diff --git a/CHANGELOG.md b/CHANGELOG.md index c57d1217..cd15cc83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # @vladmandic/human - Version: **3.2.0** + Version: **3.2.1** Description: **Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition** Author: **Vladimir Mandic ** @@ -9,11 +9,15 @@ ## Changelog -### **3.2.0** 2023/12/06 mandic00@live.com +### **3.2.1** 2024/02/15 mandic00@live.com + +### **origin/main** 2023/12/06 mandic00@live.com -### **origin/main** 2023/12/06 aug@iterative.day +### **3.2.0** 2023/12/06 mandic00@live.com + +- set browser false when navigator object is empty - https://github.com/vladmandic/human/issues/402 ### **release: 3.1.2** 2023/09/18 mandic00@live.com diff --git a/dist/human.esm-nobundle.js b/dist/human.esm-nobundle.js index 60cc769b..12ae17b4 100644 --- a/dist/human.esm-nobundle.js +++ b/dist/human.esm-nobundle.js @@ -4,7 +4,7 @@ author: ' */ -var at=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var _n=Object.getOwnPropertyNames;var $n=Object.prototype.hasOwnProperty;var eo=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t)=>{for(var n in t)at(e,n,{get:t[n],enumerable:!0})},X5=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _n(t))!$n.call(e,s)&&s!==n&&at(e,s,{get:()=>t[s],enumerable:!(r=Qn(t,s))||r.enumerable});return e},w=(e,t,n)=>(X5(e,t,"default"),n&&X5(n,t,"default"));var z=(e,t,n)=>(eo(e,typeof t!="symbol"?t+"":t,n),n),q5=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var E0=(e,t,n)=>(q5(e,t,"read from private field"),n?n.call(e):t.get(e)),q0=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Q0=(e,t,n,r)=>(q5(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var o={};oe(o,{node:()=>it,version:()=>Je});w(o,MA);w(o,PA);w(o,kA);w(o,wA);w(o,EA);w(o,zA);import*as MA from"@tensorflow/tfjs-core/dist/index.js";import*as PA from"@tensorflow/tfjs-converter/dist/index.js";import*as kA from"@tensorflow/tfjs-backend-cpu/dist/index.js";import*as wA from"@tensorflow/tfjs-backend-webgl/dist/index.js";import*as EA from"@tensorflow/tfjs-backend-wasm/dist/index.js";import*as zA from"@tensorflow/tfjs-backend-webgpu/dist/index.js";var U5="4.14.0",to="4.14.0",no="4.14.0",oo="4.14.0",ro="4.14.0",so="4.14.0",Je={tfjs:U5,"tfjs-core":U5,"tfjs-converter":to,"tfjs-backend-cpu":no,"tfjs-backend-webgl":oo,"tfjs-backend-wasm":ro,"tfjs-backend-webgpu":so},it=void 0;function b(...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)}function Y5(e,t){let n=e.endsWith("/")?"":"/",s=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${n}${t}`;if(!s.toLocaleLowerCase().includes(".json"))throw new Error(`modelpath error: expecting json file: ${s}`);return s}var R=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function lt(e,t,n="config",r=[]){for(let s of Object.keys(t))if(typeof t[s]=="object")lt(e[s],t[s],s,r);else{let A=e&&typeof e[s]!="undefined";A||r.push({reason:"unknown property",where:`${n}.${s} = ${t[s]}`});let a=e&&typeof e[s]==typeof t[s];A&&!a&&r.push({reason:"property type mismatch",where:`${n}.${s} = ${t[s]}`,expected:typeof e[s]})}return t.debug&&n==="config"&&r.length>0&&b("invalid configuration",r),r}function Q(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,r)=>(Object.keys(r||{}).forEach(s=>{let A=n[s],a=r[s];Array.isArray(A)&&Array.isArray(a)?n[s]=A.concat(...a):t(A)&&t(a)?n[s]=Q(A,a):n[s]=a}),n),{})}var Ce={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var K5=` +var at=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var _n=Object.getOwnPropertyNames;var $n=Object.prototype.hasOwnProperty;var eo=(e,t,n)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t)=>{for(var n in t)at(e,n,{get:t[n],enumerable:!0})},X5=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _n(t))!$n.call(e,s)&&s!==n&&at(e,s,{get:()=>t[s],enumerable:!(o=Qn(t,s))||o.enumerable});return e},w=(e,t,n)=>(X5(e,t,"default"),n&&X5(n,t,"default"));var z=(e,t,n)=>(eo(e,typeof t!="symbol"?t+"":t,n),n),q5=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var E0=(e,t,n)=>(q5(e,t,"read from private field"),n?n.call(e):t.get(e)),q0=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Q0=(e,t,n,o)=>(q5(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);var r={};oe(r,{node:()=>it,version:()=>Je});w(r,vA);w(r,RA);w(r,MA);w(r,PA);w(r,kA);w(r,wA);import*as vA from"@tensorflow/tfjs-core/dist/index.js";import*as RA from"@tensorflow/tfjs-converter/dist/index.js";import*as MA from"@tensorflow/tfjs-backend-cpu/dist/index.js";import*as PA from"@tensorflow/tfjs-backend-webgl/dist/index.js";import*as kA from"@tensorflow/tfjs-backend-wasm/dist/index.js";import*as wA from"@tensorflow/tfjs-backend-webgpu/dist/index.js";var U5="4.17.0",to="4.17.0",no="4.17.0",oo="4.17.0",ro="4.17.0",so="4.14.0",Je={tfjs:U5,"tfjs-core":U5,"tfjs-converter":to,"tfjs-backend-cpu":no,"tfjs-backend-webgl":oo,"tfjs-backend-wasm":ro,"tfjs-backend-webgpu":so},it=void 0;function b(...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)}function Y5(e,t){let n=e.endsWith("/")?"":"/",s=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${n}${t}`;if(!s.toLocaleLowerCase().includes(".json"))throw new Error(`modelpath error: expecting json file: ${s}`);return s}var R=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function lt(e,t,n="config",o=[]){for(let s of Object.keys(t))if(typeof t[s]=="object")lt(e[s],t[s],s,o);else{let A=e&&typeof e[s]!="undefined";A||o.push({reason:"unknown property",where:`${n}.${s} = ${t[s]}`});let a=e&&typeof e[s]==typeof t[s];A&&!a&&o.push({reason:"property type mismatch",where:`${n}.${s} = ${t[s]}`,expected:typeof e[s]})}return t.debug&&n==="config"&&o.length>0&&b("invalid configuration",o),o}function Q(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,o)=>(Object.keys(o||{}).forEach(s=>{let A=n[s],a=o[s];Array.isArray(A)&&Array.isArray(a)?n[s]=A.concat(...a):t(A)&&t(a)?n[s]=Q(A,a):n[s]=a}),n),{})}var Ce={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,scale:1.4,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,scale:2.3,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var K5=` precision highp float; attribute vec2 pos; attribute vec2 uv; @@ -96,12 +96,12 @@ var at=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var _n=Objec c31 * m[6] + c32 * m[7] + c33 * m[8]; gl_FragColor.a = c22.a; } -`;var ct=(e,t,n)=>{let r=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(r,(s,A)=>(n[A]=0,s))},dt=class{constructor(t,n,r){z(this,"uniform",{});z(this,"attribute",{});z(this,"gl");z(this,"id");z(this,"compile",(t,n)=>{let r=this.gl.createShader(n);return r?(this.gl.shaderSource(r,t),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(b(`filter: gl compile failed: ${this.gl.getShaderInfoLog(r)||"unknown"}`),null)):(b("filter: could not create shader"),null)});this.gl=t;let s=this.compile(n,this.gl.VERTEX_SHADER),A=this.compile(r,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!s||!A)){if(!this.id){b("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,s),this.gl.attachShader(this.id,A),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){b(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),ct(n,"attribute",this.attribute);for(let a in this.attribute)this.attribute[a]=this.gl.getAttribLocation(this.id,a);ct(n,"uniform",this.uniform),ct(r,"uniform",this.uniform);for(let a in this.uniform)this.uniform[a]=this.gl.getUniformLocation(this.id,a)}}};function t1(){let e=0,t=null,n=!1,r=-1,s=[null,null],A=[],a=null,i=null,c=D0(100,100),d={},y={INTERMEDIATE:1},l=c.getContext("webgl");if(!l){b("filter: cannot get webgl context");return}this.gl=l;function m(T,u){if(!(T===c.width&&u===c.height)){if(c.width=T,c.height=u,!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=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,a),l.bufferData(l.ARRAY_BUFFER,g,l.STATIC_DRAW),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}l.viewport(0,0,c.width,c.height),s=[null,null]}}function x(T,u){let g=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,g);let E=l.createRenderbuffer();l.bindRenderbuffer(l.RENDERBUFFER,E);let k=l.createTexture();return l.bindTexture(l.TEXTURE_2D,k),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,T,u,0,l.RGBA,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,k,0),l.bindTexture(l.TEXTURE_2D,null),l.bindFramebuffer(l.FRAMEBUFFER,null),{fbo:g,texture:k}}function p(T){return s[T]=s[T]||x(c.width,c.height),s[T]}function f(T=0){if(!i)return;let u=null,g=null,E=!1;e===0?u=t:u=p(r).texture||null,e++,n&&!(T&y.INTERMEDIATE)?(g=null,E=e%2===0):(r=(r+1)%2,g=p(r).fbo||null),l.bindTexture(l.TEXTURE_2D,u),l.bindFramebuffer(l.FRAMEBUFFER,g),l.uniform1f(i.uniform.flipY,E?-1:1),l.drawArrays(l.TRIANGLES,0,6)}function h(T){if(d[T])return i=d[T],l.useProgram((i?i.id:null)||null),i;if(i=new dt(l,K5,T),!i)return b("filter: could not get webgl program"),null;let u=Float32Array.BYTES_PER_ELEMENT,g=4*u;return l.enableVertexAttribArray(i.attribute.pos),l.vertexAttribPointer(i.attribute.pos,2,l.FLOAT,!1,g,0*u),l.enableVertexAttribArray(i.attribute.uv),l.vertexAttribPointer(i.attribute.uv,2,l.FLOAT,!1,g,2*u),d[T]=i,i}let v={colorMatrix:T=>{let u=new Float32Array(T);u[4]/=255,u[9]/=255,u[14]/=255,u[19]/=255;let g=u[18]===1&&u[3]===0&&u[8]===0&&u[13]===0&&u[15]===0&&u[16]===0&&u[17]===0&&u[19]===0?Q5:J5,E=h(g);E&&(l.uniform1fv(E.uniform.m,u),f())},brightness:T=>{let u=(T||0)+1;v.colorMatrix([u,0,0,0,0,0,u,0,0,0,0,0,u,0,0,0,0,0,1,0])},saturation:T=>{let u=(T||0)*2/3+1,g=(u-1)*-.5;v.colorMatrix([u,g,g,0,0,g,u,g,0,0,g,g,u,0,0,0,0,0,1,0])},desaturate:()=>{v.saturation(-1)},contrast:T=>{let u=(T||0)+1,g=-128*(u-1);v.colorMatrix([u,0,0,0,g,0,u,0,0,g,0,0,u,0,g,0,0,0,1,0])},negative:()=>{v.contrast(-2)},hue:T=>{T=(T||0)/180*Math.PI;let u=Math.cos(T),g=Math.sin(T),E=.213,k=.715,N=.072;v.colorMatrix([E+u*(1-E)+g*-E,k+u*-k+g*-k,N+u*-N+g*(1-N),0,0,E+u*-E+g*.143,k+u*(1-k)+g*.14,N+u*-N+g*-.283,0,0,E+u*-E+g*-(1-E),k+u*-k+g*k,N+u*(1-N)+g*N,0,0,0,0,0,1,0])},desaturateLuminance:()=>{v.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{v.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{v.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{v.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{v.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{v.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{v.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{v.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:T=>{let u=new Float32Array(T),g=1/c.width,E=1/c.height,k=h(e1);k&&(l.uniform1fv(k.uniform.m,u),l.uniform2f(k.uniform.px,g,E),f())},detectEdges:()=>{v.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{v.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{v.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:T=>{let u=T||1;v.convolution.call(this,[0,-1*u,0,-1*u,1+4*u,-1*u,0,-1*u,0])},emboss:T=>{let u=T||1;v.convolution.call(this,[-2*u,-1*u,0,-1*u,1,1*u,0,1*u,2*u])},blur:T=>{let u=T/7/c.width,g=T/7/c.height,E=h($5);E&&(l.uniform2f(E.uniform.px,0,g),f(y.INTERMEDIATE),l.uniform2f(E.uniform.px,u,0),f())},pixelate:T=>{let u=T/c.width,g=T/c.height,E=h(_5);E&&(l.uniform2f(E.uniform.size,u,g),f())}};this.add=function(T){let u=Array.prototype.slice.call(arguments,1),g=v[T];A.push({func:g,args:u})},this.reset=function(){A=[]},this.get=function(){return A},this.apply=function(T){m(T.width,T.height),e=0,t||(t=l.createTexture()),l.bindTexture(l.TEXTURE_2D,t),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,l.RGBA,l.UNSIGNED_BYTE,T);for(let u=0;uy.data())),a=Math.max(A[0][0],A[1][0],A[2][0]),c=(a>1?255:1)/a,d;if(c>1){let y=[o.sub(n[0],r[0]),o.sub(n[1],r[1]),o.sub(n[2],r[2])],l=[o.sub(s[0],r[0]),o.sub(s[1],r[1]),o.sub(s[2],r[2])],m=[o.mul(y[0],c),o.mul(y[1],c),o.mul(y[2],c)],x=o.stack([m[0],m[1],m[2]],2);d=o.reshape(x,[1,t.shape[0]||0,t.shape[1]||0,3]),o.dispose([...y,...l,...m,x])}else d=o.expandDims(t,0);return o.dispose([...n,...r,...s,n,t,e]),d}var x2=3840,l0=null,c0=null,We=null,X,L0={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function xt(){L0.inputSum=0,L0.cacheDiff=1,L0.sumMethod=0,L0.inputTensor=void 0}function D0(e,t){let n;if(M.browser)if(M.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof M.Canvas!="undefined")n=new M.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof M.Canvas!="undefined"?n=new M.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function y2(e,t){let n=t||D0(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function f2(e,t,n=!0){var m,x,p;if(!e)return t.debug&&b("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof o.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof o.Tensor){let f=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)f=o.expandDims(e,0);else if(e.shape[2]===4){let h=o.slice3d(e,[0,0,0],[-1,-1,3]);f=o.expandDims(h,0),o.dispose(h)}}else e.shape.length===4&&(e.shape[3]===3?f=o.clone(e):e.shape[3]===4&&(f=o.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(f==null||f.shape.length!==4||f.shape[0]!==1||f.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(f.dtype==="int32"){let h=o.cast(f,"float32");o.dispose(f),f=h}return{tensor:f,canvas:t.filter.return?c0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&b("input stream is not ready"),{tensor:null,canvas:l0};let r=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!r||!s)return t.debug&&b("cannot determine input dimensions"),{tensor:null,canvas:l0};let A=r,a=s;if(A>x2&&(A=x2,a=Math.trunc(A*s/r)),a>x2&&(a=x2,A=Math.trunc(a*r/s)),(((m=t.filter)==null?void 0:m.width)||0)>0?A=t.filter.width:(((x=t.filter)==null?void 0:x.height)||0)>0&&(A=r*((t.filter.height||0)/s)),(t.filter.height||0)>0?a=t.filter.height:(t.filter.width||0)>0&&(a=s*((t.filter.width||0)/r)),!A||!a)throw new Error("input error: cannot determine dimension");(!l0||l0.width!==A||l0.height!==a)&&(l0=D0(A,a));let i=l0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?i.putImageData(e,0,0):t.filter.flip&&typeof i.translate!="undefined"?(i.translate(r,0),i.scale(-1,1),i.drawImage(e,0,0,r,s,0,0,l0.width,l0.height),i.setTransform(1,0,0,1,0,0)):i.drawImage(e,0,0,r,s,0,0,l0.width,l0.height),(!c0||l0.width!==c0.width||l0.height!==c0.height)&&(c0=D0(l0.width,l0.height)),t.filter.enabled&&M.webgl.supported?(X||(X=M.browser?new t1:null),M.filter=!!X,X!=null&&X.add?(X.reset(),t.filter.brightness!==0&&X.add("brightness",t.filter.brightness),t.filter.contrast!==0&&X.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&X.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&X.add("blur",t.filter.blur),t.filter.saturation!==0&&X.add("saturation",t.filter.saturation),t.filter.hue!==0&&X.add("hue",t.filter.hue),t.filter.negative&&X.add("negative"),t.filter.sepia&&X.add("sepia"),t.filter.vintage&&X.add("brownie"),t.filter.sepia&&X.add("sepia"),t.filter.kodachrome&&X.add("kodachrome"),t.filter.technicolor&&X.add("technicolor"),t.filter.polaroid&&X.add("polaroid"),t.filter.pixelate!==0&&X.add("pixelate",t.filter.pixelate),((p=X.get())==null?void 0:p.length)>1?c0=X.apply(l0):c0=X.draw(l0)):(t.debug&&b("input process error: cannot initialize filters"),M.webgl.supported=!1,t.filter.enabled=!1,y2(l0,c0))):(y2(l0,c0),X&&(X=null),M.filter=!!X),!n)return{tensor:null,canvas:c0};if(!c0)throw new Error("canvas error: cannot create output");let c,d=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(M.browser&&o.browser)c=o.browser?o.browser.fromPixels(e):null;else{d=e.data.length/e.height/e.width;let f=new Uint8Array(e.data.buffer);c=o.tensor(f,[e.height,e.width,d],"int32")}else if((!We||c0.width!==We.width||c0.height!==We.height)&&(We=D0(c0.width,c0.height)),o.browser&&M.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?c=o.browser.fromPixels(c0):(We=y2(c0),c=o.browser.fromPixels(We));else{let v=y2(c0).getContext("2d").getImageData(0,0,A,a);d=v.data.length/A/a;let T=new Uint8Array(v.data.buffer);c=o.tensor(T,[A,a,d])}if(d===4){let f=o.slice3d(c,[0,0,0],[-1,-1,3]);o.dispose(c),c=f}if(!c)throw new Error("input error: cannot create tensor");let y=o.cast(c,"float32"),l=t.filter.equalization?await d2(y):o.expandDims(y,0);if(o.dispose([c,y]),t.filter.autoBrightness){let f=o.max(l),h=await f.data();t.filter.brightness=h[0]>1?1-h[0]/255:1-h[0],o.dispose(f)}return{tensor:l,canvas:t.filter.return?c0:null}}async function n1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!L0.inputTensor)L0.inputTensor=o.clone(t);else if(L0.inputTensor.shape[1]!==t.shape[1]||L0.inputTensor.shape[2]!==t.shape[2])o.dispose(L0.inputTensor),L0.inputTensor=o.clone(t);else{let r={};r.diff=o.sub(t,L0.inputTensor),r.squared=o.mul(r.diff,r.diff),r.sum=o.sum(r.squared);let A=(await r.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;o.dispose([L0.inputTensor,r.diff,r.squared,r.sum]),L0.inputTensor=o.clone(t),n=A<=(e.cacheSensitivity||0)}return n}async function o1(e,t,n){let r={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||b("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||b("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;r.input1=o.clone(t),r.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?o.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):o.clone(n),r.diff=o.sub(r.input1,r.input2),r.squared=o.mul(r.diff,r.diff),r.sum=o.sum(r.squared);let A=(await r.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return o.dispose([r.input1,r.input2,r.diff,r.squared,r.sum]),A}var Qe,_e,$e,p2=class{constructor(){z(this,"browser");z(this,"node");z(this,"worker");z(this,"platform","");z(this,"agent","");z(this,"backends",[]);z(this,"initial");z(this,"filter");z(this,"tfjs");z(this,"offscreen");z(this,"perfadd",!1);z(this,"tensorflow",{version:void 0,gpu:void 0});z(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});z(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});z(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});z(this,"cpu",{model:void 0,flags:[]});z(this,"kernels",[]);q0(this,Qe,void 0);q0(this,_e,void 0);q0(this,$e,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:Je["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let r=n[0].match(/\(([^()]+)\)/g);this.platform=r!=null&&r[0]?r[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return E0(this,Qe)}set Canvas(t){Q0(this,Qe,t),globalThis.Canvas=t}get Image(){return E0(this,_e)}set Image(t){Q0(this,_e,t),globalThis.Image=t}get ImageData(){return E0(this,$e)}set ImageData(t){Q0(this,$e,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(o.engine().registryFactory);try{this.tensorflow={version:o.backend().binding?o.backend().binding.TF_Version:void 0,gpu:o.backend().binding?o.backend().binding.isUsingGpuDevice():void 0}}catch(r){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await o.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await o.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=D0(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let r=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(r==null?void 0:r.requestAdapterInfo())}}catch(r){this.webgpu.supported=!1}try{this.kernels=o.getKernelsForBackend(o.getBackend()).map(r=>r.kernelName.toLowerCase())}catch(r){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};Qe=new WeakMap,_e=new WeakMap,$e=new WeakMap;var M=new p2;var u2=class{constructor(){z(this,"config");z(this,"element");z(this,"stream");z(this,"devices",[]);z(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});z(this,"start",async t=>{var s,A;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let a=document.getElementById(t.element);if(a&&a instanceof HTMLVideoElement)this.element=a;else return this.config.debug&&b("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&b("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((s=this.config)==null?void 0:s.width)>0&&(n.video.width={ideal:this.config.width}),((A=this.config)==null?void 0:A.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&b("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&b("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&b("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(a){return b("webcam",a),`webcam error: ${a}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(a=>{this.element?this.element.onloadeddata=()=>a(!0):a(!1)}),await this.element.play(),this.config.debug&&b("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&b("webcam error","no stream"),"webcam error no stream")});z(this,"pause",()=>{this.element&&this.element.pause()});z(this,"play",async()=>{this.element&&await this.element.play()});z(this,"stop",()=>{this.config.debug&&b("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var yt={};oe(yt,{"affectnet-mobilenet":()=>vo,age:()=>Ro,"anti-spoofing":()=>tr,antispoof:()=>lo,blazeface:()=>co,"blazeface-back":()=>Mo,"blazeface-front":()=>Po,"blazepose-detector":()=>ko,"blazepose-full":()=>wo,"blazepose-heavy":()=>Eo,"blazepose-lite":()=>zo,centernet:()=>xo,default:()=>fr,efficientpose:()=>So,"efficientpose-i-lite":()=>nr,"efficientpose-ii-lite":()=>or,"efficientpose-iv":()=>rr,emotion:()=>yo,faceboxes:()=>jo,facemesh:()=>fo,"facemesh-attention":()=>No,"facemesh-attention-pinto":()=>Io,"facemesh-detection-full":()=>Lo,"facemesh-detection-short":()=>Oo,faceres:()=>mo,"faceres-deep":()=>Co,gear:()=>Fo,"gear-e1":()=>Wo,"gear-e2":()=>Do,gender:()=>Ho,"gender-ssrnet-imdb":()=>Bo,handdetect:()=>Go,"handlandmark-full":()=>Vo,"handlandmark-lite":()=>po,"handlandmark-sparse":()=>Zo,handskeleton:()=>Xo,handtrack:()=>uo,"insightface-efficientnet-b0":()=>sr,"insightface-ghostnet-strides1":()=>Ar,"insightface-ghostnet-strides2":()=>ar,"insightface-mobilenet-emore":()=>ir,"insightface-mobilenet-swish":()=>lr,iris:()=>ho,liveness:()=>bo,meet:()=>qo,mobileface:()=>Uo,mobilefacenet:()=>Yo,models:()=>go,"movenet-lightning":()=>To,"movenet-multipose":()=>Ko,"movenet-thunder":()=>Jo,nanodet:()=>Qo,"nanodet-e":()=>cr,"nanodet-g":()=>dr,"nanodet-m":()=>xr,"nanodet-t":()=>yr,posenet:()=>_o,rvm:()=>$o,selfie:()=>er});var lo=853098,co=538928,xo=4030290,yo=820516,fo=1477958,mo=6978814,po=2023432,uo=2964837,ho=2599092,bo=592976,go=0,To=4650216,vo=6920630,Ro=161240,Mo=538928,Po=402048,ko=5928856,wo=6339202,Eo=27502466,zo=2726402,So=5651240,jo=2013002,Io=2387598,No=2382414,Lo=1026192,Oo=201268,Co=13957620,Wo=112438,Do=112438,Fo=1498916,Bo=161236,Ho=201808,Go=3515612,Vo=5431368,Zo=5286322,Xo=5502280,qo=372228,Uo=2183192,Yo=5171976,Ko=9448838,Jo=12477112,Qo=7574558,_o=5032780,$o=3739355,er=212886,tr=853098,nr=2269064,or=5651240,rr=25643252,sr=13013224,Ar=8093408,ar=8049584,ir=6938536,lr=12168584,cr=12319156,dr=7574558,xr=1887474,yr=5294216,fr={antispoof:lo,blazeface:co,centernet:xo,emotion:yo,facemesh:fo,faceres:mo,"handlandmark-lite":po,handtrack:uo,iris:ho,liveness:bo,models:go,"movenet-lightning":To,"affectnet-mobilenet":vo,age:Ro,"blazeface-back":Mo,"blazeface-front":Po,"blazepose-detector":ko,"blazepose-full":wo,"blazepose-heavy":Eo,"blazepose-lite":zo,efficientpose:So,faceboxes:jo,"facemesh-attention-pinto":Io,"facemesh-attention":No,"facemesh-detection-full":Lo,"facemesh-detection-short":Oo,"faceres-deep":Co,"gear-e1":Wo,"gear-e2":Do,gear:Fo,"gender-ssrnet-imdb":Bo,gender:Ho,handdetect:Go,"handlandmark-full":Vo,"handlandmark-sparse":Zo,handskeleton:Xo,meet:qo,mobileface:Uo,mobilefacenet:Yo,"movenet-multipose":Ko,"movenet-thunder":Jo,nanodet:Qo,posenet:_o,rvm:$o,selfie:er,"anti-spoofing":tr,"efficientpose-i-lite":nr,"efficientpose-ii-lite":or,"efficientpose-iv":rr,"insightface-efficientnet-b0":sr,"insightface-ghostnet-strides1":Ar,"insightface-ghostnet-strides2":ar,"insightface-mobilenet-emore":ir,"insightface-mobilenet-swish":lr,"nanodet-e":cr,"nanodet-g":dr,"nanodet-m":xr,"nanodet-t":yr};var T0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},p0={};async function mr(e,t){return T0.debug&&b("load model fetch:",e,t),fetch(e,t)}function r1(e){T0.cacheModels=e.cacheModels,T0.verbose=e.debug,T0.modelBasePath=e.modelBasePath}async function L(e){var d,y,l,m;let t=Y5(T0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),r=n[n.length-1].replace(".json",""),s="indexeddb://"+r;p0[r]={name:r,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:yt[r],inCache:!1,url:""},T0.cacheSupported=typeof indexedDB!="undefined";let A={};try{A=T0.cacheSupported&&T0.cacheModels?await o.io.listModels():{}}catch(x){T0.cacheSupported=!1}p0[r].inCache=T0.cacheSupported&&T0.cacheModels&&Object.keys(A).includes(s),p0[r].url=p0[r].inCache?s:t;let a=typeof fetch=="undefined"?{}:{fetchFunc:(x,p)=>mr(x,p)},i=new o.GraphModel(p0[r].url,a),c=!1;try{i.findIOHandler(),T0.debug&&b("model load handler:",i.handler)}catch(x){b("error finding model i/o handler:",t,x)}try{let x=await((d=i.handler)==null?void 0:d.load())||null;p0[r].sizeFromManifest=((y=x==null?void 0:x.weightData)==null?void 0:y.byteLength)||0,x?i.loadSync(x):i=await o.loadGraphModel(p0[r].inCache?s:t,a),p0[r].sizeLoadedWeights=((m=(l=i.artifacts)==null?void 0:l.weightData)==null?void 0:m.byteLength)||0,T0.verbose&&b("load:",{model:r,url:i.modelUrl,bytes:p0[r].sizeLoadedWeights}),c=!0}catch(x){b("error loading model:",t,x)}if(c&&T0.cacheModels&&T0.cacheSupported&&!p0[r].inCache)try{let x=await i.save(s);T0.debug&&b("model saved:",s,x)}catch(x){b("error saving model:",t,x)}return i}var ft="3.2.0";var Y={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function hr(){let e=Y.gl;e&&(Y.extensions=e.getSupportedExtensions())}function s1(e){var t;if(e.config.backend==="humangl"&&(Y.name in o.engine().registry&&!((t=Y==null?void 0:Y.gl)!=null&&t.getParameter(Y.gl.VERSION))&&(b("humangl error: backend invalid context"),e.models.reset()),!o.findBackend(Y.name))){try{Y.canvas=D0(100,100)}catch(s){b("humangl error: cannot create canvas:",s);return}try{if(Y.gl=Y.canvas.getContext("webgl2",Y.webGLattr),!Y.gl){b("humangl error: cannot get webgl context");return}if(!Y.gl.getParameter(Y.gl.VERSION).includes("2.0")){b("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}Y.canvas&&(Y.canvas.addEventListener("webglcontextlost",A=>{throw b("humangl error:",A.type),b("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),Y.canvas.addEventListener("webglcontextrestored",A=>{b("humangl error: context restored:",A)}),Y.canvas.addEventListener("webglcontextcreationerror",A=>{b("humangl error: context create:",A)}))}catch(s){b("humangl error: cannot get webgl context:",s);return}try{o.setWebGLContext(2,Y.gl)}catch(s){b("humangl error: cannot set webgl context:",s);return}try{let s=new o.GPGPUContext(Y.gl);o.registerBackend(Y.name,()=>new o.MathBackendWebGL(s),Y.priority)}catch(s){b("humangl error: cannot register webgl backend:",s);return}try{o.getKernelsForBackend("webgl").forEach(A=>{let a={...A,backendName:Y.name};o.registerKernel(a)})}catch(s){b("humangl error: cannot update webgl backend registration:",s);return}try{o.env().flagRegistry.WEBGL_VERSION&&o.env().set("WEBGL_VERSION",2)}catch(s){b("humangl error: cannot set WebGL backend flags:",s);return}hr();let n=o.backend(),r=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;r?e.config.debug&&b("humangl backend registered:",{webgl:r.getParameter(r.VERSION),renderer:r.getParameter(r.RENDERER)}):b("humangl error: no current gl context:",r,Y.gl)}}var O={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function A1(){O.tf255=o.scalar(255,"float32"),O.tf1=o.scalar(1,"float32"),O.tf2=o.scalar(2,"float32"),O.tf05=o.scalar(.5,"float32"),O.tf127=o.scalar(127.5,"float32"),O.rgb=o.tensor1d([.2989,.587,.114],"float32")}async function Tr(){var e;return await M.updateBackend(),(e=M.tensorflow)!=null&&e.version?"tensorflow":M.webgpu.supported&&M.webgpu.backend?"webgpu":M.webgl.supported&&M.webgl.backend?"webgl":M.wasm.supported&&M.wasm.backend?"wasm":"cpu"}function vr(e){let t=[];if(!M.kernels.includes("mod")){let n={kernelName:"Mod",backendName:o.getBackend(),kernelFunc:r=>o.tidy(()=>o.sub(r.inputs.a,o.mul(o.div(r.inputs.a,r.inputs.b),r.inputs.b)))};o.registerKernel(n),M.kernels.push("mod"),t.push("mod")}if(!M.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:o.getBackend(),kernelFunc:r=>o.tidy(()=>o.add(o.mul(o.floorDiv(r.inputs.a,r.inputs.b),r.inputs.b),o.mod(r.inputs.a,r.inputs.b)))};o.registerKernel(n),M.kernels.push("floormod"),t.push("floormod")}if(!M.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:o.getBackend(),kernelFunc:r=>o.tidy(()=>{let s=o.getBackend();o.setBackend("cpu");let A=o.image.rotateWithOffset(r.inputs.image,r.attrs.radians,r.attrs.fillValue,r.attrs.center);return o.setBackend(s),A})};o.registerKernel(n),M.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&b("registered kernels:",t)}var a1={};async function e2(e,t=!1){var n,r;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await Tr()),t||M.initial||e.config.backend&&e.config.backend.length>0&&o.getBackend()!==e.config.backend){let s=R();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&b("running inside web worker"),typeof navigator!="undefined"&&((r=navigator==null?void 0:navigator.userAgent)!=null&&r.toLowerCase().includes("electron"))&&e.config.debug&&b("running inside electron");let A=Object.keys(o.engine().registryFactory);if(e.config.backend==="humangl"&&!A.includes("humangl")&&(s1(e),A=Object.keys(o.engine().registryFactory)),e.config.debug&&b("available backends:",A),M.browser&&!M.node&&e.config.backend==="tensorflow"&&A.includes("webgl")&&(e.config.debug&&b("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),M.node&&!M.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&A.includes("tensorflow")&&(e.config.debug&&b(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),M.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")b("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let a=await navigator.gpu.requestAdapter();if(e.config.debug&&b("enumerated webgpu adapter:",a),!a)b("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let i="requestAdapterInfo"in a?await a.requestAdapterInfo():void 0;b("webgpu adapter info:",i)}}if(A.includes(e.config.backend)||(b(`error: backend ${e.config.backend} not found in registry`),e.config.backend=M.node?"tensorflow":"webgl",e.config.debug&&b(`override: setting backend ${e.config.backend}`)),e.config.debug&&b("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(o.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&o.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&b("wasm path:",e.config.wasmPath),typeof o.setWasmPaths!="undefined")o.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let a=!1,i=!1;try{a=await o.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),i=await o.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&b(`wasm execution: ${i?"simd":"no simd"} ${a?"multithreaded":"singlethreaded"}`),e.config.debug&&!i&&b("warning: wasm simd support is not enabled")}catch(c){b("wasm detection failed")}}try{await o.setBackend(e.config.backend),await o.ready()}catch(a){return b("error: cannot set backend:",e.config.backend,a),!1}e.config.debug&&(a1=JSON.parse(JSON.stringify(o.env().flags)))}if((o.getBackend()==="humangl"||o.getBackend()==="webgl")&&(o.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&o.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),o.env().flagRegistry.WEBGL_EXP_CONV&&o.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(b("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),o.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),o.getBackend(),e.config.debug){let A=o.env().flags,a={};for(let i of Object.keys(A))a1[i]!==A[i]&&(a[i]=A[i]);e.config.debug&&Object.keys(a).length>0&&b("backend:",o.getBackend(),"flags:",a)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&b("flags:",e.config.flags);for(let[A,a]of Object.entries(e.config.flags))o.env().set(A,a)}o.enableProdMode(),A1(),e.performance.initBackend=Math.trunc(R()-s),e.config.backend=o.getBackend(),await M.updateBackend(),vr(e.config)}return!0}function h2(e,t){for(let n of e){let r={kernelName:n,backendName:t.backend,kernelFunc:s=>{var A;return t.debug&&b("kernelFunc",n,t.backend,s),(A=s==null?void 0:s.inputs)==null?void 0:A.info}};o.registerKernel(r)}M.kernels=o.getKernelsForBackend(o.getBackend()).map(n=>n.kernelName.toLowerCase())}var vt={};oe(vt,{all:()=>$r,body:()=>g2,canvas:()=>_r,face:()=>b2,gesture:()=>R2,hand:()=>T2,init:()=>Tt,object:()=>v2,options:()=>n0,person:()=>Qr});var O0=e=>{if(!e)b("draw error: invalid canvas");else if(!e.getContext)b("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)b("draw error: cannot get canvas context");else return t}return null},ge=e=>Math.round(e*180/Math.PI),H=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Te=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function C0(e,t,n,r,s){let A=t.replace(/\[.*\]/g,"").split(` -`).map(i=>i.trim()),a=Math.max(0,n);for(let i=A.length-1;i>=0;i--){let c=i*s.lineHeight+r;s.shadowColor&&s.shadowColor!==""&&(e.fillStyle=s.shadowColor,e.fillText(A[i],a+5,c+16)),e.fillStyle=s.labelColor,e.fillText(A[i],a+4,c+15)}}function U0(e,t,n,r,s){e.fillStyle=Te(r,s),e.beginPath(),e.arc(t,n,s.pointSize,0,2*Math.PI),e.fill()}function Y0(e,t,n,r,s,A){if(e.beginPath(),e.lineWidth=A.lineWidth,A.useCurves){let a=(t+t+r)/2,i=(n+n+s)/2;e.ellipse(a,i,r/2,s/2,0,0,2*Math.PI)}else e.moveTo(t+A.roundRect,n),e.lineTo(t+r-A.roundRect,n),e.quadraticCurveTo(t+r,n,t+r,n+A.roundRect),e.lineTo(t+r,n+s-A.roundRect),e.quadraticCurveTo(t+r,n+s,t+r-A.roundRect,n+s),e.lineTo(t+A.roundRect,n+s),e.quadraticCurveTo(t,n+s,t,n+s-A.roundRect),e.lineTo(t,n+A.roundRect),e.quadraticCurveTo(t,n,t+A.roundRect,n),e.closePath();e.stroke()}function mt(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let r of t)e.strokeStyle=Te(r[2]||0,n),e.lineTo(Math.trunc(r[0]),Math.trunc(r[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function l1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){mt(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let r=0;rt2[e]),QA=Mr.map(e=>t2[e]),_A=Pr.map(e=>t2[e]);function re(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var kr=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],wr=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Er=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],zr=[[474,475],[475,476],[476,477],[477,474]],Sr=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],jr=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ir=[[469,470],[470,471],[471,472],[472,469]],Nr=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],$A={lips:re(kr),leftEye:re(wr),leftEyebrow:re(Er),leftIris:re(zr),rightEye:re(Sr),rightEyebrow:re(jr),rightIris:re(Ir),faceOval:re(Nr)};var Lr=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Or=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Cr=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Wr=[[474,475],[475,476],[476,477],[477,474]],Dr=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Fr=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Br=[[469,470],[470,471],[471,472],[472,469]],Hr=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function se(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Gr={lips:se(Lr),leftEye:se(Or),leftEyebrow:se(Cr),leftIris:se(Wr),rightEye:se(Dr),rightEyebrow:se(Fr),rightIris:se(Br),faceOval:se(Hr)},Vr=Object.entries(Gr).map(([e,t])=>t.map(n=>[n,e])).flat(),ea=new Map(Vr),n2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],Me=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],Pe=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var B;function Zr(e,t){var r,s,A,a,i,c,d,y,l;if(!B.drawLabels||((r=B.faceLabels)==null?void 0:r.length)===0)return;let n=B.faceLabels.slice();if(n=H(n,"[id]",e.id.toFixed(0)),e.score&&(n=H(n,"[score]",100*e.score)),e.gender&&(n=H(n,"[gender]",e.gender)),e.genderScore&&(n=H(n,"[genderScore]",100*e.genderScore)),e.age&&(n=H(n,"[age]",e.age)),e.distance&&(n=H(n,"[distance]",100*e.distance)),e.real&&(n=H(n,"[real]",100*e.real)),e.live&&(n=H(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let m=e.emotion.map(x=>`${Math.trunc(100*x.score)}% ${x.emotion}`);m.length>3&&(m.length=3),n=H(n,"[emotions]",m.join(" "))}(A=(s=e.rotation)==null?void 0:s.angle)!=null&&A.roll&&(n=H(n,"[roll]",ge(e.rotation.angle.roll))),(i=(a=e.rotation)==null?void 0:a.angle)!=null&&i.yaw&&(n=H(n,"[yaw]",ge(e.rotation.angle.yaw))),(d=(c=e.rotation)==null?void 0:c.angle)!=null&&d.pitch&&(n=H(n,"[pitch]",ge(e.rotation.angle.pitch))),(l=(y=e.rotation)==null?void 0:y.gaze)!=null&&l.bearing&&(n=H(n,"[gaze]",ge(e.rotation.gaze.bearing))),C0(t,n,e.box[0],e.box[1],B)}function Xr(e,t){var n,r,s,A;if((n=e.annotations)!=null&&n.leftEyeIris&&((r=e.annotations)!=null&&r.leftEyeIris[0])){t.strokeStyle=B.useDepth?"rgba(255, 200, 255, 0.3)":B.color,t.beginPath();let a=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,i=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],a,i,0,0,2*Math.PI),t.stroke(),B.fillPolygons&&(t.fillStyle=B.useDepth?"rgba(255, 255, 200, 0.3)":B.color,t.fill())}if((s=e.annotations)!=null&&s.rightEyeIris&&((A=e.annotations)!=null&&A.rightEyeIris[0])){t.strokeStyle=B.useDepth?"rgba(255, 200, 255, 0.3)":B.color,t.beginPath();let a=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,i=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],a,i,0,0,2*Math.PI),t.stroke(),B.fillPolygons&&(t.fillStyle=B.useDepth?"rgba(255, 255, 200, 0.3)":B.color,t.fill())}}function qr(e,t){var n;if(B.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let r=e.box[0]+e.box[2]/2-e.box[3]*ge(e.rotation.angle.yaw)/90,s=e.box[1]+e.box[3]/2+e.box[2]*ge(e.rotation.angle.pitch)/90,A=new Path2D(` +`;var ct=(e,t,n)=>{let o=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(o,(s,A)=>(n[A]=0,s))},dt=class{constructor(t,n,o){z(this,"uniform",{});z(this,"attribute",{});z(this,"gl");z(this,"id");z(this,"compile",(t,n)=>{let o=this.gl.createShader(n);return o?(this.gl.shaderSource(o,t),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS)?o:(b(`filter: gl compile failed: ${this.gl.getShaderInfoLog(o)||"unknown"}`),null)):(b("filter: could not create shader"),null)});this.gl=t;let s=this.compile(n,this.gl.VERTEX_SHADER),A=this.compile(o,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!s||!A)){if(!this.id){b("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,s),this.gl.attachShader(this.id,A),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){b(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),ct(n,"attribute",this.attribute);for(let a in this.attribute)this.attribute[a]=this.gl.getAttribLocation(this.id,a);ct(n,"uniform",this.uniform),ct(o,"uniform",this.uniform);for(let a in this.uniform)this.uniform[a]=this.gl.getUniformLocation(this.id,a)}}};function t1(){let e=0,t=null,n=!1,o=-1,s=[null,null],A=[],a=null,i=null,c=D0(100,100),d={},y={INTERMEDIATE:1},l=c.getContext("webgl");if(!l){b("filter: cannot get webgl context");return}this.gl=l;function f(v,u){if(!(v===c.width&&u===c.height)){if(c.width=v,c.height=u,!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=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,a),l.bufferData(l.ARRAY_BUFFER,g,l.STATIC_DRAW),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}l.viewport(0,0,c.width,c.height),s=[null,null]}}function x(v,u){let g=l.createFramebuffer();l.bindFramebuffer(l.FRAMEBUFFER,g);let E=l.createRenderbuffer();l.bindRenderbuffer(l.RENDERBUFFER,E);let k=l.createTexture();return l.bindTexture(l.TEXTURE_2D,k),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,v,u,0,l.RGBA,l.UNSIGNED_BYTE,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.LINEAR),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,k,0),l.bindTexture(l.TEXTURE_2D,null),l.bindFramebuffer(l.FRAMEBUFFER,null),{fbo:g,texture:k}}function p(v){return s[v]=s[v]||x(c.width,c.height),s[v]}function m(v=0){if(!i)return;let u=null,g=null,E=!1;e===0?u=t:u=p(o).texture||null,e++,n&&!(v&y.INTERMEDIATE)?(g=null,E=e%2===0):(o=(o+1)%2,g=p(o).fbo||null),l.bindTexture(l.TEXTURE_2D,u),l.bindFramebuffer(l.FRAMEBUFFER,g),l.uniform1f(i.uniform.flipY,E?-1:1),l.drawArrays(l.TRIANGLES,0,6)}function h(v){if(d[v])return i=d[v],l.useProgram((i?i.id:null)||null),i;if(i=new dt(l,K5,v),!i)return b("filter: could not get webgl program"),null;let u=Float32Array.BYTES_PER_ELEMENT,g=4*u;return l.enableVertexAttribArray(i.attribute.pos),l.vertexAttribPointer(i.attribute.pos,2,l.FLOAT,!1,g,0*u),l.enableVertexAttribArray(i.attribute.uv),l.vertexAttribPointer(i.attribute.uv,2,l.FLOAT,!1,g,2*u),d[v]=i,i}let T={colorMatrix:v=>{let u=new Float32Array(v);u[4]/=255,u[9]/=255,u[14]/=255,u[19]/=255;let g=u[18]===1&&u[3]===0&&u[8]===0&&u[13]===0&&u[15]===0&&u[16]===0&&u[17]===0&&u[19]===0?Q5:J5,E=h(g);E&&(l.uniform1fv(E.uniform.m,u),m())},brightness:v=>{let u=(v||0)+1;T.colorMatrix([u,0,0,0,0,0,u,0,0,0,0,0,u,0,0,0,0,0,1,0])},saturation:v=>{let u=(v||0)*2/3+1,g=(u-1)*-.5;T.colorMatrix([u,g,g,0,0,g,u,g,0,0,g,g,u,0,0,0,0,0,1,0])},desaturate:()=>{T.saturation(-1)},contrast:v=>{let u=(v||0)+1,g=-128*(u-1);T.colorMatrix([u,0,0,0,g,0,u,0,0,g,0,0,u,0,g,0,0,0,1,0])},negative:()=>{T.contrast(-2)},hue:v=>{v=(v||0)/180*Math.PI;let u=Math.cos(v),g=Math.sin(v),E=.213,k=.715,N=.072;T.colorMatrix([E+u*(1-E)+g*-E,k+u*-k+g*-k,N+u*-N+g*(1-N),0,0,E+u*-E+g*.143,k+u*(1-k)+g*.14,N+u*-N+g*-.283,0,0,E+u*-E+g*-(1-E),k+u*-k+g*k,N+u*(1-N)+g*N,0,0,0,0,0,1,0])},desaturateLuminance:()=>{T.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{T.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{T.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{T.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{T.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{T.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{T.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{T.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:v=>{let u=new Float32Array(v),g=1/c.width,E=1/c.height,k=h(e1);k&&(l.uniform1fv(k.uniform.m,u),l.uniform2f(k.uniform.px,g,E),m())},detectEdges:()=>{T.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{T.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{T.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:v=>{let u=v||1;T.convolution.call(this,[0,-1*u,0,-1*u,1+4*u,-1*u,0,-1*u,0])},emboss:v=>{let u=v||1;T.convolution.call(this,[-2*u,-1*u,0,-1*u,1,1*u,0,1*u,2*u])},blur:v=>{let u=v/7/c.width,g=v/7/c.height,E=h($5);E&&(l.uniform2f(E.uniform.px,0,g),m(y.INTERMEDIATE),l.uniform2f(E.uniform.px,u,0),m())},pixelate:v=>{let u=v/c.width,g=v/c.height,E=h(_5);E&&(l.uniform2f(E.uniform.size,u,g),m())}};this.add=function(v){let u=Array.prototype.slice.call(arguments,1),g=T[v];A.push({func:g,args:u})},this.reset=function(){A=[]},this.get=function(){return A},this.apply=function(v){f(v.width,v.height),e=0,t||(t=l.createTexture()),l.bindTexture(l.TEXTURE_2D,t),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,l.RGBA,l.UNSIGNED_BYTE,v);for(let u=0;uy.data())),a=Math.max(A[0][0],A[1][0],A[2][0]),c=(a>1?255:1)/a,d;if(c>1){let y=[r.sub(n[0],o[0]),r.sub(n[1],o[1]),r.sub(n[2],o[2])],l=[r.sub(s[0],o[0]),r.sub(s[1],o[1]),r.sub(s[2],o[2])],f=[r.mul(y[0],c),r.mul(y[1],c),r.mul(y[2],c)],x=r.stack([f[0],f[1],f[2]],2);d=r.reshape(x,[1,t.shape[0]||0,t.shape[1]||0,3]),r.dispose([...y,...l,...f,x])}else d=r.expandDims(t,0);return r.dispose([...n,...o,...s,n,t,e]),d}var x2=3840,l0=null,c0=null,We=null,X,L0={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function xt(){L0.inputSum=0,L0.cacheDiff=1,L0.sumMethod=0,L0.inputTensor=void 0}function D0(e,t){let n;if(M.browser)if(M.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof M.Canvas!="undefined")n=new M.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof M.Canvas!="undefined"?n=new M.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function y2(e,t){let n=t||D0(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function f2(e,t,n=!0){var f,x,p;if(!e)return t.debug&&b("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof r.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof r.Tensor){let m=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)m=r.expandDims(e,0);else if(e.shape[2]===4){let h=r.slice3d(e,[0,0,0],[-1,-1,3]);m=r.expandDims(h,0),r.dispose(h)}}else e.shape.length===4&&(e.shape[3]===3?m=r.clone(e):e.shape[3]===4&&(m=r.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(m==null||m.shape.length!==4||m.shape[0]!==1||m.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(m.dtype==="int32"){let h=r.cast(m,"float32");r.dispose(m),m=h}return{tensor:m,canvas:t.filter.return?c0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&b("input stream is not ready"),{tensor:null,canvas:l0};let o=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,s=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!o||!s)return t.debug&&b("cannot determine input dimensions"),{tensor:null,canvas:l0};let A=o,a=s;if(A>x2&&(A=x2,a=Math.trunc(A*s/o)),a>x2&&(a=x2,A=Math.trunc(a*o/s)),(((f=t.filter)==null?void 0:f.width)||0)>0?A=t.filter.width:(((x=t.filter)==null?void 0:x.height)||0)>0&&(A=o*((t.filter.height||0)/s)),(t.filter.height||0)>0?a=t.filter.height:(t.filter.width||0)>0&&(a=s*((t.filter.width||0)/o)),!A||!a)throw new Error("input error: cannot determine dimension");(!l0||l0.width!==A||l0.height!==a)&&(l0=D0(A,a));let i=l0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?i.putImageData(e,0,0):t.filter.flip&&typeof i.translate!="undefined"?(i.translate(o,0),i.scale(-1,1),i.drawImage(e,0,0,o,s,0,0,l0.width,l0.height),i.setTransform(1,0,0,1,0,0)):i.drawImage(e,0,0,o,s,0,0,l0.width,l0.height),(!c0||l0.width!==c0.width||l0.height!==c0.height)&&(c0=D0(l0.width,l0.height)),t.filter.enabled&&M.webgl.supported?(X||(X=M.browser?new t1:null),M.filter=!!X,X!=null&&X.add?(X.reset(),t.filter.brightness!==0&&X.add("brightness",t.filter.brightness),t.filter.contrast!==0&&X.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&X.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&X.add("blur",t.filter.blur),t.filter.saturation!==0&&X.add("saturation",t.filter.saturation),t.filter.hue!==0&&X.add("hue",t.filter.hue),t.filter.negative&&X.add("negative"),t.filter.sepia&&X.add("sepia"),t.filter.vintage&&X.add("brownie"),t.filter.sepia&&X.add("sepia"),t.filter.kodachrome&&X.add("kodachrome"),t.filter.technicolor&&X.add("technicolor"),t.filter.polaroid&&X.add("polaroid"),t.filter.pixelate!==0&&X.add("pixelate",t.filter.pixelate),((p=X.get())==null?void 0:p.length)>1?c0=X.apply(l0):c0=X.draw(l0)):(t.debug&&b("input process error: cannot initialize filters"),M.webgl.supported=!1,t.filter.enabled=!1,y2(l0,c0))):(y2(l0,c0),X&&(X=null),M.filter=!!X),!n)return{tensor:null,canvas:c0};if(!c0)throw new Error("canvas error: cannot create output");let c,d=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(M.browser&&r.browser)c=r.browser?r.browser.fromPixels(e):null;else{d=e.data.length/e.height/e.width;let m=new Uint8Array(e.data.buffer);c=r.tensor(m,[e.height,e.width,d],"int32")}else if((!We||c0.width!==We.width||c0.height!==We.height)&&(We=D0(c0.width,c0.height)),r.browser&&M.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?c=r.browser.fromPixels(c0):(We=y2(c0),c=r.browser.fromPixels(We));else{let T=y2(c0).getContext("2d").getImageData(0,0,A,a);d=T.data.length/A/a;let v=new Uint8Array(T.data.buffer);c=r.tensor(v,[A,a,d])}if(d===4){let m=r.slice3d(c,[0,0,0],[-1,-1,3]);r.dispose(c),c=m}if(!c)throw new Error("input error: cannot create tensor");let y=r.cast(c,"float32"),l=t.filter.equalization?await d2(y):r.expandDims(y,0);if(r.dispose([c,y]),t.filter.autoBrightness){let m=r.max(l),h=await m.data();t.filter.brightness=h[0]>1?1-h[0]/255:1-h[0],r.dispose(m)}return{tensor:l,canvas:t.filter.return?c0:null}}async function n1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!L0.inputTensor)L0.inputTensor=r.clone(t);else if(L0.inputTensor.shape[1]!==t.shape[1]||L0.inputTensor.shape[2]!==t.shape[2])r.dispose(L0.inputTensor),L0.inputTensor=r.clone(t);else{let o={};o.diff=r.sub(t,L0.inputTensor),o.squared=r.mul(o.diff,o.diff),o.sum=r.sum(o.squared);let A=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;r.dispose([L0.inputTensor,o.diff,o.squared,o.sum]),L0.inputTensor=r.clone(t),n=A<=(e.cacheSensitivity||0)}return n}async function o1(e,t,n){let o={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||b("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||b("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;o.input1=r.clone(t),o.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?r.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):r.clone(n),o.diff=r.sub(o.input1,o.input2),o.squared=r.mul(o.diff,o.diff),o.sum=r.sum(o.squared);let A=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return r.dispose([o.input1,o.input2,o.diff,o.squared,o.sum]),A}var Qe,_e,$e,p2=class{constructor(){z(this,"browser");z(this,"node");z(this,"worker");z(this,"platform","");z(this,"agent","");z(this,"backends",[]);z(this,"initial");z(this,"filter");z(this,"tfjs");z(this,"offscreen");z(this,"perfadd",!1);z(this,"tensorflow",{version:void 0,gpu:void 0});z(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});z(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});z(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});z(this,"cpu",{model:void 0,flags:[]});z(this,"kernels",[]);q0(this,Qe,void 0);q0(this,_e,void 0);q0(this,$e,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:Je["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let o=n[0].match(/\(([^()]+)\)/g);this.platform=o!=null&&o[0]?o[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return E0(this,Qe)}set Canvas(t){Q0(this,Qe,t),globalThis.Canvas=t}get Image(){return E0(this,_e)}set Image(t){Q0(this,_e,t),globalThis.Image=t}get ImageData(){return E0(this,$e)}set ImageData(t){Q0(this,$e,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(r.engine().registryFactory);try{this.tensorflow={version:r.backend().binding?r.backend().binding.TF_Version:void 0,gpu:r.backend().binding?r.backend().binding.isUsingGpuDevice():void 0}}catch(o){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await r.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await r.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=D0(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let o=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(o==null?void 0:o.requestAdapterInfo())}}catch(o){this.webgpu.supported=!1}try{this.kernels=r.getKernelsForBackend(r.getBackend()).map(o=>o.kernelName.toLowerCase())}catch(o){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};Qe=new WeakMap,_e=new WeakMap,$e=new WeakMap;var M=new p2;var u2=class{constructor(){z(this,"config");z(this,"element");z(this,"stream");z(this,"devices",[]);z(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});z(this,"start",async t=>{var s,A;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let a=document.getElementById(t.element);if(a&&a instanceof HTMLVideoElement)this.element=a;else return this.config.debug&&b("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&b("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((s=this.config)==null?void 0:s.width)>0&&(n.video.width={ideal:this.config.width}),((A=this.config)==null?void 0:A.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&b("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&b("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&b("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(a){return b("webcam",a),`webcam error: ${a}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(a=>{this.element?this.element.onloadeddata=()=>a(!0):a(!1)}),await this.element.play(),this.config.debug&&b("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&b("webcam error","no stream"),"webcam error no stream")});z(this,"pause",()=>{this.element&&this.element.pause()});z(this,"play",async()=>{this.element&&await this.element.play()});z(this,"stop",()=>{this.config.debug&&b("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var yt={};oe(yt,{"affectnet-mobilenet":()=>vo,age:()=>Ro,"anti-spoofing":()=>tr,antispoof:()=>lo,blazeface:()=>co,"blazeface-back":()=>Mo,"blazeface-front":()=>Po,"blazepose-detector":()=>ko,"blazepose-full":()=>wo,"blazepose-heavy":()=>Eo,"blazepose-lite":()=>zo,centernet:()=>xo,default:()=>fr,efficientpose:()=>So,"efficientpose-i-lite":()=>nr,"efficientpose-ii-lite":()=>or,"efficientpose-iv":()=>rr,emotion:()=>yo,faceboxes:()=>jo,facemesh:()=>fo,"facemesh-attention":()=>No,"facemesh-attention-pinto":()=>Io,"facemesh-detection-full":()=>Lo,"facemesh-detection-short":()=>Oo,faceres:()=>mo,"faceres-deep":()=>Co,gear:()=>Fo,"gear-e1":()=>Wo,"gear-e2":()=>Do,gender:()=>Ho,"gender-ssrnet-imdb":()=>Bo,handdetect:()=>Go,"handlandmark-full":()=>Vo,"handlandmark-lite":()=>po,"handlandmark-sparse":()=>Zo,handskeleton:()=>Xo,handtrack:()=>uo,"insightface-efficientnet-b0":()=>sr,"insightface-ghostnet-strides1":()=>Ar,"insightface-ghostnet-strides2":()=>ar,"insightface-mobilenet-emore":()=>ir,"insightface-mobilenet-swish":()=>lr,iris:()=>ho,liveness:()=>bo,meet:()=>qo,mobileface:()=>Uo,mobilefacenet:()=>Yo,models:()=>go,"movenet-lightning":()=>To,"movenet-multipose":()=>Ko,"movenet-thunder":()=>Jo,nanodet:()=>Qo,"nanodet-e":()=>cr,"nanodet-g":()=>dr,"nanodet-m":()=>xr,"nanodet-t":()=>yr,posenet:()=>_o,rvm:()=>$o,selfie:()=>er});var lo=853098,co=538928,xo=4030290,yo=820516,fo=1477958,mo=6978814,po=2023432,uo=2964837,ho=2599092,bo=592976,go=0,To=4650216,vo=6920630,Ro=161240,Mo=538928,Po=402048,ko=5928856,wo=6339202,Eo=27502466,zo=2726402,So=5651240,jo=2013002,Io=2387598,No=2382414,Lo=1026192,Oo=201268,Co=13957620,Wo=112438,Do=112438,Fo=1498916,Bo=161236,Ho=201808,Go=3515612,Vo=5431368,Zo=5286322,Xo=5502280,qo=372228,Uo=2183192,Yo=5171976,Ko=9448838,Jo=12477112,Qo=7574558,_o=5032780,$o=3739355,er=212886,tr=853098,nr=2269064,or=5651240,rr=25643252,sr=13013224,Ar=8093408,ar=8049584,ir=6938536,lr=12168584,cr=12319156,dr=7574558,xr=1887474,yr=5294216,fr={antispoof:lo,blazeface:co,centernet:xo,emotion:yo,facemesh:fo,faceres:mo,"handlandmark-lite":po,handtrack:uo,iris:ho,liveness:bo,models:go,"movenet-lightning":To,"affectnet-mobilenet":vo,age:Ro,"blazeface-back":Mo,"blazeface-front":Po,"blazepose-detector":ko,"blazepose-full":wo,"blazepose-heavy":Eo,"blazepose-lite":zo,efficientpose:So,faceboxes:jo,"facemesh-attention-pinto":Io,"facemesh-attention":No,"facemesh-detection-full":Lo,"facemesh-detection-short":Oo,"faceres-deep":Co,"gear-e1":Wo,"gear-e2":Do,gear:Fo,"gender-ssrnet-imdb":Bo,gender:Ho,handdetect:Go,"handlandmark-full":Vo,"handlandmark-sparse":Zo,handskeleton:Xo,meet:qo,mobileface:Uo,mobilefacenet:Yo,"movenet-multipose":Ko,"movenet-thunder":Jo,nanodet:Qo,posenet:_o,rvm:$o,selfie:er,"anti-spoofing":tr,"efficientpose-i-lite":nr,"efficientpose-ii-lite":or,"efficientpose-iv":rr,"insightface-efficientnet-b0":sr,"insightface-ghostnet-strides1":Ar,"insightface-ghostnet-strides2":ar,"insightface-mobilenet-emore":ir,"insightface-mobilenet-swish":lr,"nanodet-e":cr,"nanodet-g":dr,"nanodet-m":xr,"nanodet-t":yr};var T0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},p0={};async function mr(e,t){return T0.debug&&b("load model fetch:",e,t),fetch(e,t)}function r1(e){T0.cacheModels=e.cacheModels,T0.verbose=e.debug,T0.modelBasePath=e.modelBasePath}async function L(e){var d,y,l,f;let t=Y5(T0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),o=n[n.length-1].replace(".json",""),s="indexeddb://"+o;p0[o]={name:o,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:yt[o],inCache:!1,url:""},T0.cacheSupported=typeof indexedDB!="undefined";let A={};try{A=T0.cacheSupported&&T0.cacheModels?await r.io.listModels():{}}catch(x){T0.cacheSupported=!1}p0[o].inCache=T0.cacheSupported&&T0.cacheModels&&Object.keys(A).includes(s),p0[o].url=p0[o].inCache?s:t;let a=typeof fetch=="undefined"?{}:{fetchFunc:(x,p)=>mr(x,p)},i=new r.GraphModel(p0[o].url,a),c=!1;try{i.findIOHandler(),T0.debug&&b("model load handler:",i.handler)}catch(x){b("error finding model i/o handler:",t,x)}try{let x=await((d=i.handler)==null?void 0:d.load())||null;p0[o].sizeFromManifest=((y=x==null?void 0:x.weightData)==null?void 0:y.byteLength)||0,x?i.loadSync(x):i=await r.loadGraphModel(p0[o].inCache?s:t,a),p0[o].sizeLoadedWeights=((f=(l=i.artifacts)==null?void 0:l.weightData)==null?void 0:f.byteLength)||0,T0.verbose&&b("load:",{model:o,url:i.modelUrl,bytes:p0[o].sizeLoadedWeights}),c=!0}catch(x){b("error loading model:",t,x)}if(c&&T0.cacheModels&&T0.cacheSupported&&!p0[o].inCache)try{let x=await i.save(s);T0.debug&&b("model saved:",s,x)}catch(x){b("error saving model:",t,x)}return i}var ft="3.2.1";var Y={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function hr(){let e=Y.gl;e&&(Y.extensions=e.getSupportedExtensions())}function s1(e){var t;if(e.config.backend==="humangl"&&(Y.name in r.engine().registry&&!((t=Y==null?void 0:Y.gl)!=null&&t.getParameter(Y.gl.VERSION))&&(b("humangl error: backend invalid context"),e.models.reset()),!r.findBackend(Y.name))){try{Y.canvas=D0(100,100)}catch(s){b("humangl error: cannot create canvas:",s);return}try{if(Y.gl=Y.canvas.getContext("webgl2",Y.webGLattr),!Y.gl){b("humangl error: cannot get webgl context");return}if(!Y.gl.getParameter(Y.gl.VERSION).includes("2.0")){b("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}Y.canvas&&(Y.canvas.addEventListener("webglcontextlost",A=>{throw b("humangl error:",A.type),b("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),Y.canvas.addEventListener("webglcontextrestored",A=>{b("humangl error: context restored:",A)}),Y.canvas.addEventListener("webglcontextcreationerror",A=>{b("humangl error: context create:",A)}))}catch(s){b("humangl error: cannot get webgl context:",s);return}try{r.setWebGLContext(2,Y.gl)}catch(s){b("humangl error: cannot set webgl context:",s);return}try{let s=new r.GPGPUContext(Y.gl);r.registerBackend(Y.name,()=>new r.MathBackendWebGL(s),Y.priority)}catch(s){b("humangl error: cannot register webgl backend:",s);return}try{r.getKernelsForBackend("webgl").forEach(A=>{let a={...A,backendName:Y.name};r.registerKernel(a)})}catch(s){b("humangl error: cannot update webgl backend registration:",s);return}try{r.env().flagRegistry.WEBGL_VERSION&&r.env().set("WEBGL_VERSION",2)}catch(s){b("humangl error: cannot set WebGL backend flags:",s);return}hr();let n=r.backend(),o=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;o?e.config.debug&&b("humangl backend registered:",{webgl:o.getParameter(o.VERSION),renderer:o.getParameter(o.RENDERER)}):b("humangl error: no current gl context:",o,Y.gl)}}var O={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function A1(){O.tf255=r.scalar(255,"float32"),O.tf1=r.scalar(1,"float32"),O.tf2=r.scalar(2,"float32"),O.tf05=r.scalar(.5,"float32"),O.tf127=r.scalar(127.5,"float32"),O.rgb=r.tensor1d([.2989,.587,.114],"float32")}async function Tr(){var e;return await M.updateBackend(),(e=M.tensorflow)!=null&&e.version?"tensorflow":M.webgpu.supported&&M.webgpu.backend?"webgpu":M.webgl.supported&&M.webgl.backend?"webgl":M.wasm.supported&&M.wasm.backend?"wasm":"cpu"}function vr(e){let t=[];if(!M.kernels.includes("mod")){let n={kernelName:"Mod",backendName:r.getBackend(),kernelFunc:o=>r.tidy(()=>r.sub(o.inputs.a,r.mul(r.div(o.inputs.a,o.inputs.b),o.inputs.b)))};r.registerKernel(n),M.kernels.push("mod"),t.push("mod")}if(!M.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:r.getBackend(),kernelFunc:o=>r.tidy(()=>r.add(r.mul(r.floorDiv(o.inputs.a,o.inputs.b),o.inputs.b),r.mod(o.inputs.a,o.inputs.b)))};r.registerKernel(n),M.kernels.push("floormod"),t.push("floormod")}if(!M.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:r.getBackend(),kernelFunc:o=>r.tidy(()=>{let s=r.getBackend();r.setBackend("cpu");let A=r.image.rotateWithOffset(o.inputs.image,o.attrs.radians,o.attrs.fillValue,o.attrs.center);return r.setBackend(s),A})};r.registerKernel(n),M.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&b("registered kernels:",t)}var a1={};async function e2(e,t=!1){var n,o;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await Tr()),t||M.initial||e.config.backend&&e.config.backend.length>0&&r.getBackend()!==e.config.backend){let s=R();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&b("running inside web worker"),typeof navigator!="undefined"&&((o=navigator==null?void 0:navigator.userAgent)!=null&&o.toLowerCase().includes("electron"))&&e.config.debug&&b("running inside electron");let A=Object.keys(r.engine().registryFactory);if(e.config.backend==="humangl"&&!A.includes("humangl")&&(s1(e),A=Object.keys(r.engine().registryFactory)),e.config.debug&&b("available backends:",A),M.browser&&!M.node&&e.config.backend==="tensorflow"&&A.includes("webgl")&&(e.config.debug&&b("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),M.node&&!M.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&A.includes("tensorflow")&&(e.config.debug&&b(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),M.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")b("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let a=await navigator.gpu.requestAdapter();if(e.config.debug&&b("enumerated webgpu adapter:",a),!a)b("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let i="requestAdapterInfo"in a?await a.requestAdapterInfo():void 0;b("webgpu adapter info:",i)}}if(A.includes(e.config.backend)||(b(`error: backend ${e.config.backend} not found in registry`),e.config.backend=M.node?"tensorflow":"webgl",e.config.debug&&b(`override: setting backend ${e.config.backend}`)),e.config.debug&&b("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(r.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&r.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&b("wasm path:",e.config.wasmPath),typeof r.setWasmPaths!="undefined")r.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let a=!1,i=!1;try{a=await r.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),i=await r.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&b(`wasm execution: ${i?"simd":"no simd"} ${a?"multithreaded":"singlethreaded"}`),e.config.debug&&!i&&b("warning: wasm simd support is not enabled")}catch(c){b("wasm detection failed")}}try{await r.setBackend(e.config.backend),await r.ready()}catch(a){return b("error: cannot set backend:",e.config.backend,a),!1}e.config.debug&&(a1=JSON.parse(JSON.stringify(r.env().flags)))}if((r.getBackend()==="humangl"||r.getBackend()==="webgl")&&(r.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&r.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),r.env().flagRegistry.WEBGL_EXP_CONV&&r.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(b("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),r.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),r.getBackend(),e.config.debug){let A=r.env().flags,a={};for(let i of Object.keys(A))a1[i]!==A[i]&&(a[i]=A[i]);e.config.debug&&Object.keys(a).length>0&&b("backend:",r.getBackend(),"flags:",a)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&b("flags:",e.config.flags);for(let[A,a]of Object.entries(e.config.flags))r.env().set(A,a)}r.enableProdMode(),A1(),e.performance.initBackend=Math.trunc(R()-s),e.config.backend=r.getBackend(),await M.updateBackend(),vr(e.config)}return!0}function h2(e,t){for(let n of e){let o={kernelName:n,backendName:t.backend,kernelFunc:s=>{var A;return t.debug&&b("kernelFunc",n,t.backend,s),(A=s==null?void 0:s.inputs)==null?void 0:A.info}};r.registerKernel(o)}M.kernels=r.getKernelsForBackend(r.getBackend()).map(n=>n.kernelName.toLowerCase())}var vt={};oe(vt,{all:()=>$r,body:()=>g2,canvas:()=>_r,face:()=>b2,gesture:()=>R2,hand:()=>T2,init:()=>Tt,object:()=>v2,options:()=>n0,person:()=>Qr});var O0=e=>{if(!e)b("draw error: invalid canvas");else if(!e.getContext)b("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)b("draw error: cannot get canvas context");else return t}return null},ge=e=>Math.round(e*180/Math.PI),H=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Te=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function C0(e,t,n,o,s){let A=t.replace(/\[.*\]/g,"").split(` +`).map(i=>i.trim()),a=Math.max(0,n);for(let i=A.length-1;i>=0;i--){let c=i*s.lineHeight+o;s.shadowColor&&s.shadowColor!==""&&(e.fillStyle=s.shadowColor,e.fillText(A[i],a+5,c+16)),e.fillStyle=s.labelColor,e.fillText(A[i],a+4,c+15)}}function U0(e,t,n,o,s){e.fillStyle=Te(o,s),e.beginPath(),e.arc(t,n,s.pointSize,0,2*Math.PI),e.fill()}function Y0(e,t,n,o,s,A){if(e.beginPath(),e.lineWidth=A.lineWidth,A.useCurves){let a=(t+t+o)/2,i=(n+n+s)/2;e.ellipse(a,i,o/2,s/2,0,0,2*Math.PI)}else e.moveTo(t+A.roundRect,n),e.lineTo(t+o-A.roundRect,n),e.quadraticCurveTo(t+o,n,t+o,n+A.roundRect),e.lineTo(t+o,n+s-A.roundRect),e.quadraticCurveTo(t+o,n+s,t+o-A.roundRect,n+s),e.lineTo(t+A.roundRect,n+s),e.quadraticCurveTo(t,n+s,t,n+s-A.roundRect),e.lineTo(t,n+A.roundRect),e.quadraticCurveTo(t,n,t+A.roundRect,n),e.closePath();e.stroke()}function mt(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let o of t)e.strokeStyle=Te(o[2]||0,n),e.lineTo(Math.trunc(o[0]),Math.trunc(o[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function l1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){mt(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let o=0;ot2[e]),KA=Mr.map(e=>t2[e]),JA=Pr.map(e=>t2[e]);function re(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var kr=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],wr=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Er=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],zr=[[474,475],[475,476],[476,477],[477,474]],Sr=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],jr=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ir=[[469,470],[470,471],[471,472],[472,469]],Nr=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],QA={lips:re(kr),leftEye:re(wr),leftEyebrow:re(Er),leftIris:re(zr),rightEye:re(Sr),rightEyebrow:re(jr),rightIris:re(Ir),faceOval:re(Nr)};var Lr=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Or=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Cr=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Wr=[[474,475],[475,476],[476,477],[477,474]],Dr=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Fr=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Br=[[469,470],[470,471],[471,472],[472,469]],Hr=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function se(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Gr={lips:se(Lr),leftEye:se(Or),leftEyebrow:se(Cr),leftIris:se(Wr),rightEye:se(Dr),rightEyebrow:se(Fr),rightIris:se(Br),faceOval:se(Hr)},Vr=Object.entries(Gr).map(([e,t])=>t.map(n=>[n,e])).flat(),_A=new Map(Vr),n2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],Me=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],Pe=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var B;function Zr(e,t){var o,s,A,a,i,c,d,y,l;if(!B.drawLabels||((o=B.faceLabels)==null?void 0:o.length)===0)return;let n=B.faceLabels.slice();if(n=H(n,"[id]",e.id.toFixed(0)),e.score&&(n=H(n,"[score]",100*e.score)),e.gender&&(n=H(n,"[gender]",e.gender)),e.genderScore&&(n=H(n,"[genderScore]",100*e.genderScore)),e.age&&(n=H(n,"[age]",e.age)),e.distance&&(n=H(n,"[distance]",100*e.distance)),e.real&&(n=H(n,"[real]",100*e.real)),e.live&&(n=H(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let f=e.emotion.map(x=>`${Math.trunc(100*x.score)}% ${x.emotion}`);f.length>3&&(f.length=3),n=H(n,"[emotions]",f.join(" "))}(A=(s=e.rotation)==null?void 0:s.angle)!=null&&A.roll&&(n=H(n,"[roll]",ge(e.rotation.angle.roll))),(i=(a=e.rotation)==null?void 0:a.angle)!=null&&i.yaw&&(n=H(n,"[yaw]",ge(e.rotation.angle.yaw))),(d=(c=e.rotation)==null?void 0:c.angle)!=null&&d.pitch&&(n=H(n,"[pitch]",ge(e.rotation.angle.pitch))),(l=(y=e.rotation)==null?void 0:y.gaze)!=null&&l.bearing&&(n=H(n,"[gaze]",ge(e.rotation.gaze.bearing))),C0(t,n,e.box[0],e.box[1],B)}function Xr(e,t){var n,o,s,A;if((n=e.annotations)!=null&&n.leftEyeIris&&((o=e.annotations)!=null&&o.leftEyeIris[0])){t.strokeStyle=B.useDepth?"rgba(255, 200, 255, 0.3)":B.color,t.beginPath();let a=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,i=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],a,i,0,0,2*Math.PI),t.stroke(),B.fillPolygons&&(t.fillStyle=B.useDepth?"rgba(255, 255, 200, 0.3)":B.color,t.fill())}if((s=e.annotations)!=null&&s.rightEyeIris&&((A=e.annotations)!=null&&A.rightEyeIris[0])){t.strokeStyle=B.useDepth?"rgba(255, 200, 255, 0.3)":B.color,t.beginPath();let a=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,i=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],a,i,0,0,2*Math.PI),t.stroke(),B.fillPolygons&&(t.fillStyle=B.useDepth?"rgba(255, 255, 200, 0.3)":B.color,t.fill())}}function qr(e,t){var n;if(B.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let o=e.box[0]+e.box[2]/2-e.box[3]*ge(e.rotation.angle.yaw)/90,s=e.box[1]+e.box[3]/2+e.box[2]*ge(e.rotation.angle.pitch)/90,A=new Path2D(` M ${e.box[0]+e.box[2]/2} ${e.box[1]} C - ${r} ${e.box[1]}, - ${r} ${e.box[1]+e.box[3]}, + ${o} ${e.box[1]}, + ${o} ${e.box[1]+e.box[3]}, ${e.box[0]+e.box[2]/2} ${e.box[1]+e.box[3]} `),a=new Path2D(` M ${e.box[0]} ${e.box[1]+e.box[3]/2} @@ -109,7 +109,7 @@ var at=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var _n=Objec ${e.box[0]} ${s}, ${e.box[0]+e.box[2]} ${s}, ${e.box[0]+e.box[2]} ${e.box[1]+e.box[3]/2} - `);t.stroke(a),t.stroke(A)}}function Ur(e,t){var n;if(B.drawGaze&&((n=e.rotation)!=null&&n.gaze.strength)&&e.rotation.gaze.bearing&&e.annotations.leftEyeIris&&e.annotations.rightEyeIris&&e.annotations.leftEyeIris[0]&&e.annotations.rightEyeIris[0]){t.strokeStyle="pink",t.fillStyle="pink";let r=[e.annotations.leftEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.leftEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];pt(t,[e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1]],[r[0],r[1]],4);let s=[e.annotations.rightEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.rightEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];pt(t,[e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1]],[s[0],s[1]],4)}}function Yr(e,t){if(B.drawPolygons&&e.mesh.length>=468){t.lineWidth=1;for(let n=0;ne.mesh[s]);mt(t,r,B)}Xr(e,t)}}function Kr(e,t){if(B.drawPoints)if((e==null?void 0:e.mesh.length)>=468)for(let n=0;n0&&(Kr(s,r),Yr(s,r),qr(s,r),Ur(s,r))}}function g2(e,t,n){var A,a;let r=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round";for(let i=0;i0)){let c=r.bodyLabels.slice();c=H(c,"[id]",t[i].id.toFixed(0)),c=H(c,"[score]",100*t[i].score),C0(s,c,t[i].box[0],t[i].box[1],r)}if(r.drawPoints&&t[i].keypoints)for(let c=0;c0&&t[i].keypoints){s.font=r.font;for(let c of t[i].keypoints){if(!c.score||c.score===0)continue;let d=r.bodyPartLabels.slice();d=H(d,"[label]",c.part),d=H(d,"[score]",100*c.score),C0(s,d,c.position[0],c.position[1],r)}}if(r.drawPolygons&&t[i].keypoints&&t[i].annotations)for(let c of Object.values(t[i].annotations))for(let d of c)l1(s,d,r)}}}function T2(e,t,n){var A,a;let r=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round",s.font=r.font;for(let i of t){if(r.drawBoxes){if(s.strokeStyle=r.color,s.fillStyle=r.color,Y0(s,i.box[0],i.box[1],i.box[2],i.box[3],r),r.drawLabels&&((A=r.handLabels)==null?void 0:A.length)>0){let c=r.handLabels.slice();c=H(c,"[id]",i.id.toFixed(0)),c=H(c,"[label]",i.label),c=H(c,"[score]",100*i.score),C0(s,c,i.box[0],i.box[1],r)}s.stroke()}if(r.drawPoints&&i.keypoints&&i.keypoints.length>0)for(let c of i.keypoints)s.fillStyle=Te(c[2],r),U0(s,c[0],c[1],0,r);if(r.drawLabels&&i.annotations&&((a=r.fingerLabels)==null?void 0:a.length)>0)for(let[c,d]of Object.entries(i.annotations)){let y=r.fingerLabels.slice();y=H(y,"[label]",c),C0(s,y,d[d.length-1][0],d[d.length-1][1],r)}if(r.drawPolygons&&i.annotations){let c=d=>{if(!(!d||d.length===0||!d[0]))for(let y=0;y0?y-1:0][0],d[y>0?y-1:0][1]),s.lineTo(d[y][0],d[y][1]),s.stroke()}};s.lineWidth=r.lineWidth,c(i.annotations.index),c(i.annotations.middle),c(i.annotations.ring),c(i.annotations.pinky),c(i.annotations.thumb)}}}}function v2(e,t,n){var A;let r=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round",s.font=r.font;for(let a of t)if(r.drawBoxes){if(s.strokeStyle=r.color,s.fillStyle=r.color,Y0(s,a.box[0],a.box[1],a.box[2],a.box[3],r),r.drawLabels&&((A=r.objectLabels)==null?void 0:A.length)>0){let i=r.objectLabels.slice();i=H(i,"[id]",a.id.toFixed(0)),i=H(i,"[label]",a.label),i=H(i,"[score]",100*a.score),C0(s,i,a.box[0],a.box[1],r)}s.stroke()}}}function R2(e,t,n){var s;let r=Q(n0,n);if(!(!t||!e)&&r.drawGestures&&((s=r.gestureLabels)==null?void 0:s.length)>0){let A=O0(e);if(!A)return;A.font=r.font,A.fillStyle=r.color;let a=1;for(let i=0;i1&&d[1].length>0){let y=c[1]>0?`#${c[1]}`:"",l=r.gestureLabels.slice();l=H(l,"[where]",c[0]),l=H(l,"[who]",y),l=H(l,"[what]",d[1]),C0(A,l,8,2+a*r.lineHeight,r),a+=1}}}}var Ae={face:`face + `);t.stroke(a),t.stroke(A)}}function Ur(e,t){var n;if(B.drawGaze&&((n=e.rotation)!=null&&n.gaze.strength)&&e.rotation.gaze.bearing&&e.annotations.leftEyeIris&&e.annotations.rightEyeIris&&e.annotations.leftEyeIris[0]&&e.annotations.rightEyeIris[0]){t.strokeStyle="pink",t.fillStyle="pink";let o=[e.annotations.leftEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.leftEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];pt(t,[e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1]],[o[0],o[1]],4);let s=[e.annotations.rightEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.rightEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];pt(t,[e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1]],[s[0],s[1]],4)}}function Yr(e,t){if(B.drawPolygons&&e.mesh.length>=468){t.lineWidth=1;for(let n=0;ne.mesh[s]);mt(t,o,B)}Xr(e,t)}}function Kr(e,t){if(B.drawPoints)if((e==null?void 0:e.mesh.length)>=468)for(let n=0;n0&&(Kr(s,o),Yr(s,o),qr(s,o),Ur(s,o))}}function g2(e,t,n){var A,a;let o=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round";for(let i=0;i0)){let c=o.bodyLabels.slice();c=H(c,"[id]",t[i].id.toFixed(0)),c=H(c,"[score]",100*t[i].score),C0(s,c,t[i].box[0],t[i].box[1],o)}if(o.drawPoints&&t[i].keypoints)for(let c=0;c0&&t[i].keypoints){s.font=o.font;for(let c of t[i].keypoints){if(!c.score||c.score===0)continue;let d=o.bodyPartLabels.slice();d=H(d,"[label]",c.part),d=H(d,"[score]",100*c.score),C0(s,d,c.position[0],c.position[1],o)}}if(o.drawPolygons&&t[i].keypoints&&t[i].annotations)for(let c of Object.values(t[i].annotations))for(let d of c)l1(s,d,o)}}}function T2(e,t,n){var A,a;let o=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round",s.font=o.font;for(let i of t){if(o.drawBoxes){if(s.strokeStyle=o.color,s.fillStyle=o.color,Y0(s,i.box[0],i.box[1],i.box[2],i.box[3],o),o.drawLabels&&((A=o.handLabels)==null?void 0:A.length)>0){let c=o.handLabels.slice();c=H(c,"[id]",i.id.toFixed(0)),c=H(c,"[label]",i.label),c=H(c,"[score]",100*i.score),C0(s,c,i.box[0],i.box[1],o)}s.stroke()}if(o.drawPoints&&i.keypoints&&i.keypoints.length>0)for(let c of i.keypoints)s.fillStyle=Te(c[2],o),U0(s,c[0],c[1],0,o);if(o.drawLabels&&i.annotations&&((a=o.fingerLabels)==null?void 0:a.length)>0)for(let[c,d]of Object.entries(i.annotations)){let y=o.fingerLabels.slice();y=H(y,"[label]",c),C0(s,y,d[d.length-1][0],d[d.length-1][1],o)}if(o.drawPolygons&&i.annotations){let c=d=>{if(!(!d||d.length===0||!d[0]))for(let y=0;y0?y-1:0][0],d[y>0?y-1:0][1]),s.lineTo(d[y][0],d[y][1]),s.stroke()}};s.lineWidth=o.lineWidth,c(i.annotations.index),c(i.annotations.middle),c(i.annotations.ring),c(i.annotations.pinky),c(i.annotations.thumb)}}}}function v2(e,t,n){var A;let o=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round",s.font=o.font;for(let a of t)if(o.drawBoxes){if(s.strokeStyle=o.color,s.fillStyle=o.color,Y0(s,a.box[0],a.box[1],a.box[2],a.box[3],o),o.drawLabels&&((A=o.objectLabels)==null?void 0:A.length)>0){let i=o.objectLabels.slice();i=H(i,"[id]",a.id.toFixed(0)),i=H(i,"[label]",a.label),i=H(i,"[score]",100*a.score),C0(s,i,a.box[0],a.box[1],o)}s.stroke()}}}function R2(e,t,n){var s;let o=Q(n0,n);if(!(!t||!e)&&o.drawGestures&&((s=o.gestureLabels)==null?void 0:s.length)>0){let A=O0(e);if(!A)return;A.font=o.font,A.fillStyle=o.color;let a=1;for(let i=0;i1&&d[1].length>0){let y=c[1]>0?`#${c[1]}`:"",l=o.gestureLabels.slice();l=H(l,"[where]",c[0]),l=H(l,"[who]",y),l=H(l,"[what]",d[1]),C0(A,l,8,2+a*o.lineHeight,o),a+=1}}}}var Ae={face:`face confidence: [score]% [gender] [genderScore]% age: [age] years @@ -118,7 +118,7 @@ var at=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var _n=Objec live: [live]% [emotions] roll: [roll]\xB0 yaw:[yaw]\xB0 pitch:[pitch]\xB0 - gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var gt=0;function Qr(e,t,n){let r=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round",s.font=r.font;for(let A=0;AMt,kpt:()=>Rt});var Rt=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],Mt={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var W0,ke=224,x1,es=5,P2=[8,16,32,32,32];function ts(){let e=[],t=0;for(;tn.x)),y:o.tensor1d(e.map(n=>n.y))}}async function y1(e){if(M.initial&&(W0=null),!W0&&e.body.detector&&e.body.detector.modelPath){W0=await L(e.body.detector.modelPath);let t=W0!=null&&W0.executor?Object.values(W0.modelSignature.inputs):void 0;ke=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&W0&&b("cached model:",W0.modelUrl);return ts(),W0}var d1=[5,5];function ns(e,t){return o.tidy(()=>{let n=o.split(e,12,1),r=o.squeeze(n[0]),s=o.squeeze(n[1]),A=o.squeeze(n[2]),a=o.squeeze(n[3]);r=o.add(o.div(r,ke),t.x),s=o.add(o.div(s,ke),t.y),A=o.mul(o.div(A,ke),d1[0]),a=o.mul(o.div(a,ke),d1[1]);let i=o.sub(r,o.div(A,2)),c=o.sub(s,o.div(a,2)),d=o.add(i,A),y=o.add(c,a);return o.stack([i,c,d,y],1)})}async function os(e,t,n,r){var d,y;let s=[],A={};A.boxes=ns(e,x1),A.scores=o.sigmoid(t),A.nms=await o.image.nonMaxSuppressionAsync(A.boxes,A.scores,1,((d=n.body.detector)==null?void 0:d.minConfidence)||.1,((y=n.body.detector)==null?void 0:y.iouThreshold)||.1);let a=await A.nms.data(),i=await A.scores.data(),c=await A.boxes.array();for(let l of Array.from(a)){let m=i[l],x=c[l],p=[Math.round(x[0]*r[0]),Math.round(x[1]*r[1]),Math.round(x[2]*r[0]),Math.round(x[3]*r[1])],f={score:m,boxRaw:x,box:p};s.push(f)}return Object.keys(A).forEach(l=>o.dispose(A[l])),s}async function f1(e,t,n){let r={};r.res=W0==null?void 0:W0.execute(e,["Identity"]),r.logitsRaw=o.slice(r.res,[0,0,0],[1,-1,1]),r.boxesRaw=o.slice(r.res,[0,0,1],[1,-1,-1]),r.logits=o.squeeze(r.logitsRaw),r.boxes=o.squeeze(r.boxesRaw);let s=await os(r.boxes,r.logits,t,n);return Object.keys(r).forEach(A=>o.dispose(r[A])),s}function ae(e,t=[1,1]){let n=[e.map(i=>i[0]),e.map(i=>i[1])],r=[Math.min(...n[0]),Math.min(...n[1])],s=[Math.max(...n[0]),Math.max(...n[1])],A=[r[0],r[1],s[0]-r[0],s[1]-r[1]],a=[A[0]/t[0],A[1]/t[1],A[2]/t[0],A[3]/t[1]];return{box:A,boxRaw:a}}function m1(e,t=[1,1]){let n=[e.map(d=>d[0]),e.map(d=>d[1])],r=[Math.min(...n[0]),Math.min(...n[1])],s=[Math.max(...n[0]),Math.max(...n[1])],A=[(r[0]+s[0])/2,(r[1]+s[1])/2],a=Math.max(A[0]-r[0],A[1]-r[1],-A[0]+s[0],-A[1]+s[1]),i=[Math.trunc(A[0]-a),Math.trunc(A[1]-a),Math.trunc(2*a),Math.trunc(2*a)],c=[i[0]/t[0],i[1]/t[1],i[2]/t[0],i[3]/t[1]];return{box:i,boxRaw:c}}function k2(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var P0,kt=256,Pt=Number.MAX_SAFE_INTEGER,rs={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},E2=[],ie=[[0,0],[0,0],[0,0],[0,0]],p1=0,u1=e=>1-1/(1+Math.exp(e)),b1=e=>y1(e);async function g1(e){if(M.initial&&(P0=null),P0)e.debug&&b("cached model:",P0.modelUrl);else{P0=await L(e.body.modelPath);let t=P0!=null&&P0.executor?Object.values(P0.modelSignature.inputs):void 0;kt=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return P0}function h1(e,t,n){var A,a;let r={};if(!((A=e==null?void 0:e.shape)!=null&&A[1])||!((a=e==null?void 0:e.shape)!=null&&a[2]))return e;let s;if(n&&(r.cropped=o.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let i=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],c=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];ie=[[0,0],i,c,[0,0]],r.pad=o.pad(r.cropped||e,ie),r.resize=o.image.resizeBilinear(r.pad,[t,t]),s=o.div(r.resize,O.tf255)}else e.shape[1]!==t?(r.resize=o.image.resizeBilinear(r.cropped||e,[t,t]),s=o.div(r.resize,O.tf255)):s=o.div(r.cropped||e,O.tf255);return Object.keys(r).forEach(i=>o.dispose(r[i])),s}function ss(e,t,n){for(let r of e)r.position=[Math.trunc(r.position[0]*(t[0]+ie[2][0]+ie[2][1])/t[0]-ie[2][0]),Math.trunc(r.position[1]*(t[1]+ie[1][0]+ie[1][1])/t[1]-ie[1][0]),r.position[2]],r.positionRaw=[r.position[0]/t[0],r.position[1]/t[1],2*r.position[2]/(t[0]+t[1])];if(n){let r=n[2]-n[0],s=n[3]-n[1];for(let A of e)A.positionRaw=[A.positionRaw[0]/s+n[1],A.positionRaw[1]/r+n[0],A.positionRaw[2]],A.position=[Math.trunc(A.positionRaw[0]*t[0]),Math.trunc(A.positionRaw[1]*t[1]),A.positionRaw[2]]}return e}function As(e){let t=e.find(i=>i.part==="leftPalm"),n=e.find(i=>i.part==="leftWrist"),r=e.find(i=>i.part==="leftIndex");t.position[2]=((n.position[2]||0)+(r.position[2]||0))/2;let s=e.find(i=>i.part==="rightPalm"),A=e.find(i=>i.part==="rightWrist"),a=e.find(i=>i.part==="rightIndex");s.position[2]=((A.position[2]||0)+(a.position[2]||0))/2}async function as(e,t,n){if(!(P0!=null&&P0.executor))return null;let r={};[r.ld,r.segmentation,r.heatmap,r.world,r.poseflag]=P0==null?void 0:P0.execute(e,rs.landmarks);let s=(await r.poseflag.data())[0],A=await r.ld.data(),a=await r.world.data();Object.keys(r).forEach(p=>o.dispose(r[p]));let i=[],c=5;for(let p=0;pp.position),l=ae(y,[n[0],n[1]]),m={};for(let[p,f]of Object.entries(Mt)){let h=[];for(let v=0;vg.part===f[v]),u=d.find(g=>g.part===f[v+1]);T&&u&&h.push([T.position,u.position])}m[p]=h}return{id:0,score:Math.trunc(100*s)/100,box:l.box,boxRaw:l.boxRaw,keypoints:d,annotations:m}}async function wt(e,t){var A,a,i;let n=[e.shape[2]||0,e.shape[1]||0],r=(t.body.skipTime||0)>R()-p1,s=Pt<(t.body.skipFrames||0);if(t.skipAllowed&&r&&s&&E2!==null)Pt++;else{let c=[];if((a=(A=t.body)==null?void 0:A.detector)!=null&&a.enabled){let d=h1(e,224);c=await f1(d,t,n),o.dispose(d)}else c=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let d=0;do.dispose(r[d])),s}async function St(e,t){if(!(k0!=null&&k0.executor))return[];let n=(t.object.skipTime||0)>R()-v1,r=zt<(t.object.skipFrames||0);return t.skipAllowed&&n&&r&&Et.length>0?(zt++,Et):(zt=0,new Promise(async s=>{let A=[e.shape[2]||0,e.shape[1]||0],a=o.image.resizeBilinear(e,[we,we]),i=t.object.enabled?k0==null?void 0:k0.execute(a,["tower_0/detections"]):null;v1=R(),o.dispose(a);let c=await is(i,A,t);Et=c,s(c)}))}var z2={};oe(z2,{connected:()=>It,kpt:()=>jt});var jt=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],It={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var _,P1=0,v0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},Nt=Number.MAX_SAFE_INTEGER;async function k1(e){return M.initial&&(_=null),_?e.debug&&b("cached model:",_.modelUrl):_=await L(e.body.modelPath),_}async function ls(e,t){let[n,r]=e.shape,s=o.reshape(e,[r*n]),A=o.max(s,0),a=(await A.data())[0];if(a>t){let i=o.argMax(s,0),c=o.mod(i,n),d=(await c.data())[0],y=o.div(i,n),l=(await y.data())[0];return o.dispose([s,A,i,c,y]),[d,l,a]}return o.dispose([s,A]),[0,0,a]}async function Lt(e,t){if(!(_!=null&&_.executor)||!(_!=null&&_.inputs[0].shape))return[];let n=(t.body.skipTime||0)>R()-P1,r=Nt<(t.body.skipFrames||0);return t.skipAllowed&&n&&r&&Object.keys(v0.keypoints).length>0?(Nt++,[v0]):(Nt=0,new Promise(async s=>{let A=o.tidy(()=>{var p,f;let l=o.image.resizeBilinear(e,[((p=_==null?void 0:_.inputs[0].shape)==null?void 0:p[2])||0,((f=_==null?void 0:_.inputs[0].shape)==null?void 0:f[1])||0],!1),m=o.mul(l,O.tf2);return o.sub(m,O.tf1)}),a;if(t.body.enabled&&(a=_==null?void 0:_.execute(A)),P1=R(),o.dispose(A),a){v0.keypoints.length=0;let l=o.squeeze(a);o.dispose(a);let m=o.unstack(l,2);o.dispose(l);for(let x=0;x(t.body.minConfidence||0)&&v0.keypoints.push({score:Math.round(100*h)/100,part:jt[x],positionRaw:[p/_.inputs[0].shape[2],f/_.inputs[0].shape[1]],position:[Math.round(e.shape[2]*p/_.inputs[0].shape[2]),Math.round(e.shape[1]*f/_.inputs[0].shape[1])]})}m.forEach(x=>o.dispose(x))}v0.score=v0.keypoints.reduce((l,m)=>m.score>l?m.score:l,0);let i=v0.keypoints.map(l=>l.position[0]),c=v0.keypoints.map(l=>l.position[1]);v0.box=[Math.min(...i),Math.min(...c),Math.max(...i)-Math.min(...i),Math.max(...c)-Math.min(...c)];let d=v0.keypoints.map(l=>l.positionRaw[0]),y=v0.keypoints.map(l=>l.positionRaw[1]);v0.boxRaw=[Math.min(...d),Math.min(...y),Math.max(...d)-Math.min(...d),Math.max(...y)-Math.min(...y)];for(let[l,m]of Object.entries(It)){let x=[];for(let p=0;pv.part===m[p]),h=v0.keypoints.find(v=>v.part===m[p+1]);f&&h&&f.score>(t.body.minConfidence||0)&&h.score>(t.body.minConfidence||0)&&x.push([f.position,h.position])}v0.annotations[l]=x}s([v0])}))}var Fe=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],S2=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],j2=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],I2=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],S1=(e,t,n)=>{let r=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],s=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],A=e.landmarks.map(a=>[(a[0]+n[0])*t[0],(a[1]+n[1])*t[1]]);return{startPoint:r,endPoint:s,landmarks:A,confidence:e.confidence}},Ot=(e,t,n)=>{let r=t.shape[1],s=t.shape[2],A=[e.startPoint[1]/r,e.startPoint[0]/s,e.endPoint[1]/r,e.endPoint[0]/s],a=o.image.cropAndResize(t,[A],[0],n),i=o.div(a,O.tf255);return o.dispose(a),i},N2=(e,t)=>{let n=S2(e),r=Fe(e),s=[t*r[0]/2,t*r[1]/2];return{startPoint:[n[0]-s[0],n[1]-s[1]],endPoint:[n[0]+s[0],n[1]+s[1]],landmarks:e.landmarks,confidence:e.confidence,size:r}},L2=e=>{let t=S2(e),n=Fe(e),r=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-r),Math.round(t[1]-r)],endPoint:[Math.round(t[0]+r),Math.round(t[1]+r)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},j1=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},Ct=[[1,0,0],[0,1,0],[0,0,1]],cs=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),ds=(e,t)=>cs(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var E1=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],Ee=(e,t)=>{let n=0;for(let r=0;r{let n=[];for(let r=0;r{let n=[],r=e.length;for(let s=0;s{let n=Math.cos(e),r=Math.sin(e),s=[[n,-r,0],[r,n,0],[0,0,1]],A=E1(t[0],t[1]),a=z1(A,s),i=E1(-t[0],-t[1]);return z1(a,i)},ys=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],r=[-Ee(t[0],n),-Ee(t[1],n)];return[t[0].concat(r[0]),t[1].concat(r[1]),[0,0,1]]},fs=(e,t)=>[Ee(e,t[0]),Ee(e,t[1])];function N1(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let r=0;r[A[0]/s*(x[0]-s/2),A[1]/s*(x[1]-s/2),x[2]||0]),i=n&&n!==0&&Math.abs(n)>.2,c=i?I1(n,[0,0]):Ct,d=i?a.map(x=>[...fs(x,c),x[2]]):a,y=i?ys(r):Ct,l=S2(t),m=[Ee(l,y[0]),Ee(l,y[1])];return d.map(x=>[Math.trunc(x[0]+m[0]),Math.trunc(x[1]+m[1]),Math.trunc(x[2]||0)])}function O1(e,t,n,r){let s=t.landmarks.length>=ut.count?ut.symmetryLine:ve.symmetryLine,A=0,a=Ct,i;if(e&&M.kernels.includes("rotatewithoffset"))if(A=ds(t.landmarks[s[0]],t.landmarks[s[1]]),A&&A!==0&&Math.abs(A)>.2){let d=S2(t),y=[d[0]/n.shape[2],d[1]/n.shape[1]],l=o.image.rotateWithOffset(n,A,0,[y[0],y[1]]);a=I1(-A,d),i=Ot(t,l,[r,r]),o.dispose(l)}else i=Ot(t,n,[r,r]);else i=Ot(t,n,[r,r]);return[A,a,i]}var ms=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},C1=(e,t)=>{let n=ms(e),r=Fe(t);return{startPoint:[n[0]-r[0]/2,n[1]-r[1]/2],endPoint:[n[0]+r[0]/2,n[1]+r[1]/2]}};var W1=6,ps=1.4,G0,O2=null,le=0,Be=null,D1=()=>le;async function F1(e){var t;return M.initial&&(G0=null),G0?e.debug&&b("cached model:",G0.modelUrl):G0=await L((t=e.face.detector)==null?void 0:t.modelPath),le=G0.executor&&G0.inputs[0].shape?G0.inputs[0].shape[2]:256,Be=o.scalar(le,"int32"),O2=o.tensor2d(N1(le)),G0}function us(e){if(!O2||!Be)return o.zeros([0,0]);let t={};t.boxStarts=o.slice(e,[0,1],[-1,2]),t.centers=o.add(t.boxStarts,O2),t.boxSizes=o.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=o.div(t.boxSizes,Be),t.centersNormalized=o.div(t.centers,Be),t.halfBoxSize=o.div(t.boxSizesNormalized,O.tf2),t.starts=o.sub(t.centersNormalized,t.halfBoxSize),t.ends=o.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=o.mul(t.starts,Be),t.endNormalized=o.mul(t.ends,Be);let n=o.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(r=>o.dispose(t[r])),n}async function B1(e,t){var i,c,d,y,l,m;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=o.image.resizeBilinear(e,[le,le]),n.div=o.div(n.resized,O.tf127),n.normalized=o.sub(n.div,O.tf05);let r=G0==null?void 0:G0.execute(n.normalized);if(Array.isArray(r)&&r.length>2){let x=r.sort((p,f)=>p.size-f.size);n.concat384=o.concat([x[0],x[2]],2),n.concat512=o.concat([x[1],x[3]],2),n.concat=o.concat([n.concat512,n.concat384],1),n.batch=o.squeeze(n.concat,[0])}else Array.isArray(r)?n.batch=o.squeeze(r[0]):n.batch=o.squeeze(r);o.dispose(r),n.boxes=us(n.batch),n.logits=o.slice(n.batch,[0,0],[-1,1]),n.sigmoid=o.sigmoid(n.logits),n.scores=o.squeeze(n.sigmoid),n.nms=await o.image.nonMaxSuppressionAsync(n.boxes,n.scores,((i=t.face.detector)==null?void 0:i.maxDetected)||0,((c=t.face.detector)==null?void 0:c.iouThreshold)||0,((d=t.face.detector)==null?void 0:d.minConfidence)||0);let s=await n.nms.array(),A=[],a=await n.scores.data();for(let x=0;x(((y=t.face.detector)==null?void 0:y.minConfidence)||0)){let f={};f.bbox=o.slice(n.boxes,[s[x],0],[1,-1]),f.slice=o.slice(n.batch,[s[x],W1-1],[1,-1]),f.squeeze=o.squeeze(f.slice),f.landmarks=o.reshape(f.squeeze,[W1,-1]);let h=await f.bbox.data(),v={startPoint:[h[0],h[1]],endPoint:[h[2],h[3]],landmarks:await f.landmarks.array(),confidence:p};f.anchor=o.slice(O2,[s[x],0],[1,2]);let T=await f.anchor.data(),u=S1(v,[(e.shape[2]||0)/le,(e.shape[1]||0)/le],T),g=N2(u,t.face.scale||ps),E=L2(g);E.size[0]>(((l=t.face.detector)==null?void 0:l.minSize)||0)&&E.size[1]>(((m=t.face.detector)==null?void 0:m.minSize)||0)&&A.push(E),Object.keys(f).forEach(k=>o.dispose(f[k]))}}return Object.keys(n).forEach(x=>o.dispose(n[x])),A}var z0,ce=0,hs=2.3,Dt=F0.leftEyeLower0,Ft=F0.rightEyeLower0,He={leftBounds:[Dt[0],Dt[Dt.length-1]],rightBounds:[Ft[0],Ft[Ft.length-1]]},Ge={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function X1(e){var t,n;return M.initial&&(z0=null),z0?e.debug&&b("cached model:",z0.modelUrl):z0=await L((t=e.face.iris)==null?void 0:t.modelPath),ce=z0!=null&&z0.executor&&((n=z0.inputs)!=null&&n[0].shape)?z0.inputs[0].shape[2]:0,ce===-1&&(ce=64),z0}function C2(e,t,n,r){for(let s=0;s{let t=e[He.leftBounds[0]][2],n=e[He.rightBounds[0]][2];return t-n},G1=(e,t,n,r,s,A=!1)=>{let a=L2(N2(j1([e[n],e[r]]),hs)),i=Fe(a),c=o.image.cropAndResize(t,[[a.startPoint[1]/s,a.startPoint[0]/s,a.endPoint[1]/s,a.endPoint[0]/s]],[0],[ce,ce]);if(A&&M.kernels.includes("flipleftright")){let d=o.image.flipLeftRight(c);o.dispose(c),c=d}return{box:a,boxSize:i,crop:c}},V1=(e,t,n,r=!1)=>{let s=[];for(let A=0;A{let r=e[F0[`${n}EyeUpper0`][Ge.upperCenter]][2],s=e[F0[`${n}EyeLower0`][Ge.lowerCenter]][2],A=(r+s)/2;return t.map((a,i)=>{let c=A;return i===2?c=r:i===4&&(c=s),[a[0],a[1],c]})};async function q1(e,t,n){if(!(z0!=null&&z0.executor))return e;let{box:r,boxSize:s,crop:A}=G1(e,t,He.leftBounds[0],He.leftBounds[1],n,!0),{box:a,boxSize:i,crop:c}=G1(e,t,He.rightBounds[0],He.rightBounds[1],n,!0),d=o.concat([A,c]);o.dispose(A),o.dispose(c);let y=z0.execute(d);o.dispose(d);let l=await y.data();o.dispose(y);let m=l.slice(0,Ge.numCoordinates*3),{rawCoords:x,iris:p}=V1(m,r,s,!0),f=l.slice(Ge.numCoordinates*3),{rawCoords:h,iris:v}=V1(f,a,i,!1),T=bs(e);Math.abs(T)<30?(C2(e,x,"left",null),C2(e,h,"right",null)):T<1?C2(e,x,"left",["EyeUpper0","EyeLower0"]):C2(e,h,"right",["EyeUpper0","EyeLower0"]);let u=Z1(e,p,"left"),g=Z1(e,v,"right");return e.concat(u).concat(g)}async function Y1(e,t){var A,a,i,c,d,y,l,m,x,p;let n={lips:await((a=(A=t.filter(f=>f.size===160))==null?void 0:A[0])==null?void 0:a.data()),irisL:await((c=(i=t.filter(f=>f.size===10))==null?void 0:i[0])==null?void 0:c.data()),eyeL:await((y=(d=t.filter(f=>f.size===142))==null?void 0:d[0])==null?void 0:y.data()),irisR:await((m=(l=t.filter(f=>f.size===10))==null?void 0:l[1])==null?void 0:m.data()),eyeR:await((p=(x=t.filter(f=>f.size===142))==null?void 0:x[1])==null?void 0:p.data())};for(let f of Object.values(n))if(!f)return e;let r=Me.reduce((f,h)=>f+=e[h][2],0)/Me.length;for(let f=0;ff+=e[h][2],0)/Pe.length;for(let f=0;fR()-K0.timestamp,r=K0.skipped<(((d=t.face.detector)==null?void 0:d.skipFrames)||0);!t.skipAllowed||!n||!r||K0.boxes.length===0?(K0.boxes=await B1(e,t),K0.timestamp=R(),K0.skipped=0):K0.skipped++;let s=[],A=[],a=0,i=o2;for(let T=0;T[N[0]/(e.shape[2]||0),N[1]/(e.shape[1]||0),(N[2]||0)/i]);for(let N of Object.keys(ve))k.annotations[N]=[k.mesh[ve[N]]]}else if(!K)t.debug&&b("face mesh detection requested, but model is not loaded");else{if((x=t.face.attention)!=null&&x.enabled&&!M.kernels.includes("atan2"))return t.face.attention.enabled=!1,o.dispose(k.tensor),s;let N=K.execute(k.tensor),V=await N.find(D=>D.shape[D.shape.length-1]===1).data();if(k.faceScore=Math.round(100*V[0])/100,k.faceScore<(((p=t.face.detector)==null?void 0:p.minConfidence)||1)){if(u.confidence=k.faceScore,t.face.mesh.keepInvalid){k.box=j2(u,e),k.boxRaw=I2(u,e),k.size=u.size,k.score=k.boxScore,k.mesh=u.landmarks,k.meshRaw=k.mesh.map(D=>[D[0]/(e.shape[2]||1),D[1]/(e.shape[1]||1),(D[2]||0)/i]);for(let D of Object.keys(ve))k.annotations[D]=[k.mesh[ve[D]]]}}else{let D=N.find(U=>U.shape[U.shape.length-1]===1404),Z=o.reshape(D,[-1,3]),J=await Z.array();o.dispose(Z),(f=t.face.attention)!=null&&f.enabled?J=await Y1(J,N):(h=t.face.iris)!=null&&h.enabled&&(J=await q1(J,k.tensor,o2)),k.mesh=L1(J,u,g,E,o2),k.meshRaw=k.mesh.map(U=>[U[0]/(e.shape[2]||0),U[1]/(e.shape[1]||0),(U[2]||0)/i]);for(let U of Object.keys(F0))k.annotations[U]=F0[U].map(m0=>k.mesh[m0]);k.score=k.faceScore;let q={...C1(k.mesh,u),confidence:u.confidence,landmarks:u.landmarks,size:u.size};k.box=j2(q,e),k.boxRaw=I2(q,e),k.size=q.size,A.push(q)}o.dispose(N)}k.score>(((v=t.face.detector)==null?void 0:v.minConfidence)||1)?s.push(k):o.dispose(k.tensor)}return K0.boxes=A,s}async function J1(e){var t,n,r,s,A,a;return M.initial&&(K=null),(t=e.face.attention)!=null&&t.enabled&&(K!=null&&K.signature)&&Object.keys(((n=K==null?void 0:K.signature)==null?void 0:n.outputs)||{}).length<6&&(K=null),K?e.debug&&b("cached model:",K.modelUrl):(r=e.face.attention)!=null&&r.enabled?K=await L(e.face.attention.modelPath):K=await L((s=e.face.mesh)==null?void 0:s.modelPath),o2=K.executor&&((A=K==null?void 0:K.inputs)!=null&&A[0].shape)?(a=K==null?void 0:K.inputs)==null?void 0:a[0].shape[2]:256,K}var Q1=Re,_1=t2;var Gt=[],d0,W2=[],$1=0,e3=0,Ht=Number.MAX_SAFE_INTEGER,Vt=!1;async function t3(e){var t,n,r;return M.initial&&(d0=null),d0?e.debug&&b("cached model:",d0.modelUrl):(d0=await L((t=e.face.emotion)==null?void 0:t.modelPath),Vt=((r=(n=d0==null?void 0:d0.inputs)==null?void 0:n[0].shape)==null?void 0:r[3])===3,Vt?Gt=["angry","disgust","fear","happy","neutral","sad","surprise"]:Gt=["angry","disgust","fear","happy","sad","surprise","neutral"]),d0}async function Zt(e,t,n,r){var a,i;if(!d0)return[];let s=Ht<(((a=t.face.emotion)==null?void 0:a.skipFrames)||0),A=(((i=t.face.emotion)==null?void 0:i.skipTime)||0)>R()-e3;return t.skipAllowed&&A&&s&&$1===r&&W2[n]&&W2[n].length>0?(Ht++,W2[n]):(Ht=0,new Promise(async c=>{var y,l,m;let d=[];if((y=t.face.emotion)!=null&&y.enabled){let x={},p=d0!=null&&d0.inputs[0].shape?d0.inputs[0].shape[2]:0;if(((l=t.face.emotion)==null?void 0:l.crop)>0){let h=(m=t.face.emotion)==null?void 0:m.crop,v=[[h,h,1-h,1-h]];x.resize=o.image.cropAndResize(e,v,[0],[p,p])}else x.resize=o.image.resizeBilinear(e,[p,p],!1);Vt?(x.mul=o.mul(x.resize,255),x.normalize=o.sub(x.mul,[103.939,116.779,123.68]),x.emotion=d0==null?void 0:d0.execute(x.normalize)):(x.channels=o.mul(x.resize,O.rgb),x.grayscale=o.sum(x.channels,3,!0),x.grayscaleSub=o.sub(x.grayscale,O.tf05),x.grayscaleMul=o.mul(x.grayscaleSub,O.tf2),x.emotion=d0==null?void 0:d0.execute(x.grayscaleMul)),e3=R();let f=await x.emotion.data();for(let h=0;h(t.face.emotion.minConfidence||0)&&d.push({score:Math.min(.99,Math.trunc(100*f[h])/100),emotion:Gt[h]});d.sort((h,v)=>v.score-h.score),Object.keys(x).forEach(h=>o.dispose(x[h]))}W2[n]=d,$1=r,c(d)}))}var x0,de=[],o3=0,r3=0,Xt=Number.MAX_SAFE_INTEGER;async function s3(e){var t;return M.initial&&(x0=null),x0?e.debug&&b("cached model:",x0.modelUrl):x0=await L((t=e.face.description)==null?void 0:t.modelPath),x0}function Ts(e,t){var A,a;let n=e.image||e.tensor||e;if(!(x0!=null&&x0.inputs[0].shape))return n;let r;if(((A=t.face.description)==null?void 0:A.crop)>0){let i=(a=t.face.description)==null?void 0:a.crop,c=[[i,i,1-i,1-i]];r=o.image.cropAndResize(n,c,[0],[x0.inputs[0].shape[2],x0.inputs[0].shape[1]])}else r=o.image.resizeBilinear(n,[x0.inputs[0].shape[2],x0.inputs[0].shape[1]],!1);let s=o.mul(r,O.tf255);return o.dispose(r),s}async function qt(e,t,n,r){var i,c,d,y;let s={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(x0!=null&&x0.executor))return s;let A=Xt<(((i=t.face.description)==null?void 0:i.skipFrames)||0),a=(((c=t.face.description)==null?void 0:c.skipTime)||0)>R()-o3;return t.skipAllowed&&A&&a&&r3===r&&((d=de==null?void 0:de[n])==null?void 0:d.age)>0&&((y=de==null?void 0:de[n])==null?void 0:y.genderScore)>0?(Xt++,de[n]):(Xt=0,new Promise(async l=>{var m;if((m=t.face.description)!=null&&m.enabled){let x=Ts(e,t),p=x0==null?void 0:x0.execute(x);o3=R(),o.dispose(x);let h=await p.find(W=>W.shape[1]===1).data(),v=Math.trunc(200*Math.abs(h[0]-.5))/100;v>(t.face.description.minConfidence||0)&&(s.gender=h[0]<=.5?"female":"male",s.genderScore=Math.min(.99,v));let T=o.argMax(p.find(W=>W.shape[1]===100),1),u=(await T.data())[0];o.dispose(T);let E=await p.find(W=>W.shape[1]===100).data();s.age=Math.round(E[u-1]>E[u+1]?10*u-100*E[u-1]:10*u+100*E[u+1])/10,(Number.isNaN(h[0])||Number.isNaN(E[0]))&&b("faceres error:",{model:x0,result:p});let k=p.find(W=>W.shape[1]===1024),N=k?await k.data():[];s.descriptor=Array.from(N),p.forEach(W=>o.dispose(W))}de[n]=s,r3=r,l(s)}))}var Ve=.1,Ut=.5;function vs(e,t,n){let r=!1,s=n.length-1;for(let A=0;At!=n[s].y>t&&e<(n[s].x-n[A].x)*(t-n[A].y)/(n[s].y-n[A].y)+n[A].x&&(r=!r);return r}async function a3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,r=await e.tensor.buffer(),s=[];for(let a of F0.silhouette)s.push({x:(e.mesh[a][0]-e.box[0])/e.box[2],y:(e.mesh[a][1]-e.box[1])/e.box[3]});Ve&&Ve>0&&(s=s.map(a=>({x:a.x>.5?a.x+Ve:a.x-Ve,y:a.y>.5?a.y+Ve:a.y-Ve})));for(let a=0;aR()-l3,A=Yt<(((i=t.face.antispoof)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&s&&A&&i3===r&&D2[n]?(Yt++,D2[n]):(Yt=0,new Promise(async c=>{let d=o.image.resizeBilinear(e,[y0!=null&&y0.inputs[0].shape?y0.inputs[0].shape[2]:0,y0!=null&&y0.inputs[0].shape?y0.inputs[0].shape[1]:0],!1),y=y0==null?void 0:y0.execute(d),l=(await y.data())[0];D2[n]=Math.round(100*l)/100,i3=r,l3=R(),o.dispose([d,y]),c(D2[n])}))}var f0,F2=[],Jt=Number.MAX_SAFE_INTEGER,x3=0,y3=0;async function f3(e){var t;return M.initial&&(f0=null),f0?e.debug&&b("cached model:",f0.modelUrl):f0=await L((t=e.face.liveness)==null?void 0:t.modelPath),f0}async function Qt(e,t,n,r){var a,i;if(!(f0!=null&&f0.executor))return 0;let s=(((a=t.face.liveness)==null?void 0:a.skipTime)||0)>R()-y3,A=Jt<(((i=t.face.liveness)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&s&&A&&x3===r&&F2[n]?(Jt++,F2[n]):(Jt=0,new Promise(async c=>{let d=o.image.resizeBilinear(e,[f0!=null&&f0.inputs[0].shape?f0.inputs[0].shape[2]:0,f0!=null&&f0.inputs[0].shape?f0.inputs[0].shape[1]:0],!1),y=f0==null?void 0:f0.execute(d),l=(await y.data())[0];F2[n]=Math.round(100*l)/100,x3=r,y3=R(),o.dispose([d,y]),c(F2[n])}))}var B0,_t=[],Ms=["white","black","asian","indian","other"],Ps=[15,23,28,35.5,45.5,55.5,65],p3=0,u3=0,$t=Number.MAX_SAFE_INTEGER;async function h3(e){var t;return M.initial&&(B0=null),B0?e.debug&&b("cached model:",B0.modelUrl):B0=await L((t=e.face.gear)==null?void 0:t.modelPath),B0}async function e5(e,t,n,r){var a,i;if(!B0)return{age:0,gender:"unknown",genderScore:0,race:[]};let s=$t<(((a=t.face.gear)==null?void 0:a.skipFrames)||0),A=(((i=t.face.gear)==null?void 0:i.skipTime)||0)>R()-u3;return t.skipAllowed&&A&&s&&p3===r&&_t[n]?($t++,_t[n]):($t=0,new Promise(async c=>{var v,T,u,g;if(!(B0!=null&&B0.inputs[0].shape))return;let d={},y=[[0,.1,.9,.9]];if(((v=t.face.gear)==null?void 0:v.crop)>0){let E=(T=t.face.gear)==null?void 0:T.crop;y=[[E,E,1-E,1-E]]}d.resize=o.image.cropAndResize(e,y,[0],[B0.inputs[0].shape[2],B0.inputs[0].shape[1]]);let l={age:0,gender:"unknown",genderScore:0,race:[]};(u=t.face.gear)!=null&&u.enabled&&([d.age,d.gender,d.race]=B0.execute(d.resize,["age_output","gender_output","race_output"]));let m=await d.gender.data();l.gender=m[0]>m[1]?"male":"female",l.genderScore=Math.round(100*(m[0]>m[1]?m[0]:m[1]))/100;let x=await d.race.data();for(let E=0;E(((g=t.face.gear)==null?void 0:g.minConfidence)||.2)&&l.race.push({score:Math.round(100*x[E])/100,race:Ms[E]});l.race.sort((E,k)=>k.score-E.score);let f=Array.from(await d.age.data()).map((E,k)=>[Ps[k],E]).sort((E,k)=>k[1]-E[1]),h=f[0][0];for(let E=1;Eo.dispose(d[E])),_t[n]=l,p3=r,u3=R(),c(l)}))}var R0,B2=[],g3=0,T3=0,t5=Number.MAX_SAFE_INTEGER;async function v3(e){return M.initial&&(R0=null),R0?e.debug&&b("cached model:",R0.modelUrl):R0=await L(e.face.ssrnet.modelPathAge),R0}async function n5(e,t,n,r){var a,i,c,d;if(!R0)return{age:0};let s=t5<(((a=t.face.ssrnet)==null?void 0:a.skipFrames)||0),A=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>R()-T3;return t.skipAllowed&&s&&A&&g3===r&&((c=B2[n])!=null&&c.age)&&((d=B2[n])==null?void 0:d.age)>0?(t5++,B2[n]):(t5=0,new Promise(async y=>{var x,p,f;if(!(R0!=null&&R0.inputs)||!R0.inputs[0]||!R0.inputs[0].shape)return;let l={};if(((x=t.face.ssrnet)==null?void 0:x.crop)>0){let h=(p=t.face.ssrnet)==null?void 0:p.crop,v=[[h,h,1-h,1-h]];l.resize=o.image.cropAndResize(e,v,[0],[R0.inputs[0].shape[2],R0.inputs[0].shape[1]])}else l.resize=o.image.resizeBilinear(e,[R0.inputs[0].shape[2],R0.inputs[0].shape[1]],!1);l.enhance=o.mul(l.resize,O.tf255);let m={age:0};if((f=t.face.ssrnet)!=null&&f.enabled&&(l.age=R0.execute(l.enhance)),l.age){let h=await l.age.data();m.age=Math.trunc(10*h[0])/10}Object.keys(l).forEach(h=>o.dispose(l[h])),B2[n]=m,g3=r,T3=R(),y(m)}))}var u0,H2=[],M3=0,P3=0,o5=Number.MAX_SAFE_INTEGER,r5=[.2989,.587,.114];async function k3(e){var t;return M.initial&&(u0=null),u0?e.debug&&b("cached model:",u0.modelUrl):u0=await L((t=e.face.ssrnet)==null?void 0:t.modelPathGender),u0}async function s5(e,t,n,r){var a,i,c,d;if(!u0)return{gender:"unknown",genderScore:0};let s=o5<(((a=t.face.ssrnet)==null?void 0:a.skipFrames)||0),A=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>R()-P3;return t.skipAllowed&&s&&A&&M3===r&&((c=H2[n])!=null&&c.gender)&&((d=H2[n])==null?void 0:d.genderScore)>0?(o5++,H2[n]):(o5=0,new Promise(async y=>{var p,f,h;if(!(u0!=null&&u0.inputs[0].shape))return;let l={};if(((p=t.face.ssrnet)==null?void 0:p.crop)>0){let v=(f=t.face.ssrnet)==null?void 0:f.crop,T=[[v,v,1-v,1-v]];l.resize=o.image.cropAndResize(e,T,[0],[u0.inputs[0].shape[2],u0.inputs[0].shape[1]])}else l.resize=o.image.resizeBilinear(e,[u0.inputs[0].shape[2],u0.inputs[0].shape[1]],!1);l.enhance=o.tidy(()=>{var T,u;let v;if(((u=(T=u0==null?void 0:u0.inputs)==null?void 0:T[0].shape)==null?void 0:u[3])===1){let[g,E,k]=o.split(l.resize,3,3),N=o.mul(g,r5[0]),W=o.mul(E,r5[1]),V=o.mul(k,r5[2]),D=o.addN([N,W,V]);v=o.mul(o.sub(D,O.tf05),2)}else v=o.mul(o.sub(l.resize,O.tf05),2);return v});let m={gender:"unknown",genderScore:0};(h=t.face.ssrnet)!=null&&h.enabled&&(l.gender=u0.execute(l.enhance));let x=await l.gender.data();m.gender=x[0]>x[1]?"female":"male",m.genderScore=x[0]>x[1]?Math.trunc(100*x[0])/100:Math.trunc(100*x[1])/100,Object.keys(l).forEach(v=>o.dispose(l[v])),H2[n]=m,M3=r,P3=R(),y(m)}))}var S0,A5=[],E3=0,z3=0,S3=Number.MAX_SAFE_INTEGER;async function j3(e){var t;return M.initial&&(S0=null),S0?e.debug&&b("cached model:",S0.modelUrl):S0=await L((t=e.face.mobilefacenet)==null?void 0:t.modelPath),S0}async function a5(e,t,n,r){var a,i;if(!(S0!=null&&S0.executor))return[];let s=S3<(((a=t.face.mobilefacenet)==null?void 0:a.skipFrames)||0),A=(((i=t.face.mobilefacenet)==null?void 0:i.skipTime)||0)>R()-z3;return t.skipAllowed&&A&&s&&E3===r&&A5[n]?(S3++,A5[n]):new Promise(async c=>{var y;let d=[];if((y=t.face.mobilefacenet)!=null&&y.enabled&&(S0!=null&&S0.inputs[0].shape)){let l={};l.crop=o.image.resizeBilinear(e,[S0.inputs[0].shape[2],S0.inputs[0].shape[1]],!1),l.data=S0.execute(l.crop);let m=await l.data.data();d=Array.from(m),Object.keys(l).forEach(x=>o.dispose(l[x]))}A5[n]=d,E3=r,z3=R(),c(d)})}var j0,i5=[],N3=0,L3=0,O3=Number.MAX_SAFE_INTEGER;async function C3(e){return M.initial&&(j0=null),j0?e.debug&&b("cached model:",j0.modelUrl):j0=await L(e.face.insightface.modelPath),j0}async function l5(e,t,n,r){var a,i;if(!(j0!=null&&j0.executor))return[];let s=O3<(((a=t.face.insightface)==null?void 0:a.skipFrames)||0),A=(((i=t.face.insightface)==null?void 0:i.skipTime)||0)>R()-L3;return t.skipAllowed&&A&&s&&N3===r&&i5[n]?(O3++,i5[n]):new Promise(async c=>{var y;let d=[];if((y=t.face.insightface)!=null&&y.enabled&&(j0!=null&&j0.inputs[0].shape)){let l={};l.crop=o.image.resizeBilinear(e,[j0.inputs[0].shape[2],j0.inputs[0].shape[1]],!1),l.data=j0.execute(l.crop);let m=await l.data.data();d=Array.from(m),Object.keys(l).forEach(x=>o.dispose(l[x]))}i5[n]=d,N3=r,L3=R(),c(d)})}var ks=e=>{let t=(l,m)=>Math.atan2(l[1]-m[1],l[0]-m[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],r=1,s=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),A=s?e.mesh[473]:e.mesh[468],a=s?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],i=s?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],c=[(a[0]-A[0])/i[0]-n[0],r*(A[1]-a[1])/i[1]-n[1]],d=Math.sqrt(c[0]*c[0]+c[1]*c[1]);return d=Math.min(d,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],c)+Math.PI/2)%Math.PI,strength:d}},D3=(e,t)=>{let n=f=>{let h=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=h,f[1]/=h,f[2]/=h,f},r=(f,h)=>{let v=f[0]-h[0],T=f[1]-h[1],u=f[2]-h[2];return[v,T,u]},s=(f,h)=>{let v=f[1]*h[2]-f[2]*h[1],T=f[2]*h[0]-f[0]*h[2],u=f[0]*h[1]-f[1]*h[0];return[v,T,u]},A=f=>{let[h,v,T,u,g,E,k,N,W]=f,V,D,Z;return u<1?u>-1?(Z=Math.asin(u),D=Math.atan2(-k,h),V=Math.atan2(-E,g)):(Z=-Math.PI/2,D=-Math.atan2(N,W),V=0):(Z=Math.PI/2,D=Math.atan2(N,W),V=0),Number.isNaN(V)&&(V=0),Number.isNaN(D)&&(D=0),Number.isNaN(Z)&&(Z=0),{pitch:2*-V,yaw:2*-D,roll:2*-Z}},a=e.meshRaw;if(!a||a.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let i=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,c=[a[10],a[152],a[234],a[454]].map(f=>[f[0]*t[0]/i,f[1]*t[1]/i,f[2]]),d=n(r(c[1],c[0])),y=n(r(c[3],c[2])),l=n(s(y,d));y=s(d,l);let m=[y[0],y[1],y[2],d[0],d[1],d[2],l[0],l[1],l[2]],x=A(m),p=a.length===478?ks(e):{bearing:0,strength:0};return{angle:x,matrix:m,gaze:p}};function F3(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let r=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/r)/100}var c5=async(e,t)=>{var p,f,h,v,T,u,g,E,k,N,W,V,D,Z,J,q,U,m0,P,i0,g0,e0,G;let n=R(),r,s,A,a,i,c,d,y,l,m=[];e.state="run:face";let x=await K1(t,e.config);if(e.performance.face=M.perfadd?(e.performance.face||0)+Math.trunc(R()-n):Math.trunc(R()-n),!t.shape||t.shape.length!==4)return[];if(!x)return[];for(let S=0;S200?D3(x[S],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?a=(f=e.config.face.emotion)!=null&&f.enabled?Zt(x[S].tensor||o.tensor([]),e.config,S,x.length):[]:(e.state="run:emotion",n=R(),a=(h=e.config.face.emotion)!=null&&h.enabled?await Zt(x[S].tensor||o.tensor([]),e.config,S,x.length):[],e.performance.emotion=M.perfadd?(e.performance.emotion||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?d=(v=e.config.face.antispoof)!=null&&v.enabled?Kt(x[S].tensor||o.tensor([]),e.config,S,x.length):0:(e.state="run:antispoof",n=R(),d=(T=e.config.face.antispoof)!=null&&T.enabled?await Kt(x[S].tensor||o.tensor([]),e.config,S,x.length):0,e.performance.antispoof=M.perfadd?(e.performance.antispoof||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?y=(u=e.config.face.liveness)!=null&&u.enabled?Qt(x[S].tensor||o.tensor([]),e.config,S,x.length):0:(e.state="run:liveness",n=R(),y=(g=e.config.face.liveness)!=null&&g.enabled?await Qt(x[S].tensor||o.tensor([]),e.config,S,x.length):0,e.performance.liveness=M.perfadd?(e.performance.antispoof||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?s=(E=e.config.face.gear)!=null&&E.enabled?e5(x[S].tensor||o.tensor([]),e.config,S,x.length):null:(e.state="run:gear",n=R(),s=(k=e.config.face.gear)!=null&&k.enabled?await e5(x[S].tensor||o.tensor([]),e.config,S,x.length):null,e.performance.gear=Math.trunc(R()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(r=(N=e.config.face.ssrnet)!=null&&N.enabled?n5(x[S].tensor||o.tensor([]),e.config,S,x.length):null,A=(W=e.config.face.ssrnet)!=null&&W.enabled?s5(x[S].tensor||o.tensor([]),e.config,S,x.length):null):(e.state="run:ssrnet",n=R(),r=(V=e.config.face.ssrnet)!=null&&V.enabled?await n5(x[S].tensor||o.tensor([]),e.config,S,x.length):null,A=(D=e.config.face.ssrnet)!=null&&D.enabled?await s5(x[S].tensor||o.tensor([]),e.config,S,x.length):null,e.performance.ssrnet=Math.trunc(R()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?i=(Z=e.config.face.mobilefacenet)!=null&&Z.enabled?a5(x[S].tensor||o.tensor([]),e.config,S,x.length):null:(e.state="run:mobilefacenet",n=R(),i=(J=e.config.face.mobilefacenet)!=null&&J.enabled?await a5(x[S].tensor||o.tensor([]),e.config,S,x.length):null,e.performance.mobilefacenet=Math.trunc(R()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?c=(q=e.config.face.insightface)!=null&&q.enabled?l5(x[S].tensor||o.tensor([]),e.config,S,x.length):null:(e.state="run:mobilefacenet",n=R(),c=(U=e.config.face.insightface)!=null&&U.enabled?await l5(x[S].tensor||o.tensor([]),e.config,S,x.length):null,e.performance.mobilefacenet=Math.trunc(R()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?l=qt(x[S].tensor||o.tensor([]),e.config,S,x.length):(e.state="run:description",n=R(),l=await qt(x[S].tensor||o.tensor([]),e.config,S,x.length),e.performance.description=M.perfadd?(e.performance.description||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End Description:"),e.config.async&&([r,A,a,i,c,l,s,d,y]=await Promise.all([r,A,a,i,c,l,s,d,y])),e.analyze("Finish Face:"),(m0=e.config.face.ssrnet)!=null&&m0.enabled&&r&&A&&(l={...l,age:r.age,gender:A.gender,genderScore:A.genderScore}),(P=e.config.face.gear)!=null&&P.enabled&&s&&(l={...l,age:s.age,gender:s.gender,genderScore:s.genderScore,race:s.race}),(i0=e.config.face.mobilefacenet)!=null&&i0.enabled&&i&&(l.descriptor=i),(g0=e.config.face.insightface)!=null&&g0.enabled&&c&&(l.descriptor=c);let F=(e0=e.config.face.iris)!=null&&e0.enabled?F3(x[S],t.shape[2]):0,w0=(G=e.config.face.detector)!=null&&G.return?o.squeeze(x[S].tensor):null;o.dispose(x[S].tensor),x[S].tensor&&delete x[S].tensor;let t0={...x[S],id:S};l.age&&(t0.age=l.age),l.gender&&(t0.gender=l.gender),l.genderScore&&(t0.genderScore=l.genderScore),l.descriptor&&(t0.embedding=l.descriptor),l.race&&(t0.race=l.race),a&&(t0.emotion=a),d&&(t0.real=d),y&&(t0.live=y),F>0&&(t0.distance=F),C&&(t0.rotation=C),w0&&(t0.tensor=w0),m.push(t0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),m};var M0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>M0.nameMapping[e],getPoints:e=>M0.pointsMapping[e]},ye={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>ye.nameMapping[e]},$={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>$.nameMapping[e]},xe=class{constructor(t){z(this,"name");z(this,"curls");z(this,"directions");z(this,"weights");z(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,r){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,r])}direction(t,n,r){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,r])}weight(t,n){this.weights[t]=n;let r=this.weights.reduce((s,A)=>s+A,0);this.weightsRelative=this.weights.map(s=>s*5/r)}matchAgainst(t,n){let r=0;for(let s in t){let A=t[s],a=this.curls[s];if(typeof a=="undefined"){r+=this.weightsRelative[s];continue}for(let[i,c]of a)if(A===i){r+=c*this.weightsRelative[s];break}}for(let s in n){let A=n[s],a=this.directions[s];if(typeof a=="undefined"){r+=this.weightsRelative[s];continue}for(let[i,c]of a)if(A===i){r+=c*this.weightsRelative[s];break}}return r/10}};var{thumb:V0,index:_0,middle:$0,ring:ze,pinky:Se}=M0,{none:Z0,half:Es,full:X0}=ye,{verticalUp:Ze,verticalDown:ri,horizontalLeft:d5,horizontalRight:zs,diagonalUpRight:Ss,diagonalUpLeft:Xe,diagonalDownRight:si,diagonalDownLeft:Ai}=$,fe=new xe("thumbs up");fe.curl(V0,Z0,1);fe.direction(V0,Ze,1);fe.direction(V0,Xe,.25);fe.direction(V0,Ss,.25);for(let e of[M0.index,M0.middle,M0.ring,M0.pinky])fe.curl(e,X0,1),fe.direction(e,d5,1),fe.direction(e,zs,1);var s0=new xe("victory");s0.curl(V0,Es,.5);s0.curl(V0,Z0,.5);s0.direction(V0,Ze,1);s0.direction(V0,Xe,1);s0.curl(_0,Z0,1);s0.direction(_0,Ze,.75);s0.direction(_0,Xe,1);s0.curl($0,Z0,1);s0.direction($0,Ze,1);s0.direction($0,Xe,.75);s0.curl(ze,X0,1);s0.direction(ze,Ze,.2);s0.direction(ze,Xe,1);s0.direction(ze,d5,.2);s0.curl(Se,X0,1);s0.direction(Se,Ze,.2);s0.direction(Se,Xe,1);s0.direction(Se,d5,.2);s0.weight(_0,2);s0.weight($0,2);var me=new xe("point");me.curl(V0,X0,1);me.curl(_0,Z0,.5);me.curl($0,X0,.5);me.curl(ze,X0,.5);me.curl(Se,X0,.5);me.weight(_0,2);me.weight($0,2);var pe=new xe("middle finger");pe.curl(V0,Z0,1);pe.curl(_0,X0,.5);pe.curl($0,X0,.5);pe.curl(ze,X0,.5);pe.curl(Se,X0,.5);pe.weight(_0,2);pe.weight($0,2);var qe=new xe("open palm");qe.curl(V0,Z0,.75);qe.curl(_0,Z0,.75);qe.curl($0,Z0,.75);qe.curl(ze,Z0,.75);qe.curl(Se,Z0,.75);var B3=[fe,s0,me,pe,qe];var js=.7,je={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function H3(e,t,n,r){let s=(t-r)/(e-n),A=Math.atan(s)*180/Math.PI;return A<=0?A=-A:A>0&&(A=180-A),A}function V3(e,t){if(!e||!t)return[0,0];let n=H3(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let r=H3(e[1],e[2],t[1],t[2]);return[n,r]}function G3(e,t=1){let n=0,r=0,s=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?r=1*t:s=1*t,[n,r,s]}function Is(e,t,n){let r=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],i=e[1]-n[1],c=t[1]-n[1],d=e[2]-t[2],y=e[2]-n[2],l=t[2]-n[2],m=Math.sqrt(r*r+a*a+d*d),x=Math.sqrt(s*s+i*i+y*y),p=Math.sqrt(A*A+c*c+l*l),f=(p*p+m*m-x*x)/(2*p*m);f>1?f=1:f<-1&&(f=-1);let h=Math.acos(f);h=57.2958*h%180;let v;return h>je.NO_CURL_START_LIMIT?v=ye.none:h>je.HALF_CURL_START_LIMIT?v=ye.half:v=ye.full,v}function Z3(e,t,n,r){let s;return r===Math.abs(e)?e>0?s=$.horizontalLeft:s=$.horizontalRight:r===Math.abs(t)?t>0?s=$.horizontalLeft:s=$.horizontalRight:n>0?s=$.horizontalLeft:s=$.horizontalRight,s}function X3(e,t,n,r){let s;return r===Math.abs(e)?e<0?s=$.verticalDown:s=$.verticalUp:r===Math.abs(t)?t<0?s=$.verticalDown:s=$.verticalUp:n<0?s=$.verticalDown:s=$.verticalUp,s}function Ns(e,t,n,r,s,A,a,i){let c,d=X3(e,t,n,r),y=Z3(s,A,a,i);return d===$.verticalUp?y===$.horizontalLeft?c=$.diagonalUpLeft:c=$.diagonalUpRight:y===$.horizontalLeft?c=$.diagonalDownLeft:c=$.diagonalDownRight,c}function Ls(e,t,n,r){let s=e[0]-t[0],A=e[0]-n[0],a=t[0]-n[0],i=e[1]-t[1],c=e[1]-n[1],d=t[1]-n[1],y=Math.max(Math.abs(s),Math.abs(A),Math.abs(a)),l=Math.max(Math.abs(i),Math.abs(c),Math.abs(d)),m=0,x=0,p=0,f=l/(y+1e-5);f>1.5?m+=je.DISTANCE_VOTE_POWER:f>.66?x+=je.DISTANCE_VOTE_POWER:p+=je.DISTANCE_VOTE_POWER;let h=Math.sqrt(s*s+i*i),v=Math.sqrt(A*A+c*c),T=Math.sqrt(a*a+d*d),u=Math.max(h,v,T),g=e[0],E=e[1],k=n[0],N=n[1];u===h?(k=n[0],N=n[1]):u===T&&(g=t[0],E=t[1]);let D=V3([g,E],[k,N]),Z=G3(D,je.TOTAL_ANGLE_VOTE_POWER);m+=Z[0],x+=Z[1],p+=Z[2];for(let q of r){let U=G3(q,je.SINGLE_ANGLE_VOTE_POWER);m+=U[0],x+=U[1],p+=U[2]}let J;return m===Math.max(m,x,p)?J=X3(c,i,d,l):p===Math.max(x,p)?J=Z3(A,s,a,y):J=Ns(c,i,d,l,A,s,a,y),J}function q3(e){let t=[],n=[],r=[],s=[];if(!e)return{curls:r,directions:s};for(let A of M0.all){let a=M0.getPoints(A),i=[],c=[];for(let d of a){let y=e[d[0]],l=e[d[1]],m=V3(y,l),x=m[0],p=m[1];i.push(x),c.push(p)}t.push(i),n.push(c)}for(let A of M0.all){let a=A===M0.thumb?1:0,i=M0.getPoints(A),c=e[i[a][0]],d=e[i[a+1][1]],y=e[i[3][1]],l=Is(c,d,y),m=Ls(c,d,y,t[A].slice(a));r[A]=l,s[A]=m}return{curls:r,directions:s}}function G2(e){if(!e||e.length===0)return null;let t=q3(e),n={};for(let r of M0.all)n[M0.getName(r)]={curl:ye.getName(t.curls[r]),direction:$.getName(t.directions[r])};return n}function U3(e){let t=[];if(!e||e.length===0)return t;let n=q3(e);for(let r of B3){let s=r.matchAgainst(n.curls,n.directions);s>=js&&t.push({name:r.name,confidence:s})}return t}var Y3=e=>{if(!e)return[];let t=[];for(let n=0;nc.part==="leftWrist"),s=e[n].keypoints.find(c=>c.part==="rightWrist"),A=e[n].keypoints.find(c=>c.part==="nose");A&&r&&s&&r.position[1]c.part==="leftShoulder"),i=e[n].keypoints.find(c=>c.part==="rightShoulder");a&&i&&Math.abs(a.positionRaw[1]-i.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${a.position[1]>i.position[1]?"left":"right"}`})}return t},K3=e=>{if(!e)return[];let t=[];for(let n=0;n450){let r=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),s=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(r/s)<=.15?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 c=e[n].mesh[152][2]||0;Math.abs(c)>10&&t.push({face:n,gesture:`head ${c<0?"up":"down"}`})}return t},J3=e=>{var n,r,s,A;if(!e)return[];let t=[];for(let a=0;a.06||h>.06)&&(x=!1),f>h?h>.04&&t.push({iris:a,gesture:"looking right"}):f>.04&&t.push({iris:a,gesture:"looking left"});let v=Math.abs(e[a].mesh[145][1]-e[a].annotations.rightEyeIris[0][1])/e[a].box[3],T=Math.abs(e[a].mesh[374][1]-e[a].annotations.leftEyeIris[0][1])/e[a].box[3];(T<.01||v<.01||T>.022||v>.022)&&(x=!1),(T<.01||v<.01)&&t.push({iris:a,gesture:"looking down"}),(T>.022||v>.022)&&t.push({iris:a,gesture:"looking up"}),x&&t.push({iris:a,gesture:"looking center"})}return t},Q3=e=>{if(!e)return[];let t=[];for(let n=0;n0){let s=r.reduce((a,i)=>(a.position[2]||0)<(i.position[2]||0)?a:i);t.push({hand:n,gesture:`${s.name} forward`});let A=r.reduce((a,i)=>a.position[1][A[0]*t[0],A[1]*t[1]]);return{startPoint:n,endPoint:r,palmLandmarks:s,confidence:e.confidence}}function Z2(e,t=1.5){let n=r2(e),r=V2(e),s=[t*r[0]/2,t*r[1]/2],A=[n[0]-s[0],n[1]-s[1]],a=[n[0]+s[0],n[1]+s[1]];return{startPoint:A,endPoint:a,palmLandmarks:e.palmLandmarks}}function X2(e){let t=r2(e),n=V2(e),s=Math.max(...n)/2,A=[t[0]-s,t[1]-s],a=[t[0]+s,t[1]+s];return{startPoint:A,endPoint:a,palmLandmarks:e.palmLandmarks}}function Cs(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function nn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return Cs(n)}var _3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function ue(e,t){let n=0;for(let r=0;r[a.x,a.y]),this.anchorsTensor=o.tensor2d(this.anchors),this.inputSize=((A=(s=(r=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:r[0])==null?void 0:s.shape)==null?void 0:A[2])||0,this.inputSizeTensor=o.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=o.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=o.slice(t,[0,0],[-1,2]),n.boxSizes=o.slice(t,[0,2],[-1,2]),n.div=o.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=o.add(n.div,this.anchorsTensor),n.halfBoxSizes=o.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=o.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=o.mul(n.sub,this.inputSizeTensor),n.add=o.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=o.mul(n.add,this.inputSizeTensor);let r=o.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(s=>o.dispose(n[s])),r}normalizeLandmarks(t,n){let r={};r.reshape=o.reshape(t,[-1,7,2]),r.div=o.div(r.reshape,this.inputSizeTensor),r.landmarks=o.add(r.div,this.anchors[n]?this.anchors[n]:0);let s=o.mul(r.landmarks,this.inputSizeTensor);return Object.keys(r).forEach(A=>o.dispose(r[A])),s}async predict(t,n){var i;let r={};r.resize=o.image.resizeBilinear(t,[this.inputSize,this.inputSize]),r.div=o.div(r.resize,O.tf127),r.image=o.sub(r.div,O.tf1),r.batched=this.model.execute(r.image),r.predictions=o.squeeze(r.batched),r.slice=o.slice(r.predictions,[0,0],[-1,1]),r.sigmoid=o.sigmoid(r.slice),r.scores=o.squeeze(r.sigmoid);let s=await r.scores.data();r.boxes=o.slice(r.predictions,[0,1],[-1,4]),r.norm=this.normalizeBoxes(r.boxes),r.nms=await o.image.nonMaxSuppressionAsync(r.norm,r.scores,3*(((i=n.hand)==null?void 0:i.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let A=await r.nms.array(),a=[];for(let c of A){let d={};d.box=o.slice(r.norm,[c,0],[1,-1]),d.slice=o.slice(r.predictions,[c,5],[1,14]),d.norm=this.normalizeLandmarks(d.slice,c),d.palmLandmarks=o.reshape(d.norm,[-1,2]);let y=await d.box.data(),l=y.slice(0,2),m=y.slice(2,4),x=await d.palmLandmarks.array(),p={startPoint:l,endPoint:m,palmLandmarks:x,confidence:s[c]},f=tn(p,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);a.push(f),Object.keys(d).forEach(h=>o.dispose(d[h]))}return Object.keys(r).forEach(c=>o.dispose(r[c])),a}};var Bs=5,An=1.65,an=[0,5,9,13,17,1,2],Hs=0,Gs=2,ln=0,U2=class{constructor(t,n){z(this,"handDetector");z(this,"handPoseModel");z(this,"inputSize");z(this,"storedBoxes");z(this,"skipped");z(this,"detectedHands");var r,s,A;this.handDetector=t,this.handPoseModel=n,this.inputSize=((A=(s=(r=this.handPoseModel)==null?void 0:r.inputs)==null?void 0:s[0].shape)==null?void 0:A[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(a=>a[0]),r=t.map(a=>a[1]),s=[Math.min(...n),Math.min(...r)],A=[Math.max(...n),Math.max(...r)];return{startPoint:s,endPoint:A}}getBoxForPalmLandmarks(t,n){let r=t.map(A=>f5([...A,1],n)),s=this.calculateLandmarksBoundingBox(r);return Z2(X2(s),Bs)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),r=Z2(X2(n),An);r.palmLandmarks=[];for(let s=0;s[a[0]*(x[0]-this.inputSize/2),a[1]*(x[1]-this.inputSize/2),a[2]*x[2]]),c=y5(r,[0,0]),d=i.map(x=>[...f5(x,c),x[2]]),y=on(s),l=[...r2(n),1],m=[ue(l,y[0]),ue(l,y[1])];return d.map(x=>[Math.trunc(x[0]+m[0]),Math.trunc(x[1]+m[1]),Math.trunc(x[2])])}async estimateHands(t,n){let r=!1,s,A=(n.hand.skipTime||0)>R()-ln,a=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&A&&a?this.skipped++:(s=await this.handDetector.predict(t,n),this.skipped=0),s&&s.length>0&&(s.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...s],this.storedBoxes.length>0&&(r=!0));let i=[];for(let c=0;c=n.hand.minConfidence/4){let E=o.reshape(u,[-1,3]),k=await E.array();o.dispose(u),o.dispose(E);let N=this.transformRawCoords(k,f,y,p),W=this.getBoxForHandLandmarks(N);this.storedBoxes[c]={...W,confidence:g};let V={landmarks:N,confidence:g,boxConfidence:d.confidence,fingerConfidence:g,box:{topLeft:W.startPoint,bottomRight:W.endPoint}};i.push(V)}else this.storedBoxes[c]=null;o.dispose(u)}else{let y=Z2(X2(d),An),l={confidence:d.confidence,boxConfidence:d.confidence,fingerConfidence:0,box:{topLeft:y.startPoint,bottomRight:y.endPoint},landmarks:[]};i.push(l)}}return this.storedBoxes=this.storedBoxes.filter(c=>c!==null),this.detectedHands=i.length,i.length>n.hand.maxDetected&&(i.length=n.hand.maxDetected),i}};var cn={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},Ie,Ne,m5;function Zs(){let e=Ie?new q2(Ie):void 0;e&&Ne&&(m5=new U2(e,Ne))}async function p5(e,t){m5||Zs();let n=await m5.estimateHands(e,t);if(!n)return[];let r=[];for(let s=0;sn[s].landmarks[l]);let a=n[s].landmarks,i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],c=[0,0,0,0];if(a&&a.length>0){for(let y of a)y[0]i[2]&&(i[2]=y[0]),y[1]>i[3]&&(i[3]=y[1]);i[2]-=i[0],i[3]-=i[1],c=[i[0]/(e.shape[2]||0),i[1]/(e.shape[1]||0),i[2]/(e.shape[2]||0),i[3]/(e.shape[1]||0)]}else i=n[s].box?[Math.trunc(Math.max(0,n[s].box.topLeft[0])),Math.trunc(Math.max(0,n[s].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[s].box.bottomRight[0])-Math.max(0,n[s].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[s].box.bottomRight[1])-Math.max(0,n[s].box.topLeft[1]))]:[0,0,0,0],c=[n[s].box.topLeft[0]/(e.shape[2]||0),n[s].box.topLeft[1]/(e.shape[1]||0),(n[s].box.bottomRight[0]-n[s].box.topLeft[0])/(e.shape[2]||0),(n[s].box.bottomRight[1]-n[s].box.topLeft[1])/(e.shape[1]||0)];let d=G2(a);r.push({id:s,score:Math.round(100*n[s].confidence)/100,boxScore:Math.round(100*n[s].boxConfidence)/100,fingerScore:Math.round(100*n[s].fingerConfidence)/100,label:"hand",box:i,boxRaw:c,keypoints:a,annotations:A,landmarks:d})}return r}async function dn(e){var t;return M.initial&&(Ie=null),Ie?e.debug&&b("cached model:",Ie.modelUrl):Ie=await L((t=e.hand.detector)==null?void 0:t.modelPath),Ie}async function xn(e){var t;return M.initial&&(Ne=null),Ne?e.debug&&b("cached model:",Ne.modelUrl):Ne=await L((t=e.hand.skeleton)==null?void 0:t.modelPath),Ne}var r0=[null,null],Xs=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],he=[[0,0],[0,0]],qs=["hand","fist","pinch","point","face","tip","pinchtip"],fn=4,mn=1.6,Us=512,Ys=1.4,Y2=Number.MAX_SAFE_INTEGER,u5=0,ee=[0,0],o0={boxes:[],hands:[]},pn={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function un(e){var t;if(M.initial&&(r0[0]=null),r0[0])e.debug&&b("cached model:",r0[0].modelUrl);else{h2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),r0[0]=await L((t=e.hand.detector)==null?void 0:t.modelPath);let n=r0[0].executor?Object.values(r0[0].modelSignature.inputs):void 0;he[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,he[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return r0[0]}async function hn(e){var t;if(M.initial&&(r0[1]=null),r0[1])e.debug&&b("cached model:",r0[1].modelUrl);else{r0[1]=await L((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=r0[1].executor?Object.values(r0[1].modelSignature.inputs):void 0;he[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,he[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return r0[1]}async function Ks(e,t){let n=[];if(!e||!r0[0])return n;let r={},s=(e.shape[2]||1)/(e.shape[1]||1),A=Math.min(Math.round((e.shape[1]||0)/8)*8,Us),a=Math.round(A*s/8)*8;r.resize=o.image.resizeBilinear(e,[A,a]),r.cast=o.cast(r.resize,"int32"),[r.rawScores,r.rawBoxes]=await r0[0].executeAsync(r.cast,Xs),r.boxes=o.squeeze(r.rawBoxes,[0,2]),r.scores=o.squeeze(r.rawScores,[0]);let i=o.unstack(r.scores,1);o.dispose(i[fn]),i.splice(fn,1),r.filtered=o.stack(i,1),o.dispose(i),r.max=o.max(r.filtered,1),r.argmax=o.argMax(r.filtered,1);let c=0;r.nms=await o.image.nonMaxSuppressionAsync(r.boxes,r.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let d=await r.nms.data(),y=await r.max.data(),l=await r.argmax.data();for(let m of Array.from(d)){let x=o.slice(r.boxes,m,1),p=await x.data();o.dispose(x);let f=[p[1],p[0],p[3]-p[1],p[2]-p[0]],h=k2(f,Ys),v=[Math.trunc(f[0]*ee[0]),Math.trunc(f[1]*ee[1]),Math.trunc(f[2]*ee[0]),Math.trunc(f[3]*ee[1])],T=y[m],u=qs[l[m]],g={id:c++,score:T,box:v,boxRaw:h,label:u};n.push(g)}return Object.keys(r).forEach(m=>o.dispose(r[m])),n.sort((m,x)=>x.score-m.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function h5(e,t,n){let r={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&r0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let s={},A=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];s.crop=o.image.cropAndResize(e,[A],[0],[he[1][0],he[1][1]],"bilinear"),s.div=o.div(s.crop,O.tf255),[s.score,s.keypoints]=r0[1].execute(s.div,["Identity_1","Identity"]);let a=(await s.score.data())[0],i=(100-Math.trunc(100/(1+Math.exp(a))))/100;if(i>=(n.hand.minConfidence||0)){r.fingerScore=i,s.reshaped=o.reshape(s.keypoints,[-1,3]);let y=(await s.reshaped.array()).map(l=>[l[0]/he[1][1],l[1]/he[1][0],l[2]||0]).map(l=>[l[0]*t.boxRaw[2],l[1]*t.boxRaw[3],l[2]||0]);r.keypoints=y.map(l=>[ee[0]*(l[0]+t.boxRaw[0]),ee[1]*(l[1]+t.boxRaw[1]),l[2]||0]),r.landmarks=G2(r.keypoints);for(let l of Object.keys(pn))r.annotations[l]=pn[l].map(m=>r.landmarks&&r.keypoints[m]?r.keypoints[m]:null)}Object.keys(s).forEach(c=>o.dispose(s[c]))}return r}async function b5(e,t){var s,A;if(!((s=r0[0])!=null&&s.executor)||!((A=r0[1])!=null&&A.executor)||!r0[0].inputs[0].shape||!r0[1].inputs[0].shape)return[];ee=[e.shape[2]||0,e.shape[1]||0],Y2++;let n=(t.hand.skipTime||0)>R()-u5,r=Y2<(t.hand.skipFrames||0);return t.skipAllowed&&n&&r?o0.hands:new Promise(async a=>{let i=3*(t.hand.skipTime||0)>R()-u5,c=Y2<3*(t.hand.skipFrames||0);t.skipAllowed&&o0.hands.length===t.hand.maxDetected?o0.hands=await Promise.all(o0.boxes.map(y=>h5(e,y,t))):t.skipAllowed&&i&&c&&o0.hands.length>0?o0.hands=await Promise.all(o0.boxes.map(y=>h5(e,y,t))):(o0.boxes=await Ks(e,t),u5=R(),o0.hands=await Promise.all(o0.boxes.map(y=>h5(e,y,t))),Y2=0);let d=[...o0.boxes];if(o0.boxes.length=0,t.cacheSensitivity>0)for(let y=0;y.05&&l.box[3]/(e.shape[1]||1)>.05&&o0.hands[y].fingerScore&&o0.hands[y].fingerScore>(t.hand.minConfidence||0)){let m=k2(l.box,mn),x=k2(l.boxRaw,mn);o0.boxes.push({...d[y],box:m,boxRaw:x})}}for(let y=0;y({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var s2={};oe(s2,{connected:()=>J2,horizontal:()=>g5,kpt:()=>K2,relative:()=>v5,vertical:()=>T5});var K2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],g5=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],T5=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],v5=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],J2={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var j=te(),R5=0;function gn(e,t){var a,i,c,d,y,l,m,x,p,f,h,v,T,u,g,E,k,N,W,V,D,Z,J,q,U,m0;let n=R();if(!e)return te();let r=Date.now()-e.timestamp,s=r<1e3?8-Math.log(r+1):1;if(e.canvas&&(j.canvas=e.canvas),e.error&&(j.error=e.error),!j.body||e.body.length!==j.body.length)j.body=JSON.parse(JSON.stringify(e.body));else for(let P=0;P((s-1)*j.body[P].box[F]+C)/s),g0=e.body[P].boxRaw.map((C,F)=>((s-1)*j.body[P].boxRaw[F]+C)/s),e0=e.body[P].keypoints.map((C,F)=>{var w0,t0,ne,Ke,Oe,H5,G5,V5,Z5;return{score:C.score,part:C.part,position:[j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].position[0]||0)+(C.position[0]||0))/s:C.position[0],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].position[1]||0)+(C.position[1]||0))/s:C.position[1],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].position[2]||0)+(C.position[2]||0))/s:C.position[2]],positionRaw:[j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].positionRaw[0]||0)+(C.positionRaw[0]||0))/s:C.positionRaw[0],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].positionRaw[1]||0)+(C.positionRaw[1]||0))/s:C.positionRaw[1],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].positionRaw[2]||0)+(C.positionRaw[2]||0))/s:C.positionRaw[2]],distance:[j.body[P].keypoints[F]?((s-1)*(((w0=j.body[P].keypoints[F].distance)==null?void 0:w0[0])||0)+(((t0=C.distance)==null?void 0:t0[0])||0))/s:(ne=C.distance)==null?void 0:ne[0],j.body[P].keypoints[F]?((s-1)*(((Ke=j.body[P].keypoints[F].distance)==null?void 0:Ke[1])||0)+(((Oe=C.distance)==null?void 0:Oe[1])||0))/s:(H5=C.distance)==null?void 0:H5[1],j.body[P].keypoints[F]?((s-1)*(((G5=j.body[P].keypoints[F].distance)==null?void 0:G5[2])||0)+(((V5=C.distance)==null?void 0:V5[2])||0))/s:(Z5=C.distance)==null?void 0:Z5[2]]}}),G={},S={connected:{}};(a=t.body.modelPath)!=null&&a.includes("efficientpose")?S=z2:(i=t.body.modelPath)!=null&&i.includes("blazepose")?S=M2:(c=t.body.modelPath)!=null&&c.includes("movenet")&&(S=s2);for(let[C,F]of Object.entries(S.connected)){let w0=[];for(let t0=0;t0Oe.part===F[t0]),Ke=e0.find(Oe=>Oe.part===F[t0+1]);ne&&Ke&&w0.push([ne.position,Ke.position])}G[C]=w0}j.body[P]={...e.body[P],box:i0,boxRaw:g0,keypoints:e0,annotations:G}}if(!j.hand||e.hand.length!==j.hand.length)j.hand=JSON.parse(JSON.stringify(e.hand));else for(let P=0;P((s-1)*j.hand[P].box[C]+S)/s),g0=e.hand[P].boxRaw.map((S,C)=>((s-1)*j.hand[P].boxRaw[C]+S)/s);j.hand[P].keypoints.length!==e.hand[P].keypoints.length&&(j.hand[P].keypoints=e.hand[P].keypoints);let e0=e.hand[P].keypoints&&e.hand[P].keypoints.length>0?e.hand[P].keypoints.map((S,C)=>S.map((F,w0)=>((s-1)*(j.hand[P].keypoints[C][w0]||1)+(F||0))/s)):[],G={};if(Object.keys(j.hand[P].annotations).length!==Object.keys(e.hand[P].annotations).length)j.hand[P].annotations=e.hand[P].annotations,G=j.hand[P].annotations;else if(e.hand[P].annotations)for(let S of Object.keys(e.hand[P].annotations))G[S]=(l=(y=(d=e.hand[P])==null?void 0:d.annotations)==null?void 0:y[S])!=null&&l[0]?e.hand[P].annotations[S].map((C,F)=>C.map((w0,t0)=>((s-1)*j.hand[P].annotations[S][F][t0]+w0)/s)):null;j.hand[P]={...e.hand[P],box:i0,boxRaw:g0,keypoints:e0,annotations:G}}if(!j.face||e.face.length!==j.face.length)j.face=JSON.parse(JSON.stringify(e.face));else for(let P=0;P((s-1)*j.face[P].box[S]+G)/s),g0=e.face[P].boxRaw.map((G,S)=>((s-1)*j.face[P].boxRaw[S]+G)/s),e0=e.face[P].annotations;if(Object.keys(j.face[P].annotations).length!==Object.keys(e.face[P].annotations).length)j.face[P].annotations=e.face[P].annotations,e0=j.face[P].annotations;else if(e.face[P].annotations)for(let G of Object.keys(e.face[P].annotations))e0[G]=(p=(x=(m=e.face[P])==null?void 0:m.annotations)==null?void 0:x[G])!=null&&p[0]?e.face[P].annotations[G].map((S,C)=>S.map((F,w0)=>((s-1)*j.face[P].annotations[G][C][w0]+F)/s)):null;if(e.face[P].rotation){let G={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};G.matrix=(f=e.face[P].rotation)==null?void 0:f.matrix,G.angle={roll:((s-1)*(((v=(h=j.face[P].rotation)==null?void 0:h.angle)==null?void 0:v.roll)||0)+(((u=(T=e.face[P].rotation)==null?void 0:T.angle)==null?void 0:u.roll)||0))/s,yaw:((s-1)*(((E=(g=j.face[P].rotation)==null?void 0:g.angle)==null?void 0:E.yaw)||0)+(((N=(k=e.face[P].rotation)==null?void 0:k.angle)==null?void 0:N.yaw)||0))/s,pitch:((s-1)*(((V=(W=j.face[P].rotation)==null?void 0:W.angle)==null?void 0:V.pitch)||0)+(((Z=(D=e.face[P].rotation)==null?void 0:D.angle)==null?void 0:Z.pitch)||0))/s},G.gaze={bearing:((s-1)*(((J=j.face[P].rotation)==null?void 0:J.gaze.bearing)||0)+(((q=e.face[P].rotation)==null?void 0:q.gaze.bearing)||0))/s,strength:((s-1)*(((U=j.face[P].rotation)==null?void 0:U.gaze.strength)||0)+(((m0=e.face[P].rotation)==null?void 0:m0.gaze.strength)||0))/s},j.face[P]={...e.face[P],rotation:G,box:i0,boxRaw:g0,annotations:e0}}else j.face[P]={...e.face[P],box:i0,boxRaw:g0,annotations:e0}}if(!j.object||e.object.length!==j.object.length)j.object=JSON.parse(JSON.stringify(e.object));else for(let P=0;P((s-1)*j.object[P].box[G]+e0)/s),g0=e.object[P].boxRaw.map((e0,G)=>((s-1)*j.object[P].boxRaw[G]+e0)/s);j.object[P]={...e.object[P],box:i0,boxRaw:g0}}if(e.persons){let P=e.persons;if(!j.persons||P.length!==j.persons.length)j.persons=JSON.parse(JSON.stringify(P));else for(let i0=0;i0((s-1)*j.persons[i0].box[e0]+g0)/s)}e.gesture&&(j.gesture=e.gesture),j.width=e.width,j.height=e.height;let A=R();return R5=M.perfadd?R5+Math.round(A-n):Math.round(A-n),e.performance&&(j.performance={...e.performance,interpolate:R5}),j}var h0;async function M5(e){return!h0||M.initial?h0=await L(e.segmentation.modelPath):e.debug&&b("cached model:",h0.modelUrl),h0}async function Tn(e,t){var s;if(h0||(h0=await M5(t)),!(h0!=null&&h0.executor)||!((s=h0==null?void 0:h0.inputs)!=null&&s[0].shape))return null;let n={};n.resize=o.image.resizeBilinear(e,[h0.inputs[0].shape?h0.inputs[0].shape[1]:0,h0.inputs[0].shape?h0.inputs[0].shape[2]:0],!1),n.norm=o.div(n.resize,O.tf255),n.res=h0.execute(n.norm),n.squeeze=o.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=o.unstack(n.squeeze,2),n.fg=o.softmax(n.fgRaw),n.mul=o.mul(n.fg,O.tf255),n.expand=o.expandDims(n.mul,2),n.output=o.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let r;switch(t.segmentation.mode||"default"){case"default":n.input=o.squeeze(e),n.concat=o.concat([n.input,n.output],-1),r=o.cast(n.concat,"int32");break;case"alpha":r=o.cast(n.output,"int32");break;default:r=o.tensor(0)}return Object.keys(n).forEach(A=>o.dispose(n[A])),r}var k5={};oe(k5,{distance:()=>P5,find:()=>_s,similarity:()=>Qs});function P5(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let r=0;for(let s=0;s{if(e===0)return 1;let A=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(r-n);return Math.max(Math.min(A,1),0)};function Qs(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let r=P5(e,t,n);return Rn(r,n.order||2,n.min||0,n.max||1)}function _s(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let r=Number.MAX_SAFE_INTEGER,s=-1;for(let a=0;ai2,validateModel:()=>ot});var Mn=.005,I0={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function w5(e){for(let t of g5){let n=e.keypoints.findIndex(s=>s.part===t[0]),r=e.keypoints.findIndex(s=>s.part===t[1]);if(e.keypoints[n]&&e.keypoints[r]&&e.keypoints[n].position[0]s&&s.part===t[0]),r=e.keypoints.findIndex(s=>s&&s.part===t[1]);e.keypoints[n]&&e.keypoints[r]&&e.keypoints[n].position[1]d&&d.part===t[0]),s=e.keypoints.findIndex(d=>d&&d.part===t[1]),A=e.keypoints.findIndex(d=>d&&d.part===n[0]),a=e.keypoints.findIndex(d=>d&&d.part===n[1]);if(!e.keypoints[A]||!e.keypoints[a])continue;let i=e.keypoints[r]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[a].position[0]-e.keypoints[r].position[0])]:[0,0],c=e.keypoints[s]?[Math.abs(e.keypoints[a].position[0]-e.keypoints[s].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[s].position[0])]:[0,0];if(i[0]>i[1]||c[0]>c[1]){let d=e.keypoints[r];e.keypoints[r]=e.keypoints[s],e.keypoints[s]=d}}}function Pn(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=o.pad(e,I0.padding),n.resize=o.image.resizeBilinear(n.pad,[t,t]);let r=o.cast(n.resize,"int32");return Object.keys(n).forEach(a=>o.dispose(n[a])),r}function wn(e,t){e.keypoints=e.keypoints.filter(r=>r==null?void 0:r.position);for(let r of e.keypoints)r.position=[r.position[0]*(t[0]+I0.padding[2][0]+I0.padding[2][1])/t[0]-I0.padding[2][0],r.position[1]*(t[1]+I0.padding[1][0]+I0.padding[1][1])/t[1]-I0.padding[1][0]],r.positionRaw=[r.position[0]/t[0],r.position[1]/t[1]];let n=ae(e.keypoints.map(r=>r.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var A0,Q2=0,E5=Number.MAX_SAFE_INTEGER,Le={boxes:[],bodies:[],last:0};async function En(e){var t;return M.initial&&(A0=null),A0?e.debug&&b("cached model:",A0.modelUrl):(h2(["size"],e),A0=await L(e.body.modelPath)),Q2=A0!=null&&A0.executor&&((t=A0==null?void 0:A0.inputs)!=null&&t[0].shape)?A0.inputs[0].shape[2]:0,Q2<64&&(Q2=256),o.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&o.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),A0}function eA(e,t,n){let r=e[0][0],s=[],A=0;for(let y=0;yt.body.minConfidence){let l=[r[y][1],r[y][0]];s.push({score:Math.round(100*A)/100,part:K2[y],positionRaw:l,position:[Math.round((n.shape[2]||0)*l[0]),Math.round((n.shape[1]||0)*l[1])]})}A=s.reduce((y,l)=>l.score>y?l.score:y,0);let a=[],i=ae(s.map(y=>y.position),[n.shape[2],n.shape[1]]),c={};for(let[y,l]of Object.entries(J2)){let m=[];for(let x=0;xh.part===l[x]),f=s.find(h=>h.part===l[x+1]);p&&f&&p.score>(t.body.minConfidence||0)&&f.score>(t.body.minConfidence||0)&&m.push([p.position,f.position])}c[y]=m}let d={id:0,score:A,box:i.box,boxRaw:i.boxRaw,keypoints:s,annotations:c};return w5(d),a.push(d),a}function tA(e,t,n){let r=[];for(let s=0;st.body.minConfidence){let i=[];for(let m=0;m<17;m++){let x=A[3*m+2];if(x>t.body.minConfidence){let p=[A[3*m+1],A[3*m+0]];i.push({part:K2[m],score:Math.round(100*x)/100,positionRaw:p,position:[Math.round((n.shape[2]||0)*p[0]),Math.round((n.shape[1]||0)*p[1])]})}}let c=[A[52],A[51],A[54]-A[52],A[53]-A[51]],d=[Math.trunc(c[0]*(n.shape[2]||0)),Math.trunc(c[1]*(n.shape[1]||0)),Math.trunc(c[2]*(n.shape[2]||0)),Math.trunc(c[3]*(n.shape[1]||0))],y={};for(let[m,x]of Object.entries(J2)){let p=[];for(let f=0;fT.part===x[f]),v=i.find(T=>T.part===x[f+1]);h&&v&&h.score>(t.body.minConfidence||0)&&v.score>(t.body.minConfidence||0)&&p.push([h.position,v.position])}y[m]=p}let l={id:s,score:a,box:d,boxRaw:c,keypoints:[...i],annotations:y};w5(l),r.push(l)}}return r.sort((s,A)=>A.score-s.score),r.length>t.body.maxDetected&&(r.length=t.body.maxDetected),r}async function z5(e,t){var s;if(!(A0!=null&&A0.executor)||!((s=A0==null?void 0:A0.inputs)!=null&&s[0].shape))return[];t.skipAllowed||(Le.boxes.length=0),E5++;let n=(t.body.skipTime||0)>R()-Le.last,r=E5<(t.body.skipFrames||0);return t.skipAllowed&&n&&r?Le.bodies:new Promise(async A=>{let a={};E5=0,a.input=kn(e,Q2),a.res=A0==null?void 0:A0.execute(a.input),Le.last=R();let i=await a.res.array();Le.bodies=a.res.shape[2]===17?eA(i,t,e):tA(i,t,e);for(let c of Le.bodies)wn(c,[e.shape[2]||1,e.shape[1]||1]),Pn(c.keypoints);Object.keys(a).forEach(c=>o.dispose(a[c])),A(Le.bodies)})}var H0,_2=[],Sn=0,S5=Number.MAX_SAFE_INTEGER,et=0,$2=2.5;async function jn(e){if(!H0||M.initial){H0=await L(e.object.modelPath);let t=H0!=null&&H0.executor?Object.values(H0.modelSignature.inputs):void 0;et=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&b("cached model:",H0.modelUrl);return H0}async function nA(e,t,n){var d,y;let r=0,s=[],A=et;for(let l of[1,2,4]){let m=l*13,x=o.squeeze(e.find(u=>u.shape[1]===m**2&&(u.shape[2]||0)===De.length)),p=await x.array(),f=o.squeeze(e.find(u=>u.shape[1]===m**2&&(u.shape[2]||0)(n.object.minConfidence||0)&&g!==61){let k=(.5+Math.trunc(u%m))/m,N=(.5+Math.trunc(u/m))/m,W=T[u].map(P=>P*(m/l/A)),[V,D]=[k-$2/l*W[0],N-$2/l*W[1]],[Z,J]=[k+$2/l*W[2]-V,N+$2/l*W[3]-D],q=[V,D,Z,J];q=q.map(P=>Math.max(0,Math.min(P,1)));let U=[q[0]*t[0],q[1]*t[1],q[2]*t[0],q[3]*t[1]],m0={id:r++,score:Math.round(100*E)/100,class:g+1,label:De[g].label,box:U.map(P=>Math.trunc(P)),boxRaw:q};s.push(m0)}}o.dispose([x,f,h,v])}let a=s.map(l=>[l.boxRaw[1],l.boxRaw[0],l.boxRaw[3],l.boxRaw[2]]),i=s.map(l=>l.score),c=[];if(a&&a.length>0){let l=await o.image.nonMaxSuppressionAsync(a,i,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);c=Array.from(await l.data()),o.dispose(l)}return s=s.filter((l,m)=>c.includes(m)).sort((l,m)=>m.score-l.score),s}async function j5(e,t){if(!(H0!=null&&H0.executor))return[];let n=(t.object.skipTime||0)>R()-Sn,r=S5<(t.object.skipFrames||0);return t.skipAllowed&&n&&r&&_2.length>0?(S5++,_2):(S5=0,!M.kernels.includes("mod")||!M.kernels.includes("sparsetodense")?_2:new Promise(async s=>{let A=[e.shape[2]||0,e.shape[1]||0],a=o.image.resizeBilinear(e,[et,et],!1),i=o.div(a,O.tf255),c=o.transpose(i,[0,3,1,2]),d;t.object.enabled&&(d=H0.execute(c)),Sn=R();let y=await nA(d,A,t);_2=y,o.dispose([a,i,c,...d]),s(y)}))}var a2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],oA=a2.length,A2=a2.reduce((e,t,n)=>(e[t]=n,e),{}),rA=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],_i=rA.map(([e,t])=>[A2[e],A2[t]]),Nn=[["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 Ln(e){let t=e.reduce(({maxX:n,maxY:r,minX:s,minY:A},{position:{x:a,y:i}})=>({maxX:Math.max(n,a),maxY:Math.max(r,i),minX:Math.min(s,a),minY:Math.min(A,i)}),{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 On(e,[t,n],[r,s]){let A=t/r,a=n/s,i=(d,y)=>({id:y,score:d.score,boxRaw:[d.box[0]/s,d.box[1]/r,d.box[2]/s,d.box[3]/r],box:[Math.trunc(d.box[0]*a),Math.trunc(d.box[1]*A),Math.trunc(d.box[2]*a),Math.trunc(d.box[3]*A)],keypoints:d.keypoints.map(({score:l,part:m,position:x})=>({score:l,part:m,position:[Math.trunc(x.x*a),Math.trunc(x.y*A)],positionRaw:[x.x/r,x.y/r]})),annotations:{}});return e.map((d,y)=>i(d,y))}var tt=class{constructor(t,n){z(this,"priorityQueue");z(this,"numberOfElements");z(this,"getElementValue");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 Cn(e,t,n,r){let s=n-e,A=r-t;return s*s+A*A}function O5(e,t){return{x:e.x+t.x,y:e.y+t.y}}var N0,AA=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],nt=1,Ue=16,aA=50**2;function Wn(e,t,n,r,s,A,a=2){let i=v=>({y:A.get(v.y,v.x,e),x:A.get(v.y,v.x,A.shape[2]/2+e)}),c=(v,T,u)=>({y:L5(Math.round(v.y/Ue),0,T-1),x:L5(Math.round(v.x/Ue),0,u-1)}),[d,y]=r.shape,l=c(t.position,d,y),m=i(l),p=O5(t.position,m);for(let v=0;v[A2[m],A2[x]]),a=A.map(([,m])=>m),i=A.map(([m])=>m),c=t.shape[2],d=a.length,y=new Array(c),l=N5(e.part,Ue,n);y[e.part.id]={score:e.score,part:a2[e.part.id],position:l};for(let m=d-1;m>=0;--m){let x=a[m],p=i[m];y[x]&&!y[p]&&(y[p]=Wn(m,y[x],p,t,n,s))}for(let m=0;mt){i=!1;break}if(!i)break}return i}function cA(e,t){let[n,r,s]=t.shape,A=new tt(n*r*s,({score:a})=>a);for(let a=0;a{var a;let A=(a=s[r])==null?void 0:a.position;return A?Cn(n,t,A.y,A.x)<=aA:!1})}function dA(e,t){return t.reduce((r,{position:s,score:A},a)=>(Dn(e,s,a)||(r+=A),r),0)/t.length}function xA(e,t,n,r,s,A){let a=[],i=cA(A,t);for(;a.lengthx.score>A);let l=dA(a,y),m=Ln(y);l>A&&a.push({keypoints:y,box:m,score:Math.round(100*l)/100})}return a}async function C5(e,t){if(!(N0!=null&&N0.executor))return[];let n=o.tidy(()=>{if(!N0.inputs[0].shape)return[];let a=o.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]]),i=o.sub(o.div(o.cast(a,"float32"),127.5),1),d=N0.execute(i,AA).map(y=>o.squeeze(y,[0]));return d[1]=o.sigmoid(d[1]),d}),r=await Promise.all(n.map(a=>a.buffer()));for(let a of n)o.dispose(a);let s=xA(r[0],r[1],r[2],r[3],t.body.maxDetected,t.body.minConfidence);return N0.inputs[0].shape?On(s,[e.shape[1],e.shape[2]],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]]):[]}async function Fn(e){return!N0||M.initial?N0=await L(e.body.modelPath):e.debug&&b("cached model:",N0.modelUrl),N0}var J0,yA=["fgr","pha","r1o","r2o","r3o","r4o"],a0={},D5=0;function Gn(e){o.dispose([a0.r1i,a0.r2i,a0.r3i,a0.r4i,a0.downsample_ratio]),a0.r1i=o.tensor(0),a0.r2i=o.tensor(0),a0.r3i=o.tensor(0),a0.r4i=o.tensor(0),D5=e.segmentation.ratio||.5,a0.downsample_ratio=o.tensor(D5)}async function F5(e){return!J0||M.initial?J0=await L(e.segmentation.modelPath):e.debug&&b("cached model:",J0.modelUrl),Gn(e),J0}var Hn=e=>o.tidy(()=>{let t=o.squeeze(e,[0]),n=o.mul(t,O.tf255);return o.cast(n,"int32")});function W5(e,t){let n=e?Hn(e):o.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),r=t?Hn(t):o.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),s=o.concat([n,r],-1);return o.dispose([n,r]),s}function fA(e){return o.tidy(()=>{let t={};return t.unstack=o.unstack(e,-1),t.concat=o.concat(t.unstack,1),t.split=o.split(t.concat,4,1),t.stack=o.concat(t.split,2),t.squeeze=o.squeeze(t.stack,[0]),t.expand=o.expandDims(t.squeeze,-1),t.add=o.add(t.expand,1),t.mul=o.mul(t.add,127.5),t.cast=o.cast(t.mul,"int32"),t.tile=o.tile(t.cast,[1,1,3]),t.alpha=o.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),o.concat([t.tile,t.alpha],-1)})}async function Vn(e,t){if(J0||(J0=await F5(t)),!(J0!=null&&J0.executor))return null;a0.src=o.div(e,255),D5!==t.segmentation.ratio&&Gn(t);let[n,r,s,A,a,i]=await J0.executeAsync(a0,yA),c;switch(t.segmentation.mode||"default"){case"default":c=W5(n,r);break;case"alpha":c=W5(null,r);break;case"foreground":c=W5(n,null);break;case"state":c=fA(s);break;default:c=o.tensor(0)}return o.dispose([a0.src,n,r,a0.r1i,a0.r2i,a0.r3i,a0.r4i]),[a0.r1i,a0.r2i,a0.r3i,a0.r4i]=[s,A,a,i],c}var b0;async function B5(e){return!b0||M.initial?b0=await L(e.segmentation.modelPath):e.debug&&b("cached model:",b0.modelUrl),b0}async function Xn(e,t){var s;if(b0||(b0=await B5(t)),!(b0!=null&&b0.executor)||!((s=b0==null?void 0:b0.inputs)!=null&&s[0].shape))return null;let n={};n.resize=o.image.resizeBilinear(e,[b0.inputs[0].shape?b0.inputs[0].shape[1]:0,b0.inputs[0].shape?b0.inputs[0].shape[2]:0],!1),n.norm=o.div(n.resize,O.tf255),n.res=b0.execute(n.norm),n.squeeze=o.squeeze(n.res,[0]),n.alpha=o.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=o.mul(n.alpha,O.tf255);let r;switch(t.segmentation.mode||"default"){case"default":n.input=o.squeeze(e),n.concat=o.concat([n.input,n.mul],-1),r=o.cast(n.concat,"int32");break;case"alpha":r=o.cast(n.mul,"int32");break;default:r=o.tensor(0)}return Object.keys(n).forEach(A=>o.dispose(n[A])),r}function ot(e,t,n){var d,y;if(!t||!((d=e==null?void 0:e.config)!=null&&d.validateModels))return null;let r=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],s=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],A=[],a=[],i=t.modelUrl,c=t.executor;if((y=c==null?void 0:c.graph)!=null&&y.nodes)for(let l of Object.values(c.graph.nodes)){let m=l.op.toLowerCase();A.includes(m)||A.push(m)}else!c&&e.config.debug&&b("model not loaded",n);for(let l of A)!r.includes(l)&&!s.includes(l)&&!e.env.kernels.includes(l)&&!e.env.kernels.includes(l.replace("_",""))&&!e.env.kernels.includes(l.replace("native",""))&&!e.env.kernels.includes(l.replace("v2",""))&&a.push(l);return e.config.debug&&a.length>0&&b("model validation failed:",n,a),a.length>0?{name:n,missing:a,ops:A,url:i}:null}var i2=class{constructor(t){z(this,"instance");z(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,r=0;for(let A of Object.values(p0))t+=A.sizeFromManifest,n+=A.sizeLoadedWeights,r+=A.sizeDesired;let s=r>0?n/r:0;return{numLoadedModels:Object.values(p0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:s,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:r,modelStats:Object.values(p0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var r,s,A,a,i,c,d,y,l,m,x,p,f,h,v,T,u,g,E,k,N,W,V,D,Z,J,q;M.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?F1(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((r=this.instance.config.face.antispoof)!=null&&r.enabled)&&!this.models.antispoof?c3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((s=this.instance.config.face.liveness)!=null&&s.enabled)&&!this.models.liveness?f3(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((A=this.instance.config.face.description)!=null&&A.enabled)&&!this.models.faceres?s3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((a=this.instance.config.face.emotion)!=null&&a.enabled)&&!this.models.emotion?t3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((i=this.instance.config.face.iris)!=null&&i.enabled)&&!((c=this.instance.config.face.attention)!=null&&c.enabled)&&!this.models.iris?X1(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((d=this.instance.config.face.mesh)!=null&&d.enabled)&&!this.models.facemesh?J1(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((y=this.instance.config.face.gear)!=null&&y.enabled)&&!this.models.gear?h3(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((l=this.instance.config.face.ssrnet)!=null&&l.enabled)&&!this.models.ssrnetage?v3(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((m=this.instance.config.face.ssrnet)!=null&&m.enabled)&&!this.models.ssrnetgender?k3(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((x=this.instance.config.face.mobilefacenet)!=null&&x.enabled)&&!this.models.mobilefacenet?j3(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((p=this.instance.config.face.insightface)!=null&&p.enabled)&&!this.models.insightface?C3(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((f=this.instance.config.body.modelPath)!=null&&f.includes("blazepose"))?g1(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?b1(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((h=this.instance.config.body.modelPath)!=null&&h.includes("efficientpose"))?k1(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((v=this.instance.config.body.modelPath)!=null&&v.includes("movenet"))?En(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("posenet"))?Fn(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((g=(u=this.instance.config.hand.detector)==null?void 0:u.modelPath)!=null&&g.includes("handtrack"))?un(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((k=(E=this.instance.config.hand.detector)==null?void 0:E.modelPath)!=null&&k.includes("handtrack"))?hn(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((W=(N=this.instance.config.hand.detector)==null?void 0:N.modelPath)!=null&&W.includes("handdetect"))&&(n.handdetect=dn(this.instance.config),n.handskeleton=xn(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((V=this.instance.config.object.modelPath)!=null&&V.includes("centernet"))?R1(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((D=this.instance.config.object.modelPath)!=null&&D.includes("nanodet"))?jn(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&((Z=this.instance.config.segmentation.modelPath)!=null&&Z.includes("selfie"))?B5(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((J=this.instance.config.segmentation.modelPath)!=null&&J.includes("meet"))?M5(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((q=this.instance.config.segmentation.modelPath)!=null&&q.includes("rvm"))?F5(this.instance.config):null;for(let[U,m0]of Object.entries(n))m0!=null&&m0.then&&m0.then(P=>this.models[U]=P);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var r;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(r=this.models[n])==null?void 0:r.modelUrl:null}});for(let n of t){let r=Object.keys(p0).find(s=>s.startsWith(n.name));r&&(n.size=p0[r].sizeLoadedWeights,n.url=p0[r].url)}return t}loaded(){return this.list().filter(r=>r.loaded).map(r=>r.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let r=this.models[n];if(!r)continue;let s=ot(this.instance,r,n);s&&t.push(s)}return t}};function Yn(e,t,n,r,s){var i,c,d,y,l,m;let A=0,a=[];for(let x of e){let p={id:A++,face:x,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let g of t)x.box[0]>g.box[0]&&x.box[0]g.box[1]&&x.box[1]+x.box[3]p.body.box[0]&&g.box[0]+g.box[2]p.body.box[1]&&g.box[1]+g.box[3]p.body.box[0]&&g.box[1]+g.box[3]>p.body.box[1]&&g.box[1]+g.box[3]{g&&g.length===4&&(f.push(g[0],g[0]+g[2]),h.push(g[1],g[1]+g[3]))};v(p.face.box),v((y=p.body)==null?void 0:y.box),v((l=p.hands.left)==null?void 0:l.box),v((m=p.hands.right)==null?void 0:m.box);let T=Math.min(...f),u=Math.min(...h);p.box=[T,u,Math.max(...f)-T,Math.max(...h)-u],s!=null&&s[1]&&(s!=null&&s[2])&&(p.boxRaw=[p.box[0]/s[2],p.box[1]/s[1],p.box[2]/s[2],p.box[3]/s[1]]),a.push(p)}return a}var rt=` + gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var gt=0;function Qr(e,t,n){let o=Q(n0,n);if(!t||!e)return;let s=O0(e);if(s){s.lineJoin="round",s.font=o.font;for(let A=0;AMt,kpt:()=>Rt});var Rt=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],Mt={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var W0,ke=224,x1,es=5,P2=[8,16,32,32,32];function ts(){let e=[],t=0;for(;tn.x)),y:r.tensor1d(e.map(n=>n.y))}}async function y1(e){if(M.initial&&(W0=null),!W0&&e.body.detector&&e.body.detector.modelPath){W0=await L(e.body.detector.modelPath);let t=W0!=null&&W0.executor?Object.values(W0.modelSignature.inputs):void 0;ke=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&W0&&b("cached model:",W0.modelUrl);return ts(),W0}var d1=[5,5];function ns(e,t){return r.tidy(()=>{let n=r.split(e,12,1),o=r.squeeze(n[0]),s=r.squeeze(n[1]),A=r.squeeze(n[2]),a=r.squeeze(n[3]);o=r.add(r.div(o,ke),t.x),s=r.add(r.div(s,ke),t.y),A=r.mul(r.div(A,ke),d1[0]),a=r.mul(r.div(a,ke),d1[1]);let i=r.sub(o,r.div(A,2)),c=r.sub(s,r.div(a,2)),d=r.add(i,A),y=r.add(c,a);return r.stack([i,c,d,y],1)})}async function os(e,t,n,o){var d,y;let s=[],A={};A.boxes=ns(e,x1),A.scores=r.sigmoid(t),A.nms=await r.image.nonMaxSuppressionAsync(A.boxes,A.scores,1,((d=n.body.detector)==null?void 0:d.minConfidence)||.1,((y=n.body.detector)==null?void 0:y.iouThreshold)||.1);let a=await A.nms.data(),i=await A.scores.data(),c=await A.boxes.array();for(let l of Array.from(a)){let f=i[l],x=c[l],p=[Math.round(x[0]*o[0]),Math.round(x[1]*o[1]),Math.round(x[2]*o[0]),Math.round(x[3]*o[1])],m={score:f,boxRaw:x,box:p};s.push(m)}return Object.keys(A).forEach(l=>r.dispose(A[l])),s}async function f1(e,t,n){let o={};o.res=W0==null?void 0:W0.execute(e,["Identity"]),o.logitsRaw=r.slice(o.res,[0,0,0],[1,-1,1]),o.boxesRaw=r.slice(o.res,[0,0,1],[1,-1,-1]),o.logits=r.squeeze(o.logitsRaw),o.boxes=r.squeeze(o.boxesRaw);let s=await os(o.boxes,o.logits,t,n);return Object.keys(o).forEach(A=>r.dispose(o[A])),s}function ae(e,t=[1,1]){let n=[e.map(i=>i[0]),e.map(i=>i[1])],o=[Math.min(...n[0]),Math.min(...n[1])],s=[Math.max(...n[0]),Math.max(...n[1])],A=[o[0],o[1],s[0]-o[0],s[1]-o[1]],a=[A[0]/t[0],A[1]/t[1],A[2]/t[0],A[3]/t[1]];return{box:A,boxRaw:a}}function m1(e,t=[1,1]){let n=[e.map(d=>d[0]),e.map(d=>d[1])],o=[Math.min(...n[0]),Math.min(...n[1])],s=[Math.max(...n[0]),Math.max(...n[1])],A=[(o[0]+s[0])/2,(o[1]+s[1])/2],a=Math.max(A[0]-o[0],A[1]-o[1],-A[0]+s[0],-A[1]+s[1]),i=[Math.trunc(A[0]-a),Math.trunc(A[1]-a),Math.trunc(2*a),Math.trunc(2*a)],c=[i[0]/t[0],i[1]/t[1],i[2]/t[0],i[3]/t[1]];return{box:i,boxRaw:c}}function k2(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var P0,kt=256,Pt=Number.MAX_SAFE_INTEGER,rs={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},E2=[],ie=[[0,0],[0,0],[0,0],[0,0]],p1=0,u1=e=>1-1/(1+Math.exp(e)),b1=e=>y1(e);async function g1(e){if(M.initial&&(P0=null),P0)e.debug&&b("cached model:",P0.modelUrl);else{P0=await L(e.body.modelPath);let t=P0!=null&&P0.executor?Object.values(P0.modelSignature.inputs):void 0;kt=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return P0}function h1(e,t,n){var A,a;let o={};if(!((A=e==null?void 0:e.shape)!=null&&A[1])||!((a=e==null?void 0:e.shape)!=null&&a[2]))return e;let s;if(n&&(o.cropped=r.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let i=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],c=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];ie=[[0,0],i,c,[0,0]],o.pad=r.pad(o.cropped||e,ie),o.resize=r.image.resizeBilinear(o.pad,[t,t]),s=r.div(o.resize,O.tf255)}else e.shape[1]!==t?(o.resize=r.image.resizeBilinear(o.cropped||e,[t,t]),s=r.div(o.resize,O.tf255)):s=r.div(o.cropped||e,O.tf255);return Object.keys(o).forEach(i=>r.dispose(o[i])),s}function ss(e,t,n){for(let o of e)o.position=[Math.trunc(o.position[0]*(t[0]+ie[2][0]+ie[2][1])/t[0]-ie[2][0]),Math.trunc(o.position[1]*(t[1]+ie[1][0]+ie[1][1])/t[1]-ie[1][0]),o.position[2]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1],2*o.position[2]/(t[0]+t[1])];if(n){let o=n[2]-n[0],s=n[3]-n[1];for(let A of e)A.positionRaw=[A.positionRaw[0]/s+n[1],A.positionRaw[1]/o+n[0],A.positionRaw[2]],A.position=[Math.trunc(A.positionRaw[0]*t[0]),Math.trunc(A.positionRaw[1]*t[1]),A.positionRaw[2]]}return e}function As(e){let t=e.find(i=>i.part==="leftPalm"),n=e.find(i=>i.part==="leftWrist"),o=e.find(i=>i.part==="leftIndex");t.position[2]=((n.position[2]||0)+(o.position[2]||0))/2;let s=e.find(i=>i.part==="rightPalm"),A=e.find(i=>i.part==="rightWrist"),a=e.find(i=>i.part==="rightIndex");s.position[2]=((A.position[2]||0)+(a.position[2]||0))/2}async function as(e,t,n){if(!(P0!=null&&P0.executor))return null;let o={};[o.ld,o.segmentation,o.heatmap,o.world,o.poseflag]=P0==null?void 0:P0.execute(e,rs.landmarks);let s=(await o.poseflag.data())[0],A=await o.ld.data(),a=await o.world.data();Object.keys(o).forEach(p=>r.dispose(o[p]));let i=[],c=5;for(let p=0;pp.position),l=ae(y,[n[0],n[1]]),f={};for(let[p,m]of Object.entries(Mt)){let h=[];for(let T=0;Tg.part===m[T]),u=d.find(g=>g.part===m[T+1]);v&&u&&h.push([v.position,u.position])}f[p]=h}return{id:0,score:Math.trunc(100*s)/100,box:l.box,boxRaw:l.boxRaw,keypoints:d,annotations:f}}async function wt(e,t){var A,a,i;let n=[e.shape[2]||0,e.shape[1]||0],o=(t.body.skipTime||0)>R()-p1,s=Pt<(t.body.skipFrames||0);if(t.skipAllowed&&o&&s&&E2!==null)Pt++;else{let c=[];if((a=(A=t.body)==null?void 0:A.detector)!=null&&a.enabled){let d=h1(e,224);c=await f1(d,t,n),r.dispose(d)}else c=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let d=0;dr.dispose(o[d])),s}async function St(e,t){if(!(k0!=null&&k0.executor))return[];let n=(t.object.skipTime||0)>R()-v1,o=zt<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&Et.length>0?(zt++,Et):(zt=0,new Promise(async s=>{let A=[e.shape[2]||0,e.shape[1]||0],a=r.image.resizeBilinear(e,[we,we]),i=t.object.enabled?k0==null?void 0:k0.execute(a,["tower_0/detections"]):null;v1=R(),r.dispose(a);let c=await is(i,A,t);Et=c,s(c)}))}var z2={};oe(z2,{connected:()=>It,kpt:()=>jt});var jt=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],It={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var _,P1=0,v0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},Nt=Number.MAX_SAFE_INTEGER;async function k1(e){return M.initial&&(_=null),_?e.debug&&b("cached model:",_.modelUrl):_=await L(e.body.modelPath),_}async function ls(e,t){let[n,o]=e.shape,s=r.reshape(e,[o*n]),A=r.max(s,0),a=(await A.data())[0];if(a>t){let i=r.argMax(s,0),c=r.mod(i,n),d=(await c.data())[0],y=r.div(i,n),l=(await y.data())[0];return r.dispose([s,A,i,c,y]),[d,l,a]}return r.dispose([s,A]),[0,0,a]}async function Lt(e,t){if(!(_!=null&&_.executor)||!(_!=null&&_.inputs[0].shape))return[];let n=(t.body.skipTime||0)>R()-P1,o=Nt<(t.body.skipFrames||0);return t.skipAllowed&&n&&o&&Object.keys(v0.keypoints).length>0?(Nt++,[v0]):(Nt=0,new Promise(async s=>{let A=r.tidy(()=>{var p,m;let l=r.image.resizeBilinear(e,[((p=_==null?void 0:_.inputs[0].shape)==null?void 0:p[2])||0,((m=_==null?void 0:_.inputs[0].shape)==null?void 0:m[1])||0],!1),f=r.mul(l,O.tf2);return r.sub(f,O.tf1)}),a;if(t.body.enabled&&(a=_==null?void 0:_.execute(A)),P1=R(),r.dispose(A),a){v0.keypoints.length=0;let l=r.squeeze(a);r.dispose(a);let f=r.unstack(l,2);r.dispose(l);for(let x=0;x(t.body.minConfidence||0)&&v0.keypoints.push({score:Math.round(100*h)/100,part:jt[x],positionRaw:[p/_.inputs[0].shape[2],m/_.inputs[0].shape[1]],position:[Math.round(e.shape[2]*p/_.inputs[0].shape[2]),Math.round(e.shape[1]*m/_.inputs[0].shape[1])]})}f.forEach(x=>r.dispose(x))}v0.score=v0.keypoints.reduce((l,f)=>f.score>l?f.score:l,0);let i=v0.keypoints.map(l=>l.position[0]),c=v0.keypoints.map(l=>l.position[1]);v0.box=[Math.min(...i),Math.min(...c),Math.max(...i)-Math.min(...i),Math.max(...c)-Math.min(...c)];let d=v0.keypoints.map(l=>l.positionRaw[0]),y=v0.keypoints.map(l=>l.positionRaw[1]);v0.boxRaw=[Math.min(...d),Math.min(...y),Math.max(...d)-Math.min(...d),Math.max(...y)-Math.min(...y)];for(let[l,f]of Object.entries(It)){let x=[];for(let p=0;pT.part===f[p]),h=v0.keypoints.find(T=>T.part===f[p+1]);m&&h&&m.score>(t.body.minConfidence||0)&&h.score>(t.body.minConfidence||0)&&x.push([m.position,h.position])}v0.annotations[l]=x}s([v0])}))}var Fe=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],S2=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],j2=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],I2=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],S1=(e,t,n)=>{let o=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],s=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],A=e.landmarks.map(a=>[(a[0]+n[0])*t[0],(a[1]+n[1])*t[1]]);return{startPoint:o,endPoint:s,landmarks:A,confidence:e.confidence}},Ot=(e,t,n)=>{let o=t.shape[1],s=t.shape[2],A=[e.startPoint[1]/o,e.startPoint[0]/s,e.endPoint[1]/o,e.endPoint[0]/s],a=r.image.cropAndResize(t,[A],[0],n),i=r.div(a,O.tf255);return r.dispose(a),i},N2=(e,t)=>{let n=S2(e),o=Fe(e),s=[t*o[0]/2,t*o[1]/2];return{startPoint:[n[0]-s[0],n[1]-s[1]],endPoint:[n[0]+s[0],n[1]+s[1]],landmarks:e.landmarks,confidence:e.confidence,size:o}},L2=e=>{let t=S2(e),n=Fe(e),o=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-o),Math.round(t[1]-o)],endPoint:[Math.round(t[0]+o),Math.round(t[1]+o)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},j1=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},Ct=[[1,0,0],[0,1,0],[0,0,1]],cs=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),ds=(e,t)=>cs(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var E1=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],Ee=(e,t)=>{let n=0;for(let o=0;o{let n=[];for(let o=0;o{let n=[],o=e.length;for(let s=0;s{let n=Math.cos(e),o=Math.sin(e),s=[[n,-o,0],[o,n,0],[0,0,1]],A=E1(t[0],t[1]),a=z1(A,s),i=E1(-t[0],-t[1]);return z1(a,i)},ys=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],o=[-Ee(t[0],n),-Ee(t[1],n)];return[t[0].concat(o[0]),t[1].concat(o[1]),[0,0,1]]},fs=(e,t)=>[Ee(e,t[0]),Ee(e,t[1])];function N1(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let o=0;o[A[0]/s*(x[0]-s/2),A[1]/s*(x[1]-s/2),x[2]||0]),i=n&&n!==0&&Math.abs(n)>.2,c=i?I1(n,[0,0]):Ct,d=i?a.map(x=>[...fs(x,c),x[2]]):a,y=i?ys(o):Ct,l=S2(t),f=[Ee(l,y[0]),Ee(l,y[1])];return d.map(x=>[Math.trunc(x[0]+f[0]),Math.trunc(x[1]+f[1]),Math.trunc(x[2]||0)])}function O1(e,t,n,o){let s=t.landmarks.length>=ut.count?ut.symmetryLine:ve.symmetryLine,A=0,a=Ct,i;if(e&&M.kernels.includes("rotatewithoffset"))if(A=ds(t.landmarks[s[0]],t.landmarks[s[1]]),A&&A!==0&&Math.abs(A)>.2){let d=S2(t),y=[d[0]/n.shape[2],d[1]/n.shape[1]],l=r.image.rotateWithOffset(n,A,0,[y[0],y[1]]);a=I1(-A,d),i=Ot(t,l,[o,o]),r.dispose(l)}else i=Ot(t,n,[o,o]);else i=Ot(t,n,[o,o]);return[A,a,i]}var ms=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},C1=(e,t)=>{let n=ms(e),o=Fe(t);return{startPoint:[n[0]-o[0]/2,n[1]-o[1]/2],endPoint:[n[0]+o[0]/2,n[1]+o[1]/2]}};var W1=6,G0,O2=null,le=0,Be=null,D1=()=>le;async function F1(e){var t;return M.initial&&(G0=null),G0?e.debug&&b("cached model:",G0.modelUrl):G0=await L((t=e.face.detector)==null?void 0:t.modelPath),le=G0.executor&&G0.inputs[0].shape?G0.inputs[0].shape[2]:256,Be=r.scalar(le,"int32"),O2=r.tensor2d(N1(le)),G0}function ps(e){if(!O2||!Be)return r.zeros([0,0]);let t={};t.boxStarts=r.slice(e,[0,1],[-1,2]),t.centers=r.add(t.boxStarts,O2),t.boxSizes=r.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=r.div(t.boxSizes,Be),t.centersNormalized=r.div(t.centers,Be),t.halfBoxSize=r.div(t.boxSizesNormalized,O.tf2),t.starts=r.sub(t.centersNormalized,t.halfBoxSize),t.ends=r.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=r.mul(t.starts,Be),t.endNormalized=r.mul(t.ends,Be);let n=r.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(o=>r.dispose(t[o])),n}async function B1(e,t){var i,c,d,y,l,f,x;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=r.image.resizeBilinear(e,[le,le]),n.div=r.div(n.resized,O.tf127),n.normalized=r.sub(n.div,O.tf05);let o=G0==null?void 0:G0.execute(n.normalized);if(Array.isArray(o)&&o.length>2){let p=o.sort((m,h)=>m.size-h.size);n.concat384=r.concat([p[0],p[2]],2),n.concat512=r.concat([p[1],p[3]],2),n.concat=r.concat([n.concat512,n.concat384],1),n.batch=r.squeeze(n.concat,[0])}else Array.isArray(o)?n.batch=r.squeeze(o[0]):n.batch=r.squeeze(o);r.dispose(o),n.boxes=ps(n.batch),n.logits=r.slice(n.batch,[0,0],[-1,1]),n.sigmoid=r.sigmoid(n.logits),n.scores=r.squeeze(n.sigmoid),n.nms=await r.image.nonMaxSuppressionAsync(n.boxes,n.scores,((i=t.face.detector)==null?void 0:i.maxDetected)||0,((c=t.face.detector)==null?void 0:c.iouThreshold)||0,((d=t.face.detector)==null?void 0:d.minConfidence)||0);let s=await n.nms.array(),A=[],a=await n.scores.data();for(let p=0;p(((y=t.face.detector)==null?void 0:y.minConfidence)||0)){let h={};h.bbox=r.slice(n.boxes,[s[p],0],[1,-1]),h.slice=r.slice(n.batch,[s[p],W1-1],[1,-1]),h.squeeze=r.squeeze(h.slice),h.landmarks=r.reshape(h.squeeze,[W1,-1]);let T=await h.bbox.data(),v={startPoint:[T[0],T[1]],endPoint:[T[2],T[3]],landmarks:await h.landmarks.array(),confidence:m};h.anchor=r.slice(O2,[s[p],0],[1,2]);let u=await h.anchor.data(),g=S1(v,[(e.shape[2]||0)/le,(e.shape[1]||0)/le],u),E=N2(g,((l=t.face.detector)==null?void 0:l.scale)||1.4),k=L2(E);k.size[0]>(((f=t.face.detector)==null?void 0:f.minSize)||0)&&k.size[1]>(((x=t.face.detector)==null?void 0:x.minSize)||0)&&A.push(k),Object.keys(h).forEach(N=>r.dispose(h[N]))}}return Object.keys(n).forEach(p=>r.dispose(n[p])),A}var z0,ce=0,Dt=F0.leftEyeLower0,Ft=F0.rightEyeLower0,He={leftBounds:[Dt[0],Dt[Dt.length-1]],rightBounds:[Ft[0],Ft[Ft.length-1]]},Ge={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function X1(e){var t,n;return M.initial&&(z0=null),z0?e.debug&&b("cached model:",z0.modelUrl):z0=await L((t=e.face.iris)==null?void 0:t.modelPath),ce=z0!=null&&z0.executor&&((n=z0.inputs)!=null&&n[0].shape)?z0.inputs[0].shape[2]:0,ce===-1&&(ce=64),z0}function C2(e,t,n,o){for(let s=0;s{let t=e[He.leftBounds[0]][2],n=e[He.rightBounds[0]][2];return t-n},G1=(e,t,n,o,s,A=!1,a=2.3)=>{let i=L2(N2(j1([e[n],e[o]]),a)),c=Fe(i),d=r.image.cropAndResize(t,[[i.startPoint[1]/s,i.startPoint[0]/s,i.endPoint[1]/s,i.endPoint[0]/s]],[0],[ce,ce]);if(A&&M.kernels.includes("flipleftright")){let y=r.image.flipLeftRight(d);r.dispose(d),d=y}return{box:i,boxSize:c,crop:d}},V1=(e,t,n,o=!1)=>{let s=[];for(let A=0;A{let o=e[F0[`${n}EyeUpper0`][Ge.upperCenter]][2],s=e[F0[`${n}EyeLower0`][Ge.lowerCenter]][2],A=(o+s)/2;return t.map((a,i)=>{let c=A;return i===2?c=o:i===4&&(c=s),[a[0],a[1],c]})};async function q1(e,t,n,o){var N,C;if(!(z0!=null&&z0.executor))return e;let{box:s,boxSize:A,crop:a}=G1(e,t,He.leftBounds[0],He.leftBounds[1],n,!0,((N=o.face.iris)==null?void 0:N.scale)||2.3),{box:i,boxSize:c,crop:d}=G1(e,t,He.rightBounds[0],He.rightBounds[1],n,!0,((C=o.face.iris)==null?void 0:C.scale)||2.3),y=r.concat([a,d]);r.dispose(a),r.dispose(d);let l=z0.execute(y);r.dispose(y);let f=await l.data();r.dispose(l);let x=f.slice(0,Ge.numCoordinates*3),{rawCoords:p,iris:m}=V1(x,s,A,!0),h=f.slice(Ge.numCoordinates*3),{rawCoords:T,iris:v}=V1(h,i,c,!1),u=us(e);Math.abs(u)<30?(C2(e,p,"left",null),C2(e,T,"right",null)):u<1?C2(e,p,"left",["EyeUpper0","EyeLower0"]):C2(e,T,"right",["EyeUpper0","EyeLower0"]);let g=Z1(e,m,"left"),E=Z1(e,v,"right");return e.concat(g).concat(E)}async function Y1(e,t){var A,a,i,c,d,y,l,f,x,p;let n={lips:await((a=(A=t.filter(m=>m.size===160))==null?void 0:A[0])==null?void 0:a.data()),irisL:await((c=(i=t.filter(m=>m.size===10))==null?void 0:i[0])==null?void 0:c.data()),eyeL:await((y=(d=t.filter(m=>m.size===142))==null?void 0:d[0])==null?void 0:y.data()),irisR:await((f=(l=t.filter(m=>m.size===10))==null?void 0:l[1])==null?void 0:f.data()),eyeR:await((p=(x=t.filter(m=>m.size===142))==null?void 0:x[1])==null?void 0:p.data())};for(let m of Object.values(n))if(!m)return e;let o=Me.reduce((m,h)=>m+=e[h][2],0)/Me.length;for(let m=0;mm+=e[h][2],0)/Pe.length;for(let m=0;mR()-K0.timestamp,o=K0.skipped<(((d=t.face.detector)==null?void 0:d.skipFrames)||0);!t.skipAllowed||!n||!o||K0.boxes.length===0?(K0.boxes=await B1(e,t),K0.timestamp=R(),K0.skipped=0):K0.skipped++;let s=[],A=[],a=0,i=o2;for(let v=0;v[N[0]/(e.shape[2]||0),N[1]/(e.shape[1]||0),(N[2]||0)/i]);for(let N of Object.keys(ve))k.annotations[N]=[k.mesh[ve[N]]]}else if(!K)t.debug&&b("face mesh detection requested, but model is not loaded");else{if((x=t.face.attention)!=null&&x.enabled&&!M.kernels.includes("atan2"))return t.face.attention.enabled=!1,r.dispose(k.tensor),s;let N=K.execute(k.tensor),V=await N.find(D=>D.shape[D.shape.length-1]===1).data();if(k.faceScore=Math.round(100*V[0])/100,k.faceScore<(((p=t.face.detector)==null?void 0:p.minConfidence)||1)){if(u.confidence=k.faceScore,t.face.mesh.keepInvalid){k.box=j2(u,e),k.boxRaw=I2(u,e),k.size=u.size,k.score=k.boxScore,k.mesh=u.landmarks,k.meshRaw=k.mesh.map(D=>[D[0]/(e.shape[2]||1),D[1]/(e.shape[1]||1),(D[2]||0)/i]);for(let D of Object.keys(ve))k.annotations[D]=[k.mesh[ve[D]]]}}else{let D=N.find(U=>U.shape[U.shape.length-1]===1404),Z=r.reshape(D,[-1,3]),J=await Z.array();r.dispose(Z),(m=t.face.attention)!=null&&m.enabled?J=await Y1(J,N):(h=t.face.iris)!=null&&h.enabled&&(J=await q1(J,k.tensor,o2,t)),k.mesh=L1(J,u,g,E,o2),k.meshRaw=k.mesh.map(U=>[U[0]/(e.shape[2]||0),U[1]/(e.shape[1]||0),(U[2]||0)/i]);for(let U of Object.keys(F0))k.annotations[U]=F0[U].map(m0=>k.mesh[m0]);k.score=k.faceScore;let q={...C1(k.mesh,u),confidence:u.confidence,landmarks:u.landmarks,size:u.size};k.box=j2(q,e),k.boxRaw=I2(q,e),k.size=q.size,A.push(q)}r.dispose(N)}k.score>(((T=t.face.detector)==null?void 0:T.minConfidence)||1)?s.push(k):r.dispose(k.tensor)}return K0.boxes=A,s}async function J1(e){var t,n,o,s,A,a;return M.initial&&(K=null),(t=e.face.attention)!=null&&t.enabled&&(K!=null&&K.signature)&&Object.keys(((n=K==null?void 0:K.signature)==null?void 0:n.outputs)||{}).length<6&&(K=null),K?e.debug&&b("cached model:",K.modelUrl):(o=e.face.attention)!=null&&o.enabled?K=await L(e.face.attention.modelPath):K=await L((s=e.face.mesh)==null?void 0:s.modelPath),o2=K.executor&&((A=K==null?void 0:K.inputs)!=null&&A[0].shape)?(a=K==null?void 0:K.inputs)==null?void 0:a[0].shape[2]:256,K}var Q1=Re,_1=t2;var Gt=[],d0,W2=[],$1=0,e3=0,Ht=Number.MAX_SAFE_INTEGER,Vt=!1;async function t3(e){var t,n,o;return M.initial&&(d0=null),d0?e.debug&&b("cached model:",d0.modelUrl):(d0=await L((t=e.face.emotion)==null?void 0:t.modelPath),Vt=((o=(n=d0==null?void 0:d0.inputs)==null?void 0:n[0].shape)==null?void 0:o[3])===3,Vt?Gt=["angry","disgust","fear","happy","neutral","sad","surprise"]:Gt=["angry","disgust","fear","happy","sad","surprise","neutral"]),d0}async function Zt(e,t,n,o){var a,i;if(!d0)return[];let s=Ht<(((a=t.face.emotion)==null?void 0:a.skipFrames)||0),A=(((i=t.face.emotion)==null?void 0:i.skipTime)||0)>R()-e3;return t.skipAllowed&&A&&s&&$1===o&&W2[n]&&W2[n].length>0?(Ht++,W2[n]):(Ht=0,new Promise(async c=>{var y,l,f;let d=[];if((y=t.face.emotion)!=null&&y.enabled){let x={},p=d0!=null&&d0.inputs[0].shape?d0.inputs[0].shape[2]:0;if(((l=t.face.emotion)==null?void 0:l.crop)>0){let h=(f=t.face.emotion)==null?void 0:f.crop,T=[[h,h,1-h,1-h]];x.resize=r.image.cropAndResize(e,T,[0],[p,p])}else x.resize=r.image.resizeBilinear(e,[p,p],!1);Vt?(x.mul=r.mul(x.resize,255),x.normalize=r.sub(x.mul,[103.939,116.779,123.68]),x.emotion=d0==null?void 0:d0.execute(x.normalize)):(x.channels=r.mul(x.resize,O.rgb),x.grayscale=r.sum(x.channels,3,!0),x.grayscaleSub=r.sub(x.grayscale,O.tf05),x.grayscaleMul=r.mul(x.grayscaleSub,O.tf2),x.emotion=d0==null?void 0:d0.execute(x.grayscaleMul)),e3=R();let m=await x.emotion.data();for(let h=0;h(t.face.emotion.minConfidence||0)&&d.push({score:Math.min(.99,Math.trunc(100*m[h])/100),emotion:Gt[h]});d.sort((h,T)=>T.score-h.score),Object.keys(x).forEach(h=>r.dispose(x[h]))}W2[n]=d,$1=o,c(d)}))}var x0,de=[],o3=0,r3=0,Xt=Number.MAX_SAFE_INTEGER;async function s3(e){var t;return M.initial&&(x0=null),x0?e.debug&&b("cached model:",x0.modelUrl):x0=await L((t=e.face.description)==null?void 0:t.modelPath),x0}function bs(e,t){var A,a;let n=e.image||e.tensor||e;if(!(x0!=null&&x0.inputs[0].shape))return n;let o;if(((A=t.face.description)==null?void 0:A.crop)>0){let i=(a=t.face.description)==null?void 0:a.crop,c=[[i,i,1-i,1-i]];o=r.image.cropAndResize(n,c,[0],[x0.inputs[0].shape[2],x0.inputs[0].shape[1]])}else o=r.image.resizeBilinear(n,[x0.inputs[0].shape[2],x0.inputs[0].shape[1]],!1);let s=r.mul(o,O.tf255);return r.dispose(o),s}async function qt(e,t,n,o){var i,c,d,y;let s={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(x0!=null&&x0.executor))return s;let A=Xt<(((i=t.face.description)==null?void 0:i.skipFrames)||0),a=(((c=t.face.description)==null?void 0:c.skipTime)||0)>R()-o3;return t.skipAllowed&&A&&a&&r3===o&&((d=de==null?void 0:de[n])==null?void 0:d.age)>0&&((y=de==null?void 0:de[n])==null?void 0:y.genderScore)>0?(Xt++,de[n]):(Xt=0,new Promise(async l=>{var f;if((f=t.face.description)!=null&&f.enabled){let x=bs(e,t),p=x0==null?void 0:x0.execute(x);o3=R(),r.dispose(x);let h=await p.find(C=>C.shape[1]===1).data(),T=Math.trunc(200*Math.abs(h[0]-.5))/100;T>(t.face.description.minConfidence||0)&&(s.gender=h[0]<=.5?"female":"male",s.genderScore=Math.min(.99,T));let v=r.argMax(p.find(C=>C.shape[1]===100),1),u=(await v.data())[0];r.dispose(v);let E=await p.find(C=>C.shape[1]===100).data();s.age=Math.round(E[u-1]>E[u+1]?10*u-100*E[u-1]:10*u+100*E[u+1])/10,(Number.isNaN(h[0])||Number.isNaN(E[0]))&&b("faceres error:",{model:x0,result:p});let k=p.find(C=>C.shape[1]===1024),N=k?await k.data():[];s.descriptor=Array.from(N),p.forEach(C=>r.dispose(C))}de[n]=s,r3=o,l(s)}))}var Ve=.1,Ut=.5;function gs(e,t,n){let o=!1,s=n.length-1;for(let A=0;At!=n[s].y>t&&e<(n[s].x-n[A].x)*(t-n[A].y)/(n[s].y-n[A].y)+n[A].x&&(o=!o);return o}async function a3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,o=await e.tensor.buffer(),s=[];for(let a of F0.silhouette)s.push({x:(e.mesh[a][0]-e.box[0])/e.box[2],y:(e.mesh[a][1]-e.box[1])/e.box[3]});Ve&&Ve>0&&(s=s.map(a=>({x:a.x>.5?a.x+Ve:a.x-Ve,y:a.y>.5?a.y+Ve:a.y-Ve})));for(let a=0;aR()-l3,A=Yt<(((i=t.face.antispoof)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&s&&A&&i3===o&&D2[n]?(Yt++,D2[n]):(Yt=0,new Promise(async c=>{let d=r.image.resizeBilinear(e,[y0!=null&&y0.inputs[0].shape?y0.inputs[0].shape[2]:0,y0!=null&&y0.inputs[0].shape?y0.inputs[0].shape[1]:0],!1),y=y0==null?void 0:y0.execute(d),l=(await y.data())[0];D2[n]=Math.round(100*l)/100,i3=o,l3=R(),r.dispose([d,y]),c(D2[n])}))}var f0,F2=[],Jt=Number.MAX_SAFE_INTEGER,x3=0,y3=0;async function f3(e){var t;return M.initial&&(f0=null),f0?e.debug&&b("cached model:",f0.modelUrl):f0=await L((t=e.face.liveness)==null?void 0:t.modelPath),f0}async function Qt(e,t,n,o){var a,i;if(!(f0!=null&&f0.executor))return 0;let s=(((a=t.face.liveness)==null?void 0:a.skipTime)||0)>R()-y3,A=Jt<(((i=t.face.liveness)==null?void 0:i.skipFrames)||0);return t.skipAllowed&&s&&A&&x3===o&&F2[n]?(Jt++,F2[n]):(Jt=0,new Promise(async c=>{let d=r.image.resizeBilinear(e,[f0!=null&&f0.inputs[0].shape?f0.inputs[0].shape[2]:0,f0!=null&&f0.inputs[0].shape?f0.inputs[0].shape[1]:0],!1),y=f0==null?void 0:f0.execute(d),l=(await y.data())[0];F2[n]=Math.round(100*l)/100,x3=o,y3=R(),r.dispose([d,y]),c(F2[n])}))}var B0,_t=[],vs=["white","black","asian","indian","other"],Rs=[15,23,28,35.5,45.5,55.5,65],p3=0,u3=0,$t=Number.MAX_SAFE_INTEGER;async function h3(e){var t;return M.initial&&(B0=null),B0?e.debug&&b("cached model:",B0.modelUrl):B0=await L((t=e.face.gear)==null?void 0:t.modelPath),B0}async function e5(e,t,n,o){var a,i;if(!B0)return{age:0,gender:"unknown",genderScore:0,race:[]};let s=$t<(((a=t.face.gear)==null?void 0:a.skipFrames)||0),A=(((i=t.face.gear)==null?void 0:i.skipTime)||0)>R()-u3;return t.skipAllowed&&A&&s&&p3===o&&_t[n]?($t++,_t[n]):($t=0,new Promise(async c=>{var T,v,u,g;if(!(B0!=null&&B0.inputs[0].shape))return;let d={},y=[[0,.1,.9,.9]];if(((T=t.face.gear)==null?void 0:T.crop)>0){let E=(v=t.face.gear)==null?void 0:v.crop;y=[[E,E,1-E,1-E]]}d.resize=r.image.cropAndResize(e,y,[0],[B0.inputs[0].shape[2],B0.inputs[0].shape[1]]);let l={age:0,gender:"unknown",genderScore:0,race:[]};(u=t.face.gear)!=null&&u.enabled&&([d.age,d.gender,d.race]=B0.execute(d.resize,["age_output","gender_output","race_output"]));let f=await d.gender.data();l.gender=f[0]>f[1]?"male":"female",l.genderScore=Math.round(100*(f[0]>f[1]?f[0]:f[1]))/100;let x=await d.race.data();for(let E=0;E(((g=t.face.gear)==null?void 0:g.minConfidence)||.2)&&l.race.push({score:Math.round(100*x[E])/100,race:vs[E]});l.race.sort((E,k)=>k.score-E.score);let m=Array.from(await d.age.data()).map((E,k)=>[Rs[k],E]).sort((E,k)=>k[1]-E[1]),h=m[0][0];for(let E=1;Er.dispose(d[E])),_t[n]=l,p3=o,u3=R(),c(l)}))}var R0,B2=[],g3=0,T3=0,t5=Number.MAX_SAFE_INTEGER;async function v3(e){return M.initial&&(R0=null),R0?e.debug&&b("cached model:",R0.modelUrl):R0=await L(e.face.ssrnet.modelPathAge),R0}async function n5(e,t,n,o){var a,i,c,d;if(!R0)return{age:0};let s=t5<(((a=t.face.ssrnet)==null?void 0:a.skipFrames)||0),A=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>R()-T3;return t.skipAllowed&&s&&A&&g3===o&&((c=B2[n])!=null&&c.age)&&((d=B2[n])==null?void 0:d.age)>0?(t5++,B2[n]):(t5=0,new Promise(async y=>{var x,p,m;if(!(R0!=null&&R0.inputs)||!R0.inputs[0]||!R0.inputs[0].shape)return;let l={};if(((x=t.face.ssrnet)==null?void 0:x.crop)>0){let h=(p=t.face.ssrnet)==null?void 0:p.crop,T=[[h,h,1-h,1-h]];l.resize=r.image.cropAndResize(e,T,[0],[R0.inputs[0].shape[2],R0.inputs[0].shape[1]])}else l.resize=r.image.resizeBilinear(e,[R0.inputs[0].shape[2],R0.inputs[0].shape[1]],!1);l.enhance=r.mul(l.resize,O.tf255);let f={age:0};if((m=t.face.ssrnet)!=null&&m.enabled&&(l.age=R0.execute(l.enhance)),l.age){let h=await l.age.data();f.age=Math.trunc(10*h[0])/10}Object.keys(l).forEach(h=>r.dispose(l[h])),B2[n]=f,g3=o,T3=R(),y(f)}))}var u0,H2=[],M3=0,P3=0,o5=Number.MAX_SAFE_INTEGER,r5=[.2989,.587,.114];async function k3(e){var t;return M.initial&&(u0=null),u0?e.debug&&b("cached model:",u0.modelUrl):u0=await L((t=e.face.ssrnet)==null?void 0:t.modelPathGender),u0}async function s5(e,t,n,o){var a,i,c,d;if(!u0)return{gender:"unknown",genderScore:0};let s=o5<(((a=t.face.ssrnet)==null?void 0:a.skipFrames)||0),A=(((i=t.face.ssrnet)==null?void 0:i.skipTime)||0)>R()-P3;return t.skipAllowed&&s&&A&&M3===o&&((c=H2[n])!=null&&c.gender)&&((d=H2[n])==null?void 0:d.genderScore)>0?(o5++,H2[n]):(o5=0,new Promise(async y=>{var p,m,h;if(!(u0!=null&&u0.inputs[0].shape))return;let l={};if(((p=t.face.ssrnet)==null?void 0:p.crop)>0){let T=(m=t.face.ssrnet)==null?void 0:m.crop,v=[[T,T,1-T,1-T]];l.resize=r.image.cropAndResize(e,v,[0],[u0.inputs[0].shape[2],u0.inputs[0].shape[1]])}else l.resize=r.image.resizeBilinear(e,[u0.inputs[0].shape[2],u0.inputs[0].shape[1]],!1);l.enhance=r.tidy(()=>{var v,u;let T;if(((u=(v=u0==null?void 0:u0.inputs)==null?void 0:v[0].shape)==null?void 0:u[3])===1){let[g,E,k]=r.split(l.resize,3,3),N=r.mul(g,r5[0]),C=r.mul(E,r5[1]),V=r.mul(k,r5[2]),D=r.addN([N,C,V]);T=r.mul(r.sub(D,O.tf05),2)}else T=r.mul(r.sub(l.resize,O.tf05),2);return T});let f={gender:"unknown",genderScore:0};(h=t.face.ssrnet)!=null&&h.enabled&&(l.gender=u0.execute(l.enhance));let x=await l.gender.data();f.gender=x[0]>x[1]?"female":"male",f.genderScore=x[0]>x[1]?Math.trunc(100*x[0])/100:Math.trunc(100*x[1])/100,Object.keys(l).forEach(T=>r.dispose(l[T])),H2[n]=f,M3=o,P3=R(),y(f)}))}var S0,A5=[],E3=0,z3=0,S3=Number.MAX_SAFE_INTEGER;async function j3(e){var t;return M.initial&&(S0=null),S0?e.debug&&b("cached model:",S0.modelUrl):S0=await L((t=e.face.mobilefacenet)==null?void 0:t.modelPath),S0}async function a5(e,t,n,o){var a,i;if(!(S0!=null&&S0.executor))return[];let s=S3<(((a=t.face.mobilefacenet)==null?void 0:a.skipFrames)||0),A=(((i=t.face.mobilefacenet)==null?void 0:i.skipTime)||0)>R()-z3;return t.skipAllowed&&A&&s&&E3===o&&A5[n]?(S3++,A5[n]):new Promise(async c=>{var y;let d=[];if((y=t.face.mobilefacenet)!=null&&y.enabled&&(S0!=null&&S0.inputs[0].shape)){let l={};l.crop=r.image.resizeBilinear(e,[S0.inputs[0].shape[2],S0.inputs[0].shape[1]],!1),l.data=S0.execute(l.crop);let f=await l.data.data();d=Array.from(f),Object.keys(l).forEach(x=>r.dispose(l[x]))}A5[n]=d,E3=o,z3=R(),c(d)})}var j0,i5=[],N3=0,L3=0,O3=Number.MAX_SAFE_INTEGER;async function C3(e){return M.initial&&(j0=null),j0?e.debug&&b("cached model:",j0.modelUrl):j0=await L(e.face.insightface.modelPath),j0}async function l5(e,t,n,o){var a,i;if(!(j0!=null&&j0.executor))return[];let s=O3<(((a=t.face.insightface)==null?void 0:a.skipFrames)||0),A=(((i=t.face.insightface)==null?void 0:i.skipTime)||0)>R()-L3;return t.skipAllowed&&A&&s&&N3===o&&i5[n]?(O3++,i5[n]):new Promise(async c=>{var y;let d=[];if((y=t.face.insightface)!=null&&y.enabled&&(j0!=null&&j0.inputs[0].shape)){let l={};l.crop=r.image.resizeBilinear(e,[j0.inputs[0].shape[2],j0.inputs[0].shape[1]],!1),l.data=j0.execute(l.crop);let f=await l.data.data();d=Array.from(f),Object.keys(l).forEach(x=>r.dispose(l[x]))}i5[n]=d,N3=o,L3=R(),c(d)})}var Ms=e=>{let t=(l,f)=>Math.atan2(l[1]-f[1],l[0]-f[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],o=1,s=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),A=s?e.mesh[473]:e.mesh[468],a=s?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],i=s?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],c=[(a[0]-A[0])/i[0]-n[0],o*(A[1]-a[1])/i[1]-n[1]],d=Math.sqrt(c[0]*c[0]+c[1]*c[1]);return d=Math.min(d,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],c)+Math.PI/2)%Math.PI,strength:d}},D3=(e,t)=>{let n=m=>{let h=Math.sqrt(m[0]*m[0]+m[1]*m[1]+m[2]*m[2]);return m[0]/=h,m[1]/=h,m[2]/=h,m},o=(m,h)=>{let T=m[0]-h[0],v=m[1]-h[1],u=m[2]-h[2];return[T,v,u]},s=(m,h)=>{let T=m[1]*h[2]-m[2]*h[1],v=m[2]*h[0]-m[0]*h[2],u=m[0]*h[1]-m[1]*h[0];return[T,v,u]},A=m=>{let[h,T,v,u,g,E,k,N,C]=m,V,D,Z;return u<1?u>-1?(Z=Math.asin(u),D=Math.atan2(-k,h),V=Math.atan2(-E,g)):(Z=-Math.PI/2,D=-Math.atan2(N,C),V=0):(Z=Math.PI/2,D=Math.atan2(N,C),V=0),Number.isNaN(V)&&(V=0),Number.isNaN(D)&&(D=0),Number.isNaN(Z)&&(Z=0),{pitch:2*-V,yaw:2*-D,roll:2*-Z}},a=e.meshRaw;if(!a||a.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let i=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,c=[a[10],a[152],a[234],a[454]].map(m=>[m[0]*t[0]/i,m[1]*t[1]/i,m[2]]),d=n(o(c[1],c[0])),y=n(o(c[3],c[2])),l=n(s(y,d));y=s(d,l);let f=[y[0],y[1],y[2],d[0],d[1],d[2],l[0],l[1],l[2]],x=A(f),p=a.length===478?Ms(e):{bearing:0,strength:0};return{angle:x,matrix:f,gaze:p}};function F3(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let o=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/o)/100}var c5=async(e,t)=>{var p,m,h,T,v,u,g,E,k,N,C,V,D,Z,J,q,U,m0,P,i0,g0,e0,G;let n=R(),o,s,A,a,i,c,d,y,l,f=[];e.state="run:face";let x=await K1(t,e.config);if(e.performance.face=M.perfadd?(e.performance.face||0)+Math.trunc(R()-n):Math.trunc(R()-n),!t.shape||t.shape.length!==4)return[];if(!x)return[];for(let S=0;S200?D3(x[S],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?a=(m=e.config.face.emotion)!=null&&m.enabled?Zt(x[S].tensor||r.tensor([]),e.config,S,x.length):[]:(e.state="run:emotion",n=R(),a=(h=e.config.face.emotion)!=null&&h.enabled?await Zt(x[S].tensor||r.tensor([]),e.config,S,x.length):[],e.performance.emotion=M.perfadd?(e.performance.emotion||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?d=(T=e.config.face.antispoof)!=null&&T.enabled?Kt(x[S].tensor||r.tensor([]),e.config,S,x.length):0:(e.state="run:antispoof",n=R(),d=(v=e.config.face.antispoof)!=null&&v.enabled?await Kt(x[S].tensor||r.tensor([]),e.config,S,x.length):0,e.performance.antispoof=M.perfadd?(e.performance.antispoof||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?y=(u=e.config.face.liveness)!=null&&u.enabled?Qt(x[S].tensor||r.tensor([]),e.config,S,x.length):0:(e.state="run:liveness",n=R(),y=(g=e.config.face.liveness)!=null&&g.enabled?await Qt(x[S].tensor||r.tensor([]),e.config,S,x.length):0,e.performance.liveness=M.perfadd?(e.performance.antispoof||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?s=(E=e.config.face.gear)!=null&&E.enabled?e5(x[S].tensor||r.tensor([]),e.config,S,x.length):null:(e.state="run:gear",n=R(),s=(k=e.config.face.gear)!=null&&k.enabled?await e5(x[S].tensor||r.tensor([]),e.config,S,x.length):null,e.performance.gear=Math.trunc(R()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(o=(N=e.config.face.ssrnet)!=null&&N.enabled?n5(x[S].tensor||r.tensor([]),e.config,S,x.length):null,A=(C=e.config.face.ssrnet)!=null&&C.enabled?s5(x[S].tensor||r.tensor([]),e.config,S,x.length):null):(e.state="run:ssrnet",n=R(),o=(V=e.config.face.ssrnet)!=null&&V.enabled?await n5(x[S].tensor||r.tensor([]),e.config,S,x.length):null,A=(D=e.config.face.ssrnet)!=null&&D.enabled?await s5(x[S].tensor||r.tensor([]),e.config,S,x.length):null,e.performance.ssrnet=Math.trunc(R()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?i=(Z=e.config.face.mobilefacenet)!=null&&Z.enabled?a5(x[S].tensor||r.tensor([]),e.config,S,x.length):null:(e.state="run:mobilefacenet",n=R(),i=(J=e.config.face.mobilefacenet)!=null&&J.enabled?await a5(x[S].tensor||r.tensor([]),e.config,S,x.length):null,e.performance.mobilefacenet=Math.trunc(R()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?c=(q=e.config.face.insightface)!=null&&q.enabled?l5(x[S].tensor||r.tensor([]),e.config,S,x.length):null:(e.state="run:mobilefacenet",n=R(),c=(U=e.config.face.insightface)!=null&&U.enabled?await l5(x[S].tensor||r.tensor([]),e.config,S,x.length):null,e.performance.mobilefacenet=Math.trunc(R()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?l=qt(x[S].tensor||r.tensor([]),e.config,S,x.length):(e.state="run:description",n=R(),l=await qt(x[S].tensor||r.tensor([]),e.config,S,x.length),e.performance.description=M.perfadd?(e.performance.description||0)+Math.trunc(R()-n):Math.trunc(R()-n)),e.analyze("End Description:"),e.config.async&&([o,A,a,i,c,l,s,d,y]=await Promise.all([o,A,a,i,c,l,s,d,y])),e.analyze("Finish Face:"),(m0=e.config.face.ssrnet)!=null&&m0.enabled&&o&&A&&(l={...l,age:o.age,gender:A.gender,genderScore:A.genderScore}),(P=e.config.face.gear)!=null&&P.enabled&&s&&(l={...l,age:s.age,gender:s.gender,genderScore:s.genderScore,race:s.race}),(i0=e.config.face.mobilefacenet)!=null&&i0.enabled&&i&&(l.descriptor=i),(g0=e.config.face.insightface)!=null&&g0.enabled&&c&&(l.descriptor=c);let F=(e0=e.config.face.iris)!=null&&e0.enabled?F3(x[S],t.shape[2]):0,w0=(G=e.config.face.detector)!=null&&G.return?r.squeeze(x[S].tensor):null;r.dispose(x[S].tensor),x[S].tensor&&delete x[S].tensor;let t0={...x[S],id:S};l.age&&(t0.age=l.age),l.gender&&(t0.gender=l.gender),l.genderScore&&(t0.genderScore=l.genderScore),l.descriptor&&(t0.embedding=l.descriptor),l.race&&(t0.race=l.race),a&&(t0.emotion=a),d&&(t0.real=d),y&&(t0.live=y),F>0&&(t0.distance=F),W&&(t0.rotation=W),w0&&(t0.tensor=w0),f.push(t0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),f};var M0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>M0.nameMapping[e],getPoints:e=>M0.pointsMapping[e]},ye={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>ye.nameMapping[e]},$={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>$.nameMapping[e]},xe=class{constructor(t){z(this,"name");z(this,"curls");z(this,"directions");z(this,"weights");z(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,o){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,o])}direction(t,n,o){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,o])}weight(t,n){this.weights[t]=n;let o=this.weights.reduce((s,A)=>s+A,0);this.weightsRelative=this.weights.map(s=>s*5/o)}matchAgainst(t,n){let o=0;for(let s in t){let A=t[s],a=this.curls[s];if(typeof a=="undefined"){o+=this.weightsRelative[s];continue}for(let[i,c]of a)if(A===i){o+=c*this.weightsRelative[s];break}}for(let s in n){let A=n[s],a=this.directions[s];if(typeof a=="undefined"){o+=this.weightsRelative[s];continue}for(let[i,c]of a)if(A===i){o+=c*this.weightsRelative[s];break}}return o/10}};var{thumb:V0,index:_0,middle:$0,ring:ze,pinky:Se}=M0,{none:Z0,half:ks,full:X0}=ye,{verticalUp:Ze,verticalDown:ni,horizontalLeft:d5,horizontalRight:ws,diagonalUpRight:Es,diagonalUpLeft:Xe,diagonalDownRight:oi,diagonalDownLeft:ri}=$,fe=new xe("thumbs up");fe.curl(V0,Z0,1);fe.direction(V0,Ze,1);fe.direction(V0,Xe,.25);fe.direction(V0,Es,.25);for(let e of[M0.index,M0.middle,M0.ring,M0.pinky])fe.curl(e,X0,1),fe.direction(e,d5,1),fe.direction(e,ws,1);var s0=new xe("victory");s0.curl(V0,ks,.5);s0.curl(V0,Z0,.5);s0.direction(V0,Ze,1);s0.direction(V0,Xe,1);s0.curl(_0,Z0,1);s0.direction(_0,Ze,.75);s0.direction(_0,Xe,1);s0.curl($0,Z0,1);s0.direction($0,Ze,1);s0.direction($0,Xe,.75);s0.curl(ze,X0,1);s0.direction(ze,Ze,.2);s0.direction(ze,Xe,1);s0.direction(ze,d5,.2);s0.curl(Se,X0,1);s0.direction(Se,Ze,.2);s0.direction(Se,Xe,1);s0.direction(Se,d5,.2);s0.weight(_0,2);s0.weight($0,2);var me=new xe("point");me.curl(V0,X0,1);me.curl(_0,Z0,.5);me.curl($0,X0,.5);me.curl(ze,X0,.5);me.curl(Se,X0,.5);me.weight(_0,2);me.weight($0,2);var pe=new xe("middle finger");pe.curl(V0,Z0,1);pe.curl(_0,X0,.5);pe.curl($0,X0,.5);pe.curl(ze,X0,.5);pe.curl(Se,X0,.5);pe.weight(_0,2);pe.weight($0,2);var qe=new xe("open palm");qe.curl(V0,Z0,.75);qe.curl(_0,Z0,.75);qe.curl($0,Z0,.75);qe.curl(ze,Z0,.75);qe.curl(Se,Z0,.75);var B3=[fe,s0,me,pe,qe];var zs=.7,je={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function H3(e,t,n,o){let s=(t-o)/(e-n),A=Math.atan(s)*180/Math.PI;return A<=0?A=-A:A>0&&(A=180-A),A}function V3(e,t){if(!e||!t)return[0,0];let n=H3(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let o=H3(e[1],e[2],t[1],t[2]);return[n,o]}function G3(e,t=1){let n=0,o=0,s=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?o=1*t:s=1*t,[n,o,s]}function Ss(e,t,n){let o=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],i=e[1]-n[1],c=t[1]-n[1],d=e[2]-t[2],y=e[2]-n[2],l=t[2]-n[2],f=Math.sqrt(o*o+a*a+d*d),x=Math.sqrt(s*s+i*i+y*y),p=Math.sqrt(A*A+c*c+l*l),m=(p*p+f*f-x*x)/(2*p*f);m>1?m=1:m<-1&&(m=-1);let h=Math.acos(m);h=57.2958*h%180;let T;return h>je.NO_CURL_START_LIMIT?T=ye.none:h>je.HALF_CURL_START_LIMIT?T=ye.half:T=ye.full,T}function Z3(e,t,n,o){let s;return o===Math.abs(e)?e>0?s=$.horizontalLeft:s=$.horizontalRight:o===Math.abs(t)?t>0?s=$.horizontalLeft:s=$.horizontalRight:n>0?s=$.horizontalLeft:s=$.horizontalRight,s}function X3(e,t,n,o){let s;return o===Math.abs(e)?e<0?s=$.verticalDown:s=$.verticalUp:o===Math.abs(t)?t<0?s=$.verticalDown:s=$.verticalUp:n<0?s=$.verticalDown:s=$.verticalUp,s}function js(e,t,n,o,s,A,a,i){let c,d=X3(e,t,n,o),y=Z3(s,A,a,i);return d===$.verticalUp?y===$.horizontalLeft?c=$.diagonalUpLeft:c=$.diagonalUpRight:y===$.horizontalLeft?c=$.diagonalDownLeft:c=$.diagonalDownRight,c}function Is(e,t,n,o){let s=e[0]-t[0],A=e[0]-n[0],a=t[0]-n[0],i=e[1]-t[1],c=e[1]-n[1],d=t[1]-n[1],y=Math.max(Math.abs(s),Math.abs(A),Math.abs(a)),l=Math.max(Math.abs(i),Math.abs(c),Math.abs(d)),f=0,x=0,p=0,m=l/(y+1e-5);m>1.5?f+=je.DISTANCE_VOTE_POWER:m>.66?x+=je.DISTANCE_VOTE_POWER:p+=je.DISTANCE_VOTE_POWER;let h=Math.sqrt(s*s+i*i),T=Math.sqrt(A*A+c*c),v=Math.sqrt(a*a+d*d),u=Math.max(h,T,v),g=e[0],E=e[1],k=n[0],N=n[1];u===h?(k=n[0],N=n[1]):u===v&&(g=t[0],E=t[1]);let D=V3([g,E],[k,N]),Z=G3(D,je.TOTAL_ANGLE_VOTE_POWER);f+=Z[0],x+=Z[1],p+=Z[2];for(let q of o){let U=G3(q,je.SINGLE_ANGLE_VOTE_POWER);f+=U[0],x+=U[1],p+=U[2]}let J;return f===Math.max(f,x,p)?J=X3(c,i,d,l):p===Math.max(x,p)?J=Z3(A,s,a,y):J=js(c,i,d,l,A,s,a,y),J}function q3(e){let t=[],n=[],o=[],s=[];if(!e)return{curls:o,directions:s};for(let A of M0.all){let a=M0.getPoints(A),i=[],c=[];for(let d of a){let y=e[d[0]],l=e[d[1]],f=V3(y,l),x=f[0],p=f[1];i.push(x),c.push(p)}t.push(i),n.push(c)}for(let A of M0.all){let a=A===M0.thumb?1:0,i=M0.getPoints(A),c=e[i[a][0]],d=e[i[a+1][1]],y=e[i[3][1]],l=Ss(c,d,y),f=Is(c,d,y,t[A].slice(a));o[A]=l,s[A]=f}return{curls:o,directions:s}}function G2(e){if(!e||e.length===0)return null;let t=q3(e),n={};for(let o of M0.all)n[M0.getName(o)]={curl:ye.getName(t.curls[o]),direction:$.getName(t.directions[o])};return n}function U3(e){let t=[];if(!e||e.length===0)return t;let n=q3(e);for(let o of B3){let s=o.matchAgainst(n.curls,n.directions);s>=zs&&t.push({name:o.name,confidence:s})}return t}var Y3=e=>{if(!e)return[];let t=[];for(let n=0;nc.part==="leftWrist"),s=e[n].keypoints.find(c=>c.part==="rightWrist"),A=e[n].keypoints.find(c=>c.part==="nose");A&&o&&s&&o.position[1]c.part==="leftShoulder"),i=e[n].keypoints.find(c=>c.part==="rightShoulder");a&&i&&Math.abs(a.positionRaw[1]-i.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${a.position[1]>i.position[1]?"left":"right"}`})}return t},K3=e=>{if(!e)return[];let t=[];for(let n=0;n450){let o=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),s=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(o/s)<=.15?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${o<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 c=e[n].mesh[152][2]||0;Math.abs(c)>10&&t.push({face:n,gesture:`head ${c<0?"up":"down"}`})}return t},J3=e=>{var n,o,s,A;if(!e)return[];let t=[];for(let a=0;a.06||h>.06)&&(x=!1),m>h?h>.04&&t.push({iris:a,gesture:"looking right"}):m>.04&&t.push({iris:a,gesture:"looking left"});let T=Math.abs(e[a].mesh[145][1]-e[a].annotations.rightEyeIris[0][1])/e[a].box[3],v=Math.abs(e[a].mesh[374][1]-e[a].annotations.leftEyeIris[0][1])/e[a].box[3];(v<.01||T<.01||v>.022||T>.022)&&(x=!1),(v<.01||T<.01)&&t.push({iris:a,gesture:"looking down"}),(v>.022||T>.022)&&t.push({iris:a,gesture:"looking up"}),x&&t.push({iris:a,gesture:"looking center"})}return t},Q3=e=>{if(!e)return[];let t=[];for(let n=0;n0){let s=o.reduce((a,i)=>(a.position[2]||0)<(i.position[2]||0)?a:i);t.push({hand:n,gesture:`${s.name} forward`});let A=o.reduce((a,i)=>a.position[1][A[0]*t[0],A[1]*t[1]]);return{startPoint:n,endPoint:o,palmLandmarks:s,confidence:e.confidence}}function Z2(e,t=1.5){let n=r2(e),o=V2(e),s=[t*o[0]/2,t*o[1]/2],A=[n[0]-s[0],n[1]-s[1]],a=[n[0]+s[0],n[1]+s[1]];return{startPoint:A,endPoint:a,palmLandmarks:e.palmLandmarks}}function X2(e){let t=r2(e),n=V2(e),s=Math.max(...n)/2,A=[t[0]-s,t[1]-s],a=[t[0]+s,t[1]+s];return{startPoint:A,endPoint:a,palmLandmarks:e.palmLandmarks}}function Ls(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function nn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return Ls(n)}var _3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function ue(e,t){let n=0;for(let o=0;o[a.x,a.y]),this.anchorsTensor=r.tensor2d(this.anchors),this.inputSize=((A=(s=(o=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:o[0])==null?void 0:s.shape)==null?void 0:A[2])||0,this.inputSizeTensor=r.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=r.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=r.slice(t,[0,0],[-1,2]),n.boxSizes=r.slice(t,[0,2],[-1,2]),n.div=r.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=r.add(n.div,this.anchorsTensor),n.halfBoxSizes=r.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=r.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=r.mul(n.sub,this.inputSizeTensor),n.add=r.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=r.mul(n.add,this.inputSizeTensor);let o=r.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(s=>r.dispose(n[s])),o}normalizeLandmarks(t,n){let o={};o.reshape=r.reshape(t,[-1,7,2]),o.div=r.div(o.reshape,this.inputSizeTensor),o.landmarks=r.add(o.div,this.anchors[n]?this.anchors[n]:0);let s=r.mul(o.landmarks,this.inputSizeTensor);return Object.keys(o).forEach(A=>r.dispose(o[A])),s}async predict(t,n){var i;let o={};o.resize=r.image.resizeBilinear(t,[this.inputSize,this.inputSize]),o.div=r.div(o.resize,O.tf127),o.image=r.sub(o.div,O.tf1),o.batched=this.model.execute(o.image),o.predictions=r.squeeze(o.batched),o.slice=r.slice(o.predictions,[0,0],[-1,1]),o.sigmoid=r.sigmoid(o.slice),o.scores=r.squeeze(o.sigmoid);let s=await o.scores.data();o.boxes=r.slice(o.predictions,[0,1],[-1,4]),o.norm=this.normalizeBoxes(o.boxes),o.nms=await r.image.nonMaxSuppressionAsync(o.norm,o.scores,3*(((i=n.hand)==null?void 0:i.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let A=await o.nms.array(),a=[];for(let c of A){let d={};d.box=r.slice(o.norm,[c,0],[1,-1]),d.slice=r.slice(o.predictions,[c,5],[1,14]),d.norm=this.normalizeLandmarks(d.slice,c),d.palmLandmarks=r.reshape(d.norm,[-1,2]);let y=await d.box.data(),l=y.slice(0,2),f=y.slice(2,4),x=await d.palmLandmarks.array(),p={startPoint:l,endPoint:f,palmLandmarks:x,confidence:s[c]},m=tn(p,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);a.push(m),Object.keys(d).forEach(h=>r.dispose(d[h]))}return Object.keys(o).forEach(c=>r.dispose(o[c])),a}};var Ds=5,An=1.65,an=[0,5,9,13,17,1,2],Fs=0,Bs=2,ln=0,U2=class{constructor(t,n){z(this,"handDetector");z(this,"handPoseModel");z(this,"inputSize");z(this,"storedBoxes");z(this,"skipped");z(this,"detectedHands");var o,s,A;this.handDetector=t,this.handPoseModel=n,this.inputSize=((A=(s=(o=this.handPoseModel)==null?void 0:o.inputs)==null?void 0:s[0].shape)==null?void 0:A[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(a=>a[0]),o=t.map(a=>a[1]),s=[Math.min(...n),Math.min(...o)],A=[Math.max(...n),Math.max(...o)];return{startPoint:s,endPoint:A}}getBoxForPalmLandmarks(t,n){let o=t.map(A=>f5([...A,1],n)),s=this.calculateLandmarksBoundingBox(o);return Z2(X2(s),Ds)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),o=Z2(X2(n),An);o.palmLandmarks=[];for(let s=0;s[a[0]*(x[0]-this.inputSize/2),a[1]*(x[1]-this.inputSize/2),a[2]*x[2]]),c=y5(o,[0,0]),d=i.map(x=>[...f5(x,c),x[2]]),y=on(s),l=[...r2(n),1],f=[ue(l,y[0]),ue(l,y[1])];return d.map(x=>[Math.trunc(x[0]+f[0]),Math.trunc(x[1]+f[1]),Math.trunc(x[2])])}async estimateHands(t,n){let o=!1,s,A=(n.hand.skipTime||0)>R()-ln,a=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&A&&a?this.skipped++:(s=await this.handDetector.predict(t,n),this.skipped=0),s&&s.length>0&&(s.length!==this.detectedHands&&this.detectedHands!==n.hand.maxDetected||!n.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...s],this.storedBoxes.length>0&&(o=!0));let i=[];for(let c=0;c=n.hand.minConfidence/4){let E=r.reshape(u,[-1,3]),k=await E.array();r.dispose(u),r.dispose(E);let N=this.transformRawCoords(k,m,y,p),C=this.getBoxForHandLandmarks(N);this.storedBoxes[c]={...C,confidence:g};let V={landmarks:N,confidence:g,boxConfidence:d.confidence,fingerConfidence:g,box:{topLeft:C.startPoint,bottomRight:C.endPoint}};i.push(V)}else this.storedBoxes[c]=null;r.dispose(u)}else{let y=Z2(X2(d),An),l={confidence:d.confidence,boxConfidence:d.confidence,fingerConfidence:0,box:{topLeft:y.startPoint,bottomRight:y.endPoint},landmarks:[]};i.push(l)}}return this.storedBoxes=this.storedBoxes.filter(c=>c!==null),this.detectedHands=i.length,i.length>n.hand.maxDetected&&(i.length=n.hand.maxDetected),i}};var cn={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},Ie,Ne,m5;function Gs(){let e=Ie?new q2(Ie):void 0;e&&Ne&&(m5=new U2(e,Ne))}async function p5(e,t){m5||Gs();let n=await m5.estimateHands(e,t);if(!n)return[];let o=[];for(let s=0;sn[s].landmarks[l]);let a=n[s].landmarks,i=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],c=[0,0,0,0];if(a&&a.length>0){for(let y of a)y[0]i[2]&&(i[2]=y[0]),y[1]>i[3]&&(i[3]=y[1]);i[2]-=i[0],i[3]-=i[1],c=[i[0]/(e.shape[2]||0),i[1]/(e.shape[1]||0),i[2]/(e.shape[2]||0),i[3]/(e.shape[1]||0)]}else i=n[s].box?[Math.trunc(Math.max(0,n[s].box.topLeft[0])),Math.trunc(Math.max(0,n[s].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[s].box.bottomRight[0])-Math.max(0,n[s].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[s].box.bottomRight[1])-Math.max(0,n[s].box.topLeft[1]))]:[0,0,0,0],c=[n[s].box.topLeft[0]/(e.shape[2]||0),n[s].box.topLeft[1]/(e.shape[1]||0),(n[s].box.bottomRight[0]-n[s].box.topLeft[0])/(e.shape[2]||0),(n[s].box.bottomRight[1]-n[s].box.topLeft[1])/(e.shape[1]||0)];let d=G2(a);o.push({id:s,score:Math.round(100*n[s].confidence)/100,boxScore:Math.round(100*n[s].boxConfidence)/100,fingerScore:Math.round(100*n[s].fingerConfidence)/100,label:"hand",box:i,boxRaw:c,keypoints:a,annotations:A,landmarks:d})}return o}async function dn(e){var t;return M.initial&&(Ie=null),Ie?e.debug&&b("cached model:",Ie.modelUrl):Ie=await L((t=e.hand.detector)==null?void 0:t.modelPath),Ie}async function xn(e){var t;return M.initial&&(Ne=null),Ne?e.debug&&b("cached model:",Ne.modelUrl):Ne=await L((t=e.hand.skeleton)==null?void 0:t.modelPath),Ne}var r0=[null,null],Vs=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],he=[[0,0],[0,0]],Zs=["hand","fist","pinch","point","face","tip","pinchtip"],fn=4,mn=1.6,Xs=512,qs=1.4,Y2=Number.MAX_SAFE_INTEGER,u5=0,ee=[0,0],o0={boxes:[],hands:[]},pn={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function un(e){var t;if(M.initial&&(r0[0]=null),r0[0])e.debug&&b("cached model:",r0[0].modelUrl);else{h2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),r0[0]=await L((t=e.hand.detector)==null?void 0:t.modelPath);let n=r0[0].executor?Object.values(r0[0].modelSignature.inputs):void 0;he[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,he[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return r0[0]}async function hn(e){var t;if(M.initial&&(r0[1]=null),r0[1])e.debug&&b("cached model:",r0[1].modelUrl);else{r0[1]=await L((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=r0[1].executor?Object.values(r0[1].modelSignature.inputs):void 0;he[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,he[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return r0[1]}async function Us(e,t){let n=[];if(!e||!r0[0])return n;let o={},s=(e.shape[2]||1)/(e.shape[1]||1),A=Math.min(Math.round((e.shape[1]||0)/8)*8,Xs),a=Math.round(A*s/8)*8;o.resize=r.image.resizeBilinear(e,[A,a]),o.cast=r.cast(o.resize,"int32"),[o.rawScores,o.rawBoxes]=await r0[0].executeAsync(o.cast,Vs),o.boxes=r.squeeze(o.rawBoxes,[0,2]),o.scores=r.squeeze(o.rawScores,[0]);let i=r.unstack(o.scores,1);r.dispose(i[fn]),i.splice(fn,1),o.filtered=r.stack(i,1),r.dispose(i),o.max=r.max(o.filtered,1),o.argmax=r.argMax(o.filtered,1);let c=0;o.nms=await r.image.nonMaxSuppressionAsync(o.boxes,o.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let d=await o.nms.data(),y=await o.max.data(),l=await o.argmax.data();for(let f of Array.from(d)){let x=r.slice(o.boxes,f,1),p=await x.data();r.dispose(x);let m=[p[1],p[0],p[3]-p[1],p[2]-p[0]],h=k2(m,qs),T=[Math.trunc(m[0]*ee[0]),Math.trunc(m[1]*ee[1]),Math.trunc(m[2]*ee[0]),Math.trunc(m[3]*ee[1])],v=y[f],u=Zs[l[f]],g={id:c++,score:v,box:T,boxRaw:h,label:u};n.push(g)}return Object.keys(o).forEach(f=>r.dispose(o[f])),n.sort((f,x)=>x.score-f.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function h5(e,t,n){let o={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&r0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let s={},A=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];s.crop=r.image.cropAndResize(e,[A],[0],[he[1][0],he[1][1]],"bilinear"),s.div=r.div(s.crop,O.tf255),[s.score,s.keypoints]=r0[1].execute(s.div,["Identity_1","Identity"]);let a=(await s.score.data())[0],i=(100-Math.trunc(100/(1+Math.exp(a))))/100;if(i>=(n.hand.minConfidence||0)){o.fingerScore=i,s.reshaped=r.reshape(s.keypoints,[-1,3]);let y=(await s.reshaped.array()).map(l=>[l[0]/he[1][1],l[1]/he[1][0],l[2]||0]).map(l=>[l[0]*t.boxRaw[2],l[1]*t.boxRaw[3],l[2]||0]);o.keypoints=y.map(l=>[ee[0]*(l[0]+t.boxRaw[0]),ee[1]*(l[1]+t.boxRaw[1]),l[2]||0]),o.landmarks=G2(o.keypoints);for(let l of Object.keys(pn))o.annotations[l]=pn[l].map(f=>o.landmarks&&o.keypoints[f]?o.keypoints[f]:null)}Object.keys(s).forEach(c=>r.dispose(s[c]))}return o}async function b5(e,t){var s,A;if(!((s=r0[0])!=null&&s.executor)||!((A=r0[1])!=null&&A.executor)||!r0[0].inputs[0].shape||!r0[1].inputs[0].shape)return[];ee=[e.shape[2]||0,e.shape[1]||0],Y2++;let n=(t.hand.skipTime||0)>R()-u5,o=Y2<(t.hand.skipFrames||0);return t.skipAllowed&&n&&o?o0.hands:new Promise(async a=>{let i=3*(t.hand.skipTime||0)>R()-u5,c=Y2<3*(t.hand.skipFrames||0);t.skipAllowed&&o0.hands.length===t.hand.maxDetected?o0.hands=await Promise.all(o0.boxes.map(y=>h5(e,y,t))):t.skipAllowed&&i&&c&&o0.hands.length>0?o0.hands=await Promise.all(o0.boxes.map(y=>h5(e,y,t))):(o0.boxes=await Us(e,t),u5=R(),o0.hands=await Promise.all(o0.boxes.map(y=>h5(e,y,t))),Y2=0);let d=[...o0.boxes];if(o0.boxes.length=0,t.cacheSensitivity>0)for(let y=0;y.05&&l.box[3]/(e.shape[1]||1)>.05&&o0.hands[y].fingerScore&&o0.hands[y].fingerScore>(t.hand.minConfidence||0)){let f=k2(l.box,mn),x=k2(l.boxRaw,mn);o0.boxes.push({...d[y],box:f,boxRaw:x})}}for(let y=0;y({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var s2={};oe(s2,{connected:()=>J2,horizontal:()=>g5,kpt:()=>K2,relative:()=>v5,vertical:()=>T5});var K2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],g5=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],T5=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],v5=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],J2={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var j=te(),R5=0;function gn(e,t){var a,i,c,d,y,l,f,x,p,m,h,T,v,u,g,E,k,N,C,V,D,Z,J,q,U,m0;let n=R();if(!e)return te();let o=Date.now()-e.timestamp,s=o<1e3?8-Math.log(o+1):1;if(e.canvas&&(j.canvas=e.canvas),e.error&&(j.error=e.error),!j.body||e.body.length!==j.body.length)j.body=JSON.parse(JSON.stringify(e.body));else for(let P=0;P((s-1)*j.body[P].box[F]+W)/s),g0=e.body[P].boxRaw.map((W,F)=>((s-1)*j.body[P].boxRaw[F]+W)/s),e0=e.body[P].keypoints.map((W,F)=>{var w0,t0,ne,Ke,Oe,H5,G5,V5,Z5;return{score:W.score,part:W.part,position:[j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].position[0]||0)+(W.position[0]||0))/s:W.position[0],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].position[1]||0)+(W.position[1]||0))/s:W.position[1],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].position[2]||0)+(W.position[2]||0))/s:W.position[2]],positionRaw:[j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].positionRaw[0]||0)+(W.positionRaw[0]||0))/s:W.positionRaw[0],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].positionRaw[1]||0)+(W.positionRaw[1]||0))/s:W.positionRaw[1],j.body[P].keypoints[F]?((s-1)*(j.body[P].keypoints[F].positionRaw[2]||0)+(W.positionRaw[2]||0))/s:W.positionRaw[2]],distance:[j.body[P].keypoints[F]?((s-1)*(((w0=j.body[P].keypoints[F].distance)==null?void 0:w0[0])||0)+(((t0=W.distance)==null?void 0:t0[0])||0))/s:(ne=W.distance)==null?void 0:ne[0],j.body[P].keypoints[F]?((s-1)*(((Ke=j.body[P].keypoints[F].distance)==null?void 0:Ke[1])||0)+(((Oe=W.distance)==null?void 0:Oe[1])||0))/s:(H5=W.distance)==null?void 0:H5[1],j.body[P].keypoints[F]?((s-1)*(((G5=j.body[P].keypoints[F].distance)==null?void 0:G5[2])||0)+(((V5=W.distance)==null?void 0:V5[2])||0))/s:(Z5=W.distance)==null?void 0:Z5[2]]}}),G={},S={connected:{}};(a=t.body.modelPath)!=null&&a.includes("efficientpose")?S=z2:(i=t.body.modelPath)!=null&&i.includes("blazepose")?S=M2:(c=t.body.modelPath)!=null&&c.includes("movenet")&&(S=s2);for(let[W,F]of Object.entries(S.connected)){let w0=[];for(let t0=0;t0Oe.part===F[t0]),Ke=e0.find(Oe=>Oe.part===F[t0+1]);ne&&Ke&&w0.push([ne.position,Ke.position])}G[W]=w0}j.body[P]={...e.body[P],box:i0,boxRaw:g0,keypoints:e0,annotations:G}}if(!j.hand||e.hand.length!==j.hand.length)j.hand=JSON.parse(JSON.stringify(e.hand));else for(let P=0;P((s-1)*j.hand[P].box[W]+S)/s),g0=e.hand[P].boxRaw.map((S,W)=>((s-1)*j.hand[P].boxRaw[W]+S)/s);j.hand[P].keypoints.length!==e.hand[P].keypoints.length&&(j.hand[P].keypoints=e.hand[P].keypoints);let e0=e.hand[P].keypoints&&e.hand[P].keypoints.length>0?e.hand[P].keypoints.map((S,W)=>S.map((F,w0)=>((s-1)*(j.hand[P].keypoints[W][w0]||1)+(F||0))/s)):[],G={};if(Object.keys(j.hand[P].annotations).length!==Object.keys(e.hand[P].annotations).length)j.hand[P].annotations=e.hand[P].annotations,G=j.hand[P].annotations;else if(e.hand[P].annotations)for(let S of Object.keys(e.hand[P].annotations))G[S]=(l=(y=(d=e.hand[P])==null?void 0:d.annotations)==null?void 0:y[S])!=null&&l[0]?e.hand[P].annotations[S].map((W,F)=>W.map((w0,t0)=>((s-1)*j.hand[P].annotations[S][F][t0]+w0)/s)):null;j.hand[P]={...e.hand[P],box:i0,boxRaw:g0,keypoints:e0,annotations:G}}if(!j.face||e.face.length!==j.face.length)j.face=JSON.parse(JSON.stringify(e.face));else for(let P=0;P((s-1)*j.face[P].box[S]+G)/s),g0=e.face[P].boxRaw.map((G,S)=>((s-1)*j.face[P].boxRaw[S]+G)/s),e0=e.face[P].annotations;if(Object.keys(j.face[P].annotations).length!==Object.keys(e.face[P].annotations).length)j.face[P].annotations=e.face[P].annotations,e0=j.face[P].annotations;else if(e.face[P].annotations)for(let G of Object.keys(e.face[P].annotations))e0[G]=(p=(x=(f=e.face[P])==null?void 0:f.annotations)==null?void 0:x[G])!=null&&p[0]?e.face[P].annotations[G].map((S,W)=>S.map((F,w0)=>((s-1)*j.face[P].annotations[G][W][w0]+F)/s)):null;if(e.face[P].rotation){let G={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};G.matrix=(m=e.face[P].rotation)==null?void 0:m.matrix,G.angle={roll:((s-1)*(((T=(h=j.face[P].rotation)==null?void 0:h.angle)==null?void 0:T.roll)||0)+(((u=(v=e.face[P].rotation)==null?void 0:v.angle)==null?void 0:u.roll)||0))/s,yaw:((s-1)*(((E=(g=j.face[P].rotation)==null?void 0:g.angle)==null?void 0:E.yaw)||0)+(((N=(k=e.face[P].rotation)==null?void 0:k.angle)==null?void 0:N.yaw)||0))/s,pitch:((s-1)*(((V=(C=j.face[P].rotation)==null?void 0:C.angle)==null?void 0:V.pitch)||0)+(((Z=(D=e.face[P].rotation)==null?void 0:D.angle)==null?void 0:Z.pitch)||0))/s},G.gaze={bearing:((s-1)*(((J=j.face[P].rotation)==null?void 0:J.gaze.bearing)||0)+(((q=e.face[P].rotation)==null?void 0:q.gaze.bearing)||0))/s,strength:((s-1)*(((U=j.face[P].rotation)==null?void 0:U.gaze.strength)||0)+(((m0=e.face[P].rotation)==null?void 0:m0.gaze.strength)||0))/s},j.face[P]={...e.face[P],rotation:G,box:i0,boxRaw:g0,annotations:e0}}else j.face[P]={...e.face[P],box:i0,boxRaw:g0,annotations:e0}}if(!j.object||e.object.length!==j.object.length)j.object=JSON.parse(JSON.stringify(e.object));else for(let P=0;P((s-1)*j.object[P].box[G]+e0)/s),g0=e.object[P].boxRaw.map((e0,G)=>((s-1)*j.object[P].boxRaw[G]+e0)/s);j.object[P]={...e.object[P],box:i0,boxRaw:g0}}if(e.persons){let P=e.persons;if(!j.persons||P.length!==j.persons.length)j.persons=JSON.parse(JSON.stringify(P));else for(let i0=0;i0((s-1)*j.persons[i0].box[e0]+g0)/s)}e.gesture&&(j.gesture=e.gesture),j.width=e.width,j.height=e.height;let A=R();return R5=M.perfadd?R5+Math.round(A-n):Math.round(A-n),e.performance&&(j.performance={...e.performance,interpolate:R5}),j}var h0;async function M5(e){return!h0||M.initial?h0=await L(e.segmentation.modelPath):e.debug&&b("cached model:",h0.modelUrl),h0}async function Tn(e,t){var s;if(h0||(h0=await M5(t)),!(h0!=null&&h0.executor)||!((s=h0==null?void 0:h0.inputs)!=null&&s[0].shape))return null;let n={};n.resize=r.image.resizeBilinear(e,[h0.inputs[0].shape?h0.inputs[0].shape[1]:0,h0.inputs[0].shape?h0.inputs[0].shape[2]:0],!1),n.norm=r.div(n.resize,O.tf255),n.res=h0.execute(n.norm),n.squeeze=r.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=r.unstack(n.squeeze,2),n.fg=r.softmax(n.fgRaw),n.mul=r.mul(n.fg,O.tf255),n.expand=r.expandDims(n.mul,2),n.output=r.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let o;switch(t.segmentation.mode||"default"){case"default":n.input=r.squeeze(e),n.concat=r.concat([n.input,n.output],-1),o=r.cast(n.concat,"int32");break;case"alpha":o=r.cast(n.output,"int32");break;default:o=r.tensor(0)}return Object.keys(n).forEach(A=>r.dispose(n[A])),o}var k5={};oe(k5,{distance:()=>P5,find:()=>Js,similarity:()=>Ks});function P5(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let o=0;for(let s=0;s{if(e===0)return 1;let A=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(o-n);return Math.max(Math.min(A,1),0)};function Ks(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let o=P5(e,t,n);return Rn(o,n.order||2,n.min||0,n.max||1)}function Js(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let o=Number.MAX_SAFE_INTEGER,s=-1;for(let a=0;ai2,validateModel:()=>ot});var Mn=.005,I0={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function w5(e){for(let t of g5){let n=e.keypoints.findIndex(s=>s.part===t[0]),o=e.keypoints.findIndex(s=>s.part===t[1]);if(e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[0]s&&s.part===t[0]),o=e.keypoints.findIndex(s=>s&&s.part===t[1]);e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[1]d&&d.part===t[0]),s=e.keypoints.findIndex(d=>d&&d.part===t[1]),A=e.keypoints.findIndex(d=>d&&d.part===n[0]),a=e.keypoints.findIndex(d=>d&&d.part===n[1]);if(!e.keypoints[A]||!e.keypoints[a])continue;let i=e.keypoints[o]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[o].position[0]),Math.abs(e.keypoints[a].position[0]-e.keypoints[o].position[0])]:[0,0],c=e.keypoints[s]?[Math.abs(e.keypoints[a].position[0]-e.keypoints[s].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[s].position[0])]:[0,0];if(i[0]>i[1]||c[0]>c[1]){let d=e.keypoints[o];e.keypoints[o]=e.keypoints[s],e.keypoints[s]=d}}}function Pn(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=r.pad(e,I0.padding),n.resize=r.image.resizeBilinear(n.pad,[t,t]);let o=r.cast(n.resize,"int32");return Object.keys(n).forEach(a=>r.dispose(n[a])),o}function wn(e,t){e.keypoints=e.keypoints.filter(o=>o==null?void 0:o.position);for(let o of e.keypoints)o.position=[o.position[0]*(t[0]+I0.padding[2][0]+I0.padding[2][1])/t[0]-I0.padding[2][0],o.position[1]*(t[1]+I0.padding[1][0]+I0.padding[1][1])/t[1]-I0.padding[1][0]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1]];let n=ae(e.keypoints.map(o=>o.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var A0,Q2=0,E5=Number.MAX_SAFE_INTEGER,Le={boxes:[],bodies:[],last:0};async function En(e){var t;return M.initial&&(A0=null),A0?e.debug&&b("cached model:",A0.modelUrl):(h2(["size"],e),A0=await L(e.body.modelPath)),Q2=A0!=null&&A0.executor&&((t=A0==null?void 0:A0.inputs)!=null&&t[0].shape)?A0.inputs[0].shape[2]:0,Q2<64&&(Q2=256),r.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&r.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),A0}function _s(e,t,n){let o=e[0][0],s=[],A=0;for(let y=0;yt.body.minConfidence){let l=[o[y][1],o[y][0]];s.push({score:Math.round(100*A)/100,part:K2[y],positionRaw:l,position:[Math.round((n.shape[2]||0)*l[0]),Math.round((n.shape[1]||0)*l[1])]})}A=s.reduce((y,l)=>l.score>y?l.score:y,0);let a=[],i=ae(s.map(y=>y.position),[n.shape[2],n.shape[1]]),c={};for(let[y,l]of Object.entries(J2)){let f=[];for(let x=0;xh.part===l[x]),m=s.find(h=>h.part===l[x+1]);p&&m&&p.score>(t.body.minConfidence||0)&&m.score>(t.body.minConfidence||0)&&f.push([p.position,m.position])}c[y]=f}let d={id:0,score:A,box:i.box,boxRaw:i.boxRaw,keypoints:s,annotations:c};return w5(d),a.push(d),a}function $s(e,t,n){let o=[];for(let s=0;st.body.minConfidence){let i=[];for(let f=0;f<17;f++){let x=A[3*f+2];if(x>t.body.minConfidence){let p=[A[3*f+1],A[3*f+0]];i.push({part:K2[f],score:Math.round(100*x)/100,positionRaw:p,position:[Math.round((n.shape[2]||0)*p[0]),Math.round((n.shape[1]||0)*p[1])]})}}let c=[A[52],A[51],A[54]-A[52],A[53]-A[51]],d=[Math.trunc(c[0]*(n.shape[2]||0)),Math.trunc(c[1]*(n.shape[1]||0)),Math.trunc(c[2]*(n.shape[2]||0)),Math.trunc(c[3]*(n.shape[1]||0))],y={};for(let[f,x]of Object.entries(J2)){let p=[];for(let m=0;mv.part===x[m]),T=i.find(v=>v.part===x[m+1]);h&&T&&h.score>(t.body.minConfidence||0)&&T.score>(t.body.minConfidence||0)&&p.push([h.position,T.position])}y[f]=p}let l={id:s,score:a,box:d,boxRaw:c,keypoints:[...i],annotations:y};w5(l),o.push(l)}}return o.sort((s,A)=>A.score-s.score),o.length>t.body.maxDetected&&(o.length=t.body.maxDetected),o}async function z5(e,t){var s;if(!(A0!=null&&A0.executor)||!((s=A0==null?void 0:A0.inputs)!=null&&s[0].shape))return[];t.skipAllowed||(Le.boxes.length=0),E5++;let n=(t.body.skipTime||0)>R()-Le.last,o=E5<(t.body.skipFrames||0);return t.skipAllowed&&n&&o?Le.bodies:new Promise(async A=>{let a={};E5=0,a.input=kn(e,Q2),a.res=A0==null?void 0:A0.execute(a.input),Le.last=R();let i=await a.res.array();Le.bodies=a.res.shape[2]===17?_s(i,t,e):$s(i,t,e);for(let c of Le.bodies)wn(c,[e.shape[2]||1,e.shape[1]||1]),Pn(c.keypoints);Object.keys(a).forEach(c=>r.dispose(a[c])),A(Le.bodies)})}var H0,_2=[],Sn=0,S5=Number.MAX_SAFE_INTEGER,et=0,$2=2.5;async function jn(e){if(!H0||M.initial){H0=await L(e.object.modelPath);let t=H0!=null&&H0.executor?Object.values(H0.modelSignature.inputs):void 0;et=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&b("cached model:",H0.modelUrl);return H0}async function eA(e,t,n){var d,y;let o=0,s=[],A=et;for(let l of[1,2,4]){let f=l*13,x=r.squeeze(e.find(u=>u.shape[1]===f**2&&(u.shape[2]||0)===De.length)),p=await x.array(),m=r.squeeze(e.find(u=>u.shape[1]===f**2&&(u.shape[2]||0)(n.object.minConfidence||0)&&g!==61){let k=(.5+Math.trunc(u%f))/f,N=(.5+Math.trunc(u/f))/f,C=v[u].map(P=>P*(f/l/A)),[V,D]=[k-$2/l*C[0],N-$2/l*C[1]],[Z,J]=[k+$2/l*C[2]-V,N+$2/l*C[3]-D],q=[V,D,Z,J];q=q.map(P=>Math.max(0,Math.min(P,1)));let U=[q[0]*t[0],q[1]*t[1],q[2]*t[0],q[3]*t[1]],m0={id:o++,score:Math.round(100*E)/100,class:g+1,label:De[g].label,box:U.map(P=>Math.trunc(P)),boxRaw:q};s.push(m0)}}r.dispose([x,m,h,T])}let a=s.map(l=>[l.boxRaw[1],l.boxRaw[0],l.boxRaw[3],l.boxRaw[2]]),i=s.map(l=>l.score),c=[];if(a&&a.length>0){let l=await r.image.nonMaxSuppressionAsync(a,i,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);c=Array.from(await l.data()),r.dispose(l)}return s=s.filter((l,f)=>c.includes(f)).sort((l,f)=>f.score-l.score),s}async function j5(e,t){if(!(H0!=null&&H0.executor))return[];let n=(t.object.skipTime||0)>R()-Sn,o=S5<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&_2.length>0?(S5++,_2):(S5=0,!M.kernels.includes("mod")||!M.kernels.includes("sparsetodense")?_2:new Promise(async s=>{let A=[e.shape[2]||0,e.shape[1]||0],a=r.image.resizeBilinear(e,[et,et],!1),i=r.div(a,O.tf255),c=r.transpose(i,[0,3,1,2]),d;t.object.enabled&&(d=H0.execute(c)),Sn=R();let y=await eA(d,A,t);_2=y,r.dispose([a,i,c,...d]),s(y)}))}var a2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],tA=a2.length,A2=a2.reduce((e,t,n)=>(e[t]=n,e),{}),nA=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],Ji=nA.map(([e,t])=>[A2[e],A2[t]]),Nn=[["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 Ln(e){let t=e.reduce(({maxX:n,maxY:o,minX:s,minY:A},{position:{x:a,y:i}})=>({maxX:Math.max(n,a),maxY:Math.max(o,i),minX:Math.min(s,a),minY:Math.min(A,i)}),{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 On(e,[t,n],[o,s]){let A=t/o,a=n/s,i=(d,y)=>({id:y,score:d.score,boxRaw:[d.box[0]/s,d.box[1]/o,d.box[2]/s,d.box[3]/o],box:[Math.trunc(d.box[0]*a),Math.trunc(d.box[1]*A),Math.trunc(d.box[2]*a),Math.trunc(d.box[3]*A)],keypoints:d.keypoints.map(({score:l,part:f,position:x})=>({score:l,part:f,position:[Math.trunc(x.x*a),Math.trunc(x.y*A)],positionRaw:[x.x/o,x.y/o]})),annotations:{}});return e.map((d,y)=>i(d,y))}var tt=class{constructor(t,n){z(this,"priorityQueue");z(this,"numberOfElements");z(this,"getElementValue");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 Cn(e,t,n,o){let s=n-e,A=o-t;return s*s+A*A}function O5(e,t){return{x:e.x+t.x,y:e.y+t.y}}var N0,rA=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],nt=1,Ue=16,sA=50**2;function Wn(e,t,n,o,s,A,a=2){let i=T=>({y:A.get(T.y,T.x,e),x:A.get(T.y,T.x,A.shape[2]/2+e)}),c=(T,v,u)=>({y:L5(Math.round(T.y/Ue),0,v-1),x:L5(Math.round(T.x/Ue),0,u-1)}),[d,y]=o.shape,l=c(t.position,d,y),f=i(l),p=O5(t.position,f);for(let T=0;T[A2[f],A2[x]]),a=A.map(([,f])=>f),i=A.map(([f])=>f),c=t.shape[2],d=a.length,y=new Array(c),l=N5(e.part,Ue,n);y[e.part.id]={score:e.score,part:a2[e.part.id],position:l};for(let f=d-1;f>=0;--f){let x=a[f],p=i[f];y[x]&&!y[p]&&(y[p]=Wn(f,y[x],p,t,n,s))}for(let f=0;ft){i=!1;break}if(!i)break}return i}function iA(e,t){let[n,o,s]=t.shape,A=new tt(n*o*s,({score:a})=>a);for(let a=0;a{var a;let A=(a=s[o])==null?void 0:a.position;return A?Cn(n,t,A.y,A.x)<=sA:!1})}function lA(e,t){return t.reduce((o,{position:s,score:A},a)=>(Dn(e,s,a)||(o+=A),o),0)/t.length}function cA(e,t,n,o,s,A){let a=[],i=iA(A,t);for(;a.lengthx.score>A);let l=lA(a,y),f=Ln(y);l>A&&a.push({keypoints:y,box:f,score:Math.round(100*l)/100})}return a}async function C5(e,t){if(!(N0!=null&&N0.executor))return[];let n=r.tidy(()=>{if(!N0.inputs[0].shape)return[];let a=r.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]]),i=r.sub(r.div(r.cast(a,"float32"),127.5),1),d=N0.execute(i,rA).map(y=>r.squeeze(y,[0]));return d[1]=r.sigmoid(d[1]),d}),o=await Promise.all(n.map(a=>a.buffer()));for(let a of n)r.dispose(a);let s=cA(o[0],o[1],o[2],o[3],t.body.maxDetected,t.body.minConfidence);return N0.inputs[0].shape?On(s,[e.shape[1],e.shape[2]],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]]):[]}async function Fn(e){return!N0||M.initial?N0=await L(e.body.modelPath):e.debug&&b("cached model:",N0.modelUrl),N0}var J0,dA=["fgr","pha","r1o","r2o","r3o","r4o"],a0={},D5=0;function Gn(e){r.dispose([a0.r1i,a0.r2i,a0.r3i,a0.r4i,a0.downsample_ratio]),a0.r1i=r.tensor(0),a0.r2i=r.tensor(0),a0.r3i=r.tensor(0),a0.r4i=r.tensor(0),D5=e.segmentation.ratio||.5,a0.downsample_ratio=r.tensor(D5)}async function F5(e){return!J0||M.initial?J0=await L(e.segmentation.modelPath):e.debug&&b("cached model:",J0.modelUrl),Gn(e),J0}var Hn=e=>r.tidy(()=>{let t=r.squeeze(e,[0]),n=r.mul(t,O.tf255);return r.cast(n,"int32")});function W5(e,t){let n=e?Hn(e):r.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),o=t?Hn(t):r.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),s=r.concat([n,o],-1);return r.dispose([n,o]),s}function xA(e){return r.tidy(()=>{let t={};return t.unstack=r.unstack(e,-1),t.concat=r.concat(t.unstack,1),t.split=r.split(t.concat,4,1),t.stack=r.concat(t.split,2),t.squeeze=r.squeeze(t.stack,[0]),t.expand=r.expandDims(t.squeeze,-1),t.add=r.add(t.expand,1),t.mul=r.mul(t.add,127.5),t.cast=r.cast(t.mul,"int32"),t.tile=r.tile(t.cast,[1,1,3]),t.alpha=r.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),r.concat([t.tile,t.alpha],-1)})}async function Vn(e,t){if(J0||(J0=await F5(t)),!(J0!=null&&J0.executor))return null;a0.src=r.div(e,255),D5!==t.segmentation.ratio&&Gn(t);let[n,o,s,A,a,i]=await J0.executeAsync(a0,dA),c;switch(t.segmentation.mode||"default"){case"default":c=W5(n,o);break;case"alpha":c=W5(null,o);break;case"foreground":c=W5(n,null);break;case"state":c=xA(s);break;default:c=r.tensor(0)}return r.dispose([a0.src,n,o,a0.r1i,a0.r2i,a0.r3i,a0.r4i]),[a0.r1i,a0.r2i,a0.r3i,a0.r4i]=[s,A,a,i],c}var b0;async function B5(e){return!b0||M.initial?b0=await L(e.segmentation.modelPath):e.debug&&b("cached model:",b0.modelUrl),b0}async function Xn(e,t){var s;if(b0||(b0=await B5(t)),!(b0!=null&&b0.executor)||!((s=b0==null?void 0:b0.inputs)!=null&&s[0].shape))return null;let n={};n.resize=r.image.resizeBilinear(e,[b0.inputs[0].shape?b0.inputs[0].shape[1]:0,b0.inputs[0].shape?b0.inputs[0].shape[2]:0],!1),n.norm=r.div(n.resize,O.tf255),n.res=b0.execute(n.norm),n.squeeze=r.squeeze(n.res,[0]),n.alpha=r.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=r.mul(n.alpha,O.tf255);let o;switch(t.segmentation.mode||"default"){case"default":n.input=r.squeeze(e),n.concat=r.concat([n.input,n.mul],-1),o=r.cast(n.concat,"int32");break;case"alpha":o=r.cast(n.mul,"int32");break;default:o=r.tensor(0)}return Object.keys(n).forEach(A=>r.dispose(n[A])),o}function ot(e,t,n){var d,y;if(!t||!((d=e==null?void 0:e.config)!=null&&d.validateModels))return null;let o=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],s=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],A=[],a=[],i=t.modelUrl,c=t.executor;if((y=c==null?void 0:c.graph)!=null&&y.nodes)for(let l of Object.values(c.graph.nodes)){let f=l.op.toLowerCase();A.includes(f)||A.push(f)}else!c&&e.config.debug&&b("model not loaded",n);for(let l of A)!o.includes(l)&&!s.includes(l)&&!e.env.kernels.includes(l)&&!e.env.kernels.includes(l.replace("_",""))&&!e.env.kernels.includes(l.replace("native",""))&&!e.env.kernels.includes(l.replace("v2",""))&&a.push(l);return e.config.debug&&a.length>0&&b("model validation failed:",n,a),a.length>0?{name:n,missing:a,ops:A,url:i}:null}var i2=class{constructor(t){z(this,"instance");z(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,o=0;for(let A of Object.values(p0))t+=A.sizeFromManifest,n+=A.sizeLoadedWeights,o+=A.sizeDesired;let s=o>0?n/o:0;return{numLoadedModels:Object.values(p0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:s,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:o,modelStats:Object.values(p0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var o,s,A,a,i,c,d,y,l,f,x,p,m,h,T,v,u,g,E,k,N,C,V,D,Z,J,q;M.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?F1(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((o=this.instance.config.face.antispoof)!=null&&o.enabled)&&!this.models.antispoof?c3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((s=this.instance.config.face.liveness)!=null&&s.enabled)&&!this.models.liveness?f3(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((A=this.instance.config.face.description)!=null&&A.enabled)&&!this.models.faceres?s3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((a=this.instance.config.face.emotion)!=null&&a.enabled)&&!this.models.emotion?t3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((i=this.instance.config.face.iris)!=null&&i.enabled)&&!((c=this.instance.config.face.attention)!=null&&c.enabled)&&!this.models.iris?X1(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((d=this.instance.config.face.mesh)!=null&&d.enabled)&&!this.models.facemesh?J1(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((y=this.instance.config.face.gear)!=null&&y.enabled)&&!this.models.gear?h3(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((l=this.instance.config.face.ssrnet)!=null&&l.enabled)&&!this.models.ssrnetage?v3(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((f=this.instance.config.face.ssrnet)!=null&&f.enabled)&&!this.models.ssrnetgender?k3(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((x=this.instance.config.face.mobilefacenet)!=null&&x.enabled)&&!this.models.mobilefacenet?j3(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((p=this.instance.config.face.insightface)!=null&&p.enabled)&&!this.models.insightface?C3(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((m=this.instance.config.body.modelPath)!=null&&m.includes("blazepose"))?g1(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?b1(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((h=this.instance.config.body.modelPath)!=null&&h.includes("efficientpose"))?k1(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("movenet"))?En(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((v=this.instance.config.body.modelPath)!=null&&v.includes("posenet"))?Fn(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((g=(u=this.instance.config.hand.detector)==null?void 0:u.modelPath)!=null&&g.includes("handtrack"))?un(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((k=(E=this.instance.config.hand.detector)==null?void 0:E.modelPath)!=null&&k.includes("handtrack"))?hn(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((C=(N=this.instance.config.hand.detector)==null?void 0:N.modelPath)!=null&&C.includes("handdetect"))&&(n.handdetect=dn(this.instance.config),n.handskeleton=xn(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((V=this.instance.config.object.modelPath)!=null&&V.includes("centernet"))?R1(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((D=this.instance.config.object.modelPath)!=null&&D.includes("nanodet"))?jn(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&((Z=this.instance.config.segmentation.modelPath)!=null&&Z.includes("selfie"))?B5(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((J=this.instance.config.segmentation.modelPath)!=null&&J.includes("meet"))?M5(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((q=this.instance.config.segmentation.modelPath)!=null&&q.includes("rvm"))?F5(this.instance.config):null;for(let[U,m0]of Object.entries(n))m0!=null&&m0.then&&m0.then(P=>this.models[U]=P);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var o;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(o=this.models[n])==null?void 0:o.modelUrl:null}});for(let n of t){let o=Object.keys(p0).find(s=>s.startsWith(n.name));o&&(n.size=p0[o].sizeLoadedWeights,n.url=p0[o].url)}return t}loaded(){return this.list().filter(o=>o.loaded).map(o=>o.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let o=this.models[n];if(!o)continue;let s=ot(this.instance,o,n);s&&t.push(s)}return t}};function Yn(e,t,n,o,s){var i,c,d,y,l,f;let A=0,a=[];for(let x of e){let p={id:A++,face:x,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let g of t)x.box[0]>g.box[0]&&x.box[0]g.box[1]&&x.box[1]+x.box[3]p.body.box[0]&&g.box[0]+g.box[2]p.body.box[1]&&g.box[1]+g.box[3]p.body.box[0]&&g.box[1]+g.box[3]>p.body.box[1]&&g.box[1]+g.box[3]{g&&g.length===4&&(m.push(g[0],g[0]+g[2]),h.push(g[1],g[1]+g[3]))};T(p.face.box),T((y=p.body)==null?void 0:y.box),T((l=p.hands.left)==null?void 0:l.box),T((f=p.hands.right)==null?void 0:f.box);let v=Math.min(...m),u=Math.min(...h);p.box=[v,u,Math.max(...m)-v,Math.max(...h)-u],s!=null&&s[1]&&(s!=null&&s[2])&&(p.boxRaw=[p.box[0]/s[2],p.box[1]/s[1],p.box[2]/s[2],p.box[3]/s[1]]),a.push(p)}return a}var rt=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -837,4 +837,4 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;async function uA(e){let t=(s,A="application/octet-stream")=>fetch(`data:${A};base64,${s}`).then(a=>a.blob()),n,r;switch(e.config.warmup){case"face":n=await t(rt);break;case"body":case"full":n=await t(st);break;default:n=null}if(n){let s=await createImageBitmap(n);r=await e.detect(s,e.config),s.close()}return r}async function hA(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+rt;break;case"full":case"body":n="data:image/jpeg;base64,"+st;break;default:n=""}let r;if(typeof Image!="undefined")r=new Image;else if(M.Image)r=new M.Image;else{t(void 0);return}r.onload=async()=>{let s=D0(r.naturalWidth,r.naturalHeight);if(!s)b("Warmup: Canvas not found"),t(void 0);else{let A=s.getContext("2d");A&&A.drawImage(r,0,0);let a=await e.image(s,!0),i=a.tensor?await e.detect(a.tensor,e.config):void 0;t(i)}},n?r.src=n:t(void 0)})}async function bA(e){let t=s=>Buffer.from(s,"base64"),n;e.config.warmup==="face"?n=t(rt):n=t(st);let r;if("node"in o&&o.getBackend()==="tensorflow"){let s=it.decodeJpeg(n),A=o.expandDims(s,0);e.tf.dispose(s),r=await e.detect(A,e.config),e.tf.dispose(A)}else e.config.debug&&b("Warmup tfjs-node not loaded");return r}async function gA(e){let t;return typeof createImageBitmap=="function"?t=await uA(e):typeof Image!="undefined"||M.Canvas!==void 0?t=await hA(e):t=await bA(e),t}async function TA(e){var i,c,d,y;if(!o.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=o.getBackend(),n=o.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;o.env().set("ENGINE_COMPILE_ONLY",!0);let r=o.engine().state.numTensors,s=[];for(let[l,m]of Object.entries(e.models.models)){if(!m)continue;let x=m!=null&&m.modelSignature&&((c=(i=m==null?void 0:m.inputs)==null?void 0:i[0])!=null&&c.shape)?[...m.inputs[0].shape]:[1,64,64,3],p=m!=null&&m.modelSignature&&((y=(d=m==null?void 0:m.inputs)==null?void 0:d[0])!=null&&y.dtype)?m.inputs[0].dtype:"float32";for(let h=0;ho.dispose(v)):o.dispose(h)}catch(h){e.config.debug&&b("compile fail model:",l)}o.dispose(f)}let A=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&b("compile pass:",{models:s,kernels:A.length}),o.env().set("ENGINE_COMPILE_ONLY",!1);let a=o.engine().state.numTensors;a-r>0&&b("tensor leak:",a-r)}async function Kn(e,t){await e2(e,!1);let n=R();return e.state="warmup",t&&(e.config=Q(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?te():new Promise(async r=>{await e.models.load(),await TA(e);let s=await gA(e),A=R();e.config.debug&&b("warmup",e.config.warmup,Math.round(A-n),"ms"),e.emit("warmup"),r(s)})}var Ye,l2,c2,At,be,Jn=class{constructor(t){z(this,"version");z(this,"config");z(this,"result");z(this,"state");z(this,"process");z(this,"tf");z(this,"env",M);z(this,"draw",vt);z(this,"match",k5);z(this,"models");z(this,"events");z(this,"faceTriangulation");z(this,"faceUVMap");z(this,"performance");q0(this,Ye,void 0);q0(this,l2,void 0);q0(this,c2,void 0);z(this,"analyze",(...t)=>{if(!E0(this,l2))return;let n=this.tf.engine().state.numTensors,r=E0(this,Ye);Q0(this,Ye,n);let s=n-r;s!==0&&b(...t,s)});q0(this,At,t=>{if(!E0(this,c2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof o.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});z(this,"webcam",new u2);z(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});q0(this,be,{});let n=(Je.tfjs||o.version_core).replace(/-(.*)/,"");Ce.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ce.modelBasePath=M.browser?"../models/":"file://models/",this.version=ft,Object.defineProperty(this,"version",{value:ft}),this.config=JSON.parse(JSON.stringify(Ce)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=Q(this.config,t)),r1(this.config),this.tf=o,this.state="idle",Q0(this,Ye,0),Q0(this,l2,!1),Q0(this,c2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new i2(this),Tt(),this.result=te(),this.process={tensor:null,canvas:null},this.faceTriangulation=Q1,this.faceUVMap=_1,ot(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&b(`version: ${this.version}`),this.config.debug&&b(`tfjs version: ${this.tf.version["tfjs-core"]}`);let r=JSON.parse(JSON.stringify(this.env));delete r.kernels,delete r.initial,delete r.perfadd,this.config.debug&&b("environment:",r)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ce)),this.config.backend=t,xt(),M.initial=!0}validate(t){let n=lt(Ce,t||this.config);return n.length===0&&(this.config=Q(this.config,t)),n}now(){return R()}image(t,n=!1){return f2(t,this.config,n)}async segmentation(t,n){var A,a,i;if(n&&(this.config=Q(this.config,n)),!this.config.segmentation.enabled)return null;let r=await f2(t,this.config);if(!r.tensor)return null;let s=null;return(A=this.config.segmentation.modelPath)!=null&&A.includes("rvm")&&(s=await Vn(r.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("meet")&&(s=await Tn(r.tensor,this.config)),(i=this.config.segmentation.modelPath)!=null&&i.includes("selfie")&&(s=await Xn(r.tensor,this.config)),o.dispose(r.tensor),s}compare(t,n){return o1(this.config,t,n)}async init(){await e2(this,!0),await this.tf.ready(),xt()}async load(t){this.state="load";let n=R(),r=Object.values(this.models.models).filter(a=>a).length;t&&(this.config=Q(this.config,t)),this.env.initial&&(await e2(this,!1)||b("error: backend check failed"),await o.ready(),this.env.browser&&(this.config.debug&&b("configuration:",this.config),this.config.debug&&b("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&b("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(a=>a).length!==r&&(this.models.validate(),this.emit("load"));let A=Math.trunc(R()-n);A>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+A:A)}next(t=this.result){return gn(t,this.config)}async warmup(t){let n=R(),r=await Kn(this,t),s=R();return this.performance.warmup=Math.trunc(s-n),r}async profile(t,n){let r=await this.tf.profile(()=>this.detect(t,n)),s={},A=0;for(let i of r.kernels){let c=Number(i.kernelTimeMs)||0;s[i.name]?s[i.name]+=c:s[i.name]=c,A+=c}let a=[];Object.entries(s).forEach(i=>a.push({kernel:i[0],time:i[1],perc:0}));for(let i of a)i.perc=Math.round(1e3*i.time/A)/1e3,i.time=Math.round(1e3*i.time)/1e3;return a.sort((i,c)=>c.time-i.time),a.length=20,a}async detect(t,n){return this.state="detect",new Promise(async r=>{var h,v,T,u,g,E,k,N,W,V,D,Z,J,q,U,m0,P,i0,g0,e0,G;this.state="config";let s;this.config=Q(this.config,n),this.state="check";let A=E0(this,At).call(this,t);A&&(b(A,t),this.emit("error"),r(te(A)));let a=R();await this.load(),s=R(),this.state="image";let i=await f2(t,this.config);if(this.process=i,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(R()-s):Math.trunc(R()-s),this.analyze("Get Image:"),!i.tensor){this.config.debug&&b("could not convert input to tensor"),this.emit("error"),r(te("could not convert input to tensor"));return}this.emit("image"),s=R(),this.config.skipAllowed=await n1(this.config,i.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(R()-s):Math.trunc(R()-s),this.analyze("Check Changed:");let c=[],d=[],y=[],l=[];this.state="detect:face",this.config.async?(c=this.config.face.enabled?c5(this,i.tensor):[],this.performance.face&&delete this.performance.face):(s=R(),c=this.config.face.enabled?await c5(this,i.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(c=await c),this.analyze("Start Body:"),this.state="detect:body";let m=this.config.body.maxDetected===-1?Q(this.config,{body:{maxDetected:this.config.face.enabled?1*c.length:1}}):this.config;this.config.async?((h=this.config.body.modelPath)!=null&&h.includes("posenet")?d=this.config.body.enabled?C5(i.tensor,m):[]:(v=this.config.body.modelPath)!=null&&v.includes("blazepose")?d=this.config.body.enabled?wt(i.tensor,m):[]:(T=this.config.body.modelPath)!=null&&T.includes("efficientpose")?d=this.config.body.enabled?Lt(i.tensor,m):[]:(u=this.config.body.modelPath)!=null&&u.includes("movenet")&&(d=this.config.body.enabled?z5(i.tensor,m):[]),this.performance.body&&delete this.performance.body):(s=R(),(g=this.config.body.modelPath)!=null&&g.includes("posenet")?d=this.config.body.enabled?await C5(i.tensor,m):[]:(E=this.config.body.modelPath)!=null&&E.includes("blazepose")?d=this.config.body.enabled?await wt(i.tensor,m):[]:(k=this.config.body.modelPath)!=null&&k.includes("efficientpose")?d=this.config.body.enabled?await Lt(i.tensor,m):[]:(N=this.config.body.modelPath)!=null&&N.includes("movenet")&&(d=this.config.body.enabled?await z5(i.tensor,m):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let x=this.config.hand.maxDetected===-1?Q(this.config,{hand:{maxDetected:this.config.face.enabled?2*c.length:1}}):this.config;this.config.async?((V=(W=this.config.hand.detector)==null?void 0:W.modelPath)!=null&&V.includes("handdetect")?y=this.config.hand.enabled?p5(i.tensor,x):[]:(Z=(D=this.config.hand.detector)==null?void 0:D.modelPath)!=null&&Z.includes("handtrack")&&(y=this.config.hand.enabled?b5(i.tensor,x):[]),this.performance.hand&&delete this.performance.hand):(s=R(),(q=(J=this.config.hand.detector)==null?void 0:J.modelPath)!=null&&q.includes("handdetect")?y=this.config.hand.enabled?await p5(i.tensor,x):[]:(m0=(U=this.config.hand.detector)==null?void 0:U.modelPath)!=null&&m0.includes("handtrack")&&(y=this.config.hand.enabled?await b5(i.tensor,x):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((P=this.config.object.modelPath)!=null&&P.includes("nanodet")?l=this.config.object.enabled?j5(i.tensor,this.config):[]:(i0=this.config.object.modelPath)!=null&&i0.includes("centernet")&&(l=this.config.object.enabled?St(i.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(s=R(),(g0=this.config.object.modelPath)!=null&&g0.includes("nanodet")?l=this.config.object.enabled?await j5(i.tensor,this.config):[]:(e0=this.config.object.modelPath)!=null&&e0.includes("centernet")&&(l=this.config.object.enabled?await St(i.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([c,d,y,l]=await Promise.all([c,d,y,l])),this.state="detect:gesture";let p=[];this.config.gesture.enabled&&(s=R(),p=[...K3(c),...Y3(d),...Q3(y),...J3(c)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(R()-a):Math.trunc(R()-a);let f=((G=this.process.tensor)==null?void 0:G.shape)||[0,0,0,0];this.result={face:c,body:d,hand:y,gesture:p,object:l,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:f[2],height:f[1],get persons(){return Yn(c,d,y,p,f)}},o.dispose(i.tensor),this.emit("detect"),this.state="idle",r(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,r=0){n?(E0(this,be)[t.id]||(this.config.debug&&b("video start",t.id),E0(this,be)[t.id]=!0),!t.paused&&E0(this,be)[t.id]&&t.readyState>=2&&await this.detect(t),r>0&&await this.sleep(r),E0(this,be)[t.id]&&requestAnimationFrame(()=>this.video(t,n,r))):(this.config.debug&&b("video stop",t.id),E0(this,be)[t.id]=!1)}};Ye=new WeakMap,l2=new WeakMap,c2=new WeakMap,At=new WeakMap,be=new WeakMap;export{p2 as Env,Jn as Human,Jn as default,Ce as defaults,vt as draw,te as empty,M as env,k5 as match,Un as models}; +2Q==`;async function mA(e){let t=(s,A="application/octet-stream")=>fetch(`data:${A};base64,${s}`).then(a=>a.blob()),n,o;switch(e.config.warmup){case"face":n=await t(rt);break;case"body":case"full":n=await t(st);break;default:n=null}if(n){let s=await createImageBitmap(n);o=await e.detect(s,e.config),s.close()}return o}async function pA(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+rt;break;case"full":case"body":n="data:image/jpeg;base64,"+st;break;default:n=""}let o;if(typeof Image!="undefined")o=new Image;else if(M.Image)o=new M.Image;else{t(void 0);return}o.onload=async()=>{let s=D0(o.naturalWidth,o.naturalHeight);if(!s)b("Warmup: Canvas not found"),t(void 0);else{let A=s.getContext("2d");A&&A.drawImage(o,0,0);let a=await e.image(s,!0),i=a.tensor?await e.detect(a.tensor,e.config):void 0;t(i)}},n?o.src=n:t(void 0)})}async function uA(e){let t=s=>Buffer.from(s,"base64"),n;e.config.warmup==="face"?n=t(rt):n=t(st);let o;if("node"in r&&r.getBackend()==="tensorflow"){let s=it.decodeJpeg(n),A=r.expandDims(s,0);e.tf.dispose(s),o=await e.detect(A,e.config),e.tf.dispose(A)}else e.config.debug&&b("Warmup tfjs-node not loaded");return o}async function hA(e){let t;return typeof createImageBitmap=="function"?t=await mA(e):typeof Image!="undefined"||M.Canvas!==void 0?t=await pA(e):t=await uA(e),t}async function bA(e){var i,c,d,y;if(!r.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=r.getBackend(),n=r.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;r.env().set("ENGINE_COMPILE_ONLY",!0);let o=r.engine().state.numTensors,s=[];for(let[l,f]of Object.entries(e.models.models)){if(!f)continue;let x=f!=null&&f.modelSignature&&((c=(i=f==null?void 0:f.inputs)==null?void 0:i[0])!=null&&c.shape)?[...f.inputs[0].shape]:[1,64,64,3],p=f!=null&&f.modelSignature&&((y=(d=f==null?void 0:f.inputs)==null?void 0:d[0])!=null&&y.dtype)?f.inputs[0].dtype:"float32";for(let h=0;hr.dispose(T)):r.dispose(h)}catch(h){e.config.debug&&b("compile fail model:",l)}r.dispose(m)}let A=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&b("compile pass:",{models:s,kernels:A.length}),r.env().set("ENGINE_COMPILE_ONLY",!1);let a=r.engine().state.numTensors;a-o>0&&b("tensor leak:",a-o)}async function Kn(e,t){await e2(e,!1);let n=R();return e.state="warmup",t&&(e.config=Q(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?te():new Promise(async o=>{await e.models.load(),await bA(e);let s=await hA(e),A=R();e.config.debug&&b("warmup",e.config.warmup,Math.round(A-n),"ms"),e.emit("warmup"),o(s)})}var Ye,l2,c2,At,be,Jn=class{constructor(t){z(this,"version");z(this,"config");z(this,"result");z(this,"state");z(this,"process");z(this,"tf");z(this,"env",M);z(this,"draw",vt);z(this,"match",k5);z(this,"models");z(this,"events");z(this,"faceTriangulation");z(this,"faceUVMap");z(this,"performance");q0(this,Ye,void 0);q0(this,l2,void 0);q0(this,c2,void 0);z(this,"analyze",(...t)=>{if(!E0(this,l2))return;let n=this.tf.engine().state.numTensors,o=E0(this,Ye);Q0(this,Ye,n);let s=n-o;s!==0&&b(...t,s)});q0(this,At,t=>{if(!E0(this,c2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof r.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});z(this,"webcam",new u2);z(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});q0(this,be,{});let n=(Je.tfjs||r.version_core).replace(/-(.*)/,"");Ce.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ce.modelBasePath=M.browser?"../models/":"file://models/",this.version=ft,Object.defineProperty(this,"version",{value:ft}),this.config=JSON.parse(JSON.stringify(Ce)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=Q(this.config,t)),r1(this.config),this.tf=r,this.state="idle",Q0(this,Ye,0),Q0(this,l2,!1),Q0(this,c2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new i2(this),Tt(),this.result=te(),this.process={tensor:null,canvas:null},this.faceTriangulation=Q1,this.faceUVMap=_1,ot(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&b(`version: ${this.version}`),this.config.debug&&b(`tfjs version: ${this.tf.version["tfjs-core"]}`);let o=JSON.parse(JSON.stringify(this.env));delete o.kernels,delete o.initial,delete o.perfadd,this.config.debug&&b("environment:",o)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ce)),this.config.backend=t,xt(),M.initial=!0}validate(t){let n=lt(Ce,t||this.config);return n.length===0&&(this.config=Q(this.config,t)),n}now(){return R()}image(t,n=!1){return f2(t,this.config,n)}async segmentation(t,n){var A,a,i;if(n&&(this.config=Q(this.config,n)),!this.config.segmentation.enabled)return null;let o=await f2(t,this.config);if(!o.tensor)return null;let s=null;return(A=this.config.segmentation.modelPath)!=null&&A.includes("rvm")&&(s=await Vn(o.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("meet")&&(s=await Tn(o.tensor,this.config)),(i=this.config.segmentation.modelPath)!=null&&i.includes("selfie")&&(s=await Xn(o.tensor,this.config)),r.dispose(o.tensor),s}compare(t,n){return o1(this.config,t,n)}async init(){await e2(this,!0),await this.tf.ready(),xt()}async load(t){this.state="load";let n=R(),o=Object.values(this.models.models).filter(a=>a).length;t&&(this.config=Q(this.config,t)),this.env.initial&&(await e2(this,!1)||b("error: backend check failed"),await r.ready(),this.env.browser&&(this.config.debug&&b("configuration:",this.config),this.config.debug&&b("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&b("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(a=>a).length!==o&&(this.models.validate(),this.emit("load"));let A=Math.trunc(R()-n);A>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+A:A)}next(t=this.result){return gn(t,this.config)}async warmup(t){let n=R(),o=await Kn(this,t),s=R();return this.performance.warmup=Math.trunc(s-n),o}async profile(t,n){let o=await this.tf.profile(()=>this.detect(t,n)),s={},A=0;for(let i of o.kernels){let c=Number(i.kernelTimeMs)||0;s[i.name]?s[i.name]+=c:s[i.name]=c,A+=c}let a=[];Object.entries(s).forEach(i=>a.push({kernel:i[0],time:i[1],perc:0}));for(let i of a)i.perc=Math.round(1e3*i.time/A)/1e3,i.time=Math.round(1e3*i.time)/1e3;return a.sort((i,c)=>c.time-i.time),a.length=20,a}async detect(t,n){return this.state="detect",new Promise(async o=>{var h,T,v,u,g,E,k,N,C,V,D,Z,J,q,U,m0,P,i0,g0,e0,G;this.state="config";let s;this.config=Q(this.config,n),this.state="check";let A=E0(this,At).call(this,t);A&&(b(A,t),this.emit("error"),o(te(A)));let a=R();await this.load(),s=R(),this.state="image";let i=await f2(t,this.config);if(this.process=i,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(R()-s):Math.trunc(R()-s),this.analyze("Get Image:"),!i.tensor){this.config.debug&&b("could not convert input to tensor"),this.emit("error"),o(te("could not convert input to tensor"));return}this.emit("image"),s=R(),this.config.skipAllowed=await n1(this.config,i.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(R()-s):Math.trunc(R()-s),this.analyze("Check Changed:");let c=[],d=[],y=[],l=[];this.state="detect:face",this.config.async?(c=this.config.face.enabled?c5(this,i.tensor):[],this.performance.face&&delete this.performance.face):(s=R(),c=this.config.face.enabled?await c5(this,i.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(c=await c),this.analyze("Start Body:"),this.state="detect:body";let f=this.config.body.maxDetected===-1?Q(this.config,{body:{maxDetected:this.config.face.enabled?1*c.length:1}}):this.config;this.config.async?((h=this.config.body.modelPath)!=null&&h.includes("posenet")?d=this.config.body.enabled?C5(i.tensor,f):[]:(T=this.config.body.modelPath)!=null&&T.includes("blazepose")?d=this.config.body.enabled?wt(i.tensor,f):[]:(v=this.config.body.modelPath)!=null&&v.includes("efficientpose")?d=this.config.body.enabled?Lt(i.tensor,f):[]:(u=this.config.body.modelPath)!=null&&u.includes("movenet")&&(d=this.config.body.enabled?z5(i.tensor,f):[]),this.performance.body&&delete this.performance.body):(s=R(),(g=this.config.body.modelPath)!=null&&g.includes("posenet")?d=this.config.body.enabled?await C5(i.tensor,f):[]:(E=this.config.body.modelPath)!=null&&E.includes("blazepose")?d=this.config.body.enabled?await wt(i.tensor,f):[]:(k=this.config.body.modelPath)!=null&&k.includes("efficientpose")?d=this.config.body.enabled?await Lt(i.tensor,f):[]:(N=this.config.body.modelPath)!=null&&N.includes("movenet")&&(d=this.config.body.enabled?await z5(i.tensor,f):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let x=this.config.hand.maxDetected===-1?Q(this.config,{hand:{maxDetected:this.config.face.enabled?2*c.length:1}}):this.config;this.config.async?((V=(C=this.config.hand.detector)==null?void 0:C.modelPath)!=null&&V.includes("handdetect")?y=this.config.hand.enabled?p5(i.tensor,x):[]:(Z=(D=this.config.hand.detector)==null?void 0:D.modelPath)!=null&&Z.includes("handtrack")&&(y=this.config.hand.enabled?b5(i.tensor,x):[]),this.performance.hand&&delete this.performance.hand):(s=R(),(q=(J=this.config.hand.detector)==null?void 0:J.modelPath)!=null&&q.includes("handdetect")?y=this.config.hand.enabled?await p5(i.tensor,x):[]:(m0=(U=this.config.hand.detector)==null?void 0:U.modelPath)!=null&&m0.includes("handtrack")&&(y=this.config.hand.enabled?await b5(i.tensor,x):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((P=this.config.object.modelPath)!=null&&P.includes("nanodet")?l=this.config.object.enabled?j5(i.tensor,this.config):[]:(i0=this.config.object.modelPath)!=null&&i0.includes("centernet")&&(l=this.config.object.enabled?St(i.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(s=R(),(g0=this.config.object.modelPath)!=null&&g0.includes("nanodet")?l=this.config.object.enabled?await j5(i.tensor,this.config):[]:(e0=this.config.object.modelPath)!=null&&e0.includes("centernet")&&(l=this.config.object.enabled?await St(i.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([c,d,y,l]=await Promise.all([c,d,y,l])),this.state="detect:gesture";let p=[];this.config.gesture.enabled&&(s=R(),p=[...K3(c),...Y3(d),...Q3(y),...J3(c)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(R()-s):Math.trunc(R()-s)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(R()-a):Math.trunc(R()-a);let m=((G=this.process.tensor)==null?void 0:G.shape)||[0,0,0,0];this.result={face:c,body:d,hand:y,gesture:p,object:l,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:m[2],height:m[1],get persons(){return Yn(c,d,y,p,m)}},r.dispose(i.tensor),this.emit("detect"),this.state="idle",o(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,o=0){n?(E0(this,be)[t.id]||(this.config.debug&&b("video start",t.id),E0(this,be)[t.id]=!0),!t.paused&&E0(this,be)[t.id]&&t.readyState>=2&&await this.detect(t),o>0&&await this.sleep(o),E0(this,be)[t.id]&&requestAnimationFrame(()=>this.video(t,n,o))):(this.config.debug&&b("video stop",t.id),E0(this,be)[t.id]=!1)}};Ye=new WeakMap,l2=new WeakMap,c2=new WeakMap,At=new WeakMap,be=new WeakMap;export{p2 as Env,Jn as Human,Jn as default,Ce as defaults,vt as draw,te as empty,M as env,k5 as match,Un as models}; diff --git a/dist/human.esm.js b/dist/human.esm.js index a87c081a..aab3cf87 100644 --- a/dist/human.esm.js +++ b/dist/human.esm.js @@ -36,634 +36,634 @@ var __privateSet = (obj, member, value, setter) => { // dist/tfjs.esm.js var tfjs_esm_exports = {}; __export(tfjs_esm_exports, { - Abs: () => Xs, - Acos: () => Vo, - Acosh: () => Wo, - AdadeltaOptimizer: () => Qu, - AdagradOptimizer: () => Zu, - AdamOptimizer: () => Ju, - AdamaxOptimizer: () => ep, - Add: () => io, - AddN: () => Uo, - All: () => Go, - Any: () => Ho, - ArgMax: () => Ys, - ArgMin: () => Qs, - Asin: () => Ko, - Asinh: () => qo, - Atan: () => jo, - Atan2: () => Yo, - Atanh: () => Xo, - AvgPool: () => Qo, - AvgPool3D: () => Zs, - AvgPool3DGrad: () => Ei, - AvgPoolGrad: () => $i, - BackendWasm: () => im, - BatchMatMul: () => Zo, - BatchToSpaceND: () => Js, - Bincount: () => Jo, - BitwiseAnd: () => qa, - BroadcastArgs: () => ea, - BroadcastTo: () => Bce, - Cast: () => yo, - Ceil: () => en, - ClipByValue: () => bo, - Complex: () => Ri, - ComplexAbs: () => Di, - Concat: () => ta, - Conv2D: () => tn, - Conv2DBackpropFilter: () => Ai, - Conv2DBackpropInput: () => rn, - Conv3D: () => on, - Conv3DBackpropFilterV2: () => ja, - Conv3DBackpropInputV2: () => nn, - Cos: () => sn, - Cosh: () => an, - CropAndResize: () => cn, - Cumprod: () => un, - Cumsum: () => pn, - DataStorage: () => Bo, - DenseBincount: () => ra, - DepthToSpace: () => ln, - DepthwiseConv2dNative: () => mn, - DepthwiseConv2dNativeBackpropFilter: () => Fi, - DepthwiseConv2dNativeBackpropInput: () => Pi, - Diag: () => oa, - Dilation2D: () => dn, - Dilation2DBackpropFilter: () => Mi, - Dilation2DBackpropInput: () => Oi, - Draw: () => _u, - ENV: () => ow, - Einsum: () => Li, - Elu: () => hn, - EluGrad: () => Xa, - Environment: () => ll, - Equal: () => xn, - Erf: () => gn, - Exp: () => yn, - ExpandDims: () => na, - Expm1: () => bn, - FFT: () => Bi, - Fill: () => sa, - FlipLeftRight: () => Cn, - Floor: () => wn, - FloorDiv: () => Sn, - FromPixels: () => Eu, - FusedBatchNorm: () => In, - FusedConv2D: () => Io, - FusedDepthwiseConv2D: () => vo, - GPGPUContext: () => xp, - GatherNd: () => vn, - GatherV2: () => aa, - GraphModel: () => Ml, - Greater: () => kn, - GreaterEqual: () => Nn, - IFFT: () => zi, - Identity: () => Co, - Imag: () => Vi, - IsFinite: () => Tn, - IsInf: () => _n, - IsNan: () => $n, - KernelBackend: () => so, - LRN: () => Bn, - LRNGrad: () => Ya, - LeakyRelu: () => En, - Less: () => Rn, - LessEqual: () => Dn, - LinSpace: () => An, - Log: () => Fn, - Log1p: () => Pn, - LogSoftmax: () => zce, - LogicalAnd: () => On, - LogicalNot: () => Mn, - LogicalOr: () => Ln, - LogicalXor: () => E0, - LowerBound: () => Vce, - MathBackendCPU: () => hc, - MathBackendWebGL: () => Oc, - MatrixBandPart: () => Wce, - Max: () => zn, - MaxPool: () => Wn, - MaxPool3D: () => ia, - MaxPool3DGrad: () => Ui, - MaxPoolGrad: () => Wi, - MaxPoolWithArgmax: () => ua, - Maximum: () => Vn, - Mean: () => Un, - Min: () => Gn, - Minimum: () => Hn, - MirrorPad: () => Kn, - Mod: () => qn, - MomentumOptimizer: () => tp, - Multinomial: () => jn, - Multiply: () => Xn, - Neg: () => pa, - NonMaxSuppressionV3: () => Qn, - NonMaxSuppressionV4: () => Qa, - NonMaxSuppressionV5: () => Zn, - NotEqual: () => Yn, - OP_SCOPE_SUFFIX: () => kw, - OneHot: () => Jn, - OnesLike: () => ca, - Optimizer: () => kr, - OptimizerConstructors: () => Dl, - Pack: () => la, - PadV2: () => es, - Pool: () => Uce, - Pow: () => ts, - Prelu: () => rs, - Prod: () => os, - RMSPropOptimizer: () => rp, - RaggedGather: () => Up, - RaggedRange: () => Gp, - RaggedTensorToTensor: () => Hp, - Range: () => ma, - Rank: () => hw, - Real: () => Gi, - RealDiv: () => fn, - Reciprocal: () => ns, - Reduction: () => Et, - Relu: () => ss, - Relu6: () => us, - Reshape: () => da, - ResizeBilinear: () => is, - ResizeBilinearGrad: () => Ja, - ResizeNearestNeighbor: () => as, - ResizeNearestNeighborGrad: () => Za, - Reverse: () => ps, - RotateWithOffset: () => Ds, - Round: () => cs, - Rsqrt: () => ls, - SGDOptimizer: () => li, - ScatterNd: () => ms, - SearchSorted: () => fs, - Select: () => fa, - Selu: () => hs, - Sigmoid: () => bs, - Sign: () => ys, - Sin: () => gs, - Sinh: () => xs, - Slice: () => ha, - Softmax: () => Is, - Softplus: () => Cs, - SpaceToBatchND: () => ga, - SparseFillEmptyRows: () => Hi, - SparseReshape: () => ei, - SparseSegmentMean: () => ya, - SparseSegmentSum: () => ba, - SparseToDense: () => vs, - SplitV: () => xa, - Sqrt: () => ws, - Square: () => Ki, - SquaredDifference: () => ks, - StaticRegexReplace: () => $u, - Step: () => wo, - StridedSlice: () => Ns, - StringNGrams: () => Ca, - StringSplit: () => qi, - StringToHashBucketFast: () => ji, - Sub: () => Ts, - Sum: () => Ss, - Tan: () => _s, - Tanh: () => $s, - Tensor: () => mt, - TensorBuffer: () => tt, - TensorScatterUpdate: () => ds, - Tile: () => uo, - TopK: () => Es, - Transform: () => Rs, - Transpose: () => po, - Unique: () => Xi, - Unpack: () => wa, - UnsortedSegmentSum: () => Yi, - UpperBound: () => Gce, - Variable: () => ri, - WebGPUBackend: () => Kc, - ZerosLike: () => Sa, - _FusedMatMul: () => So, - abs: () => Qt, - acos: () => Nk, - acosh: () => Tk, + Abs: () => fn, + Acos: () => hn, + Acosh: () => gn, + AdadeltaOptimizer: () => sp, + AdagradOptimizer: () => ap, + AdamOptimizer: () => ip, + AdamaxOptimizer: () => up, + Add: () => Rr, + AddN: () => xn, + All: () => yn, + Any: () => bn, + ArgMax: () => na, + ArgMin: () => sa, + Asin: () => Cn, + Asinh: () => wn, + Atan: () => Sn, + Atan2: () => vn, + Atanh: () => In, + AvgPool: () => kn, + AvgPool3D: () => aa, + AvgPool3DGrad: () => Vi, + AvgPoolGrad: () => zi, + BackendWasm: () => gm, + BatchMatMul: () => Nn, + BatchToSpaceND: () => ia, + Bincount: () => Tn, + BitwiseAnd: () => _n, + BroadcastArgs: () => ua, + BroadcastTo: () => Sme, + Cast: () => ho, + Ceil: () => go, + ClipByValue: () => Go, + Complex: () => ei, + ComplexAbs: () => Wi, + Concat: () => pa, + Conv2D: () => En, + Conv2DBackpropFilter: () => Ui, + Conv2DBackpropInput: () => $n, + Conv3D: () => Rn, + Conv3DBackpropFilterV2: () => ti, + Conv3DBackpropInputV2: () => Dn, + Cos: () => An, + Cosh: () => Fn, + CropAndResize: () => Mn, + Cumprod: () => Pn, + Cumsum: () => On, + DataStorage: () => mn, + DenseBincount: () => la, + DepthToSpace: () => Ln, + DepthwiseConv2dNative: () => Bn, + DepthwiseConv2dNativeBackpropFilter: () => Gi, + DepthwiseConv2dNativeBackpropInput: () => Hi, + Diag: () => ca, + Dilation2D: () => zn, + Dilation2DBackpropFilter: () => qi, + Dilation2DBackpropInput: () => Ki, + Draw: () => Mu, + ENV: () => xw, + Einsum: () => ji, + Elu: () => Wn, + EluGrad: () => ri, + Environment: () => Cc, + Equal: () => xo, + Erf: () => Un, + Exp: () => yo, + ExpandDims: () => ma, + Expm1: () => bo, + FFT: () => Xi, + Fill: () => da, + FlipLeftRight: () => Gn, + Floor: () => Co, + FloorDiv: () => wo, + FromPixels: () => Lu, + FusedBatchNorm: () => Hn, + FusedConv2D: () => jo, + FusedDepthwiseConv2D: () => Xo, + GPGPUContext: () => kp, + GatherNd: () => Kn, + GatherV2: () => fa, + GraphModel: () => Kc, + Greater: () => So, + GreaterEqual: () => Io, + IFFT: () => Yi, + Identity: () => vo, + Imag: () => Qi, + IsFinite: () => qn, + IsInf: () => jn, + IsNan: () => Xn, + KernelBackend: () => mo, + LRN: () => rs, + LRNGrad: () => oi, + LeakyRelu: () => Yn, + Less: () => ko, + LessEqual: () => No, + LinSpace: () => Qn, + Log: () => To, + Log1p: () => Zn, + LogSoftmax: () => Ime, + LogicalAnd: () => Jn, + LogicalNot: () => es, + LogicalOr: () => ts, + LogicalXor: () => gk, + LowerBound: () => vme, + MathBackendCPU: () => Il, + MathBackendWebGL: () => Ul, + MatrixBandPart: () => kme, + Max: () => os, + MaxPool: () => ns, + MaxPool3D: () => ha, + MaxPool3DGrad: () => Ji, + MaxPoolGrad: () => Zi, + MaxPoolWithArgmax: () => ga, + Maximum: () => _o, + Mean: () => ss, + Min: () => as, + Minimum: () => Eo, + MirrorPad: () => is, + Mod: () => us, + MomentumOptimizer: () => pp, + Multinomial: () => ps, + Multiply: () => $o, + Neg: () => ls, + NonMaxSuppressionV3: () => cs, + NonMaxSuppressionV4: () => ni, + NonMaxSuppressionV5: () => ms, + NotEqual: () => Ro, + OP_SCOPE_SUFFIX: () => Bw, + OneHot: () => ds, + OnesLike: () => xa, + Optimizer: () => _r, + OptimizerConstructors: () => Vc, + Pack: () => ya, + PadV2: () => fs, + Pool: () => Nme, + Pow: () => hs, + Prelu: () => gs, + Prod: () => Ho, + RMSPropOptimizer: () => lp, + RaggedGather: () => Qp, + RaggedRange: () => Zp, + RaggedTensorToTensor: () => Jp, + Range: () => ba, + Rank: () => Ew, + Real: () => si, + RealDiv: () => Vn, + Reciprocal: () => xs, + Reduction: () => Dt, + Relu: () => ys, + Relu6: () => ws, + Reshape: () => Ca, + ResizeBilinear: () => Cs, + ResizeBilinearGrad: () => ii, + ResizeNearestNeighbor: () => bs, + ResizeNearestNeighborGrad: () => ai, + Reverse: () => Ss, + RotateWithOffset: () => Vs, + Round: () => Is, + Rsqrt: () => Do, + SGDOptimizer: () => wi, + ScatterNd: () => vs, + SearchSorted: () => Ns, + Select: () => wa, + Selu: () => Ts, + Sigmoid: () => Ao, + Sign: () => Rs, + Sin: () => Es, + Sinh: () => $s, + Slice: () => _s, + Softmax: () => Fs, + Softplus: () => Ds, + SpaceToBatchND: () => Sa, + SparseFillEmptyRows: () => eu, + SparseReshape: () => ui, + SparseSegmentMean: () => va, + SparseSegmentSum: () => ka, + SparseToDense: () => Ps, + SplitV: () => Ia, + Sqrt: () => Fo, + Square: () => tu, + SquaredDifference: () => Po, + StaticRegexReplace: () => pi, + Step: () => Ko, + StridedSlice: () => Os, + StringNGrams: () => Na, + StringSplit: () => ru, + StringToHashBucketFast: () => ou, + Sub: () => Oo, + Sum: () => As, + Tan: () => Ms, + Tanh: () => Ls, + Tensor: () => dt, + TensorBuffer: () => Ge, + TensorScatterUpdate: () => ks, + Tile: () => Mo, + TopK: () => Bs, + Transform: () => zs, + Transpose: () => Kr, + Unique: () => nu, + Unpack: () => Ta, + UnsortedSegmentSum: () => su, + UpperBound: () => Tme, + Variable: () => ci, + WebGPUBackend: () => Jl, + ZerosLike: () => _a, + _FusedMatMul: () => qo, + abs: () => er, + acos: () => g1, + acosh: () => x1, add: () => Ce, - addN: () => _k, - all: () => $k, - any: () => Ek, - argMax: () => Rk, - argMin: () => Dk, - asin: () => Ak, - asinh: () => Fk, - atan: () => Pk, - atan2: () => Ok, - atanh: () => Mk, - avgPool: () => md, - avgPool3d: () => zk, - backend: () => vde, - backend_util: () => w, - basicLSTMCell: () => Vk, - batchNorm: () => ru, - batchNorm2d: () => Uk, - batchNorm3d: () => Gk, - batchNorm4d: () => Hk, - batchToSpaceND: () => dd, - bincount: () => fd, - bitwiseAnd: () => Kk, - booleanMaskAsync: () => E6, - broadcastArgs: () => qk, - broadcastTo: () => ou, - broadcast_util: () => Sr, - browser: () => nT, - buffer: () => me, - cast: () => We, - ceil: () => jk, - clipByValue: () => Xk, - clone: () => Wr, - complex: () => $r, - concat: () => yt, - concat1d: () => Yk, - concat2d: () => Qk, - concat3d: () => Zk, - concat4d: () => Jk, - conv1d: () => e2, - conv2d: () => nu, - conv2dTranspose: () => t2, - conv3d: () => r22, - conv3dTranspose: () => n2, - copyRegisteredKernels: () => Zce, - cos: () => s2, - cosh: () => a2, - cosineWindow: () => _l, - cumprod: () => i2, - cumsum: () => u2, - customGrad: () => Ir, - denseBincount: () => p2, - deprecationWarn: () => Pw, - depthToSpace: () => c2, - depthwiseConv2d: () => oc, - deregisterOp: () => A5, - device_util: () => Ji, - diag: () => l2, - dilation2d: () => m2, - disableDeprecationWarnings: () => dde, - dispose: () => Ot, - disposeVariables: () => fde, - div: () => je, - divNoNan: () => f2, - dot: () => h2, - dropout: () => W6, - einsum: () => su, - elu: () => yd, - enableDebugMode: () => mde, - enableProdMode: () => lde, - enclosingPowerOfTwo: () => Qw, - engine: () => ur, - ensureShape: () => g2, + addN: () => y1, + all: () => b1, + any: () => C1, + argMax: () => w1, + argMin: () => S1, + asin: () => I1, + asinh: () => v1, + atan: () => k1, + atan2: () => N1, + atanh: () => T1, + avgPool: () => Id, + avgPool3d: () => $1, + backend: () => Hk, + backend_util: () => C, + basicLSTMCell: () => R1, + batchNorm: () => mu, + batchNorm2d: () => A1, + batchNorm3d: () => F1, + batchNorm4d: () => P1, + batchToSpaceND: () => vd, + bincount: () => kd, + bitwiseAnd: () => O1, + booleanMaskAsync: () => oX, + broadcastArgs: () => M1, + broadcastTo: () => Oa, + broadcast_util: () => kr, + browser: () => XT, + buffer: () => ie, + cast: () => Ue, + ceil: () => L1, + clipByValue: () => B1, + clone: () => Xr, + complex: () => Ar, + concat: () => bt, + concat1d: () => z1, + concat2d: () => V1, + concat3d: () => W1, + concat4d: () => U1, + conv1d: () => G1, + conv2d: () => du, + conv2dTranspose: () => H1, + conv3d: () => K1, + conv3dTranspose: () => j1, + copyRegisteredKernels: () => Pme, + cos: () => X1, + cosh: () => Y1, + cosineWindow: () => Mc, + cumprod: () => Q1, + cumsum: () => Z1, + customGrad: () => Nr, + denseBincount: () => J1, + deprecationWarn: () => zw, + depthToSpace: () => e2, + depthwiseConv2d: () => cl, + deregisterOp: () => aY, + device_util: () => uu, + diag: () => t2, + dilation2d: () => r22, + disableDeprecationWarnings: () => Kde, + dispose: () => Lt, + disposeVariables: () => qde, + div: () => Xe, + divNoNan: () => n2, + dot: () => s2, + dropout: () => hX, + einsum: () => fu, + elu: () => Ed, + enableDebugMode: () => Hde, + enableProdMode: () => Gde, + enclosingPowerOfTwo: () => cS, + engine: () => cr, + ensureShape: () => a2, env: () => A, - equal: () => xd, - erf: () => x2, - euclideanNorm: () => C2, - exp: () => _o, - expandDims: () => Ms, - expm1: () => w2, - eye: () => bd, - fft: () => ac, - fill: () => Ea, - findBackend: () => Sde, - findBackendFactory: () => Ide, - floor: () => Cd, - floorDiv: () => ld, - forceHalfFloat: () => LD, - fused: () => Zw, - gather: () => wd, - gatherND: () => z6, - gather_util: () => sf, - getBackend: () => Cde, - getGradient: () => aw, - getKernel: () => qp, - getKernelsForBackend: () => jm, - getThreadsCount: () => Zse, - gpgpu_util: () => lv, - grad: () => AK, - grads: () => FK, - greater: () => zu, - greaterEqual: () => Sd, - ifft: () => Ku, - imag: () => iu, - image: () => Kj, - inTopKAsync: () => G6, - io: () => mi, - irfft: () => Gd, - isFinite: () => S2, - isInf: () => I2, - isNaN: () => v2, - keep: () => Er, - kernel_impls: () => Vt, - leakyRelu: () => Id, - less: () => kl, - lessEqual: () => nc, - linalg: () => qj, - linspace: () => k2, - loadGraphModel: () => $8, - loadGraphModelSync: () => E8, - localResponseNormalization: () => N2, - log: () => ui, - log1p: () => vd, - logSigmoid: () => T2, - logSoftmax: () => _2, - logSumExp: () => Td, - logicalAnd: () => Vu, - logicalNot: () => _d, - logicalOr: () => $d, - logicalXor: () => $2, - losses: () => jj, - lowerBound: () => E2, - matMul: () => Ze, - math: () => eT, - max: () => Ra, - maxPool: () => Rd, - maxPool3d: () => R2, - maxPoolWithArgmax: () => D2, - maximum: () => Dd, - mean: () => Wu, - memory: () => hde, - meshgrid: () => A2, - min: () => vl, - minimum: () => Uu, - mirrorPad: () => F2, - mod: () => P2, - moments: () => O2, - movingAverage: () => A6, + equal: () => _d, + erf: () => i2, + euclideanNorm: () => l2, + exp: () => Jo, + expandDims: () => Ks, + expm1: () => c2, + eye: () => $d, + fft: () => fl, + fill: () => Ma, + findBackend: () => efe, + findBackendFactory: () => tfe, + floor: () => Rd, + floorDiv: () => Sd, + forceHalfFloat: () => EA, + fused: () => mS, + gather: () => Dd, + gatherND: () => dX, + gather_util: () => xf, + getBackend: () => Gk, + getGradient: () => Cw, + getKernel: () => tl, + getKernelsForBackend: () => ad, + getThreadsCount: () => kie, + gpgpu_util: () => k0, + grad: () => a6, + grads: () => i6, + greater: () => ju, + greaterEqual: () => Ad, + ifft: () => ep, + imag: () => gu, + image: () => b5, + inTopKAsync: () => xX, + io: () => Si, + irfft: () => tf, + isFinite: () => m2, + isInf: () => d2, + isNaN: () => f2, + keep: () => Fr, + kernel_impls: () => Ut, + leakyRelu: () => Fd, + less: () => Fc, + lessEqual: () => ml, + linalg: () => C5, + linspace: () => h2, + loadGraphModel: () => r72, + loadGraphModelSync: () => o7, + localResponseNormalization: () => g2, + log: () => yi, + log1p: () => Pd, + logSigmoid: () => x2, + logSoftmax: () => y2, + logSumExp: () => Ld, + logicalAnd: () => Xu, + logicalNot: () => Bd, + logicalOr: () => zd, + logicalXor: () => b2, + losses: () => w5, + lowerBound: () => C2, + matMul: () => Je, + math: () => HT, + max: () => La, + maxPool: () => Wd, + maxPool3d: () => w2, + maxPoolWithArgmax: () => S2, + maximum: () => Ud, + mean: () => Yu, + memory: () => jde, + meshgrid: () => I2, + min: () => Ac, + minimum: () => Qu, + mirrorPad: () => v2, + mod: () => k2, + moments: () => N2, + movingAverage: () => aX, mul: () => se, - multiRNNCell: () => M2, - multinomial: () => L2, - neg: () => pr, - nextFrame: () => pS, - node: () => bQt, - norm: () => Bu, - notEqual: () => Ad, - oneHot: () => Tl, - ones: () => Da, - onesLike: () => B2, + multiRNNCell: () => T2, + multinomial: () => _2, + neg: () => mr, + nextFrame: () => IS, + node: () => qtr, + norm: () => qu, + notEqual: () => Gd, + oneHot: () => Oc, + ones: () => Ba, + onesLike: () => E2, op: () => N, - outerProduct: () => z2, - pad: () => Aa, - pad1d: () => V2, - pad2d: () => W2, - pad3d: () => U2, - pad4d: () => G2, - pool: () => H2, - pow: () => ii, - prelu: () => Pd, - print: () => cd, - prod: () => K2, - profile: () => gde, - raggedGather: () => q2, - raggedRange: () => j2, - raggedTensorToTensor: () => X2, - rand: () => Y2, - randomGamma: () => x1, - randomNormal: () => Vd, - randomStandardNormal: () => y1, - randomUniform: () => sc, - randomUniformInt: () => b1, - range: () => uu, - ready: () => bde, - real: () => pi, - reciprocal: () => C1, - registerBackend: () => tu, - registerGradient: () => Xce, - registerKernel: () => ti, - registerOp: () => D5, - relu: () => pu, - relu6: () => Wd, - removeBackend: () => wde, + outerProduct: () => $2, + pad: () => za, + pad1d: () => R2, + pad2d: () => D2, + pad3d: () => A2, + pad4d: () => F2, + pool: () => P2, + pow: () => xi, + prelu: () => Kd, + print: () => wd, + prod: () => O2, + profile: () => Xde, + raggedGather: () => M2, + raggedRange: () => L2, + raggedTensorToTensor: () => B2, + rand: () => z2, + randomGamma: () => iN, + randomNormal: () => Zd, + randomStandardNormal: () => uN, + randomUniform: () => dl, + randomUniformInt: () => pN, + range: () => xu, + ready: () => Zde, + real: () => bi, + reciprocal: () => lN, + registerBackend: () => pu, + registerGradient: () => Dme, + registerKernel: () => li, + registerOp: () => sY, + relu: () => yu, + relu6: () => Jd, + removeBackend: () => Jde, reshape: () => W, - reverse: () => lo, - reverse1d: () => w1, - reverse2d: () => S1, - reverse3d: () => I1, - reverse4d: () => v1, - rfft: () => ic, - round: () => Ud, - rsqrt: () => k1, + reverse: () => Bo, + reverse1d: () => cN, + reverse2d: () => mN, + reverse3d: () => dN, + reverse4d: () => fN, + rfft: () => hl, + round: () => ef, + rsqrt: () => hN, scalar: () => ke, - scatterND: () => P6, - scatter_util: () => lu, - searchSorted: () => Nl, - selu: () => N1, - separableConv2d: () => T1, - serialization: () => UN, - setBackend: () => yde, - setPlatform: () => kde, - setThreadsCount: () => Qse, - setWasmPath: () => Xse, - setWasmPaths: () => Yse, - setWebGLContext: () => kI, - setdiff1dAsync: () => _1, - shared: () => wc, - sigmoid: () => $a, - sign: () => $1, - signal: () => Hj, - sin: () => E1, - sinh: () => R1, - slice: () => Xe, - slice1d: () => D1, - slice2d: () => A1, - slice3d: () => F1, - slice4d: () => P1, - slice_util: () => pt, - softmax: () => O1, - softplus: () => Nd, - spaceToBatchND: () => Fd, - sparse: () => Xj, - sparseToDense: () => L6, - spectral: () => Gj, - split: () => ci, - sqrt: () => Rr, - square: () => Zt, - squaredDifference: () => Hd, - squeeze: () => uc, - stack: () => vr, - step: () => Kd, - stridedSlice: () => M1, - string: () => Yj, + scatterND: () => uX, + scatter_util: () => Cu, + searchSorted: () => Pc, + selu: () => gN, + separableConv2d: () => xN, + serialization: () => AT, + setBackend: () => Qde, + setPlatform: () => rfe, + setThreadsCount: () => vie, + setWasmPath: () => Sie, + setWasmPaths: () => Iie, + setWebGLContext: () => BI, + setdiff1dAsync: () => yN, + shared: () => Xf, + sigmoid: () => Pa, + sign: () => bN, + signal: () => y5, + sin: () => CN, + sinh: () => wN, + slice: () => Ye, + slice1d: () => SN, + slice2d: () => IN, + slice3d: () => vN, + slice4d: () => kN, + slice_util: () => nt, + softmax: () => NN, + softplus: () => Md, + spaceToBatchND: () => Hd, + sparse: () => S5, + sparseToDense: () => cX, + spectral: () => x5, + split: () => Ci, + sqrt: () => Pr, + square: () => tr, + squaredDifference: () => rf, + squeeze: () => gl, + stack: () => Tr, + step: () => of, + stridedSlice: () => TN, + string: () => I5, sub: () => Te, sum: () => ot, - sumOutType: () => oi, - tan: () => L1, - tanh: () => Il, - tensor: () => ar, - tensor1d: () => Jt, - tensor2d: () => cu, - tensor3d: () => qd, - tensor4d: () => B1, - tensor5d: () => z1, - tensor6d: () => V1, - tensorScatterUpdate: () => U1, - tensor_util: () => tk, - test_util: () => g1, + sumOutType: () => mi, + tan: () => _N, + tanh: () => Dc, + tensor: () => pr, + tensor1d: () => rr, + tensor2d: () => bu, + tensor3d: () => nf, + tensor4d: () => EN, + tensor5d: () => $N, + tensor6d: () => RN, + tensorScatterUpdate: () => AN, + tensor_util: () => Vk, + test_util: () => aN, tidy: () => De, - tile: () => au, - time: () => xde, - topk: () => G1, - train: () => TGe, - transpose: () => cc, - truncatedNormal: () => H1, - unique: () => K1, - unregisterGradient: () => Qce, - unregisterKernel: () => Yce, - unsortedSegmentSum: () => q1, - unstack: () => mo, - upcastType: () => dt, - upperBound: () => j1, + tile: () => hu, + time: () => Yde, + topk: () => FN, + train: () => cHe, + transpose: () => yl, + truncatedNormal: () => PN, + unique: () => ON, + unregisterGradient: () => Fme, + unregisterKernel: () => Ame, + unsortedSegmentSum: () => MN, + unstack: () => zo, + upcastType: () => pt, + upperBound: () => LN, util: () => y, - valueAndGrad: () => PK, - valueAndGrads: () => OK, - variable: () => X1, - variableGrads: () => zw, - version: () => Ace, - version_converter: () => D8, - version_core: () => _X, - version_cpu: () => cY, - version_wasm: () => Jse, - version_webgl: () => s9, - webgl: () => Cat, - webgl_util: () => Tc, - webgpu_util: () => Qv, - where: () => co, - whereAsync: () => Xd, - zeros: () => Ur, - zerosLike: () => Gt + valueAndGrad: () => u6, + valueAndGrads: () => p6, + variable: () => BN, + variableGrads: () => eS, + version: () => gme, + version_converter: () => s7, + version_core: () => t8, + version_cpu: () => M7, + version_wasm: () => Nie, + version_webgl: () => DJ, + webgl: () => sut, + webgl_util: () => Fl, + webgpu_util: () => cv, + where: () => Lo, + whereAsync: () => af, + zeros: () => Yr, + zerosLike: () => Kt }); -var SG = Object.create; -var YC = Object.defineProperty; -var IG = Object.getOwnPropertyDescriptor; -var vG = Object.getOwnPropertyNames; -var kG = Object.getPrototypeOf; -var NG = Object.prototype.hasOwnProperty; -var Kt = (r15, t8) => () => (t8 || r15((t8 = { exports: {} }).exports, t8), t8.exports); -var qe = (r15, t8) => { - for (var e in t8) - YC(r15, e, { get: t8[e], enumerable: true }); -}; -var TG = (r15, t8, e, o) => { - if (t8 && typeof t8 == "object" || typeof t8 == "function") - for (let n of vG(t8)) - !NG.call(r15, n) && n !== e && YC(r15, n, { get: () => t8[n], enumerable: !(o = IG(t8, n)) || o.enumerable }); - return r15; -}; -var Lp = (r15, t8, e) => (e = r15 != null ? SG(kG(r15)) : {}, TG(t8 || !r15 || !r15.__esModule ? YC(e, "default", { value: r15, enumerable: true }) : e, r15)); -var W0 = Kt((tle, V0) => { - V0.exports = kt; - var ko = null; +var q4 = Object.create; +var lw = Object.defineProperty; +var j4 = Object.getOwnPropertyDescriptor; +var X4 = Object.getOwnPropertyNames; +var Y4 = Object.getPrototypeOf; +var Q4 = Object.prototype.hasOwnProperty; +var jt = (r16, e) => () => (e || r16((e = { exports: {} }).exports, e), e.exports); +var qe = (r16, e) => { + for (var t10 in e) + lw(r16, t10, { get: e[t10], enumerable: true }); +}; +var Z4 = (r16, e, t10, o) => { + if (e && typeof e == "object" || typeof e == "function") + for (let n of X4(e)) + !Q4.call(r16, n) && n !== t10 && lw(r16, n, { get: () => e[n], enumerable: !(o = j4(e, n)) || o.enumerable }); + return r16; +}; +var Kp = (r16, e, t10) => (t10 = r16 != null ? q4(Y4(r16)) : {}, Z4(e || !r16 || !r16.__esModule ? lw(t10, "default", { value: r16, enumerable: true }) : t10, r16)); +var _k = jt((Lme, Tk) => { + Tk.exports = Tt; + var Yo = null; try { - ko = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; - } catch (r15) { - } - function kt(r15, t8, e) { - this.low = r15 | 0, this.high = t8 | 0, this.unsigned = !!e; - } - kt.prototype.__isLong__; - Object.defineProperty(kt.prototype, "__isLong__", { value: true }); - function Vr(r15) { - return (r15 && r15.__isLong__) === true; - } - kt.isLong = Vr; - var D0 = {}, A0 = {}; - function Du(r15, t8) { - var e, o, n; - return t8 ? (r15 >>>= 0, (n = 0 <= r15 && r15 < 256) && (o = A0[r15], o) ? o : (e = Nt(r15, (r15 | 0) < 0 ? -1 : 0, true), n && (A0[r15] = e), e)) : (r15 |= 0, (n = -128 <= r15 && r15 < 128) && (o = D0[r15], o) ? o : (e = Nt(r15, r15 < 0 ? -1 : 0, false), n && (D0[r15] = e), e)); - } - kt.fromInt = Du; - function No(r15, t8) { - if (isNaN(r15)) - return t8 ? Ru : To; - if (t8) { - if (r15 < 0) - return Ru; - if (r15 >= M0) - return z0; + Yo = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; + } catch (r16) { + } + function Tt(r16, e, t10) { + this.low = r16 | 0, this.high = e | 0, this.unsigned = !!t10; + } + Tt.prototype.__isLong__; + Object.defineProperty(Tt.prototype, "__isLong__", { value: true }); + function jr(r16) { + return (r16 && r16.__isLong__) === true; + } + Tt.isLong = jr; + var yk = {}, bk = {}; + function zu(r16, e) { + var t10, o, n; + return e ? (r16 >>>= 0, (n = 0 <= r16 && r16 < 256) && (o = bk[r16], o) ? o : (t10 = _t(r16, (r16 | 0) < 0 ? -1 : 0, true), n && (bk[r16] = t10), t10)) : (r16 |= 0, (n = -128 <= r16 && r16 < 128) && (o = yk[r16], o) ? o : (t10 = _t(r16, r16 < 0 ? -1 : 0, false), n && (yk[r16] = t10), t10)); + } + Tt.fromInt = zu; + function Qo(r16, e) { + if (isNaN(r16)) + return e ? Bu : Zo; + if (e) { + if (r16 < 0) + return Bu; + if (r16 >= Ik) + return Nk; } else { - if (r15 <= -P0) - return zr; - if (r15 + 1 >= P0) - return B0; + if (r16 <= -wk) + return qr; + if (r16 + 1 >= wk) + return kk; } - return r15 < 0 ? No(-r15, t8).neg() : Nt(r15 % Xp | 0, r15 / Xp | 0, t8); + return r16 < 0 ? Qo(-r16, e).neg() : _t(r16 % ol | 0, r16 / ol | 0, e); } - kt.fromNumber = No; - function Nt(r15, t8, e) { - return new kt(r15, t8, e); + Tt.fromNumber = Qo; + function _t(r16, e, t10) { + return new Tt(r16, e, t10); } - kt.fromBits = Nt; - var Ym = Math.pow; - function pw(r15, t8, e) { - if (r15.length === 0) + Tt.fromBits = _t; + var ud = Math.pow; + function Iw(r16, e, t10) { + if (r16.length === 0) throw Error("empty string"); - if (r15 === "NaN" || r15 === "Infinity" || r15 === "+Infinity" || r15 === "-Infinity") - return To; - if (typeof t8 == "number" ? (e = t8, t8 = false) : t8 = !!t8, e = e || 10, e < 2 || 36 < e) + if (r16 === "NaN" || r16 === "Infinity" || r16 === "+Infinity" || r16 === "-Infinity") + return Zo; + if (typeof e == "number" ? (t10 = e, e = false) : e = !!e, t10 = t10 || 10, t10 < 2 || 36 < t10) throw RangeError("radix"); var o; - if ((o = r15.indexOf("-")) > 0) + if ((o = r16.indexOf("-")) > 0) throw Error("interior hyphen"); if (o === 0) - return pw(r15.substring(1), t8, e).neg(); - for (var n = No(Ym(e, 8)), s = To, a = 0; a < r15.length; a += 8) { - var i = Math.min(8, r15.length - a), p = parseInt(r15.substring(a, a + i), e); + return Iw(r16.substring(1), e, t10).neg(); + for (var n = Qo(ud(t10, 8)), s = Zo, a = 0; a < r16.length; a += 8) { + var i = Math.min(8, r16.length - a), p = parseInt(r16.substring(a, a + i), t10); if (i < 8) { - var u = No(Ym(e, i)); - s = s.mul(u).add(No(p)); + var u = Qo(ud(t10, i)); + s = s.mul(u).add(Qo(p)); } else - s = s.mul(n), s = s.add(No(p)); - } - return s.unsigned = t8, s; - } - kt.fromString = pw; - function As(r15, t8) { - return typeof r15 == "number" ? No(r15, t8) : typeof r15 == "string" ? pw(r15, t8) : Nt(r15.low, r15.high, typeof t8 == "boolean" ? t8 : r15.unsigned); - } - kt.fromValue = As; - var F0 = 65536, YG = 1 << 24, Xp = F0 * F0, M0 = Xp * Xp, P0 = M0 / 2, O0 = Du(YG), To = Du(0); - kt.ZERO = To; - var Ru = Du(0, true); - kt.UZERO = Ru; - var jp = Du(1); - kt.ONE = jp; - var L0 = Du(1, true); - kt.UONE = L0; - var uw = Du(-1); - kt.NEG_ONE = uw; - var B0 = Nt(-1, 2147483647, false); - kt.MAX_VALUE = B0; - var z0 = Nt(-1, -1, true); - kt.MAX_UNSIGNED_VALUE = z0; - var zr = Nt(0, -2147483648, false); - kt.MIN_VALUE = zr; - var de = kt.prototype; + s = s.mul(n), s = s.add(Qo(p)); + } + return s.unsigned = e, s; + } + Tt.fromString = Iw; + function Ws(r16, e) { + return typeof r16 == "number" ? Qo(r16, e) : typeof r16 == "string" ? Iw(r16, e) : _t(r16.low, r16.high, typeof e == "boolean" ? e : r16.unsigned); + } + Tt.fromValue = Ws; + var Ck = 65536, wH = 1 << 24, ol = Ck * Ck, Ik = ol * ol, wk = Ik / 2, Sk = zu(wH), Zo = zu(0); + Tt.ZERO = Zo; + var Bu = zu(0, true); + Tt.UZERO = Bu; + var rl = zu(1); + Tt.ONE = rl; + var vk = zu(1, true); + Tt.UONE = vk; + var Sw = zu(-1); + Tt.NEG_ONE = Sw; + var kk = _t(-1, 2147483647, false); + Tt.MAX_VALUE = kk; + var Nk = _t(-1, -1, true); + Tt.MAX_UNSIGNED_VALUE = Nk; + var qr = _t(0, -2147483648, false); + Tt.MIN_VALUE = qr; + var de = Tt.prototype; de.toInt = function() { return this.unsigned ? this.low >>> 0 : this.low; }; de.toNumber = function() { - return this.unsigned ? (this.high >>> 0) * Xp + (this.low >>> 0) : this.high * Xp + (this.low >>> 0); + return this.unsigned ? (this.high >>> 0) * ol + (this.low >>> 0) : this.high * ol + (this.low >>> 0); }; - de.toString = function(t8) { - if (t8 = t8 || 10, t8 < 2 || 36 < t8) + de.toString = function(e) { + if (e = e || 10, e < 2 || 36 < e) throw RangeError("radix"); if (this.isZero()) return "0"; if (this.isNegative()) - if (this.eq(zr)) { - var e = No(t8), o = this.div(e), n = o.mul(e).sub(this); - return o.toString(t8) + n.toInt().toString(t8); + if (this.eq(qr)) { + var t10 = Qo(e), o = this.div(t10), n = o.mul(t10).sub(this); + return o.toString(e) + n.toInt().toString(e); } else - return "-" + this.neg().toString(t8); - for (var s = No(Ym(t8, 6), this.unsigned), a = this, i = ""; ; ) { - var p = a.div(s), u = a.sub(p.mul(s)).toInt() >>> 0, c = u.toString(t8); + return "-" + this.neg().toString(e); + for (var s = Qo(ud(e, 6), this.unsigned), a = this, i = ""; ; ) { + var p = a.div(s), u = a.sub(p.mul(s)).toInt() >>> 0, l = u.toString(e); if (a = p, a.isZero()) - return c + i; - for (; c.length < 6; ) - c = "0" + c; - i = "" + c + i; + return l + i; + for (; l.length < 6; ) + l = "0" + l; + i = "" + l + i; } }; de.getHighBits = function() { @@ -680,10 +680,10 @@ var W0 = Kt((tle, V0) => { }; de.getNumBitsAbs = function() { if (this.isNegative()) - return this.eq(zr) ? 64 : this.neg().getNumBitsAbs(); - for (var t8 = this.high != 0 ? this.high : this.low, e = 31; e > 0 && !(t8 & 1 << e); e--) + return this.eq(qr) ? 64 : this.neg().getNumBitsAbs(); + for (var e = this.high != 0 ? this.high : this.low, t10 = 31; t10 > 0 && !(e & 1 << t10); t10--) ; - return this.high != 0 ? e + 33 : e + 1; + return this.high != 0 ? t10 + 33 : t10 + 1; }; de.isZero = function() { return this.high === 0 && this.low === 0; @@ -701,237 +701,237 @@ var W0 = Kt((tle, V0) => { de.isEven = function() { return (this.low & 1) === 0; }; - de.equals = function(t8) { - return Vr(t8) || (t8 = As(t8)), this.unsigned !== t8.unsigned && this.high >>> 31 === 1 && t8.high >>> 31 === 1 ? false : this.high === t8.high && this.low === t8.low; + de.equals = function(e) { + return jr(e) || (e = Ws(e)), this.unsigned !== e.unsigned && this.high >>> 31 === 1 && e.high >>> 31 === 1 ? false : this.high === e.high && this.low === e.low; }; de.eq = de.equals; - de.notEquals = function(t8) { - return !this.eq(t8); + de.notEquals = function(e) { + return !this.eq(e); }; de.neq = de.notEquals; de.ne = de.notEquals; - de.lessThan = function(t8) { - return this.comp(t8) < 0; + de.lessThan = function(e) { + return this.comp(e) < 0; }; de.lt = de.lessThan; - de.lessThanOrEqual = function(t8) { - return this.comp(t8) <= 0; + de.lessThanOrEqual = function(e) { + return this.comp(e) <= 0; }; de.lte = de.lessThanOrEqual; de.le = de.lessThanOrEqual; - de.greaterThan = function(t8) { - return this.comp(t8) > 0; + de.greaterThan = function(e) { + return this.comp(e) > 0; }; de.gt = de.greaterThan; - de.greaterThanOrEqual = function(t8) { - return this.comp(t8) >= 0; + de.greaterThanOrEqual = function(e) { + return this.comp(e) >= 0; }; de.gte = de.greaterThanOrEqual; de.ge = de.greaterThanOrEqual; - de.compare = function(t8) { - if (Vr(t8) || (t8 = As(t8)), this.eq(t8)) + de.compare = function(e) { + if (jr(e) || (e = Ws(e)), this.eq(e)) return 0; - var e = this.isNegative(), o = t8.isNegative(); - return e && !o ? -1 : !e && o ? 1 : this.unsigned ? t8.high >>> 0 > this.high >>> 0 || t8.high === this.high && t8.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(t8).isNegative() ? -1 : 1; + var t10 = this.isNegative(), o = e.isNegative(); + return t10 && !o ? -1 : !t10 && o ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1; }; de.comp = de.compare; de.negate = function() { - return !this.unsigned && this.eq(zr) ? zr : this.not().add(jp); + return !this.unsigned && this.eq(qr) ? qr : this.not().add(rl); }; de.neg = de.negate; - de.add = function(t8) { - Vr(t8) || (t8 = As(t8)); - var e = this.high >>> 16, o = this.high & 65535, n = this.low >>> 16, s = this.low & 65535, a = t8.high >>> 16, i = t8.high & 65535, p = t8.low >>> 16, u = t8.low & 65535, c = 0, l = 0, m = 0, d = 0; - return d += s + u, m += d >>> 16, d &= 65535, m += n + p, l += m >>> 16, m &= 65535, l += o + i, c += l >>> 16, l &= 65535, c += e + a, c &= 65535, Nt(m << 16 | d, c << 16 | l, this.unsigned); + de.add = function(e) { + jr(e) || (e = Ws(e)); + var t10 = this.high >>> 16, o = this.high & 65535, n = this.low >>> 16, s = this.low & 65535, a = e.high >>> 16, i = e.high & 65535, p = e.low >>> 16, u = e.low & 65535, l = 0, c = 0, m = 0, d = 0; + return d += s + u, m += d >>> 16, d &= 65535, m += n + p, c += m >>> 16, m &= 65535, c += o + i, l += c >>> 16, c &= 65535, l += t10 + a, l &= 65535, _t(m << 16 | d, l << 16 | c, this.unsigned); }; - de.subtract = function(t8) { - return Vr(t8) || (t8 = As(t8)), this.add(t8.neg()); + de.subtract = function(e) { + return jr(e) || (e = Ws(e)), this.add(e.neg()); }; de.sub = de.subtract; - de.multiply = function(t8) { + de.multiply = function(e) { if (this.isZero()) - return To; - if (Vr(t8) || (t8 = As(t8)), ko) { - var e = ko.mul(this.low, this.high, t8.low, t8.high); - return Nt(e, ko.get_high(), this.unsigned); - } - if (t8.isZero()) - return To; - if (this.eq(zr)) - return t8.isOdd() ? zr : To; - if (t8.eq(zr)) - return this.isOdd() ? zr : To; + return Zo; + if (jr(e) || (e = Ws(e)), Yo) { + var t10 = Yo.mul(this.low, this.high, e.low, e.high); + return _t(t10, Yo.get_high(), this.unsigned); + } + if (e.isZero()) + return Zo; + if (this.eq(qr)) + return e.isOdd() ? qr : Zo; + if (e.eq(qr)) + return this.isOdd() ? qr : Zo; if (this.isNegative()) - return t8.isNegative() ? this.neg().mul(t8.neg()) : this.neg().mul(t8).neg(); - if (t8.isNegative()) - return this.mul(t8.neg()).neg(); - if (this.lt(O0) && t8.lt(O0)) - return No(this.toNumber() * t8.toNumber(), this.unsigned); - var o = this.high >>> 16, n = this.high & 65535, s = this.low >>> 16, a = this.low & 65535, i = t8.high >>> 16, p = t8.high & 65535, u = t8.low >>> 16, c = t8.low & 65535, l = 0, m = 0, d = 0, f = 0; - return f += a * c, d += f >>> 16, f &= 65535, d += s * c, m += d >>> 16, d &= 65535, d += a * u, m += d >>> 16, d &= 65535, m += n * c, l += m >>> 16, m &= 65535, m += s * u, l += m >>> 16, m &= 65535, m += a * p, l += m >>> 16, m &= 65535, l += o * c + n * u + s * p + a * i, l &= 65535, Nt(d << 16 | f, l << 16 | m, this.unsigned); + return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg(); + if (e.isNegative()) + return this.mul(e.neg()).neg(); + if (this.lt(Sk) && e.lt(Sk)) + return Qo(this.toNumber() * e.toNumber(), this.unsigned); + var o = this.high >>> 16, n = this.high & 65535, s = this.low >>> 16, a = this.low & 65535, i = e.high >>> 16, p = e.high & 65535, u = e.low >>> 16, l = e.low & 65535, c = 0, m = 0, d = 0, f = 0; + return f += a * l, d += f >>> 16, f &= 65535, d += s * l, m += d >>> 16, d &= 65535, d += a * u, m += d >>> 16, d &= 65535, m += n * l, c += m >>> 16, m &= 65535, m += s * u, c += m >>> 16, m &= 65535, m += a * p, c += m >>> 16, m &= 65535, c += o * l + n * u + s * p + a * i, c &= 65535, _t(d << 16 | f, c << 16 | m, this.unsigned); }; de.mul = de.multiply; - de.divide = function(t8) { - if (Vr(t8) || (t8 = As(t8)), t8.isZero()) + de.divide = function(e) { + if (jr(e) || (e = Ws(e)), e.isZero()) throw Error("division by zero"); - if (ko) { - if (!this.unsigned && this.high === -2147483648 && t8.low === -1 && t8.high === -1) + if (Yo) { + if (!this.unsigned && this.high === -2147483648 && e.low === -1 && e.high === -1) return this; - var e = (this.unsigned ? ko.div_u : ko.div_s)(this.low, this.high, t8.low, t8.high); - return Nt(e, ko.get_high(), this.unsigned); + var t10 = (this.unsigned ? Yo.div_u : Yo.div_s)(this.low, this.high, e.low, e.high); + return _t(t10, Yo.get_high(), this.unsigned); } if (this.isZero()) - return this.unsigned ? Ru : To; + return this.unsigned ? Bu : Zo; var o, n, s; if (this.unsigned) { - if (t8.unsigned || (t8 = t8.toUnsigned()), t8.gt(this)) - return Ru; - if (t8.gt(this.shru(1))) - return L0; - s = Ru; + if (e.unsigned || (e = e.toUnsigned()), e.gt(this)) + return Bu; + if (e.gt(this.shru(1))) + return vk; + s = Bu; } else { - if (this.eq(zr)) { - if (t8.eq(jp) || t8.eq(uw)) - return zr; - if (t8.eq(zr)) - return jp; + if (this.eq(qr)) { + if (e.eq(rl) || e.eq(Sw)) + return qr; + if (e.eq(qr)) + return rl; var a = this.shr(1); - return o = a.div(t8).shl(1), o.eq(To) ? t8.isNegative() ? jp : uw : (n = this.sub(t8.mul(o)), s = o.add(n.div(t8)), s); - } else if (t8.eq(zr)) - return this.unsigned ? Ru : To; + return o = a.div(e).shl(1), o.eq(Zo) ? e.isNegative() ? rl : Sw : (n = this.sub(e.mul(o)), s = o.add(n.div(e)), s); + } else if (e.eq(qr)) + return this.unsigned ? Bu : Zo; if (this.isNegative()) - return t8.isNegative() ? this.neg().div(t8.neg()) : this.neg().div(t8).neg(); - if (t8.isNegative()) - return this.div(t8.neg()).neg(); - s = To; + return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg(); + if (e.isNegative()) + return this.div(e.neg()).neg(); + s = Zo; } - for (n = this; n.gte(t8); ) { - o = Math.max(1, Math.floor(n.toNumber() / t8.toNumber())); - for (var i = Math.ceil(Math.log(o) / Math.LN2), p = i <= 48 ? 1 : Ym(2, i - 48), u = No(o), c = u.mul(t8); c.isNegative() || c.gt(n); ) - o -= p, u = No(o, this.unsigned), c = u.mul(t8); - u.isZero() && (u = jp), s = s.add(u), n = n.sub(c); + for (n = this; n.gte(e); ) { + o = Math.max(1, Math.floor(n.toNumber() / e.toNumber())); + for (var i = Math.ceil(Math.log(o) / Math.LN2), p = i <= 48 ? 1 : ud(2, i - 48), u = Qo(o), l = u.mul(e); l.isNegative() || l.gt(n); ) + o -= p, u = Qo(o, this.unsigned), l = u.mul(e); + u.isZero() && (u = rl), s = s.add(u), n = n.sub(l); } return s; }; de.div = de.divide; - de.modulo = function(t8) { - if (Vr(t8) || (t8 = As(t8)), ko) { - var e = (this.unsigned ? ko.rem_u : ko.rem_s)(this.low, this.high, t8.low, t8.high); - return Nt(e, ko.get_high(), this.unsigned); + de.modulo = function(e) { + if (jr(e) || (e = Ws(e)), Yo) { + var t10 = (this.unsigned ? Yo.rem_u : Yo.rem_s)(this.low, this.high, e.low, e.high); + return _t(t10, Yo.get_high(), this.unsigned); } - return this.sub(this.div(t8).mul(t8)); + return this.sub(this.div(e).mul(e)); }; de.mod = de.modulo; de.rem = de.modulo; de.not = function() { - return Nt(~this.low, ~this.high, this.unsigned); + return _t(~this.low, ~this.high, this.unsigned); }; - de.and = function(t8) { - return Vr(t8) || (t8 = As(t8)), Nt(this.low & t8.low, this.high & t8.high, this.unsigned); + de.and = function(e) { + return jr(e) || (e = Ws(e)), _t(this.low & e.low, this.high & e.high, this.unsigned); }; - de.or = function(t8) { - return Vr(t8) || (t8 = As(t8)), Nt(this.low | t8.low, this.high | t8.high, this.unsigned); + de.or = function(e) { + return jr(e) || (e = Ws(e)), _t(this.low | e.low, this.high | e.high, this.unsigned); }; - de.xor = function(t8) { - return Vr(t8) || (t8 = As(t8)), Nt(this.low ^ t8.low, this.high ^ t8.high, this.unsigned); + de.xor = function(e) { + return jr(e) || (e = Ws(e)), _t(this.low ^ e.low, this.high ^ e.high, this.unsigned); }; - de.shiftLeft = function(t8) { - return Vr(t8) && (t8 = t8.toInt()), (t8 &= 63) === 0 ? this : t8 < 32 ? Nt(this.low << t8, this.high << t8 | this.low >>> 32 - t8, this.unsigned) : Nt(0, this.low << t8 - 32, this.unsigned); + de.shiftLeft = function(e) { + return jr(e) && (e = e.toInt()), (e &= 63) === 0 ? this : e < 32 ? _t(this.low << e, this.high << e | this.low >>> 32 - e, this.unsigned) : _t(0, this.low << e - 32, this.unsigned); }; de.shl = de.shiftLeft; - de.shiftRight = function(t8) { - return Vr(t8) && (t8 = t8.toInt()), (t8 &= 63) === 0 ? this : t8 < 32 ? Nt(this.low >>> t8 | this.high << 32 - t8, this.high >> t8, this.unsigned) : Nt(this.high >> t8 - 32, this.high >= 0 ? 0 : -1, this.unsigned); + de.shiftRight = function(e) { + return jr(e) && (e = e.toInt()), (e &= 63) === 0 ? this : e < 32 ? _t(this.low >>> e | this.high << 32 - e, this.high >> e, this.unsigned) : _t(this.high >> e - 32, this.high >= 0 ? 0 : -1, this.unsigned); }; de.shr = de.shiftRight; - de.shiftRightUnsigned = function(t8) { - if (Vr(t8) && (t8 = t8.toInt()), t8 &= 63, t8 === 0) + de.shiftRightUnsigned = function(e) { + if (jr(e) && (e = e.toInt()), e &= 63, e === 0) return this; - var e = this.high; - if (t8 < 32) { + var t10 = this.high; + if (e < 32) { var o = this.low; - return Nt(o >>> t8 | e << 32 - t8, e >>> t8, this.unsigned); + return _t(o >>> e | t10 << 32 - e, t10 >>> e, this.unsigned); } else - return t8 === 32 ? Nt(e, 0, this.unsigned) : Nt(e >>> t8 - 32, 0, this.unsigned); + return e === 32 ? _t(t10, 0, this.unsigned) : _t(t10 >>> e - 32, 0, this.unsigned); }; de.shru = de.shiftRightUnsigned; de.shr_u = de.shiftRightUnsigned; de.toSigned = function() { - return this.unsigned ? Nt(this.low, this.high, false) : this; + return this.unsigned ? _t(this.low, this.high, false) : this; }; de.toUnsigned = function() { - return this.unsigned ? this : Nt(this.low, this.high, true); + return this.unsigned ? this : _t(this.low, this.high, true); }; - de.toBytes = function(t8) { - return t8 ? this.toBytesLE() : this.toBytesBE(); + de.toBytes = function(e) { + return e ? this.toBytesLE() : this.toBytesBE(); }; de.toBytesLE = function() { - var t8 = this.high, e = this.low; - return [e & 255, e >>> 8 & 255, e >>> 16 & 255, e >>> 24, t8 & 255, t8 >>> 8 & 255, t8 >>> 16 & 255, t8 >>> 24]; + var e = this.high, t10 = this.low; + return [t10 & 255, t10 >>> 8 & 255, t10 >>> 16 & 255, t10 >>> 24, e & 255, e >>> 8 & 255, e >>> 16 & 255, e >>> 24]; }; de.toBytesBE = function() { - var t8 = this.high, e = this.low; - return [t8 >>> 24, t8 >>> 16 & 255, t8 >>> 8 & 255, t8 & 255, e >>> 24, e >>> 16 & 255, e >>> 8 & 255, e & 255]; + var e = this.high, t10 = this.low; + return [e >>> 24, e >>> 16 & 255, e >>> 8 & 255, e & 255, t10 >>> 24, t10 >>> 16 & 255, t10 >>> 8 & 255, t10 & 255]; }; - kt.fromBytes = function(t8, e, o) { - return o ? kt.fromBytesLE(t8, e) : kt.fromBytesBE(t8, e); + Tt.fromBytes = function(e, t10, o) { + return o ? Tt.fromBytesLE(e, t10) : Tt.fromBytesBE(e, t10); }; - kt.fromBytesLE = function(t8, e) { - return new kt(t8[0] | t8[1] << 8 | t8[2] << 16 | t8[3] << 24, t8[4] | t8[5] << 8 | t8[6] << 16 | t8[7] << 24, e); + Tt.fromBytesLE = function(e, t10) { + return new Tt(e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24, e[4] | e[5] << 8 | e[6] << 16 | e[7] << 24, t10); }; - kt.fromBytesBE = function(t8, e) { - return new kt(t8[4] << 24 | t8[5] << 16 | t8[6] << 8 | t8[7], t8[0] << 24 | t8[1] << 16 | t8[2] << 8 | t8[3], e); + Tt.fromBytesBE = function(e, t10) { + return new Tt(e[4] << 24 | e[5] << 16 | e[6] << 8 | e[7], e[0] << 24 | e[1] << 16 | e[2] << 8 | e[3], t10); }; }); -var vk = Kt(() => { +var f1 = jt(() => { }); -var kk = Kt(() => { +var h1 = jt(() => { }); -var Z2 = Kt((Q2, Vw) => { - (function(r15, t8, e) { +var W2 = jt((V2, tS) => { + (function(r16, e, t10) { function o(i) { var p = this, u = a(); p.next = function() { - var c = 2091639 * p.s0 + p.c * 23283064365386963e-26; - return p.s0 = p.s1, p.s1 = p.s2, p.s2 = c - (p.c = c | 0); + var l = 2091639 * p.s0 + p.c * 23283064365386963e-26; + return p.s0 = p.s1, p.s1 = p.s2, p.s2 = l - (p.c = l | 0); }, p.c = 1, p.s0 = u(" "), p.s1 = u(" "), p.s2 = u(" "), p.s0 -= u(i), p.s0 < 0 && (p.s0 += 1), p.s1 -= u(i), p.s1 < 0 && (p.s1 += 1), p.s2 -= u(i), p.s2 < 0 && (p.s2 += 1), u = null; } function n(i, p) { return p.c = i.c, p.s0 = i.s0, p.s1 = i.s1, p.s2 = i.s2, p; } function s(i, p) { - var u = new o(i), c = p && p.state, l = u.next; - return l.int32 = function() { + var u = new o(i), l = p && p.state, c = u.next; + return c.int32 = function() { return u.next() * 4294967296 | 0; - }, l.double = function() { - return l() + (l() * 2097152 | 0) * 11102230246251565e-32; - }, l.quick = l, c && (typeof c == "object" && n(c, u), l.state = function() { + }, c.double = function() { + return c() + (c() * 2097152 | 0) * 11102230246251565e-32; + }, c.quick = c, l && (typeof l == "object" && n(l, u), c.state = function() { return n(u, {}); - }), l; + }), c; } function a() { var i = 4022871197, p = function(u) { u = String(u); - for (var c = 0; c < u.length; c++) { - i += u.charCodeAt(c); - var l = 0.02519603282416938 * i; - i = l >>> 0, l -= i, l *= i, i = l >>> 0, l -= i, i += l * 4294967296; + for (var l = 0; l < u.length; l++) { + i += u.charCodeAt(l); + var c = 0.02519603282416938 * i; + i = c >>> 0, c -= i, c *= i, i = c >>> 0, c -= i, i += c * 4294967296; } return (i >>> 0) * 23283064365386963e-26; }; return p; } - t8 && t8.exports ? t8.exports = s : e && e.amd ? e(function() { + e && e.exports ? e.exports = s : t10 && t10.amd ? t10(function() { return s; }) : this.alea = s; - })(Q2, typeof Vw == "object" && Vw, typeof define == "function" && define); + })(V2, typeof tS == "object" && tS, typeof define == "function" && define); }); -var e1 = Kt((J2, Ww) => { - (function(r15, t8, e) { +var G2 = jt((U2, rS) => { + (function(r16, e, t10) { function o(a) { var i = this, p = ""; i.x = 0, i.y = 0, i.z = 0, i.w = 0, i.next = function() { - var c = i.x ^ i.x << 11; - return i.x = i.y, i.y = i.z, i.z = i.w, i.w ^= i.w >>> 19 ^ c ^ c >>> 8; + var l = i.x ^ i.x << 11; + return i.x = i.y, i.y = i.z, i.z = i.w, i.w ^= i.w >>> 19 ^ l ^ l >>> 8; }, a === (a | 0) ? i.x = a : p += a; for (var u = 0; u < p.length + 64; u++) i.x ^= p.charCodeAt(u) | 0, i.next(); @@ -940,30 +940,30 @@ var e1 = Kt((J2, Ww) => { return i.x = a.x, i.y = a.y, i.z = a.z, i.w = a.w, i; } function s(a, i) { - var p = new o(a), u = i && i.state, c = function() { + var p = new o(a), u = i && i.state, l = function() { return (p.next() >>> 0) / 4294967296; }; - return c.double = function() { + return l.double = function() { do - var l = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (l + m) / (1 << 21); + var c = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (c + m) / (1 << 21); while (d === 0); return d; - }, c.int32 = p.next, c.quick = c, u && (typeof u == "object" && n(u, p), c.state = function() { + }, l.int32 = p.next, l.quick = l, u && (typeof u == "object" && n(u, p), l.state = function() { return n(p, {}); - }), c; + }), l; } - t8 && t8.exports ? t8.exports = s : e && e.amd ? e(function() { + e && e.exports ? e.exports = s : t10 && t10.amd ? t10(function() { return s; }) : this.xor128 = s; - })(J2, typeof Ww == "object" && Ww, typeof define == "function" && define); + })(U2, typeof rS == "object" && rS, typeof define == "function" && define); }); -var r1 = Kt((t1, Uw) => { - (function(r15, t8, e) { +var K2 = jt((H2, oS) => { + (function(r16, e, t10) { function o(a) { var i = this, p = ""; i.next = function() { - var c = i.x ^ i.x >>> 2; - return i.x = i.y, i.y = i.z, i.z = i.w, i.w = i.v, (i.d = i.d + 362437 | 0) + (i.v = i.v ^ i.v << 4 ^ (c ^ c << 1)) | 0; + var l = i.x ^ i.x >>> 2; + return i.x = i.y, i.y = i.z, i.z = i.w, i.w = i.v, (i.d = i.d + 362437 | 0) + (i.v = i.v ^ i.v << 4 ^ (l ^ l << 1)) | 0; }, i.x = 0, i.y = 0, i.z = 0, i.w = 0, i.v = 0, a === (a | 0) ? i.x = a : p += a; for (var u = 0; u < p.length + 64; u++) i.x ^= p.charCodeAt(u) | 0, u == p.length && (i.d = i.x << 10 ^ i.x >>> 4), i.next(); @@ -972,43 +972,43 @@ var r1 = Kt((t1, Uw) => { return i.x = a.x, i.y = a.y, i.z = a.z, i.w = a.w, i.v = a.v, i.d = a.d, i; } function s(a, i) { - var p = new o(a), u = i && i.state, c = function() { + var p = new o(a), u = i && i.state, l = function() { return (p.next() >>> 0) / 4294967296; }; - return c.double = function() { + return l.double = function() { do - var l = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (l + m) / (1 << 21); + var c = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (c + m) / (1 << 21); while (d === 0); return d; - }, c.int32 = p.next, c.quick = c, u && (typeof u == "object" && n(u, p), c.state = function() { + }, l.int32 = p.next, l.quick = l, u && (typeof u == "object" && n(u, p), l.state = function() { return n(p, {}); - }), c; + }), l; } - t8 && t8.exports ? t8.exports = s : e && e.amd ? e(function() { + e && e.exports ? e.exports = s : t10 && t10.amd ? t10(function() { return s; }) : this.xorwow = s; - })(t1, typeof Uw == "object" && Uw, typeof define == "function" && define); + })(H2, typeof oS == "object" && oS, typeof define == "function" && define); }); -var n1 = Kt((o1, Gw) => { - (function(r15, t8, e) { +var j2 = jt((q2, nS) => { + (function(r16, e, t10) { function o(a) { var i = this; i.next = function() { - var u = i.x, c = i.i, l, m, d; - return l = u[c], l ^= l >>> 7, m = l ^ l << 24, l = u[c + 1 & 7], m ^= l ^ l >>> 10, l = u[c + 3 & 7], m ^= l ^ l >>> 3, l = u[c + 4 & 7], m ^= l ^ l << 7, l = u[c + 7 & 7], l = l ^ l << 13, m ^= l ^ l << 9, u[c] = m, i.i = c + 1 & 7, m; + var u = i.x, l = i.i, c, m, d; + return c = u[l], c ^= c >>> 7, m = c ^ c << 24, c = u[l + 1 & 7], m ^= c ^ c >>> 10, c = u[l + 3 & 7], m ^= c ^ c >>> 3, c = u[l + 4 & 7], m ^= c ^ c << 7, c = u[l + 7 & 7], c = c ^ c << 13, m ^= c ^ c << 9, u[l] = m, i.i = l + 1 & 7, m; }; - function p(u, c) { - var l, m, d = []; - if (c === (c | 0)) - m = d[0] = c; + function p(u, l) { + var c, m, d = []; + if (l === (l | 0)) + m = d[0] = l; else - for (c = "" + c, l = 0; l < c.length; ++l) - d[l & 7] = d[l & 7] << 15 ^ c.charCodeAt(l) + d[l + 1 & 7] << 13; + for (l = "" + l, c = 0; c < l.length; ++c) + d[c & 7] = d[c & 7] << 15 ^ l.charCodeAt(c) + d[c + 1 & 7] << 13; for (; d.length < 8; ) d.push(0); - for (l = 0; l < 8 && d[l] === 0; ++l) + for (c = 0; c < 8 && d[c] === 0; ++c) ; - for (l == 8 ? m = d[7] = -1 : m = d[l], u.x = d, u.i = 0, l = 256; l > 0; --l) + for (c == 8 ? m = d[7] = -1 : m = d[c], u.x = d, u.i = 0, c = 256; c > 0; --c) u.next(); } p(i, a); @@ -1018,37 +1018,37 @@ var n1 = Kt((o1, Gw) => { } function s(a, i) { a == null && (a = +/* @__PURE__ */ new Date()); - var p = new o(a), u = i && i.state, c = function() { + var p = new o(a), u = i && i.state, l = function() { return (p.next() >>> 0) / 4294967296; }; - return c.double = function() { + return l.double = function() { do - var l = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (l + m) / (1 << 21); + var c = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (c + m) / (1 << 21); while (d === 0); return d; - }, c.int32 = p.next, c.quick = c, u && (u.x && n(u, p), c.state = function() { + }, l.int32 = p.next, l.quick = l, u && (u.x && n(u, p), l.state = function() { return n(p, {}); - }), c; + }), l; } - t8 && t8.exports ? t8.exports = s : e && e.amd ? e(function() { + e && e.exports ? e.exports = s : t10 && t10.amd ? t10(function() { return s; }) : this.xorshift7 = s; - })(o1, typeof Gw == "object" && Gw, typeof define == "function" && define); + })(q2, typeof nS == "object" && nS, typeof define == "function" && define); }); -var a1 = Kt((s1, Hw) => { - (function(r15, t8, e) { +var Y2 = jt((X2, sS) => { + (function(r16, e, t10) { function o(a) { var i = this; i.next = function() { - var u = i.w, c = i.X, l = i.i, m, d; - return i.w = u = u + 1640531527 | 0, d = c[l + 34 & 127], m = c[l = l + 1 & 127], d ^= d << 13, m ^= m << 17, d ^= d >>> 15, m ^= m >>> 12, d = c[l] = d ^ m, i.i = l, d + (u ^ u >>> 16) | 0; + var u = i.w, l = i.X, c = i.i, m, d; + return i.w = u = u + 1640531527 | 0, d = l[c + 34 & 127], m = l[c = c + 1 & 127], d ^= d << 13, m ^= m << 17, d ^= d >>> 15, m ^= m >>> 12, d = l[c] = d ^ m, i.i = c, d + (u ^ u >>> 16) | 0; }; - function p(u, c) { - var l, m, d, f, h, g = [], x = 128; - for (c === (c | 0) ? (m = c, c = null) : (c = c + "\0", m = 0, x = Math.max(x, c.length)), d = 0, f = -32; f < x; ++f) - c && (m ^= c.charCodeAt((f + 32) % c.length)), f === 0 && (h = m), m ^= m << 10, m ^= m >>> 15, m ^= m << 4, m ^= m >>> 13, f >= 0 && (h = h + 1640531527 | 0, l = g[f & 127] ^= m + h, d = l == 0 ? d + 1 : 0); - for (d >= 128 && (g[(c && c.length || 0) & 127] = -1), d = 127, f = 4 * 128; f > 0; --f) - m = g[d + 34 & 127], l = g[d = d + 1 & 127], m ^= m << 13, l ^= l << 17, m ^= m >>> 15, l ^= l >>> 12, g[d] = m ^ l; + function p(u, l) { + var c, m, d, f, h, g = [], x = 128; + for (l === (l | 0) ? (m = l, l = null) : (l = l + "\0", m = 0, x = Math.max(x, l.length)), d = 0, f = -32; f < x; ++f) + l && (m ^= l.charCodeAt((f + 32) % l.length)), f === 0 && (h = m), m ^= m << 10, m ^= m >>> 15, m ^= m << 4, m ^= m >>> 13, f >= 0 && (h = h + 1640531527 | 0, c = g[f & 127] ^= m + h, d = c == 0 ? d + 1 : 0); + for (d >= 128 && (g[(l && l.length || 0) & 127] = -1), d = 127, f = 4 * 128; f > 0; --f) + m = g[d + 34 & 127], c = g[d = d + 1 & 127], m ^= m << 13, c ^= c << 17, m ^= m >>> 15, c ^= c >>> 12, g[d] = m ^ c; u.w = h, u.X = g, u.i = d; } p(i, a); @@ -1058,30 +1058,30 @@ var a1 = Kt((s1, Hw) => { } function s(a, i) { a == null && (a = +/* @__PURE__ */ new Date()); - var p = new o(a), u = i && i.state, c = function() { + var p = new o(a), u = i && i.state, l = function() { return (p.next() >>> 0) / 4294967296; }; - return c.double = function() { + return l.double = function() { do - var l = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (l + m) / (1 << 21); + var c = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (c + m) / (1 << 21); while (d === 0); return d; - }, c.int32 = p.next, c.quick = c, u && (u.X && n(u, p), c.state = function() { + }, l.int32 = p.next, l.quick = l, u && (u.X && n(u, p), l.state = function() { return n(p, {}); - }), c; + }), l; } - t8 && t8.exports ? t8.exports = s : e && e.amd ? e(function() { + e && e.exports ? e.exports = s : t10 && t10.amd ? t10(function() { return s; }) : this.xor4096 = s; - })(s1, typeof Hw == "object" && Hw, typeof define == "function" && define); + })(X2, typeof sS == "object" && sS, typeof define == "function" && define); }); -var u1 = Kt((i1, Kw) => { - (function(r15, t8, e) { +var Z2 = jt((Q2, aS) => { + (function(r16, e, t10) { function o(a) { var i = this, p = ""; i.next = function() { - var c = i.b, l = i.c, m = i.d, d = i.a; - return c = c << 25 ^ c >>> 7 ^ l, l = l - m | 0, m = m << 24 ^ m >>> 8 ^ d, d = d - c | 0, i.b = c = c << 20 ^ c >>> 12 ^ l, i.c = l = l - m | 0, i.d = m << 16 ^ l >>> 16 ^ d, i.a = d - c | 0; + var l = i.b, c = i.c, m = i.d, d = i.a; + return l = l << 25 ^ l >>> 7 ^ c, c = c - m | 0, m = m << 24 ^ m >>> 8 ^ d, d = d - l | 0, i.b = l = l << 20 ^ l >>> 12 ^ c, i.c = c = c - m | 0, i.d = m << 16 ^ c >>> 16 ^ d, i.a = d - l | 0; }, i.a = 0, i.b = 0, i.c = -1640531527, i.d = 1367130551, a === Math.floor(a) ? (i.a = a / 4294967296 | 0, i.b = a | 0) : p += a; for (var u = 0; u < p.length + 20; u++) i.b ^= p.charCodeAt(u) | 0, i.next(); @@ -1090,1094 +1090,1094 @@ var u1 = Kt((i1, Kw) => { return i.a = a.a, i.b = a.b, i.c = a.c, i.d = a.d, i; } function s(a, i) { - var p = new o(a), u = i && i.state, c = function() { + var p = new o(a), u = i && i.state, l = function() { return (p.next() >>> 0) / 4294967296; }; - return c.double = function() { + return l.double = function() { do - var l = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (l + m) / (1 << 21); + var c = p.next() >>> 11, m = (p.next() >>> 0) / 4294967296, d = (c + m) / (1 << 21); while (d === 0); return d; - }, c.int32 = p.next, c.quick = c, u && (typeof u == "object" && n(u, p), c.state = function() { + }, l.int32 = p.next, l.quick = l, u && (typeof u == "object" && n(u, p), l.state = function() { return n(p, {}); - }), c; + }), l; } - t8 && t8.exports ? t8.exports = s : e && e.amd ? e(function() { + e && e.exports ? e.exports = s : t10 && t10.amd ? t10(function() { return s; }) : this.tychei = s; - })(i1, typeof Kw == "object" && Kw, typeof define == "function" && define); + })(Q2, typeof aS == "object" && aS, typeof define == "function" && define); }); -var p1 = Kt(() => { +var J2 = jt(() => { }); -var l1 = Kt((c1, Od) => { - (function(r15, t8, e) { - var o = 256, n = 6, s = 52, a = "random", i = e.pow(o, n), p = e.pow(2, s), u = p * 2, c = o - 1, l; - function m(C, S, k) { - var _ = []; +var tN = jt((eN, qd) => { + (function(r16, e, t10) { + var o = 256, n = 6, s = 52, a = "random", i = t10.pow(o, n), p = t10.pow(2, s), u = p * 2, l = o - 1, c; + function m(w, S, k) { + var T = []; S = S == true ? { entropy: true } : S || {}; - var E = g(h(S.entropy ? [C, b(t8)] : C == null ? x() : C, 3), _), R = new d(_), D = function() { - for (var P = R.g(n), O = i, M = 0; P < p; ) - P = (P + M) * o, O *= o, M = R.g(1); - for (; P >= u; ) - P /= 2, O /= 2, M >>>= 1; - return (P + M) / O; + var E = g(h(S.entropy ? [w, b(e)] : w == null ? x() : w, 3), T), R = new d(T), D = function() { + for (var F = R.g(n), O = i, M = 0; F < p; ) + F = (F + M) * o, O *= o, M = R.g(1); + for (; F >= u; ) + F /= 2, O /= 2, M >>>= 1; + return (F + M) / O; }; return D.int32 = function() { return R.g(4) | 0; }, D.quick = function() { return R.g(4) / 4294967296; - }, D.double = D, g(b(R.S), t8), (S.pass || k || function(P, O, M, L) { - return L && (L.S && f(L, R), P.state = function() { + }, D.double = D, g(b(R.S), e), (S.pass || k || function(F, O, M, L) { + return L && (L.S && f(L, R), F.state = function() { return f(R, {}); - }), M ? (e[a] = P, O) : P; - })(D, E, "global" in S ? S.global : this == e, S.state); + }), M ? (t10[a] = F, O) : F; + })(D, E, "global" in S ? S.global : this == t10, S.state); } - function d(C) { - var S, k = C.length, _ = this, E = 0, R = _.i = _.j = 0, D = _.S = []; - for (k || (C = [k++]); E < o; ) + function d(w) { + var S, k = w.length, T = this, E = 0, R = T.i = T.j = 0, D = T.S = []; + for (k || (w = [k++]); E < o; ) D[E] = E++; for (E = 0; E < o; E++) - D[E] = D[R = c & R + C[E % k] + (S = D[E])], D[R] = S; - (_.g = function(P) { - for (var O, M = 0, L = _.i, B = _.j, z = _.S; P--; ) - O = z[L = c & L + 1], M = M * o + z[c & (z[L] = z[B = c & B + O]) + (z[B] = O)]; - return _.i = L, _.j = B, M; + D[E] = D[R = l & R + w[E % k] + (S = D[E])], D[R] = S; + (T.g = function(F) { + for (var O, M = 0, L = T.i, B = T.j, z = T.S; F--; ) + O = z[L = l & L + 1], M = M * o + z[l & (z[L] = z[B = l & B + O]) + (z[B] = O)]; + return T.i = L, T.j = B, M; })(o); } - function f(C, S) { - return S.i = C.i, S.j = C.j, S.S = C.S.slice(), S; + function f(w, S) { + return S.i = w.i, S.j = w.j, S.S = w.S.slice(), S; } - function h(C, S) { - var k = [], _ = typeof C, E; - if (S && _ == "object") - for (E in C) + function h(w, S) { + var k = [], T = typeof w, E; + if (S && T == "object") + for (E in w) try { - k.push(h(C[E], S - 1)); + k.push(h(w[E], S - 1)); } catch (R) { } - return k.length ? k : _ == "string" ? C : C + "\0"; + return k.length ? k : T == "string" ? w : w + "\0"; } - function g(C, S) { - for (var k = C + "", _, E = 0; E < k.length; ) - S[c & E] = c & (_ ^= S[c & E] * 19) + k.charCodeAt(E++); + function g(w, S) { + for (var k = w + "", T, E = 0; E < k.length; ) + S[l & E] = l & (T ^= S[l & E] * 19) + k.charCodeAt(E++); return b(S); } function x() { try { - var C; - return l && (C = l.randomBytes) ? C = C(o) : (C = new Uint8Array(o), (r15.crypto || r15.msCrypto).getRandomValues(C)), b(C); - } catch (_) { - var S = r15.navigator, k = S && S.plugins; - return [+/* @__PURE__ */ new Date(), r15, k, r15.screen, b(t8)]; + var w; + return c && (w = c.randomBytes) ? w = w(o) : (w = new Uint8Array(o), (r16.crypto || r16.msCrypto).getRandomValues(w)), b(w); + } catch (T) { + var S = r16.navigator, k = S && S.plugins; + return [+/* @__PURE__ */ new Date(), r16, k, r16.screen, b(e)]; } } - function b(C) { - return String.fromCharCode.apply(0, C); + function b(w) { + return String.fromCharCode.apply(0, w); } - if (g(e.random(), t8), typeof Od == "object" && Od.exports) { - Od.exports = m; + if (g(t10.random(), e), typeof qd == "object" && qd.exports) { + qd.exports = m; try { - l = p1(); - } catch (C) { + c = J2(); + } catch (w) { } } else typeof define == "function" && define.amd ? define(function() { return m; - }) : e["seed" + a] = m; - })(typeof self != "undefined" ? self : c1, [], Math); + }) : t10["seed" + a] = m; + })(typeof self != "undefined" ? self : eN, [], Math); }); -var qw = Kt((Y2e, m1) => { - var vq = Z2(), kq = e1(), Nq = r1(), Tq = n1(), _q = a1(), $q = u1(), Gu = l1(); - Gu.alea = vq; - Gu.xor128 = kq; - Gu.xorwow = Nq; - Gu.xorshift7 = Tq; - Gu.xor4096 = _q; - Gu.tychei = $q; - m1.exports = Gu; +var iS = jt((FNe, rN) => { + var Q6 = W2(), Z6 = G2(), J6 = K2(), ej = j2(), tj = Y2(), rj = Z2(), Zu = tN(); + Zu.alea = Q6; + Zu.xor128 = Z6; + Zu.xorwow = J6; + Zu.xorshift7 = ej; + Zu.xor4096 = tj; + Zu.tychei = rj; + rN.exports = Zu; }); -var zv = Kt(() => { +var ev = jt(() => { }); -var Vv = Kt(() => { +var tv = jt(() => { }); -var DB = Kt(() => { +var Iz = jt(() => { }); -var AB = Kt(() => { +var vz = jt(() => { }); -var FB = Kt(() => { +var kz = jt(() => { }); -var PB = Kt((Vg, Uv) => { - var Wv = (() => { - var r15 = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0; - return typeof __filename != "undefined" && (r15 = r15 || __filename), function(t8) { - t8 = t8 || {}; - function e() { - return oe.buffer != Ge && Tt(oe.buffer), lt; +var Nz = jt((Jg, ov) => { + var rv = (() => { + var r16 = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0; + return typeof __filename != "undefined" && (r16 = r16 || __filename), function(e) { + e = e || {}; + function t10() { + return oe.buffer != Ke && Et(oe.buffer), mt; } function o() { - return oe.buffer != Ge && Tt(oe.buffer), it; + return oe.buffer != Ke && Et(oe.buffer), ut; } function n() { - return oe.buffer != Ge && Tt(oe.buffer), ht; + return oe.buffer != Ke && Et(oe.buffer), gt; } function s() { - return oe.buffer != Ge && Tt(oe.buffer), Mr; + return oe.buffer != Ke && Et(oe.buffer), Ur; } function a() { - return oe.buffer != Ge && Tt(oe.buffer), Mt; + return oe.buffer != Ke && Et(oe.buffer), Bt; } function i() { - return oe.buffer != Ge && Tt(oe.buffer), eo; + return oe.buffer != Ke && Et(oe.buffer), io; } function p() { - return oe.buffer != Ge && Tt(oe.buffer), rr; + return oe.buffer != Ke && Et(oe.buffer), sr; } - var u = typeof t8 != "undefined" ? t8 : {}, c, l; - u.ready = new Promise(function(F, V) { - c = F, l = V; + var u = typeof e != "undefined" ? e : {}, l, c; + u.ready = new Promise(function(P, V) { + l = P, c = V; }); var m; typeof process != "undefined" && process.listeners && (m = { uncaughtException: process.listeners("uncaughtException"), unhandledRejection: process.listeners("unhandledRejection") }); - var d = Object.assign({}, u), f = [], h = "./this.program", g = (F, V) => { + var d = Object.assign({}, u), f = [], h = "./this.program", g = (P, V) => { throw V; - }, x = typeof window == "object", b = typeof importScripts == "function", C = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", S = u.ENVIRONMENT_IS_PTHREAD || false, k = ""; - function _(F) { - return u.locateFile ? u.locateFile(F, k) : k + F; + }, x = typeof window == "object", b = typeof importScripts == "function", w = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", S = u.ENVIRONMENT_IS_PTHREAD || false, k = ""; + function T(P) { + return u.locateFile ? u.locateFile(P, k) : k + P; } - var E, R, D, P; - function O(F) { - if (F instanceof Iu) + var E, R, D, F; + function O(P) { + if (P instanceof Du) return; - j("exiting due to exception: " + F); - } - if (C) { - var M = zv(), L = Vv(); - b ? k = L.dirname(k) + "/" : k = __dirname + "/", E = (V, ue) => (V = Dp(V) ? new URL(V) : L.normalize(V), M.readFileSync(V, ue ? void 0 : "utf8")), D = (V) => { - var ue = E(V, true); - return ue.buffer || (ue = new Uint8Array(ue)), ue; - }, R = (V, ue, Ee) => { - V = Dp(V) ? new URL(V) : L.normalize(V), M.readFile(V, function(Be, Le) { - Be ? Ee(Be) : ue(Le.buffer); + j("exiting due to exception: " + P); + } + if (w) { + var M = ev(), L = tv(); + b ? k = L.dirname(k) + "/" : k = __dirname + "/", E = (V, pe) => (V = zp(V) ? new URL(V) : L.normalize(V), M.readFileSync(V, pe ? void 0 : "utf8")), D = (V) => { + var pe = E(V, true); + return pe.buffer || (pe = new Uint8Array(pe)), pe; + }, R = (V, pe, $e) => { + V = zp(V) ? new URL(V) : L.normalize(V), M.readFile(V, function(Be, Le) { + Be ? $e(Be) : pe(Le.buffer); }); }, process.argv.length > 1 && (h = process.argv[1].replace(/\\/g, "/")), f = process.argv.slice(2), process.on("uncaughtException", function(V) { - if (!(V instanceof Iu)) + if (!(V instanceof Du)) throw V; }), process.on("unhandledRejection", function(V) { throw V; - }), g = (V, ue) => { - if (Lo()) - throw process.exitCode = V, ue; - O(ue), process.exit(V); + }), g = (V, pe) => { + if (cn()) + throw process.exitCode = V, pe; + O(pe), process.exit(V); }, u.inspect = function() { return "[Emscripten Module object]"; }; - let F; + let P; try { - F = DB(); + P = Iz(); } catch (V) { throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'), V; } - global.Worker = F.Worker; + global.Worker = P.Worker; } else - (x || b) && (b ? k = self.location.href : typeof document != "undefined" && document.currentScript && (k = document.currentScript.src), typeof r15 != "undefined" && r15 && (k = r15), k.indexOf("blob:") !== 0 ? k = k.substr(0, k.replace(/[?#].*/, "").lastIndexOf("/") + 1) : k = "", C || (E = (F) => { + (x || b) && (b ? k = self.location.href : typeof document != "undefined" && document.currentScript && (k = document.currentScript.src), typeof r16 != "undefined" && r16 && (k = r16), k.indexOf("blob:") !== 0 ? k = k.substr(0, k.replace(/[?#].*/, "").lastIndexOf("/") + 1) : k = "", w || (E = (P) => { var V = new XMLHttpRequest(); - return V.open("GET", F, false), V.send(null), V.responseText; - }, b && (D = (F) => { + return V.open("GET", P, false), V.send(null), V.responseText; + }, b && (D = (P) => { var V = new XMLHttpRequest(); - return V.open("GET", F, false), V.responseType = "arraybuffer", V.send(null), new Uint8Array(V.response); - }), R = (F, V, ue) => { - var Ee = new XMLHttpRequest(); - Ee.open("GET", F, true), Ee.responseType = "arraybuffer", Ee.onload = () => { - if (Ee.status == 200 || Ee.status == 0 && Ee.response) { - V(Ee.response); + return V.open("GET", P, false), V.responseType = "arraybuffer", V.send(null), new Uint8Array(V.response); + }), R = (P, V, pe) => { + var $e = new XMLHttpRequest(); + $e.open("GET", P, true), $e.responseType = "arraybuffer", $e.onload = () => { + if ($e.status == 200 || $e.status == 0 && $e.response) { + V($e.response); return; } - ue(); - }, Ee.onerror = ue, Ee.send(null); - }), P = (F) => document.title = F); - C && typeof performance == "undefined" && (global.performance = AB().performance); + pe(); + }, $e.onerror = pe, $e.send(null); + }), F = (P) => document.title = P); + w && typeof performance == "undefined" && (global.performance = vz().performance); var B = console.log.bind(console), z = console.warn.bind(console); - C && (B = (F) => M.writeSync(1, F + ` -`), z = (F) => M.writeSync(2, F + ` + w && (B = (P) => M.writeSync(1, P + ` +`), z = (P) => M.writeSync(2, P + ` `)); var U = u.print || B, j = u.printErr || z; Object.assign(u, d), d = null, u.arguments && (f = u.arguments), u.thisProgram && (h = u.thisProgram), u.quit && (g = u.quit); var q = 4, Y = Atomics.load, J = Atomics.store, re = Atomics.compareExchange, ne; u.wasmBinary && (ne = u.wasmBinary); var ee = u.noExitRuntime || true; - typeof WebAssembly != "object" && Su("no native wasm support detected"); - var oe, ie, le = false, be; - function _e(F, V) { - F || Su(V); + typeof WebAssembly != "object" && Ru("no native wasm support detected"); + var oe, ue, me = false, be; + function _e(P, V) { + P || Ru(V); } var ve = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : void 0; - function Fe(F, V, ue) { + function Fe(P, V, pe) { V >>>= 0; - for (var Ee = V + ue, Be = V; F[Be] && !(Be >= Ee); ) + for (var $e = V + pe, Be = V; P[Be] && !(Be >= $e); ) ++Be; - if (Be - V > 16 && F.buffer && ve) - return ve.decode(F.buffer instanceof SharedArrayBuffer ? F.slice(V, Be) : F.subarray(V, Be)); + if (Be - V > 16 && P.buffer && ve) + return ve.decode(P.buffer instanceof SharedArrayBuffer ? P.slice(V, Be) : P.subarray(V, Be)); for (var Le = ""; V < Be; ) { - var ge = F[V++]; + var ge = P[V++]; if (!(ge & 128)) { Le += String.fromCharCode(ge); continue; } - var Ne = F[V++] & 63; + var Ne = P[V++] & 63; if ((ge & 224) == 192) { Le += String.fromCharCode((ge & 31) << 6 | Ne); continue; } - var Ft = F[V++] & 63; - if ((ge & 240) == 224 ? ge = (ge & 15) << 12 | Ne << 6 | Ft : ge = (ge & 7) << 18 | Ne << 12 | Ft << 6 | F[V++] & 63, ge < 65536) + var Ot = P[V++] & 63; + if ((ge & 240) == 224 ? ge = (ge & 15) << 12 | Ne << 6 | Ot : ge = (ge & 7) << 18 | Ne << 12 | Ot << 6 | P[V++] & 63, ge < 65536) Le += String.fromCharCode(ge); else { - var no = ge - 65536; - Le += String.fromCharCode(55296 | no >> 10, 56320 | no & 1023); + var co = ge - 65536; + Le += String.fromCharCode(55296 | co >> 10, 56320 | co & 1023); } } return Le; } - function Pe(F, V) { - return F >>>= 0, F ? Fe(o(), F, V) : ""; + function Pe(P, V) { + return P >>>= 0, P ? Fe(o(), P, V) : ""; } - function st(F, V, ue, Ee) { - if (ue >>>= 0, !(Ee > 0)) + function at(P, V, pe, $e) { + if (pe >>>= 0, !($e > 0)) return 0; - for (var Be = ue, Le = ue + Ee - 1, ge = 0; ge < F.length; ++ge) { - var Ne = F.charCodeAt(ge); + for (var Be = pe, Le = pe + $e - 1, ge = 0; ge < P.length; ++ge) { + var Ne = P.charCodeAt(ge); if (Ne >= 55296 && Ne <= 57343) { - var Ft = F.charCodeAt(++ge); - Ne = 65536 + ((Ne & 1023) << 10) | Ft & 1023; + var Ot = P.charCodeAt(++ge); + Ne = 65536 + ((Ne & 1023) << 10) | Ot & 1023; } if (Ne <= 127) { - if (ue >= Le) + if (pe >= Le) break; - V[ue++ >>> 0] = Ne; + V[pe++ >>> 0] = Ne; } else if (Ne <= 2047) { - if (ue + 1 >= Le) + if (pe + 1 >= Le) break; - V[ue++ >>> 0] = 192 | Ne >> 6, V[ue++ >>> 0] = 128 | Ne & 63; + V[pe++ >>> 0] = 192 | Ne >> 6, V[pe++ >>> 0] = 128 | Ne & 63; } else if (Ne <= 65535) { - if (ue + 2 >= Le) + if (pe + 2 >= Le) break; - V[ue++ >>> 0] = 224 | Ne >> 12, V[ue++ >>> 0] = 128 | Ne >> 6 & 63, V[ue++ >>> 0] = 128 | Ne & 63; + V[pe++ >>> 0] = 224 | Ne >> 12, V[pe++ >>> 0] = 128 | Ne >> 6 & 63, V[pe++ >>> 0] = 128 | Ne & 63; } else { - if (ue + 3 >= Le) + if (pe + 3 >= Le) break; - V[ue++ >>> 0] = 240 | Ne >> 18, V[ue++ >>> 0] = 128 | Ne >> 12 & 63, V[ue++ >>> 0] = 128 | Ne >> 6 & 63, V[ue++ >>> 0] = 128 | Ne & 63; + V[pe++ >>> 0] = 240 | Ne >> 18, V[pe++ >>> 0] = 128 | Ne >> 12 & 63, V[pe++ >>> 0] = 128 | Ne >> 6 & 63, V[pe++ >>> 0] = 128 | Ne & 63; } } - return V[ue >>> 0] = 0, ue - Be; + return V[pe >>> 0] = 0, pe - Be; } - function ct(F, V, ue) { - return st(F, o(), V, ue); + function ct(P, V, pe) { + return at(P, o(), V, pe); } - var Ge, lt, it, ht, gt, Mr, Mt, eo, rr; - S && (Ge = u.buffer); - function Tt(F) { - Ge = F, u.HEAP8 = lt = new Int8Array(F), u.HEAP16 = ht = new Int16Array(F), u.HEAP32 = Mr = new Int32Array(F), u.HEAPU8 = it = new Uint8Array(F), u.HEAPU16 = gt = new Uint16Array(F), u.HEAPU32 = Mt = new Uint32Array(F), u.HEAPF32 = eo = new Float32Array(F), u.HEAPF64 = rr = new Float64Array(F); + var Ke, mt, ut, gt, xt, Ur, Bt, io, sr; + S && (Ke = u.buffer); + function Et(P) { + Ke = P, u.HEAP8 = mt = new Int8Array(P), u.HEAP16 = gt = new Int16Array(P), u.HEAP32 = Ur = new Int32Array(P), u.HEAPU8 = ut = new Uint8Array(P), u.HEAPU16 = xt = new Uint16Array(P), u.HEAPU32 = Bt = new Uint32Array(P), u.HEAPF32 = io = new Float32Array(P), u.HEAPF64 = sr = new Float64Array(P); } - var or = u.INITIAL_MEMORY || 16777216; + var ar = u.INITIAL_MEMORY || 16777216; if (S) - oe = u.wasmMemory, Ge = u.buffer; + oe = u.wasmMemory, Ke = u.buffer; else if (u.wasmMemory) oe = u.wasmMemory; - else if (oe = new WebAssembly.Memory({ initial: or / 65536, maximum: 65536, shared: true }), !(oe.buffer instanceof SharedArrayBuffer)) - throw j("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"), C && j("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"), Error("bad memory"); - oe && (Ge = oe.buffer), or = Ge.byteLength, Tt(Ge); - var nr, to = [], ro = [], fr = [], Va = false; - function Lo() { + else if (oe = new WebAssembly.Memory({ initial: ar / 65536, maximum: 65536, shared: true }), !(oe.buffer instanceof SharedArrayBuffer)) + throw j("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"), w && j("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"), Error("bad memory"); + oe && (Ke = oe.buffer), ar = Ke.byteLength, Et(Ke); + var ir, uo = [], po = [], xr = [], ja = false; + function cn() { return ee; } - function Ks() { + function ta() { if (u.preRun) for (typeof u.preRun == "function" && (u.preRun = [u.preRun]); u.preRun.length; ) - tl(u.preRun.shift()); - nl(to); + lc(u.preRun.shift()); + dc(uo); } - function Xt() { - Va = true, !S && nl(ro); + function Zt() { + ja = true, !S && dc(po); } - function Wa() { + function Xa() { if (!S) { if (u.postRun) for (typeof u.postRun == "function" && (u.postRun = [u.postRun]); u.postRun.length; ) - m0(u.postRun.shift()); - nl(fr); + Zv(u.postRun.shift()); + dc(xr); } } - function tl(F) { - to.unshift(F); + function lc(P) { + uo.unshift(P); } - function rl(F) { - ro.unshift(F); + function cc(P) { + po.unshift(P); } - function m0(F) { - fr.unshift(F); + function Zv(P) { + xr.unshift(P); } - var vi = 0, Rp = null, Ua = null; - function by(F) { - vi++, u.monitorRunDependencies && u.monitorRunDependencies(vi); + var Pi = 0, Bp = null, Ya = null; + function Ay(P) { + Pi++, u.monitorRunDependencies && u.monitorRunDependencies(Pi); } - function bm(F) { - if (vi--, u.monitorRunDependencies && u.monitorRunDependencies(vi), vi == 0 && (Rp !== null && (clearInterval(Rp), Rp = null), Ua)) { - var V = Ua; - Ua = null, V(); + function Rm(P) { + if (Pi--, u.monitorRunDependencies && u.monitorRunDependencies(Pi), Pi == 0 && (Bp !== null && (clearInterval(Bp), Bp = null), Ya)) { + var V = Ya; + Ya = null, V(); } } - function Su(F) { - u.onAbort && u.onAbort(F), F = "Aborted(" + F + ")", j(F), le = true, be = 1, F += ". Build with -sASSERTIONS for more info."; - var V = new WebAssembly.RuntimeError(F); - throw l(V), V; + function Ru(P) { + u.onAbort && u.onAbort(P), P = "Aborted(" + P + ")", j(P), me = true, be = 1, P += ". Build with -sASSERTIONS for more info."; + var V = new WebAssembly.RuntimeError(P); + throw c(V), V; } - var Cy = "data:application/octet-stream;base64,"; - function Cm(F) { - return F.startsWith(Cy); + var Fy = "data:application/octet-stream;base64,"; + function Dm(P) { + return P.startsWith(Fy); } - function Dp(F) { - return F.startsWith("file://"); + function zp(P) { + return P.startsWith("file://"); } - var hr; - hr = "tfjs-backend-wasm-threaded-simd.wasm", Cm(hr) || (hr = _(hr)); - function wm(F) { + var yr; + yr = "tfjs-backend-wasm-threaded-simd.wasm", Dm(yr) || (yr = T(yr)); + function Am(P) { try { - if (F == hr && ne) + if (P == yr && ne) return new Uint8Array(ne); if (D) - return D(F); + return D(P); throw "both async and sync fetching of the wasm failed"; } catch (V) { - Su(V); + Ru(V); } } - function wy() { + function Py() { if (!ne && (x || b)) { - if (typeof fetch == "function" && !Dp(hr)) - return fetch(hr, { credentials: "same-origin" }).then(function(F) { - if (!F.ok) - throw "failed to load wasm binary file at '" + hr + "'"; - return F.arrayBuffer(); + if (typeof fetch == "function" && !zp(yr)) + return fetch(yr, { credentials: "same-origin" }).then(function(P) { + if (!P.ok) + throw "failed to load wasm binary file at '" + yr + "'"; + return P.arrayBuffer(); }).catch(function() { - return wm(hr); + return Am(yr); }); if (R) - return new Promise(function(F, V) { - R(hr, function(ue) { - F(new Uint8Array(ue)); + return new Promise(function(P, V) { + R(yr, function(pe) { + P(new Uint8Array(pe)); }, V); }); } return Promise.resolve().then(function() { - return wm(hr); + return Am(yr); }); } - function Sy() { - var F = { env: Fm, wasi_snapshot_preview1: Fm }; + function Oy() { + var P = { env: Km, wasi_snapshot_preview1: Km }; function V(ge, Ne) { - var Ft = ge.exports; - if (u.asm = Ft, Ry(u.asm._emscripten_tls_init), nr = u.asm.__indirect_function_table, rl(u.asm.__wasm_call_ctors), ie = Ne, !S) { - var no = Me.unusedWorkers.length; - Me.unusedWorkers.forEach(function(Ha) { - Me.loadWasmModuleToWorker(Ha, function() { - --no || bm("wasm-instantiate"); + var Ot = ge.exports; + if (u.asm = Ot, Hy(u.asm._emscripten_tls_init), ir = u.asm.__indirect_function_table, cc(u.asm.__wasm_call_ctors), ue = Ne, !S) { + var co = Me.unusedWorkers.length; + Me.unusedWorkers.forEach(function(Za) { + Me.loadWasmModuleToWorker(Za, function() { + --co || Rm("wasm-instantiate"); }); }); } } - S || by("wasm-instantiate"); - function ue(ge) { + S || Ay("wasm-instantiate"); + function pe(ge) { V(ge.instance, ge.module); } - function Ee(ge) { - return wy().then(function(Ne) { - return WebAssembly.instantiate(Ne, F); + function $e(ge) { + return Py().then(function(Ne) { + return WebAssembly.instantiate(Ne, P); }).then(function(Ne) { return Ne; }).then(ge, function(Ne) { - j("failed to asynchronously prepare wasm: " + Ne), Su(Ne); + j("failed to asynchronously prepare wasm: " + Ne), Ru(Ne); }); } function Be() { - return !ne && typeof WebAssembly.instantiateStreaming == "function" && !Cm(hr) && !Dp(hr) && !C && typeof fetch == "function" ? fetch(hr, { credentials: "same-origin" }).then(function(ge) { - var Ne = WebAssembly.instantiateStreaming(ge, F); - return Ne.then(ue, function(Ft) { - return j("wasm streaming compile failed: " + Ft), j("falling back to ArrayBuffer instantiation"), Ee(ue); + return !ne && typeof WebAssembly.instantiateStreaming == "function" && !Dm(yr) && !zp(yr) && !w && typeof fetch == "function" ? fetch(yr, { credentials: "same-origin" }).then(function(ge) { + var Ne = WebAssembly.instantiateStreaming(ge, P); + return Ne.then(pe, function(Ot) { + return j("wasm streaming compile failed: " + Ot), j("falling back to ArrayBuffer instantiation"), $e(pe); }); - }) : Ee(ue); + }) : $e(pe); } if (u.instantiateWasm) try { - var Le = u.instantiateWasm(F, V); + var Le = u.instantiateWasm(P, V); return Le; } catch (ge) { - j("Module.instantiateWasm callback failed with error: " + ge), l(ge); + j("Module.instantiateWasm callback failed with error: " + ge), c(ge); } - return Be().catch(l), {}; + return Be().catch(c), {}; } - var d0, f0, Sm = {}; - function Iu(F) { - this.name = "ExitStatus", this.message = "Program terminated with exit(" + F + ")", this.status = F; + var Jv, ek, Fm = {}; + function Du(P) { + this.name = "ExitStatus", this.message = "Program terminated with exit(" + P + ")", this.status = P; } - function Iy(F) { - var V = Me.pthreads[F]; - delete Me.pthreads[F], V.terminate(), qC(F), Me.runningWorkers.splice(Me.runningWorkers.indexOf(V), 1), V.pthread_ptr = 0; + function My(P) { + var V = Me.pthreads[P]; + delete Me.pthreads[P], V.terminate(), iw(P), Me.runningWorkers.splice(Me.runningWorkers.indexOf(V), 1), V.pthread_ptr = 0; } - function vy(F) { - var V = Me.pthreads[F]; + function Ly(P) { + var V = Me.pthreads[P]; V.postMessage({ cmd: "cancel" }); } - function ol(F) { - var V = Me.pthreads[F]; + function mc(P) { + var V = Me.pthreads[P]; _e(V), Me.returnWorkerToPool(V); } - function ky(F) { + function By(P) { var V = Me.getNewWorker(); if (!V) return 6; - Me.runningWorkers.push(V), Me.pthreads[F.pthread_ptr] = V, V.pthread_ptr = F.pthread_ptr; - var ue = { cmd: "run", start_routine: F.startRoutine, arg: F.arg, pthread_ptr: F.pthread_ptr }; + Me.runningWorkers.push(V), Me.pthreads[P.pthread_ptr] = V, V.pthread_ptr = P.pthread_ptr; + var pe = { cmd: "run", start_routine: P.startRoutine, arg: P.arg, pthread_ptr: P.pthread_ptr }; return V.runPthread = () => { - C && V.ref(), V.postMessage(ue, F.transferList), delete V.runPthread; + w && V.ref(), V.postMessage(pe, P.transferList), delete V.runPthread; }, V.loaded && V.runPthread(), 0; } - var Im = { varargs: void 0, get: function() { - Im.varargs += 4; - var F = s()[Im.varargs - 4 >>> 2]; - return F; - }, getStr: function(F) { - var V = Pe(F); + var Pm = { varargs: void 0, get: function() { + Pm.varargs += 4; + var P = s()[Pm.varargs - 4 >>> 2]; + return P; + }, getStr: function(P) { + var V = Pe(P); return V; } }; - function vm(F) { + function Om(P) { if (S) - return ki(1, 1, F); - be = F, Lo() || (Me.terminateAllThreads(), u.onExit && u.onExit(F), le = true), g(F, new Iu(F)); + return Oi(1, 1, P); + be = P, cn() || (Me.terminateAllThreads(), u.onExit && u.onExit(P), me = true), g(P, new Du(P)); } - function Ny(F, V) { - if (be = F, !V && S) - throw Nm(F), "unwind"; - vm(F); + function zy(P, V) { + if (be = P, !V && S) + throw Lm(P), "unwind"; + Om(P); } - var km = Ny; - function Ty(F) { - if (F instanceof Iu || F == "unwind") + var Mm = zy; + function Vy(P) { + if (P instanceof Du || P == "unwind") return be; - g(1, F); + g(1, P); } var Me = { unusedWorkers: [], runningWorkers: [], tlsInitFunctions: [], pthreads: {}, init: function() { S ? Me.initWorker() : Me.initMainThread(); }, initMainThread: function() { - for (var F = 8; F--; ) + for (var P = 8; P--; ) Me.allocateUnusedWorker(); }, initWorker: function() { ee = false; - }, setExitStatus: function(F) { - be = F; + }, setExitStatus: function(P) { + be = P; }, terminateAllThreads: function() { - for (var F of Object.values(Me.pthreads)) - Me.returnWorkerToPool(F); - for (var F of Me.unusedWorkers) - F.terminate(); + for (var P of Object.values(Me.pthreads)) + Me.returnWorkerToPool(P); + for (var P of Me.unusedWorkers) + P.terminate(); Me.unusedWorkers = []; - }, returnWorkerToPool: function(F) { - var V = F.pthread_ptr; - delete Me.pthreads[V], Me.unusedWorkers.push(F), Me.runningWorkers.splice(Me.runningWorkers.indexOf(F), 1), F.pthread_ptr = 0, C && F.unref(), qC(V); - }, receiveObjectTransfer: function(F) { + }, returnWorkerToPool: function(P) { + var V = P.pthread_ptr; + delete Me.pthreads[V], Me.unusedWorkers.push(P), Me.runningWorkers.splice(Me.runningWorkers.indexOf(P), 1), P.pthread_ptr = 0, w && P.unref(), iw(V); + }, receiveObjectTransfer: function(P) { }, threadInitTLS: function() { - Me.tlsInitFunctions.forEach((F) => F()); - }, loadWasmModuleToWorker: function(F, V) { - F.onmessage = (Le) => { + Me.tlsInitFunctions.forEach((P) => P()); + }, loadWasmModuleToWorker: function(P, V) { + P.onmessage = (Le) => { var ge = Le.data, Ne = ge.cmd; - if (F.pthread_ptr && (Me.currentProxiedOperationCallerThread = F.pthread_ptr), ge.targetThread && ge.targetThread != zm()) { - var Ft = Me.pthreads[ge.targetThread]; - Ft ? Ft.postMessage(ge, ge.transferList) : j('Internal error! Worker sent a message "' + Ne + '" to target pthread ' + ge.targetThread + ", but that thread no longer exists!"), Me.currentProxiedOperationCallerThread = void 0; + if (P.pthread_ptr && (Me.currentProxiedOperationCallerThread = P.pthread_ptr), ge.targetThread && ge.targetThread != Zm()) { + var Ot = Me.pthreads[ge.targetThread]; + Ot ? Ot.postMessage(ge, ge.transferList) : j('Internal error! Worker sent a message "' + Ne + '" to target pthread ' + ge.targetThread + ", but that thread no longer exists!"), Me.currentProxiedOperationCallerThread = void 0; return; } - Ne === "processProxyingQueue" ? sl(ge.queue) : Ne === "spawnThread" ? ky(ge) : Ne === "cleanupThread" ? ol(ge.thread) : Ne === "killThread" ? Iy(ge.thread) : Ne === "cancelThread" ? vy(ge.thread) : Ne === "loaded" ? (F.loaded = true, C && F.unref(), V && V(F), F.runPthread && F.runPthread()) : Ne === "print" ? U("Thread " + ge.threadId + ": " + ge.text) : Ne === "printErr" ? j("Thread " + ge.threadId + ": " + ge.text) : Ne === "alert" ? alert("Thread " + ge.threadId + ": " + ge.text) : ge.target === "setimmediate" ? F.postMessage(ge) : Ne === "callHandler" ? u[ge.handler](...ge.args) : Ne && j("worker sent an unknown command " + Ne), Me.currentProxiedOperationCallerThread = void 0; - }, F.onerror = (Le) => { + Ne === "processProxyingQueue" ? fc(ge.queue) : Ne === "spawnThread" ? By(ge) : Ne === "cleanupThread" ? mc(ge.thread) : Ne === "killThread" ? My(ge.thread) : Ne === "cancelThread" ? Ly(ge.thread) : Ne === "loaded" ? (P.loaded = true, w && P.unref(), V && V(P), P.runPthread && P.runPthread()) : Ne === "print" ? U("Thread " + ge.threadId + ": " + ge.text) : Ne === "printErr" ? j("Thread " + ge.threadId + ": " + ge.text) : Ne === "alert" ? alert("Thread " + ge.threadId + ": " + ge.text) : ge.target === "setimmediate" ? P.postMessage(ge) : Ne === "callHandler" ? u[ge.handler](...ge.args) : Ne && j("worker sent an unknown command " + Ne), Me.currentProxiedOperationCallerThread = void 0; + }, P.onerror = (Le) => { var ge = "worker sent an error!"; throw j(ge + " " + Le.filename + ":" + Le.lineno + ": " + Le.message), Le; - }, C && (F.on("message", function(Le) { - F.onmessage({ data: Le }); - }), F.on("error", function(Le) { - F.onerror(Le); - }), F.on("detachedExit", function() { + }, w && (P.on("message", function(Le) { + P.onmessage({ data: Le }); + }), P.on("error", function(Le) { + P.onerror(Le); + }), P.on("detachedExit", function() { })); - var ue = [], Ee = ["onExit", "onAbort", "print", "printErr"]; - for (var Be of Ee) - u.hasOwnProperty(Be) && ue.push(Be); - F.postMessage({ cmd: "load", handlers: ue, urlOrBlob: u.mainScriptUrlOrBlob || r15, wasmMemory: oe, wasmModule: ie }); + var pe = [], $e = ["onExit", "onAbort", "print", "printErr"]; + for (var Be of $e) + u.hasOwnProperty(Be) && pe.push(Be); + P.postMessage({ cmd: "load", handlers: pe, urlOrBlob: u.mainScriptUrlOrBlob || r16, wasmMemory: oe, wasmModule: ue }); }, allocateUnusedWorker: function() { - var F, V = _("tfjs-backend-wasm-threaded-simd.worker.js"); - F = new Worker(V), Me.unusedWorkers.push(F); + var P, V = T("tfjs-backend-wasm-threaded-simd.worker.js"); + P = new Worker(V), Me.unusedWorkers.push(P); }, getNewWorker: function() { return Me.unusedWorkers.length == 0 && (Me.allocateUnusedWorker(), Me.loadWasmModuleToWorker(Me.unusedWorkers[0])), Me.unusedWorkers.pop(); } }; u.PThread = Me; - function nl(F) { - for (; F.length > 0; ) - F.shift()(u); + function dc(P) { + for (; P.length > 0; ) + P.shift()(u); } - function _y() { - var F = zm(), V = s()[F + 52 >>> 2], ue = s()[F + 56 >>> 2], Ee = V - ue; - C0(V, Ee), Vm(V); + function Wy() { + var P = Zm(), V = s()[P + 52 >>> 2], pe = s()[P + 56 >>> 2], $e = V - pe; + ak(V, $e), Jm(V); } - u.establishStackSpace = _y; - function Nm(F) { + u.establishStackSpace = Wy; + function Lm(P) { if (S) - return ki(2, 0, F); + return Oi(2, 0, P); try { - km(F); + Mm(P); } catch (V) { - Ty(V); + Vy(V); } } - var Ap = []; - function $y(F) { - var V = Ap[F]; - return V || (F >= Ap.length && (Ap.length = F + 1), Ap[F] = V = nr.get(F)), V; + var Vp = []; + function Uy(P) { + var V = Vp[P]; + return V || (P >= Vp.length && (Vp.length = P + 1), Vp[P] = V = ir.get(P)), V; } - function Ey(F, V) { - var ue = $y(F)(V); - Lo() ? Me.setExitStatus(ue) : b0(ue); + function Gy(P, V) { + var pe = Uy(P)(V); + cn() ? Me.setExitStatus(pe) : sk(pe); } - u.invokeEntryPoint = Ey; - function Ry(F) { - Me.tlsInitFunctions.push(F); + u.invokeEntryPoint = Gy; + function Hy(P) { + Me.tlsInitFunctions.push(P); } - function Dy(F) { - g0(F, !b, 1, !x), Me.threadInitTLS(); + function Ky(P) { + rk(P, !b, 1, !x), Me.threadInitTLS(); } - function Ay(F) { - S ? postMessage({ cmd: "cleanupThread", thread: F }) : ol(F); + function qy(P) { + S ? postMessage({ cmd: "cleanupThread", thread: P }) : mc(P); } - function Tm(F, V, ue, Ee) { - return S ? ki(3, 1, F, V, ue, Ee) : _m(F, V, ue, Ee); + function Bm(P, V, pe, $e) { + return S ? Oi(3, 1, P, V, pe, $e) : zm(P, V, pe, $e); } - function _m(F, V, ue, Ee) { + function zm(P, V, pe, $e) { if (typeof SharedArrayBuffer == "undefined") return j("Current environment does not support SharedArrayBuffer, pthreads are not available!"), 6; var Be = [], Le = 0; if (S && (Be.length === 0 || Le)) - return Tm(F, V, ue, Ee); + return Bm(P, V, pe, $e); if (Le) return Le; - var ge = { startRoutine: ue, pthread_ptr: F, arg: Ee, transferList: Be }; - return S ? (ge.cmd = "spawnThread", postMessage(ge, Be), 0) : ky(ge); + var ge = { startRoutine: pe, pthread_ptr: P, arg: $e, transferList: Be }; + return S ? (ge.cmd = "spawnThread", postMessage(ge, Be), 0) : By(ge); } - function Fy() { + function jy() { return 65536; } - var Py = true; - function Oy() { - return Py; + var Xy = true; + function Yy() { + return Xy; } - function sl(F) { - Atomics.store(s(), F >> 2, 1), zm() && y0(F), Atomics.compareExchange(s(), F >> 2, 1, 0); + function fc(P) { + Atomics.store(s(), P >> 2, 1), Zm() && nk(P), Atomics.compareExchange(s(), P >> 2, 1, 0); } - u.executeNotifiedProxyingQueue = sl; - function My(F, V, ue, Ee) { - if (F == V) - setTimeout(() => sl(Ee)); + u.executeNotifiedProxyingQueue = fc; + function Qy(P, V, pe, $e) { + if (P == V) + setTimeout(() => fc($e)); else if (S) - postMessage({ targetThread: F, cmd: "processProxyingQueue", queue: Ee }); + postMessage({ targetThread: P, cmd: "processProxyingQueue", queue: $e }); else { - var Be = Me.pthreads[F]; + var Be = Me.pthreads[P]; if (!Be) return; - Be.postMessage({ cmd: "processProxyingQueue", queue: Ee }); + Be.postMessage({ cmd: "processProxyingQueue", queue: $e }); } return 1; } - function Ly(F, V, ue) { + function Zy(P, V, pe) { return -1; } - function By() { - Su(""); + function Jy() { + Ru(""); } - function vu(F) { - vu.shown || (vu.shown = {}), vu.shown[F] || (vu.shown[F] = 1, C && (F = "warning: " + F), j(F)); + function Au(P) { + Au.shown || (Au.shown = {}), Au.shown[P] || (Au.shown[P] = 1, w && (P = "warning: " + P), j(P)); } - function zy() { - C || b || vu("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"); + function eb() { + w || b || Au("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread"); } - function Vy() { + function tb() { return Date.now(); } - function $m() { + function Vm() { return 4294901760; } - function Wy() { - return $m(); - } - var al; - C ? al = () => { - var F = process.hrtime(); - return F[0] * 1e3 + F[1] / 1e6; - } : al = () => performance.timeOrigin + performance.now(); - function Uy(F, V, ue) { - o().copyWithin(F >>> 0, V >>> 0, V + ue >>> 0); - } - function Gy() { - return C ? FB().cpus().length : navigator.hardwareConcurrency; - } - function Hy(F) { - var V = jC(), ue = F(); - return Vm(V), ue; - } - function ki(F, V) { - var ue = arguments.length - 2, Ee = arguments; - return Hy(() => { - for (var Be = ue, Le = Wm(Be * 8), ge = Le >> 3, Ne = 0; Ne < ue; Ne++) { - var Ft = Ee[2 + Ne]; - p()[ge + Ne >>> 0] = Ft; + function rb() { + return Vm(); + } + var hc; + w ? hc = () => { + var P = process.hrtime(); + return P[0] * 1e3 + P[1] / 1e6; + } : hc = () => performance.timeOrigin + performance.now(); + function ob(P, V, pe) { + o().copyWithin(P >>> 0, V >>> 0, V + pe >>> 0); + } + function nb() { + return w ? kz().cpus().length : navigator.hardwareConcurrency; + } + function sb(P) { + var V = uw(), pe = P(); + return Jm(V), pe; + } + function Oi(P, V) { + var pe = arguments.length - 2, $e = arguments; + return sb(() => { + for (var Be = pe, Le = ed(Be * 8), ge = Le >> 3, Ne = 0; Ne < pe; Ne++) { + var Ot = $e[2 + Ne]; + p()[ge + Ne >>> 0] = Ot; } - return x0(F, Be, Le, V); + return ok(P, Be, Le, V); }); } - var il = []; - function Ky(F, V, ue) { - il.length = V; - for (var Ee = ue >> 3, Be = 0; Be < V; Be++) - il[Be] = p()[Ee + Be >>> 0]; - var Le = F < 0, ge = Le ? Sm[-F - 1] : tb[F]; - return ge.apply(null, il); + var gc = []; + function ab(P, V, pe) { + gc.length = V; + for (var $e = pe >> 3, Be = 0; Be < V; Be++) + gc[Be] = p()[$e + Be >>> 0]; + var Le = P < 0, ge = Le ? Fm[-P - 1] : hb[P]; + return ge.apply(null, gc); } - function qy(F) { + function ib(P) { try { - return oe.grow(F - Ge.byteLength + 65535 >>> 16), Tt(oe.buffer), 1; + return oe.grow(P - Ke.byteLength + 65535 >>> 16), Et(oe.buffer), 1; } catch (V) { } } - function jy(F) { + function ub(P) { var V = o().length; - if (F = F >>> 0, F <= V) + if (P = P >>> 0, P <= V) return false; - var ue = $m(); - if (F > ue) + var pe = Vm(); + if (P > pe) return false; - let Ee = (Ft, no) => Ft + (no - Ft % no) % no; + let $e = (Ot, co) => Ot + (co - Ot % co) % co; for (var Be = 1; Be <= 4; Be *= 2) { var Le = V * (1 + 0.2 / Be); - Le = Math.min(Le, F + 100663296); - var ge = Math.min(ue, Ee(Math.max(F, Le), 65536)), Ne = qy(ge); + Le = Math.min(Le, P + 100663296); + var ge = Math.min(pe, $e(Math.max(P, Le), 65536)), Ne = ib(ge); if (Ne) return true; } return false; } - function Xy() { + function pb() { throw "unwind"; } - function Em(F) { - return S ? ki(4, 1, F) : 52; + function Wm(P) { + return S ? Oi(4, 1, P) : 52; } - function Rm(F, V, ue, Ee, Be) { - return S ? ki(5, 1, F, V, ue, Ee, Be) : 70; + function Um(P, V, pe, $e, Be) { + return S ? Oi(5, 1, P, V, pe, $e, Be) : 70; } - var Yy = [null, [], []]; - function Qy(F, V) { - var ue = Yy[F]; - V === 0 || V === 10 ? ((F === 1 ? U : j)(Fe(ue, 0)), ue.length = 0) : ue.push(V); + var lb = [null, [], []]; + function cb(P, V) { + var pe = lb[P]; + V === 0 || V === 10 ? ((P === 1 ? U : j)(Fe(pe, 0)), pe.length = 0) : pe.push(V); } - function Dm(F, V, ue, Ee) { + function Gm(P, V, pe, $e) { if (S) - return ki(6, 1, F, V, ue, Ee); - for (var Be = 0, Le = 0; Le < ue; Le++) { + return Oi(6, 1, P, V, pe, $e); + for (var Be = 0, Le = 0; Le < pe; Le++) { var ge = a()[V >>> 2], Ne = a()[V + 4 >>> 2]; V += 8; - for (var Ft = 0; Ft < Ne; Ft++) - Qy(F, o()[ge + Ft >>> 0]); + for (var Ot = 0; Ot < Ne; Ot++) + cb(P, o()[ge + Ot >>> 0]); Be += Ne; } - return a()[Ee >>> 2] = Be, 0; + return a()[$e >>> 2] = Be, 0; } - function Am(F) { - var V = u["_" + F]; + function Hm(P) { + var V = u["_" + P]; return V; } - function Zy(F, V) { - e().set(F, V >>> 0); + function mb(P, V) { + t10().set(P, V >>> 0); } - function Jy(F, V, ue, Ee, Be) { - var Le = { string: (Lr) => { - var Mp = 0; - if (Lr != null && Lr !== 0) { - var I0 = (Lr.length << 2) + 1; - Mp = Wm(I0), ct(Lr, Mp, I0); + function db(P, V, pe, $e, Be) { + var Le = { string: (Gr) => { + var Hp = 0; + if (Gr != null && Gr !== 0) { + var pk = (Gr.length << 2) + 1; + Hp = ed(pk), ct(Gr, Hp, pk); } - return Mp; - }, array: (Lr) => { - var Mp = Wm(Lr.length); - return Zy(Lr, Mp), Mp; + return Hp; + }, array: (Gr) => { + var Hp = ed(Gr.length); + return mb(Gr, Hp), Hp; } }; - function ge(Lr) { - return V === "string" ? Pe(Lr) : V === "boolean" ? !!Lr : Lr; - } - var Ne = Am(F), Ft = [], no = 0; - if (Ee) - for (var Ha = 0; Ha < Ee.length; Ha++) { - var S0 = Le[ue[Ha]]; - S0 ? (no === 0 && (no = jC()), Ft[Ha] = S0(Ee[Ha])) : Ft[Ha] = Ee[Ha]; + function ge(Gr) { + return V === "string" ? Pe(Gr) : V === "boolean" ? !!Gr : Gr; + } + var Ne = Hm(P), Ot = [], co = 0; + if ($e) + for (var Za = 0; Za < $e.length; Za++) { + var uk = Le[pe[Za]]; + uk ? (co === 0 && (co = uw()), Ot[Za] = uk($e[Za])) : Ot[Za] = $e[Za]; } - var XC = Ne.apply(null, Ft); - function wG(Lr) { - return no !== 0 && Vm(no), ge(Lr); + var pw = Ne.apply(null, Ot); + function K4(Gr) { + return co !== 0 && Jm(co), ge(Gr); } - return XC = wG(XC), XC; + return pw = K4(pw), pw; } - function eb(F, V, ue, Ee) { - ue = ue || []; - var Be = ue.every((ge) => ge === "number" || ge === "boolean"), Le = V !== "string"; - return Le && Be && !Ee ? Am(F) : function() { - return Jy(F, V, ue, arguments, Ee); + function fb(P, V, pe, $e) { + pe = pe || []; + var Be = pe.every((ge) => ge === "number" || ge === "boolean"), Le = V !== "string"; + return Le && Be && !$e ? Hm(P) : function() { + return db(P, V, pe, arguments, $e); }; } Me.init(); - var tb = [null, vm, Nm, Tm, Em, Rm, Dm], Fm = { __emscripten_init_main_thread_js: Dy, __emscripten_thread_cleanup: Ay, __pthread_create_js: _m, _emscripten_default_pthread_stack_size: Fy, _emscripten_get_now_is_monotonic: Oy, _emscripten_notify_task_queue: My, _emscripten_set_offscreencanvas_size: Ly, abort: By, emscripten_check_blocking_allowed: zy, emscripten_date_now: Vy, emscripten_get_heap_max: Wy, emscripten_get_now: al, emscripten_memcpy_big: Uy, emscripten_num_logical_cores: Gy, emscripten_receive_on_main_thread_js: Ky, emscripten_resize_heap: jy, emscripten_unwind_to_js_event_loop: Xy, exit: km, fd_close: Em, fd_seek: Rm, fd_write: Dm, memory: oe || u.wasmMemory }, h0 = Sy(), rb = u.___wasm_call_ctors = function() { - return (rb = u.___wasm_call_ctors = u.asm.__wasm_call_ctors).apply(null, arguments); - }, ob = u._init = function() { - return (ob = u._init = u.asm.init).apply(null, arguments); - }, nb = u._init_with_threads_count = function() { - return (nb = u._init_with_threads_count = u.asm.init_with_threads_count).apply(null, arguments); - }, sb = u._get_threads_count = function() { - return (sb = u._get_threads_count = u.asm.get_threads_count).apply(null, arguments); - }, ab = u._register_tensor = function() { - return (ab = u._register_tensor = u.asm.register_tensor).apply(null, arguments); - }, ib = u._dispose_data = function() { - return (ib = u._dispose_data = u.asm.dispose_data).apply(null, arguments); - }, ub = u._dispose = function() { - return (ub = u._dispose = u.asm.dispose).apply(null, arguments); - }, pb = u._Abs = function() { - return (pb = u._Abs = u.asm.Abs).apply(null, arguments); - }, cb = u._Acos = function() { - return (cb = u._Acos = u.asm.Acos).apply(null, arguments); - }, lb = u._Acosh = function() { - return (lb = u._Acosh = u.asm.Acosh).apply(null, arguments); - }, mb = u._Add = function() { - return (mb = u._Add = u.asm.Add).apply(null, arguments); - }, db = u._AddN = function() { - return (db = u._AddN = u.asm.AddN).apply(null, arguments); - }, fb = u._All = function() { - return (fb = u._All = u.asm.All).apply(null, arguments); - }, hb = u._Any = function() { - return (hb = u._Any = u.asm.Any).apply(null, arguments); - }, gb = u._ArgMax = function() { - return (gb = u._ArgMax = u.asm.ArgMax).apply(null, arguments); - }, xb = u._ArgMin = function() { - return (xb = u._ArgMin = u.asm.ArgMin).apply(null, arguments); - }, yb = u._Asin = function() { - return (yb = u._Asin = u.asm.Asin).apply(null, arguments); - }, bb = u._Asinh = function() { - return (bb = u._Asinh = u.asm.Asinh).apply(null, arguments); - }, Cb = u._Atan = function() { - return (Cb = u._Atan = u.asm.Atan).apply(null, arguments); - }, wb = u._Atan2 = function() { - return (wb = u._Atan2 = u.asm.Atan2).apply(null, arguments); - }, Sb = u._Atanh = function() { - return (Sb = u._Atanh = u.asm.Atanh).apply(null, arguments); - }, Ib = u._AvgPool = function() { - return (Ib = u._AvgPool = u.asm.AvgPool).apply(null, arguments); - }, vb = u._AvgPool3D = function() { - return (vb = u._AvgPool3D = u.asm.AvgPool3D).apply(null, arguments); - }, kb = u._AvgPool3DGrad = function() { - return (kb = u._AvgPool3DGrad = u.asm.AvgPool3DGrad).apply(null, arguments); - }, Nb = u._AvgPoolGrad = function() { - return (Nb = u._AvgPoolGrad = u.asm.AvgPoolGrad).apply(null, arguments); - }, Tb = u._BatchMatMul = function() { - return (Tb = u._BatchMatMul = u.asm.BatchMatMul).apply(null, arguments); - }, _b = u._Bincount = function() { - return (_b = u._Bincount = u.asm.Bincount).apply(null, arguments); - }, $b = u._BitwiseAnd = function() { - return ($b = u._BitwiseAnd = u.asm.BitwiseAnd).apply(null, arguments); - }, Eb = u._Ceil = function() { - return (Eb = u._Ceil = u.asm.Ceil).apply(null, arguments); - }, Rb = u._ClipByValue = function() { - return (Rb = u._ClipByValue = u.asm.ClipByValue).apply(null, arguments); - }, Db = u._Conv2D = function() { - return (Db = u._Conv2D = u.asm.Conv2D).apply(null, arguments); - }, Ab = u._Conv2DBackpropInput = function() { - return (Ab = u._Conv2DBackpropInput = u.asm.Conv2DBackpropInput).apply(null, arguments); - }, Fb = u._Conv3D = function() { - return (Fb = u._Conv3D = u.asm.Conv3D).apply(null, arguments); - }, Pb = u._Conv3DBackpropFilterV2 = function() { - return (Pb = u._Conv3DBackpropFilterV2 = u.asm.Conv3DBackpropFilterV2).apply(null, arguments); - }, Ob = u._Conv3DBackpropInputV2 = function() { - return (Ob = u._Conv3DBackpropInputV2 = u.asm.Conv3DBackpropInputV2).apply(null, arguments); - }, Mb = u._Cos = function() { - return (Mb = u._Cos = u.asm.Cos).apply(null, arguments); - }, Lb = u._Cosh = function() { - return (Lb = u._Cosh = u.asm.Cosh).apply(null, arguments); - }, Bb = u._CropAndResize = function() { - return (Bb = u._CropAndResize = u.asm.CropAndResize).apply(null, arguments); - }, zb = u._Cumprod = function() { - return (zb = u._Cumprod = u.asm.Cumprod).apply(null, arguments); - }, Vb = u._Cumsum = function() { - return (Vb = u._Cumsum = u.asm.Cumsum).apply(null, arguments); - }, Wb = u._DenseBincount = function() { - return (Wb = u._DenseBincount = u.asm.DenseBincount).apply(null, arguments); - }, Ub = u._DepthToSpace = function() { - return (Ub = u._DepthToSpace = u.asm.DepthToSpace).apply(null, arguments); - }, Gb = u._DepthwiseConv2dNative = function() { - return (Gb = u._DepthwiseConv2dNative = u.asm.DepthwiseConv2dNative).apply(null, arguments); - }, Hb = u._Diag = function() { - return (Hb = u._Diag = u.asm.Diag).apply(null, arguments); - }, Kb = u._Dilation2D = function() { - return (Kb = u._Dilation2D = u.asm.Dilation2D).apply(null, arguments); - }, qb = u._Dilation2DBackpropFilter = function() { - return (qb = u._Dilation2DBackpropFilter = u.asm.Dilation2DBackpropFilter).apply(null, arguments); - }, jb = u._Dilation2DBackpropInput = function() { - return (jb = u._Dilation2DBackpropInput = u.asm.Dilation2DBackpropInput).apply(null, arguments); - }, Xb = u._Elu = function() { - return (Xb = u._Elu = u.asm.Elu).apply(null, arguments); - }, Yb = u._EluGrad = function() { - return (Yb = u._EluGrad = u.asm.EluGrad).apply(null, arguments); - }, Qb = u._Equal = function() { - return (Qb = u._Equal = u.asm.Equal).apply(null, arguments); - }, Zb = u._Erf = function() { - return (Zb = u._Erf = u.asm.Erf).apply(null, arguments); - }, Jb = u._Exp = function() { - return (Jb = u._Exp = u.asm.Exp).apply(null, arguments); - }, eC = u._Expm1 = function() { - return (eC = u._Expm1 = u.asm.Expm1).apply(null, arguments); - }, tC = u._FlipLeftRight = function() { - return (tC = u._FlipLeftRight = u.asm.FlipLeftRight).apply(null, arguments); - }, rC = u._Floor = function() { - return (rC = u._Floor = u.asm.Floor).apply(null, arguments); - }, oC = u._FloorDiv = function() { - return (oC = u._FloorDiv = u.asm.FloorDiv).apply(null, arguments); - }, nC = u._FusedBatchNorm = function() { - return (nC = u._FusedBatchNorm = u.asm.FusedBatchNorm).apply(null, arguments); - }, sC = u._FusedConv2D = function() { - return (sC = u._FusedConv2D = u.asm.FusedConv2D).apply(null, arguments); - }, aC = u._FusedDepthwiseConv2D = function() { - return (aC = u._FusedDepthwiseConv2D = u.asm.FusedDepthwiseConv2D).apply(null, arguments); - }, iC = u._Gather = function() { - return (iC = u._Gather = u.asm.Gather).apply(null, arguments); - }, uC = u._GatherNd = function() { - return (uC = u._GatherNd = u.asm.GatherNd).apply(null, arguments); - }, pC = u._Greater = function() { - return (pC = u._Greater = u.asm.Greater).apply(null, arguments); - }, cC = u._GreaterEqual = function() { - return (cC = u._GreaterEqual = u.asm.GreaterEqual).apply(null, arguments); - }, lC = u._IsFinite = function() { - return (lC = u._IsFinite = u.asm.IsFinite).apply(null, arguments); - }, mC = u._IsInf = function() { - return (mC = u._IsInf = u.asm.IsInf).apply(null, arguments); - }, dC = u._IsNan = function() { - return (dC = u._IsNan = u.asm.IsNan).apply(null, arguments); - }, fC = u._LRN = function() { - return (fC = u._LRN = u.asm.LRN).apply(null, arguments); - }, hC = u._LRNGrad = function() { - return (hC = u._LRNGrad = u.asm.LRNGrad).apply(null, arguments); - }, gC = u._LeakyRelu = function() { - return (gC = u._LeakyRelu = u.asm.LeakyRelu).apply(null, arguments); - }, xC = u._Less = function() { - return (xC = u._Less = u.asm.Less).apply(null, arguments); - }, yC = u._LessEqual = function() { - return (yC = u._LessEqual = u.asm.LessEqual).apply(null, arguments); - }, bC = u._LinSpace = function() { - return (bC = u._LinSpace = u.asm.LinSpace).apply(null, arguments); - }, CC = u._Log = function() { - return (CC = u._Log = u.asm.Log).apply(null, arguments); - }, wC = u._Log1p = function() { - return (wC = u._Log1p = u.asm.Log1p).apply(null, arguments); - }, SC = u._LogicalAnd = function() { - return (SC = u._LogicalAnd = u.asm.LogicalAnd).apply(null, arguments); - }, IC = u._LogicalNot = function() { - return (IC = u._LogicalNot = u.asm.LogicalNot).apply(null, arguments); - }, vC = u._LogicalOr = function() { - return (vC = u._LogicalOr = u.asm.LogicalOr).apply(null, arguments); - }, kC = u._LogicalXor = function() { - return (kC = u._LogicalXor = u.asm.LogicalXor).apply(null, arguments); - }, NC = u._Max = function() { - return (NC = u._Max = u.asm.Max).apply(null, arguments); - }, TC = u._MaxPool = function() { - return (TC = u._MaxPool = u.asm.MaxPool).apply(null, arguments); - }, _C = u._MaxPool3D = function() { - return (_C = u._MaxPool3D = u.asm.MaxPool3D).apply(null, arguments); - }, $C = u._MaxPool3DGrad = function() { - return ($C = u._MaxPool3DGrad = u.asm.MaxPool3DGrad).apply(null, arguments); - }, EC = u._MaxPoolGrad = function() { - return (EC = u._MaxPoolGrad = u.asm.MaxPoolGrad).apply(null, arguments); - }, RC = u._MaxPoolWithArgmax = function() { - return (RC = u._MaxPoolWithArgmax = u.asm.MaxPoolWithArgmax).apply(null, arguments); - }, DC = u._Maximum = function() { - return (DC = u._Maximum = u.asm.Maximum).apply(null, arguments); - }, AC = u._Mean = function() { - return (AC = u._Mean = u.asm.Mean).apply(null, arguments); - }, FC = u._Min = function() { - return (FC = u._Min = u.asm.Min).apply(null, arguments); - }, PC = u._Minimum = function() { - return (PC = u._Minimum = u.asm.Minimum).apply(null, arguments); - }, OC = u._MirrorPad = function() { - return (OC = u._MirrorPad = u.asm.MirrorPad).apply(null, arguments); - }, MC = u._Mod = function() { - return (MC = u._Mod = u.asm.Mod).apply(null, arguments); - }, LC = u._Multinomial = function() { - return (LC = u._Multinomial = u.asm.Multinomial).apply(null, arguments); - }, BC = u._Multiply = function() { - return (BC = u._Multiply = u.asm.Multiply).apply(null, arguments); - }, zC = u._Neg = function() { - return (zC = u._Neg = u.asm.Neg).apply(null, arguments); - }, VC = u._NonMaxSuppressionV3 = function() { - return (VC = u._NonMaxSuppressionV3 = u.asm.NonMaxSuppressionV3).apply(null, arguments); - }, WC = u._NonMaxSuppressionV4 = function() { - return (WC = u._NonMaxSuppressionV4 = u.asm.NonMaxSuppressionV4).apply(null, arguments); - }, Pm = u._NonMaxSuppressionV5 = function() { - return (Pm = u._NonMaxSuppressionV5 = u.asm.NonMaxSuppressionV5).apply(null, arguments); - }, Om = u._NotEqual = function() { - return (Om = u._NotEqual = u.asm.NotEqual).apply(null, arguments); - }, ul = u._OneHot = function() { - return (ul = u._OneHot = u.asm.OneHot).apply(null, arguments); - }, UC = u._PadV2 = function() { - return (UC = u._PadV2 = u.asm.PadV2).apply(null, arguments); - }, GC = u._Pow = function() { - return (GC = u._Pow = u.asm.Pow).apply(null, arguments); - }, Fp = u._Prelu = function() { - return (Fp = u._Prelu = u.asm.Prelu).apply(null, arguments); - }, Mm = u._Prod = function() { - return (Mm = u._Prod = u.asm.Prod).apply(null, arguments); - }, Pp = u._RealDiv = function() { - return (Pp = u._RealDiv = u.asm.RealDiv).apply(null, arguments); - }, Op = u._Reciprocal = function() { - return (Op = u._Reciprocal = u.asm.Reciprocal).apply(null, arguments); - }, HC = u._Relu = function() { - return (HC = u._Relu = u.asm.Relu).apply(null, arguments); + var hb = [null, Om, Lm, Bm, Wm, Um, Gm], Km = { __emscripten_init_main_thread_js: Ky, __emscripten_thread_cleanup: qy, __pthread_create_js: zm, _emscripten_default_pthread_stack_size: jy, _emscripten_get_now_is_monotonic: Yy, _emscripten_notify_task_queue: Qy, _emscripten_set_offscreencanvas_size: Zy, abort: Jy, emscripten_check_blocking_allowed: eb, emscripten_date_now: tb, emscripten_get_heap_max: rb, emscripten_get_now: hc, emscripten_memcpy_big: ob, emscripten_num_logical_cores: nb, emscripten_receive_on_main_thread_js: ab, emscripten_resize_heap: ub, emscripten_unwind_to_js_event_loop: pb, exit: Mm, fd_close: Wm, fd_seek: Um, fd_write: Gm, memory: oe || u.wasmMemory }, tk = Oy(), gb = u.___wasm_call_ctors = function() { + return (gb = u.___wasm_call_ctors = u.asm.__wasm_call_ctors).apply(null, arguments); + }, xb = u._init = function() { + return (xb = u._init = u.asm.init).apply(null, arguments); + }, yb = u._init_with_threads_count = function() { + return (yb = u._init_with_threads_count = u.asm.init_with_threads_count).apply(null, arguments); + }, bb = u._get_threads_count = function() { + return (bb = u._get_threads_count = u.asm.get_threads_count).apply(null, arguments); + }, Cb = u._register_tensor = function() { + return (Cb = u._register_tensor = u.asm.register_tensor).apply(null, arguments); + }, wb = u._dispose_data = function() { + return (wb = u._dispose_data = u.asm.dispose_data).apply(null, arguments); + }, Sb = u._dispose = function() { + return (Sb = u._dispose = u.asm.dispose).apply(null, arguments); + }, Ib = u._Abs = function() { + return (Ib = u._Abs = u.asm.Abs).apply(null, arguments); + }, vb = u._Acos = function() { + return (vb = u._Acos = u.asm.Acos).apply(null, arguments); + }, kb = u._Acosh = function() { + return (kb = u._Acosh = u.asm.Acosh).apply(null, arguments); + }, Nb = u._Add = function() { + return (Nb = u._Add = u.asm.Add).apply(null, arguments); + }, Tb = u._AddN = function() { + return (Tb = u._AddN = u.asm.AddN).apply(null, arguments); + }, _b = u._All = function() { + return (_b = u._All = u.asm.All).apply(null, arguments); + }, Eb = u._Any = function() { + return (Eb = u._Any = u.asm.Any).apply(null, arguments); + }, $b = u._ArgMax = function() { + return ($b = u._ArgMax = u.asm.ArgMax).apply(null, arguments); + }, Rb = u._ArgMin = function() { + return (Rb = u._ArgMin = u.asm.ArgMin).apply(null, arguments); + }, Db = u._Asin = function() { + return (Db = u._Asin = u.asm.Asin).apply(null, arguments); + }, Ab = u._Asinh = function() { + return (Ab = u._Asinh = u.asm.Asinh).apply(null, arguments); + }, Fb = u._Atan = function() { + return (Fb = u._Atan = u.asm.Atan).apply(null, arguments); + }, Pb = u._Atan2 = function() { + return (Pb = u._Atan2 = u.asm.Atan2).apply(null, arguments); + }, Ob = u._Atanh = function() { + return (Ob = u._Atanh = u.asm.Atanh).apply(null, arguments); + }, Mb = u._AvgPool = function() { + return (Mb = u._AvgPool = u.asm.AvgPool).apply(null, arguments); + }, Lb = u._AvgPool3D = function() { + return (Lb = u._AvgPool3D = u.asm.AvgPool3D).apply(null, arguments); + }, Bb = u._AvgPool3DGrad = function() { + return (Bb = u._AvgPool3DGrad = u.asm.AvgPool3DGrad).apply(null, arguments); + }, zb = u._AvgPoolGrad = function() { + return (zb = u._AvgPoolGrad = u.asm.AvgPoolGrad).apply(null, arguments); + }, Vb = u._BatchMatMul = function() { + return (Vb = u._BatchMatMul = u.asm.BatchMatMul).apply(null, arguments); + }, Wb = u._Bincount = function() { + return (Wb = u._Bincount = u.asm.Bincount).apply(null, arguments); + }, Ub = u._BitwiseAnd = function() { + return (Ub = u._BitwiseAnd = u.asm.BitwiseAnd).apply(null, arguments); + }, Gb = u._Ceil = function() { + return (Gb = u._Ceil = u.asm.Ceil).apply(null, arguments); + }, Hb = u._ClipByValue = function() { + return (Hb = u._ClipByValue = u.asm.ClipByValue).apply(null, arguments); + }, Kb = u._Conv2D = function() { + return (Kb = u._Conv2D = u.asm.Conv2D).apply(null, arguments); + }, qb = u._Conv2DBackpropInput = function() { + return (qb = u._Conv2DBackpropInput = u.asm.Conv2DBackpropInput).apply(null, arguments); + }, jb = u._Conv3D = function() { + return (jb = u._Conv3D = u.asm.Conv3D).apply(null, arguments); + }, Xb = u._Conv3DBackpropFilterV2 = function() { + return (Xb = u._Conv3DBackpropFilterV2 = u.asm.Conv3DBackpropFilterV2).apply(null, arguments); + }, Yb = u._Conv3DBackpropInputV2 = function() { + return (Yb = u._Conv3DBackpropInputV2 = u.asm.Conv3DBackpropInputV2).apply(null, arguments); + }, Qb = u._Cos = function() { + return (Qb = u._Cos = u.asm.Cos).apply(null, arguments); + }, Zb = u._Cosh = function() { + return (Zb = u._Cosh = u.asm.Cosh).apply(null, arguments); + }, Jb = u._CropAndResize = function() { + return (Jb = u._CropAndResize = u.asm.CropAndResize).apply(null, arguments); + }, eC = u._Cumprod = function() { + return (eC = u._Cumprod = u.asm.Cumprod).apply(null, arguments); + }, tC = u._Cumsum = function() { + return (tC = u._Cumsum = u.asm.Cumsum).apply(null, arguments); + }, rC = u._DenseBincount = function() { + return (rC = u._DenseBincount = u.asm.DenseBincount).apply(null, arguments); + }, oC = u._DepthToSpace = function() { + return (oC = u._DepthToSpace = u.asm.DepthToSpace).apply(null, arguments); + }, nC = u._DepthwiseConv2dNative = function() { + return (nC = u._DepthwiseConv2dNative = u.asm.DepthwiseConv2dNative).apply(null, arguments); + }, sC = u._Diag = function() { + return (sC = u._Diag = u.asm.Diag).apply(null, arguments); + }, aC = u._Dilation2D = function() { + return (aC = u._Dilation2D = u.asm.Dilation2D).apply(null, arguments); + }, iC = u._Dilation2DBackpropFilter = function() { + return (iC = u._Dilation2DBackpropFilter = u.asm.Dilation2DBackpropFilter).apply(null, arguments); + }, uC = u._Dilation2DBackpropInput = function() { + return (uC = u._Dilation2DBackpropInput = u.asm.Dilation2DBackpropInput).apply(null, arguments); + }, pC = u._Elu = function() { + return (pC = u._Elu = u.asm.Elu).apply(null, arguments); + }, lC = u._EluGrad = function() { + return (lC = u._EluGrad = u.asm.EluGrad).apply(null, arguments); + }, cC = u._Equal = function() { + return (cC = u._Equal = u.asm.Equal).apply(null, arguments); + }, mC = u._Erf = function() { + return (mC = u._Erf = u.asm.Erf).apply(null, arguments); + }, dC = u._Exp = function() { + return (dC = u._Exp = u.asm.Exp).apply(null, arguments); + }, fC = u._Expm1 = function() { + return (fC = u._Expm1 = u.asm.Expm1).apply(null, arguments); + }, hC = u._FlipLeftRight = function() { + return (hC = u._FlipLeftRight = u.asm.FlipLeftRight).apply(null, arguments); + }, gC = u._Floor = function() { + return (gC = u._Floor = u.asm.Floor).apply(null, arguments); + }, xC = u._FloorDiv = function() { + return (xC = u._FloorDiv = u.asm.FloorDiv).apply(null, arguments); + }, yC = u._FusedBatchNorm = function() { + return (yC = u._FusedBatchNorm = u.asm.FusedBatchNorm).apply(null, arguments); + }, bC = u._FusedConv2D = function() { + return (bC = u._FusedConv2D = u.asm.FusedConv2D).apply(null, arguments); + }, CC = u._FusedDepthwiseConv2D = function() { + return (CC = u._FusedDepthwiseConv2D = u.asm.FusedDepthwiseConv2D).apply(null, arguments); + }, wC = u._Gather = function() { + return (wC = u._Gather = u.asm.Gather).apply(null, arguments); + }, SC = u._GatherNd = function() { + return (SC = u._GatherNd = u.asm.GatherNd).apply(null, arguments); + }, IC = u._Greater = function() { + return (IC = u._Greater = u.asm.Greater).apply(null, arguments); + }, vC = u._GreaterEqual = function() { + return (vC = u._GreaterEqual = u.asm.GreaterEqual).apply(null, arguments); + }, kC = u._IsFinite = function() { + return (kC = u._IsFinite = u.asm.IsFinite).apply(null, arguments); + }, NC = u._IsInf = function() { + return (NC = u._IsInf = u.asm.IsInf).apply(null, arguments); + }, TC = u._IsNan = function() { + return (TC = u._IsNan = u.asm.IsNan).apply(null, arguments); + }, _C = u._LRN = function() { + return (_C = u._LRN = u.asm.LRN).apply(null, arguments); + }, EC = u._LRNGrad = function() { + return (EC = u._LRNGrad = u.asm.LRNGrad).apply(null, arguments); + }, $C = u._LeakyRelu = function() { + return ($C = u._LeakyRelu = u.asm.LeakyRelu).apply(null, arguments); + }, RC = u._Less = function() { + return (RC = u._Less = u.asm.Less).apply(null, arguments); + }, DC = u._LessEqual = function() { + return (DC = u._LessEqual = u.asm.LessEqual).apply(null, arguments); + }, AC = u._LinSpace = function() { + return (AC = u._LinSpace = u.asm.LinSpace).apply(null, arguments); + }, FC = u._Log = function() { + return (FC = u._Log = u.asm.Log).apply(null, arguments); + }, PC = u._Log1p = function() { + return (PC = u._Log1p = u.asm.Log1p).apply(null, arguments); + }, OC = u._LogicalAnd = function() { + return (OC = u._LogicalAnd = u.asm.LogicalAnd).apply(null, arguments); + }, MC = u._LogicalNot = function() { + return (MC = u._LogicalNot = u.asm.LogicalNot).apply(null, arguments); + }, LC = u._LogicalOr = function() { + return (LC = u._LogicalOr = u.asm.LogicalOr).apply(null, arguments); + }, BC = u._LogicalXor = function() { + return (BC = u._LogicalXor = u.asm.LogicalXor).apply(null, arguments); + }, zC = u._Max = function() { + return (zC = u._Max = u.asm.Max).apply(null, arguments); + }, VC = u._MaxPool = function() { + return (VC = u._MaxPool = u.asm.MaxPool).apply(null, arguments); + }, WC = u._MaxPool3D = function() { + return (WC = u._MaxPool3D = u.asm.MaxPool3D).apply(null, arguments); + }, UC = u._MaxPool3DGrad = function() { + return (UC = u._MaxPool3DGrad = u.asm.MaxPool3DGrad).apply(null, arguments); + }, GC = u._MaxPoolGrad = function() { + return (GC = u._MaxPoolGrad = u.asm.MaxPoolGrad).apply(null, arguments); + }, HC = u._MaxPoolWithArgmax = function() { + return (HC = u._MaxPoolWithArgmax = u.asm.MaxPoolWithArgmax).apply(null, arguments); + }, KC = u._Maximum = function() { + return (KC = u._Maximum = u.asm.Maximum).apply(null, arguments); + }, qC = u._Mean = function() { + return (qC = u._Mean = u.asm.Mean).apply(null, arguments); + }, jC = u._Min = function() { + return (jC = u._Min = u.asm.Min).apply(null, arguments); + }, XC = u._Minimum = function() { + return (XC = u._Minimum = u.asm.Minimum).apply(null, arguments); + }, YC = u._MirrorPad = function() { + return (YC = u._MirrorPad = u.asm.MirrorPad).apply(null, arguments); + }, QC = u._Mod = function() { + return (QC = u._Mod = u.asm.Mod).apply(null, arguments); + }, ZC = u._Multinomial = function() { + return (ZC = u._Multinomial = u.asm.Multinomial).apply(null, arguments); + }, JC = u._Multiply = function() { + return (JC = u._Multiply = u.asm.Multiply).apply(null, arguments); + }, ew = u._Neg = function() { + return (ew = u._Neg = u.asm.Neg).apply(null, arguments); + }, tw = u._NonMaxSuppressionV3 = function() { + return (tw = u._NonMaxSuppressionV3 = u.asm.NonMaxSuppressionV3).apply(null, arguments); + }, rw = u._NonMaxSuppressionV4 = function() { + return (rw = u._NonMaxSuppressionV4 = u.asm.NonMaxSuppressionV4).apply(null, arguments); + }, qm = u._NonMaxSuppressionV5 = function() { + return (qm = u._NonMaxSuppressionV5 = u.asm.NonMaxSuppressionV5).apply(null, arguments); + }, jm = u._NotEqual = function() { + return (jm = u._NotEqual = u.asm.NotEqual).apply(null, arguments); + }, xc = u._OneHot = function() { + return (xc = u._OneHot = u.asm.OneHot).apply(null, arguments); + }, ow = u._PadV2 = function() { + return (ow = u._PadV2 = u.asm.PadV2).apply(null, arguments); + }, nw = u._Pow = function() { + return (nw = u._Pow = u.asm.Pow).apply(null, arguments); + }, Wp = u._Prelu = function() { + return (Wp = u._Prelu = u.asm.Prelu).apply(null, arguments); + }, Xm = u._Prod = function() { + return (Xm = u._Prod = u.asm.Prod).apply(null, arguments); + }, Up = u._RealDiv = function() { + return (Up = u._RealDiv = u.asm.RealDiv).apply(null, arguments); + }, Gp = u._Reciprocal = function() { + return (Gp = u._Reciprocal = u.asm.Reciprocal).apply(null, arguments); + }, sw = u._Relu = function() { + return (sw = u._Relu = u.asm.Relu).apply(null, arguments); }, K = u._Relu6 = function() { return (K = u._Relu6 = u.asm.Relu6).apply(null, arguments); }, ae = u._ResizeBilinear = function() { return (ae = u._ResizeBilinear = u.asm.ResizeBilinear).apply(null, arguments); - }, $e = u._ResizeBilinearGrad = function() { - return ($e = u._ResizeBilinearGrad = u.asm.ResizeBilinearGrad).apply(null, arguments); - }, at = u._ResizeNearestNeighbor = function() { - return (at = u._ResizeNearestNeighbor = u.asm.ResizeNearestNeighbor).apply(null, arguments); - }, _t = u._ResizeNearestNeighborGrad = function() { - return (_t = u._ResizeNearestNeighborGrad = u.asm.ResizeNearestNeighborGrad).apply(null, arguments); - }, $t = u._Reverse = function() { - return ($t = u._Reverse = u.asm.Reverse).apply(null, arguments); - }, Qe = u._RotateWithOffset = function() { - return (Qe = u._RotateWithOffset = u.asm.RotateWithOffset).apply(null, arguments); - }, Ke = u._Round = function() { - return (Ke = u._Round = u.asm.Round).apply(null, arguments); - }, Ut = u._Rsqrt = function() { - return (Ut = u._Rsqrt = u.asm.Rsqrt).apply(null, arguments); - }, oo = u._ScatterNd = function() { - return (oo = u._ScatterNd = u.asm.ScatterNd).apply(null, arguments); - }, Ga = u._SearchSorted = function() { - return (Ga = u._SearchSorted = u.asm.SearchSorted).apply(null, arguments); - }, Lm = u._SelectV2 = function() { - return (Lm = u._SelectV2 = u.asm.SelectV2).apply(null, arguments); - }, pl = u._Selu = function() { - return (pl = u._Selu = u.asm.Selu).apply(null, arguments); - }, KC = u._Sigmoid = function() { - return (KC = u._Sigmoid = u.asm.Sigmoid).apply(null, arguments); - }, yr = u._Sign = function() { - return (yr = u._Sign = u.asm.Sign).apply(null, arguments); - }, Ni = u._Sin = function() { - return (Ni = u._Sin = u.asm.Sin).apply(null, arguments); - }, Bm = u._Sinh = function() { - return (Bm = u._Sinh = u.asm.Sinh).apply(null, arguments); - }, UU = u._Softmax = function() { - return (UU = u._Softmax = u.asm.Softmax).apply(null, arguments); - }, GU = u._Softplus = function() { - return (GU = u._Softplus = u.asm.Softplus).apply(null, arguments); - }, HU = u._SparseFillEmptyRows = function() { - return (HU = u._SparseFillEmptyRows = u.asm.SparseFillEmptyRows).apply(null, arguments); - }, KU = u._SparseReshape = function() { - return (KU = u._SparseReshape = u.asm.SparseReshape).apply(null, arguments); - }, qU = u._SparseSegmentReduction = function() { - return (qU = u._SparseSegmentReduction = u.asm.SparseSegmentReduction).apply(null, arguments); - }, jU = u._SparseToDense = function() { - return (jU = u._SparseToDense = u.asm.SparseToDense).apply(null, arguments); - }, XU = u._Sqrt = function() { - return (XU = u._Sqrt = u.asm.Sqrt).apply(null, arguments); - }, YU = u._Square = function() { - return (YU = u._Square = u.asm.Square).apply(null, arguments); - }, QU = u._SquaredDifference = function() { - return (QU = u._SquaredDifference = u.asm.SquaredDifference).apply(null, arguments); - }, ZU = u._Step = function() { - return (ZU = u._Step = u.asm.Step).apply(null, arguments); - }, JU = u._StridedSlice = function() { - return (JU = u._StridedSlice = u.asm.StridedSlice).apply(null, arguments); - }, eG = u._Sub = function() { - return (eG = u._Sub = u.asm.Sub).apply(null, arguments); - }, tG = u._Sum = function() { - return (tG = u._Sum = u.asm.Sum).apply(null, arguments); - }, rG = u._Tan = function() { - return (rG = u._Tan = u.asm.Tan).apply(null, arguments); - }, oG = u._Tanh = function() { - return (oG = u._Tanh = u.asm.Tanh).apply(null, arguments); - }, nG = u._TensorScatterUpdate = function() { - return (nG = u._TensorScatterUpdate = u.asm.TensorScatterUpdate).apply(null, arguments); - }, sG = u._Tile = function() { - return (sG = u._Tile = u.asm.Tile).apply(null, arguments); - }, aG = u._TopK = function() { - return (aG = u._TopK = u.asm.TopK).apply(null, arguments); - }, iG = u._Transform = function() { - return (iG = u._Transform = u.asm.Transform).apply(null, arguments); - }, uG = u._Transpose = function() { - return (uG = u._Transpose = u.asm.Transpose).apply(null, arguments); - }, pG = u.__FusedMatMul = function() { - return (pG = u.__FusedMatMul = u.asm._FusedMatMul).apply(null, arguments); - }, cG = u._malloc = function() { - return (cG = u._malloc = u.asm.malloc).apply(null, arguments); - }, lG = u._free = function() { - return (lG = u._free = u.asm.free).apply(null, arguments); - }, mG = u.__emscripten_tls_init = function() { - return (mG = u.__emscripten_tls_init = u.asm._emscripten_tls_init).apply(null, arguments); - }, zm = u._pthread_self = function() { - return (zm = u._pthread_self = u.asm.pthread_self).apply(null, arguments); - }, dG = u.___errno_location = function() { - return (dG = u.___errno_location = u.asm.__errno_location).apply(null, arguments); - }, g0 = u.__emscripten_thread_init = function() { - return (g0 = u.__emscripten_thread_init = u.asm._emscripten_thread_init).apply(null, arguments); - }, fG = u.__emscripten_thread_crashed = function() { - return (fG = u.__emscripten_thread_crashed = u.asm._emscripten_thread_crashed).apply(null, arguments); - }, hG = u._emscripten_main_thread_process_queued_calls = function() { - return (hG = u._emscripten_main_thread_process_queued_calls = u.asm.emscripten_main_thread_process_queued_calls).apply(null, arguments); - }, gG = u._emscripten_main_browser_thread_id = function() { - return (gG = u._emscripten_main_browser_thread_id = u.asm.emscripten_main_browser_thread_id).apply(null, arguments); - }, x0 = u._emscripten_run_in_main_runtime_thread_js = function() { - return (x0 = u._emscripten_run_in_main_runtime_thread_js = u.asm.emscripten_run_in_main_runtime_thread_js).apply(null, arguments); - }, xG = u._emscripten_dispatch_to_thread_ = function() { - return (xG = u._emscripten_dispatch_to_thread_ = u.asm.emscripten_dispatch_to_thread_).apply(null, arguments); - }, y0 = u.__emscripten_proxy_execute_task_queue = function() { - return (y0 = u.__emscripten_proxy_execute_task_queue = u.asm._emscripten_proxy_execute_task_queue).apply(null, arguments); - }, qC = u.__emscripten_thread_free_data = function() { - return (qC = u.__emscripten_thread_free_data = u.asm._emscripten_thread_free_data).apply(null, arguments); - }, b0 = u.__emscripten_thread_exit = function() { - return (b0 = u.__emscripten_thread_exit = u.asm._emscripten_thread_exit).apply(null, arguments); - }, C0 = u._emscripten_stack_set_limits = function() { - return (C0 = u._emscripten_stack_set_limits = u.asm.emscripten_stack_set_limits).apply(null, arguments); - }, jC = u.stackSave = function() { - return (jC = u.stackSave = u.asm.stackSave).apply(null, arguments); - }, Vm = u.stackRestore = function() { - return (Vm = u.stackRestore = u.asm.stackRestore).apply(null, arguments); - }, Wm = u.stackAlloc = function() { - return (Wm = u.stackAlloc = u.asm.stackAlloc).apply(null, arguments); - }, yG = u.dynCall_iijjiiii = function() { - return (yG = u.dynCall_iijjiiii = u.asm.dynCall_iijjiiii).apply(null, arguments); - }, bG = u.dynCall_jiji = function() { - return (bG = u.dynCall_jiji = u.asm.dynCall_jiji).apply(null, arguments); + }, Ee = u._ResizeBilinearGrad = function() { + return (Ee = u._ResizeBilinearGrad = u.asm.ResizeBilinearGrad).apply(null, arguments); + }, it = u._ResizeNearestNeighbor = function() { + return (it = u._ResizeNearestNeighbor = u.asm.ResizeNearestNeighbor).apply(null, arguments); + }, $t = u._ResizeNearestNeighborGrad = function() { + return ($t = u._ResizeNearestNeighborGrad = u.asm.ResizeNearestNeighborGrad).apply(null, arguments); + }, Rt = u._Reverse = function() { + return (Rt = u._Reverse = u.asm.Reverse).apply(null, arguments); + }, Ze = u._RotateWithOffset = function() { + return (Ze = u._RotateWithOffset = u.asm.RotateWithOffset).apply(null, arguments); + }, je = u._Round = function() { + return (je = u._Round = u.asm.Round).apply(null, arguments); + }, Ht = u._Rsqrt = function() { + return (Ht = u._Rsqrt = u.asm.Rsqrt).apply(null, arguments); + }, lo = u._ScatterNd = function() { + return (lo = u._ScatterNd = u.asm.ScatterNd).apply(null, arguments); + }, Qa = u._SearchSorted = function() { + return (Qa = u._SearchSorted = u.asm.SearchSorted).apply(null, arguments); + }, Ym = u._SelectV2 = function() { + return (Ym = u._SelectV2 = u.asm.SelectV2).apply(null, arguments); + }, yc = u._Selu = function() { + return (yc = u._Selu = u.asm.Selu).apply(null, arguments); + }, aw = u._Sigmoid = function() { + return (aw = u._Sigmoid = u.asm.Sigmoid).apply(null, arguments); + }, wr = u._Sign = function() { + return (wr = u._Sign = u.asm.Sign).apply(null, arguments); + }, Mi = u._Sin = function() { + return (Mi = u._Sin = u.asm.Sin).apply(null, arguments); + }, Qm = u._Sinh = function() { + return (Qm = u._Sinh = u.asm.Sinh).apply(null, arguments); + }, f4 = u._Softmax = function() { + return (f4 = u._Softmax = u.asm.Softmax).apply(null, arguments); + }, h4 = u._Softplus = function() { + return (h4 = u._Softplus = u.asm.Softplus).apply(null, arguments); + }, g4 = u._SparseFillEmptyRows = function() { + return (g4 = u._SparseFillEmptyRows = u.asm.SparseFillEmptyRows).apply(null, arguments); + }, x4 = u._SparseReshape = function() { + return (x4 = u._SparseReshape = u.asm.SparseReshape).apply(null, arguments); + }, y4 = u._SparseSegmentReduction = function() { + return (y4 = u._SparseSegmentReduction = u.asm.SparseSegmentReduction).apply(null, arguments); + }, b4 = u._SparseToDense = function() { + return (b4 = u._SparseToDense = u.asm.SparseToDense).apply(null, arguments); + }, C4 = u._Sqrt = function() { + return (C4 = u._Sqrt = u.asm.Sqrt).apply(null, arguments); + }, w4 = u._Square = function() { + return (w4 = u._Square = u.asm.Square).apply(null, arguments); + }, S4 = u._SquaredDifference = function() { + return (S4 = u._SquaredDifference = u.asm.SquaredDifference).apply(null, arguments); + }, I4 = u._Step = function() { + return (I4 = u._Step = u.asm.Step).apply(null, arguments); + }, v4 = u._StridedSlice = function() { + return (v4 = u._StridedSlice = u.asm.StridedSlice).apply(null, arguments); + }, k4 = u._Sub = function() { + return (k4 = u._Sub = u.asm.Sub).apply(null, arguments); + }, N4 = u._Sum = function() { + return (N4 = u._Sum = u.asm.Sum).apply(null, arguments); + }, T4 = u._Tan = function() { + return (T4 = u._Tan = u.asm.Tan).apply(null, arguments); + }, _4 = u._Tanh = function() { + return (_4 = u._Tanh = u.asm.Tanh).apply(null, arguments); + }, E4 = u._TensorScatterUpdate = function() { + return (E4 = u._TensorScatterUpdate = u.asm.TensorScatterUpdate).apply(null, arguments); + }, $4 = u._Tile = function() { + return ($4 = u._Tile = u.asm.Tile).apply(null, arguments); + }, R4 = u._TopK = function() { + return (R4 = u._TopK = u.asm.TopK).apply(null, arguments); + }, D4 = u._Transform = function() { + return (D4 = u._Transform = u.asm.Transform).apply(null, arguments); + }, A4 = u._Transpose = function() { + return (A4 = u._Transpose = u.asm.Transpose).apply(null, arguments); + }, F4 = u.__FusedMatMul = function() { + return (F4 = u.__FusedMatMul = u.asm._FusedMatMul).apply(null, arguments); + }, P4 = u._malloc = function() { + return (P4 = u._malloc = u.asm.malloc).apply(null, arguments); + }, O4 = u._free = function() { + return (O4 = u._free = u.asm.free).apply(null, arguments); + }, M4 = u.__emscripten_tls_init = function() { + return (M4 = u.__emscripten_tls_init = u.asm._emscripten_tls_init).apply(null, arguments); + }, Zm = u._pthread_self = function() { + return (Zm = u._pthread_self = u.asm.pthread_self).apply(null, arguments); + }, L4 = u.___errno_location = function() { + return (L4 = u.___errno_location = u.asm.__errno_location).apply(null, arguments); + }, rk = u.__emscripten_thread_init = function() { + return (rk = u.__emscripten_thread_init = u.asm._emscripten_thread_init).apply(null, arguments); + }, B4 = u.__emscripten_thread_crashed = function() { + return (B4 = u.__emscripten_thread_crashed = u.asm._emscripten_thread_crashed).apply(null, arguments); + }, z4 = u._emscripten_main_thread_process_queued_calls = function() { + return (z4 = u._emscripten_main_thread_process_queued_calls = u.asm.emscripten_main_thread_process_queued_calls).apply(null, arguments); + }, V4 = u._emscripten_main_browser_thread_id = function() { + return (V4 = u._emscripten_main_browser_thread_id = u.asm.emscripten_main_browser_thread_id).apply(null, arguments); + }, ok = u._emscripten_run_in_main_runtime_thread_js = function() { + return (ok = u._emscripten_run_in_main_runtime_thread_js = u.asm.emscripten_run_in_main_runtime_thread_js).apply(null, arguments); + }, W4 = u._emscripten_dispatch_to_thread_ = function() { + return (W4 = u._emscripten_dispatch_to_thread_ = u.asm.emscripten_dispatch_to_thread_).apply(null, arguments); + }, nk = u.__emscripten_proxy_execute_task_queue = function() { + return (nk = u.__emscripten_proxy_execute_task_queue = u.asm._emscripten_proxy_execute_task_queue).apply(null, arguments); + }, iw = u.__emscripten_thread_free_data = function() { + return (iw = u.__emscripten_thread_free_data = u.asm._emscripten_thread_free_data).apply(null, arguments); + }, sk = u.__emscripten_thread_exit = function() { + return (sk = u.__emscripten_thread_exit = u.asm._emscripten_thread_exit).apply(null, arguments); + }, ak = u._emscripten_stack_set_limits = function() { + return (ak = u._emscripten_stack_set_limits = u.asm.emscripten_stack_set_limits).apply(null, arguments); + }, uw = u.stackSave = function() { + return (uw = u.stackSave = u.asm.stackSave).apply(null, arguments); + }, Jm = u.stackRestore = function() { + return (Jm = u.stackRestore = u.asm.stackRestore).apply(null, arguments); + }, ed = u.stackAlloc = function() { + return (ed = u.stackAlloc = u.asm.stackAlloc).apply(null, arguments); + }, U4 = u.dynCall_iijjiiii = function() { + return (U4 = u.dynCall_iijjiiii = u.asm.dynCall_iijjiiii).apply(null, arguments); + }, G4 = u.dynCall_jiji = function() { + return (G4 = u.dynCall_jiji = u.asm.dynCall_jiji).apply(null, arguments); }; - u.keepRuntimeAlive = Lo, u.wasmMemory = oe, u.cwrap = eb, u.ExitStatus = Iu, u.PThread = Me; - var Um; - Ua = function F() { - Um || w0(), Um || (Ua = F); + u.keepRuntimeAlive = cn, u.wasmMemory = oe, u.cwrap = fb, u.ExitStatus = Du, u.PThread = Me; + var td; + Ya = function P() { + td || ik(), td || (Ya = P); }; - function w0(F) { - if (F = F || f, vi > 0) + function ik(P) { + if (P = P || f, Pi > 0) return; if (S) { - c(u), Xt(), startWorker(u); + l(u), Zt(), startWorker(u); return; } - if (Ks(), vi > 0) + if (ta(), Pi > 0) return; function V() { - Um || (Um = true, u.calledRun = true, !le && (Xt(), c(u), u.onRuntimeInitialized && u.onRuntimeInitialized(), Wa())); + td || (td = true, u.calledRun = true, !me && (Zt(), l(u), u.onRuntimeInitialized && u.onRuntimeInitialized(), Xa())); } u.setStatus ? (u.setStatus("Running..."), setTimeout(function() { setTimeout(function() { @@ -2188,957 +2188,957 @@ var PB = Kt((Vg, Uv) => { if (u.preInit) for (typeof u.preInit == "function" && (u.preInit = [u.preInit]); u.preInit.length > 0; ) u.preInit.pop()(); - w0(); - var Gm; - m && (Gm = { uncaughtException: process.listeners("uncaughtException").filter(function(F) { - return !m.uncaughtException.indexOf(F) > -1; - }), unhandledRejection: process.listeners("unhandledRejection").filter(function(F) { - return !m.unhandledRejection.indexOf(F) > -1; + ik(); + var rd; + m && (rd = { uncaughtException: process.listeners("uncaughtException").filter(function(P) { + return !m.uncaughtException.indexOf(P) > -1; + }), unhandledRejection: process.listeners("unhandledRejection").filter(function(P) { + return !m.unhandledRejection.indexOf(P) > -1; }) }); - var Hm; + var od; if (typeof WasmBackendModule != "undefined") - Hm = WasmBackendModule; - else if (typeof t8 != "undefined") - Hm = t8; + od = WasmBackendModule; + else if (typeof e != "undefined") + od = e; else throw new Error("Could not find wasm module in post.js"); - if (Gm) { - var CG = Hm._dispose; - Hm._dispose = function() { - CG(), Gm.uncaughtException.forEach(function(F) { - process.removeListener("uncaughtException", F); - }), Gm.unhandledRejection.forEach(function(F) { - process.removeListener("unhandledRejection", F); + if (rd) { + var H4 = od._dispose; + od._dispose = function() { + H4(), rd.uncaughtException.forEach(function(P) { + process.removeListener("uncaughtException", P); + }), rd.unhandledRejection.forEach(function(P) { + process.removeListener("unhandledRejection", P); }); }; } - return t8.ready; + return e.ready; }; })(); - typeof Vg == "object" && typeof Uv == "object" ? Uv.exports = Wv : typeof define == "function" && define.amd ? define([], function() { - return Wv; - }) : typeof Vg == "object" && (Vg.WasmBackendModuleThreadedSimd = Wv); + typeof Jg == "object" && typeof ov == "object" ? ov.exports = rv : typeof define == "function" && define.amd ? define([], function() { + return rv; + }) : typeof Jg == "object" && (Jg.WasmBackendModuleThreadedSimd = rv); }); -var MB = Kt((GFt, OB) => { - OB.exports.wasmWorkerContents = `"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+" +var _z = jt((EPt, Tz) => { + Tz.exports.wasmWorkerContents = `"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+" ");return}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;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"})};self.onmessage=e=>{try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}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)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}};`; }); -var LB = Kt((Wg, Hv) => { - var Gv = (() => { - var r15 = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0; - return typeof __filename != "undefined" && (r15 = r15 || __filename), function(t8) { - t8 = t8 || {}; - var e = typeof t8 != "undefined" ? t8 : {}, o, n; - e.ready = new Promise(function(K, ae) { +var Ez = jt((ex, sv) => { + var nv = (() => { + var r16 = typeof document != "undefined" && document.currentScript ? document.currentScript.src : void 0; + return typeof __filename != "undefined" && (r16 = r16 || __filename), function(e) { + e = e || {}; + var t10 = typeof e != "undefined" ? e : {}, o, n; + t10.ready = new Promise(function(K, ae) { o = K, n = ae; }); var s; typeof process != "undefined" && process.listeners && (s = { uncaughtException: process.listeners("uncaughtException"), unhandledRejection: process.listeners("unhandledRejection") }); - var a = Object.assign({}, e), i = [], p = "./this.program", u = (K, ae) => { + var a = Object.assign({}, t10), i = [], p = "./this.program", u = (K, ae) => { throw ae; - }, c = typeof window == "object", l = typeof importScripts == "function", m = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", d = ""; + }, l = typeof window == "object", c = typeof importScripts == "function", m = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", d = ""; function f(K) { - return e.locateFile ? e.locateFile(K, d) : d + K; + return t10.locateFile ? t10.locateFile(K, d) : d + K; } var h, g, x, b; - function C(K) { - if (K instanceof Rp) + function w(K) { + if (K instanceof Bp) return; E("exiting due to exception: " + K); } if (m) { - var S = zv(), k = Vv(); - l ? d = k.dirname(d) + "/" : d = __dirname + "/", h = (K, ae) => (K = Ks(K) ? new URL(K) : k.normalize(K), S.readFileSync(K, ae ? void 0 : "utf8")), x = (K) => { + var S = ev(), k = tv(); + c ? d = k.dirname(d) + "/" : d = __dirname + "/", h = (K, ae) => (K = ta(K) ? new URL(K) : k.normalize(K), S.readFileSync(K, ae ? void 0 : "utf8")), x = (K) => { var ae = h(K, true); return ae.buffer || (ae = new Uint8Array(ae)), ae; - }, g = (K, ae, $e) => { - K = Ks(K) ? new URL(K) : k.normalize(K), S.readFile(K, function(at, _t) { - at ? $e(at) : ae(_t.buffer); + }, g = (K, ae, Ee) => { + K = ta(K) ? new URL(K) : k.normalize(K), S.readFile(K, function(it, $t) { + it ? Ee(it) : ae($t.buffer); }); }, process.argv.length > 1 && (p = process.argv[1].replace(/\\/g, "/")), i = process.argv.slice(2), process.on("uncaughtException", function(K) { - if (!(K instanceof Rp)) + if (!(K instanceof Bp)) throw K; }), process.on("unhandledRejection", function(K) { throw K; }), u = (K, ae) => { - if (it()) + if (ut()) throw process.exitCode = K, ae; - C(ae), process.exit(K); - }, e.inspect = function() { + w(ae), process.exit(K); + }, t10.inspect = function() { return "[Emscripten Module object]"; }; } else - (c || l) && (l ? d = self.location.href : typeof document != "undefined" && document.currentScript && (d = document.currentScript.src), r15 && (d = r15), d.indexOf("blob:") !== 0 ? d = d.substr(0, d.replace(/[?#].*/, "").lastIndexOf("/") + 1) : d = "", h = (K) => { + (l || c) && (c ? d = self.location.href : typeof document != "undefined" && document.currentScript && (d = document.currentScript.src), r16 && (d = r16), d.indexOf("blob:") !== 0 ? d = d.substr(0, d.replace(/[?#].*/, "").lastIndexOf("/") + 1) : d = "", h = (K) => { var ae = new XMLHttpRequest(); return ae.open("GET", K, false), ae.send(null), ae.responseText; - }, l && (x = (K) => { + }, c && (x = (K) => { var ae = new XMLHttpRequest(); return ae.open("GET", K, false), ae.responseType = "arraybuffer", ae.send(null), new Uint8Array(ae.response); - }), g = (K, ae, $e) => { - var at = new XMLHttpRequest(); - at.open("GET", K, true), at.responseType = "arraybuffer", at.onload = () => { - if (at.status == 200 || at.status == 0 && at.response) { - ae(at.response); + }), g = (K, ae, Ee) => { + var it = new XMLHttpRequest(); + it.open("GET", K, true), it.responseType = "arraybuffer", it.onload = () => { + if (it.status == 200 || it.status == 0 && it.response) { + ae(it.response); return; } - $e(); - }, at.onerror = $e, at.send(null); + Ee(); + }, it.onerror = Ee, it.send(null); }, b = (K) => document.title = K); - var _ = e.print || console.log.bind(console), E = e.printErr || console.warn.bind(console); - Object.assign(e, a), a = null, e.arguments && (i = e.arguments), e.thisProgram && (p = e.thisProgram), e.quit && (u = e.quit); + var T = t10.print || console.log.bind(console), E = t10.printErr || console.warn.bind(console); + Object.assign(t10, a), a = null, t10.arguments && (i = t10.arguments), t10.thisProgram && (p = t10.thisProgram), t10.quit && (u = t10.quit); var R = 4, D; - e.wasmBinary && (D = e.wasmBinary); - var P = e.noExitRuntime || true; - typeof WebAssembly != "object" && fr("no native wasm support detected"); + t10.wasmBinary && (D = t10.wasmBinary); + var F = t10.noExitRuntime || true; + typeof WebAssembly != "object" && xr("no native wasm support detected"); var O, M = false, L; function B(K, ae) { - K || fr(ae); + K || xr(ae); } var z = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : void 0; - function U(K, ae, $e) { + function U(K, ae, Ee) { ae >>>= 0; - for (var at = ae + $e, _t = ae; K[_t] && !(_t >= at); ) - ++_t; - if (_t - ae > 16 && K.buffer && z) - return z.decode(K.subarray(ae, _t)); - for (var $t = ""; ae < _t; ) { - var Qe = K[ae++]; - if (!(Qe & 128)) { - $t += String.fromCharCode(Qe); + for (var it = ae + Ee, $t = ae; K[$t] && !($t >= it); ) + ++$t; + if ($t - ae > 16 && K.buffer && z) + return z.decode(K.subarray(ae, $t)); + for (var Rt = ""; ae < $t; ) { + var Ze = K[ae++]; + if (!(Ze & 128)) { + Rt += String.fromCharCode(Ze); continue; } - var Ke = K[ae++] & 63; - if ((Qe & 224) == 192) { - $t += String.fromCharCode((Qe & 31) << 6 | Ke); + var je = K[ae++] & 63; + if ((Ze & 224) == 192) { + Rt += String.fromCharCode((Ze & 31) << 6 | je); continue; } - var Ut = K[ae++] & 63; - if ((Qe & 240) == 224 ? Qe = (Qe & 15) << 12 | Ke << 6 | Ut : Qe = (Qe & 7) << 18 | Ke << 12 | Ut << 6 | K[ae++] & 63, Qe < 65536) - $t += String.fromCharCode(Qe); + var Ht = K[ae++] & 63; + if ((Ze & 240) == 224 ? Ze = (Ze & 15) << 12 | je << 6 | Ht : Ze = (Ze & 7) << 18 | je << 12 | Ht << 6 | K[ae++] & 63, Ze < 65536) + Rt += String.fromCharCode(Ze); else { - var oo = Qe - 65536; - $t += String.fromCharCode(55296 | oo >> 10, 56320 | oo & 1023); + var lo = Ze - 65536; + Rt += String.fromCharCode(55296 | lo >> 10, 56320 | lo & 1023); } } - return $t; + return Rt; } function j(K, ae) { return K >>>= 0, K ? U(ne, K, ae) : ""; } - function q(K, ae, $e, at) { - if ($e >>>= 0, !(at > 0)) + function q(K, ae, Ee, it) { + if (Ee >>>= 0, !(it > 0)) return 0; - for (var _t = $e, $t = $e + at - 1, Qe = 0; Qe < K.length; ++Qe) { - var Ke = K.charCodeAt(Qe); - if (Ke >= 55296 && Ke <= 57343) { - var Ut = K.charCodeAt(++Qe); - Ke = 65536 + ((Ke & 1023) << 10) | Ut & 1023; + for (var $t = Ee, Rt = Ee + it - 1, Ze = 0; Ze < K.length; ++Ze) { + var je = K.charCodeAt(Ze); + if (je >= 55296 && je <= 57343) { + var Ht = K.charCodeAt(++Ze); + je = 65536 + ((je & 1023) << 10) | Ht & 1023; } - if (Ke <= 127) { - if ($e >= $t) + if (je <= 127) { + if (Ee >= Rt) break; - ae[$e++ >>> 0] = Ke; - } else if (Ke <= 2047) { - if ($e + 1 >= $t) + ae[Ee++ >>> 0] = je; + } else if (je <= 2047) { + if (Ee + 1 >= Rt) break; - ae[$e++ >>> 0] = 192 | Ke >> 6, ae[$e++ >>> 0] = 128 | Ke & 63; - } else if (Ke <= 65535) { - if ($e + 2 >= $t) + ae[Ee++ >>> 0] = 192 | je >> 6, ae[Ee++ >>> 0] = 128 | je & 63; + } else if (je <= 65535) { + if (Ee + 2 >= Rt) break; - ae[$e++ >>> 0] = 224 | Ke >> 12, ae[$e++ >>> 0] = 128 | Ke >> 6 & 63, ae[$e++ >>> 0] = 128 | Ke & 63; + ae[Ee++ >>> 0] = 224 | je >> 12, ae[Ee++ >>> 0] = 128 | je >> 6 & 63, ae[Ee++ >>> 0] = 128 | je & 63; } else { - if ($e + 3 >= $t) + if (Ee + 3 >= Rt) break; - ae[$e++ >>> 0] = 240 | Ke >> 18, ae[$e++ >>> 0] = 128 | Ke >> 12 & 63, ae[$e++ >>> 0] = 128 | Ke >> 6 & 63, ae[$e++ >>> 0] = 128 | Ke & 63; + ae[Ee++ >>> 0] = 240 | je >> 18, ae[Ee++ >>> 0] = 128 | je >> 12 & 63, ae[Ee++ >>> 0] = 128 | je >> 6 & 63, ae[Ee++ >>> 0] = 128 | je & 63; } } - return ae[$e >>> 0] = 0, $e - _t; + return ae[Ee >>> 0] = 0, Ee - $t; } - function Y(K, ae, $e) { - return q(K, ne, ae, $e); + function Y(K, ae, Ee) { + return q(K, ne, ae, Ee); } - var J, re, ne, ee, oe, ie, le, be, _e; + var J, re, ne, ee, oe, ue, me, be, _e; function ve(K) { - J = K, e.HEAP8 = re = new Int8Array(K), e.HEAP16 = ee = new Int16Array(K), e.HEAP32 = ie = new Int32Array(K), e.HEAPU8 = ne = new Uint8Array(K), e.HEAPU16 = oe = new Uint16Array(K), e.HEAPU32 = le = new Uint32Array(K), e.HEAPF32 = be = new Float32Array(K), e.HEAPF64 = _e = new Float64Array(K); - } - var Fe = e.INITIAL_MEMORY || 16777216, Pe, st = [], ct = [], Ge = [], lt = false; - function it() { - return P; + J = K, t10.HEAP8 = re = new Int8Array(K), t10.HEAP16 = ee = new Int16Array(K), t10.HEAP32 = ue = new Int32Array(K), t10.HEAPU8 = ne = new Uint8Array(K), t10.HEAPU16 = oe = new Uint16Array(K), t10.HEAPU32 = me = new Uint32Array(K), t10.HEAPF32 = be = new Float32Array(K), t10.HEAPF64 = _e = new Float64Array(K); } - function ht() { - if (e.preRun) - for (typeof e.preRun == "function" && (e.preRun = [e.preRun]); e.preRun.length; ) - Mt(e.preRun.shift()); - Ua(st); + var Fe = t10.INITIAL_MEMORY || 16777216, Pe, at = [], ct = [], Ke = [], mt = false; + function ut() { + return F; } function gt() { - lt = true, Ua(ct); + if (t10.preRun) + for (typeof t10.preRun == "function" && (t10.preRun = [t10.preRun]); t10.preRun.length; ) + Bt(t10.preRun.shift()); + Ya(at); + } + function xt() { + mt = true, Ya(ct); } - function Mr() { - if (e.postRun) - for (typeof e.postRun == "function" && (e.postRun = [e.postRun]); e.postRun.length; ) - rr(e.postRun.shift()); - Ua(Ge); + function Ur() { + if (t10.postRun) + for (typeof t10.postRun == "function" && (t10.postRun = [t10.postRun]); t10.postRun.length; ) + sr(t10.postRun.shift()); + Ya(Ke); } - function Mt(K) { - st.unshift(K); + function Bt(K) { + at.unshift(K); } - function eo(K) { + function io(K) { ct.unshift(K); } - function rr(K) { - Ge.unshift(K); + function sr(K) { + Ke.unshift(K); } - var Tt = 0, or = null, nr = null; - function to(K) { - Tt++, e.monitorRunDependencies && e.monitorRunDependencies(Tt); + var Et = 0, ar = null, ir = null; + function uo(K) { + Et++, t10.monitorRunDependencies && t10.monitorRunDependencies(Et); } - function ro(K) { - if (Tt--, e.monitorRunDependencies && e.monitorRunDependencies(Tt), Tt == 0 && (or !== null && (clearInterval(or), or = null), nr)) { - var ae = nr; - nr = null, ae(); + function po(K) { + if (Et--, t10.monitorRunDependencies && t10.monitorRunDependencies(Et), Et == 0 && (ar !== null && (clearInterval(ar), ar = null), ir)) { + var ae = ir; + ir = null, ae(); } } - function fr(K) { - e.onAbort && e.onAbort(K), K = "Aborted(" + K + ")", E(K), M = true, L = 1, K += ". Build with -sASSERTIONS for more info."; + function xr(K) { + t10.onAbort && t10.onAbort(K), K = "Aborted(" + K + ")", E(K), M = true, L = 1, K += ". Build with -sASSERTIONS for more info."; var ae = new WebAssembly.RuntimeError(K); throw n(ae), ae; } - var Va = "data:application/octet-stream;base64,"; - function Lo(K) { - return K.startsWith(Va); + var ja = "data:application/octet-stream;base64,"; + function cn(K) { + return K.startsWith(ja); } - function Ks(K) { + function ta(K) { return K.startsWith("file://"); } - var Xt; - Xt = "tfjs-backend-wasm.wasm", Lo(Xt) || (Xt = f(Xt)); - function Wa(K) { + var Zt; + Zt = "tfjs-backend-wasm.wasm", cn(Zt) || (Zt = f(Zt)); + function Xa(K) { try { - if (K == Xt && D) + if (K == Zt && D) return new Uint8Array(D); if (x) return x(K); throw "both async and sync fetching of the wasm failed"; } catch (ae) { - fr(ae); + xr(ae); } } - function tl() { - if (!D && (c || l)) { - if (typeof fetch == "function" && !Ks(Xt)) - return fetch(Xt, { credentials: "same-origin" }).then(function(K) { + function lc() { + if (!D && (l || c)) { + if (typeof fetch == "function" && !ta(Zt)) + return fetch(Zt, { credentials: "same-origin" }).then(function(K) { if (!K.ok) - throw "failed to load wasm binary file at '" + Xt + "'"; + throw "failed to load wasm binary file at '" + Zt + "'"; return K.arrayBuffer(); }).catch(function() { - return Wa(Xt); + return Xa(Zt); }); if (g) return new Promise(function(K, ae) { - g(Xt, function($e) { - K(new Uint8Array($e)); + g(Zt, function(Ee) { + K(new Uint8Array(Ee)); }, ae); }); } return Promise.resolve().then(function() { - return Wa(Xt); + return Xa(Zt); }); } - function rl() { - var K = { env: ol, wasi_snapshot_preview1: ol }; - function ae(Qe, Ke) { - var Ut = Qe.exports; - e.asm = Ut, O = e.asm.memory, ve(O.buffer), Pe = e.asm.__indirect_function_table, eo(e.asm.__wasm_call_ctors), ro("wasm-instantiate"); - } - to("wasm-instantiate"); - function $e(Qe) { - ae(Qe.instance); - } - function at(Qe) { - return tl().then(function(Ke) { - return WebAssembly.instantiate(Ke, K); - }).then(function(Ke) { - return Ke; - }).then(Qe, function(Ke) { - E("failed to asynchronously prepare wasm: " + Ke), fr(Ke); + function cc() { + var K = { env: mc, wasi_snapshot_preview1: mc }; + function ae(Ze, je) { + var Ht = Ze.exports; + t10.asm = Ht, O = t10.asm.memory, ve(O.buffer), Pe = t10.asm.__indirect_function_table, io(t10.asm.__wasm_call_ctors), po("wasm-instantiate"); + } + uo("wasm-instantiate"); + function Ee(Ze) { + ae(Ze.instance); + } + function it(Ze) { + return lc().then(function(je) { + return WebAssembly.instantiate(je, K); + }).then(function(je) { + return je; + }).then(Ze, function(je) { + E("failed to asynchronously prepare wasm: " + je), xr(je); }); } - function _t() { - return !D && typeof WebAssembly.instantiateStreaming == "function" && !Lo(Xt) && !Ks(Xt) && !m && typeof fetch == "function" ? fetch(Xt, { credentials: "same-origin" }).then(function(Qe) { - var Ke = WebAssembly.instantiateStreaming(Qe, K); - return Ke.then($e, function(Ut) { - return E("wasm streaming compile failed: " + Ut), E("falling back to ArrayBuffer instantiation"), at($e); + function $t() { + return !D && typeof WebAssembly.instantiateStreaming == "function" && !cn(Zt) && !ta(Zt) && !m && typeof fetch == "function" ? fetch(Zt, { credentials: "same-origin" }).then(function(Ze) { + var je = WebAssembly.instantiateStreaming(Ze, K); + return je.then(Ee, function(Ht) { + return E("wasm streaming compile failed: " + Ht), E("falling back to ArrayBuffer instantiation"), it(Ee); }); - }) : at($e); + }) : it(Ee); } - if (e.instantiateWasm) + if (t10.instantiateWasm) try { - var $t = e.instantiateWasm(K, ae); - return $t; - } catch (Qe) { - E("Module.instantiateWasm callback failed with error: " + Qe), n(Qe); + var Rt = t10.instantiateWasm(K, ae); + return Rt; + } catch (Ze) { + E("Module.instantiateWasm callback failed with error: " + Ze), n(Ze); } - return _t().catch(n), {}; + return $t().catch(n), {}; } - var m0, vi; - function Rp(K) { + var Zv, Pi; + function Bp(K) { this.name = "ExitStatus", this.message = "Program terminated with exit(" + K + ")", this.status = K; } - function Ua(K) { + function Ya(K) { for (; K.length > 0; ) - K.shift()(e); + K.shift()(t10); } - function by() { - fr(""); + function Ay() { + xr(""); } - function bm() { + function Rm() { return 4294901760; } - function Su() { - return bm(); + function Ru() { + return Rm(); } - function Cy(K, ae, $e) { - ne.copyWithin(K >>> 0, ae >>> 0, ae + $e >>> 0); + function Fy(K, ae, Ee) { + ne.copyWithin(K >>> 0, ae >>> 0, ae + Ee >>> 0); } - function Cm(K) { + function Dm(K) { try { return O.grow(K - J.byteLength + 65535 >>> 16), ve(O.buffer), 1; } catch (ae) { } } - function Dp(K) { + function zp(K) { var ae = ne.length; K = K >>> 0; - var $e = bm(); - if (K > $e) + var Ee = Rm(); + if (K > Ee) return false; - let at = (Ut, oo) => Ut + (oo - Ut % oo) % oo; - for (var _t = 1; _t <= 4; _t *= 2) { - var $t = ae * (1 + 0.2 / _t); - $t = Math.min($t, K + 100663296); - var Qe = Math.min($e, at(Math.max(K, $t), 65536)), Ke = Cm(Qe); - if (Ke) + let it = (Ht, lo) => Ht + (lo - Ht % lo) % lo; + for (var $t = 1; $t <= 4; $t *= 2) { + var Rt = ae * (1 + 0.2 / $t); + Rt = Math.min(Rt, K + 100663296); + var Ze = Math.min(Ee, it(Math.max(K, Rt), 65536)), je = Dm(Ze); + if (je) return true; } return false; } - var hr = { varargs: void 0, get: function() { - hr.varargs += 4; - var K = ie[hr.varargs - 4 >>> 2]; + var yr = { varargs: void 0, get: function() { + yr.varargs += 4; + var K = ue[yr.varargs - 4 >>> 2]; return K; }, getStr: function(K) { var ae = j(K); return ae; } }; - function wm(K) { + function Am(K) { return 52; } - function wy(K, ae, $e, at, _t) { + function Py(K, ae, Ee, it, $t) { return 70; } - var Sy = [null, [], []]; - function d0(K, ae) { - var $e = Sy[K]; - ae === 0 || ae === 10 ? ((K === 1 ? _ : E)(U($e, 0)), $e.length = 0) : $e.push(ae); + var Oy = [null, [], []]; + function Jv(K, ae) { + var Ee = Oy[K]; + ae === 0 || ae === 10 ? ((K === 1 ? T : E)(U(Ee, 0)), Ee.length = 0) : Ee.push(ae); } - function f0(K, ae, $e, at) { - for (var _t = 0, $t = 0; $t < $e; $t++) { - var Qe = le[ae >>> 2], Ke = le[ae + 4 >>> 2]; + function ek(K, ae, Ee, it) { + for (var $t = 0, Rt = 0; Rt < Ee; Rt++) { + var Ze = me[ae >>> 2], je = me[ae + 4 >>> 2]; ae += 8; - for (var Ut = 0; Ut < Ke; Ut++) - d0(K, ne[Qe + Ut >>> 0]); - _t += Ke; + for (var Ht = 0; Ht < je; Ht++) + Jv(K, ne[Ze + Ht >>> 0]); + $t += je; } - return le[at >>> 2] = _t, 0; + return me[it >>> 2] = $t, 0; } - function Sm(K) { - var ae = e["_" + K]; + function Fm(K) { + var ae = t10["_" + K]; return ae; } - function Iu(K, ae) { + function Du(K, ae) { re.set(K, ae >>> 0); } - function Iy(K, ae, $e, at, _t) { - var $t = { string: (yr) => { - var Ni = 0; - if (yr != null && yr !== 0) { - var Bm = (yr.length << 2) + 1; - Ni = ul(Bm), Y(yr, Ni, Bm); + function My(K, ae, Ee, it, $t) { + var Rt = { string: (wr) => { + var Mi = 0; + if (wr != null && wr !== 0) { + var Qm = (wr.length << 2) + 1; + Mi = xc(Qm), Y(wr, Mi, Qm); } - return Ni; - }, array: (yr) => { - var Ni = ul(yr.length); - return Iu(yr, Ni), Ni; + return Mi; + }, array: (wr) => { + var Mi = xc(wr.length); + return Du(wr, Mi), Mi; } }; - function Qe(yr) { - return ae === "string" ? j(yr) : ae === "boolean" ? !!yr : yr; - } - var Ke = Sm(K), Ut = [], oo = 0; - if (at) - for (var Ga = 0; Ga < at.length; Ga++) { - var Lm = $t[$e[Ga]]; - Lm ? (oo === 0 && (oo = Pm()), Ut[Ga] = Lm(at[Ga])) : Ut[Ga] = at[Ga]; + function Ze(wr) { + return ae === "string" ? j(wr) : ae === "boolean" ? !!wr : wr; + } + var je = Fm(K), Ht = [], lo = 0; + if (it) + for (var Qa = 0; Qa < it.length; Qa++) { + var Ym = Rt[Ee[Qa]]; + Ym ? (lo === 0 && (lo = qm()), Ht[Qa] = Ym(it[Qa])) : Ht[Qa] = it[Qa]; } - var pl = Ke.apply(null, Ut); - function KC(yr) { - return oo !== 0 && Om(oo), Qe(yr); + var yc = je.apply(null, Ht); + function aw(wr) { + return lo !== 0 && jm(lo), Ze(wr); } - return pl = KC(pl), pl; + return yc = aw(yc), yc; } - function vy(K, ae, $e, at) { - $e = $e || []; - var _t = $e.every((Qe) => Qe === "number" || Qe === "boolean"), $t = ae !== "string"; - return $t && _t && !at ? Sm(K) : function() { - return Iy(K, ae, $e, arguments, at); + function Ly(K, ae, Ee, it) { + Ee = Ee || []; + var $t = Ee.every((Ze) => Ze === "number" || Ze === "boolean"), Rt = ae !== "string"; + return Rt && $t && !it ? Fm(K) : function() { + return My(K, ae, Ee, arguments, it); }; } - var ol = { abort: by, emscripten_get_heap_max: Su, emscripten_memcpy_big: Cy, emscripten_resize_heap: Dp, fd_close: wm, fd_seek: wy, fd_write: f0 }, ky = rl(), Im = e.___wasm_call_ctors = function() { - return (Im = e.___wasm_call_ctors = e.asm.__wasm_call_ctors).apply(null, arguments); - }, vm = e._init = function() { - return (vm = e._init = e.asm.init).apply(null, arguments); - }, Ny = e._init_with_threads_count = function() { - return (Ny = e._init_with_threads_count = e.asm.init_with_threads_count).apply(null, arguments); - }, km = e._get_threads_count = function() { - return (km = e._get_threads_count = e.asm.get_threads_count).apply(null, arguments); - }, Ty = e._register_tensor = function() { - return (Ty = e._register_tensor = e.asm.register_tensor).apply(null, arguments); - }, Me = e._dispose_data = function() { - return (Me = e._dispose_data = e.asm.dispose_data).apply(null, arguments); - }, nl = e._dispose = function() { - return (nl = e._dispose = e.asm.dispose).apply(null, arguments); - }, _y = e._Abs = function() { - return (_y = e._Abs = e.asm.Abs).apply(null, arguments); - }, Nm = e._Acos = function() { - return (Nm = e._Acos = e.asm.Acos).apply(null, arguments); - }, Ap = e._Acosh = function() { - return (Ap = e._Acosh = e.asm.Acosh).apply(null, arguments); - }, $y = e._Add = function() { - return ($y = e._Add = e.asm.Add).apply(null, arguments); - }, Ey = e._AddN = function() { - return (Ey = e._AddN = e.asm.AddN).apply(null, arguments); - }, Ry = e._All = function() { - return (Ry = e._All = e.asm.All).apply(null, arguments); - }, Dy = e._Any = function() { - return (Dy = e._Any = e.asm.Any).apply(null, arguments); - }, Ay = e._ArgMax = function() { - return (Ay = e._ArgMax = e.asm.ArgMax).apply(null, arguments); - }, Tm = e._ArgMin = function() { - return (Tm = e._ArgMin = e.asm.ArgMin).apply(null, arguments); - }, _m = e._Asin = function() { - return (_m = e._Asin = e.asm.Asin).apply(null, arguments); - }, Fy = e._Asinh = function() { - return (Fy = e._Asinh = e.asm.Asinh).apply(null, arguments); - }, Py = e._Atan = function() { - return (Py = e._Atan = e.asm.Atan).apply(null, arguments); - }, Oy = e._Atan2 = function() { - return (Oy = e._Atan2 = e.asm.Atan2).apply(null, arguments); - }, sl = e._Atanh = function() { - return (sl = e._Atanh = e.asm.Atanh).apply(null, arguments); - }, My = e._AvgPool = function() { - return (My = e._AvgPool = e.asm.AvgPool).apply(null, arguments); - }, Ly = e._AvgPool3D = function() { - return (Ly = e._AvgPool3D = e.asm.AvgPool3D).apply(null, arguments); - }, By = e._AvgPool3DGrad = function() { - return (By = e._AvgPool3DGrad = e.asm.AvgPool3DGrad).apply(null, arguments); - }, vu = e._AvgPoolGrad = function() { - return (vu = e._AvgPoolGrad = e.asm.AvgPoolGrad).apply(null, arguments); - }, zy = e._BatchMatMul = function() { - return (zy = e._BatchMatMul = e.asm.BatchMatMul).apply(null, arguments); - }, Vy = e._Bincount = function() { - return (Vy = e._Bincount = e.asm.Bincount).apply(null, arguments); - }, $m = e._BitwiseAnd = function() { - return ($m = e._BitwiseAnd = e.asm.BitwiseAnd).apply(null, arguments); - }, Wy = e._Ceil = function() { - return (Wy = e._Ceil = e.asm.Ceil).apply(null, arguments); - }, al = e._ClipByValue = function() { - return (al = e._ClipByValue = e.asm.ClipByValue).apply(null, arguments); - }, Uy = e._Conv2D = function() { - return (Uy = e._Conv2D = e.asm.Conv2D).apply(null, arguments); - }, Gy = e._Conv2DBackpropInput = function() { - return (Gy = e._Conv2DBackpropInput = e.asm.Conv2DBackpropInput).apply(null, arguments); - }, Hy = e._Conv3D = function() { - return (Hy = e._Conv3D = e.asm.Conv3D).apply(null, arguments); - }, ki = e._Conv3DBackpropFilterV2 = function() { - return (ki = e._Conv3DBackpropFilterV2 = e.asm.Conv3DBackpropFilterV2).apply(null, arguments); - }, il = e._Conv3DBackpropInputV2 = function() { - return (il = e._Conv3DBackpropInputV2 = e.asm.Conv3DBackpropInputV2).apply(null, arguments); - }, Ky = e._Cos = function() { - return (Ky = e._Cos = e.asm.Cos).apply(null, arguments); - }, qy = e._Cosh = function() { - return (qy = e._Cosh = e.asm.Cosh).apply(null, arguments); - }, jy = e._CropAndResize = function() { - return (jy = e._CropAndResize = e.asm.CropAndResize).apply(null, arguments); - }, Xy = e._Cumprod = function() { - return (Xy = e._Cumprod = e.asm.Cumprod).apply(null, arguments); - }, Em = e._Cumsum = function() { - return (Em = e._Cumsum = e.asm.Cumsum).apply(null, arguments); - }, Rm = e._DenseBincount = function() { - return (Rm = e._DenseBincount = e.asm.DenseBincount).apply(null, arguments); - }, Yy = e._DepthToSpace = function() { - return (Yy = e._DepthToSpace = e.asm.DepthToSpace).apply(null, arguments); - }, Qy = e._DepthwiseConv2dNative = function() { - return (Qy = e._DepthwiseConv2dNative = e.asm.DepthwiseConv2dNative).apply(null, arguments); - }, Dm = e._Diag = function() { - return (Dm = e._Diag = e.asm.Diag).apply(null, arguments); - }, Am = e._Dilation2D = function() { - return (Am = e._Dilation2D = e.asm.Dilation2D).apply(null, arguments); - }, Zy = e._Dilation2DBackpropFilter = function() { - return (Zy = e._Dilation2DBackpropFilter = e.asm.Dilation2DBackpropFilter).apply(null, arguments); - }, Jy = e._Dilation2DBackpropInput = function() { - return (Jy = e._Dilation2DBackpropInput = e.asm.Dilation2DBackpropInput).apply(null, arguments); - }, eb = e._Elu = function() { - return (eb = e._Elu = e.asm.Elu).apply(null, arguments); - }, tb = e._EluGrad = function() { - return (tb = e._EluGrad = e.asm.EluGrad).apply(null, arguments); - }, Fm = e._Equal = function() { - return (Fm = e._Equal = e.asm.Equal).apply(null, arguments); - }, h0 = e._Erf = function() { - return (h0 = e._Erf = e.asm.Erf).apply(null, arguments); - }, rb = e._Exp = function() { - return (rb = e._Exp = e.asm.Exp).apply(null, arguments); - }, ob = e._Expm1 = function() { - return (ob = e._Expm1 = e.asm.Expm1).apply(null, arguments); - }, nb = e._FlipLeftRight = function() { - return (nb = e._FlipLeftRight = e.asm.FlipLeftRight).apply(null, arguments); - }, sb = e._Floor = function() { - return (sb = e._Floor = e.asm.Floor).apply(null, arguments); - }, ab = e._FloorDiv = function() { - return (ab = e._FloorDiv = e.asm.FloorDiv).apply(null, arguments); - }, ib = e._FusedBatchNorm = function() { - return (ib = e._FusedBatchNorm = e.asm.FusedBatchNorm).apply(null, arguments); - }, ub = e._FusedConv2D = function() { - return (ub = e._FusedConv2D = e.asm.FusedConv2D).apply(null, arguments); - }, pb = e._FusedDepthwiseConv2D = function() { - return (pb = e._FusedDepthwiseConv2D = e.asm.FusedDepthwiseConv2D).apply(null, arguments); - }, cb = e._Gather = function() { - return (cb = e._Gather = e.asm.Gather).apply(null, arguments); - }, lb = e._GatherNd = function() { - return (lb = e._GatherNd = e.asm.GatherNd).apply(null, arguments); - }, mb = e._Greater = function() { - return (mb = e._Greater = e.asm.Greater).apply(null, arguments); - }, db = e._GreaterEqual = function() { - return (db = e._GreaterEqual = e.asm.GreaterEqual).apply(null, arguments); - }, fb = e._IsFinite = function() { - return (fb = e._IsFinite = e.asm.IsFinite).apply(null, arguments); - }, hb = e._IsInf = function() { - return (hb = e._IsInf = e.asm.IsInf).apply(null, arguments); - }, gb = e._IsNan = function() { - return (gb = e._IsNan = e.asm.IsNan).apply(null, arguments); - }, xb = e._LRN = function() { - return (xb = e._LRN = e.asm.LRN).apply(null, arguments); - }, yb = e._LRNGrad = function() { - return (yb = e._LRNGrad = e.asm.LRNGrad).apply(null, arguments); - }, bb = e._LeakyRelu = function() { - return (bb = e._LeakyRelu = e.asm.LeakyRelu).apply(null, arguments); - }, Cb = e._Less = function() { - return (Cb = e._Less = e.asm.Less).apply(null, arguments); - }, wb = e._LessEqual = function() { - return (wb = e._LessEqual = e.asm.LessEqual).apply(null, arguments); - }, Sb = e._LinSpace = function() { - return (Sb = e._LinSpace = e.asm.LinSpace).apply(null, arguments); - }, Ib = e._Log = function() { - return (Ib = e._Log = e.asm.Log).apply(null, arguments); - }, vb = e._Log1p = function() { - return (vb = e._Log1p = e.asm.Log1p).apply(null, arguments); - }, kb = e._LogicalAnd = function() { - return (kb = e._LogicalAnd = e.asm.LogicalAnd).apply(null, arguments); - }, Nb = e._LogicalNot = function() { - return (Nb = e._LogicalNot = e.asm.LogicalNot).apply(null, arguments); - }, Tb = e._LogicalOr = function() { - return (Tb = e._LogicalOr = e.asm.LogicalOr).apply(null, arguments); - }, _b = e._LogicalXor = function() { - return (_b = e._LogicalXor = e.asm.LogicalXor).apply(null, arguments); - }, $b = e._Max = function() { - return ($b = e._Max = e.asm.Max).apply(null, arguments); - }, Eb = e._MaxPool = function() { - return (Eb = e._MaxPool = e.asm.MaxPool).apply(null, arguments); - }, Rb = e._MaxPool3D = function() { - return (Rb = e._MaxPool3D = e.asm.MaxPool3D).apply(null, arguments); - }, Db = e._MaxPool3DGrad = function() { - return (Db = e._MaxPool3DGrad = e.asm.MaxPool3DGrad).apply(null, arguments); - }, Ab = e._MaxPoolGrad = function() { - return (Ab = e._MaxPoolGrad = e.asm.MaxPoolGrad).apply(null, arguments); - }, Fb = e._MaxPoolWithArgmax = function() { - return (Fb = e._MaxPoolWithArgmax = e.asm.MaxPoolWithArgmax).apply(null, arguments); - }, Pb = e._Maximum = function() { - return (Pb = e._Maximum = e.asm.Maximum).apply(null, arguments); - }, Ob = e._Mean = function() { - return (Ob = e._Mean = e.asm.Mean).apply(null, arguments); - }, Mb = e._Min = function() { - return (Mb = e._Min = e.asm.Min).apply(null, arguments); - }, Lb = e._Minimum = function() { - return (Lb = e._Minimum = e.asm.Minimum).apply(null, arguments); - }, Bb = e._MirrorPad = function() { - return (Bb = e._MirrorPad = e.asm.MirrorPad).apply(null, arguments); - }, zb = e._Mod = function() { - return (zb = e._Mod = e.asm.Mod).apply(null, arguments); - }, Vb = e._Multinomial = function() { - return (Vb = e._Multinomial = e.asm.Multinomial).apply(null, arguments); - }, Wb = e._Multiply = function() { - return (Wb = e._Multiply = e.asm.Multiply).apply(null, arguments); - }, Ub = e._Neg = function() { - return (Ub = e._Neg = e.asm.Neg).apply(null, arguments); - }, Gb = e._NonMaxSuppressionV3 = function() { - return (Gb = e._NonMaxSuppressionV3 = e.asm.NonMaxSuppressionV3).apply(null, arguments); - }, Hb = e._NonMaxSuppressionV4 = function() { - return (Hb = e._NonMaxSuppressionV4 = e.asm.NonMaxSuppressionV4).apply(null, arguments); - }, Kb = e._NonMaxSuppressionV5 = function() { - return (Kb = e._NonMaxSuppressionV5 = e.asm.NonMaxSuppressionV5).apply(null, arguments); - }, qb = e._NotEqual = function() { - return (qb = e._NotEqual = e.asm.NotEqual).apply(null, arguments); - }, jb = e._OneHot = function() { - return (jb = e._OneHot = e.asm.OneHot).apply(null, arguments); - }, Xb = e._PadV2 = function() { - return (Xb = e._PadV2 = e.asm.PadV2).apply(null, arguments); - }, Yb = e._Pow = function() { - return (Yb = e._Pow = e.asm.Pow).apply(null, arguments); - }, Qb = e._Prelu = function() { - return (Qb = e._Prelu = e.asm.Prelu).apply(null, arguments); - }, Zb = e._Prod = function() { - return (Zb = e._Prod = e.asm.Prod).apply(null, arguments); - }, Jb = e._RealDiv = function() { - return (Jb = e._RealDiv = e.asm.RealDiv).apply(null, arguments); - }, eC = e._Reciprocal = function() { - return (eC = e._Reciprocal = e.asm.Reciprocal).apply(null, arguments); - }, tC = e._Relu = function() { - return (tC = e._Relu = e.asm.Relu).apply(null, arguments); - }, rC = e._Relu6 = function() { - return (rC = e._Relu6 = e.asm.Relu6).apply(null, arguments); - }, oC = e._ResizeBilinear = function() { - return (oC = e._ResizeBilinear = e.asm.ResizeBilinear).apply(null, arguments); - }, nC = e._ResizeBilinearGrad = function() { - return (nC = e._ResizeBilinearGrad = e.asm.ResizeBilinearGrad).apply(null, arguments); - }, sC = e._ResizeNearestNeighbor = function() { - return (sC = e._ResizeNearestNeighbor = e.asm.ResizeNearestNeighbor).apply(null, arguments); - }, aC = e._ResizeNearestNeighborGrad = function() { - return (aC = e._ResizeNearestNeighborGrad = e.asm.ResizeNearestNeighborGrad).apply(null, arguments); - }, iC = e._Reverse = function() { - return (iC = e._Reverse = e.asm.Reverse).apply(null, arguments); - }, uC = e._RotateWithOffset = function() { - return (uC = e._RotateWithOffset = e.asm.RotateWithOffset).apply(null, arguments); - }, pC = e._Round = function() { - return (pC = e._Round = e.asm.Round).apply(null, arguments); - }, cC = e._Rsqrt = function() { - return (cC = e._Rsqrt = e.asm.Rsqrt).apply(null, arguments); - }, lC = e._ScatterNd = function() { - return (lC = e._ScatterNd = e.asm.ScatterNd).apply(null, arguments); - }, mC = e._SearchSorted = function() { - return (mC = e._SearchSorted = e.asm.SearchSorted).apply(null, arguments); - }, dC = e._SelectV2 = function() { - return (dC = e._SelectV2 = e.asm.SelectV2).apply(null, arguments); - }, fC = e._Selu = function() { - return (fC = e._Selu = e.asm.Selu).apply(null, arguments); - }, hC = e._Sigmoid = function() { - return (hC = e._Sigmoid = e.asm.Sigmoid).apply(null, arguments); - }, gC = e._Sign = function() { - return (gC = e._Sign = e.asm.Sign).apply(null, arguments); - }, xC = e._Sin = function() { - return (xC = e._Sin = e.asm.Sin).apply(null, arguments); - }, yC = e._Sinh = function() { - return (yC = e._Sinh = e.asm.Sinh).apply(null, arguments); - }, bC = e._Softmax = function() { - return (bC = e._Softmax = e.asm.Softmax).apply(null, arguments); - }, CC = e._Softplus = function() { - return (CC = e._Softplus = e.asm.Softplus).apply(null, arguments); - }, wC = e._SparseFillEmptyRows = function() { - return (wC = e._SparseFillEmptyRows = e.asm.SparseFillEmptyRows).apply(null, arguments); - }, SC = e._SparseReshape = function() { - return (SC = e._SparseReshape = e.asm.SparseReshape).apply(null, arguments); - }, IC = e._SparseSegmentReduction = function() { - return (IC = e._SparseSegmentReduction = e.asm.SparseSegmentReduction).apply(null, arguments); - }, vC = e._SparseToDense = function() { - return (vC = e._SparseToDense = e.asm.SparseToDense).apply(null, arguments); - }, kC = e._Sqrt = function() { - return (kC = e._Sqrt = e.asm.Sqrt).apply(null, arguments); - }, NC = e._Square = function() { - return (NC = e._Square = e.asm.Square).apply(null, arguments); - }, TC = e._SquaredDifference = function() { - return (TC = e._SquaredDifference = e.asm.SquaredDifference).apply(null, arguments); - }, _C = e._Step = function() { - return (_C = e._Step = e.asm.Step).apply(null, arguments); - }, $C = e._StridedSlice = function() { - return ($C = e._StridedSlice = e.asm.StridedSlice).apply(null, arguments); - }, EC = e._Sub = function() { - return (EC = e._Sub = e.asm.Sub).apply(null, arguments); - }, RC = e._Sum = function() { - return (RC = e._Sum = e.asm.Sum).apply(null, arguments); - }, DC = e._Tan = function() { - return (DC = e._Tan = e.asm.Tan).apply(null, arguments); - }, AC = e._Tanh = function() { - return (AC = e._Tanh = e.asm.Tanh).apply(null, arguments); - }, FC = e._TensorScatterUpdate = function() { - return (FC = e._TensorScatterUpdate = e.asm.TensorScatterUpdate).apply(null, arguments); - }, PC = e._Tile = function() { - return (PC = e._Tile = e.asm.Tile).apply(null, arguments); - }, OC = e._TopK = function() { - return (OC = e._TopK = e.asm.TopK).apply(null, arguments); - }, MC = e._Transform = function() { - return (MC = e._Transform = e.asm.Transform).apply(null, arguments); - }, LC = e._Transpose = function() { - return (LC = e._Transpose = e.asm.Transpose).apply(null, arguments); - }, BC = e.__FusedMatMul = function() { - return (BC = e.__FusedMatMul = e.asm._FusedMatMul).apply(null, arguments); - }, zC = e._malloc = function() { - return (zC = e._malloc = e.asm.malloc).apply(null, arguments); - }, VC = e._free = function() { - return (VC = e._free = e.asm.free).apply(null, arguments); - }, WC = e.___errno_location = function() { - return (WC = e.___errno_location = e.asm.__errno_location).apply(null, arguments); - }, Pm = e.stackSave = function() { - return (Pm = e.stackSave = e.asm.stackSave).apply(null, arguments); - }, Om = e.stackRestore = function() { - return (Om = e.stackRestore = e.asm.stackRestore).apply(null, arguments); - }, ul = e.stackAlloc = function() { - return (ul = e.stackAlloc = e.asm.stackAlloc).apply(null, arguments); - }, UC = e.dynCall_iijjiiii = function() { - return (UC = e.dynCall_iijjiiii = e.asm.dynCall_iijjiiii).apply(null, arguments); - }, GC = e.dynCall_jiji = function() { - return (GC = e.dynCall_jiji = e.asm.dynCall_jiji).apply(null, arguments); + var mc = { abort: Ay, emscripten_get_heap_max: Ru, emscripten_memcpy_big: Fy, emscripten_resize_heap: zp, fd_close: Am, fd_seek: Py, fd_write: ek }, By = cc(), Pm = t10.___wasm_call_ctors = function() { + return (Pm = t10.___wasm_call_ctors = t10.asm.__wasm_call_ctors).apply(null, arguments); + }, Om = t10._init = function() { + return (Om = t10._init = t10.asm.init).apply(null, arguments); + }, zy = t10._init_with_threads_count = function() { + return (zy = t10._init_with_threads_count = t10.asm.init_with_threads_count).apply(null, arguments); + }, Mm = t10._get_threads_count = function() { + return (Mm = t10._get_threads_count = t10.asm.get_threads_count).apply(null, arguments); + }, Vy = t10._register_tensor = function() { + return (Vy = t10._register_tensor = t10.asm.register_tensor).apply(null, arguments); + }, Me = t10._dispose_data = function() { + return (Me = t10._dispose_data = t10.asm.dispose_data).apply(null, arguments); + }, dc = t10._dispose = function() { + return (dc = t10._dispose = t10.asm.dispose).apply(null, arguments); + }, Wy = t10._Abs = function() { + return (Wy = t10._Abs = t10.asm.Abs).apply(null, arguments); + }, Lm = t10._Acos = function() { + return (Lm = t10._Acos = t10.asm.Acos).apply(null, arguments); + }, Vp = t10._Acosh = function() { + return (Vp = t10._Acosh = t10.asm.Acosh).apply(null, arguments); + }, Uy = t10._Add = function() { + return (Uy = t10._Add = t10.asm.Add).apply(null, arguments); + }, Gy = t10._AddN = function() { + return (Gy = t10._AddN = t10.asm.AddN).apply(null, arguments); + }, Hy = t10._All = function() { + return (Hy = t10._All = t10.asm.All).apply(null, arguments); + }, Ky = t10._Any = function() { + return (Ky = t10._Any = t10.asm.Any).apply(null, arguments); + }, qy = t10._ArgMax = function() { + return (qy = t10._ArgMax = t10.asm.ArgMax).apply(null, arguments); + }, Bm = t10._ArgMin = function() { + return (Bm = t10._ArgMin = t10.asm.ArgMin).apply(null, arguments); + }, zm = t10._Asin = function() { + return (zm = t10._Asin = t10.asm.Asin).apply(null, arguments); + }, jy = t10._Asinh = function() { + return (jy = t10._Asinh = t10.asm.Asinh).apply(null, arguments); + }, Xy = t10._Atan = function() { + return (Xy = t10._Atan = t10.asm.Atan).apply(null, arguments); + }, Yy = t10._Atan2 = function() { + return (Yy = t10._Atan2 = t10.asm.Atan2).apply(null, arguments); + }, fc = t10._Atanh = function() { + return (fc = t10._Atanh = t10.asm.Atanh).apply(null, arguments); + }, Qy = t10._AvgPool = function() { + return (Qy = t10._AvgPool = t10.asm.AvgPool).apply(null, arguments); + }, Zy = t10._AvgPool3D = function() { + return (Zy = t10._AvgPool3D = t10.asm.AvgPool3D).apply(null, arguments); + }, Jy = t10._AvgPool3DGrad = function() { + return (Jy = t10._AvgPool3DGrad = t10.asm.AvgPool3DGrad).apply(null, arguments); + }, Au = t10._AvgPoolGrad = function() { + return (Au = t10._AvgPoolGrad = t10.asm.AvgPoolGrad).apply(null, arguments); + }, eb = t10._BatchMatMul = function() { + return (eb = t10._BatchMatMul = t10.asm.BatchMatMul).apply(null, arguments); + }, tb = t10._Bincount = function() { + return (tb = t10._Bincount = t10.asm.Bincount).apply(null, arguments); + }, Vm = t10._BitwiseAnd = function() { + return (Vm = t10._BitwiseAnd = t10.asm.BitwiseAnd).apply(null, arguments); + }, rb = t10._Ceil = function() { + return (rb = t10._Ceil = t10.asm.Ceil).apply(null, arguments); + }, hc = t10._ClipByValue = function() { + return (hc = t10._ClipByValue = t10.asm.ClipByValue).apply(null, arguments); + }, ob = t10._Conv2D = function() { + return (ob = t10._Conv2D = t10.asm.Conv2D).apply(null, arguments); + }, nb = t10._Conv2DBackpropInput = function() { + return (nb = t10._Conv2DBackpropInput = t10.asm.Conv2DBackpropInput).apply(null, arguments); + }, sb = t10._Conv3D = function() { + return (sb = t10._Conv3D = t10.asm.Conv3D).apply(null, arguments); + }, Oi = t10._Conv3DBackpropFilterV2 = function() { + return (Oi = t10._Conv3DBackpropFilterV2 = t10.asm.Conv3DBackpropFilterV2).apply(null, arguments); + }, gc = t10._Conv3DBackpropInputV2 = function() { + return (gc = t10._Conv3DBackpropInputV2 = t10.asm.Conv3DBackpropInputV2).apply(null, arguments); + }, ab = t10._Cos = function() { + return (ab = t10._Cos = t10.asm.Cos).apply(null, arguments); + }, ib = t10._Cosh = function() { + return (ib = t10._Cosh = t10.asm.Cosh).apply(null, arguments); + }, ub = t10._CropAndResize = function() { + return (ub = t10._CropAndResize = t10.asm.CropAndResize).apply(null, arguments); + }, pb = t10._Cumprod = function() { + return (pb = t10._Cumprod = t10.asm.Cumprod).apply(null, arguments); + }, Wm = t10._Cumsum = function() { + return (Wm = t10._Cumsum = t10.asm.Cumsum).apply(null, arguments); + }, Um = t10._DenseBincount = function() { + return (Um = t10._DenseBincount = t10.asm.DenseBincount).apply(null, arguments); + }, lb = t10._DepthToSpace = function() { + return (lb = t10._DepthToSpace = t10.asm.DepthToSpace).apply(null, arguments); + }, cb = t10._DepthwiseConv2dNative = function() { + return (cb = t10._DepthwiseConv2dNative = t10.asm.DepthwiseConv2dNative).apply(null, arguments); + }, Gm = t10._Diag = function() { + return (Gm = t10._Diag = t10.asm.Diag).apply(null, arguments); + }, Hm = t10._Dilation2D = function() { + return (Hm = t10._Dilation2D = t10.asm.Dilation2D).apply(null, arguments); + }, mb = t10._Dilation2DBackpropFilter = function() { + return (mb = t10._Dilation2DBackpropFilter = t10.asm.Dilation2DBackpropFilter).apply(null, arguments); + }, db = t10._Dilation2DBackpropInput = function() { + return (db = t10._Dilation2DBackpropInput = t10.asm.Dilation2DBackpropInput).apply(null, arguments); + }, fb = t10._Elu = function() { + return (fb = t10._Elu = t10.asm.Elu).apply(null, arguments); + }, hb = t10._EluGrad = function() { + return (hb = t10._EluGrad = t10.asm.EluGrad).apply(null, arguments); + }, Km = t10._Equal = function() { + return (Km = t10._Equal = t10.asm.Equal).apply(null, arguments); + }, tk = t10._Erf = function() { + return (tk = t10._Erf = t10.asm.Erf).apply(null, arguments); + }, gb = t10._Exp = function() { + return (gb = t10._Exp = t10.asm.Exp).apply(null, arguments); + }, xb = t10._Expm1 = function() { + return (xb = t10._Expm1 = t10.asm.Expm1).apply(null, arguments); + }, yb = t10._FlipLeftRight = function() { + return (yb = t10._FlipLeftRight = t10.asm.FlipLeftRight).apply(null, arguments); + }, bb = t10._Floor = function() { + return (bb = t10._Floor = t10.asm.Floor).apply(null, arguments); + }, Cb = t10._FloorDiv = function() { + return (Cb = t10._FloorDiv = t10.asm.FloorDiv).apply(null, arguments); + }, wb = t10._FusedBatchNorm = function() { + return (wb = t10._FusedBatchNorm = t10.asm.FusedBatchNorm).apply(null, arguments); + }, Sb = t10._FusedConv2D = function() { + return (Sb = t10._FusedConv2D = t10.asm.FusedConv2D).apply(null, arguments); + }, Ib = t10._FusedDepthwiseConv2D = function() { + return (Ib = t10._FusedDepthwiseConv2D = t10.asm.FusedDepthwiseConv2D).apply(null, arguments); + }, vb = t10._Gather = function() { + return (vb = t10._Gather = t10.asm.Gather).apply(null, arguments); + }, kb = t10._GatherNd = function() { + return (kb = t10._GatherNd = t10.asm.GatherNd).apply(null, arguments); + }, Nb = t10._Greater = function() { + return (Nb = t10._Greater = t10.asm.Greater).apply(null, arguments); + }, Tb = t10._GreaterEqual = function() { + return (Tb = t10._GreaterEqual = t10.asm.GreaterEqual).apply(null, arguments); + }, _b = t10._IsFinite = function() { + return (_b = t10._IsFinite = t10.asm.IsFinite).apply(null, arguments); + }, Eb = t10._IsInf = function() { + return (Eb = t10._IsInf = t10.asm.IsInf).apply(null, arguments); + }, $b = t10._IsNan = function() { + return ($b = t10._IsNan = t10.asm.IsNan).apply(null, arguments); + }, Rb = t10._LRN = function() { + return (Rb = t10._LRN = t10.asm.LRN).apply(null, arguments); + }, Db = t10._LRNGrad = function() { + return (Db = t10._LRNGrad = t10.asm.LRNGrad).apply(null, arguments); + }, Ab = t10._LeakyRelu = function() { + return (Ab = t10._LeakyRelu = t10.asm.LeakyRelu).apply(null, arguments); + }, Fb = t10._Less = function() { + return (Fb = t10._Less = t10.asm.Less).apply(null, arguments); + }, Pb = t10._LessEqual = function() { + return (Pb = t10._LessEqual = t10.asm.LessEqual).apply(null, arguments); + }, Ob = t10._LinSpace = function() { + return (Ob = t10._LinSpace = t10.asm.LinSpace).apply(null, arguments); + }, Mb = t10._Log = function() { + return (Mb = t10._Log = t10.asm.Log).apply(null, arguments); + }, Lb = t10._Log1p = function() { + return (Lb = t10._Log1p = t10.asm.Log1p).apply(null, arguments); + }, Bb = t10._LogicalAnd = function() { + return (Bb = t10._LogicalAnd = t10.asm.LogicalAnd).apply(null, arguments); + }, zb = t10._LogicalNot = function() { + return (zb = t10._LogicalNot = t10.asm.LogicalNot).apply(null, arguments); + }, Vb = t10._LogicalOr = function() { + return (Vb = t10._LogicalOr = t10.asm.LogicalOr).apply(null, arguments); + }, Wb = t10._LogicalXor = function() { + return (Wb = t10._LogicalXor = t10.asm.LogicalXor).apply(null, arguments); + }, Ub = t10._Max = function() { + return (Ub = t10._Max = t10.asm.Max).apply(null, arguments); + }, Gb = t10._MaxPool = function() { + return (Gb = t10._MaxPool = t10.asm.MaxPool).apply(null, arguments); + }, Hb = t10._MaxPool3D = function() { + return (Hb = t10._MaxPool3D = t10.asm.MaxPool3D).apply(null, arguments); + }, Kb = t10._MaxPool3DGrad = function() { + return (Kb = t10._MaxPool3DGrad = t10.asm.MaxPool3DGrad).apply(null, arguments); + }, qb = t10._MaxPoolGrad = function() { + return (qb = t10._MaxPoolGrad = t10.asm.MaxPoolGrad).apply(null, arguments); + }, jb = t10._MaxPoolWithArgmax = function() { + return (jb = t10._MaxPoolWithArgmax = t10.asm.MaxPoolWithArgmax).apply(null, arguments); + }, Xb = t10._Maximum = function() { + return (Xb = t10._Maximum = t10.asm.Maximum).apply(null, arguments); + }, Yb = t10._Mean = function() { + return (Yb = t10._Mean = t10.asm.Mean).apply(null, arguments); + }, Qb = t10._Min = function() { + return (Qb = t10._Min = t10.asm.Min).apply(null, arguments); + }, Zb = t10._Minimum = function() { + return (Zb = t10._Minimum = t10.asm.Minimum).apply(null, arguments); + }, Jb = t10._MirrorPad = function() { + return (Jb = t10._MirrorPad = t10.asm.MirrorPad).apply(null, arguments); + }, eC = t10._Mod = function() { + return (eC = t10._Mod = t10.asm.Mod).apply(null, arguments); + }, tC = t10._Multinomial = function() { + return (tC = t10._Multinomial = t10.asm.Multinomial).apply(null, arguments); + }, rC = t10._Multiply = function() { + return (rC = t10._Multiply = t10.asm.Multiply).apply(null, arguments); + }, oC = t10._Neg = function() { + return (oC = t10._Neg = t10.asm.Neg).apply(null, arguments); + }, nC = t10._NonMaxSuppressionV3 = function() { + return (nC = t10._NonMaxSuppressionV3 = t10.asm.NonMaxSuppressionV3).apply(null, arguments); + }, sC = t10._NonMaxSuppressionV4 = function() { + return (sC = t10._NonMaxSuppressionV4 = t10.asm.NonMaxSuppressionV4).apply(null, arguments); + }, aC = t10._NonMaxSuppressionV5 = function() { + return (aC = t10._NonMaxSuppressionV5 = t10.asm.NonMaxSuppressionV5).apply(null, arguments); + }, iC = t10._NotEqual = function() { + return (iC = t10._NotEqual = t10.asm.NotEqual).apply(null, arguments); + }, uC = t10._OneHot = function() { + return (uC = t10._OneHot = t10.asm.OneHot).apply(null, arguments); + }, pC = t10._PadV2 = function() { + return (pC = t10._PadV2 = t10.asm.PadV2).apply(null, arguments); + }, lC = t10._Pow = function() { + return (lC = t10._Pow = t10.asm.Pow).apply(null, arguments); + }, cC = t10._Prelu = function() { + return (cC = t10._Prelu = t10.asm.Prelu).apply(null, arguments); + }, mC = t10._Prod = function() { + return (mC = t10._Prod = t10.asm.Prod).apply(null, arguments); + }, dC = t10._RealDiv = function() { + return (dC = t10._RealDiv = t10.asm.RealDiv).apply(null, arguments); + }, fC = t10._Reciprocal = function() { + return (fC = t10._Reciprocal = t10.asm.Reciprocal).apply(null, arguments); + }, hC = t10._Relu = function() { + return (hC = t10._Relu = t10.asm.Relu).apply(null, arguments); + }, gC = t10._Relu6 = function() { + return (gC = t10._Relu6 = t10.asm.Relu6).apply(null, arguments); + }, xC = t10._ResizeBilinear = function() { + return (xC = t10._ResizeBilinear = t10.asm.ResizeBilinear).apply(null, arguments); + }, yC = t10._ResizeBilinearGrad = function() { + return (yC = t10._ResizeBilinearGrad = t10.asm.ResizeBilinearGrad).apply(null, arguments); + }, bC = t10._ResizeNearestNeighbor = function() { + return (bC = t10._ResizeNearestNeighbor = t10.asm.ResizeNearestNeighbor).apply(null, arguments); + }, CC = t10._ResizeNearestNeighborGrad = function() { + return (CC = t10._ResizeNearestNeighborGrad = t10.asm.ResizeNearestNeighborGrad).apply(null, arguments); + }, wC = t10._Reverse = function() { + return (wC = t10._Reverse = t10.asm.Reverse).apply(null, arguments); + }, SC = t10._RotateWithOffset = function() { + return (SC = t10._RotateWithOffset = t10.asm.RotateWithOffset).apply(null, arguments); + }, IC = t10._Round = function() { + return (IC = t10._Round = t10.asm.Round).apply(null, arguments); + }, vC = t10._Rsqrt = function() { + return (vC = t10._Rsqrt = t10.asm.Rsqrt).apply(null, arguments); + }, kC = t10._ScatterNd = function() { + return (kC = t10._ScatterNd = t10.asm.ScatterNd).apply(null, arguments); + }, NC = t10._SearchSorted = function() { + return (NC = t10._SearchSorted = t10.asm.SearchSorted).apply(null, arguments); + }, TC = t10._SelectV2 = function() { + return (TC = t10._SelectV2 = t10.asm.SelectV2).apply(null, arguments); + }, _C = t10._Selu = function() { + return (_C = t10._Selu = t10.asm.Selu).apply(null, arguments); + }, EC = t10._Sigmoid = function() { + return (EC = t10._Sigmoid = t10.asm.Sigmoid).apply(null, arguments); + }, $C = t10._Sign = function() { + return ($C = t10._Sign = t10.asm.Sign).apply(null, arguments); + }, RC = t10._Sin = function() { + return (RC = t10._Sin = t10.asm.Sin).apply(null, arguments); + }, DC = t10._Sinh = function() { + return (DC = t10._Sinh = t10.asm.Sinh).apply(null, arguments); + }, AC = t10._Softmax = function() { + return (AC = t10._Softmax = t10.asm.Softmax).apply(null, arguments); + }, FC = t10._Softplus = function() { + return (FC = t10._Softplus = t10.asm.Softplus).apply(null, arguments); + }, PC = t10._SparseFillEmptyRows = function() { + return (PC = t10._SparseFillEmptyRows = t10.asm.SparseFillEmptyRows).apply(null, arguments); + }, OC = t10._SparseReshape = function() { + return (OC = t10._SparseReshape = t10.asm.SparseReshape).apply(null, arguments); + }, MC = t10._SparseSegmentReduction = function() { + return (MC = t10._SparseSegmentReduction = t10.asm.SparseSegmentReduction).apply(null, arguments); + }, LC = t10._SparseToDense = function() { + return (LC = t10._SparseToDense = t10.asm.SparseToDense).apply(null, arguments); + }, BC = t10._Sqrt = function() { + return (BC = t10._Sqrt = t10.asm.Sqrt).apply(null, arguments); + }, zC = t10._Square = function() { + return (zC = t10._Square = t10.asm.Square).apply(null, arguments); + }, VC = t10._SquaredDifference = function() { + return (VC = t10._SquaredDifference = t10.asm.SquaredDifference).apply(null, arguments); + }, WC = t10._Step = function() { + return (WC = t10._Step = t10.asm.Step).apply(null, arguments); + }, UC = t10._StridedSlice = function() { + return (UC = t10._StridedSlice = t10.asm.StridedSlice).apply(null, arguments); + }, GC = t10._Sub = function() { + return (GC = t10._Sub = t10.asm.Sub).apply(null, arguments); + }, HC = t10._Sum = function() { + return (HC = t10._Sum = t10.asm.Sum).apply(null, arguments); + }, KC = t10._Tan = function() { + return (KC = t10._Tan = t10.asm.Tan).apply(null, arguments); + }, qC = t10._Tanh = function() { + return (qC = t10._Tanh = t10.asm.Tanh).apply(null, arguments); + }, jC = t10._TensorScatterUpdate = function() { + return (jC = t10._TensorScatterUpdate = t10.asm.TensorScatterUpdate).apply(null, arguments); + }, XC = t10._Tile = function() { + return (XC = t10._Tile = t10.asm.Tile).apply(null, arguments); + }, YC = t10._TopK = function() { + return (YC = t10._TopK = t10.asm.TopK).apply(null, arguments); + }, QC = t10._Transform = function() { + return (QC = t10._Transform = t10.asm.Transform).apply(null, arguments); + }, ZC = t10._Transpose = function() { + return (ZC = t10._Transpose = t10.asm.Transpose).apply(null, arguments); + }, JC = t10.__FusedMatMul = function() { + return (JC = t10.__FusedMatMul = t10.asm._FusedMatMul).apply(null, arguments); + }, ew = t10._malloc = function() { + return (ew = t10._malloc = t10.asm.malloc).apply(null, arguments); + }, tw = t10._free = function() { + return (tw = t10._free = t10.asm.free).apply(null, arguments); + }, rw = t10.___errno_location = function() { + return (rw = t10.___errno_location = t10.asm.__errno_location).apply(null, arguments); + }, qm = t10.stackSave = function() { + return (qm = t10.stackSave = t10.asm.stackSave).apply(null, arguments); + }, jm = t10.stackRestore = function() { + return (jm = t10.stackRestore = t10.asm.stackRestore).apply(null, arguments); + }, xc = t10.stackAlloc = function() { + return (xc = t10.stackAlloc = t10.asm.stackAlloc).apply(null, arguments); + }, ow = t10.dynCall_iijjiiii = function() { + return (ow = t10.dynCall_iijjiiii = t10.asm.dynCall_iijjiiii).apply(null, arguments); + }, nw = t10.dynCall_jiji = function() { + return (nw = t10.dynCall_jiji = t10.asm.dynCall_jiji).apply(null, arguments); }; - e.cwrap = vy; - var Fp; - nr = function K() { - Fp || Mm(), Fp || (nr = K); + t10.cwrap = Ly; + var Wp; + ir = function K() { + Wp || Xm(), Wp || (ir = K); }; - function Mm(K) { - if (K = K || i, Tt > 0 || (ht(), Tt > 0)) + function Xm(K) { + if (K = K || i, Et > 0 || (gt(), Et > 0)) return; function ae() { - Fp || (Fp = true, e.calledRun = true, !M && (gt(), o(e), e.onRuntimeInitialized && e.onRuntimeInitialized(), Mr())); + Wp || (Wp = true, t10.calledRun = true, !M && (xt(), o(t10), t10.onRuntimeInitialized && t10.onRuntimeInitialized(), Ur())); } - e.setStatus ? (e.setStatus("Running..."), setTimeout(function() { + t10.setStatus ? (t10.setStatus("Running..."), setTimeout(function() { setTimeout(function() { - e.setStatus(""); + t10.setStatus(""); }, 1), ae(); }, 1)) : ae(); } - if (e.preInit) - for (typeof e.preInit == "function" && (e.preInit = [e.preInit]); e.preInit.length > 0; ) - e.preInit.pop()(); - Mm(); - var Pp; - s && (Pp = { uncaughtException: process.listeners("uncaughtException").filter(function(K) { + if (t10.preInit) + for (typeof t10.preInit == "function" && (t10.preInit = [t10.preInit]); t10.preInit.length > 0; ) + t10.preInit.pop()(); + Xm(); + var Up; + s && (Up = { uncaughtException: process.listeners("uncaughtException").filter(function(K) { return !s.uncaughtException.indexOf(K) > -1; }), unhandledRejection: process.listeners("unhandledRejection").filter(function(K) { return !s.unhandledRejection.indexOf(K) > -1; }) }); - var Op; - if (typeof t8 != "undefined") - Op = t8; + var Gp; + if (typeof e != "undefined") + Gp = e; else if (typeof WasmBackendModuleThreadedSimd != "undefined") - Op = WasmBackendModuleThreadedSimd; + Gp = WasmBackendModuleThreadedSimd; else throw new Error("Could not find wasm module in post.js"); - if (Pp) { - var HC = Op._dispose; - Op._dispose = function() { - HC(), Pp.uncaughtException.forEach(function(K) { + if (Up) { + var sw = Gp._dispose; + Gp._dispose = function() { + sw(), Up.uncaughtException.forEach(function(K) { process.removeListener("uncaughtException", K); - }), Pp.unhandledRejection.forEach(function(K) { + }), Up.unhandledRejection.forEach(function(K) { process.removeListener("unhandledRejection", K); }); }; } - return t8.ready; + return e.ready; }; })(); - typeof Wg == "object" && typeof Hv == "object" ? Hv.exports = Gv : typeof define == "function" && define.amd ? define([], function() { - return Gv; - }) : typeof Wg == "object" && (Wg.WasmBackendModule = Gv); + typeof ex == "object" && typeof sv == "object" ? sv.exports = nv : typeof define == "function" && define.amd ? define([], function() { + return nv; + }) : typeof ex == "object" && (ex.WasmBackendModule = nv); }); -var Bo = class { - constructor(t8, e) { - this.backend = t8, this.dataMover = e, this.data = /* @__PURE__ */ new WeakMap(), this.dataIdsCount = 0; +var mn = class { + constructor(e, t10) { + this.backend = e, this.dataMover = t10, this.data = /* @__PURE__ */ new WeakMap(), this.dataIdsCount = 0; } - get(t8) { - return this.data.has(t8) || this.dataMover.moveData(this.backend, t8), this.data.get(t8); + get(e) { + return this.data.has(e) || this.dataMover.moveData(this.backend, e), this.data.get(e); } - set(t8, e) { - this.dataIdsCount++, this.data.set(t8, e); + set(e, t10) { + this.dataIdsCount++, this.data.set(e, t10); } - has(t8) { - return this.data.has(t8); + has(e) { + return this.data.has(e); } - delete(t8) { - return this.dataIdsCount--, this.data.delete(t8); + delete(e) { + return this.dataIdsCount--, this.data.delete(e); } numDataIds() { return this.dataIdsCount; } }; -var so = class { - refCount(t8) { - return Br("refCount"); +var mo = class { + refCount(e) { + return Hr("refCount"); } - incRef(t8) { - return Br("incRef"); + incRef(e) { + return Hr("incRef"); } timerAvailable() { return true; } - time(t8) { - return Br("time"); + time(e) { + return Hr("time"); } - read(t8) { - return Br("read"); + read(e) { + return Hr("read"); } - readSync(t8) { - return Br("readSync"); + readSync(e) { + return Hr("readSync"); } - readToGPU(t8, e) { - return Br("readToGPU"); + readToGPU(e, t10) { + return Hr("readToGPU"); } numDataIds() { - return Br("numDataIds"); + return Hr("numDataIds"); } - disposeData(t8, e) { - return Br("disposeData"); + disposeData(e, t10) { + return Hr("disposeData"); } - write(t8, e, o) { - return Br("write"); + write(e, t10, o) { + return Hr("write"); } - move(t8, e, o, n, s) { - return Br("move"); + move(e, t10, o, n, s) { + return Hr("move"); } - createTensorFromGPUData(t8, e, o) { - return Br("createTensorFromGPUData"); + createTensorFromGPUData(e, t10, o) { + return Hr("createTensorFromGPUData"); } memory() { - return Br("memory"); + return Hr("memory"); } floatPrecision() { - return Br("floatPrecision"); + return Hr("floatPrecision"); } epsilon() { return this.floatPrecision() === 32 ? 1e-7 : 1e-4; } dispose() { - return Br("dispose"); + return Hr("dispose"); } }; -function Br(r15) { - throw new Error(`'${r15}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`); -} -function v0(r15) { - let t8 = r15.length, e = 0; - for (; t8 > 0; ) - e = Math.random() * t8 | 0, t8--, Km(r15, t8, e); +function Hr(r16) { + throw new Error(`'${r16}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`); } -function _G(r15, t8) { - if (r15.length !== t8.length) - throw new Error(`Array sizes must match to be shuffled together First array length was ${r15.length}Second array length was ${t8.length}`); - let e = r15.length, o = 0; +function lk(r16) { + let e = r16.length, t10 = 0; for (; e > 0; ) - o = Math.random() * e | 0, e--, Km(r15, e, o), Km(t8, e, o); + t10 = Math.random() * e | 0, e--, nd(r16, e, t10); } -function Bp(r15, t8, e) { - return Math.max(r15, Math.min(t8, e)); +function J4(r16, e) { + if (r16.length !== e.length) + throw new Error(`Array sizes must match to be shuffled together First array length was ${r16.length}Second array length was ${e.length}`); + let t10 = r16.length, o = 0; + for (; t10 > 0; ) + o = Math.random() * t10 | 0, t10--, nd(r16, t10, o), nd(e, t10, o); } -function $G(r15) { - return r15 % 2 === 0 ? r15 : r15 + 1; +function qp(r16, e, t10) { + return Math.max(r16, Math.min(e, t10)); } -function Km(r15, t8, e) { - let o = r15[t8]; - r15[t8] = r15[e], r15[e] = o; +function eH(r16) { + return r16 % 2 === 0 ? r16 : r16 + 1; } -function EG(r15) { - let t8 = 0; - for (let e = 0; e < r15.length; e++) - t8 += r15[e]; - return t8; +function nd(r16, e, t10) { + let o = r16[e]; + r16[e] = r16[t10], r16[t10] = o; } -function RG(r15, t8) { - let e = Math.random(); - return t8 * e + (1 - e) * r15; -} -function DG(r15, t8) { +function tH(r16) { let e = 0; - for (let o = 0; o < r15.length; o++) { - let n = Number(r15[o]) - Number(t8[o]); - e += n * n; - } + for (let t10 = 0; t10 < r16.length; t10++) + e += r16[t10]; return e; } -function $(r15, t8) { - if (!r15) - throw new Error(typeof t8 == "string" ? t8 : t8()); +function rH(r16, e) { + let t10 = Math.random(); + return e * t10 + (1 - t10) * r16; +} +function oH(r16, e) { + let t10 = 0; + for (let o = 0; o < r16.length; o++) { + let n = Number(r16[o]) - Number(e[o]); + t10 += n * n; + } + return t10; +} +function $(r16, e) { + if (!r16) + throw new Error(typeof e == "string" ? e : e()); } -function xt(r15, t8, e = "") { - $(br(r15, t8), () => e + ` Shapes ${r15} and ${t8} must match`); +function yt(r16, e, t10 = "") { + $(Sr(r16, e), () => t10 + ` Shapes ${r16} and ${e} must match`); } -function ao(r15) { - $(r15 != null, () => "The input to the tensor constructor must be a non-null value."); +function fo(r16) { + $(r16 != null, () => "The input to the tensor constructor must be a non-null value."); } -function He(r15) { - if (r15.length === 0) +function ze(r16) { + if (r16.length === 0) return 1; - let t8 = r15[0]; - for (let e = 1; e < r15.length; e++) - t8 *= r15[e]; - return t8; + let e = r16[0]; + for (let t10 = 1; t10 < r16.length; t10++) + e *= r16[t10]; + return e; } -function AG(r15) { - return r15.length === 0; +function nH(r16) { + return r16.length === 0; } -function QC(r15, t8) { - if (r15 === t8) +function cw(r16, e) { + if (r16 === e) return true; - if (r15 == null || t8 == null || r15.length !== t8.length) + if (r16 == null || e == null || r16.length !== e.length) return false; - for (let e = 0; e < r15.length; e++) - if (r15[e] !== null && t8[e] !== null && r15[e] !== t8[e]) + for (let t10 = 0; t10 < r16.length; t10++) + if (r16[t10] !== null && e[t10] !== null && r16[t10] !== e[t10]) return false; return true; } -function br(r15, t8) { - if (r15 === t8) +function Sr(r16, e) { + if (r16 === e) return true; - if (r15 == null || t8 == null || r15.length !== t8.length) + if (r16 == null || e == null || r16.length !== e.length) return false; - for (let e = 0; e < r15.length; e++) - if (r15[e] !== t8[e]) + for (let t10 = 0; t10 < r16.length; t10++) + if (r16[t10] !== e[t10]) return false; return true; } -function Ka(r15) { - return r15 % 1 === 0; +function Ja(r16) { + return r16 % 1 === 0; } -function FG(r15) { +function sH(r16) { if (Math.tanh != null) - return Math.tanh(r15); - if (r15 === 1 / 0) + return Math.tanh(r16); + if (r16 === 1 / 0) return 1; - if (r15 === -1 / 0) + if (r16 === -1 / 0) return -1; { - let t8 = Math.exp(2 * r15); - return (t8 - 1) / (t8 + 1); + let e = Math.exp(2 * r16); + return (e - 1) / (e + 1); } } -function PG(r15) { - let t8 = Math.ceil(Math.sqrt(r15)); - return [t8, Math.ceil(r15 / t8)]; +function aH(r16) { + let e = Math.ceil(Math.sqrt(r16)); + return [e, Math.ceil(r16 / e)]; } -function OG(r15) { - let t8 = new Uint32Array(r15); - for (let e = 0; e < r15; ++e) - t8[e] = e; - return v0(t8), t8; +function iH(r16) { + let e = new Uint32Array(r16); + for (let t10 = 0; t10 < r16; ++t10) + e[t10] = t10; + return lk(e), e; } -function Nu(r15, t8) { - return t8 <= r15.length ? r15 : r15 + " ".repeat(t8 - r15.length); +function Pu(r16, e) { + return e <= r16.length ? r16 : r16 + " ".repeat(e - r16.length); } -function MG(r15, t8 = (n) => 0, e, o) { +function uH(r16, e = (n) => 0, t10, o) { return new Promise((n, s) => { let a = 0, i = () => { - if (r15()) { + if (r16()) { n(); return; } a++; - let p = t8(a); - if (e != null && a >= e) { + let p = e(a); + if (t10 != null && a >= t10) { s(); return; } @@ -3147,241 +3147,241 @@ function MG(r15, t8 = (n) => 0, e, o) { i(); }); } -function LG(r15, t8) { - let e = 1, o = -1; - for (let s = 0; s < r15.length; ++s) - if (r15[s] >= 0) - e *= r15[s]; - else if (r15[s] === -1) { +function pH(r16, e) { + let t10 = 1, o = -1; + for (let s = 0; s < r16.length; ++s) + if (r16[s] >= 0) + t10 *= r16[s]; + else if (r16[s] === -1) { if (o !== -1) throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${o} and dim ${s}`); o = s; - } else if (r15[s] < 0) - throw Error(`Shapes can not be < 0. Found ${r15[s]} at dim ${s}`); + } else if (r16[s] < 0) + throw Error(`Shapes can not be < 0. Found ${r16[s]} at dim ${s}`); if (o === -1) { - if (t8 > 0 && t8 !== e) - throw Error(`Size(${t8}) must match the product of shape ${r15}`); - return r15; - } - if (e === 0) - throw Error(`Cannot infer the missing size in [${r15}] when there are 0 elements`); - if (t8 % e !== 0) - throw Error(`The implicit shape can't be a fractional number. Got ${t8} / ${e}`); - let n = r15.slice(); - return n[o] = t8 / e, n; -} -function Ti(r15, t8) { - let e = t8.length; - return r15 = r15 == null ? t8.map((o, n) => n) : [].concat(r15), $(r15.every((o) => o >= -e && o < e), () => `All values in axis param must be in range [-${e}, ${e}) but got axis ${r15}`), $(r15.every((o) => Ka(o)), () => `All values in axis param must be integers but got axis ${r15}`), r15.map((o) => o < 0 ? e + o : o); -} -function ZC(r15, t8) { - let e = [], o = [], n = t8 != null && Array.isArray(t8) && t8.length === 0, s = t8 == null || n ? null : Ti(t8, r15).sort(), a = 0; - for (let i = 0; i < r15.length; ++i) { + if (e > 0 && e !== t10) + throw Error(`Size(${e}) must match the product of shape ${r16}`); + return r16; + } + if (t10 === 0) + throw Error(`Cannot infer the missing size in [${r16}] when there are 0 elements`); + if (e % t10 !== 0) + throw Error(`The implicit shape can't be a fractional number. Got ${e} / ${t10}`); + let n = r16.slice(); + return n[o] = e / t10, n; +} +function Li(r16, e) { + let t10 = e.length; + return r16 = r16 == null ? e.map((o, n) => n) : [].concat(r16), $(r16.every((o) => o >= -t10 && o < t10), () => `All values in axis param must be in range [-${t10}, ${t10}) but got axis ${r16}`), $(r16.every((o) => Ja(o)), () => `All values in axis param must be integers but got axis ${r16}`), r16.map((o) => o < 0 ? t10 + o : o); +} +function mw(r16, e) { + let t10 = [], o = [], n = e != null && Array.isArray(e) && e.length === 0, s = e == null || n ? null : Li(e, r16).sort(), a = 0; + for (let i = 0; i < r16.length; ++i) { if (s != null) { - if (s[a] === i && r15[i] !== 1) - throw new Error(`Can't squeeze axis ${i} since its dim '${r15[i]}' is not 1`); - (s[a] == null || s[a] > i) && r15[i] === 1 && (e.push(r15[i]), o.push(i)), s[a] <= i && a++; - } - r15[i] !== 1 && (e.push(r15[i]), o.push(i)); - } - return { newShape: e, keptDims: o }; -} -function JC(r15, t8) { - return qm(r15, t8); -} -function qm(r15, t8) { - let e = null; - if (r15 == null || r15 === "float32") - e = new Float32Array(t8); - else if (r15 === "int32") - e = new Int32Array(t8); - else if (r15 === "bool") - e = new Uint8Array(t8); - else if (r15 === "string") - e = new Array(t8); + if (s[a] === i && r16[i] !== 1) + throw new Error(`Can't squeeze axis ${i} since its dim '${r16[i]}' is not 1`); + (s[a] == null || s[a] > i) && r16[i] === 1 && (t10.push(r16[i]), o.push(i)), s[a] <= i && a++; + } + r16[i] !== 1 && (t10.push(r16[i]), o.push(i)); + } + return { newShape: t10, keptDims: o }; +} +function dw(r16, e) { + return sd(r16, e); +} +function sd(r16, e) { + let t10 = null; + if (r16 == null || r16 === "float32") + t10 = new Float32Array(e); + else if (r16 === "int32") + t10 = new Int32Array(e); + else if (r16 === "bool") + t10 = new Uint8Array(e); + else if (r16 === "string") + t10 = new Array(e); else - throw new Error(`Unknown data type ${r15}`); - return e; + throw new Error(`Unknown data type ${r16}`); + return t10; } -function ew(r15, t8) { - for (let e = 0; e < r15.length; e++) { - let o = r15[e]; +function fw(r16, e) { + for (let t10 = 0; t10 < r16.length; t10++) { + let o = r16[t10]; if (isNaN(o) || !isFinite(o)) - throw Error(`A tensor of type ${t8} being uploaded contains ${o}.`); + throw Error(`A tensor of type ${e} being uploaded contains ${o}.`); } } -function tw(r15) { - return r15 === "bool" || r15 === "complex64" || r15 === "float32" || r15 === "int32" || r15 === "string"; +function hw(r16) { + return r16 === "bool" || r16 === "complex64" || r16 === "float32" || r16 === "int32" || r16 === "string"; } -function BG(r15, t8) { - return !(t8 === "complex64" || t8 === "float32" && r15 !== "complex64" || t8 === "int32" && r15 !== "float32" && r15 !== "complex64" || t8 === "bool" && r15 === "bool"); +function lH(r16, e) { + return !(e === "complex64" || e === "float32" && r16 !== "complex64" || e === "int32" && r16 !== "float32" && r16 !== "complex64" || e === "bool" && r16 === "bool"); } -function zp(r15) { - if (r15 === "float32" || r15 === "int32") +function jp(r16) { + if (r16 === "float32" || r16 === "int32") return 4; - if (r15 === "complex64") + if (r16 === "complex64") return 8; - if (r15 === "bool") + if (r16 === "bool") return 1; - throw new Error(`Unknown dtype ${r15}`); + throw new Error(`Unknown dtype ${r16}`); } -function rw(r15) { - if (r15 == null) +function gw(r16) { + if (r16 == null) return 0; - let t8 = 0; - return r15.forEach((e) => t8 += e.length), t8; + let e = 0; + return r16.forEach((t10) => e += t10.length), e; } -function zo(r15) { - return typeof r15 == "string" || r15 instanceof String; +function dn(r16) { + return typeof r16 == "string" || r16 instanceof String; } -function k0(r15) { - return typeof r15 == "boolean"; +function ck(r16) { + return typeof r16 == "boolean"; } -function N0(r15) { - return typeof r15 == "number"; +function mk(r16) { + return typeof r16 == "number"; } -function _i(r15) { - return Array.isArray(r15) ? _i(r15[0]) : r15 instanceof Float32Array ? "float32" : r15 instanceof Int32Array || r15 instanceof Uint8Array || r15 instanceof Uint8ClampedArray ? "int32" : N0(r15) ? "float32" : zo(r15) ? "string" : k0(r15) ? "bool" : "float32"; +function Bi(r16) { + return Array.isArray(r16) ? Bi(r16[0]) : r16 instanceof Float32Array ? "float32" : r16 instanceof Int32Array || r16 instanceof Uint8Array || r16 instanceof Uint8ClampedArray ? "int32" : mk(r16) ? "float32" : dn(r16) ? "string" : ck(r16) ? "bool" : "float32"; } -function qs(r15) { - return !!(r15 && r15.constructor && r15.call && r15.apply); +function ra(r16) { + return !!(r16 && r16.constructor && r16.call && r16.apply); } -function Vp(r15, t8) { - for (let e = t8; e < r15; ++e) - if (r15 % e === 0) - return e; - return r15; +function Xp(r16, e) { + for (let t10 = e; t10 < r16; ++t10) + if (r16 % t10 === 0) + return t10; + return r16; } -function js(r15) { - let t8 = r15.length; - if (t8 < 2) +function oa(r16) { + let e = r16.length; + if (e < 2) return []; - let e = new Array(t8 - 1); - e[t8 - 2] = r15[t8 - 1]; - for (let o = t8 - 3; o >= 0; --o) - e[o] = e[o + 1] * r15[o + 1]; - return e; + let t10 = new Array(e - 1); + t10[e - 2] = r16[e - 1]; + for (let o = e - 3; o >= 0; --o) + t10[o] = t10[o + 1] * r16[o + 1]; + return t10; } -function T0(r15, t8, e, o = false) { +function dk(r16, e, t10, o = false) { let n = new Array(); - if (t8.length === 1) { - let s = t8[0] * (o ? 2 : 1); + if (e.length === 1) { + let s = e[0] * (o ? 2 : 1); for (let a = 0; a < s; a++) - n[a] = e[r15 + a]; + n[a] = t10[r16 + a]; } else { - let s = t8[0], a = t8.slice(1), i = a.reduce((p, u) => p * u) * (o ? 2 : 1); + let s = e[0], a = e.slice(1), i = a.reduce((p, u) => p * u) * (o ? 2 : 1); for (let p = 0; p < s; p++) - n[p] = T0(r15 + p * i, a, e, o); + n[p] = dk(r16 + p * i, a, t10, o); } return n; } -function ku(r15, t8, e = false) { - if (r15.length === 0) - return t8[0]; - let o = r15.reduce((n, s) => n * s) * (e ? 2 : 1); +function Fu(r16, e, t10 = false) { + if (r16.length === 0) + return e[0]; + let o = r16.reduce((n, s) => n * s) * (t10 ? 2 : 1); if (o === 0) return []; - if (o !== t8.length) - throw new Error(`[${r15}] does not match the input size ${t8.length}${e ? " for a complex tensor" : ""}.`); - return T0(0, r15, t8, e); -} -function zG(r15, t8) { - if (Array.isArray(r15)) - return r15; - if (t8 === "float32") - return r15 instanceof Float32Array ? r15 : new Float32Array(r15); - if (t8 === "int32") - return r15 instanceof Int32Array ? r15 : new Int32Array(r15); - if (t8 === "bool" || t8 === "string") - return Uint8Array.from(new Int32Array(r15)); - throw new Error(`Unknown dtype ${t8}`); -} -function cl(r15, t8) { - let e = Wp(r15, t8); - for (let o = 0; o < e.length; o++) - e[o] = 1; - return e; -} -function Wp(r15, t8) { - if (t8 == null || t8 === "float32" || t8 === "complex64") - return new Float32Array(r15); - if (t8 === "int32") - return new Int32Array(r15); - if (t8 === "bool") - return new Uint8Array(r15); - throw new Error(`Unknown data type ${t8}`); -} -function VG(r15, t8) { - let e = r15.reduce((o, n) => o * n, 1); - if (t8 == null || t8 === "float32") - return ku(r15, new Float32Array(e)); - if (t8 === "int32") - return ku(r15, new Int32Array(e)); - if (t8 === "bool") - return ku(r15, new Uint8Array(e)); - throw new Error(`Unknown data type ${t8}`); -} -function Ct(r15) { - r15.forEach((t8) => { - $(Number.isInteger(t8) && t8 >= 0, () => `Tensor must have a shape comprised of positive integers but got shape [${r15}].`); + if (o !== e.length) + throw new Error(`[${r16}] does not match the input size ${e.length}${t10 ? " for a complex tensor" : ""}.`); + return dk(0, r16, e, t10); +} +function cH(r16, e) { + if (Array.isArray(r16)) + return r16; + if (e === "float32") + return r16 instanceof Float32Array ? r16 : new Float32Array(r16); + if (e === "int32") + return r16 instanceof Int32Array ? r16 : new Int32Array(r16); + if (e === "bool" || e === "string") + return Uint8Array.from(new Int32Array(r16)); + throw new Error(`Unknown dtype ${e}`); +} +function bc(r16, e) { + let t10 = Yp(r16, e); + for (let o = 0; o < t10.length; o++) + t10[o] = 1; + return t10; +} +function Yp(r16, e) { + if (e == null || e === "float32" || e === "complex64") + return new Float32Array(r16); + if (e === "int32") + return new Int32Array(r16); + if (e === "bool") + return new Uint8Array(r16); + throw new Error(`Unknown data type ${e}`); +} +function mH(r16, e) { + let t10 = r16.reduce((o, n) => o * n, 1); + if (e == null || e === "float32") + return Fu(r16, new Float32Array(t10)); + if (e === "int32") + return Fu(r16, new Int32Array(t10)); + if (e === "bool") + return Fu(r16, new Uint8Array(t10)); + throw new Error(`Unknown data type ${e}`); +} +function St(r16) { + r16.forEach((e) => { + $(Number.isInteger(e) && e >= 0, () => `Tensor must have a shape comprised of positive integers but got shape [${r16}].`); }); } -function WG(r15, t8, e) { - if (t8 === 0) +function dH(r16, e, t10) { + if (e === 0) return 0; - if (t8 === 1) - return r15[0]; - let o = r15[r15.length - 1]; - for (let n = 0; n < r15.length - 1; ++n) - o += e[n] * r15[n]; + if (e === 1) + return r16[0]; + let o = r16[r16.length - 1]; + for (let n = 0; n < r16.length - 1; ++n) + o += t10[n] * r16[n]; return o; } -function UG(r15, t8, e) { - if (t8 === 0) +function fH(r16, e, t10) { + if (e === 0) return []; - if (t8 === 1) - return [r15]; - let o = new Array(t8); + if (e === 1) + return [r16]; + let o = new Array(e); for (let n = 0; n < o.length - 1; ++n) - o[n] = Math.floor(r15 / e[n]), r15 -= o[n] * e[n]; - return o[o.length - 1] = r15, o; + o[n] = Math.floor(r16 / t10[n]), r16 -= o[n] * t10[n]; + return o[o.length - 1] = r16, o; } -function Tu(r15) { - return r15 && r15.then && typeof r15.then == "function"; +function Ou(r16) { + return r16 && r16.then && typeof r16.then == "function"; } -var _0 = "tfjsflags"; -var ll = class { - constructor(t8) { - this.global = t8, this.flags = {}, this.flagRegistry = {}, this.urlFlags = {}, this.getQueryParams = HG, this.populateURLFlags(); +var fk = "tfjsflags"; +var Cc = class { + constructor(e) { + this.global = e, this.flags = {}, this.flagRegistry = {}, this.urlFlags = {}, this.getQueryParams = gH, this.populateURLFlags(); } - setPlatform(t8, e) { - this.platform != null && (A().getBool("IS_TEST") || A().getBool("PROD") || console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${t8}.`)), this.platformName = t8, this.platform = e; + setPlatform(e, t10) { + this.platform != null && (A().getBool("IS_TEST") || A().getBool("PROD") || console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`)), this.platformName = e, this.platform = t10; } - registerFlag(t8, e, o) { - if (this.flagRegistry[t8] = { evaluationFn: e, setHook: o }, this.urlFlags[t8] != null) { - let n = this.urlFlags[t8]; - A().getBool("IS_TEST") || A().getBool("PROD") || console.warn(`Setting feature override from URL ${t8}: ${n}.`), this.set(t8, n); + registerFlag(e, t10, o) { + if (this.flagRegistry[e] = { evaluationFn: t10, setHook: o }, this.urlFlags[e] != null) { + let n = this.urlFlags[e]; + A().getBool("IS_TEST") || A().getBool("PROD") || console.warn(`Setting feature override from URL ${e}: ${n}.`), this.set(e, n); } } - async getAsync(t8) { - return t8 in this.flags ? this.flags[t8] : (this.flags[t8] = await this.evaluateFlag(t8), this.flags[t8]); + async getAsync(e) { + return e in this.flags ? this.flags[e] : (this.flags[e] = await this.evaluateFlag(e), this.flags[e]); } - get(t8) { - if (t8 in this.flags) - return this.flags[t8]; - let e = this.evaluateFlag(t8); - if (Tu(e)) - throw new Error(`Flag ${t8} cannot be synchronously evaluated. Please use getAsync() instead.`); - return this.flags[t8] = e, this.flags[t8]; + get(e) { + if (e in this.flags) + return this.flags[e]; + let t10 = this.evaluateFlag(e); + if (Ou(t10)) + throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`); + return this.flags[e] = t10, this.flags[e]; } - getNumber(t8) { - return this.get(t8); + getNumber(e) { + return this.get(e); } - getBool(t8) { - return this.get(t8); + getBool(e) { + return this.get(e); } - getString(t8) { - return this.get(t8); + getString(e) { + return this.get(e); } getFlags() { return this.flags; @@ -3389,18 +3389,18 @@ var ll = class { get features() { return this.flags; } - set(t8, e) { - if (this.flagRegistry[t8] == null) - throw new Error(`Cannot set flag ${t8} as it has not been registered.`); - this.flags[t8] = e, this.flagRegistry[t8].setHook != null && this.flagRegistry[t8].setHook(e); + set(e, t10) { + if (this.flagRegistry[e] == null) + throw new Error(`Cannot set flag ${e} as it has not been registered.`); + this.flags[e] = t10, this.flagRegistry[e].setHook != null && this.flagRegistry[e].setHook(t10); } - evaluateFlag(t8) { - if (this.flagRegistry[t8] == null) - throw new Error(`Cannot evaluate flag '${t8}': no evaluation function found.`); - return this.flagRegistry[t8].evaluationFn(); + evaluateFlag(e) { + if (this.flagRegistry[e] == null) + throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`); + return this.flagRegistry[e].evaluationFn(); } - setFlags(t8) { - this.flags = Object.assign({}, t8); + setFlags(e) { + this.flags = Object.assign({}, e); } reset() { this.flags = {}, this.urlFlags = {}, this.populateURLFlags(); @@ -3408,496 +3408,496 @@ var ll = class { populateURLFlags() { if (typeof this.global == "undefined" || typeof this.global.location == "undefined" || typeof this.global.location.search == "undefined") return; - let t8 = this.getQueryParams(this.global.location.search); - _0 in t8 && t8[_0].split(",").forEach((o) => { + let e = this.getQueryParams(this.global.location.search); + fk in e && e[fk].split(",").forEach((o) => { let [n, s] = o.split(":"); - this.urlFlags[n] = qG(n, s); + this.urlFlags[n] = yH(n, s); }); } }; -function HG(r15) { - let t8 = {}; - return r15.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (e, ...o) => (KG(t8, o[0], o[1]), o.join("="))), t8; +function gH(r16) { + let e = {}; + return r16.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, (t10, ...o) => (xH(e, o[0], o[1]), o.join("="))), e; } -function KG(r15, t8, e) { - r15[decodeURIComponent(t8)] = decodeURIComponent(e || ""); +function xH(r16, e, t10) { + r16[decodeURIComponent(e)] = decodeURIComponent(t10 || ""); } -function qG(r15, t8) { - let e = t8.toLowerCase(); - return e === "true" || e === "false" ? e === "true" : `${+e}` === e ? +e : t8; +function yH(r16, e) { + let t10 = e.toLowerCase(); + return t10 === "true" || t10 === "false" ? t10 === "true" : `${+t10}` === t10 ? +t10 : e; } function A() { - return ow; + return xw; } -var ow = null; -function $0(r15) { - ow = r15; +var xw = null; +function hk(r16) { + xw = r16; } -var nw; -function sw() { - if (nw == null) { - let r15; +var yw; +function bw() { + if (yw == null) { + let r16; if (typeof window != "undefined") - r15 = window; + r16 = window; else if (typeof global != "undefined") - r15 = global; + r16 = global; else if (typeof process != "undefined") - r15 = process; + r16 = process; else if (typeof self != "undefined") - r15 = self; + r16 = self; else throw new Error("Could not find a global object"); - nw = r15; + yw = r16; } - return nw; + return yw; } -function jG() { - let r15 = sw(); - return r15._tfGlobals == null && (r15._tfGlobals = /* @__PURE__ */ new Map()), r15._tfGlobals; +function bH() { + let r16 = bw(); + return r16._tfGlobals == null && (r16._tfGlobals = /* @__PURE__ */ new Map()), r16._tfGlobals; } -function ml(r15, t8) { - let e = jG(); - if (e.has(r15)) - return e.get(r15); +function wc(r16, e) { + let t10 = bH(); + if (t10.has(r16)) + return t10.get(r16); { - let o = t8(); - return e.set(r15, o), e.get(r15); - } -} -var Xs = "Abs"; -var Vo = "Acos"; -var Wo = "Acosh"; -var io = "Add"; -var Uo = "AddN"; -var Go = "All"; -var Ho = "Any"; -var Ys = "ArgMax"; -var Qs = "ArgMin"; -var Ko = "Asin"; -var qo = "Asinh"; -var jo = "Atan"; -var Xo = "Atanh"; -var Yo = "Atan2"; -var Qo = "AvgPool"; -var $i = "AvgPoolGrad"; -var Zs = "AvgPool3D"; -var Ei = "AvgPool3DGrad"; -var Zo = "BatchMatMul"; -var Js = "BatchToSpaceND"; -var Jo = "Bincount"; -var qa = "BitwiseAnd"; -var Bce = "BroadcastTo"; -var ea = "BroadcastArgs"; -var yo = "Cast"; -var en = "Ceil"; -var bo = "ClipByValue"; -var Ri = "Complex"; -var Di = "ComplexAbs"; -var ta = "Concat"; -var tn = "Conv2D"; -var Ai = "Conv2DBackpropFilter"; -var rn = "Conv2DBackpropInput"; -var on = "Conv3D"; -var ja = "Conv3DBackpropFilterV2"; -var nn = "Conv3DBackpropInputV2"; -var sn = "Cos"; -var an = "Cosh"; -var un = "Cumprod"; -var pn = "Cumsum"; -var cn = "CropAndResize"; -var ra = "DenseBincount"; -var ln = "DepthToSpace"; -var mn = "DepthwiseConv2dNative"; -var Fi = "DepthwiseConv2dNativeBackpropFilter"; -var Pi = "DepthwiseConv2dNativeBackpropInput"; -var oa = "Diag"; -var dn = "Dilation2D"; -var Oi = "Dilation2DBackpropInput"; -var Mi = "Dilation2DBackpropFilter"; -var _u = "Draw"; -var fn = "RealDiv"; -var Li = "Einsum"; -var hn = "Elu"; -var Xa = "EluGrad"; -var gn = "Erf"; -var xn = "Equal"; -var yn = "Exp"; -var na = "ExpandDims"; -var bn = "Expm1"; -var Bi = "FFT"; -var sa = "Fill"; -var Cn = "FlipLeftRight"; -var wn = "Floor"; -var Sn = "FloorDiv"; -var In = "FusedBatchNorm"; -var aa = "GatherV2"; -var vn = "GatherNd"; -var kn = "Greater"; -var Nn = "GreaterEqual"; -var Co = "Identity"; -var zi = "IFFT"; -var Vi = "Imag"; -var Tn = "IsFinite"; -var _n = "IsInf"; -var $n = "IsNan"; -var En = "LeakyRelu"; -var Rn = "Less"; -var Dn = "LessEqual"; -var An = "LinSpace"; -var Fn = "Log"; -var Pn = "Log1p"; -var On = "LogicalAnd"; -var Mn = "LogicalNot"; -var Ln = "LogicalOr"; -var E0 = "LogicalXor"; -var zce = "LogSoftmax"; -var Vce = "LowerBound"; -var Bn = "LRN"; -var Ya = "LRNGrad"; -var Wce = "MatrixBandPart"; -var zn = "Max"; -var Vn = "Maximum"; -var Wn = "MaxPool"; -var Wi = "MaxPoolGrad"; -var ia = "MaxPool3D"; -var Ui = "MaxPool3DGrad"; -var ua = "MaxPoolWithArgmax"; -var Un = "Mean"; -var Gn = "Min"; -var Hn = "Minimum"; -var Kn = "MirrorPad"; -var qn = "Mod"; -var jn = "Multinomial"; -var Xn = "Multiply"; -var pa = "Neg"; -var Yn = "NotEqual"; -var Qn = "NonMaxSuppressionV3"; -var Qa = "NonMaxSuppressionV4"; -var Zn = "NonMaxSuppressionV5"; -var ca = "OnesLike"; -var Jn = "OneHot"; -var la = "Pack"; -var es = "PadV2"; -var Uce = "Pool"; -var ts = "Pow"; -var rs = "Prelu"; -var os = "Prod"; -var Up = "RaggedGather"; -var Gp = "RaggedRange"; -var Hp = "RaggedTensorToTensor"; -var ma = "Range"; -var Gi = "Real"; -var ns = "Reciprocal"; -var ss = "Relu"; -var da = "Reshape"; -var as = "ResizeNearestNeighbor"; -var Za = "ResizeNearestNeighborGrad"; -var is = "ResizeBilinear"; -var Ja = "ResizeBilinearGrad"; -var us = "Relu6"; -var ps = "Reverse"; -var cs = "Round"; -var ls = "Rsqrt"; -var ms = "ScatterNd"; -var ds = "TensorScatterUpdate"; -var fs = "SearchSorted"; -var fa = "Select"; -var hs = "Selu"; -var ha = "Slice"; -var gs = "Sin"; -var xs = "Sinh"; -var ys = "Sign"; -var bs = "Sigmoid"; -var Cs = "Softplus"; -var ws = "Sqrt"; -var Ss = "Sum"; -var ga = "SpaceToBatchND"; -var xa = "SplitV"; -var Is = "Softmax"; -var Hi = "SparseFillEmptyRows"; -var ei = "SparseReshape"; -var ya = "SparseSegmentMean"; -var ba = "SparseSegmentSum"; -var vs = "SparseToDense"; -var ks = "SquaredDifference"; -var Ki = "Square"; -var $u = "StaticRegexReplace"; -var Ns = "StridedSlice"; -var Ca = "StringNGrams"; -var qi = "StringSplit"; -var ji = "StringToHashBucketFast"; -var Ts = "Sub"; -var _s = "Tan"; -var $s = "Tanh"; -var uo = "Tile"; -var Es = "TopK"; -var Rs = "Transform"; -var po = "Transpose"; -var Xi = "Unique"; -var wa = "Unpack"; -var Yi = "UnsortedSegmentSum"; -var Gce = "UpperBound"; -var Sa = "ZerosLike"; -var wo = "Step"; -var Eu = "FromPixels"; -var Ds = "RotateWithOffset"; -var So = "_FusedMatMul"; -var Io = "FusedConv2D"; -var vo = "FusedDepthwiseConv2D"; -function Ia(...r15) { - A().getBool("IS_TEST") || A().getBool("PROD") || console.warn(...r15); -} -function XG(...r15) { - A().getBool("IS_TEST") || A().getBool("PROD") || console.log(...r15); -} -var Kp = ml("kernelRegistry", () => /* @__PURE__ */ new Map()); -var dl = ml("gradRegistry", () => /* @__PURE__ */ new Map()); -function qp(r15, t8) { - let e = iw(r15, t8); - return Kp.get(e); -} -function aw(r15) { - return dl.get(r15); -} -function jm(r15) { - let t8 = Kp.entries(), e = []; + let o = e(); + return t10.set(r16, o), t10.get(r16); + } +} +var fn = "Abs"; +var hn = "Acos"; +var gn = "Acosh"; +var Rr = "Add"; +var xn = "AddN"; +var yn = "All"; +var bn = "Any"; +var na = "ArgMax"; +var sa = "ArgMin"; +var Cn = "Asin"; +var wn = "Asinh"; +var Sn = "Atan"; +var In = "Atanh"; +var vn = "Atan2"; +var kn = "AvgPool"; +var zi = "AvgPoolGrad"; +var aa = "AvgPool3D"; +var Vi = "AvgPool3DGrad"; +var Nn = "BatchMatMul"; +var ia = "BatchToSpaceND"; +var Tn = "Bincount"; +var _n = "BitwiseAnd"; +var Sme = "BroadcastTo"; +var ua = "BroadcastArgs"; +var ho = "Cast"; +var go = "Ceil"; +var Go = "ClipByValue"; +var ei = "Complex"; +var Wi = "ComplexAbs"; +var pa = "Concat"; +var En = "Conv2D"; +var Ui = "Conv2DBackpropFilter"; +var $n = "Conv2DBackpropInput"; +var Rn = "Conv3D"; +var ti = "Conv3DBackpropFilterV2"; +var Dn = "Conv3DBackpropInputV2"; +var An = "Cos"; +var Fn = "Cosh"; +var Pn = "Cumprod"; +var On = "Cumsum"; +var Mn = "CropAndResize"; +var la = "DenseBincount"; +var Ln = "DepthToSpace"; +var Bn = "DepthwiseConv2dNative"; +var Gi = "DepthwiseConv2dNativeBackpropFilter"; +var Hi = "DepthwiseConv2dNativeBackpropInput"; +var ca = "Diag"; +var zn = "Dilation2D"; +var Ki = "Dilation2DBackpropInput"; +var qi = "Dilation2DBackpropFilter"; +var Mu = "Draw"; +var Vn = "RealDiv"; +var ji = "Einsum"; +var Wn = "Elu"; +var ri = "EluGrad"; +var Un = "Erf"; +var xo = "Equal"; +var yo = "Exp"; +var ma = "ExpandDims"; +var bo = "Expm1"; +var Xi = "FFT"; +var da = "Fill"; +var Gn = "FlipLeftRight"; +var Co = "Floor"; +var wo = "FloorDiv"; +var Hn = "FusedBatchNorm"; +var fa = "GatherV2"; +var Kn = "GatherNd"; +var So = "Greater"; +var Io = "GreaterEqual"; +var vo = "Identity"; +var Yi = "IFFT"; +var Qi = "Imag"; +var qn = "IsFinite"; +var jn = "IsInf"; +var Xn = "IsNan"; +var Yn = "LeakyRelu"; +var ko = "Less"; +var No = "LessEqual"; +var Qn = "LinSpace"; +var To = "Log"; +var Zn = "Log1p"; +var Jn = "LogicalAnd"; +var es = "LogicalNot"; +var ts = "LogicalOr"; +var gk = "LogicalXor"; +var Ime = "LogSoftmax"; +var vme = "LowerBound"; +var rs = "LRN"; +var oi = "LRNGrad"; +var kme = "MatrixBandPart"; +var os = "Max"; +var _o = "Maximum"; +var ns = "MaxPool"; +var Zi = "MaxPoolGrad"; +var ha = "MaxPool3D"; +var Ji = "MaxPool3DGrad"; +var ga = "MaxPoolWithArgmax"; +var ss = "Mean"; +var as = "Min"; +var Eo = "Minimum"; +var is = "MirrorPad"; +var us = "Mod"; +var ps = "Multinomial"; +var $o = "Multiply"; +var ls = "Neg"; +var Ro = "NotEqual"; +var cs = "NonMaxSuppressionV3"; +var ni = "NonMaxSuppressionV4"; +var ms = "NonMaxSuppressionV5"; +var xa = "OnesLike"; +var ds = "OneHot"; +var ya = "Pack"; +var fs = "PadV2"; +var Nme = "Pool"; +var hs = "Pow"; +var gs = "Prelu"; +var Ho = "Prod"; +var Qp = "RaggedGather"; +var Zp = "RaggedRange"; +var Jp = "RaggedTensorToTensor"; +var ba = "Range"; +var si = "Real"; +var xs = "Reciprocal"; +var ys = "Relu"; +var Ca = "Reshape"; +var bs = "ResizeNearestNeighbor"; +var ai = "ResizeNearestNeighborGrad"; +var Cs = "ResizeBilinear"; +var ii = "ResizeBilinearGrad"; +var ws = "Relu6"; +var Ss = "Reverse"; +var Is = "Round"; +var Do = "Rsqrt"; +var vs = "ScatterNd"; +var ks = "TensorScatterUpdate"; +var Ns = "SearchSorted"; +var wa = "Select"; +var Ts = "Selu"; +var _s = "Slice"; +var Es = "Sin"; +var $s = "Sinh"; +var Rs = "Sign"; +var Ao = "Sigmoid"; +var Ds = "Softplus"; +var Fo = "Sqrt"; +var As = "Sum"; +var Sa = "SpaceToBatchND"; +var Ia = "SplitV"; +var Fs = "Softmax"; +var eu = "SparseFillEmptyRows"; +var ui = "SparseReshape"; +var va = "SparseSegmentMean"; +var ka = "SparseSegmentSum"; +var Ps = "SparseToDense"; +var Po = "SquaredDifference"; +var tu = "Square"; +var pi = "StaticRegexReplace"; +var Os = "StridedSlice"; +var Na = "StringNGrams"; +var ru = "StringSplit"; +var ou = "StringToHashBucketFast"; +var Oo = "Sub"; +var Ms = "Tan"; +var Ls = "Tanh"; +var Mo = "Tile"; +var Bs = "TopK"; +var zs = "Transform"; +var Kr = "Transpose"; +var nu = "Unique"; +var Ta = "Unpack"; +var su = "UnsortedSegmentSum"; +var Tme = "UpperBound"; +var _a = "ZerosLike"; +var Ko = "Step"; +var Lu = "FromPixels"; +var Vs = "RotateWithOffset"; +var qo = "_FusedMatMul"; +var jo = "FusedConv2D"; +var Xo = "FusedDepthwiseConv2D"; +function Ea(...r16) { + A().getBool("IS_TEST") || A().getBool("PROD") || console.warn(...r16); +} +function CH(...r16) { + A().getBool("IS_TEST") || A().getBool("PROD") || console.log(...r16); +} +var el = wc("kernelRegistry", () => /* @__PURE__ */ new Map()); +var Sc = wc("gradRegistry", () => /* @__PURE__ */ new Map()); +function tl(r16, e) { + let t10 = ww(r16, e); + return el.get(t10); +} +function Cw(r16) { + return Sc.get(r16); +} +function ad(r16) { + let e = el.entries(), t10 = []; for (; ; ) { - let { done: o, value: n } = t8.next(); + let { done: o, value: n } = e.next(); if (o) break; let [s, a] = n, [i] = s.split("_"); - i === r15 && e.push(a); + i === r16 && t10.push(a); } - return e; + return t10; +} +function li(r16) { + let { kernelName: e, backendName: t10 } = r16, o = ww(e, t10); + el.has(o) && Ea(`The kernel '${e}' for backend '${t10}' is already registered`), el.set(o, r16); +} +function Dme(r16) { + let { kernelName: e } = r16; + Sc.has(e) && A().getBool("DEBUG") && Ea(`Overriding the gradient for '${e}'`), Sc.set(e, r16); } -function ti(r15) { - let { kernelName: t8, backendName: e } = r15, o = iw(t8, e); - Kp.has(o) && Ia(`The kernel '${t8}' for backend '${e}' is already registered`), Kp.set(o, r15); -} -function Xce(r15) { - let { kernelName: t8 } = r15; - dl.has(t8) && A().getBool("DEBUG") && Ia(`Overriding the gradient for '${t8}'`), dl.set(t8, r15); -} -function Yce(r15, t8) { - let e = iw(r15, t8); - if (!Kp.has(e)) - throw new Error(`The kernel '${r15}' for backend '${t8}' is not registered`); - Kp.delete(e); -} -function Qce(r15) { - if (!dl.has(r15)) - throw new Error(`The gradient '${r15}' for backend is not registered`); - dl.delete(r15); -} -function Zce(r15, t8) { - jm(r15).forEach((o) => { - let n = Object.assign({}, o, { backendName: t8 }); - ti(n); +function Ame(r16, e) { + let t10 = ww(r16, e); + if (!el.has(t10)) + throw new Error(`The kernel '${r16}' for backend '${e}' is not registered`); + el.delete(t10); +} +function Fme(r16) { + if (!Sc.has(r16)) + throw new Error(`The gradient '${r16}' for backend is not registered`); + Sc.delete(r16); +} +function Pme(r16, e) { + ad(r16).forEach((o) => { + let n = Object.assign({}, o, { backendName: e }); + li(n); }); } -function iw(r15, t8) { - return `${t8}_${r15}`; +function ww(r16, e) { + return `${e}_${r16}`; } var y = {}; -qe(y, { arraysEqual: () => br, arraysEqualWithNull: () => QC, assert: () => $, assertNonNegativeIntegerDimensions: () => Ct, assertNonNull: () => ao, assertShapesMatch: () => xt, bytesFromStringArray: () => rw, bytesPerElement: () => zp, checkConversionForErrors: () => ew, clamp: () => Bp, computeStrides: () => js, convertBackendValuesAndArrayBuffer: () => zG, createScalarValue: () => r4, createShuffledIndices: () => OG, decodeString: () => Qp, distSquared: () => DG, encodeString: () => Zi, fetch: () => n4, fingerPrint64: () => t4, flatten: () => Fs, getArrayFromDType: () => qm, getTypedArrayFromDType: () => JC, hasEncodingLoss: () => BG, hexToLong: () => fl, indexToLoc: () => UG, inferDtype: () => _i, inferFromImplicitShape: () => LG, isBoolean: () => k0, isFunction: () => qs, isInt: () => Ka, isNumber: () => N0, isPromise: () => Tu, isScalarShape: () => AG, isString: () => zo, isTypedArray: () => Pt, isValidDtype: () => tw, locToIndex: () => WG, makeOnesTypedArray: () => cl, makeZerosNestedTypedArray: () => VG, makeZerosTypedArray: () => Wp, nearestDivisor: () => Vp, nearestLargerEven: () => $G, now: () => Pu, parseAxisParam: () => Ti, randUniform: () => RG, repeatedTry: () => MG, rightPad: () => Nu, shuffle: () => v0, shuffleCombo: () => _G, sizeFromShape: () => He, sizeToSquarishShape: () => PG, squeezeShape: () => ZC, sum: () => EG, swap: () => Km, tanh: () => FG, toNestedArray: () => ku, toTypedArray: () => Yp }); -function Xm(r15) { - return r15 instanceof Float32Array || r15 instanceof Int32Array || r15 instanceof Uint8Array || r15 instanceof Uint8ClampedArray; +qe(y, { arraysEqual: () => Sr, arraysEqualWithNull: () => cw, assert: () => $, assertNonNegativeIntegerDimensions: () => St, assertNonNull: () => fo, assertShapesMatch: () => yt, bytesFromStringArray: () => gw, bytesPerElement: () => jp, checkConversionForErrors: () => fw, clamp: () => qp, computeStrides: () => oa, convertBackendValuesAndArrayBuffer: () => cH, createScalarValue: () => TH, createShuffledIndices: () => iH, decodeString: () => sl, distSquared: () => oH, encodeString: () => iu, fetch: () => EH, fingerPrint64: () => NH, flatten: () => Us, getArrayFromDType: () => sd, getTypedArrayFromDType: () => dw, hasEncodingLoss: () => lH, hexToLong: () => Ic, indexToLoc: () => fH, inferDtype: () => Bi, inferFromImplicitShape: () => pH, isBoolean: () => ck, isFunction: () => ra, isInt: () => Ja, isNumber: () => mk, isPromise: () => Ou, isScalarShape: () => nH, isString: () => dn, isTypedArray: () => Mt, isValidDtype: () => hw, locToIndex: () => dH, makeOnesTypedArray: () => bc, makeZerosNestedTypedArray: () => mH, makeZerosTypedArray: () => Yp, nearestDivisor: () => Xp, nearestLargerEven: () => eH, now: () => Uu, parseAxisParam: () => Li, randUniform: () => rH, repeatedTry: () => uH, rightPad: () => Pu, shuffle: () => lk, shuffleCombo: () => J4, sizeFromShape: () => ze, sizeToSquarishShape: () => aH, squeezeShape: () => mw, sum: () => tH, swap: () => nd, tanh: () => sH, toNestedArray: () => Fu, toTypedArray: () => nl }); +function id(r16) { + return r16 instanceof Float32Array || r16 instanceof Int32Array || r16 instanceof Uint8Array || r16 instanceof Uint8ClampedArray; } -var lw = Lp(W0()); -var Fu = lw.default || lw; -function fl(r15) { - return Fu.fromString(r15, true, 16); +var kw = Kp(_k()); +var Wu = kw.default || kw; +function Ic(r16) { + return Wu.fromString(r16, true, 16); } -var G0 = fl("c3a5c85c97cb3127"); -var Au = fl("b492b66fbe98f273"); -var Cr = fl("9ae16a3b2f90404f"); -function cw(r15) { - return r15.xor(r15.shru(47)); +var $k = Ic("c3a5c85c97cb3127"); +var Vu = Ic("b492b66fbe98f273"); +var Ir = Ic("9ae16a3b2f90404f"); +function vw(r16) { + return r16.xor(r16.shru(47)); } -function H0(r15, t8, e) { - let o = r15.slice(t8, t8 + e); - return Fu.fromBytes(Array.from(o), true, true); +function Rk(r16, e, t10) { + let o = r16.slice(e, e + t10); + return Wu.fromBytes(Array.from(o), true, true); } -function wt(r15, t8) { - return H0(r15, t8, 8); +function It(r16, e) { + return Rk(r16, e, 8); } -function U0(r15, t8) { - return H0(r15, t8, 4); +function Ek(r16, e) { + return Rk(r16, e, 4); } -function Yt(r15, t8) { - return t8 === 0 ? r15 : r15.shru(t8).or(r15.shl(64 - t8)); +function Jt(r16, e) { + return e === 0 ? r16 : r16.shru(e).or(r16.shl(64 - e)); } -function Qi(r15, t8, e = fl("9ddfea08eb382d69")) { - let o = r15.xor(t8).mul(e); +function au(r16, e, t10 = Ic("9ddfea08eb382d69")) { + let o = r16.xor(e).mul(t10); o = o.xor(o.shru(47)); - let n = t8.xor(o).mul(e); - return n = n.xor(n.shru(47)), n = n.mul(e), n; + let n = e.xor(o).mul(t10); + return n = n.xor(n.shru(47)), n = n.mul(t10), n; } -function QG(r15, t8, e, o, n, s) { - n = n.add(r15), s = Yt(s.add(n).add(o), 21); +function SH(r16, e, t10, o, n, s) { + n = n.add(r16), s = Jt(s.add(n).add(o), 21); let a = n; - return n = n.add(t8), n = n.add(e), s = s.add(Yt(n, 44)), [n.add(o), s.add(a)]; -} -function Qm(r15, t8, e, o) { - return QG(wt(r15, t8), wt(r15, t8 + 8), wt(r15, t8 + 16), wt(r15, t8 + 24), e, o); -} -function ZG(r15, t8 = r15.length) { - if (t8 >= 8) { - let e = Cr.add(t8 * 2), o = wt(r15, 0).add(Cr), n = wt(r15, t8 - 8), s = Yt(n, 37).mul(e).add(o), a = Yt(o, 25).add(n).mul(e); - return Qi(s, a, e); - } - if (t8 >= 4) { - let e = Cr.add(t8 * 2), o = U0(r15, 0); - return Qi(o.shl(3).add(t8), U0(r15, t8 - 4), e); - } - if (t8 > 0) { - let e = r15[0], o = r15[t8 >> 1], n = r15[t8 - 1], s = e + (o << 8), a = t8 + (n << 2); - return cw(Cr.mul(s).xor(G0.mul(a))).mul(Cr); - } - return Cr; -} -function JG(r15, t8 = r15.length) { - let e = Cr.add(t8 * 2), o = wt(r15, 0).mul(Au), n = wt(r15, 8), s = wt(r15, t8 - 8).mul(e), a = wt(r15, t8 - 16).mul(Cr); - return Qi(Yt(o.add(n), 43).add(Yt(s, 30)).add(a), o.add(Yt(n.add(Cr), 18)).add(s), e); -} -function e4(r15, t8 = r15.length) { - let e = Cr.add(t8 * 2), o = wt(r15, 0).mul(Cr), n = wt(r15, 8), s = wt(r15, t8 - 8).mul(e), a = wt(r15, t8 - 16).mul(Cr), i = Yt(o.add(n), 43).add(Yt(s, 30)).add(a), p = Qi(i, o.add(Yt(n.add(Cr), 18)).add(s), e), u = wt(r15, 16).mul(e), c = wt(r15, 24), l = i.add(wt(r15, t8 - 32)).mul(e), m = p.add(wt(r15, t8 - 24)).mul(e); - return Qi(Yt(u.add(c), 43).add(Yt(l, 30)).add(m), u.add(Yt(c.add(o), 18)).add(l), e); -} -function t4(r15, t8 = r15.length) { - let e = Fu.fromNumber(81, true); - if (t8 <= 32) - return t8 <= 16 ? ZG(r15, t8) : JG(r15, t8); - if (t8 <= 64) - return e4(r15, t8); - let o = e, n = e.mul(Au).add(113), s = cw(n.mul(Cr).add(113)).mul(Cr), a = [Fu.UZERO, Fu.UZERO], i = [Fu.UZERO, Fu.UZERO]; - o = o.mul(Cr).add(wt(r15, 0)); - let p = 0, u = (t8 - 1 >> 6) * 64, c = u + (t8 - 1 & 63) - 63; + return n = n.add(e), n = n.add(t10), s = s.add(Jt(n, 44)), [n.add(o), s.add(a)]; +} +function pd(r16, e, t10, o) { + return SH(It(r16, e), It(r16, e + 8), It(r16, e + 16), It(r16, e + 24), t10, o); +} +function IH(r16, e = r16.length) { + if (e >= 8) { + let t10 = Ir.add(e * 2), o = It(r16, 0).add(Ir), n = It(r16, e - 8), s = Jt(n, 37).mul(t10).add(o), a = Jt(o, 25).add(n).mul(t10); + return au(s, a, t10); + } + if (e >= 4) { + let t10 = Ir.add(e * 2), o = Ek(r16, 0); + return au(o.shl(3).add(e), Ek(r16, e - 4), t10); + } + if (e > 0) { + let t10 = r16[0], o = r16[e >> 1], n = r16[e - 1], s = t10 + (o << 8), a = e + (n << 2); + return vw(Ir.mul(s).xor($k.mul(a))).mul(Ir); + } + return Ir; +} +function vH(r16, e = r16.length) { + let t10 = Ir.add(e * 2), o = It(r16, 0).mul(Vu), n = It(r16, 8), s = It(r16, e - 8).mul(t10), a = It(r16, e - 16).mul(Ir); + return au(Jt(o.add(n), 43).add(Jt(s, 30)).add(a), o.add(Jt(n.add(Ir), 18)).add(s), t10); +} +function kH(r16, e = r16.length) { + let t10 = Ir.add(e * 2), o = It(r16, 0).mul(Ir), n = It(r16, 8), s = It(r16, e - 8).mul(t10), a = It(r16, e - 16).mul(Ir), i = Jt(o.add(n), 43).add(Jt(s, 30)).add(a), p = au(i, o.add(Jt(n.add(Ir), 18)).add(s), t10), u = It(r16, 16).mul(t10), l = It(r16, 24), c = i.add(It(r16, e - 32)).mul(t10), m = p.add(It(r16, e - 24)).mul(t10); + return au(Jt(u.add(l), 43).add(Jt(c, 30)).add(m), u.add(Jt(l.add(o), 18)).add(c), t10); +} +function NH(r16, e = r16.length) { + let t10 = Wu.fromNumber(81, true); + if (e <= 32) + return e <= 16 ? IH(r16, e) : vH(r16, e); + if (e <= 64) + return kH(r16, e); + let o = t10, n = t10.mul(Vu).add(113), s = vw(n.mul(Ir).add(113)).mul(Ir), a = [Wu.UZERO, Wu.UZERO], i = [Wu.UZERO, Wu.UZERO]; + o = o.mul(Ir).add(It(r16, 0)); + let p = 0, u = (e - 1 >> 6) * 64, l = u + (e - 1 & 63) - 63; do - o = Yt(o.add(n).add(a[0]).add(wt(r15, p + 8)), 37).mul(Au), n = Yt(n.add(a[1]).add(wt(r15, p + 48)), 42).mul(Au), o = o.xor(i[1]), n = n.add(a[0]).add(wt(r15, p + 40)), s = Yt(s.add(i[0]), 33).mul(Au), a = Qm(r15, p, a[1].mul(Au), o.add(i[0])), i = Qm(r15, p + 32, s.add(i[1]), n.add(wt(r15, p + 16))), [s, o] = [o, s], p += 64; + o = Jt(o.add(n).add(a[0]).add(It(r16, p + 8)), 37).mul(Vu), n = Jt(n.add(a[1]).add(It(r16, p + 48)), 42).mul(Vu), o = o.xor(i[1]), n = n.add(a[0]).add(It(r16, p + 40)), s = Jt(s.add(i[0]), 33).mul(Vu), a = pd(r16, p, a[1].mul(Vu), o.add(i[0])), i = pd(r16, p + 32, s.add(i[1]), n.add(It(r16, p + 16))), [s, o] = [o, s], p += 64; while (p !== u); - let l = Au.add(s.and(255).shl(1)); - return p = c, i[0] = i[0].add(t8 - 1 & 63), a[0] = a[0].add(i[0]), i[0] = i[0].add(a[0]), o = Yt(o.add(n).add(a[0]).add(wt(r15, p + 8)), 37).mul(l), n = Yt(n.add(a[1]).add(wt(r15, p + 48)), 42).mul(l), o = o.xor(i[1].mul(9)), n = n.add(a[0].mul(9).add(wt(r15, p + 40))), s = Yt(s.add(i[0]), 33).mul(l), a = Qm(r15, p, a[1].mul(l), o.add(i[0])), i = Qm(r15, p + 32, s.add(i[1]), n.add(wt(r15, p + 16))), [s, o] = [o, s], Qi(Qi(a[0], i[0], l).add(cw(n).mul(G0)).add(s), Qi(a[1], i[1], l).add(o), l); + let c = Vu.add(s.and(255).shl(1)); + return p = l, i[0] = i[0].add(e - 1 & 63), a[0] = a[0].add(i[0]), i[0] = i[0].add(a[0]), o = Jt(o.add(n).add(a[0]).add(It(r16, p + 8)), 37).mul(c), n = Jt(n.add(a[1]).add(It(r16, p + 48)), 42).mul(c), o = o.xor(i[1].mul(9)), n = n.add(a[0].mul(9).add(It(r16, p + 40))), s = Jt(s.add(i[0]), 33).mul(c), a = pd(r16, p, a[1].mul(c), o.add(i[0])), i = pd(r16, p + 32, s.add(i[1]), n.add(It(r16, p + 16))), [s, o] = [o, s], au(au(a[0], i[0], c).add(vw(n).mul($k)).add(s), au(a[1], i[1], c).add(o), c); } -function r4(r15, t8) { - return t8 === "string" ? Zi(r15) : Yp([r15], t8); +function TH(r16, e) { + return e === "string" ? iu(r16) : nl([r16], e); } -function o4(r15, t8) { - return r15 instanceof Float32Array && t8 === "float32" || r15 instanceof Int32Array && t8 === "int32" || r15 instanceof Uint8Array && t8 === "bool"; +function _H(r16, e) { + return r16 instanceof Float32Array && e === "float32" || r16 instanceof Int32Array && e === "int32" || r16 instanceof Uint8Array && e === "bool"; } -function Yp(r15, t8) { - if (t8 === "string") +function nl(r16, e) { + if (e === "string") throw new Error("Cannot convert a string[] to a TypedArray"); - if (Array.isArray(r15) && (r15 = Fs(r15)), A().getBool("DEBUG") && ew(r15, t8), o4(r15, t8)) - return r15; - if (t8 == null || t8 === "float32" || t8 === "complex64") - return new Float32Array(r15); - if (t8 === "int32") - return new Int32Array(r15); - if (t8 === "bool") { - let e = new Uint8Array(r15.length); - for (let o = 0; o < e.length; ++o) - Math.round(r15[o]) !== 0 && (e[o] = 1); - return e; + if (Array.isArray(r16) && (r16 = Us(r16)), A().getBool("DEBUG") && fw(r16, e), _H(r16, e)) + return r16; + if (e == null || e === "float32" || e === "complex64") + return new Float32Array(r16); + if (e === "int32") + return new Int32Array(r16); + if (e === "bool") { + let t10 = new Uint8Array(r16.length); + for (let o = 0; o < t10.length; ++o) + Math.round(r16[o]) !== 0 && (t10[o] = 1); + return t10; } else - throw new Error(`Unknown data type ${t8}`); + throw new Error(`Unknown data type ${e}`); } -function Pu() { +function Uu() { return A().platform.now(); } -function n4(r15, t8) { - return A().platform.fetch(r15, t8); +function EH(r16, e) { + return A().platform.fetch(r16, e); } -function Zi(r15, t8 = "utf-8") { - return t8 = t8 || "utf-8", A().platform.encode(r15, t8); +function iu(r16, e = "utf-8") { + return e = e || "utf-8", A().platform.encode(r16, e); } -function Qp(r15, t8 = "utf-8") { - return t8 = t8 || "utf-8", A().platform.decode(r15, t8); +function sl(r16, e = "utf-8") { + return e = e || "utf-8", A().platform.decode(r16, e); } -function Pt(r15) { - return A().platform.isTypedArray != null ? A().platform.isTypedArray(r15) : Xm(r15); +function Mt(r16) { + return A().platform.isTypedArray != null ? A().platform.isTypedArray(r16) : id(r16); } -function Fs(r15, t8 = [], e = false) { - if (t8 == null && (t8 = []), typeof r15 == "boolean" || typeof r15 == "number" || typeof r15 == "string" || Tu(r15) || r15 == null || Pt(r15) && e) - t8.push(r15); - else if (Array.isArray(r15) || Pt(r15)) - for (let o = 0; o < r15.length; ++o) - Fs(r15[o], t8, e); +function Us(r16, e = [], t10 = false) { + if (e == null && (e = []), typeof r16 == "boolean" || typeof r16 == "number" || typeof r16 == "string" || Ou(r16) || r16 == null || Mt(r16) && t10) + e.push(r16); + else if (Array.isArray(r16) || Mt(r16)) + for (let o = 0; o < r16.length; ++o) + Us(r16[o], e, t10); else { let o = -1; - for (let n of Object.keys(r15)) + for (let n of Object.keys(r16)) /^([1-9]+[0-9]*|0)$/.test(n) && (o = Math.max(o, Number(n))); for (let n = 0; n <= o; n++) - Fs(r15[n], t8, e); + Us(r16[n], e, t10); } - return t8; + return e; } -var Zm = class { - constructor(t8, e) { - this.backendTimer = t8, this.logger = e, e == null && (this.logger = new mw()); +var ld = class { + constructor(e, t10) { + this.backendTimer = e, this.logger = t10, t10 == null && (this.logger = new Nw()); } - profileKernel(t8, e, o) { + profileKernel(e, t10, o) { let n, s = () => { n = o(); - }, a, i = Pu(); + }, a, i = Uu(); if (this.backendTimer.timerAvailable()) a = this.backendTimer.time(s); else { s(); for (let u of n) u.dataSync(); - a = Promise.resolve({ kernelMs: Pu() - i }); + a = Promise.resolve({ kernelMs: Uu() - i }); } if (A().getBool("CHECK_COMPUTATION_FOR_ERRORS")) for (let u = 0; u < n.length; u++) { - let c = n[u]; - c.data().then((l) => { - s4(l, c.dtype, t8); + let l = n[u]; + l.data().then((c) => { + $H(c, l.dtype, e); }); } - return { kernelName: t8, outputs: n, inputs: e, timeMs: a.then((u) => u.kernelMs), extraInfo: a.then((u) => u.getExtraProfileInfo != null ? u.getExtraProfileInfo() : "") }; + return { kernelName: e, outputs: n, inputs: t10, timeMs: a.then((u) => u.kernelMs), extraInfo: a.then((u) => u.getExtraProfileInfo != null ? u.getExtraProfileInfo() : "") }; } - logKernelProfile(t8) { - let { kernelName: e, outputs: o, timeMs: n, inputs: s, extraInfo: a } = t8; + logKernelProfile(e) { + let { kernelName: t10, outputs: o, timeMs: n, inputs: s, extraInfo: a } = e; o.forEach((i) => { Promise.all([i.data(), n, a]).then((p) => { - this.logger.logKernelProfile(e, i, p[0], p[1], s, p[2]); + this.logger.logKernelProfile(t10, i, p[0], p[1], s, p[2]); }); }); } }; -function s4(r15, t8, e) { - if (t8 !== "float32") +function $H(r16, e, t10) { + if (e !== "float32") return false; - for (let o = 0; o < r15.length; o++) { - let n = r15[o]; + for (let o = 0; o < r16.length; o++) { + let n = r16[o]; if (isNaN(n) || !isFinite(n)) - return console.warn(`Found ${n} in the result of '${e}'`), true; + return console.warn(`Found ${n} in the result of '${t10}'`), true; } return false; } -var mw = class { - logKernelProfile(t8, e, o, n, s, a) { - let i = typeof n == "number" ? Nu(`${n}ms`, 9) : n.error, p = Nu(t8, 25), u = e.rank, c = e.size, l = Nu(e.shape.toString(), 14), m = ""; +var Nw = class { + logKernelProfile(e, t10, o, n, s, a) { + let i = typeof n == "number" ? Pu(`${n}ms`, 9) : n.error, p = Pu(e, 25), u = t10.rank, l = t10.size, c = Pu(t10.shape.toString(), 14), m = ""; for (let d in s) { let f = s[d]; if (f != null) { - let h = f.shape || e.shape, g = h.length; + let h = f.shape || t10.shape, g = h.length; m += `${d}: ${g}D ${g > 0 ? h : ""} `; } } - console.log(`%c${p} %c${i} %c${u}D ${l} %c${c} %c${m} %c${a}`, "font-weight:bold", "color:red", "color:blue", "color: orange", "color: green", "color: steelblue"); + console.log(`%c${p} %c${i} %c${u}D ${c} %c${l} %c${m} %c${a}`, "font-weight:bold", "color:red", "color:blue", "color: orange", "color: green", "color: steelblue"); } }; -function K0(r15, t8, e) { +function Dk(r16, e, t10) { let o = {}, n = {}; - for (let p = 0; p < t8.length; p++) - o[t8[p].id] = true; - for (let p = 0; p < r15.length; p++) { - let u = r15[p], c = u.inputs; - for (let l in c) { - let m = c[l], d = false; - for (let f = 0; f < t8.length; f++) + for (let p = 0; p < e.length; p++) + o[e[p].id] = true; + for (let p = 0; p < r16.length; p++) { + let u = r16[p], l = u.inputs; + for (let c in l) { + let m = l[c], d = false; + for (let f = 0; f < e.length; f++) if (o[m.id]) { u.outputs.forEach((h) => o[h.id] = true), d = true, n[u.id] = true; break; @@ -3907,37 +3907,37 @@ function K0(r15, t8, e) { } } let s = {}; - s[e.id] = true; + s[t10.id] = true; let a = {}; - for (let p = r15.length - 1; p >= 0; p--) { - let u = r15[p], c = u.inputs; - for (let l = 0; l < u.outputs.length; l++) - if (s[u.outputs[l].id]) { - for (let m in c) - s[c[m].id] = true, a[u.id] = true; + for (let p = r16.length - 1; p >= 0; p--) { + let u = r16[p], l = u.inputs; + for (let c = 0; c < u.outputs.length; c++) + if (s[u.outputs[c].id]) { + for (let m in l) + s[l[m].id] = true, a[u.id] = true; break; } } let i = []; - for (let p = 0; p < r15.length; p++) { - let u = r15[p]; + for (let p = 0; p < r16.length; p++) { + let u = r16[p]; if (n[u.id] && a[u.id]) { - let c = {}; + let l = {}; for (let m in u.inputs) { let d = u.inputs[m]; - o[d.id] && (c[m] = d); + o[d.id] && (l[m] = d); } - let l = Object.assign({}, u); - l.inputs = c, l.outputs = u.outputs, i.push(l); + let c = Object.assign({}, u); + c.inputs = l, c.outputs = u.outputs, i.push(c); } } return i; } -function q0(r15, t8, e, o) { - for (let n = t8.length - 1; n >= 0; n--) { - let s = t8[n], a = []; +function Ak(r16, e, t10, o) { + for (let n = e.length - 1; n >= 0; n--) { + let s = e[n], a = []; if (s.outputs.forEach((p) => { - let u = r15[p.id]; + let u = r16[p.id]; u != null ? a.push(u) : a.push(null); }), s.gradient == null) throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`); @@ -3945,78 +3945,78 @@ function q0(r15, t8, e, o) { for (let p in s.inputs) { if (!(p in i)) throw new Error(`Cannot backprop through input ${p}. Available gradients found: ${Object.keys(i)}.`); - let u = e(() => i[p]()); + let u = t10(() => i[p]()); if (u.dtype !== "float32") throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${p} must have 'float32' dtype, but has '${u.dtype}'`); - let c = s.inputs[p]; - if (!br(u.shape, c.shape)) - throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${p}' has shape '${u.shape}', which does not match the shape of the input '${c.shape}'`); - if (r15[c.id] == null) - r15[c.id] = u; + let l = s.inputs[p]; + if (!Sr(u.shape, l.shape)) + throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${p}' has shape '${u.shape}', which does not match the shape of the input '${l.shape}'`); + if (r16[l.id] == null) + r16[l.id] = u; else { - let l = r15[c.id]; - r15[c.id] = o(l, u), l.dispose(); + let c = r16[l.id]; + r16[l.id] = o(c, u), c.dispose(); } } } } -var j0 = 20; -var hl = 3; -var dw = 7; -function X0(r15, t8, e, o) { - let n = js(t8), s = a4(r15, t8, e, n), a = t8.length, i = Jm(r15, t8, e, n, s), p = ["Tensor"]; - return o && (p.push(` dtype: ${e}`), p.push(` rank: ${a}`), p.push(` shape: [${t8}]`), p.push(" values:")), p.push(i.map((u) => " " + u).join(` +var Fk = 20; +var vc = 3; +var Tw = 7; +function Pk(r16, e, t10, o) { + let n = oa(e), s = RH(r16, e, t10, n), a = e.length, i = cd(r16, e, t10, n, s), p = ["Tensor"]; + return o && (p.push(` dtype: ${t10}`), p.push(` rank: ${a}`), p.push(` shape: [${e}]`), p.push(" values:")), p.push(i.map((u) => " " + u).join(` `)), p.join(` `); } -function a4(r15, t8, e, o) { - let n = He(t8), s = o[o.length - 1], a = new Array(s).fill(0), i = t8.length, p = e === "complex64" ? xl(r15) : r15; +function RH(r16, e, t10, o) { + let n = ze(e), s = o[o.length - 1], a = new Array(s).fill(0), i = e.length, p = t10 === "complex64" ? Nc(r16) : r16; if (i > 1) for (let u = 0; u < n / s; u++) { - let c = u * s; - for (let l = 0; l < s; l++) - a[l] = Math.max(a[l], gl(p[c + l], 0, e).length); + let l = u * s; + for (let c = 0; c < s; c++) + a[c] = Math.max(a[c], kc(p[l + c], 0, t10).length); } return a; } -function gl(r15, t8, e) { +function kc(r16, e, t10) { let o; - return Array.isArray(r15) ? o = `${parseFloat(r15[0].toFixed(dw))} + ${parseFloat(r15[1].toFixed(dw))}j` : zo(r15) ? o = `'${r15}'` : e === "bool" ? o = Y0(r15) : o = parseFloat(r15.toFixed(dw)).toString(), Nu(o, t8); + return Array.isArray(r16) ? o = `${parseFloat(r16[0].toFixed(Tw))} + ${parseFloat(r16[1].toFixed(Tw))}j` : dn(r16) ? o = `'${r16}'` : t10 === "bool" ? o = Ok(r16) : o = parseFloat(r16.toFixed(Tw)).toString(), Pu(o, e); } -function Y0(r15) { - return r15 === 0 ? "false" : "true"; +function Ok(r16) { + return r16 === 0 ? "false" : "true"; } -function Jm(r15, t8, e, o, n, s = true) { - let a = e === "complex64" ? 2 : 1, i = t8[0], p = t8.length; +function cd(r16, e, t10, o, n, s = true) { + let a = t10 === "complex64" ? 2 : 1, i = e[0], p = e.length; if (p === 0) { - if (e === "complex64") { - let h = xl(r15); - return [gl(h[0], 0, e)]; + if (t10 === "complex64") { + let h = Nc(r16); + return [kc(h[0], 0, t10)]; } - return e === "bool" ? [Y0(r15[0])] : [r15[0].toString()]; + return t10 === "bool" ? [Ok(r16[0])] : [r16[0].toString()]; } if (p === 1) { - if (i > j0) { - let g = hl * a, x = Array.from(r15.slice(0, g)), b = Array.from(r15.slice((i - hl) * a, i * a)); - return e === "complex64" && (x = xl(x), b = xl(b)), ["[" + x.map((C, S) => gl(C, n[S], e)).join(", ") + ", ..., " + b.map((C, S) => gl(C, n[i - hl + S], e)).join(", ") + "]"]; + if (i > Fk) { + let g = vc * a, x = Array.from(r16.slice(0, g)), b = Array.from(r16.slice((i - vc) * a, i * a)); + return t10 === "complex64" && (x = Nc(x), b = Nc(b)), ["[" + x.map((w, S) => kc(w, n[S], t10)).join(", ") + ", ..., " + b.map((w, S) => kc(w, n[i - vc + S], t10)).join(", ") + "]"]; } - return ["[" + (e === "complex64" ? xl(r15) : Array.from(r15)).map((g, x) => gl(g, n[x], e)).join(", ") + "]"]; + return ["[" + (t10 === "complex64" ? Nc(r16) : Array.from(r16)).map((g, x) => kc(g, n[x], t10)).join(", ") + "]"]; } - let u = t8.slice(1), c = o.slice(1), l = o[0] * a, m = []; - if (i > j0) { - for (let h = 0; h < hl; h++) { - let g = h * l, x = g + l; - m.push(...Jm(r15.slice(g, x), u, e, c, n, false)); + let u = e.slice(1), l = o.slice(1), c = o[0] * a, m = []; + if (i > Fk) { + for (let h = 0; h < vc; h++) { + let g = h * c, x = g + c; + m.push(...cd(r16.slice(g, x), u, t10, l, n, false)); } m.push("..."); - for (let h = i - hl; h < i; h++) { - let g = h * l, x = g + l; - m.push(...Jm(r15.slice(g, x), u, e, c, n, h === i - 1)); + for (let h = i - vc; h < i; h++) { + let g = h * c, x = g + c; + m.push(...cd(r16.slice(g, x), u, t10, l, n, h === i - 1)); } } else for (let h = 0; h < i; h++) { - let g = h * l, x = g + l; - m.push(...Jm(r15.slice(g, x), u, e, c, n, h === i - 1)); + let g = h * c, x = g + c; + m.push(...cd(r16.slice(g, x), u, t10, l, n, h === i - 1)); } let d = p === 2 ? "," : ""; m[0] = "[" + (i > 0 ? m[0] + d : ""); @@ -4029,136 +4029,136 @@ function Jm(r15, t8, e, o, n, s = true) { `; return m[m.length - 1] = " " + m[m.length - 1] + "]" + (s ? "" : f), m; } -function xl(r15) { - let t8 = []; - for (let e = 0; e < r15.length; e += 2) - t8.push([r15[e], r15[e + 1]]); - return t8; +function Nc(r16) { + let e = []; + for (let t10 = 0; t10 < r16.length; t10 += 2) + e.push([r16[t10], r16[t10 + 1]]); + return e; } -var tt = class { - constructor(t8, e, o) { - if (this.dtype = e, this.shape = t8.slice(), this.size = He(t8), o != null) { +var Ge = class { + constructor(e, t10, o) { + if (this.dtype = t10, this.shape = e.slice(), this.size = ze(e), o != null) { let n = o.length; $(n === this.size, () => `Length of values '${n}' does not match the size inferred by the shape '${this.size}'.`); } - if (e === "complex64") + if (t10 === "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 = o || qm(e, this.size), this.strides = js(t8); - } - set(t8, ...e) { - e.length === 0 && (e = [0]), $(e.length === this.rank, () => `The number of provided coordinates (${e.length}) must match the rank (${this.rank})`); - let o = this.locToIndex(e); - this.values[o] = t8; - } - get(...t8) { - t8.length === 0 && (t8 = [0]); - let e = 0; - for (let n of t8) { - if (n < 0 || n >= this.shape[e]) { - let s = `Requested out of range element at ${t8}. Buffer shape=${this.shape}`; + this.values = o || sd(t10, this.size), this.strides = oa(e); + } + set(e, ...t10) { + t10.length === 0 && (t10 = [0]), $(t10.length === this.rank, () => `The number of provided coordinates (${t10.length}) must match the rank (${this.rank})`); + let o = this.locToIndex(t10); + this.values[o] = e; + } + get(...e) { + e.length === 0 && (e = [0]); + let t10 = 0; + for (let n of e) { + if (n < 0 || n >= this.shape[t10]) { + let s = `Requested out of range element at ${e}. Buffer shape=${this.shape}`; throw new Error(s); } - e++; + t10++; } - let o = t8[t8.length - 1]; - for (let n = 0; n < t8.length - 1; ++n) - o += this.strides[n] * t8[n]; + let o = e[e.length - 1]; + for (let n = 0; n < e.length - 1; ++n) + o += this.strides[n] * e[n]; return this.values[o]; } - locToIndex(t8) { + locToIndex(e) { if (this.rank === 0) return 0; if (this.rank === 1) - return t8[0]; - let e = t8[t8.length - 1]; - for (let o = 0; o < t8.length - 1; ++o) - e += this.strides[o] * t8[o]; - return e; + return e[0]; + let t10 = e[e.length - 1]; + for (let o = 0; o < e.length - 1; ++o) + t10 += this.strides[o] * e[o]; + return t10; } - indexToLoc(t8) { + indexToLoc(e) { if (this.rank === 0) return []; if (this.rank === 1) - return [t8]; - let e = new Array(this.shape.length); - for (let o = 0; o < e.length - 1; ++o) - e[o] = Math.floor(t8 / this.strides[o]), t8 -= e[o] * this.strides[o]; - return e[e.length - 1] = t8, e; + return [e]; + let t10 = new Array(this.shape.length); + for (let o = 0; o < t10.length - 1; ++o) + t10[o] = Math.floor(e / this.strides[o]), e -= t10[o] * this.strides[o]; + return t10[t10.length - 1] = e, t10; } get rank() { return this.shape.length; } toTensor() { - return Ps().makeTensor(this.values, this.shape, this.dtype); + return Gs().makeTensor(this.values, this.shape, this.dtype); } }; -var Ps = null; -var Zp = null; -var i4 = null; -function Q0(r15) { - Ps = r15; +var Gs = null; +var al = null; +var DH = null; +function Mk(r16) { + Gs = r16; } -function Z0(r15) { - Zp = r15; +function Lk(r16) { + al = r16; } -function J0(r15) { - i4 = r15; +function Bk(r16) { + DH = r16; } -var mt = class { - constructor(t8, e, o, n) { - this.kept = false, this.isDisposedInternal = false, this.shape = t8.slice(), this.dtype = e || "float32", this.size = He(t8), this.strides = js(t8), this.dataId = o, this.id = n, this.rankType = this.rank < 5 ? this.rank.toString() : "higher"; +var dt = class { + constructor(e, t10, o, n) { + this.kept = false, this.isDisposedInternal = false, this.shape = e.slice(), this.dtype = t10 || "float32", this.size = ze(e), this.strides = oa(e), this.dataId = o, this.id = n, this.rankType = this.rank < 5 ? this.rank.toString() : "higher"; } get rank() { return this.shape.length; } async buffer() { - let t8 = await this.data(); - return Zp.buffer(this.shape, this.dtype, t8); + let e = await this.data(); + return al.buffer(this.shape, this.dtype, e); } bufferSync() { - return Zp.buffer(this.shape, this.dtype, this.dataSync()); + return al.buffer(this.shape, this.dtype, this.dataSync()); } async array() { - let t8 = await this.data(); - return ku(this.shape, t8, this.dtype === "complex64"); + let e = await this.data(); + return Fu(this.shape, e, this.dtype === "complex64"); } arraySync() { - return ku(this.shape, this.dataSync(), this.dtype === "complex64"); + return Fu(this.shape, this.dataSync(), this.dtype === "complex64"); } async data() { this.throwIfDisposed(); - let t8 = Ps().read(this.dataId); + let e = Gs().read(this.dataId); if (this.dtype === "string") { - let e = await t8; + let t10 = await e; try { - return e.map((o) => Qp(o)); + return t10.map((o) => sl(o)); } catch (o) { throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes()."); } } - return t8; + return e; } - dataToGPU(t8) { - return this.throwIfDisposed(), Ps().readToGPU(this.dataId, t8); + dataToGPU(e) { + return this.throwIfDisposed(), Gs().readToGPU(this.dataId, e); } dataSync() { this.throwIfDisposed(); - let t8 = Ps().readSync(this.dataId); + let e = Gs().readSync(this.dataId); if (this.dtype === "string") try { - return t8.map((e) => Qp(e)); - } catch (e) { + return e.map((t10) => sl(t10)); + } catch (t10) { throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes()."); } - return t8; + return e; } async bytes() { this.throwIfDisposed(); - let t8 = await Ps().read(this.dataId); - return this.dtype === "string" ? t8 : new Uint8Array(t8.buffer); + let e = await Gs().read(this.dataId); + return this.dtype === "string" ? e : new Uint8Array(e.buffer); } dispose() { - this.isDisposed || (this.kerasMask && this.kerasMask.dispose(), Ps().disposeTensor(this), this.isDisposedInternal = true); + this.isDisposed || (this.kerasMask && this.kerasMask.dispose(), Gs().disposeTensor(this), this.isDisposedInternal = true); } get isDisposed() { return this.isDisposedInternal; @@ -4167,135 +4167,135 @@ var mt = class { if (this.isDisposed) throw new Error("Tensor is disposed."); } - print(t8 = false) { - return Zp.print(this, t8); + print(e = false) { + return al.print(this, e); } clone() { - return this.throwIfDisposed(), Zp.clone(this); + return this.throwIfDisposed(), al.clone(this); } - toString(t8 = false) { - let e = this.dataSync(); - return X0(e, this.shape, this.dtype, t8); + toString(e = false) { + let t10 = this.dataSync(); + return Pk(t10, this.shape, this.dtype, e); } - cast(t8) { - return this.throwIfDisposed(), Zp.cast(this, t8); + cast(e) { + return this.throwIfDisposed(), al.cast(this, e); } - variable(t8 = true, e, o) { - return this.throwIfDisposed(), Ps().makeVariable(this, t8, e, o); + variable(e = true, t10, o) { + return this.throwIfDisposed(), Gs().makeVariable(this, e, t10, o); } }; -Object.defineProperty(mt, Symbol.hasInstance, { value: (r15) => !!r15 && r15.data != null && r15.dataSync != null && r15.throwIfDisposed != null }); -function fw() { - return ml("Tensor", () => mt); +Object.defineProperty(dt, Symbol.hasInstance, { value: (r16) => !!r16 && r16.data != null && r16.dataSync != null && r16.throwIfDisposed != null }); +function _w() { + return wc("Tensor", () => dt); } -fw(); -var ri = class extends mt { - constructor(t8, e, o, n) { - super(t8.shape, t8.dtype, t8.dataId, n), this.trainable = e, this.name = o; +_w(); +var ci = class extends dt { + constructor(e, t10, o, n) { + super(e.shape, e.dtype, e.dataId, n), this.trainable = t10, this.name = o; } - assign(t8) { - if (t8.dtype !== this.dtype) - throw new Error(`dtype of the new value (${t8.dtype}) and previous value (${this.dtype}) must match`); - if (!br(t8.shape, this.shape)) - throw new Error(`shape of the new value (${t8.shape}) and previous value (${this.shape}) must match`); - Ps().disposeTensor(this), this.dataId = t8.dataId, Ps().incRef(this, null); + 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 (!Sr(e.shape, this.shape)) + throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`); + Gs().disposeTensor(this), this.dataId = e.dataId, Gs().incRef(this, null); } dispose() { - Ps().disposeVariable(this), this.isDisposedInternal = true; - } -}; -Object.defineProperty(ri, Symbol.hasInstance, { value: (r15) => r15 instanceof mt && r15.assign != null && r15.assign instanceof Function }); -var tk = {}; -qe(tk, { assertTypesMatch: () => Cw, getTensorsInContainer: () => yl, isTensorInList: () => p4, makeTypesMatch: () => Oe }); -var hw; -(function(r15) { - r15.R0 = "R0", r15.R1 = "R1", r15.R2 = "R2", r15.R3 = "R3", r15.R4 = "R4", r15.R5 = "R5", r15.R6 = "R6"; -})(hw || (hw = {})); -var gw; -(function(r15) { - r15.float32 = "float32", r15.int32 = "int32", r15.bool = "int32", r15.complex64 = "complex64"; -})(gw || (gw = {})); -var xw; -(function(r15) { - r15.float32 = "float32", r15.int32 = "int32", r15.bool = "bool", r15.complex64 = "complex64"; -})(xw || (xw = {})); -var yw; -(function(r15) { - r15.float32 = "float32", r15.int32 = "float32", r15.bool = "float32", r15.complex64 = "complex64"; -})(yw || (yw = {})); -var bw; -(function(r15) { - r15.float32 = "complex64", r15.int32 = "complex64", r15.bool = "complex64", r15.complex64 = "complex64"; -})(bw || (bw = {})); -var u4 = { float32: yw, int32: gw, bool: xw, complex64: bw }; -function dt(r15, t8) { - if (r15 === "string" || t8 === "string") { - if (r15 === "string" && t8 === "string") + Gs().disposeVariable(this), this.isDisposedInternal = true; + } +}; +Object.defineProperty(ci, Symbol.hasInstance, { value: (r16) => r16 instanceof dt && r16.assign != null && r16.assign instanceof Function }); +var Vk = {}; +qe(Vk, { assertTypesMatch: () => Fw, getTensorsInContainer: () => Tc, isTensorInList: () => FH, makeTypesMatch: () => Oe }); +var Ew; +(function(r16) { + r16.R0 = "R0", r16.R1 = "R1", r16.R2 = "R2", r16.R3 = "R3", r16.R4 = "R4", r16.R5 = "R5", r16.R6 = "R6"; +})(Ew || (Ew = {})); +var $w; +(function(r16) { + r16.float32 = "float32", r16.int32 = "int32", r16.bool = "int32", r16.complex64 = "complex64"; +})($w || ($w = {})); +var Rw; +(function(r16) { + r16.float32 = "float32", r16.int32 = "int32", r16.bool = "bool", r16.complex64 = "complex64"; +})(Rw || (Rw = {})); +var Dw; +(function(r16) { + r16.float32 = "float32", r16.int32 = "float32", r16.bool = "float32", r16.complex64 = "complex64"; +})(Dw || (Dw = {})); +var Aw; +(function(r16) { + r16.float32 = "complex64", r16.int32 = "complex64", r16.bool = "complex64", r16.complex64 = "complex64"; +})(Aw || (Aw = {})); +var AH = { float32: Dw, int32: $w, bool: Rw, complex64: Aw }; +function pt(r16, e) { + if (r16 === "string" || e === "string") { + if (r16 === "string" && e === "string") return "string"; - throw new Error(`Can not upcast ${r15} with ${t8}`); + throw new Error(`Can not upcast ${r16} with ${e}`); } - return u4[r15][t8]; + return AH[r16][e]; } -function oi(r15) { - return dt(r15, "int32"); +function mi(r16) { + return pt(r16, "int32"); } -function ed(r15) { - return r15 != null && typeof r15 == "object" && "texture" in r15 && r15.texture instanceof WebGLTexture; +function md(r16) { + return r16 != null && typeof r16 == "object" && "texture" in r16 && r16.texture instanceof WebGLTexture; } -function td(r15) { - return typeof GPUBuffer != "undefined" && r15 != null && typeof r15 == "object" && "buffer" in r15 && r15.buffer instanceof GPUBuffer; +function dd(r16) { + return typeof GPUBuffer != "undefined" && r16 != null && typeof r16 == "object" && "buffer" in r16 && r16.buffer instanceof GPUBuffer; } -function Oe(r15, t8) { - if (r15.dtype === t8.dtype) - return [r15, t8]; - let e = dt(r15.dtype, t8.dtype); - return [r15.cast(e), t8.cast(e)]; +function Oe(r16, e) { + if (r16.dtype === e.dtype) + return [r16, e]; + let t10 = pt(r16.dtype, e.dtype); + return [r16.cast(t10), e.cast(t10)]; } -function Cw(r15, t8) { - $(r15.dtype === t8.dtype, () => `The dtypes of the first(${r15.dtype}) and second(${t8.dtype}) input must match`); +function Fw(r16, e) { + $(r16.dtype === e.dtype, () => `The dtypes of the first(${r16.dtype}) and second(${e.dtype}) input must match`); } -function p4(r15, t8) { - return t8.some((e) => e.id === r15.id); +function FH(r16, e) { + return e.some((t10) => t10.id === r16.id); } -function yl(r15) { - let t8 = []; - return ek(r15, t8, /* @__PURE__ */ new Set()), t8; +function Tc(r16) { + let e = []; + return zk(r16, e, /* @__PURE__ */ new Set()), e; } -function ek(r15, t8, e) { - if (r15 == null) +function zk(r16, e, t10) { + if (r16 == null) return; - if (r15 instanceof mt) { - t8.push(r15); + if (r16 instanceof dt) { + e.push(r16); return; } - if (!c4(r15)) + if (!PH(r16)) return; - let o = r15; + let o = r16; for (let n in o) { let s = o[n]; - e.has(s) || (e.add(s), ek(s, t8, e)); + t10.has(s) || (t10.add(s), zk(s, e, t10)); } } -function c4(r15) { - return Array.isArray(r15) || typeof r15 == "object"; +function PH(r16) { + return Array.isArray(r16) || typeof r16 == "object"; } -function ww(r15) { - return r15.kernelName != null; +function Pw(r16) { + return r16.kernelName != null; } -var rd = class { +var fd = 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 = /* @__PURE__ */ new WeakMap(), this.profiling = false, this.activeProfile = { newBytes: 0, newTensors: 0, peakBytes: 0, kernels: [], result: null, get kernelNames() { - return Array.from(new Set(this.kernels.map((t8) => t8.name))); + return Array.from(new Set(this.kernels.map((e) => e.name))); } }; } dispose() { - for (let t8 in this.registeredVariables) - this.registeredVariables[t8].dispose(); + for (let e in this.registeredVariables) + this.registeredVariables[e].dispose(); } }; -var bl = class r { - constructor(t8) { - this.ENV = t8, this.registry = {}, this.registryFactory = {}, this.pendingBackendInitId = 0, this.state = new rd(); +var _c = class r { + constructor(e) { + this.ENV = e, this.registry = {}, this.registryFactory = {}, this.pendingBackendInitId = 0, this.state = new fd(); } async ready() { if (this.pendingBackendInit != null) @@ -4303,9 +4303,9 @@ var bl = class r { }); if (this.backendInstance != null) return; - let t8 = this.getSortedBackends(); - for (let e = 0; e < t8.length; e++) { - let o = t8[e]; + let e = this.getSortedBackends(); + for (let t10 = 0; t10 < e.length; t10++) { + let o = e[t10]; if (await this.initializeBackend(o).success) { await this.setBackend(o); return; @@ -4317,114 +4317,114 @@ var bl = class r { if (this.pendingBackendInit != null) throw new Error(`Backend '${this.backendName}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`); if (this.backendInstance == null) { - let { name: t8, asyncInit: e } = this.initializeBackendsAndReturnBest(); - if (e) - throw new Error(`The highest priority backend '${t8}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`); - this.setBackend(t8); + let { name: e, asyncInit: t10 } = this.initializeBackendsAndReturnBest(); + if (t10) + throw new Error(`The highest priority backend '${e}' has not yet been initialized. Make sure to await tf.ready() or await tf.setBackend() before calling other methods`); + this.setBackend(e); } return this.backendInstance; } backendNames() { return Object.keys(this.registryFactory); } - findBackend(t8) { - if (!(t8 in this.registry)) - if (t8 in this.registryFactory) { - let { asyncInit: e } = this.initializeBackend(t8); - if (e) + findBackend(e) { + if (!(e in this.registry)) + if (e in this.registryFactory) { + let { asyncInit: t10 } = this.initializeBackend(e); + if (t10) return null; } else return null; - return this.registry[t8]; + return this.registry[e]; } - findBackendFactory(t8) { - return t8 in this.registryFactory ? this.registryFactory[t8].factory : null; + findBackendFactory(e) { + return e in this.registryFactory ? this.registryFactory[e].factory : null; } - registerBackend(t8, e, o = 1) { - return t8 in this.registryFactory ? (Ia(`${t8} backend was already registered. Reusing existing backend factory.`), false) : (this.registryFactory[t8] = { factory: e, priority: o }, true); + registerBackend(e, t10, o = 1) { + return e in this.registryFactory ? (Ea(`${e} backend was already registered. Reusing existing backend factory.`), false) : (this.registryFactory[e] = { factory: t10, priority: o }, true); } - async setBackend(t8) { - if (this.registryFactory[t8] == null) - throw new Error(`Backend name '${t8}' not found in registry`); - if (this.backendName = t8, this.registry[t8] == null) { + async setBackend(e) { + if (this.registryFactory[e] == null) + throw new Error(`Backend name '${e}' not found in registry`); + if (this.backendName = e, this.registry[e] == null) { this.backendInstance = null; - let { success: e, asyncInit: o } = this.initializeBackend(t8); - if (!(o ? await e : e)) + let { success: t10, asyncInit: o } = this.initializeBackend(e); + if (!(o ? await t10 : t10)) return false; } - return this.backendInstance = this.registry[t8], this.setupRegisteredKernels(), this.profiler = new Zm(this.backendInstance), true; + return this.backendInstance = this.registry[e], this.setupRegisteredKernels(), this.profiler = new ld(this.backendInstance), true; } setupRegisteredKernels() { - jm(this.backendName).forEach((e) => { - e.setupFunc != null && e.setupFunc(this.backendInstance); + ad(this.backendName).forEach((t10) => { + t10.setupFunc != null && t10.setupFunc(this.backendInstance); }); } - disposeRegisteredKernels(t8) { - jm(t8).forEach((o) => { - o.disposeFunc != null && o.disposeFunc(this.registry[t8]); + disposeRegisteredKernels(e) { + ad(e).forEach((o) => { + o.disposeFunc != null && o.disposeFunc(this.registry[e]); }); } - initializeBackend(t8) { - let e = this.registryFactory[t8]; - if (e == null) - throw new Error(`Cannot initialize backend ${t8}, no registration found.`); + initializeBackend(e) { + let t10 = this.registryFactory[e]; + if (t10 == null) + throw new Error(`Cannot initialize backend ${e}, no registration found.`); try { - let o = e.factory(); - if (o && !(o instanceof so) && typeof o.then == "function") { - let n = ++this.pendingBackendInitId, s = o.then((a) => n < this.pendingBackendInitId ? false : (this.registry[t8] = a, this.pendingBackendInit = null, true)).catch((a) => (n < this.pendingBackendInitId || (this.pendingBackendInit = null, Ia(`Initialization of backend ${t8} failed`), Ia(a.stack || a.message)), false)); + let o = t10.factory(); + if (o && !(o instanceof mo) && typeof o.then == "function") { + let n = ++this.pendingBackendInitId, s = o.then((a) => n < this.pendingBackendInitId ? false : (this.registry[e] = a, this.pendingBackendInit = null, true)).catch((a) => (n < this.pendingBackendInitId || (this.pendingBackendInit = null, Ea(`Initialization of backend ${e} failed`), Ea(a.stack || a.message)), false)); return this.pendingBackendInit = s, { success: s, asyncInit: true }; } else - return this.registry[t8] = o, { success: true, asyncInit: false }; + return this.registry[e] = o, { success: true, asyncInit: false }; } catch (o) { - return Ia(`Initialization of backend ${t8} failed`), Ia(o.stack || o.message), { success: false, asyncInit: false }; + return Ea(`Initialization of backend ${e} failed`), Ea(o.stack || o.message), { success: false, asyncInit: false }; } } - removeBackend(t8) { - if (!(t8 in this.registryFactory)) - throw new Error(`${t8} backend not found in registry`); - this.backendName === t8 && this.pendingBackendInit != null && this.pendingBackendInitId++, t8 in this.registry && (this.disposeRegisteredKernels(t8), this.registry[t8].dispose(), delete this.registry[t8]), delete this.registryFactory[t8], this.backendName === t8 && (this.pendingBackendInit = null, this.backendName = null, this.backendInstance = null); + removeBackend(e) { + if (!(e in this.registryFactory)) + throw new Error(`${e} backend not found in registry`); + this.backendName === e && this.pendingBackendInit != null && this.pendingBackendInitId++, e in this.registry && (this.disposeRegisteredKernels(e), this.registry[e].dispose(), delete this.registry[e]), delete this.registryFactory[e], this.backendName === e && (this.pendingBackendInit = null, this.backendName = null, this.backendInstance = null); } getSortedBackends() { if (Object.keys(this.registryFactory).length === 0) throw new Error("No backend found in registry."); - return Object.keys(this.registryFactory).sort((t8, e) => this.registryFactory[e].priority - this.registryFactory[t8].priority); + return Object.keys(this.registryFactory).sort((e, t10) => this.registryFactory[t10].priority - this.registryFactory[e].priority); } initializeBackendsAndReturnBest() { - let t8 = this.getSortedBackends(); - for (let e = 0; e < t8.length; e++) { - let o = t8[e], { success: n, asyncInit: s } = this.initializeBackend(o); + let e = this.getSortedBackends(); + for (let t10 = 0; t10 < e.length; t10++) { + let o = e[t10], { success: n, asyncInit: s } = this.initializeBackend(o); if (s || n) return { name: o, asyncInit: s }; } throw new Error("Could not initialize any backends, all backend initializations failed."); } - moveData(t8, e) { - let o = this.state.tensorInfo.get(e), n = o.backend, s = this.readSync(e), a = n.refCount(e); - n.disposeData(e, true), o.backend = t8, t8.move(e, s, o.shape, o.dtype, a), this.shouldCheckForMemLeaks() && this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; + moveData(e, t10) { + let o = this.state.tensorInfo.get(t10), n = o.backend, s = this.readSync(t10), a = n.refCount(t10); + n.disposeData(t10, true), o.backend = e, e.move(t10, s, o.shape, o.dtype, a), this.shouldCheckForMemLeaks() && this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1]++; } - tidy(t8, e) { + tidy(e, t10) { let o = null; - if (e == null) { - if (typeof t8 != "function") + if (t10 == null) { + if (typeof e != "function") throw new Error("Please provide a function to tidy()"); - e = t8; + t10 = e; } else { - if (typeof t8 != "string" && !(t8 instanceof String)) + if (typeof e != "string" && !(e instanceof String)) throw new Error("When calling with two arguments, the first argument to tidy() must be a string"); - if (typeof e != "function") + if (typeof t10 != "function") throw new Error("When calling with two arguments, the 2nd argument to tidy() must be a function"); - o = t8; + o = e; } let n; - return this.scopedRun(() => this.startScope(o), () => this.endScope(n), () => (n = e(), n instanceof Promise && console.error("Cannot return a Promise inside of tidy."), n)); + return this.scopedRun(() => this.startScope(o), () => this.endScope(n), () => (n = t10(), n instanceof Promise && console.error("Cannot return a Promise inside of tidy."), n)); } - scopedRun(t8, e, o) { - t8(); + scopedRun(e, t10, o) { + e(); try { let n = o(); - return e(), n; + return t10(), n; } catch (n) { - throw e(), n; + throw t10(), n; } } nextTensorId() { @@ -4433,46 +4433,46 @@ var bl = class r { nextVariableId() { return r.nextVariableId++; } - clone(t8) { - let e = T.runKernel(Co, { x: t8 }), o = { x: t8 }, n = (a) => ({ x: () => { + clone(e) { + let t10 = _.runKernel(vo, { x: e }), o = { x: e }, n = (a) => ({ x: () => { let i = "float32", p = { x: a }, u = { dtype: i }; - return T.runKernel(yo, p, u); + return _.runKernel(ho, p, u); } }), s = []; - return this.addTapeNode(this.state.activeScope.name, o, [e], n, s, {}), e; + return this.addTapeNode(this.state.activeScope.name, o, [t10], n, s, {}), t10; } - runKernel(t8, e, o) { - if (this.backendName == null && this.backend, !(qp(t8, this.backendName) != null)) - throw new Error(`Kernel '${t8}' not registered for backend '${this.backendName}'`); - return this.runKernelFunc({ kernelName: t8, inputs: e, attrs: o }); + runKernel(e, t10, o) { + if (this.backendName == null && this.backend, !(tl(e, this.backendName) != null)) + throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`); + return this.runKernelFunc({ kernelName: e, inputs: t10, attrs: o }); } shouldCheckForMemLeaks() { return this.ENV.getBool("IS_TEST"); } - checkKernelForMemLeak(t8, e, o) { + checkKernelForMemLeak(e, t10, o) { let n = this.backend.numDataIds(), s = 0; o.forEach((p) => { s += p.dtype === "complex64" ? 3 : 1; }); - let a = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1], i = n - e - s - a; + let a = this.state.numDataMovesStack[this.state.numDataMovesStack.length - 1], i = n - t10 - s - a; if (i > 0) - throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${t8}'`); + throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`); } - runKernelFunc(t8) { - let e, o = [], n = this.isTapeOn(), s = this.state.numBytes, a = this.state.numTensors; + runKernelFunc(e) { + let t10, o = [], n = this.isTapeOn(), s = this.state.numBytes, a = this.state.numTensors; this.shouldCheckForMemLeaks() && this.state.numDataMovesStack.push(0); let i; this.backendName == null && this.backend; - let p, u = ww(t8) ? t8.kernelName : this.state.activeScope != null ? this.state.activeScope.name : ""; - if (ww(t8)) { - let { kernelName: f, inputs: h, attrs: g } = t8; + let p, u = Pw(e) ? e.kernelName : this.state.activeScope != null ? this.state.activeScope.name : ""; + if (Pw(e)) { + let { kernelName: f, inputs: h, attrs: g } = e; this.backendName == null && this.backend; - let x = qp(f, this.backendName); + let x = tl(f, this.backendName); $(x != null, () => `Cannot find registered kernel '${f}' for backend '${this.backendName}'`), i = () => { let b = this.backend.numDataIds(); p = x.kernelFunc({ inputs: h, attrs: g, backend: this.backend }); - let C = Array.isArray(p) ? p : [p]; - this.shouldCheckForMemLeaks() && this.checkKernelForMemLeak(f, b, C); - let S = C.map((k) => k.rank != null ? k : this.makeTensorFromTensorInfo(k)); + let w = Array.isArray(p) ? p : [p]; + this.shouldCheckForMemLeaks() && this.checkKernelForMemLeak(f, b, w); + let S = w.map((k) => k.rank != null ? k : this.makeTensorFromTensorInfo(k)); if (n) { let k = this.getTensorsForGradient(f, h, S); o = this.saveTensorsForBackwardMode(k); @@ -4480,7 +4480,7 @@ var bl = class r { return S; }; } else { - let { forwardFunc: f } = t8, h = (g) => { + let { forwardFunc: f } = e, h = (g) => { n && (o = g.map((x) => this.keep(this.clone(x)))); }; i = () => { @@ -4490,91 +4490,91 @@ var bl = class r { return this.shouldCheckForMemLeaks() && this.checkKernelForMemLeak(u, g, x), x; }; } - let { inputs: c, attrs: l } = t8, m = ww(t8) ? null : t8.backwardsFunc, d; + let { inputs: l, attrs: c } = e, m = Pw(e) ? null : e.backwardsFunc, d; return this.scopedRun(() => this.state.kernelDepth++, () => this.state.kernelDepth--, () => { - !this.ENV.getBool("DEBUG") && !this.state.profiling ? e = i() : (d = this.profiler.profileKernel(u, c, () => i()), this.ENV.getBool("DEBUG") && this.profiler.logKernelProfile(d), e = d.outputs); - }), n && this.addTapeNode(u, c, e, m, o, l), this.state.profiling && this.state.activeProfile.kernels.push({ name: u, bytesAdded: this.state.numBytes - s, totalBytesSnapshot: this.state.numBytes, tensorsAdded: this.state.numTensors - a, totalTensorsSnapshot: this.state.numTensors, inputShapes: Object.keys(c).map((f) => c[f] != null ? c[f].shape : null), outputShapes: e.map((f) => f.shape), kernelTimeMs: d.timeMs, extraInfo: d.extraInfo }), Array.isArray(p) ? e : e[0]; + !this.ENV.getBool("DEBUG") && !this.state.profiling ? t10 = i() : (d = this.profiler.profileKernel(u, l, () => i()), this.ENV.getBool("DEBUG") && this.profiler.logKernelProfile(d), t10 = d.outputs); + }), n && this.addTapeNode(u, l, t10, m, o, c), this.state.profiling && this.state.activeProfile.kernels.push({ name: u, bytesAdded: this.state.numBytes - s, totalBytesSnapshot: this.state.numBytes, tensorsAdded: this.state.numTensors - a, totalTensorsSnapshot: this.state.numTensors, inputShapes: Object.keys(l).map((f) => l[f] != null ? l[f].shape : null), outputShapes: t10.map((f) => f.shape), kernelTimeMs: d.timeMs, extraInfo: d.extraInfo }), Array.isArray(p) ? t10 : t10[0]; } - saveTensorsForBackwardMode(t8) { - return t8.map((o) => this.keep(this.clone(o))); + saveTensorsForBackwardMode(e) { + return e.map((o) => this.keep(this.clone(o))); } - getTensorsForGradient(t8, e, o) { - let n = aw(t8); + getTensorsForGradient(e, t10, o) { + let n = Cw(e); if (n != null) { let s = n.inputsToSave || [], a = n.outputsToSave || [], i; - n.saveAllInputs ? ($(Array.isArray(e), () => "saveAllInputs is true, expected inputs to be an array."), i = Object.keys(e).map((u) => e[u])) : i = s.map((u) => e[u]); - let p = o.filter((u, c) => a[c]); + n.saveAllInputs ? ($(Array.isArray(t10), () => "saveAllInputs is true, expected inputs to be an array."), i = Object.keys(t10).map((u) => t10[u])) : i = s.map((u) => t10[u]); + let p = o.filter((u, l) => a[l]); return i.concat(p); } return []; } - makeTensor(t8, e, o, n) { - if (t8 == null) + makeTensor(e, t10, o, n) { + if (e == null) throw new Error("Values passed to engine.makeTensor() are null"); o = o || "float32", n = n || this.backend; - let s = t8; - o === "string" && zo(t8[0]) && (s = t8.map((p) => Zi(p))); - let a = n.write(s, e, o), i = new mt(e, o, a, this.nextTensorId()); + let s = e; + o === "string" && dn(e[0]) && (s = e.map((p) => iu(p))); + let a = n.write(s, t10, o), i = new dt(t10, o, a, this.nextTensorId()); if (this.trackTensor(i, n), o === "string") { - let p = this.state.tensorInfo.get(a), u = rw(s); + let p = this.state.tensorInfo.get(a), u = gw(s); this.state.numBytes += u - p.bytes, p.bytes = u; } return i; } - makeTensorFromDataId(t8, e, o, n) { + makeTensorFromDataId(e, t10, o, n) { o = o || "float32"; - let s = { dataId: t8, shape: e, dtype: o }; + let s = { dataId: e, shape: t10, dtype: o }; return this.makeTensorFromTensorInfo(s, n); } - makeTensorFromTensorInfo(t8, e) { - let { dataId: o, shape: n, dtype: s } = t8, a = new mt(n, s, o, this.nextTensorId()); - return this.trackTensor(a, e), a; + makeTensorFromTensorInfo(e, t10) { + let { dataId: o, shape: n, dtype: s } = e, a = new dt(n, s, o, this.nextTensorId()); + return this.trackTensor(a, t10), a; } - makeVariable(t8, e = true, o, n) { - o = o || this.nextVariableId().toString(), n != null && n !== t8.dtype && (t8 = t8.cast(n)); - let s = new ri(t8, e, o, this.nextTensorId()); + makeVariable(e, t10 = true, o, n) { + o = o || this.nextVariableId().toString(), n != null && n !== e.dtype && (e = e.cast(n)); + let s = new ci(e, t10, o, this.nextTensorId()); if (this.state.registeredVariables[s.name] != null) throw new Error(`Variable with name ${s.name} was already registered`); return this.state.registeredVariables[s.name] = s, this.incRef(s, this.backend), s; } - trackTensor(t8, e) { - this.state.numTensors++, t8.dtype === "string" && this.state.numStringTensors++; + trackTensor(e, t10) { + this.state.numTensors++, e.dtype === "string" && this.state.numStringTensors++; let o = 0; - t8.dtype !== "complex64" && t8.dtype !== "string" && (o = t8.size * zp(t8.dtype)), this.state.numBytes += o, this.state.tensorInfo.has(t8.dataId) || (this.state.numDataBuffers++, this.state.tensorInfo.set(t8.dataId, { backend: e || this.backend, dtype: t8.dtype, shape: t8.shape, bytes: o })), t8 instanceof ri || this.track(t8); + e.dtype !== "complex64" && e.dtype !== "string" && (o = e.size * jp(e.dtype)), this.state.numBytes += o, this.state.tensorInfo.has(e.dataId) || (this.state.numDataBuffers++, this.state.tensorInfo.set(e.dataId, { backend: t10 || this.backend, dtype: e.dtype, shape: e.shape, bytes: o })), e instanceof ci || this.track(e); } - incRef(t8, e) { - this.trackTensor(t8, e), this.backend.incRef(t8.dataId); + incRef(e, t10) { + this.trackTensor(e, t10), this.backend.incRef(e.dataId); } - removeDataId(t8, e) { - this.state.tensorInfo.has(t8) && this.state.tensorInfo.get(t8).backend === e && (this.state.tensorInfo.delete(t8), this.state.numDataBuffers--); + removeDataId(e, t10) { + this.state.tensorInfo.has(e) && this.state.tensorInfo.get(e).backend === t10 && (this.state.tensorInfo.delete(e), this.state.numDataBuffers--); } - disposeTensor(t8) { - if (!this.state.tensorInfo.has(t8.dataId)) + disposeTensor(e) { + if (!this.state.tensorInfo.has(e.dataId)) return; - let e = this.state.tensorInfo.get(t8.dataId); - if (this.state.numTensors--, t8.dtype === "string" && (this.state.numStringTensors--, this.state.numBytes -= e.bytes), t8.dtype !== "complex64" && t8.dtype !== "string") { - let o = t8.size * zp(t8.dtype); + let t10 = this.state.tensorInfo.get(e.dataId); + if (this.state.numTensors--, e.dtype === "string" && (this.state.numStringTensors--, this.state.numBytes -= t10.bytes), e.dtype !== "complex64" && e.dtype !== "string") { + let o = e.size * jp(e.dtype); this.state.numBytes -= o; } - e.backend.disposeData(t8.dataId) && this.removeDataId(t8.dataId, e.backend); + t10.backend.disposeData(e.dataId) && this.removeDataId(e.dataId, t10.backend); } disposeVariables() { - for (let t8 in this.state.registeredVariables) { - let e = this.state.registeredVariables[t8]; - this.disposeVariable(e); + for (let e in this.state.registeredVariables) { + let t10 = this.state.registeredVariables[e]; + this.disposeVariable(t10); } } - disposeVariable(t8) { - this.disposeTensor(t8), this.state.registeredVariables[t8.name] != null && delete this.state.registeredVariables[t8.name]; + disposeVariable(e) { + this.disposeTensor(e), this.state.registeredVariables[e.name] != null && delete this.state.registeredVariables[e.name]; } memory() { - let t8 = this.backend.memory(); - return t8.numTensors = this.state.numTensors, t8.numDataBuffers = this.state.numDataBuffers, t8.numBytes = this.state.numBytes, this.state.numStringTensors > 0 && (t8.unreliable = true, t8.reasons == null && (t8.reasons = []), t8.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")), t8; + 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 = true, e.reasons == null && (e.reasons = []), e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")), e; } - async profile(t8) { + async profile(e) { this.state.profiling = true; - let e = this.state.numBytes, o = this.state.numTensors; - this.state.activeProfile.kernels = [], this.state.activeProfile.result = await t8(), this.state.profiling = false, this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map((n) => n.totalBytesSnapshot)), this.state.activeProfile.newBytes = this.state.numBytes - e, this.state.activeProfile.newTensors = this.state.numTensors - o; + let t10 = this.state.numBytes, o = this.state.numTensors; + this.state.activeProfile.kernels = [], this.state.activeProfile.result = await e(), this.state.profiling = false, this.state.activeProfile.peakBytes = Math.max(...this.state.activeProfile.kernels.map((n) => n.totalBytesSnapshot)), this.state.activeProfile.newBytes = this.state.numBytes - t10, this.state.activeProfile.newTensors = this.state.numTensors - o; for (let n of this.state.activeProfile.kernels) n.kernelTimeMs = await n.kernelTimeMs, n.extraInfo = await n.extraInfo; return this.state.activeProfile; @@ -4582,18 +4582,18 @@ var bl = class r { isTapeOn() { return this.state.gradientDepth > 0 && this.state.kernelDepth === 0; } - addTapeNode(t8, e, o, n, s, a) { - let i = { id: this.state.nextTapeNodeId++, kernelName: t8, inputs: e, outputs: o, saved: s }, p = aw(t8); - p != null && (n = p.gradFunc), n != null && (i.gradient = (u) => (u = u.map((c, l) => { - if (c == null) { - let m = o[l], d = Wp(m.size, m.dtype); + addTapeNode(e, t10, o, n, s, a) { + let i = { id: this.state.nextTapeNodeId++, kernelName: e, inputs: t10, outputs: o, saved: s }, p = Cw(e); + p != null && (n = p.gradFunc), n != null && (i.gradient = (u) => (u = u.map((l, c) => { + if (l == null) { + let m = o[c], d = Yp(m.size, m.dtype); return this.makeTensor(d, m.shape, m.dtype); } - return c; + return l; }), n(u.length > 1 ? u : u[0], s, a))), this.state.activeTape.push(i); } - keep(t8) { - return t8.kept = true, t8; + keep(e) { + return e.kept = true, e; } startTape() { this.state.gradientDepth === 0 && (this.state.activeTape = []), this.state.gradientDepth++; @@ -4601,857 +4601,981 @@ var bl = class r { endTape() { this.state.gradientDepth--; } - startScope(t8) { - let e = { track: [], name: "unnamed scope", id: this.state.nextScopeId++ }; - t8 && (e.name = t8), this.state.scopeStack.push(e), this.state.activeScope = e; + startScope(e) { + let t10 = { track: [], name: "unnamed scope", id: this.state.nextScopeId++ }; + e && (t10.name = e), this.state.scopeStack.push(t10), this.state.activeScope = t10; } - endScope(t8) { - let e = yl(t8), o = new Set(e.map((s) => s.id)); + endScope(e) { + let t10 = Tc(e), o = new Set(t10.map((s) => s.id)); for (let s = 0; s < this.state.activeScope.track.length; s++) { let a = this.state.activeScope.track[s]; !a.kept && !o.has(a.id) && a.dispose(); } let n = this.state.scopeStack.pop(); - this.state.activeScope = this.state.scopeStack.length === 0 ? null : this.state.scopeStack[this.state.scopeStack.length - 1], e.forEach((s) => { + this.state.activeScope = this.state.scopeStack.length === 0 ? null : this.state.scopeStack[this.state.scopeStack.length - 1], t10.forEach((s) => { !s.kept && s.scopeId === n.id && this.track(s); }); } - gradients(t8, e, o, n = false) { - if ($(e.length > 0, () => "gradients() received an empty list of xs."), o != null && o.dtype !== "float32") + gradients(e, t10, o, n = false) { + if ($(t10.length > 0, () => "gradients() received an empty list of xs."), o != null && o.dtype !== "float32") throw new Error(`dy must have 'float32' dtype, but has '${o.dtype}'`); - let s = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy("forward", t8)); - $(s instanceof mt, () => "The result y returned by f() must be a tensor."); - let a = K0(this.state.activeTape, e, s); - if (!n && a.length === 0 && e.length > 0) + let s = this.scopedRun(() => this.startTape(), () => this.endTape(), () => this.tidy("forward", e)); + $(s instanceof dt, () => "The result y returned by f() must be a tensor."); + let a = Dk(this.state.activeTape, t10, s); + if (!n && a.length === 0 && t10.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[s.id] = o == null ? l4(s.shape) : o, q0(i, a, (u) => this.tidy(u), m4); - let p = e.map((u) => i[u.id]); + i[s.id] = o == null ? OH(s.shape) : o, Ak(i, a, (u) => this.tidy(u), MH); + let p = t10.map((u) => i[u.id]); return this.state.gradientDepth === 0 && (this.state.activeTape.forEach((u) => { - for (let c of u.saved) - c.dispose(); + for (let l of u.saved) + l.dispose(); }), this.state.activeTape = null), { value: s, grads: p }; }); } - customGrad(t8) { - return $(qs(t8), () => "The f passed in customGrad(f) must be a function."), (...e) => { - $(e.every((i) => i instanceof mt), () => "The args passed in customGrad(f)(x1, x2,...) must all be tensors"); + customGrad(e) { + return $(ra(e), () => "The f passed in customGrad(f) must be a function."), (...t10) => { + $(t10.every((i) => i instanceof dt), () => "The args passed in customGrad(f)(x1, x2,...) must all be tensors"); let o, n = {}; - e.forEach((i, p) => { + t10.forEach((i, p) => { n[p] = i; }); - let s = (i, p) => (o = t8(...e, p), $(o.value instanceof mt, () => "The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"), $(qs(o.gradFunc), () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."), o.value), a = (i, p) => { - let u = o.gradFunc(i, p), c = Array.isArray(u) ? u : [u]; - $(c.length === e.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(...)."), $(c.every((m) => m instanceof mt), () => "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 l = {}; - return c.forEach((m, d) => { - l[d] = () => m; - }), l; + let s = (i, p) => (o = e(...t10, p), $(o.value instanceof dt, () => "The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"), $(ra(o.gradFunc), () => "The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."), o.value), a = (i, p) => { + let u = o.gradFunc(i, p), l = Array.isArray(u) ? u : [u]; + $(l.length === t10.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(...)."), $(l.every((m) => m instanceof dt), () => "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 c = {}; + return l.forEach((m, d) => { + c[d] = () => m; + }), c; }; return this.runKernelFunc({ forwardFunc: s, backwardsFunc: a, inputs: n }); }; } - readSync(t8) { - return this.state.tensorInfo.get(t8).backend.readSync(t8); + readSync(e) { + return this.state.tensorInfo.get(e).backend.readSync(e); } - read(t8) { - return this.state.tensorInfo.get(t8).backend.read(t8); + read(e) { + return this.state.tensorInfo.get(e).backend.read(e); } - readToGPU(t8, e) { - return this.state.tensorInfo.get(t8).backend.readToGPU(t8, e); + readToGPU(e, t10) { + return this.state.tensorInfo.get(e).backend.readToGPU(e, t10); } - async time(t8) { - let e = Pu(), o = await this.backend.time(t8); - return o.wallMs = Pu() - e, o; + async time(e) { + let t10 = Uu(), o = await this.backend.time(e); + return o.wallMs = Uu() - t10, o; } - track(t8) { - return this.state.activeScope != null && (t8.scopeId = this.state.activeScope.id, this.state.activeScope.track.push(t8)), t8; + 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 rd(); - for (let t8 in this.registry) - this.disposeRegisteredKernels(t8), this.registry[t8].dispose(), delete this.registry[t8]; + this.pendingBackendInitId++, this.state.dispose(), this.ENV.reset(), this.state = new fd(); + 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; } }; -bl.nextTensorId = 0; -bl.nextVariableId = 0; -function l4(r15) { - let t8 = cl(He(r15), "float32"); - return T.makeTensor(t8, r15, "float32"); +_c.nextTensorId = 0; +_c.nextVariableId = 0; +function OH(r16) { + let e = bc(ze(r16), "float32"); + return _.makeTensor(e, r16, "float32"); } -function Sw() { - let r15 = sw(); - if (r15._tfengine == null) { - let t8 = new ll(r15); - r15._tfengine = new bl(t8); +function Ow() { + let r16 = bw(); + if (r16._tfengine == null) { + let e = new Cc(r16); + r16._tfengine = new _c(e); } - return $0(r15._tfengine.ENV), Q0(() => r15._tfengine), r15._tfengine; + return hk(r16._tfengine.ENV), Mk(() => r16._tfengine), r16._tfengine; } -var T = Sw(); -function m4(r15, t8) { - let e = { a: r15, b: t8 }; - return T.runKernel(io, e); +var _ = Ow(); +function MH(r16, e) { + let t10 = { a: r16, b: e }; + return _.runKernel(Rr, t10); } -var Ji = {}; -qe(Ji, { isBrowser: () => vw, isMobile: () => h4, mockIsMobile: () => f4 }); -function d4() { +var uu = {}; +qe(uu, { isBrowser: () => Lw, isMobile: () => zH, mockIsMobile: () => BH }); +function LH() { return typeof navigator != "undefined" && navigator != null; } -var Iw; -function f4(r15) { - Iw = r15; +var Mw; +function BH(r16) { + Mw = r16; } -function h4(r15) { - if (Iw !== void 0) - return Iw; - if (r15 || d4()) { - if (r15 || (r15 = navigator), r15.product === "ReactNative") +function zH(r16) { + if (Mw !== void 0) + return Mw; + if (r16 || LH()) { + if (r16 || (r16 = navigator), r16.product === "ReactNative") return true; - let t8 = r15.userAgent || r15.vendor || (typeof window != "undefined" ? window.opera : ""); - if (!t8) { - let e = r15; - return e.userAgentData && e.userAgentData.mobile; + let e = r16.userAgent || r16.vendor || (typeof window != "undefined" ? window.opera : ""); + if (!e) { + let t10 = r16; + return t10.userAgentData && t10.userAgentData.mobile; } - 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(t8) || /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(t8.substr(0, 4)); + 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(e) || /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(e.substr(0, 4)); } return false; } -function vw() { +function Lw() { return typeof window != "undefined" && window.document != null || typeof WorkerGlobalScope != "undefined"; } -var _r = A(); -_r.registerFlag("DEBUG", () => false, (r15) => { - r15 && 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."); +var Dr = A(); +Dr.registerFlag("DEBUG", () => false, (r16) => { + r16 && 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."); }); -_r.registerFlag("IS_BROWSER", () => vw()); -_r.registerFlag("IS_NODE", () => typeof process != "undefined" && typeof process.versions != "undefined" && typeof process.versions.node != "undefined"); -_r.registerFlag("IS_CHROME", () => typeof navigator != "undefined" && navigator != null && navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)); -_r.registerFlag("IS_SAFARI", () => typeof navigator != "undefined" && navigator != null && navigator.userAgent != null && /Safari/.test(navigator.userAgent) && /Apple/.test(navigator.vendor)); -_r.registerFlag("PROD", () => false); -_r.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY", () => _r.getBool("DEBUG")); -_r.registerFlag("DEPRECATION_WARNINGS_ENABLED", () => true); -_r.registerFlag("IS_TEST", () => false); -_r.registerFlag("CHECK_COMPUTATION_FOR_ERRORS", () => _r.getBool("DEBUG")); -_r.registerFlag("WRAP_TO_IMAGEBITMAP", () => false); -_r.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU", () => false); -_r.registerFlag("USE_SETTIMEOUTCUSTOM", () => false); -function sr(r15, t8) { - let e = r15; - if (Pt(r15)) - return t8 === "string" ? [] : [r15.length]; - if (ed(r15)) { - let n = r15.channels || "RGBA"; - return [r15.height, r15.width * n.length]; - } else if (td(r15)) - return [r15.buffer.size / (t8 == null ? 4 : zp(t8))]; - if (!Array.isArray(r15)) +Dr.registerFlag("IS_BROWSER", () => Lw()); +Dr.registerFlag("IS_NODE", () => typeof process != "undefined" && typeof process.versions != "undefined" && typeof process.versions.node != "undefined"); +Dr.registerFlag("IS_CHROME", () => typeof navigator != "undefined" && navigator != null && navigator.userAgent != null && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)); +Dr.registerFlag("IS_SAFARI", () => typeof navigator != "undefined" && navigator != null && navigator.userAgent != null && /Safari/.test(navigator.userAgent) && /Apple/.test(navigator.vendor)); +Dr.registerFlag("PROD", () => false); +Dr.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY", () => Dr.getBool("DEBUG")); +Dr.registerFlag("DEPRECATION_WARNINGS_ENABLED", () => true); +Dr.registerFlag("IS_TEST", () => false); +Dr.registerFlag("CHECK_COMPUTATION_FOR_ERRORS", () => Dr.getBool("DEBUG")); +Dr.registerFlag("WRAP_TO_IMAGEBITMAP", () => false); +Dr.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU", () => false); +Dr.registerFlag("USE_SETTIMEOUTCUSTOM", () => false); +function ur(r16, e) { + let t10 = r16; + if (Mt(r16)) + return e === "string" ? [] : [r16.length]; + if (md(r16)) { + let n = r16.channels || "RGBA"; + return [r16.height, r16.width * n.length]; + } else if (dd(r16)) + return [r16.buffer.size / (e == null ? 4 : jp(e))]; + if (!Array.isArray(r16)) return []; let o = []; - for (; Array.isArray(e) || Pt(e) && t8 !== "string"; ) - o.push(e.length), e = e[0]; - return Array.isArray(r15) && A().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY") && ok(r15, o, []), o; + for (; Array.isArray(t10) || Mt(t10) && e !== "string"; ) + o.push(t10.length), t10 = t10[0]; + return Array.isArray(r16) && A().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY") && Uk(r16, o, []), o; } -function ok(r15, t8, e) { - if (e = e || [], !Array.isArray(r15) && !Pt(r15)) { - $(t8.length === 0, () => `Element arr[${e.join("][")}] is a primitive, but should be an array/TypedArray of ${t8[0]} elements`); +function Uk(r16, e, t10) { + if (t10 = t10 || [], !Array.isArray(r16) && !Mt(r16)) { + $(e.length === 0, () => `Element arr[${t10.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`); return; } - $(t8.length > 0, () => `Element arr[${e.join("][")}] should be a primitive, but is an array of ${r15.length} elements`), $(r15.length === t8[0], () => `Element arr[${e.join("][")}] should have ${t8[0]} elements, but has ${r15.length} elements`); - let o = t8.slice(1); - for (let n = 0; n < r15.length; ++n) - ok(r15[n], o, e.concat(n)); + $(e.length > 0, () => `Element arr[${t10.join("][")}] should be a primitive, but is an array of ${r16.length} elements`), $(r16.length === e[0], () => `Element arr[${t10.join("][")}] should have ${e[0]} elements, but has ${r16.length} elements`); + let o = e.slice(1); + for (let n = 0; n < r16.length; ++n) + Uk(r16[n], o, t10.concat(n)); } -function rk(r15, t8, e, o) { - if (r15 !== "string_or_numeric") { - if (r15 == null) +function Wk(r16, e, t10, o) { + if (r16 !== "string_or_numeric") { + if (r16 == null) throw new Error("Expected dtype cannot be null."); - if (r15 !== "numeric" && r15 !== t8 || r15 === "numeric" && t8 === "string") - throw new Error(`Argument '${e}' passed to '${o}' must be ${r15} tensor, but got ${t8} tensor`); - } -} -function v(r15, t8, e, o = "numeric") { - if (r15 instanceof fw()) - return rk(o, r15.dtype, t8, e), r15; - let n = _i(r15); - if (n !== "string" && ["bool", "int32", "float32"].indexOf(o) >= 0 && (n = o), rk(o, n, t8, e), r15 == null || !Pt(r15) && !Array.isArray(r15) && typeof r15 != "number" && typeof r15 != "boolean" && typeof r15 != "string") { - let p = r15 == null ? "null" : r15.constructor.name; - throw new Error(`Argument '${t8}' passed to '${e}' must be a Tensor or TensorLike, but got '${p}'`); - } - let s = sr(r15, n); - !Pt(r15) && !Array.isArray(r15) && (r15 = [r15]); - let i = n !== "string" ? Yp(r15, n) : Fs(r15, [], true); - return T.makeTensor(i, s, n); -} -function ni(r15, t8, e, o = "numeric") { - if (!Array.isArray(r15)) - throw new Error(`Argument ${t8} passed to ${e} must be a \`Tensor[]\` or \`TensorLike[]\``); - return r15.map((s, a) => v(s, `${t8}[${a}]`, e, o)); -} -var kw = "__op"; -function N(r15) { - let t8 = Object.keys(r15); - if (t8.length !== 1) - throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t8.length} keys.`); - let e = t8[0], o = r15[e]; - e.endsWith("_") && (e = e.substring(0, e.length - 1)), e = e + kw; + if (r16 !== "numeric" && r16 !== e || r16 === "numeric" && e === "string") + throw new Error(`Argument '${t10}' passed to '${o}' must be ${r16} tensor, but got ${e} tensor`); + } +} +function v(r16, e, t10, o = "numeric") { + if (r16 instanceof _w()) + return Wk(o, r16.dtype, e, t10), r16; + let n = Bi(r16); + if (n !== "string" && ["bool", "int32", "float32"].indexOf(o) >= 0 && (n = o), Wk(o, n, e, t10), r16 == null || !Mt(r16) && !Array.isArray(r16) && typeof r16 != "number" && typeof r16 != "boolean" && typeof r16 != "string") { + let p = r16 == null ? "null" : r16.constructor.name; + throw new Error(`Argument '${e}' passed to '${t10}' must be a Tensor or TensorLike, but got '${p}'`); + } + let s = ur(r16, n); + !Mt(r16) && !Array.isArray(r16) && (r16 = [r16]); + let i = n !== "string" ? nl(r16, n) : Us(r16, [], true); + return _.makeTensor(i, s, n); +} +function di(r16, e, t10, o = "numeric") { + if (!Array.isArray(r16)) + throw new Error(`Argument ${e} passed to ${t10} must be a \`Tensor[]\` or \`TensorLike[]\``); + return r16.map((s, a) => v(s, `${e}[${a}]`, t10, o)); +} +var Bw = "__op"; +function N(r16) { + let e = Object.keys(r16); + if (e.length !== 1) + throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`); + let t10 = e[0], o = r16[t10]; + t10.endsWith("_") && (t10 = t10.substring(0, t10.length - 1)), t10 = t10 + Bw; let n = (...s) => { - T.startScope(e); + _.startScope(t10); try { let a = o(...s); - return Tu(a) && console.error("Cannot return a Promise inside of tidy."), T.endScope(a), a; + return Ou(a) && console.error("Cannot return a Promise inside of tidy."), _.endScope(a), a; } catch (a) { - throw T.endScope(null), a; + throw _.endScope(null), a; } }; - return Object.defineProperty(n, "name", { value: e, configurable: true }), n; + return Object.defineProperty(n, "name", { value: t10, configurable: true }), n; } -function g4(r15, t8) { - let e = v(r15, "real", "complex"), o = v(t8, "imag", "complex"); - xt(e.shape, o.shape, `real and imag shapes, ${e.shape} and ${o.shape}, must match in call to tf.complex().`); - let n = { real: e, imag: o }; - return T.runKernel(Ri, n); +function VH(r16, e) { + let t10 = v(r16, "real", "complex"), o = v(e, "imag", "complex"); + yt(t10.shape, o.shape, `real and imag shapes, ${t10.shape} and ${o.shape}, must match in call to tf.complex().`); + let n = { real: t10, imag: o }; + return _.runKernel(ei, n); } -var $r = N({ complex_: g4 }); -function wr(r15, t8, e, o) { +var Ar = N({ complex_: VH }); +function vr(r16, e, t10, o) { if (o == null) - o = _i(r15); + o = Bi(r16); else if (o === "complex64") throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag)."); - if (td(r15) || ed(r15)) { + if (dd(r16) || md(r16)) { if (o !== "float32" && o !== "int32") throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${o}.`); - return T.backend.createTensorFromGPUData(r15, t8 || e, o); + return _.backend.createTensorFromGPUData(r16, e || t10, o); } - if (!Pt(r15) && !Array.isArray(r15) && typeof r15 != "number" && typeof r15 != "boolean" && typeof r15 != "string") + if (!Mt(r16) && !Array.isArray(r16) && typeof r16 != "number" && typeof r16 != "boolean" && typeof r16 != "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 (t8 != null) { - Ct(t8); - let n = He(t8), s = He(e); - $(n === s, () => `Based on the provided shape, [${t8}], the tensor should have ${n} values but has ${s}`); - for (let a = 0; a < e.length; ++a) { - let i = e[a], p = a === e.length - 1 ? i !== He(t8.slice(a)) : true; - $(e[a] === t8[a] || !p, () => `Error creating a new Tensor. Inferred shape (${e}) does not match the provided shape (${t8}). `); + if (e != null) { + St(e); + let n = ze(e), s = ze(t10); + $(n === s, () => `Based on the provided shape, [${e}], the tensor should have ${n} values but has ${s}`); + for (let a = 0; a < t10.length; ++a) { + let i = t10[a], p = a === t10.length - 1 ? i !== ze(e.slice(a)) : true; + $(t10[a] === e[a] || !p, () => `Error creating a new Tensor. Inferred shape (${t10}) does not match the provided shape (${e}). `); } } - return !Pt(r15) && !Array.isArray(r15) && (r15 = [r15]), t8 = t8 || e, r15 = o !== "string" ? Yp(r15, o) : Fs(r15, [], true), T.makeTensor(r15, t8, o); + return !Mt(r16) && !Array.isArray(r16) && (r16 = [r16]), e = e || t10, r16 = o !== "string" ? nl(r16, o) : Us(r16, [], true), _.makeTensor(r16, e, o); } -function ar(r15, t8, e) { - let o = sr(r15, e); - return wr(r15, t8, o, e); +function pr(r16, e, t10) { + let o = ur(r16, t10); + return vr(r16, e, o, t10); } -var Cl = { float32: 4, float16: 2, int32: 4, uint16: 2, uint8: 1, bool: 1, complex64: 8 }; -var ir = class r2 { - static join(t8) { - return new r2(t8).slice(); +var fi = { float32: 4, float16: 2, int32: 4, uint16: 2, uint8: 1, bool: 1, complex64: 8 }; +var lr = class r2 { + static join(e) { + return new r2(e).slice(); } - constructor(t8) { - if (this.shards = [], this.previousShardIndex = 0, t8 == null || (t8 instanceof Array || (t8 = [t8]), t8 = t8.map((o) => Pt(o) ? o.buffer : o), t8.length === 0)) + constructor(e) { + if (this.shards = [], this.previousShardIndex = 0, e == null || (e instanceof Array || (e = [e]), e = e.map((o) => Mt(o) ? o.buffer : o), e.length === 0)) return; - this.bufferUniformSize = t8[0].byteLength; - let e = 0; - for (let o = 0; o < t8.length; o++) { - let n = t8[o]; - o !== t8.length - 1 && n.byteLength !== this.bufferUniformSize && (this.bufferUniformSize = void 0); - let s = e + n.byteLength; - this.shards.push({ buffer: n, start: e, end: s }), e = s; + this.bufferUniformSize = e[0].byteLength; + let t10 = 0; + for (let o = 0; o < e.length; o++) { + let n = e[o]; + o !== e.length - 1 && n.byteLength !== this.bufferUniformSize && (this.bufferUniformSize = void 0); + let s = t10 + n.byteLength; + this.shards.push({ buffer: n, start: t10, end: s }), t10 = s; } this.shards.length === 0 && (this.byteLength = 0), this.byteLength = this.shards[this.shards.length - 1].end; } - slice(t8 = 0, e = this.byteLength) { + slice(e = 0, t10 = this.byteLength) { if (this.shards.length === 0) return new ArrayBuffer(0); - if (t8 = isNaN(Number(t8)) ? 0 : t8, e = isNaN(Number(e)) ? 0 : e, t8 = Math.max(0, t8), e = Math.min(this.byteLength, e), e <= t8) + if (e = isNaN(Number(e)) ? 0 : e, t10 = isNaN(Number(t10)) ? 0 : t10, e = Math.max(0, e), t10 = Math.min(this.byteLength, t10), t10 <= e) return new ArrayBuffer(0); - let o = this.findShardForByte(t8); + let o = this.findShardForByte(e); if (o === -1) - throw new Error(`Could not find start shard for byte ${t8}`); - let n = e - t8, s = new ArrayBuffer(n), a = new Uint8Array(s), i = 0; + throw new Error(`Could not find start shard for byte ${e}`); + let n = t10 - e, s = new ArrayBuffer(n), a = new Uint8Array(s), i = 0; for (let p = o; p < this.shards.length; p++) { - let u = this.shards[p], l = t8 + i - u.start, m = i, f = Math.min(e, u.end) - u.start, h = new Uint8Array(u.buffer, l, f - l); - if (a.set(h, m), i += h.length, e < u.end) + let u = this.shards[p], c = e + i - u.start, m = i, f = Math.min(t10, u.end) - u.start, h = new Uint8Array(u.buffer, c, f - c); + if (a.set(h, m), i += h.length, t10 < u.end) break; } return s; } - findShardForByte(t8) { - if (this.shards.length === 0 || t8 < 0 || t8 >= this.byteLength) + findShardForByte(e) { + if (this.shards.length === 0 || e < 0 || e >= this.byteLength) return -1; if (this.bufferUniformSize != null) - return this.previousShardIndex = Math.floor(t8 / this.bufferUniformSize), this.previousShardIndex; - function e(n) { - return t8 < n.start ? -1 : t8 >= n.end ? 1 : 0; + return this.previousShardIndex = Math.floor(e / this.bufferUniformSize), this.previousShardIndex; + function t10(n) { + return e < n.start ? -1 : e >= n.end ? 1 : 0; } - if (e(this.shards[this.previousShardIndex]) === 0) + if (t10(this.shards[this.previousShardIndex]) === 0) return this.previousShardIndex; - let o = x4(this.shards, e); + let o = WH(this.shards, t10); return o === -1 ? -1 : (this.previousShardIndex = o, this.previousShardIndex); } }; -function x4(r15, t8) { - let e = 0, o = r15.length; - for (; e <= o; ) { - let n = Math.floor((o - e) / 2) + e, s = t8(r15[n]); +function WH(r16, e) { + let t10 = 0, o = r16.length; + for (; t10 <= o; ) { + let n = Math.floor((o - t10) / 2) + t10, s = e(r16[n]); if (s === 0) return n; - s < 0 ? o = n : e = n + 1; + s < 0 ? o = n : t10 = n + 1; } return -1; } -var od = 4; -async function sk(r15, t8) { - let e = [], o = [], n = Array.isArray(r15) ? r15.map((a) => a.name) : Object.keys(r15); +function Gde() { + A().set("PROD", true); +} +function Hde() { + A().set("DEBUG", true); +} +function Kde() { + A().set("DEPRECATION_WARNINGS_ENABLED", false), console.warn("TensorFlow.js deprecation warnings have been disabled."); +} +function zw(r16) { + A().getBool("DEPRECATION_WARNINGS_ENABLED") && console.warn(r16 + " You can disable deprecation warnings with tf.disableDeprecationWarnings()."); +} +Bk(zw); +function qde() { + _.disposeVariables(); +} +function cr() { + return _; +} +function jde() { + return _.memory(); +} +function Xde(r16) { + return _.profile(r16); +} +function De(r16, e) { + return _.tidy(r16, e); +} +function Lt(r16) { + Tc(r16).forEach((t10) => t10.dispose()); +} +function Fr(r16) { + return _.keep(r16); +} +function Yde(r16) { + return _.time(r16); +} +function Qde(r16) { + return _.setBackend(r16); +} +function Zde() { + return _.ready(); +} +function Gk() { + return _.backendName; +} +function Jde(r16) { + _.removeBackend(r16); +} +function efe(r16) { + return _.findBackend(r16); +} +function tfe(r16) { + return _.findBackendFactory(r16); +} +function pu(r16, e, t10 = 1) { + return _.registerBackend(r16, e, t10); +} +function Hk() { + return _.backend; +} +function rfe(r16, e) { + A().setPlatform(r16, e); +} +var lu = 4; +async function jk(r16, e) { + let t10 = [], o = [], n = Array.isArray(r16) ? r16.map((a) => a.name) : Object.keys(r16); for (let a = 0; a < n.length; ++a) { - let i = n[a], p = Array.isArray(r15) ? r15[a].tensor : r15[i]; + let i = n[a], p = Array.isArray(r16) ? r16[a].tensor : r16[i]; if (p.dtype !== "float32" && p.dtype !== "int32" && p.dtype !== "bool" && p.dtype !== "string" && p.dtype !== "complex64") throw new Error(`Unsupported dtype in weight '${i}': ${p.dtype}`); let u = { name: i, shape: p.shape, dtype: p.dtype }; if (p.dtype === "string") { - let c = new Promise(async (l) => { - let m = await p.bytes(), d = m.reduce((g, x) => g + x.length, 0) + od * m.length, f = new Uint8Array(d), h = 0; + let l = new Promise(async (c) => { + let m = await p.bytes(), d = m.reduce((g, x) => g + x.length, 0) + lu * m.length, f = new Uint8Array(d), h = 0; for (let g = 0; g < m.length; g++) { let x = m[g], b = new Uint8Array(new Uint32Array([x.length]).buffer); - f.set(b, h), h += od, f.set(x, h), h += x.length; + f.set(b, h), h += lu, f.set(x, h), h += x.length; } - l(f); + c(f); }); - o.push(c); + o.push(l); } else o.push(p.data()); - t8 != null && (u.group = t8), e.push(u); + e != null && (u.group = e), t10.push(u); } let s = await Promise.all(o); - return { data: y4(s), specs: e }; -} -function nd(r15, t8) { - let e = new ir(r15), o = {}, n, s = 0; - for (let a of t8) { - let i = a.name, p = a.dtype, u = a.shape, c = He(u), l; - if ("quantization" in a) { - let m = a.quantization; - if (m.dtype === "uint8" || m.dtype === "uint16") { - if (!("min" in m && "scale" in m)) - throw new Error(`Weight ${a.name} with quantization ${m.dtype} doesn't have corresponding metadata min and scale.`); - } else if (m.dtype === "float16") { - if (p !== "float32") - throw new Error(`Weight ${a.name} is quantized with ${m.dtype} which only supports weights of type float32 not ${p}.`); - } else - throw new Error(`Weight ${a.name} has unknown quantization dtype ${m.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`); - let d = Cl[m.dtype], f = e.slice(s, s + c * d), h = m.dtype === "uint8" ? new Uint8Array(f) : new Uint16Array(f); - if (p === "float32") - if (m.dtype === "uint8" || m.dtype === "uint16") { - l = new Float32Array(h.length); - for (let g = 0; g < h.length; g++) { - let x = h[g]; - l[g] = x * m.scale + m.min; - } - } else if (m.dtype === "float16") - n === void 0 && (n = S4()), l = n(h); - else - throw new Error(`Unsupported quantization type ${m.dtype} for weight type float32.`); - else if (p === "int32") { - if (m.dtype !== "uint8" && m.dtype !== "uint16") - throw new Error(`Unsupported quantization type ${m.dtype} for weight type int32.`); - l = new Int32Array(h.length); - for (let g = 0; g < h.length; g++) { - let x = h[g]; - l[g] = Math.round(x * m.scale + m.min); - } - } else - throw new Error(`Unsupported dtype in weight '${i}': ${p}`); - s += c * d; - } else if (p === "string") { - let m = He(a.shape); - l = []; - for (let d = 0; d < m; d++) { - let f = new Uint32Array(e.slice(s, s + od))[0]; - s += od; - let h = new Uint8Array(e.slice(s, s + f)); - l.push(h), s += f; - } - } else { - let m = Cl[p], d = e.slice(s, s + c * m); - if (p === "float32") - l = new Float32Array(d); - else if (p === "int32") - l = new Int32Array(d); - else if (p === "bool") - l = new Uint8Array(d); - else if (p === "complex64") { - l = new Float32Array(d); - let f = new Float32Array(l.length / 2), h = new Float32Array(l.length / 2); - for (let b = 0; b < f.length; b++) - f[b] = l[b * 2], h[b] = l[b * 2 + 1]; - let g = ar(f, u, "float32"), x = ar(h, u, "float32"); - o[i] = $r(g, x), g.dispose(), x.dispose(); - } else - throw new Error(`Unsupported dtype in weight '${i}': ${p}`); - s += c * m; - } - p !== "complex64" && (o[i] = ar(l, u, p)); + return { data: HH(s), specs: t10 }; +} +function hd(r16, e) { + let t10 = new lr(r16), o = {}, n = 0; + for (let s of e) { + let a = UH(s, (i, p) => t10.slice(n + i, n + p)); + o[s.name] = Xk(s, t10.slice(n, n + a)), n += a; } return o; } -function y4(r15) { - if (r15 === null) - throw new Error(`Invalid input value: ${JSON.stringify(r15)}`); - let t8 = 0, e = []; - r15.forEach((s) => { - if (t8 += s.byteLength, e.push(s.byteLength === s.buffer.byteLength ? s : new s.constructor(s)), !(s instanceof Float32Array || s instanceof Int32Array || s instanceof Uint8Array)) +function UH(r16, e) { + let t10 = ze(r16.shape), o; + if ("quantization" in r16) { + let n = r16.quantization; + o = fi[n.dtype]; + } else if (r16.dtype === "string") { + let n = 0; + for (let s = 0; s < t10; s++) + n += lu + new Uint32Array(e(n, n + lu))[0]; + return n; + } else + o = fi[r16.dtype]; + return t10 * o; +} +async function GH(r16, e) { + let t10 = ze(r16.shape), o; + if ("quantization" in r16) { + let n = r16.quantization; + o = fi[n.dtype]; + } else if (r16.dtype === "string") { + let n = 0; + for (let s = 0; s < t10; s++) + n += lu + new Uint32Array(await e(n, n + lu))[0]; + return n; + } else + o = fi[r16.dtype]; + return t10 * o; +} +function Xk(r16, e) { + let t10 = r16.name, o = r16.dtype, n = r16.shape, s = ze(n), a, i = 0; + if ("quantization" in r16) { + let p = r16.quantization; + if (p.dtype === "uint8" || p.dtype === "uint16") { + if (!("min" in p && "scale" in p)) + throw new Error(`Weight ${r16.name} with quantization ${p.dtype} doesn't have corresponding metadata min and scale.`); + } else if (p.dtype === "float16") { + if (o !== "float32") + throw new Error(`Weight ${r16.name} is quantized with ${p.dtype} which only supports weights of type float32 not ${o}.`); + } else + throw new Error(`Weight ${r16.name} has unknown quantization dtype ${p.dtype}. Supported quantization dtypes are: 'uint8', 'uint16', and 'float16'.`); + let u = fi[p.dtype], l = p.dtype === "uint8" ? new Uint8Array(e) : new Uint16Array(e); + if (o === "float32") + if (p.dtype === "uint8" || p.dtype === "uint16") { + a = new Float32Array(l.length); + for (let c = 0; c < l.length; c++) { + let m = l[c]; + a[c] = m * p.scale + p.min; + } + } else if (p.dtype === "float16") + a = XH()(l); + else + throw new Error(`Unsupported quantization type ${p.dtype} for weight type float32.`); + else if (o === "int32") { + if (p.dtype !== "uint8" && p.dtype !== "uint16") + throw new Error(`Unsupported quantization type ${p.dtype} for weight type int32.`); + a = new Int32Array(l.length); + for (let c = 0; c < l.length; c++) { + let m = l[c]; + a[c] = Math.round(m * p.scale + p.min); + } + } else + throw new Error(`Unsupported dtype in weight '${t10}': ${o}`); + i += s * u; + } else if (o === "string") { + let p = ze(r16.shape); + a = []; + for (let u = 0; u < p; u++) { + let l = new Uint32Array(e.slice(i, i + lu))[0]; + i += lu; + let c = new Uint8Array(e.slice(i, i + l)); + a.push(c), i += l; + } + } else { + let p = fi[o]; + if (o === "float32") + a = new Float32Array(e); + else if (o === "int32") + a = new Int32Array(e); + else if (o === "bool") + a = new Uint8Array(e); + else if (o === "complex64") { + a = new Float32Array(e); + let u = new Float32Array(a.length / 2), l = new Float32Array(a.length / 2); + for (let f = 0; f < u.length; f++) + u[f] = a[f * 2], l[f] = a[f * 2 + 1]; + let c = pr(u, n, "float32"), m = pr(l, n, "float32"), d = Ar(c, m); + return c.dispose(), m.dispose(), d; + } else + throw new Error(`Unsupported dtype in weight '${t10}': ${o}`); + i += s * p; + } + return pr(a, n, o); +} +async function Kk(r16, e, t10) { + let o = new Uint8Array(e); + for (; o.byteLength < t10; ) { + let { done: n, value: s } = await r16.read(); + if (n && s == null) { + let i = t10 - o.byteLength; + throw new Error(`Reader is done but ${i} bytes are still expected`); + } + let a = new Uint8Array(o.length + s.byteLength); + a.set(o, 0), a.set(new Uint8Array(s), o.length), o = a; + } + return o.buffer; +} +async function gd(r16, e) { + let t10 = {}, o = r16.getReader(), n = new ArrayBuffer(0); + for (let s of e) { + let a = await GH(s, async (u, l) => (n = await Kk(o, n, l), n.slice(u, l))); + n = await Kk(o, n, a); + let i = n.slice(0, a); + n = n.slice(a); + let p = Xk(s, i); + if (t10[s.name] = p, Gk() === "webgpu") { + let u = Hk(); + "uploadToGPU" in u && ze(p.shape) >= A().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD") && u.uploadToGPU(p.dataId); + } + } + return t10; +} +function HH(r16) { + if (r16 === null) + throw new Error(`Invalid input value: ${JSON.stringify(r16)}`); + let e = 0, t10 = []; + r16.forEach((s) => { + if (e += s.byteLength, t10.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 o = new Uint8Array(t8), n = 0; - return e.forEach((s) => { + let o = new Uint8Array(e), n = 0; + return t10.forEach((s) => { o.set(new Uint8Array(s.buffer), n), n += s.byteLength; }), o.buffer; } -var Nw = typeof Buffer != "undefined" && (typeof Blob == "undefined" || typeof atob == "undefined" || typeof btoa == "undefined"); -function nk(r15) { - return Nw ? Buffer.byteLength(r15, "utf8") : new Blob([r15]).size; -} -function ak(r15) { - if (Nw) - return Buffer.from(r15).toString("base64"); - let t8 = new Uint8Array(r15), e = ""; - for (let o = 0, n = t8.length; o < n; o++) - e += String.fromCharCode(t8[o]); - return btoa(e); -} -function ik(r15) { - if (Nw) { - let o = Buffer.from(r15, "base64"); +var Vw = typeof Buffer != "undefined" && (typeof Blob == "undefined" || typeof atob == "undefined" || typeof btoa == "undefined"); +function qk(r16) { + return Vw ? Buffer.byteLength(r16, "utf8") : new Blob([r16]).size; +} +function Yk(r16) { + if (Vw) + return Buffer.from(r16).toString("base64"); + let e = new Uint8Array(r16), t10 = ""; + for (let o = 0, n = e.length; o < n; o++) + t10 += String.fromCharCode(e[o]); + return btoa(t10); +} +function Qk(r16) { + if (Vw) { + let o = Buffer.from(r16, "base64"); return o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength); } - let t8 = atob(r15), e = new Uint8Array(t8.length); - for (let o = 0; o < t8.length; ++o) - e.set([t8.charCodeAt(o)], o); - return e.buffer; -} -function uk(r15) { - return ir.join(r15); -} -function Tw(r15) { - let t8 = "/"; - for (r15 = r15.trim(); r15.endsWith(t8); ) - r15 = r15.slice(0, r15.length - 1); - let e = r15.split(t8); - return e[e.length - 1]; -} -function sd(r15, t8) { - let e = { modelTopology: r15.modelTopology, format: r15.format, generatedBy: r15.generatedBy, convertedBy: r15.convertedBy, weightsManifest: t8 }; - return r15.signature != null && (e.signature = r15.signature), r15.userDefinedMetadata != null && (e.userDefinedMetadata = r15.userDefinedMetadata), r15.modelInitializer != null && (e.modelInitializer = r15.modelInitializer), r15.initializerSignature != null && (e.initializerSignature = r15.initializerSignature), r15.trainingConfig != null && (e.trainingConfig = r15.trainingConfig), e; -} -function _w(r15, t8, e) { - let o = { modelTopology: r15.modelTopology, format: r15.format, generatedBy: r15.generatedBy, convertedBy: r15.convertedBy }; - if (r15.trainingConfig != null && (o.trainingConfig = r15.trainingConfig), r15.weightsManifest != null) { - if (!t8) - throw new Error("modelJSON has weightsManifest but weightSpecs is null"); + let e = atob(r16), t10 = new Uint8Array(e.length); + for (let o = 0; o < e.length; ++o) + t10.set([e.charCodeAt(o)], o); + return t10.buffer; +} +function Zk(r16) { + return lr.join(r16); +} +function Ww(r16) { + let e = "/"; + for (r16 = r16.trim(); r16.endsWith(e); ) + r16 = r16.slice(0, r16.length - 1); + let t10 = r16.split(e); + return t10[t10.length - 1]; +} +function xd(r16, e) { + let t10 = { modelTopology: r16.modelTopology, format: r16.format, generatedBy: r16.generatedBy, convertedBy: r16.convertedBy, weightsManifest: e }; + return r16.signature != null && (t10.signature = r16.signature), r16.userDefinedMetadata != null && (t10.userDefinedMetadata = r16.userDefinedMetadata), r16.modelInitializer != null && (t10.modelInitializer = r16.modelInitializer), r16.initializerSignature != null && (t10.initializerSignature = r16.initializerSignature), r16.trainingConfig != null && (t10.trainingConfig = r16.trainingConfig), t10; +} +function Uw(r16, e, t10) { + let o = { modelTopology: r16.modelTopology, format: r16.format, generatedBy: r16.generatedBy, convertedBy: r16.convertedBy }; + if (r16.trainingConfig != null && (o.trainingConfig = r16.trainingConfig), r16.weightsManifest != null) { if (!e) + throw new Error("modelJSON has weightsManifest but weightSpecs is null"); + if (!t10) throw new Error("modelJSON has weightsManifest but weightData is null"); - o.weightSpecs = t8, o.weightData = e; + o.weightSpecs = e, o.weightData = t10; } - return r15.signature != null && (o.signature = r15.signature), r15.userDefinedMetadata != null && (o.userDefinedMetadata = r15.userDefinedMetadata), r15.modelInitializer != null && (o.modelInitializer = r15.modelInitializer), r15.initializerSignature != null && (o.initializerSignature = r15.initializerSignature), o; + return r16.signature != null && (o.signature = r16.signature), r16.userDefinedMetadata != null && (o.userDefinedMetadata = r16.userDefinedMetadata), r16.modelInitializer != null && (o.modelInitializer = r16.modelInitializer), r16.initializerSignature != null && (o.initializerSignature = r16.initializerSignature), o; } -async function Jp(r15, t8) { - let e, o; - return r15.weightsManifest != null && ([e, o] = await t8(r15.weightsManifest)), _w(r15, e, o); +async function il(r16, e) { + let t10, o; + return r16.weightsManifest != null && ([t10, o] = await e(r16.weightsManifest)), Uw(r16, t10, o); } -function va(r15) { - if (r15.modelTopology instanceof ArrayBuffer) +function $a(r16) { + if (r16.modelTopology instanceof ArrayBuffer) throw new Error("Expected JSON model topology, received ArrayBuffer."); - return { dateSaved: /* @__PURE__ */ new Date(), modelTopologyType: "JSON", modelTopologyBytes: r15.modelTopology == null ? 0 : nk(JSON.stringify(r15.modelTopology)), weightSpecsBytes: r15.weightSpecs == null ? 0 : nk(JSON.stringify(r15.weightSpecs)), weightDataBytes: r15.weightData == null ? 0 : new ir(r15.weightData).byteLength }; + return { dateSaved: /* @__PURE__ */ new Date(), modelTopologyType: "JSON", modelTopologyBytes: r16.modelTopology == null ? 0 : qk(JSON.stringify(r16.modelTopology)), weightSpecsBytes: r16.weightSpecs == null ? 0 : qk(JSON.stringify(r16.weightSpecs)), weightDataBytes: r16.weightData == null ? 0 : new lr(r16.weightData).byteLength }; } -function ad(r15) { - let t8 = []; - for (let e of r15) - t8.push(...e.weights); - return t8; +function Ec(r16) { + let e = []; + for (let t10 of r16) + e.push(...t10.weights); + return e; } -function b4() { - let r15 = (e) => { - let o = e << 13, n = 0; +function KH() { + let r16 = (t10) => { + let o = t10 << 13, n = 0; for (; !(o & 8388608); ) n -= 8388608, o <<= 1; return o &= -8388609, n += 947912704, o | n; - }, t8 = new Uint32Array(2048); - t8[0] = 0; - for (let e = 1; e < 1024; e++) - t8[e] = r15(e); - for (let e = 1024; e < 2048; e++) - t8[e] = 939524096 + (e - 1024 << 13); - return t8; -} -function C4() { - let r15 = new Uint32Array(64); - r15[0] = 0, r15[31] = 1199570944, r15[32] = 2147483648, r15[63] = 3347054592; - for (let t8 = 1; t8 < 31; t8++) - r15[t8] = t8 << 23; - for (let t8 = 33; t8 < 63; t8++) - r15[t8] = 2147483648 + (t8 - 32 << 23); - return r15; -} -function w4() { - let r15 = new Uint32Array(64); - for (let t8 = 0; t8 < 64; t8++) - r15[t8] = 1024; - return r15[0] = r15[32] = 0, r15; -} -function S4() { - let r15 = b4(), t8 = C4(), e = w4(); + }, e = new Uint32Array(2048); + e[0] = 0; + for (let t10 = 1; t10 < 1024; t10++) + e[t10] = r16(t10); + for (let t10 = 1024; t10 < 2048; t10++) + e[t10] = 939524096 + (t10 - 1024 << 13); + return e; +} +function qH() { + let r16 = new Uint32Array(64); + r16[0] = 0, r16[31] = 1199570944, r16[32] = 2147483648, r16[63] = 3347054592; + for (let e = 1; e < 31; e++) + r16[e] = e << 23; + for (let e = 33; e < 63; e++) + r16[e] = 2147483648 + (e - 32 << 23); + return r16; +} +function jH() { + let r16 = new Uint32Array(64); + for (let e = 0; e < 64; e++) + r16[e] = 1024; + return r16[0] = r16[32] = 0, r16; +} +function XH() { + let r16 = KH(), e = qH(), t10 = jH(); return (o) => { let n = new ArrayBuffer(4 * o.length), s = new Uint32Array(n); for (let a = 0; a < o.length; a++) { - let i = o[a], p = r15[e[i >> 10] + (i & 1023)] + t8[i >> 10]; + let i = o[a], p = r16[t10[i >> 10] + (i & 1023)] + e[i >> 10]; s[a] = p; } return new Float32Array(n); }; } -var qt = class r3 { +var Xt = class r3 { constructor() { this.saveRouters = [], this.loadRouters = []; } static getInstance() { return r3.instance == null && (r3.instance = new r3()), r3.instance; } - static registerSaveRouter(t8) { - r3.getInstance().saveRouters.push(t8); + static registerSaveRouter(e) { + r3.getInstance().saveRouters.push(e); } - static registerLoadRouter(t8) { - r3.getInstance().loadRouters.push(t8); + static registerLoadRouter(e) { + r3.getInstance().loadRouters.push(e); } - static getSaveHandlers(t8) { - return r3.getHandlers(t8, "save"); + static getSaveHandlers(e) { + return r3.getHandlers(e, "save"); } - static getLoadHandlers(t8, e) { - return r3.getHandlers(t8, "load", e); + static getLoadHandlers(e, t10) { + return r3.getHandlers(e, "load", t10); } - static getHandlers(t8, e, o) { + static getHandlers(e, t10, o) { let n = []; - return (e === "load" ? r3.getInstance().loadRouters : r3.getInstance().saveRouters).forEach((a) => { - let i = a(t8, o); + return (t10 === "load" ? r3.getInstance().loadRouters : r3.getInstance().saveRouters).forEach((a) => { + let i = a(e, o); i !== null && n.push(i); }), n; } }; -var pk = (r15) => qt.registerSaveRouter(r15); -var ck = (r15) => qt.registerLoadRouter(r15); -var lk = (r15) => qt.getSaveHandlers(r15); -var mk = (r15, t8) => qt.getLoadHandlers(r15, t8); -var $w = "tensorflowjs"; -var Ew = 1; -var Ou = "models_store"; -var eu = "model_info_store"; -function dk() { +var Jk = (r16) => Xt.registerSaveRouter(r16); +var e1 = (r16) => Xt.registerLoadRouter(r16); +var t1 = (r16) => Xt.getSaveHandlers(r16); +var r1 = (r16, e) => Xt.getLoadHandlers(r16, e); +var Gw = "tensorflowjs"; +var Hw = 1; +var Gu = "models_store"; +var cu = "model_info_store"; +function o1() { if (!A().getBool("IS_BROWSER")) throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser."); - let r15 = typeof window == "undefined" ? self : window, t8 = r15.indexedDB || r15.mozIndexedDB || r15.webkitIndexedDB || r15.msIndexedDB || r15.shimIndexedDB; - if (t8 == null) + let r16 = typeof window == "undefined" ? self : window, e = r16.indexedDB || r16.mozIndexedDB || r16.webkitIndexedDB || r16.msIndexedDB || r16.shimIndexedDB; + if (e == null) throw new Error("The current browser does not appear to support IndexedDB."); - return t8; + return e; } -function Rw(r15) { - let t8 = r15.result; - t8.createObjectStore(Ou, { keyPath: "modelPath" }), t8.createObjectStore(eu, { keyPath: "modelPath" }); +function Kw(r16) { + let e = r16.result; + e.createObjectStore(Gu, { keyPath: "modelPath" }), e.createObjectStore(cu, { keyPath: "modelPath" }); } -var ka = class { - constructor(t8) { - if (this.indexedDB = dk(), t8 == null || !t8) +var Ra = class { + constructor(e) { + if (this.indexedDB = o1(), e == null || !e) throw new Error("For IndexedDB, modelPath must not be null, undefined or empty."); - this.modelPath = t8; + this.modelPath = e; } - async save(t8) { - if (t8.modelTopology instanceof ArrayBuffer) + 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, t8); + return this.databaseAction(this.modelPath, e); } async load() { return this.databaseAction(this.modelPath); } - databaseAction(t8, e) { + databaseAction(e, t10) { return new Promise((o, n) => { - let s = this.indexedDB.open($w, Ew); - s.onupgradeneeded = () => Rw(s), s.onsuccess = () => { + let s = this.indexedDB.open(Gw, Hw); + s.onupgradeneeded = () => Kw(s), s.onsuccess = () => { let a = s.result; - if (e == null) { - let i = a.transaction(Ou, "readonly"), u = i.objectStore(Ou).get(this.modelPath); + if (t10 == null) { + let i = a.transaction(Gu, "readonly"), u = i.objectStore(Gu).get(this.modelPath); u.onsuccess = () => { if (u.result == null) return a.close(), n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`)); o(u.result.modelArtifacts); - }, u.onerror = (c) => (a.close(), n(u.error)), i.oncomplete = () => a.close(); + }, u.onerror = (l) => (a.close(), n(u.error)), i.oncomplete = () => a.close(); } else { - e.weightData = ir.join(e.weightData); - let i = va(e), p = a.transaction(eu, "readwrite"), u = p.objectStore(eu), c; + t10.weightData = lr.join(t10.weightData); + let i = $a(t10), p = a.transaction(cu, "readwrite"), u = p.objectStore(cu), l; try { - c = u.put({ modelPath: this.modelPath, modelArtifactsInfo: i }); + l = u.put({ modelPath: this.modelPath, modelArtifactsInfo: i }); } catch (m) { return n(m); } - let l; - c.onsuccess = () => { - l = a.transaction(Ou, "readwrite"); - let m = l.objectStore(Ou), d; + let c; + l.onsuccess = () => { + c = a.transaction(Gu, "readwrite"); + let m = c.objectStore(Gu), d; try { - d = m.put({ modelPath: this.modelPath, modelArtifacts: e, modelArtifactsInfo: i }); + d = m.put({ modelPath: this.modelPath, modelArtifacts: t10, modelArtifactsInfo: i }); } catch (f) { return n(f); } d.onsuccess = () => o({ modelArtifactsInfo: i }), d.onerror = (f) => { - u = p.objectStore(eu); + u = p.objectStore(cu); let h = u.delete(this.modelPath); h.onsuccess = () => (a.close(), n(d.error)), h.onerror = (g) => (a.close(), n(d.error)); }; - }, c.onerror = (m) => (a.close(), n(c.error)), p.oncomplete = () => { - l == null ? a.close() : l.oncomplete = () => a.close(); + }, l.onerror = (m) => (a.close(), n(l.error)), p.oncomplete = () => { + c == null ? a.close() : c.oncomplete = () => a.close(); }; } }, s.onerror = (a) => n(s.error); }); } }; -ka.URL_SCHEME = "indexeddb://"; -var fk = (r15) => A().getBool("IS_BROWSER") && !Array.isArray(r15) && r15.startsWith(ka.URL_SCHEME) ? I4(r15.slice(ka.URL_SCHEME.length)) : null; -qt.registerSaveRouter(fk); -qt.registerLoadRouter(fk); -function I4(r15) { - return new ka(r15); +Ra.URL_SCHEME = "indexeddb://"; +var n1 = (r16) => A().getBool("IS_BROWSER") && !Array.isArray(r16) && r16.startsWith(Ra.URL_SCHEME) ? YH(r16.slice(Ra.URL_SCHEME.length)) : null; +Xt.registerSaveRouter(n1); +Xt.registerLoadRouter(n1); +function YH(r16) { + return new Ra(r16); } -function v4(r15) { - return r15.startsWith(ka.URL_SCHEME) ? r15.slice(ka.URL_SCHEME.length) : r15; +function QH(r16) { + return r16.startsWith(Ra.URL_SCHEME) ? r16.slice(Ra.URL_SCHEME.length) : r16; } -var id = class { +var yd = class { constructor() { - this.indexedDB = dk(); + this.indexedDB = o1(); } async listModels() { - return new Promise((t8, e) => { - let o = this.indexedDB.open($w, Ew); - o.onupgradeneeded = () => Rw(o), o.onsuccess = () => { - let n = o.result, s = n.transaction(eu, "readonly"), i = s.objectStore(eu).getAll(); + return new Promise((e, t10) => { + let o = this.indexedDB.open(Gw, Hw); + o.onupgradeneeded = () => Kw(o), o.onsuccess = () => { + let n = o.result, s = n.transaction(cu, "readonly"), i = s.objectStore(cu).getAll(); i.onsuccess = () => { let p = {}; for (let u of i.result) p[u.modelPath] = u.modelArtifactsInfo; - t8(p); - }, i.onerror = (p) => (n.close(), e(i.error)), s.oncomplete = () => n.close(); - }, o.onerror = (n) => e(o.error); + e(p); + }, i.onerror = (p) => (n.close(), t10(i.error)), s.oncomplete = () => n.close(); + }, o.onerror = (n) => t10(o.error); }); } - async removeModel(t8) { - return t8 = v4(t8), new Promise((e, o) => { - let n = this.indexedDB.open($w, Ew); - n.onupgradeneeded = () => Rw(n), n.onsuccess = () => { - let s = n.result, a = s.transaction(eu, "readwrite"), i = a.objectStore(eu), p = i.get(t8), u; + async removeModel(e) { + return e = QH(e), new Promise((t10, o) => { + let n = this.indexedDB.open(Gw, Hw); + n.onupgradeneeded = () => Kw(n), n.onsuccess = () => { + let s = n.result, a = s.transaction(cu, "readwrite"), i = a.objectStore(cu), p = i.get(e), u; p.onsuccess = () => { if (p.result == null) - return s.close(), o(new Error(`Cannot find model with path '${t8}' in IndexedDB.`)); + return s.close(), o(new Error(`Cannot find model with path '${e}' in IndexedDB.`)); { - let c = i.delete(t8), l = () => { - u = s.transaction(Ou, "readwrite"); - let d = u.objectStore(Ou).delete(t8); - d.onsuccess = () => e(p.result.modelArtifactsInfo), d.onerror = (f) => o(p.error); + let l = i.delete(e), c = () => { + u = s.transaction(Gu, "readwrite"); + let d = u.objectStore(Gu).delete(e); + d.onsuccess = () => t10(p.result.modelArtifactsInfo), d.onerror = (f) => o(p.error); }; - c.onsuccess = l, c.onerror = (m) => (l(), s.close(), o(p.error)); + l.onsuccess = c, l.onerror = (m) => (c(), s.close(), o(p.error)); } - }, p.onerror = (c) => (s.close(), o(p.error)), a.oncomplete = () => { + }, p.onerror = (l) => (s.close(), o(p.error)), a.oncomplete = () => { u == null ? s.close() : u.oncomplete = () => s.close(); }; }, n.onerror = (s) => o(n.error); }); } }; -var si = "/"; -var ec = "tensorflowjs_models"; -var hk = "info"; -var k4 = "model_topology"; -var N4 = "weight_specs"; -var T4 = "weight_data"; -var _4 = "model_metadata"; -function gk(r15) { - return { info: [ec, r15, hk].join(si), topology: [ec, r15, k4].join(si), weightSpecs: [ec, r15, N4].join(si), weightData: [ec, r15, T4].join(si), modelMetadata: [ec, r15, _4].join(si) }; +var hi = "/"; +var ul = "tensorflowjs_models"; +var s1 = "info"; +var ZH = "model_topology"; +var JH = "weight_specs"; +var eK = "weight_data"; +var tK = "model_metadata"; +function a1(r16) { + return { info: [ul, r16, s1].join(hi), topology: [ul, r16, ZH].join(hi), weightSpecs: [ul, r16, JH].join(hi), weightData: [ul, r16, eK].join(hi), modelMetadata: [ul, r16, tK].join(hi) }; } -function xk(r15) { - for (let t8 of Object.values(r15)) - window.localStorage.removeItem(t8); +function i1(r16) { + for (let e of Object.values(r16)) + window.localStorage.removeItem(e); } -function $4(r15) { - let t8 = r15.split(si); - if (t8.length < 3) - throw new Error(`Invalid key format: ${r15}`); - return t8.slice(1, t8.length - 1).join(si); +function rK(r16) { + let e = r16.split(hi); + if (e.length < 3) + throw new Error(`Invalid key format: ${r16}`); + return e.slice(1, e.length - 1).join(hi); } -function E4(r15) { - return r15.startsWith(Na.URL_SCHEME) ? r15.slice(Na.URL_SCHEME.length) : r15; +function oK(r16) { + return r16.startsWith(Da.URL_SCHEME) ? r16.slice(Da.URL_SCHEME.length) : r16; } -var Na = class { - constructor(t8) { +var Da = class { + constructor(e) { if (!A().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, t8 == null || !t8) + if (this.LS = window.localStorage, e == null || !e) throw new Error("For local storage, modelPath must not be null, undefined or empty."); - this.modelPath = t8, this.keys = gk(this.modelPath); + this.modelPath = e, this.keys = a1(this.modelPath); } - async save(t8) { - if (t8.modelTopology instanceof ArrayBuffer) + async save(e) { + if (e.modelTopology instanceof ArrayBuffer) throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet."); { - let e = JSON.stringify(t8.modelTopology), o = JSON.stringify(t8.weightSpecs), n = va(t8), s = ir.join(t8.weightData); + let t10 = JSON.stringify(e.modelTopology), o = JSON.stringify(e.weightSpecs), n = $a(e), s = lr.join(e.weightData); try { - this.LS.setItem(this.keys.info, JSON.stringify(n)), this.LS.setItem(this.keys.topology, e), this.LS.setItem(this.keys.weightSpecs, o), this.LS.setItem(this.keys.weightData, ak(s)); - let a = { format: t8.format, generatedBy: t8.generatedBy, convertedBy: t8.convertedBy, signature: t8.signature != null ? t8.signature : void 0, userDefinedMetadata: t8.userDefinedMetadata != null ? t8.userDefinedMetadata : void 0, modelInitializer: t8.modelInitializer != null ? t8.modelInitializer : void 0, initializerSignature: t8.initializerSignature != null ? t8.initializerSignature : void 0, trainingConfig: t8.trainingConfig != null ? t8.trainingConfig : void 0 }; + this.LS.setItem(this.keys.info, JSON.stringify(n)), this.LS.setItem(this.keys.topology, t10), this.LS.setItem(this.keys.weightSpecs, o), this.LS.setItem(this.keys.weightData, Yk(s)); + let a = { format: e.format, generatedBy: e.generatedBy, convertedBy: e.convertedBy, signature: e.signature != null ? e.signature : void 0, userDefinedMetadata: e.userDefinedMetadata != null ? e.userDefinedMetadata : void 0, modelInitializer: e.modelInitializer != null ? e.modelInitializer : void 0, initializerSignature: e.initializerSignature != null ? e.initializerSignature : void 0, trainingConfig: e.trainingConfig != null ? e.trainingConfig : void 0 }; return this.LS.setItem(this.keys.modelMetadata, JSON.stringify(a)), { modelArtifactsInfo: n }; } catch (a) { - throw xk(this.keys), new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.weightDataBytes}.`); + throw i1(this.keys), new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.weightDataBytes}.`); } } } async load() { - let t8 = JSON.parse(this.LS.getItem(this.keys.info)); - if (t8 == null) + 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 (t8.modelTopologyType !== "JSON") + if (e.modelTopologyType !== "JSON") throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet."); - let e = {}, o = JSON.parse(this.LS.getItem(this.keys.topology)); + let t10 = {}, o = JSON.parse(this.LS.getItem(this.keys.topology)); if (o == null) throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`); - e.modelTopology = o; + t10.modelTopology = o; let n = JSON.parse(this.LS.getItem(this.keys.weightSpecs)); if (n == null) throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`); - e.weightSpecs = n; + t10.weightSpecs = n; let s = this.LS.getItem(this.keys.modelMetadata); if (s != null) { let i = JSON.parse(s); - e.format = i.format, e.generatedBy = i.generatedBy, e.convertedBy = i.convertedBy, i.signature != null && (e.signature = i.signature), i.userDefinedMetadata != null && (e.userDefinedMetadata = i.userDefinedMetadata), i.modelInitializer != null && (e.modelInitializer = i.modelInitializer), i.initializerSignature != null && (e.initializerSignature = i.initializerSignature), i.trainingConfig != null && (e.trainingConfig = i.trainingConfig); + t10.format = i.format, t10.generatedBy = i.generatedBy, t10.convertedBy = i.convertedBy, i.signature != null && (t10.signature = i.signature), i.userDefinedMetadata != null && (t10.userDefinedMetadata = i.userDefinedMetadata), i.modelInitializer != null && (t10.modelInitializer = i.modelInitializer), i.initializerSignature != null && (t10.initializerSignature = i.initializerSignature), i.trainingConfig != null && (t10.trainingConfig = i.trainingConfig); } let a = this.LS.getItem(this.keys.weightData); if (a == null) throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`); - return e.weightData = ik(a), e; + return t10.weightData = Qk(a), t10; } }; -Na.URL_SCHEME = "localstorage://"; -var yk = (r15) => A().getBool("IS_BROWSER") && !Array.isArray(r15) && r15.startsWith(Na.URL_SCHEME) ? R4(r15.slice(Na.URL_SCHEME.length)) : null; -qt.registerSaveRouter(yk); -qt.registerLoadRouter(yk); -function R4(r15) { - return new Na(r15); +Da.URL_SCHEME = "localstorage://"; +var u1 = (r16) => A().getBool("IS_BROWSER") && !Array.isArray(r16) && r16.startsWith(Da.URL_SCHEME) ? nK(r16.slice(Da.URL_SCHEME.length)) : null; +Xt.registerSaveRouter(u1); +Xt.registerLoadRouter(u1); +function nK(r16) { + return new Da(r16); } -var ud = class { +var bd = class { constructor() { $(A().getBool("IS_BROWSER"), () => "Current environment is not a web browser"), $(typeof window == "undefined" || typeof window.localStorage != "undefined", () => "Current browser does not appear to support localStorage"), this.LS = window.localStorage; } async listModels() { - let t8 = {}, e = ec + si, o = si + hk; + let e = {}, t10 = ul + hi, o = hi + s1; for (let n = 0; n < this.LS.length; ++n) { let s = this.LS.key(n); - if (s.startsWith(e) && s.endsWith(o)) { - let a = $4(s); - t8[a] = JSON.parse(this.LS.getItem(s)); + if (s.startsWith(t10) && s.endsWith(o)) { + let a = rK(s); + e[a] = JSON.parse(this.LS.getItem(s)); } } - return t8; + return e; } - async removeModel(t8) { - t8 = E4(t8); - let e = gk(t8); - if (this.LS.getItem(e.info) == null) - throw new Error(`Cannot find model at path '${t8}'`); - let o = JSON.parse(this.LS.getItem(e.info)); - return xk(e), o; + async removeModel(e) { + e = oK(e); + let t10 = a1(e); + if (this.LS.getItem(t10.info) == null) + throw new Error(`Cannot find model at path '${e}'`); + let o = JSON.parse(this.LS.getItem(t10.info)); + return i1(t10), o; } }; -var tc = "://"; -var Os = class r5 { +var pl = "://"; +var Hs = class r4 { constructor() { this.managers = {}; } static getInstance() { - return r5.instance == null && (r5.instance = new r5()), r5.instance; + return r4.instance == null && (r4.instance = new r4()), r4.instance; } - static registerManager(t8, e) { - $(t8 != null, () => "scheme must not be undefined or null."), t8.endsWith(tc) && (t8 = t8.slice(0, t8.indexOf(tc))), $(t8.length > 0, () => "scheme must not be an empty string."); - let o = r5.getInstance(); - $(o.managers[t8] == null, () => `A model store manager is already registered for scheme '${t8}'.`), o.managers[t8] = e; + static registerManager(e, t10) { + $(e != null, () => "scheme must not be undefined or null."), e.endsWith(pl) && (e = e.slice(0, e.indexOf(pl))), $(e.length > 0, () => "scheme must not be an empty string."); + let o = r4.getInstance(); + $(o.managers[e] == null, () => `A model store manager is already registered for scheme '${e}'.`), o.managers[e] = t10; } - static getManager(t8) { - let e = r5.getInstance().managers[t8]; - if (e == null) - throw new Error(`Cannot find model manager for scheme '${t8}'`); - return e; + static getManager(e) { + let t10 = r4.getInstance().managers[e]; + if (t10 == null) + throw new Error(`Cannot find model manager for scheme '${e}'`); + return t10; } static getSchemes() { - return Object.keys(r5.getInstance().managers); - } -}; -function pd(r15) { - if (r15.indexOf(tc) === -1) - throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Os.getSchemes().join(",")}`); - return { scheme: r15.split(tc)[0], path: r15.split(tc)[1] }; -} -async function bk(r15, t8, e = false) { - $(r15 !== t8, () => `Old path and new path are the same: '${r15}'`); - let o = qt.getLoadHandlers(r15); - $(o.length > 0, () => `Copying failed because no load handler is found for source URL ${r15}.`), $(o.length < 2, () => `Copying failed because more than one (${o.length}) load handlers for source URL ${r15}.`); - let n = o[0], s = qt.getSaveHandlers(t8); - $(s.length > 0, () => `Copying failed because no save handler is found for destination URL ${t8}.`), $(s.length < 2, () => `Copying failed because more than one (${o.length}) save handlers for destination URL ${t8}.`); - let a = s[0], i = pd(r15).scheme, p = pd(r15).path, u = i === pd(r15).scheme, c = await n.load(); - e && u && await Os.getManager(i).removeModel(p); - let l = await a.save(c); - return e && !u && await Os.getManager(i).removeModel(p), l.modelArtifactsInfo; -} -async function Ck() { - let r15 = Os.getSchemes(), t8 = {}; - for (let e of r15) { - let o = await Os.getManager(e).listModels(); + return Object.keys(r4.getInstance().managers); + } +}; +function Cd(r16) { + if (r16.indexOf(pl) === -1) + throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Hs.getSchemes().join(",")}`); + return { scheme: r16.split(pl)[0], path: r16.split(pl)[1] }; +} +async function p1(r16, e, t10 = false) { + $(r16 !== e, () => `Old path and new path are the same: '${r16}'`); + let o = Xt.getLoadHandlers(r16); + $(o.length > 0, () => `Copying failed because no load handler is found for source URL ${r16}.`), $(o.length < 2, () => `Copying failed because more than one (${o.length}) load handlers for source URL ${r16}.`); + let n = o[0], s = Xt.getSaveHandlers(e); + $(s.length > 0, () => `Copying failed because no save handler is found for destination URL ${e}.`), $(s.length < 2, () => `Copying failed because more than one (${o.length}) save handlers for destination URL ${e}.`); + let a = s[0], i = Cd(r16).scheme, p = Cd(r16).path, u = i === Cd(r16).scheme, l = await n.load(); + t10 && u && await Hs.getManager(i).removeModel(p); + let c = await a.save(l); + return t10 && !u && await Hs.getManager(i).removeModel(p), c.modelArtifactsInfo; +} +async function l1() { + let r16 = Hs.getSchemes(), e = {}; + for (let t10 of r16) { + let o = await Hs.getManager(t10).listModels(); for (let n in o) { - let s = e + tc + n; - t8[s] = o[n]; + let s = t10 + pl + n; + e[s] = o[n]; } } - return t8; + return e; } -async function wk(r15) { - let t8 = pd(r15); - return Os.getManager(t8.scheme).removeModel(t8.path); +async function c1(r16) { + let e = Cd(r16); + return Hs.getManager(e.scheme).removeModel(e.path); } -async function Sk(r15, t8) { - return bk(r15, t8, false); +async function m1(r16, e) { + return p1(r16, e, false); } -async function Ik(r15, t8) { - return bk(r15, t8, true); +async function d1(r16, e) { + return p1(r16, e, true); } -var Dw = class { +var qw = class { constructor() { this.messageName = "setTimeoutCustom", this.functionRefs = [], this.handledMessageCount = 0, this.hasEventListener = false; } - fetch(t8, e) { - return fetch(t8, e); + fetch(e, t10) { + return fetch(e, t10); } now() { return performance.now(); } - encode(t8, e) { - if (e !== "utf-8" && e !== "utf8") - throw new Error(`Browser's encoder only supports utf-8, but got ${e}`); - return this.textEncoder == null && (this.textEncoder = new TextEncoder()), this.textEncoder.encode(t8); + encode(e, t10) { + if (t10 !== "utf-8" && t10 !== "utf8") + throw new Error(`Browser's encoder only supports utf-8, but got ${t10}`); + return this.textEncoder == null && (this.textEncoder = new TextEncoder()), this.textEncoder.encode(e); } - decode(t8, e) { - return new TextDecoder(e).decode(t8); + decode(e, t10) { + return new TextDecoder(t10).decode(e); } - setTimeoutCustom(t8, e) { + setTimeoutCustom(e, t10) { if (typeof window == "undefined" || !A().getBool("USE_SETTIMEOUTCUSTOM")) { - setTimeout(t8, e); + setTimeout(e, t10); return; } - this.functionRefs.push(t8), setTimeout(() => { + this.functionRefs.push(e), setTimeout(() => { window.postMessage({ name: this.messageName, index: this.functionRefs.length - 1 }, "*"); - }, e), this.hasEventListener || (this.hasEventListener = true, window.addEventListener("message", (o) => { + }, t10), this.hasEventListener || (this.hasEventListener = true, window.addEventListener("message", (o) => { if (o.source === window && o.data.name === this.messageName) { o.stopPropagation(); let n = this.functionRefs[o.data.index]; @@ -5459,2730 +5583,2666 @@ var Dw = class { } }, true)); } - isTypedArray(t8) { - return Xm(t8); + isTypedArray(e) { + return id(e); } }; if (A().get("IS_BROWSER")) { - A().setPlatform("browser", new Dw()); + A().setPlatform("browser", new qw()); try { - Os.registerManager(Na.URL_SCHEME, new ud()); - } catch (r15) { + Hs.registerManager(Da.URL_SCHEME, new bd()); + } catch (r16) { } try { - Os.registerManager(ka.URL_SCHEME, new id()); - } catch (r15) { + Hs.registerManager(Ra.URL_SCHEME, new yd()); + } catch (r16) { } } -var D4 = { importFetch: () => vk() }; -var Aw; -var Fw = class { +var sK = { importFetch: () => f1() }; +var jw; +var Xw = class { constructor() { - this.util = kk(), this.textEncoder = new this.util.TextEncoder(); + this.util = h1(), this.textEncoder = new this.util.TextEncoder(); } - fetch(t8, e) { - return A().global.fetch != null ? A().global.fetch(t8, e) : (Aw == null && (Aw = D4.importFetch()), Aw(t8, e)); + fetch(e, t10) { + return A().global.fetch != null ? A().global.fetch(e, t10) : (jw == null && (jw = sK.importFetch()), jw(e, t10)); } now() { - let t8 = process.hrtime(); - return t8[0] * 1e3 + t8[1] / 1e6; + let e = process.hrtime(); + return e[0] * 1e3 + e[1] / 1e6; } - encode(t8, e) { - if (e !== "utf-8" && e !== "utf8") - throw new Error(`Node built-in encoder only supports utf-8, but got ${e}`); - return this.textEncoder.encode(t8); + encode(e, t10) { + if (t10 !== "utf-8" && t10 !== "utf8") + throw new Error(`Node built-in encoder only supports utf-8, but got ${t10}`); + return this.textEncoder.encode(e); } - decode(t8, e) { - return t8.length === 0 ? "" : new this.util.TextDecoder(e).decode(t8); + decode(e, t10) { + return e.length === 0 ? "" : new this.util.TextDecoder(t10).decode(e); } - isTypedArray(t8) { - return this.util.types.isFloat32Array(t8) || this.util.types.isInt32Array(t8) || this.util.types.isUint8Array(t8) || this.util.types.isUint8ClampedArray(t8); + isTypedArray(e) { + return this.util.types.isFloat32Array(e) || this.util.types.isInt32Array(e) || this.util.types.isUint8Array(e) || this.util.types.isUint8ClampedArray(e); } }; -A().get("IS_NODE") && !A().get("IS_BROWSER") && A().setPlatform("node", new Fw()); -function me(r15, t8 = "float32", e) { - return t8 = t8 || "float32", Ct(r15), new tt(r15, t8, e); +A().get("IS_NODE") && !A().get("IS_BROWSER") && A().setPlatform("node", new Xw()); +function ie(r16, e = "float32", t10) { + return e = e || "float32", St(r16), new Ge(r16, e, t10); } -function A4(r15, t8) { - let e = v(r15, "x", "cast"); - if (!tw(t8)) - throw new Error(`Failed to cast to unknown dtype ${t8}`); - if (t8 === "string" && e.dtype !== "string" || t8 !== "string" && e.dtype === "string") +function aK(r16, e) { + let t10 = v(r16, "x", "cast"); + if (!hw(e)) + throw new Error(`Failed to cast to unknown dtype ${e}`); + if (e === "string" && t10.dtype !== "string" || e !== "string" && t10.dtype === "string") throw new Error("Only strings can be casted to strings"); - let o = { x: e }, n = { dtype: t8 }; - return T.runKernel(yo, o, n); -} -var We = N({ cast_: A4 }); -function F4(r15) { - let e = { x: v(r15, "x", "clone", "string_or_numeric") }; - return T.runKernel(Co, e); -} -var Wr = N({ clone_: F4 }); -function cd(r15, t8 = false) { - console.log(r15.toString(t8)); -} -Sw(); -var P4 = { buffer: me, cast: We, clone: Wr, print: cd }; -Z0(P4); -function lde() { - A().set("PROD", true); -} -function mde() { - A().set("DEBUG", true); -} -function dde() { - A().set("DEPRECATION_WARNINGS_ENABLED", false), console.warn("TensorFlow.js deprecation warnings have been disabled."); -} -function Pw(r15) { - A().getBool("DEPRECATION_WARNINGS_ENABLED") && console.warn(r15 + " You can disable deprecation warnings with tf.disableDeprecationWarnings()."); -} -J0(Pw); -function fde() { - T.disposeVariables(); -} -function ur() { - return T; -} -function hde() { - return T.memory(); -} -function gde(r15) { - return T.profile(r15); -} -function De(r15, t8) { - return T.tidy(r15, t8); -} -function Ot(r15) { - yl(r15).forEach((e) => e.dispose()); -} -function Er(r15) { - return T.keep(r15); -} -function xde(r15) { - return T.time(r15); -} -function yde(r15) { - return T.setBackend(r15); -} -function bde() { - return T.ready(); -} -function Cde() { - return T.backendName; -} -function wde(r15) { - T.removeBackend(r15); -} -function Sde(r15) { - return T.findBackend(r15); -} -function Ide(r15) { - return T.findBackendFactory(r15); -} -function tu(r15, t8, e = 1) { - return T.registerBackend(r15, t8, e); -} -function vde() { - return T.backend; -} -function kde(r15, t8) { - A().setPlatform(r15, t8); -} -function O4(r15, t8) { - let e = v(r15, "a", "add"), o = v(t8, "b", "add"); - [e, o] = Oe(e, o); - let n = { a: e, b: o }; - return T.runKernel(io, n); -} -var Ce = N({ add_: O4 }); -function M4(r15, t8) { - let e = v(r15, "a", "floorDiv"), o = v(t8, "b", "floorDiv"); - [e, o] = Oe(e, o); - let n = { a: e, b: o }; - return T.runKernel(Sn, n); -} -var ld = N({ floorDiv_: M4 }); -function L4(r15, t8) { - let e = v(r15, "a", "div"), o = v(t8, "b", "div"); - if ([e, o] = Oe(e, o), e.dtype === "int32" && o.dtype === "int32") - return ld(e, o); - let n = { a: e, b: o }, s = {}; - return T.runKernel(fn, n, s); -} -var je = N({ div_: L4 }); -function B4(r15, t8) { - let e = v(r15, "a", "mul"), o = v(t8, "b", "mul"); - [e, o] = Oe(e, o); - let n = { a: e, b: o }; - return T.runKernel(Xn, n); -} -var se = N({ mul_: B4 }); -function z4(r15) { - let t8 = v(r15, "x", "abs"); - if (t8.dtype === "complex64") { - let e = { x: t8 }; - return T.runKernel(Di, e); + let o = { x: t10 }, n = { dtype: e }; + return _.runKernel(ho, o, n); +} +var Ue = N({ cast_: aK }); +function iK(r16) { + let t10 = { x: v(r16, "x", "clone", "string_or_numeric") }; + return _.runKernel(vo, t10); +} +var Xr = N({ clone_: iK }); +function wd(r16, e = false) { + console.log(r16.toString(e)); +} +Ow(); +var uK = { buffer: ie, cast: Ue, clone: Xr, print: wd }; +Lk(uK); +function pK(r16, e) { + let t10 = v(r16, "a", "add"), o = v(e, "b", "add"); + [t10, o] = Oe(t10, o); + let n = { a: t10, b: o }; + return _.runKernel(Rr, n); +} +var Ce = N({ add_: pK }); +function lK(r16, e) { + let t10 = v(r16, "a", "floorDiv"), o = v(e, "b", "floorDiv"); + [t10, o] = Oe(t10, o); + let n = { a: t10, b: o }; + return _.runKernel(wo, n); +} +var Sd = N({ floorDiv_: lK }); +function cK(r16, e) { + let t10 = v(r16, "a", "div"), o = v(e, "b", "div"); + if ([t10, o] = Oe(t10, o), t10.dtype === "int32" && o.dtype === "int32") + return Sd(t10, o); + let n = { a: t10, b: o }, s = {}; + return _.runKernel(Vn, n, s); +} +var Xe = N({ div_: cK }); +function mK(r16, e) { + let t10 = v(r16, "a", "mul"), o = v(e, "b", "mul"); + [t10, o] = Oe(t10, o); + let n = { a: t10, b: o }; + return _.runKernel($o, n); +} +var se = N({ mul_: mK }); +function dK(r16) { + let e = v(r16, "x", "abs"); + if (e.dtype === "complex64") { + let t10 = { x: e }; + return _.runKernel(Wi, t10); } else { - let e = { x: t8 }; - return T.runKernel(Xs, e); - } -} -var Qt = N({ abs_: z4 }); -function V4(r15) { - let e = { x: v(r15, "x", "acos") }; - return T.runKernel(Vo, e); -} -var Nk = N({ acos_: V4 }); -function W4(r15) { - let e = { x: v(r15, "x", "acosh") }; - return T.runKernel(Wo, e); -} -var Tk = N({ acosh_: W4 }); -function U4(r15) { - $(Array.isArray(r15), () => "The argument passed to tf.addN() must be a list of tensors"), $(r15.length >= 1, () => `Must pass at least one tensor to tf.addN(), but got ${r15.length}`); - let t8 = r15.map((n, s) => v(n, `tensors${s}`, "addN")), e = t8[0]; - t8.forEach((n) => { - if (n.dtype !== e.dtype) + let t10 = { x: e }; + return _.runKernel(fn, t10); + } +} +var er = N({ abs_: dK }); +function fK(r16) { + let t10 = { x: v(r16, "x", "acos") }; + return _.runKernel(hn, t10); +} +var g1 = N({ acos_: fK }); +function hK(r16) { + let t10 = { x: v(r16, "x", "acosh") }; + return _.runKernel(gn, t10); +} +var x1 = N({ acosh_: hK }); +function gK(r16) { + $(Array.isArray(r16), () => "The argument passed to tf.addN() must be a list of tensors"), $(r16.length >= 1, () => `Must pass at least one tensor to tf.addN(), but got ${r16.length}`); + let e = r16.map((n, s) => v(n, `tensors${s}`, "addN")), t10 = e[0]; + e.forEach((n) => { + if (n.dtype !== t10.dtype) throw new Error("All tensors passed to tf.addN() must have the same dtype"); - }), t8.forEach((n) => { - if (!br(n.shape, e.shape)) + }), e.forEach((n) => { + if (!Sr(n.shape, t10.shape)) throw new Error("All tensors passed to tf.addN() must have the same shape"); }); - let o = t8; - return T.runKernel(Uo, o); -} -var _k = N({ addN_: U4 }); -function G4(r15, t8 = null, e = false) { - let n = { x: v(r15, "x", "all", "bool") }, s = { axis: t8, keepDims: e }; - return T.runKernel(Go, n, s); -} -var $k = N({ all_: G4 }); -function H4(r15, t8 = null, e = false) { - let n = { x: v(r15, "x", "any", "bool") }, s = { axis: t8, keepDims: e }; - return T.runKernel(Ho, n, s); -} -var Ek = N({ any_: H4 }); -function K4(r15, t8 = 0) { - let o = { x: v(r15, "x", "argMax") }, n = { axis: t8 }; - return T.runKernel(Ys, o, n); -} -var Rk = N({ argMax_: K4 }); -function q4(r15, t8 = 0) { - let o = { x: v(r15, "x", "argMin") }, n = { axis: t8 }; - return T.runKernel(Qs, o, n); -} -var Dk = N({ argMin_: q4 }); -function j4(r15) { - let e = { x: v(r15, "x", "asin") }; - return T.runKernel(Ko, e); -} -var Ak = N({ asin_: j4 }); -function X4(r15) { - let e = { x: v(r15, "x", "asinh") }; - return T.runKernel(qo, e); -} -var Fk = N({ asinh_: X4 }); -function Y4(r15) { - let e = { x: v(r15, "x", "atan") }; - return T.runKernel(jo, e); -} -var Pk = N({ atan_: Y4 }); -function Q4(r15, t8) { - let e = v(r15, "a", "atan2"), o = v(t8, "b", "atan2"); - [e, o] = Oe(e, o); - let n = { a: e, b: o }; - return T.runKernel(Yo, n); -} -var Ok = N({ atan2_: Q4 }); -function Z4(r15) { - let e = { x: v(r15, "x", "atanh") }; - return T.runKernel(Xo, e); -} -var Mk = N({ atanh_: Z4 }); -function J4(r15, t8, e, o, n = "NHWC", s) { - let a = r15[3], i = [...t8, a], p = Bk(n); - return Lu(r15, i, e, s, o, null, null, p); -} -function Mw(r15, t8, e, o, n, s, a = "channelsLast") { - let [i, p] = wl(t8), u; + let o = e; + return _.runKernel(xn, o); +} +var y1 = N({ addN_: gK }); +function xK(r16, e = null, t10 = false) { + let n = { x: v(r16, "x", "all", "bool") }, s = { axis: e, keepDims: t10 }; + return _.runKernel(yn, n, s); +} +var b1 = N({ all_: xK }); +function yK(r16, e = null, t10 = false) { + let n = { x: v(r16, "x", "any", "bool") }, s = { axis: e, keepDims: t10 }; + return _.runKernel(bn, n, s); +} +var C1 = N({ any_: yK }); +function bK(r16, e = 0) { + let o = { x: v(r16, "x", "argMax") }, n = { axis: e }; + return _.runKernel(na, o, n); +} +var w1 = N({ argMax_: bK }); +function CK(r16, e = 0) { + let o = { x: v(r16, "x", "argMin") }, n = { axis: e }; + return _.runKernel(sa, o, n); +} +var S1 = N({ argMin_: CK }); +function wK(r16) { + let t10 = { x: v(r16, "x", "asin") }; + return _.runKernel(Cn, t10); +} +var I1 = N({ asin_: wK }); +function SK(r16) { + let t10 = { x: v(r16, "x", "asinh") }; + return _.runKernel(wn, t10); +} +var v1 = N({ asinh_: SK }); +function IK(r16) { + let t10 = { x: v(r16, "x", "atan") }; + return _.runKernel(Sn, t10); +} +var k1 = N({ atan_: IK }); +function vK(r16, e) { + let t10 = v(r16, "a", "atan2"), o = v(e, "b", "atan2"); + [t10, o] = Oe(t10, o); + let n = { a: t10, b: o }; + return _.runKernel(vn, n); +} +var N1 = N({ atan2_: vK }); +function kK(r16) { + let t10 = { x: v(r16, "x", "atanh") }; + return _.runKernel(In, t10); +} +var T1 = N({ atanh_: kK }); +function NK(r16, e, t10, o, n = "NHWC", s) { + let a = r16[3], i = [...e, a], p = E1(n); + return Ku(r16, i, t10, s, o, null, null, p); +} +function Qw(r16, e, t10, o, n, s, a = "channelsLast") { + let [i, p] = $c(e), u; if (a === "channelsLast") - u = [i, p, r15[3], r15[3]]; + u = [i, p, r16[3], r16[3]]; else if (a === "channelsFirst") - u = [i, p, r15[1], r15[1]]; + u = [i, p, r16[1], r16[1]]; else throw new Error(`Unknown dataFormat ${a}`); - return Lu(r15, u, e, o, n, s, false, a); + return Ku(r16, u, t10, o, n, s, false, a); } -function eH(r15, t8, e, o, n, s, a = "NDHWC") { - let [i, p, u] = Ow(t8), c, l; +function TK(r16, e, t10, o, n, s, a = "NDHWC") { + let [i, p, u] = Yw(e), l, c; if (a === "NDHWC") - l = "channelsLast", c = [i, p, u, r15[4], r15[4]]; + c = "channelsLast", l = [i, p, u, r16[4], r16[4]]; else if (a === "NCDHW") - l = "channelsFirst", c = [i, p, u, r15[1], r15[1]]; + c = "channelsFirst", l = [i, p, u, r16[1], r16[1]]; else throw new Error(`Unknown dataFormat ${a}`); - return Lk(r15, c, e, o, n, false, l, s); + return _1(r16, l, t10, o, n, false, c, s); } -function Lu(r15, t8, e, o, n, s, a = false, i = "channelsLast") { - let [p, u, c, l] = [-1, -1, -1, -1]; +function Ku(r16, e, t10, o, n, s, a = false, i = "channelsLast") { + let [p, u, l, c] = [-1, -1, -1, -1]; if (i === "channelsLast") - [p, u, c, l] = r15; + [p, u, l, c] = r16; else if (i === "channelsFirst") - [p, l, u, c] = r15; + [p, c, u, l] = r16; else throw new Error(`Unknown dataFormat ${i}`); - let [m, d, , f] = t8, [h, g] = wl(e), [x, b] = wl(o), C = rc(m, x), S = rc(d, b), { padInfo: k, outHeight: _, outWidth: E } = oH(n, u, c, h, g, C, S, s, i), R = a ? f * l : f, D; - return i === "channelsFirst" ? D = [p, R, _, E] : i === "channelsLast" && (D = [p, _, E, R]), { batchSize: p, dataFormat: i, inHeight: u, inWidth: c, inChannels: l, outHeight: _, outWidth: E, outChannels: R, padInfo: k, strideHeight: h, strideWidth: g, filterHeight: m, filterWidth: d, effectiveFilterHeight: C, effectiveFilterWidth: S, dilationHeight: x, dilationWidth: b, inShape: r15, outShape: D, filterShape: t8 }; + let [m, d, , f] = e, [h, g] = $c(t10), [x, b] = $c(o), w = ll(m, x), S = ll(d, b), { padInfo: k, outHeight: T, outWidth: E } = $K(n, u, l, h, g, w, S, s, i), R = a ? f * c : f, D; + return i === "channelsFirst" ? D = [p, R, T, E] : i === "channelsLast" && (D = [p, T, E, R]), { batchSize: p, dataFormat: i, inHeight: u, inWidth: l, inChannels: c, outHeight: T, outWidth: E, outChannels: R, padInfo: k, strideHeight: h, strideWidth: g, filterHeight: m, filterWidth: d, effectiveFilterHeight: w, effectiveFilterWidth: S, dilationHeight: x, dilationWidth: b, inShape: r16, outShape: D, filterShape: e }; } -function Lk(r15, t8, e, o, n, s = false, a = "channelsLast", i) { - let [p, u, c, l, m] = [-1, -1, -1, -1, -1]; +function _1(r16, e, t10, o, n, s = false, a = "channelsLast", i) { + let [p, u, l, c, m] = [-1, -1, -1, -1, -1]; if (a === "channelsLast") - [p, u, c, l, m] = r15; + [p, u, l, c, m] = r16; else if (a === "channelsFirst") - [p, m, u, c, l] = r15; + [p, m, u, l, c] = r16; else throw new Error(`Unknown dataFormat ${a}`); - let [d, f, h, , g] = t8, [x, b, C] = Ow(e), [S, k, _] = Ow(o), E = rc(d, S), R = rc(f, k), D = rc(h, _), { padInfo: P, outDepth: O, outHeight: M, outWidth: L } = nH(n, u, c, l, x, b, C, E, R, D, i), B = s ? g * m : g, z; - return a === "channelsFirst" ? z = [p, B, O, M, L] : a === "channelsLast" && (z = [p, O, M, L, B]), { batchSize: p, dataFormat: a, inDepth: u, inHeight: c, inWidth: l, inChannels: m, outDepth: O, outHeight: M, outWidth: L, outChannels: B, padInfo: P, strideDepth: x, strideHeight: b, strideWidth: C, filterDepth: d, filterHeight: f, filterWidth: h, effectiveFilterDepth: E, effectiveFilterHeight: R, effectiveFilterWidth: D, dilationDepth: S, dilationHeight: k, dilationWidth: _, inShape: r15, outShape: z, filterShape: t8 }; + let [d, f, h, , g] = e, [x, b, w] = Yw(t10), [S, k, T] = Yw(o), E = ll(d, S), R = ll(f, k), D = ll(h, T), { padInfo: F, outDepth: O, outHeight: M, outWidth: L } = RK(n, u, l, c, x, b, w, E, R, D, i), B = s ? g * m : g, z; + return a === "channelsFirst" ? z = [p, B, O, M, L] : a === "channelsLast" && (z = [p, O, M, L, B]), { batchSize: p, dataFormat: a, inDepth: u, inHeight: l, inWidth: c, inChannels: m, outDepth: O, outHeight: M, outWidth: L, outChannels: B, padInfo: F, strideDepth: x, strideHeight: b, strideWidth: w, filterDepth: d, filterHeight: f, filterWidth: h, effectiveFilterDepth: E, effectiveFilterHeight: R, effectiveFilterWidth: D, dilationDepth: S, dilationHeight: k, dilationWidth: T, inShape: r16, outShape: z, filterShape: e }; } -function tH(r15, t8, e, o, n) { - o == null && (o = Lw(r15, t8, e)); - let s = r15[0], a = r15[1], i = Sl((s - t8 + 2 * o) / e + 1, n), p = Sl((a - t8 + 2 * o) / e + 1, n); +function _K(r16, e, t10, o, n) { + o == null && (o = Zw(r16, e, t10)); + let s = r16[0], a = r16[1], i = Rc((s - e + 2 * o) / t10 + 1, n), p = Rc((a - e + 2 * o) / t10 + 1, n); return [i, p]; } -function rH(r15, t8, e, o, n, s) { - n == null && (n = Lw(r15, t8[0], o[0])); - let a = [0, 0, 0, e]; +function EK(r16, e, t10, o, n, s) { + n == null && (n = Zw(r16, e[0], o[0])); + let a = [0, 0, 0, t10]; for (let i = 0; i < 3; i++) - r15[i] + 2 * n >= t8[i] && (a[i] = Sl((r15[i] - t8[i] + 2 * n) / o[i] + 1, s)); + r16[i] + 2 * n >= e[i] && (a[i] = Rc((r16[i] - e[i] + 2 * n) / o[i] + 1, s)); return a; } -function Lw(r15, t8, e, o = 1) { - let n = rc(t8, o); - return Math.floor((r15[0] * (e - 1) - e + n) / 2); +function Zw(r16, e, t10, o = 1) { + let n = ll(e, o); + return Math.floor((r16[0] * (t10 - 1) - t10 + n) / 2); } -function wl(r15) { - return typeof r15 == "number" ? [r15, r15, r15] : r15.length === 2 ? [r15[0], r15[1], 1] : r15; +function $c(r16) { + return typeof r16 == "number" ? [r16, r16, r16] : r16.length === 2 ? [r16[0], r16[1], 1] : r16; } -function Ow(r15) { - return typeof r15 == "number" ? [r15, r15, r15] : r15; +function Yw(r16) { + return typeof r16 == "number" ? [r16, r16, r16] : r16; } -function rc(r15, t8) { - return t8 <= 1 ? r15 : r15 + (r15 - 1) * (t8 - 1); +function ll(r16, e) { + return e <= 1 ? r16 : r16 + (r16 - 1) * (e - 1); } -function oH(r15, t8, e, o, n, s, a, i, p) { - let u, c, l; - if (typeof r15 == "number") { - u = { top: r15, bottom: r15, left: r15, right: r15, type: r15 === 0 ? "VALID" : "NUMBER" }; - let d = tH([t8, e], s, o, r15, i); - c = d[0], l = d[1]; - } else if (r15 === "same") { - c = Math.ceil(t8 / o), l = Math.ceil(e / n); - let m = Math.max(0, (c - 1) * o + s - t8), d = Math.max(0, (l - 1) * n + a - e), f = Math.floor(m / 2), h = m - f, g = Math.floor(d / 2), x = d - g; +function $K(r16, e, t10, o, n, s, a, i, p) { + let u, l, c; + if (typeof r16 == "number") { + u = { top: r16, bottom: r16, left: r16, right: r16, type: r16 === 0 ? "VALID" : "NUMBER" }; + let d = _K([e, t10], s, o, r16, i); + l = d[0], c = d[1]; + } else if (r16 === "same") { + l = Math.ceil(e / o), c = Math.ceil(t10 / n); + let m = Math.max(0, (l - 1) * o + s - e), d = Math.max(0, (c - 1) * n + a - t10), f = Math.floor(m / 2), h = m - f, g = Math.floor(d / 2), x = d - g; u = { top: f, bottom: h, left: g, right: x, type: "SAME" }; - } else if (r15 === "valid") - u = { top: 0, bottom: 0, left: 0, right: 0, type: "VALID" }, c = Math.ceil((t8 - s + 1) / o), l = Math.ceil((e - a + 1) / n); - else if (typeof r15 == "object") { - let m = p === "channelsLast" ? r15[1][0] : r15[2][0], d = p === "channelsLast" ? r15[1][1] : r15[2][1], f = p === "channelsLast" ? r15[2][0] : r15[3][0], h = p === "channelsLast" ? r15[2][1] : r15[3][1]; - u = { top: m, bottom: d, left: f, right: h, type: m === 0 && d === 0 && f === 0 && h === 0 ? "VALID" : "EXPLICIT" }, c = Sl((t8 - s + m + d) / o + 1, i), l = Sl((e - a + f + h) / n + 1, i); + } else if (r16 === "valid") + u = { top: 0, bottom: 0, left: 0, right: 0, type: "VALID" }, l = Math.ceil((e - s + 1) / o), c = Math.ceil((t10 - a + 1) / n); + else if (typeof r16 == "object") { + let m = p === "channelsLast" ? r16[1][0] : r16[2][0], d = p === "channelsLast" ? r16[1][1] : r16[2][1], f = p === "channelsLast" ? r16[2][0] : r16[3][0], h = p === "channelsLast" ? r16[2][1] : r16[3][1]; + u = { top: m, bottom: d, left: f, right: h, type: m === 0 && d === 0 && f === 0 && h === 0 ? "VALID" : "EXPLICIT" }, l = Rc((e - s + m + d) / o + 1, i), c = Rc((t10 - a + f + h) / n + 1, i); } else - throw Error(`Unknown padding parameter: ${r15}`); - return { padInfo: u, outHeight: c, outWidth: l }; -} -function nH(r15, t8, e, o, n, s, a, i, p, u, c) { - let l, m, d, f; - if (r15 === "valid" && (r15 = 0), typeof r15 == "number") { - l = { top: r15, bottom: r15, left: r15, right: r15, front: r15, back: r15, type: r15 === 0 ? "VALID" : "NUMBER" }; - let g = rH([t8, e, o, 1], [i, p, u], 1, [n, s, a], r15, c); + throw Error(`Unknown padding parameter: ${r16}`); + return { padInfo: u, outHeight: l, outWidth: c }; +} +function RK(r16, e, t10, o, n, s, a, i, p, u, l) { + let c, m, d, f; + if (r16 === "valid" && (r16 = 0), typeof r16 == "number") { + c = { top: r16, bottom: r16, left: r16, right: r16, front: r16, back: r16, type: r16 === 0 ? "VALID" : "NUMBER" }; + let g = EK([e, t10, o, 1], [i, p, u], 1, [n, s, a], r16, l); m = g[0], d = g[1], f = g[2]; - } else if (r15 === "same") { - m = Math.ceil(t8 / n), d = Math.ceil(e / s), f = Math.ceil(o / a); - let h = (m - 1) * n + i - t8, g = (d - 1) * s + p - e, x = (f - 1) * a + u - o, b = Math.floor(h / 2), C = h - b, S = Math.floor(g / 2), k = g - S, _ = Math.floor(x / 2), E = x - _; - l = { top: S, bottom: k, left: _, right: E, front: b, back: C, type: "SAME" }; + } else if (r16 === "same") { + m = Math.ceil(e / n), d = Math.ceil(t10 / s), f = Math.ceil(o / a); + let h = (m - 1) * n + i - e, g = (d - 1) * s + p - t10, x = (f - 1) * a + u - o, b = Math.floor(h / 2), w = h - b, S = Math.floor(g / 2), k = g - S, T = Math.floor(x / 2), E = x - T; + c = { top: S, bottom: k, left: T, right: E, front: b, back: w, type: "SAME" }; } else - throw Error(`Unknown padding parameter: ${r15}`); - return { padInfo: l, outDepth: m, outHeight: d, outWidth: f }; + throw Error(`Unknown padding parameter: ${r16}`); + return { padInfo: c, outDepth: m, outHeight: d, outWidth: f }; } -function Sl(r15, t8) { - if (!t8) - return Math.trunc(r15); - switch (t8) { +function Rc(r16, e) { + if (!e) + return Math.trunc(r16); + switch (e) { case "round": - return Math.round(r15); + return Math.round(r16); case "ceil": - return Math.ceil(r15); + return Math.ceil(r16); case "floor": - return Math.floor(r15); + return Math.floor(r16); default: - throw new Error(`Unknown roundingMode ${t8}`); + throw new Error(`Unknown roundingMode ${e}`); } } -function Mu(r15) { - let [t8, e, o] = wl(r15); - return t8 === 1 && e === 1 && o === 1; +function Hu(r16) { + let [e, t10, o] = $c(r16); + return e === 1 && t10 === 1 && o === 1; } -function gr(r15, t8) { - return Mu(r15) || Mu(t8); +function br(r16, e) { + return Hu(r16) || Hu(e); } -function Ta(r15) { - return wl(r15).every((t8) => t8 > 0); +function Aa(r16) { + return $c(r16).every((e) => e > 0); } -function Bk(r15) { - if (r15 === "NHWC") +function E1(r16) { + if (r16 === "NHWC") return "channelsLast"; - if (r15 === "NCHW") + if (r16 === "NCHW") return "channelsFirst"; - throw new Error(`Unknown dataFormat ${r15}`); -} -function Lt(r15, t8, e) { - if (e != null) { - if (typeof t8 == "string") - throw Error(`Error in ${r15}: pad must be an integer when using dimRoundingMode ${e} but got pad ${t8}.`); - if (typeof t8 == "number") - $(Ka(t8), () => `Error in ${r15}: pad must be an integer when using dimRoundingMode ${e} but got pad ${t8}.`); - else if (typeof t8 == "object") - t8.forEach((o) => { + throw new Error(`Unknown dataFormat ${r16}`); +} +function zt(r16, e, t10) { + if (t10 != null) { + if (typeof e == "string") + throw Error(`Error in ${r16}: pad must be an integer when using dimRoundingMode ${t10} but got pad ${e}.`); + if (typeof e == "number") + $(Ja(e), () => `Error in ${r16}: pad must be an integer when using dimRoundingMode ${t10} but got pad ${e}.`); + else if (typeof e == "object") + e.forEach((o) => { o.forEach((n) => { - $(Ka(n), () => `Error in ${r15}: pad must be an integer when using dimRoundingMode ${e} but got pad ${n}.`); + $(Ja(n), () => `Error in ${r16}: pad must be an integer when using dimRoundingMode ${t10} but got pad ${n}.`); }); }); else - throw Error(`Error in ${r15}: Unknown padding parameter: ${t8}`); + throw Error(`Error in ${r16}: Unknown padding parameter: ${e}`); } } -function sH(r15, t8) { - let o = { x: v(r15, "x", "reshape", "string_or_numeric") }, n = { shape: t8 }; - return T.runKernel(da, o, n); +function DK(r16, e) { + let o = { x: v(r16, "x", "reshape", "string_or_numeric") }, n = { shape: e }; + return _.runKernel(Ca, o, n); } -var W = N({ reshape_: sH }); -function aH(r15, t8, e, o, n) { - let s = v(r15, "x", "avgPool", "float32"), a = 1; - $(gr(e, a), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${e} and dilations '${a}'`); +var W = N({ reshape_: DK }); +function AK(r16, e, t10, o, n) { + let s = v(r16, "x", "avgPool", "float32"), a = 1; + $(br(t10, a), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${t10} and dilations '${a}'`); let i = s, p = false; - s.rank === 3 && (p = true, i = W(s, [1, s.shape[0], s.shape[1], s.shape[2]])), $(i.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${i.rank}.`), Lt("avgPool", o, n); - let u = { x: i }, c = { filterSize: t8, strides: e, pad: o, dimRoundingMode: n }, l = T.runKernel(Qo, u, c); - return l = We(l, s.dtype), p ? W(l, [l.shape[1], l.shape[2], l.shape[3]]) : l; -} -var md = N({ avgPool_: aH }); -function iH(r15, t8, e, o, n, s = "NDHWC") { - let a = v(r15, "x", "avgPool3d", "float32"), i = a, p = false; - a.rank === 4 && (p = true, i = W(a, [1, a.shape[0], a.shape[1], a.shape[2], a.shape[3]])), $(i.rank === 5, () => `Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`), $(s === "NDHWC", () => `Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`), $(typeof e == "number" && e > 0 || Array.isArray(e) && e[0] > 0 && e[1] > 0 && e[2] > 0, () => `Error in avgPool3d: Stride must be > 0, but got '${e}'`), Lt("avgPool3d", o, n); - let u = { x: i }, c = { filterSize: t8, strides: e, pad: o, dimRoundingMode: n, dataFormat: s }, l = T.runKernel(Zs, u, c); - return l = We(l, i.dtype), p ? W(l, [l.shape[1], l.shape[2], l.shape[3], l.shape[4]]) : l; -} -var zk = N({ avgPool3d_: iH }); -function uH(r15, t8 = 0) { - $(r15.length >= 1, () => "Pass at least one tensor to concat"); - let e = ni(r15, "tensors", "concat", "string_or_numeric"); - if (e[0].dtype === "complex64" && e.forEach((s) => { + s.rank === 3 && (p = true, i = W(s, [1, s.shape[0], s.shape[1], s.shape[2]])), $(i.rank === 4, () => `Error in avgPool: x must be rank 4 but got rank ${i.rank}.`), zt("avgPool", o, n); + let u = { x: i }, l = { filterSize: e, strides: t10, pad: o, dimRoundingMode: n }, c = _.runKernel(kn, u, l); + return c = Ue(c, s.dtype), p ? W(c, [c.shape[1], c.shape[2], c.shape[3]]) : c; +} +var Id = N({ avgPool_: AK }); +function FK(r16, e, t10, o, n, s = "NDHWC") { + let a = v(r16, "x", "avgPool3d", "float32"), i = a, p = false; + a.rank === 4 && (p = true, i = W(a, [1, a.shape[0], a.shape[1], a.shape[2], a.shape[3]])), $(i.rank === 5, () => `Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`), $(s === "NDHWC", () => `Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`), $(typeof t10 == "number" && t10 > 0 || Array.isArray(t10) && t10[0] > 0 && t10[1] > 0 && t10[2] > 0, () => `Error in avgPool3d: Stride must be > 0, but got '${t10}'`), zt("avgPool3d", o, n); + let u = { x: i }, l = { filterSize: e, strides: t10, pad: o, dimRoundingMode: n, dataFormat: s }, c = _.runKernel(aa, u, l); + return c = Ue(c, i.dtype), p ? W(c, [c.shape[1], c.shape[2], c.shape[3], c.shape[4]]) : c; +} +var $1 = N({ avgPool3d_: FK }); +function PK(r16, e = 0) { + $(r16.length >= 1, () => "Pass at least one tensor to concat"); + let t10 = di(r16, "tensors", "concat", "string_or_numeric"); + if (t10[0].dtype === "complex64" && t10.forEach((s) => { if (s.dtype !== "complex64") throw new Error(`Cannot concatenate complex64 tensors with a tensor with dtype ${s.dtype}. `); - }), e.length === 1) - return Wr(e[0]); - let o = e, n = { axis: t8 }; - return T.runKernel(ta, o, n); -} -var yt = N({ concat_: uH }); -function pH(r15, t8, e = false, o = false) { - let n = v(r15, "a", "matMul"), s = v(t8, "b", "matMul"); + }), t10.length === 1) + return Xr(t10[0]); + let o = t10, n = { axis: e }; + return _.runKernel(pa, o, n); +} +var bt = N({ concat_: PK }); +function OK(r16, e, t10 = false, o = false) { + let n = v(r16, "a", "matMul"), s = v(e, "b", "matMul"); [n, s] = Oe(n, s); - let a = { a: n, b: s }, i = { transposeA: e, transposeB: o }; - return T.runKernel(Zo, a, i); + let a = { a: n, b: s }, i = { transposeA: t10, transposeB: o }; + return _.runKernel(Nn, a, i); } -var Ze = N({ matMul_: pH }); -function cH(r15) { - let e = { x: v(r15, "x", "sigmoid", "float32") }; - return T.runKernel(bs, e); +var Je = N({ matMul_: OK }); +function MK(r16) { + let t10 = { x: v(r16, "x", "sigmoid", "float32") }; + return _.runKernel(Ao, t10); } -var $a = N({ sigmoid_: cH }); -function lH(r15, t8, e) { - let o = v(r15, "x", "slice", "string_or_numeric"); +var Pa = N({ sigmoid_: MK }); +function LK(r16, e, t10) { + let o = v(r16, "x", "slice", "string_or_numeric"); if (o.rank === 0) throw new Error("Slicing scalar is not possible"); - let n = { x: o }, s = { begin: t8, size: e }; - return T.runKernel(ha, n, s); -} -var Xe = N({ slice_: lH }); -function mH(r15) { - let e = { x: v(r15, "x", "tanh", "float32") }; - return T.runKernel($s, e); -} -var Il = N({ tanh_: mH }); -function dH(r15, t8, e, o, n, s) { - let a = v(r15, "forgetBias", "basicLSTMCell"), i = v(t8, "lstmKernel", "basicLSTMCell"), p = v(e, "lstmBias", "basicLSTMCell"), u = v(o, "data", "basicLSTMCell"), c = v(n, "c", "basicLSTMCell"), l = v(s, "h", "basicLSTMCell"), m = yt([u, l], 1), d = Ze(m, i), f = Ce(d, p), h = f.shape[0], g = f.shape[1] / 4, x = [h, g], b = Xe(f, [0, 0], x), C = Xe(f, [0, g], x), S = Xe(f, [0, g * 2], x), k = Xe(f, [0, g * 3], x), _ = Ce(se($a(b), Il(C)), se(c, $a(Ce(a, S)))), E = se(Il(_), $a(k)); - return [_, E]; -} -var Vk = N({ basicLSTMCell_: dH }); -function fH(r15, t8, e) { - let o = v(r15, "x", "batchToSpaceND"), n = t8.reduce((i, p) => i * p); - $(o.rank >= 1 + t8.length, () => `input rank is ${o.rank} but should be > than blockShape.length ${t8.length}`), $(e.length === t8.length, () => `crops.length is ${e.length} but should be equal to blockShape.length ${t8.length}`), $(o.shape[0] % n === 0, () => `input tensor batch is ${o.shape[0]} but is not divisible by the product of the elements of blockShape ${t8.join(" * ")} === ${n}`); - let s = { x: o }, a = { blockShape: t8, crops: e }; - return T.runKernel(Js, s, a); -} -var dd = N({ batchToSpaceND_: fH }); -function Wk(r15) { - let t8; - return r15.rank === 0 || r15.rank === 1 ? t8 = W(r15, [1, 1, 1, r15.size]) : r15.rank === 2 ? t8 = W(r15, [1, 1, r15.shape[0], r15.shape[1]]) : r15.rank === 3 ? t8 = W(r15, [1, r15.shape[0], r15.shape[1], r15.shape[2]]) : t8 = r15, t8; -} -function hH(r15, t8, e, o, n, s) { + let n = { x: o }, s = { begin: e, size: t10 }; + return _.runKernel(_s, n, s); +} +var Ye = N({ slice_: LK }); +function BK(r16) { + let t10 = { x: v(r16, "x", "tanh", "float32") }; + return _.runKernel(Ls, t10); +} +var Dc = N({ tanh_: BK }); +function zK(r16, e, t10, o, n, s) { + let a = v(r16, "forgetBias", "basicLSTMCell"), i = v(e, "lstmKernel", "basicLSTMCell"), p = v(t10, "lstmBias", "basicLSTMCell"), u = v(o, "data", "basicLSTMCell"), l = v(n, "c", "basicLSTMCell"), c = v(s, "h", "basicLSTMCell"), m = bt([u, c], 1), d = Je(m, i), f = Ce(d, p), h = f.shape[0], g = f.shape[1] / 4, x = [h, g], b = Ye(f, [0, 0], x), w = Ye(f, [0, g], x), S = Ye(f, [0, g * 2], x), k = Ye(f, [0, g * 3], x), T = Ce(se(Pa(b), Dc(w)), se(l, Pa(Ce(a, S)))), E = se(Dc(T), Pa(k)); + return [T, E]; +} +var R1 = N({ basicLSTMCell_: zK }); +function VK(r16, e, t10) { + let o = v(r16, "x", "batchToSpaceND"), n = e.reduce((i, p) => i * p); + $(o.rank >= 1 + e.length, () => `input rank is ${o.rank} but should be > than blockShape.length ${e.length}`), $(t10.length === e.length, () => `crops.length is ${t10.length} but should be equal to blockShape.length ${e.length}`), $(o.shape[0] % n === 0, () => `input tensor batch is ${o.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${n}`); + let s = { x: o }, a = { blockShape: e, crops: t10 }; + return _.runKernel(ia, s, a); +} +var vd = N({ batchToSpaceND_: VK }); +function D1(r16) { + let e; + return r16.rank === 0 || r16.rank === 1 ? e = W(r16, [1, 1, 1, r16.size]) : r16.rank === 2 ? e = W(r16, [1, 1, r16.shape[0], r16.shape[1]]) : r16.rank === 3 ? e = W(r16, [1, r16.shape[0], r16.shape[1], r16.shape[2]]) : e = r16, e; +} +function WK(r16, e, t10, o, n, s) { s == null && (s = 1e-3); - let a = v(r15, "x", "batchNorm"), i = v(t8, "mean", "batchNorm"), p = v(e, "variance", "batchNorm"), u; + let a = v(r16, "x", "batchNorm"), i = v(e, "mean", "batchNorm"), p = v(t10, "variance", "batchNorm"), u; n != null && (u = v(n, "scale", "batchNorm")); - let c; - o != null && (c = v(o, "offset", "batchNorm")), $(i.rank === p.rank, () => "Batch normalization gradient requires mean and variance to have equal ranks."), $(c == null || i.rank === c.rank, () => "Batch normalization gradient requires mean and offset to have equal ranks."), $(u == null || i.rank === u.rank, () => "Batch normalization gradient requires mean and scale to have equal ranks."); - let m = { x: Wk(a), scale: u, offset: c, mean: i, variance: p }, d = { varianceEpsilon: s }, f = T.runKernel(In, m, d); + let l; + o != null && (l = v(o, "offset", "batchNorm")), $(i.rank === p.rank, () => "Batch normalization gradient requires mean and variance to have equal ranks."), $(l == null || i.rank === l.rank, () => "Batch normalization gradient requires mean and offset to have equal ranks."), $(u == null || i.rank === u.rank, () => "Batch normalization gradient requires mean and scale to have equal ranks."); + let m = { x: D1(a), scale: u, offset: l, mean: i, variance: p }, d = { varianceEpsilon: s }, f = _.runKernel(Hn, m, d); return W(f, a.shape); } -var ru = N({ batchNorm_: hH }); -function gH(r15, t8, e, o, n, s) { - let a = v(r15, "x", "batchNorm"), i = v(t8, "mean", "batchNorm"), p = v(e, "variance", "batchNorm"), u; +var mu = N({ batchNorm_: WK }); +function UK(r16, e, t10, o, n, s) { + let a = v(r16, "x", "batchNorm"), i = v(e, "mean", "batchNorm"), p = v(t10, "variance", "batchNorm"), u; n != null && (u = v(n, "scale", "batchNorm")); - let c; - return o != null && (c = v(o, "offset", "batchNorm")), $(a.rank === 2, () => `Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`), $(i.rank === 2 || i.rank === 1, () => `Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`), $(p.rank === 2 || p.rank === 1, () => `Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${p.rank}.`), u != null && $(u.rank === 2 || u.rank === 1, () => `Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`), c != null && $(c.rank === 2 || c.rank === 1, () => `Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`), ru(a, i, p, c, u, s); + let l; + return o != null && (l = v(o, "offset", "batchNorm")), $(a.rank === 2, () => `Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`), $(i.rank === 2 || i.rank === 1, () => `Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`), $(p.rank === 2 || p.rank === 1, () => `Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${p.rank}.`), u != null && $(u.rank === 2 || u.rank === 1, () => `Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`), l != null && $(l.rank === 2 || l.rank === 1, () => `Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${l.rank}.`), mu(a, i, p, l, u, s); } -var Uk = N({ batchNorm2d_: gH }); -function xH(r15, t8, e, o, n, s) { - let a = v(r15, "x", "batchNorm"), i = v(t8, "mean", "batchNorm"), p = v(e, "variance", "batchNorm"), u; +var A1 = N({ batchNorm2d_: UK }); +function GK(r16, e, t10, o, n, s) { + let a = v(r16, "x", "batchNorm"), i = v(e, "mean", "batchNorm"), p = v(t10, "variance", "batchNorm"), u; n != null && (u = v(n, "scale", "batchNorm")); - let c; - return o != null && (c = v(o, "offset", "batchNorm")), $(a.rank === 3, () => `Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`), $(i.rank === 3 || i.rank === 1, () => `Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`), $(p.rank === 3 || p.rank === 1, () => `Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${p.rank}.`), u != null && $(u.rank === 3 || u.rank === 1, () => `Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`), c != null && $(c.rank === 3 || c.rank === 1, () => `Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`), ru(a, i, p, c, u, s); + let l; + return o != null && (l = v(o, "offset", "batchNorm")), $(a.rank === 3, () => `Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`), $(i.rank === 3 || i.rank === 1, () => `Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`), $(p.rank === 3 || p.rank === 1, () => `Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${p.rank}.`), u != null && $(u.rank === 3 || u.rank === 1, () => `Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`), l != null && $(l.rank === 3 || l.rank === 1, () => `Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${l.rank}.`), mu(a, i, p, l, u, s); } -var Gk = N({ batchNorm3d_: xH }); -function yH(r15, t8, e, o, n, s) { - let a = v(r15, "x", "batchNorm"), i = v(t8, "mean", "batchNorm"), p = v(e, "variance", "batchNorm"), u; +var F1 = N({ batchNorm3d_: GK }); +function HK(r16, e, t10, o, n, s) { + let a = v(r16, "x", "batchNorm"), i = v(e, "mean", "batchNorm"), p = v(t10, "variance", "batchNorm"), u; n != null && (u = v(n, "scale", "batchNorm")); - let c; - return o != null && (c = v(o, "offset", "batchNorm")), $(a.rank === 4, () => `Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`), $(i.rank === 4 || i.rank === 1, () => `Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`), $(p.rank === 4 || p.rank === 1, () => `Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${p.rank}.`), u != null && $(u.rank === 4 || u.rank === 1, () => `Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`), c != null && $(c.rank === 4 || c.rank === 1, () => `Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`), ru(a, i, p, c, u, s); -} -var Hk = N({ batchNorm4d_: yH }); -function bH(r15, t8, e) { - let o = v(r15, "x", "bincount"), n = v(t8, "weights", "bincount"); - $(o.dtype === "int32", () => `Error in bincount: input dtype must be int32, but got ${o.dtype}`), $(e >= 0, () => `size must be non-negative, but got ${e}.`), $(n.size === o.size || n.size === 0, () => `Error in bincount: weights must have the same size as input or0-length, but got input shape: ${o.shape}, weights shape: ${n.shape}.`); - let s = { x: o, weights: n }, a = { size: e }; - return T.runKernel(Jo, s, a); -} -var fd = N({ bincount_: bH }); -function CH(r15, t8) { - let e = v(r15, "x", "bitwiseAnd"), o = v(t8, "y", "bitwiseAnd"); - if (!br(e.shape, o.shape)) - throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${e.shape}, y: ${o.shape}`); - if (e.dtype !== "int32" || o.dtype !== "int32") - throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${e.dtype} and type of y: ${o.dtype}`); - let n = { a: e, b: o }; - return T.runKernel(qa, n); -} -var Kk = N({ bitwiseAnd_: CH }); -function wH(r15, t8) { - let e = v(r15, "s0", "broadcastArgs", "int32"), o = v(t8, "s1", "broadcastArgs", "int32"); - if (e.rank !== 1) - throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${e.rank}`); + let l; + return o != null && (l = v(o, "offset", "batchNorm")), $(a.rank === 4, () => `Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`), $(i.rank === 4 || i.rank === 1, () => `Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`), $(p.rank === 4 || p.rank === 1, () => `Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${p.rank}.`), u != null && $(u.rank === 4 || u.rank === 1, () => `Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`), l != null && $(l.rank === 4 || l.rank === 1, () => `Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${l.rank}.`), mu(a, i, p, l, u, s); +} +var P1 = N({ batchNorm4d_: HK }); +function KK(r16, e, t10) { + let o = v(r16, "x", "bincount"), n = v(e, "weights", "bincount"); + $(o.dtype === "int32", () => `Error in bincount: input dtype must be int32, but got ${o.dtype}`), $(t10 >= 0, () => `size must be non-negative, but got ${t10}.`), $(n.size === o.size || n.size === 0, () => `Error in bincount: weights must have the same size as input or0-length, but got input shape: ${o.shape}, weights shape: ${n.shape}.`); + let s = { x: o, weights: n }, a = { size: t10 }; + return _.runKernel(Tn, s, a); +} +var kd = N({ bincount_: KK }); +function qK(r16, e) { + let t10 = v(r16, "x", "bitwiseAnd"), o = v(e, "y", "bitwiseAnd"); + if (!Sr(t10.shape, o.shape)) + throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${t10.shape}, y: ${o.shape}`); + if (t10.dtype !== "int32" || o.dtype !== "int32") + throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${t10.dtype} and type of y: ${o.dtype}`); + let n = { a: t10, b: o }; + return _.runKernel(_n, n); +} +var O1 = N({ bitwiseAnd_: qK }); +function jK(r16, e) { + let t10 = v(r16, "s0", "broadcastArgs", "int32"), o = v(e, "s1", "broadcastArgs", "int32"); + if (t10.rank !== 1) + throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${t10.rank}`); if (o.rank !== 1) throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${o.rank}`); - let n = { s0: e, s1: o }; - return T.runKernel(ea, n); -} -var qk = N({ broadcastArgs_: wH }); -function SH(r15, t8) { - let e = v(r15, "broadcastTo", "x"), o = e.shape; - if (Ct(t8), t8.length < e.rank) - throw new Error(`broadcastTo(): shape.length=${t8.length} < input.rank=${e.rank}.`); - if (t8.length > e.rank) { - let u = e.shape.slice(); - for (; u.length < t8.length; ) + let n = { s0: t10, s1: o }; + return _.runKernel(ua, n); +} +var M1 = N({ broadcastArgs_: jK }); +function XK(r16, e) { + let t10 = v(r16, "broadcastTo", "x"), o = t10.shape; + if (St(e), e.length < t10.rank) + throw new Error(`broadcastTo(): shape.length=${e.length} < input.rank=${t10.rank}.`); + if (e.length > t10.rank) { + let u = t10.shape.slice(); + for (; u.length < e.length; ) u.unshift(1); - e = W(e, u); + t10 = W(t10, u); } - let n = e.shape, s = Array.from(t8); - for (let u = t8.length - 1; u >= 0; u--) - if (n[u] === t8[u]) + let n = t10.shape, s = Array.from(e); + for (let u = e.length - 1; u >= 0; u--) + if (n[u] === e[u]) s[u] = 1; - else if (e.shape[u] !== 1) - throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${t8}].`); - if (s.map((u, c) => u > 1 ? c : -1).filter((u) => u >= 0).length === 0) - return Wr(e); - let i = { x: e }, p = { reps: s }; - return T.runKernel(uo, i, p); -} -var ou = N({ broadcastTo_: SH }); -function IH(r15) { - let e = { x: v(r15, "x", "ceil", "float32") }; - return T.runKernel(en, e); -} -var jk = N({ ceil_: IH }); -function Ea(r15, t8, e) { - Ct(r15), e = e || _i(t8); - let o = { shape: r15, value: t8, dtype: e }; - return T.runKernel(sa, {}, o); -} -function vH(r15, t8, e) { - let o = v(r15, "x", "clipByValue"); - if ($(t8 <= e, () => `Error in clip: min (${t8}) must be less than or equal to max (${e}).`), t8 === e) - return Ea(o.shape, t8, o.dtype); - let n = { x: o }, s = { clipValueMin: t8, clipValueMax: e }; - return T.runKernel(bo, n, s); -} -var Xk = N({ clipByValue_: vH }); -function kH(r15) { - return yt(r15, 0); -} -var Yk = N({ concat1d_: kH }); -function NH(r15, t8) { - return yt(r15, t8); -} -var Qk = N({ concat2d_: NH }); -function TH(r15, t8) { - return yt(r15, t8); -} -var Zk = N({ concat3d_: TH }); -function _H(r15, t8) { - return yt(r15, t8); -} -var Jk = N({ concat4d_: _H }); -function $H(r15, t8, e, o, n = "NHWC", s = [1, 1], a) { - let i = v(r15, "x", "conv2d", "float32"), p = v(t8, "filter", "conv2d", "float32"), u = i, c = false; - i.rank === 3 && (c = true, u = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), $(u.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${u.rank}.`), $(p.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ${p.rank}.`), Lt("conv2d", o, a); - let l = n === "NHWC" ? u.shape[3] : u.shape[1]; - $(l === p.shape[2], () => `Error in conv2d: depth of input (${l}) must match input depth for filter ${p.shape[2]}.`), $(gr(e, s), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`), $(Ta(s), () => "Error in conv2D: Dilated rates should be larger than 0."), $(Ta(e), () => "Error in conv2D: Strides should be larger than 0."); - let m = { x: u, filter: p }, d = { strides: e, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a }, f = T.runKernel(tn, m, d); - return c ? W(f, [f.shape[1], f.shape[2], f.shape[3]]) : f; -} -var nu = N({ conv2d_: $H }); -function EH(r15, t8, e, o, n = "NWC", s = 1, a) { - let i = v(r15, "x", "conv1d"), p = v(t8, "filter", "conv1d"), u = i, c = false; - i.rank === 2 && (c = true, u = W(i, [1, i.shape[0], i.shape[1]])), $(u.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${u.rank}.`), $(p.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ${p.rank}.`), Lt("conv1d", o, a), $(u.shape[2] === p.shape[1], () => `Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${p.shape[1]}.`), $(gr(e, s), () => `Error in conv1D: Either stride or dilation must be 1. Got stride ${e} and dilation '${s}'`), $(Ta(s), () => "Error in conv1D: Dilated rates should be larger than 0."), $(Ta(e), () => "Error in conv1D: Stride should be larger than 0."), $(n === "NWC", () => `Error in conv1d: got dataFormat of ${n} but only NWC is currently supported.`); - let l = W(p, [1, p.shape[0], p.shape[1], p.shape[2]]), m = W(u, [u.shape[0], 1, u.shape[1], u.shape[2]]), g = nu(m, l, [1, e], o, "NHWC", [1, s], a); - return c ? W(g, [g.shape[2], g.shape[3]]) : W(g, [g.shape[0], g.shape[2], g.shape[3]]); -} -var e2 = N({ conv1d_: EH }); -function RH(r15, t8, e, o, n, s = "NHWC", a) { - $(r15.length === t8.rank, () => `Length of inShape (${r15.length}) and rank of dy (${t8.rank}) must match`); - let i = r15, p = t8, u = false; - t8.rank === 3 && (u = true, p = W(t8, [1, t8.shape[0], t8.shape[1], t8.shape[2]]), i = [1, r15[0], r15[1], r15[2]]), $(i.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ${i.length}.`), $(p.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got rank ${p.rank}`), $(e.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got rank ${e.rank}`); - let c = s === "NHWC" ? i[3] : i[1], l = s === "NHWC" ? p.shape[3] : p.shape[1]; - $(c === e.shape[2], () => `Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${e.shape[2]}.`), $(l === e.shape[3], () => `Error in conv2dDerInput: depth of output (${l}) must match output depth for filter ${e.shape[3]}.`), Lt("conv2dDerInput", n, a); - let m = { dy: p, filter: e }, d = { strides: o, pad: n, dataFormat: s, dimRoundingMode: a, inputShape: i }, f = T.runKernel(rn, m, d); + else if (t10.shape[u] !== 1) + throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${e}].`); + if (s.map((u, l) => u > 1 ? l : -1).filter((u) => u >= 0).length === 0) + return Xr(t10); + let i = { x: t10 }, p = { reps: s }; + return _.runKernel(Mo, i, p); +} +var Oa = N({ broadcastTo_: XK }); +function YK(r16) { + let t10 = { x: v(r16, "x", "ceil", "float32") }; + return _.runKernel(go, t10); +} +var L1 = N({ ceil_: YK }); +function Ma(r16, e, t10) { + St(r16), t10 = t10 || Bi(e); + let o = { shape: r16, value: e, dtype: t10 }; + return _.runKernel(da, {}, o); +} +function QK(r16, e, t10) { + let o = v(r16, "x", "clipByValue"); + if ($(e <= t10, () => `Error in clip: min (${e}) must be less than or equal to max (${t10}).`), e === t10) + return Ma(o.shape, e, o.dtype); + let n = { x: o }, s = { clipValueMin: e, clipValueMax: t10 }; + return _.runKernel(Go, n, s); +} +var B1 = N({ clipByValue_: QK }); +function ZK(r16) { + return bt(r16, 0); +} +var z1 = N({ concat1d_: ZK }); +function JK(r16, e) { + return bt(r16, e); +} +var V1 = N({ concat2d_: JK }); +function eq(r16, e) { + return bt(r16, e); +} +var W1 = N({ concat3d_: eq }); +function tq(r16, e) { + return bt(r16, e); +} +var U1 = N({ concat4d_: tq }); +function rq(r16, e, t10, o, n = "NHWC", s = [1, 1], a) { + let i = v(r16, "x", "conv2d", "float32"), p = v(e, "filter", "conv2d", "float32"), u = i, l = false; + i.rank === 3 && (l = true, u = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), $(u.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${u.rank}.`), $(p.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ${p.rank}.`), zt("conv2d", o, a); + let c = n === "NHWC" ? u.shape[3] : u.shape[1]; + $(c === p.shape[2], () => `Error in conv2d: depth of input (${c}) must match input depth for filter ${p.shape[2]}.`), $(br(t10, s), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${t10} and dilations '${s}'`), $(Aa(s), () => "Error in conv2D: Dilated rates should be larger than 0."), $(Aa(t10), () => "Error in conv2D: Strides should be larger than 0."); + let m = { x: u, filter: p }, d = { strides: t10, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a }, f = _.runKernel(En, m, d); + return l ? W(f, [f.shape[1], f.shape[2], f.shape[3]]) : f; +} +var du = N({ conv2d_: rq }); +function oq(r16, e, t10, o, n = "NWC", s = 1, a) { + let i = v(r16, "x", "conv1d"), p = v(e, "filter", "conv1d"), u = i, l = false; + i.rank === 2 && (l = true, u = W(i, [1, i.shape[0], i.shape[1]])), $(u.rank === 3, () => `Error in conv1d: input must be rank 3, but got rank ${u.rank}.`), $(p.rank === 3, () => `Error in conv1d: filter must be rank 3, but got rank ${p.rank}.`), zt("conv1d", o, a), $(u.shape[2] === p.shape[1], () => `Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${p.shape[1]}.`), $(br(t10, s), () => `Error in conv1D: Either stride or dilation must be 1. Got stride ${t10} and dilation '${s}'`), $(Aa(s), () => "Error in conv1D: Dilated rates should be larger than 0."), $(Aa(t10), () => "Error in conv1D: Stride should be larger than 0."), $(n === "NWC", () => `Error in conv1d: got dataFormat of ${n} but only NWC is currently supported.`); + let c = W(p, [1, p.shape[0], p.shape[1], p.shape[2]]), m = W(u, [u.shape[0], 1, u.shape[1], u.shape[2]]), g = du(m, c, [1, t10], o, "NHWC", [1, s], a); + return l ? W(g, [g.shape[2], g.shape[3]]) : W(g, [g.shape[0], g.shape[2], g.shape[3]]); +} +var G1 = N({ conv1d_: oq }); +function nq(r16, e, t10, o, n, s = "NHWC", a) { + $(r16.length === e.rank, () => `Length of inShape (${r16.length}) and rank of dy (${e.rank}) must match`); + let i = r16, p = e, u = false; + e.rank === 3 && (u = true, p = W(e, [1, e.shape[0], e.shape[1], e.shape[2]]), i = [1, r16[0], r16[1], r16[2]]), $(i.length === 4, () => `Error in conv2dDerInput: inShape must be length 4, but got length ${i.length}.`), $(p.rank === 4, () => `Error in conv2dDerInput: dy must be rank 4, but got rank ${p.rank}`), $(t10.rank === 4, () => `Error in conv2dDerInput: filter must be rank 4, but got rank ${t10.rank}`); + let l = s === "NHWC" ? i[3] : i[1], c = s === "NHWC" ? p.shape[3] : p.shape[1]; + $(l === t10.shape[2], () => `Error in conv2dDerInput: depth of input (${l}) must match input depth for filter ${t10.shape[2]}.`), $(c === t10.shape[3], () => `Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${t10.shape[3]}.`), zt("conv2dDerInput", n, a); + let m = { dy: p, filter: t10 }, d = { strides: o, pad: n, dataFormat: s, dimRoundingMode: a, inputShape: i }, f = _.runKernel($n, m, d); return u ? W(f, [f.shape[1], f.shape[2], f.shape[3]]) : f; } -var hd = N({ conv2DBackpropInput_: RH }); -function DH(r15, t8, e, o, n, s) { - let a = v(r15, "x", "conv2dTranspose"), i = v(t8, "filter", "conv2dTranspose"); - return hd(e, a, i, o, n, "NHWC", s); +var Nd = N({ conv2DBackpropInput_: nq }); +function sq(r16, e, t10, o, n, s) { + let a = v(r16, "x", "conv2dTranspose"), i = v(e, "filter", "conv2dTranspose"); + return Nd(t10, a, i, o, n, "NHWC", s); } -var t2 = N({ conv2dTranspose_: DH }); -function AH(r15, t8, e, o, n = "NDHWC", s = [1, 1, 1]) { - let a = v(r15, "x", "conv3d"), i = v(t8, "filter", "conv3d"), p = a, u = false; - a.rank === 4 && (u = true, p = W(a, [1, a.shape[0], a.shape[1], a.shape[2], a.shape[3]])), $(p.rank === 5, () => `Error in conv3d: input must be rank 5, but got rank ${p.rank}.`), $(i.rank === 5, () => `Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`), $(p.shape[4] === i.shape[3], () => `Error in conv3d: depth of input (${p.shape[4]}) must match input depth for filter ${i.shape[3]}.`), $(gr(e, s), () => `Error in conv3D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`), $(n === "NDHWC", () => `Error in conv3d: got dataFormat of ${n} but only NDHWC is currently supported.`), $(Ta(s), () => "Error in conv3D: Dilated rates should be larger than 0."), $(Ta(e), () => "Error in conv3D: Strides should be larger than 0."); - let c = { x: p, filter: i }, l = { strides: e, pad: o, dataFormat: n, dilations: s }, m = T.runKernel(on, c, l); +var H1 = N({ conv2dTranspose_: sq }); +function aq(r16, e, t10, o, n = "NDHWC", s = [1, 1, 1]) { + let a = v(r16, "x", "conv3d"), i = v(e, "filter", "conv3d"), p = a, u = false; + a.rank === 4 && (u = true, p = W(a, [1, a.shape[0], a.shape[1], a.shape[2], a.shape[3]])), $(p.rank === 5, () => `Error in conv3d: input must be rank 5, but got rank ${p.rank}.`), $(i.rank === 5, () => `Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`), $(p.shape[4] === i.shape[3], () => `Error in conv3d: depth of input (${p.shape[4]}) must match input depth for filter ${i.shape[3]}.`), $(br(t10, s), () => `Error in conv3D: Either strides or dilations must be 1. Got strides ${t10} and dilations '${s}'`), $(n === "NDHWC", () => `Error in conv3d: got dataFormat of ${n} but only NDHWC is currently supported.`), $(Aa(s), () => "Error in conv3D: Dilated rates should be larger than 0."), $(Aa(t10), () => "Error in conv3D: Strides should be larger than 0."); + let l = { x: p, filter: i }, c = { strides: t10, pad: o, dataFormat: n, dilations: s }, m = _.runKernel(Rn, l, c); return u ? W(m, [m.shape[1], m.shape[2], m.shape[3], m.shape[4]]) : m; } -var r22 = N({ conv3d_: AH }); -function FH(r15, t8, e, o, n) { - $(r15.length === t8.rank, () => `Length of inShape (${r15.length}) and rank of dy (${t8.rank}) must match`); - let s = r15, a = t8, i = false; - t8.rank === 4 && (i = true, a = W(t8, [1, t8.shape[0], t8.shape[1], t8.shape[2], t8.shape[3]]), s = [1, r15[0], r15[1], r15[2], r15[3]]); +var K1 = N({ conv3d_: aq }); +function iq(r16, e, t10, o, n) { + $(r16.length === e.rank, () => `Length of inShape (${r16.length}) and rank of dy (${e.rank}) must match`); + let s = r16, a = e, i = false; + e.rank === 4 && (i = true, a = W(e, [1, e.shape[0], e.shape[1], e.shape[2], e.shape[3]]), s = [1, r16[0], r16[1], r16[2], r16[3]]); let p = s[4], u = a.shape[4]; - $(s.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`), $(a.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`), $(e.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got rank ${e.rank}`), $(p === e.shape[3], () => `Error in conv3dDerInput: depth of input (${p}) must match input depth for filter ${e.shape[3]}.`), $(u === e.shape[4], () => `Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${e.shape[4]}.`); - let c = { dy: a, filter: e }, l = { pad: n, strides: o, inputShape: s }, m = T.runKernel(nn, c, l); + $(s.length === 5, () => `Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`), $(a.rank === 5, () => `Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`), $(t10.rank === 5, () => `Error in conv3dDerInput: filter must be rank 5, but got rank ${t10.rank}`), $(p === t10.shape[3], () => `Error in conv3dDerInput: depth of input (${p}) must match input depth for filter ${t10.shape[3]}.`), $(u === t10.shape[4], () => `Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${t10.shape[4]}.`); + let l = { dy: a, filter: t10 }, c = { pad: n, strides: o, inputShape: s }, m = _.runKernel(Dn, l, c); return i ? W(m, [m.shape[1], m.shape[2], m.shape[3], m.shape[4]]) : m; } -var o2 = N({ conv3DBackpropInput_: FH }); -function PH(r15, t8, e, o, n) { - let s = v(r15, "x", "conv3dTranspose"), a = v(t8, "filter", "conv3dTranspose"); - return o2(e, s, a, o, n); -} -var n2 = N({ conv3dTranspose_: PH }); -function OH(r15) { - let e = { x: v(r15, "x", "cos", "float32") }; - return T.runKernel(sn, e); -} -var s2 = N({ cos_: OH }); -function MH(r15) { - let e = { x: v(r15, "x", "cosh", "float32") }; - return T.runKernel(an, e); -} -var a2 = N({ cosh_: MH }); -function LH(r15, t8 = 0, e = false, o = false) { - let s = { x: v(r15, "x", "cumprod") }, a = { axis: t8, exclusive: e, reverse: o }; - return T.runKernel(un, s, a); -} -var i2 = N({ cumprod_: LH }); -function BH(r15, t8 = 0, e = false, o = false) { - let s = { x: v(r15, "x", "cumsum") }, a = { axis: t8, exclusive: e, reverse: o }; - return T.runKernel(pn, s, a); -} -var u2 = N({ cumsum_: BH }); -function zH(r15, t8, e, o = false) { - let n = v(r15, "x", "denseBincount"), s = v(t8, "weights", "denseBincount"); - $(n.dtype === "int32", () => `Error in denseBincount: input dtype must be int32, but got ${n.dtype}`), $(n.rank <= 2, () => `Error in denseBincount: input must be at most rank 2, but got rank ${n.rank}.`), $(e >= 0, () => `size must be non-negative, but got ${e}.`), $(s.size === n.size || s.size === 0, () => `Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${n.shape}, weights shape: ${s.shape}.`); - let a = { x: n, weights: s }, i = { size: e, binaryOutput: o }; - return T.runKernel(ra, a, i); -} -var p2 = N({ denseBincount_: zH }); -function VH(r15, t8, e = "NHWC") { - let o = v(r15, "x", "depthToSpace", "float32"), n = e === "NHWC" ? o.shape[1] : o.shape[2], s = e === "NHWC" ? o.shape[2] : o.shape[3], a = e === "NHWC" ? o.shape[3] : o.shape[1]; - $(t8 > 1, () => `blockSize should be > 1 for depthToSpace, but was: ${t8}`), $(n * t8 >= 0, () => `Negative dimension size caused by overflow when multiplying - ${n} and ${t8} for depthToSpace with input shape - ${o.shape}`), $(s * t8 >= 0, () => `Negative dimension size caused by overflow when multiplying - ${s} and ${t8} for depthToSpace with input shape - ${o.shape}`), $(a % (t8 * t8) === 0, () => `Dimension size must be evenly divisible by ${t8 * t8} but is ${a} for depthToSpace with input shape ${o.shape}`); - let i = { x: o }, p = { blockSize: t8, dataFormat: e }; - return T.runKernel(ln, i, p); -} -var c2 = N({ depthToSpace_: VH }); -function WH(r15, t8, e, o, n = "NHWC", s = [1, 1], a) { - let i = v(r15, "x", "depthwiseConv2d", "float32"), p = v(t8, "filter", "depthwiseConv2d", "float32"), u = i, c = false; - i.rank === 3 && (c = true, u = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), $(u.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`), $(p.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`); - let l = n === "NHWC" ? u.shape[3] : u.shape[1]; - $(l === p.shape[2], () => `Error in depthwiseConv2d: number of input channels (${l}) must match the inChannels dimension in filter ${p.shape[2]}.`), Lt("depthwiseConv2d", o, a); - let m = { x: u, filter: p }, d = { strides: e, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a }, f = T.runKernel(mn, m, d); - return c ? W(f, [f.shape[1], f.shape[2], f.shape[3]]) : f; -} -var oc = N({ depthwiseConv2d_: WH }); -function UH(r15) { - let e = { x: v(r15, "x", "diag") }; - return T.runKernel(oa, e); -} -var l2 = N({ diag_: UH }); -function GH(r15, t8, e, o, n = [1, 1], s = "NHWC") { - let a = v(r15, "x", "dilation2d"), i = v(t8, "filter", "dilation2d"); +var q1 = N({ conv3DBackpropInput_: iq }); +function uq(r16, e, t10, o, n) { + let s = v(r16, "x", "conv3dTranspose"), a = v(e, "filter", "conv3dTranspose"); + return q1(t10, s, a, o, n); +} +var j1 = N({ conv3dTranspose_: uq }); +function pq(r16) { + let t10 = { x: v(r16, "x", "cos", "float32") }; + return _.runKernel(An, t10); +} +var X1 = N({ cos_: pq }); +function lq(r16) { + let t10 = { x: v(r16, "x", "cosh", "float32") }; + return _.runKernel(Fn, t10); +} +var Y1 = N({ cosh_: lq }); +function cq(r16, e = 0, t10 = false, o = false) { + let s = { x: v(r16, "x", "cumprod") }, a = { axis: e, exclusive: t10, reverse: o }; + return _.runKernel(Pn, s, a); +} +var Q1 = N({ cumprod_: cq }); +function mq(r16, e = 0, t10 = false, o = false) { + let s = { x: v(r16, "x", "cumsum") }, a = { axis: e, exclusive: t10, reverse: o }; + return _.runKernel(On, s, a); +} +var Z1 = N({ cumsum_: mq }); +function dq(r16, e, t10, o = false) { + let n = v(r16, "x", "denseBincount"), s = v(e, "weights", "denseBincount"); + $(n.dtype === "int32", () => `Error in denseBincount: input dtype must be int32, but got ${n.dtype}`), $(n.rank <= 2, () => `Error in denseBincount: input must be at most rank 2, but got rank ${n.rank}.`), $(t10 >= 0, () => `size must be non-negative, but got ${t10}.`), $(s.size === n.size || s.size === 0, () => `Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${n.shape}, weights shape: ${s.shape}.`); + let a = { x: n, weights: s }, i = { size: t10, binaryOutput: o }; + return _.runKernel(la, a, i); +} +var J1 = N({ denseBincount_: dq }); +function fq(r16, e, t10 = "NHWC") { + let o = v(r16, "x", "depthToSpace", "float32"), n = t10 === "NHWC" ? o.shape[1] : o.shape[2], s = t10 === "NHWC" ? o.shape[2] : o.shape[3], a = t10 === "NHWC" ? o.shape[3] : o.shape[1]; + $(e > 1, () => `blockSize should be > 1 for depthToSpace, but was: ${e}`), $(n * e >= 0, () => `Negative dimension size caused by overflow when multiplying + ${n} and ${e} for depthToSpace with input shape + ${o.shape}`), $(s * e >= 0, () => `Negative dimension size caused by overflow when multiplying + ${s} and ${e} for depthToSpace with input shape + ${o.shape}`), $(a % (e * e) === 0, () => `Dimension size must be evenly divisible by ${e * e} but is ${a} for depthToSpace with input shape ${o.shape}`); + let i = { x: o }, p = { blockSize: e, dataFormat: t10 }; + return _.runKernel(Ln, i, p); +} +var e2 = N({ depthToSpace_: fq }); +function hq(r16, e, t10, o, n = "NHWC", s = [1, 1], a) { + let i = v(r16, "x", "depthwiseConv2d", "float32"), p = v(e, "filter", "depthwiseConv2d", "float32"), u = i, l = false; + i.rank === 3 && (l = true, u = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), $(u.rank === 4, () => `Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`), $(p.rank === 4, () => `Error in depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`); + let c = n === "NHWC" ? u.shape[3] : u.shape[1]; + $(c === p.shape[2], () => `Error in depthwiseConv2d: number of input channels (${c}) must match the inChannels dimension in filter ${p.shape[2]}.`), zt("depthwiseConv2d", o, a); + let m = { x: u, filter: p }, d = { strides: t10, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a }, f = _.runKernel(Bn, m, d); + return l ? W(f, [f.shape[1], f.shape[2], f.shape[3]]) : f; +} +var cl = N({ depthwiseConv2d_: hq }); +function gq(r16) { + let t10 = { x: v(r16, "x", "diag") }; + return _.runKernel(ca, t10); +} +var t2 = N({ diag_: gq }); +function xq(r16, e, t10, o, n = [1, 1], s = "NHWC") { + let a = v(r16, "x", "dilation2d"), i = v(e, "filter", "dilation2d"); $(a.rank === 3 || a.rank === 4, () => `Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`), $(i.rank === 3, () => `Error in dilation2d: filter must be rank 3, but got rank ${i.rank}.`), $(s === "NHWC", () => `Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`); let p = a, u = false; a.rank === 3 && (p = W(a, [1, a.shape[0], a.shape[1], a.shape[2]]), u = true), $(p.shape[3] === i.shape[2], () => `Error in dilation2d: input and filter must have the same depth: ${p.shape[3]} vs ${i.shape[2]}`); - let c = { x: p, filter: i }, l = { strides: e, pad: o, dilations: n }, m = T.runKernel(dn, c, l); + let l = { x: p, filter: i }, c = { strides: t10, pad: o, dilations: n }, m = _.runKernel(zn, l, c); return u ? W(m, [m.shape[1], m.shape[2], m.shape[3]]) : m; } -var m2 = N({ dilation2d_: GH }); -var Sr = {}; -qe(Sr, { assertAndGetBroadcastShape: () => rt, getBroadcastDims: () => d2, getReductionAxes: () => gd }); -function d2(r15, t8) { - let e = r15.length, o = []; - for (let n = 0; n < e; n++) { - let s = e - 1 - n, a = r15[s] || 1; - (t8[t8.length - 1 - n] || 1) > 1 && a === 1 && o.unshift(s); +var r22 = N({ dilation2d_: xq }); +var kr = {}; +qe(kr, { assertAndGetBroadcastShape: () => rt, getBroadcastDims: () => o2, getReductionAxes: () => Td }); +function o2(r16, e) { + let t10 = r16.length, o = []; + for (let n = 0; n < t10; n++) { + let s = t10 - 1 - n, a = r16[s] || 1; + (e[e.length - 1 - n] || 1) > 1 && a === 1 && o.unshift(s); } return o; } -function gd(r15, t8) { - let e = []; - for (let o = 0; o < t8.length; o++) { - let n = r15[r15.length - o - 1], s = t8.length - o - 1, a = t8[s]; - (n == null || n === 1 && a > 1) && e.unshift(s); +function Td(r16, e) { + let t10 = []; + for (let o = 0; o < e.length; o++) { + let n = r16[r16.length - o - 1], s = e.length - o - 1, a = e[s]; + (n == null || n === 1 && a > 1) && t10.unshift(s); } - return e; + return t10; } -function rt(r15, t8) { - let e = Math.max(r15.length, t8.length), o = new Array(e); - for (let n = 0; n < e; n++) { - let s = r15[r15.length - n - 1]; +function rt(r16, e) { + let t10 = Math.max(r16.length, e.length), o = new Array(t10); + for (let n = 0; n < t10; n++) { + let s = r16[r16.length - n - 1]; s == null && (s = 1); - let a = t8[t8.length - n - 1]; + let a = e[e.length - n - 1]; if (a == null && (a = 1), s === 1) - o[e - n - 1] = a; + o[t10 - n - 1] = a; else if (a === 1) - o[e - n - 1] = s; + o[t10 - n - 1] = s; else if (s !== a) { - let i = `Operands could not be broadcast together with shapes ${r15} and ${t8}.`; + let i = `Operands could not be broadcast together with shapes ${r16} and ${e}.`; throw Error(i); } else - o[e - n - 1] = s; + o[t10 - n - 1] = s; } return o; } -function HH(r15, t8) { - let e = v(r15, "a", "equal", "string_or_numeric"), o = v(t8, "b", "equal", "string_or_numeric"); - [e, o] = Oe(e, o), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(xn, n); -} -var xd = N({ equal_: HH }); -function KH(r15, t8, e) { - let o = v(t8, "a", "where"), n = v(e, "b", "where"), s = v(r15, "condition", "where", "bool"), a = rt(rt(s.shape, o.shape), n.shape), i = ou(s, a), p = ou(o, a), u = ou(n, a), c = { condition: i, t: p, e: u }; - return T.runKernel(fa, c); -} -var co = N({ where_: KH }); -function qH(r15) { - let e = { x: v(r15, "x", "zerosLike") }; - return T.runKernel(Sa, e); -} -var Gt = N({ zerosLike_: qH }); -function jH(r15, t8) { - let e = v(r15, "a", "div"), o = v(t8, "b", "div"); - [e, o] = Oe(e, o); - let n = je(e, o), s = Gt(n), a = xd(o, s); - return co(a, s, n); -} -var f2 = N({ divNoNan_: jH }); -function XH(r15, t8) { - let e = v(r15, "t1", "dot"), o = v(t8, "t2", "dot"); - $((e.rank === 1 || e.rank === 2) && (o.rank === 1 || o.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ${e.rank} and ${o.rank}.`); - let n = e.rank === 1 ? e.size : e.shape[1], s = o.rank === 1 ? o.size : o.shape[0]; - if ($(n === s, () => `Error in dot: inner dimensions of inputs must match, but got ${n} and ${s}.`), e.rank === 1 && o.rank === 1) { - let a = W(e, [1, -1]), i = W(o, [-1, 1]), p = Ze(a, i); +function yq(r16, e) { + let t10 = v(r16, "a", "equal", "string_or_numeric"), o = v(e, "b", "equal", "string_or_numeric"); + [t10, o] = Oe(t10, o), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(xo, n); +} +var _d = N({ equal_: yq }); +function bq(r16, e, t10) { + let o = v(e, "a", "where"), n = v(t10, "b", "where"), s = v(r16, "condition", "where", "bool"), a = rt(rt(s.shape, o.shape), n.shape), i = Oa(s, a), p = Oa(o, a), u = Oa(n, a), l = { condition: i, t: p, e: u }; + return _.runKernel(wa, l); +} +var Lo = N({ where_: bq }); +function Cq(r16) { + let t10 = { x: v(r16, "x", "zerosLike") }; + return _.runKernel(_a, t10); +} +var Kt = N({ zerosLike_: Cq }); +function wq(r16, e) { + let t10 = v(r16, "a", "div"), o = v(e, "b", "div"); + [t10, o] = Oe(t10, o); + let n = Xe(t10, o), s = Kt(n), a = _d(o, s); + return Lo(a, s, n); +} +var n2 = N({ divNoNan_: wq }); +function Sq(r16, e) { + let t10 = v(r16, "t1", "dot"), o = v(e, "t2", "dot"); + $((t10.rank === 1 || t10.rank === 2) && (o.rank === 1 || o.rank === 2), () => `Error in dot: inputs must all be rank 1 or 2, but got ranks ${t10.rank} and ${o.rank}.`); + let n = t10.rank === 1 ? t10.size : t10.shape[1], s = o.rank === 1 ? o.size : o.shape[0]; + if ($(n === s, () => `Error in dot: inner dimensions of inputs must match, but got ${n} and ${s}.`), t10.rank === 1 && o.rank === 1) { + let a = W(t10, [1, -1]), i = W(o, [-1, 1]), p = Je(a, i); return W(p, []); - } else if (e.rank === 1 && o.rank === 2) { - let a = W(e, [1, -1]), i = W(o, [o.shape[0], o.shape[1]]), p = Ze(a, i); + } else if (t10.rank === 1 && o.rank === 2) { + let a = W(t10, [1, -1]), i = W(o, [o.shape[0], o.shape[1]]), p = Je(a, i); return W(p, [p.size]); - } else if (e.rank === 2 && o.rank === 1) { - let a = W(o, [-1, 1]), i = Ze(e, a); + } else if (t10.rank === 2 && o.rank === 1) { + let a = W(o, [-1, 1]), i = Je(t10, a); return W(i, [i.size]); } else { let a = W(o, [o.shape[0], o.shape[1]]); - return Ze(e, a); - } -} -var h2 = N({ dot_: XH }); -function YH(r15, ...t8) { - let e = t8.map((n, s) => v(n, `tensors${s}`, "einsum")), o = { equation: r15 }; - return T.runKernel(Li, e, o); -} -var su = N({ einsum_: YH }); -function QH(r15) { - let e = { x: v(r15, "x", "elu", "float32") }; - return T.runKernel(hn, e); -} -var yd = N({ elu_: QH }); -function ZH(r15, t8) { - let e = v(r15, "x", "ensureShape", "string_or_numeric"); - if (!QC(e.shape, t8)) - throw new Error(`EnsureShape: Shape of tensor ${e.shape} is not compatible with expected shape ${t8}`); - return r15; -} -var g2 = N({ ensureShape_: ZH }); -function JH(r15) { - let t8 = v(r15, "x", "erf"); - $(t8.dtype === "int32" || t8.dtype === "float32", () => "Input dtype must be `int32` or `float32`."), t8.dtype === "int32" && (t8 = We(t8, "float32")); - let e = { x: t8 }; - return T.runKernel(gn, e); -} -var x2 = N({ erf_: JH }); -function Bw(r15, t8) { - for (let e = 0; e < r15.length; ++e) - if (r15[r15.length - e - 1] !== t8 - 1 - e) + return Je(t10, a); + } +} +var s2 = N({ dot_: Sq }); +function Iq(r16, ...e) { + let t10 = e.map((n, s) => v(n, `tensors${s}`, "einsum")), o = { equation: r16 }; + return _.runKernel(ji, t10, o); +} +var fu = N({ einsum_: Iq }); +function vq(r16) { + let t10 = { x: v(r16, "x", "elu", "float32") }; + return _.runKernel(Wn, t10); +} +var Ed = N({ elu_: vq }); +function kq(r16, e) { + let t10 = v(r16, "x", "ensureShape", "string_or_numeric"); + if (!cw(t10.shape, e)) + throw new Error(`EnsureShape: Shape of tensor ${t10.shape} is not compatible with expected shape ${e}`); + return r16; +} +var a2 = N({ ensureShape_: kq }); +function Nq(r16) { + let e = v(r16, "x", "erf"); + $(e.dtype === "int32" || e.dtype === "float32", () => "Input dtype must be `int32` or `float32`."), e.dtype === "int32" && (e = Ue(e, "float32")); + let t10 = { x: e }; + return _.runKernel(Un, t10); +} +var i2 = N({ erf_: Nq }); +function Jw(r16, e) { + for (let t10 = 0; t10 < r16.length; ++t10) + if (r16[r16.length - t10 - 1] !== e - 1 - t10) return false; return true; } -function y2(r15, t8, e) { - let o = r15.length + t8.length, n = [], s = 0, a = 0; +function u2(r16, e, t10) { + let o = r16.length + e.length, n = [], s = 0, a = 0; for (let i = 0; i < o; i++) - e.indexOf(i) === -1 ? n.push(r15[s++]) : n.push(t8[a++]); + t10.indexOf(i) === -1 ? n.push(r16[s++]) : n.push(e[a++]); return n; } -function eK(r15, t8) { - let e = [], o = r15.length; +function Tq(r16, e) { + let t10 = [], o = r16.length; for (let s = 0; s < o; s++) - t8.indexOf(s) === -1 && e.push(r15[s]); - let n = t8.map((s) => r15[s]); - return [e, n]; + e.indexOf(s) === -1 && t10.push(r16[s]); + let n = e.map((s) => r16[s]); + return [t10, n]; } -function ai(r15, t8) { - let e = t8.map((o) => 1); - return y2(r15, e, t8); +function gi(r16, e) { + let t10 = e.map((o) => 1); + return u2(r16, t10, e); } -function tK(r15, t8, e) { - $(Bw(t8, e), () => `${r15} supports only inner-most axes for now. Got axes ${t8} and rank-${e} input.`); +function _q(r16, e, t10) { + $(Jw(e, t10), () => `${r16} supports only inner-most axes for now. Got axes ${e} and rank-${t10} input.`); } -function rK(r15, t8) { - if (Bw(r15, t8)) +function Eq(r16, e) { + if (Jw(r16, e)) return null; - let e = []; - for (let o = 0; o < t8; ++o) - r15.indexOf(o) === -1 && e.push(o); - return r15.forEach((o) => e.push(o)), e; -} -function oK(r15) { - return r15.map((t8, e) => [e, t8]).sort((t8, e) => t8[1] - e[1]).map((t8) => t8[0]); -} -function nK(r15, t8) { - let e = []; - for (let o = t8 - r15; o < t8; ++o) - e.push(o); - return e; -} -function aK(r15, t8 = null, e = false) { - let n = { x: v(r15, "x", "max") }, s = { reductionIndices: t8, keepDims: e }; - return T.runKernel(zn, n, s); -} -var Ra = N({ max_: aK }); -function iK(r15, t8 = null, e = false) { - let n = { x: v(r15, "x", "min") }, s = { axis: t8, keepDims: e }; - return T.runKernel(Gn, n, s); -} -var vl = N({ min_: iK }); -function uK(r15, t8) { - let e = v(r15, "base", "pow"), o = v(t8, "exp", "pow"); - [e, o] = Oe(e, o); - let n = { a: e, b: o }; - return T.runKernel(ts, n); -} -var ii = N({ pow_: uK }); -function ke(r15, t8) { - if ((Pt(r15) && t8 !== "string" || Array.isArray(r15)) && t8 !== "complex64") + let t10 = []; + for (let o = 0; o < e; ++o) + r16.indexOf(o) === -1 && t10.push(o); + return r16.forEach((o) => t10.push(o)), t10; +} +function $q(r16) { + return r16.map((e, t10) => [t10, e]).sort((e, t10) => e[1] - t10[1]).map((e) => e[0]); +} +function Rq(r16, e) { + let t10 = []; + for (let o = e - r16; o < e; ++o) + t10.push(o); + return t10; +} +function Aq(r16, e = null, t10 = false) { + let n = { x: v(r16, "x", "max") }, s = { reductionIndices: e, keepDims: t10 }; + return _.runKernel(os, n, s); +} +var La = N({ max_: Aq }); +function Fq(r16, e = null, t10 = false) { + let n = { x: v(r16, "x", "min") }, s = { axis: e, keepDims: t10 }; + return _.runKernel(as, n, s); +} +var Ac = N({ min_: Fq }); +function Pq(r16, e) { + let t10 = v(r16, "base", "pow"), o = v(e, "exp", "pow"); + [t10, o] = Oe(t10, o); + let n = { a: t10, b: o }; + return _.runKernel(hs, n); +} +var xi = N({ pow_: Pq }); +function ke(r16, e) { + if ((Mt(r16) && e !== "string" || Array.isArray(r16)) && e !== "complex64") throw new Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)"); - if (t8 === "string" && Pt(r15) && !(r15 instanceof Uint8Array)) + if (e === "string" && Mt(r16) && !(r16 instanceof Uint8Array)) throw new Error("When making a scalar from encoded string, the value must be `Uint8Array`."); - return wr(r15, [], [], t8); -} -function pK(r15) { - let e = { x: v(r15, "x", "sqrt", "float32") }; - return T.runKernel(ws, e); -} -var Rr = N({ sqrt_: pK }); -function cK(r15) { - let t8 = v(r15, "x", "square"), e = {}; - return T.runKernel("Square", { x: t8 }, e); -} -var Zt = N({ square_: cK }); -function lK(r15, t8 = null, e = false) { - let o = v(r15, "x", "sum"); - o.dtype === "bool" && (o = We(o, "int32")); - let n = { x: o }, s = { axis: t8, keepDims: e }; - return T.runKernel(Ss, n, s); -} -var ot = N({ sum_: lK }); -function mK(r15, t8 = "euclidean", e = null, o = false) { - r15 = v(r15, "x", "norm"); - let n = b2(r15, t8, e), s = n.shape; + return vr(r16, [], [], e); +} +function Oq(r16) { + let t10 = { x: v(r16, "x", "sqrt", "float32") }; + return _.runKernel(Fo, t10); +} +var Pr = N({ sqrt_: Oq }); +function Mq(r16) { + let e = v(r16, "x", "square"), t10 = {}; + return _.runKernel("Square", { x: e }, t10); +} +var tr = N({ square_: Mq }); +function Lq(r16, e = null, t10 = false) { + let o = v(r16, "x", "sum"); + o.dtype === "bool" && (o = Ue(o, "int32")); + let n = { x: o }, s = { axis: e, keepDims: t10 }; + return _.runKernel(As, n, s); +} +var ot = N({ sum_: Lq }); +function Bq(r16, e = "euclidean", t10 = null, o = false) { + r16 = v(r16, "x", "norm"); + let n = p2(r16, e, t10), s = n.shape; if (o) { - let a = Ti(e, r15.shape); - s = ai(n.shape, a); + let a = Li(t10, r16.shape); + s = gi(n.shape, a); } return W(n, s); } -function b2(r15, t8, e = null) { - if (r15.rank === 0) - return Qt(r15); - if (r15.rank !== 1 && e === null) - return b2(W(r15, [-1]), t8, e); - if (r15.rank === 1 || typeof e == "number" || Array.isArray(e) && e.length === 1) { - if (t8 === 1) - return ot(Qt(r15), e); - if (t8 === 1 / 0) - return Ra(Qt(r15), e); - if (t8 === -1 / 0) - return vl(Qt(r15), e); - if (t8 === "euclidean" || t8 === 2) - return Rr(ot(ii(Qt(r15), ke(2, "int32")), e)); - throw new Error(`Error in norm: invalid ord value: ${t8}`); - } - if (Array.isArray(e) && e.length === 2) { - if (t8 === 1) - return Ra(ot(Qt(r15), e[0]), e[1] - 1); - if (t8 === 1 / 0) - return Ra(ot(Qt(r15), e[1]), e[0]); - if (t8 === -1 / 0) - return vl(ot(Qt(r15), e[1]), e[0]); - if (t8 === "fro" || t8 === "euclidean") - return Rr(ot(Zt(r15), e)); - throw new Error(`Error in norm: invalid ord value: ${t8}`); - } - throw new Error(`Error in norm: invalid axis: ${e}`); -} -var Bu = N({ norm_: mK }); -function dK(r15, t8 = null, e = false) { - return Bu(r15, "euclidean", t8, e); -} -var C2 = N({ euclideanNorm_: dK }); -function fK(r15) { - let e = { x: v(r15, "x", "exp") }; - return T.runKernel(yn, e); -} -var _o = N({ exp_: fK }); -function hK(r15, t8 = 0) { - let e = v(r15, "x", "expandDims", "string_or_numeric"); - $(t8 <= e.rank, () => "Axis must be <= rank of the tensor"); - let o = { input: e }, n = { dim: t8 }; - return T.runKernel(na, o, n); -} -var Ms = N({ expandDims_: hK }); -function gK(r15) { - let e = { x: v(r15, "x", "expm1") }; - return T.runKernel(bn, e); -} -var w2 = N({ expm1_: gK }); -function xK(r15, t8) { - let e = v(r15, "x", "tile", "string_or_numeric"); - $(e.rank === t8.length, () => `Error in transpose: rank of input ${e.rank} must match length of reps ${t8}.`); - let o = { x: e }, n = { reps: t8 }; - return T.runKernel(uo, o, n); -} -var au = N({ tile_: xK }); -function yK(r15, t8, e, o = "float32") { - t8 == null && (t8 = r15); - let n = me([r15, t8], o), s = r15 <= t8 ? r15 : t8; +function p2(r16, e, t10 = null) { + if (r16.rank === 0) + return er(r16); + if (r16.rank !== 1 && t10 === null) + return p2(W(r16, [-1]), e, t10); + if (r16.rank === 1 || typeof t10 == "number" || Array.isArray(t10) && t10.length === 1) { + if (e === 1) + return ot(er(r16), t10); + if (e === 1 / 0) + return La(er(r16), t10); + if (e === -1 / 0) + return Ac(er(r16), t10); + if (e === "euclidean" || e === 2) + return Pr(ot(xi(er(r16), ke(2, "int32")), t10)); + throw new Error(`Error in norm: invalid ord value: ${e}`); + } + if (Array.isArray(t10) && t10.length === 2) { + if (e === 1) + return La(ot(er(r16), t10[0]), t10[1] - 1); + if (e === 1 / 0) + return La(ot(er(r16), t10[1]), t10[0]); + if (e === -1 / 0) + return Ac(ot(er(r16), t10[1]), t10[0]); + if (e === "fro" || e === "euclidean") + return Pr(ot(tr(r16), t10)); + throw new Error(`Error in norm: invalid ord value: ${e}`); + } + throw new Error(`Error in norm: invalid axis: ${t10}`); +} +var qu = N({ norm_: Bq }); +function zq(r16, e = null, t10 = false) { + return qu(r16, "euclidean", e, t10); +} +var l2 = N({ euclideanNorm_: zq }); +function Vq(r16) { + let t10 = { x: v(r16, "x", "exp") }; + return _.runKernel(yo, t10); +} +var Jo = N({ exp_: Vq }); +function Wq(r16, e = 0) { + let t10 = v(r16, "x", "expandDims", "string_or_numeric"); + $(e <= t10.rank, () => "Axis must be <= rank of the tensor"); + let o = { input: t10 }, n = { dim: e }; + return _.runKernel(ma, o, n); +} +var Ks = N({ expandDims_: Wq }); +function Uq(r16) { + let t10 = { x: v(r16, "x", "expm1") }; + return _.runKernel(bo, t10); +} +var c2 = N({ expm1_: Uq }); +function Gq(r16, e) { + let t10 = v(r16, "x", "tile", "string_or_numeric"); + $(t10.rank === e.length, () => `Error in transpose: rank of input ${t10.rank} must match length of reps ${e}.`); + let o = { x: t10 }, n = { reps: e }; + return _.runKernel(Mo, o, n); +} +var hu = N({ tile_: Gq }); +function Hq(r16, e, t10, o = "float32") { + e == null && (e = r16); + let n = ie([r16, e], o), s = r16 <= e ? r16 : e; for (let i = 0; i < s; ++i) n.set(1, i, i); - let a = W(n.toTensor(), [r15, t8]); - if (e == null) + let a = W(n.toTensor(), [r16, e]); + if (t10 == null) return a; - if (e.length === 1) - return au(Ms(a, 0), [e[0], 1, 1]); - if (e.length === 2) - return au(Ms(Ms(a, 0), 0), [e[0], e[1], 1, 1]); - if (e.length === 3) - return au(Ms(Ms(Ms(a, 0), 0), 0), [e[0], e[1], e[2], 1, 1]); - throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${e.length}D.`); -} -var bd = N({ eye_: yK }); -function bK(r15) { - let e = { x: v(r15, "x", "floor", "float32") }; - return T.runKernel(wn, e); -} -var Cd = N({ floor_: bK }); -function CK(r15, t8, e = 0, o = 0) { - let n = v(r15, "x", "gather"), s = v(t8, "indices", "gather", "int32"), a = { x: n, indices: s }, i = { axis: e, batchDims: o }; - return T.runKernel(aa, a, i); -} -var wd = N({ gather_: CK }); -function wK(r15, t8) { - let e = v(r15, "a", "greater", "string_or_numeric"), o = v(t8, "b", "greater", "string_or_numeric"); - [e, o] = Oe(e, o), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(kn, n); -} -var zu = N({ greater_: wK }); -function SK(r15, t8) { - let e = v(r15, "a", "greaterEqual", "string_or_numeric"), o = v(t8, "b", "greaterEqual", "string_or_numeric"); - [e, o] = Oe(e, o), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(Nn, n); -} -var Sd = N({ greaterEqual_: SK }); -function IK(r15) { - let e = { input: v(r15, "input", "imag") }; - return T.runKernel(Vi, e); -} -var iu = N({ imag_: IK }); -function vK(r15) { - let e = { x: v(r15, "x", "isFinite") }; - return T.runKernel(Tn, e); -} -var S2 = N({ isFinite_: vK }); -function kK(r15) { - let e = { x: v(r15, "x", "isInf") }; - return T.runKernel(_n, e); -} -var I2 = N({ isInf_: kK }); -function NK(r15) { - let e = { x: v(r15, "x", "isNaN") }; - return T.runKernel($n, e); -} -var v2 = N({ isNaN_: NK }); -function TK(r15, t8 = 0.2) { - let o = { x: v(r15, "x", "leakyRelu") }, n = { alpha: t8 }; - return T.runKernel(En, o, n); -} -var Id = N({ leakyRelu_: TK }); -function _K(r15, t8) { - let e = v(r15, "a", "less", "string_or_numeric"), o = v(t8, "b", "less", "string_or_numeric"); - [e, o] = Oe(e, o), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(Rn, n); -} -var kl = N({ less_: _K }); -function $K(r15, t8) { - let e = v(r15, "a", "lessEqual", "string_or_numeric"), o = v(t8, "b", "lessEqual", "string_or_numeric"); - [e, o] = Oe(e, o), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(Dn, n); -} -var nc = N({ lessEqual_: $K }); -function k2(r15, t8, e) { - if (e <= 0) + if (t10.length === 1) + return hu(Ks(a, 0), [t10[0], 1, 1]); + if (t10.length === 2) + return hu(Ks(Ks(a, 0), 0), [t10[0], t10[1], 1, 1]); + if (t10.length === 3) + return hu(Ks(Ks(Ks(a, 0), 0), 0), [t10[0], t10[1], t10[2], 1, 1]); + throw new Error(`eye() currently supports only 1D and 2D batchShapes, but received ${t10.length}D.`); +} +var $d = N({ eye_: Hq }); +function Kq(r16) { + let t10 = { x: v(r16, "x", "floor", "float32") }; + return _.runKernel(Co, t10); +} +var Rd = N({ floor_: Kq }); +function qq(r16, e, t10 = 0, o = 0) { + let n = v(r16, "x", "gather"), s = v(e, "indices", "gather", "int32"), a = { x: n, indices: s }, i = { axis: t10, batchDims: o }; + return _.runKernel(fa, a, i); +} +var Dd = N({ gather_: qq }); +function jq(r16, e) { + let t10 = v(r16, "a", "greater", "string_or_numeric"), o = v(e, "b", "greater", "string_or_numeric"); + [t10, o] = Oe(t10, o), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(So, n); +} +var ju = N({ greater_: jq }); +function Xq(r16, e) { + let t10 = v(r16, "a", "greaterEqual", "string_or_numeric"), o = v(e, "b", "greaterEqual", "string_or_numeric"); + [t10, o] = Oe(t10, o), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(Io, n); +} +var Ad = N({ greaterEqual_: Xq }); +function Yq(r16) { + let t10 = { input: v(r16, "input", "imag") }; + return _.runKernel(Qi, t10); +} +var gu = N({ imag_: Yq }); +function Qq(r16) { + let t10 = { x: v(r16, "x", "isFinite") }; + return _.runKernel(qn, t10); +} +var m2 = N({ isFinite_: Qq }); +function Zq(r16) { + let t10 = { x: v(r16, "x", "isInf") }; + return _.runKernel(jn, t10); +} +var d2 = N({ isInf_: Zq }); +function Jq(r16) { + let t10 = { x: v(r16, "x", "isNaN") }; + return _.runKernel(Xn, t10); +} +var f2 = N({ isNaN_: Jq }); +function e6(r16, e = 0.2) { + let o = { x: v(r16, "x", "leakyRelu") }, n = { alpha: e }; + return _.runKernel(Yn, o, n); +} +var Fd = N({ leakyRelu_: e6 }); +function t6(r16, e) { + let t10 = v(r16, "a", "less", "string_or_numeric"), o = v(e, "b", "less", "string_or_numeric"); + [t10, o] = Oe(t10, o), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(ko, n); +} +var Fc = N({ less_: t6 }); +function r6(r16, e) { + let t10 = v(r16, "a", "lessEqual", "string_or_numeric"), o = v(e, "b", "lessEqual", "string_or_numeric"); + [t10, o] = Oe(t10, o), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(No, n); +} +var ml = N({ lessEqual_: r6 }); +function h2(r16, e, t10) { + if (t10 <= 0) throw new Error("The number of values should be positive."); - let o = { start: r15, stop: t8, num: e }; - return T.runKernel(An, {}, o); + let o = { start: r16, stop: e, num: t10 }; + return _.runKernel(Qn, {}, o); } -function EK(r15, t8 = 5, e = 1, o = 1, n = 0.5) { - let s = v(r15, "x", "localResponseNormalization"); +function o6(r16, e = 5, t10 = 1, o = 1, n = 0.5) { + let s = v(r16, "x", "localResponseNormalization"); $(s.rank === 4 || s.rank === 3, () => `Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${s.rank}.`), $(Ka(t8), () => `Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t8}.`); + rank ${s.rank}.`), $(Ja(e), () => `Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`); let a = s, i = false; s.rank === 3 && (i = true, a = W(s, [1, s.shape[0], s.shape[1], s.shape[2]])); - let p = { x: a }, u = { depthRadius: t8, bias: e, alpha: o, beta: n }, c = T.runKernel(Bn, p, u); - return i ? W(c, [c.shape[1], c.shape[2], c.shape[3]]) : c; -} -var N2 = N({ localResponseNormalization_: EK }); -function RK(r15) { - let e = { x: v(r15, "x", "log", "float32") }; - return T.runKernel(Fn, e); -} -var ui = N({ log_: RK }); -function DK(r15) { - let e = { x: v(r15, "x", "log1p") }; - return T.runKernel(Pn, e); -} -var vd = N({ log1p_: DK }); -function AK(r15) { - return $(qs(r15), () => "The f passed in grad(f) must be a function"), (t8, e) => { - let o = v(t8, "x", "tf.grad", "string_or_numeric"), n = e != null ? v(e, "dy", "tf.grad") : null; - return T.tidy(() => { - let { value: s, grads: a } = T.gradients(() => r15(o), [o], n); - return n != null && xt(s.shape, n.shape, "The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"), kd(a), a[0]; + let p = { x: a }, u = { depthRadius: e, bias: t10, alpha: o, beta: n }, l = _.runKernel(rs, p, u); + return i ? W(l, [l.shape[1], l.shape[2], l.shape[3]]) : l; +} +var g2 = N({ localResponseNormalization_: o6 }); +function n6(r16) { + let t10 = { x: v(r16, "x", "log", "float32") }; + return _.runKernel(To, t10); +} +var yi = N({ log_: n6 }); +function s6(r16) { + let t10 = { x: v(r16, "x", "log1p") }; + return _.runKernel(Zn, t10); +} +var Pd = N({ log1p_: s6 }); +function a6(r16) { + return $(ra(r16), () => "The f passed in grad(f) must be a function"), (e, t10) => { + let o = v(e, "x", "tf.grad", "string_or_numeric"), n = t10 != null ? v(t10, "dy", "tf.grad") : null; + return _.tidy(() => { + let { value: s, grads: a } = _.gradients(() => r16(o), [o], n); + return n != null && yt(s.shape, n.shape, "The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"), Od(a), a[0]; }); }; } -function FK(r15) { - return $(qs(r15), () => "The f passed in grads(f) must be a function"), (t8, e) => { - $(Array.isArray(t8), () => "The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"); - let o = ni(t8, "args", "tf.grads", "string_or_numeric"), n = e != null ? v(e, "dy", "tf.grads") : null; - return T.tidy(() => { - let { value: s, grads: a } = T.gradients(() => r15(...o), o, n); - return n != null && xt(s.shape, n.shape, "The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), kd(a), a; +function i6(r16) { + return $(ra(r16), () => "The f passed in grads(f) must be a function"), (e, t10) => { + $(Array.isArray(e), () => "The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s"); + let o = di(e, "args", "tf.grads", "string_or_numeric"), n = t10 != null ? v(t10, "dy", "tf.grads") : null; + return _.tidy(() => { + let { value: s, grads: a } = _.gradients(() => r16(...o), o, n); + return n != null && yt(s.shape, n.shape, "The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), Od(a), a; }); }; } -function PK(r15) { - return $(qs(r15), () => "The f passed in valueAndGrad(f) must be a function"), (t8, e) => { - $(t8 instanceof mt, () => "The x passed in valueAndGrad(f)(x) must be a tensor"), $(e == null || e instanceof mt, () => "The dy passed in valueAndGrad(f)(x, dy) must be a tensor"); - let { grads: o, value: n } = T.gradients(() => r15(t8), [t8], e); - return kd(o), { grad: o[0], value: n }; +function u6(r16) { + return $(ra(r16), () => "The f passed in valueAndGrad(f) must be a function"), (e, t10) => { + $(e instanceof dt, () => "The x passed in valueAndGrad(f)(x) must be a tensor"), $(t10 == null || t10 instanceof dt, () => "The dy passed in valueAndGrad(f)(x, dy) must be a tensor"); + let { grads: o, value: n } = _.gradients(() => r16(e), [e], t10); + return Od(o), { grad: o[0], value: n }; }; } -function OK(r15) { - return $(qs(r15), () => "The f passed in valueAndGrads(f) must be a function"), (t8, e) => { - $(Array.isArray(t8) && t8.every((n) => n instanceof mt), () => "The args passed in valueAndGrads(f)(args) must be array of tensors"), $(e == null || e instanceof mt, () => "The dy passed in valueAndGrads(f)(args, dy) must be a tensor"); - let o = T.gradients(() => r15(...t8), t8, e); - return e != null && xt(o.value.shape, e.shape, "The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), kd(o.grads), o; +function p6(r16) { + return $(ra(r16), () => "The f passed in valueAndGrads(f) must be a function"), (e, t10) => { + $(Array.isArray(e) && e.every((n) => n instanceof dt), () => "The args passed in valueAndGrads(f)(args) must be array of tensors"), $(t10 == null || t10 instanceof dt, () => "The dy passed in valueAndGrads(f)(args, dy) must be a tensor"); + let o = _.gradients(() => r16(...e), e, t10); + return t10 != null && yt(o.value.shape, t10.shape, "The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"), Od(o.grads), o; }; } -function zw(r15, t8) { - $(qs(r15), () => "The f passed in variableGrads(f) must be a function"), $(t8 == null || Array.isArray(t8) && t8.every((u) => u instanceof ri), () => "The varList passed in variableGrads(f, varList) must be an array of variables"); - let e = t8 != null; - if (!e) { - t8 = []; - for (let u in T.registeredVariables) - t8.push(T.registeredVariables[u]); - } - let o = e ? t8.filter((u) => !u.trainable) : null, n = t8.length; - t8 = t8.filter((u) => u.trainable), $(t8.length > 0, () => `variableGrads() expects at least one of the input variables to be trainable, but none of the ${n} variables is trainable.`); - let s = true, { value: a, grads: i } = T.gradients(r15, t8, null, s); +function eS(r16, e) { + $(ra(r16), () => "The f passed in variableGrads(f) must be a function"), $(e == null || Array.isArray(e) && e.every((u) => u instanceof ci), () => "The varList passed in variableGrads(f, varList) must be an array of variables"); + let t10 = e != null; + if (!t10) { + e = []; + for (let u in _.registeredVariables) + e.push(_.registeredVariables[u]); + } + let o = t10 ? e.filter((u) => !u.trainable) : null, n = e.length; + e = e.filter((u) => u.trainable), $(e.length > 0, () => `variableGrads() expects at least one of the input variables to be trainable, but none of the ${n} variables is trainable.`); + let s = true, { value: a, grads: i } = _.gradients(r16, e, null, s); $(i.some((u) => u != 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()."), $(a.rank === 0, () => `The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`); let p = {}; - return t8.forEach((u, c) => { - i[c] != null && (p[u.name] = i[c]); + return e.forEach((u, l) => { + i[l] != null && (p[u.name] = i[l]); }), o != null && o.forEach((u) => p[u.name] = null), { value: a, grads: p }; } -function Ir(r15) { - return T.customGrad(r15); +function Nr(r16) { + return _.customGrad(r16); } -function kd(r15) { - if (r15.filter((e) => e == null).length > 0) +function Od(r16) { + if (r16.filter((t10) => t10 == 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 MK(r15) { - let e = { x: v(r15, "x", "neg") }; - return T.runKernel(pa, e); -} -var pr = N({ neg_: MK }); -function LK(r15) { - let e = { x: v(r15, "x", "softplus") }; - return T.runKernel(Cs, e); -} -var Nd = N({ softplus_: LK }); -function BK(r15) { - let t8 = v(r15, "x", "logSigmoid"); - return Ir((o) => ({ value: pr(Nd(pr(o))), gradFunc: (a) => se(a, $a(pr(o))) }))(t8); -} -var T2 = N({ logSigmoid_: BK }); -function zK(r15, t8) { - let e = v(r15, "a", "sub"), o = v(t8, "b", "sub"); - [e, o] = Oe(e, o); - let n = { a: e, b: o }; - return T.runKernel(Ts, n); -} -var Te = N({ sub_: zK }); -function VK(r15, t8 = -1) { - let e = v(r15, "logits", "logSoftmax"); - if (t8 === -1 && (t8 = e.rank - 1), t8 !== e.rank - 1) - throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${e.rank} and axis was ${t8}`); - return Ir((n, s) => { - let i = Ra(n, t8, true), p = Te(n, i), u = Te(We(p, "float32"), ui(ot(_o(p), t8, true))); - return s([u]), { value: u, gradFunc: (l, m) => { - let [d] = m, f = true, h = _o(d); - return Te(l, se(ot(l, t8, f), h)); +function l6(r16) { + let t10 = { x: v(r16, "x", "neg") }; + return _.runKernel(ls, t10); +} +var mr = N({ neg_: l6 }); +function c6(r16) { + let t10 = { x: v(r16, "x", "softplus") }; + return _.runKernel(Ds, t10); +} +var Md = N({ softplus_: c6 }); +function m6(r16) { + let e = v(r16, "x", "logSigmoid"); + return Nr((o) => ({ value: mr(Md(mr(o))), gradFunc: (a) => se(a, Pa(mr(o))) }))(e); +} +var x2 = N({ logSigmoid_: m6 }); +function d6(r16, e) { + let t10 = v(r16, "a", "sub"), o = v(e, "b", "sub"); + [t10, o] = Oe(t10, o); + let n = { a: t10, b: o }; + return _.runKernel(Oo, n); +} +var Te = N({ sub_: d6 }); +function f6(r16, e = -1) { + let t10 = v(r16, "logits", "logSoftmax"); + if (e === -1 && (e = t10.rank - 1), e !== t10.rank - 1) + throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${t10.rank} and axis was ${e}`); + return Nr((n, s) => { + let i = La(n, e, true), p = Te(n, i), u = Te(Ue(p, "float32"), yi(ot(Jo(p), e, true))); + return s([u]), { value: u, gradFunc: (c, m) => { + let [d] = m, f = true, h = Jo(d); + return Te(c, se(ot(c, e, f), h)); } }; - })(e); + })(t10); } -var _2 = N({ logSoftmax_: VK }); -function WK(r15, t8 = null, e = false) { - let o = v(r15, "x", "logSumExp"), n = Ti(t8, o.shape), s = Ra(o, n, true), a = Te(o, s), i = _o(a), p = ot(i, n), u = ui(p), c = Ce(W(s, u.shape), u); - if (e) { - let l = ai(c.shape, n); - return W(c, l); +var y2 = N({ logSoftmax_: f6 }); +function h6(r16, e = null, t10 = false) { + let o = v(r16, "x", "logSumExp"), n = Li(e, o.shape), s = La(o, n, true), a = Te(o, s), i = Jo(a), p = ot(i, n), u = yi(p), l = Ce(W(s, u.shape), u); + if (t10) { + let c = gi(l.shape, n); + return W(l, c); } - return c; + return l; } -var Td = N({ logSumExp_: WK }); -function UK(r15, t8) { - let e = v(r15, "a", "logicalAnd", "bool"), o = v(t8, "b", "logicalAnd", "bool"); - rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(On, n); -} -var Vu = N({ logicalAnd_: UK }); -function GK(r15) { - let e = { x: v(r15, "x", "logicalNot", "bool") }; - return T.runKernel(Mn, e); -} -var _d = N({ logicalNot_: GK }); -function HK(r15, t8) { - let e = v(r15, "a", "logicalOr", "bool"), o = v(t8, "b", "logicalOr", "bool"); - rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(Ln, n); -} -var $d = N({ logicalOr_: HK }); -function KK(r15, t8) { - let e = v(r15, "a", "logicalXor", "bool"), o = v(t8, "b", "logicalXor", "bool"); - return rt(e.shape, o.shape), Vu($d(r15, t8), _d(Vu(r15, t8))); -} -var $2 = N({ logicalXor_: KK }); -var Ed = 2147483648; -function qK(r15, t8, e = "left") { - let o = v(r15, "sortedSequence", "searchSorted"), n = v(t8, "values", "searchSorted"), s = o.shape[o.shape.length - 1], a = n.shape[n.shape.length - 1], i = W(o, [-1, s]), p = W(n, [-1, a]); +var Ld = N({ logSumExp_: h6 }); +function g6(r16, e) { + let t10 = v(r16, "a", "logicalAnd", "bool"), o = v(e, "b", "logicalAnd", "bool"); + rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(Jn, n); +} +var Xu = N({ logicalAnd_: g6 }); +function x6(r16) { + let t10 = { x: v(r16, "x", "logicalNot", "bool") }; + return _.runKernel(es, t10); +} +var Bd = N({ logicalNot_: x6 }); +function y6(r16, e) { + let t10 = v(r16, "a", "logicalOr", "bool"), o = v(e, "b", "logicalOr", "bool"); + rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(ts, n); +} +var zd = N({ logicalOr_: y6 }); +function b6(r16, e) { + let t10 = v(r16, "a", "logicalXor", "bool"), o = v(e, "b", "logicalXor", "bool"); + return rt(t10.shape, o.shape), Xu(zd(r16, e), Bd(Xu(r16, e))); +} +var b2 = N({ logicalXor_: b6 }); +var Vd = 2147483648; +function C6(r16, e, t10 = "left") { + let o = v(r16, "sortedSequence", "searchSorted"), n = v(e, "values", "searchSorted"), s = o.shape[o.shape.length - 1], a = n.shape[n.shape.length - 1], i = W(o, [-1, s]), p = W(n, [-1, a]); if (i.rank < 2) throw new Error("Sorted input argument must be at least 2-dimensional"); if (i.shape[0] !== p.shape[0]) throw new Error("Leading dimension of 'sortedSequence' and 'values' must match."); - if (He(p.shape) >= Ed) - throw new Error(`values tensor size must less than ${Ed}`); - if (i.shape[1] >= Ed) - throw new Error(`trailing dim_size must less than ${Ed} for int32 output type, was ${i.shape[1]}`); - let u = { sortedSequence: i, values: p }, c = { side: e }; - return T.runKernel(fs, u, c); -} -var Nl = N({ searchSorted_: qK }); -function E2(r15, t8) { - return Nl(r15, t8, "left"); -} -function jK(r15, t8, e, o, n) { - let s = v(r15, "x", "maxPool"), a = 1, i = s, p = false; - s.rank === 3 && (p = true, i = W(s, [1, s.shape[0], s.shape[1], s.shape[2]])), $(i.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${i.rank}.`), $(gr(e, a), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${e} and dilations '${a}'`), Lt("maxPool", o, n); - let u = { x: i }, c = { filterSize: t8, strides: e, pad: o, dimRoundingMode: n }, l = T.runKernel(Wn, u, c); - return p ? W(l, [l.shape[1], l.shape[2], l.shape[3]]) : l; -} -var Rd = N({ maxPool_: jK }); -function XK(r15, t8 = [1, 1, 1], e, o, n, s = "NDHWC") { - let a = v(r15, "x", "maxPool3d"), i = a, p = false; - a.rank === 4 && (p = true, i = W(a, [1, a.shape[0], a.shape[1], a.shape[2], a.shape[3]])), $(i.rank === 5, () => `Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`), $(s === "NDHWC", () => `Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`), Lt("maxPool3d", o, n); - let u = { x: i }, c = { filterSize: t8, strides: e, pad: o, dimRoundingMode: n, dataFormat: s }, l = T.runKernel(ia, u, c); - return p ? W(l, [l.shape[1], l.shape[2], l.shape[3], l.shape[4]]) : l; -} -var R2 = N({ maxPool3d_: XK }); -function YK(r15, t8, e, o, n = false) { - let a = { x: v(r15, "x", "maxPoolWithArgmax") }, i = { filterSize: t8, strides: e, pad: o, includeBatchInIndex: n }, p = T.runKernel(ua, a, i); + if (ze(p.shape) >= Vd) + throw new Error(`values tensor size must less than ${Vd}`); + if (i.shape[1] >= Vd) + throw new Error(`trailing dim_size must less than ${Vd} for int32 output type, was ${i.shape[1]}`); + let u = { sortedSequence: i, values: p }, l = { side: t10 }; + return _.runKernel(Ns, u, l); +} +var Pc = N({ searchSorted_: C6 }); +function C2(r16, e) { + return Pc(r16, e, "left"); +} +function w6(r16, e, t10, o, n) { + let s = v(r16, "x", "maxPool"), a = 1, i = s, p = false; + s.rank === 3 && (p = true, i = W(s, [1, s.shape[0], s.shape[1], s.shape[2]])), $(i.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${i.rank}.`), $(br(t10, a), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${t10} and dilations '${a}'`), zt("maxPool", o, n); + let u = { x: i }, l = { filterSize: e, strides: t10, pad: o, dimRoundingMode: n }, c = _.runKernel(ns, u, l); + return p ? W(c, [c.shape[1], c.shape[2], c.shape[3]]) : c; +} +var Wd = N({ maxPool_: w6 }); +function S6(r16, e = [1, 1, 1], t10, o, n, s = "NDHWC") { + let a = v(r16, "x", "maxPool3d"), i = a, p = false; + a.rank === 4 && (p = true, i = W(a, [1, a.shape[0], a.shape[1], a.shape[2], a.shape[3]])), $(i.rank === 5, () => `Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`), $(s === "NDHWC", () => `Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`), zt("maxPool3d", o, n); + let u = { x: i }, l = { filterSize: e, strides: t10, pad: o, dimRoundingMode: n, dataFormat: s }, c = _.runKernel(ha, u, l); + return p ? W(c, [c.shape[1], c.shape[2], c.shape[3], c.shape[4]]) : c; +} +var w2 = N({ maxPool3d_: S6 }); +function I6(r16, e, t10, o, n = false) { + let a = { x: v(r16, "x", "maxPoolWithArgmax") }, i = { filterSize: e, strides: t10, pad: o, includeBatchInIndex: n }, p = _.runKernel(ga, a, i); return { result: p[0], indexes: p[1] }; } -var D2 = N({ maxPoolWithArgmax_: YK }); -function QK(r15, t8) { - let e = v(r15, "a", "maximum"), o = v(t8, "b", "maximum"); - [e, o] = Oe(e, o), e.dtype === "bool" && (e = We(e, "int32"), o = We(o, "int32")), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(Vn, n); -} -var Dd = N({ maximum_: QK }); -function ZK(r15, t8 = null, e = false) { - let n = { x: v(r15, "x", "mean") }, s = { axis: t8, keepDims: e }; - return T.runKernel(Un, n, s); -} -var Wu = N({ mean_: ZK }); -function Ur(r15, t8 = "float32") { - if (Ct(r15), t8 === "complex64") { - let o = Ur(r15, "float32"), n = Ur(r15, "float32"); - return $r(o, n); - } - let e = Wp(He(r15), t8); - return T.makeTensor(e, r15, t8); -} -function Da(r15, t8 = "float32") { - if (Ct(r15), t8 === "complex64") { - let o = Da(r15, "float32"), n = Ur(r15, "float32"); - return $r(o, n); - } - let e = cl(He(r15), t8); - return T.makeTensor(e, r15, t8); -} -function A2(r15, t8, { indexing: e = "xy" } = {}) { - if (e !== "xy" && e !== "ij") - throw new TypeError(`${e} is not a valid third argument to meshgrid`); - if (r15 === void 0) +var S2 = N({ maxPoolWithArgmax_: I6 }); +function v6(r16, e) { + let t10 = v(r16, "a", "maximum"), o = v(e, "b", "maximum"); + [t10, o] = Oe(t10, o), t10.dtype === "bool" && (t10 = Ue(t10, "int32"), o = Ue(o, "int32")), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(_o, n); +} +var Ud = N({ maximum_: v6 }); +function k6(r16, e = null, t10 = false) { + let n = { x: v(r16, "x", "mean") }, s = { axis: e, keepDims: t10 }; + return _.runKernel(ss, n, s); +} +var Yu = N({ mean_: k6 }); +function Yr(r16, e = "float32") { + if (St(r16), e === "complex64") { + let o = Yr(r16, "float32"), n = Yr(r16, "float32"); + return Ar(o, n); + } + let t10 = Yp(ze(r16), e); + return _.makeTensor(t10, r16, e); +} +function Ba(r16, e = "float32") { + if (St(r16), e === "complex64") { + let o = Ba(r16, "float32"), n = Yr(r16, "float32"); + return Ar(o, n); + } + let t10 = bc(ze(r16), e); + return _.makeTensor(t10, r16, e); +} +function I2(r16, e, { indexing: t10 = "xy" } = {}) { + if (t10 !== "xy" && t10 !== "ij") + throw new TypeError(`${t10} is not a valid third argument to meshgrid`); + if (r16 === void 0) return []; - let o = v(r15, "x", "meshgrid", r15 instanceof mt ? r15.dtype : "float32"); - if (t8 === void 0) + let o = v(r16, "x", "meshgrid", r16 instanceof dt ? r16.dtype : "float32"); + if (e === void 0) return [o]; - let n = v(t8, "y", "meshgrid", t8 instanceof mt ? t8.dtype : "float32"), s = He(o.shape), a = He(n.shape); - return e === "xy" ? (o = W(o, [1, -1]), n = W(n, [-1, 1]), [Ze(Da([a, 1], o.dtype), o), Ze(n, Da([1, s], n.dtype))]) : (o = W(o, [-1, 1]), n = W(n, [1, -1]), [Ze(o, Da([1, a], o.dtype)), Ze(Da([s, 1], n.dtype), n)]); -} -function JK(r15, t8) { - let e = v(r15, "a", "minimum"), o = v(t8, "b", "minimum"); - [e, o] = Oe(e, o), e.dtype === "bool" && (e = We(e, "int32"), o = We(o, "int32")), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(Hn, n); -} -var Uu = N({ minimum_: JK }); -function eq(r15, t8, e) { - $(e === "reflect" || e === "symmetric", () => `Invalid mode. Mode must be either reflect or symmetric. Got ${e}.`); - let o = v(r15, "x", "mirrorPad"); + let n = v(e, "y", "meshgrid", e instanceof dt ? e.dtype : "float32"), s = ze(o.shape), a = ze(n.shape); + return t10 === "xy" ? (o = W(o, [1, -1]), n = W(n, [-1, 1]), [Je(Ba([a, 1], o.dtype), o), Je(n, Ba([1, s], n.dtype))]) : (o = W(o, [-1, 1]), n = W(n, [1, -1]), [Je(o, Ba([1, a], o.dtype)), Je(Ba([s, 1], n.dtype), n)]); +} +function N6(r16, e) { + let t10 = v(r16, "a", "minimum"), o = v(e, "b", "minimum"); + [t10, o] = Oe(t10, o), t10.dtype === "bool" && (t10 = Ue(t10, "int32"), o = Ue(o, "int32")), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(Eo, n); +} +var Qu = N({ minimum_: N6 }); +function T6(r16, e, t10) { + $(t10 === "reflect" || t10 === "symmetric", () => `Invalid mode. Mode must be either reflect or symmetric. Got ${t10}.`); + let o = v(r16, "x", "mirrorPad"); if (o.rank === 0) throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad"); - $(t8.length === o.rank, () => `Padding doesn't match input. Must be ${o.rank}. Got ${t8.length}.`); - let n = e === "reflect" ? 1 : 0; + $(e.length === o.rank, () => `Padding doesn't match input. Must be ${o.rank}. Got ${e.length}.`); + let n = t10 === "reflect" ? 1 : 0; for (let i = 0; i < o.rank; i++) - $(t8[i].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), $(t8[i][0] >= 0 && t8[i][0] <= o.shape[i] - n && t8[i][1] >= 0 && t8[i][1] <= o.shape[i] - n, () => `Padding in dimension ${i} cannot be greater than or equal to ${o.shape[i] - n} or less than 0 for input of shape ${o.shape}`); - let s = { paddings: t8, mode: e }, a = { x: o }; - return T.runKernel(Kn, a, s); -} -var F2 = N({ mirrorPad_: eq }); -function tq(r15, t8) { - let e = v(r15, "a", "mod"), o = v(t8, "b", "mod"); - [e, o] = Oe(e, o); - let n = { a: e, b: o }; - return T.runKernel(qn, n); -} -var P2 = N({ mod_: tq }); -function rq(r15, t8 = null, e = false) { - r15 = v(r15, "x", "moments"); - let o = Ti(t8, r15.shape), n = Wu(r15, o, e), s = n.shape; - e || (s = ai(n.shape, o)); - let a = Zt(Te(We(r15, "float32"), W(n, s))), i = Wu(a, o, e); + $(e[i].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), $(e[i][0] >= 0 && e[i][0] <= o.shape[i] - n && e[i][1] >= 0 && e[i][1] <= o.shape[i] - n, () => `Padding in dimension ${i} cannot be greater than or equal to ${o.shape[i] - n} or less than 0 for input of shape ${o.shape}`); + let s = { paddings: e, mode: t10 }, a = { x: o }; + return _.runKernel(is, a, s); +} +var v2 = N({ mirrorPad_: T6 }); +function _6(r16, e) { + let t10 = v(r16, "a", "mod"), o = v(e, "b", "mod"); + [t10, o] = Oe(t10, o); + let n = { a: t10, b: o }; + return _.runKernel(us, n); +} +var k2 = N({ mod_: _6 }); +function E6(r16, e = null, t10 = false) { + r16 = v(r16, "x", "moments"); + let o = Li(e, r16.shape), n = Yu(r16, o, t10), s = n.shape; + t10 || (s = gi(n.shape, o)); + let a = tr(Te(Ue(r16, "float32"), W(n, s))), i = Yu(a, o, t10); return { mean: n, variance: i }; } -var O2 = N({ moments_: rq }); -function oq(r15, t8, e, o) { - let n = v(t8, "data", "multiRNNCell"), s = ni(e, "c", "multiRNNCell"), a = ni(o, "h", "multiRNNCell"), i = n, p = []; - for (let l = 0; l < r15.length; l++) { - let m = r15[l](i, s[l], a[l]); +var N2 = N({ moments_: E6 }); +function $6(r16, e, t10, o) { + let n = v(e, "data", "multiRNNCell"), s = di(t10, "c", "multiRNNCell"), a = di(o, "h", "multiRNNCell"), i = n, p = []; + for (let c = 0; c < r16.length; c++) { + let m = r16[c](i, s[c], a[c]); p.push(m[0]), p.push(m[1]), i = m[1]; } - let u = [], c = []; - for (let l = 0; l < p.length; l += 2) - u.push(p[l]), c.push(p[l + 1]); - return [u, c]; + let u = [], l = []; + for (let c = 0; c < p.length; c += 2) + u.push(p[c]), l.push(p[c + 1]); + return [u, l]; } -var M2 = N({ multiRNNCell_: oq }); -function nq(r15, t8, e, o = false) { - let n = v(r15, "logits", "multinomial"), s = n.size, a = n.rank; +var T2 = N({ multiRNNCell_: $6 }); +function R6(r16, e, t10, o = false) { + let n = v(r16, "logits", "multinomial"), s = n.size, a = n.rank; if (s < 2) throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${s}.`); if (a > 2) throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`); - e = e || Math.random(); - let p = { logits: a === 1 ? W(n, [1, -1]) : n }, u = { numSamples: t8, seed: e, normalized: o }, c = T.runKernel(jn, p, u); - return a === 1 ? W(c, [c.size]) : c; -} -var L2 = N({ multinomial_: nq }); -function sq(r15, t8) { - let e = v(r15, "a", "notEqual", "string_or_numeric"), o = v(t8, "b", "notEqual", "string_or_numeric"); - [e, o] = Oe(e, o), rt(e.shape, o.shape); - let n = { a: e, b: o }; - return T.runKernel(Yn, n); -} -var Ad = N({ notEqual_: sq }); -function aq(r15, t8, e = 1, o = 0, n = "int32") { - if (t8 < 2) - throw new Error(`Error in oneHot: depth must be >=2, but it is ${t8}`); - let a = { indices: v(r15, "indices", "oneHot", "int32") }, i = { dtype: n, depth: t8, onValue: e, offValue: o }; - return T.runKernel(Jn, a, i); -} -var Tl = N({ oneHot_: aq }); -function iq(r15) { - let e = { x: v(r15, "x", "onesLike") }; - return T.runKernel(ca, e); -} -var B2 = N({ onesLike_: iq }); -function uq(r15, t8) { - let e = v(r15, "v1", "outerProduct"), o = v(t8, "v2", "outerProduct"); - $(e.rank === 1 && o.rank === 1, () => `Error in outerProduct: inputs must be rank 1, but got ranks ${e.rank} and ${o.rank}.`); - let n = W(e, [-1, 1]), s = W(o, [1, -1]); - return Ze(n, s); -} -var z2 = N({ outerProduct_: uq }); -function pq(r15, t8, e = 0) { - let o = v(r15, "x", "pad"); + t10 = t10 || Math.random(); + let p = { logits: a === 1 ? W(n, [1, -1]) : n }, u = { numSamples: e, seed: t10, normalized: o }, l = _.runKernel(ps, p, u); + return a === 1 ? W(l, [l.size]) : l; +} +var _2 = N({ multinomial_: R6 }); +function D6(r16, e) { + let t10 = v(r16, "a", "notEqual", "string_or_numeric"), o = v(e, "b", "notEqual", "string_or_numeric"); + [t10, o] = Oe(t10, o), rt(t10.shape, o.shape); + let n = { a: t10, b: o }; + return _.runKernel(Ro, n); +} +var Gd = N({ notEqual_: D6 }); +function A6(r16, e, t10 = 1, o = 0, n = "int32") { + if (e < 2) + throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`); + let a = { indices: v(r16, "indices", "oneHot", "int32") }, i = { dtype: n, depth: e, onValue: t10, offValue: o }; + return _.runKernel(ds, a, i); +} +var Oc = N({ oneHot_: A6 }); +function F6(r16) { + let t10 = { x: v(r16, "x", "onesLike") }; + return _.runKernel(xa, t10); +} +var E2 = N({ onesLike_: F6 }); +function P6(r16, e) { + let t10 = v(r16, "v1", "outerProduct"), o = v(e, "v2", "outerProduct"); + $(t10.rank === 1 && o.rank === 1, () => `Error in outerProduct: inputs must be rank 1, but got ranks ${t10.rank} and ${o.rank}.`); + let n = W(t10, [-1, 1]), s = W(o, [1, -1]); + return Je(n, s); +} +var $2 = N({ outerProduct_: P6 }); +function O6(r16, e, t10 = 0) { + let o = v(r16, "x", "pad"); if (o.rank === 0) throw new Error("pad(scalar) is not defined. Pass non-scalar to pad"); - let n = { paddings: t8, constantValue: e }, s = { x: o }; - return T.runKernel(es, s, n); -} -var Aa = N({ pad_: pq }); -function cq(r15, t8, e = 0) { - return $(t8.length === 2, () => "Invalid number of paddings. Must be length of 2."), Aa(r15, [t8], e); -} -var V2 = N({ pad1d_: cq }); -function lq(r15, t8, e = 0) { - return $(t8.length === 2 && t8[0].length === 2 && t8[1].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), Aa(r15, t8, e); -} -var W2 = N({ pad2d_: lq }); -function mq(r15, t8, e = 0) { - return $(t8.length === 3 && t8[0].length === 2 && t8[1].length === 2 && t8[2].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), Aa(r15, t8, e); -} -var U2 = N({ pad3d_: mq }); -function dq(r15, t8, e = 0) { - return $(t8.length === 4 && t8[0].length === 2 && t8[1].length === 2 && t8[2].length === 2 && t8[3].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), Aa(r15, t8, e); -} -var G2 = N({ pad4d_: dq }); -function fq(r15, t8, e) { - let o = v(r15, "x", "spaceToBatchND"); - $(o.rank >= 1 + t8.length, () => `input rank ${o.rank} should be > than [blockShape] ${t8.length}`), $(e.length === t8.length, () => `paddings.shape[0] ${e.length} must be equal to [blockShape] ${t8.length}`), $(o.shape.reduce((a, i, p) => p > 0 && p <= t8.length ? a && (i + e[p - 1][0] + e[p - 1][1]) % t8[p - 1] === 0 : a, true), () => `input spatial dimensions ${o.shape.slice(1)} with paddings ${e.toString()} must be divisible by blockShapes ${t8.toString()}`); - let n = { x: o }, s = { blockShape: t8, paddings: e }; - return T.runKernel(ga, n, s); -} -var Fd = N({ spaceToBatchND_: fq }); -function hq(r15, t8, e, o, n, s, a) { + let n = { paddings: e, constantValue: t10 }, s = { x: o }; + return _.runKernel(fs, s, n); +} +var za = N({ pad_: O6 }); +function M6(r16, e, t10 = 0) { + return $(e.length === 2, () => "Invalid number of paddings. Must be length of 2."), za(r16, [e], t10); +} +var R2 = N({ pad1d_: M6 }); +function L6(r16, e, t10 = 0) { + return $(e.length === 2 && e[0].length === 2 && e[1].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), za(r16, e, t10); +} +var D2 = N({ pad2d_: L6 }); +function B6(r16, e, t10 = 0) { + return $(e.length === 3 && e[0].length === 2 && e[1].length === 2 && e[2].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), za(r16, e, t10); +} +var A2 = N({ pad3d_: B6 }); +function z6(r16, e, t10 = 0) { + return $(e.length === 4 && e[0].length === 2 && e[1].length === 2 && e[2].length === 2 && e[3].length === 2, () => "Invalid number of paddings. Must be length of 2 each."), za(r16, e, t10); +} +var F2 = N({ pad4d_: z6 }); +function V6(r16, e, t10) { + let o = v(r16, "x", "spaceToBatchND"); + $(o.rank >= 1 + e.length, () => `input rank ${o.rank} should be > than [blockShape] ${e.length}`), $(t10.length === e.length, () => `paddings.shape[0] ${t10.length} must be equal to [blockShape] ${e.length}`), $(o.shape.reduce((a, i, p) => p > 0 && p <= e.length ? a && (i + t10[p - 1][0] + t10[p - 1][1]) % e[p - 1] === 0 : a, true), () => `input spatial dimensions ${o.shape.slice(1)} with paddings ${t10.toString()} must be divisible by blockShapes ${e.toString()}`); + let n = { x: o }, s = { blockShape: e, paddings: t10 }; + return _.runKernel(Sa, n, s); +} +var Hd = N({ spaceToBatchND_: V6 }); +function W6(r16, e, t10, o, n, s, a) { n == null && (n = [1, 1]), s == null && (s = 1), o === 0 && (o = "valid"); - let i = v(r15, "x", "maxPool"), p = i, u = false; - i.rank === 3 && (u = true, p = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), $(gr(s, n), () => `Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${n}'`); - let c = Mw(p.shape, t8, s, n, o), l = [c.dilationHeight, c.dilationWidth], m; - o === "same" ? m = xq([c.filterHeight, c.filterWidth], l) : m = [[0, 0], [0, 0]]; - let d = l[0] === 1 && l[1] === 1, [f, h] = gq([c.inHeight, c.inWidth], l, m), g = d ? o : "valid", x = d ? p : Fd(p, l, f), C = (e === "avg" ? () => md(x, t8, s, g, a) : () => Rd(x, t8, s, g, a))(), S = d ? C : dd(C, l, h); + let i = v(r16, "x", "maxPool"), p = i, u = false; + i.rank === 3 && (u = true, p = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), $(br(s, n), () => `Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${n}'`); + let l = Qw(p.shape, e, s, n, o), c = [l.dilationHeight, l.dilationWidth], m; + o === "same" ? m = G6([l.filterHeight, l.filterWidth], c) : m = [[0, 0], [0, 0]]; + let d = c[0] === 1 && c[1] === 1, [f, h] = U6([l.inHeight, l.inWidth], c, m), g = d ? o : "valid", x = d ? p : Hd(p, c, f), w = (t10 === "avg" ? () => Id(x, e, s, g, a) : () => Wd(x, e, s, g, a))(), S = d ? w : vd(w, c, h); return u ? W(S, [S.shape[1], S.shape[2], S.shape[3]]) : S; } -function gq(r15, t8, e) { - let o = e.map((c) => c[0]), n = e.map((c) => c[1]), s = r15.concat(o, n), a = t8.map((c, l) => (c - s[l] % c) % c), i = n.map((c, l) => c + a[l]), p = t8.map((c, l) => [o[l], i[l]]), u = t8.map((c, l) => [0, a[l]]); +function U6(r16, e, t10) { + let o = t10.map((l) => l[0]), n = t10.map((l) => l[1]), s = r16.concat(o, n), a = e.map((l, c) => (l - s[c] % l) % l), i = n.map((l, c) => l + a[c]), p = e.map((l, c) => [o[c], i[c]]), u = e.map((l, c) => [0, a[c]]); return [p, u]; } -function xq(r15, t8) { - let o = r15.map((a, i) => a + (a - 1) * (t8[i] - 1)).map((a) => a - 1), n = o.map((a) => Math.floor(a / 2)), s = o.map((a, i) => a - n[i]); +function G6(r16, e) { + let o = r16.map((a, i) => a + (a - 1) * (e[i] - 1)).map((a) => a - 1), n = o.map((a) => Math.floor(a / 2)), s = o.map((a, i) => a - n[i]); return o.map((a, i) => [n[i], s[i]]); } -var H2 = N({ pool_: hq }); -function yq(r15, t8) { - let e = v(r15, "x", "prelu"), o = v(t8, "alpha", "prelu"), n = { x: e, alpha: o }; - return T.runKernel(rs, n); -} -var Pd = N({ prelu_: yq }); -function bq(r15, t8 = null, e = false) { - let o = v(r15, "x", "prod"); - o.dtype === "bool" && (o = We(o, "int32")); - let n = { x: o }, s = { axis: t8, keepDims: e }; - return T.runKernel(os, n, s); -} -var K2 = N({ prod_: bq }); -function Cq(r15, t8, e, o) { - let n = r15.map((c, l) => v(c, `tensors${l}`, "raggedGather", "int32")), s = v(t8, "paramsDenseValues", "raggedGather"), a = v(e, "indices", "raggedGather", "int32"), i = { paramsNestedSplits: n, paramsDenseValues: s, indices: a }, p = { outputRaggedRank: o }, u = T.runKernel(Up, i, p); +var P2 = N({ pool_: W6 }); +function H6(r16, e) { + let t10 = v(r16, "x", "prelu"), o = v(e, "alpha", "prelu"), n = { x: t10, alpha: o }; + return _.runKernel(gs, n); +} +var Kd = N({ prelu_: H6 }); +function K6(r16, e = null, t10 = false) { + let o = v(r16, "x", "prod"); + o.dtype === "bool" && (o = Ue(o, "int32")); + let n = { x: o }, s = { axis: e, keepDims: t10 }; + return _.runKernel(Ho, n, s); +} +var O2 = N({ prod_: K6 }); +function q6(r16, e, t10, o) { + let n = r16.map((l, c) => v(l, `tensors${c}`, "raggedGather", "int32")), s = v(e, "paramsDenseValues", "raggedGather"), a = v(t10, "indices", "raggedGather", "int32"), i = { paramsNestedSplits: n, paramsDenseValues: s, indices: a }, p = { outputRaggedRank: o }, u = _.runKernel(Qp, i, p); return { outputNestedSplits: u.slice(0, u.length - 1), outputDenseValues: u[u.length - 1] }; } -var q2 = N({ raggedGather_: Cq }); -function wq(r15, t8, e) { - let o = v(r15, "starts", "raggedRange"), n = v(t8, "limits", "raggedRange", o.dtype), s = v(e, "deltas", "raggedRange", o.dtype), a = { starts: o, limits: n, deltas: s }, i = T.runKernel(Gp, a); +var M2 = N({ raggedGather_: q6 }); +function j6(r16, e, t10) { + let o = v(r16, "starts", "raggedRange"), n = v(e, "limits", "raggedRange", o.dtype), s = v(t10, "deltas", "raggedRange", o.dtype), a = { starts: o, limits: n, deltas: s }, i = _.runKernel(Zp, a); return { rtNestedSplits: i[0], rtDenseValues: i[1] }; } -var j2 = N({ raggedRange_: wq }); -function Sq(r15, t8, e, o, n) { - let s = v(r15, "shape", "raggedTensorToTensor", "int32"), a = v(t8, "values", "raggedTensorToTensor"), i = v(e, "defaultValue", "raggedTensorToTensor", a.dtype), p = o.map((l, m) => v(l, `tensors${m}`, "raggedTensorToTensor", "int32")), u = { shape: s, values: a, defaultValue: i, rowPartitionTensors: p }, c = { rowPartitionTypes: n }; - return T.runKernel(Hp, u, c); +var L2 = N({ raggedRange_: j6 }); +function X6(r16, e, t10, o, n) { + let s = v(r16, "shape", "raggedTensorToTensor", "int32"), a = v(e, "values", "raggedTensorToTensor"), i = v(t10, "defaultValue", "raggedTensorToTensor", a.dtype), p = o.map((c, m) => v(c, `tensors${m}`, "raggedTensorToTensor", "int32")), u = { shape: s, values: a, defaultValue: i, rowPartitionTensors: p }, l = { rowPartitionTypes: n }; + return _.runKernel(Jp, u, l); } -var X2 = N({ raggedTensorToTensor_: Sq }); -function Iq(r15, t8, e) { - Ct(r15); - let o = He(r15), n = null; - if (e == null || e === "float32") +var B2 = N({ raggedTensorToTensor_: X6 }); +function Y6(r16, e, t10) { + St(r16); + let o = ze(r16), n = null; + if (t10 == null || t10 === "float32") n = new Float32Array(o); - else if (e === "int32") + else if (t10 === "int32") n = new Int32Array(o); - else if (e === "bool") + else if (t10 === "bool") n = new Uint8Array(o); else - throw new Error(`Unknown data type ${e}`); + throw new Error(`Unknown data type ${t10}`); for (let s = 0; s < o; s++) - n[s] = t8(); - return T.makeTensor(n, r15, e); -} -var Y2 = N({ rand_: Iq }); -var zd = Lp(qw()); -var g1 = {}; -qe(g1, { TEST_EPSILON_FLOAT16: () => d1, createVideoElement: () => Oq, encodeStrings: () => h1, expectArrayBuffersEqual: () => Pq, expectArraysClose: () => Rq, expectArraysEqual: () => Aq, expectNumbersClose: () => f1, expectPromiseToFail: () => Dq, expectValuesInRange: () => Fq, play: () => Mq, testEpsilon: () => Md }); -var Eq = 1e-3; -var d1 = 0.1; -function Rq(r15, t8, e) { - return e == null && (e = Md()), jw(r15, t8, (o, n) => Xw(o, n, e)); -} -function Md() { - return T.backend.floatPrecision() === 32 ? Eq : d1; -} -function jw(r15, t8, e) { + n[s] = e(); + return _.makeTensor(n, r16, t10); +} +var z2 = N({ rand_: Y6 }); +var Qd = Kp(iS()); +var aN = {}; +qe(aN, { TEST_EPSILON_FLOAT16: () => oN, createVideoElement: () => pj, encodeStrings: () => sN, expectArrayBuffersEqual: () => uj, expectArraysClose: () => nj, expectArraysEqual: () => aj, expectNumbersClose: () => nN, expectPromiseToFail: () => sj, expectValuesInRange: () => ij, play: () => lj, testEpsilon: () => jd }); +var oj = 1e-3; +var oN = 0.1; +function nj(r16, e, t10) { + return t10 == null && (t10 = jd()), uS(r16, e, (o, n) => pS(o, n, t10)); +} +function jd() { + return _.backend.floatPrecision() === 32 ? oj : oN; +} +function uS(r16, e, t10) { let o = true; - if ((Pt(r15) || Pt(t8)) && (o = false), Pt(r15) && Pt(t8) && (o = true), o) { - let a = r15.constructor.name, i = t8.constructor.name; + if ((Mt(r16) || Mt(e)) && (o = false), Mt(r16) && Mt(e) && (o = true), o) { + let a = r16.constructor.name, i = e.constructor.name; if (a !== i) throw new Error(`Arrays are of different type. Actual: ${a}. Expected: ${i}`); } - if (Array.isArray(r15) && Array.isArray(t8)) { - let a = sr(r15), i = sr(t8); - if (!br(a, i)) + if (Array.isArray(r16) && Array.isArray(e)) { + let a = ur(r16), i = ur(e); + if (!Sr(a, i)) throw new Error(`Arrays have different shapes. Actual: [${a}]. Expected: [${i}]`); } - let n = Pt(r15) ? r15 : Fs(r15), s = Pt(t8) ? t8 : Fs(t8); + let n = Mt(r16) ? r16 : Us(r16), s = Mt(e) ? e : Us(e); if (n.length !== s.length) throw new Error(`Arrays have different lengths actual: ${n.length} vs expected: ${s.length}. Actual: ${n}. Expected: ${s}.`); for (let a = 0; a < s.length; ++a) { let i = n[a], p = s[a]; - if (!e(i, p)) + if (!t10(i, p)) throw new Error(`Arrays differ: actual[${a}] = ${i}, expected[${a}] = ${p}. Actual: ${n}. Expected: ${s}.`); } typeof expect != "undefined" && expect().nothing(); } -function Dq(r15, t8) { - r15().then(() => t8.fail(), () => t8()), typeof expect != "undefined" && expect().nothing(); +function sj(r16, e) { + r16().then(() => e.fail(), () => e()), typeof expect != "undefined" && expect().nothing(); } -function Aq(r15, t8) { - let e = typeof t8 == "string" || typeof t8 == "number" || typeof t8 == "boolean" ? [t8] : t8; - return zo(r15) || zo(r15[0]) || zo(t8) || zo(t8[0]) ? jw(r15, e, (o, n) => o == n) : jw(r15, t8, (o, n) => Xw(o, n, 0)); +function aj(r16, e) { + let t10 = typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? [e] : e; + return dn(r16) || dn(r16[0]) || dn(e) || dn(e[0]) ? uS(r16, t10, (o, n) => o == n) : uS(r16, e, (o, n) => pS(o, n, 0)); } -function f1(r15, t8, e) { - if (e == null && (e = Md()), !Xw(r15, t8, e)) - throw new Error(`Numbers differ: actual === ${r15}, expected === ${t8}`); +function nN(r16, e, t10) { + if (t10 == null && (t10 = jd()), !pS(r16, e, t10)) + throw new Error(`Numbers differ: actual === ${r16}, expected === ${e}`); typeof expect != "undefined" && expect().nothing(); } -function Xw(r15, t8, e) { - return !isFinite(r15) && !isFinite(t8) ? true : !(isNaN(r15) || isNaN(t8) || Math.abs(r15 - t8) > e); +function pS(r16, e, t10) { + return !isFinite(r16) && !isFinite(e) ? true : !(isNaN(r16) || isNaN(e) || Math.abs(r16 - e) > t10); } -function Fq(r15, t8, e) { - for (let o = 0; o < r15.length; o++) - if (r15[o] < t8 || r15[o] > e) - throw new Error(`Value out of range:${r15[o]} low: ${t8}, high: ${e}`); +function ij(r16, e, t10) { + for (let o = 0; o < r16.length; o++) + if (r16[o] < e || r16[o] > t10) + throw new Error(`Value out of range:${r16[o]} low: ${e}, high: ${t10}`); } -function Pq(r15, t8) { - let e = new Float32Array(r15), o = new Float32Array(t8); - if (e.length !== o.length) - throw new Error(`Expected ArrayBuffer to be of length ${o.length}, but it was ${e.length}`); +function uj(r16, e) { + let t10 = new Float32Array(r16), o = new Float32Array(e); + if (t10.length !== o.length) + throw new Error(`Expected ArrayBuffer to be of length ${o.length}, but it was ${t10.length}`); for (let n = 0; n < o.length; n++) - if (e[n] !== o[n]) - throw new Error(`Expected ArrayBuffer value at ${n} to be ${o[n]} but got ${e[n]} instead`); + if (t10[n] !== o[n]) + throw new Error(`Expected ArrayBuffer value at ${n} to be ${o[n]} but got ${t10[n]} instead`); } -function h1(r15) { - for (let t8 = 0; t8 < r15.length; t8++) { - let e = r15[t8]; - Array.isArray(e) ? h1(e) : r15[t8] = Zi(e); +function sN(r16) { + for (let e = 0; e < r16.length; e++) { + let t10 = r16[e]; + Array.isArray(t10) ? sN(t10) : r16[e] = iu(t10); } - return r15; + return r16; } -function Oq(r15) { - let t8 = document.createElement("video"); - return "playsInline" in t8 && (t8.playsInline = true), t8.muted = true, t8.loop = true, t8.style.position = "fixed", t8.style.left = "0px", t8.style.top = "0px", t8.preload = "auto", t8.appendChild(r15), new Promise((e) => { - t8.addEventListener("loadeddata", (o) => e(t8)), t8.load(); +function pj(r16) { + let e = document.createElement("video"); + return "playsInline" in e && (e.playsInline = true), e.muted = true, e.loop = true, e.style.position = "fixed", e.style.left = "0px", e.style.top = "0px", e.preload = "auto", e.appendChild(r16), new Promise((t10) => { + e.addEventListener("loadeddata", (o) => t10(e)), e.load(); }); } -async function Mq(r15) { - await r15.play(), "requestVideoFrameCallback" in r15 && await new Promise((t8) => { - r15.requestVideoFrameCallback(t8); +async function lj(r16) { + await r16.play(), "requestVideoFrameCallback" in r16 && await new Promise((e) => { + r16.requestVideoFrameCallback(e); }); } -var Hu = class { - constructor(t8, e, o, n, s) { - this.mean = t8, this.stdDev = e, this.dtype = o, this.nextVal = NaN, this.truncated = n, this.truncated && (this.upper = this.mean + this.stdDev * 2, this.lower = this.mean - this.stdDev * 2); +var Ju = class { + constructor(e, t10, o, n, s) { + this.mean = e, this.stdDev = t10, this.dtype = o, this.nextVal = NaN, this.truncated = n, this.truncated && (this.upper = this.mean + this.stdDev * 2, this.lower = this.mean - this.stdDev * 2); let a = s || Math.random(); - this.random = zd.alea(a.toString()); + this.random = Qd.alea(a.toString()); } nextValue() { if (!isNaN(this.nextVal)) { let n = this.nextVal; return this.nextVal = NaN, n; } - let t8, e, o = false; + let e, t10, o = false; for (; !o; ) { let n, s, a; do n = 2 * this.random() - 1, s = 2 * this.random() - 1, a = n * n + s * s; while (a >= 1 || a === 0); let i = Math.sqrt(-2 * Math.log(a) / a); - t8 = this.mean + this.stdDev * n * i, e = this.mean + this.stdDev * s * i, (!this.truncated || this.isValidTruncated(t8)) && (o = true); + e = this.mean + this.stdDev * n * i, t10 = this.mean + this.stdDev * s * i, (!this.truncated || this.isValidTruncated(e)) && (o = true); } - return (!this.truncated || this.isValidTruncated(e)) && (this.nextVal = this.convertValue(e)), this.convertValue(t8); + return (!this.truncated || this.isValidTruncated(t10)) && (this.nextVal = this.convertValue(t10)), this.convertValue(e); } - convertValue(t8) { - return this.dtype == null || this.dtype === "float32" ? t8 : Math.round(t8); + convertValue(e) { + return this.dtype == null || this.dtype === "float32" ? e : Math.round(e); } - isValidTruncated(t8) { - return t8 <= this.upper && t8 >= this.lower; + isValidTruncated(e) { + return e <= this.upper && e >= this.lower; } }; -var Ld = class { - constructor(t8, e, o, n) { - this.alpha = t8, this.beta = 1 / e, this.dtype = o; +var Xd = class { + constructor(e, t10, o, n) { + this.alpha = e, this.beta = 1 / t10, this.dtype = o; let s = n || Math.random(); - this.randu = zd.alea(s.toString()), this.randn = new Hu(0, 1, o, false, this.randu()), t8 < 1 ? this.d = t8 + 2 / 3 : this.d = t8 - 1 / 3, this.c = 1 / Math.sqrt(9 * this.d); + this.randu = Qd.alea(s.toString()), this.randn = new Ju(0, 1, o, false, this.randu()), e < 1 ? this.d = e + 2 / 3 : this.d = e - 1 / 3, this.c = 1 / Math.sqrt(9 * this.d); } nextValue() { - let t8, e, o, n, s, a; + let e, t10, o, n, s, a; for (; ; ) { do n = this.randn.nextValue(), a = 1 + this.c * n; while (a <= 0); - if (a *= a * a, t8 = n * n, e = 1 - 0.331 * t8 * t8, o = 0.5 * t8 + this.d * (1 - a + Math.log(a)), s = this.randu(), s < e || Math.log(s) < o) + if (a *= a * a, e = n * n, t10 = 1 - 0.331 * e * e, o = 0.5 * e + this.d * (1 - a + Math.log(a)), s = this.randu(), s < t10 || Math.log(s) < o) break; } return a = 1 / this.beta * this.d * a, this.alpha < 1 && (a *= Math.pow(this.randu(), 1 / this.alpha)), this.convertValue(a); } - convertValue(t8) { - return this.dtype === "float32" ? t8 : Math.round(t8); + convertValue(e) { + return this.dtype === "float32" ? e : Math.round(e); } }; -var Bd = class { - constructor(t8 = 0, e = 1, o, n) { - if (this.canReturnFloat = () => this.dtype == null || this.dtype === "float32", this.min = t8, this.range = e - t8, this.dtype = o, n == null && (n = Math.random()), typeof n == "number" && (n = n.toString()), !this.canReturnFloat() && this.range <= 1) - throw new Error(`The difference between ${t8} - ${e} <= 1 and dtype is not float`); - this.random = zd.alea(n); +var Yd = class { + constructor(e = 0, t10 = 1, o, n) { + if (this.canReturnFloat = () => this.dtype == null || this.dtype === "float32", this.min = e, this.range = t10 - e, this.dtype = o, n == null && (n = Math.random()), typeof n == "number" && (n = n.toString()), !this.canReturnFloat() && this.range <= 1) + throw new Error(`The difference between ${e} - ${t10} <= 1 and dtype is not float`); + this.random = Qd.alea(n); } - convertValue(t8) { - return this.canReturnFloat() ? t8 : Math.round(t8); + convertValue(e) { + return this.canReturnFloat() ? e : Math.round(e); } nextValue() { return this.convertValue(this.min + this.range * this.random()); } }; -function Lq(r15, t8, e = 1, o = "float32", n) { - if (Ct(r15), e == null && (e = 1), o == null && (o = "float32"), o !== "float32" && o !== "int32") +function cj(r16, e, t10 = 1, o = "float32", n) { + if (St(r16), t10 == null && (t10 = 1), o == null && (o = "float32"), o !== "float32" && o !== "int32") throw new Error(`Unsupported data type ${o}`); - let s = new Ld(t8, e, o, n), a = me(r15, o); + let s = new Xd(e, t10, o, n), a = ie(r16, o); for (let i = 0; i < a.values.length; i++) a.values[i] = s.nextValue(); return a.toTensor(); } -var x1 = N({ randomGamma_: Lq }); -function Bq(r15, t8 = 0, e = 1, o, n) { - if (Ct(r15), o != null && o === "bool") +var iN = N({ randomGamma_: cj }); +function mj(r16, e = 0, t10 = 1, o, n) { + if (St(r16), o != null && o === "bool") throw new Error(`Unsupported data type ${o}`); - let s = new Hu(t8, e, o, false, n), a = me(r15, o); + let s = new Ju(e, t10, o, false, n), a = ie(r16, o); for (let i = 0; i < a.values.length; i++) a.values[i] = s.nextValue(); return a.toTensor(); } -var Vd = N({ randomNormal_: Bq }); -function zq(r15, t8, e) { - if (t8 != null && t8 === "bool") - throw new Error(`Unsupported data type ${t8}`); - return Vd(r15, 0, 1, t8, e); +var Zd = N({ randomNormal_: mj }); +function dj(r16, e, t10) { + if (e != null && e === "bool") + throw new Error(`Unsupported data type ${e}`); + return Zd(r16, 0, 1, e, t10); } -var y1 = N({ randomStandardNormal_: zq }); -function Vq(r15, t8 = 0, e = 1, o = "float32", n) { - Ct(r15); - let s = me(r15, o), a = new Bd(t8, e, null, n); +var uN = N({ randomStandardNormal_: dj }); +function fj(r16, e = 0, t10 = 1, o = "float32", n) { + St(r16); + let s = ie(r16, o), a = new Yd(e, t10, null, n); for (let i = 0; i < s.values.length; i++) s.values[i] = a.nextValue(); return s.toTensor(); } -var sc = N({ randomUniform_: Vq }); -function Wq(r15, t8, e, o) { - return sc(r15, t8, e, "int32", o); +var dl = N({ randomUniform_: fj }); +function hj(r16, e, t10, o) { + return dl(r16, e, t10, "int32", o); } -var b1 = N({ randomUniformInt_: Wq }); -function uu(r15, t8, e = 1, o = "float32") { - if (e === 0) +var pN = N({ randomUniformInt_: hj }); +function xu(r16, e, t10 = 1, o = "float32") { + if (t10 === 0) throw new Error("Cannot have a step of zero"); - let n = { start: r15, stop: t8, step: e, dtype: o }; - return T.runKernel(ma, {}, n); -} -function Uq(r15) { - let e = { input: v(r15, "input", "real") }; - return T.runKernel(Gi, e); -} -var pi = N({ real_: Uq }); -function Gq(r15) { - let e = { x: v(r15, "x", "reciprocal") }; - return T.runKernel(ns, e); -} -var C1 = N({ reciprocal_: Gq }); -function Hq(r15) { - let e = { x: v(r15, "x", "relu") }; - return T.runKernel(ss, e); -} -var pu = N({ relu_: Hq }); -function Kq(r15) { - let e = { x: v(r15, "x", "relu6") }; - return T.runKernel(us, e); -} -var Wd = N({ relu6_: Kq }); -function qq(r15, t8) { - let o = { x: v(r15, "x", "reverse") }, n = { dims: t8 }; - return T.runKernel(ps, o, n); -} -var lo = N({ reverse_: qq }); -function jq(r15) { - let t8 = v(r15, "x", "reverse"); - return $(t8.rank === 1, () => `Error in reverse1D: x must be rank 1 but got rank ${t8.rank}.`), lo(t8, 0); -} -var w1 = N({ reverse1d_: jq }); -function Xq(r15, t8) { - let e = v(r15, "x", "reverse"); - return $(e.rank === 2, () => `Error in reverse2D: x must be rank 2 but got rank ${e.rank}.`), lo(e, t8); -} -var S1 = N({ reverse2d_: Xq }); -function Yq(r15, t8) { - let e = v(r15, "x", "reverse"); - return $(e.rank === 3, () => `Error in reverse3D: x must be rank 3 but got rank ${e.rank}.`), lo(e, t8); -} -var I1 = N({ reverse3d_: Yq }); -function Qq(r15, t8) { - let e = v(r15, "x", "reverse"); - return $(e.rank === 4, () => `Error in reverse4D: x must be rank 4 but got rank ${e.rank}.`), lo(e, t8); -} -var v1 = N({ reverse4d_: Qq }); -function Zq(r15) { - let e = { x: v(r15, "x", "round") }; - return T.runKernel(cs, e); -} -var Ud = N({ round_: Zq }); -function Jq(r15) { - let e = { x: v(r15, "x", "rsqrt", "float32") }; - return T.runKernel(ls, e); -} -var k1 = N({ rsqrt_: Jq }); -function e6(r15) { - let e = { x: v(r15, "x", "selu") }; - return T.runKernel(hs, e); -} -var N1 = N({ selu_: e6 }); -function t6(r15, t8, e, o, n, s = [1, 1], a = "NHWC") { - let i = v(r15, "x", "separableConv2d"), p = v(t8, "depthwiseFilter", "separableConv2d"), u = v(e, "pointwiseFilter", "separableConv2d"), c = i, l = false; - if (i.rank === 3 && (l = true, c = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), a === "NCHW") + let n = { start: r16, stop: e, step: t10, dtype: o }; + return _.runKernel(ba, {}, n); +} +function gj(r16) { + let t10 = { input: v(r16, "input", "real") }; + return _.runKernel(si, t10); +} +var bi = N({ real_: gj }); +function xj(r16) { + let t10 = { x: v(r16, "x", "reciprocal") }; + return _.runKernel(xs, t10); +} +var lN = N({ reciprocal_: xj }); +function yj(r16) { + let t10 = { x: v(r16, "x", "relu") }; + return _.runKernel(ys, t10); +} +var yu = N({ relu_: yj }); +function bj(r16) { + let t10 = { x: v(r16, "x", "relu6") }; + return _.runKernel(ws, t10); +} +var Jd = N({ relu6_: bj }); +function Cj(r16, e) { + let o = { x: v(r16, "x", "reverse") }, n = { dims: e }; + return _.runKernel(Ss, o, n); +} +var Bo = N({ reverse_: Cj }); +function wj(r16) { + let e = v(r16, "x", "reverse"); + return $(e.rank === 1, () => `Error in reverse1D: x must be rank 1 but got rank ${e.rank}.`), Bo(e, 0); +} +var cN = N({ reverse1d_: wj }); +function Sj(r16, e) { + let t10 = v(r16, "x", "reverse"); + return $(t10.rank === 2, () => `Error in reverse2D: x must be rank 2 but got rank ${t10.rank}.`), Bo(t10, e); +} +var mN = N({ reverse2d_: Sj }); +function Ij(r16, e) { + let t10 = v(r16, "x", "reverse"); + return $(t10.rank === 3, () => `Error in reverse3D: x must be rank 3 but got rank ${t10.rank}.`), Bo(t10, e); +} +var dN = N({ reverse3d_: Ij }); +function vj(r16, e) { + let t10 = v(r16, "x", "reverse"); + return $(t10.rank === 4, () => `Error in reverse4D: x must be rank 4 but got rank ${t10.rank}.`), Bo(t10, e); +} +var fN = N({ reverse4d_: vj }); +function kj(r16) { + let t10 = { x: v(r16, "x", "round") }; + return _.runKernel(Is, t10); +} +var ef = N({ round_: kj }); +function Nj(r16) { + let t10 = { x: v(r16, "x", "rsqrt", "float32") }; + return _.runKernel(Do, t10); +} +var hN = N({ rsqrt_: Nj }); +function Tj(r16) { + let t10 = { x: v(r16, "x", "selu") }; + return _.runKernel(Ts, t10); +} +var gN = N({ selu_: Tj }); +function _j(r16, e, t10, o, n, s = [1, 1], a = "NHWC") { + let i = v(r16, "x", "separableConv2d"), p = v(e, "depthwiseFilter", "separableConv2d"), u = v(t10, "pointwiseFilter", "separableConv2d"), l = i, c = false; + if (i.rank === 3 && (c = true, l = W(i, [1, i.shape[0], i.shape[1], i.shape[2]])), a === "NCHW") throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported"); - $(c.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`), $(p.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but got rank ${p.rank}.`), $(u.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but got rank ${p.rank}.`), $(u.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`), $(u.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`); + $(l.rank === 4, () => `Error in separableConv2d: input must be rank 4, but got rank ${l.rank}.`), $(p.rank === 4, () => `Error in separableConv2d: depthwise filter must be rank 4, but got rank ${p.rank}.`), $(u.rank === 4, () => `Error in separableConv2d: pointwise filter must be rank 4, but got rank ${p.rank}.`), $(u.shape[0] === 1, () => `Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`), $(u.shape[1] === 1, () => `Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`); let m = p.shape[2], d = p.shape[3]; $(u.shape[2] === m * d, () => `Error in separableConv2d: the third dimension of pointwise filter must be ${m * d}, but got ${u.shape[2]}.`); - let f = oc(c, p, o, n, a, s), g = nu(f, u, 1, "valid", a); - return l ? W(g, [g.shape[1], g.shape[2], g.shape[3]]) : g; -} -var T1 = N({ separableConv2d_: t6 }); -async function r6(r15, t8) { - let e = v(r15, "x", "setdiff1d"), o = v(t8, "y", "setdiff1d"); - $(e.dtype === o.dtype, () => `x and y should have the same dtype, but got x (${e.dtype}) and y (${o.dtype}).`), $(e.rank === 1, () => `x should be 1D tensor, but got x (${e.shape}).`), $(o.rank === 1, () => `y should be 1D tensor, but got y (${o.shape}).`); - let n = await e.data(), s = await o.data(), a = new Set(s), i = 0; - for (let c = 0; c < n.length; c++) - a.has(n[c]) || i++; - let p = new tt([i], e.dtype), u = new tt([i], "int32"); - for (let c = 0, l = 0; c < n.length; c++) - a.has(n[c]) || (p.values[l] = n[c], u.values[l] = c, l++); + let f = cl(l, p, o, n, a, s), g = du(f, u, 1, "valid", a); + return c ? W(g, [g.shape[1], g.shape[2], g.shape[3]]) : g; +} +var xN = N({ separableConv2d_: _j }); +async function Ej(r16, e) { + let t10 = v(r16, "x", "setdiff1d"), o = v(e, "y", "setdiff1d"); + $(t10.dtype === o.dtype, () => `x and y should have the same dtype, but got x (${t10.dtype}) and y (${o.dtype}).`), $(t10.rank === 1, () => `x should be 1D tensor, but got x (${t10.shape}).`), $(o.rank === 1, () => `y should be 1D tensor, but got y (${o.shape}).`); + let n = await t10.data(), s = await o.data(), a = new Set(s), i = 0; + for (let l = 0; l < n.length; l++) + a.has(n[l]) || i++; + let p = new Ge([i], t10.dtype), u = new Ge([i], "int32"); + for (let l = 0, c = 0; l < n.length; l++) + a.has(n[l]) || (p.values[c] = n[l], u.values[c] = l, c++); return [p.toTensor(), u.toTensor()]; } -var _1 = r6; -function o6(r15) { - let e = { x: v(r15, "x", "sign") }; - return T.runKernel(ys, e); -} -var $1 = N({ sign_: o6 }); -function n6(r15) { - let e = { x: v(r15, "x", "sin", "float32") }; - return T.runKernel(gs, e); -} -var E1 = N({ sin_: n6 }); -function s6(r15) { - let e = { x: v(r15, "x", "sinh") }; - return T.runKernel(xs, e); -} -var R1 = N({ sinh_: s6 }); -function a6(r15, t8, e) { - let o = v(r15, "x", "slice1d"); - return $(o.rank === 1, () => `slice1d expects a rank-1 tensor, but got a rank-${o.rank} tensor`), Xe(o, [t8], [e]); -} -var D1 = N({ slice1d_: a6 }); -function i6(r15, t8, e) { - let o = v(r15, "x", "slice2d"); - return $(o.rank === 2, () => `slice2d expects a rank-2 tensor, but got a rank-${o.rank} tensor`), Xe(o, t8, e); -} -var A1 = N({ slice2d_: i6 }); -function u6(r15, t8, e) { - let o = v(r15, "x", "slice3d"); - return $(o.rank === 3, () => `slice3d expects a rank-3 tensor, but got a rank-${o.rank} tensor`), Xe(o, t8, e); -} -var F1 = N({ slice3d_: u6 }); -function p6(r15, t8, e) { - let o = v(r15, "x", "slice4d"); - return $(o.rank === 4, () => `slice4d expects a rank-4 tensor, but got a rank-${o.rank} tensor`), Xe(o, t8, e); -} -var P1 = N({ slice4d_: p6 }); -function c6(r15, t8 = -1) { - let e = v(r15, "logits", "softmax", "float32"); - if (t8 === -1 && (t8 = e.rank - 1), t8 !== e.rank - 1) - throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${e.rank} and dim was ${t8}`); - let o = { logits: e }, n = { dim: t8 }; - return T.runKernel(Is, o, n); -} -var O1 = N({ softmax_: c6 }); -function l6(r15) { - $(r15.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${r15.dtype}.`); - let t8 = { input: r15 }; - return T.runKernel(Bi, t8); -} -var ac = N({ fft_: l6 }); -function m6(r15) { - $(r15.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${r15.dtype}.`); - let t8 = { input: r15 }; - return T.runKernel(zi, t8); -} -var Ku = N({ ifft_: m6 }); -function d6(r15) { - let t8 = r15.shape[r15.shape.length - 1], e = r15.size / t8, o; - if (t8 <= 2) { - let n = W(r15, [e, t8]); - o = Ku(n); +var yN = Ej; +function $j(r16) { + let t10 = { x: v(r16, "x", "sign") }; + return _.runKernel(Rs, t10); +} +var bN = N({ sign_: $j }); +function Rj(r16) { + let t10 = { x: v(r16, "x", "sin", "float32") }; + return _.runKernel(Es, t10); +} +var CN = N({ sin_: Rj }); +function Dj(r16) { + let t10 = { x: v(r16, "x", "sinh") }; + return _.runKernel($s, t10); +} +var wN = N({ sinh_: Dj }); +function Aj(r16, e, t10) { + let o = v(r16, "x", "slice1d"); + return $(o.rank === 1, () => `slice1d expects a rank-1 tensor, but got a rank-${o.rank} tensor`), Ye(o, [e], [t10]); +} +var SN = N({ slice1d_: Aj }); +function Fj(r16, e, t10) { + let o = v(r16, "x", "slice2d"); + return $(o.rank === 2, () => `slice2d expects a rank-2 tensor, but got a rank-${o.rank} tensor`), Ye(o, e, t10); +} +var IN = N({ slice2d_: Fj }); +function Pj(r16, e, t10) { + let o = v(r16, "x", "slice3d"); + return $(o.rank === 3, () => `slice3d expects a rank-3 tensor, but got a rank-${o.rank} tensor`), Ye(o, e, t10); +} +var vN = N({ slice3d_: Pj }); +function Oj(r16, e, t10) { + let o = v(r16, "x", "slice4d"); + return $(o.rank === 4, () => `slice4d expects a rank-4 tensor, but got a rank-${o.rank} tensor`), Ye(o, e, t10); +} +var kN = N({ slice4d_: Oj }); +function Mj(r16, e = -1) { + let t10 = v(r16, "logits", "softmax", "float32"); + if (e === -1 && (e = t10.rank - 1), e !== t10.rank - 1) + throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${t10.rank} and dim was ${e}`); + let o = { logits: t10 }, n = { dim: e }; + return _.runKernel(Fs, o, n); +} +var NN = N({ softmax_: Mj }); +function Lj(r16) { + $(r16.dtype === "complex64", () => `The dtype for tf.spectral.fft() must be complex64 but got ${r16.dtype}.`); + let e = { input: r16 }; + return _.runKernel(Xi, e); +} +var fl = N({ fft_: Lj }); +function Bj(r16) { + $(r16.dtype === "complex64", () => `The dtype for tf.spectral.ifft() must be complex64 but got ${r16.dtype}.`); + let e = { input: r16 }; + return _.runKernel(Yi, e); +} +var ep = N({ ifft_: Bj }); +function zj(r16) { + let e = r16.shape[r16.shape.length - 1], t10 = r16.size / e, o; + if (e <= 2) { + let n = W(r16, [t10, e]); + o = ep(n); } else { - let n = [e, 2 * (t8 - 1)], s = W(pi(r15), [e, t8]), a = W(iu(r15), [e, t8]), i = lo(Xe(s, [0, 1], [e, t8 - 2]), 1), p = se(lo(Xe(a, [0, 1], [e, t8 - 2]), 1), ke(-1)), u = yt([s, i], 1), c = yt([a, p], 1), l = W($r(u, c), [n[0], n[1]]); - o = Ku(l); + let n = [t10, 2 * (e - 1)], s = W(bi(r16), [t10, e]), a = W(gu(r16), [t10, e]), i = Bo(Ye(s, [0, 1], [t10, e - 2]), 1), p = se(Bo(Ye(a, [0, 1], [t10, e - 2]), 1), ke(-1)), u = bt([s, i], 1), l = bt([a, p], 1), c = W(Ar(u, l), [n[0], n[1]]); + o = ep(c); } - if (o = pi(o), r15.rank === 3 && r15.shape[0] !== 0) { - let n = o, s = r15.shape[0]; + if (o = bi(o), r16.rank === 3 && r16.shape[0] !== 0) { + let n = o, s = r16.shape[0]; o = W(o, [s, o.shape[0] / s, o.shape[1]]), n.dispose(); } return o; } -var Gd = N({ irfft_: d6 }); -function f6(r15, t8, e = 0) { - let n = { x: v(r15, "x", "split") }, s = { numOrSizeSplits: t8, axis: e }; - return T.runKernel(xa, n, s); -} -var ci = N({ split_: f6 }); -function h6(r15, t8) { - $(r15.dtype === "float32", () => `The dtype for rfft() must be real value but got ${r15.dtype}`); - let e = r15.shape[r15.shape.length - 1], o = r15.size / e, n; - if (t8 != null && t8 < e) { - let f = r15.shape.map((g) => 0), h = r15.shape.map((g) => g); - h[r15.shape.length - 1] = t8, n = Xe(r15, f, h), e = t8; - } else if (t8 != null && t8 > e) { - let f = r15.shape.map((h) => h); - f[r15.shape.length - 1] = t8 - e, n = yt([r15, Ur(f)], r15.shape.length - 1), e = t8; +var tf = N({ irfft_: zj }); +function Vj(r16, e, t10 = 0) { + let n = { x: v(r16, "x", "split") }, s = { numOrSizeSplits: e, axis: t10 }; + return _.runKernel(Ia, n, s); +} +var Ci = N({ split_: Vj }); +function Wj(r16, e) { + $(r16.dtype === "float32", () => `The dtype for rfft() must be real value but got ${r16.dtype}`); + let t10 = r16.shape[r16.shape.length - 1], o = r16.size / t10, n; + if (e != null && e < t10) { + let f = r16.shape.map((g) => 0), h = r16.shape.map((g) => g); + h[r16.shape.length - 1] = e, n = Ye(r16, f, h), t10 = e; + } else if (e != null && e > t10) { + let f = r16.shape.map((h) => h); + f[r16.shape.length - 1] = e - t10, n = bt([r16, Yr(f)], r16.shape.length - 1), t10 = e; } else - n = r15; - let s = Gt(n), a = W($r(n, s), [o, e]), i = ac(a), p = Math.floor(e / 2) + 1, u = pi(i), c = iu(i), l = ci(u, [p, e - p], u.shape.length - 1), m = ci(c, [p, e - p], c.shape.length - 1), d = n.shape.slice(); - return d[n.shape.length - 1] = p, W($r(l[0], m[0]), d); -} -var ic = N({ rfft_: h6 }); -function g6(r15, t8) { - let e = v(r15, "a", "squaredDifference"), o = v(t8, "b", "squaredDifference"); - [e, o] = Oe(e, o), rt(e.shape, o.shape); - let n = { a: e, b: o }, s = {}; - return T.runKernel(ks, n, s); -} -var Hd = N({ squaredDifference_: g6 }); -function x6(r15, t8) { - let e = v(r15, "x", "squeeze", "string_or_numeric"); - return W(e, ZC(e.shape, t8).newShape); -} -var uc = N({ squeeze_: x6 }); -function y6(r15, t8 = 0) { - let e = ni(r15, "tensors", "stack", "string_or_numeric"); - $(e.length >= 1, () => "Pass at least one tensor to tf.stack"), e.length > 0 && $(t8 <= e[0].rank, () => "Axis must be <= rank of the tensor"); - let o = e, n = { axis: t8 }; - return T.runKernel(la, o, n); -} -var vr = N({ stack_: y6 }); -function b6(r15, t8 = 0) { - let o = { x: v(r15, "x", "step") }, n = { alpha: t8 }; - return T.runKernel(wo, o, n); -} -var Kd = N({ step_: b6 }); -function C6(r15, t8, e, o, n = 0, s = 0, a = 0, i = 0, p = 0) { - let c = { x: v(r15, "x", "stridedSlice", "string_or_numeric") }, l = { begin: t8, end: e, strides: o, beginMask: n, endMask: s, ellipsisMask: a, newAxisMask: i, shrinkAxisMask: p }; - return T.runKernel(Ns, c, l); -} -var M1 = N({ stridedSlice_: C6 }); -function w6(r15) { - let e = { x: v(r15, "x", "tan", "float32") }; - return T.runKernel(_s, e); -} -var L1 = N({ tan_: w6 }); -function Jt(r15, t8) { - ao(r15); - let e = sr(r15, t8); - if (e.length !== 1) + n = r16; + let s = Kt(n), a = W(Ar(n, s), [o, t10]), i = fl(a), p = Math.floor(t10 / 2) + 1, u = bi(i), l = gu(i), c = Ci(u, [p, t10 - p], u.shape.length - 1), m = Ci(l, [p, t10 - p], l.shape.length - 1), d = n.shape.slice(); + return d[n.shape.length - 1] = p, W(Ar(c[0], m[0]), d); +} +var hl = N({ rfft_: Wj }); +function Uj(r16, e) { + let t10 = v(r16, "a", "squaredDifference"), o = v(e, "b", "squaredDifference"); + [t10, o] = Oe(t10, o), rt(t10.shape, o.shape); + let n = { a: t10, b: o }, s = {}; + return _.runKernel(Po, n, s); +} +var rf = N({ squaredDifference_: Uj }); +function Gj(r16, e) { + let t10 = v(r16, "x", "squeeze", "string_or_numeric"); + return W(t10, mw(t10.shape, e).newShape); +} +var gl = N({ squeeze_: Gj }); +function Hj(r16, e = 0) { + let t10 = di(r16, "tensors", "stack", "string_or_numeric"); + $(t10.length >= 1, () => "Pass at least one tensor to tf.stack"), t10.length > 0 && $(e <= t10[0].rank, () => "Axis must be <= rank of the tensor"); + let o = t10, n = { axis: e }; + return _.runKernel(ya, o, n); +} +var Tr = N({ stack_: Hj }); +function Kj(r16, e = 0) { + let o = { x: v(r16, "x", "step") }, n = { alpha: e }; + return _.runKernel(Ko, o, n); +} +var of = N({ step_: Kj }); +function qj(r16, e, t10, o, n = 0, s = 0, a = 0, i = 0, p = 0) { + let l = { x: v(r16, "x", "stridedSlice", "string_or_numeric") }, c = { begin: e, end: t10, strides: o, beginMask: n, endMask: s, ellipsisMask: a, newAxisMask: i, shrinkAxisMask: p }; + return _.runKernel(Os, l, c); +} +var TN = N({ stridedSlice_: qj }); +function jj(r16) { + let t10 = { x: v(r16, "x", "tan", "float32") }; + return _.runKernel(Ms, t10); +} +var _N = N({ tan_: jj }); +function rr(r16, e) { + fo(r16); + let t10 = ur(r16, e); + if (t10.length !== 1) throw new Error("tensor1d() requires values to be a flat/TypedArray"); - return wr(r15, null, e, t8); + return vr(r16, null, t10, e); } -function cu(r15, t8, e) { - if (ao(r15), t8 != null && t8.length !== 2) +function bu(r16, e, t10) { + if (fo(r16), e != null && e.length !== 2) throw new Error("tensor2d() requires shape to have two numbers"); - let o = sr(r15, e); + let o = ur(r16, t10); if (o.length !== 2 && o.length !== 1) throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray"); - if (o.length === 1 && t8 == null) + if (o.length === 1 && e == null) throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray"); - return wr(r15, t8, o, e); + return vr(r16, e, o, t10); } -function qd(r15, t8, e) { - if (ao(r15), t8 != null && t8.length !== 3) +function nf(r16, e, t10) { + if (fo(r16), e != null && e.length !== 3) throw new Error("tensor3d() requires shape to have three numbers"); - let o = sr(r15, e); + let o = ur(r16, t10); if (o.length !== 3 && o.length !== 1) throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray"); - if (o.length === 1 && t8 == null) + if (o.length === 1 && e == null) throw new Error("tensor3d() requires shape to be provided when `values` are a flat array"); - return wr(r15, t8, o, e); + return vr(r16, e, o, t10); } -function B1(r15, t8, e) { - if (ao(r15), t8 != null && t8.length !== 4) +function EN(r16, e, t10) { + if (fo(r16), e != null && e.length !== 4) throw new Error("tensor4d() requires shape to have four numbers"); - let o = sr(r15, e); + let o = ur(r16, t10); if (o.length !== 4 && o.length !== 1) throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray"); - if (o.length === 1 && t8 == null) + if (o.length === 1 && e == null) throw new Error("tensor4d() requires shape to be provided when `values` are a flat array"); - return wr(r15, t8, o, e); + return vr(r16, e, o, t10); } -function z1(r15, t8, e) { - if (ao(r15), t8 != null && t8.length !== 5) +function $N(r16, e, t10) { + if (fo(r16), e != null && e.length !== 5) throw new Error("tensor5d() requires shape to have five numbers"); - let o = sr(r15, e); + let o = ur(r16, t10); if (o.length !== 5 && o.length !== 1) throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray"); - if (o.length === 1 && t8 == null) + if (o.length === 1 && e == null) throw new Error("tensor5d() requires shape to be provided when `values` are a flat array"); - return wr(r15, t8, o, e); + return vr(r16, e, o, t10); } -function V1(r15, t8, e) { - if (ao(r15), t8 != null && t8.length !== 6) +function RN(r16, e, t10) { + if (fo(r16), e != null && e.length !== 6) throw new Error("tensor6d() requires shape to have six numbers"); - let o = sr(r15, e); + let o = ur(r16, t10); if (o.length !== 6 && o.length !== 1) throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray"); - if (o.length === 1 && t8 == null) + if (o.length === 1 && e == null) throw new Error("tensor6d() requires shape to be provided when `values` are a flat array"); - return t8 = t8 || o, wr(r15, t8, o, e); + return e = e || o, vr(r16, e, o, t10); } -var lu = {}; -qe(lu, { calculateShapes: () => W1, validateInput: () => pc, validateUpdateShape: () => Yw }); -function Yw(r15, t8, e) { - let o = t8.rank > 1 ? t8.shape[t8.rank - 1] : 1, n = t8.rank > 1 ? t8.rank - 1 : 1, s = `Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${e.shape}, indices.shape: ${t8.shape}, shape: ${r15}, sliceDim: ${o}, and batchDim: ${n}.`; - if (e.rank < n) +var Cu = {}; +qe(Cu, { calculateShapes: () => DN, validateInput: () => xl, validateUpdateShape: () => lS }); +function lS(r16, e, t10) { + let o = e.rank > 1 ? e.shape[e.rank - 1] : 1, n = e.rank > 1 ? e.rank - 1 : 1, s = `Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${t10.shape}, indices.shape: ${e.shape}, shape: ${r16}, sliceDim: ${o}, and batchDim: ${n}.`; + if (t10.rank < n) throw new Error(s + ` update.rank < ${n}. `); - if (r15.length < o + (e.rank - n)) - throw new Error(s + ` Output shape length < ${o + (e.rank - n)}`); - if (e.rank !== n + r15.length - o) - throw new Error(s + ` update.rank != ${n + r15.length - o}`); + if (r16.length < o + (t10.rank - n)) + throw new Error(s + ` Output shape length < ${o + (t10.rank - n)}`); + if (t10.rank !== n + r16.length - o) + throw new Error(s + ` update.rank != ${n + r16.length - o}`); for (let a = 0; a < n; ++a) - if (e.shape[a] !== t8.shape[a]) - throw new Error(s + ` updates.shape[${a}] (${e.shape[a]}) != indices.shape[${a}] (${t8.shape[a]}).`); - for (let a = 0; a < e.rank - n; ++a) - if (e.shape[a + n] !== r15[a + o]) - throw new Error(s + ` updates.shape[${a + n}] (${e.shape[a + n]}) != shape[${a + n}] (${r15[a + n]})`); -} -function pc(r15, t8, e) { - if (t8.rank < 1) - throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${t8.rank}.`); - if (r15.rank < 1) - throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${r15.rank}.`); - if (t8.dtype !== "int32") - throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${t8.dtype}`); - if (e.length < 1) - throw new Error(`Output rank must be greater or equal to 1, but got shape: ${e}`); - if (e.length === 0) { - if (t8.size === 0) - throw new Error(`Indices specified for empty output. indices shape: ${t8.shape}`); - if (r15.size === 0) - throw new Error(`Updates specified for empty output. updates shape: ${r15.shape}`); - } - Yw(e, t8, r15); -} -function W1(r15, t8, e) { - let o = t8.shape.length, n = o > 1 ? t8.shape[o - 1] : 1, s = e.length, a = 1; - for (let l = n; l < s; ++l) - a *= e[l]; - let i = n < 1 ? 1 : n, p = He(t8.shape) / i, u = [...js(e.slice(0, n)), 1], c = He(e); - return { sliceRank: n, numUpdates: p, sliceSize: a, strides: u, outputSize: c }; -} -function S6(r15, t8, e) { - let o = v(r15, "tensor", "tensorScatterupdate"), n = v(t8, "indices", "tensorScatterupdate", "int32"), s = v(e, "updates", "tensorScatterupdate"); - if (pc(s, n, o.shape), o.dtype !== s.dtype) + if (t10.shape[a] !== e.shape[a]) + throw new Error(s + ` updates.shape[${a}] (${t10.shape[a]}) != indices.shape[${a}] (${e.shape[a]}).`); + for (let a = 0; a < t10.rank - n; ++a) + if (t10.shape[a + n] !== r16[a + o]) + throw new Error(s + ` updates.shape[${a + n}] (${t10.shape[a + n]}) != shape[${a + n}] (${r16[a + n]})`); +} +function xl(r16, e, t10) { + if (e.rank < 1) + throw new Error(`tf.scatterND() expects the indices to be rank 1 or higher, but the rank was ${e.rank}.`); + if (r16.rank < 1) + throw new Error(`tf.scatterND() expects the updates to be rank 1 or higher, but the rank was ${r16.rank}.`); + if (e.dtype !== "int32") + throw new Error(`The dtype of 'indices' should be int32, but got dtype: ${e.dtype}`); + if (t10.length < 1) + throw new Error(`Output rank must be greater or equal to 1, but got shape: ${t10}`); + if (t10.length === 0) { + if (e.size === 0) + throw new Error(`Indices specified for empty output. indices shape: ${e.shape}`); + if (r16.size === 0) + throw new Error(`Updates specified for empty output. updates shape: ${r16.shape}`); + } + lS(t10, e, r16); +} +function DN(r16, e, t10) { + let o = e.shape.length, n = o > 1 ? e.shape[o - 1] : 1, s = t10.length, a = 1; + for (let c = n; c < s; ++c) + a *= t10[c]; + let i = n < 1 ? 1 : n, p = ze(e.shape) / i, u = [...oa(t10.slice(0, n)), 1], l = ze(t10); + return { sliceRank: n, numUpdates: p, sliceSize: a, strides: u, outputSize: l }; +} +function Xj(r16, e, t10) { + let o = v(r16, "tensor", "tensorScatterupdate"), n = v(e, "indices", "tensorScatterupdate", "int32"), s = v(t10, "updates", "tensorScatterupdate"); + if (xl(s, n, o.shape), o.dtype !== s.dtype) throw new Error(`tensor and updates must have the same dtype, instead they are ${o.dtype} and ${s.dtype}.`); let a = { tensor: o, indices: n, updates: s }, i = {}; - return T.runKernel(ds, a, i); + return _.runKernel(ks, a, i); } -var U1 = N({ tensorScatterUpdate_: S6 }); -function I6(r15, t8 = 1, e = true) { - let o = v(r15, "x", "topk"); +var AN = N({ tensorScatterUpdate_: Xj }); +function Yj(r16, e = 1, t10 = true) { + let o = v(r16, "x", "topk"); if (o.rank === 0) throw new Error("topk() expects the input to be of rank 1 or higher"); let n = o.shape[o.shape.length - 1]; - if (t8 < 0) - throw new Error(`'k' passed to topk() must be >= 0 but got ${t8}`); - if (t8 > n) - throw new Error(`'k' passed to topk() must be <= the last dimension (${n}) but got ${t8}`); - let s = { x: o }, a = { k: t8, sorted: e }, [i, p] = T.runKernel(Es, s, a); + if (e < 0) + throw new Error(`'k' passed to topk() must be >= 0 but got ${e}`); + if (e > n) + throw new Error(`'k' passed to topk() must be <= the last dimension (${n}) but got ${e}`); + let s = { x: o }, a = { k: e, sorted: t10 }, [i, p] = _.runKernel(Bs, s, a); return { values: i, indices: p }; } -var G1 = N({ topk_: I6 }); -function v6(r15, t8 = 0, e = 1, o, n) { - if (Ct(r15), o != null && o === "bool") +var FN = N({ topk_: Yj }); +function Qj(r16, e = 0, t10 = 1, o, n) { + if (St(r16), o != null && o === "bool") throw new Error("Unsupported data type $ { dtype }"); - let s = new Hu(t8, e, o, true, n), a = me(r15, o); + let s = new Ju(e, t10, o, true, n), a = ie(r16, o); for (let i = 0; i < a.values.length; i++) a.values[i] = s.nextValue(); return a.toTensor(); } -var H1 = N({ truncatedNormal_: v6 }); -function k6(r15, t8 = 0) { - let e = v(r15, "x", "unique", "string_or_numeric"); - $(e.rank > 0, () => "The input tensor must be at least 1D"); - let o = { x: e }, n = { axis: t8 }, [s, a] = T.runKernel(Xi, o, n); +var PN = N({ truncatedNormal_: Qj }); +function Zj(r16, e = 0) { + let t10 = v(r16, "x", "unique", "string_or_numeric"); + $(t10.rank > 0, () => "The input tensor must be at least 1D"); + let o = { x: t10 }, n = { axis: e }, [s, a] = _.runKernel(nu, o, n); return { values: s, indices: a }; } -var K1 = N({ unique_: k6 }); -function N6(r15, t8, e) { - let o = v(r15, "x", "unsortedSegmentSum"), n = v(t8, "segmentIds", "unsortedSegmentSum", "int32"); - $(Ka(e), () => "numSegments must be of dtype int"); - let s = { x: o, segmentIds: n }, a = { numSegments: e }; - return T.runKernel(Yi, s, a); -} -var q1 = N({ unsortedSegmentSum_: N6 }); -function T6(r15, t8 = 0) { - let e = v(r15, "x", "unstack", "string_or_numeric"); - $(t8 >= -e.shape.length && t8 < e.shape.length, () => `Axis = ${t8} is not in [-${e.shape.length}, ${e.shape.length})`); - let o = { value: e }, n = { axis: t8 }; - return T.runKernel(wa, o, n); -} -var mo = N({ unstack_: T6 }); -function j1(r15, t8) { - return Nl(r15, t8, "right"); -} -function X1(r15, t8 = true, e, o) { - return T.makeVariable(r15, t8, e, o); -} -function jd(r15, t8) { - let e = []; - for (let s = 0; s < t8.length; s++) - t8[s] && e.push(s); - let o = me(r15, "int32"), n = me([e.length, r15.length], "int32"); - for (let s = 0; s < e.length; s++) { - let a = o.indexToLoc(e[s]), i = s * r15.length; +var ON = N({ unique_: Zj }); +function Jj(r16, e, t10) { + let o = v(r16, "x", "unsortedSegmentSum"), n = v(e, "segmentIds", "unsortedSegmentSum", "int32"); + $(Ja(t10), () => "numSegments must be of dtype int"); + let s = { x: o, segmentIds: n }, a = { numSegments: t10 }; + return _.runKernel(su, s, a); +} +var MN = N({ unsortedSegmentSum_: Jj }); +function eX(r16, e = 0) { + let t10 = v(r16, "x", "unstack", "string_or_numeric"); + $(e >= -t10.shape.length && e < t10.shape.length, () => `Axis = ${e} is not in [-${t10.shape.length}, ${t10.shape.length})`); + let o = { value: t10 }, n = { axis: e }; + return _.runKernel(Ta, o, n); +} +var zo = N({ unstack_: eX }); +function LN(r16, e) { + return Pc(r16, e, "right"); +} +function BN(r16, e = true, t10, o) { + return _.makeVariable(r16, e, t10, o); +} +function sf(r16, e) { + let t10 = []; + for (let s = 0; s < e.length; s++) + e[s] && t10.push(s); + let o = ie(r16, "int32"), n = ie([t10.length, r16.length], "int32"); + for (let s = 0; s < t10.length; s++) { + let a = o.indexToLoc(t10[s]), i = s * r16.length; n.values.set(a, i); } return n.toTensor(); } -async function _6(r15) { - let t8 = v(r15, "condition", "whereAsync", "bool"), e = await t8.data(), o = jd(t8.shape, e); - return r15 !== t8 && t8.dispose(), o; +async function tX(r16) { + let e = v(r16, "condition", "whereAsync", "bool"), t10 = await e.data(), o = sf(e.shape, t10); + return r16 !== e && e.dispose(), o; } -var Xd = _6; -async function $6(r15, t8, e) { - let o = v(r15, "tensor", "boolMask"), n = v(t8, "mask", "boolMask", "bool"), s = e == null ? 0 : e, a = n.rank, i = o.shape; - $(a > 0, () => "mask cannot be scalar"), xt(i.slice(s, s + a), n.shape, "mask's shape must match the first K dimensions of tensor's shape,"); +var af = tX; +async function rX(r16, e, t10) { + let o = v(r16, "tensor", "boolMask"), n = v(e, "mask", "boolMask", "bool"), s = t10 == null ? 0 : t10, a = n.rank, i = o.shape; + $(a > 0, () => "mask cannot be scalar"), yt(i.slice(s, s + a), n.shape, "mask's shape must match the first K dimensions of tensor's shape,"); let p = 1; for (let h = s; h < s + a; h++) p *= i[h]; - let u = i.slice(0, s).concat([p], i.slice(s + a)), c = W(o, u), l = W(n, [-1]), m = await Xd(l), d = uc(m, [1]), f = wd(c, d, s); - return r15 !== o && o.dispose(), t8 !== n && n.dispose(), d.dispose(), c.dispose(), l.dispose(), m.dispose(), f; -} -var E6 = $6; -function R6(r15, t8, e) { - let o = v(r15, "x", "transpose"); - if (t8 == null && (t8 = o.shape.map((a, i) => i).reverse()), $(o.rank === t8.length, () => `Error in transpose: rank of input ${o.rank} must match length of perm ${t8}.`), t8.forEach((a) => { - $(a >= 0 && a < o.rank, () => `All entries in 'perm' must be between 0 and ${o.rank - 1} but got ${t8}`); + let u = i.slice(0, s).concat([p], i.slice(s + a)), l = W(o, u), c = W(n, [-1]), m = await af(c), d = gl(m, [1]), f = Dd(l, d, s); + return r16 !== o && o.dispose(), e !== n && n.dispose(), d.dispose(), l.dispose(), c.dispose(), m.dispose(), f; +} +var oX = rX; +function nX(r16, e, t10) { + let o = v(r16, "x", "transpose"); + if (e == null && (e = o.shape.map((a, i) => i).reverse()), $(o.rank === e.length, () => `Error in transpose: rank of input ${o.rank} must match length of perm ${e}.`), e.forEach((a) => { + $(a >= 0 && a < o.rank, () => `All entries in 'perm' must be between 0 and ${o.rank - 1} but got ${e}`); }), o.rank <= 1) return o.clone(); - let n = { x: o }, s = { perm: t8 }; + let n = { x: o }, s = { perm: e }; return o.dtype === "complex64" ? De(() => { - let a = pi(o), i = iu(o); - return a = T.runKernel(po, { x: a }, s), i = T.runKernel(po, { x: i }, s), e && (i = pr(i)), $r(a, i); - }) : T.runKernel(po, n, s); -} -var cc = N({ transpose_: R6 }); -function D6(r15, t8, e, o, n = true) { - let s = v(r15, "v", "movingAverage"), a = v(t8, "x", "movingAverage"), i = v(e, "decay", "movingAverage"); - Cw(s, a), $(br(s.shape, a.shape), () => "Shape mismatch in v and x"); - let p = ke(1), u = Te(p, i), c = se(Te(a, s), u); + let a = bi(o), i = gu(o); + return a = _.runKernel(Kr, { x: a }, s), i = _.runKernel(Kr, { x: i }, s), t10 && (i = mr(i)), Ar(a, i); + }) : _.runKernel(Kr, n, s); +} +var yl = N({ transpose_: nX }); +function sX(r16, e, t10, o, n = true) { + let s = v(r16, "v", "movingAverage"), a = v(e, "x", "movingAverage"), i = v(t10, "decay", "movingAverage"); + Fw(s, a), $(Sr(s.shape, a.shape), () => "Shape mismatch in v and x"); + let p = ke(1), u = Te(p, i), l = se(Te(a, s), u); if (n) { $(o != null, () => "When using zeroDebias: true, step is required."); - let l = v(o, "step", "movingAverage"); - c = je(c, Te(p, ii(i, l))); - } - return Ce(s, c); -} -var A6 = N({ movingAverage_: D6 }); -function F6(r15, t8, e) { - Ct(e); - let o = v(r15, "indices", "scatterND", "int32"), n = v(t8, "updates", "scatterND"); - pc(n, o, e); - let s = { indices: o, updates: n }, a = { shape: e }; - return T.runKernel(ms, s, a); -} -var P6 = N({ scatterND_: F6 }); -function Y1(r15, t8, e, o) { - if (r15.dtype !== "int32") - throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${r15.dtype}.`); - if (r15.rank > 2) - throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${r15.shape}.`); - let n = r15.rank > 0 ? r15.shape[0] : 1, s = r15.rank > 1 ? r15.shape[1] : 1; - if (e.length !== s) - throw new Error(`outputShape has incorrect number of elements:, ${e.length}, should be: ${s}.`); - let a = t8.size; - if (!(t8.rank === 0 || t8.rank === 1 && a === n)) - throw new Error(`sparseValues has incorrect shape ${t8.shape}, should be [] or [${n}]`); - if (t8.dtype !== o.dtype) + let c = v(o, "step", "movingAverage"); + l = Xe(l, Te(p, xi(i, c))); + } + return Ce(s, l); +} +var aX = N({ movingAverage_: sX }); +function iX(r16, e, t10) { + St(t10); + let o = v(r16, "indices", "scatterND", "int32"), n = v(e, "updates", "scatterND"); + xl(n, o, t10); + let s = { indices: o, updates: n }, a = { shape: t10 }; + return _.runKernel(vs, s, a); +} +var uX = N({ scatterND_: iX }); +function zN(r16, e, t10, o) { + if (r16.dtype !== "int32") + throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${r16.dtype}.`); + if (r16.rank > 2) + throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${r16.shape}.`); + let n = r16.rank > 0 ? r16.shape[0] : 1, s = r16.rank > 1 ? r16.shape[1] : 1; + if (t10.length !== s) + throw new Error(`outputShape has incorrect number of elements:, ${t10.length}, should be: ${s}.`); + let a = e.size; + if (!(e.rank === 0 || e.rank === 1 && a === n)) + throw new Error(`sparseValues has incorrect shape ${e.shape}, should be [] or [${n}]`); + if (e.dtype !== o.dtype) throw new Error("sparseValues.dtype must match defaultValues.dtype"); } -function M6(r15, t8, e, o = 0) { - Ct(e); - let n = v(r15, "sparseIndices", "sparseToDense", "int32"), s = v(t8, "sparseValues", "sparseToDense", "string_or_numeric"), a = v(o, "defaultValue", "sparseToDense", s.dtype); - Y1(n, s, e, a); - let i = { sparseIndices: n, sparseValues: s, defaultValue: a }, p = { outputShape: e }; - return T.runKernel(vs, i, p); -} -var L6 = N({ sparseToDense_: M6 }); -function B6(r15, t8) { - let e = v(t8, "indices", "gatherND", "int32"), n = { params: v(r15, "x", "gatherND", "string_or_numeric"), indices: e }; - return T.runKernel(vn, n); -} -var z6 = N({ gatherND_: B6 }); -function Q1(r15, t8) { - if (t8 == null) - return r15.shape.slice(); - if (br(r15.shape, t8)) - return t8; - if (r15.shape.length === t8.length) { - let e = []; - for (let o = 0; o < r15.shape.length; o++) - t8[o] == null && r15.shape[o] != null ? e.push(r15.shape[o]) : e.push(t8[o]); +function lX(r16, e, t10, o = 0) { + St(t10); + let n = v(r16, "sparseIndices", "sparseToDense", "int32"), s = v(e, "sparseValues", "sparseToDense", "string_or_numeric"), a = v(o, "defaultValue", "sparseToDense", s.dtype); + zN(n, s, t10, a); + let i = { sparseIndices: n, sparseValues: s, defaultValue: a }, p = { outputShape: t10 }; + return _.runKernel(Ps, i, p); +} +var cX = N({ sparseToDense_: lX }); +function mX(r16, e) { + let t10 = v(e, "indices", "gatherND", "int32"), n = { params: v(r16, "x", "gatherND", "string_or_numeric"), indices: t10 }; + return _.runKernel(Kn, n); +} +var dX = N({ gatherND_: mX }); +function VN(r16, e) { + if (e == null) + return r16.shape.slice(); + if (Sr(r16.shape, e)) return e; + if (r16.shape.length === e.length) { + let t10 = []; + for (let o = 0; o < r16.shape.length; o++) + e[o] == null && r16.shape[o] != null ? t10.push(r16.shape[o]) : t10.push(e[o]); + return t10; } - return t8; + return e; } -function V6(r15, t8, e, o) { - let n = v(r15, "x", "dropout"); - if ($(n.dtype === "float32", () => `x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`), $(t8 >= 0 && t8 < 1, () => `rate must be a float in the range [0, 1), but got ${t8}.`), t8 === 0) - return r15 instanceof mt ? n.clone() : n; - let s = Q1(n, e), a = 1 - t8, i = je(Cd(Ce(sc(s, 0, 1, "float32", o), a)), a); +function fX(r16, e, t10, o) { + let n = v(r16, "x", "dropout"); + if ($(n.dtype === "float32", () => `x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`), $(e >= 0 && e < 1, () => `rate must be a float in the range [0, 1), but got ${e}.`), e === 0) + return r16 instanceof dt ? n.clone() : n; + let s = VN(n, t10), a = 1 - e, i = Xe(Rd(Ce(dl(s, 0, 1, "float32", o), a)), a); return se(n, i); } -var W6 = N({ dropout_: V6 }); -function Qw(r15) { - return Math.floor(Math.pow(2, Math.ceil(Math.log(r15) / Math.log(2)))); +var hX = N({ dropout_: fX }); +function cS(r16) { + return Math.floor(Math.pow(2, Math.ceil(Math.log(r16) / Math.log(2)))); } -function _l(r15, t8, e) { - let o = 1 - r15 % 2, n = new Float32Array(r15); - for (let s = 0; s < r15; ++s) { - let a = 2 * Math.PI * s / (r15 + o - 1); - n[s] = t8 - e * Math.cos(a); +function Mc(r16, e, t10) { + let o = 1 - r16 % 2, n = new Float32Array(r16); + for (let s = 0; s < r16; ++s) { + let a = 2 * Math.PI * s / (r16 + o - 1); + n[s] = e - t10 * Math.cos(a); } - return Jt(n, "float32"); + return rr(n, "float32"); } -async function U6(r15, t8, e = 1) { - let o = v(r15, "predictions", "inTopK"), n = v(t8, "targets", "inTopK"); - $(o.rank > 1, () => `inTopK() expects the predictions to be of rank 2 or higher, but got ${o.rank}`), $(o.rank - 1 === n.rank, () => `predictions rank should be 1 larger than targets rank, but got predictions rank ${o.rank} and targets rank ${n.rank}`), xt(o.shape.slice(0, o.shape.length - 1), n.shape, "predictions's shape should be align with the targets' shape, except the last dimension."); +async function gX(r16, e, t10 = 1) { + let o = v(r16, "predictions", "inTopK"), n = v(e, "targets", "inTopK"); + $(o.rank > 1, () => `inTopK() expects the predictions to be of rank 2 or higher, but got ${o.rank}`), $(o.rank - 1 === n.rank, () => `predictions rank should be 1 larger than targets rank, but got predictions rank ${o.rank} and targets rank ${n.rank}`), yt(o.shape.slice(0, o.shape.length - 1), n.shape, "predictions's shape should be align with the targets' shape, except the last dimension."); let s = o.shape[o.shape.length - 1]; - $(e > 0 && e <= s, () => `'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${e}`); - let a = await o.data(), i = await n.data(), [p, u] = [a.length / s, s], c = JC("bool", p); - for (let l = 0; l < p; l++) { - let m = l * u, d = a.subarray(m, m + u), f = []; + $(t10 > 0 && t10 <= s, () => `'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${t10}`); + let a = await o.data(), i = await n.data(), [p, u] = [a.length / s, s], l = dw("bool", p); + for (let c = 0; c < p; c++) { + let m = c * u, d = a.subarray(m, m + u), f = []; for (let h = 0; h < d.length; h++) f.push({ value: d[h], index: h }); - f.sort((h, g) => g.value - h.value), c[l] = 0; - for (let h = 0; h < e; h++) - if (f[h].index === i[l]) { - c[l] = 1; + f.sort((h, g) => g.value - h.value), l[c] = 0; + for (let h = 0; h < t10; h++) + if (f[h].index === i[c]) { + l[c] = 1; break; } } - return r15 !== o && o.dispose(), t8 !== n && n.dispose(), ar(c, n.shape, "bool"); -} -var G6 = U6; -var Zw = {}; -qe(Zw, { conv2d: () => J1, depthwiseConv2d: () => rN, matMul: () => oN }); -function H6(r15, t8, e, o, n, s = "NHWC", a) { - let i = r15; - r15.rank === 3 && (i = W(r15, [1, r15.shape[0], r15.shape[1], r15.shape[2]])); - let p = t8; - p.rank === 3 && (p = W(t8, [1, t8.shape[0], t8.shape[1], t8.shape[2]])), $(i.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ${i.shape}.`), $(p.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`), $(e.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ${e}.`); - let u = s === "NHWC" ? i.shape[3] : i.shape[1], c = s === "NHWC" ? p.shape[3] : p.shape[1]; - $(u === e[2], () => `Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${e[2]}.`), $(c === e[3], () => `Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${e[3]}).`), Lt("conv2dDerFilter", n, a); - let l = { x: i, dy: p }, m = { strides: o, pad: n, dataFormat: s, dimRoundingMode: a, filterShape: e }; - return T.runKernel(Ai, l, m); -} -var Z1 = N({ conv2DBackpropFilter_: H6 }); -function qu(r15, t8, e) { - if (e == null || e === "linear") - return r15; + return r16 !== o && o.dispose(), e !== n && n.dispose(), pr(l, n.shape, "bool"); +} +var xX = gX; +var mS = {}; +qe(mS, { conv2d: () => UN, depthwiseConv2d: () => KN, matMul: () => qN }); +function yX(r16, e, t10, o, n, s = "NHWC", a) { + let i = r16; + r16.rank === 3 && (i = W(r16, [1, r16.shape[0], r16.shape[1], r16.shape[2]])); + let p = e; + p.rank === 3 && (p = W(e, [1, e.shape[0], e.shape[1], e.shape[2]])), $(i.rank === 4, () => `Error in conv2dDerFilter: input must be rank 4, but got shape ${i.shape}.`), $(p.rank === 4, () => `Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`), $(t10.length === 4, () => `Error in conv2dDerFilter: filterShape must be length 4, but got ${t10}.`); + let u = s === "NHWC" ? i.shape[3] : i.shape[1], l = s === "NHWC" ? p.shape[3] : p.shape[1]; + $(u === t10[2], () => `Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${t10[2]}.`), $(l === t10[3], () => `Error in conv2dDerFilter: depth of dy (${l}) must match output depth for filter (${t10[3]}).`), zt("conv2dDerFilter", n, a); + let c = { x: i, dy: p }, m = { strides: o, pad: n, dataFormat: s, dimRoundingMode: a, filterShape: t10 }; + return _.runKernel(Ui, c, m); +} +var WN = N({ conv2DBackpropFilter_: yX }); +function tp(r16, e, t10) { + if (t10 == null || t10 === "linear") + return r16; + if (t10 === "relu") + return se(r16, of(e)); + throw new Error(`Cannot compute gradient for fused activation ${t10}.`); +} +function rp(r16, e) { + let t10 = e, o = Td(r16.shape, e.shape); + return o.length > 0 && (t10 = ot(t10, o)), W(t10, r16.shape); +} +function op(r16, e, t10, o) { + if (e === "linear") + return r16; if (e === "relu") - return se(r15, Kd(t8)); - throw new Error(`Cannot compute gradient for fused activation ${e}.`); -} -function ju(r15, t8) { - let e = t8, o = gd(r15.shape, t8.shape); - return o.length > 0 && (e = ot(e, o)), W(e, r15.shape); -} -function Xu(r15, t8, e, o) { - if (t8 === "linear") - return r15; - if (t8 === "relu") - return pu(r15); - if (t8 === "elu") - return yd(r15); - if (t8 === "relu6") - return Wd(r15); - if (t8 === "prelu") - return Pd(r15, e); - if (t8 === "leakyrelu") - return Id(r15, o); - if (t8 === "sigmoid") - return $a(r15); - throw new Error(`Unknown fused activation ${t8}.`); -} -var Yu = (r15, t8) => !(r15 > 0) || t8 === "linear"; -function K6({ x: r15, filter: t8, strides: e, pad: o, dataFormat: n = "NHWC", dilations: s = [1, 1], dimRoundingMode: a, bias: i, activation: p = "linear", preluActivationWeights: u, leakyreluAlpha: c }) { - if (p = p || "linear", Yu(T.state.gradientDepth, p) === false) { + return yu(r16); + if (e === "elu") + return Ed(r16); + if (e === "relu6") + return Jd(r16); + if (e === "prelu") + return Kd(r16, t10); + if (e === "leakyrelu") + return Fd(r16, o); + if (e === "sigmoid") + return Pa(r16); + throw new Error(`Unknown fused activation ${e}.`); +} +var np = (r16, e) => !(r16 > 0) || e === "linear"; +function bX({ x: r16, filter: e, strides: t10, pad: o, dataFormat: n = "NHWC", dilations: s = [1, 1], dimRoundingMode: a, bias: i, activation: p = "linear", preluActivationWeights: u, leakyreluAlpha: l }) { + if (p = p || "linear", np(_.state.gradientDepth, p) === false) { $(n === "NHWC", () => `Error in fused conv2d: got dataFormat of ${n} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`); - let _ = nu(r15, t8, e, o, n, s, a); - return i != null && (_ = Ce(_, i)), Xu(_, p, u, c); + let T = du(r16, e, t10, o, n, s, a); + return i != null && (T = Ce(T, i)), op(T, p, u, l); } - let l = v(r15, "x", "conv2d", "float32"), m = v(t8, "filter", "conv2d", "float32"), d = l, f = false; - l.rank === 3 && (f = true, d = W(l, [1, l.shape[0], l.shape[1], l.shape[2]])), $(d.rank === 4, () => `Error in fused conv2d: input must be rank 4, but got rank ${d.rank}.`), $(m.rank === 4, () => `Error in fused conv2d: filter must be rank 4, but got rank ${m.rank}.`), Lt("fused conv2d", o, a); + let c = v(r16, "x", "conv2d", "float32"), m = v(e, "filter", "conv2d", "float32"), d = c, f = false; + c.rank === 3 && (f = true, d = W(c, [1, c.shape[0], c.shape[1], c.shape[2]])), $(d.rank === 4, () => `Error in fused conv2d: input must be rank 4, but got rank ${d.rank}.`), $(m.rank === 4, () => `Error in fused conv2d: filter must be rank 4, but got rank ${m.rank}.`), zt("fused conv2d", o, a); let h = n === "NHWC" ? d.shape[3] : d.shape[1]; - $(m.shape[2] === h, () => `Error in conv2d: depth of input (${h}) must match input depth for filter ${m.shape[2]}.`), $(gr(e, s), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`); - let g = Lu(d.shape, m.shape, e, s, o, a), x; - i != null && (x = v(i, "bias", "fused conv2d"), [x] = Oe(x, l), n === "NHWC" ? rt(g.outShape, x.shape) : ($(x.shape.length <= 1, () => `Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${x.shape.length}.`), $(x.shape.length === 0 || x.shape[0] === g.outChannels || x.shape[0] === 1, () => `Error in fused conv2d: bias shape (${x.shape}) is not compatible with the number of output channels (${g.outChannels})`))); + $(m.shape[2] === h, () => `Error in conv2d: depth of input (${h}) must match input depth for filter ${m.shape[2]}.`), $(br(t10, s), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${t10} and dilations '${s}'`); + let g = Ku(d.shape, m.shape, t10, s, o, a), x; + i != null && (x = v(i, "bias", "fused conv2d"), [x] = Oe(x, c), n === "NHWC" ? rt(g.outShape, x.shape) : ($(x.shape.length <= 1, () => `Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${x.shape.length}.`), $(x.shape.length === 0 || x.shape[0] === g.outChannels || x.shape[0] === 1, () => `Error in fused conv2d: bias shape (${x.shape}) is not compatible with the number of output channels (${g.outChannels})`))); let b; if (u != null) { - let _ = u.shape; - if ($(_.length <= 1 || _.length === 3, () => `Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${_.length}.`), _.length === 1) - $(_[0] === 1 || _[0] === g.outChannels, () => `Error in fused conv2d: PReLU activation weights (${_}) is not compatible with the number of output channels (${g.outChannels}).`); - else if (_.length === 3) + let T = u.shape; + if ($(T.length <= 1 || T.length === 3, () => `Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${T.length}.`), T.length === 1) + $(T[0] === 1 || T[0] === g.outChannels, () => `Error in fused conv2d: PReLU activation weights (${T}) is not compatible with the number of output channels (${g.outChannels}).`); + else if (T.length === 3) try { - rt(_, g.outShape); + rt(T, g.outShape); } catch (E) { - let R = `Error in fused conv2d: PReLU activation weights (${_}) is not compatible with the output shape of the conv2d (${g.outShape}).`; + let R = `Error in fused conv2d: PReLU activation weights (${T}) is not compatible with the output shape of the conv2d (${g.outShape}).`; throw Error(R); } b = v(u, "prelu weights", "fused conv2d"); } - let C = (_, E) => { + let w = (T, E) => { $(n === "NHWC", () => `Error in gradient of fused conv2D: got dataFormat of ${n} but only NHWC is currently supported.`); - let [R, D, P, O] = E, M = qu(_, P, p); - $(Mu(s), () => `Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`); - let L = hd(D.shape, M, R, e, o), B = Z1(D, M, R.shape, e, o), z = [L, B]; + let [R, D, F, O] = E, M = tp(T, F, p); + $(Hu(s), () => `Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`); + let L = Nd(D.shape, M, R, t10, o), B = WN(D, M, R.shape, t10, o), z = [L, B]; if (O != null) { - let U = ju(O, M); + let U = rp(O, M); z.push(U); } return z; - }, S = { x: d, filter: m, bias: x, preluActivationWeights: b }, k = { strides: e, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a, activation: p, leakyreluAlpha: c }; - return i == null ? Ir((E, R, D) => { - let P = T.runKernel(Io, S, k); - return D([R, E, P]), f && (P = W(P, [P.shape[1], P.shape[2], P.shape[3]])), { value: P, gradFunc: C }; - })(d, m) : Ir((E, R, D, P) => { - let O = T.runKernel(Io, S, k); - return P([R, E, O, D]), f && (O = W(O, [O.shape[1], O.shape[2], O.shape[3]])), { value: O, gradFunc: C }; + }, S = { x: d, filter: m, bias: x, preluActivationWeights: b }, k = { strides: t10, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a, activation: p, leakyreluAlpha: l }; + return i == null ? Nr((E, R, D) => { + let F = _.runKernel(jo, S, k); + return D([R, E, F]), f && (F = W(F, [F.shape[1], F.shape[2], F.shape[3]])), { value: F, gradFunc: w }; + })(d, m) : Nr((E, R, D, F) => { + let O = _.runKernel(jo, S, k); + return F([R, E, O, D]), f && (O = W(O, [O.shape[1], O.shape[2], O.shape[3]])), { value: O, gradFunc: w }; })(d, m, x); } -var J1 = N({ fusedConv2d_: K6 }); -function q6(r15, t8, e, o, n, s = [1, 1], a) { - let i = r15; - r15.rank === 3 && (i = W(r15, [1, r15.shape[0], r15.shape[1], r15.shape[2]])); - let p = t8; - p.rank === 3 && (p = W(t8, [1, t8.shape[0], t8.shape[1], t8.shape[2]])); - let u = { x: i, dy: p }, c = { strides: o, pad: n, dimRoundingMode: a, dilations: s, filterShape: e }; - return T.runKernel(Fi, u, c); -} -var eN = N({ depthwiseConv2dNativeBackpropFilter_: q6 }); -function j6(r15, t8, e, o, n, s = [1, 1], a) { - let i = t8, p = false; - t8.rank === 3 && (p = true, i = W(t8, [1, t8.shape[0], t8.shape[1], t8.shape[2]])); - let u = { dy: i, filter: e }, c = { strides: o, pad: n, dimRoundingMode: a, dilations: s, inputShape: r15 }, l = T.runKernel(Pi, u, c); - return p ? W(l, [l.shape[1], l.shape[2], l.shape[3]]) : l; -} -var tN = N({ depthwiseConv2dNativeBackpropInput_: j6 }); -function X6({ x: r15, filter: t8, strides: e, pad: o, dataFormat: n = "NHWC", dilations: s = [1, 1], dimRoundingMode: a, bias: i, activation: p = "linear", preluActivationWeights: u, leakyreluAlpha: c }) { - if (Yu(T.state.gradientDepth, p) === false) { - let k = oc(r15, t8, e, o, n, s, a); - return i != null && (k = Ce(k, i)), Xu(k, p, u, c); - } - let l = v(r15, "x", "depthwiseConv2d", "float32"), m = v(t8, "filter", "depthwiseConv2d", "float32"), d = l, f = false; - l.rank === 3 && (f = true, d = W(l, [1, l.shape[0], l.shape[1], l.shape[2]])), $(d.rank === 4, () => `Error in fused depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`), $(m.rank === 4, () => `Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${m.rank}.`), $(d.shape[3] === m.shape[2], () => `Error in fused depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${m.shape[2]}.`), s == null && (s = [1, 1]), $(gr(e, s), () => `Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`), Lt("fused depthwiseConv2d", o, a); - let h = Lu(d.shape, m.shape, e, s, o, a, true), g; - i != null && (g = v(i, "bias", "fused conv2d"), [g] = Oe(g, l), rt(h.outShape, g.shape)); +var UN = N({ fusedConv2d_: bX }); +function CX(r16, e, t10, o, n, s = [1, 1], a) { + let i = r16; + r16.rank === 3 && (i = W(r16, [1, r16.shape[0], r16.shape[1], r16.shape[2]])); + let p = e; + p.rank === 3 && (p = W(e, [1, e.shape[0], e.shape[1], e.shape[2]])); + let u = { x: i, dy: p }, l = { strides: o, pad: n, dimRoundingMode: a, dilations: s, filterShape: t10 }; + return _.runKernel(Gi, u, l); +} +var GN = N({ depthwiseConv2dNativeBackpropFilter_: CX }); +function wX(r16, e, t10, o, n, s = [1, 1], a) { + let i = e, p = false; + e.rank === 3 && (p = true, i = W(e, [1, e.shape[0], e.shape[1], e.shape[2]])); + let u = { dy: i, filter: t10 }, l = { strides: o, pad: n, dimRoundingMode: a, dilations: s, inputShape: r16 }, c = _.runKernel(Hi, u, l); + return p ? W(c, [c.shape[1], c.shape[2], c.shape[3]]) : c; +} +var HN = N({ depthwiseConv2dNativeBackpropInput_: wX }); +function SX({ x: r16, filter: e, strides: t10, pad: o, dataFormat: n = "NHWC", dilations: s = [1, 1], dimRoundingMode: a, bias: i, activation: p = "linear", preluActivationWeights: u, leakyreluAlpha: l }) { + if (np(_.state.gradientDepth, p) === false) { + let k = cl(r16, e, t10, o, n, s, a); + return i != null && (k = Ce(k, i)), op(k, p, u, l); + } + let c = v(r16, "x", "depthwiseConv2d", "float32"), m = v(e, "filter", "depthwiseConv2d", "float32"), d = c, f = false; + c.rank === 3 && (f = true, d = W(c, [1, c.shape[0], c.shape[1], c.shape[2]])), $(d.rank === 4, () => `Error in fused depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`), $(m.rank === 4, () => `Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${m.rank}.`), $(d.shape[3] === m.shape[2], () => `Error in fused depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${m.shape[2]}.`), s == null && (s = [1, 1]), $(br(t10, s), () => `Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${t10} and dilations '${s}'`), zt("fused depthwiseConv2d", o, a); + let h = Ku(d.shape, m.shape, t10, s, o, a, true), g; + i != null && (g = v(i, "bias", "fused conv2d"), [g] = Oe(g, c), rt(h.outShape, g.shape)); let x; u != null && (x = v(u, "prelu weights", "fused depthwiseConv2d")); - let b = (k, _) => { - $(Mu(s), () => `Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`); - let [E, R, D, P] = _, O = qu(k, D, p), M = tN(R.shape, O, E, e, o, s, a), L = eN(R, O, E.shape, e, o, s, a); - if (P != null) { - let B = ju(g, O); + let b = (k, T) => { + $(Hu(s), () => `Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`); + let [E, R, D, F] = T, O = tp(k, D, p), M = HN(R.shape, O, E, t10, o, s, a), L = GN(R, O, E.shape, t10, o, s, a); + if (F != null) { + let B = rp(g, O); return [M, L, B]; } return [M, L]; - }, C = { x: d, filter: m, bias: g, preluActivationWeights: x }, S = { strides: e, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a, activation: p, leakyreluAlpha: c }; - return i == null ? Ir((_, E, R) => { - let D = T.runKernel(vo, C, S); - return R([E, _, D]), f && (D = W(D, [D.shape[1], D.shape[2], D.shape[3]])), { value: D, gradFunc: b }; - })(d, m) : Ir((_, E, R, D) => { - let P = T.runKernel(vo, C, S); - return D([E, _, P, R]), f && (P = W(P, [P.shape[1], P.shape[2], P.shape[3]])), { value: P, gradFunc: b }; + }, w = { x: d, filter: m, bias: g, preluActivationWeights: x }, S = { strides: t10, pad: o, dataFormat: n, dilations: s, dimRoundingMode: a, activation: p, leakyreluAlpha: l }; + return i == null ? Nr((T, E, R) => { + let D = _.runKernel(Xo, w, S); + return R([E, T, D]), f && (D = W(D, [D.shape[1], D.shape[2], D.shape[3]])), { value: D, gradFunc: b }; + })(d, m) : Nr((T, E, R, D) => { + let F = _.runKernel(Xo, w, S); + return D([E, T, F, R]), f && (F = W(F, [F.shape[1], F.shape[2], F.shape[3]])), { value: F, gradFunc: b }; })(d, m, g); } -var rN = N({ fusedDepthwiseConv2d_: X6 }); -function Y6({ a: r15, b: t8, transposeA: e = false, transposeB: o = false, bias: n, activation: s = "linear", preluActivationWeights: a, leakyreluAlpha: i = 0.2 }) { - if (Yu(T.state.gradientDepth, s) === false) { - let O = Ze(r15, t8, e, o); - return n != null && (O = Ce(O, n)), Xu(O, s, a, i); +var KN = N({ fusedDepthwiseConv2d_: SX }); +function IX({ a: r16, b: e, transposeA: t10 = false, transposeB: o = false, bias: n, activation: s = "linear", preluActivationWeights: a, leakyreluAlpha: i = 0.2 }) { + if (np(_.state.gradientDepth, s) === false) { + let O = Je(r16, e, t10, o); + return n != null && (O = Ce(O, n)), op(O, s, a, i); } - let p = v(r15, "a", "fused matMul"), u = v(t8, "b", "fused matMul"); + let p = v(r16, "a", "fused matMul"), u = v(e, "b", "fused matMul"); [p, u] = Oe(p, u); - let c = e ? p.shape[p.rank - 2] : p.shape[p.rank - 1], l = o ? u.shape[u.rank - 1] : u.shape[u.rank - 2], m = e ? p.shape[p.rank - 1] : p.shape[p.rank - 2], d = o ? u.shape[u.rank - 2] : u.shape[u.rank - 1], f = p.shape.slice(0, -2), h = u.shape.slice(0, -2), g = He(f), x = He(h); - $(c === l, () => `Error in fused matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${p.shape} and ${u.shape} and transposeA=${e} and transposeB=${o} must match.`); - let C = rt(p.shape.slice(0, -2), u.shape.slice(0, -2)).concat([m, d]), S = e ? W(p, [g, c, m]) : W(p, [g, m, c]), k = o ? W(u, [x, d, l]) : W(u, [x, l, d]), _; - n != null && (_ = v(n, "bias", "fused matMul"), [_] = Oe(_, p), rt(C, _.shape)); + let l = t10 ? p.shape[p.rank - 2] : p.shape[p.rank - 1], c = o ? u.shape[u.rank - 1] : u.shape[u.rank - 2], m = t10 ? p.shape[p.rank - 1] : p.shape[p.rank - 2], d = o ? u.shape[u.rank - 2] : u.shape[u.rank - 1], f = p.shape.slice(0, -2), h = u.shape.slice(0, -2), g = ze(f), x = ze(h); + $(l === c, () => `Error in fused matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${p.shape} and ${u.shape} and transposeA=${t10} and transposeB=${o} must match.`); + let w = rt(p.shape.slice(0, -2), u.shape.slice(0, -2)).concat([m, d]), S = t10 ? W(p, [g, l, m]) : W(p, [g, m, l]), k = o ? W(u, [x, d, c]) : W(u, [x, c, d]), T; + n != null && (T = v(n, "bias", "fused matMul"), [T] = Oe(T, p), rt(w, T.shape)); let E; a != null && (E = v(a, "prelu weights", "fused matMul")); let R = (O, M) => { - let [L, B, z, U] = M, j = qu(W(O, z.shape), z, s), q, Y; - if (!e && !o ? (q = Ze(j, B, false, true), Y = Ze(L, j, true, false)) : !e && o ? (q = Ze(j, B, false, false), Y = Ze(j, L, true, false)) : e && !o ? (q = Ze(B, j, false, true), Y = Ze(L, j, false, false)) : (q = Ze(B, j, true, true), Y = Ze(j, L, true, true)), n != null) { - let J = ju(U, j); + let [L, B, z, U] = M, j = tp(W(O, z.shape), z, s), q, Y; + if (!t10 && !o ? (q = Je(j, B, false, true), Y = Je(L, j, true, false)) : !t10 && o ? (q = Je(j, B, false, false), Y = Je(j, L, true, false)) : t10 && !o ? (q = Je(B, j, false, true), Y = Je(L, j, false, false)) : (q = Je(B, j, true, true), Y = Je(j, L, true, true)), n != null) { + let J = rp(U, j); return [q, Y, J]; } else return [q, Y]; - }, D = { a: S, b: k, bias: _, preluActivationWeights: E }, P = { transposeA: e, transposeB: o, activation: s, leakyreluAlpha: i }; - return n == null ? Ir((M, L, B) => { - let z = T.runKernel(So, D, P); - return B([M, L, z]), { value: W(z, C), gradFunc: R }; - })(S, k) : Ir((M, L, B, z) => { - let U = T.runKernel(So, D, P); - return z([M, L, U, B]), { value: W(U, C), gradFunc: R }; - })(S, k, _); -} -var oN = N({ fusedMatMul_: Y6 }); -function Q6(r15) { - return _l(r15, 0.54, 0.46); -} -var nN = N({ hammingWindow_: Q6 }); -function Z6(r15) { - return _l(r15, 0.5, 0.5); -} -var Yd = N({ hannWindow_: Z6 }); -function J6(r15, t8, e, o = false, n = 0) { + }, D = { a: S, b: k, bias: T, preluActivationWeights: E }, F = { transposeA: t10, transposeB: o, activation: s, leakyreluAlpha: i }; + return n == null ? Nr((M, L, B) => { + let z = _.runKernel(qo, D, F); + return B([M, L, z]), { value: W(z, w), gradFunc: R }; + })(S, k) : Nr((M, L, B, z) => { + let U = _.runKernel(qo, D, F); + return z([M, L, U, B]), { value: W(U, w), gradFunc: R }; + })(S, k, T); +} +var qN = N({ fusedMatMul_: IX }); +function vX(r16) { + return Mc(r16, 0.54, 0.46); +} +var jN = N({ hammingWindow_: vX }); +function kX(r16) { + return Mc(r16, 0.5, 0.5); +} +var uf = N({ hannWindow_: kX }); +function NX(r16, e, t10, o = false, n = 0) { let s = 0, a = []; - for (; s + t8 <= r15.size; ) - a.push(Xe(r15, s, t8)), s += e; + for (; s + e <= r16.size; ) + a.push(Ye(r16, s, e)), s += t10; if (o) - for (; s < r15.size; ) { - let i = s + t8 - r15.size, p = yt([Xe(r15, s, t8 - i), Ea([i], n)]); - a.push(p), s += e; + for (; s < r16.size; ) { + let i = s + e - r16.size, p = bt([Ye(r16, s, e - i), Ma([i], n)]); + a.push(p), s += t10; } - return a.length === 0 ? cu([], [0, t8]) : W(yt(a), [a.length, t8]); + return a.length === 0 ? bu([], [0, e]) : W(bt(a), [a.length, e]); } -var Qd = N({ frame_: J6 }); -function ej(r15, t8, e, o, n = Yd) { - o == null && (o = Qw(t8)); - let s = Qd(r15, t8, e), a = se(s, n(t8)); - return ic(a, o); +var pf = N({ frame_: NX }); +function TX(r16, e, t10, o, n = uf) { + o == null && (o = cS(e)); + let s = pf(r16, e, t10), a = se(s, n(e)); + return hl(a, o); } -var sN = N({ stft_: ej }); -function tj(r15, t8, e, o, n = "bilinear", s = 0) { - let a = v(r15, "image", "cropAndResize"), i = v(t8, "boxes", "cropAndResize", "float32"), p = v(e, "boxInd", "cropAndResize", "int32"), u = i.shape[0]; +var XN = N({ stft_: TX }); +function _X(r16, e, t10, o, n = "bilinear", s = 0) { + let a = v(r16, "image", "cropAndResize"), i = v(e, "boxes", "cropAndResize", "float32"), p = v(t10, "boxInd", "cropAndResize", "int32"), u = i.shape[0]; $(a.rank === 4, () => `Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`), $(i.rank === 2 && i.shape[1] === 4, () => `Error in cropAndResize: boxes must be have size [${u},4] but had shape ${i.shape}.`), $(p.rank === 1 && p.shape[0] === u, () => `Error in cropAndResize: boxInd must be have size [${u}] but had shape ${i.shape}.`), $(o.length === 2, () => `Error in cropAndResize: cropSize must be of length 2, but got length ${o.length}.`), $(o[0] >= 1 && o[1] >= 1, () => `cropSize must be atleast [1,1], but was ${o}`), $(n === "bilinear" || n === "nearest", () => `method must be bilinear or nearest, but was ${n}`); - let c = { image: a, boxes: i, boxInd: p }, l = { method: n, extrapolationValue: s, cropSize: o }; - return T.runKernel(cn, c, l); -} -var aN = N({ cropAndResize_: tj }); -function rj(r15) { - let t8 = v(r15, "image", "flipLeftRight", "float32"); - $(t8.rank === 4, () => `Error in flipLeftRight: image must be rank 4,but got rank ${t8.rank}.`); - let e = { image: t8 }; - return T.runKernel(Cn, e, {}); -} -var iN = N({ flipLeftRight_: rj }); -function oj(r15) { - let t8 = v(r15, "image", "grayscaleToRGB"), e = t8.rank - 1, o = t8.shape[e]; - $(t8.rank >= 2, () => `Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t8.rank}.`), $(o === 1, () => `Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${o}.`); - let n = new Array(t8.rank); - return n.fill(1, 0, e), n[e] = 3, au(t8, n); -} -var uN = N({ grayscaleToRGB_: oj }); -function nj(r15) { - let t8 = v(r15, "image", "RGBToGrayscale"), e = t8.rank - 1, o = t8.shape[e]; - $(t8.rank >= 2, () => `Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t8.rank}.`), $(o === 3, () => `Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${o}.`); - let n = t8.dtype, s = We(t8, "float32"), a = Jt([0.2989, 0.587, 0.114]), i; - switch (t8.rank) { + let l = { image: a, boxes: i, boxInd: p }, c = { method: n, extrapolationValue: s, cropSize: o }; + return _.runKernel(Mn, l, c); +} +var YN = N({ cropAndResize_: _X }); +function EX(r16) { + let e = v(r16, "image", "flipLeftRight", "float32"); + $(e.rank === 4, () => `Error in flipLeftRight: image must be rank 4,but got rank ${e.rank}.`); + let t10 = { image: e }; + return _.runKernel(Gn, t10, {}); +} +var QN = N({ flipLeftRight_: EX }); +function $X(r16) { + let e = v(r16, "image", "grayscaleToRGB"), t10 = e.rank - 1, o = e.shape[t10]; + $(e.rank >= 2, () => `Error in grayscaleToRGB: images must be at least rank 2, but got rank ${e.rank}.`), $(o === 1, () => `Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${o}.`); + let n = new Array(e.rank); + return n.fill(1, 0, t10), n[t10] = 3, hu(e, n); +} +var ZN = N({ grayscaleToRGB_: $X }); +function RX(r16) { + let e = v(r16, "image", "RGBToGrayscale"), t10 = e.rank - 1, o = e.shape[t10]; + $(e.rank >= 2, () => `Error in RGBToGrayscale: images must be at least rank 2, but got rank ${e.rank}.`), $(o === 3, () => `Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${o}.`); + let n = e.dtype, s = Ue(e, "float32"), a = rr([0.2989, 0.587, 0.114]), i; + switch (e.rank) { case 2: - i = su("ij,j->i", s, a); + i = fu("ij,j->i", s, a); break; case 3: - i = su("ijk,k->ij", s, a); + i = fu("ijk,k->ij", s, a); break; case 4: - i = su("ijkl,l->ijk", s, a); + i = fu("ijkl,l->ijk", s, a); break; case 5: - i = su("ijklm,m->ijkl", s, a); + i = fu("ijklm,m->ijkl", s, a); break; case 6: - i = su("ijklmn,n->ijklm", s, a); + i = fu("ijklmn,n->ijklm", s, a); break; default: throw new Error("Not a valid tensor rank."); } - return i = Ms(i, -1), We(i, n); + return i = Ks(i, -1), Ue(i, n); } -var pN = N({ rgbToGrayscale_: nj }); -function sj(r15, t8, e = 0, o = 0.5) { - let n = v(r15, "image", "rotateWithOffset", "float32"); +var JN = N({ rgbToGrayscale_: RX }); +function DX(r16, e, t10 = 0, o = 0.5) { + let n = v(r16, "image", "rotateWithOffset", "float32"); $(n.rank === 4, () => `Error in rotateWithOffset: image must be rank 4,but got rank ${n.rank}.`); - let s = { image: n }, a = { radians: t8, fillValue: e, center: o }; - return T.runKernel(Ds, s, a); + let s = { image: n }, a = { radians: e, fillValue: t10, center: o }; + return _.runKernel(Vs, s, a); } -var cN = N({ rotateWithOffset_: sj }); -function $o(r15, t8, e, o, n, s) { +var eT = N({ rotateWithOffset_: DX }); +function en(r16, e, t10, o, n, s) { o == null && (o = 0.5), n == null && (n = Number.NEGATIVE_INFINITY), s == null && (s = 0); - let a = r15.shape[0]; - return e = Math.min(e, a), $(0 <= o && o <= 1, () => `iouThreshold must be in [0, 1], but was '${o}'`), $(r15.rank === 2, () => `boxes must be a 2D tensor, but was of rank '${r15.rank}'`), $(r15.shape[1] === 4, () => `boxes must have 4 columns, but 2nd dimension was ${r15.shape[1]}`), $(t8.rank === 1, () => "scores must be a 1D tensor"), $(t8.shape[0] === a, () => `scores has incompatible shape with boxes. Expected ${a}, but was ${t8.shape[0]}`), $(0 <= s && s <= 1, () => `softNmsSigma must be in [0, 1], but was '${s}'`), { maxOutputSize: e, iouThreshold: o, scoreThreshold: n, softNmsSigma: s }; + let a = r16.shape[0]; + return t10 = Math.min(t10, a), $(0 <= o && o <= 1, () => `iouThreshold must be in [0, 1], but was '${o}'`), $(r16.rank === 2, () => `boxes must be a 2D tensor, but was of rank '${r16.rank}'`), $(r16.shape[1] === 4, () => `boxes must have 4 columns, but 2nd dimension was ${r16.shape[1]}`), $(e.rank === 1, () => "scores must be a 1D tensor"), $(e.shape[0] === a, () => `scores has incompatible shape with boxes. Expected ${a}, but was ${e.shape[0]}`), $(0 <= s && s <= 1, () => `softNmsSigma must be in [0, 1], but was '${s}'`), { maxOutputSize: t10, iouThreshold: o, scoreThreshold: n, softNmsSigma: s }; } -function aj(r15, t8, e, o = 0.5, n = Number.NEGATIVE_INFINITY) { - let s = v(r15, "boxes", "nonMaxSuppression", "float32"), a = v(t8, "scores", "nonMaxSuppression", "float32"), i = $o(s, a, e, o, n); - e = i.maxOutputSize, o = i.iouThreshold, n = i.scoreThreshold; - let p = { maxOutputSize: e, iouThreshold: o, scoreThreshold: n }; - return T.runKernel(Qn, { boxes: s, scores: a }, p); +function AX(r16, e, t10, o = 0.5, n = Number.NEGATIVE_INFINITY) { + let s = v(r16, "boxes", "nonMaxSuppression", "float32"), a = v(e, "scores", "nonMaxSuppression", "float32"), i = en(s, a, t10, o, n); + t10 = i.maxOutputSize, o = i.iouThreshold, n = i.scoreThreshold; + let p = { maxOutputSize: t10, iouThreshold: o, scoreThreshold: n }; + return _.runKernel(cs, { boxes: s, scores: a }, p); } -var lN = N({ nonMaxSuppression_: aj }); -function mN(r15, t8, e) { - let o = ij(r15, t8, e), n = o < 0 ? -(o + 1) : o; - r15.splice(n, 0, t8); +var tT = N({ nonMaxSuppression_: AX }); +function rT(r16, e, t10) { + let o = FX(r16, e, t10), n = o < 0 ? -(o + 1) : o; + r16.splice(n, 0, e); } -function ij(r15, t8, e) { - return pj(r15, t8, e || uj); +function FX(r16, e, t10) { + return OX(r16, e, t10 || PX); } -function uj(r15, t8) { - return r15 > t8 ? 1 : r15 < t8 ? -1 : 0; +function PX(r16, e) { + return r16 > e ? 1 : r16 < e ? -1 : 0; } -function pj(r15, t8, e) { - let o = 0, n = r15.length, s = 0, a = false; +function OX(r16, e, t10) { + let o = 0, n = r16.length, s = 0, a = false; for (; o < n; ) { s = o + (n - o >>> 1); - let i = e(t8, r15[s]); + let i = t10(e, r16[s]); i > 0 ? o = s + 1 : (n = s, a = !i); } return a ? o : -o - 1; } -function Zd(r15, t8, e, o, n) { - return Jw(r15, t8, e, o, n, 0); +function lf(r16, e, t10, o, n) { + return dS(r16, e, t10, o, n, 0); } -function Jd(r15, t8, e, o, n, s) { - return Jw(r15, t8, e, o, n, 0, false, s, true); +function cf(r16, e, t10, o, n, s) { + return dS(r16, e, t10, o, n, 0, false, s, true); } -function ef(r15, t8, e, o, n, s) { - return Jw(r15, t8, e, o, n, s, true); +function mf(r16, e, t10, o, n, s) { + return dS(r16, e, t10, o, n, s, true); } -function Jw(r15, t8, e, o, n, s, a = false, i = false, p = false) { +function dS(r16, e, t10, o, n, s, a = false, i = false, p = false) { let u = []; - for (let g = 0; g < t8.length; g++) - t8[g] > n && u.push({ score: t8[g], boxIndex: g, suppressBeginIndex: 0 }); - u.sort(dN); - let c = s > 0 ? -0.5 / s : 0, l = [], m = []; - for (; l.length < e && u.length > 0; ) { - let g = u.pop(), { score: x, boxIndex: b, suppressBeginIndex: C } = g; + for (let g = 0; g < e.length; g++) + e[g] > n && u.push({ score: e[g], boxIndex: g, suppressBeginIndex: 0 }); + u.sort(oT); + let l = s > 0 ? -0.5 / s : 0, c = [], m = []; + for (; c.length < t10 && u.length > 0; ) { + let g = u.pop(), { score: x, boxIndex: b, suppressBeginIndex: w } = g; if (x < n) break; let S = false; - for (let k = l.length - 1; k >= C; --k) { - let _ = cj(r15, b, l[k]); - if (_ >= o) { + for (let k = c.length - 1; k >= w; --k) { + let T = MX(r16, b, c[k]); + if (T >= o) { S = true; break; } - if (g.score = g.score * lj(o, c, _), g.score <= n) + if (g.score = g.score * LX(o, l, T), g.score <= n) break; } - g.suppressBeginIndex = l.length, S || (g.score === x ? (l.push(b), m.push(g.score)) : g.score > n && mN(u, g, dN)); + g.suppressBeginIndex = c.length, S || (g.score === x ? (c.push(b), m.push(g.score)) : g.score > n && rT(u, g, oT)); } - let d = l.length, f = e - d; - i && f > 0 && (l.push(...new Array(f).fill(0)), m.push(...new Array(f).fill(0))); - let h = { selectedIndices: l }; + let d = c.length, f = t10 - d; + i && f > 0 && (c.push(...new Array(f).fill(0)), m.push(...new Array(f).fill(0))); + let h = { selectedIndices: c }; return a && (h.selectedScores = m), p && (h.validOutputs = d), h; } -function cj(r15, t8, e) { - let o = r15.subarray(t8 * 4, t8 * 4 + 4), n = r15.subarray(e * 4, e * 4 + 4), s = Math.min(o[0], o[2]), a = Math.min(o[1], o[3]), i = Math.max(o[0], o[2]), p = Math.max(o[1], o[3]), u = Math.min(n[0], n[2]), c = Math.min(n[1], n[3]), l = Math.max(n[0], n[2]), m = Math.max(n[1], n[3]), d = (i - s) * (p - a), f = (l - u) * (m - c); +function MX(r16, e, t10) { + let o = r16.subarray(e * 4, e * 4 + 4), n = r16.subarray(t10 * 4, t10 * 4 + 4), s = Math.min(o[0], o[2]), a = Math.min(o[1], o[3]), i = Math.max(o[0], o[2]), p = Math.max(o[1], o[3]), u = Math.min(n[0], n[2]), l = Math.min(n[1], n[3]), c = Math.max(n[0], n[2]), m = Math.max(n[1], n[3]), d = (i - s) * (p - a), f = (c - u) * (m - l); if (d <= 0 || f <= 0) return 0; - let h = Math.max(s, u), g = Math.max(a, c), x = Math.min(i, l), b = Math.min(p, m), C = Math.max(x - h, 0) * Math.max(b - g, 0); - return C / (d + f - C); -} -function lj(r15, t8, e) { - let o = Math.exp(t8 * e * e); - return e <= r15 ? o : 0; -} -function dN(r15, t8) { - return r15.score - t8.score || r15.score === t8.score && t8.boxIndex - r15.boxIndex; -} -async function mj(r15, t8, e, o = 0.5, n = Number.NEGATIVE_INFINITY) { - let s = v(r15, "boxes", "nonMaxSuppressionAsync"), a = v(t8, "scores", "nonMaxSuppressionAsync"), i = $o(s, a, e, o, n); - e = i.maxOutputSize, o = i.iouThreshold, n = i.scoreThreshold; - let p = await Promise.all([s.data(), a.data()]), u = p[0], c = p[1], { selectedIndices: l } = Zd(u, c, e, o, n); - return s !== r15 && s.dispose(), a !== t8 && a.dispose(), Jt(l, "int32"); -} -var fN = mj; -function dj(r15, t8, e, o = 0.5, n = Number.NEGATIVE_INFINITY, s = 0) { - let a = v(r15, "boxes", "nonMaxSuppression"), i = v(t8, "scores", "nonMaxSuppression"), p = $o(a, i, e, o, n, s); - e = p.maxOutputSize, o = p.iouThreshold, n = p.scoreThreshold, s = p.softNmsSigma; - let u = { boxes: a, scores: i }, c = { maxOutputSize: e, iouThreshold: o, scoreThreshold: n, softNmsSigma: s }, l = T.runKernel(Zn, u, c); - return { selectedIndices: l[0], selectedScores: l[1] }; -} -var hN = N({ nonMaxSuppressionWithScore_: dj }); -async function fj(r15, t8, e, o = 0.5, n = Number.NEGATIVE_INFINITY, s = 0) { - let a = v(r15, "boxes", "nonMaxSuppressionAsync"), i = v(t8, "scores", "nonMaxSuppressionAsync"), p = $o(a, i, e, o, n, s); - e = p.maxOutputSize, o = p.iouThreshold, n = p.scoreThreshold, s = p.softNmsSigma; - let u = await Promise.all([a.data(), i.data()]), c = u[0], l = u[1], { selectedIndices: m, selectedScores: d } = ef(c, l, e, o, n, s); - return a !== r15 && a.dispose(), i !== t8 && i.dispose(), { selectedIndices: Jt(m, "int32"), selectedScores: Jt(d) }; -} -var gN = fj; -function hj(r15, t8, e, o = 0.5, n = Number.NEGATIVE_INFINITY, s = false) { - let a = v(r15, "boxes", "nonMaxSuppression"), i = v(t8, "scores", "nonMaxSuppression"), p = $o(a, i, e, o, n, null), u = p.maxOutputSize, c = p.iouThreshold, l = p.scoreThreshold, m = { boxes: a, scores: i }, d = { maxOutputSize: u, iouThreshold: c, scoreThreshold: l, padToMaxOutputSize: s }, f = T.runKernel(Qa, m, d); + let h = Math.max(s, u), g = Math.max(a, l), x = Math.min(i, c), b = Math.min(p, m), w = Math.max(x - h, 0) * Math.max(b - g, 0); + return w / (d + f - w); +} +function LX(r16, e, t10) { + let o = Math.exp(e * t10 * t10); + return t10 <= r16 ? o : 0; +} +function oT(r16, e) { + return r16.score - e.score || r16.score === e.score && e.boxIndex - r16.boxIndex; +} +async function BX(r16, e, t10, o = 0.5, n = Number.NEGATIVE_INFINITY) { + let s = v(r16, "boxes", "nonMaxSuppressionAsync"), a = v(e, "scores", "nonMaxSuppressionAsync"), i = en(s, a, t10, o, n); + t10 = i.maxOutputSize, o = i.iouThreshold, n = i.scoreThreshold; + let p = await Promise.all([s.data(), a.data()]), u = p[0], l = p[1], { selectedIndices: c } = lf(u, l, t10, o, n); + return s !== r16 && s.dispose(), a !== e && a.dispose(), rr(c, "int32"); +} +var nT = BX; +function zX(r16, e, t10, o = 0.5, n = Number.NEGATIVE_INFINITY, s = 0) { + let a = v(r16, "boxes", "nonMaxSuppression"), i = v(e, "scores", "nonMaxSuppression"), p = en(a, i, t10, o, n, s); + t10 = p.maxOutputSize, o = p.iouThreshold, n = p.scoreThreshold, s = p.softNmsSigma; + let u = { boxes: a, scores: i }, l = { maxOutputSize: t10, iouThreshold: o, scoreThreshold: n, softNmsSigma: s }, c = _.runKernel(ms, u, l); + return { selectedIndices: c[0], selectedScores: c[1] }; +} +var sT = N({ nonMaxSuppressionWithScore_: zX }); +async function VX(r16, e, t10, o = 0.5, n = Number.NEGATIVE_INFINITY, s = 0) { + let a = v(r16, "boxes", "nonMaxSuppressionAsync"), i = v(e, "scores", "nonMaxSuppressionAsync"), p = en(a, i, t10, o, n, s); + t10 = p.maxOutputSize, o = p.iouThreshold, n = p.scoreThreshold, s = p.softNmsSigma; + let u = await Promise.all([a.data(), i.data()]), l = u[0], c = u[1], { selectedIndices: m, selectedScores: d } = mf(l, c, t10, o, n, s); + return a !== r16 && a.dispose(), i !== e && i.dispose(), { selectedIndices: rr(m, "int32"), selectedScores: rr(d) }; +} +var aT = VX; +function WX(r16, e, t10, o = 0.5, n = Number.NEGATIVE_INFINITY, s = false) { + let a = v(r16, "boxes", "nonMaxSuppression"), i = v(e, "scores", "nonMaxSuppression"), p = en(a, i, t10, o, n, null), u = p.maxOutputSize, l = p.iouThreshold, c = p.scoreThreshold, m = { boxes: a, scores: i }, d = { maxOutputSize: u, iouThreshold: l, scoreThreshold: c, padToMaxOutputSize: s }, f = _.runKernel(ni, m, d); return { selectedIndices: f[0], validOutputs: f[1] }; } -var xN = N({ nonMaxSuppressionPadded_: hj }); -async function gj(r15, t8, e, o = 0.5, n = Number.NEGATIVE_INFINITY, s = false) { - let a = v(r15, "boxes", "nonMaxSuppressionAsync"), i = v(t8, "scores", "nonMaxSuppressionAsync"), p = $o(a, i, e, o, n, null), u = p.maxOutputSize, c = p.iouThreshold, l = p.scoreThreshold, [m, d] = await Promise.all([a.data(), i.data()]), { selectedIndices: f, validOutputs: h } = Jd(m, d, u, c, l, s); - return a !== r15 && a.dispose(), i !== t8 && i.dispose(), { selectedIndices: Jt(f, "int32"), validOutputs: ke(h, "int32") }; +var iT = N({ nonMaxSuppressionPadded_: WX }); +async function UX(r16, e, t10, o = 0.5, n = Number.NEGATIVE_INFINITY, s = false) { + let a = v(r16, "boxes", "nonMaxSuppressionAsync"), i = v(e, "scores", "nonMaxSuppressionAsync"), p = en(a, i, t10, o, n, null), u = p.maxOutputSize, l = p.iouThreshold, c = p.scoreThreshold, [m, d] = await Promise.all([a.data(), i.data()]), { selectedIndices: f, validOutputs: h } = cf(m, d, u, l, c, s); + return a !== r16 && a.dispose(), i !== e && i.dispose(), { selectedIndices: rr(f, "int32"), validOutputs: ke(h, "int32") }; } -var yN = gj; -function xj(r15, t8, e = false, o = false) { - let n = v(r15, "images", "resizeBilinear"); - $(n.rank === 3 || n.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got rank ${n.rank}.`), $(t8.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ${t8}.`), $(o === false || e === false, () => "Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."); +var uT = UX; +function GX(r16, e, t10 = false, o = false) { + let n = v(r16, "images", "resizeBilinear"); + $(n.rank === 3 || n.rank === 4, () => `Error in resizeBilinear: x must be rank 3 or 4, but got rank ${n.rank}.`), $(e.length === 2, () => `Error in resizeBilinear: new shape must 2D, but got shape ${e}.`), $(o === false || t10 === false, () => "Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false."); let s = n, a = false; n.rank === 3 && (a = true, s = W(n, [1, n.shape[0], n.shape[1], n.shape[2]])); - let [] = t8, i = { images: s }, p = { alignCorners: e, halfPixelCenters: o, size: t8 }, u = T.runKernel(is, i, p); + let [] = e, i = { images: s }, p = { alignCorners: t10, halfPixelCenters: o, size: e }, u = _.runKernel(Cs, i, p); return a ? W(u, [u.shape[1], u.shape[2], u.shape[3]]) : u; } -var bN = N({ resizeBilinear_: xj }); -function yj(r15, t8, e = false, o = false) { - let n = v(r15, "images", "resizeNearestNeighbor"); - $(n.rank === 3 || n.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${n.rank}.`), $(t8.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t8}.`), $(n.dtype === "float32" || n.dtype === "int32", () => "`images` must have `int32` or `float32` as dtype"), $(o === false || e === false, () => "Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."); +var pT = N({ resizeBilinear_: GX }); +function HX(r16, e, t10 = false, o = false) { + let n = v(r16, "images", "resizeNearestNeighbor"); + $(n.rank === 3 || n.rank === 4, () => `Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${n.rank}.`), $(e.length === 2, () => `Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`), $(n.dtype === "float32" || n.dtype === "int32", () => "`images` must have `int32` or `float32` as dtype"), $(o === false || t10 === false, () => "Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false."); let s = n, a = false; n.rank === 3 && (a = true, s = W(n, [1, n.shape[0], n.shape[1], n.shape[2]])); - let [] = t8, i = { images: s }, p = { alignCorners: e, halfPixelCenters: o, size: t8 }, u = T.runKernel(as, i, p); + let [] = e, i = { images: s }, p = { alignCorners: t10, halfPixelCenters: o, size: e }, u = _.runKernel(bs, i, p); return a ? W(u, [u.shape[1], u.shape[2], u.shape[3]]) : u; } -var CN = N({ resizeNearestNeighbor_: yj }); -function bj(r15, t8 = "binary", e = false, o = 0.5) { - let n = v(r15, "image", "threshold"), s = 0.2989, a = 0.587, i = 0.114, p = n.shape[0] * n.shape[1], u = se(Jt([o]), 255), c, l, m, d; - if ($(n.rank === 3, () => `Error in threshold: image must be rank 3,but got rank ${n.rank}.`), $(n.shape[2] === 3 || n.shape[2] === 1, () => `Error in threshold: image color channel must be equal to 3 or 1but got ${n.shape[2]}.`), $(n.dtype === "int32" || n.dtype === "float32", () => `Error in dtype: image dtype must be int32 or float32,but got dtype ${n.dtype}.`), $(t8 === "otsu" || t8 === "binary", () => `Method must be binary or otsu, but was ${t8}`), n.shape[2] === 3) { - [c, l, m] = ci(n, [1, 1, 1], -1); - let g = se(c, s), x = se(l, a), b = se(m, i); +var lT = N({ resizeNearestNeighbor_: HX }); +function KX(r16, e = "binary", t10 = false, o = 0.5) { + let n = v(r16, "image", "threshold"), s = 0.2989, a = 0.587, i = 0.114, p = n.shape[0] * n.shape[1], u = se(rr([o]), 255), l, c, m, d; + if ($(n.rank === 3, () => `Error in threshold: image must be rank 3,but got rank ${n.rank}.`), $(n.shape[2] === 3 || n.shape[2] === 1, () => `Error in threshold: image color channel must be equal to 3 or 1but got ${n.shape[2]}.`), $(n.dtype === "int32" || n.dtype === "float32", () => `Error in dtype: image dtype must be int32 or float32,but got dtype ${n.dtype}.`), $(e === "otsu" || e === "binary", () => `Method must be binary or otsu, but was ${e}`), n.shape[2] === 3) { + [l, c, m] = Ci(n, [1, 1, 1], -1); + let g = se(l, s), x = se(c, a), b = se(m, i); d = Ce(Ce(g, x), b); } else - d = r15; - if (t8 === "otsu") { - let g = fd(We(Ud(d), "int32"), ar([]), 256); - u = Cj(g, p); - } - let f = e ? nc(d, u) : zu(d, u); - return We(se(f, 255), "int32"); -} -function Cj(r15, t8) { - let e = Jt([-1]), o = Jt([0]), n = Jt([0]), s, a, i, p, u, c; - for (let l = 0; l < r15.size - 1; l++) { - s = Xe(r15, 0, l + 1), a = Xe(r15, l + 1), u = je(ot(s), t8), c = je(ot(a), t8); - let m = ot(se(s, uu(0, s.size))); - i = je(m, ot(s)); - let d = Ea(a.shape, s.size), f = Ce(uu(0, a.size), d), h = se(a, f); - p = je(ot(h), ot(a)); - let g = Te(i, p), x = Te(i, p), b = se(u, c); + d = r16; + if (e === "otsu") { + let g = kd(Ue(ef(d), "int32"), pr([]), 256); + u = qX(g, p); + } + let f = t10 ? ml(d, u) : ju(d, u); + return Ue(se(f, 255), "int32"); +} +function qX(r16, e) { + let t10 = rr([-1]), o = rr([0]), n = rr([0]), s, a, i, p, u, l; + for (let c = 0; c < r16.size - 1; c++) { + s = Ye(r16, 0, c + 1), a = Ye(r16, c + 1), u = Xe(ot(s), e), l = Xe(ot(a), e); + let m = ot(se(s, xu(0, s.size))); + i = Xe(m, ot(s)); + let d = Ma(a.shape, s.size), f = Ce(xu(0, a.size), d), h = se(a, f); + p = Xe(ot(h), ot(a)); + let g = Te(i, p), x = Te(i, p), b = se(u, l); n = se(se(b, g), x); - let C = zu(n, o); - o = co(C, n, o), e = co(C, Jt([l]), e); + let w = ju(n, o); + o = Lo(w, n, o), t10 = Lo(w, rr([c]), t10); } - return e; + return t10; } -var wN = N({ threshold_: bj }); -function wj(r15, t8, e = "nearest", o = "constant", n = 0, s) { - let a = v(r15, "image", "transform", "float32"), i = v(t8, "transforms", "transform", "float32"); +var cT = N({ threshold_: KX }); +function jX(r16, e, t10 = "nearest", o = "constant", n = 0, s) { + let a = v(r16, "image", "transform", "float32"), i = v(e, "transforms", "transform", "float32"); $(a.rank === 4, () => `Error in transform: image must be rank 4,but got rank ${a.rank}.`), $(i.rank === 2 && (i.shape[0] === a.shape[0] || i.shape[0] === 1) && i.shape[1] === 8, () => "Error in transform: Input transform should be batch x 8 or 1 x 8"), $(s == null || s.length === 2, () => `Error in transform: outputShape must be [height, width] or null, but got ${s}.`); - let p = { image: a, transforms: i }, u = { interpolation: e, fillMode: o, fillValue: n, outputShape: s }; - return T.runKernel(Rs, p, u); + let p = { image: a, transforms: i }, u = { interpolation: t10, fillMode: o, fillValue: n, outputShape: s }; + return _.runKernel(zs, p, u); } -var SN = N({ transform_: wj }); -function Sj(r15, t8, e) { - let o = v(r15, "a", "bandPart"); +var mT = N({ transform_: jX }); +function XX(r16, e, t10) { + let o = v(r16, "a", "bandPart"); $(o.rank >= 2, () => `bandPart(): Rank must be at least 2, got ${o.rank}.`); let n = o.shape, [s, a] = o.shape.slice(-2), i, p; - typeof t8 == "number" ? ($(t8 % 1 === 0, () => `bandPart(): numLower must be an integer, got ${t8}.`), $(t8 <= s, () => `bandPart(): numLower (${t8}) must not be greater than the number of rows (${s}).`), i = v(t8 < 0 ? s : t8, "numLower", "bandPart")) : ($(t8.dtype === "int32", () => "bandPart(): numLower's dtype must be an int32."), i = co(kl(t8, 0), s, Uu(t8, s))), typeof e == "number" ? ($(e % 1 === 0, () => `bandPart(): numUpper must be an integer, got ${e}.`), $(e <= a, () => `bandPart(): numUpper (${e}) must not be greater than the number of columns (${a}).`), p = v(e < 0 ? a : e, "numUpper", "bandPart")) : ($(e.dtype === "int32", () => "bandPart(): numUpper's dtype must be an int32."), p = co(kl(e, 0), a, Uu(e, a))); - let u = W(uu(0, s, 1, "int32"), [-1, 1]), c = uu(0, a, 1, "int32"), l = Te(u, c), m = Vu(nc(l, i), Sd(l, pr(p))), d = Ur([s, a], o.dtype); - return W(vr(mo(W(o, [-1, s, a])).map((f) => co(m, f, d))), n); -} -var IN = N({ bandPart_: Sj }); -function Ij(r15) { - let t8; - if (Array.isArray(r15)) { - t8 = false, $(r15 != null && r15.length > 0, () => "Gram-Schmidt process: input must not be null, undefined, or empty"); - let n = r15[0].shape[0]; - for (let s = 1; s < r15.length; ++s) - $(r15[s].shape[0] === n, () => `Gram-Schmidt: Non-unique lengths found in the input vectors: (${r15[s].shape[0]} vs. ${n})`); + typeof e == "number" ? ($(e % 1 === 0, () => `bandPart(): numLower must be an integer, got ${e}.`), $(e <= s, () => `bandPart(): numLower (${e}) must not be greater than the number of rows (${s}).`), i = v(e < 0 ? s : e, "numLower", "bandPart")) : ($(e.dtype === "int32", () => "bandPart(): numLower's dtype must be an int32."), i = Lo(Fc(e, 0), s, Qu(e, s))), typeof t10 == "number" ? ($(t10 % 1 === 0, () => `bandPart(): numUpper must be an integer, got ${t10}.`), $(t10 <= a, () => `bandPart(): numUpper (${t10}) must not be greater than the number of columns (${a}).`), p = v(t10 < 0 ? a : t10, "numUpper", "bandPart")) : ($(t10.dtype === "int32", () => "bandPart(): numUpper's dtype must be an int32."), p = Lo(Fc(t10, 0), a, Qu(t10, a))); + let u = W(xu(0, s, 1, "int32"), [-1, 1]), l = xu(0, a, 1, "int32"), c = Te(u, l), m = Xu(ml(c, i), Ad(c, mr(p))), d = Yr([s, a], o.dtype); + return W(Tr(zo(W(o, [-1, s, a])).map((f) => Lo(m, f, d))), n); +} +var dT = N({ bandPart_: XX }); +function YX(r16) { + let e; + if (Array.isArray(r16)) { + e = false, $(r16 != null && r16.length > 0, () => "Gram-Schmidt process: input must not be null, undefined, or empty"); + let n = r16[0].shape[0]; + for (let s = 1; s < r16.length; ++s) + $(r16[s].shape[0] === n, () => `Gram-Schmidt: Non-unique lengths found in the input vectors: (${r16[s].shape[0]} vs. ${n})`); } else - t8 = true, r15 = ci(r15, r15.shape[0], 0).map((n) => uc(n, [0])); - $(r15.length <= r15[0].shape[0], () => `Gram-Schmidt: Number of vectors (${r15.length}) exceeds number of dimensions (${r15[0].shape[0]}).`); - let e = [], o = r15; - for (let n = 0; n < r15.length; ++n) - e.push(T.tidy(() => { + e = true, r16 = Ci(r16, r16.shape[0], 0).map((n) => gl(n, [0])); + $(r16.length <= r16[0].shape[0], () => `Gram-Schmidt: Number of vectors (${r16.length}) exceeds number of dimensions (${r16[0].shape[0]}).`); + let t10 = [], o = r16; + for (let n = 0; n < r16.length; ++n) + t10.push(_.tidy(() => { let s = o[n]; if (n > 0) for (let a = 0; a < n; ++a) { - let i = se(ot(se(e[a], s)), e[a]); + let i = se(ot(se(t10[a], s)), t10[a]); s = Te(s, i); } - return je(s, Bu(s, "euclidean")); + return Xe(s, qu(s, "euclidean")); })); - return t8 ? vr(e, 0) : e; + return e ? Tr(t10, 0) : t10; } -var vN = N({ gramSchmidt_: Ij }); -function vj(r15, t8 = false) { - if ($(r15.rank >= 2, () => `qr() requires input tensor to have a rank >= 2, but got rank ${r15.rank}`), r15.rank === 2) - return kN(r15, t8); +var fT = N({ gramSchmidt_: YX }); +function QX(r16, e = false) { + if ($(r16.rank >= 2, () => `qr() requires input tensor to have a rank >= 2, but got rank ${r16.rank}`), r16.rank === 2) + return hT(r16, e); { - let e = r15.shape.slice(0, r15.shape.length - 2).reduce((p, u) => p * u), o = mo(W(r15, [e, r15.shape[r15.shape.length - 2], r15.shape[r15.shape.length - 1]]), 0), n = [], s = []; + let t10 = r16.shape.slice(0, r16.shape.length - 2).reduce((p, u) => p * u), o = zo(W(r16, [t10, r16.shape[r16.shape.length - 2], r16.shape[r16.shape.length - 1]]), 0), n = [], s = []; o.forEach((p) => { - let [u, c] = kN(p, t8); - n.push(u), s.push(c); + let [u, l] = hT(p, e); + n.push(u), s.push(l); }); - let a = W(vr(n, 0), r15.shape), i = W(vr(s, 0), r15.shape); + let a = W(Tr(n, 0), r16.shape), i = W(Tr(s, 0), r16.shape); return [a, i]; } } -function kN(r15, t8 = false) { - return T.tidy(() => { - $(r15.shape.length === 2, () => `qr2d() requires a 2D Tensor, but got a ${r15.shape.length}D Tensor.`); - let e = r15.shape[0], o = r15.shape[1], n = bd(e), s = Wr(r15), a = cu([[1]], [1, 1]), i = Wr(a), p = e >= o ? o : e; +function hT(r16, e = false) { + return _.tidy(() => { + $(r16.shape.length === 2, () => `qr2d() requires a 2D Tensor, but got a ${r16.shape.length}D Tensor.`); + let t10 = r16.shape[0], o = r16.shape[1], n = $d(t10), s = Xr(r16), a = bu([[1]], [1, 1]), i = Xr(a), p = t10 >= o ? o : t10; for (let u = 0; u < p; ++u) { - let c = s, l = i, m = n; - [i, s, n] = T.tidy(() => { - let d = Xe(s, [u, u], [e - u, 1]), f = Bu(d), h = Xe(s, [u, u], [1, 1]), g = co(zu(h, 0), cu([[-1]]), cu([[1]])), x = Te(h, se(g, f)), b = je(d, x); - b.shape[0] === 1 ? i = Wr(a) : i = yt([a, Xe(b, [1, 0], [b.shape[0] - 1, b.shape[1]])], 0); - let C = pr(je(Ze(g, x), f)), S = Xe(s, [u, 0], [e - u, o]), k = se(C, i), _ = cc(i); + let l = s, c = i, m = n; + [i, s, n] = _.tidy(() => { + let d = Ye(s, [u, u], [t10 - u, 1]), f = qu(d), h = Ye(s, [u, u], [1, 1]), g = Lo(ju(h, 0), bu([[-1]]), bu([[1]])), x = Te(h, se(g, f)), b = Xe(d, x); + b.shape[0] === 1 ? i = Xr(a) : i = bt([a, Ye(b, [1, 0], [b.shape[0] - 1, b.shape[1]])], 0); + let w = mr(Xe(Je(g, x), f)), S = Ye(s, [u, 0], [t10 - u, o]), k = se(w, i), T = yl(i); if (u === 0) - s = Te(S, Ze(k, Ze(_, S))); + s = Te(S, Je(k, Je(T, S))); else { - let D = Te(S, Ze(k, Ze(_, S))); - s = yt([Xe(s, [0, 0], [u, o]), D], 0); + let D = Te(S, Je(k, Je(T, S))); + s = bt([Ye(s, [0, 0], [u, o]), D], 0); } - let E = cc(k), R = Xe(n, [0, u], [e, n.shape[1] - u]); + let E = yl(k), R = Ye(n, [0, u], [t10, n.shape[1] - u]); if (u === 0) - n = Te(R, Ze(Ze(R, i), E)); + n = Te(R, Je(Je(R, i), E)); else { - let D = Te(R, Ze(Ze(R, i), E)); - n = yt([Xe(n, [0, 0], [e, u]), D], 1); + let D = Te(R, Je(Je(R, i), E)); + n = bt([Ye(n, [0, 0], [t10, u]), D], 1); } return [i, s, n]; - }), Ot([c, l, m]); + }), Lt([l, c, m]); } - return !t8 && e > o && (n = Xe(n, [0, 0], [e, o]), s = Xe(s, [0, 0], [o, o])), [n, s]; + return !e && t10 > o && (n = Ye(n, [0, 0], [t10, o]), s = Ye(s, [0, 0], [o, o])), [n, s]; }); } -var NN = N({ qr_: vj }); -var Et; -(function(r15) { - r15[r15.NONE = 0] = "NONE", r15[r15.MEAN = 1] = "MEAN", r15[r15.SUM = 2] = "SUM", r15[r15.SUM_BY_NONZERO_WEIGHTS = 3] = "SUM_BY_NONZERO_WEIGHTS"; -})(Et || (Et = {})); -function kj(r15, t8, e = Et.SUM_BY_NONZERO_WEIGHTS) { - let o = v(r15, "losses", "computeWeightedLoss"), n = null; - t8 != null && (n = v(t8, "weights", "computeWeightedLoss")); +var gT = N({ qr_: QX }); +var Dt; +(function(r16) { + r16[r16.NONE = 0] = "NONE", r16[r16.MEAN = 1] = "MEAN", r16[r16.SUM = 2] = "SUM", r16[r16.SUM_BY_NONZERO_WEIGHTS = 3] = "SUM_BY_NONZERO_WEIGHTS"; +})(Dt || (Dt = {})); +function ZX(r16, e, t10 = Dt.SUM_BY_NONZERO_WEIGHTS) { + let o = v(r16, "losses", "computeWeightedLoss"), n = null; + e != null && (n = v(e, "weights", "computeWeightedLoss")); let s = n == null ? o : se(o, n); - if (e === Et.NONE) + if (t10 === Dt.NONE) return s; - if (e === Et.SUM) + if (t10 === Dt.SUM) return ot(s); - if (e === Et.MEAN) { + if (t10 === Dt.MEAN) { if (n == null) - return Wu(s); + return Yu(s); { - let a = o.size / n.size, i = je(ot(s), ot(n)); - return a > 1 ? je(i, ke(a)) : i; + let a = o.size / n.size, i = Xe(ot(s), ot(n)); + return a > 1 ? Xe(i, ke(a)) : i; } } - if (e === Et.SUM_BY_NONZERO_WEIGHTS) { + if (t10 === Dt.SUM_BY_NONZERO_WEIGHTS) { if (n == null) - return je(ot(s), ke(o.size)); + return Xe(ot(s), ke(o.size)); { - let a = se(n, Da(o.shape)), i = We(ot(Ad(a, ke(0))), "float32"); - return je(ot(s), i); - } - } - throw Error(`Unknown reduction: ${e}`); -} -var cr = N({ computeWeightedLoss_: kj }); -function Nj(r15, t8, e, o = Et.SUM_BY_NONZERO_WEIGHTS) { - let n = v(r15, "labels", "absoluteDifference"), s = v(t8, "predictions", "absoluteDifference"), a = null; - e != null && (a = v(e, "weights", "absoluteDifference")), xt(n.shape, s.shape, "Error in absoluteDifference: "); - let i = Qt(Te(n, s)); - return cr(i, a, o); -} -var TN = N({ absoluteDifference_: Nj }); -function Tj(r15, t8, e, o, n = Et.SUM_BY_NONZERO_WEIGHTS) { - let s = v(r15, "labels", "cosineDistance"), a = v(t8, "predictions", "cosineDistance"), i = null; - o != null && (i = v(o, "weights", "cosineDistance")), xt(s.shape, a.shape, "Error in cosineDistance: "); - let p = ke(1), u = Te(p, ot(se(s, a), e, true)); - return cr(u, i, n); -} -var _N = N({ cosineDistance_: Tj }); -function _j(r15, t8, e, o = Et.SUM_BY_NONZERO_WEIGHTS) { - let n = v(r15, "labels", "hingeLoss"), s = v(t8, "predictions", "hingeLoss"), a = null; - e != null && (a = v(e, "weights", "hingeLoss")), xt(n.shape, s.shape, "Error in hingeLoss: "); + let a = se(n, Ba(o.shape)), i = Ue(ot(Gd(a, ke(0))), "float32"); + return Xe(ot(s), i); + } + } + throw Error(`Unknown reduction: ${t10}`); +} +var dr = N({ computeWeightedLoss_: ZX }); +function JX(r16, e, t10, o = Dt.SUM_BY_NONZERO_WEIGHTS) { + let n = v(r16, "labels", "absoluteDifference"), s = v(e, "predictions", "absoluteDifference"), a = null; + t10 != null && (a = v(t10, "weights", "absoluteDifference")), yt(n.shape, s.shape, "Error in absoluteDifference: "); + let i = er(Te(n, s)); + return dr(i, a, o); +} +var xT = N({ absoluteDifference_: JX }); +function e5(r16, e, t10, o, n = Dt.SUM_BY_NONZERO_WEIGHTS) { + let s = v(r16, "labels", "cosineDistance"), a = v(e, "predictions", "cosineDistance"), i = null; + o != null && (i = v(o, "weights", "cosineDistance")), yt(s.shape, a.shape, "Error in cosineDistance: "); + let p = ke(1), u = Te(p, ot(se(s, a), t10, true)); + return dr(u, i, n); +} +var yT = N({ cosineDistance_: e5 }); +function t5(r16, e, t10, o = Dt.SUM_BY_NONZERO_WEIGHTS) { + let n = v(r16, "labels", "hingeLoss"), s = v(e, "predictions", "hingeLoss"), a = null; + t10 != null && (a = v(t10, "weights", "hingeLoss")), yt(n.shape, s.shape, "Error in hingeLoss: "); let i = ke(1); n = Te(se(ke(2), n), i); - let p = pu(Te(i, se(n, s))); - return cr(p, a, o); -} -var $N = N({ hingeLoss_: _j }); -function $j(r15, t8, e, o = 1, n = Et.SUM_BY_NONZERO_WEIGHTS) { - let s = v(r15, "labels", "huberLoss"), a = v(t8, "predictions", "huberLoss"), i = null; - e != null && (i = v(e, "weights", "huberLoss")), xt(s.shape, a.shape, "Error in huberLoss: "); - let p = ke(o), u = Qt(Te(a, s)), c = Uu(u, p), l = Te(u, c), m = Ce(se(ke(0.5), Zt(c)), se(p, l)); - return cr(m, i, n); -} -var EN = N({ huberLoss_: $j }); -function Ej(r15, t8, e, o = 1e-7, n = Et.SUM_BY_NONZERO_WEIGHTS) { - let s = v(r15, "labels", "logLoss"), a = v(t8, "predictions", "logLoss"), i = null; - e != null && (i = v(e, "weights", "logLoss")), xt(s.shape, a.shape, "Error in logLoss: "); - let p = ke(1), u = ke(o), c = pr(se(s, ui(Ce(a, u)))), l = se(Te(p, s), ui(Ce(Te(p, a), u))), m = Te(c, l); - return cr(m, i, n); -} -var RN = N({ logLoss_: Ej }); -function Rj(r15, t8, e, o = Et.SUM_BY_NONZERO_WEIGHTS) { - let n = v(r15, "labels", "meanSquaredError"), s = v(t8, "predictions", "meanSquaredError"), a = null; - e != null && (a = v(e, "weights", "meanSquaredError")), xt(n.shape, s.shape, "Error in meanSquaredError: "); - let i = Hd(n, s); - return cr(i, a, o); -} -var DN = N({ meanSquaredError_: Rj }); -function Dj(r15, t8) { - let e = v(r15, "labels", "sigmoidCrossEntropyWithLogits"), o = v(t8, "logits", "sigmoidCrossEntropyWithLogits"); - xt(e.shape, o.shape, "Error in sigmoidCrossEntropyWithLogits: "); - let n = pu(o), s = se(o, e), a = vd(_o(pr(Qt(o)))); + let p = yu(Te(i, se(n, s))); + return dr(p, a, o); +} +var bT = N({ hingeLoss_: t5 }); +function r5(r16, e, t10, o = 1, n = Dt.SUM_BY_NONZERO_WEIGHTS) { + let s = v(r16, "labels", "huberLoss"), a = v(e, "predictions", "huberLoss"), i = null; + t10 != null && (i = v(t10, "weights", "huberLoss")), yt(s.shape, a.shape, "Error in huberLoss: "); + let p = ke(o), u = er(Te(a, s)), l = Qu(u, p), c = Te(u, l), m = Ce(se(ke(0.5), tr(l)), se(p, c)); + return dr(m, i, n); +} +var CT = N({ huberLoss_: r5 }); +function o5(r16, e, t10, o = 1e-7, n = Dt.SUM_BY_NONZERO_WEIGHTS) { + let s = v(r16, "labels", "logLoss"), a = v(e, "predictions", "logLoss"), i = null; + t10 != null && (i = v(t10, "weights", "logLoss")), yt(s.shape, a.shape, "Error in logLoss: "); + let p = ke(1), u = ke(o), l = mr(se(s, yi(Ce(a, u)))), c = se(Te(p, s), yi(Ce(Te(p, a), u))), m = Te(l, c); + return dr(m, i, n); +} +var wT = N({ logLoss_: o5 }); +function n5(r16, e, t10, o = Dt.SUM_BY_NONZERO_WEIGHTS) { + let n = v(r16, "labels", "meanSquaredError"), s = v(e, "predictions", "meanSquaredError"), a = null; + t10 != null && (a = v(t10, "weights", "meanSquaredError")), yt(n.shape, s.shape, "Error in meanSquaredError: "); + let i = rf(n, s); + return dr(i, a, o); +} +var ST = N({ meanSquaredError_: n5 }); +function s5(r16, e) { + let t10 = v(r16, "labels", "sigmoidCrossEntropyWithLogits"), o = v(e, "logits", "sigmoidCrossEntropyWithLogits"); + yt(t10.shape, o.shape, "Error in sigmoidCrossEntropyWithLogits: "); + let n = yu(o), s = se(o, t10), a = Pd(Jo(mr(er(o)))); return Ce(Te(n, s), a); } -function Aj(r15, t8, e, o = 0, n = Et.SUM_BY_NONZERO_WEIGHTS) { - let s = v(r15, "multiClassLabels", "sigmoidCrossEntropy"), a = v(t8, "logits", "sigmoidCrossEntropy"), i = null; - if (e != null && (i = v(e, "weights", "sigmoidCrossEntropy")), xt(s.shape, a.shape, "Error in sigmoidCrossEntropy: "), o > 0) { - let u = ke(o), c = ke(1), l = ke(0.5); - s = Ce(se(s, Te(c, u)), se(l, u)); - } - let p = Dj(s, a); - return cr(p, i, n); -} -var AN = N({ sigmoidCrossEntropy_: Aj }); -function Fj(r15, t8, e = -1) { - if (e === -1 && (e = t8.rank - 1), e !== t8.rank - 1) - throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${t8.rank} and dim was ${e}`); - return Ir((n, s, a) => { - let p = Td(s, [e], true), u = Te(We(s, "float32"), p); +function a5(r16, e, t10, o = 0, n = Dt.SUM_BY_NONZERO_WEIGHTS) { + let s = v(r16, "multiClassLabels", "sigmoidCrossEntropy"), a = v(e, "logits", "sigmoidCrossEntropy"), i = null; + if (t10 != null && (i = v(t10, "weights", "sigmoidCrossEntropy")), yt(s.shape, a.shape, "Error in sigmoidCrossEntropy: "), o > 0) { + let u = ke(o), l = ke(1), c = ke(0.5); + s = Ce(se(s, Te(l, u)), se(c, u)); + } + let p = s5(s, a); + return dr(p, i, n); +} +var IT = N({ sigmoidCrossEntropy_: a5 }); +function i5(r16, e, t10 = -1) { + if (t10 === -1 && (t10 = e.rank - 1), t10 !== e.rank - 1) + throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${e.rank} and dim was ${t10}`); + return Nr((n, s, a) => { + let p = Ld(s, [t10], true), u = Te(Ue(s, "float32"), p); a([n, u]); - let c = pr(se(u, n)); - return { value: ot(c, [e]), gradFunc: (d, f) => { - let [h, g] = f, x = ai(d.shape, [e]); - return [se(W(d, x), Te(We(h, "float32"), _o(g))), se(W(d, x), Te(_o(g), We(h, "float32")))]; + let l = mr(se(u, n)); + return { value: ot(l, [t10]), gradFunc: (d, f) => { + let [h, g] = f, x = gi(d.shape, [t10]); + return [se(W(d, x), Te(Ue(h, "float32"), Jo(g))), se(W(d, x), Te(Jo(g), Ue(h, "float32")))]; } }; - })(r15, t8); + })(r16, e); } -function Pj(r15, t8, e, o = 0, n = Et.SUM_BY_NONZERO_WEIGHTS) { - let s = v(r15, "onehotLabels", "softmaxCrossEntropy"), a = v(t8, "logits", "softmaxCrossEntropy"), i = null; - if (e != null && (i = v(e, "weights", "softmaxCrossEntropy")), xt(s.shape, a.shape, "Error in softmaxCrossEntropy: "), o > 0) { - let u = ke(o), c = ke(1), l = ke(s.shape[1]); - s = Ce(se(s, Te(c, u)), je(u, l)); +function u5(r16, e, t10, o = 0, n = Dt.SUM_BY_NONZERO_WEIGHTS) { + let s = v(r16, "onehotLabels", "softmaxCrossEntropy"), a = v(e, "logits", "softmaxCrossEntropy"), i = null; + if (t10 != null && (i = v(t10, "weights", "softmaxCrossEntropy")), yt(s.shape, a.shape, "Error in softmaxCrossEntropy: "), o > 0) { + let u = ke(o), l = ke(1), c = ke(s.shape[1]); + s = Ce(se(s, Te(l, u)), Xe(u, c)); } - let p = Fj(s, a); - return cr(p, i, n); + let p = i5(s, a); + return dr(p, i, n); } -var FN = N({ softmaxCrossEntropy_: Pj }); -function Oj(r15, t8, e, o) { - let n = v(r15, "indices", "sparseFillEmptyRows", "int32"), s = v(t8, "values", "sparseFillEmptyRows"), a = v(e, "denseShape", "sparseFillEmptyRows", "int32"), i = v(o, "defaultValue", "sparseFillEmptyRows", s.dtype); +var vT = N({ softmaxCrossEntropy_: u5 }); +function p5(r16, e, t10, o) { + let n = v(r16, "indices", "sparseFillEmptyRows", "int32"), s = v(e, "values", "sparseFillEmptyRows"), a = v(t10, "denseShape", "sparseFillEmptyRows", "int32"), i = v(o, "defaultValue", "sparseFillEmptyRows", s.dtype); if (n.rank !== 2) throw new Error(`Indices should be Tensor2D but received shape ${n.shape}`); @@ -8192,12 +8252,12 @@ function Oj(r15, t8, e, o) { throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`); if (i.rank !== 0) throw new Error(`Default value should be a scalar but received shape ${i.shape}`); - let p = { indices: n, values: s, denseShape: a, defaultValue: i }, u = T.runKernel(Hi, p); + let p = { indices: n, values: s, denseShape: a, defaultValue: i }, u = _.runKernel(eu, p); return { outputIndices: u[0], outputValues: u[1], emptyRowIndicator: u[2], reverseIndexMap: u[3] }; } -var PN = N({ sparseFillEmptyRows_: Oj }); -function Mj(r15, t8, e) { - let o = v(r15, "inputIndices", "sparseReshape", "int32"), n = v(t8, "inputShape", "sparseReshape", "int32"), s = v(e, "newShape", "sparseReshape", "int32"); +var kT = N({ sparseFillEmptyRows_: p5 }); +function l5(r16, e, t10) { + let o = v(r16, "inputIndices", "sparseReshape", "int32"), n = v(e, "inputShape", "sparseReshape", "int32"), s = v(t10, "newShape", "sparseReshape", "int32"); if (o.rank !== 2) throw new Error(`Input indices should be Tensor2D but received shape ${o.shape}`); @@ -8205,12 +8265,12 @@ function Mj(r15, t8, e) { throw new Error(`Input shape should be Tensor1D but received shape ${n.shape}`); if (s.rank !== 1) throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`); - let a = { inputIndices: o, inputShape: n, newShape: s }, i = T.runKernel(ei, a); + let a = { inputIndices: o, inputShape: n, newShape: s }, i = _.runKernel(ui, a); return { outputIndices: i[0], outputShape: i[1] }; } -var ON = N({ sparseReshape_: Mj }); -function Lj(r15, t8, e) { - let o = v(r15, "data", "sparseSegmentMean"), n = v(t8, "indices", "sparseSegmentMean", "int32"), s = v(e, "segmentIds", "sparseSegmentMean", "int32"); +var NT = N({ sparseReshape_: l5 }); +function c5(r16, e, t10) { + let o = v(r16, "data", "sparseSegmentMean"), n = v(e, "indices", "sparseSegmentMean", "int32"), s = v(t10, "segmentIds", "sparseSegmentMean", "int32"); if (o.rank < 1) throw new Error("Data should be at least 1 dimensional but received scalar"); if (n.rank !== 1) @@ -8220,11 +8280,11 @@ function Lj(r15, t8, e) { throw new Error(`Segment ids should be Tensor1D but received shape ${s.shape}`); let a = { data: o, indices: n, segmentIds: s }; - return T.runKernel(ya, a); + return _.runKernel(va, a); } -var MN = N({ sparseSegmentMean_: Lj }); -function Bj(r15, t8, e) { - let o = v(r15, "data", "sparseSegmentSum"), n = v(t8, "indices", "sparseSegmentSum", "int32"), s = v(e, "segmentIds", "sparseSegmentSum", "int32"); +var TT = N({ sparseSegmentMean_: c5 }); +function m5(r16, e, t10) { + let o = v(r16, "data", "sparseSegmentSum"), n = v(e, "indices", "sparseSegmentSum", "int32"), s = v(t10, "segmentIds", "sparseSegmentSum", "int32"); if (o.rank < 1) throw new Error("Data should be at least 1 dimensional but received scalar"); if (n.rank !== 1) @@ -8234,92 +8294,92 @@ function Bj(r15, t8, e) { throw new Error(`Segment ids should be Tensor1D but received shape ${s.shape}`); let a = { data: o, indices: n, segmentIds: s }; - return T.runKernel(ba, a); + return _.runKernel(ka, a); } -var LN = N({ sparseSegmentSum_: Bj }); -function zj(r15, t8, e, o, n, s, a, i) { - let p = v(r15, "data", "stringNGrams", "string"); +var _T = N({ sparseSegmentSum_: m5 }); +function d5(r16, e, t10, o, n, s, a, i) { + let p = v(r16, "data", "stringNGrams", "string"); if (p.dtype !== "string") throw new Error("Data must be of datatype string"); if (p.shape.length !== 1) throw new Error(`Data must be a vector, saw: ${p.shape}`); - let u = v(t8, "dataSplits", "stringNGrams"); + let u = v(e, "dataSplits", "stringNGrams"); if (u.dtype !== "int32") throw new Error("Data splits must be of datatype int32"); - let c = { separator: e, nGramWidths: o, leftPad: n, rightPad: s, padWidth: a, preserveShortSequences: i }, l = { data: p, dataSplits: u }, m = T.runKernel(Ca, l, c); + let l = { separator: t10, nGramWidths: o, leftPad: n, rightPad: s, padWidth: a, preserveShortSequences: i }, c = { data: p, dataSplits: u }, m = _.runKernel(Na, c, l); return { nGrams: m[0], nGramsSplits: m[1] }; } -var BN = N({ stringNGrams_: zj }); -function Vj(r15, t8, e = true) { - let o = v(r15, "input", "stringSplit", "string"), n = v(t8, "delimiter", "stringSplit", "string"); +var ET = N({ stringNGrams_: d5 }); +function f5(r16, e, t10 = true) { + let o = v(r16, "input", "stringSplit", "string"), n = v(e, "delimiter", "stringSplit", "string"); if (o.rank !== 1) throw new Error(`Input should be Tensor1D but received shape ${o.shape}`); if (n.rank !== 0) throw new Error(`Delimiter should be a scalar but received shape ${n.shape}`); - let s = { skipEmpty: e }, a = { input: o, delimiter: n }, i = T.runKernel(qi, a, s); + let s = { skipEmpty: t10 }, a = { input: o, delimiter: n }, i = _.runKernel(ru, a, s); return { indices: i[0], values: i[1], shape: i[2] }; } -var zN = N({ stringSplit_: Vj }); -function Wj(r15, t8) { - let e = v(r15, "input", "stringToHashBucketFast", "string"), o = { numBuckets: t8 }; - if (t8 <= 0) +var $T = N({ stringSplit_: f5 }); +function h5(r16, e) { + let t10 = v(r16, "input", "stringToHashBucketFast", "string"), o = { numBuckets: e }; + if (e <= 0) throw new Error("Number of buckets must be at least 1"); - let n = { input: e }; - return T.runKernel(ji, n, o); -} -var VN = N({ stringToHashBucketFast_: Wj }); -function Uj(r15, t8, e, o = true) { - let n = v(r15, "input", "staticRegexReplace", "string"), s = { pattern: t8, rewrite: e, replaceGlobal: o }; - return T.runKernel($u, { x: n }, s); -} -var WN = N({ staticRegexReplace_: Uj }); -var Gj = { fft: ac, ifft: Ku, rfft: ic, irfft: Gd }; -var Hj = { hammingWindow: nN, hannWindow: Yd, frame: Qd, stft: sN }; -var Kj = { flipLeftRight: iN, grayscaleToRGB: uN, resizeNearestNeighbor: CN, resizeBilinear: bN, rgbToGrayscale: pN, rotateWithOffset: cN, cropAndResize: aN, nonMaxSuppression: lN, nonMaxSuppressionAsync: fN, nonMaxSuppressionWithScore: hN, nonMaxSuppressionWithScoreAsync: gN, nonMaxSuppressionPadded: xN, nonMaxSuppressionPaddedAsync: yN, threshold: wN, transform: SN }; -var qj = { bandPart: IN, gramSchmidt: vN, qr: NN }; -var jj = { absoluteDifference: TN, computeWeightedLoss: cr, cosineDistance: _N, hingeLoss: $N, huberLoss: EN, logLoss: RN, meanSquaredError: DN, sigmoidCrossEntropy: AN, softmaxCrossEntropy: FN }; -var Xj = { sparseFillEmptyRows: PN, sparseReshape: ON, sparseSegmentMean: MN, sparseSegmentSum: LN }; -var Yj = { stringNGrams: BN, stringSplit: zN, stringToHashBucketFast: VN, staticRegexReplace: WN }; -var UN = {}; -qe(UN, { Serializable: () => $l, SerializationMap: () => tf, getRegisteredName: () => Zj, registerClass: () => tS }); -var Qj = /* @__PURE__ */ new Map(); -var eS = /* @__PURE__ */ new Map(); -var $l = class { + let n = { input: t10 }; + return _.runKernel(ou, n, o); +} +var RT = N({ stringToHashBucketFast_: h5 }); +function g5(r16, e, t10, o = true) { + let n = v(r16, "input", "staticRegexReplace", "string"), s = { pattern: e, rewrite: t10, replaceGlobal: o }; + return _.runKernel(pi, { x: n }, s); +} +var DT = N({ staticRegexReplace_: g5 }); +var x5 = { fft: fl, ifft: ep, rfft: hl, irfft: tf }; +var y5 = { hammingWindow: jN, hannWindow: uf, frame: pf, stft: XN }; +var b5 = { flipLeftRight: QN, grayscaleToRGB: ZN, resizeNearestNeighbor: lT, resizeBilinear: pT, rgbToGrayscale: JN, rotateWithOffset: eT, cropAndResize: YN, nonMaxSuppression: tT, nonMaxSuppressionAsync: nT, nonMaxSuppressionWithScore: sT, nonMaxSuppressionWithScoreAsync: aT, nonMaxSuppressionPadded: iT, nonMaxSuppressionPaddedAsync: uT, threshold: cT, transform: mT }; +var C5 = { bandPart: dT, gramSchmidt: fT, qr: gT }; +var w5 = { absoluteDifference: xT, computeWeightedLoss: dr, cosineDistance: yT, hingeLoss: bT, huberLoss: CT, logLoss: wT, meanSquaredError: ST, sigmoidCrossEntropy: IT, softmaxCrossEntropy: vT }; +var S5 = { sparseFillEmptyRows: kT, sparseReshape: NT, sparseSegmentMean: TT, sparseSegmentSum: _T }; +var I5 = { stringNGrams: ET, stringSplit: $T, stringToHashBucketFast: RT, staticRegexReplace: DT }; +var AT = {}; +qe(AT, { Serializable: () => Lc, SerializationMap: () => df, getRegisteredName: () => k5, registerClass: () => hS }); +var v5 = /* @__PURE__ */ new Map(); +var fS = /* @__PURE__ */ new Map(); +var Lc = class { getClassName() { return this.constructor.className; } - static fromConfig(t8, e) { - return new t8(e); + static fromConfig(e, t10) { + return new e(t10); } }; -var tf = class r7 { +var df = class r7 { constructor() { this.classNameMap = {}; } static getMap() { return r7.instance == null && (r7.instance = new r7()), r7.instance; } - static register(t8) { - r7.getMap().classNameMap[t8.className] = [t8, t8.fromConfig]; + static register(e) { + r7.getMap().classNameMap[e.className] = [e, e.fromConfig]; } }; -function tS(r15, t8, e) { - $(r15.className != null, () => "Class being registered does not have the static className property defined."), $(typeof r15.className == "string", () => "className is required to be a string, but got type " + typeof r15.className), $(r15.className.length > 0, () => "Class being registered has an empty-string as its className, which is disallowed."), typeof t8 == "undefined" && (t8 = "Custom"), typeof e == "undefined" && (e = r15.className); - let o = e, n = t8 + ">" + o; - return tf.register(r15), Qj.set(n, r15), eS.set(r15, n), r15; +function hS(r16, e, t10) { + $(r16.className != null, () => "Class being registered does not have the static className property defined."), $(typeof r16.className == "string", () => "className is required to be a string, but got type " + typeof r16.className), $(r16.className.length > 0, () => "Class being registered has an empty-string as its className, which is disallowed."), typeof e == "undefined" && (e = "Custom"), typeof t10 == "undefined" && (t10 = r16.className); + let o = t10, n = e + ">" + o; + return df.register(r16), v5.set(n, r16), fS.set(r16, n), r16; } -function Zj(r15) { - return eS.has(r15) ? eS.get(r15) : r15.className; +function k5(r16) { + return fS.has(r16) ? fS.get(r16) : r16.className; } -var kr = class extends $l { - minimize(t8, e = false, o) { - let { value: n, grads: s } = this.computeGradients(t8, o); +var _r = class extends Lc { + minimize(e, t10 = false, o) { + let { value: n, grads: s } = this.computeGradients(e, o); if (o != null) { let a = o.map((i) => ({ name: i.name, tensor: s[i.name] })); this.applyGradients(a); } else this.applyGradients(s); - return Ot(s), e ? n : (n.dispose(), null); + return Lt(s), t10 ? n : (n.dispose(), null); } get iterations() { return this.iterations_ == null && (this.iterations_ = 0), this.iterations_; @@ -8327,11 +8387,11 @@ var kr = class extends $l { incrementIterations() { this.iterations_ = this.iterations + 1; } - computeGradients(t8, e) { - return zw(t8, e); + computeGradients(e, t10) { + return eS(e, t10); } dispose() { - this.iterations_ != null && Ot(this.iterations_); + this.iterations_ != null && Lt(this.iterations_); } async saveIterations() { return this.iterations_ == null && (this.iterations_ = 0), { name: "iter", tensor: ke(this.iterations_, "int32") }; @@ -8339,207 +8399,207 @@ var kr = class extends $l { async getWeights() { throw new Error("getWeights() is not implemented for this optimizer yet."); } - async setWeights(t8) { + async setWeights(e) { throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`); } - async extractIterations(t8) { - return this.iterations_ = (await t8[0].tensor.data())[0], t8.slice(1); + async extractIterations(e) { + return this.iterations_ = (await e[0].tensor.data())[0], e.slice(1); } }; -Object.defineProperty(kr, Symbol.hasInstance, { value: (r15) => r15.minimize != null && r15.computeGradients != null && r15.applyGradients != null }); -var Qu = class extends kr { +Object.defineProperty(_r, Symbol.hasInstance, { value: (r16) => r16.minimize != null && r16.computeGradients != null && r16.applyGradients != null }); +var sp = class extends _r { static get className() { return "Adadelta"; } - constructor(t8, e, o = null) { - super(), this.learningRate = t8, this.rho = e, this.epsilon = o, this.accumulatedGrads = [], this.accumulatedUpdates = [], o == null && (this.epsilon = T.backend.epsilon()); + constructor(e, t10, o = null) { + super(), this.learningRate = e, this.rho = t10, this.epsilon = o, this.accumulatedGrads = [], this.accumulatedUpdates = [], o == null && (this.epsilon = _.backend.epsilon()); } - applyGradients(t8) { - (Array.isArray(t8) ? t8.map((o) => o.name) : Object.keys(t8)).forEach((o, n) => { - let s = T.registeredVariables[o], a = false; - this.accumulatedGrads[n] == null && (this.accumulatedGrads[n] = { originalName: `${o}/accum_grad`, variable: De(() => Gt(s).variable(a)) }), this.accumulatedUpdates[n] == null && (this.accumulatedUpdates[n] = { originalName: `${o}/accum_var`, variable: De(() => Gt(s).variable(a)) }); - let i = Array.isArray(t8) ? t8[n].tensor : t8[o]; + applyGradients(e) { + (Array.isArray(e) ? e.map((o) => o.name) : Object.keys(e)).forEach((o, n) => { + let s = _.registeredVariables[o], a = false; + this.accumulatedGrads[n] == null && (this.accumulatedGrads[n] = { originalName: `${o}/accum_grad`, variable: De(() => Kt(s).variable(a)) }), this.accumulatedUpdates[n] == null && (this.accumulatedUpdates[n] = { originalName: `${o}/accum_var`, variable: De(() => Kt(s).variable(a)) }); + let i = Array.isArray(e) ? e[n].tensor : e[o]; if (i == null) return; let p = this.accumulatedGrads[n].variable, u = this.accumulatedUpdates[n].variable; De(() => { - let c = Ce(se(p, this.rho), se(Zt(i), 1 - this.rho)), l = se(je(Rr(Ce(u, this.epsilon)), Rr(Ce(p, this.epsilon))), i), m = Ce(se(u, this.rho), se(Zt(l), 1 - this.rho)); - p.assign(c), u.assign(m); - let d = Ce(se(l, -this.learningRate), s); + let l = Ce(se(p, this.rho), se(tr(i), 1 - this.rho)), c = se(Xe(Pr(Ce(u, this.epsilon)), Pr(Ce(p, this.epsilon))), i), m = Ce(se(u, this.rho), se(tr(c), 1 - this.rho)); + p.assign(l), u.assign(m); + let d = Ce(se(c, -this.learningRate), s); s.assign(d); }); }), this.incrementIterations(); } dispose() { - this.accumulatedUpdates != null && (Ot(this.accumulatedGrads.map((t8) => t8.variable)), Ot(this.accumulatedUpdates.map((t8) => t8.variable))); + this.accumulatedUpdates != null && (Lt(this.accumulatedGrads.map((e) => e.variable)), Lt(this.accumulatedUpdates.map((e) => e.variable))); } async getWeights() { - let t8 = [...this.accumulatedGrads, ...this.accumulatedUpdates]; - return [await this.saveIterations()].concat(t8.map((e) => ({ name: e.originalName, tensor: e.variable }))); + let e = [...this.accumulatedGrads, ...this.accumulatedUpdates]; + return [await this.saveIterations()].concat(e.map((t10) => ({ name: t10.originalName, tensor: t10.variable }))); } - async setWeights(t8) { - t8 = await this.extractIterations(t8); - let e = t8.length / 2, o = false; - this.accumulatedGrads = t8.slice(0, e).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.accumulatedUpdates = t8.slice(e, e * 2).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })); + async setWeights(e) { + e = await this.extractIterations(e); + let t10 = e.length / 2, o = false; + this.accumulatedGrads = e.slice(0, t10).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.accumulatedUpdates = e.slice(t10, t10 * 2).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })); } getConfig() { return { learningRate: this.learningRate, rho: this.rho, epsilon: this.epsilon }; } - static fromConfig(t8, e) { - return new t8(e.learningRate, e.rho, e.epsilon); + static fromConfig(e, t10) { + return new e(t10.learningRate, t10.rho, t10.epsilon); } }; -var Zu = class extends kr { +var ap = class extends _r { static get className() { return "Adagrad"; } - constructor(t8, e = 0.1) { - super(), this.learningRate = t8, this.initialAccumulatorValue = e, this.accumulatedGrads = []; + constructor(e, t10 = 0.1) { + super(), this.learningRate = e, this.initialAccumulatorValue = t10, this.accumulatedGrads = []; } - applyGradients(t8) { - (Array.isArray(t8) ? t8.map((o) => o.name) : Object.keys(t8)).forEach((o, n) => { - let s = T.registeredVariables[o]; - this.accumulatedGrads[n] == null && (this.accumulatedGrads[n] = { originalName: `${o}/accumulator`, variable: De(() => Ea(s.shape, this.initialAccumulatorValue).variable(false)) }); - let a = Array.isArray(t8) ? t8[n].tensor : t8[o]; + applyGradients(e) { + (Array.isArray(e) ? e.map((o) => o.name) : Object.keys(e)).forEach((o, n) => { + let s = _.registeredVariables[o]; + this.accumulatedGrads[n] == null && (this.accumulatedGrads[n] = { originalName: `${o}/accumulator`, variable: De(() => Ma(s.shape, this.initialAccumulatorValue).variable(false)) }); + let a = Array.isArray(e) ? e[n].tensor : e[o]; if (a == null) return; let i = this.accumulatedGrads[n].variable; De(() => { - let p = Ce(i, Zt(a)); + let p = Ce(i, tr(a)); i.assign(p); - let u = Ce(se(je(a, Rr(Ce(p, T.backend.epsilon()))), -this.learningRate), s); + let u = Ce(se(Xe(a, Pr(Ce(p, _.backend.epsilon()))), -this.learningRate), s); s.assign(u); }); }), this.incrementIterations(); } dispose() { - this.accumulatedGrads != null && Ot(this.accumulatedGrads.map((t8) => t8.variable)); + this.accumulatedGrads != null && Lt(this.accumulatedGrads.map((e) => e.variable)); } async getWeights() { - return [await this.saveIterations()].concat(this.accumulatedGrads.map((t8) => ({ name: t8.originalName, tensor: t8.variable }))); + return [await this.saveIterations()].concat(this.accumulatedGrads.map((e) => ({ name: e.originalName, tensor: e.variable }))); } - async setWeights(t8) { - t8 = await this.extractIterations(t8); - let e = false; - this.accumulatedGrads = t8.map((o) => ({ originalName: o.name, variable: o.tensor.variable(e) })); + async setWeights(e) { + e = await this.extractIterations(e); + let t10 = false; + this.accumulatedGrads = e.map((o) => ({ originalName: o.name, variable: o.tensor.variable(t10) })); } getConfig() { return { learningRate: this.learningRate, initialAccumulatorValue: this.initialAccumulatorValue }; } - static fromConfig(t8, e) { - return new t8(e.learningRate, e.initialAccumulatorValue); + static fromConfig(e, t10) { + return new e(t10.learningRate, t10.initialAccumulatorValue); } }; -var Ju = class extends kr { +var ip = class extends _r { static get className() { return "Adam"; } - constructor(t8, e, o, n = null) { - super(), this.learningRate = t8, this.beta1 = e, this.beta2 = o, this.epsilon = n, this.accumulatedFirstMoment = [], this.accumulatedSecondMoment = [], De(() => { - this.accBeta1 = ke(e).variable(), this.accBeta2 = ke(o).variable(); - }), n == null && (this.epsilon = T.backend.epsilon()); + constructor(e, t10, o, n = null) { + super(), this.learningRate = e, this.beta1 = t10, this.beta2 = o, this.epsilon = n, this.accumulatedFirstMoment = [], this.accumulatedSecondMoment = [], De(() => { + this.accBeta1 = ke(t10).variable(), this.accBeta2 = ke(o).variable(); + }), n == null && (this.epsilon = _.backend.epsilon()); } - applyGradients(t8) { - let e = Array.isArray(t8) ? t8.map((o) => o.name) : Object.keys(t8); + applyGradients(e) { + let t10 = Array.isArray(e) ? e.map((o) => o.name) : Object.keys(e); De(() => { let o = Te(1, this.accBeta1), n = Te(1, this.accBeta2); - e.forEach((s, a) => { - let i = T.registeredVariables[s], p = false; - this.accumulatedFirstMoment[a] == null && (this.accumulatedFirstMoment[a] = { originalName: `${s}/m`, variable: De(() => Gt(i).variable(p)) }), this.accumulatedSecondMoment[a] == null && (this.accumulatedSecondMoment[a] = { originalName: `${s}/v`, variable: De(() => Gt(i).variable(p)) }); - let u = Array.isArray(t8) ? t8[a].tensor : t8[s]; + t10.forEach((s, a) => { + let i = _.registeredVariables[s], p = false; + this.accumulatedFirstMoment[a] == null && (this.accumulatedFirstMoment[a] = { originalName: `${s}/m`, variable: De(() => Kt(i).variable(p)) }), this.accumulatedSecondMoment[a] == null && (this.accumulatedSecondMoment[a] = { originalName: `${s}/v`, variable: De(() => Kt(i).variable(p)) }); + let u = Array.isArray(e) ? e[a].tensor : e[s]; if (u == null) return; - let c = this.accumulatedFirstMoment[a].variable, l = this.accumulatedSecondMoment[a].variable, m = Ce(se(c, this.beta1), se(u, 1 - this.beta1)), d = Ce(se(l, this.beta2), se(Zt(u), 1 - this.beta2)), f = je(m, o), h = je(d, n); - c.assign(m), l.assign(d); - let g = Ce(se(je(f, Ce(Rr(h), this.epsilon)), -this.learningRate), i); + let l = this.accumulatedFirstMoment[a].variable, c = this.accumulatedSecondMoment[a].variable, m = Ce(se(l, this.beta1), se(u, 1 - this.beta1)), d = Ce(se(c, this.beta2), se(tr(u), 1 - this.beta2)), f = Xe(m, o), h = Xe(d, n); + l.assign(m), c.assign(d); + let g = Ce(se(Xe(f, Ce(Pr(h), this.epsilon)), -this.learningRate), i); i.assign(g); }), this.accBeta1.assign(se(this.accBeta1, this.beta1)), this.accBeta2.assign(se(this.accBeta2, this.beta2)); }), this.incrementIterations(); } dispose() { - this.accBeta1.dispose(), this.accBeta2.dispose(), this.accumulatedFirstMoment != null && Ot(this.accumulatedFirstMoment.map((t8) => t8.variable)), this.accumulatedSecondMoment != null && Ot(this.accumulatedSecondMoment.map((t8) => t8.variable)); + this.accBeta1.dispose(), this.accBeta2.dispose(), this.accumulatedFirstMoment != null && Lt(this.accumulatedFirstMoment.map((e) => e.variable)), this.accumulatedSecondMoment != null && Lt(this.accumulatedSecondMoment.map((e) => e.variable)); } async getWeights() { - let t8 = [...this.accumulatedFirstMoment, ...this.accumulatedSecondMoment]; - return [await this.saveIterations()].concat(t8.map((e) => ({ name: e.originalName, tensor: e.variable }))); + let e = [...this.accumulatedFirstMoment, ...this.accumulatedSecondMoment]; + return [await this.saveIterations()].concat(e.map((t10) => ({ name: t10.originalName, tensor: t10.variable }))); } - async setWeights(t8) { - t8 = await this.extractIterations(t8), De(() => { - this.accBeta1.assign(ii(this.beta1, this.iterations_ + 1)), this.accBeta2.assign(ii(this.beta2, this.iterations_ + 1)); + async setWeights(e) { + e = await this.extractIterations(e), De(() => { + this.accBeta1.assign(xi(this.beta1, this.iterations_ + 1)), this.accBeta2.assign(xi(this.beta2, this.iterations_ + 1)); }); - let e = t8.length / 2, o = false; - this.accumulatedFirstMoment = t8.slice(0, e).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.accumulatedSecondMoment = t8.slice(e, e * 2).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })); + let t10 = e.length / 2, o = false; + this.accumulatedFirstMoment = e.slice(0, t10).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.accumulatedSecondMoment = e.slice(t10, t10 * 2).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })); } getConfig() { return { learningRate: this.learningRate, beta1: this.beta1, beta2: this.beta2, epsilon: this.epsilon }; } - static fromConfig(t8, e) { - return new t8(e.learningRate, e.beta1, e.beta2, e.epsilon); + static fromConfig(e, t10) { + return new e(t10.learningRate, t10.beta1, t10.beta2, t10.epsilon); } }; -var ep = class extends kr { +var up = class extends _r { static get className() { return "Adamax"; } - constructor(t8, e, o, n = null, s = 0) { - super(), this.learningRate = t8, this.beta1 = e, this.beta2 = o, this.epsilon = n, this.decay = s, this.accumulatedFirstMoment = [], this.accumulatedWeightedInfNorm = [], De(() => { - this.iteration = ke(0).variable(), this.accBeta1 = ke(e).variable(); - }), n == null && (this.epsilon = T.backend.epsilon()); + constructor(e, t10, o, n = null, s = 0) { + super(), this.learningRate = e, this.beta1 = t10, this.beta2 = o, this.epsilon = n, this.decay = s, this.accumulatedFirstMoment = [], this.accumulatedWeightedInfNorm = [], De(() => { + this.iteration = ke(0).variable(), this.accBeta1 = ke(t10).variable(); + }), n == null && (this.epsilon = _.backend.epsilon()); } - applyGradients(t8) { - let e = Array.isArray(t8) ? t8.map((o) => o.name) : Object.keys(t8); + applyGradients(e) { + let t10 = Array.isArray(e) ? e.map((o) => o.name) : Object.keys(e); De(() => { - let o = Te(1, this.accBeta1), n = je(-this.learningRate, Ce(se(this.iteration, this.decay), 1)); - e.forEach((s, a) => { - let i = T.registeredVariables[s], p = false; - this.accumulatedFirstMoment[a] == null && (this.accumulatedFirstMoment[a] = { originalName: `${s}/m`, variable: Gt(i).variable(p) }), this.accumulatedWeightedInfNorm[a] == null && (this.accumulatedWeightedInfNorm[a] = { originalName: `${s}/v`, variable: Gt(i).variable(p) }); - let u = Array.isArray(t8) ? t8[a].tensor : t8[s]; + let o = Te(1, this.accBeta1), n = Xe(-this.learningRate, Ce(se(this.iteration, this.decay), 1)); + t10.forEach((s, a) => { + let i = _.registeredVariables[s], p = false; + this.accumulatedFirstMoment[a] == null && (this.accumulatedFirstMoment[a] = { originalName: `${s}/m`, variable: Kt(i).variable(p) }), this.accumulatedWeightedInfNorm[a] == null && (this.accumulatedWeightedInfNorm[a] = { originalName: `${s}/v`, variable: Kt(i).variable(p) }); + let u = Array.isArray(e) ? e[a].tensor : e[s]; if (u == null) return; - let c = this.accumulatedFirstMoment[a].variable, l = this.accumulatedWeightedInfNorm[a].variable, m = Ce(se(c, this.beta1), se(u, 1 - this.beta1)), d = se(l, this.beta2), f = Qt(u), h = Dd(d, f); - c.assign(m), l.assign(h); - let g = Ce(se(je(n, o), je(m, Ce(h, this.epsilon))), i); + let l = this.accumulatedFirstMoment[a].variable, c = this.accumulatedWeightedInfNorm[a].variable, m = Ce(se(l, this.beta1), se(u, 1 - this.beta1)), d = se(c, this.beta2), f = er(u), h = Ud(d, f); + l.assign(m), c.assign(h); + let g = Ce(se(Xe(n, o), Xe(m, Ce(h, this.epsilon))), i); i.assign(g); }), this.iteration.assign(Ce(this.iteration, 1)), this.accBeta1.assign(se(this.accBeta1, this.beta1)); }), this.incrementIterations(); } dispose() { - this.accBeta1.dispose(), this.iteration.dispose(), this.accumulatedFirstMoment != null && Ot(this.accumulatedFirstMoment.map((t8) => t8.variable)), this.accumulatedWeightedInfNorm != null && Ot(this.accumulatedWeightedInfNorm.map((t8) => t8.variable)); + this.accBeta1.dispose(), this.iteration.dispose(), this.accumulatedFirstMoment != null && Lt(this.accumulatedFirstMoment.map((e) => e.variable)), this.accumulatedWeightedInfNorm != null && Lt(this.accumulatedWeightedInfNorm.map((e) => e.variable)); } async getWeights() { throw new Error("getWeights() is not implemented for Adamax yet."); } - async setWeights(t8) { + 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(t8, e) { - return new t8(e.learningRate, e.beta1, e.beta2, e.epsilon, e.decay); + static fromConfig(e, t10) { + return new e(t10.learningRate, t10.beta1, t10.beta2, t10.epsilon, t10.decay); } }; -var li = class extends kr { +var wi = class extends _r { static get className() { return "SGD"; } - constructor(t8) { - super(), this.learningRate = t8, this.setLearningRate(t8); + constructor(e) { + super(), this.learningRate = e, this.setLearningRate(e); } - applyGradients(t8) { - (Array.isArray(t8) ? t8.map((o) => o.name) : Object.keys(t8)).forEach((o, n) => { - let s = Array.isArray(t8) ? t8[n].tensor : t8[o]; + applyGradients(e) { + (Array.isArray(e) ? e.map((o) => o.name) : Object.keys(e)).forEach((o, n) => { + let s = Array.isArray(e) ? e[n].tensor : e[o]; if (s == null) return; - let a = T.registeredVariables[o]; + let a = _.registeredVariables[o]; De(() => { let i = Ce(se(this.c, s), a); a.assign(i); }); }), this.incrementIterations(); } - setLearningRate(t8) { - this.learningRate = t8, this.c != null && this.c.dispose(), this.c = Er(ke(-t8)); + setLearningRate(e) { + this.learningRate = e, this.c != null && this.c.dispose(), this.c = Fr(ke(-e)); } dispose() { this.c.dispose(); @@ -8547,29 +8607,29 @@ var li = class extends kr { async getWeights() { return [await this.saveIterations()]; } - async setWeights(t8) { - if (t8 = await this.extractIterations(t8), t8.length !== 0) + 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(t8, e) { - return new t8(e.learningRate); + static fromConfig(e, t10) { + return new e(t10.learningRate); } }; -var tp = class extends li { +var pp = class extends wi { static get className() { return "Momentum"; } - constructor(t8, e, o = false) { - super(t8), this.learningRate = t8, this.momentum = e, this.useNesterov = o, this.accumulations = [], this.m = ke(this.momentum); + constructor(e, t10, o = false) { + super(e), this.learningRate = e, this.momentum = t10, this.useNesterov = o, this.accumulations = [], this.m = ke(this.momentum); } - applyGradients(t8) { - (Array.isArray(t8) ? t8.map((o) => o.name) : Object.keys(t8)).forEach((o, n) => { - let s = T.registeredVariables[o]; - this.accumulations[n] == null && (this.accumulations[n] = { originalName: `${o}/momentum`, variable: De(() => Gt(s).variable(false)) }); - let a = this.accumulations[n].variable, i = Array.isArray(t8) ? t8[n].tensor : t8[o]; + applyGradients(e) { + (Array.isArray(e) ? e.map((o) => o.name) : Object.keys(e)).forEach((o, n) => { + let s = _.registeredVariables[o]; + this.accumulations[n] == null && (this.accumulations[n] = { originalName: `${o}/momentum`, variable: De(() => Kt(s).variable(false)) }); + let a = this.accumulations[n].variable, i = Array.isArray(e) ? e[n].tensor : e[o]; i != null && De(() => { let p, u = Ce(se(this.m, a), i); this.useNesterov ? p = Ce(se(this.c, Ce(i, se(u, this.m))), s) : p = Ce(se(this.c, u), s), a.assign(u), s.assign(p); @@ -8577,52 +8637,52 @@ var tp = class extends li { }), this.incrementIterations(); } dispose() { - this.m.dispose(), this.accumulations != null && Ot(this.accumulations.map((t8) => t8.variable)); + this.m.dispose(), this.accumulations != null && Lt(this.accumulations.map((e) => e.variable)); } - setMomentum(t8) { - this.momentum = t8; + setMomentum(e) { + this.momentum = e; } async getWeights() { - return [await this.saveIterations()].concat(this.accumulations.map((t8) => ({ name: t8.originalName, tensor: t8.variable }))); + return [await this.saveIterations()].concat(this.accumulations.map((e) => ({ name: e.originalName, tensor: e.variable }))); } - async setWeights(t8) { - t8 = await this.extractIterations(t8); - let e = false; - this.accumulations = t8.map((o) => ({ originalName: o.name, variable: o.tensor.variable(e) })); + async setWeights(e) { + e = await this.extractIterations(e); + let t10 = false; + this.accumulations = e.map((o) => ({ originalName: o.name, variable: o.tensor.variable(t10) })); } getConfig() { return { learningRate: this.learningRate, momentum: this.momentum, useNesterov: this.useNesterov }; } - static fromConfig(t8, e) { - return new t8(e.learningRate, e.momentum, e.useNesterov); + static fromConfig(e, t10) { + return new e(t10.learningRate, t10.momentum, t10.useNesterov); } }; -var rp = class extends kr { +var lp = class extends _r { static get className() { return "RMSProp"; } - constructor(t8, e = 0.9, o = 0, n = null, s = false) { - if (super(), this.learningRate = t8, this.decay = e, this.momentum = o, this.epsilon = n, this.accumulatedMeanSquares = [], this.accumulatedMoments = [], this.accumulatedMeanGrads = [], this.centered = s, n == null && (this.epsilon = T.backend.epsilon()), t8 == null) + constructor(e, t10 = 0.9, o = 0, n = null, s = false) { + if (super(), this.learningRate = e, this.decay = t10, this.momentum = o, this.epsilon = n, this.accumulatedMeanSquares = [], this.accumulatedMoments = [], this.accumulatedMeanGrads = [], this.centered = s, n == null && (this.epsilon = _.backend.epsilon()), e == null) throw new Error("learningRate for RMSPropOptimizer must be defined."); } - applyGradients(t8) { - (Array.isArray(t8) ? t8.map((o) => o.name) : Object.keys(t8)).forEach((o, n) => { - let s = T.registeredVariables[o], a = false; - this.accumulatedMeanSquares[n] == null && (this.accumulatedMeanSquares[n] = { originalName: `${o}/rms`, variable: De(() => Gt(s).variable(a)) }), this.accumulatedMoments[n] == null && (this.accumulatedMoments[n] = { originalName: `${o}/momentum`, variable: De(() => Gt(s).variable(a)) }), this.accumulatedMeanGrads[n] == null && this.centered && (this.accumulatedMeanGrads[n] = { originalName: `${o}/mg`, variable: De(() => Gt(s).variable(a)) }); - let i = Array.isArray(t8) ? t8[n].tensor : t8[o]; + applyGradients(e) { + (Array.isArray(e) ? e.map((o) => o.name) : Object.keys(e)).forEach((o, n) => { + let s = _.registeredVariables[o], a = false; + this.accumulatedMeanSquares[n] == null && (this.accumulatedMeanSquares[n] = { originalName: `${o}/rms`, variable: De(() => Kt(s).variable(a)) }), this.accumulatedMoments[n] == null && (this.accumulatedMoments[n] = { originalName: `${o}/momentum`, variable: De(() => Kt(s).variable(a)) }), this.accumulatedMeanGrads[n] == null && this.centered && (this.accumulatedMeanGrads[n] = { originalName: `${o}/mg`, variable: De(() => Kt(s).variable(a)) }); + let i = Array.isArray(e) ? e[n].tensor : e[o]; if (i == null) return; let p = this.accumulatedMeanSquares[n].variable, u = this.accumulatedMoments[n].variable; De(() => { - let c = Ce(se(p, this.decay), se(Zt(i), 1 - this.decay)); + let l = Ce(se(p, this.decay), se(tr(i), 1 - this.decay)); if (this.centered) { - let l = this.accumulatedMeanGrads[n].variable, m = Ce(se(l, this.decay), se(i, 1 - this.decay)), d = je(se(i, this.learningRate), Rr(Te(c, Ce(Zt(m), this.epsilon)))), f = Ce(se(u, this.momentum), d); - p.assign(c), l.assign(m), u.assign(f); + let c = this.accumulatedMeanGrads[n].variable, m = Ce(se(c, this.decay), se(i, 1 - this.decay)), d = Xe(se(i, this.learningRate), Pr(Te(l, Ce(tr(m), this.epsilon)))), f = Ce(se(u, this.momentum), d); + p.assign(l), c.assign(m), u.assign(f); let h = Te(s, f); s.assign(h); } else { - let l = Ce(se(p, this.decay), se(Zt(i), 1 - this.decay)), m = Ce(se(u, this.momentum), je(se(i, this.learningRate), Rr(Ce(l, this.epsilon)))); - p.assign(l), u.assign(m); + let c = Ce(se(p, this.decay), se(tr(i), 1 - this.decay)), m = Ce(se(u, this.momentum), Xe(se(i, this.learningRate), Pr(Ce(c, this.epsilon)))); + p.assign(c), u.assign(m); let d = Te(s, m); s.assign(d); } @@ -8630,133 +8690,133 @@ var rp = class extends kr { }), this.incrementIterations(); } dispose() { - this.accumulatedMeanSquares != null && Ot(this.accumulatedMeanSquares.map((t8) => t8.variable)), this.accumulatedMeanGrads != null && this.centered && Ot(this.accumulatedMeanGrads.map((t8) => t8.variable)), this.accumulatedMoments != null && Ot(this.accumulatedMoments.map((t8) => t8.variable)); + this.accumulatedMeanSquares != null && Lt(this.accumulatedMeanSquares.map((e) => e.variable)), this.accumulatedMeanGrads != null && this.centered && Lt(this.accumulatedMeanGrads.map((e) => e.variable)), this.accumulatedMoments != null && Lt(this.accumulatedMoments.map((e) => e.variable)); } async getWeights() { - let t8 = [...this.accumulatedMeanSquares, ...this.accumulatedMoments]; - return this.centered && t8.push(...this.accumulatedMeanGrads), [await this.saveIterations()].concat(t8.map((e) => ({ name: e.originalName, tensor: e.variable }))); + let e = [...this.accumulatedMeanSquares, ...this.accumulatedMoments]; + return this.centered && e.push(...this.accumulatedMeanGrads), [await this.saveIterations()].concat(e.map((t10) => ({ name: t10.originalName, tensor: t10.variable }))); } - async setWeights(t8) { - t8 = await this.extractIterations(t8); - let e = this.centered ? t8.length / 3 : t8.length / 2, o = false; - this.accumulatedMeanSquares = t8.slice(0, e).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.accumulatedMoments = t8.slice(e, e * 2).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.centered && (this.accumulatedMeanGrads = t8.slice(e * 2, e * 3).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) }))); + async setWeights(e) { + e = await this.extractIterations(e); + let t10 = this.centered ? e.length / 3 : e.length / 2, o = false; + this.accumulatedMeanSquares = e.slice(0, t10).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.accumulatedMoments = e.slice(t10, t10 * 2).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) })), this.centered && (this.accumulatedMeanGrads = e.slice(t10 * 2, t10 * 3).map((n) => ({ originalName: n.name, variable: n.tensor.variable(o) }))); } getConfig() { return { learningRate: this.learningRate, decay: this.decay, momentum: this.momentum, epsilon: this.epsilon, centered: this.centered }; } - static fromConfig(t8, e) { - return new t8(e.learningRate, e.decay, e.momentum, e.epsilon, e.centered); + static fromConfig(e, t10) { + return new e(t10.learningRate, t10.decay, t10.momentum, t10.epsilon, t10.centered); } }; -var Jj = [Qu, Zu, Ju, ep, tp, rp, li]; -function GN() { - for (let r15 of Jj) - tS(r15); +var N5 = [sp, ap, ip, up, pp, lp, wi]; +function FT() { + for (let r16 of N5) + hS(r16); } -var mi = {}; -qe(mi, { CompositeArrayBuffer: () => ir, browserFiles: () => KN, browserHTTPRequest: () => XN, concatenateArrayBuffers: () => uk, copyModel: () => Sk, decodeWeights: () => nd, encodeWeights: () => sk, fromMemory: () => YN, fromMemorySync: () => iS, getLoadHandlers: () => mk, getModelArtifactsForJSON: () => Jp, getModelArtifactsForJSONSync: () => _w, getModelArtifactsInfoForJSON: () => va, getSaveHandlers: () => lk, getWeightSpecs: () => ad, http: () => of, isHTTPScheme: () => rf, listModels: () => Ck, loadWeights: () => qN, moveModel: () => Ik, registerLoadRouter: () => ck, registerSaveRouter: () => pk, removeModel: () => wk, weightsLoaderFactory: () => sS, withSaveHandler: () => QN, withSaveHandlerSync: () => ZN }); -var eX = "model"; -var tX = ".json"; -var rX = ".weights.bin"; -function HN(r15) { - return new Promise((t8) => setTimeout(t8)).then(r15); +var Si = {}; +qe(Si, { CompositeArrayBuffer: () => lr, browserFiles: () => OT, browserHTTPRequest: () => zT, concatenateArrayBuffers: () => Zk, copyModel: () => m1, decodeWeights: () => hd, decodeWeightsStream: () => gd, encodeWeights: () => jk, fromMemory: () => VT, fromMemorySync: () => wS, getLoadHandlers: () => r1, getModelArtifactsForJSON: () => il, getModelArtifactsForJSONSync: () => Uw, getModelArtifactsInfoForJSON: () => $a, getSaveHandlers: () => t1, getWeightSpecs: () => Ec, http: () => hf, isHTTPScheme: () => ff, listModels: () => l1, loadWeights: () => LT, moveModel: () => d1, registerLoadRouter: () => e1, registerSaveRouter: () => Jk, removeModel: () => c1, weightsLoaderFactory: () => bS, withSaveHandler: () => WT, withSaveHandlerSync: () => UT }); +var T5 = "model"; +var _5 = ".json"; +var E5 = ".weights.bin"; +function PT(r16) { + return new Promise((e) => setTimeout(e)).then(r16); } -var lc = class r8 { - constructor(t8) { +var bl = class r8 { + constructor(e) { if (!A().getBool("IS_BROWSER")) throw new Error("browserDownloads() cannot proceed because the current environment is not a browser."); - t8.startsWith(r8.URL_SCHEME) && (t8 = t8.slice(r8.URL_SCHEME.length)), (t8 == null || t8.length === 0) && (t8 = eX), this.modelJsonFileName = t8 + tX, this.weightDataFileName = t8 + rX; + e.startsWith(r8.URL_SCHEME) && (e = e.slice(r8.URL_SCHEME.length)), (e == null || e.length === 0) && (e = T5), this.modelJsonFileName = e + _5, this.weightDataFileName = e + E5; } - async save(t8) { + async save(e) { if (typeof document == "undefined") throw new Error("Browser downloads are not supported in this environment since `document` is not present"); - let e = ir.join(t8.weightData), o = window.URL.createObjectURL(new Blob([e], { type: "application/octet-stream" })); - if (t8.modelTopology instanceof ArrayBuffer) + let t10 = lr.join(e.weightData), o = window.URL.createObjectURL(new Blob([t10], { 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: t8.weightSpecs }], s = sd(t8, n), a = window.URL.createObjectURL(new Blob([JSON.stringify(s)], { type: "application/json" })), i = this.modelJsonAnchor == null ? document.createElement("a") : this.modelJsonAnchor; - if (i.download = this.modelJsonFileName, i.href = a, await HN(() => i.dispatchEvent(new MouseEvent("click"))), t8.weightData != null) { + let n = [{ paths: ["./" + this.weightDataFileName], weights: e.weightSpecs }], s = xd(e, n), a = window.URL.createObjectURL(new Blob([JSON.stringify(s)], { type: "application/json" })), i = this.modelJsonAnchor == null ? document.createElement("a") : this.modelJsonAnchor; + if (i.download = this.modelJsonFileName, i.href = a, await PT(() => i.dispatchEvent(new MouseEvent("click"))), e.weightData != null) { let p = this.weightDataAnchor == null ? document.createElement("a") : this.weightDataAnchor; - p.download = this.weightDataFileName, p.href = o, await HN(() => p.dispatchEvent(new MouseEvent("click"))); + p.download = this.weightDataFileName, p.href = o, await PT(() => p.dispatchEvent(new MouseEvent("click"))); } - return { modelArtifactsInfo: va(t8) }; + return { modelArtifactsInfo: $a(e) }; } } }; -lc.URL_SCHEME = "downloads://"; -var rS = class { - constructor(t8) { - if (t8 == null || t8.length < 1) - throw new Error(`When calling browserFiles, at least 1 file is required, but received ${t8}`); - this.jsonFile = t8[0], this.weightsFiles = t8.slice(1); +bl.URL_SCHEME = "downloads://"; +var gS = 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.jsonFile = e[0], this.weightsFiles = e.slice(1); } async load() { - return new Promise((t8, e) => { + return new Promise((e, t10) => { let o = new FileReader(); o.onload = (n) => { let s = JSON.parse(n.target.result), a = s.modelTopology; if (a == null) { - e(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`)); + t10(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`)); return; } if (s.weightsManifest == null) { - e(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`)); + t10(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`)); return; } if (this.weightsFiles.length === 0) { - t8({ modelTopology: a }); + e({ modelTopology: a }); return; } - let p = Jp(s, (u) => this.loadWeights(u)); - t8(p); - }, o.onerror = (n) => e(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`), o.readAsText(this.jsonFile); + let p = il(s, (u) => this.loadWeights(u)); + e(p); + }, o.onerror = (n) => t10(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`), o.readAsText(this.jsonFile); }); } - loadWeights(t8) { - let e = [], o = []; - for (let a of t8) - e.push(...a.weights), o.push(...a.paths); - let n = this.checkManifestAndWeightFiles(t8), s = o.map((a) => this.loadWeightsFile(a, n[a])); - return Promise.all(s).then((a) => [e, a]); + loadWeights(e) { + let t10 = [], o = []; + for (let a of e) + t10.push(...a.weights), o.push(...a.paths); + let n = this.checkManifestAndWeightFiles(e), s = o.map((a) => this.loadWeightsFile(a, n[a])); + return Promise.all(s).then((a) => [t10, a]); } - loadWeightsFile(t8, e) { + loadWeightsFile(e, t10) { return new Promise((o, n) => { let s = new FileReader(); s.onload = (a) => { let i = a.target.result; o(i); - }, s.onerror = (a) => n(`Failed to weights data from file of path '${t8}'.`), s.readAsArrayBuffer(e); + }, s.onerror = (a) => n(`Failed to weights data from file of path '${e}'.`), s.readAsArrayBuffer(t10); }); } - checkManifestAndWeightFiles(t8) { - let e = [], o = this.weightsFiles.map((s) => Tw(s.name)), n = {}; - for (let s of t8) + checkManifestAndWeightFiles(e) { + let t10 = [], o = this.weightsFiles.map((s) => Ww(s.name)), n = {}; + for (let s of e) s.paths.forEach((a) => { - let i = Tw(a); - if (e.indexOf(i) !== -1) + let i = Ww(a); + if (t10.indexOf(i) !== -1) throw new Error(`Duplicate file basename found in weights manifest: '${i}'`); - if (e.push(i), o.indexOf(i) === -1) + if (t10.push(i), o.indexOf(i) === -1) throw new Error(`Weight file with basename '${i}' is not provided.`); n[a] = this.weightsFiles[o.indexOf(i)]; }); - if (e.length !== this.weightsFiles.length) - throw new Error(`Mismatch in the number of files in weights manifest (${e.length}) and the number of weight files provided (${this.weightsFiles.length}).`); + if (t10.length !== this.weightsFiles.length) + throw new Error(`Mismatch in the number of files in weights manifest (${t10.length}) and the number of weight files provided (${this.weightsFiles.length}).`); return n; } }; -var oX = (r15) => A().getBool("IS_BROWSER") && !Array.isArray(r15) && r15.startsWith(lc.URL_SCHEME) ? nX(r15.slice(lc.URL_SCHEME.length)) : null; -qt.registerSaveRouter(oX); -function nX(r15 = "model") { - return new lc(r15); +var $5 = (r16) => A().getBool("IS_BROWSER") && !Array.isArray(r16) && r16.startsWith(bl.URL_SCHEME) ? R5(r16.slice(bl.URL_SCHEME.length)) : null; +Xt.registerSaveRouter($5); +function R5(r16 = "model") { + return new bl(r16); } -function KN(r15) { - return new rS(r15); +function OT(r16) { + return new gS(r16); } -function oS(r15, t8, e, o) { - a(r15), e = e == null ? 0 : e, o = o == null ? 1 : o, i(e, o); +function xS(r16, e, t10, o) { + a(r16), t10 = t10 == null ? 0 : t10, o = o == null ? 1 : o, i(t10, o); let n = 0, s = (p) => (p.then((u) => { - let c = e + ++n / r15.length * (o - e); - return t8(c), u; + let l = t10 + ++n / r16.length * (o - t10); + return e(l), u; }), p); function a(p) { $(p != null && Array.isArray(p) && p.length > 0, () => "promises must be a none empty array"); @@ -8764,28 +8824,45 @@ function oS(r15, t8, e, o) { function i(p, u) { $(p >= 0 && p <= 1, () => `Progress fraction must be in range [0, 1], but got startFraction ${p}`), $(u >= 0 && u <= 1, () => `Progress fraction must be in range [0, 1], but got endFraction ${u}`), $(u >= p, () => `startFraction must be no more than endFraction, but got startFraction ${p} and endFraction ${u}`); } - return Promise.all(r15.map(s)); -} -async function nS(r15, t8) { - t8 == null && (t8 = {}); - let e = t8.fetchFunc == null ? A().platform.fetch : t8.fetchFunc, o = r15.map((l) => e(l, t8.requestInit, { isBinary: true })), n = 0, s = 0.5, i = (t8.onProgress == null ? await Promise.all(o) : await oS(o, t8.onProgress, n, s)).map((l) => l.arrayBuffer()), p = 0.5, u = 1; - return t8.onProgress == null ? await Promise.all(i) : await oS(i, t8.onProgress, p, u); + return Promise.all(r16.map(s)); +} +async function yS(r16, e) { + e == null && (e = {}); + let t10 = e.fetchFunc == null ? A().platform.fetch : e.fetchFunc, o = r16.map((c) => t10(c, e.requestInit, { isBinary: true })), i = (e.onProgress == null ? await Promise.all(o) : await xS(o, e.onProgress, 0, 0.5)).map((c) => c.arrayBuffer()); + return e.onProgress == null ? await Promise.all(i) : await xS(i, e.onProgress, 0.5, 1); +} +function MT(r16, e) { + var t10; + let o = e.fetchFunc == null ? A().platform.fetch : e.fetchFunc, n = 0, s; + return (t10 = e.onProgress) === null || t10 === void 0 || t10.call(e, 0), new ReadableStream({ pull: async (a) => { + for (var i; n < r16.length; ) { + s || (s = (await o(r16[n], e.requestInit, { isBinary: true })).body.getReader()); + let { done: p, value: u } = await s.read(); + if (p) { + n++, s = void 0, (i = e.onProgress) === null || i === void 0 || i.call(e, n / r16.length); + continue; + } + a.enqueue(u); + return; + } + a.close(); + } }); } -async function qN(r15, t8 = "", e, o) { - return sS((a) => nS(a, { requestInit: o }))(r15, t8, e); +async function LT(r16, e = "", t10, o) { + return bS((a) => yS(a, { requestInit: o }))(r16, e, t10); } -function sS(r15) { - return async (t8, e = "", o) => { - let n = t8.map(() => false), s = {}, a = o != null ? o.map(() => false) : [], i = []; - if (t8.forEach((d, f) => { +function bS(r16) { + return async (e, t10 = "", o) => { + let n = e.map(() => false), s = {}, a = o != null ? o.map(() => false) : [], i = []; + if (e.forEach((d, f) => { let h = 0; d.weights.forEach((g) => { - let x = "quantization" in g ? g.quantization.dtype : g.dtype, b = Cl[x] * He(g.shape), C = () => { + let x = "quantization" in g ? g.quantization.dtype : g.dtype, b = fi[x] * ze(g.shape), w = () => { n[f] = true, s[f] == null && (s[f] = []), s[f].push({ manifestEntry: g, groupOffset: h, sizeBytes: b }); }; o != null ? o.forEach((S, k) => { - S === g.name && (C(), a[k] = true); - }) : C(), i.push(g.name), h += b; + S === g.name && (w(), a[k] = true); + }) : w(), i.push(g.name), h += b; }); }), !a.every((d) => d)) { let d = o.filter((f, h) => !a[h]); @@ -8794,714 +8871,726 @@ Manifest JSON has weights with names: ${i.join(", ")}.`); } let p = n.reduce((d, f, h) => (f && d.push(h), d), []), u = []; p.forEach((d) => { - t8[d].paths.forEach((f) => { - let h = e + (e.endsWith("/") ? "" : "/") + f; + e[d].paths.forEach((f) => { + let h = t10 + (t10.endsWith("/") ? "" : "/") + f; u.push(h); }); }); - let c = await r15(u), l = {}, m = 0; + let l = await r16(u), c = {}, m = 0; return p.forEach((d) => { - let f = t8[d].paths.length, h = new ir(c.slice(m, m + f)); + let f = e[d].paths.length, h = new lr(l.slice(m, m + f)); s[d].forEach((x) => { - let b = h.slice(x.groupOffset, x.groupOffset + x.sizeBytes), C = nd(b, [x.manifestEntry]); - for (let S in C) - l[S] = C[S]; + let b = h.slice(x.groupOffset, x.groupOffset + x.sizeBytes), w = hd(b, [x.manifestEntry]); + for (let S in w) + c[S] = w[S]; }), m += f; - }), l; + }), c; }; } -var sX = "application/octet-stream"; -var aX = "application/json"; -var El = class { - constructor(t8, e) { - if (this.DEFAULT_METHOD = "POST", e == null && (e = {}), this.weightPathPrefix = e.weightPathPrefix, this.onProgress = e.onProgress, this.weightUrlConverter = e.weightUrlConverter, e.fetchFunc != null ? ($(typeof e.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 = e.fetchFunc) : this.fetch = A().platform.fetch, $(t8 != null && t8.length > 0, () => "URL path for http must not be null, undefined or empty."), Array.isArray(t8) && $(t8.length === 2, () => `URL paths for http must have a length of 2, (actual length is ${t8.length}).`), this.path = t8, e.requestInit != null && e.requestInit.body != null) +var D5 = "application/octet-stream"; +var A5 = "application/json"; +var Bc = class { + constructor(e, t10) { + if (this.DEFAULT_METHOD = "POST", t10 == null && (t10 = {}), this.weightPathPrefix = t10.weightPathPrefix, this.weightUrlConverter = t10.weightUrlConverter, t10.fetchFunc != null ? ($(typeof t10.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 = t10.fetchFunc) : this.fetch = A().platform.fetch, $(e != null && e.length > 0, () => "URL path for http must not be null, undefined or empty."), Array.isArray(e) && $(e.length === 2, () => `URL paths for http must have a length of 2, (actual length is ${e.length}).`), this.path = e, t10.requestInit != null && t10.requestInit.body != null) throw new Error("requestInit is expected to have no pre-existing body, but has one."); - this.requestInit = e.requestInit || {}; + this.requestInit = t10.requestInit || {}, this.loadOptions = t10; } - async save(t8) { - if (t8.modelTopology instanceof ArrayBuffer) + async save(e) { + if (e.modelTopology instanceof ArrayBuffer) throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet."); - let e = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); - e.body = new FormData(); - let o = [{ paths: ["./model.weights.bin"], weights: t8.weightSpecs }], n = sd(t8, o); - if (e.body.append("model.json", new Blob([JSON.stringify(n)], { type: aX }), "model.json"), t8.weightData != null) { - let a = ir.join(t8.weightData); - e.body.append("model.weights.bin", new Blob([a], { type: sX }), "model.weights.bin"); - } - let s = await this.fetch(this.path, e); + let t10 = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit); + t10.body = new FormData(); + let o = [{ paths: ["./model.weights.bin"], weights: e.weightSpecs }], n = xd(e, o); + if (t10.body.append("model.json", new Blob([JSON.stringify(n)], { type: A5 }), "model.json"), e.weightData != null) { + let a = lr.join(e.weightData); + t10.body.append("model.weights.bin", new Blob([a], { type: D5 }), "model.weights.bin"); + } + let s = await this.fetch(this.path, t10); if (s.ok) - return { modelArtifactsInfo: va(t8), responses: [s] }; + return { modelArtifactsInfo: $a(e), responses: [s] }; throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`); } - async load() { - let t8 = await this.fetch(this.path, this.requestInit); - if (!t8.ok) - throw new Error(`Request to ${this.path} failed with status code ${t8.status}. Please verify this URL points to the model JSON of the model to load.`); - let e; + async loadModelJSON() { + 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 t10; try { - e = await t8.json(); + t10 = await e.json(); } catch (s) { let a = `Failed to parse model JSON of response from ${this.path}.`; throw this.path.endsWith(".pb") ? a += " 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." : a += " Please make sure the server is serving valid JSON for this request.", new Error(a); } - let o = e.modelTopology, n = e.weightsManifest; + let o = t10.modelTopology, n = t10.weightsManifest; if (o == null && n == null) throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`); - return Jp(e, (s) => this.loadWeights(s)); - } - async loadWeights(t8) { - let e = Array.isArray(this.path) ? this.path[1] : this.path, [o, n] = iX(e), s = this.weightPathPrefix || o, a = ad(t8), i = [], p = []; - for (let c of t8) - for (let l of c.paths) - this.weightUrlConverter != null ? p.push(this.weightUrlConverter(l)) : i.push(s + l + n); - this.weightUrlConverter && i.push(...await Promise.all(p)); - let u = await nS(i, { requestInit: this.requestInit, fetchFunc: this.fetch, onProgress: this.onProgress }); - return [a, u]; + return t10; } -}; -El.URL_SCHEME_REGEX = /^https?:\/\//; -function iX(r15) { - let t8 = r15.lastIndexOf("/"), e = r15.lastIndexOf("?"), o = r15.substring(0, t8), n = e > t8 ? r15.substring(e) : ""; + async load() { + if (this.loadOptions.streamWeights) + return this.loadStream(); + let e = await this.loadModelJSON(); + return il(e, (t10) => this.loadWeights(t10)); + } + async loadStream() { + let e = await this.loadModelJSON(), t10 = await this.getWeightUrls(e.weightsManifest), o = Ec(e.weightsManifest), n = () => MT(t10, this.loadOptions); + return Object.assign(Object.assign({}, e), { weightSpecs: o, getWeightStream: n }); + } + async getWeightUrls(e) { + let t10 = Array.isArray(this.path) ? this.path[1] : this.path, [o, n] = F5(t10), s = this.weightPathPrefix || o, a = [], i = []; + for (let p of e) + for (let u of p.paths) + this.weightUrlConverter != null ? i.push(this.weightUrlConverter(u)) : a.push(s + u + n); + return this.weightUrlConverter && a.push(...await Promise.all(i)), a; + } + async loadWeights(e) { + let t10 = await this.getWeightUrls(e), o = Ec(e), n = await yS(t10, this.loadOptions); + return [o, n]; + } +}; +Bc.URL_SCHEME_REGEX = /^https?:\/\//; +function F5(r16) { + let e = r16.lastIndexOf("/"), t10 = r16.lastIndexOf("?"), o = r16.substring(0, e), n = t10 > e ? r16.substring(t10) : ""; return [o + "/", n]; } -function rf(r15) { - return r15.match(El.URL_SCHEME_REGEX) != null; +function ff(r16) { + return r16.match(Bc.URL_SCHEME_REGEX) != null; } -var jN = (r15, t8) => { - if (typeof fetch == "undefined" && (t8 == null || t8.fetchFunc == null)) +var BT = (r16, e) => { + if (typeof fetch == "undefined" && (e == null || e.fetchFunc == null)) return null; { - let e = true; - if (Array.isArray(r15) ? e = r15.every((o) => rf(o)) : e = rf(r15), e) - return of(r15, t8); + let t10 = true; + if (Array.isArray(r16) ? t10 = r16.every((o) => ff(o)) : t10 = ff(r16), t10) + return hf(r16, e); } return null; }; -qt.registerSaveRouter(jN); -qt.registerLoadRouter(jN); -function of(r15, t8) { - return new El(r15, t8); +Xt.registerSaveRouter(BT); +Xt.registerLoadRouter(BT); +function hf(r16, e) { + return new Bc(r16, e); } -function XN(r15, t8) { - return of(r15, t8); +function zT(r16, e) { + return hf(r16, e); } -var Rl = class { - constructor(t8) { - this.modelArtifacts = t8; +var zc = class { + constructor(e) { + this.modelArtifacts = e; } load() { return this.modelArtifacts; } }; -var nf = class { - constructor(t8) { - this.saveHandler = t8; +var gf = class { + constructor(e) { + this.saveHandler = e; } - save(t8) { - return this.saveHandler(t8); + save(e) { + return this.saveHandler(e); } }; -var aS = class { - constructor(t8) { - t8.load && (this.load = () => Promise.resolve(t8.load())), t8.save && (this.save = (e) => Promise.resolve(t8.save(e))); +var CS = class { + constructor(e) { + e.load && (this.load = () => Promise.resolve(e.load())), e.save && (this.save = (t10) => Promise.resolve(e.save(t10))); } }; -function YN(r15, t8, e, o) { +function VT(r16, e, t10, o) { let n = arguments; - return new aS(iS(...n)); -} -function iS(r15, t8, e, o) { - return arguments.length === 1 ? r15.modelTopology != null || r15.weightSpecs != null ? new Rl(r15) : (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 Rl({ modelTopology: r15 })) : (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 Rl({ modelTopology: r15, weightSpecs: t8, weightData: e, trainingConfig: o })); -} -function QN(r15) { - return new nf(r15); -} -function ZN(r15) { - return new nf(r15); -} -var eT = {}; -qe(eT, { confusionMatrix: () => JN }); -function uX(r15, t8, e) { - let o = v(r15, "labels", "confusionMatrix"), n = v(t8, "predictions", "confusionMatrix"); - $(e == null || e > 0 && Number.isInteger(e), () => `If provided, numClasses must be a positive integer, but got ${e}`), $(o.rank === 1, () => `Expected the rank of labels to be 1, but got ${o.rank}`), $(n.rank === 1, () => `Expected the rank of predictions to be 1, but got ${n.rank}`), $(o.shape[0] === n.shape[0], () => `Mismatch in the number of examples: ${o.shape[0]} vs. ${n.shape[0]}. Labels and predictions should have the same number of elements.`), $(e > 0 && Number.isInteger(e), () => `numClasses is required to be a positive integer, but got ${e}`); - let s = Tl(We(o, "int32"), e), a = Tl(We(n, "int32"), e), i = cc(s), p = Ze(i, a); - return We(p, "int32"); -} -var JN = N({ confusionMatrix_: uX }); -var nT = {}; -qe(nT, { draw: () => gX, fromPixels: () => xX, fromPixelsAsync: () => dX, toPixels: () => hX }); -var op; -var tT = false; -function rT(r15, t8 = 3) { - if (t8 > 4) + return new CS(wS(...n)); +} +function wS(r16, e, t10, o) { + return arguments.length === 1 ? r16.modelTopology != null || r16.weightSpecs != null ? new zc(r16) : (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 zc({ modelTopology: r16 })) : (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 zc({ modelTopology: r16, weightSpecs: e, weightData: t10, trainingConfig: o })); +} +function WT(r16) { + return new gf(r16); +} +function UT(r16) { + return new gf(r16); +} +var HT = {}; +qe(HT, { confusionMatrix: () => GT }); +function P5(r16, e, t10) { + let o = v(r16, "labels", "confusionMatrix"), n = v(e, "predictions", "confusionMatrix"); + $(t10 == null || t10 > 0 && Number.isInteger(t10), () => `If provided, numClasses must be a positive integer, but got ${t10}`), $(o.rank === 1, () => `Expected the rank of labels to be 1, but got ${o.rank}`), $(n.rank === 1, () => `Expected the rank of predictions to be 1, but got ${n.rank}`), $(o.shape[0] === n.shape[0], () => `Mismatch in the number of examples: ${o.shape[0]} vs. ${n.shape[0]}. Labels and predictions should have the same number of elements.`), $(t10 > 0 && Number.isInteger(t10), () => `numClasses is required to be a positive integer, but got ${t10}`); + let s = Oc(Ue(o, "int32"), t10), a = Oc(Ue(n, "int32"), t10), i = yl(s), p = Je(i, a); + return Ue(p, "int32"); +} +var GT = N({ confusionMatrix_: P5 }); +var XT = {}; +qe(XT, { draw: () => U5, fromPixels: () => G5, fromPixelsAsync: () => z5, toPixels: () => W5 }); +var cp; +var KT = false; +function qT(r16, e = 3) { + if (e > 4) throw new Error("Cannot construct Tensor with more than 4 channels from pixels."); - if (r15 == null) + if (r16 == null) throw new Error("pixels passed to tf.browser.fromPixels() can not be null"); - let e = false, o = false, n = false, s = false, a = false, i = false; - if (r15.data instanceof Uint8Array) - e = true; - else if (typeof ImageData != "undefined" && r15 instanceof ImageData) + let t10 = false, o = false, n = false, s = false, a = false, i = false; + if (r16.data instanceof Uint8Array) + t10 = true; + else if (typeof ImageData != "undefined" && r16 instanceof ImageData) o = true; - else if (typeof HTMLVideoElement != "undefined" && r15 instanceof HTMLVideoElement) + else if (typeof HTMLVideoElement != "undefined" && r16 instanceof HTMLVideoElement) n = true; - else if (typeof HTMLImageElement != "undefined" && r15 instanceof HTMLImageElement) + else if (typeof HTMLImageElement != "undefined" && r16 instanceof HTMLImageElement) s = true; - else if (r15.getContext != null) + else if (r16.getContext != null) a = true; - else if (typeof ImageBitmap != "undefined" && r15 instanceof ImageBitmap) + else if (typeof ImageBitmap != "undefined" && r16 instanceof ImageBitmap) i = true; 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 ${r15.constructor.name}`); - if (qp(Eu, T.backendName) != null) { - let f = { pixels: r15 }, h = { numChannels: t8 }; - return T.runKernel(Eu, f, h); + 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 ${r16.constructor.name}`); + if (tl(Lu, _.backendName) != null) { + let f = { pixels: r16 }, h = { numChannels: e }; + return _.runKernel(Lu, f, h); } - let [u, c] = n ? [r15.videoWidth, r15.videoHeight] : [r15.width, r15.height], l; + let [u, l] = n ? [r16.videoWidth, r16.videoHeight] : [r16.width, r16.height], c; if (a) - l = r15.getContext("2d").getImageData(0, 0, u, c).data; - else if (o || e) - l = r15.data; + c = r16.getContext("2d").getImageData(0, 0, u, l).data; + else if (o || t10) + c = r16.data; else if (s || n || i) { - if (op == null) + if (cp == null) if (typeof document == "undefined") if (typeof OffscreenCanvas != "undefined" && typeof OffscreenCanvasRenderingContext2D != "undefined") - op = new OffscreenCanvas(1, 1).getContext("2d"); + cp = new OffscreenCanvas(1, 1).getContext("2d"); else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported."); else - op = document.createElement("canvas").getContext("2d", { willReadFrequently: true }); - op.canvas.width = u, op.canvas.height = c, op.drawImage(r15, 0, 0, u, c), l = op.getImageData(0, 0, u, c).data; + cp = document.createElement("canvas").getContext("2d", { willReadFrequently: true }); + cp.canvas.width = u, cp.canvas.height = l, cp.drawImage(r16, 0, 0, u, l), c = cp.getImageData(0, 0, u, l).data; } let m; - if (t8 === 4) - m = new Int32Array(l); + if (e === 4) + m = new Int32Array(c); else { - let f = u * c; - m = new Int32Array(f * t8); + let f = u * l; + m = new Int32Array(f * e); for (let h = 0; h < f; h++) - for (let g = 0; g < t8; ++g) - m[h * t8 + g] = l[h * 4 + g]; + for (let g = 0; g < e; ++g) + m[h * e + g] = c[h * 4 + g]; } - return qd(m, [c, u, t8], "int32"); + return nf(m, [l, u, e], "int32"); } -function pX(r15) { - return r15 != null && r15.data instanceof Uint8Array; +function O5(r16) { + return r16 != null && r16.data instanceof Uint8Array; } -function cX() { +function M5() { return typeof window != "undefined" && typeof ImageBitmap != "undefined" && window.hasOwnProperty("createImageBitmap"); } -function lX(r15) { - return r15 != null && r15.width !== 0 && r15.height !== 0; +function L5(r16) { + return r16 != null && r16.width !== 0 && r16.height !== 0; } -function mX(r15) { - return cX() && !(r15 instanceof ImageBitmap) && lX(r15) && !pX(r15); +function B5(r16) { + return M5() && !(r16 instanceof ImageBitmap) && L5(r16) && !O5(r16); } -async function dX(r15, t8 = 3) { - let e = null; - if (A().getBool("WRAP_TO_IMAGEBITMAP") && mX(r15)) { +async function z5(r16, e = 3) { + let t10 = null; + if (A().getBool("WRAP_TO_IMAGEBITMAP") && B5(r16)) { let o; try { - o = await createImageBitmap(r15, { premultiplyAlpha: "none" }); + o = await createImageBitmap(r16, { premultiplyAlpha: "none" }); } catch (n) { o = null; } - o != null && o.width === r15.width && o.height === r15.height ? e = o : e = r15; + o != null && o.width === r16.width && o.height === r16.height ? t10 = o : t10 = r16; } else - e = r15; - return rT(e, t8); -} -function oT(r15) { - if (r15.rank !== 2 && r15.rank !== 3) - throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${r15.rank}.`); - let t8 = r15.rank === 2 ? 1 : r15.shape[2]; - if (t8 > 4 || t8 === 2) - throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t8}`); - if (r15.dtype !== "float32" && r15.dtype !== "int32") - throw new Error(`Unsupported type for toPixels: ${r15.dtype}. Please use float32 or int32 tensors.`); -} -function fX(r15) { - let t8 = (r15 == null ? void 0 : r15.alpha) || 1; - if (t8 > 1 || t8 < 0) - throw new Error(`Alpha value ${t8} is suppoed to be in range [0 - 1].`); -} -async function hX(r15, t8) { - let e = v(r15, "img", "toPixels"); - if (!(r15 instanceof mt)) { - let u = e; - e = We(u, "int32"), u.dispose(); - } - oT(e); - let [o, n] = e.shape.slice(0, 2), s = e.rank === 2 ? 1 : e.shape[2], a = await e.data(), i = e.dtype === "float32" ? 255 : 1, p = new Uint8ClampedArray(n * o * 4); + t10 = r16; + return qT(t10, e); +} +function jT(r16) { + if (r16.rank !== 2 && r16.rank !== 3) + throw new Error(`toPixels only supports rank 2 or 3 tensors, got rank ${r16.rank}.`); + let e = r16.rank === 2 ? 1 : r16.shape[2]; + if (e > 4 || e === 2) + throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${e}`); + if (r16.dtype !== "float32" && r16.dtype !== "int32") + throw new Error(`Unsupported type for toPixels: ${r16.dtype}. Please use float32 or int32 tensors.`); +} +function V5(r16) { + let e = (r16 == null ? void 0 : r16.alpha) || 1; + if (e > 1 || e < 0) + throw new Error(`Alpha value ${e} is suppoed to be in range [0 - 1].`); +} +async function W5(r16, e) { + let t10 = v(r16, "img", "toPixels"); + if (!(r16 instanceof dt)) { + let u = t10; + t10 = Ue(u, "int32"), u.dispose(); + } + jT(t10); + let [o, n] = t10.shape.slice(0, 2), s = t10.rank === 2 ? 1 : t10.shape[2], a = await t10.data(), i = t10.dtype === "float32" ? 255 : 1, p = new Uint8ClampedArray(n * o * 4); for (let u = 0; u < o * n; ++u) { - let c = [0, 0, 0, 255]; + let l = [0, 0, 0, 255]; for (let m = 0; m < s; m++) { let d = a[u * s + m]; - if (e.dtype === "float32") { + if (t10.dtype === "float32") { if (d < 0 || d > 1) throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${d}.`); - } else if (e.dtype === "int32" && (d < 0 || d > 255)) + } else if (t10.dtype === "int32" && (d < 0 || d > 255)) throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${d}.`); - s === 1 ? (c[0] = d * i, c[1] = d * i, c[2] = d * i) : c[m] = d * i; + s === 1 ? (l[0] = d * i, l[1] = d * i, l[2] = d * i) : l[m] = d * i; } - let l = u * 4; - p[l + 0] = Math.round(c[0]), p[l + 1] = Math.round(c[1]), p[l + 2] = Math.round(c[2]), p[l + 3] = Math.round(c[3]); + let c = u * 4; + p[c + 0] = Math.round(l[0]), p[c + 1] = Math.round(l[1]), p[c + 2] = Math.round(l[2]), p[c + 3] = Math.round(l[3]); } - if (t8 != null) { - tT || qp(_u, T.backendName) != null && (console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."), tT = true), t8.width = n, t8.height = o; - let u = t8.getContext("2d"), c = new ImageData(p, n, o); - u.putImageData(c, 0, 0); + if (e != null) { + KT || tl(Mu, _.backendName) != null && (console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."), KT = true), e.width = n, e.height = o; + let u = e.getContext("2d"), l = new ImageData(p, n, o); + u.putImageData(l, 0, 0); } - return e !== r15 && e.dispose(), p; + return t10 !== r16 && t10.dispose(), p; } -function gX(r15, t8, e) { - let o = v(r15, "img", "draw"); - if (!(r15 instanceof mt)) { +function U5(r16, e, t10) { + let o = v(r16, "img", "draw"); + if (!(r16 instanceof dt)) { let a = o; - o = We(a, "int32"), a.dispose(); - } - oT(o), fX(e == null ? void 0 : e.imageOptions); - let n = { image: o }, s = { canvas: t8, options: e }; - T.runKernel(_u, n, s); -} -var xX = N({ fromPixels_: rT }); -var sf = {}; -qe(sf, { prepareAndValidate: () => sT }); -function sT(r15, t8) { - let e = r15.shape.length, o = t8.shape.length; - if (e < 1) - throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${e}.`); + o = Ue(a, "int32"), a.dispose(); + } + jT(o), V5(t10 == null ? void 0 : t10.imageOptions); + let n = { image: o }, s = { canvas: e, options: t10 }; + _.runKernel(Mu, n, s); +} +var G5 = N({ fromPixels_: qT }); +var xf = {}; +qe(xf, { prepareAndValidate: () => YT }); +function YT(r16, e) { + let t10 = r16.shape.length, o = e.shape.length; + if (t10 < 1) + throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${t10}.`); if (o < 1) throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${o}.`); - if (t8.dtype !== "int32") - throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t8.dtype}.`); - if (t8.shape[o - 1] > e) - throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t8.shape[o - 1]} vs. ${e}`); - if (He(r15.shape) === 0) - throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${r15.shape}.`); - let n = t8.shape, s = n[n.length - 1], a = 1; - for (let l = 0; l < n.length - 1; ++l) - a *= n[l]; - let i = r15.shape, p = n.slice(); + if (e.dtype !== "int32") + throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${e.dtype}.`); + if (e.shape[o - 1] > t10) + throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${e.shape[o - 1]} vs. ${t10}`); + if (ze(r16.shape) === 0) + throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${r16.shape}.`); + let n = e.shape, s = n[n.length - 1], a = 1; + for (let c = 0; c < n.length - 1; ++c) + a *= n[c]; + let i = r16.shape, p = n.slice(); p.pop(); let u = 1; - for (let l = s; l < e; ++l) - u *= i[l], p.push(i[l]); - let c = [...js(r15.shape).map((l) => l / u), 1].slice(0, s); - return [p, a, u, c]; -} -var pt = {}; -qe(pt, { assertParamsValid: () => bX, computeFlatOffset: () => vX, computeOutShape: () => wX, getNormalizedAxes: () => SX, isSliceContinous: () => IX, maskToAxes: () => CX, parseSliceParams: () => kX, sliceInfo: () => NX, startForAxis: () => dT, startIndicesWithElidedDims: () => cT, stopForAxis: () => fT, stopIndicesWithElidedDims: () => lT, stridesForAxis: () => mT, stridesWithElidedDims: () => iT }); -var uS = -2; -var yX = -1; -function bX(r15, t8, e) { - let o = r15.shape.length; - $(o === t8.length, () => `Error in slice${o}D: Length of begin ${t8} must match the rank of the array (${o}).`), $(o === e.length, () => `Error in slice${o}D: Length of size ${e} must match the rank of the array (${o}).`); + for (let c = s; c < t10; ++c) + u *= i[c], p.push(i[c]); + let l = [...oa(r16.shape).map((c) => c / u), 1].slice(0, s); + return [p, a, u, l]; +} +var nt = {}; +qe(nt, { assertParamsValid: () => K5, computeFlatOffset: () => Q5, computeOutShape: () => j5, getNormalizedAxes: () => X5, isSliceContinous: () => Y5, maskToAxes: () => q5, parseSliceParams: () => Z5, sliceInfo: () => J5, startForAxis: () => n_, startIndicesWithElidedDims: () => t_, stopForAxis: () => s_, stopIndicesWithElidedDims: () => r_, stridesForAxis: () => o_, stridesWithElidedDims: () => ZT }); +var SS = -2; +var H5 = -1; +function K5(r16, e, t10) { + let o = r16.shape.length; + $(o === e.length, () => `Error in slice${o}D: Length of begin ${e} must match the rank of the array (${o}).`), $(o === t10.length, () => `Error in slice${o}D: Length of size ${t10} must match the rank of the array (${o}).`); for (let n = 0; n < o; ++n) - $(t8[n] + e[n] <= r15.shape[n], () => `Error in slice${o}D: begin[${n}] + size[${n}] (${t8[n] + e[n]}) would overflow input.shape[${n}] (${r15.shape[n]})`); + $(e[n] + t10[n] <= r16.shape[n], () => `Error in slice${o}D: begin[${n}] + size[${n}] (${e[n] + t10[n]}) would overflow input.shape[${n}] (${r16.shape[n]})`); } -function CX(r15) { - let t8 = [], e = 0; - for (; r15 > 0; ) - r15 & 1 && t8.push(e), r15 /= 2, e++; - return t8; +function q5(r16) { + let e = [], t10 = 0; + for (; r16 > 0; ) + r16 & 1 && e.push(t10), r16 /= 2, t10++; + return e; } -function wX(r15, t8, e) { +function j5(r16, e, t10) { let o = []; - for (let n = 0; n < r15.length; n++) - o[n] = Math.ceil((t8[n] - r15[n]) / e[n]); + for (let n = 0; n < r16.length; n++) + o[n] = Math.ceil((e[n] - r16[n]) / t10[n]); return o; } -function iT(r15, t8, e, o) { - let n = [...r15]; +function ZT(r16, e, t10, o) { + let n = [...r16]; for (let s = n.length; s < o.length; s++) n.push(1); - for (let s = 0; s < e; s++) - s === 0 ? n[t8] = 1 : (n.splice(t8, 0, 1), n.pop()); + for (let s = 0; s < t10; s++) + s === 0 ? n[e] = 1 : (n.splice(e, 0, 1), n.pop()); return n; } -function uT(r15, t8, e) { - return e <= r15 ? e : e - (t8 - 1); +function JT(r16, e, t10) { + return t10 <= r16 ? t10 : t10 - (e - 1); } -function pT(r15, t8) { - let e = []; - for (let o = 0; o < r15; o++) - e.push(t8 + o); - return e; +function e_(r16, e) { + let t10 = []; + for (let o = 0; o < r16; o++) + t10.push(e + o); + return t10; } -function SX(r15, t8, e, o, n, s, a, i, p) { - let u = r15.length, c = new Array(u), l = new Array(u), m = new Array(u); - if (t8.length && e > 0) { - let d = t8[0], f = e + 1; - c = cT(a, d, f, o, r15), l = lT(i, d, f, n, r15), m = iT(s, d, f, r15); +function X5(r16, e, t10, o, n, s, a, i, p) { + let u = r16.length, l = new Array(u), c = new Array(u), m = new Array(u); + if (e.length && t10 > 0) { + let d = e[0], f = t10 + 1; + l = t_(a, d, f, o, r16), c = r_(i, d, f, n, r16), m = ZT(s, d, f, r16); } else for (let d = 0; d < u; d++) - c[d] = dT(a, o, s, r15, d, p), l[d] = fT(i, n, s, r15, d, p), m[d] = mT(s, d, p); - return { begin: c, end: l, strides: m }; + l[d] = n_(a, o, s, r16, d, p), c[d] = s_(i, n, s, r16, d, p), m[d] = o_(s, d, p); + return { begin: l, end: c, strides: m }; } -function cT(r15, t8, e, o, n) { - let s = [...n], a = pT(e, t8); +function t_(r16, e, t10, o, n) { + let s = [...n], a = e_(t10, e); for (let i = 0; i < s.length; i++) if (a.indexOf(i) > -1) s[i] = 0; else { - let p = uT(t8, e, i), u = o[p]; - r15 & 1 << p && (u = 0), s[i] = u; + let p = JT(e, t10, i), u = o[p]; + r16 & 1 << p && (u = 0), s[i] = u; } return s; } -function lT(r15, t8, e, o, n) { - let s = [...n], a = pT(e, t8); +function r_(r16, e, t10, o, n) { + let s = [...n], a = e_(t10, e); for (let i = 0; i < s.length; i++) if (a.indexOf(i) > -1) s[i] = Number.MAX_SAFE_INTEGER; else { - let p = uT(t8, e, i), u = o[p]; - r15 & 1 << p && (u = Number.MAX_SAFE_INTEGER), s[i] = u; + let p = JT(e, t10, i), u = o[p]; + r16 & 1 << p && (u = Number.MAX_SAFE_INTEGER), s[i] = u; } for (let i = 0; i < s.length; i++) { let p = n[i]; - s[i] < 0 && (s[i] += p), s[i] = Bp(0, s[i], n[i]); + s[i] < 0 && (s[i] += p), s[i] = qp(0, s[i], n[i]); } return s; } -function mT(r15, t8, e) { - let o = r15[t8]; - return (e & 1 << t8 || o == null) && (o = 1), o; +function o_(r16, e, t10) { + let o = r16[e]; + return (t10 & 1 << e || o == null) && (o = 1), o; } -function dT(r15, t8, e, o, n, s) { - let a = t8[n], i = e[n] || 1; - (r15 & 1 << n || s & 1 << n || a == null) && (i > 0 ? a = Number.MIN_SAFE_INTEGER : a = Number.MAX_SAFE_INTEGER); +function n_(r16, e, t10, o, n, s) { + let a = e[n], i = t10[n] || 1; + (r16 & 1 << n || s & 1 << n || a == null) && (i > 0 ? a = Number.MIN_SAFE_INTEGER : a = Number.MAX_SAFE_INTEGER); let p = o[n]; - return a < 0 && (a += p), a = Bp(0, a, p - 1), a; + return a < 0 && (a += p), a = qp(0, a, p - 1), a; } -function fT(r15, t8, e, o, n, s) { - let a = t8[n], i = e[n] || 1; - (r15 & 1 << n || s & 1 << n || a == null) && (i > 0 ? a = Number.MAX_SAFE_INTEGER : a = Number.MIN_SAFE_INTEGER); +function s_(r16, e, t10, o, n, s) { + let a = e[n], i = t10[n] || 1; + (r16 & 1 << n || s & 1 << n || a == null) && (i > 0 ? a = Number.MAX_SAFE_INTEGER : a = Number.MIN_SAFE_INTEGER); let p = o[n]; - return a < 0 && (a += p), i > 0 ? a = Bp(0, a, p) : a = Bp(-1, a, p - 1), a; + return a < 0 && (a += p), i > 0 ? a = qp(0, a, p) : a = qp(-1, a, p - 1), a; } -function IX(r15, t8, e) { - let o = e.length; - for (let n = 0; n < e.length; n++) - if (e[n] > 1) { +function Y5(r16, e, t10) { + let o = t10.length; + for (let n = 0; n < t10.length; n++) + if (t10[n] > 1) { o = n; break; } - for (let n = o + 1; n < e.length; n++) - if (t8[n] > 0 || e[n] !== r15[n]) + for (let n = o + 1; n < t10.length; n++) + if (e[n] > 0 || t10[n] !== r16[n]) return false; return true; } -function vX(r15, t8) { - let e = r15.length > 0 ? r15[r15.length - 1] : 1; - for (let o = 0; o < r15.length - 1; o++) - e += r15[o] * t8[o]; - return e; +function Q5(r16, e) { + let t10 = r16.length > 0 ? r16[r16.length - 1] : 1; + for (let o = 0; o < r16.length - 1; o++) + t10 += r16[o] * e[o]; + return t10; } -function kX(r15, t8, e) { - let o, n = r15.shape.length; - typeof t8 == "number" ? o = [t8, ...new Array(n - 1).fill(0)] : t8.length < n ? o = t8.concat(new Array(n - t8.length).fill(0)) : o = t8.slice(), o.forEach((a) => { +function Z5(r16, e, t10) { + let o, n = r16.shape.length; + typeof e == "number" ? o = [e, ...new Array(n - 1).fill(0)] : e.length < n ? o = e.concat(new Array(n - e.length).fill(0)) : o = e.slice(), o.forEach((a) => { $(a !== -1, () => "slice() does not support negative begin indexing."); }); let s; - return e == null ? s = new Array(n).fill(-1) : typeof e == "number" ? s = [e, ...new Array(n - 1).fill(-1)] : e.length < n ? s = e.concat(new Array(n - e.length).fill(-1)) : s = e, s = s.map((a, i) => a >= 0 ? a : ($(a === -1, () => `Negative size values should be exactly -1 but got ${a} for the slice() size at index ${i}.`), r15.shape[i] - o[i])), [o, s]; + return t10 == null ? s = new Array(n).fill(-1) : typeof t10 == "number" ? s = [t10, ...new Array(n - 1).fill(-1)] : t10.length < n ? s = t10.concat(new Array(n - t10.length).fill(-1)) : s = t10, s = s.map((a, i) => a >= 0 ? a : ($(a === -1, () => `Negative size values should be exactly -1 but got ${a} for the slice() size at index ${i}.`), r16.shape[i] - o[i])), [o, s]; } -function NX(r15, t8, e, o, n, s, a, i, p) { +function J5(r16, e, t10, o, n, s, a, i, p) { let u; - if (o == null ? (u = new Array(t8.length), u.fill(1)) : u = o, a != null && a & a - 1) + if (o == null ? (u = new Array(e.length), u.fill(1)) : u = o, a != null && a & a - 1) throw new Error("Multiple ellipses in slice is not allowed."); - let c = false, l = { dims: u.length, numAddAxisAfterEllipsis: 0, begin: t8.slice(), end: e.slice(), strides: u.slice(), beginMask: n, endMask: s, ellipsisMask: a, newAxisMask: i, shrinkAxisMask: p }; - for (let C = 0; C < l.dims; C++) - c && 1 << C & i && l.numAddAxisAfterEllipsis++, 1 << C & a && (c = true); - c || (l.ellipsisMask |= 1 << l.dims, l.dims++); - let m = { dims: r15.length, beginMask: 0, endMask: 0, beginValid: false, endValid: false }; - TX(l, m); + let l = false, c = { dims: u.length, numAddAxisAfterEllipsis: 0, begin: e.slice(), end: t10.slice(), strides: u.slice(), beginMask: n, endMask: s, ellipsisMask: a, newAxisMask: i, shrinkAxisMask: p }; + for (let w = 0; w < c.dims; w++) + l && 1 << w & i && c.numAddAxisAfterEllipsis++, 1 << w & a && (l = true); + l || (c.ellipsisMask |= 1 << c.dims, c.dims++); + let m = { dims: r16.length, beginMask: 0, endMask: 0, beginValid: false, endValid: false }; + e8(c, m); let d = true, f = true, h = true, g = [], x = []; - for (let C = 0; C < r15.length; ++C) { - if (m.strides[C] === 0) - throw Error(`strides[${C}] must be non-zero`); - let S = !!(m.shrinkAxisMask & 1 << C), k = r15[C]; + for (let w = 0; w < r16.length; ++w) { + if (m.strides[w] === 0) + throw Error(`strides[${w}] must be non-zero`); + let S = !!(m.shrinkAxisMask & 1 << w), k = r16[w]; if (k === -1) { g.push(S ? 1 : -1); continue; } - let _ = [m.beginMask & 1 << C, m.endMask & 1 << C], E = [m.strides[C] > 0 ? 0 : -1, m.strides[C] > 0 ? k : k - 1]; - if (S && m.strides[C] <= 0) + let T = [m.beginMask & 1 << w, m.endMask & 1 << w], E = [m.strides[w] > 0 ? 0 : -1, m.strides[w] > 0 ? k : k - 1]; + if (S && m.strides[w] <= 0) throw Error("only stride 1 allowed on non-range indexing."); - h = h && m.strides[C] === 1; - let R = !!(m.beginMask & 1 << C && m.endMask & 1 << C); + h = h && m.strides[w] === 1; + let R = !!(m.beginMask & 1 << w && m.endMask & 1 << w); if (m.beginValid && m.endValid) { if (S) { - let M = m.begin[C] < 0 ? k + m.begin[C] : m.begin[C]; - if (m.begin[C] = M, m.end[C] = m.begin[C] + 1, M < 0 || M >= k) - throw Error(`slice index ${m.begin[C]} of dimension ${C} out of bounds.`); + let M = m.begin[w] < 0 ? k + m.begin[w] : m.begin[w]; + if (m.begin[w] = M, m.end[w] = m.begin[w] + 1, M < 0 || M >= k) + throw Error(`slice index ${m.begin[w]} of dimension ${w} out of bounds.`); } else - m.begin[C] = aT(m.begin[C], 0, m.strides[C], k, _, E), m.end[C] = aT(m.end[C], 1, m.strides[C], k, _, E); - let O = m.strides[C] === 1 && m.begin[C] === 0 && m.end[C] === k; - d = d && O, f = f && (C === 0 && m.strides[C] === 1 || O); + m.begin[w] = QT(m.begin[w], 0, m.strides[w], k, T, E), m.end[w] = QT(m.end[w], 1, m.strides[w], k, T, E); + let O = m.strides[w] === 1 && m.begin[w] === 0 && m.end[w] === k; + d = d && O, f = f && (w === 0 && m.strides[w] === 1 || O); } else - d = d && m.strides[C] === 1 && R, f = f && (C === 0 && m.strides[C] === 1 || R); - let D, P = false; - if (m.beginValid && m.endValid ? (D = m.end[C] - m.begin[C], P = true) : S ? (D = 1, P = true) : R && k >= 0 && (m.strides[C] < 0 ? D = -k : D = k, P = true), P) { + d = d && m.strides[w] === 1 && R, f = f && (w === 0 && m.strides[w] === 1 || R); + let D, F = false; + if (m.beginValid && m.endValid ? (D = m.end[w] - m.begin[w], F = true) : S ? (D = 1, F = true) : R && k >= 0 && (m.strides[w] < 0 ? D = -k : D = k, F = true), F) { let O; - D === 0 || D < 0 != m.strides[C] < 0 ? O = 0 : O = Math.trunc(D / m.strides[C]) + (D % m.strides[C] !== 0 ? 1 : 0), g.push(O); + D === 0 || D < 0 != m.strides[w] < 0 ? O = 0 : O = Math.trunc(D / m.strides[w]) + (D % m.strides[w] !== 0 ? 1 : 0), g.push(O); } else g.push(-1); } - for (let C = 0; C < m.finalShapeGatherIndices.length; ++C) { - let S = m.finalShapeGatherIndices[C]; - S >= 0 ? x.push(g[S]) : S === uS && x.push(1); - } - return { finalShapeSparse: x.filter((C, S) => m.finalShapeGatherIndices[S] !== uS), finalShape: x, isIdentity: d, sliceDim0: f, isSimpleSlice: h, begin: m.begin, end: m.end, strides: m.strides }; -} -function TX(r15, t8) { - t8.beginMask = 0, t8.endMask = 0, t8.shrinkAxisMask = 0; - let e = 0; - t8.beginValid = r15.begin != null, t8.endValid = r15.end != null, t8.begin = new Array(t8.dims), t8.end = new Array(t8.dims), t8.strides = new Array(t8.dims), t8.finalShapeGatherIndices = [], t8.finalShapeGatherIndicesSparse = [], t8.inputShapeGatherIndicesSparse = new Array(t8.dims); - for (let o = 0; o < r15.dims; o++) - if (1 << o & r15.ellipsisMask) { - let n = Math.min(t8.dims - (r15.dims - o) + 1 + r15.numAddAxisAfterEllipsis, t8.dims); - for (; e < n; e++) - t8.begin[e] = 0, t8.end[e] = 0, t8.strides[e] = 1, t8.beginMask |= 1 << e, t8.endMask |= 1 << e, t8.finalShapeGatherIndices.push(e), t8.finalShapeGatherIndicesSparse.push(-1), t8.inputShapeGatherIndicesSparse[e] = o; - } else if (1 << o & r15.newAxisMask) - t8.finalShapeGatherIndices.push(uS), t8.finalShapeGatherIndicesSparse.push(-1); + for (let w = 0; w < m.finalShapeGatherIndices.length; ++w) { + let S = m.finalShapeGatherIndices[w]; + S >= 0 ? x.push(g[S]) : S === SS && x.push(1); + } + return { finalShapeSparse: x.filter((w, S) => m.finalShapeGatherIndices[S] !== SS), finalShape: x, isIdentity: d, sliceDim0: f, isSimpleSlice: h, begin: m.begin, end: m.end, strides: m.strides }; +} +function e8(r16, e) { + e.beginMask = 0, e.endMask = 0, e.shrinkAxisMask = 0; + let t10 = 0; + e.beginValid = r16.begin != null, e.endValid = r16.end != null, e.begin = new Array(e.dims), e.end = new Array(e.dims), e.strides = new Array(e.dims), e.finalShapeGatherIndices = [], e.finalShapeGatherIndicesSparse = [], e.inputShapeGatherIndicesSparse = new Array(e.dims); + for (let o = 0; o < r16.dims; o++) + if (1 << o & r16.ellipsisMask) { + let n = Math.min(e.dims - (r16.dims - o) + 1 + r16.numAddAxisAfterEllipsis, e.dims); + for (; t10 < n; t10++) + e.begin[t10] = 0, e.end[t10] = 0, e.strides[t10] = 1, e.beginMask |= 1 << t10, e.endMask |= 1 << t10, e.finalShapeGatherIndices.push(t10), e.finalShapeGatherIndicesSparse.push(-1), e.inputShapeGatherIndicesSparse[t10] = o; + } else if (1 << o & r16.newAxisMask) + e.finalShapeGatherIndices.push(SS), e.finalShapeGatherIndicesSparse.push(-1); else { - if (e === t8.begin.length) - throw Error(`Index out of range using input dim ${e}; input has only ${t8.dims} dims, ${t8.begin.length}.`); - r15.begin != null && (t8.begin[e] = r15.begin[o]), r15.end != null && (t8.end[e] = r15.end[o]), t8.strides[e] = r15.strides[o], r15.beginMask & 1 << o && (t8.beginMask |= 1 << e), r15.endMask & 1 << o && (t8.endMask |= 1 << e), r15.shrinkAxisMask & 1 << o ? (t8.finalShapeGatherIndices.push(yX), t8.finalShapeGatherIndicesSparse.push(-1), t8.shrinkAxisMask |= 1 << e) : (t8.finalShapeGatherIndices.push(e), t8.finalShapeGatherIndicesSparse.push(o)), t8.inputShapeGatherIndicesSparse[e] = o, e++; + if (t10 === e.begin.length) + throw Error(`Index out of range using input dim ${t10}; input has only ${e.dims} dims, ${e.begin.length}.`); + r16.begin != null && (e.begin[t10] = r16.begin[o]), r16.end != null && (e.end[t10] = r16.end[o]), e.strides[t10] = r16.strides[o], r16.beginMask & 1 << o && (e.beginMask |= 1 << t10), r16.endMask & 1 << o && (e.endMask |= 1 << t10), r16.shrinkAxisMask & 1 << o ? (e.finalShapeGatherIndices.push(H5), e.finalShapeGatherIndicesSparse.push(-1), e.shrinkAxisMask |= 1 << t10) : (e.finalShapeGatherIndices.push(t10), e.finalShapeGatherIndicesSparse.push(o)), e.inputShapeGatherIndicesSparse[t10] = o, t10++; } } -function aT(r15, t8, e, o, n, s) { - if (n[t8]) - return e > 0 ? s[t8] : s[t8 + 1 & 1]; +function QT(r16, e, t10, o, n, s) { + if (n[e]) + return t10 > 0 ? s[e] : s[e + 1 & 1]; { - let a = r15 < 0 ? o + r15 : r15; + let a = r16 < 0 ? o + r16 : r16; return a < s[0] ? s[0] : a > s[1] ? s[1] : a; } } -var _X = "4.14.0"; -var Dl = class { - static sgd(t8) { - return new li(t8); +var t8 = "4.17.0"; +var Vc = class { + static sgd(e) { + return new wi(e); } - static momentum(t8, e, o = false) { - return new tp(t8, e, o); + static momentum(e, t10, o = false) { + return new pp(e, t10, o); } - static rmsprop(t8, e = 0.9, o = 0, n = null, s = false) { - return new rp(t8, e, o, n, s); + static rmsprop(e, t10 = 0.9, o = 0, n = null, s = false) { + return new lp(e, t10, o, n, s); } - static adam(t8 = 1e-3, e = 0.9, o = 0.999, n = null) { - return new Ju(t8, e, o, n); + static adam(e = 1e-3, t10 = 0.9, o = 0.999, n = null) { + return new ip(e, t10, o, n); } - static adadelta(t8 = 1e-3, e = 0.95, o = null) { - return new Qu(t8, e, o); + static adadelta(e = 1e-3, t10 = 0.95, o = null) { + return new sp(e, t10, o); } - static adamax(t8 = 2e-3, e = 0.9, o = 0.999, n = null, s = 0) { - return new ep(t8, e, o, n, s); + static adamax(e = 2e-3, t10 = 0.9, o = 0.999, n = null, s = 0) { + return new up(e, t10, o, n, s); } - static adagrad(t8, e = 0.1) { - return new Zu(t8, e); + static adagrad(e, t10 = 0.1) { + return new ap(e, t10); } }; -var TGe = Dl; -var $X = typeof requestAnimationFrame != "undefined" ? requestAnimationFrame : typeof setImmediate != "undefined" ? setImmediate : (r15) => r15(); -function pS() { - return new Promise((r15) => $X(() => r15())); +var cHe = Vc; +var r82 = typeof requestAnimationFrame != "undefined" ? requestAnimationFrame : typeof setImmediate != "undefined" ? setImmediate : (r16) => r16(); +function IS() { + return new Promise((r16) => r82(() => r16())); } -var w = {}; -qe(w, { ERF_A1: () => KX, ERF_A2: () => qX, ERF_A3: () => jX, ERF_A4: () => XX, ERF_A5: () => YX, ERF_P: () => HX, PARALLELIZE_THRESHOLD: () => af, RowPartitionType: () => Fa, SELU_SCALE: () => GX, SELU_SCALEALPHA: () => UX, applyActivation: () => Xu, assertAndGetBroadcastShape: () => rt, assertAxesAreInnerMostDims: () => tK, assertParamsConsistent: () => EX, assignToTypedArray: () => r52, axesAreInnerMostDims: () => Bw, calculateShapes: () => W1, checkEinsumDimSizes: () => u5, checkPadOnDimRoundingMode: () => Lt, combineLocations: () => y2, combineRaggedTensorToTensorShapes: () => DX, complexWithEvenIndex: () => JX, complexWithOddIndex: () => e5, computeConv2DInfo: () => Lu, computeConv3DInfo: () => Lk, computeDefaultPad: () => Lw, computeDilation2DInfo: () => J4, computeOptimalWindowSize: () => OX, computeOutAndReduceShapes: () => eK, computeOutShape: () => RX, computePool2DInfo: () => Mw, computePool3DInfo: () => eH, convertConv2DDataFormat: () => Bk, decodeEinsumEquation: () => a5, eitherStridesOrDilationsAreOne: () => gr, expandShapeToKeepDim: () => ai, exponent: () => n5, exponents: () => o5, fromStringArrayToUint8: () => $5, fromUint8ToStringArray: () => _5, getAxesPermutation: () => rK, getBroadcastDims: () => d2, getComplexWithIndex: () => t5, getEinsumComputePath: () => p5, getEinsumPermutation: () => i5, getFusedBiasGradient: () => ju, getFusedDyActivation: () => qu, getImageCenter: () => MX, getInnerMostAxes: () => nK, getPermuted: () => BX, getRaggedRank: () => FX, getReductionAxes: () => gd, getReshaped: () => LX, getReshapedPermuted: () => zX, getRowPartitionTypesHelper: () => AX, getSliceBeginCoords: () => VX, getSliceSize: () => WX, getSparseFillEmptyRowsIndicesDenseShapeMismatch: () => d5, getSparseFillEmptyRowsNegativeIndexErrorMessage: () => f5, getSparseFillEmptyRowsOutOfRangeIndexErrorMessage: () => h5, getSparseReshapeEmptyTensorZeroOutputDimErrorMessage: () => y5, getSparseReshapeInputOutputMismatchErrorMessage: () => C5, getSparseReshapeInputOutputMultipleErrorMessage: () => b5, getSparseReshapeMultipleNegativeOneOutputDimErrorMessage: () => g5, getSparseReshapeNegativeOutputDimErrorMessage: () => x5, getSparseSegmentReductionIndicesOutOfRangeErrorMessage: () => v5, getSparseSegmentReductionNegativeSegmentIdsErrorMessage: () => w5, getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage: () => S5, getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage: () => I5, getUndoAxesPermutation: () => oK, isIdentityPermutation: () => c5, log: () => XG, mergeRealAndImagArrays: () => QX, prepareAndValidate: () => sT, prepareSplitSize: () => m5, segment_util: () => lS, shouldFuse: () => Yu, slice_util: () => pt, splitRealAndImagArrays: () => ZX, stridesOrDilationsArePositive: () => Ta, tupleValuesAreOne: () => Mu, upcastType: () => dt, validateDefaultValueShape: () => PX, validateInput: () => pc, validateUpdateShape: () => Yw, warn: () => Ia }); -function EX(r15, t8) { - let e = r15[0].length; - r15.forEach((n, s) => { - $(n.length === e, () => `Error in concat${e}D: rank of tensors[${s}] must be the same as the rank of the rest (${e})`); - }), $(t8 >= 0 && t8 < e, () => `Error in concat${e}D: axis must be between 0 and ${e - 1}.`); - let o = r15[0]; - r15.forEach((n, s) => { - for (let a = 0; a < e; a++) - $(a === t8 || n[a] === o[a], () => `Error in concat${e}D: Shape of tensors[${s}] (${n}) does not match the shape of the rest (${o}) along the non-concatenated axis ${s}.`); +var C = {}; +qe(C, { ERF_A1: () => b8, ERF_A2: () => C8, ERF_A3: () => w8, ERF_A4: () => S8, ERF_A5: () => I8, ERF_P: () => y8, PARALLELIZE_THRESHOLD: () => yf, RowPartitionType: () => Va, SELU_SCALE: () => x8, SELU_SCALEALPHA: () => g8, applyActivation: () => op, assertAndGetBroadcastShape: () => rt, assertAxesAreInnerMostDims: () => _q, assertParamsConsistent: () => o8, assignToTypedArray: () => E8, axesAreInnerMostDims: () => Jw, calculateShapes: () => DN, checkEinsumDimSizes: () => P8, checkPadOnDimRoundingMode: () => zt, combineLocations: () => u2, combineRaggedTensorToTensorShapes: () => s8, complexWithEvenIndex: () => N8, complexWithOddIndex: () => T8, computeConv2DInfo: () => Ku, computeConv3DInfo: () => _1, computeDefaultPad: () => Zw, computeDilation2DInfo: () => NK, computeOptimalWindowSize: () => p8, computeOutAndReduceShapes: () => Tq, computeOutShape: () => n8, computePool2DInfo: () => Qw, computePool3DInfo: () => TK, convertConv2DDataFormat: () => E1, decodeEinsumEquation: () => A8, eitherStridesOrDilationsAreOne: () => br, expandShapeToKeepDim: () => gi, exponent: () => R8, exponents: () => $8, fromStringArrayToUint8: () => rY, fromUint8ToStringArray: () => tY, getAxesPermutation: () => Eq, getBroadcastDims: () => o2, getComplexWithIndex: () => _8, getEinsumComputePath: () => O8, getEinsumPermutation: () => F8, getFusedBiasGradient: () => rp, getFusedDyActivation: () => tp, getImageCenter: () => l8, getInnerMostAxes: () => Rq, getPermuted: () => m8, getRaggedRank: () => i8, getReductionAxes: () => Td, getReshaped: () => c8, getReshapedPermuted: () => d8, getRowPartitionTypesHelper: () => a8, getSliceBeginCoords: () => f8, getSliceSize: () => h8, getSparseFillEmptyRowsIndicesDenseShapeMismatch: () => z8, getSparseFillEmptyRowsNegativeIndexErrorMessage: () => V8, getSparseFillEmptyRowsOutOfRangeIndexErrorMessage: () => W8, getSparseReshapeEmptyTensorZeroOutputDimErrorMessage: () => H8, getSparseReshapeInputOutputMismatchErrorMessage: () => q8, getSparseReshapeInputOutputMultipleErrorMessage: () => K8, getSparseReshapeMultipleNegativeOneOutputDimErrorMessage: () => U8, getSparseReshapeNegativeOutputDimErrorMessage: () => G8, getSparseSegmentReductionIndicesOutOfRangeErrorMessage: () => Q8, getSparseSegmentReductionNegativeSegmentIdsErrorMessage: () => j8, getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage: () => X8, getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage: () => Y8, getUndoAxesPermutation: () => $q, isIdentityPermutation: () => M8, log: () => CH, mergeRealAndImagArrays: () => v8, prepareAndValidate: () => YT, prepareSplitSize: () => B8, segment_util: () => kS, shouldFuse: () => np, slice_util: () => nt, splitRealAndImagArrays: () => k8, stridesOrDilationsArePositive: () => Aa, tupleValuesAreOne: () => Hu, upcastType: () => pt, validateDefaultValueShape: () => u8, validateInput: () => xl, validateUpdateShape: () => lS, warn: () => Ea }); +function o8(r16, e) { + let t10 = r16[0].length; + r16.forEach((n, s) => { + $(n.length === t10, () => `Error in concat${t10}D: rank of tensors[${s}] must be the same as the rank of the rest (${t10})`); + }), $(e >= 0 && e < t10, () => `Error in concat${t10}D: axis must be between 0 and ${t10 - 1}.`); + let o = r16[0]; + r16.forEach((n, s) => { + for (let a = 0; a < t10; a++) + $(a === e || n[a] === o[a], () => `Error in concat${t10}D: Shape of tensors[${s}] (${n}) does not match the shape of the rest (${o}) along the non-concatenated axis ${s}.`); }); } -function RX(r15, t8) { - let e = r15[0].slice(); - for (let o = 1; o < r15.length; o++) - e[t8] += r15[o][t8]; - return e; -} -var Fa; -(function(r15) { - r15[r15.FIRST_DIM_SIZE = 0] = "FIRST_DIM_SIZE", r15[r15.VALUE_ROWIDS = 1] = "VALUE_ROWIDS", r15[r15.ROW_LENGTHS = 2] = "ROW_LENGTHS", r15[r15.ROW_SPLITS = 3] = "ROW_SPLITS", r15[r15.ROW_LIMITS = 4] = "ROW_LIMITS", r15[r15.ROW_STARTS = 5] = "ROW_STARTS"; -})(Fa || (Fa = {})); -function DX(r15, t8, e) { +function n8(r16, e) { + let t10 = r16[0].slice(); + for (let o = 1; o < r16.length; o++) + t10[e] += r16[o][e]; + return t10; +} +var Va; +(function(r16) { + r16[r16.FIRST_DIM_SIZE = 0] = "FIRST_DIM_SIZE", r16[r16.VALUE_ROWIDS = 1] = "VALUE_ROWIDS", r16[r16.ROW_LENGTHS = 2] = "ROW_LENGTHS", r16[r16.ROW_SPLITS = 3] = "ROW_SPLITS", r16[r16.ROW_LIMITS = 4] = "ROW_LIMITS", r16[r16.ROW_STARTS = 5] = "ROW_STARTS"; +})(Va || (Va = {})); +function s8(r16, e, t10) { let o = new Array(); - if (e == null && t8 == null) + if (t10 == null && e == null) return o; - if (t8 == null) - for (; o.length < r15 + e.length; ) + if (e == null) + for (; o.length < r16 + t10.length; ) o.push(-1); else - o = t8.slice(); - if (e == null) + o = e.slice(); + if (t10 == null) return o; - if (r15 + e.length !== o.length) - throw new Error(`rt input.shape and shape=${t8} are incompatible: rt input.rank = ${r15 + e.length}, but shape.rank = ${o.length}`); - for (let n = 1; n < e.length; ++n) { - let s = e[n], a = o[o.length - e.length + n], i = o[a]; + if (r16 + t10.length !== o.length) + throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.rank = ${r16 + t10.length}, but shape.rank = ${o.length}`); + for (let n = 1; n < t10.length; ++n) { + let s = t10[n], a = o[o.length - t10.length + n], i = o[a]; if (s >= 0) if (i >= 0) { if (i !== s) - throw new Error(`rt input.shape and shape=${t8} are incompatible: rt input.shape[${n + r15}] = ${s} but shape[${n + r15}] = ${i}`); + throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.shape[${n + r16}] = ${s} but shape[${n + r16}] = ${i}`); } else o[a] = s; } return o; } -function AX(r15) { - let t8 = { FIRST_DIM_SIZE: Fa.FIRST_DIM_SIZE, VALUE_ROWIDS: Fa.VALUE_ROWIDS, ROW_LENGTHS: Fa.ROW_LENGTHS, ROW_SPLITS: Fa.ROW_SPLITS, ROW_LIMITS: Fa.ROW_LIMITS, ROW_STARTS: Fa.ROW_STARTS }, e = []; - for (let o of r15) - if (o in t8) - e.push(t8[o]); +function a8(r16) { + let e = { FIRST_DIM_SIZE: Va.FIRST_DIM_SIZE, VALUE_ROWIDS: Va.VALUE_ROWIDS, ROW_LENGTHS: Va.ROW_LENGTHS, ROW_SPLITS: Va.ROW_SPLITS, ROW_LIMITS: Va.ROW_LIMITS, ROW_STARTS: Va.ROW_STARTS }, t10 = []; + for (let o of r16) + if (o in e) + t10.push(e[o]); else break; - return e; + return t10; } -function FX(r15) { - return r15.length === 0 ? 0 : r15[0] === Fa.FIRST_DIM_SIZE ? r15.length - 1 : r15.length; +function i8(r16) { + return r16.length === 0 ? 0 : r16[0] === Va.FIRST_DIM_SIZE ? r16.length - 1 : r16.length; } -function PX(r15, t8) { - if (r15 == null || t8 == null) +function u8(r16, e) { + if (r16 == null || e == null) return; - let e = r15.length, o = t8.length; - if (e >= o) - throw new Error(`defaultValue.shape=${r15} and ragged tensor flatValues.shape=${t8}, are incompatible: defaultValue.rank = ${e} must be less than ragged tensor input flatValues.rank = ${o})`); - for (let n = 0; n < Math.min(e, o - 1); ++n) { - let s = r15[n], a = t8[n + 1]; + let t10 = r16.length, o = e.length; + if (t10 >= o) + throw new Error(`defaultValue.shape=${r16} and ragged tensor flatValues.shape=${e}, are incompatible: defaultValue.rank = ${t10} must be less than ragged tensor input flatValues.rank = ${o})`); + for (let n = 0; n < Math.min(t10, o - 1); ++n) { + let s = r16[n], a = e[n + 1]; if (s >= 0 && a >= 0 && s !== 1 && s !== a) - throw new Error(`defaultValue.shape=${r15}, and ragged tensor input flatValues.shape=${t8} are incompatible: defaultValue.shape[${n - r15.length}] = ${s} but ragged tensor input.flatValues.shape[${n - r15.length}] = ${a}`); + throw new Error(`defaultValue.shape=${r16}, and ragged tensor input flatValues.shape=${e} are incompatible: defaultValue.shape[${n - r16.length}] = ${s} but ragged tensor input.flatValues.shape[${n - r16.length}] = ${a}`); } } -var af = 30; -function OX(r15) { - return r15 <= af ? r15 : Vp(r15, Math.floor(Math.sqrt(r15))); +var yf = 30; +function p8(r16) { + return r16 <= yf ? r16 : Xp(r16, Math.floor(Math.sqrt(r16))); } -function MX(r15, t8, e) { - let o = e * (typeof r15 == "number" ? r15 : r15[0]), n = t8 * (typeof r15 == "number" ? r15 : r15[1]); +function l8(r16, e, t10) { + let o = t10 * (typeof r16 == "number" ? r16 : r16[0]), n = e * (typeof r16 == "number" ? r16 : r16[1]); return [o, n]; } -function LX(r15, t8, e, o = true) { +function c8(r16, e, t10, o = true) { let n = []; if (o) - n = n.concat(t8.slice(0)), n.push(r15[0] / e), n = n.concat(r15.slice(1)); + n = n.concat(e.slice(0)), n.push(r16[0] / t10), n = n.concat(r16.slice(1)); else { - n = n.concat(r15[0]); - let s = t8.length; + n = n.concat(r16[0]); + let s = e.length; for (let a = 0; a < s; ++a) - n = n.concat([r15[a + 1] / t8[a], t8[a]]); - n = n.concat(r15.slice(s + 1)); + n = n.concat([r16[a + 1] / e[a], e[a]]); + n = n.concat(r16.slice(s + 1)); } return n; } -function BX(r15, t8, e = true) { +function m8(r16, e, t10 = true) { let o = []; - if (e) { - o.push(t8); - for (let n = t8 + 1; n < r15; ++n) - n <= 2 * t8 ? (o.push(n), o.push(n - (t8 + 1))) : o.push(n); + if (t10) { + o.push(e); + for (let n = e + 1; n < r16; ++n) + n <= 2 * e ? (o.push(n), o.push(n - (e + 1))) : o.push(n); } else { let n = [], s = []; - for (let a = 1; a < r15; ++a) - a >= t8 * 2 + 1 || a % 2 === 1 ? s.push(a) : n.push(a); + for (let a = 1; a < r16; ++a) + a >= e * 2 + 1 || a % 2 === 1 ? s.push(a) : n.push(a); o.push(...n), o.push(0), o.push(...s); } return o; } -function zX(r15, t8, e, o = true) { +function d8(r16, e, t10, o = true) { let n = []; - o ? n.push(r15[0] / e) : n.push(r15[0] * e); - for (let s = 1; s < r15.length; ++s) - s <= t8.length ? o ? n.push(t8[s - 1] * r15[s]) : n.push(r15[s] / t8[s - 1]) : n.push(r15[s]); + o ? n.push(r16[0] / t10) : n.push(r16[0] * t10); + for (let s = 1; s < r16.length; ++s) + s <= e.length ? o ? n.push(e[s - 1] * r16[s]) : n.push(r16[s] / e[s - 1]) : n.push(r16[s]); return n; } -function VX(r15, t8) { - let e = [0]; - for (let o = 0; o < t8; ++o) - e.push(r15[o][0]); - return e; +function f8(r16, e) { + let t10 = [0]; + for (let o = 0; o < e; ++o) + t10.push(r16[o][0]); + return t10; } -function WX(r15, t8, e) { - let o = r15.slice(0, 1); - for (let n = 0; n < e; ++n) - o.push(r15[n + 1] - t8[n][0] - t8[n][1]); +function h8(r16, e, t10) { + let o = r16.slice(0, 1); + for (let n = 0; n < t10; ++n) + o.push(r16[n + 1] - e[n][0] - e[n][1]); return o; } -var UX = 1.7580993408473768; -var GX = 1.0507009873554805; -var HX = 0.3275911; -var KX = 0.254829592; -var qX = -0.284496736; -var jX = 1.421413741; -var XX = -1.453152027; -var YX = 1.061405429; -function QX(r15, t8) { - if (r15.length !== t8.length) - throw new Error(`Cannot merge real and imag arrays of different lengths. real:${r15.length}, imag: ${t8.length}.`); - let e = new Float32Array(r15.length * 2); - for (let o = 0; o < e.length; o += 2) - e[o] = r15[o / 2], e[o + 1] = t8[o / 2]; - return e; -} -function ZX(r15) { - let t8 = new Float32Array(r15.length / 2), e = new Float32Array(r15.length / 2); - for (let o = 0; o < r15.length; o += 2) - t8[o / 2] = r15[o], e[o / 2] = r15[o + 1]; - return { real: t8, imag: e }; -} -function JX(r15) { - let t8 = Math.ceil(r15.length / 4), e = new Float32Array(t8), o = new Float32Array(t8); - for (let n = 0; n < r15.length; n += 4) - e[Math.floor(n / 4)] = r15[n], o[Math.floor(n / 4)] = r15[n + 1]; - return { real: e, imag: o }; -} -function e5(r15) { - let t8 = Math.floor(r15.length / 4), e = new Float32Array(t8), o = new Float32Array(t8); - for (let n = 2; n < r15.length; n += 4) - e[Math.floor(n / 4)] = r15[n], o[Math.floor(n / 4)] = r15[n + 1]; - return { real: e, imag: o }; -} -function t5(r15, t8) { - let e = r15[t8 * 2], o = r15[t8 * 2 + 1]; - return { real: e, imag: o }; -} -function r52(r15, t8, e, o) { - r15[o * 2] = t8, r15[o * 2 + 1] = e; -} -function o5(r15, t8) { - let e = new Float32Array(r15 / 2), o = new Float32Array(r15 / 2); - for (let n = 0; n < Math.ceil(r15 / 2); n++) { - let s = (t8 ? 2 : -2) * Math.PI * (n / r15); - e[n] = Math.cos(s), o[n] = Math.sin(s); - } - return { real: e, imag: o }; -} -function n5(r15, t8, e) { - let o = (e ? 2 : -2) * Math.PI * (r15 / t8), n = Math.cos(o), s = Math.sin(o); +var g8 = 1.7580993408473768; +var x8 = 1.0507009873554805; +var y8 = 0.3275911; +var b8 = 0.254829592; +var C8 = -0.284496736; +var w8 = 1.421413741; +var S8 = -1.453152027; +var I8 = 1.061405429; +function v8(r16, e) { + if (r16.length !== e.length) + throw new Error(`Cannot merge real and imag arrays of different lengths. real:${r16.length}, imag: ${e.length}.`); + let t10 = new Float32Array(r16.length * 2); + for (let o = 0; o < t10.length; o += 2) + t10[o] = r16[o / 2], t10[o + 1] = e[o / 2]; + return t10; +} +function k8(r16) { + let e = new Float32Array(r16.length / 2), t10 = new Float32Array(r16.length / 2); + for (let o = 0; o < r16.length; o += 2) + e[o / 2] = r16[o], t10[o / 2] = r16[o + 1]; + return { real: e, imag: t10 }; +} +function N8(r16) { + let e = Math.ceil(r16.length / 4), t10 = new Float32Array(e), o = new Float32Array(e); + for (let n = 0; n < r16.length; n += 4) + t10[Math.floor(n / 4)] = r16[n], o[Math.floor(n / 4)] = r16[n + 1]; + return { real: t10, imag: o }; +} +function T8(r16) { + let e = Math.floor(r16.length / 4), t10 = new Float32Array(e), o = new Float32Array(e); + for (let n = 2; n < r16.length; n += 4) + t10[Math.floor(n / 4)] = r16[n], o[Math.floor(n / 4)] = r16[n + 1]; + return { real: t10, imag: o }; +} +function _8(r16, e) { + let t10 = r16[e * 2], o = r16[e * 2 + 1]; + return { real: t10, imag: o }; +} +function E8(r16, e, t10, o) { + r16[o * 2] = e, r16[o * 2 + 1] = t10; +} +function $8(r16, e) { + let t10 = new Float32Array(r16 / 2), o = new Float32Array(r16 / 2); + for (let n = 0; n < Math.ceil(r16 / 2); n++) { + let s = (e ? 2 : -2) * Math.PI * (n / r16); + t10[n] = Math.cos(s), o[n] = Math.sin(s); + } + return { real: t10, imag: o }; +} +function R8(r16, e, t10) { + let o = (t10 ? 2 : -2) * Math.PI * (r16 / e), n = Math.cos(o), s = Math.sin(o); return { real: n, imag: s }; } -var cS = "->"; -var s5 = /->/g; -var hT = ","; -var gT = "..."; -function a5(r15, t8) { - r15 = r15.replace(/\s/g, ""); - let e = (r15.length - r15.replace(s5, "").length) / cS.length; - if (e < 1) +var vS = "->"; +var D8 = /->/g; +var a_ = ","; +var i_ = "..."; +function A8(r16, e) { + r16 = r16.replace(/\s/g, ""); + let t10 = (r16.length - r16.replace(D8, "").length) / vS.length; + if (t10 < 1) throw new Error("Equations without an arrow are not supported."); - if (e > 1) - throw new Error(`Equation must contain exactly one arrow ("${cS}").`); - let [o, n] = r15.split(cS); - $(o.indexOf(gT) === -1, () => `The ellipsis notation ("${gT}") is not supported yet.`); - let s = o.split(hT), a = s.length; - if (t8 !== a) - throw new Error(`Expected ${a} input tensors, received ${t8}`); + if (t10 > 1) + throw new Error(`Equation must contain exactly one arrow ("${vS}").`); + let [o, n] = r16.split(vS); + $(o.indexOf(i_) === -1, () => `The ellipsis notation ("${i_}") is not supported yet.`); + let s = o.split(a_), a = s.length; + if (e !== a) + throw new Error(`Expected ${a} input tensors, received ${e}`); if (a > 2) throw new Error("Support for more than 2 input tensors is not implemented yet."); let i = []; @@ -9513,7 +9602,7 @@ function a5(r15, t8) { } for (let m = 0; m < o.length; ++m) { let d = o[m]; - i.indexOf(d) === -1 && d !== hT && i.push(d); + i.indexOf(d) === -1 && d !== a_ && i.push(d); } let p = new Array(s.length); for (let m = 0; m < a; ++m) { @@ -9523,244 +9612,244 @@ function a5(r15, t8) { for (let d = 0; d < s[m].length; ++d) p[m].push(i.indexOf(s[m][d])); } - let u = i.length, c = n.length, l = []; - for (let m = c; m < u; ++m) - l.push(m); - return { allDims: i, summedDims: l, idDims: p }; + let u = i.length, l = n.length, c = []; + for (let m = l; m < u; ++m) + c.push(m); + return { allDims: i, summedDims: c, idDims: p }; } -function i5(r15, t8) { - let e = new Array(r15); - e.fill(-1); - for (let n = 0; n < t8.length; ++n) - e[t8[n]] = n; +function F8(r16, e) { + let t10 = new Array(r16); + t10.fill(-1); + for (let n = 0; n < e.length; ++n) + t10[e[n]] = n; let o = []; - for (let n = 0; n < r15; ++n) - e[n] === -1 && o.push(n); - return e = e.filter((n) => n !== -1), { permutationIndices: e, expandDims: o }; + for (let n = 0; n < r16; ++n) + t10[n] === -1 && o.push(n); + return t10 = t10.filter((n) => n !== -1), { permutationIndices: t10, expandDims: o }; } -function u5(r15, t8, e) { - let o = new Array(r15); - for (let n = 0; n < e.length; ++n) { - let s = e[n].shape; - for (let a = 0; a < t8[n].length; ++a) - o[t8[n][a]] === void 0 ? o[t8[n][a]] = s[a] : $(o[t8[n][a]] === s[a], () => `Expected dimension ${o[t8[n][a]]} at axis ${a} of input shaped ${JSON.stringify(s)}, but got dimension ${s[a]}`); +function P8(r16, e, t10) { + let o = new Array(r16); + for (let n = 0; n < t10.length; ++n) { + let s = t10[n].shape; + for (let a = 0; a < e[n].length; ++a) + o[e[n][a]] === void 0 ? o[e[n][a]] = s[a] : $(o[e[n][a]] === s[a], () => `Expected dimension ${o[e[n][a]]} at axis ${a} of input shaped ${JSON.stringify(s)}, but got dimension ${s[a]}`); } } -function p5(r15, t8) { - let e = r15, o = [], n = 0; - r15.length === 0 && e.push(-1), n = r15.length + 1; +function O8(r16, e) { + let t10 = r16, o = [], n = 0; + r16.length === 0 && t10.push(-1), n = r16.length + 1; for (let a = 0; a < n; ++a) o.push([]); let s = []; - for (let a = 0; a < e.length; ++a) { - let i = e[a], p = l5(t8, i); + for (let a = 0; a < t10.length; ++a) { + let i = t10[a], p = L8(e, i); for (let u of p) s.indexOf(u) === -1 && (o[a].push(u), s.push(u)); } - return { path: e, steps: o }; + return { path: t10, steps: o }; } -function c5(r15) { - return r15.every((t8, e) => t8 === e); +function M8(r16) { + return r16.every((e, t10) => e === t10); } -function l5(r15, t8) { - let e = []; - for (let o = 0; o < r15.length; ++o) - (r15[o].length === 0 || r15[o].indexOf(t8) !== -1 || t8 === -1) && e.push(o); - return e; +function L8(r16, e) { + let t10 = []; + for (let o = 0; o < r16.length; ++o) + (r16[o].length === 0 || r16[o].indexOf(e) !== -1 || e === -1) && t10.push(o); + return t10; } -function m5(r15, t8, e = 0) { +function B8(r16, e, t10 = 0) { let o = []; - if (typeof t8 == "number") - $(r15.shape[e] % t8 === 0, () => "Number of splits must evenly divide the axis."), o = new Array(t8).fill(r15.shape[e] / t8); + if (typeof e == "number") + $(r16.shape[t10] % e === 0, () => "Number of splits must evenly divide the axis."), o = new Array(e).fill(r16.shape[t10] / e); else { - let n = t8.reduce((a, i) => (i === -1 && (a += 1), a), 0); + let n = e.reduce((a, i) => (i === -1 && (a += 1), a), 0); $(n <= 1, () => "There should be only one negative value in split array."); - let s = t8.indexOf(-1); + let s = e.indexOf(-1); if (s !== -1) { - let a = t8.reduce((i, p) => p > 0 ? i + p : i); - t8[s] = r15.shape[e] - a; + let a = e.reduce((i, p) => p > 0 ? i + p : i); + e[s] = r16.shape[t10] - a; } - $(r15.shape[e] === t8.reduce((a, i) => a + i), () => "The sum of sizes must match the size of the axis dimension."), o = t8; + $(r16.shape[t10] === e.reduce((a, i) => a + i), () => "The sum of sizes must match the size of the axis dimension."), o = e; } return o; } -function d5(r15) { +function z8(r16) { return `Received SparseTensor with denseShape[0] = 0 but - indices.shape[0] = ${r15}`; + indices.shape[0] = ${r16}`; } -function f5(r15, t8) { - return `indices(${r15}, 0) is invalid: ${t8} < 0`; +function V8(r16, e) { + return `indices(${r16}, 0) is invalid: ${e} < 0`; } -function h5(r15, t8, e) { - return `indices(${r15}, 0) is invalid: ${t8} >= ${e}`; +function W8(r16, e, t10) { + return `indices(${r16}, 0) is invalid: ${e} >= ${t10}`; } -function g5(r15, t8) { - return `only one output dimension may be -1, not both ${r15} and ${t8}`; +function U8(r16, e) { + return `only one output dimension may be -1, not both ${r16} and ${e}`; } -function x5(r15, t8) { - return `size ${r15} must be non-negative, not ${t8}`; +function G8(r16, e) { + return `size ${r16} must be non-negative, not ${e}`; } -function y5() { +function H8() { return "reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"; } -function b5(r15, t8) { - let e = He(r15), o = He(t8); - return `Input to reshape is a SparseTensor with ${e} - dense values, but the requested shape requires a multiple of ${o}. inputShape=${r15} outputShape= ${t8}`; +function K8(r16, e) { + let t10 = ze(r16), o = ze(e); + return `Input to reshape is a SparseTensor with ${t10} + dense values, but the requested shape requires a multiple of ${o}. inputShape=${r16} outputShape= ${e}`; } -function C5(r15, t8) { - let e = He(r15), o = He(t8); - return `Input to reshape is a tensor with ${e} dense values, but the requested shape has ${o}. inputShape=${r15} outputShape=${t8}`; +function q8(r16, e) { + let t10 = ze(r16), o = ze(e); + return `Input to reshape is a tensor with ${t10} dense values, but the requested shape has ${o}. inputShape=${r16} outputShape=${e}`; } -function w5() { +function j8() { return "segment ids must be >= 0"; } -function S5() { +function X8() { return "segment ids are not increasing"; } -function I5(r15, t8) { - return `Segment id ${r15} out of range [0, ${t8}), possibly because segmentIds input is not sorted.`; +function Y8(r16, e) { + return `Segment id ${r16} out of range [0, ${e}), possibly because segmentIds input is not sorted.`; } -function v5(r15, t8, e) { - return `Bad: indices[${r15}] == ${t8} out of range [0, ${e})`; +function Q8(r16, e, t10) { + return `Bad: indices[${r16}] == ${e} out of range [0, ${t10})`; } -var lS = {}; -qe(lS, { collectGatherOpShapeInfo: () => T5, computeOutShape: () => N5, segOpComputeOptimalWindowSize: () => k5 }); -function k5(r15, t8) { - let e = false, o; - for (r15 <= af ? (o = r15, e = true) : o = Vp(r15, Math.floor(Math.sqrt(r15))); !e; ) - o > t8 || o === r15 ? e = true : o = Vp(r15, o + 1); +var kS = {}; +qe(kS, { collectGatherOpShapeInfo: () => eY, computeOutShape: () => J8, segOpComputeOptimalWindowSize: () => Z8 }); +function Z8(r16, e) { + let t10 = false, o; + for (r16 <= yf ? (o = r16, t10 = true) : o = Xp(r16, Math.floor(Math.sqrt(r16))); !t10; ) + o > e || o === r16 ? t10 = true : o = Xp(r16, o + 1); return o; } -function N5(r15, t8, e) { - let o = [], n = r15.length; +function J8(r16, e, t10) { + let o = [], n = r16.length; for (let s = 0; s < n; s++) - s !== t8 ? o.push(r15[s]) : o.push(e); + s !== e ? o.push(r16[s]) : o.push(t10); return o; } -function T5(r15, t8, e, o) { - let n = t8.shape.length, s = r15.shape.length; +function eY(r16, e, t10, o) { + let n = e.shape.length, s = r16.shape.length; if (o !== 0 && (o < -n || o > n)) throw new Error(`Expect batchDims in the range of [-${n}, ${n}], but got ${o}`); if (o < 0 && (o += n), o > s) throw new Error(`batchDims (${o}) must be less than rank(x) ( ${s}).`); - if (e < o) - throw new Error(`batchDims (${o}) must be less than or equal to axis (${e}).`); - for (let l = 0; l < o; ++l) - if (r15.shape[l] !== t8.shape[l]) - throw new Error(`x.shape[${l}]: ${r15.shape[l]} should be equal to indices.shape[${l}]: ${t8.shape[l]}.`); - let a = r15.shape[e], i = [], p = 1, u = 1, c = 1; - for (let l = 0; l < o; ++l) - i.push(r15.shape[l]), p *= r15.shape[l]; - for (let l = o; l < e; l++) - i.push(r15.shape[l]), u *= r15.shape[l]; - for (let l = o; l < n; l++) - i.push(t8.shape[l]); - for (let l = e + 1; l < s; l++) - i.push(r15.shape[l]), c *= r15.shape[l]; - return { batchSize: p, sliceSize: c, outerSize: u, dimSize: a, outputShape: i }; -} -function _5(r15) { + if (t10 < o) + throw new Error(`batchDims (${o}) must be less than or equal to axis (${t10}).`); + for (let c = 0; c < o; ++c) + if (r16.shape[c] !== e.shape[c]) + throw new Error(`x.shape[${c}]: ${r16.shape[c]} should be equal to indices.shape[${c}]: ${e.shape[c]}.`); + let a = r16.shape[t10], i = [], p = 1, u = 1, l = 1; + for (let c = 0; c < o; ++c) + i.push(r16.shape[c]), p *= r16.shape[c]; + for (let c = o; c < t10; c++) + i.push(r16.shape[c]), u *= r16.shape[c]; + for (let c = o; c < n; c++) + i.push(e.shape[c]); + for (let c = t10 + 1; c < s; c++) + i.push(r16.shape[c]), l *= r16.shape[c]; + return { batchSize: p, sliceSize: l, outerSize: u, dimSize: a, outputShape: i }; +} +function tY(r16) { try { - return r15.map((t8) => Qp(t8)); - } catch (t8) { - throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t8}`); + return r16.map((e) => sl(e)); + } catch (e) { + throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`); } } -function $5(r15) { - return r15.map((t8) => Zi(t8)); +function rY(r16) { + return r16.map((e) => iu(e)); } -var Vt = {}; -qe(Vt, { nonMaxSuppressionV3Impl: () => Zd, nonMaxSuppressionV4Impl: () => Jd, nonMaxSuppressionV5Impl: () => ef, whereImpl: () => jd }); -GN(); -var E5 = A(); -E5.registerFlag("KEEP_INTERMEDIATE_TENSORS", () => false, (r15) => { - r15 && console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance."); +var Ut = {}; +qe(Ut, { nonMaxSuppressionV3Impl: () => lf, nonMaxSuppressionV4Impl: () => cf, nonMaxSuppressionV5Impl: () => mf, whereImpl: () => sf }); +FT(); +var oY = A(); +oY.registerFlag("KEEP_INTERMEDIATE_TENSORS", () => false, (r16) => { + r16 && console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance."); }); -var fo; -(function(r15) { - r15[r15.DT_INVALID = 0] = "DT_INVALID", r15[r15.DT_FLOAT = 1] = "DT_FLOAT", r15[r15.DT_DOUBLE = 2] = "DT_DOUBLE", r15[r15.DT_INT32 = 3] = "DT_INT32", r15[r15.DT_UINT8 = 4] = "DT_UINT8", r15[r15.DT_INT16 = 5] = "DT_INT16", r15[r15.DT_INT8 = 6] = "DT_INT8", r15[r15.DT_STRING = 7] = "DT_STRING", r15[r15.DT_COMPLEX64 = 8] = "DT_COMPLEX64", r15[r15.DT_INT64 = 9] = "DT_INT64", r15[r15.DT_BOOL = 10] = "DT_BOOL", r15[r15.DT_QINT8 = 11] = "DT_QINT8", r15[r15.DT_QUINT8 = 12] = "DT_QUINT8", r15[r15.DT_QINT32 = 13] = "DT_QINT32", r15[r15.DT_BFLOAT16 = 14] = "DT_BFLOAT16", r15[r15.DT_QINT16 = 15] = "DT_QINT16", r15[r15.DT_QUINT16 = 16] = "DT_QUINT16", r15[r15.DT_UINT16 = 17] = "DT_UINT16", r15[r15.DT_COMPLEX128 = 18] = "DT_COMPLEX128", r15[r15.DT_HALF = 19] = "DT_HALF", r15[r15.DT_RESOURCE = 20] = "DT_RESOURCE", r15[r15.DT_VARIANT = 21] = "DT_VARIANT", r15[r15.DT_UINT32 = 22] = "DT_UINT32", r15[r15.DT_UINT64 = 23] = "DT_UINT64", r15[r15.DT_FLOAT_REF = 101] = "DT_FLOAT_REF", r15[r15.DT_DOUBLE_REF = 102] = "DT_DOUBLE_REF", r15[r15.DT_INT32_REF = 103] = "DT_INT32_REF", r15[r15.DT_UINT8_REF = 104] = "DT_UINT8_REF", r15[r15.DT_INT16_REF = 105] = "DT_INT16_REF", r15[r15.DT_INT8_REF = 106] = "DT_INT8_REF", r15[r15.DT_STRING_REF = 107] = "DT_STRING_REF", r15[r15.DT_COMPLEX64_REF = 108] = "DT_COMPLEX64_REF", r15[r15.DT_INT64_REF = 109] = "DT_INT64_REF", r15[r15.DT_BOOL_REF = 110] = "DT_BOOL_REF", r15[r15.DT_QINT8_REF = 111] = "DT_QINT8_REF", r15[r15.DT_QUINT8_REF = 112] = "DT_QUINT8_REF", r15[r15.DT_QINT32_REF = 113] = "DT_QINT32_REF", r15[r15.DT_BFLOAT16_REF = 114] = "DT_BFLOAT16_REF", r15[r15.DT_QINT16_REF = 115] = "DT_QINT16_REF", r15[r15.DT_QUINT16_REF = 116] = "DT_QUINT16_REF", r15[r15.DT_UINT16_REF = 117] = "DT_UINT16_REF", r15[r15.DT_COMPLEX128_REF = 118] = "DT_COMPLEX128_REF", r15[r15.DT_HALF_REF = 119] = "DT_HALF_REF", r15[r15.DT_RESOURCE_REF = 120] = "DT_RESOURCE_REF", r15[r15.DT_VARIANT_REF = 121] = "DT_VARIANT_REF", r15[r15.DT_UINT32_REF = 122] = "DT_UINT32_REF", r15[r15.DT_UINT64_REF = 123] = "DT_UINT64_REF"; -})(fo || (fo = {})); -var xT; -(function(r15) { - let t8; - (function(e) { - e[e.LEGACY = 0] = "LEGACY", e[e.V1 = 1] = "V1", e[e.V2 = 2] = "V2"; - })(t8 = r15.CheckpointFormatVersion || (r15.CheckpointFormatVersion = {})); -})(xT || (xT = {})); -var dS = {}; -function D5(r15, t8) { - let e = { tfOpName: r15, category: "custom", inputs: [], attrs: [], customExecutor: t8 }; - dS[r15] = e; -} -function uf(r15) { - return dS[r15]; -} -function A5(r15) { - delete dS[r15]; -} -function I(r15, t8, e, o, n) { - let s = t8.inputParams[r15]; +var Or; +(function(r16) { + r16[r16.DT_INVALID = 0] = "DT_INVALID", r16[r16.DT_FLOAT = 1] = "DT_FLOAT", r16[r16.DT_DOUBLE = 2] = "DT_DOUBLE", r16[r16.DT_INT32 = 3] = "DT_INT32", r16[r16.DT_UINT8 = 4] = "DT_UINT8", r16[r16.DT_INT16 = 5] = "DT_INT16", r16[r16.DT_INT8 = 6] = "DT_INT8", r16[r16.DT_STRING = 7] = "DT_STRING", r16[r16.DT_COMPLEX64 = 8] = "DT_COMPLEX64", r16[r16.DT_INT64 = 9] = "DT_INT64", r16[r16.DT_BOOL = 10] = "DT_BOOL", r16[r16.DT_QINT8 = 11] = "DT_QINT8", r16[r16.DT_QUINT8 = 12] = "DT_QUINT8", r16[r16.DT_QINT32 = 13] = "DT_QINT32", r16[r16.DT_BFLOAT16 = 14] = "DT_BFLOAT16", r16[r16.DT_QINT16 = 15] = "DT_QINT16", r16[r16.DT_QUINT16 = 16] = "DT_QUINT16", r16[r16.DT_UINT16 = 17] = "DT_UINT16", r16[r16.DT_COMPLEX128 = 18] = "DT_COMPLEX128", r16[r16.DT_HALF = 19] = "DT_HALF", r16[r16.DT_RESOURCE = 20] = "DT_RESOURCE", r16[r16.DT_VARIANT = 21] = "DT_VARIANT", r16[r16.DT_UINT32 = 22] = "DT_UINT32", r16[r16.DT_UINT64 = 23] = "DT_UINT64", r16[r16.DT_FLOAT_REF = 101] = "DT_FLOAT_REF", r16[r16.DT_DOUBLE_REF = 102] = "DT_DOUBLE_REF", r16[r16.DT_INT32_REF = 103] = "DT_INT32_REF", r16[r16.DT_UINT8_REF = 104] = "DT_UINT8_REF", r16[r16.DT_INT16_REF = 105] = "DT_INT16_REF", r16[r16.DT_INT8_REF = 106] = "DT_INT8_REF", r16[r16.DT_STRING_REF = 107] = "DT_STRING_REF", r16[r16.DT_COMPLEX64_REF = 108] = "DT_COMPLEX64_REF", r16[r16.DT_INT64_REF = 109] = "DT_INT64_REF", r16[r16.DT_BOOL_REF = 110] = "DT_BOOL_REF", r16[r16.DT_QINT8_REF = 111] = "DT_QINT8_REF", r16[r16.DT_QUINT8_REF = 112] = "DT_QUINT8_REF", r16[r16.DT_QINT32_REF = 113] = "DT_QINT32_REF", r16[r16.DT_BFLOAT16_REF = 114] = "DT_BFLOAT16_REF", r16[r16.DT_QINT16_REF = 115] = "DT_QINT16_REF", r16[r16.DT_QUINT16_REF = 116] = "DT_QUINT16_REF", r16[r16.DT_UINT16_REF = 117] = "DT_UINT16_REF", r16[r16.DT_COMPLEX128_REF = 118] = "DT_COMPLEX128_REF", r16[r16.DT_HALF_REF = 119] = "DT_HALF_REF", r16[r16.DT_RESOURCE_REF = 120] = "DT_RESOURCE_REF", r16[r16.DT_VARIANT_REF = 121] = "DT_VARIANT_REF", r16[r16.DT_UINT32_REF = 122] = "DT_UINT32_REF", r16[r16.DT_UINT64_REF = 123] = "DT_UINT64_REF"; +})(Or || (Or = {})); +var u_; +(function(r16) { + let e; + (function(t10) { + t10[t10.LEGACY = 0] = "LEGACY", t10[t10.V1 = 1] = "V1", t10[t10.V2 = 2] = "V2"; + })(e = r16.CheckpointFormatVersion || (r16.CheckpointFormatVersion = {})); +})(u_ || (u_ = {})); +var TS = {}; +function sY(r16, e) { + let t10 = { tfOpName: r16, category: "custom", inputs: [], attrs: [], customExecutor: e }; + TS[r16] = t10; +} +function bf(r16) { + return TS[r16]; +} +function aY(r16) { + delete TS[r16]; +} +function I(r16, e, t10, o, n) { + let s = e.inputParams[r16]; if (s && s.inputIndexStart !== void 0) { - let i = s.inputIndexStart, p = s.inputIndexEnd === 0 ? void 0 : s.inputIndexEnd === void 0 ? i + 1 : s.inputIndexEnd, u = i < 0 ? t8.inputNames.length + i : i; + let i = s.inputIndexStart, p = s.inputIndexEnd === 0 ? void 0 : s.inputIndexEnd === void 0 ? i + 1 : s.inputIndexEnd, u = i < 0 ? e.inputNames.length + i : i; if (s.type === "tensor") - return Bt(t8.inputNames[u], e, o, n); + return Vt(e.inputNames[u], t10, o, n); if (s.type === "tensors") { - let m = t8.inputs.slice(i, p); - return t8.inputNames.slice(i, p).filter((f, h) => { + let m = e.inputs.slice(i, p); + return e.inputNames.slice(i, p).filter((f, h) => { var g; return ((g = m[h]) === null || g === void 0 ? void 0 : g.op) !== "NoOp"; - }).map((f) => Bt(f, e, o, n)); + }).map((f) => Vt(f, t10, o, n)); } - let c = Bt(t8.inputNames[u], e, o, n), l = c.dataSync(); - return s.type === "number" ? l[0] : y.toNestedArray(c.shape, l); + let l = Vt(e.inputNames[u], t10, o, n), c = l.dataSync(); + return s.type === "number" ? c[0] : y.toNestedArray(l.shape, c); } - let a = t8.attrParams[r15]; + let a = e.attrParams[r16]; return a && a.value; } -function Bt(r15, t8, e, o) { - let [n, s] = Nr(r15, e); +function Vt(r16, e, t10, o) { + let [n, s] = Er(r16, t10); if (o != null) { let i = o.getHashTableHandleByName(n); if (i != null) return i; } - let a = e.currentContextIds.find((i) => !!t8[pf(n, i)]); - return a !== void 0 ? t8[pf(n, a)][s] : void 0; + let a = t10.currentContextIds.find((i) => !!e[Cf(n, i)]); + return a !== void 0 ? e[Cf(n, a)][s] : void 0; } -function fS(r15, t8, e) { - return t8[pf(r15, e.currentContextId)]; +function _S(r16, e, t10) { + return e[Cf(r16, t10.currentContextId)]; } -function Ls(r15, t8) { - let [e, o, n] = Nr(r15, t8); - return [pf(e, t8 && t8.currentContextId), o, n]; +function qs(r16, e) { + let [t10, o, n] = Er(r16, e); + return [Cf(t10, e && e.currentContextId), o, n]; } -function pf(r15, t8) { - return t8 ? `${r15}-${t8}` : r15; +function Cf(r16, e) { + return e ? `${r16}-${e}` : r16; } -function Nr(r15, t8) { - if (r15 === "") +function Er(r16, e) { + if (r16 === "") return ["", 0, void 0]; - let e = t8 != null && t8.parseNodeNameCache != null; - if (e) { - let s = t8.parseNodeNameCache.get(r15); + let t10 = e != null && e.parseNodeNameCache != null; + if (t10) { + let s = e.parseNodeNameCache.get(r16); if (s != null) return s; } - let o = r15.split(":"), n; + let o = r16.split(":"), n; if (o.length === 1) - n = [r15, 0, void 0]; + n = [r16, 0, void 0]; else { let s = o[0], a = o.length === 3 ? o[1] : void 0, i = Number(o[o.length - 1]); n = [s, i, a]; } - return e && t8.parseNodeNameCache.set(r15, n), n; + return t10 && e.parseNodeNameCache.set(r16, n), n; } -function Al(r15, t8, e) { - let o = I("pad", r15, t8, e); +function Wc(r16, e, t10) { + let o = I("pad", r16, e, t10); if (o === "explicit") { - o = I("explicitPaddings", r15, t8, e); + o = I("explicitPaddings", r16, e, t10); let n = [[0, 0], [0, 0], [0, 0], [0, 0]]; for (let s = 0; s < 4; s++) n[s][0] = o[s * 2], n[s][1] = o[s * 2 + 1]; @@ -9768,481 +9857,484 @@ function Al(r15, t8, e) { } return o; } -function Bs(r15) { - return r15.kept ? r15 : Wr(r15); -} -var hS = {}; -qe(hS, { json: () => F5 }); -var F5 = [{ 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: true }] }, { 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: true }] }, { 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: true }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }]; -var gS = {}; -qe(gS, { json: () => P5 }); -var P5 = [{ tfOpName: "Abs", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Acos", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Asin", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Atan", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { tfOpName: "Ceil", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { tfOpName: "ComplexAbs", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Cos", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Cosh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Elu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Exp", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Floor", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Log", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Imag", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }, { tfName: "Tout", name: "outputType", type: "dtype", notSupported: true }] }, { tfOpName: "Neg", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Real", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }, { tfName: "Tout", name: "outputType", type: "dtype", notSupported: true }] }, { 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: true }] }, { tfOpName: "Relu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Relu6", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Selu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sigmoid", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sin", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sinh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sqrt", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Rsqrt", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Square", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Tan", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Tanh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sign", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Round", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Expm1", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Log1p", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Reciprocal", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Softplus", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Asinh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Acosh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Atanh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Erf", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "LeakyRelu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "alpha", name: "alpha", type: "number", defaultValue: 0.2 }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "IsNan", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "IsFinite", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "IsInf", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }]; -var xS = {}; -qe(xS, { json: () => O5 }); -var O5 = [{ 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: true }, { 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: true }] }, { tfOpName: "NextIteration", category: "control", inputs: [{ start: 0, name: "tensor", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: "TensorListConcatV2", 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" }] }, { tfOpName: "TensorListLength", category: "control", inputs: [{ start: 0, name: "tensorListId", type: "tensor" }] }, { tfOpName: "TensorListResize", category: "control", inputs: [{ start: 0, name: "tensorListId", type: "tensor" }, { start: 1, name: "size", type: "number" }] }]; -var yS = {}; -qe(yS, { json: () => M5 }); -var M5 = [{ 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "explicit_paddings", name: "explicitPaddings", type: "number[]", defaultValue: [], notSupported: true }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }, { 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: true }, { 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: true }, { 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: true }, { 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", defaultValue: 0.2 }] }, { 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: true }, { tfName: "explicit_paddings", name: "explicitPaddings", type: "number[]", defaultValue: [] }, { tfName: "dilations", name: "dilations", type: "number[]", notSupported: true }] }, { 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: true }, { 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" }] }]; -var bS = {}; -qe(bS, { json: () => L5 }); -var L5 = [{ 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: true }] }, { 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: true }, { tfName: "T", name: "dtype", type: "dtype" }] }, { 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: "RandomStandardNormal", category: "creation", inputs: [{ start: 0, name: "shape", type: "number[]" }], attrs: [{ tfName: "seed", name: "seed", type: "number", defaultValue: 0 }, { tfName: "seed2", name: "seed2", type: "number", defaultValue: 0, notSupported: true }, { tfName: "dtype", name: "dtype", type: "dtype" }, { tfName: "T", name: "T", type: "number", notSupported: true }] }, { 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: true }, { tfName: "T", name: "T", type: "number", notSupported: true }] }, { tfOpName: "RandomUniformInt", category: "creation", inputs: [{ start: 0, name: "shape", type: "number[]" }], attrs: [{ tfName: "minval", name: "minval", type: "number" }, { tfName: "maxval", name: "maxval", type: "number" }, { tfName: "seed", name: "seed", type: "number", defaultValue: 0 }, { tfName: "seed2", name: "seed2", type: "number", defaultValue: 0, notSupported: true }] }, { 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: true }, { tfName: "dtype", name: "dtype", type: "dtype" }, { tfName: "T", name: "T", type: "number", notSupported: true }] }, { 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" }] }]; -var CS = {}; -qe(CS, { json: () => B5 }); -var B5 = [{ 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: true }, { tfName: "T_threshold", name: "threshold", type: "dtype", notSupported: true }, { 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: true }] }, { 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: true }] }]; -var wS = {}; -qe(wS, { json: () => z5 }); -var z5 = [{ tfOpName: "LowerBound", category: "evaluation", inputs: [{ start: 0, name: "sortedSequence", type: "tensor" }, { start: 1, name: "values", type: "tensor" }] }, { 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: "UpperBound", category: "evaluation", inputs: [{ start: 0, name: "sortedSequence", type: "tensor" }, { start: 1, name: "values", type: "tensor" }] }, { 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" }] }]; -var SS = {}; -qe(SS, { json: () => V5 }); -var V5 = [{ 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: true }, { 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" }] }]; -var IS = {}; -qe(IS, { json: () => W5 }); -var W5 = [{ 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { tfOpName: "LookupTableSize", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }] }, { tfOpName: "LookupTableSizeV2", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }] }, { tfOpName: "InitializeTable", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }, { start: 1, name: "keys", type: "tensor" }, { start: 2, name: "values", type: "tensor" }] }, { tfOpName: "InitializeTableV2", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }, { start: 1, name: "keys", type: "tensor" }, { start: 2, name: "values", type: "tensor" }] }]; -var vS = {}; -qe(vS, { json: () => U5 }); -var U5 = [{ 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: true }] }, { 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: true }] }, { 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" }] }, { tfOpName: "ImageProjectiveTransformV3", category: "image", inputs: [{ start: 0, name: "images", type: "tensor" }, { start: 1, name: "transforms", type: "tensor" }, { start: 2, name: "outputShape", type: "number[]" }, { start: 3, name: "fillValue", type: "number" }], attrs: [{ tfName: "interpolation", name: "interpolation", type: "string" }, { tfName: "fill_mode", name: "fillMode", type: "string" }] }]; -var kS = {}; -qe(kS, { json: () => G5 }); -var G5 = [{ 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { tfOpName: "LogicalNot", category: "logical", inputs: [{ start: 0, name: "a", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { tfOpName: "BitwiseAnd", category: "logical", inputs: [{ start: 0, name: "x", type: "tensor" }, { start: 1, name: "y", type: "tensor" }] }]; -var NS = {}; -qe(NS, { json: () => H5 }); -var H5 = [{ 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: false }, { tfName: "transpose_b", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "leakyrelu_alpha", name: "leakyreluAlpha", type: "number", defaultValue: 0.2 }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: false }, { tfName: "transpose_b", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: false }, { tfName: "adj_y", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: false }, { tfName: "adj_y", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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" }] }, { tfOpName: "MatrixBandPart", category: "matrices", inputs: [{ start: 0, name: "a", type: "tensor" }, { start: 1, name: "numLower", type: "tensor" }, { start: 1, name: "numUpper", type: "tensor" }] }]; -var TS = {}; -qe(TS, { json: () => K5 }); -var K5 = [{ tfOpName: "EuclideanNorm", category: "normalization", inputs: [{ start: 0, name: "x", type: "tensor" }, { start: 1, name: "axis", type: "number[]" }], attrs: [{ tfName: "keep_dims", name: "keepDims", type: "bool", defaultValue: false }] }, { 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: 1e-3 }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: 1e-3 }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: 1e-3 }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: 0.5 }] }, { tfOpName: "Softmax", category: "normalization", inputs: [{ start: 0, name: "x", type: "tensor" }] }, { tfOpName: "LogSoftmax", category: "normalization", inputs: [{ start: 0, name: "x", type: "tensor" }] }]; -var _S = {}; -qe(_S, { json: () => q5 }); -var q5 = [{ 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" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Cumprod", 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" }] }, { 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" }] }]; -var $S = {}; -qe($S, { json: () => j5 }); -var j5 = [{ 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: true }] }, { 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: true }] }, { 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: false, notSupported: true }] }, { tfOpName: "TensorScatterUpdate", category: "slice_join", inputs: [{ start: 0, name: "tensor", type: "tensor" }, { start: 1, name: "indices", type: "tensor" }, { start: 2, name: "values", type: "tensor" }] }]; +function js(r16) { + return r16.kept ? r16 : Xr(r16); +} var ES = {}; -qe(ES, { json: () => X5 }); -var X5 = [{ tfOpName: "SparseFillEmptyRows", category: "sparse", inputs: [{ start: 0, name: "indices", type: "tensor" }, { start: 1, name: "values", type: "tensor" }, { start: 2, name: "denseShape", type: "tensor" }, { start: 3, name: "defaultValue", type: "tensor" }] }, { tfOpName: "SparseReshape", category: "sparse", inputs: [{ start: 0, name: "inputIndices", type: "tensor" }, { start: 1, name: "inputShape", type: "tensor" }, { start: 2, name: "newShape", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "SparseSegmentMean", category: "sparse", inputs: [{ start: 0, name: "data", type: "tensor" }, { start: 1, name: "indices", type: "tensor" }, { start: 2, name: "segmentIds", type: "tensor" }] }, { tfOpName: "SparseSegmentSum", category: "sparse", inputs: [{ start: 0, name: "data", type: "tensor" }, { start: 1, name: "indices", type: "tensor" }, { start: 2, name: "segmentIds", type: "tensor" }] }]; +qe(ES, { json: () => iY }); +var iY = [{ 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: true }] }, { 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: true }] }, { 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: true }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }]; +var $S = {}; +qe($S, { json: () => uY }); +var uY = [{ tfOpName: "Abs", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Acos", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Asin", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Atan", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { tfOpName: "Ceil", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { tfOpName: "ComplexAbs", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Cos", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Cosh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Elu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Exp", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Floor", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Log", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Imag", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }, { tfName: "Tout", name: "outputType", type: "dtype", notSupported: true }] }, { tfOpName: "Neg", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Real", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }, { tfName: "Tout", name: "outputType", type: "dtype", notSupported: true }] }, { 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: true }] }, { tfOpName: "Relu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Relu6", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Selu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sigmoid", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sin", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sinh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sqrt", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Rsqrt", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Square", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Tan", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Tanh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Sign", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Round", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Expm1", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Log1p", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Reciprocal", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Softplus", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Asinh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Acosh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Atanh", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Erf", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "LeakyRelu", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "alpha", name: "alpha", type: "number", defaultValue: 0.2 }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "IsNan", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "IsFinite", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "IsInf", category: "basic_math", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }]; var RS = {}; -qe(RS, { json: () => Y5 }); -var Y5 = [{ 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: true }] }, { tfOpName: "IRFFT", category: "spectral", inputs: [{ start: 0, name: "x", type: "tensor" }, { start: 1, name: "fft_length", type: "number", notSupported: true }] }]; +qe(RS, { json: () => pY }); +var pY = [{ 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: true }, { 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: true }] }, { tfOpName: "NextIteration", category: "control", inputs: [{ start: 0, name: "tensor", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: "TensorListConcatV2", 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" }] }, { tfOpName: "TensorListLength", category: "control", inputs: [{ start: 0, name: "tensorListId", type: "tensor" }] }, { tfOpName: "TensorListResize", category: "control", inputs: [{ start: 0, name: "tensorListId", type: "tensor" }, { start: 1, name: "size", type: "number" }] }]; var DS = {}; -qe(DS, { json: () => Q5 }); -var Q5 = [{ tfOpName: "StaticRegexReplace", category: "string", inputs: [{ start: 0, name: "input", type: "tensor" }], attrs: [{ tfName: "pattern", name: "pattern", type: "string" }, { tfName: "rewrite", name: "rewrite", type: "string" }, { tfName: "replace_global", name: "replaceGlobal", type: "bool" }] }, { tfOpName: "StringNGrams", category: "string", inputs: [{ start: 0, name: "data", type: "tensor" }, { start: 1, name: "dataSplits", type: "tensor" }], attrs: [{ tfName: "separator", name: "separator", type: "string" }, { tfName: "ngram_widths", name: "nGramWidths", type: "number[]" }, { tfName: "left_pad", name: "leftPad", type: "string" }, { tfName: "right_pad", name: "rightPad", type: "string" }, { tfName: "pad_width", name: "padWidth", type: "number" }, { tfName: "preserve_short_sequences", name: "preserveShortSequences", type: "bool" }], outputs: ["ngrams", "ngrams_splits"] }, { tfOpName: "StringSplit", category: "string", inputs: [{ start: 0, name: "input", type: "tensor" }, { start: 1, name: "delimiter", type: "tensor" }], attrs: [{ tfName: "skip_empty", name: "skipEmpty", type: "bool" }], outputs: ["indices", "values", "shape"] }, { tfOpName: "StringToHashBucketFast", category: "string", inputs: [{ start: 0, name: "input", type: "tensor" }], attrs: [{ tfName: "num_buckets", name: "numBuckets", type: "number" }] }]; +qe(DS, { json: () => lY }); +var lY = [{ 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "explicit_paddings", name: "explicitPaddings", type: "number[]", defaultValue: [], notSupported: true }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "ksize", name: "kernelSize", type: "number[]" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }, { 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: true }, { 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: true }, { 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: true }, { 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", defaultValue: 0.2 }] }, { 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: true }, { tfName: "explicit_paddings", name: "explicitPaddings", type: "number[]", defaultValue: [] }, { tfName: "dilations", name: "dilations", type: "number[]", notSupported: true }] }, { 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: true }, { 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" }] }]; var AS = {}; -qe(AS, { json: () => Z5 }); -var Z5 = [{ tfOpName: "Cast", category: "transformation", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "SrcT", name: "sdtype", type: "dtype", notSupported: true }, { 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: "EnsureShape", 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: [] }, { tfOpName: "BroadcastArgs", category: "transformation", inputs: [{ start: 0, name: "s0", type: "tensor" }, { start: 1, name: "s1", type: "tensor" }], attrs: [] }]; -var Fl = class { +qe(AS, { json: () => cY }); +var cY = [{ 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: true }] }, { 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: true }, { tfName: "T", name: "dtype", type: "dtype" }] }, { 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: "RandomStandardNormal", category: "creation", inputs: [{ start: 0, name: "shape", type: "number[]" }], attrs: [{ tfName: "seed", name: "seed", type: "number", defaultValue: 0 }, { tfName: "seed2", name: "seed2", type: "number", defaultValue: 0, notSupported: true }, { tfName: "dtype", name: "dtype", type: "dtype" }, { tfName: "T", name: "T", type: "number", notSupported: true }] }, { 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: true }, { tfName: "T", name: "T", type: "number", notSupported: true }] }, { tfOpName: "RandomUniformInt", category: "creation", inputs: [{ start: 0, name: "shape", type: "number[]" }], attrs: [{ tfName: "minval", name: "minval", type: "number" }, { tfName: "maxval", name: "maxval", type: "number" }, { tfName: "seed", name: "seed", type: "number", defaultValue: 0 }, { tfName: "seed2", name: "seed2", type: "number", defaultValue: 0, notSupported: true }] }, { 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: true }, { tfName: "dtype", name: "dtype", type: "dtype" }, { tfName: "T", name: "T", type: "number", notSupported: true }] }, { 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" }] }]; +var FS = {}; +qe(FS, { json: () => mY }); +var mY = [{ 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: true }, { tfName: "T_threshold", name: "threshold", type: "dtype", notSupported: true }, { 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: true }] }, { 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: true }] }]; +var PS = {}; +qe(PS, { json: () => dY }); +var dY = [{ tfOpName: "LowerBound", category: "evaluation", inputs: [{ start: 0, name: "sortedSequence", type: "tensor" }, { start: 1, name: "values", type: "tensor" }] }, { 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: "UpperBound", category: "evaluation", inputs: [{ start: 0, name: "sortedSequence", type: "tensor" }, { start: 1, name: "values", type: "tensor" }] }, { 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" }] }]; +var OS = {}; +qe(OS, { json: () => fY }); +var fY = [{ 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: true }, { 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" }] }]; +var MS = {}; +qe(MS, { json: () => hY }); +var hY = [{ 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { 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: true }, { tfName: "Tout", name: "tOut", type: "dtype", notSupported: true }] }, { tfOpName: "LookupTableSize", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }] }, { tfOpName: "LookupTableSizeV2", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }] }, { tfOpName: "InitializeTable", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }, { start: 1, name: "keys", type: "tensor" }, { start: 2, name: "values", type: "tensor" }] }, { tfOpName: "InitializeTableV2", category: "hash_table", inputs: [{ start: 0, name: "tableHandle", type: "tensor" }, { start: 1, name: "keys", type: "tensor" }, { start: 2, name: "values", type: "tensor" }] }]; +var LS = {}; +qe(LS, { json: () => gY }); +var gY = [{ 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: true }] }, { 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: true }] }, { 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" }] }, { tfOpName: "ImageProjectiveTransformV3", category: "image", inputs: [{ start: 0, name: "images", type: "tensor" }, { start: 1, name: "transforms", type: "tensor" }, { start: 2, name: "outputShape", type: "number[]" }, { start: 3, name: "fillValue", type: "number" }], attrs: [{ tfName: "interpolation", name: "interpolation", type: "string" }, { tfName: "fill_mode", name: "fillMode", type: "string" }] }]; +var BS = {}; +qe(BS, { json: () => xY }); +var xY = [{ 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { tfOpName: "LogicalNot", category: "logical", inputs: [{ start: 0, name: "a", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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: true }] }, { 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: true }] }, { tfOpName: "BitwiseAnd", category: "logical", inputs: [{ start: 0, name: "x", type: "tensor" }, { start: 1, name: "y", type: "tensor" }] }]; +var zS = {}; +qe(zS, { json: () => yY }); +var yY = [{ 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: false }, { tfName: "transpose_b", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "leakyrelu_alpha", name: "leakyreluAlpha", type: "number", defaultValue: 0.2 }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: false }, { tfName: "transpose_b", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: false }, { tfName: "adj_y", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: false }, { tfName: "adj_y", name: "transposeB", type: "bool", defaultValue: false }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { 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: true }] }, { 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" }] }, { tfOpName: "MatrixBandPart", category: "matrices", inputs: [{ start: 0, name: "a", type: "tensor" }, { start: 1, name: "numLower", type: "tensor" }, { start: 1, name: "numUpper", type: "tensor" }] }]; +var VS = {}; +qe(VS, { json: () => bY }); +var bY = [{ tfOpName: "EuclideanNorm", category: "normalization", inputs: [{ start: 0, name: "x", type: "tensor" }, { start: 1, name: "axis", type: "number[]" }], attrs: [{ tfName: "keep_dims", name: "keepDims", type: "bool", defaultValue: false }] }, { 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: 1e-3 }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: 1e-3 }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: 1e-3 }, { tfName: "data_format", name: "dataFormat", type: "string", notSupported: true }] }, { 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: 0.5 }] }, { tfOpName: "Softmax", category: "normalization", inputs: [{ start: 0, name: "x", type: "tensor" }] }, { tfOpName: "LogSoftmax", category: "normalization", inputs: [{ start: 0, name: "x", type: "tensor" }] }]; +var WS = {}; +qe(WS, { json: () => CY }); +var CY = [{ 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" }, { tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "Cumprod", 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" }] }, { 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" }] }]; +var US = {}; +qe(US, { json: () => wY }); +var wY = [{ 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: true }] }, { 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: true }] }, { 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: false, notSupported: true }] }, { tfOpName: "TensorScatterUpdate", category: "slice_join", inputs: [{ start: 0, name: "tensor", type: "tensor" }, { start: 1, name: "indices", type: "tensor" }, { start: 2, name: "values", type: "tensor" }] }]; +var GS = {}; +qe(GS, { json: () => SY }); +var SY = [{ tfOpName: "SparseFillEmptyRows", category: "sparse", inputs: [{ start: 0, name: "indices", type: "tensor" }, { start: 1, name: "values", type: "tensor" }, { start: 2, name: "denseShape", type: "tensor" }, { start: 3, name: "defaultValue", type: "tensor" }] }, { tfOpName: "SparseReshape", category: "sparse", inputs: [{ start: 0, name: "inputIndices", type: "tensor" }, { start: 1, name: "inputShape", type: "tensor" }, { start: 2, name: "newShape", type: "tensor" }], attrs: [{ tfName: "T", name: "dtype", type: "dtype", notSupported: true }] }, { tfOpName: "SparseSegmentMean", category: "sparse", inputs: [{ start: 0, name: "data", type: "tensor" }, { start: 1, name: "indices", type: "tensor" }, { start: 2, name: "segmentIds", type: "tensor" }] }, { tfOpName: "SparseSegmentSum", category: "sparse", inputs: [{ start: 0, name: "data", type: "tensor" }, { start: 1, name: "indices", type: "tensor" }, { start: 2, name: "segmentIds", type: "tensor" }] }]; +var HS = {}; +qe(HS, { json: () => IY }); +var IY = [{ 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: true }] }, { tfOpName: "IRFFT", category: "spectral", inputs: [{ start: 0, name: "x", type: "tensor" }, { start: 1, name: "fft_length", type: "number", notSupported: true }] }]; +var KS = {}; +qe(KS, { json: () => vY }); +var vY = [{ tfOpName: "StaticRegexReplace", category: "string", inputs: [{ start: 0, name: "input", type: "tensor" }], attrs: [{ tfName: "pattern", name: "pattern", type: "string" }, { tfName: "rewrite", name: "rewrite", type: "string" }, { tfName: "replace_global", name: "replaceGlobal", type: "bool" }] }, { tfOpName: "StringNGrams", category: "string", inputs: [{ start: 0, name: "data", type: "tensor" }, { start: 1, name: "dataSplits", type: "tensor" }], attrs: [{ tfName: "separator", name: "separator", type: "string" }, { tfName: "ngram_widths", name: "nGramWidths", type: "number[]" }, { tfName: "left_pad", name: "leftPad", type: "string" }, { tfName: "right_pad", name: "rightPad", type: "string" }, { tfName: "pad_width", name: "padWidth", type: "number" }, { tfName: "preserve_short_sequences", name: "preserveShortSequences", type: "bool" }], outputs: ["ngrams", "ngrams_splits"] }, { tfOpName: "StringSplit", category: "string", inputs: [{ start: 0, name: "input", type: "tensor" }, { start: 1, name: "delimiter", type: "tensor" }], attrs: [{ tfName: "skip_empty", name: "skipEmpty", type: "bool" }], outputs: ["indices", "values", "shape"] }, { tfOpName: "StringToHashBucketFast", category: "string", inputs: [{ start: 0, name: "input", type: "tensor" }], attrs: [{ tfName: "num_buckets", name: "numBuckets", type: "number" }] }]; +var qS = {}; +qe(qS, { json: () => kY }); +var kY = [{ tfOpName: "Cast", category: "transformation", inputs: [{ start: 0, name: "x", type: "tensor" }], attrs: [{ tfName: "SrcT", name: "sdtype", type: "dtype", notSupported: true }, { 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: "EnsureShape", 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: [] }, { tfOpName: "BroadcastArgs", category: "transformation", inputs: [{ start: 0, name: "s0", type: "tensor" }, { start: 1, name: "s1", type: "tensor" }], attrs: [] }]; +var Uc = class { static get Instance() { return this._instance || (this._instance = new this()); } constructor() { - let t8 = [hS, gS, xS, yS, bS, CS, wS, SS, IS, vS, kS, NS, TS, _S, $S, ES, RS, DS, AS], e = [].concat(...t8.map((o) => o.json)); - this.opMappers = e.reduce((o, n) => (o[n.tfOpName] = n, o), {}); + let e = [ES, $S, RS, DS, AS, FS, PS, OS, MS, LS, BS, zS, VS, WS, US, GS, HS, KS, qS], t10 = [].concat(...e.map((o) => o.json)); + this.opMappers = t10.reduce((o, n) => (o[n.tfOpName] = n, o), {}); } - transformGraph(t8, e = {}) { - let o = t8.node, n = [], s = [], a = [], i = o.reduce((h, g) => (h[g.name] = this.mapNode(g), g.op.startsWith("Placeholder") ? n.push(h[g.name]) : g.op === "Const" ? s.push(h[g.name]) : (g.input == null || g.input.length === 0) && a.push(h[g.name]), h), {}), p = [], u = [], c = {}, l = {}; - e != null && (c = this.mapSignatureEntries(e.inputs), l = this.mapSignatureEntries(e.outputs)); + transformGraph(e, t10 = {}) { + let o = e.node, n = [], s = [], a = [], i = o.reduce((h, g) => (h[g.name] = this.mapNode(g), g.op.startsWith("Placeholder") ? n.push(h[g.name]) : g.op === "Const" ? s.push(h[g.name]) : (g.input == null || g.input.length === 0) && a.push(h[g.name]), h), {}), p = [], u = [], l = {}, c = {}; + t10 != null && (l = this.mapSignatureEntries(t10.inputs), c = this.mapSignatureEntries(t10.outputs)); let m = Object.keys(i); m.forEach((h) => { let g = i[h]; g.inputNames.forEach((x, b) => { - let [C, , S] = Ls(x), k = i[C]; + let [w, , S] = qs(x), k = i[w]; if (k.outputs != null) { - let _ = k.outputs.indexOf(S); - if (_ !== -1) { - let E = `${C}:${_}`; + let T = k.outputs.indexOf(S); + if (T !== -1) { + let E = `${w}:${T}`; g.inputNames[b] = E; } } g.inputs.push(k), k.children.push(g); }); - }), Object.keys(l).length === 0 ? m.forEach((h) => { + }), Object.keys(c).length === 0 ? m.forEach((h) => { let g = i[h]; g.children.length === 0 && u.push(g); - }) : Object.keys(l).forEach((h) => { - let [g] = Ls(h), x = i[g]; - x != null && (x.signatureKey = l[h], u.push(x)); - }), Object.keys(c).length > 0 ? Object.keys(c).forEach((h) => { - let [g] = Ls(h), x = i[g]; - x && (x.signatureKey = c[h], p.push(x)); + }) : Object.keys(c).forEach((h) => { + let [g] = qs(h), x = i[g]; + x != null && (x.signatureKey = c[h], u.push(x)); + }), Object.keys(l).length > 0 ? Object.keys(l).forEach((h) => { + let [g] = qs(h), x = i[g]; + x && (x.signatureKey = l[h], p.push(x)); }) : p = n; let d = {}; - t8.library != null && t8.library.function != null && (d = t8.library.function.reduce((h, g) => (h[g.signature.name] = this.mapFunction(g), h), {})); - let f = { nodes: i, inputs: p, outputs: u, weights: s, placeholders: n, signature: e, functions: d }; + e.library != null && e.library.function != null && (d = e.library.function.reduce((h, g) => (h[g.signature.name] = this.mapFunction(g), h), {})); + let f = { nodes: i, inputs: p, outputs: u, weights: s, placeholders: n, signature: t10, functions: d }; return a.length > 0 && (f.initNodes = a), f; } - mapSignatureEntries(t8) { - return Object.keys(t8 || {}).reduce((e, o) => (e[t8[o].name] = o, e), {}); + mapSignatureEntries(e) { + return Object.keys(e || {}).reduce((t10, o) => (t10[e[o].name] = o, t10), {}); } - mapNode(t8) { - let e = uf(t8.op) || this.opMappers[t8.op] || {}; - t8.attr == null && (t8.attr = {}); - let o = { name: t8.name, op: t8.op, category: e.category, inputNames: (t8.input || []).map((n) => n.startsWith("^") ? n.slice(1) : n), inputs: [], children: [], inputParams: {}, attrParams: {}, rawAttrs: t8.attr, outputs: e.outputs }; - return e.inputs != null && (o.inputParams = e.inputs.reduce((n, s) => (n[s.name] = { type: s.type, inputIndexStart: s.start, inputIndexEnd: s.end }, n), {})), e.attrs != null && (o.attrParams = e.attrs.reduce((n, s) => { + mapNode(e) { + let t10 = bf(e.op) || this.opMappers[e.op] || {}; + e.attr == null && (e.attr = {}); + let o = { name: e.name, op: e.op, category: t10.category, inputNames: (e.input || []).map((n) => n.startsWith("^") ? n.slice(1) : n), inputs: [], children: [], inputParams: {}, attrParams: {}, rawAttrs: e.attr, outputs: t10.outputs }; + return t10.inputs != null && (o.inputParams = t10.inputs.reduce((n, s) => (n[s.name] = { type: s.type, inputIndexStart: s.start, inputIndexEnd: s.end }, n), {})), t10.attrs != null && (o.attrParams = t10.attrs.reduce((n, s) => { let a = s.type, i; switch (s.type) { case "string": - i = cf(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = cf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = wf(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = wf(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "string[]": - i = xf(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = xf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = _f(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = _f(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "number": - i = mf(t8.attr, s.tfName, s.defaultValue || 0), i === void 0 && s.tfDeprecatedName && (i = mf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = If(e.attr, s.tfName, s.defaultValue || 0), i === void 0 && s.tfDeprecatedName && (i = If(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "number[]": - i = gf(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = gf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = Tf(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = Tf(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "bool": - i = lf(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = lf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = Sf(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = Sf(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "bool[]": - i = bf(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = bf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = $f(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = $f(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "shape": - i = hf(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = hf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = Nf(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = Nf(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "shape[]": - i = yf(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = yf(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = Ef(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = Ef(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "dtype": - i = df(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = df(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = vf(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = vf(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "dtype[]": - i = ff(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = ff(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = kf(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = kf(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "func": - i = yT(t8.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = yT(t8.attr, s.tfDeprecatedName, s.defaultValue)); + i = p_(e.attr, s.tfName, s.defaultValue), i === void 0 && s.tfDeprecatedName && (i = p_(e.attr, s.tfDeprecatedName, s.defaultValue)); break; case "tensor": case "tensors": break; default: - throw new Error(`Unsupported param type: ${s.type} for op: ${t8.op}`); + throw new Error(`Unsupported param type: ${s.type} for op: ${e.op}`); } return n[s.name] = { value: i, type: a }, n; }, {})), o; } - mapFunction(t8) { - let e = t8.nodeDef, o = [], n = [], s = {}; - e != null && (s = e.reduce((l, m) => (l[m.name] = this.mapNode(m), m.op === "Const" && n.push(l[m.name]), l), {})); + mapFunction(e) { + let t10 = e.nodeDef, o = [], n = [], s = {}; + t10 != null && (s = t10.reduce((c, m) => (c[m.name] = this.mapNode(m), m.op === "Const" && n.push(c[m.name]), c), {})); let a = [], i = []; - t8.signature.inputArg.forEach((l) => { - let [m] = Ls(l.name), d = { name: m, op: "Placeholder", inputs: [], inputNames: [], category: "graph", inputParams: {}, attrParams: { dtype: { value: FS(l.type), type: "dtype" } }, children: [] }; - d.signatureKey = l.name, a.push(d), s[m] = d; - }), Object.keys(s).forEach((l) => { - let m = s[l]; + e.signature.inputArg.forEach((c) => { + let [m] = qs(c.name), d = { name: m, op: "Placeholder", inputs: [], inputNames: [], category: "graph", inputParams: {}, attrParams: { dtype: { value: jS(c.type), type: "dtype" } }, children: [] }; + d.signatureKey = c.name, a.push(d), s[m] = d; + }), Object.keys(s).forEach((c) => { + let m = s[c]; m.inputNames.forEach((d, f) => { - let [h, , g] = Ls(d), x = s[h]; + let [h, , g] = qs(d), x = s[h]; if (x.outputs != null) { let b = x.outputs.indexOf(g); if (b !== -1) { - let C = `${h}:${b}`; - m.inputNames[f] = C; + let w = `${h}:${b}`; + m.inputNames[f] = w; } } m.inputs.push(x), x.children.push(m); }); }); - let u = t8.ret; - t8.signature.outputArg.forEach((l) => { - let [m, d] = Ls(u[l.name]), f = s[m]; + let u = e.ret; + e.signature.outputArg.forEach((c) => { + let [m, d] = qs(u[c.name]), f = s[m]; f != null && (f.defaultOutput = d, i.push(f)); }); - let c = this.mapArgsToSignature(t8); - return { nodes: s, inputs: a, outputs: i, weights: n, placeholders: o, signature: c }; + let l = this.mapArgsToSignature(e); + return { nodes: s, inputs: a, outputs: i, weights: n, placeholders: o, signature: l }; } - mapArgsToSignature(t8) { - return { methodName: t8.signature.name, inputs: t8.signature.inputArg.reduce((e, o) => (e[o.name] = this.mapArgToTensorInfo(o), e), {}), outputs: t8.signature.outputArg.reduce((e, o) => (e[o.name] = this.mapArgToTensorInfo(o, t8.ret), e), {}) }; + mapArgsToSignature(e) { + return { methodName: e.signature.name, inputs: e.signature.inputArg.reduce((t10, o) => (t10[o.name] = this.mapArgToTensorInfo(o), t10), {}), outputs: e.signature.outputArg.reduce((t10, o) => (t10[o.name] = this.mapArgToTensorInfo(o, e.ret), t10), {}) }; } - mapArgToTensorInfo(t8, e) { - let o = t8.name; - return e != null && (o = e[o]), { name: o, dtype: t8.type }; + mapArgToTensorInfo(e, t10) { + let o = e.name; + return t10 != null && (o = t10[o]), { name: o, dtype: e.type }; } }; -function J5(r15) { - let t8 = A().global; - if (typeof t8.atob != "undefined") - return t8.atob(r15); +function NY(r16) { + let e = A().global; + if (typeof e.atob != "undefined") + return e.atob(r16); if (typeof Buffer != "undefined") - return new Buffer(r15, "base64").toString(); + return new Buffer(r16, "base64").toString(); throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()"); } -function bT(r15, t8) { - let e = Array.isArray(r15) ? String.fromCharCode.apply(null, r15) : J5(r15); - return t8 ? e : e.toLowerCase(); +function l_(r16, e) { + let t10 = Array.isArray(r16) ? String.fromCharCode.apply(null, r16) : NY(r16); + return e ? t10 : t10.toLowerCase(); } -function cf(r15, t8, e, o = false) { - let n = r15[t8]; - return n != null ? bT(n.s, o) : e; +function wf(r16, e, t10, o = false) { + let n = r16[e]; + return n != null ? l_(n.s, o) : t10; } -function lf(r15, t8, e) { - let o = r15[t8]; - return o ? o.b : e; +function Sf(r16, e, t10) { + let o = r16[e]; + return o ? o.b : t10; } -function mf(r15, t8, e) { - let o = r15[t8] || {}, n = o.i != null ? o.i : o.f != null ? o.f : e; +function If(r16, e, t10) { + let o = r16[e] || {}, n = o.i != null ? o.i : o.f != null ? o.f : t10; return typeof n == "number" ? n : parseInt(n, 10); } -function FS(r15) { - switch (typeof r15 == "string" && (r15 = fo[r15]), r15) { - case fo.DT_FLOAT: - case fo.DT_HALF: +function jS(r16) { + switch (typeof r16 == "string" && (r16 = Or[r16]), r16) { + case Or.DT_FLOAT: + case Or.DT_HALF: return "float32"; - case fo.DT_INT32: - case fo.DT_INT64: - case fo.DT_INT8: - case fo.DT_UINT8: + case Or.DT_INT32: + case Or.DT_INT64: + case Or.DT_INT8: + case Or.DT_UINT8: return "int32"; - case fo.DT_BOOL: + case Or.DT_BOOL: return "bool"; - case fo.DT_DOUBLE: + case Or.DT_DOUBLE: return "float32"; - case fo.DT_STRING: + case Or.DT_STRING: return "string"; + case Or.DT_COMPLEX64: + case Or.DT_COMPLEX128: + return "complex64"; default: return null; } } -function yT(r15, t8, e) { - let o = r15[t8]; - return o && o.func ? o.func.name : e; +function p_(r16, e, t10) { + let o = r16[e]; + return o && o.func ? o.func.name : t10; } -function df(r15, t8, e) { - let o = r15[t8]; - return o && o.type ? FS(o.type) : e; +function vf(r16, e, t10) { + let o = r16[e]; + return o && o.type ? jS(o.type) : t10; } -function ff(r15, t8, e) { - let o = r15[t8]; - return o && o.list && o.list.type ? o.list.type.map((n) => FS(n)) : e; +function kf(r16, e, t10) { + let o = r16[e]; + return o && o.list && o.list.type ? o.list.type.map((n) => jS(n)) : t10; } -function CT(r15) { - if (!r15.unknownRank) - return r15.dim != null ? r15.dim.map((t8) => typeof t8.size == "number" ? t8.size : parseInt(t8.size, 10)) : []; +function c_(r16) { + if (!r16.unknownRank) + return r16.dim != null ? r16.dim.map((e) => typeof e.size == "number" ? e.size : parseInt(e.size, 10)) : []; } -function hf(r15, t8, e) { - let o = r15[t8]; - return o && o.shape ? CT(o.shape) : e; +function Nf(r16, e, t10) { + let o = r16[e]; + return o && o.shape ? c_(o.shape) : t10; } -function gf(r15, t8, e) { - let o = r15[t8]; - return o ? ((o.list.f && o.list.f.length ? o.list.f : o.list.i) || []).map((n) => typeof n == "number" ? n : parseInt(n, 10)) : e; +function Tf(r16, e, t10) { + let o = r16[e]; + return o ? ((o.list.f && o.list.f.length ? o.list.f : o.list.i) || []).map((n) => typeof n == "number" ? n : parseInt(n, 10)) : t10; } -function xf(r15, t8, e, o = false) { - let n = r15[t8]; - return n && n.list && n.list.s ? n.list.s.map((s) => bT(s, o)) : e; +function _f(r16, e, t10, o = false) { + let n = r16[e]; + return n && n.list && n.list.s ? n.list.s.map((s) => l_(s, o)) : t10; } -function yf(r15, t8, e) { - let o = r15[t8]; - return o && o.list && o.list.shape ? o.list.shape.map((n) => CT(n)) : e; +function Ef(r16, e, t10) { + let o = r16[e]; + return o && o.list && o.list.shape ? o.list.shape.map((n) => c_(n)) : t10; } -function bf(r15, t8, e) { - let o = r15[t8]; - return o && o.list && o.list.b ? o.list.b : e; +function $f(r16, e, t10) { + let o = r16[e]; + return o && o.list && o.list.b ? o.list.b : t10; } -var Cf = class { - constructor(t8, e, o) { - this.node = t8, this.tensorMap = e, this.context = o, this.inputs = [], this.attrs = {}, this.inputs = t8.inputNames.map((n) => this.getInput(n)), t8.rawAttrs != null && (this.attrs = Object.keys(t8.rawAttrs).reduce((n, s) => (n[s] = this.getAttr(s), n), {})); +var Rf = class { + constructor(e, t10, o) { + this.node = e, this.tensorMap = t10, this.context = o, this.inputs = [], this.attrs = {}, this.inputs = e.inputNames.map((n) => this.getInput(n)), e.rawAttrs != null && (this.attrs = Object.keys(e.rawAttrs).reduce((n, s) => (n[s] = this.getAttr(s), n), {})); } - getInput(t8) { - return Bt(t8, this.tensorMap, this.context); + getInput(e) { + return Vt(e, this.tensorMap, this.context); } - getAttr(t8, e) { - let o = this.node.rawAttrs[t8]; + getAttr(e, t10) { + let o = this.node.rawAttrs[e]; if (o.tensor != null) - return Bt(t8, this.tensorMap, this.context); + return Vt(e, this.tensorMap, this.context); if (o.i != null || o.f != null) - return mf(this.node.rawAttrs, t8, e); + return If(this.node.rawAttrs, e, t10); if (o.s != null) - return cf(this.node.rawAttrs, t8, e); + return wf(this.node.rawAttrs, e, t10); if (o.b != null) - return lf(this.node.rawAttrs, t8, e); + return Sf(this.node.rawAttrs, e, t10); if (o.shape != null) - return hf(this.node.rawAttrs, t8, e); + return Nf(this.node.rawAttrs, e, t10); if (o.type != null) - return df(this.node.rawAttrs, t8, e); + return vf(this.node.rawAttrs, e, t10); if (o.list != null) { if (o.list.i != null || o.list.f != null) - return gf(this.node.rawAttrs, t8, e); + return Tf(this.node.rawAttrs, e, t10); if (o.list.s != null) - return xf(this.node.rawAttrs, t8, e); + return _f(this.node.rawAttrs, e, t10); if (o.list.shape != null) - return yf(this.node.rawAttrs, t8, e); + return Ef(this.node.rawAttrs, e, t10); if (o.list.b != null) - return bf(this.node.rawAttrs, t8, e); + return $f(this.node.rawAttrs, e, t10); if (o.list.type != null) - return ff(this.node.rawAttrs, t8, e); + return kf(this.node.rawAttrs, e, t10); } - return e; + return t10; } }; -var Je = {}; -qe(Je, { OP_SCOPE_SUFFIX: () => kw, abs: () => Qt, acos: () => Nk, acosh: () => Tk, add: () => Ce, addN: () => _k, all: () => $k, any: () => Ek, argMax: () => Rk, argMin: () => Dk, asin: () => Ak, asinh: () => Fk, atan: () => Pk, atan2: () => Ok, atanh: () => Mk, avgPool: () => md, avgPool3d: () => zk, basicLSTMCell: () => Vk, batchNorm: () => ru, batchNorm2d: () => Uk, batchNorm3d: () => Gk, batchNorm4d: () => Hk, batchToSpaceND: () => dd, bincount: () => fd, bitwiseAnd: () => Kk, booleanMaskAsync: () => E6, broadcastArgs: () => qk, broadcastTo: () => ou, buffer: () => me, cast: () => We, ceil: () => jk, clipByValue: () => Xk, clone: () => Wr, complex: () => $r, concat: () => yt, concat1d: () => Yk, concat2d: () => Qk, concat3d: () => Zk, concat4d: () => Jk, conv1d: () => e2, conv2d: () => nu, conv2dTranspose: () => t2, conv3d: () => r22, conv3dTranspose: () => n2, cos: () => s2, cosh: () => a2, cosineWindow: () => _l, cumprod: () => i2, cumsum: () => u2, denseBincount: () => p2, depthToSpace: () => c2, depthwiseConv2d: () => oc, diag: () => l2, dilation2d: () => m2, div: () => je, divNoNan: () => f2, dot: () => h2, dropout: () => W6, einsum: () => su, elu: () => yd, enclosingPowerOfTwo: () => Qw, ensureShape: () => g2, equal: () => xd, erf: () => x2, euclideanNorm: () => C2, exp: () => _o, expandDims: () => Ms, expm1: () => w2, eye: () => bd, fft: () => ac, fill: () => Ea, floor: () => Cd, floorDiv: () => ld, fused: () => Zw, gather: () => wd, gatherND: () => z6, greater: () => zu, greaterEqual: () => Sd, ifft: () => Ku, imag: () => iu, image: () => Kj, inTopKAsync: () => G6, irfft: () => Gd, isFinite: () => S2, isInf: () => I2, isNaN: () => v2, leakyRelu: () => Id, less: () => kl, lessEqual: () => nc, linalg: () => qj, linspace: () => k2, localResponseNormalization: () => N2, log: () => ui, log1p: () => vd, logSigmoid: () => T2, logSoftmax: () => _2, logSumExp: () => Td, logicalAnd: () => Vu, logicalNot: () => _d, logicalOr: () => $d, logicalXor: () => $2, losses: () => jj, lowerBound: () => E2, matMul: () => Ze, max: () => Ra, maxPool: () => Rd, maxPool3d: () => R2, maxPoolWithArgmax: () => D2, maximum: () => Dd, mean: () => Wu, meshgrid: () => A2, min: () => vl, minimum: () => Uu, mirrorPad: () => F2, mod: () => P2, moments: () => O2, movingAverage: () => A6, mul: () => se, multiRNNCell: () => M2, multinomial: () => L2, neg: () => pr, norm: () => Bu, notEqual: () => Ad, oneHot: () => Tl, ones: () => Da, onesLike: () => B2, op: () => N, outerProduct: () => z2, pad: () => Aa, pad1d: () => V2, pad2d: () => W2, pad3d: () => U2, pad4d: () => G2, pool: () => H2, pow: () => ii, prelu: () => Pd, print: () => cd, prod: () => K2, raggedGather: () => q2, raggedRange: () => j2, raggedTensorToTensor: () => X2, rand: () => Y2, randomGamma: () => x1, randomNormal: () => Vd, randomStandardNormal: () => y1, randomUniform: () => sc, randomUniformInt: () => b1, range: () => uu, real: () => pi, reciprocal: () => C1, relu: () => pu, relu6: () => Wd, reshape: () => W, reverse: () => lo, reverse1d: () => w1, reverse2d: () => S1, reverse3d: () => I1, reverse4d: () => v1, rfft: () => ic, round: () => Ud, rsqrt: () => k1, scalar: () => ke, scatterND: () => P6, searchSorted: () => Nl, selu: () => N1, separableConv2d: () => T1, setdiff1dAsync: () => _1, sigmoid: () => $a, sign: () => $1, signal: () => Hj, sin: () => E1, sinh: () => R1, slice: () => Xe, slice1d: () => D1, slice2d: () => A1, slice3d: () => F1, slice4d: () => P1, softmax: () => O1, softplus: () => Nd, spaceToBatchND: () => Fd, sparse: () => Xj, sparseToDense: () => L6, spectral: () => Gj, split: () => ci, sqrt: () => Rr, square: () => Zt, squaredDifference: () => Hd, squeeze: () => uc, stack: () => vr, step: () => Kd, stridedSlice: () => M1, string: () => Yj, sub: () => Te, sum: () => ot, tan: () => L1, tanh: () => Il, tensor: () => ar, tensor1d: () => Jt, tensor2d: () => cu, tensor3d: () => qd, tensor4d: () => B1, tensor5d: () => z1, tensor6d: () => V1, tensorScatterUpdate: () => U1, tile: () => au, topk: () => G1, transpose: () => cc, truncatedNormal: () => H1, unique: () => K1, unsortedSegmentSum: () => q1, unstack: () => mo, upperBound: () => j1, variable: () => X1, where: () => co, whereAsync: () => Xd, zeros: () => Ur, zerosLike: () => Gt }); -var wT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var et = {}; +qe(et, { OP_SCOPE_SUFFIX: () => Bw, abs: () => er, acos: () => g1, acosh: () => x1, add: () => Ce, addN: () => y1, all: () => b1, any: () => C1, argMax: () => w1, argMin: () => S1, asin: () => I1, asinh: () => v1, atan: () => k1, atan2: () => N1, atanh: () => T1, avgPool: () => Id, avgPool3d: () => $1, basicLSTMCell: () => R1, batchNorm: () => mu, batchNorm2d: () => A1, batchNorm3d: () => F1, batchNorm4d: () => P1, batchToSpaceND: () => vd, bincount: () => kd, bitwiseAnd: () => O1, booleanMaskAsync: () => oX, broadcastArgs: () => M1, broadcastTo: () => Oa, buffer: () => ie, cast: () => Ue, ceil: () => L1, clipByValue: () => B1, clone: () => Xr, complex: () => Ar, concat: () => bt, concat1d: () => z1, concat2d: () => V1, concat3d: () => W1, concat4d: () => U1, conv1d: () => G1, conv2d: () => du, conv2dTranspose: () => H1, conv3d: () => K1, conv3dTranspose: () => j1, cos: () => X1, cosh: () => Y1, cosineWindow: () => Mc, cumprod: () => Q1, cumsum: () => Z1, denseBincount: () => J1, depthToSpace: () => e2, depthwiseConv2d: () => cl, diag: () => t2, dilation2d: () => r22, div: () => Xe, divNoNan: () => n2, dot: () => s2, dropout: () => hX, einsum: () => fu, elu: () => Ed, enclosingPowerOfTwo: () => cS, ensureShape: () => a2, equal: () => _d, erf: () => i2, euclideanNorm: () => l2, exp: () => Jo, expandDims: () => Ks, expm1: () => c2, eye: () => $d, fft: () => fl, fill: () => Ma, floor: () => Rd, floorDiv: () => Sd, fused: () => mS, gather: () => Dd, gatherND: () => dX, greater: () => ju, greaterEqual: () => Ad, ifft: () => ep, imag: () => gu, image: () => b5, inTopKAsync: () => xX, irfft: () => tf, isFinite: () => m2, isInf: () => d2, isNaN: () => f2, leakyRelu: () => Fd, less: () => Fc, lessEqual: () => ml, linalg: () => C5, linspace: () => h2, localResponseNormalization: () => g2, log: () => yi, log1p: () => Pd, logSigmoid: () => x2, logSoftmax: () => y2, logSumExp: () => Ld, logicalAnd: () => Xu, logicalNot: () => Bd, logicalOr: () => zd, logicalXor: () => b2, losses: () => w5, lowerBound: () => C2, matMul: () => Je, max: () => La, maxPool: () => Wd, maxPool3d: () => w2, maxPoolWithArgmax: () => S2, maximum: () => Ud, mean: () => Yu, meshgrid: () => I2, min: () => Ac, minimum: () => Qu, mirrorPad: () => v2, mod: () => k2, moments: () => N2, movingAverage: () => aX, mul: () => se, multiRNNCell: () => T2, multinomial: () => _2, neg: () => mr, norm: () => qu, notEqual: () => Gd, oneHot: () => Oc, ones: () => Ba, onesLike: () => E2, op: () => N, outerProduct: () => $2, pad: () => za, pad1d: () => R2, pad2d: () => D2, pad3d: () => A2, pad4d: () => F2, pool: () => P2, pow: () => xi, prelu: () => Kd, print: () => wd, prod: () => O2, raggedGather: () => M2, raggedRange: () => L2, raggedTensorToTensor: () => B2, rand: () => z2, randomGamma: () => iN, randomNormal: () => Zd, randomStandardNormal: () => uN, randomUniform: () => dl, randomUniformInt: () => pN, range: () => xu, real: () => bi, reciprocal: () => lN, relu: () => yu, relu6: () => Jd, reshape: () => W, reverse: () => Bo, reverse1d: () => cN, reverse2d: () => mN, reverse3d: () => dN, reverse4d: () => fN, rfft: () => hl, round: () => ef, rsqrt: () => hN, scalar: () => ke, scatterND: () => uX, searchSorted: () => Pc, selu: () => gN, separableConv2d: () => xN, setdiff1dAsync: () => yN, sigmoid: () => Pa, sign: () => bN, signal: () => y5, sin: () => CN, sinh: () => wN, slice: () => Ye, slice1d: () => SN, slice2d: () => IN, slice3d: () => vN, slice4d: () => kN, softmax: () => NN, softplus: () => Md, spaceToBatchND: () => Hd, sparse: () => S5, sparseToDense: () => cX, spectral: () => x5, split: () => Ci, sqrt: () => Pr, square: () => tr, squaredDifference: () => rf, squeeze: () => gl, stack: () => Tr, step: () => of, stridedSlice: () => TN, string: () => I5, sub: () => Te, sum: () => ot, tan: () => _N, tanh: () => Dc, tensor: () => pr, tensor1d: () => rr, tensor2d: () => bu, tensor3d: () => nf, tensor4d: () => EN, tensor5d: () => $N, tensor6d: () => RN, tensorScatterUpdate: () => AN, tile: () => hu, topk: () => FN, transpose: () => yl, truncatedNormal: () => PN, unique: () => ON, unsortedSegmentSum: () => MN, unstack: () => zo, upperBound: () => LN, variable: () => BN, where: () => Lo, whereAsync: () => af, zeros: () => Yr, zerosLike: () => Kt }); +var m_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "BiasAdd": case "AddV2": case "Add": - return [o.add(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.add(I("a", r16, e, t10), I("b", r16, e, t10))]; case "AddN": - return [o.addN(I("tensors", r15, t8, e))]; + return [o.addN(I("tensors", r16, e, t10))]; case "FloorMod": case "Mod": - return [o.mod(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.mod(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Mul": - return [o.mul(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.mul(I("a", r16, e, t10), I("b", r16, e, t10))]; case "RealDiv": case "Div": - return [o.div(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.div(I("a", r16, e, t10), I("b", r16, e, t10))]; case "DivNoNan": - return [o.divNoNan(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.divNoNan(I("a", r16, e, t10), I("b", r16, e, t10))]; case "FloorDiv": - return [o.floorDiv(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.floorDiv(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Sub": - return [o.sub(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.sub(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Minimum": - return [o.minimum(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.minimum(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Maximum": - return [o.maximum(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.maximum(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Pow": - return [o.pow(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.pow(I("a", r16, e, t10), I("b", r16, e, t10))]; case "SquaredDifference": - return [o.squaredDifference(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.squaredDifference(I("a", r16, e, t10), I("b", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var ST = (r15, t8, e, o = Je) => { - switch (r15.op) { +var d_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "Abs": case "ComplexAbs": - return [o.abs(I("x", r15, t8, e))]; + return [o.abs(I("x", r16, e, t10))]; case "Acos": - return [o.acos(I("x", r15, t8, e))]; + return [o.acos(I("x", r16, e, t10))]; case "Acosh": - return [o.acosh(I("x", r15, t8, e))]; + return [o.acosh(I("x", r16, e, t10))]; case "Asin": - return [o.asin(I("x", r15, t8, e))]; + return [o.asin(I("x", r16, e, t10))]; case "Asinh": - return [o.asinh(I("x", r15, t8, e))]; + return [o.asinh(I("x", r16, e, t10))]; case "Atan": - return [o.atan(I("x", r15, t8, e))]; + return [o.atan(I("x", r16, e, t10))]; case "Atan2": - return [o.atan2(I("x", r15, t8, e), I("y", r15, t8, e))]; + return [o.atan2(I("x", r16, e, t10), I("y", r16, e, t10))]; case "Atanh": - return [o.atanh(I("x", r15, t8, e))]; + return [o.atanh(I("x", r16, e, t10))]; case "Ceil": - return [o.ceil(I("x", r15, t8, e))]; + return [o.ceil(I("x", r16, e, t10))]; case "Complex": - return [o.complex(I("real", r15, t8, e), I("imag", r15, t8, e))]; + return [o.complex(I("real", r16, e, t10), I("imag", r16, e, t10))]; case "Cos": - return [o.cos(I("x", r15, t8, e))]; + return [o.cos(I("x", r16, e, t10))]; case "Cosh": - return [o.cosh(I("x", r15, t8, e))]; + return [o.cosh(I("x", r16, e, t10))]; case "Elu": - return [o.elu(I("x", r15, t8, e))]; + return [o.elu(I("x", r16, e, t10))]; case "Erf": - return [o.erf(I("x", r15, t8, e))]; + return [o.erf(I("x", r16, e, t10))]; case "Exp": - return [o.exp(I("x", r15, t8, e))]; + return [o.exp(I("x", r16, e, t10))]; case "Expm1": - return [o.expm1(I("x", r15, t8, e))]; + return [o.expm1(I("x", r16, e, t10))]; case "Floor": - return [o.floor(I("x", r15, t8, e))]; + return [o.floor(I("x", r16, e, t10))]; case "Log": - return [o.log(I("x", r15, t8, e))]; + return [o.log(I("x", r16, e, t10))]; case "Log1p": - return [o.log1p(I("x", r15, t8, e))]; + return [o.log1p(I("x", r16, e, t10))]; case "Imag": - return [o.imag(I("x", r15, t8, e))]; + return [o.imag(I("x", r16, e, t10))]; case "Neg": - return [o.neg(I("x", r15, t8, e))]; + return [o.neg(I("x", r16, e, t10))]; case "Reciprocal": - return [o.reciprocal(I("x", r15, t8, e))]; + return [o.reciprocal(I("x", r16, e, t10))]; case "Real": - return [o.real(I("x", r15, t8, e))]; + return [o.real(I("x", r16, e, t10))]; case "Relu": - return [o.relu(I("x", r15, t8, e))]; + return [o.relu(I("x", r16, e, t10))]; case "Round": - return [o.round(I("x", r15, t8, e))]; + return [o.round(I("x", r16, e, t10))]; case "Selu": - return [o.selu(I("x", r15, t8, e))]; + return [o.selu(I("x", r16, e, t10))]; case "Sigmoid": - return [o.sigmoid(I("x", r15, t8, e))]; + return [o.sigmoid(I("x", r16, e, t10))]; case "Sin": - return [o.sin(I("x", r15, t8, e))]; + return [o.sin(I("x", r16, e, t10))]; case "Sign": - return [o.sign(I("x", r15, t8, e))]; + return [o.sign(I("x", r16, e, t10))]; case "Sinh": - return [o.sinh(I("x", r15, t8, e))]; + return [o.sinh(I("x", r16, e, t10))]; case "Softplus": - return [o.softplus(I("x", r15, t8, e))]; + return [o.softplus(I("x", r16, e, t10))]; case "Sqrt": - return [o.sqrt(I("x", r15, t8, e))]; + return [o.sqrt(I("x", r16, e, t10))]; case "Square": - return [o.square(I("x", r15, t8, e))]; + return [o.square(I("x", r16, e, t10))]; case "Tanh": - return [o.tanh(I("x", r15, t8, e))]; + return [o.tanh(I("x", r16, e, t10))]; case "Tan": - return [o.tan(I("x", r15, t8, e))]; + return [o.tan(I("x", r16, e, t10))]; case "ClipByValue": - return [o.clipByValue(I("x", r15, t8, e), I("clipValueMin", r15, t8, e), I("clipValueMax", r15, t8, e))]; + return [o.clipByValue(I("x", r16, e, t10), I("clipValueMin", r16, e, t10), I("clipValueMax", r16, e, t10))]; case "Relu6": - return [o.relu6(I("x", r15, t8, e))]; + return [o.relu6(I("x", r16, e, t10))]; case "Rsqrt": - return [o.rsqrt(Bt(r15.inputNames[0], t8, e))]; + return [o.rsqrt(Vt(r16.inputNames[0], e, t10))]; case "LeakyRelu": - return [o.leakyRelu(I("x", r15, t8, e), I("alpha", r15, t8, e))]; + return [o.leakyRelu(I("x", r16, e, t10), I("alpha", r16, e, t10))]; case "Prelu": - return [o.prelu(I("x", r15, t8, e), I("alpha", r15, t8, e))]; + return [o.prelu(I("x", r16, e, t10), I("alpha", r16, e, t10))]; case "IsNan": - return [o.isNaN(Bt(r15.inputNames[0], t8, e))]; + return [o.isNaN(Vt(r16.inputNames[0], e, t10))]; case "IsInf": - return [o.isInf(Bt(r15.inputNames[0], t8, e))]; + return [o.isInf(Vt(r16.inputNames[0], e, t10))]; case "IsFinite": - return [o.isFinite(Bt(r15.inputNames[0], t8, e))]; + return [o.isFinite(Vt(r16.inputNames[0], e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -function Gr(r15, t8, e = "") { - if (!(typeof r15 == "number" || typeof t8 == "number")) { - y.assert(r15.length === t8.length, () => e + ` Shapes ${r15} and ${t8} must match`); - for (let o = 0; o < r15.length; o++) { - let n = r15[o], s = t8[o]; - y.assert(n < 0 || s < 0 || n === s, () => e + ` Shapes ${r15} and ${t8} must match`); +function Qr(r16, e, t10 = "") { + if (!(typeof r16 == "number" || typeof e == "number")) { + y.assert(r16.length === e.length, () => t10 + ` Shapes ${r16} and ${e} must match`); + for (let o = 0; o < r16.length; o++) { + let n = r16[o], s = e[o]; + y.assert(n < 0 || s < 0 || n === s, () => t10 + ` Shapes ${r16} and ${e} must match`); } } } -function IT(r15) { - return !(typeof r15 == "number" || r15.some((t8) => t8 < 0)); +function f_(r16) { + return !(typeof r16 == "number" || r16.some((e) => e < 0)); } -function mc(r15, t8, e) { - let o = wf(r15, e), n = !IT(o); - if (n && t8.length === 0) +function Cl(r16, e, t10) { + let o = Df(r16, t10), n = !f_(o); + if (n && e.length === 0) throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${o}`); - if (n && t8.forEach((s) => { - o = wf(s.shape, o); - }), !IT(o)) + if (n && e.forEach((s) => { + o = Df(s.shape, o); + }), !f_(o)) throw new Error(`Non-fully-defined elementShape: ${o}`); return o; } -function wf(r15, t8) { - if (typeof r15 == "number") - return t8; - if (typeof t8 == "number") - return r15; - if (r15.length !== t8.length) - throw new Error(`Incompatible ranks during merge: ${r15} vs. ${t8}`); - let e = []; - for (let o = 0; o < r15.length; ++o) { - let n = r15[o], s = t8[o]; +function Df(r16, e) { + if (typeof r16 == "number") + return e; + if (typeof e == "number") + return r16; + if (r16.length !== e.length) + throw new Error(`Incompatible ranks during merge: ${r16} vs. ${e}`); + let t10 = []; + for (let o = 0; o < r16.length; ++o) { + let n = r16[o], s = e[o]; if (n >= 0 && s >= 0 && n !== s) - throw new Error(`Incompatible shape during merge: ${r15} vs. ${t8}`); - e[o] = n >= 0 ? n : s; + throw new Error(`Incompatible shape during merge: ${r16} vs. ${e}`); + t10[o] = n >= 0 ? n : s; } - return e; + return t10; } -var Sf = class { - constructor(t8, e, o, n, s, a, i) { - this.name = t8, this.dtype = e, this.maxSize = o, this.elementShape = n, this.identicalElementShapes = s, this.dynamicSize = a, this.clearAfterRead = i, this.tensors = [], this.closed_ = false, this.idTensor = ke(0), Er(this.idTensor); +var Af = class { + constructor(e, t10, o, n, s, a, i) { + this.name = e, this.dtype = t10, this.maxSize = o, this.elementShape = n, this.identicalElementShapes = s, this.dynamicSize = a, this.clearAfterRead = i, this.tensors = [], this.closed_ = false, this.idTensor = ke(0), Fr(this.idTensor); } get id() { return this.idTensor.id; @@ -10250,406 +10342,406 @@ var Sf = class { get closed() { return this.closed_; } - clearAndClose(t8) { - this.tensors.forEach((e) => { - (t8 == null || !t8.has(e.tensor.id)) && e.tensor.dispose(); + clearAndClose(e) { + this.tensors.forEach((t10) => { + (e == null || !e.has(t10.tensor.id)) && t10.tensor.dispose(); }), this.tensors = [], this.closed_ = true, this.idTensor.dispose(); } size() { return this.tensors.length; } - read(t8) { + read(e) { if (this.closed_) throw new Error(`TensorArray ${this.name} has already been closed.`); - if (t8 < 0 || t8 >= this.size()) - throw new Error(`Tried to read from index ${t8}, but array size is: ${this.size()}`); - let e = this.tensors[t8]; - if (e.cleared) - throw new Error(`TensorArray ${this.name}: Could not read index ${t8} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`); - return this.clearAfterRead && (e.cleared = true), e.read = true, e.tensor; + if (e < 0 || e >= this.size()) + throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`); + let t10 = this.tensors[e]; + if (t10.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 && (t10.cleared = true), t10.read = true, t10.tensor; } - readMany(t8) { - return t8.map((e) => this.read(e)); + readMany(e) { + return e.map((t10) => this.read(t10)); } - write(t8, e) { + write(e, t10) { if (this.closed_) throw new Error(`TensorArray ${this.name} has already been closed.`); - if (t8 < 0 || !this.dynamicSize && t8 >= this.maxSize) - throw new Error(`Tried to write to index ${t8}, but array is not resizeable and size is: ${this.maxSize}`); - let o = this.tensors[t8] || {}; - if (e.dtype !== this.dtype) - throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t8}, - because the value dtype is ${e.dtype}, but TensorArray dtype is ${this.dtype}.`); - if (this.size() === 0 && (this.elementShape == null || this.elementShape.length === 0) && (this.elementShape = e.shape), Gr(this.elementShape, e.shape, `TensorArray ${this.name}: Could not write to TensorArray index ${t8}.`), o.read) - throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t8}, because it has already been read.`); + 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 o = this.tensors[e] || {}; + if (t10.dtype !== this.dtype) + throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, + because the value dtype is ${t10.dtype}, but TensorArray dtype is ${this.dtype}.`); + if (this.size() === 0 && (this.elementShape == null || this.elementShape.length === 0) && (this.elementShape = t10.shape), Qr(this.elementShape, t10.shape, `TensorArray ${this.name}: Could not write to TensorArray index ${e}.`), o.read) + throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`); if (o.written) - throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t8}, because it has already been written.`); - o.tensor = e, Er(e), o.written = true, this.tensors[t8] = o; - } - writeMany(t8, e) { - if (t8.length !== e.length) - throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${t8.length} is not the same as tensors size: ${e.length}.`); - t8.forEach((o, n) => this.write(o, e[n])); - } - gather(t8, e) { - if (e && e !== this.dtype) - throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${e}`); - if (t8) - t8 = t8.slice(0, this.size()); + throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`); + o.tensor = t10, Fr(t10), o.written = true, this.tensors[e] = o; + } + writeMany(e, t10) { + if (e.length !== t10.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: ${t10.length}.`); + e.forEach((o, n) => this.write(o, t10[n])); + } + gather(e, t10) { + if (t10 && t10 !== this.dtype) + throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${t10}`); + if (e) + e = e.slice(0, this.size()); else { - t8 = []; + e = []; for (let n = 0; n < this.size(); n++) - t8.push(n); + e.push(n); } - if (t8.length === 0) - return ar([], [0].concat(this.elementShape)); - let o = this.readMany(t8); - return Gr(this.elementShape, o[0].shape, "TensorArray shape mismatch: "), vr(o, 0); + if (e.length === 0) + return pr([], [0].concat(this.elementShape)); + let o = this.readMany(e); + return Qr(this.elementShape, o[0].shape, "TensorArray shape mismatch: "), Tr(o, 0); } - concat(t8) { - if (t8 && t8 !== this.dtype) - throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${t8}`); + concat(e) { + if (e && e !== this.dtype) + throw new Error(`TensorArray dtype is ${this.dtype} but concat requested dtype ${e}`); if (this.size() === 0) - return ar([], [0].concat(this.elementShape)); - let e = []; + return pr([], [0].concat(this.elementShape)); + let t10 = []; for (let n = 0; n < this.size(); n++) - e.push(n); - let o = this.readMany(e); - return Gr(this.elementShape, o[0].shape, `TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${o[0].shape})`), yt(o, 0); - } - scatter(t8, e) { - if (e.dtype !== this.dtype) - throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`); - if (t8.length !== e.shape[0]) - throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t8.length} vs. ${e.shape[0]}`); - let o = Math.max(...t8); + t10.push(n); + let o = this.readMany(t10); + return Qr(this.elementShape, o[0].shape, `TensorArray shape mismatch: tensor array shape (${this.elementShape}) vs first tensor shape (${o[0].shape})`), bt(o, 0); + } + scatter(e, t10) { + if (t10.dtype !== this.dtype) + throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t10.dtype}`); + if (e.length !== t10.shape[0]) + throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t10.shape[0]}`); + let o = Math.max(...e); if (!this.dynamicSize && o >= this.maxSize) throw new Error(`Max index must be < array size (${o} vs. ${this.maxSize})`); - this.writeMany(t8, mo(e, 0)); + this.writeMany(e, zo(t10, 0)); } - split(t8, e) { - if (e.dtype !== this.dtype) - throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`); - let o = 0, n = t8.map((p) => (o += p, o)); - if (o !== e.shape[0]) + split(e, t10) { + if (t10.dtype !== this.dtype) + throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${t10.dtype}`); + let o = 0, n = e.map((p) => (o += p, o)); + if (o !== t10.shape[0]) throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${o}, and tensor's shape is: ${e.shape}`); - if (!this.dynamicSize && t8.length !== this.maxSize) - throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${t8.length}), and the TensorArray is not marked as dynamically resizeable`); - let s = o === 0 ? 0 : e.size / o, a = []; + ${o}, and tensor's shape is: ${t10.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 s = o === 0 ? 0 : t10.size / o, a = []; De(() => { - e = W(e, [1, o, s]); - for (let p = 0; p < t8.length; ++p) { - let c = [0, p === 0 ? 0 : n[p - 1], 0], l = [1, t8[p], s]; - a[p] = W(Xe(e, c, l), this.elementShape); + t10 = W(t10, [1, o, s]); + for (let p = 0; p < e.length; ++p) { + let l = [0, p === 0 ? 0 : n[p - 1], 0], c = [1, e[p], s]; + a[p] = W(Ye(t10, l, c), this.elementShape); } return a; }); let i = []; - for (let p = 0; p < t8.length; p++) + for (let p = 0; p < e.length; p++) i[p] = p; this.writeMany(i, a); } }; -var dc = class r9 { +var wl = class r9 { get id() { return this.idTensor.id; } - constructor(t8, e, o, n = -1) { - this.tensors = t8, this.elementShape = e, this.elementDtype = o, t8 != null && t8.forEach((s) => { + constructor(e, t10, o, n = -1) { + this.tensors = e, this.elementShape = t10, this.elementDtype = o, e != null && e.forEach((s) => { if (o !== s.dtype) throw new Error(`Invalid data types; op elements ${o}, but list elements ${s.dtype}`); - Gr(e, s.shape, "TensorList shape mismatch: "), Er(s); - }), this.idTensor = ke(0), this.maxNumElements = n, Er(this.idTensor); + Qr(t10, s.shape, "TensorList shape mismatch: "), Fr(s); + }), this.idTensor = ke(0), this.maxNumElements = n, Fr(this.idTensor); } copy() { return new r9([...this.tensors], this.elementShape, this.elementDtype); } - clearAndClose(t8) { - this.tensors.forEach((e) => { - (t8 == null || !t8.has(e.id)) && e.dispose(); + clearAndClose(e) { + this.tensors.forEach((t10) => { + (e == null || !e.has(t10.id)) && t10.dispose(); }), this.tensors.length = 0, this.idTensor.dispose(); } size() { return this.tensors.length; } - stack(t8, e, o = -1) { - if (e !== this.elementDtype) - throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`); + stack(e, t10, o = -1) { + if (t10 !== this.elementDtype) + throw new Error(`Invalid data types; op elements ${t10}, but list elements ${this.elementDtype}`); if (o !== -1 && this.tensors.length !== o) throw new Error(`Operation expected a list with ${o} elements but got a list with ${this.tensors.length} elements.`); - Gr(t8, this.elementShape, "TensorList shape mismatch: "); - let n = mc(this.elementShape, this.tensors, t8); + Qr(e, this.elementShape, "TensorList shape mismatch: "); + let n = Cl(this.elementShape, this.tensors, e); return De(() => { let s = this.tensors.map((a) => W(a, n)); - return vr(s, 0); + return Tr(s, 0); }); } - popBack(t8, e) { - if (e !== this.elementDtype) - throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`); + popBack(e, t10) { + if (t10 !== this.elementDtype) + throw new Error(`Invalid data types; op elements ${t10}, but list elements ${this.elementDtype}`); if (this.size() === 0) throw new Error("Trying to pop from an empty list."); - let o = mc(this.elementShape, this.tensors, t8), n = this.tensors.pop(); - return n.kept = false, Gr(n.shape, t8, "TensorList shape mismatch: "), W(n, o); + let o = Cl(this.elementShape, this.tensors, e), n = this.tensors.pop(); + return n.kept = false, Qr(n.shape, e, "TensorList shape mismatch: "), W(n, o); } - pushBack(t8) { - if (t8.dtype !== this.elementDtype) - throw new Error(`Invalid data types; op elements ${t8.dtype}, but list elements ${this.elementDtype}`); - if (Gr(t8.shape, this.elementShape, "TensorList shape mismatch: "), this.maxNumElements === this.size()) + pushBack(e) { + if (e.dtype !== this.elementDtype) + throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`); + if (Qr(e.shape, this.elementShape, "TensorList shape mismatch: "), this.maxNumElements === this.size()) throw new Error("Trying to push element into a full list."); - Er(t8), this.tensors.push(t8); - } - resize(t8) { - if (t8 < 0) - throw new Error(`TensorListResize expects size to be non-negative. Got: ${t8}`); - if (this.maxNumElements !== -1 && t8 > this.maxNumElements) - throw new Error(`TensorListResize input size ${t8} is greater maxNumElement ${this.maxNumElements}.`); - let e = new r9([], this.elementShape, this.elementDtype, this.maxNumElements); - e.tensors.length = t8; - for (let o = 0; o < Math.min(this.tensors.length, t8); ++o) - e.tensors[o] = this.tensors[o]; - return e; - } - getItem(t8, e, o) { + Fr(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}.`); + let t10 = new r9([], this.elementShape, this.elementDtype, this.maxNumElements); + t10.tensors.length = e; + for (let o = 0; o < Math.min(this.tensors.length, e); ++o) + t10.tensors[o] = this.tensors[o]; + return t10; + } + getItem(e, t10, o) { if (o !== this.elementDtype) throw new Error(`Invalid data types; op elements ${o}, but list elements ${this.elementDtype}`); - if (t8 < 0 || t8 > this.tensors.length) - throw new Error(`Trying to access element ${t8} in a list with ${this.tensors.length} elements.`); - if (this.tensors[t8] == null) - throw new Error(`element at index ${t8} is null.`); - Gr(this.tensors[t8].shape, e, "TensorList shape mismatch: "); - let n = mc(this.elementShape, this.tensors, e); - return W(this.tensors[t8], n); - } - setItem(t8, e) { - if (e.dtype !== this.elementDtype) - throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`); - if (t8 < 0 || this.maxNumElements !== -1 && t8 >= this.maxNumElements) - throw new Error(`Trying to set element ${t8} in a list with max ${this.maxNumElements} elements.`); - Gr(this.elementShape, e.shape, "TensorList shape mismatch: "), Er(e), this.tensors[t8] != null && (this.tensors[t8].kept = false), this.tensors[t8] = e; - } - gather(t8, e, o) { - if (e !== this.elementDtype) - throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`); - Gr(this.elementShape, o, "TensorList shape mismatch: "), t8 = t8.slice(0, this.size()); - let n = mc(this.elementShape, this.tensors, o); - return t8.length === 0 ? ar([], [0].concat(n)) : De(() => { - let s = t8.map((a) => W(this.tensors[a], n)); - return vr(s, 0); + 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.`); + Qr(this.tensors[e].shape, t10, "TensorList shape mismatch: "); + let n = Cl(this.elementShape, this.tensors, t10); + return W(this.tensors[e], n); + } + setItem(e, t10) { + if (t10.dtype !== this.elementDtype) + throw new Error(`Invalid data types; op elements ${t10.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.`); + Qr(this.elementShape, t10.shape, "TensorList shape mismatch: "), Fr(t10), this.tensors[e] != null && (this.tensors[e].kept = false), this.tensors[e] = t10; + } + gather(e, t10, o) { + if (t10 !== this.elementDtype) + throw new Error(`Invalid data types; op elements ${t10}, but list elements ${this.elementDtype}`); + Qr(this.elementShape, o, "TensorList shape mismatch: "), e = e.slice(0, this.size()); + let n = Cl(this.elementShape, this.tensors, o); + return e.length === 0 ? pr([], [0].concat(n)) : De(() => { + let s = e.map((a) => W(this.tensors[a], n)); + return Tr(s, 0); }); } - concat(t8, e) { - if (t8 && t8 !== this.elementDtype) - throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t8}`); - Gr(this.elementShape, e, "TensorList shape mismatch: "); - let o = mc(this.elementShape, this.tensors, e); - return this.size() === 0 ? ar([], [0].concat(o)) : De(() => { + concat(e, t10) { + if (e && e !== this.elementDtype) + throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`); + Qr(this.elementShape, t10, "TensorList shape mismatch: "); + let o = Cl(this.elementShape, this.tensors, t10); + return this.size() === 0 ? pr([], [0].concat(o)) : De(() => { let n = this.tensors.map((s) => W(s, o)); - return yt(n, 0); + return bt(n, 0); }); } }; -function vT(r15, t8, e) { - let o = r15.dtype; - if (r15.shape.length < 1) - throw new Error(`Tensor must be at least a vector, but saw shape: ${r15.shape}`); - if (r15.dtype !== e) - throw new Error(`Invalid data types; op elements ${r15.dtype}, but list elements ${e}`); - let n = r15.shape.slice(1); - Gr(n, t8, "TensorList shape mismatch: "); - let s = mo(r15); - return new dc(s, t8, o); -} -function kT(r15, t8, e, o) { - return new dc([], r15, t8, o); -} -function NT(r15, t8, e, o) { - if (t8.length !== r15.shape[0]) - throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t8.length} vs. ${r15.shape[0]}`); - let n = Math.max(...t8); +function h_(r16, e, t10) { + let o = r16.dtype; + if (r16.shape.length < 1) + throw new Error(`Tensor must be at least a vector, but saw shape: ${r16.shape}`); + if (r16.dtype !== t10) + throw new Error(`Invalid data types; op elements ${r16.dtype}, but list elements ${t10}`); + let n = r16.shape.slice(1); + Qr(n, e, "TensorList shape mismatch: "); + let s = zo(r16); + return new wl(s, e, o); +} +function g_(r16, e, t10, o) { + return new wl([], r16, e, o); +} +function x_(r16, e, t10, o) { + if (e.length !== r16.shape[0]) + throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${r16.shape[0]}`); + let n = Math.max(...e); if (o != null && o !== -1 && n >= o) throw new Error(`Max index must be < array size (${n} vs. ${o})`); - let s = new dc([], e, r15.dtype, o), a = mo(r15, 0); - return t8.forEach((i, p) => { + let s = new wl([], t10, r16.dtype, o), a = zo(r16, 0); + return e.forEach((i, p) => { s.setItem(i, a[p]); }), s; } -function TT(r15, t8, e) { - let o = 0, n = t8.map((c) => (o += c, o)); - if (o !== r15.shape[0]) +function y_(r16, e, t10) { + let o = 0, n = e.map((l) => (o += l, o)); + if (o !== r16.shape[0]) throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${o}, and tensor's shape is: ${r15.shape}`); - let s = r15.shape.slice(1), a = wf(s, e), i = o === 0 ? 0 : r15.size / o, p = De(() => { - let c = []; - r15 = W(r15, [1, o, i]); - for (let l = 0; l < t8.length; ++l) { - let d = [0, l === 0 ? 0 : n[l - 1], 0], f = [1, t8[l], i]; - c[l] = W(Xe(r15, d, f), a); - } - return r15.dispose(), c; - }), u = new dc([], e, r15.dtype, t8.length); - for (let c = 0; c < p.length; c++) - u.setItem(c, p[c]); + ${o}, and tensor's shape is: ${r16.shape}`); + let s = r16.shape.slice(1), a = Df(s, t10), i = o === 0 ? 0 : r16.size / o, p = De(() => { + let l = []; + r16 = W(r16, [1, o, i]); + for (let c = 0; c < e.length; ++c) { + let d = [0, c === 0 ? 0 : n[c - 1], 0], f = [1, e[c], i]; + l[c] = W(Ye(r16, d, f), a); + } + return r16.dispose(), l; + }), u = new wl([], t10, r16.dtype, e.length); + for (let l = 0; l < p.length; l++) + u.setItem(l, p[l]); return u; } -var _T = async (r15, t8, e) => { - switch (r15.op) { +var b_ = async (r16, e, t10) => { + switch (r16.op) { case "If": case "StatelessIf": { - let o = I("thenBranch", r15, t8, e), n = I("elseBranch", r15, t8, e), s = I("cond", r15, t8, e), a = I("args", r15, t8, e); - return (await s.data())[0] ? e.functionMap[o].executeFunctionAsync(a, e.tensorArrayMap, e.tensorListMap) : e.functionMap[n].executeFunctionAsync(a, e.tensorArrayMap, e.tensorListMap); + let o = I("thenBranch", r16, e, t10), n = I("elseBranch", r16, e, t10), s = I("cond", r16, e, t10), a = I("args", r16, e, t10); + return (await s.data())[0] ? t10.functionMap[o].executeFunctionAsync(a, t10.tensorArrayMap, t10.tensorListMap) : t10.functionMap[n].executeFunctionAsync(a, t10.tensorArrayMap, t10.tensorListMap); } case "While": case "StatelessWhile": { - let o = I("body", r15, t8, e), n = I("cond", r15, t8, e), s = I("args", r15, t8, e), a = await e.functionMap[n].executeFunctionAsync(s, e.tensorArrayMap, e.tensorListMap), i = s.map((c) => c.id), p = await a[0].data(); - a.forEach((c) => { - !c.kept && i.indexOf(c.id) === -1 && c.dispose(); + let o = I("body", r16, e, t10), n = I("cond", r16, e, t10), s = I("args", r16, e, t10), a = await t10.functionMap[n].executeFunctionAsync(s, t10.tensorArrayMap, t10.tensorListMap), i = s.map((l) => l.id), p = await a[0].data(); + a.forEach((l) => { + !l.kept && i.indexOf(l.id) === -1 && l.dispose(); }); let u = s; for (; p[0]; ) { - let c = u; - u = await e.functionMap[o].executeFunctionAsync(u, e.tensorArrayMap, e.tensorListMap); - let l = u.map((d) => d.id); - c.forEach((d) => { - !d.kept && i.indexOf(d.id) === -1 && l.indexOf(d.id) === -1 && d.dispose(); + let l = u; + u = await t10.functionMap[o].executeFunctionAsync(u, t10.tensorArrayMap, t10.tensorListMap); + let c = u.map((d) => d.id); + l.forEach((d) => { + !d.kept && i.indexOf(d.id) === -1 && c.indexOf(d.id) === -1 && d.dispose(); }); - let m = await e.functionMap[n].executeFunctionAsync(u, e.tensorArrayMap, e.tensorListMap); + let m = await t10.functionMap[n].executeFunctionAsync(u, t10.tensorArrayMap, t10.tensorListMap); p = await m[0].data(), m.forEach((d) => { - !d.kept && i.indexOf(d.id) === -1 && l.indexOf(d.id) === -1 && d.dispose(); + !d.kept && i.indexOf(d.id) === -1 && c.indexOf(d.id) === -1 && d.dispose(); }); } return u; } case "LoopCond": { - let o = I("pred", r15, t8, e); - return [Bs(o)]; + let o = I("pred", r16, e, t10); + return [js(o)]; } case "Switch": { - let o = I("pred", r15, t8, e), n = I("data", r15, t8, e); - return n.kept || (n = Bs(n)), (await o.data())[0] ? [void 0, n] : [n, void 0]; + let o = I("pred", r16, e, t10), n = I("data", r16, e, t10); + return n.kept || (n = js(n)), (await o.data())[0] ? [void 0, n] : [n, void 0]; } case "Merge": { - let o = r15.inputNames.find((n) => Bt(n, t8, e) !== void 0); + let o = r16.inputNames.find((n) => Vt(n, e, t10) !== void 0); if (o) { - let n = Bt(o, t8, e); - return [Bs(n)]; + let n = Vt(o, e, t10); + return [js(n)]; } return; } case "Enter": { - let o = I("frameName", r15, t8, e), n = I("tensor", r15, t8, e); - return e.enterFrame(o), [Bs(n)]; + let o = I("frameName", r16, e, t10), n = I("tensor", r16, e, t10); + return t10.enterFrame(o), [js(n)]; } case "Exit": { - let o = I("tensor", r15, t8, e); - return e.exitFrame(), [Bs(o)]; + let o = I("tensor", r16, e, t10); + return t10.exitFrame(), [js(o)]; } case "NextIteration": { - let o = I("tensor", r15, t8, e); - return e.nextIteration(), [Bs(o)]; + let o = I("tensor", r16, e, t10); + return t10.nextIteration(), [js(o)]; } case "TensorArrayV3": { - let o = I("size", r15, t8, e), n = I("dtype", r15, t8, e), s = I("elementShape", r15, t8, e), a = I("dynamicSize", r15, t8, e), i = I("clearAfterRead", r15, t8, e), p = I("identicalElementShapes", r15, t8, e), u = I("name", r15, t8, e), c = new Sf(u, n, o, s, p, a, i); - return e.addTensorArray(c), [c.idTensor, ke(1)]; + let o = I("size", r16, e, t10), n = I("dtype", r16, e, t10), s = I("elementShape", r16, e, t10), a = I("dynamicSize", r16, e, t10), i = I("clearAfterRead", r16, e, t10), p = I("identicalElementShapes", r16, e, t10), u = I("name", r16, e, t10), l = new Af(u, n, o, s, p, a, i); + return t10.addTensorArray(l), [l.idTensor, ke(1)]; } case "TensorArrayWriteV3": { - let o = I("tensorArrayId", r15, t8, e), n = I("index", r15, t8, e), s = I("tensor", r15, t8, e), a = e.getTensorArray(o.id); + let o = I("tensorArrayId", r16, e, t10), n = I("index", r16, e, t10), s = I("tensor", r16, e, t10), a = t10.getTensorArray(o.id); return a.write(n, s), [a.idTensor]; } case "TensorArrayReadV3": { - let o = I("tensorArrayId", r15, t8, e), n = I("index", r15, t8, e); - return [e.getTensorArray(o.id).read(n)]; + let o = I("tensorArrayId", r16, e, t10), n = I("index", r16, e, t10); + return [t10.getTensorArray(o.id).read(n)]; } case "TensorArrayGatherV3": { - let o = I("tensorArrayId", r15, t8, e), n = I("indices", r15, t8, e), s = I("dtype", r15, t8, e); - return [e.getTensorArray(o.id).gather(n, s)]; + let o = I("tensorArrayId", r16, e, t10), n = I("indices", r16, e, t10), s = I("dtype", r16, e, t10); + return [t10.getTensorArray(o.id).gather(n, s)]; } case "TensorArrayScatterV3": { - let o = I("tensorArrayId", r15, t8, e), n = I("indices", r15, t8, e), s = I("tensor", r15, t8, e), a = e.getTensorArray(o.id); + let o = I("tensorArrayId", r16, e, t10), n = I("indices", r16, e, t10), s = I("tensor", r16, e, t10), a = t10.getTensorArray(o.id); return a.scatter(n, s), [a.idTensor]; } case "TensorArrayConcatV3": { - let o = I("tensorArrayId", r15, t8, e), n = e.getTensorArray(o.id), s = I("dtype", r15, t8, e); + let o = I("tensorArrayId", r16, e, t10), n = t10.getTensorArray(o.id), s = I("dtype", r16, e, t10); return [n.concat(s)]; } case "TensorArraySplitV3": { - let o = I("tensorArrayId", r15, t8, e), n = I("tensor", r15, t8, e), s = I("lengths", r15, t8, e), a = e.getTensorArray(o.id); + let o = I("tensorArrayId", r16, e, t10), n = I("tensor", r16, e, t10), s = I("lengths", r16, e, t10), a = t10.getTensorArray(o.id); return a.split(s, n), [a.idTensor]; } case "TensorArraySizeV3": { - let o = I("tensorArrayId", r15, t8, e), n = e.getTensorArray(o.id); + let o = I("tensorArrayId", r16, e, t10), n = t10.getTensorArray(o.id); return [ke(n.size(), "int32")]; } case "TensorArrayCloseV3": { - let o = I("tensorArrayId", r15, t8, e), n = e.getTensorArray(o.id); + let o = I("tensorArrayId", r16, e, t10), n = t10.getTensorArray(o.id); return n.clearAndClose(), [n.idTensor]; } case "TensorListSetItem": { - let o = I("tensorListId", r15, t8, e), n = I("index", r15, t8, e), s = I("tensor", r15, t8, e), a = e.getTensorList(o.id); + let o = I("tensorListId", r16, e, t10), n = I("index", r16, e, t10), s = I("tensor", r16, e, t10), a = t10.getTensorList(o.id); return a.setItem(n, s), [a.idTensor]; } case "TensorListGetItem": { - let o = I("tensorListId", r15, t8, e), n = I("index", r15, t8, e), s = I("elementShape", r15, t8, e), a = I("elementDType", r15, t8, e); - return [e.getTensorList(o.id).getItem(n, s, a)]; + let o = I("tensorListId", r16, e, t10), n = I("index", r16, e, t10), s = I("elementShape", r16, e, t10), a = I("elementDType", r16, e, t10); + return [t10.getTensorList(o.id).getItem(n, s, a)]; } case "TensorListScatterV2": case "TensorListScatter": { - let o = I("indices", r15, t8, e), n = I("tensor", r15, t8, e), s = I("elementShape", r15, t8, e), a = I("numElements", r15, t8, e), i = NT(n, o, s, a); - return e.addTensorList(i), [i.idTensor]; + let o = I("indices", r16, e, t10), n = I("tensor", r16, e, t10), s = I("elementShape", r16, e, t10), a = I("numElements", r16, e, t10), i = x_(n, o, s, a); + return t10.addTensorList(i), [i.idTensor]; } case "TensorListReserve": case "EmptyTensorList": { - let o = I("elementShape", r15, t8, e), n = I("elementDType", r15, t8, e), s; - r15.op === "TensorListReserve" ? s = "numElements" : s = "maxNumElements"; - let a = I(s, r15, t8, e), i = r15.op === "TensorListReserve" ? -1 : a, p = kT(o, n, a, i); - return e.addTensorList(p), [p.idTensor]; + let o = I("elementShape", r16, e, t10), n = I("elementDType", r16, e, t10), s; + r16.op === "TensorListReserve" ? s = "numElements" : s = "maxNumElements"; + let a = I(s, r16, e, t10), i = r16.op === "TensorListReserve" ? -1 : a, p = g_(o, n, a, i); + return t10.addTensorList(p), [p.idTensor]; } case "TensorListGather": { - let o = I("tensorListId", r15, t8, e), n = I("indices", r15, t8, e), s = I("elementShape", r15, t8, e), a = I("elementDType", r15, t8, e); - return [e.getTensorList(o.id).gather(n, a, s)]; + let o = I("tensorListId", r16, e, t10), n = I("indices", r16, e, t10), s = I("elementShape", r16, e, t10), a = I("elementDType", r16, e, t10); + return [t10.getTensorList(o.id).gather(n, a, s)]; } case "TensorListStack": { - let o = I("tensorListId", r15, t8, e), n = I("elementShape", r15, t8, e), s = I("elementDType", r15, t8, e), a = I("numElements", r15, t8, e); - return [e.getTensorList(o.id).stack(n, s, a)]; + let o = I("tensorListId", r16, e, t10), n = I("elementShape", r16, e, t10), s = I("elementDType", r16, e, t10), a = I("numElements", r16, e, t10); + return [t10.getTensorList(o.id).stack(n, s, a)]; } case "TensorListFromTensor": { - let o = I("tensor", r15, t8, e), n = I("elementShape", r15, t8, e), s = I("elementDType", r15, t8, e), a = vT(o, n, s); - return e.addTensorList(a), [a.idTensor]; + let o = I("tensor", r16, e, t10), n = I("elementShape", r16, e, t10), s = I("elementDType", r16, e, t10), a = h_(o, n, s); + return t10.addTensorList(a), [a.idTensor]; } case "TensorListConcat": case "TensorListConcatV2": { - let o = I("tensorListId", r15, t8, e), n = e.getTensorList(o.id), s = I("dtype", r15, t8, e), a = I("elementShape", r15, t8, e); + let o = I("tensorListId", r16, e, t10), n = t10.getTensorList(o.id), s = I("dtype", r16, e, t10), a = I("elementShape", r16, e, t10); return [n.concat(s, a)]; } case "TensorListPushBack": { - let o = I("tensorListId", r15, t8, e), n = I("tensor", r15, t8, e), s = e.getTensorList(o.id); + let o = I("tensorListId", r16, e, t10), n = I("tensor", r16, e, t10), s = t10.getTensorList(o.id); return s.pushBack(n), [s.idTensor]; } case "TensorListPopBack": { - let o = I("tensorListId", r15, t8, e), n = I("elementShape", r15, t8, e), s = I("elementDType", r15, t8, e); - return [e.getTensorList(o.id).popBack(n, s)]; + let o = I("tensorListId", r16, e, t10), n = I("elementShape", r16, e, t10), s = I("elementDType", r16, e, t10); + return [t10.getTensorList(o.id).popBack(n, s)]; } case "TensorListSplit": { - let o = I("tensor", r15, t8, e), n = I("elementShape", r15, t8, e), s = I("lengths", r15, t8, e), a = TT(o, s, n); - return e.addTensorList(a), [a.idTensor]; + let o = I("tensor", r16, e, t10), n = I("elementShape", r16, e, t10), s = I("lengths", r16, e, t10), a = y_(o, s, n); + return t10.addTensorList(a), [a.idTensor]; } case "TensorListLength": { - let o = I("tensorListId", r15, t8, e), n = e.getTensorList(o.id); + let o = I("tensorListId", r16, e, t10), n = t10.getTensorList(o.id); return [ke(n.size(), "int32")]; } case "TensorListResize": { - let o = I("tensorListId", r15, t8, e), n = I("size", r15, t8, e), a = e.getTensorList(o.id).resize(n); - return e.addTensorList(a), [a.idTensor]; + let o = I("tensorListId", r16, e, t10), n = I("size", r16, e, t10), a = t10.getTensorList(o.id).resize(n); + return t10.addTensorList(a), [a.idTensor]; } default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -function $T(r15, t8, e) { - let [o, n] = I("fusedOps", r15, t8, e), s = o === "biasadd", a = !s, i = n === "prelu", p = o === "fusedbatchnorm", u = I("numArgs", r15, t8, e); +function C_(r16, e, t10) { + let [o, n] = I("fusedOps", r16, e, t10), s = o === "biasadd", a = !s, i = n === "prelu", p = o === "fusedbatchnorm", u = I("numArgs", r16, e, t10); if (s) { if (i && u !== 2) throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha."); @@ -10658,219 +10750,219 @@ function $T(r15, t8, e) { } if (p) throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported"); - let c = I("strides", r15, t8, e), l = Al(r15, t8, e), m = I("dataFormat", r15, t8, e).toUpperCase(), d = I("dilations", r15, t8, e), [f, h] = I("args", r15, t8, e); + let l = I("strides", r16, e, t10), c = Wc(r16, e, t10), m = I("dataFormat", r16, e, t10).toUpperCase(), d = I("dilations", r16, e, t10), [f, h] = I("args", r16, e, t10); a && (h = f, f = void 0); - let g = I("leakyreluAlpha", r15, t8, e); - return { stride: c, pad: l, dataFormat: m, dilations: d, biasArg: f, preluArg: h, activationFunc: n, leakyreluAlpha: g }; + let g = I("leakyreluAlpha", r16, e, t10); + return { stride: l, pad: c, dataFormat: m, dilations: d, biasArg: f, preluArg: h, activationFunc: n, leakyreluAlpha: g }; } -var ET = (r15, t8, e, o = Je) => { - switch (r15.op) { +var w_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "Conv1D": { - let n = I("stride", r15, t8, e), s = I("pad", r15, t8, e), a = I("dataFormat", r15, t8, e).toUpperCase(), i = I("dilation", r15, t8, e); - return [o.conv1d(I("x", r15, t8, e), I("filter", r15, t8, e), n, s, a, i)]; + let n = I("stride", r16, e, t10), s = I("pad", r16, e, t10), a = I("dataFormat", r16, e, t10).toUpperCase(), i = I("dilation", r16, e, t10); + return [o.conv1d(I("x", r16, e, t10), I("filter", r16, e, t10), n, s, a, i)]; } case "Conv2D": { - let n = I("strides", r15, t8, e), s = Al(r15, t8, e), a = I("dataFormat", r15, t8, e).toUpperCase(), i = I("dilations", r15, t8, e); - return [o.conv2d(I("x", r15, t8, e), I("filter", r15, t8, e), [n[1], n[2]], s, a, [i[1], i[2]])]; + let n = I("strides", r16, e, t10), s = Wc(r16, e, t10), a = I("dataFormat", r16, e, t10).toUpperCase(), i = I("dilations", r16, e, t10); + return [o.conv2d(I("x", r16, e, t10), I("filter", r16, e, t10), [n[1], n[2]], s, a, [i[1], i[2]])]; } case "_FusedConv2D": { - let { stride: n, pad: s, dataFormat: a, dilations: i, biasArg: p, preluArg: u, activationFunc: c, leakyreluAlpha: l } = $T(r15, t8, e); - return [o.fused.conv2d({ x: I("x", r15, t8, e), filter: I("filter", r15, t8, e), strides: [n[1], n[2]], pad: s, dataFormat: a, dilations: [i[1], i[2]], bias: p, activation: c, preluActivationWeights: u, leakyreluAlpha: l })]; + let { stride: n, pad: s, dataFormat: a, dilations: i, biasArg: p, preluArg: u, activationFunc: l, leakyreluAlpha: c } = C_(r16, e, t10); + return [o.fused.conv2d({ x: I("x", r16, e, t10), filter: I("filter", r16, e, t10), strides: [n[1], n[2]], pad: s, dataFormat: a, dilations: [i[1], i[2]], bias: p, activation: l, preluActivationWeights: u, leakyreluAlpha: c })]; } case "FusedDepthwiseConv2dNative": { - let { stride: n, pad: s, dataFormat: a, dilations: i, biasArg: p, preluArg: u, activationFunc: c, leakyreluAlpha: l } = $T(r15, t8, e); - return [o.fused.depthwiseConv2d({ x: I("x", r15, t8, e), filter: I("filter", r15, t8, e), strides: [n[1], n[2]], pad: s, dataFormat: a, dilations: [i[1], i[2]], bias: p, activation: c, preluActivationWeights: u, leakyreluAlpha: l })]; + let { stride: n, pad: s, dataFormat: a, dilations: i, biasArg: p, preluArg: u, activationFunc: l, leakyreluAlpha: c } = C_(r16, e, t10); + return [o.fused.depthwiseConv2d({ x: I("x", r16, e, t10), filter: I("filter", r16, e, t10), strides: [n[1], n[2]], pad: s, dataFormat: a, dilations: [i[1], i[2]], bias: p, activation: l, preluActivationWeights: u, leakyreluAlpha: c })]; } case "Conv2DBackpropInput": case "Conv2dTranspose": { - let n = I("outputShape", r15, t8, e), s = I("strides", r15, t8, e), a = Al(r15, t8, e); - return [o.conv2dTranspose(I("x", r15, t8, e), I("filter", r15, t8, e), n, [s[1], s[2]], a)]; + let n = I("outputShape", r16, e, t10), s = I("strides", r16, e, t10), a = Wc(r16, e, t10); + return [o.conv2dTranspose(I("x", r16, e, t10), I("filter", r16, e, t10), n, [s[1], s[2]], a)]; } case "DepthwiseConv2dNative": case "DepthwiseConv2d": { - let n = I("strides", r15, t8, e), s = Al(r15, t8, e), a = I("dilations", r15, t8, e), i = I("dataFormat", r15, t8, e).toUpperCase(); - return [o.depthwiseConv2d(I("input", r15, t8, e), I("filter", r15, t8, e), [n[1], n[2]], s, i, [a[1], a[2]])]; + let n = I("strides", r16, e, t10), s = Wc(r16, e, t10), a = I("dilations", r16, e, t10), i = I("dataFormat", r16, e, t10).toUpperCase(); + return [o.depthwiseConv2d(I("input", r16, e, t10), I("filter", r16, e, t10), [n[1], n[2]], s, i, [a[1], a[2]])]; } case "Conv3D": { - let n = I("strides", r15, t8, e), s = I("pad", r15, t8, e), a = I("dataFormat", r15, t8, e).toUpperCase(), i = I("dilations", r15, t8, e); - return [o.conv3d(I("x", r15, t8, e), I("filter", r15, t8, e), [n[1], n[2], n[3]], s, a, [i[1], i[2], i[3]])]; + let n = I("strides", r16, e, t10), s = I("pad", r16, e, t10), a = I("dataFormat", r16, e, t10).toUpperCase(), i = I("dilations", r16, e, t10); + return [o.conv3d(I("x", r16, e, t10), I("filter", r16, e, t10), [n[1], n[2], n[3]], s, a, [i[1], i[2], i[3]])]; } case "AvgPool": { - let n = I("strides", r15, t8, e), s = I("pad", r15, t8, e), a = I("kernelSize", r15, t8, e); - return [o.avgPool(I("x", r15, t8, e), [a[1], a[2]], [n[1], n[2]], s)]; + let n = I("strides", r16, e, t10), s = I("pad", r16, e, t10), a = I("kernelSize", r16, e, t10); + return [o.avgPool(I("x", r16, e, t10), [a[1], a[2]], [n[1], n[2]], s)]; } case "MaxPool": { - let n = I("strides", r15, t8, e), s = I("pad", r15, t8, e), a = I("kernelSize", r15, t8, e); - return [o.maxPool(I("x", r15, t8, e), [a[1], a[2]], [n[1], n[2]], s)]; + let n = I("strides", r16, e, t10), s = I("pad", r16, e, t10), a = I("kernelSize", r16, e, t10); + return [o.maxPool(I("x", r16, e, t10), [a[1], a[2]], [n[1], n[2]], s)]; } case "MaxPoolWithArgmax": { - let n = I("strides", r15, t8, e), s = I("pad", r15, t8, e), a = I("kernelSize", r15, t8, e), i = I("includeBatchInIndex", r15, t8, e), { result: p, indexes: u } = o.maxPoolWithArgmax(I("x", r15, t8, e), [a[1], a[2]], [n[1], n[2]], s, i); + let n = I("strides", r16, e, t10), s = I("pad", r16, e, t10), a = I("kernelSize", r16, e, t10), i = I("includeBatchInIndex", r16, e, t10), { result: p, indexes: u } = o.maxPoolWithArgmax(I("x", r16, e, t10), [a[1], a[2]], [n[1], n[2]], s, i); return [p, u]; } case "AvgPool3D": { - let n = I("strides", r15, t8, e), s = I("pad", r15, t8, e), a = I("kernelSize", r15, t8, e); - return [o.avgPool3d(I("x", r15, t8, e), [a[1], a[2], a[3]], [n[1], n[2], n[3]], s)]; + let n = I("strides", r16, e, t10), s = I("pad", r16, e, t10), a = I("kernelSize", r16, e, t10); + return [o.avgPool3d(I("x", r16, e, t10), [a[1], a[2], a[3]], [n[1], n[2], n[3]], s)]; } case "MaxPool3D": { - let n = I("strides", r15, t8, e), s = I("pad", r15, t8, e), a = I("kernelSize", r15, t8, e); - return [o.maxPool3d(I("x", r15, t8, e), [a[1], a[2], a[3]], [n[1], n[2], n[3]], s)]; + let n = I("strides", r16, e, t10), s = I("pad", r16, e, t10), a = I("kernelSize", r16, e, t10); + return [o.maxPool3d(I("x", r16, e, t10), [a[1], a[2], a[3]], [n[1], n[2], n[3]], s)]; } case "Dilation2D": { - let n = I("strides", r15, t8, e), s = I("pad", r15, t8, e), a = I("dilations", r15, t8, e), i = n[1], p = n[2], u = a[1], c = a[2]; - return [o.dilation2d(I("x", r15, t8, e), I("filter", r15, t8, e), [i, p], s, [u, c], "NHWC")]; + let n = I("strides", r16, e, t10), s = I("pad", r16, e, t10), a = I("dilations", r16, e, t10), i = n[1], p = n[2], u = a[1], l = a[2]; + return [o.dilation2d(I("x", r16, e, t10), I("filter", r16, e, t10), [i, p], s, [u, l], "NHWC")]; } default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var RT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var S_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "Fill": { - let n = I("shape", r15, t8, e), s = I("dtype", r15, t8, e), a = I("value", r15, t8, e); + let n = I("shape", r16, e, t10), s = I("dtype", r16, e, t10), a = I("value", r16, e, t10); return [o.fill(n, a, s)]; } case "LinSpace": { - let n = I("start", r15, t8, e), s = I("stop", r15, t8, e), a = I("num", r15, t8, e); + let n = I("start", r16, e, t10), s = I("stop", r16, e, t10), a = I("num", r16, e, t10); return [o.linspace(n, s, a)]; } case "Multinomial": { - let n = I("logits", r15, t8, e), s = I("numSamples", r15, t8, e), a = I("seed", r15, t8, e); + let n = I("logits", r16, e, t10), s = I("numSamples", r16, e, t10), a = I("seed", r16, e, t10); return [o.multinomial(n, s, a)]; } case "OneHot": { - let n = I("indices", r15, t8, e), s = I("depth", r15, t8, e), a = I("onValue", r15, t8, e), i = I("offValue", r15, t8, e), p = I("dtype", r15, t8, e); + let n = I("indices", r16, e, t10), s = I("depth", r16, e, t10), a = I("onValue", r16, e, t10), i = I("offValue", r16, e, t10), p = I("dtype", r16, e, t10); return [o.oneHot(n, s, a, i, p)]; } case "Ones": - return [o.ones(I("shape", r15, t8, e), I("dtype", r15, t8, e))]; + return [o.ones(I("shape", r16, e, t10), I("dtype", r16, e, t10))]; case "OnesLike": - return [o.onesLike(I("x", r15, t8, e))]; + return [o.onesLike(I("x", r16, e, t10))]; case "RandomStandardNormal": - return [o.randomStandardNormal(I("shape", r15, t8, e), I("dtype", r15, t8, e), I("seed", r15, t8, e))]; + return [o.randomStandardNormal(I("shape", r16, e, t10), I("dtype", r16, e, t10), I("seed", r16, e, t10))]; case "RandomUniform": - return [o.randomUniform(I("shape", r15, t8, e), I("minval", r15, t8, e), I("maxval", r15, t8, e), I("dtype", r15, t8, e))]; + return [o.randomUniform(I("shape", r16, e, t10), I("minval", r16, e, t10), I("maxval", r16, e, t10), I("dtype", r16, e, t10))]; case "RandomUniformInt": - return [o.randomUniformInt(I("shape", r15, t8, e), I("minval", r15, t8, e), I("maxval", r15, t8, e), I("seed", r15, t8, e))]; + return [o.randomUniformInt(I("shape", r16, e, t10), I("minval", r16, e, t10), I("maxval", r16, e, t10), I("seed", r16, e, t10))]; case "Range": { - let n = I("start", r15, t8, e), s = I("stop", r15, t8, e), a = I("step", r15, t8, e); - return [o.range(n, s, a, I("dtype", r15, t8, e))]; + let n = I("start", r16, e, t10), s = I("stop", r16, e, t10), a = I("step", r16, e, t10); + return [o.range(n, s, a, I("dtype", r16, e, t10))]; } case "TruncatedNormal": { - let n = I("shape", r15, t8, e), s = I("mean", r15, t8, e), a = I("stdDev", r15, t8, e), i = I("seed", r15, t8, e); - return [o.truncatedNormal(n, s, a, I("dtype", r15, t8, e), i)]; + let n = I("shape", r16, e, t10), s = I("mean", r16, e, t10), a = I("stdDev", r16, e, t10), i = I("seed", r16, e, t10); + return [o.truncatedNormal(n, s, a, I("dtype", r16, e, t10), i)]; } case "Zeros": - return [o.zeros(I("shape", r15, t8, e), I("dtype", r15, t8, e))]; + return [o.zeros(I("shape", r16, e, t10), I("dtype", r16, e, t10))]; case "ZerosLike": - return [o.zerosLike(I("x", r15, t8, e))]; + return [o.zerosLike(I("x", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -function PS(r15, t8, e) { - let o = I("boxes", r15, t8, e), n = I("scores", r15, t8, e), s = I("maxOutputSize", r15, t8, e), a = I("iouThreshold", r15, t8, e), i = I("scoreThreshold", r15, t8, e), p = I("softNmsSigma", r15, t8, e); +function XS(r16, e, t10) { + let o = I("boxes", r16, e, t10), n = I("scores", r16, e, t10), s = I("maxOutputSize", r16, e, t10), a = I("iouThreshold", r16, e, t10), i = I("scoreThreshold", r16, e, t10), p = I("softNmsSigma", r16, e, t10); return { boxes: o, scores: n, maxOutputSize: s, iouThreshold: a, scoreThreshold: i, softNmsSigma: p }; } -var DT = async (r15, t8, e, o, n = Je) => { - switch (r15.op) { +var I_ = async (r16, e, t10, o, n = et) => { + switch (r16.op) { case "NonMaxSuppressionV5": { - let { boxes: s, scores: a, maxOutputSize: i, iouThreshold: p, scoreThreshold: u, softNmsSigma: c } = PS(r15, t8, e), l = await n.image.nonMaxSuppressionWithScoreAsync(s, a, i, p, u, c); - return [l.selectedIndices, l.selectedScores]; + let { boxes: s, scores: a, maxOutputSize: i, iouThreshold: p, scoreThreshold: u, softNmsSigma: l } = XS(r16, e, t10), c = await n.image.nonMaxSuppressionWithScoreAsync(s, a, i, p, u, l); + return [c.selectedIndices, c.selectedScores]; } case "NonMaxSuppressionV4": { - let { boxes: s, scores: a, maxOutputSize: i, iouThreshold: p, scoreThreshold: u } = PS(r15, t8, e), c = I("padToMaxOutputSize", r15, t8, e), l = await n.image.nonMaxSuppressionPaddedAsync(s, a, i, p, u, c); - return [l.selectedIndices, l.validOutputs]; + let { boxes: s, scores: a, maxOutputSize: i, iouThreshold: p, scoreThreshold: u } = XS(r16, e, t10), l = I("padToMaxOutputSize", r16, e, t10), c = await n.image.nonMaxSuppressionPaddedAsync(s, a, i, p, u, l); + return [c.selectedIndices, c.validOutputs]; } case "NonMaxSuppressionV3": case "NonMaxSuppressionV2": { - let { boxes: s, scores: a, maxOutputSize: i, iouThreshold: p, scoreThreshold: u } = PS(r15, t8, e); + let { boxes: s, scores: a, maxOutputSize: i, iouThreshold: p, scoreThreshold: u } = XS(r16, e, t10); return [await n.image.nonMaxSuppressionAsync(s, a, i, p, u)]; } case "Where": { - let s = n.cast(I("condition", r15, t8, e), "bool"), a = [await n.whereAsync(s)]; + let s = n.cast(I("condition", r16, e, t10), "bool"), a = [await n.whereAsync(s)]; return s.dispose(), a; } case "ListDiff": - return n.setdiff1dAsync(I("x", r15, t8, e), I("y", r15, t8, e)); + return n.setdiff1dAsync(I("x", r16, e, t10), I("y", r16, e, t10)); default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var AT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var v_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "LowerBound": { - let n = I("sortedSequence", r15, t8, e), s = I("values", r15, t8, e); + let n = I("sortedSequence", r16, e, t10), s = I("values", r16, e, t10); return [o.lowerBound(n, s)]; } case "TopKV2": { - let n = I("x", r15, t8, e), s = I("k", r15, t8, e), a = I("sorted", r15, t8, e), i = o.topk(n, s, a); + let n = I("x", r16, e, t10), s = I("k", r16, e, t10), a = I("sorted", r16, e, t10), i = o.topk(n, s, a); return [i.values, i.indices]; } case "UpperBound": { - let n = I("sortedSequence", r15, t8, e), s = I("values", r15, t8, e); + let n = I("sortedSequence", r16, e, t10), s = I("values", r16, e, t10); return [o.upperBound(n, s)]; } case "Unique": { - let n = I("x", r15, t8, e), s = o.unique(n); + let n = I("x", r16, e, t10), s = o.unique(n); return [s.values, s.indices]; } case "UniqueV2": { - let n = I("x", r15, t8, e), s = I("axis", r15, t8, e), a = o.unique(n, s); + let n = I("x", r16, e, t10), s = I("axis", r16, e, t10), a = o.unique(n, s); return [a.values, a.indices]; } default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var FT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var k_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "Const": - return t8[r15.name]; + return e[r16.name]; case "PlaceholderWithDefault": - let n = I("default", r15, t8, e); - return [Bt(r15.name, t8, e) || n]; + let n = I("default", r16, e, t10); + return [Vt(r16.name, e, t10) || n]; case "Placeholder": - return [Bt(r15.name, t8, e)]; + return [Vt(r16.name, e, t10)]; case "Identity": case "StopGradient": case "FakeQuantWithMinMaxVars": { - let c = I("x", r15, t8, e); - return [Bs(c)]; + let l = I("x", r16, e, t10); + return [js(l)]; } case "IdentityN": - return I("x", r15, t8, e).map((c) => Bs(c)); + return I("x", r16, e, t10).map((l) => js(l)); case "Snapshot": - let s = I("x", r15, t8, e); - return [Bs(s)]; + let s = I("x", r16, e, t10); + return [js(s)]; case "Shape": - return [o.tensor1d(I("x", r15, t8, e).shape, "int32")]; + return [o.tensor1d(I("x", r16, e, t10).shape, "int32")]; case "ShapeN": - return I("x", r15, t8, e).map((c) => o.tensor1d(c.shape)); + return I("x", r16, e, t10).map((l) => o.tensor1d(l.shape)); case "Size": - return [o.scalar(I("x", r15, t8, e).size, "int32")]; + return [o.scalar(I("x", r16, e, t10).size, "int32")]; case "Rank": - return [o.scalar(I("x", r15, t8, e).rank, "int32")]; + return [o.scalar(I("x", r16, e, t10).rank, "int32")]; case "NoOp": return [o.scalar(1)]; case "Print": - let a = I("x", r15, t8, e), i = I("data", r15, t8, e), p = I("message", r15, t8, e), u = I("summarize", r15, t8, e); + let a = I("x", r16, e, t10), i = I("data", r16, e, t10), p = I("message", r16, e, t10), u = I("summarize", r16, e, t10); console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."), console.log(p); - for (let c = 0; c < i.length; c++) - console.log(Array.prototype.slice.call(i[c].dataSync()).slice(0, u)); + for (let l = 0; l < i.length; l++) + console.log(Array.prototype.slice.call(i[l].dataSync()).slice(0, u)); return [a]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var If = class { +var Ff = class { get id() { return this.handle.id; } - constructor(t8, e) { - this.keyDType = t8, this.valueDType = e, this.handle = ke(0), this.tensorMap = /* @__PURE__ */ new Map(), Er(this.handle); + constructor(e, t10) { + this.keyDType = e, this.valueDType = t10, this.handle = ke(0), this.tensorMap = /* @__PURE__ */ new Map(), Fr(this.handle); } clearAndClose() { - this.tensorMap.forEach((t8) => t8.dispose()), this.tensorMap.clear(), this.handle.dispose(); + this.tensorMap.forEach((e) => e.dispose()), this.tensorMap.clear(), this.handle.dispose(); } size() { return this.tensorMap.size; @@ -10878,475 +10970,475 @@ var If = class { tensorSize() { return ke(this.size(), "int32"); } - async import(t8, e) { - this.checkKeyAndValueTensor(t8, e); - let o = await t8.data(); + async import(e, t10) { + this.checkKeyAndValueTensor(e, t10); + let o = await e.data(); return this.tensorMap.forEach((n) => n.dispose()), this.tensorMap.clear(), De(() => { - let n = mo(e), s = o.length, a = n.length; + let n = zo(t10), s = o.length, a = n.length; y.assert(s === a, () => `The number of elements doesn't match, keys has ${s} elements, the values has ${a} elements.`); for (let i = 0; i < s; i++) { let p = o[i], u = n[i]; - Er(u), this.tensorMap.set(p, u); + Fr(u), this.tensorMap.set(p, u); } return this.handle; }); } - async find(t8, e) { - this.checkKeyAndValueTensor(t8, e); - let o = await t8.data(); + async find(e, t10) { + this.checkKeyAndValueTensor(e, t10); + let o = await e.data(); return De(() => { let n = []; for (let s = 0; s < o.length; s++) { - let a = o[s], i = this.findWithDefault(a, e); + let a = o[s], i = this.findWithDefault(a, t10); n.push(i); } - return vr(n); + return Tr(n); }); } - findWithDefault(t8, e) { - let o = this.tensorMap.get(t8); - return o != null ? o : e; + findWithDefault(e, t10) { + let o = this.tensorMap.get(e); + return o != null ? o : t10; } - checkKeyAndValueTensor(t8, e) { - if (t8.dtype !== this.keyDType) - throw new Error(`Expect key dtype ${this.keyDType}, but got ${t8.dtype}`); - if (e.dtype !== this.valueDType) - throw new Error(`Expect value dtype ${this.valueDType}, but got ${e.dtype}`); + checkKeyAndValueTensor(e, t10) { + if (e.dtype !== this.keyDType) + throw new Error(`Expect key dtype ${this.keyDType}, but got ${e.dtype}`); + if (t10.dtype !== this.valueDType) + throw new Error(`Expect value dtype ${this.valueDType}, but got ${t10.dtype}`); } }; -var PT = async (r15, t8, e, o) => { - switch (r15.op) { +var N_ = async (r16, e, t10, o) => { + switch (r16.op) { case "HashTable": case "HashTableV2": { - let n = o.getHashTableHandleByName(r15.name); + let n = o.getHashTableHandleByName(r16.name); if (n != null) return [n]; { - let s = I("keyDType", r15, t8, e), a = I("valueDType", r15, t8, e), i = new If(s, a); - return o.addHashTable(r15.name, i), [i.handle]; + let s = I("keyDType", r16, e, t10), a = I("valueDType", r16, e, t10), i = new Ff(s, a); + return o.addHashTable(r16.name, i), [i.handle]; } } case "InitializeTable": case "InitializeTableV2": case "LookupTableImport": case "LookupTableImportV2": { - let n = I("tableHandle", r15, t8, e, o), s = I("keys", r15, t8, e), a = I("values", r15, t8, e); + let n = I("tableHandle", r16, e, t10, o), s = I("keys", r16, e, t10), a = I("values", r16, e, t10); return [await o.getHashTableById(n.id).import(s, a)]; } case "LookupTableFind": case "LookupTableFindV2": { - let n = I("tableHandle", r15, t8, e, o), s = I("keys", r15, t8, e), a = I("defaultValue", r15, t8, e); + let n = I("tableHandle", r16, e, t10, o), s = I("keys", r16, e, t10), a = I("defaultValue", r16, e, t10); return [await o.getHashTableById(n.id).find(s, a)]; } case "LookupTableSize": case "LookupTableSizeV2": { - let n = I("tableHandle", r15, t8, e, o); + let n = I("tableHandle", r16, e, t10, o); return [o.getHashTableById(n.id).tensorSize()]; } default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var OT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var T_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "ResizeBilinear": { - let n = I("images", r15, t8, e), s = I("size", r15, t8, e), a = I("alignCorners", r15, t8, e), i = I("halfPixelCenters", r15, t8, e); + let n = I("images", r16, e, t10), s = I("size", r16, e, t10), a = I("alignCorners", r16, e, t10), i = I("halfPixelCenters", r16, e, t10); return [o.image.resizeBilinear(n, [s[0], s[1]], a, i)]; } case "ResizeNearestNeighbor": { - let n = I("images", r15, t8, e), s = I("size", r15, t8, e), a = I("alignCorners", r15, t8, e), i = I("halfPixelCenters", r15, t8, e); + let n = I("images", r16, e, t10), s = I("size", r16, e, t10), a = I("alignCorners", r16, e, t10), i = I("halfPixelCenters", r16, e, t10); return [o.image.resizeNearestNeighbor(n, [s[0], s[1]], a, i)]; } case "CropAndResize": { - let n = I("image", r15, t8, e), s = I("boxes", r15, t8, e), a = I("boxInd", r15, t8, e), i = I("cropSize", r15, t8, e), p = I("method", r15, t8, e), u = I("extrapolationValue", r15, t8, e); + let n = I("image", r16, e, t10), s = I("boxes", r16, e, t10), a = I("boxInd", r16, e, t10), i = I("cropSize", r16, e, t10), p = I("method", r16, e, t10), u = I("extrapolationValue", r16, e, t10); return [o.image.cropAndResize(n, s, a, i, p, u)]; } case "ImageProjectiveTransformV3": { - let n = I("images", r15, t8, e), s = I("transforms", r15, t8, e), a = I("outputShape", r15, t8, e), i = I("fillValue", r15, t8, e), p = I("interpolation", r15, t8, e), u = I("fillMode", r15, t8, e); + let n = I("images", r16, e, t10), s = I("transforms", r16, e, t10), a = I("outputShape", r16, e, t10), i = I("fillValue", r16, e, t10), p = I("interpolation", r16, e, t10), u = I("fillMode", r16, e, t10); return [o.image.transform(n, s, p.toLowerCase(), u.toLowerCase(), i, a)]; } default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var MT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var __ = (r16, e, t10, o = et) => { + switch (r16.op) { case "Equal": - return [o.equal(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.equal(I("a", r16, e, t10), I("b", r16, e, t10))]; case "NotEqual": - return [o.notEqual(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.notEqual(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Greater": - return [o.greater(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.greater(I("a", r16, e, t10), I("b", r16, e, t10))]; case "GreaterEqual": - return [o.greaterEqual(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.greaterEqual(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Less": - return [o.less(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.less(I("a", r16, e, t10), I("b", r16, e, t10))]; case "LessEqual": - return [o.lessEqual(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.lessEqual(I("a", r16, e, t10), I("b", r16, e, t10))]; case "LogicalAnd": - return [o.logicalAnd(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.logicalAnd(I("a", r16, e, t10), I("b", r16, e, t10))]; case "LogicalNot": - return [o.logicalNot(I("a", r15, t8, e))]; + return [o.logicalNot(I("a", r16, e, t10))]; case "LogicalOr": - return [o.logicalOr(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.logicalOr(I("a", r16, e, t10), I("b", r16, e, t10))]; case "Select": case "SelectV2": - return [o.where(I("condition", r15, t8, e), I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.where(I("condition", r16, e, t10), I("a", r16, e, t10), I("b", r16, e, t10))]; case "BitwiseAnd": - return [o.bitwiseAnd(I("a", r15, t8, e), I("b", r15, t8, e))]; + return [o.bitwiseAnd(I("a", r16, e, t10), I("b", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var LT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var E_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "BatchMatMul": case "BatchMatMulV2": case "MatMul": - return [o.matMul(I("a", r15, t8, e), I("b", r15, t8, e), I("transposeA", r15, t8, e), I("transposeB", r15, t8, e))]; + return [o.matMul(I("a", r16, e, t10), I("b", r16, e, t10), I("transposeA", r16, e, t10), I("transposeB", r16, e, t10))]; case "Einsum": - return [o.einsum(I("equation", r15, t8, e), ...I("tensors", r15, t8, e))]; + return [o.einsum(I("equation", r16, e, t10), ...I("tensors", r16, e, t10))]; case "Transpose": - return [o.transpose(I("x", r15, t8, e), I("perm", r15, t8, e))]; + return [o.transpose(I("x", r16, e, t10), I("perm", r16, e, t10))]; case "_FusedMatMul": - let [n, s] = I("fusedOps", r15, t8, e), a = n === "biasadd", i = s === "prelu", p = I("numArgs", r15, t8, e), u = I("leakyreluAlpha", r15, t8, e); + let [n, s] = I("fusedOps", r16, e, t10), a = n === "biasadd", i = s === "prelu", p = I("numArgs", r16, e, t10), u = I("leakyreluAlpha", r16, e, t10); if (a) { if (i && p !== 2) throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha."); if (!i && p !== 1) throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias."); } - let [c, l] = I("args", r15, t8, e); - return [o.fused.matMul({ a: I("a", r15, t8, e), b: I("b", r15, t8, e), transposeA: I("transposeA", r15, t8, e), transposeB: I("transposeB", r15, t8, e), bias: c, activation: s, preluActivationWeights: l, leakyreluAlpha: u })]; + let [l, c] = I("args", r16, e, t10); + return [o.fused.matMul({ a: I("a", r16, e, t10), b: I("b", r16, e, t10), transposeA: I("transposeA", r16, e, t10), transposeB: I("transposeB", r16, e, t10), bias: l, activation: s, preluActivationWeights: c, leakyreluAlpha: u })]; case "MatrixBandPart": - return [o.linalg.bandPart(I("a", r15, t8, e), I("numLower", r15, t8, e), I("numUpper", r15, t8, e))]; + return [o.linalg.bandPart(I("a", r16, e, t10), I("numLower", r16, e, t10), I("numUpper", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var BT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var $_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "EuclideanNorm": - return [o.euclideanNorm(I("x", r15, t8, e), I("axis", r15, t8, e), I("keepDims", r15, t8, e))]; + return [o.euclideanNorm(I("x", r16, e, t10), I("axis", r16, e, t10), I("keepDims", r16, e, t10))]; case "FusedBatchNorm": case "FusedBatchNormV2": - return [o.batchNorm(I("x", r15, t8, e), I("mean", r15, t8, e), I("variance", r15, t8, e), I("offset", r15, t8, e), I("scale", r15, t8, e), I("epsilon", r15, t8, e))]; + return [o.batchNorm(I("x", r16, e, t10), I("mean", r16, e, t10), I("variance", r16, e, t10), I("offset", r16, e, t10), I("scale", r16, e, t10), I("epsilon", r16, e, t10))]; case "FusedBatchNormV3": - return [o.batchNorm(I("x", r15, t8, e), I("mean", r15, t8, e), I("variance", r15, t8, e), I("offset", r15, t8, e), I("scale", r15, t8, e), I("epsilon", r15, t8, e))]; + return [o.batchNorm(I("x", r16, e, t10), I("mean", r16, e, t10), I("variance", r16, e, t10), I("offset", r16, e, t10), I("scale", r16, e, t10), I("epsilon", r16, e, t10))]; case "LRN": - return [o.localResponseNormalization(I("x", r15, t8, e), I("radius", r15, t8, e), I("bias", r15, t8, e), I("alpha", r15, t8, e), I("beta", r15, t8, e))]; + return [o.localResponseNormalization(I("x", r16, e, t10), I("radius", r16, e, t10), I("bias", r16, e, t10), I("alpha", r16, e, t10), I("beta", r16, e, t10))]; case "Softmax": - return [o.softmax(I("x", r15, t8, e))]; + return [o.softmax(I("x", r16, e, t10))]; case "LogSoftmax": - return [o.logSoftmax(I("x", r15, t8, e))]; + return [o.logSoftmax(I("x", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var zT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var R_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "RaggedGather": { - let { outputNestedSplits: n, outputDenseValues: s } = o.raggedGather(I("paramsNestedSplits", r15, t8, e), I("paramsDenseValues", r15, t8, e), I("indices", r15, t8, e), I("outputRaggedRank", r15, t8, e)); + let { outputNestedSplits: n, outputDenseValues: s } = o.raggedGather(I("paramsNestedSplits", r16, e, t10), I("paramsDenseValues", r16, e, t10), I("indices", r16, e, t10), I("outputRaggedRank", r16, e, t10)); return n.concat(s); } case "RaggedRange": { - let { rtNestedSplits: n, rtDenseValues: s } = o.raggedRange(I("starts", r15, t8, e), I("limits", r15, t8, e), I("splits", r15, t8, e)); + let { rtNestedSplits: n, rtDenseValues: s } = o.raggedRange(I("starts", r16, e, t10), I("limits", r16, e, t10), I("splits", r16, e, t10)); return [n, s]; } case "RaggedTensorToTensor": - return [o.raggedTensorToTensor(I("shape", r15, t8, e), I("values", r15, t8, e), I("defaultValue", r15, t8, e), I("rowPartitionTensors", r15, t8, e), I("rowPartitionTypes", r15, t8, e))]; + return [o.raggedTensorToTensor(I("shape", r16, e, t10), I("values", r16, e, t10), I("defaultValue", r16, e, t10), I("rowPartitionTensors", r16, e, t10), I("rowPartitionTypes", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var VT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var D_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "Max": { - let i = I("axis", r15, t8, e), p = I("keepDims", r15, t8, e); - return [o.max(I("x", r15, t8, e), i, p)]; + let i = I("axis", r16, e, t10), p = I("keepDims", r16, e, t10); + return [o.max(I("x", r16, e, t10), i, p)]; } case "Mean": { - let i = I("axis", r15, t8, e), p = I("keepDims", r15, t8, e); - return [o.mean(I("x", r15, t8, e), i, p)]; + let i = I("axis", r16, e, t10), p = I("keepDims", r16, e, t10); + return [o.mean(I("x", r16, e, t10), i, p)]; } case "Min": { - let i = I("axis", r15, t8, e), p = I("keepDims", r15, t8, e); - return [o.min(I("x", r15, t8, e), i, p)]; + let i = I("axis", r16, e, t10), p = I("keepDims", r16, e, t10); + return [o.min(I("x", r16, e, t10), i, p)]; } case "Sum": { - let i = I("axis", r15, t8, e), p = I("keepDims", r15, t8, e); - return [o.sum(I("x", r15, t8, e), i, p)]; + let i = I("axis", r16, e, t10), p = I("keepDims", r16, e, t10); + return [o.sum(I("x", r16, e, t10), i, p)]; } case "All": { - let i = I("axis", r15, t8, e), p = I("keepDims", r15, t8, e); - return [o.all(I("x", r15, t8, e), i, p)]; + let i = I("axis", r16, e, t10), p = I("keepDims", r16, e, t10); + return [o.all(I("x", r16, e, t10), i, p)]; } case "Any": { - let i = I("axis", r15, t8, e), p = I("keepDims", r15, t8, e); - return [o.any(I("x", r15, t8, e), i, p)]; + let i = I("axis", r16, e, t10), p = I("keepDims", r16, e, t10); + return [o.any(I("x", r16, e, t10), i, p)]; } case "ArgMax": { - let i = I("axis", r15, t8, e); - return [o.argMax(I("x", r15, t8, e), i)]; + let i = I("axis", r16, e, t10); + return [o.argMax(I("x", r16, e, t10), i)]; } case "ArgMin": { - let i = I("axis", r15, t8, e); - return [o.argMin(I("x", r15, t8, e), i)]; + let i = I("axis", r16, e, t10); + return [o.argMin(I("x", r16, e, t10), i)]; } case "Prod": { - let i = I("axis", r15, t8, e), p = I("keepDims", r15, t8, e); - return [o.prod(I("x", r15, t8, e), i, p)]; + let i = I("axis", r16, e, t10), p = I("keepDims", r16, e, t10); + return [o.prod(I("x", r16, e, t10), i, p)]; } case "Cumprod": { - let i = I("axis", r15, t8, e), p = I("exclusive", r15, t8, e), u = I("reverse", r15, t8, e); - return [o.cumprod(I("x", r15, t8, e), i, p, u)]; + let i = I("axis", r16, e, t10), p = I("exclusive", r16, e, t10), u = I("reverse", r16, e, t10); + return [o.cumprod(I("x", r16, e, t10), i, p, u)]; } case "Cumsum": { - let i = I("axis", r15, t8, e), p = I("exclusive", r15, t8, e), u = I("reverse", r15, t8, e); - return [o.cumsum(I("x", r15, t8, e), i, p, u)]; + let i = I("axis", r16, e, t10), p = I("exclusive", r16, e, t10), u = I("reverse", r16, e, t10); + return [o.cumsum(I("x", r16, e, t10), i, p, u)]; } case "Bincount": - let n = I("x", r15, t8, e), s = I("weights", r15, t8, e), a = I("size", r15, t8, e); + let n = I("x", r16, e, t10), s = I("weights", r16, e, t10), a = I("size", r16, e, t10); return [o.bincount(n, s, a)]; case "DenseBincount": { - let i = I("x", r15, t8, e), p = I("weights", r15, t8, e), u = I("size", r15, t8, e), c = I("binaryOutput", r15, t8, e); - return [o.denseBincount(i, p, u, c)]; + let i = I("x", r16, e, t10), p = I("weights", r16, e, t10), u = I("size", r16, e, t10), l = I("binaryOutput", r16, e, t10); + return [o.denseBincount(i, p, u, l)]; } default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var WT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var A_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "ConcatV2": case "Concat": { - let n = I("n", r15, t8, e), s = I("axis", r15, t8, e), a = I("tensors", r15, t8, e); + let n = I("n", r16, e, t10), s = I("axis", r16, e, t10), a = I("tensors", r16, e, t10); return a = a.slice(0, n), [o.concat(a, s)]; } case "Gather": { - let n = I("x", r15, t8, e), s = I("indices", r15, t8, e); + let n = I("x", r16, e, t10), s = I("indices", r16, e, t10); return [o.gather(n, o.cast(s, "int32"), 0)]; } case "GatherV2": { - let n = I("axis", r15, t8, e), s = I("batchDims", r15, t8, e), a = I("x", r15, t8, e), i = I("indices", r15, t8, e); + let n = I("axis", r16, e, t10), s = I("batchDims", r16, e, t10), a = I("x", r16, e, t10), i = I("indices", r16, e, t10); return [o.gather(a, o.cast(i, "int32"), n, s)]; } case "Reverse": { - let n = I("dims", r15, t8, e), s = []; + let n = I("dims", r16, e, t10), s = []; for (let i = 0; i < n.length; i++) n[i] && s.push(i); - let a = I("x", r15, t8, e); + let a = I("x", r16, e, t10); return [o.reverse(a, s)]; } case "ReverseV2": { - let n = I("axis", r15, t8, e), s = I("x", r15, t8, e); + let n = I("axis", r16, e, t10), s = I("x", r16, e, t10); return [o.reverse(s, n)]; } case "Slice": { - let n = I("begin", r15, t8, e), s = I("size", r15, t8, e); - return [o.slice(I("x", r15, t8, e), n, s)]; + let n = I("begin", r16, e, t10), s = I("size", r16, e, t10); + return [o.slice(I("x", r16, e, t10), n, s)]; } case "StridedSlice": { - let n = I("begin", r15, t8, e), s = I("end", r15, t8, e), a = I("strides", r15, t8, e), i = I("beginMask", r15, t8, e), p = I("endMask", r15, t8, e), u = I("ellipsisMask", r15, t8, e), c = I("newAxisMask", r15, t8, e), l = I("shrinkAxisMask", r15, t8, e), m = I("x", r15, t8, e); - return [o.stridedSlice(m, n, s, a, i, p, u, c, l)]; + let n = I("begin", r16, e, t10), s = I("end", r16, e, t10), a = I("strides", r16, e, t10), i = I("beginMask", r16, e, t10), p = I("endMask", r16, e, t10), u = I("ellipsisMask", r16, e, t10), l = I("newAxisMask", r16, e, t10), c = I("shrinkAxisMask", r16, e, t10), m = I("x", r16, e, t10); + return [o.stridedSlice(m, n, s, a, i, p, u, l, c)]; } case "Pack": return De(() => { - let n = I("axis", r15, t8, e), s = I("tensors", r15, t8, e), a = s[0].shape, i = o.squeeze(s[0]).shape, p = s.map((u) => { - let c = y.arraysEqual(u.shape, a); - if (!c && !y.arraysEqual(o.squeeze(u).shape, i)) + let n = I("axis", r16, e, t10), s = I("tensors", r16, e, t10), a = s[0].shape, i = o.squeeze(s[0]).shape, p = s.map((u) => { + let l = y.arraysEqual(u.shape, a); + if (!l && !y.arraysEqual(o.squeeze(u).shape, i)) throw new Error("the input tensors shape does not match"); - return c ? u : o.reshape(u, a); + return l ? u : o.reshape(u, a); }); return [o.stack(p, n)]; }); case "Unpack": { - let n = I("axis", r15, t8, e), s = I("tensor", r15, t8, e); + let n = I("axis", r16, e, t10), s = I("tensor", r16, e, t10); return o.unstack(s, n); } case "Tile": { - let n = I("reps", r15, t8, e); - return [o.tile(I("x", r15, t8, e), n)]; + let n = I("reps", r16, e, t10); + return [o.tile(I("x", r16, e, t10), n)]; } case "Split": case "SplitV": { - let n = I("axis", r15, t8, e), s = I("numOrSizeSplits", r15, t8, e), a = I("x", r15, t8, e); + let n = I("axis", r16, e, t10), s = I("numOrSizeSplits", r16, e, t10), a = I("x", r16, e, t10); return o.split(a, s, n); } case "ScatterNd": { - let n = I("indices", r15, t8, e), s = I("values", r15, t8, e), a = I("shape", r15, t8, e); + let n = I("indices", r16, e, t10), s = I("values", r16, e, t10), a = I("shape", r16, e, t10); return [o.scatterND(n, s, a)]; } case "GatherNd": { - let n = I("x", r15, t8, e), s = I("indices", r15, t8, e); + let n = I("x", r16, e, t10), s = I("indices", r16, e, t10); return [o.gatherND(n, s)]; } case "SparseToDense": { - let n = I("sparseIndices", r15, t8, e), s = I("outputShape", r15, t8, e), a = I("sparseValues", r15, t8, e), i = I("defaultValue", r15, t8, e); + let n = I("sparseIndices", r16, e, t10), s = I("outputShape", r16, e, t10), a = I("sparseValues", r16, e, t10), i = I("defaultValue", r16, e, t10); return [o.sparseToDense(n, a, s, a.dtype === i.dtype ? i : o.cast(i, a.dtype))]; } case "TensorScatterUpdate": { - let n = I("indices", r15, t8, e), s = I("values", r15, t8, e), a = I("tensor", r15, t8, e); + let n = I("indices", r16, e, t10), s = I("values", r16, e, t10), a = I("tensor", r16, e, t10); return [o.tensorScatterUpdate(a, n, s)]; } default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var UT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var F_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "SparseFillEmptyRows": { - let { outputIndices: n, outputValues: s, emptyRowIndicator: a, reverseIndexMap: i } = o.sparse.sparseFillEmptyRows(I("indices", r15, t8, e), I("values", r15, t8, e), I("denseShape", r15, t8, e), I("defaultValue", r15, t8, e)); + let { outputIndices: n, outputValues: s, emptyRowIndicator: a, reverseIndexMap: i } = o.sparse.sparseFillEmptyRows(I("indices", r16, e, t10), I("values", r16, e, t10), I("denseShape", r16, e, t10), I("defaultValue", r16, e, t10)); return [n, s, a, i]; } case "SparseReshape": { - let { outputIndices: n, outputShape: s } = o.sparse.sparseReshape(I("inputIndices", r15, t8, e), I("inputShape", r15, t8, e), I("newShape", r15, t8, e)); + let { outputIndices: n, outputShape: s } = o.sparse.sparseReshape(I("inputIndices", r16, e, t10), I("inputShape", r16, e, t10), I("newShape", r16, e, t10)); return [n, s]; } case "SparseSegmentMean": - return [o.sparse.sparseSegmentMean(I("data", r15, t8, e), I("indices", r15, t8, e), I("segmentIds", r15, t8, e))]; + return [o.sparse.sparseSegmentMean(I("data", r16, e, t10), I("indices", r16, e, t10), I("segmentIds", r16, e, t10))]; case "SparseSegmentSum": - return [o.sparse.sparseSegmentSum(I("data", r15, t8, e), I("indices", r15, t8, e), I("segmentIds", r15, t8, e))]; + return [o.sparse.sparseSegmentSum(I("data", r16, e, t10), I("indices", r16, e, t10), I("segmentIds", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var GT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var P_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "FFT": - return [o.fft(I("x", r15, t8, e))]; + return [o.fft(I("x", r16, e, t10))]; case "IFFT": - return [o.ifft(I("x", r15, t8, e))]; + return [o.ifft(I("x", r16, e, t10))]; case "RFFT": - return [o.rfft(I("x", r15, t8, e))]; + return [o.rfft(I("x", r16, e, t10))]; case "IRFFT": - return [o.irfft(I("x", r15, t8, e))]; + return [o.irfft(I("x", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var HT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var O_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "StaticRegexReplace": - return [o.string.staticRegexReplace(I("input", r15, t8, e), I("pattern", r15, t8, e), I("rewrite", r15, t8, e), I("replaceGlobal", r15, t8, e))]; + return [o.string.staticRegexReplace(I("input", r16, e, t10), I("pattern", r16, e, t10), I("rewrite", r16, e, t10), I("replaceGlobal", r16, e, t10))]; case "StringNGrams": { - let { nGrams: n, nGramsSplits: s } = o.string.stringNGrams(I("data", r15, t8, e), I("dataSplits", r15, t8, e), I("separator", r15, t8, e), I("nGramWidths", r15, t8, e), I("leftPad", r15, t8, e), I("rightPad", r15, t8, e), I("padWidth", r15, t8, e), I("preserveShortSequences", r15, t8, e)); + let { nGrams: n, nGramsSplits: s } = o.string.stringNGrams(I("data", r16, e, t10), I("dataSplits", r16, e, t10), I("separator", r16, e, t10), I("nGramWidths", r16, e, t10), I("leftPad", r16, e, t10), I("rightPad", r16, e, t10), I("padWidth", r16, e, t10), I("preserveShortSequences", r16, e, t10)); return [n, s]; } case "StringSplit": { - let { indices: n, values: s, shape: a } = o.string.stringSplit(I("input", r15, t8, e), I("delimiter", r15, t8, e), I("skipEmpty", r15, t8, e)); + let { indices: n, values: s, shape: a } = o.string.stringSplit(I("input", r16, e, t10), I("delimiter", r16, e, t10), I("skipEmpty", r16, e, t10)); return [n, s, a]; } case "StringToHashBucketFast": - return [o.string.stringToHashBucketFast(I("input", r15, t8, e), I("numBuckets", r15, t8, e))]; + return [o.string.stringToHashBucketFast(I("input", r16, e, t10), I("numBuckets", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -var KT = (r15, t8, e, o = Je) => { - switch (r15.op) { +var M_ = (r16, e, t10, o = et) => { + switch (r16.op) { case "Cast": - return [o.cast(I("x", r15, t8, e), I("dtype", r15, t8, e))]; + return [o.cast(I("x", r16, e, t10), I("dtype", r16, e, t10))]; case "ExpandDims": { - let n = I("axis", r15, t8, e); - return [o.expandDims(I("x", r15, t8, e), n)]; + let n = I("axis", r16, e, t10); + return [o.expandDims(I("x", r16, e, t10), n)]; } case "Squeeze": { - let n = I("axis", r15, t8, e); - return [o.squeeze(I("x", r15, t8, e), n)]; + let n = I("axis", r16, e, t10); + return [o.squeeze(I("x", r16, e, t10), n)]; } case "Reshape": - return [o.reshape(I("x", r15, t8, e), I("shape", r15, t8, e))]; + return [o.reshape(I("x", r16, e, t10), I("shape", r16, e, t10))]; case "EnsureShape": - return [o.ensureShape(I("x", r15, t8, e), I("shape", r15, t8, e))]; + return [o.ensureShape(I("x", r16, e, t10), I("shape", r16, e, t10))]; case "MirrorPad": - return [o.mirrorPad(I("x", r15, t8, e), I("padding", r15, t8, e), I("mode", r15, t8, e))]; + return [o.mirrorPad(I("x", r16, e, t10), I("padding", r16, e, t10), I("mode", r16, e, t10))]; case "PadV2": case "Pad": - return [o.pad(I("x", r15, t8, e), I("padding", r15, t8, e), I("constantValue", r15, t8, e))]; + return [o.pad(I("x", r16, e, t10), I("padding", r16, e, t10), I("constantValue", r16, e, t10))]; case "SpaceToBatchND": { - let n = I("blockShape", r15, t8, e), s = I("paddings", r15, t8, e); - return [o.spaceToBatchND(I("x", r15, t8, e), n, s)]; + let n = I("blockShape", r16, e, t10), s = I("paddings", r16, e, t10); + return [o.spaceToBatchND(I("x", r16, e, t10), n, s)]; } case "BatchToSpaceND": { - let n = I("blockShape", r15, t8, e), s = I("crops", r15, t8, e); - return [o.batchToSpaceND(I("x", r15, t8, e), n, s)]; + let n = I("blockShape", r16, e, t10), s = I("crops", r16, e, t10); + return [o.batchToSpaceND(I("x", r16, e, t10), n, s)]; } case "DepthToSpace": { - let n = I("blockSize", r15, t8, e), s = I("dataFormat", r15, t8, e).toUpperCase(); - return [o.depthToSpace(I("x", r15, t8, e), n, s)]; + let n = I("blockSize", r16, e, t10), s = I("dataFormat", r16, e, t10).toUpperCase(); + return [o.depthToSpace(I("x", r16, e, t10), n, s)]; } case "BroadcastTo": - return [o.broadcastTo(I("x", r15, t8, e), I("shape", r15, t8, e))]; + return [o.broadcastTo(I("x", r16, e, t10), I("shape", r16, e, t10))]; case "BroadcastArgs": - return [o.broadcastArgs(I("s0", r15, t8, e), I("s1", r15, t8, e))]; + return [o.broadcastArgs(I("s0", r16, e, t10), I("s1", r16, e, t10))]; default: - throw TypeError(`Node type ${r15.op} is not implemented`); + throw TypeError(`Node type ${r16.op} is not implemented`); } }; -function OS(r15, t8, e, o, n = De) { +function YS(r16, e, t10, o, n = De) { let s = ((a, i, p) => { switch (a.category) { case "arithmetic": - return n(() => wT(a, i, p)); + return n(() => m_(a, i, p)); case "basic_math": - return n(() => ST(a, i, p)); + return n(() => d_(a, i, p)); case "control": - return _T(a, i, p); + return b_(a, i, p); case "convolution": - return n(() => ET(a, i, p)); + return n(() => w_(a, i, p)); case "creation": - return n(() => RT(a, i, p)); + return n(() => S_(a, i, p)); case "dynamic": - return DT(a, i, p); + return I_(a, i, p); case "evaluation": - return n(() => AT(a, i, p)); + return n(() => v_(a, i, p)); case "image": - return n(() => OT(a, i, p)); + return n(() => T_(a, i, p)); case "graph": - return n(() => FT(a, i, p)); + return n(() => k_(a, i, p)); case "logical": - return n(() => MT(a, i, p)); + return n(() => __(a, i, p)); case "matrices": - return n(() => LT(a, i, p)); + return n(() => E_(a, i, p)); case "normalization": - return n(() => BT(a, i, p)); + return n(() => $_(a, i, p)); case "ragged": - return n(() => zT(a, i, p)); + return n(() => R_(a, i, p)); case "reduction": - return n(() => VT(a, i, p)); + return n(() => D_(a, i, p)); case "slice_join": - return n(() => WT(a, i, p)); + return n(() => A_(a, i, p)); case "sparse": - return n(() => UT(a, i, p)); + return n(() => F_(a, i, p)); case "spectral": - return n(() => GT(a, i, p)); + return n(() => P_(a, i, p)); case "string": - return n(() => HT(a, i, p)); + return n(() => O_(a, i, p)); case "transformation": - return n(() => KT(a, i, p)); + return n(() => M_(a, i, p)); case "hash_table": - return PT(a, i, p, o); + return N_(a, i, p, o); case "custom": - let u = uf(a.op); + let u = bf(a.op); if (u && u.customExecutor) - return u.customExecutor(new Cf(a, i, p)); + return u.customExecutor(new Rf(a, i, p)); throw TypeError(`Custom op ${a.op} is not registered.`); default: throw TypeError(`Unknown op '${a.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`); } - })(r15, t8, e); + })(r16, e, t10); return y.isPromise(s) ? s.then((a) => [].concat(a)) : [].concat(s); } -var Pl = class { - constructor(t8 = {}, e = {}, o = {}, n = {}, s) { - this.weightMap = t8, this.tensorArrayMap = e, this.tensorListMap = o, this.functionMap = n, this.parseNodeNameCache = s, this.rootContext = { id: 0, frameName: "", iterationId: 0 }, this.contexts = [this.rootContext], this.lastId = 0, this.generateCurrentContextIds(); +var Gc = class { + constructor(e = {}, t10 = {}, o = {}, n = {}, s) { + this.weightMap = e, this.tensorArrayMap = t10, this.tensorListMap = o, this.functionMap = n, this.parseNodeNameCache = s, this.rootContext = { id: 0, frameName: "", iterationId: 0 }, this.contexts = [this.rootContext], this.lastId = 0, this.generateCurrentContextIds(); } - newFrame(t8, e) { - return { id: t8, frameName: e, iterationId: 0 }; + newFrame(e, t10) { + return { id: e, frameName: t10, iterationId: 0 }; } - set currentContext(t8) { - this.contexts !== t8 && (this.contexts = t8, this.generateCurrentContextIds()); + set currentContext(e) { + this.contexts !== e && (this.contexts = e, this.generateCurrentContextIds()); } get currentContext() { return this.contexts; @@ -11358,18 +11450,18 @@ var Pl = class { return this._currentContextIds; } generateCurrentContextIds() { - let t8 = []; - for (let e = 0; e < this.contexts.length - 1; e++) { - let o = this.contexts.slice(0, this.contexts.length - e); - t8.push(this.contextIdforContexts(o)); + let e = []; + for (let t10 = 0; t10 < this.contexts.length - 1; t10++) { + let o = this.contexts.slice(0, this.contexts.length - t10); + e.push(this.contextIdforContexts(o)); } - t8.push(""), this._currentContextIds = t8; + e.push(""), this._currentContextIds = e; } - contextIdforContexts(t8) { - return t8 ? t8.map((e) => e.id === 0 && e.iterationId === 0 ? "" : `${e.frameName}-${e.iterationId}`).join("/") : ""; + contextIdforContexts(e) { + return e ? e.map((t10) => t10.id === 0 && t10.iterationId === 0 ? "" : `${t10.frameName}-${t10.iterationId}`).join("/") : ""; } - enterFrame(t8) { - this.contexts && (this.lastId++, this.contexts = this.contexts.slice(), this.contexts.push(this.newFrame(this.lastId, t8)), this._currentContextIds.unshift(this.contextIdforContexts(this.contexts))); + 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) @@ -11380,130 +11472,130 @@ var Pl = class { nextIteration() { if (this.contexts && this.contexts.length > 0) { this.contexts = this.contexts.slice(), this.lastId++; - let t8 = Object.assign({}, this.contexts[this.contexts.length - 1]); - t8.iterationId += 1, t8.id = this.lastId, this.contexts.splice(-1, 1, t8), this._currentContextIds.splice(0, 1, this.contextIdforContexts(this.contexts)); + 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(t8) { - return this.weightMap[t8]; + getWeight(e) { + return this.weightMap[e]; } - addTensorArray(t8) { - this.tensorArrayMap[t8.id] = t8; + addTensorArray(e) { + this.tensorArrayMap[e.id] = e; } - getTensorArray(t8) { - return this.tensorArrayMap[t8]; + getTensorArray(e) { + return this.tensorArrayMap[e]; } - addTensorList(t8) { - this.tensorListMap[t8.id] = t8; + addTensorList(e) { + this.tensorListMap[e.id] = e; } - getTensorList(t8) { - return this.tensorListMap[t8]; + getTensorList(e) { + return this.tensorListMap[e]; } - dispose(t8) { - for (let e in this.tensorArrayMap) - this.tensorArrayMap[e].clearAndClose(t8); - for (let e in this.tensorListMap) - this.tensorListMap[e].clearAndClose(t8); + dispose(e) { + for (let t10 in this.tensorArrayMap) + this.tensorArrayMap[t10].clearAndClose(e); + for (let t10 in this.tensorListMap) + this.tensorListMap[t10].clearAndClose(e); } }; -function MS(r15, t8, e, o) { - let n = /* @__PURE__ */ new Set(), s = [], a = null, i = null, p = /* @__PURE__ */ new Set(), u = new Set(Object.keys(r15).map((m) => Nr(m)[0])); +function QS(r16, e, t10, o) { + let n = /* @__PURE__ */ new Set(), s = [], a = null, i = null, p = /* @__PURE__ */ new Set(), u = new Set(Object.keys(r16).map((m) => Er(m)[0])); o = o || []; - let c = new Set(o.map((m) => Nr(m.name)[0])), l = [...t8]; - for (; l.length > 0; ) { - let m = l.pop(); - if ((mu(m) || k8(m) || N8(m)) && a == null && (a = m, i = a.children.map((d) => d.name).filter((d) => n.has(d))), n.add(m.name), e[m.name] == null && !u.has(m.name) && !c.has(m.name)) { + let l = new Set(o.map((m) => Er(m.name)[0])), c = [...e]; + for (; c.length > 0; ) { + let m = c.pop(); + if ((wu(m) || ZY(m) || JY(m)) && a == null && (a = m, i = a.children.map((d) => d.name).filter((d) => n.has(d))), n.add(m.name), t10[m.name] == null && !u.has(m.name) && !l.has(m.name)) { if (m.inputs.length === 0) { s.push(m.name); continue; } m.inputs.forEach((d) => { - p.has(d.name) || (p.add(d.name), l.push(d)); + p.has(d.name) || (p.add(d.name), c.push(d)); }); } } - return { inputs: r15, outputs: t8, usedNodes: n, missingInputs: s, dynamicNode: a, syncInputs: i }; + return { inputs: r16, outputs: e, usedNodes: n, missingInputs: s, dynamicNode: a, syncInputs: i }; } -function qT(r15, t8) { - let { usedNodes: e, inputs: o } = t8, n = Object.keys(o).map((g) => Nr(g)[0]).map((g) => r15.nodes[g]), s = r15.initNodes || [], a = (g) => e.has(typeof g == "string" ? g : g.name); +function L_(r16, e) { + let { usedNodes: t10, inputs: o } = e, n = Object.keys(o).map((g) => Er(g)[0]).map((g) => r16.nodes[g]), s = r16.initNodes || [], a = (g) => t10.has(typeof g == "string" ? g : g.name); function i(g) { return [...new Map(g.map((x) => [x.name, x])).values()]; } - let p = i([...n, ...r15.weights, ...s]).filter(a), u = i([...p, ...Object.values(r15.nodes)]).filter(a), c = new Map(u.map((g) => [g.name, g])), l = {}; + let p = i([...n, ...r16.weights, ...s]).filter(a), u = i([...p, ...Object.values(r16.nodes)]).filter(a), l = new Map(u.map((g) => [g.name, g])), c = {}; for (let g of u) { - l[g.name] = l[g.name] || 0; + c[g.name] = c[g.name] || 0; for (let x of g.children) - a(x) || (l[x.name] = Number.POSITIVE_INFINITY), l[x.name] = (l[x.name] || 0) + 1; + a(x) || (c[x.name] = Number.POSITIVE_INFINITY), c[x.name] = (c[x.name] || 0) + 1; } - let m = Object.entries(l).filter(([, g]) => g === 0).map(([g]) => g), d = [...m]; + let m = Object.entries(c).filter(([, g]) => g === 0).map(([g]) => g), d = [...m]; for (; m.length > 0; ) { - let g = m.pop(), x = c.get(g); + let g = m.pop(), x = l.get(g); for (let b of x.children.filter(a)) - --l[b.name] === 0 && (d.push(b.name), m.push(b.name)); + --c[b.name] === 0 && (d.push(b.name), m.push(b.name)); } - let f = d.map((g) => c.get(g)), h = C8(f, p); - return w8(h, p), h; + let f = d.map((g) => l.get(g)), h = qY(f, p); + return jY(h, p), h; } -function C8(r15, t8) { - let e = new Map(r15.map((a) => [a.name, a])), o = t8.map((a) => a.name), n = new Set(o); +function qY(r16, e) { + let t10 = new Map(r16.map((a) => [a.name, a])), o = e.map((a) => a.name), n = new Set(o); for (; o.length > 0; ) { - let a = o.pop(), i = e.get(a); + let a = o.pop(), i = t10.get(a); for (let p of i.children) - !e.has(p.name) || n.has(p.name) || (n.add(p.name), o.push(p.name)); + !t10.has(p.name) || n.has(p.name) || (n.add(p.name), o.push(p.name)); } - return r15.filter((a) => n.has(a.name)); + return r16.filter((a) => n.has(a.name)); } -var fc = class extends Error { - constructor(t8) { - super(`NodesExecutionOrderError: ${t8}`); +var Sl = class extends Error { + constructor(e) { + super(`NodesExecutionOrderError: ${e}`); } }; -function w8(r15, t8) { - let e = new Map(r15.map((i, p) => [i.name, p])), o = new Set(t8.map((i) => i.name)), n = (i) => o.has(typeof i == "string" ? i : i.name), s = new Set(r15.map((i) => i.name)), a = (i) => s.has(typeof i == "string" ? i : i.name); - for (let i of r15) { +function jY(r16, e) { + let t10 = new Map(r16.map((i, p) => [i.name, p])), o = new Set(e.map((i) => i.name)), n = (i) => o.has(typeof i == "string" ? i : i.name), s = new Set(r16.map((i) => i.name)), a = (i) => s.has(typeof i == "string" ? i : i.name); + for (let i of r16) { for (let p of i.children.filter(a)) { - if (!e.has(p.name)) - throw new fc(`Child ${p.name} of node ${i.name} is unreachable.`); - if (e.get(i.name) > e.get(p.name)) - throw new fc(`Node ${i.name} is scheduled to run after its child ${p.name}.`); + if (!t10.has(p.name)) + throw new Sl(`Child ${p.name} of node ${i.name} is unreachable.`); + if (t10.get(i.name) > t10.get(p.name)) + throw new Sl(`Node ${i.name} is scheduled to run after its child ${p.name}.`); } if (!n(i)) for (let p of i.inputs) { - if (!e.has(p.name)) - throw new fc(`Input ${p.name} of node ${i.name} is unreachable.`); - if (e.get(p.name) > e.get(i.name)) - throw new fc(`Node ${i.name} is scheduled to run before its input ${p.name}.`); + if (!t10.has(p.name)) + throw new Sl(`Input ${p.name} of node ${i.name} is unreachable.`); + if (t10.get(p.name) > t10.get(i.name)) + throw new Sl(`Node ${i.name} is scheduled to run before its input ${p.name}.`); } } } -function jT(r15) { - let t8 = new Map(r15.map((i, p) => [i.name, p])), e = Number.MAX_SAFE_INTEGER, o = r15.map((i, p) => mu(i) ? e : p), n = (i) => { - let p = o[t8.get(i.name)]; +function B_(r16) { + let e = new Map(r16.map((i, p) => [i.name, p])), t10 = Number.MAX_SAFE_INTEGER, o = r16.map((i, p) => wu(i) ? t10 : p), n = (i) => { + let p = o[e.get(i.name)]; return p == null ? -1 : p; - }, s = r15.map((i, p) => i.children.map(n).reduce((u, c) => Math.max(u, c), o[p])), a = /* @__PURE__ */ new Map(); - for (let i = 0; i < r15.length; ++i) { + }, s = r16.map((i, p) => i.children.map(n).reduce((u, l) => Math.max(u, l), o[p])), a = /* @__PURE__ */ new Map(); + for (let i = 0; i < r16.length; ++i) { let p = s[i]; - if (p === e) + if (p === t10) continue; - let u = r15[i], c = r15[p]; - a.has(c.name) || a.set(c.name, []), a.get(c.name).push(u); + let u = r16[i], l = r16[p]; + a.has(l.name) || a.set(l.name, []), a.get(l.name).push(u); } return a; } -var S8 = /* @__PURE__ */ new Set(["Switch", "Merge", "Enter", "Exit", "NextIteration", "StatelessIf", "StatelessWhile", "if", "While"]); -var I8 = /* @__PURE__ */ new Set(["NonMaxSuppressionV2", "NonMaxSuppressionV3", "NonMaxSuppressionV5", "Where"]); -var v8 = /* @__PURE__ */ new Set(["HashTable", "HashTableV2", "LookupTableImport", "LookupTableImportV2", "LookupTableFind", "LookupTableFindV2", "LookupTableSize", "LookupTableSizeV2"]); -function mu(r15) { - return S8.has(r15.op); +var XY = /* @__PURE__ */ new Set(["Switch", "Merge", "Enter", "Exit", "NextIteration", "StatelessIf", "StatelessWhile", "if", "While"]); +var YY = /* @__PURE__ */ new Set(["NonMaxSuppressionV2", "NonMaxSuppressionV3", "NonMaxSuppressionV5", "Where"]); +var QY = /* @__PURE__ */ new Set(["HashTable", "HashTableV2", "LookupTableImport", "LookupTableImportV2", "LookupTableFind", "LookupTableFindV2", "LookupTableSize", "LookupTableSizeV2"]); +function wu(r16) { + return XY.has(r16.op); } -function k8(r15) { - return I8.has(r15.op); +function ZY(r16) { + return YY.has(r16.op); } -function N8(r15) { - return v8.has(r15.op); +function JY(r16) { + return QY.has(r16.op); } -var Ol = class r10 { +var Hc = class r10 { get weightIds() { return this.parent ? this.parent.weightIds : this._weightIds; } @@ -11513,211 +11605,211 @@ var Ol = class r10 { get weightMap() { return this.parent ? this.parent.weightMap : this._weightMap; } - set weightMap(t8) { - let e = Object.keys(t8).map((o) => t8[o].map((n) => n.id)); - this._weightIds = [].concat(...e), this._weightMap = t8; + set weightMap(e) { + let t10 = Object.keys(e).map((o) => e[o].map((n) => n.id)); + this._weightIds = [].concat(...t10), this._weightMap = e; } - set resourceManager(t8) { - this._resourceManager = t8; + set resourceManager(e) { + this._resourceManager = e; } get inputs() { - return this._inputs.map((t8) => ({ name: t8.name, shape: t8.attrParams.shape ? t8.attrParams.shape.value : void 0, dtype: t8.attrParams.dtype ? t8.attrParams.dtype.value : void 0 })); + 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((t8) => ({ name: t8.name, shape: t8.attrParams.shape ? t8.attrParams.shape.value : void 0, dtype: t8.attrParams.dtype ? t8.attrParams.dtype.value : void 0 })); + 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((t8) => t8.signatureKey || t8.name); + return this._inputs.map((e) => e.signatureKey || e.name); } get outputNodes() { - return this._outputs.map((t8) => { - let e = t8.signatureKey || t8.name; - return t8.defaultOutput ? `${e}:${t8.defaultOutput}` : e; + return this._outputs.map((e) => { + let t10 = e.signatureKey || e.name; + return e.defaultOutput ? `${t10}:${e.defaultOutput}` : t10; }); } get functions() { - return Object.keys(this._functions).reduce((t8, e) => (t8[e] = this._functions[e].signature, t8), {}); + return Object.keys(this._functions).reduce((e, t10) => (e[t10] = this._functions[t10].signature, e), {}); } - constructor(t8, e) { - this.graph = t8, this.parent = e, this.compiledMap = /* @__PURE__ */ new Map(), this.parseNodeNameCache = /* @__PURE__ */ new Map(), this._weightMap = {}, this.SEPARATOR = ",", this._functions = {}, this._functionExecutorMap = {}, this.keepIntermediateTensors = false, this._outputs = t8.outputs, this._inputs = t8.inputs, this._initNodes = t8.initNodes, this._signature = t8.signature, this._functions = t8.functions, t8.functions != null && Object.keys(t8.functions).forEach((o) => { - this._functionExecutorMap[o] = new r10(t8.functions[o], this); + constructor(e, t10) { + this.graph = e, this.parent = t10, this.compiledMap = /* @__PURE__ */ new Map(), this.parseNodeNameCache = /* @__PURE__ */ new Map(), this._weightMap = {}, this.SEPARATOR = ",", this._functions = {}, this._functionExecutorMap = {}, this.keepIntermediateTensors = false, 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((o) => { + this._functionExecutorMap[o] = new r10(e.functions[o], this); }); } - getCompilationKey(t8, e) { - let o = t8.map((s) => s.name).sort(), n = e.map((s) => s.name).sort(); + getCompilationKey(e, t10) { + let o = e.map((s) => s.name).sort(), n = t10.map((s) => s.name).sort(); return o.join(this.SEPARATOR) + "--" + n.join(this.SEPARATOR); } - compile(t8, e) { - let o = MS(t8, e, this.weightMap, this._initNodes), { missingInputs: n, dynamicNode: s, syncInputs: a } = o; + compile(e, t10) { + let o = QS(e, t10, this.weightMap, this._initNodes), { missingInputs: n, dynamicNode: s, syncInputs: a } = o; if (s != null) throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`); if (n.length > 0) { - let u = e.map((l) => l.name), c = Object.keys(t8); - throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${c}]. Missing the following inputs: [${n}]`); + let u = t10.map((c) => c.name), l = Object.keys(e); + throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${l}]. Missing the following inputs: [${n}]`); } - let i = qT(this.graph, o), p = jT(i); + let i = L_(this.graph, o), p = B_(i); return { orderedNodes: i, nodeLiveUntilMap: p }; } - cloneAndKeepTensor(t8) { - if (t8 == null) + cloneAndKeepTensor(e) { + if (e == null) return null; - let e = t8.clone(); - return Er(e), e; + let t10 = e.clone(); + return Fr(t10), t10; } - cloneTensorList(t8) { - return t8 ? t8.map((o) => this.cloneAndKeepTensor(o)) : null; + cloneTensorList(e) { + return e ? e.map((o) => this.cloneAndKeepTensor(o)) : null; } - cloneTensorMap(t8) { - return Object.fromEntries(Object.entries(t8).map(([e, o]) => [e, this.cloneTensorList(o)])); + cloneTensorMap(e) { + return Object.fromEntries(Object.entries(e).map(([t10, o]) => [t10, this.cloneTensorList(o)])); } - execute(t8, e) { - this.disposeIntermediateTensors(), t8 = this.mapInputs(t8); - let o = Object.keys(t8).sort(); - this.checkInputs(t8), this.checkInputShapeAndType(t8), e = this.mapOutputs(e), this.checkOutputs(e); - let n = o.map((m) => this.graph.nodes[Nr(m)[0]]), s = e.map((m) => Nr(m)[0]), a = new Set(s), i = s.map((m) => this.graph.nodes[m]); + execute(e, t10) { + this.disposeIntermediateTensors(), e = this.mapInputs(e); + let o = Object.keys(e).sort(); + this.checkInputs(e), this.checkInputShapeAndType(e), t10 = this.mapOutputs(t10), this.checkOutputs(t10); + let n = o.map((m) => this.graph.nodes[Er(m)[0]]), s = t10.map((m) => Er(m)[0]), a = new Set(s), i = s.map((m) => this.graph.nodes[m]); i.length === 0 && (i = this._outputs); let p = this.getCompilationKey(n, i), u = this.compiledMap.get(p); - u == null && (u = this.compile(t8, i), this.compiledMap.set(p, u)); + u == null && (u = this.compile(e, i), this.compiledMap.set(p, u)); try { this.keepIntermediateTensors = A().getBool("KEEP_INTERMEDIATE_TENSORS"); } catch (m) { this.keepIntermediateTensors = false, console.warn(m.message); } - let c = {}, l = {}; + let l = {}, c = {}; return De(() => { - let m = new Pl(this.weightMap, c, l, this.functionExecutorMap, this.parseNodeNameCache), d = Object.assign({}, this.weightMap); - this.keepIntermediateTensors && (this.clonedTensorsMap = this.cloneTensorMap(this.weightMap)), Object.keys(t8).forEach((x) => { - let [b, C] = Nr(x, m), S = []; - S[C] = t8[x], d[b] = S, this.keepIntermediateTensors && (this.clonedTensorsMap[b] = this.cloneTensorList(S)); + let m = new Gc(this.weightMap, l, c, this.functionExecutorMap, this.parseNodeNameCache), d = Object.assign({}, this.weightMap); + this.keepIntermediateTensors && (this.clonedTensorsMap = this.cloneTensorMap(this.weightMap)), Object.keys(e).forEach((x) => { + let [b, w] = Er(x, m), S = []; + S[w] = e[x], d[b] = S, this.keepIntermediateTensors && (this.clonedTensorsMap[b] = this.cloneTensorList(S)); }); let f = this.getFrozenTensorIds(d), { orderedNodes: h, nodeLiveUntilMap: g } = u; for (let x of h) { if (d[x.name]) continue; - let b = OS(x, d, m, this._resourceManager); + let b = YS(x, d, m, this._resourceManager); if (y.isPromise(b)) throw new Error(`The execution of the op '${x.op}' returned a promise. Please use model.executeAsync() instead.`); d[x.name] = b, this.keepIntermediateTensors && (this.clonedTensorsMap[x.name] = this.cloneTensorList(b)), this.checkTensorForDisposalWithNodeLiveUntilInfo(x, d, m, f, a, g.get(x.name)); } - return this.parent == null && m.dispose(f), e.map((x) => Bt(x, d, m)); + return this.parent == null && m.dispose(f), t10.map((x) => Vt(x, d, m)); }); } - getFrozenTensorIds(t8) { - let e = [].concat.apply([], Object.keys(t8).map((o) => t8[o]).map((o) => o.map((n) => n.id))); - return new Set(e); + getFrozenTensorIds(e) { + let t10 = [].concat.apply([], Object.keys(e).map((o) => e[o]).map((o) => o.map((n) => n.id))); + return new Set(t10); } - checkTensorForDisposal(t8, e, o, n, s, a, i) { - if (!(mu(e) || a.has(t8))) { - for (let p of o[t8]) - p != null && (i[p.id] = (i[p.id] || 0) + e.children.length); - for (let p of e.inputs) { - if (mu(p)) + checkTensorForDisposal(e, t10, o, n, s, a, i) { + if (!(wu(t10) || a.has(e))) { + for (let p of o[e]) + p != null && (i[p.id] = (i[p.id] || 0) + t10.children.length); + for (let p of t10.inputs) { + if (wu(p)) continue; - let u = fS(p.name, o, n); + let u = _S(p.name, o, n); if (u != null) - for (let c of u) { - if (!c || c.kept || s.has(c.id)) + for (let l of u) { + if (!l || l.kept || s.has(l.id)) continue; - let l = i[c.id]; - l === 1 ? (c.dispose(), delete i[c.id]) : l != null && i[c.id]--; + let c = i[l.id]; + c === 1 ? (l.dispose(), delete i[l.id]) : c != null && i[l.id]--; } } } } - checkTensorForDisposalWithNodeLiveUntilInfo(t8, e, o, n, s, a) { + checkTensorForDisposalWithNodeLiveUntilInfo(e, t10, o, n, s, a) { function i(p) { - return mu(p) || s.has(p.name); + return wu(p) || s.has(p.name); } - if (!(mu(t8) || a == null)) + if (!(wu(e) || a == null)) for (let p of a) { if (i(p)) continue; - let u = fS(p.name, e, o); - for (let c of u) - !c || c.kept || n.has(c.id) || c.dispose(); + let u = _S(p.name, t10, o); + for (let l of u) + !l || l.kept || n.has(l.id) || l.dispose(); } } - async executeAsync(t8, e) { - return this._executeAsync(t8, e); + async executeAsync(e, t10) { + return this._executeAsync(e, t10); } disposeIntermediateTensors() { - this.clonedTensorsMap && (Object.values(this.clonedTensorsMap).forEach((t8) => { - for (let e of t8) - e && !e.isDisposed && e.dispose(); + this.clonedTensorsMap && (Object.values(this.clonedTensorsMap).forEach((e) => { + for (let t10 of e) + t10 && !t10.isDisposed && t10.dispose(); }), this.clonedTensorsMap = null); } getIntermediateTensors() { return this.clonedTensorsMap; } - async _executeAsync(t8, e, o = false, n = {}, s = {}) { - this.disposeIntermediateTensors(), o || (t8 = this.mapInputs(t8), this.checkInputs(t8), this.checkInputShapeAndType(t8), e = this.mapOutputs(e), this.checkOutputs(e)); + async _executeAsync(e, t10, o = false, n = {}, s = {}) { + this.disposeIntermediateTensors(), o || (e = this.mapInputs(e), this.checkInputs(e), this.checkInputShapeAndType(e), t10 = this.mapOutputs(t10), this.checkOutputs(t10)); try { this.keepIntermediateTensors = A().getBool("KEEP_INTERMEDIATE_TENSORS"); } catch (m) { this.keepIntermediateTensors = false, console.warn(m.message); } - let a = new Pl(this.weightMap, n, s, this.functionExecutorMap, this.parseNodeNameCache); + let a = new Gc(this.weightMap, n, s, this.functionExecutorMap, this.parseNodeNameCache); this.keepIntermediateTensors && (this.clonedTensorsMap = this.cloneTensorMap(this.weightMap)); - let i = await this.executeWithControlFlow(t8, a, e, o), p = e.map((m) => Bt(m, i, a)), u = p.map((m) => m.id), c = Object.keys(t8).map((m) => t8[m].id), l = /* @__PURE__ */ new Set([...u, ...c, ...this.weightIds]); + let i = await this.executeWithControlFlow(e, a, t10, o), p = t10.map((m) => Vt(m, i, a)), u = p.map((m) => m.id), l = Object.keys(e).map((m) => e[m].id), c = /* @__PURE__ */ new Set([...u, ...l, ...this.weightIds]); return Object.values(i).forEach((m) => { m.forEach((d) => { - d && !d.isDisposed && !l.has(d.id) && d.dispose(); + d && !d.isDisposed && !c.has(d.id) && d.dispose(); }); - }), this.parent == null && a.dispose(l), p; + }), this.parent == null && a.dispose(c), p; } - async executeFunctionAsync(t8, e, o) { - let n = t8.reduce((s, a, i) => (s[this.inputs[i].name] = a, s), {}); - return this._executeAsync(n, this.outputNodes, true, e, o); + async executeFunctionAsync(e, t10, o) { + let n = e.reduce((s, a, i) => (s[this.inputs[i].name] = a, s), {}); + return this._executeAsync(n, this.outputNodes, true, t10, o); } - async executeWithControlFlow(t8, e, o, n) { - let s = Object.keys(t8), a = s.map((S) => this.graph.nodes[Nr(S)[0]]), i = o.map((S) => Nr(S)[0]), p = new Set(i), u = i.map((S) => this.graph.nodes[S]); + async executeWithControlFlow(e, t10, o, n) { + let s = Object.keys(e), a = s.map((S) => this.graph.nodes[Er(S)[0]]), i = o.map((S) => Er(S)[0]), p = new Set(i), u = i.map((S) => this.graph.nodes[S]); u.length === 0 && (u = this._outputs); - let { usedNodes: c, missingInputs: l, dynamicNode: m, syncInputs: d } = MS(t8, u, this.weightMap, this._initNodes), f = [...a, ...this.graph.weights, ...this._initNodes || []].map((S) => ({ node: S, contexts: e.currentContext })), h = Object.assign({}, this.weightMap); - Object.keys(t8).forEach((S) => { - let [k, _] = Nr(S), E = []; - E[_] = t8[S], h[k] = E; + let { usedNodes: l, missingInputs: c, dynamicNode: m, syncInputs: d } = QS(e, u, this.weightMap, this._initNodes), f = [...a, ...this.graph.weights, ...this._initNodes || []].map((S) => ({ node: S, contexts: t10.currentContext })), h = Object.assign({}, this.weightMap); + Object.keys(e).forEach((S) => { + let [k, T] = Er(S), E = []; + E[T] = e[S], h[k] = E; }); let g = {}, x = this.getFrozenTensorIds(h), b = {}; for (; f.length > 0; ) { - let S = this.processStack(a, f, e, h, b, x, p, g, c); + let S = this.processStack(a, f, t10, h, b, x, p, g, l); await Promise.all(S); } m == null && !n && console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead."); - let C = u.filter((S) => !mu(S) && !Bt(S.name, h, e)).map((S) => S.name); - if (C.length > 0) { + let w = u.filter((S) => !wu(S) && !Vt(S.name, h, t10)).map((S) => S.name); + if (w.length > 0) { let S = ""; - throw m != null && (S = `Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`), new Error(`Cannot compute the outputs [${C}] from the provided inputs [${s}]. Consider providing the following inputs: [${l}]. ${S}`); + throw m != null && (S = `Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`), new Error(`Cannot compute the outputs [${w}] from the provided inputs [${s}]. Consider providing the following inputs: [${c}]. ${S}`); } return h; } - processStack(t8, e, o, n, s, a, i, p, u) { - let c = []; - for (; e.length > 0; ) { - let l = e.pop(); - o.currentContext = l.contexts; + processStack(e, t10, o, n, s, a, i, p, u) { + let l = []; + for (; t10.length > 0; ) { + let c = t10.pop(); + o.currentContext = c.contexts; let m = ""; - if (l.node.op === "Enter" && I("isConstant", l.node, n, o) && ([m] = Ls(l.node.name, o)), n[l.node.name] == null) { - let d = OS(l.node, n, o, this._resourceManager); - m || ([m] = Ls(l.node.name, o)); + if (c.node.op === "Enter" && I("isConstant", c.node, n, o) && ([m] = qs(c.node.name, o)), n[c.node.name] == null) { + let d = YS(c.node, n, o, this._resourceManager); + m || ([m] = qs(c.node.name, o)); let f = o.currentContext; - y.isPromise(d) ? c.push(d.then((h) => (n[m] = h, this.keepIntermediateTensors && (this.clonedTensorsMap[m] = this.cloneTensorList(h)), o.currentContext = f, this.checkTensorForDisposal(m, l.node, n, o, a, i, p), this.processChildNodes(l.node, e, o, n, s, u), h))) : (n[m] = d, this.keepIntermediateTensors && (this.clonedTensorsMap[m] = this.cloneTensorList(d)), this.checkTensorForDisposal(m, l.node, n, o, a, i, p), this.processChildNodes(l.node, e, o, n, s, u)); + y.isPromise(d) ? l.push(d.then((h) => (n[m] = h, this.keepIntermediateTensors && (this.clonedTensorsMap[m] = this.cloneTensorList(h)), o.currentContext = f, this.checkTensorForDisposal(m, c.node, n, o, a, i, p), this.processChildNodes(c.node, t10, o, n, s, u), h))) : (n[m] = d, this.keepIntermediateTensors && (this.clonedTensorsMap[m] = this.cloneTensorList(d)), this.checkTensorForDisposal(m, c.node, n, o, a, i, p), this.processChildNodes(c.node, t10, o, n, s, u)); } else - this.processChildNodes(l.node, e, o, n, s, u); + this.processChildNodes(c.node, t10, o, n, s, u); } - return c; + return l; } - processChildNodes(t8, e, o, n, s, a) { - t8.children.forEach((i) => { - let [p] = Ls(i.name, o); - s[p] || !a.has(i.name) || (i.op === "Merge" ? i.inputNames.some((u) => !!Bt(u, n, o)) && (s[p] = true, e.push({ contexts: o.currentContext, node: i })) : i.inputNames.every((u) => !!Bt(u, n, o)) && (s[p] = true, e.push({ contexts: o.currentContext, node: i }))); + processChildNodes(e, t10, o, n, s, a) { + e.children.forEach((i) => { + let [p] = qs(i.name, o); + s[p] || !a.has(i.name) || (i.op === "Merge" ? i.inputNames.some((u) => !!Vt(u, n, o)) && (s[p] = true, t10.push({ contexts: o.currentContext, node: i })) : i.inputNames.every((u) => !!Vt(u, n, o)) && (s[p] = true, t10.push({ contexts: o.currentContext, node: i }))); }); } dispose() { - Object.keys(this.weightMap).forEach((t8) => this.weightMap[t8].forEach((e) => e.dispose())); + Object.keys(this.weightMap).forEach((e) => this.weightMap[e].forEach((t10) => t10.dispose())); } - checkInputShapeAndType(t8) { - Object.keys(t8).forEach((e) => { - let o = t8[e], [n] = Nr(e), s = this.graph.nodes[n]; + checkInputShapeAndType(e) { + Object.keys(e).forEach((t10) => { + let o = e[t10], [n] = Er(t10), s = this.graph.nodes[n]; if (s.attrParams.shape && s.attrParams.shape.value) { let a = s.attrParams.shape.value, i = a.length === o.shape.length && o.shape.every((p, u) => a[u] === -1 || a[u] === p); y.assert(i, () => `The shape of dict['${s.name}'] provided in model.execute(dict) must be [${a}], but was [${o.shape}]`); @@ -11725,61 +11817,61 @@ var Ol = class r10 { s.attrParams.dtype && s.attrParams.dtype.value && y.assert(o.dtype === s.attrParams.dtype.value, () => `The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${o.dtype}`); }); } - mapInputs(t8) { - var e, o; + mapInputs(e) { + var t10, o; let n = {}; - for (let s in t8) { - let a = (o = (e = this._signature) === null || e === void 0 ? void 0 : e.inputs) === null || o === void 0 ? void 0 : o[s]; - a != null ? n[a.name] = t8[s] : n[s] = t8[s]; + for (let s in e) { + let a = (o = (t10 = this._signature) === null || t10 === void 0 ? void 0 : t10.inputs) === null || o === void 0 ? void 0 : o[s]; + a != null ? n[a.name] = e[s] : n[s] = e[s]; } return n; } - checkInputs(t8) { - let e = Object.keys(t8).filter((o) => { - let [n] = Nr(o); + checkInputs(e) { + let t10 = Object.keys(e).filter((o) => { + let [n] = Er(o); return this.graph.nodes[n] == null; }); - if (e.length > 0) - throw new Error(`The dict provided in model.execute(dict) has keys: [${e}] that are not part of graph`); + if (t10.length > 0) + throw new Error(`The dict provided in model.execute(dict) has keys: [${t10}] that are not part of graph`); } - mapOutputs(t8) { - return t8.map((e) => { + mapOutputs(e) { + return e.map((t10) => { var o, n; - let s = (n = (o = this._signature) === null || o === void 0 ? void 0 : o.outputs) === null || n === void 0 ? void 0 : n[e]; - return s != null ? s.name : e; + let s = (n = (o = this._signature) === null || o === void 0 ? void 0 : o.outputs) === null || n === void 0 ? void 0 : n[t10]; + return s != null ? s.name : t10; }, {}); } - checkOutputs(t8) { - t8.forEach((e) => { - let [o] = Nr(e); + checkOutputs(e) { + e.forEach((t10) => { + let [o] = Er(t10); if (!this.graph.nodes[o]) - throw new Error(`The output '${e}' is not found in the graph`); + throw new Error(`The output '${t10}' is not found in the graph`); }); } }; -var vf = class { - constructor(t8 = {}, e = {}) { - this.hashTableNameToHandle = t8, this.hashTableMap = e; +var Pf = class { + constructor(e = {}, t10 = {}) { + this.hashTableNameToHandle = e, this.hashTableMap = t10; } - addHashTable(t8, e) { - this.hashTableNameToHandle[t8] = e.handle, this.hashTableMap[e.id] = e; + addHashTable(e, t10) { + this.hashTableNameToHandle[e] = t10.handle, this.hashTableMap[t10.id] = t10; } - getHashTableHandleByName(t8) { - return this.hashTableNameToHandle[t8]; + getHashTableHandleByName(e) { + return this.hashTableNameToHandle[e]; } - getHashTableById(t8) { - return this.hashTableMap[t8]; + getHashTableById(e) { + return this.hashTableMap[e]; } dispose() { - for (let t8 in this.hashTableMap) - this.hashTableMap[t8].clearAndClose(), delete this.hashTableMap[t8]; - for (let t8 in this.hashTableNameToHandle) - this.hashTableNameToHandle[t8].dispose(), delete this.hashTableNameToHandle[t8]; + 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]; } }; -var T8 = "?tfjs-format=file"; -var _8 = "model.json"; -var Ml = class { +var e7 = "?tfjs-format=file"; +var t7 = "model.json"; +var Kc = class { get modelVersion() { return this.version; } @@ -11807,97 +11899,105 @@ var Ml = class { get modelStructuredOutputKeys() { return this.structuredOutputKeys; } - constructor(t8, e = {}, o = mi) { - this.modelUrl = t8, this.loadOptions = e, this.version = "n/a", this.io = o, e == null && (this.loadOptions = {}), this.resourceManager = new vf(); + constructor(e, t10 = {}, o = Si) { + this.modelUrl = e, this.loadOptions = t10, this.version = "n/a", this.io = o, t10 == null && (this.loadOptions = {}), this.resourceManager = new Pf(); } findIOHandler() { - let t8 = this.modelUrl; - if (t8.load != null) - this.handler = t8; + let e = this.modelUrl; + if (e.load != null) + this.handler = e; else if (this.loadOptions.requestInit != null) - this.handler = this.io.browserHTTPRequest(t8, this.loadOptions); + this.handler = this.io.browserHTTPRequest(e, this.loadOptions); else { - let e = this.io.getLoadHandlers(t8, this.loadOptions); - if (e.length === 0) - e.push(this.io.browserHTTPRequest(t8, this.loadOptions)); - else if (e.length > 1) - throw new Error(`Found more than one (${e.length}) load handlers for URL '${[t8]}'`); - this.handler = e[0]; + let t10 = this.io.getLoadHandlers(e, this.loadOptions); + if (t10.length === 0) + t10.push(this.io.browserHTTPRequest(e, this.loadOptions)); + else if (t10.length > 1) + throw new Error(`Found more than one (${t10.length}) load handlers for URL '${[e]}'`); + this.handler = t10[0]; } } 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 t8 = this.handler.load(); - return y.isPromise(t8) ? t8.then((e) => this.loadSync(e)) : this.loadSync(t8); - } - loadSync(t8) { - this.artifacts = t8; - let e = this.artifacts.modelTopology, o = this.artifacts.signature; + let e = this.handler.load(); + return y.isPromise(e) ? e.then((t10) => t10.getWeightStream == null ? this.loadSync(t10) : this.loadStreaming(t10)) : this.loadSync(e); + } + loadSync(e) { + let t10 = this.io.decodeWeights(e.weightData, e.weightSpecs); + return this.loadWithWeightMap(e, t10); + } + async loadStreaming(e) { + if (e.getWeightStream == null) + throw new Error("Model artifacts missing streamWeights function"); + let t10 = await gd(e.getWeightStream(), e.weightSpecs); + return this.loadWithWeightMap(e, t10); + } + loadWithWeightMap(e, t10) { + this.artifacts = e; + let o = this.artifacts.modelTopology, n = this.artifacts.signature; if (this.artifacts.userDefinedMetadata != null) { let s = this.artifacts.userDefinedMetadata; - s.signature != null && (o = s.signature), s.structuredOutputKeys != null && (this.structuredOutputKeys = s.structuredOutputKeys); + s.signature != null && (n = s.signature), s.structuredOutputKeys != null && (this.structuredOutputKeys = s.structuredOutputKeys); } - this.signature = o, this.version = `${e.versions.producer}.${e.versions.minConsumer}`; - let n = this.io.decodeWeights(this.artifacts.weightData, this.artifacts.weightSpecs); - if (this.executor = new Ol(Fl.Instance.transformGraph(e, this.signature)), this.executor.weightMap = this.convertTensorMapToTensorsMap(n), this.executor.resourceManager = this.resourceManager, t8.modelInitializer != null && t8.modelInitializer.node != null) { - let s = Fl.Instance.transformGraph(t8.modelInitializer); - this.initializer = new Ol(s), this.initializer.weightMap = this.executor.weightMap, this.initializer.resourceManager = this.resourceManager, this.initializerSignature = t8.initializerSignature; + if (this.signature = n, this.version = `${o.versions.producer}.${o.versions.minConsumer}`, this.executor = new Hc(Uc.Instance.transformGraph(o, this.signature)), this.executor.weightMap = this.convertTensorMapToTensorsMap(t10), this.executor.resourceManager = this.resourceManager, e.modelInitializer != null && e.modelInitializer.node != null) { + let s = Uc.Instance.transformGraph(e.modelInitializer); + this.initializer = new Hc(s), this.initializer.weightMap = this.executor.weightMap, this.initializer.resourceManager = this.resourceManager, this.initializerSignature = e.initializerSignature; } return true; } - async save(t8, e) { - if (typeof t8 == "string") { - let o = this.io.getSaveHandlers(t8); + async save(e, t10) { + if (typeof e == "string") { + let o = this.io.getSaveHandlers(e); if (o.length === 0) - throw new Error(`Cannot find any save handlers for URL '${t8}'`); + throw new Error(`Cannot find any save handlers for URL '${e}'`); if (o.length > 1) - throw new Error(`Found more than one (${o.length}) save handlers for URL '${t8}'`); - t8 = o[0]; + throw new Error(`Found more than one (${o.length}) save handlers for URL '${e}'`); + e = o[0]; } - if (t8.save == null) + if (e.save == null) throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined."); - return t8.save(this.artifacts); + return e.save(this.artifacts); } - addStructuredOutputNames(t8) { + addStructuredOutputNames(e) { if (this.structuredOutputKeys) { - let e = t8 instanceof mt ? [t8] : t8, o = {}; - return e.forEach((n, s) => o[this.structuredOutputKeys[s]] = n), o; + let t10 = e instanceof dt ? [e] : e, o = {}; + return t10.forEach((n, s) => o[this.structuredOutputKeys[s]] = n), o; } - return t8; + return e; } - predict(t8, e) { - let o = this.execute(t8, this.outputNodes); + predict(e, t10) { + let o = this.execute(e, this.outputNodes); return this.addStructuredOutputNames(o); } - async predictAsync(t8, e) { - let o = await this.executeAsync(t8, this.outputNodes); + async predictAsync(e, t10) { + let o = await this.executeAsync(e, this.outputNodes); return this.addStructuredOutputNames(o); } - normalizeInputs(t8) { - var e; - if (!(t8 instanceof mt) && !Array.isArray(t8)) { - let s = (e = this.signature) === null || e === void 0 ? void 0 : e.inputs; + normalizeInputs(e) { + var t10; + if (!(e instanceof dt) && !Array.isArray(e)) { + let s = (t10 = this.signature) === null || t10 === void 0 ? void 0 : t10.inputs; if (s != null) for (let a in s) { let i = s[a]; - i.resourceId != null && (t8[a] = this.resourceIdToCapturedInput[i.resourceId]); + i.resourceId != null && (e[a] = this.resourceIdToCapturedInput[i.resourceId]); } - return t8; + return e; } - t8 = Array.isArray(t8) ? t8 : [t8]; + e = Array.isArray(e) ? e : [e]; let o = Object.keys(this.resourceIdToCapturedInput).length; - if (t8.length + o !== this.inputNodes.length) - throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length - o} non-resource placeholders, while there are ${t8.length} input tensors provided.`); + if (e.length + o !== this.inputNodes.length) + throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length - o} non-resource placeholders, while there are ${e.length} input tensors provided.`); let n = 0; return this.inputNodes.reduce((s, a) => { var i, p, u; - let c = (u = (p = (i = this.signature) === null || i === void 0 ? void 0 : i.inputs) === null || p === void 0 ? void 0 : p[a]) === null || u === void 0 ? void 0 : u.resourceId; - return c != null ? s[a] = this.resourceIdToCapturedInput[c] : s[a] = t8[n++], s; + let l = (u = (p = (i = this.signature) === null || i === void 0 ? void 0 : i.inputs) === null || p === void 0 ? void 0 : p[a]) === null || u === void 0 ? void 0 : u.resourceId; + return l != null ? s[a] = this.resourceIdToCapturedInput[l] : s[a] = e[n++], s; }, {}); } - normalizeOutputs(t8) { - return t8 = t8 || this.outputNodes, Array.isArray(t8) ? t8 : [t8]; + normalizeOutputs(e) { + return e = e || this.outputNodes, Array.isArray(e) ? e : [e]; } executeInitializerGraph() { return this.initializer == null ? [] : this.initializerSignature == null ? this.initializer.execute({}, []) : this.initializer.execute({}, Object.keys(this.initializerSignature.outputs)); @@ -11905,23 +12005,23 @@ var Ml = class { async executeInitializerGraphAsync() { return this.initializer == null ? [] : this.initializerSignature == null ? this.initializer.executeAsync({}, []) : this.initializer.executeAsync({}, Object.keys(this.initializerSignature.outputs)); } - setResourceIdToCapturedInput(t8) { + setResourceIdToCapturedInput(e) { if (this.resourceIdToCapturedInput = {}, this.initializerSignature) { - let e = this.initializerSignature.outputs, o = Object.keys(e); + let t10 = this.initializerSignature.outputs, o = Object.keys(t10); for (let n = 0; n < o.length; n++) { - let s = o[n], a = e[s]; - this.resourceIdToCapturedInput[a.resourceId] = t8[n]; + let s = o[n], a = t10[s]; + this.resourceIdToCapturedInput[a.resourceId] = e[n]; } } } - execute(t8, e) { - this.resourceIdToCapturedInput == null && this.setResourceIdToCapturedInput(this.executeInitializerGraph()), t8 = this.normalizeInputs(t8), e = this.normalizeOutputs(e); - let o = this.executor.execute(t8, e); + execute(e, t10) { + this.resourceIdToCapturedInput == null && this.setResourceIdToCapturedInput(this.executeInitializerGraph()), e = this.normalizeInputs(e), t10 = this.normalizeOutputs(t10); + let o = this.executor.execute(e, t10); return o.length > 1 ? o : o[0]; } - async executeAsync(t8, e) { - this.resourceIdToCapturedInput == null && this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()), t8 = this.normalizeInputs(t8), e = this.normalizeOutputs(e); - let o = await this.executor.executeAsync(t8, e); + async executeAsync(e, t10) { + this.resourceIdToCapturedInput == null && this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()), e = this.normalizeInputs(e), t10 = this.normalizeOutputs(t10); + let o = await this.executor.executeAsync(e, t10); return o.length > 1 ? o : o[0]; } getIntermediateTensors() { @@ -11930,26 +12030,26 @@ var Ml = class { disposeIntermediateTensors() { this.executor.disposeIntermediateTensors(); } - convertTensorMapToTensorsMap(t8) { - return Object.keys(t8).reduce((e, o) => (e[o] = [t8[o]], e), {}); + convertTensorMapToTensorsMap(e) { + return Object.keys(e).reduce((t10, o) => (t10[o] = [e[o]], t10), {}); } dispose() { - this.executor.dispose(), this.initializer && (this.initializer.dispose(), this.resourceIdToCapturedInput && Ot(this.resourceIdToCapturedInput)), this.resourceManager.dispose(); + this.executor.dispose(), this.initializer && (this.initializer.dispose(), this.resourceIdToCapturedInput && Lt(this.resourceIdToCapturedInput)), this.resourceManager.dispose(); } }; -async function $8(r15, t8 = {}, e = mi) { - if (r15 == null) +async function r72(r16, e = {}, t10 = Si) { + if (r16 == null) throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model"); - t8 == null && (t8 = {}), t8.fromTFHub && typeof r15 == "string" && (r15 = R8(r15)); - let o = new Ml(r15, t8, e); + e == null && (e = {}), e.fromTFHub && typeof r16 == "string" && (r16 = n7(r16)); + let o = new Kc(r16, e, t10); return await o.load(), o; } -function E8(r15) { - if (r15 == null) +function o7(r16) { + if (r16 == null) throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model"); - let t8; - if (r15 instanceof Array) { - let [o, n] = r15; + let e; + if (r16 instanceof Array) { + let [o, n] = r16; if (!o) throw new Error("modelJSON must be the first element of the array"); if (!n || !(n instanceof ArrayBuffer)) @@ -11958,118 +12058,118 @@ function E8(r15) { throw new Error("Model JSON is missing 'modelTopology'"); if (!("weightsManifest" in o)) throw new Error("Model JSON is missing 'weightsManifest'"); - let s = mi.getWeightSpecs(o.weightsManifest), a = mi.getModelArtifactsForJSONSync(o, s, n); - t8 = mi.fromMemorySync(a); - } else if ("load" in r15) - t8 = r15; - else if ("modelTopology" in r15 && "weightSpecs" in r15 && "weightData" in r15) - t8 = mi.fromMemorySync(r15); + let s = Si.getWeightSpecs(o.weightsManifest), a = Si.getModelArtifactsForJSONSync(o, s, n); + e = Si.fromMemorySync(a); + } else if ("load" in r16) + e = r16; + else if ("modelTopology" in r16 && "weightSpecs" in r16 && "weightData" in r16) + e = Si.fromMemorySync(r16); else throw new Error("Unknown model format"); - let e = new Ml(t8); - return e.load(), e; + let t10 = new Kc(e); + return t10.load(), t10; } -function R8(r15) { - return r15.endsWith("/") || (r15 = r15 + "/"), `${r15}${_8}${T8}`; +function n7(r16) { + return r16.endsWith("/") || (r16 = r16 + "/"), `${r16}${t7}${e7}`; } -var D8 = "4.14.0"; -function Q(r15, t8) { - Array.isArray(r15) || (r15 = [r15]), r15.forEach((e) => { - e != null && y.assert(e.dtype !== "complex64", () => `${t8} does not support complex64 tensors in the CPU backend.`); +var s7 = "4.17.0"; +function Q(r16, e) { + Array.isArray(r16) || (r16 = [r16]), r16.forEach((t10) => { + t10 != null && y.assert(t10.dtype !== "complex64", () => `${e} does not support complex64 tensors in the CPU backend.`); }); } -var A8 = Vt.whereImpl; -var hc = class r11 extends so { +var a7 = Ut.whereImpl; +var Il = class r11 extends mo { nextDataId() { return r11.nextDataId++; } constructor() { - super(), this.blockSize = 48, this.firstUse = true, this.data = new Bo(this, ur()); + super(), this.blockSize = 48, this.firstUse = true, this.data = new mn(this, cr()); } - write(t8, e, o) { - this.firstUse && (this.firstUse = false, A().get("IS_NODE") && w.warn(` + write(e, t10, o) { + this.firstUse && (this.firstUse = false, A().get("IS_NODE") && C.warn(` ============================ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. ============================`)); let n = { id: this.nextDataId() }; - return this.data.set(n, { values: t8, dtype: o, refCount: 1 }), n; + return this.data.set(n, { values: e, dtype: o, refCount: 1 }), n; } - makeTensorInfo(t8, e, o) { + makeTensorInfo(e, t10, o) { let n; - if (e === "string" && o != null && o.length > 0 && y.isString(o[0])) { + if (t10 === "string" && o != null && o.length > 0 && y.isString(o[0])) { let s = o.map((a) => y.encodeString(a)); - n = this.write(s, t8, e); + n = this.write(s, e, t10); } else - n = this.write(o, t8, e); - return { dataId: n, shape: t8, dtype: e }; + n = this.write(o, e, t10); + return { dataId: n, shape: e, dtype: t10 }; } - refCount(t8) { - return this.data.has(t8) ? this.data.get(t8).refCount : 0; + refCount(e) { + return this.data.has(e) ? this.data.get(e).refCount : 0; } - incRef(t8) { - let e = this.data.get(t8); - e.refCount++; + incRef(e) { + let t10 = this.data.get(e); + t10.refCount++; } - decRef(t8) { - if (this.data.has(t8)) { - let e = this.data.get(t8); - e.refCount--; + decRef(e) { + if (this.data.has(e)) { + let t10 = this.data.get(e); + t10.refCount--; } } - move(t8, e, o, n, s) { - this.data.set(t8, { values: e, dtype: n, refCount: s }); + move(e, t10, o, n, s) { + this.data.set(e, { values: t10, dtype: n, refCount: s }); } numDataIds() { return this.data.numDataIds(); } - async read(t8) { - return this.readSync(t8); + async read(e) { + return this.readSync(e); } - readSync(t8) { - let { dtype: e, complexTensorInfos: o } = this.data.get(t8); - if (e === "complex64") { + readSync(e) { + let { dtype: t10, complexTensorInfos: o } = this.data.get(e); + if (t10 === "complex64") { let n = this.readSync(o.real.dataId), s = this.readSync(o.imag.dataId); - return w.mergeRealAndImagArrays(n, s); + return C.mergeRealAndImagArrays(n, s); } - return y.convertBackendValuesAndArrayBuffer(this.data.get(t8).values, e); + return y.convertBackendValuesAndArrayBuffer(this.data.get(e).values, t10); } - bufferSync(t8) { - let e = this.readSync(t8.dataId); - if (t8.dtype === "string") + bufferSync(e) { + let t10 = this.readSync(e.dataId); + if (e.dtype === "string") try { - let o = e.map((n) => y.decodeString(n)); - return me(t8.shape, t8.dtype, o); + let o = t10.map((n) => y.decodeString(n)); + return ie(e.shape, e.dtype, o); } catch (o) { throw new Error("Failed to decode encoded string bytes into utf-8"); } - return me(t8.shape, t8.dtype, e); + return ie(e.shape, e.dtype, t10); } - makeOutput(t8, e, o) { - return ur().makeTensorFromTensorInfo(this.makeTensorInfo(e, o, t8), this); + makeOutput(e, t10, o) { + return cr().makeTensorFromTensorInfo(this.makeTensorInfo(t10, o, e), this); } - disposeData(t8, e = false) { - if (this.data.has(t8)) { - if (this.data.get(t8).refCount--, !e && this.data.get(t8).refCount > 0) + disposeData(e, t10 = false) { + if (this.data.has(e)) { + if (this.data.get(e).refCount--, !t10 && this.data.get(e).refCount > 0) return false; - let { complexTensorInfos: o } = this.data.get(t8); - o != null && (this.disposeData(o.real.dataId, true), this.disposeData(o.imag.dataId, true)), this.data.delete(t8); + let { complexTensorInfos: o } = this.data.get(e); + o != null && (this.disposeData(o.real.dataId, true), this.disposeData(o.imag.dataId, true)), this.data.delete(e); } return true; } - disposeIntermediateTensorInfo(t8) { - this.disposeData(t8.dataId); + disposeIntermediateTensorInfo(e) { + this.disposeData(e.dataId); } - async time(t8) { - let e = y.now(); - return t8(), { kernelMs: y.now() - e }; + async time(e) { + let t10 = y.now(); + return e(), { kernelMs: y.now() - t10 }; } memory() { return { unreliable: true, reasons: ["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."] }; } - where(t8) { - Q([t8], "where"); - let e = this.readSync(t8.dataId); - return A8(t8.shape, e); + where(e) { + Q([e], "where"); + let t10 = this.readSync(e.dataId); + return a7(e.shape, t10); } dispose() { } @@ -12080,360 +12180,360 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram return super.epsilon(); } }; -hc.nextDataId = 0; -var wc = {}; -qe(wc, { addImpl: () => zS, bincountImpl: () => yc, bincountReduceImpl: () => kf, bitwiseAndImpl: () => VS, castImpl: () => BS, ceilImpl: () => WS, concatImpl: () => np, equalImpl: () => US, expImpl: () => HS, expm1Impl: () => qS, floorDivImpl: () => XS, floorImpl: () => jS, gatherNdImpl: () => Nf, gatherV2Impl: () => Tf, greaterEqualImpl: () => QS, greaterImpl: () => YS, lessEqualImpl: () => JS, lessImpl: () => ZS, linSpaceImpl: () => _f, logImpl: () => eI, maxImpl: () => $f, maximumImpl: () => tI, minimumImpl: () => rI, multiplyImpl: () => Ll, negImpl: () => oI, notEqualImpl: () => nI, prodImpl: () => sI, raggedGatherImpl: () => Ef, raggedRangeImpl: () => Rf, raggedTensorToTensorImpl: () => Df, rangeImpl: () => ap, rsqrtImpl: () => iI, scatterImpl: () => zs, sigmoidImpl: () => k_, simpleAbsImpl: () => LS, sliceImpl: () => ip, sparseFillEmptyRowsImpl: () => Af, sparseReshapeImpl: () => Ff, sparseSegmentReductionImpl: () => Cc, sqrtImpl: () => __, squaredDifferenceImpl: () => pI, staticRegexReplaceImpl: () => cI, stridedSliceImpl: () => Pf, stringNGramsImpl: () => up, stringSplitImpl: () => pp, stringToHashBucketFastImpl: () => cp, subImpl: () => mI, tileImpl: () => Of, topKImpl: () => Mf, transposeImpl: () => bc, uniqueImpl: () => lp }); -function LS(r15) { - let t8 = new Float32Array(r15.length); - for (let e = 0; e < r15.length; ++e) - t8[e] = Math.abs(r15[e]); - return t8; -} -var F8 = (r15) => { - let { x: t8 } = r15.inputs, e = r15.backend; - Q(t8, "abs"); - let o = new Float32Array(y.sizeFromShape(t8.shape)), n = e.data.get(t8.dataId).values; - return o = LS(n), e.makeOutput(o, t8.shape, t8.dtype); -}; -var XT = { kernelName: Xs, backendName: "cpu", kernelFunc: F8 }; -function ze(r15) { - return (t8, e, o, n, s) => { - let a = w.assertAndGetBroadcastShape(t8, e), i = a.length, p = y.computeStrides(a), u = y.sizeFromShape(a), c = y.getTypedArrayFromDType(s, u), l = t8.length, m = e.length, d = y.computeStrides(t8), f = y.computeStrides(e), h = w.getBroadcastDims(t8, a), g = w.getBroadcastDims(e, a); +Il.nextDataId = 0; +var Xf = {}; +qe(Xf, { addImpl: () => eI, bincountImpl: () => Nl, bincountReduceImpl: () => Of, bitwiseAndImpl: () => tI, castImpl: () => JS, ceilImpl: () => rI, concatImpl: () => mp, equalImpl: () => oI, expImpl: () => sI, expm1Impl: () => iI, floorDivImpl: () => pI, floorImpl: () => uI, gatherNdImpl: () => Mf, gatherV2Impl: () => Lf, greaterEqualImpl: () => cI, greaterImpl: () => lI, lessEqualImpl: () => dI, lessImpl: () => mI, linSpaceImpl: () => Bf, logImpl: () => fI, maxImpl: () => zf, maximumImpl: () => hI, minimumImpl: () => gI, multiplyImpl: () => qc, negImpl: () => xI, notEqualImpl: () => yI, prodImpl: () => bI, raggedGatherImpl: () => Vf, raggedRangeImpl: () => Wf, raggedTensorToTensorImpl: () => Uf, rangeImpl: () => fp, rsqrtImpl: () => wI, scatterImpl: () => Xs, sigmoidImpl: () => gE, simpleAbsImpl: () => ZS, sliceImpl: () => hp, sparseFillEmptyRowsImpl: () => Gf, sparseReshapeImpl: () => Hf, sparseSegmentReductionImpl: () => _l, sqrtImpl: () => bE, squaredDifferenceImpl: () => II, staticRegexReplaceImpl: () => vI, stridedSliceImpl: () => Kf, stringNGramsImpl: () => gp, stringSplitImpl: () => xp, stringToHashBucketFastImpl: () => yp, subImpl: () => NI, tileImpl: () => qf, topKImpl: () => jf, transposeImpl: () => Tl, uniqueImpl: () => bp }); +function ZS(r16) { + let e = new Float32Array(r16.length); + for (let t10 = 0; t10 < r16.length; ++t10) + e[t10] = Math.abs(r16[t10]); + return e; +} +var i7 = (r16) => { + let { x: e } = r16.inputs, t10 = r16.backend; + Q(e, "abs"); + let o = new Float32Array(y.sizeFromShape(e.shape)), n = t10.data.get(e.dataId).values; + return o = ZS(n), t10.makeOutput(o, e.shape, e.dtype); +}; +var z_ = { kernelName: fn, backendName: "cpu", kernelFunc: i7 }; +function Ve(r16) { + return (e, t10, o, n, s) => { + let a = C.assertAndGetBroadcastShape(e, t10), i = a.length, p = y.computeStrides(a), u = y.sizeFromShape(a), l = y.getTypedArrayFromDType(s, u), c = e.length, m = t10.length, d = y.computeStrides(e), f = y.computeStrides(t10), h = C.getBroadcastDims(e, a), g = C.getBroadcastDims(t10, a); if (h.length + g.length === 0) - for (let x = 0; x < c.length; ++x) - c[x] = r15(o[x % o.length], n[x % n.length]); + for (let x = 0; x < l.length; ++x) + l[x] = r16(o[x % o.length], n[x % n.length]); else - for (let x = 0; x < c.length; ++x) { - let b = y.indexToLoc(x, i, p), C = b.slice(-l); - h.forEach((E) => C[E] = 0); - let S = y.locToIndex(C, l, d), k = b.slice(-m); + for (let x = 0; x < l.length; ++x) { + let b = y.indexToLoc(x, i, p), w = b.slice(-c); + h.forEach((E) => w[E] = 0); + let S = y.locToIndex(w, c, d), k = b.slice(-m); g.forEach((E) => k[E] = 0); - let _ = y.locToIndex(k, m, f); - c[x] = r15(o[S], n[_]); + let T = y.locToIndex(k, m, f); + l[x] = r16(o[S], n[T]); } - return [c, a]; + return [l, a]; }; } -function Ht(r15) { - let { inputs: t8, backend: e } = r15, { real: o, imag: n } = t8, s = e.data.get(o.dataId).values, a = e.data.get(n.dataId).values, i = e.makeTensorInfo(o.shape, "complex64"), p = e.data.get(i.dataId); - return p.complexTensorInfos = { real: e.makeTensorInfo(o.shape, "float32", s), imag: e.makeTensorInfo(n.shape, "float32", a) }, i; +function qt(r16) { + let { inputs: e, backend: t10 } = r16, { real: o, imag: n } = e, s = t10.data.get(o.dataId).values, a = t10.data.get(n.dataId).values, i = t10.makeTensorInfo(o.shape, "complex64"), p = t10.data.get(i.dataId); + return p.complexTensorInfos = { real: t10.makeTensorInfo(o.shape, "float32", s), imag: t10.makeTensorInfo(n.shape, "float32", a) }, i; } -var YT = { kernelName: Ri, backendName: "cpu", kernelFunc: Ht }; -function gc(r15, t8, e = "float32") { - if (e === "complex64") { - let n = gc(r15, t8, "float32"), s = gc(r15, t8, "float32"); - return Ht({ inputs: { real: n, imag: s }, backend: r15 }); +var V_ = { kernelName: ei, backendName: "cpu", kernelFunc: qt }; +function vl(r16, e, t10 = "float32") { + if (t10 === "complex64") { + let n = vl(r16, e, "float32"), s = vl(r16, e, "float32"); + return qt({ inputs: { real: n, imag: s }, backend: r16 }); } - let o = y.makeZerosTypedArray(y.sizeFromShape(t8), e); - return r15.makeTensorInfo(t8, e, o); + let o = y.makeZerosTypedArray(y.sizeFromShape(e), t10); + return r16.makeTensorInfo(e, t10, o); } -function lr(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; - return e.incRef(o.dataId), { dataId: o.dataId, shape: o.shape, dtype: o.dtype }; +function fr(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; + return t10.incRef(o.dataId), { dataId: o.dataId, shape: o.shape, dtype: o.dtype }; } -var QT = { kernelName: Co, backendName: "cpu", kernelFunc: lr }; -function Eo(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = e.data.get(o.dataId).complexTensorInfos.real, s = e.data.get(n.dataId).values; - return e.makeTensorInfo(n.shape, n.dtype, s); +var W_ = { kernelName: vo, backendName: "cpu", kernelFunc: fr }; +function tn(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = t10.data.get(o.dataId).complexTensorInfos.real, s = t10.data.get(n.dataId).values; + return t10.makeTensorInfo(n.shape, n.dtype, s); } -var ZT = { kernelName: Gi, backendName: "cpu", kernelFunc: Eo }; -function BS(r15, t8, e, o) { +var U_ = { kernelName: si, backendName: "cpu", kernelFunc: tn }; +function JS(r16, e, t10, o) { if (o === "int32") { - let n = Int32Array.from(r15); - return [t8, "int32", n]; + let n = Int32Array.from(r16); + return [e, "int32", n]; } if (o === "bool") { - let n = y.toTypedArray([0], e), [s, a] = ze((i, p) => i !== p ? 1 : 0)(t8, [], r15, n, "bool"); + let n = y.toTypedArray([0], t10), [s, a] = Ve((i, p) => i !== p ? 1 : 0)(e, [], r16, n, "bool"); return [a, "bool", s]; } - throw new Error(`Error in Cast: failed to cast ${e} to ${o}`); + throw new Error(`Error in Cast: failed to cast ${t10} to ${o}`); } -function Ro(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { dtype: s } = o; +function rn(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dtype: s } = o; if (s === "complex64") { if (n.dtype === "complex64") - return lr({ inputs: { x: n }, backend: e }); - let c = gc(e, n.shape, n.dtype), l = Ro({ inputs: { x: n }, backend: e, attrs: { dtype: "float32" } }), m = Ht({ inputs: { real: l, imag: c }, backend: e }); - return e.disposeIntermediateTensorInfo(c), e.disposeIntermediateTensorInfo(l), m; + return fr({ inputs: { x: n }, backend: t10 }); + let l = vl(t10, n.shape, n.dtype), c = rn({ inputs: { x: n }, backend: t10, attrs: { dtype: "float32" } }), m = qt({ inputs: { real: c, imag: l }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(l), t10.disposeIntermediateTensorInfo(c), m; } if (n.dtype === "complex64") { - let c = Eo({ inputs: { input: n }, backend: e }), l = Ro({ inputs: { x: c }, backend: e, attrs: { dtype: s } }); - return e.disposeIntermediateTensorInfo(c), l; + let l = tn({ inputs: { input: n }, backend: t10 }), c = rn({ inputs: { x: l }, backend: t10, attrs: { dtype: s } }); + return t10.disposeIntermediateTensorInfo(l), c; } if (!y.hasEncodingLoss(n.dtype, s)) { - let c = lr({ inputs: { x: n }, backend: e }); - return { dataId: c.dataId, shape: c.shape, dtype: s }; + let l = fr({ inputs: { x: n }, backend: t10 }); + return { dataId: l.dataId, shape: l.shape, dtype: s }; } - let a = e.data.get(n.dataId).values, [i, p, u] = BS(a, n.shape, n.dtype, s); - return e.makeTensorInfo(i, p, u); + let a = t10.data.get(n.dataId).values, [i, p, u] = JS(a, n.shape, n.dtype, s); + return t10.makeTensorInfo(i, p, u); } -var JT = { kernelName: yo, backendName: "cpu", kernelFunc: Ro }; -function Ye(r15, t8, e, o) { - return e == null ? ({ inputs: n, backend: s }) => { +var G_ = { kernelName: ho, backendName: "cpu", kernelFunc: rn }; +function Qe(r16, e, t10, o) { + return t10 == null ? ({ inputs: n, backend: s }) => { let { a, b: i } = n, p = s; - Q([a, i], r15); - let u = p.data.get(a.dataId).values, c = p.data.get(i.dataId).values, l = a.dtype === "string" ? w.fromUint8ToStringArray(u) : u, m = a.dtype === "string" ? w.fromUint8ToStringArray(c) : c, d = o || a.dtype, [f, h] = t8(a.shape, i.shape, l, m, d); + Q([a, i], r16); + let u = p.data.get(a.dataId).values, l = p.data.get(i.dataId).values, c = a.dtype === "string" ? C.fromUint8ToStringArray(u) : u, m = a.dtype === "string" ? C.fromUint8ToStringArray(l) : l, d = o || a.dtype, [f, h] = e(a.shape, i.shape, c, m, d); return p.makeTensorInfo(h, d, f); } : ({ inputs: n, backend: s }) => { let { a, b: i } = n, p = s; if (a.dtype === "complex64" || i.dtype === "complex64") { - let u = Ro({ inputs: { x: a }, backend: p, attrs: { dtype: "complex64" } }), c = p.data.get(u.dataId), l = c.complexTensorInfos.real, m = c.complexTensorInfos.imag, d = p.data.get(l.dataId).values, f = p.data.get(m.dataId).values, h = Ro({ inputs: { x: i }, backend: p, attrs: { dtype: "complex64" } }), g = p.data.get(h.dataId), x = g.complexTensorInfos.real, b = g.complexTensorInfos.imag, C = p.data.get(x.dataId).values, S = p.data.get(b.dataId).values, [k, _, E] = e(a.shape, i.shape, d, f, C, S), R = p.makeTensorInfo(E, "float32", k), D = p.makeTensorInfo(E, "float32", _), P = Ht({ inputs: { real: R, imag: D }, backend: p }); - return p.disposeIntermediateTensorInfo(u), p.disposeIntermediateTensorInfo(h), p.disposeIntermediateTensorInfo(R), p.disposeIntermediateTensorInfo(D), P; + let u = rn({ inputs: { x: a }, backend: p, attrs: { dtype: "complex64" } }), l = p.data.get(u.dataId), c = l.complexTensorInfos.real, m = l.complexTensorInfos.imag, d = p.data.get(c.dataId).values, f = p.data.get(m.dataId).values, h = rn({ inputs: { x: i }, backend: p, attrs: { dtype: "complex64" } }), g = p.data.get(h.dataId), x = g.complexTensorInfos.real, b = g.complexTensorInfos.imag, w = p.data.get(x.dataId).values, S = p.data.get(b.dataId).values, [k, T, E] = t10(a.shape, i.shape, d, f, w, S), R = p.makeTensorInfo(E, "float32", k), D = p.makeTensorInfo(E, "float32", T), F = qt({ inputs: { real: R, imag: D }, backend: p }); + return p.disposeIntermediateTensorInfo(u), p.disposeIntermediateTensorInfo(h), p.disposeIntermediateTensorInfo(R), p.disposeIntermediateTensorInfo(D), F; } else { - let u = p.data.get(a.dataId).values, c = p.data.get(i.dataId).values, l = o || a.dtype, [m, d] = t8(a.shape, i.shape, u, c, l); - return p.makeTensorInfo(d, l, m); + let u = p.data.get(a.dataId).values, l = p.data.get(i.dataId).values, c = o || a.dtype, [m, d] = e(a.shape, i.shape, u, l, c); + return p.makeTensorInfo(d, c, m); } }; } -function xc(r15) { - return (t8, e, o, n, s, a) => { - let i = w.assertAndGetBroadcastShape(t8, e), p = y.sizeFromShape(i), u = i.length, c = y.computeStrides(i), l = y.getTypedArrayFromDType("float32", p), m = y.getTypedArrayFromDType("float32", p), d = w.getBroadcastDims(t8, i), f = w.getBroadcastDims(e, i), h = w.mergeRealAndImagArrays(o, n), g = w.mergeRealAndImagArrays(s, a), x = t8.length, b = y.computeStrides(t8), C = e.length, S = y.computeStrides(e); +function kl(r16) { + return (e, t10, o, n, s, a) => { + let i = C.assertAndGetBroadcastShape(e, t10), p = y.sizeFromShape(i), u = i.length, l = y.computeStrides(i), c = y.getTypedArrayFromDType("float32", p), m = y.getTypedArrayFromDType("float32", p), d = C.getBroadcastDims(e, i), f = C.getBroadcastDims(t10, i), h = C.mergeRealAndImagArrays(o, n), g = C.mergeRealAndImagArrays(s, a), x = e.length, b = y.computeStrides(e), w = t10.length, S = y.computeStrides(t10); if (d.length + f.length === 0) - for (let k = 0; k < l.length; k++) { - let _ = k % h.length, E = k % g.length, R = r15(h[_ * 2], h[_ * 2 + 1], g[E * 2], g[E * 2 + 1]); - l[k] = R.real, m[k] = R.imag; + for (let k = 0; k < c.length; k++) { + let T = k % h.length, E = k % g.length, R = r16(h[T * 2], h[T * 2 + 1], g[E * 2], g[E * 2 + 1]); + c[k] = R.real, m[k] = R.imag; } else - for (let k = 0; k < l.length; k++) { - let _ = y.indexToLoc(k, u, c), E = _.slice(-x); + for (let k = 0; k < c.length; k++) { + let T = y.indexToLoc(k, u, l), E = T.slice(-x); d.forEach((M) => E[M] = 0); - let R = y.locToIndex(E, x, b), D = _.slice(-C); + let R = y.locToIndex(E, x, b), D = T.slice(-w); f.forEach((M) => D[M] = 0); - let P = y.locToIndex(D, C, S), O = r15(h[R * 2], h[R * 2 + 1], g[P * 2], g[P * 2 + 1]); - l[k] = O.real, m[k] = O.imag; + let F = y.locToIndex(D, w, S), O = r16(h[R * 2], h[R * 2 + 1], g[F * 2], g[F * 2 + 1]); + c[k] = O.real, m[k] = O.imag; } - return [l, m, i]; + return [c, m, i]; }; } -var zS = ze((r15, t8) => r15 + t8); -var P8 = xc((r15, t8, e, o) => ({ real: r15 + e, imag: t8 + o })); -var Pa = Ye(io, zS, P8); -var e_ = { kernelName: io, backendName: "cpu", kernelFunc: Pa }; -function yc(r15, t8, e, o, n) { - let s = y.sizeFromShape(o), a = y.makeZerosTypedArray(n, e); - for (let i = 0; i < r15.length; i++) { - let p = r15[i]; +var eI = Ve((r16, e) => r16 + e); +var u7 = kl((r16, e, t10, o) => ({ real: r16 + t10, imag: e + o })); +var Wa = Qe(Rr, eI, u7); +var H_ = { kernelName: Rr, backendName: "cpu", kernelFunc: Wa }; +function Nl(r16, e, t10, o, n) { + let s = y.sizeFromShape(o), a = y.makeZerosTypedArray(n, t10); + for (let i = 0; i < r16.length; i++) { + let p = r16[i]; if (p < 0) throw new Error("Input x must be non-negative!"); - p >= n || (s > 0 ? a[p] += t8[i] : a[p] += 1); + p >= n || (s > 0 ? a[p] += e[i] : a[p] += 1); } return a; } -function kf(r15, t8, e, o = false) { - let n = r15.shape[0], s = r15.shape[1], a = me([n, e], t8.dtype); +function Of(r16, e, t10, o = false) { + let n = r16.shape[0], s = r16.shape[1], a = ie([n, t10], e.dtype); for (let i = 0; i < n; i++) for (let p = 0; p < s; p++) { - let u = r15.get(i, p); + let u = r16.get(i, p); if (u < 0) throw new Error("Input x must be non-negative!"); - u >= e || (o ? a.set(1, i, u) : t8.size > 0 ? a.set(a.get(i, u) + t8.get(i, p), i, u) : a.set(a.get(i, u) + 1, i, u)); + u >= t10 || (o ? a.set(1, i, u) : e.size > 0 ? a.set(a.get(i, u) + e.get(i, p), i, u) : a.set(a.get(i, u) + 1, i, u)); } return a; } -var VS = ze((r15, t8) => r15 & t8); -var O8 = Ye(qa, VS); -var t_ = { kernelName: qa, backendName: "cpu", kernelFunc: O8 }; -function jt(r15) { - return (t8, e, o) => { - let n = y.getArrayFromDType(e, t8.length); - for (let s = 0; s < t8.length; ++s) - n[s] = r15(t8[s], o); +var tI = Ve((r16, e) => r16 & e); +var p7 = Qe(_n, tI); +var K_ = { kernelName: _n, backendName: "cpu", kernelFunc: p7 }; +function Yt(r16) { + return (e, t10, o) => { + let n = y.getArrayFromDType(t10, e.length); + for (let s = 0; s < e.length; ++s) + n[s] = r16(e[s], o); return n; }; } -function Ie(r15, t8, e) { - let o = jt(t8); - return Dr(r15, o, e); +function Ie(r16, e, t10) { + let o = Yt(e); + return Mr(r16, o, t10); } -function Dr(r15, t8, e) { +function Mr(r16, e, t10) { return ({ inputs: o, attrs: n, backend: s }) => { let { x: a } = o; - Q(a, r15); + Q(a, r16); let i = s, p = i.data.get(a.dataId).values, u; if (a.dtype === "string") { if (!Array.isArray(p)) throw new Error("String tensor's value was not an instance of Array"); - u = w.fromUint8ToStringArray(p); + u = C.fromUint8ToStringArray(p); } else u = p; - let c = e || a.dtype, l = t8(u, c, n); - return i.makeTensorInfo(a.shape, c, l); + let l = t10 || a.dtype, c = e(u, l, n); + return i.makeTensorInfo(a.shape, l, c); }; } -var WS = jt((r15) => Math.ceil(r15)); -var M8 = Dr(en, WS); -var r_ = { kernelName: en, backendName: "cpu", kernelFunc: M8 }; -function np(r15, t8, e, o) { - let n = y.getArrayFromDType(e, y.sizeFromShape(t8)); - if (o && e !== "string") { +var rI = Yt((r16) => Math.ceil(r16)); +var l7 = Mr(go, rI); +var q_ = { kernelName: go, backendName: "cpu", kernelFunc: l7 }; +function mp(r16, e, t10, o) { + let n = y.getArrayFromDType(t10, y.sizeFromShape(e)); + if (o && t10 !== "string") { let s = 0; - r15.forEach((a) => { + r16.forEach((a) => { let i = y.sizeFromShape(a.shape); n.set(a.vals, s), s += i; }); } else { let s = 0; - r15.forEach((a) => { - let i = e === "string" ? w.fromUint8ToStringArray(a.vals) : a.vals, p = 0; + r16.forEach((a) => { + let i = t10 === "string" ? C.fromUint8ToStringArray(a.vals) : a.vals, p = 0; for (let u = 0; u < a.shape[0]; ++u) { - let c = u * t8[1] + s; - for (let l = 0; l < a.shape[1]; ++l) - n[c + l] = i[p++]; + let l = u * e[1] + s; + for (let c = 0; c < a.shape[1]; ++c) + n[l + c] = i[p++]; } s += a.shape[1]; }); } return n; } -var US = ze((r15, t8) => r15 === t8 ? 1 : 0); -var GS = Ye(xn, US, null, "bool"); -var o_ = { kernelName: xn, backendName: "cpu", kernelFunc: GS }; -var HS = jt((r15) => Math.exp(r15)); -var KS = Dr(yn, HS, "float32"); -var n_ = { kernelName: yn, backendName: "cpu", kernelFunc: KS }; -var qS = jt((r15) => Math.expm1(r15)); -var L8 = Dr(bn, qS); -var s_ = { kernelName: bn, backendName: "cpu", kernelFunc: L8 }; -var jS = jt((r15) => Math.floor(r15)); -var B8 = Dr(wn, jS); -var a_ = { kernelName: wn, backendName: "cpu", kernelFunc: B8 }; -var XS = ze((r15, t8) => Math.floor(r15 / t8)); -var z8 = Ye(Sn, XS, null, "int32"); -var i_ = { kernelName: Sn, backendName: "cpu", kernelFunc: z8 }; -function Nf(r15, t8, e, o, n, s, a, i, p) { - let u = me([o, s], e); - for (let c = 0; c < o; c++) { - let l = [], m = 0; +var oI = Ve((r16, e) => r16 === e ? 1 : 0); +var nI = Qe(xo, oI, null, "bool"); +var j_ = { kernelName: xo, backendName: "cpu", kernelFunc: nI }; +var sI = Yt((r16) => Math.exp(r16)); +var aI = Mr(yo, sI, "float32"); +var X_ = { kernelName: yo, backendName: "cpu", kernelFunc: aI }; +var iI = Yt((r16) => Math.expm1(r16)); +var c7 = Mr(bo, iI); +var Y_ = { kernelName: bo, backendName: "cpu", kernelFunc: c7 }; +var uI = Yt((r16) => Math.floor(r16)); +var m7 = Mr(Co, uI); +var Q_ = { kernelName: Co, backendName: "cpu", kernelFunc: m7 }; +var pI = Ve((r16, e) => Math.floor(r16 / e)); +var d7 = Qe(wo, pI, null, "int32"); +var Z_ = { kernelName: wo, backendName: "cpu", kernelFunc: d7 }; +function Mf(r16, e, t10, o, n, s, a, i, p) { + let u = ie([o, s], t10); + for (let l = 0; l < o; l++) { + let c = [], m = 0; for (let d = 0; d < n; d++) { - let f = r15[c * n + d]; - m += f * a[d], l.push(f); + let f = r16[l * n + d]; + m += f * a[d], c.push(f); } if (m < 0 || m >= p / s) - throw new Error(`Invalid indices: ${l} does not index into ${i}`); + throw new Error(`Invalid indices: ${c} does not index into ${i}`); for (let d = 0; d < s; d++) - u.values[c * s + d] = t8.get(...t8.indexToLoc(m * s + d)); + u.values[l * s + d] = e.get(...e.indexToLoc(m * s + d)); } return u; } -function Tf(r15, t8, e) { - let o = me(e, r15.dtype); +function Lf(r16, e, t10) { + let o = ie(t10, r16.dtype); for (let n = 0; n < o.size; ++n) { - let a = o.indexToLoc(n).slice(), i = a[0], p = a[2], u = t8.locToIndex([i, p]); - a[2] = t8.values[u]; - let c = r15.locToIndex(a); - 0 <= c && c < r15.values.length && (o.values[n] = r15.values[c]); + let a = o.indexToLoc(n).slice(), i = a[0], p = a[2], u = e.locToIndex([i, p]); + a[2] = e.values[u]; + let l = r16.locToIndex(a); + 0 <= l && l < r16.values.length && (o.values[n] = r16.values[l]); } return o; } -var YS = ze((r15, t8) => r15 > t8 ? 1 : 0); -var V8 = Ye(kn, YS, null, "bool"); -var u_ = { kernelName: kn, backendName: "cpu", kernelFunc: V8 }; -var QS = ze((r15, t8) => r15 >= t8 ? 1 : 0); -var W8 = Ye(Nn, QS, null, "bool"); -var p_ = { kernelName: Nn, backendName: "cpu", kernelFunc: W8 }; -var ZS = ze((r15, t8) => r15 < t8 ? 1 : 0); -var U8 = Ye(Rn, ZS, null, "bool"); -var c_ = { kernelName: Rn, backendName: "cpu", kernelFunc: U8 }; -var JS = ze((r15, t8) => r15 <= t8 ? 1 : 0); -var G8 = Ye(Dn, JS, null, "bool"); -var l_ = { kernelName: Dn, backendName: "cpu", kernelFunc: G8 }; -function _f(r15, t8, e) { - let o = (t8 - r15) / (e - 1), n = y.makeZerosTypedArray(e, "float32"); - n[0] = r15; +var lI = Ve((r16, e) => r16 > e ? 1 : 0); +var f7 = Qe(So, lI, null, "bool"); +var J_ = { kernelName: So, backendName: "cpu", kernelFunc: f7 }; +var cI = Ve((r16, e) => r16 >= e ? 1 : 0); +var h7 = Qe(Io, cI, null, "bool"); +var eE = { kernelName: Io, backendName: "cpu", kernelFunc: h7 }; +var mI = Ve((r16, e) => r16 < e ? 1 : 0); +var g7 = Qe(ko, mI, null, "bool"); +var tE = { kernelName: ko, backendName: "cpu", kernelFunc: g7 }; +var dI = Ve((r16, e) => r16 <= e ? 1 : 0); +var x7 = Qe(No, dI, null, "bool"); +var rE = { kernelName: No, backendName: "cpu", kernelFunc: x7 }; +function Bf(r16, e, t10) { + let o = (e - r16) / (t10 - 1), n = y.makeZerosTypedArray(t10, "float32"); + n[0] = r16; for (let s = 1; s < n.length; s++) n[s] = n[s - 1] + o; return n; } -var eI = jt((r15) => Math.log(r15)); -var H8 = Dr(Fn, eI); -var m_ = { kernelName: Fn, backendName: "cpu", kernelFunc: H8 }; -function $f(r15, t8, e, o) { - let n = y.getTypedArrayFromDType(o, y.sizeFromShape(e)); +var fI = Yt((r16) => Math.log(r16)); +var y7 = Mr(To, fI); +var oE = { kernelName: To, backendName: "cpu", kernelFunc: y7 }; +function zf(r16, e, t10, o) { + let n = y.getTypedArrayFromDType(o, y.sizeFromShape(t10)); for (let s = 0; s < n.length; ++s) { - let a = s * t8, i = r15[a]; - for (let p = 0; p < t8; ++p) { - let u = r15[a + p]; + let a = s * e, i = r16[a]; + for (let p = 0; p < e; ++p) { + let u = r16[a + p]; (Number.isNaN(u) || u > i) && (i = u); } n[s] = i; } return n; } -var tI = ze((r15, t8) => Math.max(r15, t8)); -var K8 = Ye(Vn, tI); -var d_ = { kernelName: Vn, backendName: "cpu", kernelFunc: K8 }; -var rI = ze((r15, t8) => Math.min(r15, t8)); -var q8 = Ye(Hn, rI); -var f_ = { kernelName: Hn, backendName: "cpu", kernelFunc: q8 }; -var Ll = ze((r15, t8) => r15 * t8); -var j8 = xc((r15, t8, e, o) => ({ real: r15 * e - t8 * o, imag: r15 * o + t8 * e })); -var sp = Ye(Xn, Ll, j8); -var h_ = { kernelName: Xn, backendName: "cpu", kernelFunc: sp }; -function oI(r15, t8, e) { - let o = y.createScalarValue(-1, e); - return Ll([], t8, o, r15, e); -} -function X8(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; +var hI = Ve((r16, e) => Math.max(r16, e)); +var b7 = Qe(_o, hI); +var nE = { kernelName: _o, backendName: "cpu", kernelFunc: b7 }; +var gI = Ve((r16, e) => Math.min(r16, e)); +var C7 = Qe(Eo, gI); +var sE = { kernelName: Eo, backendName: "cpu", kernelFunc: C7 }; +var qc = Ve((r16, e) => r16 * e); +var w7 = kl((r16, e, t10, o) => ({ real: r16 * t10 - e * o, imag: r16 * o + e * t10 })); +var dp = Qe($o, qc, w7); +var aE = { kernelName: $o, backendName: "cpu", kernelFunc: dp }; +function xI(r16, e, t10) { + let o = y.createScalarValue(-1, t10); + return qc([], e, o, r16, t10); +} +function S7(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; Q(o, "neg"); - let n = e.data.get(o.dataId).values, [s, a] = oI(n, o.shape, o.dtype); - return e.makeTensorInfo(a, o.dtype, s); -} -var g_ = { kernelName: pa, backendName: "cpu", kernelFunc: X8 }; -var nI = ze((r15, t8) => r15 !== t8 ? 1 : 0); -var Y8 = Ye(Yn, nI, null, "bool"); -var x_ = { kernelName: Yn, backendName: "cpu", kernelFunc: Y8 }; -function bc(r15, t8, e, o, n) { - let s = t8.length, a = y.sizeFromShape(t8), i = y.computeStrides(t8), p = y.computeStrides(n), u = y.getTypedArrayFromDType(e, y.sizeFromShape(n)); - for (let c = 0; c < a; ++c) { - let l = y.indexToLoc(c, s, i), m = new Array(l.length); + let n = t10.data.get(o.dataId).values, [s, a] = xI(n, o.shape, o.dtype); + return t10.makeTensorInfo(a, o.dtype, s); +} +var iE = { kernelName: ls, backendName: "cpu", kernelFunc: S7 }; +var yI = Ve((r16, e) => r16 !== e ? 1 : 0); +var I7 = Qe(Ro, yI, null, "bool"); +var uE = { kernelName: Ro, backendName: "cpu", kernelFunc: I7 }; +function Tl(r16, e, t10, o, n) { + let s = e.length, a = y.sizeFromShape(e), i = y.computeStrides(e), p = y.computeStrides(n), u = y.getTypedArrayFromDType(t10, y.sizeFromShape(n)); + for (let l = 0; l < a; ++l) { + let c = y.indexToLoc(l, s, i), m = new Array(c.length); for (let f = 0; f < m.length; f++) - m[f] = l[o[f]]; + m[f] = c[o[f]]; let d = y.locToIndex(m, s, p); - u[d] = r15[c]; + u[d] = r16[l]; } return u; } -function St(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { x: n } = t8, { perm: s } = e; +function vt(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { x: n } = e, { perm: s } = t10; Q(n, "transpose"); let a = n.shape.length, i = new Array(a); - for (let l = 0; l < i.length; l++) - i[l] = n.shape[s[l]]; - let p = o.data.get(n.dataId).values, u = bc(p, n.shape, n.dtype, s, i); + for (let c = 0; c < i.length; c++) + i[c] = n.shape[s[c]]; + let p = o.data.get(n.dataId).values, u = Tl(p, n.shape, n.dtype, s, i); return { dataId: o.write(u, i, n.dtype), shape: i, dtype: n.dtype }; } -var y_ = { kernelName: po, backendName: "cpu", kernelFunc: St }; -function sI(r15, t8, e, o) { - let [n, s] = w.computeOutAndReduceShapes(r15, o), a = dt(t8, "int32"), i = y.makeZerosTypedArray(y.sizeFromShape(n), a), p = y.sizeFromShape(s); +var pE = { kernelName: Kr, backendName: "cpu", kernelFunc: vt }; +function bI(r16, e, t10, o) { + let [n, s] = C.computeOutAndReduceShapes(r16, o), a = pt(e, "int32"), i = y.makeZerosTypedArray(y.sizeFromShape(n), a), p = y.sizeFromShape(s); for (let u = 0; u < i.length; ++u) { - let c = u * p, l = 1; + let l = u * p, c = 1; for (let m = 0; m < p; ++m) - l *= e[c + m]; - i[u] = l; + c *= t10[l + m]; + i[u] = c; } return { outVals: i, outShape: n, outDtype: a }; } -function Q8(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; +function v7(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; Q(n, "prod"); - let i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = w.getAxesPermutation(p, i), c = p, l = n, m = []; - u != null && (l = St({ inputs: { x: n }, backend: e, attrs: { perm: u } }), m.push(l), c = w.getInnerMostAxes(c.length, i)); - let d = e.data.get(l.dataId).values, { outVals: f, outShape: h, outDtype: g } = sI(l.shape, l.dtype, d, c), x = h; - return a && (x = w.expandShapeToKeepDim(h, p)), m.forEach((b) => e.disposeIntermediateTensorInfo(b)), e.makeTensorInfo(x, g, f); -} -var b_ = { kernelName: os, backendName: "cpu", kernelFunc: Q8 }; -function Z8(r15, t8, e) { - r15.forEach((o, n) => { - if (o < 0 || o >= e) { - let s = y.indexToLoc(n, t8.length, y.computeStrides(t8)).join(","); - throw new Error(`indices[${s}] = ${o} is not in [0, ${e})`); + let i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = C.getAxesPermutation(p, i), l = p, c = n, m = []; + u != null && (c = vt({ inputs: { x: n }, backend: t10, attrs: { perm: u } }), m.push(c), l = C.getInnerMostAxes(l.length, i)); + let d = t10.data.get(c.dataId).values, { outVals: f, outShape: h, outDtype: g } = bI(c.shape, c.dtype, d, l), x = h; + return a && (x = C.expandShapeToKeepDim(h, p)), m.forEach((b) => t10.disposeIntermediateTensorInfo(b)), t10.makeTensorInfo(x, g, f); +} +var lE = { kernelName: Ho, backendName: "cpu", kernelFunc: v7 }; +function k7(r16, e, t10) { + r16.forEach((o, n) => { + if (o < 0 || o >= t10) { + let s = y.indexToLoc(n, e.length, y.computeStrides(e)).join(","); + throw new Error(`indices[${s}] = ${o} is not in [0, ${t10})`); } }); } -function J8(r15, t8) { - for (let e = 0; e < r15.length; ++e) { - let o = r15[e], n = e === r15.length - 1 ? t8 : r15[e + 1].length; +function N7(r16, e) { + for (let t10 = 0; t10 < r16.length; ++t10) { + let o = r16[t10], n = t10 === r16.length - 1 ? e : r16[t10 + 1].length; if (o.length === 0) throw new Error("Ragged splits may not be empty"); if (o[0] < 0) @@ -12445,282 +12545,282 @@ function J8(r15, t8) { throw new Error("Ragged splits must be sorted in ascending order"); } } -function eY(r15, t8, e, o) { - let n = [], s = 0, a = t8.length - 1 + e.length, i = new Array(a).fill(null).map(() => [0]); - J8(e, o); +function T7(r16, e, t10, o) { + let n = [], s = 0, a = e.length - 1 + t10.length, i = new Array(a).fill(null).map(() => [0]); + N7(t10, o); let p = 1; - for (let u = 0; u < t8.length - 1; ++u) { - p *= t8[u]; - let c = t8[u + 1]; - for (let l = 1; l < p + 1; ++l) - i[u].push(l * c); - } - for (let u = 0; u < r15.length; ++u) { - let c = r15[u], l = r15[u] + 1; - for (let m = 0; m < e.length; ++m) { - let d = e[m], f = m + t8.length - 1; + for (let u = 0; u < e.length - 1; ++u) { + p *= e[u]; + let l = e[u + 1]; + for (let c = 1; c < p + 1; ++c) + i[u].push(c * l); + } + for (let u = 0; u < r16.length; ++u) { + let l = r16[u], c = r16[u] + 1; + for (let m = 0; m < t10.length; ++m) { + let d = t10[m], f = m + e.length - 1; if (f >= 0) { - let h = i[f], g = h[h.length - 1] - d[c]; - for (let x = c; x < l; ++x) + let h = i[f], g = h[h.length - 1] - d[l]; + for (let x = l; x < c; ++x) i[f].push(d[x + 1] + g); } - c = d[c], l = d[l]; + l = d[l], c = d[c]; } - l !== c && (n.push([c, l]), s += l - c); + c !== l && (n.push([l, c]), s += c - l); } return { outSplits: i, valueSlices: n, numValues: s }; } -function tY(r15) { - let t8 = []; - for (let e = 0; e < r15.length; ++e) { - let o = r15[e].length, n = y.getArrayFromDType("int32", o); - t8.push(n), r15[e].forEach((s, a) => n[a] = s); +function _7(r16) { + let e = []; + for (let t10 = 0; t10 < r16.length; ++t10) { + let o = r16[t10].length, n = y.getArrayFromDType("int32", o); + e.push(n), r16[t10].forEach((s, a) => n[a] = s); } - return t8; -} -function C_(r15, t8) { - let e = r15.slice(0, t8); - for (; e.length < t8; ) - e.push(1); - for (let o = t8; o < r15.length; o++) - e[t8 - 1] *= r15[o]; return e; } -function rY(r15, t8, e, o, n, s) { - let a = C_(t8, 2)[1], i = C_(s, 2)[1], p = 0; - for (let u of e) - for (let c = u[0]; c < u[1]; ++c) { - for (let l = 0; l < o; ++l) - n[p * i + l] = r15[c * a + l]; +function cE(r16, e) { + let t10 = r16.slice(0, e); + for (; t10.length < e; ) + t10.push(1); + for (let o = e; o < r16.length; o++) + t10[e - 1] *= r16[o]; + return t10; +} +function E7(r16, e, t10, o, n, s) { + let a = cE(e, 2)[1], i = cE(s, 2)[1], p = 0; + for (let u of t10) + for (let l = u[0]; l < u[1]; ++l) { + for (let c = 0; c < o; ++c) + n[p * i + c] = r16[l * a + c]; ++p; } } -function oY(r15, t8, e, o, n) { - let s = t8.slice(); +function $7(r16, e, t10, o, n) { + let s = e.slice(); s[0] = n; - let a = y.getArrayFromDType(e, y.sizeFromShape(s)), i = r15.length, p = i === 0 ? 0 : i / t8[0]; - return rY(r15, t8, o, p, a, s), [a, s]; + let a = y.getArrayFromDType(t10, y.sizeFromShape(s)), i = r16.length, p = i === 0 ? 0 : i / e[0]; + return E7(r16, e, o, p, a, s), [a, s]; } -function Ef(r15, t8, e, o, n, s, a, i) { - if (r15.length === 0) +function Vf(r16, e, t10, o, n, s, a, i) { + if (r16.length === 0) throw new Error("paramsNestedSplits must be non empty"); - if (t8[0].length === 0) + if (e[0].length === 0) throw new Error("Split tensors must not be scalars"); - let p = t8[0][0] - 1; - if (Z8(s, a, p), o.length === 0) + let p = e[0][0] - 1; + if (k7(s, a, p), o.length === 0) throw new Error("params.rank must be nonzero"); - let u = o[0], { outSplits: c, valueSlices: l, numValues: m } = eY(s, a, r15, u), d = tY(c), f = oY(e, o, n, l, m); + let u = o[0], { outSplits: l, valueSlices: c, numValues: m } = T7(s, a, r16, u), d = _7(l), f = $7(t10, o, n, c, m); return [d, f[0], f[1]]; } -var w_ = 2147483647; -function Rf(r15, t8, e, o, n, s, a) { - if (t8.length > 1) +var mE = 2147483647; +function Wf(r16, e, t10, o, n, s, a) { + if (e.length > 1) throw new Error("starts must be a scalar or vector"); if (n.length > 1) throw new Error("limits must be a scalar or vector"); if (a.length > 1) throw new Error("deltas must be a scalar or vector"); - let i = t8.length === 0, p = n.length === 0, u = a.length === 0, c = []; - i || c.push(t8[0]), p || c.push(n[0]), u || c.push(a[0]); - for (let g = 1; g < c.length; ++g) - if (c[g] !== c[g - 1]) + let i = e.length === 0, p = n.length === 0, u = a.length === 0, l = []; + i || l.push(e[0]), p || l.push(n[0]), u || l.push(a[0]); + for (let g = 1; g < l.length; ++g) + if (l[g] !== l[g - 1]) throw new Error("starts, limits, and deltas must have the same shape"); - let l = c.length === 0 ? 1 : c[0], m = y.getArrayFromDType("int32", l + 1); + let c = l.length === 0 ? 1 : l[0], m = y.getArrayFromDType("int32", c + 1); m[0] = 0; - for (let g = 0; g < l; ++g) { - let x = i ? r15[0] : r15[g], b = p ? o[0] : o[g], C = u ? s[0] : s[g]; - if (C === 0) + for (let g = 0; g < c; ++g) { + let x = i ? r16[0] : r16[g], b = p ? o[0] : o[g], w = u ? s[0] : s[g]; + if (w === 0) throw new Error("Requires delta != 0"); let S; - if (C > 0 && b < x || C < 0 && b > x) + if (w > 0 && b < x || w < 0 && b > x) S = 0; - else if (S = Math.ceil(Math.abs((b - x) / C)), S > w_) - throw new Error(`Requires ((limit - start) / delta) <= ${w_}`); + else if (S = Math.ceil(Math.abs((b - x) / w)), S > mE) + throw new Error(`Requires ((limit - start) / delta) <= ${mE}`); m[g + 1] = m[g] + S; } - let d = m[l], f = y.getArrayFromDType(e, d), h = 0; - for (let g = 0; g < l; ++g) { - let x = m[g + 1] - m[g], b = i ? r15[0] : r15[g], C = u ? s[0] : s[g]; + let d = m[c], f = y.getArrayFromDType(t10, d), h = 0; + for (let g = 0; g < c; ++g) { + let x = m[g + 1] - m[g], b = i ? r16[0] : r16[g], w = u ? s[0] : s[g]; for (let S = 0; S < x; ++S) - f[h++] = b, b += C; + f[h++] = b, b += w; } return [m, f]; } -var Do = w.RowPartitionType; -var aI = class r12 { - constructor(t8, e, o, n, s, a, i, p, u, c) { - this.shape = t8, this.shapeShape = e, this.values = o, this.valuesShape = n, this.valuesDType = s, this.defaultValue = a, this.defaultValueShape = i, this.rowPartitionValues = p, this.rowPartitionValuesShapes = u, this.rowPartitionTypes = w.getRowPartitionTypesHelper(c), this.raggedRank = w.getRaggedRank(this.rowPartitionTypes); +var on = C.RowPartitionType; +var CI = class r12 { + constructor(e, t10, o, n, s, a, i, p, u, l) { + this.shape = e, this.shapeShape = t10, this.values = o, this.valuesShape = n, this.valuesDType = s, this.defaultValue = a, this.defaultValueShape = i, this.rowPartitionValues = p, this.rowPartitionValuesShapes = u, this.rowPartitionTypes = C.getRowPartitionTypesHelper(l), this.raggedRank = C.getRaggedRank(this.rowPartitionTypes); } - getRowPartitionTypeByDimension(t8) { - return this.rowPartitionTypes[0] === Do.FIRST_DIM_SIZE ? this.rowPartitionTypes[t8 + 1] : this.rowPartitionTypes[t8]; + getRowPartitionTypeByDimension(e) { + return this.rowPartitionTypes[0] === on.FIRST_DIM_SIZE ? this.rowPartitionTypes[e + 1] : this.rowPartitionTypes[e]; } - getRowPartitionTensor(t8) { - return this.rowPartitionTypes[0] === Do.FIRST_DIM_SIZE ? this.rowPartitionValues[t8 + 1] : this.rowPartitionValues[t8]; + getRowPartitionTensor(e) { + return this.rowPartitionTypes[0] === on.FIRST_DIM_SIZE ? this.rowPartitionValues[e + 1] : this.rowPartitionValues[e]; } - getMaxWidth(t8) { - let e = this.getRowPartitionTensor(t8 - 1); - switch (this.getRowPartitionTypeByDimension(t8 - 1)) { - case Do.VALUE_ROWIDS: - return r12.getMaxWidthValueRowID(e); - case Do.ROW_SPLITS: - return r12.getMaxWidthRowSplit(e); + getMaxWidth(e) { + let t10 = this.getRowPartitionTensor(e - 1); + switch (this.getRowPartitionTypeByDimension(e - 1)) { + case on.VALUE_ROWIDS: + return r12.getMaxWidthValueRowID(t10); + case on.ROW_SPLITS: + return r12.getMaxWidthRowSplit(t10); default: - throw new Error(`Cannot handle partition type ${Do[this.getRowPartitionTypeByDimension(t8 - 1)]}`); + throw new Error(`Cannot handle partition type ${on[this.getRowPartitionTypeByDimension(e - 1)]}`); } } - static getMaxWidthRowSplit(t8) { - let e = t8.length; - if (e === 0 || e === 1) + static getMaxWidthRowSplit(e) { + let t10 = e.length; + if (t10 === 0 || t10 === 1) return 0; let o = 0; - for (let n = 0; n < e - 1; ++n) { - let s = t8[n + 1] - t8[n]; + for (let n = 0; n < t10 - 1; ++n) { + let s = e[n + 1] - e[n]; s > o && (o = s); } return o; } - static getMaxWidthValueRowID(t8) { - let e = t8.length; - if (e === 0) + static getMaxWidthValueRowID(e) { + let t10 = e.length; + if (t10 === 0) return 0; - let o = 0, n = t8[0], s = 0; - for (let a = 1; a < e; ++a) { - let i = t8[a]; + let o = 0, n = e[0], s = 0; + for (let a = 1; a < t10; ++a) { + let i = e[a]; i !== n && (n = i, s = Math.max(a - o, s), o = a); } - return Math.max(e - o, s); + return Math.max(t10 - o, s); } - tensorShapeFromTensor(t8, e, o = true) { - if (e.length === 0) { - if (t8[0] === -1) + tensorShapeFromTensor(e, t10, o = true) { + if (t10.length === 0) { + if (e[0] === -1) return []; throw new Error("The only valid scalar shape tensor is the fully unknown shape specified as -1."); } - return I_(t8, o); + return fE(e, o); } - calculateOutputSize(t8) { - let e = this.valuesShape, o = this.defaultValueShape; - w.validateDefaultValueShape(o, e); - let n = this.tensorShapeFromTensor(this.shape, this.shapeShape), a = w.combineRaggedTensorToTensorShapes(this.raggedRank, n, e); - a[0] < 0 && (a[0] = t8); + calculateOutputSize(e) { + let t10 = this.valuesShape, o = this.defaultValueShape; + C.validateDefaultValueShape(o, t10); + let n = this.tensorShapeFromTensor(this.shape, this.shapeShape), a = C.combineRaggedTensorToTensorShapes(this.raggedRank, n, t10); + a[0] < 0 && (a[0] = e); for (let i = 1; i <= this.raggedRank; ++i) a[i] < 0 && (a[i] = this.getMaxWidth(i)); return a; } - calculateFirstParentOutputIndex(t8, e, o) { - let n = Math.min(t8, o), s = [], a = 0; - for (let i = 0; i < n; ++i, a += e) + calculateFirstParentOutputIndex(e, t10, o) { + let n = Math.min(e, o), s = [], a = 0; + for (let i = 0; i < n; ++i, a += t10) s.push(a); - for (let i = n; i < t8; ++i) + for (let i = n; i < e; ++i) s.push(-1); - return y.assert(s.length === t8, () => "Final length of result must be equal to firstDimension."), s; + return y.assert(s.length === e, () => "Final length of result must be equal to firstDimension."), s; } - calculateOutputIndexRowSplit(t8, e, o, n) { - let s = t8.length, a = []; + calculateOutputIndexRowSplit(e, t10, o, n) { + let s = e.length, a = []; for (let i = 0; i < s - 1; ++i) { - let p = t8[i + 1] - t8[i], u = Math.min(n, p), c = e[i]; - c === -1 && (u = 0); - for (let l = 0; l < u; ++l) - a.push(c), c += o; - for (let l = 0; l < p - u; ++l) + let p = e[i + 1] - e[i], u = Math.min(n, p), l = t10[i]; + l === -1 && (u = 0); + for (let c = 0; c < u; ++c) + a.push(l), l += o; + for (let c = 0; c < p - u; ++c) a.push(-1); } - if (s > 0 && a.length !== t8[s - 1]) + if (s > 0 && a.length !== e[s - 1]) throw new Error("Invalid row split size."); return a; } - calculateOutputIndexValueRowID(t8, e, o, n) { - let s = t8.length, a = []; + calculateOutputIndexValueRowID(e, t10, o, n) { + let s = e.length, a = []; if (s === 0) return []; - let i = 0, p = t8[0]; - if (p >= e.length) - throw new Error(`Got currentValueRowId=${p}, which is not less than ${e.length}`); - let u = e[p]; + let i = 0, p = e[0]; + if (p >= t10.length) + throw new Error(`Got currentValueRowId=${p}, which is not less than ${t10.length}`); + let u = t10[p]; a.push(u); - for (let c = 1; c < s; ++c) { - let l = t8[c]; - if (l === p) + for (let l = 1; l < s; ++l) { + let c = e[l]; + if (c === p) u >= 0 && (++i, i < n ? u += o : u = -1); else { - if (i = 0, p = l, l >= e.length) - throw new Error(`Got nextValueRowId=${l} which is not less than ${e.length}`); - u = e[l]; + if (i = 0, p = c, c >= t10.length) + throw new Error(`Got nextValueRowId=${c} which is not less than ${t10.length}`); + u = t10[c]; } a.push(u); } - if (a.length !== t8.length) + if (a.length !== e.length) throw new Error("Invalid row ids."); return a; } - calculateOutputIndex(t8, e, o, n) { - let s = this.getRowPartitionTensor(t8), a = this.getRowPartitionTypeByDimension(t8); + calculateOutputIndex(e, t10, o, n) { + let s = this.getRowPartitionTensor(e), a = this.getRowPartitionTypeByDimension(e); switch (a) { - case Do.VALUE_ROWIDS: - return this.calculateOutputIndexValueRowID(s, e, o, n); - case Do.ROW_SPLITS: - if (s.length - 1 > e.length) - throw new Error(`Row partition size is greater than output size: ${s.length - 1} > ${e.length}`); - return this.calculateOutputIndexRowSplit(s, e, o, n); + case on.VALUE_ROWIDS: + return this.calculateOutputIndexValueRowID(s, t10, o, n); + case on.ROW_SPLITS: + if (s.length - 1 > t10.length) + throw new Error(`Row partition size is greater than output size: ${s.length - 1} > ${t10.length}`); + return this.calculateOutputIndexRowSplit(s, t10, o, n); default: - throw new Error(`Unsupported partition type: ${Do[a]}`); + throw new Error(`Unsupported partition type: ${on[a]}`); } } getFirstDimensionSize() { - let t8 = this.rowPartitionValues[0]; + let e = this.rowPartitionValues[0]; if (this.rowPartitionTypes.length === 0) throw new Error("No row_partition_types given."); - let e = this.rowPartitionTypes[0]; - switch (e) { - case Do.FIRST_DIM_SIZE: - return t8[0]; - case Do.VALUE_ROWIDS: + let t10 = this.rowPartitionTypes[0]; + switch (t10) { + case on.FIRST_DIM_SIZE: + return e[0]; + case on.VALUE_ROWIDS: throw new Error("Cannot handle VALUE_ROWIDS in first dimension."); - case Do.ROW_SPLITS: + case on.ROW_SPLITS: return this.rowPartitionValuesShapes[0][0] - 1; default: - throw new Error(`Cannot handle type ${Do[e]}`); + throw new Error(`Cannot handle type ${on[t10]}`); } } compute() { if (this.rowPartitionValues[0].length <= 0) throw new Error("Invalid first partition input. Tensor requires at least one element."); - let e = this.getFirstDimensionSize(), o = this.calculateOutputSize(e), n = new Array(this.raggedRank + 1); + let t10 = this.getFirstDimensionSize(), o = this.calculateOutputSize(t10), n = new Array(this.raggedRank + 1); n[n.length - 1] = 1; for (let p = n.length - 2; p >= 0; --p) n[p] = n[p + 1] * o[p + 1]; - let s = I_(o, false), a = y.getArrayFromDType(this.valuesDType, y.sizeFromShape(s)); + let s = fE(o, false), a = y.getArrayFromDType(this.valuesDType, y.sizeFromShape(s)); if (n[0] * o[0] > 0) { - let p = this.calculateFirstParentOutputIndex(e, n[0], o[0]); + let p = this.calculateFirstParentOutputIndex(t10, n[0], o[0]); for (let u = 1; u <= this.raggedRank; ++u) p = this.calculateOutputIndex(u - 1, p, n[u], o[u]); this.setOutput(this.raggedRank, p, a, s); } return [s, a]; } - setOutput(t8, e, o, n) { + setOutput(e, t10, o, n) { if (o.length === 0) return; let s = this.values, a = o, i = n.slice(); - i = i.slice(t8 + 1); - let p = y.sizeFromShape(i), u = e.length, c = this.defaultValue; - if (c.length !== p && c.length !== 1) { + i = i.slice(e + 1); + let p = y.sizeFromShape(i), u = t10.length, l = this.defaultValue; + if (l.length !== p && l.length !== 1) { let f = this.defaultValueShape; De(() => { - let h = W(c, f); - c = ou(h, i).dataSync(); + let h = W(l, f); + l = Oa(h, i).dataSync(); }); } - let l = 0, m = 0, d = 0; + let c = 0, m = 0, d = 0; for (let f = 0; f <= u; ++f) { - let h = f < u ? e[f] : -1; + let h = f < u ? t10[f] : -1; if (h === d) { ++d; continue; } if (m < d) { - let g = s.subarray(l * p), x = a.subarray(m * p), b = (d - m) * p; - S_(x, g, b); + let g = s.subarray(c * p), x = a.subarray(m * p), b = (d - m) * p; + dE(x, g, b); } if (f >= u) { let g = o.length; @@ -12732,105 +12832,105 @@ var aI = class r12 { else for (; h > d; ) { let g = a.slice(d * p); - S_(g, c, p), ++d; + dE(g, l, p), ++d; } - h < 0 ? (l = f + 1, m = d) : (l = f, m = d, d = m + 1); + h < 0 ? (c = f + 1, m = d) : (c = f, m = d, d = m + 1); } } }; -function S_(r15, t8, e) { - for (let o = 0; o < e; o++) - r15[o] = t8[o]; +function dE(r16, e, t10) { + for (let o = 0; o < t10; o++) + r16[o] = e[o]; } -function I_(r15, t8) { - let e = []; - for (let o of r15) { +function fE(r16, e) { + let t10 = []; + for (let o of r16) { if (o < 0) { - if (!t8) + if (!e) throw new Error(`Dimension ${o} must be >= 0`); if (o < -1) throw new Error(`Dimension ${o} must be >= -1`); o = -1; } - e.push(o); + t10.push(o); } - return e; + return t10; } -function Df(r15, t8, e, o, n, s, a, i, p, u) { - return new aI(r15, t8, e, o, n, s, a, i, p, u).compute(); +function Uf(r16, e, t10, o, n, s, a, i, p, u) { + return new CI(r16, e, t10, o, n, s, a, i, p, u).compute(); } -function ap(r15, t8, e, o) { - let n = r15 === t8, s = r15 < t8 && e < 0, a = t8 < r15 && e > 1; +function fp(r16, e, t10, o) { + let n = r16 === e, s = r16 < e && t10 < 0, a = e < r16 && t10 > 1; if (n || s || a) return y.makeZerosTypedArray(0, o); - let i = Math.abs(Math.ceil((t8 - r15) / e)), p = y.makeZerosTypedArray(i, o); - t8 < r15 && e === 1 && (e = -1), p[0] = r15; + let i = Math.abs(Math.ceil((e - r16) / t10)), p = y.makeZerosTypedArray(i, o); + e < r16 && t10 === 1 && (t10 = -1), p[0] = r16; for (let u = 1; u < p.length; u++) - p[u] = p[u - 1] + e; + p[u] = p[u - 1] + t10; return p; } -var iI = jt((r15) => 1 / Math.sqrt(r15)); -var nY = Dr(ls, iI); -var v_ = { kernelName: ls, backendName: "cpu", kernelFunc: nY }; -function zs(r15, t8, e, o, n, s, a, i, p, u) { - let c = [o / n, n], l = r15.values, m = t8.values; +var wI = Yt((r16) => 1 / Math.sqrt(r16)); +var R7 = Mr(Do, wI); +var hE = { kernelName: Do, backendName: "cpu", kernelFunc: R7 }; +function Xs(r16, e, t10, o, n, s, a, i, p, u) { + let l = [o / n, n], c = r16.values, m = e.values; if (o === 0) - return me(e, t8.dtype); - let d = p instanceof tt ? p : me(c, t8.dtype); + return ie(t10, e.dtype); + let d = p instanceof Ge ? p : ie(l, e.dtype); typeof p == "string" || typeof p == "number" ? d.values.fill(p) : typeof p == "boolean" && d.values.fill(+p); for (let f = 0; f < s; f++) { let h = [], g = 0; for (let x = 0; x < a; x++) { - let b = l[f * a + x]; + let b = c[f * a + x]; h.push(b), g += b * i[x]; } if (g < 0 || g >= o / n) - throw new Error(`Invalid indices: ${h} does not index into ${e}`); + throw new Error(`Invalid indices: ${h} does not index into ${t10}`); for (let x = 0; x < n; x++) - u ? d.values[g * n + x] += m[f * n + x] : d.values[g * n + x] = t8.rank === 0 ? m[0] : m[f * n + x]; + u ? d.values[g * n + x] += m[f * n + x] : d.values[g * n + x] = e.rank === 0 ? m[0] : m[f * n + x]; } return d; } -var k_ = jt((r15) => 1 / (1 + Math.exp(-r15))); -var uI = Ie(bs, (r15) => 1 / (1 + Math.exp(-r15))); -var N_ = { kernelName: bs, backendName: "cpu", kernelFunc: uI }; -function ip(r15, t8, e, o, n) { - let s = pt.isSliceContinous(o, t8, e), a = y.sizeFromShape(e), i = y.computeStrides(o); +var gE = Yt((r16) => 1 / (1 + Math.exp(-r16))); +var SI = Ie(Ao, (r16) => 1 / (1 + Math.exp(-r16))); +var xE = { kernelName: Ao, backendName: "cpu", kernelFunc: SI }; +function hp(r16, e, t10, o, n) { + let s = nt.isSliceContinous(o, e, t10), a = y.sizeFromShape(t10), i = y.computeStrides(o); if (s) { - let l = pt.computeFlatOffset(t8, i); - return n === "string" ? r15.slice(l, l + a) : r15.subarray(l, l + a); + let c = nt.computeFlatOffset(e, i); + return n === "string" ? r16.slice(c, c + a) : r16.subarray(c, c + a); } - let p = n === "string" ? w.fromUint8ToStringArray(r15) : r15, u = me(o, n, p), c = me(e, n); - for (let l = 0; l < c.size; ++l) { - let m = c.indexToLoc(l), d = m.map((f, h) => f + t8[h]); - c.set(u.get(...d), ...m); + let p = n === "string" ? C.fromUint8ToStringArray(r16) : r16, u = ie(o, n, p), l = ie(t10, n); + for (let c = 0; c < l.size; ++c) { + let m = l.indexToLoc(c), d = m.map((f, h) => f + e[h]); + l.set(u.get(...d), ...m); } - return n === "string" ? w.fromStringArrayToUint8(c.values) : c.values; + return n === "string" ? C.fromStringArrayToUint8(l.values) : l.values; } -function Ao(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { begin: s, size: a } = o; +function nn(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { begin: s, size: a } = o; Q(n, "slice"); - let [i, p] = pt.parseSliceParams(n, s, a); - pt.assertParamsValid(n, i, p); - let u = e.data.get(n.dataId).values, c = ip(u, i, p, n.shape, n.dtype); - return e.makeTensorInfo(p, n.dtype, c); -} -var T_ = { kernelName: ha, backendName: "cpu", kernelFunc: Ao }; -function Af(r15, t8, e, o, n, s, a) { - let i = t8[0], p = s[0], u = new Array(p), c = new Array(i), l = t8[1]; + let [i, p] = nt.parseSliceParams(n, s, a); + nt.assertParamsValid(n, i, p); + let u = t10.data.get(n.dataId).values, l = hp(u, i, p, n.shape, n.dtype); + return t10.makeTensorInfo(p, n.dtype, l); +} +var yE = { kernelName: _s, backendName: "cpu", kernelFunc: nn }; +function Gf(r16, e, t10, o, n, s, a) { + let i = e[0], p = s[0], u = new Array(p), l = new Array(i), c = e[1]; if (p === 0) { if (i !== 0) - throw new Error(w.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i)); - let g = y.getArrayFromDType(e, 0), x = y.getArrayFromDType(n, 0); - return [g, [0, l], x, u, c]; + throw new Error(C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i)); + let g = y.getArrayFromDType(t10, 0), x = y.getArrayFromDType(n, 0); + return [g, [0, c], x, u, l]; } let m = true, d = 0, f = new Array(p).fill(0); for (let g = 0; g < i; ++g) { - let x = r15[g * l]; + let x = r16[g * c]; if (x < 0) - throw new Error(w.getSparseFillEmptyRowsNegativeIndexErrorMessage(g, x)); + throw new Error(C.getSparseFillEmptyRowsNegativeIndexErrorMessage(g, x)); if (x >= p) - throw new Error(w.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g, x, p)); + throw new Error(C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g, x, p)); ++f[x], m = m && x >= d, d = x; } let h = true; @@ -12839,54 +12939,54 @@ function Af(r15, t8, e, o, n, s, a) { u[g] = x, h = h && !x, f[g] = Math.max(f[g], 1), g > 0 && (f[g] += f[g - 1]); } if (h && m) { - let g = r15, x = o; + let g = r16, x = o; for (let b = 0; b < i; ++b) - c[b] = b; - return [g, [i, l], x, u, c]; + l[b] = b; + return [g, [i, c], x, u, l]; } else { - let g = f[p - 1], x = y.getArrayFromDType(e, g * l), b = y.getArrayFromDType(n, g), C = new Array(p).fill(0); + let g = f[p - 1], x = y.getArrayFromDType(t10, g * c), b = y.getArrayFromDType(n, g), w = new Array(p).fill(0); for (let S = 0; S < i; ++S) { - let k = r15[S * l], _ = C[k], E = (k === 0 ? 0 : f[k - 1]) + _; - C[k]++; - for (let R = 0; R < l; ++R) - x[E * l + R] = r15[S * l + R]; - b[E] = o[S], c[S] = E; + let k = r16[S * c], T = w[k], E = (k === 0 ? 0 : f[k - 1]) + T; + w[k]++; + for (let R = 0; R < c; ++R) + x[E * c + R] = r16[S * c + R]; + b[E] = o[S], l[S] = E; } for (let S = 0; S < p; ++S) - if (C[S] === 0) { - let _ = S === 0 ? 0 : f[S - 1]; - x[_ * l + 0] = S; - for (let E = 1; E < l; ++E) - x[_ * l + E] = 0; - b[_] = a; + if (w[S] === 0) { + let T = S === 0 ? 0 : f[S - 1]; + x[T * c + 0] = S; + for (let E = 1; E < c; ++E) + x[T * c + E] = 0; + b[T] = a; } - return [x, [g, l], b, u, c]; + return [x, [g, c], b, u, l]; } } -function Ff(r15, t8, e, o, n) { - let s = y.sizeFromShape(o), a = t8[0], i = n.length, p = [], u = 1, c = -1; +function Hf(r16, e, t10, o, n) { + let s = y.sizeFromShape(o), a = e[0], i = n.length, p = [], u = 1, l = -1; for (let g = 0; g < i; ++g) { let x = n[g]; if (x === -1) { - if (c !== -1) - throw new Error(w.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(c, g)); - c = g, p.push(1); + if (l !== -1) + throw new Error(C.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(l, g)); + l = g, p.push(1); } else { if (x < 0) - throw new Error(w.getSparseReshapeNegativeOutputDimErrorMessage(g, x)); + throw new Error(C.getSparseReshapeNegativeOutputDimErrorMessage(g, x)); u *= x, p.push(x); } } - if (c !== -1) { + if (l !== -1) { if (u <= 0) - throw new Error(w.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage()); + throw new Error(C.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage()); let g = Math.trunc(s / u); if (u * g !== s) - throw new Error(w.getSparseReshapeInputOutputMultipleErrorMessage(o, p)); - p[c] = g; + throw new Error(C.getSparseReshapeInputOutputMultipleErrorMessage(o, p)); + p[l] = g; } if (y.sizeFromShape(p) !== s) - throw new Error(w.getSparseReshapeInputOutputMismatchErrorMessage(o, p)); + throw new Error(C.getSparseReshapeInputOutputMismatchErrorMessage(o, p)); let m = o.length, d = []; if (m > 0) { d[m - 1] = 1; @@ -12899,128 +12999,128 @@ function Ff(r15, t8, e, o, n) { for (let g = i - 2; g >= 0; --g) f[g] = f[g + 1] * p[g + 1]; } - let h = y.getArrayFromDType(e, a * i); + let h = y.getArrayFromDType(t10, a * i); for (let g = 0; g < a; ++g) { let x = 0; for (let b = 0; b < m; ++b) - x += r15[g * m + b] * d[b]; + x += r16[g * m + b] * d[b]; for (let b = 0; b < i; ++b) h[g * i + b] = Math.trunc(x / f[b]), x %= f[b]; } return [h, [a, i], p]; } -function Cc(r15, t8, e, o, n, s = false, a = 0) { - let i = o.length, p = [t8[0], r15.length / t8[0]], u = p[1], l = i > 0 ? n[i - 1] + 1 : 0; - if (l < 0) - throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); - let m = t8.slice(); - m[0] = l; - let d = m.reduce((C, S) => C * S, 1), f = y.getArrayFromDType(e, d); +function _l(r16, e, t10, o, n, s = false, a = 0) { + let i = o.length, p = [e[0], r16.length / e[0]], u = p[1], c = i > 0 ? n[i - 1] + 1 : 0; + if (c < 0) + throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); + let m = e.slice(); + m[0] = c; + let d = m.reduce((w, S) => w * S, 1), f = y.getArrayFromDType(t10, d); if (i === 0) - return l > 0 && f.fill(a), [f, m]; - if (l <= 0) - throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); + return c > 0 && f.fill(a), [f, m]; + if (c <= 0) + throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); let h = 0, g = 1, x = 0, b = n[h]; for (; ; ) { - let C = 0; + let w = 0; if (g < i) { - if (C = n[g], b === C) { + if (w = n[g], b === w) { ++g; continue; } - if (b >= C) - throw new Error(w.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage()); + if (b >= w) + throw new Error(C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage()); } - if (b < 0 || b >= l) - throw new Error(w.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b, l)); + if (b < 0 || b >= c) + throw new Error(C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b, c)); b > x && f.fill(a, x * u, b * u); for (let S = h; S < g; ++S) { let k = o[S]; if (k < 0 || k >= p[0]) - throw new Error(w.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S, o[S], p[0])); - for (let _ = 0; _ < u; _++) - f[b * u + _] += r15[k * u + _]; + throw new Error(C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S, o[S], p[0])); + for (let T = 0; T < u; T++) + f[b * u + T] += r16[k * u + T]; } if (s) for (let S = 0; S < u; S++) f[b * u + S] /= g - h; - if (h = g, ++g, x = b + 1, b = C, g > i) + if (h = g, ++g, x = b + 1, b = w, g > i) break; } - return x < l && f.fill(a, x * u, l * u), [f, m]; + return x < c && f.fill(a, x * u, c * u), [f, m]; } -var __ = jt((r15) => Math.sqrt(r15)); -var sY = Ie(ws, (r15) => Math.sqrt(r15)); -var $_ = { kernelName: ws, backendName: "cpu", kernelFunc: sY }; -var pI = ze((r15, t8) => { - let e = r15 - t8; - return e * e; +var bE = Yt((r16) => Math.sqrt(r16)); +var D7 = Ie(Fo, (r16) => Math.sqrt(r16)); +var CE = { kernelName: Fo, backendName: "cpu", kernelFunc: D7 }; +var II = Ve((r16, e) => { + let t10 = r16 - e; + return t10 * t10; }); -var aY = Ye(ks, pI); -var E_ = { kernelName: ks, backendName: "cpu", kernelFunc: aY }; -var cI = jt((r15, t8) => { - let { pattern: e, replaceGlobal: o, rewrite: n } = t8; - return r15.replace(new RegExp(e, o ? "g" : ""), n); +var A7 = Qe(Po, II); +var wE = { kernelName: Po, backendName: "cpu", kernelFunc: A7 }; +var vI = Yt((r16, e) => { + let { pattern: t10, replaceGlobal: o, rewrite: n } = e; + return r16.replace(new RegExp(t10, o ? "g" : ""), n); }); -var iY = Dr($u, cI); -var R_ = { kernelName: $u, backendName: "cpu", kernelFunc: iY }; -function Pf(r15, t8, e, o) { - let n = me(r15, t8.dtype); +var F7 = Mr(pi, vI); +var SE = { kernelName: pi, backendName: "cpu", kernelFunc: F7 }; +function Kf(r16, e, t10, o) { + let n = ie(r16, e.dtype); for (let s = 0; s < n.size; s++) { let a = n.indexToLoc(s), i = new Array(a.length); for (let p = 0; p < i.length; p++) - i[p] = a[p] * e[p] + o[p]; - n.set(t8.get(...i), ...a); + i[p] = a[p] * t10[p] + o[p]; + n.set(e.get(...i), ...a); } return n; } -var lI = class { - constructor(t8, e, o, n, s, a) { - this.separator = y.encodeString(t8), this.nGramWidths = e, this.leftPad = y.encodeString(o), this.rightPad = y.encodeString(n), this.padWidth = s, this.preserveShort = a; +var kI = class { + constructor(e, t10, o, n, s, a) { + this.separator = y.encodeString(e), this.nGramWidths = t10, this.leftPad = y.encodeString(o), this.rightPad = y.encodeString(n), this.padWidth = s, this.preserveShort = a; } - getPadWidth(t8) { - return Math.min(this.padWidth < 0 ? t8 - 1 : this.padWidth, t8 - 1); + getPadWidth(e) { + return Math.min(this.padWidth < 0 ? e - 1 : this.padWidth, e - 1); } - getNumNGrams(t8, e) { - let o = this.getPadWidth(e); - return Math.max(0, t8 + 2 * o - e + 1); + getNumNGrams(e, t10) { + let o = this.getPadWidth(t10); + return Math.max(0, e + 2 * o - t10 + 1); } - createNGrams(t8, e, o, n, s, a) { + createNGrams(e, t10, o, n, s, a) { for (let i = 0; i < s; ++i) { - let p = this.getPadWidth(a), u = Math.max(0, p - i), c = Math.max(0, p - (s - (i + 1))), l = a - (u + c), m = e + (u > 0 ? 0 : i - p), d = 0; + let p = this.getPadWidth(a), u = Math.max(0, p - i), l = Math.max(0, p - (s - (i + 1))), c = a - (u + l), m = t10 + (u > 0 ? 0 : i - p), d = 0; d += u * this.leftPad.length; - for (let b = 0; b < l; ++b) - d += t8[m + b].length; - d += c * this.rightPad.length; - let f = u + c + l - 1; + for (let b = 0; b < c; ++b) + d += e[m + b].length; + d += l * this.rightPad.length; + let f = u + l + c - 1; d += f * this.separator.length, o[n + i] = new Uint8Array(d); - let h = o[n + i], g = 0, x = (b) => b.forEach((C) => h[g++] = C); + let h = o[n + i], g = 0, x = (b) => b.forEach((w) => h[g++] = w); for (let b = 0; b < u; ++b) x(this.leftPad), x(this.separator); - for (let b = 0; b < l - 1; ++b) - x(t8[m + b]), x(this.separator); - if (l > 0) { - x(t8[m + l - 1]); - for (let b = 0; b < c; ++b) + for (let b = 0; b < c - 1; ++b) + x(e[m + b]), x(this.separator); + if (c > 0) { + x(e[m + c - 1]); + for (let b = 0; b < l; ++b) x(this.separator), x(this.rightPad); } else { - for (let b = 0; b < c - 1; ++b) + for (let b = 0; b < l - 1; ++b) x(this.rightPad), x(this.separator); x(this.rightPad); } } } - compute(t8, e) { - let o = t8.length, n = e.length; + compute(e, t10) { + let o = e.length, n = t10.length; if (n > 0) { - let p = e[0]; + let p = t10[0]; if (p !== 0) throw new Error(`First split value must be 0, got ${p}`); for (let u = 1; u < n; ++u) { - let c = e[u] >= p; - if (c = c && e[u] <= o, !c) - throw new Error(`Invalid split value ${e[u]}, must be in [${p}, ${o}]`); - p = e[u]; + let l = t10[u] >= p; + if (l = l && t10[u] <= o, !l) + throw new Error(`Invalid split value ${t10[u]}, must be in [${p}, ${o}]`); + p = t10[u]; } if (p !== o) throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`); @@ -13034,142 +13134,142 @@ var lI = class { } a[0] = 0; for (let p = 1; p <= s; ++p) { - let u = e[p] - e[p - 1], c = 0; - this.nGramWidths.forEach((l) => { - c += this.getNumNGrams(u, l); - }), this.preserveShort && u > 0 && c === 0 && (c = 1), a[p] = a[p - 1] + c; + let u = t10[p] - t10[p - 1], l = 0; + this.nGramWidths.forEach((c) => { + l += this.getNumNGrams(u, c); + }), this.preserveShort && u > 0 && l === 0 && (l = 1), a[p] = a[p - 1] + l; } let i = new Array(a[s]); for (let p = 0; p < s; ++p) { - let u = e[p], c = a[p]; - if (this.nGramWidths.forEach((l) => { - let m = e[p + 1] - e[p], d = this.getNumNGrams(m, l); - this.createNGrams(t8, u, i, c, d, l), c += d; - }), this.preserveShort && c === a[p]) { - let l = e[p + 1] - e[p]; - if (l === 0) + let u = t10[p], l = a[p]; + if (this.nGramWidths.forEach((c) => { + let m = t10[p + 1] - t10[p], d = this.getNumNGrams(m, c); + this.createNGrams(e, u, i, l, d, c), l += d; + }), this.preserveShort && l === a[p]) { + let c = t10[p + 1] - t10[p]; + if (c === 0) continue; - let m = l + 2 * this.padWidth, d = 1; - this.createNGrams(t8, u, i, c, d, m); + let m = c + 2 * this.padWidth; + this.createNGrams(e, u, i, l, 1, m); } } return [i, a]; } }; -function up(r15, t8, e, o, n, s, a, i) { - return new lI(e, o, n, s, a, i).compute(r15, t8); +function gp(r16, e, t10, o, n, s, a, i) { + return new kI(t10, o, n, s, a, i).compute(r16, e); } -function uY(r15, t8, e, o) { - if (!r15.length) +function P7(r16, e, t10, o) { + if (!r16.length) return; - if (t8.length === 0) { - for (let s = 0; s < r15.length; ++s) - o.push(r15.subarray(s, s + 1)); + if (e.length === 0) { + for (let s = 0; s < r16.length; ++s) + o.push(r16.subarray(s, s + 1)); return; } - if (t8.length === 1) { - let s = t8[0], a = r15.indexOf(s); + if (e.length === 1) { + let s = e[0], a = r16.indexOf(s); for (; a !== -1; ) { - let i = r15.subarray(0, a); - (!e || i.length !== 0) && o.push(i), r15 = r15.subarray(a + 1), a = r15.indexOf(s); + let i = r16.subarray(0, a); + (!t10 || i.length !== 0) && o.push(i), r16 = r16.subarray(a + 1), a = r16.indexOf(s); } - (!e || r15.length !== 0) && o.push(r15); + (!t10 || r16.length !== 0) && o.push(r16); return; } let n = 0; - for (let s = 0; s < r15.length + 1; s++) - if (s === r15.length || t8.indexOf(r15[s]) !== -1) { - let a = r15.subarray(n, s); - (!e || a.length !== 0) && o.push(a), n = s + 1; + for (let s = 0; s < r16.length + 1; s++) + if (s === r16.length || e.indexOf(r16[s]) !== -1) { + let a = r16.subarray(n, s); + (!t10 || a.length !== 0) && o.push(a), n = s + 1; } } -function pp(r15, t8, e) { - let o = r15.length, n = [], s = 0, a = 0, i = new Array(o); +function xp(r16, e, t10) { + let o = r16.length, n = [], s = 0, a = 0, i = new Array(o); for (let m = 0; m < o; ++m) { let d = n.length; - uY(r15[m], t8, e, n); + P7(r16[m], e, t10, n); let f = n.length - d; i[m] = f, s += f, a = Math.max(a, f); } - let p = y.getArrayFromDType("int32", s * 2), u = new Array(s), c = [o, a], l = 0; + let p = y.getArrayFromDType("int32", s * 2), u = new Array(s), l = [o, a], c = 0; for (let m = 0; m < o; ++m) for (let d = 0; d < i[m]; ++d) - p[l * 2] = m, p[l * 2 + 1] = d, u[l] = n[l], ++l; - return [p, u, c]; -} -function cp(r15, t8) { - let e = y.getArrayFromDType("int32", r15.length); - for (let o = 0; o < r15.length; ++o) - e[o] = y.fingerPrint64(r15[o]).modulo(t8).getLowBitsUnsigned(); - return e; -} -var mI = ze((r15, t8) => r15 - t8); -var pY = xc((r15, t8, e, o) => ({ real: r15 - e, imag: t8 - o })); -var Bl = Ye(Ts, mI, pY); -var D_ = { kernelName: Ts, backendName: "cpu", kernelFunc: Bl }; -function Of(r15, t8) { - let e = new Array(r15.rank); - for (let n = 0; n < e.length; n++) - e[n] = r15.shape[n] * t8[n]; - let o = me(e, r15.dtype); + p[c * 2] = m, p[c * 2 + 1] = d, u[c] = n[c], ++c; + return [p, u, l]; +} +function yp(r16, e) { + let t10 = y.getArrayFromDType("int32", r16.length); + for (let o = 0; o < r16.length; ++o) + t10[o] = y.fingerPrint64(r16[o]).modulo(e).getLowBitsUnsigned(); + return t10; +} +var NI = Ve((r16, e) => r16 - e); +var O7 = kl((r16, e, t10, o) => ({ real: r16 - t10, imag: e - o })); +var jc = Qe(Oo, NI, O7); +var IE = { kernelName: Oo, backendName: "cpu", kernelFunc: jc }; +function qf(r16, e) { + let t10 = new Array(r16.rank); + for (let n = 0; n < t10.length; n++) + t10[n] = r16.shape[n] * e[n]; + let o = ie(t10, r16.dtype); for (let n = 0; n < o.values.length; ++n) { - let s = o.indexToLoc(n), a = new Array(r15.rank); + let s = o.indexToLoc(n), a = new Array(r16.rank); for (let p = 0; p < a.length; p++) - a[p] = s[p] % r15.shape[p]; - let i = r15.locToIndex(a); - o.values[n] = r15.values[i]; + a[p] = s[p] % r16.shape[p]; + let i = r16.locToIndex(a); + o.values[n] = r16.values[i]; } return o; } -var zl = (r15, t8) => { - let e = t8.value - r15.value; - return e === 0 ? r15.index - t8.index : e; +var Xc = (r16, e) => { + let t10 = e.value - r16.value; + return t10 === 0 ? r16.index - e.index : t10; }; -function A_(r15, t8, e = 0, o = r15.length - 1) { - for (; o > e; ) { - if (o - e > 600) { - let i = o - e + 1, p = t8 - e + 1, u = Math.log(i), c = 0.5 * Math.exp(2 * u / 3), l = 0.5 * Math.sqrt(u * c * (i - c) / i) * Math.sign(p - i / 2), m = Math.max(e, Math.floor(t8 - p * c / i + l)), d = Math.min(o, Math.floor(t8 + (i - p) * c / i + l)); - A_(r15, t8, m, d); +function vE(r16, e, t10 = 0, o = r16.length - 1) { + for (; o > t10; ) { + if (o - t10 > 600) { + let i = o - t10 + 1, p = e - t10 + 1, u = Math.log(i), l = 0.5 * Math.exp(2 * u / 3), c = 0.5 * Math.sqrt(u * l * (i - l) / i) * Math.sign(p - i / 2), m = Math.max(t10, Math.floor(e - p * l / i + c)), d = Math.min(o, Math.floor(e + (i - p) * l / i + c)); + vE(r16, e, m, d); } - let n = r15[t8], s = e, a = o; - for (y.swap(r15, e, t8), zl(r15[o], n) > 0 && y.swap(r15, e, o); s < a; ) { - for (y.swap(r15, s, a), s++, a--; zl(r15[s], n) < 0; ) + let n = r16[e], s = t10, a = o; + for (y.swap(r16, t10, e), Xc(r16[o], n) > 0 && y.swap(r16, t10, o); s < a; ) { + for (y.swap(r16, s, a), s++, a--; Xc(r16[s], n) < 0; ) s = s + 1; - for (; zl(r15[a], n) > 0; ) + for (; Xc(r16[a], n) > 0; ) a = a - 1; } - zl(r15[e], n) === 0 ? y.swap(r15, e, a) : (a = a + 1, y.swap(r15, a, o)), a <= t8 && (e = a + 1), t8 <= a && (o = a - 1); + Xc(r16[t10], n) === 0 ? y.swap(r16, t10, a) : (a = a + 1, y.swap(r16, a, o)), a <= e && (t10 = a + 1), e <= a && (o = a - 1); } } -function Mf(r15, t8, e, o, n) { - let s = t8[t8.length - 1], [a, i] = [r15.length / s, s], p = y.getTypedArrayFromDType(e, a * o), u = y.getTypedArrayFromDType("int32", a * o); - for (let l = 0; l < a; l++) { - let m = l * i, d = r15.subarray(m, m + i), f = new Array(d.length); - d.forEach((b, C) => f[C] = { value: b, index: C }), o < f.length && (A_(f, o), f = f.slice(0, o)), n && f.sort(zl); - let h = l * o, g = p.subarray(h, h + o), x = u.subarray(h, h + o); +function jf(r16, e, t10, o, n) { + let s = e[e.length - 1], [a, i] = [r16.length / s, s], p = y.getTypedArrayFromDType(t10, a * o), u = y.getTypedArrayFromDType("int32", a * o); + for (let c = 0; c < a; c++) { + let m = c * i, d = r16.subarray(m, m + i), f = new Array(d.length); + d.forEach((b, w) => f[w] = { value: b, index: w }), o < f.length && (vE(f, o), f = f.slice(0, o)), n && f.sort(Xc); + let h = c * o, g = p.subarray(h, h + o), x = u.subarray(h, h + o); for (let b = 0; b < o; b++) g[b] = f[b].value, x[b] = f[b].index; } - let c = t8.slice(); - return c[c.length - 1] = o, [me(c, e, p), me(c, "int32", u)]; + let l = e.slice(); + return l[l.length - 1] = o, [ie(l, t10, p), ie(l, "int32", u)]; } -function lp(r15, t8, e, o) { - let n = y.parseAxisParam(t8, e)[0], s = [1, e[0], 1]; +function bp(r16, e, t10, o) { + let n = y.parseAxisParam(e, t10)[0], s = [1, t10[0], 1]; for (let f = 0; f < n; f++) - s[0] *= e[f]; - s[1] = e[n]; - for (let f = n + 1; f < e.length; f++) - s[2] *= e[f]; - let a = /* @__PURE__ */ new Map(), i = new Int32Array(e[n]), p = new tt(s, o, r15), u = [], c = s[0] === 1 && s[2] === 1; - for (let f = 0; f < e[n]; f++) { + s[0] *= t10[f]; + s[1] = t10[n]; + for (let f = n + 1; f < t10.length; f++) + s[2] *= t10[f]; + let a = /* @__PURE__ */ new Map(), i = new Int32Array(t10[n]), p = new Ge(s, o, r16), u = [], l = s[0] === 1 && s[2] === 1; + for (let f = 0; f < t10[n]; f++) { let h; - if (c) - h = r15[f].toString(); + if (l) + h = r16[f].toString(); else { let x = []; for (let b = 0; b < s[0]; b++) - for (let C = 0; C < s[2]; C++) - x.push(p.get(b, f, C)); + for (let w = 0; w < s[2]; w++) + x.push(p.get(b, f, w)); h = x.join(","); } let g = a.get(h); @@ -13180,293 +13280,293 @@ function lp(r15, t8, e, o) { a.set(h, x), i[f] = x, u.push(f); } } - let l = s.slice(); - l[1] = a.size; - let m = new tt(l, o); + let c = s.slice(); + c[1] = a.size; + let m = new Ge(c, o); u.forEach((f, h) => { for (let g = 0; g < s[0]; g++) for (let x = 0; x < s[2]; x++) m.set(p.get(g, f, x), g, h, x); }); - let d = e.slice(); - return d[n] = l[1], { outputValues: m.values, outputShape: d, indices: i }; -} -var cY = "4.14.0"; -tu("cpu", () => new hc(), 1); -var dI = Ie(hn, (r15) => r15 >= 0 ? r15 : Math.exp(r15) - 1); -var F_ = { kernelName: hn, backendName: "cpu", kernelFunc: dI }; -function fI(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { alpha: s } = o; + let d = t10.slice(); + return d[n] = c[1], { outputValues: m.values, outputShape: d, indices: i }; +} +var M7 = "4.17.0"; +pu("cpu", () => new Il(), 1); +var TI = Ie(Wn, (r16) => r16 >= 0 ? r16 : Math.exp(r16) - 1); +var kE = { kernelName: Wn, backendName: "cpu", kernelFunc: TI }; +function _I(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { alpha: s } = o; Q([n], "leakyRelu"); - let a = y.sizeFromShape(n.shape), i = e.data.get(n.dataId).values, p = y.getTypedArrayFromDType("float32", a); + let a = y.sizeFromShape(n.shape), i = t10.data.get(n.dataId).values, p = y.getTypedArrayFromDType("float32", a); for (let u = 0; u < i.length; u++) p[u] = i[u] < 0 ? s * i[u] : i[u]; - return e.makeTensorInfo(n.shape, "float32", p); + return t10.makeTensorInfo(n.shape, "float32", p); } -var P_ = { kernelName: En, backendName: "cpu", kernelFunc: fI }; -var lY = ze((r15, t8) => r15 < 0 ? t8 * r15 : r15); -function hI(r15) { - let { inputs: t8, backend: e } = r15, { x: o, alpha: n } = t8; +var NE = { kernelName: Yn, backendName: "cpu", kernelFunc: _I }; +var L7 = Ve((r16, e) => r16 < 0 ? e * r16 : r16); +function EI(r16) { + let { inputs: e, backend: t10 } = r16, { x: o, alpha: n } = e; Q([o, n], "prelu"); - let s = e.data.get(o.dataId).values, a = e.data.get(n.dataId).values, [i, p] = lY(o.shape, n.shape, s, a, "float32"); - return e.makeTensorInfo(p, "float32", i); -} -var O_ = { kernelName: rs, backendName: "cpu", kernelFunc: hI }; -var gI = Ie(ss, (r15) => Math.max(0, r15)); -var M_ = { kernelName: ss, backendName: "cpu", kernelFunc: gI }; -var xI = Ie(us, (r15) => Math.min(Math.max(0, r15), 6)); -var L_ = { kernelName: us, backendName: "cpu", kernelFunc: xI }; -function mp(r15, t8, e, o, n) { - if (e === "linear") - return lr({ inputs: { x: t8 }, backend: r15 }); - if (e === "relu") - return gI({ inputs: { x: t8 }, backend: r15 }); - if (e === "elu") - return dI({ inputs: { x: t8 }, backend: r15 }); - if (e === "relu6") - return xI({ inputs: { x: t8 }, backend: r15 }); - if (e === "prelu") - return hI({ inputs: { x: t8, alpha: o }, backend: r15 }); - if (e === "leakyrelu") - return fI({ inputs: { x: t8 }, backend: r15, attrs: { alpha: n } }); - if (e === "sigmoid") - return uI({ inputs: { x: t8 }, backend: r15 }); - throw new Error(`Activation ${e} has not been implemented for the CPU backend.`); -} -function Ve(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { shape: s } = o, a = y.sizeFromShape(n.shape), i = y.inferFromImplicitShape(s, a), p = y.sizeFromShape(i); - y.assert(a === p, () => `The new shape (${i}) has ${p} elements and the old shape (${n.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`), e.incRef(n.dataId); - let u = e.data.get(n.dataId); + let s = t10.data.get(o.dataId).values, a = t10.data.get(n.dataId).values, [i, p] = L7(o.shape, n.shape, s, a, "float32"); + return t10.makeTensorInfo(p, "float32", i); +} +var TE = { kernelName: gs, backendName: "cpu", kernelFunc: EI }; +var $I = Ie(ys, (r16) => Math.max(0, r16)); +var _E = { kernelName: ys, backendName: "cpu", kernelFunc: $I }; +var RI = Ie(ws, (r16) => Math.min(Math.max(0, r16), 6)); +var EE = { kernelName: ws, backendName: "cpu", kernelFunc: RI }; +function Cp(r16, e, t10, o, n) { + if (t10 === "linear") + return fr({ inputs: { x: e }, backend: r16 }); + if (t10 === "relu") + return $I({ inputs: { x: e }, backend: r16 }); + if (t10 === "elu") + return TI({ inputs: { x: e }, backend: r16 }); + if (t10 === "relu6") + return RI({ inputs: { x: e }, backend: r16 }); + if (t10 === "prelu") + return EI({ inputs: { x: e, alpha: o }, backend: r16 }); + if (t10 === "leakyrelu") + return _I({ inputs: { x: e }, backend: r16, attrs: { alpha: n } }); + if (t10 === "sigmoid") + return SI({ inputs: { x: e }, backend: r16 }); + throw new Error(`Activation ${t10} has not been implemented for the CPU backend.`); +} +function We(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { shape: s } = o, a = y.sizeFromShape(n.shape), i = y.inferFromImplicitShape(s, a), p = y.sizeFromShape(i); + y.assert(a === p, () => `The new shape (${i}) has ${p} elements and the old shape (${n.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`), t10.incRef(n.dataId); + let u = t10.data.get(n.dataId); if (u.complexTensorInfos != null) { - let c = u.complexTensorInfos.real, l = u.complexTensorInfos.imag; - c.shape = i, l.shape = i; + let l = u.complexTensorInfos.real, c = u.complexTensorInfos.imag; + l.shape = i, c.shape = i; } return { dataId: n.dataId, shape: i, dtype: n.dtype }; } -var B_ = { kernelName: da, backendName: "cpu", kernelFunc: Ve }; -function yI(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s } = t8, { transposeA: a, transposeB: i } = o; +var $E = { kernelName: Ca, backendName: "cpu", kernelFunc: We }; +function DI(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s } = e, { transposeA: a, transposeB: i } = o; Q([n, s], "matMul"); - let p = n.shape.length, u = s.shape.length, c = a ? n.shape[p - 2] : n.shape[p - 1], l = i ? s.shape[u - 1] : s.shape[u - 2], m = a ? n.shape[p - 1] : n.shape[p - 2], d = i ? s.shape[u - 2] : s.shape[u - 1], f = n.shape.slice(0, -2), h = s.shape.slice(0, -2), g = y.sizeFromShape(f), x = y.sizeFromShape(h), C = Sr.assertAndGetBroadcastShape(n.shape.slice(0, -2), s.shape.slice(0, -2)).concat([m, d]); - y.assert(c === l, () => `Error in matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`); - let S = a ? [g, c, m] : [g, m, c], k = i ? [x, d, l] : [x, l, d], _ = Ve({ inputs: { x: n }, backend: e, attrs: { shape: S } }), E = Ve({ inputs: { x: s }, backend: e, attrs: { shape: k } }), R = a ? _.shape[1] : _.shape[2], D = a ? _.shape[2] : _.shape[1], P = i ? E.shape[1] : E.shape[2], O = Math.max(g, x), M = e.data.get(_.dataId).values, L = e.data.get(E.dataId).values, B = y.computeStrides(_.shape), z = y.computeStrides(E.shape), [U, j, q] = a ? [B[0], 1, B[1]] : [B[0], B[1], 1], [Y, J, re] = i ? [1, z[1], z[0]] : [z[1], 1, z[0]], ne = D * P, ee = me([O, D, P], _.dtype), oe = ee.values, ie = e.blockSize; - for (let le = 0; le < O; le++) { - let be = le % g, _e = le % x; - for (let ve = 0; ve < D; ve += ie) { - let Fe = Math.min(ve + ie, D); - for (let Pe = 0; Pe < P; Pe += ie) { - let st = Math.min(Pe + ie, P); - for (let ct = 0; ct < R; ct += ie) { - let Ge = Math.min(ct + ie, R); - for (let lt = ve; lt < Fe; lt++) - for (let it = Pe; it < st; it++) { - let ht = 0; - for (let gt = ct; gt < Ge; gt++) { - let Mr = M[be * U + lt * j + gt * q], Mt = L[gt * Y + it * J + _e * re]; - ht += Mr * Mt; + let p = n.shape.length, u = s.shape.length, l = a ? n.shape[p - 2] : n.shape[p - 1], c = i ? s.shape[u - 1] : s.shape[u - 2], m = a ? n.shape[p - 1] : n.shape[p - 2], d = i ? s.shape[u - 2] : s.shape[u - 1], f = n.shape.slice(0, -2), h = s.shape.slice(0, -2), g = y.sizeFromShape(f), x = y.sizeFromShape(h), w = kr.assertAndGetBroadcastShape(n.shape.slice(0, -2), s.shape.slice(0, -2)).concat([m, d]); + y.assert(l === c, () => `Error in matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`); + let S = a ? [g, l, m] : [g, m, l], k = i ? [x, d, c] : [x, c, d], T = We({ inputs: { x: n }, backend: t10, attrs: { shape: S } }), E = We({ inputs: { x: s }, backend: t10, attrs: { shape: k } }), R = a ? T.shape[1] : T.shape[2], D = a ? T.shape[2] : T.shape[1], F = i ? E.shape[1] : E.shape[2], O = Math.max(g, x), M = t10.data.get(T.dataId).values, L = t10.data.get(E.dataId).values, B = y.computeStrides(T.shape), z = y.computeStrides(E.shape), [U, j, q] = a ? [B[0], 1, B[1]] : [B[0], B[1], 1], [Y, J, re] = i ? [1, z[1], z[0]] : [z[1], 1, z[0]], ne = D * F, ee = ie([O, D, F], T.dtype), oe = ee.values, ue = t10.blockSize; + for (let me = 0; me < O; me++) { + let be = me % g, _e = me % x; + for (let ve = 0; ve < D; ve += ue) { + let Fe = Math.min(ve + ue, D); + for (let Pe = 0; Pe < F; Pe += ue) { + let at = Math.min(Pe + ue, F); + for (let ct = 0; ct < R; ct += ue) { + let Ke = Math.min(ct + ue, R); + for (let mt = ve; mt < Fe; mt++) + for (let ut = Pe; ut < at; ut++) { + let gt = 0; + for (let xt = ct; xt < Ke; xt++) { + let Ur = M[be * U + mt * j + xt * q], Bt = L[xt * Y + ut * J + _e * re]; + gt += Ur * Bt; } - oe[le * ne + (lt * P + it)] += ht; + oe[me * ne + (mt * F + ut)] += gt; } } } } } - return e.disposeIntermediateTensorInfo(_), e.disposeIntermediateTensorInfo(E), e.makeTensorInfo(C, ee.dtype, ee.values); + return t10.disposeIntermediateTensorInfo(T), t10.disposeIntermediateTensorInfo(E), t10.makeTensorInfo(w, ee.dtype, ee.values); } -var z_ = { kernelName: Zo, backendName: "cpu", kernelFunc: yI }; -function mY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s, bias: a, preluActivationWeights: i } = t8, { transposeA: p, transposeB: u, activation: c, leakyreluAlpha: l } = o, m, d, f, h = []; - m = yI({ inputs: { a: n, b: s }, attrs: { transposeA: p, transposeB: u }, backend: e }), a && (d = Pa({ inputs: { a: m, b: a }, backend: e }), h.push(m), m = d), c && (f = mp(e, m, c, i, l), h.push(m), m = f); +var RE = { kernelName: Nn, backendName: "cpu", kernelFunc: DI }; +function B7(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s, bias: a, preluActivationWeights: i } = e, { transposeA: p, transposeB: u, activation: l, leakyreluAlpha: c } = o, m, d, f, h = []; + m = DI({ inputs: { a: n, b: s }, attrs: { transposeA: p, transposeB: u }, backend: t10 }), a && (d = Wa({ inputs: { a: m, b: a }, backend: t10 }), h.push(m), m = d), l && (f = Cp(t10, m, l, i, c), h.push(m), m = f); for (let x of h) - e.disposeIntermediateTensorInfo(x); + t10.disposeIntermediateTensorInfo(x); return m; } -var V_ = { kernelName: So, backendName: "cpu", kernelFunc: mY }; -var dY = Ie(Vo, (r15) => Math.acos(r15)); -var W_ = { kernelName: Vo, backendName: "cpu", kernelFunc: dY }; -var fY = Ie(Wo, (r15) => Math.acosh(r15)); -var U_ = { kernelName: Wo, backendName: "cpu", kernelFunc: fY }; -function hY(r15) { - let { inputs: t8, backend: e } = r15, o = t8; - Q(t8, "addN"); - let n = o.map((i) => e.data.get(i.dataId).values), s = me(o[0].shape, o[0].dtype), a = s.values; +var DE = { kernelName: qo, backendName: "cpu", kernelFunc: B7 }; +var z7 = Ie(hn, (r16) => Math.acos(r16)); +var AE = { kernelName: hn, backendName: "cpu", kernelFunc: z7 }; +var V7 = Ie(gn, (r16) => Math.acosh(r16)); +var FE = { kernelName: gn, backendName: "cpu", kernelFunc: V7 }; +function W7(r16) { + let { inputs: e, backend: t10 } = r16, o = e; + Q(e, "addN"); + let n = o.map((i) => t10.data.get(i.dataId).values), s = ie(o[0].shape, o[0].dtype), a = s.values; for (let i = 0; i < o.length; i++) { let p = n[i]; for (let u = 0; u < a.length; u++) a[u] += p[u]; } - return e.makeTensorInfo(s.shape, s.dtype, s.values); + return t10.makeTensorInfo(s.shape, s.dtype, s.values); } -var G_ = { kernelName: Uo, backendName: "cpu", kernelFunc: hY }; -function gY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; +var PE = { kernelName: xn, backendName: "cpu", kernelFunc: W7 }; +function U7(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; Q(n, "all"); - let i = y.parseAxisParam(s, n.shape), p = i, u = w.getAxesPermutation(p, n.shape.length), c = n; - u != null && (c = St({ inputs: { x: n }, backend: e, attrs: { perm: u } }), p = w.getInnerMostAxes(p.length, n.shape.length)), w.assertAxesAreInnerMostDims("all", p, c.shape.length); - let [l, m] = w.computeOutAndReduceShapes(c.shape, p), d = y.sizeFromShape(m), f = y.makeZerosTypedArray(y.sizeFromShape(l), c.dtype), h = e.data.get(c.dataId).values; + let i = y.parseAxisParam(s, n.shape), p = i, u = C.getAxesPermutation(p, n.shape.length), l = n; + u != null && (l = vt({ inputs: { x: n }, backend: t10, attrs: { perm: u } }), p = C.getInnerMostAxes(p.length, n.shape.length)), C.assertAxesAreInnerMostDims("all", p, l.shape.length); + let [c, m] = C.computeOutAndReduceShapes(l.shape, p), d = y.sizeFromShape(m), f = y.makeZerosTypedArray(y.sizeFromShape(c), l.dtype), h = t10.data.get(l.dataId).values; for (let x = 0; x < f.length; ++x) { - let b = x * d, C = h[b]; + let b = x * d, w = h[b]; for (let S = 0; S < d; ++S) { let k = h[b + S]; - C = C && k; + w = w && k; } - f[x] = C; + f[x] = w; } - u != null && e.disposeIntermediateTensorInfo(c); - let g = e.makeTensorInfo(l, c.dtype, f); + u != null && t10.disposeIntermediateTensorInfo(l); + let g = t10.makeTensorInfo(c, l.dtype, f); if (a) { - let x = w.expandShapeToKeepDim(l, i), b = Ve({ inputs: { x: g }, backend: e, attrs: { shape: x } }); - return e.disposeIntermediateTensorInfo(g), b; + let x = C.expandShapeToKeepDim(c, i), b = We({ inputs: { x: g }, backend: t10, attrs: { shape: x } }); + return t10.disposeIntermediateTensorInfo(g), b; } return g; } -var H_ = { kernelName: Go, backendName: "cpu", kernelFunc: gY }; -function xY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; +var OE = { kernelName: yn, backendName: "cpu", kernelFunc: U7 }; +function G7(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; Q(n, "any"); - let i = y.parseAxisParam(s, n.shape), p = i, u = w.getAxesPermutation(p, n.shape.length), c = n; - u != null && (c = St({ inputs: { x: n }, backend: e, attrs: { perm: u } }), p = w.getInnerMostAxes(p.length, n.shape.length)), w.assertAxesAreInnerMostDims("any", p, c.shape.length); - let [l, m] = w.computeOutAndReduceShapes(c.shape, p), d = y.sizeFromShape(m), f = y.makeZerosTypedArray(y.sizeFromShape(l), c.dtype), h = e.data.get(c.dataId).values; + let i = y.parseAxisParam(s, n.shape), p = i, u = C.getAxesPermutation(p, n.shape.length), l = n; + u != null && (l = vt({ inputs: { x: n }, backend: t10, attrs: { perm: u } }), p = C.getInnerMostAxes(p.length, n.shape.length)), C.assertAxesAreInnerMostDims("any", p, l.shape.length); + let [c, m] = C.computeOutAndReduceShapes(l.shape, p), d = y.sizeFromShape(m), f = y.makeZerosTypedArray(y.sizeFromShape(c), l.dtype), h = t10.data.get(l.dataId).values; for (let x = 0; x < f.length; ++x) { - let b = x * d, C = h[b]; + let b = x * d, w = h[b]; for (let S = 0; S < d; ++S) { let k = h[b + S]; - C = C || k; + w = w || k; } - f[x] = C; + f[x] = w; } - u != null && e.disposeIntermediateTensorInfo(c); - let g = e.makeTensorInfo(l, c.dtype, f); + u != null && t10.disposeIntermediateTensorInfo(l); + let g = t10.makeTensorInfo(c, l.dtype, f); if (a) { - let x = w.expandShapeToKeepDim(l, i), b = Ve({ inputs: { x: g }, backend: e, attrs: { shape: x } }); - return e.disposeIntermediateTensorInfo(g), b; + let x = C.expandShapeToKeepDim(c, i), b = We({ inputs: { x: g }, backend: t10, attrs: { shape: x } }); + return t10.disposeIntermediateTensorInfo(g), b; } return g; } -var K_ = { kernelName: Ho, backendName: "cpu", kernelFunc: xY }; -function yY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s } = o; +var ME = { kernelName: bn, backendName: "cpu", kernelFunc: G7 }; +function H7(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s } = o; Q(n, "argMax"); - let a = y.parseAxisParam(s, n.shape), i = w.getAxesPermutation(a, n.shape.length), p = n, u = []; - i != null && (p = St({ inputs: { x: n }, backend: e, attrs: { perm: i } }), u.push(p), a = w.getInnerMostAxes(a.length, p.shape.length)), a = [a[0]], w.assertAxesAreInnerMostDims("argMax", a, p.shape.length); - let [c, l] = w.computeOutAndReduceShapes(p.shape, a), m = y.sizeFromShape(c), d = y.makeZerosTypedArray(m, "int32"), f = y.sizeFromShape(l), h = e.data.get(p.dataId).values; + let a = y.parseAxisParam(s, n.shape), i = C.getAxesPermutation(a, n.shape.length), p = n, u = []; + i != null && (p = vt({ inputs: { x: n }, backend: t10, attrs: { perm: i } }), u.push(p), a = C.getInnerMostAxes(a.length, p.shape.length)), a = [a[0]], C.assertAxesAreInnerMostDims("argMax", a, p.shape.length); + let [l, c] = C.computeOutAndReduceShapes(p.shape, a), m = y.sizeFromShape(l), d = y.makeZerosTypedArray(m, "int32"), f = y.sizeFromShape(c), h = t10.data.get(p.dataId).values; for (let g = 0; g < d.length; ++g) { - let x = g * f, b = h[x], C = 0; + let x = g * f, b = h[x], w = 0; for (let S = 0; S < f; ++S) { let k = h[x + S]; - k > b && (b = k, C = S); + k > b && (b = k, w = S); } - d[g] = C; + d[g] = w; } - return u.forEach((g) => e.disposeIntermediateTensorInfo(g)), e.makeTensorInfo(c, "int32", d); + return u.forEach((g) => t10.disposeIntermediateTensorInfo(g)), t10.makeTensorInfo(l, "int32", d); } -var q_ = { kernelName: Ys, backendName: "cpu", kernelFunc: yY }; -function bY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s } = o; +var LE = { kernelName: na, backendName: "cpu", kernelFunc: H7 }; +function K7(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s } = o; Q(n, "argMin"); - let a = y.parseAxisParam(s, n.shape), i = w.getAxesPermutation(a, n.shape.length), p = n, u = []; - i != null && (p = St({ inputs: { x: n }, backend: e, attrs: { perm: i } }), u.push(p), a = w.getInnerMostAxes(a.length, p.shape.length)), a = [a[0]], w.assertAxesAreInnerMostDims("argMin", a, p.shape.length); - let [c, l] = w.computeOutAndReduceShapes(p.shape, a), m = y.sizeFromShape(c), d = y.makeZerosTypedArray(m, "int32"), f = y.sizeFromShape(l), h = e.data.get(p.dataId).values; + let a = y.parseAxisParam(s, n.shape), i = C.getAxesPermutation(a, n.shape.length), p = n, u = []; + i != null && (p = vt({ inputs: { x: n }, backend: t10, attrs: { perm: i } }), u.push(p), a = C.getInnerMostAxes(a.length, p.shape.length)), a = [a[0]], C.assertAxesAreInnerMostDims("argMin", a, p.shape.length); + let [l, c] = C.computeOutAndReduceShapes(p.shape, a), m = y.sizeFromShape(l), d = y.makeZerosTypedArray(m, "int32"), f = y.sizeFromShape(c), h = t10.data.get(p.dataId).values; for (let g = 0; g < d.length; ++g) { - let x = g * f, b = h[x], C = 0; + let x = g * f, b = h[x], w = 0; for (let S = 0; S < f; ++S) { let k = h[x + S]; - k < b && (b = k, C = S); - } - d[g] = C; - } - return u.forEach((g) => e.disposeIntermediateTensorInfo(g)), e.makeTensorInfo(c, "int32", d); -} -var j_ = { kernelName: Qs, backendName: "cpu", kernelFunc: bY }; -var CY = Ie(Ko, (r15) => Math.asin(r15)); -var X_ = { kernelName: Ko, backendName: "cpu", kernelFunc: CY }; -var wY = Ie(qo, (r15) => Math.asinh(r15)); -var Y_ = { kernelName: qo, backendName: "cpu", kernelFunc: wY }; -var SY = Ie(jo, (r15) => Math.atan(r15)); -var Q_ = { kernelName: jo, backendName: "cpu", kernelFunc: SY }; -var IY = ze((r15, t8) => Math.atan2(r15, t8)); -var vY = Ye(Yo, IY); -var Z_ = { kernelName: Yo, backendName: "cpu", kernelFunc: vY }; -var kY = Ie(Xo, (r15) => Math.atanh(r15)); -var J_ = { kernelName: Xo, backendName: "cpu", kernelFunc: kY }; -function Sc(r15, t8, e, o, n, s) { - let a = n.strideHeight, i = n.strideWidth, p = n.dilationHeight, u = n.dilationWidth, c = n.effectiveFilterHeight, l = n.effectiveFilterWidth, m = n.padInfo.top, d = n.padInfo.left, f = s === "max" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, h = me(n.outShape, e), g = h.values, x = n.outShape[1] * n.outShape[2] * n.outShape[3], b = n.outShape[2] * n.outShape[3], C = n.outShape[3]; + k < b && (b = k, w = S); + } + d[g] = w; + } + return u.forEach((g) => t10.disposeIntermediateTensorInfo(g)), t10.makeTensorInfo(l, "int32", d); +} +var BE = { kernelName: sa, backendName: "cpu", kernelFunc: K7 }; +var q7 = Ie(Cn, (r16) => Math.asin(r16)); +var zE = { kernelName: Cn, backendName: "cpu", kernelFunc: q7 }; +var j7 = Ie(wn, (r16) => Math.asinh(r16)); +var VE = { kernelName: wn, backendName: "cpu", kernelFunc: j7 }; +var X7 = Ie(Sn, (r16) => Math.atan(r16)); +var WE = { kernelName: Sn, backendName: "cpu", kernelFunc: X7 }; +var Y7 = Ve((r16, e) => Math.atan2(r16, e)); +var Q7 = Qe(vn, Y7); +var UE = { kernelName: vn, backendName: "cpu", kernelFunc: Q7 }; +var Z7 = Ie(In, (r16) => Math.atanh(r16)); +var GE = { kernelName: In, backendName: "cpu", kernelFunc: Z7 }; +function El(r16, e, t10, o, n, s) { + let a = n.strideHeight, i = n.strideWidth, p = n.dilationHeight, u = n.dilationWidth, l = n.effectiveFilterHeight, c = n.effectiveFilterWidth, m = n.padInfo.top, d = n.padInfo.left, f = s === "max" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, h = ie(n.outShape, t10), g = h.values, x = n.outShape[1] * n.outShape[2] * n.outShape[3], b = n.outShape[2] * n.outShape[3], w = n.outShape[3]; for (let S = 0; S < n.batchSize; ++S) { - let k = S * x, _ = S * o[0]; + let k = S * x, T = S * o[0]; for (let E = 0; E < n.inChannels; ++E) for (let R = 0; R < n.outHeight; ++R) { - let D = R * a - m, P = Math.max(0, D), O = Math.min(n.inHeight, c + D), M = k + R * b; + let D = R * a - m, F = Math.max(0, D), O = Math.min(n.inHeight, l + D), M = k + R * b; for (let L = 0; L < n.outWidth; ++L) { - let B = L * i - d, z = Math.max(0, B), U = Math.min(n.inWidth, l + B), j = f, q = 0, Y = 0; - for (let re = P; re < O; re += p) { - let ne = _ + re * o[1]; + let B = L * i - d, z = Math.max(0, B), U = Math.min(n.inWidth, c + B), j = f, q = 0, Y = 0; + for (let re = F; re < O; re += p) { + let ne = T + re * o[1]; for (let ee = z; ee < U; ee += u) { - let oe = ne + ee * o[2], ie = r15[oe + E]; - s === "max" && ie > j ? j = ie : s === "avg" && (q += ie, Y++); + let oe = ne + ee * o[2], ue = r16[oe + E]; + s === "max" && ue > j ? j = ue : s === "avg" && (q += ue, Y++); } if (isNaN(j)) break; } - let J = M + L * C + E; + let J = M + L * w + E; g[J] = s === "avg" ? q / Y : j; } } } return h; } -function Lf(r15, t8, e, o, n = false, s = false) { - let a = me(o.outShape, "int32"), i = o.strideHeight, p = o.strideWidth, u = o.dilationHeight, c = o.dilationWidth, l = o.effectiveFilterHeight, m = o.effectiveFilterWidth, d = o.padInfo.top, f = o.padInfo.left, h = me(t8, e, r15); +function Yf(r16, e, t10, o, n = false, s = false) { + let a = ie(o.outShape, "int32"), i = o.strideHeight, p = o.strideWidth, u = o.dilationHeight, l = o.dilationWidth, c = o.effectiveFilterHeight, m = o.effectiveFilterWidth, d = o.padInfo.top, f = o.padInfo.left, h = ie(e, t10, r16); for (let g = 0; g < o.batchSize; ++g) for (let x = 0; x < o.inChannels; ++x) for (let b = 0; b < o.outHeight; ++b) { - let C = b * i - d, S = C; + let w = b * i - d, S = w; for (; S < 0; ) S += u; - let k = Math.min(o.inHeight, l + C); - for (let _ = 0; _ < o.outWidth; ++_) { - let E = _ * p - f, R = E; + let k = Math.min(o.inHeight, c + w); + for (let T = 0; T < o.outWidth; ++T) { + let E = T * p - f, R = E; for (; R < 0; ) - R += c; - let D = Math.min(o.inWidth, m + E), P = Number.NEGATIVE_INFINITY, O = -1; + R += l; + let D = Math.min(o.inWidth, m + E), F = Number.NEGATIVE_INFINITY, O = -1; for (let M = S; M < k; M += u) { - let L = M - C; - for (let B = R; B < D; B += c) { + let L = M - w; + for (let B = R; B < D; B += l) { let z = B - E, U = h.get(g, M, B, x); - U > P && (P = U, n ? O = s ? ((g * o.inHeight + M) * o.inWidth + B) * o.inChannels + x : (M * o.inWidth + B) * o.inChannels + x : O = L * m + z); + U > F && (F = U, n ? O = s ? ((g * o.inHeight + M) * o.inWidth + B) * o.inChannels + x : (M * o.inWidth + B) * o.inChannels + x : O = L * m + z); } } - a.set(O, g, b, _, x); + a.set(O, g, b, T, x); } } return a; } -function Bf(r15, t8, e, o, n, s) { - let a = n.strideDepth, i = n.strideHeight, p = n.strideWidth, u = n.dilationDepth, c = n.dilationHeight, l = n.dilationWidth, m = n.effectiveFilterDepth, d = n.effectiveFilterHeight, f = n.effectiveFilterWidth, h = n.padInfo.front, g = n.padInfo.top, x = n.padInfo.left, b = s === "max" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, C = me(n.outShape, e), S = C.values, k = n.outShape[1] * n.outShape[2] * n.outShape[3] * n.outShape[4], _ = n.outShape[2] * n.outShape[3] * n.outShape[4], E = n.outShape[3] * n.outShape[4], R = n.outShape[4]; +function Qf(r16, e, t10, o, n, s) { + let a = n.strideDepth, i = n.strideHeight, p = n.strideWidth, u = n.dilationDepth, l = n.dilationHeight, c = n.dilationWidth, m = n.effectiveFilterDepth, d = n.effectiveFilterHeight, f = n.effectiveFilterWidth, h = n.padInfo.front, g = n.padInfo.top, x = n.padInfo.left, b = s === "max" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY, w = ie(n.outShape, t10), S = w.values, k = n.outShape[1] * n.outShape[2] * n.outShape[3] * n.outShape[4], T = n.outShape[2] * n.outShape[3] * n.outShape[4], E = n.outShape[3] * n.outShape[4], R = n.outShape[4]; for (let D = 0; D < n.batchSize; ++D) { - let P = D * k, O = D * o[0]; + let F = D * k, O = D * o[0]; for (let M = 0; M < n.inChannels; ++M) for (let L = 0; L < n.outDepth; ++L) { let B = L * a - h, z = B; for (; z < 0; ) z += u; - let U = Math.min(n.inDepth, m + B), j = P + L * _; + let U = Math.min(n.inDepth, m + B), j = F + L * T; for (let q = 0; q < n.outHeight; ++q) { let Y = q * i - g, J = Y; for (; J < 0; ) - J += c; + J += l; let re = Math.min(n.inHeight, d + Y), ne = j + q * E; for (let ee = 0; ee < n.outWidth; ++ee) { - let oe = ee * p - x, ie = oe; - for (; ie < 0; ) - ie += l; - let le = Math.min(n.inWidth, f + oe), be = ne + ee * R, _e = b, ve = 0, Fe = 0; - for (let st = z; st < U; st += u) { - let ct = O + st * o[1]; - for (let Ge = J; Ge < re; Ge += c) { - let lt = ct + Ge * o[2]; - for (let it = ie; it < le; it += l) { - let ht = lt + it * o[3], gt = r15[ht + M]; - if (s === "max" && gt > _e ? _e = gt : s === "avg" && (ve += gt, Fe++), isNaN(_e)) + let oe = ee * p - x, ue = oe; + for (; ue < 0; ) + ue += c; + let me = Math.min(n.inWidth, f + oe), be = ne + ee * R, _e = b, ve = 0, Fe = 0; + for (let at = z; at < U; at += u) { + let ct = O + at * o[1]; + for (let Ke = J; Ke < re; Ke += l) { + let mt = ct + Ke * o[2]; + for (let ut = ue; ut < me; ut += c) { + let gt = mt + ut * o[3], xt = r16[gt + M]; + if (s === "max" && xt > _e ? _e = xt : s === "avg" && (ve += xt, Fe++), isNaN(_e)) break; } if (isNaN(_e)) @@ -13481,239 +13581,239 @@ function Bf(r15, t8, e, o, n, s) { } } } - return C; + return w; } -function e$(r15, t8) { - let e = me(t8.outShape, "int32"), o = t8.strideDepth, n = t8.strideHeight, s = t8.strideWidth, a = t8.dilationDepth, i = t8.dilationHeight, p = t8.dilationWidth, u = t8.effectiveFilterDepth, c = t8.effectiveFilterHeight, l = t8.effectiveFilterWidth, m = t8.padInfo.front, d = t8.padInfo.top, f = t8.padInfo.left; - for (let h = 0; h < t8.batchSize; ++h) - for (let g = 0; g < t8.inChannels; ++g) - for (let x = 0; x < t8.outDepth; ++x) { - let b = x * o - m, C = b; - for (; C < 0; ) - C += a; - let S = Math.min(t8.inDepth, u + b); - for (let k = 0; k < t8.outHeight; ++k) { - let _ = k * n - d, E = _; +function HE(r16, e) { + let t10 = ie(e.outShape, "int32"), o = e.strideDepth, n = e.strideHeight, s = e.strideWidth, a = e.dilationDepth, i = e.dilationHeight, p = e.dilationWidth, u = e.effectiveFilterDepth, l = e.effectiveFilterHeight, c = e.effectiveFilterWidth, m = e.padInfo.front, d = e.padInfo.top, f = e.padInfo.left; + for (let h = 0; h < e.batchSize; ++h) + for (let g = 0; g < e.inChannels; ++g) + for (let x = 0; x < e.outDepth; ++x) { + let b = x * o - m, w = b; + for (; w < 0; ) + w += a; + let S = Math.min(e.inDepth, u + b); + for (let k = 0; k < e.outHeight; ++k) { + let T = k * n - d, E = T; for (; E < 0; ) E += i; - let R = Math.min(t8.inHeight, c + _); - for (let D = 0; D < t8.outWidth; ++D) { - let P = D * s - f, O = P; + let R = Math.min(e.inHeight, l + T); + for (let D = 0; D < e.outWidth; ++D) { + let F = D * s - f, O = F; for (; O < 0; ) O += p; - let M = Math.min(t8.inWidth, l + P), L = Number.NEGATIVE_INFINITY, B = -1; - for (let z = C; z < S; z += a) { + let M = Math.min(e.inWidth, c + F), L = Number.NEGATIVE_INFINITY, B = -1; + for (let z = w; z < S; z += a) { let U = z - b; for (let j = E; j < R; j += i) { - let q = j - _; + let q = j - T; for (let Y = O; Y < M; Y += p) { - let J = Y - P, re = r15.get(h, z, j, Y, g); - re >= L && (L = re, B = U * c * l + q * c + J); + let J = Y - F, re = r16.get(h, z, j, Y, g); + re >= L && (L = re, B = U * l * c + q * l + J); } } } - e.set(B, h, x, k, D, g); + t10.set(B, h, x, k, D, g); } } } - return e; + return t10; } -function NY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8; +function J7(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e; Q(n, "avgPool"); let { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, u = 1; - y.assert(w.eitherStridesOrDilationsAreOne(a, u), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); - let c = w.computePool2DInfo(n.shape, s, a, u, i, p), l; - if (c.filterWidth === 1 && c.filterHeight === 1 && y.arraysEqual(c.inShape, c.outShape)) - l = lr({ inputs: { x: n }, backend: e }); + y.assert(C.eitherStridesOrDilationsAreOne(a, u), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); + let l = C.computePool2DInfo(n.shape, s, a, u, i, p), c; + if (l.filterWidth === 1 && l.filterHeight === 1 && y.arraysEqual(l.inShape, l.outShape)) + c = fr({ inputs: { x: n }, backend: t10 }); else { - let m = e.data.get(n.dataId).values, d = y.computeStrides(n.shape), f = Sc(m, n.shape, n.dtype, d, c, "avg"); - l = e.makeTensorInfo(c.outShape, n.dtype, f.values); + let m = t10.data.get(n.dataId).values, d = y.computeStrides(n.shape), f = El(m, n.shape, n.dtype, d, l, "avg"); + c = t10.makeTensorInfo(l.outShape, n.dtype, f.values); } - return l; + return c; } -var t$ = { kernelName: Qo, backendName: "cpu", kernelFunc: NY }; -function TY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o; +var KE = { kernelName: kn, backendName: "cpu", kernelFunc: J7 }; +function eQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o; Q(n, "avgPool3d"); - let c = w.computePool3DInfo(n.shape, s, a, 1, i, p, u), l = e.data.get(n.dataId).values, m = Bf(l, n.shape, n.dtype, y.computeStrides(n.shape), c, "avg"); - return e.makeTensorInfo(m.shape, "float32", m.values); + let l = C.computePool3DInfo(n.shape, s, a, 1, i, p, u), c = t10.data.get(n.dataId).values, m = Qf(c, n.shape, n.dtype, y.computeStrides(n.shape), l, "avg"); + return t10.makeTensorInfo(m.shape, "float32", m.values); } -var r$ = { kernelName: Zs, backendName: "cpu", kernelFunc: TY }; -function _Y(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o; +var qE = { kernelName: aa, backendName: "cpu", kernelFunc: eQ }; +function tQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o; Q([n, s], "avgPool3DGrad"); - let c = w.computePool3DInfo(s.shape, a, i, 1, p, u), l = c.strideDepth, m = c.strideHeight, d = c.strideWidth, f = c.filterDepth, h = c.filterHeight, g = c.filterWidth, x = c.dilationDepth, b = c.dilationHeight, C = c.dilationWidth, S = c.effectiveFilterDepth, k = c.effectiveFilterHeight, _ = c.effectiveFilterWidth, E = S - 1 - c.padInfo.front, R = _ - 1 - c.padInfo.left, D = k - 1 - c.padInfo.top, P = me(s.shape, "float32"), O = 1 / (f * h * g), M = e.bufferSync(n); - for (let L = 0; L < c.batchSize; ++L) - for (let B = 0; B < c.inChannels; ++B) - for (let z = 0; z < c.inDepth; ++z) - for (let U = 0; U < c.inHeight; ++U) - for (let j = 0; j < c.inWidth; ++j) { + let l = C.computePool3DInfo(s.shape, a, i, 1, p, u), c = l.strideDepth, m = l.strideHeight, d = l.strideWidth, f = l.filterDepth, h = l.filterHeight, g = l.filterWidth, x = l.dilationDepth, b = l.dilationHeight, w = l.dilationWidth, S = l.effectiveFilterDepth, k = l.effectiveFilterHeight, T = l.effectiveFilterWidth, E = S - 1 - l.padInfo.front, R = T - 1 - l.padInfo.left, D = k - 1 - l.padInfo.top, F = ie(s.shape, "float32"), O = 1 / (f * h * g), M = t10.bufferSync(n); + for (let L = 0; L < l.batchSize; ++L) + for (let B = 0; B < l.inChannels; ++B) + for (let z = 0; z < l.inDepth; ++z) + for (let U = 0; U < l.inHeight; ++U) + for (let j = 0; j < l.inWidth; ++j) { let q = z - E, Y = U - D, J = j - R, re = 0; for (let ne = 0; ne < S; ne += x) { - let ee = (q + ne) / l; - if (!(ee < 0 || ee >= c.outDepth || Math.floor(ee) !== ee)) + let ee = (q + ne) / c; + if (!(ee < 0 || ee >= l.outDepth || Math.floor(ee) !== ee)) for (let oe = 0; oe < k; oe += b) { - let ie = (Y + oe) / m; - if (!(ie < 0 || ie >= c.outHeight || Math.floor(ie) !== ie)) - for (let le = 0; le < _; le += C) { - let be = (J + le) / d; - if (be < 0 || be >= c.outWidth || Math.floor(be) !== be) + let ue = (Y + oe) / m; + if (!(ue < 0 || ue >= l.outHeight || Math.floor(ue) !== ue)) + for (let me = 0; me < T; me += w) { + let be = (J + me) / d; + if (be < 0 || be >= l.outWidth || Math.floor(be) !== be) continue; - let _e = M.get(L, ee, ie, be, B); + let _e = M.get(L, ee, ue, be, B); re += _e; } } } - P.set(re * O, L, z, U, j, B); + F.set(re * O, L, z, U, j, B); } - return e.makeTensorInfo(P.shape, P.dtype, P.values); + return t10.makeTensorInfo(F.shape, F.dtype, F.values); } -var o$ = { kernelName: Ei, backendName: "cpu", kernelFunc: _Y }; -function $Y(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, a = s; +var jE = { kernelName: Vi, backendName: "cpu", kernelFunc: tQ }; +function rQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, a = s; Q([n, s], "avgPoolGrad"); - let { filterSize: i, strides: p, pad: u } = o, c = w.computePool2DInfo(a.shape, i, p, 1, u), l = c.strideHeight, m = c.strideWidth, d = c.filterHeight, f = c.filterWidth, h = c.dilationHeight, g = c.dilationWidth, x = c.effectiveFilterHeight, b = c.effectiveFilterWidth, C = b - 1 - c.padInfo.left, S = x - 1 - c.padInfo.top, k = me(a.shape, "float32"), _ = 1 / (d * f), E = e.data.get(n.dataId).values, R = me(n.shape, "float32", E); - for (let D = 0; D < c.batchSize; ++D) - for (let P = 0; P < c.inChannels; ++P) - for (let O = 0; O < c.inHeight; ++O) - for (let M = 0; M < c.inWidth; ++M) { - let L = O - S, B = M - C, z = 0; + let { filterSize: i, strides: p, pad: u } = o, l = C.computePool2DInfo(a.shape, i, p, 1, u), c = l.strideHeight, m = l.strideWidth, d = l.filterHeight, f = l.filterWidth, h = l.dilationHeight, g = l.dilationWidth, x = l.effectiveFilterHeight, b = l.effectiveFilterWidth, w = b - 1 - l.padInfo.left, S = x - 1 - l.padInfo.top, k = ie(a.shape, "float32"), T = 1 / (d * f), E = t10.data.get(n.dataId).values, R = ie(n.shape, "float32", E); + for (let D = 0; D < l.batchSize; ++D) + for (let F = 0; F < l.inChannels; ++F) + for (let O = 0; O < l.inHeight; ++O) + for (let M = 0; M < l.inWidth; ++M) { + let L = O - S, B = M - w, z = 0; for (let U = 0; U < x; U += h) { - let j = (L + U) / l; - if (!(j < 0 || j >= c.outHeight || Math.floor(j) !== j)) + let j = (L + U) / c; + if (!(j < 0 || j >= l.outHeight || Math.floor(j) !== j)) for (let q = 0; q < b; q += g) { let Y = (B + q) / m; - if (Y < 0 || Y >= c.outWidth || Math.floor(Y) !== Y) + if (Y < 0 || Y >= l.outWidth || Math.floor(Y) !== Y) continue; - let J = R.get(D, j, Y, P); + let J = R.get(D, j, Y, F); z += J; } } - k.set(z * _, D, O, M, P); + k.set(z * T, D, O, M, F); } - return e.makeTensorInfo(k.shape, k.dtype, k.values); + return t10.makeTensorInfo(k.shape, k.dtype, k.values); } -var n$ = { kernelName: $i, backendName: "cpu", kernelFunc: $Y }; -function EY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, scale: s, offset: a, mean: i, variance: p } = t8; +var XE = { kernelName: zi, backendName: "cpu", kernelFunc: rQ }; +function oQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, scale: s, offset: a, mean: i, variance: p } = e; y.assert(i.shape.length === p.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."), y.assert(a == null || i.shape.length === a.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."), y.assert(s == null || i.shape.length === s.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."), Q([n, i, p, s, a], "batchNorm"); let { varianceEpsilon: u } = o; u == null && (u = 1e-3); - let c = e.data.get(n.dataId).values, l = e.data.get(i.dataId).values, m = e.data.get(p.dataId).values, d = s ? e.data.get(s.dataId).values : new Float32Array([1]), f = a ? e.data.get(a.dataId).values : new Float32Array([0]), h = new Float32Array(c.length), g = f.length, x = d.length, b = m.length, C = l.length, S = 0, k = 0, _ = 0, E = 0; - for (let R = 0; R < c.length; ++R) - h[R] = f[S++] + (c[R] - l[k++]) * d[_++] / Math.sqrt(m[E++] + u), S >= g && (S = 0), k >= C && (k = 0), _ >= x && (_ = 0), E >= b && (E = 0); - return e.makeTensorInfo(n.shape, n.dtype, h); -} -var s$ = { kernelName: In, backendName: "cpu", kernelFunc: EY }; -function RY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, crops: a } = o; + let l = t10.data.get(n.dataId).values, c = t10.data.get(i.dataId).values, m = t10.data.get(p.dataId).values, d = s ? t10.data.get(s.dataId).values : new Float32Array([1]), f = a ? t10.data.get(a.dataId).values : new Float32Array([0]), h = new Float32Array(l.length), g = f.length, x = d.length, b = m.length, w = c.length, S = 0, k = 0, T = 0, E = 0; + for (let R = 0; R < l.length; ++R) + h[R] = f[S++] + (l[R] - c[k++]) * d[T++] / Math.sqrt(m[E++] + u), S >= g && (S = 0), k >= w && (k = 0), T >= x && (T = 0), E >= b && (E = 0); + return t10.makeTensorInfo(n.shape, n.dtype, h); +} +var YE = { kernelName: Hn, backendName: "cpu", kernelFunc: oQ }; +function nQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, crops: a } = o; Q([n], "batchToSpaceND"); - let i = s.reduce((x, b) => x * b), p = w.getReshaped(n.shape, s, i), u = w.getPermuted(p.length, s.length), c = w.getReshapedPermuted(n.shape, s, i), l = w.getSliceBeginCoords(a, s.length), m = w.getSliceSize(c, a, s.length), d = Ve({ inputs: { x: n }, backend: e, attrs: { shape: p } }), f = St({ inputs: { x: d }, backend: e, attrs: { perm: u } }), h = Ve({ inputs: { x: f }, backend: e, attrs: { shape: c } }), g = Ao({ inputs: { x: h }, backend: e, attrs: { begin: l, size: m } }); - return e.disposeIntermediateTensorInfo(d), e.disposeIntermediateTensorInfo(f), e.disposeIntermediateTensorInfo(h), g; -} -var a$ = { kernelName: Js, backendName: "cpu", kernelFunc: RY }; -function DY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, weights: s } = t8, { size: a } = o, i = e.data.get(n.dataId).values, p = e.data.get(s.dataId).values, u = yc(i, p, s.dtype, s.shape, a); - return e.makeTensorInfo([a], s.dtype, u); -} -var i$ = { kernelName: Jo, backendName: "cpu", kernelFunc: DY }; -function AY(r15) { - let { inputs: t8, backend: e } = r15, { s0: o, s1: n } = t8, s = e.data.get(o.dataId).values, a = e.data.get(n.dataId).values, i = w.assertAndGetBroadcastShape(Array.from(s), Array.from(a)); - return e.makeTensorInfo([i.length], "int32", Int32Array.from(i)); -} -var u$ = { kernelName: ea, backendName: "cpu", kernelFunc: AY }; -var FY = Ie(bo, (r15, t8) => { - let e = t8; - return r15 > e.clipValueMax ? e.clipValueMax : r15 < e.clipValueMin ? e.clipValueMin : r15; + let i = s.reduce((x, b) => x * b), p = C.getReshaped(n.shape, s, i), u = C.getPermuted(p.length, s.length), l = C.getReshapedPermuted(n.shape, s, i), c = C.getSliceBeginCoords(a, s.length), m = C.getSliceSize(l, a, s.length), d = We({ inputs: { x: n }, backend: t10, attrs: { shape: p } }), f = vt({ inputs: { x: d }, backend: t10, attrs: { perm: u } }), h = We({ inputs: { x: f }, backend: t10, attrs: { shape: l } }), g = nn({ inputs: { x: h }, backend: t10, attrs: { begin: c, size: m } }); + return t10.disposeIntermediateTensorInfo(d), t10.disposeIntermediateTensorInfo(f), t10.disposeIntermediateTensorInfo(h), g; +} +var QE = { kernelName: ia, backendName: "cpu", kernelFunc: nQ }; +function sQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, weights: s } = e, { size: a } = o, i = t10.data.get(n.dataId).values, p = t10.data.get(s.dataId).values, u = Nl(i, p, s.dtype, s.shape, a); + return t10.makeTensorInfo([a], s.dtype, u); +} +var ZE = { kernelName: Tn, backendName: "cpu", kernelFunc: sQ }; +function aQ(r16) { + let { inputs: e, backend: t10 } = r16, { s0: o, s1: n } = e, s = t10.data.get(o.dataId).values, a = t10.data.get(n.dataId).values, i = C.assertAndGetBroadcastShape(Array.from(s), Array.from(a)); + return t10.makeTensorInfo([i.length], "int32", Int32Array.from(i)); +} +var JE = { kernelName: ua, backendName: "cpu", kernelFunc: aQ }; +var iQ = Ie(Go, (r16, e) => { + let t10 = e; + return r16 > t10.clipValueMax ? t10.clipValueMax : r16 < t10.clipValueMin ? t10.clipValueMin : r16; }); -var p$ = { kernelName: bo, backendName: "cpu", kernelFunc: FY }; -var PY = (r15) => { - let { x: t8 } = r15.inputs, e = r15.backend, o = new Float32Array(y.sizeFromShape(t8.shape)), n = e.data.get(t8.dataId), s = n.complexTensorInfos.real, a = n.complexTensorInfos.imag, i = e.data.get(s.dataId).values, p = e.data.get(a.dataId).values; +var e$ = { kernelName: Go, backendName: "cpu", kernelFunc: iQ }; +var uQ = (r16) => { + let { x: e } = r16.inputs, t10 = r16.backend, o = new Float32Array(y.sizeFromShape(e.shape)), n = t10.data.get(e.dataId), s = n.complexTensorInfos.real, a = n.complexTensorInfos.imag, i = t10.data.get(s.dataId).values, p = t10.data.get(a.dataId).values; for (let u = 0; u < i.length; u++) { - let c = i[u], l = p[u]; - o[u] = Math.hypot(c, l); + let l = i[u], c = p[u]; + o[u] = Math.hypot(l, c); } - return e.makeOutput(o, t8.shape, "float32"); + return t10.makeOutput(o, e.shape, "float32"); }; -var c$ = { kernelName: Di, backendName: "cpu", kernelFunc: PY }; -function Oa(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = e.data.get(o.dataId).complexTensorInfos.imag, s = e.data.get(n.dataId).values; - return e.makeTensorInfo(n.shape, n.dtype, s); +var t$ = { kernelName: Wi, backendName: "cpu", kernelFunc: uQ }; +function Ua(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = t10.data.get(o.dataId).complexTensorInfos.imag, s = t10.data.get(n.dataId).values; + return t10.makeTensorInfo(n.shape, n.dtype, s); } -var l$ = { kernelName: Vi, backendName: "cpu", kernelFunc: Oa }; -function du(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { axis: n } = o, s = y.parseAxisParam(n, t8[0].shape)[0], a = t8.map((h) => h.shape); - w.assertParamsConsistent(a, s); - let i = w.computeOutShape(t8.map((h) => h.shape), s); +var r$ = { kernelName: Qi, backendName: "cpu", kernelFunc: Ua }; +function Su(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { axis: n } = o, s = y.parseAxisParam(n, e[0].shape)[0], a = e.map((h) => h.shape); + C.assertParamsConsistent(a, s); + let i = C.computeOutShape(e.map((h) => h.shape), s); if (y.sizeFromShape(i) === 0) - return e.makeTensorInfo(i, t8[0].dtype, []); - let p = t8.filter((h) => y.sizeFromShape(h.shape) > 0); + return t10.makeTensorInfo(i, e[0].dtype, []); + let p = e.filter((h) => y.sizeFromShape(h.shape) > 0); if (p.length === 1) - return lr({ inputs: { x: p[0] }, backend: e }); + return fr({ inputs: { x: p[0] }, backend: t10 }); if (p[0].dtype === "complex64") { - let h = p.map((S) => Eo({ inputs: { input: S }, backend: e })), g = p.map((S) => Oa({ inputs: { input: S }, backend: e })), x = du({ inputs: h, backend: e, attrs: { axis: s } }), b = du({ inputs: g, backend: e, attrs: { axis: s } }), C = Ht({ inputs: { real: x, imag: b }, backend: e }); - return h.forEach((S) => e.disposeIntermediateTensorInfo(S)), g.forEach((S) => e.disposeIntermediateTensorInfo(S)), e.disposeIntermediateTensorInfo(x), e.disposeIntermediateTensorInfo(b), C; + let h = p.map((S) => tn({ inputs: { input: S }, backend: t10 })), g = p.map((S) => Ua({ inputs: { input: S }, backend: t10 })), x = Su({ inputs: h, backend: t10, attrs: { axis: s } }), b = Su({ inputs: g, backend: t10, attrs: { axis: s } }), w = qt({ inputs: { real: x, imag: b }, backend: t10 }); + return h.forEach((S) => t10.disposeIntermediateTensorInfo(S)), g.forEach((S) => t10.disposeIntermediateTensorInfo(S)), t10.disposeIntermediateTensorInfo(x), t10.disposeIntermediateTensorInfo(b), w; } let u = p.map((h) => { let x = [-1, y.sizeFromShape(h.shape.slice(s))]; - return Ve({ inputs: { x: h }, backend: e, attrs: { shape: x } }); - }), c = u.map((h) => ({ vals: e.data.get(h.dataId).values, shape: h.shape })); - i = w.computeOutShape(u.map((h) => h.shape), 1); - let l = u[0].shape[0] === 1, m = np(c, i, t8[0].dtype, l), d = w.computeOutShape(p.map((h) => h.shape), s), f = e.makeTensorInfo(d, t8[0].dtype, m); - return u.forEach((h) => e.disposeIntermediateTensorInfo(h)), f; -} -var m$ = { kernelName: ta, backendName: "cpu", kernelFunc: du }; -function bI(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: c } = o; + return We({ inputs: { x: h }, backend: t10, attrs: { shape: x } }); + }), l = u.map((h) => ({ vals: t10.data.get(h.dataId).values, shape: h.shape })); + i = C.computeOutShape(u.map((h) => h.shape), 1); + let c = u[0].shape[0] === 1, m = mp(l, i, e[0].dtype, c), d = C.computeOutShape(p.map((h) => h.shape), s), f = t10.makeTensorInfo(d, e[0].dtype, m); + return u.forEach((h) => t10.disposeIntermediateTensorInfo(h)), f; +} +var o$ = { kernelName: pa, backendName: "cpu", kernelFunc: Su }; +function AI(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: l } = o; Q([n, s], "conv2d"); - let l = w.convertConv2DDataFormat(p), m = w.computeConv2DInfo(n.shape, s.shape, a, u, i, c, false, l), d = m.filterHeight, f = m.filterWidth, h = m.dilationHeight, g = m.dilationWidth, x = m.padInfo.left, b = m.padInfo.top, C = m.dataFormat === "channelsLast", S = new tt(m.outShape, n.dtype), k = y.computeStrides(n.shape), _ = y.computeStrides(s.shape), E = k[0], R = C ? k[1] : k[2], D = C ? k[2] : 1, P = C ? 1 : k[1], O = S.strides[0], M = C ? S.strides[1] : S.strides[2], L = C ? S.strides[2] : 1, B = C ? 1 : S.strides[1], z = e.data.get(n.dataId).values, U = e.data.get(s.dataId).values, j = S.values; + let c = C.convertConv2DDataFormat(p), m = C.computeConv2DInfo(n.shape, s.shape, a, u, i, l, false, c), d = m.filterHeight, f = m.filterWidth, h = m.dilationHeight, g = m.dilationWidth, x = m.padInfo.left, b = m.padInfo.top, w = m.dataFormat === "channelsLast", S = new Ge(m.outShape, n.dtype), k = y.computeStrides(n.shape), T = y.computeStrides(s.shape), E = k[0], R = w ? k[1] : k[2], D = w ? k[2] : 1, F = w ? 1 : k[1], O = S.strides[0], M = w ? S.strides[1] : S.strides[2], L = w ? S.strides[2] : 1, B = w ? 1 : S.strides[1], z = t10.data.get(n.dataId).values, U = t10.data.get(s.dataId).values, j = S.values; for (let q = 0; q < m.batchSize; ++q) { let Y = q * E, J = q * O; for (let re = 0; re < m.outHeight; ++re) { let ne = J + re * M, ee = re * m.strideHeight - b; for (let oe = 0; oe < d; ++oe) { - let ie = ee + oe * h; - if (ie < 0 || ie >= m.inHeight) + let ue = ee + oe * h; + if (ue < 0 || ue >= m.inHeight) continue; - let le = oe * _[0], be = Y + ie * R; + let me = oe * T[0], be = Y + ue * R; for (let _e = 0; _e < m.outWidth; ++_e) { let ve = ne + _e * L, Fe = _e * m.strideWidth - x; for (let Pe = 0; Pe < f; ++Pe) { - let st = Fe + Pe * g; - if (st < 0 || st >= m.inWidth) + let at = Fe + Pe * g; + if (at < 0 || at >= m.inWidth) continue; - let ct = le + Pe * _[1], Ge = be + st * D, lt = ct; - for (let it = 0; it < m.inChannels; ++it) { - let ht = z[Ge + it * P]; - for (let gt = 0; gt < m.outChannels; ++gt) - j[ve + gt * B] += ht * U[lt + gt]; - lt += m.outChannels; + let ct = me + Pe * T[1], Ke = be + at * D, mt = ct; + for (let ut = 0; ut < m.inChannels; ++ut) { + let gt = z[Ke + ut * F]; + for (let xt = 0; xt < m.outChannels; ++xt) + j[ve + xt * B] += gt * U[mt + xt]; + mt += m.outChannels; } } } } } } - return e.makeTensorInfo(S.shape, S.dtype, j); + return t10.makeTensorInfo(S.shape, S.dtype, j); } -var d$ = { kernelName: tn, backendName: "cpu", kernelFunc: bI }; -function OY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, filterShape: c } = o; +var n$ = { kernelName: En, backendName: "cpu", kernelFunc: AI }; +function pQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, filterShape: l } = o; Q([n, s], "conv2dBackpropFilter"); - let l = w.convertConv2DDataFormat(p), m = w.computeConv2DInfo(n.shape, c, a, 1, i, u, false, l), { strideHeight: d, strideWidth: f, filterHeight: h, filterWidth: g } = m, x = m.dataFormat === "channelsLast", b = new tt(m.filterShape, "float32"), C = m.padInfo.left, S = m.padInfo.top, k = e.data.get(n.dataId).values, _ = e.data.get(s.dataId).values, E = new tt(n.shape, n.dtype, k), R = new tt(s.shape, s.dtype, _); + let c = C.convertConv2DDataFormat(p), m = C.computeConv2DInfo(n.shape, l, a, 1, i, u, false, c), { strideHeight: d, strideWidth: f, filterHeight: h, filterWidth: g } = m, x = m.dataFormat === "channelsLast", b = new Ge(m.filterShape, "float32"), w = m.padInfo.left, S = m.padInfo.top, k = t10.data.get(n.dataId).values, T = t10.data.get(s.dataId).values, E = new Ge(n.shape, n.dtype, k), R = new Ge(s.shape, s.dtype, T); for (let D = 0; D < h; ++D) { - let P = Math.max(0, Math.ceil((S - D) / d)), O = Math.min(m.outHeight, (m.inHeight + S - D) / d); + let F = Math.max(0, Math.ceil((S - D) / d)), O = Math.min(m.outHeight, (m.inHeight + S - D) / d); for (let M = 0; M < g; ++M) { - let L = Math.max(0, Math.ceil((C - M) / f)), B = Math.min(m.outWidth, (m.inWidth + C - M) / f); + let L = Math.max(0, Math.ceil((w - M) / f)), B = Math.min(m.outWidth, (m.inWidth + w - M) / f); for (let z = 0; z < m.inChannels; ++z) for (let U = 0; U < m.outChannels; ++U) { let j = 0; for (let q = 0; q < m.batchSize; ++q) - for (let Y = P; Y < O; ++Y) { + for (let Y = F; Y < O; ++Y) { let J = D + Y * d - S; for (let re = L; re < B; ++re) { - let ne = M + re * f - C; + let ne = M + re * f - w; x ? j += E.get(q, J, ne, z) * R.get(q, Y, re, U) : j += E.get(q, z, J, ne) * R.get(q, U, Y, re); } } @@ -13721,70 +13821,70 @@ function OY(r15) { } } } - return e.makeTensorInfo(b.shape, b.dtype, b.values); + return t10.makeTensorInfo(b.shape, b.dtype, b.values); } -var f$ = { kernelName: Ai, backendName: "cpu", kernelFunc: OY }; -function MY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { inputShape: a, strides: i, pad: p, dataFormat: u, dimRoundingMode: c } = o; +var s$ = { kernelName: Ui, backendName: "cpu", kernelFunc: pQ }; +function lQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { inputShape: a, strides: i, pad: p, dataFormat: u, dimRoundingMode: l } = o; Q([n, s], "conv2dBackpropInput"); - let l = y.computeStrides(s.shape), m = y.computeStrides(n.shape), d = w.convertConv2DDataFormat(u), f = w.computeConv2DInfo(a, s.shape, i, 1, p, c, false, d), h = new tt(f.inShape, "float32"), g = h.values, x = e.data.get(n.dataId).values, b = e.data.get(s.dataId).values, [C, S, k] = l, { batchSize: _, filterHeight: E, filterWidth: R, inChannels: D, inHeight: P, inWidth: O, outChannels: M, outHeight: L, outWidth: B, strideHeight: z, strideWidth: U } = f; + let c = y.computeStrides(s.shape), m = y.computeStrides(n.shape), d = C.convertConv2DDataFormat(u), f = C.computeConv2DInfo(a, s.shape, i, 1, p, l, false, d), h = new Ge(f.inShape, "float32"), g = h.values, x = t10.data.get(n.dataId).values, b = t10.data.get(s.dataId).values, [w, S, k] = c, { batchSize: T, filterHeight: E, filterWidth: R, inChannels: D, inHeight: F, inWidth: O, outChannels: M, outHeight: L, outWidth: B, strideHeight: z, strideWidth: U } = f; d = f.dataFormat; - let j = E - 1 - f.padInfo.top, q = R - 1 - f.padInfo.left, Y = d === "channelsLast", J = h.strides[0], re = Y ? h.strides[1] : h.strides[2], ne = Y ? h.strides[2] : 1, ee = Y ? 1 : h.strides[1], oe = m[0], ie = Y ? m[1] : m[2], le = Y ? m[2] : 1, be = Y ? 1 : m[1]; - for (let _e = 0; _e < _; ++_e) + let j = E - 1 - f.padInfo.top, q = R - 1 - f.padInfo.left, Y = d === "channelsLast", J = h.strides[0], re = Y ? h.strides[1] : h.strides[2], ne = Y ? h.strides[2] : 1, ee = Y ? 1 : h.strides[1], oe = m[0], ue = Y ? m[1] : m[2], me = Y ? m[2] : 1, be = Y ? 1 : m[1]; + for (let _e = 0; _e < T; ++_e) for (let ve = 0; ve < D; ++ve) - for (let Fe = 0; Fe < P; ++Fe) { - let Pe = Fe - j, st = Math.max(0, Math.ceil(Pe / z)), ct = Math.min(L, (E + Pe) / z); - for (let Ge = 0; Ge < O; ++Ge) { - let lt = Ge - q, it = Math.max(0, Math.ceil(lt / U)), ht = Math.min(B, (R + lt) / U), gt = 0; - for (let Mt = st; Mt < ct; ++Mt) { - let eo = Mt * z - Pe; - for (let rr = it; rr < ht; ++rr) { - let Tt = rr * U - lt, or = oe * _e + ie * Mt + le * rr, nr = C * (E - 1 - eo) + S * (R - 1 - Tt) + k * ve; - for (let to = 0; to < M; ++to) { - let ro = x[or + be * to], fr = b[nr + to]; - gt += ro * fr; + for (let Fe = 0; Fe < F; ++Fe) { + let Pe = Fe - j, at = Math.max(0, Math.ceil(Pe / z)), ct = Math.min(L, (E + Pe) / z); + for (let Ke = 0; Ke < O; ++Ke) { + let mt = Ke - q, ut = Math.max(0, Math.ceil(mt / U)), gt = Math.min(B, (R + mt) / U), xt = 0; + for (let Bt = at; Bt < ct; ++Bt) { + let io = Bt * z - Pe; + for (let sr = ut; sr < gt; ++sr) { + let Et = sr * U - mt, ar = oe * _e + ue * Bt + me * sr, ir = w * (E - 1 - io) + S * (R - 1 - Et) + k * ve; + for (let uo = 0; uo < M; ++uo) { + let po = x[ar + be * uo], xr = b[ir + uo]; + xt += po * xr; } } } - let Mr = J * _e + re * Fe + ne * Ge + ee * ve; - g[Mr] = gt; + let Ur = J * _e + re * Fe + ne * Ke + ee * ve; + g[Ur] = xt; } } - return e.makeTensorInfo(h.shape, h.dtype, h.values); + return t10.makeTensorInfo(h.shape, h.dtype, h.values); } -var h$ = { kernelName: rn, backendName: "cpu", kernelFunc: MY }; -function LY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p } = o; +var a$ = { kernelName: $n, backendName: "cpu", kernelFunc: lQ }; +function cQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p } = o; Q([n, s], "conv3d"); - let u = w.computeConv3DInfo(n.shape, s.shape, a, p, i), { filterDepth: c, filterHeight: l, filterWidth: m, dilationDepth: d, dilationHeight: f, dilationWidth: h, padInfo: g } = u, x = g.front, b = g.left, C = g.top, S = new tt(u.outShape, n.dtype), k = e.data.get(n.dataId).values, _ = e.data.get(s.dataId).values, E = S.values, R = y.computeStrides(n.shape), D = y.computeStrides(s.shape); - for (let P = 0; P < u.batchSize; ++P) { - let O = P * R[0], M = P * S.strides[0]; + let u = C.computeConv3DInfo(n.shape, s.shape, a, p, i), { filterDepth: l, filterHeight: c, filterWidth: m, dilationDepth: d, dilationHeight: f, dilationWidth: h, padInfo: g } = u, x = g.front, b = g.left, w = g.top, S = new Ge(u.outShape, n.dtype), k = t10.data.get(n.dataId).values, T = t10.data.get(s.dataId).values, E = S.values, R = y.computeStrides(n.shape), D = y.computeStrides(s.shape); + for (let F = 0; F < u.batchSize; ++F) { + let O = F * R[0], M = F * S.strides[0]; for (let L = 0; L < u.outDepth; ++L) { let B = M + L * S.strides[1], z = L * u.strideDepth - x; - for (let U = 0; U < c; ++U) { + for (let U = 0; U < l; ++U) { let j = z + U * d; if (j < 0 || j >= u.inDepth) continue; let q = U * D[0], Y = O + j * R[1]; for (let J = 0; J < u.outHeight; ++J) { - let re = B + J * S.strides[2], ne = J * u.strideHeight - C; - for (let ee = 0; ee < l; ++ee) { + let re = B + J * S.strides[2], ne = J * u.strideHeight - w; + for (let ee = 0; ee < c; ++ee) { let oe = ne + ee * f; if (oe < 0 || oe >= u.inHeight) continue; - let ie = q + ee * D[1], le = Y + oe * R[2]; + let ue = q + ee * D[1], me = Y + oe * R[2]; for (let be = 0; be < u.outWidth; ++be) { let _e = re + be * u.outChannels, ve = be * u.strideWidth - b; for (let Fe = 0; Fe < m; ++Fe) { let Pe = ve + Fe * h; if (Pe < 0 || Pe >= u.inWidth) continue; - let st = ie + Fe * D[2], ct = le + Pe * u.inChannels, Ge = st; - for (let lt = 0; lt < u.inChannels; ++lt) { - let it = k[ct + lt]; - for (let ht = 0; ht < u.outChannels; ++ht) - E[_e + ht] += it * _[Ge + ht]; - Ge += u.outChannels; + let at = ue + Fe * D[2], ct = me + Pe * u.inChannels, Ke = at; + for (let mt = 0; mt < u.inChannels; ++mt) { + let ut = k[ct + mt]; + for (let gt = 0; gt < u.outChannels; ++gt) + E[_e + gt] += ut * T[Ke + gt]; + Ke += u.outChannels; } } } @@ -13793,94 +13893,94 @@ function LY(r15) { } } } - return e.makeTensorInfo(S.shape, S.dtype, S.values); + return t10.makeTensorInfo(S.shape, S.dtype, S.values); } -var g$ = { kernelName: on, backendName: "cpu", kernelFunc: LY }; -function BY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, pad: i, filterShape: p } = o; +var i$ = { kernelName: Rn, backendName: "cpu", kernelFunc: cQ }; +function mQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, pad: i, filterShape: p } = o; Q([n, s], "conv3dBackpropFilterV2"); - let u = y.computeStrides(n.shape), c = y.computeStrides(s.shape), l = w.computeConv3DInfo(n.shape, p, a, 1, i), m = l.strideDepth, d = l.strideHeight, f = l.strideWidth, h = l.filterDepth, g = l.filterHeight, x = l.filterWidth, b = new tt(l.filterShape, "float32"), C = b.values, [S, k, _, E] = b.strides, R = e.data.get(s.dataId).values, [D, P, O, M] = c, L = e.data.get(n.dataId).values, [B, z, U, j] = u, q = l.padInfo.front, Y = l.padInfo.left, J = l.padInfo.top; + let u = y.computeStrides(n.shape), l = y.computeStrides(s.shape), c = C.computeConv3DInfo(n.shape, p, a, 1, i), m = c.strideDepth, d = c.strideHeight, f = c.strideWidth, h = c.filterDepth, g = c.filterHeight, x = c.filterWidth, b = new Ge(c.filterShape, "float32"), w = b.values, [S, k, T, E] = b.strides, R = t10.data.get(s.dataId).values, [D, F, O, M] = l, L = t10.data.get(n.dataId).values, [B, z, U, j] = u, q = c.padInfo.front, Y = c.padInfo.left, J = c.padInfo.top; for (let re = 0; re < h; ++re) { - let ne = Math.max(0, Math.ceil((q - re) / m)), ee = Math.min(l.outDepth, (l.inDepth + q - re) / m), oe = re * S; - for (let ie = 0; ie < g; ++ie) { - let le = Math.max(0, Math.ceil((J - ie) / d)), be = Math.min(l.outHeight, (l.inHeight + J - ie) / d), _e = ie * k + oe; + let ne = Math.max(0, Math.ceil((q - re) / m)), ee = Math.min(c.outDepth, (c.inDepth + q - re) / m), oe = re * S; + for (let ue = 0; ue < g; ++ue) { + let me = Math.max(0, Math.ceil((J - ue) / d)), be = Math.min(c.outHeight, (c.inHeight + J - ue) / d), _e = ue * k + oe; for (let ve = 0; ve < x; ++ve) { - let Fe = Math.max(0, Math.ceil((Y - ve) / f)), Pe = Math.min(l.outWidth, (l.inWidth + Y - ve) / f), st = ve * _ + _e; - for (let ct = 0; ct < l.inChannels; ++ct) { - let Ge = ct * E + st; - for (let lt = 0; lt < l.outChannels; ++lt) { - let it = 0; - for (let ht = 0; ht < l.batchSize; ++ht) { - let gt = ht * B, Mr = ht * D; - for (let Mt = ne; Mt < ee; ++Mt) { - let rr = (re + Mt * m - q) * z + gt, Tt = Mt * P + Mr; - for (let or = le; or < be; ++or) { - let to = (ie + or * d - J) * U + rr, ro = or * O + Tt; - for (let fr = Fe; fr < Pe; ++fr) { - let Lo = (ve + fr * f - Y) * j + to, Ks = fr * M + ro; - it += L[Lo + ct] * R[Ks + lt]; + let Fe = Math.max(0, Math.ceil((Y - ve) / f)), Pe = Math.min(c.outWidth, (c.inWidth + Y - ve) / f), at = ve * T + _e; + for (let ct = 0; ct < c.inChannels; ++ct) { + let Ke = ct * E + at; + for (let mt = 0; mt < c.outChannels; ++mt) { + let ut = 0; + for (let gt = 0; gt < c.batchSize; ++gt) { + let xt = gt * B, Ur = gt * D; + for (let Bt = ne; Bt < ee; ++Bt) { + let sr = (re + Bt * m - q) * z + xt, Et = Bt * F + Ur; + for (let ar = me; ar < be; ++ar) { + let uo = (ue + ar * d - J) * U + sr, po = ar * O + Et; + for (let xr = Fe; xr < Pe; ++xr) { + let cn = (ve + xr * f - Y) * j + uo, ta = xr * M + po; + ut += L[cn + ct] * R[ta + mt]; } } } } - C[Ge + lt] = it; + w[Ke + mt] = ut; } } } } } - return e.makeTensorInfo(b.shape, b.dtype, b.values); + return t10.makeTensorInfo(b.shape, b.dtype, b.values); } -var x$ = { kernelName: ja, backendName: "cpu", kernelFunc: BY }; -function zY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { pad: a, strides: i, inputShape: p } = o; +var u$ = { kernelName: ti, backendName: "cpu", kernelFunc: mQ }; +function dQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { pad: a, strides: i, inputShape: p } = o; Q([n], "conv3dBackpropInputV2"); - let u = y.computeStrides(n.shape), c = y.computeStrides(s.shape), l = w.computeConv3DInfo(p, s.shape, i, 1, a), m = new tt(l.inShape, "float32"), d = m.values, [f, h, g, x] = m.strides, b = e.data.get(n.dataId).values, [C, S, k, _] = u, E = e.data.get(s.dataId).values, [R, D, P, O] = c, { batchSize: M, filterDepth: L, filterHeight: B, filterWidth: z, inChannels: U, inDepth: j, inHeight: q, inWidth: Y, outChannels: J, outDepth: re, outHeight: ne, outWidth: ee, strideDepth: oe, strideHeight: ie, strideWidth: le } = l, be = L - 1 - l.padInfo.front, _e = B - 1 - l.padInfo.top, ve = z - 1 - l.padInfo.left; + let u = y.computeStrides(n.shape), l = y.computeStrides(s.shape), c = C.computeConv3DInfo(p, s.shape, i, 1, a), m = new Ge(c.inShape, "float32"), d = m.values, [f, h, g, x] = m.strides, b = t10.data.get(n.dataId).values, [w, S, k, T] = u, E = t10.data.get(s.dataId).values, [R, D, F, O] = l, { batchSize: M, filterDepth: L, filterHeight: B, filterWidth: z, inChannels: U, inDepth: j, inHeight: q, inWidth: Y, outChannels: J, outDepth: re, outHeight: ne, outWidth: ee, strideDepth: oe, strideHeight: ue, strideWidth: me } = c, be = L - 1 - c.padInfo.front, _e = B - 1 - c.padInfo.top, ve = z - 1 - c.padInfo.left; for (let Fe = 0; Fe < M; ++Fe) for (let Pe = 0; Pe < U; ++Pe) - for (let st = 0; st < j; ++st) { - let ct = st - be, Ge = Math.max(0, Math.ceil(ct / oe)), lt = Math.min(re, (L + ct) / oe); - for (let it = 0; it < q; ++it) { - let ht = it - _e, gt = Math.max(0, Math.ceil(ht / ie)), Mr = Math.min(ne, (B + ht) / ie); - for (let Mt = 0; Mt < Y; ++Mt) { - let eo = Mt - ve, rr = Math.max(0, Math.ceil(eo / le)), Tt = Math.min(ee, (z + eo) / le), or = 0; - for (let nr = Ge; nr < lt; ++nr) { - let to = nr * oe - ct; - for (let ro = gt; ro < Mr; ++ro) { - let fr = ro * ie - ht; - for (let Va = rr; Va < Tt; ++Va) { - let Lo = Va * le - eo, Ks = C * Fe + S * nr + k * ro + _ * Va, Xt = R * (L - 1 - to) + D * (B - 1 - fr) + P * (z - 1 - Lo) + O * Pe; - for (let Wa = 0; Wa < J; ++Wa) { - let tl = b[Ks + Wa], rl = E[Xt + Wa]; - or += tl * rl; + for (let at = 0; at < j; ++at) { + let ct = at - be, Ke = Math.max(0, Math.ceil(ct / oe)), mt = Math.min(re, (L + ct) / oe); + for (let ut = 0; ut < q; ++ut) { + let gt = ut - _e, xt = Math.max(0, Math.ceil(gt / ue)), Ur = Math.min(ne, (B + gt) / ue); + for (let Bt = 0; Bt < Y; ++Bt) { + let io = Bt - ve, sr = Math.max(0, Math.ceil(io / me)), Et = Math.min(ee, (z + io) / me), ar = 0; + for (let ir = Ke; ir < mt; ++ir) { + let uo = ir * oe - ct; + for (let po = xt; po < Ur; ++po) { + let xr = po * ue - gt; + for (let ja = sr; ja < Et; ++ja) { + let cn = ja * me - io, ta = w * Fe + S * ir + k * po + T * ja, Zt = R * (L - 1 - uo) + D * (B - 1 - xr) + F * (z - 1 - cn) + O * Pe; + for (let Xa = 0; Xa < J; ++Xa) { + let lc = b[ta + Xa], cc = E[Zt + Xa]; + ar += lc * cc; } } } } - d[f * Fe + h * st + g * it + x * Mt + Pe] = or; + d[f * Fe + h * at + g * ut + x * Bt + Pe] = ar; } } } - return e.makeTensorInfo(m.shape, m.dtype, m.values); + return t10.makeTensorInfo(m.shape, m.dtype, m.values); } -var y$ = { kernelName: nn, backendName: "cpu", kernelFunc: zY }; -var VY = Ie(sn, (r15) => Math.cos(r15)); -var b$ = { kernelName: sn, backendName: "cpu", kernelFunc: VY }; -var WY = Ie(an, (r15) => Math.cosh(r15)); -var C$ = { kernelName: an, backendName: "cpu", kernelFunc: WY }; -function UY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n, boxes: s, boxInd: a } = t8, { cropSize: i, method: p, extrapolationValue: u } = o, [c, l, m, d] = n.shape, f = s.shape[0], [h, g] = i, x = me([f, h, g, d], "float32"), b = e.data.get(s.dataId).values, C = e.data.get(a.dataId).values, S = e.data.get(n.dataId).values, k = y.computeStrides(n.shape), _ = y.computeStrides(x.shape); +var p$ = { kernelName: Dn, backendName: "cpu", kernelFunc: dQ }; +var fQ = Ie(An, (r16) => Math.cos(r16)); +var l$ = { kernelName: An, backendName: "cpu", kernelFunc: fQ }; +var hQ = Ie(Fn, (r16) => Math.cosh(r16)); +var c$ = { kernelName: Fn, backendName: "cpu", kernelFunc: hQ }; +function gQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n, boxes: s, boxInd: a } = e, { cropSize: i, method: p, extrapolationValue: u } = o, [l, c, m, d] = n.shape, f = s.shape[0], [h, g] = i, x = ie([f, h, g, d], "float32"), b = t10.data.get(s.dataId).values, w = t10.data.get(a.dataId).values, S = t10.data.get(n.dataId).values, k = y.computeStrides(n.shape), T = y.computeStrides(x.shape); for (let E = 0; E < f; E++) { - let R = E * 4, D = b[R], P = b[R + 1], O = b[R + 2], M = b[R + 3], L = C[E]; - if (L >= c) + let R = E * 4, D = b[R], F = b[R + 1], O = b[R + 2], M = b[R + 3], L = w[E]; + if (L >= l) continue; - let B = h > 1 ? (O - D) * (l - 1) / (h - 1) : 0, z = g > 1 ? (M - P) * (m - 1) / (g - 1) : 0; + let B = h > 1 ? (O - D) * (c - 1) / (h - 1) : 0, z = g > 1 ? (M - F) * (m - 1) / (g - 1) : 0; for (let U = 0; U < h; U++) { - let j = h > 1 ? D * (l - 1) + U * B : 0.5 * (D + O) * (l - 1); - if (j < 0 || j > l - 1) { + let j = h > 1 ? D * (c - 1) + U * B : 0.5 * (D + O) * (c - 1); + if (j < 0 || j > c - 1) { for (let q = 0; q < g; q++) for (let Y = 0; Y < d; Y++) { - let J = Y + q * _[2] + U * _[1] + E * _[0]; + let J = Y + q * T[2] + U * T[1] + E * T[0]; x.values[J] = u; } continue; @@ -13888,155 +13988,155 @@ function UY(r15) { if (p === "bilinear") { let q = Math.floor(j), Y = Math.ceil(j), J = j - q; for (let re = 0; re < g; re++) { - let ne = g > 1 ? P * (m - 1) + re * z : 0.5 * (P + M) * (m - 1); + let ne = g > 1 ? F * (m - 1) + re * z : 0.5 * (F + M) * (m - 1); if (ne < 0 || ne > m - 1) { - for (let le = 0; le < d; le++) { - let be = le + re * _[2] + U * _[1] + E * _[0]; + for (let me = 0; me < d; me++) { + let be = me + re * T[2] + U * T[1] + E * T[0]; x.values[be] = u; } continue; } - let ee = Math.floor(ne), oe = Math.ceil(ne), ie = ne - ee; - for (let le = 0; le < d; le++) { - let be = le + ee * k[2] + q * k[1] + L * k[0], _e = S[be]; - be = le + oe * k[2] + q * k[1] + L * k[0]; + let ee = Math.floor(ne), oe = Math.ceil(ne), ue = ne - ee; + for (let me = 0; me < d; me++) { + let be = me + ee * k[2] + q * k[1] + L * k[0], _e = S[be]; + be = me + oe * k[2] + q * k[1] + L * k[0]; let ve = S[be]; - be = le + ee * k[2] + Y * k[1] + L * k[0]; + be = me + ee * k[2] + Y * k[1] + L * k[0]; let Fe = S[be]; - be = le + oe * k[2] + Y * k[1] + L * k[0]; - let Pe = S[be], st = _e + (ve - _e) * ie, ct = Fe + (Pe - Fe) * ie; - be = le + re * _[2] + U * _[1] + E * _[0], x.values[be] = st + (ct - st) * J; + be = me + oe * k[2] + Y * k[1] + L * k[0]; + let Pe = S[be], at = _e + (ve - _e) * ue, ct = Fe + (Pe - Fe) * ue; + be = me + re * T[2] + U * T[1] + E * T[0], x.values[be] = at + (ct - at) * J; } } } else for (let q = 0; q < g; ++q) { - let Y = g > 1 ? P * (m - 1) + q * z : 0.5 * (P + M) * (m - 1); + let Y = g > 1 ? F * (m - 1) + q * z : 0.5 * (F + M) * (m - 1); if (Y < 0 || Y > m - 1) { for (let ne = 0; ne < d; ne++) { - let ee = ne + q * _[2] + U * _[1] + E * _[0]; + let ee = ne + q * T[2] + U * T[1] + E * T[0]; x.values[ee] = u; } continue; } let J = Math.round(Y), re = Math.round(j); for (let ne = 0; ne < d; ne++) { - let ee = ne + J * k[2] + re * k[1] + L * k[0], oe = ne + q * _[2] + U * _[1] + E * _[0]; + let ee = ne + J * k[2] + re * k[1] + L * k[0], oe = ne + q * T[2] + U * T[1] + E * T[0]; x.values[oe] = S[ee]; } } } } - return e.makeTensorInfo(x.shape, x.dtype, x.values); + return t10.makeTensorInfo(x.shape, x.dtype, x.values); } -var w$ = { kernelName: cn, backendName: "cpu", kernelFunc: UY }; -function GY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o; +var m$ = { kernelName: Mn, backendName: "cpu", kernelFunc: gQ }; +function xQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o; Q(n, "cumprod"); - let p = w.getAxesPermutation([s], n.shape.length), u = n; - p != null && (u = St({ inputs: { x: n }, backend: e, attrs: { perm: p } })); - let c = w.getInnerMostAxes(1, n.shape.length)[0]; - if (c !== u.shape.length - 1) - throw new Error(`backend.cumprod in CPU expects an inner-most axis=${u.shape.length - 1} but got axis=${c}`); - let l = dt(u.dtype, "int32"), m = y.makeOnesTypedArray(y.sizeFromShape(u.shape), l), d = e.data.get(u.dataId).values, f = u.shape[u.shape.length - 1], h = i ? (x, b) => x + f - b - 1 : (x, b) => x + b; + let p = C.getAxesPermutation([s], n.shape.length), u = n; + p != null && (u = vt({ inputs: { x: n }, backend: t10, attrs: { perm: p } })); + let l = C.getInnerMostAxes(1, n.shape.length)[0]; + if (l !== u.shape.length - 1) + throw new Error(`backend.cumprod in CPU expects an inner-most axis=${u.shape.length - 1} but got axis=${l}`); + let c = pt(u.dtype, "int32"), m = y.makeOnesTypedArray(y.sizeFromShape(u.shape), c), d = t10.data.get(u.dataId).values, f = u.shape[u.shape.length - 1], h = i ? (x, b) => x + f - b - 1 : (x, b) => x + b; for (let x = 0; x < d.length; x += f) for (let b = 0; b < f; b++) { - let C = h(x, b); + let w = h(x, b); if (b === 0) - m[C] = a ? 1 : d[C]; + m[w] = a ? 1 : d[w]; else { let S = h(x, b - 1); - m[C] = a ? d[S] * m[S] : d[C] * m[S]; + m[w] = a ? d[S] * m[S] : d[w] * m[S]; } } - let g = e.makeTensorInfo(u.shape, l, m); + let g = t10.makeTensorInfo(u.shape, c, m); if (p != null) { - let x = w.getUndoAxesPermutation(p), b = St({ inputs: { x: g }, backend: e, attrs: { perm: x } }); - return e.disposeIntermediateTensorInfo(g), e.disposeIntermediateTensorInfo(u), b; + let x = C.getUndoAxesPermutation(p), b = vt({ inputs: { x: g }, backend: t10, attrs: { perm: x } }); + return t10.disposeIntermediateTensorInfo(g), t10.disposeIntermediateTensorInfo(u), b; } return g; } -var S$ = { kernelName: un, backendName: "cpu", kernelFunc: GY }; -function HY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o; +var d$ = { kernelName: Pn, backendName: "cpu", kernelFunc: xQ }; +function yQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o; Q(n, "cumsum"); - let p = w.getAxesPermutation([s], n.shape.length), u = n; - p != null && (u = St({ inputs: { x: n }, backend: e, attrs: { perm: p } })); - let c = w.getInnerMostAxes(1, n.shape.length)[0]; - if (c !== u.shape.length - 1) - throw new Error(`backend.cumsum in CPU expects an inner-most axis=${u.shape.length - 1} but got axis=${c}`); - let l = dt(u.dtype, "int32"), m = y.makeZerosTypedArray(y.sizeFromShape(u.shape), l), d = e.data.get(u.dataId).values, f = u.shape[u.shape.length - 1], h = i ? (x, b) => x + f - b - 1 : (x, b) => x + b; + let p = C.getAxesPermutation([s], n.shape.length), u = n; + p != null && (u = vt({ inputs: { x: n }, backend: t10, attrs: { perm: p } })); + let l = C.getInnerMostAxes(1, n.shape.length)[0]; + if (l !== u.shape.length - 1) + throw new Error(`backend.cumsum in CPU expects an inner-most axis=${u.shape.length - 1} but got axis=${l}`); + let c = pt(u.dtype, "int32"), m = y.makeZerosTypedArray(y.sizeFromShape(u.shape), c), d = t10.data.get(u.dataId).values, f = u.shape[u.shape.length - 1], h = i ? (x, b) => x + f - b - 1 : (x, b) => x + b; for (let x = 0; x < d.length; x += f) for (let b = 0; b < f; b++) { - let C = h(x, b); + let w = h(x, b); if (b === 0) - m[C] = a ? 0 : d[C]; + m[w] = a ? 0 : d[w]; else { let S = h(x, b - 1); - m[C] = a ? d[S] + m[S] : d[C] + m[S]; + m[w] = a ? d[S] + m[S] : d[w] + m[S]; } } - let g = e.makeTensorInfo(u.shape, l, m); + let g = t10.makeTensorInfo(u.shape, c, m); if (p != null) { - let x = w.getUndoAxesPermutation(p), b = St({ inputs: { x: g }, backend: e, attrs: { perm: x } }); - return e.disposeIntermediateTensorInfo(g), e.disposeIntermediateTensorInfo(u), b; + let x = C.getUndoAxesPermutation(p), b = vt({ inputs: { x: g }, backend: t10, attrs: { perm: x } }); + return t10.disposeIntermediateTensorInfo(g), t10.disposeIntermediateTensorInfo(u), b; } return g; } -var I$ = { kernelName: pn, backendName: "cpu", kernelFunc: HY }; -function KY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, weights: s } = t8, { size: a, binaryOutput: i } = o; +var f$ = { kernelName: On, backendName: "cpu", kernelFunc: yQ }; +function bQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, weights: s } = e, { size: a, binaryOutput: i } = o; if (n.shape.length === 1) { - let p = e.data.get(n.dataId).values, u = e.data.get(s.dataId).values, c = yc(p, u, s.dtype, s.shape, a); - return e.makeTensorInfo([a], s.dtype, c); + let p = t10.data.get(n.dataId).values, u = t10.data.get(s.dataId).values, l = Nl(p, u, s.dtype, s.shape, a); + return t10.makeTensorInfo([a], s.dtype, l); } else if (n.shape.length === 2) { - let p = e.bufferSync(n), u = e.bufferSync(s), c = kf(p, u, a, i); - return e.makeTensorInfo(c.shape, s.dtype, c.values); + let p = t10.bufferSync(n), u = t10.bufferSync(s), l = Of(p, u, a, i); + return t10.makeTensorInfo(l.shape, s.dtype, l.values); } throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${n.shape.length}.`); } -var v$ = { kernelName: ra, backendName: "cpu", kernelFunc: KY }; -function qY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockSize: s, dataFormat: a } = o; +var h$ = { kernelName: la, backendName: "cpu", kernelFunc: bQ }; +function CQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockSize: s, dataFormat: a } = o; y.assert(a === "NHWC", () => `Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`); - let i = n.shape[0], p = n.shape[1], u = n.shape[2], c = n.shape[3], l = p * s, m = u * s, d = c / (s * s), f = e.data.get(n.dataId).values, h = new Float32Array(i * l * m * d), g = 0; + let i = n.shape[0], p = n.shape[1], u = n.shape[2], l = n.shape[3], c = p * s, m = u * s, d = l / (s * s), f = t10.data.get(n.dataId).values, h = new Float32Array(i * c * m * d), g = 0; for (let x = 0; x < i; ++x) - for (let b = 0; b < l; ++b) { - let C = Math.floor(b / s), S = b % s; + for (let b = 0; b < c; ++b) { + let w = Math.floor(b / s), S = b % s; for (let k = 0; k < m; ++k) { - let _ = Math.floor(k / s), E = k % s, R = (S * s + E) * d; + let T = Math.floor(k / s), E = k % s, R = (S * s + E) * d; for (let D = 0; D < d; ++D) { - let O = D + R + c * (_ + u * (C + p * x)); + let O = D + R + l * (T + u * (w + p * x)); h[g++] = f[O]; } } } - return e.makeTensorInfo([i, l, m, d], n.dtype, h); + return t10.makeTensorInfo([i, c, m, d], n.dtype, h); } -var k$ = { kernelName: ln, backendName: "cpu", kernelFunc: qY }; -function CI(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p, dimRoundingMode: u } = o; +var g$ = { kernelName: Ln, backendName: "cpu", kernelFunc: CQ }; +function FI(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p, dimRoundingMode: u } = o; Q([n, s], "depthwiseConv2DNative"); - let c = y.computeStrides(n.shape), l = y.computeStrides(s.shape), m = p; - m == null && (m = [1, 1]), y.assert(w.eitherStridesOrDilationsAreOne(a, m), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${m}'`); - let d = w.computeConv2DInfo(n.shape, s.shape, a, m, i, u, true), { filterHeight: f, filterWidth: h, dilationHeight: g, dilationWidth: x, padInfo: b } = d, C = b.left, S = b.top, k = d.outChannels / d.inChannels, _ = new tt(d.outShape, n.dtype), E = e.data.get(n.dataId).values, R = e.data.get(s.dataId).values, D = _.values; - for (let P = 0; P < d.batchSize; ++P) { - let O = P * c[0], M = P * _.strides[0]; + let l = y.computeStrides(n.shape), c = y.computeStrides(s.shape), m = p; + m == null && (m = [1, 1]), y.assert(C.eitherStridesOrDilationsAreOne(a, m), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${m}'`); + let d = C.computeConv2DInfo(n.shape, s.shape, a, m, i, u, true), { filterHeight: f, filterWidth: h, dilationHeight: g, dilationWidth: x, padInfo: b } = d, w = b.left, S = b.top, k = d.outChannels / d.inChannels, T = new Ge(d.outShape, n.dtype), E = t10.data.get(n.dataId).values, R = t10.data.get(s.dataId).values, D = T.values; + for (let F = 0; F < d.batchSize; ++F) { + let O = F * l[0], M = F * T.strides[0]; for (let L = 0; L < d.outHeight; ++L) { - let B = M + L * _.strides[1], z = L * d.strideHeight - S; + let B = M + L * T.strides[1], z = L * d.strideHeight - S; for (let U = 0; U < f; ++U) { let j = z + U * g; if (j < 0 || j >= d.inHeight) continue; - let q = U * l[0], Y = O + j * c[1]; + let q = U * c[0], Y = O + j * l[1]; for (let J = 0; J < d.outWidth; ++J) { - let re = B + J * _.strides[2], ne = J * d.strideWidth - C; + let re = B + J * T.strides[2], ne = J * d.strideWidth - w; for (let ee = 0; ee < h; ++ee) { let oe = ne + ee * x; if (oe < 0 || oe >= d.inWidth) continue; - let ie = q + ee * l[1], le = Y + oe * d.inChannels, be = re, _e = ie; + let ue = q + ee * c[1], me = Y + oe * d.inChannels, be = re, _e = ue; for (let ve = 0; ve < d.inChannels; ++ve) { - let Fe = E[le + ve]; + let Fe = E[me + ve]; for (let Pe = 0; Pe < k; ++Pe) D[be + Pe] += Fe * R[_e + Pe]; be += k, _e += k; @@ -14046,21 +14146,21 @@ function CI(r15) { } } } - return e.makeTensorInfo(_.shape, _.dtype, _.values); + return t10.makeTensorInfo(T.shape, T.dtype, T.values); } -var N$ = { kernelName: mn, backendName: "cpu", kernelFunc: CI }; -function jY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, dilations: i, pad: p, dimRoundingMode: u, filterShape: c } = o; +var x$ = { kernelName: Bn, backendName: "cpu", kernelFunc: FI }; +function wQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, dilations: i, pad: p, dimRoundingMode: u, filterShape: l } = o; Q([n, s], "depthwiseConv2dNativeBackpropFilter"); - let l = w.computeConv2DInfo(n.shape, c, a, i, p, u, true), { strideHeight: m, strideWidth: d, filterHeight: f, filterWidth: h } = l, g = new tt(l.filterShape, "float32"), x = l.padInfo.left, b = l.padInfo.top, C = l.outChannels / l.inChannels, S = e.data.get(n.dataId).values, k = new tt(n.shape, n.dtype, S), _ = e.data.get(s.dataId).values, E = new tt(s.shape, s.dtype, _); + let c = C.computeConv2DInfo(n.shape, l, a, i, p, u, true), { strideHeight: m, strideWidth: d, filterHeight: f, filterWidth: h } = c, g = new Ge(c.filterShape, "float32"), x = c.padInfo.left, b = c.padInfo.top, w = c.outChannels / c.inChannels, S = t10.data.get(n.dataId).values, k = new Ge(n.shape, n.dtype, S), T = t10.data.get(s.dataId).values, E = new Ge(s.shape, s.dtype, T); for (let R = 0; R < f; ++R) { - let D = Math.max(0, Math.ceil((b - R) / m)), P = Math.min(l.outHeight, (l.inHeight + b - R) / m); + let D = Math.max(0, Math.ceil((b - R) / m)), F = Math.min(c.outHeight, (c.inHeight + b - R) / m); for (let O = 0; O < h; ++O) { - let M = Math.max(0, Math.ceil((x - O) / d)), L = Math.min(l.outWidth, (l.inWidth + x - O) / d); - for (let B = 0; B < l.outChannels; ++B) { - let z = Math.trunc(B / C), U = B % C, j = 0; - for (let q = 0; q < l.batchSize; ++q) - for (let Y = D; Y < P; ++Y) { + let M = Math.max(0, Math.ceil((x - O) / d)), L = Math.min(c.outWidth, (c.inWidth + x - O) / d); + for (let B = 0; B < c.outChannels; ++B) { + let z = Math.trunc(B / w), U = B % w, j = 0; + for (let q = 0; q < c.batchSize; ++q) + for (let Y = D; Y < F; ++Y) { let J = R + Y * m - b; for (let re = M; re < L; ++re) { let ne = O + re * d - x; @@ -14071,77 +14171,77 @@ function jY(r15) { } } } - return e.makeTensorInfo(g.shape, g.dtype, g.values); + return t10.makeTensorInfo(g.shape, g.dtype, g.values); } -var T$ = { kernelName: Fi, backendName: "cpu", kernelFunc: jY }; -function XY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { strides: a, dilations: i, pad: p, dimRoundingMode: u, inputShape: c } = o; +var y$ = { kernelName: Gi, backendName: "cpu", kernelFunc: wQ }; +function SQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { strides: a, dilations: i, pad: p, dimRoundingMode: u, inputShape: l } = o; Q([n, s], "depthwiseConv2DNativeBackpropInput"); - let l = y.computeStrides(n.shape), m = y.computeStrides(s.shape), d = w.computeConv2DInfo(c, s.shape, a, i, p, u, true), f = new tt(d.inShape, "float32"), h = f.values, [g, x, b] = f.strides, C = e.data.get(n.dataId).values, [S, k, _] = l, E = e.data.get(s.dataId).values, [R, D, P] = m, { batchSize: O, filterHeight: M, filterWidth: L, inChannels: B, inHeight: z, inWidth: U, outChannels: j, outHeight: q, outWidth: Y, strideHeight: J, strideWidth: re } = d, ne = M - 1 - d.padInfo.top, ee = L - 1 - d.padInfo.left, oe = j / B; - for (let ie = 0; ie < O; ++ie) - for (let le = 0; le < B; ++le) + let c = y.computeStrides(n.shape), m = y.computeStrides(s.shape), d = C.computeConv2DInfo(l, s.shape, a, i, p, u, true), f = new Ge(d.inShape, "float32"), h = f.values, [g, x, b] = f.strides, w = t10.data.get(n.dataId).values, [S, k, T] = c, E = t10.data.get(s.dataId).values, [R, D, F] = m, { batchSize: O, filterHeight: M, filterWidth: L, inChannels: B, inHeight: z, inWidth: U, outChannels: j, outHeight: q, outWidth: Y, strideHeight: J, strideWidth: re } = d, ne = M - 1 - d.padInfo.top, ee = L - 1 - d.padInfo.left, oe = j / B; + for (let ue = 0; ue < O; ++ue) + for (let me = 0; me < B; ++me) for (let be = 0; be < z; ++be) { let _e = be - ne, ve = Math.max(0, Math.ceil(_e / J)), Fe = Math.min(q, (M + _e) / J); for (let Pe = 0; Pe < U; ++Pe) { - let st = Pe - ee, ct = Math.max(0, Math.ceil(st / re)), Ge = Math.min(Y, (L + st) / re), lt = 0; - for (let it = ve; it < Fe; ++it) { - let ht = it * J - _e; - for (let gt = ct; gt < Ge; ++gt) { - let Mr = gt * re - st, Mt = S * ie + k * it + _ * gt, eo = R * (M - 1 - ht) + D * (L - 1 - Mr) + P * le; - for (let rr = 0; rr < oe; ++rr) { - let Tt = le * oe + rr, or = C[Mt + Tt], nr = E[eo + rr]; - lt += or * nr; + let at = Pe - ee, ct = Math.max(0, Math.ceil(at / re)), Ke = Math.min(Y, (L + at) / re), mt = 0; + for (let ut = ve; ut < Fe; ++ut) { + let gt = ut * J - _e; + for (let xt = ct; xt < Ke; ++xt) { + let Ur = xt * re - at, Bt = S * ue + k * ut + T * xt, io = R * (M - 1 - gt) + D * (L - 1 - Ur) + F * me; + for (let sr = 0; sr < oe; ++sr) { + let Et = me * oe + sr, ar = w[Bt + Et], ir = E[io + sr]; + mt += ar * ir; } } } - h[g * ie + x * be + b * Pe + le] = lt; + h[g * ue + x * be + b * Pe + me] = mt; } } - return e.makeTensorInfo(f.shape, f.dtype, f.values); + return t10.makeTensorInfo(f.shape, f.dtype, f.values); } -var _$ = { kernelName: Pi, backendName: "cpu", kernelFunc: XY }; -function YY(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8, n = y.sizeFromShape(o.shape), s = e.data.get(o.dataId).values, a = me([n, n], o.dtype), i = a.values; +var b$ = { kernelName: Hi, backendName: "cpu", kernelFunc: SQ }; +function IQ(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e, n = y.sizeFromShape(o.shape), s = t10.data.get(o.dataId).values, a = ie([n, n], o.dtype), i = a.values; for (let u = 0; u < s.length; u++) i[u * n + u] = s[u]; let p = [...o.shape, ...o.shape]; - return e.makeTensorInfo(p, a.dtype, a.values); + return t10.makeTensorInfo(p, a.dtype, a.values); } -var $$ = { kernelName: oa, backendName: "cpu", kernelFunc: YY }; -var E$ = { kernelName: dn, backendName: "cpu", kernelFunc: ({ inputs: r15, backend: t8, attrs: e }) => { - let { x: o, filter: n } = r15, { strides: s, pad: a, dilations: i } = e, p = t8, u = p.data.get(o.dataId).values, c = o.shape.length, l = p.data.get(n.dataId).values, m = n.shape.length, { batchSize: d, inHeight: f, inWidth: h, inChannels: g, outHeight: x, outWidth: b, padInfo: C, strideHeight: S, strideWidth: k, filterHeight: _, filterWidth: E, dilationHeight: R, dilationWidth: D, outShape: P } = w.computeDilation2DInfo(o.shape, n.shape, s, a, "NHWC", i), O = y.sizeFromShape(P), M = P.length, L = y.getArrayFromDType(o.dtype, O); +var C$ = { kernelName: ca, backendName: "cpu", kernelFunc: IQ }; +var w$ = { kernelName: zn, backendName: "cpu", kernelFunc: ({ inputs: r16, backend: e, attrs: t10 }) => { + let { x: o, filter: n } = r16, { strides: s, pad: a, dilations: i } = t10, p = e, u = p.data.get(o.dataId).values, l = o.shape.length, c = p.data.get(n.dataId).values, m = n.shape.length, { batchSize: d, inHeight: f, inWidth: h, inChannels: g, outHeight: x, outWidth: b, padInfo: w, strideHeight: S, strideWidth: k, filterHeight: T, filterWidth: E, dilationHeight: R, dilationWidth: D, outShape: F } = C.computeDilation2DInfo(o.shape, n.shape, s, a, "NHWC", i), O = y.sizeFromShape(F), M = F.length, L = y.getArrayFromDType(o.dtype, O); for (let z = 0; z < d; ++z) for (let U = 0; U < x; ++U) { - let j = U * S - C.top; + let j = U * S - w.top; for (let q = 0; q < b; ++q) { - let Y = q * k - C.left; + let Y = q * k - w.left; for (let J = 0; J < g; ++J) { let re = Number.MIN_SAFE_INTEGER; - for (let ee = 0; ee < _; ++ee) { + for (let ee = 0; ee < T; ++ee) { let oe = j + ee * R; if (oe >= 0 && oe < f) - for (let ie = 0; ie < E; ++ie) { - let le = Y + ie * D; - if (le >= 0 && le < h) { - let be = y.locToIndex([z, oe, le, J], c, y.computeStrides(o.shape)), _e = y.locToIndex([ee, ie, J], m, y.computeStrides(n.shape)), ve = u[be] + l[_e]; + for (let ue = 0; ue < E; ++ue) { + let me = Y + ue * D; + if (me >= 0 && me < h) { + let be = y.locToIndex([z, oe, me, J], l, y.computeStrides(o.shape)), _e = y.locToIndex([ee, ue, J], m, y.computeStrides(n.shape)), ve = u[be] + c[_e]; ve > re && (re = ve); } } } - let ne = y.locToIndex([z, U, q, J], M, y.computeStrides(P)); + let ne = y.locToIndex([z, U, q, J], M, y.computeStrides(F)); L[ne] = re; } } } - return { dataId: p.write(y.toTypedArray(L, o.dtype), P, o.dtype), shape: P, dtype: o.dtype }; + return { dataId: p.write(y.toTypedArray(L, o.dtype), F, o.dtype), shape: F, dtype: o.dtype }; } }; -var R$ = { kernelName: Mi, backendName: "cpu", kernelFunc: ({ inputs: r15, backend: t8, attrs: e }) => { - let { x: o, filter: n, dy: s } = r15, { strides: a, pad: i, dilations: p } = e, u = t8, c = y.toNestedArray(o.shape, u.data.get(o.dataId).values), l = y.toNestedArray(n.shape, u.data.get(n.dataId).values), { batchSize: m, inHeight: d, inWidth: f, inChannels: h, outHeight: g, outWidth: x, padInfo: b, strideHeight: C, strideWidth: S, filterHeight: k, filterWidth: _, dilationHeight: E, dilationWidth: R, outShape: D } = w.computeDilation2DInfo(o.shape, n.shape, a, i, "NHWC", p); - y.assert(s.rank === D.length, () => `Error in ${Mi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`); - let P = y.toNestedArray(D, u.data.get(s.dataId).values), O = y.makeZerosNestedTypedArray(n.shape, n.dtype); +var S$ = { kernelName: qi, backendName: "cpu", kernelFunc: ({ inputs: r16, backend: e, attrs: t10 }) => { + let { x: o, filter: n, dy: s } = r16, { strides: a, pad: i, dilations: p } = t10, u = e, l = y.toNestedArray(o.shape, u.data.get(o.dataId).values), c = y.toNestedArray(n.shape, u.data.get(n.dataId).values), { batchSize: m, inHeight: d, inWidth: f, inChannels: h, outHeight: g, outWidth: x, padInfo: b, strideHeight: w, strideWidth: S, filterHeight: k, filterWidth: T, dilationHeight: E, dilationWidth: R, outShape: D } = C.computeDilation2DInfo(o.shape, n.shape, a, i, "NHWC", p); + y.assert(s.rank === D.length, () => `Error in ${qi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`); + let F = y.toNestedArray(D, u.data.get(s.dataId).values), O = y.makeZerosNestedTypedArray(n.shape, n.dtype); for (let L = 0; L < m; ++L) for (let B = 0; B < g; ++B) { - let z = B * C - b.top; + let z = B * w - b.top; for (let U = 0; U < x; ++U) { let j = U * S - b.left; for (let q = 0; q < h; ++q) { @@ -14149,27 +14249,27 @@ var R$ = { kernelName: Mi, backendName: "cpu", kernelFunc: ({ inputs: r15, backe for (let ne = 0; ne < k; ++ne) { let ee = z + ne * E; if (ee >= 0 && ee < d) - for (let oe = 0; oe < _; ++oe) { - let ie = j + oe * R; - if (ie >= 0 && ie < f) { - let le = c[L][ee][ie][q] + l[ne][oe][q]; - le > Y && (Y = le, J = ne, re = oe); + for (let oe = 0; oe < T; ++oe) { + let ue = j + oe * R; + if (ue >= 0 && ue < f) { + let me = l[L][ee][ue][q] + c[ne][oe][q]; + me > Y && (Y = me, J = ne, re = oe); } } } - O[J][re][q] += P[L][B][U][q]; + O[J][re][q] += F[L][B][U][q]; } } } return { dataId: u.write(y.toTypedArray(O, o.dtype), n.shape, n.dtype), shape: n.shape, dtype: n.dtype }; } }; -var D$ = { kernelName: Oi, backendName: "cpu", kernelFunc: ({ inputs: r15, backend: t8, attrs: e }) => { - let { x: o, filter: n, dy: s } = r15, { strides: a, pad: i, dilations: p } = e, u = t8, c = y.toNestedArray(o.shape, u.data.get(o.dataId).values), l = y.toNestedArray(n.shape, u.data.get(n.dataId).values), { batchSize: m, inHeight: d, inWidth: f, inChannels: h, outHeight: g, outWidth: x, padInfo: b, strideHeight: C, strideWidth: S, filterHeight: k, filterWidth: _, dilationHeight: E, dilationWidth: R, outShape: D } = w.computeDilation2DInfo(o.shape, n.shape, a, i, "NHWC", p); - y.assert(s.rank === D.length, () => `Error in ${Oi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`); - let P = y.toNestedArray(D, u.data.get(s.dataId).values), O = y.makeZerosNestedTypedArray(o.shape, o.dtype); +var I$ = { kernelName: Ki, backendName: "cpu", kernelFunc: ({ inputs: r16, backend: e, attrs: t10 }) => { + let { x: o, filter: n, dy: s } = r16, { strides: a, pad: i, dilations: p } = t10, u = e, l = y.toNestedArray(o.shape, u.data.get(o.dataId).values), c = y.toNestedArray(n.shape, u.data.get(n.dataId).values), { batchSize: m, inHeight: d, inWidth: f, inChannels: h, outHeight: g, outWidth: x, padInfo: b, strideHeight: w, strideWidth: S, filterHeight: k, filterWidth: T, dilationHeight: E, dilationWidth: R, outShape: D } = C.computeDilation2DInfo(o.shape, n.shape, a, i, "NHWC", p); + y.assert(s.rank === D.length, () => `Error in ${Ki}, dy must have the same rank as output ${D.length}, but got ${s.rank}`); + let F = y.toNestedArray(D, u.data.get(s.dataId).values), O = y.makeZerosNestedTypedArray(o.shape, o.dtype); for (let L = 0; L < m; ++L) for (let B = 0; B < g; ++B) { - let z = B * C - b.top; + let z = B * w - b.top; for (let U = 0; U < x; ++U) { let j = U * S - b.left; for (let q = 0; q < h; ++q) { @@ -14177,181 +14277,181 @@ var D$ = { kernelName: Oi, backendName: "cpu", kernelFunc: ({ inputs: r15, backe for (let ne = 0; ne < k; ++ne) { let ee = z + ne * E; if (ee >= 0 && ee < d) - for (let oe = 0; oe < _; ++oe) { - let ie = j + oe * R; - if (ie >= 0 && ie < f) { - let le = c[L][ee][ie][q] + l[ne][oe][q]; - le > Y && (Y = le, J = ee, re = ie); + for (let oe = 0; oe < T; ++oe) { + let ue = j + oe * R; + if (ue >= 0 && ue < f) { + let me = l[L][ee][ue][q] + c[ne][oe][q]; + me > Y && (Y = me, J = ee, re = ue); } } } - O[L][J][re][q] += P[L][B][U][q]; + O[L][J][re][q] += F[L][B][U][q]; } } } return { dataId: u.write(y.toTypedArray(O, o.dtype), o.shape, o.dtype), shape: o.shape, dtype: o.dtype }; } }; -function QY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n } = t8, { canvas: s, options: a } = o, { contextOptions: i, imageOptions: p } = a || {}, u = (p == null ? void 0 : p.alpha) || 1, c = (i == null ? void 0 : i.contextType) || "2d"; - if (c !== "2d") +function vQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n } = e, { canvas: s, options: a } = o, { contextOptions: i, imageOptions: p } = a || {}, u = (p == null ? void 0 : p.alpha) || 1, l = (i == null ? void 0 : i.contextType) || "2d"; + if (l !== "2d") throw new Error(`Context type ${i.contextType} is not supported by the CPU backend.`); - let l = s.getContext(c, (i == null ? void 0 : i.contextAttributes) || {}); - if (l == null) - throw new Error(`Could not get the context with ${c} type.`); - let [m, d] = n.shape.slice(0, 2), f = n.shape.length === 2 ? 1 : n.shape[2], h = e.data.get(n.dataId).values, g = n.dtype === "float32" ? 255 : 1, x = new Uint8ClampedArray(d * m * 4); - for (let C = 0; C < m * d; ++C) { + let c = s.getContext(l, (i == null ? void 0 : i.contextAttributes) || {}); + if (c == null) + throw new Error(`Could not get the context with ${l} type.`); + let [m, d] = n.shape.slice(0, 2), f = n.shape.length === 2 ? 1 : n.shape[2], h = t10.data.get(n.dataId).values, g = n.dtype === "float32" ? 255 : 1, x = new Uint8ClampedArray(d * m * 4); + for (let w = 0; w < m * d; ++w) { let S = [0, 0, 0, 255 * u]; - for (let _ = 0; _ < f; _++) { - let E = h[C * f + _]; + for (let T = 0; T < f; T++) { + let E = h[w * f + T]; if (n.dtype === "float32") { if (E < 0 || E > 1) throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${E}.`); } else if (n.dtype === "int32" && (E < 0 || E > 255)) throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${E}.`); - f === 1 ? (S[0] = E * g, S[1] = E * g, S[2] = E * g) : S[_] = E * g; + f === 1 ? (S[0] = E * g, S[1] = E * g, S[2] = E * g) : S[T] = E * g; } - let k = C * 4; + let k = w * 4; x[k + 0] = Math.round(S[0]), x[k + 1] = Math.round(S[1]), x[k + 2] = Math.round(S[2]), x[k + 3] = Math.round(S[3]); } s.width = d, s.height = m; let b = new ImageData(x, d, m); - return l.putImageData(b, 0, 0), n; + return c.putImageData(b, 0, 0), n; } -var A$ = { kernelName: _u, backendName: "cpu", kernelFunc: QY }; -function di(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; +var v$ = { kernelName: Mu, backendName: "cpu", kernelFunc: vQ }; +function Ii(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; Q(n, "sum"); let i; - n.dtype === "bool" ? i = Ro({ inputs: { x: n }, backend: e, attrs: { dtype: "int32" } }) : i = lr({ inputs: { x: n }, backend: e }); - let p = i.shape.length, u = y.parseAxisParam(s, i.shape), c = w.getAxesPermutation(u, p), l = u, m = i; - c != null && (m = St({ inputs: { x: i }, backend: e, attrs: { perm: c } }), l = w.getInnerMostAxes(l.length, p)), w.assertAxesAreInnerMostDims("sum", l, m.shape.length); - let [d, f] = w.computeOutAndReduceShapes(m.shape, l), h = w.upcastType(m.dtype, "int32"), g = gc(e, d, h), x = y.sizeFromShape(f), b = e.data.get(g.dataId).values, C = e.data.get(m.dataId).values; + n.dtype === "bool" ? i = rn({ inputs: { x: n }, backend: t10, attrs: { dtype: "int32" } }) : i = fr({ inputs: { x: n }, backend: t10 }); + let p = i.shape.length, u = y.parseAxisParam(s, i.shape), l = C.getAxesPermutation(u, p), c = u, m = i; + l != null && (m = vt({ inputs: { x: i }, backend: t10, attrs: { perm: l } }), c = C.getInnerMostAxes(c.length, p)), C.assertAxesAreInnerMostDims("sum", c, m.shape.length); + let [d, f] = C.computeOutAndReduceShapes(m.shape, c), h = C.upcastType(m.dtype, "int32"), g = vl(t10, d, h), x = y.sizeFromShape(f), b = t10.data.get(g.dataId).values, w = t10.data.get(m.dataId).values; for (let S = 0; S < b.length; ++S) { - let k = S * x, _ = 0; + let k = S * x, T = 0; for (let E = 0; E < x; ++E) - _ += C[k + E]; - b[S] = _; + T += w[k + E]; + b[S] = T; } if (a) { - let S = w.expandShapeToKeepDim(g.shape, u), k = g; - g = Ve({ inputs: { x: g }, backend: e, attrs: { shape: S } }), e.disposeIntermediateTensorInfo(k); - } - return e.disposeIntermediateTensorInfo(i), c != null && e.disposeIntermediateTensorInfo(m), g; -} -var F$ = { kernelName: Ss, backendName: "cpu", kernelFunc: di }; -function ZY(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { equation: n } = o, s = t8, { allDims: a, summedDims: i, idDims: p } = w.decodeEinsumEquation(n, s.length); - w.checkEinsumDimSizes(a.length, p, s); - let { path: u, steps: c } = w.getEinsumComputePath(i, p), l = c.length, m = null, d = a.length, f = []; - for (let h = 0; h < l; ++h) { - for (let g of c[h]) { - let { permutationIndices: x, expandDims: b } = w.getEinsumPermutation(d, p[g]), C; - w.isIdentityPermutation(x) ? C = s[g] : (C = St({ inputs: { x: s[g] }, backend: e, attrs: { perm: x } }), f.push(C)); - let S = C.shape.slice(); + let S = C.expandShapeToKeepDim(g.shape, u), k = g; + g = We({ inputs: { x: g }, backend: t10, attrs: { shape: S } }), t10.disposeIntermediateTensorInfo(k); + } + return t10.disposeIntermediateTensorInfo(i), l != null && t10.disposeIntermediateTensorInfo(m), g; +} +var k$ = { kernelName: As, backendName: "cpu", kernelFunc: Ii }; +function kQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { equation: n } = o, s = e, { allDims: a, summedDims: i, idDims: p } = C.decodeEinsumEquation(n, s.length); + C.checkEinsumDimSizes(a.length, p, s); + let { path: u, steps: l } = C.getEinsumComputePath(i, p), c = l.length, m = null, d = a.length, f = []; + for (let h = 0; h < c; ++h) { + for (let g of l[h]) { + let { permutationIndices: x, expandDims: b } = C.getEinsumPermutation(d, p[g]), w; + C.isIdentityPermutation(x) ? w = s[g] : (w = vt({ inputs: { x: s[g] }, backend: t10, attrs: { perm: x } }), f.push(w)); + let S = w.shape.slice(); for (let k = 0; k < b.length; ++k) S.splice(b[k], 0, 1); - y.arraysEqual(C.shape, S) || (C = Ve({ inputs: { x: C }, backend: e, attrs: { shape: S } }), f.push(C)), m === null ? m = C : (m = sp({ inputs: { a: C, b: m }, backend: e }), f.push(m)); + y.arraysEqual(w.shape, S) || (w = We({ inputs: { x: w }, backend: t10, attrs: { shape: S } }), f.push(w)), m === null ? m = w : (m = dp({ inputs: { a: w, b: m }, backend: t10 }), f.push(m)); } - h < l - 1 && (u[h] >= 0 && (m = di({ inputs: { x: m }, backend: e, attrs: { axis: u[h] - (a.length - d), keepDims: false } }), f.push(m)), d--); + h < c - 1 && (u[h] >= 0 && (m = Ii({ inputs: { x: m }, backend: t10, attrs: { axis: u[h] - (a.length - d), keepDims: false } }), f.push(m)), d--); } for (let h of f) - h !== m && e.disposeIntermediateTensorInfo(h); + h !== m && t10.disposeIntermediateTensorInfo(h); return m; } -var P$ = { kernelName: Li, backendName: "cpu", kernelFunc: ZY }; -function JY(r15) { - let { inputs: t8, backend: e } = r15, { dy: o, y: n } = t8; +var N$ = { kernelName: ji, backendName: "cpu", kernelFunc: kQ }; +function NQ(r16) { + let { inputs: e, backend: t10 } = r16, { dy: o, y: n } = e; Q([o, n], "eluGrad"); - let s = new Float32Array(y.sizeFromShape(n.shape)), a = e.data.get(n.dataId).values, i = e.data.get(o.dataId).values; + let s = new Float32Array(y.sizeFromShape(n.shape)), a = t10.data.get(n.dataId).values, i = t10.data.get(o.dataId).values; for (let p = 0; p < a.length; ++p) { let u = a[p]; u >= 0 ? s[p] = i[p] : s[p] = i[p] * (u + 1); } - return e.makeTensorInfo(n.shape, "float32", s); -} -var O$ = { kernelName: Xa, backendName: "cpu", kernelFunc: JY }; -var eQ = w.ERF_P; -var tQ = w.ERF_A1; -var rQ = w.ERF_A2; -var oQ = w.ERF_A3; -var nQ = w.ERF_A4; -var sQ = w.ERF_A5; -var aQ = Ie(gn, (r15) => { - let t8 = Math.sign(r15), e = Math.abs(r15), o = 1 / (1 + eQ * e); - return t8 * (1 - ((((sQ * o + nQ) * o + oQ) * o + rQ) * o + tQ) * o * Math.exp(-e * e)); + return t10.makeTensorInfo(n.shape, "float32", s); +} +var T$ = { kernelName: ri, backendName: "cpu", kernelFunc: NQ }; +var TQ = C.ERF_P; +var _Q = C.ERF_A1; +var EQ = C.ERF_A2; +var $Q = C.ERF_A3; +var RQ = C.ERF_A4; +var DQ = C.ERF_A5; +var AQ = Ie(Un, (r16) => { + let e = Math.sign(r16), t10 = Math.abs(r16), o = 1 / (1 + TQ * t10); + return e * (1 - ((((DQ * o + RQ) * o + $Q) * o + EQ) * o + _Q) * o * Math.exp(-t10 * t10)); }); -var M$ = { kernelName: gn, backendName: "cpu", kernelFunc: aQ }; -function Ic(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { input: n } = t8, { dim: s } = o, a = n.shape.length, i = n.shape.slice(), p = s; - return s < 0 && (y.assert(-(a + 1) <= s, () => `Axis must be in the interval [${-(a + 1)}, ${a}]`), p = a + s + 1), i.splice(p, 0, 1), Ve({ inputs: { x: n }, backend: e, attrs: { shape: i } }); -} -var L$ = { kernelName: na, backendName: "cpu", kernelFunc: Ic }; -var iQ = ze((r15, t8) => r15 / t8); -var Vl = Ye(fn, iQ); -var Wl = { kernelName: fn, backendName: "cpu", kernelFunc: Vl }; -function zf(r15, t8, e) { - let o = r15.shape, n = o[0], s = o[1], a = e.data.get(r15.dataId), i = a.complexTensorInfos.real, p = a.complexTensorInfos.imag, u = [n, s], c = y.sizeFromShape(u), l = y.getTypedArrayFromDType("float32", c), m = y.getTypedArrayFromDType("float32", c); +var _$ = { kernelName: Un, backendName: "cpu", kernelFunc: AQ }; +function $l(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { input: n } = e, { dim: s } = o, a = n.shape.length, i = n.shape.slice(), p = s; + return s < 0 && (y.assert(-(a + 1) <= s, () => `Axis must be in the interval [${-(a + 1)}, ${a}]`), p = a + s + 1), i.splice(p, 0, 1), We({ inputs: { x: n }, backend: t10, attrs: { shape: i } }); +} +var E$ = { kernelName: ma, backendName: "cpu", kernelFunc: $l }; +var FQ = Ve((r16, e) => r16 / e); +var Yc = Qe(Vn, FQ); +var Qc = { kernelName: Vn, backendName: "cpu", kernelFunc: Yc }; +function Zf(r16, e, t10) { + let o = r16.shape, n = o[0], s = o[1], a = t10.data.get(r16.dataId), i = a.complexTensorInfos.real, p = a.complexTensorInfos.imag, u = [n, s], l = y.sizeFromShape(u), c = y.getTypedArrayFromDType("float32", l), m = y.getTypedArrayFromDType("float32", l); for (let g = 0; g < n; g++) { - let x = Ao({ inputs: { x: i }, backend: e, attrs: { begin: [g, 0], size: [1, s] } }), b = Ao({ inputs: { x: p }, backend: e, attrs: { begin: [g, 0], size: [1, s] } }), C = Ht({ inputs: { real: x, imag: b }, backend: e }), { real: S, imag: k } = uQ(C, t8, e), _ = w.mergeRealAndImagArrays(S, k); + let x = nn({ inputs: { x: i }, backend: t10, attrs: { begin: [g, 0], size: [1, s] } }), b = nn({ inputs: { x: p }, backend: t10, attrs: { begin: [g, 0], size: [1, s] } }), w = qt({ inputs: { real: x, imag: b }, backend: t10 }), { real: S, imag: k } = PQ(w, e, t10), T = C.mergeRealAndImagArrays(S, k); for (let E = 0; E < s; E++) { - let R = w.getComplexWithIndex(_, E); - l[g * s + E] = R.real, m[g * s + E] = R.imag; + let R = C.getComplexWithIndex(T, E); + c[g * s + E] = R.real, m[g * s + E] = R.imag; } - e.disposeIntermediateTensorInfo(x), e.disposeIntermediateTensorInfo(b), e.disposeIntermediateTensorInfo(C); + t10.disposeIntermediateTensorInfo(x), t10.disposeIntermediateTensorInfo(b), t10.disposeIntermediateTensorInfo(w); } - let d = e.makeTensorInfo(u, "float32", l), f = e.makeTensorInfo(u, "float32", m), h = Ht({ inputs: { real: d, imag: f }, backend: e }); - return e.disposeIntermediateTensorInfo(d), e.disposeIntermediateTensorInfo(f), h; + let d = t10.makeTensorInfo(u, "float32", c), f = t10.makeTensorInfo(u, "float32", m), h = qt({ inputs: { real: d, imag: f }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(d), t10.disposeIntermediateTensorInfo(f), h; } -function uQ(r15, t8, e) { - let o = y.sizeFromShape(r15.shape), n = e.data.get(r15.dataId), s = e.data.get(n.complexTensorInfos.real.dataId).values, a = e.data.get(n.complexTensorInfos.imag.dataId).values; - if (pQ(o)) { - let i = wI(s, a, o, t8, e), p = [r15.shape[0], r15.shape[1]]; - if (t8) { - let u = e.makeTensorInfo(p, "float32", i.real), c = e.makeTensorInfo(p, "float32", i.imag), l = e.makeTensorInfo([], "float32", y.createScalarValue(o, "float32")), m = lr({ inputs: { x: l }, backend: e }), d = Wl.kernelFunc({ inputs: { a: u, b: l }, backend: e }), f = Wl.kernelFunc({ inputs: { a: c, b: m }, backend: e }), h = e.data.get(d.dataId).values, g = e.data.get(f.dataId).values; - return e.disposeIntermediateTensorInfo(u), e.disposeIntermediateTensorInfo(c), e.disposeIntermediateTensorInfo(l), e.disposeIntermediateTensorInfo(m), e.disposeIntermediateTensorInfo(d), e.disposeIntermediateTensorInfo(f), { real: h, imag: g }; +function PQ(r16, e, t10) { + let o = y.sizeFromShape(r16.shape), n = t10.data.get(r16.dataId), s = t10.data.get(n.complexTensorInfos.real.dataId).values, a = t10.data.get(n.complexTensorInfos.imag.dataId).values; + if (OQ(o)) { + let i = PI(s, a, o, e, t10), p = [r16.shape[0], r16.shape[1]]; + if (e) { + let u = t10.makeTensorInfo(p, "float32", i.real), l = t10.makeTensorInfo(p, "float32", i.imag), c = t10.makeTensorInfo([], "float32", y.createScalarValue(o, "float32")), m = fr({ inputs: { x: c }, backend: t10 }), d = Qc.kernelFunc({ inputs: { a: u, b: c }, backend: t10 }), f = Qc.kernelFunc({ inputs: { a: l, b: m }, backend: t10 }), h = t10.data.get(d.dataId).values, g = t10.data.get(f.dataId).values; + return t10.disposeIntermediateTensorInfo(u), t10.disposeIntermediateTensorInfo(l), t10.disposeIntermediateTensorInfo(c), t10.disposeIntermediateTensorInfo(m), t10.disposeIntermediateTensorInfo(d), t10.disposeIntermediateTensorInfo(f), { real: h, imag: g }; } return i; } else { - let i = w.mergeRealAndImagArrays(s, a), p = cQ(i, o, t8); - return w.splitRealAndImagArrays(p); + let i = C.mergeRealAndImagArrays(s, a), p = MQ(i, o, e); + return C.splitRealAndImagArrays(p); } } -function pQ(r15) { - return (r15 & r15 - 1) === 0; +function OQ(r16) { + return (r16 & r16 - 1) === 0; } -function wI(r15, t8, e, o, n) { - if (e === 1) - return { real: r15, imag: t8 }; - let s = w.mergeRealAndImagArrays(r15, t8), a = e / 2, i = w.complexWithEvenIndex(s), p = i.real, u = i.imag, c = [p.length], l = n.makeTensorInfo(c, "float32", p), m = n.makeTensorInfo(c, "float32", u), d = Ht({ inputs: { real: l, imag: m }, backend: n }), f = w.complexWithOddIndex(s), h = f.real, g = f.imag, x = [h.length], b = n.makeTensorInfo(x, "float32", h), C = n.makeTensorInfo(x, "float32", g), S = Ht({ inputs: { real: b, imag: C }, backend: n }), k = wI(p, u, a, o, n), _ = k.real, E = k.imag, R = [_.length], D = n.makeTensorInfo(R, "float32", _), P = n.makeTensorInfo(R, "float32", E), O = Ht({ inputs: { real: D, imag: P }, backend: n }), M = wI(h, g, a, o, n), L = M.real, B = M.imag, z = [L.length], U = n.makeTensorInfo(z, "float32", L), j = n.makeTensorInfo(z, "float32", B), q = Ht({ inputs: { real: U, imag: j }, backend: n }), Y = w.exponents(e, o), J = [Y.real.length], re = n.makeTensorInfo(J, "float32", Y.real), ne = n.makeTensorInfo(J, "float32", Y.imag), ee = Ht({ inputs: { real: re, imag: ne }, backend: n }), oe = sp({ inputs: { a: ee, b: q }, backend: n }), ie = Pa({ inputs: { a: O, b: oe }, backend: n }), le = Bl({ inputs: { a: O, b: oe }, backend: n }), be = Eo({ inputs: { input: ie }, backend: n }), _e = Eo({ inputs: { input: le }, backend: n }), ve = Oa({ inputs: { input: ie }, backend: n }), Fe = Oa({ inputs: { input: le }, backend: n }), Pe = du({ inputs: [be, _e], backend: n, attrs: { axis: 0 } }), st = du({ inputs: [ve, Fe], backend: n, attrs: { axis: 0 } }), ct = n.data.get(Pe.dataId).values, Ge = n.data.get(st.dataId).values; - return n.disposeIntermediateTensorInfo(l), n.disposeIntermediateTensorInfo(m), n.disposeIntermediateTensorInfo(d), n.disposeIntermediateTensorInfo(b), n.disposeIntermediateTensorInfo(C), n.disposeIntermediateTensorInfo(S), n.disposeIntermediateTensorInfo(D), n.disposeIntermediateTensorInfo(P), n.disposeIntermediateTensorInfo(O), n.disposeIntermediateTensorInfo(U), n.disposeIntermediateTensorInfo(j), n.disposeIntermediateTensorInfo(q), n.disposeIntermediateTensorInfo(re), n.disposeIntermediateTensorInfo(ne), n.disposeIntermediateTensorInfo(ee), n.disposeIntermediateTensorInfo(oe), n.disposeIntermediateTensorInfo(ie), n.disposeIntermediateTensorInfo(le), n.disposeIntermediateTensorInfo(be), n.disposeIntermediateTensorInfo(ve), n.disposeIntermediateTensorInfo(_e), n.disposeIntermediateTensorInfo(Fe), n.disposeIntermediateTensorInfo(Pe), n.disposeIntermediateTensorInfo(st), { real: ct, imag: Ge }; +function PI(r16, e, t10, o, n) { + if (t10 === 1) + return { real: r16, imag: e }; + let s = C.mergeRealAndImagArrays(r16, e), a = t10 / 2, i = C.complexWithEvenIndex(s), p = i.real, u = i.imag, l = [p.length], c = n.makeTensorInfo(l, "float32", p), m = n.makeTensorInfo(l, "float32", u), d = qt({ inputs: { real: c, imag: m }, backend: n }), f = C.complexWithOddIndex(s), h = f.real, g = f.imag, x = [h.length], b = n.makeTensorInfo(x, "float32", h), w = n.makeTensorInfo(x, "float32", g), S = qt({ inputs: { real: b, imag: w }, backend: n }), k = PI(p, u, a, o, n), T = k.real, E = k.imag, R = [T.length], D = n.makeTensorInfo(R, "float32", T), F = n.makeTensorInfo(R, "float32", E), O = qt({ inputs: { real: D, imag: F }, backend: n }), M = PI(h, g, a, o, n), L = M.real, B = M.imag, z = [L.length], U = n.makeTensorInfo(z, "float32", L), j = n.makeTensorInfo(z, "float32", B), q = qt({ inputs: { real: U, imag: j }, backend: n }), Y = C.exponents(t10, o), J = [Y.real.length], re = n.makeTensorInfo(J, "float32", Y.real), ne = n.makeTensorInfo(J, "float32", Y.imag), ee = qt({ inputs: { real: re, imag: ne }, backend: n }), oe = dp({ inputs: { a: ee, b: q }, backend: n }), ue = Wa({ inputs: { a: O, b: oe }, backend: n }), me = jc({ inputs: { a: O, b: oe }, backend: n }), be = tn({ inputs: { input: ue }, backend: n }), _e = tn({ inputs: { input: me }, backend: n }), ve = Ua({ inputs: { input: ue }, backend: n }), Fe = Ua({ inputs: { input: me }, backend: n }), Pe = Su({ inputs: [be, _e], backend: n, attrs: { axis: 0 } }), at = Su({ inputs: [ve, Fe], backend: n, attrs: { axis: 0 } }), ct = n.data.get(Pe.dataId).values, Ke = n.data.get(at.dataId).values; + return n.disposeIntermediateTensorInfo(c), n.disposeIntermediateTensorInfo(m), n.disposeIntermediateTensorInfo(d), n.disposeIntermediateTensorInfo(b), n.disposeIntermediateTensorInfo(w), n.disposeIntermediateTensorInfo(S), n.disposeIntermediateTensorInfo(D), n.disposeIntermediateTensorInfo(F), n.disposeIntermediateTensorInfo(O), n.disposeIntermediateTensorInfo(U), n.disposeIntermediateTensorInfo(j), n.disposeIntermediateTensorInfo(q), n.disposeIntermediateTensorInfo(re), n.disposeIntermediateTensorInfo(ne), n.disposeIntermediateTensorInfo(ee), n.disposeIntermediateTensorInfo(oe), n.disposeIntermediateTensorInfo(ue), n.disposeIntermediateTensorInfo(me), n.disposeIntermediateTensorInfo(be), n.disposeIntermediateTensorInfo(ve), n.disposeIntermediateTensorInfo(_e), n.disposeIntermediateTensorInfo(Fe), n.disposeIntermediateTensorInfo(Pe), n.disposeIntermediateTensorInfo(at), { real: ct, imag: Ke }; } -function cQ(r15, t8, e) { - let o = new Float32Array(t8 * 2); - for (let n = 0; n < t8; n++) { +function MQ(r16, e, t10) { + let o = new Float32Array(e * 2); + for (let n = 0; n < e; n++) { let s = 0, a = 0; - for (let i = 0; i < t8; i++) { - let p = w.exponent(n * i, t8, e), u = w.getComplexWithIndex(r15, i); + for (let i = 0; i < e; i++) { + let p = C.exponent(n * i, e, t10), u = C.getComplexWithIndex(r16, i); s += u.real * p.real - u.imag * p.imag, a += u.real * p.imag + u.imag * p.real; } - e && (s /= t8, a /= t8), w.assignToTypedArray(o, s, a, n); + t10 && (s /= e, a /= e), C.assignToTypedArray(o, s, a, n); } return o; } -function lQ(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = y.sizeFromShape(o.shape), s = o.shape[o.shape.length - 1], a = n / s, i = Ve({ inputs: { x: o }, backend: e, attrs: { shape: [a, s] } }), p = zf(i, false, e), u = Ve({ inputs: { x: p }, backend: e, attrs: { shape: o.shape } }); - return e.disposeIntermediateTensorInfo(i), e.disposeIntermediateTensorInfo(p), u; +function LQ(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = y.sizeFromShape(o.shape), s = o.shape[o.shape.length - 1], a = n / s, i = We({ inputs: { x: o }, backend: t10, attrs: { shape: [a, s] } }), p = Zf(i, false, t10), u = We({ inputs: { x: p }, backend: t10, attrs: { shape: o.shape } }); + return t10.disposeIntermediateTensorInfo(i), t10.disposeIntermediateTensorInfo(p), u; } -var B$ = { kernelName: Bi, backendName: "cpu", kernelFunc: lQ }; -function Ul(r15) { - let { backend: t8, attrs: e } = r15, { shape: o, value: n, dtype: s } = e, a = s || y.inferDtype(n), i = y.getArrayFromDType(a, y.sizeFromShape(o)); - return mQ(i, n, a), t8.makeTensorInfo(o, a, i); +var $$ = { kernelName: Xi, backendName: "cpu", kernelFunc: LQ }; +function Zc(r16) { + let { backend: e, attrs: t10 } = r16, { shape: o, value: n, dtype: s } = t10, a = s || y.inferDtype(n), i = y.getArrayFromDType(a, y.sizeFromShape(o)); + return BQ(i, n, a), e.makeTensorInfo(o, a, i); } -var z$ = { kernelName: sa, backendName: "cpu", kernelFunc: Ul }; -function mQ(r15, t8, e) { - r15.fill(t8); +var R$ = { kernelName: da, backendName: "cpu", kernelFunc: Zc }; +function BQ(r16, e, t10) { + r16.fill(e); } -var V$ = { kernelName: Cn, backendName: "cpu", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { image: o } = r15, n = e, s = y.getTypedArrayFromDType(o.dtype, y.sizeFromShape(o.shape)), [a, i, p, u] = o.shape, c = n.data.get(o.dataId).values; +var D$ = { kernelName: Gn, backendName: "cpu", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { image: o } = r16, n = t10, s = y.getTypedArrayFromDType(o.dtype, y.sizeFromShape(o.shape)), [a, i, p, u] = o.shape, l = n.data.get(o.dataId).values; for (let m = 0; m < a; m++) { let d = m * p * i * u; for (let f = 0; f < i; f++) { @@ -14359,10 +14459,10 @@ var V$ = { kernelName: Cn, backendName: "cpu", kernelFunc: ({ inputs: r15, attrs for (let g = 0; g < p; g++) { let x = g * u; for (let b = 0; b < u; b++) { - let C = Math.round(p - g - 1), S = d + h + x + b, k = c[S]; - if (C >= 0 && C < p) { - let _ = C * u, E = d + h + _ + b; - k = c[E]; + let w = Math.round(p - g - 1), S = d + h + x + b, k = l[S]; + if (w >= 0 && w < p) { + let T = w * u, E = d + h + T + b; + k = l[E]; } s[S] = k; } @@ -14371,481 +14471,481 @@ var V$ = { kernelName: Cn, backendName: "cpu", kernelFunc: ({ inputs: r15, attrs } return { dataId: n.write(s, o.shape, o.dtype), shape: o.shape, dtype: o.dtype }; } }; -function dQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dataFormat: c, dilations: l, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = bI({ inputs: { x: n, filter: s }, backend: e, attrs: { strides: p, pad: u, dataFormat: c, dilations: l, dimRoundingMode: m } }); +function zQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dataFormat: l, dilations: c, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = AI({ inputs: { x: n, filter: s }, backend: t10, attrs: { strides: p, pad: u, dataFormat: l, dilations: c, dimRoundingMode: m } }); if (a) { let g = h; - if (c === "NCHW" && a.shape.length === 1 && a.shape[0] !== 1) { - let x = Ve({ inputs: { x: a }, backend: e, attrs: { shape: [a.shape[0], 1, 1] } }); - h = Pa({ inputs: { a: h, b: x }, backend: e }), e.disposeIntermediateTensorInfo(x); + if (l === "NCHW" && a.shape.length === 1 && a.shape[0] !== 1) { + let x = We({ inputs: { x: a }, backend: t10, attrs: { shape: [a.shape[0], 1, 1] } }); + h = Wa({ inputs: { a: h, b: x }, backend: t10 }), t10.disposeIntermediateTensorInfo(x); } else - h = Pa({ inputs: { a: h, b: a }, backend: e }); - e.disposeIntermediateTensorInfo(g); + h = Wa({ inputs: { a: h, b: a }, backend: t10 }); + t10.disposeIntermediateTensorInfo(g); } if (d) { let g = h; - if (c === "NCHW" && d === "prelu" && i.shape.length === 1 && i.shape[0] !== 1) { - let x = Ve({ inputs: { x: i }, backend: e, attrs: { shape: [i.shape[0], 1, 1] } }); - h = mp(e, h, d, x, f), e.disposeIntermediateTensorInfo(x); + if (l === "NCHW" && d === "prelu" && i.shape.length === 1 && i.shape[0] !== 1) { + let x = We({ inputs: { x: i }, backend: t10, attrs: { shape: [i.shape[0], 1, 1] } }); + h = Cp(t10, h, d, x, f), t10.disposeIntermediateTensorInfo(x); } else - h = mp(e, h, d, i, f); - e.disposeIntermediateTensorInfo(g); + h = Cp(t10, h, d, i, f); + t10.disposeIntermediateTensorInfo(g); } return h; } -var W$ = { kernelName: Io, backendName: "cpu", kernelFunc: dQ }; -function fQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dataFormat: c, dilations: l, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = CI({ inputs: { x: n, filter: s }, backend: e, attrs: { strides: p, pad: u, dataFormat: c, dilations: l, dimRoundingMode: m } }); +var A$ = { kernelName: jo, backendName: "cpu", kernelFunc: zQ }; +function VQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dataFormat: l, dilations: c, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = FI({ inputs: { x: n, filter: s }, backend: t10, attrs: { strides: p, pad: u, dataFormat: l, dilations: c, dimRoundingMode: m } }); if (a) { let g = h; - h = Pa({ inputs: { a: h, b: a }, backend: e }), e.disposeIntermediateTensorInfo(g); + h = Wa({ inputs: { a: h, b: a }, backend: t10 }), t10.disposeIntermediateTensorInfo(g); } if (d) { let g = h; - h = mp(e, h, d, i, f), e.disposeIntermediateTensorInfo(g); + h = Cp(t10, h, d, i, f), t10.disposeIntermediateTensorInfo(g); } return h; } -var U$ = { kernelName: vo, backendName: "cpu", kernelFunc: fQ }; -function hQ(r15) { - let { inputs: t8, backend: e } = r15, { params: o, indices: n } = t8, s = y.sizeFromShape(o.shape), a = n.shape, i = a[a.length - 1], [p, u, c, l] = w.prepareAndValidate(o, n); +var F$ = { kernelName: Xo, backendName: "cpu", kernelFunc: VQ }; +function WQ(r16) { + let { inputs: e, backend: t10 } = r16, { params: o, indices: n } = e, s = y.sizeFromShape(o.shape), a = n.shape, i = a[a.length - 1], [p, u, l, c] = C.prepareAndValidate(o, n); if (u === 0) - return e.makeTensorInfo(p, o.dtype, []); - let m = e.data.get(n.dataId).values, d = e.bufferSync(o), f = Nf(m, d, o.dtype, u, i, c, l, o.shape, s); - return e.makeTensorInfo(p, o.dtype, f.values); + return t10.makeTensorInfo(p, o.dtype, []); + let m = t10.data.get(n.dataId).values, d = t10.bufferSync(o), f = Mf(m, d, o.dtype, u, i, l, c, o.shape, s); + return t10.makeTensorInfo(p, o.dtype, f.values); } -var G$ = { kernelName: vn, backendName: "cpu", kernelFunc: hQ }; -function gQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, indices: s } = t8, { axis: a, batchDims: i } = o; +var P$ = { kernelName: Kn, backendName: "cpu", kernelFunc: WQ }; +function UQ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, indices: s } = e, { axis: a, batchDims: i } = o; Q([n, s], "gatherV2"); - let p = y.parseAxisParam(a, n.shape)[0], u = e.data.get(s.dataId).values, c = n.shape[p]; + let p = y.parseAxisParam(a, n.shape)[0], u = t10.data.get(s.dataId).values, l = n.shape[p]; for (let S = 0; S < u.length; ++S) { let k = u[S]; - y.assert(k <= c - 1 && k >= 0, () => `GatherV2: the index value ${k} is not in [0, ${c - 1}]`); - } - let l = i; - i == null && (l = 0); - let m = y.sizeFromShape(s.shape), d = w.segment_util.collectGatherOpShapeInfo(n, s, p, l), f = Ve({ inputs: { x: n }, backend: e, attrs: { shape: [d.batchSize, d.outerSize, d.dimSize, d.sliceSize] } }), h = Ve({ inputs: { x: s }, backend: e, attrs: { shape: [d.batchSize, m / d.batchSize] } }), g = [d.batchSize, d.outerSize, m / d.batchSize, d.sliceSize], x = e.bufferSync(h), b = e.bufferSync(f), C = Tf(b, x, g); - return e.disposeIntermediateTensorInfo(f), e.disposeIntermediateTensorInfo(h), e.makeTensorInfo(d.outputShape, C.dtype, C.values); -} -var H$ = { kernelName: aa, backendName: "cpu", kernelFunc: gQ }; -function xQ(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = y.sizeFromShape(o.shape), s = o.shape[o.shape.length - 1], a = n / s, i = Ve({ inputs: { x: o }, backend: e, attrs: { shape: [a, s] } }), p = zf(i, true, e), u = Ve({ inputs: { x: p }, backend: e, attrs: { shape: o.shape } }); - return e.disposeIntermediateTensorInfo(i), e.disposeIntermediateTensorInfo(p), u; -} -var K$ = { kernelName: zi, backendName: "cpu", kernelFunc: xQ }; -var yQ = Ie(Tn, (r15) => Number.isFinite(r15) ? 1 : 0, "bool"); -var q$ = { kernelName: Tn, backendName: "cpu", kernelFunc: yQ }; -var bQ = Ie(_n, (r15) => Math.abs(r15) === 1 / 0 ? 1 : 0, "bool"); -var j$ = { kernelName: _n, backendName: "cpu", kernelFunc: bQ }; -var CQ = Ie($n, (r15) => Number.isNaN(r15) ? 1 : 0, "bool"); -var X$ = { kernelName: $n, backendName: "cpu", kernelFunc: CQ }; -function wQ(r15) { - let { backend: t8, attrs: e } = r15, { start: o, stop: n, num: s } = e, a = _f(o, n, s); - return t8.makeTensorInfo([a.length], "float32", a); -} -var Y$ = { kernelName: An, backendName: "cpu", kernelFunc: wQ }; -var SQ = Ie(Pn, (r15) => Math.log1p(r15)); -var Q$ = { kernelName: Pn, backendName: "cpu", kernelFunc: SQ }; -var IQ = ze((r15, t8) => r15 && t8); -var vQ = Ye(On, IQ, null, "bool"); -var Z$ = { kernelName: On, backendName: "cpu", kernelFunc: vQ }; -var kQ = Ie(Mn, (r15) => r15 ? 0 : 1, "bool"); -var J$ = { kernelName: Mn, backendName: "cpu", kernelFunc: kQ }; -var NQ = ze((r15, t8) => r15 || t8); -var TQ = Ye(Ln, NQ, null, "bool"); -var eE = { kernelName: Ln, backendName: "cpu", kernelFunc: TQ }; -function _Q(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { depthRadius: s, bias: a, alpha: i, beta: p } = o; + y.assert(k <= l - 1 && k >= 0, () => `GatherV2: the index value ${k} is not in [0, ${l - 1}]`); + } + let c = i; + i == null && (c = 0); + let m = y.sizeFromShape(s.shape), d = C.segment_util.collectGatherOpShapeInfo(n, s, p, c), f = We({ inputs: { x: n }, backend: t10, attrs: { shape: [d.batchSize, d.outerSize, d.dimSize, d.sliceSize] } }), h = We({ inputs: { x: s }, backend: t10, attrs: { shape: [d.batchSize, m / d.batchSize] } }), g = [d.batchSize, d.outerSize, m / d.batchSize, d.sliceSize], x = t10.bufferSync(h), b = t10.bufferSync(f), w = Lf(b, x, g); + return t10.disposeIntermediateTensorInfo(f), t10.disposeIntermediateTensorInfo(h), t10.makeTensorInfo(d.outputShape, w.dtype, w.values); +} +var O$ = { kernelName: fa, backendName: "cpu", kernelFunc: UQ }; +function GQ(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = y.sizeFromShape(o.shape), s = o.shape[o.shape.length - 1], a = n / s, i = We({ inputs: { x: o }, backend: t10, attrs: { shape: [a, s] } }), p = Zf(i, true, t10), u = We({ inputs: { x: p }, backend: t10, attrs: { shape: o.shape } }); + return t10.disposeIntermediateTensorInfo(i), t10.disposeIntermediateTensorInfo(p), u; +} +var M$ = { kernelName: Yi, backendName: "cpu", kernelFunc: GQ }; +var HQ = Ie(qn, (r16) => Number.isFinite(r16) ? 1 : 0, "bool"); +var L$ = { kernelName: qn, backendName: "cpu", kernelFunc: HQ }; +var KQ = Ie(jn, (r16) => Math.abs(r16) === 1 / 0 ? 1 : 0, "bool"); +var B$ = { kernelName: jn, backendName: "cpu", kernelFunc: KQ }; +var qQ = Ie(Xn, (r16) => Number.isNaN(r16) ? 1 : 0, "bool"); +var z$ = { kernelName: Xn, backendName: "cpu", kernelFunc: qQ }; +function jQ(r16) { + let { backend: e, attrs: t10 } = r16, { start: o, stop: n, num: s } = t10, a = Bf(o, n, s); + return e.makeTensorInfo([a.length], "float32", a); +} +var V$ = { kernelName: Qn, backendName: "cpu", kernelFunc: jQ }; +var XQ = Ie(Zn, (r16) => Math.log1p(r16)); +var W$ = { kernelName: Zn, backendName: "cpu", kernelFunc: XQ }; +var YQ = Ve((r16, e) => r16 && e); +var QQ = Qe(Jn, YQ, null, "bool"); +var U$ = { kernelName: Jn, backendName: "cpu", kernelFunc: QQ }; +var ZQ = Ie(es, (r16) => r16 ? 0 : 1, "bool"); +var G$ = { kernelName: es, backendName: "cpu", kernelFunc: ZQ }; +var JQ = Ve((r16, e) => r16 || e); +var eZ = Qe(ts, JQ, null, "bool"); +var H$ = { kernelName: ts, backendName: "cpu", kernelFunc: eZ }; +function tZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { depthRadius: s, bias: a, alpha: i, beta: p } = o; Q(n, "LRN"); - let u = n.shape[3], c = u - 1, l = e.data.get(n.dataId).values, m = y.sizeFromShape(n.shape), d = new Float32Array(m); + let u = n.shape[3], l = u - 1, c = t10.data.get(n.dataId).values, m = y.sizeFromShape(n.shape), d = new Float32Array(m); function f(h) { - let g = h % u, x = h - g + Math.max(0, g - s), b = h - g + Math.min(g + s, c), C = 0; + let g = h % u, x = h - g + Math.max(0, g - s), b = h - g + Math.min(g + s, l), w = 0; for (; x <= b; x++) { - let S = l[x]; - C += S * S; + let S = c[x]; + w += S * S; } - return C; + return w; } for (let h = 0; h < m; h++) { - let g = f(h), x = l[h] * Math.pow(a + i * g, -p); + let g = f(h), x = c[h] * Math.pow(a + i * g, -p); d[h] = x; } - return e.makeTensorInfo(n.shape, n.dtype, d); + return t10.makeTensorInfo(n.shape, n.dtype, d); } -var tE = { kernelName: Bn, backendName: "cpu", kernelFunc: _Q }; -function $Q(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, y: s, dy: a } = t8, { depthRadius: i, bias: p, alpha: u, beta: c } = o; +var K$ = { kernelName: rs, backendName: "cpu", kernelFunc: tZ }; +function rZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, y: s, dy: a } = e, { depthRadius: i, bias: p, alpha: u, beta: l } = o; Q(a, "LRNGrad"); - let l = y.sizeFromShape(a.shape), m = a.shape[3], d = e.data.get(a.dataId).values, f = e.data.get(n.dataId).values, h = e.data.get(s.dataId).values, g = new Float32Array(l), x = l; + let c = y.sizeFromShape(a.shape), m = a.shape[3], d = t10.data.get(a.dataId).values, f = t10.data.get(n.dataId).values, h = t10.data.get(s.dataId).values, g = new Float32Array(c), x = c; for (let b = 0; b < x; b++) { - let C = b % m, S = b - C + Math.max(0, C - i), k = b - C + Math.min(m, C + i + 1), _ = 0; + let w = b % m, S = b - w + Math.max(0, w - i), k = b - w + Math.min(m, w + i + 1), T = 0; for (let E = S; E < k; E++) - _ += Math.pow(f[E], 2); - _ = u * _ + p; + T += Math.pow(f[E], 2); + T = u * T + p; for (let E = S; E < k; E++) { - let R = -2 * u * c * f[E] * h[b] / _; - b === E && (R += Math.pow(_, -c)), R *= d[b], g[E] += R; + let R = -2 * u * l * f[E] * h[b] / T; + b === E && (R += Math.pow(T, -l)), R *= d[b], g[E] += R; } } - return e.makeTensorInfo(a.shape, n.dtype, g); + return t10.makeTensorInfo(a.shape, n.dtype, g); } -var rE = { kernelName: Ya, backendName: "cpu", kernelFunc: $Q }; -function SI(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { reductionIndices: s, keepDims: a } = o, i = e, p = n.shape, u = p.length, c = y.parseAxisParam(s, p), l = c, m = w.getAxesPermutation(l, u), d = i.data.get(n.dataId).values; +var q$ = { kernelName: oi, backendName: "cpu", kernelFunc: rZ }; +function OI(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { reductionIndices: s, keepDims: a } = o, i = t10, p = n.shape, u = p.length, l = y.parseAxisParam(s, p), c = l, m = C.getAxesPermutation(c, u), d = i.data.get(n.dataId).values; if (m != null) { let S = new Array(u); for (let k = 0; k < S.length; k++) S[k] = p[m[k]]; - d = bc(d, p, n.dtype, m, S), l = w.getInnerMostAxes(l.length, u), p = S; + d = Tl(d, p, n.dtype, m, S), c = C.getInnerMostAxes(c.length, u), p = S; } - Q(n, "max"), w.assertAxesAreInnerMostDims("max", l, u); - let [f, h] = w.computeOutAndReduceShapes(p, l), g = y.sizeFromShape(h), x = $f(d, g, f, n.dtype), b = i.write(x, f, n.dtype), C = f; - return a && (C = w.expandShapeToKeepDim(f, c)), { dataId: b, shape: C, dtype: n.dtype }; + Q(n, "max"), C.assertAxesAreInnerMostDims("max", c, u); + let [f, h] = C.computeOutAndReduceShapes(p, c), g = y.sizeFromShape(h), x = zf(d, g, f, n.dtype), b = i.write(x, f, n.dtype), w = f; + return a && (w = C.expandShapeToKeepDim(f, l)), { dataId: b, shape: w, dtype: n.dtype }; } -var oE = { kernelName: zn, backendName: "cpu", kernelFunc: SI }; -function EQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8; +var j$ = { kernelName: os, backendName: "cpu", kernelFunc: OI }; +function oZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e; Q(n, "maxPool"); let { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, u = 1; - y.assert(w.eitherStridesOrDilationsAreOne(a, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); - let c = w.computePool2DInfo(n.shape, s, a, u, i, p), l; - if (c.filterWidth === 1 && c.filterHeight === 1 && y.arraysEqual(c.inShape, c.outShape)) - l = lr({ inputs: { x: n }, backend: e }); + y.assert(C.eitherStridesOrDilationsAreOne(a, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); + let l = C.computePool2DInfo(n.shape, s, a, u, i, p), c; + if (l.filterWidth === 1 && l.filterHeight === 1 && y.arraysEqual(l.inShape, l.outShape)) + c = fr({ inputs: { x: n }, backend: t10 }); else { - let m = e.data.get(n.dataId).values, d = y.computeStrides(n.shape), f = Sc(m, n.shape, n.dtype, d, c, "max"); - l = e.makeTensorInfo(c.outShape, n.dtype, f.values); + let m = t10.data.get(n.dataId).values, d = y.computeStrides(n.shape), f = El(m, n.shape, n.dtype, d, l, "max"); + c = t10.makeTensorInfo(l.outShape, n.dtype, f.values); } - return l; + return c; } -var nE = { kernelName: Wn, backendName: "cpu", kernelFunc: EQ }; -function RQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o; +var X$ = { kernelName: ns, backendName: "cpu", kernelFunc: oZ }; +function nZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o; Q(n, "maxPool3d"); - let c = w.computePool3DInfo(n.shape, s, a, 1, i, p, u), l = e.data.get(n.dataId).values, m = Bf(l, n.shape, n.dtype, y.computeStrides(n.shape), c, "max"); - return e.makeTensorInfo(m.shape, "float32", m.values); + let l = C.computePool3DInfo(n.shape, s, a, 1, i, p, u), c = t10.data.get(n.dataId).values, m = Qf(c, n.shape, n.dtype, y.computeStrides(n.shape), l, "max"); + return t10.makeTensorInfo(m.shape, "float32", m.values); } -var sE = { kernelName: ia, backendName: "cpu", kernelFunc: RQ }; -function DQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o; +var Y$ = { kernelName: ha, backendName: "cpu", kernelFunc: nZ }; +function sZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o; Q([n, s], "maxPool3DGrad"); - let c = w.computePool3DInfo(s.shape, a, i, 1, p, u), l = e.bufferSync(s), m = e$(l, c), d = c.strideDepth, f = c.strideHeight, h = c.strideWidth, g = c.dilationDepth, x = c.dilationHeight, b = c.dilationWidth, C = c.effectiveFilterDepth, S = c.effectiveFilterHeight, k = c.effectiveFilterWidth, _ = C - 1 - c.padInfo.front, E = k - 1 - c.padInfo.left, R = S - 1 - c.padInfo.top, D = me(s.shape, "float32"), P = e.bufferSync(n); - for (let O = 0; O < c.batchSize; ++O) - for (let M = 0; M < c.inChannels; ++M) - for (let L = 0; L < c.inDepth; ++L) - for (let B = 0; B < c.inHeight; ++B) - for (let z = 0; z < c.inWidth; ++z) { - let U = L - _, j = B - R, q = z - E, Y = 0; - for (let J = 0; J < C; J += g) { + let l = C.computePool3DInfo(s.shape, a, i, 1, p, u), c = t10.bufferSync(s), m = HE(c, l), d = l.strideDepth, f = l.strideHeight, h = l.strideWidth, g = l.dilationDepth, x = l.dilationHeight, b = l.dilationWidth, w = l.effectiveFilterDepth, S = l.effectiveFilterHeight, k = l.effectiveFilterWidth, T = w - 1 - l.padInfo.front, E = k - 1 - l.padInfo.left, R = S - 1 - l.padInfo.top, D = ie(s.shape, "float32"), F = t10.bufferSync(n); + for (let O = 0; O < l.batchSize; ++O) + for (let M = 0; M < l.inChannels; ++M) + for (let L = 0; L < l.inDepth; ++L) + for (let B = 0; B < l.inHeight; ++B) + for (let z = 0; z < l.inWidth; ++z) { + let U = L - T, j = B - R, q = z - E, Y = 0; + for (let J = 0; J < w; J += g) { let re = (U + J) / d; - if (!(re < 0 || re >= c.outDepth || Math.floor(re) !== re)) + if (!(re < 0 || re >= l.outDepth || Math.floor(re) !== re)) for (let ne = 0; ne < S; ne += x) { let ee = (j + ne) / f; - if (!(ee < 0 || ee >= c.outHeight || Math.floor(ee) !== ee)) + if (!(ee < 0 || ee >= l.outHeight || Math.floor(ee) !== ee)) for (let oe = 0; oe < k; oe += b) { - let ie = (q + oe) / h; - if (ie < 0 || ie >= c.outWidth || Math.floor(ie) !== ie) + let ue = (q + oe) / h; + if (ue < 0 || ue >= l.outWidth || Math.floor(ue) !== ue) continue; - let le = C * S * k - 1 - m.get(O, re, ee, ie, M), be = J * S * k + ne * k + oe, _e = le === be ? 1 : 0; + let me = w * S * k - 1 - m.get(O, re, ee, ue, M), be = J * S * k + ne * k + oe, _e = me === be ? 1 : 0; if (_e === 0) continue; - let ve = P.get(O, re, ee, ie, M); + let ve = F.get(O, re, ee, ue, M); Y += ve * _e; } } } D.set(Y, O, L, B, z, M); } - return e.makeTensorInfo(D.shape, D.dtype, D.values); + return t10.makeTensorInfo(D.shape, D.dtype, D.values); } -var aE = { kernelName: Ui, backendName: "cpu", kernelFunc: DQ }; -function AQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s, output: a } = t8, i = s; +var Q$ = { kernelName: Ji, backendName: "cpu", kernelFunc: sZ }; +function aZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s, output: a } = e, i = s; Q([s, a], "maxPoolGrad"); - let { filterSize: p, strides: u, pad: c, dimRoundingMode: l } = o, m = w.computePool2DInfo(i.shape, p, u, 1, c, l), d = e.data.get(i.dataId).values, f = me(m.outShape, i.dtype, Lf(d, i.shape, i.dtype, m).values), h = m.strideHeight, g = m.strideWidth, x = m.dilationHeight, b = m.dilationWidth, C = m.effectiveFilterHeight, S = m.effectiveFilterWidth, k = S - 1 - m.padInfo.left, _ = C - 1 - m.padInfo.top, E = me(i.shape, "float32"), R = e.data.get(n.dataId).values, D = me(n.shape, "float32", R); - for (let P = 0; P < m.batchSize; ++P) + let { filterSize: p, strides: u, pad: l, dimRoundingMode: c } = o, m = C.computePool2DInfo(i.shape, p, u, 1, l, c), d = t10.data.get(i.dataId).values, f = ie(m.outShape, i.dtype, Yf(d, i.shape, i.dtype, m).values), h = m.strideHeight, g = m.strideWidth, x = m.dilationHeight, b = m.dilationWidth, w = m.effectiveFilterHeight, S = m.effectiveFilterWidth, k = S - 1 - m.padInfo.left, T = w - 1 - m.padInfo.top, E = ie(i.shape, "float32"), R = t10.data.get(n.dataId).values, D = ie(n.shape, "float32", R); + for (let F = 0; F < m.batchSize; ++F) for (let O = 0; O < m.inChannels; ++O) for (let M = 0; M < m.inHeight; ++M) for (let L = 0; L < m.inWidth; ++L) { - let B = M - _, z = L - k, U = 0; - for (let j = 0; j < C; j += x) { + let B = M - T, z = L - k, U = 0; + for (let j = 0; j < w; j += x) { let q = (B + j) / h; if (!(q < 0 || q >= m.outHeight || Math.floor(q) !== q)) for (let Y = 0; Y < S; Y += b) { let J = (z + Y) / g; if (J < 0 || J >= m.outWidth || Math.floor(J) !== J) continue; - let re = C * S - 1 - f.get(P, q, J, O), ne = j * S + Y, ee = re === ne ? 1 : 0; + let re = w * S - 1 - f.get(F, q, J, O), ne = j * S + Y, ee = re === ne ? 1 : 0; if (ee === 0) continue; - let oe = D.get(P, q, J, O); + let oe = D.get(F, q, J, O); U += oe * ee; } } - E.set(U, P, M, L, O); + E.set(U, F, M, L, O); } - return e.makeTensorInfo(E.shape, E.dtype, E.values); + return t10.makeTensorInfo(E.shape, E.dtype, E.values); } -var iE = { kernelName: Wi, backendName: "cpu", kernelFunc: AQ }; -function uE(r15, t8, e, o, n) { - let s = y.computeStrides(t8), a = Sc(r15, t8, e, s, n, "max"), i = Lf(r15, t8, e, n, true, o); +var Z$ = { kernelName: Zi, backendName: "cpu", kernelFunc: aZ }; +function J$(r16, e, t10, o, n) { + let s = y.computeStrides(e), a = El(r16, e, t10, s, n, "max"), i = Yf(r16, e, t10, n, true, o); return [a.values, i.values]; } -var pE = { kernelName: ua, backendName: "cpu", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { x: o } = r15, { filterSize: n, strides: s, pad: a, includeBatchInIndex: i } = t8, p = e; +var eR = { kernelName: ga, backendName: "cpu", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { x: o } = r16, { filterSize: n, strides: s, pad: a, includeBatchInIndex: i } = e, p = t10; Q(o, "MaxPoolWithArgmax"); - let u = p.data.get(o.dataId).values, c = w.computePool2DInfo(o.shape, n, s, [1, 1], a), [l, m] = uE(u, o.shape, o.dtype, i, c), d = p.write(l, c.outShape, o.dtype), f = p.write(m, c.outShape, o.dtype); - return [{ dataId: d, shape: c.outShape, dtype: o.dtype }, { dataId: f, shape: c.outShape, dtype: "int32" }]; + let u = p.data.get(o.dataId).values, l = C.computePool2DInfo(o.shape, n, s, [1, 1], a), [c, m] = J$(u, o.shape, o.dtype, i, l), d = p.write(c, l.outShape, o.dtype), f = p.write(m, l.outShape, o.dtype); + return [{ dataId: d, shape: l.outShape, dtype: o.dtype }, { dataId: f, shape: l.outShape, dtype: "int32" }]; } }; -function FQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o, i = y.parseAxisParam(s, n.shape), u = w.computeOutAndReduceShapes(n.shape, i)[1], c = y.sizeFromShape(u), l = [], m = e.makeTensorInfo([], "float32", new Float32Array([c])); - l.push(m); - let d = Ro({ inputs: { x: n }, backend: e, attrs: { dtype: "float32" } }); - l.push(d); - let f = Vl({ inputs: { a: d, b: m }, backend: e }); - l.push(f); - let h = di({ inputs: { x: f }, backend: e, attrs: { axis: s, keepDims: a } }); - return l.forEach((g) => e.disposeIntermediateTensorInfo(g)), h; -} -var cE = { kernelName: Un, backendName: "cpu", kernelFunc: FQ }; -function PQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; +function iZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o, i = y.parseAxisParam(s, n.shape), u = C.computeOutAndReduceShapes(n.shape, i)[1], l = y.sizeFromShape(u), c = [], m = t10.makeTensorInfo([], "float32", new Float32Array([l])); + c.push(m); + let d = rn({ inputs: { x: n }, backend: t10, attrs: { dtype: "float32" } }); + c.push(d); + let f = Yc({ inputs: { a: d, b: m }, backend: t10 }); + c.push(f); + let h = Ii({ inputs: { x: f }, backend: t10, attrs: { axis: s, keepDims: a } }); + return c.forEach((g) => t10.disposeIntermediateTensorInfo(g)), h; +} +var tR = { kernelName: ss, backendName: "cpu", kernelFunc: iZ }; +function uZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; Q(n, "min"); - let i = y.parseAxisParam(s, n.shape), p = i, u = w.getAxesPermutation(p, n.shape.length), c = n; - u != null && (c = St({ inputs: { x: n }, backend: e, attrs: { perm: u } }), p = w.getInnerMostAxes(p.length, n.shape.length)), w.assertAxesAreInnerMostDims("min", p, c.shape.length); - let [l, m] = w.computeOutAndReduceShapes(c.shape, p), d = y.sizeFromShape(m), f = y.makeZerosTypedArray(y.sizeFromShape(l), c.dtype), h = e.data.get(c.dataId).values; + let i = y.parseAxisParam(s, n.shape), p = i, u = C.getAxesPermutation(p, n.shape.length), l = n; + u != null && (l = vt({ inputs: { x: n }, backend: t10, attrs: { perm: u } }), p = C.getInnerMostAxes(p.length, n.shape.length)), C.assertAxesAreInnerMostDims("min", p, l.shape.length); + let [c, m] = C.computeOutAndReduceShapes(l.shape, p), d = y.sizeFromShape(m), f = y.makeZerosTypedArray(y.sizeFromShape(c), l.dtype), h = t10.data.get(l.dataId).values; for (let x = 0; x < f.length; ++x) { - let b = x * d, C = h[b]; + let b = x * d, w = h[b]; for (let S = 0; S < d; ++S) { let k = h[b + S]; - (Number.isNaN(k) || k < C) && (C = k); + (Number.isNaN(k) || k < w) && (w = k); } - f[x] = C; + f[x] = w; } - u != null && e.disposeIntermediateTensorInfo(c); - let g = e.makeTensorInfo(l, c.dtype, f); + u != null && t10.disposeIntermediateTensorInfo(l); + let g = t10.makeTensorInfo(c, l.dtype, f); if (a) { - let x = w.expandShapeToKeepDim(l, i), b = Ve({ inputs: { x: g }, backend: e, attrs: { shape: x } }); - return e.disposeIntermediateTensorInfo(g), b; + let x = C.expandShapeToKeepDim(c, i), b = We({ inputs: { x: g }, backend: t10, attrs: { shape: x } }); + return t10.disposeIntermediateTensorInfo(g), b; } return g; } -var lE = { kernelName: Gn, backendName: "cpu", kernelFunc: PQ }; -function OQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { paddings: s, mode: a } = o; +var rR = { kernelName: as, backendName: "cpu", kernelFunc: uZ }; +function pZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { paddings: s, mode: a } = o; Q(n, "mirrorPad"); - let i = s.map((C, S) => C[0] + n.shape[S] + C[1]), p = s.map((C) => C[0]), u = s.map((C, S) => C[0] + n.shape[S]), c = a === "reflect" ? 0 : 1, l = e.data.get(n.dataId).values, m = n.shape.length, d = y.computeStrides(n.shape), f = y.sizeFromShape(i), h = i.length, g = y.computeStrides(i), x = y.getTypedArrayFromDType(n.dtype, f); - for (let C = 0; C < f; C++) { - let S = y.indexToLoc(C, h, g); - for (let _ = 0; _ < h; _++) - S[_] < p[_] ? S[_] = p[_] * 2 - S[_] - c : S[_] >= u[_] && (S[_] = (u[_] - 1) * 2 - S[_] + c); - S = S.map((_, E) => _ - p[E]); + let i = s.map((w, S) => w[0] + n.shape[S] + w[1]), p = s.map((w) => w[0]), u = s.map((w, S) => w[0] + n.shape[S]), l = a === "reflect" ? 0 : 1, c = t10.data.get(n.dataId).values, m = n.shape.length, d = y.computeStrides(n.shape), f = y.sizeFromShape(i), h = i.length, g = y.computeStrides(i), x = y.getTypedArrayFromDType(n.dtype, f); + for (let w = 0; w < f; w++) { + let S = y.indexToLoc(w, h, g); + for (let T = 0; T < h; T++) + S[T] < p[T] ? S[T] = p[T] * 2 - S[T] - l : S[T] >= u[T] && (S[T] = (u[T] - 1) * 2 - S[T] + l); + S = S.map((T, E) => T - p[E]); let k = y.locToIndex(S, m, d); - x[C] = l[k]; + x[w] = c[k]; } - return { dataId: e.write(x, i, n.dtype), shape: i, dtype: n.dtype }; + return { dataId: t10.write(x, i, n.dtype), shape: i, dtype: n.dtype }; } -var mE = { kernelName: Kn, backendName: "cpu", kernelFunc: OQ }; -var MQ = ze((r15, t8) => { - let e = r15 % t8; - return r15 < 0 && t8 < 0 || r15 >= 0 && t8 >= 0 ? e : (e + t8) % t8; +var oR = { kernelName: is, backendName: "cpu", kernelFunc: pZ }; +var lZ = Ve((r16, e) => { + let t10 = r16 % e; + return r16 < 0 && e < 0 || r16 >= 0 && e >= 0 ? t10 : (t10 + e) % e; }); -var LQ = Ye(qn, MQ); -var dE = { kernelName: qn, backendName: "cpu", kernelFunc: LQ }; -var hE = Lp(qw()); -function II(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { logits: n } = t8, { dim: s } = o, a = n.shape.length, i = s; +var cZ = Qe(us, lZ); +var nR = { kernelName: us, backendName: "cpu", kernelFunc: cZ }; +var aR = Kp(iS()); +function MI(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { logits: n } = e, { dim: s } = o, a = n.shape.length, i = s; if (i === -1 && (i = a - 1), i !== a - 1) throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${i}`); - let p = y.parseAxisParam([i], n.shape), u = SI({ inputs: { x: n }, backend: e, attrs: { reductionIndices: p, keepDims: false } }), c = w.expandShapeToKeepDim(u.shape, p), l = Ve({ inputs: { x: u }, backend: e, attrs: { shape: c } }), m = Bl({ inputs: { a: n, b: l }, backend: e }), d = KS({ inputs: { x: m }, backend: e }), f = di({ inputs: { x: d }, backend: e, attrs: { axis: p, keepDims: false } }), h = Ve({ inputs: { x: f }, backend: e, attrs: { shape: c } }), g = Vl({ inputs: { a: d, b: h }, backend: e }); - return e.disposeIntermediateTensorInfo(u), e.disposeIntermediateTensorInfo(l), e.disposeIntermediateTensorInfo(m), e.disposeIntermediateTensorInfo(d), e.disposeIntermediateTensorInfo(f), e.disposeIntermediateTensorInfo(h), g; + let p = y.parseAxisParam([i], n.shape), u = OI({ inputs: { x: n }, backend: t10, attrs: { reductionIndices: p, keepDims: false } }), l = C.expandShapeToKeepDim(u.shape, p), c = We({ inputs: { x: u }, backend: t10, attrs: { shape: l } }), m = jc({ inputs: { a: n, b: c }, backend: t10 }), d = aI({ inputs: { x: m }, backend: t10 }), f = Ii({ inputs: { x: d }, backend: t10, attrs: { axis: p, keepDims: false } }), h = We({ inputs: { x: f }, backend: t10, attrs: { shape: l } }), g = Yc({ inputs: { a: d, b: h }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(u), t10.disposeIntermediateTensorInfo(c), t10.disposeIntermediateTensorInfo(m), t10.disposeIntermediateTensorInfo(d), t10.disposeIntermediateTensorInfo(f), t10.disposeIntermediateTensorInfo(h), g; } -var fE = { kernelName: Is, backendName: "cpu", kernelFunc: II }; -function BQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { logits: n } = t8, { numSamples: s, seed: a, normalized: i } = o; +var sR = { kernelName: Fs, backendName: "cpu", kernelFunc: MI }; +function mZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { logits: n } = e, { numSamples: s, seed: a, normalized: i } = o; Q(n, "multinomial"); - let p = i ? n : II({ inputs: { logits: n }, backend: e, attrs: { dim: -1 } }), u = p.shape[0], c = p.shape[1], l = e.data.get(p.dataId).values, m = [u, s], d = y.makeZerosTypedArray(y.sizeFromShape(m), "int32"); + let p = i ? n : MI({ inputs: { logits: n }, backend: t10, attrs: { dim: -1 } }), u = p.shape[0], l = p.shape[1], c = t10.data.get(p.dataId).values, m = [u, s], d = y.makeZerosTypedArray(y.sizeFromShape(m), "int32"); for (let f = 0; f < u; ++f) { - let h = f * c, g = new Float32Array(c - 1); - g[0] = l[h]; - for (let C = 1; C < g.length; ++C) - g[C] = g[C - 1] + l[h + C]; - let x = hE.alea(a.toString()), b = f * s; - for (let C = 0; C < s; ++C) { + let h = f * l, g = new Float32Array(l - 1); + g[0] = c[h]; + for (let w = 1; w < g.length; ++w) + g[w] = g[w - 1] + c[h + w]; + let x = aR.alea(a.toString()), b = f * s; + for (let w = 0; w < s; ++w) { let S = x(); - d[b + C] = g.length; + d[b + w] = g.length; for (let k = 0; k < g.length; k++) if (S < g[k]) { - d[b + C] = k; + d[b + w] = k; break; } } } - return i || e.disposeIntermediateTensorInfo(p), e.makeTensorInfo(m, "int32", d); + return i || t10.disposeIntermediateTensorInfo(p), t10.makeTensorInfo(m, "int32", d); } -var gE = { kernelName: jn, backendName: "cpu", kernelFunc: BQ }; -var zQ = Vt.nonMaxSuppressionV3Impl; -function VQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p } = o; +var iR = { kernelName: ps, backendName: "cpu", kernelFunc: mZ }; +var dZ = Ut.nonMaxSuppressionV3Impl; +function fZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p } = o; Q(n, "NonMaxSuppression"); - let u = e.data.get(n.dataId).values, c = e.data.get(s.dataId).values, { selectedIndices: l } = zQ(u, c, a, i, p); - return e.makeTensorInfo([l.length], "int32", new Int32Array(l)); + let u = t10.data.get(n.dataId).values, l = t10.data.get(s.dataId).values, { selectedIndices: c } = dZ(u, l, a, i, p); + return t10.makeTensorInfo([c.length], "int32", new Int32Array(c)); } -var xE = { kernelName: Qn, backendName: "cpu", kernelFunc: VQ }; -var WQ = Vt.nonMaxSuppressionV4Impl; -function UQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, padToMaxOutputSize: u } = o; +var uR = { kernelName: cs, backendName: "cpu", kernelFunc: fZ }; +var hZ = Ut.nonMaxSuppressionV4Impl; +function gZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, padToMaxOutputSize: u } = o; Q(n, "NonMaxSuppressionPadded"); - let c = e.data.get(n.dataId).values, l = e.data.get(s.dataId).values, { selectedIndices: m, validOutputs: d } = WQ(c, l, a, i, p, u); - return [e.makeTensorInfo([m.length], "int32", new Int32Array(m)), e.makeTensorInfo([], "int32", new Int32Array([d]))]; + let l = t10.data.get(n.dataId).values, c = t10.data.get(s.dataId).values, { selectedIndices: m, validOutputs: d } = hZ(l, c, a, i, p, u); + return [t10.makeTensorInfo([m.length], "int32", new Int32Array(m)), t10.makeTensorInfo([], "int32", new Int32Array([d]))]; } -var yE = { kernelName: Qa, backendName: "cpu", kernelFunc: UQ }; -var GQ = Vt.nonMaxSuppressionV5Impl; -function HQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, softNmsSigma: u } = o; +var pR = { kernelName: ni, backendName: "cpu", kernelFunc: gZ }; +var xZ = Ut.nonMaxSuppressionV5Impl; +function yZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, softNmsSigma: u } = o; Q(n, "NonMaxSuppressionWithScore"); - let c = e.data.get(n.dataId).values, l = e.data.get(s.dataId).values, m = a, d = i, f = p, h = u, { selectedIndices: g, selectedScores: x } = GQ(c, l, m, d, f, h); - return [e.makeTensorInfo([g.length], "int32", new Int32Array(g)), e.makeTensorInfo([x.length], "float32", new Float32Array(x))]; + let l = t10.data.get(n.dataId).values, c = t10.data.get(s.dataId).values, m = a, d = i, f = p, h = u, { selectedIndices: g, selectedScores: x } = xZ(l, c, m, d, f, h); + return [t10.makeTensorInfo([g.length], "int32", new Int32Array(g)), t10.makeTensorInfo([x.length], "float32", new Float32Array(x))]; } -var bE = { kernelName: Zn, backendName: "cpu", kernelFunc: HQ }; -function KQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { indices: n } = t8, { dtype: s, depth: a, onValue: i, offValue: p } = o; +var lR = { kernelName: ms, backendName: "cpu", kernelFunc: yZ }; +function bZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { indices: n } = e, { dtype: s, depth: a, onValue: i, offValue: p } = o; Q(n, "oneHot"); - let u = y.sizeFromShape(n.shape), c = new Float32Array(u * a); - c.fill(p); - let l = e.data.get(n.dataId).values; + let u = y.sizeFromShape(n.shape), l = new Float32Array(u * a); + l.fill(p); + let c = t10.data.get(n.dataId).values; for (let m = 0; m < u; ++m) - l[m] >= 0 && l[m] < a && (c[m * a + l[m]] = i); - return e.makeTensorInfo([...n.shape, a], s, c); + c[m] >= 0 && c[m] < a && (l[m * a + c[m]] = i); + return t10.makeTensorInfo([...n.shape, a], s, l); } -var CE = { kernelName: Jn, backendName: "cpu", kernelFunc: KQ }; -function Gl(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; +var cR = { kernelName: ds, backendName: "cpu", kernelFunc: bZ }; +function Jc(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; if (o.dtype === "string") throw new Error("zerosLike is not supported for string tensors"); if (o.dtype === "complex64") { - let n = Eo({ inputs: { input: o }, backend: e }), s = Gl({ inputs: { x: n }, backend: e }), a = Oa({ inputs: { input: o }, backend: e }), i = Gl({ inputs: { x: a }, backend: e }), p = Ht({ inputs: { real: s, imag: i }, backend: e }); - return e.disposeIntermediateTensorInfo(n), e.disposeIntermediateTensorInfo(s), e.disposeIntermediateTensorInfo(a), e.disposeIntermediateTensorInfo(i), p; + let n = tn({ inputs: { input: o }, backend: t10 }), s = Jc({ inputs: { x: n }, backend: t10 }), a = Ua({ inputs: { input: o }, backend: t10 }), i = Jc({ inputs: { x: a }, backend: t10 }), p = qt({ inputs: { real: s, imag: i }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(n), t10.disposeIntermediateTensorInfo(s), t10.disposeIntermediateTensorInfo(a), t10.disposeIntermediateTensorInfo(i), p; } else - return Ul({ backend: e, attrs: { shape: o.shape, value: 0, dtype: o.dtype } }); + return Zc({ backend: t10, attrs: { shape: o.shape, value: 0, dtype: o.dtype } }); } -var wE = { kernelName: Sa, backendName: "cpu", kernelFunc: Gl }; -function SE(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; +var mR = { kernelName: _a, backendName: "cpu", kernelFunc: Jc }; +function dR(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; if (o.dtype === "string") throw new Error("onesLike is not supported for string tensors"); if (o.dtype === "complex64") { - let n = Eo({ inputs: { input: o }, backend: e }), s = SE({ inputs: { x: n }, backend: e }), a = Oa({ inputs: { input: o }, backend: e }), i = Gl({ inputs: { x: a }, backend: e }), p = Ht({ inputs: { real: s, imag: i }, backend: e }); - return e.disposeIntermediateTensorInfo(n), e.disposeIntermediateTensorInfo(s), e.disposeIntermediateTensorInfo(a), e.disposeIntermediateTensorInfo(i), p; + let n = tn({ inputs: { input: o }, backend: t10 }), s = dR({ inputs: { x: n }, backend: t10 }), a = Ua({ inputs: { input: o }, backend: t10 }), i = Jc({ inputs: { x: a }, backend: t10 }), p = qt({ inputs: { real: s, imag: i }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(n), t10.disposeIntermediateTensorInfo(s), t10.disposeIntermediateTensorInfo(a), t10.disposeIntermediateTensorInfo(i), p; } else - return Ul({ backend: e, attrs: { shape: o.shape, value: 1, dtype: o.dtype } }); -} -var IE = { kernelName: ca, backendName: "cpu", kernelFunc: SE }; -function vI(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { axis: n } = o; - if (t8.length === 1) - return Ic({ inputs: { input: t8[0] }, backend: e, attrs: { dim: n } }); - let s = t8[0].shape, a = t8[0].dtype; - t8.forEach((c) => { - y.assertShapesMatch(s, c.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === c.dtype, () => "All tensors passed to stack must have matching dtypes"); + return Zc({ backend: t10, attrs: { shape: o.shape, value: 1, dtype: o.dtype } }); +} +var fR = { kernelName: xa, backendName: "cpu", kernelFunc: dR }; +function LI(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { axis: n } = o; + if (e.length === 1) + return $l({ inputs: { input: e[0] }, backend: t10, attrs: { dim: n } }); + let s = e[0].shape, a = e[0].dtype; + e.forEach((l) => { + y.assertShapesMatch(s, l.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === l.dtype, () => "All tensors passed to stack must have matching dtypes"); }); - let i = [], p = t8.map((c) => { - let l = Ic({ inputs: { input: c }, backend: e, attrs: { dim: n } }); - return i.push(l), l; - }), u = du({ inputs: p, backend: e, attrs: { axis: n } }); - return i.forEach((c) => e.disposeIntermediateTensorInfo(c)), u; -} -var vE = { kernelName: la, backendName: "cpu", kernelFunc: vI }; -function qQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { paddings: s, constantValue: a } = o; + let i = [], p = e.map((l) => { + let c = $l({ inputs: { input: l }, backend: t10, attrs: { dim: n } }); + return i.push(c), c; + }), u = Su({ inputs: p, backend: t10, attrs: { axis: n } }); + return i.forEach((l) => t10.disposeIntermediateTensorInfo(l)), u; +} +var hR = { kernelName: ya, backendName: "cpu", kernelFunc: LI }; +function CZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { paddings: s, constantValue: a } = o; Q(n, "pad"); - let i = s.map((b, C) => b[0] + n.shape[C] + b[1]), p = s.map((b) => b[0]), u = e.data.get(n.dataId).values, c = y.sizeFromShape(n.shape), l = n.shape.length, m = y.computeStrides(n.shape), d = y.sizeFromShape(i), f = i.length, h = y.computeStrides(i), g = y.getTypedArrayFromDType(n.dtype, d); + let i = s.map((b, w) => b[0] + n.shape[w] + b[1]), p = s.map((b) => b[0]), u = t10.data.get(n.dataId).values, l = y.sizeFromShape(n.shape), c = n.shape.length, m = y.computeStrides(n.shape), d = y.sizeFromShape(i), f = i.length, h = y.computeStrides(i), g = y.getTypedArrayFromDType(n.dtype, d); a !== 0 && g.fill(a); - for (let b = 0; b < c; b++) { - let S = y.indexToLoc(b, l, m).map((_, E) => _ + p[E]), k = y.locToIndex(S, f, h); + for (let b = 0; b < l; b++) { + let S = y.indexToLoc(b, c, m).map((T, E) => T + p[E]), k = y.locToIndex(S, f, h); g[k] = u[b]; } - return { dataId: e.write(g, i, n.dtype), shape: i, dtype: n.dtype }; + return { dataId: t10.write(g, i, n.dtype), shape: i, dtype: n.dtype }; } -var Vf = { kernelName: es, backendName: "cpu", kernelFunc: qQ }; -var jQ = ze((r15, t8) => Math.pow(r15, t8)); -var XQ = Ye(ts, jQ); -var kE = { kernelName: ts, backendName: "cpu", kernelFunc: XQ }; -function YQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { paramsNestedSplits: n, paramsDenseValues: s, indices: a } = t8, { outputRaggedRank: i } = o, p = n.map((x) => e.data.get(x.dataId).values), u = n.map((x) => x.shape), c = e.data.get(s.dataId).values, l = e.data.get(a.dataId).values, [m, d, f] = Ef(p, u, c, s.shape, s.dtype, l, a.shape, i), h = m.map((x) => e.makeTensorInfo([x.length], "int32", x)), g = e.makeTensorInfo(f, s.dtype, d); +var Jf = { kernelName: fs, backendName: "cpu", kernelFunc: CZ }; +var wZ = Ve((r16, e) => Math.pow(r16, e)); +var SZ = Qe(hs, wZ); +var gR = { kernelName: hs, backendName: "cpu", kernelFunc: SZ }; +function IZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { paramsNestedSplits: n, paramsDenseValues: s, indices: a } = e, { outputRaggedRank: i } = o, p = n.map((x) => t10.data.get(x.dataId).values), u = n.map((x) => x.shape), l = t10.data.get(s.dataId).values, c = t10.data.get(a.dataId).values, [m, d, f] = Vf(p, u, l, s.shape, s.dtype, c, a.shape, i), h = m.map((x) => t10.makeTensorInfo([x.length], "int32", x)), g = t10.makeTensorInfo(f, s.dtype, d); return h.concat([g]); } -var NE = { kernelName: Up, backendName: "cpu", kernelFunc: YQ }; -function QQ(r15) { - let { inputs: t8, backend: e } = r15, { starts: o, limits: n, deltas: s } = t8, a = e.data.get(o.dataId).values, i = e.data.get(n.dataId).values, p = e.data.get(s.dataId).values, [u, c] = Rf(a, o.shape, o.dtype, i, n.shape, p, s.shape), l = e.makeTensorInfo([u.length], "int32", u), m = e.makeTensorInfo([c.length], o.dtype, c); - return [l, m]; -} -var TE = { kernelName: Gp, backendName: "cpu", kernelFunc: QQ }; -function ZQ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { shape: n, values: s, defaultValue: a, rowPartitionTensors: i } = t8, { rowPartitionTypes: p } = o, u = e.data.get(n.dataId).values, c = e.data.get(s.dataId).values, l = e.data.get(a.dataId).values, m = i.map((g) => e.data.get(g.dataId).values), d = i.map((g) => g.shape), [f, h] = Df(u, n.shape, c, s.shape, s.dtype, l, a.shape, m, d, p); - return e.makeTensorInfo(f, s.dtype, h); -} -var _E = { kernelName: Hp, backendName: "cpu", kernelFunc: ZQ }; -function JQ(r15) { - let { backend: t8, attrs: e } = r15, { start: o, stop: n, dtype: s, step: a } = e, i = ap(o, n, a, s); - return t8.makeTensorInfo([i.length], s, i); -} -var $E = { kernelName: ma, backendName: "cpu", kernelFunc: JQ }; -var e7 = Ie(ns, (r15) => 1 / r15); -var EE = { kernelName: ns, backendName: "cpu", kernelFunc: e7 }; -function t7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n } = t8, { alignCorners: s, halfPixelCenters: a, size: i } = o; +var xR = { kernelName: Qp, backendName: "cpu", kernelFunc: IZ }; +function vZ(r16) { + let { inputs: e, backend: t10 } = r16, { starts: o, limits: n, deltas: s } = e, a = t10.data.get(o.dataId).values, i = t10.data.get(n.dataId).values, p = t10.data.get(s.dataId).values, [u, l] = Wf(a, o.shape, o.dtype, i, n.shape, p, s.shape), c = t10.makeTensorInfo([u.length], "int32", u), m = t10.makeTensorInfo([l.length], o.dtype, l); + return [c, m]; +} +var yR = { kernelName: Zp, backendName: "cpu", kernelFunc: vZ }; +function kZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { shape: n, values: s, defaultValue: a, rowPartitionTensors: i } = e, { rowPartitionTypes: p } = o, u = t10.data.get(n.dataId).values, l = t10.data.get(s.dataId).values, c = t10.data.get(a.dataId).values, m = i.map((g) => t10.data.get(g.dataId).values), d = i.map((g) => g.shape), [f, h] = Uf(u, n.shape, l, s.shape, s.dtype, c, a.shape, m, d, p); + return t10.makeTensorInfo(f, s.dtype, h); +} +var bR = { kernelName: Jp, backendName: "cpu", kernelFunc: kZ }; +function NZ(r16) { + let { backend: e, attrs: t10 } = r16, { start: o, stop: n, dtype: s, step: a } = t10, i = fp(o, n, a, s); + return e.makeTensorInfo([i.length], s, i); +} +var CR = { kernelName: ba, backendName: "cpu", kernelFunc: NZ }; +var TZ = Ie(xs, (r16) => 1 / r16); +var wR = { kernelName: xs, backendName: "cpu", kernelFunc: TZ }; +function _Z(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n } = e, { alignCorners: s, halfPixelCenters: a, size: i } = o; Q(n, "resizeBilinear"); - let p = y.computeStrides(n.shape), [u, c] = i, [l, m, d, f] = n.shape, h = e.data.get(n.dataId).values, g = new Float32Array(y.sizeFromShape([l, u, c, f])), x = [s && u > 1 ? m - 1 : m, s && c > 1 ? d - 1 : d], b = [s && u > 1 ? u - 1 : u, s && c > 1 ? c - 1 : c], C = 0, S = x[0] / b[0], k = x[1] / b[1]; - for (let _ = 0; _ < l; _++) + let p = y.computeStrides(n.shape), [u, l] = i, [c, m, d, f] = n.shape, h = t10.data.get(n.dataId).values, g = new Float32Array(y.sizeFromShape([c, u, l, f])), x = [s && u > 1 ? m - 1 : m, s && l > 1 ? d - 1 : d], b = [s && u > 1 ? u - 1 : u, s && l > 1 ? l - 1 : l], w = 0, S = x[0] / b[0], k = x[1] / b[1]; + for (let T = 0; T < c; T++) for (let E = 0; E < u; E++) { let R; a ? R = S * (E + 0.5) - 0.5 : R = S * E; - let D = Math.max(0, Math.floor(R)), P = R - D, O = Math.min(m - 1, Math.ceil(R)), M = _ * p[0] + D * p[1], L = _ * p[0] + O * p[1]; - for (let B = 0; B < c; B++) { + let D = Math.max(0, Math.floor(R)), F = R - D, O = Math.min(m - 1, Math.ceil(R)), M = T * p[0] + D * p[1], L = T * p[0] + O * p[1]; + for (let B = 0; B < l; B++) { let z; a ? z = k * (B + 0.5) - 0.5 : z = k * B; let U = Math.max(0, Math.floor(z)), j = z - U, q = Math.min(d - 1, Math.ceil(z)), Y = M + U * p[2], J = L + U * p[2], re = M + q * p[2], ne = L + q * p[2]; for (let ee = 0; ee < f; ee++) { - let oe = h[Y + ee], ie = h[J + ee], le = h[re + ee], be = h[ne + ee], _e = oe + (le - oe) * j, ve = ie + (be - ie) * j, Fe = _e + (ve - _e) * P; - g[C++] = Fe; + let oe = h[Y + ee], ue = h[J + ee], me = h[re + ee], be = h[ne + ee], _e = oe + (me - oe) * j, ve = ue + (be - ue) * j, Fe = _e + (ve - _e) * F; + g[w++] = Fe; } } } - return e.makeTensorInfo([l, u, c, f], "float32", g); + return t10.makeTensorInfo([c, u, l, f], "float32", g); } -var RE = { kernelName: is, backendName: "cpu", kernelFunc: t7 }; -function r72(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o; +var SR = { kernelName: Cs, backendName: "cpu", kernelFunc: _Z }; +function EZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o; Q([s, n], "resizeBilinearGrad"); - let i = y.computeStrides(n.shape), [p, u, c, l] = n.shape, [, m, d] = s.shape, f = new Float32Array(p * u * c * l), h = [a && m > 1 ? u - 1 : u, a && d > 1 ? c - 1 : c], g = [a && m > 1 ? m - 1 : m, a && d > 1 ? d - 1 : d], x = h[0] / g[0], b = h[1] / g[1], C = e.data.get(s.dataId).values, S = 0; + let i = y.computeStrides(n.shape), [p, u, l, c] = n.shape, [, m, d] = s.shape, f = new Float32Array(p * u * l * c), h = [a && m > 1 ? u - 1 : u, a && d > 1 ? l - 1 : l], g = [a && m > 1 ? m - 1 : m, a && d > 1 ? d - 1 : d], x = h[0] / g[0], b = h[1] / g[1], w = t10.data.get(s.dataId).values, S = 0; for (let k = 0; k < p; k++) { - let _ = k * i[0]; + let T = k * i[0]; for (let E = 0; E < m; E++) { - let R = E * x, D = Math.floor(R), P = Math.min(Math.ceil(R), u - 1), O = _ + D * i[1], M = _ + P * i[1], L = R - D, B = 1 - L; + let R = E * x, D = Math.floor(R), F = Math.min(Math.ceil(R), u - 1), O = T + D * i[1], M = T + F * i[1], L = R - D, B = 1 - L; for (let z = 0; z < d; z++) { - let U = z * b, j = Math.floor(U), q = Math.min(Math.ceil(U), c - 1), Y = U - j, J = 1 - Y, re = O + j * i[2], ne = O + q * i[2], ee = M + j * i[2], oe = M + q * i[2], ie = B * J, le = B * Y, be = L * J, _e = L * Y; - for (let ve = 0; ve < l; ve++) { - let Fe = C[S++]; - f[re + ve] += Fe * ie, f[ne + ve] += Fe * le, f[ee + ve] += Fe * be, f[oe + ve] += Fe * _e; + let U = z * b, j = Math.floor(U), q = Math.min(Math.ceil(U), l - 1), Y = U - j, J = 1 - Y, re = O + j * i[2], ne = O + q * i[2], ee = M + j * i[2], oe = M + q * i[2], ue = B * J, me = B * Y, be = L * J, _e = L * Y; + for (let ve = 0; ve < c; ve++) { + let Fe = w[S++]; + f[re + ve] += Fe * ue, f[ne + ve] += Fe * me, f[ee + ve] += Fe * be, f[oe + ve] += Fe * _e; } } } } - return e.makeTensorInfo([p, c, u, l], "float32", f); + return t10.makeTensorInfo([p, l, u, c], "float32", f); } -var DE = { kernelName: Ja, backendName: "cpu", kernelFunc: r72 }; -function o7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n } = t8, { alignCorners: s, halfPixelCenters: a, size: i } = o; +var IR = { kernelName: ii, backendName: "cpu", kernelFunc: EZ }; +function $Z(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n } = e, { alignCorners: s, halfPixelCenters: a, size: i } = o; Q(n, "resizeNearestNeighbor"); - let p = y.computeStrides(n.shape), [u, c] = i, [l, m, d, f] = n.shape, h = e.data.get(n.dataId).values, g = new Float32Array(l * u * c * f), x = [s && u > 1 ? m - 1 : m, s && c > 1 ? d - 1 : d], b = [s && u > 1 ? u - 1 : u, s && c > 1 ? c - 1 : c], C = x[0] / b[0], S = x[1] / b[1], k = 0; - for (let _ = 0; _ < l; _++) { - let E = _ * p[0]; + let p = y.computeStrides(n.shape), [u, l] = i, [c, m, d, f] = n.shape, h = t10.data.get(n.dataId).values, g = new Float32Array(c * u * l * f), x = [s && u > 1 ? m - 1 : m, s && l > 1 ? d - 1 : d], b = [s && u > 1 ? u - 1 : u, s && l > 1 ? l - 1 : l], w = x[0] / b[0], S = x[1] / b[1], k = 0; + for (let T = 0; T < c; T++) { + let E = T * p[0]; for (let R = 0; R < u; R++) { - let D = a ? C * (R + 0.5) : C * R, P = Math.min(m - 1, s ? Math.round(D) : Math.floor(D)); - a && (P = Math.max(0, P)); - let O = E + P * p[1]; - for (let M = 0; M < c; M++) { + let D = a ? w * (R + 0.5) : w * R, F = Math.min(m - 1, s ? Math.round(D) : Math.floor(D)); + a && (F = Math.max(0, F)); + let O = E + F * p[1]; + for (let M = 0; M < l; M++) { let L = a ? S * (M + 0.5) : S * M, B = Math.min(d - 1, s ? Math.round(L) : Math.floor(L)); a && (B = Math.max(0, B)); let z = O + B * p[2]; @@ -14856,32 +14956,32 @@ function o7(r15) { } } } - return e.makeTensorInfo([l, u, c, f], n.dtype, g); + return t10.makeTensorInfo([c, u, l, f], n.dtype, g); } -var AE = { kernelName: as, backendName: "cpu", kernelFunc: o7 }; -function n7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o; +var vR = { kernelName: bs, backendName: "cpu", kernelFunc: $Z }; +function RZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o; Q([s, n], "resizeNearestNeighborGrad"); - let i = y.computeStrides(n.shape), p = y.computeStrides(s.shape), [u, c, l, m] = n.shape, [, d, f] = s.shape, h = new Float32Array(u * c * l * m), g = e.data.get(s.dataId).values, x = [a && d > 1 ? c - 1 : c, a && f > 1 ? l - 1 : l], b = [a && d > 1 ? d - 1 : d, a && f > 1 ? f - 1 : f], C = x[0] / b[0], S = x[1] / b[1], k = 1 / C, _ = 1 / S, E = Math.ceil(k) * 2 + 2, R = Math.ceil(_) * 2 + 2; + let i = y.computeStrides(n.shape), p = y.computeStrides(s.shape), [u, l, c, m] = n.shape, [, d, f] = s.shape, h = new Float32Array(u * l * c * m), g = t10.data.get(s.dataId).values, x = [a && d > 1 ? l - 1 : l, a && f > 1 ? c - 1 : c], b = [a && d > 1 ? d - 1 : d, a && f > 1 ? f - 1 : f], w = x[0] / b[0], S = x[1] / b[1], k = 1 / w, T = 1 / S, E = Math.ceil(k) * 2 + 2, R = Math.ceil(T) * 2 + 2; for (let D = 0; D < u; D++) { - let P = D * i[0]; - for (let O = 0; O < c; O++) { - let M = P + O * i[1], L = Math.floor(O * k), B = Math.floor(L - E / 2); - for (let z = 0; z < l; z++) { - let U = M + z * i[2], j = Math.floor(z * _), q = Math.floor(j - R / 2); + let F = D * i[0]; + for (let O = 0; O < l; O++) { + let M = F + O * i[1], L = Math.floor(O * k), B = Math.floor(L - E / 2); + for (let z = 0; z < c; z++) { + let U = M + z * i[2], j = Math.floor(z * T), q = Math.floor(j - R / 2); for (let Y = 0; Y < m; Y++) { let J = 0; for (let re = 0; re < E; re++) { let ne = re + B; if (ne < 0 || ne >= d) continue; - let ee = P + ne * p[1], oe = ne * C, ie = Math.min(c - 1, a ? Math.round(oe) : Math.floor(oe)); - if (O === ie) - for (let le = 0; le < R; le++) { - let be = le + q; + let ee = F + ne * p[1], oe = ne * w, ue = Math.min(l - 1, a ? Math.round(oe) : Math.floor(oe)); + if (O === ue) + for (let me = 0; me < R; me++) { + let be = me + q; if (be < 0 || be >= f) continue; - let _e = ee + be * p[2], ve = be * S, Fe = Math.min(l - 1, a ? Math.round(ve) : Math.floor(ve)); + let _e = ee + be * p[2], ve = be * S, Fe = Math.min(c - 1, a ? Math.round(ve) : Math.floor(ve)); z === Fe && (J += g[_e + Y]); } } @@ -14890,40 +14990,40 @@ function n7(r15) { } } } - return e.makeTensorInfo(n.shape, n.dtype, h); + return t10.makeTensorInfo(n.shape, n.dtype, h); } -var FE = { kernelName: Za, backendName: "cpu", kernelFunc: n7 }; -function s7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { dims: s } = o; +var kR = { kernelName: ai, backendName: "cpu", kernelFunc: RZ }; +function DZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dims: s } = o; Q(n, "reverse"); let a = n.shape.length, i = y.parseAxisParam(s, n.shape); if (a === 0) - return lr({ inputs: { x: n }, backend: e }); - let p = new tt(n.shape, n.dtype), u = e.bufferSync(n); - for (let c = 0; c < p.size; c++) { - let l = p.indexToLoc(c), m = l.slice(); - i.forEach((d) => m[d] = n.shape[d] - 1 - m[d]), p.set(u.get(...m), ...l); + return fr({ inputs: { x: n }, backend: t10 }); + let p = new Ge(n.shape, n.dtype), u = t10.bufferSync(n); + for (let l = 0; l < p.size; l++) { + let c = p.indexToLoc(l), m = c.slice(); + i.forEach((d) => m[d] = n.shape[d] - 1 - m[d]), p.set(u.get(...m), ...c); } - return e.makeTensorInfo(p.shape, p.dtype, p.values); + return t10.makeTensorInfo(p.shape, p.dtype, p.values); } -var PE = { kernelName: ps, backendName: "cpu", kernelFunc: s7 }; -var OE = { kernelName: Ds, backendName: "cpu", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { image: o } = r15, { radians: n, fillValue: s, center: a } = t8, i = e, p = y.getTypedArrayFromDType(o.dtype, y.sizeFromShape(o.shape)), [u, c, l, m] = o.shape, [d, f] = w.getImageCenter(a, c, l), h = 255, g = Math.sin(n), x = Math.cos(n), b = i.data.get(o.dataId).values; +var NR = { kernelName: Ss, backendName: "cpu", kernelFunc: DZ }; +var TR = { kernelName: Vs, backendName: "cpu", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { image: o } = r16, { radians: n, fillValue: s, center: a } = e, i = t10, p = y.getTypedArrayFromDType(o.dtype, y.sizeFromShape(o.shape)), [u, l, c, m] = o.shape, [d, f] = C.getImageCenter(a, l, c), h = 255, g = Math.sin(n), x = Math.cos(n), b = i.data.get(o.dataId).values; for (let S = 0; S < u; S++) { - let k = S * l * c * m; - for (let _ = 0; _ < c; _++) { - let E = _ * (l * m); - for (let R = 0; R < l; R++) { + let k = S * c * l * m; + for (let T = 0; T < l; T++) { + let E = T * (c * m); + for (let R = 0; R < c; R++) { let D = R * m; - for (let P = 0; P < m; P++) { - let O = [u, _, R, P], M = O[2], L = O[1], B = (M - d) * x - (L - f) * g, z = (M - d) * g + (L - f) * x; + for (let F = 0; F < m; F++) { + let O = [u, T, R, F], M = O[2], L = O[1], B = (M - d) * x - (L - f) * g, z = (M - d) * g + (L - f) * x; B = Math.round(B + d), z = Math.round(z + f); let U = s; - if (typeof s != "number" && (P === 3 ? U = h : U = s[P]), B >= 0 && B < l && z >= 0 && z < c) { - let q = z * (l * m), Y = B * m, J = k + q + Y + P; + if (typeof s != "number" && (F === 3 ? U = h : U = s[F]), B >= 0 && B < c && z >= 0 && z < l) { + let q = z * (c * m), Y = B * m, J = k + q + Y + F; U = b[J]; } - let j = k + E + D + P; + let j = k + E + D + F; p[j] = U; } } @@ -14931,82 +15031,82 @@ var OE = { kernelName: Ds, backendName: "cpu", kernelFunc: ({ inputs: r15, attrs } return { dataId: i.write(p, o.shape, o.dtype), shape: o.shape, dtype: o.dtype }; } }; -var a7 = Ie(cs, (r15) => { - let t8 = Math.floor(r15); - return r15 - t8 < 0.5 ? Math.floor(r15) : r15 - t8 > 0.5 ? Math.ceil(r15) : t8 % 2 === 0 ? t8 : t8 + 1; +var AZ = Ie(Is, (r16) => { + let e = Math.floor(r16); + return r16 - e < 0.5 ? Math.floor(r16) : r16 - e > 0.5 ? Math.ceil(r16) : e % 2 === 0 ? e : e + 1; }); -var ME = { kernelName: cs, backendName: "cpu", kernelFunc: a7 }; -function i7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { indices: n, updates: s } = t8, { shape: a } = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: c, outputSize: l } = w.calculateShapes(s, n, a), m = true, d = e.bufferSync(n), f = e.bufferSync(s), h = zs(d, f, a, l, u, p, i, c, 0, m); - return e.makeTensorInfo(a, h.dtype, h.values); -} -var LE = { kernelName: ms, backendName: "cpu", kernelFunc: i7 }; -function u7(r15, t8) { - let e = 0, o = r15.length, n = 0; - for (; e < o; ) - n = Math.floor((e + o) / 2), r15[n] < t8 ? e = n + 1 : o = n; +var _R = { kernelName: Is, backendName: "cpu", kernelFunc: AZ }; +function FZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { indices: n, updates: s } = e, { shape: a } = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: l, outputSize: c } = C.calculateShapes(s, n, a), m = true, d = t10.bufferSync(n), f = t10.bufferSync(s), h = Xs(d, f, a, c, u, p, i, l, 0, m); + return t10.makeTensorInfo(a, h.dtype, h.values); +} +var ER = { kernelName: vs, backendName: "cpu", kernelFunc: FZ }; +function PZ(r16, e) { + let t10 = 0, o = r16.length, n = 0; + for (; t10 < o; ) + n = Math.floor((t10 + o) / 2), r16[n] < e ? t10 = n + 1 : o = n; return o; } -function p7(r15, t8) { - let e = 0, o = r15.length, n = 0; - for (; e < o; ) - n = Math.floor((e + o) / 2), r15[n] <= t8 ? e = n + 1 : o = n; +function OZ(r16, e) { + let t10 = 0, o = r16.length, n = 0; + for (; t10 < o; ) + n = Math.floor((t10 + o) / 2), r16[n] <= e ? t10 = n + 1 : o = n; return o; } -function BE(r15, t8, e, o, n, s) { - let a = y.getArrayFromDType("int32", e * n); - for (let i = 0; i < e; ++i) { - let p = r15.slice(i * o, (i + 1) * o), u = i * n; - for (let c = 0; c < n; ++c) - a[u + c] = s === "left" ? u7(p, t8[c + u]) : p7(p, t8[c + u]); +function $R(r16, e, t10, o, n, s) { + let a = y.getArrayFromDType("int32", t10 * n); + for (let i = 0; i < t10; ++i) { + let p = r16.slice(i * o, (i + 1) * o), u = i * n; + for (let l = 0; l < n; ++l) + a[u + l] = s === "left" ? PZ(p, e[l + u]) : OZ(p, e[l + u]); } return a; } -function c7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { sortedSequence: n, values: s } = t8, { side: a } = o, i = e.data.get(n.dataId).values, p = e.data.get(s.dataId).values, u = BE(i, p, n.shape[0], n.shape[1], s.shape[1], a); - return e.makeTensorInfo(s.shape, "int32", u); +function MZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { sortedSequence: n, values: s } = e, { side: a } = o, i = t10.data.get(n.dataId).values, p = t10.data.get(s.dataId).values, u = $R(i, p, n.shape[0], n.shape[1], s.shape[1], a); + return t10.makeTensorInfo(s.shape, "int32", u); } -var zE = { kernelName: fs, backendName: "cpu", kernelFunc: c7 }; -function l7(r15) { - let { inputs: t8, backend: e } = r15, { condition: o, t: n, e: s } = t8; +var RR = { kernelName: Ns, backendName: "cpu", kernelFunc: MZ }; +function LZ(r16) { + let { inputs: e, backend: t10 } = r16, { condition: o, t: n, e: s } = e; Q([o, n, s], "select"); - let a = o.shape.length, i = e.data.get(o.dataId).values, p = e.data.get(n.dataId).values, u = e.data.get(s.dataId).values, c = dt(n.dtype, s.dtype), l = y.makeZerosTypedArray(y.sizeFromShape(n.shape), c), m = 0, d = a === 0 || a > 1 || n.shape.length === 1 ? 1 : y.sizeFromShape(n.shape.slice(1)); + let a = o.shape.length, i = t10.data.get(o.dataId).values, p = t10.data.get(n.dataId).values, u = t10.data.get(s.dataId).values, l = pt(n.dtype, s.dtype), c = y.makeZerosTypedArray(y.sizeFromShape(n.shape), l), m = 0, d = a === 0 || a > 1 || n.shape.length === 1 ? 1 : y.sizeFromShape(n.shape.slice(1)); for (let f = 0; f < i.length; f++) for (let h = 0; h < d; h++) - i[f] === 1 ? l[m++] = p[f] : l[m++] = u[f]; - return e.makeTensorInfo(n.shape, c, l); -} -var VE = { kernelName: fa, backendName: "cpu", kernelFunc: l7 }; -var m7 = w.SELU_SCALEALPHA; -var d7 = w.SELU_SCALE; -var f7 = Ie(hs, (r15) => r15 >= 0 ? d7 * r15 : m7 * (Math.exp(r15) - 1)); -var WE = { kernelName: hs, backendName: "cpu", kernelFunc: f7 }; -var h7 = Ie(ys, (r15) => r15 < 0 ? -1 : r15 > 0 ? 1 : 0); -var UE = { kernelName: ys, backendName: "cpu", kernelFunc: h7 }; -var g7 = Ie(gs, (r15) => Math.sin(r15)); -var GE = { kernelName: gs, backendName: "cpu", kernelFunc: g7 }; -var x7 = Ie(xs, (r15) => Math.sinh(r15)); -var HE = { kernelName: xs, backendName: "cpu", kernelFunc: x7 }; -var y7 = 11920928955078125e-23; -var KE = Math.log(y7) + 2; -var b7 = Ie(Cs, (r15) => { - let t8 = r15 > -KE, e = r15 < KE, o = Math.exp(r15), n; - return e ? n = o : t8 ? n = r15 : n = Math.log(1 + o), n; + i[f] === 1 ? c[m++] = p[f] : c[m++] = u[f]; + return t10.makeTensorInfo(n.shape, l, c); +} +var DR = { kernelName: wa, backendName: "cpu", kernelFunc: LZ }; +var BZ = C.SELU_SCALEALPHA; +var zZ = C.SELU_SCALE; +var VZ = Ie(Ts, (r16) => r16 >= 0 ? zZ * r16 : BZ * (Math.exp(r16) - 1)); +var AR = { kernelName: Ts, backendName: "cpu", kernelFunc: VZ }; +var WZ = Ie(Rs, (r16) => r16 < 0 ? -1 : r16 > 0 ? 1 : 0); +var FR = { kernelName: Rs, backendName: "cpu", kernelFunc: WZ }; +var UZ = Ie(Es, (r16) => Math.sin(r16)); +var PR = { kernelName: Es, backendName: "cpu", kernelFunc: UZ }; +var GZ = Ie($s, (r16) => Math.sinh(r16)); +var OR = { kernelName: $s, backendName: "cpu", kernelFunc: GZ }; +var HZ = 11920928955078125e-23; +var MR = Math.log(HZ) + 2; +var KZ = Ie(Ds, (r16) => { + let e = r16 > -MR, t10 = r16 < MR, o = Math.exp(r16), n; + return t10 ? n = o : e ? n = r16 : n = Math.log(1 + o), n; }); -var qE = { kernelName: Cs, backendName: "cpu", kernelFunc: b7 }; -function C7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, paddings: a } = o; +var LR = { kernelName: Ds, backendName: "cpu", kernelFunc: KZ }; +function qZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, paddings: a } = o; Q([n], "spaceToBatchND"); let i = y.sizeFromShape(s), p = [[0, 0]]; p.push(...a); - for (let _ = 1 + s.length; _ < n.shape.length; ++_) + for (let T = 1 + s.length; T < n.shape.length; ++T) p.push([0, 0]); - let u = Vf.kernelFunc({ inputs: { x: n }, backend: e, attrs: { paddings: p, constantValue: 0 } }), c = w.getReshaped(u.shape, s, i, false), l = w.getPermuted(c.length, s.length, false), m = w.getReshapedPermuted(u.shape, s, i, false), h = Ve({ inputs: { x: u }, backend: e, attrs: { shape: c } }), b = St({ inputs: { x: h }, backend: e, attrs: { perm: l } }), k = Ve({ inputs: { x: b }, backend: e, attrs: { shape: m } }); - return e.disposeIntermediateTensorInfo(u), e.disposeIntermediateTensorInfo(h), e.disposeIntermediateTensorInfo(b), k; + let u = Jf.kernelFunc({ inputs: { x: n }, backend: t10, attrs: { paddings: p, constantValue: 0 } }), l = C.getReshaped(u.shape, s, i, false), c = C.getPermuted(l.length, s.length, false), m = C.getReshapedPermuted(u.shape, s, i, false), h = We({ inputs: { x: u }, backend: t10, attrs: { shape: l } }), b = vt({ inputs: { x: h }, backend: t10, attrs: { perm: c } }), k = We({ inputs: { x: b }, backend: t10, attrs: { shape: m } }); + return t10.disposeIntermediateTensorInfo(u), t10.disposeIntermediateTensorInfo(h), t10.disposeIntermediateTensorInfo(b), k; } -var jE = { kernelName: ga, backendName: "cpu", kernelFunc: C7 }; -function w7(r15) { - let { inputs: t8, backend: e } = r15, { indices: o, values: n, denseShape: s, defaultValue: a } = t8; +var BR = { kernelName: Sa, backendName: "cpu", kernelFunc: qZ }; +function jZ(r16) { + let { inputs: e, backend: t10 } = r16, { indices: o, values: n, denseShape: s, defaultValue: a } = e; if (s.shape.length !== 1) throw new Error(`Dense shape must be a vector, saw: ${s.shape}`); @@ -15019,12 +15119,12 @@ function w7(r15) { if (a.shape.length !== 0) throw new Error(`Default value must be a scalar, saw: ${a.shape}`); - let i = e.data.get(o.dataId).values, p = e.data.get(n.dataId).values, u = e.data.get(s.dataId).values, c = e.data.get(a.dataId).values[0], [l, m, d, f, h] = Af(i, o.shape, o.dtype, p, n.dtype, u, c); - return [e.makeTensorInfo(m, o.dtype, l), e.makeTensorInfo([m[0]], n.dtype, d), e.makeTensorInfo([f.length], "bool", new Uint8Array(f.map((g) => Number(g)))), e.makeTensorInfo([h.length], o.dtype, new Int32Array(h))]; + let i = t10.data.get(o.dataId).values, p = t10.data.get(n.dataId).values, u = t10.data.get(s.dataId).values, l = t10.data.get(a.dataId).values[0], [c, m, d, f, h] = Gf(i, o.shape, o.dtype, p, n.dtype, u, l); + return [t10.makeTensorInfo(m, o.dtype, c), t10.makeTensorInfo([m[0]], n.dtype, d), t10.makeTensorInfo([f.length], "bool", new Uint8Array(f.map((g) => Number(g)))), t10.makeTensorInfo([h.length], o.dtype, new Int32Array(h))]; } -var XE = { kernelName: Hi, backendName: "cpu", kernelFunc: w7 }; -function S7(r15) { - let { inputs: t8, backend: e } = r15, { inputIndices: o, inputShape: n, newShape: s } = t8; +var zR = { kernelName: eu, backendName: "cpu", kernelFunc: jZ }; +function XZ(r16) { + let { inputs: e, backend: t10 } = r16, { inputIndices: o, inputShape: n, newShape: s } = e; if (o.shape.length !== 2) throw new Error(`Input indices should be a matrix but received shape ${o.shape}`); @@ -15033,12 +15133,12 @@ function S7(r15) { ${n.shape}`); if (s.shape.length !== 1) throw new Error(`Target shape should be a vector but received shape ${s.shape}`); - let a = Array.from(e.data.get(n.dataId).values), i = e.data.get(o.dataId).values, p = Array.from(e.data.get(s.dataId).values), [u, c, l] = Ff(i, o.shape, o.dtype, a, p); - return [e.makeTensorInfo(c, o.dtype, u), e.makeTensorInfo([l.length], s.dtype, new Int32Array(l))]; + let a = Array.from(t10.data.get(n.dataId).values), i = t10.data.get(o.dataId).values, p = Array.from(t10.data.get(s.dataId).values), [u, l, c] = Hf(i, o.shape, o.dtype, a, p); + return [t10.makeTensorInfo(l, o.dtype, u), t10.makeTensorInfo([c.length], s.dtype, new Int32Array(c))]; } -var YE = { kernelName: ei, backendName: "cpu", kernelFunc: S7 }; -function I7(r15) { - let { inputs: t8, backend: e } = r15, { data: o, indices: n, segmentIds: s } = t8; +var VR = { kernelName: ui, backendName: "cpu", kernelFunc: XZ }; +function YZ(r16) { + let { inputs: e, backend: t10 } = r16, { data: o, indices: n, segmentIds: s } = e; if (o.shape.length < 1) throw new Error("Data should be at least 1 dimensional but received scalar"); if (n.shape.length !== 1) @@ -15049,12 +15149,12 @@ function I7(r15) { ${s.shape}`); if (n.shape[0] !== s.shape[0]) throw new Error("segmentIds and indices should have same size."); - let a = e.data.get(o.dataId).values, i = e.data.get(n.dataId).values, p = e.data.get(s.dataId).values, [u, c] = Cc(a, o.shape, o.dtype, i, p, true); - return e.makeTensorInfo(c, o.dtype, u); + let a = t10.data.get(o.dataId).values, i = t10.data.get(n.dataId).values, p = t10.data.get(s.dataId).values, [u, l] = _l(a, o.shape, o.dtype, i, p, true); + return t10.makeTensorInfo(l, o.dtype, u); } -var QE = { kernelName: ya, backendName: "cpu", kernelFunc: I7 }; -function v7(r15) { - let { inputs: t8, backend: e } = r15, { data: o, indices: n, segmentIds: s } = t8; +var WR = { kernelName: va, backendName: "cpu", kernelFunc: YZ }; +function QZ(r16) { + let { inputs: e, backend: t10 } = r16, { data: o, indices: n, segmentIds: s } = e; if (o.shape.length < 1) throw new Error("Data should be at least 1 dimensional but received scalar"); if (n.shape.length !== 1) @@ -15065,136 +15165,136 @@ function v7(r15) { ${s.shape}`); if (n.shape[0] !== s.shape[0]) throw new Error("segmentIds and indices should have same size."); - let a = e.data.get(o.dataId).values, i = e.data.get(n.dataId).values, p = e.data.get(s.dataId).values, [u, c] = Cc(a, o.shape, o.dtype, i, p); - return e.makeTensorInfo(c, o.dtype, u); + let a = t10.data.get(o.dataId).values, i = t10.data.get(n.dataId).values, p = t10.data.get(s.dataId).values, [u, l] = _l(a, o.shape, o.dtype, i, p); + return t10.makeTensorInfo(l, o.dtype, u); } -var ZE = { kernelName: ba, backendName: "cpu", kernelFunc: v7 }; -function k7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { sparseIndices: n, sparseValues: s, defaultValue: a } = t8, { outputShape: i } = o, { sliceRank: p, numUpdates: u, sliceSize: c, strides: l, outputSize: m } = w.calculateShapes(s, n, i), d = false, f = e.bufferSync(n), h; +var UR = { kernelName: ka, backendName: "cpu", kernelFunc: QZ }; +function ZZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { sparseIndices: n, sparseValues: s, defaultValue: a } = e, { outputShape: i } = o, { sliceRank: p, numUpdates: u, sliceSize: l, strides: c, outputSize: m } = C.calculateShapes(s, n, i), d = false, f = t10.bufferSync(n), h; switch (s.dtype) { case "bool": { - let g = e.bufferSync(s), x = !!e.data.get(a.dataId).values[0]; - h = zs(f, g, i, m, c, u, p, l, x, d); + let g = t10.bufferSync(s), x = !!t10.data.get(a.dataId).values[0]; + h = Xs(f, g, i, m, l, u, p, c, x, d); break; } case "float32": { - let g = e.bufferSync(s), x = e.data.get(a.dataId).values[0]; - h = zs(f, g, i, m, c, u, p, l, x, d); + let g = t10.bufferSync(s), x = t10.data.get(a.dataId).values[0]; + h = Xs(f, g, i, m, l, u, p, c, x, d); break; } case "int32": { - let g = e.bufferSync(s), x = e.data.get(a.dataId).values[0]; - h = zs(f, g, i, m, c, u, p, l, x, d); + let g = t10.bufferSync(s), x = t10.data.get(a.dataId).values[0]; + h = Xs(f, g, i, m, l, u, p, c, x, d); break; } case "string": { - let g = e.bufferSync(s), x = y.decodeString(e.data.get(a.dataId).values[0]); - h = zs(f, g, i, m, c, u, p, l, x, d); + let g = t10.bufferSync(s), x = y.decodeString(t10.data.get(a.dataId).values[0]); + h = Xs(f, g, i, m, l, u, p, c, x, d); break; } default: throw new Error(`Unsupported type ${s.dtype}`); } - return e.makeTensorInfo(i, h.dtype, h.values); + return t10.makeTensorInfo(i, h.dtype, h.values); } -var JE = { kernelName: vs, backendName: "cpu", kernelFunc: k7 }; -function N7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { numOrSizeSplits: s, axis: a } = o, i = y.parseAxisParam(a, n.shape)[0], p = w.prepareSplitSize(n, s, i), u = new Array(n.shape.length).fill(0), c = n.shape.slice(); - return p.map((l) => { - let m = [...c]; - m[i] = l; - let d = Ao({ inputs: { x: n }, backend: e, attrs: { begin: u, size: m } }); - return u[i] += l, d; +var GR = { kernelName: Ps, backendName: "cpu", kernelFunc: ZZ }; +function JZ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { numOrSizeSplits: s, axis: a } = o, i = y.parseAxisParam(a, n.shape)[0], p = C.prepareSplitSize(n, s, i), u = new Array(n.shape.length).fill(0), l = n.shape.slice(); + return p.map((c) => { + let m = [...l]; + m[i] = c; + let d = nn({ inputs: { x: n }, backend: t10, attrs: { begin: u, size: m } }); + return u[i] += c, d; }); } -var eR = { kernelName: xa, backendName: "cpu", kernelFunc: N7 }; -var tR = { kernelName: Ki, backendName: "cpu", kernelFunc: ({ inputs: r15, backend: t8 }) => { - let { x: e } = r15, o = t8; - Q(e, "square"); - let n = o.data.get(e.dataId).values, s = new Float32Array(n.length); +var HR = { kernelName: Ia, backendName: "cpu", kernelFunc: JZ }; +var KR = { kernelName: tu, backendName: "cpu", kernelFunc: ({ inputs: r16, backend: e }) => { + let { x: t10 } = r16, o = e; + Q(t10, "square"); + let n = o.data.get(t10.dataId).values, s = new Float32Array(n.length); for (let i = 0; i < n.length; ++i) { let p = n[i]; s[i] = p * p; } - return { dataId: o.write(s, e.shape, e.dtype), shape: e.shape, dtype: e.dtype }; + return { dataId: o.write(s, t10.shape, t10.dtype), shape: t10.shape, dtype: t10.dtype }; } }; -var T7 = Ie(wo, (r15, t8) => { - let e = t8; - return isNaN(r15) ? NaN : r15 > 0 ? 1 : e.alpha; +var e9 = Ie(Ko, (r16, e) => { + let t10 = e; + return isNaN(r16) ? NaN : r16 > 0 ? 1 : t10.alpha; }); -var rR = { kernelName: wo, backendName: "cpu", kernelFunc: T7 }; -function _7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: c, newAxisMask: l, shrinkAxisMask: m } = o; +var qR = { kernelName: Ko, backendName: "cpu", kernelFunc: e9 }; +function t9(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: l, newAxisMask: c, shrinkAxisMask: m } = o; Q(n, "stridedSlice"); - let { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: C, strides: S } = pt.sliceInfo(n.shape, s, a, i, p, u, c, l, m), k; + let { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: w, strides: S } = nt.sliceInfo(n.shape, s, a, i, p, u, l, c, m), k; if (h) - k = Ve({ inputs: { x: n }, backend: e, attrs: { shape: f } }); + k = We({ inputs: { x: n }, backend: t10, attrs: { shape: f } }); else if (g || x) { y.assert(n.shape.length >= 1, () => `Input must have rank at least 1, got: ${n.shape.length}`); - let _ = pt.computeOutShape(b, C, S), E = Ao({ inputs: { x: n }, backend: e, attrs: { begin: b, size: _ } }); - k = Ve({ inputs: { x: E }, backend: e, attrs: { shape: f } }), e.disposeIntermediateTensorInfo(E); + let T = nt.computeOutShape(b, w, S), E = nn({ inputs: { x: n }, backend: t10, attrs: { begin: b, size: T } }); + k = We({ inputs: { x: E }, backend: t10, attrs: { shape: f } }), t10.disposeIntermediateTensorInfo(E); } else { - let _ = e.bufferSync(n), E = Pf(d, _, S, b); - k = e.makeTensorInfo(f, E.dtype, E.values); + let T = t10.bufferSync(n), E = Kf(d, T, S, b); + k = t10.makeTensorInfo(f, E.dtype, E.values); } return k; } -var oR = { kernelName: Ns, backendName: "cpu", kernelFunc: _7 }; -function $7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { separator: n, nGramWidths: s, leftPad: a, rightPad: i, padWidth: p, preserveShortSequences: u } = o, { data: c, dataSplits: l } = t8, m = e.data.get(c.dataId).values, d = e.data.get(l.dataId).values, [f, h] = up(m, d, n, s, a, i, p, u); - return [e.makeTensorInfo([f.length], "string", f), e.makeTensorInfo(l.shape, "int32", h)]; +var jR = { kernelName: Os, backendName: "cpu", kernelFunc: t9 }; +function r92(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { separator: n, nGramWidths: s, leftPad: a, rightPad: i, padWidth: p, preserveShortSequences: u } = o, { data: l, dataSplits: c } = e, m = t10.data.get(l.dataId).values, d = t10.data.get(c.dataId).values, [f, h] = gp(m, d, n, s, a, i, p, u); + return [t10.makeTensorInfo([f.length], "string", f), t10.makeTensorInfo(c.shape, "int32", h)]; } -var nR = { kernelName: Ca, backendName: "cpu", kernelFunc: $7 }; -function E7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { skipEmpty: n } = o, { input: s, delimiter: a } = t8; +var XR = { kernelName: Na, backendName: "cpu", kernelFunc: r92 }; +function o9(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { skipEmpty: n } = o, { input: s, delimiter: a } = e; if (s.dtype !== "string") throw new Error("Input must be of datatype string"); if (s.shape.length !== 1) throw new Error(`Input must be a vector, got shape: ${s.shape}`); if (a.shape.length !== 0) throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`); - let i = e.data.get(s.dataId).values, p = e.data.get(a.dataId).values[0], [u, c, l] = pp(i, p, n), m = c.length; - return [e.makeTensorInfo([m, 2], "int32", u), e.makeTensorInfo([m], "string", c), e.makeTensorInfo([2], "int32", new Int32Array(l))]; + let i = t10.data.get(s.dataId).values, p = t10.data.get(a.dataId).values[0], [u, l, c] = xp(i, p, n), m = l.length; + return [t10.makeTensorInfo([m, 2], "int32", u), t10.makeTensorInfo([m], "string", l), t10.makeTensorInfo([2], "int32", new Int32Array(c))]; } -var sR = { kernelName: qi, backendName: "cpu", kernelFunc: E7 }; -function R7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { numBuckets: n } = o, { input: s } = t8; +var YR = { kernelName: ru, backendName: "cpu", kernelFunc: o9 }; +function n9(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { numBuckets: n } = o, { input: s } = e; if (s.dtype !== "string") throw new Error("Input must be of datatype string"); if (n <= 0) throw new Error("Number of buckets must be at least 1"); - let a = e.data.get(s.dataId).values, i = cp(a, n); - return e.makeTensorInfo(s.shape, "int32", i); -} -var aR = { kernelName: ji, backendName: "cpu", kernelFunc: R7 }; -var D7 = Ie(_s, (r15) => Math.tan(r15)); -var iR = { kernelName: _s, backendName: "cpu", kernelFunc: D7 }; -var A7 = Ie($s, (r15) => Math.tanh(r15)); -var uR = { kernelName: $s, backendName: "cpu", kernelFunc: A7 }; -function F7(r15) { - let { inputs: t8, backend: e } = r15, { tensor: o, indices: n, updates: s } = t8, { sliceRank: a, numUpdates: i, sliceSize: p, strides: u, outputSize: c } = w.calculateShapes(s, n, o.shape), l = false, m = e.bufferSync(n), d = e.bufferSync(s), f = e.bufferSync(o), h = zs(m, d, o.shape, c, p, i, a, u, f, l); - return e.makeTensorInfo(o.shape, h.dtype, h.values); -} -var pR = { kernelName: ds, backendName: "cpu", kernelFunc: F7 }; -function P7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { reps: s } = o; + let a = t10.data.get(s.dataId).values, i = yp(a, n); + return t10.makeTensorInfo(s.shape, "int32", i); +} +var QR = { kernelName: ou, backendName: "cpu", kernelFunc: n9 }; +var s9 = Ie(Ms, (r16) => Math.tan(r16)); +var ZR = { kernelName: Ms, backendName: "cpu", kernelFunc: s9 }; +var a9 = Ie(Ls, (r16) => Math.tanh(r16)); +var JR = { kernelName: Ls, backendName: "cpu", kernelFunc: a9 }; +function i9(r16) { + let { inputs: e, backend: t10 } = r16, { tensor: o, indices: n, updates: s } = e, { sliceRank: a, numUpdates: i, sliceSize: p, strides: u, outputSize: l } = C.calculateShapes(s, n, o.shape), c = false, m = t10.bufferSync(n), d = t10.bufferSync(s), f = t10.bufferSync(o), h = Xs(m, d, o.shape, l, p, i, a, u, f, c); + return t10.makeTensorInfo(o.shape, h.dtype, h.values); +} +var eD = { kernelName: ks, backendName: "cpu", kernelFunc: i9 }; +function u9(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { reps: s } = o; Q(n, "tile"); - let a = Of(e.bufferSync(n), s); - return e.makeTensorInfo(a.shape, a.dtype, a.values); + let a = qf(t10.bufferSync(n), s); + return t10.makeTensorInfo(a.shape, a.dtype, a.values); } -var cR = { kernelName: uo, backendName: "cpu", kernelFunc: P7 }; -function O7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { k: s, sorted: a } = o; +var tD = { kernelName: Mo, backendName: "cpu", kernelFunc: u9 }; +function p9(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { k: s, sorted: a } = o; Q(n, "topk"); - let i = e.data.get(n.dataId).values, [p, u] = Mf(i, n.shape, n.dtype, s, a); - return [e.makeTensorInfo(p.shape, p.dtype, p.values), e.makeTensorInfo(u.shape, u.dtype, u.values)]; + let i = t10.data.get(n.dataId).values, [p, u] = jf(i, n.shape, n.dtype, s, a); + return [t10.makeTensorInfo(p.shape, p.dtype, p.values), t10.makeTensorInfo(u.shape, u.dtype, u.values)]; } -var lR = { kernelName: Es, backendName: "cpu", kernelFunc: O7 }; -function M7(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { image: n, transforms: s } = t8, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = e, [c, l, m, d] = n.shape, [f, h] = u != null ? u : [l, m], g = [c, f, h, d], x = y.computeStrides(n.shape), b = x[0], C = x[1], S = x[2], k = y.computeStrides(g), _ = k[0], E = k[1], R = k[2], D = y.getTypedArrayFromDType(n.dtype, y.sizeFromShape(g)); +var rD = { kernelName: Bs, backendName: "cpu", kernelFunc: p9 }; +function l9(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { image: n, transforms: s } = e, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = t10, [l, c, m, d] = n.shape, [f, h] = u != null ? u : [c, m], g = [l, f, h, d], x = y.computeStrides(n.shape), b = x[0], w = x[1], S = x[2], k = y.computeStrides(g), T = k[0], E = k[1], R = k[2], D = y.getTypedArrayFromDType(n.dtype, y.sizeFromShape(g)); D.fill(p); - let P = o.data.get(n.dataId).values, O = o.data.get(s.dataId).values; - for (let L = 0; L < c; ++L) { + let F = o.data.get(n.dataId).values, O = o.data.get(s.dataId).values; + for (let L = 0; L < l; ++L) { let B = s.shape[0] === 1 ? O : O.subarray(L * 8, L * 8 + 8); for (let z = 0; z < f; ++z) for (let U = 0; U < h; ++U) @@ -15202,508 +15302,504 @@ function M7(r15) { let q, Y = B[6] * U + B[7] * z + 1; if (Y === 0) continue; - let J = (B[0] * U + B[1] * z + B[2]) / Y, re = (B[3] * U + B[4] * z + B[5]) / Y, ne = mR(J, m, i), ee = mR(re, l, i); + let J = (B[0] * U + B[1] * z + B[2]) / Y, re = (B[3] * U + B[4] * z + B[5]) / Y, ne = oD(J, m, i), ee = oD(re, c, i); switch (a) { case "nearest": - q = W7(P, l, m, b, C, S, L, ee, ne, j, p); + q = h9(F, c, m, b, w, S, L, ee, ne, j, p); break; case "bilinear": - q = U7(P, l, m, b, C, S, L, ee, ne, j, p); + q = g9(F, c, m, b, w, S, L, ee, ne, j, p); break; default: throw new Error(`Error in Transform: Expect 'nearest' or 'bilinear', but got ${a}`); } - let oe = L * _ + z * E + U * R + j; + let oe = L * T + z * E + U * R + j; D[oe] = q; } return o.makeTensorInfo(g, n.dtype, D); } return { dataId: o.write(D, g, n.dtype), shape: n.shape, dtype: n.dtype }; } -var dR = { kernelName: Rs, backendName: "cpu", kernelFunc: M7 }; -function mR(r15, t8, e) { - switch (e) { +var nD = { kernelName: zs, backendName: "cpu", kernelFunc: l9 }; +function oD(r16, e, t10) { + switch (t10) { case "reflect": - return L7(r15, t8); + return c9(r16, e); case "wrap": - return B7(r15, t8); + return m9(r16, e); case "nearest": - return V7(r15, t8); + return f9(r16, e); case "constant": default: - return z7(r15, t8); + return d9(r16, e); } } -function L7(r15, t8) { - let e = r15; - if (e < 0) - if (t8 <= 1) - e = 0; +function c9(r16, e) { + let t10 = r16; + if (t10 < 0) + if (e <= 1) + t10 = 0; else { - let o = 2 * t8; - e < o && (e = o * Math.trunc(-e / o) + e), e = e < -t8 ? e + o : -e - 1; + let o = 2 * e; + t10 < o && (t10 = o * Math.trunc(-t10 / o) + t10), t10 = t10 < -e ? t10 + o : -t10 - 1; } - else if (e > t8 - 1) - if (t8 <= 1) - e = 0; + else if (t10 > e - 1) + if (e <= 1) + t10 = 0; else { - let o = 2 * t8; - e -= o * Math.trunc(e / o), e >= t8 && (e = o - e - 1); + let o = 2 * e; + t10 -= o * Math.trunc(t10 / o), t10 >= e && (t10 = o - t10 - 1); } - return y.clamp(0, e, t8 - 1); + return y.clamp(0, t10, e - 1); } -function B7(r15, t8) { - let e = r15; - if (e < 0) - if (t8 <= 1) - e = 0; +function m9(r16, e) { + let t10 = r16; + if (t10 < 0) + if (e <= 1) + t10 = 0; else { - let o = t8 - 1; - e += t8 * (Math.trunc(-e / o) + 1); + let o = e - 1; + t10 += e * (Math.trunc(-t10 / o) + 1); } - else if (e > t8 - 1) - if (t8 <= 1) - e = 0; + else if (t10 > e - 1) + if (e <= 1) + t10 = 0; else { - let o = t8 - 1; - e -= t8 * Math.trunc(e / o); + let o = e - 1; + t10 -= e * Math.trunc(t10 / o); } - return y.clamp(0, e, t8 - 1); + return y.clamp(0, t10, e - 1); } -function z7(r15, t8) { - return r15; +function d9(r16, e) { + return r16; } -function V7(r15, t8) { - return y.clamp(0, r15, t8 - 1); +function f9(r16, e) { + return y.clamp(0, r16, e - 1); } -function Hl(r15, t8, e, o, n, s, a, i, p, u, c) { - let l = a * o + i * n + p * s + u; - return 0 <= i && i < t8 && 0 <= p && p < e ? r15[l] : c; +function em(r16, e, t10, o, n, s, a, i, p, u, l) { + let c = a * o + i * n + p * s + u; + return 0 <= i && i < e && 0 <= p && p < t10 ? r16[c] : l; } -function W7(r15, t8, e, o, n, s, a, i, p, u, c) { - let l = Math.round(i), m = Math.round(p); - return Hl(r15, t8, e, o, n, s, a, l, m, u, c); +function h9(r16, e, t10, o, n, s, a, i, p, u, l) { + let c = Math.round(i), m = Math.round(p); + return em(r16, e, t10, o, n, s, a, c, m, u, l); } -function U7(r15, t8, e, o, n, s, a, i, p, u, c) { - let l = Math.floor(i), m = Math.floor(p), d = l + 1, f = m + 1, h = (f - p) * Hl(r15, t8, e, o, n, s, a, l, m, u, c) + (p - m) * Hl(r15, t8, e, o, n, s, a, l, f, u, c), g = (f - p) * Hl(r15, t8, e, o, n, s, a, d, m, u, c) + (p - m) * Hl(r15, t8, e, o, n, s, a, d, f, u, c); - return (d - i) * h + (i - l) * g; +function g9(r16, e, t10, o, n, s, a, i, p, u, l) { + let c = Math.floor(i), m = Math.floor(p), d = c + 1, f = m + 1, h = (f - p) * em(r16, e, t10, o, n, s, a, c, m, u, l) + (p - m) * em(r16, e, t10, o, n, s, a, c, f, u, l), g = (f - p) * em(r16, e, t10, o, n, s, a, d, m, u, l) + (p - m) * em(r16, e, t10, o, n, s, a, d, f, u, l); + return (d - i) * h + (i - c) * g; } -function G7(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { axis: n } = e, { x: s } = t8; +function x9(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { axis: n } = t10, { x: s } = e; Q(s, "unique"); - let a = o.data.get(s.dataId).values, { outputValues: i, outputShape: p, indices: u } = lp(a, n, s.shape, s.dtype); + let a = o.data.get(s.dataId).values, { outputValues: i, outputShape: p, indices: u } = bp(a, n, s.shape, s.dtype); return [o.makeTensorInfo(p, s.dtype, i), o.makeTensorInfo([u.length], "int32", u)]; } -var fR = { kernelName: Xi, backendName: "cpu", kernelFunc: G7 }; -function H7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { value: n } = t8, { axis: s } = o; +var sD = { kernelName: nu, backendName: "cpu", kernelFunc: x9 }; +function y9(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { value: n } = e, { axis: s } = o; s < 0 && (s += n.shape.length); let a = n.shape.length, i = n.shape[s], p = new Array(a - 1), u = 0; for (let d = 0; d < a; d++) d !== s && (p[u++] = n.shape[d]); - let c = new Array(a).fill(0), l = n.shape.slice(); - l[s] = 1; + let l = new Array(a).fill(0), c = n.shape.slice(); + c[s] = 1; let m = new Array(i); for (let d = 0; d < m.length; d++) { - c[s] = d; - let f = Ao({ inputs: { x: n }, backend: e, attrs: { begin: c, size: l } }); - m[d] = Ve({ inputs: { x: f }, backend: e, attrs: { shape: p } }), e.disposeIntermediateTensorInfo(f); + l[s] = d; + let f = nn({ inputs: { x: n }, backend: t10, attrs: { begin: l, size: c } }); + m[d] = We({ inputs: { x: f }, backend: t10, attrs: { shape: p } }), t10.disposeIntermediateTensorInfo(f); } return m; } -var hR = { kernelName: wa, backendName: "cpu", kernelFunc: H7 }; -function K7(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, segmentIds: s } = t8, { numSegments: a } = o; +var aD = { kernelName: Ta, backendName: "cpu", kernelFunc: y9 }; +function b9(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, segmentIds: s } = e, { numSegments: a } = o; Q(n, "unsortedSegmentSum"); - let i = n.shape.length, p = s.shape.length, u = [], c = [], l = i - p, m = s; - for (let f = 0; f < l; ++f) { - let h = Ic({ inputs: { input: m }, backend: e, attrs: { dim: f + 1 } }); - m = h, c.push(h); + let i = n.shape.length, p = s.shape.length, u = [], l = [], c = i - p, m = s; + for (let f = 0; f < c; ++f) { + let h = $l({ inputs: { input: m }, backend: t10, attrs: { dim: f + 1 } }); + m = h, l.push(h); } for (let f = 0; f < a; ++f) { - let h = y.createScalarValue(f, "int32"), g = e.makeTensorInfo([], "int32", h), x = GS({ inputs: { a: g, b: m }, backend: e }), b = Ro({ inputs: { x }, backend: e, attrs: { dtype: "float32" } }), C = sp({ inputs: { a: b, b: n }, backend: e }), S = di({ inputs: { x: C }, backend: e, attrs: { axis: 0, keepDims: false } }); - u.push(S), c.push(g), c.push(x), c.push(b), c.push(C), c.push(S); - } - let d = vI({ inputs: u, backend: e, attrs: { axis: 0 } }); - return c.forEach((f) => e.disposeIntermediateTensorInfo(f)), d; -} -var gR = { kernelName: Yi, backendName: "cpu", kernelFunc: K7 }; -var q7 = [V_, XT, W_, U_, e_, G_, H_, K_, q_, j_, X_, Y_, Q_, Z_, J_, t$, r$, o$, n$, z_, s$, a$, i$, t_, u$, JT, r_, p$, YT, c$, m$, d$, f$, h$, g$, x$, y$, b$, C$, w$, S$, I$, v$, k$, N$, T$, _$, $$, E$, R$, D$, A$, P$, F_, O$, o_, M$, n_, L$, s_, B$, z$, V$, a_, i_, W$, U$, G$, H$, u_, p_, QT, K$, l$, q$, j$, X$, P_, c_, l_, Y$, m_, Q$, Z$, J$, eE, tE, rE, oE, d_, nE, sE, aE, iE, pE, cE, lE, f_, mE, dE, gE, h_, g_, xE, yE, bE, x_, CE, IE, vE, Vf, kE, O_, b_, NE, TE, _E, $E, ZT, Wl, EE, M_, L_, B_, RE, DE, AE, FE, PE, OE, ME, v_, LE, zE, VE, WE, N_, UE, GE, HE, T_, fE, qE, jE, XE, YE, QE, ZE, JE, eR, $_, tR, E_, R_, rR, oR, nR, sR, aR, D_, F$, iR, uR, pR, cR, lR, dR, y_, fR, hR, gR, wE]; -for (let r15 of q7) - ti(r15); -var Tc = {}; -qe(Tc, { assertNotComplex: () => Vs, bindCanvasToFramebuffer: () => rZ, bindColorTextureToFramebuffer: () => Xl, bindTextureToProgramUniformSampler: () => zI, bindTextureUnit: () => CR, bindVertexBufferToProgramAttribute: () => qf, callAndCheck: () => ce, canBeRepresented: () => _I, createFragmentShader: () => EI, createFramebuffer: () => MI, createProgram: () => RI, createStaticIndexBuffer: () => FI, createStaticVertexBuffer: () => AI, createTexture: () => PI, createVertexShader: () => $I, getBatchDim: () => hi, getExtensionOrThrow: () => vc, getFramebufferErrorMessage: () => wR, getMaxTexturesInShader: () => UI, getNumChannels: () => eZ, getProgramUniformLocation: () => BI, getProgramUniformLocationOrThrow: () => LI, getRowsCols: () => gi, getShapeAs3D: () => Nc, getTextureShapeFromLogicalShape: () => VI, getWebGLDisjointQueryTimerVersion: () => GI, getWebGLErrorMessage: () => bR, getWebGLMaxTextureSize: () => WI, hasExtension: () => Kr, isCapableOfRenderingToFloatTexture: () => HI, isDownloadFloatTextureEnabled: () => KI, isReshapeFree: () => hu, isWebGLFenceEnabled: () => qI, isWebGLVersionEnabled: () => Xf, linkProgram: () => DI, logShaderSourceAndInfoLog: () => Kf, resetMaxTextureSize: () => oZ, resetMaxTexturesInShader: () => nZ, unbindColorTextureFromFramebuffer: () => jf, unbindTextureUnit: () => tZ, validateFramebuffer: () => kc, validateProgram: () => jl, validateTextureSize: () => OI }); -var dp = {}; -var Wf = { alpha: false, antialias: false, premultipliedAlpha: false, preserveDrawingBuffer: false, depth: false, stencil: false, failIfMajorPerformanceCaveat: true }; -function kI(r15, t8) { - dp[r15] = t8; -} -function Hr(r15, t8) { - if (!(r15 in dp) || t8 != null) { - let o = X7(r15, t8); + let h = y.createScalarValue(f, "int32"), g = t10.makeTensorInfo([], "int32", h), x = nI({ inputs: { a: g, b: m }, backend: t10 }), b = rn({ inputs: { x }, backend: t10, attrs: { dtype: "float32" } }), w = dp({ inputs: { a: b, b: n }, backend: t10 }), S = Ii({ inputs: { x: w }, backend: t10, attrs: { axis: 0, keepDims: false } }); + u.push(S), l.push(g), l.push(x), l.push(b), l.push(w), l.push(S); + } + let d = LI({ inputs: u, backend: t10, attrs: { axis: 0 } }); + return l.forEach((f) => t10.disposeIntermediateTensorInfo(f)), d; +} +var iD = { kernelName: su, backendName: "cpu", kernelFunc: b9 }; +var C9 = [DE, z_, AE, FE, H_, PE, OE, ME, LE, BE, zE, VE, WE, UE, GE, KE, qE, jE, XE, RE, YE, QE, ZE, K_, JE, G_, q_, e$, V_, t$, o$, n$, s$, a$, i$, u$, p$, l$, c$, m$, d$, f$, h$, g$, x$, y$, b$, C$, w$, S$, I$, v$, N$, kE, T$, j_, _$, X_, E$, Y_, $$, R$, D$, Q_, Z_, A$, F$, P$, O$, J_, eE, W_, M$, r$, L$, B$, z$, NE, tE, rE, V$, oE, W$, U$, G$, H$, K$, q$, j$, nE, X$, Y$, Q$, Z$, eR, tR, rR, sE, oR, nR, iR, aE, iE, uR, pR, lR, uE, cR, fR, hR, Jf, gR, TE, lE, xR, yR, bR, CR, U_, Qc, wR, _E, EE, $E, SR, IR, vR, kR, NR, TR, _R, hE, ER, RR, DR, AR, xE, FR, PR, OR, yE, sR, LR, BR, zR, VR, WR, UR, GR, HR, CE, KR, wE, SE, qR, jR, XR, YR, QR, IE, k$, ZR, JR, eD, tD, rD, nD, pE, sD, aD, iD, mR]; +for (let r16 of C9) + li(r16); +var Fl = {}; +qe(Fl, { assertNotComplex: () => Ys, bindCanvasToFramebuffer: () => E9, bindColorTextureToFramebuffer: () => nm, bindTextureToProgramUniformSampler: () => e0, bindTextureUnit: () => cD, bindVertexBufferToProgramAttribute: () => sh, callAndCheck: () => ce, canBeRepresented: () => WI, createFragmentShader: () => GI, createFramebuffer: () => QI, createProgram: () => HI, createStaticIndexBuffer: () => jI, createStaticVertexBuffer: () => qI, createTexture: () => XI, createVertexShader: () => UI, getBatchDim: () => ki, getExtensionOrThrow: () => Rl, getFramebufferErrorMessage: () => mD, getMaxTexturesInShader: () => o0, getNumChannels: () => T9, getProgramUniformLocation: () => JI, getProgramUniformLocationOrThrow: () => ZI, getRowsCols: () => Ni, getShapeAs3D: () => Al, getTextureShapeFromLogicalShape: () => t0, getWebGLDisjointQueryTimerVersion: () => n0, getWebGLErrorMessage: () => lD, getWebGLMaxTextureSize: () => r0, hasExtension: () => Jr, isCapableOfRenderingToFloatTexture: () => s0, isDownloadFloatTextureEnabled: () => a0, isReshapeFree: () => vu, isWebGLFenceEnabled: () => i0, isWebGLVersionEnabled: () => ih, linkProgram: () => KI, logShaderSourceAndInfoLog: () => nh, resetMaxTextureSize: () => $9, resetMaxTexturesInShader: () => R9, unbindColorTextureFromFramebuffer: () => ah, unbindTextureUnit: () => _9, validateFramebuffer: () => Dl, validateProgram: () => om, validateTextureSize: () => YI }); +var wp = {}; +var eh = { alpha: false, antialias: false, premultipliedAlpha: false, preserveDrawingBuffer: false, depth: false, stencil: false, failIfMajorPerformanceCaveat: true }; +function BI(r16, e) { + wp[r16] = e; +} +function Zr(r16, e) { + if (!(r16 in wp) || e != null) { + let o = S9(r16, e); if (o !== null) - dp[r15] = o; + wp[r16] = o; else - return console.log("Could not get context for WebGL version", r15), null; + return console.log("Could not get context for WebGL version", r16), null; } - let e = dp[r15]; - return e == null || e.isContextLost() ? (delete dp[r15], Hr(r15)) : (e.disable(e.DEPTH_TEST), e.disable(e.STENCIL_TEST), e.disable(e.BLEND), e.disable(e.DITHER), e.disable(e.POLYGON_OFFSET_FILL), e.disable(e.SAMPLE_COVERAGE), e.enable(e.SCISSOR_TEST), e.enable(e.CULL_FACE), e.cullFace(e.BACK), dp[r15]); + let t10 = wp[r16]; + return t10 == null || t10.isContextLost() ? (delete wp[r16], Zr(r16)) : (t10.disable(t10.DEPTH_TEST), t10.disable(t10.STENCIL_TEST), t10.disable(t10.BLEND), t10.disable(t10.DITHER), t10.disable(t10.POLYGON_OFFSET_FILL), t10.disable(t10.SAMPLE_COVERAGE), t10.enable(t10.SCISSOR_TEST), t10.enable(t10.CULL_FACE), t10.cullFace(t10.BACK), wp[r16]); } -function j7(r15) { - if (!A().getBool("IS_SAFARI") && typeof OffscreenCanvas != "undefined" && r15 === 2) +function w9(r16) { + if (!A().getBool("IS_SAFARI") && typeof OffscreenCanvas != "undefined" && r16 === 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 X7(r15, t8) { - if (r15 !== 1 && r15 !== 2) +function S9(r16, e) { + if (r16 !== 1 && r16 !== 2) throw new Error("Cannot get WebGL rendering context, WebGL is disabled."); - let e = t8 == null ? j7(r15) : t8; - return e.addEventListener("webglcontextlost", (o) => { - o.preventDefault(), delete dp[r15]; - }, false), A().getBool("SOFTWARE_WEBGL_ENABLED") && (Wf.failIfMajorPerformanceCaveat = false), r15 === 1 ? e.getContext("webgl", Wf) || e.getContext("experimental-webgl", Wf) : e.getContext("webgl2", Wf); -} -var fu; -(function(r15) { - r15[r15.DENSE = 0] = "DENSE", r15[r15.SHARED_BATCH = 1] = "SHARED_BATCH"; -})(fu || (fu = {})); -var mr; -(function(r15) { - r15[r15.RENDER = 0] = "RENDER", r15[r15.UPLOAD = 1] = "UPLOAD", r15[r15.PIXELS = 2] = "PIXELS", r15[r15.DOWNLOAD = 3] = "DOWNLOAD"; -})(mr || (mr = {})); -var er; -(function(r15) { - r15[r15.UNPACKED_FLOAT16 = 0] = "UNPACKED_FLOAT16", r15[r15.UNPACKED_FLOAT32 = 1] = "UNPACKED_FLOAT32", r15[r15.PACKED_4X1_UNSIGNED_BYTE = 2] = "PACKED_4X1_UNSIGNED_BYTE", r15[r15.PACKED_2X2_FLOAT32 = 3] = "PACKED_2X2_FLOAT32", r15[r15.PACKED_2X2_FLOAT16 = 4] = "PACKED_2X2_FLOAT16"; -})(er || (er = {})); -function fp(r15, t8) { - return [t8, r15]; -} -function xR(r15, t8) { - return r15 * t8; -} -function Kl(r15) { - let t8 = y.sizeFromShape(r15), e = Math.ceil(t8 / 4); - return y.sizeToSquarishShape(e); -} -function Ma(r15, t8) { - return [Math.max(1, Math.ceil(t8 / 2)), Math.max(1, Math.ceil(r15 / 2))]; -} -function yR(r15, t8) { - let [e, o] = Ma(r15, t8); - return e * o * 4; -} -function ql(r15, t8) { - let e = r15, o, n, s, a, i, p, u, c, l, m; - return A().getNumber("WEBGL_VERSION") === 2 ? (o = e.R32F, n = e.R16F, s = e.RGBA16F, a = e.RGBA32F, i = e.RED, u = 4, c = 1, l = e.HALF_FLOAT, m = e.FLOAT, p = e.RGBA8) : (o = r15.RGBA, n = r15.RGBA, s = r15.RGBA, a = e.RGBA, i = r15.RGBA, u = 4, c = 4, l = t8 != null ? t8.HALF_FLOAT_OES : null, m = r15.FLOAT, p = r15.RGBA), { internalFormatFloat: o, internalFormatHalfFloat: n, internalFormatPackedHalfFloat: s, internalFormatPackedFloat: a, textureFormatFloat: i, downloadTextureFormat: p, downloadUnpackNumChannels: u, defaultNumChannels: c, textureTypeHalfFloat: l, textureTypeFloat: m }; -} -function ce(r15, t8) { - let e = t8(); - return A().getBool("DEBUG") && Y7(r15), e; -} -function Y7(r15) { - let t8 = r15.getError(); - if (t8 !== r15.NO_ERROR) - throw new Error("WebGL Error: " + bR(r15, t8)); -} -var Q7 = 596e-10; -var Z7 = 65504; -function _I(r15) { - return !!(A().getBool("WEBGL_RENDER_FLOAT32_ENABLED") || r15 === 0 || Q7 < Math.abs(r15) && Math.abs(r15) < Z7); -} -function bR(r15, t8) { - switch (t8) { - case r15.NO_ERROR: + let t10 = e == null ? w9(r16) : e; + return t10.addEventListener("webglcontextlost", (o) => { + o.preventDefault(), delete wp[r16]; + }, false), A().getBool("SOFTWARE_WEBGL_ENABLED") && (eh.failIfMajorPerformanceCaveat = false), r16 === 1 ? t10.getContext("webgl", eh) || t10.getContext("experimental-webgl", eh) : t10.getContext("webgl2", eh); +} +var Iu; +(function(r16) { + r16[r16.DENSE = 0] = "DENSE", r16[r16.SHARED_BATCH = 1] = "SHARED_BATCH"; +})(Iu || (Iu = {})); +var hr; +(function(r16) { + r16[r16.RENDER = 0] = "RENDER", r16[r16.UPLOAD = 1] = "UPLOAD", r16[r16.PIXELS = 2] = "PIXELS", r16[r16.DOWNLOAD = 3] = "DOWNLOAD"; +})(hr || (hr = {})); +var or; +(function(r16) { + r16[r16.UNPACKED_FLOAT16 = 0] = "UNPACKED_FLOAT16", r16[r16.UNPACKED_FLOAT32 = 1] = "UNPACKED_FLOAT32", r16[r16.PACKED_4X1_UNSIGNED_BYTE = 2] = "PACKED_4X1_UNSIGNED_BYTE", r16[r16.PACKED_2X2_FLOAT32 = 3] = "PACKED_2X2_FLOAT32", r16[r16.PACKED_2X2_FLOAT16 = 4] = "PACKED_2X2_FLOAT16"; +})(or || (or = {})); +function Sp(r16, e) { + return [e, r16]; +} +function uD(r16, e) { + return r16 * e; +} +function tm(r16) { + let e = y.sizeFromShape(r16), t10 = Math.ceil(e / 4); + return y.sizeToSquarishShape(t10); +} +function Ga(r16, e) { + return [Math.max(1, Math.ceil(e / 2)), Math.max(1, Math.ceil(r16 / 2))]; +} +function pD(r16, e) { + let [t10, o] = Ga(r16, e); + return t10 * o * 4; +} +function rm(r16, e) { + let t10 = r16, o, n, s, a, i, p, u, l, c, m; + return A().getNumber("WEBGL_VERSION") === 2 ? (o = t10.R32F, n = t10.R16F, s = t10.RGBA16F, a = t10.RGBA32F, i = t10.RED, u = 4, l = 1, c = t10.HALF_FLOAT, m = t10.FLOAT, p = t10.RGBA8) : (o = r16.RGBA, n = r16.RGBA, s = r16.RGBA, a = t10.RGBA, i = r16.RGBA, u = 4, l = 4, c = e != null ? e.HALF_FLOAT_OES : null, m = r16.FLOAT, p = r16.RGBA), { internalFormatFloat: o, internalFormatHalfFloat: n, internalFormatPackedHalfFloat: s, internalFormatPackedFloat: a, textureFormatFloat: i, downloadTextureFormat: p, downloadUnpackNumChannels: u, defaultNumChannels: l, textureTypeHalfFloat: c, textureTypeFloat: m }; +} +function ce(r16, e) { + let t10 = e(); + return A().getBool("DEBUG") && I9(r16), t10; +} +function I9(r16) { + let e = r16.getError(); + if (e !== r16.NO_ERROR) + throw new Error("WebGL Error: " + lD(r16, e)); +} +var v9 = 596e-10; +var k9 = 65504; +function WI(r16) { + return !!(A().getBool("WEBGL_RENDER_FLOAT32_ENABLED") || r16 === 0 || v9 < Math.abs(r16) && Math.abs(r16) < k9); +} +function lD(r16, e) { + switch (e) { + case r16.NO_ERROR: return "NO_ERROR"; - case r15.INVALID_ENUM: + case r16.INVALID_ENUM: return "INVALID_ENUM"; - case r15.INVALID_VALUE: + case r16.INVALID_VALUE: return "INVALID_VALUE"; - case r15.INVALID_OPERATION: + case r16.INVALID_OPERATION: return "INVALID_OPERATION"; - case r15.INVALID_FRAMEBUFFER_OPERATION: + case r16.INVALID_FRAMEBUFFER_OPERATION: return "INVALID_FRAMEBUFFER_OPERATION"; - case r15.OUT_OF_MEMORY: + case r16.OUT_OF_MEMORY: return "OUT_OF_MEMORY"; - case r15.CONTEXT_LOST_WEBGL: + case r16.CONTEXT_LOST_WEBGL: return "CONTEXT_LOST_WEBGL"; default: - return `Unknown error code ${t8}`; - } -} -function vc(r15, t8) { - return fi(r15, () => r15.getExtension(t8), 'Extension "' + t8 + '" not supported on this browser.'); -} -function $I(r15, t8) { - let e = fi(r15, () => r15.createShader(r15.VERTEX_SHADER), "Unable to create vertex WebGLShader."); - if (ce(r15, () => r15.shaderSource(e, t8)), ce(r15, () => r15.compileShader(e)), r15.getShaderParameter(e, r15.COMPILE_STATUS) === false) - throw console.log(r15.getShaderInfoLog(e)), new Error("Failed to compile vertex shader."); - return e; -} -function EI(r15, t8) { - let e = fi(r15, () => r15.createShader(r15.FRAGMENT_SHADER), "Unable to create fragment WebGLShader."); - if (ce(r15, () => r15.shaderSource(e, t8)), ce(r15, () => r15.compileShader(e)), A().get("ENGINE_COMPILE_ONLY")) - return e; - if (r15.getShaderParameter(e, r15.COMPILE_STATUS) === false) - throw Kf(t8, r15.getShaderInfoLog(e)), new Error("Failed to compile fragment shader."); - return e; -} -var J7 = /ERROR: [0-9]+:([0-9]+):/g; -function Kf(r15, t8) { - let e = J7.exec(t8); - if (e == null) { - console.log(`Couldn't parse line number in error: ${t8}`), console.log(r15); + return `Unknown error code ${e}`; + } +} +function Rl(r16, e) { + return vi(r16, () => r16.getExtension(e), 'Extension "' + e + '" not supported on this browser.'); +} +function UI(r16, e) { + let t10 = vi(r16, () => r16.createShader(r16.VERTEX_SHADER), "Unable to create vertex WebGLShader."); + if (ce(r16, () => r16.shaderSource(t10, e)), ce(r16, () => r16.compileShader(t10)), r16.getShaderParameter(t10, r16.COMPILE_STATUS) === false) + throw console.log(r16.getShaderInfoLog(t10)), new Error("Failed to compile vertex shader."); + return t10; +} +function GI(r16, e) { + let t10 = vi(r16, () => r16.createShader(r16.FRAGMENT_SHADER), "Unable to create fragment WebGLShader."); + if (ce(r16, () => r16.shaderSource(t10, e)), ce(r16, () => r16.compileShader(t10)), A().get("ENGINE_COMPILE_ONLY")) + return t10; + if (r16.getShaderParameter(t10, r16.COMPILE_STATUS) === false) + throw nh(e, r16.getShaderInfoLog(t10)), new Error("Failed to compile fragment shader."); + return t10; +} +var N9 = /ERROR: [0-9]+:([0-9]+):/g; +function nh(r16, e) { + let t10 = N9.exec(e); + if (t10 == null) { + console.log(`Couldn't parse line number in error: ${e}`), console.log(r16); return; } - let o = +e[1], n = r15.split(` -`), s = n.length.toString().length + 2, a = n.map((l, m) => y.rightPad((m + 1).toString(), s) + l), i = 0; - for (let l = 0; l < a.length; l++) - i = Math.max(a[l].length, i); - let p = a.slice(0, o - 1), u = a.slice(o - 1, o), c = a.slice(o); + let o = +t10[1], n = r16.split(` +`), s = n.length.toString().length + 2, a = n.map((c, m) => y.rightPad((m + 1).toString(), s) + c), i = 0; + for (let c = 0; c < a.length; c++) + i = Math.max(a[c].length, i); + let p = a.slice(0, o - 1), u = a.slice(o - 1, o), l = a.slice(o); console.log(p.join(` -`)), console.log(t8.split(` -`)[0]), console.log(`%c ${y.rightPad(u[0], i)}`, "border:1px solid red; background-color:#e3d2d2; color:#a61717"), console.log(c.join(` +`)), console.log(e.split(` +`)[0]), console.log(`%c ${y.rightPad(u[0], i)}`, "border:1px solid red; background-color:#e3d2d2; color:#a61717"), console.log(l.join(` `)); } -function RI(r15) { - return fi(r15, () => r15.createProgram(), "Unable to create WebGLProgram."); +function HI(r16) { + return vi(r16, () => r16.createProgram(), "Unable to create WebGLProgram."); } -function DI(r15, t8) { - if (ce(r15, () => r15.linkProgram(t8)), !A().get("ENGINE_COMPILE_ONLY") && r15.getProgramParameter(t8, r15.LINK_STATUS) === false) - throw console.log(r15.getProgramInfoLog(t8)), new Error("Failed to link vertex and fragment shaders."); +function KI(r16, e) { + if (ce(r16, () => r16.linkProgram(e)), !A().get("ENGINE_COMPILE_ONLY") && r16.getProgramParameter(e, r16.LINK_STATUS) === false) + throw console.log(r16.getProgramInfoLog(e)), new Error("Failed to link vertex and fragment shaders."); } -function jl(r15, t8) { - if (ce(r15, () => r15.validateProgram(t8)), r15.getProgramParameter(t8, r15.VALIDATE_STATUS) === false) - throw console.log(r15.getProgramInfoLog(t8)), new Error("Shader program validation failed."); +function om(r16, e) { + if (ce(r16, () => r16.validateProgram(e)), r16.getProgramParameter(e, r16.VALIDATE_STATUS) === false) + throw console.log(r16.getProgramInfoLog(e)), new Error("Shader program validation failed."); } -function AI(r15, t8) { - let e = fi(r15, () => r15.createBuffer(), "Unable to create WebGLBuffer"); - return ce(r15, () => r15.bindBuffer(r15.ARRAY_BUFFER, e)), ce(r15, () => r15.bufferData(r15.ARRAY_BUFFER, t8, r15.STATIC_DRAW)), e; +function qI(r16, e) { + let t10 = vi(r16, () => r16.createBuffer(), "Unable to create WebGLBuffer"); + return ce(r16, () => r16.bindBuffer(r16.ARRAY_BUFFER, t10)), ce(r16, () => r16.bufferData(r16.ARRAY_BUFFER, e, r16.STATIC_DRAW)), t10; } -function FI(r15, t8) { - let e = fi(r15, () => r15.createBuffer(), "Unable to create WebGLBuffer"); - return ce(r15, () => r15.bindBuffer(r15.ELEMENT_ARRAY_BUFFER, e)), ce(r15, () => r15.bufferData(r15.ELEMENT_ARRAY_BUFFER, t8, r15.STATIC_DRAW)), e; +function jI(r16, e) { + let t10 = vi(r16, () => r16.createBuffer(), "Unable to create WebGLBuffer"); + return ce(r16, () => r16.bindBuffer(r16.ELEMENT_ARRAY_BUFFER, t10)), ce(r16, () => r16.bufferData(r16.ELEMENT_ARRAY_BUFFER, e, r16.STATIC_DRAW)), t10; } -function eZ() { +function T9() { return A().getNumber("WEBGL_VERSION") === 2 ? 1 : 4; } -function PI(r15) { - return fi(r15, () => r15.createTexture(), "Unable to create WebGLTexture."); +function XI(r16) { + return vi(r16, () => r16.createTexture(), "Unable to create WebGLTexture."); } -function OI(r15, t8) { - let e = A().getNumber("WEBGL_MAX_TEXTURE_SIZE"); - if (r15 <= 0 || t8 <= 0) { - let o = `[${r15}x${t8}]`; +function YI(r16, e) { + let t10 = A().getNumber("WEBGL_MAX_TEXTURE_SIZE"); + if (r16 <= 0 || e <= 0) { + let o = `[${r16}x${e}]`; throw new Error("Requested texture size " + o + " is invalid."); } - if (r15 > e || t8 > e) { - let o = `[${r15}x${t8}]`, n = `[${e}x${e}]`; + if (r16 > t10 || e > t10) { + let o = `[${r16}x${e}]`, n = `[${t10}x${t10}]`; throw new Error("Requested texture size " + o + " greater than WebGL maximum on this browser / GPU " + n + "."); } } -function MI(r15) { - return fi(r15, () => r15.createFramebuffer(), "Unable to create WebGLFramebuffer."); +function QI(r16) { + return vi(r16, () => r16.createFramebuffer(), "Unable to create WebGLFramebuffer."); } -function qf(r15, t8, e, o, n, s, a) { - let i = r15.getAttribLocation(t8, e); - return i === -1 ? false : (ce(r15, () => r15.bindBuffer(r15.ARRAY_BUFFER, o)), ce(r15, () => r15.vertexAttribPointer(i, n, r15.FLOAT, false, s, a)), ce(r15, () => r15.enableVertexAttribArray(i)), true); +function sh(r16, e, t10, o, n, s, a) { + let i = r16.getAttribLocation(e, t10); + return i === -1 ? false : (ce(r16, () => r16.bindBuffer(r16.ARRAY_BUFFER, o)), ce(r16, () => r16.vertexAttribPointer(i, n, r16.FLOAT, false, s, a)), ce(r16, () => r16.enableVertexAttribArray(i)), true); } -function CR(r15, t8, e) { - SR(r15, e), ce(r15, () => r15.activeTexture(r15.TEXTURE0 + e)), ce(r15, () => r15.bindTexture(r15.TEXTURE_2D, t8)); +function cD(r16, e, t10) { + dD(r16, t10), ce(r16, () => r16.activeTexture(r16.TEXTURE0 + t10)), ce(r16, () => r16.bindTexture(r16.TEXTURE_2D, e)); } -function tZ(r15, t8) { - SR(r15, t8), ce(r15, () => r15.activeTexture(r15.TEXTURE0 + t8)), ce(r15, () => r15.bindTexture(r15.TEXTURE_2D, null)); +function _9(r16, e) { + dD(r16, e), ce(r16, () => r16.activeTexture(r16.TEXTURE0 + e)), ce(r16, () => r16.bindTexture(r16.TEXTURE_2D, null)); } -function LI(r15, t8, e) { - return fi(r15, () => r15.getUniformLocation(t8, e), 'uniform "' + e + '" not present in program.'); +function ZI(r16, e, t10) { + return vi(r16, () => r16.getUniformLocation(e, t10), 'uniform "' + t10 + '" not present in program.'); } -function BI(r15, t8, e) { - return r15.getUniformLocation(t8, e); +function JI(r16, e, t10) { + return r16.getUniformLocation(e, t10); } -function zI(r15, t8, e, o) { - ce(r15, () => CR(r15, t8, o)), ce(r15, () => r15.uniform1i(e, o)); +function e0(r16, e, t10, o) { + ce(r16, () => cD(r16, e, o)), ce(r16, () => r16.uniform1i(t10, o)); } -function rZ(r15) { - ce(r15, () => r15.bindFramebuffer(r15.FRAMEBUFFER, null)), ce(r15, () => r15.viewport(0, 0, r15.canvas.width, r15.canvas.height)), ce(r15, () => r15.scissor(0, 0, r15.canvas.width, r15.canvas.height)); +function E9(r16) { + ce(r16, () => r16.bindFramebuffer(r16.FRAMEBUFFER, null)), ce(r16, () => r16.viewport(0, 0, r16.canvas.width, r16.canvas.height)), ce(r16, () => r16.scissor(0, 0, r16.canvas.width, r16.canvas.height)); } -function Xl(r15, t8, e) { - ce(r15, () => r15.bindFramebuffer(r15.FRAMEBUFFER, e)), ce(r15, () => r15.framebufferTexture2D(r15.FRAMEBUFFER, r15.COLOR_ATTACHMENT0, r15.TEXTURE_2D, t8, 0)); +function nm(r16, e, t10) { + ce(r16, () => r16.bindFramebuffer(r16.FRAMEBUFFER, t10)), ce(r16, () => r16.framebufferTexture2D(r16.FRAMEBUFFER, r16.COLOR_ATTACHMENT0, r16.TEXTURE_2D, e, 0)); } -function jf(r15, t8) { - ce(r15, () => r15.bindFramebuffer(r15.FRAMEBUFFER, t8)), ce(r15, () => r15.framebufferTexture2D(r15.FRAMEBUFFER, r15.COLOR_ATTACHMENT0, r15.TEXTURE_2D, null, 0)); +function ah(r16, e) { + ce(r16, () => r16.bindFramebuffer(r16.FRAMEBUFFER, e)), ce(r16, () => r16.framebufferTexture2D(r16.FRAMEBUFFER, r16.COLOR_ATTACHMENT0, r16.TEXTURE_2D, null, 0)); } -function kc(r15) { - let t8 = r15.checkFramebufferStatus(r15.FRAMEBUFFER); - if (t8 !== r15.FRAMEBUFFER_COMPLETE) - throw new Error("Error binding framebuffer: " + wR(r15, t8)); +function Dl(r16) { + let e = r16.checkFramebufferStatus(r16.FRAMEBUFFER); + if (e !== r16.FRAMEBUFFER_COMPLETE) + throw new Error("Error binding framebuffer: " + mD(r16, e)); } -function wR(r15, t8) { - switch (t8) { - case r15.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: +function mD(r16, e) { + switch (e) { + case r16.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: return "FRAMEBUFFER_INCOMPLETE_ATTACHMENT"; - case r15.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: + case r16.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: return "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"; - case r15.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: + case r16.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: return "FRAMEBUFFER_INCOMPLETE_DIMENSIONS"; - case r15.FRAMEBUFFER_UNSUPPORTED: + case r16.FRAMEBUFFER_UNSUPPORTED: return "FRAMEBUFFER_UNSUPPORTED"; default: - return `unknown error ${t8}`; + return `unknown error ${e}`; } } -function fi(r15, t8, e) { - let o = ce(r15, () => t8()); +function vi(r16, e, t10) { + let o = ce(r16, () => e()); if (o == null) - throw new Error(e); + throw new Error(t10); return o; } -function SR(r15, t8) { - let e = r15.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1, o = t8 + r15.TEXTURE0; - if (o < r15.TEXTURE0 || o > e) { - let n = `[gl.TEXTURE0, gl.TEXTURE${e}]`; +function dD(r16, e) { + let t10 = r16.MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1, o = e + r16.TEXTURE0; + if (o < r16.TEXTURE0 || o > t10) { + let n = `[gl.TEXTURE0, gl.TEXTURE${t10}]`; throw new Error(`textureUnit must be in ${n}.`); } } -function hi(r15, t8 = 2) { - return y.sizeFromShape(r15.slice(0, r15.length - t8)); +function ki(r16, e = 2) { + return y.sizeFromShape(r16.slice(0, r16.length - e)); } -function gi(r15) { - if (r15.length === 0) +function Ni(r16) { + if (r16.length === 0) throw Error("Cannot get rows and columns of an empty shape array."); - return [r15.length > 1 ? r15[r15.length - 2] : 1, r15[r15.length - 1]]; -} -function Nc(r15) { - let t8 = [1, 1, 1]; - return r15.length === 0 || r15.length === 1 && r15[0] === 1 || (t8 = [hi(r15), ...gi(r15)]), t8; -} -function VI(r15, t8 = false) { - let e = A().getNumber("WEBGL_MAX_TEXTURE_SIZE"), o = A().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE"); - o === 1 / 0 && A().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE") && (o = e / 2), t8 && (e = e * 2, o = o * 2, r15 = r15.map((i, p) => p >= r15.length - 2 ? y.nearestLargerEven(r15[p]) : r15[p]), r15.length === 1 && (r15 = [2, r15[0]])), r15.length !== 2 && (r15 = y.squeezeShape(r15).newShape); - let n = y.sizeFromShape(r15), s = null; - r15.length <= 1 && n <= e ? s = [1, n] : r15.length === 2 && r15[0] <= e && r15[1] <= e ? s = r15 : r15.length === 3 && r15[0] * r15[1] <= e && r15[2] <= e ? s = [r15[0] * r15[1], r15[2]] : r15.length === 3 && r15[0] <= e && r15[1] * r15[2] <= e ? s = [r15[0], r15[1] * r15[2]] : r15.length === 4 && r15[0] * r15[1] * r15[2] <= e && r15[3] <= e ? s = [r15[0] * r15[1] * r15[2], r15[3]] : r15.length === 4 && r15[0] <= e && r15[1] * r15[2] * r15[3] <= e && (s = [r15[0], r15[1] * r15[2] * r15[3]]); - let a = s != null && Math.max(...s) > o && Math.min(...s) <= (t8 ? 2 : 1) && Math.min(...s) > 0; + return [r16.length > 1 ? r16[r16.length - 2] : 1, r16[r16.length - 1]]; +} +function Al(r16) { + let e = [1, 1, 1]; + return r16.length === 0 || r16.length === 1 && r16[0] === 1 || (e = [ki(r16), ...Ni(r16)]), e; +} +function t0(r16, e = false) { + let t10 = A().getNumber("WEBGL_MAX_TEXTURE_SIZE"), o = A().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE"); + o === 1 / 0 && A().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE") && (o = t10 / 2), e && (t10 = t10 * 2, o = o * 2, r16 = r16.map((i, p) => p >= r16.length - 2 ? y.nearestLargerEven(r16[p]) : r16[p]), r16.length === 1 && (r16 = [2, r16[0]])), r16.length !== 2 && (r16 = y.squeezeShape(r16).newShape); + let n = y.sizeFromShape(r16), s = null; + r16.length <= 1 && n <= t10 ? s = [1, n] : r16.length === 2 && r16[0] <= t10 && r16[1] <= t10 ? s = r16 : r16.length === 3 && r16[0] * r16[1] <= t10 && r16[2] <= t10 ? s = [r16[0] * r16[1], r16[2]] : r16.length === 3 && r16[0] <= t10 && r16[1] * r16[2] <= t10 ? s = [r16[0], r16[1] * r16[2]] : r16.length === 4 && r16[0] * r16[1] * r16[2] <= t10 && r16[3] <= t10 ? s = [r16[0] * r16[1] * r16[2], r16[3]] : r16.length === 4 && r16[0] <= t10 && r16[1] * r16[2] * r16[3] <= t10 && (s = [r16[0], r16[1] * r16[2] * r16[3]]); + let a = s != null && Math.max(...s) > o && Math.min(...s) <= (e ? 2 : 1) && Math.min(...s) > 0; if (s == null || a) - if (t8) { - let i = hi(r15), p = 2, u = 2; - r15.length && ([p, u] = gi(r15)), n = i * (p / 2) * (u / 2), s = y.sizeToSquarishShape(n).map((c) => c * 2); + if (e) { + let i = ki(r16), p = 2, u = 2; + r16.length && ([p, u] = Ni(r16)), n = i * (p / 2) * (u / 2), s = y.sizeToSquarishShape(n).map((l) => l * 2); } else s = y.sizeToSquarishShape(n); return s; } -function Uf(r15) { - return r15 % 2 === 0; +function th(r16) { + return r16 % 2 === 0; } -function hu(r15, t8) { - if (r15 = r15.slice(-2), t8 = t8.slice(-2), y.arraysEqual(r15, t8) || !r15.length || !t8.length || r15[0] === 0 || r15[1] === 0 || t8[0] === 0 || t8[1] === 0) +function vu(r16, e) { + if (r16 = r16.slice(-2), e = e.slice(-2), y.arraysEqual(r16, e) || !r16.length || !e.length || r16[0] === 0 || r16[1] === 0 || e[0] === 0 || e[1] === 0) return true; - if (r15.length !== t8.length) { - let e = r15[r15.length - 1], o = t8[t8.length - 1]; - if (e === o || Uf(e) && Uf(o) && (r15[0] === 1 || t8[0] === 1)) + if (r16.length !== e.length) { + let t10 = r16[r16.length - 1], o = e[e.length - 1]; + if (t10 === o || th(t10) && th(o) && (r16[0] === 1 || e[0] === 1)) return true; } - return r15[1] === t8[1] && Uf(r15[0]) && Uf(t8[0]); + return r16[1] === e[1] && th(r16[0]) && th(e[0]); } -var Gf; -var Hf; -function WI(r15) { - if (Gf == null) { - let t8 = Hr(r15); - Gf = t8.getParameter(t8.MAX_TEXTURE_SIZE); +var rh; +var oh; +function r0(r16) { + if (rh == null) { + let e = Zr(r16); + rh = e.getParameter(e.MAX_TEXTURE_SIZE); } - return Gf; + return rh; } -function oZ() { - Gf = null; +function $9() { + rh = null; } -function nZ() { - Hf = null; +function R9() { + oh = null; } -function UI(r15) { - if (Hf == null) { - let t8 = Hr(r15); - Hf = t8.getParameter(t8.MAX_TEXTURE_IMAGE_UNITS); +function o0(r16) { + if (oh == null) { + let e = Zr(r16); + oh = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS); } - return Math.min(16, Hf); + return Math.min(16, oh); } -function GI(r15) { - if (r15 === 0) +function n0(r16) { + if (r16 === 0) return 0; - let t8, e = Hr(r15); - return Kr(e, "EXT_disjoint_timer_query_webgl2") && r15 === 2 ? t8 = 2 : Kr(e, "EXT_disjoint_timer_query") ? t8 = 1 : t8 = 0, t8; + let e, t10 = Zr(r16); + return Jr(t10, "EXT_disjoint_timer_query_webgl2") && r16 === 2 ? e = 2 : Jr(t10, "EXT_disjoint_timer_query") ? e = 1 : e = 0, e; } -function Kr(r15, t8) { - return r15.getExtension(t8) != null; +function Jr(r16, e) { + return r16.getExtension(e) != null; } -function Xf(r15) { +function ih(r16) { try { - if (Hr(r15) != null) + if (Zr(r16) != null) return true; - } catch (t8) { - return console.log("Error when getting WebGL context: ", t8), false; + } catch (e) { + return console.log("Error when getting WebGL context: ", e), false; } return false; } -function HI(r15) { - if (r15 === 0) +function s0(r16) { + if (r16 === 0) return false; - let t8 = Hr(r15); - if (r15 === 1) { - if (!Kr(t8, "OES_texture_float")) + let e = Zr(r16); + if (r16 === 1) { + if (!Jr(e, "OES_texture_float")) return false; - } else if (!Kr(t8, "EXT_color_buffer_float")) + } else if (!Jr(e, "EXT_color_buffer_float")) return false; - return TI(t8); + return VI(e); } -function KI(r15) { - if (r15 === 0) +function a0(r16) { + if (r16 === 0) return false; - let t8 = Hr(r15); - if (r15 === 1) { - if (!Kr(t8, "OES_texture_float") || !Kr(t8, "WEBGL_color_buffer_float")) + let e = Zr(r16); + if (r16 === 1) { + if (!Jr(e, "OES_texture_float") || !Jr(e, "WEBGL_color_buffer_float")) return false; } else { - if (Kr(t8, "EXT_color_buffer_float")) - return TI(t8); + if (Jr(e, "EXT_color_buffer_float")) + return VI(e); let o = "EXT_color_buffer_half_float"; - if (Kr(t8, o)) { - let n = t8.getExtension(o); - return sZ(t8, n); + if (Jr(e, o)) { + let n = e.getExtension(o); + return D9(e, n); } return false; } - return TI(t8); -} -function TI(r15) { - let t8 = ql(r15), e = r15.createTexture(); - r15.bindTexture(r15.TEXTURE_2D, e); - let o = 1, n = 1; - r15.texImage2D(r15.TEXTURE_2D, 0, t8.internalFormatFloat, o, n, 0, t8.textureFormatFloat, t8.textureTypeFloat, null); - let s = r15.createFramebuffer(); - r15.bindFramebuffer(r15.FRAMEBUFFER, s), r15.framebufferTexture2D(r15.FRAMEBUFFER, r15.COLOR_ATTACHMENT0, r15.TEXTURE_2D, e, 0); - let a = r15.checkFramebufferStatus(r15.FRAMEBUFFER) === r15.FRAMEBUFFER_COMPLETE; - return r15.bindTexture(r15.TEXTURE_2D, null), r15.bindFramebuffer(r15.FRAMEBUFFER, null), r15.deleteTexture(e), r15.deleteFramebuffer(s), a; -} -function sZ(r15, t8) { - let e = ql(r15, t8), o = r15.createTexture(); - r15.bindTexture(r15.TEXTURE_2D, o); - let n = 1, s = 1; - r15.texImage2D(r15.TEXTURE_2D, 0, e.internalFormatHalfFloat, n, s, 0, e.textureFormatFloat, e.textureTypeHalfFloat, null); - let a = r15.createFramebuffer(); - r15.bindFramebuffer(r15.FRAMEBUFFER, a), r15.framebufferTexture2D(r15.FRAMEBUFFER, r15.COLOR_ATTACHMENT0, r15.TEXTURE_2D, o, 0); - let i = r15.checkFramebufferStatus(r15.FRAMEBUFFER) === r15.FRAMEBUFFER_COMPLETE; - return r15.bindTexture(r15.TEXTURE_2D, null), r15.bindFramebuffer(r15.FRAMEBUFFER, null), r15.deleteTexture(o), r15.deleteFramebuffer(a), i; -} -function qI(r15) { - return r15 !== 2 ? false : Hr(r15).fenceSync != null; -} -function Vs(r15, t8) { - Array.isArray(r15) || (r15 = [r15]), r15.forEach((e) => { - e != null && y.assert(e.dtype !== "complex64", () => `${t8} does not support complex64 tensors in the WebGL backend.`); + return VI(e); +} +function VI(r16) { + let e = rm(r16), t10 = r16.createTexture(); + r16.bindTexture(r16.TEXTURE_2D, t10), r16.texImage2D(r16.TEXTURE_2D, 0, e.internalFormatFloat, 1, 1, 0, e.textureFormatFloat, e.textureTypeFloat, null); + let s = r16.createFramebuffer(); + r16.bindFramebuffer(r16.FRAMEBUFFER, s), r16.framebufferTexture2D(r16.FRAMEBUFFER, r16.COLOR_ATTACHMENT0, r16.TEXTURE_2D, t10, 0); + let a = r16.checkFramebufferStatus(r16.FRAMEBUFFER) === r16.FRAMEBUFFER_COMPLETE; + return r16.bindTexture(r16.TEXTURE_2D, null), r16.bindFramebuffer(r16.FRAMEBUFFER, null), r16.deleteTexture(t10), r16.deleteFramebuffer(s), a; +} +function D9(r16, e) { + let t10 = rm(r16, e), o = r16.createTexture(); + r16.bindTexture(r16.TEXTURE_2D, o), r16.texImage2D(r16.TEXTURE_2D, 0, t10.internalFormatHalfFloat, 1, 1, 0, t10.textureFormatFloat, t10.textureTypeHalfFloat, null); + let a = r16.createFramebuffer(); + r16.bindFramebuffer(r16.FRAMEBUFFER, a), r16.framebufferTexture2D(r16.FRAMEBUFFER, r16.COLOR_ATTACHMENT0, r16.TEXTURE_2D, o, 0); + let i = r16.checkFramebufferStatus(r16.FRAMEBUFFER) === r16.FRAMEBUFFER_COMPLETE; + return r16.bindTexture(r16.TEXTURE_2D, null), r16.bindFramebuffer(r16.FRAMEBUFFER, null), r16.deleteTexture(o), r16.deleteFramebuffer(a), i; +} +function i0(r16) { + return r16 !== 2 ? false : Zr(r16).fenceSync != null; +} +function Ys(r16, e) { + Array.isArray(r16) || (r16 = [r16]), r16.forEach((t10) => { + t10 != null && y.assert(t10.dtype !== "complex64", () => `${e} does not support complex64 tensors in the WebGL backend.`); }); } var Se = A(); Se.registerFlag("HAS_WEBGL", () => Se.getNumber("WEBGL_VERSION") > 0); -Se.registerFlag("WEBGL_VERSION", () => Xf(2) ? 2 : Xf(1) ? 1 : 0); +Se.registerFlag("WEBGL_VERSION", () => ih(2) ? 2 : ih(1) ? 1 : 0); Se.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS", () => false); Se.registerFlag("WEBGL_BUFFER_SUPPORTED", () => Se.get("WEBGL_VERSION") === 2); Se.registerFlag("WEBGL_CPU_FORWARD", () => true); @@ -15720,29 +15816,29 @@ Se.registerFlag("WEBGL_PACK_REDUCE", () => Se.getBool("WEBGL_PACK")); Se.registerFlag("WEBGL_LAZILY_UNPACK", () => Se.getBool("WEBGL_PACK")); Se.registerFlag("WEBGL_CONV_IM2COL", () => Se.getBool("WEBGL_PACK")); Se.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE", () => Se.getBool("WEBGL_PACK")); -Se.registerFlag("WEBGL_MAX_TEXTURE_SIZE", () => WI(Se.getNumber("WEBGL_VERSION"))); -Se.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER", () => UI(Se.getNumber("WEBGL_VERSION"))); +Se.registerFlag("WEBGL_MAX_TEXTURE_SIZE", () => r0(Se.getNumber("WEBGL_VERSION"))); +Se.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER", () => o0(Se.getNumber("WEBGL_VERSION"))); Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION", () => { - let r15 = Se.getNumber("WEBGL_VERSION"); - return r15 === 0 ? 0 : GI(r15); + let r16 = Se.getNumber("WEBGL_VERSION"); + return r16 === 0 ? 0 : n0(r16); }); -Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE", () => Se.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 && !Ji.isMobile()); -Se.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE", () => HI(Se.getNumber("WEBGL_VERSION"))); +Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE", () => Se.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 && !uu.isMobile()); +Se.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE", () => s0(Se.getNumber("WEBGL_VERSION"))); Se.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED", () => Se.getBool("WEBGL_FORCE_F16_TEXTURES") ? false : Se.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")); -Se.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED", () => KI(Se.getNumber("WEBGL_VERSION"))); -Se.registerFlag("WEBGL_FENCE_API_ENABLED", () => qI(Se.getNumber("WEBGL_VERSION"))); +Se.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED", () => a0(Se.getNumber("WEBGL_VERSION"))); +Se.registerFlag("WEBGL_FENCE_API_ENABLED", () => i0(Se.getNumber("WEBGL_VERSION"))); Se.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM", () => Se.getBool("WEBGL_RENDER_FLOAT32_ENABLED") ? 4 : 0); -Se.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD", () => -1, (r15) => { - if (typeof r15 != "number") - throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${r15}.`); - if (r15 < 0 && r15 !== -1) - throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${r15}.`); +Se.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD", () => -1, (r16) => { + if (typeof r16 != "number") + throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${r16}.`); + if (r16 < 0 && r16 !== -1) + throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${r16}.`); }); -Se.registerFlag("WEBGL_FLUSH_THRESHOLD", () => Ji.isMobile() ? 1 : -1, (r15) => { - if (typeof r15 != "number") - throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${r15}.`); - if (r15 < 0 && r15 !== -1) - throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${r15}.`); +Se.registerFlag("WEBGL_FLUSH_THRESHOLD", () => uu.isMobile() ? 1 : -1, (r16) => { + if (typeof r16 != "number") + throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${r16}.`); + if (r16 < 0 && r16 !== -1) + throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${r16}.`); }); Se.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD", () => 128); Se.registerFlag("WEBGL_USE_SHAPES_UNIFORMS", () => false); @@ -15754,9 +15850,9 @@ Se.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE", () => 1 / 0); Se.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE", () => false); Se.registerFlag("WEBGL2_ISNAN_CUSTOM", () => false); Se.registerFlag("ENGINE_COMPILE_ONLY", () => false); -function It() { - let r15, t8, e, o, n, s, a, i, p, u; - return A().getNumber("WEBGL_VERSION") === 2 ? (r15 = "#version 300 es", t8 = "in", e = "out", o = "in", n = "texture", s = "outputColor", a = "out vec4 outputColor;", i = A().getBool("WEBGL2_ISNAN_CUSTOM") ? ` +function kt() { + let r16, e, t10, o, n, s, a, i, p, u; + return A().getNumber("WEBGL_VERSION") === 2 ? (r16 = "#version 300 es", e = "in", t10 = "out", o = "in", n = "texture", s = "outputColor", a = "out vec4 outputColor;", i = A().getBool("WEBGL2_ISNAN_CUSTOM") ? ` bool isnan_custom(float val) { uint floatToUint = floatBitsToUint(val); return (floatToUint & 0x7fffffffu) > 0x7f800000u; @@ -15777,7 +15873,7 @@ function It() { ivec4 newRound(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `) : (r15 = "", t8 = "attribute", e = "varying", o = "varying", n = "texture2D", s = "gl_FragColor", a = "", i = ` + `) : (r16 = "", e = "attribute", t10 = "varying", o = "varying", n = "texture2D", s = "gl_FragColor", a = "", i = ` #define isnan(value) isnan_custom(value) bool isnan_custom(float val) { return (val > 0. || val < 1. || val == 0.) ? false : true; @@ -15802,52 +15898,52 @@ function It() { ivec4 round(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `), { version: r15, attribute: t8, varyingVs: e, varyingFs: o, texture2D: n, output: s, defineOutput: a, defineSpecialNaN: i, defineSpecialInf: p, defineRound: u }; + `), { version: r16, attribute: e, varyingVs: t10, varyingFs: o, texture2D: n, output: s, defineOutput: a, defineSpecialNaN: i, defineSpecialInf: p, defineRound: u }; } -function Ws(r15, t8, e = "index") { - let o = y.computeStrides(t8); +function Qs(r16, e, t10 = "index") { + let o = y.computeStrides(e); return o.map((n, s) => { - let a = `int ${r15[s]} = ${e} / ${n}`, i = s === o.length - 1 ? `int ${r15[s + 1]} = ${e} - ${r15[s]} * ${n}` : `index -= ${r15[s]} * ${n}`; + let a = `int ${r16[s]} = ${t10} / ${n}`, i = s === o.length - 1 ? `int ${r16[s + 1]} = ${t10} - ${r16[s]} * ${n}` : `index -= ${r16[s]} * ${n}`; return `${a}; ${i};`; }).join(""); } -function hp(r15, t8, e = "index") { - let o = y.computeStrides(t8); +function Ip(r16, e, t10 = "index") { + let o = y.computeStrides(e); return o.map((n, s) => { - let a = `int ${r15[s]} = ${e} / outShapeStrides[${s}]`, i = s === o.length - 1 ? `int ${r15[s + 1]} = ${e} - ${r15[s]} * outShapeStrides[${s}]` : `index -= ${r15[s]} * outShapeStrides[${s}]`; + let a = `int ${r16[s]} = ${t10} / outShapeStrides[${s}]`, i = s === o.length - 1 ? `int ${r16[s + 1]} = ${t10} - ${r16[s]} * outShapeStrides[${s}]` : `index -= ${r16[s]} * outShapeStrides[${s}]`; return `${a}; ${i};`; }).join(""); } -function aZ(r15, t8) { - let e = r15.length, o = r15.map((s) => `${t8}[${s}]`), n = new Array(e - 1); - n[e - 2] = o[e - 1]; - for (let s = e - 3; s >= 0; --s) +function A9(r16, e) { + let t10 = r16.length, o = r16.map((s) => `${e}[${s}]`), n = new Array(t10 - 1); + n[t10 - 2] = o[t10 - 1]; + for (let s = t10 - 3; s >= 0; --s) n[s] = `(${n[s + 1]} * ${o[s + 1]})`; return n; } -function IR(r15, t8, e = "index") { - let o = r15.map((s, a) => a), n = aZ(o, t8); +function fD(r16, e, t10 = "index") { + let o = r16.map((s, a) => a), n = A9(o, e); return n.map((s, a) => { - let i = `int ${r15[a]} = ${e} / ${n[a]}`, p = a === n.length - 1 ? `int ${r15[a + 1]} = ${e} - ${r15[a]} * ${n[a]}` : `index -= ${r15[a]} * ${n[a]}`; + let i = `int ${r16[a]} = ${t10} / ${n[a]}`, p = a === n.length - 1 ? `int ${r16[a + 1]} = ${t10} - ${r16[a]} * ${n[a]}` : `index -= ${r16[a]} * ${n[a]}`; return `${i}; ${p};`; }).join(""); } -function _c(r15) { - let t8 = y.computeStrides(r15).map((e) => e.toString()); +function Pl(r16) { + let e = y.computeStrides(r16).map((t10) => t10.toString()); return ` int getFlatIndex(ivec3 coords) { - return coords.x * ${t8[0]} + coords.y * ${t8[1]} + coords.z; + return coords.x * ${e[0]} + coords.y * ${e[1]} + coords.z; } `; } -function $c() { +function Ol() { return ` int getFlatIndex(ivec3 coords) { return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z; } `; } -var Yf = ` +var uh = ` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; @@ -15887,13 +15983,13 @@ var Yf = ` return c / 255.0; } `; -var { getBroadcastDims: vR } = w; -function kR(r15, t8, e) { +var { getBroadcastDims: hD } = C; +function gD(r16, e, t10) { let o = []; - if (r15.forEach((d) => { + if (r16.forEach((d) => { let f = y.sizeFromShape(d.shapeInfo.logicalShape); - if (d.shapeInfo.isUniform ? o.push(`uniform float ${d.name}${f > 1 ? `[${f}]` : ""};`) : (o.push(`uniform sampler2D ${d.name};`), o.push(`uniform int offset${d.name};`)), e.enableShapeUniforms) { - let { uniformShape: h } = Qf(e.packedInputs, d.shapeInfo.logicalShape, d.shapeInfo.texShape); + if (d.shapeInfo.isUniform ? o.push(`uniform float ${d.name}${f > 1 ? `[${f}]` : ""};`) : (o.push(`uniform sampler2D ${d.name};`), o.push(`uniform int offset${d.name};`)), t10.enableShapeUniforms) { + let { uniformShape: h } = ph(t10.packedInputs, d.shapeInfo.logicalShape, d.shapeInfo.texShape); switch (h.length) { case 1: o.push(`uniform int ${d.name}Shape;`); @@ -15912,8 +16008,8 @@ function kR(r15, t8, e) { } o.push(`uniform ivec2 ${d.name}TexShape;`); } - }), e.enableShapeUniforms) { - switch (t8.logicalShape.length) { + }), t10.enableShapeUniforms) { + switch (e.logicalShape.length) { case 1: o.push("uniform int outShape;"); break; @@ -15931,118 +16027,118 @@ function kR(r15, t8, e) { } o.push("uniform ivec2 outTexShape;"); } - e.customUniforms && e.customUniforms.forEach((d) => { + t10.customUniforms && t10.customUniforms.forEach((d) => { o.push(`uniform ${d.type} ${d.name}${d.arrayIndex ? `[${d.arrayIndex}]` : ""};`); }); let n = o.join(` -`), s = r15.map((d) => iZ(d, t8, e.packedInputs, e.enableShapeUniforms)).join(` -`), a = t8.texShape, i = It(), p = cZ(i), u, c, l = dZ(i); - return t8.isPacked ? (u = uZ(t8.logicalShape, a, e.enableShapeUniforms), c = mZ(i)) : (u = pZ(t8.logicalShape, a, e.enableShapeUniforms), c = lZ(i)), e.packedInputs && (l += xZ), [l, p, c, n, u, s, e.userCode].join(` +`), s = r16.map((d) => F9(d, e, t10.packedInputs, t10.enableShapeUniforms)).join(` +`), a = e.texShape, i = kt(), p = M9(i), u, l, c = z9(i); + return e.isPacked ? (u = P9(e.logicalShape, a, t10.enableShapeUniforms), l = B9(i)) : (u = O9(e.logicalShape, a, t10.enableShapeUniforms), l = L9(i)), t10.packedInputs && (c += G9), [c, p, l, n, u, s, t10.userCode].join(` `); } -function Rc(r15, t8 = false) { - let e = r15.shapeInfo.logicalShape; - switch (e.length) { +function Ll(r16, e = false) { + let t10 = r16.shapeInfo.logicalShape; + switch (t10.length) { case 0: - return $Z(r15, t8); + return rJ(r16, e); case 1: - return RZ(r15, t8); + return nJ(r16, e); case 2: - return AZ(r15, t8); + return aJ(r16, e); case 3: - return PZ(r15, t8); + return uJ(r16, e); case 4: - return MZ(r15, t8); + return lJ(r16, e); case 5: - return LZ(r15); + return cJ(r16); case 6: - return BZ(r15); + return mJ(r16); default: - throw new Error(`${e.length}-D input sampling is not yet supported`); + throw new Error(`${t10.length}-D input sampling is not yet supported`); } } -function NR(r15, t8) { - switch (r15.shapeInfo.logicalShape.length) { +function xD(r16, e) { + switch (r16.shapeInfo.logicalShape.length) { case 0: - return _Z(r15); + return tJ(r16); case 1: - return EZ(r15, t8); + return oJ(r16, e); case 2: - return DZ(r15, t8); + return sJ(r16, e); case 3: - return FZ(r15, t8); + return iJ(r16, e); default: - return OZ(r15, t8); + return pJ(r16, e); } } -function iZ(r15, t8, e = false, o) { +function F9(r16, e, t10 = false, o) { let n = ""; - e ? n += NR(r15, o) : n += Rc(r15, o); - let s = r15.shapeInfo.logicalShape, a = t8.logicalShape; - return s.length <= a.length && (e ? n += zZ(r15, t8) : n += VZ(r15, t8)), n; + t10 ? n += xD(r16, o) : n += Ll(r16, o); + let s = r16.shapeInfo.logicalShape, a = e.logicalShape; + return s.length <= a.length && (t10 ? n += dJ(r16, e) : n += fJ(r16, e)), n; } -function uZ(r15, t8, e) { - switch (r15.length) { +function P9(r16, e, t10) { + switch (r16.length) { case 0: - return TR(); + return yD(); case 1: - return yZ(r15, t8, e); + return H9(r16, e, t10); case 2: - return NZ(r15, t8, e); + return J9(r16, e, t10); case 3: - return CZ(r15, t8, e); + return q9(r16, e, t10); default: - return SZ(r15, t8, e); + return X9(r16, e, t10); } } -function pZ(r15, t8, e) { - switch (r15.length) { +function O9(r16, e, t10) { + switch (r16.length) { case 0: - return TR(); + return yD(); case 1: - return bZ(r15, t8, e); + return K9(r16, e, t10); case 2: - return TZ(r15, t8, e); + return eJ(r16, e, t10); case 3: - return wZ(r15, t8, e); + return j9(r16, e, t10); case 4: - return IZ(r15, t8, e); + return Y9(r16, e, t10); case 5: - return vZ(r15, t8); + return Q9(r16, e); case 6: - return kZ(r15, t8); + return Z9(r16, e); default: - throw new Error(`${r15.length}-D output sampling is not yet supported`); + throw new Error(`${r16.length}-D output sampling is not yet supported`); } } -function cZ(r15) { +function M9(r16) { return ` float sampleTexture(sampler2D textureSampler, vec2 uv) { - return ${r15.texture2D}(textureSampler, uv).r; + return ${r16.texture2D}(textureSampler, uv).r; } `; } -function lZ(r15) { +function L9(r16) { return ` void setOutput(float val) { - ${r15.output} = vec4(val, 0, 0, 0); + ${r16.output} = vec4(val, 0, 0, 0); } `; } -function mZ(r15) { +function B9(r16) { return ` void setOutput(vec4 val) { - ${r15.output} = val; + ${r16.output} = val; } `; } -function dZ(r15) { - return `${r15.version} +function z9(r16) { + return `${r16.version} precision highp float; precision highp int; precision highp sampler2D; - ${r15.varyingFs} vec2 resultUV; - ${r15.defineOutput} + ${r16.varyingFs} vec2 resultUV; + ${r16.defineOutput} const vec2 halfCR = vec2(0.5, 0.5); struct ivec5 @@ -16065,9 +16161,9 @@ function dZ(r15) { }; uniform float NAN; - ${r15.defineSpecialNaN} - ${r15.defineSpecialInf} - ${r15.defineRound} + ${r16.defineSpecialNaN} + ${r16.defineSpecialInf} + ${r16.defineRound} int imod(int x, int y) { return x - y * (x / y); @@ -16092,12 +16188,12 @@ function dZ(r15) { return fract((p3.x + p3.y) * p3.z); } - ${fZ} - ${hZ} - ${gZ} + ${V9} + ${W9} + ${U9} `; } -var fZ = ` +var V9 = ` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texR = index / texNumC; int texC = index - texR * texNumC; @@ -16110,7 +16206,7 @@ vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `; -var hZ = ` +var W9 = ` vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texNumC, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); @@ -16119,7 +16215,7 @@ vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `; -var gZ = ` +var U9 = ` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { @@ -16129,7 +16225,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } `; -var xZ = ` +var G9 = ` float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? @@ -16141,16 +16237,16 @@ var xZ = ` return modCoord == 0. ? frag.r : frag.g; } `; -function TR() { +function yD() { return ` int getOutputCoords() { return 0; } `; } -function yZ(r15, t8, e) { - let o = [Math.ceil(t8[0] / 2), Math.ceil(t8[1] / 2)]; - return o[0] === 1 ? e ? ` +function H9(r16, e, t10) { + let o = [Math.ceil(e[0] / 2), Math.ceil(e[1] / 2)]; + return o[0] === 1 ? t10 ? ` int getOutputCoords() { return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0)); } @@ -16158,7 +16254,7 @@ function yZ(r15, t8, e) { int getOutputCoords() { return 2 * int(resultUV.x * ${o[1]}.0); } - ` : o[1] === 1 ? e ? ` + ` : o[1] === 1 ? t10 ? ` int getOutputCoords() { return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0)); } @@ -16166,7 +16262,7 @@ function yZ(r15, t8, e) { int getOutputCoords() { return 2 * int(resultUV.y * ${o[0]}.0); } - ` : e ? ` + ` : t10 ? ` int getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); ivec2 resTexRC = ivec2(resultUV.yx * @@ -16181,24 +16277,24 @@ function yZ(r15, t8, e) { } `; } -function bZ(r15, t8, e) { - return t8[0] === 1 ? e ? ` +function K9(r16, e, t10) { + return e[0] === 1 ? t10 ? ` int getOutputCoords() { return int(resultUV.x * float(outTexShape[1])); } ` : ` int getOutputCoords() { - return int(resultUV.x * ${t8[1]}.0); + return int(resultUV.x * ${e[1]}.0); } - ` : t8[1] === 1 ? e ? ` + ` : e[1] === 1 ? t10 ? ` int getOutputCoords() { return int(resultUV.y * float(outTexShape[0])); } ` : ` int getOutputCoords() { - return int(resultUV.y * ${t8[0]}.0); + return int(resultUV.y * ${e[0]}.0); } - ` : e ? ` + ` : t10 ? ` int getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); @@ -16207,13 +16303,13 @@ function bZ(r15, t8, e) { ` : ` int getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t8[0]}, ${t8[1]})); - return resTexRC.x * ${t8[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + return resTexRC.x * ${e[1]} + resTexRC.y; } `; } -function CZ(r15, t8, e) { - if (e) +function q9(r16, e, t10) { + if (t10) return ` ivec3 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); @@ -16232,7 +16328,7 @@ function CZ(r15, t8, e) { return ivec3(b, r, c); } `; - let o = [Math.ceil(t8[0] / 2), Math.ceil(t8[1] / 2)], n = Math.ceil(r15[2] / 2), s = n * Math.ceil(r15[1] / 2); + let o = [Math.ceil(e[0] / 2), Math.ceil(e[1] / 2)], n = Math.ceil(r16[2] / 2), s = n * Math.ceil(r16[1] / 2); return ` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * @@ -16249,30 +16345,30 @@ function CZ(r15, t8, e) { } `; } -function wZ(r15, t8, e) { - if (e) +function j9(r16, e, t10) { + if (t10) return ` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); int index = resTexRC.x * outTexShape[1] + resTexRC.y; - ${hp(["r", "c", "d"], r15)} + ${Ip(["r", "c", "d"], r16)} return ivec3(r, c, d); } `; - let o = Ws(["r", "c", "d"], r15); + let o = Qs(["r", "c", "d"], r16); return ` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t8[0]}, ${t8[1]})); - int index = resTexRC.x * ${t8[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; ${o} return ivec3(r, c, d); } `; } -function SZ(r15, t8, e) { - if (e) +function X9(r16, e, t10) { + if (t10) return ` ivec4 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); @@ -16296,14 +16392,14 @@ function SZ(r15, t8, e) { return ivec4(b2, b, r, c); } `; - let o = [Math.ceil(t8[0] / 2), Math.ceil(t8[1] / 2)], n = Math.ceil(r15[r15.length - 1] / 2), s = n * Math.ceil(r15[r15.length - 2] / 2), a = s, i = "", p = "b, r, c"; - for (let u = 2; u < r15.length - 1; u++) - a *= r15[r15.length - u - 1], i = ` + let o = [Math.ceil(e[0] / 2), Math.ceil(e[1] / 2)], n = Math.ceil(r16[r16.length - 1] / 2), s = n * Math.ceil(r16[r16.length - 2] / 2), a = s, i = "", p = "b, r, c"; + for (let u = 2; u < r16.length - 1; u++) + a *= r16[r16.length - u - 1], i = ` int b${u} = index / ${a}; index -= b${u} * ${a}; ` + i, p = `b${u}, ` + p; return ` - ivec${r15.length} getOutputCoords() { + ivec${r16.length} getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${o[0]}, ${o[1]})); int index = resTexRC.x * ${o[1]} + resTexRC.y; @@ -16316,67 +16412,67 @@ function SZ(r15, t8, e) { int r = 2 * (index / ${n}); int c = imod(index, ${n}) * 2; - return ivec${r15.length}(${p}); + return ivec${r16.length}(${p}); } `; } -function IZ(r15, t8, e) { - if (e) +function Y9(r16, e, t10) { + if (t10) return ` ivec4 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); int index = resTexRC.x * outTexShape[1] + resTexRC.y; - ${hp(["r", "c", "d", "d2"], r15)} + ${Ip(["r", "c", "d", "d2"], r16)} return ivec4(r, c, d, d2); } `; - let o = Ws(["r", "c", "d", "d2"], r15); + let o = Qs(["r", "c", "d", "d2"], r16); return ` ivec4 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t8[0]}, ${t8[1]})); - int index = resTexRC.x * ${t8[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; ${o} return ivec4(r, c, d, d2); } `; } -function vZ(r15, t8) { - let e = Ws(["r", "c", "d", "d2", "d3"], r15); +function Q9(r16, e) { + let t10 = Qs(["r", "c", "d", "d2", "d3"], r16); return ` ivec5 getOutputCoords() { - ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t8[0]}, - ${t8[1]})); + ivec2 resTexRC = ivec2(resultUV.yx * vec2(${e[0]}, + ${e[1]})); - int index = resTexRC.x * ${t8[1]} + resTexRC.y; + int index = resTexRC.x * ${e[1]} + resTexRC.y; - ${e} + ${t10} ivec5 outShape = ivec5(r, c, d, d2, d3); return outShape; } `; } -function kZ(r15, t8) { - let e = Ws(["r", "c", "d", "d2", "d3", "d4"], r15); +function Z9(r16, e) { + let t10 = Qs(["r", "c", "d", "d2", "d3", "d4"], r16); return ` ivec6 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t8[0]}, ${t8[1]})); - int index = resTexRC.x * ${t8[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; - ${e} + ${t10} ivec6 result = ivec6(r, c, d, d2, d3, d4); return result; } `; } -function NZ(r15, t8, e) { - let o = [Math.ceil(t8[0] / 2), Math.ceil(t8[1] / 2)]; - if (y.arraysEqual(r15, t8)) - return e ? ` +function J9(r16, e, t10) { + let o = [Math.ceil(e[0] / 2), Math.ceil(e[1] / 2)]; + if (y.arraysEqual(r16, e)) + return t10 ? ` ivec2 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); @@ -16386,8 +16482,8 @@ function NZ(r15, t8, e) { return 2 * ivec2(resultUV.yx * vec2(${o[0]}, ${o[1]})); } `; - let n = Math.ceil(r15[1] / 2); - return e ? ` + let n = Math.ceil(r16[1] / 2); + return t10 ? ` ivec2 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); int texelsInLogicalRow = int(ceil(float(outShape[1]) / 2.0)); @@ -16413,16 +16509,16 @@ function NZ(r15, t8, e) { } `; } -function TZ(r15, t8, e) { - return y.arraysEqual(r15, t8) ? e ? ` +function eJ(r16, e, t10) { + return y.arraysEqual(r16, e) ? t10 ? ` ivec2 getOutputCoords() { return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); } ` : ` ivec2 getOutputCoords() { - return ivec2(resultUV.yx * vec2(${t8[0]}, ${t8[1]})); + return ivec2(resultUV.yx * vec2(${e[0]}, ${e[1]})); } - ` : r15[1] === 1 ? e ? ` + ` : r16[1] === 1 ? t10 ? ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); @@ -16432,11 +16528,11 @@ function TZ(r15, t8, e) { ` : ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t8[0]}, ${t8[1]})); - int index = resTexRC.x * ${t8[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; return ivec2(index, 0); } - ` : r15[0] === 1 ? e ? ` + ` : r16[0] === 1 ? t10 ? ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); @@ -16446,11 +16542,11 @@ function TZ(r15, t8, e) { ` : ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t8[0]}, ${t8[1]})); - int index = resTexRC.x * ${t8[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; return ivec2(0, index); } - ` : e ? ` + ` : t10 ? ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); @@ -16462,61 +16558,61 @@ function TZ(r15, t8, e) { ` : ` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t8[0]}, ${t8[1]})); - int index = resTexRC.x * ${t8[1]} + resTexRC.y; - int r = index / ${r15[1]}; - int c = index - r * ${r15[1]}; + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; + int r = index / ${r16[1]}; + int c = index - r * ${r16[1]}; return ivec2(r, c); } `; } -function gp(r15) { - return `offset${r15}`; +function vp(r16) { + return `offset${r16}`; } -function _Z(r15) { - let t8 = r15.name, e = "get" + t8.charAt(0).toUpperCase() + t8.slice(1), o = It(); +function tJ(r16) { + let e = r16.name, t10 = "get" + e.charAt(0).toUpperCase() + e.slice(1), o = kt(); return ` - vec4 ${e}() { - return ${o.texture2D}(${t8}, halfCR); + vec4 ${t10}() { + return ${o.texture2D}(${e}, halfCR); } `; } -function $Z(r15, t8) { - let e = r15.name, o = "get" + e.charAt(0).toUpperCase() + e.slice(1); - if (r15.shapeInfo.isUniform) - return `float ${o}() {return ${e};}`; - let [n, s] = r15.shapeInfo.texShape; +function rJ(r16, e) { + let t10 = r16.name, o = "get" + t10.charAt(0).toUpperCase() + t10.slice(1); + if (r16.shapeInfo.isUniform) + return `float ${o}() {return ${t10};}`; + let [n, s] = r16.shapeInfo.texShape; if (n === 1 && s === 1) return ` float ${o}() { - return sampleTexture(${e}, halfCR); + return sampleTexture(${t10}, halfCR); } `; - let a = gp(e); - if (t8) + let a = vp(t10); + if (e) return ` float ${o}() { - vec2 uv = uvFromFlat(${e}TexShape[0], ${e}TexShape[1], ${a}); - return sampleTexture(${e}, uv); + vec2 uv = uvFromFlat(${t10}TexShape[0], ${t10}TexShape[1], ${a}); + return sampleTexture(${t10}, uv); } `; - let [i, p] = r15.shapeInfo.texShape; + let [i, p] = r16.shapeInfo.texShape; return ` float ${o}() { vec2 uv = uvFromFlat(${i}, ${p}, ${a}); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; } -function EZ(r15, t8) { - let e = r15.name, o = "get" + e.charAt(0).toUpperCase() + e.slice(1), n = r15.shapeInfo.texShape, s = It(); - if (t8) +function oJ(r16, e) { + let t10 = r16.name, o = "get" + t10.charAt(0).toUpperCase() + t10.slice(1), n = r16.shapeInfo.texShape, s = kt(); + if (e) return ` vec4 ${o}(int index) { - ivec2 packedTexShape = ivec2(ceil(float(${e}TexShape[0]) / 2.0), ceil(float(${e}TexShape[1]) / 2.0)); + ivec2 packedTexShape = ivec2(ceil(float(${t10}TexShape[0]) / 2.0), ceil(float(${t10}TexShape[1]) / 2.0)); vec2 uv = packedUVfrom1D( packedTexShape[0], packedTexShape[1], index); - return ${s.texture2D}(${e}, uv); + return ${s.texture2D}(${t10}, uv); } `; let a = [Math.ceil(n[0] / 2), Math.ceil(n[1] / 2)]; @@ -16524,62 +16620,62 @@ function EZ(r15, t8) { vec4 ${o}(int index) { vec2 uv = packedUVfrom1D( ${a[0]}, ${a[1]}, index); - return ${s.texture2D}(${e}, uv); + return ${s.texture2D}(${t10}, uv); } `; } -function RZ(r15, t8) { - let e = r15.name, o = "get" + e.charAt(0).toUpperCase() + e.slice(1); - if (r15.shapeInfo.isUniform) +function nJ(r16, e) { + let t10 = r16.name, o = "get" + t10.charAt(0).toUpperCase() + t10.slice(1); + if (r16.shapeInfo.isUniform) return ` float ${o}(int index) { - ${Dc(r15)} + ${Bl(r16)} } `; - let n = r15.shapeInfo.texShape, s = n[0], a = n[1]; + let n = r16.shapeInfo.texShape, s = n[0], a = n[1]; if (a === 1 && s === 1) return ` float ${o}(int index) { - return sampleTexture(${e}, halfCR); + return sampleTexture(${t10}, halfCR); } `; - let i = gp(e); - return a === 1 ? t8 ? ` + let i = vp(t10); + return a === 1 ? e ? ` float ${o}(int index) { - vec2 uv = vec2(0.5, (float(index + ${i}) + 0.5) / float(${e}TexShape[0])); - return sampleTexture(${e}, uv); + vec2 uv = vec2(0.5, (float(index + ${i}) + 0.5) / float(${t10}TexShape[0])); + return sampleTexture(${t10}, uv); } ` : ` float ${o}(int index) { vec2 uv = vec2(0.5, (float(index + ${i}) + 0.5) / ${s}.0); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } - ` : s === 1 ? t8 ? ` + ` : s === 1 ? e ? ` float ${o}(int index) { - vec2 uv = vec2((float(index + ${i}) + 0.5) / float(${e}TexShape[1]), 0.5); - return sampleTexture(${e}, uv); + vec2 uv = vec2((float(index + ${i}) + 0.5) / float(${t10}TexShape[1]), 0.5); + return sampleTexture(${t10}, uv); } ` : ` float ${o}(int index) { vec2 uv = vec2((float(index + ${i}) + 0.5) / ${a}.0, 0.5); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } - ` : t8 ? ` + ` : e ? ` float ${o}(int index) { - vec2 uv = uvFromFlat(${e}TexShape[0], ${e}TexShape[1], index + ${i}); - return sampleTexture(${e}, uv); + vec2 uv = uvFromFlat(${t10}TexShape[0], ${t10}TexShape[1], index + ${i}); + return sampleTexture(${t10}, uv); } ` : ` float ${o}(int index) { vec2 uv = uvFromFlat(${s}, ${a}, index + ${i}); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; } -function DZ(r15, t8) { - let e = r15.shapeInfo.logicalShape, o = r15.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = r15.shapeInfo.texShape, a = s[0], i = s[1], p = It(); - if (s != null && y.arraysEqual(e, s)) - return t8 ? ` +function sJ(r16, e) { + let t10 = r16.shapeInfo.logicalShape, o = r16.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = r16.shapeInfo.texShape, a = s[0], i = s[1], p = kt(); + if (s != null && y.arraysEqual(t10, s)) + return e ? ` vec4 ${n}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${o}TexShape[1], ${o}TexShape[0]); @@ -16592,7 +16688,7 @@ function DZ(r15, t8) { return ${p.texture2D}(${o}, uv); } `; - if (t8) + if (e) return ` vec4 ${n}(int row, int col) { ivec2 packedTexShape = ivec2(ceil(float(${o}TexShape[0]) / 2.0), ceil(float(${o}TexShape[1]) / 2.0)); @@ -16601,18 +16697,18 @@ function DZ(r15, t8) { return ${p.texture2D}(${o}, uv); } `; - let u = [Math.ceil(s[0] / 2), Math.ceil(s[1] / 2)], c = Math.ceil(e[1] / 2); + let u = [Math.ceil(s[0] / 2), Math.ceil(s[1] / 2)], l = Math.ceil(t10[1] / 2); return ` vec4 ${n}(int row, int col) { - vec2 uv = packedUVfrom2D(${c}, ${u[0]}, ${u[1]}, row, col); + vec2 uv = packedUVfrom2D(${l}, ${u[0]}, ${u[1]}, row, col); return ${p.texture2D}(${o}, uv); } `; } -function AZ(r15, t8) { - let e = r15.shapeInfo.logicalShape, o = r15.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = r15.shapeInfo.texShape; - if (s != null && y.arraysEqual(e, s)) { - if (t8) +function aJ(r16, e) { + let t10 = r16.shapeInfo.logicalShape, o = r16.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = r16.shapeInfo.texShape; + if (s != null && y.arraysEqual(t10, s)) { + if (e) return ` float ${n}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${o}TexShape[1], ${o}TexShape[0]); @@ -16627,77 +16723,77 @@ function AZ(r15, t8) { } `; } - let { newShape: a, keptDims: i } = y.squeezeShape(e), p = a; - if (p.length < e.length) { - let m = Ac(r15, p), d = ["row", "col"]; + let { newShape: a, keptDims: i } = y.squeezeShape(t10), p = a; + if (p.length < t10.length) { + let m = zl(r16, p), d = ["row", "col"]; return ` - ${Rc(m, t8)} + ${Ll(m, e)} float ${n}(int row, int col) { - return ${n}(${Fc(d, i)}); + return ${n}(${Vl(d, i)}); } `; } - if (r15.shapeInfo.isUniform) + if (r16.shapeInfo.isUniform) return ` float ${n}(int row, int col) { - int index = round(dot(vec2(row, col), vec2(${e[1]}, 1))); - ${Dc(r15)} + int index = round(dot(vec2(row, col), vec2(${t10[1]}, 1))); + ${Bl(r16)} } `; - let u = s[0], c = s[1], l = gp(o); - return c === 1 ? t8 ? ` + let u = s[0], l = s[1], c = vp(o); + return l === 1 ? e ? ` float ${n}(int row, int col) { - float index = dot(vec3(row, col, ${l}), vec3(${o}Shape[1], 1, 1)); + float index = dot(vec3(row, col, ${c}), vec3(${o}Shape[1], 1, 1)); vec2 uv = vec2(0.5, (index + 0.5) / float(${o}TexShape[0])); return sampleTexture(${o}, uv); } ` : ` float ${n}(int row, int col) { - float index = dot(vec3(row, col, ${l}), vec3(${e[1]}, 1, 1)); + float index = dot(vec3(row, col, ${c}), vec3(${t10[1]}, 1, 1)); vec2 uv = vec2(0.5, (index + 0.5) / ${u}.0); return sampleTexture(${o}, uv); } - ` : u === 1 ? t8 ? ` + ` : u === 1 ? e ? ` float ${n}(int row, int col) { - float index = dot(vec3(row, col, ${l}), vec3(${o}Shape[1], 1, 1)); + float index = dot(vec3(row, col, ${c}), vec3(${o}Shape[1], 1, 1)); vec2 uv = vec2((index + 0.5) / float(${o}TexShape[1]), 0.5); return sampleTexture(${o}, uv); } ` : ` float ${n}(int row, int col) { - float index = dot(vec3(row, col, ${l}), vec3(${e[1]}, 1, 1)); - vec2 uv = vec2((index + 0.5) / ${c}.0, 0.5); + float index = dot(vec3(row, col, ${c}), vec3(${t10[1]}, 1, 1)); + vec2 uv = vec2((index + 0.5) / ${l}.0, 0.5); return sampleTexture(${o}, uv); } - ` : t8 ? ` + ` : e ? ` float ${n}(int row, int col) { // Explicitly use integer operations as dot() only works on floats. - int index = row * ${o}Shape[1] + col + ${l}; + int index = row * ${o}Shape[1] + col + ${c}; vec2 uv = uvFromFlat(${o}TexShape[0], ${o}TexShape[1], index); return sampleTexture(${o}, uv); } ` : ` float ${n}(int row, int col) { // Explicitly use integer operations as dot() only works on floats. - int index = row * ${e[1]} + col + ${l}; - vec2 uv = uvFromFlat(${u}, ${c}, index); + int index = row * ${t10[1]} + col + ${c}; + vec2 uv = uvFromFlat(${u}, ${l}, index); return sampleTexture(${o}, uv); } `; } -function FZ(r15, t8) { - let e = r15.shapeInfo.logicalShape, o = r15.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = r15.shapeInfo.texShape, a = [Math.ceil(s[0] / 2), Math.ceil(s[1] / 2)]; - if (e[0] === 1) { - let m = e.slice(1), d = [1, 2], f = Ac(r15, m), h = ["b", "row", "col"]; +function iJ(r16, e) { + let t10 = r16.shapeInfo.logicalShape, o = r16.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = r16.shapeInfo.texShape, a = [Math.ceil(s[0] / 2), Math.ceil(s[1] / 2)]; + if (t10[0] === 1) { + let m = t10.slice(1), d = [1, 2], f = zl(r16, m), h = ["b", "row", "col"]; return ` - ${NR(f, t8)} + ${xD(f, e)} vec4 ${n}(int b, int row, int col) { - return ${n}(${Fc(h, d)}); + return ${n}(${Vl(h, d)}); } `; } - let i = It(); - if (t8) + let i = kt(); + if (e) return ` vec4 ${n}(int b, int row, int col) { ivec2 packedTexShape = ivec2(ceil(float(${o}TexShape[0]) / 2.0), ceil(float(${o}TexShape[1]) / 2.0)); @@ -16708,37 +16804,37 @@ function FZ(r15, t8) { return ${i.texture2D}(${o}, uv); } `; - let p = a[0], u = a[1], c = Math.ceil(e[2] / 2), l = c * Math.ceil(e[1] / 2); + let p = a[0], u = a[1], l = Math.ceil(t10[2] / 2), c = l * Math.ceil(t10[1] / 2); return ` vec4 ${n}(int b, int row, int col) { vec2 uv = packedUVfrom3D( - ${p}, ${u}, ${l}, ${c}, b, row, col); + ${p}, ${u}, ${c}, ${l}, b, row, col); return ${i.texture2D}(${o}, uv); } `; } -function PZ(r15, t8) { - let e = r15.shapeInfo.logicalShape, o = r15.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = e[1] * e[2], a = e[2], { newShape: i, keptDims: p } = y.squeezeShape(e), u = i; - if (u.length < e.length) { - let h = Ac(r15, u), g = ["row", "col", "depth"]; +function uJ(r16, e) { + let t10 = r16.shapeInfo.logicalShape, o = r16.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = t10[1] * t10[2], a = t10[2], { newShape: i, keptDims: p } = y.squeezeShape(t10), u = i; + if (u.length < t10.length) { + let h = zl(r16, u), g = ["row", "col", "depth"]; return ` - ${Rc(h, t8)} + ${Ll(h, e)} float ${n}(int row, int col, int depth) { - return ${n}(${Fc(g, p)}); + return ${n}(${Vl(g, p)}); } `; } - if (r15.shapeInfo.isUniform) + if (r16.shapeInfo.isUniform) return ` float ${n}(int row, int col, int depth) { int index = round(dot(vec3(row, col, depth), vec3(${s}, ${a}, 1))); - ${Dc(r15)} + ${Bl(r16)} } `; - let c = r15.shapeInfo.texShape, l = c[0], m = c[1], d = r15.shapeInfo.flatOffset; + let l = r16.shapeInfo.texShape, c = l[0], m = l[1], d = r16.shapeInfo.flatOffset; if (m === s && d == null) - return t8 ? ` + return e ? ` float ${n}(int row, int col, int depth) { int stride1 = ${o}Shape[2]; float texR = float(row); @@ -16752,12 +16848,12 @@ function PZ(r15, t8) { float texR = float(row); float texC = dot(vec2(col, depth), vec2(${a}, 1)); vec2 uv = (vec2(texC, texR) + halfCR) / - vec2(${m}.0, ${l}.0); + vec2(${m}.0, ${c}.0); return sampleTexture(${o}, uv); } `; if (m === a && d == null) - return t8 ? ` + return e ? ` float ${n}(int row, int col, int depth) { float texR = dot(vec2(row, col), vec2(${o}Shape[1], 1)); float texC = float(depth); @@ -16766,14 +16862,14 @@ function PZ(r15, t8) { } ` : ` float ${n}(int row, int col, int depth) { - float texR = dot(vec2(row, col), vec2(${e[1]}, 1)); + float texR = dot(vec2(row, col), vec2(${t10[1]}, 1)); float texC = float(depth); - vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${m}.0, ${l}.0); + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${m}.0, ${c}.0); return sampleTexture(${o}, uv); } `; - let f = gp(o); - return t8 ? ` + let f = vp(o); + return e ? ` float ${n}(int row, int col, int depth) { // Explicitly use integer operations as dot() only works on floats. int stride0 = ${o}Shape[1] * ${o}Shape[2]; @@ -16786,62 +16882,62 @@ function PZ(r15, t8) { float ${n}(int row, int col, int depth) { // Explicitly use integer operations as dot() only works on floats. int index = row * ${s} + col * ${a} + depth + ${f}; - vec2 uv = uvFromFlat(${l}, ${m}, index); + vec2 uv = uvFromFlat(${c}, ${m}, index); return sampleTexture(${o}, uv); } `; } -function OZ(r15, t8) { - let e = r15.name, o = "get" + e.charAt(0).toUpperCase() + e.slice(1), n = It(); - if (t8) +function pJ(r16, e) { + let t10 = r16.name, o = "get" + t10.charAt(0).toUpperCase() + t10.slice(1), n = kt(); + if (e) return ` vec4 ${o}(int b2, int b, int row, int col) { - int valuesPerRow = int(ceil(float(${e}Shape[3]) / 2.0)); - int texelsInBatch = valuesPerRow * int(ceil(float(${e}Shape[2]) / 2.0)); + int valuesPerRow = int(ceil(float(${t10}Shape[3]) / 2.0)); + int texelsInBatch = valuesPerRow * int(ceil(float(${t10}Shape[2]) / 2.0)); int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2); - texelsInBatch *= ${e}Shape[1]; + texelsInBatch *= ${t10}Shape[1]; index = b2 * texelsInBatch + index; - ivec2 packedTexShape = ivec2(ceil(float(${e}TexShape[0]) / 2.0), ceil(float(${e}TexShape[1]) / 2.0)); + ivec2 packedTexShape = ivec2(ceil(float(${t10}TexShape[0]) / 2.0), ceil(float(${t10}TexShape[1]) / 2.0)); int texR = index / packedTexShape[1]; int texC = index - texR * packedTexShape[1]; - vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${n.texture2D}(${e}, uv); + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(packedTexShape[1], packedTexShape[0]); return ${n.texture2D}(${t10}, uv); } `; - let s = r15.shapeInfo.logicalShape, a = s.length, i = r15.shapeInfo.texShape, p = [Math.ceil(i[0] / 2), Math.ceil(i[1] / 2)], u = p[0], c = p[1], l = Math.ceil(s[a - 1] / 2), m = l * Math.ceil(s[a - 2] / 2), d = "int b, int row, int col", f = `b * ${m} + (row / 2) * ${l} + (col / 2)`; + let s = r16.shapeInfo.logicalShape, a = s.length, i = r16.shapeInfo.texShape, p = [Math.ceil(i[0] / 2), Math.ceil(i[1] / 2)], u = p[0], l = p[1], c = Math.ceil(s[a - 1] / 2), m = c * Math.ceil(s[a - 2] / 2), d = "int b, int row, int col", f = `b * ${m} + (row / 2) * ${c} + (col / 2)`; for (let h = 2; h < a - 1; h++) d = `int b${h}, ` + d, m *= s[a - h - 1], f = `b${h} * ${m} + ` + f; return ` vec4 ${o}(${d}) { int index = ${f}; - int texR = index / ${c}; - int texC = index - texR * ${c}; - vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${c}, ${u}); - return ${n.texture2D}(${e}, uv); + int texR = index / ${l}; + int texC = index - texR * ${l}; + vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${l}, ${u}); + return ${n.texture2D}(${t10}, uv); } `; } -function MZ(r15, t8) { - let e = r15.shapeInfo.logicalShape, o = r15.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = e[3], a = e[2] * s, i = e[1] * a, { newShape: p, keptDims: u } = y.squeezeShape(e); - if (p.length < e.length) { - let b = Ac(r15, p), C = ["row", "col", "depth", "depth2"]; +function lJ(r16, e) { + let t10 = r16.shapeInfo.logicalShape, o = r16.name, n = "get" + o.charAt(0).toUpperCase() + o.slice(1), s = t10[3], a = t10[2] * s, i = t10[1] * a, { newShape: p, keptDims: u } = y.squeezeShape(t10); + if (p.length < t10.length) { + let b = zl(r16, p), w = ["row", "col", "depth", "depth2"]; return ` - ${Rc(b, t8)} + ${Ll(b, e)} float ${n}(int row, int col, int depth, int depth2) { - return ${n}(${Fc(C, u)}); + return ${n}(${Vl(w, u)}); } `; } - if (r15.shapeInfo.isUniform) + if (r16.shapeInfo.isUniform) return ` float ${n}(int row, int col, int depth, int depth2) { int index = round(dot(vec4(row, col, depth, depth2), vec4(${i}, ${a}, ${s}, 1))); - ${Dc(r15)} + ${Bl(r16)} } `; - let c = r15.shapeInfo.flatOffset, l = r15.shapeInfo.texShape, m = l[0], d = l[1], f = `int stride2 = ${o}Shape[3];`, h = `int stride1 = ${o}Shape[2] * stride2;`, g = `int stride0 = ${o}Shape[1] * stride1;`; - if (d === i && c == null) - return t8 ? ` + let l = r16.shapeInfo.flatOffset, c = r16.shapeInfo.texShape, m = c[0], d = c[1], f = `int stride2 = ${o}Shape[3];`, h = `int stride1 = ${o}Shape[2] * stride2;`, g = `int stride0 = ${o}Shape[1] * stride1;`; + if (d === i && l == null) + return e ? ` float ${n}(int row, int col, int depth, int depth2) { ${f} ${h} @@ -16864,8 +16960,8 @@ function MZ(r15, t8) { return sampleTexture(${o}, uv); } `; - if (d === s && c == null) - return t8 ? ` + if (d === s && l == null) + return e ? ` float ${n}(int row, int col, int depth, int depth2) { float texR = dot(vec3(row, col, depth), vec3(${o}Shape[1] * ${o}Shape[2], ${o}Shape[2], 1)); @@ -16877,15 +16973,15 @@ function MZ(r15, t8) { ` : ` float ${n}(int row, int col, int depth, int depth2) { float texR = dot(vec3(row, col, depth), - vec3(${e[1] * e[2]}, ${e[2]}, 1)); + vec3(${t10[1] * t10[2]}, ${t10[2]}, 1)); float texC = float(depth2); vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}.0, ${m}.0); return sampleTexture(${o}, uv); } `; - let x = gp(o); - return t8 ? ` + let x = vp(o); + return e ? ` float ${n}(int row, int col, int depth, int depth2) { // Explicitly use integer operations as dot() only works on floats. ${f} @@ -16906,29 +17002,29 @@ function MZ(r15, t8) { } `; } -function LZ(r15) { - let t8 = r15.shapeInfo.logicalShape, e = r15.name, o = "get" + e.charAt(0).toUpperCase() + e.slice(1), n = t8[4], s = t8[3] * n, a = t8[2] * s, i = t8[1] * a, { newShape: p, keptDims: u } = y.squeezeShape(t8); - if (p.length < t8.length) { - let h = Ac(r15, p), g = ["row", "col", "depth", "depth2", "depth3"]; +function cJ(r16) { + let e = r16.shapeInfo.logicalShape, t10 = r16.name, o = "get" + t10.charAt(0).toUpperCase() + t10.slice(1), n = e[4], s = e[3] * n, a = e[2] * s, i = e[1] * a, { newShape: p, keptDims: u } = y.squeezeShape(e); + if (p.length < e.length) { + let h = zl(r16, p), g = ["row", "col", "depth", "depth2", "depth3"]; return ` - ${Rc(h)} + ${Ll(h)} float ${o}(int row, int col, int depth, int depth2, int depth3) { - return ${o}(${Fc(g, u)}); + return ${o}(${Vl(g, u)}); } `; } - if (r15.shapeInfo.isUniform) + if (r16.shapeInfo.isUniform) return ` float ${o}(int row, int col, int depth, int depth2, int depth3) { float index = dot( vec4(row, col, depth, depth2), vec4(${i}, ${a}, ${s}, ${n})) + depth3; - ${Dc(r15)} + ${Bl(r16)} } `; - let c = r15.shapeInfo.flatOffset, l = r15.shapeInfo.texShape, m = l[0], d = l[1]; - if (d === i && c == null) + let l = r16.shapeInfo.flatOffset, c = r16.shapeInfo.texShape, m = c[0], d = c[1]; + if (d === i && l == null) return ` float ${o}(int row, int col, int depth, int depth2, int depth3) { int texR = row; @@ -16936,61 +17032,61 @@ function LZ(r15) { vec4(${a}, ${s}, ${n}, 1)); vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}.0, ${m}.0); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; - if (d === n && c == null) + if (d === n && l == null) return ` float ${o}(int row, int col, int depth, int depth2, int depth3) { float texR = dot( vec4(row, col, depth, depth2), - vec4(${t8[1] * t8[2] * t8[3]}, - ${t8[2] * t8[3]}, ${t8[3]}, 1)); + vec4(${e[1] * e[2] * e[3]}, + ${e[2] * e[3]}, ${e[3]}, 1)); int texC = depth3; vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${d}.0, ${m}.0); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; - let f = gp(e); + let f = vp(t10); return ` float ${o}(int row, int col, int depth, int depth2, int depth3) { // Explicitly use integer operations as dot() only works on floats. int index = row * ${i} + col * ${a} + depth * ${s} + depth2 * ${n} + depth3 + ${f}; vec2 uv = uvFromFlat(${m}, ${d}, index); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; } -function BZ(r15) { - let t8 = r15.shapeInfo.logicalShape, e = r15.name, o = "get" + e.charAt(0).toUpperCase() + e.slice(1), { newShape: n, keptDims: s } = y.squeezeShape(t8); - if (n.length < t8.length) { - let g = Ac(r15, n), x = ["row", "col", "depth", "depth2", "depth3", "depth4"]; +function mJ(r16) { + let e = r16.shapeInfo.logicalShape, t10 = r16.name, o = "get" + t10.charAt(0).toUpperCase() + t10.slice(1), { newShape: n, keptDims: s } = y.squeezeShape(e); + if (n.length < e.length) { + let g = zl(r16, n), x = ["row", "col", "depth", "depth2", "depth3", "depth4"]; return ` - ${Rc(g)} + ${Ll(g)} float ${o}(int row, int col, int depth, int depth2, int depth3, int depth4) { - return ${o}(${Fc(x, s)}); + return ${o}(${Vl(x, s)}); } `; } - let a = t8[5], i = t8[4] * a, p = t8[3] * i, u = t8[2] * p, c = t8[1] * u; - if (r15.shapeInfo.isUniform) + let a = e[5], i = e[4] * a, p = e[3] * i, u = e[2] * p, l = e[1] * u; + if (r16.shapeInfo.isUniform) return ` float ${o}(int row, int col, int depth, int depth2, int depth3, int depth4) { int index = round(dot( vec4(row, col, depth, depth2), - vec4(${c}, ${u}, ${p}, ${i})) + + vec4(${l}, ${u}, ${p}, ${i})) + dot( vec2(depth3, depth4), vec2(${a}, 1))); - ${Dc(r15)} + ${Bl(r16)} } `; - let l = r15.shapeInfo.flatOffset, m = r15.shapeInfo.texShape, d = m[0], f = m[1]; - if (f === c && l == null) + let c = r16.shapeInfo.flatOffset, m = r16.shapeInfo.texShape, d = m[0], f = m[1]; + if (f === l && c == null) return ` float ${o}(int row, int col, int depth, int depth2, int depth3, int depth4) { @@ -17000,53 +17096,53 @@ function BZ(r15) { float(depth4); vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${f}.0, ${d}.0); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; - if (f === a && l == null) + if (f === a && c == null) return ` float ${o}(int row, int col, int depth, int depth2, int depth3, int depth4) { float texR = dot(vec4(row, col, depth, depth2), - vec4(${t8[1] * t8[2] * t8[3] * t8[4]}, - ${t8[2] * t8[3] * t8[4]}, - ${t8[3] * t8[4]}, - ${t8[4]})) + float(depth3); + vec4(${e[1] * e[2] * e[3] * e[4]}, + ${e[2] * e[3] * e[4]}, + ${e[3] * e[4]}, + ${e[4]})) + float(depth3); int texC = depth4; vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${f}.0, ${d}.0); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; - let h = gp(e); + let h = vp(t10); return ` float ${o}(int row, int col, int depth, int depth2, int depth3, int depth4) { // Explicitly use integer operations as dot() only works on floats. - int index = row * ${c} + col * ${u} + depth * ${p} + + int index = row * ${l} + col * ${u} + depth * ${p} + depth2 * ${i} + depth3 * ${a} + depth4 + ${h}; vec2 uv = uvFromFlat(${d}, ${f}, index); - return sampleTexture(${e}, uv); + return sampleTexture(${t10}, uv); } `; } -function Dc(r15) { - let t8 = r15.name, e = y.sizeFromShape(r15.shapeInfo.logicalShape); - return e < 2 ? `return ${t8};` : ` - for (int i = 0; i < ${e}; i++) { +function Bl(r16) { + let e = r16.name, t10 = y.sizeFromShape(r16.shapeInfo.logicalShape); + return t10 < 2 ? `return ${e};` : ` + for (int i = 0; i < ${t10}; i++) { if (i == index) { - return ${t8}[i]; + return ${e}[i]; } } `; } -function zZ(r15, t8) { - let e = r15.name, o = e.charAt(0).toUpperCase() + e.slice(1), n = "get" + o + "AtOutCoords", s = r15.shapeInfo.logicalShape.length, a = t8.logicalShape.length, i = vR(r15.shapeInfo.logicalShape, t8.logicalShape), p = Re(a), u = a - s, c, l = ["x", "y", "z", "w", "u", "v"]; - s === 0 ? c = "" : a < 2 && i.length >= 1 ? c = "coords = 0;" : c = i.map((b) => `coords.${l[b + u]} = 0;`).join(` +function dJ(r16, e) { + let t10 = r16.name, o = t10.charAt(0).toUpperCase() + t10.slice(1), n = "get" + o + "AtOutCoords", s = r16.shapeInfo.logicalShape.length, a = e.logicalShape.length, i = hD(r16.shapeInfo.logicalShape, e.logicalShape), p = Re(a), u = a - s, l, c = ["x", "y", "z", "w", "u", "v"]; + s === 0 ? l = "" : a < 2 && i.length >= 1 ? l = "coords = 0;" : l = i.map((b) => `coords.${c[b + u]} = 0;`).join(` `); let m = ""; - a < 2 && s > 0 ? m = "coords" : m = r15.shapeInfo.logicalShape.map((b, C) => `coords.${l[C + u]}`).join(", "); - let d = "return outputValue;", h = y.sizeFromShape(r15.shapeInfo.logicalShape) === 1, x = y.sizeFromShape(t8.logicalShape) === 1; + a < 2 && s > 0 ? m = "coords" : m = r16.shapeInfo.logicalShape.map((b, w) => `coords.${c[w + u]}`).join(", "); + let d = "return outputValue;", h = y.sizeFromShape(r16.shapeInfo.logicalShape) === 1, x = y.sizeFromShape(e.logicalShape) === 1; if (s === 1 && !h && !x) d = ` return vec4(outputValue.xy, outputValue.xy); @@ -17058,31 +17154,31 @@ function zZ(r15, t8) { return vec4(outputValue.x); `; else if (i.length) { - let b = s - 2, C = s - 1; - i.indexOf(b) > -1 && i.indexOf(C) > -1 ? d = "return vec4(outputValue.x);" : i.indexOf(b) > -1 ? d = "return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);" : i.indexOf(C) > -1 && (d = "return vec4(outputValue.xx, outputValue.zz);"); + let b = s - 2, w = s - 1; + i.indexOf(b) > -1 && i.indexOf(w) > -1 ? d = "return vec4(outputValue.x);" : i.indexOf(b) > -1 ? d = "return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);" : i.indexOf(w) > -1 && (d = "return vec4(outputValue.xx, outputValue.zz);"); } return ` vec4 ${n}() { ${p} coords = getOutputCoords(); - ${c} + ${l} vec4 outputValue = get${o}(${m}); ${d} } `; } -function VZ(r15, t8) { - let e = r15.name, o = e.charAt(0).toUpperCase() + e.slice(1), n = "get" + o + "AtOutCoords", s = t8.texShape, a = r15.shapeInfo.texShape, i = r15.shapeInfo.logicalShape.length, p = t8.logicalShape.length; - if (!r15.shapeInfo.isUniform && i === p && r15.shapeInfo.flatOffset == null && y.arraysEqual(a, s)) +function fJ(r16, e) { + let t10 = r16.name, o = t10.charAt(0).toUpperCase() + t10.slice(1), n = "get" + o + "AtOutCoords", s = e.texShape, a = r16.shapeInfo.texShape, i = r16.shapeInfo.logicalShape.length, p = e.logicalShape.length; + if (!r16.shapeInfo.isUniform && i === p && r16.shapeInfo.flatOffset == null && y.arraysEqual(a, s)) return ` float ${n}() { - return sampleTexture(${e}, resultUV); + return sampleTexture(${t10}, resultUV); } `; - let u = Re(p), c = vR(r15.shapeInfo.logicalShape, t8.logicalShape), l = p - i, m, d = ["x", "y", "z", "w", "u", "v"]; - i === 0 ? m = "" : p < 2 && c.length >= 1 ? m = "coords = 0;" : m = c.map((h) => `coords.${d[h + l]} = 0;`).join(` + let u = Re(p), l = hD(r16.shapeInfo.logicalShape, e.logicalShape), c = p - i, m, d = ["x", "y", "z", "w", "u", "v"]; + i === 0 ? m = "" : p < 2 && l.length >= 1 ? m = "coords = 0;" : m = l.map((h) => `coords.${d[h + c]} = 0;`).join(` `); let f = ""; - return p < 2 && i > 0 ? f = "coords" : f = r15.shapeInfo.logicalShape.map((h, g) => `coords.${d[g + l]}`).join(", "), ` + return p < 2 && i > 0 ? f = "coords" : f = r16.shapeInfo.logicalShape.map((h, g) => `coords.${d[g + c]}`).join(", "), ` float ${n}() { ${u} coords = getOutputCoords(); ${m} @@ -17090,197 +17186,197 @@ function VZ(r15, t8) { } `; } -function Re(r15) { - if (r15 <= 1) +function Re(r16) { + if (r16 <= 1) return "int"; - if (r15 === 2) + if (r16 === 2) return "ivec2"; - if (r15 === 3) + if (r16 === 3) return "ivec3"; - if (r15 === 4) + if (r16 === 4) return "ivec4"; - if (r15 === 5) + if (r16 === 5) return "ivec5"; - if (r15 === 6) + if (r16 === 6) return "ivec6"; - throw Error(`GPU for rank ${r15} is not yet supported`); + throw Error(`GPU for rank ${r16} is not yet supported`); } -function Qf(r15, t8, e) { - let { newShape: o, keptDims: n } = y.squeezeShape(t8), s = t8.length, a = r15 && s === 3 && t8[0] === 1, i = a ? t8.slice(1) : o, p = !r15 && s > 1 && !y.arraysEqual(t8, e) && o.length < s || a; - return { useSqueezeShape: p, uniformShape: p ? i : t8, keptDims: n }; +function ph(r16, e, t10) { + let { newShape: o, keptDims: n } = y.squeezeShape(e), s = e.length, a = r16 && s === 3 && e[0] === 1, i = a ? e.slice(1) : o, p = !r16 && s > 1 && !y.arraysEqual(e, t10) && o.length < s || a; + return { useSqueezeShape: p, uniformShape: p ? i : e, keptDims: n }; } -function Ac(r15, t8) { - let e = JSON.parse(JSON.stringify(r15)); - return e.shapeInfo.logicalShape = t8, e; +function zl(r16, e) { + let t10 = JSON.parse(JSON.stringify(r16)); + return t10.shapeInfo.logicalShape = e, t10; } -function Fc(r15, t8) { - return t8.map((e) => r15[e]).join(", "); +function Vl(r16, e) { + return e.map((t10) => r16[t10]).join(", "); } -function $R(r15, t8, e, o) { - let n = e.map((c, l) => { - let m = { logicalShape: c.shape, texShape: c.isUniform ? null : c.texData.texShape, isUniform: c.isUniform, isPacked: c.isUniform ? false : c.texData.isPacked, flatOffset: null }; - return c.texData != null && c.texData.slice != null && c.texData.slice.flatOffset > 0 && (m.flatOffset = c.texData.slice.flatOffset), { name: t8.variableNames[l], shapeInfo: m }; - }), s = n.map((c) => c.shapeInfo), a = { logicalShape: o.shape, texShape: o.texData.texShape, isUniform: false, isPacked: o.texData.isPacked, flatOffset: null }, i = kR(n, a, t8), p = EI(r15.gl, i), u = r15.createProgram(p); - return A().get("ENGINE_COMPILE_ONLY") ? { program: t8, fragmentShader: p, source: i, webGLProgram: u, inShapeInfos: s, outShapeInfo: a, variablesLocations: null, customUniformLocations: null, infLoc: null, nanLoc: null, outShapeLocation: null, outShapeStridesLocation: null, outTexShapeLocation: null } : (r15.buildVao(u), Object.assign({ program: t8, fragmentShader: p, source: i, webGLProgram: u, inShapeInfos: s, outShapeInfo: a }, jI(r15, t8, u))); +function CD(r16, e, t10, o) { + let n = t10.map((l, c) => { + let m = { logicalShape: l.shape, texShape: l.isUniform ? null : l.texData.texShape, isUniform: l.isUniform, isPacked: l.isUniform ? false : l.texData.isPacked, flatOffset: null }; + return l.texData != null && l.texData.slice != null && l.texData.slice.flatOffset > 0 && (m.flatOffset = l.texData.slice.flatOffset), { name: e.variableNames[c], shapeInfo: m }; + }), s = n.map((l) => l.shapeInfo), a = { logicalShape: o.shape, texShape: o.texData.texShape, isUniform: false, isPacked: o.texData.isPacked, flatOffset: null }, i = gD(n, a, e), p = GI(r16.gl, i), u = r16.createProgram(p); + return A().get("ENGINE_COMPILE_ONLY") ? { program: e, fragmentShader: p, source: i, webGLProgram: u, inShapeInfos: s, outShapeInfo: a, variablesLocations: null, customUniformLocations: null, infLoc: null, nanLoc: null, outShapeLocation: null, outShapeStridesLocation: null, outTexShapeLocation: null } : (r16.buildVao(u), Object.assign({ program: e, fragmentShader: p, source: i, webGLProgram: u, inShapeInfos: s, outShapeInfo: a }, u0(r16, e, u))); } -function jI(r15, t8, e) { +function u0(r16, e, t10) { let o = [], n = [], s, a, i, p = null, u = null; - u = r15.getUniformLocation(e, "NAN", false), A().getNumber("WEBGL_VERSION") === 1 && (p = r15.getUniformLocation(e, "INFINITY", false)); - let c = false; - for (let l of t8.variableNames) { - let m = { name: l, uniform: r15.getUniformLocation(e, l, c), offset: r15.getUniformLocation(e, `offset${l}`, c) }; - t8.enableShapeUniforms && (m.shape = r15.getUniformLocation(e, `${l}Shape`, c), m.texShape = r15.getUniformLocation(e, `${l}TexShape`, c)), o.push(m); - } - if (t8.enableShapeUniforms && (s = r15.getUniformLocation(e, "outShape", c), i = r15.getUniformLocation(e, "outShapeStrides", c), a = r15.getUniformLocation(e, "outTexShape", c)), t8.customUniforms) - for (let l of t8.customUniforms) - n.push(r15.getUniformLocation(e, l.name, c)); + u = r16.getUniformLocation(t10, "NAN", false), A().getNumber("WEBGL_VERSION") === 1 && (p = r16.getUniformLocation(t10, "INFINITY", false)); + let l = false; + for (let c of e.variableNames) { + let m = { name: c, uniform: r16.getUniformLocation(t10, c, l), offset: r16.getUniformLocation(t10, `offset${c}`, l) }; + e.enableShapeUniforms && (m.shape = r16.getUniformLocation(t10, `${c}Shape`, l), m.texShape = r16.getUniformLocation(t10, `${c}TexShape`, l)), o.push(m); + } + if (e.enableShapeUniforms && (s = r16.getUniformLocation(t10, "outShape", l), i = r16.getUniformLocation(t10, "outShapeStrides", l), a = r16.getUniformLocation(t10, "outTexShape", l)), e.customUniforms) + for (let c of e.customUniforms) + n.push(r16.getUniformLocation(t10, c.name, l)); return { variablesLocations: o, customUniformLocations: n, infLoc: p, nanLoc: u, outShapeLocation: s, outShapeStridesLocation: i, outTexShapeLocation: a }; } -function _R(r15, t8) { - if (r15.length !== t8.length) - throw Error(`Binary was compiled with ${r15.length} inputs, but was executed with ${t8.length} inputs`); - r15.forEach((e, o) => { - let n = e.logicalShape, s = t8[o], a = s.shape; +function bD(r16, e) { + if (r16.length !== e.length) + throw Error(`Binary was compiled with ${r16.length} inputs, but was executed with ${e.length} inputs`); + r16.forEach((t10, o) => { + let n = t10.logicalShape, s = e[o], a = s.shape; if (!y.arraysEqual(n, a)) throw Error(`Binary was compiled with different shapes than the current args. Shapes ${n} and ${a} must match`); - if (e.isUniform && s.isUniform) + if (t10.isUniform && s.isUniform) return; - let i = e.texShape, p = s.isUniform ? null : s.texData.texShape; + let i = t10.texShape, p = s.isUniform ? null : s.texData.texShape; if (!y.arraysEqual(i, p)) throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${i} and ${p} must match`); }); } -function ER(r15, t8, e, o, n) { - t8.program.enableShapeUniforms || (_R(t8.inShapeInfos, e), _R([t8.outShapeInfo], [o])); +function wD(r16, e, t10, o, n) { + e.program.enableShapeUniforms || (bD(e.inShapeInfos, t10), bD([e.outShapeInfo], [o])); let s = o.texData.texture, a = o.texData.texShape; - o.texData.isPacked ? r15.setOutputPackedMatrixTexture(s.texture, a[0], a[1]) : r15.setOutputMatrixTexture(s.texture, a[0], a[1]), r15.setProgram(t8.webGLProgram), r15.bindVertexArray(t8.webGLProgram.vao), A().getNumber("WEBGL_VERSION") === 1 && t8.infLoc !== null && r15.gl.uniform1f(t8.infLoc, 1 / 0), t8.nanLoc !== null && r15.gl.uniform1f(t8.nanLoc, NaN); - for (let p = 0; p < e.length; ++p) { - let u = e[p], { uniform: c, offset: l, shape: m, texShape: d } = t8.variablesLocations[p]; + o.texData.isPacked ? r16.setOutputPackedMatrixTexture(s.texture, a[0], a[1]) : r16.setOutputMatrixTexture(s.texture, a[0], a[1]), r16.setProgram(e.webGLProgram), r16.bindVertexArray(e.webGLProgram.vao), A().getNumber("WEBGL_VERSION") === 1 && e.infLoc !== null && r16.gl.uniform1f(e.infLoc, 1 / 0), e.nanLoc !== null && r16.gl.uniform1f(e.nanLoc, NaN); + for (let p = 0; p < t10.length; ++p) { + let u = t10[p], { uniform: l, offset: c, shape: m, texShape: d } = e.variablesLocations[p]; if (m) { - let { uniformShape: f } = Qf(t8.program.packedInputs, u.shape, u.texData.texShape); + let { uniformShape: f } = ph(e.program.packedInputs, u.shape, u.texData.texShape); switch (f.length) { case 1: - r15.gl.uniform1iv(m, new Int32Array(f)); + r16.gl.uniform1iv(m, new Int32Array(f)); break; case 2: - r15.gl.uniform2iv(m, new Int32Array(f)); + r16.gl.uniform2iv(m, new Int32Array(f)); break; case 3: - r15.gl.uniform3iv(m, new Int32Array(f)); + r16.gl.uniform3iv(m, new Int32Array(f)); break; case 4: - r15.gl.uniform4iv(m, new Int32Array(f)); + r16.gl.uniform4iv(m, new Int32Array(f)); break; default: break; } } - if (d && r15.gl.uniform2i(d, u.texData.texShape[0], u.texData.texShape[1]), c != null) { + if (d && r16.gl.uniform2i(d, u.texData.texShape[0], u.texData.texShape[1]), l != null) { if (u.isUniform) { if (y.sizeFromShape(u.shape) < 2) - r15.gl.uniform1f(c, u.uniformValues[0]); + r16.gl.uniform1f(l, u.uniformValues[0]); else { let f = u.uniformValues; - f instanceof Float32Array || (f = new Float32Array(f)), r15.gl.uniform1fv(c, f); + f instanceof Float32Array || (f = new Float32Array(f)), r16.gl.uniform1fv(l, f); } continue; } - u.texData.slice != null && l != null && r15.gl.uniform1i(l, u.texData.slice.flatOffset), r15.setInputMatrixTexture(u.texData.texture.texture, c, p); + u.texData.slice != null && c != null && r16.gl.uniform1i(c, u.texData.slice.flatOffset), r16.setInputMatrixTexture(u.texData.texture.texture, l, p); } } - let i = t8.outShapeLocation; + let i = e.outShapeLocation; if (i) switch (o.shape.length) { case 1: - r15.gl.uniform1iv(i, new Int32Array(o.shape)); + r16.gl.uniform1iv(i, new Int32Array(o.shape)); break; case 2: - r15.gl.uniform2iv(i, new Int32Array(o.shape)); + r16.gl.uniform2iv(i, new Int32Array(o.shape)); break; case 3: - r15.gl.uniform3iv(i, new Int32Array(o.shape)); + r16.gl.uniform3iv(i, new Int32Array(o.shape)); break; case 4: - r15.gl.uniform4iv(i, new Int32Array(o.shape)); + r16.gl.uniform4iv(i, new Int32Array(o.shape)); break; default: break; } - if (t8.outShapeStridesLocation) { + if (e.outShapeStridesLocation) { let p = y.computeStrides(o.shape); switch (o.shape.length) { case 2: - r15.gl.uniform1iv(t8.outShapeStridesLocation, new Int32Array(p)); + r16.gl.uniform1iv(e.outShapeStridesLocation, new Int32Array(p)); break; case 3: - r15.gl.uniform2iv(t8.outShapeStridesLocation, new Int32Array(p)); + r16.gl.uniform2iv(e.outShapeStridesLocation, new Int32Array(p)); break; case 4: - r15.gl.uniform3iv(t8.outShapeStridesLocation, new Int32Array(p)); + r16.gl.uniform3iv(e.outShapeStridesLocation, new Int32Array(p)); break; default: break; } } - if (t8.outTexShapeLocation && r15.gl.uniform2i(t8.outTexShapeLocation, o.texData.texShape[0], o.texData.texShape[1]), t8.program.customUniforms && n) - for (let p = 0; p < t8.program.customUniforms.length; ++p) { - let u = t8.program.customUniforms[p], c = t8.customUniformLocations[p], l = n[p]; + if (e.outTexShapeLocation && r16.gl.uniform2i(e.outTexShapeLocation, o.texData.texShape[0], o.texData.texShape[1]), e.program.customUniforms && n) + for (let p = 0; p < e.program.customUniforms.length; ++p) { + let u = e.program.customUniforms[p], l = e.customUniformLocations[p], c = n[p]; if (u.type === "float") - r15.gl.uniform1fv(c, l); + r16.gl.uniform1fv(l, c); else if (u.type === "vec2") - r15.gl.uniform2fv(c, l); + r16.gl.uniform2fv(l, c); else if (u.type === "vec3") - r15.gl.uniform3fv(c, l); + r16.gl.uniform3fv(l, c); else if (u.type === "vec4") - r15.gl.uniform4fv(c, l); + r16.gl.uniform4fv(l, c); else if (u.type === "int") - r15.gl.uniform1iv(c, l); + r16.gl.uniform1iv(l, c); else if (u.type === "ivec2") - r15.gl.uniform2iv(c, l); + r16.gl.uniform2iv(l, c); else if (u.type === "ivec3") - r15.gl.uniform3iv(c, l); + r16.gl.uniform3iv(l, c); else if (u.type === "ivec4") - r15.gl.uniform4iv(c, l); + r16.gl.uniform4iv(l, c); else throw Error(`uniform type ${u.type} is not supported yet.`); } - r15.executeProgram(); + r16.executeProgram(); } -function RR(r15, t8, e) { +function SD(r16, e, t10) { let o = ""; - t8.concat(e).forEach((a) => { + e.concat(t10).forEach((a) => { let i = a.texData != null && a.texData.slice != null && a.texData.slice.flatOffset > 0; - if (r15.enableShapeUniforms && !a.isUniform) { - let p = a.texData.texShape, { useSqueezeShape: u, uniformShape: c, keptDims: l } = Qf(r15.packedInputs, a.shape, p), m = "", d = "", f = ""; - if (c.length === 1 && r15.packedInputs) { + if (r16.enableShapeUniforms && !a.isUniform) { + let p = a.texData.texShape, { useSqueezeShape: u, uniformShape: l, keptDims: c } = ph(r16.packedInputs, a.shape, p), m = "", d = "", f = ""; + if (l.length === 1 && r16.packedInputs) { let k = [Math.ceil(p[0] / 2), Math.ceil(p[1] / 2)]; m = `${k[0] > 1}_${k[1] > 1}`; - } else if (c.length === 2 && !r15.packedInputs) - d = `${c[0] > 1}_${c[1] > 1}`; - else if (c.length > 2 && !r15.packedInputs) { - let k = y.computeStrides(c); + } else if (l.length === 2 && !r16.packedInputs) + d = `${l[0] > 1}_${l[1] > 1}`; + else if (l.length > 2 && !r16.packedInputs) { + let k = y.computeStrides(l); f = `${k[0] === p[1]}_${k[k.length - 1] === p[1]}`; } - let h = a.shape.length, g = c.length === 2 && y.arraysEqual(a.shape, p), x = y.sizeFromShape(a.shape) === 1, b = w.getBroadcastDims(a.shape, e.shape), C = !r15.packedInputs && h === e.shape.length && y.arraysEqual(p, e.texData.texShape), S = r15.packedInputs || c.length > 2 ? "" : `${p[0] > 1}_${p[1] > 1}`; - o += `${h}_${C}_${u ? l : ""}_${c.length}_${x}_${b}_${g}_${m}_${d}_${f}_${S}_${i}`; + let h = a.shape.length, g = l.length === 2 && y.arraysEqual(a.shape, p), x = y.sizeFromShape(a.shape) === 1, b = C.getBroadcastDims(a.shape, t10.shape), w = !r16.packedInputs && h === t10.shape.length && y.arraysEqual(p, t10.texData.texShape), S = r16.packedInputs || l.length > 2 ? "" : `${p[0] > 1}_${p[1] > 1}`; + o += `${h}_${w}_${u ? c : ""}_${l.length}_${x}_${b}_${g}_${m}_${d}_${f}_${S}_${i}`; } else { let p = a.isUniform ? "uniform" : a.texData.texShape; o += `${a.shape}_${p}_${i}`; } }); - let n = r15.userCode, s = r15.constructor.name; + let n = r16.userCode, s = r16.constructor.name; return s += "_" + o + "_" + n + `${A().getNumber("WEBGL_VERSION")}`, s; } -function ut(r15) { - return A().getBool("WEBGL_USE_SHAPES_UNIFORMS") && r15 <= 4; +function lt(r16) { + return A().getBool("WEBGL_USE_SHAPES_UNIFORMS") && r16 <= 4; } -var Zf = class { - constructor(t8) { - this.variableNames = ["A"], this.packedInputs = false, this.packedOutput = true, this.outPackingScheme = fu.DENSE, this.customUniforms = [{ name: "texShape", type: "ivec2" }]; - let e = It(); - this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length), this.userCode = ` +var lh = class { + constructor(e) { + this.variableNames = ["A"], this.packedInputs = false, this.packedOutput = true, this.outPackingScheme = Iu.DENSE, this.customUniforms = [{ name: "texShape", type: "ivec2" }]; + let t10 = kt(); + this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length), this.userCode = ` ivec3 outCoordsFromFlatIndex(int index) { - ${this.enableShapeUniforms ? hp(["r", "c", "d"], t8) : Ws(["r", "c", "d"], t8)} + ${this.enableShapeUniforms ? Ip(["r", "c", "d"], e) : Qs(["r", "c", "d"], e)} return ivec3(r, c, d); } @@ -17296,18 +17392,18 @@ var Zf = class { result[i] = getA(rc.x, rc.y, rc.z); } - ${e.output} = result; + ${t10.output} = result; } `; } }; -var Jf = class { - constructor(t8) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.outPackingScheme = fu.DENSE, this.customUniforms = [{ name: "texShape", type: "ivec2" }]; - let e = It(); - this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length), this.userCode = ` +var ch = class { + constructor(e) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.outPackingScheme = Iu.DENSE, this.customUniforms = [{ name: "texShape", type: "ivec2" }]; + let t10 = kt(); + this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length), this.userCode = ` ivec3 outCoordsFromFlatIndex(int index) { - ${this.enableShapeUniforms ? hp(["r", "c", "d"], t8) : Ws(["r", "c", "d"], t8)} + ${this.enableShapeUniforms ? Ip(["r", "c", "d"], e) : Qs(["r", "c", "d"], e)} return ivec3(r, c, d); } @@ -17323,58 +17419,58 @@ var Jf = class { result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z)); } - ${e.output} = result; + ${t10.output} = result; } `; } }; -var eh = class { - constructor(t8) { - this.variableNames = ["A"], this.outTexUsage = mr.DOWNLOAD; - let e = It(); - this.outputShape = t8, this.userCode = ` - ${Yf} +var mh = class { + constructor(e) { + this.variableNames = ["A"], this.outTexUsage = hr.DOWNLOAD; + let t10 = kt(); + this.outputShape = e, this.userCode = ` + ${uh} void main() { float x = getAAtOutCoords(); - ${e.output} = encode_float(x); + ${t10.output} = encode_float(x); } `; } }; -var th = class { - constructor(t8) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = false, this.outTexUsage = mr.DOWNLOAD; - let e = It(); - this.outputShape = t8, this.userCode = ` - ${Yf} +var dh = class { + constructor(e) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = false, this.outTexUsage = hr.DOWNLOAD; + let t10 = kt(); + this.outputShape = e, this.userCode = ` + ${uh} void main() { ivec3 coords = getOutputCoords(); float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); - ${e.output} = encode_float(x); + ${t10.output} = encode_float(x); } `; } }; -var GZ = { R: 0, G: 1, B: 2, A: 3 }; -var Yl = class { - constructor(t8, e = false, o = "RGBA") { +var xJ = { R: 0, G: 1, B: 2, A: 3 }; +var sm = class { + constructor(e, t10 = false, o = "RGBA") { this.variableNames = ["A"], this.customUniforms = [{ name: "texShape", type: "ivec2" }]; - let n = It(); - this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length); + let n = kt(); + this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length); let s = "result"; - e && (s = "floor(result * 255. + 0.5)"); + t10 && (s = "floor(result * 255. + 0.5)"); let a = ""; for (let i = 0; i < o.length; i++) { let p = o[i]; a += ` if(offset == ${i}) { - result = values[${GZ[p]}]; + result = values[${xJ[p]}]; }`; } this.userCode = ` - ${this.enableShapeUniforms ? $c() : _c(t8)} + ${this.enableShapeUniforms ? Ol() : Pl(e)} void main() { ivec3 coords = getOutputCoords(); @@ -17396,21 +17492,21 @@ var Yl = class { `; } }; -var rh = class { - constructor(t8, e = false) { +var fh = class { + constructor(e, t10 = false) { this.variableNames = ["A"], this.packedInputs = false, this.packedOutput = true, this.customUniforms = [{ name: "texShape", type: "ivec2" }]; - let o = It(); - this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length); + let o = kt(); + this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length); let n = "", s = "result"; - e && (s = "floor(result * 255. + 0.5)"); + t10 && (s = "floor(result * 255. + 0.5)"); for (let a = 0; a <= 1; a++) for (let i = 0; i <= 1; i++) { let p = a * 2 + i; n += ` localCoords = coords; - if(localCoords[2] + ${i} < ${this.enableShapeUniforms ? "outShape[2]" : `${t8[2]}`}) { + if(localCoords[2] + ${i} < ${this.enableShapeUniforms ? "outShape[2]" : `${e[2]}`}) { localCoords[2] += ${i}; - if (localCoords[1] + ${a} < ${this.enableShapeUniforms ? "outShape[1]" : `${t8[1]}`}) { + if (localCoords[1] + ${a} < ${this.enableShapeUniforms ? "outShape[1]" : `${e[1]}`}) { localCoords[1] += ${a}; flatIndex = getFlatIndex(localCoords); @@ -17437,7 +17533,7 @@ var rh = class { `; } this.userCode = ` - ${this.enableShapeUniforms ? $c() : _c(t8)} + ${this.enableShapeUniforms ? Ol() : Pl(e)} void main() { ivec3 coords = getOutputCoords(); @@ -17455,133 +17551,133 @@ var rh = class { `; } }; -var lv = {}; -qe(lv, { bindVertexProgramAttributeStreams: () => ov, createBufferFromOutputTexture: () => av, createFloat16MatrixTexture: () => JI, createFloat16PackedMatrixTexture: () => rv, createFloat32MatrixTexture: () => ZI, createIndexBuffer: () => QI, createPackedMatrixTexture: () => tv, createUnsignedBytesMatrixTexture: () => ev, createVertexBuffer: () => YI, createVertexShader: () => XI, downloadByteEncodedFloatMatrixFromOutputTexture: () => uv, downloadFloat32MatrixFromBuffer: () => iv, downloadMatrixFromPackedOutputTexture: () => cv, downloadPackedMatrixFromBuffer: () => pv, getInternalFormatForFloat16MatrixTexture: () => nh, getInternalFormatForFloat16PackedMatrixTexture: () => ih, getInternalFormatForFloat32MatrixTexture: () => oh, getInternalFormatForPackedMatrixTexture: () => ah, getInternalFormatForUnsignedBytesMatrixTexture: () => sh, uploadDenseMatrixToTexture: () => nv, uploadPixelDataToTexture: () => sv }); -function XI(r15) { - let t8 = It(), e = `${t8.version} +var k0 = {}; +qe(k0, { bindVertexProgramAttributeStreams: () => x0, createBufferFromOutputTexture: () => C0, createFloat16MatrixTexture: () => d0, createFloat16PackedMatrixTexture: () => g0, createFloat32MatrixTexture: () => m0, createIndexBuffer: () => c0, createPackedMatrixTexture: () => h0, createUnsignedBytesMatrixTexture: () => f0, createVertexBuffer: () => l0, createVertexShader: () => p0, downloadByteEncodedFloatMatrixFromOutputTexture: () => S0, downloadFloat32MatrixFromBuffer: () => w0, downloadMatrixFromPackedOutputTexture: () => v0, downloadPackedMatrixFromBuffer: () => I0, getInternalFormatForFloat16MatrixTexture: () => gh, getInternalFormatForFloat16PackedMatrixTexture: () => bh, getInternalFormatForFloat32MatrixTexture: () => hh, getInternalFormatForPackedMatrixTexture: () => yh, getInternalFormatForUnsignedBytesMatrixTexture: () => xh, uploadDenseMatrixToTexture: () => y0, uploadPixelDataToTexture: () => b0 }); +function p0(r16) { + let e = kt(), t10 = `${e.version} precision highp float; - ${t8.attribute} vec3 clipSpacePos; - ${t8.attribute} vec2 uv; - ${t8.varyingVs} vec2 resultUV; + ${e.attribute} vec3 clipSpacePos; + ${e.attribute} vec2 uv; + ${e.varyingVs} vec2 resultUV; void main() { gl_Position = vec4(clipSpacePos, 1); resultUV = uv; }`; - return $I(r15, e); + return UI(r16, t10); } -function YI(r15) { - let t8 = new Float32Array([-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]); - return AI(r15, t8); +function l0(r16) { + let e = new Float32Array([-1, 1, 0, 0, 1, -1, -1, 0, 0, 0, 1, 1, 0, 1, 1, 1, -1, 0, 1, 0]); + return qI(r16, e); } -function QI(r15) { - let t8 = new Uint16Array([0, 1, 2, 2, 1, 3]); - return FI(r15, t8); +function c0(r16) { + let e = new Uint16Array([0, 1, 2, 2, 1, 3]); + return jI(r16, e); } -function Ql(r15, t8, e, o, n, s) { - OI(t8, e); - let a = PI(r15), i = r15.TEXTURE_2D; - return ce(r15, () => r15.bindTexture(i, a)), ce(r15, () => r15.texParameteri(i, r15.TEXTURE_WRAP_S, r15.CLAMP_TO_EDGE)), ce(r15, () => r15.texParameteri(i, r15.TEXTURE_WRAP_T, r15.CLAMP_TO_EDGE)), ce(r15, () => r15.texParameteri(i, r15.TEXTURE_MIN_FILTER, r15.NEAREST)), ce(r15, () => r15.texParameteri(i, r15.TEXTURE_MAG_FILTER, r15.NEAREST)), A().getNumber("WEBGL_VERSION") === 1 ? ce(r15, () => r15.texImage2D(i, 0, o, t8, e, 0, n, s, null)) : ce(r15, () => r15.texStorage2D(i, 1, o, t8, e)), ce(r15, () => r15.bindTexture(r15.TEXTURE_2D, null)), { texture: a, texShape: [e, t8] }; +function am(r16, e, t10, o, n, s) { + YI(e, t10); + let a = XI(r16), i = r16.TEXTURE_2D; + return ce(r16, () => r16.bindTexture(i, a)), ce(r16, () => r16.texParameteri(i, r16.TEXTURE_WRAP_S, r16.CLAMP_TO_EDGE)), ce(r16, () => r16.texParameteri(i, r16.TEXTURE_WRAP_T, r16.CLAMP_TO_EDGE)), ce(r16, () => r16.texParameteri(i, r16.TEXTURE_MIN_FILTER, r16.NEAREST)), ce(r16, () => r16.texParameteri(i, r16.TEXTURE_MAG_FILTER, r16.NEAREST)), A().getNumber("WEBGL_VERSION") === 1 ? ce(r16, () => r16.texImage2D(i, 0, o, e, t10, 0, n, s, null)) : ce(r16, () => r16.texStorage2D(i, 1, o, e, t10)), ce(r16, () => r16.bindTexture(r16.TEXTURE_2D, null)), { texture: a, texShape: [t10, e] }; } -function oh(r15) { - return r15.internalFormatFloat; +function hh(r16) { + return r16.internalFormatFloat; } -function ZI(r15, t8, e, o) { - let [n, s] = fp(t8, e); - return Ql(r15, n, s, oh(o), o.textureFormatFloat, r15.FLOAT); +function m0(r16, e, t10, o) { + let [n, s] = Sp(e, t10); + return am(r16, n, s, hh(o), o.textureFormatFloat, r16.FLOAT); } -function nh(r15) { - return r15.internalFormatHalfFloat; +function gh(r16) { + return r16.internalFormatHalfFloat; } -function JI(r15, t8, e, o) { - let [n, s] = fp(t8, e); - return Ql(r15, n, s, nh(o), o.textureFormatFloat, o.textureTypeHalfFloat); +function d0(r16, e, t10, o) { + let [n, s] = Sp(e, t10); + return am(r16, n, s, gh(o), o.textureFormatFloat, o.textureTypeHalfFloat); } -function sh(r15) { - return r15.downloadTextureFormat; +function xh(r16) { + return r16.downloadTextureFormat; } -function ev(r15, t8, e, o) { - let [n, s] = fp(t8, e); - return Ql(r15, n, s, sh(o), r15.RGBA, r15.UNSIGNED_BYTE); +function f0(r16, e, t10, o) { + let [n, s] = Sp(e, t10); + return am(r16, n, s, xh(o), r16.RGBA, r16.UNSIGNED_BYTE); } -function ah(r15) { - return r15.internalFormatPackedFloat; +function yh(r16) { + return r16.internalFormatPackedFloat; } -function tv(r15, t8, e, o) { - let [n, s] = Ma(t8, e); - return Ql(r15, n, s, ah(o), r15.RGBA, r15.FLOAT); +function h0(r16, e, t10, o) { + let [n, s] = Ga(e, t10); + return am(r16, n, s, yh(o), r16.RGBA, r16.FLOAT); } -function ih(r15) { - return r15.internalFormatPackedHalfFloat; +function bh(r16) { + return r16.internalFormatPackedHalfFloat; } -function rv(r15, t8, e, o) { - let [n, s] = Ma(t8, e); - return Ql(r15, n, s, ih(o), r15.RGBA, o.textureTypeHalfFloat); +function g0(r16, e, t10, o) { + let [n, s] = Ga(e, t10); + return am(r16, n, s, bh(o), r16.RGBA, o.textureTypeHalfFloat); } -function ov(r15, t8, e) { - return ce(r15, () => r15.bindBuffer(r15.ARRAY_BUFFER, e)), qf(r15, t8, "clipSpacePos", e, 3, 20, 0) && qf(r15, t8, "uv", e, 2, 20, 12); +function x0(r16, e, t10) { + return ce(r16, () => r16.bindBuffer(r16.ARRAY_BUFFER, t10)), sh(r16, e, "clipSpacePos", t10, 3, 20, 0) && sh(r16, e, "uv", t10, 2, 20, 12); } -function nv(r15, t8, e, o, n, s) { - ce(r15, () => r15.bindTexture(r15.TEXTURE_2D, t8)); +function y0(r16, e, t10, o, n, s) { + ce(r16, () => r16.bindTexture(r16.TEXTURE_2D, e)); let a, i, p; - n instanceof Uint8Array ? (a = new Uint8Array(e * o * 4), i = r15.UNSIGNED_BYTE, p = r15.RGBA) : (a = new Float32Array(e * o * 4), i = r15.FLOAT, p = s.internalFormatPackedFloat), a.set(n), A().getNumber("WEBGL_VERSION") === 2 ? ce(r15, () => r15.texSubImage2D(r15.TEXTURE_2D, 0, 0, 0, e, o, r15.RGBA, i, a)) : ce(r15, () => r15.texImage2D(r15.TEXTURE_2D, 0, p, e, o, 0, r15.RGBA, i, a)), ce(r15, () => r15.bindTexture(r15.TEXTURE_2D, null)); + n instanceof Uint8Array ? (a = new Uint8Array(t10 * o * 4), i = r16.UNSIGNED_BYTE, p = r16.RGBA) : (a = new Float32Array(t10 * o * 4), i = r16.FLOAT, p = s.internalFormatPackedFloat), a.set(n), A().getNumber("WEBGL_VERSION") === 2 ? ce(r16, () => r16.texSubImage2D(r16.TEXTURE_2D, 0, 0, 0, t10, o, r16.RGBA, i, a)) : ce(r16, () => r16.texImage2D(r16.TEXTURE_2D, 0, p, t10, o, 0, r16.RGBA, i, a)), ce(r16, () => r16.bindTexture(r16.TEXTURE_2D, null)); } -function sv(r15, t8, e) { - ce(r15, () => r15.bindTexture(r15.TEXTURE_2D, t8)), e.data instanceof Uint8Array ? A().getNumber("WEBGL_VERSION") === 2 ? ce(r15, () => r15.texSubImage2D(r15.TEXTURE_2D, 0, 0, 0, e.width, e.height, r15.RGBA, r15.UNSIGNED_BYTE, e.data)) : ce(r15, () => r15.texImage2D(r15.TEXTURE_2D, 0, r15.RGBA, e.width, e.height, 0, r15.RGBA, r15.UNSIGNED_BYTE, e.data)) : A().getNumber("WEBGL_VERSION") === 2 ? ce(r15, () => r15.texSubImage2D(r15.TEXTURE_2D, 0, 0, 0, r15.RGBA, r15.UNSIGNED_BYTE, e)) : ce(r15, () => r15.texImage2D(r15.TEXTURE_2D, 0, r15.RGBA, r15.RGBA, r15.UNSIGNED_BYTE, e)), ce(r15, () => r15.bindTexture(r15.TEXTURE_2D, null)); +function b0(r16, e, t10) { + ce(r16, () => r16.bindTexture(r16.TEXTURE_2D, e)), t10.data instanceof Uint8Array ? A().getNumber("WEBGL_VERSION") === 2 ? ce(r16, () => r16.texSubImage2D(r16.TEXTURE_2D, 0, 0, 0, t10.width, t10.height, r16.RGBA, r16.UNSIGNED_BYTE, t10.data)) : ce(r16, () => r16.texImage2D(r16.TEXTURE_2D, 0, r16.RGBA, t10.width, t10.height, 0, r16.RGBA, r16.UNSIGNED_BYTE, t10.data)) : A().getNumber("WEBGL_VERSION") === 2 ? ce(r16, () => r16.texSubImage2D(r16.TEXTURE_2D, 0, 0, 0, r16.RGBA, r16.UNSIGNED_BYTE, t10)) : ce(r16, () => r16.texImage2D(r16.TEXTURE_2D, 0, r16.RGBA, r16.RGBA, r16.UNSIGNED_BYTE, t10)), ce(r16, () => r16.bindTexture(r16.TEXTURE_2D, null)); } -function av(r15, t8, e, o) { - let n = r15.createBuffer(); - ce(r15, () => r15.bindBuffer(r15.PIXEL_PACK_BUFFER, n)); - let i = 4 * 4 * t8 * e; - return ce(r15, () => r15.bufferData(r15.PIXEL_PACK_BUFFER, i, r15.STREAM_READ)), ce(r15, () => r15.readPixels(0, 0, e, t8, r15.RGBA, r15.FLOAT, 0)), ce(r15, () => r15.bindBuffer(r15.PIXEL_PACK_BUFFER, null)), n; +function C0(r16, e, t10, o) { + let n = r16.createBuffer(); + ce(r16, () => r16.bindBuffer(r16.PIXEL_PACK_BUFFER, n)); + let i = 4 * 4 * e * t10; + return ce(r16, () => r16.bufferData(r16.PIXEL_PACK_BUFFER, i, r16.STREAM_READ)), ce(r16, () => r16.readPixels(0, 0, t10, e, r16.RGBA, r16.FLOAT, 0)), ce(r16, () => r16.bindBuffer(r16.PIXEL_PACK_BUFFER, null)), n; } -function iv(r15, t8, e) { - let o = r15, n = new Float32Array(e); - return o.bindBuffer(o.PIXEL_PACK_BUFFER, t8), o.getBufferSubData(o.PIXEL_PACK_BUFFER, 0, n), o.bindBuffer(o.PIXEL_PACK_BUFFER, null), n; +function w0(r16, e, t10) { + let o = r16, n = new Float32Array(t10); + return o.bindBuffer(o.PIXEL_PACK_BUFFER, e), o.getBufferSubData(o.PIXEL_PACK_BUFFER, 0, n), o.bindBuffer(o.PIXEL_PACK_BUFFER, null), n; } -function uv(r15, t8, e, o) { - let [n, s] = fp(t8, e), a = 4, i = new Uint8Array(xR(t8 * e, a)); - return ce(r15, () => r15.readPixels(0, 0, n, s, o.downloadTextureFormat, r15.UNSIGNED_BYTE, i)), new Float32Array(i.buffer); +function S0(r16, e, t10, o) { + let [n, s] = Sp(e, t10), a = 4, i = new Uint8Array(uD(e * t10, a)); + return ce(r16, () => r16.readPixels(0, 0, n, s, o.downloadTextureFormat, r16.UNSIGNED_BYTE, i)), new Float32Array(i.buffer); } -function pv(r15, t8, e, o, n, s, a, i) { - let p = r15, u = new Float32Array(yR(s, a)); - return p.bindBuffer(p.PIXEL_PACK_BUFFER, t8), p.getBufferSubData(p.PIXEL_PACK_BUFFER, 0, u), p.bindBuffer(p.PIXEL_PACK_BUFFER, null), u; +function I0(r16, e, t10, o, n, s, a, i) { + let p = r16, u = new Float32Array(pD(s, a)); + return p.bindBuffer(p.PIXEL_PACK_BUFFER, e), p.getBufferSubData(p.PIXEL_PACK_BUFFER, 0, u), p.bindBuffer(p.PIXEL_PACK_BUFFER, null), u; } -function cv(r15, t8, e) { - let o = new Float32Array(t8 * e * 4); - return ce(r15, () => r15.readPixels(0, 0, e, t8, r15.RGBA, r15.FLOAT, o)), o; +function v0(r16, e, t10) { + let o = new Float32Array(e * t10 * 4); + return ce(r16, () => r16.readPixels(0, 0, t10, e, r16.RGBA, r16.FLOAT, o)), o; } -var xp = class { - constructor(t8) { +var kp = class { + constructor(e) { this.outputTexture = null, this.program = null, this.disposed = false, this.itemsToPoll = []; - let e = A().getNumber("WEBGL_VERSION"); - if (t8 != null ? (this.gl = t8, kI(e, t8)) : this.gl = Hr(e), t8 = this.gl, A().getNumber("WEBGL_VERSION") === 2) { - let s = t8; + let t10 = A().getNumber("WEBGL_VERSION"); + if (e != null ? (this.gl = e, BI(t10, e)) : this.gl = Zr(t10), e = this.gl, A().getNumber("WEBGL_VERSION") === 2) { + let s = e; this.createVertexArray = () => ce(s, () => s.createVertexArray()), this.bindVertexArray = (a) => ce(s, () => s.bindVertexArray(a)), this.deleteVertexArray = (a) => ce(s, () => s.deleteVertexArray(a)), this.getVertexArray = () => ce(s, () => s.getParameter(s.VERTEX_ARRAY_BINDING)); - } else if (t8 != null) { - let s = t8.getExtension("OES_vertex_array_object"); + } else if (e != null) { + let s = e.getExtension("OES_vertex_array_object"); if (s == null) throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object."); - this.createVertexArray = () => ce(t8, () => s.createVertexArrayOES()), this.bindVertexArray = (a) => ce(t8, () => s.bindVertexArrayOES(a)), this.deleteVertexArray = (a) => ce(t8, () => s.deleteVertexArrayOES(a)), this.getVertexArray = () => ce(t8, () => t8.getParameter(s.VERTEX_ARRAY_BINDING_OES)); + this.createVertexArray = () => ce(e, () => s.createVertexArrayOES()), this.bindVertexArray = (a) => ce(e, () => s.bindVertexArrayOES(a)), this.deleteVertexArray = (a) => ce(e, () => s.deleteVertexArrayOES(a)), this.getVertexArray = () => ce(e, () => e.getParameter(s.VERTEX_ARRAY_BINDING_OES)); } let o = "WEBGL_color_buffer_float", n = "EXT_color_buffer_half_float"; if (this.parallelCompilationExtension = this.gl.getExtension("KHR_parallel_shader_compile"), A().getNumber("WEBGL_VERSION") === 1) { let s = "OES_texture_float", a = "OES_texture_half_float"; - if (this.textureFloatExtension = vc(this.gl, s), Kr(this.gl, a)) - this.textureHalfFloatExtension = vc(this.gl, a); + if (this.textureFloatExtension = Rl(this.gl, s), Jr(this.gl, a)) + this.textureHalfFloatExtension = Rl(this.gl, a); else if (A().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(o), Kr(this.gl, n)) - this.colorBufferHalfFloatExtension = vc(this.gl, n); + if (this.colorBufferFloatExtension = this.gl.getExtension(o), Jr(this.gl, n)) + this.colorBufferHalfFloatExtension = Rl(this.gl, n); else if (A().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 (o = "EXT_color_buffer_float", Kr(this.gl, o)) + } else if (o = "EXT_color_buffer_float", Jr(this.gl, o)) this.colorBufferFloatExtension = this.gl.getExtension(o); - else if (Kr(this.gl, n)) + else if (Jr(this.gl, n)) this.colorBufferHalfFloatExtension = this.gl.getExtension(n); else throw new Error("GL context does not support color renderable floats"); - this.vertexBuffer = YI(this.gl), this.indexBuffer = QI(this.gl), this.framebuffer = MI(this.gl), this.textureConfig = ql(this.gl, this.textureHalfFloatExtension); + this.vertexBuffer = l0(this.gl), this.indexBuffer = c0(this.gl), this.framebuffer = QI(this.gl), this.textureConfig = rm(this.gl, this.textureHalfFloatExtension); } get debug() { return A().getBool("DEBUG"); @@ -17590,129 +17686,129 @@ var xp = class { 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 t8 = this.gl; - ce(t8, () => t8.finish()), ce(t8, () => t8.bindFramebuffer(t8.FRAMEBUFFER, null)), ce(t8, () => t8.deleteFramebuffer(this.framebuffer)), ce(t8, () => t8.bindBuffer(t8.ARRAY_BUFFER, null)), ce(t8, () => t8.bindBuffer(t8.ELEMENT_ARRAY_BUFFER, null)), ce(t8, () => t8.deleteBuffer(this.indexBuffer)), this.disposed = true; + let e = this.gl; + ce(e, () => e.finish()), ce(e, () => e.bindFramebuffer(e.FRAMEBUFFER, null)), ce(e, () => e.deleteFramebuffer(this.framebuffer)), ce(e, () => e.bindBuffer(e.ARRAY_BUFFER, null)), ce(e, () => e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, null)), ce(e, () => e.deleteBuffer(this.indexBuffer)), this.disposed = true; } - createFloat32MatrixTexture(t8, e) { - return this.throwIfDisposed(), ZI(this.gl, t8, e, this.textureConfig); + createFloat32MatrixTexture(e, t10) { + return this.throwIfDisposed(), m0(this.gl, e, t10, this.textureConfig); } - createFloat16MatrixTexture(t8, e) { - return this.throwIfDisposed(), JI(this.gl, t8, e, this.textureConfig); + createFloat16MatrixTexture(e, t10) { + return this.throwIfDisposed(), d0(this.gl, e, t10, this.textureConfig); } - createUnsignedBytesMatrixTexture(t8, e) { - return this.throwIfDisposed(), ev(this.gl, t8, e, this.textureConfig); + createUnsignedBytesMatrixTexture(e, t10) { + return this.throwIfDisposed(), f0(this.gl, e, t10, this.textureConfig); } - uploadPixelDataToTexture(t8, e) { - this.throwIfDisposed(), sv(this.gl, t8, e); + uploadPixelDataToTexture(e, t10) { + this.throwIfDisposed(), b0(this.gl, e, t10); } - uploadDenseMatrixToTexture(t8, e, o, n) { - this.throwIfDisposed(), nv(this.gl, t8, e, o, n, this.textureConfig); + uploadDenseMatrixToTexture(e, t10, o, n) { + this.throwIfDisposed(), y0(this.gl, e, t10, o, n, this.textureConfig); } - createFloat16PackedMatrixTexture(t8, e) { - return this.throwIfDisposed(), rv(this.gl, t8, e, this.textureConfig); + createFloat16PackedMatrixTexture(e, t10) { + return this.throwIfDisposed(), g0(this.gl, e, t10, this.textureConfig); } - createPackedMatrixTexture(t8, e) { - return this.throwIfDisposed(), tv(this.gl, t8, e, this.textureConfig); + createPackedMatrixTexture(e, t10) { + return this.throwIfDisposed(), h0(this.gl, e, t10, this.textureConfig); } - deleteMatrixTexture(t8) { - this.throwIfDisposed(), this.outputTexture === t8 && (jf(this.gl, this.framebuffer), this.outputTexture = null), ce(this.gl, () => this.gl.deleteTexture(t8)); + deleteMatrixTexture(e) { + this.throwIfDisposed(), this.outputTexture === e && (ah(this.gl, this.framebuffer), this.outputTexture = null), ce(this.gl, () => this.gl.deleteTexture(e)); } - downloadByteEncodedFloatMatrixFromOutputTexture(t8, e, o) { - return this.downloadMatrixDriver(t8, () => uv(this.gl, e, o, this.textureConfig)); + downloadByteEncodedFloatMatrixFromOutputTexture(e, t10, o) { + return this.downloadMatrixDriver(e, () => S0(this.gl, t10, o, this.textureConfig)); } - downloadPackedMatrixFromBuffer(t8, e, o, n, s, a) { - return pv(this.gl, t8, e, o, n, s, a, this.textureConfig); + downloadPackedMatrixFromBuffer(e, t10, o, n, s, a) { + return I0(this.gl, e, t10, o, n, s, a, this.textureConfig); } - downloadFloat32MatrixFromBuffer(t8, e) { - return iv(this.gl, t8, e); + downloadFloat32MatrixFromBuffer(e, t10) { + return w0(this.gl, e, t10); } - createBufferFromTexture(t8, e, o) { - this.bindTextureToFrameBuffer(t8); - let n = av(this.gl, e, o, this.textureConfig); + createBufferFromTexture(e, t10, o) { + this.bindTextureToFrameBuffer(e); + let n = C0(this.gl, t10, o, this.textureConfig); return this.unbindTextureToFrameBuffer(), n; } createAndWaitForFence() { - let t8 = this.createFence(this.gl); - return this.pollFence(t8); + let e = this.createFence(this.gl); + return this.pollFence(e); } - createFence(t8) { - let e, o; + createFence(e) { + let t10, o; if (A().getBool("WEBGL_FENCE_API_ENABLED")) { - let n = t8, s = n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE, 0); - t8.flush(), o = () => { + let n = e, s = n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE, 0); + e.flush(), o = () => { let a = n.clientWaitSync(s, 0, 0); return a === n.ALREADY_SIGNALED || a === n.CONDITION_SATISFIED; - }, e = s; + }, t10 = s; } else - A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 ? (e = this.beginQuery(), this.endQuery(), o = () => this.isQueryAvailable(e, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))) : o = () => true; - return { query: e, isFencePassed: o }; + A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") > 0 ? (t10 = this.beginQuery(), this.endQuery(), o = () => this.isQueryAvailable(t10, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))) : o = () => true; + return { query: t10, isFencePassed: o }; } - downloadMatrixFromPackedTexture(t8, e, o) { - return this.downloadMatrixDriver(t8, () => cv(this.gl, e, o)); + downloadMatrixFromPackedTexture(e, t10, o) { + return this.downloadMatrixDriver(e, () => v0(this.gl, t10, o)); } - createProgram(t8) { + createProgram(e) { this.throwIfDisposed(); - let e = this.gl; - this.vertexShader == null && (this.vertexShader = XI(e)); - let o = RI(e); - ce(e, () => e.attachShader(o, this.vertexShader)), ce(e, () => e.attachShader(o, t8)), DI(e, o); + let t10 = this.gl; + this.vertexShader == null && (this.vertexShader = p0(t10)); + let o = HI(t10); + ce(t10, () => t10.attachShader(o, this.vertexShader)), ce(t10, () => t10.attachShader(o, e)), KI(t10, o); let n = Object.assign(o, { vao: this.createVertexArray() }); - return this.debug && jl(e, n), n; + return this.debug && om(t10, n), n; } - buildVao(t8) { - this.setProgram(t8), this.bindVertexArray(t8.vao); - let e = this.gl; - ce(e, () => e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, this.indexBuffer)), ov(e, t8, this.vertexBuffer); + buildVao(e) { + this.setProgram(e), this.bindVertexArray(e.vao); + let t10 = this.gl; + ce(t10, () => t10.bindBuffer(t10.ELEMENT_ARRAY_BUFFER, this.indexBuffer)), x0(t10, e, this.vertexBuffer); } - deleteProgram(t8) { - this.throwIfDisposed(), t8 === this.program && (this.program = null), t8 != null && (ce(this.gl, () => this.gl.deleteProgram(t8)), this.deleteVertexArray(t8.vao)); + deleteProgram(e) { + this.throwIfDisposed(), e === this.program && (this.program = null), e != null && (ce(this.gl, () => this.gl.deleteProgram(e)), this.deleteVertexArray(e.vao)); } - setProgram(t8) { - this.throwIfDisposed(), this.program = t8, this.program != null && this.debug && jl(this.gl, this.program), ce(this.gl, () => this.gl.useProgram(t8)); + setProgram(e) { + this.throwIfDisposed(), this.program = e, this.program != null && this.debug && om(this.gl, this.program), ce(this.gl, () => this.gl.useProgram(e)); } - getUniformLocation(t8, e, o = true) { - return this.throwIfDisposed(), o ? LI(this.gl, t8, e) : BI(this.gl, t8, e); + getUniformLocation(e, t10, o = true) { + return this.throwIfDisposed(), o ? ZI(this.gl, e, t10) : JI(this.gl, e, t10); } - getAttributeLocation(t8, e) { - return this.throwIfDisposed(), ce(this.gl, () => this.gl.getAttribLocation(t8, e)); + getAttributeLocation(e, t10) { + return this.throwIfDisposed(), ce(this.gl, () => this.gl.getAttribLocation(e, t10)); } - getUniformLocationNoThrow(t8, e) { - return this.throwIfDisposed(), this.gl.getUniformLocation(t8, e); + getUniformLocationNoThrow(e, t10) { + return this.throwIfDisposed(), this.gl.getUniformLocation(e, t10); } - setInputMatrixTexture(t8, e, o) { - this.throwIfDisposed(), this.throwIfNoProgram(), zI(this.gl, t8, e, o); + setInputMatrixTexture(e, t10, o) { + this.throwIfDisposed(), this.throwIfNoProgram(), e0(this.gl, e, t10, o); } - setOutputMatrixTexture(t8, e, o) { - this.setOutputMatrixTextureDriver(t8, o, e); + setOutputMatrixTexture(e, t10, o) { + this.setOutputMatrixTextureDriver(e, o, t10); } - setOutputPackedMatrixTexture(t8, e, o) { + setOutputPackedMatrixTexture(e, t10, o) { this.throwIfDisposed(); - let [n, s] = Ma(e, o); - this.setOutputMatrixTextureDriver(t8, n, s); + let [n, s] = Ga(t10, o); + this.setOutputMatrixTextureDriver(e, n, s); } - setOutputMatrixWriteRegion(t8, e, o, n) { - this.setOutputMatrixWriteRegionDriver(o, t8, n, e); + setOutputMatrixWriteRegion(e, t10, o, n) { + this.setOutputMatrixWriteRegionDriver(o, e, n, t10); } - setOutputPackedMatrixWriteRegion(t8, e, o, n) { + setOutputPackedMatrixWriteRegion(e, t10, o, n) { throw new Error("setOutputPackedMatrixWriteRegion not implemented."); } debugValidate() { - this.program != null && jl(this.gl, this.program), kc(this.gl); + this.program != null && om(this.gl, this.program), Dl(this.gl); } executeProgram() { this.throwIfDisposed(), this.throwIfNoProgram(); - let t8 = this.gl; + let e = this.gl; if (this.debug) { - let e = this.getVertexArray(); - console.assert(e === this.program.vao, "VAO changed between setProgram and executeProgram!"), this.debugValidate(); + let t10 = this.getVertexArray(); + console.assert(t10 === this.program.vao, "VAO changed between setProgram and executeProgram!"), this.debugValidate(); } - ce(t8, () => t8.drawElements(t8.TRIANGLES, 6, t8.UNSIGNED_SHORT, 0)); + ce(e, () => e.drawElements(e.TRIANGLES, 6, e.UNSIGNED_SHORT, 0)); } blockUntilAllProgramsCompleted() { this.throwIfDisposed(), ce(this.gl, () => this.gl.finish()); } getQueryTimerExtension() { - return this.disjointQueryTimerExtension == null && (this.disjointQueryTimerExtension = vc(this.gl, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") === 2 ? "EXT_disjoint_timer_query_webgl2" : "EXT_disjoint_timer_query")), this.disjointQueryTimerExtension; + return this.disjointQueryTimerExtension == null && (this.disjointQueryTimerExtension = Rl(this.gl, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") === 2 ? "EXT_disjoint_timer_query_webgl2" : "EXT_disjoint_timer_query")), this.disjointQueryTimerExtension; } getQueryTimerExtensionWebGL2() { return this.getQueryTimerExtension(); @@ -17725,80 +17821,80 @@ var xp = class { let o = this.gl, n = this.getQueryTimerExtensionWebGL2(), s = o.createQuery(); return o.beginQuery(n.TIME_ELAPSED_EXT, s), s; } - let t8 = this.getQueryTimerExtensionWebGL1(), e = t8.createQueryEXT(); - return t8.beginQueryEXT(t8.TIME_ELAPSED_EXT, e), e; + let e = this.getQueryTimerExtensionWebGL1(), t10 = e.createQueryEXT(); + return e.beginQueryEXT(e.TIME_ELAPSED_EXT, t10), t10; } endQuery() { if (A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION") === 2) { - let e = this.gl, o = this.getQueryTimerExtensionWebGL2(); - e.endQuery(o.TIME_ELAPSED_EXT); + let t10 = this.gl, o = this.getQueryTimerExtensionWebGL2(); + t10.endQuery(o.TIME_ELAPSED_EXT); return; } - let t8 = this.getQueryTimerExtensionWebGL1(); - t8.endQueryEXT(t8.TIME_ELAPSED_EXT); + let e = this.getQueryTimerExtensionWebGL1(); + e.endQueryEXT(e.TIME_ELAPSED_EXT); } - async waitForQueryAndGetTime(t8) { - return await y.repeatedTry(() => this.disposed || this.isQueryAvailable(t8, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))), this.getQueryTime(t8, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")); + async waitForQueryAndGetTime(e) { + return await y.repeatedTry(() => this.disposed || this.isQueryAvailable(e, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))), this.getQueryTime(e, A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")); } - getQueryTime(t8, e) { - if (e === 0) + getQueryTime(e, t10) { + if (t10 === 0) return null; - if (e === 2) { + if (t10 === 2) { let o = this.gl; - return o.getQueryParameter(t8, o.QUERY_RESULT) / 1e6; + return o.getQueryParameter(e, o.QUERY_RESULT) / 1e6; } else { let o = this.getQueryTimerExtensionWebGL1(); - return o.getQueryObjectEXT(t8, o.QUERY_RESULT_EXT) / 1e6; + return o.getQueryObjectEXT(e, o.QUERY_RESULT_EXT) / 1e6; } } - isQueryAvailable(t8, e) { - if (e === 0) + isQueryAvailable(e, t10) { + if (t10 === 0) return true; - if (e === 2) { - let o = this.gl, n = this.getQueryTimerExtensionWebGL2(), s = o.getQueryParameter(t8, o.QUERY_RESULT_AVAILABLE); + if (t10 === 2) { + let o = this.gl, n = this.getQueryTimerExtensionWebGL2(), s = o.getQueryParameter(e, o.QUERY_RESULT_AVAILABLE); return this.disjoint == null && (this.disjoint = this.gl.getParameter(n.GPU_DISJOINT_EXT)), s && !this.disjoint; } else { - let o = this.getQueryTimerExtensionWebGL1(), n = o.getQueryObjectEXT(t8, o.QUERY_RESULT_AVAILABLE_EXT); + let o = this.getQueryTimerExtensionWebGL1(), n = o.getQueryObjectEXT(e, o.QUERY_RESULT_AVAILABLE_EXT); return this.disjoint == null && (this.disjoint = this.gl.getParameter(o.GPU_DISJOINT_EXT)), n && !this.disjoint; } } - pollFence(t8) { - return new Promise((e) => { - this.addItemToPoll(() => t8.isFencePassed(), () => e()); + pollFence(e) { + return new Promise((t10) => { + this.addItemToPoll(() => e.isFencePassed(), () => t10()); }); } pollItems() { - let t8 = HZ(this.itemsToPoll.map((e) => e.isDoneFn)); - for (let e = 0; e <= t8; ++e) { - let { resolveFn: o } = this.itemsToPoll[e]; + let e = yJ(this.itemsToPoll.map((t10) => t10.isDoneFn)); + for (let t10 = 0; t10 <= e; ++t10) { + let { resolveFn: o } = this.itemsToPoll[t10]; o(); } - this.itemsToPoll = this.itemsToPoll.slice(t8 + 1); + this.itemsToPoll = this.itemsToPoll.slice(e + 1); } - addItemToPoll(t8, e) { - if (this.itemsToPoll.push({ isDoneFn: t8, resolveFn: e }), this.itemsToPoll.length > 1) + addItemToPoll(e, t10) { + if (this.itemsToPoll.push({ isDoneFn: e, resolveFn: t10 }), this.itemsToPoll.length > 1) return; let o; "setTimeoutCustom" in A().platform && (o = A().platform.setTimeoutCustom.bind(A().platform)), y.repeatedTry(() => (this.pollItems(), this.itemsToPoll.length === 0), () => 0, null, o); } - bindTextureToFrameBuffer(t8) { - this.throwIfDisposed(), Xl(this.gl, t8, this.framebuffer), this.debug && kc(this.gl); + bindTextureToFrameBuffer(e) { + this.throwIfDisposed(), nm(this.gl, e, this.framebuffer), this.debug && Dl(this.gl); } unbindTextureToFrameBuffer() { - this.outputTexture != null ? (Xl(this.gl, this.outputTexture, this.framebuffer), this.debug && kc(this.gl)) : jf(this.gl, this.framebuffer); + this.outputTexture != null ? (nm(this.gl, this.outputTexture, this.framebuffer), this.debug && Dl(this.gl)) : ah(this.gl, this.framebuffer); } - downloadMatrixDriver(t8, e) { - this.bindTextureToFrameBuffer(t8); - let o = e(); + downloadMatrixDriver(e, t10) { + this.bindTextureToFrameBuffer(e); + let o = t10(); return this.unbindTextureToFrameBuffer(), o; } - setOutputMatrixTextureDriver(t8, e, o) { + setOutputMatrixTextureDriver(e, t10, o) { this.throwIfDisposed(); let n = this.gl; - Xl(n, t8, this.framebuffer), this.debug && kc(n), this.outputTexture = t8, ce(n, () => n.viewport(0, 0, e, o)), ce(n, () => n.scissor(0, 0, e, o)); + nm(n, e, this.framebuffer), this.debug && Dl(n), this.outputTexture = e, ce(n, () => n.viewport(0, 0, t10, o)), ce(n, () => n.scissor(0, 0, t10, o)); } - setOutputMatrixWriteRegionDriver(t8, e, o, n) { - this.throwIfDisposed(), ce(this.gl, () => this.gl.scissor(t8, e, o, n)); + setOutputMatrixWriteRegionDriver(e, t10, o, n) { + this.throwIfDisposed(), ce(this.gl, () => this.gl.scissor(e, t10, o, n)); } throwIfDisposed() { if (this.disposed) @@ -17809,37 +17905,37 @@ var xp = class { throw new Error("No GPU program is currently set."); } }; -function HZ(r15) { - let t8 = 0; - for (; t8 < r15.length && r15[t8](); ++t8) +function yJ(r16) { + let e = 0; + for (; e < r16.length && r16[e](); ++e) ; - return t8 - 1; + return e - 1; } -var { addImpl: DR, bincountImpl: uh, bincountReduceImpl: AR, bitwiseAndImpl: FR, castImpl: PR, ceilImpl: OR, concatImpl: MR, equalImpl: LR, expImpl: BR, expm1Impl: zR, floorImpl: VR, gatherNdImpl: WR, gatherV2Impl: UR, greaterImpl: GR, greaterEqualImpl: HR, lessImpl: KR, lessEqualImpl: qR, linSpaceImpl: jR, logImpl: XR, maxImpl: YR, maximumImpl: QR, minimumImpl: ZR, multiplyImpl: JR, negImpl: eD, notEqualImpl: tD, prodImpl: rD, raggedGatherImpl: oD, raggedRangeImpl: nD, raggedTensorToTensorImpl: sD, rangeImpl: aD, rsqrtImpl: iD, scatterImpl: uD, sigmoidImpl: pD, simpleAbsImpl: ph, sliceImpl: cD, sparseFillEmptyRowsImpl: lD, sparseReshapeImpl: mD, sparseSegmentReductionImpl: ch, sqrtImpl: dD, staticRegexReplaceImpl: fD, stridedSliceImpl: hD, stringNGramsImpl: gD, stringSplitImpl: xD, stringToHashBucketFastImpl: yD, subImpl: bD, tileImpl: CD, topKImpl: wD, transposeImpl: yp, uniqueImpl: SD } = wc; -function mv(r15, t8) { - return ["x", "y", "z", "w", "u", "v"].slice(0, t8).map((e) => `${r15}.${e}`); +var { addImpl: ID, bincountImpl: Ch, bincountReduceImpl: vD, bitwiseAndImpl: kD, castImpl: ND, ceilImpl: TD, concatImpl: _D, equalImpl: ED, expImpl: $D, expm1Impl: RD, floorImpl: DD, gatherNdImpl: AD, gatherV2Impl: FD, greaterImpl: PD, greaterEqualImpl: OD, lessImpl: MD, lessEqualImpl: LD, linSpaceImpl: BD, logImpl: zD, maxImpl: VD, maximumImpl: WD, minimumImpl: UD, multiplyImpl: GD, negImpl: HD, notEqualImpl: KD, prodImpl: qD, raggedGatherImpl: jD, raggedRangeImpl: XD, raggedTensorToTensorImpl: YD, rangeImpl: QD, rsqrtImpl: ZD, scatterImpl: JD, sigmoidImpl: eA, simpleAbsImpl: wh, sliceImpl: tA, sparseFillEmptyRowsImpl: rA, sparseReshapeImpl: oA, sparseSegmentReductionImpl: Sh, sqrtImpl: nA, staticRegexReplaceImpl: sA, stridedSliceImpl: aA, stringNGramsImpl: iA, stringSplitImpl: uA, stringToHashBucketFastImpl: pA, subImpl: lA, tileImpl: cA, topKImpl: mA, transposeImpl: Np, uniqueImpl: dA } = Xf; +function N0(r16, e) { + return ["x", "y", "z", "w", "u", "v"].slice(0, e).map((t10) => `${r16}.${t10}`); } -function Rt(r15, t8) { - return t8 === 1 ? [r15] : mv(r15, t8); +function At(r16, e) { + return e === 1 ? [r16] : N0(r16, e); } -function ID(r15, t8) { - if (r15 === 1) +function fA(r16, e) { + if (r16 === 1) return "rc"; - let e = ""; - for (let o = 0; o < r15; o++) - e += t8[o], o < r15 - 1 && (e += ","); - return e; -} -var lh = class { - constructor(t8) { - if (this.variableNames = ["A"], this.packedInputs = false, this.packedOutput = true, this.outputShape = t8, this.rank = t8.length, this.enableShapeUniforms = ut(this.outputShape.length), this.rank === 0) + let t10 = ""; + for (let o = 0; o < r16; o++) + t10 += e[o], o < r16 - 1 && (t10 += ","); + return t10; +} +var Ih = class { + constructor(e) { + if (this.variableNames = ["A"], this.packedInputs = false, this.packedOutput = true, this.outputShape = e, this.rank = e.length, this.enableShapeUniforms = lt(this.outputShape.length), this.rank === 0) this.userCode = ` void main() { setOutput(vec4(getA(), 0., 0., 0.)); } `; else { - let e = Rt("rc", this.rank), o = Re(this.rank), n = this.getOutOfBoundsCondition(e), s = this.getSetup(e), a = this.getOutput(e); + let t10 = At("rc", this.rank), o = Re(this.rank), n = this.getOutOfBoundsCondition(t10), s = this.getSetup(t10), a = this.getOutput(t10); this.userCode = ` void main() { ${o} rc = getOutputCoords(); @@ -17855,32 +17951,32 @@ var lh = class { `; } } - getSourceCoordsArr(t8) { - let e = []; + getSourceCoordsArr(e) { + let t10 = []; for (let o = 0; o <= 1; o++) for (let n = 0; n <= 1; n++) { let s = `${o === 0 ? "r" : "rp1"}, ${n === 0 ? "c" : "cp1"}`; for (let a = 2; a < this.rank; a++) - s = `${t8[t8.length - 1 - a]},` + s; - e.push(s); + s = `${e[e.length - 1 - a]},` + s; + t10.push(s); } - return e; + return t10; } - getOutOfBoundsCondition(t8) { + getOutOfBoundsCondition(e) { if (this.rank === 1) return `rc > ${this.enableShapeUniforms ? "outShape" : this.outputShape[0]}`; - let e = ""; + let t10 = ""; for (let o = this.rank - 2; o < this.rank; o++) - e += `${t8[o]} >= ${this.enableShapeUniforms ? `outShape[${o}]` : this.outputShape[o]}`, o < this.rank - 1 && (e += "||"); - return e; + t10 += `${e[o]} >= ${this.enableShapeUniforms ? `outShape[${o}]` : this.outputShape[o]}`, o < this.rank - 1 && (t10 += "||"); + return t10; } - getSetup(t8) { + getSetup(e) { if (this.rank === 1) return ""; - let e = t8.slice(-2), o = this.enableShapeUniforms ? `outShape[${this.rank} - 1]` : this.outputShape[this.rank - 1], n = this.enableShapeUniforms ? `outShape[${this.rank} - 2]` : this.outputShape[this.rank - 2]; + let t10 = e.slice(-2), o = this.enableShapeUniforms ? `outShape[${this.rank} - 1]` : this.outputShape[this.rank - 1], n = this.enableShapeUniforms ? `outShape[${this.rank} - 2]` : this.outputShape[this.rank - 2]; return ` - int r = ${e[0]}; - int c = ${e[1]}; + int r = ${t10[0]}; + int c = ${t10[1]}; int rp1 = r + 1; int cp1 = c + 1; @@ -17888,17 +17984,17 @@ var lh = class { bool rEdge = rp1 >= ${n}; `; } - getOutput(t8) { - let e = this.getSourceCoordsArr(t8); - return this.rank === 1 ? `getA(rc), (rc + 1 >= ${this.enableShapeUniforms ? "outShape" : this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0` : `getA(${e[0]}), - cEdge ? 0. : getA(${e[1]}), - rEdge ? 0. : getA(${e[2]}), - rEdge || cEdge ? 0. : getA(${e[3]})`; + getOutput(e) { + let t10 = this.getSourceCoordsArr(e); + return this.rank === 1 ? `getA(rc), (rc + 1 >= ${this.enableShapeUniforms ? "outShape" : this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0` : `getA(${t10[0]}), + cEdge ? 0. : getA(${t10[1]}), + rEdge ? 0. : getA(${t10[2]}), + rEdge || cEdge ? 0. : getA(${t10[3]})`; } }; -var Pc = class { - constructor(t8, e) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "inputShape", type: "ivec3" }], this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length); +var Wl = class { + constructor(e, t10) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "inputShape", type: "ivec3" }], this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length); let o = ""; for (let n = 0; n < 4; n++) { let s = "thisRC = rc;"; @@ -17916,8 +18012,8 @@ var Pc = class { `; } this.userCode = ` - ${KZ(e, this.enableShapeUniforms)} - ${this.enableShapeUniforms ? $c() : _c(t8)} + ${bJ(t10, this.enableShapeUniforms)} + ${this.enableShapeUniforms ? Ol() : Pl(e)} void main() { ivec3 rc = getOutputCoords(); @@ -17925,8 +18021,8 @@ var Pc = class { vec4 result = vec4(0.); ivec3 thisRC; - int rows = ${this.enableShapeUniforms ? "outShape[1]" : t8[1]}; - int cols = ${this.enableShapeUniforms ? "outShape[2]" : t8[2]}; + int rows = ${this.enableShapeUniforms ? "outShape[1]" : e[1]}; + int cols = ${this.enableShapeUniforms ? "outShape[2]" : e[2]}; ${o} @@ -17935,49 +18031,49 @@ var Pc = class { `; } }; -function KZ(r15, t8) { +function bJ(r16, e) { return ` ivec3 inputCoordsFromReshapedOutCoords(int index) { - ${t8 ? IR(["r", "c", "d"], "inputShape") : Ws(["r", "c", "d"], r15)} + ${e ? fD(["r", "c", "d"], "inputShape") : Qs(["r", "c", "d"], r16)} return ivec3(r, c, d); } `; } -var mh = class { - constructor(t8) { - this.gpgpu = t8, this.numUsedTextures = 0, this.numFreeTextures = 0, this._numBytesAllocated = 0, this._numBytesFree = 0, this.freeTextures = {}, this.usedTextures = {}, this.logEnabled = false; +var vh = class { + constructor(e) { + this.gpgpu = e, this.numUsedTextures = 0, this.numFreeTextures = 0, this._numBytesAllocated = 0, this._numBytesFree = 0, this.freeTextures = {}, this.usedTextures = {}, this.logEnabled = false; } - acquireTexture(t8, e, o) { - let n = kD(e, o), s = ND(t8, n, o); + acquireTexture(e, t10, o) { + let n = gA(t10, o), s = xA(e, n, o); s in this.freeTextures || (this.freeTextures[s] = []), s in this.usedTextures || (this.usedTextures[s] = []); - let a = vD(t8, n, this.gpgpu.gl, this.gpgpu.textureConfig, o); + let a = hA(e, n, this.gpgpu.gl, this.gpgpu.textureConfig, o); if (this.freeTextures[s].length > 0) { this.numFreeTextures--, this.numUsedTextures++, this._numBytesFree -= a, this.log(); let p = this.freeTextures[s].pop(); return this.usedTextures[s].push(p), p; } let i; - return n === er.PACKED_2X2_FLOAT32 ? i = this.gpgpu.createPackedMatrixTexture(t8[0], t8[1]) : n === er.PACKED_2X2_FLOAT16 ? i = this.gpgpu.createFloat16PackedMatrixTexture(t8[0], t8[1]) : n === er.UNPACKED_FLOAT32 ? i = this.gpgpu.createFloat32MatrixTexture(t8[0], t8[1]) : n === er.UNPACKED_FLOAT16 ? i = this.gpgpu.createFloat16MatrixTexture(t8[0], t8[1]) : n === er.PACKED_4X1_UNSIGNED_BYTE && (i = this.gpgpu.createUnsignedBytesMatrixTexture(t8[0], t8[1])), this.usedTextures[s].push(i), this.numUsedTextures++, this._numBytesAllocated += a, this.log(), i; + return n === or.PACKED_2X2_FLOAT32 ? i = this.gpgpu.createPackedMatrixTexture(e[0], e[1]) : n === or.PACKED_2X2_FLOAT16 ? i = this.gpgpu.createFloat16PackedMatrixTexture(e[0], e[1]) : n === or.UNPACKED_FLOAT32 ? i = this.gpgpu.createFloat32MatrixTexture(e[0], e[1]) : n === or.UNPACKED_FLOAT16 ? i = this.gpgpu.createFloat16MatrixTexture(e[0], e[1]) : n === or.PACKED_4X1_UNSIGNED_BYTE && (i = this.gpgpu.createUnsignedBytesMatrixTexture(e[0], e[1])), this.usedTextures[s].push(i), this.numUsedTextures++, this._numBytesAllocated += a, this.log(), i; } - releaseTexture(t8, e, o, n) { + releaseTexture(e, t10, o, n) { if (this.freeTextures == null) return; - let s = kD(o, n), a = ND(e, s, n); + let s = gA(o, n), a = xA(t10, s, n); a in this.freeTextures || (this.freeTextures[a] = []); - let i = vD(e, s, this.gpgpu.gl, this.gpgpu.textureConfig, n), p = A().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD"); - p !== -1 && this._numBytesAllocated > p ? (this.gpgpu.deleteMatrixTexture(t8.texture), this._numBytesAllocated -= i) : (this.freeTextures[a].push(t8), this.numFreeTextures++, this._numBytesFree += i), this.numUsedTextures--; - let u = this.usedTextures[a], c = u && u.indexOf(t8); - if (c == null || c < 0) + let i = hA(t10, s, this.gpgpu.gl, this.gpgpu.textureConfig, n), p = A().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD"); + p !== -1 && this._numBytesAllocated > p ? (this.gpgpu.deleteMatrixTexture(e.texture), this._numBytesAllocated -= i) : (this.freeTextures[a].push(e), this.numFreeTextures++, this._numBytesFree += i), this.numUsedTextures--; + let u = this.usedTextures[a], l = u && u.indexOf(e); + if (l == null || l < 0) throw new Error("Cannot release a texture that was never provided by this texture manager"); - u[c] = u[u.length - 1], u.pop(), this.log(); + u[l] = u[u.length - 1], u.pop(), this.log(); } log() { if (!this.logEnabled) return; - let t8 = this.numFreeTextures + this.numUsedTextures; - console.log("Free/Used", `${this.numFreeTextures} / ${this.numUsedTextures}`, `(${t8})`); - let e = this._numBytesFree / this._numBytesAllocated; - console.log(`Bytes allocated: ${this._numBytesAllocated}`), console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100 * e)}%)`); + let e = this.numFreeTextures + this.numUsedTextures; + console.log("Free/Used", `${this.numFreeTextures} / ${this.numUsedTextures}`, `(${e})`); + let t10 = this._numBytesFree / this._numBytesAllocated; + console.log(`Bytes allocated: ${this._numBytesAllocated}`), console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100 * t10)}%)`); } get numBytesAllocated() { return this._numBytesAllocated; @@ -17993,82 +18089,82 @@ var mh = class { } dispose() { if (this.freeTextures != null) { - for (let t8 in this.freeTextures) - this.freeTextures[t8].forEach((e) => { - this.gpgpu.deleteMatrixTexture(e.texture); + for (let e in this.freeTextures) + this.freeTextures[e].forEach((t10) => { + this.gpgpu.deleteMatrixTexture(t10.texture); }); - for (let t8 in this.usedTextures) - this.usedTextures[t8].forEach((e) => { - this.gpgpu.deleteMatrixTexture(e.texture); + for (let e in this.usedTextures) + this.usedTextures[e].forEach((t10) => { + this.gpgpu.deleteMatrixTexture(t10.texture); }); this.freeTextures = null, this.usedTextures = null, this.numUsedTextures = 0, this.numFreeTextures = 0, this._numBytesAllocated = 0, this._numBytesFree = 0; } } }; -function qZ(r15, t8) { - let e = r15; - if (t8 === e.R32F) +function CJ(r16, e) { + let t10 = r16; + if (e === t10.R32F) return 4; - if (t8 === e.R16F) + if (e === t10.R16F) return 2; - if (t8 === e.RGBA32F) + if (e === t10.RGBA32F) return 16; - if (t8 === r15.RGBA) + if (e === r16.RGBA) return 16; - if (t8 === e.RGBA16F) + if (e === t10.RGBA16F) return 8; - if (t8 === e.RGBA8) + if (e === t10.RGBA8) return 4; - throw new Error(`Unknown internal format ${t8}`); + throw new Error(`Unknown internal format ${e}`); } -function vD(r15, t8, e, o, n) { - let s = jZ(t8, o), a; +function hA(r16, e, t10, o, n) { + let s = wJ(e, o), a; if (n) { - let [p, u] = Ma(r15[0], r15[1]); + let [p, u] = Ga(r16[0], r16[1]); a = p * u; } else { - let [p, u] = fp(r15[0], r15[1]); + let [p, u] = Sp(r16[0], r16[1]); a = p * u; } - let i = qZ(e, s); + let i = CJ(t10, s); return a * i; } -function jZ(r15, t8) { - switch (r15) { - case er.PACKED_2X2_FLOAT32: - return ah(t8); - case er.PACKED_2X2_FLOAT16: - return ih(t8); - case er.UNPACKED_FLOAT32: - return oh(t8); - case er.UNPACKED_FLOAT16: - return nh(t8); - case er.PACKED_4X1_UNSIGNED_BYTE: - return sh(t8); +function wJ(r16, e) { + switch (r16) { + case or.PACKED_2X2_FLOAT32: + return yh(e); + case or.PACKED_2X2_FLOAT16: + return bh(e); + case or.UNPACKED_FLOAT32: + return hh(e); + case or.UNPACKED_FLOAT16: + return gh(e); + case or.PACKED_4X1_UNSIGNED_BYTE: + return xh(e); default: - throw new Error(`Unknown physical texture type ${r15}`); + throw new Error(`Unknown physical texture type ${r16}`); } } -function XZ(r15) { - return A().getBool("WEBGL_RENDER_FLOAT32_ENABLED") ? r15 ? er.PACKED_2X2_FLOAT32 : er.UNPACKED_FLOAT32 : r15 ? er.PACKED_2X2_FLOAT16 : er.UNPACKED_FLOAT16; +function SJ(r16) { + return A().getBool("WEBGL_RENDER_FLOAT32_ENABLED") ? r16 ? or.PACKED_2X2_FLOAT32 : or.UNPACKED_FLOAT32 : r16 ? or.PACKED_2X2_FLOAT16 : or.UNPACKED_FLOAT16; } -function kD(r15, t8) { - if (r15 === mr.UPLOAD) - return er.PACKED_2X2_FLOAT32; - if (r15 === mr.RENDER || r15 == null) - return XZ(t8); - if (r15 === mr.DOWNLOAD || r15 === mr.PIXELS) - return er.PACKED_4X1_UNSIGNED_BYTE; - throw new Error(`Unknown logical texture type ${r15}`); +function gA(r16, e) { + if (r16 === hr.UPLOAD) + return or.PACKED_2X2_FLOAT32; + if (r16 === hr.RENDER || r16 == null) + return SJ(e); + if (r16 === hr.DOWNLOAD || r16 === hr.PIXELS) + return or.PACKED_4X1_UNSIGNED_BYTE; + throw new Error(`Unknown logical texture type ${r16}`); } -function ND(r15, t8, e) { - return `${r15[0]}_${r15[1]}_${t8}_${e}`; +function xA(r16, e, t10) { + return `${r16[0]}_${r16[1]}_${e}_${t10}`; } -var tr = class { - constructor(t8, e) { - this.variableNames = ["A"], this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length), this.userCode = ` +var nr = class { + constructor(e, t10) { + this.variableNames = ["A"], this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length), this.userCode = ` float unaryOperation(float x) { - ${e} + ${t10} } void main() { @@ -18080,20 +18176,20 @@ var tr = class { `; } }; -var Wt = "if (isnan(x)) return x;"; -var TD = "return x;"; -var dv = "return abs(x);"; -var _D = "return (x >= 0.0) ? x : (exp(x) - 1.0);"; -var $D = Wt + ` +var Gt = "if (isnan(x)) return x;"; +var yA = "return x;"; +var T0 = "return abs(x);"; +var bA = "return (x >= 0.0) ? x : (exp(x) - 1.0);"; +var CA = Gt + ` return (x < 0.0) ? 0.0 : x; `; -var ED = Wt + ` +var wA = Gt + ` return (x < 0.0) ? 0.0 : min(6.0, x); `; -var La = "return x;"; -var RD = "return 1.0 / (1.0 + exp(-1.0 * x));"; -var AD = "return x;"; -var FD = ` +var Ha = "return x;"; +var SA = "return 1.0 / (1.0 + exp(-1.0 * x));"; +var vA = "return x;"; +var kA = ` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -18103,7 +18199,7 @@ var FD = ` return result; `; -var PD = ` +var NA = ` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -18114,7 +18210,7 @@ var PD = ` return result; `; -var OD = ` +var TA = ` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -18125,12 +18221,12 @@ var OD = ` return result; `; -var MD = "return 1.0 / (1.0 + exp(-1.0 * x));"; -var Ar = class { - constructor(t8, e) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length), this.userCode = ` +var _A = "return 1.0 / (1.0 + exp(-1.0 * x));"; +var Lr = class { + constructor(e, t10) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length), this.userCode = ` vec4 unaryOperation(vec4 x) { - ${e} + ${t10} } void main() { @@ -18142,10 +18238,10 @@ var Ar = class { `; } }; -var dh = class { - constructor(t8) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = false, this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length); - let e = t8.length, o = Rt("rc", e), n = Re(e), s = ID(e, o), a = o.slice(-2), i = e <= 1 ? "rc" : `vec2(${a.join(",")})`; +var kh = class { + constructor(e) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = false, this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length); + let t10 = e.length, o = At("rc", t10), n = Re(t10), s = fA(t10, o), a = o.slice(-2), i = t10 <= 1 ? "rc" : `vec2(${a.join(",")})`; this.userCode = ` void main() { ${n} rc = getOutputCoords(); @@ -18156,194 +18252,194 @@ var dh = class { `; } }; -var QZ = Vt.whereImpl; -var ZZ = 1e-7; -var JZ = 1e-4; -var fh = {}; -function e9(r15) { - return r15 in fh || (fh[r15] = {}), fh[r15]; +var vJ = Ut.whereImpl; +var kJ = 1e-7; +var NJ = 1e-4; +var Nh = {}; +function TJ(r16) { + return r16 in Nh || (Nh[r16] = {}), Nh[r16]; } -var t9 = A().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"); -var r92 = 600; -function o9() { - return A().global.screen == null ? 1024 : A().global.screen.height * A().global.screen.width * window.devicePixelRatio * r92 / 1024 / 1024; +var _J = A().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"); +var EJ = 600; +function $J() { + return A().global.screen == null ? 1024 : A().global.screen.height * A().global.screen.width * window.devicePixelRatio * EJ / 1024 / 1024; } -var Oc = class r13 extends so { +var Ul = class r13 extends mo { nextDataId() { return r13.nextDataId++; } - constructor(t8) { + constructor(e) { if (super(), this.pendingRead = /* @__PURE__ */ new WeakMap(), this.pendingDisposal = /* @__PURE__ */ new WeakSet(), this.dataRefCount = /* @__PURE__ */ new WeakMap(), this.numBytesInGPU = 0, this.uploadWaitMs = 0, this.downloadWaitMs = 0, this.lastGlFlushTime = 0, this.warnedAboutMemory = false, this.pendingDeletes = 0, this.disposed = false, !A().getBool("HAS_WEBGL")) throw new Error("WebGL is not supported on this device"); - let e; - if (t8 != null) { - if (t8 instanceof xp) - e = t8; + let t10; + if (e != null) { + if (e instanceof kp) + t10 = e; else { - let o = Hr(A().getNumber("WEBGL_VERSION"), t8); - e = new xp(o); + let o = Zr(A().getNumber("WEBGL_VERSION"), e); + t10 = new kp(o); } this.binaryCache = {}, this.gpgpuCreatedLocally = false; } else { - let o = Hr(A().getNumber("WEBGL_VERSION")); - e = new xp(o), this.binaryCache = e9(A().getNumber("WEBGL_VERSION")), this.gpgpuCreatedLocally = true; + let o = Zr(A().getNumber("WEBGL_VERSION")); + t10 = new kp(o), this.binaryCache = TJ(A().getNumber("WEBGL_VERSION")), this.gpgpuCreatedLocally = true; } - this.gpgpu = e, this.canvas = this.gpgpu.gl.canvas, this.textureManager = new mh(this.gpgpu), this.numMBBeforeWarning = o9(), this.texData = new Bo(this, ur()); + this.gpgpu = t10, this.canvas = this.gpgpu.gl.canvas, this.textureManager = new vh(this.gpgpu), this.numMBBeforeWarning = $J(), this.texData = new mn(this, cr()); } numDataIds() { return this.texData.numDataIds() - this.pendingDeletes; } - writeTexture(t8, e, o, n, s, a) { - let i = this.makeTensorInfo(e, o), p = this.texData.get(i.dataId); - p.isPacked = false, p.texture = { texture: t8, texShape: [n, s] }, p.texShape = [n, s]; - let u = Nc(e), c = new Yl(u, false, a), l = this.runWebGLProgram(c, [i], o, [[n, s]]); - return l.shape = e, p.texture = null, this.disposeIntermediateTensorInfo(i), l.dataId; + writeTexture(e, t10, o, n, s, a) { + let i = this.makeTensorInfo(t10, o), p = this.texData.get(i.dataId); + p.isPacked = false, p.texture = { texture: e, texShape: [n, s] }, p.texShape = [n, s]; + let u = Al(t10), l = new sm(u, false, a), c = this.runWebGLProgram(l, [i], o, [[n, s]]); + return c.shape = t10, p.texture = null, this.disposeIntermediateTensorInfo(i), c.dataId; } - write(t8, e, o) { - if ((A().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS") || A().getBool("DEBUG")) && this.checkNumericalProblems(t8), o === "complex64" && t8 != null) + write(e, t10, o) { + if ((A().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS") || A().getBool("DEBUG")) && this.checkNumericalProblems(e), o === "complex64" && e != null) throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag)."); let n = { id: this.nextDataId() }; - return this.texData.set(n, { shape: e, dtype: o, values: t8, usage: mr.UPLOAD, refCount: 1 }), n; + return this.texData.set(n, { shape: t10, dtype: o, values: e, usage: hr.UPLOAD, refCount: 1 }), n; } - refCount(t8) { - return this.texData.has(t8) ? this.texData.get(t8).refCount : 0; + refCount(e) { + return this.texData.has(e) ? this.texData.get(e).refCount : 0; } - incRef(t8) { - let e = this.texData.get(t8); - e.refCount++; + incRef(e) { + let t10 = this.texData.get(e); + t10.refCount++; } - decRef(t8) { - if (this.texData.has(t8)) { - let e = this.texData.get(t8); - e.refCount--; + decRef(e) { + if (this.texData.has(e)) { + let t10 = this.texData.get(e); + t10.refCount--; } } - move(t8, e, o, n, s) { - if (A().getBool("DEBUG") && this.checkNumericalProblems(e), n === "complex64") + move(e, t10, o, n, s) { + if (A().getBool("DEBUG") && this.checkNumericalProblems(t10), n === "complex64") throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag)."); - this.texData.set(t8, { shape: o, dtype: n, values: e, usage: mr.UPLOAD, refCount: s }); + this.texData.set(e, { shape: o, dtype: n, values: t10, usage: hr.UPLOAD, refCount: s }); } - disposeIntermediateTensorInfo(t8) { - this.disposeData(t8.dataId); + disposeIntermediateTensorInfo(e) { + this.disposeData(e.dataId); } - readSync(t8) { - let e = this.texData.get(t8), { values: o, dtype: n, complexTensorInfos: s, slice: a, shape: i, isPacked: p } = e; + readSync(e) { + let t10 = this.texData.get(e), { values: o, dtype: n, complexTensorInfos: s, slice: a, shape: i, isPacked: p } = t10; if (a != null) { let m; - p ? m = new Ar(i, La) : m = new tr(i, La); - let d = this.runWebGLProgram(m, [{ dataId: t8, shape: i, dtype: n }], n), f = this.readSync(d.dataId); + p ? m = new Lr(i, Ha) : m = new nr(i, Ha); + let d = this.runWebGLProgram(m, [{ dataId: e, shape: i, dtype: n }], n), f = this.readSync(d.dataId); return this.disposeIntermediateTensorInfo(d), f; } if (o != null) - return this.convertAndCacheOnCPU(t8); + return this.convertAndCacheOnCPU(e); if (n === "string") return o; - let u = this.activeTimers != null, c; - u && (c = y.now()); - let l; + let u = this.activeTimers != null, l; + u && (l = y.now()); + let c; if (n === "complex64") { let m = this.readSync(s.real.dataId), d = this.readSync(s.imag.dataId); - l = w.mergeRealAndImagArrays(m, d); + c = C.mergeRealAndImagArrays(m, d); } else - l = this.getValuesFromTexture(t8); - return u && (this.downloadWaitMs += y.now() - c), this.convertAndCacheOnCPU(t8, l); + c = this.getValuesFromTexture(e); + return u && (this.downloadWaitMs += y.now() - l), this.convertAndCacheOnCPU(e, c); } - async read(t8) { - if (this.pendingRead.has(t8)) { - let f = this.pendingRead.get(t8); + async read(e) { + if (this.pendingRead.has(e)) { + let f = this.pendingRead.get(e); return new Promise((h) => f.push(h)); } - let e = this.texData.get(t8), { values: o, shape: n, slice: s, dtype: a, complexTensorInfos: i, isPacked: p } = e; + let t10 = this.texData.get(e), { values: o, shape: n, slice: s, dtype: a, complexTensorInfos: i, isPacked: p } = t10; if (s != null) { let f; - p ? f = new Ar(n, La) : f = new tr(n, La); - let h = this.runWebGLProgram(f, [{ dataId: t8, shape: n, dtype: a }], a), g = this.read(h.dataId); + p ? f = new Lr(n, Ha) : f = new nr(n, Ha); + let h = this.runWebGLProgram(f, [{ dataId: e, shape: n, dtype: a }], a), g = this.read(h.dataId); return this.disposeIntermediateTensorInfo(h), g; } if (o != null) - return this.convertAndCacheOnCPU(t8); + return this.convertAndCacheOnCPU(e); if (A().getBool("DEBUG") && !A().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED") && A().getNumber("WEBGL_VERSION") === 2) throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported."); - let u = null, c; + let u = null, l; if (a !== "complex64" && A().get("WEBGL_BUFFER_SUPPORTED")) { - c = this.decode(t8); - let f = this.texData.get(c.dataId); - u = this.gpgpu.createBufferFromTexture(f.texture.texture, ...Kl(n)); + l = this.decode(e); + let f = this.texData.get(l.dataId); + u = this.gpgpu.createBufferFromTexture(f.texture.texture, ...tm(n)); } - this.pendingRead.set(t8, []), a !== "complex64" && await this.gpgpu.createAndWaitForFence(); - let l; + this.pendingRead.set(e, []), a !== "complex64" && await this.gpgpu.createAndWaitForFence(); + let c; if (a === "complex64") { let f = await Promise.all([this.read(i.real.dataId), this.read(i.imag.dataId)]), h = f[0], g = f[1]; - l = w.mergeRealAndImagArrays(h, g); + c = C.mergeRealAndImagArrays(h, g); } else if (u == null) - l = this.getValuesFromTexture(t8); + c = this.getValuesFromTexture(e); else { let f = y.sizeFromShape(n); - l = this.gpgpu.downloadFloat32MatrixFromBuffer(u, f); + c = this.gpgpu.downloadFloat32MatrixFromBuffer(u, f); } - if (c != null && this.disposeIntermediateTensorInfo(c), u != null) { + if (l != null && this.disposeIntermediateTensorInfo(l), u != null) { let f = this.gpgpu.gl; ce(f, () => f.deleteBuffer(u)); } - let m = this.convertAndCacheOnCPU(t8, l), d = this.pendingRead.get(t8); - return this.pendingRead.delete(t8), d.forEach((f) => f(m)), this.pendingDisposal.has(t8) && (this.pendingDisposal.delete(t8), this.disposeData(t8) && ur().removeDataId(t8, this), this.pendingDeletes--), m; + let m = this.convertAndCacheOnCPU(e, c), d = this.pendingRead.get(e); + return this.pendingRead.delete(e), d.forEach((f) => f(m)), this.pendingDisposal.has(e) && (this.pendingDisposal.delete(e), this.disposeData(e) && cr().removeDataId(e, this), this.pendingDeletes--), m; } - readToGPU(t8, e = {}) { - let o = this.texData.get(t8), { values: n, shape: s, slice: a, dtype: i, isPacked: p, texture: u } = o; + readToGPU(e, t10 = {}) { + let o = this.texData.get(e), { values: n, shape: s, slice: a, dtype: i, isPacked: p, texture: u } = o; if (i === "complex64") throw new Error("Does not support reading texture for complex64 dtype."); if (a != null) { let d; - p ? d = new Ar(s, La) : d = new tr(s, La); - let f = this.runWebGLProgram(d, [{ dataId: t8, shape: s, dtype: i }], i), h = this.readToGPU(f, e); + p ? d = new Lr(s, Ha) : d = new nr(s, Ha); + let f = this.runWebGLProgram(d, [{ dataId: e, shape: s, dtype: i }], i), h = this.readToGPU(f, t10); return this.disposeIntermediateTensorInfo(f), h; } if (u == null) throw n != null ? new Error("Data is not on GPU but on CPU.") : new Error("There is no data on GPU or CPU."); - let c = this.decode(t8, e.customTexShape), l = ur().makeTensorFromTensorInfo(c), m = this.texData.get(c.dataId); - return Object.assign({ tensorRef: l }, m.texture); + let l = this.decode(e, t10.customTexShape), c = cr().makeTensorFromTensorInfo(l), m = this.texData.get(l.dataId); + return Object.assign({ tensorRef: c }, m.texture); } - bufferSync(t8) { - let e = this.readSync(t8.dataId); - if (t8.dtype === "string") + bufferSync(e) { + let t10 = this.readSync(e.dataId); + if (e.dtype === "string") try { - let o = e.map((n) => y.decodeString(n)); - return me(t8.shape, t8.dtype, o); + let o = t10.map((n) => y.decodeString(n)); + return ie(e.shape, e.dtype, o); } catch (o) { throw new Error("Failed to decode encoded string bytes into utf-8"); } - return me(t8.shape, t8.dtype, e); + return ie(e.shape, e.dtype, t10); } - checkNumericalProblems(t8) { - if (t8 != null) - for (let e = 0; e < t8.length; e++) { - let o = t8[e]; - if (!_I(o)) + checkNumericalProblems(e) { + if (e != null) + for (let t10 = 0; t10 < e.length; t10++) { + let o = e[t10]; + if (!WI(o)) throw A().getBool("WEBGL_RENDER_FLOAT32_CAPABLE") ? Error(`The value ${o} cannot be represented with your current settings. Consider enabling float32 rendering: 'tf.env().set('WEBGL_RENDER_FLOAT32_ENABLED', true);'`) : Error(`The value ${o} cannot be represented on this device.`); } } - getValuesFromTexture(t8) { - let { shape: e, dtype: o, isPacked: n } = this.texData.get(t8), s = y.sizeFromShape(e); + getValuesFromTexture(e) { + let { shape: t10, dtype: o, isPacked: n } = this.texData.get(e), s = y.sizeFromShape(t10); if (A().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")) { - let m = this.decode(t8), d = this.texData.get(m.dataId), f = this.gpgpu.downloadMatrixFromPackedTexture(d.texture.texture, ...Kl(e)).subarray(0, s); + let m = this.decode(e), d = this.texData.get(m.dataId), f = this.gpgpu.downloadMatrixFromPackedTexture(d.texture.texture, ...tm(t10)).subarray(0, s); return this.disposeIntermediateTensorInfo(m), f; } - let a = A().getBool("WEBGL_PACK") && n === true, i = a ? Nc(e) : e, p = a ? new th(i) : new eh(i), u = this.runWebGLProgram(p, [{ shape: i, dtype: o, dataId: t8 }], "float32"), c = this.texData.get(u.dataId), l = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(c.texture.texture, c.texShape[0], c.texShape[1]).subarray(0, s); - return this.disposeIntermediateTensorInfo(u), l; + let a = A().getBool("WEBGL_PACK") && n === true, i = a ? Al(t10) : t10, p = a ? new dh(i) : new mh(i), u = this.runWebGLProgram(p, [{ shape: i, dtype: o, dataId: e }], "float32"), l = this.texData.get(u.dataId), c = this.gpgpu.downloadByteEncodedFloatMatrixFromOutputTexture(l.texture.texture, l.texShape[0], l.texShape[1]).subarray(0, s); + return this.disposeIntermediateTensorInfo(u), c; } timerAvailable() { return A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0; } - time(t8) { - let e = this.activeTimers, o = [], n = false; - this.programTimersStack == null ? (this.programTimersStack = o, n = true) : this.activeTimers.push(o), this.activeTimers = o, t8(); + time(e) { + let t10 = this.activeTimers, o = [], n = false; + this.programTimersStack == null ? (this.programTimersStack = o, n = true) : this.activeTimers.push(o), this.activeTimers = o, e(); let s = y.flatten(this.activeTimers.map((p) => p.query)).filter((p) => p != null), a = y.flatten(this.activeTimers.map((p) => p.name)).filter((p) => p != null); - this.activeTimers = e, n && (this.programTimersStack = null); + this.activeTimers = t10, n && (this.programTimersStack = null); let i = { uploadWaitMs: this.uploadWaitMs, downloadWaitMs: this.downloadWaitMs, kernelMs: null, wallMs: null }; return (async () => { if (A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0) { let p = await Promise.all(s); - i.kernelMs = y.sum(p), i.getExtraProfileInfo = () => p.map((u, c) => ({ name: a[c], ms: u })).map((u) => `${u.name}: ${u.ms}`).join(", "); + i.kernelMs = y.sum(p), i.getExtraProfileInfo = () => p.map((u, l) => ({ name: a[l], ms: u })).map((u) => `${u.name}: ${u.ms}`).join(", "); } else i.kernelMs = { error: "WebGL query timers are not supported in this environment." }; return this.uploadWaitMs = 0, this.downloadWaitMs = 0, i; @@ -18355,128 +18451,128 @@ var Oc = class r13 extends so { startTimer() { return A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0 ? this.gpgpu.beginQuery() : { startMs: y.now(), endMs: null }; } - endTimer(t8) { - return A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0 ? (this.gpgpu.endQuery(), t8) : (t8.endMs = y.now(), t8); + endTimer(e) { + return A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0 ? (this.gpgpu.endQuery(), e) : (e.endMs = y.now(), e); } - async getQueryTime(t8) { + async getQueryTime(e) { if (A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE") > 0) - return this.gpgpu.waitForQueryAndGetTime(t8); - let e = t8; - return e.endMs - e.startMs; + return this.gpgpu.waitForQueryAndGetTime(e); + let t10 = e; + return t10.endMs - t10.startMs; } - disposeData(t8, e = false) { - if (this.pendingDisposal.has(t8)) + disposeData(e, t10 = false) { + if (this.pendingDisposal.has(e)) return false; - if (!this.texData.has(t8)) + if (!this.texData.has(e)) return true; - if (e ? this.texData.get(t8).refCount = 0 : this.texData.get(t8).refCount--, !e && this.texData.get(t8).refCount > 0) + if (t10 ? this.texData.get(e).refCount = 0 : this.texData.get(e).refCount--, !t10 && this.texData.get(e).refCount > 0) return false; - if (this.pendingRead.has(t8)) - return this.pendingDisposal.add(t8), this.pendingDeletes++, false; - this.releaseGPUData(t8); - let { complexTensorInfos: o } = this.texData.get(t8); - return o != null && (this.disposeData(o.real.dataId, e), this.disposeData(o.imag.dataId, e)), this.texData.delete(t8), true; + if (this.pendingRead.has(e)) + return this.pendingDisposal.add(e), this.pendingDeletes++, false; + this.releaseGPUData(e); + let { complexTensorInfos: o } = this.texData.get(e); + return o != null && (this.disposeData(o.real.dataId, t10), this.disposeData(o.imag.dataId, t10)), this.texData.delete(e), true; } - releaseGPUData(t8) { - let { texture: e, dtype: o, texShape: n, usage: s, isPacked: a, slice: i } = this.texData.get(t8), p = i && i.origDataId || t8, u = this.dataRefCount.get(p); - u > 1 ? this.dataRefCount.set(p, u - 1) : (this.dataRefCount.delete(p), e != null && (this.numBytesInGPU -= this.computeBytes(n, o), this.textureManager.releaseTexture(e, n, s, a))); - let c = this.texData.get(t8); - c.texture = null, c.texShape = null, c.isPacked = false, c.slice = null; + releaseGPUData(e) { + let { texture: t10, dtype: o, texShape: n, usage: s, isPacked: a, slice: i } = this.texData.get(e), p = i && i.origDataId || e, u = this.dataRefCount.get(p); + u > 1 ? this.dataRefCount.set(p, u - 1) : (this.dataRefCount.delete(p), t10 != null && (this.numBytesInGPU -= this.computeBytes(n, o), this.textureManager.releaseTexture(t10, n, s, a))); + let l = this.texData.get(e); + l.texture = null, l.texShape = null, l.isPacked = false, l.slice = null; } - getTexture(t8) { - return this.uploadToGPU(t8), this.texData.get(t8).texture.texture; + getTexture(e) { + return this.uploadToGPU(e), this.texData.get(e).texture.texture; } - getDataInfo(t8) { - return this.texData.get(t8); + getDataInfo(e) { + return this.texData.get(e); } - shouldExecuteOnCPU(t8, e = t9) { - return A().getBool("WEBGL_CPU_FORWARD") && t8.every((o) => this.texData.get(o.dataId).texture == null && y.sizeFromShape(o.shape) < e); + shouldExecuteOnCPU(e, t10 = _J) { + return A().getBool("WEBGL_CPU_FORWARD") && e.every((o) => this.texData.get(o.dataId).texture == null && y.sizeFromShape(o.shape) < t10); } getGPGPUContext() { return this.gpgpu; } - where(t8) { - w.warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead"); - let e = t8.dataSync(); - return QZ(t8.shape, e); + where(e) { + C.warn("tf.where() in webgl locks the UI thread. Call tf.whereAsync() instead"); + let t10 = e.dataSync(); + return vJ(e.shape, t10); } - packedUnaryOp(t8, e, o) { - let n = new Ar(t8.shape, e), s = this.compileAndRun(n, [t8], o); - return ur().makeTensorFromTensorInfo(s); + packedUnaryOp(e, t10, o) { + let n = new Lr(e.shape, t10), s = this.compileAndRun(n, [e], o); + return cr().makeTensorFromTensorInfo(s); } - abs(t8) { - if (this.shouldExecuteOnCPU([t8]) && t8.dtype !== "complex64") { - let n = ph(this.texData.get(t8.dataId).values); - return this.makeOutput(t8.shape, t8.dtype, n); + abs(e) { + if (this.shouldExecuteOnCPU([e]) && e.dtype !== "complex64") { + let n = wh(this.texData.get(e.dataId).values); + return this.makeOutput(e.shape, e.dtype, n); } if (A().getBool("WEBGL_PACK_UNARY_OPERATIONS")) - return this.packedUnaryOp(t8, dv, t8.dtype); - let e = new tr(t8.shape, dv), o = this.compileAndRun(e, [t8]); - return ur().makeTensorFromTensorInfo(o); + return this.packedUnaryOp(e, T0, e.dtype); + let t10 = new nr(e.shape, T0), o = this.compileAndRun(t10, [e]); + return cr().makeTensorFromTensorInfo(o); } - makeTensorInfo(t8, e, o) { + makeTensorInfo(e, t10, o) { let n; - if (e === "string" && o != null && o.length > 0 && y.isString(o[0])) { + if (t10 === "string" && o != null && o.length > 0 && y.isString(o[0])) { let s = o.map((a) => y.encodeString(a)); - n = this.write(s, t8, e); + n = this.write(s, e, t10); } else - n = this.write(o, t8, e); - return this.texData.get(n).usage = null, { dataId: n, shape: t8, dtype: e }; + n = this.write(o, e, t10); + return this.texData.get(n).usage = null, { dataId: n, shape: e, dtype: t10 }; } - makeOutput(t8, e, o) { - return ur().makeTensorFromTensorInfo(this.makeTensorInfo(t8, e, o), this); + makeOutput(e, t10, o) { + return cr().makeTensorFromTensorInfo(this.makeTensorInfo(e, t10, o), this); } - unpackTensor(t8) { - let e = new dh(t8.shape); - return this.runWebGLProgram(e, [t8], t8.dtype); + unpackTensor(e) { + let t10 = new kh(e.shape); + return this.runWebGLProgram(t10, [e], e.dtype); } - packTensor(t8) { - let e = new lh(t8.shape), o = true; - return this.runWebGLProgram(e, [t8], t8.dtype, null, o); + packTensor(e) { + let t10 = new Ih(e.shape); + return this.runWebGLProgram(t10, [e], e.dtype, null, true); } - packedReshape(t8, e) { - let o = [hi(t8.shape), ...gi(t8.shape)], n = { dtype: t8.dtype, shape: o, dataId: t8.dataId }, s = [hi(e), ...gi(e)], a = new Pc(s, o), i = true, p = [o], u = this.runWebGLProgram(a, [n], t8.dtype, p, i); - return { dataId: u.dataId, shape: e, dtype: u.dtype }; + packedReshape(e, t10) { + let o = [ki(e.shape), ...Ni(e.shape)], n = { dtype: e.dtype, shape: o, dataId: e.dataId }, s = [ki(t10), ...Ni(t10)], a = new Wl(s, o), i = true, p = [o], u = this.runWebGLProgram(a, [n], e.dtype, p, i); + return { dataId: u.dataId, shape: t10, dtype: u.dtype }; } - decode(t8, e) { - let o = this.texData.get(t8), { isPacked: n, shape: s, dtype: a } = o; - if (e != null) { - let m = y.sizeFromShape(s), d = e[0] * e[1] * 4; + decode(e, t10) { + let o = this.texData.get(e), { isPacked: n, shape: s, dtype: a } = o; + if (t10 != null) { + let m = y.sizeFromShape(s), d = t10[0] * t10[1] * 4; y.assert(m <= d, () => "customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data."); } - let i = Nc(s), p; - n ? p = new Jf(i) : p = new Zf(i); - let u = true, c = [e != null ? e : Kl(i)], l = this.runWebGLProgram(p, [{ shape: i, dtype: a, dataId: t8 }], a, c, u, e); - return { dtype: a, shape: s, dataId: l.dataId }; + let i = Al(s), p; + n ? p = new ch(i) : p = new lh(i); + let u = true, l = [t10 != null ? t10 : tm(i)], c = this.runWebGLProgram(p, [{ shape: i, dtype: a, dataId: e }], a, l, u, t10); + return { dtype: a, shape: s, dataId: c.dataId }; } - runWebGLProgram(t8, e, o, n, s = false, a) { - let i = this.makeTensorInfo(t8.outputShape, o), p = this.texData.get(i.dataId); - if (t8.packedOutput && (p.isPacked = true), t8.outPackingScheme === fu.DENSE) { - let x = a != null ? a : Kl(t8.outputShape); + runWebGLProgram(e, t10, o, n, s = false, a) { + let i = this.makeTensorInfo(e.outputShape, o), p = this.texData.get(i.dataId); + if (e.packedOutput && (p.isPacked = true), e.outPackingScheme === Iu.DENSE) { + let x = a != null ? a : tm(e.outputShape); p.texShape = x.map((b) => b * 2); } - if (t8.outTexUsage != null && (p.usage = t8.outTexUsage), y.sizeFromShape(i.shape) === 0) + if (e.outTexUsage != null && (p.usage = e.outTexUsage), y.sizeFromShape(i.shape) === 0) return p.values = y.getTypedArrayFromDType(i.dtype, 0), i; - let u = [], c = e.map((x) => { + let u = [], l = t10.map((x) => { if (x.dtype === "complex64") throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts."); let b = this.texData.get(x.dataId); if (b.texture == null) { - if (!t8.packedInputs && y.sizeFromShape(x.shape) <= A().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM")) + if (!e.packedInputs && y.sizeFromShape(x.shape) <= A().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM")) return { shape: x.shape, texData: null, isUniform: true, uniformValues: b.values }; - t8.packedInputs && (b.isPacked = true, b.shape = x.shape); + e.packedInputs && (b.isPacked = true, b.shape = x.shape); } - if (this.uploadToGPU(x.dataId), !!b.isPacked != !!t8.packedInputs) + if (this.uploadToGPU(x.dataId), !!b.isPacked != !!e.packedInputs) x = b.isPacked ? this.unpackTensor(x) : this.packTensor(x), u.push(x), b = this.texData.get(x.dataId); - else if (b.isPacked && !hu(b.shape, x.shape)) { - let C = x, S = x.shape; - x.shape = b.shape, x = this.packedReshape(x, S), u.push(x), b = this.texData.get(x.dataId), C.shape = S; + else if (b.isPacked && !vu(b.shape, x.shape)) { + let w = x, S = x.shape; + x.shape = b.shape, x = this.packedReshape(x, S), u.push(x), b = this.texData.get(x.dataId), w.shape = S; } return { shape: x.shape, texData: b, isUniform: false }; }); this.uploadToGPU(i.dataId); - let l = { shape: i.shape, texData: p, isUniform: false }, m = RR(t8, c, l), d = this.getAndSaveBinary(m, () => $R(this.gpgpu, t8, c, l)), f = this.activeTimers != null, h; - f && (h = this.startTimer()), A().get("ENGINE_COMPILE_ONLY") || ER(this.gpgpu, d, c, l, n), u.forEach((x) => this.disposeIntermediateTensorInfo(x)), f && (h = this.endTimer(h), this.activeTimers.push({ name: t8.constructor.name, query: this.getQueryTime(h) })); + let c = { shape: i.shape, texData: p, isUniform: false }, m = SD(e, l, c), d = this.getAndSaveBinary(m, () => CD(this.gpgpu, e, l, c)), f = this.activeTimers != null, h; + f && (h = this.startTimer()), A().get("ENGINE_COMPILE_ONLY") || wD(this.gpgpu, d, l, c, n), u.forEach((x) => this.disposeIntermediateTensorInfo(x)), f && (h = this.endTimer(h), this.activeTimers.push({ name: e.constructor.name, query: this.getQueryTime(h) })); let g = A().getNumber("WEBGL_FLUSH_THRESHOLD"); if (g > 0) { let x = y.now(); @@ -18488,143 +18584,143 @@ var Oc = class r13 extends so { } return i; } - compileAndRun(t8, e, o, n, s = false) { - return o = o || e[0].dtype, this.runWebGLProgram(t8, e, o, n, s); + compileAndRun(e, t10, o, n, s = false) { + return o = o || t10[0].dtype, this.runWebGLProgram(e, t10, o, n, s); } - getAndSaveBinary(t8, e) { - return t8 in this.binaryCache || (this.binaryCache[t8] = e()), this.binaryCache[t8]; + getAndSaveBinary(e, t10) { + return e in this.binaryCache || (this.binaryCache[e] = t10()), this.binaryCache[e]; } getTextureManager() { return this.textureManager; } dispose() { - this.disposed || (A().getBool("IS_TEST") || Object.keys(this.binaryCache).forEach((e) => { - this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram), delete this.binaryCache[e]; + this.disposed || (A().getBool("IS_TEST") || Object.keys(this.binaryCache).forEach((t10) => { + this.gpgpu.deleteProgram(this.binaryCache[t10].webGLProgram), delete this.binaryCache[t10]; }), 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 = true); } floatPrecision() { return this.floatPrecisionValue == null && (this.floatPrecisionValue = De(() => { if (!A().get("WEBGL_RENDER_FLOAT32_ENABLED")) { - let t8 = A().getBool("DEBUG"); + let e = A().getBool("DEBUG"); A().set("DEBUG", false); - let e = this.abs(ke(1e-8)).dataSync()[0]; - if (A().set("DEBUG", t8), e > 0) + let t10 = this.abs(ke(1e-8)).dataSync()[0]; + if (A().set("DEBUG", e), t10 > 0) return 32; } return 16; })), this.floatPrecisionValue; } epsilon() { - return this.floatPrecision() === 32 ? ZZ : JZ; + return this.floatPrecision() === 32 ? kJ : NJ; } - uploadToGPU(t8) { - let e = this.texData.get(t8), { shape: o, dtype: n, values: s, texture: a, usage: i, isPacked: p } = e; + uploadToGPU(e) { + let t10 = this.texData.get(e), { shape: o, dtype: n, values: s, texture: a, usage: i, isPacked: p } = t10; if (a != null) return; - let u = this.activeTimers != null, c; - u && (c = y.now()); - let l = e.texShape; - if (l == null && (l = VI(o, p), e.texShape = l), s != null) { - let m = Nc(o), d, f = l[1], h = l[0], g = s instanceof Uint8Array || s instanceof Uint8ClampedArray; - (p || !g) && ([f, h] = Ma(l[0], l[1])), p ? d = new rh(m, g) : d = new Yl(m, g); - let x = g ? [h, f] : l, b = this.makeTensorInfo(x, n), C = this.texData.get(b.dataId); - g ? C.usage = mr.PIXELS : C.usage = mr.UPLOAD, C.texShape = x, this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(b.dataId), f, h, s); - let S = [[h, f]], k = true, _ = this.runWebGLProgram(d, [b], n, S, k), E = this.texData.get(_.dataId); - e.texShape = E.texShape, e.isPacked = E.isPacked, e.usage = E.usage, A().get("ENGINE_COMPILE_ONLY") ? this.disposeData(_.dataId) : (e.texture = E.texture, e.values = null, this.texData.delete(_.dataId)), this.disposeIntermediateTensorInfo(b), u && (this.uploadWaitMs += y.now() - c); + let u = this.activeTimers != null, l; + u && (l = y.now()); + let c = t10.texShape; + if (c == null && (c = t0(o, p), t10.texShape = c), s != null) { + let m = Al(o), d, f = c[1], h = c[0], g = s instanceof Uint8Array || s instanceof Uint8ClampedArray; + (p || !g) && ([f, h] = Ga(c[0], c[1])), p ? d = new fh(m, g) : d = new sm(m, g); + let x = g ? [h, f] : c, b = this.makeTensorInfo(x, n), w = this.texData.get(b.dataId); + g ? w.usage = hr.PIXELS : w.usage = hr.UPLOAD, w.texShape = x, this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(b.dataId), f, h, s); + let S = [[h, f]], T = this.runWebGLProgram(d, [b], n, S, true), E = this.texData.get(T.dataId); + t10.texShape = E.texShape, t10.isPacked = E.isPacked, t10.usage = E.usage, A().get("ENGINE_COMPILE_ONLY") ? this.disposeData(T.dataId) : (t10.texture = E.texture, t10.values = null, this.texData.delete(T.dataId)), this.disposeIntermediateTensorInfo(b), u && (this.uploadWaitMs += y.now() - l); } else { - let m = this.acquireTexture(l, i, n, p); - e.texture = m; + let m = this.acquireTexture(c, i, n, p); + t10.texture = m; } } - convertAndCacheOnCPU(t8, e) { - let o = this.texData.get(t8), { dtype: n } = o; - return e != null && (o.values = n9(e, n)), o.values; + convertAndCacheOnCPU(e, t10) { + let o = this.texData.get(e), { dtype: n } = o; + return t10 != null && (o.values = RJ(t10, n)), o.values; } - acquireTexture(t8, e, o, n) { - if (this.numBytesInGPU += this.computeBytes(t8, o), !this.warnedAboutMemory && this.numBytesInGPU > this.numMBBeforeWarning * 1024 * 1024) { + acquireTexture(e, t10, o, n) { + if (this.numBytesInGPU += this.computeBytes(e, o), !this.warnedAboutMemory && this.numBytesInGPU > this.numMBBeforeWarning * 1024 * 1024) { let s = (this.numBytesInGPU / 1024 / 1024).toFixed(2); this.warnedAboutMemory = true, console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`); } - return this.textureManager.acquireTexture(t8, e, n); + return this.textureManager.acquireTexture(e, t10, n); } - computeBytes(t8, e) { - return t8[0] * t8[1] * y.bytesPerElement(e); + computeBytes(e, t10) { + return e[0] * e[1] * y.bytesPerElement(t10); } checkCompileCompletion() { - for (let [, t8] of Object.entries(this.binaryCache)) - this.checkCompletion_(t8); + for (let [, e] of Object.entries(this.binaryCache)) + this.checkCompletion_(e); } async checkCompileCompletionAsync() { - let t8 = []; + let e = []; if (this.gpgpu.parallelCompilationExtension) { - for (let [, e] of Object.entries(this.binaryCache)) - t8.push(this.checkCompletionAsync_(e)); - return Promise.all(t8); + for (let [, t10] of Object.entries(this.binaryCache)) + e.push(this.checkCompletionAsync_(t10)); + return Promise.all(e); } else { - for (let [, e] of Object.entries(this.binaryCache)) { + for (let [, t10] of Object.entries(this.binaryCache)) { let o = new Promise((n) => { try { - this.checkCompletion_(e), n(true); + this.checkCompletion_(t10), n(true); } catch (s) { throw s; } }); - t8.push(o); + e.push(o); } - return Promise.all(t8); + return Promise.all(e); } } - async checkCompletionAsync_(t8) { - return this.gpgpu.gl.getProgramParameter(t8.webGLProgram, this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR) ? this.checkCompletion_(t8) : (await pS(), this.checkCompletionAsync_(t8)); + async checkCompletionAsync_(e) { + return this.gpgpu.gl.getProgramParameter(e.webGLProgram, this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR) ? this.checkCompletion_(e) : (await IS(), this.checkCompletionAsync_(e)); } - checkCompletion_(t8) { - if (this.gpgpu.gl.getProgramParameter(t8.webGLProgram, this.gpgpu.gl.LINK_STATUS) === false) - throw console.log(this.gpgpu.gl.getProgramInfoLog(t8.webGLProgram)), this.gpgpu.gl.getShaderParameter(t8.fragmentShader, this.gpgpu.gl.COMPILE_STATUS) === false ? (Kf(t8.source, this.gpgpu.gl.getShaderInfoLog(t8.fragmentShader)), new Error("Failed to compile fragment shader.")) : new Error("Failed to link vertex and fragment shaders."); + checkCompletion_(e) { + if (this.gpgpu.gl.getProgramParameter(e.webGLProgram, this.gpgpu.gl.LINK_STATUS) === false) + throw console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)), this.gpgpu.gl.getShaderParameter(e.fragmentShader, this.gpgpu.gl.COMPILE_STATUS) === false ? (nh(e.source, this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)), new Error("Failed to compile fragment shader.")) : new Error("Failed to link vertex and fragment shaders."); return true; } getUniformLocations() { - for (let t8 of Object.values(this.binaryCache)) { - this.gpgpu.buildVao(t8.webGLProgram); - let { variablesLocations: e, customUniformLocations: o, infLoc: n, nanLoc: s, outShapeLocation: a, outShapeStridesLocation: i, outTexShapeLocation: p } = jI(this.gpgpu, t8.program, t8.webGLProgram); - t8.variablesLocations = e, t8.customUniformLocations = o, t8.infLoc = n, t8.nanLoc = s, t8.outShapeLocation = a, t8.outShapeStridesLocation = i, t8.outTexShapeLocation = p; + for (let e of Object.values(this.binaryCache)) { + this.gpgpu.buildVao(e.webGLProgram); + let { variablesLocations: t10, customUniformLocations: o, infLoc: n, nanLoc: s, outShapeLocation: a, outShapeStridesLocation: i, outTexShapeLocation: p } = u0(this.gpgpu, e.program, e.webGLProgram); + e.variablesLocations = t10, e.customUniformLocations = o, e.infLoc = n, e.nanLoc = s, e.outShapeLocation = a, e.outShapeStridesLocation = i, e.outTexShapeLocation = p; } } - createTensorFromGPUData(t8, e, o) { - t8.channels = t8.channels || "RGBA"; - let { texture: n, height: s, width: a, channels: i } = t8, p = ur().backend; + createTensorFromGPUData(e, t10, o) { + e.channels = e.channels || "RGBA"; + let { texture: n, height: s, width: a, channels: i } = e, p = cr().backend; if (!p.gpgpu.gl.isTexture(n)) throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'."); - let u = p.writeTexture(n, e, o, s, a, i); - return ur().makeTensorFromDataId(u, e, o, p); - } -}; -Oc.nextDataId = 0; -function n9(r15, t8) { - if (t8 === "float32" || t8 === "complex64") - return r15; - if (t8 === "int32" || t8 === "bool") { - let e = t8 === "int32" ? new Int32Array(r15.length) : new Uint8Array(r15.length); - for (let o = 0; o < e.length; ++o) - e[o] = Math.round(r15[o]); - return e; + let u = p.writeTexture(n, t10, o, s, a, i); + return cr().makeTensorFromDataId(u, t10, o, p); + } +}; +Ul.nextDataId = 0; +function RJ(r16, e) { + if (e === "float32" || e === "complex64") + return r16; + if (e === "int32" || e === "bool") { + let t10 = e === "int32" ? new Int32Array(r16.length) : new Uint8Array(r16.length); + for (let o = 0; o < t10.length; ++o) + t10[o] = Math.round(r16[o]); + return t10; } else - throw new Error(`Unknown dtype ${t8}`); + throw new Error(`Unknown dtype ${e}`); } -var s9 = "4.14.0"; -function LD() { +var DJ = "4.17.0"; +function EA() { A().set("WEBGL_FORCE_F16_TEXTURES", true); } -Ji.isBrowser() && tu("webgl", () => new Oc(), 2); -var Cat = { forceHalfFloat: LD }; -var Mc = ` +uu.isBrowser() && pu("webgl", () => new Ul(), 2); +var sut = { forceHalfFloat: EA }; +var Gl = ` if (isnan(a)) return a; if (isnan(b)) return b; `; -var Fr = class { - constructor(t8, e, o) { - this.variableNames = ["A", "B"], this.outputShape = w.assertAndGetBroadcastShape(e, o), this.enableShapeUniforms = ut(this.outputShape.length), this.userCode = ` +var Br = class { + constructor(e, t10, o) { + this.variableNames = ["A", "B"], this.outputShape = C.assertAndGetBroadcastShape(t10, o), this.enableShapeUniforms = lt(this.outputShape.length), this.userCode = ` float binaryOperation(float a, float b) { - ${t8} + ${e} } void main() { @@ -18635,17 +18731,17 @@ var Fr = class { `; } }; -var jr = ` +var to = ` result.r = isNaN.r ? NAN : result.r; result.g = isNaN.g ? NAN : result.g; result.b = isNaN.b ? NAN : result.b; result.a = isNaN.a ? NAN : result.a; `; -var qr = class { - constructor(t8, e, o, n = false) { - this.variableNames = ["A", "B"], this.supportsBroadcasting = true, this.packedInputs = true, this.packedOutput = true, this.outputShape = w.assertAndGetBroadcastShape(e, o); +var eo = class { + constructor(e, t10, o, n = false) { + this.variableNames = ["A", "B"], this.supportsBroadcasting = true, this.packedInputs = true, this.packedOutput = true, this.outputShape = C.assertAndGetBroadcastShape(t10, o); let s = this.outputShape.length; - this.enableShapeUniforms = ut(s); + this.enableShapeUniforms = lt(s); let a = ""; if (n) if (s === 0 || y.sizeFromShape(this.outputShape) === 1) @@ -18667,7 +18763,7 @@ var qr = class { result.w = 0.; `; else { - let p = Rt("coords", s); + let p = At("coords", s); this.enableShapeUniforms ? a += ` bool nextRowOutOfBounds = (${p[s - 2]} + 1) >= outShape[${s} - 2]; @@ -18688,7 +18784,7 @@ var qr = class { } this.userCode = ` vec4 binaryOperation(vec4 a, vec4 b) { - ${t8} + ${e} } void main() { @@ -18703,88 +18799,88 @@ var qr = class { `; } }; -function Dt(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; - return e.incRef(o.dataId), { dataId: o.dataId, shape: o.shape, dtype: o.dtype }; +function Ft(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; + return t10.incRef(o.dataId), { dataId: o.dataId, shape: o.shape, dtype: o.dtype }; } -var BD = { kernelName: Co, backendName: "webgl", kernelFunc: Dt }; -function Pr(r15) { - let { inputs: t8, backend: e } = r15, { real: o, imag: n } = t8, s = e.makeTensorInfo(o.shape, "complex64"), a = e.texData.get(s.dataId), i = Dt({ inputs: { x: o }, backend: e }), p = Dt({ inputs: { x: n }, backend: e }); +var $A = { kernelName: vo, backendName: "webgl", kernelFunc: Ft }; +function zr(r16) { + let { inputs: e, backend: t10 } = r16, { real: o, imag: n } = e, s = t10.makeTensorInfo(o.shape, "complex64"), a = t10.texData.get(s.dataId), i = Ft({ inputs: { x: o }, backend: t10 }), p = Ft({ inputs: { x: n }, backend: t10 }); return a.complexTensorInfos = { real: i, imag: p }, s; } -var zD = { kernelName: Ri, backendName: "webgl", kernelFunc: Pr }; -var fv = "return (a < 0.) ? b * a : a;"; -var hv = ` +var RA = { kernelName: ei, backendName: "webgl", kernelFunc: zr }; +var _0 = "return (a < 0.) ? b * a : a;"; +var E0 = ` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); `; -function a9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { alpha: s } = o, a = e.makeTensorInfo([], "float32", y.createScalarValue(s, "float32")), i = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new qr(hv, n.shape, a.shape) : new Fr(fv, n.shape, a.shape), p = e.runWebGLProgram(i, [n, a], "float32"); - return e.disposeIntermediateTensorInfo(a), p; +function AJ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { alpha: s } = o, a = t10.makeTensorInfo([], "float32", y.createScalarValue(s, "float32")), i = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new eo(E0, n.shape, a.shape) : new Br(_0, n.shape, a.shape), p = t10.runWebGLProgram(i, [n, a], "float32"); + return t10.disposeIntermediateTensorInfo(a), p; } -var VD = { kernelName: En, backendName: "webgl", kernelFunc: a9 }; -var gv = "return (a < 0.) ? b * a : a;"; -var xv = ` +var DA = { kernelName: Yn, backendName: "webgl", kernelFunc: AJ }; +var $0 = "return (a < 0.) ? b * a : a;"; +var R0 = ` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); `; -function i9(r15) { - let { inputs: t8, backend: e } = r15, { x: o, alpha: n } = t8, s = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new qr(xv, o.shape, n.shape) : new Fr(gv, o.shape, n.shape); - return e.runWebGLProgram(s, [o, n], "float32"); +function FJ(r16) { + let { inputs: e, backend: t10 } = r16, { x: o, alpha: n } = e, s = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new eo(R0, o.shape, n.shape) : new Br($0, o.shape, n.shape); + return t10.runWebGLProgram(s, [o, n], "float32"); } -var WD = { kernelName: rs, backendName: "webgl", kernelFunc: i9 }; -var Fo = "if (isnan(x)) return x;"; -function xe({ opSnippet: r15, packedOpSnippet: t8, cpuKernelImpl: e, dtype: o }) { +var AA = { kernelName: gs, backendName: "webgl", kernelFunc: FJ }; +var sn = "if (isnan(x)) return x;"; +function xe({ opSnippet: r16, packedOpSnippet: e, cpuKernelImpl: t10, dtype: o }) { return ({ inputs: n, backend: s }) => { let { x: a } = n, i = s, p = o || a.dtype; - if (i.shouldExecuteOnCPU([a]) && e != null) { - let l = i.texData.get(a.dataId), m = e(l.values, p); + if (i.shouldExecuteOnCPU([a]) && t10 != null) { + let c = i.texData.get(a.dataId), m = t10(c.values, p); return i.makeTensorInfo(a.shape, p, m); } - let u = A().getBool("WEBGL_PACK_UNARY_OPERATIONS") && t8 != null, c; - return u ? c = new Ar(a.shape, t8) : c = new tr(a.shape, r15), i.runWebGLProgram(c, [a], p); + let u = A().getBool("WEBGL_PACK_UNARY_OPERATIONS") && e != null, l; + return u ? l = new Lr(a.shape, e) : l = new nr(a.shape, r16), i.runWebGLProgram(l, [a], p); }; } -function nt({ opSnippet: r15, packedOpSnippet: t8, checkOutOfBounds: e = false, supportsComplex: o = false, cpuKernelImpl: n, dtype: s }) { +function st({ opSnippet: r16, packedOpSnippet: e, checkOutOfBounds: t10 = false, supportsComplex: o = false, cpuKernelImpl: n, dtype: s }) { return ({ inputs: a, backend: i }) => { - let { a: p, b: u } = a, c = i; + let { a: p, b: u } = a, l = i; if (o && p.dtype === "complex64") { - let f = c.texData.get(p.dataId), h = c.texData.get(u.dataId), [g, x] = [[f.complexTensorInfos.real, h.complexTensorInfos.real], [f.complexTensorInfos.imag, h.complexTensorInfos.imag]].map((C) => { - let [S, k] = C, _ = { dataId: S.dataId, dtype: S.dtype, shape: p.shape }, E = { dataId: k.dataId, dtype: k.dtype, shape: u.shape }, R = new Fr(r15, p.shape, u.shape); - return c.runWebGLProgram(R, [_, E], dt(S.dtype, k.dtype)); - }), b = Pr({ inputs: { real: g, imag: x }, backend: c }); - return c.disposeIntermediateTensorInfo(g), c.disposeIntermediateTensorInfo(x), b; - } - let l = s || dt(p.dtype, u.dtype); - if ((p.dtype === "string" || u.dtype === "string" || c.shouldExecuteOnCPU([p, u])) && n != null) { - let f = c.texData.get(p.dataId).values, h = c.texData.get(u.dataId).values, g = p.dtype === "string" ? w.fromUint8ToStringArray(f) : f, x = p.dtype === "string" ? w.fromUint8ToStringArray(h) : h, [b, C] = n(p.shape, u.shape, g, x, l), S = c.makeTensorInfo(C, l), k = c.texData.get(S.dataId); + let f = l.texData.get(p.dataId), h = l.texData.get(u.dataId), [g, x] = [[f.complexTensorInfos.real, h.complexTensorInfos.real], [f.complexTensorInfos.imag, h.complexTensorInfos.imag]].map((w) => { + let [S, k] = w, T = { dataId: S.dataId, dtype: S.dtype, shape: p.shape }, E = { dataId: k.dataId, dtype: k.dtype, shape: u.shape }, R = new Br(r16, p.shape, u.shape); + return l.runWebGLProgram(R, [T, E], pt(S.dtype, k.dtype)); + }), b = zr({ inputs: { real: g, imag: x }, backend: l }); + return l.disposeIntermediateTensorInfo(g), l.disposeIntermediateTensorInfo(x), b; + } + let c = s || pt(p.dtype, u.dtype); + if ((p.dtype === "string" || u.dtype === "string" || l.shouldExecuteOnCPU([p, u])) && n != null) { + let f = l.texData.get(p.dataId).values, h = l.texData.get(u.dataId).values, g = p.dtype === "string" ? C.fromUint8ToStringArray(f) : f, x = p.dtype === "string" ? C.fromUint8ToStringArray(h) : h, [b, w] = n(p.shape, u.shape, g, x, c), S = l.makeTensorInfo(w, c), k = l.texData.get(S.dataId); return k.values = b, S; } - let m = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") && t8 != null, d; - return m ? d = new qr(t8, p.shape, u.shape, e) : d = new Fr(r15, p.shape, u.shape), c.runWebGLProgram(d, [p, u], l); + let m = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") && e != null, d; + return m ? d = new eo(e, p.shape, u.shape, t10) : d = new Br(r16, p.shape, u.shape), l.runWebGLProgram(d, [p, u], c); }; } -function xi(r15, t8 = false) { - if (r15 === "linear") - return t8 ? AD : TD; - if (r15 === "relu") - return t8 ? PD : $D; - if (r15 === "elu") - return t8 ? FD : _D; - if (r15 === "relu6") - return t8 ? OD : ED; - if (r15 === "prelu") - return t8 ? xv : gv; - if (r15 === "leakyrelu") - return t8 ? hv : fv; - if (r15 === "sigmoid") - return t8 ? MD : RD; - throw new Error(`Activation ${r15} has not been implemented for the WebGL backend.`); -} -var Lc = class { - constructor(t8, e, o, n = false, s = false, a = false, i = null, p = false, u = false) { - this.variableNames = ["matrixA", "matrixB"], this.packedInputs = true, this.packedOutput = true, this.outputShape = o, this.enableShapeUniforms = ut(this.outputShape.length); - let c = n ? t8[1] : t8[2], l = Math.ceil(c / 2), m = n ? "i * 2, rc.y" : "rc.y, i * 2", d = s ? "rc.z, i * 2" : "i * 2, rc.z", f = n ? ["a.xxyy", "a.zzww"] : ["a.xxzz", "a.yyww"], h = s ? ["b.xzxz", "b.ywyw"] : ["b.xyxy", "b.zwzw"], g = "", x = ""; +function Ti(r16, e = false) { + if (r16 === "linear") + return e ? vA : yA; + if (r16 === "relu") + return e ? NA : CA; + if (r16 === "elu") + return e ? kA : bA; + if (r16 === "relu6") + return e ? TA : wA; + if (r16 === "prelu") + return e ? R0 : $0; + if (r16 === "leakyrelu") + return e ? E0 : _0; + if (r16 === "sigmoid") + return e ? _A : SA; + throw new Error(`Activation ${r16} has not been implemented for the WebGL backend.`); +} +var Hl = class { + constructor(e, t10, o, n = false, s = false, a = false, i = null, p = false, u = false) { + this.variableNames = ["matrixA", "matrixB"], this.packedInputs = true, this.packedOutput = true, this.outputShape = o, this.enableShapeUniforms = lt(this.outputShape.length); + let l = n ? e[1] : e[2], c = Math.ceil(l / 2), m = n ? "i * 2, rc.y" : "rc.y, i * 2", d = s ? "rc.z, i * 2" : "i * 2, rc.z", f = n ? ["a.xxyy", "a.zzww"] : ["a.xxzz", "a.yyww"], h = s ? ["b.xzxz", "b.ywyw"] : ["b.xyxy", "b.zwzw"], g = "", x = ""; i && (p ? g = `vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${i} @@ -18796,17 +18892,17 @@ var Lc = class { }`, x = "result = activation(result);"); let b = a ? "result += getBiasAtOutCoords();" : ""; a && this.variableNames.push("bias"), p && this.variableNames.push("preluActivationWeights"), u && this.variableNames.push("leakyreluAlpha"); - let C = "rc.x", S = "rc.x"; - t8[0] < e[0] ? C = `imod(rc.x, ${t8[0]})` : e[0] < t8[0] && (S = `imod(rc.x, ${e[0]})`), this.userCode = ` + let w = "rc.x", S = "rc.x"; + e[0] < t10[0] ? w = `imod(rc.x, ${e[0]})` : t10[0] < e[0] && (S = `imod(rc.x, ${t10[0]})`), this.userCode = ` ${g} // Don't use uniform for sharedDimensionPacked for performance. - const float sharedDimension = ${l}.0; + const float sharedDimension = ${c}.0; vec4 dot2x2ARowBCol(ivec3 rc) { vec4 result = vec4(0); - int batchA = ${C}; + int batchA = ${w}; int batchB = ${S}; - for (int i = 0; i < ${l}; i++) { + for (int i = 0; i < ${c}; i++) { vec4 a = getMatrixA(batchA, ${m}); vec4 b = getMatrixB(batchB, ${d}); @@ -18831,13 +18927,13 @@ var Lc = class { `; } }; -var yv = { REAL: "return areal * breal - aimag * bimag;", IMAG: "return areal * bimag + aimag * breal;" }; -var Zl = class { - constructor(t8, e, o) { - this.variableNames = ["AReal", "AImag", "BReal", "BImag"], this.outputShape = w.assertAndGetBroadcastShape(e, o), this.userCode = ` +var D0 = { REAL: "return areal * breal - aimag * bimag;", IMAG: "return areal * bimag + aimag * breal;" }; +var im = class { + constructor(e, t10, o) { + this.variableNames = ["AReal", "AImag", "BReal", "BImag"], this.outputShape = C.assertAndGetBroadcastShape(t10, o), this.userCode = ` float binaryOpComplex( float areal, float aimag, float breal, float bimag) { - ${t8} + ${e} } void main() { @@ -18850,44 +18946,44 @@ var Zl = class { `; } }; -var UD = "return a * b;"; -function Jl(r15) { - let { inputs: t8, backend: e } = r15, { a: o, b: n } = t8, s = w.upcastType(o.dtype, n.dtype); +var FA = "return a * b;"; +function um(r16) { + let { inputs: e, backend: t10 } = r16, { a: o, b: n } = e, s = C.upcastType(o.dtype, n.dtype); if (o.dtype === "complex64") { - let i = e.texData.get(o.dataId), p = e.texData.get(n.dataId), u = new Zl(yv.REAL, o.shape, n.shape), c = new Zl(yv.IMAG, o.shape, n.shape), l = [{ dataId: i.complexTensorInfos.real.dataId, dtype: i.complexTensorInfos.real.dtype, shape: o.shape }, { dataId: i.complexTensorInfos.imag.dataId, dtype: i.complexTensorInfos.imag.dtype, shape: o.shape }, { dataId: p.complexTensorInfos.real.dataId, dtype: p.complexTensorInfos.real.dtype, shape: n.shape }, { dataId: p.complexTensorInfos.imag.dataId, dtype: p.complexTensorInfos.imag.dtype, shape: n.shape }], m = e.runWebGLProgram(u, l, "float32"), d = e.runWebGLProgram(c, l, "float32"), f = Pr({ inputs: { real: m, imag: d }, backend: e }); - return e.disposeIntermediateTensorInfo(m), e.disposeIntermediateTensorInfo(d), f; + let i = t10.texData.get(o.dataId), p = t10.texData.get(n.dataId), u = new im(D0.REAL, o.shape, n.shape), l = new im(D0.IMAG, o.shape, n.shape), c = [{ dataId: i.complexTensorInfos.real.dataId, dtype: i.complexTensorInfos.real.dtype, shape: o.shape }, { dataId: i.complexTensorInfos.imag.dataId, dtype: i.complexTensorInfos.imag.dtype, shape: o.shape }, { dataId: p.complexTensorInfos.real.dataId, dtype: p.complexTensorInfos.real.dtype, shape: n.shape }, { dataId: p.complexTensorInfos.imag.dataId, dtype: p.complexTensorInfos.imag.dtype, shape: n.shape }], m = t10.runWebGLProgram(u, c, "float32"), d = t10.runWebGLProgram(l, c, "float32"), f = zr({ inputs: { real: m, imag: d }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(m), t10.disposeIntermediateTensorInfo(d), f; } - if (e.shouldExecuteOnCPU([o, n])) { - let i = e.texData.get(o.dataId), p = e.texData.get(n.dataId), [u, c] = JR(o.shape, n.shape, i.values, p.values, s), l = e.makeTensorInfo(c, s), m = e.texData.get(l.dataId); - return m.values = u, l; + if (t10.shouldExecuteOnCPU([o, n])) { + let i = t10.texData.get(o.dataId), p = t10.texData.get(n.dataId), [u, l] = GD(o.shape, n.shape, i.values, p.values, s), c = t10.makeTensorInfo(l, s), m = t10.texData.get(c.dataId); + return m.values = u, c; } let a; - return A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? a = new qr(UD, o.shape, n.shape) : a = new Fr(UD, o.shape, n.shape), e.runWebGLProgram(a, [o, n], s); + return A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? a = new eo(FA, o.shape, n.shape) : a = new Br(FA, o.shape, n.shape), t10.runWebGLProgram(a, [o, n], s); } -var GD = { kernelName: Xn, backendName: "webgl", kernelFunc: Jl }; -function HD(r15, t8, e) { - let o = [hi(r15.shape), ...gi(r15.shape)], n = { dtype: r15.dtype, shape: o, dataId: r15.dataId }, s = [hi(t8), ...gi(t8)], a = new Pc(s, o), i = true, p = [o], u = e.runWebGLProgram(a, [n], r15.dtype, p, i); - return { dataId: u.dataId, shape: t8, dtype: u.dtype }; +var PA = { kernelName: $o, backendName: "webgl", kernelFunc: um }; +function OA(r16, e, t10) { + let o = [ki(r16.shape), ...Ni(r16.shape)], n = { dtype: r16.dtype, shape: o, dataId: r16.dataId }, s = [ki(e), ...Ni(e)], a = new Wl(s, o), i = true, p = [o], u = t10.runWebGLProgram(a, [n], r16.dtype, p, i); + return { dataId: u.dataId, shape: e, dtype: u.dtype }; } -function te(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { shape: s } = o, a = e, i = y.sizeFromShape(n.shape), p = y.inferFromImplicitShape(s, i), u = y.sizeFromShape(p); +function te(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { shape: s } = o, a = t10, i = y.sizeFromShape(n.shape), p = y.inferFromImplicitShape(s, i), u = y.sizeFromShape(p); y.assert(i === u, () => `The new shape (${p}) has ${u} elements and the old shape (${n.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`); - let c = a.texData.get(n.dataId); - return c.isPacked && !hu(n.shape, p) && !(c.texture !== null && hu(c.shape, p)) ? HD(n, p, a) : (a.incRef(n.dataId), { dataId: n.dataId, shape: p, dtype: n.dtype }); + let l = a.texData.get(n.dataId); + return l.isPacked && !vu(n.shape, p) && !(l.texture !== null && vu(l.shape, p)) ? OA(n, p, a) : (a.incRef(n.dataId), { dataId: n.dataId, shape: p, dtype: n.dtype }); } -var KD = { kernelName: da, backendName: "webgl", kernelFunc: te }; -var em = class { - constructor(t8, e) { +var MA = { kernelName: Ca, backendName: "webgl", kernelFunc: te }; +var pm = class { + constructor(e, t10) { this.variableNames = ["x"]; - let { windowSize: o, batchSize: n, inSize: s, outSize: a } = t8; + let { windowSize: o, batchSize: n, inSize: s, outSize: a } = e; this.outputShape = [n, a]; let i = Math.floor(o / 4) * 4, p = o % 4, u = "sumValue += dot(values, ones);"; - if (e != null) { - let l = 1 / e; - u = `sumValue += dot(values * ${y.isInt(l) ? l.toPrecision(2) : l}, ones);`; + if (t10 != null) { + let c = 1 / t10; + u = `sumValue += dot(values * ${y.isInt(c) ? c.toPrecision(2) : c}, ones);`; } - let c = ""; - s % o > 0 && (c = ` + let l = ""; + s % o > 0 && (l = ` if (inIdx < 0 || inIdx >= ${s}) { return 0.0; } @@ -18895,7 +18991,7 @@ var em = class { const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { - ${c} + ${l} return getX(batch, inIdx); } @@ -18943,24 +19039,24 @@ var em = class { `; } }; -var hh = class { - constructor(t8, e) { +var Th = class { + constructor(e, t10) { this.variableNames = ["x"]; - let { windowSize: o, batchSize: n, inSize: s, outSize: a } = t8; + let { windowSize: o, batchSize: n, inSize: s, outSize: a } = e; this.outputShape = [n, a]; let i = "0.0", p = ""; - e === "prod" ? i = "1.0" : e === "min" ? (i = "1.0 / 1e-20", p = "min") : e === "max" && (i = "-1.0 / 1e-20", p = "max"); - let u = `${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; - e === "sum" ? u = "sumValue" : e === "prod" ? u = "prodValue" : e === "all" ? u = "allValue" : e === "any" && (u = "anyValue"); - let c = Math.floor(o / 4) * 4, l = o % 4, m = ` - if (${e === "sum"}) { + t10 === "prod" ? i = "1.0" : t10 === "min" ? (i = "1.0 / 1e-20", p = "min") : t10 === "max" && (i = "-1.0 / 1e-20", p = "max"); + let u = `${t10}(${t10}(${t10}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; + t10 === "sum" ? u = "sumValue" : t10 === "prod" ? u = "prodValue" : t10 === "all" ? u = "allValue" : t10 === "any" && (u = "anyValue"); + let l = Math.floor(o / 4) * 4, c = o % 4, m = ` + if (${t10 === "sum"}) { sumValue += dot(values, ones); - } else if (${e === "prod"}) { + } else if (${t10 === "prod"}) { vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]); prodValue *= tmp[0] * tmp[1]; } else { minMaxValue = ${p}(values, minMaxValue); - if (${e === "min"} || ${e === "max"}) { + if (${t10 === "min"} || ${t10 === "max"}) { minMaxValue = ${p}(values, minMaxValue); bvec4 isNaN = isnan(values); if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) { @@ -18969,11 +19065,11 @@ var hh = class { } } `, d = "vec4"; - e === "all" ? (i = "1.0", m = ` + t10 === "all" ? (i = "1.0", m = ` bool reducedAllValue = all(values); float floatedReducedAllValue = float(reducedAllValue); allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); - `, d = "bvec4") : e === "any" && (i = "0.0", m = ` + `, d = "bvec4") : t10 === "any" && (i = "0.0", m = ` bool reducedAnyValue = any(values); float floatedReducedAnyValue = float(reducedAnyValue); anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); @@ -19004,7 +19100,7 @@ var hh = class { float allValue = 1.0; float anyValue = 0.0; - for (int i = 0; i < ${c}; i += 4) { + for (int i = 0; i < ${l}; i += 4) { int inIdx = inOffset + i; ${d} values = ${d}( getValue(batch, inIdx), @@ -19016,8 +19112,8 @@ var hh = class { ${m} } - int inIdx = inOffset + ${c}; - if (${l === 1}) { + int inIdx = inOffset + ${l}; + if (${c === 1}) { ${d} values = ${d}( getValue(batch, inIdx), initializationValue, @@ -19026,7 +19122,7 @@ var hh = class { ); ${m} - } else if (${l === 2}) { + } else if (${c === 2}) { ${d} values = ${d}( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -19035,7 +19131,7 @@ var hh = class { ); ${m} - } else if (${l === 3}) { + } else if (${c === 3}) { ${d} values = ${d}( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -19050,30 +19146,30 @@ var hh = class { `; } }; -function p9(r15) { - let t8 = []; - for (; t8.length === 0 || t8[t8.length - 1].outSize !== 1; ) { - let e = t8.length ? t8[t8.length - 1].outSize : r15[1], o = w.computeOptimalWindowSize(e); - t8.push({ inSize: e, windowSize: o, outSize: Math.ceil(e / o) }); +function OJ(r16) { + let e = []; + for (; e.length === 0 || e[e.length - 1].outSize !== 1; ) { + let t10 = e.length ? e[e.length - 1].outSize : r16[1], o = C.computeOptimalWindowSize(t10); + e.push({ inSize: t10, windowSize: o, outSize: Math.ceil(t10 / o) }); } - return t8; + return e; } -function Xr(r15, t8, e, o) { - let n = p9(r15.shape), s = r15; +function ro(r16, e, t10, o) { + let n = OJ(r16.shape), s = r16; for (let a = 0; a < n.length; a++) { - let { inSize: i, windowSize: p, outSize: u } = n[a], c, l; - e === "mean" ? c = a === 0 ? new em({ windowSize: p, inSize: i, batchSize: r15.shape[0], outSize: u }, i) : new em({ windowSize: p, inSize: i, batchSize: r15.shape[0], outSize: u }) : c = new hh({ windowSize: p, inSize: i, batchSize: r15.shape[0], outSize: u }, e), l = s, s = o.runWebGLProgram(c, [s], t8), l.dataId !== r15.dataId && o.disposeIntermediateTensorInfo(l); + let { inSize: i, windowSize: p, outSize: u } = n[a], l, c; + t10 === "mean" ? l = a === 0 ? new pm({ windowSize: p, inSize: i, batchSize: r16.shape[0], outSize: u }, i) : new pm({ windowSize: p, inSize: i, batchSize: r16.shape[0], outSize: u }) : l = new Th({ windowSize: p, inSize: i, batchSize: r16.shape[0], outSize: u }, t10), c = s, s = o.runWebGLProgram(l, [s], e), c.dataId !== r16.dataId && o.disposeIntermediateTensorInfo(c); } return s; } -var gh = class { - constructor(t8, e) { +var _h = class { + constructor(e, t10) { this.variableNames = ["A"]; - let o = new Array(t8.length); + let o = new Array(e.length); for (let a = 0; a < o.length; a++) - o[a] = t8[e[a]]; + o[a] = e[t10[a]]; this.outputShape = o, this.rank = o.length; - let n = Re(this.rank), s = c9(e); + let n = Re(this.rank), s = MJ(t10); this.userCode = ` void main() { ${n} resRC = getOutputCoords(); @@ -19082,26 +19178,26 @@ var gh = class { `; } }; -function c9(r15) { - let t8 = r15.length; - if (t8 > 6) - throw Error(`Transpose for rank ${t8} is not yet supported`); - let e = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u", "resRC.v"], o = new Array(t8); - for (let n = 0; n < r15.length; n++) - o[r15[n]] = e[n]; +function MJ(r16) { + let e = r16.length; + if (e > 6) + throw Error(`Transpose for rank ${e} is not yet supported`); + let t10 = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u", "resRC.v"], o = new Array(e); + for (let n = 0; n < r16.length; n++) + o[r16[n]] = t10[n]; return o.join(); } -var xh = class { - constructor(t8, e) { +var Eh = class { + constructor(e, t10) { this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true; - let o = new Array(t8.length); - for (let c = 0; c < o.length; c++) - o[c] = t8[e[c]]; + let o = new Array(e.length); + for (let l = 0; l < o.length; l++) + o[l] = e[t10[l]]; if (this.outputShape = o, this.rank = o.length, this.rank > 6) throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`); - let n = Re(this.rank), s = mv("rc", this.rank), a = new Array(this.rank); - for (let c = 0; c < e.length; c++) - a[e[c]] = s[c]; + let n = Re(this.rank), s = N0("rc", this.rank), a = new Array(this.rank); + for (let l = 0; l < t10.length; l++) + a[t10[l]] = s[l]; let i = `vec2(${a.slice(-2).join()})`, p = `++${s[this.rank - 1]} < ${o[this.rank - 1]}`, u = `getChannel(getA(${a.join()}), ${i})`; this.userCode = ` void main() { @@ -19123,54 +19219,54 @@ var xh = class { `; } }; -function gu(r15, t8, e) { - let o = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new xh(r15.shape, t8) : new gh(r15.shape, t8); - return e.runWebGLProgram(o, [r15], r15.dtype); +function ku(r16, e, t10) { + let o = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new Eh(r16.shape, e) : new _h(r16.shape, e); + return t10.runWebGLProgram(o, [r16], r16.dtype); } -function qD(r15, t8, e, o) { - let n = t8, s = r15.shape.length, a = y.parseAxisParam(n, r15.shape), i = a, p = w.getAxesPermutation(i, s), u = p != null, c = r15; - u && (c = gu(r15, p, o), i = w.getInnerMostAxes(i.length, s)), w.assertAxesAreInnerMostDims("sum", i, s); - let [l, m] = w.computeOutAndReduceShapes(c.shape, i), d = l; - e && (d = w.expandShapeToKeepDim(l, a)); - let f = y.sizeFromShape(m), g = y.sizeFromShape(r15.shape) / f, x = te({ inputs: { x: c }, attrs: { shape: [g, f] }, backend: o }), b = oi(r15.dtype), C = Xr(x, b, "sum", o), S = te({ inputs: { x: C }, attrs: { shape: d }, backend: o }); - return o.disposeIntermediateTensorInfo(x), o.disposeIntermediateTensorInfo(C), u && o.disposeIntermediateTensorInfo(c), S; +function LA(r16, e, t10, o) { + let n = e, s = r16.shape.length, a = y.parseAxisParam(n, r16.shape), i = a, p = C.getAxesPermutation(i, s), u = p != null, l = r16; + u && (l = ku(r16, p, o), i = C.getInnerMostAxes(i.length, s)), C.assertAxesAreInnerMostDims("sum", i, s); + let [c, m] = C.computeOutAndReduceShapes(l.shape, i), d = c; + t10 && (d = C.expandShapeToKeepDim(c, a)); + let f = y.sizeFromShape(m), g = y.sizeFromShape(r16.shape) / f, x = te({ inputs: { x: l }, attrs: { shape: [g, f] }, backend: o }), b = mi(r16.dtype), w = ro(x, b, "sum", o), S = te({ inputs: { x: w }, attrs: { shape: d }, backend: o }); + return o.disposeIntermediateTensorInfo(x), o.disposeIntermediateTensorInfo(w), u && o.disposeIntermediateTensorInfo(l), S; } -function bp(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; - return qD(n, s, a, e); +function Tp(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; + return LA(n, s, a, t10); } -var jD = { kernelName: Ss, backendName: "webgl", kernelFunc: bp }; -function bt(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { perm: s } = o, a = e, i = n.shape.length, p = new Array(i); - for (let c = 0; c < p.length; c++) - p[c] = n.shape[s[c]]; +var BA = { kernelName: As, backendName: "webgl", kernelFunc: Tp }; +function Ct(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { perm: s } = o, a = t10, i = n.shape.length, p = new Array(i); + for (let l = 0; l < p.length; l++) + p[l] = n.shape[s[l]]; let u; if (a.shouldExecuteOnCPU([n])) { - let l = a.texData.get(n.dataId).values, m = yp(l, n.shape, n.dtype, s, p); + let c = a.texData.get(n.dataId).values, m = Np(c, n.shape, n.dtype, s, p); u = a.makeTensorInfo(p, n.dtype); let d = a.texData.get(u.dataId); d.values = m; } else - u = gu(n, s, a); + u = ku(n, s, a); return u; } -var XD = { kernelName: po, backendName: "webgl", kernelFunc: bt }; -var bv = 1e3; -function Cp({ a: r15, b: t8, transposeA: e, transposeB: o, backend: n, bias: s = null, preluActivationWeights: a = null, leakyreluAlpha: i = 0, activation: p = null }) { - let u = r15.shape.length, c = t8.shape.length, l = e ? r15.shape[u - 2] : r15.shape[u - 1], m = o ? t8.shape[c - 1] : t8.shape[c - 2], d = e ? r15.shape[u - 1] : r15.shape[u - 2], f = o ? t8.shape[c - 2] : t8.shape[c - 1], h = r15.shape.slice(0, -2), g = t8.shape.slice(0, -2), x = y.sizeFromShape(h), b = y.sizeFromShape(g), S = Sr.assertAndGetBroadcastShape(r15.shape.slice(0, -2), t8.shape.slice(0, -2)).concat([d, f]); - y.assert(l === m, () => `Error in matMul: inner shapes (${l}) and (${m}) of Tensors with shapes ${r15.shape} and ${t8.shape} and transposeA=${e} and transposeB=${o} must match.`); - let k = e ? [x, l, d] : [x, d, l], _ = o ? [b, f, m] : [b, m, f], E = te({ inputs: { x: r15 }, backend: n, attrs: { shape: k } }), R = te({ inputs: { x: t8 }, backend: n, attrs: { shape: _ } }), D = [E, R], P = Math.max(x, b), O = e ? E.shape[1] : E.shape[2], M = s != null, L = a != null, B = p === "leakyrelu", z = p != null ? xi(p, true) : null, U = M || L || B || z != null, j; - if ((d === 1 || f === 1) && O > bv && U === false) { +var zA = { kernelName: Kr, backendName: "webgl", kernelFunc: Ct }; +var A0 = 1e3; +function _p({ a: r16, b: e, transposeA: t10, transposeB: o, backend: n, bias: s = null, preluActivationWeights: a = null, leakyreluAlpha: i = 0, activation: p = null }) { + let u = r16.shape.length, l = e.shape.length, c = t10 ? r16.shape[u - 2] : r16.shape[u - 1], m = o ? e.shape[l - 1] : e.shape[l - 2], d = t10 ? r16.shape[u - 1] : r16.shape[u - 2], f = o ? e.shape[l - 2] : e.shape[l - 1], h = r16.shape.slice(0, -2), g = e.shape.slice(0, -2), x = y.sizeFromShape(h), b = y.sizeFromShape(g), S = kr.assertAndGetBroadcastShape(r16.shape.slice(0, -2), e.shape.slice(0, -2)).concat([d, f]); + y.assert(c === m, () => `Error in matMul: inner shapes (${c}) and (${m}) of Tensors with shapes ${r16.shape} and ${e.shape} and transposeA=${t10} and transposeB=${o} must match.`); + let k = t10 ? [x, c, d] : [x, d, c], T = o ? [b, f, m] : [b, m, f], E = te({ inputs: { x: r16 }, backend: n, attrs: { shape: k } }), R = te({ inputs: { x: e }, backend: n, attrs: { shape: T } }), D = [E, R], F = Math.max(x, b), O = t10 ? E.shape[1] : E.shape[2], M = s != null, L = a != null, B = p === "leakyrelu", z = p != null ? Ti(p, true) : null, U = M || L || B || z != null, j; + if ((d === 1 || f === 1) && O > A0 && U === false) { let Y = E, J = R; - e && (Y = bt({ inputs: { x: E }, backend: n, attrs: { perm: [0, 2, 1] } }), D.push(Y)), o && (J = bt({ inputs: { x: R }, backend: n, attrs: { perm: [0, 2, 1] } }), D.push(J)); + t10 && (Y = Ct({ inputs: { x: E }, backend: n, attrs: { perm: [0, 2, 1] } }), D.push(Y)), o && (J = Ct({ inputs: { x: R }, backend: n, attrs: { perm: [0, 2, 1] } }), D.push(J)); let re = f !== 1, ne = f === 1, ee = Y; - re && (ee = te({ inputs: { x: Y }, backend: n, attrs: { shape: [P, O, 1] } }), D.push(ee)); - let oe = f === 1 ? 2 : 1, ie = J; - ne && (ie = te({ inputs: { x: J }, backend: n, attrs: { shape: [P, 1, O] } }), D.push(ie)); - let le = Jl({ inputs: { a: ee, b: ie }, backend: n }); - j = bp({ inputs: { x: le }, backend: n, attrs: { axis: oe, keepDims: true } }), D.push(le); + re && (ee = te({ inputs: { x: Y }, backend: n, attrs: { shape: [F, O, 1] } }), D.push(ee)); + let oe = f === 1 ? 2 : 1, ue = J; + ne && (ue = te({ inputs: { x: J }, backend: n, attrs: { shape: [F, 1, O] } }), D.push(ue)); + let me = um({ inputs: { a: ee, b: ue }, backend: n }); + j = Tp({ inputs: { x: me }, backend: n, attrs: { axis: oe, keepDims: true } }), D.push(me); } else { - let Y = dt(r15.dtype, t8.dtype), J = new Lc(k, _, [P, d, f], e, o, M, z, L, B), re = [E, R]; + let Y = pt(r16.dtype, e.dtype), J = new Hl(k, T, [F, d, f], t10, o, M, z, L, B), re = [E, R]; if (s != null && re.push(s), L && re.push(a), B) { let ne = n.makeTensorInfo([], "float32", y.createScalarValue(i, "float32")); re.push(ne), D.push(ne); @@ -19183,41 +19279,41 @@ function Cp({ a: r15, b: t8, transposeA: e, transposeB: o, backend: n, bias: s = n.disposeIntermediateTensorInfo(Y); return q; } -function l9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s, bias: a, preluActivationWeights: i } = t8, { transposeA: p, transposeB: u, activation: c, leakyreluAlpha: l } = o; - return Cp({ a: n, b: s, transposeA: p, transposeB: u, backend: e, bias: a, preluActivationWeights: i, leakyreluAlpha: l, activation: c }); +function LJ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s, bias: a, preluActivationWeights: i } = e, { transposeA: p, transposeB: u, activation: l, leakyreluAlpha: c } = o; + return _p({ a: n, b: s, transposeA: p, transposeB: u, backend: t10, bias: a, preluActivationWeights: i, leakyreluAlpha: c, activation: l }); } -var YD = { kernelName: So, backendName: "webgl", kernelFunc: l9 }; -var QD = "return abs(x);"; -function m9(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; - if (e.shouldExecuteOnCPU([o]) && o.dtype !== "complex64") { - let s = e.texData.get(o.dataId), a = ph(s.values); - return e.makeTensorInfo(o.shape, o.dtype, a); +var VA = { kernelName: qo, backendName: "webgl", kernelFunc: LJ }; +var WA = "return abs(x);"; +function BJ(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; + if (t10.shouldExecuteOnCPU([o]) && o.dtype !== "complex64") { + let s = t10.texData.get(o.dataId), a = wh(s.values); + return t10.makeTensorInfo(o.shape, o.dtype, a); } let n; - return A().getBool("WEBGL_PACK_UNARY_OPERATIONS") ? n = new Ar(o.shape, QD) : n = new tr(o.shape, QD), e.runWebGLProgram(n, [o], o.dtype); + return A().getBool("WEBGL_PACK_UNARY_OPERATIONS") ? n = new Lr(o.shape, WA) : n = new nr(o.shape, WA), t10.runWebGLProgram(n, [o], o.dtype); } -var ZD = { kernelName: Xs, backendName: "webgl", kernelFunc: m9 }; -var d9 = Wt + ` +var UA = { kernelName: fn, backendName: "webgl", kernelFunc: BJ }; +var zJ = Gt + ` if (abs(x) > 1.) { return NAN; } return acos(x); `; -var f9 = xe({ opSnippet: d9 }); -var JD = { kernelName: Vo, backendName: "webgl", kernelFunc: f9 }; -var h9 = Wt + ` +var VJ = xe({ opSnippet: zJ }); +var GA = { kernelName: hn, backendName: "webgl", kernelFunc: VJ }; +var WJ = Gt + ` if (x < 1.0) return NAN; return log(x + sqrt(x * x - 1.0));`; -var g9 = xe({ opSnippet: h9 }); -var eA = { kernelName: Wo, backendName: "webgl", kernelFunc: g9 }; -var tA = "return a + b;"; -var x9 = nt({ opSnippet: tA, packedOpSnippet: tA, supportsComplex: true, cpuKernelImpl: DR }); -var rA = { kernelName: io, backendName: "webgl", kernelFunc: x9 }; -var yh = class { - constructor(t8, e) { - this.outputShape = [], this.outputShape = t8, this.variableNames = e.map((s, a) => `T${a}`); +var UJ = xe({ opSnippet: WJ }); +var HA = { kernelName: gn, backendName: "webgl", kernelFunc: UJ }; +var KA = "return a + b;"; +var GJ = st({ opSnippet: KA, packedOpSnippet: KA, supportsComplex: true, cpuKernelImpl: ID }); +var qA = { kernelName: Rr, backendName: "webgl", kernelFunc: GJ }; +var $h = class { + constructor(e, t10) { + this.outputShape = [], this.outputShape = e, this.variableNames = t10.map((s, a) => `T${a}`); let o = []; this.variableNames.forEach((s) => { o.push(`float v${s} = get${s}AtOutCoords();`); @@ -19234,9 +19330,9 @@ var yh = class { `; } }; -var bh = class { - constructor(t8, e) { - this.outputShape = [], this.packedInputs = true, this.packedOutput = true, this.outputShape = t8, this.variableNames = e.map((s, a) => `T${a}`); +var Rh = class { + constructor(e, t10) { + this.outputShape = [], this.packedInputs = true, this.packedOutput = true, this.outputShape = e, this.variableNames = t10.map((s, a) => `T${a}`); let o = []; this.variableNames.forEach((s) => { o.push(`vec4 v${s} = get${s}AtOutCoords();`); @@ -19253,48 +19349,48 @@ var bh = class { `; } }; -function Ch(r15) { - let { inputs: t8, backend: e } = r15, o = t8; +function Dh(r16) { + let { inputs: e, backend: t10 } = r16, o = e; if (o.length === 1) - return Dt({ inputs: { x: o[0] }, backend: e }); + return Ft({ inputs: { x: o[0] }, backend: t10 }); if (o.length > A().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")) { - let p = Math.floor(o.length / 2), u = Ch({ inputs: o.slice(0, p), backend: e }), c = Ch({ inputs: o.slice(p), backend: e }); - return Ch({ inputs: [u, c], backend: e }); + let p = Math.floor(o.length / 2), u = Dh({ inputs: o.slice(0, p), backend: t10 }), l = Dh({ inputs: o.slice(p), backend: t10 }); + return Dh({ inputs: [u, l], backend: t10 }); } - let n = o.map((p) => p.dtype).reduce((p, u) => dt(p, u)), s = o.map((p) => p.shape), i = A().getBool("WEBGL_PACK") ? new bh(o[0].shape, s) : new yh(o[0].shape, s); - return e.runWebGLProgram(i, o, n); + let n = o.map((p) => p.dtype).reduce((p, u) => pt(p, u)), s = o.map((p) => p.shape), i = A().getBool("WEBGL_PACK") ? new Rh(o[0].shape, s) : new $h(o[0].shape, s); + return t10.runWebGLProgram(i, o, n); } -var oA = { kernelName: Uo, backendName: "webgl", kernelFunc: Ch }; -function y9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, c = w.getAxesPermutation(u, i), l = n; - c != null && (l = bt({ inputs: { x: n }, backend: e, attrs: { perm: c } }), u = w.getInnerMostAxes(u.length, i)), w.assertAxesAreInnerMostDims("all", u, i); - let [m, d] = w.computeOutAndReduceShapes(l.shape, u), f = y.sizeFromShape(d), h = te({ inputs: { x: l }, backend: e, attrs: { shape: [-1, f] } }), g = Xr(h, h.dtype, "all", e), x; +var jA = { kernelName: xn, backendName: "webgl", kernelFunc: Dh }; +function HJ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, l = C.getAxesPermutation(u, i), c = n; + l != null && (c = Ct({ inputs: { x: n }, backend: t10, attrs: { perm: l } }), u = C.getInnerMostAxes(u.length, i)), C.assertAxesAreInnerMostDims("all", u, i); + let [m, d] = C.computeOutAndReduceShapes(c.shape, u), f = y.sizeFromShape(d), h = te({ inputs: { x: c }, backend: t10, attrs: { shape: [-1, f] } }), g = ro(h, h.dtype, "all", t10), x; if (a) { - let b = w.expandShapeToKeepDim(m, p); - x = te({ inputs: { x: g }, backend: e, attrs: { shape: b } }); + let b = C.expandShapeToKeepDim(m, p); + x = te({ inputs: { x: g }, backend: t10, attrs: { shape: b } }); } else - x = te({ inputs: { x: g }, backend: e, attrs: { shape: m } }); - return e.disposeIntermediateTensorInfo(h), e.disposeIntermediateTensorInfo(g), c != null && e.disposeIntermediateTensorInfo(l), x; -} -var nA = { kernelName: Go, backendName: "webgl", kernelFunc: y9 }; -function b9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, c = w.getAxesPermutation(u, i), l = n; - c != null && (l = bt({ inputs: { x: n }, backend: e, attrs: { perm: c } }), u = w.getInnerMostAxes(u.length, i)), w.assertAxesAreInnerMostDims("any", u, i); - let [m, d] = w.computeOutAndReduceShapes(l.shape, u), f = y.sizeFromShape(d), h = te({ inputs: { x: l }, backend: e, attrs: { shape: [-1, f] } }), g = Xr(h, h.dtype, "any", e), x; + x = te({ inputs: { x: g }, backend: t10, attrs: { shape: m } }); + return t10.disposeIntermediateTensorInfo(h), t10.disposeIntermediateTensorInfo(g), l != null && t10.disposeIntermediateTensorInfo(c), x; +} +var XA = { kernelName: yn, backendName: "webgl", kernelFunc: HJ }; +function KJ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, l = C.getAxesPermutation(u, i), c = n; + l != null && (c = Ct({ inputs: { x: n }, backend: t10, attrs: { perm: l } }), u = C.getInnerMostAxes(u.length, i)), C.assertAxesAreInnerMostDims("any", u, i); + let [m, d] = C.computeOutAndReduceShapes(c.shape, u), f = y.sizeFromShape(d), h = te({ inputs: { x: c }, backend: t10, attrs: { shape: [-1, f] } }), g = ro(h, h.dtype, "any", t10), x; if (a) { - let b = w.expandShapeToKeepDim(m, p); - x = te({ inputs: { x: g }, backend: e, attrs: { shape: b } }); + let b = C.expandShapeToKeepDim(m, p); + x = te({ inputs: { x: g }, backend: t10, attrs: { shape: b } }); } else - x = te({ inputs: { x: g }, backend: e, attrs: { shape: m } }); - return e.disposeIntermediateTensorInfo(h), e.disposeIntermediateTensorInfo(g), c != null && e.disposeIntermediateTensorInfo(l), x; + x = te({ inputs: { x: g }, backend: t10, attrs: { shape: m } }); + return t10.disposeIntermediateTensorInfo(h), t10.disposeIntermediateTensorInfo(g), l != null && t10.disposeIntermediateTensorInfo(c), x; } -var sA = { kernelName: Ho, backendName: "webgl", kernelFunc: b9 }; -var wh = class { - constructor(t8, e, o) { +var YA = { kernelName: bn, backendName: "webgl", kernelFunc: KJ }; +var Ah = class { + constructor(e, t10, o) { this.variableNames = ["A"]; - let { windowSize: n, batchSize: s, outSize: a } = t8; + let { windowSize: n, batchSize: s, outSize: a } = e; o || this.variableNames.push("bestIndicesA"), this.outputShape = [s, a]; - let i = e === "max" ? ">" : "<", p = o ? "inOffset + i;" : "round(getBestIndicesA(batch, inOffset + i));"; + let i = t10 === "max" ? ">" : "<", p = o ? "inOffset + i;" : "round(getBestIndicesA(batch, inOffset + i));"; this.userCode = ` void main() { ivec2 coords = getOutputCoords(); @@ -19318,43 +19414,43 @@ var wh = class { `; } }; -var Sh = class { - constructor(t8, e, o, n) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, y.assert(t8.length > 2, () => `Packed arg${o.charAt(0).toUpperCase() + o.slice(1)} supports only inputs with rank above 2.`); - let s = t8[t8.length - 1], a = Math.ceil(s / e); - this.outputShape = t8.slice(0, -1), a > 1 && this.outputShape.push(a), n || this.variableNames.push("bestIndicesA"); - let i = this.outputShape, p = i.length, u = Re(p), c = Rt("coords", p), l, m; +var Fh = class { + constructor(e, t10, o, n) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, y.assert(e.length > 2, () => `Packed arg${o.charAt(0).toUpperCase() + o.slice(1)} supports only inputs with rank above 2.`); + let s = e[e.length - 1], a = Math.ceil(s / t10); + this.outputShape = e.slice(0, -1), a > 1 && this.outputShape.push(a), n || this.variableNames.push("bestIndicesA"); + let i = this.outputShape, p = i.length, u = Re(p), l = At("coords", p), c, m; if (a === 1) { m = p + 1; let R = Re(m); - l = ` - ${R} sourceLocR = ${R}(${c.join()}, 0); - ++${c[p - 1]}; - ${R} sourceLocG = ${R}(${c.join()}, 0); - ++${c[p - 2]}; - ${R} sourceLocA = ${R}(${c.join()}, 0); - --${c[p - 1]}; - ${R} sourceLocB = ${R}(${c.join()}, 0); - --${c[p - 2]};`; + c = ` + ${R} sourceLocR = ${R}(${l.join()}, 0); + ++${l[p - 1]}; + ${R} sourceLocG = ${R}(${l.join()}, 0); + ++${l[p - 2]}; + ${R} sourceLocA = ${R}(${l.join()}, 0); + --${l[p - 1]}; + ${R} sourceLocB = ${R}(${l.join()}, 0); + --${l[p - 2]};`; } else - m = p, l = ` + m = p, c = ` ${u} sourceLocR = coords; - ++${c[p - 1]}; + ++${l[p - 1]}; ${u} sourceLocG = coords; - ++${c[p - 2]}; + ++${l[p - 2]}; ${u} sourceLocA = coords; - --${c[p - 1]}; + --${l[p - 1]}; ${u} sourceLocB = coords; - --${c[p - 2]};`; - let d = ["x", "y", "z", "w", "u", "v"].slice(0, m), f = "." + d[m - 1], h = d.map((R) => "int " + R), g = Rt("sourceLocR", m - 1).concat("inIdx.r"), x = Rt("sourceLocG", m - 1).concat("inIdx.g"), b = Rt("sourceLocB", m - 1).concat("inIdx.b"), C = Rt("sourceLocA", m - 1).concat("inIdx.a"), S = o === "max" ? "greaterThan" : "lessThan", k = n ? "" : ` + --${l[p - 2]};`; + let d = ["x", "y", "z", "w", "u", "v"].slice(0, m), f = "." + d[m - 1], h = d.map((R) => "int " + R), g = At("sourceLocR", m - 1).concat("inIdx.r"), x = At("sourceLocG", m - 1).concat("inIdx.g"), b = At("sourceLocB", m - 1).concat("inIdx.b"), w = At("sourceLocA", m - 1).concat("inIdx.a"), S = o === "max" ? "greaterThan" : "lessThan", k = n ? "" : ` inIdx = round(vec4(getBestIndicesAChannel(${g.join()}), getBestIndicesAChannel(${x.join()}), getBestIndicesAChannel(${b.join()}), - getBestIndicesAChannel(${C.join()})));`, _ = `vec4( + getBestIndicesAChannel(${w.join()})));`, T = `vec4( getAChannel(${g.join()}), hasNextCol ? getAChannel(${x.join()}) : 0., hasNextRow ? getAChannel(${b.join()}) : 0., - hasNextRow && hasNextCol ? getAChannel(${C.join()}) : 0.)`, E = n ? "" : ` + hasNextRow && hasNextCol ? getAChannel(${w.join()}) : 0.)`, E = n ? "" : ` float getBestIndicesAChannel(${h.join()}) { return getChannel(getBestIndicesA(${d.join()}), vec2(${d.slice(-2).join()})); @@ -19367,19 +19463,19 @@ var Sh = class { ${E} void main() { ${u} coords = getOutputCoords(); - bool hasNextCol = ${c[p - 1]} < ${i[p - 1] - 1}; - bool hasNextRow = ${c[p - 2]} < ${i[p - 2] - 1}; - ${l} + bool hasNextCol = ${l[p - 1]} < ${i[p - 1] - 1}; + bool hasNextRow = ${l[p - 2]} < ${i[p - 2] - 1}; + ${c} ivec4 srcIdx = ivec4(sourceLocR${f}, sourceLocG${f}, - sourceLocB${f}, sourceLocA${f}) * ${e}; + sourceLocB${f}, sourceLocA${f}) * ${t10}; ivec4 inIdx = srcIdx; vec4 bestIndex = vec4(inIdx); - vec4 bestValue = ${_}; + vec4 bestValue = ${T}; - for (int i = 0; i < ${e}; i++) { + for (int i = 0; i < ${t10}; i++) { inIdx = srcIdx; ${k} - vec4 candidate = ${_}; + vec4 candidate = ${T}; bvec4 nan = isnan(candidate); bvec4 replace = bvec4( vec4(${S}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); @@ -19396,94 +19492,94 @@ var Sh = class { `; } }; -function aA(r15, t8, e, o = null) { - let n = t8.shape[0], s = t8.shape[1]; +function QA(r16, e, t10, o = null) { + let n = e.shape[0], s = e.shape[1]; o != null && (n = o.shape[0], s = o.shape[1]); - let a = w.computeOptimalWindowSize(s), i = { windowSize: a, inSize: s, batchSize: n, outSize: Math.ceil(s / a) }, p = new wh(i, e, o == null), u = [t8]; + let a = C.computeOptimalWindowSize(s), i = { windowSize: a, inSize: s, batchSize: n, outSize: Math.ceil(s / a) }, p = new Ah(i, t10, o == null), u = [e]; o != null && u.push(o); - let c = r15.runWebGLProgram(p, u, "int32"); - if (c.shape[1] === 1) - return c; - let l = aA(r15, t8, e, c); - return r15.disposeIntermediateTensorInfo(c), l; -} -function iA(r15, t8, e, o = null) { - let n = o != null ? o.shape : t8.shape, s = n[n.length - 1], a = w.computeOptimalWindowSize(s), i = new Sh(n, a, e, o == null), p = o == null ? [t8] : [t8, o], u = r15.runWebGLProgram(i, p, "int32"); - if (u.shape.length === t8.shape.length) { - let c = iA(r15, t8, e, u); - return r15.disposeIntermediateTensorInfo(u), c; + let l = r16.runWebGLProgram(p, u, "int32"); + if (l.shape[1] === 1) + return l; + let c = QA(r16, e, t10, l); + return r16.disposeIntermediateTensorInfo(l), c; +} +function ZA(r16, e, t10, o = null) { + let n = o != null ? o.shape : e.shape, s = n[n.length - 1], a = C.computeOptimalWindowSize(s), i = new Fh(n, a, t10, o == null), p = o == null ? [e] : [e, o], u = r16.runWebGLProgram(i, p, "int32"); + if (u.shape.length === e.shape.length) { + let l = ZA(r16, e, t10, u); + return r16.disposeIntermediateTensorInfo(u), l; } return u; } -function Ih(r15, t8, e, o) { - let n = [e]; - if (w.assertAxesAreInnerMostDims("arg" + o.charAt(0).toUpperCase() + o.slice(1), n, t8.shape.length), !A().getBool("WEBGL_PACK_REDUCE") || t8.shape.length <= 2) { - let s = [], a = r15.texData.get(t8.dataId), i = a !== null && a.isPacked, p = t8; - i && (p = r15.unpackTensor(t8), s.push(p)); - let [u, c] = w.computeOutAndReduceShapes(p.shape, n), l = y.sizeFromShape(c), m = te({ inputs: { x: p }, backend: r15, attrs: { shape: [-1, l] } }); +function Ph(r16, e, t10, o) { + let n = [t10]; + if (C.assertAxesAreInnerMostDims("arg" + o.charAt(0).toUpperCase() + o.slice(1), n, e.shape.length), !A().getBool("WEBGL_PACK_REDUCE") || e.shape.length <= 2) { + let s = [], a = r16.texData.get(e.dataId), i = a !== null && a.isPacked, p = e; + i && (p = r16.unpackTensor(e), s.push(p)); + let [u, l] = C.computeOutAndReduceShapes(p.shape, n), c = y.sizeFromShape(l), m = te({ inputs: { x: p }, backend: r16, attrs: { shape: [-1, c] } }); s.push(m); - let d = aA(r15, m, o); + let d = QA(r16, m, o); s.push(d); - let f = te({ inputs: { x: d }, backend: r15, attrs: { shape: u } }); - return s.forEach((h) => r15.disposeIntermediateTensorInfo(h)), f; - } - return iA(r15, t8, o); -} -function C9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = w.getAxesPermutation(a, n.shape.length), p = n, u = []; - i != null && (p = bt({ inputs: { x: n }, backend: e, attrs: { perm: i } }), u.push(p), a = w.getInnerMostAxes(a.length, p.shape.length)), w.assertAxesAreInnerMostDims("argMax", [a[0]], p.shape.length); - let c = Ih(e, p, a[0], "max"); - return u.forEach((l) => e.disposeIntermediateTensorInfo(l)), c; -} -var uA = { kernelName: Ys, backendName: "webgl", kernelFunc: C9 }; -function w9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = w.getAxesPermutation(a, n.shape.length), p = n, u = []; - i != null && (p = bt({ inputs: { x: n }, backend: e, attrs: { perm: i } }), u.push(p), a = w.getInnerMostAxes(a.length, p.shape.length)), w.assertAxesAreInnerMostDims("argMin", [a[0]], p.shape.length); - let c = Ih(e, p, a[0], "min"); - return u.forEach((l) => e.disposeIntermediateTensorInfo(l)), c; -} -var pA = { kernelName: Qs, backendName: "webgl", kernelFunc: w9 }; -var S9 = Wt + ` + let f = te({ inputs: { x: d }, backend: r16, attrs: { shape: u } }); + return s.forEach((h) => r16.disposeIntermediateTensorInfo(h)), f; + } + return ZA(r16, e, o); +} +function qJ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = C.getAxesPermutation(a, n.shape.length), p = n, u = []; + i != null && (p = Ct({ inputs: { x: n }, backend: t10, attrs: { perm: i } }), u.push(p), a = C.getInnerMostAxes(a.length, p.shape.length)), C.assertAxesAreInnerMostDims("argMax", [a[0]], p.shape.length); + let l = Ph(t10, p, a[0], "max"); + return u.forEach((c) => t10.disposeIntermediateTensorInfo(c)), l; +} +var JA = { kernelName: na, backendName: "webgl", kernelFunc: qJ }; +function jJ(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = C.getAxesPermutation(a, n.shape.length), p = n, u = []; + i != null && (p = Ct({ inputs: { x: n }, backend: t10, attrs: { perm: i } }), u.push(p), a = C.getInnerMostAxes(a.length, p.shape.length)), C.assertAxesAreInnerMostDims("argMin", [a[0]], p.shape.length); + let l = Ph(t10, p, a[0], "min"); + return u.forEach((c) => t10.disposeIntermediateTensorInfo(c)), l; +} +var eF = { kernelName: sa, backendName: "webgl", kernelFunc: jJ }; +var XJ = Gt + ` if (abs(x) > 1.) { return NAN; } return asin(x); `; -var I9 = xe({ opSnippet: S9 }); -var cA = { kernelName: Ko, backendName: "webgl", kernelFunc: I9 }; -var v9 = Wt + "return log(x + sqrt(x * x + 1.0));"; -var k9 = xe({ opSnippet: v9 }); -var lA = { kernelName: qo, backendName: "webgl", kernelFunc: k9 }; -var N9 = Wt + ` +var YJ = xe({ opSnippet: XJ }); +var tF = { kernelName: Cn, backendName: "webgl", kernelFunc: YJ }; +var QJ = Gt + "return log(x + sqrt(x * x + 1.0));"; +var ZJ = xe({ opSnippet: QJ }); +var rF = { kernelName: wn, backendName: "webgl", kernelFunc: ZJ }; +var JJ = Gt + ` return atan(x); `; -var T9 = xe({ opSnippet: N9 }); -var mA = { kernelName: jo, backendName: "webgl", kernelFunc: T9 }; -var _9 = Mc + ` +var eee = xe({ opSnippet: JJ }); +var oF = { kernelName: Sn, backendName: "webgl", kernelFunc: eee }; +var tee = Gl + ` return atan(a, b); `; -var $9 = ` +var ree = ` vec4 result = atan(a, b); bvec4 isNaNA = isnan(a); bvec4 isNaNB = isnan(b); bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); - ` + jr + ` + ` + to + ` return result; `; -var E9 = nt({ opSnippet: _9, packedOpSnippet: $9 }); -var dA = { kernelName: Yo, backendName: "webgl", kernelFunc: E9 }; -var R9 = Wt + ` +var oee = st({ opSnippet: tee, packedOpSnippet: ree }); +var nF = { kernelName: vn, backendName: "webgl", kernelFunc: oee }; +var nee = Gt + ` if ((x < -1.0) || (x > 1.0)) return NAN; return (log(1.0 + x) - log(1.0 - x)) / 2.0;`; -var D9 = xe({ opSnippet: R9 }); -var fA = { kernelName: Xo, backendName: "webgl", kernelFunc: D9 }; -var Us = class { - constructor(t8, e, o, n = false, s = false) { - if (this.variableNames = ["x"], e === "avg" && o) +var see = xe({ opSnippet: nee }); +var sF = { kernelName: In, backendName: "webgl", kernelFunc: see }; +var Zs = class { + constructor(e, t10, o, n = false, s = false) { + if (this.variableNames = ["x"], t10 === "avg" && o) throw new Error("Cannot compute positions for average pool."); - let a = t8.filterWidth, i = t8.strideHeight, p = t8.strideWidth, u = t8.dilationHeight, c = t8.dilationWidth, l = t8.effectiveFilterHeight, m = t8.effectiveFilterWidth, d = t8.padInfo.top, f = t8.padInfo.left; - this.outputShape = t8.outShape; - let h = e === "avg", g = `((batch * ${t8.inHeight} + xR) * ${t8.inWidth} + xC) * ${t8.inChannels} + d`, x = `(xR * ${t8.inWidth} + xC) * ${t8.inChannels} + d`, b = "0.0"; + let a = e.filterWidth, i = e.strideHeight, p = e.strideWidth, u = e.dilationHeight, l = e.dilationWidth, c = e.effectiveFilterHeight, m = e.effectiveFilterWidth, d = e.padInfo.top, f = e.padInfo.left; + this.outputShape = e.outShape; + let h = t10 === "avg", g = `((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`, x = `(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`, b = "0.0"; if (h || (b = "-1.0 / 1e-20"), o) { let R = ">="; this.userCode = ` @@ -19506,19 +19602,19 @@ var Us = class { int minMaxPosition = 0; float avgValue = 0.0; - for (int wR = 0; wR < ${l}; + for (int wR = 0; wR < ${c}; wR += ${u}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${m}; - wC += ${c}) { + wC += ${l}) { int xC = xCCorner + wC; - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -19540,13 +19636,13 @@ var Us = class { `; return; } - let C = "max", S = `${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; - e === "avg" && (S = "avgValue / max(count, 1.0)"); - let k = Math.floor(a / 4) * 4, _ = a % 4, E = ` + let w = "max", S = `${t10}(${t10}(${t10}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; + t10 === "avg" && (S = "avgValue / max(count, 1.0)"); + let k = Math.floor(a / 4) * 4, T = a % 4, E = ` if (${h}) { avgValue += dot(values, ones); } else { - minMaxValue = ${C}(values, minMaxValue); + minMaxValue = ${w}(values, minMaxValue); } `; this.userCode = ` @@ -19558,7 +19654,7 @@ var Us = class { float count = 0.0; float getValue(int batch, int xR, int xC, int d) { - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { return initializationValue; } count += 1.0; @@ -19580,29 +19676,29 @@ var Us = class { float avgValue = 0.0; count = 0.0; - for (int wR = 0; wR < ${l}; + for (int wR = 0; wR < ${c}; wR += ${u}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${k}; wC += 4) { - int xC = xCCorner + wC * ${c}; + int xC = xCCorner + wC * ${l}; 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 + ${l}, d), + getValue(batch, xR, xC + 2 * ${l}, d), + getValue(batch, xR, xC + 3 * ${l}, d) ); ${E} } int xC = xCCorner + ${k}; - if (${_ === 1}) { + if (${T === 1}) { vec4 values = vec4( getValue(batch, xR, xC, d), initializationValue, @@ -19611,20 +19707,20 @@ var Us = class { ); ${E} - } else if (${_ === 2}) { + } else if (${T === 2}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), + getValue(batch, xR, xC + ${l}, d), initializationValue, initializationValue ); ${E} - } else if (${_ === 3}) { + } else if (${T === 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 + ${l}, d), + getValue(batch, xR, xC + 2 * ${l}, d), initializationValue ); @@ -19636,15 +19732,15 @@ var Us = class { `; } }; -var xu = class { - constructor(t8, e, o, n = false, s = false) { - if (this.variableNames = ["x"], e === "avg" && o) +var Nu = class { + constructor(e, t10, o, n = false, s = false) { + if (this.variableNames = ["x"], t10 === "avg" && o) throw new Error("Cannot compute positions for average pool."); - let a = t8.filterWidth, i = t8.strideDepth, p = t8.strideHeight, u = t8.strideWidth, c = t8.dilationDepth, l = t8.dilationHeight, m = t8.dilationWidth, d = t8.effectiveFilterDepth, f = t8.effectiveFilterHeight, h = t8.effectiveFilterWidth, g = t8.padInfo.front, x = t8.padInfo.top, b = t8.padInfo.left; - this.outputShape = t8.outShape; - let C = e === "avg", S = "0.0"; - if (C || (S = "-1.0 / 1e-20"), o) { - let P = ">="; + let a = e.filterWidth, i = e.strideDepth, p = e.strideHeight, u = e.strideWidth, l = e.dilationDepth, c = e.dilationHeight, m = e.dilationWidth, d = e.effectiveFilterDepth, f = e.effectiveFilterHeight, h = e.effectiveFilterWidth, g = e.padInfo.front, x = e.padInfo.top, b = e.padInfo.left; + this.outputShape = e.outShape; + let w = t10 === "avg", S = "0.0"; + if (w || (S = "-1.0 / 1e-20"), o) { + let F = ">="; this.userCode = ` const ivec3 strides = ivec3(${i}, ${p}, ${u}); @@ -19667,18 +19763,18 @@ var xu = class { int minMaxPosition = 0; for (int wD = 0; wD < ${d}; - wD += ${c}) { + wD += ${l}) { int xD = xDCorner + wD; - if (xD < 0 || xD >= ${t8.inDepth}) { + if (xD < 0 || xD >= ${e.inDepth}) { continue; } for (int wR = 0; wR < ${f}; - wR += ${l}) { + wR += ${c}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } @@ -19686,7 +19782,7 @@ var xu = class { wC += ${m}) { int xC = xCCorner + wC; - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -19696,10 +19792,10 @@ var xu = class { // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); - if (value ${P} currMinMaxValue) { + if (value ${F} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; - minMaxPosition = ${n ? s ? `(((batch * ${t8.inDepth} + xD) * ${t8.inHeight} + xR) * ${t8.inWidth} + xC) * ${t8.inChannels} + ch` : `((xD * ${t8.inHeight} + xR) * ${t8.inWidth} + xC) * ${t8.inChannels} + ch` : `wD * ${f} * ${h} + + minMaxPosition = ${n ? s ? `(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch` : `((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch` : `wD * ${f} * ${h} + wR * ${h} + wC`}; } } @@ -19710,10 +19806,10 @@ var xu = class { `; return; } - let k = "max", _ = `${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; - e === "avg" && (_ = "avgValue / max(count, 1.0)"); + let k = "max", T = `${t10}(${t10}(${t10}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`; + t10 === "avg" && (T = "avgValue / max(count, 1.0)"); let E = Math.floor(a / 4) * 4, R = a % 4, D = ` - if (${C}) { + if (${w}) { avgValue += dot(values, ones); } else { minMaxValue = ${k}(values, minMaxValue); @@ -19729,7 +19825,7 @@ var xu = class { float count = 0.0; float getValue(int batch, int xD, int xR, int xC, int ch) { - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { return initializationValue; } count += 1.0; @@ -19753,18 +19849,18 @@ var xu = class { count = 0.0; for (int wD = 0; wD < ${d}; - wD += ${c}) { + wD += ${l}) { int xD = xDCorner + wD; - if (xD < 0 || xD >= ${t8.inDepth}) { + if (xD < 0 || xD >= ${e.inDepth}) { continue; } for (int wR = 0; wR < ${f}; - wR += ${l}) { + wR += ${c}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } @@ -19812,34 +19908,34 @@ var xu = class { } } } - setOutput(${_}); + setOutput(${T}); } `; } }; -function A9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8; - Vs(n, "avgPool"); +function aee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e; + Ys(n, "avgPool"); let { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, u = 1; - y.assert(w.eitherStridesOrDilationsAreOne(a, u), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); - let c = w.computePool2DInfo(n.shape, s, a, u, i, p); - if (c.filterWidth === 1 && c.filterHeight === 1 && y.arraysEqual(c.inShape, c.outShape)) - return Dt({ inputs: { x: n }, backend: e }); - let l = new Us(c, "avg", false); - return e.runWebGLProgram(l, [n], "float32"); -} -var hA = { kernelName: Qo, backendName: "webgl", kernelFunc: A9 }; -function F9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o, c = [1, 1, 1], l = w.computePool3DInfo(n.shape, s, a, c, i, p, u), m = new xu(l, "avg", false); - return e.runWebGLProgram(m, [n], "float32"); -} -var gA = { kernelName: Zs, backendName: "webgl", kernelFunc: F9 }; -var vh = class { - constructor(t8) { - this.variableNames = ["dy"], this.outputShape = t8.inShape; - let e = t8.filterHeight, o = t8.filterWidth, n = t8.strideHeight, s = t8.strideWidth, a = t8.dilationHeight, i = t8.dilationWidth, p = t8.effectiveFilterHeight, u = t8.effectiveFilterWidth, c = p - 1 - t8.padInfo.top, l = u - 1 - t8.padInfo.left, m = 1 / (e * o); + y.assert(C.eitherStridesOrDilationsAreOne(a, u), () => `Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); + let l = C.computePool2DInfo(n.shape, s, a, u, i, p); + if (l.filterWidth === 1 && l.filterHeight === 1 && y.arraysEqual(l.inShape, l.outShape)) + return Ft({ inputs: { x: n }, backend: t10 }); + let c = new Zs(l, "avg", false); + return t10.runWebGLProgram(c, [n], "float32"); +} +var aF = { kernelName: kn, backendName: "webgl", kernelFunc: aee }; +function iee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o, l = [1, 1, 1], c = C.computePool3DInfo(n.shape, s, a, l, i, p, u), m = new Nu(c, "avg", false); + return t10.runWebGLProgram(m, [n], "float32"); +} +var iF = { kernelName: aa, backendName: "webgl", kernelFunc: iee }; +var Oh = class { + constructor(e) { + this.variableNames = ["dy"], this.outputShape = e.inShape; + let t10 = e.filterHeight, o = e.filterWidth, n = e.strideHeight, s = e.strideWidth, a = e.dilationHeight, i = e.dilationWidth, p = e.effectiveFilterHeight, u = e.effectiveFilterWidth, l = p - 1 - e.padInfo.top, c = u - 1 - e.padInfo.left, m = 1 / (t10 * o); this.userCode = ` - const ivec2 pads = ivec2(${c}, ${l}); + const ivec2 pads = ivec2(${l}, ${c}); const float avgMultiplier = float(${m}); void main() { @@ -19858,7 +19954,7 @@ var vh = class { wR += ${a}) { float dyR = float(dyRCorner + wR) / ${n}.0; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); @@ -19867,7 +19963,7 @@ var vh = class { wC+= ${i}) { float dyC = float(dyCCorner + wC) / ${s}.0; - if (dyC < 0.0 || dyC >= ${t8.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -19883,10 +19979,10 @@ var vh = class { `; } }; -var kh = class { - constructor(t8) { - this.variableNames = ["dy"], this.outputShape = t8.inShape; - let e = t8.filterDepth, o = t8.filterHeight, n = t8.filterWidth, s = t8.strideDepth, a = t8.strideHeight, i = t8.strideWidth, p = t8.dilationDepth, u = t8.dilationHeight, c = t8.dilationWidth, l = t8.effectiveFilterDepth, m = t8.effectiveFilterHeight, d = t8.effectiveFilterWidth, f = l - 1 - t8.padInfo.front, h = m - 1 - t8.padInfo.top, g = d - 1 - t8.padInfo.left, x = 1 / (e * o * n); +var Mh = class { + constructor(e) { + this.variableNames = ["dy"], this.outputShape = e.inShape; + let t10 = e.filterDepth, o = e.filterHeight, n = e.filterWidth, s = e.strideDepth, a = e.strideHeight, i = e.strideWidth, p = e.dilationDepth, u = e.dilationHeight, l = e.dilationWidth, c = e.effectiveFilterDepth, m = e.effectiveFilterHeight, d = e.effectiveFilterWidth, f = c - 1 - e.padInfo.front, h = m - 1 - e.padInfo.top, g = d - 1 - e.padInfo.left, x = 1 / (t10 * o * n); this.userCode = ` const ivec3 pads = ivec3(${f}, ${h}, ${g}); const float avgMultiplier = float(${x}); @@ -19906,11 +20002,11 @@ var kh = class { // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wD = 0; wD < ${l}; + for (int wD = 0; wD < ${c}; wD += ${p}) { float dyD = float(dyDCorner + wD) / ${s}.0; - if (dyD < 0.0 || dyD >= ${t8.outDepth}.0 || fract(dyD) > 0.0) { + if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); @@ -19919,17 +20015,17 @@ var kh = class { wR += ${u}) { float dyR = float(dyRCorner + wR) / ${a}.0; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); for (int wC = 0; wC < ${d}; - wC += ${c}) { + wC += ${l}) { float dyC = float(dyCCorner + wC) / ${i}.0; - if (dyC < 0.0 || dyC >= ${t8.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -19946,30 +20042,30 @@ var kh = class { `; } }; -function P9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: c } = o, l = [1, 1, 1], m = w.computePool3DInfo(a.shape, i, p, l, u, c), d = new kh(m); - return e.runWebGLProgram(d, [n], a.dtype); +function uee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: l } = o, c = [1, 1, 1], m = C.computePool3DInfo(a.shape, i, p, c, u, l), d = new Mh(m); + return t10.runWebGLProgram(d, [n], a.dtype); } -var xA = { kernelName: Ei, backendName: "webgl", kernelFunc: P9 }; -function O9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, a = s; - Vs([n, s], "avgPoolGrad"); - let { filterSize: i, strides: p, pad: u } = o, c = w.computePool2DInfo(a.shape, i, p, 1, u), l = new vh(c); - return e.runWebGLProgram(l, [n], a.dtype); +var uF = { kernelName: Vi, backendName: "webgl", kernelFunc: uee }; +function pee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, a = s; + Ys([n, s], "avgPoolGrad"); + let { filterSize: i, strides: p, pad: u } = o, l = C.computePool2DInfo(a.shape, i, p, 1, u), c = new Oh(l); + return t10.runWebGLProgram(c, [n], a.dtype); } -var yA = { kernelName: $i, backendName: "webgl", kernelFunc: O9 }; -function M9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s } = t8, { transposeA: a, transposeB: i } = o; - return Cp({ a: n, b: s, transposeA: a, transposeB: i, backend: e }); +var pF = { kernelName: zi, backendName: "webgl", kernelFunc: pee }; +function lee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s } = e, { transposeA: a, transposeB: i } = o; + return _p({ a: n, b: s, transposeA: a, transposeB: i, backend: t10 }); } -var bA = { kernelName: Zo, backendName: "webgl", kernelFunc: M9 }; -var Nh = class { - constructor(t8, e, o, n, s, a) { - this.outputShape = [], this.variableNames = ["x", "mean", "variance"], w.assertAndGetBroadcastShape(t8, e), w.assertAndGetBroadcastShape(t8, o); +var lF = { kernelName: Nn, backendName: "webgl", kernelFunc: lee }; +var Lh = class { + constructor(e, t10, o, n, s, a) { + this.outputShape = [], this.variableNames = ["x", "mean", "variance"], C.assertAndGetBroadcastShape(e, t10), C.assertAndGetBroadcastShape(e, o); let i = "0.0"; - n != null && (w.assertAndGetBroadcastShape(t8, n), this.variableNames.push("offset"), i = "getOffsetAtOutCoords()"); + n != null && (C.assertAndGetBroadcastShape(e, n), this.variableNames.push("offset"), i = "getOffsetAtOutCoords()"); let p = "1.0"; - s != null && (w.assertAndGetBroadcastShape(t8, s), this.variableNames.push("scale"), p = "getScaleAtOutCoords()"), this.outputShape = t8, this.userCode = ` + s != null && (C.assertAndGetBroadcastShape(e, s), this.variableNames.push("scale"), p = "getScaleAtOutCoords()"), this.outputShape = e, this.userCode = ` void main() { float x = getXAtOutCoords(); float mean = getMeanAtOutCoords(); @@ -19982,13 +20078,13 @@ var Nh = class { `; } }; -var Th = class { - constructor(t8, e, o, n, s, a) { - this.packedInputs = true, this.packedOutput = true, this.variableNames = ["x", "mean", "variance"], w.assertAndGetBroadcastShape(t8, e), w.assertAndGetBroadcastShape(t8, o); +var Bh = class { + constructor(e, t10, o, n, s, a) { + this.packedInputs = true, this.packedOutput = true, this.variableNames = ["x", "mean", "variance"], C.assertAndGetBroadcastShape(e, t10), C.assertAndGetBroadcastShape(e, o); let i = "vec4(0.0)"; - n != null && (w.assertAndGetBroadcastShape(t8, n), this.variableNames.push("offset"), i = "getOffsetAtOutCoords()"); + n != null && (C.assertAndGetBroadcastShape(e, n), this.variableNames.push("offset"), i = "getOffsetAtOutCoords()"); let p = "vec4(1.0)"; - s != null && (w.assertAndGetBroadcastShape(t8, s), this.variableNames.push("scale"), p = "getScaleAtOutCoords()"), this.outputShape = t8, this.userCode = ` + s != null && (C.assertAndGetBroadcastShape(e, s), this.variableNames.push("scale"), p = "getScaleAtOutCoords()"), this.outputShape = e, this.userCode = ` void main() { vec4 offset = ${i}; vec4 scale = ${p}; @@ -20004,28 +20100,28 @@ var Th = class { `; } }; -var L9 = ({ inputs: r15, backend: t8, attrs: e }) => { - let { x: o, mean: n, variance: s, offset: a, scale: i } = r15; +var cee = ({ inputs: r16, backend: e, attrs: t10 }) => { + let { x: o, mean: n, variance: s, offset: a, scale: i } = r16; y.assert(n.shape.length === s.shape.length, () => "Batch normalization gradient requires mean and variance to have equal ranks."), y.assert(a == null || n.shape.length === a.shape.length, () => "Batch normalization gradient requires mean and offset to have equal ranks."), y.assert(i == null || n.shape.length === i.shape.length, () => "Batch normalization gradient requires mean and scale to have equal ranks."); - let { varianceEpsilon: p } = e; + let { varianceEpsilon: p } = t10; p == null && (p = 1e-3); - let u = [o, n, s], c = null; - a != null && (c = a.shape, u.push(a)); - let l = null; - i != null && (l = i.shape, u.push(i)); - let m = A().getBool("WEBGL_PACK_NORMALIZATION") ? new Th(o.shape, n.shape, s.shape, c, l, p) : new Nh(o.shape, n.shape, s.shape, c, l, p); - return t8.runWebGLProgram(m, u, u[0].dtype); -}; -var CA = { kernelName: In, backendName: "webgl", kernelFunc: L9 }; -var _h = class { - constructor(t8) { - this.variableNames = ["source"], this.outputShape = t8, this.rank = t8.length; - let e = Re(this.rank); + let u = [o, n, s], l = null; + a != null && (l = a.shape, u.push(a)); + let c = null; + i != null && (c = i.shape, u.push(i)); + let m = A().getBool("WEBGL_PACK_NORMALIZATION") ? new Bh(o.shape, n.shape, s.shape, l, c, p) : new Lh(o.shape, n.shape, s.shape, l, c, p); + return e.runWebGLProgram(m, u, u[0].dtype); +}; +var cF = { kernelName: Hn, backendName: "webgl", kernelFunc: cee }; +var zh = class { + constructor(e) { + this.variableNames = ["source"], this.outputShape = e, this.rank = e.length; + let t10 = Re(this.rank); this.customUniforms = [{ name: "start", arrayIndex: this.rank, type: "int" }]; - let o = B9(this.rank), n, s = t8.map((a, i) => `sourceLoc.${Cv[i]} = start[${i}] + coords.${Cv[i]};`); + let o = mee(this.rank), n, s = e.map((a, i) => `sourceLoc.${F0[i]} = start[${i}] + coords.${F0[i]};`); n = ` - ${e} sourceLoc; - ${e} coords = getOutputCoords(); + ${t10} sourceLoc; + ${t10} coords = getOutputCoords(); ${s.join(` `)} `, this.userCode = ` @@ -20036,41 +20132,41 @@ var _h = class { `; } }; -var Cv = ["x", "y", "z", "w", "u", "v"]; -function B9(r15) { - if (r15 === 1) +var F0 = ["x", "y", "z", "w", "u", "v"]; +function mee(r16) { + if (r16 === 1) return "sourceLoc"; - if (r15 <= 6) - return Cv.slice(0, r15).map((t8) => "sourceLoc." + t8).join(","); - throw Error(`Slicing for rank ${r15} is not yet supported`); + if (r16 <= 6) + return F0.slice(0, r16).map((e) => "sourceLoc." + e).join(","); + throw Error(`Slicing for rank ${r16} is not yet supported`); } -var $h = class { - constructor(t8) { - this.variableNames = ["source"], this.packedInputs = true, this.packedOutput = true, this.outputShape = t8, this.rank = t8.length, this.customUniforms = [{ name: "start", arrayIndex: this.rank, type: "int" }]; - let e = Re(this.rank), o = Rt("coords", this.rank), n = Rt("sourceLoc", this.rank), s = this.rank === 1 ? "sourceLoc" : `vec2(${n.slice(-2).join()})`, a = `getChannel(getSource(${n.join()}), ${s})`, i = ` +var Vh = class { + constructor(e) { + this.variableNames = ["source"], this.packedInputs = true, this.packedOutput = true, this.outputShape = e, this.rank = e.length, this.customUniforms = [{ name: "start", arrayIndex: this.rank, type: "int" }]; + let t10 = Re(this.rank), o = At("coords", this.rank), n = At("sourceLoc", this.rank), s = this.rank === 1 ? "sourceLoc" : `vec2(${n.slice(-2).join()})`, a = `getChannel(getSource(${n.join()}), ${s})`, i = ` result.x = ${a}; - if (++${o[this.rank - 1]} < ${t8[this.rank - 1]}) { + if (++${o[this.rank - 1]} < ${e[this.rank - 1]}) { ++${n[this.rank - 1]}; result.y = ${a}; --${n[this.rank - 1]}; } `, p = this.rank === 1 ? "" : ` --${o[this.rank - 1]}; - if (++${o[this.rank - 2]} < ${t8[this.rank - 2]}) { + if (++${o[this.rank - 2]} < ${e[this.rank - 2]}) { ++${n[this.rank - 2]}; result.z = ${a}; - if (++${o[this.rank - 1]} < ${t8[this.rank - 1]}) { + if (++${o[this.rank - 1]} < ${e[this.rank - 1]}) { ++${n[this.rank - 1]}; result.w = ${a}; } } `, u = this.rank <= 4 ? `sourceLoc = coords + - ${e}(${t8.map((c, l) => `start[${l}]`).join()});` : t8.map((c, l) => `${n[l]} = ${o[l]} + start[${l}];`).join(` + ${t10}(${e.map((l, c) => `start[${c}]`).join()});` : e.map((l, c) => `${n[c]} = ${o[c]} + start[${c}];`).join(` `); this.userCode = ` void main() { - ${e} coords = getOutputCoords(); - ${e} sourceLoc; + ${t10} coords = getOutputCoords(); + ${t10} sourceLoc; ${u} vec4 result = vec4(0.); ${i} @@ -20080,115 +20176,115 @@ var $h = class { `; } }; -function z9(r15, t8, e, o) { - let n = o.texData.get(r15.dataId), s = o.makeTensorInfo(e, r15.dtype), a = o.texData.get(s.dataId); - Object.assign(a, n), a.refCount = 1, a.shape = e, a.dtype = r15.dtype; - let i = pt.computeFlatOffset(t8, y.computeStrides(r15.shape)); - n.slice && (i += n.slice.flatOffset), a.slice = { flatOffset: i, origDataId: n.slice && n.slice.origDataId || r15.dataId }; +function dee(r16, e, t10, o) { + let n = o.texData.get(r16.dataId), s = o.makeTensorInfo(t10, r16.dtype), a = o.texData.get(s.dataId); + Object.assign(a, n), a.refCount = 1, a.shape = t10, a.dtype = r16.dtype; + let i = nt.computeFlatOffset(e, y.computeStrides(r16.shape)); + n.slice && (i += n.slice.flatOffset), a.slice = { flatOffset: i, origDataId: n.slice && n.slice.origDataId || r16.dataId }; let p = o.dataRefCount.get(a.slice.origDataId) || 1; return o.dataRefCount.set(a.slice.origDataId, p + 1), s; } -function Gs(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { begin: s, size: a } = o, [i, p] = pt.parseSliceParams(n, s, a); - if (pt.assertParamsValid(n, i, p), y.sizeFromShape(p) === 0) - return e.makeTensorInfo(p, n.dtype, []); - if (e.shouldExecuteOnCPU([n]) || n.dtype === "string") { - let l = e.texData.get(n.dataId), m = cD(l.values, i, p, n.shape, n.dtype); - return e.makeTensorInfo(p, n.dtype, m); +function Js(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { begin: s, size: a } = o, [i, p] = nt.parseSliceParams(n, s, a); + if (nt.assertParamsValid(n, i, p), y.sizeFromShape(p) === 0) + return t10.makeTensorInfo(p, n.dtype, []); + if (t10.shouldExecuteOnCPU([n]) || n.dtype === "string") { + let c = t10.texData.get(n.dataId), m = tA(c.values, i, p, n.shape, n.dtype); + return t10.makeTensorInfo(p, n.dtype, m); } - let { isPacked: u } = e.texData.get(n.dataId), c = pt.isSliceContinous(n.shape, i, p); - if (u || !c) { - let l = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new $h(p) : new _h(p), m = [i]; - return e.runWebGLProgram(l, [n], n.dtype, m); + let { isPacked: u } = t10.texData.get(n.dataId), l = nt.isSliceContinous(n.shape, i, p); + if (u || !l) { + let c = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new Vh(p) : new zh(p), m = [i]; + return t10.runWebGLProgram(c, [n], n.dtype, m); } - return e.uploadToGPU(n.dataId), z9(n, i, p, e); + return t10.uploadToGPU(n.dataId), dee(n, i, p, t10); } -var wA = { kernelName: ha, backendName: "webgl", kernelFunc: Gs }; -var V9 = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, crops: a } = o; +var mF = { kernelName: _s, backendName: "webgl", kernelFunc: Js }; +var fee = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, crops: a } = o; y.assert(n.shape.length <= 4, () => "batchToSpaceND for rank > 4 with a WebGL backend not implemented yet"); - let i = s.reduce((b, C) => b * C), p = w.getReshaped(n.shape, s, i), u = w.getPermuted(p.length, s.length), c = w.getReshapedPermuted(n.shape, s, i), l = w.getSliceBeginCoords(a, s.length), m = w.getSliceSize(c, a, s.length), d = [], f = te({ inputs: { x: n }, backend: e, attrs: { shape: p } }), h = bt({ inputs: { x: f }, backend: e, attrs: { perm: u } }), g = te({ inputs: { x: h }, backend: e, attrs: { shape: c } }), x = Gs({ inputs: { x: g }, backend: e, attrs: { begin: l, size: m } }); - return d.push(f), d.push(h), d.push(g), d.forEach((b) => e.disposeIntermediateTensorInfo(b)), x; + let i = s.reduce((b, w) => b * w), p = C.getReshaped(n.shape, s, i), u = C.getPermuted(p.length, s.length), l = C.getReshapedPermuted(n.shape, s, i), c = C.getSliceBeginCoords(a, s.length), m = C.getSliceSize(l, a, s.length), d = [], f = te({ inputs: { x: n }, backend: t10, attrs: { shape: p } }), h = Ct({ inputs: { x: f }, backend: t10, attrs: { perm: u } }), g = te({ inputs: { x: h }, backend: t10, attrs: { shape: l } }), x = Js({ inputs: { x: g }, backend: t10, attrs: { begin: c, size: m } }); + return d.push(f), d.push(h), d.push(g), d.forEach((b) => t10.disposeIntermediateTensorInfo(b)), x; }; -var SA = { kernelName: Js, backendName: "webgl", kernelFunc: V9 }; -function W9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, weights: s } = t8, { size: a } = o, i = e.readSync(n.dataId), p = e.readSync(s.dataId), u = uh(i, p, s.dtype, s.shape, a); - return e.makeTensorInfo([a], s.dtype, u); +var dF = { kernelName: ia, backendName: "webgl", kernelFunc: fee }; +function hee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, weights: s } = e, { size: a } = o, i = t10.readSync(n.dataId), p = t10.readSync(s.dataId), u = Ch(i, p, s.dtype, s.shape, a); + return t10.makeTensorInfo([a], s.dtype, u); } -var IA = { kernelName: Jo, backendName: "webgl", kernelFunc: W9 }; -var U9 = ` +var fF = { kernelName: Tn, backendName: "webgl", kernelFunc: hee }; +var gee = ` int r = int(a.r) & int(b.r); int g = int(a.g) & int(b.g); int rb = int(a.b) & int(b.b); int ra = int(a.a) & int(b.a); return vec4(r, g, rb, ra); `; -var G9 = ` +var xee = ` return float(int(a.r) & int(b.r)); `; -function H9(r15) { - let { inputs: t8, backend: e } = r15, { a: o, b: n } = t8, s = A().getBool("WEBGL_PACK_BINARY_OPERATIONS"), a = A().getNumber("WEBGL_VERSION"); - if (e.shouldExecuteOnCPU([o, n]) || a === 1) { - let p = e.texData.get(o.dataId).values, u = e.texData.get(n.dataId).values, [c, l] = FR(o.shape, n.shape, p, u, o.dtype), m = e.makeTensorInfo(l, o.dtype), d = e.texData.get(m.dataId); - return d.values = c, m; +function yee(r16) { + let { inputs: e, backend: t10 } = r16, { a: o, b: n } = e, s = A().getBool("WEBGL_PACK_BINARY_OPERATIONS"), a = A().getNumber("WEBGL_VERSION"); + if (t10.shouldExecuteOnCPU([o, n]) || a === 1) { + let p = t10.texData.get(o.dataId).values, u = t10.texData.get(n.dataId).values, [l, c] = kD(o.shape, n.shape, p, u, o.dtype), m = t10.makeTensorInfo(c, o.dtype), d = t10.texData.get(m.dataId); + return d.values = l, m; } let i; - return s ? i = new qr(U9, o.shape, n.shape, false) : i = new Fr(G9, o.shape, n.shape), e.runWebGLProgram(i, [o, n], o.dtype); -} -var vA = { kernelName: qa, backendName: "webgl", kernelFunc: H9 }; -function K9(r15) { - let { inputs: t8, backend: e } = r15, { s0: o, s1: n } = t8, s = e.readSync(o.dataId), a = e.readSync(n.dataId), i = w.assertAndGetBroadcastShape(Array.from(s), Array.from(a)); - return e.makeTensorInfo([i.length], "int32", Int32Array.from(i)); -} -var kA = { kernelName: ea, backendName: "webgl", kernelFunc: K9 }; -var q9 = "return float(a != b);"; -var wv = nt({ opSnippet: q9, cpuKernelImpl: tD, dtype: "bool" }); -var NA = { kernelName: Yn, backendName: "webgl", kernelFunc: wv }; -function yi(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = e.texData.get(o.dataId); - return Dt({ inputs: { x: n.complexTensorInfos.real }, backend: e }); -} -var TA = { kernelName: Gi, backendName: "webgl", kernelFunc: yi }; -var j9 = "return float(int(x));"; -function _A(r15, t8) { - let e = new tr(r15.shape, j9), o = t8.runWebGLProgram(e, [r15], "int32"); + return s ? i = new eo(gee, o.shape, n.shape, false) : i = new Br(xee, o.shape, n.shape), t10.runWebGLProgram(i, [o, n], o.dtype); +} +var hF = { kernelName: _n, backendName: "webgl", kernelFunc: yee }; +function bee(r16) { + let { inputs: e, backend: t10 } = r16, { s0: o, s1: n } = e, s = t10.readSync(o.dataId), a = t10.readSync(n.dataId), i = C.assertAndGetBroadcastShape(Array.from(s), Array.from(a)); + return t10.makeTensorInfo([i.length], "int32", Int32Array.from(i)); +} +var gF = { kernelName: ua, backendName: "webgl", kernelFunc: bee }; +var Cee = "return float(a != b);"; +var P0 = st({ opSnippet: Cee, cpuKernelImpl: KD, dtype: "bool" }); +var xF = { kernelName: Ro, backendName: "webgl", kernelFunc: P0 }; +function _i(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = t10.texData.get(o.dataId); + return Ft({ inputs: { x: n.complexTensorInfos.real }, backend: t10 }); +} +var yF = { kernelName: si, backendName: "webgl", kernelFunc: _i }; +var wee = "return float(int(x));"; +function bF(r16, e) { + let t10 = new nr(r16.shape, wee), o = e.runWebGLProgram(t10, [r16], "int32"); return { dataId: o.dataId, shape: o.shape, dtype: o.dtype }; } -function Sv(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { dtype: s } = o; +function O0(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dtype: s } = o; if (s === "complex64") { if (n.dtype === "complex64") - return Dt({ inputs: { x: n }, backend: e }); - let a = Ur(n.shape), i = Sv({ inputs: { x: n }, backend: e, attrs: { dtype: "float32" } }), p = Pr({ inputs: { real: i, imag: a }, backend: e }); - return a.dispose(), e.disposeIntermediateTensorInfo(i), p; + return Ft({ inputs: { x: n }, backend: t10 }); + let a = Yr(n.shape), i = O0({ inputs: { x: n }, backend: t10, attrs: { dtype: "float32" } }), p = zr({ inputs: { real: i, imag: a }, backend: t10 }); + return a.dispose(), t10.disposeIntermediateTensorInfo(i), p; } if (n.dtype === "complex64") { - let a = yi({ inputs: { input: n }, backend: e }), i = Sv({ inputs: { x: a }, backend: e, attrs: { dtype: s } }); - return e.disposeIntermediateTensorInfo(a), i; + let a = _i({ inputs: { input: n }, backend: t10 }), i = O0({ inputs: { x: a }, backend: t10, attrs: { dtype: s } }); + return t10.disposeIntermediateTensorInfo(a), i; } if (!y.hasEncodingLoss(n.dtype, s)) { - let a = Dt({ inputs: { x: n }, backend: e }); + let a = Ft({ inputs: { x: n }, backend: t10 }); return { dataId: a.dataId, shape: a.shape, dtype: s }; } - if (e.shouldExecuteOnCPU([n])) { - let a = e.texData.get(n.dataId).values, [i, p, u] = PR(a, n.shape, n.dtype, s); - return e.makeTensorInfo(i, p, u); + if (t10.shouldExecuteOnCPU([n])) { + let a = t10.texData.get(n.dataId).values, [i, p, u] = ND(a, n.shape, n.dtype, s); + return t10.makeTensorInfo(i, p, u); } if (s === "int32") - return _A(n, e); + return bF(n, t10); if (s === "bool") { - let a = e.makeTensorInfo([], "bool", y.getTypedArrayFromDType("bool", 1)), p = wv({ inputs: { a: n, b: a }, backend: e }); - return e.disposeIntermediateTensorInfo(a), p; + let a = t10.makeTensorInfo([], "bool", y.getTypedArrayFromDType("bool", 1)), p = P0({ inputs: { a: n, b: a }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(a), p; } throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`); } -var $A = { kernelName: yo, backendName: "webgl", kernelFunc: Sv }; -var EA = "return ceil(x);"; -var X9 = xe({ opSnippet: EA, packedOpSnippet: EA, cpuKernelImpl: OR }); -var RA = { kernelName: en, backendName: "webgl", kernelFunc: X9 }; -var Eh = class { - constructor(t8) { - this.variableNames = ["A"], this.customUniforms = [{ name: "minVal", type: "float" }, { name: "maxVal", type: "float" }], this.outputShape = t8, this.userCode = ` +var CF = { kernelName: ho, backendName: "webgl", kernelFunc: O0 }; +var wF = "return ceil(x);"; +var See = xe({ opSnippet: wF, packedOpSnippet: wF, cpuKernelImpl: TD }); +var SF = { kernelName: go, backendName: "webgl", kernelFunc: See }; +var Wh = class { + constructor(e) { + this.variableNames = ["A"], this.customUniforms = [{ name: "minVal", type: "float" }, { name: "maxVal", type: "float" }], this.outputShape = e, this.userCode = ` void main() { float value = getAAtOutCoords(); @@ -20202,9 +20298,9 @@ var Eh = class { `; } }; -var Rh = class { - constructor(t8) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "minVal", type: "float" }, { name: "maxVal", type: "float" }], this.outputShape = t8, this.userCode = ` +var Uh = class { + constructor(e) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "minVal", type: "float" }, { name: "maxVal", type: "float" }], this.outputShape = e, this.userCode = ` void main() { vec4 value = getAAtOutCoords(); @@ -20218,16 +20314,16 @@ var Rh = class { `; } }; -function Y9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { clipValueMin: s, clipValueMax: a } = o, i; - A().getBool("WEBGL_PACK_CLIP") ? i = new Rh(n.shape) : i = new Eh(n.shape); +function Iee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { clipValueMin: s, clipValueMax: a } = o, i; + A().getBool("WEBGL_PACK_CLIP") ? i = new Uh(n.shape) : i = new Wh(n.shape); let p = [[s], [a]]; - return e.runWebGLProgram(i, [n], n.dtype, p); + return t10.runWebGLProgram(i, [n], n.dtype, p); } -var DA = { kernelName: bo, backendName: "webgl", kernelFunc: Y9 }; -var Dh = class { - constructor(t8) { - this.variableNames = ["real", "imag"], this.outputShape = t8, this.userCode = ` +var IF = { kernelName: Go, backendName: "webgl", kernelFunc: Iee }; +var Gh = class { + constructor(e) { + this.variableNames = ["real", "imag"], this.outputShape = e, this.userCode = ` void main() { float re = abs(getRealAtOutCoords()); float im = abs(getImagAtOutCoords()); @@ -20243,27 +20339,27 @@ var Dh = class { `; } }; -function AA(r15, t8) { - return { dataId: t8.dataId, dtype: t8.dtype, shape: r15.shape }; +function vF(r16, e) { + return { dataId: e.dataId, dtype: e.dtype, shape: r16.shape }; } -function Q9(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8, n = e.texData.get(o.dataId), s = new Dh(o.shape), a = [AA(o, n.complexTensorInfos.real), AA(o, n.complexTensorInfos.imag)]; - return e.runWebGLProgram(s, a, a[0].dtype); +function vee(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e, n = t10.texData.get(o.dataId), s = new Gh(o.shape), a = [vF(o, n.complexTensorInfos.real), vF(o, n.complexTensorInfos.imag)]; + return t10.runWebGLProgram(s, a, a[0].dtype); } -var FA = { kernelName: Di, backendName: "webgl", kernelFunc: Q9 }; -var Ah = class { - constructor(t8) { - this.outputShape = [], this.outputShape = w.computeOutShape(t8, 1), this.variableNames = t8.map((a, i) => `T${i}`); - let e = new Array(t8.length - 1); - e[0] = t8[0][1]; - for (let a = 1; a < e.length; a++) - e[a] = e[a - 1] + t8[a][1]; - let o = [`if (yC < ${e[0]}) setOutput(getT0(yR, yC));`]; - for (let a = 1; a < e.length; a++) { - let i = e[a - 1]; - o.push(`else if (yC < ${e[a]}) setOutput(getT${a}(yR, yC-${i}));`); - } - let n = e.length, s = e[e.length - 1]; +var kF = { kernelName: Wi, backendName: "webgl", kernelFunc: vee }; +var Hh = class { + constructor(e) { + this.outputShape = [], this.outputShape = C.computeOutShape(e, 1), this.variableNames = e.map((a, i) => `T${i}`); + let t10 = new Array(e.length - 1); + t10[0] = e[0][1]; + for (let a = 1; a < t10.length; a++) + t10[a] = t10[a - 1] + e[a][1]; + let o = [`if (yC < ${t10[0]}) setOutput(getT0(yR, yC));`]; + for (let a = 1; a < t10.length; a++) { + let i = t10[a - 1]; + o.push(`else if (yC < ${t10[a]}) setOutput(getT${a}(yR, yC-${i}));`); + } + let n = t10.length, s = t10[t10.length - 1]; o.push(`else setOutput(getT${n}(yR, yC-${s}));`), this.userCode = ` void main() { ivec2 coords = getOutputCoords(); @@ -20276,33 +20372,33 @@ var Ah = class { `; } }; -var Ph = class { - constructor(t8, e) { - this.packedInputs = true, this.packedOutput = true, this.outputShape = [], this.outputShape = w.computeOutShape(t8, e); - let o = this.outputShape, n = o.length, s = Re(n), a = Rt("coords", n), i = ["x", "y", "z", "w", "u", "v"].slice(0, n); - this.variableNames = t8.map((h, g) => `T${g}`); - let p = new Array(t8.length - 1); - p[0] = t8[0][e]; +var qh = class { + constructor(e, t10) { + this.packedInputs = true, this.packedOutput = true, this.outputShape = [], this.outputShape = C.computeOutShape(e, t10); + let o = this.outputShape, n = o.length, s = Re(n), a = At("coords", n), i = ["x", "y", "z", "w", "u", "v"].slice(0, n); + this.variableNames = e.map((h, g) => `T${g}`); + let p = new Array(e.length - 1); + p[0] = e[0][t10]; for (let h = 1; h < p.length; h++) - p[h] = p[h - 1] + t8[h][e]; - let u = i[e], c = i.slice(-2), l = i.join(), m = `if (${u} < ${p[0]}) { + p[h] = p[h - 1] + e[h][t10]; + let u = i[t10], l = i.slice(-2), c = i.join(), m = `if (${u} < ${p[0]}) { return getChannel( - getT0(${l}), vec2(${c.join()})); + getT0(${c}), vec2(${l.join()})); }`; for (let h = 1; h < p.length; h++) { let g = p[h - 1]; m += ` if (${u} < ${p[h]} && ${u} >= ${p[h - 1]}) { return getChannel( - getT${h}(${Fh(i, u, g)}), - vec2(${Fh(c, u, g)})); + getT${h}(${Kh(i, u, g)}), + vec2(${Kh(l, u, g)})); }`; } let d = p.length, f = p[p.length - 1]; m += ` return getChannel( - getT${d}(${Fh(i, u, f)}), - vec2(${Fh(c, u, f)}));`, this.userCode = ` + getT${d}(${Kh(i, u, f)}), + vec2(${Kh(l, u, f)}));`, this.userCode = ` float getValue(${i.map((h) => "int " + h)}) { ${m} } @@ -20331,73 +20427,73 @@ var Ph = class { `; } }; -function Fh(r15, t8, e) { - let o = r15.indexOf(t8); - return r15.map((s, a) => a === o ? `${s} - ${e}` : s).join(); +function Kh(r16, e, t10) { + let o = r16.indexOf(e); + return r16.map((s, a) => a === o ? `${s} - ${t10}` : s).join(); } -function wp(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = e.texData.get(o.dataId); - return Dt({ inputs: { x: n.complexTensorInfos.imag }, backend: e }); +function Ep(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = t10.texData.get(o.dataId); + return Ft({ inputs: { x: n.complexTensorInfos.imag }, backend: t10 }); } -var PA = { kernelName: Vi, backendName: "webgl", kernelFunc: wp }; -function Bc(r15, t8, e) { - let o = r15[0].dtype; +var NF = { kernelName: Qi, backendName: "webgl", kernelFunc: Ep }; +function Kl(r16, e, t10) { + let o = r16[0].dtype; if (o === "complex64") { - let d = r15.map((b) => yi({ inputs: { input: b }, backend: e })), f = r15.map((b) => wp({ inputs: { input: b }, backend: e })), h = Bc(d, t8, e), g = Bc(f, t8, e), x = Pr({ inputs: { real: h, imag: g }, backend: e }); - return d.forEach((b) => e.disposeIntermediateTensorInfo(b)), f.forEach((b) => e.disposeIntermediateTensorInfo(b)), e.disposeIntermediateTensorInfo(h), e.disposeIntermediateTensorInfo(g), x; + let d = r16.map((b) => _i({ inputs: { input: b }, backend: t10 })), f = r16.map((b) => Ep({ inputs: { input: b }, backend: t10 })), h = Kl(d, e, t10), g = Kl(f, e, t10), x = zr({ inputs: { real: h, imag: g }, backend: t10 }); + return d.forEach((b) => t10.disposeIntermediateTensorInfo(b)), f.forEach((b) => t10.disposeIntermediateTensorInfo(b)), t10.disposeIntermediateTensorInfo(h), t10.disposeIntermediateTensorInfo(g), x; } - let n = e.shouldExecuteOnCPU(r15); + let n = t10.shouldExecuteOnCPU(r16); if (o === "string" && (n = true), n) { - let d = r15.map((S) => { - let _ = [-1, y.sizeFromShape(S.shape.slice(t8))]; - return te({ inputs: { x: S }, backend: e, attrs: { shape: _ } }); - }), f = d.map((S) => ({ vals: e.readSync(S.dataId), shape: S.shape })), h = w.computeOutShape(d.map((S) => S.shape), 1), g = d[0].shape[0] === 1, x = MR(f, h, o, g), b = w.computeOutShape(r15.map((S) => S.shape), t8), C = e.makeTensorInfo(b, o, x); - return d.forEach((S) => e.disposeIntermediateTensorInfo(S)), C; + let d = r16.map((S) => { + let T = [-1, y.sizeFromShape(S.shape.slice(e))]; + return te({ inputs: { x: S }, backend: t10, attrs: { shape: T } }); + }), f = d.map((S) => ({ vals: t10.readSync(S.dataId), shape: S.shape })), h = C.computeOutShape(d.map((S) => S.shape), 1), g = d[0].shape[0] === 1, x = _D(f, h, o, g), b = C.computeOutShape(r16.map((S) => S.shape), e), w = t10.makeTensorInfo(b, o, x); + return d.forEach((S) => t10.disposeIntermediateTensorInfo(S)), w; } - let s = r15.filter((d) => y.sizeFromShape(d.shape) > 0), a = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") && s[0].shape.length > 1; + let s = r16.filter((d) => y.sizeFromShape(d.shape) > 0), a = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") && s[0].shape.length > 1; if (s.length === 1) { - let d = a ? new tr(r15[0].shape, La) : new Ar(r15[0].shape, La); - return e.runWebGLProgram(d, r15, o); + let d = a ? new nr(r16[0].shape, Ha) : new Lr(r16[0].shape, Ha); + return t10.runWebGLProgram(d, r16, o); } let i = A().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER"); if (s.length > i) { let d = []; for (let h = 0; h < s.length; h += i) { let g = s.slice(h, h + i); - d.push(Bc(g, t8, e)); + d.push(Kl(g, e, t10)); } - let f = Bc(d, t8, e); + let f = Kl(d, e, t10); for (let h of d) - e.disposeIntermediateTensorInfo(h); + t10.disposeIntermediateTensorInfo(h); return f; } if (a) { - let d = new Ph(s.map((f) => f.shape), t8); - return e.runWebGLProgram(d, s, o); - } - let { tensors2D: p, outShape: u } = Z9(s, t8, e), c = new Ah(p.map((d) => d.shape)), l = e.runWebGLProgram(c, p, o); - p.forEach((d) => e.disposeIntermediateTensorInfo(d)); - let m = te({ inputs: { x: l }, attrs: { shape: u }, backend: e }); - return e.disposeIntermediateTensorInfo(l), m; -} -function Z9(r15, t8, e) { - let o = w.computeOutShape(r15.map((s) => s.shape), t8); - return { tensors2D: r15.map((s) => te({ inputs: { x: s }, attrs: { shape: [-1, y.sizeFromShape(s.shape.slice(t8))] }, backend: e })), outShape: o }; -} -function Iv(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { axis: n } = o, s = y.parseAxisParam(n, t8[0].shape)[0], a = t8.map((u) => u.shape); - w.assertParamsConsistent(a, s); - let i = w.computeOutShape(t8.map((u) => u.shape), s); + let d = new qh(s.map((f) => f.shape), e); + return t10.runWebGLProgram(d, s, o); + } + let { tensors2D: p, outShape: u } = kee(s, e, t10), l = new Hh(p.map((d) => d.shape)), c = t10.runWebGLProgram(l, p, o); + p.forEach((d) => t10.disposeIntermediateTensorInfo(d)); + let m = te({ inputs: { x: c }, attrs: { shape: u }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(c), m; +} +function kee(r16, e, t10) { + let o = C.computeOutShape(r16.map((s) => s.shape), e); + return { tensors2D: r16.map((s) => te({ inputs: { x: s }, attrs: { shape: [-1, y.sizeFromShape(s.shape.slice(e))] }, backend: t10 })), outShape: o }; +} +function M0(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { axis: n } = o, s = y.parseAxisParam(n, e[0].shape)[0], a = e.map((u) => u.shape); + C.assertParamsConsistent(a, s); + let i = C.computeOutShape(e.map((u) => u.shape), s); if (y.sizeFromShape(i) === 0) - return e.makeTensorInfo(i, t8[0].dtype, []); - let p = t8.filter((u) => y.sizeFromShape(u.shape) > 0); - return p.length === 1 ? Dt({ inputs: { x: p[0] }, backend: e }) : Bc(p, s, e); -} -var OA = { kernelName: ta, backendName: "webgl", kernelFunc: Iv }; -var zc = class { - constructor(t8, e = false, o = null, n = false, s = false) { - this.variableNames = ["x", "W"], this.outputShape = t8.outShape; - let a = t8.padInfo.top, i = t8.padInfo.left, p = t8.strideHeight, u = t8.strideWidth, c = t8.dilationHeight, l = t8.dilationWidth, m = t8.filterHeight, d = t8.filterWidth, f = Math.floor(t8.inChannels / 4) * 4, h = t8.inChannels % 4, g = t8.dataFormat === "channelsLast", x = g ? 1 : 2, b = g ? 2 : 3, C = g ? 3 : 1, S = "", k = ""; + return t10.makeTensorInfo(i, e[0].dtype, []); + let p = e.filter((u) => y.sizeFromShape(u.shape) > 0); + return p.length === 1 ? Ft({ inputs: { x: p[0] }, backend: t10 }) : Kl(p, s, t10); +} +var TF = { kernelName: pa, backendName: "webgl", kernelFunc: M0 }; +var ql = class { + constructor(e, t10 = false, o = null, n = false, s = false) { + this.variableNames = ["x", "W"], this.outputShape = e.outShape; + let a = e.padInfo.top, i = e.padInfo.left, p = e.strideHeight, u = e.strideWidth, l = e.dilationHeight, c = e.dilationWidth, m = e.filterHeight, d = e.filterWidth, f = Math.floor(e.inChannels / 4) * 4, h = e.inChannels % 4, g = e.dataFormat === "channelsLast", x = g ? 1 : 2, b = g ? 2 : 3, w = g ? 3 : 1, S = "", k = ""; o && (n ? S = `float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${o} @@ -20409,8 +20505,8 @@ var zc = class { ${o} } `, k = "result = activation(result);"); - let _ = e ? "result += getBiasAtOutCoords();" : ""; - e && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` + let T = t10 ? "result += getBiasAtOutCoords();" : ""; + t10 && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` ${S} const ivec2 strides = ivec2(${p}, ${u}); @@ -20419,7 +20515,7 @@ var zc = class { void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; - int d2 = coords[${C}]; + int d2 = coords[${w}]; ivec2 xRCCorner = ivec2(coords[${x}], coords[${b}]) * strides - pads; @@ -20430,16 +20526,16 @@ var zc = class { // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR < ${m}; wR++) { - int xR = xRCorner + wR * ${c}; + int xR = xRCorner + wR * ${l}; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${d}; wC++) { - int xC = xCCorner + wC * ${l}; + int xC = xCCorner + wC * ${c}; - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -20530,20 +20626,20 @@ var zc = class { } float result = dotProd; - ${_} + ${T} ${k} setOutput(result); } `; } }; -var Oh = class { - constructor(t8) { - this.variableNames = ["x", "W"], this.outputShape = t8.outShape; - let e = t8.padInfo.front, o = t8.padInfo.top, n = t8.padInfo.left, s = t8.strideDepth, a = t8.strideHeight, i = t8.strideWidth, p = t8.dilationDepth, u = t8.dilationHeight, c = t8.dilationWidth, l = t8.filterDepth, m = t8.filterHeight, d = t8.filterWidth, f = Math.floor(t8.inChannels / 4) * 4, h = t8.inChannels % 4; +var jh = class { + constructor(e) { + this.variableNames = ["x", "W"], this.outputShape = e.outShape; + let t10 = e.padInfo.front, o = e.padInfo.top, n = e.padInfo.left, s = e.strideDepth, a = e.strideHeight, i = e.strideWidth, p = e.dilationDepth, u = e.dilationHeight, l = e.dilationWidth, c = e.filterDepth, m = e.filterHeight, d = e.filterWidth, f = Math.floor(e.inChannels / 4) * 4, h = e.inChannels % 4; this.userCode = ` const ivec3 strides = ivec3(${s}, ${a}, ${i}); - const ivec3 pads = ivec3(${e}, ${o}, ${n}); + const ivec3 pads = ivec3(${t10}, ${o}, ${n}); void main() { ivec5 coords = getOutputCoords(); @@ -20559,24 +20655,24 @@ var Oh = class { // y(yF, yR, yC, d2). ? = to be determined. : = across all // values in that axis. float dotProd = 0.0; - for (int wF = 0; wF < ${l}; wF++) { + for (int wF = 0; wF < ${c}; wF++) { int xF = xFCorner + wF * ${p}; - if (xF < 0 || xF >= ${t8.inDepth}) { + if (xF < 0 || xF >= ${e.inDepth}) { continue; } for (int wR = 0; wR < ${m}; wR++) { int xR = xRCorner + wR * ${u}; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${d}; wC++) { - int xC = xCCorner + wC * ${c}; + int xC = xCCorner + wC * ${l}; - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -20632,13 +20728,13 @@ var Oh = class { `; } }; -var Vc = class { - constructor(t8, e = false, o = null, n = false, s = false) { - this.variableNames = ["x", "W"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "pads", type: "ivec2" }, { name: "strides", type: "ivec2" }, { name: "dilations", type: "ivec2" }, { name: "inDims", type: "ivec2" }], this.outputShape = t8.outShape, this.enableShapeUniforms = ut(this.outputShape.length); - let a = t8.padInfo.left, i = t8.strideWidth, p = t8.dilationWidth, u = t8.filterHeight, c = t8.filterWidth, l = c, m = ` +var jl = class { + constructor(e, t10 = false, o = null, n = false, s = false) { + this.variableNames = ["x", "W"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "pads", type: "ivec2" }, { name: "strides", type: "ivec2" }, { name: "dilations", type: "ivec2" }, { name: "inDims", type: "ivec2" }], this.outputShape = e.outShape, this.enableShapeUniforms = lt(this.outputShape.length); + let a = e.padInfo.left, i = e.strideWidth, p = e.dilationWidth, u = e.filterHeight, l = e.filterWidth, c = l, m = ` int xR; int xC; int xCOffset; vec4 wTexel; vec4 previous; vec4 final;`; - for (let g = 0; g < c; g++) + for (let g = 0; g < l; g++) m += ` vec4 xTexelC${g * 2}; int xTexelC${g * 2}Ready; @@ -20647,9 +20743,9 @@ var Vc = class { vec4 xC${g};`; m += ` for (int r = 0; r < ${u}; r++) { - for (int d1 = 0; d1 < ${t8.inChannels}; d1 += 2) { + for (int d1 = 0; d1 < ${e.inChannels}; d1 += 2) { `; - for (let g = 0; g < c; g++) + for (let g = 0; g < l; g++) m += ` xTexelC${g * 2} = vec4(0.0); xTexelC${g * 2}Ready = 0; @@ -20660,12 +20756,12 @@ var Vc = class { xR = xRCorner + r * dilations[0]; if (xR >=0 && xR < inDims[0]) { `; - for (let g = 0; g < (l + 1) / 2; g++) { + for (let g = 0; g < (c + 1) / 2; g++) { let x = g * 2; if (m += ` xC = xCCorner + ${x * p}; `, i === 1) { - if (x < c && (a % 2 === 1 ? (m += ` + if (x < l && (a % 2 === 1 ? (m += ` xCOffset = xC + 1; if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) { xTexelC${x} = getX(batch, xR, xCOffset, d1); @@ -20705,7 +20801,7 @@ var Vc = class { } xC${x} = xTexelC${x}; - `, x + 1 < c)) { + `, x + 1 < l)) { let b = a % 2 === 0 ? y.nearestLargerEven(p) : p; p % 2 === 0 && a % 2 === 1 || p % 2 !== 0 && a % 2 !== 1 ? (m += ` xCOffset = xC + imod(pads[1], 2) + ${b}; @@ -20747,7 +20843,7 @@ var Vc = class { `; } } else - x < c && (a % 2 === 1 ? (m += ` + x < l && (a % 2 === 1 ? (m += ` xCOffset = xC + 1 - strides[1]; if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) { xTexelC${x} = getX(batch, xR, xCOffset, d1); @@ -20770,7 +20866,7 @@ var Vc = class { } xC${x} = vec4(xTexelC${x}.zw, xTexelC${x + 1}.zw); - `, x + 1 < c && (m += ` + `, x + 1 < l && (m += ` final = vec4(0.0); xCOffset = xC + 1 + strides[1]; if(xCOffset >= 0 && xCOffset < inDims[1]) { @@ -20797,19 +20893,19 @@ var Vc = class { xC${x} = vec4( xTexelC${x}.xy, xTexelC${x + 1}.xy); - `, x + 1 < c && (m += ` + `, x + 1 < l && (m += ` xC${x + 1} = vec4(xTexelC${x}.zw, xTexelC${x + 1}.zw); `))); - x < c && (m += ` + x < l && (m += ` wTexel = getW(r, ${x}, d1, d2); dotProd += xC${x}.xxzz * vec4(wTexel.xy, wTexel.xy); - if(d1 + 1 < ${t8.inChannels}) { + if(d1 + 1 < ${e.inChannels}) { dotProd += xC${x}.yyww * vec4(wTexel.zw, wTexel.zw); } - `, x + 1 < c && (m += ` + `, x + 1 < l && (m += ` wTexel = getW(r, ${x + 1}, d1, d2); dotProd += xC${x + 1}.xxzz * vec4(wTexel.xy, wTexel.xy); - if(d1 + 1 < ${t8.inChannels}) { + if(d1 + 1 < ${e.inChannels}) { dotProd += xC${x + 1}.yyww * vec4(wTexel.zw, wTexel.zw); } `)); @@ -20831,8 +20927,8 @@ var Vc = class { }` : d = `vec4 activation(vec4 x) { ${o} }`, f = "result = activation(result);"); - let h = e ? "result += getBiasAtOutCoords();" : ""; - e && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` + let h = t10 ? "result += getBiasAtOutCoords();" : ""; + t10 && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` ${d} void main() { @@ -20856,15 +20952,15 @@ var Vc = class { `; } }; -var Mh = class { - constructor(t8, e) { - this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "inputShape", type: "ivec4" }, { name: "pad", type: "ivec2" }, { name: "stride", type: "ivec2" }, { name: "dilation", type: "ivec2" }, { name: "inChannels", type: "int" }, { name: "itemsPerBlockRow", type: "int" }, { name: "outWidth", type: "int" }], this.outputShape = t8, this.enableShapeUniforms = ut(this.outputShape.length); - let { dataFormat: o } = e, n = It(), s = o === "channelsLast", a = s ? 1 : 2, i = s ? 2 : 3, p = this.enableShapeUniforms ? "if(blockIndex < outShape[2] && pos < outShape[1]) {" : `if(blockIndex < ${t8[2]} && pos < ${t8[1]}) {`, u = ""; - for (let c = 0; c <= 1; c++) - for (let l = 0; l <= 1; l++) +var Xh = class { + constructor(e, t10) { + this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "inputShape", type: "ivec4" }, { name: "pad", type: "ivec2" }, { name: "stride", type: "ivec2" }, { name: "dilation", type: "ivec2" }, { name: "inChannels", type: "int" }, { name: "itemsPerBlockRow", type: "int" }, { name: "outWidth", type: "int" }], this.outputShape = e, this.enableShapeUniforms = lt(this.outputShape.length); + let { dataFormat: o } = t10, n = kt(), s = o === "channelsLast", a = s ? 1 : 2, i = s ? 2 : 3, p = this.enableShapeUniforms ? "if(blockIndex < outShape[2] && pos < outShape[1]) {" : `if(blockIndex < ${e[2]} && pos < ${e[1]}) {`, u = ""; + for (let l = 0; l <= 1; l++) + for (let c = 0; c <= 1; c++) u += ` - blockIndex = rc.z + ${l}; - pos = rc.y + ${c}; + blockIndex = rc.z + ${c}; + pos = rc.y + ${l}; ${p} offsetY = int(blockIndex / outWidth) * stride[0] - pad[0]; @@ -20884,12 +20980,12 @@ var Mh = class { if (${s}) { innerDims = vec2(d1, ch); - result[${c * 2 + l}] = getChannel( + result[${l * 2 + c}] = getChannel( getA(rc.x, d0, int(innerDims.x), int(innerDims.y)), innerDims); } else { innerDims = vec2(d0, d1); - result[${c * 2 + l}] = getChannel( + result[${l * 2 + c}] = getChannel( getA(rc.x, ch, int(innerDims.x), int(innerDims.y)), innerDims); } @@ -20913,81 +21009,81 @@ var Mh = class { `; } }; -function Lh(r15, t8) { - let e = r15.length; - return e >= 3 ? t8 ? [...r15.slice(0, -3), r15[e - 3] * r15[e - 2], r15[e - 1]] : [...r15.slice(0, -3), r15[e - 3], r15[e - 2] * r15[e - 1]] : !t8 && e === 1 && r15[0] > 1 ? [r15[0], 1] : null; +function Yh(r16, e) { + let t10 = r16.length; + return t10 >= 3 ? e ? [...r16.slice(0, -3), r16[t10 - 3] * r16[t10 - 2], r16[t10 - 1]] : [...r16.slice(0, -3), r16[t10 - 3], r16[t10 - 2] * r16[t10 - 1]] : !e && t10 === 1 && r16[0] > 1 ? [r16[0], 1] : null; } -function Bh({ x: r15, filter: t8, convInfo: e, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { - let p = r15.shape, u = o.texData.get(r15.dataId), c = e.inChannels, l = p[0] * p[1] * p[2], m = e.outChannels, d = e.dataFormat === "channelsLast", f = false, h = false, g, x = []; +function Qh({ x: r16, filter: e, convInfo: t10, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { + let p = r16.shape, u = o.texData.get(r16.dataId), l = t10.inChannels, c = p[0] * p[1] * p[2], m = t10.outChannels, d = t10.dataFormat === "channelsLast", f = false, h = false, g, x = []; if (s != null) { - let S = Lh(s.shape, d); + let S = Yh(s.shape, d); S != null && (s = te({ inputs: { x: s }, backend: o, attrs: { shape: S } }), x.push(s)); } if (n != null) { - let S = Lh(n.shape, d); + let S = Yh(n.shape, d); S != null && (n = te({ inputs: { x: n }, backend: o, attrs: { shape: S } }), x.push(n)); } - if (!((l === 1 || m === 1) && c > bv) && u.isPacked && d && u.texture != null && p[2] % 2 !== 0 && y.arraysEqual(u.shape.slice(-3), p.slice(-3))) { - let S = p[0] * p[1] * (p[2] + 1), k = { dataId: r15.dataId, shape: [1, S, e.inChannels], dtype: r15.dtype }, _ = u.shape; - u.shape = u.shape.slice(), u.shape[u.shape.length - 2]++, y.assert(hu(u.shape, k.shape), () => `packed reshape ${u.shape} to ${k.shape} isn't free`); - let E = te({ inputs: { x: t8 }, backend: o, attrs: { shape: [1, e.inChannels, e.outChannels] } }); + if (!((c === 1 || m === 1) && l > A0) && u.isPacked && d && u.texture != null && p[2] % 2 !== 0 && y.arraysEqual(u.shape.slice(-3), p.slice(-3))) { + let S = p[0] * p[1] * (p[2] + 1), k = { dataId: r16.dataId, shape: [1, S, t10.inChannels], dtype: r16.dtype }, T = u.shape; + u.shape = u.shape.slice(), u.shape[u.shape.length - 2]++, y.assert(vu(u.shape, k.shape), () => `packed reshape ${u.shape} to ${k.shape} isn't free`); + let E = te({ inputs: { x: e }, backend: o, attrs: { shape: [1, t10.inChannels, t10.outChannels] } }); x.push(E); - let R = Cp({ a: k, b: E, backend: o, transposeA: f, transposeB: h, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }), D = o.texData.get(R.dataId); - y.assert(D.isPacked, () => "batchMatMul result is expected to be packed"), u.shape = _, D.shape = e.outShape, g = Dt({ inputs: { x: R }, backend: o }), g.shape = e.outShape, x.push(R); + let R = _p({ a: k, b: E, backend: o, transposeA: f, transposeB: h, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }), D = o.texData.get(R.dataId); + y.assert(D.isPacked, () => "batchMatMul result is expected to be packed"), u.shape = T, D.shape = t10.outShape, g = Ft({ inputs: { x: R }, backend: o }), g.shape = t10.outShape, x.push(R); } else { - let S = e.outHeight * e.outWidth, k = te({ inputs: { x: r15 }, backend: o, attrs: { shape: d ? [e.batchSize, S, e.inChannels] : [e.batchSize, e.inChannels, S] } }), _ = te({ inputs: { x: t8 }, backend: o, attrs: { shape: [1, e.inChannels, e.outChannels] } }), E = Cp({ a: d ? k : _, b: d ? _ : k, transposeA: !d, transposeB: h, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }); - g = te({ inputs: { x: E }, backend: o, attrs: { shape: e.outShape } }), x.push(k), x.push(_), x.push(E); + let S = t10.outHeight * t10.outWidth, k = te({ inputs: { x: r16 }, backend: o, attrs: { shape: d ? [t10.batchSize, S, t10.inChannels] : [t10.batchSize, t10.inChannels, S] } }), T = te({ inputs: { x: e }, backend: o, attrs: { shape: [1, t10.inChannels, t10.outChannels] } }), E = _p({ a: d ? k : T, b: d ? T : k, transposeA: !d, transposeB: h, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }); + g = te({ inputs: { x: E }, backend: o, attrs: { shape: t10.outShape } }), x.push(k), x.push(T), x.push(E); } for (let S of x) o.disposeIntermediateTensorInfo(S); return g; } -function zh({ x: r15, filter: t8, convInfo: e, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { - let { filterWidth: p, filterHeight: u, inChannels: c, outWidth: l, outHeight: m, dataFormat: d } = e, f = d === "channelsLast", h = p * u * c, g = m * l, x = [e.batchSize, h, g], b = true, C = false, S = []; +function Zh({ x: r16, filter: e, convInfo: t10, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { + let { filterWidth: p, filterHeight: u, inChannels: l, outWidth: c, outHeight: m, dataFormat: d } = t10, f = d === "channelsLast", h = p * u * l, g = m * c, x = [t10.batchSize, h, g], b = true, w = false, S = []; if (s != null) { - let q = Lh(s.shape, f); + let q = Yh(s.shape, f); q != null && (s = te({ inputs: { x: s }, backend: o, attrs: { shape: q } }), S.push(s)); } if (n != null) { - let q = Lh(n.shape, f); + let q = Yh(n.shape, f); q != null && (n = te({ inputs: { x: n }, backend: o, attrs: { shape: q } }), S.push(n)); } - let k = te({ inputs: { x: t8 }, backend: o, attrs: { shape: [1, h, y.sizeFromShape(t8.shape) / h] } }); + let k = te({ inputs: { x: e }, backend: o, attrs: { shape: [1, h, y.sizeFromShape(e.shape) / h] } }); S.push(k); - let _ = new Mh(x, e), E = [r15.shape, [e.padInfo.top, e.padInfo.left], [e.strideHeight, e.strideWidth], [e.dilationHeight, e.dilationWidth], [e.inChannels], [e.filterWidth * e.inChannels], [e.outWidth]], R = o.runWebGLProgram(_, [r15], "float32", E), D = te({ inputs: { x: R }, backend: o, attrs: { shape: x } }); + let T = new Xh(x, t10), E = [r16.shape, [t10.padInfo.top, t10.padInfo.left], [t10.strideHeight, t10.strideWidth], [t10.dilationHeight, t10.dilationWidth], [t10.inChannels], [t10.filterWidth * t10.inChannels], [t10.outWidth]], R = o.runWebGLProgram(T, [r16], "float32", E), D = te({ inputs: { x: R }, backend: o, attrs: { shape: x } }); S.push(R), S.push(D); - let P = n != null, O = s != null, M = i === "leakyrelu", L = i ? xi(i, true) : null, B = new Lc(f ? D.shape : k.shape, f ? k.shape : D.shape, f ? [e.batchSize, g, e.outChannels] : [e.batchSize, e.outChannels, g], b, C, P, L, O, M), z = f ? [D, k] : [k, D]; + let F = n != null, O = s != null, M = i === "leakyrelu", L = i ? Ti(i, true) : null, B = new Hl(f ? D.shape : k.shape, f ? k.shape : D.shape, f ? [t10.batchSize, g, t10.outChannels] : [t10.batchSize, t10.outChannels, g], b, w, F, L, O, M), z = f ? [D, k] : [k, D]; if (n && z.push(n), O && z.push(s), M) { let q = o.makeTensorInfo([], "float32", y.createScalarValue(a, "float32")); z.push(q), S.push(q); } - let U = o.runWebGLProgram(B, z, "float32"), j = te({ inputs: { x: U }, backend: o, attrs: { shape: e.outShape } }); + let U = o.runWebGLProgram(B, z, "float32"), j = te({ inputs: { x: U }, backend: o, attrs: { shape: t10.outShape } }); S.push(U); for (let q of S) o.disposeIntermediateTensorInfo(q); return j; } -function J9(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: c } = o, l = w.convertConv2DDataFormat(p), m = w.computeConv2DInfo(n.shape, s.shape, a, u, i, c, false, l), d; +function Nee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: l } = o, c = C.convertConv2DDataFormat(p), m = C.computeConv2DInfo(n.shape, s.shape, a, u, i, l, false, c), d; if (m.filterHeight === 1 && m.filterWidth === 1 && m.dilationHeight === 1 && m.dilationWidth === 1 && m.strideHeight === 1 && m.strideWidth === 1 && (m.padInfo.type === "SAME" || m.padInfo.type === "VALID")) - d = Bh({ x: n, filter: s, convInfo: m, backend: e }); - else if (m.strideWidth <= 2 && l === "channelsLast" && A().getBool("WEBGL_EXP_CONV")) { - let h = new Vc(m), g = [[m.padInfo.top, m.padInfo.left], [m.strideHeight, m.strideWidth], [m.dilationHeight, m.dilationWidth], [m.inHeight, m.inWidth]]; - d = e.runWebGLProgram(h, [n, s], "float32", g); + d = Qh({ x: n, filter: s, convInfo: m, backend: t10 }); + else if (m.strideWidth <= 2 && c === "channelsLast" && A().getBool("WEBGL_EXP_CONV")) { + let h = new jl(m), g = [[m.padInfo.top, m.padInfo.left], [m.strideHeight, m.strideWidth], [m.dilationHeight, m.dilationWidth], [m.inHeight, m.inWidth]]; + d = t10.runWebGLProgram(h, [n, s], "float32", g); } else if (A().getBool("WEBGL_CONV_IM2COL")) - d = zh({ x: n, filter: s, convInfo: m, backend: e }); + d = Zh({ x: n, filter: s, convInfo: m, backend: t10 }); else { - let h = new zc(m); - d = e.runWebGLProgram(h, [n, s], "float32"); + let h = new ql(m); + d = t10.runWebGLProgram(h, [n, s], "float32"); } - let f = te({ inputs: { x: d }, backend: e, attrs: { shape: m.outShape } }); - return e.disposeIntermediateTensorInfo(d), f; + let f = te({ inputs: { x: d }, backend: t10, attrs: { shape: m.outShape } }); + return t10.disposeIntermediateTensorInfo(d), f; } -var MA = { kernelName: tn, backendName: "webgl", kernelFunc: J9 }; -var Vh = class { - constructor(t8) { - this.variableNames = ["x", "dy"], this.outputShape = t8.filterShape; - let e = t8.strideHeight, o = t8.strideWidth, n = t8.padInfo.top, s = t8.padInfo.left, a = t8.dataFormat === "channelsLast"; +var _F = { kernelName: En, backendName: "webgl", kernelFunc: Nee }; +var Jh = class { + constructor(e) { + this.variableNames = ["x", "dy"], this.outputShape = e.filterShape; + let t10 = e.strideHeight, o = e.strideWidth, n = e.padInfo.top, s = e.padInfo.left, a = e.dataFormat === "channelsLast"; this.userCode = ` void main() { ivec4 coords = getOutputCoords(); @@ -21000,18 +21096,18 @@ var Vh = class { // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int b = 0; b < ${t8.batchSize}; b++) { - for (int yR = 0; yR < ${t8.outHeight}; yR++) { - int xR = wR + yR * ${e} - ${n}; + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { + int xR = wR + yR * ${t10} - ${n}; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int yC = 0; yC < ${t8.outWidth}; yC++) { + for (int yC = 0; yC < ${e.outWidth}; yC++) { int xC = wC + yC * ${o} - ${s}; - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -21028,39 +21124,39 @@ var Vh = class { `; } }; -var Wh = class { - constructor(t8) { - this.variableNames = ["dy", "W"], this.outputShape = t8.inShape; - let e = t8.filterHeight, o = t8.filterWidth, n = t8.strideHeight, s = t8.strideWidth, a = t8.dataFormat === "channelsLast", i = e - 1 - t8.padInfo.top, p = o - 1 - t8.padInfo.left, u = a ? 1 : 2, c = a ? 2 : 3, l = a ? 3 : 1; +var eg = class { + constructor(e) { + this.variableNames = ["dy", "W"], this.outputShape = e.inShape; + let t10 = e.filterHeight, o = e.filterWidth, n = e.strideHeight, s = e.strideWidth, a = e.dataFormat === "channelsLast", i = t10 - 1 - e.padInfo.top, p = o - 1 - e.padInfo.left, u = a ? 1 : 2, l = a ? 2 : 3, c = a ? 3 : 1; this.userCode = ` const ivec2 pads = ivec2(${i}, ${p}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; - int d1 = coords[${l}]; + int d1 = coords[${c}]; - ivec2 dyCorner = ivec2(coords[${u}], coords[${c}]) - pads; + ivec2 dyCorner = ivec2(coords[${u}], coords[${l}]) - pads; int dyRCorner = dyCorner.x; int dyCCorner = dyCorner.y; // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wR = 0; wR < ${e}; wR++) { + for (int wR = 0; wR < ${t10}; wR++) { float dyR = float(dyRCorner + wR) / ${n}.0; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - int wRPerm = ${e} - 1 - wR; + int wRPerm = ${t10} - 1 - wR; for (int wC = 0; wC < ${o}; wC++) { float dyC = float(dyCCorner + wC) / ${s}.0; - if (dyC < 0.0 || dyC >= ${t8.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -21068,7 +21164,7 @@ var Wh = class { int wCPerm = ${o} - 1 - wC; - for (int d2 = 0; d2 < ${t8.outChannels}; d2++) { + for (int d2 = 0; d2 < ${e.outChannels}; d2++) { if (${a}) { float xValue = getDy(batch, idyR, idyC, d2); @@ -21088,10 +21184,10 @@ var Wh = class { `; } }; -var Uh = class { - constructor(t8) { - this.variableNames = ["x", "dy"], this.outputShape = t8.filterShape; - let e = t8.strideDepth, o = t8.strideHeight, n = t8.strideWidth, s = t8.padInfo.front, a = t8.padInfo.top, i = t8.padInfo.left; +var tg = class { + constructor(e) { + this.variableNames = ["x", "dy"], this.outputShape = e.filterShape; + let t10 = e.strideDepth, o = e.strideHeight, n = e.strideWidth, s = e.padInfo.front, a = e.padInfo.top, i = e.padInfo.left; this.userCode = ` void main() { ivec5 coords = getOutputCoords(); @@ -21103,25 +21199,25 @@ var Uh = class { float dotProd = 0.0; - for (int b = 0; b < ${t8.batchSize}; b++) { - for (int yF = 0; yF < ${t8.outDepth}; yF++) { - int xF = wF + yF * ${e} - ${s}; + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yF = 0; yF < ${e.outDepth}; yF++) { + int xF = wF + yF * ${t10} - ${s}; - if (xF < 0 || xF >= ${t8.inDepth}) { + if (xF < 0 || xF >= ${e.inDepth}) { continue; } - for (int yR = 0; yR < ${t8.outHeight}; yR++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { int xR = wR + yR * ${o} - ${a}; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int yC = 0; yC < ${t8.outWidth}; yC++) { + for (int yC = 0; yC < ${e.outWidth}; yC++) { int xC = wC + yC * ${n} - ${i}; - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -21137,12 +21233,12 @@ var Uh = class { `; } }; -var Gh = class { - constructor(t8) { - this.variableNames = ["dy", "W"], this.outputShape = t8.inShape; - let e = t8.filterDepth, o = t8.filterHeight, n = t8.filterWidth, s = t8.strideDepth, a = t8.strideHeight, i = t8.strideWidth, p = e - 1 - t8.padInfo.front, u = o - 1 - t8.padInfo.top, c = n - 1 - t8.padInfo.left; +var rg = class { + constructor(e) { + this.variableNames = ["dy", "W"], this.outputShape = e.inShape; + let t10 = e.filterDepth, o = e.filterHeight, n = e.filterWidth, s = e.strideDepth, a = e.strideHeight, i = e.strideWidth, p = t10 - 1 - e.padInfo.front, u = o - 1 - e.padInfo.top, l = n - 1 - e.padInfo.left; this.userCode = ` - const ivec3 pads = ivec3(${p}, ${u}, ${c}); + const ivec3 pads = ivec3(${p}, ${u}, ${l}); void main() { ivec5 coords = getOutputCoords(); @@ -21156,20 +21252,20 @@ var Gh = class { int dyCCorner = dyCorner.z; float dotProd = 0.0; - for (int wF = 0; wF < ${e}; wF++) { + for (int wF = 0; wF < ${t10}; wF++) { float dyF = float(dyFCorner + wF) / ${s}.0; - if (dyF < 0.0 || dyF >= ${t8.outDepth}.0 || fract(dyF) > 0.0) { + if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) { continue; } int idyF = int(dyF); - int wFPerm = ${e} - 1 - wF; + int wFPerm = ${t10} - 1 - wF; for (int wR = 0; wR < ${o}; wR++) { float dyR = float(dyRCorner + wR) / ${a}.0; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } @@ -21180,7 +21276,7 @@ var Gh = class { for (int wC = 0; wC < ${n}; wC++) { float dyC = float(dyCCorner + wC) / ${i}.0; - if (dyC < 0.0 || dyC >= ${t8.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -21188,7 +21284,7 @@ var Gh = class { int wCPerm = ${n} - 1 - wC; - for (int d2 = 0; d2 < ${t8.outChannels}; d2++) { + for (int d2 = 0; d2 < ${e.outChannels}; d2++) { float xValue = getDy(batch, idyF, idyR, idyC, d2); float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2); dotProd += xValue * wValue; @@ -21201,15 +21297,15 @@ var Gh = class { `; } }; -function eJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, filterShape: c } = o, l = w.convertConv2DDataFormat(p), m = w.computeConv2DInfo(n.shape, c, a, 1, i, u, false, l), d = new Vh(m); - return e.runWebGLProgram(d, [n, s], "float32"); +function Tee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, filterShape: l } = o, c = C.convertConv2DDataFormat(p), m = C.computeConv2DInfo(n.shape, l, a, 1, i, u, false, c), d = new Jh(m); + return t10.runWebGLProgram(d, [n, s], "float32"); } -var LA = { kernelName: Ai, backendName: "webgl", kernelFunc: eJ }; -var Hh = class { - constructor(t8) { - this.variableNames = ["dy", "W"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "strides", type: "vec2" }], this.outputShape = t8.inShape, this.enableShapeUniforms = ut(this.outputShape.length); - let e = t8.filterHeight, o = t8.filterWidth, n = e - 1 - t8.padInfo.top, s = o - 1 - t8.padInfo.left; +var EF = { kernelName: Ui, backendName: "webgl", kernelFunc: Tee }; +var og = class { + constructor(e) { + this.variableNames = ["dy", "W"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "strides", type: "vec2" }], this.outputShape = e.inShape, this.enableShapeUniforms = lt(this.outputShape.length); + let t10 = e.filterHeight, o = e.filterWidth, n = t10 - 1 - e.padInfo.top, s = o - 1 - e.padInfo.left; this.userCode = ` const ivec2 pads = ivec2(${n}, ${s}); @@ -21223,29 +21319,29 @@ var Hh = class { int dyCCorner = dyCorner.y; vec4 result = vec4(0.); - for (int wR = 0; wR < ${e}; wR++) { + for (int wR = 0; wR < ${t10}; wR++) { float dyR = float(dyRCorner + wR) / strides[0]; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - int wRPerm = ${e} - 1 - wR; + int wRPerm = ${t10} - 1 - wR; for (int wC = 0; wC < ${o}; wC++) { int wCPerm = ${o} - 1 - wC; float dyC = float(dyCCorner + wC) / strides[1]; - bool idyCVal = (dyC >= 0.0) && (dyC < ${t8.outWidth}.0) + bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0) && (fract(dyC) == 0.0); int idyC = int(dyC); float dyC2 = float(dyCCorner + wC + 1) / strides[1]; - bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${t8.outWidth}.0) + bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0) && (fract(dyC2) == 0.0); int idyC2 = int(dyC2); if (idyCVal && idyCVal2) { - for (int d2 = 0; d2 < ${t8.outChannels}; d2 += 2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { vec4 wValue = getW(wRPerm, wCPerm, d1, d2); vec4 dySample = getDy(batch, idyR, idyC, d2); vec4 dySample2 = (idyC / 2 == idyC2 / 2) ? @@ -21262,7 +21358,7 @@ var Hh = class { dot(dyValue, wValue.zw)); } } else if (idyCVal) { - for (int d2 = 0; d2 < ${t8.outChannels}; d2 += 2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { vec4 wValue = getW(wRPerm, wCPerm, d1, d2); vec4 dySample = getDy(batch, idyR, idyC, d2); vec2 dyValue = mod(float(idyC), 2.) == 0. ? @@ -21271,7 +21367,7 @@ var Hh = class { dot(dyValue, wValue.zw)); } } else if (idyCVal2) { - for (int d2 = 0; d2 < ${t8.outChannels}; d2 += 2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { vec4 wValue = getW(wRPerm, wCPerm, d1, d2); vec4 dySample = getDy(batch, idyR, idyC2, d2); vec2 dyValue = mod(float(idyC2), 2.) == 0. ? @@ -21287,58 +21383,58 @@ var Hh = class { `; } }; -function tJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { inputShape: a, strides: i, pad: p, dataFormat: u, dimRoundingMode: c } = o, l = w.convertConv2DDataFormat(u), m = w.computeConv2DInfo(a, s.shape, i, 1, p, c, false, l); - if (A().getBool("WEBGL_PACK_CONV2DTRANSPOSE") && l === "channelsLast") { - let d = [[m.strideHeight, m.strideWidth]], f = new Hh(m); - return e.runWebGLProgram(f, [n, s], "float32", d); +function _ee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { inputShape: a, strides: i, pad: p, dataFormat: u, dimRoundingMode: l } = o, c = C.convertConv2DDataFormat(u), m = C.computeConv2DInfo(a, s.shape, i, 1, p, l, false, c); + if (A().getBool("WEBGL_PACK_CONV2DTRANSPOSE") && c === "channelsLast") { + let d = [[m.strideHeight, m.strideWidth]], f = new og(m); + return t10.runWebGLProgram(f, [n, s], "float32", d); } else { - let d = new Wh(m); - return e.runWebGLProgram(d, [n, s], "float32"); + let d = new eg(m); + return t10.runWebGLProgram(d, [n, s], "float32"); } } -var BA = { kernelName: rn, backendName: "webgl", kernelFunc: tJ }; -function rJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p } = o, u = w.computeConv3DInfo(n.shape, s.shape, a, p, i), c = new Oh(u); - return e.runWebGLProgram(c, [n, s], "float32"); +var $F = { kernelName: $n, backendName: "webgl", kernelFunc: _ee }; +function Eee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p } = o, u = C.computeConv3DInfo(n.shape, s.shape, a, p, i), l = new jh(u); + return t10.runWebGLProgram(l, [n, s], "float32"); } -var zA = { kernelName: on, backendName: "webgl", kernelFunc: rJ }; -function oJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, pad: i, filterShape: p } = o, u = w.computeConv3DInfo(n.shape, p, a, 1, i), c = new Uh(u); - return e.runWebGLProgram(c, [n, s], "float32"); +var RF = { kernelName: Rn, backendName: "webgl", kernelFunc: Eee }; +function $ee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, pad: i, filterShape: p } = o, u = C.computeConv3DInfo(n.shape, p, a, 1, i), l = new tg(u); + return t10.runWebGLProgram(l, [n, s], "float32"); } -var VA = { kernelName: ja, backendName: "webgl", kernelFunc: oJ }; -function nJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { pad: a, strides: i, inputShape: p } = o, u = w.computeConv3DInfo(p, s.shape, i, 1, a), c = new Gh(u); - return e.runWebGLProgram(c, [n, s], "float32"); +var DF = { kernelName: ti, backendName: "webgl", kernelFunc: $ee }; +function Ree(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { pad: a, strides: i, inputShape: p } = o, u = C.computeConv3DInfo(p, s.shape, i, 1, a), l = new rg(u); + return t10.runWebGLProgram(l, [n, s], "float32"); } -var WA = { kernelName: nn, backendName: "webgl", kernelFunc: nJ }; -var sJ = Fo + ` +var AF = { kernelName: Dn, backendName: "webgl", kernelFunc: Ree }; +var Dee = sn + ` return cos(x); `; -var aJ = ` +var Aee = ` vec4 result = cos(x); bvec4 isNaN = isnan(x); - ${jr} + ${to} return result; `; -var iJ = xe({ opSnippet: sJ, packedOpSnippet: aJ }); -var UA = { kernelName: sn, backendName: "webgl", kernelFunc: iJ }; -var uJ = ` +var Fee = xe({ opSnippet: Dee, packedOpSnippet: Aee }); +var FF = { kernelName: An, backendName: "webgl", kernelFunc: Fee }; +var Pee = ` float e2x = exp(-x); return (e2x + 1.0 / e2x) / 2.0; `; -var pJ = xe({ opSnippet: uJ }); -var GA = { kernelName: an, backendName: "webgl", kernelFunc: pJ }; -var Kh = class { - constructor(t8, e, o, n, s) { +var Oee = xe({ opSnippet: Pee }); +var PF = { kernelName: Fn, backendName: "webgl", kernelFunc: Oee }; +var ng = class { + constructor(e, t10, o, n, s) { this.variableNames = ["Image", "Boxes", "BoxInd"], this.outputShape = []; - let [a, i, p, u] = t8, [c] = e, [l, m] = o; - this.outputShape = [c, l, m, u]; - let d = n === "bilinear" ? 1 : 0, [f, h] = [`${i - 1}.0`, `${p - 1}.0`], [g, x, b] = l > 1 ? [`${(i - 1) / (l - 1)}`, "(y2-y1) * height_ratio", `y1*${f} + float(y)*(height_scale)`] : ["0.0", "0.0", `0.5 * (y1+y2) * ${f}`], [C, S, k] = m > 1 ? [`${(p - 1) / (m - 1)}`, "(x2-x1) * width_ratio", `x1*${h} + float(x)*(width_scale)`] : ["0.0", "0.0", `0.5 * (x1+x2) * ${h}`]; + let [a, i, p, u] = e, [l] = t10, [c, m] = o; + this.outputShape = [l, c, m, u]; + let d = n === "bilinear" ? 1 : 0, [f, h] = [`${i - 1}.0`, `${p - 1}.0`], [g, x, b] = c > 1 ? [`${(i - 1) / (c - 1)}`, "(y2-y1) * height_ratio", `y1*${f} + float(y)*(height_scale)`] : ["0.0", "0.0", `0.5 * (y1+y2) * ${f}`], [w, S, k] = m > 1 ? [`${(p - 1) / (m - 1)}`, "(x2-x1) * width_ratio", `x1*${h} + float(x)*(width_scale)`] : ["0.0", "0.0", `0.5 * (x1+x2) * ${h}`]; this.userCode = ` const float height_ratio = float(${g}); - const float width_ratio = float(${C}); + const float width_ratio = float(${w}); void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -21400,103 +21496,103 @@ var Kh = class { `; } }; -var cJ = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n, boxes: s, boxInd: a } = t8, { cropSize: i, method: p, extrapolationValue: u } = o, c = new Kh(n.shape, s.shape, i, p, u); - return e.runWebGLProgram(c, [n, s, a], "float32"); -}; -var HA = { kernelName: cn, backendName: "webgl", kernelFunc: cJ }; -var Sp; -(function(r15) { - r15.Prod = "*", r15.Sum = "+"; -})(Sp || (Sp = {})); -var tm = class { - constructor(t8, e, o, n) { - this.op = t8, this.outputShape = e, this.variableNames = ["x"], this.customUniforms = [{ name: "index", type: "float" }]; - let s = this.outputShape.length, a = this.op === Sp.Prod ? "1.0" : "0.0", i = o ? a : `getX(${KA(s, "coords", this.op)})`, p = this.outputShape[this.outputShape.length - 1], u = "", c = ""; - o ? (u = n ? `end != ${p - 1}` : "end != 0", c = n ? "end + 1" : "end - 1") : (u = n ? `end + pow2 < ${p}` : "end >= pow2", c = n ? "end + pow2" : "end - pow2"), this.userCode = ` +var Mee = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n, boxes: s, boxInd: a } = e, { cropSize: i, method: p, extrapolationValue: u } = o, l = new ng(n.shape, s.shape, i, p, u); + return t10.runWebGLProgram(l, [n, s, a], "float32"); +}; +var OF = { kernelName: Mn, backendName: "webgl", kernelFunc: Mee }; +var $p; +(function(r16) { + r16.Prod = "*", r16.Sum = "+"; +})($p || ($p = {})); +var lm = class { + constructor(e, t10, o, n) { + this.op = e, this.outputShape = t10, this.variableNames = ["x"], this.customUniforms = [{ name: "index", type: "float" }]; + let s = this.outputShape.length, a = this.op === $p.Prod ? "1.0" : "0.0", i = o ? a : `getX(${MF(s, "coords", this.op)})`, p = this.outputShape[this.outputShape.length - 1], u = "", l = ""; + o ? (u = n ? `end != ${p - 1}` : "end != 0", l = n ? "end + 1" : "end - 1") : (u = n ? `end + pow2 < ${p}` : "end >= pow2", l = n ? "end + pow2" : "end - pow2"), this.userCode = ` void main() { ${Re(s)} coords = getOutputCoords(); - int end = ${qA(s, "coords", this.op)}; + int end = ${LF(s, "coords", this.op)}; float val = ${i}; int pow2 = int(pow(2.0, index)); if (${u}) { - int idx = ${c}; - ${qA(s, "coords", this.op)} = idx; - val ${this.op}= getX(${KA(s, "coords", this.op)}); + int idx = ${l}; + ${LF(s, "coords", this.op)} = idx; + val ${this.op}= getX(${MF(s, "coords", this.op)}); } setOutput(val); } `; } }; -function KA(r15, t8, e) { - if (r15 === 1) - return `${t8}`; - if (r15 === 2) - return `${t8}.x, ${t8}.y`; - if (r15 === 3) - return `${t8}.x, ${t8}.y, ${t8}.z`; - if (r15 === 4) - return `${t8}.x, ${t8}.y, ${t8}.z, ${t8}.w`; - throw new Error(`Cumulative ${e} for rank ${r15} is not yet supported`); -} -function qA(r15, t8, e) { - if (r15 === 1) - return `${t8}`; - if (r15 === 2) - return `${t8}.y`; - if (r15 === 3) - return `${t8}.z`; - if (r15 === 4) - return `${t8}.w`; - throw new Error(`Cumulative ${e} for rank ${r15} is not yet supported`); -} -function qh(r15, t8, e, o, n, s) { - let a = t8.shape.length, i = w.getAxesPermutation([o], a), p = t8; - i != null && (p = bt({ inputs: { x: t8 }, backend: e, attrs: { perm: i } })); - let u = w.getInnerMostAxes(1, a)[0]; +function MF(r16, e, t10) { + if (r16 === 1) + return `${e}`; + if (r16 === 2) + return `${e}.x, ${e}.y`; + if (r16 === 3) + return `${e}.x, ${e}.y, ${e}.z`; + if (r16 === 4) + return `${e}.x, ${e}.y, ${e}.z, ${e}.w`; + throw new Error(`Cumulative ${t10} for rank ${r16} is not yet supported`); +} +function LF(r16, e, t10) { + if (r16 === 1) + return `${e}`; + if (r16 === 2) + return `${e}.y`; + if (r16 === 3) + return `${e}.z`; + if (r16 === 4) + return `${e}.w`; + throw new Error(`Cumulative ${t10} for rank ${r16} is not yet supported`); +} +function sg(r16, e, t10, o, n, s) { + let a = e.shape.length, i = C.getAxesPermutation([o], a), p = e; + i != null && (p = Ct({ inputs: { x: e }, backend: t10, attrs: { perm: i } })); + let u = C.getInnerMostAxes(1, a)[0]; if (u !== a - 1) - throw new Error(`WebGL cumprod shader expects an inner-most axis=${t8.shape.length - 1} but got axis=${o}`); - let c = p.shape[u], l = Dt({ inputs: { x: p }, backend: e }); - for (let m = 0; m <= Math.ceil(Math.log2(c)) - 1; m++) { - let d = new tm(r15, p.shape, false, s), f = [[m]], h = l; - l = e.runWebGLProgram(d, [l], l.dtype, f), e.disposeIntermediateTensorInfo(h); + throw new Error(`WebGL cumprod shader expects an inner-most axis=${e.shape.length - 1} but got axis=${o}`); + let l = p.shape[u], c = Ft({ inputs: { x: p }, backend: t10 }); + for (let m = 0; m <= Math.ceil(Math.log2(l)) - 1; m++) { + let d = new lm(r16, p.shape, false, s), f = [[m]], h = c; + c = t10.runWebGLProgram(d, [c], c.dtype, f), t10.disposeIntermediateTensorInfo(h); } if (n) { - let m = new tm(r15, p.shape, n, s), d = l; - l = e.runWebGLProgram(m, [l], l.dtype), e.disposeIntermediateTensorInfo(d); + let m = new lm(r16, p.shape, n, s), d = c; + c = t10.runWebGLProgram(m, [c], c.dtype), t10.disposeIntermediateTensorInfo(d); } if (i != null) { - let m = w.getUndoAxesPermutation(i), d = bt({ inputs: { x: l }, backend: e, attrs: { perm: m } }); - return e.disposeIntermediateTensorInfo(l), e.disposeIntermediateTensorInfo(p), d; + let m = C.getUndoAxesPermutation(i), d = Ct({ inputs: { x: c }, backend: t10, attrs: { perm: m } }); + return t10.disposeIntermediateTensorInfo(c), t10.disposeIntermediateTensorInfo(p), d; } - return l; + return c; } -function lJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o; - return qh(Sp.Prod, n, e, s, a, i); +function Lee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o; + return sg($p.Prod, n, t10, s, a, i); } -var jA = { kernelName: un, backendName: "webgl", kernelFunc: lJ }; -function mJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o; - return qh(Sp.Sum, n, e, s, a, i); +var BF = { kernelName: Pn, backendName: "webgl", kernelFunc: Lee }; +function Bee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o; + return sg($p.Sum, n, t10, s, a, i); } -var XA = { kernelName: pn, backendName: "webgl", kernelFunc: mJ }; -function dJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, weights: s } = t8, { size: a, binaryOutput: i } = o; +var zF = { kernelName: On, backendName: "webgl", kernelFunc: Bee }; +function zee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, weights: s } = e, { size: a, binaryOutput: i } = o; if (n.shape.length === 1) { - let p = e.readSync(n.dataId), u = e.readSync(s.dataId), c = uh(p, u, s.dtype, s.shape, a); - return e.makeTensorInfo([a], s.dtype, c); + let p = t10.readSync(n.dataId), u = t10.readSync(s.dataId), l = Ch(p, u, s.dtype, s.shape, a); + return t10.makeTensorInfo([a], s.dtype, l); } else if (n.shape.length === 2) { - let p = e.bufferSync(n), u = e.bufferSync(s), c = AR(p, u, a, i); - return e.makeTensorInfo(c.shape, s.dtype, c.values); + let p = t10.bufferSync(n), u = t10.bufferSync(s), l = vD(p, u, a, i); + return t10.makeTensorInfo(l.shape, s.dtype, l.values); } throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${n.shape.length}.`); } -var YA = { kernelName: ra, backendName: "webgl", kernelFunc: dJ }; -var jh = class { - constructor(t8, e, o) { - this.variableNames = ["x"], this.outputShape = [], this.outputShape = t8, this.blockSize = e, this.dataFormat = o, this.userCode = ` +var VF = { kernelName: la, backendName: "webgl", kernelFunc: zee }; +var ag = class { + constructor(e, t10, o) { + this.variableNames = ["x"], this.outputShape = [], this.outputShape = e, this.blockSize = t10, this.dataFormat = o, this.userCode = ` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -21504,11 +21600,11 @@ var jh = class { int w = ${this.getWidthCoordString()}; int d = ${this.getDepthCoordString()}; - int in_h = h / ${e}; - int offset_h = imod(h, ${e}); - int in_w = w / ${e}; - int offset_w = imod(w, ${e}); - int offset_d = (offset_h * ${e} + offset_w) * + int in_h = h / ${t10}; + int offset_h = imod(h, ${t10}); + int in_w = w / ${t10}; + int offset_w = imod(w, ${t10}); + int offset_d = (offset_h * ${t10} + offset_w) * ${this.getOutputDepthSize()}; int in_d = d + offset_d; @@ -21533,15 +21629,15 @@ var jh = class { return this.dataFormat === "NHWC" ? "getX(b, in_h, in_w, in_d)" : "getX(b, in_d, in_h, in_w)"; } }; -function fJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockSize: s, dataFormat: a } = o, i = n.shape[0], p = a === "NHWC" ? n.shape[1] : n.shape[2], u = a === "NHWC" ? n.shape[2] : n.shape[3], c = a === "NHWC" ? n.shape[3] : n.shape[1], l = p * s, m = u * s, d = c / (s * s), f = a === "NHWC" ? [i, l, m, d] : [i, d, l, m], h = new jh(f, s, a); - return e.runWebGLProgram(h, [n], n.dtype); +function Vee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockSize: s, dataFormat: a } = o, i = n.shape[0], p = a === "NHWC" ? n.shape[1] : n.shape[2], u = a === "NHWC" ? n.shape[2] : n.shape[3], l = a === "NHWC" ? n.shape[3] : n.shape[1], c = p * s, m = u * s, d = l / (s * s), f = a === "NHWC" ? [i, c, m, d] : [i, d, c, m], h = new ag(f, s, a); + return t10.runWebGLProgram(h, [n], n.dtype); } -var QA = { kernelName: ln, backendName: "webgl", kernelFunc: fJ }; -var Wc = class { - constructor(t8, e = false, o = null, n = false, s = false) { - this.variableNames = ["x", "W"], this.customUniforms = [{ name: "pads", type: "ivec2" }, { name: "strides", type: "ivec2" }, { name: "dilations", type: "ivec2" }, { name: "inDims", type: "ivec2" }], this.outputShape = t8.outShape, this.enableShapeUniforms = ut(this.outputShape.length); - let a = t8.filterHeight, i = t8.filterWidth, p = t8.outChannels / t8.inChannels, u = "", c = ""; +var WF = { kernelName: Ln, backendName: "webgl", kernelFunc: Vee }; +var Xl = class { + constructor(e, t10 = false, o = null, n = false, s = false) { + this.variableNames = ["x", "W"], this.customUniforms = [{ name: "pads", type: "ivec2" }, { name: "strides", type: "ivec2" }, { name: "dilations", type: "ivec2" }, { name: "inDims", type: "ivec2" }], this.outputShape = e.outShape, this.enableShapeUniforms = lt(this.outputShape.length); + let a = e.filterHeight, i = e.filterWidth, p = e.outChannels / e.inChannels, u = "", l = ""; o && (n ? u = `float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${o} @@ -21552,9 +21648,9 @@ var Wc = class { float activation(float x) { ${o} } - `, c = "result = activation(result);"); - let l = e ? "result += getBiasAtOutCoords();" : ""; - e && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` + `, l = "result = activation(result);"); + let c = t10 ? "result += getBiasAtOutCoords();" : ""; + t10 && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` ${u} void main() { @@ -21593,20 +21689,20 @@ var Wc = class { } float result = dotProd; - ${l} ${c} + ${l} setOutput(result); } `; } }; -var Uc = class { - constructor(t8, e = false, o = null, n = false, s = false) { - this.variableNames = ["x", "W"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "pads", type: "ivec2" }, { name: "strides", type: "ivec2" }, { name: "dilations", type: "ivec2" }, { name: "inDims", type: "ivec2" }], this.outputShape = t8.outShape, this.enableShapeUniforms = ut(this.outputShape.length); - let a = t8.outChannels / t8.inChannels, i = t8.padInfo.left, p = t8.strideWidth, u = t8.dilationWidth, c = t8.filterHeight, l = t8.filterWidth, m = l, d = ` +var Yl = class { + constructor(e, t10 = false, o = null, n = false, s = false) { + this.variableNames = ["x", "W"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "pads", type: "ivec2" }, { name: "strides", type: "ivec2" }, { name: "dilations", type: "ivec2" }, { name: "inDims", type: "ivec2" }], this.outputShape = e.outShape, this.enableShapeUniforms = lt(this.outputShape.length); + let a = e.outChannels / e.inChannels, i = e.padInfo.left, p = e.strideWidth, u = e.dilationWidth, l = e.filterHeight, c = e.filterWidth, m = c, d = ` int xR; int xC; int xCOffset; vec4 wTexel; vec4 previous; vec4 final;`; - for (let x = 0; x < l; x++) + for (let x = 0; x < c; x++) d += ` vec4 xTexelC${x * 2}; int xTexelC${x * 2}Ready; @@ -21614,9 +21710,9 @@ var Uc = class { int xTexelC${x * 2 + 1}Ready; vec4 xC${x};`; d += ` - for (int r = 0; r < ${c}; r++) { + for (int r = 0; r < ${l}; r++) { `; - for (let x = 0; x < l; x++) + for (let x = 0; x < c; x++) d += ` xTexelC${x * 2} = vec4(0.0); xTexelC${x * 2}Ready = 0; @@ -21632,7 +21728,7 @@ var Uc = class { if (d += ` xC = xCCorner + ${b * u}; `, p === 1) { - if (b < l && (i % 2 === 1 ? (d += ` + if (b < c && (i % 2 === 1 ? (d += ` xCOffset = xC + 1; if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) { xTexelC${b} = getX(batch, xR, xCOffset, d1); @@ -21672,10 +21768,10 @@ var Uc = class { } xC${b} = xTexelC${b}; - `, b + 1 < l)) { - let C = i % 2 === 0 ? y.nearestLargerEven(u) : u; + `, b + 1 < c)) { + let w = i % 2 === 0 ? y.nearestLargerEven(u) : u; u % 2 === 0 && i % 2 === 1 || u % 2 !== 0 && i % 2 !== 1 ? (d += ` - xCOffset = xC + imod(pads[1], 2) + ${C}; + xCOffset = xC + imod(pads[1], 2) + ${w}; if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b + 1}Ready == 0) { xTexelC${b + 1} = getX(batch, xR, xCOffset, d1); @@ -21697,10 +21793,10 @@ var Uc = class { } ` : d += ` xC${b + 1} = vec4(xTexelC${b}.zw, xTexelC${b + 1}.xy); - `) : C === 1 ? d += ` + `) : w === 1 ? d += ` xC${b + 1} = xTexelC${b}; ` : d += ` - xCOffset = xC + ${C}; + xCOffset = xC + ${w}; if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b + 1}Ready == 0) { xTexelC${b + 1} = getX(batch, xR, xCOffset, d1); @@ -21714,7 +21810,7 @@ var Uc = class { `; } } else - b < l && (i % 2 === 1 ? (d += ` + b < c && (i % 2 === 1 ? (d += ` xCOffset = xC + 1 - strides[1]; if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) { xTexelC${b} = getX(batch, xR, xCOffset, d1); @@ -21737,7 +21833,7 @@ var Uc = class { } xC${b} = vec4(xTexelC${b}.zw, xTexelC${b + 1}.zw); - `, b + 1 < l && (d += ` + `, b + 1 < c && (d += ` final = vec4(0.0); xCOffset = xC + 1 + strides[1]; if(xCOffset >= 0 && xCOffset < inDims[1]) { @@ -21764,13 +21860,13 @@ var Uc = class { xC${b} = vec4( xTexelC${b}.xy, xTexelC${b + 1}.xy); - `, b + 1 < l && (d += ` + `, b + 1 < c && (d += ` xC${b + 1} = vec4(xTexelC${b}.zw, xTexelC${b + 1}.zw); `))); - b < l && (d += ` + b < c && (d += ` wTexel = getW(r, ${b}, d1, q); dotProd += xC${b} * vec4(wTexel.xz, wTexel.xz); - `, b + 1 < l && (d += ` + `, b + 1 < c && (d += ` wTexel = getW(r, ${b + 1}, d1, q); dotProd += xC${b + 1} * vec4(wTexel.xz, wTexel.xz); `)); @@ -21790,8 +21886,8 @@ var Uc = class { }` : f = `vec4 activation(vec4 x) { ${o} }`, h = "result = activation(result);"); - let g = e ? "result += getBiasAtOutCoords();" : ""; - e && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` + let g = t10 ? "result += getBiasAtOutCoords();" : ""; + t10 && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), s && this.variableNames.push("leakyreluAlpha"), this.userCode = ` ${f} void main() { @@ -21817,19 +21913,19 @@ var Uc = class { `; } }; -function hJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p, dimRoundingMode: u } = o, c = p; - c == null && (c = [1, 1]), y.assert(w.eitherStridesOrDilationsAreOne(a, c), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${c}'`); - let l = w.computeConv2DInfo(n.shape, s.shape, a, c, i, u, true), m; - A().getBool("WEBGL_PACK_DEPTHWISECONV") && l.strideWidth <= 2 && l.outChannels / l.inChannels === 1 ? m = new Uc(l) : m = new Wc(l); - let d = [[l.padInfo.top, l.padInfo.left], [l.strideHeight, l.strideWidth], [l.dilationHeight, l.dilationWidth], [l.inHeight, l.inWidth]]; - return e.runWebGLProgram(m, [n, s], "float32", d); +function Wee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p, dimRoundingMode: u } = o, l = p; + l == null && (l = [1, 1]), y.assert(C.eitherStridesOrDilationsAreOne(a, l), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${l}'`); + let c = C.computeConv2DInfo(n.shape, s.shape, a, l, i, u, true), m; + A().getBool("WEBGL_PACK_DEPTHWISECONV") && c.strideWidth <= 2 && c.outChannels / c.inChannels === 1 ? m = new Yl(c) : m = new Xl(c); + let d = [[c.padInfo.top, c.padInfo.left], [c.strideHeight, c.strideWidth], [c.dilationHeight, c.dilationWidth], [c.inHeight, c.inWidth]]; + return t10.runWebGLProgram(m, [n, s], "float32", d); } -var ZA = { kernelName: mn, backendName: "webgl", kernelFunc: hJ }; -var Xh = class { - constructor(t8) { - this.variableNames = ["x", "dy"], this.outputShape = t8.filterShape; - let e = t8.strideHeight, o = t8.strideWidth, n = t8.padInfo.top, s = t8.padInfo.left, a = t8.outChannels / t8.inChannels; +var UF = { kernelName: Bn, backendName: "webgl", kernelFunc: Wee }; +var ig = class { + constructor(e) { + this.variableNames = ["x", "dy"], this.outputShape = e.filterShape; + let t10 = e.strideHeight, o = e.strideWidth, n = e.padInfo.top, s = e.padInfo.left, a = e.outChannels / e.inChannels; this.userCode = ` void main() { ivec4 coords = getOutputCoords(); @@ -21842,18 +21938,18 @@ var Xh = class { float dotProd = 0.0; // TO DO: Vec4 over the batch size - for (int b = 0; b < ${t8.batchSize}; b++) { - for (int yR = 0; yR < ${t8.outHeight}; yR++) { - int xR = wR + yR * ${e} - ${n}; + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { + int xR = wR + yR * ${t10} - ${n}; - if (xR < 0 || xR >= ${t8.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int yC = 0; yC < ${t8.outWidth}; yC++) { + for (int yC = 0; yC < ${e.outWidth}; yC++) { int xC = wC + yC * ${o} - ${s}; - if (xC < 0 || xC >= ${t8.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -21868,10 +21964,10 @@ var Xh = class { `; } }; -var Yh = class { - constructor(t8) { - this.variableNames = ["dy", "W"], this.outputShape = t8.inShape; - let e = t8.filterHeight, o = t8.filterWidth, n = t8.strideHeight, s = t8.strideWidth, a = e - 1 - t8.padInfo.top, i = o - 1 - t8.padInfo.left, p = t8.outChannels / t8.inChannels; +var ug = class { + constructor(e) { + this.variableNames = ["dy", "W"], this.outputShape = e.inShape; + let t10 = e.filterHeight, o = e.filterWidth, n = e.strideHeight, s = e.strideWidth, a = t10 - 1 - e.padInfo.top, i = o - 1 - e.padInfo.left, p = e.outChannels / e.inChannels; this.userCode = ` const ivec2 pads = ivec2(${a}, ${i}); @@ -21885,20 +21981,20 @@ var Yh = class { float dotProd = 0.0; - for (int wR = 0; wR < ${e}; wR++) { + for (int wR = 0; wR < ${t10}; wR++) { float dyR = float(dyRCorner + wR) / ${n}.0; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - int wRPerm = ${e} - 1 - wR; + int wRPerm = ${t10} - 1 - wR; for (int wC = 0; wC < ${o}; wC++) { float dyC = float(dyCCorner + wC) / ${s}.0; - if (dyC < 0.0 || dyC >= ${t8.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -21920,19 +22016,19 @@ var Yh = class { `; } }; -function gJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, dilations: i, pad: p, dimRoundingMode: u, filterShape: c } = o, l = w.computeConv2DInfo(n.shape, c, a, i, p, u, true), m = new Xh(l); - return e.runWebGLProgram(m, [n, s], "float32"); +function Uee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, dilations: i, pad: p, dimRoundingMode: u, filterShape: l } = o, c = C.computeConv2DInfo(n.shape, l, a, i, p, u, true), m = new ig(c); + return t10.runWebGLProgram(m, [n, s], "float32"); } -var JA = { kernelName: Fi, backendName: "webgl", kernelFunc: gJ }; -function xJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { strides: a, dilations: i, pad: p, dimRoundingMode: u, inputShape: c } = o, l = w.computeConv2DInfo(c, s.shape, a, i, p, u, true), m = new Yh(l); - return e.runWebGLProgram(m, [n, s], "float32"); +var GF = { kernelName: Gi, backendName: "webgl", kernelFunc: Uee }; +function Gee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { strides: a, dilations: i, pad: p, dimRoundingMode: u, inputShape: l } = o, c = C.computeConv2DInfo(l, s.shape, a, i, p, u, true), m = new ug(c); + return t10.runWebGLProgram(m, [n, s], "float32"); } -var eF = { kernelName: Pi, backendName: "webgl", kernelFunc: xJ }; -var Qh = class { - constructor(t8) { - this.variableNames = ["X"], this.outputShape = [t8, t8], this.userCode = ` +var HF = { kernelName: Hi, backendName: "webgl", kernelFunc: Gee }; +var pg = 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; @@ -21941,18 +22037,18 @@ var Qh = class { `; } }; -function yJ(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8, n = [...o.shape, ...o.shape], s = y.sizeFromShape(o.shape), a = te({ inputs: { x: o }, backend: e, attrs: { shape: [s] } }), i = new Qh(s), p = e.runWebGLProgram(i, [a], a.dtype), u = te({ inputs: { x: p }, backend: e, attrs: { shape: n } }); - return e.disposeIntermediateTensorInfo(a), e.disposeIntermediateTensorInfo(p), u; +function Hee(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e, n = [...o.shape, ...o.shape], s = y.sizeFromShape(o.shape), a = te({ inputs: { x: o }, backend: t10, attrs: { shape: [s] } }), i = new pg(s), p = t10.runWebGLProgram(i, [a], a.dtype), u = te({ inputs: { x: p }, backend: t10, attrs: { shape: n } }); + return t10.disposeIntermediateTensorInfo(a), t10.disposeIntermediateTensorInfo(p), u; } -var tF = { kernelName: oa, backendName: "webgl", kernelFunc: yJ }; -var Zh = class { - constructor(t8) { - this.variableNames = ["x", "W"], this.outputShape = t8.outShape; - let { inHeight: e, inWidth: o, padInfo: n, strideHeight: s, strideWidth: a, filterHeight: i, filterWidth: p, dilationHeight: u, dilationWidth: c } = t8, { top: l, left: m } = n; +var KF = { kernelName: ca, backendName: "webgl", kernelFunc: Hee }; +var lg = class { + constructor(e) { + this.variableNames = ["x", "W"], this.outputShape = e.outShape; + let { inHeight: t10, inWidth: o, padInfo: n, strideHeight: s, strideWidth: a, filterHeight: i, filterWidth: p, dilationHeight: u, dilationWidth: l } = e, { top: c, left: m } = n; this.userCode = ` const ivec2 strides = ivec2(${s}, ${a}); - const ivec2 pads = ivec2(${l}, ${m}); + const ivec2 pads = ivec2(${c}, ${m}); const float neg_infinity = -3.4e38; void main() { @@ -21968,9 +22064,9 @@ var Zh = class { for (int h = 0; h < ${i}; h++) { int hIn = hBeg + h * ${u}; - if (hIn >= 0 && hIn < ${e}) { + if (hIn >= 0 && hIn < ${t10}) { for (int w = 0; w < ${p}; w++) { - int wIn = wBeg + w * ${c}; + int wIn = wBeg + w * ${l}; if (wIn >= 0 && wIn < ${o}) { float xVal = getX(batch, hIn, wIn, d1); @@ -21991,35 +22087,35 @@ var Zh = class { `; } }; -function bJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p } = o, u = w.computeDilation2DInfo(n.shape, s.shape, a, i, "NHWC", p), c, l = new Zh(u); - c = e.runWebGLProgram(l, [n, s], "float32"); - let m = te({ inputs: { x: c }, backend: e, attrs: { shape: u.outShape } }); - return e.disposeIntermediateTensorInfo(c), m; -} -var rF = { kernelName: dn, backendName: "webgl", kernelFunc: bJ }; -function CJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { equation: n } = o, s = t8, { allDims: a, summedDims: i, idDims: p } = w.decodeEinsumEquation(n, s.length); - w.checkEinsumDimSizes(a.length, p, s); - let { path: u, steps: c } = w.getEinsumComputePath(i, p), l = c.length, m = null, d = a.length, f = []; - for (let h = 0; h < l; ++h) { - for (let g of c[h]) { - let { permutationIndices: x, expandDims: b } = w.getEinsumPermutation(d, p[g]), C; - w.isIdentityPermutation(x) ? C = s[g] : (C = bt({ inputs: { x: s[g] }, backend: e, attrs: { perm: x } }), f.push(C)); - let S = C.shape.slice(); +function Kee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p } = o, u = C.computeDilation2DInfo(n.shape, s.shape, a, i, "NHWC", p), l, c = new lg(u); + l = t10.runWebGLProgram(c, [n, s], "float32"); + let m = te({ inputs: { x: l }, backend: t10, attrs: { shape: u.outShape } }); + return t10.disposeIntermediateTensorInfo(l), m; +} +var qF = { kernelName: zn, backendName: "webgl", kernelFunc: Kee }; +function qee(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { equation: n } = o, s = e, { allDims: a, summedDims: i, idDims: p } = C.decodeEinsumEquation(n, s.length); + C.checkEinsumDimSizes(a.length, p, s); + let { path: u, steps: l } = C.getEinsumComputePath(i, p), c = l.length, m = null, d = a.length, f = []; + for (let h = 0; h < c; ++h) { + for (let g of l[h]) { + let { permutationIndices: x, expandDims: b } = C.getEinsumPermutation(d, p[g]), w; + C.isIdentityPermutation(x) ? w = s[g] : (w = Ct({ inputs: { x: s[g] }, backend: t10, attrs: { perm: x } }), f.push(w)); + let S = w.shape.slice(); for (let k = 0; k < b.length; ++k) S.splice(b[k], 0, 1); - y.arraysEqual(C.shape, S) || (C = te({ inputs: { x: C }, backend: e, attrs: { shape: S } }), f.push(C)), m === null ? m = C : (m = Jl({ inputs: { a: C, b: m }, backend: e }), f.push(m)); + y.arraysEqual(w.shape, S) || (w = te({ inputs: { x: w }, backend: t10, attrs: { shape: S } }), f.push(w)), m === null ? m = w : (m = um({ inputs: { a: w, b: m }, backend: t10 }), f.push(m)); } - h < l - 1 && (u[h] >= 0 && (m = bp({ inputs: { x: m }, backend: e, attrs: { axis: u[h] - (a.length - d), keepDims: false } }), f.push(m)), d--); + h < c - 1 && (u[h] >= 0 && (m = Tp({ inputs: { x: m }, backend: t10, attrs: { axis: u[h] - (a.length - d), keepDims: false } }), f.push(m)), d--); } for (let h of f) - h !== m && e.disposeIntermediateTensorInfo(h); + h !== m && t10.disposeIntermediateTensorInfo(h); return m; } -var oF = { kernelName: Li, backendName: "webgl", kernelFunc: CJ }; -var wJ = "return (x >= 0.0) ? x : (exp(x) - 1.0);"; -var SJ = ` +var jF = { kernelName: ji, backendName: "webgl", kernelFunc: qee }; +var jee = "return (x >= 0.0) ? x : (exp(x) - 1.0);"; +var Xee = ` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -22029,46 +22125,46 @@ var SJ = ` return result; `; -var IJ = xe({ opSnippet: wJ, packedOpSnippet: SJ }); -var nF = { kernelName: hn, backendName: "webgl", kernelFunc: IJ }; -var vJ = "return (b >= 0.0) ? a : a * (b + 1.0);"; -var kJ = ` +var Yee = xe({ opSnippet: jee, packedOpSnippet: Xee }); +var XF = { kernelName: Wn, backendName: "webgl", kernelFunc: Yee }; +var Qee = "return (b >= 0.0) ? a : a * (b + 1.0);"; +var Zee = ` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); `; -var NJ = (r15) => { - let { inputs: t8, backend: e } = r15, { dy: o, y: n } = t8, s = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new qr(kJ, o.shape, n.shape) : new Fr(vJ, o.shape, n.shape); - return e.runWebGLProgram(s, [o, n], o.dtype); +var Jee = (r16) => { + let { inputs: e, backend: t10 } = r16, { dy: o, y: n } = e, s = A().getBool("WEBGL_PACK_BINARY_OPERATIONS") ? new eo(Zee, o.shape, n.shape) : new Br(Qee, o.shape, n.shape); + return t10.runWebGLProgram(s, [o, n], o.dtype); }; -var sF = { kernelName: Xa, backendName: "webgl", kernelFunc: NJ }; -var TJ = ` +var YF = { kernelName: ri, backendName: "webgl", kernelFunc: Jee }; +var ete = ` return vec4(equal(a, b)); `; -var _J = "return float(a == b);"; -var $J = nt({ opSnippet: _J, packedOpSnippet: TJ, dtype: "bool", cpuKernelImpl: LR }); -var aF = { kernelName: xn, backendName: "webgl", kernelFunc: $J }; -var EJ = ` +var tte = "return float(a == b);"; +var rte = st({ opSnippet: tte, packedOpSnippet: ete, dtype: "bool", cpuKernelImpl: ED }); +var QF = { kernelName: xo, backendName: "webgl", kernelFunc: rte }; +var ote = ` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - float p = ${w.ERF_P}; - float a1 = ${w.ERF_A1}; - float a2 = ${w.ERF_A2}; - float a3 = ${w.ERF_A3}; - float a4 = ${w.ERF_A4}; - float a5 = ${w.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)); `; -var RJ = xe({ opSnippet: EJ }); -var iF = { kernelName: gn, backendName: "webgl", kernelFunc: RJ }; -var DJ = Fo + ` +var nte = xe({ opSnippet: ote }); +var ZF = { kernelName: Un, backendName: "webgl", kernelFunc: nte }; +var ste = sn + ` return exp(x); `; -var AJ = ` +var ate = ` vec4 result = exp(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; @@ -22078,28 +22174,28 @@ var AJ = ` return result; `; -var vv = xe({ opSnippet: DJ, packedOpSnippet: AJ, cpuKernelImpl: BR, dtype: "float32" }); -var uF = { kernelName: yn, backendName: "webgl", kernelFunc: vv }; -function Jh(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { dim: n } = e, { input: s } = t8, a = s.shape.length, i = s.shape.slice(), p = n; +var L0 = xe({ opSnippet: ste, packedOpSnippet: ate, cpuKernelImpl: $D, dtype: "float32" }); +var JF = { kernelName: yo, backendName: "webgl", kernelFunc: L0 }; +function cg(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { dim: n } = t10, { input: s } = e, a = s.shape.length, i = s.shape.slice(), p = n; return n < 0 && (y.assert(-(a + 1) <= n, () => `Axis must be in the interval [${-(a + 1)}, ${a}]`), p = a + n + 1), i.splice(p, 0, 1), te({ inputs: { x: s }, backend: o, attrs: { shape: i } }); } -var pF = { kernelName: na, backendName: "webgl", kernelFunc: Jh }; -var cF = "return exp(x) - 1.0;"; -var FJ = xe({ opSnippet: cF, packedOpSnippet: cF, cpuKernelImpl: zR }); -var lF = { kernelName: bn, backendName: "webgl", kernelFunc: FJ }; -var rm = class { - constructor(t8, e, o) { +var e3 = { kernelName: ma, backendName: "webgl", kernelFunc: cg }; +var t3 = "return exp(x) - 1.0;"; +var ite = xe({ opSnippet: t3, packedOpSnippet: t3, cpuKernelImpl: RD }); +var r32 = { kernelName: bo, backendName: "webgl", kernelFunc: ite }; +var cm = class { + constructor(e, t10, o) { this.variableNames = ["real", "imag"]; - let n = e[1]; - this.outputShape = e; + let n = t10[1]; + this.outputShape = t10; let s = o ? `2.0 * ${Math.PI}` : `-2.0 * ${Math.PI}`, a = o ? `${n}.0` : "1.0", i; - if (t8 === "real") + if (e === "real") i = "return real * expR - imag * expI;"; - else if (t8 === "imag") + else if (e === "imag") i = "return real * expI + imag * expR;"; else - throw new Error(`FFT component must be either "real" or "imag", got ${t8}.`); + throw new Error(`FFT component must be either "real" or "imag", got ${e}.`); this.userCode = ` const float exponentMultiplier = ${s}; @@ -22136,20 +22232,20 @@ var rm = class { `; } }; -function eg(r15, t8, e) { - let o = e.texData.get(r15.dataId), n = y.sizeFromShape(r15.shape), s = r15.shape[r15.shape.length - 1], a = n / s, i = te({ inputs: { x: r15 }, backend: e, attrs: { shape: [a, s] } }), p = i.shape, u = new rm("real", p, t8), c = new rm("imag", p, t8), l = [{ dataId: o.complexTensorInfos.real.dataId, dtype: o.complexTensorInfos.real.dtype, shape: p }, { dataId: o.complexTensorInfos.imag.dataId, dtype: o.complexTensorInfos.imag.dtype, shape: p }], m = e.runWebGLProgram(u, l, "float32"), d = e.runWebGLProgram(c, l, "float32"), f = Pr({ inputs: { real: m, imag: d }, backend: e }); - e.disposeIntermediateTensorInfo(m), e.disposeIntermediateTensorInfo(d); - let h = te({ inputs: { x: f }, backend: e, attrs: { shape: r15.shape } }); - return e.disposeIntermediateTensorInfo(i), e.disposeIntermediateTensorInfo(f), h; +function mg(r16, e, t10) { + let o = t10.texData.get(r16.dataId), n = y.sizeFromShape(r16.shape), s = r16.shape[r16.shape.length - 1], a = n / s, i = te({ inputs: { x: r16 }, backend: t10, attrs: { shape: [a, s] } }), p = i.shape, u = new cm("real", p, e), l = new cm("imag", p, e), c = [{ dataId: o.complexTensorInfos.real.dataId, dtype: o.complexTensorInfos.real.dtype, shape: p }, { dataId: o.complexTensorInfos.imag.dataId, dtype: o.complexTensorInfos.imag.dtype, shape: p }], m = t10.runWebGLProgram(u, c, "float32"), d = t10.runWebGLProgram(l, c, "float32"), f = zr({ inputs: { real: m, imag: d }, backend: t10 }); + t10.disposeIntermediateTensorInfo(m), t10.disposeIntermediateTensorInfo(d); + let h = te({ inputs: { x: f }, backend: t10, attrs: { shape: r16.shape } }); + return t10.disposeIntermediateTensorInfo(i), t10.disposeIntermediateTensorInfo(f), h; } -function PJ(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8; - return eg(o, false, e); +function ute(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e; + return mg(o, false, t10); } -var mF = { kernelName: Bi, backendName: "webgl", kernelFunc: PJ }; -var tg = class { - constructor(t8, e) { - this.outputShape = [], this.customUniforms = [{ name: "value", type: "float" }], this.variableNames = ["x"], this.outputShape = t8, this.userCode = ` +var o3 = { kernelName: Xi, backendName: "webgl", kernelFunc: ute }; +var dg = class { + constructor(e, t10) { + this.outputShape = [], this.customUniforms = [{ name: "value", type: "float" }], this.variableNames = ["x"], this.outputShape = e, this.userCode = ` void main() { // Input can be obtained from uniform value. setOutput(value); @@ -22157,29 +22253,29 @@ var tg = class { `; } }; -function bi(r15) { - let { backend: t8, attrs: e } = r15, { shape: o, value: n } = e, { dtype: s } = e; +function Ei(r16) { + let { backend: e, attrs: t10 } = r16, { shape: o, value: n } = t10, { dtype: s } = t10; if (s = s || y.inferDtype(n), s === "string") { let a = y.getArrayFromDType(s, y.sizeFromShape(o)); - return a.fill(n), t8.makeTensorInfo(o, s, a); + return a.fill(n), e.makeTensorInfo(o, s, a); } else { - let a = new tg(o, n), i = [[n]]; - return t8.runWebGLProgram(a, [], s, i); + let a = new dg(o, n), i = [[n]]; + return e.runWebGLProgram(a, [], s, i); } } -var dF = { kernelName: sa, backendName: "webgl", kernelFunc: bi }; -var rg = class { - constructor(t8) { +var n3 = { kernelName: da, backendName: "webgl", kernelFunc: Ei }; +var fg = class { + constructor(e) { this.variableNames = ["Image"], this.outputShape = []; - let e = t8[2]; - this.outputShape = t8, this.userCode = ` + let t10 = e[2]; + this.outputShape = e, this.userCode = ` void main() { ivec4 coords = getOutputCoords(); int x = coords[2]; - int coordX = ${e} - x - 1; + int coordX = ${t10} - x - 1; float outputValue; - if(coordX >= 0 && coordX < ${e}) { + if(coordX >= 0 && coordX < ${t10}) { outputValue = getImage(coords[0], coords[1], coordX, coords[3]); } else { outputValue = getImage(coords[0], coords[1], coords[2], coords[3]); @@ -22189,14 +22285,14 @@ var rg = class { `; } }; -var fF = { kernelName: Cn, backendName: "webgl", kernelFunc: ({ inputs: r15, backend: t8 }) => { - let { image: e } = r15, o = t8, n = new rg(e.shape); - return o.runWebGLProgram(n, [e], e.dtype); +var s3 = { kernelName: Gn, backendName: "webgl", kernelFunc: ({ inputs: r16, backend: e }) => { + let { image: t10 } = r16, o = e, n = new fg(t10.shape); + return o.runWebGLProgram(n, [t10], t10.dtype); } }; -var hF = "return floor(x);"; -var OJ = xe({ opSnippet: hF, packedOpSnippet: hF, cpuKernelImpl: VR }); -var gF = { kernelName: wn, backendName: "webgl", kernelFunc: OJ }; -var MJ = ` +var a3 = "return floor(x);"; +var pte = xe({ opSnippet: a3, packedOpSnippet: a3, cpuKernelImpl: DD }); +var i3 = { kernelName: Co, backendName: "webgl", kernelFunc: pte }; +var lte = ` float s = sign(a) * sign(b); int ia = round(a); int ib = round(b); @@ -22207,7 +22303,7 @@ var MJ = ` return NAN; } `; -var LJ = ` +var cte = ` ivec4 ia = round(a); ivec4 ib = round(b); bvec4 cond = notEqual(ib, ivec4(0)); @@ -22229,13 +22325,13 @@ var LJ = ` } return vec4(result); `; -var BJ = nt({ opSnippet: MJ, packedOpSnippet: LJ, dtype: "int32" }); -var xF = { kernelName: Sn, backendName: "webgl", kernelFunc: BJ }; -var og = class { - constructor(t8) { +var mte = st({ opSnippet: lte, packedOpSnippet: cte, dtype: "int32" }); +var u3 = { kernelName: wo, backendName: "webgl", kernelFunc: mte }; +var hg = class { + constructor(e) { this.variableNames = ["A"]; - let e = It(), [o, n] = t8; - this.outputShape = t8, this.userCode = ` + let t10 = kt(), [o, n] = e; + this.outputShape = e, this.userCode = ` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -22243,7 +22339,7 @@ var og = class { int depth = coords[2]; vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${o}.0); - vec4 values = ${e.texture2D}(A, uv); + vec4 values = ${t10.texture2D}(A, uv); float value; if (depth == 0) { value = values.r; @@ -22260,11 +22356,11 @@ var og = class { `; } }; -var ng = class { - constructor(t8) { +var gg = class { + constructor(e) { this.variableNames = ["A"], this.packedInputs = false, this.packedOutput = true; - let e = It(), [o, n] = t8; - this.outputShape = t8, this.userCode = ` + let t10 = kt(), [o, n] = e; + this.outputShape = e, this.userCode = ` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -22280,7 +22376,7 @@ var ng = class { vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${o}.0); - vec4 values = ${e.texture2D}(A, uv); + vec4 values = ${t10.texture2D}(A, uv); float value; if (depth == 0) { value = values.r; @@ -22296,72 +22392,72 @@ var ng = class { } } - ${e.output} = result; + ${t10.output} = result; } `; } }; -var yF = { kernelName: Eu, backendName: "webgl", kernelFunc: zJ }; -var Gc; -var kv = A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU"); -function zJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { pixels: n } = t8, { numChannels: s } = o, a = typeof HTMLVideoElement != "undefined" && n instanceof HTMLVideoElement, i = typeof HTMLImageElement != "undefined" && n instanceof HTMLImageElement, [p, u] = a ? [n.videoWidth, n.videoHeight] : [n.width, n.height], c = [u, p], l = [u, p, s]; +var p3 = { kernelName: Lu, backendName: "webgl", kernelFunc: dte }; +var Ql; +var B0 = A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU"); +function dte(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { pixels: n } = e, { numChannels: s } = o, a = typeof HTMLVideoElement != "undefined" && n instanceof HTMLVideoElement, i = typeof HTMLImageElement != "undefined" && n instanceof HTMLImageElement, [p, u] = a ? [n.videoWidth, n.videoHeight] : [n.width, n.height], l = [u, p], c = [u, p, s]; if (i || a) { let h = A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU"); - (Gc == null || h !== kv) && (kv = h, Gc = document.createElement("canvas").getContext("2d", { willReadFrequently: kv })), Gc.canvas.width = p, Gc.canvas.height = u, Gc.drawImage(n, 0, 0, p, u), n = Gc.canvas; - } - let m = e.makeTensorInfo(c, "int32"); - e.texData.get(m.dataId).usage = mr.PIXELS, e.gpgpu.uploadPixelDataToTexture(e.getTexture(m.dataId), n); - let d = A().getBool("WEBGL_PACK") ? new ng(l) : new og(l), f = e.runWebGLProgram(d, [m], "int32"); - return e.disposeData(m.dataId), f; -} -function VJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dataFormat: c, dilations: l, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = w.convertConv2DDataFormat(c), g = w.computeConv2DInfo(n.shape, s.shape, p, l, u, m, false, h), x, b = [], C = a != null, S = i != null, k = d === "leakyrelu", _ = () => { - let R = [n, s], D = (P, O) => { - if (O === "NCHW" && P.shape.length === 1 && P.shape[0] !== 1) { - let M = te({ inputs: { x: P }, backend: e, attrs: { shape: [P.shape[0], 1, 1] } }); + (Ql == null || h !== B0) && (B0 = h, Ql = document.createElement("canvas").getContext("2d", { willReadFrequently: B0 })), Ql.canvas.width = p, Ql.canvas.height = u, Ql.drawImage(n, 0, 0, p, u), n = Ql.canvas; + } + let m = t10.makeTensorInfo(l, "int32"); + t10.texData.get(m.dataId).usage = hr.PIXELS, t10.gpgpu.uploadPixelDataToTexture(t10.getTexture(m.dataId), n); + let d = A().getBool("WEBGL_PACK") ? new gg(c) : new hg(c), f = t10.runWebGLProgram(d, [m], "int32"); + return t10.disposeData(m.dataId), f; +} +function fte(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dataFormat: l, dilations: c, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = C.convertConv2DDataFormat(l), g = C.computeConv2DInfo(n.shape, s.shape, p, c, u, m, false, h), x, b = [], w = a != null, S = i != null, k = d === "leakyrelu", T = () => { + let R = [n, s], D = (F, O) => { + if (O === "NCHW" && F.shape.length === 1 && F.shape[0] !== 1) { + let M = te({ inputs: { x: F }, backend: t10, attrs: { shape: [F.shape[0], 1, 1] } }); return b.push(M), M; } - return P; + return F; }; - if (C && R.push(D(a, c)), S && R.push(D(i, c)), k) { - let P = e.makeTensorInfo([], "float32", y.createScalarValue(f, "float32")); - R.push(P), b.push(P); + if (w && R.push(D(a, l)), S && R.push(D(i, l)), k) { + let F = t10.makeTensorInfo([], "float32", y.createScalarValue(f, "float32")); + R.push(F), b.push(F); } return R; }; if (g.filterHeight === 1 && g.filterWidth === 1 && g.dilationHeight === 1 && g.dilationWidth === 1 && g.strideHeight === 1 && g.strideWidth === 1 && (g.padInfo.type === "SAME" || g.padInfo.type === "VALID")) - x = Bh({ x: n, filter: s, convInfo: g, backend: e, bias: a, activation: d, preluActivationWeights: i, leakyreluAlpha: f }); + x = Qh({ x: n, filter: s, convInfo: g, backend: t10, bias: a, activation: d, preluActivationWeights: i, leakyreluAlpha: f }); else if (g.strideWidth <= 2 && h === "channelsLast" && A().getBool("WEBGL_EXP_CONV")) { - let R = d ? xi(d, true) : null, D = new Vc(g, C, R, S, k), P = [[g.padInfo.top, g.padInfo.left], [g.strideHeight, g.strideWidth], [g.dilationHeight, g.dilationWidth], [g.inHeight, g.inWidth]], O = _(); - x = e.runWebGLProgram(D, O, "float32", P); + let R = d ? Ti(d, true) : null, D = new jl(g, w, R, S, k), F = [[g.padInfo.top, g.padInfo.left], [g.strideHeight, g.strideWidth], [g.dilationHeight, g.dilationWidth], [g.inHeight, g.inWidth]], O = T(); + x = t10.runWebGLProgram(D, O, "float32", F); } else if (A().getBool("WEBGL_CONV_IM2COL")) - x = zh({ x: n, filter: s, convInfo: g, backend: e, bias: a, activation: d, preluActivationWeights: i, leakyreluAlpha: f }); + x = Zh({ x: n, filter: s, convInfo: g, backend: t10, bias: a, activation: d, preluActivationWeights: i, leakyreluAlpha: f }); else { - let R = d ? xi(d, false) : null, D = new zc(g, C, R, S, k), P = _(); - x = e.runWebGLProgram(D, P, "float32"); + let R = d ? Ti(d, false) : null, D = new ql(g, w, R, S, k), F = T(); + x = t10.runWebGLProgram(D, F, "float32"); } - let E = te({ inputs: { x }, backend: e, attrs: { shape: g.outShape } }); - return b.push(x), b.forEach((R) => e.disposeIntermediateTensorInfo(R)), E; + let E = te({ inputs: { x }, backend: t10, attrs: { shape: g.outShape } }); + return b.push(x), b.forEach((R) => t10.disposeIntermediateTensorInfo(R)), E; } -var bF = { kernelName: Io, backendName: "webgl", kernelFunc: VJ }; -function WJ(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dilations: c, dimRoundingMode: l, activation: m, leakyreluAlpha: d } = o, f = [], h = c; - h == null && (h = [1, 1]), y.assert(w.eitherStridesOrDilationsAreOne(p, h), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`); - let g = w.computeConv2DInfo(n.shape, s.shape, p, h, u, l, true), x = A().getBool("WEBGL_PACK_DEPTHWISECONV") && g.strideWidth <= 2 && g.outChannels / g.inChannels === 1, b = m ? xi(m, x) : null, C = [n, s], S = a != null, k = i != null, _ = m === "leakyrelu"; - if (S && C.push(a), k && C.push(i), _) { - let P = e.makeTensorInfo([], "float32", y.createScalarValue(d, "float32")); - C.push(P), f.push(P); +var l3 = { kernelName: jo, backendName: "webgl", kernelFunc: fte }; +function hte(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dilations: l, dimRoundingMode: c, activation: m, leakyreluAlpha: d } = o, f = [], h = l; + h == null && (h = [1, 1]), y.assert(C.eitherStridesOrDilationsAreOne(p, h), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`); + let g = C.computeConv2DInfo(n.shape, s.shape, p, h, u, c, true), x = A().getBool("WEBGL_PACK_DEPTHWISECONV") && g.strideWidth <= 2 && g.outChannels / g.inChannels === 1, b = m ? Ti(m, x) : null, w = [n, s], S = a != null, k = i != null, T = m === "leakyrelu"; + if (S && w.push(a), k && w.push(i), T) { + let F = t10.makeTensorInfo([], "float32", y.createScalarValue(d, "float32")); + w.push(F), f.push(F); } let E; - x ? E = new Uc(g, S, b, k, _) : E = new Wc(g, S, b, k, _); - let R = [[g.padInfo.top, g.padInfo.left], [g.strideHeight, g.strideWidth], [g.dilationHeight, g.dilationWidth], [g.inHeight, g.inWidth]], D = e.runWebGLProgram(E, C, "float32", R); - return f.forEach((P) => e.disposeIntermediateTensorInfo(P)), D; -} -var CF = { kernelName: vo, backendName: "webgl", kernelFunc: WJ }; -var sg = class { - constructor(t8, e, o, n) { - this.sliceDim = t8, this.strides = e, this.paramsShape = n, this.variableNames = ["x", "indices"], this.outputShape = o; + x ? E = new Yl(g, S, b, k, T) : E = new Xl(g, S, b, k, T); + let R = [[g.padInfo.top, g.padInfo.left], [g.strideHeight, g.strideWidth], [g.dilationHeight, g.dilationWidth], [g.inHeight, g.inWidth]], D = t10.runWebGLProgram(E, w, "float32", R); + return f.forEach((F) => t10.disposeIntermediateTensorInfo(F)), D; +} +var c3 = { kernelName: Xo, backendName: "webgl", kernelFunc: hte }; +var xg = class { + constructor(e, t10, o, n) { + this.sliceDim = e, this.strides = t10, this.paramsShape = n, this.variableNames = ["x", "indices"], this.outputShape = o; let s = Re(o.length), a = ` int index;`; for (let i = 0; i < this.sliceDim; i++) @@ -22383,105 +22479,105 @@ var sg = class { `; } }; -function UJ(r15) { - let { inputs: t8, backend: e } = r15, { params: o, indices: n } = t8, s = n.shape, a = s[s.length - 1], i = y.sizeFromShape(o.shape), [p, u, c, l] = w.prepareAndValidate(o, n), m = te({ inputs: { x: n }, backend: e, attrs: { shape: [u, a] } }), d = te({ inputs: { x: o }, backend: e, attrs: { shape: [y.sizeFromShape(o.shape) / c, c] } }); - if (e.shouldExecuteOnCPU([o, n]) || o.dtype === "string") { - let x = e.readSync(n.dataId), b = e.bufferSync(o), C = WR(x, b, o.dtype, u, a, c, l, o.shape, i); - return e.makeTensorInfo(p, o.dtype, C.values); +function gte(r16) { + let { inputs: e, backend: t10 } = r16, { params: o, indices: n } = e, s = n.shape, a = s[s.length - 1], i = y.sizeFromShape(o.shape), [p, u, l, c] = C.prepareAndValidate(o, n), m = te({ inputs: { x: n }, backend: t10, attrs: { shape: [u, a] } }), d = te({ inputs: { x: o }, backend: t10, attrs: { shape: [y.sizeFromShape(o.shape) / l, l] } }); + if (t10.shouldExecuteOnCPU([o, n]) || o.dtype === "string") { + let x = t10.readSync(n.dataId), b = t10.bufferSync(o), w = AD(x, b, o.dtype, u, a, l, c, o.shape, i); + return t10.makeTensorInfo(p, o.dtype, w.values); } - let f = new sg(a, l, [u, c], o.shape), h = e.runWebGLProgram(f, [d, m], d.dtype), g = te({ inputs: { x: h }, backend: e, attrs: { shape: p } }); - return e.disposeIntermediateTensorInfo(m), e.disposeIntermediateTensorInfo(d), e.disposeIntermediateTensorInfo(h), g; + let f = new xg(a, c, [u, l], o.shape), h = t10.runWebGLProgram(f, [d, m], d.dtype), g = te({ inputs: { x: h }, backend: t10, attrs: { shape: p } }); + return t10.disposeIntermediateTensorInfo(m), t10.disposeIntermediateTensorInfo(d), t10.disposeIntermediateTensorInfo(h), g; } -var wF = { kernelName: vn, backendName: "webgl", kernelFunc: UJ }; -var ag = class { - constructor(t8, e) { - this.variableNames = ["A", "indices"], this.outputShape = e, this.rank = e.length; - let o = Re(this.rank), n = GJ(t8, 2); +var m3 = { kernelName: Kn, backendName: "webgl", kernelFunc: gte }; +var yg = class { + constructor(e, t10) { + this.variableNames = ["A", "indices"], this.outputShape = t10, this.rank = t10.length; + let o = Re(this.rank), n = xte(e, 2); this.userCode = ` void main() { ${o} resRC = getOutputCoords(); int index = int(getIndices(resRC.x, resRC.z)); - float inBounds = (index >= 0) && (index < ${t8[2]}) ? 1.0 : 0.0; + float inBounds = (index >= 0) && (index < ${e[2]}) ? 1.0 : 0.0; setOutput(inBounds * getA(${n})); } `; } }; -function GJ(r15, t8) { - let e = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], o = []; - for (let n = 0; n < r15.length; n++) - n === 2 ? o.push("index") : o.push(`${e[n]}`); +function xte(r16, e) { + let t10 = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], o = []; + for (let n = 0; n < r16.length; n++) + n === 2 ? o.push("index") : o.push(`${t10[n]}`); return o.join(); } -function Nv(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, indices: s } = t8, { axis: a, batchDims: i } = o, p = y.parseAxisParam(a, n.shape)[0]; +function z0(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, indices: s } = e, { axis: a, batchDims: i } = o, p = y.parseAxisParam(a, n.shape)[0]; if (A().get("DEBUG")) { - let b = e.readSync(s.dataId), C = n.shape[p]; + let b = t10.readSync(s.dataId), w = n.shape[p]; for (let S = 0; S < b.length; ++S) { let k = b[S]; - y.assert(k <= C - 1 && k >= 0, () => `GatherV2: the index value ${k} is not in [0, ${C - 1}]`); + y.assert(k <= w - 1 && k >= 0, () => `GatherV2: the index value ${k} is not in [0, ${w - 1}]`); } } - let u = w.segment_util.collectGatherOpShapeInfo(n, s, p, i), c = y.sizeFromShape(s.shape), l = [], m = te({ inputs: { x: n }, backend: e, attrs: { shape: [u.batchSize, u.outerSize, u.dimSize, u.sliceSize] } }), d = te({ inputs: { x: s }, backend: e, attrs: { shape: [u.batchSize, c / u.batchSize] } }); - l.push(m), l.push(d); - let f = [u.batchSize, u.outerSize, c / u.batchSize, u.sliceSize]; - if (e.shouldExecuteOnCPU([n, s]) || n.dtype === "string") { - let b = e.bufferSync(d), C = e.bufferSync(m), S = UR(C, b, f); - return l.forEach((k) => e.disposeIntermediateTensorInfo(k)), e.makeTensorInfo(u.outputShape, S.dtype, S.values); + let u = C.segment_util.collectGatherOpShapeInfo(n, s, p, i), l = y.sizeFromShape(s.shape), c = [], m = te({ inputs: { x: n }, backend: t10, attrs: { shape: [u.batchSize, u.outerSize, u.dimSize, u.sliceSize] } }), d = te({ inputs: { x: s }, backend: t10, attrs: { shape: [u.batchSize, l / u.batchSize] } }); + c.push(m), c.push(d); + let f = [u.batchSize, u.outerSize, l / u.batchSize, u.sliceSize]; + if (t10.shouldExecuteOnCPU([n, s]) || n.dtype === "string") { + let b = t10.bufferSync(d), w = t10.bufferSync(m), S = FD(w, b, f); + return c.forEach((k) => t10.disposeIntermediateTensorInfo(k)), t10.makeTensorInfo(u.outputShape, S.dtype, S.values); } - let h = new ag(m.shape, f), g = e.runWebGLProgram(h, [m, d], m.dtype); - l.push(g); - let x = te({ inputs: { x: g }, backend: e, attrs: { shape: u.outputShape } }); - return l.forEach((b) => e.disposeIntermediateTensorInfo(b)), x; + let h = new yg(m.shape, f), g = t10.runWebGLProgram(h, [m, d], m.dtype); + c.push(g); + let x = te({ inputs: { x: g }, backend: t10, attrs: { shape: u.outputShape } }); + return c.forEach((b) => t10.disposeIntermediateTensorInfo(b)), x; } -var SF = { kernelName: aa, backendName: "webgl", kernelFunc: Nv }; -var HJ = "return float(a > b);"; -var KJ = ` +var d3 = { kernelName: fa, backendName: "webgl", kernelFunc: z0 }; +var yte = "return float(a > b);"; +var bte = ` return vec4(greaterThan(a, b)); `; -var qJ = nt({ opSnippet: HJ, packedOpSnippet: KJ, cpuKernelImpl: GR, dtype: "bool" }); -var IF = { kernelName: kn, backendName: "webgl", kernelFunc: qJ }; -var jJ = "return float(a >= b);"; -var XJ = ` +var Cte = st({ opSnippet: yte, packedOpSnippet: bte, cpuKernelImpl: PD, dtype: "bool" }); +var f3 = { kernelName: So, backendName: "webgl", kernelFunc: Cte }; +var wte = "return float(a >= b);"; +var Ste = ` return vec4(greaterThanEqual(a, b)); `; -var YJ = nt({ opSnippet: jJ, packedOpSnippet: XJ, dtype: "bool", cpuKernelImpl: HR }); -var vF = { kernelName: Nn, backendName: "webgl", kernelFunc: YJ }; -function QJ(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8; - return eg(o, true, e); -} -var kF = { kernelName: zi, backendName: "webgl", kernelFunc: QJ }; -var ZJ = "return float(!isnan(x) && !isinf(x));"; -var JJ = xe({ opSnippet: ZJ, dtype: "bool" }); -var NF = { kernelName: Tn, backendName: "webgl", kernelFunc: JJ }; -var eee = "return float(isinf(x));"; -var tee = xe({ opSnippet: eee, dtype: "bool" }); -var TF = { kernelName: _n, backendName: "webgl", kernelFunc: tee }; -var ree = "return float(isnan(x));"; -var oee = xe({ opSnippet: ree, dtype: "bool" }); -var _F = { kernelName: $n, backendName: "webgl", kernelFunc: oee }; -var nee = "return float(a < b);"; -var see = ` +var Ite = st({ opSnippet: wte, packedOpSnippet: Ste, dtype: "bool", cpuKernelImpl: OD }); +var h3 = { kernelName: Io, backendName: "webgl", kernelFunc: Ite }; +function vte(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e; + return mg(o, true, t10); +} +var g3 = { kernelName: Yi, backendName: "webgl", kernelFunc: vte }; +var kte = "return float(!isnan(x) && !isinf(x));"; +var Nte = xe({ opSnippet: kte, dtype: "bool" }); +var x3 = { kernelName: qn, backendName: "webgl", kernelFunc: Nte }; +var Tte = "return float(isinf(x));"; +var _te = xe({ opSnippet: Tte, dtype: "bool" }); +var y3 = { kernelName: jn, backendName: "webgl", kernelFunc: _te }; +var Ete = "return float(isnan(x));"; +var $te = xe({ opSnippet: Ete, dtype: "bool" }); +var b3 = { kernelName: Xn, backendName: "webgl", kernelFunc: $te }; +var Rte = "return float(a < b);"; +var Dte = ` return vec4(lessThan(a, b)); `; -var aee = nt({ opSnippet: nee, packedOpSnippet: see, cpuKernelImpl: KR, dtype: "bool" }); -var $F = { kernelName: Rn, backendName: "webgl", kernelFunc: aee }; -var iee = "return float(a <= b);"; -var uee = ` +var Ate = st({ opSnippet: Rte, packedOpSnippet: Dte, cpuKernelImpl: MD, dtype: "bool" }); +var C3 = { kernelName: ko, backendName: "webgl", kernelFunc: Ate }; +var Fte = "return float(a <= b);"; +var Pte = ` return vec4(lessThanEqual(a, b)); `; -var pee = nt({ opSnippet: iee, packedOpSnippet: uee, cpuKernelImpl: qR, dtype: "bool" }); -var EF = { kernelName: Dn, backendName: "webgl", kernelFunc: pee }; -function cee(r15) { - let { backend: t8, attrs: e } = r15, { start: o, stop: n, num: s } = e, a = jR(o, n, s); - return t8.makeTensorInfo([a.length], "float32", a); -} -var RF = { kernelName: An, backendName: "webgl", kernelFunc: cee }; -var lee = Fo + ` +var Ote = st({ opSnippet: Fte, packedOpSnippet: Pte, cpuKernelImpl: LD, dtype: "bool" }); +var w3 = { kernelName: No, backendName: "webgl", kernelFunc: Ote }; +function Mte(r16) { + let { backend: e, attrs: t10 } = r16, { start: o, stop: n, num: s } = t10, a = BD(o, n, s); + return e.makeTensorInfo([a.length], "float32", a); +} +var S3 = { kernelName: Qn, backendName: "webgl", kernelFunc: Mte }; +var Lte = sn + ` return x < 0.0 ? 0./0. : log(x); `; -var mee = ` +var Bte = ` vec4 result = log(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r); @@ -22490,38 +22586,38 @@ var mee = ` result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a); return result; `; -var dee = xe({ opSnippet: lee, packedOpSnippet: mee, cpuKernelImpl: XR }); -var DF = { kernelName: Fn, backendName: "webgl", kernelFunc: dee }; -var fee = Fo + ` +var zte = xe({ opSnippet: Lte, packedOpSnippet: Bte, cpuKernelImpl: zD }); +var I3 = { kernelName: To, backendName: "webgl", kernelFunc: zte }; +var Vte = sn + ` return log(1.0 + x); `; -var hee = xe({ opSnippet: fee }); -var AF = { kernelName: Pn, backendName: "webgl", kernelFunc: hee }; -var gee = "return float(a >= 1.0 && b >= 1.0);"; -var xee = ` +var Wte = xe({ opSnippet: Vte }); +var v3 = { kernelName: Zn, backendName: "webgl", kernelFunc: Wte }; +var Ute = "return float(a >= 1.0 && b >= 1.0);"; +var Gte = ` return vec4( vec4(greaterThanEqual(a, vec4(1.0))) * vec4(greaterThanEqual(b, vec4(1.0)))); `; -var yee = nt({ opSnippet: gee, packedOpSnippet: xee, dtype: "bool" }); -var FF = { kernelName: On, backendName: "webgl", kernelFunc: yee }; -var bee = "return float(!(x >= 1.0));"; -var Cee = xe({ opSnippet: bee }); -var PF = { kernelName: Mn, backendName: "webgl", kernelFunc: Cee }; -var wee = "return float(a >= 1.0 || b >= 1.0);"; -var See = ` +var Hte = st({ opSnippet: Ute, packedOpSnippet: Gte, dtype: "bool" }); +var k3 = { kernelName: Jn, backendName: "webgl", kernelFunc: Hte }; +var Kte = "return float(!(x >= 1.0));"; +var qte = xe({ opSnippet: Kte }); +var N3 = { kernelName: es, backendName: "webgl", kernelFunc: qte }; +var jte = "return float(a >= 1.0 || b >= 1.0);"; +var Xte = ` return min( vec4(greaterThanEqual(a, vec4(1.0))) + vec4(greaterThanEqual(b, vec4(1.0))), vec4(1.0)); `; -var Iee = nt({ opSnippet: wee, packedOpSnippet: See, dtype: "bool" }); -var OF = { kernelName: Ln, backendName: "webgl", kernelFunc: Iee }; -var ig = class { - constructor(t8, e, o, n, s) { +var Yte = st({ opSnippet: jte, packedOpSnippet: Xte, dtype: "bool" }); +var T3 = { kernelName: ts, backendName: "webgl", kernelFunc: Yte }; +var bg = class { + constructor(e, t10, o, n, s) { this.variableNames = ["x"], this.outputShape = []; - let a = e, i = t8[3] - 1; - this.outputShape = t8; + let a = t10, i = e[3] - 1; + this.outputShape = e; let p, u = `float(${o}) + float(${n}) * sum`; s === 0.5 ? p = `inversesqrt(${u})` : s === 1 ? p = `1.0/(${u})` : p = `exp(log(${u}) * float(-${s}));`, this.userCode = ` void main() { @@ -22545,11 +22641,11 @@ var ig = class { `; } }; -var ug = class { - constructor(t8, e, o, n, s) { +var Cg = class { + constructor(e, t10, o, n, s) { this.variableNames = ["x"], this.outputShape = [], this.packedInputs = true, this.packedOutput = true; - let a = e, i = t8[3] - 1; - this.outputShape = t8; + let a = t10, i = e[3] - 1; + this.outputShape = e; let p, u = `float(${o}) + float(${n}) * sum`; s === 0.5 ? p = `inversesqrt(${u})` : s === 1 ? p = `1.0/(${u})` : p = `exp(log(${u}) * float(-${s}));`, this.userCode = ` void main() { @@ -22616,14 +22712,14 @@ var ug = class { `; } }; -var vee = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { depthRadius: s, bias: a, alpha: i, beta: p } = o, u = A().getBool("WEBGL_PACK_NORMALIZATION") ? new ug(n.shape, s, a, i, p) : new ig(n.shape, s, a, i, p); - return e.runWebGLProgram(u, [n], n.dtype); +var Qte = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { depthRadius: s, bias: a, alpha: i, beta: p } = o, u = A().getBool("WEBGL_PACK_NORMALIZATION") ? new Cg(n.shape, s, a, i, p) : new bg(n.shape, s, a, i, p); + return t10.runWebGLProgram(u, [n], n.dtype); }; -var MF = { kernelName: Bn, backendName: "webgl", kernelFunc: vee }; -var pg = class { - constructor(t8, e, o, n, s) { - this.variableNames = ["inputImage", "outputImage", "dy"], this.outputShape = [], this.outputShape = t8, this.depth = t8[3], this.depthRadius = e, this.bias = o, this.alpha = n, this.beta = s, this.userCode = ` +var _3 = { kernelName: rs, backendName: "webgl", kernelFunc: Qte }; +var wg = class { + constructor(e, t10, o, n, s) { + this.variableNames = ["inputImage", "outputImage", "dy"], this.outputShape = [], this.outputShape = e, this.depth = e[3], this.depthRadius = t10, this.bias = o, this.alpha = n, this.beta = s, this.userCode = ` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -22632,9 +22728,9 @@ var pg = class { float result = 0.0; for (int d = 0; d < ${this.depth}; ++d) { - int depthBegin = int(max(0.0, float(d - ${e}))); + int depthBegin = int(max(0.0, float(d - ${t10}))); int depthEnd = int(min(float(${this.depth}), - float(d + ${e} + 1))); + float(d + ${t10} + 1))); const int MIN_DEPTH_BEGIN = 0; const int MAX_DEPTH_END = ${this.depth}; @@ -22681,78 +22777,78 @@ var pg = class { `; } }; -var kee = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, y: s, dy: a } = t8, { depthRadius: i, bias: p, alpha: u, beta: c } = o, l = new pg(n.shape, i, p, u, c); - return e.runWebGLProgram(l, [n, s, a], n.dtype); +var Zte = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, y: s, dy: a } = e, { depthRadius: i, bias: p, alpha: u, beta: l } = o, c = new wg(n.shape, i, p, u, l); + return t10.runWebGLProgram(c, [n, s, a], n.dtype); }; -var LF = { kernelName: Ya, backendName: "webgl", kernelFunc: kee }; -function BF(r15, t8, e, o) { - let n = y.sizeFromShape(t8), a = y.sizeFromShape(r15.shape) / n, i = te({ inputs: { x: r15 }, attrs: { shape: [a, n] }, backend: o }), p = Xr(i, r15.dtype, "max", o), u = te({ inputs: { x: p }, attrs: { shape: e }, backend: o }); +var E3 = { kernelName: oi, backendName: "webgl", kernelFunc: Zte }; +function $3(r16, e, t10, o) { + let n = y.sizeFromShape(e), a = y.sizeFromShape(r16.shape) / n, i = te({ inputs: { x: r16 }, attrs: { shape: [a, n] }, backend: o }), p = ro(i, r16.dtype, "max", o), u = te({ inputs: { x: p }, attrs: { shape: t10 }, backend: o }); return o.disposeIntermediateTensorInfo(i), o.disposeIntermediateTensorInfo(p), u; } -function Tv(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { reductionIndices: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, c = w.getAxesPermutation(u, i), l = c != null, m = e.shouldExecuteOnCPU([n]), d = n; - if (l) { +function V0(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { reductionIndices: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, l = C.getAxesPermutation(u, i), c = l != null, m = t10.shouldExecuteOnCPU([n]), d = n; + if (c) { if (m) { - let C = e.texData.get(d.dataId).values, S = new Array(i); + let w = t10.texData.get(d.dataId).values, S = new Array(i); for (let E = 0; E < S.length; E++) - S[E] = n.shape[c[E]]; - let k = yp(C, n.shape, n.dtype, c, S); - d = e.makeTensorInfo(S, n.dtype); - let _ = e.texData.get(d.dataId); - _.values = k; + S[E] = n.shape[l[E]]; + let k = Np(w, n.shape, n.dtype, l, S); + d = t10.makeTensorInfo(S, n.dtype); + let T = t10.texData.get(d.dataId); + T.values = k; } else - d = gu(n, c, e); - u = w.getInnerMostAxes(u.length, i); + d = ku(n, l, t10); + u = C.getInnerMostAxes(u.length, i); } - w.assertAxesAreInnerMostDims("max", u, i); - let [f, h] = w.computeOutAndReduceShapes(d.shape, u), g = f; - a && (g = w.expandShapeToKeepDim(f, p)); + C.assertAxesAreInnerMostDims("max", u, i); + let [f, h] = C.computeOutAndReduceShapes(d.shape, u), g = f; + a && (g = C.expandShapeToKeepDim(f, p)); let x; if (m) { - let C = e.texData.get(d.dataId).values, S = YR(C, y.sizeFromShape(h), g, n.dtype); - x = e.makeTensorInfo(g, n.dtype); - let k = e.texData.get(x.dataId); + let w = t10.texData.get(d.dataId).values, S = VD(w, y.sizeFromShape(h), g, n.dtype); + x = t10.makeTensorInfo(g, n.dtype); + let k = t10.texData.get(x.dataId); k.values = S; } else - x = BF(d, h, g, e); - return l && e.disposeIntermediateTensorInfo(d), x; + x = $3(d, h, g, t10); + return c && t10.disposeIntermediateTensorInfo(d), x; } -var zF = { kernelName: zn, backendName: "webgl", kernelFunc: Tv }; -var Nee = Mc + ` +var R3 = { kernelName: os, backendName: "webgl", kernelFunc: V0 }; +var Jte = Gl + ` return max(a, b); `; -var Tee = ` +var ere = ` vec4 result = vec4(max(a, b)); bvec4 isNaNA = isnan(a); bvec4 isNaNB = isnan(b); bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); - ` + jr + ` + ` + to + ` return result; `; -var _ee = nt({ opSnippet: Nee, packedOpSnippet: Tee, cpuKernelImpl: QR }); -var VF = { kernelName: Vn, backendName: "webgl", kernelFunc: _ee }; -function $ee(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8; - Vs(n, "maxPool"); +var tre = st({ opSnippet: Jte, packedOpSnippet: ere, cpuKernelImpl: WD }); +var D3 = { kernelName: _o, backendName: "webgl", kernelFunc: tre }; +function rre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e; + Ys(n, "maxPool"); let { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, u = 1; - y.assert(w.eitherStridesOrDilationsAreOne(a, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); - let c = w.computePool2DInfo(n.shape, s, a, u, i, p); - if (c.filterWidth === 1 && c.filterHeight === 1 && y.arraysEqual(c.inShape, c.outShape)) - return Dt({ inputs: { x: n }, backend: e }); - let l = new Us(c, "max", false); - return e.runWebGLProgram(l, [n], n.dtype); -} -var WF = { kernelName: Wn, backendName: "webgl", kernelFunc: $ee }; -function Eee(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dataFormat: p, dimRoundingMode: u } = o, c = [1, 1, 1], l = w.computePool3DInfo(n.shape, s, a, c, i, u, p), m = new xu(l, "max", false); - return e.runWebGLProgram(m, [n], n.dtype); -} -var UF = { kernelName: ia, backendName: "webgl", kernelFunc: Eee }; -var cg = class { - constructor(t8) { - this.variableNames = ["dy", "maxPos"], this.outputShape = t8.inShape; - let e = t8.strideHeight, o = t8.strideWidth, n = t8.dilationHeight, s = t8.effectiveFilterHeight, a = t8.effectiveFilterWidth, i = s - 1 - t8.padInfo.top, p = a - 1 - t8.padInfo.left, u = s * a - 1; + y.assert(C.eitherStridesOrDilationsAreOne(a, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); + let l = C.computePool2DInfo(n.shape, s, a, u, i, p); + if (l.filterWidth === 1 && l.filterHeight === 1 && y.arraysEqual(l.inShape, l.outShape)) + return Ft({ inputs: { x: n }, backend: t10 }); + let c = new Zs(l, "max", false); + return t10.runWebGLProgram(c, [n], n.dtype); +} +var A3 = { kernelName: ns, backendName: "webgl", kernelFunc: rre }; +function ore(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dataFormat: p, dimRoundingMode: u } = o, l = [1, 1, 1], c = C.computePool3DInfo(n.shape, s, a, l, i, u, p), m = new Nu(c, "max", false); + return t10.runWebGLProgram(m, [n], n.dtype); +} +var F3 = { kernelName: ha, backendName: "webgl", kernelFunc: ore }; +var Sg = class { + constructor(e) { + this.variableNames = ["dy", "maxPos"], this.outputShape = e.inShape; + let t10 = e.strideHeight, o = e.strideWidth, n = e.dilationHeight, s = e.effectiveFilterHeight, a = e.effectiveFilterWidth, i = s - 1 - e.padInfo.top, p = a - 1 - e.padInfo.left, u = s * a - 1; this.userCode = ` const ivec2 pads = ivec2(${i}, ${p}); @@ -22770,9 +22866,9 @@ var cg = class { float dotProd = 0.0; for (int wR = 0; wR < ${s}; wR += ${n}) { - float dyR = float(dyRCorner + wR) / ${e}.0; + float dyR = float(dyRCorner + wR) / ${t10}.0; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); @@ -22780,7 +22876,7 @@ var cg = class { for (int wC = 0; wC < ${a}; wC++) { float dyC = float(dyCCorner + wC) / ${o}.0; - if (dyC < 0.0 || dyC >= ${t8.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -22802,12 +22898,12 @@ var cg = class { `; } }; -var lg = class { - constructor(t8) { - this.variableNames = ["dy", "maxPos"], this.outputShape = t8.inShape; - let e = t8.strideDepth, o = t8.strideHeight, n = t8.strideWidth, s = t8.dilationDepth, a = t8.dilationHeight, i = t8.dilationWidth, p = t8.effectiveFilterDepth, u = t8.effectiveFilterHeight, c = t8.effectiveFilterWidth, l = p - 1 - t8.padInfo.front, m = u - 1 - t8.padInfo.top, d = c - 1 - t8.padInfo.left, f = p * u * c - 1; +var Ig = class { + constructor(e) { + this.variableNames = ["dy", "maxPos"], this.outputShape = e.inShape; + let t10 = e.strideDepth, o = e.strideHeight, n = e.strideWidth, s = e.dilationDepth, a = e.dilationHeight, i = e.dilationWidth, p = e.effectiveFilterDepth, u = e.effectiveFilterHeight, l = e.effectiveFilterWidth, c = p - 1 - e.padInfo.front, m = u - 1 - e.padInfo.top, d = l - 1 - e.padInfo.left, f = p * u * l - 1; this.userCode = ` - const ivec3 pads = ivec3(${l}, ${m}, ${d}); + const ivec3 pads = ivec3(${c}, ${m}, ${d}); void main() { ivec5 coords = getOutputCoords(); @@ -22826,9 +22922,9 @@ var lg = class { for (int wD = 0; wD < ${p}; wD += ${s}) { - float dyD = float(dyDCorner + wD) / ${e}.0; + float dyD = float(dyDCorner + wD) / ${t10}.0; - if (dyD < 0.0 || dyD >= ${t8.outDepth}.0 || fract(dyD) > 0.0) { + if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); @@ -22837,17 +22933,17 @@ var lg = class { wR += ${a}) { float dyR = float(dyRCorner + wR) / ${o}.0; - if (dyR < 0.0 || dyR >= ${t8.outHeight}.0 || + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - for (int wC = 0; wC < ${c}; + for (int wC = 0; wC < ${l}; wC += ${i}) { float dyC = float(dyCCorner + wC) / ${n}.0; - if (dyC < 0.0 || dyC >= ${t8.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -22860,8 +22956,8 @@ var lg = class { // Get the current value, check it against the value from the // position matrix. int curPosValue = - wD * ${u} * ${c} + - wR * ${c} + wC; + wD * ${u} * ${l} + + wR * ${l} + wC; float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); dotProd += dyValue * mask; @@ -22873,88 +22969,88 @@ var lg = class { `; } }; -function Ree(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: c } = o, l = [1, 1, 1], m = w.computePool3DInfo(a.shape, i, p, l, u, c), d = new xu(m, "max", true), f = e.runWebGLProgram(d, [a], a.dtype), h = new lg(m), g = e.runWebGLProgram(h, [n, f], a.dtype); - return e.disposeIntermediateTensorInfo(f), g; +function nre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: l } = o, c = [1, 1, 1], m = C.computePool3DInfo(a.shape, i, p, c, u, l), d = new Nu(m, "max", true), f = t10.runWebGLProgram(d, [a], a.dtype), h = new Ig(m), g = t10.runWebGLProgram(h, [n, f], a.dtype); + return t10.disposeIntermediateTensorInfo(f), g; } -var GF = { kernelName: Ui, backendName: "webgl", kernelFunc: Ree }; -function Dee(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s, output: a } = t8, i = s; - Vs([s, a], "maxPoolGrad"); - let { filterSize: p, strides: u, pad: c, dimRoundingMode: l } = o, m = w.computePool2DInfo(i.shape, p, u, 1, c, l), d = true, f = new Us(m, "max", d), h = e.runWebGLProgram(f, [i], i.dtype), g = new cg(m), x = e.runWebGLProgram(g, [n, h], i.dtype); - return e.disposeIntermediateTensorInfo(h), x; +var P3 = { kernelName: Ji, backendName: "webgl", kernelFunc: nre }; +function sre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s, output: a } = e, i = s; + Ys([s, a], "maxPoolGrad"); + let { filterSize: p, strides: u, pad: l, dimRoundingMode: c } = o, m = C.computePool2DInfo(i.shape, p, u, 1, l, c), d = true, f = new Zs(m, "max", d), h = t10.runWebGLProgram(f, [i], i.dtype), g = new Sg(m), x = t10.runWebGLProgram(g, [n, h], i.dtype); + return t10.disposeIntermediateTensorInfo(h), x; } -var HF = { kernelName: Wi, backendName: "webgl", kernelFunc: Dee }; -function KF(r15, t8, e, o) { - let n = new Us(e, "max", false), s = o.runWebGLProgram(n, [r15], "float32"); - n = new Us(e, "max", true, true, t8); - let a = o.runWebGLProgram(n, [r15], "float32"); +var O3 = { kernelName: Zi, backendName: "webgl", kernelFunc: sre }; +function M3(r16, e, t10, o) { + let n = new Zs(t10, "max", false), s = o.runWebGLProgram(n, [r16], "float32"); + n = new Zs(t10, "max", true, true, e); + let a = o.runWebGLProgram(n, [r16], "float32"); return [s, a]; } -var qF = { kernelName: ua, backendName: "webgl", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { x: o } = r15, { filterSize: n, strides: s, pad: a, includeBatchInIndex: i } = t8, p = e; +var L3 = { kernelName: ga, backendName: "webgl", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { x: o } = r16, { filterSize: n, strides: s, pad: a, includeBatchInIndex: i } = e, p = t10; y.assert(o.shape.length === 4, () => `Error in maxPool: input must be rank 4 but got rank ${o.shape.length}.`); let u = [1, 1]; - y.assert(w.eitherStridesOrDilationsAreOne(s, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`); - let c = w.computePool2DInfo(o.shape, n, s, u, a), [l, m] = KF(o, i, c, p); - return [l, m]; + y.assert(C.eitherStridesOrDilationsAreOne(s, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`); + let l = C.computePool2DInfo(o.shape, n, s, u, a), [c, m] = M3(o, i, l, p); + return [c, m]; } }; -function jF(r15, t8, e, o) { - let n = y.sizeFromShape(t8), a = y.sizeFromShape(r15.shape) / n, i = te({ inputs: { x: r15 }, attrs: { shape: [a, n] }, backend: o }), p = Xr(i, "float32", "mean", o), u = te({ inputs: { x: p }, attrs: { shape: e }, backend: o }); +function B3(r16, e, t10, o) { + let n = y.sizeFromShape(e), a = y.sizeFromShape(r16.shape) / n, i = te({ inputs: { x: r16 }, attrs: { shape: [a, n] }, backend: o }), p = ro(i, "float32", "mean", o), u = te({ inputs: { x: p }, attrs: { shape: t10 }, backend: o }); return o.disposeIntermediateTensorInfo(i), o.disposeIntermediateTensorInfo(p), u; } -var XF = { kernelName: Un, backendName: "webgl", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { x: o } = r15, { keepDims: n, axis: s } = t8, a = e, i = o.shape.length, p = y.parseAxisParam(s, o.shape), u = p, c = w.getAxesPermutation(u, i), l = c != null, m = a.shouldExecuteOnCPU([o]), d = [], f = o; - if (l) { +var z3 = { kernelName: ss, backendName: "webgl", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { x: o } = r16, { keepDims: n, axis: s } = e, a = t10, i = o.shape.length, p = y.parseAxisParam(s, o.shape), u = p, l = C.getAxesPermutation(u, i), c = l != null, m = a.shouldExecuteOnCPU([o]), d = [], f = o; + if (c) { if (m) { let S = a.texData.get(f.dataId).values, k = new Array(i); for (let R = 0; R < k.length; R++) - k[R] = o.shape[c[R]]; - let _ = yp(S, o.shape, o.dtype, c, k); + k[R] = o.shape[l[R]]; + let T = Np(S, o.shape, o.dtype, l, k); f = a.makeTensorInfo(k, o.dtype); let E = a.texData.get(f.dataId); - E.values = _; + E.values = T; } else - f = gu(o, c, a); - d.push(f), u = w.getInnerMostAxes(u.length, i); - } - w.assertAxesAreInnerMostDims("sum", u, i); - let [h, g] = w.computeOutAndReduceShapes(f.shape, u), x = h; - n && (x = w.expandShapeToKeepDim(h, p)); - let b = jF(f, g, x, a); - for (let C of d) - a.disposeIntermediateTensorInfo(C); + f = ku(o, l, a); + d.push(f), u = C.getInnerMostAxes(u.length, i); + } + C.assertAxesAreInnerMostDims("sum", u, i); + let [h, g] = C.computeOutAndReduceShapes(f.shape, u), x = h; + n && (x = C.expandShapeToKeepDim(h, p)); + let b = B3(f, g, x, a); + for (let w of d) + a.disposeIntermediateTensorInfo(w); return b; } }; -function Aee(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, c = w.getAxesPermutation(u, i), l = n; - c != null && (l = bt({ inputs: { x: n }, backend: e, attrs: { perm: c } }), u = w.getInnerMostAxes(u.length, n.shape.length)), w.assertAxesAreInnerMostDims("min", u, i); - let [m, d] = w.computeOutAndReduceShapes(l.shape, u), f = y.sizeFromShape(d), h = te({ inputs: { x: l }, backend: e, attrs: { shape: [-1, f] } }), g = Xr(h, h.dtype, "min", e), x; +function are(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o, i = n.shape.length, p = y.parseAxisParam(s, n.shape), u = p, l = C.getAxesPermutation(u, i), c = n; + l != null && (c = Ct({ inputs: { x: n }, backend: t10, attrs: { perm: l } }), u = C.getInnerMostAxes(u.length, n.shape.length)), C.assertAxesAreInnerMostDims("min", u, i); + let [m, d] = C.computeOutAndReduceShapes(c.shape, u), f = y.sizeFromShape(d), h = te({ inputs: { x: c }, backend: t10, attrs: { shape: [-1, f] } }), g = ro(h, h.dtype, "min", t10), x; if (a) { - let b = w.expandShapeToKeepDim(m, p); - x = te({ inputs: { x: g }, backend: e, attrs: { shape: b } }); + let b = C.expandShapeToKeepDim(m, p); + x = te({ inputs: { x: g }, backend: t10, attrs: { shape: b } }); } else - x = te({ inputs: { x: g }, backend: e, attrs: { shape: m } }); - return e.disposeIntermediateTensorInfo(h), e.disposeIntermediateTensorInfo(g), c != null && e.disposeIntermediateTensorInfo(l), x; + x = te({ inputs: { x: g }, backend: t10, attrs: { shape: m } }); + return t10.disposeIntermediateTensorInfo(h), t10.disposeIntermediateTensorInfo(g), l != null && t10.disposeIntermediateTensorInfo(c), x; } -var YF = { kernelName: Gn, backendName: "webgl", kernelFunc: Aee }; -var Fee = Mc + ` +var V3 = { kernelName: as, backendName: "webgl", kernelFunc: are }; +var ire = Gl + ` return min(a, b); `; -var Pee = ` +var ure = ` vec4 result = vec4(min(a, b)); bvec4 isNaNA = isnan(a); bvec4 isNaNB = isnan(b); bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); - ` + jr + ` + ` + to + ` return result; `; -var Oee = nt({ opSnippet: Fee, packedOpSnippet: Pee, cpuKernelImpl: ZR }); -var QF = { kernelName: Hn, backendName: "webgl", kernelFunc: Oee }; -var mg = class { - constructor(t8, e, o) { - this.variableNames = ["x"], this.outputShape = e.map((c, l) => c[0] + t8[l] + c[1]); - let n = t8.length, s = Re(n), a = e.map((c) => c[0]).join(","), i = e.map((c, l) => c[0] + t8[l]).join(","), p = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, n), u = o === "reflect" ? 0 : 1; +var pre = st({ opSnippet: ire, packedOpSnippet: ure, cpuKernelImpl: UD }); +var W3 = { kernelName: Eo, backendName: "webgl", kernelFunc: pre }; +var vg = class { + constructor(e, t10, o) { + this.variableNames = ["x"], this.outputShape = t10.map((l, c) => l[0] + e[c] + l[1]); + let n = e.length, s = Re(n), a = t10.map((l) => l[0]).join(","), i = t10.map((l, c) => l[0] + e[c]).join(","), p = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, n), u = o === "reflect" ? 0 : 1; if (n === 1) { this.userCode = ` int start = ${a}; @@ -22991,10 +23087,10 @@ var mg = class { `; } }; -var dg = class { - constructor(t8, e, o) { - this.variableNames = ["x"], this.packedInputs = true, this.packedOutput = true, this.outputShape = e.map((f, h) => f[0] + t8[h] + f[1]); - let n = t8.length, s = Re(n), a = e.map((f) => f[0]).join(","), i = e.map((f, h) => f[0] + t8[h]).join(","), p = Rt("rc", n), u = Rt("source", n), c = `${p[n - 1]} < ${this.outputShape[n - 1]}`, l = n === 1 ? "source" : `vec2(${u.slice(-2).join()})`, m = o === "reflect" ? 0 : 1, d = ""; +var kg = class { + constructor(e, t10, o) { + this.variableNames = ["x"], this.packedInputs = true, this.packedOutput = true, this.outputShape = t10.map((f, h) => f[0] + e[h] + f[1]); + let n = e.length, s = Re(n), a = t10.map((f) => f[0]).join(","), i = t10.map((f, h) => f[0] + e[h]).join(","), p = At("rc", n), u = At("source", n), l = `${p[n - 1]} < ${this.outputShape[n - 1]}`, c = n === 1 ? "source" : `vec2(${u.slice(-2).join()})`, m = o === "reflect" ? 0 : 1, d = ""; if (n === 1) { let f = ` ${s} source = rc; @@ -23008,11 +23104,11 @@ var dg = class { d = ` ${s} rc = outputLoc; ${f} - result[0] = getChannel(getX(${u.join()}), ${l}); + result[0] = getChannel(getX(${u.join()}), ${c}); ${p[n - 1]} += 1; - if(${c}) { + if(${l}) { ${f} - result[1] = getChannel(getX(${u.join()}), ${l}); + result[1] = getChannel(getX(${u.join()}), ${c}); } `; } else { @@ -23029,21 +23125,21 @@ var dg = class { d = ` ${s} rc = outputLoc; ${f} - result[0] = getChannel(getX(${u.join()}), ${l}); + result[0] = getChannel(getX(${u.join()}), ${c}); ${p[n - 1]} += 1; - if(${c}) { + if(${l}) { ${f} - result[1] = getChannel(getX(${u.join()}), ${l}); + result[1] = getChannel(getX(${u.join()}), ${c}); } rc = outputLoc; ${p[n - 2]} += 1; if(${p[n - 2]} < ${this.outputShape[n - 2]}) { ${f} - result[2] = getChannel(getX(${u.join()}), ${l}); + result[2] = getChannel(getX(${u.join()}), ${c}); ${p[n - 1]} += 1; - if(${c}) { + if(${l}) { ${f} - result[3] = getChannel(getX(${u.join()}), ${l}); + result[3] = getChannel(getX(${u.join()}), ${c}); } } `; @@ -23061,24 +23157,24 @@ var dg = class { `; } }; -var Mee = ({ inputs: r15, backend: t8, attrs: e }) => { - let { x: o } = r15, { paddings: n, mode: s } = e, a = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new dg(o.shape, n, s) : new mg(o.shape, n, s); - return t8.runWebGLProgram(a, [o], o.dtype); +var lre = ({ inputs: r16, backend: e, attrs: t10 }) => { + let { x: o } = r16, { paddings: n, mode: s } = t10, a = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new kg(o.shape, n, s) : new vg(o.shape, n, s); + return e.runWebGLProgram(a, [o], o.dtype); }; -var ZF = { kernelName: Kn, backendName: "webgl", kernelFunc: Mee }; -var Lee = `if (b == 0.0) return NAN; +var U3 = { kernelName: is, backendName: "webgl", kernelFunc: lre }; +var cre = `if (b == 0.0) return NAN; return mod(a, b);`; -var Bee = ` +var mre = ` vec4 result = mod(a, b); bvec4 isNaN = equal(b, vec4(0.0)); - ` + jr + ` + ` + to + ` return result; `; -var zee = nt({ opSnippet: Lee, packedOpSnippet: Bee }); -var JF = { kernelName: qn, backendName: "webgl", kernelFunc: zee }; -var fg = class { - constructor(t8, e, o) { - this.variableNames = ["probs"], this.customUniforms = [{ name: "seed", type: "float" }], this.outputShape = [t8, o], this.userCode = ` +var dre = st({ opSnippet: cre, packedOpSnippet: mre }); +var G3 = { kernelName: us, backendName: "webgl", kernelFunc: dre }; +var Ng = class { + constructor(e, t10, o) { + this.variableNames = ["probs"], this.customUniforms = [{ name: "seed", type: "float" }], this.outputShape = [e, o], this.userCode = ` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -23086,7 +23182,7 @@ var fg = class { float r = random(seed); float cdf = 0.0; - for (int i = 0; i < ${e - 1}; i++) { + for (int i = 0; i < ${t10 - 1}; i++) { cdf += getProbs(batch, i); if (r < cdf) { @@ -23096,17 +23192,17 @@ var fg = class { } // If no other event happened, last event happened. - setOutput(float(${e - 1})); + setOutput(float(${t10 - 1})); } `; } }; -var Vee = ` +var fre = ` if (a == b) { return 1.0; }; return a / b;`; -var Wee = ` +var hre = ` // vec4 one = vec4(equal(a, b)); // return one + (vec4(1.0) - one) * a / b; vec4 result = a / b; @@ -23125,25 +23221,25 @@ var Wee = ` return result; `; -var _v = nt({ opSnippet: Vee, packedOpSnippet: Wee, checkOutOfBounds: true }); -var e3 = { kernelName: fn, backendName: "webgl", kernelFunc: _v }; -var t3 = "return a - b;"; -var $v = nt({ opSnippet: t3, packedOpSnippet: t3, supportsComplex: true, cpuKernelImpl: bD }); -var r32 = { kernelName: Ts, backendName: "webgl", kernelFunc: $v }; -function Ev(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { logits: n } = t8, { dim: s } = o, a = y.parseAxisParam([s], n.shape), i = Tv({ inputs: { x: n }, backend: e, attrs: { reductionIndices: a, keepDims: false } }), p = w.expandShapeToKeepDim(i.shape, a), u = te({ inputs: { x: i }, backend: e, attrs: { shape: p } }), c = $v({ inputs: { a: n, b: u }, backend: e }), l = vv({ inputs: { x: c }, backend: e }), m = bp({ inputs: { x: l }, backend: e, attrs: { axis: a, keepDims: false } }), d = te({ inputs: { x: m }, backend: e, attrs: { shape: p } }), f = _v({ inputs: { a: l, b: d }, backend: e }); - return e.disposeIntermediateTensorInfo(i), e.disposeIntermediateTensorInfo(u), e.disposeIntermediateTensorInfo(c), e.disposeIntermediateTensorInfo(l), e.disposeIntermediateTensorInfo(m), e.disposeIntermediateTensorInfo(d), f; -} -var o3 = { kernelName: Is, backendName: "webgl", kernelFunc: Ev }; -function Uee(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { logits: n } = t8, { numSamples: s, seed: a, normalized: i } = o, p = i ? n : Ev({ inputs: { logits: n }, backend: e, attrs: { dim: n.shape.length - 1 } }), u = p.shape[0], c = p.shape[1], l = new fg(u, c, s), m = [[a]], d = e.runWebGLProgram(l, [p], "int32", m); - return i || e.disposeIntermediateTensorInfo(p), d; -} -var n3 = { kernelName: jn, backendName: "webgl", kernelFunc: Uee }; -var Gee = Wt + ` +var W0 = st({ opSnippet: fre, packedOpSnippet: hre, checkOutOfBounds: true }); +var H3 = { kernelName: Vn, backendName: "webgl", kernelFunc: W0 }; +var K3 = "return a - b;"; +var U0 = st({ opSnippet: K3, packedOpSnippet: K3, supportsComplex: true, cpuKernelImpl: lA }); +var q3 = { kernelName: Oo, backendName: "webgl", kernelFunc: U0 }; +function G0(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { logits: n } = e, { dim: s } = o, a = y.parseAxisParam([s], n.shape), i = V0({ inputs: { x: n }, backend: t10, attrs: { reductionIndices: a, keepDims: false } }), p = C.expandShapeToKeepDim(i.shape, a), u = te({ inputs: { x: i }, backend: t10, attrs: { shape: p } }), l = U0({ inputs: { a: n, b: u }, backend: t10 }), c = L0({ inputs: { x: l }, backend: t10 }), m = Tp({ inputs: { x: c }, backend: t10, attrs: { axis: a, keepDims: false } }), d = te({ inputs: { x: m }, backend: t10, attrs: { shape: p } }), f = W0({ inputs: { a: c, b: d }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(i), t10.disposeIntermediateTensorInfo(u), t10.disposeIntermediateTensorInfo(l), t10.disposeIntermediateTensorInfo(c), t10.disposeIntermediateTensorInfo(m), t10.disposeIntermediateTensorInfo(d), f; +} +var j3 = { kernelName: Fs, backendName: "webgl", kernelFunc: G0 }; +function gre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { logits: n } = e, { numSamples: s, seed: a, normalized: i } = o, p = i ? n : G0({ inputs: { logits: n }, backend: t10, attrs: { dim: n.shape.length - 1 } }), u = p.shape[0], l = p.shape[1], c = new Ng(u, l, s), m = [[a]], d = t10.runWebGLProgram(c, [p], "int32", m); + return i || t10.disposeIntermediateTensorInfo(p), d; +} +var X3 = { kernelName: ps, backendName: "webgl", kernelFunc: gre }; +var xre = Gt + ` return -x; `; -var Hee = ` +var yre = ` vec4 result = -x; bvec4 isNaN = isnan(x); @@ -23154,40 +23250,40 @@ var Hee = ` return result; `; -function Kee(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; - if (e.shouldExecuteOnCPU([o])) { - let s = e.texData.get(o.dataId), [a, i] = eD(s.values, o.shape, o.dtype); - return e.makeTensorInfo(i, o.dtype, a); +function bre(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; + if (t10.shouldExecuteOnCPU([o])) { + let s = t10.texData.get(o.dataId), [a, i] = HD(s.values, o.shape, o.dtype); + return t10.makeTensorInfo(i, o.dtype, a); } let n; - return A().getBool("WEBGL_PACK_UNARY_OPERATIONS") ? n = new Ar(o.shape, Hee) : n = new tr(o.shape, Gee), e.runWebGLProgram(n, [o], o.dtype); -} -var s3 = { kernelName: pa, backendName: "webgl", kernelFunc: Kee }; -var qee = Vt.nonMaxSuppressionV3Impl; -function jee(r15) { - w.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p } = o, u = e.readSync(n.dataId), c = e.readSync(s.dataId), { selectedIndices: l } = qee(u, c, a, i, p); - return e.makeTensorInfo([l.length], "int32", new Int32Array(l)); -} -var a3 = { kernelName: Qn, backendName: "webgl", kernelFunc: jee }; -var Xee = Vt.nonMaxSuppressionV4Impl; -function Yee(r15) { - w.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, padToMaxOutputSize: u } = o, c = e.readSync(n.dataId), l = e.readSync(s.dataId), { selectedIndices: m, validOutputs: d } = Xee(c, l, a, i, p, u); - return [e.makeTensorInfo([m.length], "int32", new Int32Array(m)), e.makeTensorInfo([], "int32", new Int32Array([d]))]; -} -var i3 = { kernelName: Qa, backendName: "webgl", kernelFunc: Yee }; -var Qee = Vt.nonMaxSuppressionV5Impl; -function Zee(r15) { - w.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, softNmsSigma: u } = o, c = e.readSync(n.dataId), l = e.readSync(s.dataId), m = a, d = i, f = p, h = u, { selectedIndices: g, selectedScores: x } = Qee(c, l, m, d, f, h); - return [e.makeTensorInfo([g.length], "int32", new Int32Array(g)), e.makeTensorInfo([x.length], "float32", new Float32Array(x))]; -} -var u3 = { kernelName: Zn, backendName: "webgl", kernelFunc: Zee }; -var hg = class { - constructor(t8, e, o, n) { - this.variableNames = ["indices"], this.outputShape = [t8, e], this.userCode = ` + return A().getBool("WEBGL_PACK_UNARY_OPERATIONS") ? n = new Lr(o.shape, yre) : n = new nr(o.shape, xre), t10.runWebGLProgram(n, [o], o.dtype); +} +var Y3 = { kernelName: ls, backendName: "webgl", kernelFunc: bre }; +var Cre = Ut.nonMaxSuppressionV3Impl; +function wre(r16) { + C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p } = o, u = t10.readSync(n.dataId), l = t10.readSync(s.dataId), { selectedIndices: c } = Cre(u, l, a, i, p); + return t10.makeTensorInfo([c.length], "int32", new Int32Array(c)); +} +var Q3 = { kernelName: cs, backendName: "webgl", kernelFunc: wre }; +var Sre = Ut.nonMaxSuppressionV4Impl; +function Ire(r16) { + C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, padToMaxOutputSize: u } = o, l = t10.readSync(n.dataId), c = t10.readSync(s.dataId), { selectedIndices: m, validOutputs: d } = Sre(l, c, a, i, p, u); + return [t10.makeTensorInfo([m.length], "int32", new Int32Array(m)), t10.makeTensorInfo([], "int32", new Int32Array([d]))]; +} +var Z3 = { kernelName: ni, backendName: "webgl", kernelFunc: Ire }; +var vre = Ut.nonMaxSuppressionV5Impl; +function kre(r16) { + C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, softNmsSigma: u } = o, l = t10.readSync(n.dataId), c = t10.readSync(s.dataId), m = a, d = i, f = p, h = u, { selectedIndices: g, selectedScores: x } = vre(l, c, m, d, f, h); + return [t10.makeTensorInfo([g.length], "int32", new Int32Array(g)), t10.makeTensorInfo([x.length], "float32", new Float32Array(x))]; +} +var J3 = { kernelName: ms, backendName: "webgl", kernelFunc: kre }; +var Tg = class { + constructor(e, t10, o, n) { + this.variableNames = ["indices"], this.outputShape = [e, t10], this.userCode = ` void main() { ivec2 coords = getOutputCoords(); int index = round(getIndices(coords.x)); @@ -23197,52 +23293,52 @@ var hg = class { `; } }; -var Jee = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { indices: n } = t8, { dtype: s, depth: a, onValue: i, offValue: p } = o, u = y.sizeFromShape(n.shape), c = new hg(u, a, i, p), l = te({ inputs: { x: n }, backend: e, attrs: { shape: [u] } }), m = e.runWebGLProgram(c, [l], s); - e.disposeIntermediateTensorInfo(l); - let d = [...n.shape, a], f = te({ inputs: { x: m }, backend: e, attrs: { shape: d } }); - return e.disposeIntermediateTensorInfo(m), f; +var Nre = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { indices: n } = e, { dtype: s, depth: a, onValue: i, offValue: p } = o, u = y.sizeFromShape(n.shape), l = new Tg(u, a, i, p), c = te({ inputs: { x: n }, backend: t10, attrs: { shape: [u] } }), m = t10.runWebGLProgram(l, [c], s); + t10.disposeIntermediateTensorInfo(c); + let d = [...n.shape, a], f = te({ inputs: { x: m }, backend: t10, attrs: { shape: d } }); + return t10.disposeIntermediateTensorInfo(m), f; }; -var p3 = { kernelName: Jn, backendName: "webgl", kernelFunc: Jee }; -function om(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; +var eP = { kernelName: ds, backendName: "webgl", kernelFunc: Nre }; +function mm(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; if (o.dtype === "complex64") { - let n = yi({ inputs: { input: o }, backend: e }), s = om({ inputs: { x: n }, backend: e }), a = wp({ inputs: { input: o }, backend: e }), i = om({ inputs: { x: a }, backend: e }), p = Pr({ inputs: { real: s, imag: i }, backend: e }); - return e.disposeIntermediateTensorInfo(n), e.disposeIntermediateTensorInfo(s), e.disposeIntermediateTensorInfo(a), e.disposeIntermediateTensorInfo(i), p; + let n = _i({ inputs: { input: o }, backend: t10 }), s = mm({ inputs: { x: n }, backend: t10 }), a = Ep({ inputs: { input: o }, backend: t10 }), i = mm({ inputs: { x: a }, backend: t10 }), p = zr({ inputs: { real: s, imag: i }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(n), t10.disposeIntermediateTensorInfo(s), t10.disposeIntermediateTensorInfo(a), t10.disposeIntermediateTensorInfo(i), p; } else - return bi({ attrs: { shape: o.shape, dtype: o.dtype, value: o.dtype === "string" ? "" : 0 }, backend: e }); + return Ei({ attrs: { shape: o.shape, dtype: o.dtype, value: o.dtype === "string" ? "" : 0 }, backend: t10 }); } -var c3 = { kernelName: Sa, backendName: "webgl", kernelFunc: om }; -function l3(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; +var tP = { kernelName: _a, backendName: "webgl", kernelFunc: mm }; +function rP(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; if (o.dtype === "string") throw new Error("onesLike is not supported under string dtype"); if (o.dtype === "complex64") { - let n = yi({ inputs: { input: o }, backend: e }), s = l3({ inputs: { x: n }, backend: e }), a = wp({ inputs: { input: o }, backend: e }), i = om({ inputs: { x: a }, backend: e }), p = Pr({ inputs: { real: s, imag: i }, backend: e }); - return e.disposeIntermediateTensorInfo(n), e.disposeIntermediateTensorInfo(s), e.disposeIntermediateTensorInfo(a), e.disposeIntermediateTensorInfo(i), p; + let n = _i({ inputs: { input: o }, backend: t10 }), s = rP({ inputs: { x: n }, backend: t10 }), a = Ep({ inputs: { input: o }, backend: t10 }), i = mm({ inputs: { x: a }, backend: t10 }), p = zr({ inputs: { real: s, imag: i }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(n), t10.disposeIntermediateTensorInfo(s), t10.disposeIntermediateTensorInfo(a), t10.disposeIntermediateTensorInfo(i), p; } else - return bi({ attrs: { shape: o.shape, dtype: o.dtype, value: 1 }, backend: e }); -} -var m3 = { kernelName: ca, backendName: "webgl", kernelFunc: l3 }; -function ete(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { axis: n } = o; - if (t8.length === 1) - return Jh({ inputs: { input: t8[0] }, backend: e, attrs: { dim: n } }); - let s = t8[0].shape, a = t8[0].dtype; - t8.forEach((c) => { - y.assertShapesMatch(s, c.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === c.dtype, () => "All tensors passed to stack must have matching dtypes"); + return Ei({ attrs: { shape: o.shape, dtype: o.dtype, value: 1 }, backend: t10 }); +} +var oP = { kernelName: xa, backendName: "webgl", kernelFunc: rP }; +function Tre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { axis: n } = o; + if (e.length === 1) + return cg({ inputs: { input: e[0] }, backend: t10, attrs: { dim: n } }); + let s = e[0].shape, a = e[0].dtype; + e.forEach((l) => { + y.assertShapesMatch(s, l.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === l.dtype, () => "All tensors passed to stack must have matching dtypes"); }); - let i = [], p = t8.map((c) => { - let l = Jh({ inputs: { input: c }, backend: e, attrs: { dim: n } }); - return i.push(l), l; - }), u = Iv({ inputs: p, backend: e, attrs: { axis: n } }); - return i.forEach((c) => e.disposeIntermediateTensorInfo(c)), u; + let i = [], p = e.map((l) => { + let c = cg({ inputs: { input: l }, backend: t10, attrs: { dim: n } }); + return i.push(c), c; + }), u = M0({ inputs: p, backend: t10, attrs: { axis: n } }); + return i.forEach((l) => t10.disposeIntermediateTensorInfo(l)), u; } -var d3 = { kernelName: la, backendName: "webgl", kernelFunc: ete }; -var gg = class { - constructor(t8, e, o) { - this.variableNames = ["x"], this.customUniforms = [{ name: "value", type: "float" }], this.outputShape = e.map((u, c) => u[0] + t8[c] + u[1]); - let n = t8.length, s = Re(n), a = e.map((u) => u[0]).join(","), i = e.map((u, c) => u[0] + t8[c]).join(","), p = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, n); +var nP = { kernelName: ya, backendName: "webgl", kernelFunc: Tre }; +var _g = class { + constructor(e, t10, o) { + this.variableNames = ["x"], this.customUniforms = [{ name: "value", type: "float" }], this.outputShape = t10.map((u, l) => u[0] + e[l] + u[1]); + let n = e.length, s = Re(n), a = t10.map((u) => u[0]).join(","), i = t10.map((u, l) => u[0] + e[l]).join(","), p = ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, n); if (n === 1) { this.userCode = ` int start = ${a}; @@ -23275,16 +23371,16 @@ var gg = class { `; } }; -var xg = class { - constructor(t8, e, o) { - this.variableNames = ["x"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "value", type: "float" }], this.outputShape = e.map((h, g) => h[0] + t8[g] + h[1]); - let n = t8.length, s = Re(n), a = e.map((h) => h[0]).join(","), i = e.map((h, g) => h[0] + t8[g]).join(","), p = Rt("rc", n), u = Rt("source", n), c = `${p[n - 1]} < ${this.outputShape[n - 1]}`, l = n === 1 ? "source" : `vec2(${u.slice(-2).join()})`, m = [`${s} rc = outputLoc;`, `${p[n - 1]} += 1; - if(${c}) { +var Eg = class { + constructor(e, t10, o) { + this.variableNames = ["x"], this.packedInputs = true, this.packedOutput = true, this.customUniforms = [{ name: "value", type: "float" }], this.outputShape = t10.map((h, g) => h[0] + e[g] + h[1]); + let n = e.length, s = Re(n), a = t10.map((h) => h[0]).join(","), i = t10.map((h, g) => h[0] + e[g]).join(","), p = At("rc", n), u = At("source", n), l = `${p[n - 1]} < ${this.outputShape[n - 1]}`, c = n === 1 ? "source" : `vec2(${u.slice(-2).join()})`, m = [`${s} rc = outputLoc;`, `${p[n - 1]} += 1; + if(${l}) { `, n === 1 ? "" : `} rc = outputLoc; ${p[n - 2]} += 1; if(${p[n - 2]} < ${this.outputShape[n - 2]}) {`, n === 1 ? "" : ` ${p[n - 1]} += 1; - if(${c}) {`], d = n === 1 ? "rc < start || rc >= end" : "any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))", f = ""; + if(${l}) {`], d = n === 1 ? "rc < start || rc >= end" : "any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))", f = ""; for (let h = 0, g = n === 1 ? 2 : 4; h < g; h++) f += ` ${m[h]} @@ -23292,7 +23388,7 @@ var xg = class { result[${h}] = float(value); } else { ${s} source = rc - start; - result[${h}] = getChannel(getX(${u.join()}), ${l}); + result[${h}] = getChannel(getX(${u.join()}), ${c}); } `; f += n === 1 ? "} " : "}}", this.userCode = ` @@ -23308,17 +23404,17 @@ var xg = class { `; } }; -var Rv = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { paddings: s, constantValue: a } = o; +var H0 = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { paddings: s, constantValue: a } = o; if (y.sizeFromShape(n.shape) === 0) { - let u = s.map((c, l) => c[0] + n.shape[l] + c[1]); - return bi({ backend: e, attrs: { shape: u, value: a, dtype: n.dtype } }); + let u = s.map((l, c) => l[0] + n.shape[c] + l[1]); + return Ei({ backend: t10, attrs: { shape: u, value: a, dtype: n.dtype } }); } - let i = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new xg(n.shape, s, a) : new gg(n.shape, s, a), p = [[a]]; - return e.runWebGLProgram(i, [n], n.dtype, p); + let i = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new Eg(n.shape, s, a) : new _g(n.shape, s, a), p = [[a]]; + return t10.runWebGLProgram(i, [n], n.dtype, p); }; -var f3 = { kernelName: es, backendName: "webgl", kernelFunc: Rv }; -var tte = ` +var sP = { kernelName: fs, backendName: "webgl", kernelFunc: H0 }; +var _re = ` if(a < 0.0 && floor(b) < b){ return NAN; } @@ -23328,7 +23424,7 @@ var tte = ` return (round(mod(b, 2.0)) != 1) ? pow(abs(a), b) : sign(a) * pow(abs(a), b); `; -var rte = ` +var Ere = ` // 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); @@ -23344,57 +23440,57 @@ var rte = ` bvec4 isNaN1 = lessThan(a, vec4(0.0)); bvec4 isNaN2 = lessThan(floor(b), b); bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w); - ` + jr + ` + ` + to + ` return result; `; -var ote = nt({ opSnippet: tte, packedOpSnippet: rte }); -var h3 = { kernelName: ts, backendName: "webgl", kernelFunc: ote }; -function nte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o, i = n.shape.length, p = [], u = y.parseAxisParam(s, n.shape), c = u, l = w.getAxesPermutation(c, i), m = n; - l != null && (m = bt({ inputs: { x: n }, backend: e, attrs: { perm: l } }), c = w.getInnerMostAxes(c.length, i), p.push(m)), w.assertAxesAreInnerMostDims("prod", c, i); +var $re = st({ opSnippet: _re, packedOpSnippet: Ere }); +var aP = { kernelName: hs, backendName: "webgl", kernelFunc: $re }; +function Rre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o, i = n.shape.length, p = [], u = y.parseAxisParam(s, n.shape), l = u, c = C.getAxesPermutation(l, i), m = n; + c != null && (m = Ct({ inputs: { x: n }, backend: t10, attrs: { perm: c } }), l = C.getInnerMostAxes(l.length, i), p.push(m)), C.assertAxesAreInnerMostDims("prod", l, i); let d; - if (e.shouldExecuteOnCPU([m])) { - let f = e.texData.get(m.dataId).values, { outVals: h, outShape: g, outDtype: x } = rD(m.shape, m.dtype, f, c); - d = e.makeTensorInfo(g, x, h); + if (t10.shouldExecuteOnCPU([m])) { + let f = t10.texData.get(m.dataId).values, { outVals: h, outShape: g, outDtype: x } = qD(m.shape, m.dtype, f, l); + d = t10.makeTensorInfo(g, x, h); } else { - let [f, h] = w.computeOutAndReduceShapes(m.shape, c), g = y.sizeFromShape(h), x = te({ inputs: { x: m }, backend: e, attrs: { shape: [-1, g] } }), b = oi(n.dtype), C = Xr(x, b, "prod", e); - d = te({ inputs: { x: C }, backend: e, attrs: { shape: f } }), p.push(x), p.push(C); + let [f, h] = C.computeOutAndReduceShapes(m.shape, l), g = y.sizeFromShape(h), x = te({ inputs: { x: m }, backend: t10, attrs: { shape: [-1, g] } }), b = mi(n.dtype), w = ro(x, b, "prod", t10); + d = te({ inputs: { x: w }, backend: t10, attrs: { shape: f } }), p.push(x), p.push(w); } if (a) { p.push(d); - let f = w.expandShapeToKeepDim(d.shape, u); - d = te({ inputs: { x: d }, backend: e, attrs: { shape: f } }); + let f = C.expandShapeToKeepDim(d.shape, u); + d = te({ inputs: { x: d }, backend: t10, attrs: { shape: f } }); } - return p.forEach((f) => e.disposeIntermediateTensorInfo(f)), d; + return p.forEach((f) => t10.disposeIntermediateTensorInfo(f)), d; } -var g3 = { kernelName: os, backendName: "webgl", kernelFunc: nte }; -function ste(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { paramsNestedSplits: n, paramsDenseValues: s, indices: a } = t8, { outputRaggedRank: i } = o, p = n.map((x) => e.readSync(x.dataId)), u = n.map((x) => x.shape), c = e.readSync(s.dataId), l = e.readSync(a.dataId), [m, d, f] = oD(p, u, c, s.shape, s.dtype, l, a.shape, i), h = m.map((x) => e.makeTensorInfo([x.length], "int32", x)), g = e.makeTensorInfo(f, s.dtype, d); +var iP = { kernelName: Ho, backendName: "webgl", kernelFunc: Rre }; +function Dre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { paramsNestedSplits: n, paramsDenseValues: s, indices: a } = e, { outputRaggedRank: i } = o, p = n.map((x) => t10.readSync(x.dataId)), u = n.map((x) => x.shape), l = t10.readSync(s.dataId), c = t10.readSync(a.dataId), [m, d, f] = jD(p, u, l, s.shape, s.dtype, c, a.shape, i), h = m.map((x) => t10.makeTensorInfo([x.length], "int32", x)), g = t10.makeTensorInfo(f, s.dtype, d); return h.concat([g]); } -var x3 = { kernelName: Up, backendName: "webgl", kernelFunc: ste }; -function ate(r15) { - let { inputs: t8, backend: e } = r15, { starts: o, limits: n, deltas: s } = t8, a = e.readSync(o.dataId), i = e.readSync(n.dataId), p = e.readSync(s.dataId), [u, c] = nD(a, o.shape, o.dtype, i, n.shape, p, s.shape), l = e.makeTensorInfo([u.length], "int32", u), m = e.makeTensorInfo([c.length], o.dtype, c); - return [l, m]; -} -var y3 = { kernelName: Gp, backendName: "webgl", kernelFunc: ate }; -function ite(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { shape: n, values: s, defaultValue: a, rowPartitionTensors: i } = t8, { rowPartitionTypes: p } = o, u = e.readSync(n.dataId), c = e.readSync(s.dataId), l = e.readSync(a.dataId), m = i.map((g) => e.readSync(g.dataId)), d = i.map((g) => g.shape), [f, h] = sD(u, n.shape, c, s.shape, s.dtype, l, a.shape, m, d, p); - return e.makeTensorInfo(f, s.dtype, h); -} -var b3 = { kernelName: Hp, backendName: "webgl", kernelFunc: ite }; -var Dv = (r15) => { - let { backend: t8, attrs: e } = r15, { start: o, stop: n, step: s, dtype: a } = e, i = aD(o, n, s, a); - return t8.makeTensorInfo([i.length], a, i); -}; -var C3 = { kernelName: ma, backendName: "webgl", kernelFunc: Dv }; -var ute = "return 1.0 / x;"; -var pte = xe({ opSnippet: ute }); -var w3 = { kernelName: ns, backendName: "webgl", kernelFunc: pte }; -var cte = Wt + ` +var uP = { kernelName: Qp, backendName: "webgl", kernelFunc: Dre }; +function Are(r16) { + let { inputs: e, backend: t10 } = r16, { starts: o, limits: n, deltas: s } = e, a = t10.readSync(o.dataId), i = t10.readSync(n.dataId), p = t10.readSync(s.dataId), [u, l] = XD(a, o.shape, o.dtype, i, n.shape, p, s.shape), c = t10.makeTensorInfo([u.length], "int32", u), m = t10.makeTensorInfo([l.length], o.dtype, l); + return [c, m]; +} +var pP = { kernelName: Zp, backendName: "webgl", kernelFunc: Are }; +function Fre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { shape: n, values: s, defaultValue: a, rowPartitionTensors: i } = e, { rowPartitionTypes: p } = o, u = t10.readSync(n.dataId), l = t10.readSync(s.dataId), c = t10.readSync(a.dataId), m = i.map((g) => t10.readSync(g.dataId)), d = i.map((g) => g.shape), [f, h] = YD(u, n.shape, l, s.shape, s.dtype, c, a.shape, m, d, p); + return t10.makeTensorInfo(f, s.dtype, h); +} +var lP = { kernelName: Jp, backendName: "webgl", kernelFunc: Fre }; +var K0 = (r16) => { + let { backend: e, attrs: t10 } = r16, { start: o, stop: n, step: s, dtype: a } = t10, i = QD(o, n, s, a); + return e.makeTensorInfo([i.length], a, i); +}; +var cP = { kernelName: ba, backendName: "webgl", kernelFunc: K0 }; +var Pre = "return 1.0 / x;"; +var Ore = xe({ opSnippet: Pre }); +var mP = { kernelName: xs, backendName: "webgl", kernelFunc: Ore }; +var Mre = Gt + ` return (x < 0.0) ? 0.0 : x; `; -var lte = ` +var Lre = ` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -23405,12 +23501,12 @@ var lte = ` return result; `; -var mte = xe({ opSnippet: cte, packedOpSnippet: lte }); -var S3 = { kernelName: ss, backendName: "webgl", kernelFunc: mte }; -var dte = Wt + ` +var Bre = xe({ opSnippet: Mre, packedOpSnippet: Lre }); +var dP = { kernelName: ys, backendName: "webgl", kernelFunc: Bre }; +var zre = Gt + ` return (x < 0.0) ? 0.0 : min(6.0, x); `; -var fte = ` +var Vre = ` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -23421,18 +23517,18 @@ var fte = ` return result; `; -var hte = xe({ opSnippet: dte, packedOpSnippet: fte }); -var I3 = { kernelName: us, backendName: "webgl", kernelFunc: hte }; -var yg = class { - constructor(t8, e, o, n, s) { +var Wre = xe({ opSnippet: zre, packedOpSnippet: Vre }); +var fP = { kernelName: ws, backendName: "webgl", kernelFunc: Wre }; +var $g = class { + constructor(e, t10, o, n, s) { this.variableNames = ["A"], this.outputShape = []; - let [a, i, p, u] = t8; - this.outputShape = [a, e, o, u]; - let c = [n && e > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], l = [n && e > 1 ? e - 1 : e, n && o > 1 ? o - 1 : o], m; + let [a, i, p, u] = e; + this.outputShape = [a, t10, o, u]; + let l = [n && t10 > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], c = [n && t10 > 1 ? t10 - 1 : t10, n && o > 1 ? o - 1 : o], m; s ? m = "(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)" : m = "vec2(yRC) * effectiveInputOverOutputRatioRC", this.userCode = ` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0] / l[0]}, - ${c[1] / l[1]}); + ${l[0] / c[0]}, + ${l[1] / c[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${p}.0); void main() { @@ -23465,17 +23561,17 @@ var yg = class { `; } }; -var bg = class { - constructor(t8, e, o, n, s) { +var Rg = class { + constructor(e, t10, o, n, s) { this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.outputShape = []; - let [a, i, p, u] = t8; - this.outputShape = [a, e, o, u]; - let c = [n && e > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], l = [n && e > 1 ? e - 1 : e, n && o > 1 ? o - 1 : o], m; + let [a, i, p, u] = e; + this.outputShape = [a, t10, o, u]; + let l = [n && t10 > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], c = [n && t10 > 1 ? t10 - 1 : t10, n && o > 1 ? o - 1 : o], m; s ? m = "(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)" : m = "vec3(yRC) * effectiveInputOverOutputRatioRC", this.userCode = ` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${c[0] / l[0]}, - ${c[1] / l[1]}, - ${c[1] / l[1]}); + ${l[0] / c[0]}, + ${l[1] / c[1]}, + ${l[1] / c[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${p}.0, ${p}.0); @@ -23551,15 +23647,15 @@ var bg = class { `; } }; -function gte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n } = t8, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, c = A().getBool("WEBGL_PACK_IMAGE_OPERATIONS") ? new bg(n.shape, p, u, s, a) : new yg(n.shape, p, u, s, a); - return e.runWebGLProgram(c, [n], "float32"); +function Ure(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n } = e, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, l = A().getBool("WEBGL_PACK_IMAGE_OPERATIONS") ? new Rg(n.shape, p, u, s, a) : new $g(n.shape, p, u, s, a); + return t10.runWebGLProgram(l, [n], "float32"); } -var v3 = { kernelName: is, backendName: "webgl", kernelFunc: gte }; -var Cg = class { - constructor(t8, e, o) { - this.variableNames = ["dy"], this.outputShape = [], this.outputShape = e; - let [, n, s] = e, [, a, i] = t8, p = [o && a > 1 ? n - 1 : n, o && i > 1 ? s - 1 : s], u = [o && a > 1 ? a - 1 : a, o && i > 1 ? i - 1 : i], c = p[0] / u[0], l = p[1] / u[1], m = 1 / c, d = 1 / l, f = Math.ceil(m) * 2 + 2, h = Math.ceil(d) * 2 + 2; +var hP = { kernelName: Cs, backendName: "webgl", kernelFunc: Ure }; +var Dg = class { + constructor(e, t10, o) { + this.variableNames = ["dy"], this.outputShape = [], this.outputShape = t10; + let [, n, s] = t10, [, a, i] = e, p = [o && a > 1 ? n - 1 : n, o && i > 1 ? s - 1 : s], u = [o && a > 1 ? a - 1 : a, o && i > 1 ? i - 1 : i], l = p[0] / u[0], c = p[1] / u[1], m = 1 / l, d = 1 / c, f = Math.ceil(m) * 2 + 2, h = Math.ceil(d) * 2 + 2; this.userCode = ` void main() { ivec4 coords = getOutputCoords(); @@ -23570,8 +23666,8 @@ var Cg = class { float accumulator = 0.0; - const float heightScale = float(${c}); - const float widthScale = float(${l}); + const float heightScale = float(${l}); + const float widthScale = float(${c}); const float invHeightScale = float(${m}); const float invWidthScale = float(${d}); @@ -23644,21 +23740,21 @@ var Cg = class { `; } }; -function xte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o, i = new Cg(s.shape, n.shape, a); - return e.runWebGLProgram(i, [s], s.dtype); +function Gre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o, i = new Dg(s.shape, n.shape, a); + return t10.runWebGLProgram(i, [s], s.dtype); } -var k3 = { kernelName: Ja, backendName: "webgl", kernelFunc: xte }; -var wg = class { - constructor(t8, e, o, n, s) { +var gP = { kernelName: ii, backendName: "webgl", kernelFunc: Gre }; +var Ag = class { + constructor(e, t10, o, n, s) { this.variableNames = ["A"], this.outputShape = []; - let [a, i, p, u] = t8; - this.outputShape = [a, e, o, u]; - let c = [n && e > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], l = [n && e > 1 ? e - 1 : e, n && o > 1 ? o - 1 : o], m = n ? "0.5" : "0.0", d; + let [a, i, p, u] = e; + this.outputShape = [a, t10, o, u]; + let l = [n && t10 > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], c = [n && t10 > 1 ? t10 - 1 : t10, n && o > 1 ? o - 1 : o], m = n ? "0.5" : "0.0", d; s ? d = "max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))" : d = "vec2(yRC) * effectiveInputOverOutputRatioRC", this.userCode = ` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0] / l[0]}, - ${c[1] / l[1]}); + ${l[0] / c[0]}, + ${l[1] / c[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${p}.0); void main() { @@ -23680,17 +23776,17 @@ var wg = class { `; } }; -var Sg = class { - constructor(t8, e, o, n, s) { +var Fg = class { + constructor(e, t10, o, n, s) { this.variableNames = ["A"], this.packedInputs = true, this.packedOutput = true, this.outputShape = []; - let [a, i, p, u] = t8; - this.outputShape = [a, e, o, u]; - let c = [n && e > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], l = [n && e > 1 ? e - 1 : e, n && o > 1 ? o - 1 : o], m = n ? "0.5" : "0.0", d; + let [a, i, p, u] = e; + this.outputShape = [a, t10, o, u]; + let l = [n && t10 > 1 ? i - 1 : i, n && o > 1 ? p - 1 : p], c = [n && t10 > 1 ? t10 - 1 : t10, n && o > 1 ? o - 1 : o], m = n ? "0.5" : "0.0", d; s ? d = "max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))" : d = "vec3(yRC) * effectiveInputOverOutputRatioRC", this.userCode = ` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${c[0] / l[0]}, - ${c[1] / l[1]}, - ${c[1] / l[1]}); + ${l[0] / c[0]}, + ${l[1] / c[1]}, + ${l[1] / c[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${p}.0, ${p}.0); @@ -23730,15 +23826,15 @@ var Sg = class { `; } }; -function yte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n } = t8, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, c = A().getBool("WEBGL_PACK_IMAGE_OPERATIONS") ? new Sg(n.shape, p, u, s, a) : new wg(n.shape, p, u, s, a); - return e.runWebGLProgram(c, [n], n.dtype); +function Hre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n } = e, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, l = A().getBool("WEBGL_PACK_IMAGE_OPERATIONS") ? new Fg(n.shape, p, u, s, a) : new Ag(n.shape, p, u, s, a); + return t10.runWebGLProgram(l, [n], n.dtype); } -var N3 = { kernelName: as, backendName: "webgl", kernelFunc: yte }; -var Ig = class { - constructor(t8, e, o) { - this.variableNames = ["dy"], this.outputShape = [], this.outputShape = e; - let [, n, s] = e, [, a, i] = t8, p = [o && a > 1 ? n - 1 : n, o && i > 1 ? s - 1 : s], u = [o && a > 1 ? a - 1 : a, o && i > 1 ? i - 1 : i], c = p[0] / u[0], l = p[1] / u[1], m = 1 / c, d = 1 / l, f = Math.ceil(m) * 2 + 2, h = Math.ceil(d) * 2 + 2; +var xP = { kernelName: bs, backendName: "webgl", kernelFunc: Hre }; +var Pg = class { + constructor(e, t10, o) { + this.variableNames = ["dy"], this.outputShape = [], this.outputShape = t10; + let [, n, s] = t10, [, a, i] = e, p = [o && a > 1 ? n - 1 : n, o && i > 1 ? s - 1 : s], u = [o && a > 1 ? a - 1 : a, o && i > 1 ? i - 1 : i], l = p[0] / u[0], c = p[1] / u[1], m = 1 / l, d = 1 / c, f = Math.ceil(m) * 2 + 2, h = Math.ceil(d) * 2 + 2; this.userCode = ` void main() { ivec4 coords = getOutputCoords(); @@ -23749,8 +23845,8 @@ var Ig = class { float accumulator = 0.0; - const float heightScale = float(${c}); - const float widthScale = float(${l}); + const float heightScale = float(${l}); + const float widthScale = float(${c}); const float invHeightScale = float(${m}); const float invWidthScale = float(${d}); @@ -23812,27 +23908,27 @@ var Ig = class { `; } }; -function bte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o, i = new Ig(s.shape, n.shape, a); - return e.runWebGLProgram(i, [s], s.dtype); +function Kre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o, i = new Pg(s.shape, n.shape, a); + return t10.runWebGLProgram(i, [s], s.dtype); } -var T3 = { kernelName: Za, backendName: "webgl", kernelFunc: bte }; -var vg = class { - constructor(t8, e) { +var yP = { kernelName: ai, backendName: "webgl", kernelFunc: Kre }; +var Og = class { + constructor(e, t10) { this.variableNames = ["x"]; - let o = t8.length; + let o = e.length; if (o > 4) throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`); - if (this.outputShape = t8, o === 1) { + if (this.outputShape = e, o === 1) { this.userCode = ` void main() { int coord = getOutputCoords(); - setOutput(getX(${t8[0]} - coord - 1)); + setOutput(getX(${e[0]} - coord - 1)); } `; return; } - let n = (i) => e.indexOf(i) !== -1 && t8[i] !== 1 ? `${t8[i]} - coords[${i}] - 1` : `coords[${i}]`, s = t8.map((i, p) => n(p)).join(","), a = Re(o); + let n = (i) => t10.indexOf(i) !== -1 && e[i] !== 1 ? `${e[i]} - coords[${i}] - 1` : `coords[${i}]`, s = e.map((i, p) => n(p)).join(","), a = Re(o); this.userCode = ` void main() { ${a} coords = getOutputCoords(); @@ -23841,23 +23937,23 @@ var vg = class { `; } }; -var kg = class { - constructor(t8, e) { +var Mg = class { + constructor(e, t10) { this.variableNames = ["x"], this.packedInputs = true, this.packedOutput = true; - let o = t8.length; + let o = e.length; if (o > 4) throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`); - this.outputShape = t8; - let n = Rt("rc", o), s = `${n[o - 1]} + 1 < ${this.outputShape[o - 1]}`, a = `${n[o - 2]} + 1 < ${this.outputShape[o - 2]}`, i = Re(o); + this.outputShape = e; + let n = At("rc", o), s = `${n[o - 1]} + 1 < ${this.outputShape[o - 1]}`, a = `${n[o - 2]} + 1 < ${this.outputShape[o - 2]}`, i = Re(o); o === 1 ? this.userCode = ` void main(){ int rc = getOutputCoords(); vec4 result = vec4(0.); - result.r = getChannel(getX(${t8[0]} - rc - 1), - ${t8[0]} - rc - 1); + result.r = getChannel(getX(${e[0]} - rc - 1), + ${e[0]} - rc - 1); if(${s}){ - result.g = getChannel(getX(${t8[0]} - (rc + 1) - 1), - ${t8[0]} - (rc + 1) - 1); + result.g = getChannel(getX(${e[0]} - (rc + 1) - 1), + ${e[0]} - (rc + 1) - 1); } setOutput(result); } @@ -23870,9 +23966,9 @@ var kg = class { result.g = ${u(n.slice())}; } if(${a}) { - result.b = ${c(n.slice())}; + result.b = ${l(n.slice())}; if(${s}) { - result.a = ${l(n.slice())}; + result.a = ${c(n.slice())}; } } setOutput(result); @@ -23884,37 +23980,37 @@ var kg = class { function u(f) { return f[o - 1] = "(" + f[o - 1] + " + 1)", m(f); } - function c(f) { + function l(f) { return f[o - 2] = "(" + f[o - 2] + " + 1)", m(f); } - function l(f) { + function c(f) { return f[o - 1] = "(" + f[o - 1] + " + 1)", f[o - 2] = "(" + f[o - 2] + " + 1)", m(f); } function m(f) { - let h = t8.map((b, C) => d(C, f)), g = h.join(","), x = h.slice(-2).join(","); + let h = e.map((b, w) => d(w, f)), g = h.join(","), x = h.slice(-2).join(","); return `getChannel(getX(${g}), vec2(${x}))`; } function d(f, h) { - return e.indexOf(f) !== -1 && t8[f] !== 1 ? `${t8[f]} - ${h[f]} - 1` : `${h[f]}`; + return t10.indexOf(f) !== -1 && e[f] !== 1 ? `${e[f]} - ${h[f]} - 1` : `${h[f]}`; } } }; -function Cte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { dims: s } = o, a = n.shape.length, i = y.parseAxisParam(s, n.shape); +function qre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dims: s } = o, a = n.shape.length, i = y.parseAxisParam(s, n.shape); if (a === 0) - return Dt({ inputs: { x: n }, backend: e }); - let p = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new kg(n.shape, i) : new vg(n.shape, i); - return e.runWebGLProgram(p, [n], n.dtype); + return Ft({ inputs: { x: n }, backend: t10 }); + let p = A().getBool("WEBGL_PACK_ARRAY_OPERATIONS") ? new Mg(n.shape, i) : new Og(n.shape, i); + return t10.runWebGLProgram(p, [n], n.dtype); } -var _3 = { kernelName: ps, backendName: "webgl", kernelFunc: Cte }; -var Ng = class { - constructor(t8, e) { +var bP = { kernelName: Ss, backendName: "webgl", kernelFunc: qre }; +var Lg = class { + constructor(e, t10) { this.variableNames = ["Image"], this.outputShape = [], this.customUniforms = [{ name: "params", type: "vec4" }]; - let o = t8[1], n = t8[2]; - this.outputShape = t8; + let o = e[1], n = e[2]; + this.outputShape = e; let s = ""; - typeof e == "number" ? s = `float outputValue = ${e.toFixed(2)};` : s = ` - vec3 fill = vec3(${e.join(",")}); + typeof t10 == "number" ? s = `float outputValue = ${t10.toFixed(2)};` : s = ` + vec3 fill = vec3(${t10.join(",")}); float outputValue = fill[coords[3]];`, this.userCode = ` void main() { ivec4 coords = getOutputCoords(); @@ -23935,11 +24031,11 @@ var Ng = class { `; } }; -var $3 = { kernelName: Ds, backendName: "webgl", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { image: o } = r15, { radians: n, fillValue: s, center: a } = t8, i = e, p = new Ng(o.shape, s), [u, c] = w.getImageCenter(a, o.shape[1], o.shape[2]), l = [[u, c, Math.sin(n), Math.cos(n)]]; - return i.runWebGLProgram(p, [o], o.dtype, l); +var CP = { kernelName: Vs, backendName: "webgl", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { image: o } = r16, { radians: n, fillValue: s, center: a } = e, i = t10, p = new Lg(o.shape, s), [u, l] = C.getImageCenter(a, o.shape[1], o.shape[2]), c = [[u, l, Math.sin(n), Math.cos(n)]]; + return i.runWebGLProgram(p, [o], o.dtype, c); } }; -var wte = ` +var jre = ` // OpenGL ES does not support round function. // The algorithm is based on banker's rounding. float base = floor(x); @@ -23955,31 +24051,31 @@ var wte = ` } } `; -var Ste = xe({ opSnippet: wte }); -var E3 = { kernelName: cs, backendName: "webgl", kernelFunc: Ste }; -var Ite = "return inversesqrt(x);"; -var vte = xe({ opSnippet: Ite, cpuKernelImpl: iD }); -var R3 = { kernelName: ls, backendName: "webgl", kernelFunc: vte }; -var yu = class { - constructor(t8, e, o, n, s, a, i = true, p = false) { +var Xre = xe({ opSnippet: jre }); +var wP = { kernelName: Is, backendName: "webgl", kernelFunc: Xre }; +var Yre = "return inversesqrt(x);"; +var Qre = xe({ opSnippet: Yre, cpuKernelImpl: ZD }); +var SP = { kernelName: Do, backendName: "webgl", kernelFunc: Qre }; +var Tu = class { + constructor(e, t10, o, n, s, a, i = true, p = false) { this.variableNames = ["updates", "indices", "defaultValue"], this.outputShape = a; - let u = Re(s.length), c = Re(a.length), l = ""; - o === 1 ? l = "i" : o === 2 && (l = "i, j"); - let m = `getIndices(${l})`, d = ""; + let u = Re(s.length), l = Re(a.length), c = ""; + o === 1 ? c = "i" : o === 2 && (c = "i, j"); + let m = `getIndices(${c})`, d = ""; n === 1 ? d = "i" : n === 2 && (d = "i, coords[1]"); let f = `getUpdates(${d})`, h = ""; p && (h = "coords[0], coords[1]"); - let g = `getDefaultValue(${h})`, x = e > 1 ? "strides[j]" : "strides"; + let g = `getDefaultValue(${h})`, x = t10 > 1 ? "strides[j]" : "strides"; this.userCode = ` ${u} strides = ${u}(${s}); void main() { - ${c} coords = getOutputCoords(); + ${l} coords = getOutputCoords(); float sum = 0.0; bool found = false; - for (int i = 0; i < ${t8}; i++) { + for (int i = 0; i < ${e}; i++) { int flattenedIndex = 0; - for (int j = 0; j < ${e}; j++) { + for (int j = 0; j < ${t10}; j++) { int index = round(${m}); flattenedIndex += index * ${x}; } @@ -23993,29 +24089,29 @@ var yu = class { `; } }; -var Tg = class { - constructor(t8, e, o, n, s, a, i = true, p = false) { +var Bg = class { + constructor(e, t10, o, n, s, a, i = true, p = false) { this.variableNames = ["updates", "indices", "defaultValue"], this.packedInputs = true, this.packedOutput = true, this.outputShape = a; - let u = Re(s.length), c = Re(a.length), l = ""; - o === 1 ? l = "i" : o === 2 && (l = "i, j"); - let m = `getIndices(${l})`, d = ""; + let u = Re(s.length), l = Re(a.length), c = ""; + o === 1 ? c = "i" : o === 2 && (c = "i, j"); + let m = `getIndices(${c})`, d = ""; n === 1 ? d = "i" : n === 2 && (d = "i, coords[1]"); let f = `getUpdates(${d})`, h = ""; p && (h = "coords[0], coords[1]"); - let g = `getDefaultValue(${h})`, x = e > 1 ? "strides[j]" : "strides", b = e > 1 ? "strides[j + 1]" : "strides"; + let g = `getDefaultValue(${h})`, x = t10 > 1 ? "strides[j]" : "strides", b = t10 > 1 ? "strides[j + 1]" : "strides"; this.userCode = ` ${u} strides = ${u}(${s}); void main() { - ${c} coords = getOutputCoords(); + ${l} coords = getOutputCoords(); vec4 sum = vec4(0.); vec4 found = vec4(0.); - for (int i = 0; i < ${t8}; i+=2) { + for (int i = 0; i < ${e}; i+=2) { ivec2 flattenedIndex = ivec2(0); - for (int j = 0; j < ${e}; j+=2) { + for (int j = 0; j < ${t10}; j+=2) { ivec4 index = round(${m}); flattenedIndex += index.xz * ${x}; - if (j + 1 < ${e}) { + if (j + 1 < ${t10}) { flattenedIndex += index.yw * ${b}; } } @@ -24043,20 +24139,20 @@ var Tg = class { `; } }; -function kte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { indices: n, updates: s } = t8, { shape: a } = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: c, outputSize: l } = w.calculateShapes(s, n, a), m = [l / u, u]; - if (l === 0) - return e.makeTensorInfo(a, n.dtype); - let d = te({ inputs: { x: n }, backend: e, attrs: { shape: [p, i] } }), f = te({ inputs: { x: s }, backend: e, attrs: { shape: [p, u] } }), h = e.makeTensorInfo([], "float32", new Float32Array([0])), g; - A().getBool("WEBGL_PACK") ? g = new Tg(p, i, d.shape.length, f.shape.length, c, m) : g = new yu(p, i, d.shape.length, f.shape.length, c, m); - let x = e.runWebGLProgram(g, [f, d, h], f.dtype), b = te({ inputs: { x }, backend: e, attrs: { shape: a } }); - return e.disposeIntermediateTensorInfo(d), e.disposeIntermediateTensorInfo(f), e.disposeIntermediateTensorInfo(x), e.disposeIntermediateTensorInfo(h), b; -} -var D3 = { kernelName: ms, backendName: "webgl", kernelFunc: kte }; -var _g = class { - constructor(t8, e, o, n) { - this.variableNames = ["sortedSequence", "values"], this.customUniforms = [{ name: "numInputs", type: "int" }], this.outputShape = [t8, o]; - let s = "while (left < right) {", a = `for (int i = 0; i < ${Math.ceil(Math.log2(e + 1))}; ++i) { if (left >= right) break;`, i = A().getNumber("WEBGL_VERSION") === 2 ? s : a, p = n === "left" ? "<" : "<="; +function Zre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { indices: n, updates: s } = e, { shape: a } = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: l, outputSize: c } = C.calculateShapes(s, n, a), m = [c / u, u]; + if (c === 0) + return t10.makeTensorInfo(a, n.dtype); + let d = te({ inputs: { x: n }, backend: t10, attrs: { shape: [p, i] } }), f = te({ inputs: { x: s }, backend: t10, attrs: { shape: [p, u] } }), h = t10.makeTensorInfo([], "float32", new Float32Array([0])), g; + A().getBool("WEBGL_PACK") ? g = new Bg(p, i, d.shape.length, f.shape.length, l, m) : g = new Tu(p, i, d.shape.length, f.shape.length, l, m); + let x = t10.runWebGLProgram(g, [f, d, h], f.dtype), b = te({ inputs: { x }, backend: t10, attrs: { shape: a } }); + return t10.disposeIntermediateTensorInfo(d), t10.disposeIntermediateTensorInfo(f), t10.disposeIntermediateTensorInfo(x), t10.disposeIntermediateTensorInfo(h), b; +} +var IP = { kernelName: vs, backendName: "webgl", kernelFunc: Zre }; +var zg = class { + constructor(e, t10, o, n) { + this.variableNames = ["sortedSequence", "values"], this.customUniforms = [{ name: "numInputs", type: "int" }], this.outputShape = [e, o]; + let s = "while (left < right) {", a = `for (int i = 0; i < ${Math.ceil(Math.log2(t10 + 1))}; ++i) { if (left >= right) break;`, i = A().getNumber("WEBGL_VERSION") === 2 ? s : a, p = n === "left" ? "<" : "<="; this.userCode = ` int findBound(int batch, float value) { int left = 0; @@ -24085,14 +24181,14 @@ var _g = class { `; } }; -function Nte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { sortedSequence: n, values: s } = t8, { side: a } = o, i = new _g(n.shape[0], n.shape[1], s.shape[1], a), p = [[n.shape[1]]]; - return e.runWebGLProgram(i, [n, s], "int32", p); +function Jre(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { sortedSequence: n, values: s } = e, { side: a } = o, i = new zg(n.shape[0], n.shape[1], s.shape[1], a), p = [[n.shape[1]]]; + return t10.runWebGLProgram(i, [n, s], "int32", p); } -var A3 = { kernelName: fs, backendName: "webgl", kernelFunc: Nte }; -var $g = class { - constructor(t8, e, o) { - this.variableNames = ["c", "a", "b"], this.outputShape = e; +var vP = { kernelName: Ns, backendName: "webgl", kernelFunc: Jre }; +var Vg = class { + constructor(e, t10, o) { + this.variableNames = ["c", "a", "b"], this.outputShape = t10; let n, s; if (o > 4) throw Error(`Where for rank ${o} is not yet supported`); @@ -24100,8 +24196,8 @@ var $g = class { s = "resRC", n = "resRC"; else { let i = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], p = [], u = []; - for (let c = 0; c < e.length; c++) - u.push(`${i[c]}`), c < t8 && p.push(`${i[c]}`); + for (let l = 0; l < t10.length; l++) + u.push(`${i[l]}`), l < e && p.push(`${i[l]}`); n = p.join(), s = u.join(); } let a = Re(o); @@ -24118,24 +24214,24 @@ var $g = class { `; } }; -function Tte(r15) { - let { inputs: t8, backend: e } = r15, { condition: o, t: n, e: s } = t8, a = new $g(o.shape.length, n.shape, n.shape.length); - return e.runWebGLProgram(a, [o, n, s], dt(n.dtype, s.dtype)); +function eoe(r16) { + let { inputs: e, backend: t10 } = r16, { condition: o, t: n, e: s } = e, a = new Vg(o.shape.length, n.shape, n.shape.length); + return t10.runWebGLProgram(a, [o, n, s], pt(n.dtype, s.dtype)); } -var F3 = { kernelName: fa, backendName: "webgl", kernelFunc: Tte }; -var _te = ` +var kP = { kernelName: wa, backendName: "webgl", kernelFunc: eoe }; +var toe = ` // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. // see: https://arxiv.org/abs/1706.02515 - float scaleAlpha = ${w.SELU_SCALEALPHA}; - float scale = ${w.SELU_SCALE}; + float scaleAlpha = ${C.SELU_SCALEALPHA}; + float scale = ${C.SELU_SCALE}; return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); `; -var $te = xe({ opSnippet: _te }); -var P3 = { kernelName: hs, backendName: "webgl", kernelFunc: $te }; -var Ete = Fo + ` +var roe = xe({ opSnippet: toe }); +var NP = { kernelName: Ts, backendName: "webgl", kernelFunc: roe }; +var ooe = sn + ` return 1.0 / (1.0 + exp(-1.0 * x)); `; -var Rte = ` +var noe = ` vec4 result = 1.0 / (1.0 + exp(-1.0 * x)); bvec4 isNaN = isnan(x); @@ -24146,32 +24242,32 @@ var Rte = ` return result; `; -var Dte = xe({ opSnippet: Ete, packedOpSnippet: Rte, cpuKernelImpl: pD }); -var O3 = { kernelName: bs, backendName: "webgl", kernelFunc: Dte }; -var Ate = ` +var soe = xe({ opSnippet: ooe, packedOpSnippet: noe, cpuKernelImpl: eA }); +var TP = { kernelName: Ao, backendName: "webgl", kernelFunc: soe }; +var aoe = ` if (isnan(x)) { return 0.0; } return sign(x); `; -var Fte = xe({ opSnippet: Ate }); -var M3 = { kernelName: ys, backendName: "webgl", kernelFunc: Fte }; -var Pte = Fo + ` +var ioe = xe({ opSnippet: aoe }); +var _P = { kernelName: Rs, backendName: "webgl", kernelFunc: ioe }; +var uoe = sn + ` return sin(x); `; -var Ote = ` +var poe = ` vec4 result = sin(x); bvec4 isNaN = isnan(x); - ${jr} + ${to} return result; `; -var Mte = xe({ opSnippet: Pte, packedOpSnippet: Ote }); -var L3 = { kernelName: gs, backendName: "webgl", kernelFunc: Mte }; -var Lte = ` +var loe = xe({ opSnippet: uoe, packedOpSnippet: poe }); +var EP = { kernelName: Es, backendName: "webgl", kernelFunc: loe }; +var coe = ` float e2x = exp(x); return (e2x - 1.0 / e2x) / 2.0; `; -var Bte = xe({ opSnippet: Lte }); -var B3 = { kernelName: xs, backendName: "webgl", kernelFunc: Bte }; -var zte = ` +var moe = xe({ opSnippet: coe }); +var $P = { kernelName: $s, backendName: "webgl", kernelFunc: moe }; +var doe = ` float epsilon = 1.1920928955078125e-7; float threshold = log(epsilon) + 2.0; @@ -24192,21 +24288,21 @@ var zte = ` } return result; `; -var Vte = xe({ opSnippet: zte }); -var z3 = { kernelName: Cs, backendName: "webgl", kernelFunc: Vte }; -var Wte = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, paddings: a } = o; +var foe = xe({ opSnippet: doe }); +var RP = { kernelName: Ds, backendName: "webgl", kernelFunc: foe }; +var hoe = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, paddings: a } = o; y.assert(n.shape.length <= 4, () => "spaceToBatchND for rank > 4 with a WebGL backend not implemented yet"); let i = s.reduce((x, b) => x * b), p = [[0, 0]]; p.push(...a); for (let x = 1 + s.length; x < n.shape.length; ++x) p.push([0, 0]); - let u = [], c = Rv({ inputs: { x: n }, backend: e, attrs: { paddings: p, constantValue: 0 } }), l = w.getReshaped(c.shape, s, i, false), m = w.getPermuted(l.length, s.length, false), d = w.getReshapedPermuted(c.shape, s, i, false), f = te({ inputs: { x: c }, backend: e, attrs: { shape: l } }), h = bt({ inputs: { x: f }, backend: e, attrs: { perm: m } }), g = te({ inputs: { x: h }, backend: e, attrs: { shape: d } }); - return u.push(c), u.push(f), u.push(h), u.forEach((x) => e.disposeIntermediateTensorInfo(x)), g; + let u = [], l = H0({ inputs: { x: n }, backend: t10, attrs: { paddings: p, constantValue: 0 } }), c = C.getReshaped(l.shape, s, i, false), m = C.getPermuted(c.length, s.length, false), d = C.getReshapedPermuted(l.shape, s, i, false), f = te({ inputs: { x: l }, backend: t10, attrs: { shape: c } }), h = Ct({ inputs: { x: f }, backend: t10, attrs: { perm: m } }), g = te({ inputs: { x: h }, backend: t10, attrs: { shape: d } }); + return u.push(l), u.push(f), u.push(h), u.forEach((x) => t10.disposeIntermediateTensorInfo(x)), g; }; -var V3 = { kernelName: ga, backendName: "webgl", kernelFunc: Wte }; -function Ute(r15) { - let { inputs: t8, backend: e } = r15, { indices: o, values: n, denseShape: s, defaultValue: a } = t8; +var DP = { kernelName: Sa, backendName: "webgl", kernelFunc: hoe }; +function goe(r16) { + let { inputs: e, backend: t10 } = r16, { indices: o, values: n, denseShape: s, defaultValue: a } = e; if (s.shape.length !== 1) throw new Error(`Dense shape must be a vector, saw: ${s.shape}`); @@ -24219,24 +24315,24 @@ function Ute(r15) { if (a.shape.length !== 0) throw new Error(`Default value must be a scalar, saw: ${a.shape}`); - let i = e.readSync(o.dataId), p = e.readSync(n.dataId), u = e.readSync(s.dataId), c = e.readSync(a.dataId)[0], [l, m, d, f, h] = lD(i, o.shape, o.dtype, p, n.dtype, u, c); - return [e.makeTensorInfo(m, o.dtype, l), e.makeTensorInfo([m[0]], n.dtype, d), e.makeTensorInfo([f.length], "bool", new Uint8Array(f.map((g) => Number(g)))), e.makeTensorInfo([h.length], o.dtype, new Int32Array(h))]; + let i = t10.readSync(o.dataId), p = t10.readSync(n.dataId), u = t10.readSync(s.dataId), l = t10.readSync(a.dataId)[0], [c, m, d, f, h] = rA(i, o.shape, o.dtype, p, n.dtype, u, l); + return [t10.makeTensorInfo(m, o.dtype, c), t10.makeTensorInfo([m[0]], n.dtype, d), t10.makeTensorInfo([f.length], "bool", new Uint8Array(f.map((g) => Number(g)))), t10.makeTensorInfo([h.length], o.dtype, new Int32Array(h))]; } -var W3 = { kernelName: Hi, backendName: "webgl", kernelFunc: Ute }; -function Gte(r15) { - let { inputs: t8, backend: e } = r15, { inputIndices: o, inputShape: n, newShape: s } = t8; +var AP = { kernelName: eu, backendName: "webgl", kernelFunc: goe }; +function xoe(r16) { + let { inputs: e, backend: t10 } = r16, { inputIndices: o, inputShape: n, newShape: s } = e; if (o.shape.length !== 2) throw new Error(`Input indices should be a matrix but received shape ${o.shape}`); if (n.shape.length !== 1) throw new Error(`Input shape should be a vector but received shape ${n.shape}`); if (s.shape.length !== 1) throw new Error(`Target shape should be a vector but received shape ${s.shape}`); - let a = Array.from(e.readSync(n.dataId)), i = e.readSync(o.dataId), p = Array.from(e.readSync(s.dataId)), [u, c, l] = mD(i, o.shape, o.dtype, a, p); - return [e.makeTensorInfo(c, o.dtype, u), e.makeTensorInfo([l.length], s.dtype, new Int32Array(l))]; + let a = Array.from(t10.readSync(n.dataId)), i = t10.readSync(o.dataId), p = Array.from(t10.readSync(s.dataId)), [u, l, c] = oA(i, o.shape, o.dtype, a, p); + return [t10.makeTensorInfo(l, o.dtype, u), t10.makeTensorInfo([c.length], s.dtype, new Int32Array(c))]; } -var U3 = { kernelName: ei, backendName: "webgl", kernelFunc: Gte }; -function Hte(r15) { - let { inputs: t8, backend: e } = r15, { data: o, indices: n, segmentIds: s } = t8; +var FP = { kernelName: ui, backendName: "webgl", kernelFunc: xoe }; +function yoe(r16) { + let { inputs: e, backend: t10 } = r16, { data: o, indices: n, segmentIds: s } = e; if (o.shape.length < 1) throw new Error("Data should be at least 1 dimensional but received scalar"); if (n.shape.length !== 1) @@ -24245,12 +24341,12 @@ function Hte(r15) { if (s.shape.length !== 1) throw new Error(`Segment ids should be a vector but received shape ${s.shape}`); - let a = e.readSync(o.dataId), i = e.readSync(n.dataId), p = e.readSync(s.dataId), [u, c] = ch(a, o.shape, o.dtype, i, p, true); - return e.makeTensorInfo(c, o.dtype, u); + let a = t10.readSync(o.dataId), i = t10.readSync(n.dataId), p = t10.readSync(s.dataId), [u, l] = Sh(a, o.shape, o.dtype, i, p, true); + return t10.makeTensorInfo(l, o.dtype, u); } -var G3 = { kernelName: ya, backendName: "webgl", kernelFunc: Hte }; -function Kte(r15) { - let { inputs: t8, backend: e } = r15, { data: o, indices: n, segmentIds: s } = t8; +var PP = { kernelName: va, backendName: "webgl", kernelFunc: yoe }; +function boe(r16) { + let { inputs: e, backend: t10 } = r16, { data: o, indices: n, segmentIds: s } = e; if (o.shape.length < 1) throw new Error("Data should be at least 1 dimensional but received scalar"); if (n.shape.length !== 1) @@ -24259,67 +24355,67 @@ function Kte(r15) { if (s.shape.length !== 1) throw new Error(`Segment ids should be a vector but received shape ${s.shape}`); - let a = e.readSync(o.dataId), i = e.readSync(n.dataId), p = e.readSync(s.dataId), [u, c] = ch(a, o.shape, o.dtype, i, p); - return e.makeTensorInfo(c, o.dtype, u); + let a = t10.readSync(o.dataId), i = t10.readSync(n.dataId), p = t10.readSync(s.dataId), [u, l] = Sh(a, o.shape, o.dtype, i, p); + return t10.makeTensorInfo(l, o.dtype, u); } -var H3 = { kernelName: ba, backendName: "webgl", kernelFunc: Kte }; -function qte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { sparseIndices: n, sparseValues: s, defaultValue: a } = t8, { outputShape: i } = o, { sliceRank: p, numUpdates: u, sliceSize: c, strides: l, outputSize: m } = w.calculateShapes(s, n, i), d = false; +var OP = { kernelName: ka, backendName: "webgl", kernelFunc: boe }; +function Coe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { sparseIndices: n, sparseValues: s, defaultValue: a } = e, { outputShape: i } = o, { sliceRank: p, numUpdates: u, sliceSize: l, strides: c, outputSize: m } = C.calculateShapes(s, n, i), d = false; if (s.dtype === "string") { - let x = e.bufferSync(n), b = e.bufferSync(s), C = y.decodeString(e.readSync(a.dataId)[0]), S = uD(x, b, i, m, c, u, p, l, C, d); - return e.makeTensorInfo(i, S.dtype, S.values); + let x = t10.bufferSync(n), b = t10.bufferSync(s), w = y.decodeString(t10.readSync(a.dataId)[0]), S = JD(x, b, i, m, l, u, p, c, w, d); + return t10.makeTensorInfo(i, S.dtype, S.values); } - let f = new yu(u, p, n.shape.length, s.shape.length, l, [m, 1], d), h = e.runWebGLProgram(f, [s, n, a], s.dtype), g = te({ inputs: { x: h }, backend: e, attrs: { shape: i } }); - return e.disposeIntermediateTensorInfo(h), g; + let f = new Tu(u, p, n.shape.length, s.shape.length, c, [m, 1], d), h = t10.runWebGLProgram(f, [s, n, a], s.dtype), g = te({ inputs: { x: h }, backend: t10, attrs: { shape: i } }); + return t10.disposeIntermediateTensorInfo(h), g; } -var K3 = { kernelName: vs, backendName: "webgl", kernelFunc: qte }; -function jte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { numOrSizeSplits: s, axis: a } = o, i = y.parseAxisParam(a, n.shape)[0], p = w.prepareSplitSize(n, s, i), u = n.shape.length, c = new Array(u).fill(0), l = n.shape.slice(); +var MP = { kernelName: Ps, backendName: "webgl", kernelFunc: Coe }; +function woe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { numOrSizeSplits: s, axis: a } = o, i = y.parseAxisParam(a, n.shape)[0], p = C.prepareSplitSize(n, s, i), u = n.shape.length, l = new Array(u).fill(0), c = n.shape.slice(); return p.map((m) => { - let d = [...l]; + let d = [...c]; d[i] = m; - let f = Gs({ inputs: { x: n }, backend: e, attrs: { begin: c, size: d } }); - return c[i] += m, f; + let f = Js({ inputs: { x: n }, backend: t10, attrs: { begin: l, size: d } }); + return l[i] += m, f; }); } -var q3 = { kernelName: xa, backendName: "webgl", kernelFunc: jte }; -var j3 = "return sqrt(x);"; -var Xte = xe({ opSnippet: j3, packedOpSnippet: j3, cpuKernelImpl: dD }); -var X3 = { kernelName: ws, backendName: "webgl", kernelFunc: Xte }; -var Yte = "return x * x;"; -var Qte = xe({ opSnippet: Yte }); -var Y3 = { kernelName: Ki, backendName: "webgl", kernelFunc: Qte }; -var Q3 = "return (a - b) * (a - b);"; -var Zte = nt({ opSnippet: Q3, packedOpSnippet: Q3 }); -var Z3 = { kernelName: ks, backendName: "webgl", kernelFunc: Zte }; -function Jte(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8; +var LP = { kernelName: Ia, backendName: "webgl", kernelFunc: woe }; +var BP = "return sqrt(x);"; +var Soe = xe({ opSnippet: BP, packedOpSnippet: BP, cpuKernelImpl: nA }); +var zP = { kernelName: Fo, backendName: "webgl", kernelFunc: Soe }; +var Ioe = "return x * x;"; +var voe = xe({ opSnippet: Ioe }); +var VP = { kernelName: tu, backendName: "webgl", kernelFunc: voe }; +var WP = "return (a - b) * (a - b);"; +var koe = st({ opSnippet: WP, packedOpSnippet: WP }); +var UP = { kernelName: Po, backendName: "webgl", kernelFunc: koe }; +function Noe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e; if (n.dtype !== "string") throw new Error("Input must be of datatype string"); - let s = e.readSync(n.dataId), a = w.fromUint8ToStringArray(s), i = fD(a, "string", o); - return e.makeTensorInfo(n.shape, "string", i); -} -var J3 = { kernelName: $u, backendName: "webgl", kernelFunc: Jte }; -function ere({ inputs: r15, attrs: t8, backend: e }) { - let { x: o } = r15, n = Wt + ` - return x > 0.0 ? 1.0 : float(${t8.alpha}); - `, s = new tr(o.shape, n); - return e.runWebGLProgram(s, [o], o.dtype); -} -var eP = { kernelName: wo, backendName: "webgl", kernelFunc: ere }; -var Eg = class { - constructor(t8, e, o) { + let s = t10.readSync(n.dataId), a = C.fromUint8ToStringArray(s), i = sA(a, "string", o); + return t10.makeTensorInfo(n.shape, "string", i); +} +var GP = { kernelName: pi, backendName: "webgl", kernelFunc: Noe }; +function Toe({ inputs: r16, attrs: e, backend: t10 }) { + let { x: o } = r16, n = Gt + ` + return x > 0.0 ? 1.0 : float(${e.alpha}); + `, s = new nr(o.shape, n); + return t10.runWebGLProgram(s, [o], o.dtype); +} +var HP = { kernelName: Ko, backendName: "webgl", kernelFunc: Toe }; +var Wg = class { + constructor(e, t10, o) { this.variableNames = ["x"], this.outputShape = o; let n = o.length, s = Re(o.length), a = Re(o.length), i = ""; if (n === 1) i = "coords * strides + begin"; else { let p = 0; - i = o.map((u, c) => (p++, o.length === 1 ? `coords * strides[${c}] + begin[${c}]` : `coords[${p - 1}] * strides[${c}] + begin[${c}]`)).join(","); + i = o.map((u, l) => (p++, o.length === 1 ? `coords * strides[${l}] + begin[${l}]` : `coords[${p - 1}] * strides[${l}] + begin[${l}]`)).join(","); } this.userCode = ` - ${s} begin = ${s}(${t8}); - ${s} strides = ${s}(${e}); + ${s} begin = ${s}(${e}); + ${s} strides = ${s}(${t10}); void main() { ${a} coords = getOutputCoords(); @@ -24328,77 +24424,77 @@ var Eg = class { `; } }; -function tre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: c, newAxisMask: l, shrinkAxisMask: m } = o, { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: C, strides: S } = pt.sliceInfo(n.shape, s, a, i, p, u, c, l, m), k; +function _oe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: l, newAxisMask: c, shrinkAxisMask: m } = o, { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: w, strides: S } = nt.sliceInfo(n.shape, s, a, i, p, u, l, c, m), k; if (h) - k = te({ inputs: { x: n }, backend: e, attrs: { shape: f } }); + k = te({ inputs: { x: n }, backend: t10, attrs: { shape: f } }); else if (g || x) { y.assert(n.shape.length >= 1, () => `Input must have rank at least 1, got: ${n.shape.length}`); - let E = pt.computeOutShape(b, C, S), R = Gs({ inputs: { x: n }, backend: e, attrs: { begin: b, size: E } }); - k = te({ inputs: { x: R }, backend: e, attrs: { shape: f } }), e.disposeIntermediateTensorInfo(R); - } else if (e.shouldExecuteOnCPU([n])) { - let R = e.readSync(n.dataId), D = me(n.shape, n.dtype, R), P = hD(d, D, S, b); - k = e.makeTensorInfo(f, n.dtype, P.values); + let E = nt.computeOutShape(b, w, S), R = Js({ inputs: { x: n }, backend: t10, attrs: { begin: b, size: E } }); + k = te({ inputs: { x: R }, backend: t10, attrs: { shape: f } }), t10.disposeIntermediateTensorInfo(R); + } else if (t10.shouldExecuteOnCPU([n])) { + let R = t10.readSync(n.dataId), D = ie(n.shape, n.dtype, R), F = aA(d, D, S, b); + k = t10.makeTensorInfo(f, n.dtype, F.values); } else { - let R = new Eg(b, S, d); - k = e.runWebGLProgram(R, [n], n.dtype); + let R = new Wg(b, S, d); + k = t10.runWebGLProgram(R, [n], n.dtype); } - let _ = te({ inputs: { x: k }, backend: e, attrs: { shape: f } }); - return e.disposeIntermediateTensorInfo(k), _; + let T = te({ inputs: { x: k }, backend: t10, attrs: { shape: f } }); + return t10.disposeIntermediateTensorInfo(k), T; } -var tP = { kernelName: Ns, backendName: "webgl", kernelFunc: tre }; -function rre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { separator: n, nGramWidths: s, leftPad: a, rightPad: i, padWidth: p, preserveShortSequences: u } = o, { data: c, dataSplits: l } = t8, m = e.readSync(c.dataId), d = e.readSync(l.dataId), [f, h] = gD(m, d, n, s, a, i, p, u); - return [e.makeTensorInfo([f.length], "string", f), e.makeTensorInfo(l.shape, "int32", h)]; +var KP = { kernelName: Os, backendName: "webgl", kernelFunc: _oe }; +function Eoe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { separator: n, nGramWidths: s, leftPad: a, rightPad: i, padWidth: p, preserveShortSequences: u } = o, { data: l, dataSplits: c } = e, m = t10.readSync(l.dataId), d = t10.readSync(c.dataId), [f, h] = iA(m, d, n, s, a, i, p, u); + return [t10.makeTensorInfo([f.length], "string", f), t10.makeTensorInfo(c.shape, "int32", h)]; } -var rP = { kernelName: Ca, backendName: "webgl", kernelFunc: rre }; -function ore(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { skipEmpty: n } = o, { input: s, delimiter: a } = t8; +var qP = { kernelName: Na, backendName: "webgl", kernelFunc: Eoe }; +function $oe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { skipEmpty: n } = o, { input: s, delimiter: a } = e; if (s.dtype !== "string") throw new Error("Input must be of datatype string"); if (s.shape.length !== 1) throw new Error(`Input must be a vector, got shape: ${s.shape}`); if (a.shape.length !== 0) throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`); - let i = e.readSync(s.dataId), p = e.readSync(a.dataId)[0], [u, c, l] = xD(i, p, n), m = c.length; - return [e.makeTensorInfo([m, 2], "int32", u), e.makeTensorInfo([m], "string", c), e.makeTensorInfo([2], "int32", new Int32Array(l))]; + let i = t10.readSync(s.dataId), p = t10.readSync(a.dataId)[0], [u, l, c] = uA(i, p, n), m = l.length; + return [t10.makeTensorInfo([m, 2], "int32", u), t10.makeTensorInfo([m], "string", l), t10.makeTensorInfo([2], "int32", new Int32Array(c))]; } -var oP = { kernelName: qi, backendName: "webgl", kernelFunc: ore }; -function nre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { numBuckets: n } = o, { input: s } = t8; +var jP = { kernelName: ru, backendName: "webgl", kernelFunc: $oe }; +function Roe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { numBuckets: n } = o, { input: s } = e; if (s.dtype !== "string") throw new Error("Input must be of datatype string"); if (n <= 0) throw new Error("Number of buckets must be at least 1"); - let a = e.readSync(s.dataId), i = yD(a, n); - return e.makeTensorInfo(s.shape, "int32", i); -} -var nP = { kernelName: ji, backendName: "webgl", kernelFunc: nre }; -var sre = "return tan(x);"; -var are = xe({ opSnippet: sre }); -var sP = { kernelName: _s, backendName: "webgl", kernelFunc: are }; -var ire = ` + let a = t10.readSync(s.dataId), i = pA(a, n); + return t10.makeTensorInfo(s.shape, "int32", i); +} +var XP = { kernelName: ou, backendName: "webgl", kernelFunc: Roe }; +var Doe = "return tan(x);"; +var Aoe = xe({ opSnippet: Doe }); +var YP = { kernelName: Ms, backendName: "webgl", kernelFunc: Aoe }; +var Foe = ` float e2x = exp(-2.0 * abs(x)); return sign(x) * (1.0 - e2x) / (1.0 + e2x); `; -var ure = xe({ opSnippet: ire }); -var aP = { kernelName: $s, backendName: "webgl", kernelFunc: ure }; -function pre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { tensor: n, indices: s, updates: a } = t8, {} = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: c, outputSize: l } = w.calculateShapes(a, s, n.shape), m = [l / u, u]; - if (l === 0) - return e.makeTensorInfo(n.shape, s.dtype); - let d = te({ inputs: { x: s }, backend: e, attrs: { shape: [p, i] } }), f = te({ inputs: { x: a }, backend: e, attrs: { shape: [p, u] } }), h = te({ inputs: { x: n }, backend: e, attrs: { shape: m } }), g = new yu(p, i, d.shape.length, f.shape.length, c, m, false, true), x = e.runWebGLProgram(g, [f, d, h], h.dtype), b = te({ inputs: { x }, backend: e, attrs: { shape: n.shape } }); - return e.disposeIntermediateTensorInfo(d), e.disposeIntermediateTensorInfo(f), e.disposeIntermediateTensorInfo(h), e.disposeIntermediateTensorInfo(x), b; -} -var iP = { kernelName: ds, backendName: "webgl", kernelFunc: pre }; -var Rg = class { - constructor(t8, e) { +var Poe = xe({ opSnippet: Foe }); +var QP = { kernelName: Ls, backendName: "webgl", kernelFunc: Poe }; +function Ooe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { tensor: n, indices: s, updates: a } = e, {} = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: l, outputSize: c } = C.calculateShapes(a, s, n.shape), m = [c / u, u]; + if (c === 0) + return t10.makeTensorInfo(n.shape, s.dtype); + let d = te({ inputs: { x: s }, backend: t10, attrs: { shape: [p, i] } }), f = te({ inputs: { x: a }, backend: t10, attrs: { shape: [p, u] } }), h = te({ inputs: { x: n }, backend: t10, attrs: { shape: m } }), g = new Tu(p, i, d.shape.length, f.shape.length, l, m, false, true), x = t10.runWebGLProgram(g, [f, d, h], h.dtype), b = te({ inputs: { x }, backend: t10, attrs: { shape: n.shape } }); + return t10.disposeIntermediateTensorInfo(d), t10.disposeIntermediateTensorInfo(f), t10.disposeIntermediateTensorInfo(h), t10.disposeIntermediateTensorInfo(x), b; +} +var ZP = { kernelName: ks, backendName: "webgl", kernelFunc: Ooe }; +var Ug = class { + constructor(e, t10) { this.variableNames = ["A"]; - let o = new Array(t8.length); + let o = new Array(e.length); for (let a = 0; a < o.length; a++) - o[a] = t8[a] * e[a]; + o[a] = e[a] * t10[a]; this.outputShape = o, this.rank = o.length; - let n = Re(this.rank), s = cre(t8); + let n = Re(this.rank), s = Moe(e); this.userCode = ` void main() { ${n} resRC = getOutputCoords(); @@ -24407,30 +24503,30 @@ var Rg = class { `; } }; -function cre(r15) { - let t8 = r15.length; - if (t8 > 5) - throw Error(`Tile for rank ${t8} is not yet supported`); - if (t8 === 1) - return `imod(resRC, ${r15[0]})`; - let e = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u"], o = []; - for (let n = 0; n < r15.length; n++) - o.push(`imod(${e[n]}, ${r15[n]})`); +function Moe(r16) { + let e = r16.length; + if (e > 5) + throw Error(`Tile for rank ${e} is not yet supported`); + if (e === 1) + return `imod(resRC, ${r16[0]})`; + let t10 = ["resRC.x", "resRC.y", "resRC.z", "resRC.w", "resRC.u"], o = []; + for (let n = 0; n < r16.length; n++) + o.push(`imod(${t10[n]}, ${r16[n]})`); return o.join(); } -function Av(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { reps: s } = o; +function q0(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { reps: s } = o; if (n.dtype === "string" || n.shape.length > 5) { - let p = e.readSync(n.dataId), u = n.dtype === "string" ? p.map((m) => y.decodeString(m)) : p, c = me(n.shape, n.dtype, u), l = CD(c, s); - return e.makeTensorInfo(l.shape, l.dtype, l.values); + let p = t10.readSync(n.dataId), u = n.dtype === "string" ? p.map((m) => y.decodeString(m)) : p, l = ie(n.shape, n.dtype, u), c = cA(l, s); + return t10.makeTensorInfo(c.shape, c.dtype, c.values); } - let a = new Rg(n.shape, s); - return e.runWebGLProgram(a, [n], n.dtype); + let a = new Ug(n.shape, s); + return t10.runWebGLProgram(a, [n], n.dtype); } -var uP = { kernelName: uo, backendName: "webgl", kernelFunc: Av }; -var Dg = class { - constructor(t8) { - this.variableNames = ["x", "indices"], this.customUniforms = [{ name: "n", type: "int" }, { name: "firstPass", type: "int" }, { name: "negativeInf", type: "float" }, { name: "dir", type: "int" }, { name: "inc", type: "int" }], this.outputShape = t8, this.userCode = ` +var JP = { kernelName: Mo, backendName: "webgl", kernelFunc: q0 }; +var Gg = class { + constructor(e) { + this.variableNames = ["x", "indices"], this.customUniforms = [{ name: "n", type: "int" }, { name: "firstPass", type: "int" }, { name: "negativeInf", type: "float" }, { name: "dir", type: "int" }, { name: "inc", type: "int" }], this.outputShape = e, this.userCode = ` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -24473,9 +24569,9 @@ var Dg = class { `; } }; -var Ag = class { - constructor(t8) { - this.variableNames = ["x", "indices"], this.customUniforms = [{ name: "n", type: "int" }, { name: "firstPass", type: "int" }, { name: "k", type: "int" }], this.outputShape = t8, this.userCode = ` +var Hg = class { + constructor(e) { + this.variableNames = ["x", "indices"], this.customUniforms = [{ name: "n", type: "int" }, { name: "firstPass", type: "int" }, { name: "k", type: "int" }], this.outputShape = e, this.userCode = ` void main() { // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ... ivec2 coords = getOutputCoords(); @@ -24512,55 +24608,55 @@ var Ag = class { `; } }; -function Ip(r15, t8) { - t8 !== null && r15.disposeIntermediateTensorInfo(t8); +function Rp(r16, e) { + e !== null && r16.disposeIntermediateTensorInfo(e); } -function pP(r15) { - let t8 = 1; - for (; t8 < r15; ) - t8 *= 2; - return t8; +function eO(r16) { + let e = 1; + for (; e < r16; ) + e *= 2; + return e; } -function lre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { k: s, sorted: a } = o, i = A().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"), p = A().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"), u = n.shape, c = u[u.length - 1]; - if (e.shouldExecuteOnCPU([n]) || c < i || s > p) { - let P = e.readSync(n.dataId), [O, M] = wD(P, u, n.dtype, s, a); - return [e.makeTensorInfo(O.shape, O.dtype, O.values), e.makeTensorInfo(M.shape, M.dtype, M.values)]; +function Loe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { k: s, sorted: a } = o, i = A().getNumber("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD"), p = A().getNumber("TOPK_K_CPU_HANDOFF_THRESHOLD"), u = n.shape, l = u[u.length - 1]; + if (t10.shouldExecuteOnCPU([n]) || l < i || s > p) { + let F = t10.readSync(n.dataId), [O, M] = mA(F, u, n.dtype, s, a); + return [t10.makeTensorInfo(O.shape, O.dtype, O.values), t10.makeTensorInfo(M.shape, M.dtype, M.values)]; } if (s === 0) - return u[u.length - 1] = 0, [e.makeTensorInfo(u, n.dtype, []), e.makeTensorInfo(u, "int32", [])]; - if (c === 1) - return [n, bi({ attrs: { shape: u, dtype: "int32", value: 0 }, backend: e })]; - let l = e.texData.get(n.dataId), m = l !== null && l.isPacked, d = m ? e.unpackTensor(n) : n, h = y.sizeFromShape(u) / c, g = te({ inputs: { x: d }, attrs: { shape: [h, c] }, backend: e }); - m && Ip(e, d); - let x = pP(s), b = pP(c), C = null, S = () => C === null ? [g, g] : [g, C], k = (P, O, M) => { - let L = S(), B = new Dg(M), U = [[c], [C === null ? 1 : 0], [Number.NEGATIVE_INFINITY], [P], [O]], j = C; - C = e.runWebGLProgram(B, L, "int32", U), Ip(e, j); + return u[u.length - 1] = 0, [t10.makeTensorInfo(u, n.dtype, []), t10.makeTensorInfo(u, "int32", [])]; + if (l === 1) + return [n, Ei({ attrs: { shape: u, dtype: "int32", value: 0 }, backend: t10 })]; + let c = t10.texData.get(n.dataId), m = c !== null && c.isPacked, d = m ? t10.unpackTensor(n) : n, h = y.sizeFromShape(u) / l, g = te({ inputs: { x: d }, attrs: { shape: [h, l] }, backend: t10 }); + m && Rp(t10, d); + let x = eO(s), b = eO(l), w = null, S = () => w === null ? [g, g] : [g, w], k = (F, O, M) => { + let L = S(), B = new Gg(M), U = [[l], [w === null ? 1 : 0], [Number.NEGATIVE_INFINITY], [F], [O]], j = w; + w = t10.runWebGLProgram(B, L, "int32", U), Rp(t10, j); }; - for (let P = 1; P < x; P *= 2) { - let O = P * 2; - for (let M = P; M >= 1; M /= 2) + for (let F = 1; F < x; F *= 2) { + let O = F * 2; + for (let M = F; M >= 1; M /= 2) k(O, M, [h, b]); } - for (let P = b; P > x; P /= 2) { - let O = S(), M = new Ag([h, P / 2]), B = [[c], [C === null ? 1 : 0], [x]], z = C; - C = e.runWebGLProgram(M, O, "int32", B), Ip(e, z); + for (let F = b; F > x; F /= 2) { + let O = S(), M = new Hg([h, F / 2]), B = [[l], [w === null ? 1 : 0], [x]], z = w; + w = t10.runWebGLProgram(M, O, "int32", B), Rp(t10, z); let U = x / 2, j = U * 2; for (let q = U; q >= 1; q /= 2) - k(j, q, C.shape); + k(j, q, w.shape); } - let _ = C; - C = Gs({ inputs: { x: C }, backend: e, attrs: { begin: 0, size: [h, s] } }), Ip(e, _); - let E = Nv({ inputs: { x: g, indices: C }, backend: e, attrs: { axis: 1, batchDims: 1 } }); - Ip(e, g); + let T = w; + w = Js({ inputs: { x: w }, backend: t10, attrs: { begin: 0, size: [h, s] } }), Rp(t10, T); + let E = z0({ inputs: { x: g, indices: w }, backend: t10, attrs: { axis: 1, batchDims: 1 } }); + Rp(t10, g); let R = u.slice(0, -1); - R.push(s), _ = C, C = te({ inputs: { x: C }, attrs: { shape: R }, backend: e }), Ip(e, _); + R.push(s), T = w, w = te({ inputs: { x: w }, attrs: { shape: R }, backend: t10 }), Rp(t10, T); let D = E; - return E = te({ inputs: { x: E }, attrs: { shape: R }, backend: e }), Ip(e, D), [E, C]; + return E = te({ inputs: { x: E }, attrs: { shape: R }, backend: t10 }), Rp(t10, D), [E, w]; } -var cP = { kernelName: Es, backendName: "webgl", kernelFunc: lre }; -var Fg = class { - constructor(t8, e, o, n, s, a) { +var tO = { kernelName: Bs, backendName: "webgl", kernelFunc: Loe }; +var Kg = class { + constructor(e, t10, o, n, s, a) { this.variableNames = ["Image", "Transforms"], this.outputShape = a; let i = o === "nearest" ? 1 : 2, p; switch (n) { @@ -24634,7 +24730,7 @@ var Fg = class { float readWithFillValue(int batch, int coordY, int coordX, int channel) { float outputValue; - if (0 <= coordY && coordY < ${t8} && 0 <= coordX && coordX < ${e}) { + if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t10}) { outputValue = getImage(batch, coordY, coordX, channel); } else { outputValue = float(${s}); @@ -24665,8 +24761,8 @@ var Fg = class { } else { float inX = (a1 * xf + a2 * yf + a3) / projection; float inY = (b1 * xf + b2 * yf + b3) / projection; - float mapX = mapCoord(inX, float(${e})); - float mapY = mapCoord(inY, float(${t8})); + float mapX = mapCoord(inX, float(${t10})); + float mapY = mapCoord(inY, float(${e})); if (${i} == 1) { int coordY = int(round(mapY)); @@ -24695,41 +24791,41 @@ var Fg = class { `; } }; -function mre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n, transforms: s } = t8, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = o, [c, l, m, d] = n.shape, [f, h] = u != null ? u : [l, m], g = [c, f, h, d], x = new Fg(l, m, a, i, p, g); - return e.runWebGLProgram(x, [n, s], "float32"); +function Boe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n, transforms: s } = e, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = o, [l, c, m, d] = n.shape, [f, h] = u != null ? u : [c, m], g = [l, f, h, d], x = new Kg(c, m, a, i, p, g); + return t10.runWebGLProgram(x, [n, s], "float32"); } -var lP = { kernelName: Rs, backendName: "webgl", kernelFunc: mre }; -function dre(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { axis: n } = e, { x: s } = t8; - Vs(s, "unique"), console.warn("WARNING: ", "UI might be locked temporarily as data is being downloaded"); - let a = o.readSync(s.dataId), { outputValues: i, outputShape: p, indices: u } = SD(a, n, s.shape, s.dtype); +var rO = { kernelName: zs, backendName: "webgl", kernelFunc: Boe }; +function zoe(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { axis: n } = t10, { x: s } = e; + Ys(s, "unique"), console.warn("WARNING: ", "UI might be locked temporarily as data is being downloaded"); + let a = o.readSync(s.dataId), { outputValues: i, outputShape: p, indices: u } = dA(a, n, s.shape, s.dtype); return [o.makeTensorInfo(p, s.dtype, i), o.makeTensorInfo([u.length], "int32", u)]; } -var mP = { kernelName: Xi, backendName: "webgl", kernelFunc: dre }; -function fre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { value: n } = t8, { axis: s } = o; +var oO = { kernelName: nu, backendName: "webgl", kernelFunc: zoe }; +function Voe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { value: n } = e, { axis: s } = o; s < 0 && (s += n.shape.length); - let a = n, i = a.shape.length, p = n.shape[s], u = new Array(i - 1), c = 0; + let a = n, i = a.shape.length, p = n.shape[s], u = new Array(i - 1), l = 0; for (let h = 0; h < i; h++) - h !== s && (u[c++] = a.shape[h]); - let l = [], m = new Array(i).fill(0), d = a.shape.slice(); + h !== s && (u[l++] = a.shape[h]); + let c = [], m = new Array(i).fill(0), d = a.shape.slice(); d[s] = 1; let f = new Array(p); for (let h = 0; h < f.length; h++) { m[s] = h; - let g = Gs({ inputs: { x: a }, backend: e, attrs: { begin: m, size: d } }), x = te({ inputs: { x: g }, backend: e, attrs: { shape: u } }); - f[h] = x, l.push(g); + let g = Js({ inputs: { x: a }, backend: t10, attrs: { begin: m, size: d } }), x = te({ inputs: { x: g }, backend: t10, attrs: { shape: u } }); + f[h] = x, c.push(g); } - return l.forEach((h) => e.disposeIntermediateTensorInfo(h)), f; + return c.forEach((h) => t10.disposeIntermediateTensorInfo(h)), f; } -var dP = { kernelName: wa, backendName: "webgl", kernelFunc: fre }; -var Pg = class { - constructor(t8, e) { +var nO = { kernelName: Ta, backendName: "webgl", kernelFunc: Voe }; +var qg = class { + constructor(e, t10) { this.variableNames = ["x", "segmentIds"]; - let o = t8.windowSize, n = t8.batchSize, s = t8.inSize, a = t8.numSegments, i = a * Math.ceil(s / o); + let o = e.windowSize, n = e.batchSize, s = e.inSize, a = e.numSegments, i = a * Math.ceil(s / o); this.outputShape = [n, i]; - let p = "0.0", u = "sumValue", c = Math.floor(o / 4) * 4, l = o % 4, m = ` + let p = "0.0", u = "sumValue", l = Math.floor(o / 4) * 4, c = o % 4, m = ` sumValue += dot(values, segFilter); `, d = ""; s % o > 0 && (d = ` @@ -24765,7 +24861,7 @@ var Pg = class { float sumValue = 0.0; - for (int i = 0; i < ${c}; i += 4) { + for (int i = 0; i < ${l}; i += 4) { int inIdx = inOffset + i; vec4 values = vec4( getValue(batch, inIdx), @@ -24784,8 +24880,8 @@ var Pg = class { ${m} } - int inIdx = inOffset + ${c}; - if (${l === 1}) { + int inIdx = inOffset + ${l}; + if (${c === 1}) { vec4 values = vec4( getValue(batch, inIdx), initializationValue, @@ -24803,7 +24899,7 @@ var Pg = class { ); ${m} - } else if (${l === 2}) { + } else if (${c === 2}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -24819,7 +24915,7 @@ var Pg = class { ); ${m} - } else if (${l === 3}) { + } else if (${c === 3}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -24841,1258 +24937,1258 @@ var Pg = class { `; } }; -function hre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, segmentIds: s } = t8, { numSegments: a } = o, i = n.shape.length, p = [], u = 0, c = w.getAxesPermutation([u], i), l = n; - c != null && (l = bt({ inputs: { x: n }, backend: e, attrs: { perm: c } }), p.push(l), u = w.getInnerMostAxes(1, i)[0]); - let m = w.segment_util.computeOutShape(l.shape, u, a), d = y.sizeFromShape([l.shape[u]]), f = te({ inputs: { x: l }, backend: e, attrs: { shape: [-1, d] } }); +function Woe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, segmentIds: s } = e, { numSegments: a } = o, i = n.shape.length, p = [], u = 0, l = C.getAxesPermutation([u], i), c = n; + l != null && (c = Ct({ inputs: { x: n }, backend: t10, attrs: { perm: l } }), p.push(c), u = C.getInnerMostAxes(1, i)[0]); + let m = C.segment_util.computeOutShape(c.shape, u, a), d = y.sizeFromShape([c.shape[u]]), f = te({ inputs: { x: c }, backend: t10, attrs: { shape: [-1, d] } }); p.push(f); - let h = oi(n.dtype), g = (S, k, _, E, R) => { - let D = S.shape[0], P = S.shape[1], O = w.segment_util.segOpComputeOptimalWindowSize(P, R), M = { windowSize: O, inSize: P, batchSize: D, numSegments: R }, L = new Pg(M, k), B = e.compileAndRun(L, [S, _], E); + let h = mi(n.dtype), g = (S, k, T, E, R) => { + let D = S.shape[0], F = S.shape[1], O = C.segment_util.segOpComputeOptimalWindowSize(F, R), M = { windowSize: O, inSize: F, batchSize: D, numSegments: R }, L = new qg(M, k), B = t10.compileAndRun(L, [S, T], E); if (p.push(B), B.shape[1] === R) return B; - let z = Dv({ backend: e, attrs: { start: 0, stop: R, step: 1, dtype: "float32" } }), U = Av({ inputs: { x: z }, backend: e, attrs: { reps: [P / O] } }); + let z = K0({ backend: t10, attrs: { start: 0, stop: R, step: 1, dtype: "float32" } }), U = q0({ inputs: { x: z }, backend: t10, attrs: { reps: [F / O] } }); return p.push(z), p.push(U), g(B, k, U, E, R); - }, x = g(f, "unsortedSegmentSum", s, h, a), b = te({ inputs: { x }, backend: e, attrs: { shape: m } }), C = b; - if (c != null) { + }, x = g(f, "unsortedSegmentSum", s, h, a), b = te({ inputs: { x }, backend: t10, attrs: { shape: m } }), w = b; + if (l != null) { p.push(b); - let S = w.getUndoAxesPermutation(c); - C = bt({ inputs: { x: C }, backend: e, attrs: { perm: S } }); + let S = C.getUndoAxesPermutation(l); + w = Ct({ inputs: { x: w }, backend: t10, attrs: { perm: S } }); } - return p.forEach((S) => e.disposeIntermediateTensorInfo(S)), C; + return p.forEach((S) => t10.disposeIntermediateTensorInfo(S)), w; } -var fP = { kernelName: Yi, backendName: "webgl", kernelFunc: hre }; -var gre = [YD, ZD, JD, eA, rA, oA, nA, sA, uA, pA, cA, lA, mA, dA, fA, hA, gA, xA, yA, bA, CA, SA, IA, vA, kA, $A, RA, DA, zD, FA, OA, MA, LA, BA, zA, VA, WA, UA, GA, HA, jA, XA, YA, QA, ZA, JA, eF, tF, rF, oF, nF, sF, aF, iF, uF, pF, lF, mF, dF, fF, gF, xF, yF, bF, CF, wF, SF, IF, vF, BD, kF, PA, NF, TF, _F, VD, $F, EF, RF, DF, AF, FF, PF, OF, MF, LF, zF, VF, WF, UF, GF, HF, qF, XF, YF, QF, ZF, JF, n3, GD, s3, a3, i3, u3, NA, p3, m3, d3, f3, h3, WD, g3, x3, y3, b3, C3, TA, e3, w3, S3, I3, KD, v3, k3, N3, T3, _3, $3, E3, R3, D3, A3, F3, P3, O3, M3, L3, B3, wA, o3, z3, V3, W3, U3, G3, H3, K3, q3, X3, Y3, Z3, J3, eP, tP, rP, oP, nP, r32, jD, sP, aP, iP, uP, cP, lP, XD, mP, dP, fP, c3]; -for (let r15 of gre) - ti(r15); +var sO = { kernelName: su, backendName: "webgl", kernelFunc: Woe }; +var Uoe = [VA, UA, GA, HA, qA, jA, XA, YA, JA, eF, tF, rF, oF, nF, sF, aF, iF, uF, pF, lF, cF, dF, fF, hF, gF, CF, SF, IF, RA, kF, TF, _F, EF, $F, RF, DF, AF, FF, PF, OF, BF, zF, VF, WF, UF, GF, HF, KF, qF, jF, XF, YF, QF, ZF, JF, e3, r32, o3, n3, s3, i3, u3, p3, l3, c3, m3, d3, f3, h3, $A, g3, NF, x3, y3, b3, DA, C3, w3, S3, I3, v3, k3, N3, T3, _3, E3, R3, D3, A3, F3, P3, O3, L3, z3, V3, W3, U3, G3, X3, PA, Y3, Q3, Z3, J3, xF, eP, oP, nP, sP, aP, AA, iP, uP, pP, lP, cP, yF, H3, mP, dP, fP, MA, hP, gP, xP, yP, bP, CP, wP, SP, IP, vP, kP, NP, TP, _P, EP, $P, mF, j3, RP, DP, AP, FP, PP, OP, MP, LP, zP, VP, UP, GP, HP, KP, qP, jP, XP, q3, BA, YP, QP, ZP, JP, tO, rO, zA, oO, nO, sO, tP]; +for (let r16 of Uoe) + li(r16); var we; -(function(r15) { - r15[r15.float32 = 0] = "float32", r15[r15.int32 = 1] = "int32", r15[r15.bool = 2] = "bool", r15[r15.string = 3] = "string", r15[r15.complex64 = 4] = "complex64"; +(function(r16) { + r16[r16.float32 = 0] = "float32", r16[r16.int32 = 1] = "int32", r16[r16.bool = 2] = "bool", r16[r16.string = 3] = "string", r16[r16.complex64 = 4] = "complex64"; })(we || (we = {})); -var bu; -(function(r15) { - r15[r15.linear = 0] = "linear", r15[r15.relu = 1] = "relu", r15[r15.relu6 = 2] = "relu6", r15[r15.prelu = 3] = "prelu", r15[r15.leakyrelu = 4] = "leakyrelu", r15[r15.sigmoid = 5] = "sigmoid", r15[r15.elu = 6] = "elu"; -})(bu || (bu = {})); -var hP; -function xre(r15) { - hP = r15.wasm.cwrap(So, null, ["number", "array", "number", "number", "array", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function yre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s, bias: a, preluActivationWeights: i } = t8; +var _u; +(function(r16) { + r16[r16.linear = 0] = "linear", r16[r16.relu = 1] = "relu", r16[r16.relu6 = 2] = "relu6", r16[r16.prelu = 3] = "prelu", r16[r16.leakyrelu = 4] = "leakyrelu", r16[r16.sigmoid = 5] = "sigmoid", r16[r16.elu = 6] = "elu"; +})(_u || (_u = {})); +var aO; +function Goe(r16) { + aO = r16.wasm.cwrap(qo, null, ["number", "array", "number", "number", "array", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function Hoe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s, bias: a, preluActivationWeights: i } = e; if (n.dtype !== "float32" || s.dtype !== "float32") throw new Error("_FusedMatMul for non non-float32 tensors not yet supported."); - let { transposeA: p, transposeB: u, activation: c, leakyreluAlpha: l } = o, m = e.dataIdMap.get(n.dataId).id, d = e.dataIdMap.get(s.dataId).id, f = 0; + let { transposeA: p, transposeB: u, activation: l, leakyreluAlpha: c } = o, m = t10.dataIdMap.get(n.dataId).id, d = t10.dataIdMap.get(s.dataId).id, f = 0; if (a != null) { - let R = e.dataIdMap.get(a.dataId); + let R = t10.dataIdMap.get(a.dataId); if (R.shape.length !== 1) throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${R.shape.length}.`); f = R.id; } - let h = i == null ? 0 : e.dataIdMap.get(i.dataId).id, g = bu[c]; + let h = i == null ? 0 : t10.dataIdMap.get(i.dataId).id, g = _u[l]; if (g == null) - throw new Error(`${c} activation not yet supported for FusedConv2D in the wasm backend.`); - let x = p ? n.shape[2] : n.shape[1], b = u ? s.shape[1] : s.shape[2], C = Sr.assertAndGetBroadcastShape(n.shape.slice(0, -2), s.shape.slice(0, -2)), S = e.makeOutput([...C, x, b], n.dtype), k = e.dataIdMap.get(S.dataId).id, _ = new Uint8Array(new Int32Array(n.shape).buffer), E = new Uint8Array(new Int32Array(s.shape).buffer); - return hP(m, _, n.shape.length, d, E, s.shape.length, p, u, g, f, h, l || 0, k), S; + throw new Error(`${l} activation not yet supported for FusedConv2D in the wasm backend.`); + let x = p ? n.shape[2] : n.shape[1], b = u ? s.shape[1] : s.shape[2], w = kr.assertAndGetBroadcastShape(n.shape.slice(0, -2), s.shape.slice(0, -2)), S = t10.makeOutput([...w, x, b], n.dtype), k = t10.dataIdMap.get(S.dataId).id, T = new Uint8Array(new Int32Array(n.shape).buffer), E = new Uint8Array(new Int32Array(s.shape).buffer); + return aO(m, T, n.shape.length, d, E, s.shape.length, p, u, g, f, h, c || 0, k), S; } -var gP = { kernelName: So, backendName: "wasm", setupFunc: xre, kernelFunc: yre }; -function he(r15, t8) { - let e; +var iO = { kernelName: qo, backendName: "wasm", setupFunc: Goe, kernelFunc: Hoe }; +function he(r16, e) { + let t10; function o(s) { - e = s.wasm.cwrap(r15, null, ["number", "number", "number"]); + t10 = s.wasm.cwrap(r16, null, ["number", "number", "number"]); } function n(s) { - let { backend: a, inputs: { x: i } } = s, p = a.dataIdMap.get(i.dataId).id, u = a.makeOutput(i.shape, t8 || i.dtype), c = a.dataIdMap.get(u.dataId).id; - return y.sizeFromShape(u.shape) === 0 || e(p, we[i.dtype], c), u; + let { backend: a, inputs: { x: i } } = s, p = a.dataIdMap.get(i.dataId).id, u = a.makeOutput(i.shape, e || i.dtype), l = a.dataIdMap.get(u.dataId).id; + return y.sizeFromShape(u.shape) === 0 || t10(p, we[i.dtype], l), u; } - return { kernelName: r15, backendName: "wasm", setupFunc: o, kernelFunc: n }; + return { kernelName: r16, backendName: "wasm", setupFunc: o, kernelFunc: n }; } -var xP = he(Xs); -var yP = he(Vo); -var bP = he(Wo); -function Ue(r15, t8, e) { +var uO = he(fn); +var pO = he(hn); +var lO = he(gn); +function He(r16, e, t10) { let o; function n(a) { - o = a.wasm.cwrap(r15, null, ["number", "array", "number", "number", "array", "number", "number", "number"]); + o = a.wasm.cwrap(r16, null, ["number", "array", "number", "number", "array", "number", "number", "number"]); } function s(a) { - let { backend: i, inputs: p } = a, { a: u, b: c } = p, l = i.dataIdMap.get(u.dataId).id, m = i.dataIdMap.get(c.dataId).id, d = e != null ? e : u.dtype, f = w.assertAndGetBroadcastShape(u.shape, c.shape), h = i.makeOutput(f, d); + let { backend: i, inputs: p } = a, { a: u, b: l } = p, c = i.dataIdMap.get(u.dataId).id, m = i.dataIdMap.get(l.dataId).id, d = t10 != null ? t10 : u.dtype, f = C.assertAndGetBroadcastShape(u.shape, l.shape), h = i.makeOutput(f, d); if (y.sizeFromShape(f) === 0) return h; - let g = new Uint8Array(new Int32Array(u.shape).buffer), x = new Uint8Array(new Int32Array(c.shape).buffer), b = i.dataIdMap.get(h.dataId).id; - return o(l, g, u.shape.length, m, x, c.shape.length, we[u.dtype], b), h; + let g = new Uint8Array(new Int32Array(u.shape).buffer), x = new Uint8Array(new Int32Array(l.shape).buffer), b = i.dataIdMap.get(h.dataId).id; + return o(c, g, u.shape.length, m, x, l.shape.length, we[u.dtype], b), h; } - return { kernelName: r15, backendName: "wasm", setupFunc: n, kernelFunc: s }; + return { kernelName: r16, backendName: "wasm", setupFunc: n, kernelFunc: s }; } -var bre = true; -var CP = Ue(io, bre); -var wP; -function Cre(r15) { - wP = r15.wasm.cwrap(Uo, null, ["array", "number", "number", "number"]); +var Koe = true; +var cO = He(Rr, Koe); +var mO; +function qoe(r16) { + mO = r16.wasm.cwrap(xn, null, ["array", "number", "number", "number"]); } -function wre(r15) { - let { inputs: t8, backend: e } = r15, o = e.makeOutput(t8[0].shape, t8[0].dtype); +function joe(r16) { + let { inputs: e, backend: t10 } = r16, o = t10.makeOutput(e[0].shape, e[0].dtype); if (y.sizeFromShape(o.shape) === 0) return o; - let n = t8.map((i) => e.dataIdMap.get(i.dataId).id), s = new Uint8Array(new Int32Array(n).buffer), a = e.dataIdMap.get(o.dataId).id; - return wP(s, n.length, we[o.dtype], a), o; -} -var SP = { kernelName: Uo, backendName: "wasm", setupFunc: Cre, kernelFunc: wre }; -function vp(r15) { - let { inputs: { x: t8 }, backend: e } = r15; - if (t8.dtype === "string") - return ar(e.readSync(t8.dataId), t8.shape, t8.dtype); - let o = e.makeOutput(t8.shape, t8.dtype), n = e.typedArrayFromHeap(t8); - return e.typedArrayFromHeap(o).set(n), o; -} -var IP = { kernelName: Co, backendName: "wasm", kernelFunc: vp }; -var vP; -function Sre(r15) { - vP = r15.wasm.cwrap(po, null, ["number", "array", "number", "number", "number", "array", "number"]); -} -function ho(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, [n, s] = vre(t8.x.shape, o.perm), a = true; + let n = e.map((i) => t10.dataIdMap.get(i.dataId).id), s = new Uint8Array(new Int32Array(n).buffer), a = t10.dataIdMap.get(o.dataId).id; + return mO(s, n.length, we[o.dtype], a), o; +} +var dO = { kernelName: xn, backendName: "wasm", setupFunc: qoe, kernelFunc: joe }; +function Dp(r16) { + let { inputs: { x: e }, backend: t10 } = r16; + if (e.dtype === "string") + return pr(t10.readSync(e.dataId), e.shape, e.dtype); + let o = t10.makeOutput(e.shape, e.dtype), n = t10.typedArrayFromHeap(e); + return t10.typedArrayFromHeap(o).set(n), o; +} +var fO = { kernelName: vo, backendName: "wasm", kernelFunc: Dp }; +var hO; +function Xoe(r16) { + hO = r16.wasm.cwrap(Kr, null, ["number", "array", "number", "number", "number", "array", "number"]); +} +function Vo(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, [n, s] = Qoe(e.x.shape, o.perm), a = true; for (let f = 0; f < s.length; f++) s[f] !== f && (a = false); - let i = Ire(t8.x.shape, o.perm), p = { dataId: t8.x.dataId, shape: n, dtype: t8.x.dtype }; + let i = Yoe(e.x.shape, o.perm), p = { dataId: e.x.dataId, shape: n, dtype: e.x.dtype }; if (a) { - let f = vp({ inputs: t8, backend: e }); + let f = Dp({ inputs: e, backend: t10 }); return f.shape = i, f; } - let u = e.makeOutput(i, p.dtype), c = e.dataIdMap.get(p.dataId).id, l = e.dataIdMap.get(u.dataId).id, m = new Uint8Array(new Int32Array(s).buffer), d = new Uint8Array(new Int32Array(p.shape).buffer); - return vP(c, d, p.shape.length, we[p.dtype], l, m, s.length), u; + let u = t10.makeOutput(i, p.dtype), l = t10.dataIdMap.get(p.dataId).id, c = t10.dataIdMap.get(u.dataId).id, m = new Uint8Array(new Int32Array(s).buffer), d = new Uint8Array(new Int32Array(p.shape).buffer); + return hO(l, d, p.shape.length, we[p.dtype], c, m, s.length), u; } -function Ire(r15, t8) { - let e = new Array(r15.length); - for (let o = 0; o < e.length; o++) - e[o] = r15[t8[o]]; - return e; +function Yoe(r16, e) { + let t10 = new Array(r16.length); + for (let o = 0; o < t10.length; o++) + t10[o] = r16[e[o]]; + return t10; } -function vre(r15, t8) { - let e = [], o = []; - for (let n = 0; n < r15.length; ++n) - r15[n] !== 1 && e.push(r15[n]), r15[t8[n]] !== 1 && o.push(t8[n]); +function Qoe(r16, e) { + let t10 = [], o = []; + for (let n = 0; n < r16.length; ++n) + r16[n] !== 1 && t10.push(r16[n]), r16[e[n]] !== 1 && o.push(e[n]); for (let n = 0; n < o.length; ++n) { let s = -1; for (let a = 0; a < o.length; ++a) o[a] >= n && (s === -1 || o[s] > o[a]) && (s = a); o[s] = n; } - return [e, o]; + return [t10, o]; } -var kP = { kernelName: po, backendName: "wasm", kernelFunc: ho, setupFunc: Sre }; -function Tr(r15, t8, e) { - let o = r15.shape, n = r15.shape.length, s = y.parseAxisParam(t8, o), a = s, i = w.getAxesPermutation(a, n), p = null, u = false; +var gO = { kernelName: Kr, backendName: "wasm", kernelFunc: Vo, setupFunc: Xoe }; +function $r(r16, e, t10) { + let o = r16.shape, n = r16.shape.length, s = y.parseAxisParam(e, o), a = s, i = C.getAxesPermutation(a, n), p = null, u = false; if (i != null) { - let c = new Array(n); - for (let d = 0; d < c.length; d++) - c[d] = o[i[d]]; - a = w.getInnerMostAxes(a.length, n), p = ho({ inputs: { x: r15 }, attrs: { perm: i }, backend: e }); - let l = e.dataIdMap.get(r15.dataId).id; - e.dataIdMap.get(p.dataId).id !== l && (u = true); + let l = new Array(n); + for (let d = 0; d < l.length; d++) + l[d] = o[i[d]]; + a = C.getInnerMostAxes(a.length, n), p = Vo({ inputs: { x: r16 }, attrs: { perm: i }, backend: t10 }); + let c = t10.dataIdMap.get(r16.dataId).id; + t10.dataIdMap.get(p.dataId).id !== c && (u = true); } return { transposed: p, originalAxes: s, axes: a, inputWasTransposed: u }; } -var NP; -function kre(r15) { - NP = r15.wasm.cwrap(Go, null, ["number, number, number"]); +var xO; +function Zoe(r16) { + xO = r16.wasm.cwrap(yn, null, ["number, number, number"]); } -function Nre(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { axis: n, keepDims: s } = o, { x: a } = e, p = t8.dataIdMap.get(a.dataId).id, u = a, { transposed: c, axes: l, originalAxes: m, inputWasTransposed: d } = Tr(a, n, t8); +function Joe(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { axis: n, keepDims: s } = o, { x: a } = t10, p = e.dataIdMap.get(a.dataId).id, u = a, { transposed: l, axes: c, originalAxes: m, inputWasTransposed: d } = $r(a, n, e); if (d) { - let C = t8.dataIdMap.get(c.dataId).id; - u = c, p = C; + let w = e.dataIdMap.get(l.dataId).id; + u = l, p = w; } let f = u.shape.length; - w.assertAxesAreInnerMostDims("all", l, f); - let [h, g] = w.computeOutAndReduceShapes(u.shape, l), x = y.sizeFromShape(g), b = t8.makeOutput(h, a.dtype); + C.assertAxesAreInnerMostDims("all", c, f); + let [h, g] = C.computeOutAndReduceShapes(u.shape, c), x = y.sizeFromShape(g), b = e.makeOutput(h, a.dtype); if (y.sizeFromShape(u.shape) !== 0) { - let C = t8.dataIdMap.get(b.dataId).id; - NP(p, x, C); + let w = e.dataIdMap.get(b.dataId).id; + xO(p, x, w); } - if (d && t8.disposeData(c.dataId), s) { - let C = w.expandShapeToKeepDim(b.shape, m); - b.shape = C; + if (d && e.disposeData(l.dataId), s) { + let w = C.expandShapeToKeepDim(b.shape, m); + b.shape = w; } return b; } -var TP = { kernelName: Go, backendName: "wasm", setupFunc: kre, kernelFunc: Nre }; -var _P; -function Tre(r15) { - _P = r15.wasm.cwrap(Ho, null, ["number, number, number"]); +var yO = { kernelName: yn, backendName: "wasm", setupFunc: Zoe, kernelFunc: Joe }; +var bO; +function ene(r16) { + bO = r16.wasm.cwrap(bn, null, ["number, number, number"]); } -function _re(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { axis: n, keepDims: s } = o, { x: a } = e, p = t8.dataIdMap.get(a.dataId).id, u = a, { transposed: c, axes: l, originalAxes: m, inputWasTransposed: d } = Tr(a, n, t8); +function tne(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { axis: n, keepDims: s } = o, { x: a } = t10, p = e.dataIdMap.get(a.dataId).id, u = a, { transposed: l, axes: c, originalAxes: m, inputWasTransposed: d } = $r(a, n, e); if (d) { - let C = t8.dataIdMap.get(c.dataId).id; - u = c, p = C; + let w = e.dataIdMap.get(l.dataId).id; + u = l, p = w; } let f = u.shape.length; - w.assertAxesAreInnerMostDims("any", l, f); - let [h, g] = w.computeOutAndReduceShapes(u.shape, l), x = y.sizeFromShape(g), b = t8.makeOutput(h, a.dtype); + C.assertAxesAreInnerMostDims("any", c, f); + let [h, g] = C.computeOutAndReduceShapes(u.shape, c), x = y.sizeFromShape(g), b = e.makeOutput(h, a.dtype); if (y.sizeFromShape(u.shape) !== 0) { - let C = t8.dataIdMap.get(b.dataId).id; - _P(p, x, C); + let w = e.dataIdMap.get(b.dataId).id; + bO(p, x, w); } - if (d && t8.disposeData(c.dataId), s) { - let C = w.expandShapeToKeepDim(b.shape, m); - b.shape = C; + if (d && e.disposeData(l.dataId), s) { + let w = C.expandShapeToKeepDim(b.shape, m); + b.shape = w; } return b; } -var $P = { kernelName: Ho, backendName: "wasm", setupFunc: Tre, kernelFunc: _re }; -function Og(r15) { - let t8; - function e(n) { - t8 = n.wasm.cwrap(r15, null, ["number", "number", "number", "number", "number"]); +var CO = { kernelName: bn, backendName: "wasm", setupFunc: ene, kernelFunc: tne }; +function jg(r16) { + let e; + function t10(n) { + e = n.wasm.cwrap(r16, null, ["number", "number", "number", "number", "number"]); } function o(n) { - let { backend: s, inputs: a, attrs: i } = n, { axis: p } = i, { x: u } = a, c = s.dataIdMap.get(u.dataId).id, l = c, m = u, { transposed: d, axes: f, inputWasTransposed: h } = Tr(u, p, s); + let { backend: s, inputs: a, attrs: i } = n, { axis: p } = i, { x: u } = a, l = s.dataIdMap.get(u.dataId).id, c = l, m = u, { transposed: d, axes: f, inputWasTransposed: h } = $r(u, p, s); if (h) { let k = s.dataIdMap.get(d.dataId).id; - k !== c && (m = d, l = k); - } - let g = m.shape.slice(0, -1), x = s.makeOutput(g, "int32"), b = s.dataIdMap.get(x.dataId).id, C = y.sizeFromShape(x.shape), S = m.shape[f[0]]; - return t8(l, we[m.dtype], C, S, b), h && s.disposeData(d.dataId), x; - } - return { kernelName: r15, backendName: "wasm", setupFunc: e, kernelFunc: o }; -} -var EP = Og(Ys); -var RP = Og(Qs); -var DP = he(Ko); -var AP = he(qo); -var FP = he(jo); -var PP = Ue(Yo, false); -var OP = he(Xo); -var MP; -function $re(r15) { - MP = r15.wasm.cwrap(Qo, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function Ere(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, n = t8.x, s = o.dataIdMap.get(n.dataId).id, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = e, c = w.computePool2DInfo(n.shape, a, i, 1, p, u), l = c.filterHeight, m = c.filterWidth, d = c.padInfo.top, f = c.padInfo.right, h = c.padInfo.bottom, g = c.padInfo.left, x = c.strideHeight, b = c.strideWidth, C = c.inChannels; - if (c.dataFormat !== "channelsLast") - throw new Error(`wasm backend does not support dataFormat:'${c.dataFormat}'. Please use 'channelsLast'.`); - if (c.dilationWidth !== 1 || c.dilationHeight !== 1) - throw new Error(`was backend only supports average pooling with dilation = [1, 1], got [${c.dilationHeight}, ${c.dilationWidth}].`); - let S = o.makeOutput(c.outShape, "float32"), k = o.dataIdMap.get(S.dataId).id; - return MP(s, n.shape[0], n.shape[1], n.shape[2], l, m, d, f, h, g, x, b, C, k), S; -} -var LP = { kernelName: Qo, backendName: "wasm", setupFunc: $re, kernelFunc: Ere }; -var BP; -function Rre(r15) { - BP = r15.wasm.cwrap("AvgPool3D", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function Dre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o, c = w.computePool3DInfo(n.shape, s, a, 1, i, p, u), l = e.makeOutput(c.outShape, n.dtype); - return BP(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(l.dataId).id, c.batchSize, c.inChannels, c.inDepth, c.inHeight, c.inWidth, c.outDepth, c.outHeight, c.outWidth, c.strideDepth, c.strideHeight, c.strideWidth, c.dilationDepth, c.dilationHeight, c.dilationWidth, c.effectiveFilterDepth, c.effectiveFilterHeight, c.effectiveFilterWidth, c.padInfo.front, c.padInfo.top, c.padInfo.left), l; -} -var zP = { kernelName: Zs, backendName: "wasm", setupFunc: Rre, kernelFunc: Dre }; -var VP; -function Are(r15) { - VP = r15.wasm.cwrap("AvgPool3DGrad", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function Fre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o, c = w.computePool3DInfo(s.shape, a, i, 1, p, u), l = e.makeOutput(s.shape, s.dtype); - return VP(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(l.dataId).id, c.batchSize, c.inChannels, c.inDepth, c.inHeight, c.inWidth, c.outDepth, c.outHeight, c.outWidth, c.strideDepth, c.strideHeight, c.strideWidth, c.dilationDepth, c.dilationHeight, c.dilationWidth, c.effectiveFilterDepth, c.effectiveFilterHeight, c.effectiveFilterWidth, c.padInfo.front, c.padInfo.top, c.padInfo.left, c.filterDepth, c.filterHeight, c.filterWidth), l; -} -var WP = { kernelName: Ei, backendName: "wasm", setupFunc: Are, kernelFunc: Fre }; -var UP; -function Pre(r15) { - UP = r15.wasm.cwrap("AvgPoolGrad", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function Ore(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, { filterSize: a, strides: i, pad: p } = o, u = w.computePool2DInfo(s.shape, a, i, 1, p), c = e.makeOutput(s.shape, s.dtype); - return UP(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(c.dataId).id, u.batchSize, u.inChannels, u.inHeight, u.inWidth, u.outHeight, u.outWidth, u.strideHeight, u.strideWidth, u.dilationHeight, u.dilationWidth, u.effectiveFilterHeight, u.effectiveFilterWidth, u.padInfo.top, u.padInfo.left, u.filterHeight, u.filterWidth), c; -} -var GP = { kernelName: $i, backendName: "wasm", setupFunc: Pre, kernelFunc: Ore }; -function zt(r15) { - let { inputs: t8, attrs: e } = r15, { x: o } = t8, { shape: n } = e, s = y.sizeFromShape(o.shape), a = y.inferFromImplicitShape(n, s); - return y.assert(s === y.sizeFromShape(a), () => `new shape: ${a}, old shape: ${o.shape}. New shape and old shape must have the same number of elements.`), r15.backend.incRef(o.dataId), { dataId: o.dataId, shape: a, dtype: o.dtype }; -} -var HP = { kernelName: da, backendName: "wasm", kernelFunc: zt }; -var KP; -function Mre(r15) { - KP = r15.wasm.cwrap(Zo, null, ["number", "array", "number", "number", "array", "number", "number", "number", "number"]); -} -function Lre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s } = t8, { transposeA: a, transposeB: i } = o; + k !== l && (m = d, c = k); + } + let g = m.shape.slice(0, -1), x = s.makeOutput(g, "int32"), b = s.dataIdMap.get(x.dataId).id, w = y.sizeFromShape(x.shape), S = m.shape[f[0]]; + return e(c, we[m.dtype], w, S, b), h && s.disposeData(d.dataId), x; + } + return { kernelName: r16, backendName: "wasm", setupFunc: t10, kernelFunc: o }; +} +var wO = jg(na); +var SO = jg(sa); +var IO = he(Cn); +var vO = he(wn); +var kO = he(Sn); +var NO = He(vn, false); +var TO = he(In); +var _O; +function rne(r16) { + _O = r16.wasm.cwrap(kn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function one(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, n = e.x, s = o.dataIdMap.get(n.dataId).id, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = t10, l = C.computePool2DInfo(n.shape, a, i, 1, p, u), c = l.filterHeight, m = l.filterWidth, d = l.padInfo.top, f = l.padInfo.right, h = l.padInfo.bottom, g = l.padInfo.left, x = l.strideHeight, b = l.strideWidth, w = l.inChannels; + if (l.dataFormat !== "channelsLast") + throw new Error(`wasm backend does not support dataFormat:'${l.dataFormat}'. Please use 'channelsLast'.`); + if (l.dilationWidth !== 1 || l.dilationHeight !== 1) + throw new Error(`was backend only supports average pooling with dilation = [1, 1], got [${l.dilationHeight}, ${l.dilationWidth}].`); + let S = o.makeOutput(l.outShape, "float32"), k = o.dataIdMap.get(S.dataId).id; + return _O(s, n.shape[0], n.shape[1], n.shape[2], c, m, d, f, h, g, x, b, w, k), S; +} +var EO = { kernelName: kn, backendName: "wasm", setupFunc: rne, kernelFunc: one }; +var $O; +function nne(r16) { + $O = r16.wasm.cwrap("AvgPool3D", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function sne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o, l = C.computePool3DInfo(n.shape, s, a, 1, i, p, u), c = t10.makeOutput(l.outShape, n.dtype); + return $O(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(c.dataId).id, l.batchSize, l.inChannels, l.inDepth, l.inHeight, l.inWidth, l.outDepth, l.outHeight, l.outWidth, l.strideDepth, l.strideHeight, l.strideWidth, l.dilationDepth, l.dilationHeight, l.dilationWidth, l.effectiveFilterDepth, l.effectiveFilterHeight, l.effectiveFilterWidth, l.padInfo.front, l.padInfo.top, l.padInfo.left), c; +} +var RO = { kernelName: aa, backendName: "wasm", setupFunc: nne, kernelFunc: sne }; +var DO; +function ane(r16) { + DO = r16.wasm.cwrap("AvgPool3DGrad", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function ine(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o, l = C.computePool3DInfo(s.shape, a, i, 1, p, u), c = t10.makeOutput(s.shape, s.dtype); + return DO(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(c.dataId).id, l.batchSize, l.inChannels, l.inDepth, l.inHeight, l.inWidth, l.outDepth, l.outHeight, l.outWidth, l.strideDepth, l.strideHeight, l.strideWidth, l.dilationDepth, l.dilationHeight, l.dilationWidth, l.effectiveFilterDepth, l.effectiveFilterHeight, l.effectiveFilterWidth, l.padInfo.front, l.padInfo.top, l.padInfo.left, l.filterDepth, l.filterHeight, l.filterWidth), c; +} +var AO = { kernelName: Vi, backendName: "wasm", setupFunc: ane, kernelFunc: ine }; +var FO; +function une(r16) { + FO = r16.wasm.cwrap("AvgPoolGrad", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function pne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, { filterSize: a, strides: i, pad: p } = o, u = C.computePool2DInfo(s.shape, a, i, 1, p), l = t10.makeOutput(s.shape, s.dtype); + return FO(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(l.dataId).id, u.batchSize, u.inChannels, u.inHeight, u.inWidth, u.outHeight, u.outWidth, u.strideHeight, u.strideWidth, u.dilationHeight, u.dilationWidth, u.effectiveFilterHeight, u.effectiveFilterWidth, u.padInfo.top, u.padInfo.left, u.filterHeight, u.filterWidth), l; +} +var PO = { kernelName: zi, backendName: "wasm", setupFunc: une, kernelFunc: pne }; +function Wt(r16) { + let { inputs: e, attrs: t10 } = r16, { x: o } = e, { shape: n } = t10, s = y.sizeFromShape(o.shape), a = y.inferFromImplicitShape(n, s); + return y.assert(s === y.sizeFromShape(a), () => `new shape: ${a}, old shape: ${o.shape}. New shape and old shape must have the same number of elements.`), r16.backend.incRef(o.dataId), { dataId: o.dataId, shape: a, dtype: o.dtype }; +} +var OO = { kernelName: Ca, backendName: "wasm", kernelFunc: Wt }; +var MO; +function lne(r16) { + MO = r16.wasm.cwrap(Nn, null, ["number", "array", "number", "number", "array", "number", "number", "number", "number"]); +} +function cne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s } = e, { transposeA: a, transposeB: i } = o; if (n.dtype !== "float32" || s.dtype !== "float32") throw new Error("BatchMatMul for non non-float32 tensors not yet supported."); - let p = n.shape.length, u = s.shape.length, c = a ? n.shape[p - 2] : n.shape[p - 1], l = i ? s.shape[u - 1] : s.shape[u - 2], m = a ? n.shape[p - 1] : n.shape[p - 2], d = i ? s.shape[u - 2] : s.shape[u - 1], f = n.shape.slice(0, -2), h = s.shape.slice(0, -2), g = y.sizeFromShape(f), x = y.sizeFromShape(h), C = Sr.assertAndGetBroadcastShape(n.shape.slice(0, -2), s.shape.slice(0, -2)).concat([m, d]); - y.assert(c === l, () => `Error in matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`); - let S = a ? [g, c, m] : [g, m, c], k = i ? [x, d, l] : [x, l, d], _ = zt({ inputs: { x: n }, backend: e, attrs: { shape: S } }), E = zt({ inputs: { x: s }, backend: e, attrs: { shape: k } }), R = e.dataIdMap.get(_.dataId).id, D = e.dataIdMap.get(E.dataId).id, P = a ? _.shape[2] : _.shape[1], O = i ? E.shape[1] : E.shape[2], M = Math.max(g, x), L = e.makeOutput([M, P, O], _.dtype), B = e.dataIdMap.get(L.dataId).id, z = new Uint8Array(new Int32Array(_.shape).buffer), U = new Uint8Array(new Int32Array(E.shape).buffer); - return KP(R, z, _.shape.length, D, U, E.shape.length, a, i, B), e.disposeData(_.dataId), e.disposeData(E.dataId), L.shape = C, L; -} -var qP = { kernelName: Zo, backendName: "wasm", setupFunc: Mre, kernelFunc: Lre }; -function Po(r15) { - let { inputs: { x: t8 }, attrs: { begin: e, size: o }, backend: n } = r15, [s, a] = pt.parseSliceParams(t8, e, o), i = pt.isSliceContinous(t8.shape, s, a), p = n.readSync(t8.dataId), u = n.makeOutput(a, t8.dtype), c = y.computeStrides(t8.shape), l = n.dataIdMap.get(u.dataId); + let p = n.shape.length, u = s.shape.length, l = a ? n.shape[p - 2] : n.shape[p - 1], c = i ? s.shape[u - 1] : s.shape[u - 2], m = a ? n.shape[p - 1] : n.shape[p - 2], d = i ? s.shape[u - 2] : s.shape[u - 1], f = n.shape.slice(0, -2), h = s.shape.slice(0, -2), g = y.sizeFromShape(f), x = y.sizeFromShape(h), w = kr.assertAndGetBroadcastShape(n.shape.slice(0, -2), s.shape.slice(0, -2)).concat([m, d]); + y.assert(l === c, () => `Error in matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`); + let S = a ? [g, l, m] : [g, m, l], k = i ? [x, d, c] : [x, c, d], T = Wt({ inputs: { x: n }, backend: t10, attrs: { shape: S } }), E = Wt({ inputs: { x: s }, backend: t10, attrs: { shape: k } }), R = t10.dataIdMap.get(T.dataId).id, D = t10.dataIdMap.get(E.dataId).id, F = a ? T.shape[2] : T.shape[1], O = i ? E.shape[1] : E.shape[2], M = Math.max(g, x), L = t10.makeOutput([M, F, O], T.dtype), B = t10.dataIdMap.get(L.dataId).id, z = new Uint8Array(new Int32Array(T.shape).buffer), U = new Uint8Array(new Int32Array(E.shape).buffer); + return MO(R, z, T.shape.length, D, U, E.shape.length, a, i, B), t10.disposeData(T.dataId), t10.disposeData(E.dataId), L.shape = w, L; +} +var LO = { kernelName: Nn, backendName: "wasm", setupFunc: lne, kernelFunc: cne }; +function an(r16) { + let { inputs: { x: e }, attrs: { begin: t10, size: o }, backend: n } = r16, [s, a] = nt.parseSliceParams(e, t10, o), i = nt.isSliceContinous(e.shape, s, a), p = n.readSync(e.dataId), u = n.makeOutput(a, e.dtype), l = y.computeStrides(e.shape), c = n.dataIdMap.get(u.dataId); if (i) { - let f = pt.computeFlatOffset(s, c); - return t8.dtype === "string" ? l.stringBytes = p.slice(f, f + y.sizeFromShape(a)) : n.typedArrayFromHeap(u).set(p.subarray(f, f + y.sizeFromShape(a))), u; + let f = nt.computeFlatOffset(s, l); + return e.dtype === "string" ? c.stringBytes = p.slice(f, f + y.sizeFromShape(a)) : n.typedArrayFromHeap(u).set(p.subarray(f, f + y.sizeFromShape(a))), u; } - if (t8.dtype === "string") { - let f = ip(p, s, a, t8.shape, t8.dtype); - return l.stringBytes = f, u; + if (e.dtype === "string") { + let f = hp(p, s, a, e.shape, e.dtype); + return c.stringBytes = f, u; } - let m = n.typedArrayFromHeap(u), d = t8.shape.length; + let m = n.typedArrayFromHeap(u), d = e.shape.length; if (d === 2) - Bre(p, c[0], m, s, a); + mne(p, l[0], m, s, a); else if (d === 3) - zre(p, c[0], c[1], m, s, a); + dne(p, l[0], l[1], m, s, a); else if (d === 4) - Vre(p, c[0], c[1], c[2], m, s, a); + fne(p, l[0], l[1], l[2], m, s, a); else { - let f = ip(p, s, a, t8.shape, t8.dtype); + let f = hp(p, s, a, e.shape, e.dtype); m.set(f); } return u; } -function Bre(r15, t8, e, o, n) { +function mne(r16, e, t10, o, n) { let s = 0, a = o[0], i = o[1], p = a + n[0]; for (let u = a; u < p; u++) { - let c = u * t8 + i; - e.set(r15.subarray(c, c + n[1]), s), s += n[1]; + let l = u * e + i; + t10.set(r16.subarray(l, l + n[1]), s), s += n[1]; } } -function zre(r15, t8, e, o, n, s) { - let a = 0, i = n[0], p = n[1], u = n[2], c = i + s[0], l = p + s[1]; - for (let m = i; m < c; m++) - for (let d = p; d < l; d++) { - let f = m * t8 + d * e + u; - o.set(r15.subarray(f, f + s[2]), a), a += s[2]; +function dne(r16, e, t10, o, n, s) { + let a = 0, i = n[0], p = n[1], u = n[2], l = i + s[0], c = p + s[1]; + for (let m = i; m < l; m++) + for (let d = p; d < c; d++) { + let f = m * e + d * t10 + u; + o.set(r16.subarray(f, f + s[2]), a), a += s[2]; } } -function Vre(r15, t8, e, o, n, s, a) { - let i = 0, p = s[0], u = s[1], c = s[2], l = p + a[0], m = u + a[1], d = c + a[2], f = s[3]; - for (let h = p; h < l; h++) +function fne(r16, e, t10, o, n, s, a) { + let i = 0, p = s[0], u = s[1], l = s[2], c = p + a[0], m = u + a[1], d = l + a[2], f = s[3]; + for (let h = p; h < c; h++) for (let g = u; g < m; g++) - for (let x = c; x < d; x++) { - let b = h * t8 + g * e + x * o + f; - n.set(r15.subarray(b, b + a[3]), i), i += a[3]; - } -} -var jP = { kernelName: ha, backendName: "wasm", kernelFunc: Po }; -function Wre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, crops: a } = o, i = s.reduce((x, b) => x * b), p = w.getReshaped(n.shape, s, i), u = w.getPermuted(p.length, s.length), c = w.getReshapedPermuted(n.shape, s, i), l = w.getSliceBeginCoords(a, s.length), m = w.getSliceSize(c, a, s.length), d = zt({ inputs: { x: n }, backend: e, attrs: { shape: p } }), f = ho({ inputs: { x: d }, backend: e, attrs: { perm: u } }), h = zt({ inputs: { x: f }, backend: e, attrs: { shape: c } }), g = Po({ inputs: { x: h }, backend: e, attrs: { begin: l, size: m } }); - return e.disposeData(d.dataId), e.disposeData(f.dataId), e.disposeData(h.dataId), g; -} -var XP = { kernelName: Js, backendName: "wasm", kernelFunc: Wre }; -var YP; -function Ure(r15) { - YP = r15.wasm.cwrap(Jo, null, ["number", "number", "boolean", "number", "number", "number"]); -} -function Gre(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { x: n, weights: s } = e, { size: a } = o, i = s.shape.reduce((l, m) => l * m, 1) !== 0, p = n.shape.length === 1 ? [a] : [n.shape[0], a], u = t8.makeOutput(p, s.dtype); - function c(l) { - return t8.dataIdMap.get(l.dataId).id; - } - return YP(c(n), a, i, c(s), we[s.dtype], c(u)), u; -} -var QP = { kernelName: Jo, backendName: "wasm", setupFunc: Ure, kernelFunc: Gre }; -var Hre = true; -var ZP = Ue(qa, Hre); -function Kre(r15) { - let { inputs: t8, backend: e } = r15, { s0: o, s1: n } = t8, s = e.typedArrayFromHeap(o), a = e.typedArrayFromHeap(n), i = w.assertAndGetBroadcastShape(Array.from(s), Array.from(a)); - return e.makeOutput([i.length], "int32", void 0, new Int32Array(i)); -} -var JP = { kernelName: ea, backendName: "wasm", kernelFunc: Kre }; -function Or(r15) { - let { inputs: { x: t8 }, attrs: { dtype: e }, backend: o } = r15, n = o.makeOutput(t8.shape, e), s = o.typedArrayFromHeap(t8); + for (let x = l; x < d; x++) { + let b = h * e + g * t10 + x * o + f; + n.set(r16.subarray(b, b + a[3]), i), i += a[3]; + } +} +var BO = { kernelName: _s, backendName: "wasm", kernelFunc: an }; +function hne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, crops: a } = o, i = s.reduce((x, b) => x * b), p = C.getReshaped(n.shape, s, i), u = C.getPermuted(p.length, s.length), l = C.getReshapedPermuted(n.shape, s, i), c = C.getSliceBeginCoords(a, s.length), m = C.getSliceSize(l, a, s.length), d = Wt({ inputs: { x: n }, backend: t10, attrs: { shape: p } }), f = Vo({ inputs: { x: d }, backend: t10, attrs: { perm: u } }), h = Wt({ inputs: { x: f }, backend: t10, attrs: { shape: l } }), g = an({ inputs: { x: h }, backend: t10, attrs: { begin: c, size: m } }); + return t10.disposeData(d.dataId), t10.disposeData(f.dataId), t10.disposeData(h.dataId), g; +} +var zO = { kernelName: ia, backendName: "wasm", kernelFunc: hne }; +var VO; +function gne(r16) { + VO = r16.wasm.cwrap(Tn, null, ["number", "number", "boolean", "number", "number", "number"]); +} +function xne(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { x: n, weights: s } = t10, { size: a } = o, i = s.shape.reduce((c, m) => c * m, 1) !== 0, p = n.shape.length === 1 ? [a] : [n.shape[0], a], u = e.makeOutput(p, s.dtype); + function l(c) { + return e.dataIdMap.get(c.dataId).id; + } + return VO(l(n), a, i, l(s), we[s.dtype], l(u)), u; +} +var WO = { kernelName: Tn, backendName: "wasm", setupFunc: gne, kernelFunc: xne }; +var yne = true; +var UO = He(_n, yne); +function bne(r16) { + let { inputs: e, backend: t10 } = r16, { s0: o, s1: n } = e, s = t10.typedArrayFromHeap(o), a = t10.typedArrayFromHeap(n), i = C.assertAndGetBroadcastShape(Array.from(s), Array.from(a)); + return t10.makeOutput([i.length], "int32", void 0, new Int32Array(i)); +} +var GO = { kernelName: ua, backendName: "wasm", kernelFunc: bne }; +function Vr(r16) { + let { inputs: { x: e }, attrs: { dtype: t10 }, backend: o } = r16, n = o.makeOutput(e.shape, t10), s = o.typedArrayFromHeap(e); return o.typedArrayFromHeap(n).set(s), n; } -var eO = { kernelName: yo, backendName: "wasm", kernelFunc: Or }; -var tO = he(en); -var rO; -function qre(r15) { - rO = r15.wasm.cwrap(bo, null, ["number", "number", "number", "number"]); -} -function jre(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { clipValueMin: s, clipValueMax: a } = o, i = e.dataIdMap.get(n.dataId).id, p = e.makeOutput(n.shape, n.dtype), u = e.dataIdMap.get(p.dataId).id; - return rO(i, s, a, u), p; -} -var oO = { kernelName: bo, backendName: "wasm", setupFunc: qre, kernelFunc: jre }; -function Fv(r15) { - let { inputs: t8, backend: e } = r15, o = y.parseAxisParam(r15.attrs.axis, t8[0].shape)[0], n = t8.map((d) => d.shape); - w.assertParamsConsistent(n, o); - let s = w.computeOutShape(t8.map((d) => d.shape), o), a = t8.filter((d) => y.sizeFromShape(d.shape) > 0); +var HO = { kernelName: ho, backendName: "wasm", kernelFunc: Vr }; +var KO = he(go); +var qO; +function Cne(r16) { + qO = r16.wasm.cwrap(Go, null, ["number", "number", "number", "number"]); +} +function wne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { clipValueMin: s, clipValueMax: a } = o, i = t10.dataIdMap.get(n.dataId).id, p = t10.makeOutput(n.shape, n.dtype), u = t10.dataIdMap.get(p.dataId).id; + return qO(i, s, a, u), p; +} +var jO = { kernelName: Go, backendName: "wasm", setupFunc: Cne, kernelFunc: wne }; +function j0(r16) { + let { inputs: e, backend: t10 } = r16, o = y.parseAxisParam(r16.attrs.axis, e[0].shape)[0], n = e.map((d) => d.shape); + C.assertParamsConsistent(n, o); + let s = C.computeOutShape(e.map((d) => d.shape), o), a = e.filter((d) => y.sizeFromShape(d.shape) > 0); if (a.length === 1) - return vp({ inputs: { x: a[0] }, backend: e }); - let i = e.makeOutput(s, t8[0].dtype); + return Dp({ inputs: { x: a[0] }, backend: t10 }); + let i = t10.makeOutput(s, e[0].dtype); if (y.sizeFromShape(s) === 0) return i; if (a[0].dtype === "string") { - let d = a.map((C) => { - let k = [-1, y.sizeFromShape(C.shape.slice(o))]; - return zt({ inputs: { x: C }, backend: e, attrs: { shape: k } }); - }), f = d.map((C) => ({ vals: e.readSync(C.dataId), shape: C.shape })); - s = w.computeOutShape(d.map((C) => C.shape), 1); - let h = d[0].shape[0] === 1, g = np(f, s, t8[0].dtype, h), x = w.computeOutShape(a.map((C) => C.shape), o); + let d = a.map((w) => { + let k = [-1, y.sizeFromShape(w.shape.slice(o))]; + return Wt({ inputs: { x: w }, backend: t10, attrs: { shape: k } }); + }), f = d.map((w) => ({ vals: t10.readSync(w.dataId), shape: w.shape })); + s = C.computeOutShape(d.map((w) => w.shape), 1); + let h = d[0].shape[0] === 1, g = mp(f, s, e[0].dtype, h), x = C.computeOutShape(a.map((w) => w.shape), o); i.shape = x; - let b = e.dataIdMap.get(i.dataId); - return b.stringBytes = w.fromStringArrayToUint8(g), d.forEach((C) => e.disposeData(C.dataId)), i; + let b = t10.dataIdMap.get(i.dataId); + return b.stringBytes = C.fromStringArrayToUint8(g), d.forEach((w) => t10.disposeData(w.dataId)), i; } - let p = y.sizeFromShape(a[0].shape.slice(0, o)), u = 0, c = a.map((d) => { + let p = y.sizeFromShape(a[0].shape.slice(0, o)), u = 0, l = a.map((d) => { let f = y.sizeFromShape(d.shape.slice(o)); return u += f, f; - }), l = a.map((d) => e.typedArrayFromHeap(d)), m = e.typedArrayFromHeap(i); + }), c = a.map((d) => t10.typedArrayFromHeap(d)), m = t10.typedArrayFromHeap(i); for (let d = 0; d < p; d++) { let f = d * u; - for (let h = 0; h < l.length; h++) { - let g = c[h], x = d * g, b = l[h].subarray(x, x + g); + for (let h = 0; h < c.length; h++) { + let g = l[h], x = d * g, b = c[h].subarray(x, x + g); m.set(b, f), f += g; } } return i; } -var nO = { kernelName: ta, backendName: "wasm", kernelFunc: Fv }; -var sO; -function Xre(r15) { - sO = r15.wasm.cwrap(tn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var XO = { kernelName: pa, backendName: "wasm", kernelFunc: j0 }; +var YO; +function Sne(r16) { + YO = r16.wasm.cwrap(En, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function Yre(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { x: n, filter: s } = t8, a = o.dataIdMap.get(n.dataId).id, i = o.dataIdMap.get(s.dataId).id, { strides: p, dilations: u, pad: c, dimRoundingMode: l, dataFormat: m } = e, d = w.convertConv2DDataFormat(m), f = w.computeConv2DInfo(n.shape, s.shape, p, u, c, l, false, d), h = f.filterHeight, g = f.filterWidth, x = f.padInfo.top, b = f.padInfo.right, C = f.padInfo.bottom, S = f.padInfo.left, k = f.dilationHeight, _ = f.dilationWidth, E = f.strideHeight, R = f.strideWidth, D = f.inChannels, P = f.outChannels, O = f.padInfo.type === "SAME" ? 1 : 0; +function Ine(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { x: n, filter: s } = e, a = o.dataIdMap.get(n.dataId).id, i = o.dataIdMap.get(s.dataId).id, { strides: p, dilations: u, pad: l, dimRoundingMode: c, dataFormat: m } = t10, d = C.convertConv2DDataFormat(m), f = C.computeConv2DInfo(n.shape, s.shape, p, u, l, c, false, d), h = f.filterHeight, g = f.filterWidth, x = f.padInfo.top, b = f.padInfo.right, w = f.padInfo.bottom, S = f.padInfo.left, k = f.dilationHeight, T = f.dilationWidth, E = f.strideHeight, R = f.strideWidth, D = f.inChannels, F = f.outChannels, O = f.padInfo.type === "SAME" ? 1 : 0; if (f.dataFormat !== "channelsLast") throw new Error(`wasm backend Conv2D does not support dataFormat:'${f.dataFormat}'. Please use 'channelsLast'.`); let M = o.makeOutput(f.outShape, "float32"), L = o.dataIdMap.get(M.dataId).id; - return sO(a, n.shape[0], n.shape[1], n.shape[2], i, h, g, x, b, C, S, O, k, _, E, R, D, P, L), M; + return YO(a, n.shape[0], n.shape[1], n.shape[2], i, h, g, x, b, w, S, O, k, T, E, R, D, F, L), M; } -var aO = { kernelName: tn, backendName: "wasm", setupFunc: Xre, kernelFunc: Yre }; -var iO; -function Qre(r15) { - iO = r15.wasm.cwrap(rn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var QO = { kernelName: En, backendName: "wasm", setupFunc: Sne, kernelFunc: Ine }; +var ZO; +function vne(r16) { + ZO = r16.wasm.cwrap($n, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function Zre(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { dy: n, filter: s } = e, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, inputShape: c } = o, l = 1, m = w.convertConv2DDataFormat(p), d = w.computeConv2DInfo(c, s.shape, a, l, i, u, false, m), { batchSize: f, filterHeight: h, filterWidth: g, inChannels: x, inHeight: b, inWidth: C, outChannels: S, outHeight: k, outWidth: _, strideHeight: E, strideWidth: R } = d, D = h - 1 - d.padInfo.top, P = g - 1 - d.padInfo.left, O = d.dataFormat === "channelsLast", M = y.computeStrides(d.inShape), L = y.computeStrides(n.shape), [B, z, U] = y.computeStrides(s.shape), j = M[0], q = O ? M[1] : M[2], Y = O ? M[2] : 1, J = O ? 1 : M[1], re = L[0], ne = O ? L[1] : L[2], ee = O ? L[2] : 1, oe = O ? 1 : L[1], ie = t8.makeOutput(d.inShape, "float32"), le = t8.dataIdMap.get(ie.dataId).id, be = t8.dataIdMap.get(n.dataId).id, _e = t8.dataIdMap.get(s.dataId).id; - return iO(be, _e, f, h, g, b, C, x, k, _, S, E, R, D, P, B, z, U, j, q, Y, J, re, ne, ee, oe, le), ie; +function kne(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { dy: n, filter: s } = t10, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, inputShape: l } = o, c = 1, m = C.convertConv2DDataFormat(p), d = C.computeConv2DInfo(l, s.shape, a, c, i, u, false, m), { batchSize: f, filterHeight: h, filterWidth: g, inChannels: x, inHeight: b, inWidth: w, outChannels: S, outHeight: k, outWidth: T, strideHeight: E, strideWidth: R } = d, D = h - 1 - d.padInfo.top, F = g - 1 - d.padInfo.left, O = d.dataFormat === "channelsLast", M = y.computeStrides(d.inShape), L = y.computeStrides(n.shape), [B, z, U] = y.computeStrides(s.shape), j = M[0], q = O ? M[1] : M[2], Y = O ? M[2] : 1, J = O ? 1 : M[1], re = L[0], ne = O ? L[1] : L[2], ee = O ? L[2] : 1, oe = O ? 1 : L[1], ue = e.makeOutput(d.inShape, "float32"), me = e.dataIdMap.get(ue.dataId).id, be = e.dataIdMap.get(n.dataId).id, _e = e.dataIdMap.get(s.dataId).id; + return ZO(be, _e, f, h, g, b, w, x, k, T, S, E, R, D, F, B, z, U, j, q, Y, J, re, ne, ee, oe, me), ue; } -var uO = { kernelName: rn, backendName: "wasm", setupFunc: Qre, kernelFunc: Zre }; -var pO; -function Jre(r15) { - pO = r15.wasm.cwrap(on, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var JO = { kernelName: $n, backendName: "wasm", setupFunc: vne, kernelFunc: kne }; +var eM; +function Nne(r16) { + eM = r16.wasm.cwrap(Rn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function eoe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p } = o; +function Tne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p } = o; if (n.dtype !== "float32") throw new Error(`Tensor x must have dtype float32, got ${n.dtype}`); if (s.dtype !== "float32") throw new Error(`Tensor filter must have dtype float32, got ${s.dtype}`); - let u = w.computeConv3DInfo(n.shape, s.shape, a, p, i), c = e.makeOutput(u.outShape, n.dtype); - return pO(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(c.dataId).id, u.batchSize, u.inDepth, u.inHeight, u.inWidth, u.inChannels, u.outDepth, u.outHeight, u.outWidth, u.outChannels, u.strideDepth, u.strideHeight, u.strideWidth, u.dilationDepth, u.dilationHeight, u.dilationWidth, u.filterDepth, u.filterHeight, u.filterWidth, u.padInfo.front, u.padInfo.top, u.padInfo.left), c; + let u = C.computeConv3DInfo(n.shape, s.shape, a, p, i), l = t10.makeOutput(u.outShape, n.dtype); + return eM(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(l.dataId).id, u.batchSize, u.inDepth, u.inHeight, u.inWidth, u.inChannels, u.outDepth, u.outHeight, u.outWidth, u.outChannels, u.strideDepth, u.strideHeight, u.strideWidth, u.dilationDepth, u.dilationHeight, u.dilationWidth, u.filterDepth, u.filterHeight, u.filterWidth, u.padInfo.front, u.padInfo.top, u.padInfo.left), l; } -var cO = { kernelName: on, backendName: "wasm", setupFunc: Jre, kernelFunc: eoe }; -var lO; -function toe(r15) { - lO = r15.wasm.cwrap(ja, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var tM = { kernelName: Rn, backendName: "wasm", setupFunc: Nne, kernelFunc: Tne }; +var rM; +function _ne(r16) { + rM = r16.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", "number"]); } -function roe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, pad: i, filterShape: p } = o; +function Ene(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, pad: i, filterShape: p } = o; if (n.dtype !== "float32") throw new Error(`Tensor dy must have dtype float32, got ${n.dtype}`); if (s.dtype !== "float32") throw new Error(`Tensor filter must have dtype float32, got ${s.dtype}`); - let u = w.computeConv3DInfo(n.shape, p, a, 1, i), c = e.makeOutput(u.filterShape, s.dtype); - return lO(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(c.dataId).id, u.batchSize, u.inDepth, u.inHeight, u.inWidth, u.inChannels, u.outDepth, u.outHeight, u.outWidth, u.outChannels, u.strideDepth, u.strideHeight, u.strideWidth, u.dilationDepth, u.dilationHeight, u.dilationWidth, u.filterDepth, u.filterHeight, u.filterWidth, u.padInfo.front, u.padInfo.top, u.padInfo.left), c; + let u = C.computeConv3DInfo(n.shape, p, a, 1, i), l = t10.makeOutput(u.filterShape, s.dtype); + return rM(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(l.dataId).id, u.batchSize, u.inDepth, u.inHeight, u.inWidth, u.inChannels, u.outDepth, u.outHeight, u.outWidth, u.outChannels, u.strideDepth, u.strideHeight, u.strideWidth, u.dilationDepth, u.dilationHeight, u.dilationWidth, u.filterDepth, u.filterHeight, u.filterWidth, u.padInfo.front, u.padInfo.top, u.padInfo.left), l; } -var mO = { kernelName: ja, backendName: "wasm", setupFunc: toe, kernelFunc: roe }; -var dO; -function ooe(r15) { - dO = r15.wasm.cwrap(nn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var oM = { kernelName: ti, backendName: "wasm", setupFunc: _ne, kernelFunc: Ene }; +var nM; +function $ne(r16) { + nM = r16.wasm.cwrap(Dn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function noe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { pad: a, strides: i, inputShape: p } = o; +function Rne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { pad: a, strides: i, inputShape: p } = o; if (n.dtype !== "float32") throw new Error(`Tensor dy must have dtype float32, got ${n.dtype}`); if (s.dtype !== "float32") throw new Error(`Tensor filter must have dtype float32, got ${s.dtype}`); - let u = w.computeConv3DInfo(p, s.shape, i, 1, a), c = e.makeOutput(u.inShape, n.dtype); - return dO(e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(c.dataId).id, u.batchSize, u.inDepth, u.inHeight, u.inWidth, u.inChannels, u.outDepth, u.outHeight, u.outWidth, u.outChannels, u.strideDepth, u.strideHeight, u.strideWidth, u.dilationDepth, u.dilationHeight, u.dilationWidth, u.filterDepth, u.filterHeight, u.filterWidth, u.padInfo.front, u.padInfo.top, u.padInfo.left), c; -} -var fO = { kernelName: nn, backendName: "wasm", setupFunc: ooe, kernelFunc: noe }; -var hO = he(sn); -var gO = he(an); -var Pv; -(function(r15) { - r15[r15.bilinear = 0] = "bilinear", r15[r15.nearest = 1] = "nearest"; -})(Pv || (Pv = {})); -var xO; -function soe(r15) { - xO = r15.wasm.cwrap(cn, null, ["number", "number", "number", "number", "array", "number", "number", "number", "number", "number"]); -} -function aoe(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { method: n, extrapolationValue: s, cropSize: a } = o, { image: i, boxes: p, boxInd: u } = e, c = p.shape[0], [l, m] = a, d = [c, l, m, i.shape[3]], f = t8.dataIdMap.get(i.dataId), h; - i.dtype !== "float32" && (h = Or({ backend: t8, inputs: { x: i }, attrs: { dtype: "float32" } }), f = t8.dataIdMap.get(h.dataId)); - let g = f.id, x = t8.dataIdMap.get(p.dataId).id, b = t8.dataIdMap.get(u.dataId).id, C = t8.makeOutput(d, "float32"), S = t8.dataIdMap.get(C.dataId).id, k = new Uint8Array(new Int32Array(i.shape).buffer); - return xO(g, x, b, c, k, l, m, Pv[n], s, S), h != null && t8.disposeData(h.dataId), C; -} -var yO = { kernelName: cn, backendName: "wasm", setupFunc: soe, kernelFunc: aoe }; -var bO; -function ioe(r15) { - bO = r15.wasm.cwrap(un, null, ["number", "number", "number", "number", "number", "number"]); + let u = C.computeConv3DInfo(p, s.shape, i, 1, a), l = t10.makeOutput(u.inShape, n.dtype); + return nM(t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(l.dataId).id, u.batchSize, u.inDepth, u.inHeight, u.inWidth, u.inChannels, u.outDepth, u.outHeight, u.outWidth, u.outChannels, u.strideDepth, u.strideHeight, u.strideWidth, u.dilationDepth, u.dilationHeight, u.dilationWidth, u.filterDepth, u.filterHeight, u.filterWidth, u.padInfo.front, u.padInfo.top, u.padInfo.left), l; +} +var sM = { kernelName: Dn, backendName: "wasm", setupFunc: $ne, kernelFunc: Rne }; +var aM = he(An); +var iM = he(Fn); +var X0; +(function(r16) { + r16[r16.bilinear = 0] = "bilinear", r16[r16.nearest = 1] = "nearest"; +})(X0 || (X0 = {})); +var uM; +function Dne(r16) { + uM = r16.wasm.cwrap(Mn, null, ["number", "number", "number", "number", "array", "number", "number", "number", "number", "number"]); +} +function Ane(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { method: n, extrapolationValue: s, cropSize: a } = o, { image: i, boxes: p, boxInd: u } = t10, l = p.shape[0], [c, m] = a, d = [l, c, m, i.shape[3]], f = e.dataIdMap.get(i.dataId), h; + i.dtype !== "float32" && (h = Vr({ backend: e, inputs: { x: i }, attrs: { dtype: "float32" } }), f = e.dataIdMap.get(h.dataId)); + let g = f.id, x = e.dataIdMap.get(p.dataId).id, b = e.dataIdMap.get(u.dataId).id, w = e.makeOutput(d, "float32"), S = e.dataIdMap.get(w.dataId).id, k = new Uint8Array(new Int32Array(i.shape).buffer); + return uM(g, x, b, l, k, c, m, X0[n], s, S), h != null && e.disposeData(h.dataId), w; +} +var pM = { kernelName: Mn, backendName: "wasm", setupFunc: Dne, kernelFunc: Ane }; +var lM; +function Fne(r16) { + lM = r16.wasm.cwrap(Pn, null, ["number", "number", "number", "number", "number", "number"]); } -function uoe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o, p = n.shape.length; +function Pne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o, p = n.shape.length; y.assert(n.dtype === "float32" || n.dtype === "int32", () => `cumprod does not support ${n.dtype} tensors in the WASM backend`); - let u = w.getAxesPermutation([s], p), c = n; - u !== null && (c = ho({ inputs: { x: n }, attrs: { perm: u }, backend: e })); - let l = w.getInnerMostAxes(1, p)[0]; - w.assertAxesAreInnerMostDims("cumprod", [l], p); - let m = e.makeOutput(c.shape, c.dtype), d = c.shape[l], f = e.dataIdMap.get(c.dataId).id, h = e.dataIdMap.get(m.dataId).id; - bO(f, a ? 1 : 0, i ? 1 : 0, d, h, we[n.dtype]); + let u = C.getAxesPermutation([s], p), l = n; + u !== null && (l = Vo({ inputs: { x: n }, attrs: { perm: u }, backend: t10 })); + let c = C.getInnerMostAxes(1, p)[0]; + C.assertAxesAreInnerMostDims("cumprod", [c], p); + let m = t10.makeOutput(l.shape, l.dtype), d = l.shape[c], f = t10.dataIdMap.get(l.dataId).id, h = t10.dataIdMap.get(m.dataId).id; + lM(f, a ? 1 : 0, i ? 1 : 0, d, h, we[n.dtype]); let g = m; if (u !== null) { - let x = w.getUndoAxesPermutation(u); - g = ho({ inputs: { x: m }, attrs: { perm: x }, backend: e }), e.disposeData(c.dataId), e.disposeData(m.dataId); + let x = C.getUndoAxesPermutation(u); + g = Vo({ inputs: { x: m }, attrs: { perm: x }, backend: t10 }), t10.disposeData(l.dataId), t10.disposeData(m.dataId); } return g; } -var CO = { kernelName: un, backendName: "wasm", setupFunc: ioe, kernelFunc: uoe }; -var wO; -function poe(r15) { - wO = r15.wasm.cwrap(pn, null, ["number", "number", "number", "number", "number", "number"]); +var cM = { kernelName: Pn, backendName: "wasm", setupFunc: Fne, kernelFunc: Pne }; +var mM; +function One(r16) { + mM = r16.wasm.cwrap(On, null, ["number", "number", "number", "number", "number", "number"]); } -function coe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o, p = n.shape.length; +function Mne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o, p = n.shape.length; y.assert(n.dtype === "float32" || n.dtype === "int32", () => `cumsum does not support ${n.dtype} tensors in the WASM backend`); - let u = w.getAxesPermutation([s], p), c = n; - u !== null && (c = ho({ inputs: { x: n }, attrs: { perm: u }, backend: e })); - let l = w.getInnerMostAxes(1, p)[0]; - w.assertAxesAreInnerMostDims("cumsum", [l], p); - let m = e.makeOutput(c.shape, c.dtype), d = c.shape[l], f = e.dataIdMap.get(c.dataId).id, h = e.dataIdMap.get(m.dataId).id; - wO(f, a ? 1 : 0, i ? 1 : 0, d, h, we[n.dtype]); + let u = C.getAxesPermutation([s], p), l = n; + u !== null && (l = Vo({ inputs: { x: n }, attrs: { perm: u }, backend: t10 })); + let c = C.getInnerMostAxes(1, p)[0]; + C.assertAxesAreInnerMostDims("cumsum", [c], p); + let m = t10.makeOutput(l.shape, l.dtype), d = l.shape[c], f = t10.dataIdMap.get(l.dataId).id, h = t10.dataIdMap.get(m.dataId).id; + mM(f, a ? 1 : 0, i ? 1 : 0, d, h, we[n.dtype]); let g = m; if (u !== null) { - let x = w.getUndoAxesPermutation(u); - g = ho({ inputs: { x: m }, attrs: { perm: x }, backend: e }), e.disposeData(c.dataId), e.disposeData(m.dataId); + let x = C.getUndoAxesPermutation(u); + g = Vo({ inputs: { x: m }, attrs: { perm: x }, backend: t10 }), t10.disposeData(l.dataId), t10.disposeData(m.dataId); } return g; } -var SO = { kernelName: pn, backendName: "wasm", setupFunc: poe, kernelFunc: coe }; -var IO; -function loe(r15) { - IO = r15.wasm.cwrap("DenseBincount", null, ["number", "array", "number", "number", "boolean", "number", "number", "boolean", "number"]); +var dM = { kernelName: On, backendName: "wasm", setupFunc: One, kernelFunc: Mne }; +var fM; +function Lne(r16) { + fM = r16.wasm.cwrap("DenseBincount", null, ["number", "array", "number", "number", "boolean", "number", "number", "boolean", "number"]); } -function moe(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { x: n, weights: s } = e, { size: a, binaryOutput: i } = o, p = s.shape.reduce((m, d) => m * d, 1) !== 0, u = n.shape.length === 1 ? [a] : [n.shape[0], a], c = t8.makeOutput(u, s.dtype); - function l(m) { - return t8.dataIdMap.get(m.dataId).id; +function Bne(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { x: n, weights: s } = t10, { size: a, binaryOutput: i } = o, p = s.shape.reduce((m, d) => m * d, 1) !== 0, u = n.shape.length === 1 ? [a] : [n.shape[0], a], l = e.makeOutput(u, s.dtype); + function c(m) { + return e.dataIdMap.get(m.dataId).id; } - return IO(l(n), new Uint8Array(new Int32Array(n.shape).buffer), n.shape.length, a, p, l(s), we[s.dtype], i, l(c)), c; + return fM(c(n), new Uint8Array(new Int32Array(n.shape).buffer), n.shape.length, a, p, c(s), we[s.dtype], i, c(l)), l; } -var vO = { kernelName: ra, backendName: "wasm", setupFunc: loe, kernelFunc: moe }; -var kO; -function doe(r15) { - kO = r15.wasm.cwrap(ln, null, ["number", "number", "number", "array", "number", "array", "array", "number", "number"]); +var hM = { kernelName: la, backendName: "wasm", setupFunc: Lne, kernelFunc: Bne }; +var gM; +function zne(r16) { + gM = r16.wasm.cwrap(Ln, null, ["number", "number", "number", "array", "number", "array", "array", "number", "number"]); } -function foe(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { x: n } = e, { blockSize: s, dataFormat: a } = o, i = n.shape[0], p = a === "NHWC" ? n.shape[1] : n.shape[2], u = a === "NHWC" ? n.shape[2] : n.shape[3], c = a === "NHWC" ? n.shape[3] : n.shape[1], l = p * s, m = u * s, d = c / (s * s), f = a === "NHWC" ? [i, l, m, d] : [i, d, l, m], h = t8.makeOutput(f, "float32"), x = t8.dataIdMap.get(n.dataId).id, b = new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer), C = new Uint8Array(new Int32Array(f).buffer), S = new Uint8Array(new Int32Array(y.computeStrides(f)).buffer), k = t8.dataIdMap.get(h.dataId).id; - return kO(x, s, a === "NHWC" ? 1 : 0, b, n.shape.length - 1, C, S, f.length, k), h; +function Vne(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { x: n } = t10, { blockSize: s, dataFormat: a } = o, i = n.shape[0], p = a === "NHWC" ? n.shape[1] : n.shape[2], u = a === "NHWC" ? n.shape[2] : n.shape[3], l = a === "NHWC" ? n.shape[3] : n.shape[1], c = p * s, m = u * s, d = l / (s * s), f = a === "NHWC" ? [i, c, m, d] : [i, d, c, m], h = e.makeOutput(f, "float32"), x = e.dataIdMap.get(n.dataId).id, b = new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer), w = new Uint8Array(new Int32Array(f).buffer), S = new Uint8Array(new Int32Array(y.computeStrides(f)).buffer), k = e.dataIdMap.get(h.dataId).id; + return gM(x, s, a === "NHWC" ? 1 : 0, b, n.shape.length - 1, w, S, f.length, k), h; } -var NO = { kernelName: ln, backendName: "wasm", setupFunc: doe, kernelFunc: foe }; -var TO; -function hoe(r15) { - TO = r15.wasm.cwrap(mn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var xM = { kernelName: Ln, backendName: "wasm", setupFunc: zne, kernelFunc: Vne }; +var yM; +function Wne(r16) { + yM = r16.wasm.cwrap(Bn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function goe(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { x: n, filter: s } = t8, a = o.dataIdMap.get(n.dataId).id, i = o.dataIdMap.get(s.dataId).id, { strides: p, dilations: u, pad: c, dimRoundingMode: l } = e, m = u == null ? [1, 1] : u, d = w.computeConv2DInfo(n.shape, s.shape, p, m, c, l, true), f = d.filterHeight, h = d.filterWidth, g = d.padInfo.top, x = d.padInfo.right, b = d.padInfo.bottom, C = d.padInfo.left, S = d.dilationHeight, k = d.dilationWidth, _ = d.strideHeight, E = d.strideWidth, R = d.inChannels, D = d.outChannels, P = d.padInfo.type === "SAME" ? 1 : 0; +function Une(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { x: n, filter: s } = e, a = o.dataIdMap.get(n.dataId).id, i = o.dataIdMap.get(s.dataId).id, { strides: p, dilations: u, pad: l, dimRoundingMode: c } = t10, m = u == null ? [1, 1] : u, d = C.computeConv2DInfo(n.shape, s.shape, p, m, l, c, true), f = d.filterHeight, h = d.filterWidth, g = d.padInfo.top, x = d.padInfo.right, b = d.padInfo.bottom, w = d.padInfo.left, S = d.dilationHeight, k = d.dilationWidth, T = d.strideHeight, E = d.strideWidth, R = d.inChannels, D = d.outChannels, F = d.padInfo.type === "SAME" ? 1 : 0; if (d.dataFormat !== "channelsLast") throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`); let O = o.makeOutput(d.outShape, "float32"), M = o.dataIdMap.get(O.dataId).id; - return TO(a, n.shape[0], n.shape[1], n.shape[2], i, f, h, g, x, b, C, P, S, k, _, E, R, D, M), O; + return yM(a, n.shape[0], n.shape[1], n.shape[2], i, f, h, g, x, b, w, F, S, k, T, E, R, D, M), O; } -var _O = { kernelName: mn, backendName: "wasm", setupFunc: hoe, kernelFunc: goe }; -var $O; -function xoe(r15) { - $O = r15.wasm.cwrap("Diag", null, ["number", "number", "number", "number"]); +var bM = { kernelName: Bn, backendName: "wasm", setupFunc: Wne, kernelFunc: Une }; +var CM; +function Gne(r16) { + CM = r16.wasm.cwrap("Diag", null, ["number", "number", "number", "number"]); } -function yoe(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8, n = y.sizeFromShape(o.shape), s = e.makeOutput([...o.shape, ...o.shape], o.dtype); - return $O(e.dataIdMap.get(o.dataId).id, we[o.dtype], n, e.dataIdMap.get(s.dataId).id), s; +function Hne(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e, n = y.sizeFromShape(o.shape), s = t10.makeOutput([...o.shape, ...o.shape], o.dtype); + return CM(t10.dataIdMap.get(o.dataId).id, we[o.dtype], n, t10.dataIdMap.get(s.dataId).id), s; } -var EO = { kernelName: oa, backendName: "wasm", setupFunc: xoe, kernelFunc: yoe }; -var RO; -function boe(r15) { - RO = r15.wasm.cwrap(dn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var wM = { kernelName: ca, backendName: "wasm", setupFunc: Gne, kernelFunc: Hne }; +var SM; +function Kne(r16) { + SM = r16.wasm.cwrap(zn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function Coe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p } = o; +function qne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p } = o; if (n.dtype !== s.dtype) throw new Error(`Dilation2D error: x must have the same dtype as filter. Got ${n.dtype} and ${s.dtype}`); - let u = w.computeDilation2DInfo(n.shape, s.shape, a, i, "NHWC", p), c = e.makeOutput(u.outShape, n.dtype); - return RO(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(c.dataId).id, we[n.dtype], u.batchSize, u.inChannels, u.inHeight, u.inWidth, u.outHeight, u.outWidth, u.strideHeight, u.strideWidth, u.dilationHeight, u.dilationWidth, u.filterHeight, u.filterWidth, u.padInfo.top, u.padInfo.left), c; + let u = C.computeDilation2DInfo(n.shape, s.shape, a, i, "NHWC", p), l = t10.makeOutput(u.outShape, n.dtype); + return SM(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(l.dataId).id, we[n.dtype], u.batchSize, u.inChannels, u.inHeight, u.inWidth, u.outHeight, u.outWidth, u.strideHeight, u.strideWidth, u.dilationHeight, u.dilationWidth, u.filterHeight, u.filterWidth, u.padInfo.top, u.padInfo.left), l; } -var DO = { kernelName: dn, backendName: "wasm", setupFunc: boe, kernelFunc: Coe }; -var AO; -function woe(r15) { - AO = r15.wasm.cwrap(Mi, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var IM = { kernelName: zn, backendName: "wasm", setupFunc: Kne, kernelFunc: qne }; +var vM; +function jne(r16) { + vM = r16.wasm.cwrap(qi, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function Soe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, dy: a } = t8, { strides: i, pad: p, dilations: u } = o; +function Xne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, dy: a } = e, { strides: i, pad: p, dilations: u } = o; if (n.dtype !== s.dtype || n.dtype !== a.dtype) throw new Error(`Dilation2DBackpropFilter error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`); - let c = w.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), l = e.makeOutput(s.shape, s.dtype); - return AO(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(a.dataId).id, e.dataIdMap.get(l.dataId).id, we[n.dtype], c.batchSize, c.inChannels, c.inHeight, c.inWidth, c.outHeight, c.outWidth, c.strideHeight, c.strideWidth, c.dilationHeight, c.dilationWidth, c.filterHeight, c.filterWidth, c.padInfo.top, c.padInfo.left), l; + let l = C.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), c = t10.makeOutput(s.shape, s.dtype); + return vM(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(a.dataId).id, t10.dataIdMap.get(c.dataId).id, we[n.dtype], l.batchSize, l.inChannels, l.inHeight, l.inWidth, l.outHeight, l.outWidth, l.strideHeight, l.strideWidth, l.dilationHeight, l.dilationWidth, l.filterHeight, l.filterWidth, l.padInfo.top, l.padInfo.left), c; } -var FO = { kernelName: Mi, backendName: "wasm", setupFunc: woe, kernelFunc: Soe }; -var PO; -function Ioe(r15) { - PO = r15.wasm.cwrap(Oi, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var kM = { kernelName: qi, backendName: "wasm", setupFunc: jne, kernelFunc: Xne }; +var NM; +function Yne(r16) { + NM = r16.wasm.cwrap(Ki, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function voe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, dy: a } = t8, { strides: i, pad: p, dilations: u } = o; +function Qne(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, dy: a } = e, { strides: i, pad: p, dilations: u } = o; if (n.dtype !== s.dtype || n.dtype !== a.dtype) throw new Error(`Dilation2DBackpropInput error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`); - let c = w.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), l = e.makeOutput(n.shape, n.dtype); - return PO(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(a.dataId).id, e.dataIdMap.get(l.dataId).id, we[n.dtype], c.batchSize, c.inChannels, c.inHeight, c.inWidth, c.outHeight, c.outWidth, c.strideHeight, c.strideWidth, c.dilationHeight, c.dilationWidth, c.filterHeight, c.filterWidth, c.padInfo.top, c.padInfo.left), l; -} -var OO = { kernelName: Oi, backendName: "wasm", setupFunc: Ioe, kernelFunc: voe }; -var MO = he(hn); -var LO; -function koe(r15) { - LO = r15.wasm.cwrap(Xa, null, ["number", "number", "number"]); -} -function Noe(r15) { - let { inputs: t8, backend: e } = r15, { dy: o, y: n } = t8, s = e.makeOutput(n.shape, "float32"), a = (i) => e.dataIdMap.get(i.dataId).id; - return LO(a(n), a(o), a(s)), s; -} -var BO = { kernelName: Xa, backendName: "wasm", setupFunc: koe, kernelFunc: Noe }; -var Toe = false; -var zO = Ue(xn, Toe, "bool"); -var VO = he(gn); -var WO = he(yn, "float32"); -function Mg(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { input: n } = t8, { dim: s } = e, a = n.shape.length, i = n.shape.slice(), p = s; - return s < 0 && (y.assert(-(a + 1) <= s, () => `Axis must be in the interval [${-(a + 1)}, ${a}]`), p = a + s + 1), i.splice(p, 0, 1), zt({ inputs: { x: n }, backend: o, attrs: { shape: i } }); -} -var UO = { kernelName: na, backendName: "wasm", kernelFunc: Mg }; -var GO = he(bn, "float32"); -function Ov(r15) { - let { attrs: { shape: t8, value: e }, backend: o } = r15, { attrs: { dtype: n } } = r15; - n = n || y.inferDtype(e); - let s = o.makeOutput(t8, n); - return o.typedArrayFromHeap(s).fill(e), s; -} -var HO = { kernelName: sa, backendName: "wasm", kernelFunc: Ov }; -var KO; -function _oe(r15) { - KO = r15.wasm.cwrap(Cn, null, ["number", "number", "number", "number", "number", "number"]); -} -function $oe(r15) { - let { inputs: t8, backend: e } = r15, { image: o } = t8, n = e.makeOutput(o.shape, o.dtype), s = e.dataIdMap.get(o.dataId).id, a = e.dataIdMap.get(n.dataId).id, [i, p, u, c] = o.shape; - return KO(s, i, p, u, c, a), n; -} -var qO = { kernelName: Cn, backendName: "wasm", kernelFunc: $oe, setupFunc: _oe }; -var jO = he(wn); -var Eoe = false; -var XO = Ue(Sn, Eoe); -var YO; -function Roe(r15) { - YO = r15.wasm.cwrap(In, null, ["number", "number", "number", "number", "number", "number", "number"]); + let l = C.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), c = t10.makeOutput(n.shape, n.dtype); + return NM(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(a.dataId).id, t10.dataIdMap.get(c.dataId).id, we[n.dtype], l.batchSize, l.inChannels, l.inHeight, l.inWidth, l.outHeight, l.outWidth, l.strideHeight, l.strideWidth, l.dilationHeight, l.dilationWidth, l.filterHeight, l.filterWidth, l.padInfo.top, l.padInfo.left), c; } -function Doe(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { varianceEpsilon: n } = o, { x: s, mean: a, variance: i, offset: p, scale: u } = e, c = t8.dataIdMap.get(s.dataId).id, l = t8.dataIdMap.get(a.dataId).id, m = t8.dataIdMap.get(i.dataId).id, d = p != null ? t8.dataIdMap.get(p.dataId).id : 0, f = u != null ? t8.dataIdMap.get(u.dataId).id : 0, h = t8.makeOutput(s.shape, s.dtype); +var TM = { kernelName: Ki, backendName: "wasm", setupFunc: Yne, kernelFunc: Qne }; +var _M = he(Wn); +var EM; +function Zne(r16) { + EM = r16.wasm.cwrap(ri, null, ["number", "number", "number"]); +} +function Jne(r16) { + let { inputs: e, backend: t10 } = r16, { dy: o, y: n } = e, s = t10.makeOutput(n.shape, "float32"), a = (i) => t10.dataIdMap.get(i.dataId).id; + return EM(a(n), a(o), a(s)), s; +} +var $M = { kernelName: ri, backendName: "wasm", setupFunc: Zne, kernelFunc: Jne }; +var ese = false; +var RM = He(xo, ese, "bool"); +var DM = he(Un); +var AM = he(yo, "float32"); +function Xg(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { input: n } = e, { dim: s } = t10, a = n.shape.length, i = n.shape.slice(), p = s; + return s < 0 && (y.assert(-(a + 1) <= s, () => `Axis must be in the interval [${-(a + 1)}, ${a}]`), p = a + s + 1), i.splice(p, 0, 1), Wt({ inputs: { x: n }, backend: o, attrs: { shape: i } }); +} +var FM = { kernelName: ma, backendName: "wasm", kernelFunc: Xg }; +var PM = he(bo, "float32"); +function Y0(r16) { + let { attrs: { shape: e, value: t10 }, backend: o } = r16, { attrs: { dtype: n } } = r16; + n = n || y.inferDtype(t10); + let s = o.makeOutput(e, n); + return o.typedArrayFromHeap(s).fill(t10), s; +} +var OM = { kernelName: da, backendName: "wasm", kernelFunc: Y0 }; +var MM; +function tse(r16) { + MM = r16.wasm.cwrap(Gn, null, ["number", "number", "number", "number", "number", "number"]); +} +function rse(r16) { + let { inputs: e, backend: t10 } = r16, { image: o } = e, n = t10.makeOutput(o.shape, o.dtype), s = t10.dataIdMap.get(o.dataId).id, a = t10.dataIdMap.get(n.dataId).id, [i, p, u, l] = o.shape; + return MM(s, i, p, u, l, a), n; +} +var LM = { kernelName: Gn, backendName: "wasm", kernelFunc: rse, setupFunc: tse }; +var BM = he(Co); +var ose = false; +var zM = He(wo, ose); +var VM; +function nse(r16) { + VM = r16.wasm.cwrap(Hn, null, ["number", "number", "number", "number", "number", "number", "number"]); +} +function sse(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { varianceEpsilon: n } = o, { x: s, mean: a, variance: i, offset: p, scale: u } = t10, l = e.dataIdMap.get(s.dataId).id, c = e.dataIdMap.get(a.dataId).id, m = e.dataIdMap.get(i.dataId).id, d = p != null ? e.dataIdMap.get(p.dataId).id : 0, f = u != null ? e.dataIdMap.get(u.dataId).id : 0, h = e.makeOutput(s.shape, s.dtype); if (y.sizeFromShape(s.shape) === 0) return h; - let g = t8.dataIdMap.get(h.dataId).id; - return YO(c, l, m, d, f, n, g), h; + let g = e.dataIdMap.get(h.dataId).id; + return VM(l, c, m, d, f, n, g), h; } -var QO = { kernelName: In, backendName: "wasm", setupFunc: Roe, kernelFunc: Doe }; -var ZO; -function Aoe(r15) { - ZO = r15.wasm.cwrap(Io, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var WM = { kernelName: Hn, backendName: "wasm", setupFunc: nse, kernelFunc: sse }; +var UM; +function ase(r16) { + UM = r16.wasm.cwrap(jo, 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 Foe(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dilations: c, dataFormat: l, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = e, h = w.computeConv2DInfo(n.shape, s.shape, p, c, u, m), g = bu[d]; +function ise(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dilations: l, dataFormat: c, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = t10, h = C.computeConv2DInfo(n.shape, s.shape, p, l, u, m), g = _u[d]; if (g == null) throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`); - let x = o.dataIdMap.get(n.dataId).id, b = o.dataIdMap.get(s.dataId).id, C = h.outChannels, S = 0; + let x = o.dataIdMap.get(n.dataId).id, b = o.dataIdMap.get(s.dataId).id, w = h.outChannels, S = 0; if (a != null) { let ee = o.dataIdMap.get(a.dataId); if (ee.shape.length !== 1) throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`); - if (ee.shape[0] !== C) - throw new Error(`FusedConv2D bias shape (${ee.shape}) does not match the number of output channels (${C})`); + if (ee.shape[0] !== w) + throw new Error(`FusedConv2D bias shape (${ee.shape}) does not match the number of output channels (${w})`); S = ee.id; } - let k = h.filterHeight, _ = h.filterWidth, E = h.padInfo.top, R = h.padInfo.right, D = h.padInfo.bottom, P = h.padInfo.left, O = h.dilationHeight, M = h.dilationWidth, L = h.strideHeight, B = h.strideWidth, z = h.inChannels, U = h.padInfo.type === "SAME" ? 1 : 0, j = h.batchSize, q = h.inHeight, Y = h.inWidth; - if (l !== "NHWC") - throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${l}'. Please use 'NHWC'.`); + let k = h.filterHeight, T = h.filterWidth, E = h.padInfo.top, R = h.padInfo.right, D = h.padInfo.bottom, F = h.padInfo.left, O = h.dilationHeight, M = h.dilationWidth, L = h.strideHeight, B = h.strideWidth, z = h.inChannels, U = h.padInfo.type === "SAME" ? 1 : 0, j = h.batchSize, q = h.inHeight, Y = h.inWidth; + if (c !== "NHWC") + throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`); let J = o.makeOutput(h.outShape, "float32"), re = o.dataIdMap.get(J.dataId).id, ne = i == null ? 0 : o.dataIdMap.get(i.dataId).id; - return ZO(x, j, q, Y, b, k, _, S, E, R, D, P, U, O, M, L, B, z, C, g, ne, f || 0, re), J; + return UM(x, j, q, Y, b, k, T, S, E, R, D, F, U, O, M, L, B, z, w, g, ne, f || 0, re), J; } -var JO = { kernelName: Io, backendName: "wasm", setupFunc: Aoe, kernelFunc: Foe }; -var eM; -function Poe(r15) { - eM = r15.wasm.cwrap(vo, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var GM = { kernelName: jo, backendName: "wasm", setupFunc: ase, kernelFunc: ise }; +var HM; +function use(r16) { + HM = r16.wasm.cwrap(Xo, 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 Ooe(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dilations: c, dataFormat: l, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = e, h = w.computeConv2DInfo(n.shape, s.shape, p, c, u, m, true), g = bu[d]; +function pse(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dilations: l, dataFormat: c, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = t10, h = C.computeConv2DInfo(n.shape, s.shape, p, l, u, m, true), g = _u[d]; if (g == null) throw new Error(`${d} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`); - let x = o.dataIdMap.get(n.dataId).id, b = o.dataIdMap.get(s.dataId).id, C = h.outChannels, S = 0; + let x = o.dataIdMap.get(n.dataId).id, b = o.dataIdMap.get(s.dataId).id, w = h.outChannels, S = 0; if (a != null) { let ee = o.dataIdMap.get(a.dataId); if (ee.shape.length !== 1) throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`); - if (ee.shape[0] !== C) - throw new Error(`FusedDepthwiseConv2D bias shape (${ee.shape}) does not match the number of output channels (${C})`); + if (ee.shape[0] !== w) + throw new Error(`FusedDepthwiseConv2D bias shape (${ee.shape}) does not match the number of output channels (${w})`); S = ee.id; } - let k = h.filterHeight, _ = h.filterWidth, E = h.padInfo.top, R = h.padInfo.right, D = h.padInfo.bottom, P = h.padInfo.left, O = h.dilationHeight, M = h.dilationWidth, L = h.strideHeight, B = h.strideWidth, z = h.inChannels, U = h.padInfo.type === "SAME" ? 1 : 0, j = h.batchSize, q = h.inHeight, Y = h.inWidth; - if (l !== "NHWC") - throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${l}'. Please use 'NHWC'.`); + let k = h.filterHeight, T = h.filterWidth, E = h.padInfo.top, R = h.padInfo.right, D = h.padInfo.bottom, F = h.padInfo.left, O = h.dilationHeight, M = h.dilationWidth, L = h.strideHeight, B = h.strideWidth, z = h.inChannels, U = h.padInfo.type === "SAME" ? 1 : 0, j = h.batchSize, q = h.inHeight, Y = h.inWidth; + if (c !== "NHWC") + throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`); let J = o.makeOutput(h.outShape, "float32"), re = o.dataIdMap.get(J.dataId).id, ne = i == null ? 0 : o.dataIdMap.get(i.dataId).id; - return eM(x, j, q, Y, b, k, _, S, E, R, D, P, U, O, M, L, B, z, C, g, ne, f || 0, re), J; + return HM(x, j, q, Y, b, k, T, S, E, R, D, F, U, O, M, L, B, z, w, g, ne, f || 0, re), J; } -var tM = { kernelName: vo, backendName: "wasm", setupFunc: Poe, kernelFunc: Ooe }; -var rM; -function Moe(r15) { - rM = r15.wasm.cwrap(vn, null, ["number", "number", "number", "number", "number", "number", "array", "number"]); +var KM = { kernelName: Xo, backendName: "wasm", setupFunc: use, kernelFunc: pse }; +var qM; +function lse(r16) { + qM = r16.wasm.cwrap(Kn, null, ["number", "number", "number", "number", "number", "number", "array", "number"]); } -function Loe(r15) { - let { backend: t8, inputs: e } = r15, { params: o, indices: n } = e, [s, a, i, p] = sf.prepareAndValidate(o, n), u = t8.makeOutput(s, o.dtype); +function cse(r16) { + let { backend: e, inputs: t10 } = r16, { params: o, indices: n } = t10, [s, a, i, p] = xf.prepareAndValidate(o, n), u = e.makeOutput(s, o.dtype); if (a === 0) return u; - let c = n.shape, l = c[c.length - 1], d = t8.dataIdMap.get(o.dataId).id, h = t8.dataIdMap.get(n.dataId).id, g = new Uint8Array(new Int32Array(p).buffer), x = t8.dataIdMap.get(u.dataId).id; - return rM(d, we[o.dtype], h, a, l, i, g, x), u; + let l = n.shape, c = l[l.length - 1], d = e.dataIdMap.get(o.dataId).id, h = e.dataIdMap.get(n.dataId).id, g = new Uint8Array(new Int32Array(p).buffer), x = e.dataIdMap.get(u.dataId).id; + return qM(d, we[o.dtype], h, a, c, i, g, x), u; } -var oM = { kernelName: vn, backendName: "wasm", setupFunc: Moe, kernelFunc: Loe }; -var nM; -function Boe(r15) { - nM = r15.wasm.cwrap("Gather", null, ["number", "number", "array", "number", "number", "number", "array", "number"]); +var jM = { kernelName: Kn, backendName: "wasm", setupFunc: lse, kernelFunc: cse }; +var XM; +function mse(r16) { + XM = r16.wasm.cwrap("Gather", null, ["number", "number", "array", "number", "number", "number", "array", "number"]); } -function zoe(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { x: n, indices: s } = e, { axis: a, batchDims: i } = o, p = y.parseAxisParam(a, n.shape)[0], u = t8.readSync(s.dataId), c = n.shape[p]; +function dse(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { x: n, indices: s } = t10, { axis: a, batchDims: i } = o, p = y.parseAxisParam(a, n.shape)[0], u = e.readSync(s.dataId), l = n.shape[p]; for (let D = 0; D < u.length; ++D) { - let P = u[D]; - y.assert(P <= c - 1 && P >= 0, () => `GatherV2: the index value ${P} is not in [0, ${c - 1}]`); + let F = u[D]; + y.assert(F <= l - 1 && F >= 0, () => `GatherV2: the index value ${F} is not in [0, ${l - 1}]`); } - let l = w.segment_util.collectGatherOpShapeInfo(n, s, p, i), m = zt({ inputs: { x: n }, attrs: { shape: [l.batchSize, l.outerSize, l.dimSize, l.sliceSize] }, backend: t8 }), d = y.sizeFromShape(s.shape), f = zt({ inputs: { x: s }, attrs: { shape: [l.batchSize, d / l.batchSize] }, backend: t8 }), h = [l.batchSize, l.outerSize, d / l.batchSize, l.sliceSize], g = t8.makeOutput(h, n.dtype); + let c = C.segment_util.collectGatherOpShapeInfo(n, s, p, i), m = Wt({ inputs: { x: n }, attrs: { shape: [c.batchSize, c.outerSize, c.dimSize, c.sliceSize] }, backend: e }), d = y.sizeFromShape(s.shape), f = Wt({ inputs: { x: s }, attrs: { shape: [c.batchSize, d / c.batchSize] }, backend: e }), h = [c.batchSize, c.outerSize, d / c.batchSize, c.sliceSize], g = e.makeOutput(h, n.dtype); if (y.sizeFromShape(n.shape) === 0) return g; - let x = m.shape.length - 1, C = t8.dataIdMap.get(m.dataId).id, k = t8.dataIdMap.get(f.dataId).id, _ = t8.dataIdMap.get(g.dataId).id, E = new Uint8Array(new Int32Array(y.computeStrides(m.shape)).buffer), R = new Uint8Array(new Int32Array(y.computeStrides(h)).buffer); - return nM(C, we[n.dtype], E, x, k, l.batchSize, R, _), t8.disposeData(m.dataId), t8.disposeData(f.dataId), g.shape = l.outputShape, g; -} -var sM = { kernelName: aa, backendName: "wasm", setupFunc: Boe, kernelFunc: zoe }; -var Voe = false; -var aM = Ue(kn, Voe, "bool"); -var Woe = false; -var iM = Ue(Nn, Woe, "bool"); -var uM = he(Tn, "bool"); -var pM = he(_n, "bool"); -var cM = he($n, "bool"); -var lM; -function Uoe(r15) { - lM = r15.wasm.cwrap(En, null, ["number", "number", "number", "number"]); + let x = m.shape.length - 1, w = e.dataIdMap.get(m.dataId).id, k = e.dataIdMap.get(f.dataId).id, T = e.dataIdMap.get(g.dataId).id, E = new Uint8Array(new Int32Array(y.computeStrides(m.shape)).buffer), R = new Uint8Array(new Int32Array(y.computeStrides(h)).buffer); + return XM(w, we[n.dtype], E, x, k, c.batchSize, R, T), e.disposeData(m.dataId), e.disposeData(f.dataId), g.shape = c.outputShape, g; +} +var YM = { kernelName: fa, backendName: "wasm", setupFunc: mse, kernelFunc: dse }; +var fse = false; +var QM = He(So, fse, "bool"); +var hse = false; +var ZM = He(Io, hse, "bool"); +var JM = he(qn, "bool"); +var eL = he(jn, "bool"); +var tL = he(Xn, "bool"); +var rL; +function gse(r16) { + rL = r16.wasm.cwrap(Yn, null, ["number", "number", "number", "number"]); } -function Goe(r15) { - let { inputs: { x: t8 }, attrs: { alpha: e }, backend: o } = r15, n = o.dataIdMap.get(t8.dataId).id, s = o.makeOutput(t8.shape, "float32"); - if (y.sizeFromShape(t8.shape) !== 0) { +function xse(r16) { + let { inputs: { x: e }, attrs: { alpha: t10 }, backend: o } = r16, n = o.dataIdMap.get(e.dataId).id, s = o.makeOutput(e.shape, "float32"); + if (y.sizeFromShape(e.shape) !== 0) { let a = o.dataIdMap.get(s.dataId).id; - lM(n, we[t8.dtype], e, a); + rL(n, we[e.dtype], t10, a); } return s; } -var mM = { kernelName: En, backendName: "wasm", setupFunc: Uoe, kernelFunc: Goe }; -var Hoe = false; -var dM = Ue(Rn, Hoe, "bool"); -var Koe = false; -var fM = Ue(Dn, Koe, "bool"); -var hM; -function qoe(r15) { - hM = r15.wasm.cwrap(An, null, ["number", "number", "number", "number"]); -} -function joe(r15) { - let { attrs: t8, backend: e } = r15, { start: o, stop: n, num: s } = t8, a = Math.floor(s), i = e.makeOutput([a], "float32"); - return hM(e.dataIdMap.get(i.dataId).id, o, n, a), i; -} -var gM = { kernelName: An, backendName: "wasm", setupFunc: qoe, kernelFunc: joe }; -var xM = he(Fn); -var yM = he(Pn); -var Xoe = false; -var bM = Ue(On, Xoe, "bool"); -var CM = he(Mn); -var Yoe = false; -var wM = Ue(Ln, Yoe, "bool"); -var Qoe = false; -var SM = Ue(E0, Qoe, "bool"); -var IM; -function Zoe(r15) { - IM = r15.wasm.cwrap(Bn, null, ["number", "number", "number", "number", "number", "number", "number"]); -} -function Joe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { depthRadius: s, bias: a, alpha: i, beta: p } = o; +var oL = { kernelName: Yn, backendName: "wasm", setupFunc: gse, kernelFunc: xse }; +var yse = false; +var nL = He(ko, yse, "bool"); +var bse = false; +var sL = He(No, bse, "bool"); +var aL; +function Cse(r16) { + aL = r16.wasm.cwrap(Qn, null, ["number", "number", "number", "number"]); +} +function wse(r16) { + let { attrs: e, backend: t10 } = r16, { start: o, stop: n, num: s } = e, a = Math.floor(s), i = t10.makeOutput([a], "float32"); + return aL(t10.dataIdMap.get(i.dataId).id, o, n, a), i; +} +var iL = { kernelName: Qn, backendName: "wasm", setupFunc: Cse, kernelFunc: wse }; +var uL = he(To); +var pL = he(Zn); +var Sse = false; +var lL = He(Jn, Sse, "bool"); +var cL = he(es); +var Ise = false; +var mL = He(ts, Ise, "bool"); +var vse = false; +var dL = He(gk, vse, "bool"); +var fL; +function kse(r16) { + fL = r16.wasm.cwrap(rs, null, ["number", "number", "number", "number", "number", "number", "number"]); +} +function Nse(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { depthRadius: s, bias: a, alpha: i, beta: p } = o; if (n.dtype !== "float32") throw new Error("LRN error: x must have dtype float32"); - let u = e.makeOutput(n.shape, n.dtype); - return IM(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(u.dataId).id, n.shape[3], s, a, i, p), u; + let u = t10.makeOutput(n.shape, n.dtype); + return fL(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(u.dataId).id, n.shape[3], s, a, i, p), u; } -var vM = { kernelName: Bn, backendName: "wasm", setupFunc: Zoe, kernelFunc: Joe }; -var kM; -function ene(r15) { - kM = r15.wasm.cwrap(Ya, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var hL = { kernelName: rs, backendName: "wasm", setupFunc: kse, kernelFunc: Nse }; +var gL; +function Tse(r16) { + gL = r16.wasm.cwrap(oi, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function tne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, y: s, dy: a } = t8, { depthRadius: i, bias: p, alpha: u, beta: c } = o; +function _se(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, y: s, dy: a } = e, { depthRadius: i, bias: p, alpha: u, beta: l } = o; if (n.dtype !== "float32" || s.dtype !== "float32" || a.dtype !== "float32") throw new Error("LRNGrad error: x, y, and dy must have dtype float32"); - let l = e.makeOutput(n.shape, n.dtype); - return kM(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(a.dataId).id, e.dataIdMap.get(l.dataId).id, a.shape[3], i, p, u, c), l; + let c = t10.makeOutput(n.shape, n.dtype); + return gL(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(a.dataId).id, t10.dataIdMap.get(c.dataId).id, a.shape[3], i, p, u, l), c; } -var NM = { kernelName: Ya, backendName: "wasm", setupFunc: ene, kernelFunc: tne }; -var TM; -function rne(r15) { - TM = r15.wasm.cwrap(zn, null, ["number", "number", "number", "number"]); +var xL = { kernelName: oi, backendName: "wasm", setupFunc: Tse, kernelFunc: _se }; +var yL; +function Ese(r16) { + yL = r16.wasm.cwrap(os, null, ["number", "number", "number", "number"]); } -function one(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { reductionIndices: n, keepDims: s } = o, { x: a } = e, p = t8.dataIdMap.get(a.dataId).id, u = a, { transposed: c, axes: l, originalAxes: m, inputWasTransposed: d } = Tr(a, n, t8); +function $se(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { reductionIndices: n, keepDims: s } = o, { x: a } = t10, p = e.dataIdMap.get(a.dataId).id, u = a, { transposed: l, axes: c, originalAxes: m, inputWasTransposed: d } = $r(a, n, e); if (d) { - let C = t8.dataIdMap.get(c.dataId).id; - u = c, p = C; + let w = e.dataIdMap.get(l.dataId).id; + u = l, p = w; } let f = u.shape.length; - w.assertAxesAreInnerMostDims("max", l, f); - let [h, g] = w.computeOutAndReduceShapes(u.shape, l), x = y.sizeFromShape(g), b = t8.makeOutput(h, a.dtype); + C.assertAxesAreInnerMostDims("max", c, f); + let [h, g] = C.computeOutAndReduceShapes(u.shape, c), x = y.sizeFromShape(g), b = e.makeOutput(h, a.dtype); if (y.sizeFromShape(u.shape) !== 0) { - let C = t8.dataIdMap.get(b.dataId).id; - TM(p, we[a.dtype], x, C); + let w = e.dataIdMap.get(b.dataId).id; + yL(p, we[a.dtype], x, w); } - if (d && t8.disposeData(c.dataId), s) { - let C = w.expandShapeToKeepDim(b.shape, m); - b.shape = C; + if (d && e.disposeData(l.dataId), s) { + let w = C.expandShapeToKeepDim(b.shape, m); + b.shape = w; } return b; } -var _M = { kernelName: zn, backendName: "wasm", setupFunc: rne, kernelFunc: one }; -var nne = false; -var $M = Ue(Vn, nne); -var EM; -function sne(r15) { - EM = r15.wasm.cwrap(Wn, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var bL = { kernelName: os, backendName: "wasm", setupFunc: Ese, kernelFunc: $se }; +var Rse = false; +var CL = He(_o, Rse); +var wL; +function Dse(r16) { + wL = r16.wasm.cwrap(ns, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function ane(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, n = t8.x, s = o.dataIdMap.get(n.dataId).id; +function Ase(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, n = e.x, s = o.dataIdMap.get(n.dataId).id; y.assert(n.dtype === "float32", () => `Error in MaxPool: only float32 input is supported. Got ${n.dtype}.`); - let { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = e, c = w.computePool2DInfo(n.shape, a, i, 1, p, u), l = c.filterHeight, m = c.filterWidth, d = c.padInfo.top, f = c.padInfo.right, h = c.padInfo.bottom, g = c.padInfo.left, x = c.dilationHeight, b = c.dilationWidth, C = c.strideHeight, S = c.strideWidth, k = c.inChannels, _ = c.outChannels; - if (c.dataFormat !== "channelsLast") - throw new Error(`wasm backend does not support dataFormat:'${c.dataFormat}'. Please use 'channelsLast'.`); - let E = o.makeOutput(c.outShape, "float32"), R = o.dataIdMap.get(E.dataId).id; - return EM(s, n.shape[0], n.shape[1], n.shape[2], l, m, d, f, h, g, x, b, C, S, k, _, R), E; -} -var RM = { kernelName: Wn, backendName: "wasm", setupFunc: sne, kernelFunc: ane }; -var DM; -function ine(r15) { - DM = r15.wasm.cwrap("MaxPool3D", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function une(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o, c = w.computePool3DInfo(n.shape, s, a, 1, i, p, u), l = e.makeOutput(c.outShape, n.dtype); - return DM(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(l.dataId).id, c.batchSize, c.inChannels, c.inDepth, c.inHeight, c.inWidth, c.outDepth, c.outHeight, c.outWidth, c.strideDepth, c.strideHeight, c.strideWidth, c.dilationDepth, c.dilationHeight, c.dilationWidth, c.effectiveFilterDepth, c.effectiveFilterHeight, c.effectiveFilterWidth, c.padInfo.front, c.padInfo.top, c.padInfo.left), l; -} -var AM = { kernelName: ia, backendName: "wasm", setupFunc: ine, kernelFunc: une }; -var FM; -function pne(r15) { - FM = r15.wasm.cwrap("MaxPool3DGrad", 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 cne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o, c = w.computePool3DInfo(s.shape, a, i, 1, p, u), l = e.makeOutput(s.shape, s.dtype); - return FM(e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(l.dataId).id, c.batchSize, c.inChannels, c.inDepth, c.inHeight, c.inWidth, c.outDepth, c.outHeight, c.outWidth, c.strideDepth, c.strideHeight, c.strideWidth, c.dilationDepth, c.dilationHeight, c.dilationWidth, c.effectiveFilterDepth, c.effectiveFilterHeight, c.effectiveFilterWidth, c.padInfo.front, c.padInfo.top, c.padInfo.left), l; -} -var PM = { kernelName: Ui, backendName: "wasm", setupFunc: pne, kernelFunc: cne }; -var OM; -function lne(r15) { - OM = r15.wasm.cwrap("MaxPoolGrad", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function mne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o, c = w.computePool2DInfo(s.shape, a, i, 1, p, u), l = e.makeOutput(s.shape, s.dtype); - return OM(e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(l.dataId).id, c.batchSize, c.inChannels, c.inHeight, c.inWidth, c.outHeight, c.outWidth, c.strideHeight, c.strideWidth, c.dilationHeight, c.dilationWidth, c.effectiveFilterHeight, c.effectiveFilterWidth, c.padInfo.top, c.padInfo.left), l; -} -var MM = { kernelName: Wi, backendName: "wasm", setupFunc: lne, kernelFunc: mne }; -var LM; -function dne(r15) { - LM = r15.wasm.cwrap("MaxPoolWithArgmax", null, ["number", "number", "number", "number", "boolean", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function fne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, includeBatchInIndex: p } = o; + let { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = t10, l = C.computePool2DInfo(n.shape, a, i, 1, p, u), c = l.filterHeight, m = l.filterWidth, d = l.padInfo.top, f = l.padInfo.right, h = l.padInfo.bottom, g = l.padInfo.left, x = l.dilationHeight, b = l.dilationWidth, w = l.strideHeight, S = l.strideWidth, k = l.inChannels, T = l.outChannels; + if (l.dataFormat !== "channelsLast") + throw new Error(`wasm backend does not support dataFormat:'${l.dataFormat}'. Please use 'channelsLast'.`); + let E = o.makeOutput(l.outShape, "float32"), R = o.dataIdMap.get(E.dataId).id; + return wL(s, n.shape[0], n.shape[1], n.shape[2], c, m, d, f, h, g, x, b, w, S, k, T, R), E; +} +var SL = { kernelName: ns, backendName: "wasm", setupFunc: Dse, kernelFunc: Ase }; +var IL; +function Fse(r16) { + IL = r16.wasm.cwrap("MaxPool3D", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function Pse(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dimRoundingMode: p, dataFormat: u } = o, l = C.computePool3DInfo(n.shape, s, a, 1, i, p, u), c = t10.makeOutput(l.outShape, n.dtype); + return IL(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(c.dataId).id, l.batchSize, l.inChannels, l.inDepth, l.inHeight, l.inWidth, l.outDepth, l.outHeight, l.outWidth, l.strideDepth, l.strideHeight, l.strideWidth, l.dilationDepth, l.dilationHeight, l.dilationWidth, l.effectiveFilterDepth, l.effectiveFilterHeight, l.effectiveFilterWidth, l.padInfo.front, l.padInfo.top, l.padInfo.left), c; +} +var vL = { kernelName: ha, backendName: "wasm", setupFunc: Fse, kernelFunc: Pse }; +var kL; +function Ose(r16) { + kL = r16.wasm.cwrap("MaxPool3DGrad", 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 Mse(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o, l = C.computePool3DInfo(s.shape, a, i, 1, p, u), c = t10.makeOutput(s.shape, s.dtype); + return kL(t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(c.dataId).id, l.batchSize, l.inChannels, l.inDepth, l.inHeight, l.inWidth, l.outDepth, l.outHeight, l.outWidth, l.strideDepth, l.strideHeight, l.strideWidth, l.dilationDepth, l.dilationHeight, l.dilationWidth, l.effectiveFilterDepth, l.effectiveFilterHeight, l.effectiveFilterWidth, l.padInfo.front, l.padInfo.top, l.padInfo.left), c; +} +var NL = { kernelName: Ji, backendName: "wasm", setupFunc: Ose, kernelFunc: Mse }; +var TL; +function Lse(r16) { + TL = r16.wasm.cwrap("MaxPoolGrad", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function Bse(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, { filterSize: a, strides: i, pad: p, dimRoundingMode: u } = o, l = C.computePool2DInfo(s.shape, a, i, 1, p, u), c = t10.makeOutput(s.shape, s.dtype); + return TL(t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(c.dataId).id, l.batchSize, l.inChannels, l.inHeight, l.inWidth, l.outHeight, l.outWidth, l.strideHeight, l.strideWidth, l.dilationHeight, l.dilationWidth, l.effectiveFilterHeight, l.effectiveFilterWidth, l.padInfo.top, l.padInfo.left), c; +} +var _L = { kernelName: Zi, backendName: "wasm", setupFunc: Lse, kernelFunc: Bse }; +var EL; +function zse(r16) { + EL = r16.wasm.cwrap("MaxPoolWithArgmax", null, ["number", "number", "number", "number", "boolean", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function Vse(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, includeBatchInIndex: p } = o; y.assert(n.shape.length === 4, () => `Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`); let u = [1, 1]; - y.assert(w.eitherStridesOrDilationsAreOne(a, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); - let c = w.computePool2DInfo(n.shape, s, a, [1, 1], i), l = e.makeOutput(c.outShape, n.dtype), m = e.makeOutput(c.outShape, "int32"); - return LM(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(l.dataId).id, e.dataIdMap.get(m.dataId).id, we[n.dtype], p, c.batchSize, c.inChannels, c.inHeight, c.inWidth, c.outHeight, c.outWidth, c.strideHeight, c.strideWidth, c.dilationHeight, c.dilationWidth, c.effectiveFilterHeight, c.effectiveFilterWidth, c.padInfo.top, c.padInfo.left), [l, m]; + y.assert(C.eitherStridesOrDilationsAreOne(a, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`); + let l = C.computePool2DInfo(n.shape, s, a, [1, 1], i), c = t10.makeOutput(l.outShape, n.dtype), m = t10.makeOutput(l.outShape, "int32"); + return EL(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(c.dataId).id, t10.dataIdMap.get(m.dataId).id, we[n.dtype], p, l.batchSize, l.inChannels, l.inHeight, l.inWidth, l.outHeight, l.outWidth, l.strideHeight, l.strideWidth, l.dilationHeight, l.dilationWidth, l.effectiveFilterHeight, l.effectiveFilterWidth, l.padInfo.top, l.padInfo.left), [c, m]; } -var BM = { kernelName: ua, backendName: "wasm", setupFunc: dne, kernelFunc: fne }; -var zM; -function hne(r15) { - zM = r15.wasm.cwrap(Un, null, ["number, number, number"]); +var $L = { kernelName: ga, backendName: "wasm", setupFunc: zse, kernelFunc: Vse }; +var RL; +function Wse(r16) { + RL = r16.wasm.cwrap(ss, null, ["number, number, number"]); } -function gne(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { axis: n, keepDims: s } = o, { x: a } = e, i = t8.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: c, axes: l, originalAxes: m, inputWasTransposed: d } = Tr(a, n, t8), f = l; +function Use(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { axis: n, keepDims: s } = o, { x: a } = t10, i = e.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: l, axes: c, originalAxes: m, inputWasTransposed: d } = $r(a, n, e), f = c; if (d) { - let S = t8.dataIdMap.get(c.dataId).id; - S !== i && (u = c, p = S, f = w.getInnerMostAxes(f.length, u.shape.length)); + let S = e.dataIdMap.get(l.dataId).id; + S !== i && (u = l, p = S, f = C.getInnerMostAxes(f.length, u.shape.length)); } - w.assertAxesAreInnerMostDims("mean", f, u.shape.length); - let [h, g] = w.computeOutAndReduceShapes(u.shape, f), x = y.sizeFromShape(g), b = u; - u.dtype !== "float32" && (b = Or({ backend: t8, inputs: { x: u }, attrs: { dtype: "float32" } }), p = t8.dataIdMap.get(b.dataId).id); - let C = t8.makeOutput(h, "float32"); + C.assertAxesAreInnerMostDims("mean", f, u.shape.length); + let [h, g] = C.computeOutAndReduceShapes(u.shape, f), x = y.sizeFromShape(g), b = u; + u.dtype !== "float32" && (b = Vr({ backend: e, inputs: { x: u }, attrs: { dtype: "float32" } }), p = e.dataIdMap.get(b.dataId).id); + let w = e.makeOutput(h, "float32"); if (y.sizeFromShape(u.shape) !== 0) { - let S = t8.dataIdMap.get(C.dataId).id; - zM(p, x, S); + let S = e.dataIdMap.get(w.dataId).id; + RL(p, x, S); } - if (d && t8.disposeData(c.dataId), s) { - let S = w.expandShapeToKeepDim(C.shape, m); - C.shape = S; + if (d && e.disposeData(l.dataId), s) { + let S = C.expandShapeToKeepDim(w.shape, m); + w.shape = S; } - return u.dtype !== "float32" && t8.disposeData(b.dataId), C; + return u.dtype !== "float32" && e.disposeData(b.dataId), w; } -var VM = { kernelName: Un, backendName: "wasm", setupFunc: hne, kernelFunc: gne }; -var WM; -function xne(r15) { - WM = r15.wasm.cwrap(Gn, null, ["number", "number", "number", "number"]); +var DL = { kernelName: ss, backendName: "wasm", setupFunc: Wse, kernelFunc: Use }; +var AL; +function Gse(r16) { + AL = r16.wasm.cwrap(as, null, ["number", "number", "number", "number"]); } -function yne(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { axis: n, keepDims: s } = o, { x: a } = e, i = t8.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: c, axes: l, originalAxes: m, inputWasTransposed: d } = Tr(a, n, t8); +function Hse(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { axis: n, keepDims: s } = o, { x: a } = t10, i = e.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: l, axes: c, originalAxes: m, inputWasTransposed: d } = $r(a, n, e); if (d) { - let C = t8.dataIdMap.get(c.dataId).id; - C !== i && (u = c, p = C); + let w = e.dataIdMap.get(l.dataId).id; + w !== i && (u = l, p = w); } let f = u.shape.length; - w.assertAxesAreInnerMostDims("min", l, f); - let [h, g] = w.computeOutAndReduceShapes(u.shape, l), x = y.sizeFromShape(g), b = t8.makeOutput(h, u.dtype); + C.assertAxesAreInnerMostDims("min", c, f); + let [h, g] = C.computeOutAndReduceShapes(u.shape, c), x = y.sizeFromShape(g), b = e.makeOutput(h, u.dtype); if (y.sizeFromShape(u.shape) !== 0) { - let C = t8.dataIdMap.get(b.dataId).id; - WM(p, we[a.dtype], x, C); + let w = e.dataIdMap.get(b.dataId).id; + AL(p, we[a.dtype], x, w); } - if (d && t8.disposeData(c.dataId), s) { - let C = w.expandShapeToKeepDim(b.shape, m); - b.shape = C; + if (d && e.disposeData(l.dataId), s) { + let w = C.expandShapeToKeepDim(b.shape, m); + b.shape = w; } return b; } -var UM = { kernelName: Gn, backendName: "wasm", setupFunc: xne, kernelFunc: yne }; -var bne = false; -var GM = Ue(Hn, bne); -var Mv; -(function(r15) { - r15[r15.reflect = 0] = "reflect", r15[r15.symmetric = 1] = "symmetric"; -})(Mv || (Mv = {})); -var HM; -function Cne(r15) { - HM = r15.wasm.cwrap(Kn, null, ["number", "array", "number", "number", "array", "array", "number", "number"]); +var FL = { kernelName: as, backendName: "wasm", setupFunc: Gse, kernelFunc: Hse }; +var Kse = false; +var PL = He(Eo, Kse); +var Q0; +(function(r16) { + r16[r16.reflect = 0] = "reflect", r16[r16.symmetric = 1] = "symmetric"; +})(Q0 || (Q0 = {})); +var OL; +function qse(r16) { + OL = r16.wasm.cwrap(is, null, ["number", "array", "number", "number", "array", "array", "number", "number"]); } -function wne(r15) { - let { inputs: { x: t8 }, backend: e, attrs: { paddings: o, mode: n } } = r15, s = o.map((f, h) => f[0] + t8.shape[h] + f[1]), a = e.dataIdMap.get(t8.dataId).id, i = e.makeOutput(s, t8.dtype), p = e.dataIdMap.get(i.dataId).id, u = new Uint8Array(new Int32Array(t8.shape).buffer), c = o.map((f) => f[0]), l = o.map((f) => f[1]), m = new Uint8Array(new Int32Array(c).buffer), d = new Uint8Array(new Int32Array(l).buffer); - return HM(a, u, t8.shape.length, we[t8.dtype], m, d, Mv[n], p), i; +function jse(r16) { + let { inputs: { x: e }, backend: t10, attrs: { paddings: o, mode: n } } = r16, s = o.map((f, h) => f[0] + e.shape[h] + f[1]), a = t10.dataIdMap.get(e.dataId).id, i = t10.makeOutput(s, e.dtype), p = t10.dataIdMap.get(i.dataId).id, u = new Uint8Array(new Int32Array(e.shape).buffer), l = o.map((f) => f[0]), c = o.map((f) => f[1]), m = new Uint8Array(new Int32Array(l).buffer), d = new Uint8Array(new Int32Array(c).buffer); + return OL(a, u, e.shape.length, we[e.dtype], m, d, Q0[n], p), i; } -var KM = { kernelName: Kn, backendName: "wasm", kernelFunc: wne, setupFunc: Cne }; -var qM; -function Sne(r15) { - qM = r15.wasm.cwrap(Is, null, ["number", "number", "number", "number"]); +var ML = { kernelName: is, backendName: "wasm", kernelFunc: jse, setupFunc: qse }; +var LL; +function Xse(r16) { + LL = r16.wasm.cwrap(Fs, null, ["number", "number", "number", "number"]); } -function Lv(r15) { - let { backend: t8, inputs: { logits: e }, attrs: { dim: o } } = r15, n = t8.dataIdMap.get(e.dataId).id, s = t8.makeOutput(e.shape, e.dtype), a = t8.dataIdMap.get(s.dataId).id, i = e.shape[o], p = y.sizeFromShape(e.shape) / i; - return y.sizeFromShape(s.shape) === 0 || qM(n, a, i, p), s; +function Z0(r16) { + let { backend: e, inputs: { logits: t10 }, attrs: { dim: o } } = r16, n = e.dataIdMap.get(t10.dataId).id, s = e.makeOutput(t10.shape, t10.dtype), a = e.dataIdMap.get(s.dataId).id, i = t10.shape[o], p = y.sizeFromShape(t10.shape) / i; + return y.sizeFromShape(s.shape) === 0 || LL(n, a, i, p), s; } -var jM = { kernelName: Is, backendName: "wasm", setupFunc: Sne, kernelFunc: Lv }; -var XM; -function Ine(r15) { - XM = r15.wasm.cwrap(jn, null, ["number", "number", "number", "number", "number", "number"]); +var BL = { kernelName: Fs, backendName: "wasm", setupFunc: Xse, kernelFunc: Z0 }; +var zL; +function Yse(r16) { + zL = r16.wasm.cwrap(ps, null, ["number", "number", "number", "number", "number", "number"]); } -function vne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { logits: n } = t8, { numSamples: s, seed: a, normalized: i } = o; +function Qse(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { logits: n } = e, { numSamples: s, seed: a, normalized: i } = o; if (n.dtype !== "float32") throw new Error(`Tensor logits must have dtype float32, got ${n.dtype}`); - let p = i ? n : Lv({ inputs: { logits: n }, backend: e, attrs: { dim: n.shape.length - 1 } }), [u, c] = p.shape, l = e.makeOutput([u, s], "int32"); - return XM(e.dataIdMap.get(p.dataId).id, u, c, s, a, e.dataIdMap.get(l.dataId).id), i || e.disposeData(p.dataId), l; -} -var YM = { kernelName: jn, backendName: "wasm", setupFunc: Ine, kernelFunc: vne }; -var QM = Ue(qn, true); -var kne = true; -var ZM = Ue(Xn, kne); -var JM = he(pa); -function Hc(r15, t8) { - let e = new Int32Array(r15.wasm.HEAPU8.buffer, t8, 4), o = e[0], n = e[1], s = e[2], a = e[3]; - return r15.wasm._free(t8), { pSelectedIndices: o, selectedSize: n, pSelectedScores: s, pValidOutputs: a }; -} -var eL; -function Nne(r15) { - eL = r15.wasm.cwrap(Qn, "number", ["number", "number", "number", "number", "number"]); -} -function Tne(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { iouThreshold: n, maxOutputSize: s, scoreThreshold: a } = o, { boxes: i, scores: p } = e, u = t8.dataIdMap.get(i.dataId).id, c = t8.dataIdMap.get(p.dataId).id, l = eL(u, c, s, n, a), { pSelectedIndices: m, selectedSize: d, pSelectedScores: f, pValidOutputs: h } = Hc(t8, l); - return t8.wasm._free(f), t8.wasm._free(h), t8.makeOutput([d], "int32", m); -} -var tL = { kernelName: Qn, backendName: "wasm", setupFunc: Nne, kernelFunc: Tne }; -var rL; -function _ne(r15) { - rL = r15.wasm.cwrap(Qa, "number", ["number", "number", "number", "number", "number", "bool"]); -} -function $ne(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { iouThreshold: n, maxOutputSize: s, scoreThreshold: a, padToMaxOutputSize: i } = o, { boxes: p, scores: u } = e, c = t8.dataIdMap.get(p.dataId).id, l = t8.dataIdMap.get(u.dataId).id, m = rL(c, l, s, n, a, i), { pSelectedIndices: d, selectedSize: f, pSelectedScores: h, pValidOutputs: g } = Hc(t8, m); - t8.wasm._free(h); - let x = t8.makeOutput([f], "int32", d), b = t8.makeOutput([], "int32", g); + let p = i ? n : Z0({ inputs: { logits: n }, backend: t10, attrs: { dim: n.shape.length - 1 } }), [u, l] = p.shape, c = t10.makeOutput([u, s], "int32"); + return zL(t10.dataIdMap.get(p.dataId).id, u, l, s, a, t10.dataIdMap.get(c.dataId).id), i || t10.disposeData(p.dataId), c; +} +var VL = { kernelName: ps, backendName: "wasm", setupFunc: Yse, kernelFunc: Qse }; +var WL = He(us, true); +var Zse = true; +var UL = He($o, Zse); +var GL = he(ls); +function Zl(r16, e) { + let t10 = new Int32Array(r16.wasm.HEAPU8.buffer, e, 4), o = t10[0], n = t10[1], s = t10[2], a = t10[3]; + return r16.wasm._free(e), { pSelectedIndices: o, selectedSize: n, pSelectedScores: s, pValidOutputs: a }; +} +var HL; +function Jse(r16) { + HL = r16.wasm.cwrap(cs, "number", ["number", "number", "number", "number", "number"]); +} +function eae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { iouThreshold: n, maxOutputSize: s, scoreThreshold: a } = o, { boxes: i, scores: p } = t10, u = e.dataIdMap.get(i.dataId).id, l = e.dataIdMap.get(p.dataId).id, c = HL(u, l, s, n, a), { pSelectedIndices: m, selectedSize: d, pSelectedScores: f, pValidOutputs: h } = Zl(e, c); + return e.wasm._free(f), e.wasm._free(h), e.makeOutput([d], "int32", m); +} +var KL = { kernelName: cs, backendName: "wasm", setupFunc: Jse, kernelFunc: eae }; +var qL; +function tae(r16) { + qL = r16.wasm.cwrap(ni, "number", ["number", "number", "number", "number", "number", "bool"]); +} +function rae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { iouThreshold: n, maxOutputSize: s, scoreThreshold: a, padToMaxOutputSize: i } = o, { boxes: p, scores: u } = t10, l = e.dataIdMap.get(p.dataId).id, c = e.dataIdMap.get(u.dataId).id, m = qL(l, c, s, n, a, i), { pSelectedIndices: d, selectedSize: f, pSelectedScores: h, pValidOutputs: g } = Zl(e, m); + e.wasm._free(h); + let x = e.makeOutput([f], "int32", d), b = e.makeOutput([], "int32", g); return [x, b]; } -var oL = { kernelName: Qa, backendName: "wasm", setupFunc: _ne, kernelFunc: $ne }; -var nL; -function Ene(r15) { - nL = r15.wasm.cwrap(Zn, "number", ["number", "number", "number", "number", "number", "number"]); +var jL = { kernelName: ni, backendName: "wasm", setupFunc: tae, kernelFunc: rae }; +var XL; +function oae(r16) { + XL = r16.wasm.cwrap(ms, "number", ["number", "number", "number", "number", "number", "number"]); } -function Rne(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { iouThreshold: n, maxOutputSize: s, scoreThreshold: a, softNmsSigma: i } = o, { boxes: p, scores: u } = e, c = t8.dataIdMap.get(p.dataId).id, l = t8.dataIdMap.get(u.dataId).id, m = nL(c, l, s, n, a, i), { pSelectedIndices: d, selectedSize: f, pSelectedScores: h, pValidOutputs: g } = Hc(t8, m); - t8.wasm._free(g); - let x = t8.makeOutput([f], "int32", d), b = t8.makeOutput([f], "float32", h); +function nae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { iouThreshold: n, maxOutputSize: s, scoreThreshold: a, softNmsSigma: i } = o, { boxes: p, scores: u } = t10, l = e.dataIdMap.get(p.dataId).id, c = e.dataIdMap.get(u.dataId).id, m = XL(l, c, s, n, a, i), { pSelectedIndices: d, selectedSize: f, pSelectedScores: h, pValidOutputs: g } = Zl(e, m); + e.wasm._free(g); + let x = e.makeOutput([f], "int32", d), b = e.makeOutput([f], "float32", h); return [x, b]; } -var sL = { kernelName: Zn, backendName: "wasm", setupFunc: Ene, kernelFunc: Rne }; -var Dne = false; -var aL = Ue(Yn, Dne, "bool"); -var iL; -function Ane(r15) { - iL = r15.wasm.cwrap(Jn, null, ["number", "number", "number", "number", "number"]); -} -function Fne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { indices: n } = t8, { dtype: s, depth: a, onValue: i, offValue: p } = o, u = e.makeOutput([...n.shape, a], s), c = e.dataIdMap.get(u.dataId).id, m = e.dataIdMap.get(n.dataId).id; - return iL(m, a, i, p, c), u; -} -var uL = { kernelName: Jn, backendName: "wasm", setupFunc: Ane, kernelFunc: Fne }; -function Pne(r15) { - let { inputs: { x: t8 }, backend: e } = r15, o = e.makeOutput(t8.shape, t8.dtype); - return e.typedArrayFromHeap(o).fill(1), o; -} -var pL = { kernelName: ca, backendName: "wasm", kernelFunc: Pne }; -function One(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { axis: n } = o; - if (t8.length === 1) - return Mg({ inputs: { input: t8[0] }, backend: e, attrs: { dim: n } }); - let s = t8[0].shape, a = t8[0].dtype; - t8.forEach((c) => { - y.assertShapesMatch(s, c.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === c.dtype, () => "All tensors passed to stack must have matching dtypes"); +var YL = { kernelName: ms, backendName: "wasm", setupFunc: oae, kernelFunc: nae }; +var sae = false; +var QL = He(Ro, sae, "bool"); +var ZL; +function aae(r16) { + ZL = r16.wasm.cwrap(ds, null, ["number", "number", "number", "number", "number"]); +} +function iae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { indices: n } = e, { dtype: s, depth: a, onValue: i, offValue: p } = o, u = t10.makeOutput([...n.shape, a], s), l = t10.dataIdMap.get(u.dataId).id, m = t10.dataIdMap.get(n.dataId).id; + return ZL(m, a, i, p, l), u; +} +var JL = { kernelName: ds, backendName: "wasm", setupFunc: aae, kernelFunc: iae }; +function uae(r16) { + let { inputs: { x: e }, backend: t10 } = r16, o = t10.makeOutput(e.shape, e.dtype); + return t10.typedArrayFromHeap(o).fill(1), o; +} +var eB = { kernelName: xa, backendName: "wasm", kernelFunc: uae }; +function pae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { axis: n } = o; + if (e.length === 1) + return Xg({ inputs: { input: e[0] }, backend: t10, attrs: { dim: n } }); + let s = e[0].shape, a = e[0].dtype; + e.forEach((l) => { + y.assertShapesMatch(s, l.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === l.dtype, () => "All tensors passed to stack must have matching dtypes"); }); - let i = [], p = t8.map((c) => { - let l = Mg({ inputs: { input: c }, backend: e, attrs: { dim: n } }); - return i.push(l), l; - }), u = Fv({ inputs: p, backend: e, attrs: { axis: n } }); - return i.forEach((c) => e.disposeData(c.dataId)), u; -} -var cL = { kernelName: la, backendName: "wasm", kernelFunc: One }; -var lL; -function Mne(r15) { - lL = r15.wasm.cwrap(es, null, ["number", "array", "number", "number", "array", "array", "number", "number"]); -} -function Lne(r15) { - let { inputs: { x: t8 }, backend: e, attrs: { paddings: o, constantValue: n } } = r15, s = o.map((h, g) => h[0] + t8.shape[g] + h[1]); - if (y.sizeFromShape(t8.shape) === 0) - return Ov({ backend: e, attrs: { shape: s, value: n, dtype: t8.dtype } }); - let a = e.dataIdMap.get(t8.dataId).id, i = e.makeOutput(s, t8.dtype), u = e.dataIdMap.get(i.dataId).id, c = new Uint8Array(new Int32Array(t8.shape).buffer), l = o.map((h) => h[0]), m = o.map((h) => h[1]), d = new Uint8Array(new Int32Array(l).buffer), f = new Uint8Array(new Int32Array(m).buffer); - return lL(a, c, t8.shape.length, we[t8.dtype], d, f, n, u), i; -} -var Lg = { kernelName: es, backendName: "wasm", kernelFunc: Lne, setupFunc: Mne }; -var Bne = false; -var mL = Ue(ts, Bne); -var dL; -function zne(r15) { - dL = r15.wasm.cwrap(rs, null, ["number", "number", "number"]); -} -function Vne(r15) { - let { inputs: t8, backend: e } = r15, { x: o, alpha: n } = t8, s = e.dataIdMap.get(o.dataId).id, a = e.dataIdMap.get(n.dataId).id, i = s, p = o, u = p; - p.dtype !== "float32" && (u = Or({ backend: e, inputs: { x: o }, attrs: { dtype: "float32" } }), i = e.dataIdMap.get(u.dataId).id); - let c = e.makeOutput(o.shape, "float32"), l = e.dataIdMap.get(c.dataId).id; - return dL(i, a, l), p.dtype !== "float32" && e.disposeData(u.dataId), c; -} -var fL = { kernelName: rs, backendName: "wasm", setupFunc: zne, kernelFunc: Vne }; -var hL; -function Wne(r15) { - hL = r15.wasm.cwrap(os, null, ["number", "number", "number", "number"]); -} -function Une(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { axis: n, keepDims: s } = o, { x: a } = e, i = t8.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: c, axes: l, originalAxes: m, inputWasTransposed: d } = Tr(a, n, t8), f = l; + let i = [], p = e.map((l) => { + let c = Xg({ inputs: { input: l }, backend: t10, attrs: { dim: n } }); + return i.push(c), c; + }), u = j0({ inputs: p, backend: t10, attrs: { axis: n } }); + return i.forEach((l) => t10.disposeData(l.dataId)), u; +} +var tB = { kernelName: ya, backendName: "wasm", kernelFunc: pae }; +var rB; +function lae(r16) { + rB = r16.wasm.cwrap(fs, null, ["number", "array", "number", "number", "array", "array", "number", "number"]); +} +function cae(r16) { + let { inputs: { x: e }, backend: t10, attrs: { paddings: o, constantValue: n } } = r16, s = o.map((h, g) => h[0] + e.shape[g] + h[1]); + if (y.sizeFromShape(e.shape) === 0) + return Y0({ backend: t10, attrs: { shape: s, value: n, dtype: e.dtype } }); + let a = t10.dataIdMap.get(e.dataId).id, i = t10.makeOutput(s, e.dtype), u = t10.dataIdMap.get(i.dataId).id, l = new Uint8Array(new Int32Array(e.shape).buffer), c = o.map((h) => h[0]), m = o.map((h) => h[1]), d = new Uint8Array(new Int32Array(c).buffer), f = new Uint8Array(new Int32Array(m).buffer); + return rB(a, l, e.shape.length, we[e.dtype], d, f, n, u), i; +} +var Yg = { kernelName: fs, backendName: "wasm", kernelFunc: cae, setupFunc: lae }; +var mae = false; +var oB = He(hs, mae); +var nB; +function dae(r16) { + nB = r16.wasm.cwrap(gs, null, ["number", "number", "number"]); +} +function fae(r16) { + let { inputs: e, backend: t10 } = r16, { x: o, alpha: n } = e, s = t10.dataIdMap.get(o.dataId).id, a = t10.dataIdMap.get(n.dataId).id, i = s, p = o, u = p; + p.dtype !== "float32" && (u = Vr({ backend: t10, inputs: { x: o }, attrs: { dtype: "float32" } }), i = t10.dataIdMap.get(u.dataId).id); + let l = t10.makeOutput(o.shape, "float32"), c = t10.dataIdMap.get(l.dataId).id; + return nB(i, a, c), p.dtype !== "float32" && t10.disposeData(u.dataId), l; +} +var sB = { kernelName: gs, backendName: "wasm", setupFunc: dae, kernelFunc: fae }; +var aB; +function hae(r16) { + aB = r16.wasm.cwrap(Ho, null, ["number", "number", "number", "number"]); +} +function gae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { axis: n, keepDims: s } = o, { x: a } = t10, i = e.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: l, axes: c, originalAxes: m, inputWasTransposed: d } = $r(a, n, e), f = c; if (d) { - let C = t8.dataIdMap.get(c.dataId).id; - C !== i && (u = c, p = C, f = w.getInnerMostAxes(f.length, u.shape.length)); + let w = e.dataIdMap.get(l.dataId).id; + w !== i && (u = l, p = w, f = C.getInnerMostAxes(f.length, u.shape.length)); } - w.assertAxesAreInnerMostDims("prod", f, u.shape.length); - let [h, g] = w.computeOutAndReduceShapes(u.shape, f), x = y.sizeFromShape(g), b = t8.makeOutput(h, u.dtype); + C.assertAxesAreInnerMostDims("prod", f, u.shape.length); + let [h, g] = C.computeOutAndReduceShapes(u.shape, f), x = y.sizeFromShape(g), b = e.makeOutput(h, u.dtype); if (y.sizeFromShape(u.shape) !== 0) { - let C = t8.dataIdMap.get(b.dataId).id; - hL(p, x, we[b.dtype], C); + let w = e.dataIdMap.get(b.dataId).id; + aB(p, x, we[b.dtype], w); } - if (d && t8.disposeData(c.dataId), s) { - let C = w.expandShapeToKeepDim(b.shape, m); - b.shape = C; + if (d && e.disposeData(l.dataId), s) { + let w = C.expandShapeToKeepDim(b.shape, m); + b.shape = w; } return b; } -var gL = { kernelName: os, backendName: "wasm", setupFunc: Wne, kernelFunc: Une }; -var Gne = (r15) => { - let { backend: t8, attrs: e } = r15, { start: o, stop: n, step: s, dtype: a } = e, i = ap(o, n, s, a), p = t8.makeOutput([i.length], a); - return t8.typedArrayFromHeap(p).set(i), p; -}; -var xL = { kernelName: ma, backendName: "wasm", kernelFunc: Gne }; -var Hne = true; -var yL = Ue(fn, Hne); -var bL = he(ns); -var CL = he(ss); -var wL = he(us); -var SL; -function Kne(r15) { - SL = r15.wasm.cwrap(is, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); -} -function qne(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { images: n } = e, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, [c, l, m, d] = n.shape, f = [c, p, u, d], h = t8.dataIdMap.get(n.dataId), g; - h.dtype !== "float32" && (g = Or({ backend: t8, inputs: { x: n }, attrs: { dtype: "float32" } }), h = t8.dataIdMap.get(g.dataId)); - let x = h.id, b = t8.makeOutput(f, "float32"); +var iB = { kernelName: Ho, backendName: "wasm", setupFunc: hae, kernelFunc: gae }; +var xae = (r16) => { + let { backend: e, attrs: t10 } = r16, { start: o, stop: n, step: s, dtype: a } = t10, i = fp(o, n, s, a), p = e.makeOutput([i.length], a); + return e.typedArrayFromHeap(p).set(i), p; +}; +var uB = { kernelName: ba, backendName: "wasm", kernelFunc: xae }; +var yae = true; +var pB = He(Vn, yae); +var lB = he(xs); +var cB = he(ys); +var mB = he(ws); +var dB; +function bae(r16) { + dB = r16.wasm.cwrap(Cs, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +} +function Cae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { images: n } = t10, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, [l, c, m, d] = n.shape, f = [l, p, u, d], h = e.dataIdMap.get(n.dataId), g; + h.dtype !== "float32" && (g = Vr({ backend: e, inputs: { x: n }, attrs: { dtype: "float32" } }), h = e.dataIdMap.get(g.dataId)); + let x = h.id, b = e.makeOutput(f, "float32"); if (y.sizeFromShape(n.shape) === 0) return b; - let C = t8.dataIdMap.get(b.dataId).id; - return SL(x, c, l, m, d, p, u, s ? 1 : 0, a ? 1 : 0, C), g != null && t8.disposeData(g.dataId), b; + let w = e.dataIdMap.get(b.dataId).id; + return dB(x, l, c, m, d, p, u, s ? 1 : 0, a ? 1 : 0, w), g != null && e.disposeData(g.dataId), b; } -var IL = { kernelName: is, backendName: "wasm", setupFunc: Kne, kernelFunc: qne }; -var vL; -function jne(r15) { - vL = r15.wasm.cwrap(Ja, null, ["number", "number", "number", "array", "array", "boolean"]); +var fB = { kernelName: Cs, backendName: "wasm", setupFunc: bae, kernelFunc: Cae }; +var hB; +function wae(r16) { + hB = r16.wasm.cwrap(ii, null, ["number", "number", "number", "array", "array", "boolean"]); } -function Xne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o, i = e.makeOutput(n.shape, "float32"), p = e.dataIdMap.get(n.dataId), u; - return p.dtype !== "float32" && (u = Or({ backend: e, inputs: { x: n }, attrs: { dtype: "float32" } }), p = e.dataIdMap.get(u.dataId)), vL(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(i.dataId).id, new Uint8Array(new Int32Array(n.shape).buffer), new Uint8Array(new Int32Array(s.shape).buffer), a), u != null && e.disposeData(u.dataId), i; +function Sae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o, i = t10.makeOutput(n.shape, "float32"), p = t10.dataIdMap.get(n.dataId), u; + return p.dtype !== "float32" && (u = Vr({ backend: t10, inputs: { x: n }, attrs: { dtype: "float32" } }), p = t10.dataIdMap.get(u.dataId)), hB(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(i.dataId).id, new Uint8Array(new Int32Array(n.shape).buffer), new Uint8Array(new Int32Array(s.shape).buffer), a), u != null && t10.disposeData(u.dataId), i; } -var kL = { kernelName: Ja, backendName: "wasm", setupFunc: jne, kernelFunc: Xne }; -var NL; -function Yne(r15) { - NL = r15.wasm.cwrap(as, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var gB = { kernelName: ii, backendName: "wasm", setupFunc: wae, kernelFunc: Sae }; +var xB; +function Iae(r16) { + xB = r16.wasm.cwrap(bs, null, ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function Qne(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { images: n } = e, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, [c, l, m, d] = n.shape, f = [c, p, u, d], h = t8.makeOutput(f, "float32"); +function vae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { images: n } = t10, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, [l, c, m, d] = n.shape, f = [l, p, u, d], h = e.makeOutput(f, "float32"); if (y.sizeFromShape(n.shape) === 0) return h; - let g = t8.dataIdMap.get(n.dataId), x; - g.dtype !== "float32" && (x = Or({ backend: t8, inputs: { x: n }, attrs: { dtype: "float32" } }), g = t8.dataIdMap.get(x.dataId)); - let b = g.id, C = t8.dataIdMap.get(h.dataId).id; - return NL(b, c, l, m, d, p, u, s ? 1 : 0, a ? 1 : 0, C), x != null && t8.disposeData(x.dataId), h; + let g = e.dataIdMap.get(n.dataId), x; + g.dtype !== "float32" && (x = Vr({ backend: e, inputs: { x: n }, attrs: { dtype: "float32" } }), g = e.dataIdMap.get(x.dataId)); + let b = g.id, w = e.dataIdMap.get(h.dataId).id; + return xB(b, l, c, m, d, p, u, s ? 1 : 0, a ? 1 : 0, w), x != null && e.disposeData(x.dataId), h; } -var TL = { kernelName: as, backendName: "wasm", setupFunc: Yne, kernelFunc: Qne }; -var _L; -function Zne(r15) { - _L = r15.wasm.cwrap(Za, null, ["number", "number", "number", "array", "array", "boolean"]); +var yB = { kernelName: bs, backendName: "wasm", setupFunc: Iae, kernelFunc: vae }; +var bB; +function kae(r16) { + bB = r16.wasm.cwrap(ai, null, ["number", "number", "number", "array", "array", "boolean"]); } -function Jne(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o, i = e.makeOutput(n.shape, "float32"), p = e.dataIdMap.get(n.dataId), u; - return p.dtype !== "float32" && (u = Or({ backend: e, inputs: { x: n }, attrs: { dtype: "float32" } }), p = e.dataIdMap.get(u.dataId)), _L(e.dataIdMap.get(n.dataId).id, e.dataIdMap.get(s.dataId).id, e.dataIdMap.get(i.dataId).id, new Uint8Array(new Int32Array(n.shape).buffer), new Uint8Array(new Int32Array(s.shape).buffer), a), u != null && e.disposeData(u.dataId), i; +function Nae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o, i = t10.makeOutput(n.shape, "float32"), p = t10.dataIdMap.get(n.dataId), u; + return p.dtype !== "float32" && (u = Vr({ backend: t10, inputs: { x: n }, attrs: { dtype: "float32" } }), p = t10.dataIdMap.get(u.dataId)), bB(t10.dataIdMap.get(n.dataId).id, t10.dataIdMap.get(s.dataId).id, t10.dataIdMap.get(i.dataId).id, new Uint8Array(new Int32Array(n.shape).buffer), new Uint8Array(new Int32Array(s.shape).buffer), a), u != null && t10.disposeData(u.dataId), i; } -var $L = { kernelName: Za, backendName: "wasm", setupFunc: Zne, kernelFunc: Jne }; -var EL; -function ese(r15) { - EL = r15.wasm.cwrap(ps, null, ["number", "array", "number", "array", "number", "number"]); +var CB = { kernelName: ai, backendName: "wasm", setupFunc: kae, kernelFunc: Nae }; +var wB; +function Tae(r16) { + wB = r16.wasm.cwrap(Ss, null, ["number", "array", "number", "array", "number", "number"]); } -function tse(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { dims: s } = o, a = y.parseAxisParam(s, n.shape); +function _ae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dims: s } = o, a = y.parseAxisParam(s, n.shape); if (n.shape.length === 0) - return vp({ inputs: { x: n }, backend: e }); - let i = e.makeOutput(n.shape, n.dtype), p = e.dataIdMap.get(n.dataId).id, u = e.dataIdMap.get(i.dataId).id, c = new Uint8Array(new Int32Array(a).buffer), l = new Uint8Array(new Int32Array(n.shape).buffer); - EL(p, c, a.length, l, n.shape.length, u); - let m = zt({ inputs: { x: i }, attrs: { shape: n.shape }, backend: e }); - return e.disposeData(i.dataId), m; -} -var RL = { kernelName: ps, backendName: "wasm", kernelFunc: tse, setupFunc: ese }; -var DL; -function rse(r15) { - DL = r15.wasm.cwrap(Ds, null, ["number", "number", "number", "number", "number", "number", "number", "number", "array", "number", "number"]); -} -function ose(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n } = t8, { radians: s, fillValue: a, center: i } = o, p = e.makeOutput(n.shape, n.dtype), u = e.dataIdMap.get(n.dataId).id, c = e.dataIdMap.get(p.dataId).id, [l, m, d, f] = n.shape, [h, g] = w.getImageCenter(i, m, d), x = a === 0, b = 255, C = typeof a == "number" ? [a, a, a, x ? 0 : b] : [...a, b], S = new Uint8Array(new Int32Array(C).buffer); - return DL(u, l, m, d, f, s, h, g, S, C.length, c), p; -} -var AL = { kernelName: Ds, backendName: "wasm", kernelFunc: ose, setupFunc: rse }; -var FL = he(cs); -var PL = he(ls); -var OL; -function nse(r15) { - OL = r15.wasm.cwrap(ms, null, ["number", "number", "number", "number", "number", "number", "array", "number", "number"]); + return Dp({ inputs: { x: n }, backend: t10 }); + let i = t10.makeOutput(n.shape, n.dtype), p = t10.dataIdMap.get(n.dataId).id, u = t10.dataIdMap.get(i.dataId).id, l = new Uint8Array(new Int32Array(a).buffer), c = new Uint8Array(new Int32Array(n.shape).buffer); + wB(p, l, a.length, c, n.shape.length, u); + let m = Wt({ inputs: { x: i }, attrs: { shape: n.shape }, backend: t10 }); + return t10.disposeData(i.dataId), m; } -function sse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { indices: n, updates: s } = e, { shape: a } = o, i = t8.makeOutput(a, s.dtype); +var SB = { kernelName: Ss, backendName: "wasm", kernelFunc: _ae, setupFunc: Tae }; +var IB; +function Eae(r16) { + IB = r16.wasm.cwrap(Vs, null, ["number", "number", "number", "number", "number", "number", "number", "number", "array", "number", "number"]); +} +function $ae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n } = e, { radians: s, fillValue: a, center: i } = o, p = t10.makeOutput(n.shape, n.dtype), u = t10.dataIdMap.get(n.dataId).id, l = t10.dataIdMap.get(p.dataId).id, [c, m, d, f] = n.shape, [h, g] = C.getImageCenter(i, m, d), x = a === 0, b = 255, w = typeof a == "number" ? [a, a, a, x ? 0 : b] : [...a, b], S = new Uint8Array(new Int32Array(w).buffer); + return IB(u, c, m, d, f, s, h, g, S, w.length, l), p; +} +var vB = { kernelName: Vs, backendName: "wasm", kernelFunc: $ae, setupFunc: Eae }; +var kB = he(Is); +var NB = he(Do); +var TB; +function Rae(r16) { + TB = r16.wasm.cwrap(vs, null, ["number", "number", "number", "number", "number", "number", "array", "number", "number"]); +} +function Dae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { indices: n, updates: s } = t10, { shape: a } = o, i = e.makeOutput(a, s.dtype); if (y.sizeFromShape(a) === 0) return i; - let { sliceRank: p, numUpdates: u, sliceSize: c, strides: l, outputSize: m } = lu.calculateShapes(s, n, a), f = t8.dataIdMap.get(n.dataId).id, g = t8.dataIdMap.get(s.dataId).id, x = new Uint8Array(new Int32Array(l).buffer), b = t8.dataIdMap.get(i.dataId).id; - return OL(f, g, we[s.dtype], p, u, c, x, m, b), i; + let { sliceRank: p, numUpdates: u, sliceSize: l, strides: c, outputSize: m } = Cu.calculateShapes(s, n, a), f = e.dataIdMap.get(n.dataId).id, g = e.dataIdMap.get(s.dataId).id, x = new Uint8Array(new Int32Array(c).buffer), b = e.dataIdMap.get(i.dataId).id; + return TB(f, g, we[s.dtype], p, u, l, x, m, b), i; } -var ML = { kernelName: ms, backendName: "wasm", setupFunc: nse, kernelFunc: sse }; -var LL; -function ase(r15) { - LL = r15.wasm.cwrap(fs, null, ["number", "number", "number", "number", "number", "number", "bool", "number"]); +var _B = { kernelName: vs, backendName: "wasm", setupFunc: Rae, kernelFunc: Dae }; +var EB; +function Aae(r16) { + EB = r16.wasm.cwrap(Ns, null, ["number", "number", "number", "number", "number", "number", "bool", "number"]); } -function ise(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { sortedSequence: n, values: s } = t8, { side: a } = o; +function Fae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { sortedSequence: n, values: s } = e, { side: a } = o; if (n.dtype !== s.dtype) throw new Error(`SearchSorted error: sorted_sequence must have the same dtype as values. Got ${n.dtype} and ${s.dtype}`); - let i = e.makeOutput(s.shape, "int32"); + let i = t10.makeOutput(s.shape, "int32"); function p(u) { - return e.dataIdMap.get(u.dataId).id; - } - return LL(p(n), p(s), n.shape[0], n.shape[1], s.shape[1], we[n.dtype], a === "left", p(i)), i; -} -var BL = { kernelName: fs, backendName: "wasm", setupFunc: ase, kernelFunc: ise }; -var zL; -function use(r15) { - zL = r15.wasm.cwrap("SelectV2", null, ["number", "number", "number", "number", "number"]); -} -function pse(r15) { - let { inputs: t8, backend: e } = r15, { condition: o, t: n, e: s } = t8, a = e.dataIdMap.get(o.dataId).id, i = e.dataIdMap.get(n.dataId).id, p = e.dataIdMap.get(s.dataId).id, u = e.makeOutput(n.shape, n.dtype), c = e.dataIdMap.get(u.dataId).id, l = o.shape.length, m = n.shape.length, d = l === 0 || l > 1 || m === 1 ? 1 : y.sizeFromShape(n.shape.slice(1)); - return zL(a, i, p, d, c), u; -} -var VL = { kernelName: fa, backendName: "wasm", kernelFunc: pse, setupFunc: use }; -var WL = he(hs); -var UL; -function cse(r15) { - UL = r15.wasm.cwrap(bs, null, ["number", "number"]); -} -function lse(r15) { - let { backend: t8, inputs: { x: e } } = r15, o = t8.dataIdMap.get(e.dataId).id, n = t8.makeOutput(e.shape, e.dtype), s = t8.dataIdMap.get(n.dataId).id; - return y.sizeFromShape(n.shape) === 0 || UL(o, s), n; -} -var GL = { kernelName: "Sigmoid", backendName: "wasm", setupFunc: cse, kernelFunc: lse }; -var HL = he(ys); -var KL = he(gs); -var qL = he(xs); -var jL = he(Cs); -function mse(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, paddings: a } = o, i = y.sizeFromShape(s), p = [[0, 0]]; + return t10.dataIdMap.get(u.dataId).id; + } + return EB(p(n), p(s), n.shape[0], n.shape[1], s.shape[1], we[n.dtype], a === "left", p(i)), i; +} +var $B = { kernelName: Ns, backendName: "wasm", setupFunc: Aae, kernelFunc: Fae }; +var RB; +function Pae(r16) { + RB = r16.wasm.cwrap("SelectV2", null, ["number", "number", "number", "number", "number"]); +} +function Oae(r16) { + let { inputs: e, backend: t10 } = r16, { condition: o, t: n, e: s } = e, a = t10.dataIdMap.get(o.dataId).id, i = t10.dataIdMap.get(n.dataId).id, p = t10.dataIdMap.get(s.dataId).id, u = t10.makeOutput(n.shape, n.dtype), l = t10.dataIdMap.get(u.dataId).id, c = o.shape.length, m = n.shape.length, d = c === 0 || c > 1 || m === 1 ? 1 : y.sizeFromShape(n.shape.slice(1)); + return RB(a, i, p, d, l), u; +} +var DB = { kernelName: wa, backendName: "wasm", kernelFunc: Oae, setupFunc: Pae }; +var AB = he(Ts); +var FB; +function Mae(r16) { + FB = r16.wasm.cwrap(Ao, null, ["number", "number"]); +} +function Lae(r16) { + let { backend: e, inputs: { x: t10 } } = r16, o = e.dataIdMap.get(t10.dataId).id, n = e.makeOutput(t10.shape, t10.dtype), s = e.dataIdMap.get(n.dataId).id; + return y.sizeFromShape(n.shape) === 0 || FB(o, s), n; +} +var PB = { kernelName: "Sigmoid", backendName: "wasm", setupFunc: Mae, kernelFunc: Lae }; +var OB = he(Rs); +var MB = he(Es); +var LB = he($s); +var BB = he(Ds); +function Bae(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, paddings: a } = o, i = y.sizeFromShape(s), p = [[0, 0]]; p.push(...a); - for (let _ = 1 + s.length; _ < n.shape.length; ++_) + for (let T = 1 + s.length; T < n.shape.length; ++T) p.push([0, 0]); - let u = Lg.kernelFunc({ inputs: { x: n }, backend: e, attrs: { paddings: p, constantValue: 0 } }), c = w.getReshaped(u.shape, s, i, false), l = w.getPermuted(c.length, s.length, false), m = w.getReshapedPermuted(u.shape, s, i, false), h = zt({ inputs: { x: u }, backend: e, attrs: { shape: c } }), b = ho({ inputs: { x: h }, backend: e, attrs: { perm: l } }), k = zt({ inputs: { x: b }, backend: e, attrs: { shape: m } }); - return e.disposeData(u.dataId), e.disposeData(h.dataId), e.disposeData(b.dataId), k; + let u = Yg.kernelFunc({ inputs: { x: n }, backend: t10, attrs: { paddings: p, constantValue: 0 } }), l = C.getReshaped(u.shape, s, i, false), c = C.getPermuted(l.length, s.length, false), m = C.getReshapedPermuted(u.shape, s, i, false), h = Wt({ inputs: { x: u }, backend: t10, attrs: { shape: l } }), b = Vo({ inputs: { x: h }, backend: t10, attrs: { perm: c } }), k = Wt({ inputs: { x: b }, backend: t10, attrs: { shape: m } }); + return t10.disposeData(u.dataId), t10.disposeData(h.dataId), t10.disposeData(b.dataId), k; } -var XL = { kernelName: ga, backendName: "wasm", kernelFunc: mse }; -var YL; -function dse(r15) { - YL = r15.wasm.cwrap("SparseFillEmptyRows", "number", ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var zB = { kernelName: Sa, backendName: "wasm", kernelFunc: Bae }; +var VB; +function zae(r16) { + VB = r16.wasm.cwrap("SparseFillEmptyRows", "number", ["number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function fse(r15) { - let { backend: t8, inputs: e } = r15, { indices: o, values: n, denseShape: s, defaultValue: a } = e, i = o.shape[0], p = o.shape[1], u = t8.readSync(s.dataId)[0], c = [i + u, p], l = t8.dataIdMap.get(o.dataId).id, m = t8.dataIdMap.get(n.dataId).id, d = t8.dataIdMap.get(a.dataId).id, f = t8.makeOutput(c, o.dtype), h = t8.dataIdMap.get(f.dataId).id, g = t8.makeOutput(c.slice(0, 1), n.dtype), x = t8.dataIdMap.get(g.dataId).id, b = t8.makeOutput([u], "bool"), C = t8.dataIdMap.get(b.dataId).id, S = t8.makeOutput([i], o.dtype), k = t8.dataIdMap.get(S.dataId).id, _ = t8.makeOutput([4], "int32"), E = t8.dataIdMap.get(_.dataId).id, R = YL(l, m, we[n.dtype], i, u, p, d, h, x, C, k, E), D = t8.readSync(_.dataId), P; +function Vae(r16) { + let { backend: e, inputs: t10 } = r16, { indices: o, values: n, denseShape: s, defaultValue: a } = t10, i = o.shape[0], p = o.shape[1], u = e.readSync(s.dataId)[0], l = [i + u, p], c = e.dataIdMap.get(o.dataId).id, m = e.dataIdMap.get(n.dataId).id, d = e.dataIdMap.get(a.dataId).id, f = e.makeOutput(l, o.dtype), h = e.dataIdMap.get(f.dataId).id, g = e.makeOutput(l.slice(0, 1), n.dtype), x = e.dataIdMap.get(g.dataId).id, b = e.makeOutput([u], "bool"), w = e.dataIdMap.get(b.dataId).id, S = e.makeOutput([i], o.dtype), k = e.dataIdMap.get(S.dataId).id, T = e.makeOutput([4], "int32"), E = e.dataIdMap.get(T.dataId).id, R = VB(c, m, we[n.dtype], i, u, p, d, h, x, w, k, E), D = e.readSync(T.dataId), F; switch (D[0]) { case 1: { - P = w.getSparseFillEmptyRowsIndicesDenseShapeMismatch(D[1]); + F = C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(D[1]); break; } case 2: { - P = w.getSparseFillEmptyRowsNegativeIndexErrorMessage(D[1], D[2]); + F = C.getSparseFillEmptyRowsNegativeIndexErrorMessage(D[1], D[2]); break; } case 3: - P = w.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(D[1], D[2], D[3]); + F = C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(D[1], D[2], D[3]); break; default: - P = ""; + F = ""; } - if (t8.disposeData(_.dataId), P) - throw t8.disposeData(f.dataId), t8.disposeData(g.dataId), t8.disposeData(b.dataId), t8.disposeData(S.dataId), new Error(P); + if (e.disposeData(T.dataId), F) + throw e.disposeData(f.dataId), e.disposeData(g.dataId), e.disposeData(b.dataId), e.disposeData(S.dataId), new Error(F); let O = f, M = g; - return R !== c[0] && (O = Po({ inputs: { x: f }, attrs: { begin: 0, size: [R, p] }, backend: t8 }), M = Po({ inputs: { x: g }, attrs: { begin: 0, size: R }, backend: t8 }), t8.disposeData(f.dataId), t8.disposeData(g.dataId)), [O, M, b, S]; + return R !== l[0] && (O = an({ inputs: { x: f }, attrs: { begin: 0, size: [R, p] }, backend: e }), M = an({ inputs: { x: g }, attrs: { begin: 0, size: R }, backend: e }), e.disposeData(f.dataId), e.disposeData(g.dataId)), [O, M, b, S]; } -var QL = { kernelName: Hi, backendName: "wasm", setupFunc: dse, kernelFunc: fse }; -var ZL; -function hse(r15) { - ZL = r15.wasm.cwrap(ei, null, ["number", "number", "number", "number", "number", "number", "number"]); +var WB = { kernelName: eu, backendName: "wasm", setupFunc: zae, kernelFunc: Vae }; +var UB; +function Wae(r16) { + UB = r16.wasm.cwrap(ui, null, ["number", "number", "number", "number", "number", "number", "number"]); } -function gse(r15) { - let { backend: t8, inputs: e } = r15, { inputIndices: o, inputShape: n, newShape: s } = e; +function Uae(r16) { + let { backend: e, inputs: t10 } = r16, { inputIndices: o, inputShape: n, newShape: s } = t10; if (o.shape.length !== 2) throw new Error(`Input indices should be a matrix but received shape ${o.shape}`); @@ -26101,350 +26197,350 @@ function gse(r15) { ${n.shape}`); if (s.shape.length !== 1) throw new Error(`Target shape should be a vector but received shape ${s.shape}`); - let a = t8.dataIdMap.get(o.dataId).id, i = t8.dataIdMap.get(n.dataId).id, p = t8.dataIdMap.get(s.dataId).id, u = o.shape[0], c = y.sizeFromShape(s.shape), l = t8.makeOutput([u, c], o.dtype), m = t8.dataIdMap.get(l.dataId).id, d = t8.makeOutput([c], s.dtype), f = t8.dataIdMap.get(d.dataId).id, h = t8.makeOutput([3], "int32"), g = t8.dataIdMap.get(h.dataId).id; - ZL(a, i, p, u, m, f, g); - let x = t8.readSync(h.dataId), b; + let a = e.dataIdMap.get(o.dataId).id, i = e.dataIdMap.get(n.dataId).id, p = e.dataIdMap.get(s.dataId).id, u = o.shape[0], l = y.sizeFromShape(s.shape), c = e.makeOutput([u, l], o.dtype), m = e.dataIdMap.get(c.dataId).id, d = e.makeOutput([l], s.dtype), f = e.dataIdMap.get(d.dataId).id, h = e.makeOutput([3], "int32"), g = e.dataIdMap.get(h.dataId).id; + UB(a, i, p, u, m, f, g); + let x = e.readSync(h.dataId), b; switch (x[0]) { case 0: { - b = w.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(x[1], x[2]); + b = C.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(x[1], x[2]); break; } case 1: { - b = w.getSparseReshapeNegativeOutputDimErrorMessage(x[1], x[2]); + b = C.getSparseReshapeNegativeOutputDimErrorMessage(x[1], x[2]); break; } case 2: - b = w.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage(); + b = C.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage(); break; case 3: { - let C = Array.from(t8.readSync(n.dataId)), S = Array.from(t8.readSync(d.dataId)); - b = w.getSparseReshapeInputOutputMultipleErrorMessage(C, S); + let w = Array.from(e.readSync(n.dataId)), S = Array.from(e.readSync(d.dataId)); + b = C.getSparseReshapeInputOutputMultipleErrorMessage(w, S); break; } case 4: { - let C = Array.from(t8.readSync(n.dataId)), S = Array.from(t8.readSync(d.dataId)); - b = w.getSparseReshapeInputOutputMismatchErrorMessage(C, S); + let w = Array.from(e.readSync(n.dataId)), S = Array.from(e.readSync(d.dataId)); + b = C.getSparseReshapeInputOutputMismatchErrorMessage(w, S); break; } default: b = ""; } - if (t8.disposeData(h.dataId), b) - throw t8.disposeData(l.dataId), t8.disposeData(d.dataId), new Error(b); - return [l, d]; + if (e.disposeData(h.dataId), b) + throw e.disposeData(c.dataId), e.disposeData(d.dataId), new Error(b); + return [c, d]; } -var JL = { kernelName: ei, backendName: "wasm", setupFunc: hse, kernelFunc: gse }; -var eB; -function Bg(r15) { - eB = r15.wasm.cwrap("SparseSegmentReduction", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number"]); +var GB = { kernelName: ui, backendName: "wasm", setupFunc: Wae, kernelFunc: Uae }; +var HB; +function Qg(r16) { + HB = r16.wasm.cwrap("SparseSegmentReduction", null, ["number", "number", "number", "number", "number", "number", "number", "number", "number"]); } -function zg(r15, t8) { - let { backend: e, inputs: o } = r15, { data: n, indices: s, segmentIds: a } = o, i = s.shape[0], p = e.readSync(a.dataId, i - 1, i)[0], c = i > 0 ? p + 1 : 0; - if (c < 0) - throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); - let l = n.shape.slice(); - l[0] = c; - let m = e.dataIdMap.get(n.dataId).id, d = e.dataIdMap.get(s.dataId).id, f = e.dataIdMap.get(a.dataId).id, h = e.makeOutput(l, n.dtype), g = e.dataIdMap.get(h.dataId).id, x = e.makeOutput([4], "int32"), b = e.dataIdMap.get(x.dataId).id; - eB(m, we[n.dtype], n.shape[0], d, f, g, b, t8, 0); - let C = e.readSync(x.dataId), S; - switch (C[0]) { +function Zg(r16, e) { + let { backend: t10, inputs: o } = r16, { data: n, indices: s, segmentIds: a } = o, i = s.shape[0], p = t10.readSync(a.dataId, i - 1, i)[0], l = i > 0 ? p + 1 : 0; + if (l < 0) + throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); + let c = n.shape.slice(); + c[0] = l; + let m = t10.dataIdMap.get(n.dataId).id, d = t10.dataIdMap.get(s.dataId).id, f = t10.dataIdMap.get(a.dataId).id, h = t10.makeOutput(c, n.dtype), g = t10.dataIdMap.get(h.dataId).id, x = t10.makeOutput([4], "int32"), b = t10.dataIdMap.get(x.dataId).id; + HB(m, we[n.dtype], n.shape[0], d, f, g, b, e, 0); + let w = t10.readSync(x.dataId), S; + switch (w[0]) { case 0: { - S = w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage(); + S = C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage(); break; } case 1: { - S = w.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage(); + S = C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage(); break; } case 2: - S = w.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(C[1], C[2]); + S = C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(w[1], w[2]); break; case 3: - S = w.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(C[1], C[2], C[3]); + S = C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(w[1], w[2], w[3]); break; default: S = ""; } - if (e.disposeData(x.dataId), S) - throw e.disposeData(h.dataId), new Error(S); + if (t10.disposeData(x.dataId), S) + throw t10.disposeData(h.dataId), new Error(S); return h; } -function xse(r15) { - return zg(r15, true); +function Gae(r16) { + return Zg(r16, true); } -var tB = { kernelName: ya, backendName: "wasm", setupFunc: Bg, kernelFunc: xse }; -function yse(r15) { - return zg(r15, false); +var KB = { kernelName: va, backendName: "wasm", setupFunc: Qg, kernelFunc: Gae }; +function Hae(r16) { + return Zg(r16, false); } -var rB = { kernelName: ba, backendName: "wasm", setupFunc: Bg, kernelFunc: yse }; -var oB; -function bse(r15) { - oB = r15.wasm.cwrap(vs, null, ["number", "number", "number", "number", "number", "number", "number", "number", "array", "number", "number"]); +var qB = { kernelName: ka, backendName: "wasm", setupFunc: Qg, kernelFunc: Hae }; +var jB; +function Kae(r16) { + jB = r16.wasm.cwrap(Ps, null, ["number", "number", "number", "number", "number", "number", "number", "number", "array", "number", "number"]); } -function Cse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { sparseIndices: n, sparseValues: s, defaultValue: a } = e, { outputShape: i } = o, p = t8.makeOutput(i, a.dtype); +function qae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { sparseIndices: n, sparseValues: s, defaultValue: a } = t10, { outputShape: i } = o, p = e.makeOutput(i, a.dtype); if (y.sizeFromShape(i) === 0) return p; - let { sliceRank: u, numUpdates: c, sliceSize: l, strides: m, outputSize: d } = w.calculateShapes(s, n, i), f = t8.dataIdMap.get(n.dataId).id, h = t8.dataIdMap.get(s.dataId).id, g = t8.dataIdMap.get(a.dataId).id, x = new Uint8Array(new Int32Array(m).buffer), b = t8.dataIdMap.get(p.dataId).id; - return oB(f, h, s.shape.length, g, we[a.dtype], u, c, l, x, d, b), p; -} -var nB = { kernelName: vs, backendName: "wasm", setupFunc: bse, kernelFunc: Cse }; -function wse(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { x: n } = t8, { numOrSizeSplits: s, axis: a } = e, i = y.parseAxisParam(a, n.shape)[0], p = w.prepareSplitSize(n, s, i), u = new Array(n.shape.length).fill(0), c = n.shape.slice(); - return p.map((l) => { - let m = [...c]; - m[i] = l; - let d = Po({ inputs: { x: n }, attrs: { begin: u, size: m }, backend: o }); - return u[i] += l, d; + let { sliceRank: u, numUpdates: l, sliceSize: c, strides: m, outputSize: d } = C.calculateShapes(s, n, i), f = e.dataIdMap.get(n.dataId).id, h = e.dataIdMap.get(s.dataId).id, g = e.dataIdMap.get(a.dataId).id, x = new Uint8Array(new Int32Array(m).buffer), b = e.dataIdMap.get(p.dataId).id; + return jB(f, h, s.shape.length, g, we[a.dtype], u, l, c, x, d, b), p; +} +var XB = { kernelName: Ps, backendName: "wasm", setupFunc: Kae, kernelFunc: qae }; +function jae(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { x: n } = e, { numOrSizeSplits: s, axis: a } = t10, i = y.parseAxisParam(a, n.shape)[0], p = C.prepareSplitSize(n, s, i), u = new Array(n.shape.length).fill(0), l = n.shape.slice(); + return p.map((c) => { + let m = [...l]; + m[i] = c; + let d = an({ inputs: { x: n }, attrs: { begin: u, size: m }, backend: o }); + return u[i] += c, d; }); } -var sB = { kernelName: xa, backendName: "wasm", kernelFunc: wse }; -var aB = he(ws); -var iB = he(Ki); -var Sse = true; -var uB = Ue(ks, Sse); -var pB; -function Ise(r15) { - pB = r15.wasm.cwrap(wo, null, ["number", "number", "number", "number"]); -} -function vse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { alpha: n } = o, { x: s } = e, a = t8.dataIdMap.get(s.dataId).id, i = t8.makeOutput(s.shape, s.dtype), p = t8.dataIdMap.get(i.dataId).id; - return pB(a, n, we[s.dtype], p), i; -} -var cB = { kernelName: wo, backendName: "wasm", setupFunc: Ise, kernelFunc: vse }; -var lB; -function kse(r15) { - lB = r15.wasm.cwrap(Ns, null, ["number", "array", "number", "array", "array", "array", "array", "array", "number", "number"]); -} -function Nse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { x: n } = e, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: c, newAxisMask: l, shrinkAxisMask: m } = o, { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: C, strides: S } = pt.sliceInfo(n.shape, s, a, i, p, u, c, l, m), k; +var YB = { kernelName: Ia, backendName: "wasm", kernelFunc: jae }; +var QB = he(Fo); +var ZB = he(tu); +var Xae = true; +var JB = He(Po, Xae); +var ez; +function Yae(r16) { + ez = r16.wasm.cwrap(Ko, null, ["number", "number", "number", "number"]); +} +function Qae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { alpha: n } = o, { x: s } = t10, a = e.dataIdMap.get(s.dataId).id, i = e.makeOutput(s.shape, s.dtype), p = e.dataIdMap.get(i.dataId).id; + return ez(a, n, we[s.dtype], p), i; +} +var tz = { kernelName: Ko, backendName: "wasm", setupFunc: Yae, kernelFunc: Qae }; +var rz; +function Zae(r16) { + rz = r16.wasm.cwrap(Os, null, ["number", "array", "number", "array", "array", "array", "array", "array", "number", "number"]); +} +function Jae(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { x: n } = t10, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: l, newAxisMask: c, shrinkAxisMask: m } = o, { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: w, strides: S } = nt.sliceInfo(n.shape, s, a, i, p, u, l, c, m), k; if (h) - k = zt({ inputs: { x: n }, backend: t8, attrs: { shape: f } }); + k = Wt({ inputs: { x: n }, backend: e, attrs: { shape: f } }); else if (g || x) { y.assert(n.shape.length >= 1, () => `Input must have rank at least 1, got: ${n.shape.length}`); - let _ = pt.computeOutShape(b, C, S), E = Po({ inputs: { x: n }, backend: t8, attrs: { begin: b, size: _ } }); - k = zt({ inputs: { x: E }, backend: t8, attrs: { shape: f } }), t8.disposeData(E.dataId); + let T = nt.computeOutShape(b, w, S), E = an({ inputs: { x: n }, backend: e, attrs: { begin: b, size: T } }); + k = Wt({ inputs: { x: E }, backend: e, attrs: { shape: f } }), e.disposeData(E.dataId); } else { - let _ = t8.makeOutput(d, "float32"), E = t8.dataIdMap.get(n.dataId).id, R = new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer), D = new Uint8Array(new Int32Array(b).buffer), P = new Uint8Array(new Int32Array(C).buffer), O = new Uint8Array(new Int32Array(S).buffer), M = new Uint8Array(new Int32Array(d).buffer), L = new Uint8Array(new Int32Array(y.computeStrides(d)).buffer), B = t8.dataIdMap.get(_.dataId).id; - lB(E, R, n.shape.length, D, P, O, M, L, d.length, B), k = zt({ inputs: { x: _ }, backend: t8, attrs: { shape: f } }), t8.disposeData(_.dataId); + let T = e.makeOutput(d, "float32"), E = e.dataIdMap.get(n.dataId).id, R = new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer), D = new Uint8Array(new Int32Array(b).buffer), F = new Uint8Array(new Int32Array(w).buffer), O = new Uint8Array(new Int32Array(S).buffer), M = new Uint8Array(new Int32Array(d).buffer), L = new Uint8Array(new Int32Array(y.computeStrides(d)).buffer), B = e.dataIdMap.get(T.dataId).id; + rz(E, R, n.shape.length, D, F, O, M, L, d.length, B), k = Wt({ inputs: { x: T }, backend: e, attrs: { shape: f } }), e.disposeData(T.dataId); } return k; } -var mB = { kernelName: Ns, backendName: "wasm", setupFunc: kse, kernelFunc: Nse }; -function Tse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { data: n, dataSplits: s } = e, { separator: a, nGramWidths: i, leftPad: p, rightPad: u, padWidth: c, preserveShortSequences: l } = o, m = t8.readSync(n.dataId), d = t8.readSync(s.dataId), [f, h] = up(m, d, a, i, p, u, c, l), g = t8.makeOutput([f.length], "string"), x = t8.dataIdMap.get(g.dataId); +var oz = { kernelName: Os, backendName: "wasm", setupFunc: Zae, kernelFunc: Jae }; +function eie(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { data: n, dataSplits: s } = t10, { separator: a, nGramWidths: i, leftPad: p, rightPad: u, padWidth: l, preserveShortSequences: c } = o, m = e.readSync(n.dataId), d = e.readSync(s.dataId), [f, h] = gp(m, d, a, i, p, u, l, c), g = e.makeOutput([f.length], "string"), x = e.dataIdMap.get(g.dataId); x.stringBytes = f; - let b = t8.makeOutput(s.shape, "int32"); - return t8.typedArrayFromHeap(b).set(h), [g, b]; -} -var dB = { kernelName: Ca, backendName: "wasm", kernelFunc: Tse }; -function _se(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { input: n, delimiter: s } = e, { skipEmpty: a } = o, i = t8.readSync(n.dataId), p = t8.readSync(s.dataId), [u, c, l] = pp(i, p[0], a), m = c.length, d = t8.makeOutput([m, 2], "int32"); - t8.typedArrayFromHeap(d).set(u); - let h = t8.makeOutput([m], "string"), g = t8.dataIdMap.get(h.dataId); - g.stringBytes = c; - let x = t8.makeOutput([2], "int32"); - return t8.typedArrayFromHeap(x).set(l), [d, h, x]; -} -var fB = { kernelName: qi, backendName: "wasm", kernelFunc: _se }; -function $se(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { input: n } = e, { numBuckets: s } = o, a = t8.readSync(n.dataId), i = cp(a, s), p = t8.makeOutput(n.shape, "int32"); - return t8.typedArrayFromHeap(p).set(i), p; -} -var hB = { kernelName: ji, backendName: "wasm", kernelFunc: $se }; -var Ese = true; -var gB = Ue(Ts, Ese); -var xB; -function Rse(r15) { - xB = r15.wasm.cwrap(Ss, null, ["number", "number", "number", "number"]); -} -function Dse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { axis: n, keepDims: s } = o, { x: a } = e, i = t8.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: c, axes: l, originalAxes: m, inputWasTransposed: d } = Tr(a, n, t8), f = l; + let b = e.makeOutput(s.shape, "int32"); + return e.typedArrayFromHeap(b).set(h), [g, b]; +} +var nz = { kernelName: Na, backendName: "wasm", kernelFunc: eie }; +function tie(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { input: n, delimiter: s } = t10, { skipEmpty: a } = o, i = e.readSync(n.dataId), p = e.readSync(s.dataId), [u, l, c] = xp(i, p[0], a), m = l.length, d = e.makeOutput([m, 2], "int32"); + e.typedArrayFromHeap(d).set(u); + let h = e.makeOutput([m], "string"), g = e.dataIdMap.get(h.dataId); + g.stringBytes = l; + let x = e.makeOutput([2], "int32"); + return e.typedArrayFromHeap(x).set(c), [d, h, x]; +} +var sz = { kernelName: ru, backendName: "wasm", kernelFunc: tie }; +function rie(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { input: n } = t10, { numBuckets: s } = o, a = e.readSync(n.dataId), i = yp(a, s), p = e.makeOutput(n.shape, "int32"); + return e.typedArrayFromHeap(p).set(i), p; +} +var az = { kernelName: ou, backendName: "wasm", kernelFunc: rie }; +var oie = true; +var iz = He(Oo, oie); +var uz; +function nie(r16) { + uz = r16.wasm.cwrap(As, null, ["number", "number", "number", "number"]); +} +function sie(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { axis: n, keepDims: s } = o, { x: a } = t10, i = e.dataIdMap.get(a.dataId).id, p = i, u = a, { transposed: l, axes: c, originalAxes: m, inputWasTransposed: d } = $r(a, n, e), f = c; if (d) { - let C = t8.dataIdMap.get(c.dataId).id; - C !== i && (u = c, p = C, f = w.getInnerMostAxes(f.length, u.shape.length)); + let w = e.dataIdMap.get(l.dataId).id; + w !== i && (u = l, p = w, f = C.getInnerMostAxes(f.length, u.shape.length)); } - w.assertAxesAreInnerMostDims("sum", f, u.shape.length); - let [h, g] = w.computeOutAndReduceShapes(u.shape, f), x = y.sizeFromShape(g), b = t8.makeOutput(h, u.dtype); + C.assertAxesAreInnerMostDims("sum", f, u.shape.length); + let [h, g] = C.computeOutAndReduceShapes(u.shape, f), x = y.sizeFromShape(g), b = e.makeOutput(h, u.dtype); if (y.sizeFromShape(u.shape) !== 0) { - let C = t8.dataIdMap.get(b.dataId).id; - xB(p, x, we[b.dtype], C); + let w = e.dataIdMap.get(b.dataId).id; + uz(p, x, we[b.dtype], w); } - if (d && t8.disposeData(c.dataId), s) { - let C = w.expandShapeToKeepDim(b.shape, m); - b.shape = C; + if (d && e.disposeData(l.dataId), s) { + let w = C.expandShapeToKeepDim(b.shape, m); + b.shape = w; } return b; } -var yB = { kernelName: Ss, backendName: "wasm", setupFunc: Rse, kernelFunc: Dse }; -var bB = he(_s); -var CB = he($s); -var wB; -function Ase(r15) { - wB = r15.wasm.cwrap(ds, null, ["number", "number", "number", "number", "number", "number", "array", "number", "number", "number"]); +var pz = { kernelName: As, backendName: "wasm", setupFunc: nie, kernelFunc: sie }; +var lz = he(Ms); +var cz = he(Ls); +var mz; +function aie(r16) { + mz = r16.wasm.cwrap(ks, null, ["number", "number", "number", "number", "number", "number", "array", "number", "number", "number"]); } -function Fse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { tensor: n, indices: s, updates: a } = e, {} = o, i = t8.makeOutput(n.shape, n.dtype); +function iie(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { tensor: n, indices: s, updates: a } = t10, {} = o, i = e.makeOutput(n.shape, n.dtype); if (y.sizeFromShape(n.shape) === 0) return i; - let { sliceRank: p, numUpdates: u, sliceSize: c, strides: l, outputSize: m } = lu.calculateShapes(a, s, n.shape), f = t8.dataIdMap.get(s.dataId).id, g = t8.dataIdMap.get(a.dataId).id, b = t8.dataIdMap.get(n.dataId).id, C = new Uint8Array(new Int32Array(l).buffer), S = t8.dataIdMap.get(i.dataId).id; - return wB(f, g, we[a.dtype], p, u, c, C, m, S, b), i; + let { sliceRank: p, numUpdates: u, sliceSize: l, strides: c, outputSize: m } = Cu.calculateShapes(a, s, n.shape), f = e.dataIdMap.get(s.dataId).id, g = e.dataIdMap.get(a.dataId).id, b = e.dataIdMap.get(n.dataId).id, w = new Uint8Array(new Int32Array(c).buffer), S = e.dataIdMap.get(i.dataId).id; + return mz(f, g, we[a.dtype], p, u, l, w, m, S, b), i; } -var SB = { kernelName: ds, backendName: "wasm", setupFunc: Ase, kernelFunc: Fse }; -var IB; -function Pse(r15) { - IB = r15.wasm.cwrap(uo, null, ["number", "array", "number", "array", "number", "number"]); +var dz = { kernelName: ks, backendName: "wasm", setupFunc: aie, kernelFunc: iie }; +var fz; +function uie(r16) { + fz = r16.wasm.cwrap(Mo, null, ["number", "array", "number", "array", "number", "number"]); } -function Ose(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, s = e.dataIdMap.get(n.dataId).id, { reps: a } = o, i = new Array(n.shape.length); +function pie(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, s = t10.dataIdMap.get(n.dataId).id, { reps: a } = o, i = new Array(n.shape.length); for (let m = 0; m < i.length; m++) i[m] = n.shape[m] * a[m]; - let p = new Uint8Array(new Int32Array(n.shape).buffer), u = new Uint8Array(new Int32Array(i).buffer), c = e.makeOutput(i, n.dtype), l = e.dataIdMap.get(c.dataId).id; - return IB(s, p, n.shape.length, u, i.length, we[c.dtype], l), c; + let p = new Uint8Array(new Int32Array(n.shape).buffer), u = new Uint8Array(new Int32Array(i).buffer), l = t10.makeOutput(i, n.dtype), c = t10.dataIdMap.get(l.dataId).id; + return fz(s, p, n.shape.length, u, i.length, we[l.dtype], c), l; } -var vB = { kernelName: uo, backendName: "wasm", setupFunc: Pse, kernelFunc: Ose }; -var kB; -function Mse(r15) { - kB = r15.wasm.cwrap(Es, null, ["number", "array", "number", "number", "number", "bool", "number", "number"]); +var hz = { kernelName: Mo, backendName: "wasm", setupFunc: uie, kernelFunc: pie }; +var gz; +function lie(r16) { + gz = r16.wasm.cwrap(Bs, null, ["number", "array", "number", "number", "number", "bool", "number", "number"]); } -var Lse = ({ inputs: r15, backend: t8, attrs: e }) => { - let { x: o } = r15, { k: n, sorted: s } = e, a = t8.dataIdMap.get(o.dataId).id, i = new Uint8Array(new Int32Array(o.shape).buffer), p = o.shape.slice(); +var cie = ({ inputs: r16, backend: e, attrs: t10 }) => { + let { x: o } = r16, { k: n, sorted: s } = t10, a = e.dataIdMap.get(o.dataId).id, i = new Uint8Array(new Int32Array(o.shape).buffer), p = o.shape.slice(); p[p.length - 1] = n; - let u = t8.makeOutput(p, o.dtype), c = t8.dataIdMap.get(u.dataId).id, l = t8.makeOutput(p, "int32"), m = t8.dataIdMap.get(l.dataId).id; - return kB(a, i, o.shape.length, we[o.dtype], n, s, c, m), [u, l]; + let u = e.makeOutput(p, o.dtype), l = e.dataIdMap.get(u.dataId).id, c = e.makeOutput(p, "int32"), m = e.dataIdMap.get(c.dataId).id; + return gz(a, i, o.shape.length, we[o.dtype], n, s, l, m), [u, c]; }; -var NB = { kernelName: Es, backendName: "wasm", setupFunc: Mse, kernelFunc: Lse }; -var TB; -function Bse(r15) { - TB = r15.wasm.cwrap(Rs, null, ["number", "number", "bool", "number", "number", "number", "number", "number", "number", "array", "number", "array", "number", "number", "number", "number", "number"]); +var xz = { kernelName: Bs, backendName: "wasm", setupFunc: lie, kernelFunc: cie }; +var yz; +function mie(r16) { + yz = r16.wasm.cwrap(zs, null, ["number", "number", "bool", "number", "number", "number", "number", "number", "number", "array", "number", "array", "number", "number", "number", "number", "number"]); } -function zse(r15) { - let { backend: t8, inputs: e, attrs: o } = r15, { image: n, transforms: s } = e, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = o, [c, l, m, d] = n.shape, [f, h] = u != null ? u : [l, m], g = [c, f, h, d], x = new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer), b = new Uint8Array(new Int32Array(y.computeStrides(g)).buffer), C = t8.makeOutput(g, n.dtype), S = t8.dataIdMap.get(C.dataId).id, _ = t8.dataIdMap.get(n.dataId).id, R = t8.dataIdMap.get(s.dataId).id, D = a === "nearest" ? 1 : 2, P; +function die(r16) { + let { backend: e, inputs: t10, attrs: o } = r16, { image: n, transforms: s } = t10, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = o, [l, c, m, d] = n.shape, [f, h] = u != null ? u : [c, m], g = [l, f, h, d], x = new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer), b = new Uint8Array(new Int32Array(y.computeStrides(g)).buffer), w = e.makeOutput(g, n.dtype), S = e.dataIdMap.get(w.dataId).id, T = e.dataIdMap.get(n.dataId).id, R = e.dataIdMap.get(s.dataId).id, D = a === "nearest" ? 1 : 2, F; switch (i) { case "constant": - P = 1; + F = 1; break; case "reflect": - P = 2; + F = 2; break; case "wrap": - P = 3; + F = 3; break; case "nearest": - P = 4; + F = 4; break; default: - P = 1; + F = 1; break; } - return TB(_, R, s.shape[0] > 1, c, f, h, d, m, l, x, n.shape.length - 1, b, g.length - 1, D, P, p, S), C; + return yz(T, R, s.shape[0] > 1, l, f, h, d, m, c, x, n.shape.length - 1, b, g.length - 1, D, F, p, S), w; } -var _B = { kernelName: Rs, backendName: "wasm", setupFunc: Bse, kernelFunc: zse }; -function Vse(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { axis: n } = e, { x: s } = t8, { outputValues: a, outputShape: i, indices: p } = lp(o.readSync(s.dataId), n, s.shape, s.dtype); +var bz = { kernelName: zs, backendName: "wasm", setupFunc: mie, kernelFunc: die }; +function fie(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { axis: n } = t10, { x: s } = e, { outputValues: a, outputShape: i, indices: p } = bp(o.readSync(s.dataId), n, s.shape, s.dtype); return [o.makeOutput(i, s.dtype, void 0, a), o.makeOutput([p.length], "int32", void 0, p)]; } -var $B = { kernelName: Xi, backendName: "wasm", kernelFunc: Vse }; -function Wse(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { value: n } = t8, { axis: s } = o; +var Cz = { kernelName: nu, backendName: "wasm", kernelFunc: fie }; +function hie(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { value: n } = e, { axis: s } = o; s < 0 && (s += n.shape.length); let a = n.shape[s], i = n.shape.length, p = new Array(i - 1), u = 0; for (let d = 0; d < i; d++) d !== s && (p[u++] = n.shape[d]); - let c = new Array(a), l = new Array(i).fill(0), m = n.shape.slice(); + let l = new Array(a), c = new Array(i).fill(0), m = n.shape.slice(); m[s] = 1; - for (let d = 0; d < c.length; d++) - l[s] = d, c[d] = Po({ inputs: { x: n }, attrs: { begin: l, size: m }, backend: e }); - return c.map(({ dataId: d, dtype: f }) => ({ dataId: d, dtype: f, shape: p })); -} -var EB = { kernelName: wa, backendName: "wasm", kernelFunc: Wse }; -function Use(r15) { - let { inputs: { x: t8 }, backend: e } = r15, o = e.makeOutput(t8.shape, t8.dtype); - return e.typedArrayFromHeap(o).fill(0), o; -} -var RB = { kernelName: Sa, backendName: "wasm", kernelFunc: Use }; -var Gse = [gP, xP, yP, bP, CP, SP, TP, $P, EP, RP, DP, AP, FP, PP, OP, LP, GP, zP, WP, qP, XP, QP, ZP, JP, eO, tO, oO, nO, aO, uO, cO, mO, fO, hO, gO, yO, CO, SO, vO, NO, _O, EO, DO, FO, OO, MO, BO, zO, VO, WO, UO, GO, HO, qO, jO, XO, QO, JO, tM, oM, sM, aM, iM, IP, uM, pM, cM, mM, dM, fM, gM, yM, xM, bM, CM, wM, SM, vM, NM, _M, $M, RM, AM, PM, MM, BM, VM, UM, GM, KM, YM, QM, ZM, JM, tL, oL, sL, aL, uL, pL, cL, Lg, mL, fL, gL, xL, yL, bL, CL, wL, HP, IL, kL, TL, $L, RL, AL, FL, PL, ML, BL, VL, WL, GL, HL, KL, qL, jP, jM, jL, XL, QL, JL, tB, rB, nB, sB, aB, iB, uB, cB, mB, dB, fB, hB, gB, yB, bB, CB, SB, vB, NB, _B, kP, $B, EB, RB]; -for (let r15 of Gse) - ti(r15); -var Bv = A(); -Bv.registerFlag("WASM_HAS_SIMD_SUPPORT", async () => { + for (let d = 0; d < l.length; d++) + c[s] = d, l[d] = an({ inputs: { x: n }, attrs: { begin: c, size: m }, backend: t10 }); + return l.map(({ dataId: d, dtype: f }) => ({ dataId: d, dtype: f, shape: p })); +} +var wz = { kernelName: Ta, backendName: "wasm", kernelFunc: hie }; +function gie(r16) { + let { inputs: { x: e }, backend: t10 } = r16, o = t10.makeOutput(e.shape, e.dtype); + return t10.typedArrayFromHeap(o).fill(0), o; +} +var Sz = { kernelName: _a, backendName: "wasm", kernelFunc: gie }; +var xie = [iO, uO, pO, lO, cO, dO, yO, CO, wO, SO, IO, vO, kO, NO, TO, EO, PO, RO, AO, LO, zO, WO, UO, GO, HO, KO, jO, XO, QO, JO, tM, oM, sM, aM, iM, pM, cM, dM, hM, xM, bM, wM, IM, kM, TM, _M, $M, RM, DM, AM, FM, PM, OM, LM, BM, zM, WM, GM, KM, jM, YM, QM, ZM, fO, JM, eL, tL, oL, nL, sL, iL, pL, uL, lL, cL, mL, dL, hL, xL, bL, CL, SL, vL, NL, _L, $L, DL, FL, PL, ML, VL, WL, UL, GL, KL, jL, YL, QL, JL, eB, tB, Yg, oB, sB, iB, uB, pB, lB, cB, mB, OO, fB, gB, yB, CB, SB, vB, kB, NB, _B, $B, DB, AB, PB, OB, MB, LB, BO, BL, BB, zB, WB, GB, KB, qB, XB, YB, QB, ZB, JB, tz, oz, nz, sz, az, iz, pz, lz, cz, dz, hz, xz, bz, gO, Cz, wz, Sz]; +for (let r16 of xie) + li(r16); +var J0 = A(); +J0.registerFlag("WASM_HAS_SIMD_SUPPORT", async () => { try { return 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])); - } catch (r15) { + } catch (r16) { return false; } }); -Bv.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT", async () => { - if (Bv.get("IS_NODE")) +J0.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT", async () => { + if (J0.get("IS_NODE")) return false; 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 (r15) { + } catch (r16) { return false; } }); -var qv = Lp(PB()); -var VB = Lp(MB()); -var jv = Lp(LB()); -var BB = qv.default || qv; -var Hse = jv.default || jv; -var im = class extends so { - constructor(t8) { - super(), this.wasm = t8, this.dataIdNextNumber = 1, this.wasm.tfjs.initWithThreadsCount(UB), Kv = this.wasm.tfjs.getThreadsCount(), this.dataIdMap = new Bo(this, ur()); - } - write(t8, e, o) { +var iv = Kp(Nz()); +var Dz = Kp(_z()); +var uv = Kp(Ez()); +var $z = iv.default || iv; +var yie = uv.default || uv; +var gm = class extends mo { + constructor(e) { + super(), this.wasm = e, this.dataIdNextNumber = 1, this.wasm.tfjs.initWithThreadsCount(Fz), av = this.wasm.tfjs.getThreadsCount(), this.dataIdMap = new mn(this, cr()); + } + write(e, t10, o) { let n = { id: this.dataIdNextNumber++ }; - return this.move(n, t8, e, o, 1), n; + return this.move(n, e, t10, o, 1), n; } numDataIds() { return this.dataIdMap.numDataIds(); } - async time(t8) { - let e = y.now(); - return t8(), { kernelMs: y.now() - e }; + async time(e) { + let t10 = y.now(); + return e(), { kernelMs: y.now() - t10 }; } - move(t8, e, o, n, s) { + move(e, t10, o, n, s) { let a = this.dataIdNextNumber++; if (n === "string") { - let c = e; - this.dataIdMap.set(t8, { id: a, stringBytes: c, shape: o, dtype: n, memoryOffset: null, refCount: s }); + let l = t10; + this.dataIdMap.set(e, { id: a, stringBytes: l, shape: o, dtype: n, memoryOffset: null, refCount: s }); return; } let i = y.sizeFromShape(o), p = i * y.bytesPerElement(n), u = this.wasm._malloc(p) >>> 0; - this.dataIdMap.set(t8, { id: a, memoryOffset: u, shape: o, dtype: n, refCount: s }), this.wasm.tfjs.registerTensor(a, i, u), e != null && this.wasm.HEAPU8.set(new Uint8Array(e.buffer, e.byteOffset, p), u); + this.dataIdMap.set(e, { id: a, memoryOffset: u, shape: o, dtype: n, refCount: s }), this.wasm.tfjs.registerTensor(a, i, u), t10 != null && this.wasm.HEAPU8.set(new Uint8Array(t10.buffer, t10.byteOffset, p), u); } - async read(t8) { - return this.readSync(t8); + async read(e) { + return this.readSync(e); } - readSync(t8, e, o) { - let { memoryOffset: n, dtype: s, shape: a, stringBytes: i } = this.dataIdMap.get(t8); + readSync(e, t10, o) { + let { memoryOffset: n, dtype: s, shape: a, stringBytes: i } = this.dataIdMap.get(e); if (s === "string") - return (e == null || e === 0) && (o == null || o >= i.length) ? i : i.slice(e, o); - e = e || 0, o = o || y.sizeFromShape(a); - let p = y.bytesPerElement(s), u = this.wasm.HEAPU8.slice(n + e * p, n + o * p); - return qse(u.buffer, s); - } - disposeData(t8, e = false) { - if (this.dataIdMap.has(t8)) { - let o = this.dataIdMap.get(t8); - if (o.refCount--, !e && o.refCount > 0) + return (t10 == null || t10 === 0) && (o == null || o >= i.length) ? i : i.slice(t10, o); + t10 = t10 || 0, o = o || y.sizeFromShape(a); + let p = y.bytesPerElement(s), u = this.wasm.HEAPU8.slice(n + t10 * p, n + o * p); + return Cie(u.buffer, s); + } + disposeData(e, t10 = false) { + if (this.dataIdMap.has(e)) { + let o = this.dataIdMap.get(e); + if (o.refCount--, !t10 && o.refCount > 0) return false; - this.wasm._free(o.memoryOffset), this.wasm.tfjs.disposeData(o.id), this.dataIdMap.delete(t8); + this.wasm._free(o.memoryOffset), this.wasm.tfjs.disposeData(o.id), this.dataIdMap.delete(e); } return true; } - refCount(t8) { - return this.dataIdMap.has(t8) ? this.dataIdMap.get(t8).refCount : 0; + refCount(e) { + return this.dataIdMap.has(e) ? this.dataIdMap.get(e).refCount : 0; } - incRef(t8) { - let e = this.dataIdMap.get(t8); - e != null && e.refCount++; + incRef(e) { + let t10 = this.dataIdMap.get(e); + t10 != null && t10.refCount++; } floatPrecision() { return 32; } - getMemoryOffset(t8) { - return this.dataIdMap.get(t8).memoryOffset; + getMemoryOffset(e) { + return this.dataIdMap.get(e).memoryOffset; } dispose() { this.wasm.tfjs.dispose(), "PThread" in this.wasm && this.wasm.PThread.terminateAllThreads(), this.wasm = null; @@ -26452,21 +26548,21 @@ var im = class extends so { memory() { return { unreliable: false }; } - makeOutput(t8, e, o, n) { + makeOutput(e, t10, o, n) { let s; if (o == null) - s = this.write(n != null ? n : null, t8, e); + s = this.write(n != null ? n : null, e, t10); else { let a = this.dataIdNextNumber++; - s = { id: a }, this.dataIdMap.set(s, { id: a, memoryOffset: o, shape: t8, dtype: e, refCount: 1 }); - let i = y.sizeFromShape(t8); + s = { id: a }, this.dataIdMap.set(s, { id: a, memoryOffset: o, shape: e, dtype: t10, refCount: 1 }); + let i = y.sizeFromShape(e); this.wasm.tfjs.registerTensor(a, i, o); } - return { dataId: s, shape: t8, dtype: e }; + return { dataId: s, shape: e, dtype: t10 }; } - typedArrayFromHeap({ shape: t8, dtype: e, dataId: o }) { - let n = this.wasm.HEAPU8.buffer, { memoryOffset: s } = this.dataIdMap.get(o), a = y.sizeFromShape(t8); - switch (e) { + typedArrayFromHeap({ shape: e, dtype: t10, dataId: o }) { + let n = this.wasm.HEAPU8.buffer, { memoryOffset: s } = this.dataIdMap.get(o), a = y.sizeFromShape(e); + switch (t10) { case "float32": return new Float32Array(n, s, a); case "int32": @@ -26474,119 +26570,119 @@ var im = class extends so { case "bool": return new Uint8Array(n, s, a); default: - throw new Error(`Unknown dtype ${e}`); + throw new Error(`Unknown dtype ${t10}`); } } }; -function Kse(r15) { - return (t8, e) => (y.fetch(r15, { credentials: "same-origin" }).then((o) => { - o.ok || t8.env.a(`failed to load wasm binary file at '${r15}'`), o.arrayBuffer().then((n) => { - WebAssembly.instantiate(n, t8).then((s) => { - e(s.instance, s.module); +function bie(r16) { + return (e, t10) => (y.fetch(r16, { credentials: "same-origin" }).then((o) => { + o.ok || e.env.a(`failed to load wasm binary file at '${r16}'`), o.arrayBuffer().then((n) => { + WebAssembly.instantiate(n, e).then((s) => { + t10(s.instance, s.module); }); }); }), {}); } -function zB(r15, t8, e) { - if (Ug != null) - return Ug; +function Rz(r16, e, t10) { + if (tx != null) + return tx; let o = "tfjs-backend-wasm.wasm"; - return r15 && t8 ? o = "tfjs-backend-wasm-threaded-simd.wasm" : r15 && (o = "tfjs-backend-wasm-simd.wasm"), sm != null && sm[o] != null ? sm[o] : e + o; + return r16 && e ? o = "tfjs-backend-wasm-threaded-simd.wasm" : r16 && (o = "tfjs-backend-wasm-simd.wasm"), fm != null && fm[o] != null ? fm[o] : t10 + o; } -async function WB() { - let [r15, t8] = await Promise.all([A().getAsync("WASM_HAS_SIMD_SUPPORT"), A().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]); - return new Promise((e, o) => { +async function Az() { + let [r16, e] = await Promise.all([A().getAsync("WASM_HAS_SIMD_SUPPORT"), A().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]); + return new Promise((t10, o) => { let n = {}; n.locateFile = (i, p) => { if (i.endsWith(".worker.js")) { - let u = VB.wasmWorkerContents.replace(/\n/g, "\\n"), c = new Blob([u], { type: "application/javascript" }); - return URL.createObjectURL(c); + let u = Dz.wasmWorkerContents.replace(/\n/g, "\\n"), l = new Blob([u], { type: "application/javascript" }); + return URL.createObjectURL(l); } - return i.endsWith(".wasm") ? zB(r15, t8, nm != null ? nm : p) : p + i; - }, Xv && (n.instantiateWasm = Kse(zB(r15, t8, nm != null ? nm : ""))); + return i.endsWith(".wasm") ? Rz(r16, e, dm != null ? dm : p) : p + i; + }, pv && (n.instantiateWasm = bie(Rz(r16, e, dm != null ? dm : ""))); let s = false; n.onAbort = () => { - if (s || am) + if (s || hm) return; - am = true, o({ 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" }); + hm = true, o({ 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 a; - t8 && r15 && Ug == null ? (n.mainScriptUrlOrBlob = new Blob(["var WasmBackendModuleThreadedSimd = " + BB.toString()], { type: "text/javascript" }), a = BB(n)) : a = Hse(n), a.then((i) => { - s = true, am = false; + e && r16 && tx == null ? (n.mainScriptUrlOrBlob = new Blob(["var WasmBackendModuleThreadedSimd = " + $z.toString()], { type: "text/javascript" }), a = $z(n)) : a = yie(n), a.then((i) => { + s = true, hm = false; let p = null; - i.tfjs = { init: i.cwrap("init", null, []), initWithThreadsCount: i.cwrap("init_with_threads_count", null, ["number"]), getThreadsCount: i.cwrap("get_threads_count", "number", []), registerTensor: i.cwrap("register_tensor", null, ["number", "number", "number"]), disposeData: i.cwrap("dispose_data", p, ["number"]), dispose: i.cwrap("dispose", p, []) }, e({ wasm: i }); + i.tfjs = { init: i.cwrap("init", null, []), initWithThreadsCount: i.cwrap("init_with_threads_count", null, ["number"]), getThreadsCount: i.cwrap("get_threads_count", "number", []), registerTensor: i.cwrap("register_tensor", null, ["number", "number", "number"]), disposeData: i.cwrap("dispose_data", p, ["number"]), dispose: i.cwrap("dispose", p, []) }, t10({ wasm: i }); }).catch(o); }); } -function qse(r15, t8) { - switch (t8) { +function Cie(r16, e) { + switch (e) { case "float32": - return new Float32Array(r15); + return new Float32Array(r16); case "int32": - return new Int32Array(r15); + return new Int32Array(r16); case "bool": - return new Uint8Array(r15); + return new Uint8Array(r16); default: - throw new Error(`Unknown dtype ${t8}`); + throw new Error(`Unknown dtype ${e}`); } } -var jse = ["tfjs-backend-wasm.wasm", "tfjs-backend-wasm-simd.wasm", "tfjs-backend-wasm-threaded-simd.wasm"]; -var Ug = null; -var nm = null; -var sm = {}; -var am = false; -var Xv = false; -function Xse(r15, t8 = false) { - if (Pw("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."), am) +var wie = ["tfjs-backend-wasm.wasm", "tfjs-backend-wasm-simd.wasm", "tfjs-backend-wasm-threaded-simd.wasm"]; +var tx = null; +var dm = null; +var fm = {}; +var hm = false; +var pv = false; +function Sie(r16, e = false) { + if (zw("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."), hm) throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`"); - Ug = r15, Xv = t8; + tx = r16, pv = e; } -function Yse(r15, t8 = false) { - if (am) +function Iie(r16, e = false) { + if (hm) throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`"); - if (typeof r15 == "string") - nm = r15; + if (typeof r16 == "string") + dm = r16; else { - sm = r15; - let e = jse.filter((o) => sm[o] == null); - if (e.length > 0) - throw new Error(`There were no entries found for the following binaries: ${e.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.`); + fm = r16; + let t10 = wie.filter((o) => fm[o] == null); + if (t10.length > 0) + throw new Error(`There were no entries found for the following binaries: ${t10.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.`); } - Xv = t8; + pv = e; } -var UB = -1; -var Kv = -1; -function Qse(r15) { - UB = r15; +var Fz = -1; +var av = -1; +function vie(r16) { + Fz = r16; } -function Zse() { - if (Kv === -1) +function kie() { + if (av === -1) throw new Error("WASM backend not initialized."); - return Kv; -} -var Jse = "4.14.0"; -var eae = 2; -tu("wasm", async () => { - let { wasm: r15 } = await WB(); - return new im(r15); -}, eae); -var go = A(); -go.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE", () => 15); -go.registerFlag("WEBGPU_CPU_FORWARD", () => true); -go.registerFlag("WEBGPU_MATMUL_PROGRAM_TYPE", () => -1); -go.registerFlag("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE", () => true); -go.registerFlag("WEBGPU_USE_LOW_POWER_GPU", () => false); -go.registerFlag("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD", () => 1e3); -go.registerFlag("WEBGPU_USE_PROFILE_TOOL", () => false); -go.registerFlag("WEBGPU_IMPORT_EXTERNAL_TEXTURE", () => true); -go.registerFlag("WEBGPU_USE_NAIVE_CONV2D_DEBUG", () => false); -go.registerFlag("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL", () => -1); -go.registerFlag("WEBGPU_CONV_SEPARATE_IM2COL_SHADER", () => false); -go.registerFlag("WEBGPU_PRINT_SHADER", () => ""); -go.registerFlag("WEBGPU_ENGINE_COMPILE_ONLY", () => false); -var Gg = class { - constructor(t8) { - t8 && (this.vendor = t8.vendor, this.architecture = t8.architecture, this.intelGPUGeneration = this.getIntelGPUGeneration()); + return av; +} +var Nie = "4.17.0"; +var Tie = 2; +pu("wasm", async () => { + let { wasm: r16 } = await Az(); + return new gm(r16); +}, Tie); +var Wo = A(); +Wo.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE", () => 15); +Wo.registerFlag("WEBGPU_CPU_FORWARD", () => true); +Wo.registerFlag("WEBGPU_MATMUL_PROGRAM_TYPE", () => -1); +Wo.registerFlag("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE", () => true); +Wo.registerFlag("WEBGPU_USE_LOW_POWER_GPU", () => false); +Wo.registerFlag("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD", () => 1e3); +Wo.registerFlag("WEBGPU_USE_PROFILE_TOOL", () => false); +Wo.registerFlag("WEBGPU_IMPORT_EXTERNAL_TEXTURE", () => true); +Wo.registerFlag("WEBGPU_USE_NAIVE_CONV2D_DEBUG", () => false); +Wo.registerFlag("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL", () => -1); +Wo.registerFlag("WEBGPU_CONV_SEPARATE_IM2COL_SHADER", () => false); +Wo.registerFlag("WEBGPU_PRINT_SHADER", () => ""); +Wo.registerFlag("WEBGPU_ENGINE_COMPILE_ONLY", () => false); +var rx = class { + constructor(e) { + e && (this.vendor = e.vendor, this.architecture = e.architecture, this.intelGPUGeneration = this.getIntelGPUGeneration()); } getIntelGPUGeneration() { if (this.isIntel()) { @@ -26601,21 +26697,21 @@ var Gg = class { return this.vendor === "intel"; } }; -var Hg = class { - constructor(t8) { - this.device = t8, this.numUsedBuffers = 0, this.numFreeBuffers = 0, this.freeBuffers = /* @__PURE__ */ new Map(), this.usedBuffers = /* @__PURE__ */ new Map(), this.numBytesUsed = 0, this.numBytesAllocated = 0; +var ox = class { + constructor(e) { + this.device = e, this.numUsedBuffers = 0, this.numFreeBuffers = 0, this.freeBuffers = /* @__PURE__ */ new Map(), this.usedBuffers = /* @__PURE__ */ new Map(), this.numBytesUsed = 0, this.numBytesAllocated = 0; } - acquireBuffer(t8, e, o = false, n = true) { - let s, a = GB(t8, e); - return n ? (this.freeBuffers.has(a) || this.freeBuffers.set(a, []), this.freeBuffers.get(a).length > 0 ? (s = this.freeBuffers.get(a).pop(), this.numFreeBuffers--) : (s = this.device.createBuffer({ size: t8, usage: e, mappedAtCreation: o }), this.numBytesAllocated += t8)) : (s = this.device.createBuffer({ size: t8, usage: e, mappedAtCreation: o }), this.numBytesAllocated += t8), this.usedBuffers.has(a) || this.usedBuffers.set(a, []), this.usedBuffers.get(a).push(s), this.numUsedBuffers++, this.numBytesUsed += t8, s; + acquireBuffer(e, t10, o = false, n = true) { + let s, a = Pz(e, t10); + return n ? (this.freeBuffers.has(a) || this.freeBuffers.set(a, []), this.freeBuffers.get(a).length > 0 ? (s = this.freeBuffers.get(a).pop(), this.numFreeBuffers--) : (s = this.device.createBuffer({ size: e, usage: t10, mappedAtCreation: o }), this.numBytesAllocated += e)) : (s = this.device.createBuffer({ size: e, usage: t10, mappedAtCreation: o }), this.numBytesAllocated += e), this.usedBuffers.has(a) || this.usedBuffers.set(a, []), this.usedBuffers.get(a).push(s), this.numUsedBuffers++, this.numBytesUsed += e, s; } - releaseBuffer(t8, e = true) { + releaseBuffer(e, t10 = true) { if (this.freeBuffers.size === 0) return; - let o = t8.size, n = t8.usage, s = GB(o, n), a = this.usedBuffers.get(s), i = a.indexOf(t8); + let o = e.size, n = e.usage, s = Pz(o, n), a = this.usedBuffers.get(s), i = a.indexOf(e); if (i < 0) throw new Error("Cannot find the buffer in buffer manager"); - a[i] = a[a.length - 1], a.pop(), this.numUsedBuffers--, this.numBytesUsed -= o, e ? (this.freeBuffers.get(s).push(t8), this.numFreeBuffers++) : (t8.destroy(), this.numBytesAllocated -= o); + a[i] = a[a.length - 1], a.pop(), this.numUsedBuffers--, this.numBytesUsed -= o, t10 ? (this.freeBuffers.get(s).push(e), this.numFreeBuffers++) : (e.destroy(), this.numBytesAllocated -= o); } getNumUsedBuffers() { return this.numUsedBuffers; @@ -26624,46 +26720,46 @@ var Hg = class { return this.numFreeBuffers; } dispose() { - this.freeBuffers.forEach((t8, e) => { - t8.forEach((o) => { + this.freeBuffers.forEach((e, t10) => { + e.forEach((o) => { o.destroy(); }); - }), this.usedBuffers.forEach((t8, e) => { - t8.forEach((o) => { + }), this.usedBuffers.forEach((e, t10) => { + e.forEach((o) => { o.destroy(); }); }), this.freeBuffers = /* @__PURE__ */ new Map(), this.usedBuffers = /* @__PURE__ */ new Map(), this.numUsedBuffers = 0, this.numFreeBuffers = 0, this.numBytesUsed = 0, this.numBytesAllocated = 0; } }; -function GB(r15, t8) { - return `${r15}_${t8}`; +function Pz(r16, e) { + return `${r16}_${e}`; } -var Kg = class { - constructor(t8) { - this.device = t8, this.numUsedTextures = 0, this.numFreeTextures = 0, this.freeTextures = /* @__PURE__ */ new Map(), this.usedTextures = /* @__PURE__ */ new Map(), this.numBytesUsed = 0, this.numBytesAllocated = 0; +var nx = class { + constructor(e) { + this.device = e, this.numUsedTextures = 0, this.numFreeTextures = 0, this.freeTextures = /* @__PURE__ */ new Map(), this.usedTextures = /* @__PURE__ */ new Map(), this.numBytesUsed = 0, this.numBytesAllocated = 0; } - acquireTexture(t8, e, o, n) { - let s = KB(o), a = t8 * e * s, i = HB(t8, e, o, n); + acquireTexture(e, t10, o, n) { + let s = Mz(o), a = e * t10 * s, i = Oz(e, t10, o, n); if (this.freeTextures.has(i) || this.freeTextures.set(i, []), this.usedTextures.has(i) || this.usedTextures.set(i, []), this.numBytesUsed += a, this.numUsedTextures++, this.freeTextures.get(i).length > 0) { this.numFreeTextures--; let u = this.freeTextures.get(i).shift(); return this.usedTextures.get(i).push(u), u; } this.numBytesAllocated += a; - let p = this.device.createTexture({ size: [t8, e], format: o, usage: n }); + let p = this.device.createTexture({ size: [e, t10], format: o, usage: n }); return this.usedTextures.get(i).push(p), p; } - releaseTexture(t8) { + releaseTexture(e) { if (this.freeTextures.size === 0) return; - let e = t8.width, o = t8.height, n = t8.format, s = t8.usage, a = HB(e, o, n, s); - this.freeTextures.has(a) || this.freeTextures.set(a, []), this.freeTextures.get(a).push(t8), this.numFreeTextures++, this.numUsedTextures--; - let i = this.usedTextures.get(a), p = i.indexOf(t8); + let t10 = e.width, o = e.height, n = e.format, s = e.usage, a = Oz(t10, o, n, s); + this.freeTextures.has(a) || this.freeTextures.set(a, []), this.freeTextures.get(a).push(e), this.numFreeTextures++, this.numUsedTextures--; + let i = this.usedTextures.get(a), p = i.indexOf(e); if (p < 0) throw new Error("Cannot release a texture that was never provided by this texture manager"); i.splice(p, 1); - let u = KB(n), c = e * o * u; - this.numBytesUsed -= c; + let u = Mz(n), l = t10 * o * u; + this.numBytesUsed -= l; } getNumUsedTextures() { return this.numUsedTextures; @@ -26672,126 +26768,126 @@ var Kg = class { return this.numFreeTextures; } dispose() { - this.freeTextures.forEach((t8, e) => { - t8.forEach((o) => { + this.freeTextures.forEach((e, t10) => { + e.forEach((o) => { o.destroy(); }); - }), this.usedTextures.forEach((t8, e) => { - t8.forEach((o) => { + }), this.usedTextures.forEach((e, t10) => { + e.forEach((o) => { o.destroy(); }); }), this.freeTextures = /* @__PURE__ */ new Map(), this.usedTextures = /* @__PURE__ */ new Map(), this.numUsedTextures = 0, this.numFreeTextures = 0, this.numBytesUsed = 0, this.numBytesAllocated = 0; } }; -function HB(r15, t8, e, o) { - return `${r15}_${t8}_${e}_${o}`; +function Oz(r16, e, t10, o) { + return `${r16}_${e}_${t10}_${o}`; } -function KB(r15) { - if (r15 === "rgba8unorm") +function Mz(r16) { + if (r16 === "rgba8unorm") return 16; - throw new Error(`${r15} is not supported!`); + throw new Error(`${r16} is not supported!`); } -function qB(r15, t8) { - if (Math.max(...r15) > 5) +function Lz(r16, e) { + if (Math.max(...r16) > 5) throw new Error("Cannot symbolically compute strides for rank > 6 tensor."); - let e = r15.length, o = "xyzwuv", n = r15.map((a) => `${t8}.${o[a]}`), s = new Array(e - 1); - s[e - 2] = n[e - 1]; - for (let a = e - 3; a >= 0; --a) + let t10 = r16.length, o = "xyzwuv", n = r16.map((a) => `${e}.${o[a]}`), s = new Array(t10 - 1); + s[t10 - 2] = n[t10 - 1]; + for (let a = t10 - 3; a >= 0; --a) s[a] = `(${s[a + 1]} * ${n[a + 1]})`; return s; } -var Yr = (r15, t8, e) => e === "int32" ? `atomicAdd(${r15}, bitcast(${t8}));` : ` +var oo = (r16, e, t10) => t10 === "int32" ? `atomicAdd(${r16}, bitcast(${e}));` : ` { var oldValue = 0; loop { - let newValueF32 = bitcast(oldValue) + (${t8}); + let newValueF32 = bitcast(oldValue) + (${e}); let newValue = bitcast(newValueF32); - let res = atomicCompareExchangeWeak(${r15}, oldValue, newValue); + let res = atomicCompareExchangeWeak(${r16}, oldValue, newValue); if res.exchanged { break; } oldValue = res.old_value; } }`; -var Ci; -(function(r15) { - r15[r15.FROM_PIXELS = 0] = "FROM_PIXELS", r15[r15.DRAW = 1] = "DRAW"; -})(Ci || (Ci = {})); -var QB = (r15, t8, e, o, n) => { - let s = { dtype: o.dtype, shape: o.shape }, a = rae(e, s, t8), i = r15.createShaderModule({ code: a, label: t8.constructor.name }), p = A().get("WEBGPU_PRINT_SHADER"); +var $i; +(function(r16) { + r16[r16.FROM_PIXELS = 0] = "FROM_PIXELS", r16[r16.DRAW = 1] = "DRAW"; +})($i || ($i = {})); +var Wz = (r16, e, t10, o, n) => { + let s = { dtype: o.dtype, shape: o.shape }, a = Eie(t10, s, e), i = r16.createShaderModule({ code: a, label: e.constructor.name }), p = A().get("WEBGPU_PRINT_SHADER"); if (p !== "") { p = p.toLowerCase(); let u = p.split(","); - (p === "all" || u.some((c) => t8.shaderKey.toLowerCase().includes(c))) && (console.group(t8.shaderKey), console.debug(a), console.groupEnd()); + (p === "all" || u.some((l) => e.shaderKey.toLowerCase().includes(l))) && (console.group(e.shaderKey), console.debug(a), console.groupEnd()); } - return n ? r15.createComputePipelineAsync({ compute: { module: i, entryPoint: "_start" }, label: t8.constructor.name, layout: "auto" }) : r15.createComputePipeline({ compute: { module: i, entryPoint: "_start" }, label: t8.constructor.name, layout: "auto" }); + return n ? r16.createComputePipelineAsync({ compute: { module: i, entryPoint: "_start" }, label: e.constructor.name, layout: "auto" }) : r16.createComputePipeline({ compute: { module: i, entryPoint: "_start" }, label: e.constructor.name, layout: "auto" }); }; -var Ae = (r15, t8 = "f32") => { - switch (r15) { +var Ae = (r16, e = "f32") => { + switch (r16) { case 1: - return `${t8}`; + return `${e}`; case 2: - return `vec2<${t8}>`; + return `vec2<${e}>`; case 3: - return `vec3<${t8}>`; + return `vec3<${e}>`; case 4: - return `vec4<${t8}>`; + return `vec4<${e}>`; default: - throw new Error(`${r15}-component ${t8} is not supported.`); + throw new Error(`${r16}-component ${e} is not supported.`); } }; -function ft(r15) { - if (r15 <= 1) +function ft(r16) { + if (r16 <= 1) return "i32"; - if (r15 === 2) + if (r16 === 2) return "vec2"; - if (r15 === 3) + if (r16 === 3) return "vec3"; - if (r15 === 4) + if (r16 === 4) return "vec4"; - if (r15 === 5) + if (r16 === 5) return "vec5"; - if (r15 === 6) + if (r16 === 6) return "vec6"; - throw Error(`GPU for rank ${r15} is not yet supported`); + throw Error(`GPU for rank ${r16} is not yet supported`); } -function Oo(r15) { - if (r15 === 0) +function un(r16) { + if (r16 === 0) return "x"; - if (r15 === 1) + if (r16 === 1) return "y"; - if (r15 === 2) + if (r16 === 2) return "z"; - if (r15 === 3) + if (r16 === 3) return "w"; - if (r15 === 4) + if (r16 === 4) return "u"; - if (r15 === 5) + if (r16 === 5) return "v"; - throw Error(`Index ${r15} is not yet supported`); + throw Error(`Index ${r16} is not yet supported`); } -function G(...r15) { - let t8; - switch (r15.length) { +function G(...r16) { + let e; + switch (r16.length) { case 0: - t8 = ` + e = ` fn main() `; break; case 1: - t8 = ` - fn main(${r15[0]} : i32) + e = ` + fn main(${r16[0]} : i32) `; break; default: throw Error("Unreachable"); } - return t8; + return e; } -function jB(r15, t8) { - let e; - return e = ` - ${tae(t8)} +function Bz(r16, e) { + let t10; + return t10 = ` + ${_ie(e)} fn _start(@builtin(local_invocation_id) LocalId : vec3, @builtin(global_invocation_id) GlobalId : vec3, @builtin(local_invocation_index) LocalIndex: u32, @@ -26802,18 +26898,18 @@ function jB(r15, t8) { globalId = GlobalId; numWorkgroups = NumWorkgroups; workgroupId = WorkgroupId; - ${r15 ? "main(getGlobalIndex());" : "main();"}; + ${r16 ? "main(getGlobalIndex());" : "main();"}; } - `, e; + `, t10; } -function tae(r15) { +function _ie(r16) { return ` - @compute @workgroup_size(${r15.workgroupSize[0]}, ${r15.workgroupSize[1]}, ${r15.workgroupSize[2]}) + @compute @workgroup_size(${r16.workgroupSize[0]}, ${r16.workgroupSize[1]}, ${r16.workgroupSize[2]}) `; } -function rae(r15, t8, e) { - let o = [], n = e.workgroupSize[0] * e.workgroupSize[1] * e.workgroupSize[2]; - if (e.outputComponent = e.outputComponent ? e.outputComponent : 1, o.push(` +function Eie(r16, e, t10) { + let o = [], n = t10.workgroupSize[0] * t10.workgroupSize[1] * t10.workgroupSize[2]; + if (t10.outputComponent = t10.outputComponent ? t10.outputComponent : 1, o.push(` var localId: vec3; var localIndex: u32; @@ -26823,13 +26919,13 @@ function rae(r15, t8, e) { // Only used when the y/z dimension of workgroup size is 1. fn getGlobalIndex() -> i32 { - ${JB(e) ? " return i32(globalId.x);" : ` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y + + ${Gz(t10) ? " return i32(globalId.x);" : ` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y + workgroupId.y * numWorkgroups.x + workgroupId.x) * ${n}u + localIndex); `} } - `), e.pixelsOpType != null) { - let f = e.pixelsOpType === Ci.FROM_PIXELS ? `@group(0) @binding(0) var result: array<${Cu(t8.dtype, e.outputComponent)}>;` : `@group(0) @binding(1) var inBuf : array<${Cu(r15[0].dtype, e.outputComponent)}>;`, h = t8.shape.length === 3 ? "vec2" : "i32"; + `), t10.pixelsOpType != null) { + let f = t10.pixelsOpType === $i.FROM_PIXELS ? `@group(0) @binding(0) var result: array<${Eu(e.dtype, t10.outputComponent)}>;` : `@group(0) @binding(1) var inBuf : array<${Eu(r16[0].dtype, t10.outputComponent)}>;`, h = e.shape.length === 3 ? "vec2" : "i32"; o.push(` struct Uniform { outShapeStrides : ${h}, @@ -26841,53 +26937,53 @@ function rae(r15, t8, e) { ${f} @group(0) @binding(2) var uniforms: Uniform; `); - let g = YB(e); - return [XB, o.join(` -`), um(t8.shape), e.getUserCode(), jB(g, e)].join(` + let g = Vz(t10); + return [zz, o.join(` +`), xm(e.shape), t10.getUserCode(), Bz(g, t10)].join(` `); } let s, a, i = "struct Uniforms { NAN : f32, INFINITY : f32, "; - e.variableNames.forEach((f, h) => { - let g = ft(r15[h].shape.length); - i += `${f.charAt(0).toLowerCase() + f.slice(1)}Shape : ${g}, `, s = r15[h].shape.length - 1, a = ft(s), i += `${f.charAt(0).toLowerCase() + f.slice(1)}ShapeStrides: ${a}, `; + t10.variableNames.forEach((f, h) => { + let g = ft(r16[h].shape.length); + i += `${f.charAt(0).toLowerCase() + f.slice(1)}Shape : ${g}, `, s = r16[h].shape.length - 1, a = ft(s), i += `${f.charAt(0).toLowerCase() + f.slice(1)}ShapeStrides: ${a}, `; }); - let p = ft(t8.shape.length); - i += `outShape : ${p}, `, s = t8.shape.length - 1, a = ft(s), i += ` - outShapeStrides: ${a}, `, e.size && (i += "size : i32, "), e.uniforms && (i += e.uniforms), i += "};", i = cae(i), o.push(i), e.atomic ? o.push(` + let p = ft(e.shape.length); + i += `outShape : ${p}, `, s = e.shape.length - 1, a = ft(s), i += ` + outShapeStrides: ${a}, `, t10.size && (i += "size : i32, "), t10.uniforms && (i += t10.uniforms), i += "};", i = Mie(i), o.push(i), t10.atomic ? o.push(` @group(0) @binding(0) var result: array>; `) : o.push(` - @group(0) @binding(0) var result: array<${Cu(t8.dtype, e.outputComponent)}>; - `), e.variableNames.forEach((f, h) => { + @group(0) @binding(0) var result: array<${Eu(e.dtype, t10.outputComponent)}>; + `), t10.variableNames.forEach((f, h) => { o.push(` - @group(0) @binding(${1 + h}) var ${f}: array<${e.variableComponents ? Cu(r15[h].dtype, e.variableComponents[h]) : Cu(r15[h].dtype, e.outputComponent)}>; + @group(0) @binding(${1 + h}) var ${f}: array<${t10.variableComponents ? Eu(r16[h].dtype, t10.variableComponents[h]) : Eu(r16[h].dtype, t10.outputComponent)}>; `); }), i !== "" && o.push(` - @group(0) @binding(${1 + e.variableNames.length}) var uniforms: Uniforms; + @group(0) @binding(${1 + t10.variableNames.length}) var uniforms: Uniforms; `); - let u = iae(t8.shape, e.dispatchLayout), c = [XB, o.join(` -`) + oae, um(t8.shape), u, uae(t8.shape.length)]; - e.atomic || c.push(pae(t8.shape, t8.dtype, e.outputComponent)), e.variableNames.forEach((f, h) => { - c.push(`${um(r15[h].shape, f)}`); + let u = Fie(e.shape, t10.dispatchLayout), l = [zz, o.join(` +`) + $ie, xm(e.shape), u, Pie(e.shape.length)]; + t10.atomic || l.push(Oie(e.shape, e.dtype, t10.outputComponent)), t10.variableNames.forEach((f, h) => { + l.push(`${xm(r16[h].shape, f)}`); }); - let l = r15.map((f, h) => aae(f, t8.shape, e.variableComponents ? e.variableComponents[h] : e.outputComponent, e.dispatchLayout.x.length === t8.shape.length)).join(` + let c = r16.map((f, h) => Aie(f, e.shape, t10.variableComponents ? t10.variableComponents[h] : t10.outputComponent, t10.dispatchLayout.x.length === e.shape.length)).join(` `); - c.push(l), c.push(e.getUserCode()); - let m = YB(e); - return c.push(jB(m, e)), c.join(` + l.push(c), l.push(t10.getUserCode()); + let m = Vz(t10); + return l.push(Bz(m, t10)), l.join(` `); } -function ZB(r15, t8, e) { - let o = r15.shaderKey; - if (r15.pixelsOpType != null) +function Uz(r16, e, t10) { + let o = r16.shaderKey; + if (r16.pixelsOpType != null) return o; let n = [], s = []; - t8.forEach((c) => { - n.push(c.shape), s.push(c.dtype); - }), n.push(e.shape), s.push(e.dtype); - let a = t8.map((c) => w.getBroadcastDims(c.shape, e.shape)), i = t8.map((c) => y.arraysEqual(c.shape, e.shape)).join("_"), p = a.map((c) => c.join("_")).join(";"), u = JB(r15) ? "flatDispatch" : ""; - return o += "_" + (r15.workgroupSize ? r15.workgroupSize.join(",") : "") + n.map((c) => c.length).join(",") + s.join(",") + r15.variableNames.join(",") + p + i + u, o; + e.forEach((l) => { + n.push(l.shape), s.push(l.dtype); + }), n.push(t10.shape), s.push(t10.dtype); + let a = e.map((l) => C.getBroadcastDims(l.shape, t10.shape)), i = e.map((l) => y.arraysEqual(l.shape, t10.shape)).join("_"), p = a.map((l) => l.join("_")).join(";"), u = Gz(r16) ? "flatDispatch" : ""; + return o += "_" + (r16.workgroupSize ? r16.workgroupSize.join(",") : "") + n.map((l) => l.length).join(",") + s.join(",") + r16.variableNames.join(",") + p + i + u, o; } -var XB = ` +var zz = ` struct vec5 {x: i32, y: i32, z: i32, w: i32, u: i32}; struct vec6 {x: i32, y: i32, z: i32, w: i32, u: i32, v: i32}; @@ -26938,17 +27034,17 @@ var XB = ` return (floatToUint & vec4(0x7fffffffu)) > vec4(0x7f800000u); } `; -var oae = ` +var $ie = ` fn isinf(val: f32) -> bool { return abs(val) == uniforms.INFINITY; } `; -function um(r15, t8 = "") { - let e = r15.length, o = t8 !== "" ? `get${t8.charAt(0).toUpperCase() + t8.slice(1)}CoordsFromIndex` : "getCoordsFromIndex", n = t8 !== "" ? `${t8.charAt(0).toLowerCase() + t8.slice(1)}ShapeStrides` : "outShapeStrides"; - if (e <= 1) +function xm(r16, e = "") { + let t10 = r16.length, o = e !== "" ? `get${e.charAt(0).toUpperCase() + e.slice(1)}CoordsFromIndex` : "getCoordsFromIndex", n = e !== "" ? `${e.charAt(0).toLowerCase() + e.slice(1)}ShapeStrides` : "outShapeStrides"; + if (t10 <= 1) return `fn ${o}(index : i32) -> i32 { return index; }`; - let s = y.computeStrides(r15), a = ft(e), i = []; - for (let u = 0; u < e; u++) + let s = y.computeStrides(r16), a = ft(t10), i = []; + for (let u = 0; u < t10; u++) i.push(`d${u}`); if (s.length === 1) return ` fn ${o}(index : i32) -> vec2 { @@ -26956,9 +27052,9 @@ function um(r15, t8 = "") { return vec2(d0, d1); }`; let p; - return p = "var index2 = index;" + s.map((u, c) => { - let l = `let ${i[c]} = index2 / uniforms.${n}.${Oo(c)}`, m = c === s.length - 1 ? `let ${i[c + 1]} = index2 - ${i[c]} * uniforms.${n}.${Oo(c)}` : `index2 = index2 - ${i[c]} * uniforms.${n}.${Oo(c)}`; - return `${l}; ${m};`; + return p = "var index2 = index;" + s.map((u, l) => { + let c = `let ${i[l]} = index2 / uniforms.${n}.${un(l)}`, m = l === s.length - 1 ? `let ${i[l + 1]} = index2 - ${i[l]} * uniforms.${n}.${un(l)}` : `index2 = index2 - ${i[l]} * uniforms.${n}.${un(l)}`; + return `${c}; ${m};`; }).join(""), ` fn ${o}(index : i32) -> ${a} { ${p} @@ -26966,92 +27062,92 @@ function um(r15, t8 = "") { } `; } -function nae(r15, t8) { - let e = r15.name, o = r15.shape.length, n = ft(o), s = "get" + e.charAt(0).toUpperCase() + e.slice(1), a = ["d0", "d1", "d2", "d3", "d4", "d5"].slice(0, o), i = a.map((c) => `${c} : i32`).join(", "); +function Rie(r16, e) { + let t10 = r16.name, o = r16.shape.length, n = ft(o), s = "get" + t10.charAt(0).toUpperCase() + t10.slice(1), a = ["d0", "d1", "d2", "d3", "d4", "d5"].slice(0, o), i = a.map((l) => `${l} : i32`).join(", "); if (o < 1) return ` - fn ${s}() -> ${Ae(t8)} { - return ${Ae(t8)}(${e}[0]); + fn ${s}() -> ${Ae(e)} { + return ${Ae(e)}(${t10}[0]); } `; - let p = `uniforms.${e.charAt(0).toLowerCase() + e.slice(1)}Shape`, u = `${o}D`; + let p = `uniforms.${t10.charAt(0).toLowerCase() + t10.slice(1)}Shape`, u = `${o}D`; return o === 0 && (u = "1D"), ` - fn ${s}(${i}) -> ${Ae(t8)} { - return ${Ae(t8)}(${e}[getIndexFromCoords${u}(${n}(${a.join(",")}), - ${p})${t8 === 1 ? "" : ` / ${t8}`}]); + fn ${s}(${i}) -> ${Ae(e)} { + return ${Ae(e)}(${t10}[getIndexFromCoords${u}(${n}(${a.join(",")}), + ${p})${e === 1 ? "" : ` / ${e}`}]); } `; } -function sae(r15, t8, e, o) { - let n = r15.name, s = n.charAt(0).toUpperCase() + n.slice(1), a = "get" + s + "ByOutput", i = r15.shape.length, p = t8.length, u = ft(p); - if (y.arraysEqual(r15.shape, t8) && o) +function Die(r16, e, t10, o) { + let n = r16.name, s = n.charAt(0).toUpperCase() + n.slice(1), a = "get" + s + "ByOutput", i = r16.shape.length, p = e.length, u = ft(p); + if (y.arraysEqual(r16.shape, e) && o) return ` - fn ${a}Index(globalIndex : i32) -> ${Ae(e)} { - return ${Ae(e)}(${n}[globalIndex]); + fn ${a}Index(globalIndex : i32) -> ${Ae(t10)} { + return ${Ae(t10)}(${n}[globalIndex]); } - fn ${a}Coords(coords : ${u}) -> ${Ae(e)} { - return ${Ae(e)}(${n}[${p > 1 ? "getOutputIndexFromCoords(coords)" : "coords"}${e === 1 ? "" : ` / ${e}`}]); + fn ${a}Coords(coords : ${u}) -> ${Ae(t10)} { + return ${Ae(t10)}(${n}[${p > 1 ? "getOutputIndexFromCoords(coords)" : "coords"}${t10 === 1 ? "" : ` / ${t10}`}]); } `; - let c = w.getBroadcastDims(r15.shape, t8), l = p - i, m = ""; + let l = C.getBroadcastDims(r16.shape, e), c = p - i, m = ""; if (i === 0) return ` - fn ${a}Index(globalIndex : i32) -> ${Ae(e)}{ + fn ${a}Index(globalIndex : i32) -> ${Ae(t10)}{ return get${s}(); } - fn ${a}Coords(coords : ${u}) -> ${Ae(e)}{ + fn ${a}Coords(coords : ${u}) -> ${Ae(t10)}{ return get${s}(); } `; - p < 2 && c.length >= 1 ? m = "coords = 0;" : m = c.map((g) => `coords.${Oo(g + l)} = 0;`).join(` + p < 2 && l.length >= 1 ? m = "coords = 0;" : m = l.map((g) => `coords.${un(g + c)} = 0;`).join(` `); let d = ""; if (p < 2 && i > 0) d = "coords"; else if (p > 1) { - let g = ft(i), x = r15.shape.map((b, C) => `coords.${Oo(C + l)}`).join(", "); + let g = ft(i), x = r16.shape.map((b, w) => `coords.${un(w + c)}`).join(", "); d = `${g}(${x})`; } else d = "coords"; let f = `uniforms.${n.charAt(0).toLowerCase() + n.slice(1)}Shape`, h = `${i}D`; return ` - fn ${a}Index(globalIndex : i32) -> ${Ae(e)} { + fn ${a}Index(globalIndex : i32) -> ${Ae(t10)} { var coords = getCoordsFromIndex(globalIndex); ${m} - return ${Ae(e)}(${n}[getIndexFromCoords${h}(${d}, ${f})${e === 1 ? "" : ` / ${e}`}]); + return ${Ae(t10)}(${n}[getIndexFromCoords${h}(${d}, ${f})${t10 === 1 ? "" : ` / ${t10}`}]); } - fn ${a}Coords(coordsIn : ${u}) -> ${Ae(e)} { + fn ${a}Coords(coordsIn : ${u}) -> ${Ae(t10)} { var coords = coordsIn; ${m} - return ${Ae(e)}(${n}[getIndexFromCoords${h}(${d}, ${f})${e === 1 ? "" : ` / ${e}`}]); + return ${Ae(t10)}(${n}[getIndexFromCoords${h}(${d}, ${f})${t10 === 1 ? "" : ` / ${t10}`}]); } `; } -function aae(r15, t8, e, o) { - let n = nae(r15, e); - return r15.shape.length <= t8.length && (n += sae(r15, t8, e, o)), n; +function Aie(r16, e, t10, o) { + let n = Rie(r16, t10); + return r16.shape.length <= e.length && (n += Die(r16, e, t10, o)), n; } -function iae(r15, t8) { - let { x: e, y: o = [], z: n = [] } = t8, s = r15.length, a = e.length + o.length + n.length; +function Fie(r16, e) { + let { x: t10, y: o = [], z: n = [] } = e, s = r16.length, a = t10.length + o.length + n.length; if (a !== s) return ""; - if (e.length === s) + if (t10.length === s) return `fn getOutputCoords() -> ${ft(s)}{ let globalIndex = getGlobalIndex(); return getCoordsFromIndex(globalIndex); } `; - let i = "", p = [e, o, n]; + let i = "", p = [t10, o, n]; for (let m = 0; m < p.length; m++) { let d = p[m]; if (d.length !== 0) if (d.length === 1) i += `let d${d[0]} = i32(globalId[${m}]);`; else { - let f = qB(d, "uniforms.outShape"); + let f = Lz(d, "uniforms.outShape"); i += `var index${m} = i32(globalId[${m}]);`; for (let h = 0; h < f.length; h++) i += `let d${d[h]} = index${m} / ${f[h]};`, h === f.length - 1 ? i += `let d${d[h + 1]} = index${m} - d${d[h]} * ${f[h]};` : i += `index${m} = index${m} - d${d[h]} * ${f[h]};`; @@ -27060,38 +27156,38 @@ function iae(r15, t8) { let u = []; for (let m = 0; m < a; m++) u.push(`d${m}`); - let c = ft(a), l = `fn getOutputCoords() -> ${c} { + let l = ft(a), c = `fn getOutputCoords() -> ${l} { ${i} `; - return u.length === 0 ? l += `return ${c}(0); }` : l += `return ${c}(${u.join(",")}); }`, l; + return u.length === 0 ? c += `return ${l}(0); }` : c += `return ${l}(${u.join(",")}); }`, c; } -function uae(r15) { - let t8 = ""; - switch (r15) { +function Pie(r16) { + let e = ""; + switch (r16) { case 0: case 1: - t8 += ` + e += ` fn getOutputIndexFromCoords(coords : i32) -> i32 { return coords; } `; break; case 2: - t8 += ` + e += ` fn getOutputIndexFromCoords(coords : vec2) -> i32 { return dot(coords, vec2(uniforms.outShapeStrides, 1)); } `; break; case 3: - t8 += ` + e += ` fn getOutputIndexFromCoords(coords : vec3) -> i32 { return dot(coords, vec3(uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, 1)); } `; break; case 4: - t8 += ` + e += ` fn getOutputIndexFromCoords(coords : vec4) -> i32 { return dot(coords, vec4( uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, uniforms.outShapeStrides.z, 1)); @@ -27099,7 +27195,7 @@ function uae(r15) { `; break; case 5: - t8 += ` + e += ` fn getOutputIndexFromCoords(coords : vec5) -> i32 { return coords.x * uniforms.outShapeStrides.x + coords.y * uniforms.outShapeStrides.y + @@ -27110,7 +27206,7 @@ function uae(r15) { `; break; case 6: - t8 += ` + e += ` fn getOutputIndexFromCoords(coords : vec6) -> i32 { return coords.x * uniforms.outShapeStrides.x + coords.y * uniforms.outShapeStrides.y + @@ -27122,177 +27218,177 @@ function uae(r15) { `; break; default: - y.assert(false, () => `Unsupported ${r15}D shape`); + y.assert(false, () => `Unsupported ${r16}D shape`); break; } - return t8; + return e; } -function JB(r15) { - return r15.dispatch[1] === 1 && r15.dispatch[2] === 1; +function Gz(r16) { + return r16.dispatch[1] === 1 && r16.dispatch[2] === 1; } -function Cu(r15, t8 = 1) { - if (r15 === "float32") - return Ae(t8, "f32"); - if (r15 === "int32" || r15 === "bool") - return Ae(t8, "i32"); - throw new Error(`type ${r15} is not supported.`); +function Eu(r16, e = 1) { + if (r16 === "float32") + return Ae(e, "f32"); + if (r16 === "int32" || r16 === "bool") + return Ae(e, "i32"); + throw new Error(`type ${r16} is not supported.`); } -function pae(r15, t8, e) { - let o = r15.length, n = Cu(t8, e), s = `fn setOutputAtIndex(flatIndex : i32, value : ${Ae(e)}) { +function Oie(r16, e, t10) { + let o = r16.length, n = Eu(e, t10), s = `fn setOutputAtIndex(flatIndex : i32, value : ${Ae(t10)}) { result[flatIndex] = ${n}(value); } - fn setOutputAtIndexI32(flatIndex : i32, value : ${Ae(e, "i32")}) { + fn setOutputAtIndexI32(flatIndex : i32, value : ${Ae(t10, "i32")}) { result[flatIndex] = ${n}(value); } `; if (o >= 2) { let a = ["d0", "d1", "d2", "d3", "d4", "d5"].slice(0, o), i = ft(o); s += ` - fn setOutputAtCoords(${a.map((p) => `${p} : i32`).join(", ")}, value : ${Ae(e)}) { + fn setOutputAtCoords(${a.map((p) => `${p} : i32`).join(", ")}, value : ${Ae(t10)}) { let flatIndex = getOutputIndexFromCoords(${i}(${a.join(", ")})); - setOutputAtIndex(flatIndex${e === 1 ? "" : ` / ${e}`}, value); + setOutputAtIndex(flatIndex${t10 === 1 ? "" : ` / ${t10}`}, value); } - fn setOutputAtCoordsI32(${a.map((p) => `${p} : i32`).join(", ")}, value : ${Ae(e, "i32")}) { + fn setOutputAtCoordsI32(${a.map((p) => `${p} : i32`).join(", ")}, value : ${Ae(t10, "i32")}) { let flatIndex = getOutputIndexFromCoords(${i}(${a.join(", ")})); - setOutputAtIndexI32(flatIndex${e === 1 ? "" : ` / ${e}`}, value); + setOutputAtIndexI32(flatIndex${t10 === 1 ? "" : ` / ${t10}`}, value); } `; } return s; } -function cae(r15) { - let t8 = /(\w+)\s*:\s*vec(5|6)/g; - r15 = r15.replace(t8, (o) => "@align(16) " + o); - let e = /vec(5|6)\s*,\s*(\w+)/g; - return r15 = r15.replace(e, (o, n, s) => `vec${n}, @align(16) ${s}`), r15; -} -function YB(r15) { - return !(r15.dispatchLayout.hasOwnProperty("y") && r15.dispatchLayout.y.length !== 0 || r15.dispatchLayout.hasOwnProperty("z") && r15.dispatchLayout.z.length !== 0); -} -var Qv = {}; -qe(Qv, { GPUBytesPerElement: () => qg, MatMulProgramType: () => Mo, assertNotComplex: () => mm, computeDispatch: () => H, computeWorkPerThreadForConv2d: () => cm, computeWorkgroupInfoForMatMul: () => Yv, computeWorkgroupSizeForConv2d: () => pm, flatDispatchLayout: () => X, isWebGPUSupported: () => lm, tilesFitEvenlyIntoShape: () => mae }); -var kp = (r15) => { - let t8 = 1; - for (let e = 0; e < r15.length; e++) - t8 *= r15[e]; - return t8; -}; -function mae(r15, t8) { - if (r15.length !== t8.length) - throw new Error(`Cannot compute whether rank ${r15.length} tiles fit evenly into rank ${t8.length} shape - ranks must match.`); - return t8.every((e, o) => e % r15[o] === 0); -} -function H(r15, t8, e = [1, 1, 1], o = [1, 1, 1]) { - let [n, s, a] = [Math.ceil(kp(r15.x.map((i) => t8[i])) / (e[0] * o[0])), r15.y ? Math.ceil(kp(r15.y.map((i) => t8[i])) / (e[1] * o[1])) : 1, r15.z ? Math.ceil(kp(r15.z.map((i) => t8[i])) / (e[2] * o[2])) : 1]; +function Mie(r16) { + let e = /(\w+)\s*:\s*vec(5|6)/g; + r16 = r16.replace(e, (o) => "@align(16) " + o); + let t10 = /vec(5|6)\s*,\s*(\w+)/g; + return r16 = r16.replace(t10, (o, n, s) => `vec${n}, @align(16) ${s}`), r16; +} +function Vz(r16) { + return !(r16.dispatchLayout.hasOwnProperty("y") && r16.dispatchLayout.y.length !== 0 || r16.dispatchLayout.hasOwnProperty("z") && r16.dispatchLayout.z.length !== 0); +} +var cv = {}; +qe(cv, { GPUBytesPerElement: () => sx, MatMulProgramType: () => pn, assertNotComplex: () => wm, computeDispatch: () => H, computeWorkPerThreadForConv2d: () => bm, computeWorkgroupInfoForMatMul: () => lv, computeWorkgroupSizeForConv2d: () => ym, flatDispatchLayout: () => X, isWebGPUSupported: () => Cm, tilesFitEvenlyIntoShape: () => Bie }); +var Ap = (r16) => { + let e = 1; + for (let t10 = 0; t10 < r16.length; t10++) + e *= r16[t10]; + return e; +}; +function Bie(r16, e) { + if (r16.length !== e.length) + throw new Error(`Cannot compute whether rank ${r16.length} tiles fit evenly into rank ${e.length} shape - ranks must match.`); + return e.every((t10, o) => t10 % r16[o] === 0); +} +function H(r16, e, t10 = [1, 1, 1], o = [1, 1, 1]) { + let [n, s, a] = [Math.ceil(Ap(r16.x.map((i) => e[i])) / (t10[0] * o[0])), r16.y ? Math.ceil(Ap(r16.y.map((i) => e[i])) / (t10[1] * o[1])) : 1, r16.z ? Math.ceil(Ap(r16.z.map((i) => e[i])) / (t10[2] * o[2])) : 1]; return [n, s, a]; } -function Yv(r15, t8, e, o = false) { +function lv(r16, e, t10, o = false) { let n = [8, 8, 1], s = [4, 4, 1]; - return o || (r15 <= 8 && (s[1] = 1), t8 <= 16 && e <= 16 && (n[0] = 4)), { workgroupSize: n, elementsPerThread: s }; + return o || (r16 <= 8 && (s[1] = 1), e <= 16 && t10 <= 16 && (n[0] = 4)), { workgroupSize: n, elementsPerThread: s }; } -function pm(r15, t8, e = false) { - if (e) +function ym(r16, e, t10 = false) { + if (t10) return [8, 8, 1]; - let o = kp(r15.x.map((s) => t8[s])), n = kp(r15.y.map((s) => t8[s])); + let o = Ap(r16.x.map((s) => e[s])), n = Ap(r16.y.map((s) => e[s])); return o <= 4 ? [4, 16, 1] : n <= 4 ? [16, 4, 1] : [16, 16, 1]; } -function cm(r15, t8, e = false) { - if (e) +function bm(r16, e, t10 = false) { + if (t10) return [4, 4, 1]; - let o = kp(r15.x.map((s) => t8[s])), n = kp(r15.y.map((s) => t8[s])); + let o = Ap(r16.x.map((s) => e[s])), n = Ap(r16.y.map((s) => e[s])); return o <= 4 ? [1, 2, 1] : n <= 4 ? [2, 1, 1] : [2, 2, 1]; } -function X(r15) { - return { x: r15.map((t8, e) => e) }; +function X(r16) { + return { x: r16.map((e, t10) => t10) }; } -function qg(r15) { - if (r15 === "float32" || r15 === "int32" || r15 === "bool" || r15 === "string") +function sx(r16) { + if (r16 === "float32" || r16 === "int32" || r16 === "bool" || r16 === "string") return 4; - if (r15 === "complex64") + if (r16 === "complex64") return 8; - throw new Error(`Unknown dtype ${r15}`); + throw new Error(`Unknown dtype ${r16}`); } -function lm() { +function Cm() { return !!(globalThis && globalThis.navigator && globalThis.navigator.gpu); } -function mm(r15, t8) { - Array.isArray(r15) || (r15 = [r15]), r15.forEach((e) => { - e != null && y.assert(e.dtype !== "complex64", () => `${t8} does not support complex64 tensors in the WebGPU backend.`); +function wm(r16, e) { + Array.isArray(r16) || (r16 = [r16]), r16.forEach((t10) => { + t10 != null && y.assert(t10.dtype !== "complex64", () => `${e} does not support complex64 tensors in the WebGPU backend.`); }); } -var Mo; -(function(r15) { - r15[r15.MatMulReduceProgram = 0] = "MatMulReduceProgram", r15[r15.MatMulSplitKProgram = 1] = "MatMulSplitKProgram", r15[r15.MatMulSmallOutputSizeProgram = 2] = "MatMulSmallOutputSizeProgram", r15[r15.MatMulPackedProgram = 3] = "MatMulPackedProgram", r15[r15.MatMulMax = 4] = "MatMulMax"; -})(Mo || (Mo = {})); -var dae = A().getNumber("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD"); -var fae = (r15, t8) => { - let e = r15.limits.maxComputeWorkgroupsPerDimension, o = t8.dispatchLayout, n = t8.dispatch; - if (n.every((a) => a <= e)) +var pn; +(function(r16) { + r16[r16.MatMulReduceProgram = 0] = "MatMulReduceProgram", r16[r16.MatMulSplitKProgram = 1] = "MatMulSplitKProgram", r16[r16.MatMulSmallOutputSizeProgram = 2] = "MatMulSmallOutputSizeProgram", r16[r16.MatMulPackedProgram = 3] = "MatMulPackedProgram", r16[r16.MatMulMax = 4] = "MatMulMax"; +})(pn || (pn = {})); +var zie = A().getNumber("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD"); +var Vie = (r16, e) => { + let t10 = r16.limits.maxComputeWorkgroupsPerDimension, o = e.dispatchLayout, n = e.dispatch; + if (n.every((a) => a <= t10)) return n; - y.assert(n[0] > e && o.y === void 0 && o.z === void 0, () => "Dispatch size exceeds WebGPU limits in Y or Z dimension."); + y.assert(n[0] > t10 && o.y === void 0 && o.z === void 0, () => "Dispatch size exceeds WebGPU limits in Y or Z dimension."); let s = Math.ceil(Math.sqrt(n[0])); - return s > e ? (s = Math.ceil(Math.cbrt(n[0])), y.assert(s <= e, () => "Total dispatch size exceeds WebGPU maximum."), [s, s, s]) : [s, s, 1]; + return s > t10 ? (s = Math.ceil(Math.cbrt(n[0])), y.assert(s <= t10, () => "Total dispatch size exceeds WebGPU maximum."), [s, s, s]) : [s, s, 1]; }; -var Kc = class r14 extends so { +var Jl = class r14 extends mo { nextDataId() { return r14.nextDataId++; } - constructor(t8, e) { - if (super(), this.commandQueueOwnedIds = /* @__PURE__ */ new WeakSet(), this.dispatchCountInPass = 0, this.disposed = false, this.downloadWaitMs = 0, this.tensorDataPendingDisposal = [], this.queryResolveBuffer = null, this.querySet = null, this.querySetCount = 2, this.stagingPendingDisposal = [], this.uniformPendingDisposal = [], this.uploadWaitMs = 0, this.hasReadSyncWarned = false, this.hasTimestampQueryWarned = false, !lm()) + constructor(e, t10) { + if (super(), this.commandQueueOwnedIds = /* @__PURE__ */ new WeakSet(), this.dispatchCountInPass = 0, this.disposed = false, this.downloadWaitMs = 0, this.tensorDataPendingDisposal = [], this.queryResolveBuffer = null, this.querySet = null, this.querySetCount = 2, this.stagingPendingDisposal = [], this.uniformPendingDisposal = [], this.uploadWaitMs = 0, this.hasReadSyncWarned = false, this.hasTimestampQueryWarned = false, !Cm()) throw new Error("WebGPU is not supported on this device"); - this.pipelineCache = {}, this.device = t8, this.queue = t8.queue, this.commandEncoder = null, this.computePassEncoder = null, this.adapterInfo = new Gg(e), this.supportTimestampQuery = this.device.features.has("timestamp-query"), this.thresholdToIncreaseWorkgroups = this.adapterInfo.intelGPUGeneration >= 12 ? 16 : 8, this.bufferManager = new Hg(this.device), this.textureManager = new Kg(this.device), this.tensorMap = new Bo(this, ur()), A().getBool("WEBGPU_USE_PROFILE_TOOL") && (this.dummyCanvas = document.createElement("canvas"), this.dummyCanvas.width = 1, this.dummyCanvas.height = 1, this.dummyContext = this.dummyCanvas.getContext("webgpu"), this.dummyContext.configure({ device: t8, format: "bgra8unorm" }), document.body.appendChild(this.dummyCanvas)); + this.pipelineCache = {}, this.device = e, this.queue = e.queue, this.commandEncoder = null, this.computePassEncoder = null, this.adapterInfo = new rx(t10), this.supportTimestampQuery = this.device.features.has("timestamp-query"), this.thresholdToIncreaseWorkgroups = this.adapterInfo.intelGPUGeneration >= 12 ? 16 : 8, this.bufferManager = new ox(this.device), this.textureManager = new nx(this.device), this.tensorMap = new mn(this, cr()), A().getBool("WEBGPU_USE_PROFILE_TOOL") && (this.dummyCanvas = document.createElement("canvas"), this.dummyCanvas.width = 1, this.dummyCanvas.height = 1, this.dummyContext = this.dummyCanvas.getContext("webgpu"), this.dummyContext.configure({ device: e, format: "bgra8unorm" }), document.body.appendChild(this.dummyCanvas)); } floatPrecision() { return 32; } - disposeData(t8, e = false) { - if (!this.tensorMap.has(t8)) + disposeData(e, t10 = false) { + if (!this.tensorMap.has(e)) return true; - let o = this.tensorMap.get(t8); - return e ? o.refCount = 0 : o.refCount--, o.refCount > 0 ? false : (o.complexTensorInfos != null && (this.disposeData(o.complexTensorInfos.real.dataId), this.disposeData(o.complexTensorInfos.imag.dataId)), this.commandQueueOwnedIds.has(t8) ? (this.tensorDataPendingDisposal.push(t8), true) : (this.releaseResource(t8), this.tensorMap.delete(t8), true)); + let o = this.tensorMap.get(e); + return t10 ? o.refCount = 0 : o.refCount--, o.refCount > 0 ? false : (o.complexTensorInfos != null && (this.disposeData(o.complexTensorInfos.real.dataId), this.disposeData(o.complexTensorInfos.imag.dataId)), this.commandQueueOwnedIds.has(e) ? (this.tensorDataPendingDisposal.push(e), true) : (this.releaseResource(e), this.tensorMap.delete(e), true)); } memory() { return { numBytesInGPU: this.bufferManager.numBytesUsed, numBytesAllocatedInGPU: this.bufferManager.numBytesAllocated, unreliable: false }; } - releaseResource(t8) { - let e = this.tensorMap.get(t8); - if (!(!e || !e.resource)) { - if (e.external) { - e.resource = null; + releaseResource(e) { + let t10 = this.tensorMap.get(e); + if (!(!t10 || !t10.resource)) { + if (t10.external) { + t10.resource = null; return; } - e.resource instanceof GPUBuffer ? this.bufferManager.releaseBuffer(e.resource) : e.resource instanceof GPUTexture && this.textureManager.releaseTexture(e.resource), e.resource = null; + t10.resource instanceof GPUBuffer ? this.bufferManager.releaseBuffer(t10.resource) : t10.resource instanceof GPUTexture && this.textureManager.releaseTexture(t10.resource), t10.resource = null; } } - refCount(t8) { - return this.tensorMap.has(t8) ? this.tensorMap.get(t8).refCount : 0; + refCount(e) { + return this.tensorMap.has(e) ? this.tensorMap.get(e).refCount : 0; } - incRef(t8) { - let e = this.tensorMap.get(t8); - e.refCount++; + incRef(e) { + let t10 = this.tensorMap.get(e); + t10.refCount++; } - decRef(t8) { - if (this.tensorMap.has(t8)) { - let e = this.tensorMap.get(t8); - e.refCount--; + decRef(e) { + if (this.tensorMap.has(e)) { + let t10 = this.tensorMap.get(e); + t10.refCount--; } } - write(t8, e, o) { - if (o === "complex64" && t8 != null) + write(e, t10, o) { + if (o === "complex64" && e != null) throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag)."); let n = { id: this.nextDataId() }; - return this.tensorMap.set(n, { dtype: o, shape: e, values: t8, refCount: 1 }), n; + return this.tensorMap.set(n, { dtype: o, shape: t10, values: e, refCount: 1 }), n; } - move(t8, e, o, n, s) { + move(e, t10, o, n, s) { if (n === "complex64") throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag)."); - this.tensorMap.set(t8, { dtype: n, shape: o, values: e, refCount: s }); + this.tensorMap.set(e, { dtype: n, shape: o, values: t10, refCount: s }); } submitQueue() { - this.queue.submit([this.commandEncoder.finish()]), this.commandEncoder = null, this.dispatchCountInPass = 0, this.commandQueueOwnedIds = /* @__PURE__ */ new WeakSet(), this.tensorDataPendingDisposal.forEach((t8) => { - this.releaseResource(t8), this.tensorMap.delete(t8); - }), this.uniformPendingDisposal.forEach((t8) => this.bufferManager.releaseBuffer(t8)), this.stagingPendingDisposal.forEach((t8) => this.bufferManager.releaseBuffer(t8, false)), this.tensorDataPendingDisposal = [], this.uniformPendingDisposal = [], this.stagingPendingDisposal = []; + this.queue.submit([this.commandEncoder.finish()]), this.commandEncoder = null, this.dispatchCountInPass = 0, this.commandQueueOwnedIds = /* @__PURE__ */ new WeakSet(), this.tensorDataPendingDisposal.forEach((e) => { + this.releaseResource(e), this.tensorMap.delete(e); + }), this.uniformPendingDisposal.forEach((e) => this.bufferManager.releaseBuffer(e)), this.stagingPendingDisposal.forEach((e) => this.bufferManager.releaseBuffer(e, false)), this.tensorDataPendingDisposal = [], this.uniformPendingDisposal = [], this.stagingPendingDisposal = []; } ensureCommandEncoderReady() { this.commandEncoder || (this.commandEncoder = this.device.createCommandEncoder()); @@ -27301,49 +27397,49 @@ var Kc = class r14 extends so { this.computePassEncoder && (this.computePassEncoder.end(), this.computePassEncoder = null); } async checkCompileCompletionAsync() { - let t8; + let e; try { - t8 = await Promise.all(Object.values(this.pipelineCache)); - } catch (e) { - throw new Error(e.message); + e = await Promise.all(Object.values(this.pipelineCache)); + } catch (t10) { + throw new Error(t10.message); } - Object.keys(this.pipelineCache).map((e, o) => { - this.pipelineCache[e] = t8[o]; + Object.keys(this.pipelineCache).map((t10, o) => { + this.pipelineCache[t10] = e[o]; }); } - async getBufferData(t8) { + async getBufferData(e) { if (A().getBool("WEBGPU_ENGINE_COMPILE_ONLY")) return console.warn("The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false"), null; - let e = t8.size, o = this.bufferManager.acquireBuffer(e, GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ); - this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(t8, 0, o, 0, e), this.submitQueue(), await o.mapAsync(GPUMapMode.READ); + let t10 = e.size, o = this.bufferManager.acquireBuffer(t10, GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ); + this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(e, 0, o, 0, t10), this.submitQueue(), await o.mapAsync(GPUMapMode.READ); let n = o.getMappedRange().slice(0); return o.unmap(), o != null && this.bufferManager.releaseBuffer(o), A().getBool("WEBGPU_USE_PROFILE_TOOL") && (y.assert(this.dummyContext !== void 0, () => "Fail to get context for profiling tool"), this.dummyContext.getCurrentTexture()), n; } - convertAndCacheOnCPU(t8, e) { - let o = this.tensorMap.get(t8); - return o.values = e, o.values; + convertAndCacheOnCPU(e, t10) { + let o = this.tensorMap.get(e); + return o.values = t10, o.values; } - readSync(t8) { - let e = this.tensorMap.get(t8), { values: o, complexTensorInfos: n } = e; - if (o != null || e.dtype === "string") + readSync(e) { + let t10 = this.tensorMap.get(e), { values: o, complexTensorInfos: n } = t10; + if (o != null || t10.dtype === "string") return o; - if (e.dtype === "complex64") { - let h = this.readSync(n.real.dataId), g = this.readSync(n.imag.dataId), x = y.convertBackendValuesAndArrayBuffer(w.mergeRealAndImagArrays(h, g).buffer, "float32"); - return this.convertAndCacheOnCPU(t8, x), x; + if (t10.dtype === "complex64") { + let h = this.readSync(n.real.dataId), g = this.readSync(n.imag.dataId), x = y.convertBackendValuesAndArrayBuffer(C.mergeRealAndImagArrays(h, g).buffer, "float32"); + return this.convertAndCacheOnCPU(e, x), x; } this.hasReadSyncWarned || (this.hasReadSyncWarned = true, console.warn("The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead.")); - let s = ["opaque", "premultiplied"], a = e.resource, i = a.size; + let s = ["opaque", "premultiplied"], a = t10.resource, i = a.size; y.assert(i % 4 === 0, () => "Because there is 4 bytes for one pixel, buffer size must be multiple of 4."); - let p = i / 4, u = new ArrayBuffer(i), c = 256, l = 256, m = s.map((h) => new OffscreenCanvas(c, l)), d = new OffscreenCanvas(c, l); + let p = i / 4, u = new ArrayBuffer(i), l = 256, c = 256, m = s.map((h) => new OffscreenCanvas(l, c)), d = new OffscreenCanvas(l, c); this.endComputePassEncoder(), m.map((h, g) => { let x = h.getContext("webgpu"); return x.configure({ device: this.device, format: "bgra8unorm", usage: GPUTextureUsage.COPY_DST, alphaMode: s[g] }), x.getCurrentTexture(); }).map((h, g) => { - let x = c * 4, b = (R, D, P) => { - this.ensureCommandEncoderReady(), this.commandEncoder.copyBufferToTexture({ buffer: a, bytesPerRow: x, offset: P }, { texture: h }, { width: R, height: D }), this.submitQueue(); + let x = l * 4, b = (R, D, F) => { + this.ensureCommandEncoderReady(), this.commandEncoder.copyBufferToTexture({ buffer: a, bytesPerRow: x, offset: F }, { texture: h }, { width: R, height: D }), this.submitQueue(); let O = d.getContext("2d", { willReadFrequently: true }); O.clearRect(0, 0, R, D), O.drawImage(m[g], 0, 0); - let M = O.getImageData(0, 0, R, D).data, L = s[g], B = new Uint8ClampedArray(u, P, R * D * 4); + let M = O.getImageData(0, 0, R, D).data, L = s[g], B = new Uint8ClampedArray(u, F, R * D * 4); for (let z = 0; z < B.length; z += 4) if (L === "premultiplied") B[z + 3] = M[z + 3]; @@ -27351,109 +27447,109 @@ var Kc = class r14 extends so { let U = M[z]; B[z] = M[z + 2], B[z + 1] = M[z + 1], B[z + 2] = U; } - }, C = Math.floor(p / (c * l)), S = c, k = l, _ = 0; - for (let R = 0; R < C; R++) - b(S, k, _), _ += c * l * 4; - let E = p % (c * l); - k = Math.floor(E / c), k > 0 && (b(S, k, _), _ += k * (c * 4)), S = E % c, S > 0 && b(S, 1, _); + }, w = Math.floor(p / (l * c)), S = l, k = c, T = 0; + for (let R = 0; R < w; R++) + b(S, k, T), T += l * c * 4; + let E = p % (l * c); + k = Math.floor(E / l), k > 0 && (b(S, k, T), T += k * (l * 4)), S = E % l, S > 0 && b(S, 1, T); }); - let f = y.convertBackendValuesAndArrayBuffer(u, e.dtype); - return this.convertAndCacheOnCPU(t8, f), f; + let f = y.convertBackendValuesAndArrayBuffer(u, t10.dtype); + return this.convertAndCacheOnCPU(e, f), f; } - async read(t8) { - if (!this.tensorMap.has(t8)) - throw new Error(`Tensor ${t8} was not registered!`); - let e = this.tensorMap.get(t8), { values: o } = e; + async read(e) { + if (!this.tensorMap.has(e)) + throw new Error(`Tensor ${e} was not registered!`); + let t10 = this.tensorMap.get(e), { values: o } = t10; if (o != null) return o; let n; - if (e.dtype === "complex64") { - let s = await Promise.all([this.read(e.complexTensorInfos.real.dataId), this.read(e.complexTensorInfos.imag.dataId)]), a = s[0], i = s[1]; - n = w.mergeRealAndImagArrays(a, i); + if (t10.dtype === "complex64") { + let s = await Promise.all([this.read(t10.complexTensorInfos.real.dataId), this.read(t10.complexTensorInfos.imag.dataId)]), a = s[0], i = s[1]; + n = C.mergeRealAndImagArrays(a, i); } else { - let s = await this.getBufferData(e.resource); - n = y.convertBackendValuesAndArrayBuffer(s, e.dtype); + let s = await this.getBufferData(t10.resource); + n = y.convertBackendValuesAndArrayBuffer(s, t10.dtype); } - return this.convertAndCacheOnCPU(t8, n), n; + return this.convertAndCacheOnCPU(e, n), n; } - copyBuffer(t8) { - let e = t8.size, o = t8.usage, n = this.bufferManager.acquireBuffer(e, o); - return this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(t8, 0, n, 0, e), this.submitQueue(), n; + copyBuffer(e) { + let t10 = e.size, o = e.usage, n = this.bufferManager.acquireBuffer(t10, o); + return this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(e, 0, n, 0, t10), this.submitQueue(), n; } - createTensorFromGPUData(t8, e, o) { - let n = t8.buffer; + createTensorFromGPUData(e, t10, o) { + let n = e.buffer; if (o === "complex64") throw new Error("Cannot write to a complex64 dtype. "); let s = { id: this.nextDataId() }; - this.tensorMap.set(s, { dtype: o, shape: e, values: null, refCount: 1, external: t8.zeroCopy }); - let a = this.tensorMap.get(s), i = qg(a.dtype) * y.sizeFromShape(a.shape); - if (t8.buffer.size < i) - throw new Error(`GPUBuffer size(${t8.buffer.size}) is smaller than tensor size(${i})!`); - if ((t8.buffer.usage & (GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC)) !== (GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC)) + this.tensorMap.set(s, { dtype: o, shape: t10, values: null, refCount: 1, external: e.zeroCopy }); + let a = this.tensorMap.get(s), i = sx(a.dtype) * y.sizeFromShape(a.shape); + if (e.buffer.size < i) + throw new Error(`GPUBuffer size(${e.buffer.size}) is smaller than tensor size(${i})!`); + if ((e.buffer.usage & (GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC)) !== (GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC)) throw new Error("GPUBuffer.usage should include GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC!"); - return t8.zeroCopy !== true && (n = this.copyBuffer(n)), a.resource = n, ur().makeTensorFromDataId(s, e, o, this); + return e.zeroCopy !== true && (n = this.copyBuffer(n)), a.resource = n, cr().makeTensorFromDataId(s, t10, o, this); } - readToGPU(t8) { - let e = this.tensorMap.get(t8), { values: o, dtype: n, shape: s, resource: a } = e; + readToGPU(e) { + let t10 = this.tensorMap.get(e), { values: o, dtype: n, shape: s, resource: a } = t10; if (n === "complex64") throw new Error("Does not support reading buffer for complex64 dtype."); if (a == null) throw o != null ? new Error("Data is not on GPU but on CPU.") : new Error("There is no data on GPU or CPU."); - let i = a, p = i.size, u = i.usage, c = this.bufferManager.acquireBuffer(p, u); - this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(a, 0, c, 0, p), this.submitQueue(); - let l = this.makeTensorInfo(s, n), m = ur().makeTensorFromTensorInfo(l), d = this.tensorMap.get(l.dataId); - return d.resource = c, { tensorRef: m, buffer: c }; - } - bufferSync(t8) { - let e = this.readSync(t8.dataId); - if (t8.dtype === "string") + let i = a, p = i.size, u = i.usage, l = this.bufferManager.acquireBuffer(p, u); + this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(a, 0, l, 0, p), this.submitQueue(); + let c = this.makeTensorInfo(s, n), m = cr().makeTensorFromTensorInfo(c), d = this.tensorMap.get(c.dataId); + return d.resource = l, { tensorRef: m, buffer: l }; + } + bufferSync(e) { + let t10 = this.readSync(e.dataId); + if (e.dtype === "string") try { - let o = e.map((n) => y.decodeString(n)); - return me(t8.shape, t8.dtype, o); + let o = t10.map((n) => y.decodeString(n)); + return ie(e.shape, e.dtype, o); } catch (o) { throw new Error("Failed to decode encoded string bytes into utf-8"); } - return me(t8.shape, t8.dtype, e); + return ie(e.shape, e.dtype, t10); } - async time(t8) { + async time(e) { !this.supportTimestampQuery && !this.hasTimestampQueryWarned && (console.warn("This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled."), this.hasTimestampQueryWarned = true); - let e = this.activeTimers, o = [], n = false; - this.programTimersStack == null ? (this.programTimersStack = o, n = true) : this.activeTimers.push(o), this.activeTimers = o, t8(); + let t10 = this.activeTimers, o = [], n = false; + this.programTimersStack == null ? (this.programTimersStack = o, n = true) : this.activeTimers.push(o), this.activeTimers = o, e(); let s = y.flatten(this.activeTimers.map((u) => u.query)).filter((u) => u != null), a = y.flatten(this.activeTimers.map((u) => u.name)).filter((u) => u != null); - this.activeTimers = e, n && (this.programTimersStack = null); + this.activeTimers = t10, n && (this.programTimersStack = null); let i = { uploadWaitMs: this.uploadWaitMs, downloadWaitMs: this.downloadWaitMs, kernelMs: null, wallMs: null }, p = await Promise.all(s); - return i.kernelMs = y.sum(p), i.getExtraProfileInfo = () => p.map((u, c) => ({ name: a[c], ms: u })).map((u) => `${u.name}: ${u.ms}`).join(", "), this.uploadWaitMs = 0, this.downloadWaitMs = 0, i; + return i.kernelMs = y.sum(p), i.getExtraProfileInfo = () => p.map((u, l) => ({ name: a[l], ms: u })).map((u) => `${u.name}: ${u.ms}`).join(", "), this.uploadWaitMs = 0, this.downloadWaitMs = 0, i; } - makeTensorInfo(t8, e, o) { - return e === "string" && o != null && o.length > 0 && y.isString(o[0]) && (o = o.map((s) => y.encodeString(s))), { dataId: this.write(o, t8, e), shape: t8, dtype: e }; + makeTensorInfo(e, t10, o) { + return t10 === "string" && o != null && o.length > 0 && y.isString(o[0]) && (o = o.map((s) => y.encodeString(s))), { dataId: this.write(o, e, t10), shape: e, dtype: t10 }; } - tensorToBinding(t8) { - if (!t8) + tensorToBinding(e) { + if (!e) return null; - let o = this.tensorMap.get(t8.dataId).resource; + let o = this.tensorMap.get(e.dataId).resource; return o instanceof GPUBuffer ? { buffer: o } : o instanceof GPUTexture ? o.createView() : o; } - uploadToGPU(t8) { - let e = this.tensorMap.get(t8); - if (e.resource != null) + uploadToGPU(e) { + let t10 = this.tensorMap.get(e); + if (t10.resource != null) return; - let o = qg(e.dtype) * y.sizeFromShape(e.shape), n, s = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST; - if (e.values) { + let o = sx(t10.dtype) * y.sizeFromShape(t10.shape), n, s = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST; + if (t10.values) { if (n = this.bufferManager.acquireBuffer(o, s, true), n.mapState === "unmapped") { let a = this.bufferManager.acquireBuffer(o, GPUBufferUsage.MAP_WRITE | GPUBufferUsage.COPY_SRC, true, false), i = a.getMappedRange(); - e.dtype === "int32" || e.dtype === "bool" ? new Int32Array(i).set(e.values) : new Float32Array(i).set(e.values), a.unmap(), this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(a, 0, n, 0, o), this.stagingPendingDisposal.push(a); + t10.dtype === "int32" || t10.dtype === "bool" ? new Int32Array(i).set(t10.values) : new Float32Array(i).set(t10.values), a.unmap(), this.ensureCommandEncoderReady(), this.endComputePassEncoder(), this.commandEncoder.copyBufferToBuffer(a, 0, n, 0, o), this.stagingPendingDisposal.push(a); } else { let a = n.getMappedRange(); - e.dtype === "int32" || e.dtype === "bool" ? new Int32Array(a).set(e.values) : new Float32Array(a).set(e.values), n.unmap(); + t10.dtype === "int32" || t10.dtype === "bool" ? new Int32Array(a).set(t10.values) : new Float32Array(a).set(t10.values), n.unmap(); } - e.values = null; + t10.values = null; } else n = this.bufferManager.acquireBuffer(o, s); - e.resource = n; + t10.resource = n; } - makeUniforms(t8) { - let e = 0, o = 0, n = [], s = 1; - t8.forEach((p) => { + makeUniforms(e) { + let t10 = 0, o = 0, n = [], s = 1; + e.forEach((p) => { p.data.length === 0 && (p.data = [1]); let u; switch (p.data.length) { @@ -27478,35 +27574,35 @@ var Kc = class r14 extends so { default: y.assert(false, () => `Unsupported ${p.data.length}D shape`); } - (o === 5 || o === 6) && (u = 16), u > s && (s = u), e = Math.ceil(e / u) * u, o = p.data.length, n.push(e), e += p.data.length * 4; - }), e = Math.ceil(e / s) * s; - let a = new ArrayBuffer(e); - t8.forEach((p, u) => { - let c = n[u]; - p.type === "int32" ? new Int32Array(a, c, p.data.length).set(p.data) : p.type === "uint32" ? new Uint32Array(a, c, p.data.length).set(p.data) : new Float32Array(a, c, p.data.length).set(p.data); + (o === 5 || o === 6) && (u = 16), u > s && (s = u), t10 = Math.ceil(t10 / u) * u, o = p.data.length, n.push(t10), t10 += p.data.length * 4; + }), t10 = Math.ceil(t10 / s) * s; + let a = new ArrayBuffer(t10); + e.forEach((p, u) => { + let l = n[u]; + p.type === "int32" ? new Int32Array(a, l, p.data.length).set(p.data) : p.type === "uint32" ? new Uint32Array(a, l, p.data.length).set(p.data) : new Float32Array(a, l, p.data.length).set(p.data); }); - let i = this.bufferManager.acquireBuffer(e, GPUBufferUsage.COPY_DST | GPUBufferUsage.UNIFORM); - return this.queue.writeBuffer(i, 0, a, 0, e), this.uniformPendingDisposal.push(i), { offset: 0, size: e, buffer: i }; + let i = this.bufferManager.acquireBuffer(t10, GPUBufferUsage.COPY_DST | GPUBufferUsage.UNIFORM); + return this.queue.writeBuffer(i, 0, a, 0, t10), this.uniformPendingDisposal.push(i), { offset: 0, size: t10, buffer: i }; } - runWebGPUProgram(t8, e, o, n, s) { - if (s || (s = this.makeTensorInfo(t8.outputShape, o)), y.sizeFromShape(s.shape) === 0) + runWebGPUProgram(e, t10, o, n, s) { + if (s || (s = this.makeTensorInfo(e.outputShape, o)), y.sizeFromShape(s.shape) === 0) return this.tensorMap.get(s.dataId).values = y.getTypedArrayFromDType(s.dtype, 0), s; - this.uploadToGPU(s.dataId), t8.dispatch = fae(this.device, t8); - let a = e.map((p, u) => { + this.uploadToGPU(s.dataId), e.dispatch = Vie(this.device, e); + let a = t10.map((p, u) => { if (p.dtype === "complex64") throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts."); - return this.uploadToGPU(p.dataId), { dtype: this.tensorMap.get(p.dataId).dtype, shape: p.shape, name: t8.variableNames[u] }; + return this.uploadToGPU(p.dataId), { dtype: this.tensorMap.get(p.dataId).dtype, shape: p.shape, name: e.variableNames[u] }; }); - t8.shaderKey = ZB(t8, a, s); + e.shaderKey = Uz(e, a, s); let i = A().getBool("WEBGPU_ENGINE_COMPILE_ONLY"); - return t8.shaderKey in this.pipelineCache || (this.pipelineCache[t8.shaderKey] = QB(this.device, t8, a, s, i)), t8.pipeline = this.pipelineCache[t8.shaderKey], i || this.recordAndSubmit(t8, s, e, n), s; + return e.shaderKey in this.pipelineCache || (this.pipelineCache[e.shaderKey] = Wz(this.device, e, a, s, i)), e.pipeline = this.pipelineCache[e.shaderKey], i || this.recordAndSubmit(e, s, t10, n), s; } - recordAndSubmit(t8, e, o, n) { - if (t8.pipeline instanceof Promise) + recordAndSubmit(e, t10, o, n) { + if (e.pipeline instanceof Promise) throw new Error("Please call checkCompileCompletionAsync to ensure parallel compilation is done!"); let s = [], a = [], i = "int32"; - if (t8.pixelsOpType == null) { - s.push({ type: "float32", data: [NaN] }, { type: "float32", data: [1 / 0] }), a = o.concat(e).map((d) => d.shape); + if (e.pixelsOpType == null) { + s.push({ type: "float32", data: [NaN] }, { type: "float32", data: [1 / 0] }), a = o.concat(t10).map((d) => d.shape); let m = "int32"; a.map((d) => { s.push({ type: m, data: d }); @@ -27514,34 +27610,34 @@ var Kc = class r14 extends so { s.push({ type: m, data: f }); }); } else { - let m = y.computeStrides(e.shape); + let m = y.computeStrides(t10.shape); s.push({ type: i, data: m }); } - if (t8.size) { - let m = y.sizeFromShape(t8.outputShape); - s.push({ type: i, data: [t8.outputComponent ? m / t8.outputComponent : m] }); + if (e.size) { + let m = y.sizeFromShape(e.outputShape); + s.push({ type: i, data: [e.outputComponent ? m / e.outputComponent : m] }); } n && (s = [...s, ...n]); - let p = [this.tensorToBinding(e), ...o.map((m) => this.tensorToBinding(m)), this.makeUniforms(s)]; + let p = [this.tensorToBinding(t10), ...o.map((m) => this.tensorToBinding(m)), this.makeUniforms(s)]; o.forEach((m) => { this.commandQueueOwnedIds.add(m.dataId); - }), this.commandQueueOwnedIds.add(e.dataId); - let u = this.device.createBindGroup({ layout: t8.pipeline.getBindGroupLayout(0), entries: p.map((m, d) => ({ binding: d, resource: m })) }), c = this.activeTimers != null; + }), this.commandQueueOwnedIds.add(t10.dataId); + let u = this.device.createBindGroup({ layout: e.pipeline.getBindGroupLayout(0), entries: p.map((m, d) => ({ binding: d, resource: m })) }), l = this.activeTimers != null; this.ensureCommandEncoderReady(); - let l = {}; - c && this.supportTimestampQuery ? (this.endComputePassEncoder(), this.querySet == null && (this.querySet = this.device.createQuerySet({ type: "timestamp", count: this.querySetCount })), l.timestampWrites = { querySet: this.querySet, beginningOfPassWriteIndex: 0, endOfPassWriteIndex: 1 }, this.computePassEncoder = this.commandEncoder.beginComputePass(l)) : this.computePassEncoder || (this.computePassEncoder = this.commandEncoder.beginComputePass(l)), this.computePassEncoder.setPipeline(t8.pipeline), this.computePassEncoder.setBindGroup(0, u), this.computePassEncoder.dispatchWorkgroups(t8.dispatch[0], t8.dispatch[1], t8.dispatch[2]), this.dispatchCountInPass++, (c || A().get("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE") <= this.dispatchCountInPass || t8.pixelsOpType === Ci.DRAW) && (this.endComputePassEncoder(), c ? this.activeTimers.push({ name: t8.constructor.name, query: this.getQueryTime() }) : this.submitQueue()); + let c = {}; + l && this.supportTimestampQuery ? (this.endComputePassEncoder(), this.querySet == null && (this.querySet = this.device.createQuerySet({ type: "timestamp", count: this.querySetCount })), c.timestampWrites = { querySet: this.querySet, beginningOfPassWriteIndex: 0, endOfPassWriteIndex: 1 }, this.computePassEncoder = this.commandEncoder.beginComputePass(c)) : this.computePassEncoder || (this.computePassEncoder = this.commandEncoder.beginComputePass(c)), this.computePassEncoder.setPipeline(e.pipeline), this.computePassEncoder.setBindGroup(0, u), this.computePassEncoder.dispatchWorkgroups(e.dispatch[0], e.dispatch[1], e.dispatch[2]), this.dispatchCountInPass++, (l || A().get("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE") <= this.dispatchCountInPass || e.pixelsOpType === $i.DRAW) && (this.endComputePassEncoder(), l ? this.activeTimers.push({ name: e.constructor.name, query: this.getQueryTime() }) : this.submitQueue()); } async getQueryTime() { if (!this.supportTimestampQuery) return 0; this.queryResolveBuffer == null && (this.queryResolveBuffer = this.bufferManager.acquireBuffer(this.querySetCount * 8, GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST | GPUBufferUsage.QUERY_RESOLVE)), this.commandEncoder.resolveQuerySet(this.querySet, 0, this.querySetCount, this.queryResolveBuffer, 0); - let t8 = this.bufferManager.acquireBuffer(this.querySetCount * 8, GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST); - this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer, 0, t8, 0, this.querySetCount * 8), this.submitQueue(), await t8.mapAsync(GPUMapMode.READ); - let e = new BigUint64Array(t8.getMappedRange()), o = Number(e[1] - e[0]) / 1e6; - return t8.unmap(), this.bufferManager.releaseBuffer(t8), o; + let e = this.bufferManager.acquireBuffer(this.querySetCount * 8, GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST); + this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer, 0, e, 0, this.querySetCount * 8), this.submitQueue(), await e.mapAsync(GPUMapMode.READ); + let t10 = new BigUint64Array(e.getMappedRange()), o = Number(t10[1] - t10[0]) / 1e6; + return e.unmap(), this.bufferManager.releaseBuffer(e), o; } - shouldExecuteOnCPU(t8, e = dae) { - return A().getBool("WEBGPU_CPU_FORWARD") && t8.every((o) => this.tensorMap.get(o.dataId).resource == null && y.sizeFromShape(o.shape) < e); + shouldExecuteOnCPU(e, t10 = zie) { + return A().getBool("WEBGPU_CPU_FORWARD") && e.every((o) => this.tensorMap.get(o.dataId).resource == null && y.sizeFromShape(o.shape) < t10); } numDataIds() { return this.tensorMap.numDataIds() - this.tensorDataPendingDisposal.length; @@ -27550,72 +27646,72 @@ var Kc = class r14 extends so { this.disposed || (this.querySet != null && this.querySet.destroy(), this.bufferManager.dispose(), this.textureManager.dispose(), this.disposed = true); } }; -Kc.nextDataId = 0; -lm() && tu("webgpu", async () => { - let r15 = { powerPreference: A().get("WEBGPU_USE_LOW_POWER_GPU") ? "low-power" : "high-performance" }, t8 = await navigator.gpu.requestAdapter(r15), e = {}, o = []; - t8.features.has("timestamp-query") && o.push("timestamp-query"), t8.features.has("bgra8unorm-storage") && o.push(["bgra8unorm-storage"]), e.requiredFeatures = o; - let n = t8.limits; - e.requiredLimits = { maxComputeWorkgroupStorageSize: n.maxComputeWorkgroupStorageSize, maxComputeWorkgroupsPerDimension: n.maxComputeWorkgroupsPerDimension, maxStorageBufferBindingSize: n.maxStorageBufferBindingSize, maxBufferSize: n.maxBufferSize, maxComputeWorkgroupSizeX: n.maxComputeWorkgroupSizeX, maxComputeInvocationsPerWorkgroup: n.maxComputeInvocationsPerWorkgroup }; - let s = await t8.requestDevice(e), a = await t8.requestAdapterInfo(); - return new Kc(s, a); +Jl.nextDataId = 0; +Cm() && pu("webgpu", async () => { + let r16 = { powerPreference: A().get("WEBGPU_USE_LOW_POWER_GPU") ? "low-power" : "high-performance" }, e = await navigator.gpu.requestAdapter(r16), t10 = {}, o = []; + e.features.has("timestamp-query") && o.push("timestamp-query"), e.features.has("bgra8unorm-storage") && o.push(["bgra8unorm-storage"]), t10.requiredFeatures = o; + let n = e.limits; + t10.requiredLimits = { maxComputeWorkgroupStorageSize: n.maxComputeWorkgroupStorageSize, maxComputeWorkgroupsPerDimension: n.maxComputeWorkgroupsPerDimension, maxStorageBufferBindingSize: n.maxStorageBufferBindingSize, maxBufferSize: n.maxBufferSize, maxComputeWorkgroupSizeX: n.maxComputeWorkgroupSizeX, maxComputeInvocationsPerWorkgroup: n.maxComputeInvocationsPerWorkgroup }; + let s = await e.requestDevice(t10), a = await e.requestAdapterInfo(); + return new Jl(s, a); }, 3); var fe; -(function(r15) { - r15[r15.ADD = 0] = "ADD", r15[r15.ATAN2 = 1] = "ATAN2", r15[r15.COMPLEX_MULTIPLY_IMAG = 2] = "COMPLEX_MULTIPLY_IMAG", r15[r15.COMPLEX_MULTIPLY_REAL = 3] = "COMPLEX_MULTIPLY_REAL", r15[r15.DIV = 4] = "DIV", r15[r15.ELU_DER = 5] = "ELU_DER", r15[r15.EQUAL = 6] = "EQUAL", r15[r15.FLOOR_DIV = 7] = "FLOOR_DIV", r15[r15.GREATER = 8] = "GREATER", r15[r15.GREATER_EQUAL = 9] = "GREATER_EQUAL", r15[r15.LESS = 10] = "LESS", r15[r15.LESS_EQUAL = 11] = "LESS_EQUAL", r15[r15.LOGICAL_AND = 12] = "LOGICAL_AND", r15[r15.LOGICAL_OR = 13] = "LOGICAL_OR", r15[r15.MAX = 14] = "MAX", r15[r15.MIN = 15] = "MIN", r15[r15.MOD = 16] = "MOD", r15[r15.MUL = 17] = "MUL", r15[r15.NOT_EQUAL = 18] = "NOT_EQUAL", r15[r15.POW = 19] = "POW", r15[r15.PRELU = 20] = "PRELU", r15[r15.SQUARED_DIFFERENCE = 21] = "SQUARED_DIFFERENCE", r15[r15.SUB = 22] = "SUB"; +(function(r16) { + r16[r16.ADD = 0] = "ADD", r16[r16.ATAN2 = 1] = "ATAN2", r16[r16.COMPLEX_MULTIPLY_IMAG = 2] = "COMPLEX_MULTIPLY_IMAG", r16[r16.COMPLEX_MULTIPLY_REAL = 3] = "COMPLEX_MULTIPLY_REAL", r16[r16.DIV = 4] = "DIV", r16[r16.ELU_DER = 5] = "ELU_DER", r16[r16.EQUAL = 6] = "EQUAL", r16[r16.FLOOR_DIV = 7] = "FLOOR_DIV", r16[r16.GREATER = 8] = "GREATER", r16[r16.GREATER_EQUAL = 9] = "GREATER_EQUAL", r16[r16.LESS = 10] = "LESS", r16[r16.LESS_EQUAL = 11] = "LESS_EQUAL", r16[r16.LOGICAL_AND = 12] = "LOGICAL_AND", r16[r16.LOGICAL_OR = 13] = "LOGICAL_OR", r16[r16.MAX = 14] = "MAX", r16[r16.MIN = 15] = "MIN", r16[r16.MOD = 16] = "MOD", r16[r16.MUL = 17] = "MUL", r16[r16.NOT_EQUAL = 18] = "NOT_EQUAL", r16[r16.POW = 19] = "POW", r16[r16.PRELU = 20] = "PRELU", r16[r16.SQUARED_DIFFERENCE = 21] = "SQUARED_DIFFERENCE", r16[r16.SUB = 22] = "SUB"; })(fe || (fe = {})); -var hae = "let resultTemp = a + b;"; -var gae = "let resultTemp = atan2(a, b);"; -var xae = "let resultTemp = areal * breal - aimag * bimag;"; -var yae = "let resultTemp = areal * bimag + aimag * breal;"; -var bae = "let resultTemp = a / b;"; -var Cae = "let resultTemp = select(a * (b + 1.0), a, b >= b - b);"; -var wae = ` +var Wie = "let resultTemp = a + b;"; +var Uie = "let resultTemp = atan2(a, b);"; +var Gie = "let resultTemp = areal * breal - aimag * bimag;"; +var Hie = "let resultTemp = areal * bimag + aimag * breal;"; +var Kie = "let resultTemp = a / b;"; +var qie = "let resultTemp = select(a * (b + 1.0), a, b >= b - b);"; +var jie = ` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a == b); `; -var Sae = ` +var Xie = ` let remainder = select(a % b, round(a % b), (round(a) == a) & (round(b) == b)); let quotient = (a - remainder) / b; let resultTemp = round(select(quotient, quotient - 1, sign(remainder) == -sign(b))); `; -var Iae = ` +var Yie = ` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a > b); `; -var vae = ` +var Qie = ` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a >= b); `; -var kae = ` +var Zie = ` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a < b); `; -var Nae = ` +var Jie = ` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a <= b); `; -var Tae = "return f32(a >= 1.0 && b >= 1.0);"; -var _ae = `return (vec4(a >= vec4(1.0)) * +var eue = "return f32(a >= 1.0 && b >= 1.0);"; +var tue = `return (vec4(a >= vec4(1.0)) * vec4(b >= vec4(1.0)));`; -var $ae = "return f32(a >= 1.0 || b >= 1.0);"; -var Eae = `return min(vec4(a >= vec4(1.0)) + +var rue = "return f32(a >= 1.0 || b >= 1.0);"; +var oue = `return min(vec4(a >= vec4(1.0)) + vec4(b >= vec4(1.0)), vec4(1.0));`; -var Rae = "let resultTemp = max(a, b);"; -var Dae = "let resultTemp = min(a, b);"; -var Aae = ` +var nue = "let resultTemp = max(a, b);"; +var sue = "let resultTemp = min(a, b);"; +var aue = ` let isNaN = b == 0.; var resultTemp = a % b; resultTemp = select((resultTemp + b) % b, resultTemp, (a < 0. && b < 0.) || (a >= 0. && b > 0.)); `; -var Fae = ` +var iue = ` let isNaN = !vec4(b); var resultTemp = vec4(a % b); if (!((a[0] < 0. && b[0] < 0.) || (a[0] >= 0. && b[0] > 0.))) { @@ -27631,16 +27727,16 @@ var Fae = ` resultTemp[3] = (resultTemp[3] + b[3]) % b[3]; } `; -var Pae = "let resultTemp = a * b;"; -var Oae = ` +var uue = "let resultTemp = a * b;"; +var pue = ` var resultTemp = f32(a != b); let valueForNaN = 1.0; `; -var Mae = ` +var lue = ` var resultTemp = vec4(a != b); let valueForNaN = 1.0; `; -var Lae = ` +var cue = ` let isNaN = a < 0.0 && floor(b) < b; if (b == 0.0) { return 1.0; @@ -27648,7 +27744,7 @@ var Lae = ` var resultTemp = select(sign(a) * pow(abs(a), b), pow(abs(a), b), round(abs(b) % 2.0) != 1.0); `; -var Bae = ` +var mue = ` let isModRound1Bool = vec4(round(abs(b) % vec4(2.0))) == vec4(1); let isModRound1 = vec4(isModRound1Bool); let multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); @@ -27670,40 +27766,40 @@ var Bae = ` } let isNaN = (a < vec4(0.0)) & (floor(b) < b); `; -var zae = "if (a < 0.0) { return b * a; } return a;"; -var Vae = ` +var due = "if (a < 0.0) { return b * a; } return a;"; +var fue = ` let aLessThanZero = vec4(a < vec4(0.0)); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); `; -var Wae = "let resultTemp = (a - b) * (a - b);"; -var Uae = "let resultTemp = a - b;"; -function qc(r15, t8) { - let e; +var hue = "let resultTemp = (a - b) * (a - b);"; +var gue = "let resultTemp = a - b;"; +function ec(r16, e) { + let t10; do { - switch (r15) { + switch (r16) { case fe.ATAN2: - e = gae; + t10 = Uie; break; case fe.MAX: - e = Rae; + t10 = nue; break; case fe.MIN: - e = Dae; + t10 = sue; break; case fe.MOD: - e = t8 ? Fae : Aae; + t10 = e ? iue : aue; break; case fe.NOT_EQUAL: - e = t8 ? Mae : Oae; + t10 = e ? lue : pue; break; case fe.POW: - e = t8 ? Bae : Lae; + t10 = e ? mue : cue; break; default: continue; } let o, n, s; - return t8 ? (o = "isnanVec4", n = "vec4", s = "vec4") : (o = "isnan", n = "f32", s = "bool"), ` + return e ? (o = "isnanVec4", n = "vec4", s = "vec4") : (o = "isnan", n = "f32", s = "bool"), ` let aIsNaN = ${o}(a); let aPostLegalization = select(a, ${n}(42), aIsNaN); let bIsNaN = ${o}(b); @@ -27713,100 +27809,100 @@ function qc(r15, t8) { { let a = aPostLegalization; let b = bPostLegalization; - ${e} + ${t10} return select( resultTemp, ${n}(valueForNaN), ${s}(isNaN) | aIsNaN | bIsNaN); } `; } while (false); - switch (r15) { + switch (r16) { case fe.ADD: - e = hae; + t10 = Wie; break; case fe.COMPLEX_MULTIPLY_IMAG: - e = yae; + t10 = Hie; break; case fe.COMPLEX_MULTIPLY_REAL: - e = xae; + t10 = Gie; break; case fe.DIV: - e = bae; + t10 = Kie; break; case fe.ELU_DER: - e = Cae; + t10 = qie; break; case fe.EQUAL: - e = wae; + t10 = jie; break; case fe.FLOOR_DIV: - e = Sae; + t10 = Xie; break; case fe.GREATER: - e = Iae; + t10 = Yie; break; case fe.GREATER_EQUAL: - e = vae; + t10 = Qie; break; case fe.LESS: - e = kae; + t10 = Zie; break; case fe.LESS_EQUAL: - e = Nae; + t10 = Jie; break; case fe.LOGICAL_AND: - return t8 ? _ae : Tae; + return e ? tue : eue; case fe.LOGICAL_OR: - return t8 ? Eae : $ae; + return e ? oue : rue; case fe.MUL: - e = Pae; + t10 = uue; break; case fe.PRELU: - return t8 ? Vae : zae; + return e ? fue : due; case fe.SQUARED_DIFFERENCE: - e = Wae; + t10 = hue; break; case fe.SUB: - e = Uae; + t10 = gue; break; default: } return ` - ${e} + ${t10} return resultTemp; `; } var Z; -(function(r15) { - r15[r15.ABS = 0] = "ABS", r15[r15.ACOS = 1] = "ACOS", r15[r15.ACOSH = 2] = "ACOSH", r15[r15.ASIN = 3] = "ASIN", r15[r15.ASINH = 4] = "ASINH", r15[r15.ATAN = 5] = "ATAN", r15[r15.ATANH = 6] = "ATANH", r15[r15.CEIL = 7] = "CEIL", r15[r15.COS = 8] = "COS", r15[r15.COSH = 9] = "COSH", r15[r15.ELU = 10] = "ELU", r15[r15.ERF = 11] = "ERF", r15[r15.EXP = 12] = "EXP", r15[r15.EXPM1 = 13] = "EXPM1", r15[r15.FLOOR = 14] = "FLOOR", r15[r15.IS_FINITE = 15] = "IS_FINITE", r15[r15.IS_INF = 16] = "IS_INF", r15[r15.IS_NAN = 17] = "IS_NAN", r15[r15.LINEAR = 18] = "LINEAR", r15[r15.LOG = 19] = "LOG", r15[r15.LOG1P = 20] = "LOG1P", r15[r15.LOGICAL_NOT = 21] = "LOGICAL_NOT", r15[r15.NEG = 22] = "NEG", r15[r15.RELU = 23] = "RELU", r15[r15.RELU6 = 24] = "RELU6", r15[r15.LEAKYRELU = 25] = "LEAKYRELU", r15[r15.RECIPROCAL = 26] = "RECIPROCAL", r15[r15.ROUND = 27] = "ROUND", r15[r15.RSQRT = 28] = "RSQRT", r15[r15.SELU = 29] = "SELU", r15[r15.SIGMOID = 30] = "SIGMOID", r15[r15.SIGN = 31] = "SIGN", r15[r15.SIN = 32] = "SIN", r15[r15.SINH = 33] = "SINH", r15[r15.SOFTPLUS = 34] = "SOFTPLUS", r15[r15.SQRT = 35] = "SQRT", r15[r15.SQUARE = 36] = "SQUARE", r15[r15.STEP = 37] = "STEP", r15[r15.TAN = 38] = "TAN", r15[r15.TANH = 39] = "TANH", r15[r15.TO_INT = 40] = "TO_INT"; +(function(r16) { + r16[r16.ABS = 0] = "ABS", r16[r16.ACOS = 1] = "ACOS", r16[r16.ACOSH = 2] = "ACOSH", r16[r16.ASIN = 3] = "ASIN", r16[r16.ASINH = 4] = "ASINH", r16[r16.ATAN = 5] = "ATAN", r16[r16.ATANH = 6] = "ATANH", r16[r16.CEIL = 7] = "CEIL", r16[r16.COS = 8] = "COS", r16[r16.COSH = 9] = "COSH", r16[r16.ELU = 10] = "ELU", r16[r16.ERF = 11] = "ERF", r16[r16.EXP = 12] = "EXP", r16[r16.EXPM1 = 13] = "EXPM1", r16[r16.FLOOR = 14] = "FLOOR", r16[r16.IS_FINITE = 15] = "IS_FINITE", r16[r16.IS_INF = 16] = "IS_INF", r16[r16.IS_NAN = 17] = "IS_NAN", r16[r16.LINEAR = 18] = "LINEAR", r16[r16.LOG = 19] = "LOG", r16[r16.LOG1P = 20] = "LOG1P", r16[r16.LOGICAL_NOT = 21] = "LOGICAL_NOT", r16[r16.NEG = 22] = "NEG", r16[r16.RELU = 23] = "RELU", r16[r16.RELU6 = 24] = "RELU6", r16[r16.LEAKYRELU = 25] = "LEAKYRELU", r16[r16.RECIPROCAL = 26] = "RECIPROCAL", r16[r16.ROUND = 27] = "ROUND", r16[r16.RSQRT = 28] = "RSQRT", r16[r16.SELU = 29] = "SELU", r16[r16.SIGMOID = 30] = "SIGMOID", r16[r16.SIGN = 31] = "SIGN", r16[r16.SIN = 32] = "SIN", r16[r16.SINH = 33] = "SINH", r16[r16.SOFTPLUS = 34] = "SOFTPLUS", r16[r16.SQRT = 35] = "SQRT", r16[r16.SQUARE = 36] = "SQUARE", r16[r16.STEP = 37] = "STEP", r16[r16.TAN = 38] = "TAN", r16[r16.TANH = 39] = "TANH", r16[r16.TO_INT = 40] = "TO_INT"; })(Z || (Z = {})); -var Gae = "return abs(a);"; -var Hae = ` +var xue = "return abs(a);"; +var yue = ` if (abs(a) > 1.) { return uniforms.NAN; } return acos(a); `; -var Kae = ` +var bue = ` if (a < 1.) { return uniforms.NAN; } return acosh(a); `; -var qae = ` +var Cue = ` if (abs(a) > 1.) { return uniforms.NAN; } return asin(a); `; -var jae = "return asinh(a);"; -var Xae = ` +var wue = "return asinh(a);"; +var Sue = ` if (isnan(a)) { return uniforms.NAN; } return atan(a); `; -var Yae = ` +var Iue = ` if (abs(a) > 1.) { return uniforms.NAN; } @@ -27818,15 +27914,15 @@ var Yae = ` } return atanh(a); `; -var Qae = "return ceil(a);"; -var Zae = "return cos(a);"; -var Jae = ` +var vue = "return ceil(a);"; +var kue = "return cos(a);"; +var Nue = ` let e2x = exp(-a); return (e2x + 1.0 / e2x) / 2.0; `; -var eie = "return exp(a) - 1.0;"; -var tie = "if (a >= 0.0) { return a; } return (exp(a) - 1.0);"; -var rie = ` +var Tue = "return exp(a) - 1.0;"; +var _ue = "if (a >= 0.0) { return a; } return (exp(a) - 1.0);"; +var Eue = ` var resFloat = exp(a) - vec4(1.0); if (a.r >= 0.0) { resFloat.r = a.r; @@ -27842,65 +27938,65 @@ var rie = ` } return resFloat; `; -var oie = ` +var $ue = ` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - let p = ${w.ERF_P}; - let a1 = ${w.ERF_A1}; - let a2 = ${w.ERF_A2}; - let a3 = ${w.ERF_A3}; - let a4 = ${w.ERF_A4}; - let a5 = ${w.ERF_A5}; + let p = ${C.ERF_P}; + let a1 = ${C.ERF_A1}; + let a2 = ${C.ERF_A2}; + let a3 = ${C.ERF_A3}; + let a4 = ${C.ERF_A4}; + let a5 = ${C.ERF_A5}; let sign = sign(a); let absA = abs(a); let t = 1.0 / (1.0 + p * absA); return sign * (1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * exp(-absA * absA)); `; -var nie = "return exp(a);"; -var sie = "return floor(a);"; -var aie = "return f32(!isnan(a) && !isinf(a));"; -var iie = "return f32(isinf(a));"; -var uie = "return f32(isnan(a));"; -var pie = "return a;"; -var cie = `if (a < 0.0) { return uniforms.NAN; } +var Rue = "return exp(a);"; +var Due = "return floor(a);"; +var Aue = "return f32(!isnan(a) && !isinf(a));"; +var Fue = "return f32(isinf(a));"; +var Pue = "return f32(isnan(a));"; +var Oue = "return a;"; +var Mue = `if (a < 0.0) { return uniforms.NAN; } return log(a);`; -var lie = ` +var Lue = ` if (isnan(a)) { return a; } return log(1.0 + a); `; -var mie = "return f32(!(a >= 1.0));"; -var die = "return -a;"; -var fie = "if (a < 0.0) { return uniforms.alpha * a; } return a;"; -var hie = ` +var Bue = "return f32(!(a >= 1.0));"; +var zue = "return -a;"; +var Vue = "if (a < 0.0) { return uniforms.alpha * a; } return a;"; +var Wue = ` let aLessThanZero = vec4(a < vec4(0.0)); return (aLessThanZero * (uniforms.alpha * a)) + ((vec4(1.0) - aLessThanZero) * a); `; -var gie = "return 1.0 / a;"; -var xie = "return select(a, 0.0, a < 0.0);"; -var yie = "return clamp(a, 0.0, 6.0);"; -var bie = "return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));"; -var Cie = ` +var Uue = "return 1.0 / a;"; +var Gue = "return select(a, 0.0, a < 0.0);"; +var Hue = "return clamp(a, 0.0, 6.0);"; +var Kue = "return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));"; +var que = ` return select(a, vec4(0.0), a < vec4(0.0)); `; -var wie = "return round(a);"; -var Sie = "return inverseSqrt(a);"; -var Iie = ` +var jue = "return round(a);"; +var Xue = "return inverseSqrt(a);"; +var Yue = ` if (a >= 0.0) { - return ${w.SELU_SCALE} * a; + return ${C.SELU_SCALE} * a; } else { - return ${w.SELU_SCALEALPHA} * (exp(a) - 1.0); + return ${C.SELU_SCALEALPHA} * (exp(a) - 1.0); } `; -var vie = "return 1.0 / (1.0 + exp(-1.0 * a));"; -var kie = "return sign(a);"; -var Nie = "return sin(a);"; -var Tie = ` +var Que = "return 1.0 / (1.0 + exp(-1.0 * a));"; +var Zue = "return sign(a);"; +var Jue = "return sin(a);"; +var epe = ` let e2x = exp(a); return (e2x - 1.0 / e2x) / 2.0; `; -var _ie = ` +var tpe = ` let epsilon = 1.1920928955078125e-7; let threshold = log(epsilon) + 2.0; @@ -27916,131 +28012,131 @@ var _ie = ` return log(exp_a + 1.0); } `; -var $ie = "return sqrt(a);"; -var Eie = "return a * a;"; -var Rie = ` +var rpe = "return sqrt(a);"; +var ope = "return a * a;"; +var npe = ` if (isnan(a)) { return a; } return select(uniforms.stepAlpha, 1.0, a > 0.0); `; -var Die = "return tan(a);"; -var Aie = ` +var spe = "return tan(a);"; +var ape = ` let e2x = exp(-2.0 * abs(a)); return sign(a) * (1.0 - e2x) / (1.0 + e2x); `; -var Fie = "return f32(i32((a)));"; -function wi(r15, t8) { - switch (r15) { +var ipe = "return f32(i32((a)));"; +function Ri(r16, e) { + switch (r16) { case Z.ABS: - return Gae; + return xue; case Z.ACOS: - return Hae; + return yue; case Z.ACOSH: - return Kae; + return bue; case Z.ASIN: - return qae; + return Cue; case Z.ASINH: - return jae; + return wue; case Z.ATAN: - return Xae; + return Sue; case Z.ATANH: - return Yae; + return Iue; case Z.COS: - return Zae; + return kue; case Z.COSH: - return Jae; + return Nue; case Z.CEIL: - return Qae; + return vue; case Z.ELU: - return t8 ? rie : tie; + return e ? Eue : _ue; case Z.ERF: - return oie; + return $ue; case Z.EXP: - return nie; + return Rue; case Z.EXPM1: - return eie; + return Tue; case Z.FLOOR: - return sie; + return Due; case Z.IS_FINITE: - return aie; + return Aue; case Z.IS_INF: - return iie; + return Fue; case Z.IS_NAN: - return uie; + return Pue; case Z.LINEAR: - return pie; + return Oue; case Z.LOG: - return cie; + return Mue; case Z.LOG1P: - return lie; + return Lue; case Z.LOGICAL_NOT: - return mie; + return Bue; case Z.NEG: - return die; + return zue; case Z.LEAKYRELU: - return t8 ? hie : fie; + return e ? Wue : Vue; case Z.RECIPROCAL: - return gie; + return Uue; case Z.RELU: - return t8 ? Cie : xie; + return e ? que : Gue; case Z.RELU6: - return t8 ? bie : yie; + return e ? Kue : Hue; case Z.ROUND: - return wie; + return jue; case Z.RSQRT: - return Sie; + return Xue; case Z.SELU: - return Iie; + return Yue; case Z.SIGMOID: - return vie; + return Que; case Z.SIGN: - return kie; + return Zue; case Z.SIN: - return Nie; + return Jue; case Z.SINH: - return Tie; + return epe; case Z.SOFTPLUS: - return _ie; + return tpe; case Z.SQRT: - return $ie; + return rpe; case Z.SQUARE: - return Eie; + return ope; case Z.STEP: - return Rie; + return npe; case Z.TAN: - return Die; + return spe; case Z.TANH: - return Aie; + return ape; case Z.TO_INT: - return Fie; + return ipe; default: - throw new Error(`BinaryType ${r15} is not implemented!`); + throw new Error(`BinaryType ${r16} is not implemented!`); } } -function dr(r15, t8 = false, e = false, o = 3) { - if (r15 === null) +function gr(r16, e = false, t10 = false, o = 3) { + if (r16 === null) return ""; let n = ""; - if (r15 === "linear") - n = wi(Z.LINEAR); - else if (r15 === "relu") - n = wi(Z.RELU, e); - else if (r15 === "elu") - n = wi(Z.ELU, e); - else if (r15 === "relu6") - n = wi(Z.RELU6, e); - else if (r15 === "prelu") - n = qc(fe.PRELU, e); - else if (r15 === "sigmoid") - n = wi(Z.SIGMOID, e); - else if (r15 === "leakyrelu") - n = wi(Z.LEAKYRELU, e); + if (r16 === "linear") + n = Ri(Z.LINEAR); + else if (r16 === "relu") + n = Ri(Z.RELU, t10); + else if (r16 === "elu") + n = Ri(Z.ELU, t10); + else if (r16 === "relu6") + n = Ri(Z.RELU6, t10); + else if (r16 === "prelu") + n = ec(fe.PRELU, t10); + else if (r16 === "sigmoid") + n = Ri(Z.SIGMOID, t10); + else if (r16 === "leakyrelu") + n = Ri(Z.LEAKYRELU, t10); else - throw new Error(`Activation ${r15} has not been implemented for the WebGPU backend.`); - let a = Ae(e ? 4 : 1), i = ""; - return t8 ? i = ` + throw new Error(`Activation ${r16} has not been implemented for the WebGPU backend.`); + let a = Ae(t10 ? 4 : 1), i = ""; + return e ? i = ` fn activation(a : ${a}, coords : vec${o}) -> ${a} { let b = getPreluActivationWeightsByOutputCoords(coords); ${n} @@ -28049,23 +28145,23 @@ function dr(r15, t8 = false, e = false, o = 3) { ${n} }`, i; } -function Qr(r15, t8) { +function no(r16, e) { return ` - ${r15 ? "value = value + getBiasByOutputCoords(coords);" : ""} - ${t8 ? "value = activation(value, coords);" : ""} + ${r16 ? "value = value + getBiasByOutputCoords(coords);" : ""} + ${e ? "value = activation(value, coords);" : ""} `; } -function Zv(r15, t8, e = false, o = false, n = false, s = 1) { - y.assert(r15 && s === 1 || !r15, () => `transposeA ${r15} is not compatible with component size ${s}`); +function mv(r16, e, t10 = false, o = false, n = false, s = 1) { + y.assert(r16 && s === 1 || !r16, () => `transposeA ${r16} is not compatible with component size ${s}`); let a = ` - ${r15 ? "value = getA(batch, col, row);" : "value = getA(batch, row, col);"} + ${r16 ? "value = getA(batch, col, row);" : "value = getA(batch, row, col);"} - `, i = t8 ? "value = getB(batch, col, row);" : "value = getB(batch, row, col);"; + `, i = e ? "value = getB(batch, col, row);" : "value = getB(batch, row, col);"; return ` fn mm_readA(batch: i32, row: i32, col: i32) -> ${Ae(s)} { var value = ${Ae(s)}(0.0); - ${e && n ? a : ` - ${r15 ? "if(row < uniforms.dimAOuter && col < uniforms.dimInner)" : "if(row < uniforms.aShape[1] && col < uniforms.aShape[2])"} + ${t10 && n ? a : ` + ${r16 ? "if(row < uniforms.dimAOuter && col < uniforms.dimInner)" : "if(row < uniforms.aShape[1] && col < uniforms.aShape[2])"} { ${a} } @@ -28080,60 +28176,60 @@ function Zv(r15, t8, e = false, o = false, n = false, s = 1) { } `; } -function dm(r15, t8, e, o, n = false, s = false, a = false, i = 1) { +function Sm(r16, e, t10, o, n = false, s = false, a = false, i = 1) { return ` - ${Zv(e, o, n, s, a, i)} + ${mv(t10, o, n, s, a, i)} fn mm_write(batch: i32, row: i32, col: i32, valueIn: ${Ae(i)}) { ${n && s ? "" : "if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)"} { var value = valueIn; let coords = vec3(batch, row, col); - ${Qr(r15, t8)} + ${no(r16, e)} setOutputAtCoords(coords[0], coords[1], coords[2], value); } } `; } -var Pie = (r15, t8) => r15 ? ` +var upe = (r16, e) => r16 ? ` mm_Asub[inputRow][inputCol] = mm_readA(batchA, kStart + inputRow, - globalRowStart + inputCol * ${t8}); + globalRowStart + inputCol * ${e}); ` : ` mm_Asub[inputRow][inputCol] = mm_readA(batchA, globalRow + innerRow, - kStart + inputCol * ${t8}); + kStart + inputCol * ${e}); `; -var Oie = (r15, t8, e, o) => { - if (r15) +var ppe = (r16, e, t10, o) => { + if (r16) return ` for (var k = 0; k < ${o}; k++) { let BCached0 = mm_Bsub[k][tileCol]; let ACached0 = mm_Asub[k][localRow]; - for (var i = 0; i < ${e}; i++) { + for (var i = 0; i < ${t10}; i++) { acc[i] = fma(BCached0, vec4(ACached0[i]), acc[i]); } }`; { let n = "", s = ""; - for (let a = 0; a < t8; a++) - n += `let BCached${a} = mm_Bsub[k * ${t8} + ${a}][tileCol];`, s += `acc[i] = fma(BCached${a}, vec4(ACached[${a}]), acc[i]);`; + for (let a = 0; a < e; a++) + n += `let BCached${a} = mm_Bsub[k * ${e} + ${a}][tileCol];`, s += `acc[i] = fma(BCached${a}, vec4(ACached[${a}]), acc[i]);`; return ` - for (var k = 0; k < ${o / t8}; k++) { + for (var k = 0; k < ${o / e}; k++) { ${n} - for (var i = 0; i < ${e}; i++) { + for (var i = 0; i < ${t10}; i++) { let ACached = mm_Asub[tileRow + i][k]; ${s} } }`; } }; -function Np(r15, t8, e = false, o = 32, n = false, s = 32, a = false) { - let i = t8[1] * r15[1], p = t8[0] * r15[0], u = e ? i : o, c = e ? o : i, l = u / t8[0], m = o / t8[1], d = r15[1], f = r15[0]; - return y.assert((e && l === 4 && r15[1] === 4 || !e && (l === 3 || l === 4)) && u % t8[0] === 0 && o % t8[1] === 0 && r15[0] === 4, () => `If transposeA ${e} is true, innerElementSize ${l} and workPerThread[1] ${r15[1]} must be 4. - Otherwise, innerElementSize ${l} must be 3 or 4. - tileAWidth ${u} must be divisible by workgroupSize[0]${t8[0]}. tileInner ${o} must be divisible by workgroupSize[1] ${t8[1]}. colPerThread ${r15[0]} must be 4.`), ` - var mm_Asub : array, ${u / l}>, ${c}>; - var mm_Bsub : array, ${p / r15[0]}>, ${o}>; +function Fp(r16, e, t10 = false, o = 32, n = false, s = 32, a = false) { + let i = e[1] * r16[1], p = e[0] * r16[0], u = t10 ? i : o, l = t10 ? o : i, c = u / e[0], m = o / e[1], d = r16[1], f = r16[0]; + return y.assert((t10 && c === 4 && r16[1] === 4 || !t10 && (c === 3 || c === 4)) && u % e[0] === 0 && o % e[1] === 0 && r16[0] === 4, () => `If transposeA ${t10} is true, innerElementSize ${c} and workPerThread[1] ${r16[1]} must be 4. + Otherwise, innerElementSize ${c} must be 3 or 4. + tileAWidth ${u} must be divisible by workgroupSize[0]${e[0]}. tileInner ${o} must be divisible by workgroupSize[1] ${e[1]}. colPerThread ${r16[0]} must be 4.`), ` + var mm_Asub : array, ${u / c}>, ${l}>; + var mm_Bsub : array, ${p / r16[0]}>, ${o}>; ${G()} { let localRow = i32(localId.y); @@ -28159,7 +28255,7 @@ function Np(r15, t8, e = false, o = 32, n = false, s = 32, a = false) { for (var innerRow = 0; innerRow < ${d}; innerRow++) { let inputRow = tileRow + innerRow; let inputCol = tileCol; - ${Pie(e, l)} + ${upe(t10, c)} } // Load one tile of B into local memory. @@ -28172,7 +28268,7 @@ function Np(r15, t8, e = false, o = 32, n = false, s = 32, a = false) { workgroupBarrier(); // Compute acc values for a single thread. - ${Oie(e, l, d, o)} + ${ppe(t10, c, d, o)} workgroupBarrier(); } @@ -28181,7 +28277,7 @@ function Np(r15, t8, e = false, o = 32, n = false, s = 32, a = false) { } }`; } -var ez = (r15) => r15 ? ` +var Hz = (r16) => r16 ? ` mm_Asub[inputRow][inputCol] = mm_readA(batchA, kStart + inputRow, globalRowStart + inputCol); @@ -28190,11 +28286,11 @@ var ez = (r15) => r15 ? ` globalRowStart + inputRow, kStart + inputCol); `; -var Mie = (r15) => r15 ? "let ACached = mm_Asub[k][tileRow + innerRow];" : "let ACached = mm_Asub[tileRow + innerRow][k];"; -function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) { - let p = r15[1] * t8[1], u = r15[0] * t8[0], c = e ? p : o, l = e ? o : p; - y.assert(l % t8[1] === 0 && c % t8[0] === 0 && o % t8[1] === 0, () => `tileAHight ${l} must be divisible by workgroupSize[1]${t8[1]}, tileAWidth ${c} must be divisible by workgroupSize[0]${t8[0]}, tileInner ${o} must be divisible by workgroupSize[1]${t8[1]}`); - let m = l / t8[1], d = c / t8[0], f = o / t8[1], h = r15[1], g = r15[0], x = a ? ` +var lpe = (r16) => r16 ? "let ACached = mm_Asub[k][tileRow + innerRow];" : "let ACached = mm_Asub[tileRow + innerRow][k];"; +function Pp(r16, e, t10 = false, o = 32, n = false, s = 32, a = false, i = false) { + let p = r16[1] * e[1], u = r16[0] * e[0], l = t10 ? p : o, c = t10 ? o : p; + y.assert(c % e[1] === 0 && l % e[0] === 0 && o % e[1] === 0, () => `tileAHight ${c} must be divisible by workgroupSize[1]${e[1]}, tileAWidth ${l} must be divisible by workgroupSize[0]${e[0]}, tileInner ${o} must be divisible by workgroupSize[1]${e[1]}`); + let m = c / e[1], d = l / e[0], f = o / e[1], h = r16[1], g = r16[0], x = a ? ` let localRow = i32(localId.y); let localCol = i32(localId.x); let globalRowStart = i32(workgroupId.y) * ${p}; @@ -28203,14 +28299,14 @@ function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) // Loop over shared dimension. for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. - for (var inputRow = localRow; inputRow < ${l}; inputRow = inputRow + ${t8[1]}) { - for (var inputCol = localCol; inputCol < ${c}; inputCol = inputCol + ${t8[0]}) { - ${ez(e)} + for (var inputRow = localRow; inputRow < ${c}; inputRow = inputRow + ${e[1]}) { + for (var inputCol = localCol; inputCol < ${l}; inputCol = inputCol + ${e[0]}) { + ${Hz(t10)} } } // Load one tile of B into local memory. - for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${t8[1]}) { - for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${t8[0]}) { + for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${e[1]}) { + for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${e[0]}) { mm_Bsub[inputRow][inputCol] = mm_readB(batchB, kStart + inputRow, globalColStart + inputCol); @@ -28223,10 +28319,10 @@ function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) var BCached : array; for (var k = 0; k < ${o}; k++) { for (var inner = 0; inner < ${g}; inner++) { - BCached[inner] = mm_Bsub[k][localCol + inner * ${t8[0]}]; + BCached[inner] = mm_Bsub[k][localCol + inner * ${e[0]}]; } for (var innerRow = 0; innerRow < ${h}; innerRow++) { - let ACached = ${e ? `mm_Asub[k][localRow + innerRow * ${t8[1]}];` : `mm_Asub[localRow + innerRow * ${t8[1]}][k];`} + let ACached = ${t10 ? `mm_Asub[k][localRow + innerRow * ${e[1]}];` : `mm_Asub[localRow + innerRow * ${e[1]}][k];`} for (var innerCol = 0; innerCol < ${g}; innerCol++) { acc[innerRow][innerCol] = fma(ACached, BCached[innerCol], acc[innerRow][innerCol]); @@ -28236,9 +28332,9 @@ function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) workgroupBarrier(); } for (var innerRow = 0; innerRow < ${h}; innerRow++) { - let gRow = globalRowStart + localRow + innerRow * ${t8[1]}; + let gRow = globalRowStart + localRow + innerRow * ${e[1]}; for (var innerCol = 0; innerCol < ${g}; innerCol++) { - let gCol = globalColStart + localCol + innerCol * ${t8[0]}; + let gCol = globalColStart + localCol + innerCol * ${e[0]}; mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); } } @@ -28260,7 +28356,7 @@ function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) for (var innerCol = 0; innerCol < ${d}; innerCol++) { let inputRow = tileRowA + innerRow; let inputCol = tileColA + innerCol; - ${ez(e)} + ${Hz(t10)} } } @@ -28285,7 +28381,7 @@ function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) } for (var innerRow = 0; innerRow < ${h}; innerRow++) { - ${Mie(e)} + ${lpe(t10)} for (var innerCol = 0; innerCol < ${g}; innerCol++) { acc[innerRow][innerCol] = fma(ACached, BCached[innerCol], acc[innerRow][innerCol]); @@ -28304,7 +28400,7 @@ function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) } `; return ` - var mm_Asub : array, ${l}>; + var mm_Asub : array, ${c}>; var mm_Bsub : array, ${o}>; ${G()} { @@ -28326,7 +28422,7 @@ function Tp(r15, t8, e = false, o = 32, n = false, s = 32, a = false, i = false) } `; } -var Lie = (r15) => r15 ? ` +var cpe = (r16) => r16 ? ` mm_readA(batchA, colA, globalRow), mm_readA(batchA, colA + 1, globalRow), mm_readA(batchA, colA + 2, globalRow), @@ -28337,18 +28433,18 @@ var Lie = (r15) => r15 ? ` mm_readA(batchA, globalRow, colA + 2), mm_readA(batchA, globalRow, colA + 3) `; -function Bie(r15, t8 = false) { - y.assert(r15[1] === 1 && r15[2] === 1, () => `A linear work group size is required. But got ${r15}.`); - let e = r15[0] * 4; +function mpe(r16, e = false) { + y.assert(r16[1] === 1 && r16[2] === 1, () => `A linear work group size is required. But got ${r16}.`); + let t10 = r16[0] * 4; return ` - var mm_Asub : array, ${r15[0]}>; + var mm_Asub : array, ${r16[0]}>; ${G()} { let tileCol = i32(localId.x); let globalCol = i32(globalId.x); let globalRow = i32(globalId.y); - let numTiles = (uniforms.dimInner - 1) / ${e} + 1; + let numTiles = (uniforms.dimInner - 1) / ${t10} + 1; let batch = i32(globalId.z); let batchA = batch % uniforms.aShape[0]; let batchB = batch % uniforms.bShape[0]; @@ -28358,13 +28454,13 @@ function Bie(r15, t8 = false) { // Loop over shared dimension. for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. - let colA = t * ${e} + tileCol * 4; - mm_Asub[tileCol] = vec4(${Lie(t8)}); + let colA = t * ${t10} + tileCol * 4; + mm_Asub[tileCol] = vec4(${cpe(e)}); workgroupBarrier(); // Compute acc values for a single thread. - for (var k = 0; k < ${e / 4}; k++) { - let rowB = t * ${e} + k * 4; + for (var k = 0; k < ${t10 / 4}; k++) { + let rowB = t * ${t10} + k * 4; let BCached = vec4(mm_readB(batchB, rowB, globalCol), mm_readB(batchB, rowB + 1, globalCol), mm_readB(batchB, rowB + 2, globalCol), @@ -28381,37 +28477,37 @@ function Bie(r15, t8 = false) { } `; } -var jg = class { - constructor(t8, e, o = false, n = false, s = null, a = null, i = null, p = false) { - this.variableNames = ["A", "B"], this.uniforms = "dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.outputShape = e, this.dispatchLayout = { x: [2], y: [1], z: [0] }; - let u = o ? t8[1] : t8[2]; - if (this.isVec4 = (u % 4 === 0 && !o || e[1] % 4 === 0 && o) && e[2] % 4 === 0 && !n, this.outputComponent = this.isVec4 ? 4 : 1, this.isVectorA = e[1] === 1 && !o, !this.isVec4 && this.isVectorA) +var ax = class { + constructor(e, t10, o = false, n = false, s = null, a = null, i = null, p = false) { + this.variableNames = ["A", "B"], this.uniforms = "dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.outputShape = t10, this.dispatchLayout = { x: [2], y: [1], z: [0] }; + let u = o ? e[1] : e[2]; + if (this.isVec4 = (u % 4 === 0 && !o || t10[1] % 4 === 0 && o) && t10[2] % 4 === 0 && !n, this.outputComponent = this.isVec4 ? 4 : 1, this.isVectorA = t10[1] === 1 && !o, !this.isVec4 && this.isVectorA) this.elementsPerThread = [1, 1, 1], this.workgroupSize = [32, 1, 1]; else { - let m = Yv(e[1], u, e[2], o); + let m = lv(t10[1], u, t10[2], o); this.workgroupSize = m.workgroupSize, this.elementsPerThread = m.elementsPerThread; } this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, this.elementsPerThread); - let c = s != null, l = i != null; - c && this.variableNames.push("bias"), l && this.variableNames.push("preluActivationWeights"), this.sequentialAccessByThreads = p, this.transposeA = o, this.transposeB = n, this.addBias = c, this.activation = a, this.hasPreluActivationWeights = l, [this.fitAOuter, this.fitBOuter, this.fitInner] = this.getShapeFit(e[1], e[2], u), this.shaderKey = `matMulPacked_${this.elementsPerThread}_${o}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`; + let l = s != null, c = i != null; + l && this.variableNames.push("bias"), c && this.variableNames.push("preluActivationWeights"), this.sequentialAccessByThreads = p, this.transposeA = o, this.transposeB = n, this.addBias = l, this.activation = a, this.hasPreluActivationWeights = c, [this.fitAOuter, this.fitBOuter, this.fitInner] = this.getShapeFit(t10[1], t10[2], u), this.shaderKey = `matMulPacked_${this.elementsPerThread}_${o}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`; } - getShapeFit(t8, e, o) { + getShapeFit(e, t10, o) { let n = this.workgroupSize[1] * this.elementsPerThread[1], s = this.workgroupSize[0] * this.elementsPerThread[0]; !this.isVec4 && this.isVectorA ? this.tileInner = this.workgroupSize[0] * 4 : this.tileInner = s; - let a = t8 % n === 0, i = e % s === 0, p = o % this.tileInner === 0; + let a = e % n === 0, i = t10 % s === 0, p = o % this.tileInner === 0; return [a, i, p]; } getUserCode() { return ` - ${dr(this.activation, this.hasPreluActivationWeights, this.isVec4)} - ${dm(this.addBias, this.activation, false, this.transposeB, this.fitAOuter, this.fitBOuter, this.fitInner, this.isVec4 ? 4 : 1)} - ${this.isVec4 ? Np(this.elementsPerThread, this.workgroupSize, this.transposeA, this.tileInner, false, null, true) : this.isVectorA ? Bie(this.workgroupSize, this.transposeA) : Tp(this.elementsPerThread, this.workgroupSize, this.transposeA, this.tileInner, false, null, this.sequentialAccessByThreads, true)} + ${gr(this.activation, this.hasPreluActivationWeights, this.isVec4)} + ${Sm(this.addBias, this.activation, false, this.transposeB, this.fitAOuter, this.fitBOuter, this.fitInner, this.isVec4 ? 4 : 1)} + ${this.isVec4 ? Fp(this.elementsPerThread, this.workgroupSize, this.transposeA, this.tileInner, false, null, true) : this.isVectorA ? mpe(this.workgroupSize, this.transposeA) : Pp(this.elementsPerThread, this.workgroupSize, this.transposeA, this.tileInner, false, null, this.sequentialAccessByThreads, true)} `; } }; -function zie(r15) { +function dpe(r16) { return ` - var sumValues : array; + var sumValues : array; ${G()} { let coords = getOutputCoords(); let batch = coords[0]; @@ -28421,7 +28517,7 @@ function zie(r15) { let col = coords[2]; var sum = 0.0; let Length = uniforms.dimInner; - for (var k = i32(localId.x); k < Length; k = k + ${r15}) { + for (var k = i32(localId.x); k < Length; k = k + ${r16}) { let dataA = mm_readA(batchA, row, k); let dataB = mm_readB(batchB, k, col); sum = sum + dataA * dataB; @@ -28429,7 +28525,7 @@ function zie(r15) { sumValues[localId.x] = sum; workgroupBarrier(); - for(var currentSize = ${r15 / 2}u; currentSize > 1u; + for(var currentSize = ${r16 / 2}u; currentSize > 1u; currentSize = currentSize / 2u) { if (localId.x < currentSize) { @@ -28445,25 +28541,25 @@ function zie(r15) { } `; } -var Xg = class { - constructor(t8, e = false, o = false, n = null, s = null, a = null) { - this.variableNames = ["A", "B"], this.uniforms = "dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.workgroupSize = [256, 1, 1], this.outputShape = t8, this.dispatchLayout = { x: [], y: [1, 2], z: [0] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize); +var ix = class { + constructor(e, t10 = false, o = false, n = null, s = null, a = null) { + this.variableNames = ["A", "B"], this.uniforms = "dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.workgroupSize = [256, 1, 1], this.outputShape = e, this.dispatchLayout = { x: [], y: [1, 2], z: [0] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize); let i = n != null, p = a != null; - i && this.variableNames.push("bias"), p && this.variableNames.push("preluActivationWeights"), this.transposeA = e, this.transposeB = o, this.addBias = i, this.activation = s, this.hasPreluActivationWeights = p, this.shaderKey = `matMulReduce_${this.activation}_${e}_${o}`; + i && this.variableNames.push("bias"), p && this.variableNames.push("preluActivationWeights"), this.transposeA = t10, this.transposeB = o, this.addBias = i, this.activation = s, this.hasPreluActivationWeights = p, this.shaderKey = `matMulReduce_${this.activation}_${t10}_${o}`; } getUserCode() { return ` - ${dr(this.activation, this.hasPreluActivationWeights)} - ${dm(this.addBias, this.activation, this.transposeA, this.transposeB)} - ${zie(this.workgroupSize[0])} + ${gr(this.activation, this.hasPreluActivationWeights)} + ${Sm(this.addBias, this.activation, this.transposeA, this.transposeB)} + ${dpe(this.workgroupSize[0])} `; } }; -function Vie(r15) { - let t8 = r15[1], e = r15[0], o = t8 > e ? t8 : e; +function fpe(r16) { + let e = r16[1], t10 = r16[0], o = e > t10 ? e : t10; return ` - var mm_Asub : array, ${t8}>; - var mm_Bsub : array, ${o}>; + var mm_Asub : array, ${e}>; + var mm_Bsub : array, ${o}>; // If the output size is small for matrix multiplication, avoid to use vec4 // and handle some elements per thread to optimally utilize the ALU. @@ -28515,68 +28611,68 @@ function Vie(r15) { } `; } -var Yg = class { - constructor(t8, e, o, n = false, s = false, a = null, i = null, p = null) { +var ux = class { + constructor(e, t10, o, n = false, s = false, a = null, i = null, p = null) { this.variableNames = ["A", "B"], this.uniforms = "dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.workgroupSize = [16, 8, 1], this.outputShape = o, this.dispatchLayout = { x: [2], y: [1], z: [0] }, this.dispatch = [Math.ceil(o[2] / this.workgroupSize[0]), Math.ceil(o[1] / this.workgroupSize[1]), o[0]]; let u = a != null; u && this.variableNames.push("bias"); - let c = p != null; - c && this.variableNames.push("preluActivationWeights"), this.transposeA = n, this.transposeB = s, this.addBias = u, this.activation = i, this.hasPreluActivationWeights = c, this.shaderKey = `matMulSmallOutputSize_${this.activation}_${n}_${s}`; + let l = p != null; + l && this.variableNames.push("preluActivationWeights"), this.transposeA = n, this.transposeB = s, this.addBias = u, this.activation = i, this.hasPreluActivationWeights = l, this.shaderKey = `matMulSmallOutputSize_${this.activation}_${n}_${s}`; } getUserCode() { return ` - ${dr(this.activation, this.hasPreluActivationWeights)} - ${dm(this.addBias, this.activation, this.transposeA, this.transposeB)} - ${Vie(this.workgroupSize)} + ${gr(this.activation, this.hasPreluActivationWeights)} + ${Sm(this.addBias, this.activation, this.transposeA, this.transposeB)} + ${fpe(this.workgroupSize)} `; } }; -var Qg = class { - constructor(t8, e, o = false, n = false) { - this.variableNames = ["A", "B"], this.uniforms = "dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.workgroupSize = [8, 8, 1], this.atomic = true, this.splitedDimInner = 128, y.assert(t8[0] === 1, () => "MatMulSplitKProgram only supports batch = 1."), this.outputShape = t8, this.dispatchLayout = { x: [2], y: [1], z: [0, 3] }; - let s = (o && this.outputShape[1] % 4 === 0 || !o && e % 4 === 0) && this.outputShape[2] % 4 === 0; - this.elementsPerThread = [4, 4, this.splitedDimInner], this.outputComponent = s ? 4 : 1, s || (this.outputShape[1] < 16 && (this.elementsPerThread[1] = 1), this.outputShape[2] < 16 && (this.elementsPerThread[0] = 1)), this.dispatch = H(this.dispatchLayout, [this.outputShape[0], this.outputShape[1], this.outputShape[2], e], this.workgroupSize, this.elementsPerThread), this.transposeA = o, this.transposeB = n, this.shaderKey = `matMulSplitK_${o}_${n}_${this.elementsPerThread}_${this.outputComponent}`; +var px = class { + constructor(e, t10, o = false, n = false) { + this.variableNames = ["A", "B"], this.uniforms = "dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.workgroupSize = [8, 8, 1], this.atomic = true, this.splitedDimInner = 128, y.assert(e[0] === 1, () => "MatMulSplitKProgram only supports batch = 1."), this.outputShape = e, this.dispatchLayout = { x: [2], y: [1], z: [0, 3] }; + let s = (o && this.outputShape[1] % 4 === 0 || !o && t10 % 4 === 0) && this.outputShape[2] % 4 === 0; + this.elementsPerThread = [4, 4, this.splitedDimInner], this.outputComponent = s ? 4 : 1, s || (this.outputShape[1] < 16 && (this.elementsPerThread[1] = 1), this.outputShape[2] < 16 && (this.elementsPerThread[0] = 1)), this.dispatch = H(this.dispatchLayout, [this.outputShape[0], this.outputShape[1], this.outputShape[2], t10], this.workgroupSize, this.elementsPerThread), this.transposeA = o, this.transposeB = n, this.shaderKey = `matMulSplitK_${o}_${n}_${this.elementsPerThread}_${this.outputComponent}`; } getUserCode() { - let t8 = this.outputComponent; + let e = this.outputComponent; return ` - ${Zv(false, this.transposeB, false, false, false, t8)} - fn mm_write(batch: i32, row : i32, col : i32, value : ${Ae(t8)}) { + ${mv(false, this.transposeB, false, false, false, e)} + fn mm_write(batch: i32, row : i32, col : i32, value : ${Ae(e)}) { if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) { let coords = vec3(batch, row, col); let flatIndex = getOutputIndexFromCoords(coords); // The problem is that we should initialize output to zero before using. // Otherwise, the original value will be added to the result. - for (var i = 0; i < ${t8}; i = i + 1) { - ${Yr("&result[flatIndex + i]", `${t8 > 1 ? "value[i]" : "value"}`, "float32")} + for (var i = 0; i < ${e}; i = i + 1) { + ${oo("&result[flatIndex + i]", `${e > 1 ? "value[i]" : "value"}`, "float32")} } } } - ${t8 === 4 ? Np(this.elementsPerThread, this.workgroupSize, this.transposeA, 32, true, this.splitedDimInner) : Tp(this.elementsPerThread, this.workgroupSize, this.transposeA, 32, true, this.splitedDimInner)} + ${e === 4 ? Fp(this.elementsPerThread, this.workgroupSize, this.transposeA, 32, true, this.splitedDimInner) : Pp(this.elementsPerThread, this.workgroupSize, this.transposeA, 32, true, this.splitedDimInner)} `; } }; -var Zg = class { - constructor(t8, e = null, o = null, n = null) { - this.uniforms = "", this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.addBias = e != null, this.hasPreluActivationWeights = n != null, this.activation = o, this.addBias && this.variableNames.push("bias"), this.hasPreluActivationWeights && this.variableNames.push("preluActivationWeights"), this.shaderKey = `biasActivation_${o}`; +var lx = class { + constructor(e, t10 = null, o = null, n = null) { + this.uniforms = "", this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.addBias = t10 != null, this.hasPreluActivationWeights = n != null, this.activation = o, this.addBias && this.variableNames.push("bias"), this.hasPreluActivationWeights && this.variableNames.push("preluActivationWeights"), this.shaderKey = `biasActivation_${o}`; } getUserCode() { return ` - ${dr(this.activation, this.hasPreluActivationWeights)} + ${gr(this.activation, this.hasPreluActivationWeights)} ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); var value = getXByOutputIndex(index); - ${Qr(this.addBias, this.activation)} + ${no(this.addBias, this.activation)} setOutputAtIndex(index, value); } } `; } }; -var Jg = class { - constructor(t8) { - this.variableNames = [], this.outputShape = [], this.uniforms = "value : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "fill"; +var cx = class { + constructor(e) { + this.variableNames = [], this.outputShape = [], this.uniforms = "value : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "fill"; } getUserCode() { return ` @@ -28588,42 +28684,42 @@ var Jg = class { `; } }; -function vt(r15) { - let { backend: t8, attrs: e } = r15, { shape: o, value: n } = e, { dtype: s } = e; +function Nt(r16) { + let { backend: e, attrs: t10 } = r16, { shape: o, value: n } = t10, { dtype: s } = t10; if (s = s || y.inferDtype(n), s === "string") { let a = y.getArrayFromDType(s, y.sizeFromShape(o)); - return a.fill(n), t8.makeTensorInfo(o, s, a); + return a.fill(n), e.makeTensorInfo(o, s, a); } else { - let a = new Jg(o), i = [{ type: "float32", data: [n] }]; - return t8.runWebGPUProgram(a, [], s, i); + let a = new cx(o), i = [{ type: "float32", data: [n] }]; + return e.runWebGPUProgram(a, [], s, i); } } -var tz = { kernelName: sa, backendName: "webgpu", kernelFunc: vt }; -function pe(r15) { - let { inputs: t8, attrs: e } = r15, { x: o } = t8, { shape: n } = e, s = y.sizeFromShape(o.shape), a = y.inferFromImplicitShape(n, s), i = y.sizeFromShape(a); - return y.assert(s === i, () => `The new shape (${a}) has ${i} elements and the old shape (${o.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`), r15.backend.incRef(o.dataId), { dataId: o.dataId, shape: a, dtype: o.dtype }; +var Kz = { kernelName: da, backendName: "webgpu", kernelFunc: Nt }; +function le(r16) { + let { inputs: e, attrs: t10 } = r16, { x: o } = e, { shape: n } = t10, s = y.sizeFromShape(o.shape), a = y.inferFromImplicitShape(n, s), i = y.sizeFromShape(a); + return y.assert(s === i, () => `The new shape (${a}) has ${i} elements and the old shape (${o.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`), r16.backend.incRef(o.dataId), { dataId: o.dataId, shape: a, dtype: o.dtype }; } -var rz = { kernelName: da, backendName: "webgpu", kernelFunc: pe }; -function _p({ a: r15, b: t8, transposeA: e, transposeB: o, backend: n, bias: s = null, preluActivationWeights: a = null, leakyreluAlpha: i = 0, activation: p = null }) { - let u = r15.shape.length, c = t8.shape.length, l = e ? r15.shape[u - 2] : r15.shape[u - 1], m = o ? t8.shape[c - 1] : t8.shape[c - 2], d = e ? r15.shape[u - 1] : r15.shape[u - 2], f = o ? t8.shape[c - 2] : t8.shape[c - 1], h = r15.shape.slice(0, -2), g = t8.shape.slice(0, -2), x = y.sizeFromShape(h), b = y.sizeFromShape(g), S = Sr.assertAndGetBroadcastShape(r15.shape.slice(0, -2), t8.shape.slice(0, -2)).concat([d, f]); - y.assert(l === m, () => `Error in matMul: inner shapes (${l}) and (${m}) of Tensors with shapes ${r15.shape} and ${t8.shape} and transposeA=${e} and transposeB=${o} must match.`); - let k = e ? [x, l, d] : [x, d, l], _ = o ? [b, f, m] : [b, m, f], E = pe({ inputs: { x: r15 }, backend: n, attrs: { shape: k } }), R = pe({ inputs: { x: t8 }, backend: n, attrs: { shape: _ } }), D = [E, R], P = Math.max(x, b), O = [E, R], M = [{ type: "int32", data: [d] }, { type: "int32", data: [f] }, { type: "int32", data: [l] }], L, B, z = [P, d, f], U = A().get("WEBGPU_MATMUL_PROGRAM_TYPE"); +var qz = { kernelName: Ca, backendName: "webgpu", kernelFunc: le }; +function Op({ a: r16, b: e, transposeA: t10, transposeB: o, backend: n, bias: s = null, preluActivationWeights: a = null, leakyreluAlpha: i = 0, activation: p = null }) { + let u = r16.shape.length, l = e.shape.length, c = t10 ? r16.shape[u - 2] : r16.shape[u - 1], m = o ? e.shape[l - 1] : e.shape[l - 2], d = t10 ? r16.shape[u - 1] : r16.shape[u - 2], f = o ? e.shape[l - 2] : e.shape[l - 1], h = r16.shape.slice(0, -2), g = e.shape.slice(0, -2), x = y.sizeFromShape(h), b = y.sizeFromShape(g), S = kr.assertAndGetBroadcastShape(r16.shape.slice(0, -2), e.shape.slice(0, -2)).concat([d, f]); + y.assert(c === m, () => `Error in matMul: inner shapes (${c}) and (${m}) of Tensors with shapes ${r16.shape} and ${e.shape} and transposeA=${t10} and transposeB=${o} must match.`); + let k = t10 ? [x, c, d] : [x, d, c], T = o ? [b, f, m] : [b, m, f], E = le({ inputs: { x: r16 }, backend: n, attrs: { shape: k } }), R = le({ inputs: { x: e }, backend: n, attrs: { shape: T } }), D = [E, R], F = Math.max(x, b), O = [E, R], M = [{ type: "int32", data: [d] }, { type: "int32", data: [f] }, { type: "int32", data: [c] }], L, B, z = [F, d, f], U = A().get("WEBGPU_MATMUL_PROGRAM_TYPE"); if (U < 0) { - let q = A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"), Y = q > 0 ? q : n.thresholdToIncreaseWorkgroups, J = P * Math.ceil(d / 32) * Math.ceil(f / 32); - J <= Y || d <= 8 && J <= Y * 2 ? P * d * f <= 128 ? U = Mo.MatMulReduceProgram : P === 1 && m >= 2e3 ? U = Mo.MatMulSplitKProgram : U = Mo.MatMulSmallOutputSizeProgram : U = Mo.MatMulPackedProgram; + let q = A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"), Y = q > 0 ? q : n.thresholdToIncreaseWorkgroups, J = F * Math.ceil(d / 32) * Math.ceil(f / 32); + J <= Y || d <= 8 && J <= Y * 2 ? F * d * f <= 128 ? U = pn.MatMulReduceProgram : F === 1 && m >= 2e3 ? U = pn.MatMulSplitKProgram : U = pn.MatMulSmallOutputSizeProgram : U = pn.MatMulPackedProgram; } switch (U) { - case Mo.MatMulReduceProgram: - L = new Xg(z, e, o, s, p, a); + case pn.MatMulReduceProgram: + L = new ix(z, t10, o, s, p, a); break; - case Mo.MatMulSplitKProgram: { - if (B = vt({ backend: n, attrs: { shape: z, value: 0, dtype: r15.dtype } }), L = new Qg(z, m, e, o), s || p) { - B = n.runWebGPUProgram(L, O, r15.dtype, M, B); - let Y = new Zg(B.shape, s, p, a), J = null, re = [B]; + case pn.MatMulSplitKProgram: { + if (B = Nt({ backend: n, attrs: { shape: z, value: 0, dtype: r16.dtype } }), L = new px(z, m, t10, o), s || p) { + B = n.runWebGPUProgram(L, O, r16.dtype, M, B); + let Y = new lx(B.shape, s, p, a), J = null, re = [B]; s && re.push(s), a && re.push(a), p === "leakyrelu" && (J = [{ type: "float32", data: [i] }], Y.uniforms += " alpha : f32,"); let ne = n.runWebGPUProgram(Y, re, B.dtype, J); D.push(B); - let ee = pe({ inputs: { x: ne }, backend: n, attrs: { shape: S } }); + let ee = le({ inputs: { x: ne }, backend: n, attrs: { shape: S } }); D.push(ne); for (let oe of D) n.disposeData(oe.dataId); @@ -28631,37 +28727,37 @@ function _p({ a: r15, b: t8, transposeA: e, transposeB: o, backend: n, bias: s = } break; } - case Mo.MatMulSmallOutputSizeProgram: - L = new Yg(k, _, z, e, o, s, p, a); + case pn.MatMulSmallOutputSizeProgram: + L = new ux(k, T, z, t10, o, s, p, a); break; - case Mo.MatMulPackedProgram: + case pn.MatMulPackedProgram: let q = n.adapterInfo.isIntel(); - L = new jg(k, z, e, o, s, p, a, q); + L = new ax(k, z, t10, o, s, p, a, q); break; default: throw new Error(`Unsupported MatMulProgramType ${U}.`); } - s && O.push(s), a && O.push(a), p === "leakyrelu" && (M.push({ type: "float32", data: [i] }), L.uniforms += " alpha : f32,"), B = n.runWebGPUProgram(L, O, r15.dtype, M, B); - let j = pe({ inputs: { x: B }, backend: n, attrs: { shape: S } }); + s && O.push(s), a && O.push(a), p === "leakyrelu" && (M.push({ type: "float32", data: [i] }), L.uniforms += " alpha : f32,"), B = n.runWebGPUProgram(L, O, r16.dtype, M, B); + let j = le({ inputs: { x: B }, backend: n, attrs: { shape: S } }); D.push(B); for (let q of D) n.disposeData(q.dataId); return j; } -function Wie(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s, bias: a, preluActivationWeights: i } = t8, { transposeA: p, transposeB: u, activation: c, leakyreluAlpha: l } = o; - return _p({ a: n, b: s, transposeA: p, transposeB: u, backend: e, bias: a, preluActivationWeights: i, leakyreluAlpha: l, activation: c }); +function hpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s, bias: a, preluActivationWeights: i } = e, { transposeA: p, transposeB: u, activation: l, leakyreluAlpha: c } = o; + return Op({ a: n, b: s, transposeA: p, transposeB: u, backend: t10, bias: a, preluActivationWeights: i, leakyreluAlpha: c, activation: l }); } -var oz = { kernelName: So, backendName: "webgpu", kernelFunc: Wie }; -var fm = class { - constructor(t8, e, o) { - this.variableNames = ["AReal", "AImag", "BReal", "BImag"], this.workgroupSize = [128, 1, 1], this.size = true, this.outputShape = w.assertAndGetBroadcastShape(e, o), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = `binaryOpComplex_${t8}`, this.op = t8; +var jz = { kernelName: qo, backendName: "webgpu", kernelFunc: hpe }; +var Im = class { + constructor(e, t10, o) { + this.variableNames = ["AReal", "AImag", "BReal", "BImag"], this.workgroupSize = [128, 1, 1], this.size = true, this.outputShape = C.assertAndGetBroadcastShape(t10, o), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = `binaryOpComplex_${e}`, this.op = e; } getUserCode() { return ` fn binaryOpComplex( areal : f32, aimag : f32, breal : f32, bimag : f32) -> f32 { - ${qc(this.op, false)} + ${ec(this.op, false)} } ${G("index")} { @@ -28676,27 +28772,27 @@ var fm = class { `; } }; -var Si = class { - constructor(t8, e, o) { - if (this.size = true, this.variableNames = ["A", "B"], this.outputShape = w.assertAndGetBroadcastShape(e, o), this.dispatchLayout = X(this.outputShape), this.op = t8, this.useSharedMemoryWithA = e.length <= 1 && o.length > 1 && e[0] < 128, this.useSharedMemoryWithB = o.length <= 1 && e.length > 1 && o[0] < 128, this.useSharedMemoryWithA || this.useSharedMemoryWithB) - this.outputComponent = 1, this.variableComponents = [1, 1], this.lastDimensionSize = this.useSharedMemoryWithB ? o[0] : e[0], this.shaderKey = `binary_${t8}_${this.lastDimensionSize}`, this.type = "shared", this.workgroupSize = [256, 1, 1]; +var Di = class { + constructor(e, t10, o) { + if (this.size = true, this.variableNames = ["A", "B"], this.outputShape = C.assertAndGetBroadcastShape(t10, o), this.dispatchLayout = X(this.outputShape), this.op = e, this.useSharedMemoryWithA = t10.length <= 1 && o.length > 1 && t10[0] < 128, this.useSharedMemoryWithB = o.length <= 1 && t10.length > 1 && o[0] < 128, this.useSharedMemoryWithA || this.useSharedMemoryWithB) + this.outputComponent = 1, this.variableComponents = [1, 1], this.lastDimensionSize = this.useSharedMemoryWithB ? o[0] : t10[0], this.shaderKey = `binary_${e}_${this.lastDimensionSize}`, this.type = "shared", this.workgroupSize = [256, 1, 1]; else { - let n = e.length > 0 && e[e.length - 1] % 4 === 0, s = o.length > 0 && o[o.length - 1] % 4 === 0; - n && s ? (this.outputComponent = 4, this.variableComponents = [4, 4]) : n && (y.isScalarShape(o) || o[o.length - 1] === 1) || s && (y.isScalarShape(e) || e[e.length - 1] === 1) ? (this.outputComponent = 4, this.variableComponents = n ? [4, 1] : [1, 4]) : (this.outputComponent = 1, this.variableComponents = [1, 1]), this.type = "nonshared", this.shaderKey = `binary_${t8}_${this.variableComponents}`, this.workgroupSize = [128, 1, 1]; + let n = t10.length > 0 && t10[t10.length - 1] % 4 === 0, s = o.length > 0 && o[o.length - 1] % 4 === 0; + n && s ? (this.outputComponent = 4, this.variableComponents = [4, 4]) : n && (y.isScalarShape(o) || o[o.length - 1] === 1) || s && (y.isScalarShape(t10) || t10[t10.length - 1] === 1) ? (this.outputComponent = 4, this.variableComponents = n ? [4, 1] : [1, 4]) : (this.outputComponent = 1, this.variableComponents = [1, 1]), this.type = "nonshared", this.shaderKey = `binary_${e}_${this.variableComponents}`, this.workgroupSize = [128, 1, 1]; } this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.outputComponent, 1, 1]); } getUserCode() { - let t8, e = this.outputComponent === 4 ? "vec4" : "f32", o = ` - fn binaryOperation(a : ${e}, b : ${e}) -> ${e} { - ${qc(this.op, this.outputComponent === 4)} + let e, t10 = this.outputComponent === 4 ? "vec4" : "f32", o = ` + fn binaryOperation(a : ${t10}, b : ${t10}) -> ${t10} { + ${ec(this.op, this.outputComponent === 4)} }; `; if (this.type === "shared") { let n = this.lastDimensionSize > 1 ? `coords[${this.outputShape.length - 1}]` : "0", s = this.useSharedMemoryWithB ? `let a = getAByOutputIndex(index); let b = sharedBuf[${n}];` : `let a = sharedBuf[${n}]; let b = getBByOutputIndex(index);`; - t8 = ` + e = ` ${o} var sharedBuf : array; ${G("index")} { @@ -28715,145 +28811,1191 @@ var Si = class { } `; } else - t8 = ` + e = ` ${o} ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index * ${this.outputComponent}); - let a = ${e}(getAByOutputCoords(coords)); - let b = ${e}(getBByOutputCoords(coords)); + let a = ${t10}(getAByOutputCoords(coords)); + let b = ${t10}(getBByOutputCoords(coords)); setOutputAtIndex(index, binaryOperation(a, b)); } } `; - return t8; + return e; + } +}; +function Pt(r16) { + let { inputs: e } = r16, { x: t10 } = e; + return r16.backend.incRef(t10.dataId), { dataId: t10.dataId, shape: t10.shape, dtype: t10.dtype }; +} +var Xz = { kernelName: vo, backendName: "webgpu", kernelFunc: Pt }; +function Uo(r16) { + let { inputs: e, backend: t10 } = r16, { real: o, imag: n } = e, s = t10.makeTensorInfo(o.shape, "complex64"), a = t10.tensorMap.get(s.dataId), i = Pt({ inputs: { x: o }, backend: t10 }), p = Pt({ inputs: { x: n }, backend: t10 }); + return a.complexTensorInfos = { real: i, imag: p }, s; +} +var Yz = { kernelName: ei, backendName: "webgpu", kernelFunc: Uo }; +var so = class { + constructor(e, t10, o = "") { + this.variableNames = ["A"], this.size = true; + let n = 128; + this.workgroupSize = [n, 1, 1], this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.op = t10, o !== "" && (this.uniforms = o), this.shaderKey = `unary_${t10}`; + } + getUserCode() { + return ` + fn unaryOperation(a : f32) -> f32 { + ${Ri(this.op, false)} + } + ${G("index")} { + if (index < uniforms.size) { + let a = getAByOutputIndex(index); + setOutputAtIndex(index, unaryOperation(a)); + } + } + `; + } +}; +function ye({ opType: r16, cpuKernelImpl: e, dtype: t10 }) { + return ({ inputs: o, backend: n }) => { + let { x: s } = o, a = n, i = t10 || s.dtype; + if (a.shouldExecuteOnCPU([s]) && e != null) { + let u = a.tensorMap.get(s.dataId), l = e(u.values, i); + return a.makeTensorInfo(s.shape, i, l); + } + let p = new so(s.shape, r16); + return a.runWebGPUProgram(p, [s], i); + }; +} +function tt({ opType: r16, cpuKernelImpl: e, supportsComplex: t10 = false, dtype: o }) { + return ({ inputs: n, backend: s }) => { + let { a, b: i } = n, p = s; + if (t10 && a.dtype === "complex64") { + let c = p.tensorMap.get(a.dataId), m = p.tensorMap.get(i.dataId), d, f; + if (r16 !== fe.MUL) + [d, f] = [[c.complexTensorInfos.real, m.complexTensorInfos.real], [c.complexTensorInfos.imag, m.complexTensorInfos.imag]].map((g) => { + let [x, b] = g, w = { dataId: x.dataId, dtype: x.dtype, shape: a.shape }, S = { dataId: b.dataId, dtype: b.dtype, shape: i.shape }, k = new Di(r16, a.shape, i.shape); + return p.runWebGPUProgram(k, [w, S], pt(x.dtype, b.dtype)); + }); + else { + let g = new Im(fe.COMPLEX_MULTIPLY_REAL, a.shape, i.shape), x = new Im(fe.COMPLEX_MULTIPLY_IMAG, a.shape, i.shape), b = [{ dataId: c.complexTensorInfos.real.dataId, dtype: c.complexTensorInfos.real.dtype, shape: a.shape }, { dataId: c.complexTensorInfos.imag.dataId, dtype: c.complexTensorInfos.imag.dtype, shape: a.shape }, { dataId: m.complexTensorInfos.real.dataId, dtype: m.complexTensorInfos.real.dtype, shape: i.shape }, { dataId: m.complexTensorInfos.imag.dataId, dtype: m.complexTensorInfos.imag.dtype, shape: i.shape }]; + d = p.runWebGPUProgram(g, b, "float32"), f = p.runWebGPUProgram(x, b, "float32"); + } + let h = Uo({ inputs: { real: d, imag: f }, backend: p }); + return p.disposeData(d.dataId), p.disposeData(f.dataId), h; + } + let u = o || pt(a.dtype, i.dtype); + if ((a.dtype === "string" || i.dtype === "string" || p.shouldExecuteOnCPU([a, i])) && e != null) { + let c = p.tensorMap.get(a.dataId).values, m = p.tensorMap.get(i.dataId).values, d = a.dtype === "string" ? C.fromUint8ToStringArray(c) : c, f = a.dtype === "string" ? C.fromUint8ToStringArray(m) : m, [h, g] = e(a.shape, i.shape, d, f, u); + return p.makeTensorInfo(g, u, h); + } + let l = new Di(r16, a.shape, i.shape); + return p.runWebGPUProgram(l, [a, i], u); + }; +} +var Lv = {}; +qe(Lv, { addImpl: () => hv, bincountImpl: () => Jz, bincountReduceImpl: () => eV, bitwiseAndImpl: () => gv, castImpl: () => fv, ceilImpl: () => xv, concatImpl: () => tV, equalImpl: () => yv, expImpl: () => bv, expm1Impl: () => Cv, floorDivImpl: () => Sv, floorImpl: () => wv, gatherNdImpl: () => rV, gatherV2Impl: () => oV, greaterEqualImpl: () => vv, greaterImpl: () => Iv, lessEqualImpl: () => Nv, lessImpl: () => kv, linSpaceImpl: () => nV, logImpl: () => Tv, maxImpl: () => sV, maximumImpl: () => _v, minimumImpl: () => Ev, multiplyImpl: () => km, negImpl: () => aV, notEqualImpl: () => $v, prodImpl: () => iV, raggedGatherImpl: () => pV, raggedRangeImpl: () => cV, raggedTensorToTensorImpl: () => fV, rangeImpl: () => hV, rsqrtImpl: () => Av, scatterImpl: () => gV, sigmoidImpl: () => xV, simpleAbsImpl: () => Qz, sliceImpl: () => yV, sparseFillEmptyRowsImpl: () => bV, sparseReshapeImpl: () => CV, sparseSegmentReductionImpl: () => wV, sqrtImpl: () => SV, squaredDifferenceImpl: () => Fv, staticRegexReplaceImpl: () => Pv, stridedSliceImpl: () => IV, stringNGramsImpl: () => vV, stringSplitImpl: () => kV, stringToHashBucketFastImpl: () => NV, subImpl: () => Mv, tileImpl: () => TV, topKImpl: () => EV, transposeImpl: () => Rv, uniqueImpl: () => $V }); +function Ai(r16, e) { + Array.isArray(r16) || (r16 = [r16]), r16.forEach((t10) => { + t10 != null && y.assert(t10.dtype !== "complex64", () => `${e} does not support complex64 tensors in the CPU backend.`); + }); +} +function Qz(r16) { + let e = new Float32Array(r16.length); + for (let t10 = 0; t10 < r16.length; ++t10) + e[t10] = Math.abs(r16[t10]); + return e; +} +function ht(r16) { + return (e, t10, o, n, s) => { + let a = C.assertAndGetBroadcastShape(e, t10), i = a.length, p = y.computeStrides(a), u = y.sizeFromShape(a), l = y.getTypedArrayFromDType(s, u), c = e.length, m = t10.length, d = y.computeStrides(e), f = y.computeStrides(t10), h = C.getBroadcastDims(e, a), g = C.getBroadcastDims(t10, a); + if (h.length + g.length === 0) + for (let x = 0; x < l.length; ++x) + l[x] = r16(o[x % o.length], n[x % n.length]); + else + for (let x = 0; x < l.length; ++x) { + let b = y.indexToLoc(x, i, p), w = b.slice(-c); + h.forEach((E) => w[E] = 0); + let S = y.locToIndex(w, c, d), k = b.slice(-m); + g.forEach((E) => k[E] = 0); + let T = y.locToIndex(k, m, f); + l[x] = r16(o[S], n[T]); + } + return [l, a]; + }; +} +function tc(r16) { + let { inputs: e, backend: t10 } = r16, { real: o, imag: n } = e, s = t10.data.get(o.dataId).values, a = t10.data.get(n.dataId).values, i = t10.makeTensorInfo(o.shape, "complex64"), p = t10.data.get(i.dataId); + return p.complexTensorInfos = { real: t10.makeTensorInfo(o.shape, "float32", s), imag: t10.makeTensorInfo(n.shape, "float32", a) }, i; +} +function mx(r16, e, t10 = "float32") { + if (t10 === "complex64") { + let n = mx(r16, e, "float32"), s = mx(r16, e, "float32"); + return tc({ inputs: { real: n, imag: s }, backend: r16 }); + } + let o = y.makeZerosTypedArray(y.sizeFromShape(e), t10); + return r16.makeTensorInfo(e, t10, o); +} +function dv(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; + return t10.incRef(o.dataId), { dataId: o.dataId, shape: o.shape, dtype: o.dtype }; +} +function Zz(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = t10.data.get(o.dataId).complexTensorInfos.real, s = t10.data.get(n.dataId).values; + return t10.makeTensorInfo(n.shape, n.dtype, s); +} +function fv(r16, e, t10, o) { + if (o === "int32") { + let n = Int32Array.from(r16); + return [e, "int32", n]; + } + if (o === "bool") { + let n = y.toTypedArray([0], t10), [s, a] = ht((i, p) => i !== p ? 1 : 0)(e, [], r16, n, "bool"); + return [a, "bool", s]; + } + throw new Error(`Error in Cast: failed to cast ${t10} to ${o}`); +} +function vm(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dtype: s } = o; + if (s === "complex64") { + if (n.dtype === "complex64") + return dv({ inputs: { x: n }, backend: t10 }); + let l = mx(t10, n.shape, n.dtype), c = vm({ inputs: { x: n }, backend: t10, attrs: { dtype: "float32" } }), m = tc({ inputs: { real: c, imag: l }, backend: t10 }); + return t10.disposeIntermediateTensorInfo(l), t10.disposeIntermediateTensorInfo(c), m; + } + if (n.dtype === "complex64") { + let l = Zz({ inputs: { input: n }, backend: t10 }), c = vm({ inputs: { x: l }, backend: t10, attrs: { dtype: s } }); + return t10.disposeIntermediateTensorInfo(l), c; + } + if (!y.hasEncodingLoss(n.dtype, s)) { + let l = dv({ inputs: { x: n }, backend: t10 }); + return { dataId: l.dataId, shape: l.shape, dtype: s }; + } + let a = t10.data.get(n.dataId).values, [i, p, u] = fv(a, n.shape, n.dtype, s); + return t10.makeTensorInfo(i, p, u); +} +function wt(r16, e, t10, o) { + return t10 == null ? ({ inputs: n, backend: s }) => { + let { a, b: i } = n, p = s; + Ai([a, i], r16); + let u = p.data.get(a.dataId).values, l = p.data.get(i.dataId).values, c = a.dtype === "string" ? C.fromUint8ToStringArray(u) : u, m = a.dtype === "string" ? C.fromUint8ToStringArray(l) : l, d = o || a.dtype, [f, h] = e(a.shape, i.shape, c, m, d); + return p.makeTensorInfo(h, d, f); + } : ({ inputs: n, backend: s }) => { + let { a, b: i } = n, p = s; + if (a.dtype === "complex64" || i.dtype === "complex64") { + let u = vm({ inputs: { x: a }, backend: p, attrs: { dtype: "complex64" } }), l = p.data.get(u.dataId), c = l.complexTensorInfos.real, m = l.complexTensorInfos.imag, d = p.data.get(c.dataId).values, f = p.data.get(m.dataId).values, h = vm({ inputs: { x: i }, backend: p, attrs: { dtype: "complex64" } }), g = p.data.get(h.dataId), x = g.complexTensorInfos.real, b = g.complexTensorInfos.imag, w = p.data.get(x.dataId).values, S = p.data.get(b.dataId).values, [k, T, E] = t10(a.shape, i.shape, d, f, w, S), R = p.makeTensorInfo(E, "float32", k), D = p.makeTensorInfo(E, "float32", T), F = tc({ inputs: { real: R, imag: D }, backend: p }); + return p.disposeIntermediateTensorInfo(u), p.disposeIntermediateTensorInfo(h), p.disposeIntermediateTensorInfo(R), p.disposeIntermediateTensorInfo(D), F; + } else { + let u = p.data.get(a.dataId).values, l = p.data.get(i.dataId).values, c = o || a.dtype, [m, d] = e(a.shape, i.shape, u, l, c); + return p.makeTensorInfo(d, c, m); + } + }; +} +function rc(r16) { + return (e, t10, o, n, s, a) => { + let i = C.assertAndGetBroadcastShape(e, t10), p = y.sizeFromShape(i), u = i.length, l = y.computeStrides(i), c = y.getTypedArrayFromDType("float32", p), m = y.getTypedArrayFromDType("float32", p), d = C.getBroadcastDims(e, i), f = C.getBroadcastDims(t10, i), h = C.mergeRealAndImagArrays(o, n), g = C.mergeRealAndImagArrays(s, a), x = e.length, b = y.computeStrides(e), w = t10.length, S = y.computeStrides(t10); + if (d.length + f.length === 0) + for (let k = 0; k < c.length; k++) { + let T = k % h.length, E = k % g.length, R = r16(h[T * 2], h[T * 2 + 1], g[E * 2], g[E * 2 + 1]); + c[k] = R.real, m[k] = R.imag; + } + else + for (let k = 0; k < c.length; k++) { + let T = y.indexToLoc(k, u, l), E = T.slice(-x); + d.forEach((M) => E[M] = 0); + let R = y.locToIndex(E, x, b), D = T.slice(-w); + f.forEach((M) => D[M] = 0); + let F = y.locToIndex(D, w, S), O = r16(h[R * 2], h[R * 2 + 1], g[F * 2], g[F * 2 + 1]); + c[k] = O.real, m[k] = O.imag; + } + return [c, m, i]; + }; +} +var hv = ht((r16, e) => r16 + e); +var gpe = rc((r16, e, t10, o) => ({ real: r16 + t10, imag: e + o })); +var uLt = wt(Rr, hv, gpe); +function Jz(r16, e, t10, o, n) { + let s = y.sizeFromShape(o), a = y.makeZerosTypedArray(n, t10); + for (let i = 0; i < r16.length; i++) { + let p = r16[i]; + if (p < 0) + throw new Error("Input x must be non-negative!"); + p >= n || (s > 0 ? a[p] += e[i] : a[p] += 1); + } + return a; +} +function eV(r16, e, t10, o = false) { + let n = r16.shape[0], s = r16.shape[1], a = ie([n, t10], e.dtype); + for (let i = 0; i < n; i++) + for (let p = 0; p < s; p++) { + let u = r16.get(i, p); + if (u < 0) + throw new Error("Input x must be non-negative!"); + u >= t10 || (o ? a.set(1, i, u) : e.size > 0 ? a.set(a.get(i, u) + e.get(i, p), i, u) : a.set(a.get(i, u) + 1, i, u)); + } + return a; +} +var gv = ht((r16, e) => r16 & e); +var hLt = wt(_n, gv); +function Qt(r16) { + return (e, t10, o) => { + let n = y.getArrayFromDType(t10, e.length); + for (let s = 0; s < e.length; ++s) + n[s] = r16(e[s], o); + return n; + }; +} +function dx(r16, e, t10) { + let o = Qt(e); + return Wr(r16, o, t10); +} +function Wr(r16, e, t10) { + return ({ inputs: o, attrs: n, backend: s }) => { + let { x: a } = o; + Ai(a, r16); + let i = s, p = i.data.get(a.dataId).values, u; + if (a.dtype === "string") { + if (!Array.isArray(p)) + throw new Error("String tensor's value was not an instance of Array"); + u = C.fromUint8ToStringArray(p); + } else + u = p; + let l = t10 || a.dtype, c = e(u, l, n); + return i.makeTensorInfo(a.shape, l, c); + }; +} +var xv = Qt((r16) => Math.ceil(r16)); +var NLt = Wr(go, xv); +function tV(r16, e, t10, o) { + let n = y.getArrayFromDType(t10, y.sizeFromShape(e)); + if (o && t10 !== "string") { + let s = 0; + r16.forEach((a) => { + let i = y.sizeFromShape(a.shape); + n.set(a.vals, s), s += i; + }); + } else { + let s = 0; + r16.forEach((a) => { + let i = t10 === "string" ? C.fromUint8ToStringArray(a.vals) : a.vals, p = 0; + for (let u = 0; u < a.shape[0]; ++u) { + let l = u * e[1] + s; + for (let c = 0; c < a.shape[1]; ++c) + n[l + c] = i[p++]; + } + s += a.shape[1]; + }); + } + return n; +} +var yv = ht((r16, e) => r16 === e ? 1 : 0); +var ALt = wt(xo, yv, null, "bool"); +var bv = Qt((r16) => Math.exp(r16)); +var LLt = Wr(yo, bv, "float32"); +var Cv = Qt((r16) => Math.expm1(r16)); +var ULt = Wr(bo, Cv); +var wv = Qt((r16) => Math.floor(r16)); +var jLt = Wr(Co, wv); +var Sv = ht((r16, e) => Math.floor(r16 / e)); +var JLt = wt(wo, Sv, null, "int32"); +function rV(r16, e, t10, o, n, s, a, i, p) { + let u = ie([o, s], t10); + for (let l = 0; l < o; l++) { + let c = [], m = 0; + for (let d = 0; d < n; d++) { + let f = r16[l * n + d]; + m += f * a[d], c.push(f); + } + if (m < 0 || m >= p / s) + throw new Error(`Invalid indices: ${c} does not index into ${i}`); + for (let d = 0; d < s; d++) + u.values[l * s + d] = e.get(...e.indexToLoc(m * s + d)); + } + return u; +} +function oV(r16, e, t10) { + let o = ie(t10, r16.dtype); + for (let n = 0; n < o.size; ++n) { + let a = o.indexToLoc(n).slice(), i = a[0], p = a[2], u = e.locToIndex([i, p]); + a[2] = e.values[u]; + let l = r16.locToIndex(a); + 0 <= l && l < r16.values.length && (o.values[n] = r16.values[l]); + } + return o; +} +var Iv = ht((r16, e) => r16 > e ? 1 : 0); +var uBt = wt(So, Iv, null, "bool"); +var vv = ht((r16, e) => r16 >= e ? 1 : 0); +var dBt = wt(Io, vv, null, "bool"); +var kv = ht((r16, e) => r16 < e ? 1 : 0); +var yBt = wt(ko, kv, null, "bool"); +var Nv = ht((r16, e) => r16 <= e ? 1 : 0); +var IBt = wt(No, Nv, null, "bool"); +function nV(r16, e, t10) { + let o = (e - r16) / (t10 - 1), n = y.makeZerosTypedArray(t10, "float32"); + n[0] = r16; + for (let s = 1; s < n.length; s++) + n[s] = n[s - 1] + o; + return n; +} +var Tv = Qt((r16) => Math.log(r16)); +var $Bt = Wr(To, Tv); +function sV(r16, e, t10, o) { + let n = y.getTypedArrayFromDType(o, y.sizeFromShape(t10)); + for (let s = 0; s < n.length; ++s) { + let a = s * e, i = r16[a]; + for (let p = 0; p < e; ++p) { + let u = r16[a + p]; + (Number.isNaN(u) || u > i) && (i = u); + } + n[s] = i; + } + return n; +} +var _v = ht((r16, e) => Math.max(r16, e)); +var MBt = wt(_o, _v); +var Ev = ht((r16, e) => Math.min(r16, e)); +var WBt = wt(Eo, Ev); +var km = ht((r16, e) => r16 * e); +var xpe = rc((r16, e, t10, o) => ({ real: r16 * t10 - e * o, imag: r16 * o + e * t10 })); +var qBt = wt($o, km, xpe); +function aV(r16, e, t10) { + let o = y.createScalarValue(-1, t10); + return km([], e, o, r16, t10); +} +var $v = ht((r16, e) => r16 !== e ? 1 : 0); +var rzt = wt(Ro, $v, null, "bool"); +function Rv(r16, e, t10, o, n) { + let s = e.length, a = y.sizeFromShape(e), i = y.computeStrides(e), p = y.computeStrides(n), u = y.getTypedArrayFromDType(t10, y.sizeFromShape(n)); + for (let l = 0; l < a; ++l) { + let c = y.indexToLoc(l, s, i), m = new Array(c.length); + for (let f = 0; f < m.length; f++) + m[f] = c[o[f]]; + let d = y.locToIndex(m, s, p); + u[d] = r16[l]; + } + return u; +} +function iV(r16, e, t10, o) { + let [n, s] = C.computeOutAndReduceShapes(r16, o), a = pt(e, "int32"), i = y.makeZerosTypedArray(y.sizeFromShape(n), a), p = y.sizeFromShape(s); + for (let u = 0; u < i.length; ++u) { + let l = u * p, c = 1; + for (let m = 0; m < p; ++m) + c *= t10[l + m]; + i[u] = c; + } + return { outVals: i, outShape: n, outDtype: a }; +} +function ype(r16, e, t10) { + r16.forEach((o, n) => { + if (o < 0 || o >= t10) { + let s = y.indexToLoc(n, e.length, y.computeStrides(e)).join(","); + throw new Error(`indices[${s}] = ${o} is not in [0, ${t10})`); + } + }); +} +function bpe(r16, e) { + for (let t10 = 0; t10 < r16.length; ++t10) { + let o = r16[t10], n = t10 === r16.length - 1 ? e : r16[t10 + 1].length; + if (o.length === 0) + throw new Error("Ragged splits may not be empty"); + if (o[0] < 0) + throw new Error("Ragged splits must be non-negative"); + if (o[o.length - 1] > n) + throw new Error("Ragged splits must not point past values"); + for (let s = 1; s < o.length; ++s) + if (o[s - 1] > o[s]) + throw new Error("Ragged splits must be sorted in ascending order"); + } +} +function Cpe(r16, e, t10, o) { + let n = [], s = 0, a = e.length - 1 + t10.length, i = new Array(a).fill(null).map(() => [0]); + bpe(t10, o); + let p = 1; + for (let u = 0; u < e.length - 1; ++u) { + p *= e[u]; + let l = e[u + 1]; + for (let c = 1; c < p + 1; ++c) + i[u].push(c * l); + } + for (let u = 0; u < r16.length; ++u) { + let l = r16[u], c = r16[u] + 1; + for (let m = 0; m < t10.length; ++m) { + let d = t10[m], f = m + e.length - 1; + if (f >= 0) { + let h = i[f], g = h[h.length - 1] - d[l]; + for (let x = l; x < c; ++x) + i[f].push(d[x + 1] + g); + } + l = d[l], c = d[c]; + } + c !== l && (n.push([l, c]), s += c - l); + } + return { outSplits: i, valueSlices: n, numValues: s }; +} +function wpe(r16) { + let e = []; + for (let t10 = 0; t10 < r16.length; ++t10) { + let o = r16[t10].length, n = y.getArrayFromDType("int32", o); + e.push(n), r16[t10].forEach((s, a) => n[a] = s); + } + return e; +} +function uV(r16, e) { + let t10 = r16.slice(0, e); + for (; t10.length < e; ) + t10.push(1); + for (let o = e; o < r16.length; o++) + t10[e - 1] *= r16[o]; + return t10; +} +function Spe(r16, e, t10, o, n, s) { + let a = uV(e, 2)[1], i = uV(s, 2)[1], p = 0; + for (let u of t10) + for (let l = u[0]; l < u[1]; ++l) { + for (let c = 0; c < o; ++c) + n[p * i + c] = r16[l * a + c]; + ++p; + } +} +function Ipe(r16, e, t10, o, n) { + let s = e.slice(); + s[0] = n; + let a = y.getArrayFromDType(t10, y.sizeFromShape(s)), i = r16.length, p = i === 0 ? 0 : i / e[0]; + return Spe(r16, e, o, p, a, s), [a, s]; +} +function pV(r16, e, t10, o, n, s, a, i) { + if (r16.length === 0) + throw new Error("paramsNestedSplits must be non empty"); + if (e[0].length === 0) + throw new Error("Split tensors must not be scalars"); + let p = e[0][0] - 1; + if (ype(s, a, p), o.length === 0) + throw new Error("params.rank must be nonzero"); + let u = o[0], { outSplits: l, valueSlices: c, numValues: m } = Cpe(s, a, r16, u), d = wpe(l), f = Ipe(t10, o, n, c, m); + return [d, f[0], f[1]]; +} +var lV = 2147483647; +function cV(r16, e, t10, o, n, s, a) { + if (e.length > 1) + throw new Error("starts must be a scalar or vector"); + if (n.length > 1) + throw new Error("limits must be a scalar or vector"); + if (a.length > 1) + throw new Error("deltas must be a scalar or vector"); + let i = e.length === 0, p = n.length === 0, u = a.length === 0, l = []; + i || l.push(e[0]), p || l.push(n[0]), u || l.push(a[0]); + for (let g = 1; g < l.length; ++g) + if (l[g] !== l[g - 1]) + throw new Error("starts, limits, and deltas must have the same shape"); + let c = l.length === 0 ? 1 : l[0], m = y.getArrayFromDType("int32", c + 1); + m[0] = 0; + for (let g = 0; g < c; ++g) { + let x = i ? r16[0] : r16[g], b = p ? o[0] : o[g], w = u ? s[0] : s[g]; + if (w === 0) + throw new Error("Requires delta != 0"); + let S; + if (w > 0 && b < x || w < 0 && b > x) + S = 0; + else if (S = Math.ceil(Math.abs((b - x) / w)), S > lV) + throw new Error(`Requires ((limit - start) / delta) <= ${lV}`); + m[g + 1] = m[g] + S; + } + let d = m[c], f = y.getArrayFromDType(t10, d), h = 0; + for (let g = 0; g < c; ++g) { + let x = m[g + 1] - m[g], b = i ? r16[0] : r16[g], w = u ? s[0] : s[g]; + for (let S = 0; S < x; ++S) + f[h++] = b, b += w; + } + return [m, f]; +} +var ln = C.RowPartitionType; +var Dv = class r15 { + constructor(e, t10, o, n, s, a, i, p, u, l) { + this.shape = e, this.shapeShape = t10, this.values = o, this.valuesShape = n, this.valuesDType = s, this.defaultValue = a, this.defaultValueShape = i, this.rowPartitionValues = p, this.rowPartitionValuesShapes = u, this.rowPartitionTypes = C.getRowPartitionTypesHelper(l), this.raggedRank = C.getRaggedRank(this.rowPartitionTypes); + } + getRowPartitionTypeByDimension(e) { + return this.rowPartitionTypes[0] === ln.FIRST_DIM_SIZE ? this.rowPartitionTypes[e + 1] : this.rowPartitionTypes[e]; + } + getRowPartitionTensor(e) { + return this.rowPartitionTypes[0] === ln.FIRST_DIM_SIZE ? this.rowPartitionValues[e + 1] : this.rowPartitionValues[e]; + } + getMaxWidth(e) { + let t10 = this.getRowPartitionTensor(e - 1); + switch (this.getRowPartitionTypeByDimension(e - 1)) { + case ln.VALUE_ROWIDS: + return r15.getMaxWidthValueRowID(t10); + case ln.ROW_SPLITS: + return r15.getMaxWidthRowSplit(t10); + default: + throw new Error(`Cannot handle partition type ${ln[this.getRowPartitionTypeByDimension(e - 1)]}`); + } + } + static getMaxWidthRowSplit(e) { + let t10 = e.length; + if (t10 === 0 || t10 === 1) + return 0; + let o = 0; + for (let n = 0; n < t10 - 1; ++n) { + let s = e[n + 1] - e[n]; + s > o && (o = s); + } + return o; + } + static getMaxWidthValueRowID(e) { + let t10 = e.length; + if (t10 === 0) + return 0; + let o = 0, n = e[0], s = 0; + for (let a = 1; a < t10; ++a) { + let i = e[a]; + i !== n && (n = i, s = Math.max(a - o, s), o = a); + } + return Math.max(t10 - o, s); + } + tensorShapeFromTensor(e, t10, o = true) { + if (t10.length === 0) { + if (e[0] === -1) + return []; + throw new Error("The only valid scalar shape tensor is the fully unknown shape specified as -1."); + } + return dV(e, o); + } + calculateOutputSize(e) { + let t10 = this.valuesShape, o = this.defaultValueShape; + C.validateDefaultValueShape(o, t10); + let n = this.tensorShapeFromTensor(this.shape, this.shapeShape), a = C.combineRaggedTensorToTensorShapes(this.raggedRank, n, t10); + a[0] < 0 && (a[0] = e); + for (let i = 1; i <= this.raggedRank; ++i) + a[i] < 0 && (a[i] = this.getMaxWidth(i)); + return a; + } + calculateFirstParentOutputIndex(e, t10, o) { + let n = Math.min(e, o), s = [], a = 0; + for (let i = 0; i < n; ++i, a += t10) + s.push(a); + for (let i = n; i < e; ++i) + s.push(-1); + return y.assert(s.length === e, () => "Final length of result must be equal to firstDimension."), s; + } + calculateOutputIndexRowSplit(e, t10, o, n) { + let s = e.length, a = []; + for (let i = 0; i < s - 1; ++i) { + let p = e[i + 1] - e[i], u = Math.min(n, p), l = t10[i]; + l === -1 && (u = 0); + for (let c = 0; c < u; ++c) + a.push(l), l += o; + for (let c = 0; c < p - u; ++c) + a.push(-1); + } + if (s > 0 && a.length !== e[s - 1]) + throw new Error("Invalid row split size."); + return a; + } + calculateOutputIndexValueRowID(e, t10, o, n) { + let s = e.length, a = []; + if (s === 0) + return []; + let i = 0, p = e[0]; + if (p >= t10.length) + throw new Error(`Got currentValueRowId=${p}, which is not less than ${t10.length}`); + let u = t10[p]; + a.push(u); + for (let l = 1; l < s; ++l) { + let c = e[l]; + if (c === p) + u >= 0 && (++i, i < n ? u += o : u = -1); + else { + if (i = 0, p = c, c >= t10.length) + throw new Error(`Got nextValueRowId=${c} which is not less than ${t10.length}`); + u = t10[c]; + } + a.push(u); + } + if (a.length !== e.length) + throw new Error("Invalid row ids."); + return a; + } + calculateOutputIndex(e, t10, o, n) { + let s = this.getRowPartitionTensor(e), a = this.getRowPartitionTypeByDimension(e); + switch (a) { + case ln.VALUE_ROWIDS: + return this.calculateOutputIndexValueRowID(s, t10, o, n); + case ln.ROW_SPLITS: + if (s.length - 1 > t10.length) + throw new Error(`Row partition size is greater than output size: ${s.length - 1} > ${t10.length}`); + return this.calculateOutputIndexRowSplit(s, t10, o, n); + default: + throw new Error(`Unsupported partition type: ${ln[a]}`); + } + } + getFirstDimensionSize() { + let e = this.rowPartitionValues[0]; + if (this.rowPartitionTypes.length === 0) + throw new Error("No row_partition_types given."); + let t10 = this.rowPartitionTypes[0]; + switch (t10) { + case ln.FIRST_DIM_SIZE: + return e[0]; + case ln.VALUE_ROWIDS: + throw new Error("Cannot handle VALUE_ROWIDS in first dimension."); + case ln.ROW_SPLITS: + return this.rowPartitionValuesShapes[0][0] - 1; + default: + throw new Error(`Cannot handle type ${ln[t10]}`); + } + } + compute() { + if (this.rowPartitionValues[0].length <= 0) + throw new Error("Invalid first partition input. Tensor requires at least one element."); + let t10 = this.getFirstDimensionSize(), o = this.calculateOutputSize(t10), n = new Array(this.raggedRank + 1); + n[n.length - 1] = 1; + for (let p = n.length - 2; p >= 0; --p) + n[p] = n[p + 1] * o[p + 1]; + let s = dV(o, false), a = y.getArrayFromDType(this.valuesDType, y.sizeFromShape(s)); + if (n[0] * o[0] > 0) { + let p = this.calculateFirstParentOutputIndex(t10, n[0], o[0]); + for (let u = 1; u <= this.raggedRank; ++u) + p = this.calculateOutputIndex(u - 1, p, n[u], o[u]); + this.setOutput(this.raggedRank, p, a, s); + } + return [s, a]; + } + setOutput(e, t10, o, n) { + if (o.length === 0) + return; + let s = this.values, a = o, i = n.slice(); + i = i.slice(e + 1); + let p = y.sizeFromShape(i), u = t10.length, l = this.defaultValue; + if (l.length !== p && l.length !== 1) { + let f = this.defaultValueShape; + De(() => { + let h = W(l, f); + l = Oa(h, i).dataSync(); + }); + } + let c = 0, m = 0, d = 0; + for (let f = 0; f <= u; ++f) { + let h = f < u ? t10[f] : -1; + if (h === d) { + ++d; + continue; + } + if (m < d) { + let g = s.subarray(c * p), x = a.subarray(m * p), b = (d - m) * p; + mV(x, g, b); + } + if (f >= u) { + let g = o.length; + h = Math.floor(g / p); + } + if (h > d) + if (this.defaultValue.length === 1) + a.subarray(d * p, h * p).fill(this.defaultValue[0]), d = h; + else + for (; h > d; ) { + let g = a.slice(d * p); + mV(g, l, p), ++d; + } + h < 0 ? (c = f + 1, m = d) : (c = f, m = d, d = m + 1); + } + } +}; +function mV(r16, e, t10) { + for (let o = 0; o < t10; o++) + r16[o] = e[o]; +} +function dV(r16, e) { + let t10 = []; + for (let o of r16) { + if (o < 0) { + if (!e) + throw new Error(`Dimension ${o} must be >= 0`); + if (o < -1) + throw new Error(`Dimension ${o} must be >= -1`); + o = -1; + } + t10.push(o); + } + return t10; +} +function fV(r16, e, t10, o, n, s, a, i, p, u) { + return new Dv(r16, e, t10, o, n, s, a, i, p, u).compute(); +} +function hV(r16, e, t10, o) { + let n = r16 === e, s = r16 < e && t10 < 0, a = e < r16 && t10 > 1; + if (n || s || a) + return y.makeZerosTypedArray(0, o); + let i = Math.abs(Math.ceil((e - r16) / t10)), p = y.makeZerosTypedArray(i, o); + e < r16 && t10 === 1 && (t10 = -1), p[0] = r16; + for (let u = 1; u < p.length; u++) + p[u] = p[u - 1] + t10; + return p; +} +var Av = Qt((r16) => 1 / Math.sqrt(r16)); +var Nzt = Wr(Do, Av); +function gV(r16, e, t10, o, n, s, a, i, p, u) { + let l = [o / n, n], c = r16.values, m = e.values; + if (o === 0) + return ie(t10, e.dtype); + let d = p instanceof Ge ? p : ie(l, e.dtype); + typeof p == "string" || typeof p == "number" ? d.values.fill(p) : typeof p == "boolean" && d.values.fill(+p); + for (let f = 0; f < s; f++) { + let h = [], g = 0; + for (let x = 0; x < a; x++) { + let b = c[f * a + x]; + h.push(b), g += b * i[x]; + } + if (g < 0 || g >= o / n) + throw new Error(`Invalid indices: ${h} does not index into ${t10}`); + for (let x = 0; x < n; x++) + u ? d.values[g * n + x] += m[f * n + x] : d.values[g * n + x] = e.rank === 0 ? m[0] : m[f * n + x]; + } + return d; +} +var xV = Qt((r16) => 1 / (1 + Math.exp(-r16))); +var Azt = dx(Ao, (r16) => 1 / (1 + Math.exp(-r16))); +function yV(r16, e, t10, o, n) { + let s = nt.isSliceContinous(o, e, t10), a = y.sizeFromShape(t10), i = y.computeStrides(o); + if (s) { + let c = nt.computeFlatOffset(e, i); + return n === "string" ? r16.slice(c, c + a) : r16.subarray(c, c + a); + } + let p = n === "string" ? C.fromUint8ToStringArray(r16) : r16, u = ie(o, n, p), l = ie(t10, n); + for (let c = 0; c < l.size; ++c) { + let m = l.indexToLoc(c), d = m.map((f, h) => f + e[h]); + l.set(u.get(...d), ...m); + } + return n === "string" ? C.fromStringArrayToUint8(l.values) : l.values; +} +function bV(r16, e, t10, o, n, s, a) { + let i = e[0], p = s[0], u = new Array(p), l = new Array(i), c = e[1]; + if (p === 0) { + if (i !== 0) + throw new Error(C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i)); + let g = y.getArrayFromDType(t10, 0), x = y.getArrayFromDType(n, 0); + return [g, [0, c], x, u, l]; + } + let m = true, d = 0, f = new Array(p).fill(0); + for (let g = 0; g < i; ++g) { + let x = r16[g * c]; + if (x < 0) + throw new Error(C.getSparseFillEmptyRowsNegativeIndexErrorMessage(g, x)); + if (x >= p) + throw new Error(C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g, x, p)); + ++f[x], m = m && x >= d, d = x; + } + let h = true; + for (let g = 0; g < p; ++g) { + let x = f[g] === 0; + u[g] = x, h = h && !x, f[g] = Math.max(f[g], 1), g > 0 && (f[g] += f[g - 1]); + } + if (h && m) { + let g = r16, x = o; + for (let b = 0; b < i; ++b) + l[b] = b; + return [g, [i, c], x, u, l]; + } else { + let g = f[p - 1], x = y.getArrayFromDType(t10, g * c), b = y.getArrayFromDType(n, g), w = new Array(p).fill(0); + for (let S = 0; S < i; ++S) { + let k = r16[S * c], T = w[k], E = (k === 0 ? 0 : f[k - 1]) + T; + w[k]++; + for (let R = 0; R < c; ++R) + x[E * c + R] = r16[S * c + R]; + b[E] = o[S], l[S] = E; + } + for (let S = 0; S < p; ++S) + if (w[S] === 0) { + let T = S === 0 ? 0 : f[S - 1]; + x[T * c + 0] = S; + for (let E = 1; E < c; ++E) + x[T * c + E] = 0; + b[T] = a; + } + return [x, [g, c], b, u, l]; + } +} +function CV(r16, e, t10, o, n) { + let s = y.sizeFromShape(o), a = e[0], i = n.length, p = [], u = 1, l = -1; + for (let g = 0; g < i; ++g) { + let x = n[g]; + if (x === -1) { + if (l !== -1) + throw new Error(C.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(l, g)); + l = g, p.push(1); + } else { + if (x < 0) + throw new Error(C.getSparseReshapeNegativeOutputDimErrorMessage(g, x)); + u *= x, p.push(x); + } + } + if (l !== -1) { + if (u <= 0) + throw new Error(C.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage()); + let g = Math.trunc(s / u); + if (u * g !== s) + throw new Error(C.getSparseReshapeInputOutputMultipleErrorMessage(o, p)); + p[l] = g; + } + if (y.sizeFromShape(p) !== s) + throw new Error(C.getSparseReshapeInputOutputMismatchErrorMessage(o, p)); + let m = o.length, d = []; + if (m > 0) { + d[m - 1] = 1; + for (let g = m - 2; g >= 0; --g) + d[g] = d[g + 1] * o[g + 1]; + } + let f = []; + if (i > 0) { + f[i - 1] = 1; + for (let g = i - 2; g >= 0; --g) + f[g] = f[g + 1] * p[g + 1]; + } + let h = y.getArrayFromDType(t10, a * i); + for (let g = 0; g < a; ++g) { + let x = 0; + for (let b = 0; b < m; ++b) + x += r16[g * m + b] * d[b]; + for (let b = 0; b < i; ++b) + h[g * i + b] = Math.trunc(x / f[b]), x %= f[b]; + } + return [h, [a, i], p]; +} +function wV(r16, e, t10, o, n, s = false, a = 0) { + let i = o.length, p = [e[0], r16.length / e[0]], u = p[1], c = i > 0 ? n[i - 1] + 1 : 0; + if (c < 0) + throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); + let m = e.slice(); + m[0] = c; + let d = m.reduce((w, S) => w * S, 1), f = y.getArrayFromDType(t10, d); + if (i === 0) + return c > 0 && f.fill(a), [f, m]; + if (c <= 0) + throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage()); + let h = 0, g = 1, x = 0, b = n[h]; + for (; ; ) { + let w = 0; + if (g < i) { + if (w = n[g], b === w) { + ++g; + continue; + } + if (b >= w) + throw new Error(C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage()); + } + if (b < 0 || b >= c) + throw new Error(C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b, c)); + b > x && f.fill(a, x * u, b * u); + for (let S = h; S < g; ++S) { + let k = o[S]; + if (k < 0 || k >= p[0]) + throw new Error(C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S, o[S], p[0])); + for (let T = 0; T < u; T++) + f[b * u + T] += r16[k * u + T]; + } + if (s) + for (let S = 0; S < u; S++) + f[b * u + S] /= g - h; + if (h = g, ++g, x = b + 1, b = w, g > i) + break; } -}; -function At(r15) { - let { inputs: t8 } = r15, { x: e } = t8; - return r15.backend.incRef(e.dataId), { dataId: e.dataId, shape: e.shape, dtype: e.dtype }; + return x < c && f.fill(a, x * u, c * u), [f, m]; } -var nz = { kernelName: Co, backendName: "webgpu", kernelFunc: At }; -function xo(r15) { - let { inputs: t8, backend: e } = r15, { real: o, imag: n } = t8, s = e.makeTensorInfo(o.shape, "complex64"), a = e.tensorMap.get(s.dataId), i = At({ inputs: { x: o }, backend: e }), p = At({ inputs: { x: n }, backend: e }); - return a.complexTensorInfos = { real: i, imag: p }, s; +var SV = Qt((r16) => Math.sqrt(r16)); +var qzt = dx(Fo, (r16) => Math.sqrt(r16)); +var Fv = ht((r16, e) => { + let t10 = r16 - e; + return t10 * t10; +}); +var Zzt = wt(Po, Fv); +var Pv = Qt((r16, e) => { + let { pattern: t10, replaceGlobal: o, rewrite: n } = e; + return r16.replace(new RegExp(t10, o ? "g" : ""), n); +}); +var oVt = Wr(pi, Pv); +function IV(r16, e, t10, o) { + let n = ie(r16, e.dtype); + for (let s = 0; s < n.size; s++) { + let a = n.indexToLoc(s), i = new Array(a.length); + for (let p = 0; p < i.length; p++) + i[p] = a[p] * t10[p] + o[p]; + n.set(e.get(...i), ...a); + } + return n; } -var sz = { kernelName: Ri, backendName: "webgpu", kernelFunc: xo }; -var Zr = class { - constructor(t8, e, o = "") { - this.variableNames = ["A"], this.size = true; - let n = 128; - this.workgroupSize = [n, 1, 1], this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.op = e, o !== "" && (this.uniforms = o), this.shaderKey = `unary_${e}`; +var Ov = class { + constructor(e, t10, o, n, s, a) { + this.separator = y.encodeString(e), this.nGramWidths = t10, this.leftPad = y.encodeString(o), this.rightPad = y.encodeString(n), this.padWidth = s, this.preserveShort = a; } - getUserCode() { - return ` - fn unaryOperation(a : f32) -> f32 { - ${wi(this.op, false)} + getPadWidth(e) { + return Math.min(this.padWidth < 0 ? e - 1 : this.padWidth, e - 1); + } + getNumNGrams(e, t10) { + let o = this.getPadWidth(t10); + return Math.max(0, e + 2 * o - t10 + 1); + } + createNGrams(e, t10, o, n, s, a) { + for (let i = 0; i < s; ++i) { + let p = this.getPadWidth(a), u = Math.max(0, p - i), l = Math.max(0, p - (s - (i + 1))), c = a - (u + l), m = t10 + (u > 0 ? 0 : i - p), d = 0; + d += u * this.leftPad.length; + for (let b = 0; b < c; ++b) + d += e[m + b].length; + d += l * this.rightPad.length; + let f = u + l + c - 1; + d += f * this.separator.length, o[n + i] = new Uint8Array(d); + let h = o[n + i], g = 0, x = (b) => b.forEach((w) => h[g++] = w); + for (let b = 0; b < u; ++b) + x(this.leftPad), x(this.separator); + for (let b = 0; b < c - 1; ++b) + x(e[m + b]), x(this.separator); + if (c > 0) { + x(e[m + c - 1]); + for (let b = 0; b < l; ++b) + x(this.separator), x(this.rightPad); + } else { + for (let b = 0; b < l - 1; ++b) + x(this.rightPad), x(this.separator); + x(this.rightPad); } - ${G("index")} { - if (index < uniforms.size) { - let a = getAByOutputIndex(index); - setOutputAtIndex(index, unaryOperation(a)); - } + } + } + compute(e, t10) { + let o = e.length, n = t10.length; + if (n > 0) { + let p = t10[0]; + if (p !== 0) + throw new Error(`First split value must be 0, got ${p}`); + for (let u = 1; u < n; ++u) { + let l = t10[u] >= p; + if (l = l && t10[u] <= o, !l) + throw new Error(`Invalid split value ${t10[u]}, must be in [${p}, ${o}]`); + p = t10[u]; } - `; + if (p !== o) + throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`); + } + let s = n - 1, a = y.getArrayFromDType("int32", n); + if (o === 0 || n === 0) { + let p = new Array(o); + for (let u = 0; u <= s; ++u) + a[u] = 0; + return [p, a]; + } + a[0] = 0; + for (let p = 1; p <= s; ++p) { + let u = t10[p] - t10[p - 1], l = 0; + this.nGramWidths.forEach((c) => { + l += this.getNumNGrams(u, c); + }), this.preserveShort && u > 0 && l === 0 && (l = 1), a[p] = a[p - 1] + l; + } + let i = new Array(a[s]); + for (let p = 0; p < s; ++p) { + let u = t10[p], l = a[p]; + if (this.nGramWidths.forEach((c) => { + let m = t10[p + 1] - t10[p], d = this.getNumNGrams(m, c); + this.createNGrams(e, u, i, l, d, c), l += d; + }), this.preserveShort && l === a[p]) { + let c = t10[p + 1] - t10[p]; + if (c === 0) + continue; + let m = c + 2 * this.padWidth; + this.createNGrams(e, u, i, l, 1, m); + } + } + return [i, a]; } }; -function ye({ opType: r15, cpuKernelImpl: t8, dtype: e }) { - return ({ inputs: o, backend: n }) => { - let { x: s } = o, a = n, i = e || s.dtype; - if (a.shouldExecuteOnCPU([s]) && t8 != null) { - let u = a.tensorMap.get(s.dataId), c = t8(u.values, i); - return a.makeTensorInfo(s.shape, i, c); +function vV(r16, e, t10, o, n, s, a, i) { + return new Ov(t10, o, n, s, a, i).compute(r16, e); +} +function vpe(r16, e, t10, o) { + if (!r16.length) + return; + if (e.length === 0) { + for (let s = 0; s < r16.length; ++s) + o.push(r16.subarray(s, s + 1)); + return; + } + if (e.length === 1) { + let s = e[0], a = r16.indexOf(s); + for (; a !== -1; ) { + let i = r16.subarray(0, a); + (!t10 || i.length !== 0) && o.push(i), r16 = r16.subarray(a + 1), a = r16.indexOf(s); + } + (!t10 || r16.length !== 0) && o.push(r16); + return; + } + let n = 0; + for (let s = 0; s < r16.length + 1; s++) + if (s === r16.length || e.indexOf(r16[s]) !== -1) { + let a = r16.subarray(n, s); + (!t10 || a.length !== 0) && o.push(a), n = s + 1; } - let p = new Zr(s.shape, r15); - return a.runWebGPUProgram(p, [s], i); - }; } -function et({ opType: r15, cpuKernelImpl: t8, supportsComplex: e = false, dtype: o }) { - return ({ inputs: n, backend: s }) => { - let { a, b: i } = n, p = s; - if (e && a.dtype === "complex64") { - let l = p.tensorMap.get(a.dataId), m = p.tensorMap.get(i.dataId), d, f; - if (r15 !== fe.MUL) - [d, f] = [[l.complexTensorInfos.real, m.complexTensorInfos.real], [l.complexTensorInfos.imag, m.complexTensorInfos.imag]].map((g) => { - let [x, b] = g, C = { dataId: x.dataId, dtype: x.dtype, shape: a.shape }, S = { dataId: b.dataId, dtype: b.dtype, shape: i.shape }, k = new Si(r15, a.shape, i.shape); - return p.runWebGPUProgram(k, [C, S], dt(x.dtype, b.dtype)); - }); - else { - let g = new fm(fe.COMPLEX_MULTIPLY_REAL, a.shape, i.shape), x = new fm(fe.COMPLEX_MULTIPLY_IMAG, a.shape, i.shape), b = [{ 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 }, { dataId: m.complexTensorInfos.real.dataId, dtype: m.complexTensorInfos.real.dtype, shape: i.shape }, { dataId: m.complexTensorInfos.imag.dataId, dtype: m.complexTensorInfos.imag.dtype, shape: i.shape }]; - d = p.runWebGPUProgram(g, b, "float32"), f = p.runWebGPUProgram(x, b, "float32"); - } - let h = xo({ inputs: { real: d, imag: f }, backend: p }); - return p.disposeData(d.dataId), p.disposeData(f.dataId), h; +function kV(r16, e, t10) { + let o = r16.length, n = [], s = 0, a = 0, i = new Array(o); + for (let m = 0; m < o; ++m) { + let d = n.length; + vpe(r16[m], e, t10, n); + let f = n.length - d; + i[m] = f, s += f, a = Math.max(a, f); + } + let p = y.getArrayFromDType("int32", s * 2), u = new Array(s), l = [o, a], c = 0; + for (let m = 0; m < o; ++m) + for (let d = 0; d < i[m]; ++d) + p[c * 2] = m, p[c * 2 + 1] = d, u[c] = n[c], ++c; + return [p, u, l]; +} +function NV(r16, e) { + let t10 = y.getArrayFromDType("int32", r16.length); + for (let o = 0; o < r16.length; ++o) + t10[o] = y.fingerPrint64(r16[o]).modulo(e).getLowBitsUnsigned(); + return t10; +} +var Mv = ht((r16, e) => r16 - e); +var kpe = rc((r16, e, t10, o) => ({ real: r16 - t10, imag: e - o })); +var gVt = wt(Oo, Mv, kpe); +function TV(r16, e) { + let t10 = new Array(r16.rank); + for (let n = 0; n < t10.length; n++) + t10[n] = r16.shape[n] * e[n]; + let o = ie(t10, r16.dtype); + for (let n = 0; n < o.values.length; ++n) { + let s = o.indexToLoc(n), a = new Array(r16.rank); + for (let p = 0; p < a.length; p++) + a[p] = s[p] % r16.shape[p]; + let i = r16.locToIndex(a); + o.values[n] = r16.values[i]; + } + return o; +} +var Nm = (r16, e) => { + let t10 = e.value - r16.value; + return t10 === 0 ? r16.index - e.index : t10; +}; +function _V(r16, e, t10 = 0, o = r16.length - 1) { + for (; o > t10; ) { + if (o - t10 > 600) { + let i = o - t10 + 1, p = e - t10 + 1, u = Math.log(i), l = 0.5 * Math.exp(2 * u / 3), c = 0.5 * Math.sqrt(u * l * (i - l) / i) * Math.sign(p - i / 2), m = Math.max(t10, Math.floor(e - p * l / i + c)), d = Math.min(o, Math.floor(e + (i - p) * l / i + c)); + _V(r16, e, m, d); } - let u = o || dt(a.dtype, i.dtype); - if ((a.dtype === "string" || i.dtype === "string" || p.shouldExecuteOnCPU([a, i])) && t8 != null) { - let l = p.tensorMap.get(a.dataId).values, m = p.tensorMap.get(i.dataId).values, d = a.dtype === "string" ? w.fromUint8ToStringArray(l) : l, f = a.dtype === "string" ? w.fromUint8ToStringArray(m) : m, [h, g] = t8(a.shape, i.shape, d, f, u); - return p.makeTensorInfo(g, u, h); + let n = r16[e], s = t10, a = o; + for (y.swap(r16, t10, e), Nm(r16[o], n) > 0 && y.swap(r16, t10, o); s < a; ) { + for (y.swap(r16, s, a), s++, a--; Nm(r16[s], n) < 0; ) + s = s + 1; + for (; Nm(r16[a], n) > 0; ) + a = a - 1; } - let c = new Si(r15, a.shape, i.shape); - return p.runWebGPUProgram(c, [a, i], u); - }; + Nm(r16[t10], n) === 0 ? y.swap(r16, t10, a) : (a = a + 1, y.swap(r16, a, o)), a <= e && (t10 = a + 1), e <= a && (o = a - 1); + } } -var { addImpl: az, castImpl: iz, ceilImpl: uz, concatImpl: pz, equalImpl: cz, expImpl: lz, expm1Impl: mz, floorImpl: dz, floorDivImpl: fz, gatherNdImpl: hz, gatherV2Impl: gz, greaterEqualImpl: xz, greaterImpl: yz, lessEqualImpl: bz, lessImpl: Cz, logImpl: wz, maxImpl: Sz, maximumImpl: Iz, minimumImpl: vz, multiplyImpl: kz, negImpl: Nz, notEqualImpl: Tz, prodImpl: _z, rangeImpl: $z, rsqrtImpl: Ez, scatterImpl: Rz, simpleAbsImpl: Dz, sliceImpl: Az, stridedSliceImpl: Fz, stringNGramsImpl: Pz, subImpl: Oz, tileImpl: Mz, topKImpl: Lz, transposeImpl: Bz, uniqueImpl: KPt } = wc; -var Uie = ye({ opType: Z.ABS, cpuKernelImpl: Dz }); -var zz = { kernelName: Xs, backendName: "webgpu", kernelFunc: Uie }; -var Gie = ye({ opType: Z.ACOS }); -var Vz = { kernelName: Vo, backendName: "webgpu", kernelFunc: Gie }; -var Hie = ye({ opType: Z.ACOSH }); -var Wz = { kernelName: Wo, backendName: "webgpu", kernelFunc: Hie }; -var Kie = et({ opType: fe.ADD, cpuKernelImpl: az, supportsComplex: true }); -var Uz = { kernelName: io, backendName: "webgpu", kernelFunc: Kie }; -var ex = class { - constructor(t8) { - this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8[0], this.variableNames = t8.map((e, o) => `T${o}`), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.shaderKey = "addN"; +function EV(r16, e, t10, o, n) { + let s = e[e.length - 1], [a, i] = [r16.length / s, s], p = y.getTypedArrayFromDType(t10, a * o), u = y.getTypedArrayFromDType("int32", a * o); + for (let c = 0; c < a; c++) { + let m = c * i, d = r16.subarray(m, m + i), f = new Array(d.length); + d.forEach((b, w) => f[w] = { value: b, index: w }), o < f.length && (_V(f, o), f = f.slice(0, o)), n && f.sort(Nm); + let h = c * o, g = p.subarray(h, h + o), x = u.subarray(h, h + o); + for (let b = 0; b < o; b++) + g[b] = f[b].value, x[b] = f[b].index; + } + let l = e.slice(); + return l[l.length - 1] = o, [ie(l, t10, p), ie(l, "int32", u)]; +} +function $V(r16, e, t10, o) { + let n = y.parseAxisParam(e, t10)[0], s = [1, t10[0], 1]; + for (let f = 0; f < n; f++) + s[0] *= t10[f]; + s[1] = t10[n]; + for (let f = n + 1; f < t10.length; f++) + s[2] *= t10[f]; + let a = /* @__PURE__ */ new Map(), i = new Int32Array(t10[n]), p = new Ge(s, o, r16), u = [], l = s[0] === 1 && s[2] === 1; + for (let f = 0; f < t10[n]; f++) { + let h; + if (l) + h = r16[f].toString(); + else { + let x = []; + for (let b = 0; b < s[0]; b++) + for (let w = 0; w < s[2]; w++) + x.push(p.get(b, f, w)); + h = x.join(","); + } + let g = a.get(h); + if (g != null) + i[f] = g; + else { + let x = a.size; + a.set(h, x), i[f] = x, u.push(f); + } + } + let c = s.slice(); + c[1] = a.size; + let m = new Ge(c, o); + u.forEach((f, h) => { + for (let g = 0; g < s[0]; g++) + for (let x = 0; x < s[2]; x++) + m.set(p.get(g, f, x), g, h, x); + }); + let d = t10.slice(); + return d[n] = c[1], { outputValues: m.values, outputShape: d, indices: i }; +} +var { addImpl: RV, castImpl: DV, ceilImpl: AV, concatImpl: FV, equalImpl: PV, expImpl: OV, expm1Impl: MV, floorImpl: LV, floorDivImpl: BV, gatherNdImpl: zV, gatherV2Impl: VV, greaterEqualImpl: WV, greaterImpl: UV, lessEqualImpl: GV, lessImpl: HV, logImpl: KV, maxImpl: qV, maximumImpl: jV, minimumImpl: XV, multiplyImpl: YV, negImpl: QV, notEqualImpl: ZV, prodImpl: JV, rangeImpl: eW, rsqrtImpl: tW, scatterImpl: rW, simpleAbsImpl: oW, sliceImpl: nW, stridedSliceImpl: sW, stringNGramsImpl: aW, subImpl: iW, tileImpl: uW, topKImpl: pW, transposeImpl: lW, uniqueImpl: CWt } = Lv; +var Npe = ye({ opType: Z.ABS, cpuKernelImpl: oW }); +var cW = { kernelName: fn, backendName: "webgpu", kernelFunc: Npe }; +var Tpe = ye({ opType: Z.ACOS }); +var mW = { kernelName: hn, backendName: "webgpu", kernelFunc: Tpe }; +var _pe = ye({ opType: Z.ACOSH }); +var dW = { kernelName: gn, backendName: "webgpu", kernelFunc: _pe }; +var Epe = tt({ opType: fe.ADD, cpuKernelImpl: RV, supportsComplex: true }); +var fW = { kernelName: Rr, backendName: "webgpu", kernelFunc: Epe }; +var fx = class { + constructor(e) { + this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e[0], this.variableNames = e.map((t10, o) => `T${o}`), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.shaderKey = "addN"; } getUserCode() { - let t8 = []; + let e = []; this.variableNames.forEach((n) => { - t8.push(`let v${n} = get${n}ByOutputCoords(coords);`); + e.push(`let v${n} = get${n}ByOutputCoords(coords);`); }); - let e = this.variableNames.map((n) => `v${n}`).join(" + "); + let t10 = this.variableNames.map((n) => `v${n}`).join(" + "); return ` ${G("index")} { for (var i = 0; i < ${this.workPerThread}; i = i + 1) { let flatIndex = index * ${this.workPerThread} + i; if (flatIndex < uniforms.size) { let coords = getCoordsFromIndex(flatIndex); - ${t8.join(` + ${e.join(` `)} - setOutputAtIndex(flatIndex, ${e}); + setOutputAtIndex(flatIndex, ${t10}); } } } `; } }; -function qie(r15) { - let { inputs: t8, backend: e } = r15, o = t8; +function $pe(r16) { + let { inputs: e, backend: t10 } = r16, o = e; if (o.length === 1) - return At({ inputs: { x: o[0] }, backend: e }); - let n = o.map((i) => i.dtype).reduce((i, p) => dt(i, p)), s = o.map((i) => i.shape), a = new ex(s); - return e.runWebGPUProgram(a, o, n); + return Pt({ inputs: { x: o[0] }, backend: t10 }); + let n = o.map((i) => i.dtype).reduce((i, p) => pt(i, p)), s = o.map((i) => i.shape), a = new fx(s); + return t10.runWebGPUProgram(a, o, n); } -var Gz = { kernelName: Uo, backendName: "webgpu", kernelFunc: qie }; -var tx = class { - constructor(t8, e) { +var hW = { kernelName: xn, backendName: "webgpu", kernelFunc: $pe }; +var hx = class { + constructor(e, t10) { this.variableNames = ["A"], this.workgroupSize = [16, 16, 1]; - let o = new Array(t8.length); + let o = new Array(e.length); for (let n = 0; n < o.length; n++) - o[n] = t8[e[n]]; + o[n] = e[t10[n]]; this.outputShape = o, this.dispatchLayout = { x: [0], y: [1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [1, 1, 1]), this.shaderKey = "transposeShared"; } getUserCode() { y.assert(this.workgroupSize[0] === this.workgroupSize[1], () => `Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`); - let t8 = this.workgroupSize[0]; + let e = this.workgroupSize[0]; return ` var tile : array, ${this.workgroupSize[0]}>; ${G()} { - var x = i32(workgroupId.x) * ${t8} + i32(localId.x); - var y = i32(workgroupId.y) * ${t8} + i32(localId.y); + var x = i32(workgroupId.x) * ${e} + i32(localId.x); + var y = i32(workgroupId.y) * ${e} + i32(localId.y); let width = uniforms.outShape[0]; let height = uniforms.outShape[1]; if (x < width && y < height) { @@ -28861,8 +30003,8 @@ var tx = class { } workgroupBarrier(); - x = i32(workgroupId.y) * ${t8} + i32(localId.x); - y = i32(workgroupId.x) * ${t8} + i32(localId.y); + x = i32(workgroupId.y) * ${e} + i32(localId.x); + y = i32(workgroupId.x) * ${e} + i32(localId.y); if (x < height && y < width) { setOutputAtIndex((y * height + x), tile[localId.x] [localId.y]); @@ -28871,16 +30013,16 @@ var tx = class { `; } }; -var rx = class { - constructor(t8, e) { +var gx = class { + constructor(e, t10) { this.variableNames = ["A"], this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true; - let o = new Array(t8.length); + let o = new Array(e.length); for (let n = 0; n < o.length; n++) - o[n] = t8[e[n]]; - this.outputShape = o, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.newDim = e, this.shaderKey = `transpose_${e}`; + o[n] = e[t10[n]]; + this.outputShape = o, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.newDim = t10, this.shaderKey = `transpose_${t10}`; } getUserCode() { - let t8 = ft(this.outputShape.length), e = Jv(this.newDim); + let e = ft(this.outputShape.length), t10 = Bv(this.newDim); return ` ${G("index")} { for(var i = 0; i < ${this.workPerThread}; i = i + 1) { @@ -28888,51 +30030,51 @@ var rx = class { if(flatIndex < uniforms.size) { let coords = getCoordsFromIndex(flatIndex); setOutputAtIndex(flatIndex, A[getIndexFromCoords${this.outputShape.length}D( - ${t8}(${e}), uniforms.aShape)]); + ${e}(${t10}), uniforms.aShape)]); } } } `; } }; -function Jv(r15) { - let t8 = r15.length; - if (t8 > 6) - throw Error(`Transpose for rank ${t8} is not yet supported`); - let e = new Array(t8); - for (let o = 0; o < r15.length; o++) - e[r15[o]] = `coords.${Oo(o)}`; - return e.join(); +function Bv(r16) { + let e = r16.length; + if (e > 6) + throw Error(`Transpose for rank ${e} is not yet supported`); + let t10 = new Array(e); + for (let o = 0; o < r16.length; o++) + t10[r16[o]] = `coords.${un(o)}`; + return t10.join(); } -function xr(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { perm: s } = o, a = e, i = n.shape.length, p = new Array(i); - for (let c = 0; c < p.length; c++) - p[c] = n.shape[s[c]]; - if (e.shouldExecuteOnCPU([n])) { - let l = a.tensorMap.get(n.dataId).values, m = Bz(l, n.shape, n.dtype, s, p); - return e.makeTensorInfo(p, n.dtype, m); +function Cr(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { perm: s } = o, a = t10, i = n.shape.length, p = new Array(i); + for (let l = 0; l < p.length; l++) + p[l] = n.shape[s[l]]; + if (t10.shouldExecuteOnCPU([n])) { + let c = a.tensorMap.get(n.dataId).values, m = lW(c, n.shape, n.dtype, s, p); + return t10.makeTensorInfo(p, n.dtype, m); } if (n.shape.length === 2 && y.arraysEqual(s, [1, 0])) { - let c = new tx(n.shape, s); - return a.runWebGPUProgram(c, [n], n.dtype); + let l = new hx(n.shape, s); + return a.runWebGPUProgram(l, [n], n.dtype); } - let u = new rx(n.shape, s); + let u = new gx(n.shape, s); return a.runWebGPUProgram(u, [n], n.dtype); } -var Hz = { kernelName: po, backendName: "webgpu", kernelFunc: xr }; -var ox = class { - constructor(t8, e, o) { - this.variableNames = ["x"], this.uniforms = "reduceSize : i32,", this.size = true, this.inputShape = [t8.batchSize, t8.inSize]; - let [n] = w.computeOutAndReduceShapes(this.inputShape, [1]); - this.outputShape = n.length === 0 ? [1] : n, t8.inSize >= 32768 && o >= 512 ? this.workgroupSize = [512, 1, 1] : t8.inSize >= 4096 ? this.workgroupSize = [256, 1, 1] : this.workgroupSize = [64, 1, 1], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, [1, 1, 1]), this.reduceType = e, this.shaderKey = `reduce_${e}`; +var gW = { kernelName: Kr, backendName: "webgpu", kernelFunc: Cr }; +var xx = class { + constructor(e, t10, o) { + this.variableNames = ["x"], this.uniforms = "reduceSize : i32,", this.size = true, this.inputShape = [e.batchSize, e.inSize]; + let [n] = C.computeOutAndReduceShapes(this.inputShape, [1]); + this.outputShape = n.length === 0 ? [1] : n, e.inSize >= 32768 && o >= 512 ? this.workgroupSize = [512, 1, 1] : e.inSize >= 4096 ? this.workgroupSize = [256, 1, 1] : this.workgroupSize = [64, 1, 1], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, [1, 1, 1]), this.reduceType = t10, this.shaderKey = `reduce_${t10}`; } getUserCode() { - let t8 = "", e = "0.0", o = this.workgroupSize[0]; - this.reduceType === "min" || this.reduceType === "max" ? (t8 = ` + let e = "", t10 = "0.0", o = this.workgroupSize[0]; + this.reduceType === "min" || this.reduceType === "max" ? (e = ` if (isnan(candidate)) { bestValue = uniforms.NAN; } else if (!isnan(bestValue) && candidate ${this.reduceType === "min" ? "<" : ">"} bestValue) - { bestValue = candidate; }`, e = "f32(x[offset])") : this.reduceType === "sum" || this.reduceType === "mean" ? t8 = " bestValue = bestValue + candidate; " : this.reduceType === "prod" ? (t8 = " bestValue = bestValue * candidate; ", e = "1.0") : this.reduceType === "all" ? (t8 = " bestValue = f32(bestValue >= 1.0 && candidate >= 1.0); ", e = "1.0") : this.reduceType === "any" && (t8 = " bestValue = f32(bestValue >= 1.0 || candidate >= 1.0); ", e = "0.0"); + { bestValue = candidate; }`, t10 = "f32(x[offset])") : this.reduceType === "sum" || this.reduceType === "mean" ? e = " bestValue = bestValue + candidate; " : this.reduceType === "prod" ? (e = " bestValue = bestValue * candidate; ", t10 = "1.0") : this.reduceType === "all" ? (e = " bestValue = f32(bestValue >= 1.0 && candidate >= 1.0); ", t10 = "1.0") : this.reduceType === "any" && (e = " bestValue = f32(bestValue >= 1.0 || candidate >= 1.0); ", t10 = "0.0"); let n = this.reduceType === "mean" ? "setOutputAtIndex(outputIndex, bestValue / f32(uniforms.reduceSize));" : "setOutputAtIndex(outputIndex, bestValue);"; return ` fn DIV_CEIL(a : u32, b : u32) -> u32 { @@ -28950,13 +30092,13 @@ var ox = class { ${G("index")} { let outputIndex = index / ${o}; let offset = getOffset(outputIndex); - var bestValue = ${e}; + var bestValue = ${t10}; let Length = uniforms.reduceSize; let WorkPerThread = DIV_CEIL(u32(Length), ${o}u); for (var k = i32(localId.x); k < Length && outputIndex < uniforms.size; k = k + ${o}) { let candidate = f32(x[offset + k]); - ${t8} + ${e} } xBestValues[localId.x] = bestValue; workgroupBarrier(); @@ -28967,7 +30109,7 @@ var ox = class { let interval = DIV_CEIL(reduceSize, 2u); if (localId.x < currentSize) { let candidate = xBestValues[localId.x + interval]; - ${t8} + ${e} xBestValues[localId.x] = bestValue; } reduceSize = interval; @@ -28981,59 +30123,59 @@ var ox = class { `; } }; -var jie = { mean: "float32", all: "bool", any: "bool" }; -function Jr(r15, t8, e, o, n) { - let s = r15.shape.length, a = [], i = y.parseAxisParam(t8, r15.shape), p = i, u = w.getAxesPermutation(p, s), c = r15; - u != null && (c = xr({ inputs: { x: r15 }, attrs: { perm: u }, backend: n }), p = w.getInnerMostAxes(p.length, s), a.push(c)), w.assertAxesAreInnerMostDims(o, p, s); - let [l, m] = w.computeOutAndReduceShapes(c.shape, p), d = l; - e && (d = w.expandShapeToKeepDim(l, i)); +var Rpe = { mean: "float32", all: "bool", any: "bool" }; +function ao(r16, e, t10, o, n) { + let s = r16.shape.length, a = [], i = y.parseAxisParam(e, r16.shape), p = i, u = C.getAxesPermutation(p, s), l = r16; + u != null && (l = Cr({ inputs: { x: r16 }, attrs: { perm: u }, backend: n }), p = C.getInnerMostAxes(p.length, s), a.push(l)), C.assertAxesAreInnerMostDims(o, p, s); + let [c, m] = C.computeOutAndReduceShapes(l.shape, p), d = c; + t10 && (d = C.expandShapeToKeepDim(c, i)); let f; - if ((o === "max" || o === "prod") && n.shouldExecuteOnCPU([c])) { - let h = n.tensorMap.get(c.dataId).values; + if ((o === "max" || o === "prod") && n.shouldExecuteOnCPU([l])) { + let h = n.tensorMap.get(l.dataId).values; switch (o) { case "max": - let g = Sz(h, y.sizeFromShape(m), d, r15.dtype); - f = n.makeTensorInfo(d, r15.dtype, g); + let g = qV(h, y.sizeFromShape(m), d, r16.dtype); + f = n.makeTensorInfo(d, r16.dtype, g); break; case "prod": - let { outVals: x, outShape: b, outDtype: C } = _z(c.shape, c.dtype, h, p); - f = n.makeTensorInfo(b, C, x); + let { outVals: x, outShape: b, outDtype: w } = JV(l.shape, l.dtype, h, p); + f = n.makeTensorInfo(b, w, x); break; default: throw new Error(`${o} CPU implementation is not yet supported.`); } } else { - let h = y.sizeFromShape(m), x = y.sizeFromShape(c.shape) / h, b = { windowSize: h, inSize: h, batchSize: x, outSize: 1 }, C = jie[o] || oi(r15.dtype), S = [{ type: "int32", data: [h] }], k = new ox(b, o, n.device.limits.maxComputeWorkgroupSizeX), _ = n.runWebGPUProgram(k, [c], C, S); - a.push(_), f = pe({ inputs: { x: _ }, attrs: { shape: d }, backend: n }); + let h = y.sizeFromShape(m), x = y.sizeFromShape(l.shape) / h, b = { windowSize: h, inSize: h, batchSize: x, outSize: 1 }, w = Rpe[o] || mi(r16.dtype), S = [{ type: "int32", data: [h] }], k = new xx(b, o, n.device.limits.maxComputeWorkgroupSizeX), T = n.runWebGPUProgram(k, [l], w, S); + a.push(T), f = le({ inputs: { x: T }, attrs: { shape: d }, backend: n }); } return a.forEach((h) => n.disposeData(h.dataId)), f; } -function Xie(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { keepDims: s, axis: a } = o; - return Jr(n, a, s, "all", e); +function Dpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { keepDims: s, axis: a } = o; + return ao(n, a, s, "all", t10); } -var Kz = { kernelName: Go, backendName: "webgpu", kernelFunc: Xie }; -function Yie(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { keepDims: s, axis: a } = o; - return Jr(n, a, s, "any", e); +var xW = { kernelName: yn, backendName: "webgpu", kernelFunc: Dpe }; +function Ape(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { keepDims: s, axis: a } = o; + return ao(n, a, s, "any", t10); } -var qz = { kernelName: Ho, backendName: "webgpu", kernelFunc: Yie }; -var jc = class { - constructor(t8, e, o) { +var yW = { kernelName: bn, backendName: "webgpu", kernelFunc: Ape }; +var oc = class { + constructor(e, t10, o) { this.workgroupSize = [64, 1, 1], this.variableNames = ["x"], this.uniforms = "infinityValue : f32,", this.size = true; - let n = [e]; + let n = [t10]; this.op = o === "min" ? "<" : ">"; - let [s, a] = w.computeOutAndReduceShapes(t8, n); - this.outputShape = s.length === 0 ? [1] : s, this.dispatchLayout = X(this.outputShape), y.sizeFromShape(a) < 32 ? (this.type = "plain", this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize)) : (this.type = "shared", this.dispatch = H(this.dispatchLayout, this.outputShape, [1, 1, 1])), this.inputShape = t8, this.shaderKey = `argMinMax_${this.op}_${this.type}`; + let [s, a] = C.computeOutAndReduceShapes(e, n); + this.outputShape = s.length === 0 ? [1] : s, this.dispatchLayout = X(this.outputShape), y.sizeFromShape(a) < 32 ? (this.type = "plain", this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize)) : (this.type = "shared", this.dispatch = H(this.dispatchLayout, this.outputShape, [1, 1, 1])), this.inputShape = e, this.shaderKey = `argMinMax_${this.op}_${this.type}`; } getUserCode() { - let t8 = this.workgroupSize[0], e = () => this.inputShape.length === 1 ? "uniforms.xShape" : `uniforms.xShape.${Oo(this.inputShape.length - 1)}`, o = () => { + let e = this.workgroupSize[0], t10 = () => this.inputShape.length === 1 ? "uniforms.xShape" : `uniforms.xShape.${un(this.inputShape.length - 1)}`, o = () => { let n = ""; if (this.outputShape.length === 1) this.inputShape.length !== 1 && (n += "outputCoords,"); else for (let s = 0; s < this.outputShape.length; s++) - n += `outputCoords.${Oo(s)},`; + n += `outputCoords.${un(s)},`; return n; }; return this.type === "shared" ? ` @@ -29042,19 +30184,19 @@ var jc = class { } ${` - var xBestIndices : array; - var xBestValues : array; + var xBestIndices : array; + var xBestValues : array; `} ${G("index")} { - let outputIndex = index / ${t8}; - let reduceLength = ${e()}; + let outputIndex = index / ${e}; + let reduceLength = ${t10()}; var bestIndex = i32(localId.x); var bestValue = uniforms.infinityValue; let outputCoords = getCoordsFromIndex(outputIndex); for (var k = i32(localId.x); k < reduceLength && outputIndex < uniforms.size; - k = k + ${t8}) { + k = k + ${e}) { let candidate = getX(${o()} k); if (!isnan(candidate) && candidate ${this.op} bestValue) { bestValue = candidate; @@ -29065,7 +30207,7 @@ var jc = class { xBestIndices[localId.x] = bestIndex; workgroupBarrier(); - var reduceSize = min(u32(reduceLength), ${t8}u); + var reduceSize = min(u32(reduceLength), ${e}u); for (var currentSize = reduceSize / 2u; reduceSize > 1u; currentSize = reduceSize / 2u) { let interval = DIV_CEIL(reduceSize, 2u); @@ -29091,7 +30233,7 @@ var jc = class { let outputCoords = getCoordsFromIndex(index); var bestIndex = 0; var bestValue = getX(${o()} 0); - let reduceLength = ${e()}; + let reduceLength = ${t10()}; for (var i = 1; i < reduceLength; i++) { let candidate = getX(${o()} i); if (candidate ${this.op} bestValue) { @@ -29105,33 +30247,33 @@ var jc = class { `; } }; -function Qie(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = w.getAxesPermutation(a, n.shape.length), p = n, u = []; - i != null && (p = xr({ inputs: { x: n }, backend: e, attrs: { perm: i } }), u.push(p), a = w.getInnerMostAxes(a.length, p.shape.length)), w.assertAxesAreInnerMostDims("argMax", [a[0]], p.shape.length); - let c = new jc(p.shape, a[0], "max"), l = [{ type: "float32", data: [Number.NEGATIVE_INFINITY] }], m = e.runWebGPUProgram(c, [p], "int32", l); - return u.forEach((d) => e.disposeData(d.dataId)), m; -} -var jz = { kernelName: Ys, backendName: "webgpu", kernelFunc: Qie }; -function Zie(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = w.getAxesPermutation(a, n.shape.length), p = n, u = []; - i != null && (p = xr({ inputs: { x: n }, backend: e, attrs: { perm: i } }), u.push(p), a = w.getInnerMostAxes(a.length, p.shape.length)), w.assertAxesAreInnerMostDims("argMin", [a[0]], p.shape.length); - let c = new jc(p.shape, a[0], "min"), l = [{ type: "float32", data: [Number.POSITIVE_INFINITY] }], m = e.runWebGPUProgram(c, [p], "int32", l); - return u.forEach((d) => e.disposeData(d.dataId)), m; -} -var Xz = { kernelName: Qs, backendName: "webgpu", kernelFunc: Zie }; -var Jie = ye({ opType: Z.ASIN }); -var Yz = { kernelName: Ko, backendName: "webgpu", kernelFunc: Jie }; -var eue = ye({ opType: Z.ASINH }); -var Qz = { kernelName: qo, backendName: "webgpu", kernelFunc: eue }; -var tue = ye({ opType: Z.ATAN }); -var Zz = { kernelName: jo, backendName: "webgpu", kernelFunc: tue }; -var rue = et({ opType: fe.ATAN2 }); -var Jz = { kernelName: Yo, backendName: "webgpu", kernelFunc: rue }; -var oue = ye({ opType: Z.ATANH }); -var eV = { kernelName: Xo, backendName: "webgpu", kernelFunc: oue }; -var nx = class { - constructor(t8) { - this.variableNames = ["x"], this.uniforms = "strides : vec2,", this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = t8.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "poolWithFilterSizeEqualsOne"; +function Fpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = C.getAxesPermutation(a, n.shape.length), p = n, u = []; + i != null && (p = Cr({ inputs: { x: n }, backend: t10, attrs: { perm: i } }), u.push(p), a = C.getInnerMostAxes(a.length, p.shape.length)), C.assertAxesAreInnerMostDims("argMax", [a[0]], p.shape.length); + let l = new oc(p.shape, a[0], "max"), c = [{ type: "float32", data: [Number.NEGATIVE_INFINITY] }], m = t10.runWebGPUProgram(l, [p], "int32", c); + return u.forEach((d) => t10.disposeData(d.dataId)), m; +} +var bW = { kernelName: na, backendName: "webgpu", kernelFunc: Fpe }; +function Ppe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s } = o, a = y.parseAxisParam(s, n.shape), i = C.getAxesPermutation(a, n.shape.length), p = n, u = []; + i != null && (p = Cr({ inputs: { x: n }, backend: t10, attrs: { perm: i } }), u.push(p), a = C.getInnerMostAxes(a.length, p.shape.length)), C.assertAxesAreInnerMostDims("argMin", [a[0]], p.shape.length); + let l = new oc(p.shape, a[0], "min"), c = [{ type: "float32", data: [Number.POSITIVE_INFINITY] }], m = t10.runWebGPUProgram(l, [p], "int32", c); + return u.forEach((d) => t10.disposeData(d.dataId)), m; +} +var CW = { kernelName: sa, backendName: "webgpu", kernelFunc: Ppe }; +var Ope = ye({ opType: Z.ASIN }); +var wW = { kernelName: Cn, backendName: "webgpu", kernelFunc: Ope }; +var Mpe = ye({ opType: Z.ASINH }); +var SW = { kernelName: wn, backendName: "webgpu", kernelFunc: Mpe }; +var Lpe = ye({ opType: Z.ATAN }); +var IW = { kernelName: Sn, backendName: "webgpu", kernelFunc: Lpe }; +var Bpe = tt({ opType: fe.ATAN2 }); +var vW = { kernelName: vn, backendName: "webgpu", kernelFunc: Bpe }; +var zpe = ye({ opType: Z.ATANH }); +var kW = { kernelName: In, backendName: "webgpu", kernelFunc: zpe }; +var yx = class { + constructor(e) { + this.variableNames = ["x"], this.uniforms = "strides : vec2,", this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = e.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "poolWithFilterSizeEqualsOne"; } getUserCode() { return ` @@ -29152,22 +30294,22 @@ var nx = class { `; } }; -var Ba = class { - constructor(t8, e, o = false, n = false, s = false) { - if (this.variableNames = ["x"], this.uniforms = "strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,", this.workgroupSize = [128, 1, 1], this.size = true, e === "avg" && o) +var Ka = class { + constructor(e, t10, o = false, n = false, s = false) { + if (this.variableNames = ["x"], this.uniforms = "strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,", this.workgroupSize = [128, 1, 1], this.size = true, t10 === "avg" && o) throw new Error("Cannot compute positions for average pool."); - this.outputShape = t8.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.poolType = e, this.computePositions = o, this.flattenPositions = n, this.includeBatchIndex = s, this.shaderKey = `pool2D_${e}_${o}_${n}_${s}`; + this.outputShape = e.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.poolType = t10, this.computePositions = o, this.flattenPositions = n, this.includeBatchIndex = s, this.shaderKey = `pool2D_${t10}_${o}_${n}_${s}`; } getUserCode() { - let t8; - this.poolType === "avg" ? t8 = "resultValue = resultValue + value; count = count + 1.0;" : this.computePositions ? t8 = `let currMaxValue = mix(value, maxValue, maxValueFound); + let e; + this.poolType === "avg" ? e = "resultValue = resultValue + value; count = count + 1.0;" : this.computePositions ? e = `let currMaxValue = mix(value, maxValue, maxValueFound); if (value >= currMaxValue) { maxValue = value; maxValueFound = 1.0; maxPosition = ${this.flattenPositions ? this.includeBatchIndex ? "((batch * uniforms.xShape[1] + xR) * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d" : "(xR * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d" : "wR * uniforms.filterDims.y + wC"}; - }` : t8 = "resultValue = max(value, resultValue);"; - let e = "resultValue"; - return this.poolType === "avg" && (e = "resultValue / max(count, 1.0)"), ` + }` : e = "resultValue = max(value, resultValue);"; + let t10 = "resultValue"; + return this.poolType === "avg" && (t10 = "resultValue / max(count, 1.0)"), ` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -29196,32 +30338,32 @@ var Ba = class { } let value = getX(batch, xR, xC, d); - ${t8} + ${e} } } - ${this.computePositions ? "setOutputAtIndexI32(index, maxPosition);" : `setOutputAtIndex(index, ${e});`} + ${this.computePositions ? "setOutputAtIndexI32(index, maxPosition);" : `setOutputAtIndex(index, ${t10});`} } } `; } }; -var wu = class { - constructor(t8, e, o = false, n = false, s = false) { - if (this.variableNames = ["x"], this.uniforms = "strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,", this.workgroupSize = [128, 1, 1], this.size = true, e === "avg" && o) +var $u = class { + constructor(e, t10, o = false, n = false, s = false) { + if (this.variableNames = ["x"], this.uniforms = "strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,", this.workgroupSize = [128, 1, 1], this.size = true, t10 === "avg" && o) throw new Error("Cannot compute positions for average pool."); - this.outputShape = t8.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.poolType = e, this.computePositions = o, this.flattenPositions = n, this.includeBatchIndex = s, this.shaderKey = `pool3D_${e}_${o}_${n}_${s}`; + this.outputShape = e.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.poolType = t10, this.computePositions = o, this.flattenPositions = n, this.includeBatchIndex = s, this.shaderKey = `pool3D_${t10}_${o}_${n}_${s}`; } getUserCode() { - let t8; - this.poolType === "avg" ? t8 = "resultValue += value; count += 1.0;" : this.computePositions ? t8 = `let currMaxValue = mix(value, maxValue, maxValueFound); + let e; + this.poolType === "avg" ? e = "resultValue += value; count += 1.0;" : this.computePositions ? e = `let currMaxValue = mix(value, maxValue, maxValueFound); if (value >= currMaxValue) { maxValue = value; maxValueFound = 1.0; maxPosition = ${this.flattenPositions ? this.includeBatchIndex ? "(((batch * uniforms.xShape.y + xD) * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch" : "((xD * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch" : "wD * uniforms.filterDims.y * uniforms.filterDims.y + wR * uniforms.filterDims.z + wC"}; - }` : t8 = "resultValue = max(value, resultValue);"; - let e = "resultValue"; - return this.poolType === "avg" && (e = "resultValue / max(count, 1.0)"), ` + }` : e = "resultValue = max(value, resultValue);"; + let t10 = "resultValue"; + return this.poolType === "avg" && (t10 = "resultValue / max(count, 1.0)"), ` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -29257,53 +30399,53 @@ var wu = class { } let value = getX(batch, xD, xR, xC, ch); - ${t8} + ${e} } } } - ${this.computePositions ? "setOutputAtIndexI32(index, maxPosition);" : `setOutputAtIndex(index, ${e});`} + ${this.computePositions ? "setOutputAtIndexI32(index, maxPosition);" : `setOutputAtIndex(index, ${t10});`} } } `; } }; -function e0(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { reductionIndices: s, keepDims: a } = o; - return Jr(n, s, a, "max", e); +function zv(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { reductionIndices: s, keepDims: a } = o; + return ao(n, s, a, "max", t10); } -var tV = { kernelName: zn, backendName: "webgpu", kernelFunc: e0 }; -function t0(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { keepDims: s, axis: a } = o; - return Jr(n, a, s, "mean", e); +var NW = { kernelName: os, backendName: "webgpu", kernelFunc: zv }; +function Vv(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { keepDims: s, axis: a } = o; + return ao(n, a, s, "mean", t10); } -var rV = { kernelName: Un, backendName: "webgpu", kernelFunc: t0 }; -function sx(r15, t8, e, o) { - if (t8.filterWidth === 1 && t8.filterHeight === 1 && y.arraysEqual(t8.inShape, t8.outShape)) - return At({ inputs: { x: r15 }, backend: o }); - if (t8.filterWidth === t8.inWidth && t8.filterHeight === t8.inHeight && t8.batchSize === 1 && t8.padInfo.type === "VALID") { - let a = r15.shape.length, i = pe({ inputs: { x: r15 }, backend: o, attrs: { shape: [r15.shape[a - 3] * r15.shape[a - 2], r15.shape[a - 1]] } }), p; - e === "avg" ? p = t0({ inputs: { x: i }, backend: o, attrs: { axis: 0, keepDims: false } }) : (y.assert(e === "max", () => `Invalid pool type ${e}`), p = e0({ inputs: { x: i }, backend: o, attrs: { reductionIndices: 0, keepDims: false } })); - let u = pe({ inputs: { x: p }, backend: o, attrs: { shape: t8.outShape } }); +var TW = { kernelName: ss, backendName: "webgpu", kernelFunc: Vv }; +function bx(r16, e, t10, o) { + if (e.filterWidth === 1 && e.filterHeight === 1 && y.arraysEqual(e.inShape, e.outShape)) + return Pt({ inputs: { x: r16 }, backend: o }); + if (e.filterWidth === e.inWidth && e.filterHeight === e.inHeight && e.batchSize === 1 && e.padInfo.type === "VALID") { + let a = r16.shape.length, i = le({ inputs: { x: r16 }, backend: o, attrs: { shape: [r16.shape[a - 3] * r16.shape[a - 2], r16.shape[a - 1]] } }), p; + t10 === "avg" ? p = Vv({ inputs: { x: i }, backend: o, attrs: { axis: 0, keepDims: false } }) : (y.assert(t10 === "max", () => `Invalid pool type ${t10}`), p = zv({ inputs: { x: i }, backend: o, attrs: { reductionIndices: 0, keepDims: false } })); + let u = le({ inputs: { x: p }, backend: o, attrs: { shape: e.outShape } }); return o.disposeData(i.dataId), o.disposeData(p.dataId), u; } - let n, s = [{ type: "int32", data: [t8.strideHeight, t8.strideWidth] }]; - return t8.filterHeight === 1 && t8.filterWidth === 1 ? n = new nx(t8) : (e === "avg" ? n = new Ba(t8, "avg") : (y.assert(e === "max", () => `Invalid pool type ${e}`), n = new Ba(t8, "max")), s.push({ type: "int32", data: [t8.padInfo.top, t8.padInfo.left] }, { type: "int32", data: [t8.dilationHeight, t8.dilationWidth] }, { type: "int32", data: [t8.inHeight, t8.inWidth] }, { type: "int32", data: [t8.effectiveFilterHeight, t8.effectiveFilterWidth] })), o.runWebGPUProgram(n, [r15], r15.dtype, s); + let n, s = [{ type: "int32", data: [e.strideHeight, e.strideWidth] }]; + return e.filterHeight === 1 && e.filterWidth === 1 ? n = new yx(e) : (t10 === "avg" ? n = new Ka(e, "avg") : (y.assert(t10 === "max", () => `Invalid pool type ${t10}`), n = new Ka(e, "max")), s.push({ type: "int32", data: [e.padInfo.top, e.padInfo.left] }, { type: "int32", data: [e.dilationHeight, e.dilationWidth] }, { type: "int32", data: [e.inHeight, e.inWidth] }, { type: "int32", data: [e.effectiveFilterHeight, e.effectiveFilterWidth] })), o.runWebGPUProgram(n, [r16], r16.dtype, s); } -function nue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, u = 1, c = w.computePool2DInfo(n.shape, s, a, u, i, p); - return sx(n, c, "avg", e); +function Vpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, l = C.computePool2DInfo(n.shape, s, a, 1, i, p); + return bx(n, l, "avg", t10); } -var oV = { kernelName: Qo, backendName: "webgpu", kernelFunc: nue }; -function sue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dataFormat: p, dimRoundingMode: u } = o, c = [1, 1, 1], l = w.computePool3DInfo(n.shape, s, a, c, i, u, p), m = new wu(l, "avg"), d = [{ type: "int32", data: [l.strideDepth, l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.padInfo.front, l.padInfo.top, l.padInfo.left] }, { type: "int32", data: [l.inDepth, l.inHeight, l.inWidth] }, { type: "int32", data: [l.effectiveFilterDepth, l.effectiveFilterHeight, l.effectiveFilterWidth] }]; - return e.runWebGPUProgram(m, [n], n.dtype, d); +var _W = { kernelName: kn, backendName: "webgpu", kernelFunc: Vpe }; +function Wpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dataFormat: p, dimRoundingMode: u } = o, l = [1, 1, 1], c = C.computePool3DInfo(n.shape, s, a, l, i, u, p), m = new $u(c, "avg"), d = [{ type: "int32", data: [c.strideDepth, c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.padInfo.front, c.padInfo.top, c.padInfo.left] }, { type: "int32", data: [c.inDepth, c.inHeight, c.inWidth] }, { type: "int32", data: [c.effectiveFilterDepth, c.effectiveFilterHeight, c.effectiveFilterWidth] }]; + return t10.runWebGPUProgram(m, [n], n.dtype, d); } -var nV = { kernelName: Zs, backendName: "webgpu", kernelFunc: sue }; -var ax = class { - constructor(t8) { +var EW = { kernelName: aa, backendName: "webgpu", kernelFunc: Wpe }; +var Cx = class { + constructor(e) { this.variableNames = ["dy"], this.uniforms = `strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, - outHeight : i32, outWidth : i32, avgMultiplier : f32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "avgPool2DBackprop"; + outHeight : i32, outWidth : i32, avgMultiplier : f32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "avgPool2DBackprop"; } getUserCode() { return ` @@ -29347,10 +30489,10 @@ var ax = class { `; } }; -var ix = class { - constructor(t8) { +var wx = class { + constructor(e) { this.variableNames = ["dy"], this.uniforms = `strides : vec3, pads : vec3, filterDims : vec3, - outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "avgPool3DBackprop"; + outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "avgPool3DBackprop"; } getUserCode() { return ` @@ -29404,86 +30546,86 @@ var ix = class { `; } }; -function aue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: c } = o, l = w.computePool3DInfo(a.shape, i, p, 1, u, c), m = new ix(l), d = 1 / (l.filterDepth * l.filterHeight * l.filterWidth), f = [{ type: "int32", data: [l.strideDepth, l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.effectiveFilterDepth - 1 - l.padInfo.front, l.effectiveFilterHeight - 1 - l.padInfo.top, l.effectiveFilterWidth - 1 - l.padInfo.left] }, { type: "int32", data: [l.effectiveFilterDepth, l.effectiveFilterHeight, l.effectiveFilterWidth] }, { type: "int32", data: [l.outDepth] }, { type: "int32", data: [l.outHeight] }, { type: "int32", data: [l.outWidth] }, { type: "float32", data: [d] }]; - return e.runWebGPUProgram(m, [n], a.dtype, f); +function Upe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: l } = o, c = C.computePool3DInfo(a.shape, i, p, 1, u, l), m = new wx(c), d = 1 / (c.filterDepth * c.filterHeight * c.filterWidth), f = [{ type: "int32", data: [c.strideDepth, c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.effectiveFilterDepth - 1 - c.padInfo.front, c.effectiveFilterHeight - 1 - c.padInfo.top, c.effectiveFilterWidth - 1 - c.padInfo.left] }, { type: "int32", data: [c.effectiveFilterDepth, c.effectiveFilterHeight, c.effectiveFilterWidth] }, { type: "int32", data: [c.outDepth] }, { type: "int32", data: [c.outHeight] }, { type: "int32", data: [c.outWidth] }, { type: "float32", data: [d] }]; + return t10.runWebGPUProgram(m, [n], a.dtype, f); } -var sV = { kernelName: Ei, backendName: "webgpu", kernelFunc: aue }; -function iue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, a = s; - mm([n, s], "avgPoolGrad"); - let { filterSize: i, strides: p, pad: u } = o, c = w.computePool2DInfo(a.shape, i, p, 1, u), l = new ax(c), m = 1 / (c.filterHeight * c.filterWidth), d = [{ type: "int32", data: [c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.effectiveFilterHeight - 1 - c.padInfo.top, c.effectiveFilterWidth - 1 - c.padInfo.left] }, { type: "int32", data: [c.dilationHeight, c.dilationWidth] }, { type: "int32", data: [c.effectiveFilterHeight, c.effectiveFilterWidth] }, { type: "int32", data: [c.outHeight] }, { type: "int32", data: [c.outWidth] }, { type: "float32", data: [m] }]; - return e.runWebGPUProgram(l, [n], a.dtype, d); +var $W = { kernelName: Vi, backendName: "webgpu", kernelFunc: Upe }; +function Gpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, a = s; + wm([n, s], "avgPoolGrad"); + let { filterSize: i, strides: p, pad: u } = o, l = C.computePool2DInfo(a.shape, i, p, 1, u), c = new Cx(l), m = 1 / (l.filterHeight * l.filterWidth), d = [{ type: "int32", data: [l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.effectiveFilterHeight - 1 - l.padInfo.top, l.effectiveFilterWidth - 1 - l.padInfo.left] }, { type: "int32", data: [l.dilationHeight, l.dilationWidth] }, { type: "int32", data: [l.effectiveFilterHeight, l.effectiveFilterWidth] }, { type: "int32", data: [l.outHeight] }, { type: "int32", data: [l.outWidth] }, { type: "float32", data: [m] }]; + return t10.runWebGPUProgram(c, [n], a.dtype, d); } -var aV = { kernelName: $i, backendName: "webgpu", kernelFunc: iue }; -function uue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { a: n, b: s } = t8, { transposeA: a, transposeB: i } = o; - return _p({ a: n, b: s, transposeA: a, transposeB: i, backend: e }); +var RW = { kernelName: zi, backendName: "webgpu", kernelFunc: Gpe }; +function Hpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { a: n, b: s } = e, { transposeA: a, transposeB: i } = o; + return Op({ a: n, b: s, transposeA: a, transposeB: i, backend: t10 }); } -var iV = { kernelName: Zo, backendName: "webgpu", kernelFunc: uue }; -var ux = class { - constructor(t8, e) { - this.variableNames = ["source"], this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.rank = e.length, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.start = t8, this.uniforms = `start : ${ft(t8.length)}, `, this.shaderKey = "slice"; +var DW = { kernelName: Nn, backendName: "webgpu", kernelFunc: Hpe }; +var Sx = class { + constructor(e, t10) { + this.variableNames = ["source"], this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t10, this.rank = t10.length, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.start = e, this.uniforms = `start : ${ft(e.length)}, `, this.shaderKey = "slice"; } getUserCode() { - let t8 = ft(this.rank), e = pue(this.rank), o; - return this.start.length === 1 ? o = this.outputShape.map((s, a) => "sourceLoc = uniforms.start + coords;") : o = this.outputShape.map((s, a) => `sourceLoc.${r0[a]} = uniforms.start.${Oo(a)} + coords.${r0[a]};`), ` + let e = ft(this.rank), t10 = Kpe(this.rank), o; + return this.start.length === 1 ? o = this.outputShape.map((s, a) => "sourceLoc = uniforms.start + coords;") : o = this.outputShape.map((s, a) => `sourceLoc.${Wv[a]} = uniforms.start.${un(a)} + coords.${Wv[a]};`), ` ${G("index")} { if (index < uniforms.size) { - var sourceLoc : ${t8}; + var sourceLoc : ${e}; let coords = getCoordsFromIndex(index); ${o.join(` `)} - setOutputAtIndex(index, getSource(${e})); + setOutputAtIndex(index, getSource(${t10})); } } `; } }; -var r0 = ["x", "y", "z", "w", "u", "v"]; -function pue(r15) { - if (r15 === 1) +var Wv = ["x", "y", "z", "w", "u", "v"]; +function Kpe(r16) { + if (r16 === 1) return "sourceLoc"; - if (r15 <= 6) - return r0.slice(0, r15).map((t8) => `sourceLoc.${t8}`).join(","); - throw Error(`Slicing for rank ${r15} is not yet supported`); + if (r16 <= 6) + return Wv.slice(0, r16).map((e) => `sourceLoc.${e}`).join(","); + throw Error(`Slicing for rank ${r16} is not yet supported`); } -function Hs(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { begin: s, size: a } = o, [i, p] = pt.parseSliceParams(n, s, a); - if (pt.assertParamsValid(n, i, p), e.shouldExecuteOnCPU([n]) || n.dtype === "string") { - let l = e.tensorMap.get(n.dataId), m = Az(l.values, i, p, n.shape, n.dtype); - return e.makeTensorInfo(p, n.dtype, m); +function ea(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { begin: s, size: a } = o, [i, p] = nt.parseSliceParams(n, s, a); + if (nt.assertParamsValid(n, i, p), t10.shouldExecuteOnCPU([n]) || n.dtype === "string") { + let c = t10.tensorMap.get(n.dataId), m = nW(c.values, i, p, n.shape, n.dtype); + return t10.makeTensorInfo(p, n.dtype, m); } if (y.sizeFromShape(p) === 0) - return e.makeTensorInfo(p, n.dtype, []); - let u = new ux(i, p), c = [{ type: "int32", data: i }]; - return e.runWebGPUProgram(u, [n], n.dtype, c); + return t10.makeTensorInfo(p, n.dtype, []); + let u = new Sx(i, p), l = [{ type: "int32", data: i }]; + return t10.runWebGPUProgram(u, [n], n.dtype, l); } -var uV = { kernelName: ha, backendName: "webgpu", kernelFunc: Hs }; -var cue = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, crops: a } = o; +var AW = { kernelName: _s, backendName: "webgpu", kernelFunc: ea }; +var qpe = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, crops: a } = o; y.assert(n.shape.length <= 4, () => "batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet"); - let i = s.reduce((b, C) => b * C), p = w.getReshaped(n.shape, s, i), u = w.getPermuted(p.length, s.length), c = w.getReshapedPermuted(n.shape, s, i), l = w.getSliceBeginCoords(a, s.length), m = w.getSliceSize(c, a, s.length), d = [], f = pe({ inputs: { x: n }, backend: e, attrs: { shape: p } }), h = xr({ inputs: { x: f }, backend: e, attrs: { perm: u } }), g = pe({ inputs: { x: h }, backend: e, attrs: { shape: c } }), x = Hs({ inputs: { x: g }, backend: e, attrs: { begin: l, size: m } }); - return d.push(f), d.push(h), d.push(g), d.forEach((b) => e.disposeData(b.dataId)), x; + let i = s.reduce((b, w) => b * w), p = C.getReshaped(n.shape, s, i), u = C.getPermuted(p.length, s.length), l = C.getReshapedPermuted(n.shape, s, i), c = C.getSliceBeginCoords(a, s.length), m = C.getSliceSize(l, a, s.length), d = [], f = le({ inputs: { x: n }, backend: t10, attrs: { shape: p } }), h = Cr({ inputs: { x: f }, backend: t10, attrs: { perm: u } }), g = le({ inputs: { x: h }, backend: t10, attrs: { shape: l } }), x = ea({ inputs: { x: g }, backend: t10, attrs: { begin: c, size: m } }); + return d.push(f), d.push(h), d.push(g), d.forEach((b) => t10.disposeData(b.dataId)), x; }; -var pV = { kernelName: Js, backendName: "webgpu", kernelFunc: cue }; -var lue = ` +var FW = { kernelName: ia, backendName: "webgpu", kernelFunc: qpe }; +var jpe = ` fn bincount_write(index: i32, value: f32) { - ${Yr("&result[index]", "value", "float32")} + ${oo("&result[index]", "value", "float32")} } `; -var mue = ` +var Xpe = ` fn bincount_write(index: i32, value: f32) { atomicStore(&result[index], bitcast(value)); } `; -var Xc = class { - constructor(t8, e, o = false) { - this.outputShape = [], this.variableNames = ["x"], this.uniforms = "binCountSize : i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.hasWeights = true, this.binaryOutput = false, this.outputShape = t8, this.rank = t8.length, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.binaryOutput = o, o && (this.atomic = false), this.hasWeights = e, this.hasWeights && this.variableNames.push("w"), this.shaderKey = `bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`; +var nc = class { + constructor(e, t10, o = false) { + this.outputShape = [], this.variableNames = ["x"], this.uniforms = "binCountSize : i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.hasWeights = true, this.binaryOutput = false, this.outputShape = e, this.rank = e.length, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.binaryOutput = o, o && (this.atomic = false), this.hasWeights = t10, this.hasWeights && this.variableNames.push("w"), this.shaderKey = `bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`; } getUserCode() { return ` - ${this.binaryOutput ? mue : lue} + ${this.binaryOutput ? Xpe : jpe} ${G("index")} { ${this.rank === 1 ? `if (index < uniforms.xShape) { let indexVal = i32(getX(index)); @@ -29503,14 +30645,14 @@ var Xc = class { `; } }; -function due(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, weights: s } = t8, { size: a } = o, i = y.sizeFromShape(n.shape), u = y.sizeFromShape(s.shape) > 0, c = [a], l = s.dtype, m = vt({ backend: e, attrs: { shape: c, value: 0, dtype: l } }), d = new Xc([i], u), f = [{ type: "int32", data: [a] }], h = u ? [n, s] : [n]; - return e.runWebGPUProgram(d, h, l, f, m); +function Ype(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, weights: s } = e, { size: a } = o, i = y.sizeFromShape(n.shape), u = y.sizeFromShape(s.shape) > 0, l = [a], c = s.dtype, m = Nt({ backend: t10, attrs: { shape: l, value: 0, dtype: c } }), d = new nc([i], u), f = [{ type: "int32", data: [a] }], h = u ? [n, s] : [n]; + return t10.runWebGPUProgram(d, h, c, f, m); } -var cV = { kernelName: Jo, backendName: "webgpu", kernelFunc: due }; -var px = class { - constructor(t8) { - this.outputShape = [], this.variableNames = ["s0", "s1"], this.uniforms = "s0Size : i32, s1Size : i32, ", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [t8], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "broadcastArgs"; +var PW = { kernelName: Tn, backendName: "webgpu", kernelFunc: Ype }; +var Ix = class { + constructor(e) { + this.outputShape = [], this.variableNames = ["s0", "s1"], this.uniforms = "s0Size : i32, s1Size : i32, ", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [e], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "broadcastArgs"; } getUserCode() { return ` @@ -29541,61 +30683,61 @@ var px = class { `; } }; -function fue(r15) { - let { inputs: t8, backend: e } = r15, { s0: o, s1: n } = t8; - if (e.shouldExecuteOnCPU([o, n])) { - let c = e.tensorMap.get(o.dataId), l = e.tensorMap.get(n.dataId), m = c.values, d = l.values, f = w.assertAndGetBroadcastShape(Array.from(m), Array.from(d)); - return e.makeTensorInfo([f.length], "int32", Int32Array.from(f)); +function Qpe(r16) { + let { inputs: e, backend: t10 } = r16, { s0: o, s1: n } = e; + if (t10.shouldExecuteOnCPU([o, n])) { + let l = t10.tensorMap.get(o.dataId), c = t10.tensorMap.get(n.dataId), m = l.values, d = c.values, f = C.assertAndGetBroadcastShape(Array.from(m), Array.from(d)); + return t10.makeTensorInfo([f.length], "int32", Int32Array.from(f)); } - let s = y.sizeFromShape(o.shape), a = y.sizeFromShape(n.shape), i = Math.max(s, a), p = new px(i), u = [{ type: "int32", data: [s] }, { type: "int32", data: [a] }]; - return e.runWebGPUProgram(p, [o, n], "int32", u); + let s = y.sizeFromShape(o.shape), a = y.sizeFromShape(n.shape), i = Math.max(s, a), p = new Ix(i), u = [{ type: "int32", data: [s] }, { type: "int32", data: [a] }]; + return t10.runWebGPUProgram(p, [o, n], "int32", u); } -var lV = { kernelName: ea, backendName: "webgpu", kernelFunc: fue }; -var o0 = et({ opType: fe.NOT_EQUAL, dtype: "bool", cpuKernelImpl: Tz }); -var mV = { kernelName: Yn, backendName: "webgpu", kernelFunc: o0 }; -function Ii(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = e.tensorMap.get(o.dataId); - return At({ inputs: { x: n.complexTensorInfos.real }, backend: e }); +var OW = { kernelName: ua, backendName: "webgpu", kernelFunc: Qpe }; +var Uv = tt({ opType: fe.NOT_EQUAL, dtype: "bool", cpuKernelImpl: ZV }); +var MW = { kernelName: Ro, backendName: "webgpu", kernelFunc: Uv }; +function Fi(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = t10.tensorMap.get(o.dataId); + return Pt({ inputs: { x: n.complexTensorInfos.real }, backend: t10 }); } -var dV = { kernelName: Gi, backendName: "webgpu", kernelFunc: Ii }; -function fV(r15, t8) { - let e = new Zr(r15.shape, Z.TO_INT), o = t8.runWebGPUProgram(e, [r15], "int32"); +var LW = { kernelName: si, backendName: "webgpu", kernelFunc: Fi }; +function BW(r16, e) { + let t10 = new so(r16.shape, Z.TO_INT), o = e.runWebGPUProgram(t10, [r16], "int32"); return { dataId: o.dataId, shape: o.shape, dtype: o.dtype }; } -function n0(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { dtype: s } = o; +function Gv(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dtype: s } = o; if (s === "complex64") { if (n.dtype === "complex64") - return At({ inputs: { x: n }, backend: e }); - let a = Ur(n.shape), i = n0({ inputs: { x: n }, backend: e, attrs: { dtype: "float32" } }), p = xo({ inputs: { real: i, imag: a }, backend: e }); - return a.dispose(), e.disposeData(i.dataId), p; + return Pt({ inputs: { x: n }, backend: t10 }); + let a = Yr(n.shape), i = Gv({ inputs: { x: n }, backend: t10, attrs: { dtype: "float32" } }), p = Uo({ inputs: { real: i, imag: a }, backend: t10 }); + return a.dispose(), t10.disposeData(i.dataId), p; } if (n.dtype === "complex64") { - let a = Ii({ inputs: { input: n }, backend: e }), i = n0({ inputs: { x: a }, backend: e, attrs: { dtype: s } }); - return e.disposeData(a.dataId), i; + let a = Fi({ inputs: { input: n }, backend: t10 }), i = Gv({ inputs: { x: a }, backend: t10, attrs: { dtype: s } }); + return t10.disposeData(a.dataId), i; } if (!y.hasEncodingLoss(n.dtype, s)) { - let a = At({ inputs: { x: n }, backend: e }); + let a = Pt({ inputs: { x: n }, backend: t10 }); return { dataId: a.dataId, shape: a.shape, dtype: s }; } - if (e.shouldExecuteOnCPU([n])) { - let a = e.tensorMap.get(n.dataId).values, [i, p, u] = iz(a, n.shape, n.dtype, s); - return e.makeTensorInfo(i, p, u); + if (t10.shouldExecuteOnCPU([n])) { + let a = t10.tensorMap.get(n.dataId).values, [i, p, u] = DV(a, n.shape, n.dtype, s); + return t10.makeTensorInfo(i, p, u); } if (s === "int32") - return fV(n, e); + return BW(n, t10); if (s === "bool") { - let a = e.makeTensorInfo([], "bool", y.getTypedArrayFromDType("bool", 1)), p = o0({ inputs: { a: n, b: a }, backend: e }); - return e.disposeData(a.dataId), p; + let a = t10.makeTensorInfo([], "bool", y.getTypedArrayFromDType("bool", 1)), p = Uv({ inputs: { a: n, b: a }, backend: t10 }); + return t10.disposeData(a.dataId), p; } throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`); } -var hV = { kernelName: yo, backendName: "webgpu", kernelFunc: n0 }; -var hue = ye({ opType: Z.CEIL, cpuKernelImpl: uz }); -var gV = { kernelName: en, backendName: "webgpu", kernelFunc: hue }; -var cx = class { - constructor(t8) { - this.variableNames = ["A"], this.uniforms = "minVal : f32, maxVal : f32,", this.workPerThread = 4, this.workgroupSize = [64, 1, 1], this.outputComponent = 4, this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.shaderKey = "clipVec4"; +var zW = { kernelName: ho, backendName: "webgpu", kernelFunc: Gv }; +var Zpe = ye({ opType: Z.CEIL, cpuKernelImpl: AV }); +var VW = { kernelName: go, backendName: "webgpu", kernelFunc: Zpe }; +var vx = class { + constructor(e) { + this.variableNames = ["A"], this.uniforms = "minVal : f32, maxVal : f32,", this.workPerThread = 4, this.workgroupSize = [64, 1, 1], this.outputComponent = 4, this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.shaderKey = "clipVec4"; } getUserCode() { return ` @@ -29611,9 +30753,9 @@ var cx = class { `; } }; -var lx = class { - constructor(t8) { - this.variableNames = ["A"], this.uniforms = "minVal : f32, maxVal : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "clip"; +var kx = class { + constructor(e) { + this.variableNames = ["A"], this.uniforms = "minVal : f32, maxVal : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "clip"; } getUserCode() { return ` @@ -29630,14 +30772,14 @@ var lx = class { `; } }; -function gue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { clipValueMin: s, clipValueMax: a } = o, i, p = [{ type: "float32", data: [s] }, { type: "float32", data: [a] }]; - return y.sizeFromShape(n.shape) % 4 === 0 ? i = new cx(n.shape) : i = new lx(n.shape), e.runWebGPUProgram(i, [n], n.dtype, p); +function Jpe(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { clipValueMin: s, clipValueMax: a } = o, i, p = [{ type: "float32", data: [s] }, { type: "float32", data: [a] }]; + return y.sizeFromShape(n.shape) % 4 === 0 ? i = new vx(n.shape) : i = new kx(n.shape), t10.runWebGPUProgram(i, [n], n.dtype, p); } -var xV = { kernelName: bo, backendName: "webgpu", kernelFunc: gue }; -var mx = class { - constructor(t8) { - this.outputShape = [], this.variableNames = ["real", "imag"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "complexAbs"; +var WW = { kernelName: Go, backendName: "webgpu", kernelFunc: Jpe }; +var Nx = class { + constructor(e) { + this.outputShape = [], this.variableNames = ["real", "imag"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "complexAbs"; } getUserCode() { return ` @@ -29655,31 +30797,31 @@ var mx = class { `; } }; -function yV(r15, t8) { - return { dataId: t8.dataId, dtype: t8.dtype, shape: r15.shape }; +function UW(r16, e) { + return { dataId: e.dataId, dtype: e.dtype, shape: r16.shape }; } -function xue(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8, n = e.tensorMap.get(o.dataId), s = new mx(o.shape), a = [yV(o, n.complexTensorInfos.real), yV(o, n.complexTensorInfos.imag)]; - return e.runWebGPUProgram(s, a, a[0].dtype); +function ele(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e, n = t10.tensorMap.get(o.dataId), s = new Nx(o.shape), a = [UW(o, n.complexTensorInfos.real), UW(o, n.complexTensorInfos.imag)]; + return t10.runWebGPUProgram(s, a, a[0].dtype); } -var bV = { kernelName: Di, backendName: "webgpu", kernelFunc: xue }; -var dx = class { - constructor(t8) { - this.uniforms = "", this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = w.computeOutShape(t8, 1), this.variableNames = t8.map((e, o) => `T${o}`), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.offsetLength = t8.length - 1; - for (let e = 0; e < this.offsetLength; e++) - this.uniforms += `offset${e} : i32,`; +var GW = { kernelName: Wi, backendName: "webgpu", kernelFunc: ele }; +var Tx = class { + constructor(e) { + this.uniforms = "", this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = C.computeOutShape(e, 1), this.variableNames = e.map((t10, o) => `T${o}`), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]), this.offsetLength = e.length - 1; + for (let t10 = 0; t10 < this.offsetLength; t10++) + this.uniforms += `offset${t10} : i32,`; this.shaderKey = "concat"; } getUserCode() { - let t8 = []; + let e = []; if (this.offsetLength > 0) { - t8.push("if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }"); + e.push("if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }"); for (let s = 1; s < this.offsetLength; s++) - t8.push(`else if (yC < uniforms.offset${[s]}){ setOutputAtCoords(coords.x, coords.y, getT${s}(yR, yC - uniforms.offset${s - 1})); }`); + e.push(`else if (yC < uniforms.offset${[s]}){ setOutputAtCoords(coords.x, coords.y, getT${s}(yR, yC - uniforms.offset${s - 1})); }`); let o = this.offsetLength, n = this.offsetLength - 1; - t8.push(`else { setOutputAtCoords(coords.x, coords.y, getT${o}(yR, yC - uniforms.offset${n})); }`); + e.push(`else { setOutputAtCoords(coords.x, coords.y, getT${o}(yR, yC - uniforms.offset${n})); }`); } else - t8.push("setOutputAtCoords(coords.x, coords.y, getT0(yR, yC));"); + e.push("setOutputAtCoords(coords.x, coords.y, getT0(yR, yC));"); return ` ${G("index")} { for(var i = 0; i < ${this.workPerThread}; i = i + 1) { @@ -29689,7 +30831,7 @@ var dx = class { let yR = coords.x; let yC = coords.y; - ${t8.join(` + ${e.join(` `)} } } @@ -29697,64 +30839,64 @@ var dx = class { `; } }; -function $p(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8, n = e.tensorMap.get(o.dataId); - return At({ inputs: { x: n.complexTensorInfos.imag }, backend: e }); +function Mp(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e, n = t10.tensorMap.get(o.dataId); + return Pt({ inputs: { x: n.complexTensorInfos.imag }, backend: t10 }); } -var CV = { kernelName: Vi, backendName: "webgpu", kernelFunc: $p }; -function Yc(r15, t8, e) { - let o = r15[0].dtype; +var HW = { kernelName: Qi, backendName: "webgpu", kernelFunc: Mp }; +function sc(r16, e, t10) { + let o = r16[0].dtype; if (o === "complex64") { - let f = r15.map((C) => Ii({ inputs: { input: C }, backend: e })), h = r15.map((C) => $p({ inputs: { input: C }, backend: e })), g = Yc(f, t8, e), x = Yc(h, t8, e), b = xo({ inputs: { real: g, imag: x }, backend: e }); - return f.forEach((C) => e.disposeData(C.dataId)), h.forEach((C) => e.disposeData(C.dataId)), e.disposeData(g.dataId), e.disposeData(x.dataId), b; + let f = r16.map((w) => Fi({ inputs: { input: w }, backend: t10 })), h = r16.map((w) => Mp({ inputs: { input: w }, backend: t10 })), g = sc(f, e, t10), x = sc(h, e, t10), b = Uo({ inputs: { real: g, imag: x }, backend: t10 }); + return f.forEach((w) => t10.disposeData(w.dataId)), h.forEach((w) => t10.disposeData(w.dataId)), t10.disposeData(g.dataId), t10.disposeData(x.dataId), b; } - let n = e.shouldExecuteOnCPU(r15); + let n = t10.shouldExecuteOnCPU(r16); if (o === "string" && (n = true), n) { - let f = r15.map((k) => { - let E = [-1, y.sizeFromShape(k.shape.slice(t8))]; - return pe({ inputs: { x: k }, backend: e, attrs: { shape: E } }); - }), h = f.map((k) => ({ vals: e.readSync(k.dataId), shape: k.shape })), g = w.computeOutShape(f.map((k) => k.shape), 1), x = f[0].shape[0] === 1, b = pz(h, g, o, x), C = w.computeOutShape(r15.map((k) => k.shape), t8), S = e.makeTensorInfo(C, o, b); - return f.forEach((k) => e.disposeData(k.dataId)), S; - } - let s = e.device.limits.maxStorageBuffersPerShaderStage - 1; - if (r15.length > s) { + let f = r16.map((k) => { + let E = [-1, y.sizeFromShape(k.shape.slice(e))]; + return le({ inputs: { x: k }, backend: t10, attrs: { shape: E } }); + }), h = f.map((k) => ({ vals: t10.readSync(k.dataId), shape: k.shape })), g = C.computeOutShape(f.map((k) => k.shape), 1), x = f[0].shape[0] === 1, b = FV(h, g, o, x), w = C.computeOutShape(r16.map((k) => k.shape), e), S = t10.makeTensorInfo(w, o, b); + return f.forEach((k) => t10.disposeData(k.dataId)), S; + } + let s = t10.device.limits.maxStorageBuffersPerShaderStage - 1; + if (r16.length > s) { let f = []; - for (let g = 0; g < r15.length; g += s) { - let x = r15.slice(g, g + s); - f.push(Yc(x, t8, e)); + for (let g = 0; g < r16.length; g += s) { + let x = r16.slice(g, g + s); + f.push(sc(x, e, t10)); } - let h = Yc(f, t8, e); + let h = sc(f, e, t10); for (let g of f) - e.disposeData(g.dataId); + t10.disposeData(g.dataId); return h; } - let { tensors2D: a, outShape: i } = yue(r15, t8, e), p = a.map((f) => f.shape), u = new dx(p), c = [], l = new Array(p.length - 1); - if (l.length > 0) { - l[0] = p[0][1], c.push({ type: "int32", data: [l[0]] }); - for (let f = 1; f < l.length; f++) - l[f] = l[f - 1] + p[f][1], c.push({ type: "int32", data: [l[f]] }); - } - let m = e.runWebGPUProgram(u, a, a[0].dtype, c); - a.forEach((f) => e.disposeData(f.dataId)); - let d = pe({ inputs: { x: m }, backend: e, attrs: { shape: i } }); - return e.disposeData(m.dataId), d; -} -function yue(r15, t8, e) { - let o = w.computeOutShape(r15.map((s) => s.shape), t8); - return { tensors2D: r15.map((s) => pe({ inputs: { x: s }, backend: e, attrs: { shape: [y.sizeFromShape(s.shape.slice(0, t8)), y.sizeFromShape(s.shape.slice(t8))] } })), outShape: o }; -} -function s0(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { axis: n } = o, s = y.parseAxisParam(n, t8[0].shape)[0], a = t8.map((u) => u.shape); - w.assertParamsConsistent(a, s); - let i = w.computeOutShape(t8.map((u) => u.shape), s); + let { tensors2D: a, outShape: i } = tle(r16, e, t10), p = a.map((f) => f.shape), u = new Tx(p), l = [], c = new Array(p.length - 1); + if (c.length > 0) { + c[0] = p[0][1], l.push({ type: "int32", data: [c[0]] }); + for (let f = 1; f < c.length; f++) + c[f] = c[f - 1] + p[f][1], l.push({ type: "int32", data: [c[f]] }); + } + let m = t10.runWebGPUProgram(u, a, a[0].dtype, l); + a.forEach((f) => t10.disposeData(f.dataId)); + let d = le({ inputs: { x: m }, backend: t10, attrs: { shape: i } }); + return t10.disposeData(m.dataId), d; +} +function tle(r16, e, t10) { + let o = C.computeOutShape(r16.map((s) => s.shape), e); + return { tensors2D: r16.map((s) => le({ inputs: { x: s }, backend: t10, attrs: { shape: [y.sizeFromShape(s.shape.slice(0, e)), y.sizeFromShape(s.shape.slice(e))] } })), outShape: o }; +} +function Hv(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { axis: n } = o, s = y.parseAxisParam(n, e[0].shape)[0], a = e.map((u) => u.shape); + C.assertParamsConsistent(a, s); + let i = C.computeOutShape(e.map((u) => u.shape), s); if (y.sizeFromShape(i) === 0) - return e.makeTensorInfo(i, t8[0].dtype, []); - let p = t8.filter((u) => y.sizeFromShape(u.shape) > 0); - return p.length === 1 ? At({ inputs: { x: p[0] }, backend: e }) : Yc(p, s, e); + return t10.makeTensorInfo(i, e[0].dtype, []); + let p = e.filter((u) => y.sizeFromShape(u.shape) > 0); + return p.length === 1 ? Pt({ inputs: { x: p[0] }, backend: t10 }) : sc(p, s, t10); } -var wV = { kernelName: ta, backendName: "webgpu", kernelFunc: s0 }; -function bue(r15, t8, e, o, n = false, s = null, a = false, i = 4, p = 4, u = 4) { - let c = (D) => { +var KW = { kernelName: pa, backendName: "webgpu", kernelFunc: Hv }; +function rle(r16, e, t10, o, n = false, s = null, a = false, i = 4, p = 4, u = 4) { + let l = (D) => { switch (D) { case 1: return "resData = f32(x[xIndex]);"; @@ -29765,7 +30907,7 @@ function bue(r15, t8, e, o, n = false, s = null, a = false, i = 4, p = 4, u = 4) default: throw new Error(`innerElementSize ${D} is not supported.`); } - }, l = (D) => { + }, c = (D) => { switch (D) { case 1: return "return f32(W[row * uniforms.wShape[3] + col]);"; @@ -29774,11 +30916,11 @@ function bue(r15, t8, e, o, n = false, s = null, a = false, i = 4, p = 4, u = 4) default: throw new Error(`innerElementSize ${D} is not supported.`); } - }, m = r15 ? ` + }, m = r16 ? ` let coord = vec4(batch, xRow, xCol, xCh); ` : ` let coord = vec4(batch, xCh, xRow, xCol); - `, d = r15 ? ` + `, d = r16 ? ` let coords = vec4( batch, row / outWidth, @@ -29790,9 +30932,9 @@ function bue(r15, t8, e, o, n = false, s = null, a = false, i = 4, p = 4, u = 4) row, col / outWidth, col % outWidth); - `, f = r15 ? "uniforms.xShape[1]" : "uniforms.xShape[2]", h = r15 ? "uniforms.xShape[2]" : "uniforms.xShape[3]", g = r15 ? "row" : "col", x = r15 ? "col" : "row", b = ` + `, f = r16 ? "uniforms.xShape[1]" : "uniforms.xShape[2]", h = r16 ? "uniforms.xShape[2]" : "uniforms.xShape[3]", g = r16 ? "row" : "col", x = r16 ? "col" : "row", b = ` let inChannels = uniforms.wShape[2]; - let outWidth = ${r15 ? "uniforms.outShape[2]" : "uniforms.outShape[3]"}; + let outWidth = ${r16 ? "uniforms.outShape[2]" : "uniforms.outShape[3]"}; let outRow = ${g} / outWidth; let outCol = ${g} % outWidth; @@ -29807,59 +30949,59 @@ function bue(r15, t8, e, o, n = false, s = null, a = false, i = 4, p = 4, u = 4) if (xRow >= 0 && xRow < ${f} && xCol >= 0 && xCol < ${h}) { ${m} let xIndex = getIndexFromCoords4D(coord, uniforms.xShape); - ${c(i)} + ${l(i)} } - return resData;`, C = r15 ? t8 && o ? ` + return resData;`, w = r16 ? e && o ? ` ${b}` : ` if (row < uniforms.dimAOuter && col < uniforms.dimInner) { ${b} } - return ${Ae(i)}(0.0);` : o && e ? ` + return ${Ae(i)}(0.0);` : o && t10 ? ` ${b}` : ` if (row < uniforms.dimInner && col < uniforms.dimBOuter) { ${b} } - return ${Ae(i)}(0.0);`, S = `${l(p)}`, k = Ae(u), _ = r15 ? Ae(i) : Ae(p), E = r15 ? Ae(p) : Ae(i); + return ${Ae(i)}(0.0);`, S = `${c(p)}`, k = Ae(u), T = r16 ? Ae(i) : Ae(p), E = r16 ? Ae(p) : Ae(i); return ` - ${dr(s, a, u === 4, 4)} - fn mm_readA(batch: i32, row : i32, col : i32) -> ${_} { - ${r15 ? C : S} + ${gr(s, a, u === 4, 4)} + fn mm_readA(batch: i32, row : i32, col : i32) -> ${T} { + ${r16 ? w : S} } fn mm_readB(batch: i32, row : i32, col : i32) -> ${E} { - ${r15 ? S : C} + ${r16 ? S : w} } fn mm_write(batch: i32, row : i32, col : i32, valueIn : ${k}) { if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) { var value = valueIn; - let outWidth = ${r15 ? "uniforms.outShape[2]" : "uniforms.outShape[3]"}; + let outWidth = ${r16 ? "uniforms.outShape[2]" : "uniforms.outShape[3]"}; ${d} - ${Qr(n, s)} + ${no(n, s)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } }`; } -var fx = class { - constructor(t8, e, o, n, s = false, a = null, i = false, p = false) { - this.variableNames = ["x", "W"], this.uniforms = "filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.outputShape = t8.outShape, this.isChannelsLast = t8.dataFormat === "channelsLast", this.isVec4 = ((t8.inChannels % 4 === 0 || t8.inChannels % 3 === 0) && this.isChannelsLast || t8.outWidth % 4 === 0 && !this.isChannelsLast) && t8.outChannels % 4 === 0, this.dispatchLayout = this.isChannelsLast ? { x: [3], y: [1, 2], z: [0] } : { x: [2, 3], y: [1], z: [0] }, this.workgroupSize = pm(this.dispatchLayout, this.outputShape, this.isVec4), this.elementsPerThread = cm(this.dispatchLayout, this.outputShape, this.isVec4), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, this.elementsPerThread), this.isVec4 ? (this.outputComponent = 4, this.isChannelsLast && t8.inChannels % 4 !== 0 ? (this.innerElementSize = 3, this.variableComponents = [1, 4]) : (this.innerElementSize = 4, this.variableComponents = [4, 4]), s && (this.variableNames.push("bias"), this.variableComponents.push(4)), i && (this.variableNames.push("preluActivationWeights"), this.variableComponents.push(4))) : (this.innerElementSize = this.elementsPerThread[0], s && this.variableNames.push("bias"), i && this.variableNames.push("preluActivationWeights")), this.sequentialAccessByThreads = p, this.addBias = s, this.activation = a, this.hasPreluActivationWeights = i, this.tileAOuter = this.workgroupSize[1] * this.elementsPerThread[1], this.tileBOuter = this.workgroupSize[0] * this.elementsPerThread[0], this.tileInner = Math.max(this.workgroupSize[0] * this.innerElementSize, this.workgroupSize[1]), this.fitAOuter = e % this.tileAOuter === 0, this.fitBOuter = o % this.tileBOuter === 0, this.fitInner = n % this.tileInner === 0, this.shaderKey = `conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`; +var _x = class { + constructor(e, t10, o, n, s = false, a = null, i = false, p = false) { + this.variableNames = ["x", "W"], this.uniforms = "filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.outputShape = e.outShape, this.isChannelsLast = e.dataFormat === "channelsLast", this.isVec4 = ((e.inChannels % 4 === 0 || e.inChannels % 3 === 0) && this.isChannelsLast || e.outWidth % 4 === 0 && !this.isChannelsLast) && e.outChannels % 4 === 0, this.dispatchLayout = this.isChannelsLast ? { x: [3], y: [1, 2], z: [0] } : { x: [2, 3], y: [1], z: [0] }, this.workgroupSize = ym(this.dispatchLayout, this.outputShape, this.isVec4), this.elementsPerThread = bm(this.dispatchLayout, this.outputShape, this.isVec4), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, this.elementsPerThread), this.isVec4 ? (this.outputComponent = 4, this.isChannelsLast && e.inChannels % 4 !== 0 ? (this.innerElementSize = 3, this.variableComponents = [1, 4]) : (this.innerElementSize = 4, this.variableComponents = [4, 4]), s && (this.variableNames.push("bias"), this.variableComponents.push(4)), i && (this.variableNames.push("preluActivationWeights"), this.variableComponents.push(4))) : (this.innerElementSize = this.elementsPerThread[0], s && this.variableNames.push("bias"), i && this.variableNames.push("preluActivationWeights")), this.sequentialAccessByThreads = p, this.addBias = s, this.activation = a, this.hasPreluActivationWeights = i, this.tileAOuter = this.workgroupSize[1] * this.elementsPerThread[1], this.tileBOuter = this.workgroupSize[0] * this.elementsPerThread[0], this.tileInner = Math.max(this.workgroupSize[0] * this.innerElementSize, this.workgroupSize[1]), this.fitAOuter = t10 % this.tileAOuter === 0, this.fitBOuter = o % this.tileBOuter === 0, this.fitInner = n % this.tileInner === 0, this.shaderKey = `conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`; } getUserCode() { - let t8 = this.isVec4 ? Np(this.elementsPerThread, this.workgroupSize, !this.isChannelsLast, this.tileInner) : Tp(this.elementsPerThread, this.workgroupSize, !this.isChannelsLast, this.tileInner, false, null, this.sequentialAccessByThreads), e = this.isVec4 ? [this.innerElementSize, 4, 4] : [1, 1, 1]; + let e = this.isVec4 ? Fp(this.elementsPerThread, this.workgroupSize, !this.isChannelsLast, this.tileInner) : Pp(this.elementsPerThread, this.workgroupSize, !this.isChannelsLast, this.tileInner, false, null, this.sequentialAccessByThreads), t10 = this.isVec4 ? [this.innerElementSize, 4, 4] : [1, 1, 1]; return ` - ${bue(this.isChannelsLast, this.fitAOuter, this.fitBOuter, this.fitInner, this.addBias, this.activation, this.hasPreluActivationWeights, e[0], e[1], e[2])} - ${t8} + ${rle(this.isChannelsLast, this.fitAOuter, this.fitBOuter, this.fitInner, this.addBias, this.activation, this.hasPreluActivationWeights, t10[0], t10[1], t10[2])} + ${e} `; } }; -var hx = class { - constructor(t8, e = false, o = null, n = false) { - this.variableNames = ["x", "W"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,", this.workgroupSize = [4, 4, 8], this.outputShape = t8.outShape, this.isChannelsLast = t8.dataFormat === "channelsLast", this.dispatchLayout = this.isChannelsLast ? { x: [2], y: [1], z: [0, 3] } : { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.addBias = e, this.activation = o, this.hasPreluActivationWeights = n, e && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), this.shaderKey = `conv2dnaive_${this.activation}_${this.isChannelsLast}`; +var Ex = class { + constructor(e, t10 = false, o = null, n = false) { + this.variableNames = ["x", "W"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,", this.workgroupSize = [4, 4, 8], this.outputShape = e.outShape, this.isChannelsLast = e.dataFormat === "channelsLast", this.dispatchLayout = this.isChannelsLast ? { x: [2], y: [1], z: [0, 3] } : { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.addBias = t10, this.activation = o, this.hasPreluActivationWeights = n, t10 && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), this.shaderKey = `conv2dnaive_${this.activation}_${this.isChannelsLast}`; } getUserCode() { return ` - ${dr(this.activation, this.hasPreluActivationWeights, false, 4)} + ${gr(this.activation, this.hasPreluActivationWeights, false, 4)} fn readInp(batch : i32, row : i32, col : i32, chan : i32) -> f32{ let coords = vec4(batch, row, col, chan); if (coordsInBounds4D(coords, uniforms.xShape)) { @@ -29880,7 +31022,7 @@ var hx = class { let coords = ${this.isChannelsLast ? "vec4(batch, row, col, chan);" : "vec4(batch, chan, row, col);"} if (coordsInBounds4D(coords, uniforms.outShape)) { var value = valueIn; - ${Qr(this.addBias, this.activation)} + ${no(this.addBias, this.activation)} setOutputAtCoords(coords.x, coords.y, coords.z, coords.w, value); } } @@ -29907,13 +31049,13 @@ var hx = class { `; } }; -var gx = class { - constructor(t8, e) { +var $x = class { + constructor(e, t10) { this.variableNames = ["x"], this.uniforms = `pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32, - inChannels : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.isChannelsLast = e, this.shaderKey = `im2col_${this.isChannelsLast}`; + inChannels : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.isChannelsLast = t10, this.shaderKey = `im2col_${this.isChannelsLast}`; } getUserCode() { - let t8 = this.isChannelsLast ? 1 : 2, e = this.isChannelsLast ? 2 : 3, o = this.isChannelsLast ? "coords[1]" : "coords[2]", n = this.isChannelsLast ? "coords[2]" : "coords[1]", s = this.isChannelsLast ? "getX(batch, xRow, xCol, ch)" : "getX(batch, ch, xRow, xCol)"; + let e = this.isChannelsLast ? 1 : 2, t10 = this.isChannelsLast ? 2 : 3, o = this.isChannelsLast ? "coords[1]" : "coords[2]", n = this.isChannelsLast ? "coords[2]" : "coords[1]", s = this.isChannelsLast ? "getX(batch, xRow, xCol, ch)" : "getX(batch, ch, xRow, xCol)"; return ` ${G("index")} { let coords = getCoordsFromIndex(index); @@ -29924,13 +31066,13 @@ var gx = class { let offsetY = (row / uniforms.outWidth) * uniforms.strides[0] - uniforms.pads[0]; let xRow = offsetY + uniforms.dilations[0] * (col / uniforms.itemsPerBlockRow); var value = 0.0; - if(xRow < uniforms.xShape[${t8}] && xRow >= 0) { + if(xRow < uniforms.xShape[${e}] && xRow >= 0) { let offsetX = (row % uniforms.outWidth) * uniforms.strides[1] - uniforms.pads[1]; let xCol = offsetX + uniforms.dilations[1] * ((col % uniforms.itemsPerBlockRow) / uniforms.inChannels); let ch = col % uniforms.inChannels; - if(xCol < uniforms.xShape[${e}] && xCol >= 0) { + if(xCol < uniforms.xShape[${t10}] && xCol >= 0) { value = ${s}; } } @@ -29940,83 +31082,83 @@ var gx = class { `; } }; -function xx(r15, t8) { - let e = r15.length; - return e >= 3 ? t8 ? [...r15.slice(0, -3), r15[e - 3] * r15[e - 2], r15[e - 1]] : [...r15.slice(0, -3), r15[e - 3], r15[e - 2] * r15[e - 1]] : !t8 && e === 1 && r15[0] > 1 ? [r15[0], 1] : null; +function Rx(r16, e) { + let t10 = r16.length; + return t10 >= 3 ? e ? [...r16.slice(0, -3), r16[t10 - 3] * r16[t10 - 2], r16[t10 - 1]] : [...r16.slice(0, -3), r16[t10 - 3], r16[t10 - 2] * r16[t10 - 1]] : !e && t10 === 1 && r16[0] > 1 ? [r16[0], 1] : null; } -function Cue({ x: r15, filter: t8, convInfo: e, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { - let p = e.dataFormat === "channelsLast", u = !p, c = false, l = p && e.filterHeight === e.inHeight && e.filterWidth === e.inWidth && e.padInfo.type === "VALID", m = [], d, f; - if (l) { - let x = e.inHeight * e.inWidth * e.inChannels; - d = pe({ inputs: { x: r15 }, backend: o, attrs: { shape: [1, e.batchSize, x] } }), f = pe({ inputs: { x: t8 }, backend: o, attrs: { shape: [1, x, e.outChannels] } }); +function ole({ x: r16, filter: e, convInfo: t10, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { + let p = t10.dataFormat === "channelsLast", u = !p, l = false, c = p && t10.filterHeight === t10.inHeight && t10.filterWidth === t10.inWidth && t10.padInfo.type === "VALID", m = [], d, f; + if (c) { + let x = t10.inHeight * t10.inWidth * t10.inChannels; + d = le({ inputs: { x: r16 }, backend: o, attrs: { shape: [1, t10.batchSize, x] } }), f = le({ inputs: { x: e }, backend: o, attrs: { shape: [1, x, t10.outChannels] } }); } else - d = pe({ inputs: { x: r15 }, backend: o, attrs: { shape: p ? [e.batchSize, e.inHeight * e.inWidth, e.inChannels] : [e.batchSize, e.inChannels, e.inHeight * e.inWidth] } }), f = pe({ inputs: { x: t8 }, backend: o, attrs: { shape: [1, e.inChannels, e.outChannels] } }); + d = le({ inputs: { x: r16 }, backend: o, attrs: { shape: p ? [t10.batchSize, t10.inHeight * t10.inWidth, t10.inChannels] : [t10.batchSize, t10.inChannels, t10.inHeight * t10.inWidth] } }), f = le({ inputs: { x: e }, backend: o, attrs: { shape: [1, t10.inChannels, t10.outChannels] } }); if (m.push(d), m.push(f), s != null) { - let x = xx(s.shape, p); - x != null && (s = pe({ inputs: { x: s }, backend: o, attrs: { shape: x } }), m.push(s)); + let x = Rx(s.shape, p); + x != null && (s = le({ inputs: { x: s }, backend: o, attrs: { shape: x } }), m.push(s)); } if (n != null) { - let x = xx(n.shape, p); - x != null && (n = pe({ inputs: { x: n }, backend: o, attrs: { shape: x } }), m.push(n)); + let x = Rx(n.shape, p); + x != null && (n = le({ inputs: { x: n }, backend: o, attrs: { shape: x } }), m.push(n)); } - let h = _p({ a: p ? d : f, b: p ? f : d, transposeA: u, transposeB: c, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }), g = pe({ inputs: { x: h }, backend: o, attrs: { shape: e.outShape } }); + let h = Op({ a: p ? d : f, b: p ? f : d, transposeA: u, transposeB: l, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }), g = le({ inputs: { x: h }, backend: o, attrs: { shape: t10.outShape } }); m.push(h); for (let x of m) o.disposeData(x.dataId); return g; } -function wue({ x: r15, filter: t8, convInfo: e, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { - let { filterWidth: p, filterHeight: u, inChannels: c, strideWidth: l, strideHeight: m, padInfo: d, outWidth: f, outHeight: h, dilationWidth: g, dilationHeight: x, dataFormat: b } = e, C = b === "channelsLast", S = p * u * c, k = h * f, _ = C ? [e.batchSize, k, S] : [e.batchSize, S, k], E = new gx(_, C), R = [{ type: "int32", data: [d.top, d.left] }, { type: "int32", data: [m, l] }, { type: "int32", data: [x, g] }, { type: "int32", data: [f] }, { type: "int32", data: [c * p] }, { type: "int32", data: [c] }], D = o.runWebGPUProgram(E, [r15], r15.dtype, R), P = []; - P.push(D); - let O = pe({ inputs: { x: t8 }, backend: o, attrs: { shape: [1, S, -1] } }); - if (P.push(O), s != null) { - let U = xx(s.shape, C); - U != null && (s = pe({ inputs: { x: s }, backend: o, attrs: { shape: U } }), P.push(s)); +function nle({ x: r16, filter: e, convInfo: t10, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { + let { filterWidth: p, filterHeight: u, inChannels: l, strideWidth: c, strideHeight: m, padInfo: d, outWidth: f, outHeight: h, dilationWidth: g, dilationHeight: x, dataFormat: b } = t10, w = b === "channelsLast", S = p * u * l, k = h * f, T = w ? [t10.batchSize, k, S] : [t10.batchSize, S, k], E = new $x(T, w), R = [{ type: "int32", data: [d.top, d.left] }, { type: "int32", data: [m, c] }, { type: "int32", data: [x, g] }, { type: "int32", data: [f] }, { type: "int32", data: [l * p] }, { type: "int32", data: [l] }], D = o.runWebGPUProgram(E, [r16], r16.dtype, R), F = []; + F.push(D); + let O = le({ inputs: { x: e }, backend: o, attrs: { shape: [1, S, -1] } }); + if (F.push(O), s != null) { + let U = Rx(s.shape, w); + U != null && (s = le({ inputs: { x: s }, backend: o, attrs: { shape: U } }), F.push(s)); } if (n != null) { - let U = xx(n.shape, C); - U != null && (n = pe({ inputs: { x: n }, backend: o, attrs: { shape: U } }), P.push(n)); + let U = Rx(n.shape, w); + U != null && (n = le({ inputs: { x: n }, backend: o, attrs: { shape: U } }), F.push(n)); } - let B = _p({ a: C ? D : O, b: C ? O : D, transposeA: !C, transposeB: false, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }), z = pe({ inputs: { x: B }, backend: o, attrs: { shape: e.outShape } }); - P.push(B); - for (let U of P) + let B = Op({ a: w ? D : O, b: w ? O : D, transposeA: !w, transposeB: false, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }), z = le({ inputs: { x: B }, backend: o, attrs: { shape: t10.outShape } }); + F.push(B); + for (let U of F) o.disposeData(U.dataId); return z; } -function yx({ x: r15, filter: t8, convInfo: e, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { - let p = n != null, u = s != null, c = e.dataFormat === "channelsLast", l = c && e.filterHeight === e.inHeight && e.filterWidth === e.inWidth && e.padInfo.type === "VALID", m = A().getBool("WEBGPU_USE_NAIVE_CONV2D_DEBUG"); - if (!m && (l || e.filterHeight === 1 && e.filterWidth === 1 && e.dilationHeight === 1 && e.dilationWidth === 1 && e.strideHeight === 1 && e.strideWidth === 1 && (e.padInfo.type === "SAME" || e.padInfo.type === "VALID"))) - return Cue({ x: r15, filter: t8, convInfo: e, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }); - let d = A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"), f = d > -1 ? d : o.thresholdToIncreaseWorkgroups, h = e.batchSize * Math.ceil(e.outHeight * e.outWidth / 32) * Math.ceil(e.outChannels / 32); +function Dx({ x: r16, filter: e, convInfo: t10, backend: o, bias: n = null, preluActivationWeights: s = null, leakyreluAlpha: a = 0, activation: i = null }) { + let p = n != null, u = s != null, l = t10.dataFormat === "channelsLast", c = l && t10.filterHeight === t10.inHeight && t10.filterWidth === t10.inWidth && t10.padInfo.type === "VALID", m = A().getBool("WEBGPU_USE_NAIVE_CONV2D_DEBUG"); + if (!m && (c || t10.filterHeight === 1 && t10.filterWidth === 1 && t10.dilationHeight === 1 && t10.dilationWidth === 1 && t10.strideHeight === 1 && t10.strideWidth === 1 && (t10.padInfo.type === "SAME" || t10.padInfo.type === "VALID"))) + return ole({ x: r16, filter: e, convInfo: t10, backend: o, bias: n, activation: i, preluActivationWeights: s, leakyreluAlpha: a }); + let d = A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"), f = d > -1 ? d : o.thresholdToIncreaseWorkgroups, h = t10.batchSize * Math.ceil(t10.outHeight * t10.outWidth / 32) * Math.ceil(t10.outChannels / 32); if (A().getBool("WEBGPU_CONV_SEPARATE_IM2COL_SHADER") || h <= f) - return wue({ x: r15, filter: t8, convInfo: e, backend: o, bias: n, preluActivationWeights: s, leakyreluAlpha: a, activation: i }); - let g, x = [e.padInfo.top, e.padInfo.left], b = [{ type: "int32", data: [e.filterHeight, e.filterWidth] }, { type: "int32", data: [...x] }, { type: "int32", data: [e.strideHeight, e.strideWidth] }, { type: "int32", data: [e.dilationHeight, e.dilationWidth] }]; + return nle({ x: r16, filter: e, convInfo: t10, backend: o, bias: n, preluActivationWeights: s, leakyreluAlpha: a, activation: i }); + let g, x = [t10.padInfo.top, t10.padInfo.left], b = [{ type: "int32", data: [t10.filterHeight, t10.filterWidth] }, { type: "int32", data: [...x] }, { type: "int32", data: [t10.strideHeight, t10.strideWidth] }, { type: "int32", data: [t10.dilationHeight, t10.dilationWidth] }]; if (m) - g = new hx(e, p, i, u); + g = new Ex(t10, p, i, u); else { - let _ = c ? e.outHeight * e.outWidth : e.outChannels, E = c ? e.outChannels : e.outHeight * e.outWidth, R = e.filterHeight * e.filterWidth * e.inChannels; - b.push({ type: "int32", data: [_] }, { type: "int32", data: [E] }, { type: "int32", data: [R] }); + let T = l ? t10.outHeight * t10.outWidth : t10.outChannels, E = l ? t10.outChannels : t10.outHeight * t10.outWidth, R = t10.filterHeight * t10.filterWidth * t10.inChannels; + b.push({ type: "int32", data: [T] }, { type: "int32", data: [E] }, { type: "int32", data: [R] }); let D = o.adapterInfo.isIntel(); - g = new fx(e, _, E, R, p, i, u, D); + g = new _x(t10, T, E, R, p, i, u, D); } - let C = [], S = [r15, t8]; - p && (!c && n.shape.length === 1 && (n = pe({ inputs: { x: n }, backend: o, attrs: { shape: [n.shape[0], 1, 1] } }), C.push(n)), S.push(n)), u && (!c && s.shape.length === 1 && (s = pe({ inputs: { x: s }, backend: o, attrs: { shape: [s.shape[0], 1, 1] } }), C.push(s)), S.push(s)), i === "leakyrelu" && (b.push({ type: "float32", data: [a] }), g.uniforms += " alpha : f32,"); - let k = o.runWebGPUProgram(g, S, r15.dtype, b); - for (let _ of C) - o.disposeData(_.dataId); + let w = [], S = [r16, e]; + p && (!l && n.shape.length === 1 && (n = le({ inputs: { x: n }, backend: o, attrs: { shape: [n.shape[0], 1, 1] } }), w.push(n)), S.push(n)), u && (!l && s.shape.length === 1 && (s = le({ inputs: { x: s }, backend: o, attrs: { shape: [s.shape[0], 1, 1] } }), w.push(s)), S.push(s)), i === "leakyrelu" && (b.push({ type: "float32", data: [a] }), g.uniforms += " alpha : f32,"); + let k = o.runWebGPUProgram(g, S, r16.dtype, b); + for (let T of w) + o.disposeData(T.dataId); return k; } -function Sue(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: c } = e, l = w.convertConv2DDataFormat(p), m = w.computeConv2DInfo(n.shape, s.shape, a, u, i, c, false, l); - return yx({ x: n, filter: s, convInfo: m, backend: o }); +function sle(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: l } = t10, c = C.convertConv2DDataFormat(p), m = C.computeConv2DInfo(n.shape, s.shape, a, u, i, l, false, c); + return Dx({ x: n, filter: s, convInfo: m, backend: o }); } -var SV = { kernelName: tn, backendName: "webgpu", kernelFunc: Sue }; -var bx = class { - constructor(t8) { - this.variableNames = ["dy", "W"], this.uniforms = "filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,", this.workgroupSize = [64, 1, 1], this.size = false, this.isVec4 = false, this.workPerThread = 1, this.outputShape = t8.inShape, this.isChannelsLast = t8.dataFormat === "channelsLast", this.isVec4 = this.isChannelsLast && t8.outChannels % 4 === 0 && t8.inChannels % 4 === 0, this.isVec4 ? (this.workPerThread = 2, this.outputComponent = 4, this.workgroupSize = [4, 4, 4], this.dispatchLayout = { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [4, this.workPerThread, 1])) : (this.size = true, this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize)), this.shaderKey = `conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`; +var qW = { kernelName: En, backendName: "webgpu", kernelFunc: sle }; +var Ax = class { + constructor(e) { + this.variableNames = ["dy", "W"], this.uniforms = "filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,", this.workgroupSize = [64, 1, 1], this.size = false, this.isVec4 = false, this.workPerThread = 1, this.outputShape = e.inShape, this.isChannelsLast = e.dataFormat === "channelsLast", this.isVec4 = this.isChannelsLast && e.outChannels % 4 === 0 && e.inChannels % 4 === 0, this.isVec4 ? (this.workPerThread = 2, this.outputComponent = 4, this.workgroupSize = [4, 4, 4], this.dispatchLayout = { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [4, this.workPerThread, 1])) : (this.size = true, this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize)), this.shaderKey = `conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`; } getUserCode() { - let t8 = this.isChannelsLast ? 1 : 2, e = this.isChannelsLast ? 2 : 3, o = this.isChannelsLast ? 3 : 1, n = ` + let e = this.isChannelsLast ? 1 : 2, t10 = this.isChannelsLast ? 2 : 3, o = this.isChannelsLast ? 3 : 1, n = ` ${G()} { let batch = i32(globalId.z) / uniforms.outShape[1]; let r = i32(globalId.z) % uniforms.outShape[1]; @@ -30125,7 +31267,7 @@ var bx = class { let batch = coords[0]; let d1 = coords[${o}]; - let dyCorner = vec2(coords[${t8}], coords[${e}]) - uniforms.pads; + let dyCorner = vec2(coords[${e}], coords[${t10}]) - uniforms.pads; let dyRCorner = dyCorner.x; let dyCCorner = dyCorner.y; @@ -30163,9 +31305,9 @@ var bx = class { `; } }; -var Cx = class { - constructor(t8) { - this.variableNames = ["x", "dy"], this.uniforms = "pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.filterShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.isChannelsLast = t8.dataFormat === "channelsLast", this.shaderKey = `conv2DDerFilter_${this.isChannelsLast}`; +var Fx = class { + constructor(e) { + this.variableNames = ["x", "dy"], this.uniforms = "pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.filterShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.isChannelsLast = e.dataFormat === "channelsLast", this.shaderKey = `conv2DDerFilter_${this.isChannelsLast}`; } getUserCode() { return ` @@ -30212,10 +31354,10 @@ var Cx = class { `; } }; -var wx = class { - constructor(t8) { +var Px = class { + constructor(e) { this.variableNames = ["x", "dy"], this.uniforms = `pads : vec3, strides : vec3, batchSize : i32, outDepth : i32, - outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.filterShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "conv3DDerFilter"; + outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.filterShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "conv3DDerFilter"; } getUserCode() { return ` @@ -30261,10 +31403,10 @@ var wx = class { `; } }; -var Sx = class { - constructor(t8) { +var Ox = class { + constructor(e) { this.variableNames = ["dy", "W"], this.uniforms = `filterDims : vec3, pads : vec3, strides : vec3, - outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "conv3DDerInput"; + outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "conv3DDerInput"; } getUserCode() { return ` @@ -30323,13 +31465,13 @@ var Sx = class { `; } }; -function Iue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, filterShape: c } = o, l = w.convertConv2DDataFormat(p), m = w.computeConv2DInfo(n.shape, c, a, 1, i, u, false, l), d = new Cx(m), f = [{ type: "int32", data: [m.padInfo.top, m.padInfo.left] }, { type: "int32", data: [m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.batchSize] }, { type: "int32", data: [m.outHeight] }, { type: "int32", data: [m.outWidth] }, { type: "int32", data: [m.inHeight] }, { type: "int32", data: [m.inWidth] }]; - return e.runWebGPUProgram(d, [n, s], n.dtype, f); +function ale(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, pad: i, dataFormat: p, dimRoundingMode: u, filterShape: l } = o, c = C.convertConv2DDataFormat(p), m = C.computeConv2DInfo(n.shape, l, a, 1, i, u, false, c), d = new Fx(m), f = [{ type: "int32", data: [m.padInfo.top, m.padInfo.left] }, { type: "int32", data: [m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.batchSize] }, { type: "int32", data: [m.outHeight] }, { type: "int32", data: [m.outWidth] }, { type: "int32", data: [m.inHeight] }, { type: "int32", data: [m.inWidth] }]; + return t10.runWebGPUProgram(d, [n, s], n.dtype, f); } -var IV = { kernelName: Ai, backendName: "webgpu", kernelFunc: Iue }; -function vue(r15 = 4) { - let t8 = (s) => { +var jW = { kernelName: Ui, backendName: "webgpu", kernelFunc: ale }; +function ile(r16 = 4) { + let e = (s) => { switch (s) { case 1: return "return W[getIndexFromCoords4D(coord, uniforms.wShape)];"; @@ -30357,25 +31499,25 @@ function vue(r15 = 4) { let xR = f32(outRow - uniforms.pads[0] + WRow) / f32(uniforms.strides[0]); let xC = f32(outCol - uniforms.pads[1] + WCol) / f32(uniforms.strides[1]); if (xR < 0.0 || xR >= f32(uniforms.outBackprop[1]) || fract(xR) > 0.0) { - return ${Ae(r15)}(0.0); + return ${Ae(r16)}(0.0); } if (xC < 0.0 || xC >= f32(uniforms.outBackprop[2]) || fract(xC) > 0.0) { - return ${Ae(r15)}(0.0); + return ${Ae(r16)}(0.0); } let coord = vec4( batch, i32(xR), i32(xC), col % uniforms.outBackprop[3]); - return x[getIndexFromCoords4D(coord, uniforms.xShape)/${r15}];`} + return x[getIndexFromCoords4D(coord, uniforms.xShape)/${r16}];`} } - return ${Ae(r15)}(0.0);`; + return ${Ae(r16)}(0.0);`; return ` - fn mm_readA(batch: i32, row : i32, col : i32) -> ${Ae(r15)} { + fn mm_readA(batch: i32, row : i32, col : i32) -> ${Ae(r16)} { ${o} } - fn mm_readB(batch: i32, row : i32, col : i32) -> ${Ae(r15)} { + fn mm_readB(batch: i32, row : i32, col : i32) -> ${Ae(r16)} { let coordX = uniforms.filterDims.x - 1 - row / (uniforms.filterDims[1] * uniforms.outBackprop[3]); let coordY = uniforms.filterDims.y - 1 - @@ -30384,12 +31526,12 @@ function vue(r15 = 4) { coordX >= 0 && coordY >= 0) { let rowInner = row % uniforms.outBackprop[3]; let coord = vec4(coordX, coordY, col, rowInner); - ${t8(r15)} + ${e(r16)} } - return ${Ae(r15)}(0.0); + return ${Ae(r16)}(0.0); } - fn mm_write(batch: i32, row : i32, col : i32, valueInput : ${Ae(r15)}) { + fn mm_write(batch: i32, row : i32, col : i32, valueInput : ${Ae(r16)}) { if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) { var value = valueInput; let outCoord = vec4( @@ -30397,37 +31539,37 @@ function vue(r15 = 4) { row / uniforms.outShape[2], row % uniforms.outShape[2], col); - result[getIndexFromCoords4D(outCoord, uniforms.outShape)/${r15}] = value; + result[getIndexFromCoords4D(outCoord, uniforms.outShape)/${r16}] = value; } }`; } -var Ix = class { - constructor(t8) { - this.variableNames = ["x", "W"], this.uniforms = "filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.outputShape = t8.inShape, y.assert(t8.dataFormat === "channelsLast", () => "TODO: NCHW is unimplemented"), this.isVec4 = t8.inChannels % 4 === 0 && t8.outChannels % 4 === 0, this.dispatchLayout = { x: [3], y: [1, 2], z: [0] }, this.workgroupSize = pm(this.dispatchLayout, this.outputShape, this.isVec4), this.elementsPerThread = cm(this.dispatchLayout, this.outputShape, this.isVec4), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, this.elementsPerThread), this.isVec4 && (this.outputComponent = 4, this.variableComponents = [4, 1]), this.shaderKey = `conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`; +var Mx = class { + constructor(e) { + this.variableNames = ["x", "W"], this.uniforms = "filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,", this.outputShape = e.inShape, y.assert(e.dataFormat === "channelsLast", () => "TODO: NCHW is unimplemented"), this.isVec4 = e.inChannels % 4 === 0 && e.outChannels % 4 === 0, this.dispatchLayout = { x: [3], y: [1, 2], z: [0] }, this.workgroupSize = ym(this.dispatchLayout, this.outputShape, this.isVec4), this.elementsPerThread = bm(this.dispatchLayout, this.outputShape, this.isVec4), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, this.elementsPerThread), this.isVec4 && (this.outputComponent = 4, this.variableComponents = [4, 1]), this.shaderKey = `conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`; } getUserCode() { - let t8 = this.isVec4 ? Np(this.elementsPerThread, this.workgroupSize) : Tp(this.elementsPerThread, this.workgroupSize); + let e = this.isVec4 ? Fp(this.elementsPerThread, this.workgroupSize) : Pp(this.elementsPerThread, this.workgroupSize); return ` - ${vue(this.isVec4 ? 4 : 1)} - ${t8} + ${ile(this.isVec4 ? 4 : 1)} + ${e} `; } }; -function kue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { inputShape: a, strides: i, pad: p, dataFormat: u, dimRoundingMode: c } = o, l = w.convertConv2DDataFormat(u), m = w.computeConv2DInfo(a, s.shape, i, 1, p, c, false, l), d = [{ type: "int32", data: [m.filterHeight, m.filterWidth] }, { type: "int32", data: [m.filterHeight - 1 - m.padInfo.top, m.filterWidth - 1 - m.padInfo.left] }, { type: "int32", data: [m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.batchSize, m.outHeight, m.outWidth, m.outChannels] }], f; +function ule(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { inputShape: a, strides: i, pad: p, dataFormat: u, dimRoundingMode: l } = o, c = C.convertConv2DDataFormat(u), m = C.computeConv2DInfo(a, s.shape, i, 1, p, l, false, c), d = [{ type: "int32", data: [m.filterHeight, m.filterWidth] }, { type: "int32", data: [m.filterHeight - 1 - m.padInfo.top, m.filterWidth - 1 - m.padInfo.left] }, { type: "int32", data: [m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.batchSize, m.outHeight, m.outWidth, m.outChannels] }], f; if (A().getBool("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE") || m.dataFormat !== "channelsLast") - f = new bx(m); + f = new Ax(m); else { - f = new Ix(m); + f = new Mx(m); let h = m.inHeight * m.inWidth, g = m.inChannels, x = m.filterHeight * m.filterWidth * m.outChannels; d.push({ type: "uint32", data: [h] }, { type: "uint32", data: [g] }, { type: "uint32", data: [x] }); } - return e.runWebGPUProgram(f, [n, s], "float32", d); + return t10.runWebGPUProgram(f, [n, s], "float32", d); } -var vV = { kernelName: rn, backendName: "webgpu", kernelFunc: kue }; -var vx = class { - constructor(t8) { - this.variableNames = ["x", "W"], this.uniforms = "filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "conv3dnaive"; +var XW = { kernelName: $n, backendName: "webgpu", kernelFunc: ule }; +var Lx = class { + constructor(e) { + this.variableNames = ["x", "W"], this.uniforms = "filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "conv3dnaive"; } getUserCode() { return ` @@ -30515,33 +31657,33 @@ var vx = class { }`; } }; -function Nue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p } = o, u = w.computeConv3DInfo(n.shape, s.shape, a, p, i), c = [u.padInfo.front, u.padInfo.top, u.padInfo.left], l = [{ type: "int32", data: [u.filterDepth, u.filterHeight, u.filterWidth] }, { type: "int32", data: [...c] }, { type: "int32", data: [u.strideDepth, u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.dilationDepth, u.dilationHeight, u.dilationWidth] }], m = new vx(u), d = dt(n.dtype, s.dtype); - return e.runWebGPUProgram(m, [n, s], d, l); +function ple(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p } = o, u = C.computeConv3DInfo(n.shape, s.shape, a, p, i), l = [u.padInfo.front, u.padInfo.top, u.padInfo.left], c = [{ type: "int32", data: [u.filterDepth, u.filterHeight, u.filterWidth] }, { type: "int32", data: [...l] }, { type: "int32", data: [u.strideDepth, u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.dilationDepth, u.dilationHeight, u.dilationWidth] }], m = new Lx(u), d = pt(n.dtype, s.dtype); + return t10.runWebGPUProgram(m, [n, s], d, c); } -var kV = { kernelName: on, backendName: "webgpu", kernelFunc: Nue }; -function Tue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, pad: i, filterShape: p } = o, u = w.computeConv3DInfo(n.shape, p, a, 1, i), c = new wx(u), l = [{ type: "int32", data: [u.padInfo.front, u.padInfo.top, u.padInfo.left] }, { type: "int32", data: [u.strideDepth, u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.batchSize] }, { type: "int32", data: [u.outDepth] }, { type: "int32", data: [u.outHeight] }, { type: "int32", data: [u.outWidth] }, { type: "int32", data: [u.inDepth] }, { type: "int32", data: [u.inHeight] }, { type: "int32", data: [u.inWidth] }]; - return e.runWebGPUProgram(c, [n, s], s.dtype, l); +var YW = { kernelName: Rn, backendName: "webgpu", kernelFunc: ple }; +function lle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, pad: i, filterShape: p } = o, u = C.computeConv3DInfo(n.shape, p, a, 1, i), l = new Px(u), c = [{ type: "int32", data: [u.padInfo.front, u.padInfo.top, u.padInfo.left] }, { type: "int32", data: [u.strideDepth, u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.batchSize] }, { type: "int32", data: [u.outDepth] }, { type: "int32", data: [u.outHeight] }, { type: "int32", data: [u.outWidth] }, { type: "int32", data: [u.inDepth] }, { type: "int32", data: [u.inHeight] }, { type: "int32", data: [u.inWidth] }]; + return t10.runWebGPUProgram(l, [n, s], s.dtype, c); } -var NV = { kernelName: ja, backendName: "webgpu", kernelFunc: Tue }; -function _ue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { strides: a, pad: i, inputShape: p } = o, u = w.computeConv3DInfo(p, s.shape, a, 1, i), c = new Sx(u), l = [{ type: "int32", data: [u.filterDepth, u.filterHeight, u.filterWidth] }, { type: "int32", data: [u.filterDepth - 1 - u.padInfo.front, u.filterHeight - 1 - u.padInfo.top, u.filterWidth - 1 - u.padInfo.left] }, { type: "int32", data: [u.strideDepth, u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.outDepth] }, { type: "int32", data: [u.outHeight] }, { type: "int32", data: [u.outWidth] }, { type: "int32", data: [u.outChannels] }]; - return e.runWebGPUProgram(c, [n, s], n.dtype, l); +var QW = { kernelName: ti, backendName: "webgpu", kernelFunc: lle }; +function cle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { strides: a, pad: i, inputShape: p } = o, u = C.computeConv3DInfo(p, s.shape, a, 1, i), l = new Ox(u), c = [{ type: "int32", data: [u.filterDepth, u.filterHeight, u.filterWidth] }, { type: "int32", data: [u.filterDepth - 1 - u.padInfo.front, u.filterHeight - 1 - u.padInfo.top, u.filterWidth - 1 - u.padInfo.left] }, { type: "int32", data: [u.strideDepth, u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.outDepth] }, { type: "int32", data: [u.outHeight] }, { type: "int32", data: [u.outWidth] }, { type: "int32", data: [u.outChannels] }]; + return t10.runWebGPUProgram(l, [n, s], n.dtype, c); } -var TV = { kernelName: nn, backendName: "webgpu", kernelFunc: _ue }; -var $ue = ye({ opType: Z.COS }); -var _V = { kernelName: sn, backendName: "webgpu", kernelFunc: $ue }; -var Eue = ye({ opType: Z.COSH }); -var $V = { kernelName: an, backendName: "webgpu", kernelFunc: Eue }; -var kx = class { - constructor(t8, e, o, n) { +var ZW = { kernelName: Dn, backendName: "webgpu", kernelFunc: cle }; +var mle = ye({ opType: Z.COS }); +var JW = { kernelName: An, backendName: "webgpu", kernelFunc: mle }; +var dle = ye({ opType: Z.COSH }); +var eU = { kernelName: Fn, backendName: "webgpu", kernelFunc: dle }; +var Bx = class { + constructor(e, t10, o, n) { this.variableNames = ["Image", "Boxes", "BoxInd"], this.uniforms = "extrapolationValue : f32,", this.workgroupSize = [64, 1, 1], this.size = true; - let [s] = e; - this.outputShape = [s, o[0], o[1], t8], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.methodId = n === "bilinear" ? 1 : 0, this.cropHeightBiggerThan1 = this.outputShape[1] > 1, this.cropWidthBiggerThan1 = this.outputShape[2] > 1, this.shaderKey = `cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`; + let [s] = t10; + this.outputShape = [s, o[0], o[1], e], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.methodId = n === "bilinear" ? 1 : 0, this.cropHeightBiggerThan1 = this.outputShape[1] > 1, this.cropWidthBiggerThan1 = this.outputShape[2] > 1, this.shaderKey = `cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`; } getUserCode() { - let [t8, e] = ["f32(uniforms.imageShape[1] - 1)", "f32(uniforms.imageShape[2] - 1)"], [o, n, s] = this.cropHeightBiggerThan1 ? [`(${t8} / f32(uniforms.outShape[1] - 1))`, "(y2-y1) * height_ratio", `y1*${t8} + f32(y)*(height_scale)`] : ["0.0", "0.0", `0.5 * (y1+y2) * ${t8}`], [a, i, p] = this.cropWidthBiggerThan1 ? [`(${e} / f32(uniforms.outShape[2] - 1))`, "(x2-x1) * width_ratio", `x1*${e} + f32(x)*(width_scale)`] : ["0.0", "0.0", `0.5 * (x1+x2) * ${e}`]; + let [e, t10] = ["f32(uniforms.imageShape[1] - 1)", "f32(uniforms.imageShape[2] - 1)"], [o, n, s] = this.cropHeightBiggerThan1 ? [`(${e} / f32(uniforms.outShape[1] - 1))`, "(y2-y1) * height_ratio", `y1*${e} + f32(y)*(height_scale)`] : ["0.0", "0.0", `0.5 * (y1+y2) * ${e}`], [a, i, p] = this.cropWidthBiggerThan1 ? [`(${t10} / f32(uniforms.outShape[2] - 1))`, "(x2-x1) * width_ratio", `x1*${t10} + f32(x)*(width_scale)`] : ["0.0", "0.0", `0.5 * (x1+x2) * ${t10}`]; return ` ${G("index")} { if (index < uniforms.size) { @@ -30565,12 +31707,12 @@ var kx = class { let height_scale = ${n}; let width_scale = ${i}; let in_y = ${s}; - if( in_y < 0.0 || in_y > ${t8} ) { + if( in_y < 0.0 || in_y > ${e} ) { setOutputAtIndex(index, uniforms.extrapolationValue); return; } let in_x = ${p}; - if( in_x < 0.0 || in_x > ${e} ) { + if( in_x < 0.0 || in_x > ${t10} ) { setOutputAtIndex(index, uniforms.extrapolationValue); return; } @@ -30601,33 +31743,33 @@ var kx = class { `; } }; -var Rue = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n, boxes: s, boxInd: a } = t8, { cropSize: i, method: p, extrapolationValue: u } = o, c = new kx(n.shape[3], s.shape, i, p), l = [{ type: "float32", data: [u] }]; - return e.runWebGPUProgram(c, [n, s, a], "float32", l); +var fle = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n, boxes: s, boxInd: a } = e, { cropSize: i, method: p, extrapolationValue: u } = o, l = new Bx(n.shape[3], s.shape, i, p), c = [{ type: "float32", data: [u] }]; + return t10.runWebGPUProgram(l, [n, s, a], "float32", c); }; -var EV = { kernelName: cn, backendName: "webgpu", kernelFunc: Rue }; -var Ep; -(function(r15) { - r15.Prod = "*", r15.Sum = "+"; -})(Ep || (Ep = {})); -var hm = class { - constructor(t8, e, o, n) { - this.variableNames = ["x"], this.uniforms = "index : f32,", this.size = true, this.workgroupSize = [128, 1, 1], this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.exclusive = o, this.reverse = n, this.op = t8, this.shaderKey = `cum_${this.op}_${this.exclusive}_${this.reverse}`; +var tU = { kernelName: Mn, backendName: "webgpu", kernelFunc: fle }; +var Lp; +(function(r16) { + r16.Prod = "*", r16.Sum = "+"; +})(Lp || (Lp = {})); +var Tm = class { + constructor(e, t10, o, n) { + this.variableNames = ["x"], this.uniforms = "index : f32,", this.size = true, this.workgroupSize = [128, 1, 1], this.outputShape = t10, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.exclusive = o, this.reverse = n, this.op = e, this.shaderKey = `cum_${this.op}_${this.exclusive}_${this.reverse}`; } getUserCode() { - let t8 = this.outputShape.length, e = this.op === Ep.Prod ? "1.0" : "0.0", o = this.exclusive ? e : `getX(${RV(t8, "coords", this.op)})`, n = this.outputShape[this.outputShape.length - 1], s = "", a = ""; + let e = this.outputShape.length, t10 = this.op === Lp.Prod ? "1.0" : "0.0", o = this.exclusive ? t10 : `getX(${rU(e, "coords", this.op)})`, n = this.outputShape[this.outputShape.length - 1], s = "", a = ""; return this.exclusive ? (s = this.reverse ? `end != ${n - 1}` : "end != 0", a = this.reverse ? "end + 1" : "end - 1") : (s = this.reverse ? `end + pow2 < ${n}` : "end >= pow2", a = this.reverse ? "end + pow2" : "end - pow2"), ` ${G("index")} { if (index < uniforms.size) { var coords = getCoordsFromIndex(index); - let end = ${DV(t8, "coords", this.op)}; + let end = ${oU(e, "coords", this.op)}; var val = ${o}; let pow2 = i32(pow(2.0, uniforms.index)); if (${s}) { let idx = ${a}; - ${DV(t8, "coords", this.op)} = idx; - val ${this.op}= getX(${RV(t8, "coords", this.op)}); + ${oU(e, "coords", this.op)} = idx; + val ${this.op}= getX(${rU(e, "coords", this.op)}); } setOutputAtIndex(index, val); } @@ -30635,67 +31777,67 @@ var hm = class { `; } }; -function RV(r15, t8, e) { - if (r15 === 1) - return `${t8}`; - if (r15 === 2) - return `${t8}.x, ${t8}.y`; - if (r15 === 3) - return `${t8}.x, ${t8}.y, ${t8}.z`; - if (r15 === 4) - return `${t8}.x, ${t8}.y, ${t8}.z, ${t8}.w`; - throw Error(`Cumulative ${e} for rank ${r15} is not yet supported`); -} -function DV(r15, t8, e) { - if (r15 === 1) - return `${t8}`; - if (r15 === 2) - return `${t8}.y`; - if (r15 === 3) - return `${t8}.z`; - if (r15 === 4) - return `${t8}.w`; - throw Error(`Cumulative ${e} for rank ${r15} is not yet supported`); -} -function Nx(r15, t8, e, o, n, s) { - let a = t8.shape.length, i = w.getAxesPermutation([o], a), p = t8; - i != null && (p = xr({ inputs: { x: t8 }, backend: e, attrs: { perm: i } })); - let u = w.getInnerMostAxes(1, a)[0]; +function rU(r16, e, t10) { + if (r16 === 1) + return `${e}`; + if (r16 === 2) + return `${e}.x, ${e}.y`; + if (r16 === 3) + return `${e}.x, ${e}.y, ${e}.z`; + if (r16 === 4) + return `${e}.x, ${e}.y, ${e}.z, ${e}.w`; + throw Error(`Cumulative ${t10} for rank ${r16} is not yet supported`); +} +function oU(r16, e, t10) { + if (r16 === 1) + return `${e}`; + if (r16 === 2) + return `${e}.y`; + if (r16 === 3) + return `${e}.z`; + if (r16 === 4) + return `${e}.w`; + throw Error(`Cumulative ${t10} for rank ${r16} is not yet supported`); +} +function zx(r16, e, t10, o, n, s) { + let a = e.shape.length, i = C.getAxesPermutation([o], a), p = e; + i != null && (p = Cr({ inputs: { x: e }, backend: t10, attrs: { perm: i } })); + let u = C.getInnerMostAxes(1, a)[0]; if (u !== a - 1) - throw new Error(`WebGPU cumprod shader expects an inner-most axis=${t8.shape.length - 1} but got axis=${o}`); - let c = p.shape[u], l = At({ inputs: { x: p }, backend: e }); - for (let m = 0; m <= Math.ceil(Math.log2(c)) - 1; m++) { - let d = new hm(r15, p.shape, false, s), f = l, h = [{ type: "float32", data: [m] }]; - l = e.runWebGPUProgram(d, [l], l.dtype, h), e.disposeData(f.dataId); + throw new Error(`WebGPU cumprod shader expects an inner-most axis=${e.shape.length - 1} but got axis=${o}`); + let l = p.shape[u], c = Pt({ inputs: { x: p }, backend: t10 }); + for (let m = 0; m <= Math.ceil(Math.log2(l)) - 1; m++) { + let d = new Tm(r16, p.shape, false, s), f = c, h = [{ type: "float32", data: [m] }]; + c = t10.runWebGPUProgram(d, [c], c.dtype, h), t10.disposeData(f.dataId); } if (n) { - let m = new hm(r15, p.shape, n, s), d = l, f = [{ type: "float32", data: [0] }]; - l = e.runWebGPUProgram(m, [l], l.dtype, f), e.disposeData(d.dataId); + let m = new Tm(r16, p.shape, n, s), d = c, f = [{ type: "float32", data: [0] }]; + c = t10.runWebGPUProgram(m, [c], c.dtype, f), t10.disposeData(d.dataId); } if (i != null) { - let m = w.getUndoAxesPermutation(i), d = xr({ inputs: { x: l }, backend: e, attrs: { perm: m } }); - return e.disposeData(l.dataId), e.disposeData(p.dataId), d; + let m = C.getUndoAxesPermutation(i), d = Cr({ inputs: { x: c }, backend: t10, attrs: { perm: m } }); + return t10.disposeData(c.dataId), t10.disposeData(p.dataId), d; } - return l; + return c; } -function Due(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o; - return Nx(Ep.Prod, n, e, s, a, i); +function hle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o; + return zx(Lp.Prod, n, t10, s, a, i); } -var AV = { kernelName: un, backendName: "webgpu", kernelFunc: Due }; -function Aue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, exclusive: a, reverse: i } = o; - return Nx(Ep.Sum, n, e, s, a, i); +var nU = { kernelName: Pn, backendName: "webgpu", kernelFunc: hle }; +function gle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, exclusive: a, reverse: i } = o; + return zx(Lp.Sum, n, t10, s, a, i); } -var FV = { kernelName: pn, backendName: "webgpu", kernelFunc: Aue }; -function Fue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, weights: s } = t8, { size: a, binaryOutput: i } = o, p = n.shape.length === 1, c = y.sizeFromShape(s.shape) > 0, l = s.dtype, m = p ? [n.shape[0]] : [n.shape[0], n.shape[1]], d = p ? [a] : [n.shape[0], a], f = vt({ backend: e, attrs: { shape: d, value: 0, dtype: l } }), h = new Xc(m, c, i), g = [{ type: "int32", data: [a] }], x = c ? [n, s] : [n]; - return e.runWebGPUProgram(h, x, l, g, f); +var sU = { kernelName: On, backendName: "webgpu", kernelFunc: gle }; +function xle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, weights: s } = e, { size: a, binaryOutput: i } = o, p = n.shape.length === 1, l = y.sizeFromShape(s.shape) > 0, c = s.dtype, m = p ? [n.shape[0]] : [n.shape[0], n.shape[1]], d = p ? [a] : [n.shape[0], a], f = Nt({ backend: t10, attrs: { shape: d, value: 0, dtype: c } }), h = new nc(m, l, i), g = [{ type: "int32", data: [a] }], x = l ? [n, s] : [n]; + return t10.runWebGPUProgram(h, x, c, g, f); } -var PV = { kernelName: ra, backendName: "webgpu", kernelFunc: Fue }; -var Tx = class { - constructor(t8, e) { - this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.uniforms = "blockSize : i32,", this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = `depthToSpace_${e}`, this.dataFormat = e; +var aU = { kernelName: la, backendName: "webgpu", kernelFunc: xle }; +var Vx = class { + constructor(e, t10) { + this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.uniforms = "blockSize : i32,", this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = `depthToSpace_${t10}`, this.dataFormat = t10; } getUserCode() { return ` @@ -30736,19 +31878,19 @@ var Tx = class { return this.dataFormat === "NHWC" ? "getX(b, in_h, in_w, in_d)" : "getX(b, in_d, in_h, in_w)"; } }; -function Pue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockSize: s, dataFormat: a } = o, i = n.shape[0], p = a === "NHWC" ? n.shape[1] : n.shape[2], u = a === "NHWC" ? n.shape[2] : n.shape[3], c = a === "NHWC" ? n.shape[3] : n.shape[1], l = p * s, m = u * s, d = c / (s * s), f = a === "NHWC" ? [i, l, m, d] : [i, d, l, m], h = [{ type: "int32", data: [s] }], g = new Tx(f, a); - return e.runWebGPUProgram(g, [n], n.dtype, h); +function yle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockSize: s, dataFormat: a } = o, i = n.shape[0], p = a === "NHWC" ? n.shape[1] : n.shape[2], u = a === "NHWC" ? n.shape[2] : n.shape[3], l = a === "NHWC" ? n.shape[3] : n.shape[1], c = p * s, m = u * s, d = l / (s * s), f = a === "NHWC" ? [i, c, m, d] : [i, d, c, m], h = [{ type: "int32", data: [s] }], g = new Vx(f, a); + return t10.runWebGPUProgram(g, [n], n.dtype, h); } -var OV = { kernelName: ln, backendName: "webgpu", kernelFunc: Pue }; -var _x = class { - constructor(t8, e, o, n = false, s = null, a = false) { - this.variableNames = ["x", "W"], this.uniforms = "pads : vec2, inDims : vec2,", this.workgroupSize = [16, 16, 1], this.outputShape = t8, this.dispatchLayout = { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), n && this.variableNames.push("bias"), a && this.variableNames.push("preluActivationWeights"), this.addBias = n, this.activation = s, this.hasPreluActivation = a, this.filterHeight = e, this.filterWidth = o, this.shaderKey = `depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`; +var iU = { kernelName: Ln, backendName: "webgpu", kernelFunc: yle }; +var Wx = class { + constructor(e, t10, o, n = false, s = null, a = false) { + this.variableNames = ["x", "W"], this.uniforms = "pads : vec2, inDims : vec2,", this.workgroupSize = [16, 16, 1], this.outputShape = e, this.dispatchLayout = { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), n && this.variableNames.push("bias"), a && this.variableNames.push("preluActivationWeights"), this.addBias = n, this.activation = s, this.hasPreluActivation = a, this.filterHeight = t10, this.filterWidth = o, this.shaderKey = `depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`; } getUserCode() { - let t8 = this.filterWidth * this.filterHeight, e = this.workgroupSize[0] * this.workgroupSize[1] * this.workgroupSize[2], o = this.workgroupSize[1] + this.filterHeight - 1, n = this.workgroupSize[0] + this.filterWidth - 1; + let e = this.filterWidth * this.filterHeight, t10 = this.workgroupSize[0] * this.workgroupSize[1] * this.workgroupSize[2], o = this.workgroupSize[1] + this.filterHeight - 1, n = this.workgroupSize[0] + this.filterWidth - 1; return ` - ${dr(this.activation, this.hasPreluActivation, false, 4)} + ${gr(this.activation, this.hasPreluActivation, false, 4)} var mm_Asub : array, ${o}>; var mm_Bsub : array, ${this.filterHeight}>; @@ -30786,7 +31928,7 @@ var _x = class { // Load one tile of W into local memory. var wIndex = i32(localIndex); - ${t8 < e ? `if (wIndex < ${t8})` : `for(; wIndex < ${t8}; wIndex = wIndex + ${e})`} + ${e < t10 ? `if (wIndex < ${e})` : `for(; wIndex < ${e}; wIndex = wIndex + ${t10})`} { let wRow = wIndex / ${this.filterWidth}; @@ -30804,7 +31946,7 @@ var _x = class { value = fma(xVal, wVal, value); } } - ${Qr(this.addBias, this.activation)} + ${no(this.addBias, this.activation)} if (coordsInBounds4D(coords, uniforms.outShape)) { setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } @@ -30812,16 +31954,16 @@ var _x = class { `; } }; -var Qc = class { - constructor(t8, e = false, o = null, n = false) { - this.variableNames = ["x", "W"], this.uniforms = "pads : vec2, inDims : vec2, virtualWidth : i32,", this.workgroupSize = [64, 1, 1], this.workPerThread = 4, this.outputComponent = 4, this.outputShape = t8.outShape, this.virtualWidth = Math.ceil(this.outputShape[2] / this.workPerThread) * this.workPerThread; +var ac = class { + constructor(e, t10 = false, o = null, n = false) { + this.variableNames = ["x", "W"], this.uniforms = "pads : vec2, inDims : vec2, virtualWidth : i32,", this.workgroupSize = [64, 1, 1], this.workPerThread = 4, this.outputComponent = 4, this.outputShape = e.outShape, this.virtualWidth = Math.ceil(this.outputShape[2] / this.workPerThread) * this.workPerThread; let s = [this.outputShape[0], this.outputShape[1], this.virtualWidth, this.outputShape[3]]; - this.dispatchLayout = X(s), this.dispatch = H(this.dispatchLayout, s, this.workgroupSize, [this.outputComponent * this.workPerThread, 1, 1]), y.assert(t8.dataFormat === "channelsLast", () => "TODO: NCHW is unimplemented"), e && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), this.convInfo = t8, this.addBias = e, this.activation = o, this.hasPreluActivation = n, this.shaderKey = `depthwiseVec4_${o}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`; + this.dispatchLayout = X(s), this.dispatch = H(this.dispatchLayout, s, this.workgroupSize, [this.outputComponent * this.workPerThread, 1, 1]), y.assert(e.dataFormat === "channelsLast", () => "TODO: NCHW is unimplemented"), t10 && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), this.convInfo = e, this.addBias = t10, this.activation = o, this.hasPreluActivation = n, this.shaderKey = `depthwiseVec4_${o}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`; } getUserCode() { - let t8 = (this.workPerThread - 1) * this.convInfo.strideWidth + this.convInfo.filterWidth, e = this.convInfo.strideHeight, o = this.convInfo.strideWidth; + let e = (this.workPerThread - 1) * this.convInfo.strideWidth + this.convInfo.filterWidth, t10 = this.convInfo.strideHeight, o = this.convInfo.strideWidth; return ` - ${dr(this.activation, this.hasPreluActivation, true, 4)} + ${gr(this.activation, this.hasPreluActivation, true, 4)} fn readX(batch : i32, row : i32, col : i32, channel : i32) -> vec4 { var value = vec4(0.0); if (col >=0 && col < uniforms.inDims[1]) { @@ -30840,11 +31982,11 @@ var Qc = class { let r = index1 % uniforms.outShape[1]; let batch = index1 / uniforms.outShape[1]; - let xRCCorner = vec2(r, c) * vec2(${e}, ${o}) - uniforms.pads; + let xRCCorner = vec2(r, c) * vec2(${t10}, ${o}) - uniforms.pads; let xRCorner = xRCCorner.x; let xCCorner = xRCCorner.y; - var xVals : array, ${t8}>; + var xVals : array, ${e}>; var dotProd : array, ${this.workPerThread}>; for (var i = 0; i < ${this.workPerThread}; i++) { dotProd[i] = vec4(0.0); @@ -30854,7 +31996,7 @@ var Qc = class { for (var wR = 0; wR < ${this.convInfo.filterHeight}; wR = wR + 1) { let xR = xRCorner + wR; if (xR >=0 && xR < uniforms.inDims[0]) { - for (var i = 0; i < ${t8}; i++) { + for (var i = 0; i < ${e}; i++) { xVals[i] = readX(batch, xR, xCCorner + i, d1); } for (var wC = 0; wC < ${this.convInfo.filterWidth}; wC = wC + 1) { @@ -30870,7 +32012,7 @@ var Qc = class { let coords = vec4(batch, r, c + i, d1); if (coordsInBounds4D(coords, uniforms.outShape)) { var value = dotProd[i]; - ${Qr(this.addBias, this.activation)} + ${no(this.addBias, this.activation)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } } @@ -30878,15 +32020,15 @@ var Qc = class { `; } }; -var Zc = class { - constructor(t8, e = false, o = null, n = false) { +var ic = class { + constructor(e, t10 = false, o = null, n = false) { this.variableNames = ["x", "W"], this.uniforms = `pads : vec2, inDims : vec2, filterHeight : i32, - filterWidth : i32, strides : vec2, dilations : vec2,`, this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = t8.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.isChannelsLast = t8.dataFormat === "channelsLast", e && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), this.convInfo = t8, this.addBias = e, this.activation = o, this.hasPreluActivation = n, this.shaderKey = `depthwise_${this.activation}_${this.isChannelsLast}`; + filterWidth : i32, strides : vec2, dilations : vec2,`, this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = e.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.isChannelsLast = e.dataFormat === "channelsLast", t10 && this.variableNames.push("bias"), n && this.variableNames.push("preluActivationWeights"), this.convInfo = e, this.addBias = t10, this.activation = o, this.hasPreluActivation = n, this.shaderKey = `depthwise_${this.activation}_${this.isChannelsLast}`; } getUserCode() { - let t8 = this.isChannelsLast ? "getX(batch, xR, xC, d1);" : "getX(batch, d1, xR, xC);"; + let e = this.isChannelsLast ? "getX(batch, xR, xC, d1);" : "getX(batch, d1, xR, xC);"; return ` - ${dr(this.activation, this.hasPreluActivation, false, 4)} + ${gr(this.activation, this.hasPreluActivation, false, 4)} ${G("index")} { if (index < uniforms.size) { @@ -30921,7 +32063,7 @@ var Zc = class { for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) { let xC = inputColStart + wC * uniforms.dilations[1]; - let xVal = ${t8}; + let xVal = ${e}; let wVal = getW(wR, wC, d1, q); value = value + xVal * wVal; } @@ -30941,30 +32083,30 @@ var Zc = class { continue; } - let xVal = ${t8}; + let xVal = ${e}; let wVal = getW(wR, wC, d1, q); value = value + xVal * wVal; } } } - ${Qr(this.addBias, this.activation)} + ${no(this.addBias, this.activation)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } } `; } }; -function Oue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: c } = o, l = w.convertConv2DDataFormat(p), m = u; +function ble(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dataFormat: p, dilations: u, dimRoundingMode: l } = o, c = C.convertConv2DDataFormat(p), m = u; m == null && (m = [1, 1]); - let d = w.computeConv2DInfo(n.shape, s.shape, a, m, i, c, true, l), f = [{ type: "int32", data: [d.padInfo.top, d.padInfo.left] }, { type: "int32", data: [d.inHeight, d.inWidth] }], h = d.dataFormat === "channelsLast", g; - return !h && d.inHeight > 16 && d.inWidth > 16 && d.strideHeight === 1 && d.strideWidth === 1 && d.dilationWidth === 1 && d.dilationHeight === 1 && d.inChannels === d.outChannels ? g = new _x(d.outShape, d.filterHeight, d.filterWidth) : h && d.outHeight > 4 && d.outWidth > 4 && d.strideWidth <= 2 && d.inChannels === d.outChannels && d.dilationHeight === 1 && d.dilationWidth === 1 && d.inChannels % 4 === 0 ? (g = new Qc(d), f.push({ type: "int32", data: [g.virtualWidth] })) : (g = new Zc(d), f.push({ type: "int32", data: [d.filterHeight] }, { type: "int32", data: [d.filterWidth] }, { type: "int32", data: [d.strideHeight, d.strideWidth] }, { type: "int32", data: [d.dilationHeight, d.dilationWidth] })), e.runWebGPUProgram(g, [n, s], n.dtype, f); + let d = C.computeConv2DInfo(n.shape, s.shape, a, m, i, l, true, c), f = [{ type: "int32", data: [d.padInfo.top, d.padInfo.left] }, { type: "int32", data: [d.inHeight, d.inWidth] }], h = d.dataFormat === "channelsLast", g; + return !h && d.inHeight > 16 && d.inWidth > 16 && d.strideHeight === 1 && d.strideWidth === 1 && d.dilationWidth === 1 && d.dilationHeight === 1 && d.inChannels === d.outChannels ? g = new Wx(d.outShape, d.filterHeight, d.filterWidth) : h && d.outHeight > 4 && d.outWidth > 4 && d.strideWidth <= 2 && d.inChannels === d.outChannels && d.dilationHeight === 1 && d.dilationWidth === 1 && d.inChannels % 4 === 0 ? (g = new ac(d), f.push({ type: "int32", data: [g.virtualWidth] })) : (g = new ic(d), f.push({ type: "int32", data: [d.filterHeight] }, { type: "int32", data: [d.filterWidth] }, { type: "int32", data: [d.strideHeight, d.strideWidth] }, { type: "int32", data: [d.dilationHeight, d.dilationWidth] })), t10.runWebGPUProgram(g, [n, s], n.dtype, f); } -var MV = { kernelName: mn, backendName: "webgpu", kernelFunc: Oue }; -var $x = class { - constructor(t8) { +var uU = { kernelName: Bn, backendName: "webgpu", kernelFunc: ble }; +var Ux = class { + constructor(e) { this.variableNames = ["x", "dy"], this.uniforms = `strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32, - outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.filterShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "depthwise_conv2d_backprop_filter"; + outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.filterShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "depthwise_conv2d_backprop_filter"; } getUserCode() { return ` @@ -31005,10 +32147,10 @@ var $x = class { `; } }; -var Ex = class { - constructor(t8) { +var Gx = class { + constructor(e) { this.variableNames = ["dy", "W"], this.uniforms = `strides : vec2, pads : vec2, filterDims : vec2, - outHeight : i32, outWidth : i32, channelMul : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "depthwise_conv2d_backprop_input"; + outHeight : i32, outWidth : i32, channelMul : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "depthwise_conv2d_backprop_input"; } getUserCode() { return ` @@ -31056,19 +32198,19 @@ var Ex = class { `; } }; -function Mue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, dy: s } = t8, { strides: a, dilations: i, pad: p, dimRoundingMode: u, filterShape: c } = o, l = w.computeConv2DInfo(n.shape, c, a, i, p, u, true), m = new $x(l), d = [{ type: "int32", data: [l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.padInfo.top, l.padInfo.left] }, { type: "int32", data: [l.filterHeight, l.filterWidth] }, { type: "int32", data: [l.outHeight] }, { type: "int32", data: [l.outWidth] }, { type: "int32", data: [l.inHeight] }, { type: "int32", data: [l.inWidth] }, { type: "int32", data: [l.batchSize] }, { type: "int32", data: [l.outChannels / l.inChannels] }]; - return e.runWebGPUProgram(m, [n, s], "float32", d); +function Cle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, dy: s } = e, { strides: a, dilations: i, pad: p, dimRoundingMode: u, filterShape: l } = o, c = C.computeConv2DInfo(n.shape, l, a, i, p, u, true), m = new Ux(c), d = [{ type: "int32", data: [c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.padInfo.top, c.padInfo.left] }, { type: "int32", data: [c.filterHeight, c.filterWidth] }, { type: "int32", data: [c.outHeight] }, { type: "int32", data: [c.outWidth] }, { type: "int32", data: [c.inHeight] }, { type: "int32", data: [c.inWidth] }, { type: "int32", data: [c.batchSize] }, { type: "int32", data: [c.outChannels / c.inChannels] }]; + return t10.runWebGPUProgram(m, [n, s], "float32", d); } -var LV = { kernelName: Fi, backendName: "webgpu", kernelFunc: Mue }; -function Lue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, filter: s } = t8, { strides: a, dilations: i, pad: p, dimRoundingMode: u, inputShape: c } = o, l = w.computeConv2DInfo(c, s.shape, a, i, p, u, true), m = new Ex(l), d = [{ type: "int32", data: [l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.filterHeight - 1 - l.padInfo.top, l.filterWidth - 1 - l.padInfo.left] }, { type: "int32", data: [l.filterHeight, l.filterWidth] }, { type: "int32", data: [l.outHeight] }, { type: "int32", data: [l.outWidth] }, { type: "int32", data: [l.outChannels / l.inChannels] }]; - return e.runWebGPUProgram(m, [n, s], n.dtype, d); +var pU = { kernelName: Gi, backendName: "webgpu", kernelFunc: Cle }; +function wle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, filter: s } = e, { strides: a, dilations: i, pad: p, dimRoundingMode: u, inputShape: l } = o, c = C.computeConv2DInfo(l, s.shape, a, i, p, u, true), m = new Gx(c), d = [{ type: "int32", data: [c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.filterHeight - 1 - c.padInfo.top, c.filterWidth - 1 - c.padInfo.left] }, { type: "int32", data: [c.filterHeight, c.filterWidth] }, { type: "int32", data: [c.outHeight] }, { type: "int32", data: [c.outWidth] }, { type: "int32", data: [c.outChannels / c.inChannels] }]; + return t10.runWebGPUProgram(m, [n, s], n.dtype, d); } -var BV = { kernelName: Pi, backendName: "webgpu", kernelFunc: Lue }; -var Rx = class { - constructor(t8) { - this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [t8, t8], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "diag"; +var lU = { kernelName: Hi, backendName: "webgpu", kernelFunc: wle }; +var Hx = class { + constructor(e) { + this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [e, e], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "diag"; } getUserCode() { return ` @@ -31082,14 +32224,14 @@ var Rx = class { `; } }; -function Bue(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8, n = [...o.shape, ...o.shape], s = y.sizeFromShape(o.shape), a = pe({ inputs: { x: o }, backend: e, attrs: { shape: [s] } }), i = new Rx(s), p = e.runWebGPUProgram(i, [a], a.dtype), u = pe({ inputs: { x: p }, backend: e, attrs: { shape: n } }); - return e.disposeData(a.dataId), e.disposeData(p.dataId), u; +function Sle(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e, n = [...o.shape, ...o.shape], s = y.sizeFromShape(o.shape), a = le({ inputs: { x: o }, backend: t10, attrs: { shape: [s] } }), i = new Hx(s), p = t10.runWebGPUProgram(i, [a], a.dtype), u = le({ inputs: { x: p }, backend: t10, attrs: { shape: n } }); + return t10.disposeData(a.dataId), t10.disposeData(p.dataId), u; } -var zV = { kernelName: oa, backendName: "webgpu", kernelFunc: Bue }; -var Dx = class { - constructor(t8) { - this.variableNames = ["x", "w"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "dilation2d"; +var cU = { kernelName: ca, backendName: "webgpu", kernelFunc: Sle }; +var Kx = class { + constructor(e) { + this.variableNames = ["x", "w"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.outShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "dilation2d"; } getUserCode() { return ` @@ -31127,17 +32269,17 @@ var Dx = class { `; } }; -function zue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s } = t8, { strides: a, pad: i, dilations: p } = o, u = w.computeDilation2DInfo(n.shape, s.shape, a, i, "NHWC", p), c = [u.padInfo.top, u.padInfo.left], l = [{ type: "int32", data: [u.filterHeight, u.filterWidth] }, { type: "int32", data: [...c] }, { type: "int32", data: [u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.dilationHeight, u.dilationWidth] }], m = new Dx(u); - return e.runWebGPUProgram(m, [n, s], n.dtype, l); +function Ile(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s } = e, { strides: a, pad: i, dilations: p } = o, u = C.computeDilation2DInfo(n.shape, s.shape, a, i, "NHWC", p), l = [u.padInfo.top, u.padInfo.left], c = [{ type: "int32", data: [u.filterHeight, u.filterWidth] }, { type: "int32", data: [...l] }, { type: "int32", data: [u.strideHeight, u.strideWidth] }, { type: "int32", data: [u.dilationHeight, u.dilationWidth] }], m = new Kx(u); + return t10.runWebGPUProgram(m, [n, s], n.dtype, c); } -var VV = { kernelName: dn, backendName: "webgpu", kernelFunc: zue }; -var Ax = class { - constructor(t8, e) { - if (this.variableNames = ["x", "w", "dy"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = t8.inShape, this.dispatchLayout = X(t8.outShape), this.dispatch = H(this.dispatchLayout, t8.outShape, this.workgroupSize), e !== "float32" && e !== "int32") +var mU = { kernelName: zn, backendName: "webgpu", kernelFunc: Ile }; +var qx = class { + constructor(e, t10) { + if (this.variableNames = ["x", "w", "dy"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = e.inShape, this.dispatchLayout = X(e.outShape), this.dispatch = H(this.dispatchLayout, e.outShape, this.workgroupSize), t10 !== "float32" && t10 !== "int32") throw new Error(`Dilation2DBackpropInput only supports float32 and int32 - types, does not support ${e} type.`); - this.type = e, this.shaderKey = "dilation2DBackpropInput"; + types, does not support ${t10} type.`); + this.type = t10, this.shaderKey = "dilation2DBackpropInput"; } getUserCode() { return ` @@ -31180,15 +32322,15 @@ var Ax = class { let flatIndexIn = d + uniforms.xShape[3] * (xCMax + uniforms.xShape[2] * (xRMax + uniforms.xShape[1] * b)); let value = getDy(b, r, c, d); - ${Yr("&result[flatIndexIn]", "value", this.type)} + ${oo("&result[flatIndexIn]", "value", this.type)} } } `; } }; -var Fx = class { - constructor(t8, e, o) { - if (this.variableNames = ["x", "w", "dy"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = t8.filterShape, this.dispatchLayout = X(t8.outShape), this.dispatch = H(this.dispatchLayout, t8.outShape, this.workgroupSize), o !== "float32" && o !== "int32") +var jx = class { + constructor(e, t10, o) { + if (this.variableNames = ["x", "w", "dy"], this.uniforms = "filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = e.filterShape, this.dispatchLayout = X(e.outShape), this.dispatch = H(this.dispatchLayout, e.outShape, this.workgroupSize), o !== "float32" && o !== "int32") throw new Error(`Dilation2DBackpropFilter only supports float32 and int32 types, does not support ${o} type.`); this.type = o, this.shaderKey = "dilation2DBackpropFilter"; @@ -31233,35 +32375,35 @@ var Fx = class { let flatIndexIn = d + uniforms.wShape[2] * (wCMax + wRMax * uniforms.wShape[1]); let value = getDy(b, r, c, d); - ${Yr("&result[flatIndexIn]", "value", this.type)} + ${oo("&result[flatIndexIn]", "value", this.type)} } } `; } }; -function Vue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, dy: a } = t8, { strides: i, pad: p, dilations: u } = o, c = w.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), l = s.dtype, m = new Fx(c, s.shape, l), d = [{ type: "int32", data: [c.filterHeight, c.filterWidth] }, { type: "int32", data: [c.padInfo.top, c.padInfo.left] }, { type: "int32", data: [c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.dilationHeight, c.dilationWidth] }, { type: "int32", data: [y.sizeFromShape(c.outShape)] }], f = vt({ backend: e, attrs: { shape: s.shape, value: 0, dtype: l } }); - return e.runWebGPUProgram(m, [n, s, a], l, d, f); +function vle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, dy: a } = e, { strides: i, pad: p, dilations: u } = o, l = C.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), c = s.dtype, m = new jx(l, s.shape, c), d = [{ type: "int32", data: [l.filterHeight, l.filterWidth] }, { type: "int32", data: [l.padInfo.top, l.padInfo.left] }, { type: "int32", data: [l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.dilationHeight, l.dilationWidth] }, { type: "int32", data: [y.sizeFromShape(l.outShape)] }], f = Nt({ backend: t10, attrs: { shape: s.shape, value: 0, dtype: c } }); + return t10.runWebGPUProgram(m, [n, s, a], c, d, f); } -var WV = { kernelName: Mi, backendName: "webgpu", kernelFunc: Vue }; -function Wue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, dy: a } = t8, { strides: i, pad: p, dilations: u } = o, c = w.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), l = n.dtype, m = new Ax(c, l), d = [{ type: "int32", data: [c.filterHeight, c.filterWidth] }, { type: "int32", data: [c.padInfo.top, c.padInfo.left] }, { type: "int32", data: [c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.dilationHeight, c.dilationWidth] }, { type: "int32", data: [y.sizeFromShape(c.outShape)] }], f = vt({ backend: e, attrs: { shape: c.inShape, value: 0, dtype: l } }); - return e.runWebGPUProgram(m, [n, s, a], l, d, f); +var dU = { kernelName: qi, backendName: "webgpu", kernelFunc: vle }; +function kle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, dy: a } = e, { strides: i, pad: p, dilations: u } = o, l = C.computeDilation2DInfo(n.shape, s.shape, i, p, "NHWC", u), c = n.dtype, m = new qx(l, c), d = [{ type: "int32", data: [l.filterHeight, l.filterWidth] }, { type: "int32", data: [l.padInfo.top, l.padInfo.left] }, { type: "int32", data: [l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.dilationHeight, l.dilationWidth] }, { type: "int32", data: [y.sizeFromShape(l.outShape)] }], f = Nt({ backend: t10, attrs: { shape: l.inShape, value: 0, dtype: c } }); + return t10.runWebGPUProgram(m, [n, s, a], c, d, f); } -var UV = { kernelName: Oi, backendName: "webgpu", kernelFunc: Wue }; -var Px = class { - constructor(t8, e, o) { - this.variableNames = ["Image"], this.uniforms = "alpha: f32,", this.workgroupSize = [64, 1, 1], this.pixelsOpType = Ci.DRAW, this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.type = e, this.textureFormat = o, this.shaderKey = `draw_${e}_${o}`; +var fU = { kernelName: Ki, backendName: "webgpu", kernelFunc: kle }; +var Xx = class { + constructor(e, t10, o) { + this.variableNames = ["Image"], this.uniforms = "alpha: f32,", this.workgroupSize = [64, 1, 1], this.pixelsOpType = $i.DRAW, this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.type = t10, this.textureFormat = o, this.shaderKey = `draw_${t10}_${o}`; } getUserCode() { - let t8, e = this.type === "float32" ? "value" : "value / 255.0"; - return t8 = ` + let e, t10 = this.type === "float32" ? "value" : "value / 255.0"; + return e = ` if (uniforms.numChannels == 1) { - rgba[0] = ${e}; - rgba[1] = ${e}; - rgba[2] = ${e}; + rgba[0] = ${t10}; + rgba[1] = ${t10}; + rgba[2] = ${t10}; } else { - rgba[d] = ${e}; + rgba[d] = ${t10}; }`, ` @group(0) @binding(0) var outImage : texture_storage_2d<${this.textureFormat}, write>; ${G("index")} { @@ -31269,7 +32411,7 @@ var Px = class { var rgba = vec4(0.0, 0.0, 0.0, uniforms.alpha); for (var d = 0; d < uniforms.numChannels; d = d + 1) { let value = f32(inBuf[index * uniforms.numChannels + d]); - ${t8} + ${e} } rgba.x = rgba.x * rgba.w; rgba.y = rgba.y * rgba.w; @@ -31281,75 +32423,75 @@ var Px = class { `; } }; -function Uue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n } = t8, { canvas: s, options: a } = o, [i, p] = n.shape.slice(0, 2), { imageOptions: u } = a || {}, c = (u == null ? void 0 : u.alpha) || 1, l = e.device.features.has("bgra8unorm-storage") ? "bgra8unorm" : "rgba8unorm", m = [i, p], d = new Px(m, n.dtype, l); +function Nle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n } = e, { canvas: s, options: a } = o, [i, p] = n.shape.slice(0, 2), { imageOptions: u } = a || {}, l = (u == null ? void 0 : u.alpha) || 1, c = t10.device.features.has("bgra8unorm-storage") ? "bgra8unorm" : "rgba8unorm", m = [i, p], d = new Xx(m, n.dtype, c); s.width = p, s.height = i; let f = "webgpu", h = s.getContext(f), g; h || (g = new OffscreenCanvas(p, i), h = g.getContext(f)); let x = n.shape.length === 3 ? n.shape[2] : 1; - h.configure({ device: e.device, format: l, usage: GPUTextureUsage.STORAGE_BINDING, alphaMode: "premultiplied" }); - let b = "int32", C = e.makeTensorInfo(m, b), S = e.tensorMap.get(C.dataId); + h.configure({ device: t10.device, format: c, usage: GPUTextureUsage.STORAGE_BINDING, alphaMode: "premultiplied" }); + let b = "int32", w = t10.makeTensorInfo(m, b), S = t10.tensorMap.get(w.dataId); S.resource = h.getCurrentTexture(), S.external = true; - let k = [{ type: "uint32", data: [x] }, { type: "float32", data: [c] }]; - if (e.runWebGPUProgram(d, [n], b, k, C), g) { - let _ = s.getContext("2d"); - if (!_) + let k = [{ type: "uint32", data: [x] }, { type: "float32", data: [l] }]; + if (t10.runWebGPUProgram(d, [n], b, k, w), g) { + let T = s.getContext("2d"); + if (!T) throw new Error("Please make sure this canvas has only been used for 2d or webgpu context!"); - _.drawImage(g, 0, 0); - } - return e.disposeData(C.dataId), n; -} -var GV = { kernelName: _u, backendName: "webgpu", kernelFunc: Uue }; -var a0 = et({ opType: fe.MUL, cpuKernelImpl: kz, supportsComplex: true }); -var HV = { kernelName: Xn, backendName: "webgpu", kernelFunc: a0 }; -function i0(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; - return Jr(n, s, a, "sum", e); -} -var KV = { kernelName: Ss, backendName: "webgpu", kernelFunc: i0 }; -function Gue(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { equation: n } = o, s = t8, { allDims: a, summedDims: i, idDims: p } = w.decodeEinsumEquation(n, s.length); - w.checkEinsumDimSizes(a.length, p, s); - let { path: u, steps: c } = w.getEinsumComputePath(i, p), l = c.length, m = null, d = a.length, f = []; - for (let h = 0; h < l; ++h) { - for (let g of c[h]) { - let { permutationIndices: x, expandDims: b } = w.getEinsumPermutation(d, p[g]), C; - w.isIdentityPermutation(x) ? C = s[g] : (C = xr({ inputs: { x: s[g] }, backend: e, attrs: { perm: x } }), f.push(C)); - let S = C.shape.slice(); + T.drawImage(g, 0, 0); + } + return t10.disposeData(w.dataId), n; +} +var hU = { kernelName: Mu, backendName: "webgpu", kernelFunc: Nle }; +var Kv = tt({ opType: fe.MUL, cpuKernelImpl: YV, supportsComplex: true }); +var gU = { kernelName: $o, backendName: "webgpu", kernelFunc: Kv }; +function qv(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; + return ao(n, s, a, "sum", t10); +} +var xU = { kernelName: As, backendName: "webgpu", kernelFunc: qv }; +function Tle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { equation: n } = o, s = e, { allDims: a, summedDims: i, idDims: p } = C.decodeEinsumEquation(n, s.length); + C.checkEinsumDimSizes(a.length, p, s); + let { path: u, steps: l } = C.getEinsumComputePath(i, p), c = l.length, m = null, d = a.length, f = []; + for (let h = 0; h < c; ++h) { + for (let g of l[h]) { + let { permutationIndices: x, expandDims: b } = C.getEinsumPermutation(d, p[g]), w; + C.isIdentityPermutation(x) ? w = s[g] : (w = Cr({ inputs: { x: s[g] }, backend: t10, attrs: { perm: x } }), f.push(w)); + let S = w.shape.slice(); for (let k = 0; k < b.length; ++k) S.splice(b[k], 0, 1); - y.arraysEqual(C.shape, S) || (C = pe({ inputs: { x: C }, backend: e, attrs: { shape: S } }), f.push(C)), m === null ? m = C : (m = a0({ inputs: { a: C, b: m }, backend: e }), f.push(m)); + y.arraysEqual(w.shape, S) || (w = le({ inputs: { x: w }, backend: t10, attrs: { shape: S } }), f.push(w)), m === null ? m = w : (m = Kv({ inputs: { a: w, b: m }, backend: t10 }), f.push(m)); } - h < l - 1 && (u[h] >= 0 && (m = i0({ inputs: { x: m }, backend: e, attrs: { axis: u[h] - (a.length - d), keepDims: false } }), f.push(m)), d--); + h < c - 1 && (u[h] >= 0 && (m = qv({ inputs: { x: m }, backend: t10, attrs: { axis: u[h] - (a.length - d), keepDims: false } }), f.push(m)), d--); } for (let h of f) - h !== m && e.disposeData(h.dataId); + h !== m && t10.disposeData(h.dataId); return m; } -var qV = { kernelName: Li, backendName: "webgpu", kernelFunc: Gue }; -var Hue = ye({ opType: Z.ELU }); -var jV = { kernelName: hn, backendName: "webgpu", kernelFunc: Hue }; -var Kue = (r15) => { - let { inputs: t8, backend: e } = r15, { dy: o, y: n } = t8, s = new Si(fe.ELU_DER, o.shape, n.shape); - return e.runWebGPUProgram(s, [o, n], o.dtype); -}; -var XV = { kernelName: Xa, backendName: "webgpu", kernelFunc: Kue }; -var que = et({ opType: fe.EQUAL, dtype: "bool", cpuKernelImpl: cz }); -var YV = { kernelName: xn, backendName: "webgpu", kernelFunc: que }; -var jue = ye({ opType: Z.ERF }); -var QV = { kernelName: gn, backendName: "webgpu", kernelFunc: jue }; -var Xue = ye({ opType: Z.EXP, cpuKernelImpl: lz, dtype: "float32" }); -var ZV = { kernelName: yn, backendName: "webgpu", kernelFunc: Xue }; -function Ox(r15) { - let { inputs: t8, attrs: e, backend: o } = r15, { dim: n } = e, { input: s } = t8, a = s.shape.length, i = s.shape.slice(), p = n; - return n < 0 && (y.assert(-(a + 1) <= n, () => `Axis must be in the interval [${-(a + 1)}, ${a}]`), p = a + n + 1), i.splice(p, 0, 1), pe({ inputs: { x: s }, backend: o, attrs: { shape: i } }); -} -var JV = { kernelName: na, backendName: "webgpu", kernelFunc: Ox }; -var Yue = ye({ opType: Z.EXPM1, cpuKernelImpl: mz }); -var eW = { kernelName: bn, backendName: "webgpu", kernelFunc: Yue }; -var gm = class { - constructor(t8, e) { - this.variableNames = ["real", "imag"], this.outputShape = [], this.uniforms = "exponentMultiplier : f32, denominator: f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.component = t8, this.shaderKey = `fft_${t8}`; +var yU = { kernelName: ji, backendName: "webgpu", kernelFunc: Tle }; +var _le = ye({ opType: Z.ELU }); +var bU = { kernelName: Wn, backendName: "webgpu", kernelFunc: _le }; +var Ele = (r16) => { + let { inputs: e, backend: t10 } = r16, { dy: o, y: n } = e, s = new Di(fe.ELU_DER, o.shape, n.shape); + return t10.runWebGPUProgram(s, [o, n], o.dtype); +}; +var CU = { kernelName: ri, backendName: "webgpu", kernelFunc: Ele }; +var $le = tt({ opType: fe.EQUAL, dtype: "bool", cpuKernelImpl: PV }); +var wU = { kernelName: xo, backendName: "webgpu", kernelFunc: $le }; +var Rle = ye({ opType: Z.ERF }); +var SU = { kernelName: Un, backendName: "webgpu", kernelFunc: Rle }; +var Dle = ye({ opType: Z.EXP, cpuKernelImpl: OV, dtype: "float32" }); +var IU = { kernelName: yo, backendName: "webgpu", kernelFunc: Dle }; +function Yx(r16) { + let { inputs: e, attrs: t10, backend: o } = r16, { dim: n } = t10, { input: s } = e, a = s.shape.length, i = s.shape.slice(), p = n; + return n < 0 && (y.assert(-(a + 1) <= n, () => `Axis must be in the interval [${-(a + 1)}, ${a}]`), p = a + n + 1), i.splice(p, 0, 1), le({ inputs: { x: s }, backend: o, attrs: { shape: i } }); +} +var vU = { kernelName: ma, backendName: "webgpu", kernelFunc: Yx }; +var Ale = ye({ opType: Z.EXPM1, cpuKernelImpl: MV }); +var kU = { kernelName: bo, backendName: "webgpu", kernelFunc: Ale }; +var _m = class { + constructor(e, t10) { + this.variableNames = ["real", "imag"], this.outputShape = [], this.uniforms = "exponentMultiplier : f32, denominator: f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t10, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.component = e, this.shaderKey = `fft_${e}`; } getUserCode() { return ` @@ -31388,26 +32530,26 @@ var gm = class { `; } }; -function Mx(r15, t8, e) { - let o = e.tensorMap.get(r15.dataId), n = y.sizeFromShape(r15.shape), s = r15.shape[r15.shape.length - 1], a = n / s, i = [], p = pe({ inputs: { x: r15 }, backend: e, attrs: { shape: [a, s] } }); +function Qx(r16, e, t10) { + let o = t10.tensorMap.get(r16.dataId), n = y.sizeFromShape(r16.shape), s = r16.shape[r16.shape.length - 1], a = n / s, i = [], p = le({ inputs: { x: r16 }, backend: t10, attrs: { shape: [a, s] } }); i.push(p); - let u = p.shape, c = new gm("real", u), l = new gm("imag", u), m = [{ dataId: o.complexTensorInfos.real.dataId, dtype: o.complexTensorInfos.real.dtype, shape: u }, { dataId: o.complexTensorInfos.imag.dataId, dtype: o.complexTensorInfos.imag.dtype, shape: u }], d = t8 ? 2 * Math.PI : -2 * Math.PI, f = t8 ? u[1] : 1, h = [{ type: "float32", data: [d] }, { type: "float32", data: [f] }], g = e.runWebGPUProgram(c, m, "float32", h); + let u = p.shape, l = new _m("real", u), c = new _m("imag", u), m = [{ dataId: o.complexTensorInfos.real.dataId, dtype: o.complexTensorInfos.real.dtype, shape: u }, { dataId: o.complexTensorInfos.imag.dataId, dtype: o.complexTensorInfos.imag.dtype, shape: u }], d = e ? 2 * Math.PI : -2 * Math.PI, f = e ? u[1] : 1, h = [{ type: "float32", data: [d] }, { type: "float32", data: [f] }], g = t10.runWebGPUProgram(l, m, "float32", h); i.push(g); - let x = e.runWebGPUProgram(l, m, "float32", h); + let x = t10.runWebGPUProgram(c, m, "float32", h); i.push(x); - let b = xo({ inputs: { real: g, imag: x }, backend: e }); + let b = Uo({ inputs: { real: g, imag: x }, backend: t10 }); i.push(b); - let C = pe({ inputs: { x: b }, backend: e, attrs: { shape: r15.shape } }); - return i.forEach((S) => e.disposeData(S.dataId)), C; + let w = le({ inputs: { x: b }, backend: t10, attrs: { shape: r16.shape } }); + return i.forEach((S) => t10.disposeData(S.dataId)), w; } -function Que(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8; - return Mx(o, false, e); +function Fle(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e; + return Qx(o, false, t10); } -var tW = { kernelName: Bi, backendName: "webgpu", kernelFunc: Que }; -var Lx = class { - constructor(t8) { - this.outputShape = [], this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "flipLeftRight"; +var NU = { kernelName: Xi, backendName: "webgpu", kernelFunc: Fle }; +var Zx = class { + constructor(e) { + this.outputShape = [], this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "flipLeftRight"; } getUserCode() { return ` @@ -31422,27 +32564,27 @@ var Lx = class { `; } }; -var rW = { kernelName: Cn, backendName: "webgpu", kernelFunc: ({ inputs: r15, backend: t8 }) => { - let { image: e } = r15, o = t8, n = new Lx(e.shape); - return o.runWebGPUProgram(n, [e], e.dtype); +var TU = { kernelName: Gn, backendName: "webgpu", kernelFunc: ({ inputs: r16, backend: e }) => { + let { image: t10 } = r16, o = e, n = new Zx(t10.shape); + return o.runWebGPUProgram(n, [t10], t10.dtype); } }; -var Zue = ye({ opType: Z.FLOOR, cpuKernelImpl: dz }); -var oW = { kernelName: wn, backendName: "webgpu", kernelFunc: Zue }; -var Jue = et({ opType: fe.FLOOR_DIV, cpuKernelImpl: fz, dtype: "int32" }); -var nW = { kernelName: Sn, backendName: "webgpu", kernelFunc: Jue }; -var Bx = class { - constructor(t8, e, o = false) { - this.pixelsOpType = Ci.FROM_PIXELS, this.outputShape = [0], this.variableNames = [], this.workgroupSize = [256, 1, 1], this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [e, 1, 1]), this.importVideo = o, this.shaderKey = `fromPixels_${this.importVideo}`; +var Ple = ye({ opType: Z.FLOOR, cpuKernelImpl: LV }); +var _U = { kernelName: Co, backendName: "webgpu", kernelFunc: Ple }; +var Ole = tt({ opType: fe.FLOOR_DIV, cpuKernelImpl: BV, dtype: "int32" }); +var EU = { kernelName: wo, backendName: "webgpu", kernelFunc: Ole }; +var Jx = class { + constructor(e, t10, o = false) { + this.pixelsOpType = $i.FROM_PIXELS, this.outputShape = [0], this.variableNames = [], this.workgroupSize = [256, 1, 1], this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [t10, 1, 1]), this.importVideo = o, this.shaderKey = `fromPixels_${this.importVideo}`; } getUserCode() { - let t8 = this.importVideo ? "textureLoad(src, vec2(coords.yx));" : "textureLoad(src, vec2(coords.yx), 0)"; + let e = this.importVideo ? "textureLoad(src, vec2(coords.yx));" : "textureLoad(src, vec2(coords.yx), 0)"; return ` @binding(1) @group(0) var src: ${this.importVideo ? "texture_external" : "texture_2d"}; ${G("index")} { let flatIndex = index * uniforms.numChannels; if (flatIndex < uniforms.size) { let coords = getCoordsFromIndex(flatIndex); - let values = ${t8}; + let values = ${e}; for (var i = 0; i < uniforms.numChannels; i = i + 1) { result[flatIndex + i] = i32(floor(255.0 * values[i])); } @@ -31451,58 +32593,58 @@ var Bx = class { `; } }; -var sW = { kernelName: Eu, backendName: "webgpu", kernelFunc: epe }; -var Jc; -var u0 = A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU"); -function epe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { pixels: n } = t8, { numChannels: s } = o; +var $U = { kernelName: Lu, backendName: "webgpu", kernelFunc: Mle }; +var uc; +var jv = A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU"); +function Mle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { pixels: n } = e, { numChannels: s } = o; if (n == null) throw new Error("pixels passed to tf.browser.fromPixels() can not be null"); - let a = typeof HTMLVideoElement != "undefined" && n instanceof HTMLVideoElement, i = typeof HTMLImageElement != "undefined" && n instanceof HTMLImageElement, p = typeof HTMLCanvasElement != "undefined" && n instanceof HTMLCanvasElement || typeof OffscreenCanvas != "undefined" && n instanceof OffscreenCanvas, u = typeof ImageBitmap != "undefined" && n instanceof ImageBitmap, [c, l] = a ? [n.videoWidth, n.videoHeight] : [n.width, n.height], m = [l, c, s], d = A().getBool("WEBGPU_IMPORT_EXTERNAL_TEXTURE") && a, f = a || i; + let a = typeof HTMLVideoElement != "undefined" && n instanceof HTMLVideoElement, i = typeof HTMLImageElement != "undefined" && n instanceof HTMLImageElement, p = typeof HTMLCanvasElement != "undefined" && n instanceof HTMLCanvasElement || typeof OffscreenCanvas != "undefined" && n instanceof OffscreenCanvas, u = typeof ImageBitmap != "undefined" && n instanceof ImageBitmap, [l, c] = a ? [n.videoWidth, n.videoHeight] : [n.width, n.height], m = [c, l, s], d = A().getBool("WEBGPU_IMPORT_EXTERNAL_TEXTURE") && a, f = a || i; if (u || p || f) { let b; if (d) - b = e.device.importExternalTexture({ source: n }); + b = t10.device.importExternalTexture({ source: n }); else { if (f) { let L = A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU"); - (Jc == null || L !== u0) && (u0 = L, Jc = document.createElement("canvas").getContext("2d", { willReadFrequently: u0 })), Jc.canvas.width = c, Jc.canvas.height = l, Jc.drawImage(n, 0, 0, c, l), n = Jc.canvas; + (uc == null || L !== jv) && (jv = L, uc = document.createElement("canvas").getContext("2d", { willReadFrequently: jv })), uc.canvas.width = l, uc.canvas.height = c, uc.drawImage(n, 0, 0, l, c), n = uc.canvas; } - let P = GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, O = "rgba8unorm", M = e.textureManager.acquireTexture(m[1], m[0], O, P); - e.queue.copyExternalImageToTexture({ source: n }, { texture: M }, [m[1], m[0]]), b = M; + let F = GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, M = t10.textureManager.acquireTexture(m[1], m[0], "rgba8unorm", F); + t10.queue.copyExternalImageToTexture({ source: n }, { texture: M }, [m[1], m[0]]), b = M; } - let C = y.sizeFromShape(m), S = y.computeStrides(m), k = new Bx(m, s, d), _ = [{ type: "uint32", data: [C] }, { type: "uint32", data: [s] }, { type: "uint32", data: [...S] }], E = e.makeTensorInfo([l, c], "int32"), R = e.tensorMap.get(E.dataId); + let w = y.sizeFromShape(m), S = y.computeStrides(m), k = new Jx(m, s, d), T = [{ type: "uint32", data: [w] }, { type: "uint32", data: [s] }, { type: "uint32", data: [...S] }], E = t10.makeTensorInfo([c, l], "int32"), R = t10.tensorMap.get(E.dataId); R.resource = b; - let D = e.runWebGPUProgram(k, [E], "int32", _); - return e.disposeData(E.dataId), D; + let D = t10.runWebGPUProgram(k, [E], "int32", T); + return t10.disposeData(E.dataId), D; } let h = n.data, g = h; if (s != null && s !== 4) { g = new Uint8Array(n.width * n.height * s); - let b = h.length, C = 0; + let b = h.length, w = 0; for (let S = 0; S < b; S++) - S % 4 < s && (g[C++] = h[S]); + S % 4 < s && (g[w++] = h[S]); } - let x = e.makeTensorInfo(m, "int32", new Int32Array(g)); - return e.uploadToGPU(x.dataId), x; + let x = t10.makeTensorInfo(m, "int32", new Int32Array(g)); + return t10.uploadToGPU(x.dataId), x; } -var zx = class { - constructor(t8, e, o, n, s) { - this.uniforms = "varianceEpsilon : f32,", this.workgroupSize = [128, 1, 1], this.size = true, this.variableNames = ["x", "mean", "variance"], w.assertAndGetBroadcastShape(t8, e), w.assertAndGetBroadcastShape(t8, o), this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), n != null && (w.assertAndGetBroadcastShape(t8, n), this.variableNames.push("offset")), s != null && (w.assertAndGetBroadcastShape(t8, s), this.variableNames.push("scale")), this.offsetShape = n, this.scaleShape = s, this.shaderKey = "batchNorm"; +var ey = class { + constructor(e, t10, o, n, s) { + this.uniforms = "varianceEpsilon : f32,", this.workgroupSize = [128, 1, 1], this.size = true, this.variableNames = ["x", "mean", "variance"], C.assertAndGetBroadcastShape(e, t10), C.assertAndGetBroadcastShape(e, o), this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), n != null && (C.assertAndGetBroadcastShape(e, n), this.variableNames.push("offset")), s != null && (C.assertAndGetBroadcastShape(e, s), this.variableNames.push("scale")), this.offsetShape = n, this.scaleShape = s, this.shaderKey = "batchNorm"; } getUserCode() { - let t8 = "0.0"; - this.offsetShape != null && (t8 = "getOffsetByOutputIndex(index)"); - let e = "1.0"; - return this.scaleShape != null && (e = "getScaleByOutputIndex(index)"), ` + let e = "0.0"; + this.offsetShape != null && (e = "getOffsetByOutputIndex(index)"); + let t10 = "1.0"; + return this.scaleShape != null && (t10 = "getScaleByOutputIndex(index)"), ` ${G("index")} { if (index < uniforms.size) { let xValue = getXByOutputIndex(index); let meanValue = getMeanByOutputIndex(index); let varianValue = getVarianceByOutputIndex(index); - let offsetValue = ${t8}; - let scaleValue = ${e}; + let offsetValue = ${e}; + let scaleValue = ${t10}; let inv = scaleValue * inverseSqrt(varianValue + f32(uniforms.varianceEpsilon)); setOutputAtIndex(index,dot(vec3(xValue, -meanValue, offsetValue), vec3(inv, inv, 1.0))); } @@ -31510,42 +32652,42 @@ var zx = class { `; } }; -var aW = { kernelName: In, backendName: "webgpu", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { x: o, scale: n, offset: s, mean: a, variance: i } = r15, { varianceEpsilon: p } = t8, u = e, c = [o, a, i], l = null; - s != null && (l = s.shape, c.push(s)); +var RU = { kernelName: Hn, backendName: "webgpu", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { x: o, scale: n, offset: s, mean: a, variance: i } = r16, { varianceEpsilon: p } = e, u = t10, l = [o, a, i], c = null; + s != null && (c = s.shape, l.push(s)); let m = null; - n != null && (m = n.shape, c.push(n)); - let d = new zx(o.shape, a.shape, i.shape, l, m), f = [{ type: "float32", data: [p] }]; - return u.runWebGPUProgram(d, c, o.dtype, f); + n != null && (m = n.shape, l.push(n)); + let d = new ey(o.shape, a.shape, i.shape, c, m), f = [{ type: "float32", data: [p] }]; + return u.runWebGPUProgram(d, l, o.dtype, f); } }; -function tpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dataFormat: c, dilations: l, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = w.convertConv2DDataFormat(c), g = w.computeConv2DInfo(n.shape, s.shape, p, l, u, m, false, h); - return yx({ x: n, filter: s, convInfo: g, backend: e, bias: a, preluActivationWeights: i, leakyreluAlpha: f, activation: d }); -} -var iW = { kernelName: Io, backendName: "webgpu", kernelFunc: tpe }; -function rpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, filter: s, bias: a, preluActivationWeights: i } = t8, { strides: p, pad: u, dilations: c, dimRoundingMode: l, activation: m, leakyreluAlpha: d } = o, f = c; - f == null && (f = [1, 1]), y.assert(w.eitherStridesOrDilationsAreOne(p, f), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${f}'`); - let h = w.computeConv2DInfo(n.shape, s.shape, p, f, u, l, true), g = [n, s], x = a != null, b = i != null; +function Lle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dataFormat: l, dilations: c, dimRoundingMode: m, activation: d, leakyreluAlpha: f } = o, h = C.convertConv2DDataFormat(l), g = C.computeConv2DInfo(n.shape, s.shape, p, c, u, m, false, h); + return Dx({ x: n, filter: s, convInfo: g, backend: t10, bias: a, preluActivationWeights: i, leakyreluAlpha: f, activation: d }); +} +var DU = { kernelName: jo, backendName: "webgpu", kernelFunc: Lle }; +function Ble(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, filter: s, bias: a, preluActivationWeights: i } = e, { strides: p, pad: u, dilations: l, dimRoundingMode: c, activation: m, leakyreluAlpha: d } = o, f = l; + f == null && (f = [1, 1]), y.assert(C.eitherStridesOrDilationsAreOne(p, f), () => `Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${f}'`); + let h = C.computeConv2DInfo(n.shape, s.shape, p, f, u, c, true), g = [n, s], x = a != null, b = i != null; x && g.push(a), b && g.push(i); - let C = [{ type: "int32", data: [h.padInfo.top, h.padInfo.left] }, { type: "int32", data: [h.inHeight, h.inWidth] }], S; - return h.outHeight > 4 && h.outWidth > 4 && h.strideWidth <= 2 && h.inChannels === h.outChannels && h.dilationHeight === 1 && h.dilationWidth === 1 && h.inChannels % 4 === 0 ? (S = new Qc(h, x, m, b), C.push({ type: "int32", data: [S.virtualWidth] })) : (S = new Zc(h, x, m, b), C.push({ type: "int32", data: [h.filterHeight] }, { type: "int32", data: [h.filterWidth] }, { type: "int32", data: [h.strideHeight, h.strideWidth] }, { type: "int32", data: [h.dilationHeight, h.dilationWidth] })), m === "leakyrelu" && (C.push({ type: "float32", data: [d] }), S.uniforms += " alpha : f32,"), e.runWebGPUProgram(S, g, "float32", C); + let w = [{ type: "int32", data: [h.padInfo.top, h.padInfo.left] }, { type: "int32", data: [h.inHeight, h.inWidth] }], S; + return h.outHeight > 4 && h.outWidth > 4 && h.strideWidth <= 2 && h.inChannels === h.outChannels && h.dilationHeight === 1 && h.dilationWidth === 1 && h.inChannels % 4 === 0 ? (S = new ac(h, x, m, b), w.push({ type: "int32", data: [S.virtualWidth] })) : (S = new ic(h, x, m, b), w.push({ type: "int32", data: [h.filterHeight] }, { type: "int32", data: [h.filterWidth] }, { type: "int32", data: [h.strideHeight, h.strideWidth] }, { type: "int32", data: [h.dilationHeight, h.dilationWidth] })), m === "leakyrelu" && (w.push({ type: "float32", data: [d] }), S.uniforms += " alpha : f32,"), t10.runWebGPUProgram(S, g, "float32", w); } -var uW = { kernelName: vo, backendName: "webgpu", kernelFunc: rpe }; -var Vx = class { - constructor(t8, e) { - this.variableNames = ["A", "indices"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = `gathernd_${t8}`, this.sliceDim = t8, this.uniforms = `sliceDim : i32, strides : ${ft(t8)},`; +var AU = { kernelName: Xo, backendName: "webgpu", kernelFunc: Ble }; +var ty = class { + constructor(e, t10) { + this.variableNames = ["A", "indices"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t10, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = `gathernd_${e}`, this.sliceDim = e, this.uniforms = `sliceDim : i32, strides : ${ft(e)},`; } getUserCode() { - let t8; - return this.sliceDim > 1 ? t8 = "uniforms.strides[j]" : t8 = "uniforms.strides", ` + let e; + return this.sliceDim > 1 ? e = "uniforms.strides[j]" : e = "uniforms.strides", ` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); var flattenIndex = 0; for (var j = 0; j < uniforms.sliceDim; j = j + 1) { let indexTemp = i32(round(getIndices(coords[0], j))); - let strideNum = ${t8}; + let strideNum = ${e}; flattenIndex = flattenIndex + indexTemp * strideNum; } @@ -31555,81 +32697,81 @@ var Vx = class { `; } }; -function ope(r15) { - let { inputs: t8, backend: e } = r15, { params: o, indices: n } = t8, s = n.shape, a = s[s.length - 1], i = y.sizeFromShape(o.shape), [p, u, c, l] = w.prepareAndValidate(o, n), m = pe({ inputs: { x: n }, backend: e, attrs: { shape: [u, a] } }), d = pe({ inputs: { x: o }, backend: e, attrs: { shape: [y.sizeFromShape(o.shape) / c, c] } }); - if (e.shouldExecuteOnCPU([o, n]) || o.dtype === "string") { - let b = e.readSync(n.dataId), C = e.bufferSync(o), S = hz(b, C, o.dtype, u, a, c, l, o.shape, i); - return e.makeTensorInfo(p, o.dtype, S.values); +function zle(r16) { + let { inputs: e, backend: t10 } = r16, { params: o, indices: n } = e, s = n.shape, a = s[s.length - 1], i = y.sizeFromShape(o.shape), [p, u, l, c] = C.prepareAndValidate(o, n), m = le({ inputs: { x: n }, backend: t10, attrs: { shape: [u, a] } }), d = le({ inputs: { x: o }, backend: t10, attrs: { shape: [y.sizeFromShape(o.shape) / l, l] } }); + if (t10.shouldExecuteOnCPU([o, n]) || o.dtype === "string") { + let b = t10.readSync(n.dataId), w = t10.bufferSync(o), S = zV(b, w, o.dtype, u, a, l, c, o.shape, i); + return t10.makeTensorInfo(p, o.dtype, S.values); } - let f = new Vx(a, [u, c]), h = [{ type: "int32", data: [a] }, { type: "int32", data: l }], g = e.runWebGPUProgram(f, [d, m], d.dtype, h), x = pe({ inputs: { x: g }, backend: e, attrs: { shape: p } }); - return e.disposeData(m.dataId), e.disposeData(d.dataId), e.disposeData(g.dataId), x; + let f = new ty(a, [u, l]), h = [{ type: "int32", data: [a] }, { type: "int32", data: c }], g = t10.runWebGPUProgram(f, [d, m], d.dtype, h), x = le({ inputs: { x: g }, backend: t10, attrs: { shape: p } }); + return t10.disposeData(m.dataId), t10.disposeData(d.dataId), t10.disposeData(g.dataId), x; } -var pW = { kernelName: vn, backendName: "webgpu", kernelFunc: ope }; -var Wx = class { - constructor(t8, e) { - this.variableNames = ["A", "indices"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.slice(), this.aShape = t8, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "gather"; +var FU = { kernelName: Kn, backendName: "webgpu", kernelFunc: zle }; +var ry = class { + constructor(e, t10) { + this.variableNames = ["A", "indices"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.slice(), this.aShape = e, this.outputShape = t10, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "gather"; } getUserCode() { - let t8 = npe(this.aShape); + let e = Vle(this.aShape); return ` ${G("index")} { if (index < uniforms.size) { let resRC = getCoordsFromIndex(index); let indexZ = i32(getIndices(resRC.x, resRC.z)); let inBounds = select(0.0, 1.0, indexZ >= 0 && indexZ < uniforms.aShape[2]); - setOutputAtIndex(index, inBounds * getA(${t8})); + setOutputAtIndex(index, inBounds * getA(${e})); } } `; } }; -function npe(r15) { - let t8 = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], e = []; - for (let o = 0; o < r15.length; o++) - o === 2 ? e.push("indexZ") : e.push(`${t8[o]}`); - return e.join(); -} -function p0(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, indices: s } = t8, { axis: a, batchDims: i } = o, p = y.parseAxisParam(a, n.shape)[0], u = w.segment_util.collectGatherOpShapeInfo(n, s, p, i), c = y.sizeFromShape(s.shape), l = [], m = pe({ inputs: { x: n }, backend: e, attrs: { shape: [u.batchSize, u.outerSize, u.dimSize, u.sliceSize] } }), d = pe({ inputs: { x: s }, backend: e, attrs: { shape: [u.batchSize, c / u.batchSize] } }); - l.push(m), l.push(d); - let f = [u.batchSize, u.outerSize, c / u.batchSize, u.sliceSize]; - if (e.shouldExecuteOnCPU([n, s])) { - let C = e.tensorMap.get(d.dataId).values, S = me(d.shape, d.dtype, C), _ = e.tensorMap.get(m.dataId).values, E = me(m.shape, m.dtype, _), R = gz(E, S, f); - return l.forEach((D) => e.disposeData(D.dataId)), e.makeTensorInfo(u.outputShape, R.dtype, R.values); - } - let h = new Wx(m.shape, f), g = e.runWebGPUProgram(h, [m, d], m.dtype); - l.push(g); - let x = pe({ inputs: { x: g }, backend: e, attrs: { shape: u.outputShape } }); - return l.forEach((b) => e.disposeData(b.dataId)), x; -} -var cW = { kernelName: aa, backendName: "webgpu", kernelFunc: p0 }; -var spe = et({ opType: fe.GREATER, cpuKernelImpl: yz, dtype: "bool" }); -var lW = { kernelName: kn, backendName: "webgpu", kernelFunc: spe }; -var ape = et({ opType: fe.GREATER_EQUAL, dtype: "bool", cpuKernelImpl: xz }); -var mW = { kernelName: Nn, backendName: "webgpu", kernelFunc: ape }; -function ipe(r15) { - let { inputs: t8, backend: e } = r15, { input: o } = t8; - return Mx(o, true, e); -} -var dW = { kernelName: zi, backendName: "webgpu", kernelFunc: ipe }; -var upe = ye({ opType: Z.IS_FINITE, dtype: "bool" }); -var fW = { kernelName: Tn, backendName: "webgpu", kernelFunc: upe }; -var ppe = ye({ opType: Z.IS_INF, dtype: "bool" }); -var hW = { kernelName: _n, backendName: "webgpu", kernelFunc: ppe }; -var cpe = ye({ opType: Z.IS_NAN, dtype: "bool" }); -var gW = { kernelName: $n, backendName: "webgpu", kernelFunc: cpe }; -function lpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { alpha: s } = o, a = [{ type: "float32", data: [s] }], i = new Zr(n.shape, Z.LEAKYRELU, "alpha : f32,"); - return e.runWebGPUProgram(i, [n], "float32", a); -} -var xW = { kernelName: En, backendName: "webgpu", kernelFunc: lpe }; -var mpe = et({ opType: fe.LESS, dtype: "bool", cpuKernelImpl: Cz }); -var yW = { kernelName: Rn, backendName: "webgpu", kernelFunc: mpe }; -var dpe = et({ opType: fe.LESS_EQUAL, dtype: "bool", cpuKernelImpl: bz }); -var bW = { kernelName: Dn, backendName: "webgpu", kernelFunc: dpe }; -var Ux = class { - constructor(t8) { - this.variableNames = [], this.outputShape = [], this.uniforms = "start : f32, step : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [t8], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "linSpace"; +function Vle(r16) { + let e = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], t10 = []; + for (let o = 0; o < r16.length; o++) + o === 2 ? t10.push("indexZ") : t10.push(`${e[o]}`); + return t10.join(); +} +function Xv(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, indices: s } = e, { axis: a, batchDims: i } = o, p = y.parseAxisParam(a, n.shape)[0], u = C.segment_util.collectGatherOpShapeInfo(n, s, p, i), l = y.sizeFromShape(s.shape), c = [], m = le({ inputs: { x: n }, backend: t10, attrs: { shape: [u.batchSize, u.outerSize, u.dimSize, u.sliceSize] } }), d = le({ inputs: { x: s }, backend: t10, attrs: { shape: [u.batchSize, l / u.batchSize] } }); + c.push(m), c.push(d); + let f = [u.batchSize, u.outerSize, l / u.batchSize, u.sliceSize]; + if (t10.shouldExecuteOnCPU([n, s])) { + let w = t10.tensorMap.get(d.dataId).values, S = ie(d.shape, d.dtype, w), T = t10.tensorMap.get(m.dataId).values, E = ie(m.shape, m.dtype, T), R = VV(E, S, f); + return c.forEach((D) => t10.disposeData(D.dataId)), t10.makeTensorInfo(u.outputShape, R.dtype, R.values); + } + let h = new ry(m.shape, f), g = t10.runWebGPUProgram(h, [m, d], m.dtype); + c.push(g); + let x = le({ inputs: { x: g }, backend: t10, attrs: { shape: u.outputShape } }); + return c.forEach((b) => t10.disposeData(b.dataId)), x; +} +var PU = { kernelName: fa, backendName: "webgpu", kernelFunc: Xv }; +var Wle = tt({ opType: fe.GREATER, cpuKernelImpl: UV, dtype: "bool" }); +var OU = { kernelName: So, backendName: "webgpu", kernelFunc: Wle }; +var Ule = tt({ opType: fe.GREATER_EQUAL, dtype: "bool", cpuKernelImpl: WV }); +var MU = { kernelName: Io, backendName: "webgpu", kernelFunc: Ule }; +function Gle(r16) { + let { inputs: e, backend: t10 } = r16, { input: o } = e; + return Qx(o, true, t10); +} +var LU = { kernelName: Yi, backendName: "webgpu", kernelFunc: Gle }; +var Hle = ye({ opType: Z.IS_FINITE, dtype: "bool" }); +var BU = { kernelName: qn, backendName: "webgpu", kernelFunc: Hle }; +var Kle = ye({ opType: Z.IS_INF, dtype: "bool" }); +var zU = { kernelName: jn, backendName: "webgpu", kernelFunc: Kle }; +var qle = ye({ opType: Z.IS_NAN, dtype: "bool" }); +var VU = { kernelName: Xn, backendName: "webgpu", kernelFunc: qle }; +function jle(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { alpha: s } = o, a = [{ type: "float32", data: [s] }], i = new so(n.shape, Z.LEAKYRELU, "alpha : f32,"); + return t10.runWebGPUProgram(i, [n], "float32", a); +} +var WU = { kernelName: Yn, backendName: "webgpu", kernelFunc: jle }; +var Xle = tt({ opType: fe.LESS, dtype: "bool", cpuKernelImpl: HV }); +var UU = { kernelName: ko, backendName: "webgpu", kernelFunc: Xle }; +var Yle = tt({ opType: fe.LESS_EQUAL, dtype: "bool", cpuKernelImpl: GV }); +var GU = { kernelName: No, backendName: "webgpu", kernelFunc: Yle }; +var oy = class { + constructor(e) { + this.variableNames = [], this.outputShape = [], this.uniforms = "start : f32, step : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [e], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "linSpace"; } getUserCode() { return ` @@ -31641,22 +32783,22 @@ var Ux = class { `; } }; -function fpe(r15) { - let { backend: t8, attrs: e } = r15, { start: o, stop: n, num: s } = e, a = (n - o) / (s - 1), i = new Ux(s), p = [{ type: "float32", data: [o] }, { type: "float32", data: [a] }]; - return t8.runWebGPUProgram(i, [], "float32", p); -} -var CW = { kernelName: An, backendName: "webgpu", kernelFunc: fpe }; -var hpe = ye({ opType: Z.LOG, cpuKernelImpl: wz }); -var wW = { kernelName: Fn, backendName: "webgpu", kernelFunc: hpe }; -var gpe = ye({ opType: Z.LOG1P }); -var SW = { kernelName: Pn, backendName: "webgpu", kernelFunc: gpe }; -var xpe = et({ opType: fe.LOGICAL_AND, dtype: "bool" }); -var IW = { kernelName: On, backendName: "webgpu", kernelFunc: xpe }; -var ype = ye({ opType: Z.LOGICAL_NOT }); -var vW = { kernelName: Mn, backendName: "webgpu", kernelFunc: ype }; -var bpe = et({ opType: fe.LOGICAL_OR }); -var kW = { kernelName: Ln, backendName: "webgpu", kernelFunc: bpe }; -var NW = ` +function Qle(r16) { + let { backend: e, attrs: t10 } = r16, { start: o, stop: n, num: s } = t10, a = (n - o) / (s - 1), i = new oy(s), p = [{ type: "float32", data: [o] }, { type: "float32", data: [a] }]; + return e.runWebGPUProgram(i, [], "float32", p); +} +var HU = { kernelName: Qn, backendName: "webgpu", kernelFunc: Qle }; +var Zle = ye({ opType: Z.LOG, cpuKernelImpl: KV }); +var KU = { kernelName: To, backendName: "webgpu", kernelFunc: Zle }; +var Jle = ye({ opType: Z.LOG1P }); +var qU = { kernelName: Zn, backendName: "webgpu", kernelFunc: Jle }; +var ece = tt({ opType: fe.LOGICAL_AND, dtype: "bool" }); +var jU = { kernelName: Jn, backendName: "webgpu", kernelFunc: ece }; +var tce = ye({ opType: Z.LOGICAL_NOT }); +var XU = { kernelName: es, backendName: "webgpu", kernelFunc: tce }; +var rce = tt({ opType: fe.LOGICAL_OR }); +var YU = { kernelName: ts, backendName: "webgpu", kernelFunc: rce }; +var QU = ` var powValue = 0.0; let basis = uniforms.bias + uniforms.alpha * sum; if (uniforms.beta == 0.5) { @@ -31667,9 +32809,9 @@ var NW = ` powValue = exp(log(basis) * (-uniforms.beta)); } `; -var Gx = class { - constructor(t8) { - this.outputShape = [], this.variableNames = ["x"], this.uniforms = "radius : i32, bias : f32, alpha : f32, beta : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "lrn"; +var ny = class { + constructor(e) { + this.outputShape = [], this.variableNames = ["x"], this.uniforms = "radius : i32, bias : f32, alpha : f32, beta : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "lrn"; } getUserCode() { return ` @@ -31690,7 +32832,7 @@ var Gx = class { sum = sum + z * z; } } - ${NW} + ${QU} setOutputAtIndex(index, x * powValue); } @@ -31698,9 +32840,9 @@ var Gx = class { `; } }; -var Hx = class { - constructor(t8, e) { - this.outputShape = [], this.variableNames = ["x"], this.uniforms = "radius : i32, bias : f32, alpha : f32, beta : f32,", this.workgroupSize = [256, 1, 1], this.maxAllowRadius = 16, y.assert(e <= this.maxAllowRadius, () => `Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${e}`), this.outputShape = t8, this.elementsPerWorkgroup = this.workgroupSize[0] - 2 * this.maxAllowRadius, this.dispatchLayout = { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, [this.elementsPerWorkgroup, this.workgroupSize[1], this.workgroupSize[2]]), this.shaderKey = "lrn_shared"; +var sy = class { + constructor(e, t10) { + this.outputShape = [], this.variableNames = ["x"], this.uniforms = "radius : i32, bias : f32, alpha : f32, beta : f32,", this.workgroupSize = [256, 1, 1], this.maxAllowRadius = 16, y.assert(t10 <= this.maxAllowRadius, () => `Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${t10}`), this.outputShape = e, this.elementsPerWorkgroup = this.workgroupSize[0] - 2 * this.maxAllowRadius, this.dispatchLayout = { x: [3], y: [2], z: [0, 1] }, this.dispatch = H(this.dispatchLayout, this.outputShape, [this.elementsPerWorkgroup, this.workgroupSize[1], this.workgroupSize[2]]), this.shaderKey = "lrn_shared"; } getUserCode() { return ` @@ -31731,23 +32873,23 @@ var Hx = class { let z = lrnSub[index + i]; sum = sum + z * z; } - ${NW} + ${QU} setOutputAtCoords(b, r, c, d, lrnSub[index] * powValue); } } `; } }; -function Cpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { depthRadius: s, bias: a, alpha: i, beta: p } = o, u; - s > 16 ? u = new Gx(n.shape) : u = new Hx(n.shape, s); - let c = [{ type: "int32", data: [s] }, { type: "float32", data: [a] }, { type: "float32", data: [i] }, { type: "float32", data: [p] }]; - return e.runWebGPUProgram(u, [n], n.dtype, c); +function oce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { depthRadius: s, bias: a, alpha: i, beta: p } = o, u; + s > 16 ? u = new ny(n.shape) : u = new sy(n.shape, s); + let l = [{ type: "int32", data: [s] }, { type: "float32", data: [a] }, { type: "float32", data: [i] }, { type: "float32", data: [p] }]; + return t10.runWebGPUProgram(u, [n], n.dtype, l); } -var TW = { kernelName: Bn, backendName: "webgpu", kernelFunc: Cpe }; -var Kx = class { - constructor(t8) { - this.outputShape = [], this.variableNames = ["inputImage", "outputImage", "dy"], this.uniforms = "depthRadius : i32, bias : f32, alpha : f32, beta : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "lrn_grad"; +var ZU = { kernelName: rs, backendName: "webgpu", kernelFunc: oce }; +var ay = class { + constructor(e) { + this.outputShape = [], this.variableNames = ["inputImage", "outputImage", "dy"], this.uniforms = "depthRadius : i32, bias : f32, alpha : f32, beta : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "lrn_grad"; } getUserCode() { return ` @@ -31803,27 +32945,27 @@ var Kx = class { `; } }; -function wpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, y: s, dy: a } = t8, { depthRadius: i, bias: p, alpha: u, beta: c } = o, l = new Kx(n.shape), m = [{ type: "int32", data: [i] }, { type: "float32", data: [p] }, { type: "float32", data: [u] }, { type: "float32", data: [c] }]; - return e.runWebGPUProgram(l, [n, s, a], n.dtype, m); +function nce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, y: s, dy: a } = e, { depthRadius: i, bias: p, alpha: u, beta: l } = o, c = new ay(n.shape), m = [{ type: "int32", data: [i] }, { type: "float32", data: [p] }, { type: "float32", data: [u] }, { type: "float32", data: [l] }]; + return t10.runWebGPUProgram(c, [n, s, a], n.dtype, m); } -var _W = { kernelName: Ya, backendName: "webgpu", kernelFunc: wpe }; -var Spe = et({ opType: fe.MAX, cpuKernelImpl: Iz }); -var $W = { kernelName: Vn, backendName: "webgpu", kernelFunc: Spe }; -function Ipe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, u = 1, c = w.computePool2DInfo(n.shape, s, a, u, i, p); - return sx(n, c, "max", e); +var JU = { kernelName: oi, backendName: "webgpu", kernelFunc: nce }; +var sce = tt({ opType: fe.MAX, cpuKernelImpl: jV }); +var eG = { kernelName: _o, backendName: "webgpu", kernelFunc: sce }; +function ace(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dimRoundingMode: p } = o, l = C.computePool2DInfo(n.shape, s, a, 1, i, p); + return bx(n, l, "max", t10); } -var EW = { kernelName: Wn, backendName: "webgpu", kernelFunc: Ipe }; -function vpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { filterSize: s, strides: a, pad: i, dataFormat: p, dimRoundingMode: u } = o, c = [1, 1, 1], l = w.computePool3DInfo(n.shape, s, a, c, i, u, p), m = new wu(l, "max"), d = [{ type: "int32", data: [l.strideDepth, l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.padInfo.front, l.padInfo.top, l.padInfo.left] }, { type: "int32", data: [l.inDepth, l.inHeight, l.inWidth] }, { type: "int32", data: [l.effectiveFilterDepth, l.effectiveFilterHeight, l.effectiveFilterWidth] }]; - return e.runWebGPUProgram(m, [n], n.dtype, d); +var tG = { kernelName: ns, backendName: "webgpu", kernelFunc: ace }; +function ice(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { filterSize: s, strides: a, pad: i, dataFormat: p, dimRoundingMode: u } = o, l = [1, 1, 1], c = C.computePool3DInfo(n.shape, s, a, l, i, u, p), m = new $u(c, "max"), d = [{ type: "int32", data: [c.strideDepth, c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.padInfo.front, c.padInfo.top, c.padInfo.left] }, { type: "int32", data: [c.inDepth, c.inHeight, c.inWidth] }, { type: "int32", data: [c.effectiveFilterDepth, c.effectiveFilterHeight, c.effectiveFilterWidth] }]; + return t10.runWebGPUProgram(m, [n], n.dtype, d); } -var RW = { kernelName: ia, backendName: "webgpu", kernelFunc: vpe }; -var qx = class { - constructor(t8) { +var rG = { kernelName: ha, backendName: "webgpu", kernelFunc: ice }; +var iy = class { + constructor(e) { this.variableNames = ["dy", "maxPos"], this.uniforms = `strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, - outHeight : i32, outWidth : i32`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "maxPool2DBackprop"; + outHeight : i32, outWidth : i32`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "maxPool2DBackprop"; } getUserCode() { return ` @@ -31873,10 +33015,10 @@ var qx = class { `; } }; -var jx = class { - constructor(t8) { +var uy = class { + constructor(e) { this.variableNames = ["dy", "maxPos"], this.uniforms = `strides : vec3, pads : vec3, filterDims : vec3, - outDepth : i32, outHeight : i32, outWidth : i32`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "maxPool3DBackprop"; + outDepth : i32, outHeight : i32, outWidth : i32`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.inShape, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "maxPool3DBackprop"; } getUserCode() { return ` @@ -31939,55 +33081,55 @@ var jx = class { `; } }; -function kpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s } = t8, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: c } = o, l = [1, 1, 1], m = w.computePool3DInfo(a.shape, i, p, l, u, c), d = new wu(m, "max", true), f = [{ type: "int32", data: [m.strideDepth, m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.padInfo.front, m.padInfo.top, m.padInfo.left] }, { type: "int32", data: [m.inDepth, m.inHeight, m.inWidth] }, { type: "int32", data: [m.effectiveFilterDepth, m.effectiveFilterHeight, m.effectiveFilterWidth] }], h = e.runWebGPUProgram(d, [a], "int32", f), g = new jx(m); +function uce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s } = e, a = s, { filterSize: i, strides: p, pad: u, dimRoundingMode: l } = o, c = [1, 1, 1], m = C.computePool3DInfo(a.shape, i, p, c, u, l), d = new $u(m, "max", true), f = [{ type: "int32", data: [m.strideDepth, m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.padInfo.front, m.padInfo.top, m.padInfo.left] }, { type: "int32", data: [m.inDepth, m.inHeight, m.inWidth] }, { type: "int32", data: [m.effectiveFilterDepth, m.effectiveFilterHeight, m.effectiveFilterWidth] }], h = t10.runWebGPUProgram(d, [a], "int32", f), g = new uy(m); f = [{ type: "int32", data: [m.strideDepth, m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.effectiveFilterDepth - 1 - m.padInfo.front, m.effectiveFilterHeight - 1 - m.padInfo.top, m.effectiveFilterWidth - 1 - m.padInfo.left] }, { type: "int32", data: [m.effectiveFilterDepth, m.effectiveFilterHeight, m.effectiveFilterWidth] }, { type: "int32", data: [m.outDepth] }, { type: "int32", data: [m.outHeight] }, { type: "int32", data: [m.outWidth] }]; - let x = e.runWebGPUProgram(g, [n, h], a.dtype, f); - return e.disposeData(h.dataId), x; -} -var DW = { kernelName: Ui, backendName: "webgpu", kernelFunc: kpe }; -function Npe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { dy: n, input: s, output: a } = t8, i = s; - mm([s, a], "maxPoolGrad"); - let { filterSize: p, strides: u, pad: c, dimRoundingMode: l } = o, m = w.computePool2DInfo(i.shape, p, u, 1, c, l), d = new Ba(m, "max", true), f = [{ type: "int32", data: [m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.padInfo.top, m.padInfo.left] }, { type: "int32", data: [m.dilationHeight, m.dilationWidth] }, { type: "int32", data: [m.inHeight, m.inWidth] }, { type: "int32", data: [m.effectiveFilterHeight, m.effectiveFilterWidth] }], h = e.runWebGPUProgram(d, [i], "int32", f), g = new qx(m); + let x = t10.runWebGPUProgram(g, [n, h], a.dtype, f); + return t10.disposeData(h.dataId), x; +} +var oG = { kernelName: Ji, backendName: "webgpu", kernelFunc: uce }; +function pce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { dy: n, input: s, output: a } = e, i = s; + wm([s, a], "maxPoolGrad"); + let { filterSize: p, strides: u, pad: l, dimRoundingMode: c } = o, m = C.computePool2DInfo(i.shape, p, u, 1, l, c), d = new Ka(m, "max", true), f = [{ type: "int32", data: [m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.padInfo.top, m.padInfo.left] }, { type: "int32", data: [m.dilationHeight, m.dilationWidth] }, { type: "int32", data: [m.inHeight, m.inWidth] }, { type: "int32", data: [m.effectiveFilterHeight, m.effectiveFilterWidth] }], h = t10.runWebGPUProgram(d, [i], "int32", f), g = new iy(m); f = [{ type: "int32", data: [m.strideHeight, m.strideWidth] }, { type: "int32", data: [m.effectiveFilterHeight - 1 - m.padInfo.top, m.effectiveFilterWidth - 1 - m.padInfo.left] }, { type: "int32", data: [m.dilationHeight, m.dilationWidth] }, { type: "int32", data: [m.effectiveFilterHeight, m.effectiveFilterWidth] }, { type: "int32", data: [m.outHeight] }, { type: "int32", data: [m.outWidth] }]; - let x = e.runWebGPUProgram(g, [n, h], i.dtype, f); - return e.disposeData(h.dataId), x; + let x = t10.runWebGPUProgram(g, [n, h], i.dtype, f); + return t10.disposeData(h.dataId), x; } -var AW = { kernelName: Wi, backendName: "webgpu", kernelFunc: Npe }; -function Tpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { filterSize: n, strides: s, pad: a, includeBatchInIndex: i } = o, { x: p } = t8; +var nG = { kernelName: Zi, backendName: "webgpu", kernelFunc: pce }; +function lce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { filterSize: n, strides: s, pad: a, includeBatchInIndex: i } = o, { x: p } = e; y.assert(p.shape.length === 4, () => `Error in maxPool: input must be rank 4 but got rank ${p.shape.length}.`); let u = [1, 1]; - y.assert(w.eitherStridesOrDilationsAreOne(s, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`); - let c = w.computePool2DInfo(p.shape, n, s, u, a), l = [{ type: "int32", data: [c.strideHeight, c.strideWidth] }, { type: "int32", data: [c.padInfo.top, c.padInfo.left] }, { type: "int32", data: [c.dilationHeight, c.dilationWidth] }, { type: "int32", data: [c.inHeight, c.inWidth] }, { type: "int32", data: [c.effectiveFilterHeight, c.effectiveFilterWidth] }], m = new Ba(c, "max", false), d = e.runWebGPUProgram(m, [p], p.dtype, l); - m = new Ba(c, "max", true, true, i); - let f = e.runWebGPUProgram(m, [p], "int32", l); + y.assert(C.eitherStridesOrDilationsAreOne(s, u), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`); + let l = C.computePool2DInfo(p.shape, n, s, u, a), c = [{ type: "int32", data: [l.strideHeight, l.strideWidth] }, { type: "int32", data: [l.padInfo.top, l.padInfo.left] }, { type: "int32", data: [l.dilationHeight, l.dilationWidth] }, { type: "int32", data: [l.inHeight, l.inWidth] }, { type: "int32", data: [l.effectiveFilterHeight, l.effectiveFilterWidth] }], m = new Ka(l, "max", false), d = t10.runWebGPUProgram(m, [p], p.dtype, c); + m = new Ka(l, "max", true, true, i); + let f = t10.runWebGPUProgram(m, [p], "int32", c); return [d, f]; } -var FW = { kernelName: ua, backendName: "webgpu", kernelFunc: Tpe }; -function _pe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; - return Jr(n, s, a, "min", e); +var sG = { kernelName: ga, backendName: "webgpu", kernelFunc: lce }; +function cce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; + return ao(n, s, a, "min", t10); } -var PW = { kernelName: Gn, backendName: "webgpu", kernelFunc: _pe }; -var $pe = et({ opType: fe.MIN, cpuKernelImpl: vz }); -var OW = { kernelName: Hn, backendName: "webgpu", kernelFunc: $pe }; -var Xx = class { - constructor(t8, e, o) { - this.uniforms = "", this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.map((n, s) => n[0] + t8[s] + n[1]), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.xShape = t8, e.map((n, s) => { +var aG = { kernelName: as, backendName: "webgpu", kernelFunc: cce }; +var mce = tt({ opType: fe.MIN, cpuKernelImpl: XV }); +var iG = { kernelName: Eo, backendName: "webgpu", kernelFunc: mce }; +var py = class { + constructor(e, t10, o) { + this.uniforms = "", this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t10.map((n, s) => n[0] + e[s] + n[1]), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.xShape = e, t10.map((n, s) => { this.uniforms += ` pad${s} : vec2,`; }), this.offset = o === "reflect" ? 0 : 1, this.shaderKey = `mirrorPad_${o}`; } getUserCode() { - let t8 = this.xShape.length, e = this.xShape.map((u, c) => `uniforms.pad${c}[0]`).join(","), o = this.xShape.map((u, c) => `uniforms.pad${c}[0] + uniforms.xShape${t8 > 1 ? `[${c}]` : ""}`).join(","), n = t8 === 1 ? "start" : "start[i]", s = t8 === 1 ? "end" : "end[i]", a = t8 === 1 ? "outC" : "outC[i]", i = ft(t8), p = t8 > 1 ? ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, t8) : "coords"; + let e = this.xShape.length, t10 = this.xShape.map((u, l) => `uniforms.pad${l}[0]`).join(","), o = this.xShape.map((u, l) => `uniforms.pad${l}[0] + uniforms.xShape${e > 1 ? `[${l}]` : ""}`).join(","), n = e === 1 ? "start" : "start[i]", s = e === 1 ? "end" : "end[i]", a = e === 1 ? "outC" : "outC[i]", i = ft(e), p = e > 1 ? ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, e) : "coords"; return ` ${G("index")} { if (index < uniforms.size) { - let start = ${i}(${e}); + let start = ${i}(${t10}); let end = ${i}(${o}); var outC = getCoordsFromIndex(index); - for (var i = 0; i < ${t8}; i = i + 1) { + for (var i = 0; i < ${e}; i = i + 1) { if (${a} < ${n}) { ${a} = ${n} * 2 - ${a} - ${this.offset}; } else if(${a} >= ${s}) { @@ -32001,15 +33143,15 @@ var Xx = class { `; } }; -var MW = { kernelName: Kn, backendName: "webgpu", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { x: o } = r15, { paddings: n, mode: s } = t8, a = e, i = n.map((c) => ({ type: "int32", data: [c[0], c[1]] })), p = new Xx(o.shape, n, s); +var uG = { kernelName: is, backendName: "webgpu", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { x: o } = r16, { paddings: n, mode: s } = e, a = t10, i = n.map((l) => ({ type: "int32", data: [l[0], l[1]] })), p = new py(o.shape, n, s); return a.runWebGPUProgram(p, [o], o.dtype, i); } }; -var Epe = et({ opType: fe.MOD }); -var LW = { kernelName: qn, backendName: "webgpu", kernelFunc: Epe }; -var Yx = class { - constructor(t8, e) { - this.variableNames = ["probs"], this.outputShape = [], this.uniforms = "seed : f32, numOutcomes: i32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [t8, e], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "multinomial"; +var dce = tt({ opType: fe.MOD }); +var pG = { kernelName: us, backendName: "webgpu", kernelFunc: dce }; +var ly = class { + constructor(e, t10) { + this.variableNames = ["probs"], this.outputShape = [], this.uniforms = "seed : f32, numOutcomes: i32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [e, t10], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "multinomial"; } getUserCode() { return ` @@ -32048,9 +33190,9 @@ var Yx = class { `; } }; -var Qx = class { - constructor(t8) { - this.variableNames = ["logits"], this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = [this.outputShape[0], 1, 1], this.outputShape[1] >= 4096 ? this.workgroupSize = [256, 1, 1] : this.workgroupSize = [64, 1, 1], this.shaderKey = "softmax"; +var cy = class { + constructor(e) { + this.variableNames = ["logits"], this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = [this.outputShape[0], 1, 1], this.outputShape[1] >= 4096 ? this.workgroupSize = [256, 1, 1] : this.workgroupSize = [64, 1, 1], this.shaderKey = "softmax"; } getUserCode() { return ` @@ -32115,41 +33257,41 @@ var Qx = class { `; } }; -function c0(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { logits: n } = t8, { dim: s } = o, a = pe({ inputs: { x: n }, backend: e, attrs: { shape: [y.sizeFromShape(n.shape) / n.shape[s], n.shape[s]] } }), i = new Qx(a.shape), p = e.runWebGPUProgram(i, [a], n.dtype), u = pe({ inputs: { x: p }, backend: e, attrs: { shape: n.shape } }); - return e.disposeData(a.dataId), e.disposeData(p.dataId), u; +function Yv(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { logits: n } = e, { dim: s } = o, a = le({ inputs: { x: n }, backend: t10, attrs: { shape: [y.sizeFromShape(n.shape) / n.shape[s], n.shape[s]] } }), i = new cy(a.shape), p = t10.runWebGPUProgram(i, [a], n.dtype), u = le({ inputs: { x: p }, backend: t10, attrs: { shape: n.shape } }); + return t10.disposeData(a.dataId), t10.disposeData(p.dataId), u; } -var BW = { kernelName: Is, backendName: "webgpu", kernelFunc: c0 }; -function Rpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { logits: n } = t8, { numSamples: s, seed: a, normalized: i } = o, p = i ? n : c0({ inputs: { logits: n }, backend: e, attrs: { dim: n.shape.length - 1 } }), u = p.shape[0], c = p.shape[1], l = new Yx(u, s), m = [{ type: "float32", data: [a] }, { type: "int32", data: [c] }], d = e.runWebGPUProgram(l, [p], "int32", m); - return i || e.disposeData(p.dataId), d; +var lG = { kernelName: Fs, backendName: "webgpu", kernelFunc: Yv }; +function fce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { logits: n } = e, { numSamples: s, seed: a, normalized: i } = o, p = i ? n : Yv({ inputs: { logits: n }, backend: t10, attrs: { dim: n.shape.length - 1 } }), u = p.shape[0], l = p.shape[1], c = new ly(u, s), m = [{ type: "float32", data: [a] }, { type: "int32", data: [l] }], d = t10.runWebGPUProgram(c, [p], "int32", m); + return i || t10.disposeData(p.dataId), d; } -var zW = { kernelName: jn, backendName: "webgpu", kernelFunc: Rpe }; -function Dpe(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; - if (e.shouldExecuteOnCPU([o])) { - let s = e.tensorMap.get(o.dataId), [a, i] = Nz(s.values, o.shape, o.dtype); - return e.makeTensorInfo(i, o.dtype, a); +var cG = { kernelName: ps, backendName: "webgpu", kernelFunc: fce }; +function hce(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; + if (t10.shouldExecuteOnCPU([o])) { + let s = t10.tensorMap.get(o.dataId), [a, i] = QV(s.values, o.shape, o.dtype); + return t10.makeTensorInfo(i, o.dtype, a); } - let n = new Zr(o.shape, Z.NEG); - return e.runWebGPUProgram(n, [o], o.dtype); + let n = new so(o.shape, Z.NEG); + return t10.runWebGPUProgram(n, [o], o.dtype); } -var VW = { kernelName: pa, backendName: "webgpu", kernelFunc: Dpe }; -function Ape(r15) { +var mG = { kernelName: ls, backendName: "webgpu", kernelFunc: hce }; +function gce(r16) { console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p } = o, u = e.readSync(n.dataId), c = e.readSync(s.dataId), { selectedIndices: l } = Vt.nonMaxSuppressionV3Impl(u, c, a, i, p); - return e.makeTensorInfo([l.length], "int32", new Int32Array(l)); + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p } = o, u = t10.readSync(n.dataId), l = t10.readSync(s.dataId), { selectedIndices: c } = Ut.nonMaxSuppressionV3Impl(u, l, a, i, p); + return t10.makeTensorInfo([c.length], "int32", new Int32Array(c)); } -var WW = { kernelName: Qn, backendName: "webgpu", kernelFunc: Ape }; -function Fpe(r15) { +var dG = { kernelName: cs, backendName: "webgpu", kernelFunc: gce }; +function xce(r16) { console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead"); - let { inputs: t8, backend: e, attrs: o } = r15, { boxes: n, scores: s } = t8, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, softNmsSigma: u } = o, c = e.readSync(n.dataId), l = e.readSync(s.dataId), m = a, d = i, f = p, h = u, { selectedIndices: g, selectedScores: x } = Vt.nonMaxSuppressionV5Impl(c, l, m, d, f, h); - return [e.makeTensorInfo([g.length], "int32", new Int32Array(g)), e.makeTensorInfo([x.length], "float32", new Float32Array(x))]; + let { inputs: e, backend: t10, attrs: o } = r16, { boxes: n, scores: s } = e, { maxOutputSize: a, iouThreshold: i, scoreThreshold: p, softNmsSigma: u } = o, l = t10.readSync(n.dataId), c = t10.readSync(s.dataId), m = a, d = i, f = p, h = u, { selectedIndices: g, selectedScores: x } = Ut.nonMaxSuppressionV5Impl(l, c, m, d, f, h); + return [t10.makeTensorInfo([g.length], "int32", new Int32Array(g)), t10.makeTensorInfo([x.length], "float32", new Float32Array(x))]; } -var UW = { kernelName: Zn, backendName: "webgpu", kernelFunc: Fpe }; -var Zx = class { - constructor(t8, e) { - this.variableNames = ["x"], this.uniforms = "onValue : f32, offValue : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [t8, e], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "onehot"; +var fG = { kernelName: ms, backendName: "webgpu", kernelFunc: xce }; +var my = class { + constructor(e, t10) { + this.variableNames = ["x"], this.uniforms = "onValue : f32, offValue : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [e, t10], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "onehot"; } getUserCode() { return ` @@ -32163,120 +33305,120 @@ var Zx = class { `; } }; -function Ppe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { indices: n } = t8, { dtype: s, depth: a, onValue: i, offValue: p } = o, u = y.sizeFromShape(n.shape), c = new Zx(u, a), l = pe({ inputs: { x: n }, backend: e, attrs: { shape: [u] } }), m = [{ type: "float32", data: [i] }, { type: "float32", data: [p] }], d = e.runWebGPUProgram(c, [l], s, m); - e.disposeData(l.dataId); - let f = [...n.shape, a], h = pe({ inputs: { x: d }, backend: e, attrs: { shape: f } }); - return e.disposeData(d.dataId), h; +function yce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { indices: n } = e, { dtype: s, depth: a, onValue: i, offValue: p } = o, u = y.sizeFromShape(n.shape), l = new my(u, a), c = le({ inputs: { x: n }, backend: t10, attrs: { shape: [u] } }), m = [{ type: "float32", data: [i] }, { type: "float32", data: [p] }], d = t10.runWebGPUProgram(l, [c], s, m); + t10.disposeData(c.dataId); + let f = [...n.shape, a], h = le({ inputs: { x: d }, backend: t10, attrs: { shape: f } }); + return t10.disposeData(d.dataId), h; } -var GW = { kernelName: Jn, backendName: "webgpu", kernelFunc: Ppe }; -function xm(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; +var hG = { kernelName: ds, backendName: "webgpu", kernelFunc: yce }; +function Em(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; if (o.dtype === "complex64") { - let n = Ii({ inputs: { input: o }, backend: e }), s = xm({ inputs: { x: n }, backend: e }), a = $p({ inputs: { input: o }, backend: e }), i = xm({ inputs: { x: a }, backend: e }), p = xo({ inputs: { real: s, imag: i }, backend: e }); - return e.disposeData(n.dataId), e.disposeData(s.dataId), e.disposeData(a.dataId), e.disposeData(i.dataId), p; + let n = Fi({ inputs: { input: o }, backend: t10 }), s = Em({ inputs: { x: n }, backend: t10 }), a = Mp({ inputs: { input: o }, backend: t10 }), i = Em({ inputs: { x: a }, backend: t10 }), p = Uo({ inputs: { real: s, imag: i }, backend: t10 }); + return t10.disposeData(n.dataId), t10.disposeData(s.dataId), t10.disposeData(a.dataId), t10.disposeData(i.dataId), p; } else - return vt({ attrs: { shape: o.shape, dtype: o.dtype, value: o.dtype === "string" ? "" : 0 }, backend: e }); + return Nt({ attrs: { shape: o.shape, dtype: o.dtype, value: o.dtype === "string" ? "" : 0 }, backend: t10 }); } -var HW = { kernelName: Sa, backendName: "webgpu", kernelFunc: xm }; -function KW(r15) { - let { inputs: t8, backend: e } = r15, { x: o } = t8; +var gG = { kernelName: _a, backendName: "webgpu", kernelFunc: Em }; +function xG(r16) { + let { inputs: e, backend: t10 } = r16, { x: o } = e; if (o.dtype === "string") throw new Error("onesLike is not supported under string dtype"); if (o.dtype === "complex64") { - let n = Ii({ inputs: { input: o }, backend: e }), s = KW({ inputs: { x: n }, backend: e }), a = $p({ inputs: { input: o }, backend: e }), i = xm({ inputs: { x: a }, backend: e }), p = xo({ inputs: { real: s, imag: i }, backend: e }); - return e.disposeData(n.dataId), e.disposeData(s.dataId), e.disposeData(a.dataId), e.disposeData(i.dataId), p; + let n = Fi({ inputs: { input: o }, backend: t10 }), s = xG({ inputs: { x: n }, backend: t10 }), a = Mp({ inputs: { input: o }, backend: t10 }), i = Em({ inputs: { x: a }, backend: t10 }), p = Uo({ inputs: { real: s, imag: i }, backend: t10 }); + return t10.disposeData(n.dataId), t10.disposeData(s.dataId), t10.disposeData(a.dataId), t10.disposeData(i.dataId), p; } else - return vt({ attrs: { shape: o.shape, dtype: o.dtype, value: 1 }, backend: e }); -} -var qW = { kernelName: ca, backendName: "webgpu", kernelFunc: KW }; -function Ope(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { axis: n } = o; - if (t8.length === 1) - return Ox({ inputs: { input: t8[0] }, backend: e, attrs: { dim: n } }); - let s = t8[0].shape, a = t8[0].dtype; - t8.forEach((c) => { - y.assertShapesMatch(s, c.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === c.dtype, () => "All tensors passed to stack must have matching dtypes"); + return Nt({ attrs: { shape: o.shape, dtype: o.dtype, value: 1 }, backend: t10 }); +} +var yG = { kernelName: xa, backendName: "webgpu", kernelFunc: xG }; +function bce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { axis: n } = o; + if (e.length === 1) + return Yx({ inputs: { input: e[0] }, backend: t10, attrs: { dim: n } }); + let s = e[0].shape, a = e[0].dtype; + e.forEach((l) => { + y.assertShapesMatch(s, l.shape, "All tensors passed to stack must have matching shapes"), y.assert(a === l.dtype, () => "All tensors passed to stack must have matching dtypes"); }); - let i = [], p = t8.map((c) => { - let l = Ox({ inputs: { input: c }, backend: e, attrs: { dim: n } }); - return i.push(l), l; - }), u = s0({ inputs: p, backend: e, attrs: { axis: n } }); - return i.forEach((c) => e.disposeData(c.dataId)), u; -} -var jW = { kernelName: la, backendName: "webgpu", kernelFunc: Ope }; -function l0(r15, t8 = false) { - let e = r15.length, o = ft(e), n = r15.map((l, m) => `uniforms.pad${m}[0]`).join(","), s = r15.map((l, m) => `uniforms.pad${m}[0] + uniforms.xShape${e > 1 ? `[${m}]` : ""}`).join(","), a = e > 1 ? `${o}(${n})` : `${n}`, i = e > 1 ? `${o}(${s})` : `${s}`, p = e > 1 ? "any(paddedCoords < start)" : "paddedCoords < start", u = e > 1 ? "any(paddedCoords >= end)" : "paddedCoords >= end", c = e > 1 ? ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, e) : "coords"; + let i = [], p = e.map((l) => { + let c = Yx({ inputs: { input: l }, backend: t10, attrs: { dim: n } }); + return i.push(c), c; + }), u = Hv({ inputs: p, backend: t10, attrs: { axis: n } }); + return i.forEach((l) => t10.disposeData(l.dataId)), u; +} +var bG = { kernelName: ya, backendName: "webgpu", kernelFunc: bce }; +function Qv(r16, e = false) { + let t10 = r16.length, o = ft(t10), n = r16.map((c, m) => `uniforms.pad${m}[0]`).join(","), s = r16.map((c, m) => `uniforms.pad${m}[0] + uniforms.xShape${t10 > 1 ? `[${m}]` : ""}`).join(","), a = t10 > 1 ? `${o}(${n})` : `${n}`, i = t10 > 1 ? `${o}(${s})` : `${s}`, p = t10 > 1 ? "any(paddedCoords < start)" : "paddedCoords < start", u = t10 > 1 ? "any(paddedCoords >= end)" : "paddedCoords >= end", l = t10 > 1 ? ["coords[0]", "coords[1]", "coords[2]", "coords[3]"].slice(0, t10) : "coords"; return ` let start = ${a}; let end = ${i}; if (${p} || ${u}) { - setOutputAtIndex(index, ${t8 ? 0 : "uniforms.constantValue"}); + setOutputAtIndex(index, ${e ? 0 : "uniforms.constantValue"}); } else { let coords = paddedCoords - start; - setOutputAtIndex(index, getX(${c})); + setOutputAtIndex(index, getX(${l})); } `; } -var Jx = class { - constructor(t8, e) { - this.variableNames = ["x"], this.uniforms = "constantValue : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e.map((o, n) => o[0] + t8[n] + o[1]), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), e.map((o, n) => { +var dy = class { + constructor(e, t10) { + this.variableNames = ["x"], this.uniforms = "constantValue : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t10.map((o, n) => o[0] + e[n] + o[1]), this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), t10.map((o, n) => { this.uniforms += ` pad${n} : vec2,`; - }), this.xShape = t8, this.shaderKey = "pad"; + }), this.xShape = e, this.shaderKey = "pad"; } getUserCode() { return ` ${G("index")} { if (index < uniforms.size) { let paddedCoords = getCoordsFromIndex(index); - ${l0(this.xShape)} + ${Qv(this.xShape)} } } `; } }; -var Mpe = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { paddings: s, constantValue: a } = o; +var Cce = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { paddings: s, constantValue: a } = o; if (s.every((u) => y.arraysEqual(u, [0, 0]))) - return At({ inputs: { x: n }, backend: e }); + return Pt({ inputs: { x: n }, backend: t10 }); if (y.sizeFromShape(n.shape) === 0) { - let u = s.map((c, l) => c[0] + n.shape[l] + c[1]); - return vt({ backend: e, attrs: { shape: u, value: a, dtype: n.dtype } }); + let u = s.map((l, c) => l[0] + n.shape[c] + l[1]); + return Nt({ backend: t10, attrs: { shape: u, value: a, dtype: n.dtype } }); } let i = [{ type: "float32", data: [a] }]; s.map((u) => i.push({ type: "int32", data: [u[0], u[1]] })); - let p = new Jx(n.shape, s); - return e.runWebGPUProgram(p, [n], n.dtype, i); -}; -var XW = { kernelName: es, backendName: "webgpu", kernelFunc: Mpe }; -var Lpe = et({ opType: fe.POW }); -var YW = { kernelName: ts, backendName: "webgpu", kernelFunc: Lpe }; -function Bpe(r15) { - let { inputs: t8, backend: e } = r15, { x: o, alpha: n } = t8, s = new Si(fe.PRELU, o.shape, n.shape); - return e.runWebGPUProgram(s, [o, n], "float32"); -} -var QW = { kernelName: rs, backendName: "webgpu", kernelFunc: Bpe }; -function zpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { axis: s, keepDims: a } = o; - return Jr(n, s, a, "prod", e); -} -var ZW = { kernelName: os, backendName: "webgpu", kernelFunc: zpe }; -var Vpe = (r15) => { - let { backend: t8, attrs: e } = r15, { start: o, stop: n, step: s, dtype: a } = e, i = $z(o, n, s, a); - return t8.makeTensorInfo([i.length], a, i); -}; -var JW = { kernelName: ma, backendName: "webgpu", kernelFunc: Vpe }; -var Wpe = et({ opType: fe.DIV }); -var eU = { kernelName: fn, backendName: "webgpu", kernelFunc: Wpe }; -var Upe = ye({ opType: Z.RECIPROCAL }); -var tU = { kernelName: ns, backendName: "webgpu", kernelFunc: Upe }; -var Gpe = ye({ opType: Z.RELU }); -var rU = { kernelName: ss, backendName: "webgpu", kernelFunc: Gpe }; -var Hpe = ye({ opType: Z.RELU6 }); -var oU = { kernelName: us, backendName: "webgpu", kernelFunc: Hpe }; -var ey = class { - constructor(t8, e, o) { - this.variableNames = ["x"], this.uniforms = "adjustHeightWidth : vec2, halfPixelCenters : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [t8[0], e, o, t8[3]], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "resizeBilinear"; + let p = new dy(n.shape, s); + return t10.runWebGPUProgram(p, [n], n.dtype, i); +}; +var CG = { kernelName: fs, backendName: "webgpu", kernelFunc: Cce }; +var wce = tt({ opType: fe.POW }); +var wG = { kernelName: hs, backendName: "webgpu", kernelFunc: wce }; +function Sce(r16) { + let { inputs: e, backend: t10 } = r16, { x: o, alpha: n } = e, s = new Di(fe.PRELU, o.shape, n.shape); + return t10.runWebGPUProgram(s, [o, n], "float32"); +} +var SG = { kernelName: gs, backendName: "webgpu", kernelFunc: Sce }; +function Ice(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { axis: s, keepDims: a } = o; + return ao(n, s, a, "prod", t10); +} +var IG = { kernelName: Ho, backendName: "webgpu", kernelFunc: Ice }; +var vce = (r16) => { + let { backend: e, attrs: t10 } = r16, { start: o, stop: n, step: s, dtype: a } = t10, i = eW(o, n, s, a); + return e.makeTensorInfo([i.length], a, i); +}; +var vG = { kernelName: ba, backendName: "webgpu", kernelFunc: vce }; +var kce = tt({ opType: fe.DIV }); +var kG = { kernelName: Vn, backendName: "webgpu", kernelFunc: kce }; +var Nce = ye({ opType: Z.RECIPROCAL }); +var NG = { kernelName: xs, backendName: "webgpu", kernelFunc: Nce }; +var Tce = ye({ opType: Z.RELU }); +var TG = { kernelName: ys, backendName: "webgpu", kernelFunc: Tce }; +var _ce = ye({ opType: Z.RELU6 }); +var _G = { kernelName: ws, backendName: "webgpu", kernelFunc: _ce }; +var fy = class { + constructor(e, t10, o) { + this.variableNames = ["x"], this.uniforms = "adjustHeightWidth : vec2, halfPixelCenters : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [e[0], t10, o, e[3]], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "resizeBilinear"; } getUserCode() { return ` @@ -32325,15 +33467,15 @@ var ey = class { `; } }; -function Kpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n } = t8, { alignCorners: s, size: a, halfPixelCenters: i } = o, [p, u] = a, c = s && p > 1 ? 1 : 0, l = s && u > 1 ? 1 : 0, d = [{ type: "float32", data: [c, l] }, { type: "float32", data: [i ? 0.5 : 0] }], f = new ey(n.shape, p, u); - return e.runWebGPUProgram(f, [n], "float32", d); +function Ece(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n } = e, { alignCorners: s, size: a, halfPixelCenters: i } = o, [p, u] = a, l = s && p > 1 ? 1 : 0, c = s && u > 1 ? 1 : 0, d = [{ type: "float32", data: [l, c] }, { type: "float32", data: [i ? 0.5 : 0] }], f = new fy(n.shape, p, u); + return t10.runWebGPUProgram(f, [n], "float32", d); } -var nU = { kernelName: is, backendName: "webgpu", kernelFunc: Kpe }; -var ty = class { - constructor(t8, e) { +var EG = { kernelName: Cs, backendName: "webgpu", kernelFunc: Ece }; +var hy = class { + constructor(e, t10) { this.variableNames = ["dy"], this.uniforms = `effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32, - invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.alignCorners = e, this.shaderKey = `resizeBilinearBackprop_${e}`; + invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.alignCorners = t10, this.shaderKey = `resizeBilinearBackprop_${t10}`; } getUserCode() { return ` @@ -32413,18 +33555,18 @@ var ty = class { `; } }; -function qpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o, [, i, p] = n.shape, [, u, c] = s.shape, l = [a && u > 1 ? i - 1 : i, a && c > 1 ? p - 1 : p], m = [a && u > 1 ? u - 1 : u, a && c > 1 ? c - 1 : c], d = l[0] / m[0], f = l[1] / m[1], h = 1 / d, g = 1 / f, x = Math.ceil(h) * 2 + 2, b = Math.ceil(g) * 2 + 2, C = new ty(n.shape, a), S = [{ type: "int32", data: l }, { type: "int32", data: m }, { type: "float32", data: [d] }, { type: "float32", data: [f] }, { type: "float32", data: [h] }, { type: "float32", data: [g] }, { type: "int32", data: [x] }, { type: "int32", data: [b] }]; - return e.runWebGPUProgram(C, [s], s.dtype, S); +function $ce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o, [, i, p] = n.shape, [, u, l] = s.shape, c = [a && u > 1 ? i - 1 : i, a && l > 1 ? p - 1 : p], m = [a && u > 1 ? u - 1 : u, a && l > 1 ? l - 1 : l], d = c[0] / m[0], f = c[1] / m[1], h = 1 / d, g = 1 / f, x = Math.ceil(h) * 2 + 2, b = Math.ceil(g) * 2 + 2, w = new hy(n.shape, a), S = [{ type: "int32", data: c }, { type: "int32", data: m }, { type: "float32", data: [d] }, { type: "float32", data: [f] }, { type: "float32", data: [h] }, { type: "float32", data: [g] }, { type: "int32", data: [x] }, { type: "int32", data: [b] }]; + return t10.runWebGPUProgram(w, [s], s.dtype, S); } -var sU = { kernelName: Ja, backendName: "webgpu", kernelFunc: qpe }; -var ry = class { - constructor(t8, e, o, n) { - this.variableNames = ["x"], this.uniforms = "adjustHeightWidth : vec2, roundBase : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [t8[0], e, o, t8[3]], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.halfPixelCenters = n, this.shaderKey = `resizeNearest_${n}`; +var $G = { kernelName: ii, backendName: "webgpu", kernelFunc: $ce }; +var gy = class { + constructor(e, t10, o, n) { + this.variableNames = ["x"], this.uniforms = "adjustHeightWidth : vec2, roundBase : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = [e[0], t10, o, e[3]], this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.halfPixelCenters = n, this.shaderKey = `resizeNearest_${n}`; } getUserCode() { - let t8; - return this.halfPixelCenters ? t8 = "max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))" : t8 = "vec2(rc) * effectiveInputOverOutputRatioRC", ` + let e; + return this.halfPixelCenters ? e = "max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))" : e = "vec2(rc) * effectiveInputOverOutputRatioRC", ` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -32444,7 +33586,7 @@ var ry = class { effectiveInSize / effectiveOutSize; // Fractional source index - let sourceFracIndexRC = ${t8}; + let sourceFracIndexRC = ${e}; // Compute the coordinators of nearest neighbor point. let inputShapeRC = vec2(f32(uniforms.xShape.y), f32(uniforms.xShape.z)); @@ -32458,15 +33600,15 @@ var ry = class { `; } }; -function jpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n } = t8, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, c = s && p > 1 ? 1 : 0, l = s && u > 1 ? 1 : 0, d = [{ type: "float32", data: [c, l] }, { type: "float32", data: [s ? 0.5 : 0] }], f = new ry(n.shape, p, u, a); - return e.runWebGPUProgram(f, [n], n.dtype, d); +function Rce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n } = e, { alignCorners: s, halfPixelCenters: a, size: i } = o, [p, u] = i, l = s && p > 1 ? 1 : 0, c = s && u > 1 ? 1 : 0, d = [{ type: "float32", data: [l, c] }, { type: "float32", data: [s ? 0.5 : 0] }], f = new gy(n.shape, p, u, a); + return t10.runWebGPUProgram(f, [n], n.dtype, d); } -var aU = { kernelName: as, backendName: "webgpu", kernelFunc: jpe }; -var oy = class { - constructor(t8, e) { +var RG = { kernelName: bs, backendName: "webgpu", kernelFunc: Rce }; +var xy = class { + constructor(e, t10) { this.variableNames = ["dy"], this.uniforms = `effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32, - winHeight : i32, winWidth : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.alignCorners = e, this.shaderKey = `resizeNearestNeigborBackprop_${e}`; + winHeight : i32, winWidth : i32,`, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.alignCorners = t10, this.shaderKey = `resizeNearestNeigborBackprop_${t10}`; } getUserCode() { return ` @@ -32531,14 +33673,14 @@ var oy = class { `; } }; -function Xpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { images: n, dy: s } = t8, { alignCorners: a } = o, [, i, p] = n.shape, [, u, c] = s.shape, l = [a && u > 1 ? i - 1 : i, a && c > 1 ? p - 1 : p], m = [a && u > 1 ? u - 1 : u, a && c > 1 ? c - 1 : c], d = l[0] / m[0], f = l[1] / m[1], h = 1 / d, g = 1 / f, x = Math.ceil(h) * 2 + 2, b = Math.ceil(g) * 2 + 2, C = new oy(n.shape, a), S = [{ type: "int32", data: l }, { type: "int32", data: m }, { type: "float32", data: [h] }, { type: "float32", data: [g] }, { type: "int32", data: [x] }, { type: "int32", data: [b] }]; - return e.runWebGPUProgram(C, [s], s.dtype, S); +function Dce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { images: n, dy: s } = e, { alignCorners: a } = o, [, i, p] = n.shape, [, u, l] = s.shape, c = [a && u > 1 ? i - 1 : i, a && l > 1 ? p - 1 : p], m = [a && u > 1 ? u - 1 : u, a && l > 1 ? l - 1 : l], d = c[0] / m[0], f = c[1] / m[1], h = 1 / d, g = 1 / f, x = Math.ceil(h) * 2 + 2, b = Math.ceil(g) * 2 + 2, w = new xy(n.shape, a), S = [{ type: "int32", data: c }, { type: "int32", data: m }, { type: "float32", data: [h] }, { type: "float32", data: [g] }, { type: "int32", data: [x] }, { type: "int32", data: [b] }]; + return t10.runWebGPUProgram(w, [s], s.dtype, S); } -var iU = { kernelName: Za, backendName: "webgpu", kernelFunc: Xpe }; -var ny = class { - constructor(t8) { - this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = " axis : vec4,", this.shaderKey = "reverse"; +var DG = { kernelName: ai, backendName: "webgpu", kernelFunc: Dce }; +var yy = class { + constructor(e) { + this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = " axis : vec4,", this.shaderKey = "reverse"; } getUserCode() { return ` @@ -32574,30 +33716,30 @@ var ny = class { `; } }; -function Ype(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { dims: s } = o, a = n.shape.length; +function Ace(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { dims: s } = o, a = n.shape.length; if (a === 0) - return At({ inputs: { x: n }, backend: e }); + return Pt({ inputs: { x: n }, backend: t10 }); let i = n.shape, p = [1, 1, 1, 1]; i.forEach((g, x) => { let b = x + 4 - a; p[b] = g; }); - let u = y.parseAxisParam(s, n.shape), c = [0, 0, 0, 0]; + let u = y.parseAxisParam(s, n.shape), l = [0, 0, 0, 0]; u.forEach((g) => { let x = g + 4 - a; - c[x] = 1; + l[x] = 1; }); - let l = [{ type: "int32", data: c }], m = pe({ inputs: { x: n }, backend: e, attrs: { shape: p } }), d = new ny(p), f = e.runWebGPUProgram(d, [m], m.dtype, l); - e.disposeData(m.dataId); - let h = pe({ inputs: { x: f }, backend: e, attrs: { shape: i } }); - return e.disposeData(f.dataId), h; + let c = [{ type: "int32", data: l }], m = le({ inputs: { x: n }, backend: t10, attrs: { shape: p } }), d = new yy(p), f = t10.runWebGPUProgram(d, [m], m.dtype, c); + t10.disposeData(m.dataId); + let h = le({ inputs: { x: f }, backend: t10, attrs: { shape: i } }); + return t10.disposeData(f.dataId), h; } -var uU = { kernelName: ps, backendName: "webgpu", kernelFunc: Ype }; -var sy = class { - constructor(t8, e) { - this.outputShape = [], this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = `centerX : f32, centerY : f32, sinRadians : f32, - cosRadians : f32,`, this.shaderKey = "rotate", this.outputShape = t8, typeof e == "number" ? (this.uniforms += " fillValue : f32,", this.fillSnippet = "var outputValue = uniforms.fillValue;", this.shaderKey += "_float") : (this.uniforms += " fillValue : vec3,", this.fillSnippet = "var outputValue = uniforms.fillValue[coords[3]];", this.shaderKey += "_vec3"); +var AG = { kernelName: Ss, backendName: "webgpu", kernelFunc: Ace }; +var by = class { + constructor(e, t10) { + this.outputShape = [], this.variableNames = ["x"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = `centerX : f32, centerY : f32, sinRadians : f32, + cosRadians : f32,`, this.shaderKey = "rotate", this.outputShape = e, typeof t10 == "number" ? (this.uniforms += " fillValue : f32,", this.fillSnippet = "var outputValue = uniforms.fillValue;", this.shaderKey += "_float") : (this.uniforms += " fillValue : vec3,", this.fillSnippet = "var outputValue = uniforms.fillValue[coords[3]];", this.shaderKey += "_vec3"); } getUserCode() { return ` @@ -32623,24 +33765,24 @@ var sy = class { `; } }; -var pU = { kernelName: Ds, backendName: "webgpu", kernelFunc: ({ inputs: r15, attrs: t8, backend: e }) => { - let { image: o } = r15, { radians: n, fillValue: s, center: a } = t8, i = e, p = new sy(o.shape, s), [u, c] = w.getImageCenter(a, o.shape[1], o.shape[2]), l = [{ type: "float32", data: [u] }, { type: "float32", data: [c] }, { type: "float32", data: [Math.sin(n)] }, { type: "float32", data: [Math.cos(n)] }]; - return typeof s == "number" ? l.push({ type: "float32", data: [Number.parseFloat(s.toFixed(2))] }) : l.push({ type: "float32", data: s }), i.runWebGPUProgram(p, [o], o.dtype, l); +var FG = { kernelName: Vs, backendName: "webgpu", kernelFunc: ({ inputs: r16, attrs: e, backend: t10 }) => { + let { image: o } = r16, { radians: n, fillValue: s, center: a } = e, i = t10, p = new by(o.shape, s), [u, l] = C.getImageCenter(a, o.shape[1], o.shape[2]), c = [{ type: "float32", data: [u] }, { type: "float32", data: [l] }, { type: "float32", data: [Math.sin(n)] }, { type: "float32", data: [Math.cos(n)] }]; + return typeof s == "number" ? c.push({ type: "float32", data: [Number.parseFloat(s.toFixed(2))] }) : c.push({ type: "float32", data: s }), i.runWebGPUProgram(p, [o], o.dtype, c); } }; -var Qpe = ye({ opType: Z.ROUND }); -var cU = { kernelName: cs, backendName: "webgpu", kernelFunc: Qpe }; -var Zpe = ye({ opType: Z.RSQRT, cpuKernelImpl: Ez }); -var lU = { kernelName: ls, backendName: "webgpu", kernelFunc: Zpe }; -var za = class { - constructor(t8, e, o, n, s, a, i, p = true) { - this.variableNames = ["updates", "indices"], this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = a, this.type = i, this.sumDupeIndices = p, this.dispatchLayout = X(t8), this.dispatch = H(this.dispatchLayout, t8, this.workgroupSize), this.sliceDimGreaterThanOne = e > 1, this.shaderKey = `scatter_${o}_${n}_${this.sliceDimGreaterThanOne}_${i}_${p}_${s.length}`; +var Fce = ye({ opType: Z.ROUND }); +var PG = { kernelName: Is, backendName: "webgpu", kernelFunc: Fce }; +var Pce = ye({ opType: Z.RSQRT, cpuKernelImpl: tW }); +var OG = { kernelName: Do, backendName: "webgpu", kernelFunc: Pce }; +var qa = class { + constructor(e, t10, o, n, s, a, i, p = true) { + this.variableNames = ["updates", "indices"], this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = a, this.type = i, this.sumDupeIndices = p, this.dispatchLayout = X(e), this.dispatch = H(this.dispatchLayout, e, this.workgroupSize), this.sliceDimGreaterThanOne = t10 > 1, this.shaderKey = `scatter_${o}_${n}_${this.sliceDimGreaterThanOne}_${i}_${p}_${s.length}`; let u = ft(s.length); this.uniforms = `sliceDim : i32, strides: ${u}, updatesSize: i32,`, this.updatesRank = n, this.indicesRank = o; } getUserCode() { - let t8 = ""; - this.indicesRank === 1 ? t8 = "coords[0]" : this.indicesRank === 2 && (t8 = "coords[0], j"); - let e = `getIndices(${t8})`, o = this.sliceDimGreaterThanOne ? "uniforms.strides[j]" : "uniforms.strides", n = "", s = ""; + let e = ""; + this.indicesRank === 1 ? e = "coords[0]" : this.indicesRank === 2 && (e = "coords[0], j"); + let t10 = `getIndices(${e})`, o = this.sliceDimGreaterThanOne ? "uniforms.strides[j]" : "uniforms.strides", n = "", s = ""; this.dispatchLayout.x.length === 1 ? (n = "flattenedIndex", s = ` fn getUpdatesCoordsFromFlatIndex(index : i32) -> i32 { return index; @@ -32657,7 +33799,7 @@ var za = class { return vec2(d0, d1); } `); - let i = `getUpdates(${Array.from({ length: this.updatesRank }, (u, c) => `coords[${c}]`).join(", ")})`; + let i = `getUpdates(${Array.from({ length: this.updatesRank }, (u, l) => `coords[${l}]`).join(", ")})`; return ` ${s} ${G("index")} { @@ -32665,29 +33807,29 @@ var za = class { let coords = getUpdatesCoordsFromFlatIndex(index); var flattenedIndex = 0; for (var j = 0; j < uniforms.sliceDim; j = j + 1) { - let indexInside = i32(round(${e})); + let indexInside = i32(round(${t10})); flattenedIndex = flattenedIndex + indexInside * ${o}; } let updateValue = - ${Cu(this.type)}(${i}); + ${Eu(this.type)}(${i}); let flatIndex = getOutputIndexFromCoords(${n}); - ${this.sumDupeIndices ? Yr("&result[flatIndex]", "updateValue", this.type) : "atomicStore(&result[flatIndex], bitcast(updateValue));"} + ${this.sumDupeIndices ? oo("&result[flatIndex]", "updateValue", this.type) : "atomicStore(&result[flatIndex], bitcast(updateValue));"} } }`; } }; -function Jpe(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { indices: n, updates: s } = t8, { shape: a } = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: c, outputSize: l } = w.calculateShapes(s, n, a), m = [l / u, u]; - if (l === 0) - return e.makeTensorInfo(a, n.dtype); - let d = pe({ inputs: { x: n }, backend: e, attrs: { shape: [p, i] } }), f = pe({ inputs: { x: s }, backend: e, attrs: { shape: [p, u] } }), h = f.dtype, g = vt({ backend: e, attrs: { shape: m, value: 0, dtype: h } }), x = y.sizeFromShape(f.shape), b = [{ type: "int32", data: [i] }, { type: "int32", data: c }, { type: "int32", data: [x] }], C = new za(f.shape, i, d.shape.length, f.shape.length, c, m, h), S = e.runWebGPUProgram(C, [f, d], h, b, g), k = pe({ inputs: { x: S }, backend: e, attrs: { shape: a } }); - return e.disposeData(d.dataId), e.disposeData(f.dataId), e.disposeData(S.dataId), k; +function Oce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { indices: n, updates: s } = e, { shape: a } = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: l, outputSize: c } = C.calculateShapes(s, n, a), m = [c / u, u]; + if (c === 0) + return t10.makeTensorInfo(a, n.dtype); + let d = le({ inputs: { x: n }, backend: t10, attrs: { shape: [p, i] } }), f = le({ inputs: { x: s }, backend: t10, attrs: { shape: [p, u] } }), h = f.dtype, g = Nt({ backend: t10, attrs: { shape: m, value: 0, dtype: h } }), x = y.sizeFromShape(f.shape), b = [{ type: "int32", data: [i] }, { type: "int32", data: l }, { type: "int32", data: [x] }], w = new qa(f.shape, i, d.shape.length, f.shape.length, l, m, h), S = t10.runWebGPUProgram(w, [f, d], h, b, g), k = le({ inputs: { x: S }, backend: t10, attrs: { shape: a } }); + return t10.disposeData(d.dataId), t10.disposeData(f.dataId), t10.disposeData(S.dataId), k; } -var mU = { kernelName: ms, backendName: "webgpu", kernelFunc: Jpe }; -var ay = class { - constructor(t8, e) { - this.outputShape = [], this.variableNames = ["sortedSequence", "values"], this.uniforms = "numInputs : i32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.side = e, this.shaderKey = `search_sorted_${e}`; +var MG = { kernelName: vs, backendName: "webgpu", kernelFunc: Oce }; +var Cy = class { + constructor(e, t10) { + this.outputShape = [], this.variableNames = ["sortedSequence", "values"], this.uniforms = "numInputs : i32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.side = t10, this.shaderKey = `search_sorted_${t10}`; } getUserCode() { return ` @@ -32715,100 +33857,100 @@ var ay = class { `; } }; -function ece(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { sortedSequence: n, values: s } = t8, { side: a } = o, i = new ay([s.shape[0], s.shape[1]], a), p = [{ type: "int32", data: [n.shape[1]] }]; - return e.runWebGPUProgram(i, [n, s], "int32", p); +function Mce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { sortedSequence: n, values: s } = e, { side: a } = o, i = new Cy([s.shape[0], s.shape[1]], a), p = [{ type: "int32", data: [n.shape[1]] }]; + return t10.runWebGPUProgram(i, [n, s], "int32", p); } -var dU = { kernelName: fs, backendName: "webgpu", kernelFunc: ece }; -var iy = class { - constructor(t8, e, o) { - this.variableNames = ["c", "a", "b"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.cRank = t8, this.rank = o, this.shaderKey = "select"; +var LG = { kernelName: Ns, backendName: "webgpu", kernelFunc: Mce }; +var wy = class { + constructor(e, t10, o) { + this.variableNames = ["c", "a", "b"], this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t10, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.cRank = e, this.rank = o, this.shaderKey = "select"; } getUserCode() { - let t8, e; + let e, t10; if (this.rank > 4) throw Error(`Where for rank ${this.rank} is not yet supported`); if (this.rank === 1) - e = "resRC", t8 = "resRC"; + t10 = "resRC", e = "resRC"; else { let n = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], s = [], a = []; for (let i = 0; i < this.outputShape.length; i++) a.push(`${n[i]}`), i < this.cRank && s.push(`${n[i]}`); - t8 = s.join(), e = a.join(); + e = s.join(), t10 = a.join(); } return ` ${G("index")} { if (index < uniforms.size) { let resRC = getCoordsFromIndex(index); - let cVal = getC(${t8}); + let cVal = getC(${e}); if (cVal >= 1.0) { - setOutputAtIndex(index, getA(${e})); + setOutputAtIndex(index, getA(${t10})); } else { - setOutputAtIndex(index, getB(${e})); + setOutputAtIndex(index, getB(${t10})); } } } `; } }; -function tce(r15) { - let { inputs: t8, backend: e } = r15, { condition: o, t: n, e: s } = t8, a = new iy(o.shape.length, n.shape, n.shape.length); - return e.runWebGPUProgram(a, [o, n, s], dt(n.dtype, s.dtype)); -} -var fU = { kernelName: fa, backendName: "webgpu", kernelFunc: tce }; -var rce = ye({ opType: Z.SELU }); -var hU = { kernelName: hs, backendName: "webgpu", kernelFunc: rce }; -var oce = ye({ opType: Z.SIGMOID }); -var gU = { kernelName: bs, backendName: "webgpu", kernelFunc: oce }; -var nce = ye({ opType: Z.SIGN }); -var xU = { kernelName: ys, backendName: "webgpu", kernelFunc: nce }; -var sce = ye({ opType: Z.SIN }); -var yU = { kernelName: gs, backendName: "webgpu", kernelFunc: sce }; -var ace = ye({ opType: Z.SINH }); -var bU = { kernelName: xs, backendName: "webgpu", kernelFunc: ace }; -var ice = ye({ opType: Z.SOFTPLUS }); -var CU = { kernelName: Cs, backendName: "webgpu", kernelFunc: ice }; -var uy = class { - constructor(t8, e, o, n, s, a) { +function Lce(r16) { + let { inputs: e, backend: t10 } = r16, { condition: o, t: n, e: s } = e, a = new wy(o.shape.length, n.shape, n.shape.length); + return t10.runWebGPUProgram(a, [o, n, s], pt(n.dtype, s.dtype)); +} +var BG = { kernelName: wa, backendName: "webgpu", kernelFunc: Lce }; +var Bce = ye({ opType: Z.SELU }); +var zG = { kernelName: Ts, backendName: "webgpu", kernelFunc: Bce }; +var zce = ye({ opType: Z.SIGMOID }); +var VG = { kernelName: Ao, backendName: "webgpu", kernelFunc: zce }; +var Vce = ye({ opType: Z.SIGN }); +var WG = { kernelName: Rs, backendName: "webgpu", kernelFunc: Vce }; +var Wce = ye({ opType: Z.SIN }); +var UG = { kernelName: Es, backendName: "webgpu", kernelFunc: Wce }; +var Uce = ye({ opType: Z.SINH }); +var GG = { kernelName: $s, backendName: "webgpu", kernelFunc: Uce }; +var Gce = ye({ opType: Z.SOFTPLUS }); +var HG = { kernelName: Ds, backendName: "webgpu", kernelFunc: Gce }; +var Sy = class { + constructor(e, t10, o, n, s, a) { this.variableNames = ["x"], this.outputShape = [], this.uniforms = "", this.workgroupSize = [64, 1, 1], this.size = true; let i = new Array(n.length); for (let p = 0; p < i.length; p++) i[p] = n[s[p]]; - this.outputShape = i, this.newDim = s, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.xShape = t8, this.paddedXShape = e, this.uniforms += `reshapedPaddedXShape : ${ft(n.length)}, paddedXShapeStrides : ${ft(a)}, `, o.map((p, u) => { + this.outputShape = i, this.newDim = s, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.xShape = e, this.paddedXShape = t10, this.uniforms += `reshapedPaddedXShape : ${ft(n.length)}, paddedXShapeStrides : ${ft(a)}, `, o.map((p, u) => { this.uniforms += ` pad${u} : vec2,`; }), this.shaderKey = `spaceToBatchND_${s}`; } getUserCode() { - let t8 = ft(this.outputShape.length), e = Jv(this.newDim); + let e = ft(this.outputShape.length), t10 = Bv(this.newDim); return ` - ${um(this.paddedXShape, "PaddedX")} + ${xm(this.paddedXShape, "PaddedX")} ${G("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); - let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${t8}(${e}), uniforms.reshapedPaddedXShape); + let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${e}(${t10}), uniforms.reshapedPaddedXShape); let paddedCoords = getPaddedXCoordsFromIndex(switchedIndex); - ${l0(this.xShape, true)} + ${Qv(this.xShape, true)} } } `; } }; -var uce = (r15) => { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { blockShape: s, paddings: a } = o; +var Hce = (r16) => { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { blockShape: s, paddings: a } = o; y.assert(n.shape.length <= 4, () => "spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet"); - let i = s.reduce((b, C) => b * C), p = [[0, 0]]; + let i = s.reduce((b, w) => b * w), p = [[0, 0]]; p.push(...a); for (let b = 1 + s.length; b < n.shape.length; ++b) p.push([0, 0]); - let u = p.map((b, C) => b[0] + n.shape[C] + b[1]), c = w.getReshaped(u, s, i, false), l = w.getPermuted(c.length, s.length, false), m = w.getReshapedPermuted(u, s, i, false), d = y.computeStrides(u), f = new uy(n.shape, u, p, c, l, d.length), h = [{ type: "int32", data: c }, { type: "int32", data: d }]; + let u = p.map((b, w) => b[0] + n.shape[w] + b[1]), l = C.getReshaped(u, s, i, false), c = C.getPermuted(l.length, s.length, false), m = C.getReshapedPermuted(u, s, i, false), d = y.computeStrides(u), f = new Sy(n.shape, u, p, l, c, d.length), h = [{ type: "int32", data: l }, { type: "int32", data: d }]; p.map((b) => h.push({ type: "int32", data: [b[0], b[1]] })); - let g = e.runWebGPUProgram(f, [n], n.dtype, h), x = pe({ inputs: { x: g }, backend: e, attrs: { shape: m } }); - return e.disposeData(g.dataId), x; + let g = t10.runWebGPUProgram(f, [n], n.dtype, h), x = le({ inputs: { x: g }, backend: t10, attrs: { shape: m } }); + return t10.disposeData(g.dataId), x; }; -var wU = { kernelName: ga, backendName: "webgpu", kernelFunc: uce }; -var py = class { - constructor(t8, e, o) { - this.variableNames = ["input", "indices", "segmentIds"], this.outputShape = [], this.uniforms = "segmentSize : i32, sparseSize : i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = t8, this.type = o, this.dispatchLayout = X([e]), this.dispatch = H(this.dispatchLayout, [e], this.workgroupSize), this.shaderKey = "sparseSegmentSum"; +var KG = { kernelName: Sa, backendName: "webgpu", kernelFunc: Hce }; +var Iy = class { + constructor(e, t10, o) { + this.variableNames = ["input", "indices", "segmentIds"], this.outputShape = [], this.uniforms = "segmentSize : i32, sparseSize : i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = e, this.type = o, this.dispatchLayout = X([t10]), this.dispatch = H(this.dispatchLayout, [t10], this.workgroupSize), this.shaderKey = "sparseSegmentSum"; } getUserCode() { return ` @@ -32821,30 +33963,30 @@ var py = class { let value = input[indexInInput * uniforms.segmentSize + indexInSegment]; let outIndex = segmentId * uniforms.segmentSize + indexInSegment; - ${Yr("&result[outIndex]", "value", this.type)} + ${oo("&result[outIndex]", "value", this.type)} } } `; } }; -var cy = class { - constructor(t8, e) { - this.variableNames = ["segmentIds"], this.outputShape = [], this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = [t8], this.dispatchLayout = X(e), this.dispatch = H(this.dispatchLayout, e, this.workgroupSize), this.shaderKey = "sparseSegmentIdCountProgram"; +var vy = class { + constructor(e, t10) { + this.variableNames = ["segmentIds"], this.outputShape = [], this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = [e], this.dispatchLayout = X(t10), this.dispatch = H(this.dispatchLayout, t10, this.workgroupSize), this.shaderKey = "sparseSegmentIdCountProgram"; } getUserCode() { return ` ${G("index")} { if (index < uniforms.segmentIdsShape) { let segmentId = segmentIds[index]; - ${Yr("&result[segmentId]", "1", "int32")} + ${oo("&result[segmentId]", "1", "int32")} } } `; } }; -var ly = class { - constructor(t8, e) { - this.variableNames = ["segmentSum", "sameSegmentIdCount"], this.outputShape = [], this.uniforms = "segmentSize : i32", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.type = e, this.dispatchLayout = X(t8), this.dispatch = H(this.dispatchLayout, t8, this.workgroupSize), this.shaderKey = "sparseSegmentMean"; +var ky = class { + constructor(e, t10) { + this.variableNames = ["segmentSum", "sameSegmentIdCount"], this.outputShape = [], this.uniforms = "segmentSize : i32", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.type = t10, this.dispatchLayout = X(e), this.dispatch = H(this.dispatchLayout, e, this.workgroupSize), this.shaderKey = "sparseSegmentMean"; } getUserCode() { return ` @@ -32860,196 +34002,196 @@ var ly = class { `; } }; -function my(r15, t8, e, o = false, n) { - let a = y.sizeFromShape(r15.shape) / r15.shape[0], i = r15.dtype, p = y.sizeFromShape(t8.shape), u = n.readSync(e.dataId), l = p > 0 ? u[p - 1] + 1 : 0, m, d = r15.shape.slice(); - d[0] = l; - let f = p * a, h = vt({ backend: n, attrs: { shape: d, value: 0, dtype: i } }); - m = new py(d, f, i); - let g = [{ type: "int32", data: [a] }, { type: "int32", data: [f] }], x = n.runWebGPUProgram(m, [r15, t8, e], i, g, h); +function Ny(r16, e, t10, o = false, n) { + let a = y.sizeFromShape(r16.shape) / r16.shape[0], i = r16.dtype, p = y.sizeFromShape(e.shape), u = n.readSync(t10.dataId), c = p > 0 ? u[p - 1] + 1 : 0, m, d = r16.shape.slice(); + d[0] = c; + let f = p * a, h = Nt({ backend: n, attrs: { shape: d, value: 0, dtype: i } }); + m = new Iy(d, f, i); + let g = [{ type: "int32", data: [a] }, { type: "int32", data: [f] }], x = n.runWebGPUProgram(m, [r16, e, t10], i, g, h); if (o) return x; - let b = vt({ backend: n, attrs: { shape: [l], value: 0, dtype: "int32" } }); - m = new cy(l, e.shape); - let C = n.runWebGPUProgram(m, [e], "int32", null, b), S = vt({ backend: n, attrs: { shape: d, value: 0, dtype: i } }); - m = new ly(d, i), g = [{ type: "int32", data: [a] }]; - let k = n.runWebGPUProgram(m, [x, C], i, g, S); - return n.disposeData(x.dataId), n.disposeData(C.dataId), k; -} -function pce(r15) { - let { inputs: t8, backend: e } = r15, { data: o, indices: n, segmentIds: s } = t8; - return my(o, n, s, false, e); -} -var SU = { kernelName: ya, backendName: "webgpu", kernelFunc: pce }; -function cce(r15) { - let { inputs: t8, backend: e } = r15, { data: o, indices: n, segmentIds: s } = t8; - return my(o, n, s, true, e); -} -var IU = { kernelName: ba, backendName: "webgpu", kernelFunc: cce }; -var dy = class { - constructor(t8, e) { + let b = Nt({ backend: n, attrs: { shape: [c], value: 0, dtype: "int32" } }); + m = new vy(c, t10.shape); + let w = n.runWebGPUProgram(m, [t10], "int32", null, b), S = Nt({ backend: n, attrs: { shape: d, value: 0, dtype: i } }); + m = new ky(d, i), g = [{ type: "int32", data: [a] }]; + let k = n.runWebGPUProgram(m, [x, w], i, g, S); + return n.disposeData(x.dataId), n.disposeData(w.dataId), k; +} +function Kce(r16) { + let { inputs: e, backend: t10 } = r16, { data: o, indices: n, segmentIds: s } = e; + return Ny(o, n, s, false, t10); +} +var qG = { kernelName: va, backendName: "webgpu", kernelFunc: Kce }; +function qce(r16) { + let { inputs: e, backend: t10 } = r16, { data: o, indices: n, segmentIds: s } = e; + return Ny(o, n, s, true, t10); +} +var jG = { kernelName: ka, backendName: "webgpu", kernelFunc: qce }; +var Ty = class { + constructor(e, t10) { this.variableNames = ["A"], this.workgroupSize = [64, 1, 1], this.size = true; - let o = new Array(t8.length); + let o = new Array(e.length); for (let n = 0; n < o.length; n++) - o[n] = t8[n] * e[n]; + o[n] = e[n] * t10[n]; this.outputShape = o, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.rank = this.outputShape.length, this.shaderKey = "tile"; } getUserCode() { - let t8 = lce(this.rank, "uniforms."); + let e = jce(this.rank, "uniforms."); return ` ${G("index")} { if (index < uniforms.size) { let resRC = getCoordsFromIndex(index); - setOutputAtIndex(index, getA(${t8})); + setOutputAtIndex(index, getA(${e})); } } `; } }; -function lce(r15, t8 = "") { - if (r15 >= 5) - throw Error(`Tile for rank ${r15} is not yet supported`); - if (r15 === 1) - return `(resRC % ${t8}aShape)`; - let e = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], o = []; - for (let n = 0; n < r15; n++) - o.push(`(${e[n]} % ${t8}aShape[${n}])`); +function jce(r16, e = "") { + if (r16 >= 5) + throw Error(`Tile for rank ${r16} is not yet supported`); + if (r16 === 1) + return `(resRC % ${e}aShape)`; + let t10 = ["resRC.x", "resRC.y", "resRC.z", "resRC.w"], o = []; + for (let n = 0; n < r16; n++) + o.push(`(${t10[n]} % ${e}aShape[${n}])`); return o.join(); } -function ym(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { reps: s } = o; - if (e.shouldExecuteOnCPU([n]) || n.dtype === "string" || n.shape.length >= 5) { - let p = e.readSync(n.dataId), u = n.dtype === "string" ? p.map((m) => y.decodeString(m)) : p, c = me(n.shape, n.dtype, u), l = Mz(c, s); - return e.makeTensorInfo(l.shape, l.dtype, l.values); +function $m(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { reps: s } = o; + if (t10.shouldExecuteOnCPU([n]) || n.dtype === "string" || n.shape.length >= 5) { + let p = t10.readSync(n.dataId), u = n.dtype === "string" ? p.map((m) => y.decodeString(m)) : p, l = ie(n.shape, n.dtype, u), c = uW(l, s); + return t10.makeTensorInfo(c.shape, c.dtype, c.values); } - let a = new dy(n.shape, s); - return e.runWebGPUProgram(a, [n], n.dtype); + let a = new Ty(n.shape, s); + return t10.runWebGPUProgram(a, [n], n.dtype); } -var vU = { kernelName: uo, backendName: "webgpu", kernelFunc: ym }; -function mce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { sparseIndices: n, sparseValues: s, defaultValue: a } = t8, { outputShape: i } = o, { sliceRank: p, numUpdates: u, sliceSize: c, strides: l, outputSize: m } = w.calculateShapes(s, n, i), d = false; +var XG = { kernelName: Mo, backendName: "webgpu", kernelFunc: $m }; +function Xce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { sparseIndices: n, sparseValues: s, defaultValue: a } = e, { outputShape: i } = o, { sliceRank: p, numUpdates: u, sliceSize: l, strides: c, outputSize: m } = C.calculateShapes(s, n, i), d = false; if (s.dtype === "string") { - let R = e.bufferSync(n), D = e.bufferSync(s), P = y.decodeString(e.readSync(a.dataId)[0]), O = Rz(R, D, i, m, c, u, p, l, P, d); - return e.makeTensorInfo(i, O.dtype, O.values); + let R = t10.bufferSync(n), D = t10.bufferSync(s), F = y.decodeString(t10.readSync(a.dataId)[0]), O = rW(R, D, i, m, l, u, p, c, F, d); + return t10.makeTensorInfo(i, O.dtype, O.values); } - let f = [m / c, c], h = pe({ inputs: { x: n }, backend: e, attrs: { shape: [u, p] } }), g = s.shape.length ? pe({ inputs: { x: s }, backend: e, attrs: { shape: [u, c] } }) : At({ inputs: { x: s }, backend: e }), x = g.dtype, b = e.makeTensorInfo([], x, y.makeZerosTypedArray(1, x)), C = pe({ inputs: { x: a }, backend: e, attrs: { shape: Array(f.length).fill(1) } }), S = ym({ inputs: { x: C }, backend: e, attrs: { reps: f } }), k = y.sizeFromShape([u, c]), _ = [{ type: "int32", data: [p] }, { type: "int32", data: l }, { type: "int32", data: [k] }]; + let f = [m / l, l], h = le({ inputs: { x: n }, backend: t10, attrs: { shape: [u, p] } }), g = s.shape.length ? le({ inputs: { x: s }, backend: t10, attrs: { shape: [u, l] } }) : Pt({ inputs: { x: s }, backend: t10 }), x = g.dtype, b = t10.makeTensorInfo([], x, y.makeZerosTypedArray(1, x)), w = le({ inputs: { x: a }, backend: t10, attrs: { shape: Array(f.length).fill(1) } }), S = $m({ inputs: { x: w }, backend: t10, attrs: { reps: f } }), k = y.sizeFromShape([u, l]), T = [{ type: "int32", data: [p] }, { type: "int32", data: c }, { type: "int32", data: [k] }]; switch (u) { case 0: break; case 1: { - let R = new za([u, c], p, h.shape.length, g.shape.length, l, f, x, d); - e.runWebGPUProgram(R, [g, h], x, _, S); + let R = new qa([u, l], p, h.shape.length, g.shape.length, c, f, x, d); + t10.runWebGPUProgram(R, [g, h], x, T, S); } break; default: { - let R = new za([u, c], p, h.shape.length, b.shape.length, l, f, x, d); - e.runWebGPUProgram(R, [b, h], x, _, S); + let R = new qa([u, l], p, h.shape.length, b.shape.length, c, f, x, d); + t10.runWebGPUProgram(R, [b, h], x, T, S); } { - let R = new za([u, c], p, h.shape.length, g.shape.length, l, f, x); - e.runWebGPUProgram(R, [g, h], x, _, S); + let R = new qa([u, l], p, h.shape.length, g.shape.length, c, f, x); + t10.runWebGPUProgram(R, [g, h], x, T, S); } } - let E = pe({ inputs: { x: S }, backend: e, attrs: { shape: i } }); - return e.disposeData(h.dataId), e.disposeData(g.dataId), e.disposeData(C.dataId), e.disposeData(b.dataId), e.disposeData(S.dataId), E; + let E = le({ inputs: { x: S }, backend: t10, attrs: { shape: i } }); + return t10.disposeData(h.dataId), t10.disposeData(g.dataId), t10.disposeData(w.dataId), t10.disposeData(b.dataId), t10.disposeData(S.dataId), E; } -var kU = { kernelName: vs, backendName: "webgpu", kernelFunc: mce }; -function dce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { numOrSizeSplits: s, axis: a } = o, i = y.parseAxisParam(a, n.shape)[0], p = w.prepareSplitSize(n, s, i), u = n.shape.length, c = new Array(u).fill(0), l = n.shape.slice(); +var YG = { kernelName: Ps, backendName: "webgpu", kernelFunc: Xce }; +function Yce(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { numOrSizeSplits: s, axis: a } = o, i = y.parseAxisParam(a, n.shape)[0], p = C.prepareSplitSize(n, s, i), u = n.shape.length, l = new Array(u).fill(0), c = n.shape.slice(); return p.map((m) => { - let d = [...l]; + let d = [...c]; d[i] = m; - let f = Hs({ inputs: { x: n }, backend: e, attrs: { begin: c, size: d } }); - return c[i] += m, f; + let f = ea({ inputs: { x: n }, backend: t10, attrs: { begin: l, size: d } }); + return l[i] += m, f; }); } -var NU = { kernelName: xa, backendName: "webgpu", kernelFunc: dce }; -var fce = ye({ opType: Z.SQRT }); -var TU = { kernelName: ws, backendName: "webgpu", kernelFunc: fce }; -var _U = { kernelName: Ki, backendName: "webgpu", kernelFunc: ({ inputs: r15, backend: t8 }) => { - let { x: e } = r15, o = t8, n = new Zr(e.shape, Z.SQUARE); - return o.runWebGPUProgram(n, [e], e.dtype); +var QG = { kernelName: Ia, backendName: "webgpu", kernelFunc: Yce }; +var Qce = ye({ opType: Z.SQRT }); +var ZG = { kernelName: Fo, backendName: "webgpu", kernelFunc: Qce }; +var JG = { kernelName: tu, backendName: "webgpu", kernelFunc: ({ inputs: r16, backend: e }) => { + let { x: t10 } = r16, o = e, n = new so(t10.shape, Z.SQUARE); + return o.runWebGPUProgram(n, [t10], t10.dtype); } }; -var hce = et({ opType: fe.SQUARED_DIFFERENCE }); -var $U = { kernelName: ks, backendName: "webgpu", kernelFunc: hce }; -function gce({ inputs: r15, attrs: t8, backend: e }) { - let { x: o } = r15, n = new Zr(o.shape, Z.STEP, "stepAlpha : f32,"), s = [{ type: "float32", data: [t8.alpha] }]; - return e.runWebGPUProgram(n, [o], o.dtype, s); -} -var EU = { kernelName: wo, backendName: "webgpu", kernelFunc: gce }; -var fy = class { - constructor(t8) { - this.variableNames = ["x"], this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]); - let e = ft(this.outputShape.length); - this.uniforms = `begin : ${e}, strides : ${e}, `, this.shaderKey = "stridedSlice"; +var Zce = tt({ opType: fe.SQUARED_DIFFERENCE }); +var e4 = { kernelName: Po, backendName: "webgpu", kernelFunc: Zce }; +function Jce({ inputs: r16, attrs: e, backend: t10 }) { + let { x: o } = r16, n = new so(o.shape, Z.STEP, "stepAlpha : f32,"), s = [{ type: "float32", data: [e.alpha] }]; + return t10.runWebGPUProgram(n, [o], o.dtype, s); +} +var t4 = { kernelName: Ko, backendName: "webgpu", kernelFunc: Jce }; +var _y = class { + constructor(e) { + this.variableNames = ["x"], this.workPerThread = 1, this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize, [this.workPerThread, 1, 1]); + let t10 = ft(this.outputShape.length); + this.uniforms = `begin : ${t10}, strides : ${t10}, `, this.shaderKey = "stridedSlice"; } getUserCode() { - let t8 = this.outputShape.length, e = ""; - if (t8 === 1) - e = "coords * uniforms.strides + uniforms.begin"; + let e = this.outputShape.length, t10 = ""; + if (e === 1) + t10 = "coords * uniforms.strides + uniforms.begin"; else { let n = 0; - e = this.outputShape.map((s, a) => (n++, this.outputShape.length === 1 ? `coords * uniforms.strides[${a}] + uniforms.begin[${a}]` : `coords[${n - 1}] * uniforms.strides[${a}] + uniforms.begin[${a}]`)).join(","); + t10 = this.outputShape.map((s, a) => (n++, this.outputShape.length === 1 ? `coords * uniforms.strides[${a}] + uniforms.begin[${a}]` : `coords[${n - 1}] * uniforms.strides[${a}] + uniforms.begin[${a}]`)).join(","); } return ` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); - setOutputAtIndex(index, getX(${e})); + setOutputAtIndex(index, getX(${t10})); } } `; } }; -function xce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: c, newAxisMask: l, shrinkAxisMask: m } = o, { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: C, strides: S } = pt.sliceInfo(n.shape, s, a, i, p, u, c, l, m), k; +function eme(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { begin: s, end: a, strides: i, beginMask: p, endMask: u, ellipsisMask: l, newAxisMask: c, shrinkAxisMask: m } = o, { finalShapeSparse: d, finalShape: f, isIdentity: h, sliceDim0: g, isSimpleSlice: x, begin: b, end: w, strides: S } = nt.sliceInfo(n.shape, s, a, i, p, u, l, c, m), k; if (h) - k = pe({ inputs: { x: n }, backend: e, attrs: { shape: f } }); + k = le({ inputs: { x: n }, backend: t10, attrs: { shape: f } }); else if (g || x) { y.assert(n.shape.length >= 1, () => `Input must have rank at least 1, got: ${n.shape.length}`); - let _ = pt.computeOutShape(b, C, S), E = Hs({ inputs: { x: n }, backend: e, attrs: { begin: b, size: _ } }); - k = pe({ inputs: { x: E }, backend: e, attrs: { shape: f } }), e.disposeData(E.dataId); - } else if (e.shouldExecuteOnCPU([n])) { - let E = e.readSync(n.dataId), R = me(n.shape, n.dtype, E), D = Fz(d, R, S, b); - k = e.makeTensorInfo(f, n.dtype, D.values); + let T = nt.computeOutShape(b, w, S), E = ea({ inputs: { x: n }, backend: t10, attrs: { begin: b, size: T } }); + k = le({ inputs: { x: E }, backend: t10, attrs: { shape: f } }), t10.disposeData(E.dataId); + } else if (t10.shouldExecuteOnCPU([n])) { + let E = t10.readSync(n.dataId), R = ie(n.shape, n.dtype, E), D = sW(d, R, S, b); + k = t10.makeTensorInfo(f, n.dtype, D.values); } else { - let E = new fy(d), R = [{ type: "int32", data: b }, { type: "int32", data: S }], D = e.runWebGPUProgram(E, [n], n.dtype, R); - k = pe({ inputs: { x: D }, backend: e, attrs: { shape: f } }), e.disposeData(D.dataId); + let E = new _y(d), R = [{ type: "int32", data: b }, { type: "int32", data: S }], D = t10.runWebGPUProgram(E, [n], n.dtype, R); + k = le({ inputs: { x: D }, backend: t10, attrs: { shape: f } }), t10.disposeData(D.dataId); } return k; } -var RU = { kernelName: Ns, backendName: "webgpu", kernelFunc: xce }; -function yce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { separator: n, nGramWidths: s, leftPad: a, rightPad: i, padWidth: p, preserveShortSequences: u } = o, { data: c, dataSplits: l } = t8, m = e.readSync(c.dataId), d = e.readSync(l.dataId), [f, h] = Pz(m, d, n, s, a, i, p, u); - return [e.makeTensorInfo([f.length], "string", f), e.makeTensorInfo(l.shape, "int32", h)]; -} -var DU = { kernelName: Ca, backendName: "webgpu", kernelFunc: yce }; -var bce = et({ opType: fe.SUB, cpuKernelImpl: Oz, supportsComplex: true }); -var AU = { kernelName: Ts, backendName: "webgpu", kernelFunc: bce }; -var Cce = ye({ opType: Z.TAN }); -var FU = { kernelName: _s, backendName: "webgpu", kernelFunc: Cce }; -var wce = ye({ opType: Z.TANH }); -var PU = { kernelName: $s, backendName: "webgpu", kernelFunc: wce }; -function Sce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { tensor: n, indices: s, updates: a } = t8, {} = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: c, outputSize: l } = w.calculateShapes(a, s, n.shape), m = [l / u, u]; - if (l === 0) - return e.makeTensorInfo(n.shape, s.dtype); - let d = [], f = pe({ inputs: { x: s }, backend: e, attrs: { shape: [p, i] } }); +var r42 = { kernelName: Os, backendName: "webgpu", kernelFunc: eme }; +function tme(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { separator: n, nGramWidths: s, leftPad: a, rightPad: i, padWidth: p, preserveShortSequences: u } = o, { data: l, dataSplits: c } = e, m = t10.readSync(l.dataId), d = t10.readSync(c.dataId), [f, h] = aW(m, d, n, s, a, i, p, u); + return [t10.makeTensorInfo([f.length], "string", f), t10.makeTensorInfo(c.shape, "int32", h)]; +} +var o4 = { kernelName: Na, backendName: "webgpu", kernelFunc: tme }; +var rme = tt({ opType: fe.SUB, cpuKernelImpl: iW, supportsComplex: true }); +var n4 = { kernelName: Oo, backendName: "webgpu", kernelFunc: rme }; +var ome = ye({ opType: Z.TAN }); +var s4 = { kernelName: Ms, backendName: "webgpu", kernelFunc: ome }; +var nme = ye({ opType: Z.TANH }); +var a4 = { kernelName: Ls, backendName: "webgpu", kernelFunc: nme }; +function sme(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { tensor: n, indices: s, updates: a } = e, {} = o, { sliceRank: i, numUpdates: p, sliceSize: u, strides: l, outputSize: c } = C.calculateShapes(a, s, n.shape), m = [c / u, u]; + if (c === 0) + return t10.makeTensorInfo(n.shape, s.dtype); + let d = [], f = le({ inputs: { x: s }, backend: t10, attrs: { shape: [p, i] } }); d.push(f); - let h = pe({ inputs: { x: a }, backend: e, attrs: { shape: [p, u] } }); + let h = le({ inputs: { x: a }, backend: t10, attrs: { shape: [p, u] } }); d.push(h); - let g = pe({ inputs: { x: n }, backend: e, attrs: { shape: m } }); + let g = le({ inputs: { x: n }, backend: t10, attrs: { shape: m } }); d.push(g); - let x = ym({ inputs: { x: g }, backend: e, attrs: { reps: Array(m.length).fill(1) } }), b = new za([p, u], i, f.shape.length, h.shape.length, c, m, n.dtype, false), C = y.sizeFromShape([p, u]), S = [{ type: "int32", data: [i] }, { type: "int32", data: c }, { type: "int32", data: [C] }], k = e.runWebGPUProgram(b, [h, f], g.dtype, S, x); + let x = $m({ inputs: { x: g }, backend: t10, attrs: { reps: Array(m.length).fill(1) } }), b = new qa([p, u], i, f.shape.length, h.shape.length, l, m, n.dtype, false), w = y.sizeFromShape([p, u]), S = [{ type: "int32", data: [i] }, { type: "int32", data: l }, { type: "int32", data: [w] }], k = t10.runWebGPUProgram(b, [h, f], g.dtype, S, x); d.push(k); - let _ = pe({ inputs: { x: k }, backend: e, attrs: { shape: n.shape } }); - return d.forEach((E) => e.disposeData(E.dataId)), _; + let T = le({ inputs: { x: k }, backend: t10, attrs: { shape: n.shape } }); + return d.forEach((E) => t10.disposeData(E.dataId)), T; } -var OU = { kernelName: ds, backendName: "webgpu", kernelFunc: Sce }; -var hy = class { - constructor(t8) { - this.variableNames = ["x", "indices"], this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = `inputSize : i32, firstPass : i32, negativeInf : f32, +var i4 = { kernelName: ks, backendName: "webgpu", kernelFunc: sme }; +var Ey = class { + constructor(e) { + this.variableNames = ["x", "indices"], this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = `inputSize : i32, firstPass : i32, negativeInf : f32, dir : i32, inc : i32,`, this.shaderKey = "swap"; } getUserCode() { @@ -33123,9 +34265,9 @@ var hy = class { `; } }; -var gy = class { - constructor(t8) { - this.variableNames = ["x", "indices"], this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = "inputSize : i32, firstPass : i32, k : i32,", this.shaderKey = "merge"; +var $y = class { + constructor(e) { + this.variableNames = ["x", "indices"], this.workgroupSize = [256, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.uniforms = "inputSize : i32, firstPass : i32, k : i32,", this.shaderKey = "merge"; } getUserCode() { return ` @@ -33190,54 +34332,54 @@ var gy = class { `; } }; -function el(r15, t8) { - t8 !== null && r15.disposeData(t8.dataId); +function pc(r16, e) { + e !== null && r16.disposeData(e.dataId); } -function MU(r15) { - let t8 = 1; - for (; t8 < r15; ) - t8 *= 2; - return t8; +function u4(r16) { + let e = 1; + for (; e < r16; ) + e *= 2; + return e; } -function Ice(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n } = t8, { k: s, sorted: a } = o, i = n.shape, p = i[i.length - 1]; - if (e.shouldExecuteOnCPU([n])) { - let k = e.readSync(n.dataId), [_, E] = Lz(k, i, n.dtype, s, a); - return [e.makeTensorInfo(_.shape, _.dtype, _.values), e.makeTensorInfo(E.shape, E.dtype, E.values)]; +function ame(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n } = e, { k: s, sorted: a } = o, i = n.shape, p = i[i.length - 1]; + if (t10.shouldExecuteOnCPU([n])) { + let k = t10.readSync(n.dataId), [T, E] = pW(k, i, n.dtype, s, a); + return [t10.makeTensorInfo(T.shape, T.dtype, T.values), t10.makeTensorInfo(E.shape, E.dtype, E.values)]; } if (s === 0) - return i[i.length - 1] = 0, [e.makeTensorInfo(i, n.dtype, []), e.makeTensorInfo(i, "int32", [])]; + return i[i.length - 1] = 0, [t10.makeTensorInfo(i, n.dtype, []), t10.makeTensorInfo(i, "int32", [])]; if (p === 1) - return [n, vt({ attrs: { shape: i, dtype: "int32", value: 0 }, backend: e })]; - let c = y.sizeFromShape(i) / p, l = pe({ inputs: { x: n }, attrs: { shape: [c, p] }, backend: e }), m = MU(s), d = MU(p), f = null, h = () => f === null ? [l, l] : [l, f], g = (k, _, E) => { - let R = h(), D = new hy(E), O = [{ type: "int32", data: [p] }, { type: "int32", data: [f === null ? 1 : 0] }, { type: "float32", data: [Number.NEGATIVE_INFINITY] }, { type: "int32", data: [k] }, { type: "int32", data: [_] }], M = f; - f = e.runWebGPUProgram(D, R, "int32", O), el(e, M); + return [n, Nt({ attrs: { shape: i, dtype: "int32", value: 0 }, backend: t10 })]; + let l = y.sizeFromShape(i) / p, c = le({ inputs: { x: n }, attrs: { shape: [l, p] }, backend: t10 }), m = u4(s), d = u4(p), f = null, h = () => f === null ? [c, c] : [c, f], g = (k, T, E) => { + let R = h(), D = new Ey(E), O = [{ type: "int32", data: [p] }, { type: "int32", data: [f === null ? 1 : 0] }, { type: "float32", data: [Number.NEGATIVE_INFINITY] }, { type: "int32", data: [k] }, { type: "int32", data: [T] }], M = f; + f = t10.runWebGPUProgram(D, R, "int32", O), pc(t10, M); }; for (let k = 1; k < m; k *= 2) { - let _ = k * 2; + let T = k * 2; for (let E = k; E >= 1; E /= 2) - g(_, E, [c, d]); + g(T, E, [l, d]); } for (let k = d; k > m; k /= 2) { - let _ = h(), E = new gy([c, k / 2]), D = [{ type: "int32", data: [p] }, { type: "int32", data: [f === null ? 1 : 0] }, { type: "int32", data: [m] }], P = f; - f = e.runWebGPUProgram(E, _, "int32", D), el(e, P); + let T = h(), E = new $y([l, k / 2]), D = [{ type: "int32", data: [p] }, { type: "int32", data: [f === null ? 1 : 0] }, { type: "int32", data: [m] }], F = f; + f = t10.runWebGPUProgram(E, T, "int32", D), pc(t10, F); let O = m / 2, M = O * 2; for (let L = O; L >= 1; L /= 2) g(M, L, f.shape); } let x = f; - f = Hs({ inputs: { x: f }, backend: e, attrs: { begin: 0, size: [c, s] } }), el(e, x); - let b = p0({ inputs: { x: l, indices: f }, backend: e, attrs: { axis: 1, batchDims: 1 } }); - el(e, l); - let C = i.slice(0, -1); - C.push(s), x = f, f = pe({ inputs: { x: f }, attrs: { shape: C }, backend: e }), el(e, x); + f = ea({ inputs: { x: f }, backend: t10, attrs: { begin: 0, size: [l, s] } }), pc(t10, x); + let b = Xv({ inputs: { x: c, indices: f }, backend: t10, attrs: { axis: 1, batchDims: 1 } }); + pc(t10, c); + let w = i.slice(0, -1); + w.push(s), x = f, f = le({ inputs: { x: f }, attrs: { shape: w }, backend: t10 }), pc(t10, x); let S = b; - return b = pe({ inputs: { x: b }, attrs: { shape: C }, backend: e }), el(e, S), [b, f]; + return b = le({ inputs: { x: b }, attrs: { shape: w }, backend: t10 }), pc(t10, S), [b, f]; } -var LU = { kernelName: Es, backendName: "webgpu", kernelFunc: Ice }; -var xy = class { - constructor(t8) { - this.variableNames = ["Image", "Transforms"], this.uniforms = "interpolationModeId : i32, fillModeId : i32, fillValue : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = t8, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "transform"; +var p4 = { kernelName: Bs, backendName: "webgpu", kernelFunc: ame }; +var Ry = class { + constructor(e) { + this.variableNames = ["Image", "Transforms"], this.uniforms = "interpolationModeId : i32, fillModeId : i32, fillValue : f32,", this.workgroupSize = [64, 1, 1], this.size = true, this.outputShape = e, this.dispatchLayout = X(this.outputShape), this.dispatch = H(this.dispatchLayout, this.outputShape, this.workgroupSize), this.shaderKey = "transform"; } getUserCode() { return ` @@ -33359,49 +34501,49 @@ var xy = class { `; } }; -function vce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { image: n, transforms: s } = t8, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = o, [c, l, m, d] = n.shape, [f, h] = u != null ? u : [l, m], g = [c, f, h, d], x = new xy(g), b = a === "nearest" ? 1 : 2, C; +function ime(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { image: n, transforms: s } = e, { interpolation: a, fillMode: i, fillValue: p, outputShape: u } = o, [l, c, m, d] = n.shape, [f, h] = u != null ? u : [c, m], g = [l, f, h, d], x = new Ry(g), b = a === "nearest" ? 1 : 2, w; switch (i) { case "constant": - C = 1; + w = 1; break; case "reflect": - C = 2; + w = 2; break; case "wrap": - C = 3; + w = 3; break; case "nearest": - C = 4; + w = 4; break; default: - C = 1; + w = 1; break; } - let S = [{ type: "int32", data: [b] }, { type: "int32", data: [C] }, { type: "float32", data: [p] }]; - return e.runWebGPUProgram(x, [n, s], "float32", S); + let S = [{ type: "int32", data: [b] }, { type: "int32", data: [w] }, { type: "float32", data: [p] }]; + return t10.runWebGPUProgram(x, [n, s], "float32", S); } -var BU = { kernelName: Rs, backendName: "webgpu", kernelFunc: vce }; -function kce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { value: n } = t8, { axis: s } = o; +var l4 = { kernelName: zs, backendName: "webgpu", kernelFunc: ime }; +function ume(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { value: n } = e, { axis: s } = o; s < 0 && (s += n.shape.length); - let a = n, i = a.shape.length, p = n.shape[s], u = new Array(i - 1), c = 0; + let a = n, i = a.shape.length, p = n.shape[s], u = new Array(i - 1), l = 0; for (let h = 0; h < i; h++) - h !== s && (u[c++] = a.shape[h]); - let l = [], m = new Array(i).fill(0), d = a.shape.slice(); + h !== s && (u[l++] = a.shape[h]); + let c = [], m = new Array(i).fill(0), d = a.shape.slice(); d[s] = 1; let f = new Array(p); for (let h = 0; h < f.length; h++) { m[s] = h; - let g = Hs({ inputs: { x: a }, backend: e, attrs: { begin: m, size: d } }), x = pe({ inputs: { x: g }, backend: e, attrs: { shape: u } }); - f[h] = x, l.push(g); + let g = ea({ inputs: { x: a }, backend: t10, attrs: { begin: m, size: d } }), x = le({ inputs: { x: g }, backend: t10, attrs: { shape: u } }); + f[h] = x, c.push(g); } - return l.forEach((h) => e.disposeData(h.dataId)), f; + return c.forEach((h) => t10.disposeData(h.dataId)), f; } -var zU = { kernelName: wa, backendName: "webgpu", kernelFunc: kce }; -var yy = class { - constructor(t8, e, o) { - if (this.outputShape = [], this.variableNames = ["x", "segmentIds"], this.uniforms = "numSegments : i32, xSize: i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = e, this.dispatchLayout = X(t8), this.dispatch = H(this.dispatchLayout, t8, this.workgroupSize), o !== "float32" && o !== "int32") +var c4 = { kernelName: Ta, backendName: "webgpu", kernelFunc: ume }; +var Dy = class { + constructor(e, t10, o) { + if (this.outputShape = [], this.variableNames = ["x", "segmentIds"], this.uniforms = "numSegments : i32, xSize: i32,", this.workgroupSize = [64, 1, 1], this.atomic = true, this.outputShape = t10, this.dispatchLayout = X(e), this.dispatch = H(this.dispatchLayout, e, this.workgroupSize), o !== "float32" && o !== "int32") throw new Error(`UnsortedSegmentSum only supports float32 and int32 types, does not support ${o} type.`); this.type = o, this.shaderKey = "unsortedSegmentSum"; @@ -33419,40 +34561,40 @@ var yy = class { let flatIndex = b * uniforms.numSegments + segmentId % uniforms.numSegments; let value = getX(b, inCol); - ${Yr("&result[flatIndex]", "value", this.type)} + ${oo("&result[flatIndex]", "value", this.type)} } } } `; } }; -function Nce(r15) { - let { inputs: t8, backend: e, attrs: o } = r15, { x: n, segmentIds: s } = t8, { numSegments: a } = o, i = n.shape.length, p = [], u = 0, c = w.getAxesPermutation([u], i), l = n; - c != null && (l = xr({ inputs: { x: n }, backend: e, attrs: { perm: c } }), p.push(l), u = w.getInnerMostAxes(1, i)[0]); - let m = w.segment_util.computeOutShape(l.shape, u, a), d = y.sizeFromShape([l.shape[u]]), f = pe({ inputs: { x: l }, backend: e, attrs: { shape: [-1, d] } }); +function pme(r16) { + let { inputs: e, backend: t10, attrs: o } = r16, { x: n, segmentIds: s } = e, { numSegments: a } = o, i = n.shape.length, p = [], u = 0, l = C.getAxesPermutation([u], i), c = n; + l != null && (c = Cr({ inputs: { x: n }, backend: t10, attrs: { perm: l } }), p.push(c), u = C.getInnerMostAxes(1, i)[0]); + let m = C.segment_util.computeOutShape(c.shape, u, a), d = y.sizeFromShape([c.shape[u]]), f = le({ inputs: { x: c }, backend: t10, attrs: { shape: [-1, d] } }); p.push(f); - let h = n.dtype, g = [f.shape[0], a], x = vt({ backend: e, attrs: { shape: g, value: 0, dtype: h } }), b = new yy(f.shape, g, h), C = [{ type: "int32", data: [a] }, { type: "int32", data: [y.sizeFromShape(f.shape)] }], S = e.runWebGPUProgram(b, [f, s], h, C, x), k = pe({ inputs: { x: S }, backend: e, attrs: { shape: m } }); + let h = n.dtype, g = [f.shape[0], a], x = Nt({ backend: t10, attrs: { shape: g, value: 0, dtype: h } }), b = new Dy(f.shape, g, h), w = [{ type: "int32", data: [a] }, { type: "int32", data: [y.sizeFromShape(f.shape)] }], S = t10.runWebGPUProgram(b, [f, s], h, w, x), k = le({ inputs: { x: S }, backend: t10, attrs: { shape: m } }); p.push(S); - let _ = k; - if (c != null) { + let T = k; + if (l != null) { p.push(k); - let E = w.getUndoAxesPermutation(c); - _ = xr({ inputs: { x: _ }, backend: e, attrs: { perm: E } }); - } - return p.forEach((E) => e.disposeData(E.dataId)), _; -} -var VU = { kernelName: Yi, backendName: "webgpu", kernelFunc: Nce }; -var Tce = [oz, zz, Vz, Wz, Uz, Gz, Kz, qz, jz, Xz, Yz, Qz, Zz, Jz, eV, oV, nV, sV, aV, iV, pV, cV, lV, hV, gV, xV, sz, bV, wV, SV, IV, vV, kV, NV, TV, _V, $V, EV, AV, FV, PV, OV, LV, BV, MV, zV, VV, WV, UV, GV, qV, jV, XV, YV, QV, ZV, JV, eW, tW, tz, rW, sW, oW, nW, aW, iW, uW, pW, cW, lW, mW, nz, dW, CV, fW, hW, gW, xW, yW, bW, CW, SW, wW, IW, vW, kW, TW, _W, tV, $W, EW, AW, RW, DW, FW, rV, PW, OW, MW, LW, zW, HV, VW, WW, UW, mV, GW, qW, jW, XW, YW, QW, ZW, JW, dV, eU, tU, rU, oU, rz, nU, sU, aU, iU, uU, pU, cU, lU, mU, dU, fU, hU, gU, xU, yU, bU, uV, EU, RU, DU, BW, CU, wU, SU, IU, kU, NU, TU, _U, $U, AU, KV, FU, PU, OU, vU, LU, BU, Hz, zU, VU, HW]; -for (let r15 of Tce) - ti(r15); -var WU = "4.14.0"; -var _ce = "4.14.0"; -var $ce = "4.14.0"; -var Ece = "4.14.0"; -var Rce = "4.14.0"; -var Dce = "4.14.0"; -var Ace = { tfjs: WU, "tfjs-core": WU, "tfjs-converter": _ce, "tfjs-backend-cpu": $ce, "tfjs-backend-webgl": Ece, "tfjs-backend-wasm": Rce, "tfjs-backend-webgpu": Dce }; -var bQt = void 0; + let E = C.getUndoAxesPermutation(l); + T = Cr({ inputs: { x: T }, backend: t10, attrs: { perm: E } }); + } + return p.forEach((E) => t10.disposeData(E.dataId)), T; +} +var m4 = { kernelName: su, backendName: "webgpu", kernelFunc: pme }; +var lme = [jz, cW, mW, dW, fW, hW, xW, yW, bW, CW, wW, SW, IW, vW, kW, _W, EW, $W, RW, DW, FW, PW, OW, zW, VW, WW, Yz, GW, KW, qW, jW, XW, YW, QW, ZW, JW, eU, tU, nU, sU, aU, iU, pU, lU, uU, cU, mU, dU, fU, hU, yU, bU, CU, wU, SU, IU, vU, kU, NU, Kz, TU, $U, _U, EU, RU, DU, AU, FU, PU, OU, MU, Xz, LU, HW, BU, zU, VU, WU, UU, GU, HU, qU, KU, jU, XU, YU, ZU, JU, NW, eG, tG, nG, rG, oG, sG, TW, aG, iG, uG, pG, cG, gU, mG, dG, fG, MW, hG, yG, bG, CG, wG, SG, IG, vG, LW, kG, NG, TG, _G, qz, EG, $G, RG, DG, AG, FG, PG, OG, MG, LG, BG, zG, VG, WG, UG, GG, AW, t4, r42, o4, lG, HG, KG, qG, jG, YG, QG, ZG, JG, e4, n4, xU, s4, a4, i4, XG, p4, l4, gW, c4, m4, gG]; +for (let r16 of lme) + li(r16); +var d4 = "4.17.0"; +var cme = "4.17.0"; +var mme = "4.17.0"; +var dme = "4.17.0"; +var fme = "4.17.0"; +var hme = "4.14.0"; +var gme = { tfjs: d4, "tfjs-core": d4, "tfjs-converter": cme, "tfjs-backend-cpu": mme, "tfjs-backend-webgl": dme, "tfjs-backend-wasm": fme, "tfjs-backend-webgpu": hme }; +var qtr = void 0; // src/util/util.ts function log(...msg) { @@ -33560,6 +34702,7 @@ var config = { minConfidence: 0.2, minSize: 0, iouThreshold: 0.1, + scale: 1.4, mask: false, return: false }, @@ -33574,6 +34717,7 @@ var config = { }, iris: { enabled: true, + scale: 2.3, modelPath: "iris.json" }, emotion: { @@ -33746,8 +34890,8 @@ var convolution = ` // src/image/imagefx.ts var collect = (source, prefix, collection) => { - const r15 = new RegExp("\\b" + prefix + " \\w+ (\\w+)", "ig"); - source.replace(r15, (match2, name) => { + const r16 = new RegExp("\\b" + prefix + " \\w+ (\\w+)", "ig"); + source.replace(r16, (match2, name) => { collection[name] = 0; return match2; }); @@ -33937,20 +35081,20 @@ function GLImageFilter() { }, saturation: (amount) => { const x = (amount || 0) * 2 / 3 + 1; - const y8 = (x - 1) * -0.5; + const y4 = (x - 1) * -0.5; filter.colorMatrix([ x, - y8, - y8, + y4, + y4, 0, 0, - y8, + y4, x, - y8, + y4, 0, 0, - y8, - y8, + y4, + y4, x, 0, 0, @@ -33965,22 +35109,22 @@ function GLImageFilter() { filter.saturation(-1); }, contrast: (amount) => { - const v10 = (amount || 0) + 1; - const o = -128 * (v10 - 1); + const v4 = (amount || 0) + 1; + const o = -128 * (v4 - 1); filter.colorMatrix([ - v10, + v4, 0, 0, 0, o, 0, - v10, + v4, 0, 0, o, 0, 0, - v10, + v4, 0, o, 0, @@ -34351,10 +35495,10 @@ function GLImageFilter() { // src/image/enhance.ts async function histogramEqualization(inputImage) { - const squeeze = inputImage.shape.length === 4 ? uc(inputImage) : inputImage; - const rgb3 = ci(squeeze, 3, 2); - const min = [vl(rgb3[0]), vl(rgb3[1]), vl(rgb3[2])]; - const max = [Ra(rgb3[0]), Ra(rgb3[1]), Ra(rgb3[2])]; + const squeeze = inputImage.shape.length === 4 ? gl(inputImage) : inputImage; + const rgb3 = Ci(squeeze, 3, 2); + const min = [Ac(rgb3[0]), Ac(rgb3[1]), Ac(rgb3[2])]; + const max = [La(rgb3[0]), La(rgb3[1]), La(rgb3[2])]; const absMax = await Promise.all(max.map((channel) => channel.data())); const maxValue = Math.max(absMax[0][0], absMax[1][0], absMax[2][0]); const maxRange = maxValue > 1 ? 255 : 1; @@ -34364,13 +35508,13 @@ async function histogramEqualization(inputImage) { const sub = [Te(rgb3[0], min[0]), Te(rgb3[1], min[1]), Te(rgb3[2], min[2])]; const range = [Te(max[0], min[0]), Te(max[1], min[1]), Te(max[2], min[2])]; const enh = [se(sub[0], factor), se(sub[1], factor), se(sub[2], factor)]; - const stack = vr([enh[0], enh[1], enh[2]], 2); + const stack = Tr([enh[0], enh[1], enh[2]], 2); final = W(stack, [1, squeeze.shape[0] || 0, squeeze.shape[1] || 0, 3]); - Ot([...sub, ...range, ...enh, stack]); + Lt([...sub, ...range, ...enh, stack]); } else { - final = Ms(squeeze, 0); + final = Ks(squeeze, 0); } - Ot([...rgb3, ...min, ...max, rgb3, squeeze, inputImage]); + Lt([...rgb3, ...min, ...max, rgb3, squeeze, inputImage]); return final; } @@ -34430,16 +35574,16 @@ function copy(input, output) { return outputCanvas; } async function process2(input, config3, getTensor = true) { - var _a, _b, _c2; + var _a2, _b, _c2; if (!input) { if (config3.debug) log("input error: input is missing"); return { tensor: null, canvas: null }; } - if (!(input instanceof mt) && !(typeof Image !== "undefined" && input instanceof Image) && !(typeof globalThis.Canvas !== "undefined" && input instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input instanceof OffscreenCanvas)) { + if (!(input instanceof dt) && !(typeof Image !== "undefined" && input instanceof Image) && !(typeof globalThis.Canvas !== "undefined" && input instanceof globalThis.Canvas) && !(typeof ImageData !== "undefined" && input instanceof ImageData) && !(typeof ImageBitmap !== "undefined" && input instanceof ImageBitmap) && !(typeof HTMLImageElement !== "undefined" && input instanceof HTMLImageElement) && !(typeof HTMLMediaElement !== "undefined" && input instanceof HTMLMediaElement) && !(typeof HTMLVideoElement !== "undefined" && input instanceof HTMLVideoElement) && !(typeof HTMLCanvasElement !== "undefined" && input instanceof HTMLCanvasElement) && !(typeof OffscreenCanvas !== "undefined" && input instanceof OffscreenCanvas)) { throw new Error("input error: type not recognized"); } - if (input instanceof mt) { + if (input instanceof dt) { let tensor2 = null; if (input["isDisposedInternal"]) throw new Error("input error: attempted to use tensor but it is disposed"); @@ -34447,24 +35591,24 @@ async function process2(input, config3, getTensor = true) { throw new Error("input error: attempted to use tensor without a shape"); if (input.shape.length === 3) { if (input.shape[2] === 3) { - tensor2 = Ms(input, 0); + tensor2 = Ks(input, 0); } else if (input.shape[2] === 4) { - const rgb3 = F1(input, [0, 0, 0], [-1, -1, 3]); - tensor2 = Ms(rgb3, 0); - Ot(rgb3); + const rgb3 = vN(input, [0, 0, 0], [-1, -1, 3]); + tensor2 = Ks(rgb3, 0); + Lt(rgb3); } } else if (input.shape.length === 4) { if (input.shape[3] === 3) { - tensor2 = Wr(input); + tensor2 = Xr(input); } else if (input.shape[3] === 4) { - tensor2 = P1(input, [0, 0, 0, 0], [-1, -1, -1, 3]); + tensor2 = kN(input, [0, 0, 0, 0], [-1, -1, -1, 3]); } } if (tensor2 == null || tensor2.shape.length !== 4 || tensor2.shape[0] !== 1 || tensor2.shape[3] !== 3) throw new Error(`input error: attempted to use tensor with unrecognized shape: ${input.shape.toString()}`); if (tensor2.dtype === "int32") { - const cast = We(tensor2, "float32"); - Ot(tensor2); + const cast = Ue(tensor2, "float32"); + Lt(tensor2); tensor2 = cast; } return { tensor: tensor2, canvas: config3.filter.return ? outCanvas : null }; @@ -34491,7 +35635,7 @@ async function process2(input, config3, getTensor = true) { targetHeight = maxSize; targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight); } - if ((((_a = config3.filter) == null ? void 0 : _a.width) || 0) > 0) + if ((((_a2 = config3.filter) == null ? void 0 : _a2.width) || 0) > 0) targetWidth = config3.filter.width; else if ((((_b = config3.filter) == null ? void 0 : _b.height) || 0) > 0) targetWidth = originalWidth * ((config3.filter.height || 0) / originalHeight); @@ -34576,22 +35720,22 @@ async function process2(input, config3, getTensor = true) { let pixels; let depth = 3; if (typeof ImageData !== "undefined" && input instanceof ImageData || input.data && input.width && input.height) { - if (env.browser && nT) { - pixels = nT ? nT.fromPixels(input) : null; + if (env.browser && XT) { + pixels = XT ? XT.fromPixels(input) : null; } else { depth = input.data.length / input.height / input.width; const arr = new Uint8Array(input.data.buffer); - pixels = ar(arr, [input.height, input.width, depth], "int32"); + pixels = pr(arr, [input.height, input.width, depth], "int32"); } } else { if (!tmpCanvas || outCanvas.width !== tmpCanvas.width || outCanvas.height !== tmpCanvas.height) tmpCanvas = canvas(outCanvas.width, outCanvas.height); - if (nT && env.browser) { + if (XT && env.browser) { if (config3.backend === "webgl" || config3.backend === "humangl" || config3.backend === "webgpu") { - pixels = nT.fromPixels(outCanvas); + pixels = XT.fromPixels(outCanvas); } else { tmpCanvas = copy(outCanvas); - pixels = nT.fromPixels(tmpCanvas); + pixels = XT.fromPixels(tmpCanvas); } } else { const tempCanvas = copy(outCanvas); @@ -34599,24 +35743,24 @@ async function process2(input, config3, getTensor = true) { const tempData = tempCtx.getImageData(0, 0, targetWidth, targetHeight); depth = tempData.data.length / targetWidth / targetHeight; const arr = new Uint8Array(tempData.data.buffer); - pixels = ar(arr, [targetWidth, targetHeight, depth]); + pixels = pr(arr, [targetWidth, targetHeight, depth]); } } if (depth === 4) { - const rgb3 = F1(pixels, [0, 0, 0], [-1, -1, 3]); - Ot(pixels); + const rgb3 = vN(pixels, [0, 0, 0], [-1, -1, 3]); + Lt(pixels); pixels = rgb3; } if (!pixels) throw new Error("input error: cannot create tensor"); - const casted = We(pixels, "float32"); - const tensor = config3.filter.equalization ? await histogramEqualization(casted) : Ms(casted, 0); - Ot([pixels, casted]); + const casted = Ue(pixels, "float32"); + const tensor = config3.filter.equalization ? await histogramEqualization(casted) : Ks(casted, 0); + Lt([pixels, casted]); if (config3.filter.autoBrightness) { - const max = Ra(tensor); + const max = La(tensor); const maxVal = await max.data(); config3.filter.brightness = maxVal[0] > 1 ? 1 - maxVal[0] / 255 : 1 - maxVal[0]; - Ot(max); + Lt(max); } return { tensor, canvas: config3.filter.return ? outCanvas : null }; } @@ -34625,25 +35769,25 @@ async function skip(config3, input) { if (config3.cacheSensitivity === 0 || !input.shape || input.shape.length !== 4 || input.shape[1] > 3840 || input.shape[2] > 2160) return skipFrame; if (!last.inputTensor) { - last.inputTensor = Wr(input); + last.inputTensor = Xr(input); } else if (last.inputTensor.shape[1] !== input.shape[1] || last.inputTensor.shape[2] !== input.shape[2]) { - Ot(last.inputTensor); - last.inputTensor = Wr(input); + Lt(last.inputTensor); + last.inputTensor = Xr(input); } else { - const t8 = {}; - t8.diff = Te(input, last.inputTensor); - t8.squared = se(t8.diff, t8.diff); - t8.sum = ot(t8.squared); - const diffSum = await t8.sum.data(); + const t10 = {}; + t10.diff = Te(input, last.inputTensor); + t10.squared = se(t10.diff, t10.diff); + t10.sum = ot(t10.squared); + const diffSum = await t10.sum.data(); const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; - Ot([last.inputTensor, t8.diff, t8.squared, t8.sum]); - last.inputTensor = Wr(input); + Lt([last.inputTensor, t10.diff, t10.squared, t10.sum]); + last.inputTensor = Xr(input); skipFrame = diffRelative <= (config3.cacheSensitivity || 0); } return skipFrame; } async function compare(config3, input1, input2) { - const t8 = {}; + const t10 = {}; if (!input1 || !input2 || input1.shape.length !== 4 || input1.shape.length !== input2.shape.length) { if (!config3.debug) log("invalid input tensor or tensor shapes do not match:", input1.shape, input2.shape); @@ -34654,14 +35798,14 @@ async function compare(config3, input1, input2) { log("input tensors must be of shape [1, height, width, 3]:", input1.shape, input2.shape); return 0; } - t8.input1 = Wr(input1); - t8.input2 = input1.shape[1] !== input2.shape[1] || input1.shape[2] !== input2.shape[2] ? Kj.resizeBilinear(input2, [input1.shape[1], input1.shape[2]]) : Wr(input2); - t8.diff = Te(t8.input1, t8.input2); - t8.squared = se(t8.diff, t8.diff); - t8.sum = ot(t8.squared); - const diffSum = await t8.sum.data(); + t10.input1 = Xr(input1); + t10.input2 = input1.shape[1] !== input2.shape[1] || input1.shape[2] !== input2.shape[2] ? b5.resizeBilinear(input2, [input1.shape[1], input1.shape[2]]) : Xr(input2); + t10.diff = Te(t10.input1, t10.input2); + t10.squared = se(t10.diff, t10.diff); + t10.sum = ot(t10.squared); + const diffSum = await t10.sum.data(); const diffRelative = diffSum[0] / (input1.shape[1] || 1) / (input1.shape[2] || 1) / 255 / 3; - Ot([t8.input1, t8.input2, t8.diff, t8.squared, t8.sum]); + Lt([t10.input1, t10.input2, t10.diff, t10.squared, t10.sum]); return diffRelative; } @@ -34731,7 +35875,7 @@ var Env = class { __privateAdd(this, _imageData, void 0); this.browser = typeof navigator !== "undefined" && typeof navigator.appVersion !== "undefined"; this.node = typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined"; - this.tfjs = { version: Ace["tfjs-core"] }; + this.tfjs = { version: gme["tfjs-core"] }; this.offscreen = typeof OffscreenCanvas !== "undefined"; this.initial = true; this.worker = this.browser && this.offscreen ? typeof WorkerGlobalScope !== "undefined" : void 0; @@ -34776,11 +35920,11 @@ var Env = class { } /** update backend information */ async updateBackend() { - this.backends = Object.keys(ur().registryFactory); + this.backends = Object.keys(cr().registryFactory); try { this.tensorflow = { - version: vde()["binding"] ? vde()["binding"].TF_Version : void 0, - gpu: vde()["binding"] ? vde()["binding"].isUsingGpuDevice() : void 0 + version: Hk()["binding"] ? Hk()["binding"].TF_Version : void 0, + gpu: Hk()["binding"] ? Hk()["binding"].isUsingGpuDevice() : void 0 }; } catch (e) { } @@ -34811,7 +35955,7 @@ var Env = class { this.webgpu.supported = false; } try { - this.kernels = jm(Cde()).map((kernel) => kernel.kernelName.toLowerCase()); + this.kernels = ad(Gk()).map((kernel) => kernel.kernelName.toLowerCase()); } catch (e) { } } @@ -34854,7 +35998,7 @@ var WebCam = class { }); /** start method initializizes webcam stream and associates it with a dom video element */ __publicField(this, "start", async (webcamConfig) => { - var _a, _b; + var _a2, _b; if (webcamConfig == null ? void 0 : webcamConfig.debug) this.config.debug = webcamConfig == null ? void 0 : webcamConfig.debug; if (webcamConfig == null ? void 0 : webcamConfig.crop) @@ -34895,7 +36039,7 @@ var WebCam = class { resizeMode: this.config.crop ? "crop-and-scale" : "none" } }; - if (((_a = this.config) == null ? void 0 : _a.width) > 0) + if (((_a2 = this.config) == null ? void 0 : _a2.width) > 0) requestedConstraints.video.width = { ideal: this.config.width }; if (((_b = this.config) == null ? void 0 : _b.height) > 0) requestedConstraints.video.height = { ideal: this.config.height }; @@ -35015,18 +36159,18 @@ var WebCam = class { } /** is webcam paused */ get paused() { - var _a; - return ((_a = this.element) == null ? void 0 : _a.paused) || false; + var _a2; + return ((_a2 = this.element) == null ? void 0 : _a2.paused) || false; } /** webcam current width */ get width() { - var _a; - return ((_a = this.element) == null ? void 0 : _a.videoWidth) || 0; + var _a2; + return ((_a2 = this.element) == null ? void 0 : _a2.videoWidth) || 0; } /** webcam current height */ get height() { - var _a; - return ((_a = this.element) == null ? void 0 : _a.videoHeight) || 0; + var _a2; + return ((_a2 = this.element) == null ? void 0 : _a2.videoHeight) || 0; } }; @@ -35232,7 +36376,7 @@ function setModelLoadOptions(config3) { options.modelBasePath = config3.modelBasePath; } async function loadModel(modelPath) { - var _a, _b, _c2, _d2; + var _a2, _b, _c2, _d2; let modelUrl = join(options.modelBasePath, modelPath || ""); if (!modelUrl.toLowerCase().endsWith(".json")) modelUrl += ".json"; @@ -35250,14 +36394,14 @@ async function loadModel(modelPath) { options.cacheSupported = typeof indexedDB !== "undefined"; let cachedModels = {}; try { - cachedModels = options.cacheSupported && options.cacheModels ? await mi.listModels() : {}; + cachedModels = options.cacheSupported && options.cacheModels ? await Si.listModels() : {}; } catch (e) { options.cacheSupported = false; } modelStats[shortModelName].inCache = options.cacheSupported && options.cacheModels && Object.keys(cachedModels).includes(cachedModelName); modelStats[shortModelName].url = modelStats[shortModelName].inCache ? cachedModelName : modelUrl; const tfLoadOptions = typeof fetch === "undefined" ? {} : { fetchFunc: (url, init4) => httpHandler(url, init4) }; - let model23 = new Ml(modelStats[shortModelName].url, tfLoadOptions); + let model23 = new Kc(modelStats[shortModelName].url, tfLoadOptions); let loaded = false; try { model23.findIOHandler(); @@ -35267,12 +36411,12 @@ async function loadModel(modelPath) { log("error finding model i/o handler:", modelUrl, err); } try { - const artifacts = await ((_a = model23.handler) == null ? void 0 : _a.load()) || null; + const artifacts = await ((_a2 = model23.handler) == null ? void 0 : _a2.load()) || null; modelStats[shortModelName].sizeFromManifest = ((_b = artifacts == null ? void 0 : artifacts.weightData) == null ? void 0 : _b.byteLength) || 0; if (artifacts) model23.loadSync(artifacts); else - model23 = await $8(modelStats[shortModelName].inCache ? cachedModelName : modelUrl, tfLoadOptions); + model23 = await r72(modelStats[shortModelName].inCache ? cachedModelName : modelUrl, tfLoadOptions); modelStats[shortModelName].sizeLoadedWeights = ((_d2 = (_c2 = model23.artifacts) == null ? void 0 : _c2.weightData) == null ? void 0 : _d2.byteLength) || 0; if (options.verbose) log("load:", { model: shortModelName, url: model23["modelUrl"], bytes: modelStats[shortModelName].sizeLoadedWeights }); @@ -35293,7 +36437,7 @@ async function loadModel(modelPath) { } // package.json -var version = "3.2.0"; +var version = "3.2.1"; // src/tfjs/humangl.ts var config2 = { @@ -35323,14 +36467,14 @@ function extensions() { config2.extensions = gl2.getSupportedExtensions(); } function register(instance) { - var _a; + var _a2; if (instance.config.backend !== "humangl") return; - if (config2.name in ur().registry && !((_a = config2 == null ? void 0 : config2.gl) == null ? void 0 : _a.getParameter(config2.gl.VERSION))) { + if (config2.name in cr().registry && !((_a2 = config2 == null ? void 0 : config2.gl) == null ? void 0 : _a2.getParameter(config2.gl.VERSION))) { log("humangl error: backend invalid context"); instance.models.reset(); } - if (!Sde(config2.name)) { + if (!efe(config2.name)) { try { config2.canvas = canvas(100, 100); } catch (err) { @@ -35368,23 +36512,23 @@ function register(instance) { return; } try { - kI(2, config2.gl); + BI(2, config2.gl); } catch (err) { log("humangl error: cannot set webgl context:", err); return; } try { - const ctx = new xp(config2.gl); - tu(config2.name, () => new Oc(ctx), config2.priority); + const ctx = new kp(config2.gl); + pu(config2.name, () => new Ul(ctx), config2.priority); } catch (err) { log("humangl error: cannot register webgl backend:", err); return; } try { - const kernels = jm("webgl"); + const kernels = ad("webgl"); kernels.forEach((kernelConfig) => { const newKernelConfig = { ...kernelConfig, backendName: config2.name }; - ti(newKernelConfig); + li(newKernelConfig); }); } catch (err) { log("humangl error: cannot update webgl backend registration:", err); @@ -35398,7 +36542,7 @@ function register(instance) { return; } extensions(); - const backend = vde(); + const backend = Hk(); const current = typeof backend["gpgpu"] !== "undefined" ? backend["getGPGPUContext"]().gl : null; if (current) { if (instance.config.debug) @@ -35424,14 +36568,14 @@ function init() { constants.tf2 = ke(2, "float32"); constants.tf05 = ke(0.5, "float32"); constants.tf127 = ke(127.5, "float32"); - constants.rgb = Jt([0.2989, 0.587, 0.114], "float32"); + constants.rgb = rr([0.2989, 0.587, 0.114], "float32"); } // src/tfjs/backend.ts async function getBestBackend() { - var _a; + var _a2; await env.updateBackend(); - if ((_a = env.tensorflow) == null ? void 0 : _a.version) + if ((_a2 = env.tensorflow) == null ? void 0 : _a2.version) return "tensorflow"; if (env.webgpu.supported && env.webgpu.backend) return "webgpu"; @@ -35446,36 +36590,36 @@ function registerCustomOps(config3) { if (!env.kernels.includes("mod")) { const kernelMod = { kernelName: "Mod", - backendName: Cde(), - kernelFunc: (op2) => De(() => Te(op2.inputs.a, se(je(op2.inputs.a, op2.inputs.b), op2.inputs.b))) + backendName: Gk(), + kernelFunc: (op2) => De(() => Te(op2.inputs.a, se(Xe(op2.inputs.a, op2.inputs.b), op2.inputs.b))) }; - ti(kernelMod); + li(kernelMod); env.kernels.push("mod"); newKernels.push("mod"); } if (!env.kernels.includes("floormod")) { const kernelFloorMod = { kernelName: "FloorMod", - backendName: Cde(), - kernelFunc: (op2) => De(() => Ce(se(ld(op2.inputs.a, op2.inputs.b), op2.inputs.b), P2(op2.inputs.a, op2.inputs.b))) + backendName: Gk(), + kernelFunc: (op2) => De(() => Ce(se(Sd(op2.inputs.a, op2.inputs.b), op2.inputs.b), k2(op2.inputs.a, op2.inputs.b))) }; - ti(kernelFloorMod); + li(kernelFloorMod); env.kernels.push("floormod"); newKernels.push("floormod"); } if (!env.kernels.includes("rotatewithoffset") && config3.softwareKernels) { const kernelRotateWithOffset = { kernelName: "RotateWithOffset", - backendName: Cde(), + backendName: Gk(), kernelFunc: (op2) => De(() => { - const backend = Cde(); - yde("cpu"); - const t8 = Kj.rotateWithOffset(op2.inputs.image, op2.attrs.radians, op2.attrs.fillValue, op2.attrs.center); - yde(backend); - return t8; + const backend = Gk(); + Qde("cpu"); + const t10 = b5.rotateWithOffset(op2.inputs.image, op2.attrs.radians, op2.attrs.fillValue, op2.attrs.center); + Qde(backend); + return t10; }) }; - ti(kernelRotateWithOffset); + li(kernelRotateWithOffset); env.kernels.push("rotatewithoffset"); newKernels.push("rotatewithoffset"); } @@ -35484,11 +36628,11 @@ function registerCustomOps(config3) { } var defaultFlags = {}; async function check(instance, force = false) { - var _a, _b; + var _a2, _b; instance.state = "backend"; - if (((_a = instance.config.backend) == null ? void 0 : _a.length) === 0) + if (((_a2 = instance.config.backend) == null ? void 0 : _a2.length) === 0) instance.config.backend = await getBestBackend(); - if (force || env.initial || instance.config.backend && instance.config.backend.length > 0 && Cde() !== instance.config.backend) { + if (force || env.initial || instance.config.backend && instance.config.backend.length > 0 && Gk() !== instance.config.backend) { const timeStamp = now(); if (instance.config.backend && instance.config.backend.length > 0) { if (typeof window === "undefined" && typeof WorkerGlobalScope !== "undefined" && instance.config.debug) { @@ -35499,10 +36643,10 @@ async function check(instance, force = false) { if (instance.config.debug) log("running inside electron"); } - let available = Object.keys(ur().registryFactory); + let available = Object.keys(cr().registryFactory); if (instance.config.backend === "humangl" && !available.includes("humangl")) { register(instance); - available = Object.keys(ur().registryFactory); + available = Object.keys(cr().registryFactory); } if (instance.config.debug) log("available backends:", available); @@ -35546,17 +36690,17 @@ async function check(instance, force = false) { A().set("CANVAS2D_WILL_READ_FREQUENTLY", true); if (instance.config.debug) log("wasm path:", instance.config.wasmPath); - if (typeof Yse !== "undefined") - Yse(instance.config.wasmPath, instance.config.wasmPlatformFetch); + if (typeof Iie !== "undefined") + Iie(instance.config.wasmPath, instance.config.wasmPlatformFetch); else throw new Error("backend error: attempting to use wasm backend but wasm path is not set"); - let mt2 = false; + let mt = false; let simd = false; try { - mt2 = await A().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"); + mt = await A().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"); simd = await A().getAsync("WASM_HAS_SIMD_SUPPORT"); if (instance.config.debug) - log(`wasm execution: ${simd ? "simd" : "no simd"} ${mt2 ? "multithreaded" : "singlethreaded"}`); + log(`wasm execution: ${simd ? "simd" : "no simd"} ${mt ? "multithreaded" : "singlethreaded"}`); if (instance.config.debug && !simd) log("warning: wasm simd support is not enabled"); } catch (e) { @@ -35564,8 +36708,8 @@ async function check(instance, force = false) { } } try { - await yde(instance.config.backend); - await bde(); + await Qde(instance.config.backend); + await Zde(); } catch (err) { log("error: cannot set backend:", instance.config.backend, err); return false; @@ -35573,7 +36717,7 @@ async function check(instance, force = false) { if (instance.config.debug) defaultFlags = JSON.parse(JSON.stringify(A().flags)); } - if (Cde() === "humangl" || Cde() === "webgl") { + if (Gk() === "humangl" || Gk() === "webgl") { if (A().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) A().set("WEBGL_USE_SHAPES_UNIFORMS", true); if (A().flagRegistry.WEBGL_EXP_CONV) @@ -35583,7 +36727,7 @@ async function check(instance, force = false) { A().set("WEBGL_DELETE_TEXTURE_THRESHOLD", 0); } } - if (Cde() === "webgpu") { + if (Gk() === "webgpu") { } if (instance.config.debug) { const newFlags = A().flags; @@ -35594,7 +36738,7 @@ async function check(instance, force = false) { updatedFlags[key] = newFlags[key]; } if (instance.config.debug && Object.keys(updatedFlags).length > 0) - log("backend:", Cde(), "flags:", updatedFlags); + log("backend:", Gk(), "flags:", updatedFlags); } if (instance.config.flags && Object.keys(instance.config.flags).length > 0) { if (instance.config.debug) @@ -35603,10 +36747,10 @@ async function check(instance, force = false) { A().set(key, val); } } - lde(); + Gde(); init(); instance.performance.initBackend = Math.trunc(now() - timeStamp); - instance.config.backend = Cde(); + instance.config.backend = Gk(); await env.updateBackend(); registerCustomOps(instance.config); } @@ -35618,17 +36762,17 @@ function fakeOps(kernelNames, config3) { kernelName, backendName: config3.backend, kernelFunc: (param) => { - var _a; + var _a2; if (config3.debug) log("kernelFunc", kernelName, config3.backend, param); - return (_a = param == null ? void 0 : param.inputs) == null ? void 0 : _a.info; + return (_a2 = param == null ? void 0 : param.inputs) == null ? void 0 : _a2.info; } // setupFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); }, // disposeFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); }, }; - ti(kernelConfig); + li(kernelConfig); } - env.kernels = jm(Cde()).map((kernel) => kernel.kernelName.toLowerCase()); + env.kernels = ad(Gk()).map((kernel) => kernel.kernelName.toLowerCase()); } // src/draw/draw.ts @@ -35673,38 +36817,38 @@ function labels(ctx, str, startX, startY, localOptions2) { const line = str.replace(/\[.*\]/g, "").split("\n").map((l) => l.trim()); const x = Math.max(0, startX); for (let i = line.length - 1; i >= 0; i--) { - const y8 = i * localOptions2.lineHeight + startY; + const y4 = i * localOptions2.lineHeight + startY; if (localOptions2.shadowColor && localOptions2.shadowColor !== "") { ctx.fillStyle = localOptions2.shadowColor; - ctx.fillText(line[i], x + 5, y8 + 16); + ctx.fillText(line[i], x + 5, y4 + 16); } ctx.fillStyle = localOptions2.labelColor; - ctx.fillText(line[i], x + 4, y8 + 15); + ctx.fillText(line[i], x + 4, y4 + 15); } } -function point(ctx, x, y8, z, localOptions2) { +function point(ctx, x, y4, z, localOptions2) { ctx.fillStyle = colorDepth(z, localOptions2); ctx.beginPath(); - ctx.arc(x, y8, localOptions2.pointSize, 0, 2 * Math.PI); + ctx.arc(x, y4, localOptions2.pointSize, 0, 2 * Math.PI); ctx.fill(); } -function rect(ctx, x, y8, width, height, localOptions2) { +function rect(ctx, x, y4, width, height, localOptions2) { ctx.beginPath(); ctx.lineWidth = localOptions2.lineWidth; if (localOptions2.useCurves) { const cx2 = (x + x + width) / 2; - const cy2 = (y8 + y8 + height) / 2; + const cy2 = (y4 + y4 + height) / 2; ctx.ellipse(cx2, cy2, width / 2, height / 2, 0, 0, 2 * Math.PI); } else { - ctx.moveTo(x + localOptions2.roundRect, y8); - ctx.lineTo(x + width - localOptions2.roundRect, y8); - ctx.quadraticCurveTo(x + width, y8, x + width, y8 + localOptions2.roundRect); - ctx.lineTo(x + width, y8 + height - localOptions2.roundRect); - ctx.quadraticCurveTo(x + width, y8 + height, x + width - localOptions2.roundRect, y8 + height); - ctx.lineTo(x + localOptions2.roundRect, y8 + height); - ctx.quadraticCurveTo(x, y8 + height, x, y8 + height - localOptions2.roundRect); - ctx.lineTo(x, y8 + localOptions2.roundRect); - ctx.quadraticCurveTo(x, y8, x + localOptions2.roundRect, y8); + ctx.moveTo(x + localOptions2.roundRect, y4); + ctx.lineTo(x + width - localOptions2.roundRect, y4); + ctx.quadraticCurveTo(x + width, y4, x + width, y4 + localOptions2.roundRect); + ctx.lineTo(x + width, y4 + height - localOptions2.roundRect); + ctx.quadraticCurveTo(x + width, y4 + height, x + width - localOptions2.roundRect, y4 + height); + ctx.lineTo(x + localOptions2.roundRect, y4 + height); + ctx.quadraticCurveTo(x, y4 + height, x, y4 + height - localOptions2.roundRect); + ctx.lineTo(x, y4 + localOptions2.roundRect); + ctx.quadraticCurveTo(x, y4, x + localOptions2.roundRect, y4); ctx.closePath(); } ctx.stroke(); @@ -35734,9 +36878,9 @@ function curves(ctx, points, localOptions2) { } ctx.moveTo(points[0][0], points[0][1]); for (let i = 0; i < points.length - 2; i++) { - const xc2 = (points[i][0] + points[i + 1][0]) / 2; - const yc2 = (points[i][1] + points[i + 1][1]) / 2; - ctx.quadraticCurveTo(points[i][0], points[i][1], xc2, yc2); + const xc = (points[i][0] + points[i + 1][0]) / 2; + const yc = (points[i][1] + points[i + 1][1]) / 2; + ctx.quadraticCurveTo(points[i][0], points[i][1], xc, yc); } ctx.quadraticCurveTo(points[points.length - 2][0], points[points.length - 2][1], points[points.length - 1][0], points[points.length - 1][1]); ctx.stroke(); @@ -35745,25 +36889,25 @@ function curves(ctx, points, localOptions2) { ctx.fill(); } } -function arrow(ctx, from, to, radius = 5) { +function arrow(ctx, from, to2, radius = 5) { let angle; let x; - let y8; + let y4; ctx.beginPath(); ctx.moveTo(from[0], from[1]); - ctx.lineTo(to[0], to[1]); - angle = Math.atan2(to[1] - from[1], to[0] - from[0]); - x = radius * Math.cos(angle) + to[0]; - y8 = radius * Math.sin(angle) + to[1]; - ctx.moveTo(x, y8); + ctx.lineTo(to2[0], to2[1]); + angle = Math.atan2(to2[1] - from[1], to2[0] - from[0]); + x = radius * Math.cos(angle) + to2[0]; + y4 = radius * Math.sin(angle) + to2[1]; + ctx.moveTo(x, y4); angle += 1 / 3 * (2 * Math.PI); - x = radius * Math.cos(angle) + to[0]; - y8 = radius * Math.sin(angle) + to[1]; - ctx.lineTo(x, y8); + x = radius * Math.cos(angle) + to2[0]; + y4 = radius * Math.sin(angle) + to2[1]; + ctx.lineTo(x, y4); angle += 1 / 3 * (2 * Math.PI); - x = radius * Math.cos(angle) + to[0]; - y8 = radius * Math.sin(angle) + to[1]; - ctx.lineTo(x, y8); + x = radius * Math.cos(angle) + to2[0]; + y4 = radius * Math.sin(angle) + to2[1]; + ctx.lineTo(x, y4); ctx.closePath(); ctx.stroke(); ctx.fill(); @@ -39583,8 +40727,8 @@ var LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG = [ // src/draw/face.ts var localOptions; function drawLabels(f, ctx) { - var _a, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2; - if (!localOptions.drawLabels || ((_a = localOptions.faceLabels) == null ? void 0 : _a.length) === 0) + var _a2, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2; + if (!localOptions.drawLabels || ((_a2 = localOptions.faceLabels) == null ? void 0 : _a2.length) === 0) return; let l = localOptions.faceLabels.slice(); l = replace(l, "[id]", f.id.toFixed(0)); @@ -39619,8 +40763,8 @@ function drawLabels(f, ctx) { labels(ctx, l, f.box[0], f.box[1], localOptions); } function drawIrisElipse(f, ctx) { - var _a, _b, _c2, _d2; - if (((_a = f.annotations) == null ? void 0 : _a.leftEyeIris) && ((_b = f.annotations) == null ? void 0 : _b.leftEyeIris[0])) { + var _a2, _b, _c2, _d2; + if (((_a2 = f.annotations) == null ? void 0 : _a2.leftEyeIris) && ((_b = f.annotations) == null ? void 0 : _b.leftEyeIris[0])) { ctx.strokeStyle = localOptions.useDepth ? "rgba(255, 200, 255, 0.3)" : localOptions.color; ctx.beginPath(); const sizeX = Math.abs(f.annotations.leftEyeIris[3][0] - f.annotations.leftEyeIris[1][0]) / 2; @@ -39646,8 +40790,8 @@ function drawIrisElipse(f, ctx) { } } function drawGazeSpheres(f, ctx) { - var _a; - if (localOptions.drawGaze && ((_a = f.rotation) == null ? void 0 : _a.angle) && typeof Path2D !== "undefined") { + var _a2; + if (localOptions.drawGaze && ((_a2 = f.rotation) == null ? void 0 : _a2.angle) && typeof Path2D !== "undefined") { ctx.strokeStyle = "pink"; const valX = f.box[0] + f.box[2] / 2 - f.box[3] * rad2deg(f.rotation.angle.yaw) / 90; const valY = f.box[1] + f.box[3] / 2 + f.box[2] * rad2deg(f.rotation.angle.pitch) / 90; @@ -39670,8 +40814,8 @@ function drawGazeSpheres(f, ctx) { } } function drawGazeArrows(f, ctx) { - var _a; - if (localOptions.drawGaze && ((_a = f.rotation) == null ? void 0 : _a.gaze.strength) && f.rotation.gaze.bearing && f.annotations.leftEyeIris && f.annotations.rightEyeIris && f.annotations.leftEyeIris[0] && f.annotations.rightEyeIris[0]) { + var _a2; + if (localOptions.drawGaze && ((_a2 = f.rotation) == null ? void 0 : _a2.gaze.strength) && f.rotation.gaze.bearing && f.annotations.leftEyeIris && f.annotations.rightEyeIris && f.annotations.leftEyeIris[0] && f.annotations.rightEyeIris[0]) { ctx.strokeStyle = "pink"; ctx.fillStyle = "pink"; const leftGaze = [ @@ -39711,10 +40855,10 @@ function drawFacePoints(f, ctx) { } } } else { - for (const [k, v10] of Object.entries((f == null ? void 0 : f.annotations) || {})) { - if (!(v10 == null ? void 0 : v10[0])) + for (const [k, v4] of Object.entries((f == null ? void 0 : f.annotations) || {})) { + if (!(v4 == null ? void 0 : v4[0])) continue; - const pt2 = v10[0]; + const pt2 = v4[0]; point(ctx, pt2[0], pt2[1], 0, localOptions); if (localOptions.drawLabels) labels(ctx, k, pt2[0], pt2[1], localOptions); @@ -39751,7 +40895,7 @@ function face(inCanvas2, result, drawOptions) { // src/draw/body.ts function body(inCanvas2, result, drawOptions) { - var _a, _b; + var _a2, _b; const localOptions2 = mergeDeep(options2, drawOptions); if (!result || !inCanvas2) return; @@ -39766,7 +40910,7 @@ function body(inCanvas2, result, drawOptions) { ctx.font = localOptions2.font; if (localOptions2.drawBoxes && result[i].box && result[i].box.length === 4) { rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions2); - if (localOptions2.drawLabels && ((_a = localOptions2.bodyLabels) == null ? void 0 : _a.length) > 0) { + if (localOptions2.drawLabels && ((_a2 = localOptions2.bodyLabels) == null ? void 0 : _a2.length) > 0) { let l = localOptions2.bodyLabels.slice(); l = replace(l, "[id]", result[i].id.toFixed(0)); l = replace(l, "[score]", 100 * result[i].score); @@ -39803,7 +40947,7 @@ function body(inCanvas2, result, drawOptions) { // src/draw/hand.ts function hand(inCanvas2, result, drawOptions) { - var _a, _b; + var _a2, _b; const localOptions2 = mergeDeep(options2, drawOptions); if (!result || !inCanvas2) return; @@ -39817,7 +40961,7 @@ function hand(inCanvas2, result, drawOptions) { ctx.strokeStyle = localOptions2.color; ctx.fillStyle = localOptions2.color; rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions2); - if (localOptions2.drawLabels && ((_a = localOptions2.handLabels) == null ? void 0 : _a.length) > 0) { + if (localOptions2.drawLabels && ((_a2 = localOptions2.handLabels) == null ? void 0 : _a2.length) > 0) { let l = localOptions2.handLabels.slice(); l = replace(l, "[id]", h.id.toFixed(0)); l = replace(l, "[label]", h.label); @@ -39866,7 +41010,7 @@ function hand(inCanvas2, result, drawOptions) { // src/draw/object.ts function object(inCanvas2, result, drawOptions) { - var _a; + var _a2; const localOptions2 = mergeDeep(options2, drawOptions); if (!result || !inCanvas2) return; @@ -39880,7 +41024,7 @@ function object(inCanvas2, result, drawOptions) { ctx.strokeStyle = localOptions2.color; ctx.fillStyle = localOptions2.color; rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions2); - if (localOptions2.drawLabels && ((_a = localOptions2.objectLabels) == null ? void 0 : _a.length) > 0) { + if (localOptions2.drawLabels && ((_a2 = localOptions2.objectLabels) == null ? void 0 : _a2.length) > 0) { let l = localOptions2.objectLabels.slice(); l = replace(l, "[id]", h.id.toFixed(0)); l = replace(l, "[label]", h.label); @@ -39894,11 +41038,11 @@ function object(inCanvas2, result, drawOptions) { // src/draw/gesture.ts function gesture(inCanvas2, result, drawOptions) { - var _a; + var _a2; const localOptions2 = mergeDeep(options2, drawOptions); if (!result || !inCanvas2) return; - if (localOptions2.drawGestures && ((_a = localOptions2.gestureLabels) == null ? void 0 : _a.length) > 0) { + if (localOptions2.drawGestures && ((_a2 = localOptions2.gestureLabels) == null ? void 0 : _a2.length) > 0) { const ctx = getCanvasContext(inCanvas2); if (!ctx) return; @@ -40138,16 +41282,16 @@ function createAnchors() { const stride = strides[layerId]; const featureMapHeight = Math.ceil(inputSize / stride); const featureMapWidth = Math.ceil(inputSize / stride); - for (let y8 = 0; y8 < featureMapHeight; ++y8) { + for (let y4 = 0; y4 < featureMapHeight; ++y4) { for (let x = 0; x < featureMapWidth; ++x) { for (let anchorId = 0; anchorId < anchorCount; ++anchorId) { - anchors3.push({ x: (x + 0.5) / featureMapWidth, y: (y8 + 0.5) / featureMapHeight }); + anchors3.push({ x: (x + 0.5) / featureMapWidth, y: (y4 + 0.5) / featureMapHeight }); } } } layerId = lastSameStrideLayer; } - anchorTensor = { x: Jt(anchors3.map((a) => a.x)), y: Jt(anchors3.map((a) => a.y)) }; + anchorTensor = { x: rr(anchors3.map((a) => a.x)), y: rr(anchors3.map((a) => a.y)) }; } async function loadDetector(config3) { if (env.initial) @@ -40164,33 +41308,33 @@ async function loadDetector(config3) { var cropFactor = [5, 5]; function decodeBoxes(boxesTensor, anchor) { return De(() => { - const split = ci(boxesTensor, 12, 1); - let xCenter = uc(split[0]); - let yCenter = uc(split[1]); - let width = uc(split[2]); - let height = uc(split[3]); - xCenter = Ce(je(xCenter, inputSize), anchor.x); - yCenter = Ce(je(yCenter, inputSize), anchor.y); - width = se(je(width, inputSize), cropFactor[0]); - height = se(je(height, inputSize), cropFactor[1]); - const xMin = Te(xCenter, je(width, 2)); - const yMin = Te(yCenter, je(height, 2)); + const split = Ci(boxesTensor, 12, 1); + let xCenter = gl(split[0]); + let yCenter = gl(split[1]); + let width = gl(split[2]); + let height = gl(split[3]); + xCenter = Ce(Xe(xCenter, inputSize), anchor.x); + yCenter = Ce(Xe(yCenter, inputSize), anchor.y); + width = se(Xe(width, inputSize), cropFactor[0]); + height = se(Xe(height, inputSize), cropFactor[1]); + const xMin = Te(xCenter, Xe(width, 2)); + const yMin = Te(yCenter, Xe(height, 2)); const xMax = Ce(xMin, width); const yMax = Ce(yMin, height); - const boxes = vr([xMin, yMin, xMax, yMax], 1); + const boxes = Tr([xMin, yMin, xMax, yMax], 1); return boxes; }); } async function decodeResults(boxesTensor, logitsTensor, config3, outputSize2) { - var _a, _b; + var _a2, _b; const detectedBoxes = []; - const t8 = {}; - t8.boxes = decodeBoxes(boxesTensor, anchorTensor); - t8.scores = $a(logitsTensor); - t8.nms = await Kj.nonMaxSuppressionAsync(t8.boxes, t8.scores, 1, ((_a = config3.body["detector"]) == null ? void 0 : _a.minConfidence) || 0.1, ((_b = config3.body["detector"]) == null ? void 0 : _b.iouThreshold) || 0.1); - const nms = await t8.nms.data(); - const scores = await t8.scores.data(); - const boxes = await t8.boxes.array(); + const t10 = {}; + t10.boxes = decodeBoxes(boxesTensor, anchorTensor); + t10.scores = Pa(logitsTensor); + t10.nms = await b5.nonMaxSuppressionAsync(t10.boxes, t10.scores, 1, ((_a2 = config3.body["detector"]) == null ? void 0 : _a2.minConfidence) || 0.1, ((_b = config3.body["detector"]) == null ? void 0 : _b.iouThreshold) || 0.1); + const nms = await t10.nms.data(); + const scores = await t10.scores.data(); + const boxes = await t10.boxes.array(); for (const i of Array.from(nms)) { const score = scores[i]; const boxRaw = boxes[i]; @@ -40198,18 +41342,18 @@ async function decodeResults(boxesTensor, logitsTensor, config3, outputSize2) { const detectedBox = { score, boxRaw, box }; detectedBoxes.push(detectedBox); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return detectedBoxes; } async function detectBoxes(input, config3, outputSize2) { - const t8 = {}; - t8.res = model == null ? void 0 : model.execute(input, ["Identity"]); - t8.logitsRaw = Xe(t8.res, [0, 0, 0], [1, -1, 1]); - t8.boxesRaw = Xe(t8.res, [0, 0, 1], [1, -1, -1]); - t8.logits = uc(t8.logitsRaw); - t8.boxes = uc(t8.boxesRaw); - const boxes = await decodeResults(t8.boxes, t8.logits, config3, outputSize2); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + const t10 = {}; + t10.res = model == null ? void 0 : model.execute(input, ["Identity"]); + t10.logitsRaw = Ye(t10.res, [0, 0, 0], [1, -1, 1]); + t10.boxesRaw = Ye(t10.res, [0, 0, 1], [1, -1, -1]); + t10.logits = gl(t10.logitsRaw); + t10.boxes = gl(t10.boxesRaw); + const boxes = await decodeResults(t10.boxes, t10.logits, config3, outputSize2); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return boxes; } @@ -40268,13 +41412,13 @@ async function loadPose(config3) { return model2; } function prepareImage(input, size2, cropBox) { - var _a, _b; - const t8 = {}; - if (!((_a = input == null ? void 0 : input.shape) == null ? void 0 : _a[1]) || !((_b = input == null ? void 0 : input.shape) == null ? void 0 : _b[2])) + var _a2, _b; + const t10 = {}; + if (!((_a2 = input == null ? void 0 : input.shape) == null ? void 0 : _a2[1]) || !((_b = input == null ? void 0 : input.shape) == null ? void 0 : _b[2])) return input; let final; if (cropBox) { - t8.cropped = Kj.cropAndResize(input, [cropBox], [0], [input.shape[1], input.shape[2]]); + t10.cropped = b5.cropAndResize(input, [cropBox], [0], [input.shape[1], input.shape[2]]); } if (input.shape[1] !== input.shape[2]) { const height = [ @@ -40295,16 +41439,16 @@ function prepareImage(input, size2, cropBox) { [0, 0] // dont touch rbg ]; - t8.pad = Aa(t8.cropped || input, padding); - t8.resize = Kj.resizeBilinear(t8.pad, [size2, size2]); - final = je(t8.resize, constants.tf255); + t10.pad = za(t10.cropped || input, padding); + t10.resize = b5.resizeBilinear(t10.pad, [size2, size2]); + final = Xe(t10.resize, constants.tf255); } else if (input.shape[1] !== size2) { - t8.resize = Kj.resizeBilinear(t8.cropped || input, [size2, size2]); - final = je(t8.resize, constants.tf255); + t10.resize = b5.resizeBilinear(t10.cropped || input, [size2, size2]); + final = Xe(t10.resize, constants.tf255); } else { - final = je(t8.cropped || input, constants.tf255); + final = Xe(t10.cropped || input, constants.tf255); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return final; } function rescaleKeypoints(keypoints, outputSize2, cropBox) { @@ -40349,19 +41493,19 @@ function fixKeypoints(keypoints) { async function detectLandmarks(input, config3, outputSize2) { if (!(model2 == null ? void 0 : model2["executor"])) return null; - const t8 = {}; + const t10 = {}; [ - t8.ld, - t8.segmentation, - t8.heatmap, - t8.world, - t8.poseflag + t10.ld, + t10.segmentation, + t10.heatmap, + t10.world, + t10.poseflag /* 1,1 */ ] = model2 == null ? void 0 : model2.execute(input, outputNodes.landmarks); - const poseScore = (await t8.poseflag.data())[0]; - const points = await t8.ld.data(); - const distances = await t8.world.data(); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + const poseScore = (await t10.poseflag.data())[0]; + const points = await t10.ld.data(); + const distances = await t10.world.data(); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); const keypointsRelative = []; const depth = 5; for (let i = 0; i < points.length / depth; i++) { @@ -40394,7 +41538,7 @@ async function detectLandmarks(input, config3, outputSize2) { return body4; } async function predict(input, config3) { - var _a, _b, _c2; + var _a2, _b, _c2; const outputSize2 = [input.shape[2] || 0, input.shape[1] || 0]; const skipTime = (config3.body.skipTime || 0) > now() - lastTime; const skipFrame = skipped < (config3.body.skipFrames || 0); @@ -40402,10 +41546,10 @@ async function predict(input, config3) { skipped++; } else { let boxes = []; - if ((_b = (_a = config3.body) == null ? void 0 : _a["detector"]) == null ? void 0 : _b["enabled"]) { + if ((_b = (_a2 = config3.body) == null ? void 0 : _a2["detector"]) == null ? void 0 : _b["enabled"]) { const preparedImage = prepareImage(input, 224); boxes = await detectBoxes(preparedImage, config3, outputSize2); - Ot(preparedImage); + Lt(preparedImage); } else { boxes = [{ box: [0, 0, 0, 0], boxRaw: [0, 0, 1, 1], score: 0 }]; } @@ -40413,7 +41557,7 @@ async function predict(input, config3) { const preparedBox = prepareImage(input, 256, (_c2 = boxes[i]) == null ? void 0 : _c2.boxRaw); cache.length = 0; const bodyResult = await detectLandmarks(preparedBox, config3, outputSize2); - Ot(preparedBox); + Lt(preparedBox); if (!bodyResult) continue; bodyResult.id = i; @@ -40529,18 +41673,18 @@ async function load(config3) { async function process3(res, outputShape, config3) { if (!res) return []; - const t8 = {}; + const t10 = {}; const results = []; const detections = await res.array(); - t8.squeeze = uc(res); - const arr = ci(t8.squeeze, 6, 1); - t8.stack = vr([arr[1], arr[0], arr[3], arr[2]], 1); - t8.boxes = uc(t8.stack); - t8.scores = uc(arr[4]); - t8.classes = uc(arr[5]); - Ot([res, ...arr]); - t8.nms = await Kj.nonMaxSuppressionAsync(t8.boxes, t8.scores, config3.object.maxDetected || 0, config3.object.iouThreshold, config3.object.minConfidence || 0); - const nms = await t8.nms.data(); + t10.squeeze = gl(res); + const arr = Ci(t10.squeeze, 6, 1); + t10.stack = Tr([arr[1], arr[0], arr[3], arr[2]], 1); + t10.boxes = gl(t10.stack); + t10.scores = gl(arr[4]); + t10.classes = gl(arr[5]); + Lt([res, ...arr]); + t10.nms = await b5.nonMaxSuppressionAsync(t10.boxes, t10.scores, config3.object.maxDetected || 0, config3.object.iouThreshold, config3.object.minConfidence || 0); + const nms = await t10.nms.data(); let i = 0; for (const id2 of Array.from(nms)) { const score = Math.trunc(100 * detections[0][id2][4]) / 100; @@ -40548,15 +41692,15 @@ async function process3(res, outputShape, config3) { if (Number.isNaN(classVal)) continue; const label = labels2[classVal].label; - const [x, y8] = [ + const [x, y4] = [ detections[0][id2][0] / inputSize3, detections[0][id2][1] / inputSize3 ]; const boxRaw = [ x, - y8, + y4, detections[0][id2][2] / inputSize3 - x, - detections[0][id2][3] / inputSize3 - y8 + detections[0][id2][3] / inputSize3 - y4 ]; const box = [ Math.trunc(boxRaw[0] * outputShape[0]), @@ -40566,7 +41710,7 @@ async function process3(res, outputShape, config3) { ]; results.push({ id: i++, score, class: classVal, label, box, boxRaw }); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return results; } async function predict2(input, config3) { @@ -40581,10 +41725,10 @@ async function predict2(input, config3) { skipped2 = 0; return new Promise(async (resolve) => { const outputSize2 = [input.shape[2] || 0, input.shape[1] || 0]; - const resize = Kj.resizeBilinear(input, [inputSize3, inputSize3]); + const resize = b5.resizeBilinear(input, [inputSize3, inputSize3]); const objectT = config3.object.enabled ? model3 == null ? void 0 : model3.execute(resize, ["tower_0/detections"]) : null; lastTime2 = now(); - Ot(resize); + Lt(resize); const obj = await process3(objectT, outputSize2, config3); last2 = obj; resolve(obj); @@ -40641,18 +41785,18 @@ async function load2(config3) { async function max2d(inputs, minScore) { const [width, height] = inputs.shape; const reshaped = W(inputs, [height * width]); - const max = Ra(reshaped, 0); + const max = La(reshaped, 0); const newScore = (await max.data())[0]; if (newScore > minScore) { - const coordinates = Rk(reshaped, 0); - const mod = P2(coordinates, width); + const coordinates = w1(reshaped, 0); + const mod = k2(coordinates, width); const x = (await mod.data())[0]; - const div = je(coordinates, width); - const y8 = (await div.data())[0]; - Ot([reshaped, max, coordinates, mod, div]); - return [x, y8, newScore]; + const div = Xe(coordinates, width); + const y4 = (await div.data())[0]; + Lt([reshaped, max, coordinates, mod, div]); + return [x, y4, newScore]; } - Ot([reshaped, max]); + Lt([reshaped, max]); return [0, 0, newScore]; } async function predict3(image, config3) { @@ -40667,8 +41811,8 @@ async function predict3(image, config3) { skipped3 = 0; return new Promise(async (resolve) => { const tensor = De(() => { - var _a, _b; - const resize = Kj.resizeBilinear(image, [((_a = model4 == null ? void 0 : model4.inputs[0].shape) == null ? void 0 : _a[2]) || 0, ((_b = model4 == null ? void 0 : model4.inputs[0].shape) == null ? void 0 : _b[1]) || 0], false); + var _a2, _b; + const resize = b5.resizeBilinear(image, [((_a2 = model4 == null ? void 0 : model4.inputs[0].shape) == null ? void 0 : _a2[2]) || 0, ((_b = model4 == null ? void 0 : model4.inputs[0].shape) == null ? void 0 : _b[1]) || 0], false); const enhance2 = se(resize, constants.tf2); const norm = Te(enhance2, constants.tf1); return norm; @@ -40677,15 +41821,15 @@ async function predict3(image, config3) { if (config3.body.enabled) resT = model4 == null ? void 0 : model4.execute(tensor); lastTime3 = now(); - Ot(tensor); + Lt(tensor); if (resT) { cache2.keypoints.length = 0; - const squeeze = uc(resT); - Ot(resT); - const stack = mo(squeeze, 2); - Ot(squeeze); + const squeeze = gl(resT); + Lt(resT); + const stack = zo(squeeze, 2); + Lt(squeeze); for (let id2 = 0; id2 < stack.length; id2++) { - const [x8, y10, partScore] = await max2d(stack[id2], config3.body.minConfidence); + const [x4, y10, partScore] = await max2d(stack[id2], config3.body.minConfidence); if (partScore > (config3.body.minConfidence || 0)) { cache2.keypoints.push({ score: Math.round(100 * partScore) / 100, @@ -40693,28 +41837,28 @@ async function predict3(image, config3) { positionRaw: [ // normalized to 0..1 // @ts-ignore model is not undefined here - x8 / model4.inputs[0].shape[2], + x4 / model4.inputs[0].shape[2], y10 / model4.inputs[0].shape[1] ], position: [ // normalized to input image size // @ts-ignore model is not undefined here - Math.round(image.shape[2] * x8 / model4.inputs[0].shape[2]), + Math.round(image.shape[2] * x4 / model4.inputs[0].shape[2]), Math.round(image.shape[1] * y10 / model4.inputs[0].shape[1]) ] }); } } - stack.forEach((s) => Ot(s)); + stack.forEach((s) => Lt(s)); } cache2.score = cache2.keypoints.reduce((prev, curr) => curr.score > prev ? curr.score : prev, 0); const x = cache2.keypoints.map((a) => a.position[0]); - const y8 = cache2.keypoints.map((a) => a.position[1]); + const y4 = cache2.keypoints.map((a) => a.position[1]); cache2.box = [ Math.min(...x), - Math.min(...y8), + Math.min(...y4), Math.max(...x) - Math.min(...x), - Math.max(...y8) - Math.min(...y8) + Math.max(...y4) - Math.min(...y4) ]; const xRaw = cache2.keypoints.map((a) => a.positionRaw[0]); const yRaw = cache2.keypoints.map((a) => a.positionRaw[1]); @@ -40761,11 +41905,11 @@ var scaleBoxCoordinates = (box, factor, anchor) => { }; var cutAndResize = (box, image, cropSize) => { const h = image.shape[1]; - const w10 = image.shape[2]; - const cutBox = [box.startPoint[1] / h, box.startPoint[0] / w10, box.endPoint[1] / h, box.endPoint[0] / w10]; - const crop = Kj.cropAndResize(image, [cutBox], [0], cropSize); - const norm = je(crop, constants.tf255); - Ot(crop); + const w = image.shape[2]; + const cutBox = [box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h, box.endPoint[0] / w]; + const crop = b5.cropAndResize(image, [cutBox], [0], cropSize); + const norm = Xe(crop, constants.tf255); + Lt(crop); return norm; }; var enlargeBox = (box, factor) => { @@ -40794,17 +41938,17 @@ var squarifyBox = (box) => { }; var calculateLandmarksBoundingBox = (landmarks) => { const x = landmarks.map((d) => d[0]); - const y8 = landmarks.map((d) => d[1]); + const y4 = landmarks.map((d) => d[1]); return { - startPoint: [Math.min(...x), Math.min(...y8)], - endPoint: [Math.max(...x), Math.max(...y8)], + startPoint: [Math.min(...x), Math.min(...y4)], + endPoint: [Math.max(...x), Math.max(...y4)], landmarks }; }; var fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]; var normalizeRadians = (angle) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI)); var computeRotation = (point1, point2) => normalizeRadians(Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0])); -var buildTranslationMatrix = (x, y8) => [[1, 0, x], [0, 1, y8], [0, 0, 1]]; +var buildTranslationMatrix = (x, y4) => [[1, 0, x], [0, 1, y4], [0, 0, 1]]; var dot = (v12, v22) => { let product = 0; for (let i = 0; i < v12.length; i++) @@ -40893,10 +42037,10 @@ function correctFaceRotation(rotate, box, input, inputSize10) { if (largeAngle) { const center = getBoxCenter(box); const centerRaw = [center[0] / input.shape[2], center[1] / input.shape[1]]; - const rotated = Kj.rotateWithOffset(input, angle, 0, [centerRaw[0], centerRaw[1]]); + const rotated = b5.rotateWithOffset(input, angle, 0, [centerRaw[0], centerRaw[1]]); rotationMatrix = buildRotationMatrix(-angle, center); face4 = cutAndResize(box, rotated, [inputSize10, inputSize10]); - Ot(rotated); + Lt(rotated); } else { face4 = cutAndResize(box, input, [inputSize10, inputSize10]); } @@ -40907,8 +42051,8 @@ function correctFaceRotation(rotate, box, input, inputSize10) { } var findFaceCenter = (mesh) => { const x = mesh.map((m) => m[0]); - const y8 = mesh.map((m) => m[1]); - return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y8) + (Math.max(...y8) - Math.min(...y8)) / 2]; + const y4 = mesh.map((m) => m[1]); + return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y4) + (Math.max(...y4) - Math.min(...y4)) / 2]; }; var calculateFaceBox = (mesh, previousBox) => { const center = findFaceCenter(mesh); @@ -40922,79 +42066,78 @@ var calculateFaceBox = (mesh, previousBox) => { // src/face/blazeface.ts var keypointsCount = 6; -var faceBoxScaleFactor = 1.4; var model5; var anchors = null; var inputSize4 = 0; var inputSizeT = null; var size = () => inputSize4; async function load3(config3) { - var _a; + var _a2; if (env.initial) model5 = null; if (!model5) - model5 = await loadModel((_a = config3.face.detector) == null ? void 0 : _a.modelPath); + model5 = await loadModel((_a2 = config3.face.detector) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", model5["modelUrl"]); inputSize4 = model5["executor"] && model5.inputs[0].shape ? model5.inputs[0].shape[2] : 256; inputSizeT = ke(inputSize4, "int32"); - anchors = cu(generateAnchors(inputSize4)); + anchors = bu(generateAnchors(inputSize4)); return model5; } function decodeBoxes2(boxOutputs) { if (!anchors || !inputSizeT) - return Ur([0, 0]); - const t8 = {}; - t8.boxStarts = Xe(boxOutputs, [0, 1], [-1, 2]); - t8.centers = Ce(t8.boxStarts, anchors); - t8.boxSizes = Xe(boxOutputs, [0, 3], [-1, 2]); - t8.boxSizesNormalized = je(t8.boxSizes, inputSizeT); - t8.centersNormalized = je(t8.centers, inputSizeT); - t8.halfBoxSize = je(t8.boxSizesNormalized, constants.tf2); - t8.starts = Te(t8.centersNormalized, t8.halfBoxSize); - t8.ends = Ce(t8.centersNormalized, t8.halfBoxSize); - t8.startNormalized = se(t8.starts, inputSizeT); - t8.endNormalized = se(t8.ends, inputSizeT); - const boxes = Qk([t8.startNormalized, t8.endNormalized], 1); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + return Yr([0, 0]); + const t10 = {}; + t10.boxStarts = Ye(boxOutputs, [0, 1], [-1, 2]); + t10.centers = Ce(t10.boxStarts, anchors); + t10.boxSizes = Ye(boxOutputs, [0, 3], [-1, 2]); + t10.boxSizesNormalized = Xe(t10.boxSizes, inputSizeT); + t10.centersNormalized = Xe(t10.centers, inputSizeT); + t10.halfBoxSize = Xe(t10.boxSizesNormalized, constants.tf2); + t10.starts = Te(t10.centersNormalized, t10.halfBoxSize); + t10.ends = Ce(t10.centersNormalized, t10.halfBoxSize); + t10.startNormalized = se(t10.starts, inputSizeT); + t10.endNormalized = se(t10.ends, inputSizeT); + const boxes = V1([t10.startNormalized, t10.endNormalized], 1); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return boxes; } async function getBoxes(inputImage, config3) { - var _a, _b, _c2, _d2, _e, _f2; + var _a2, _b, _c2, _d2, _e, _f2, _g2; if (!inputImage || inputImage["isDisposedInternal"] || inputImage.shape.length !== 4 || inputImage.shape[1] < 1 || inputImage.shape[2] < 1) return []; - const t8 = {}; - t8.resized = Kj.resizeBilinear(inputImage, [inputSize4, inputSize4]); - t8.div = je(t8.resized, constants.tf127); - t8.normalized = Te(t8.div, constants.tf05); - const res = model5 == null ? void 0 : model5.execute(t8.normalized); + const t10 = {}; + t10.resized = b5.resizeBilinear(inputImage, [inputSize4, inputSize4]); + t10.div = Xe(t10.resized, constants.tf127); + t10.normalized = Te(t10.div, constants.tf05); + const res = model5 == null ? void 0 : model5.execute(t10.normalized); if (Array.isArray(res) && res.length > 2) { const sorted = res.sort((a, b) => a.size - b.size); - t8.concat384 = yt([sorted[0], sorted[2]], 2); - t8.concat512 = yt([sorted[1], sorted[3]], 2); - t8.concat = yt([t8.concat512, t8.concat384], 1); - t8.batch = uc(t8.concat, [0]); + t10.concat384 = bt([sorted[0], sorted[2]], 2); + t10.concat512 = bt([sorted[1], sorted[3]], 2); + t10.concat = bt([t10.concat512, t10.concat384], 1); + t10.batch = gl(t10.concat, [0]); } else if (Array.isArray(res)) { - t8.batch = uc(res[0]); + t10.batch = gl(res[0]); } else { - t8.batch = uc(res); - } - Ot(res); - t8.boxes = decodeBoxes2(t8.batch); - t8.logits = Xe(t8.batch, [0, 0], [-1, 1]); - t8.sigmoid = $a(t8.logits); - t8.scores = uc(t8.sigmoid); - t8.nms = await Kj.nonMaxSuppressionAsync(t8.boxes, t8.scores, ((_a = config3.face.detector) == null ? void 0 : _a.maxDetected) || 0, ((_b = config3.face.detector) == null ? void 0 : _b.iouThreshold) || 0, ((_c2 = config3.face.detector) == null ? void 0 : _c2.minConfidence) || 0); - const nms = await t8.nms.array(); + t10.batch = gl(res); + } + Lt(res); + t10.boxes = decodeBoxes2(t10.batch); + t10.logits = Ye(t10.batch, [0, 0], [-1, 1]); + t10.sigmoid = Pa(t10.logits); + t10.scores = gl(t10.sigmoid); + t10.nms = await b5.nonMaxSuppressionAsync(t10.boxes, t10.scores, ((_a2 = config3.face.detector) == null ? void 0 : _a2.maxDetected) || 0, ((_b = config3.face.detector) == null ? void 0 : _b.iouThreshold) || 0, ((_c2 = config3.face.detector) == null ? void 0 : _c2.minConfidence) || 0); + const nms = await t10.nms.array(); const boxes = []; - const scores = await t8.scores.data(); + const scores = await t10.scores.data(); for (let i = 0; i < nms.length; i++) { const confidence = scores[nms[i]]; if (confidence > (((_d2 = config3.face.detector) == null ? void 0 : _d2.minConfidence) || 0)) { const b = {}; - b.bbox = Xe(t8.boxes, [nms[i], 0], [1, -1]); - b.slice = Xe(t8.batch, [nms[i], keypointsCount - 1], [1, -1]); - b.squeeze = uc(b.slice); + b.bbox = Ye(t10.boxes, [nms[i], 0], [1, -1]); + b.slice = Ye(t10.batch, [nms[i], keypointsCount - 1], [1, -1]); + b.squeeze = gl(b.slice); b.landmarks = W(b.squeeze, [keypointsCount, -1]); const points = await b.bbox.data(); const rawBox = { @@ -41003,24 +42146,23 @@ async function getBoxes(inputImage, config3) { landmarks: await b.landmarks.array(), confidence }; - b.anchor = Xe(anchors, [nms[i], 0], [1, 2]); + b.anchor = Ye(anchors, [nms[i], 0], [1, 2]); const anchor = await b.anchor.data(); const scaledBox = scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize4, (inputImage.shape[1] || 0) / inputSize4], anchor); - const enlargedBox = enlargeBox(scaledBox, config3.face["scale"] || faceBoxScaleFactor); + const enlargedBox = enlargeBox(scaledBox, ((_e = config3.face.detector) == null ? void 0 : _e.scale) || 1.4); const squaredBox = squarifyBox(enlargedBox); - if (squaredBox.size[0] > (((_e = config3.face.detector) == null ? void 0 : _e["minSize"]) || 0) && squaredBox.size[1] > (((_f2 = config3.face.detector) == null ? void 0 : _f2["minSize"]) || 0)) + if (squaredBox.size[0] > (((_f2 = config3.face.detector) == null ? void 0 : _f2["minSize"]) || 0) && squaredBox.size[1] > (((_g2 = config3.face.detector) == null ? void 0 : _g2["minSize"]) || 0)) boxes.push(squaredBox); - Object.keys(b).forEach((tensor) => Ot(b[tensor])); + Object.keys(b).forEach((tensor) => Lt(b[tensor])); } } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return boxes; } // src/face/iris.ts var model6; var inputSize5 = 0; -var irisEnlarge = 2.3; var leftOutline = meshAnnotations.leftEyeLower0; var rightOutline = meshAnnotations.rightEyeLower0; var eyeLandmarks = { @@ -41034,11 +42176,11 @@ var irisLandmarks = { numCoordinates: 76 }; async function load4(config3) { - var _a, _b; + var _a2, _b; if (env.initial) model6 = null; if (!model6) - model6 = await loadModel((_a = config3.face.iris) == null ? void 0 : _a.modelPath); + model6 = await loadModel((_a2 = config3.face.iris) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", model6["modelUrl"]); inputSize5 = (model6 == null ? void 0 : model6["executor"]) && ((_b = model6.inputs) == null ? void 0 : _b[0].shape) ? model6.inputs[0].shape[2] : 0; @@ -41067,18 +42209,18 @@ var getLeftToRightEyeDepthDifference = (rawCoords) => { const rightEyeZ = rawCoords[eyeLandmarks.rightBounds[0]][2]; return leftEyeZ - rightEyeZ; }; -var getEyeBox = (rawCoords, face4, eyeInnerCornerIndex, eyeOuterCornerIndex, meshSize, flip = false) => { - const box = squarifyBox(enlargeBox(calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), irisEnlarge)); +var getEyeBox = (rawCoords, face4, eyeInnerCornerIndex, eyeOuterCornerIndex, meshSize, flip = false, scale2 = 2.3) => { + const box = squarifyBox(enlargeBox(calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), scale2)); const boxSize = getBoxSize(box); - let crop = Kj.cropAndResize(face4, [[ + let crop = b5.cropAndResize(face4, [[ box.startPoint[1] / meshSize, box.startPoint[0] / meshSize, box.endPoint[1] / meshSize, box.endPoint[0] / meshSize ]], [0], [inputSize5, inputSize5]); if (flip && env.kernels.includes("flipleftright")) { - const flipped = Kj.flipLeftRight(crop); - Ot(crop); + const flipped = b5.flipLeftRight(crop); + Lt(crop); crop = flipped; } return { box, boxSize, crop }; @@ -41087,11 +42229,11 @@ var getEyeCoords = (eyeData, eyeBox, eyeBoxSize, flip = false) => { const eyeRawCoords = []; for (let i = 0; i < irisLandmarks.numCoordinates; i++) { const x = eyeData[i * 3]; - const y8 = eyeData[i * 3 + 1]; + const y4 = eyeData[i * 3 + 1]; const z = eyeData[i * 3 + 2]; eyeRawCoords.push([ (flip ? 1 - x / inputSize5 : x / inputSize5) * eyeBoxSize[0] + eyeBox.startPoint[0], - y8 / inputSize5 * eyeBoxSize[1] + eyeBox.startPoint[1], + y4 / inputSize5 * eyeBoxSize[1] + eyeBox.startPoint[1], z ]); } @@ -41111,18 +42253,19 @@ var getAdjustedIrisCoords = (rawCoords, irisCoords, direction) => { return [coord[0], coord[1], z]; }); }; -async function augmentIris(rawCoords, face4, meshSize) { +async function augmentIris(rawCoords, face4, meshSize, config3) { + var _a2, _b; if (!(model6 == null ? void 0 : model6["executor"])) return rawCoords; - const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face4, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], meshSize, true); - const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face4, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], meshSize, true); - const combined = yt([leftEyeCrop, rightEyeCrop]); - Ot(leftEyeCrop); - Ot(rightEyeCrop); + const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face4, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], meshSize, true, ((_a2 = config3.face.iris) == null ? void 0 : _a2.scale) || 2.3); + const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face4, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], meshSize, true, ((_b = config3.face.iris) == null ? void 0 : _b.scale) || 2.3); + const combined = bt([leftEyeCrop, rightEyeCrop]); + Lt(leftEyeCrop); + Lt(rightEyeCrop); const eyePredictions = model6.execute(combined); - Ot(combined); + Lt(combined); const eyePredictionsData = await eyePredictions.data(); - Ot(eyePredictions); + Lt(eyePredictions); const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3); const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true); const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3); @@ -41144,38 +42287,38 @@ async function augmentIris(rawCoords, face4, meshSize) { // src/face/attention.ts async function augment(rawCoords, results) { - var _a, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2; - const t8 = { + var _a2, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2; + const t10 = { // all attention models produce 2d results so it needs to be later augmented with correct z-coords // mesh: results[0], // already have it in rawCoords // output_mesh_identity // flag: results[1], // already processed in parent // conv_faceflag - lips: await ((_b = (_a = results.filter((r15) => r15.size === 160)) == null ? void 0 : _a[0]) == null ? void 0 : _b.data()), + lips: await ((_b = (_a2 = results.filter((r16) => r16.size === 160)) == null ? void 0 : _a2[0]) == null ? void 0 : _b.data()), // 80 x 2d = 160 // output_lips - irisL: await ((_d2 = (_c2 = results.filter((r15) => r15.size === 10)) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.data()), + irisL: await ((_d2 = (_c2 = results.filter((r16) => r16.size === 10)) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.data()), // 5 x 2d = 10 // output_right_iris - eyeL: await ((_f2 = (_e = results.filter((r15) => r15.size === 142)) == null ? void 0 : _e[0]) == null ? void 0 : _f2.data()), + eyeL: await ((_f2 = (_e = results.filter((r16) => r16.size === 142)) == null ? void 0 : _e[0]) == null ? void 0 : _f2.data()), // 71 x 2d = 142 // output_right_eye - irisR: await ((_h2 = (_g2 = results.filter((r15) => r15.size === 10)) == null ? void 0 : _g2[1]) == null ? void 0 : _h2.data()), + irisR: await ((_h2 = (_g2 = results.filter((r16) => r16.size === 10)) == null ? void 0 : _g2[1]) == null ? void 0 : _h2.data()), // 5 x 2d = 10 // output_left_iris - eyeR: await ((_j2 = (_i2 = results.filter((r15) => r15.size === 142)) == null ? void 0 : _i2[1]) == null ? void 0 : _j2.data()) + eyeR: await ((_j2 = (_i2 = results.filter((r16) => r16.size === 142)) == null ? void 0 : _i2[1]) == null ? void 0 : _j2.data()) // 71 x 2d = 142// output_left_eye }; - for (const val of Object.values(t8)) { + for (const val of Object.values(t10)) { if (!val) return rawCoords; } const irisLDepth = LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.reduce((prev, curr) => prev += rawCoords[curr][2], 0) / LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.length; - for (let i = 0; i < t8.irisL.length / 2; i++) - rawCoords.push([t8.irisL[2 * i + 0], t8.irisL[2 * i + 1], irisLDepth]); + for (let i = 0; i < t10.irisL.length / 2; i++) + rawCoords.push([t10.irisL[2 * i + 0], t10.irisL[2 * i + 1], irisLDepth]); const irisRDepth = LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.reduce((prev, curr) => prev += rawCoords[curr][2], 0) / LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.length; - for (let i = 0; i < t8.irisR.length / 2; i++) - rawCoords.push([t8.irisR[2 * i + 0], t8.irisR[2 * i + 1], irisRDepth]); - for (let i = 0; i < t8.eyeL.length / 2; i++) - rawCoords[LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]] = [t8.eyeL[2 * i + 0], t8.eyeL[2 * i + 1], rawCoords[LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]][2]]; - for (let i = 0; i < t8.eyeR.length / 2; i++) - rawCoords[LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]] = [t8.eyeR[2 * i + 0], t8.eyeR[2 * i + 1], rawCoords[LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]][2]]; - for (let i = 0; i < t8.lips.length / 2; i++) - rawCoords[LANDMARKS_REFINEMENT_LIPS_CONFIG[i]] = [t8.lips[2 * i + 0], t8.lips[2 * i + 1], rawCoords[LANDMARKS_REFINEMENT_LIPS_CONFIG[i]][2]]; + for (let i = 0; i < t10.irisR.length / 2; i++) + rawCoords.push([t10.irisR[2 * i + 0], t10.irisR[2 * i + 1], irisRDepth]); + for (let i = 0; i < t10.eyeL.length / 2; i++) + rawCoords[LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]] = [t10.eyeL[2 * i + 0], t10.eyeL[2 * i + 1], rawCoords[LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]][2]]; + for (let i = 0; i < t10.eyeR.length / 2; i++) + rawCoords[LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]] = [t10.eyeR[2 * i + 0], t10.eyeR[2 * i + 1], rawCoords[LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]][2]]; + for (let i = 0; i < t10.lips.length / 2; i++) + rawCoords[LANDMARKS_REFINEMENT_LIPS_CONFIG[i]] = [t10.lips[2 * i + 0], t10.lips[2 * i + 1], rawCoords[LANDMARKS_REFINEMENT_LIPS_CONFIG[i]][2]]; return rawCoords; } @@ -41188,8 +42331,8 @@ var cache3 = { var model7 = null; var inputSize6 = 0; async function predict4(input, config3) { - var _a, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2; - const skipTime = (((_a = config3.face.detector) == null ? void 0 : _a.skipTime) || 0) > now() - cache3.timestamp; + var _a2, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2; + const skipTime = (((_a2 = config3.face.detector) == null ? void 0 : _a2.skipTime) || 0) > now() - cache3.timestamp; const skipFrame = cache3.skipped < (((_b = config3.face.detector) == null ? void 0 : _b.skipFrames) || 0); if (!config3.skipAllowed || !skipTime || !skipFrame || cache3.boxes.length === 0) { cache3.boxes = await getBoxes(input, config3); @@ -41224,7 +42367,7 @@ async function predict4(input, config3) { [angle, rotationMatrix, face4.tensor] = correctFaceRotation((_c2 = config3.face.detector) == null ? void 0 : _c2.rotation, box, input, ((_d2 = config3.face.mesh) == null ? void 0 : _d2.enabled) ? inputSize6 : size()); if (config3.filter.equalization) { const equilized = face4.tensor ? await histogramEqualization(face4.tensor) : void 0; - Ot(face4.tensor); + Lt(face4.tensor); if (equilized) face4.tensor = equilized; } @@ -41244,11 +42387,11 @@ async function predict4(input, config3) { } else { if (((_f2 = config3.face.attention) == null ? void 0 : _f2.enabled) && !env.kernels.includes("atan2")) { config3.face.attention.enabled = false; - Ot(face4.tensor); + Lt(face4.tensor); return faces; } const results = model7.execute(face4.tensor); - const confidenceT = results.find((t8) => t8.shape[t8.shape.length - 1] === 1); + const confidenceT = results.find((t10) => t10.shape[t10.shape.length - 1] === 1); const faceConfidence = await confidenceT.data(); face4.faceScore = Math.round(100 * faceConfidence[0]) / 100; if (face4.faceScore < (((_g2 = config3.face.detector) == null ? void 0 : _g2.minConfidence) || 1)) { @@ -41265,14 +42408,14 @@ async function predict4(input, config3) { } } } else { - const meshT = results.find((t8) => t8.shape[t8.shape.length - 1] === 1404); + const meshT = results.find((t10) => t10.shape[t10.shape.length - 1] === 1404); const coordsReshaped = W(meshT, [-1, 3]); let rawCoords = await coordsReshaped.array(); - Ot(coordsReshaped); + Lt(coordsReshaped); if ((_h2 = config3.face.attention) == null ? void 0 : _h2.enabled) { rawCoords = await augment(rawCoords, results); } else if ((_i2 = config3.face.iris) == null ? void 0 : _i2.enabled) { - rawCoords = await augmentIris(rawCoords, face4.tensor, inputSize6); + rawCoords = await augmentIris(rawCoords, face4.tensor, inputSize6, config3); } face4.mesh = transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize6); face4.meshRaw = face4.mesh.map((pt2) => [pt2[0] / (input.shape[2] || 0), pt2[1] / (input.shape[1] || 0), (pt2[2] || 0) / size2]); @@ -41290,21 +42433,21 @@ async function predict4(input, config3) { face4.size = calculatedBox.size; newCache.push(calculatedBox); } - Ot(results); + Lt(results); } if (face4.score > (((_j2 = config3.face.detector) == null ? void 0 : _j2.minConfidence) || 1)) faces.push(face4); else - Ot(face4.tensor); + Lt(face4.tensor); } cache3.boxes = newCache; return faces; } async function load5(config3) { - var _a, _b, _c2, _d2, _e, _f2; + var _a2, _b, _c2, _d2, _e, _f2; if (env.initial) model7 = null; - if (((_a = config3.face.attention) == null ? void 0 : _a.enabled) && (model7 == null ? void 0 : model7["signature"])) { + if (((_a2 = config3.face.attention) == null ? void 0 : _a2.enabled) && (model7 == null ? void 0 : model7["signature"])) { if (Object.keys(((_b = model7 == null ? void 0 : model7["signature"]) == null ? void 0 : _b.outputs) || {}).length < 6) model7 = null; } @@ -41331,11 +42474,11 @@ var lastTime4 = 0; var skipped4 = Number.MAX_SAFE_INTEGER; var rgb = false; async function load6(config3) { - var _a, _b, _c2; + var _a2, _b, _c2; if (env.initial) model8 = null; if (!model8) { - model8 = await loadModel((_a = config3.face.emotion) == null ? void 0 : _a.modelPath); + model8 = await loadModel((_a2 = config3.face.emotion) == null ? void 0 : _a2.modelPath); rgb = ((_c2 = (_b = model8 == null ? void 0 : model8.inputs) == null ? void 0 : _b[0].shape) == null ? void 0 : _c2[3]) === 3; if (!rgb) annotations = ["angry", "disgust", "fear", "happy", "sad", "surprise", "neutral"]; @@ -41347,10 +42490,10 @@ async function load6(config3) { return model8; } async function predict5(image, config3, idx, count2) { - var _a, _b; + var _a2, _b; if (!model8) return []; - const skipFrame = skipped4 < (((_a = config3.face.emotion) == null ? void 0 : _a.skipFrames) || 0); + const skipFrame = skipped4 < (((_a2 = config3.face.emotion) == null ? void 0 : _a2.skipFrames) || 0); const skipTime = (((_b = config3.face.emotion) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime4; if (config3.skipAllowed && skipTime && skipFrame && lastCount === count2 && last3[idx] && last3[idx].length > 0) { skipped4++; @@ -41358,37 +42501,37 @@ async function predict5(image, config3, idx, count2) { } skipped4 = 0; return new Promise(async (resolve) => { - var _a2, _b2, _c2; + var _a3, _b2, _c2; const obj = []; - if ((_a2 = config3.face.emotion) == null ? void 0 : _a2.enabled) { - const t8 = {}; + if ((_a3 = config3.face.emotion) == null ? void 0 : _a3.enabled) { + const t10 = {}; const inputSize10 = (model8 == null ? void 0 : model8.inputs[0].shape) ? model8.inputs[0].shape[2] : 0; if (((_b2 = config3.face.emotion) == null ? void 0 : _b2["crop"]) > 0) { const crop = (_c2 = config3.face.emotion) == null ? void 0 : _c2["crop"]; const box = [[crop, crop, 1 - crop, 1 - crop]]; - t8.resize = Kj.cropAndResize(image, box, [0], [inputSize10, inputSize10]); + t10.resize = b5.cropAndResize(image, box, [0], [inputSize10, inputSize10]); } else { - t8.resize = Kj.resizeBilinear(image, [inputSize10, inputSize10], false); + t10.resize = b5.resizeBilinear(image, [inputSize10, inputSize10], false); } if (rgb) { - t8.mul = se(t8.resize, 255); - t8.normalize = Te(t8.mul, [103.939, 116.779, 123.68]); - t8.emotion = model8 == null ? void 0 : model8.execute(t8.normalize); + t10.mul = se(t10.resize, 255); + t10.normalize = Te(t10.mul, [103.939, 116.779, 123.68]); + t10.emotion = model8 == null ? void 0 : model8.execute(t10.normalize); } else { - t8.channels = se(t8.resize, constants.rgb); - t8.grayscale = ot(t8.channels, 3, true); - t8.grayscaleSub = Te(t8.grayscale, constants.tf05); - t8.grayscaleMul = se(t8.grayscaleSub, constants.tf2); - t8.emotion = model8 == null ? void 0 : model8.execute(t8.grayscaleMul); + t10.channels = se(t10.resize, constants.rgb); + t10.grayscale = ot(t10.channels, 3, true); + t10.grayscaleSub = Te(t10.grayscale, constants.tf05); + t10.grayscaleMul = se(t10.grayscaleSub, constants.tf2); + t10.emotion = model8 == null ? void 0 : model8.execute(t10.grayscaleMul); } lastTime4 = now(); - const data = await t8.emotion.data(); + const data = await t10.emotion.data(); for (let i = 0; i < data.length; i++) { if (data[i] > (config3.face.emotion.minConfidence || 0)) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] }); } obj.sort((a, b) => b.score - a.score); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); } last3[idx] = obj; lastCount = count2; @@ -41403,34 +42546,34 @@ var lastTime5 = 0; var lastCount2 = 0; var skipped5 = Number.MAX_SAFE_INTEGER; async function load7(config3) { - var _a; + var _a2; if (env.initial) model9 = null; if (!model9) - model9 = await loadModel((_a = config3.face.description) == null ? void 0 : _a.modelPath); + model9 = await loadModel((_a2 = config3.face.description) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", model9["modelUrl"]); return model9; } function enhance(input, config3) { - var _a, _b; + var _a2, _b; const tensor = input.image || input.tensor || input; if (!(model9 == null ? void 0 : model9.inputs[0].shape)) return tensor; let crop; - if (((_a = config3.face.description) == null ? void 0 : _a["crop"]) > 0) { + if (((_a2 = config3.face.description) == null ? void 0 : _a2["crop"]) > 0) { const cropval = (_b = config3.face.description) == null ? void 0 : _b["crop"]; const box = [[cropval, cropval, 1 - cropval, 1 - cropval]]; - crop = Kj.cropAndResize(tensor, box, [0], [model9.inputs[0].shape[2], model9.inputs[0].shape[1]]); + crop = b5.cropAndResize(tensor, box, [0], [model9.inputs[0].shape[2], model9.inputs[0].shape[1]]); } else { - crop = Kj.resizeBilinear(tensor, [model9.inputs[0].shape[2], model9.inputs[0].shape[1]], false); + crop = b5.resizeBilinear(tensor, [model9.inputs[0].shape[2], model9.inputs[0].shape[1]], false); } const norm = se(crop, constants.tf255); - Ot(crop); + Lt(crop); return norm; } async function predict6(image, config3, idx, count2) { - var _a, _b, _c2, _d2; + var _a2, _b, _c2, _d2; const obj = { age: 0, gender: "unknown", @@ -41439,7 +42582,7 @@ async function predict6(image, config3, idx, count2) { }; if (!(model9 == null ? void 0 : model9["executor"])) return obj; - const skipFrame = skipped5 < (((_a = config3.face.description) == null ? void 0 : _a.skipFrames) || 0); + const skipFrame = skipped5 < (((_a2 = config3.face.description) == null ? void 0 : _a2.skipFrames) || 0); const skipTime = (((_b = config3.face.description) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime5; if (config3.skipAllowed && skipFrame && skipTime && lastCount2 === count2 && ((_c2 = last4 == null ? void 0 : last4[idx]) == null ? void 0 : _c2.age) > 0 && ((_d2 = last4 == null ? void 0 : last4[idx]) == null ? void 0 : _d2.genderScore) > 0) { skipped5++; @@ -41447,31 +42590,31 @@ async function predict6(image, config3, idx, count2) { } skipped5 = 0; return new Promise(async (resolve) => { - var _a2; - if ((_a2 = config3.face.description) == null ? void 0 : _a2.enabled) { + var _a3; + if ((_a3 = config3.face.description) == null ? void 0 : _a3.enabled) { const enhanced = enhance(image, config3); const resT = model9 == null ? void 0 : model9.execute(enhanced); lastTime5 = now(); - Ot(enhanced); - const genderT = resT.find((t8) => t8.shape[1] === 1); + Lt(enhanced); + const genderT = resT.find((t10) => t10.shape[1] === 1); const gender2 = await genderT.data(); const confidence = Math.trunc(200 * Math.abs(gender2[0] - 0.5)) / 100; if (confidence > (config3.face.description.minConfidence || 0)) { obj.gender = gender2[0] <= 0.5 ? "female" : "male"; obj.genderScore = Math.min(0.99, confidence); } - const argmax = Rk(resT.find((t8) => t8.shape[1] === 100), 1); + const argmax = w1(resT.find((t10) => t10.shape[1] === 100), 1); const ageIdx = (await argmax.data())[0]; - Ot(argmax); - const ageT = resT.find((t8) => t8.shape[1] === 100); + Lt(argmax); + const ageT = resT.find((t10) => t10.shape[1] === 100); const all2 = await ageT.data(); obj.age = Math.round(all2[ageIdx - 1] > all2[ageIdx + 1] ? 10 * ageIdx - 100 * all2[ageIdx - 1] : 10 * ageIdx + 100 * all2[ageIdx + 1]) / 10; if (Number.isNaN(gender2[0]) || Number.isNaN(all2[0])) log("faceres error:", { model: model9, result: resT }); - const desc = resT.find((t8) => t8.shape[1] === 1024); + const desc = resT.find((t10) => t10.shape[1] === 1024); const descriptor = desc ? await desc.data() : []; obj.descriptor = Array.from(descriptor); - resT.forEach((t8) => Ot(t8)); + resT.forEach((t10) => Lt(t10)); } last4[idx] = obj; lastCount2 = count2; @@ -41482,11 +42625,11 @@ async function predict6(image, config3, idx, count2) { // src/face/mask.ts var expandFact = 0.1; var alpha = 0.5; -function insidePoly(x, y8, polygon) { +function insidePoly(x, y4, polygon) { let inside = false; let j = polygon.length - 1; for (let i = 0; i < polygon.length; j = i++) { - if (polygon[i].y > y8 !== polygon[j].y > y8 && x < (polygon[j].x - polygon[i].x) * (y8 - polygon[i].y) / (polygon[j].y - polygon[i].y) + polygon[i].x) + if (polygon[i].y > y4 !== polygon[j].y > y4 && x < (polygon[j].x - polygon[i].x) * (y4 - polygon[i].y) / (polygon[j].y - polygon[i].y) + polygon[i].x) inside = !inside; } return inside; @@ -41505,12 +42648,12 @@ async function mask(face4) { if (expandFact && expandFact > 0) silhouette = silhouette.map((pt2) => ({ x: pt2.x > 0.5 ? pt2.x + expandFact : pt2.x - expandFact, y: pt2.y > 0.5 ? pt2.y + expandFact : pt2.y - expandFact })); for (let x = 0; x < width; x++) { - for (let y8 = 0; y8 < height; y8++) { - const inside = insidePoly(x / width, y8 / width, silhouette); + for (let y4 = 0; y4 < height; y4++) { + const inside = insidePoly(x / width, y4 / width, silhouette); if (!inside) { - buffer.set(alpha * buffer.get(0, y8, x, 0), 0, y8, x, 0); - buffer.set(alpha * buffer.get(0, y8, x, 1), 0, y8, x, 1); - buffer.set(alpha * buffer.get(0, y8, x, 2), 0, y8, x, 2); + buffer.set(alpha * buffer.get(0, y4, x, 0), 0, y4, x, 0); + buffer.set(alpha * buffer.get(0, y4, x, 1), 0, y4, x, 1); + buffer.set(alpha * buffer.get(0, y4, x, 2), 0, y4, x, 2); } } } @@ -41525,20 +42668,20 @@ var skipped6 = Number.MAX_SAFE_INTEGER; var lastCount3 = 0; var lastTime6 = 0; async function load8(config3) { - var _a; + var _a2; if (env.initial) model10 = null; if (!model10) - model10 = await loadModel((_a = config3.face.antispoof) == null ? void 0 : _a.modelPath); + model10 = await loadModel((_a2 = config3.face.antispoof) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", model10["modelUrl"]); return model10; } async function predict7(image, config3, idx, count2) { - var _a, _b; + var _a2, _b; if (!(model10 == null ? void 0 : model10["executor"])) return 0; - const skipTime = (((_a = config3.face.antispoof) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime6; + const skipTime = (((_a2 = config3.face.antispoof) == null ? void 0 : _a2.skipTime) || 0) > now() - lastTime6; const skipFrame = skipped6 < (((_b = config3.face.antispoof) == null ? void 0 : _b.skipFrames) || 0); if (config3.skipAllowed && skipTime && skipFrame && lastCount3 === count2 && cached[idx]) { skipped6++; @@ -41546,13 +42689,13 @@ async function predict7(image, config3, idx, count2) { } skipped6 = 0; return new Promise(async (resolve) => { - const resize = Kj.resizeBilinear(image, [(model10 == null ? void 0 : model10.inputs[0].shape) ? model10.inputs[0].shape[2] : 0, (model10 == null ? void 0 : model10.inputs[0].shape) ? model10.inputs[0].shape[1] : 0], false); + const resize = b5.resizeBilinear(image, [(model10 == null ? void 0 : model10.inputs[0].shape) ? model10.inputs[0].shape[2] : 0, (model10 == null ? void 0 : model10.inputs[0].shape) ? model10.inputs[0].shape[1] : 0], false); const res = model10 == null ? void 0 : model10.execute(resize); const num = (await res.data())[0]; cached[idx] = Math.round(100 * num) / 100; lastCount3 = count2; lastTime6 = now(); - Ot([resize, res]); + Lt([resize, res]); resolve(cached[idx]); }); } @@ -41564,20 +42707,20 @@ var skipped7 = Number.MAX_SAFE_INTEGER; var lastCount4 = 0; var lastTime7 = 0; async function load9(config3) { - var _a; + var _a2; if (env.initial) model11 = null; if (!model11) - model11 = await loadModel((_a = config3.face.liveness) == null ? void 0 : _a.modelPath); + model11 = await loadModel((_a2 = config3.face.liveness) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", model11["modelUrl"]); return model11; } async function predict8(image, config3, idx, count2) { - var _a, _b; + var _a2, _b; if (!(model11 == null ? void 0 : model11["executor"])) return 0; - const skipTime = (((_a = config3.face.liveness) == null ? void 0 : _a.skipTime) || 0) > now() - lastTime7; + const skipTime = (((_a2 = config3.face.liveness) == null ? void 0 : _a2.skipTime) || 0) > now() - lastTime7; const skipFrame = skipped7 < (((_b = config3.face.liveness) == null ? void 0 : _b.skipFrames) || 0); if (config3.skipAllowed && skipTime && skipFrame && lastCount4 === count2 && cached2[idx]) { skipped7++; @@ -41585,13 +42728,13 @@ async function predict8(image, config3, idx, count2) { } skipped7 = 0; return new Promise(async (resolve) => { - const resize = Kj.resizeBilinear(image, [(model11 == null ? void 0 : model11.inputs[0].shape) ? model11.inputs[0].shape[2] : 0, (model11 == null ? void 0 : model11.inputs[0].shape) ? model11.inputs[0].shape[1] : 0], false); + const resize = b5.resizeBilinear(image, [(model11 == null ? void 0 : model11.inputs[0].shape) ? model11.inputs[0].shape[2] : 0, (model11 == null ? void 0 : model11.inputs[0].shape) ? model11.inputs[0].shape[1] : 0], false); const res = model11 == null ? void 0 : model11.execute(resize); const num = (await res.data())[0]; cached2[idx] = Math.round(100 * num) / 100; lastCount4 = count2; lastTime7 = now(); - Ot([resize, res]); + Lt([resize, res]); resolve(cached2[idx]); }); } @@ -41605,20 +42748,20 @@ var lastCount5 = 0; var lastTime8 = 0; var skipped8 = Number.MAX_SAFE_INTEGER; async function load10(config3) { - var _a; + var _a2; if (env.initial) model12 = null; if (!model12) - model12 = await loadModel((_a = config3.face.gear) == null ? void 0 : _a.modelPath); + model12 = await loadModel((_a2 = config3.face.gear) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", model12["modelUrl"]); return model12; } async function predict9(image, config3, idx, count2) { - var _a, _b; + var _a2, _b; if (!model12) return { age: 0, gender: "unknown", genderScore: 0, race: [] }; - const skipFrame = skipped8 < (((_a = config3.face.gear) == null ? void 0 : _a.skipFrames) || 0); + const skipFrame = skipped8 < (((_a2 = config3.face.gear) == null ? void 0 : _a2.skipFrames) || 0); const skipTime = (((_b = config3.face.gear) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime8; if (config3.skipAllowed && skipTime && skipFrame && lastCount5 === count2 && last5[idx]) { skipped8++; @@ -41626,35 +42769,35 @@ async function predict9(image, config3, idx, count2) { } skipped8 = 0; return new Promise(async (resolve) => { - var _a2, _b2, _c2, _d2; + var _a3, _b2, _c2, _d2; if (!(model12 == null ? void 0 : model12.inputs[0].shape)) return; - const t8 = {}; + const t10 = {}; let box = [[0, 0.1, 0.9, 0.9]]; - if (((_a2 = config3.face.gear) == null ? void 0 : _a2["crop"]) > 0) { + if (((_a3 = config3.face.gear) == null ? void 0 : _a3["crop"]) > 0) { const crop = (_b2 = config3.face.gear) == null ? void 0 : _b2["crop"]; box = [[crop, crop, 1 - crop, 1 - crop]]; } - t8.resize = Kj.cropAndResize(image, box, [0], [model12.inputs[0].shape[2], model12.inputs[0].shape[1]]); + t10.resize = b5.cropAndResize(image, box, [0], [model12.inputs[0].shape[2], model12.inputs[0].shape[1]]); const obj = { age: 0, gender: "unknown", genderScore: 0, race: [] }; if ((_c2 = config3.face.gear) == null ? void 0 : _c2.enabled) - [t8.age, t8.gender, t8.race] = model12.execute(t8.resize, ["age_output", "gender_output", "race_output"]); - const gender2 = await t8.gender.data(); + [t10.age, t10.gender, t10.race] = model12.execute(t10.resize, ["age_output", "gender_output", "race_output"]); + const gender2 = await t10.gender.data(); obj.gender = gender2[0] > gender2[1] ? "male" : "female"; obj.genderScore = Math.round(100 * (gender2[0] > gender2[1] ? gender2[0] : gender2[1])) / 100; - const race = await t8.race.data(); + const race = await t10.race.data(); for (let i = 0; i < race.length; i++) { if (race[i] > (((_d2 = config3.face.gear) == null ? void 0 : _d2.minConfidence) || 0.2)) obj.race.push({ score: Math.round(100 * race[i]) / 100, race: raceNames[i] }); } obj.race.sort((a, b) => b.score - a.score); - const ageDistribution = Array.from(await t8.age.data()); + const ageDistribution = Array.from(await t10.age.data()); const ageSorted = ageDistribution.map((a, i) => [ageWeights[i], a]).sort((a, b) => b[1] - a[1]); let age2 = ageSorted[0][0]; for (let i = 1; i < ageSorted.length; i++) age2 += ageSorted[i][1] * (ageSorted[i][0] - age2); obj.age = Math.round(10 * age2) / 10; - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); last5[idx] = obj; lastCount5 = count2; lastTime8 = now(); @@ -41678,10 +42821,10 @@ async function load11(config3) { return model13; } async function predict10(image, config3, idx, count2) { - var _a, _b, _c2, _d2; + var _a2, _b, _c2, _d2; if (!model13) return { age: 0 }; - const skipFrame = skipped9 < (((_a = config3.face["ssrnet"]) == null ? void 0 : _a.skipFrames) || 0); + const skipFrame = skipped9 < (((_a2 = config3.face["ssrnet"]) == null ? void 0 : _a2.skipFrames) || 0); const skipTime = (((_b = config3.face["ssrnet"]) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime9; if (config3.skipAllowed && skipFrame && skipTime && lastCount6 === count2 && ((_c2 = last6[idx]) == null ? void 0 : _c2.age) && ((_d2 = last6[idx]) == null ? void 0 : _d2.age) > 0) { skipped9++; @@ -41689,26 +42832,26 @@ async function predict10(image, config3, idx, count2) { } skipped9 = 0; return new Promise(async (resolve) => { - var _a2, _b2, _c3; + var _a3, _b2, _c3; if (!(model13 == null ? void 0 : model13.inputs) || !model13.inputs[0] || !model13.inputs[0].shape) return; - const t8 = {}; - if (((_a2 = config3.face["ssrnet"]) == null ? void 0 : _a2["crop"]) > 0) { + const t10 = {}; + if (((_a3 = config3.face["ssrnet"]) == null ? void 0 : _a3["crop"]) > 0) { const crop = (_b2 = config3.face["ssrnet"]) == null ? void 0 : _b2["crop"]; const box = [[crop, crop, 1 - crop, 1 - crop]]; - t8.resize = Kj.cropAndResize(image, box, [0], [model13.inputs[0].shape[2], model13.inputs[0].shape[1]]); + t10.resize = b5.cropAndResize(image, box, [0], [model13.inputs[0].shape[2], model13.inputs[0].shape[1]]); } else { - t8.resize = Kj.resizeBilinear(image, [model13.inputs[0].shape[2], model13.inputs[0].shape[1]], false); + t10.resize = b5.resizeBilinear(image, [model13.inputs[0].shape[2], model13.inputs[0].shape[1]], false); } - t8.enhance = se(t8.resize, constants.tf255); + t10.enhance = se(t10.resize, constants.tf255); const obj = { age: 0 }; if ((_c3 = config3.face["ssrnet"]) == null ? void 0 : _c3.enabled) - t8.age = model13.execute(t8.enhance); - if (t8.age) { - const data = await t8.age.data(); + t10.age = model13.execute(t10.enhance); + if (t10.age) { + const data = await t10.age.data(); obj.age = Math.trunc(10 * data[0]) / 10; } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); last6[idx] = obj; lastCount6 = count2; lastTime9 = now(); @@ -41724,20 +42867,20 @@ var lastTime10 = 0; var skipped10 = Number.MAX_SAFE_INTEGER; var rgb2 = [0.2989, 0.587, 0.114]; async function load12(config3) { - var _a; + var _a2; if (env.initial) model14 = null; if (!model14) - model14 = await loadModel((_a = config3.face["ssrnet"]) == null ? void 0 : _a.modelPathGender); + model14 = await loadModel((_a2 = config3.face["ssrnet"]) == null ? void 0 : _a2.modelPathGender); else if (config3.debug) log("cached model:", model14["modelUrl"]); return model14; } async function predict11(image, config3, idx, count2) { - var _a, _b, _c2, _d2; + var _a2, _b, _c2, _d2; if (!model14) return { gender: "unknown", genderScore: 0 }; - const skipFrame = skipped10 < (((_a = config3.face["ssrnet"]) == null ? void 0 : _a.skipFrames) || 0); + const skipFrame = skipped10 < (((_a2 = config3.face["ssrnet"]) == null ? void 0 : _a2.skipFrames) || 0); const skipTime = (((_b = config3.face["ssrnet"]) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime10; if (config3.skipAllowed && skipFrame && skipTime && lastCount7 === count2 && ((_c2 = last7[idx]) == null ? void 0 : _c2.gender) && ((_d2 = last7[idx]) == null ? void 0 : _d2.genderScore) > 0) { skipped10++; @@ -41745,39 +42888,39 @@ async function predict11(image, config3, idx, count2) { } skipped10 = 0; return new Promise(async (resolve) => { - var _a2, _b2, _c3; + var _a3, _b2, _c3; if (!(model14 == null ? void 0 : model14.inputs[0].shape)) return; - const t8 = {}; - if (((_a2 = config3.face["ssrnet"]) == null ? void 0 : _a2["crop"]) > 0) { + const t10 = {}; + if (((_a3 = config3.face["ssrnet"]) == null ? void 0 : _a3["crop"]) > 0) { const crop = (_b2 = config3.face["ssrnet"]) == null ? void 0 : _b2["crop"]; const box = [[crop, crop, 1 - crop, 1 - crop]]; - t8.resize = Kj.cropAndResize(image, box, [0], [model14.inputs[0].shape[2], model14.inputs[0].shape[1]]); + t10.resize = b5.cropAndResize(image, box, [0], [model14.inputs[0].shape[2], model14.inputs[0].shape[1]]); } else { - t8.resize = Kj.resizeBilinear(image, [model14.inputs[0].shape[2], model14.inputs[0].shape[1]], false); + t10.resize = b5.resizeBilinear(image, [model14.inputs[0].shape[2], model14.inputs[0].shape[1]], false); } - t8.enhance = De(() => { - var _a3, _b3; + t10.enhance = De(() => { + var _a4, _b3; let normalize2; - if (((_b3 = (_a3 = model14 == null ? void 0 : model14.inputs) == null ? void 0 : _a3[0].shape) == null ? void 0 : _b3[3]) === 1) { - const [red, green, blue] = ci(t8.resize, 3, 3); + if (((_b3 = (_a4 = model14 == null ? void 0 : model14.inputs) == null ? void 0 : _a4[0].shape) == null ? void 0 : _b3[3]) === 1) { + const [red, green, blue] = Ci(t10.resize, 3, 3); const redNorm = se(red, rgb2[0]); const greenNorm = se(green, rgb2[1]); const blueNorm = se(blue, rgb2[2]); - const grayscale = _k([redNorm, greenNorm, blueNorm]); + const grayscale = y1([redNorm, greenNorm, blueNorm]); normalize2 = se(Te(grayscale, constants.tf05), 2); } else { - normalize2 = se(Te(t8.resize, constants.tf05), 2); + normalize2 = se(Te(t10.resize, constants.tf05), 2); } return normalize2; }); const obj = { gender: "unknown", genderScore: 0 }; if ((_c3 = config3.face["ssrnet"]) == null ? void 0 : _c3.enabled) - t8.gender = model14.execute(t8.enhance); - const data = await t8.gender.data(); + t10.gender = model14.execute(t10.enhance); + const data = await t10.gender.data(); obj.gender = data[0] > data[1] ? "female" : "male"; obj.genderScore = data[0] > data[1] ? Math.trunc(100 * data[0]) / 100 : Math.trunc(100 * data[1]) / 100; - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); last7[idx] = obj; lastCount7 = count2; lastTime10 = now(); @@ -41792,35 +42935,35 @@ var lastCount8 = 0; var lastTime11 = 0; var skipped11 = Number.MAX_SAFE_INTEGER; async function load13(config3) { - var _a; + var _a2; if (env.initial) model15 = null; if (!model15) - model15 = await loadModel((_a = config3.face["mobilefacenet"]) == null ? void 0 : _a.modelPath); + model15 = await loadModel((_a2 = config3.face["mobilefacenet"]) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", model15["modelUrl"]); return model15; } async function predict12(input, config3, idx, count2) { - var _a, _b; + var _a2, _b; if (!(model15 == null ? void 0 : model15["executor"])) return []; - const skipFrame = skipped11 < (((_a = config3.face["mobilefacenet"]) == null ? void 0 : _a.skipFrames) || 0); + const skipFrame = skipped11 < (((_a2 = config3.face["mobilefacenet"]) == null ? void 0 : _a2.skipFrames) || 0); const skipTime = (((_b = config3.face["mobilefacenet"]) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime11; if (config3.skipAllowed && skipTime && skipFrame && lastCount8 === count2 && last8[idx]) { skipped11++; return last8[idx]; } return new Promise(async (resolve) => { - var _a2; + var _a3; let data = []; - if (((_a2 = config3.face["mobilefacenet"]) == null ? void 0 : _a2.enabled) && (model15 == null ? void 0 : model15.inputs[0].shape)) { - const t8 = {}; - t8.crop = Kj.resizeBilinear(input, [model15.inputs[0].shape[2], model15.inputs[0].shape[1]], false); - t8.data = model15.execute(t8.crop); - const output = await t8.data.data(); + if (((_a3 = config3.face["mobilefacenet"]) == null ? void 0 : _a3.enabled) && (model15 == null ? void 0 : model15.inputs[0].shape)) { + const t10 = {}; + t10.crop = b5.resizeBilinear(input, [model15.inputs[0].shape[2], model15.inputs[0].shape[1]], false); + t10.data = model15.execute(t10.crop); + const output = await t10.data.data(); data = Array.from(output); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); } last8[idx] = data; lastCount8 = count2; @@ -41845,25 +42988,25 @@ async function load14(config3) { return model16; } async function predict13(input, config3, idx, count2) { - var _a, _b; + var _a2, _b; if (!(model16 == null ? void 0 : model16["executor"])) return []; - const skipFrame = skipped12 < (((_a = config3.face["insightface"]) == null ? void 0 : _a.skipFrames) || 0); + const skipFrame = skipped12 < (((_a2 = config3.face["insightface"]) == null ? void 0 : _a2.skipFrames) || 0); const skipTime = (((_b = config3.face["insightface"]) == null ? void 0 : _b.skipTime) || 0) > now() - lastTime12; if (config3.skipAllowed && skipTime && skipFrame && lastCount9 === count2 && last9[idx]) { skipped12++; return last9[idx]; } return new Promise(async (resolve) => { - var _a2; + var _a3; let data = []; - if (((_a2 = config3.face["insightface"]) == null ? void 0 : _a2.enabled) && (model16 == null ? void 0 : model16.inputs[0].shape)) { - const t8 = {}; - t8.crop = Kj.resizeBilinear(input, [model16.inputs[0].shape[2], model16.inputs[0].shape[1]], false); - t8.data = model16.execute(t8.crop); - const output = await t8.data.data(); + if (((_a3 = config3.face["insightface"]) == null ? void 0 : _a3.enabled) && (model16 == null ? void 0 : model16.inputs[0].shape)) { + const t10 = {}; + t10.crop = b5.resizeBilinear(input, [model16.inputs[0].shape[2], model16.inputs[0].shape[1]], false); + t10.data = model16.execute(t10.crop); + const output = await t10.data.data(); data = Array.from(output); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); } last9[idx] = data; lastCount9 = count2; @@ -41894,27 +43037,27 @@ var calculateGaze = (face4) => { return { bearing, strength }; }; var calculateFaceAngle = (face4, imageSize) => { - const normalize2 = (v10) => { - const length = Math.sqrt(v10[0] * v10[0] + v10[1] * v10[1] + v10[2] * v10[2]); - v10[0] /= length; - v10[1] /= length; - v10[2] /= length; - return v10; + const normalize2 = (v4) => { + const length = Math.sqrt(v4[0] * v4[0] + v4[1] * v4[1] + v4[2] * v4[2]); + v4[0] /= length; + v4[1] /= length; + v4[2] /= length; + return v4; }; const subVectors = (a, b) => { const x = a[0] - b[0]; - const y8 = a[1] - b[1]; + const y4 = a[1] - b[1]; const z = a[2] - b[2]; - return [x, y8, z]; + return [x, y4, z]; }; const crossVectors = (a, b) => { const x = a[1] * b[2] - a[2] * b[1]; - const y8 = a[2] * b[0] - a[0] * b[2]; + const y4 = a[2] * b[0] - a[0] * b[2]; const z = a[0] * b[1] - a[1] * b[0]; - return [x, y8, z]; + return [x, y4, z]; }; - const rotationMatrixToEulerAngle = (r15) => { - const [r00, _r01, _r02, r102, r112, r122, r20, r21, r222] = r15; + const rotationMatrixToEulerAngle = (r16) => { + const [r00, _r01, _r02, r102, r112, r122, r20, r21, r222] = r16; let thetaX; let thetaY; let thetaZ; @@ -41978,7 +43121,7 @@ function calculateCameraDistance(face4, width) { // src/face/face.ts var detectFace = async (instance, input) => { - var _a, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n2, _o2, _p2, _q, _r2, _s2, _t, _u2, _v2, _w2; + var _a2, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t, _u2, _v2, _w2; let timeStamp = now(); let ageRes; let gearRes; @@ -42003,92 +43146,92 @@ var detectFace = async (instance, input) => { log("Face object is disposed:", faces[i].tensor); continue; } - if ((_a = instance.config.face.detector) == null ? void 0 : _a.mask) { + if ((_a2 = instance.config.face.detector) == null ? void 0 : _a2.mask) { const masked = await mask(faces[i]); - Ot(faces[i].tensor); + Lt(faces[i].tensor); if (masked) faces[i].tensor = masked; } const rotation = faces[i].mesh && faces[i].mesh.length > 200 ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null; instance.analyze("Start Emotion:"); if (instance.config.async) { - emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict5(faces[i].tensor || ar([]), instance.config, i, faces.length) : []; + emotionRes = ((_b = instance.config.face.emotion) == null ? void 0 : _b.enabled) ? predict5(faces[i].tensor || pr([]), instance.config, i, faces.length) : []; } else { instance.state = "run:emotion"; timeStamp = now(); - emotionRes = ((_c2 = instance.config.face.emotion) == null ? void 0 : _c2.enabled) ? await predict5(faces[i].tensor || ar([]), instance.config, i, faces.length) : []; + emotionRes = ((_c2 = instance.config.face.emotion) == null ? void 0 : _c2.enabled) ? await predict5(faces[i].tensor || pr([]), instance.config, i, faces.length) : []; instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp); } instance.analyze("End Emotion:"); instance.analyze("Start AntiSpoof:"); if (instance.config.async) { - antispoofRes = ((_d2 = instance.config.face.antispoof) == null ? void 0 : _d2.enabled) ? predict7(faces[i].tensor || ar([]), instance.config, i, faces.length) : 0; + antispoofRes = ((_d2 = instance.config.face.antispoof) == null ? void 0 : _d2.enabled) ? predict7(faces[i].tensor || pr([]), instance.config, i, faces.length) : 0; } else { instance.state = "run:antispoof"; timeStamp = now(); - antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict7(faces[i].tensor || ar([]), instance.config, i, faces.length) : 0; + antispoofRes = ((_e = instance.config.face.antispoof) == null ? void 0 : _e.enabled) ? await predict7(faces[i].tensor || pr([]), instance.config, i, faces.length) : 0; instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp); } instance.analyze("End AntiSpoof:"); instance.analyze("Start Liveness:"); if (instance.config.async) { - livenessRes = ((_f2 = instance.config.face.liveness) == null ? void 0 : _f2.enabled) ? predict8(faces[i].tensor || ar([]), instance.config, i, faces.length) : 0; + livenessRes = ((_f2 = instance.config.face.liveness) == null ? void 0 : _f2.enabled) ? predict8(faces[i].tensor || pr([]), instance.config, i, faces.length) : 0; } else { instance.state = "run:liveness"; timeStamp = now(); - livenessRes = ((_g2 = instance.config.face.liveness) == null ? void 0 : _g2.enabled) ? await predict8(faces[i].tensor || ar([]), instance.config, i, faces.length) : 0; + livenessRes = ((_g2 = instance.config.face.liveness) == null ? void 0 : _g2.enabled) ? await predict8(faces[i].tensor || pr([]), instance.config, i, faces.length) : 0; instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp); } instance.analyze("End Liveness:"); instance.analyze("Start GEAR:"); if (instance.config.async) { - gearRes = ((_h2 = instance.config.face.gear) == null ? void 0 : _h2.enabled) ? predict9(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + gearRes = ((_h2 = instance.config.face.gear) == null ? void 0 : _h2.enabled) ? predict9(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; } else { instance.state = "run:gear"; timeStamp = now(); - gearRes = ((_i2 = instance.config.face.gear) == null ? void 0 : _i2.enabled) ? await predict9(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + gearRes = ((_i2 = instance.config.face.gear) == null ? void 0 : _i2.enabled) ? await predict9(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; instance.performance.gear = Math.trunc(now() - timeStamp); } instance.analyze("End GEAR:"); instance.analyze("Start SSRNet:"); if (instance.config.async) { - ageRes = ((_j2 = instance.config.face["ssrnet"]) == null ? void 0 : _j2.enabled) ? predict10(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; - genderRes = ((_k2 = instance.config.face["ssrnet"]) == null ? void 0 : _k2.enabled) ? predict11(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + ageRes = ((_j2 = instance.config.face["ssrnet"]) == null ? void 0 : _j2.enabled) ? predict10(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; + genderRes = ((_k2 = instance.config.face["ssrnet"]) == null ? void 0 : _k2.enabled) ? predict11(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; } else { instance.state = "run:ssrnet"; timeStamp = now(); - ageRes = ((_l2 = instance.config.face["ssrnet"]) == null ? void 0 : _l2.enabled) ? await predict10(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; - genderRes = ((_m = instance.config.face["ssrnet"]) == null ? void 0 : _m.enabled) ? await predict11(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + ageRes = ((_l2 = instance.config.face["ssrnet"]) == null ? void 0 : _l2.enabled) ? await predict10(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; + genderRes = ((_m2 = instance.config.face["ssrnet"]) == null ? void 0 : _m2.enabled) ? await predict11(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; instance.performance.ssrnet = Math.trunc(now() - timeStamp); } instance.analyze("End SSRNet:"); instance.analyze("Start MobileFaceNet:"); if (instance.config.async) { - mobilefacenetRes = ((_n2 = instance.config.face["mobilefacenet"]) == null ? void 0 : _n2.enabled) ? predict12(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + mobilefacenetRes = ((_n2 = instance.config.face["mobilefacenet"]) == null ? void 0 : _n2.enabled) ? predict12(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; } else { instance.state = "run:mobilefacenet"; timeStamp = now(); - mobilefacenetRes = ((_o2 = instance.config.face["mobilefacenet"]) == null ? void 0 : _o2.enabled) ? await predict12(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + mobilefacenetRes = ((_o2 = instance.config.face["mobilefacenet"]) == null ? void 0 : _o2.enabled) ? await predict12(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; instance.performance.mobilefacenet = Math.trunc(now() - timeStamp); } instance.analyze("End MobileFaceNet:"); instance.analyze("Start InsightFace:"); if (instance.config.async) { - insightfaceRes = ((_p2 = instance.config.face["insightface"]) == null ? void 0 : _p2.enabled) ? predict13(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + insightfaceRes = ((_p2 = instance.config.face["insightface"]) == null ? void 0 : _p2.enabled) ? predict13(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; } else { instance.state = "run:mobilefacenet"; timeStamp = now(); - insightfaceRes = ((_q = instance.config.face["insightface"]) == null ? void 0 : _q.enabled) ? await predict13(faces[i].tensor || ar([]), instance.config, i, faces.length) : null; + insightfaceRes = ((_q2 = instance.config.face["insightface"]) == null ? void 0 : _q2.enabled) ? await predict13(faces[i].tensor || pr([]), instance.config, i, faces.length) : null; instance.performance.mobilefacenet = Math.trunc(now() - timeStamp); } instance.analyze("End InsightFace:"); instance.analyze("Start Description:"); if (instance.config.async) { - descRes = predict6(faces[i].tensor || ar([]), instance.config, i, faces.length); + descRes = predict6(faces[i].tensor || pr([]), instance.config, i, faces.length); } else { instance.state = "run:description"; timeStamp = now(); - descRes = await predict6(faces[i].tensor || ar([]), instance.config, i, faces.length); + descRes = await predict6(faces[i].tensor || pr([]), instance.config, i, faces.length); instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp); } instance.analyze("End Description:"); @@ -42120,8 +43263,8 @@ var detectFace = async (instance, input) => { descRes.descriptor = insightfaceRes; } const irisSize = ((_v2 = instance.config.face.iris) == null ? void 0 : _v2.enabled) ? calculateCameraDistance(faces[i], input.shape[2]) : 0; - const tensor = ((_w2 = instance.config.face.detector) == null ? void 0 : _w2.return) ? uc(faces[i].tensor) : null; - Ot(faces[i].tensor); + const tensor = ((_w2 = instance.config.face.detector) == null ? void 0 : _w2.return) ? gl(faces[i].tensor) : null; + Lt(faces[i].tensor); if (faces[i].tensor) delete faces[i].tensor; const res = { @@ -42632,12 +43775,12 @@ var face2 = (res) => { return gestures; }; var iris2 = (res) => { - var _a, _b, _c2, _d2; + var _a2, _b, _c2, _d2; if (!res) return []; const gestures = []; for (let i = 0; i < res.length; i++) { - if (!((_b = (_a = res[i].annotations) == null ? void 0 : _a.leftEyeIris) == null ? void 0 : _b[0]) || !((_d2 = (_c2 = res[i].annotations) == null ? void 0 : _c2.rightEyeIris) == null ? void 0 : _d2[0])) + if (!((_b = (_a2 = res[i].annotations) == null ? void 0 : _a2.leftEyeIris) == null ? void 0 : _b[0]) || !((_d2 = (_c2 = res[i].annotations) == null ? void 0 : _c2.rightEyeIris) == null ? void 0 : _d2[0])) continue; const sizeXLeft = res[i].annotations.leftEyeIris[3][0] - res[i].annotations.leftEyeIris[1][0]; const sizeYLeft = res[i].annotations.leftEyeIris[4][1] - res[i].annotations.leftEyeIris[2][1]; @@ -42717,14 +43860,14 @@ function getBoxCenter2(box) { } function cutBoxFromImageAndResize(box, image, cropSize) { const h = image.shape[1]; - const w10 = image.shape[2]; + const w = image.shape[2]; const boxes = [[ box.startPoint[1] / h, - box.startPoint[0] / w10, + box.startPoint[0] / w, box.endPoint[1] / h, - box.endPoint[0] / w10 + box.endPoint[0] / w ]]; - return Kj.cropAndResize(image, boxes, [0], cropSize); + return b5.cropAndResize(image, boxes, [0], cropSize); } function scaleBoxCoordinates2(box, factor) { const startPoint = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]]; @@ -42759,7 +43902,7 @@ function computeRotation2(point1, point2) { const radians = Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]); return normalizeRadians2(radians); } -var buildTranslationMatrix2 = (x, y8) => [[1, 0, x], [0, 1, y8], [0, 0, 1]]; +var buildTranslationMatrix2 = (x, y4) => [[1, 0, x], [0, 1, y4], [0, 0, 1]]; function dot2(v12, v22) { let product = 0; for (let i = 0; i < v12.length; i++) { @@ -45771,59 +46914,59 @@ var HandDetector = class { __publicField(this, "inputSize"); __publicField(this, "inputSizeTensor"); __publicField(this, "doubleInputSizeTensor"); - var _a, _b, _c2, _d2; + var _a2, _b, _c2, _d2; this.model = model23; this.anchors = anchors2.map((anchor) => [anchor.x, anchor.y]); - this.anchorsTensor = cu(this.anchors); - this.inputSize = ((_d2 = (_c2 = (_b = (_a = this == null ? void 0 : this.model) == null ? void 0 : _a.inputs) == null ? void 0 : _b[0]) == null ? void 0 : _c2.shape) == null ? void 0 : _d2[2]) || 0; - this.inputSizeTensor = Jt([this.inputSize, this.inputSize]); - this.doubleInputSizeTensor = Jt([this.inputSize * 2, this.inputSize * 2]); + this.anchorsTensor = bu(this.anchors); + this.inputSize = ((_d2 = (_c2 = (_b = (_a2 = this == null ? void 0 : this.model) == null ? void 0 : _a2.inputs) == null ? void 0 : _b[0]) == null ? void 0 : _c2.shape) == null ? void 0 : _d2[2]) || 0; + this.inputSizeTensor = rr([this.inputSize, this.inputSize]); + this.doubleInputSizeTensor = rr([this.inputSize * 2, this.inputSize * 2]); } normalizeBoxes(boxes) { - const t8 = {}; - t8.boxOffsets = Xe(boxes, [0, 0], [-1, 2]); - t8.boxSizes = Xe(boxes, [0, 2], [-1, 2]); - t8.div = je(t8.boxOffsets, this.inputSizeTensor); - t8.boxCenterPoints = Ce(t8.div, this.anchorsTensor); - t8.halfBoxSizes = je(t8.boxSizes, this.doubleInputSizeTensor); - t8.sub = Te(t8.boxCenterPoints, t8.halfBoxSizes); - t8.startPoints = se(t8.sub, this.inputSizeTensor); - t8.add = Ce(t8.boxCenterPoints, t8.halfBoxSizes); - t8.endPoints = se(t8.add, this.inputSizeTensor); - const res = Qk([t8.startPoints, t8.endPoints], 1); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + const t10 = {}; + t10.boxOffsets = Ye(boxes, [0, 0], [-1, 2]); + t10.boxSizes = Ye(boxes, [0, 2], [-1, 2]); + t10.div = Xe(t10.boxOffsets, this.inputSizeTensor); + t10.boxCenterPoints = Ce(t10.div, this.anchorsTensor); + t10.halfBoxSizes = Xe(t10.boxSizes, this.doubleInputSizeTensor); + t10.sub = Te(t10.boxCenterPoints, t10.halfBoxSizes); + t10.startPoints = se(t10.sub, this.inputSizeTensor); + t10.add = Ce(t10.boxCenterPoints, t10.halfBoxSizes); + t10.endPoints = se(t10.add, this.inputSizeTensor); + const res = V1([t10.startPoints, t10.endPoints], 1); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return res; } normalizeLandmarks(rawPalmLandmarks, index2) { - const t8 = {}; - t8.reshape = W(rawPalmLandmarks, [-1, 7, 2]); - t8.div = je(t8.reshape, this.inputSizeTensor); - t8.landmarks = Ce(t8.div, this.anchors[index2] ? this.anchors[index2] : 0); - const res = se(t8.landmarks, this.inputSizeTensor); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + const t10 = {}; + t10.reshape = W(rawPalmLandmarks, [-1, 7, 2]); + t10.div = Xe(t10.reshape, this.inputSizeTensor); + t10.landmarks = Ce(t10.div, this.anchors[index2] ? this.anchors[index2] : 0); + const res = se(t10.landmarks, this.inputSizeTensor); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return res; } async predict(input, config3) { - var _a; - const t8 = {}; - t8.resize = Kj.resizeBilinear(input, [this.inputSize, this.inputSize]); - t8.div = je(t8.resize, constants.tf127); - t8.image = Te(t8.div, constants.tf1); - t8.batched = this.model.execute(t8.image); - t8.predictions = uc(t8.batched); - t8.slice = Xe(t8.predictions, [0, 0], [-1, 1]); - t8.sigmoid = $a(t8.slice); - t8.scores = uc(t8.sigmoid); - const scores = await t8.scores.data(); - t8.boxes = Xe(t8.predictions, [0, 1], [-1, 4]); - t8.norm = this.normalizeBoxes(t8.boxes); - t8.nms = await Kj.nonMaxSuppressionAsync(t8.norm, t8.scores, 3 * (((_a = config3.hand) == null ? void 0 : _a.maxDetected) || 1), config3.hand.iouThreshold, config3.hand.minConfidence); - const nms = await t8.nms.array(); + var _a2; + const t10 = {}; + t10.resize = b5.resizeBilinear(input, [this.inputSize, this.inputSize]); + t10.div = Xe(t10.resize, constants.tf127); + t10.image = Te(t10.div, constants.tf1); + t10.batched = this.model.execute(t10.image); + t10.predictions = gl(t10.batched); + t10.slice = Ye(t10.predictions, [0, 0], [-1, 1]); + t10.sigmoid = Pa(t10.slice); + t10.scores = gl(t10.sigmoid); + const scores = await t10.scores.data(); + t10.boxes = Ye(t10.predictions, [0, 1], [-1, 4]); + t10.norm = this.normalizeBoxes(t10.boxes); + t10.nms = await b5.nonMaxSuppressionAsync(t10.norm, t10.scores, 3 * (((_a2 = config3.hand) == null ? void 0 : _a2.maxDetected) || 1), config3.hand.iouThreshold, config3.hand.minConfidence); + const nms = await t10.nms.array(); const hands = []; for (const index2 of nms) { const p = {}; - p.box = Xe(t8.norm, [index2, 0], [1, -1]); - p.slice = Xe(t8.predictions, [index2, 5], [1, 14]); + p.box = Ye(t10.norm, [index2, 0], [1, -1]); + p.slice = Ye(t10.predictions, [index2, 5], [1, 14]); p.norm = this.normalizeLandmarks(p.slice, index2); p.palmLandmarks = W(p.norm, [-1, 2]); const box = await p.box.data(); @@ -45833,9 +46976,9 @@ var HandDetector = class { const hand3 = { startPoint, endPoint, palmLandmarks, confidence: scores[index2] }; const scaled = scaleBoxCoordinates2(hand3, [(input.shape[2] || 1) / this.inputSize, (input.shape[1] || 0) / this.inputSize]); hands.push(scaled); - Object.keys(p).forEach((tensor) => Ot(p[tensor])); + Object.keys(p).forEach((tensor) => Lt(p[tensor])); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return hands; } }; @@ -45855,10 +46998,10 @@ var HandPipeline = class { __publicField(this, "storedBoxes"); __publicField(this, "skipped"); __publicField(this, "detectedHands"); - var _a, _b, _c2; + var _a2, _b, _c2; this.handDetector = handDetector; this.handPoseModel = handPoseModel2; - this.inputSize = ((_c2 = (_b = (_a = this.handPoseModel) == null ? void 0 : _a.inputs) == null ? void 0 : _b[0].shape) == null ? void 0 : _c2[2]) || 0; + this.inputSize = ((_c2 = (_b = (_a2 = this.handPoseModel) == null ? void 0 : _a2.inputs) == null ? void 0 : _b[0].shape) == null ? void 0 : _c2[2]) || 0; this.storedBoxes = []; this.skipped = Number.MAX_SAFE_INTEGER; this.detectedHands = 0; @@ -45935,23 +47078,23 @@ var HandPipeline = class { const angle = config3.hand.rotation ? computeRotation2(currentBox.palmLandmarks[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0; const palmCenter = getBoxCenter2(currentBox); const palmCenterNormalized = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]]; - const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? Kj.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone(); + const rotatedImage = config3.hand.rotation && env.kernels.includes("rotatewithoffset") ? b5.rotateWithOffset(image, angle, 0, palmCenterNormalized) : image.clone(); const rotationMatrix = buildRotationMatrix2(-angle, palmCenter); const newBox = useFreshBox ? this.getBoxForPalmLandmarks(currentBox.palmLandmarks, rotationMatrix) : currentBox; const croppedInput = cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]); - const handImage = je(croppedInput, constants.tf255); - Ot(croppedInput); - Ot(rotatedImage); + const handImage = Xe(croppedInput, constants.tf255); + Lt(croppedInput); + Lt(rotatedImage); const [confidenceT, keypoints] = this.handPoseModel.execute(handImage); lastTime13 = now(); - Ot(handImage); + Lt(handImage); const confidence = (await confidenceT.data())[0]; - Ot(confidenceT); + Lt(confidenceT); if (confidence >= config3.hand.minConfidence / 4) { const keypointsReshaped = W(keypoints, [-1, 3]); const rawCoords = await keypointsReshaped.array(); - Ot(keypoints); - Ot(keypointsReshaped); + Lt(keypoints); + Lt(keypointsReshaped); const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix); const nextBoundingBox = this.getBoxForHandLandmarks(coords); this.storedBoxes[i] = { ...nextBoundingBox, confidence }; @@ -45966,7 +47109,7 @@ var HandPipeline = class { } else { this.storedBoxes[i] = null; } - Ot(keypoints); + Lt(keypoints); } else { const enlarged = enlargeBox2(squarifyBox2(currentBox), handBoxEnlargeFactor); const result = { @@ -46066,21 +47209,21 @@ async function predict14(input, config3) { return hands; } async function loadDetect2(config3) { - var _a; + var _a2; if (env.initial) handDetectorModel = null; if (!handDetectorModel) - handDetectorModel = await loadModel((_a = config3.hand.detector) == null ? void 0 : _a.modelPath); + handDetectorModel = await loadModel((_a2 = config3.hand.detector) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", handDetectorModel["modelUrl"]); return handDetectorModel; } async function loadSkeleton(config3) { - var _a; + var _a2; if (env.initial) handPoseModel = null; if (!handPoseModel) - handPoseModel = await loadModel((_a = config3.hand.skeleton) == null ? void 0 : _a.modelPath); + handPoseModel = await loadModel((_a2 = config3.hand.skeleton) == null ? void 0 : _a2.modelPath); else if (config3.debug) log("cached model:", handPoseModel["modelUrl"]); return handPoseModel; @@ -46120,12 +47263,12 @@ var fingerMap = { palm: [0, 17, 13, 9, 5, 1, 0] }; async function loadDetect3(config3) { - var _a; + var _a2; if (env.initial) models2[0] = null; if (!models2[0]) { fakeOps(["tensorlistreserve", "enter", "tensorlistfromtensor", "merge", "loopcond", "switch", "exit", "tensorliststack", "nextiteration", "tensorlistsetitem", "tensorlistgetitem", "reciprocal", "shape", "split", "where"], config3); - models2[0] = await loadModel((_a = config3.hand.detector) == null ? void 0 : _a.modelPath); + models2[0] = await loadModel((_a2 = config3.hand.detector) == null ? void 0 : _a2.modelPath); const inputs = models2[0]["executor"] ? Object.values(models2[0].modelSignature["inputs"]) : void 0; inputSize7[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0; inputSize7[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0; @@ -46134,11 +47277,11 @@ async function loadDetect3(config3) { return models2[0]; } async function loadSkeleton2(config3) { - var _a; + var _a2; if (env.initial) models2[1] = null; if (!models2[1]) { - models2[1] = await loadModel((_a = config3.hand.skeleton) == null ? void 0 : _a.modelPath); + models2[1] = await loadModel((_a2 = config3.hand.skeleton) == null ? void 0 : _a2.modelPath); const inputs = models2[1]["executor"] ? Object.values(models2[1].modelSignature["inputs"]) : void 0; inputSize7[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0; inputSize7[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0; @@ -46150,31 +47293,31 @@ async function detectHands(input, config3) { const hands = []; if (!input || !models2[0]) return hands; - const t8 = {}; + const t10 = {}; const ratio2 = (input.shape[2] || 1) / (input.shape[1] || 1); const height = Math.min(Math.round((input.shape[1] || 0) / 8) * 8, maxDetectorResolution); const width = Math.round(height * ratio2 / 8) * 8; - t8.resize = Kj.resizeBilinear(input, [height, width]); - t8.cast = We(t8.resize, "int32"); - [t8.rawScores, t8.rawBoxes] = await models2[0].executeAsync(t8.cast, modelOutputNodes); - t8.boxes = uc(t8.rawBoxes, [0, 2]); - t8.scores = uc(t8.rawScores, [0]); - const classScores = mo(t8.scores, 1); - Ot(classScores[faceIndex]); + t10.resize = b5.resizeBilinear(input, [height, width]); + t10.cast = Ue(t10.resize, "int32"); + [t10.rawScores, t10.rawBoxes] = await models2[0].executeAsync(t10.cast, modelOutputNodes); + t10.boxes = gl(t10.rawBoxes, [0, 2]); + t10.scores = gl(t10.rawScores, [0]); + const classScores = zo(t10.scores, 1); + Lt(classScores[faceIndex]); classScores.splice(faceIndex, 1); - t8.filtered = vr(classScores, 1); - Ot(classScores); - t8.max = Ra(t8.filtered, 1); - t8.argmax = Rk(t8.filtered, 1); + t10.filtered = Tr(classScores, 1); + Lt(classScores); + t10.max = La(t10.filtered, 1); + t10.argmax = w1(t10.filtered, 1); let id2 = 0; - t8.nms = await Kj.nonMaxSuppressionAsync(t8.boxes, t8.max, (config3.hand.maxDetected || 0) + 1, config3.hand.iouThreshold || 0, config3.hand.minConfidence || 1); - const nms = await t8.nms.data(); - const scores = await t8.max.data(); - const classNum = await t8.argmax.data(); + t10.nms = await b5.nonMaxSuppressionAsync(t10.boxes, t10.max, (config3.hand.maxDetected || 0) + 1, config3.hand.iouThreshold || 0, config3.hand.minConfidence || 1); + const nms = await t10.nms.data(); + const scores = await t10.max.data(); + const classNum = await t10.argmax.data(); for (const nmsIndex of Array.from(nms)) { - const boxSlice = Xe(t8.boxes, nmsIndex, 1); + const boxSlice = Ye(t10.boxes, nmsIndex, 1); const boxYX = await boxSlice.data(); - Ot(boxSlice); + Lt(boxSlice); const boxData = [boxYX[1], boxYX[0], boxYX[3] - boxYX[1], boxYX[2] - boxYX[0]]; const boxRaw = scale(boxData, detectorExpandFact); const boxFull = [Math.trunc(boxData[0] * outputSize[0]), Math.trunc(boxData[1] * outputSize[1]), Math.trunc(boxData[2] * outputSize[0]), Math.trunc(boxData[3] * outputSize[1])]; @@ -46183,7 +47326,7 @@ async function detectHands(input, config3) { const hand3 = { id: id2++, score, box: boxFull, boxRaw, label }; hands.push(hand3); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); hands.sort((a, b) => b.score - a.score); if (hands.length > (config3.hand.maxDetected || 1)) hands.length = config3.hand.maxDetected || 1; @@ -46204,17 +47347,17 @@ async function detectFingers(input, h, config3) { annotations: {} }; if (input && models2[1] && config3.hand.landmarks && h.score > (config3.hand.minConfidence || 0)) { - const t8 = {}; + const t10 = {}; const boxCrop = [h.boxRaw[1], h.boxRaw[0], h.boxRaw[3] + h.boxRaw[1], h.boxRaw[2] + h.boxRaw[0]]; - t8.crop = Kj.cropAndResize(input, [boxCrop], [0], [inputSize7[1][0], inputSize7[1][1]], "bilinear"); - t8.div = je(t8.crop, constants.tf255); - [t8.score, t8.keypoints] = models2[1].execute(t8.div, ["Identity_1", "Identity"]); - const rawScore = (await t8.score.data())[0]; + t10.crop = b5.cropAndResize(input, [boxCrop], [0], [inputSize7[1][0], inputSize7[1][1]], "bilinear"); + t10.div = Xe(t10.crop, constants.tf255); + [t10.score, t10.keypoints] = models2[1].execute(t10.div, ["Identity_1", "Identity"]); + const rawScore = (await t10.score.data())[0]; const score = (100 - Math.trunc(100 / (1 + Math.exp(rawScore)))) / 100; if (score >= (config3.hand.minConfidence || 0)) { hand3.fingerScore = score; - t8.reshaped = W(t8.keypoints, [-1, 3]); - const coordsData = await t8.reshaped.array(); + t10.reshaped = W(t10.keypoints, [-1, 3]); + const coordsData = await t10.reshaped.array(); const coordsRaw = coordsData.map((kpt4) => [kpt4[0] / inputSize7[1][1], kpt4[1] / inputSize7[1][0], kpt4[2] || 0]); const coordsNorm = coordsRaw.map((kpt4) => [kpt4[0] * h.boxRaw[2], kpt4[1] * h.boxRaw[3], kpt4[2] || 0]); hand3.keypoints = coordsNorm.map((kpt4) => [outputSize[0] * (kpt4[0] + h.boxRaw[0]), outputSize[1] * (kpt4[1] + h.boxRaw[1]), kpt4[2] || 0]); @@ -46223,13 +47366,13 @@ async function detectFingers(input, h, config3) { hand3.annotations[key] = fingerMap[key].map((index2) => hand3.landmarks && hand3.keypoints[index2] ? hand3.keypoints[index2] : null); } } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); } return hand3; } async function predict15(input, config3) { - var _a, _b; - if (!((_a = models2[0]) == null ? void 0 : _a["executor"]) || !((_b = models2[1]) == null ? void 0 : _b["executor"]) || !models2[0].inputs[0].shape || !models2[1].inputs[0].shape) + var _a2, _b; + if (!((_a2 = models2[0]) == null ? void 0 : _a2["executor"]) || !((_b = models2[1]) == null ? void 0 : _b["executor"]) || !models2[0].inputs[0].shape || !models2[1].inputs[0].shape) return []; outputSize = [input.shape[2] || 0, input.shape[1] || 0]; skipped13++; @@ -46341,7 +47484,7 @@ var connected3 = { var bufferedResult = empty(); var interpolateTime = 0; function calc2(newResult, config3) { - var _a, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n2, _o2, _p2, _q, _r2, _s2, _t, _u2, _v2, _w2, _x2, _y, _z2; + var _a2, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t, _u2, _v2, _w2, _x2, _y2, _z2; const t02 = now(); if (!newResult) return empty(); @@ -46358,7 +47501,7 @@ function calc2(newResult, config3) { const box = newResult.body[i].box.map((newBoxCoord, j) => ((bufferedFactor - 1) * bufferedResult.body[i].box[j] + newBoxCoord) / bufferedFactor); const boxRaw = newResult.body[i].boxRaw.map((newBoxCoord, j) => ((bufferedFactor - 1) * bufferedResult.body[i].boxRaw[j] + newBoxCoord) / bufferedFactor); const keypoints = newResult.body[i].keypoints.map((newKpt, j) => { - var _a2, _b2, _c3, _d3, _e2, _f3, _g3, _h3, _i3; + var _a3, _b2, _c3, _d3, _e2, _f3, _g3, _h3, _i3; return { score: newKpt.score, part: newKpt.part, @@ -46373,7 +47516,7 @@ function calc2(newResult, config3) { bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].positionRaw[2] || 0) + (newKpt.positionRaw[2] || 0)) / bufferedFactor : newKpt.positionRaw[2] ], distance: [ - bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (((_a2 = bufferedResult.body[i].keypoints[j].distance) == null ? void 0 : _a2[0]) || 0) + (((_b2 = newKpt.distance) == null ? void 0 : _b2[0]) || 0)) / bufferedFactor : (_c3 = newKpt.distance) == null ? void 0 : _c3[0], + bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (((_a3 = bufferedResult.body[i].keypoints[j].distance) == null ? void 0 : _a3[0]) || 0) + (((_b2 = newKpt.distance) == null ? void 0 : _b2[0]) || 0)) / bufferedFactor : (_c3 = newKpt.distance) == null ? void 0 : _c3[0], bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (((_d3 = bufferedResult.body[i].keypoints[j].distance) == null ? void 0 : _d3[1]) || 0) + (((_e2 = newKpt.distance) == null ? void 0 : _e2[1]) || 0)) / bufferedFactor : (_f3 = newKpt.distance) == null ? void 0 : _f3[1], bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (((_g3 = bufferedResult.body[i].keypoints[j].distance) == null ? void 0 : _g3[2]) || 0) + (((_h3 = newKpt.distance) == null ? void 0 : _h3[2]) || 0)) / bufferedFactor : (_i3 = newKpt.distance) == null ? void 0 : _i3[2] ] @@ -46381,7 +47524,7 @@ function calc2(newResult, config3) { }); const annotations2 = {}; let coords = { connected: {} }; - if ((_a = config3.body.modelPath) == null ? void 0 : _a.includes("efficientpose")) + if ((_a2 = config3.body.modelPath) == null ? void 0 : _a2.includes("efficientpose")) coords = efficientposecoords_exports; else if ((_b = config3.body.modelPath) == null ? void 0 : _b.includes("blazepose")) coords = blazeposecoords_exports; @@ -46440,14 +47583,14 @@ function calc2(newResult, config3) { const rotation = { matrix: [0, 0, 0, 0, 0, 0, 0, 0, 0], angle: { roll: 0, yaw: 0, pitch: 0 }, gaze: { bearing: 0, strength: 0 } }; rotation.matrix = (_j2 = newResult.face[i].rotation) == null ? void 0 : _j2.matrix; rotation.angle = { - roll: ((bufferedFactor - 1) * (((_l2 = (_k2 = bufferedResult.face[i].rotation) == null ? void 0 : _k2.angle) == null ? void 0 : _l2.roll) || 0) + (((_n2 = (_m = newResult.face[i].rotation) == null ? void 0 : _m.angle) == null ? void 0 : _n2.roll) || 0)) / bufferedFactor, - yaw: ((bufferedFactor - 1) * (((_p2 = (_o2 = bufferedResult.face[i].rotation) == null ? void 0 : _o2.angle) == null ? void 0 : _p2.yaw) || 0) + (((_r2 = (_q = newResult.face[i].rotation) == null ? void 0 : _q.angle) == null ? void 0 : _r2.yaw) || 0)) / bufferedFactor, + roll: ((bufferedFactor - 1) * (((_l2 = (_k2 = bufferedResult.face[i].rotation) == null ? void 0 : _k2.angle) == null ? void 0 : _l2.roll) || 0) + (((_n2 = (_m2 = newResult.face[i].rotation) == null ? void 0 : _m2.angle) == null ? void 0 : _n2.roll) || 0)) / bufferedFactor, + yaw: ((bufferedFactor - 1) * (((_p2 = (_o2 = bufferedResult.face[i].rotation) == null ? void 0 : _o2.angle) == null ? void 0 : _p2.yaw) || 0) + (((_r2 = (_q2 = newResult.face[i].rotation) == null ? void 0 : _q2.angle) == null ? void 0 : _r2.yaw) || 0)) / bufferedFactor, pitch: ((bufferedFactor - 1) * (((_t = (_s2 = bufferedResult.face[i].rotation) == null ? void 0 : _s2.angle) == null ? void 0 : _t.pitch) || 0) + (((_v2 = (_u2 = newResult.face[i].rotation) == null ? void 0 : _u2.angle) == null ? void 0 : _v2.pitch) || 0)) / bufferedFactor }; rotation.gaze = { // not fully correct due projection on circle, also causes wrap-around draw on jump from negative to positive bearing: ((bufferedFactor - 1) * (((_w2 = bufferedResult.face[i].rotation) == null ? void 0 : _w2.gaze.bearing) || 0) + (((_x2 = newResult.face[i].rotation) == null ? void 0 : _x2.gaze.bearing) || 0)) / bufferedFactor, - strength: ((bufferedFactor - 1) * (((_y = bufferedResult.face[i].rotation) == null ? void 0 : _y.gaze.strength) || 0) + (((_z2 = newResult.face[i].rotation) == null ? void 0 : _z2.gaze.strength) || 0)) / bufferedFactor + strength: ((bufferedFactor - 1) * (((_y2 = bufferedResult.face[i].rotation) == null ? void 0 : _y2.gaze.strength) || 0) + (((_z2 = newResult.face[i].rotation) == null ? void 0 : _z2.gaze.strength) || 0)) / bufferedFactor }; bufferedResult.face[i] = { ...newResult.face[i], rotation, box, boxRaw, annotations: annotations2 }; } else { @@ -46478,8 +47621,8 @@ function calc2(newResult, config3) { bufferedResult.gesture = newResult.gesture; bufferedResult.width = newResult.width; bufferedResult.height = newResult.height; - const t1 = now(); - interpolateTime = env.perfadd ? interpolateTime + Math.round(t1 - t02) : Math.round(t1 - t02); + const t12 = now(); + interpolateTime = env.perfadd ? interpolateTime + Math.round(t12 - t02) : Math.round(t12 - t02); if (newResult.performance) bufferedResult.performance = { ...newResult.performance, interpolate: interpolateTime }; return bufferedResult; @@ -46495,35 +47638,35 @@ async function load15(config3) { return model17; } async function predict16(input, config3) { - var _a; + var _a2; if (!model17) model17 = await load15(config3); - if (!(model17 == null ? void 0 : model17["executor"]) || !((_a = model17 == null ? void 0 : model17.inputs) == null ? void 0 : _a[0].shape)) + if (!(model17 == null ? void 0 : model17["executor"]) || !((_a2 = model17 == null ? void 0 : model17.inputs) == null ? void 0 : _a2[0].shape)) return null; - const t8 = {}; - t8.resize = Kj.resizeBilinear(input, [model17.inputs[0].shape ? model17.inputs[0].shape[1] : 0, model17.inputs[0].shape ? model17.inputs[0].shape[2] : 0], false); - t8.norm = je(t8.resize, constants.tf255); - t8.res = model17.execute(t8.norm); - t8.squeeze = uc(t8.res, [0]); - [t8.bgRaw, t8.fgRaw] = mo(t8.squeeze, 2); - t8.fg = O1(t8.fgRaw); - t8.mul = se(t8.fg, constants.tf255); - t8.expand = Ms(t8.mul, 2); - t8.output = Kj.resizeBilinear(t8.expand, [input.shape[1] || 0, input.shape[2] || 0]); + const t10 = {}; + t10.resize = b5.resizeBilinear(input, [model17.inputs[0].shape ? model17.inputs[0].shape[1] : 0, model17.inputs[0].shape ? model17.inputs[0].shape[2] : 0], false); + t10.norm = Xe(t10.resize, constants.tf255); + t10.res = model17.execute(t10.norm); + t10.squeeze = gl(t10.res, [0]); + [t10.bgRaw, t10.fgRaw] = zo(t10.squeeze, 2); + t10.fg = NN(t10.fgRaw); + t10.mul = se(t10.fg, constants.tf255); + t10.expand = Ks(t10.mul, 2); + t10.output = b5.resizeBilinear(t10.expand, [input.shape[1] || 0, input.shape[2] || 0]); let rgba; switch (config3.segmentation.mode || "default") { case "default": - t8.input = uc(input); - t8.concat = yt([t8.input, t8.output], -1); - rgba = We(t8.concat, "int32"); + t10.input = gl(input); + t10.concat = bt([t10.input, t10.output], -1); + rgba = Ue(t10.concat, "int32"); break; case "alpha": - rgba = We(t8.output, "int32"); + rgba = Ue(t10.output, "int32"); break; default: - rgba = ar(0); + rgba = pr(0); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return rgba; } @@ -46647,9 +47790,9 @@ function jitter(keypoints) { return keypoints; } function padInput(input, inputSize10) { - var _a, _b; - const t8 = {}; - if (!((_a = input == null ? void 0 : input.shape) == null ? void 0 : _a[1]) || !((_b = input == null ? void 0 : input.shape) == null ? void 0 : _b[2])) + var _a2, _b; + const t10 = {}; + if (!((_a2 = input == null ? void 0 : input.shape) == null ? void 0 : _a2[1]) || !((_b = input == null ? void 0 : input.shape) == null ? void 0 : _b[2])) return input; cache5.padding = [ [0, 0], @@ -46661,10 +47804,10 @@ function padInput(input, inputSize10) { [0, 0] // dont touch rbg ]; - t8.pad = Aa(input, cache5.padding); - t8.resize = Kj.resizeBilinear(t8.pad, [inputSize10, inputSize10]); - const final = We(t8.resize, "int32"); - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + t10.pad = za(input, cache5.padding); + t10.resize = b5.resizeBilinear(t10.pad, [inputSize10, inputSize10]); + const final = Ue(t10.resize, "int32"); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return final; } function rescaleBody(body4, outputSize2) { @@ -46695,7 +47838,7 @@ var cache6 = { last: 0 }; async function load16(config3) { - var _a; + var _a2; if (env.initial) model18 = null; if (!model18) { @@ -46703,7 +47846,7 @@ async function load16(config3) { model18 = await loadModel(config3.body.modelPath); } else if (config3.debug) log("cached model:", model18["modelUrl"]); - inputSize8 = (model18 == null ? void 0 : model18["executor"]) && ((_a = model18 == null ? void 0 : model18.inputs) == null ? void 0 : _a[0].shape) ? model18.inputs[0].shape[2] : 0; + inputSize8 = (model18 == null ? void 0 : model18["executor"]) && ((_a2 = model18 == null ? void 0 : model18.inputs) == null ? void 0 : _a2[0].shape) ? model18.inputs[0].shape[2] : 0; if (inputSize8 < 64) inputSize8 = 256; if (A().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) @@ -46792,8 +47935,8 @@ function parseMultiPose(res, config3, image) { return bodies; } async function predict17(input, config3) { - var _a; - if (!(model18 == null ? void 0 : model18["executor"]) || !((_a = model18 == null ? void 0 : model18.inputs) == null ? void 0 : _a[0].shape)) + var _a2; + if (!(model18 == null ? void 0 : model18["executor"]) || !((_a2 = model18 == null ? void 0 : model18.inputs) == null ? void 0 : _a2[0].shape)) return []; if (!config3.skipAllowed) cache6.boxes.length = 0; @@ -46804,18 +47947,18 @@ async function predict17(input, config3) { return cache6.bodies; } return new Promise(async (resolve) => { - const t8 = {}; + const t10 = {}; skipped14 = 0; - t8.input = padInput(input, inputSize8); - t8.res = model18 == null ? void 0 : model18.execute(t8.input); + t10.input = padInput(input, inputSize8); + t10.res = model18 == null ? void 0 : model18.execute(t10.input); cache6.last = now(); - const res = await t8.res.array(); - cache6.bodies = t8.res.shape[2] === 17 ? parseSinglePose(res, config3, input) : parseMultiPose(res, config3, input); + const res = await t10.res.array(); + cache6.bodies = t10.res.shape[2] === 17 ? parseSinglePose(res, config3, input) : parseMultiPose(res, config3, input); for (const body4 of cache6.bodies) { rescaleBody(body4, [input.shape[2] || 1, input.shape[1] || 1]); jitter(body4.keypoints); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); resolve(cache6.bodies); }); } @@ -46837,17 +47980,17 @@ async function load17(config3) { return model19; } async function process4(res, outputShape, config3) { - var _a, _b; + var _a2, _b; let id2 = 0; let results = []; const size2 = inputSize9; for (const strideSize of [1, 2, 4]) { const baseSize = strideSize * 13; - const scoresT = uc(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) === labels2.length)); + const scoresT = gl(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) === labels2.length)); const scores = await scoresT.array(); - const featuresT = uc(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) < labels2.length)); - const boxesMaxT = W(featuresT, [-1, 4, (((_a = featuresT.shape) == null ? void 0 : _a[1]) || 0) / 4]); - const boxIdxT = Rk(boxesMaxT, 2); + const featuresT = gl(res.find((a) => a.shape[1] === baseSize ** 2 && (a.shape[2] || 0) < labels2.length)); + const boxesMaxT = W(featuresT, [-1, 4, (((_a2 = featuresT.shape) == null ? void 0 : _a2[1]) || 0) / 4]); + const boxIdxT = w1(boxesMaxT, 2); const boxIdx = await boxIdxT.array(); for (let i = 0; i < scoresT.shape[0]; i++) { for (let j = 0; j < (((_b = scoresT.shape) == null ? void 0 : _b[1]) || 0); j++) { @@ -46856,15 +47999,15 @@ async function process4(res, outputShape, config3) { const cx2 = (0.5 + Math.trunc(i % baseSize)) / baseSize; const cy2 = (0.5 + Math.trunc(i / baseSize)) / baseSize; const boxOffset = boxIdx[i].map((a) => a * (baseSize / strideSize / size2)); - const [x, y8] = [ + const [x, y4] = [ cx2 - scaleBox / strideSize * boxOffset[0], cy2 - scaleBox / strideSize * boxOffset[1] ]; - const [w10, h] = [ + const [w, h] = [ cx2 + scaleBox / strideSize * boxOffset[2] - x, - cy2 + scaleBox / strideSize * boxOffset[3] - y8 + cy2 + scaleBox / strideSize * boxOffset[3] - y4 ]; - let boxRaw = [x, y8, w10, h]; + let boxRaw = [x, y4, w, h]; boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))); const box = [ // results normalized to input image pixels @@ -46888,15 +48031,15 @@ async function process4(res, outputShape, config3) { } } } - Ot([scoresT, featuresT, boxesMaxT, boxIdxT]); + Lt([scoresT, featuresT, boxesMaxT, boxIdxT]); } const nmsBoxes = results.map((a) => [a.boxRaw[1], a.boxRaw[0], a.boxRaw[3], a.boxRaw[2]]); const nmsScores = results.map((a) => a.score); let nmsIdx = []; if (nmsBoxes && nmsBoxes.length > 0) { - const nms = await Kj.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config3.object.maxDetected || 0, config3.object.iouThreshold, config3.object.minConfidence); + const nms = await b5.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config3.object.maxDetected || 0, config3.object.iouThreshold, config3.object.minConfidence); nmsIdx = Array.from(await nms.data()); - Ot(nms); + Lt(nms); } results = results.filter((_val, idx) => nmsIdx.includes(idx)).sort((a, b) => b.score - a.score); return results; @@ -46915,16 +48058,16 @@ async function predict18(image, config3) { return last10; return new Promise(async (resolve) => { const outputSize2 = [image.shape[2] || 0, image.shape[1] || 0]; - const resizeT = Kj.resizeBilinear(image, [inputSize9, inputSize9], false); - const normT = je(resizeT, constants.tf255); - const transposeT = cc(normT, [0, 3, 1, 2]); + const resizeT = b5.resizeBilinear(image, [inputSize9, inputSize9], false); + const normT = Xe(resizeT, constants.tf255); + const transposeT = yl(normT, [0, 3, 1, 2]); let objectT; if (config3.object.enabled) objectT = model19.execute(transposeT); lastTime15 = now(); const obj = await process4(objectT, outputSize2, config3); last10 = obj; - Ot([resizeT, normT, transposeT, ...objectT]); + Lt([resizeT, normT, transposeT, ...objectT]); resolve(obj); }); } @@ -46988,11 +48131,11 @@ var poseChain = [ ["rightKnee", "rightAnkle"] ]; function getBoundingBox(keypoints) { - const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y: y8 } }) => ({ + const coord = keypoints.reduce(({ maxX, maxY, minX, minY }, { position: { x, y: y4 } }) => ({ maxX: Math.max(maxX, x), - maxY: Math.max(maxY, y8), + maxY: Math.max(maxY, y4), minX: Math.min(minX, x), - minY: Math.min(minY, y8) + minY: Math.min(minY, y4) }), { maxX: Number.NEGATIVE_INFINITY, maxY: Number.NEGATIVE_INFINITY, @@ -47078,23 +48221,23 @@ var MaxHeap = class { return this.getValueAt(i) < this.getValueAt(j); } exchange(i, j) { - const t8 = this.priorityQueue[i]; + const t10 = this.priorityQueue[i]; this.priorityQueue[i] = this.priorityQueue[j]; - this.priorityQueue[j] = t8; + this.priorityQueue[j] = t10; } }; -function getOffsetPoint(y8, x, keypoint, offsets) { +function getOffsetPoint(y4, x, keypoint, offsets) { return { - y: offsets.get(y8, x, keypoint), - x: offsets.get(y8, x, keypoint + count) + y: offsets.get(y4, x, keypoint), + x: offsets.get(y4, x, keypoint + count) }; } function getImageCoords(part, outputStride2, offsets) { const { heatmapY, heatmapX, id: keypoint } = part; - const { y: y8, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets); + const { y: y4, x } = getOffsetPoint(heatmapY, heatmapX, keypoint, offsets); return { x: part.heatmapX * outputStride2 + x, - y: part.heatmapY * outputStride2 + y8 + y: part.heatmapY * outputStride2 + y4 }; } function clamp(a, min, max) { @@ -47215,13 +48358,13 @@ function buildPartWithScoreQueue(minConfidence2, scores) { } return queue; } -function withinRadius(poses, { x, y: y8 }, keypointId) { +function withinRadius(poses, { x, y: y4 }, keypointId) { return poses.some(({ keypoints }) => { - var _a; - const correspondingKeypoint = (_a = keypoints[keypointId]) == null ? void 0 : _a.position; + var _a2; + const correspondingKeypoint = (_a2 = keypoints[keypointId]) == null ? void 0 : _a2.position; if (!correspondingKeypoint) return false; - return squaredDistance(y8, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius; + return squaredDistance(y4, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius; }); } function getInstanceScore(existingPoses, keypoints) { @@ -47255,16 +48398,16 @@ async function predict19(input, config3) { const res = De(() => { if (!model20.inputs[0].shape) return []; - const resized = Kj.resizeBilinear(input, [model20.inputs[0].shape[2], model20.inputs[0].shape[1]]); - const normalized = Te(je(We(resized, "float32"), 127.5), 1); + const resized = b5.resizeBilinear(input, [model20.inputs[0].shape[2], model20.inputs[0].shape[1]]); + const normalized = Te(Xe(Ue(resized, "float32"), 127.5), 1); const results = model20.execute(normalized, poseNetOutputs); - const results3d = results.map((y8) => uc(y8, [0])); - results3d[1] = $a(results3d[1]); + const results3d = results.map((y4) => gl(y4, [0])); + results3d[1] = Pa(results3d[1]); return results3d; }); const buffers = await Promise.all(res.map((tensor) => tensor.buffer())); - for (const t8 of res) - Ot(t8); + for (const t10 of res) + Lt(t10); const decoded = decode(buffers[0], buffers[1], buffers[2], buffers[3], config3.body.maxDetected, config3.body.minConfidence); if (!model20.inputs[0].shape) return []; @@ -47285,13 +48428,13 @@ var outputNodes2 = ["fgr", "pha", "r1o", "r2o", "r3o", "r4o"]; var t = {}; var ratio = 0; function init3(config3) { - Ot([t.r1i, t.r2i, t.r3i, t.r4i, t.downsample_ratio]); - t.r1i = ar(0); - t.r2i = ar(0); - t.r3i = ar(0); - t.r4i = ar(0); + Lt([t.r1i, t.r2i, t.r3i, t.r4i, t.downsample_ratio]); + t.r1i = pr(0); + t.r2i = pr(0); + t.r3i = pr(0); + t.r4i = pr(0); ratio = config3.segmentation.ratio || 0.5; - t.downsample_ratio = ar(ratio); + t.downsample_ratio = pr(ratio); } async function load19(config3) { if (!model21 || env.initial) @@ -47301,34 +48444,34 @@ async function load19(config3) { init3(config3); return model21; } -var normalize = (r15) => De(() => { - const squeeze = uc(r15, [0]); +var normalize = (r16) => De(() => { + const squeeze = gl(r16, [0]); const mul = se(squeeze, constants.tf255); - const cast = We(mul, "int32"); + const cast = Ue(mul, "int32"); return cast; }); function getRGBA(fgr, pha) { - const rgb3 = fgr ? normalize(fgr) : Ea([pha.shape[1] || 0, pha.shape[2] || 0, 3], 255, "int32"); - const a = pha ? normalize(pha) : Ea([fgr.shape[1] || 0, fgr.shape[2] || 0, 1], 255, "int32"); - const rgba = yt([rgb3, a], -1); - Ot([rgb3, a]); + const rgb3 = fgr ? normalize(fgr) : Ma([pha.shape[1] || 0, pha.shape[2] || 0, 3], 255, "int32"); + const a = pha ? normalize(pha) : Ma([fgr.shape[1] || 0, fgr.shape[2] || 0, 1], 255, "int32"); + const rgba = bt([rgb3, a], -1); + Lt([rgb3, a]); return rgba; } function getState(state) { return De(() => { - const r15 = {}; - r15.unstack = mo(state, -1); - r15.concat = yt(r15.unstack, 1); - r15.split = ci(r15.concat, 4, 1); - r15.stack = yt(r15.split, 2); - r15.squeeze = uc(r15.stack, [0]); - r15.expand = Ms(r15.squeeze, -1); - r15.add = Ce(r15.expand, 1); - r15.mul = se(r15.add, 127.5); - r15.cast = We(r15.mul, "int32"); - r15.tile = au(r15.cast, [1, 1, 3]); - r15.alpha = Ea([r15.tile.shape[0] || 0, r15.tile.shape[1] || 0, 1], 255, "int32"); - return yt([r15.tile, r15.alpha], -1); + const r16 = {}; + r16.unstack = zo(state, -1); + r16.concat = bt(r16.unstack, 1); + r16.split = Ci(r16.concat, 4, 1); + r16.stack = bt(r16.split, 2); + r16.squeeze = gl(r16.stack, [0]); + r16.expand = Ks(r16.squeeze, -1); + r16.add = Ce(r16.expand, 1); + r16.mul = se(r16.add, 127.5); + r16.cast = Ue(r16.mul, "int32"); + r16.tile = hu(r16.cast, [1, 1, 3]); + r16.alpha = Ma([r16.tile.shape[0] || 0, r16.tile.shape[1] || 0, 1], 255, "int32"); + return bt([r16.tile, r16.alpha], -1); }); } async function predict20(input, config3) { @@ -47336,7 +48479,7 @@ async function predict20(input, config3) { model21 = await load19(config3); if (!(model21 == null ? void 0 : model21["executor"])) return null; - t.src = je(input, 255); + t.src = Xe(input, 255); if (ratio !== config3.segmentation.ratio) init3(config3); const [fgr, pha, r1o, r2o, r3o, r4o] = await model21.executeAsync(t, outputNodes2); @@ -47355,9 +48498,9 @@ async function predict20(input, config3) { rgba = getState(r1o); break; default: - rgba = ar(0); + rgba = pr(0); } - Ot([t.src, fgr, pha, t.r1i, t.r2i, t.r3i, t.r4i]); + Lt([t.src, fgr, pha, t.r1i, t.r2i, t.r3i, t.r4i]); [t.r1i, t.r2i, t.r3i, t.r4i] = [r1o, r2o, r3o, r4o]; return rgba; } @@ -47372,41 +48515,41 @@ async function load20(config3) { return model22; } async function predict21(input, config3) { - var _a; + var _a2; if (!model22) model22 = await load20(config3); - if (!(model22 == null ? void 0 : model22["executor"]) || !((_a = model22 == null ? void 0 : model22.inputs) == null ? void 0 : _a[0].shape)) + if (!(model22 == null ? void 0 : model22["executor"]) || !((_a2 = model22 == null ? void 0 : model22.inputs) == null ? void 0 : _a2[0].shape)) return null; - const t8 = {}; - t8.resize = Kj.resizeBilinear(input, [model22.inputs[0].shape ? model22.inputs[0].shape[1] : 0, model22.inputs[0].shape ? model22.inputs[0].shape[2] : 0], false); - t8.norm = je(t8.resize, constants.tf255); - t8.res = model22.execute(t8.norm); - t8.squeeze = uc(t8.res, [0]); - t8.alpha = Kj.resizeBilinear(t8.squeeze, [input.shape[1] || 0, input.shape[2] || 0]); - t8.mul = se(t8.alpha, constants.tf255); + const t10 = {}; + t10.resize = b5.resizeBilinear(input, [model22.inputs[0].shape ? model22.inputs[0].shape[1] : 0, model22.inputs[0].shape ? model22.inputs[0].shape[2] : 0], false); + t10.norm = Xe(t10.resize, constants.tf255); + t10.res = model22.execute(t10.norm); + t10.squeeze = gl(t10.res, [0]); + t10.alpha = b5.resizeBilinear(t10.squeeze, [input.shape[1] || 0, input.shape[2] || 0]); + t10.mul = se(t10.alpha, constants.tf255); let rgba; switch (config3.segmentation.mode || "default") { case "default": - t8.input = uc(input); - t8.concat = yt([t8.input, t8.mul], -1); - rgba = We(t8.concat, "int32"); + t10.input = gl(input); + t10.concat = bt([t10.input, t10.mul], -1); + rgba = Ue(t10.concat, "int32"); break; case "alpha": - rgba = We(t8.mul, "int32"); + rgba = Ue(t10.mul, "int32"); break; default: - rgba = ar(0); + rgba = pr(0); } - Object.keys(t8).forEach((tensor) => Ot(t8[tensor])); + Object.keys(t10).forEach((tensor) => Lt(t10[tensor])); return rgba; } // src/models.ts function validateModel(instance, model23, name) { - var _a, _b; + var _a2, _b; if (!model23) return null; - if (!((_a = instance == null ? void 0 : instance.config) == null ? void 0 : _a.validateModels)) + if (!((_a2 = instance == null ? void 0 : instance.config) == null ? void 0 : _a2.validateModels)) return null; const simpleOps = ["const", "placeholder", "noop", "pad", "squeeze", "add", "sub", "mul", "div"]; const ignoreOps = ["biasadd", "fusedbatchnormv3", "matmul", "switch", "shape", "merge", "split", "broadcastto"]; @@ -47466,14 +48609,14 @@ var Models = class { this.models[model23] = null; } async load(instance) { - var _a, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n2, _o2, _p2, _q, _r2, _s2, _t, _u2, _v2, _w2, _x2, _y, _z2, _A2; + var _a2, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t, _u2, _v2, _w2, _x2, _y2, _z2, _A2; if (env.initial) this.reset(); if (instance) this.instance = instance; const m = {}; m.blazeface = this.instance.config.face.enabled && !this.models.blazeface ? load3(this.instance.config) : null; - m.antispoof = this.instance.config.face.enabled && ((_a = this.instance.config.face.antispoof) == null ? void 0 : _a.enabled) && !this.models.antispoof ? load8(this.instance.config) : null; + m.antispoof = this.instance.config.face.enabled && ((_a2 = this.instance.config.face.antispoof) == null ? void 0 : _a2.enabled) && !this.models.antispoof ? load8(this.instance.config) : null; m.liveness = this.instance.config.face.enabled && ((_b = this.instance.config.face.liveness) == null ? void 0 : _b.enabled) && !this.models.liveness ? load9(this.instance.config) : null; m.faceres = this.instance.config.face.enabled && ((_c2 = this.instance.config.face.description) == null ? void 0 : _c2.enabled) && !this.models.faceres ? load7(this.instance.config) : null; m.emotion = this.instance.config.face.enabled && ((_d2 = this.instance.config.face.emotion) == null ? void 0 : _d2.enabled) && !this.models.emotion ? load6(this.instance.config) : null; @@ -47484,12 +48627,12 @@ var Models = class { m.ssrnetgender = this.instance.config.face.enabled && ((_j2 = this.instance.config.face["ssrnet"]) == null ? void 0 : _j2.enabled) && !this.models.ssrnetgender ? load12(this.instance.config) : null; m.mobilefacenet = this.instance.config.face.enabled && ((_k2 = this.instance.config.face["mobilefacenet"]) == null ? void 0 : _k2.enabled) && !this.models.mobilefacenet ? load13(this.instance.config) : null; m.insightface = this.instance.config.face.enabled && ((_l2 = this.instance.config.face["insightface"]) == null ? void 0 : _l2.enabled) && !this.models.insightface ? load14(this.instance.config) : null; - m.blazepose = this.instance.config.body.enabled && !this.models.blazepose && ((_m = this.instance.config.body.modelPath) == null ? void 0 : _m.includes("blazepose")) ? loadPose(this.instance.config) : null; + m.blazepose = this.instance.config.body.enabled && !this.models.blazepose && ((_m2 = this.instance.config.body.modelPath) == null ? void 0 : _m2.includes("blazepose")) ? loadPose(this.instance.config) : null; m.blazeposedetect = this.instance.config.body.enabled && !this.models.blazeposedetect && this.instance.config.body["detector"] && this.instance.config.body["detector"].modelPath ? loadDetect(this.instance.config) : null; m.efficientpose = this.instance.config.body.enabled && !this.models.efficientpose && ((_n2 = this.instance.config.body.modelPath) == null ? void 0 : _n2.includes("efficientpose")) ? load2(this.instance.config) : null; m.movenet = this.instance.config.body.enabled && !this.models.movenet && ((_o2 = this.instance.config.body.modelPath) == null ? void 0 : _o2.includes("movenet")) ? load16(this.instance.config) : null; m.posenet = this.instance.config.body.enabled && !this.models.posenet && ((_p2 = this.instance.config.body.modelPath) == null ? void 0 : _p2.includes("posenet")) ? load18(this.instance.config) : null; - m.handtrack = this.instance.config.hand.enabled && !this.models.handtrack && ((_r2 = (_q = this.instance.config.hand.detector) == null ? void 0 : _q.modelPath) == null ? void 0 : _r2.includes("handtrack")) ? loadDetect3(this.instance.config) : null; + m.handtrack = this.instance.config.hand.enabled && !this.models.handtrack && ((_r2 = (_q2 = this.instance.config.hand.detector) == null ? void 0 : _q2.modelPath) == null ? void 0 : _r2.includes("handtrack")) ? loadDetect3(this.instance.config) : null; m.handskeleton = this.instance.config.hand.enabled && this.instance.config.hand.landmarks && !this.models.handskeleton && ((_t = (_s2 = this.instance.config.hand.detector) == null ? void 0 : _s2.modelPath) == null ? void 0 : _t.includes("handtrack")) ? loadSkeleton2(this.instance.config) : null; if (this.instance.config.hand.enabled && !this.models.handdetect && ((_v2 = (_u2 = this.instance.config.hand.detector) == null ? void 0 : _u2.modelPath) == null ? void 0 : _v2.includes("handdetect"))) { m.handdetect = loadDetect2(this.instance.config); @@ -47497,7 +48640,7 @@ var Models = class { } m.centernet = this.instance.config.object.enabled && !this.models.centernet && ((_w2 = this.instance.config.object.modelPath) == null ? void 0 : _w2.includes("centernet")) ? load(this.instance.config) : null; m.nanodet = this.instance.config.object.enabled && !this.models.nanodet && ((_x2 = this.instance.config.object.modelPath) == null ? void 0 : _x2.includes("nanodet")) ? load17(this.instance.config) : null; - m.selfie = this.instance.config.segmentation.enabled && !this.models.selfie && ((_y = this.instance.config.segmentation.modelPath) == null ? void 0 : _y.includes("selfie")) ? load20(this.instance.config) : null; + m.selfie = this.instance.config.segmentation.enabled && !this.models.selfie && ((_y2 = this.instance.config.segmentation.modelPath) == null ? void 0 : _y2.includes("selfie")) ? load20(this.instance.config) : null; m.meet = this.instance.config.segmentation.enabled && !this.models.meet && ((_z2 = this.instance.config.segmentation.modelPath) == null ? void 0 : _z2.includes("meet")) ? load15(this.instance.config) : null; m.rvm = this.instance.config.segmentation.enabled && !this.models.rvm && ((_A2 = this.instance.config.segmentation.modelPath) == null ? void 0 : _A2.includes("rvm")) ? load19(this.instance.config) : null; for (const [model23, promise] of Object.entries(m)) { @@ -47508,8 +48651,8 @@ var Models = class { } list() { const models3 = Object.keys(this.models).map((model23) => { - var _a; - return { name: model23, loaded: this.models[model23] !== null, size: 0, url: this.models[model23] ? (_a = this.models[model23]) == null ? void 0 : _a["modelUrl"] : null }; + var _a2; + return { name: model23, loaded: this.models[model23] !== null, size: 0, url: this.models[model23] ? (_a2 = this.models[model23]) == null ? void 0 : _a2["modelUrl"] : null }; }); for (const m of models3) { const stats = Object.keys(modelStats).find((s) => s.startsWith(m.name)); @@ -47541,7 +48684,7 @@ var Models = class { // src/util/persons.ts function join2(faces, bodies, hands, gestures, shape) { - var _a, _b, _c2, _d2, _e, _f2; + var _a2, _b, _c2, _d2, _e, _f2; let id2 = 0; const persons = []; for (const face4 of faces) { @@ -47568,7 +48711,7 @@ function join2(faces, bodies, hands, gestures, shape) { person2.gestures.push(gesture2); else if (gesture2["iris"] !== void 0 && gesture2["iris"] === face4.id) person2.gestures.push(gesture2); - else if (gesture2["body"] !== void 0 && gesture2["body"] === ((_a = person2.body) == null ? void 0 : _a.id)) + else if (gesture2["body"] !== void 0 && gesture2["body"] === ((_a2 = person2.body) == null ? void 0 : _a2.id)) person2.gestures.push(gesture2); else if (gesture2["hand"] !== void 0 && gesture2["hand"] === ((_b = person2.hands.left) == null ? void 0 : _b.id)) person2.gestures.push(gesture2); @@ -47576,11 +48719,11 @@ function join2(faces, bodies, hands, gestures, shape) { person2.gestures.push(gesture2); } const x = []; - const y8 = []; + const y4 = []; const extractXY = (box) => { if (box && box.length === 4) { x.push(box[0], box[0] + box[2]); - y8.push(box[1], box[1] + box[3]); + y4.push(box[1], box[1] + box[3]); } }; extractXY(person2.face.box); @@ -47588,8 +48731,8 @@ function join2(faces, bodies, hands, gestures, shape) { extractXY((_e = person2.hands.left) == null ? void 0 : _e.box); extractXY((_f2 = person2.hands.right) == null ? void 0 : _f2.box); const minX = Math.min(...x); - const minY = Math.min(...y8); - person2.box = [minX, minY, Math.max(...x) - minX, Math.max(...y8) - minY]; + const minY = Math.min(...y4); + person2.box = [minX, minY, Math.max(...x) - minX, Math.max(...y4) - minY]; if ((shape == null ? void 0 : shape[1]) && (shape == null ? void 0 : shape[2])) person2.boxRaw = [person2.box[0] / shape[2], person2.box[1] / shape[1], person2.box[2] / shape[2], person2.box[3] / shape[1]]; persons.push(person2); @@ -48394,9 +49537,9 @@ async function warmupNode(instance) { else img = atob2(body3); let res; - if ("node" in tfjs_esm_exports && Cde() === "tensorflow") { - const data = bQt.decodeJpeg(img); - const expanded = Ms(data, 0); + if ("node" in tfjs_esm_exports && Gk() === "tensorflow") { + const data = qtr.decodeJpeg(img); + const expanded = Ks(data, 0); instance.tf.dispose(data); res = await instance.detect(expanded, instance.config); instance.tf.dispose(expanded); @@ -48417,46 +49560,46 @@ async function runInference(instance) { return res; } async function runCompile(instance) { - var _a, _b, _c2, _d2; + var _a2, _b, _c2, _d2; if (!A().flagRegistry.ENGINE_COMPILE_ONLY) return; - const backendType = Cde(); - const webGLBackend = vde(); + const backendType = Gk(); + const webGLBackend = Hk(); if (backendType !== "webgl" && backendType !== "humangl" || !(webGLBackend == null ? void 0 : webGLBackend["checkCompileCompletion"])) { return; } A().set("ENGINE_COMPILE_ONLY", true); - const numTensorsStart = ur().state.numTensors; + const numTensorsStart = cr().state.numTensors; const compiledModels = []; for (const [modelName, model23] of Object.entries(instance.models.models)) { if (!model23) continue; - const shape = (model23 == null ? void 0 : model23.modelSignature) && ((_b = (_a = model23 == null ? void 0 : model23.inputs) == null ? void 0 : _a[0]) == null ? void 0 : _b.shape) ? [...model23.inputs[0].shape] : [1, 64, 64, 3]; + const shape = (model23 == null ? void 0 : model23.modelSignature) && ((_b = (_a2 = model23 == null ? void 0 : model23.inputs) == null ? void 0 : _a2[0]) == null ? void 0 : _b.shape) ? [...model23.inputs[0].shape] : [1, 64, 64, 3]; const dtype = (model23 == null ? void 0 : model23.modelSignature) && ((_d2 = (_c2 = model23 == null ? void 0 : model23.inputs) == null ? void 0 : _c2[0]) == null ? void 0 : _d2.dtype) ? model23.inputs[0].dtype : "float32"; for (let dim = 0; dim < shape.length; dim++) { if (shape[dim] === -1) shape[dim] = dim === 0 ? 1 : 64; } - const tensor = Ur(shape, dtype); + const tensor = Yr(shape, dtype); try { const res = model23.execute(tensor); compiledModels.push(modelName); if (Array.isArray(res)) - res.forEach((t8) => Ot(t8)); + res.forEach((t10) => Lt(t10)); else - Ot(res); + Lt(res); } catch (e) { if (instance.config.debug) log("compile fail model:", modelName); } - Ot(tensor); + Lt(tensor); } const kernels = await webGLBackend["checkCompileCompletionAsync"](); webGLBackend["getUniformLocations"](); if (instance.config.debug) log("compile pass:", { models: compiledModels, kernels: kernels.length }); A().set("ENGINE_COMPILE_ONLY", false); - const numTensorsEnd = ur().state.numTensors; + const numTensorsEnd = cr().state.numTensors; if (numTensorsEnd - numTensorsStart > 0) log("tensor leak:", numTensorsEnd - numTensorsStart); } @@ -48473,9 +49616,9 @@ async function warmup(instance, userConfig) { await instance.models.load(); await runCompile(instance); const res = await runInference(instance); - const t1 = now(); + const t12 = now(); if (instance.config.debug) - log("warmup", instance.config.warmup, Math.round(t1 - t02), "ms"); + log("warmup", instance.config.warmup, Math.round(t12 - t02), "ms"); instance.emit("warmup"); resolve(res); }); @@ -48568,7 +49711,7 @@ var Human = class { return null; if (!input) return "input is not defined"; - if (this.env.node && !(input instanceof mt)) + if (this.env.node && !(input instanceof dt)) return "input must be a tensor"; try { this.tf.getBackend(); @@ -48583,13 +49726,13 @@ var Human = class { __publicField(this, "webcam", new WebCam()); /** emit event */ __publicField(this, "emit", (event) => { - var _a; - if ((_a = this.events) == null ? void 0 : _a.dispatchEvent) + var _a2; + if ((_a2 = this.events) == null ? void 0 : _a2.dispatchEvent) this.events.dispatchEvent(new Event(event)); }); /** internal structure that keeps track of processed videos @hidden */ __privateAdd(this, _loops, {}); - const tfVersion = (Ace.tfjs || _X).replace(/-(.*)/, ""); + const tfVersion = (gme.tfjs || t8).replace(/-(.*)/, ""); config.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tfVersion}/dist/`; config.modelBasePath = env.browser ? "../models/" : "file://models/"; this.version = version; @@ -48661,7 +49804,7 @@ var Human = class { * Returns tensor which contains image data in RGBA format */ async segmentation(input, userConfig) { - var _a, _b, _c2; + var _a2, _b, _c2; if (userConfig) this.config = mergeDeep(this.config, userConfig); if (!this.config.segmentation.enabled) @@ -48670,13 +49813,13 @@ var Human = class { if (!processed.tensor) return null; let tensor = null; - if ((_a = this.config.segmentation.modelPath) == null ? void 0 : _a.includes("rvm")) + if ((_a2 = this.config.segmentation.modelPath) == null ? void 0 : _a2.includes("rvm")) tensor = await predict20(processed.tensor, this.config); if ((_b = this.config.segmentation.modelPath) == null ? void 0 : _b.includes("meet")) tensor = await predict16(processed.tensor, this.config); if ((_c2 = this.config.segmentation.modelPath) == null ? void 0 : _c2.includes("selfie")) tensor = await predict21(processed.tensor, this.config); - Ot(processed.tensor); + Lt(processed.tensor); return tensor; } /** Compare two input tensors for pixel similarity @@ -48713,7 +49856,7 @@ var Human = class { if (this.env.initial) { if (!await check(this, false)) log("error: backend check failed"); - await bde(); + await Zde(); if (this.env.browser) { if (this.config.debug) log("configuration:", this.config); @@ -48752,8 +49895,8 @@ var Human = class { async warmup(userConfig) { const t02 = now(); const res = await warmup(this, userConfig); - const t1 = now(); - this.performance.warmup = Math.trunc(t1 - t02); + const t12 = now(); + this.performance.warmup = Math.trunc(t12 - t02); return res; } /** Run detect with tensorflow profiling @@ -48795,7 +49938,7 @@ var Human = class { async detect(input, userConfig) { this.state = "detect"; return new Promise(async (resolve) => { - var _a, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n2, _o2, _p2, _q, _r2, _s2, _t, _u2; + var _a2, _b, _c2, _d2, _e, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t, _u2; this.state = "config"; let timeStamp; this.config = mergeDeep(this.config, userConfig); @@ -48854,7 +49997,7 @@ var Human = class { this.state = "detect:body"; const bodyConfig = this.config.body.maxDetected === -1 ? mergeDeep(this.config, { body: { maxDetected: this.config.face.enabled ? 1 * faceRes.length : 1 } }) : this.config; if (this.config.async) { - if ((_a = this.config.body.modelPath) == null ? void 0 : _a.includes("posenet")) + if ((_a2 = this.config.body.modelPath) == null ? void 0 : _a2.includes("posenet")) bodyRes = this.config.body.enabled ? predict19(img.tensor, bodyConfig) : []; else if ((_b = this.config.body.modelPath) == null ? void 0 : _b.includes("blazepose")) bodyRes = this.config.body.enabled ? predict(img.tensor, bodyConfig) : []; @@ -48889,7 +50032,7 @@ var Human = class { delete this.performance.hand; } else { timeStamp = now(); - if ((_n2 = (_m = this.config.hand.detector) == null ? void 0 : _m.modelPath) == null ? void 0 : _n2.includes("handdetect")) + if ((_n2 = (_m2 = this.config.hand.detector) == null ? void 0 : _m2.modelPath) == null ? void 0 : _n2.includes("handdetect")) handRes = this.config.hand.enabled ? await predict14(img.tensor, handConfig) : []; else if ((_p2 = (_o2 = this.config.hand.detector) == null ? void 0 : _o2.modelPath) == null ? void 0 : _p2.includes("handtrack")) handRes = this.config.hand.enabled ? await predict15(img.tensor, handConfig) : []; @@ -48899,7 +50042,7 @@ var Human = class { this.analyze("Start Object:"); this.state = "detect:object"; if (this.config.async) { - if ((_q = this.config.object.modelPath) == null ? void 0 : _q.includes("nanodet")) + if ((_q2 = this.config.object.modelPath) == null ? void 0 : _q2.includes("nanodet")) objectRes = this.config.object.enabled ? predict18(img.tensor, this.config) : []; else if ((_r2 = this.config.object.modelPath) == null ? void 0 : _r2.includes("centernet")) objectRes = this.config.object.enabled ? predict2(img.tensor, this.config) : []; @@ -48945,7 +50088,7 @@ var Human = class { return join2(faceRes, bodyRes, handRes, gestureRes, shape); } }; - Ot(img.tensor); + Lt(img.tensor); this.emit("detect"); this.state = "idle"; resolve(this.result); diff --git a/dist/human.esm.js.map b/dist/human.esm.js.map index 8f824470..a2fe9f05 100644 --- a/dist/human.esm.js.map +++ b/dist/human.esm.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["tfjs.esm.js", "../src/util/util.ts", "../src/config.ts", "../src/image/imagefxshaders.ts", "../src/image/imagefx.ts", "../src/image/enhance.ts", "../src/image/image.ts", "../src/util/env.ts", "../src/util/webcam.ts", "../models/models.json", "../src/tfjs/load.ts", "../package.json", "../src/tfjs/humangl.ts", "../src/tfjs/constants.ts", "../src/tfjs/backend.ts", "../src/draw/draw.ts", "../src/draw/primitives.ts", "../src/draw/options.ts", "../src/face/facemeshcoords.ts", "../src/face/constants.ts", "../src/draw/face.ts", "../src/draw/body.ts", "../src/draw/hand.ts", "../src/draw/object.ts", "../src/draw/gesture.ts", "../src/draw/labels.ts", "../src/body/blazeposecoords.ts", "../src/body/blazeposedetector.ts", "../src/util/box.ts", "../src/body/blazepose.ts", "../src/object/labels.ts", "../src/object/centernet.ts", "../src/body/efficientposecoords.ts", "../src/body/efficientpose.ts", "../src/face/facemeshutil.ts", "../src/face/blazeface.ts", "../src/face/iris.ts", "../src/face/attention.ts", "../src/face/facemesh.ts", "../src/gear/emotion.ts", "../src/face/faceres.ts", "../src/face/mask.ts", "../src/face/antispoof.ts", "../src/face/liveness.ts", "../src/gear/gear.ts", "../src/gear/ssrnet-age.ts", "../src/gear/ssrnet-gender.ts", "../src/face/mobilefacenet.ts", "../src/face/insightface.ts", "../src/face/angles.ts", "../src/face/anthropometry.ts", "../src/face/face.ts", "../src/hand/fingerdef.ts", "../src/hand/fingergesture.ts", "../src/hand/fingerpose.ts", "../src/gesture/gesture.ts", "../src/hand/handposeutil.ts", "../src/hand/handposeanchors.ts", "../src/hand/handposedetector.ts", "../src/hand/handposepipeline.ts", "../src/hand/handpose.ts", "../src/hand/handtrack.ts", "../src/result.ts", "../src/body/movenetcoords.ts", "../src/util/interpolate.ts", "../src/segmentation/meet.ts", "../src/face/match.ts", "../src/models.ts", "../src/body/movenetfix.ts", "../src/body/movenet.ts", "../src/object/nanodet.ts", "../src/body/posenetutils.ts", "../src/body/posenet.ts", "../src/segmentation/rvm.ts", "../src/segmentation/selfie.ts", "../src/util/persons.ts", "../src/sample.ts", "../src/warmup.ts", "../src/human.ts"], - "sourcesContent": ["/*\n Human\n homepage: \n author: '\n*/\n\nvar SG=Object.create;var YC=Object.defineProperty;var IG=Object.getOwnPropertyDescriptor;var vG=Object.getOwnPropertyNames;var kG=Object.getPrototypeOf,NG=Object.prototype.hasOwnProperty;var Kt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),qe=(r,t)=>{for(var e in t)YC(r,e,{get:t[e],enumerable:!0})},TG=(r,t,e,o)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of vG(t))!NG.call(r,n)&&n!==e&&YC(r,n,{get:()=>t[n],enumerable:!(o=IG(t,n))||o.enumerable});return r};var Lp=(r,t,e)=>(e=r!=null?SG(kG(r)):{},TG(t||!r||!r.__esModule?YC(e,\"default\",{value:r,enumerable:!0}):e,r));var W0=Kt((tle,V0)=>{V0.exports=kt;var ko=null;try{ko=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(r){}function kt(r,t,e){this.low=r|0,this.high=t|0,this.unsigned=!!e}kt.prototype.__isLong__;Object.defineProperty(kt.prototype,\"__isLong__\",{value:!0});function Vr(r){return(r&&r.__isLong__)===!0}kt.isLong=Vr;var D0={},A0={};function Du(r,t){var e,o,n;return t?(r>>>=0,(n=0<=r&&r<256)&&(o=A0[r],o)?o:(e=Nt(r,(r|0)<0?-1:0,!0),n&&(A0[r]=e),e)):(r|=0,(n=-128<=r&&r<128)&&(o=D0[r],o)?o:(e=Nt(r,r<0?-1:0,!1),n&&(D0[r]=e),e))}kt.fromInt=Du;function No(r,t){if(isNaN(r))return t?Ru:To;if(t){if(r<0)return Ru;if(r>=M0)return z0}else{if(r<=-P0)return zr;if(r+1>=P0)return B0}return r<0?No(-r,t).neg():Nt(r%Xp|0,r/Xp|0,t)}kt.fromNumber=No;function Nt(r,t,e){return new kt(r,t,e)}kt.fromBits=Nt;var Ym=Math.pow;function pw(r,t,e){if(r.length===0)throw Error(\"empty string\");if(r===\"NaN\"||r===\"Infinity\"||r===\"+Infinity\"||r===\"-Infinity\")return To;if(typeof t==\"number\"?(e=t,t=!1):t=!!t,e=e||10,e<2||360)throw Error(\"interior hyphen\");if(o===0)return pw(r.substring(1),t,e).neg();for(var n=No(Ym(e,8)),s=To,a=0;a>>0:this.low};de.toNumber=function(){return this.unsigned?(this.high>>>0)*Xp+(this.low>>>0):this.high*Xp+(this.low>>>0)};de.toString=function(t){if(t=t||10,t<2||36>>0,c=u.toString(t);if(a=p,a.isZero())return c+i;for(;c.length<6;)c=\"0\"+c;i=\"\"+c+i}};de.getHighBits=function(){return this.high};de.getHighBitsUnsigned=function(){return this.high>>>0};de.getLowBits=function(){return this.low};de.getLowBitsUnsigned=function(){return this.low>>>0};de.getNumBitsAbs=function(){if(this.isNegative())return this.eq(zr)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,e=31;e>0&&!(t&1<=0};de.isOdd=function(){return(this.low&1)===1};de.isEven=function(){return(this.low&1)===0};de.equals=function(t){return Vr(t)||(t=As(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};de.eq=de.equals;de.notEquals=function(t){return!this.eq(t)};de.neq=de.notEquals;de.ne=de.notEquals;de.lessThan=function(t){return this.comp(t)<0};de.lt=de.lessThan;de.lessThanOrEqual=function(t){return this.comp(t)<=0};de.lte=de.lessThanOrEqual;de.le=de.lessThanOrEqual;de.greaterThan=function(t){return this.comp(t)>0};de.gt=de.greaterThan;de.greaterThanOrEqual=function(t){return this.comp(t)>=0};de.gte=de.greaterThanOrEqual;de.ge=de.greaterThanOrEqual;de.compare=function(t){if(Vr(t)||(t=As(t)),this.eq(t))return 0;var e=this.isNegative(),o=t.isNegative();return e&&!o?-1:!e&&o?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};de.comp=de.compare;de.negate=function(){return!this.unsigned&&this.eq(zr)?zr:this.not().add(jp)};de.neg=de.negate;de.add=function(t){Vr(t)||(t=As(t));var e=this.high>>>16,o=this.high&65535,n=this.low>>>16,s=this.low&65535,a=t.high>>>16,i=t.high&65535,p=t.low>>>16,u=t.low&65535,c=0,l=0,m=0,d=0;return d+=s+u,m+=d>>>16,d&=65535,m+=n+p,l+=m>>>16,m&=65535,l+=o+i,c+=l>>>16,l&=65535,c+=e+a,c&=65535,Nt(m<<16|d,c<<16|l,this.unsigned)};de.subtract=function(t){return Vr(t)||(t=As(t)),this.add(t.neg())};de.sub=de.subtract;de.multiply=function(t){if(this.isZero())return To;if(Vr(t)||(t=As(t)),ko){var e=ko.mul(this.low,this.high,t.low,t.high);return Nt(e,ko.get_high(),this.unsigned)}if(t.isZero())return To;if(this.eq(zr))return t.isOdd()?zr:To;if(t.eq(zr))return this.isOdd()?zr:To;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(O0)&&t.lt(O0))return No(this.toNumber()*t.toNumber(),this.unsigned);var o=this.high>>>16,n=this.high&65535,s=this.low>>>16,a=this.low&65535,i=t.high>>>16,p=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,m=0,d=0,f=0;return f+=a*c,d+=f>>>16,f&=65535,d+=s*c,m+=d>>>16,d&=65535,d+=a*u,m+=d>>>16,d&=65535,m+=n*c,l+=m>>>16,m&=65535,m+=s*u,l+=m>>>16,m&=65535,m+=a*p,l+=m>>>16,m&=65535,l+=o*c+n*u+s*p+a*i,l&=65535,Nt(d<<16|f,l<<16|m,this.unsigned)};de.mul=de.multiply;de.divide=function(t){if(Vr(t)||(t=As(t)),t.isZero())throw Error(\"division by zero\");if(ko){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var e=(this.unsigned?ko.div_u:ko.div_s)(this.low,this.high,t.low,t.high);return Nt(e,ko.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Ru:To;var o,n,s;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Ru;if(t.gt(this.shru(1)))return L0;s=Ru}else{if(this.eq(zr)){if(t.eq(jp)||t.eq(uw))return zr;if(t.eq(zr))return jp;var a=this.shr(1);return o=a.div(t).shl(1),o.eq(To)?t.isNegative()?jp:uw:(n=this.sub(t.mul(o)),s=o.add(n.div(t)),s)}else if(t.eq(zr))return this.unsigned?Ru:To;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=To}for(n=this;n.gte(t);){o=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var i=Math.ceil(Math.log(o)/Math.LN2),p=i<=48?1:Ym(2,i-48),u=No(o),c=u.mul(t);c.isNegative()||c.gt(n);)o-=p,u=No(o,this.unsigned),c=u.mul(t);u.isZero()&&(u=jp),s=s.add(u),n=n.sub(c)}return s};de.div=de.divide;de.modulo=function(t){if(Vr(t)||(t=As(t)),ko){var e=(this.unsigned?ko.rem_u:ko.rem_s)(this.low,this.high,t.low,t.high);return Nt(e,ko.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};de.mod=de.modulo;de.rem=de.modulo;de.not=function(){return Nt(~this.low,~this.high,this.unsigned)};de.and=function(t){return Vr(t)||(t=As(t)),Nt(this.low&t.low,this.high&t.high,this.unsigned)};de.or=function(t){return Vr(t)||(t=As(t)),Nt(this.low|t.low,this.high|t.high,this.unsigned)};de.xor=function(t){return Vr(t)||(t=As(t)),Nt(this.low^t.low,this.high^t.high,this.unsigned)};de.shiftLeft=function(t){return Vr(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Nt(this.low<>>32-t,this.unsigned):Nt(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):Nt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};de.shr=de.shiftRight;de.shiftRightUnsigned=function(t){if(Vr(t)&&(t=t.toInt()),t&=63,t===0)return this;var e=this.high;if(t<32){var o=this.low;return Nt(o>>>t|e<<32-t,e>>>t,this.unsigned)}else return t===32?Nt(e,0,this.unsigned):Nt(e>>>t-32,0,this.unsigned)};de.shru=de.shiftRightUnsigned;de.shr_u=de.shiftRightUnsigned;de.toSigned=function(){return this.unsigned?Nt(this.low,this.high,!1):this};de.toUnsigned=function(){return this.unsigned?this:Nt(this.low,this.high,!0)};de.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};de.toBytesLE=function(){var t=this.high,e=this.low;return[e&255,e>>>8&255,e>>>16&255,e>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};de.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,e>>>24,e>>>16&255,e>>>8&255,e&255]};kt.fromBytes=function(t,e,o){return o?kt.fromBytesLE(t,e):kt.fromBytesBE(t,e)};kt.fromBytesLE=function(t,e){return new kt(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)};kt.fromBytesBE=function(t,e){return new kt(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}});var vk=Kt(()=>{});var kk=Kt(()=>{});var Z2=Kt((Q2,Vw)=>{(function(r,t,e){function o(i){var p=this,u=a();p.next=function(){var c=2091639*p.s0+p.c*23283064365386963e-26;return p.s0=p.s1,p.s1=p.s2,p.s2=c-(p.c=c|0)},p.c=1,p.s0=u(\" \"),p.s1=u(\" \"),p.s2=u(\" \"),p.s0-=u(i),p.s0<0&&(p.s0+=1),p.s1-=u(i),p.s1<0&&(p.s1+=1),p.s2-=u(i),p.s2<0&&(p.s2+=1),u=null}function n(i,p){return p.c=i.c,p.s0=i.s0,p.s1=i.s1,p.s2=i.s2,p}function s(i,p){var u=new o(i),c=p&&p.state,l=u.next;return l.int32=function(){return u.next()*4294967296|0},l.double=function(){return l()+(l()*2097152|0)*11102230246251565e-32},l.quick=l,c&&(typeof c==\"object\"&&n(c,u),l.state=function(){return n(u,{})}),l}function a(){var i=4022871197,p=function(u){u=String(u);for(var c=0;c>>0,l-=i,l*=i,i=l>>>0,l-=i,i+=l*4294967296}return(i>>>0)*23283064365386963e-26};return p}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.alea=s})(Q2,typeof Vw==\"object\"&&Vw,typeof define==\"function\"&&define)});var e1=Kt((J2,Ww)=>{(function(r,t,e){function o(a){var i=this,p=\"\";i.x=0,i.y=0,i.z=0,i.w=0,i.next=function(){var c=i.x^i.x<<11;return i.x=i.y,i.y=i.z,i.z=i.w,i.w^=i.w>>>19^c^c>>>8},a===(a|0)?i.x=a:p+=a;for(var u=0;u>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(typeof u==\"object\"&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xor128=s})(J2,typeof Ww==\"object\"&&Ww,typeof define==\"function\"&&define)});var r1=Kt((t1,Uw)=>{(function(r,t,e){function o(a){var i=this,p=\"\";i.next=function(){var c=i.x^i.x>>>2;return i.x=i.y,i.y=i.z,i.z=i.w,i.w=i.v,(i.d=i.d+362437|0)+(i.v=i.v^i.v<<4^(c^c<<1))|0},i.x=0,i.y=0,i.z=0,i.w=0,i.v=0,a===(a|0)?i.x=a:p+=a;for(var u=0;u>>4),i.next()}function n(a,i){return i.x=a.x,i.y=a.y,i.z=a.z,i.w=a.w,i.v=a.v,i.d=a.d,i}function s(a,i){var p=new o(a),u=i&&i.state,c=function(){return(p.next()>>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(typeof u==\"object\"&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xorwow=s})(t1,typeof Uw==\"object\"&&Uw,typeof define==\"function\"&&define)});var n1=Kt((o1,Gw)=>{(function(r,t,e){function o(a){var i=this;i.next=function(){var u=i.x,c=i.i,l,m,d;return l=u[c],l^=l>>>7,m=l^l<<24,l=u[c+1&7],m^=l^l>>>10,l=u[c+3&7],m^=l^l>>>3,l=u[c+4&7],m^=l^l<<7,l=u[c+7&7],l=l^l<<13,m^=l^l<<9,u[c]=m,i.i=c+1&7,m};function p(u,c){var l,m,d=[];if(c===(c|0))m=d[0]=c;else for(c=\"\"+c,l=0;l0;--l)u.next()}p(i,a)}function n(a,i){return i.x=a.x.slice(),i.i=a.i,i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,c=function(){return(p.next()>>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(u.x&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xorshift7=s})(o1,typeof Gw==\"object\"&&Gw,typeof define==\"function\"&&define)});var a1=Kt((s1,Hw)=>{(function(r,t,e){function o(a){var i=this;i.next=function(){var u=i.w,c=i.X,l=i.i,m,d;return i.w=u=u+1640531527|0,d=c[l+34&127],m=c[l=l+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=c[l]=d^m,i.i=l,d+(u^u>>>16)|0};function p(u,c){var l,m,d,f,h,g=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+\"\\0\",m=0,x=Math.max(x,c.length)),d=0,f=-32;f>>15,m^=m<<4,m^=m>>>13,f>=0&&(h=h+1640531527|0,l=g[f&127]^=m+h,d=l==0?d+1:0);for(d>=128&&(g[(c&&c.length||0)&127]=-1),d=127,f=4*128;f>0;--f)m=g[d+34&127],l=g[d=d+1&127],m^=m<<13,l^=l<<17,m^=m>>>15,l^=l>>>12,g[d]=m^l;u.w=h,u.X=g,u.i=d}p(i,a)}function n(a,i){return i.i=a.i,i.w=a.w,i.X=a.X.slice(),i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,c=function(){return(p.next()>>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(u.X&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xor4096=s})(s1,typeof Hw==\"object\"&&Hw,typeof define==\"function\"&&define)});var u1=Kt((i1,Kw)=>{(function(r,t,e){function o(a){var i=this,p=\"\";i.next=function(){var c=i.b,l=i.c,m=i.d,d=i.a;return c=c<<25^c>>>7^l,l=l-m|0,m=m<<24^m>>>8^d,d=d-c|0,i.b=c=c<<20^c>>>12^l,i.c=l=l-m|0,i.d=m<<16^l>>>16^d,i.a=d-c|0},i.a=0,i.b=0,i.c=-1640531527,i.d=1367130551,a===Math.floor(a)?(i.a=a/4294967296|0,i.b=a|0):p+=a;for(var u=0;u>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(typeof u==\"object\"&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.tychei=s})(i1,typeof Kw==\"object\"&&Kw,typeof define==\"function\"&&define)});var p1=Kt(()=>{});var l1=Kt((c1,Od)=>{(function(r,t,e){var o=256,n=6,s=52,a=\"random\",i=e.pow(o,n),p=e.pow(2,s),u=p*2,c=o-1,l;function m(C,S,k){var _=[];S=S==!0?{entropy:!0}:S||{};var E=g(h(S.entropy?[C,b(t)]:C==null?x():C,3),_),R=new d(_),D=function(){for(var P=R.g(n),O=i,M=0;P=u;)P/=2,O/=2,M>>>=1;return(P+M)/O};return D.int32=function(){return R.g(4)|0},D.quick=function(){return R.g(4)/4294967296},D.double=D,g(b(R.S),t),(S.pass||k||function(P,O,M,L){return L&&(L.S&&f(L,R),P.state=function(){return f(R,{})}),M?(e[a]=P,O):P})(D,E,\"global\"in S?S.global:this==e,S.state)}function d(C){var S,k=C.length,_=this,E=0,R=_.i=_.j=0,D=_.S=[];for(k||(C=[k++]);E{var vq=Z2(),kq=e1(),Nq=r1(),Tq=n1(),_q=a1(),$q=u1(),Gu=l1();Gu.alea=vq;Gu.xor128=kq;Gu.xorwow=Nq;Gu.xorshift7=Tq;Gu.xor4096=_q;Gu.tychei=$q;m1.exports=Gu});var zv=Kt(()=>{});var Vv=Kt(()=>{});var DB=Kt(()=>{});var AB=Kt(()=>{});var FB=Kt(()=>{});var PB=Kt((Vg,Uv)=>{var Wv=(()=>{var r=typeof document!=\"undefined\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!=\"undefined\"&&(r=r||__filename),function(t){t=t||{};function e(){return oe.buffer!=Ge&&Tt(oe.buffer),lt}function o(){return oe.buffer!=Ge&&Tt(oe.buffer),it}function n(){return oe.buffer!=Ge&&Tt(oe.buffer),ht}function s(){return oe.buffer!=Ge&&Tt(oe.buffer),Mr}function a(){return oe.buffer!=Ge&&Tt(oe.buffer),Mt}function i(){return oe.buffer!=Ge&&Tt(oe.buffer),eo}function p(){return oe.buffer!=Ge&&Tt(oe.buffer),rr}var u=typeof t!=\"undefined\"?t:{},c,l;u.ready=new Promise(function(F,V){c=F,l=V});var m;typeof process!=\"undefined\"&&process.listeners&&(m={uncaughtException:process.listeners(\"uncaughtException\"),unhandledRejection:process.listeners(\"unhandledRejection\")});var d=Object.assign({},u),f=[],h=\"./this.program\",g=(F,V)=>{throw V},x=typeof window==\"object\",b=typeof importScripts==\"function\",C=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",S=u.ENVIRONMENT_IS_PTHREAD||!1,k=\"\";function _(F){return u.locateFile?u.locateFile(F,k):k+F}var E,R,D,P;function O(F){if(F instanceof Iu)return;j(\"exiting due to exception: \"+F)}if(C){var M=zv(),L=Vv();b?k=L.dirname(k)+\"/\":k=__dirname+\"/\",E=(V,ue)=>(V=Dp(V)?new URL(V):L.normalize(V),M.readFileSync(V,ue?void 0:\"utf8\")),D=V=>{var ue=E(V,!0);return ue.buffer||(ue=new Uint8Array(ue)),ue},R=(V,ue,Ee)=>{V=Dp(V)?new URL(V):L.normalize(V),M.readFile(V,function(Be,Le){Be?Ee(Be):ue(Le.buffer)})},process.argv.length>1&&(h=process.argv[1].replace(/\\\\/g,\"/\")),f=process.argv.slice(2),process.on(\"uncaughtException\",function(V){if(!(V instanceof Iu))throw V}),process.on(\"unhandledRejection\",function(V){throw V}),g=(V,ue)=>{if(Lo())throw process.exitCode=V,ue;O(ue),process.exit(V)},u.inspect=function(){return\"[Emscripten Module object]\"};let F;try{F=DB()}catch(V){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),V}global.Worker=F.Worker}else(x||b)&&(b?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.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):k=\"\",C||(E=F=>{var V=new XMLHttpRequest;return V.open(\"GET\",F,!1),V.send(null),V.responseText},b&&(D=F=>{var V=new XMLHttpRequest;return V.open(\"GET\",F,!1),V.responseType=\"arraybuffer\",V.send(null),new Uint8Array(V.response)}),R=(F,V,ue)=>{var Ee=new XMLHttpRequest;Ee.open(\"GET\",F,!0),Ee.responseType=\"arraybuffer\",Ee.onload=()=>{if(Ee.status==200||Ee.status==0&&Ee.response){V(Ee.response);return}ue()},Ee.onerror=ue,Ee.send(null)}),P=F=>document.title=F);C&&typeof performance==\"undefined\"&&(global.performance=AB().performance);var B=console.log.bind(console),z=console.warn.bind(console);C&&(B=F=>M.writeSync(1,F+`\n`),z=F=>M.writeSync(2,F+`\n`));var U=u.print||B,j=u.printErr||z;Object.assign(u,d),d=null,u.arguments&&(f=u.arguments),u.thisProgram&&(h=u.thisProgram),u.quit&&(g=u.quit);var q=4,Y=Atomics.load,J=Atomics.store,re=Atomics.compareExchange,ne;u.wasmBinary&&(ne=u.wasmBinary);var ee=u.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&Su(\"no native wasm support detected\");var oe,ie,le=!1,be;function _e(F,V){F||Su(V)}var ve=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):void 0;function Fe(F,V,ue){V>>>=0;for(var Ee=V+ue,Be=V;F[Be]&&!(Be>=Ee);)++Be;if(Be-V>16&&F.buffer&&ve)return ve.decode(F.buffer instanceof SharedArrayBuffer?F.slice(V,Be):F.subarray(V,Be));for(var Le=\"\";V>10,56320|no&1023)}}return Le}function Pe(F,V){return F>>>=0,F?Fe(o(),F,V):\"\"}function st(F,V,ue,Ee){if(ue>>>=0,!(Ee>0))return 0;for(var Be=ue,Le=ue+Ee-1,ge=0;ge=55296&&Ne<=57343){var Ft=F.charCodeAt(++ge);Ne=65536+((Ne&1023)<<10)|Ft&1023}if(Ne<=127){if(ue>=Le)break;V[ue++>>>0]=Ne}else if(Ne<=2047){if(ue+1>=Le)break;V[ue++>>>0]=192|Ne>>6,V[ue++>>>0]=128|Ne&63}else if(Ne<=65535){if(ue+2>=Le)break;V[ue++>>>0]=224|Ne>>12,V[ue++>>>0]=128|Ne>>6&63,V[ue++>>>0]=128|Ne&63}else{if(ue+3>=Le)break;V[ue++>>>0]=240|Ne>>18,V[ue++>>>0]=128|Ne>>12&63,V[ue++>>>0]=128|Ne>>6&63,V[ue++>>>0]=128|Ne&63}}return V[ue>>>0]=0,ue-Be}function ct(F,V,ue){return st(F,o(),V,ue)}var Ge,lt,it,ht,gt,Mr,Mt,eo,rr;S&&(Ge=u.buffer);function Tt(F){Ge=F,u.HEAP8=lt=new Int8Array(F),u.HEAP16=ht=new Int16Array(F),u.HEAP32=Mr=new Int32Array(F),u.HEAPU8=it=new Uint8Array(F),u.HEAPU16=gt=new Uint16Array(F),u.HEAPU32=Mt=new Uint32Array(F),u.HEAPF32=eo=new Float32Array(F),u.HEAPF64=rr=new Float64Array(F)}var or=u.INITIAL_MEMORY||16777216;if(S)oe=u.wasmMemory,Ge=u.buffer;else if(u.wasmMemory)oe=u.wasmMemory;else if(oe=new WebAssembly.Memory({initial:or/65536,maximum:65536,shared:!0}),!(oe.buffer instanceof SharedArrayBuffer))throw j(\"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\"),C&&j(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),Error(\"bad memory\");oe&&(Ge=oe.buffer),or=Ge.byteLength,Tt(Ge);var nr,to=[],ro=[],fr=[],Va=!1;function Lo(){return ee}function Ks(){if(u.preRun)for(typeof u.preRun==\"function\"&&(u.preRun=[u.preRun]);u.preRun.length;)tl(u.preRun.shift());nl(to)}function Xt(){Va=!0,!S&&nl(ro)}function Wa(){if(!S){if(u.postRun)for(typeof u.postRun==\"function\"&&(u.postRun=[u.postRun]);u.postRun.length;)m0(u.postRun.shift());nl(fr)}}function tl(F){to.unshift(F)}function rl(F){ro.unshift(F)}function m0(F){fr.unshift(F)}var vi=0,Rp=null,Ua=null;function by(F){vi++,u.monitorRunDependencies&&u.monitorRunDependencies(vi)}function bm(F){if(vi--,u.monitorRunDependencies&&u.monitorRunDependencies(vi),vi==0&&(Rp!==null&&(clearInterval(Rp),Rp=null),Ua)){var V=Ua;Ua=null,V()}}function Su(F){u.onAbort&&u.onAbort(F),F=\"Aborted(\"+F+\")\",j(F),le=!0,be=1,F+=\". Build with -sASSERTIONS for more info.\";var V=new WebAssembly.RuntimeError(F);throw l(V),V}var Cy=\"data:application/octet-stream;base64,\";function Cm(F){return F.startsWith(Cy)}function Dp(F){return F.startsWith(\"file://\")}var hr;hr=\"tfjs-backend-wasm-threaded-simd.wasm\",Cm(hr)||(hr=_(hr));function wm(F){try{if(F==hr&&ne)return new Uint8Array(ne);if(D)return D(F);throw\"both async and sync fetching of the wasm failed\"}catch(V){Su(V)}}function wy(){if(!ne&&(x||b)){if(typeof fetch==\"function\"&&!Dp(hr))return fetch(hr,{credentials:\"same-origin\"}).then(function(F){if(!F.ok)throw\"failed to load wasm binary file at '\"+hr+\"'\";return F.arrayBuffer()}).catch(function(){return wm(hr)});if(R)return new Promise(function(F,V){R(hr,function(ue){F(new Uint8Array(ue))},V)})}return Promise.resolve().then(function(){return wm(hr)})}function Sy(){var F={env:Fm,wasi_snapshot_preview1:Fm};function V(ge,Ne){var Ft=ge.exports;if(u.asm=Ft,Ry(u.asm._emscripten_tls_init),nr=u.asm.__indirect_function_table,rl(u.asm.__wasm_call_ctors),ie=Ne,!S){var no=Me.unusedWorkers.length;Me.unusedWorkers.forEach(function(Ha){Me.loadWasmModuleToWorker(Ha,function(){--no||bm(\"wasm-instantiate\")})})}}S||by(\"wasm-instantiate\");function ue(ge){V(ge.instance,ge.module)}function Ee(ge){return wy().then(function(Ne){return WebAssembly.instantiate(Ne,F)}).then(function(Ne){return Ne}).then(ge,function(Ne){j(\"failed to asynchronously prepare wasm: \"+Ne),Su(Ne)})}function Be(){return!ne&&typeof WebAssembly.instantiateStreaming==\"function\"&&!Cm(hr)&&!Dp(hr)&&!C&&typeof fetch==\"function\"?fetch(hr,{credentials:\"same-origin\"}).then(function(ge){var Ne=WebAssembly.instantiateStreaming(ge,F);return Ne.then(ue,function(Ft){return j(\"wasm streaming compile failed: \"+Ft),j(\"falling back to ArrayBuffer instantiation\"),Ee(ue)})}):Ee(ue)}if(u.instantiateWasm)try{var Le=u.instantiateWasm(F,V);return Le}catch(ge){j(\"Module.instantiateWasm callback failed with error: \"+ge),l(ge)}return Be().catch(l),{}}var d0,f0,Sm={};function Iu(F){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+F+\")\",this.status=F}function Iy(F){var V=Me.pthreads[F];delete Me.pthreads[F],V.terminate(),qC(F),Me.runningWorkers.splice(Me.runningWorkers.indexOf(V),1),V.pthread_ptr=0}function vy(F){var V=Me.pthreads[F];V.postMessage({cmd:\"cancel\"})}function ol(F){var V=Me.pthreads[F];_e(V),Me.returnWorkerToPool(V)}function ky(F){var V=Me.getNewWorker();if(!V)return 6;Me.runningWorkers.push(V),Me.pthreads[F.pthread_ptr]=V,V.pthread_ptr=F.pthread_ptr;var ue={cmd:\"run\",start_routine:F.startRoutine,arg:F.arg,pthread_ptr:F.pthread_ptr};return V.runPthread=()=>{C&&V.ref(),V.postMessage(ue,F.transferList),delete V.runPthread},V.loaded&&V.runPthread(),0}var Im={varargs:void 0,get:function(){Im.varargs+=4;var F=s()[Im.varargs-4>>>2];return F},getStr:function(F){var V=Pe(F);return V}};function vm(F){if(S)return ki(1,1,F);be=F,Lo()||(Me.terminateAllThreads(),u.onExit&&u.onExit(F),le=!0),g(F,new Iu(F))}function Ny(F,V){if(be=F,!V&&S)throw Nm(F),\"unwind\";vm(F)}var km=Ny;function Ty(F){if(F instanceof Iu||F==\"unwind\")return be;g(1,F)}var Me={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){S?Me.initWorker():Me.initMainThread()},initMainThread:function(){for(var F=8;F--;)Me.allocateUnusedWorker()},initWorker:function(){ee=!1},setExitStatus:function(F){be=F},terminateAllThreads:function(){for(var F of Object.values(Me.pthreads))Me.returnWorkerToPool(F);for(var F of Me.unusedWorkers)F.terminate();Me.unusedWorkers=[]},returnWorkerToPool:function(F){var V=F.pthread_ptr;delete Me.pthreads[V],Me.unusedWorkers.push(F),Me.runningWorkers.splice(Me.runningWorkers.indexOf(F),1),F.pthread_ptr=0,C&&F.unref(),qC(V)},receiveObjectTransfer:function(F){},threadInitTLS:function(){Me.tlsInitFunctions.forEach(F=>F())},loadWasmModuleToWorker:function(F,V){F.onmessage=Le=>{var ge=Le.data,Ne=ge.cmd;if(F.pthread_ptr&&(Me.currentProxiedOperationCallerThread=F.pthread_ptr),ge.targetThread&&ge.targetThread!=zm()){var Ft=Me.pthreads[ge.targetThread];Ft?Ft.postMessage(ge,ge.transferList):j('Internal error! Worker sent a message \"'+Ne+'\" to target pthread '+ge.targetThread+\", but that thread no longer exists!\"),Me.currentProxiedOperationCallerThread=void 0;return}Ne===\"processProxyingQueue\"?sl(ge.queue):Ne===\"spawnThread\"?ky(ge):Ne===\"cleanupThread\"?ol(ge.thread):Ne===\"killThread\"?Iy(ge.thread):Ne===\"cancelThread\"?vy(ge.thread):Ne===\"loaded\"?(F.loaded=!0,C&&F.unref(),V&&V(F),F.runPthread&&F.runPthread()):Ne===\"print\"?U(\"Thread \"+ge.threadId+\": \"+ge.text):Ne===\"printErr\"?j(\"Thread \"+ge.threadId+\": \"+ge.text):Ne===\"alert\"?alert(\"Thread \"+ge.threadId+\": \"+ge.text):ge.target===\"setimmediate\"?F.postMessage(ge):Ne===\"callHandler\"?u[ge.handler](...ge.args):Ne&&j(\"worker sent an unknown command \"+Ne),Me.currentProxiedOperationCallerThread=void 0},F.onerror=Le=>{var ge=\"worker sent an error!\";throw j(ge+\" \"+Le.filename+\":\"+Le.lineno+\": \"+Le.message),Le},C&&(F.on(\"message\",function(Le){F.onmessage({data:Le})}),F.on(\"error\",function(Le){F.onerror(Le)}),F.on(\"detachedExit\",function(){}));var ue=[],Ee=[\"onExit\",\"onAbort\",\"print\",\"printErr\"];for(var Be of Ee)u.hasOwnProperty(Be)&&ue.push(Be);F.postMessage({cmd:\"load\",handlers:ue,urlOrBlob:u.mainScriptUrlOrBlob||r,wasmMemory:oe,wasmModule:ie})},allocateUnusedWorker:function(){var F,V=_(\"tfjs-backend-wasm-threaded-simd.worker.js\");F=new Worker(V),Me.unusedWorkers.push(F)},getNewWorker:function(){return Me.unusedWorkers.length==0&&(Me.allocateUnusedWorker(),Me.loadWasmModuleToWorker(Me.unusedWorkers[0])),Me.unusedWorkers.pop()}};u.PThread=Me;function nl(F){for(;F.length>0;)F.shift()(u)}function _y(){var F=zm(),V=s()[F+52>>>2],ue=s()[F+56>>>2],Ee=V-ue;C0(V,Ee),Vm(V)}u.establishStackSpace=_y;function Nm(F){if(S)return ki(2,0,F);try{km(F)}catch(V){Ty(V)}}var Ap=[];function $y(F){var V=Ap[F];return V||(F>=Ap.length&&(Ap.length=F+1),Ap[F]=V=nr.get(F)),V}function Ey(F,V){var ue=$y(F)(V);Lo()?Me.setExitStatus(ue):b0(ue)}u.invokeEntryPoint=Ey;function Ry(F){Me.tlsInitFunctions.push(F)}function Dy(F){g0(F,!b,1,!x),Me.threadInitTLS()}function Ay(F){S?postMessage({cmd:\"cleanupThread\",thread:F}):ol(F)}function Tm(F,V,ue,Ee){return S?ki(3,1,F,V,ue,Ee):_m(F,V,ue,Ee)}function _m(F,V,ue,Ee){if(typeof SharedArrayBuffer==\"undefined\")return j(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var Be=[],Le=0;if(S&&(Be.length===0||Le))return Tm(F,V,ue,Ee);if(Le)return Le;var ge={startRoutine:ue,pthread_ptr:F,arg:Ee,transferList:Be};return S?(ge.cmd=\"spawnThread\",postMessage(ge,Be),0):ky(ge)}function Fy(){return 65536}var Py=!0;function Oy(){return Py}function sl(F){Atomics.store(s(),F>>2,1),zm()&&y0(F),Atomics.compareExchange(s(),F>>2,1,0)}u.executeNotifiedProxyingQueue=sl;function My(F,V,ue,Ee){if(F==V)setTimeout(()=>sl(Ee));else if(S)postMessage({targetThread:F,cmd:\"processProxyingQueue\",queue:Ee});else{var Be=Me.pthreads[F];if(!Be)return;Be.postMessage({cmd:\"processProxyingQueue\",queue:Ee})}return 1}function Ly(F,V,ue){return-1}function By(){Su(\"\")}function vu(F){vu.shown||(vu.shown={}),vu.shown[F]||(vu.shown[F]=1,C&&(F=\"warning: \"+F),j(F))}function zy(){C||b||vu(\"Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread\")}function Vy(){return Date.now()}function $m(){return 4294901760}function Wy(){return $m()}var al;C?al=()=>{var F=process.hrtime();return F[0]*1e3+F[1]/1e6}:al=()=>performance.timeOrigin+performance.now();function Uy(F,V,ue){o().copyWithin(F>>>0,V>>>0,V+ue>>>0)}function Gy(){return C?FB().cpus().length:navigator.hardwareConcurrency}function Hy(F){var V=jC(),ue=F();return Vm(V),ue}function ki(F,V){var ue=arguments.length-2,Ee=arguments;return Hy(()=>{for(var Be=ue,Le=Wm(Be*8),ge=Le>>3,Ne=0;Ne>>0]=Ft}return x0(F,Be,Le,V)})}var il=[];function Ky(F,V,ue){il.length=V;for(var Ee=ue>>3,Be=0;Be>>0];var Le=F<0,ge=Le?Sm[-F-1]:tb[F];return ge.apply(null,il)}function qy(F){try{return oe.grow(F-Ge.byteLength+65535>>>16),Tt(oe.buffer),1}catch(V){}}function jy(F){var V=o().length;if(F=F>>>0,F<=V)return!1;var ue=$m();if(F>ue)return!1;let Ee=(Ft,no)=>Ft+(no-Ft%no)%no;for(var Be=1;Be<=4;Be*=2){var Le=V*(1+.2/Be);Le=Math.min(Le,F+100663296);var ge=Math.min(ue,Ee(Math.max(F,Le),65536)),Ne=qy(ge);if(Ne)return!0}return!1}function Xy(){throw\"unwind\"}function Em(F){return S?ki(4,1,F):52}function Rm(F,V,ue,Ee,Be){return S?ki(5,1,F,V,ue,Ee,Be):70}var Yy=[null,[],[]];function Qy(F,V){var ue=Yy[F];V===0||V===10?((F===1?U:j)(Fe(ue,0)),ue.length=0):ue.push(V)}function Dm(F,V,ue,Ee){if(S)return ki(6,1,F,V,ue,Ee);for(var Be=0,Le=0;Le>>2],Ne=a()[V+4>>>2];V+=8;for(var Ft=0;Ft>>0]);Be+=Ne}return a()[Ee>>>2]=Be,0}function Am(F){var V=u[\"_\"+F];return V}function Zy(F,V){e().set(F,V>>>0)}function Jy(F,V,ue,Ee,Be){var Le={string:Lr=>{var Mp=0;if(Lr!=null&&Lr!==0){var I0=(Lr.length<<2)+1;Mp=Wm(I0),ct(Lr,Mp,I0)}return Mp},array:Lr=>{var Mp=Wm(Lr.length);return Zy(Lr,Mp),Mp}};function ge(Lr){return V===\"string\"?Pe(Lr):V===\"boolean\"?!!Lr:Lr}var Ne=Am(F),Ft=[],no=0;if(Ee)for(var Ha=0;Hage===\"number\"||ge===\"boolean\"),Le=V!==\"string\";return Le&&Be&&!Ee?Am(F):function(){return Jy(F,V,ue,arguments,Ee)}}Me.init();var tb=[null,vm,Nm,Tm,Em,Rm,Dm],Fm={__emscripten_init_main_thread_js:Dy,__emscripten_thread_cleanup:Ay,__pthread_create_js:_m,_emscripten_default_pthread_stack_size:Fy,_emscripten_get_now_is_monotonic:Oy,_emscripten_notify_task_queue:My,_emscripten_set_offscreencanvas_size:Ly,abort:By,emscripten_check_blocking_allowed:zy,emscripten_date_now:Vy,emscripten_get_heap_max:Wy,emscripten_get_now:al,emscripten_memcpy_big:Uy,emscripten_num_logical_cores:Gy,emscripten_receive_on_main_thread_js:Ky,emscripten_resize_heap:jy,emscripten_unwind_to_js_event_loop:Xy,exit:km,fd_close:Em,fd_seek:Rm,fd_write:Dm,memory:oe||u.wasmMemory},h0=Sy(),rb=u.___wasm_call_ctors=function(){return(rb=u.___wasm_call_ctors=u.asm.__wasm_call_ctors).apply(null,arguments)},ob=u._init=function(){return(ob=u._init=u.asm.init).apply(null,arguments)},nb=u._init_with_threads_count=function(){return(nb=u._init_with_threads_count=u.asm.init_with_threads_count).apply(null,arguments)},sb=u._get_threads_count=function(){return(sb=u._get_threads_count=u.asm.get_threads_count).apply(null,arguments)},ab=u._register_tensor=function(){return(ab=u._register_tensor=u.asm.register_tensor).apply(null,arguments)},ib=u._dispose_data=function(){return(ib=u._dispose_data=u.asm.dispose_data).apply(null,arguments)},ub=u._dispose=function(){return(ub=u._dispose=u.asm.dispose).apply(null,arguments)},pb=u._Abs=function(){return(pb=u._Abs=u.asm.Abs).apply(null,arguments)},cb=u._Acos=function(){return(cb=u._Acos=u.asm.Acos).apply(null,arguments)},lb=u._Acosh=function(){return(lb=u._Acosh=u.asm.Acosh).apply(null,arguments)},mb=u._Add=function(){return(mb=u._Add=u.asm.Add).apply(null,arguments)},db=u._AddN=function(){return(db=u._AddN=u.asm.AddN).apply(null,arguments)},fb=u._All=function(){return(fb=u._All=u.asm.All).apply(null,arguments)},hb=u._Any=function(){return(hb=u._Any=u.asm.Any).apply(null,arguments)},gb=u._ArgMax=function(){return(gb=u._ArgMax=u.asm.ArgMax).apply(null,arguments)},xb=u._ArgMin=function(){return(xb=u._ArgMin=u.asm.ArgMin).apply(null,arguments)},yb=u._Asin=function(){return(yb=u._Asin=u.asm.Asin).apply(null,arguments)},bb=u._Asinh=function(){return(bb=u._Asinh=u.asm.Asinh).apply(null,arguments)},Cb=u._Atan=function(){return(Cb=u._Atan=u.asm.Atan).apply(null,arguments)},wb=u._Atan2=function(){return(wb=u._Atan2=u.asm.Atan2).apply(null,arguments)},Sb=u._Atanh=function(){return(Sb=u._Atanh=u.asm.Atanh).apply(null,arguments)},Ib=u._AvgPool=function(){return(Ib=u._AvgPool=u.asm.AvgPool).apply(null,arguments)},vb=u._AvgPool3D=function(){return(vb=u._AvgPool3D=u.asm.AvgPool3D).apply(null,arguments)},kb=u._AvgPool3DGrad=function(){return(kb=u._AvgPool3DGrad=u.asm.AvgPool3DGrad).apply(null,arguments)},Nb=u._AvgPoolGrad=function(){return(Nb=u._AvgPoolGrad=u.asm.AvgPoolGrad).apply(null,arguments)},Tb=u._BatchMatMul=function(){return(Tb=u._BatchMatMul=u.asm.BatchMatMul).apply(null,arguments)},_b=u._Bincount=function(){return(_b=u._Bincount=u.asm.Bincount).apply(null,arguments)},$b=u._BitwiseAnd=function(){return($b=u._BitwiseAnd=u.asm.BitwiseAnd).apply(null,arguments)},Eb=u._Ceil=function(){return(Eb=u._Ceil=u.asm.Ceil).apply(null,arguments)},Rb=u._ClipByValue=function(){return(Rb=u._ClipByValue=u.asm.ClipByValue).apply(null,arguments)},Db=u._Conv2D=function(){return(Db=u._Conv2D=u.asm.Conv2D).apply(null,arguments)},Ab=u._Conv2DBackpropInput=function(){return(Ab=u._Conv2DBackpropInput=u.asm.Conv2DBackpropInput).apply(null,arguments)},Fb=u._Conv3D=function(){return(Fb=u._Conv3D=u.asm.Conv3D).apply(null,arguments)},Pb=u._Conv3DBackpropFilterV2=function(){return(Pb=u._Conv3DBackpropFilterV2=u.asm.Conv3DBackpropFilterV2).apply(null,arguments)},Ob=u._Conv3DBackpropInputV2=function(){return(Ob=u._Conv3DBackpropInputV2=u.asm.Conv3DBackpropInputV2).apply(null,arguments)},Mb=u._Cos=function(){return(Mb=u._Cos=u.asm.Cos).apply(null,arguments)},Lb=u._Cosh=function(){return(Lb=u._Cosh=u.asm.Cosh).apply(null,arguments)},Bb=u._CropAndResize=function(){return(Bb=u._CropAndResize=u.asm.CropAndResize).apply(null,arguments)},zb=u._Cumprod=function(){return(zb=u._Cumprod=u.asm.Cumprod).apply(null,arguments)},Vb=u._Cumsum=function(){return(Vb=u._Cumsum=u.asm.Cumsum).apply(null,arguments)},Wb=u._DenseBincount=function(){return(Wb=u._DenseBincount=u.asm.DenseBincount).apply(null,arguments)},Ub=u._DepthToSpace=function(){return(Ub=u._DepthToSpace=u.asm.DepthToSpace).apply(null,arguments)},Gb=u._DepthwiseConv2dNative=function(){return(Gb=u._DepthwiseConv2dNative=u.asm.DepthwiseConv2dNative).apply(null,arguments)},Hb=u._Diag=function(){return(Hb=u._Diag=u.asm.Diag).apply(null,arguments)},Kb=u._Dilation2D=function(){return(Kb=u._Dilation2D=u.asm.Dilation2D).apply(null,arguments)},qb=u._Dilation2DBackpropFilter=function(){return(qb=u._Dilation2DBackpropFilter=u.asm.Dilation2DBackpropFilter).apply(null,arguments)},jb=u._Dilation2DBackpropInput=function(){return(jb=u._Dilation2DBackpropInput=u.asm.Dilation2DBackpropInput).apply(null,arguments)},Xb=u._Elu=function(){return(Xb=u._Elu=u.asm.Elu).apply(null,arguments)},Yb=u._EluGrad=function(){return(Yb=u._EluGrad=u.asm.EluGrad).apply(null,arguments)},Qb=u._Equal=function(){return(Qb=u._Equal=u.asm.Equal).apply(null,arguments)},Zb=u._Erf=function(){return(Zb=u._Erf=u.asm.Erf).apply(null,arguments)},Jb=u._Exp=function(){return(Jb=u._Exp=u.asm.Exp).apply(null,arguments)},eC=u._Expm1=function(){return(eC=u._Expm1=u.asm.Expm1).apply(null,arguments)},tC=u._FlipLeftRight=function(){return(tC=u._FlipLeftRight=u.asm.FlipLeftRight).apply(null,arguments)},rC=u._Floor=function(){return(rC=u._Floor=u.asm.Floor).apply(null,arguments)},oC=u._FloorDiv=function(){return(oC=u._FloorDiv=u.asm.FloorDiv).apply(null,arguments)},nC=u._FusedBatchNorm=function(){return(nC=u._FusedBatchNorm=u.asm.FusedBatchNorm).apply(null,arguments)},sC=u._FusedConv2D=function(){return(sC=u._FusedConv2D=u.asm.FusedConv2D).apply(null,arguments)},aC=u._FusedDepthwiseConv2D=function(){return(aC=u._FusedDepthwiseConv2D=u.asm.FusedDepthwiseConv2D).apply(null,arguments)},iC=u._Gather=function(){return(iC=u._Gather=u.asm.Gather).apply(null,arguments)},uC=u._GatherNd=function(){return(uC=u._GatherNd=u.asm.GatherNd).apply(null,arguments)},pC=u._Greater=function(){return(pC=u._Greater=u.asm.Greater).apply(null,arguments)},cC=u._GreaterEqual=function(){return(cC=u._GreaterEqual=u.asm.GreaterEqual).apply(null,arguments)},lC=u._IsFinite=function(){return(lC=u._IsFinite=u.asm.IsFinite).apply(null,arguments)},mC=u._IsInf=function(){return(mC=u._IsInf=u.asm.IsInf).apply(null,arguments)},dC=u._IsNan=function(){return(dC=u._IsNan=u.asm.IsNan).apply(null,arguments)},fC=u._LRN=function(){return(fC=u._LRN=u.asm.LRN).apply(null,arguments)},hC=u._LRNGrad=function(){return(hC=u._LRNGrad=u.asm.LRNGrad).apply(null,arguments)},gC=u._LeakyRelu=function(){return(gC=u._LeakyRelu=u.asm.LeakyRelu).apply(null,arguments)},xC=u._Less=function(){return(xC=u._Less=u.asm.Less).apply(null,arguments)},yC=u._LessEqual=function(){return(yC=u._LessEqual=u.asm.LessEqual).apply(null,arguments)},bC=u._LinSpace=function(){return(bC=u._LinSpace=u.asm.LinSpace).apply(null,arguments)},CC=u._Log=function(){return(CC=u._Log=u.asm.Log).apply(null,arguments)},wC=u._Log1p=function(){return(wC=u._Log1p=u.asm.Log1p).apply(null,arguments)},SC=u._LogicalAnd=function(){return(SC=u._LogicalAnd=u.asm.LogicalAnd).apply(null,arguments)},IC=u._LogicalNot=function(){return(IC=u._LogicalNot=u.asm.LogicalNot).apply(null,arguments)},vC=u._LogicalOr=function(){return(vC=u._LogicalOr=u.asm.LogicalOr).apply(null,arguments)},kC=u._LogicalXor=function(){return(kC=u._LogicalXor=u.asm.LogicalXor).apply(null,arguments)},NC=u._Max=function(){return(NC=u._Max=u.asm.Max).apply(null,arguments)},TC=u._MaxPool=function(){return(TC=u._MaxPool=u.asm.MaxPool).apply(null,arguments)},_C=u._MaxPool3D=function(){return(_C=u._MaxPool3D=u.asm.MaxPool3D).apply(null,arguments)},$C=u._MaxPool3DGrad=function(){return($C=u._MaxPool3DGrad=u.asm.MaxPool3DGrad).apply(null,arguments)},EC=u._MaxPoolGrad=function(){return(EC=u._MaxPoolGrad=u.asm.MaxPoolGrad).apply(null,arguments)},RC=u._MaxPoolWithArgmax=function(){return(RC=u._MaxPoolWithArgmax=u.asm.MaxPoolWithArgmax).apply(null,arguments)},DC=u._Maximum=function(){return(DC=u._Maximum=u.asm.Maximum).apply(null,arguments)},AC=u._Mean=function(){return(AC=u._Mean=u.asm.Mean).apply(null,arguments)},FC=u._Min=function(){return(FC=u._Min=u.asm.Min).apply(null,arguments)},PC=u._Minimum=function(){return(PC=u._Minimum=u.asm.Minimum).apply(null,arguments)},OC=u._MirrorPad=function(){return(OC=u._MirrorPad=u.asm.MirrorPad).apply(null,arguments)},MC=u._Mod=function(){return(MC=u._Mod=u.asm.Mod).apply(null,arguments)},LC=u._Multinomial=function(){return(LC=u._Multinomial=u.asm.Multinomial).apply(null,arguments)},BC=u._Multiply=function(){return(BC=u._Multiply=u.asm.Multiply).apply(null,arguments)},zC=u._Neg=function(){return(zC=u._Neg=u.asm.Neg).apply(null,arguments)},VC=u._NonMaxSuppressionV3=function(){return(VC=u._NonMaxSuppressionV3=u.asm.NonMaxSuppressionV3).apply(null,arguments)},WC=u._NonMaxSuppressionV4=function(){return(WC=u._NonMaxSuppressionV4=u.asm.NonMaxSuppressionV4).apply(null,arguments)},Pm=u._NonMaxSuppressionV5=function(){return(Pm=u._NonMaxSuppressionV5=u.asm.NonMaxSuppressionV5).apply(null,arguments)},Om=u._NotEqual=function(){return(Om=u._NotEqual=u.asm.NotEqual).apply(null,arguments)},ul=u._OneHot=function(){return(ul=u._OneHot=u.asm.OneHot).apply(null,arguments)},UC=u._PadV2=function(){return(UC=u._PadV2=u.asm.PadV2).apply(null,arguments)},GC=u._Pow=function(){return(GC=u._Pow=u.asm.Pow).apply(null,arguments)},Fp=u._Prelu=function(){return(Fp=u._Prelu=u.asm.Prelu).apply(null,arguments)},Mm=u._Prod=function(){return(Mm=u._Prod=u.asm.Prod).apply(null,arguments)},Pp=u._RealDiv=function(){return(Pp=u._RealDiv=u.asm.RealDiv).apply(null,arguments)},Op=u._Reciprocal=function(){return(Op=u._Reciprocal=u.asm.Reciprocal).apply(null,arguments)},HC=u._Relu=function(){return(HC=u._Relu=u.asm.Relu).apply(null,arguments)},K=u._Relu6=function(){return(K=u._Relu6=u.asm.Relu6).apply(null,arguments)},ae=u._ResizeBilinear=function(){return(ae=u._ResizeBilinear=u.asm.ResizeBilinear).apply(null,arguments)},$e=u._ResizeBilinearGrad=function(){return($e=u._ResizeBilinearGrad=u.asm.ResizeBilinearGrad).apply(null,arguments)},at=u._ResizeNearestNeighbor=function(){return(at=u._ResizeNearestNeighbor=u.asm.ResizeNearestNeighbor).apply(null,arguments)},_t=u._ResizeNearestNeighborGrad=function(){return(_t=u._ResizeNearestNeighborGrad=u.asm.ResizeNearestNeighborGrad).apply(null,arguments)},$t=u._Reverse=function(){return($t=u._Reverse=u.asm.Reverse).apply(null,arguments)},Qe=u._RotateWithOffset=function(){return(Qe=u._RotateWithOffset=u.asm.RotateWithOffset).apply(null,arguments)},Ke=u._Round=function(){return(Ke=u._Round=u.asm.Round).apply(null,arguments)},Ut=u._Rsqrt=function(){return(Ut=u._Rsqrt=u.asm.Rsqrt).apply(null,arguments)},oo=u._ScatterNd=function(){return(oo=u._ScatterNd=u.asm.ScatterNd).apply(null,arguments)},Ga=u._SearchSorted=function(){return(Ga=u._SearchSorted=u.asm.SearchSorted).apply(null,arguments)},Lm=u._SelectV2=function(){return(Lm=u._SelectV2=u.asm.SelectV2).apply(null,arguments)},pl=u._Selu=function(){return(pl=u._Selu=u.asm.Selu).apply(null,arguments)},KC=u._Sigmoid=function(){return(KC=u._Sigmoid=u.asm.Sigmoid).apply(null,arguments)},yr=u._Sign=function(){return(yr=u._Sign=u.asm.Sign).apply(null,arguments)},Ni=u._Sin=function(){return(Ni=u._Sin=u.asm.Sin).apply(null,arguments)},Bm=u._Sinh=function(){return(Bm=u._Sinh=u.asm.Sinh).apply(null,arguments)},UU=u._Softmax=function(){return(UU=u._Softmax=u.asm.Softmax).apply(null,arguments)},GU=u._Softplus=function(){return(GU=u._Softplus=u.asm.Softplus).apply(null,arguments)},HU=u._SparseFillEmptyRows=function(){return(HU=u._SparseFillEmptyRows=u.asm.SparseFillEmptyRows).apply(null,arguments)},KU=u._SparseReshape=function(){return(KU=u._SparseReshape=u.asm.SparseReshape).apply(null,arguments)},qU=u._SparseSegmentReduction=function(){return(qU=u._SparseSegmentReduction=u.asm.SparseSegmentReduction).apply(null,arguments)},jU=u._SparseToDense=function(){return(jU=u._SparseToDense=u.asm.SparseToDense).apply(null,arguments)},XU=u._Sqrt=function(){return(XU=u._Sqrt=u.asm.Sqrt).apply(null,arguments)},YU=u._Square=function(){return(YU=u._Square=u.asm.Square).apply(null,arguments)},QU=u._SquaredDifference=function(){return(QU=u._SquaredDifference=u.asm.SquaredDifference).apply(null,arguments)},ZU=u._Step=function(){return(ZU=u._Step=u.asm.Step).apply(null,arguments)},JU=u._StridedSlice=function(){return(JU=u._StridedSlice=u.asm.StridedSlice).apply(null,arguments)},eG=u._Sub=function(){return(eG=u._Sub=u.asm.Sub).apply(null,arguments)},tG=u._Sum=function(){return(tG=u._Sum=u.asm.Sum).apply(null,arguments)},rG=u._Tan=function(){return(rG=u._Tan=u.asm.Tan).apply(null,arguments)},oG=u._Tanh=function(){return(oG=u._Tanh=u.asm.Tanh).apply(null,arguments)},nG=u._TensorScatterUpdate=function(){return(nG=u._TensorScatterUpdate=u.asm.TensorScatterUpdate).apply(null,arguments)},sG=u._Tile=function(){return(sG=u._Tile=u.asm.Tile).apply(null,arguments)},aG=u._TopK=function(){return(aG=u._TopK=u.asm.TopK).apply(null,arguments)},iG=u._Transform=function(){return(iG=u._Transform=u.asm.Transform).apply(null,arguments)},uG=u._Transpose=function(){return(uG=u._Transpose=u.asm.Transpose).apply(null,arguments)},pG=u.__FusedMatMul=function(){return(pG=u.__FusedMatMul=u.asm._FusedMatMul).apply(null,arguments)},cG=u._malloc=function(){return(cG=u._malloc=u.asm.malloc).apply(null,arguments)},lG=u._free=function(){return(lG=u._free=u.asm.free).apply(null,arguments)},mG=u.__emscripten_tls_init=function(){return(mG=u.__emscripten_tls_init=u.asm._emscripten_tls_init).apply(null,arguments)},zm=u._pthread_self=function(){return(zm=u._pthread_self=u.asm.pthread_self).apply(null,arguments)},dG=u.___errno_location=function(){return(dG=u.___errno_location=u.asm.__errno_location).apply(null,arguments)},g0=u.__emscripten_thread_init=function(){return(g0=u.__emscripten_thread_init=u.asm._emscripten_thread_init).apply(null,arguments)},fG=u.__emscripten_thread_crashed=function(){return(fG=u.__emscripten_thread_crashed=u.asm._emscripten_thread_crashed).apply(null,arguments)},hG=u._emscripten_main_thread_process_queued_calls=function(){return(hG=u._emscripten_main_thread_process_queued_calls=u.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},gG=u._emscripten_main_browser_thread_id=function(){return(gG=u._emscripten_main_browser_thread_id=u.asm.emscripten_main_browser_thread_id).apply(null,arguments)},x0=u._emscripten_run_in_main_runtime_thread_js=function(){return(x0=u._emscripten_run_in_main_runtime_thread_js=u.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)},xG=u._emscripten_dispatch_to_thread_=function(){return(xG=u._emscripten_dispatch_to_thread_=u.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},y0=u.__emscripten_proxy_execute_task_queue=function(){return(y0=u.__emscripten_proxy_execute_task_queue=u.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)},qC=u.__emscripten_thread_free_data=function(){return(qC=u.__emscripten_thread_free_data=u.asm._emscripten_thread_free_data).apply(null,arguments)},b0=u.__emscripten_thread_exit=function(){return(b0=u.__emscripten_thread_exit=u.asm._emscripten_thread_exit).apply(null,arguments)},C0=u._emscripten_stack_set_limits=function(){return(C0=u._emscripten_stack_set_limits=u.asm.emscripten_stack_set_limits).apply(null,arguments)},jC=u.stackSave=function(){return(jC=u.stackSave=u.asm.stackSave).apply(null,arguments)},Vm=u.stackRestore=function(){return(Vm=u.stackRestore=u.asm.stackRestore).apply(null,arguments)},Wm=u.stackAlloc=function(){return(Wm=u.stackAlloc=u.asm.stackAlloc).apply(null,arguments)},yG=u.dynCall_iijjiiii=function(){return(yG=u.dynCall_iijjiiii=u.asm.dynCall_iijjiiii).apply(null,arguments)},bG=u.dynCall_jiji=function(){return(bG=u.dynCall_jiji=u.asm.dynCall_jiji).apply(null,arguments)};u.keepRuntimeAlive=Lo,u.wasmMemory=oe,u.cwrap=eb,u.ExitStatus=Iu,u.PThread=Me;var Um;Ua=function F(){Um||w0(),Um||(Ua=F)};function w0(F){if(F=F||f,vi>0)return;if(S){c(u),Xt(),startWorker(u);return}if(Ks(),vi>0)return;function V(){Um||(Um=!0,u.calledRun=!0,!le&&(Xt(),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Wa()))}u.setStatus?(u.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){u.setStatus(\"\")},1),V()},1)):V()}if(u.preInit)for(typeof u.preInit==\"function\"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();w0();var Gm;m&&(Gm={uncaughtException:process.listeners(\"uncaughtException\").filter(function(F){return!m.uncaughtException.indexOf(F)>-1}),unhandledRejection:process.listeners(\"unhandledRejection\").filter(function(F){return!m.unhandledRejection.indexOf(F)>-1})});var Hm;if(typeof WasmBackendModule!=\"undefined\")Hm=WasmBackendModule;else if(typeof t!=\"undefined\")Hm=t;else throw new Error(\"Could not find wasm module in post.js\");if(Gm){var CG=Hm._dispose;Hm._dispose=function(){CG(),Gm.uncaughtException.forEach(function(F){process.removeListener(\"uncaughtException\",F)}),Gm.unhandledRejection.forEach(function(F){process.removeListener(\"unhandledRejection\",F)})}}return t.ready}})();typeof Vg==\"object\"&&typeof Uv==\"object\"?Uv.exports=Wv:typeof define==\"function\"&&define.amd?define([],function(){return Wv}):typeof Vg==\"object\"&&(Vg.WasmBackendModuleThreadedSimd=Wv)});var MB=Kt((GFt,OB)=>{OB.exports.wasmWorkerContents=`\"use strict\";var Module={};var ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\");var parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",data=>onmessage({data:data}));var fs=require(\"fs\");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,\"utf8\")+\"//# sourceURL=\"+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+\"\n\");return}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;self.alert=threadAlert;Module[\"instantiateWasm\"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module[\"wasmModule\"],info);receiveInstance(instance);Module[\"wasmModule\"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({\"cmd\":\"loaded\"})};self.onmessage=e=>{try{if(e.data.cmd===\"load\"){Module[\"wasmModule\"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:\"callHandler\",handler:handler,args:[...arguments]})}}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)}else if(e.data.cmd===\"run\"){Module[\"__emscripten_thread_init\"](e.data.pthread_ptr,0,0,1);Module[\"establishStackSpace\"]();Module[\"PThread\"].receiveObjectTransfer(e.data);Module[\"PThread\"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module[\"executeNotifiedProxyingQueue\"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module[\"invokeEntryPoint\"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!=\"unwind\"){if(ex instanceof Module[\"ExitStatus\"]){if(Module[\"keepRuntimeAlive\"]()){}else{Module[\"__emscripten_thread_exit\"](ex.status)}}else{throw ex}}}}else if(e.data.cmd===\"cancel\"){if(Module[\"_pthread_self\"]()){Module[\"__emscripten_thread_exit\"](-1)}}else if(e.data.target===\"setimmediate\"){}else if(e.data.cmd===\"processProxyingQueue\"){if(initializedJS){Module[\"executeNotifiedProxyingQueue\"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err(\"worker.js received unknown command \"+e.data.cmd);err(e.data)}}catch(ex){if(Module[\"__emscripten_thread_crashed\"]){Module[\"__emscripten_thread_crashed\"]()}throw ex}};`});var LB=Kt((Wg,Hv)=>{var Gv=(()=>{var r=typeof document!=\"undefined\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!=\"undefined\"&&(r=r||__filename),function(t){t=t||{};var e=typeof t!=\"undefined\"?t:{},o,n;e.ready=new Promise(function(K,ae){o=K,n=ae});var s;typeof process!=\"undefined\"&&process.listeners&&(s={uncaughtException:process.listeners(\"uncaughtException\"),unhandledRejection:process.listeners(\"unhandledRejection\")});var a=Object.assign({},e),i=[],p=\"./this.program\",u=(K,ae)=>{throw ae},c=typeof window==\"object\",l=typeof importScripts==\"function\",m=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",d=\"\";function f(K){return e.locateFile?e.locateFile(K,d):d+K}var h,g,x,b;function C(K){if(K instanceof Rp)return;E(\"exiting due to exception: \"+K)}if(m){var S=zv(),k=Vv();l?d=k.dirname(d)+\"/\":d=__dirname+\"/\",h=(K,ae)=>(K=Ks(K)?new URL(K):k.normalize(K),S.readFileSync(K,ae?void 0:\"utf8\")),x=K=>{var ae=h(K,!0);return ae.buffer||(ae=new Uint8Array(ae)),ae},g=(K,ae,$e)=>{K=Ks(K)?new URL(K):k.normalize(K),S.readFile(K,function(at,_t){at?$e(at):ae(_t.buffer)})},process.argv.length>1&&(p=process.argv[1].replace(/\\\\/g,\"/\")),i=process.argv.slice(2),process.on(\"uncaughtException\",function(K){if(!(K instanceof Rp))throw K}),process.on(\"unhandledRejection\",function(K){throw K}),u=(K,ae)=>{if(it())throw process.exitCode=K,ae;C(ae),process.exit(K)},e.inspect=function(){return\"[Emscripten Module object]\"}}else(c||l)&&(l?d=self.location.href:typeof document!=\"undefined\"&&document.currentScript&&(d=document.currentScript.src),r&&(d=r),d.indexOf(\"blob:\")!==0?d=d.substr(0,d.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):d=\"\",h=K=>{var ae=new XMLHttpRequest;return ae.open(\"GET\",K,!1),ae.send(null),ae.responseText},l&&(x=K=>{var ae=new XMLHttpRequest;return ae.open(\"GET\",K,!1),ae.responseType=\"arraybuffer\",ae.send(null),new Uint8Array(ae.response)}),g=(K,ae,$e)=>{var at=new XMLHttpRequest;at.open(\"GET\",K,!0),at.responseType=\"arraybuffer\",at.onload=()=>{if(at.status==200||at.status==0&&at.response){ae(at.response);return}$e()},at.onerror=$e,at.send(null)},b=K=>document.title=K);var _=e.print||console.log.bind(console),E=e.printErr||console.warn.bind(console);Object.assign(e,a),a=null,e.arguments&&(i=e.arguments),e.thisProgram&&(p=e.thisProgram),e.quit&&(u=e.quit);var R=4,D;e.wasmBinary&&(D=e.wasmBinary);var P=e.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&fr(\"no native wasm support detected\");var O,M=!1,L;function B(K,ae){K||fr(ae)}var z=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):void 0;function U(K,ae,$e){ae>>>=0;for(var at=ae+$e,_t=ae;K[_t]&&!(_t>=at);)++_t;if(_t-ae>16&&K.buffer&&z)return z.decode(K.subarray(ae,_t));for(var $t=\"\";ae<_t;){var Qe=K[ae++];if(!(Qe&128)){$t+=String.fromCharCode(Qe);continue}var Ke=K[ae++]&63;if((Qe&224)==192){$t+=String.fromCharCode((Qe&31)<<6|Ke);continue}var Ut=K[ae++]&63;if((Qe&240)==224?Qe=(Qe&15)<<12|Ke<<6|Ut:Qe=(Qe&7)<<18|Ke<<12|Ut<<6|K[ae++]&63,Qe<65536)$t+=String.fromCharCode(Qe);else{var oo=Qe-65536;$t+=String.fromCharCode(55296|oo>>10,56320|oo&1023)}}return $t}function j(K,ae){return K>>>=0,K?U(ne,K,ae):\"\"}function q(K,ae,$e,at){if($e>>>=0,!(at>0))return 0;for(var _t=$e,$t=$e+at-1,Qe=0;Qe=55296&&Ke<=57343){var Ut=K.charCodeAt(++Qe);Ke=65536+((Ke&1023)<<10)|Ut&1023}if(Ke<=127){if($e>=$t)break;ae[$e++>>>0]=Ke}else if(Ke<=2047){if($e+1>=$t)break;ae[$e++>>>0]=192|Ke>>6,ae[$e++>>>0]=128|Ke&63}else if(Ke<=65535){if($e+2>=$t)break;ae[$e++>>>0]=224|Ke>>12,ae[$e++>>>0]=128|Ke>>6&63,ae[$e++>>>0]=128|Ke&63}else{if($e+3>=$t)break;ae[$e++>>>0]=240|Ke>>18,ae[$e++>>>0]=128|Ke>>12&63,ae[$e++>>>0]=128|Ke>>6&63,ae[$e++>>>0]=128|Ke&63}}return ae[$e>>>0]=0,$e-_t}function Y(K,ae,$e){return q(K,ne,ae,$e)}var J,re,ne,ee,oe,ie,le,be,_e;function ve(K){J=K,e.HEAP8=re=new Int8Array(K),e.HEAP16=ee=new Int16Array(K),e.HEAP32=ie=new Int32Array(K),e.HEAPU8=ne=new Uint8Array(K),e.HEAPU16=oe=new Uint16Array(K),e.HEAPU32=le=new Uint32Array(K),e.HEAPF32=be=new Float32Array(K),e.HEAPF64=_e=new Float64Array(K)}var Fe=e.INITIAL_MEMORY||16777216,Pe,st=[],ct=[],Ge=[],lt=!1;function it(){return P}function ht(){if(e.preRun)for(typeof e.preRun==\"function\"&&(e.preRun=[e.preRun]);e.preRun.length;)Mt(e.preRun.shift());Ua(st)}function gt(){lt=!0,Ua(ct)}function Mr(){if(e.postRun)for(typeof e.postRun==\"function\"&&(e.postRun=[e.postRun]);e.postRun.length;)rr(e.postRun.shift());Ua(Ge)}function Mt(K){st.unshift(K)}function eo(K){ct.unshift(K)}function rr(K){Ge.unshift(K)}var Tt=0,or=null,nr=null;function to(K){Tt++,e.monitorRunDependencies&&e.monitorRunDependencies(Tt)}function ro(K){if(Tt--,e.monitorRunDependencies&&e.monitorRunDependencies(Tt),Tt==0&&(or!==null&&(clearInterval(or),or=null),nr)){var ae=nr;nr=null,ae()}}function fr(K){e.onAbort&&e.onAbort(K),K=\"Aborted(\"+K+\")\",E(K),M=!0,L=1,K+=\". Build with -sASSERTIONS for more info.\";var ae=new WebAssembly.RuntimeError(K);throw n(ae),ae}var Va=\"data:application/octet-stream;base64,\";function Lo(K){return K.startsWith(Va)}function Ks(K){return K.startsWith(\"file://\")}var Xt;Xt=\"tfjs-backend-wasm.wasm\",Lo(Xt)||(Xt=f(Xt));function Wa(K){try{if(K==Xt&&D)return new Uint8Array(D);if(x)return x(K);throw\"both async and sync fetching of the wasm failed\"}catch(ae){fr(ae)}}function tl(){if(!D&&(c||l)){if(typeof fetch==\"function\"&&!Ks(Xt))return fetch(Xt,{credentials:\"same-origin\"}).then(function(K){if(!K.ok)throw\"failed to load wasm binary file at '\"+Xt+\"'\";return K.arrayBuffer()}).catch(function(){return Wa(Xt)});if(g)return new Promise(function(K,ae){g(Xt,function($e){K(new Uint8Array($e))},ae)})}return Promise.resolve().then(function(){return Wa(Xt)})}function rl(){var K={env:ol,wasi_snapshot_preview1:ol};function ae(Qe,Ke){var Ut=Qe.exports;e.asm=Ut,O=e.asm.memory,ve(O.buffer),Pe=e.asm.__indirect_function_table,eo(e.asm.__wasm_call_ctors),ro(\"wasm-instantiate\")}to(\"wasm-instantiate\");function $e(Qe){ae(Qe.instance)}function at(Qe){return tl().then(function(Ke){return WebAssembly.instantiate(Ke,K)}).then(function(Ke){return Ke}).then(Qe,function(Ke){E(\"failed to asynchronously prepare wasm: \"+Ke),fr(Ke)})}function _t(){return!D&&typeof WebAssembly.instantiateStreaming==\"function\"&&!Lo(Xt)&&!Ks(Xt)&&!m&&typeof fetch==\"function\"?fetch(Xt,{credentials:\"same-origin\"}).then(function(Qe){var Ke=WebAssembly.instantiateStreaming(Qe,K);return Ke.then($e,function(Ut){return E(\"wasm streaming compile failed: \"+Ut),E(\"falling back to ArrayBuffer instantiation\"),at($e)})}):at($e)}if(e.instantiateWasm)try{var $t=e.instantiateWasm(K,ae);return $t}catch(Qe){E(\"Module.instantiateWasm callback failed with error: \"+Qe),n(Qe)}return _t().catch(n),{}}var m0,vi;function Rp(K){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+K+\")\",this.status=K}function Ua(K){for(;K.length>0;)K.shift()(e)}function by(){fr(\"\")}function bm(){return 4294901760}function Su(){return bm()}function Cy(K,ae,$e){ne.copyWithin(K>>>0,ae>>>0,ae+$e>>>0)}function Cm(K){try{return O.grow(K-J.byteLength+65535>>>16),ve(O.buffer),1}catch(ae){}}function Dp(K){var ae=ne.length;K=K>>>0;var $e=bm();if(K>$e)return!1;let at=(Ut,oo)=>Ut+(oo-Ut%oo)%oo;for(var _t=1;_t<=4;_t*=2){var $t=ae*(1+.2/_t);$t=Math.min($t,K+100663296);var Qe=Math.min($e,at(Math.max(K,$t),65536)),Ke=Cm(Qe);if(Ke)return!0}return!1}var hr={varargs:void 0,get:function(){hr.varargs+=4;var K=ie[hr.varargs-4>>>2];return K},getStr:function(K){var ae=j(K);return ae}};function wm(K){return 52}function wy(K,ae,$e,at,_t){return 70}var Sy=[null,[],[]];function d0(K,ae){var $e=Sy[K];ae===0||ae===10?((K===1?_:E)(U($e,0)),$e.length=0):$e.push(ae)}function f0(K,ae,$e,at){for(var _t=0,$t=0;$t<$e;$t++){var Qe=le[ae>>>2],Ke=le[ae+4>>>2];ae+=8;for(var Ut=0;Ut>>0]);_t+=Ke}return le[at>>>2]=_t,0}function Sm(K){var ae=e[\"_\"+K];return ae}function Iu(K,ae){re.set(K,ae>>>0)}function Iy(K,ae,$e,at,_t){var $t={string:yr=>{var Ni=0;if(yr!=null&&yr!==0){var Bm=(yr.length<<2)+1;Ni=ul(Bm),Y(yr,Ni,Bm)}return Ni},array:yr=>{var Ni=ul(yr.length);return Iu(yr,Ni),Ni}};function Qe(yr){return ae===\"string\"?j(yr):ae===\"boolean\"?!!yr:yr}var Ke=Sm(K),Ut=[],oo=0;if(at)for(var Ga=0;GaQe===\"number\"||Qe===\"boolean\"),$t=ae!==\"string\";return $t&&_t&&!at?Sm(K):function(){return Iy(K,ae,$e,arguments,at)}}var ol={abort:by,emscripten_get_heap_max:Su,emscripten_memcpy_big:Cy,emscripten_resize_heap:Dp,fd_close:wm,fd_seek:wy,fd_write:f0},ky=rl(),Im=e.___wasm_call_ctors=function(){return(Im=e.___wasm_call_ctors=e.asm.__wasm_call_ctors).apply(null,arguments)},vm=e._init=function(){return(vm=e._init=e.asm.init).apply(null,arguments)},Ny=e._init_with_threads_count=function(){return(Ny=e._init_with_threads_count=e.asm.init_with_threads_count).apply(null,arguments)},km=e._get_threads_count=function(){return(km=e._get_threads_count=e.asm.get_threads_count).apply(null,arguments)},Ty=e._register_tensor=function(){return(Ty=e._register_tensor=e.asm.register_tensor).apply(null,arguments)},Me=e._dispose_data=function(){return(Me=e._dispose_data=e.asm.dispose_data).apply(null,arguments)},nl=e._dispose=function(){return(nl=e._dispose=e.asm.dispose).apply(null,arguments)},_y=e._Abs=function(){return(_y=e._Abs=e.asm.Abs).apply(null,arguments)},Nm=e._Acos=function(){return(Nm=e._Acos=e.asm.Acos).apply(null,arguments)},Ap=e._Acosh=function(){return(Ap=e._Acosh=e.asm.Acosh).apply(null,arguments)},$y=e._Add=function(){return($y=e._Add=e.asm.Add).apply(null,arguments)},Ey=e._AddN=function(){return(Ey=e._AddN=e.asm.AddN).apply(null,arguments)},Ry=e._All=function(){return(Ry=e._All=e.asm.All).apply(null,arguments)},Dy=e._Any=function(){return(Dy=e._Any=e.asm.Any).apply(null,arguments)},Ay=e._ArgMax=function(){return(Ay=e._ArgMax=e.asm.ArgMax).apply(null,arguments)},Tm=e._ArgMin=function(){return(Tm=e._ArgMin=e.asm.ArgMin).apply(null,arguments)},_m=e._Asin=function(){return(_m=e._Asin=e.asm.Asin).apply(null,arguments)},Fy=e._Asinh=function(){return(Fy=e._Asinh=e.asm.Asinh).apply(null,arguments)},Py=e._Atan=function(){return(Py=e._Atan=e.asm.Atan).apply(null,arguments)},Oy=e._Atan2=function(){return(Oy=e._Atan2=e.asm.Atan2).apply(null,arguments)},sl=e._Atanh=function(){return(sl=e._Atanh=e.asm.Atanh).apply(null,arguments)},My=e._AvgPool=function(){return(My=e._AvgPool=e.asm.AvgPool).apply(null,arguments)},Ly=e._AvgPool3D=function(){return(Ly=e._AvgPool3D=e.asm.AvgPool3D).apply(null,arguments)},By=e._AvgPool3DGrad=function(){return(By=e._AvgPool3DGrad=e.asm.AvgPool3DGrad).apply(null,arguments)},vu=e._AvgPoolGrad=function(){return(vu=e._AvgPoolGrad=e.asm.AvgPoolGrad).apply(null,arguments)},zy=e._BatchMatMul=function(){return(zy=e._BatchMatMul=e.asm.BatchMatMul).apply(null,arguments)},Vy=e._Bincount=function(){return(Vy=e._Bincount=e.asm.Bincount).apply(null,arguments)},$m=e._BitwiseAnd=function(){return($m=e._BitwiseAnd=e.asm.BitwiseAnd).apply(null,arguments)},Wy=e._Ceil=function(){return(Wy=e._Ceil=e.asm.Ceil).apply(null,arguments)},al=e._ClipByValue=function(){return(al=e._ClipByValue=e.asm.ClipByValue).apply(null,arguments)},Uy=e._Conv2D=function(){return(Uy=e._Conv2D=e.asm.Conv2D).apply(null,arguments)},Gy=e._Conv2DBackpropInput=function(){return(Gy=e._Conv2DBackpropInput=e.asm.Conv2DBackpropInput).apply(null,arguments)},Hy=e._Conv3D=function(){return(Hy=e._Conv3D=e.asm.Conv3D).apply(null,arguments)},ki=e._Conv3DBackpropFilterV2=function(){return(ki=e._Conv3DBackpropFilterV2=e.asm.Conv3DBackpropFilterV2).apply(null,arguments)},il=e._Conv3DBackpropInputV2=function(){return(il=e._Conv3DBackpropInputV2=e.asm.Conv3DBackpropInputV2).apply(null,arguments)},Ky=e._Cos=function(){return(Ky=e._Cos=e.asm.Cos).apply(null,arguments)},qy=e._Cosh=function(){return(qy=e._Cosh=e.asm.Cosh).apply(null,arguments)},jy=e._CropAndResize=function(){return(jy=e._CropAndResize=e.asm.CropAndResize).apply(null,arguments)},Xy=e._Cumprod=function(){return(Xy=e._Cumprod=e.asm.Cumprod).apply(null,arguments)},Em=e._Cumsum=function(){return(Em=e._Cumsum=e.asm.Cumsum).apply(null,arguments)},Rm=e._DenseBincount=function(){return(Rm=e._DenseBincount=e.asm.DenseBincount).apply(null,arguments)},Yy=e._DepthToSpace=function(){return(Yy=e._DepthToSpace=e.asm.DepthToSpace).apply(null,arguments)},Qy=e._DepthwiseConv2dNative=function(){return(Qy=e._DepthwiseConv2dNative=e.asm.DepthwiseConv2dNative).apply(null,arguments)},Dm=e._Diag=function(){return(Dm=e._Diag=e.asm.Diag).apply(null,arguments)},Am=e._Dilation2D=function(){return(Am=e._Dilation2D=e.asm.Dilation2D).apply(null,arguments)},Zy=e._Dilation2DBackpropFilter=function(){return(Zy=e._Dilation2DBackpropFilter=e.asm.Dilation2DBackpropFilter).apply(null,arguments)},Jy=e._Dilation2DBackpropInput=function(){return(Jy=e._Dilation2DBackpropInput=e.asm.Dilation2DBackpropInput).apply(null,arguments)},eb=e._Elu=function(){return(eb=e._Elu=e.asm.Elu).apply(null,arguments)},tb=e._EluGrad=function(){return(tb=e._EluGrad=e.asm.EluGrad).apply(null,arguments)},Fm=e._Equal=function(){return(Fm=e._Equal=e.asm.Equal).apply(null,arguments)},h0=e._Erf=function(){return(h0=e._Erf=e.asm.Erf).apply(null,arguments)},rb=e._Exp=function(){return(rb=e._Exp=e.asm.Exp).apply(null,arguments)},ob=e._Expm1=function(){return(ob=e._Expm1=e.asm.Expm1).apply(null,arguments)},nb=e._FlipLeftRight=function(){return(nb=e._FlipLeftRight=e.asm.FlipLeftRight).apply(null,arguments)},sb=e._Floor=function(){return(sb=e._Floor=e.asm.Floor).apply(null,arguments)},ab=e._FloorDiv=function(){return(ab=e._FloorDiv=e.asm.FloorDiv).apply(null,arguments)},ib=e._FusedBatchNorm=function(){return(ib=e._FusedBatchNorm=e.asm.FusedBatchNorm).apply(null,arguments)},ub=e._FusedConv2D=function(){return(ub=e._FusedConv2D=e.asm.FusedConv2D).apply(null,arguments)},pb=e._FusedDepthwiseConv2D=function(){return(pb=e._FusedDepthwiseConv2D=e.asm.FusedDepthwiseConv2D).apply(null,arguments)},cb=e._Gather=function(){return(cb=e._Gather=e.asm.Gather).apply(null,arguments)},lb=e._GatherNd=function(){return(lb=e._GatherNd=e.asm.GatherNd).apply(null,arguments)},mb=e._Greater=function(){return(mb=e._Greater=e.asm.Greater).apply(null,arguments)},db=e._GreaterEqual=function(){return(db=e._GreaterEqual=e.asm.GreaterEqual).apply(null,arguments)},fb=e._IsFinite=function(){return(fb=e._IsFinite=e.asm.IsFinite).apply(null,arguments)},hb=e._IsInf=function(){return(hb=e._IsInf=e.asm.IsInf).apply(null,arguments)},gb=e._IsNan=function(){return(gb=e._IsNan=e.asm.IsNan).apply(null,arguments)},xb=e._LRN=function(){return(xb=e._LRN=e.asm.LRN).apply(null,arguments)},yb=e._LRNGrad=function(){return(yb=e._LRNGrad=e.asm.LRNGrad).apply(null,arguments)},bb=e._LeakyRelu=function(){return(bb=e._LeakyRelu=e.asm.LeakyRelu).apply(null,arguments)},Cb=e._Less=function(){return(Cb=e._Less=e.asm.Less).apply(null,arguments)},wb=e._LessEqual=function(){return(wb=e._LessEqual=e.asm.LessEqual).apply(null,arguments)},Sb=e._LinSpace=function(){return(Sb=e._LinSpace=e.asm.LinSpace).apply(null,arguments)},Ib=e._Log=function(){return(Ib=e._Log=e.asm.Log).apply(null,arguments)},vb=e._Log1p=function(){return(vb=e._Log1p=e.asm.Log1p).apply(null,arguments)},kb=e._LogicalAnd=function(){return(kb=e._LogicalAnd=e.asm.LogicalAnd).apply(null,arguments)},Nb=e._LogicalNot=function(){return(Nb=e._LogicalNot=e.asm.LogicalNot).apply(null,arguments)},Tb=e._LogicalOr=function(){return(Tb=e._LogicalOr=e.asm.LogicalOr).apply(null,arguments)},_b=e._LogicalXor=function(){return(_b=e._LogicalXor=e.asm.LogicalXor).apply(null,arguments)},$b=e._Max=function(){return($b=e._Max=e.asm.Max).apply(null,arguments)},Eb=e._MaxPool=function(){return(Eb=e._MaxPool=e.asm.MaxPool).apply(null,arguments)},Rb=e._MaxPool3D=function(){return(Rb=e._MaxPool3D=e.asm.MaxPool3D).apply(null,arguments)},Db=e._MaxPool3DGrad=function(){return(Db=e._MaxPool3DGrad=e.asm.MaxPool3DGrad).apply(null,arguments)},Ab=e._MaxPoolGrad=function(){return(Ab=e._MaxPoolGrad=e.asm.MaxPoolGrad).apply(null,arguments)},Fb=e._MaxPoolWithArgmax=function(){return(Fb=e._MaxPoolWithArgmax=e.asm.MaxPoolWithArgmax).apply(null,arguments)},Pb=e._Maximum=function(){return(Pb=e._Maximum=e.asm.Maximum).apply(null,arguments)},Ob=e._Mean=function(){return(Ob=e._Mean=e.asm.Mean).apply(null,arguments)},Mb=e._Min=function(){return(Mb=e._Min=e.asm.Min).apply(null,arguments)},Lb=e._Minimum=function(){return(Lb=e._Minimum=e.asm.Minimum).apply(null,arguments)},Bb=e._MirrorPad=function(){return(Bb=e._MirrorPad=e.asm.MirrorPad).apply(null,arguments)},zb=e._Mod=function(){return(zb=e._Mod=e.asm.Mod).apply(null,arguments)},Vb=e._Multinomial=function(){return(Vb=e._Multinomial=e.asm.Multinomial).apply(null,arguments)},Wb=e._Multiply=function(){return(Wb=e._Multiply=e.asm.Multiply).apply(null,arguments)},Ub=e._Neg=function(){return(Ub=e._Neg=e.asm.Neg).apply(null,arguments)},Gb=e._NonMaxSuppressionV3=function(){return(Gb=e._NonMaxSuppressionV3=e.asm.NonMaxSuppressionV3).apply(null,arguments)},Hb=e._NonMaxSuppressionV4=function(){return(Hb=e._NonMaxSuppressionV4=e.asm.NonMaxSuppressionV4).apply(null,arguments)},Kb=e._NonMaxSuppressionV5=function(){return(Kb=e._NonMaxSuppressionV5=e.asm.NonMaxSuppressionV5).apply(null,arguments)},qb=e._NotEqual=function(){return(qb=e._NotEqual=e.asm.NotEqual).apply(null,arguments)},jb=e._OneHot=function(){return(jb=e._OneHot=e.asm.OneHot).apply(null,arguments)},Xb=e._PadV2=function(){return(Xb=e._PadV2=e.asm.PadV2).apply(null,arguments)},Yb=e._Pow=function(){return(Yb=e._Pow=e.asm.Pow).apply(null,arguments)},Qb=e._Prelu=function(){return(Qb=e._Prelu=e.asm.Prelu).apply(null,arguments)},Zb=e._Prod=function(){return(Zb=e._Prod=e.asm.Prod).apply(null,arguments)},Jb=e._RealDiv=function(){return(Jb=e._RealDiv=e.asm.RealDiv).apply(null,arguments)},eC=e._Reciprocal=function(){return(eC=e._Reciprocal=e.asm.Reciprocal).apply(null,arguments)},tC=e._Relu=function(){return(tC=e._Relu=e.asm.Relu).apply(null,arguments)},rC=e._Relu6=function(){return(rC=e._Relu6=e.asm.Relu6).apply(null,arguments)},oC=e._ResizeBilinear=function(){return(oC=e._ResizeBilinear=e.asm.ResizeBilinear).apply(null,arguments)},nC=e._ResizeBilinearGrad=function(){return(nC=e._ResizeBilinearGrad=e.asm.ResizeBilinearGrad).apply(null,arguments)},sC=e._ResizeNearestNeighbor=function(){return(sC=e._ResizeNearestNeighbor=e.asm.ResizeNearestNeighbor).apply(null,arguments)},aC=e._ResizeNearestNeighborGrad=function(){return(aC=e._ResizeNearestNeighborGrad=e.asm.ResizeNearestNeighborGrad).apply(null,arguments)},iC=e._Reverse=function(){return(iC=e._Reverse=e.asm.Reverse).apply(null,arguments)},uC=e._RotateWithOffset=function(){return(uC=e._RotateWithOffset=e.asm.RotateWithOffset).apply(null,arguments)},pC=e._Round=function(){return(pC=e._Round=e.asm.Round).apply(null,arguments)},cC=e._Rsqrt=function(){return(cC=e._Rsqrt=e.asm.Rsqrt).apply(null,arguments)},lC=e._ScatterNd=function(){return(lC=e._ScatterNd=e.asm.ScatterNd).apply(null,arguments)},mC=e._SearchSorted=function(){return(mC=e._SearchSorted=e.asm.SearchSorted).apply(null,arguments)},dC=e._SelectV2=function(){return(dC=e._SelectV2=e.asm.SelectV2).apply(null,arguments)},fC=e._Selu=function(){return(fC=e._Selu=e.asm.Selu).apply(null,arguments)},hC=e._Sigmoid=function(){return(hC=e._Sigmoid=e.asm.Sigmoid).apply(null,arguments)},gC=e._Sign=function(){return(gC=e._Sign=e.asm.Sign).apply(null,arguments)},xC=e._Sin=function(){return(xC=e._Sin=e.asm.Sin).apply(null,arguments)},yC=e._Sinh=function(){return(yC=e._Sinh=e.asm.Sinh).apply(null,arguments)},bC=e._Softmax=function(){return(bC=e._Softmax=e.asm.Softmax).apply(null,arguments)},CC=e._Softplus=function(){return(CC=e._Softplus=e.asm.Softplus).apply(null,arguments)},wC=e._SparseFillEmptyRows=function(){return(wC=e._SparseFillEmptyRows=e.asm.SparseFillEmptyRows).apply(null,arguments)},SC=e._SparseReshape=function(){return(SC=e._SparseReshape=e.asm.SparseReshape).apply(null,arguments)},IC=e._SparseSegmentReduction=function(){return(IC=e._SparseSegmentReduction=e.asm.SparseSegmentReduction).apply(null,arguments)},vC=e._SparseToDense=function(){return(vC=e._SparseToDense=e.asm.SparseToDense).apply(null,arguments)},kC=e._Sqrt=function(){return(kC=e._Sqrt=e.asm.Sqrt).apply(null,arguments)},NC=e._Square=function(){return(NC=e._Square=e.asm.Square).apply(null,arguments)},TC=e._SquaredDifference=function(){return(TC=e._SquaredDifference=e.asm.SquaredDifference).apply(null,arguments)},_C=e._Step=function(){return(_C=e._Step=e.asm.Step).apply(null,arguments)},$C=e._StridedSlice=function(){return($C=e._StridedSlice=e.asm.StridedSlice).apply(null,arguments)},EC=e._Sub=function(){return(EC=e._Sub=e.asm.Sub).apply(null,arguments)},RC=e._Sum=function(){return(RC=e._Sum=e.asm.Sum).apply(null,arguments)},DC=e._Tan=function(){return(DC=e._Tan=e.asm.Tan).apply(null,arguments)},AC=e._Tanh=function(){return(AC=e._Tanh=e.asm.Tanh).apply(null,arguments)},FC=e._TensorScatterUpdate=function(){return(FC=e._TensorScatterUpdate=e.asm.TensorScatterUpdate).apply(null,arguments)},PC=e._Tile=function(){return(PC=e._Tile=e.asm.Tile).apply(null,arguments)},OC=e._TopK=function(){return(OC=e._TopK=e.asm.TopK).apply(null,arguments)},MC=e._Transform=function(){return(MC=e._Transform=e.asm.Transform).apply(null,arguments)},LC=e._Transpose=function(){return(LC=e._Transpose=e.asm.Transpose).apply(null,arguments)},BC=e.__FusedMatMul=function(){return(BC=e.__FusedMatMul=e.asm._FusedMatMul).apply(null,arguments)},zC=e._malloc=function(){return(zC=e._malloc=e.asm.malloc).apply(null,arguments)},VC=e._free=function(){return(VC=e._free=e.asm.free).apply(null,arguments)},WC=e.___errno_location=function(){return(WC=e.___errno_location=e.asm.__errno_location).apply(null,arguments)},Pm=e.stackSave=function(){return(Pm=e.stackSave=e.asm.stackSave).apply(null,arguments)},Om=e.stackRestore=function(){return(Om=e.stackRestore=e.asm.stackRestore).apply(null,arguments)},ul=e.stackAlloc=function(){return(ul=e.stackAlloc=e.asm.stackAlloc).apply(null,arguments)},UC=e.dynCall_iijjiiii=function(){return(UC=e.dynCall_iijjiiii=e.asm.dynCall_iijjiiii).apply(null,arguments)},GC=e.dynCall_jiji=function(){return(GC=e.dynCall_jiji=e.asm.dynCall_jiji).apply(null,arguments)};e.cwrap=vy;var Fp;nr=function K(){Fp||Mm(),Fp||(nr=K)};function Mm(K){if(K=K||i,Tt>0||(ht(),Tt>0))return;function ae(){Fp||(Fp=!0,e.calledRun=!0,!M&&(gt(),o(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),Mr()))}e.setStatus?(e.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){e.setStatus(\"\")},1),ae()},1)):ae()}if(e.preInit)for(typeof e.preInit==\"function\"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();Mm();var Pp;s&&(Pp={uncaughtException:process.listeners(\"uncaughtException\").filter(function(K){return!s.uncaughtException.indexOf(K)>-1}),unhandledRejection:process.listeners(\"unhandledRejection\").filter(function(K){return!s.unhandledRejection.indexOf(K)>-1})});var Op;if(typeof t!=\"undefined\")Op=t;else if(typeof WasmBackendModuleThreadedSimd!=\"undefined\")Op=WasmBackendModuleThreadedSimd;else throw new Error(\"Could not find wasm module in post.js\");if(Pp){var HC=Op._dispose;Op._dispose=function(){HC(),Pp.uncaughtException.forEach(function(K){process.removeListener(\"uncaughtException\",K)}),Pp.unhandledRejection.forEach(function(K){process.removeListener(\"unhandledRejection\",K)})}}return t.ready}})();typeof Wg==\"object\"&&typeof Hv==\"object\"?Hv.exports=Gv:typeof define==\"function\"&&define.amd?define([],function(){return Gv}):typeof Wg==\"object\"&&(Wg.WasmBackendModule=Gv)});var Bo=class{constructor(t,e){this.backend=t,this.dataMover=e,this.data=new WeakMap,this.dataIdsCount=0}get(t){return this.data.has(t)||this.dataMover.moveData(this.backend,t),this.data.get(t)}set(t,e){this.dataIdsCount++,this.data.set(t,e)}has(t){return this.data.has(t)}delete(t){return this.dataIdsCount--,this.data.delete(t)}numDataIds(){return this.dataIdsCount}},so=class{refCount(t){return Br(\"refCount\")}incRef(t){return Br(\"incRef\")}timerAvailable(){return!0}time(t){return Br(\"time\")}read(t){return Br(\"read\")}readSync(t){return Br(\"readSync\")}readToGPU(t,e){return Br(\"readToGPU\")}numDataIds(){return Br(\"numDataIds\")}disposeData(t,e){return Br(\"disposeData\")}write(t,e,o){return Br(\"write\")}move(t,e,o,n,s){return Br(\"move\")}createTensorFromGPUData(t,e,o){return Br(\"createTensorFromGPUData\")}memory(){return Br(\"memory\")}floatPrecision(){return Br(\"floatPrecision\")}epsilon(){return this.floatPrecision()===32?1e-7:1e-4}dispose(){return Br(\"dispose\")}};function Br(r){throw new Error(`'${r}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function v0(r){let t=r.length,e=0;for(;t>0;)e=Math.random()*t|0,t--,Km(r,t,e)}function _G(r,t){if(r.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${r.length}Second array length was ${t.length}`);let e=r.length,o=0;for(;e>0;)o=Math.random()*e|0,e--,Km(r,e,o),Km(t,e,o)}function Bp(r,t,e){return Math.max(r,Math.min(t,e))}function $G(r){return r%2===0?r:r+1}function Km(r,t,e){let o=r[t];r[t]=r[e],r[e]=o}function EG(r){let t=0;for(let e=0;ee+` Shapes ${r} and ${t} must match`)}function ao(r){$(r!=null,()=>\"The input to the tensor constructor must be a non-null value.\")}function He(r){if(r.length===0)return 1;let t=r[0];for(let e=1;e0,e,o){return new Promise((n,s)=>{let a=0,i=()=>{if(r()){n();return}a++;let p=t(a);if(e!=null&&a>=e){s();return}o!=null?o(i,p):setTimeout(i,p)};i()})}function LG(r,t){let e=1,o=-1;for(let s=0;s=0)e*=r[s];else if(r[s]===-1){if(o!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${o} and dim ${s}`);o=s}else if(r[s]<0)throw Error(`Shapes can not be < 0. Found ${r[s]} at dim ${s}`);if(o===-1){if(t>0&&t!==e)throw Error(`Size(${t}) must match the product of shape ${r}`);return r}if(e===0)throw Error(`Cannot infer the missing size in [${r}] when there are 0 elements`);if(t%e!==0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${e}`);let n=r.slice();return n[o]=t/e,n}function Ti(r,t){let e=t.length;return r=r==null?t.map((o,n)=>n):[].concat(r),$(r.every(o=>o>=-e&&o`All values in axis param must be in range [-${e}, ${e}) but got axis ${r}`),$(r.every(o=>Ka(o)),()=>`All values in axis param must be integers but got axis ${r}`),r.map(o=>o<0?e+o:o)}function ZC(r,t){let e=[],o=[],n=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||n?null:Ti(t,r).sort(),a=0;for(let i=0;ii)&&r[i]===1&&(e.push(r[i]),o.push(i)),s[a]<=i&&a++}r[i]!==1&&(e.push(r[i]),o.push(i))}return{newShape:e,keptDims:o}}function JC(r,t){return qm(r,t)}function qm(r,t){let e=null;if(r==null||r===\"float32\")e=new Float32Array(t);else if(r===\"int32\")e=new Int32Array(t);else if(r===\"bool\")e=new Uint8Array(t);else if(r===\"string\")e=new Array(t);else throw new Error(`Unknown data type ${r}`);return e}function ew(r,t){for(let e=0;et+=e.length),t}function zo(r){return typeof r==\"string\"||r instanceof String}function k0(r){return typeof r==\"boolean\"}function N0(r){return typeof r==\"number\"}function _i(r){return Array.isArray(r)?_i(r[0]):r instanceof Float32Array?\"float32\":r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray?\"int32\":N0(r)?\"float32\":zo(r)?\"string\":k0(r)?\"bool\":\"float32\"}function qs(r){return!!(r&&r.constructor&&r.call&&r.apply)}function Vp(r,t){for(let e=t;e=0;--o)e[o]=e[o+1]*r[o+1];return e}function T0(r,t,e,o=!1){let n=new Array;if(t.length===1){let s=t[0]*(o?2:1);for(let a=0;ap*u)*(o?2:1);for(let p=0;pn*s)*(e?2:1);if(o===0)return[];if(o!==t.length)throw new Error(`[${r}] does not match the input size ${t.length}${e?\" for a complex tensor\":\"\"}.`);return T0(0,r,t,e)}function zG(r,t){if(Array.isArray(r))return r;if(t===\"float32\")return r instanceof Float32Array?r:new Float32Array(r);if(t===\"int32\")return r instanceof Int32Array?r:new Int32Array(r);if(t===\"bool\"||t===\"string\")return Uint8Array.from(new Int32Array(r));throw new Error(`Unknown dtype ${t}`)}function cl(r,t){let e=Wp(r,t);for(let o=0;oo*n,1);if(t==null||t===\"float32\")return ku(r,new Float32Array(e));if(t===\"int32\")return ku(r,new Int32Array(e));if(t===\"bool\")return ku(r,new Uint8Array(e));throw new Error(`Unknown data type ${t}`)}function Ct(r){r.forEach(t=>{$(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${r}].`)})}function WG(r,t,e){if(t===0)return 0;if(t===1)return r[0];let o=r[r.length-1];for(let n=0;n{let[n,s]=o.split(\":\");this.urlFlags[n]=qG(n,s)})}};function HG(r){let t={};return r.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(e,...o)=>(KG(t,o[0],o[1]),o.join(\"=\"))),t}function KG(r,t,e){r[decodeURIComponent(t)]=decodeURIComponent(e||\"\")}function qG(r,t){let e=t.toLowerCase();return e===\"true\"||e===\"false\"?e===\"true\":`${+e}`===e?+e:t}function A(){return ow}var ow=null;function $0(r){ow=r}var nw;function sw(){if(nw==null){let r;if(typeof window!=\"undefined\")r=window;else if(typeof global!=\"undefined\")r=global;else if(typeof process!=\"undefined\")r=process;else if(typeof self!=\"undefined\")r=self;else throw new Error(\"Could not find a global object\");nw=r}return nw}function jG(){let r=sw();return r._tfGlobals==null&&(r._tfGlobals=new Map),r._tfGlobals}function ml(r,t){let e=jG();if(e.has(r))return e.get(r);{let o=t();return e.set(r,o),e.get(r)}}var Xs=\"Abs\",Vo=\"Acos\",Wo=\"Acosh\",io=\"Add\",Uo=\"AddN\",Go=\"All\",Ho=\"Any\",Ys=\"ArgMax\",Qs=\"ArgMin\",Ko=\"Asin\",qo=\"Asinh\",jo=\"Atan\",Xo=\"Atanh\",Yo=\"Atan2\",Qo=\"AvgPool\",$i=\"AvgPoolGrad\",Zs=\"AvgPool3D\",Ei=\"AvgPool3DGrad\",Zo=\"BatchMatMul\",Js=\"BatchToSpaceND\",Jo=\"Bincount\",qa=\"BitwiseAnd\",Bce=\"BroadcastTo\",ea=\"BroadcastArgs\",yo=\"Cast\",en=\"Ceil\",bo=\"ClipByValue\",Ri=\"Complex\",Di=\"ComplexAbs\",ta=\"Concat\",tn=\"Conv2D\",Ai=\"Conv2DBackpropFilter\",rn=\"Conv2DBackpropInput\",on=\"Conv3D\",ja=\"Conv3DBackpropFilterV2\",nn=\"Conv3DBackpropInputV2\",sn=\"Cos\",an=\"Cosh\",un=\"Cumprod\",pn=\"Cumsum\",cn=\"CropAndResize\",ra=\"DenseBincount\",ln=\"DepthToSpace\",mn=\"DepthwiseConv2dNative\",Fi=\"DepthwiseConv2dNativeBackpropFilter\",Pi=\"DepthwiseConv2dNativeBackpropInput\",oa=\"Diag\",dn=\"Dilation2D\",Oi=\"Dilation2DBackpropInput\",Mi=\"Dilation2DBackpropFilter\",_u=\"Draw\",fn=\"RealDiv\",Li=\"Einsum\",hn=\"Elu\",Xa=\"EluGrad\",gn=\"Erf\",xn=\"Equal\",yn=\"Exp\",na=\"ExpandDims\",bn=\"Expm1\",Bi=\"FFT\",sa=\"Fill\",Cn=\"FlipLeftRight\",wn=\"Floor\",Sn=\"FloorDiv\",In=\"FusedBatchNorm\",aa=\"GatherV2\",vn=\"GatherNd\",kn=\"Greater\",Nn=\"GreaterEqual\",Co=\"Identity\",zi=\"IFFT\",Vi=\"Imag\",Tn=\"IsFinite\",_n=\"IsInf\",$n=\"IsNan\",En=\"LeakyRelu\",Rn=\"Less\",Dn=\"LessEqual\",An=\"LinSpace\",Fn=\"Log\",Pn=\"Log1p\",On=\"LogicalAnd\",Mn=\"LogicalNot\",Ln=\"LogicalOr\",E0=\"LogicalXor\",zce=\"LogSoftmax\",Vce=\"LowerBound\",Bn=\"LRN\",Ya=\"LRNGrad\",Wce=\"MatrixBandPart\",zn=\"Max\",Vn=\"Maximum\",Wn=\"MaxPool\",Wi=\"MaxPoolGrad\",ia=\"MaxPool3D\",Ui=\"MaxPool3DGrad\",ua=\"MaxPoolWithArgmax\",Un=\"Mean\",Gn=\"Min\",Hn=\"Minimum\",Kn=\"MirrorPad\",qn=\"Mod\",jn=\"Multinomial\",Xn=\"Multiply\",pa=\"Neg\",Yn=\"NotEqual\",Qn=\"NonMaxSuppressionV3\",Qa=\"NonMaxSuppressionV4\",Zn=\"NonMaxSuppressionV5\",ca=\"OnesLike\",Jn=\"OneHot\",la=\"Pack\",es=\"PadV2\",Uce=\"Pool\",ts=\"Pow\",rs=\"Prelu\",os=\"Prod\",Up=\"RaggedGather\",Gp=\"RaggedRange\",Hp=\"RaggedTensorToTensor\",ma=\"Range\",Gi=\"Real\",ns=\"Reciprocal\",ss=\"Relu\",da=\"Reshape\",as=\"ResizeNearestNeighbor\",Za=\"ResizeNearestNeighborGrad\",is=\"ResizeBilinear\",Ja=\"ResizeBilinearGrad\",us=\"Relu6\",ps=\"Reverse\",cs=\"Round\",ls=\"Rsqrt\",ms=\"ScatterNd\",ds=\"TensorScatterUpdate\",fs=\"SearchSorted\",fa=\"Select\",hs=\"Selu\",ha=\"Slice\",gs=\"Sin\",xs=\"Sinh\",ys=\"Sign\",bs=\"Sigmoid\",Cs=\"Softplus\",ws=\"Sqrt\",Ss=\"Sum\",ga=\"SpaceToBatchND\",xa=\"SplitV\",Is=\"Softmax\",Hi=\"SparseFillEmptyRows\",ei=\"SparseReshape\",ya=\"SparseSegmentMean\",ba=\"SparseSegmentSum\",vs=\"SparseToDense\",ks=\"SquaredDifference\",Ki=\"Square\",$u=\"StaticRegexReplace\",Ns=\"StridedSlice\",Ca=\"StringNGrams\",qi=\"StringSplit\",ji=\"StringToHashBucketFast\",Ts=\"Sub\",_s=\"Tan\",$s=\"Tanh\",uo=\"Tile\",Es=\"TopK\",Rs=\"Transform\",po=\"Transpose\",Xi=\"Unique\",wa=\"Unpack\",Yi=\"UnsortedSegmentSum\",Gce=\"UpperBound\",Sa=\"ZerosLike\",wo=\"Step\",Eu=\"FromPixels\",Ds=\"RotateWithOffset\",So=\"_FusedMatMul\",Io=\"FusedConv2D\",vo=\"FusedDepthwiseConv2D\";function Ia(...r){A().getBool(\"IS_TEST\")||A().getBool(\"PROD\")||console.warn(...r)}function XG(...r){A().getBool(\"IS_TEST\")||A().getBool(\"PROD\")||console.log(...r)}var Kp=ml(\"kernelRegistry\",()=>new Map),dl=ml(\"gradRegistry\",()=>new Map);function qp(r,t){let e=iw(r,t);return Kp.get(e)}function aw(r){return dl.get(r)}function jm(r){let t=Kp.entries(),e=[];for(;;){let{done:o,value:n}=t.next();if(o)break;let[s,a]=n,[i]=s.split(\"_\");i===r&&e.push(a)}return e}function ti(r){let{kernelName:t,backendName:e}=r,o=iw(t,e);Kp.has(o)&&Ia(`The kernel '${t}' for backend '${e}' is already registered`),Kp.set(o,r)}function Xce(r){let{kernelName:t}=r;dl.has(t)&&A().getBool(\"DEBUG\")&&Ia(`Overriding the gradient for '${t}'`),dl.set(t,r)}function Yce(r,t){let e=iw(r,t);if(!Kp.has(e))throw new Error(`The kernel '${r}' for backend '${t}' is not registered`);Kp.delete(e)}function Qce(r){if(!dl.has(r))throw new Error(`The gradient '${r}' for backend is not registered`);dl.delete(r)}function Zce(r,t){jm(r).forEach(o=>{let n=Object.assign({},o,{backendName:t});ti(n)})}function iw(r,t){return`${t}_${r}`}var y={};qe(y,{arraysEqual:()=>br,arraysEqualWithNull:()=>QC,assert:()=>$,assertNonNegativeIntegerDimensions:()=>Ct,assertNonNull:()=>ao,assertShapesMatch:()=>xt,bytesFromStringArray:()=>rw,bytesPerElement:()=>zp,checkConversionForErrors:()=>ew,clamp:()=>Bp,computeStrides:()=>js,convertBackendValuesAndArrayBuffer:()=>zG,createScalarValue:()=>r4,createShuffledIndices:()=>OG,decodeString:()=>Qp,distSquared:()=>DG,encodeString:()=>Zi,fetch:()=>n4,fingerPrint64:()=>t4,flatten:()=>Fs,getArrayFromDType:()=>qm,getTypedArrayFromDType:()=>JC,hasEncodingLoss:()=>BG,hexToLong:()=>fl,indexToLoc:()=>UG,inferDtype:()=>_i,inferFromImplicitShape:()=>LG,isBoolean:()=>k0,isFunction:()=>qs,isInt:()=>Ka,isNumber:()=>N0,isPromise:()=>Tu,isScalarShape:()=>AG,isString:()=>zo,isTypedArray:()=>Pt,isValidDtype:()=>tw,locToIndex:()=>WG,makeOnesTypedArray:()=>cl,makeZerosNestedTypedArray:()=>VG,makeZerosTypedArray:()=>Wp,nearestDivisor:()=>Vp,nearestLargerEven:()=>$G,now:()=>Pu,parseAxisParam:()=>Ti,randUniform:()=>RG,repeatedTry:()=>MG,rightPad:()=>Nu,shuffle:()=>v0,shuffleCombo:()=>_G,sizeFromShape:()=>He,sizeToSquarishShape:()=>PG,squeezeShape:()=>ZC,sum:()=>EG,swap:()=>Km,tanh:()=>FG,toNestedArray:()=>ku,toTypedArray:()=>Yp});function Xm(r){return r instanceof Float32Array||r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray}var lw=Lp(W0());var Fu=lw.default||lw;function fl(r){return Fu.fromString(r,!0,16)}var G0=fl(\"c3a5c85c97cb3127\"),Au=fl(\"b492b66fbe98f273\"),Cr=fl(\"9ae16a3b2f90404f\");function cw(r){return r.xor(r.shru(47))}function H0(r,t,e){let o=r.slice(t,t+e);return Fu.fromBytes(Array.from(o),!0,!0)}function wt(r,t){return H0(r,t,8)}function U0(r,t){return H0(r,t,4)}function Yt(r,t){return t===0?r:r.shru(t).or(r.shl(64-t))}function Qi(r,t,e=fl(\"9ddfea08eb382d69\")){let o=r.xor(t).mul(e);o=o.xor(o.shru(47));let n=t.xor(o).mul(e);return n=n.xor(n.shru(47)),n=n.mul(e),n}function QG(r,t,e,o,n,s){n=n.add(r),s=Yt(s.add(n).add(o),21);let a=n;return n=n.add(t),n=n.add(e),s=s.add(Yt(n,44)),[n.add(o),s.add(a)]}function Qm(r,t,e,o){return QG(wt(r,t),wt(r,t+8),wt(r,t+16),wt(r,t+24),e,o)}function ZG(r,t=r.length){if(t>=8){let e=Cr.add(t*2),o=wt(r,0).add(Cr),n=wt(r,t-8),s=Yt(n,37).mul(e).add(o),a=Yt(o,25).add(n).mul(e);return Qi(s,a,e)}if(t>=4){let e=Cr.add(t*2),o=U0(r,0);return Qi(o.shl(3).add(t),U0(r,t-4),e)}if(t>0){let e=r[0],o=r[t>>1],n=r[t-1],s=e+(o<<8),a=t+(n<<2);return cw(Cr.mul(s).xor(G0.mul(a))).mul(Cr)}return Cr}function JG(r,t=r.length){let e=Cr.add(t*2),o=wt(r,0).mul(Au),n=wt(r,8),s=wt(r,t-8).mul(e),a=wt(r,t-16).mul(Cr);return Qi(Yt(o.add(n),43).add(Yt(s,30)).add(a),o.add(Yt(n.add(Cr),18)).add(s),e)}function e4(r,t=r.length){let e=Cr.add(t*2),o=wt(r,0).mul(Cr),n=wt(r,8),s=wt(r,t-8).mul(e),a=wt(r,t-16).mul(Cr),i=Yt(o.add(n),43).add(Yt(s,30)).add(a),p=Qi(i,o.add(Yt(n.add(Cr),18)).add(s),e),u=wt(r,16).mul(e),c=wt(r,24),l=i.add(wt(r,t-32)).mul(e),m=p.add(wt(r,t-24)).mul(e);return Qi(Yt(u.add(c),43).add(Yt(l,30)).add(m),u.add(Yt(c.add(o),18)).add(l),e)}function t4(r,t=r.length){let e=Fu.fromNumber(81,!0);if(t<=32)return t<=16?ZG(r,t):JG(r,t);if(t<=64)return e4(r,t);let o=e,n=e.mul(Au).add(113),s=cw(n.mul(Cr).add(113)).mul(Cr),a=[Fu.UZERO,Fu.UZERO],i=[Fu.UZERO,Fu.UZERO];o=o.mul(Cr).add(wt(r,0));let p=0,u=(t-1>>6)*64,c=u+(t-1&63)-63;do o=Yt(o.add(n).add(a[0]).add(wt(r,p+8)),37).mul(Au),n=Yt(n.add(a[1]).add(wt(r,p+48)),42).mul(Au),o=o.xor(i[1]),n=n.add(a[0]).add(wt(r,p+40)),s=Yt(s.add(i[0]),33).mul(Au),a=Qm(r,p,a[1].mul(Au),o.add(i[0])),i=Qm(r,p+32,s.add(i[1]),n.add(wt(r,p+16))),[s,o]=[o,s],p+=64;while(p!==u);let l=Au.add(s.and(255).shl(1));return p=c,i[0]=i[0].add(t-1&63),a[0]=a[0].add(i[0]),i[0]=i[0].add(a[0]),o=Yt(o.add(n).add(a[0]).add(wt(r,p+8)),37).mul(l),n=Yt(n.add(a[1]).add(wt(r,p+48)),42).mul(l),o=o.xor(i[1].mul(9)),n=n.add(a[0].mul(9).add(wt(r,p+40))),s=Yt(s.add(i[0]),33).mul(l),a=Qm(r,p,a[1].mul(l),o.add(i[0])),i=Qm(r,p+32,s.add(i[1]),n.add(wt(r,p+16))),[s,o]=[o,s],Qi(Qi(a[0],i[0],l).add(cw(n).mul(G0)).add(s),Qi(a[1],i[1],l).add(o),l)}function r4(r,t){return t===\"string\"?Zi(r):Yp([r],t)}function o4(r,t){return r instanceof Float32Array&&t===\"float32\"||r instanceof Int32Array&&t===\"int32\"||r instanceof Uint8Array&&t===\"bool\"}function Yp(r,t){if(t===\"string\")throw new Error(\"Cannot convert a string[] to a TypedArray\");if(Array.isArray(r)&&(r=Fs(r)),A().getBool(\"DEBUG\")&&ew(r,t),o4(r,t))return r;if(t==null||t===\"float32\"||t===\"complex64\")return new Float32Array(r);if(t===\"int32\")return new Int32Array(r);if(t===\"bool\"){let e=new Uint8Array(r.length);for(let o=0;o{n=o()},a,i=Pu();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(s);else{s();for(let u of n)u.dataSync();a=Promise.resolve({kernelMs:Pu()-i})}if(A().getBool(\"CHECK_COMPUTATION_FOR_ERRORS\"))for(let u=0;u{s4(l,c.dtype,t)})}return{kernelName:t,outputs:n,inputs:e,timeMs:a.then(u=>u.kernelMs),extraInfo:a.then(u=>u.getExtraProfileInfo!=null?u.getExtraProfileInfo():\"\")}}logKernelProfile(t){let{kernelName:e,outputs:o,timeMs:n,inputs:s,extraInfo:a}=t;o.forEach(i=>{Promise.all([i.data(),n,a]).then(p=>{this.logger.logKernelProfile(e,i,p[0],p[1],s,p[2])})})}};function s4(r,t,e){if(t!==\"float32\")return!1;for(let o=0;o0?h:\"\"} `}}console.log(`%c${p}\t%c${i}\t%c${u}D ${l}\t%c${c}\t%c${m}\t%c${a}`,\"font-weight:bold\",\"color:red\",\"color:blue\",\"color: orange\",\"color: green\",\"color: steelblue\")}};function K0(r,t,e){let o={},n={};for(let p=0;po[h.id]=!0),d=!0,n[u.id]=!0;break}if(d)break}}let s={};s[e.id]=!0;let a={};for(let p=r.length-1;p>=0;p--){let u=r[p],c=u.inputs;for(let l=0;l=0;n--){let s=t[n],a=[];if(s.outputs.forEach(p=>{let u=r[p.id];u!=null?a.push(u):a.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let i=s.gradient(a);for(let p in s.inputs){if(!(p in i))throw new Error(`Cannot backprop through input ${p}. Available gradients found: ${Object.keys(i)}.`);let u=e(()=>i[p]());if(u.dtype!==\"float32\")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${p} must have 'float32' dtype, but has '${u.dtype}'`);let c=s.inputs[p];if(!br(u.shape,c.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${p}' has shape '${u.shape}', which does not match the shape of the input '${c.shape}'`);if(r[c.id]==null)r[c.id]=u;else{let l=r[c.id];r[c.id]=o(l,u),l.dispose()}}}}var j0=20,hl=3,dw=7;function X0(r,t,e,o){let n=js(t),s=a4(r,t,e,n),a=t.length,i=Jm(r,t,e,n,s),p=[\"Tensor\"];return o&&(p.push(` dtype: ${e}`),p.push(` rank: ${a}`),p.push(` shape: [${t}]`),p.push(\" values:\")),p.push(i.map(u=>\" \"+u).join(`\n`)),p.join(`\n`)}function a4(r,t,e,o){let n=He(t),s=o[o.length-1],a=new Array(s).fill(0),i=t.length,p=e===\"complex64\"?xl(r):r;if(i>1)for(let u=0;uj0){let g=hl*a,x=Array.from(r.slice(0,g)),b=Array.from(r.slice((i-hl)*a,i*a));return e===\"complex64\"&&(x=xl(x),b=xl(b)),[\"[\"+x.map((C,S)=>gl(C,n[S],e)).join(\", \")+\", ..., \"+b.map((C,S)=>gl(C,n[i-hl+S],e)).join(\", \")+\"]\"]}return[\"[\"+(e===\"complex64\"?xl(r):Array.from(r)).map((g,x)=>gl(g,n[x],e)).join(\", \")+\"]\"]}let u=t.slice(1),c=o.slice(1),l=o[0]*a,m=[];if(i>j0){for(let h=0;h0?m[0]+d:\"\");for(let h=1;h`Length of values '${n}' does not match the size inferred by the shape '${this.size}'.`)}if(e===\"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=o||qm(e,this.size),this.strides=js(t)}set(t,...e){e.length===0&&(e=[0]),$(e.length===this.rank,()=>`The number of provided coordinates (${e.length}) must match the rank (${this.rank})`);let o=this.locToIndex(e);this.values[o]=t}get(...t){t.length===0&&(t=[0]);let e=0;for(let n of t){if(n<0||n>=this.shape[e]){let s=`Requested out of range element at ${t}. Buffer shape=${this.shape}`;throw new Error(s)}e++}let o=t[t.length-1];for(let n=0;nQp(o))}catch(o){throw new Error(\"Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().\")}}return t}dataToGPU(t){return this.throwIfDisposed(),Ps().readToGPU(this.dataId,t)}dataSync(){this.throwIfDisposed();let t=Ps().readSync(this.dataId);if(this.dtype===\"string\")try{return t.map(e=>Qp(e))}catch(e){throw new Error(\"Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().\")}return t}async bytes(){this.throwIfDisposed();let t=await Ps().read(this.dataId);return this.dtype===\"string\"?t:new Uint8Array(t.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Ps().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error(\"Tensor is disposed.\")}print(t=!1){return Zp.print(this,t)}clone(){return this.throwIfDisposed(),Zp.clone(this)}toString(t=!1){let e=this.dataSync();return X0(e,this.shape,this.dtype,t)}cast(t){return this.throwIfDisposed(),Zp.cast(this,t)}variable(t=!0,e,o){return this.throwIfDisposed(),Ps().makeVariable(this,t,e,o)}};Object.defineProperty(mt,Symbol.hasInstance,{value:r=>!!r&&r.data!=null&&r.dataSync!=null&&r.throwIfDisposed!=null});function fw(){return ml(\"Tensor\",()=>mt)}fw();var ri=class extends mt{constructor(t,e,o,n){super(t.shape,t.dtype,t.dataId,n),this.trainable=e,this.name=o}assign(t){if(t.dtype!==this.dtype)throw new Error(`dtype of the new value (${t.dtype}) and previous value (${this.dtype}) must match`);if(!br(t.shape,this.shape))throw new Error(`shape of the new value (${t.shape}) and previous value (${this.shape}) must match`);Ps().disposeTensor(this),this.dataId=t.dataId,Ps().incRef(this,null)}dispose(){Ps().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(ri,Symbol.hasInstance,{value:r=>r instanceof mt&&r.assign!=null&&r.assign instanceof Function});var tk={};qe(tk,{assertTypesMatch:()=>Cw,getTensorsInContainer:()=>yl,isTensorInList:()=>p4,makeTypesMatch:()=>Oe});var hw;(function(r){r.R0=\"R0\",r.R1=\"R1\",r.R2=\"R2\",r.R3=\"R3\",r.R4=\"R4\",r.R5=\"R5\",r.R6=\"R6\"})(hw||(hw={}));var gw;(function(r){r.float32=\"float32\",r.int32=\"int32\",r.bool=\"int32\",r.complex64=\"complex64\"})(gw||(gw={}));var xw;(function(r){r.float32=\"float32\",r.int32=\"int32\",r.bool=\"bool\",r.complex64=\"complex64\"})(xw||(xw={}));var yw;(function(r){r.float32=\"float32\",r.int32=\"float32\",r.bool=\"float32\",r.complex64=\"complex64\"})(yw||(yw={}));var bw;(function(r){r.float32=\"complex64\",r.int32=\"complex64\",r.bool=\"complex64\",r.complex64=\"complex64\"})(bw||(bw={}));var u4={float32:yw,int32:gw,bool:xw,complex64:bw};function dt(r,t){if(r===\"string\"||t===\"string\"){if(r===\"string\"&&t===\"string\")return\"string\";throw new Error(`Can not upcast ${r} with ${t}`)}return u4[r][t]}function oi(r){return dt(r,\"int32\")}function ed(r){return r!=null&&typeof r==\"object\"&&\"texture\"in r&&r.texture instanceof WebGLTexture}function td(r){return typeof GPUBuffer!=\"undefined\"&&r!=null&&typeof r==\"object\"&&\"buffer\"in r&&r.buffer instanceof GPUBuffer}function Oe(r,t){if(r.dtype===t.dtype)return[r,t];let e=dt(r.dtype,t.dtype);return[r.cast(e),t.cast(e)]}function Cw(r,t){$(r.dtype===t.dtype,()=>`The dtypes of the first(${r.dtype}) and second(${t.dtype}) input must match`)}function p4(r,t){return t.some(e=>e.id===r.id)}function yl(r){let t=[];return ek(r,t,new Set),t}function ek(r,t,e){if(r==null)return;if(r instanceof mt){t.push(r);return}if(!c4(r))return;let o=r;for(let n in o){let s=o[n];e.has(s)||(e.add(s),ek(s,t,e))}}function c4(r){return Array.isArray(r)||typeof r==\"object\"}function ww(r){return r.kernelName!=null}var rd=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(t=>t.name)))}}}dispose(){for(let t in this.registeredVariables)this.registeredVariables[t].dispose()}},bl=class r{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new rd}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let t=this.getSortedBackends();for(let e=0;e{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(t){jm(t).forEach(o=>{o.disposeFunc!=null&&o.disposeFunc(this.registry[t])})}initializeBackend(t){let e=this.registryFactory[t];if(e==null)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{let o=e.factory();if(o&&!(o instanceof so)&&typeof o.then==\"function\"){let n=++this.pendingBackendInitId,s=o.then(a=>n(nthis.registryFactory[e].priority-this.registryFactory[t].priority)}initializeBackendsAndReturnBest(){let t=this.getSortedBackends();for(let e=0;ethis.startScope(o),()=>this.endScope(n),()=>(n=e(),n instanceof Promise&&console.error(\"Cannot return a Promise inside of tidy.\"),n))}scopedRun(t,e,o){t();try{let n=o();return e(),n}catch(n){throw e(),n}}nextTensorId(){return r.nextTensorId++}nextVariableId(){return r.nextVariableId++}clone(t){let e=T.runKernel(Co,{x:t}),o={x:t},n=a=>({x:()=>{let i=\"float32\",p={x:a},u={dtype:i};return T.runKernel(yo,p,u)}}),s=[];return this.addTapeNode(this.state.activeScope.name,o,[e],n,s,{}),e}runKernel(t,e,o){if(this.backendName==null&&this.backend,!(qp(t,this.backendName)!=null))throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:e,attrs:o})}shouldCheckForMemLeaks(){return this.ENV.getBool(\"IS_TEST\")}checkKernelForMemLeak(t,e,o){let n=this.backend.numDataIds(),s=0;o.forEach(p=>{s+=p.dtype===\"complex64\"?3:1});let a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=n-e-s-a;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${t}'`)}runKernelFunc(t){let e,o=[],n=this.isTapeOn(),s=this.state.numBytes,a=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let p,u=ww(t)?t.kernelName:this.state.activeScope!=null?this.state.activeScope.name:\"\";if(ww(t)){let{kernelName:f,inputs:h,attrs:g}=t;this.backendName==null&&this.backend;let x=qp(f,this.backendName);$(x!=null,()=>`Cannot find registered kernel '${f}' for backend '${this.backendName}'`),i=()=>{let b=this.backend.numDataIds();p=x.kernelFunc({inputs:h,attrs:g,backend:this.backend});let C=Array.isArray(p)?p:[p];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(f,b,C);let S=C.map(k=>k.rank!=null?k:this.makeTensorFromTensorInfo(k));if(n){let k=this.getTensorsForGradient(f,h,S);o=this.saveTensorsForBackwardMode(k)}return S}}else{let{forwardFunc:f}=t,h=g=>{n&&(o=g.map(x=>this.keep(this.clone(x))))};i=()=>{let g=this.backend.numDataIds();p=this.tidy(()=>f(this.backend,h));let x=Array.isArray(p)?p:[p];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,g,x),x}}let{inputs:c,attrs:l}=t,m=ww(t)?null:t.backwardsFunc,d;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool(\"DEBUG\")&&!this.state.profiling?e=i():(d=this.profiler.profileKernel(u,c,()=>i()),this.ENV.getBool(\"DEBUG\")&&this.profiler.logKernelProfile(d),e=d.outputs)}),n&&this.addTapeNode(u,c,e,m,o,l),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(f=>c[f]!=null?c[f].shape:null),outputShapes:e.map(f=>f.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(p)?e:e[0]}saveTensorsForBackwardMode(t){return t.map(o=>this.keep(this.clone(o)))}getTensorsForGradient(t,e,o){let n=aw(t);if(n!=null){let s=n.inputsToSave||[],a=n.outputsToSave||[],i;n.saveAllInputs?($(Array.isArray(e),()=>\"saveAllInputs is true, expected inputs to be an array.\"),i=Object.keys(e).map(u=>e[u])):i=s.map(u=>e[u]);let p=o.filter((u,c)=>a[c]);return i.concat(p)}return[]}makeTensor(t,e,o,n){if(t==null)throw new Error(\"Values passed to engine.makeTensor() are null\");o=o||\"float32\",n=n||this.backend;let s=t;o===\"string\"&&zo(t[0])&&(s=t.map(p=>Zi(p)));let a=n.write(s,e,o),i=new mt(e,o,a,this.nextTensorId());if(this.trackTensor(i,n),o===\"string\"){let p=this.state.tensorInfo.get(a),u=rw(s);this.state.numBytes+=u-p.bytes,p.bytes=u}return i}makeTensorFromDataId(t,e,o,n){o=o||\"float32\";let s={dataId:t,shape:e,dtype:o};return this.makeTensorFromTensorInfo(s,n)}makeTensorFromTensorInfo(t,e){let{dataId:o,shape:n,dtype:s}=t,a=new mt(n,s,o,this.nextTensorId());return this.trackTensor(a,e),a}makeVariable(t,e=!0,o,n){o=o||this.nextVariableId().toString(),n!=null&&n!==t.dtype&&(t=t.cast(n));let s=new ri(t,e,o,this.nextTensorId());if(this.state.registeredVariables[s.name]!=null)throw new Error(`Variable with name ${s.name} was already registered`);return this.state.registeredVariables[s.name]=s,this.incRef(s,this.backend),s}trackTensor(t,e){this.state.numTensors++,t.dtype===\"string\"&&this.state.numStringTensors++;let o=0;t.dtype!==\"complex64\"&&t.dtype!==\"string\"&&(o=t.size*zp(t.dtype)),this.state.numBytes+=o,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:o})),t instanceof ri||this.track(t)}incRef(t,e){this.trackTensor(t,e),this.backend.incRef(t.dataId)}removeDataId(t,e){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===e&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;let e=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,t.dtype===\"string\"&&(this.state.numStringTensors--,this.state.numBytes-=e.bytes),t.dtype!==\"complex64\"&&t.dtype!==\"string\"){let o=t.size*zp(t.dtype);this.state.numBytes-=o}e.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,e.backend)}disposeVariables(){for(let t in this.state.registeredVariables){let e=this.state.registeredVariables[t];this.disposeVariable(e)}}disposeVariable(t){this.disposeTensor(t),this.state.registeredVariables[t.name]!=null&&delete this.state.registeredVariables[t.name]}memory(){let t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,t.reasons==null&&(t.reasons=[]),t.reasons.push(\"Memory usage by string tensors is approximate (2 bytes per character)\")),t}async profile(t){this.state.profiling=!0;let e=this.state.numBytes,o=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(n=>n.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-o;for(let n of this.state.activeProfile.kernels)n.kernelTimeMs=await n.kernelTimeMs,n.extraInfo=await n.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(t,e,o,n,s,a){let i={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:o,saved:s},p=aw(t);p!=null&&(n=p.gradFunc),n!=null&&(i.gradient=u=>(u=u.map((c,l)=>{if(c==null){let m=o[l],d=Wp(m.size,m.dtype);return this.makeTensor(d,m.shape,m.dtype)}return c}),n(u.length>1?u:u[0],s,a))),this.state.activeTape.push(i)}keep(t){return t.kept=!0,t}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){let e={track:[],name:\"unnamed scope\",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e}endScope(t){let e=yl(t),o=new Set(e.map(s=>s.id));for(let s=0;s{!s.kept&&s.scopeId===n.id&&this.track(s)})}gradients(t,e,o,n=!1){if($(e.length>0,()=>\"gradients() received an empty list of xs.\"),o!=null&&o.dtype!==\"float32\")throw new Error(`dy must have 'float32' dtype, but has '${o.dtype}'`);let s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy(\"forward\",t));$(s instanceof mt,()=>\"The result y returned by f() must be a tensor.\");let a=K0(this.state.activeTape,e,s);if(!n&&a.length===0&&e.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[s.id]=o==null?l4(s.shape):o,q0(i,a,u=>this.tidy(u),m4);let p=e.map(u=>i[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(let c of u.saved)c.dispose()}),this.state.activeTape=null),{value:s,grads:p}})}customGrad(t){return $(qs(t),()=>\"The f passed in customGrad(f) must be a function.\"),(...e)=>{$(e.every(i=>i instanceof mt),()=>\"The args passed in customGrad(f)(x1, x2,...) must all be tensors\");let o,n={};e.forEach((i,p)=>{n[p]=i});let s=(i,p)=>(o=t(...e,p),$(o.value instanceof mt,()=>\"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor\"),$(qs(o.gradFunc),()=>\"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.\"),o.value),a=(i,p)=>{let u=o.gradFunc(i,p),c=Array.isArray(u)?u:[u];$(c.length===e.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(...).\"),$(c.every(m=>m instanceof mt),()=>\"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 l={};return c.forEach((m,d)=>{l[d]=()=>m}),l};return this.runKernelFunc({forwardFunc:s,backwardsFunc:a,inputs:n})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}readToGPU(t,e){return this.state.tensorInfo.get(t).backend.readToGPU(t,e)}async time(t){let e=Pu(),o=await this.backend.time(t);return o.wallMs=Pu()-e,o}track(t){return this.state.activeScope!=null&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new rd;for(let t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};bl.nextTensorId=0;bl.nextVariableId=0;function l4(r){let t=cl(He(r),\"float32\");return T.makeTensor(t,r,\"float32\")}function Sw(){let r=sw();if(r._tfengine==null){let t=new ll(r);r._tfengine=new bl(t)}return $0(r._tfengine.ENV),Q0(()=>r._tfengine),r._tfengine}var T=Sw();function m4(r,t){let e={a:r,b:t};return T.runKernel(io,e)}var Ji={};qe(Ji,{isBrowser:()=>vw,isMobile:()=>h4,mockIsMobile:()=>f4});function d4(){return typeof navigator!=\"undefined\"&&navigator!=null}var Iw;function f4(r){Iw=r}function h4(r){if(Iw!==void 0)return Iw;if(r||d4()){if(r||(r=navigator),r.product===\"ReactNative\")return!0;let t=r.userAgent||r.vendor||(typeof window!=\"undefined\"?window.opera:\"\");if(!t){let e=r;return e.userAgentData&&e.userAgentData.mobile}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 vw(){return typeof window!=\"undefined\"&&window.document!=null||typeof WorkerGlobalScope!=\"undefined\"}var _r=A();_r.registerFlag(\"DEBUG\",()=>!1,r=>{r&&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.\")});_r.registerFlag(\"IS_BROWSER\",()=>vw());_r.registerFlag(\"IS_NODE\",()=>typeof process!=\"undefined\"&&typeof process.versions!=\"undefined\"&&typeof process.versions.node!=\"undefined\");_r.registerFlag(\"IS_CHROME\",()=>typeof navigator!=\"undefined\"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));_r.registerFlag(\"IS_SAFARI\",()=>typeof navigator!=\"undefined\"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));_r.registerFlag(\"PROD\",()=>!1);_r.registerFlag(\"TENSORLIKE_CHECK_SHAPE_CONSISTENCY\",()=>_r.getBool(\"DEBUG\"));_r.registerFlag(\"DEPRECATION_WARNINGS_ENABLED\",()=>!0);_r.registerFlag(\"IS_TEST\",()=>!1);_r.registerFlag(\"CHECK_COMPUTATION_FOR_ERRORS\",()=>_r.getBool(\"DEBUG\"));_r.registerFlag(\"WRAP_TO_IMAGEBITMAP\",()=>!1);_r.registerFlag(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\",()=>!1);_r.registerFlag(\"USE_SETTIMEOUTCUSTOM\",()=>!1);function sr(r,t){let e=r;if(Pt(r))return t===\"string\"?[]:[r.length];if(ed(r)){let n=r.channels||\"RGBA\";return[r.height,r.width*n.length]}else if(td(r))return[r.buffer.size/(t==null?4:zp(t))];if(!Array.isArray(r))return[];let o=[];for(;Array.isArray(e)||Pt(e)&&t!==\"string\";)o.push(e.length),e=e[0];return Array.isArray(r)&&A().getBool(\"TENSORLIKE_CHECK_SHAPE_CONSISTENCY\")&&ok(r,o,[]),o}function ok(r,t,e){if(e=e||[],!Array.isArray(r)&&!Pt(r)){$(t.length===0,()=>`Element arr[${e.join(\"][\")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}$(t.length>0,()=>`Element arr[${e.join(\"][\")}] should be a primitive, but is an array of ${r.length} elements`),$(r.length===t[0],()=>`Element arr[${e.join(\"][\")}] should have ${t[0]} elements, but has ${r.length} elements`);let o=t.slice(1);for(let n=0;n=0&&(n=o),rk(o,n,t,e),r==null||!Pt(r)&&!Array.isArray(r)&&typeof r!=\"number\"&&typeof r!=\"boolean\"&&typeof r!=\"string\"){let p=r==null?\"null\":r.constructor.name;throw new Error(`Argument '${t}' passed to '${e}' must be a Tensor or TensorLike, but got '${p}'`)}let s=sr(r,n);!Pt(r)&&!Array.isArray(r)&&(r=[r]);let i=n!==\"string\"?Yp(r,n):Fs(r,[],!0);return T.makeTensor(i,s,n)}function ni(r,t,e,o=\"numeric\"){if(!Array.isArray(r))throw new Error(`Argument ${t} passed to ${e} must be a \\`Tensor[]\\` or \\`TensorLike[]\\``);return r.map((s,a)=>v(s,`${t}[${a}]`,e,o))}var kw=\"__op\";function N(r){let t=Object.keys(r);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 e=t[0],o=r[e];e.endsWith(\"_\")&&(e=e.substring(0,e.length-1)),e=e+kw;let n=(...s)=>{T.startScope(e);try{let a=o(...s);return Tu(a)&&console.error(\"Cannot return a Promise inside of tidy.\"),T.endScope(a),a}catch(a){throw T.endScope(null),a}};return Object.defineProperty(n,\"name\",{value:e,configurable:!0}),n}function g4(r,t){let e=v(r,\"real\",\"complex\"),o=v(t,\"imag\",\"complex\");xt(e.shape,o.shape,`real and imag shapes, ${e.shape} and ${o.shape}, must match in call to tf.complex().`);let n={real:e,imag:o};return T.runKernel(Ri,n)}var $r=N({complex_:g4});function wr(r,t,e,o){if(o==null)o=_i(r);else if(o===\"complex64\")throw new Error(\"Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).\");if(td(r)||ed(r)){if(o!==\"float32\"&&o!==\"int32\")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${o}.`);return T.backend.createTensorFromGPUData(r,t||e,o)}if(!Pt(r)&&!Array.isArray(r)&&typeof r!=\"number\"&&typeof r!=\"boolean\"&&typeof r!=\"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){Ct(t);let n=He(t),s=He(e);$(n===s,()=>`Based on the provided shape, [${t}], the tensor should have ${n} values but has ${s}`);for(let a=0;a`Error creating a new Tensor. Inferred shape (${e}) does not match the provided shape (${t}). `)}}return!Pt(r)&&!Array.isArray(r)&&(r=[r]),t=t||e,r=o!==\"string\"?Yp(r,o):Fs(r,[],!0),T.makeTensor(r,t,o)}function ar(r,t,e){let o=sr(r,e);return wr(r,t,o,e)}var Cl={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};var ir=class r{static join(t){return new r(t).slice()}constructor(t){if(this.shards=[],this.previousShardIndex=0,t==null||(t instanceof Array||(t=[t]),t=t.map(o=>Pt(o)?o.buffer:o),t.length===0))return;this.bufferUniformSize=t[0].byteLength;let e=0;for(let o=0;o=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(t/this.bufferUniformSize),this.previousShardIndex;function e(n){return t=n.end?1:0}if(e(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;let o=x4(this.shards,e);return o===-1?-1:(this.previousShardIndex=o,this.previousShardIndex)}};function x4(r,t){let e=0,o=r.length;for(;e<=o;){let n=Math.floor((o-e)/2)+e,s=t(r[n]);if(s===0)return n;s<0?o=n:e=n+1}return-1}var od=4;async function sk(r,t){let e=[],o=[],n=Array.isArray(r)?r.map(a=>a.name):Object.keys(r);for(let a=0;a{let m=await p.bytes(),d=m.reduce((g,x)=>g+x.length,0)+od*m.length,f=new Uint8Array(d),h=0;for(let g=0;g{if(t+=s.byteLength,e.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 o=new Uint8Array(t),n=0;return e.forEach(s=>{o.set(new Uint8Array(s.buffer),n),n+=s.byteLength}),o.buffer}var Nw=typeof Buffer!=\"undefined\"&&(typeof Blob==\"undefined\"||typeof atob==\"undefined\"||typeof btoa==\"undefined\");function nk(r){return Nw?Buffer.byteLength(r,\"utf8\"):new Blob([r]).size}function ak(r){if(Nw)return Buffer.from(r).toString(\"base64\");let t=new Uint8Array(r),e=\"\";for(let o=0,n=t.length;o{let o=e<<13,n=0;for(;!(o&8388608);)n-=8388608,o<<=1;return o&=-8388609,n+=947912704,o|n},t=new Uint32Array(2048);t[0]=0;for(let e=1;e<1024;e++)t[e]=r(e);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}function C4(){let r=new Uint32Array(64);r[0]=0,r[31]=1199570944,r[32]=2147483648,r[63]=3347054592;for(let t=1;t<31;t++)r[t]=t<<23;for(let t=33;t<63;t++)r[t]=2147483648+(t-32<<23);return r}function w4(){let r=new Uint32Array(64);for(let t=0;t<64;t++)r[t]=1024;return r[0]=r[32]=0,r}function S4(){let r=b4(),t=C4(),e=w4();return o=>{let n=new ArrayBuffer(4*o.length),s=new Uint32Array(n);for(let a=0;a>10]+(i&1023)]+t[i>>10];s[a]=p}return new Float32Array(n)}}var qt=class r{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return r.instance==null&&(r.instance=new r),r.instance}static registerSaveRouter(t){r.getInstance().saveRouters.push(t)}static registerLoadRouter(t){r.getInstance().loadRouters.push(t)}static getSaveHandlers(t){return r.getHandlers(t,\"save\")}static getLoadHandlers(t,e){return r.getHandlers(t,\"load\",e)}static getHandlers(t,e,o){let n=[];return(e===\"load\"?r.getInstance().loadRouters:r.getInstance().saveRouters).forEach(a=>{let i=a(t,o);i!==null&&n.push(i)}),n}},pk=r=>qt.registerSaveRouter(r),ck=r=>qt.registerLoadRouter(r),lk=r=>qt.getSaveHandlers(r),mk=(r,t)=>qt.getLoadHandlers(r,t);var $w=\"tensorflowjs\",Ew=1,Ou=\"models_store\",eu=\"model_info_store\";function dk(){if(!A().getBool(\"IS_BROWSER\"))throw new Error(\"Failed to obtain IndexedDB factory because the current environmentis not a web browser.\");let r=typeof window==\"undefined\"?self:window,t=r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB||r.shimIndexedDB;if(t==null)throw new Error(\"The current browser does not appear to support IndexedDB.\");return t}function Rw(r){let t=r.result;t.createObjectStore(Ou,{keyPath:\"modelPath\"}),t.createObjectStore(eu,{keyPath:\"modelPath\"})}var ka=class{constructor(t){if(this.indexedDB=dk(),t==null||!t)throw new Error(\"For IndexedDB, modelPath must not be null, undefined or empty.\");this.modelPath=t}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error(\"BrowserLocalStorage.save() does not support saving model topology in binary formats yet.\");return this.databaseAction(this.modelPath,t)}async load(){return this.databaseAction(this.modelPath)}databaseAction(t,e){return new Promise((o,n)=>{let s=this.indexedDB.open($w,Ew);s.onupgradeneeded=()=>Rw(s),s.onsuccess=()=>{let a=s.result;if(e==null){let i=a.transaction(Ou,\"readonly\"),u=i.objectStore(Ou).get(this.modelPath);u.onsuccess=()=>{if(u.result==null)return a.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));o(u.result.modelArtifacts)},u.onerror=c=>(a.close(),n(u.error)),i.oncomplete=()=>a.close()}else{e.weightData=ir.join(e.weightData);let i=va(e),p=a.transaction(eu,\"readwrite\"),u=p.objectStore(eu),c;try{c=u.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(m){return n(m)}let l;c.onsuccess=()=>{l=a.transaction(Ou,\"readwrite\");let m=l.objectStore(Ou),d;try{d=m.put({modelPath:this.modelPath,modelArtifacts:e,modelArtifactsInfo:i})}catch(f){return n(f)}d.onsuccess=()=>o({modelArtifactsInfo:i}),d.onerror=f=>{u=p.objectStore(eu);let h=u.delete(this.modelPath);h.onsuccess=()=>(a.close(),n(d.error)),h.onerror=g=>(a.close(),n(d.error))}},c.onerror=m=>(a.close(),n(c.error)),p.oncomplete=()=>{l==null?a.close():l.oncomplete=()=>a.close()}}},s.onerror=a=>n(s.error)})}};ka.URL_SCHEME=\"indexeddb://\";var fk=r=>A().getBool(\"IS_BROWSER\")&&!Array.isArray(r)&&r.startsWith(ka.URL_SCHEME)?I4(r.slice(ka.URL_SCHEME.length)):null;qt.registerSaveRouter(fk);qt.registerLoadRouter(fk);function I4(r){return new ka(r)}function v4(r){return r.startsWith(ka.URL_SCHEME)?r.slice(ka.URL_SCHEME.length):r}var id=class{constructor(){this.indexedDB=dk()}async listModels(){return new Promise((t,e)=>{let o=this.indexedDB.open($w,Ew);o.onupgradeneeded=()=>Rw(o),o.onsuccess=()=>{let n=o.result,s=n.transaction(eu,\"readonly\"),i=s.objectStore(eu).getAll();i.onsuccess=()=>{let p={};for(let u of i.result)p[u.modelPath]=u.modelArtifactsInfo;t(p)},i.onerror=p=>(n.close(),e(i.error)),s.oncomplete=()=>n.close()},o.onerror=n=>e(o.error)})}async removeModel(t){return t=v4(t),new Promise((e,o)=>{let n=this.indexedDB.open($w,Ew);n.onupgradeneeded=()=>Rw(n),n.onsuccess=()=>{let s=n.result,a=s.transaction(eu,\"readwrite\"),i=a.objectStore(eu),p=i.get(t),u;p.onsuccess=()=>{if(p.result==null)return s.close(),o(new Error(`Cannot find model with path '${t}' in IndexedDB.`));{let c=i.delete(t),l=()=>{u=s.transaction(Ou,\"readwrite\");let d=u.objectStore(Ou).delete(t);d.onsuccess=()=>e(p.result.modelArtifactsInfo),d.onerror=f=>o(p.error)};c.onsuccess=l,c.onerror=m=>(l(),s.close(),o(p.error))}},p.onerror=c=>(s.close(),o(p.error)),a.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}},n.onerror=s=>o(n.error)})}};var si=\"/\",ec=\"tensorflowjs_models\",hk=\"info\",k4=\"model_topology\",N4=\"weight_specs\",T4=\"weight_data\",_4=\"model_metadata\";function gk(r){return{info:[ec,r,hk].join(si),topology:[ec,r,k4].join(si),weightSpecs:[ec,r,N4].join(si),weightData:[ec,r,T4].join(si),modelMetadata:[ec,r,_4].join(si)}}function xk(r){for(let t of Object.values(r))window.localStorage.removeItem(t)}function $4(r){let t=r.split(si);if(t.length<3)throw new Error(`Invalid key format: ${r}`);return t.slice(1,t.length-1).join(si)}function E4(r){return r.startsWith(Na.URL_SCHEME)?r.slice(Na.URL_SCHEME.length):r}var Na=class{constructor(t){if(!A().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,t==null||!t)throw new Error(\"For local storage, modelPath must not be null, undefined or empty.\");this.modelPath=t,this.keys=gk(this.modelPath)}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error(\"BrowserLocalStorage.save() does not support saving model topology in binary formats yet.\");{let e=JSON.stringify(t.modelTopology),o=JSON.stringify(t.weightSpecs),n=va(t),s=ir.join(t.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(n)),this.LS.setItem(this.keys.topology,e),this.LS.setItem(this.keys.weightSpecs,o),this.LS.setItem(this.keys.weightData,ak(s));let a={format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,signature:t.signature!=null?t.signature:void 0,userDefinedMetadata:t.userDefinedMetadata!=null?t.userDefinedMetadata:void 0,modelInitializer:t.modelInitializer!=null?t.modelInitializer:void 0,initializerSignature:t.initializerSignature!=null?t.initializerSignature:void 0,trainingConfig:t.trainingConfig!=null?t.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:n}}catch(a){throw xk(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.weightDataBytes}.`)}}}async load(){let t=JSON.parse(this.LS.getItem(this.keys.info));if(t==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(t.modelTopologyType!==\"JSON\")throw new Error(\"BrowserLocalStorage does not support loading non-JSON model topology yet.\");let e={},o=JSON.parse(this.LS.getItem(this.keys.topology));if(o==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);e.modelTopology=o;let n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(n==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);e.weightSpecs=n;let s=this.LS.getItem(this.keys.modelMetadata);if(s!=null){let i=JSON.parse(s);e.format=i.format,e.generatedBy=i.generatedBy,e.convertedBy=i.convertedBy,i.signature!=null&&(e.signature=i.signature),i.userDefinedMetadata!=null&&(e.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(e.modelInitializer=i.modelInitializer),i.initializerSignature!=null&&(e.initializerSignature=i.initializerSignature),i.trainingConfig!=null&&(e.trainingConfig=i.trainingConfig)}let a=this.LS.getItem(this.keys.weightData);if(a==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return e.weightData=ik(a),e}};Na.URL_SCHEME=\"localstorage://\";var yk=r=>A().getBool(\"IS_BROWSER\")&&!Array.isArray(r)&&r.startsWith(Na.URL_SCHEME)?R4(r.slice(Na.URL_SCHEME.length)):null;qt.registerSaveRouter(yk);qt.registerLoadRouter(yk);function R4(r){return new Na(r)}var ud=class{constructor(){$(A().getBool(\"IS_BROWSER\"),()=>\"Current environment is not a web browser\"),$(typeof window==\"undefined\"||typeof window.localStorage!=\"undefined\",()=>\"Current browser does not appear to support localStorage\"),this.LS=window.localStorage}async listModels(){let t={},e=ec+si,o=si+hk;for(let n=0;n\"scheme must not be undefined or null.\"),t.endsWith(tc)&&(t=t.slice(0,t.indexOf(tc))),$(t.length>0,()=>\"scheme must not be an empty string.\");let o=r.getInstance();$(o.managers[t]==null,()=>`A model store manager is already registered for scheme '${t}'.`),o.managers[t]=e}static getManager(t){let e=r.getInstance().managers[t];if(e==null)throw new Error(`Cannot find model manager for scheme '${t}'`);return e}static getSchemes(){return Object.keys(r.getInstance().managers)}};function pd(r){if(r.indexOf(tc)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Os.getSchemes().join(\",\")}`);return{scheme:r.split(tc)[0],path:r.split(tc)[1]}}async function bk(r,t,e=!1){$(r!==t,()=>`Old path and new path are the same: '${r}'`);let o=qt.getLoadHandlers(r);$(o.length>0,()=>`Copying failed because no load handler is found for source URL ${r}.`),$(o.length<2,()=>`Copying failed because more than one (${o.length}) load handlers for source URL ${r}.`);let n=o[0],s=qt.getSaveHandlers(t);$(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),$(s.length<2,()=>`Copying failed because more than one (${o.length}) save handlers for destination URL ${t}.`);let a=s[0],i=pd(r).scheme,p=pd(r).path,u=i===pd(r).scheme,c=await n.load();e&&u&&await Os.getManager(i).removeModel(p);let l=await a.save(c);return e&&!u&&await Os.getManager(i).removeModel(p),l.modelArtifactsInfo}async function Ck(){let r=Os.getSchemes(),t={};for(let e of r){let o=await Os.getManager(e).listModels();for(let n in o){let s=e+tc+n;t[s]=o[n]}}return t}async function wk(r){let t=pd(r);return Os.getManager(t.scheme).removeModel(t.path)}async function Sk(r,t){return bk(r,t,!1)}async function Ik(r,t){return bk(r,t,!0)}var Dw=class{constructor(){this.messageName=\"setTimeoutCustom\",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(t,e){return fetch(t,e)}now(){return performance.now()}encode(t,e){if(e!==\"utf-8\"&&e!==\"utf8\")throw new Error(`Browser's encoder only supports utf-8, but got ${e}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(t)}decode(t,e){return new TextDecoder(e).decode(t)}setTimeoutCustom(t,e){if(typeof window==\"undefined\"||!A().getBool(\"USE_SETTIMEOUTCUSTOM\")){setTimeout(t,e);return}this.functionRefs.push(t),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},\"*\")},e),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener(\"message\",o=>{if(o.source===window&&o.data.name===this.messageName){o.stopPropagation();let n=this.functionRefs[o.data.index];n(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(t){return Xm(t)}};if(A().get(\"IS_BROWSER\")){A().setPlatform(\"browser\",new Dw);try{Os.registerManager(Na.URL_SCHEME,new ud)}catch(r){}try{Os.registerManager(ka.URL_SCHEME,new id)}catch(r){}}var D4={importFetch:()=>vk()},Aw;var Fw=class{constructor(){this.util=kk(),this.textEncoder=new this.util.TextEncoder}fetch(t,e){return A().global.fetch!=null?A().global.fetch(t,e):(Aw==null&&(Aw=D4.importFetch()),Aw(t,e))}now(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}encode(t,e){if(e!==\"utf-8\"&&e!==\"utf8\")throw new Error(`Node built-in encoder only supports utf-8, but got ${e}`);return this.textEncoder.encode(t)}decode(t,e){return t.length===0?\"\":new this.util.TextDecoder(e).decode(t)}isTypedArray(t){return this.util.types.isFloat32Array(t)||this.util.types.isInt32Array(t)||this.util.types.isUint8Array(t)||this.util.types.isUint8ClampedArray(t)}};A().get(\"IS_NODE\")&&!A().get(\"IS_BROWSER\")&&A().setPlatform(\"node\",new Fw);function me(r,t=\"float32\",e){return t=t||\"float32\",Ct(r),new tt(r,t,e)}function A4(r,t){let e=v(r,\"x\",\"cast\");if(!tw(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t===\"string\"&&e.dtype!==\"string\"||t!==\"string\"&&e.dtype===\"string\")throw new Error(\"Only strings can be casted to strings\");let o={x:e},n={dtype:t};return T.runKernel(yo,o,n)}var We=N({cast_:A4});function F4(r){let e={x:v(r,\"x\",\"clone\",\"string_or_numeric\")};return T.runKernel(Co,e)}var Wr=N({clone_:F4});function cd(r,t=!1){console.log(r.toString(t))}Sw();var P4={buffer:me,cast:We,clone:Wr,print:cd};Z0(P4);function lde(){A().set(\"PROD\",!0)}function mde(){A().set(\"DEBUG\",!0)}function dde(){A().set(\"DEPRECATION_WARNINGS_ENABLED\",!1),console.warn(\"TensorFlow.js deprecation warnings have been disabled.\")}function Pw(r){A().getBool(\"DEPRECATION_WARNINGS_ENABLED\")&&console.warn(r+\" You can disable deprecation warnings with tf.disableDeprecationWarnings().\")}J0(Pw);function fde(){T.disposeVariables()}function ur(){return T}function hde(){return T.memory()}function gde(r){return T.profile(r)}function De(r,t){return T.tidy(r,t)}function Ot(r){yl(r).forEach(e=>e.dispose())}function Er(r){return T.keep(r)}function xde(r){return T.time(r)}function yde(r){return T.setBackend(r)}function bde(){return T.ready()}function Cde(){return T.backendName}function wde(r){T.removeBackend(r)}function Sde(r){return T.findBackend(r)}function Ide(r){return T.findBackendFactory(r)}function tu(r,t,e=1){return T.registerBackend(r,t,e)}function vde(){return T.backend}function kde(r,t){A().setPlatform(r,t)}function O4(r,t){let e=v(r,\"a\",\"add\"),o=v(t,\"b\",\"add\");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(io,n)}var Ce=N({add_:O4});function M4(r,t){let e=v(r,\"a\",\"floorDiv\"),o=v(t,\"b\",\"floorDiv\");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Sn,n)}var ld=N({floorDiv_:M4});function L4(r,t){let e=v(r,\"a\",\"div\"),o=v(t,\"b\",\"div\");if([e,o]=Oe(e,o),e.dtype===\"int32\"&&o.dtype===\"int32\")return ld(e,o);let n={a:e,b:o},s={};return T.runKernel(fn,n,s)}var je=N({div_:L4});function B4(r,t){let e=v(r,\"a\",\"mul\"),o=v(t,\"b\",\"mul\");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Xn,n)}var se=N({mul_:B4});function z4(r){let t=v(r,\"x\",\"abs\");if(t.dtype===\"complex64\"){let e={x:t};return T.runKernel(Di,e)}else{let e={x:t};return T.runKernel(Xs,e)}}var Qt=N({abs_:z4});function V4(r){let e={x:v(r,\"x\",\"acos\")};return T.runKernel(Vo,e)}var Nk=N({acos_:V4});function W4(r){let e={x:v(r,\"x\",\"acosh\")};return T.runKernel(Wo,e)}var Tk=N({acosh_:W4});function U4(r){$(Array.isArray(r),()=>\"The argument passed to tf.addN() must be a list of tensors\"),$(r.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${r.length}`);let t=r.map((n,s)=>v(n,`tensors${s}`,\"addN\")),e=t[0];t.forEach(n=>{if(n.dtype!==e.dtype)throw new Error(\"All tensors passed to tf.addN() must have the same dtype\")}),t.forEach(n=>{if(!br(n.shape,e.shape))throw new Error(\"All tensors passed to tf.addN() must have the same shape\")});let o=t;return T.runKernel(Uo,o)}var _k=N({addN_:U4});function G4(r,t=null,e=!1){let n={x:v(r,\"x\",\"all\",\"bool\")},s={axis:t,keepDims:e};return T.runKernel(Go,n,s)}var $k=N({all_:G4});function H4(r,t=null,e=!1){let n={x:v(r,\"x\",\"any\",\"bool\")},s={axis:t,keepDims:e};return T.runKernel(Ho,n,s)}var Ek=N({any_:H4});function K4(r,t=0){let o={x:v(r,\"x\",\"argMax\")},n={axis:t};return T.runKernel(Ys,o,n)}var Rk=N({argMax_:K4});function q4(r,t=0){let o={x:v(r,\"x\",\"argMin\")},n={axis:t};return T.runKernel(Qs,o,n)}var Dk=N({argMin_:q4});function j4(r){let e={x:v(r,\"x\",\"asin\")};return T.runKernel(Ko,e)}var Ak=N({asin_:j4});function X4(r){let e={x:v(r,\"x\",\"asinh\")};return T.runKernel(qo,e)}var Fk=N({asinh_:X4});function Y4(r){let e={x:v(r,\"x\",\"atan\")};return T.runKernel(jo,e)}var Pk=N({atan_:Y4});function Q4(r,t){let e=v(r,\"a\",\"atan2\"),o=v(t,\"b\",\"atan2\");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Yo,n)}var Ok=N({atan2_:Q4});function Z4(r){let e={x:v(r,\"x\",\"atanh\")};return T.runKernel(Xo,e)}var Mk=N({atanh_:Z4});function J4(r,t,e,o,n=\"NHWC\",s){let a=r[3],i=[...t,a],p=Bk(n);return Lu(r,i,e,s,o,null,null,p)}function Mw(r,t,e,o,n,s,a=\"channelsLast\"){let[i,p]=wl(t),u;if(a===\"channelsLast\")u=[i,p,r[3],r[3]];else if(a===\"channelsFirst\")u=[i,p,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return Lu(r,u,e,o,n,s,!1,a)}function eH(r,t,e,o,n,s,a=\"NDHWC\"){let[i,p,u]=Ow(t),c,l;if(a===\"NDHWC\")l=\"channelsLast\",c=[i,p,u,r[4],r[4]];else if(a===\"NCDHW\")l=\"channelsFirst\",c=[i,p,u,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return Lk(r,c,e,o,n,!1,l,s)}function Lu(r,t,e,o,n,s,a=!1,i=\"channelsLast\"){let[p,u,c,l]=[-1,-1,-1,-1];if(i===\"channelsLast\")[p,u,c,l]=r;else if(i===\"channelsFirst\")[p,l,u,c]=r;else throw new Error(`Unknown dataFormat ${i}`);let[m,d,,f]=t,[h,g]=wl(e),[x,b]=wl(o),C=rc(m,x),S=rc(d,b),{padInfo:k,outHeight:_,outWidth:E}=oH(n,u,c,h,g,C,S,s,i),R=a?f*l:f,D;return i===\"channelsFirst\"?D=[p,R,_,E]:i===\"channelsLast\"&&(D=[p,_,E,R]),{batchSize:p,dataFormat:i,inHeight:u,inWidth:c,inChannels:l,outHeight:_,outWidth:E,outChannels:R,padInfo:k,strideHeight:h,strideWidth:g,filterHeight:m,filterWidth:d,effectiveFilterHeight:C,effectiveFilterWidth:S,dilationHeight:x,dilationWidth:b,inShape:r,outShape:D,filterShape:t}}function Lk(r,t,e,o,n,s=!1,a=\"channelsLast\",i){let[p,u,c,l,m]=[-1,-1,-1,-1,-1];if(a===\"channelsLast\")[p,u,c,l,m]=r;else if(a===\"channelsFirst\")[p,m,u,c,l]=r;else throw new Error(`Unknown dataFormat ${a}`);let[d,f,h,,g]=t,[x,b,C]=Ow(e),[S,k,_]=Ow(o),E=rc(d,S),R=rc(f,k),D=rc(h,_),{padInfo:P,outDepth:O,outHeight:M,outWidth:L}=nH(n,u,c,l,x,b,C,E,R,D,i),B=s?g*m:g,z;return a===\"channelsFirst\"?z=[p,B,O,M,L]:a===\"channelsLast\"&&(z=[p,O,M,L,B]),{batchSize:p,dataFormat:a,inDepth:u,inHeight:c,inWidth:l,inChannels:m,outDepth:O,outHeight:M,outWidth:L,outChannels:B,padInfo:P,strideDepth:x,strideHeight:b,strideWidth:C,filterDepth:d,filterHeight:f,filterWidth:h,effectiveFilterDepth:E,effectiveFilterHeight:R,effectiveFilterWidth:D,dilationDepth:S,dilationHeight:k,dilationWidth:_,inShape:r,outShape:z,filterShape:t}}function tH(r,t,e,o,n){o==null&&(o=Lw(r,t,e));let s=r[0],a=r[1],i=Sl((s-t+2*o)/e+1,n),p=Sl((a-t+2*o)/e+1,n);return[i,p]}function rH(r,t,e,o,n,s){n==null&&(n=Lw(r,t[0],o[0]));let a=[0,0,0,e];for(let i=0;i<3;i++)r[i]+2*n>=t[i]&&(a[i]=Sl((r[i]-t[i]+2*n)/o[i]+1,s));return a}function Lw(r,t,e,o=1){let n=rc(t,o);return Math.floor((r[0]*(e-1)-e+n)/2)}function wl(r){return typeof r==\"number\"?[r,r,r]:r.length===2?[r[0],r[1],1]:r}function Ow(r){return typeof r==\"number\"?[r,r,r]:r}function rc(r,t){return t<=1?r:r+(r-1)*(t-1)}function oH(r,t,e,o,n,s,a,i,p){let u,c,l;if(typeof r==\"number\"){u={top:r,bottom:r,left:r,right:r,type:r===0?\"VALID\":\"NUMBER\"};let d=tH([t,e],s,o,r,i);c=d[0],l=d[1]}else if(r===\"same\"){c=Math.ceil(t/o),l=Math.ceil(e/n);let m=Math.max(0,(c-1)*o+s-t),d=Math.max(0,(l-1)*n+a-e),f=Math.floor(m/2),h=m-f,g=Math.floor(d/2),x=d-g;u={top:f,bottom:h,left:g,right:x,type:\"SAME\"}}else if(r===\"valid\")u={top:0,bottom:0,left:0,right:0,type:\"VALID\"},c=Math.ceil((t-s+1)/o),l=Math.ceil((e-a+1)/n);else if(typeof r==\"object\"){let m=p===\"channelsLast\"?r[1][0]:r[2][0],d=p===\"channelsLast\"?r[1][1]:r[2][1],f=p===\"channelsLast\"?r[2][0]:r[3][0],h=p===\"channelsLast\"?r[2][1]:r[3][1];u={top:m,bottom:d,left:f,right:h,type:m===0&&d===0&&f===0&&h===0?\"VALID\":\"EXPLICIT\"},c=Sl((t-s+m+d)/o+1,i),l=Sl((e-a+f+h)/n+1,i)}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:u,outHeight:c,outWidth:l}}function nH(r,t,e,o,n,s,a,i,p,u,c){let l,m,d,f;if(r===\"valid\"&&(r=0),typeof r==\"number\"){l={top:r,bottom:r,left:r,right:r,front:r,back:r,type:r===0?\"VALID\":\"NUMBER\"};let g=rH([t,e,o,1],[i,p,u],1,[n,s,a],r,c);m=g[0],d=g[1],f=g[2]}else if(r===\"same\"){m=Math.ceil(t/n),d=Math.ceil(e/s),f=Math.ceil(o/a);let h=(m-1)*n+i-t,g=(d-1)*s+p-e,x=(f-1)*a+u-o,b=Math.floor(h/2),C=h-b,S=Math.floor(g/2),k=g-S,_=Math.floor(x/2),E=x-_;l={top:S,bottom:k,left:_,right:E,front:b,back:C,type:\"SAME\"}}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:l,outDepth:m,outHeight:d,outWidth:f}}function Sl(r,t){if(!t)return Math.trunc(r);switch(t){case\"round\":return Math.round(r);case\"ceil\":return Math.ceil(r);case\"floor\":return Math.floor(r);default:throw new Error(`Unknown roundingMode ${t}`)}}function Mu(r){let[t,e,o]=wl(r);return t===1&&e===1&&o===1}function gr(r,t){return Mu(r)||Mu(t)}function Ta(r){return wl(r).every(t=>t>0)}function Bk(r){if(r===\"NHWC\")return\"channelsLast\";if(r===\"NCHW\")return\"channelsFirst\";throw new Error(`Unknown dataFormat ${r}`)}function Lt(r,t,e){if(e!=null){if(typeof t==\"string\")throw Error(`Error in ${r}: pad must be an integer when using dimRoundingMode ${e} but got pad ${t}.`);if(typeof t==\"number\")$(Ka(t),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${e} but got pad ${t}.`);else if(typeof t==\"object\")t.forEach(o=>{o.forEach(n=>{$(Ka(n),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${e} but got pad ${n}.`)})});else throw Error(`Error in ${r}: Unknown padding parameter: ${t}`)}}function sH(r,t){let o={x:v(r,\"x\",\"reshape\",\"string_or_numeric\")},n={shape:t};return T.runKernel(da,o,n)}var W=N({reshape_:sH});function aH(r,t,e,o,n){let s=v(r,\"x\",\"avgPool\",\"float32\"),a=1;$(gr(e,a),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${e} and dilations '${a}'`);let i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${i.rank}.`),Lt(\"avgPool\",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n},l=T.runKernel(Qo,u,c);return l=We(l,s.dtype),p?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var md=N({avgPool_:aH});function iH(r,t,e,o,n,s=\"NDHWC\"){let a=v(r,\"x\",\"avgPool3d\",\"float32\"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s===\"NDHWC\",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),$(typeof e==\"number\"&&e>0||Array.isArray(e)&&e[0]>0&&e[1]>0&&e[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${e}'`),Lt(\"avgPool3d\",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n,dataFormat:s},l=T.runKernel(Zs,u,c);return l=We(l,i.dtype),p?W(l,[l.shape[1],l.shape[2],l.shape[3],l.shape[4]]):l}var zk=N({avgPool3d_:iH});function uH(r,t=0){$(r.length>=1,()=>\"Pass at least one tensor to concat\");let e=ni(r,\"tensors\",\"concat\",\"string_or_numeric\");if(e[0].dtype===\"complex64\"&&e.forEach(s=>{if(s.dtype!==\"complex64\")throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${s.dtype}. `)}),e.length===1)return Wr(e[0]);let o=e,n={axis:t};return T.runKernel(ta,o,n)}var yt=N({concat_:uH});function pH(r,t,e=!1,o=!1){let n=v(r,\"a\",\"matMul\"),s=v(t,\"b\",\"matMul\");[n,s]=Oe(n,s);let a={a:n,b:s},i={transposeA:e,transposeB:o};return T.runKernel(Zo,a,i)}var Ze=N({matMul_:pH});function cH(r){let e={x:v(r,\"x\",\"sigmoid\",\"float32\")};return T.runKernel(bs,e)}var $a=N({sigmoid_:cH});function lH(r,t,e){let o=v(r,\"x\",\"slice\",\"string_or_numeric\");if(o.rank===0)throw new Error(\"Slicing scalar is not possible\");let n={x:o},s={begin:t,size:e};return T.runKernel(ha,n,s)}var Xe=N({slice_:lH});function mH(r){let e={x:v(r,\"x\",\"tanh\",\"float32\")};return T.runKernel($s,e)}var Il=N({tanh_:mH});function dH(r,t,e,o,n,s){let a=v(r,\"forgetBias\",\"basicLSTMCell\"),i=v(t,\"lstmKernel\",\"basicLSTMCell\"),p=v(e,\"lstmBias\",\"basicLSTMCell\"),u=v(o,\"data\",\"basicLSTMCell\"),c=v(n,\"c\",\"basicLSTMCell\"),l=v(s,\"h\",\"basicLSTMCell\"),m=yt([u,l],1),d=Ze(m,i),f=Ce(d,p),h=f.shape[0],g=f.shape[1]/4,x=[h,g],b=Xe(f,[0,0],x),C=Xe(f,[0,g],x),S=Xe(f,[0,g*2],x),k=Xe(f,[0,g*3],x),_=Ce(se($a(b),Il(C)),se(c,$a(Ce(a,S)))),E=se(Il(_),$a(k));return[_,E]}var Vk=N({basicLSTMCell_:dH});function fH(r,t,e){let o=v(r,\"x\",\"batchToSpaceND\"),n=t.reduce((i,p)=>i*p);$(o.rank>=1+t.length,()=>`input rank is ${o.rank} but should be > than blockShape.length ${t.length}`),$(e.length===t.length,()=>`crops.length is ${e.length} but should be equal to blockShape.length ${t.length}`),$(o.shape[0]%n===0,()=>`input tensor batch is ${o.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(\" * \")} === ${n}`);let s={x:o},a={blockShape:t,crops:e};return T.runKernel(Js,s,a)}var dd=N({batchToSpaceND_:fH});function Wk(r){let t;return r.rank===0||r.rank===1?t=W(r,[1,1,1,r.size]):r.rank===2?t=W(r,[1,1,r.shape[0],r.shape[1]]):r.rank===3?t=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]):t=r,t}function hH(r,t,e,o,n,s){s==null&&(s=.001);let a=v(r,\"x\",\"batchNorm\"),i=v(t,\"mean\",\"batchNorm\"),p=v(e,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let c;o!=null&&(c=v(o,\"offset\",\"batchNorm\")),$(i.rank===p.rank,()=>\"Batch normalization gradient requires mean and variance to have equal ranks.\"),$(c==null||i.rank===c.rank,()=>\"Batch normalization gradient requires mean and offset to have equal ranks.\"),$(u==null||i.rank===u.rank,()=>\"Batch normalization gradient requires mean and scale to have equal ranks.\");let m={x:Wk(a),scale:u,offset:c,mean:i,variance:p},d={varianceEpsilon:s},f=T.runKernel(In,m,d);return W(f,a.shape)}var ru=N({batchNorm_:hH});function gH(r,t,e,o,n,s){let a=v(r,\"x\",\"batchNorm\"),i=v(t,\"mean\",\"batchNorm\"),p=v(e,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let c;return o!=null&&(c=v(o,\"offset\",\"batchNorm\")),$(a.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`),$(i.rank===2||i.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`),$(p.rank===2||p.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),c!=null&&$(c.rank===2||c.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`),ru(a,i,p,c,u,s)}var Uk=N({batchNorm2d_:gH});function xH(r,t,e,o,n,s){let a=v(r,\"x\",\"batchNorm\"),i=v(t,\"mean\",\"batchNorm\"),p=v(e,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let c;return o!=null&&(c=v(o,\"offset\",\"batchNorm\")),$(a.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`),$(i.rank===3||i.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`),$(p.rank===3||p.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),c!=null&&$(c.rank===3||c.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`),ru(a,i,p,c,u,s)}var Gk=N({batchNorm3d_:xH});function yH(r,t,e,o,n,s){let a=v(r,\"x\",\"batchNorm\"),i=v(t,\"mean\",\"batchNorm\"),p=v(e,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let c;return o!=null&&(c=v(o,\"offset\",\"batchNorm\")),$(a.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`),$(i.rank===4||i.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`),$(p.rank===4||p.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),c!=null&&$(c.rank===4||c.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`),ru(a,i,p,c,u,s)}var Hk=N({batchNorm4d_:yH});function bH(r,t,e){let o=v(r,\"x\",\"bincount\"),n=v(t,\"weights\",\"bincount\");$(o.dtype===\"int32\",()=>`Error in bincount: input dtype must be int32, but got ${o.dtype}`),$(e>=0,()=>`size must be non-negative, but got ${e}.`),$(n.size===o.size||n.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${o.shape}, weights shape: ${n.shape}.`);let s={x:o,weights:n},a={size:e};return T.runKernel(Jo,s,a)}var fd=N({bincount_:bH});function CH(r,t){let e=v(r,\"x\",\"bitwiseAnd\"),o=v(t,\"y\",\"bitwiseAnd\");if(!br(e.shape,o.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${e.shape}, y: ${o.shape}`);if(e.dtype!==\"int32\"||o.dtype!==\"int32\")throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${e.dtype} and type of y: ${o.dtype}`);let n={a:e,b:o};return T.runKernel(qa,n)}var Kk=N({bitwiseAnd_:CH});function wH(r,t){let e=v(r,\"s0\",\"broadcastArgs\",\"int32\"),o=v(t,\"s1\",\"broadcastArgs\",\"int32\");if(e.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${e.rank}`);if(o.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${o.rank}`);let n={s0:e,s1:o};return T.runKernel(ea,n)}var qk=N({broadcastArgs_:wH});function SH(r,t){let e=v(r,\"broadcastTo\",\"x\"),o=e.shape;if(Ct(t),t.lengthe.rank){let u=e.shape.slice();for(;u.length=0;u--)if(n[u]===t[u])s[u]=1;else if(e.shape[u]!==1)throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${t}].`);if(s.map((u,c)=>u>1?c:-1).filter(u=>u>=0).length===0)return Wr(e);let i={x:e},p={reps:s};return T.runKernel(uo,i,p)}var ou=N({broadcastTo_:SH});function IH(r){let e={x:v(r,\"x\",\"ceil\",\"float32\")};return T.runKernel(en,e)}var jk=N({ceil_:IH});function Ea(r,t,e){Ct(r),e=e||_i(t);let o={shape:r,value:t,dtype:e};return T.runKernel(sa,{},o)}function vH(r,t,e){let o=v(r,\"x\",\"clipByValue\");if($(t<=e,()=>`Error in clip: min (${t}) must be less than or equal to max (${e}).`),t===e)return Ea(o.shape,t,o.dtype);let n={x:o},s={clipValueMin:t,clipValueMax:e};return T.runKernel(bo,n,s)}var Xk=N({clipByValue_:vH});function kH(r){return yt(r,0)}var Yk=N({concat1d_:kH});function NH(r,t){return yt(r,t)}var Qk=N({concat2d_:NH});function TH(r,t){return yt(r,t)}var Zk=N({concat3d_:TH});function _H(r,t){return yt(r,t)}var Jk=N({concat4d_:_H});function $H(r,t,e,o,n=\"NHWC\",s=[1,1],a){let i=v(r,\"x\",\"conv2d\",\"float32\"),p=v(t,\"filter\",\"conv2d\",\"float32\"),u=i,c=!1;i.rank===3&&(c=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${p.rank}.`),Lt(\"conv2d\",o,a);let l=n===\"NHWC\"?u.shape[3]:u.shape[1];$(l===p.shape[2],()=>`Error in conv2d: depth of input (${l}) must match input depth for filter ${p.shape[2]}.`),$(gr(e,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`),$(Ta(s),()=>\"Error in conv2D: Dilated rates should be larger than 0.\"),$(Ta(e),()=>\"Error in conv2D: Strides should be larger than 0.\");let m={x:u,filter:p},d={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=T.runKernel(tn,m,d);return c?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var nu=N({conv2d_:$H});function EH(r,t,e,o,n=\"NWC\",s=1,a){let i=v(r,\"x\",\"conv1d\"),p=v(t,\"filter\",\"conv1d\"),u=i,c=!1;i.rank===2&&(c=!0,u=W(i,[1,i.shape[0],i.shape[1]])),$(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),$(p.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${p.rank}.`),Lt(\"conv1d\",o,a),$(u.shape[2]===p.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${p.shape[1]}.`),$(gr(e,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${e} and dilation '${s}'`),$(Ta(s),()=>\"Error in conv1D: Dilated rates should be larger than 0.\"),$(Ta(e),()=>\"Error in conv1D: Stride should be larger than 0.\"),$(n===\"NWC\",()=>`Error in conv1d: got dataFormat of ${n} but only NWC is currently supported.`);let l=W(p,[1,p.shape[0],p.shape[1],p.shape[2]]),m=W(u,[u.shape[0],1,u.shape[1],u.shape[2]]),g=nu(m,l,[1,e],o,\"NHWC\",[1,s],a);return c?W(g,[g.shape[2],g.shape[3]]):W(g,[g.shape[0],g.shape[2],g.shape[3]])}var e2=N({conv1d_:EH});function RH(r,t,e,o,n,s=\"NHWC\",a){$(r.length===t.rank,()=>`Length of inShape (${r.length}) and rank of dy (${t.rank}) must match`);let i=r,p=t,u=!1;t.rank===3&&(u=!0,p=W(t,[1,t.shape[0],t.shape[1],t.shape[2]]),i=[1,r[0],r[1],r[2]]),$(i.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${i.length}.`),$(p.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${p.rank}`),$(e.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${e.rank}`);let c=s===\"NHWC\"?i[3]:i[1],l=s===\"NHWC\"?p.shape[3]:p.shape[1];$(c===e.shape[2],()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${e.shape[2]}.`),$(l===e.shape[3],()=>`Error in conv2dDerInput: depth of output (${l}) must match output depth for filter ${e.shape[3]}.`),Lt(\"conv2dDerInput\",n,a);let m={dy:p,filter:e},d={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,inputShape:i},f=T.runKernel(rn,m,d);return u?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var hd=N({conv2DBackpropInput_:RH});function DH(r,t,e,o,n,s){let a=v(r,\"x\",\"conv2dTranspose\"),i=v(t,\"filter\",\"conv2dTranspose\");return hd(e,a,i,o,n,\"NHWC\",s)}var t2=N({conv2dTranspose_:DH});function AH(r,t,e,o,n=\"NDHWC\",s=[1,1,1]){let a=v(r,\"x\",\"conv3d\"),i=v(t,\"filter\",\"conv3d\"),p=a,u=!1;a.rank===4&&(u=!0,p=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(p.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${p.rank}.`),$(i.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`),$(p.shape[4]===i.shape[3],()=>`Error in conv3d: depth of input (${p.shape[4]}) must match input depth for filter ${i.shape[3]}.`),$(gr(e,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`),$(n===\"NDHWC\",()=>`Error in conv3d: got dataFormat of ${n} but only NDHWC is currently supported.`),$(Ta(s),()=>\"Error in conv3D: Dilated rates should be larger than 0.\"),$(Ta(e),()=>\"Error in conv3D: Strides should be larger than 0.\");let c={x:p,filter:i},l={strides:e,pad:o,dataFormat:n,dilations:s},m=T.runKernel(on,c,l);return u?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var r2=N({conv3d_:AH});function FH(r,t,e,o,n){$(r.length===t.rank,()=>`Length of inShape (${r.length}) and rank of dy (${t.rank}) must match`);let s=r,a=t,i=!1;t.rank===4&&(i=!0,a=W(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,r[0],r[1],r[2],r[3]]);let p=s[4],u=a.shape[4];$(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),$(a.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`),$(e.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${e.rank}`),$(p===e.shape[3],()=>`Error in conv3dDerInput: depth of input (${p}) must match input depth for filter ${e.shape[3]}.`),$(u===e.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${e.shape[4]}.`);let c={dy:a,filter:e},l={pad:n,strides:o,inputShape:s},m=T.runKernel(nn,c,l);return i?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var o2=N({conv3DBackpropInput_:FH});function PH(r,t,e,o,n){let s=v(r,\"x\",\"conv3dTranspose\"),a=v(t,\"filter\",\"conv3dTranspose\");return o2(e,s,a,o,n)}var n2=N({conv3dTranspose_:PH});function OH(r){let e={x:v(r,\"x\",\"cos\",\"float32\")};return T.runKernel(sn,e)}var s2=N({cos_:OH});function MH(r){let e={x:v(r,\"x\",\"cosh\",\"float32\")};return T.runKernel(an,e)}var a2=N({cosh_:MH});function LH(r,t=0,e=!1,o=!1){let s={x:v(r,\"x\",\"cumprod\")},a={axis:t,exclusive:e,reverse:o};return T.runKernel(un,s,a)}var i2=N({cumprod_:LH});function BH(r,t=0,e=!1,o=!1){let s={x:v(r,\"x\",\"cumsum\")},a={axis:t,exclusive:e,reverse:o};return T.runKernel(pn,s,a)}var u2=N({cumsum_:BH});function zH(r,t,e,o=!1){let n=v(r,\"x\",\"denseBincount\"),s=v(t,\"weights\",\"denseBincount\");$(n.dtype===\"int32\",()=>`Error in denseBincount: input dtype must be int32, but got ${n.dtype}`),$(n.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${n.rank}.`),$(e>=0,()=>`size must be non-negative, but got ${e}.`),$(s.size===n.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${n.shape}, weights shape: ${s.shape}.`);let a={x:n,weights:s},i={size:e,binaryOutput:o};return T.runKernel(ra,a,i)}var p2=N({denseBincount_:zH});function VH(r,t,e=\"NHWC\"){let o=v(r,\"x\",\"depthToSpace\",\"float32\"),n=e===\"NHWC\"?o.shape[1]:o.shape[2],s=e===\"NHWC\"?o.shape[2]:o.shape[3],a=e===\"NHWC\"?o.shape[3]:o.shape[1];$(t>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`),$(n*t>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${n} and ${t} for depthToSpace with input shape\n ${o.shape}`),$(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${s} and ${t} for depthToSpace with input shape\n ${o.shape}`),$(a%(t*t)===0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${o.shape}`);let i={x:o},p={blockSize:t,dataFormat:e};return T.runKernel(ln,i,p)}var c2=N({depthToSpace_:VH});function WH(r,t,e,o,n=\"NHWC\",s=[1,1],a){let i=v(r,\"x\",\"depthwiseConv2d\",\"float32\"),p=v(t,\"filter\",\"depthwiseConv2d\",\"float32\"),u=i,c=!1;i.rank===3&&(c=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`);let l=n===\"NHWC\"?u.shape[3]:u.shape[1];$(l===p.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${l}) must match the inChannels dimension in filter ${p.shape[2]}.`),Lt(\"depthwiseConv2d\",o,a);let m={x:u,filter:p},d={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=T.runKernel(mn,m,d);return c?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var oc=N({depthwiseConv2d_:WH});function UH(r){let e={x:v(r,\"x\",\"diag\")};return T.runKernel(oa,e)}var l2=N({diag_:UH});function GH(r,t,e,o,n=[1,1],s=\"NHWC\"){let a=v(r,\"x\",\"dilation2d\"),i=v(t,\"filter\",\"dilation2d\");$(a.rank===3||a.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`),$(i.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${i.rank}.`),$(s===\"NHWC\",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let p=a,u=!1;a.rank===3&&(p=W(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0),$(p.shape[3]===i.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${p.shape[3]} vs ${i.shape[2]}`);let c={x:p,filter:i},l={strides:e,pad:o,dilations:n},m=T.runKernel(dn,c,l);return u?W(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var m2=N({dilation2d_:GH});var Sr={};qe(Sr,{assertAndGetBroadcastShape:()=>rt,getBroadcastDims:()=>d2,getReductionAxes:()=>gd});function d2(r,t){let e=r.length,o=[];for(let n=0;n1&&a===1&&o.unshift(s)}return o}function gd(r,t){let e=[];for(let o=0;o1)&&e.unshift(s)}return e}function rt(r,t){let e=Math.max(r.length,t.length),o=new Array(e);for(let n=0;n`Error in dot: inputs must all be rank 1 or 2, but got ranks ${e.rank} and ${o.rank}.`);let n=e.rank===1?e.size:e.shape[1],s=o.rank===1?o.size:o.shape[0];if($(n===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${n} and ${s}.`),e.rank===1&&o.rank===1){let a=W(e,[1,-1]),i=W(o,[-1,1]),p=Ze(a,i);return W(p,[])}else if(e.rank===1&&o.rank===2){let a=W(e,[1,-1]),i=W(o,[o.shape[0],o.shape[1]]),p=Ze(a,i);return W(p,[p.size])}else if(e.rank===2&&o.rank===1){let a=W(o,[-1,1]),i=Ze(e,a);return W(i,[i.size])}else{let a=W(o,[o.shape[0],o.shape[1]]);return Ze(e,a)}}var h2=N({dot_:XH});function YH(r,...t){let e=t.map((n,s)=>v(n,`tensors${s}`,\"einsum\")),o={equation:r};return T.runKernel(Li,e,o)}var su=N({einsum_:YH});function QH(r){let e={x:v(r,\"x\",\"elu\",\"float32\")};return T.runKernel(hn,e)}var yd=N({elu_:QH});function ZH(r,t){let e=v(r,\"x\",\"ensureShape\",\"string_or_numeric\");if(!QC(e.shape,t))throw new Error(`EnsureShape: Shape of tensor ${e.shape} is not compatible with expected shape ${t}`);return r}var g2=N({ensureShape_:ZH});function JH(r){let t=v(r,\"x\",\"erf\");$(t.dtype===\"int32\"||t.dtype===\"float32\",()=>\"Input dtype must be `int32` or `float32`.\"),t.dtype===\"int32\"&&(t=We(t,\"float32\"));let e={x:t};return T.runKernel(gn,e)}var x2=N({erf_:JH});function Bw(r,t){for(let e=0;er[s]);return[e,n]}function ai(r,t){let e=t.map(o=>1);return y2(r,e,t)}function tK(r,t,e){$(Bw(t,e),()=>`${r} supports only inner-most axes for now. Got axes ${t} and rank-${e} input.`)}function rK(r,t){if(Bw(r,t))return null;let e=[];for(let o=0;oe.push(o)),e}function oK(r){return r.map((t,e)=>[e,t]).sort((t,e)=>t[1]-e[1]).map(t=>t[0])}function nK(r,t){let e=[];for(let o=t-r;o\"Axis must be <= rank of the tensor\");let o={input:e},n={dim:t};return T.runKernel(na,o,n)}var Ms=N({expandDims_:hK});function gK(r){let e={x:v(r,\"x\",\"expm1\")};return T.runKernel(bn,e)}var w2=N({expm1_:gK});function xK(r,t){let e=v(r,\"x\",\"tile\",\"string_or_numeric\");$(e.rank===t.length,()=>`Error in transpose: rank of input ${e.rank} must match length of reps ${t}.`);let o={x:e},n={reps:t};return T.runKernel(uo,o,n)}var au=N({tile_:xK});function yK(r,t,e,o=\"float32\"){t==null&&(t=r);let n=me([r,t],o),s=r<=t?r:t;for(let i=0;i`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${s.rank}.`),$(Ka(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let a=s,i=!1;s.rank===3&&(i=!0,a=W(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let p={x:a},u={depthRadius:t,bias:e,alpha:o,beta:n},c=T.runKernel(Bn,p,u);return i?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var N2=N({localResponseNormalization_:EK});function RK(r){let e={x:v(r,\"x\",\"log\",\"float32\")};return T.runKernel(Fn,e)}var ui=N({log_:RK});function DK(r){let e={x:v(r,\"x\",\"log1p\")};return T.runKernel(Pn,e)}var vd=N({log1p_:DK});function AK(r){return $(qs(r),()=>\"The f passed in grad(f) must be a function\"),(t,e)=>{let o=v(t,\"x\",\"tf.grad\",\"string_or_numeric\"),n=e!=null?v(e,\"dy\",\"tf.grad\"):null;return T.tidy(()=>{let{value:s,grads:a}=T.gradients(()=>r(o),[o],n);return n!=null&&xt(s.shape,n.shape,\"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)\"),kd(a),a[0]})}}function FK(r){return $(qs(r),()=>\"The f passed in grads(f) must be a function\"),(t,e)=>{$(Array.isArray(t),()=>\"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s\");let o=ni(t,\"args\",\"tf.grads\",\"string_or_numeric\"),n=e!=null?v(e,\"dy\",\"tf.grads\"):null;return T.tidy(()=>{let{value:s,grads:a}=T.gradients(()=>r(...o),o,n);return n!=null&&xt(s.shape,n.shape,\"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),kd(a),a})}}function PK(r){return $(qs(r),()=>\"The f passed in valueAndGrad(f) must be a function\"),(t,e)=>{$(t instanceof mt,()=>\"The x passed in valueAndGrad(f)(x) must be a tensor\"),$(e==null||e instanceof mt,()=>\"The dy passed in valueAndGrad(f)(x, dy) must be a tensor\");let{grads:o,value:n}=T.gradients(()=>r(t),[t],e);return kd(o),{grad:o[0],value:n}}}function OK(r){return $(qs(r),()=>\"The f passed in valueAndGrads(f) must be a function\"),(t,e)=>{$(Array.isArray(t)&&t.every(n=>n instanceof mt),()=>\"The args passed in valueAndGrads(f)(args) must be array of tensors\"),$(e==null||e instanceof mt,()=>\"The dy passed in valueAndGrads(f)(args, dy) must be a tensor\");let o=T.gradients(()=>r(...t),t,e);return e!=null&&xt(o.value.shape,e.shape,\"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),kd(o.grads),o}}function zw(r,t){$(qs(r),()=>\"The f passed in variableGrads(f) must be a function\"),$(t==null||Array.isArray(t)&&t.every(u=>u instanceof ri),()=>\"The varList passed in variableGrads(f, varList) must be an array of variables\");let e=t!=null;if(!e){t=[];for(let u in T.registeredVariables)t.push(T.registeredVariables[u])}let o=e?t.filter(u=>!u.trainable):null,n=t.length;t=t.filter(u=>u.trainable),$(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${n} variables is trainable.`);let s=!0,{value:a,grads:i}=T.gradients(r,t,null,s);$(i.some(u=>u!=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().\"),$(a.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`);let p={};return t.forEach((u,c)=>{i[c]!=null&&(p[u.name]=i[c])}),o!=null&&o.forEach(u=>p[u.name]=null),{value:a,grads:p}}function Ir(r){return T.customGrad(r)}function kd(r){if(r.filter(e=>e==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`)}function MK(r){let e={x:v(r,\"x\",\"neg\")};return T.runKernel(pa,e)}var pr=N({neg_:MK});function LK(r){let e={x:v(r,\"x\",\"softplus\")};return T.runKernel(Cs,e)}var Nd=N({softplus_:LK});function BK(r){let t=v(r,\"x\",\"logSigmoid\");return Ir(o=>({value:pr(Nd(pr(o))),gradFunc:a=>se(a,$a(pr(o)))}))(t)}var T2=N({logSigmoid_:BK});function zK(r,t){let e=v(r,\"a\",\"sub\"),o=v(t,\"b\",\"sub\");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Ts,n)}var Te=N({sub_:zK});function VK(r,t=-1){let e=v(r,\"logits\",\"logSoftmax\");if(t===-1&&(t=e.rank-1),t!==e.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${e.rank} and axis was ${t}`);return Ir((n,s)=>{let i=Ra(n,t,!0),p=Te(n,i),u=Te(We(p,\"float32\"),ui(ot(_o(p),t,!0)));return s([u]),{value:u,gradFunc:(l,m)=>{let[d]=m,f=!0,h=_o(d);return Te(l,se(ot(l,t,f),h))}}})(e)}var _2=N({logSoftmax_:VK});function WK(r,t=null,e=!1){let o=v(r,\"x\",\"logSumExp\"),n=Ti(t,o.shape),s=Ra(o,n,!0),a=Te(o,s),i=_o(a),p=ot(i,n),u=ui(p),c=Ce(W(s,u.shape),u);if(e){let l=ai(c.shape,n);return W(c,l)}return c}var Td=N({logSumExp_:WK});function UK(r,t){let e=v(r,\"a\",\"logicalAnd\",\"bool\"),o=v(t,\"b\",\"logicalAnd\",\"bool\");rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(On,n)}var Vu=N({logicalAnd_:UK});function GK(r){let e={x:v(r,\"x\",\"logicalNot\",\"bool\")};return T.runKernel(Mn,e)}var _d=N({logicalNot_:GK});function HK(r,t){let e=v(r,\"a\",\"logicalOr\",\"bool\"),o=v(t,\"b\",\"logicalOr\",\"bool\");rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Ln,n)}var $d=N({logicalOr_:HK});function KK(r,t){let e=v(r,\"a\",\"logicalXor\",\"bool\"),o=v(t,\"b\",\"logicalXor\",\"bool\");return rt(e.shape,o.shape),Vu($d(r,t),_d(Vu(r,t)))}var $2=N({logicalXor_:KK});var Ed=2147483648;function qK(r,t,e=\"left\"){let o=v(r,\"sortedSequence\",\"searchSorted\"),n=v(t,\"values\",\"searchSorted\"),s=o.shape[o.shape.length-1],a=n.shape[n.shape.length-1],i=W(o,[-1,s]),p=W(n,[-1,a]);if(i.rank<2)throw new Error(\"Sorted input argument must be at least 2-dimensional\");if(i.shape[0]!==p.shape[0])throw new Error(\"Leading dimension of 'sortedSequence' and 'values' must match.\");if(He(p.shape)>=Ed)throw new Error(`values tensor size must less than ${Ed}`);if(i.shape[1]>=Ed)throw new Error(`trailing dim_size must less than ${Ed} for int32 output type, was ${i.shape[1]}`);let u={sortedSequence:i,values:p},c={side:e};return T.runKernel(fs,u,c)}var Nl=N({searchSorted_:qK});function E2(r,t){return Nl(r,t,\"left\")}function jK(r,t,e,o,n){let s=v(r,\"x\",\"maxPool\"),a=1,i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${i.rank}.`),$(gr(e,a),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${e} and dilations '${a}'`),Lt(\"maxPool\",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n},l=T.runKernel(Wn,u,c);return p?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var Rd=N({maxPool_:jK});function XK(r,t=[1,1,1],e,o,n,s=\"NDHWC\"){let a=v(r,\"x\",\"maxPool3d\"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s===\"NDHWC\",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),Lt(\"maxPool3d\",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n,dataFormat:s},l=T.runKernel(ia,u,c);return p?W(l,[l.shape[1],l.shape[2],l.shape[3],l.shape[4]]):l}var R2=N({maxPool3d_:XK});function YK(r,t,e,o,n=!1){let a={x:v(r,\"x\",\"maxPoolWithArgmax\")},i={filterSize:t,strides:e,pad:o,includeBatchInIndex:n},p=T.runKernel(ua,a,i);return{result:p[0],indexes:p[1]}}var D2=N({maxPoolWithArgmax_:YK});function QK(r,t){let e=v(r,\"a\",\"maximum\"),o=v(t,\"b\",\"maximum\");[e,o]=Oe(e,o),e.dtype===\"bool\"&&(e=We(e,\"int32\"),o=We(o,\"int32\")),rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Vn,n)}var Dd=N({maximum_:QK});function ZK(r,t=null,e=!1){let n={x:v(r,\"x\",\"mean\")},s={axis:t,keepDims:e};return T.runKernel(Un,n,s)}var Wu=N({mean_:ZK});function Ur(r,t=\"float32\"){if(Ct(r),t===\"complex64\"){let o=Ur(r,\"float32\"),n=Ur(r,\"float32\");return $r(o,n)}let e=Wp(He(r),t);return T.makeTensor(e,r,t)}function Da(r,t=\"float32\"){if(Ct(r),t===\"complex64\"){let o=Da(r,\"float32\"),n=Ur(r,\"float32\");return $r(o,n)}let e=cl(He(r),t);return T.makeTensor(e,r,t)}function A2(r,t,{indexing:e=\"xy\"}={}){if(e!==\"xy\"&&e!==\"ij\")throw new TypeError(`${e} is not a valid third argument to meshgrid`);if(r===void 0)return[];let o=v(r,\"x\",\"meshgrid\",r instanceof mt?r.dtype:\"float32\");if(t===void 0)return[o];let n=v(t,\"y\",\"meshgrid\",t instanceof mt?t.dtype:\"float32\"),s=He(o.shape),a=He(n.shape);return e===\"xy\"?(o=W(o,[1,-1]),n=W(n,[-1,1]),[Ze(Da([a,1],o.dtype),o),Ze(n,Da([1,s],n.dtype))]):(o=W(o,[-1,1]),n=W(n,[1,-1]),[Ze(o,Da([1,a],o.dtype)),Ze(Da([s,1],n.dtype),n)])}function JK(r,t){let e=v(r,\"a\",\"minimum\"),o=v(t,\"b\",\"minimum\");[e,o]=Oe(e,o),e.dtype===\"bool\"&&(e=We(e,\"int32\"),o=We(o,\"int32\")),rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Hn,n)}var Uu=N({minimum_:JK});function eq(r,t,e){$(e===\"reflect\"||e===\"symmetric\",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${e}.`);let o=v(r,\"x\",\"mirrorPad\");if(o.rank===0)throw new Error(\"mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad\");$(t.length===o.rank,()=>`Padding doesn't match input. Must be ${o.rank}. Got ${t.length}.`);let n=e===\"reflect\"?1:0;for(let i=0;i\"Invalid number of paddings. Must be length of 2 each.\"),$(t[i][0]>=0&&t[i][0]<=o.shape[i]-n&&t[i][1]>=0&&t[i][1]<=o.shape[i]-n,()=>`Padding in dimension ${i} cannot be greater than or equal to ${o.shape[i]-n} or less than 0 for input of shape ${o.shape}`);let s={paddings:t,mode:e},a={x:o};return T.runKernel(Kn,a,s)}var F2=N({mirrorPad_:eq});function tq(r,t){let e=v(r,\"a\",\"mod\"),o=v(t,\"b\",\"mod\");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(qn,n)}var P2=N({mod_:tq});function rq(r,t=null,e=!1){r=v(r,\"x\",\"moments\");let o=Ti(t,r.shape),n=Wu(r,o,e),s=n.shape;e||(s=ai(n.shape,o));let a=Zt(Te(We(r,\"float32\"),W(n,s))),i=Wu(a,o,e);return{mean:n,variance:i}}var O2=N({moments_:rq});function oq(r,t,e,o){let n=v(t,\"data\",\"multiRNNCell\"),s=ni(e,\"c\",\"multiRNNCell\"),a=ni(o,\"h\",\"multiRNNCell\"),i=n,p=[];for(let l=0;l2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);e=e||Math.random();let p={logits:a===1?W(n,[1,-1]):n},u={numSamples:t,seed:e,normalized:o},c=T.runKernel(jn,p,u);return a===1?W(c,[c.size]):c}var L2=N({multinomial_:nq});function sq(r,t){let e=v(r,\"a\",\"notEqual\",\"string_or_numeric\"),o=v(t,\"b\",\"notEqual\",\"string_or_numeric\");[e,o]=Oe(e,o),rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Yn,n)}var Ad=N({notEqual_:sq});function aq(r,t,e=1,o=0,n=\"int32\"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let a={indices:v(r,\"indices\",\"oneHot\",\"int32\")},i={dtype:n,depth:t,onValue:e,offValue:o};return T.runKernel(Jn,a,i)}var Tl=N({oneHot_:aq});function iq(r){let e={x:v(r,\"x\",\"onesLike\")};return T.runKernel(ca,e)}var B2=N({onesLike_:iq});function uq(r,t){let e=v(r,\"v1\",\"outerProduct\"),o=v(t,\"v2\",\"outerProduct\");$(e.rank===1&&o.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${e.rank} and ${o.rank}.`);let n=W(e,[-1,1]),s=W(o,[1,-1]);return Ze(n,s)}var z2=N({outerProduct_:uq});function pq(r,t,e=0){let o=v(r,\"x\",\"pad\");if(o.rank===0)throw new Error(\"pad(scalar) is not defined. Pass non-scalar to pad\");let n={paddings:t,constantValue:e},s={x:o};return T.runKernel(es,s,n)}var Aa=N({pad_:pq});function cq(r,t,e=0){return $(t.length===2,()=>\"Invalid number of paddings. Must be length of 2.\"),Aa(r,[t],e)}var V2=N({pad1d_:cq});function lq(r,t,e=0){return $(t.length===2&&t[0].length===2&&t[1].length===2,()=>\"Invalid number of paddings. Must be length of 2 each.\"),Aa(r,t,e)}var W2=N({pad2d_:lq});function mq(r,t,e=0){return $(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.\"),Aa(r,t,e)}var U2=N({pad3d_:mq});function dq(r,t,e=0){return $(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.\"),Aa(r,t,e)}var G2=N({pad4d_:dq});function fq(r,t,e){let o=v(r,\"x\",\"spaceToBatchND\");$(o.rank>=1+t.length,()=>`input rank ${o.rank} should be > than [blockShape] ${t.length}`),$(e.length===t.length,()=>`paddings.shape[0] ${e.length} must be equal to [blockShape] ${t.length}`),$(o.shape.reduce((a,i,p)=>p>0&&p<=t.length?a&&(i+e[p-1][0]+e[p-1][1])%t[p-1]===0:a,!0),()=>`input spatial dimensions ${o.shape.slice(1)} with paddings ${e.toString()} must be divisible by blockShapes ${t.toString()}`);let n={x:o},s={blockShape:t,paddings:e};return T.runKernel(ga,n,s)}var Fd=N({spaceToBatchND_:fq});function hq(r,t,e,o,n,s,a){n==null&&(n=[1,1]),s==null&&(s=1),o===0&&(o=\"valid\");let i=v(r,\"x\",\"maxPool\"),p=i,u=!1;i.rank===3&&(u=!0,p=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(gr(s,n),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${n}'`);let c=Mw(p.shape,t,s,n,o),l=[c.dilationHeight,c.dilationWidth],m;o===\"same\"?m=xq([c.filterHeight,c.filterWidth],l):m=[[0,0],[0,0]];let d=l[0]===1&&l[1]===1,[f,h]=gq([c.inHeight,c.inWidth],l,m),g=d?o:\"valid\",x=d?p:Fd(p,l,f),C=(e===\"avg\"?()=>md(x,t,s,g,a):()=>Rd(x,t,s,g,a))(),S=d?C:dd(C,l,h);return u?W(S,[S.shape[1],S.shape[2],S.shape[3]]):S}function gq(r,t,e){let o=e.map(c=>c[0]),n=e.map(c=>c[1]),s=r.concat(o,n),a=t.map((c,l)=>(c-s[l]%c)%c),i=n.map((c,l)=>c+a[l]),p=t.map((c,l)=>[o[l],i[l]]),u=t.map((c,l)=>[0,a[l]]);return[p,u]}function xq(r,t){let o=r.map((a,i)=>a+(a-1)*(t[i]-1)).map(a=>a-1),n=o.map(a=>Math.floor(a/2)),s=o.map((a,i)=>a-n[i]);return o.map((a,i)=>[n[i],s[i]])}var H2=N({pool_:hq});function yq(r,t){let e=v(r,\"x\",\"prelu\"),o=v(t,\"alpha\",\"prelu\"),n={x:e,alpha:o};return T.runKernel(rs,n)}var Pd=N({prelu_:yq});function bq(r,t=null,e=!1){let o=v(r,\"x\",\"prod\");o.dtype===\"bool\"&&(o=We(o,\"int32\"));let n={x:o},s={axis:t,keepDims:e};return T.runKernel(os,n,s)}var K2=N({prod_:bq});function Cq(r,t,e,o){let n=r.map((c,l)=>v(c,`tensors${l}`,\"raggedGather\",\"int32\")),s=v(t,\"paramsDenseValues\",\"raggedGather\"),a=v(e,\"indices\",\"raggedGather\",\"int32\"),i={paramsNestedSplits:n,paramsDenseValues:s,indices:a},p={outputRaggedRank:o},u=T.runKernel(Up,i,p);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}var q2=N({raggedGather_:Cq});function wq(r,t,e){let o=v(r,\"starts\",\"raggedRange\"),n=v(t,\"limits\",\"raggedRange\",o.dtype),s=v(e,\"deltas\",\"raggedRange\",o.dtype),a={starts:o,limits:n,deltas:s},i=T.runKernel(Gp,a);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}var j2=N({raggedRange_:wq});function Sq(r,t,e,o,n){let s=v(r,\"shape\",\"raggedTensorToTensor\",\"int32\"),a=v(t,\"values\",\"raggedTensorToTensor\"),i=v(e,\"defaultValue\",\"raggedTensorToTensor\",a.dtype),p=o.map((l,m)=>v(l,`tensors${m}`,\"raggedTensorToTensor\",\"int32\")),u={shape:s,values:a,defaultValue:i,rowPartitionTensors:p},c={rowPartitionTypes:n};return T.runKernel(Hp,u,c)}var X2=N({raggedTensorToTensor_:Sq});function Iq(r,t,e){Ct(r);let o=He(r),n=null;if(e==null||e===\"float32\")n=new Float32Array(o);else if(e===\"int32\")n=new Int32Array(o);else if(e===\"bool\")n=new Uint8Array(o);else throw new Error(`Unknown data type ${e}`);for(let s=0;sd1,createVideoElement:()=>Oq,encodeStrings:()=>h1,expectArrayBuffersEqual:()=>Pq,expectArraysClose:()=>Rq,expectArraysEqual:()=>Aq,expectNumbersClose:()=>f1,expectPromiseToFail:()=>Dq,expectValuesInRange:()=>Fq,play:()=>Mq,testEpsilon:()=>Md});var Eq=.001,d1=.1;function Rq(r,t,e){return e==null&&(e=Md()),jw(r,t,(o,n)=>Xw(o,n,e))}function Md(){return T.backend.floatPrecision()===32?Eq:d1}function jw(r,t,e){let o=!0;if((Pt(r)||Pt(t))&&(o=!1),Pt(r)&&Pt(t)&&(o=!0),o){let a=r.constructor.name,i=t.constructor.name;if(a!==i)throw new Error(`Arrays are of different type. Actual: ${a}. Expected: ${i}`)}if(Array.isArray(r)&&Array.isArray(t)){let a=sr(r),i=sr(t);if(!br(a,i))throw new Error(`Arrays have different shapes. Actual: [${a}]. Expected: [${i}]`)}let n=Pt(r)?r:Fs(r),s=Pt(t)?t:Fs(t);if(n.length!==s.length)throw new Error(`Arrays have different lengths actual: ${n.length} vs expected: ${s.length}.\nActual: ${n}.\nExpected: ${s}.`);for(let a=0;at.fail(),()=>t()),typeof expect!=\"undefined\"&&expect().nothing()}function Aq(r,t){let e=typeof t==\"string\"||typeof t==\"number\"||typeof t==\"boolean\"?[t]:t;return zo(r)||zo(r[0])||zo(t)||zo(t[0])?jw(r,e,(o,n)=>o==n):jw(r,t,(o,n)=>Xw(o,n,0))}function f1(r,t,e){if(e==null&&(e=Md()),!Xw(r,t,e))throw new Error(`Numbers differ: actual === ${r}, expected === ${t}`);typeof expect!=\"undefined\"&&expect().nothing()}function Xw(r,t,e){return!isFinite(r)&&!isFinite(t)?!0:!(isNaN(r)||isNaN(t)||Math.abs(r-t)>e)}function Fq(r,t,e){for(let o=0;oe)throw new Error(`Value out of range:${r[o]} low: ${t}, high: ${e}`)}function Pq(r,t){let e=new Float32Array(r),o=new Float32Array(t);if(e.length!==o.length)throw new Error(`Expected ArrayBuffer to be of length ${o.length}, but it was ${e.length}`);for(let n=0;n{t.addEventListener(\"loadeddata\",o=>e(t)),t.load()})}async function Mq(r){await r.play(),\"requestVideoFrameCallback\"in r&&await new Promise(t=>{r.requestVideoFrameCallback(t)})}var Hu=class{constructor(t,e,o,n,s){this.mean=t,this.stdDev=e,this.dtype=o,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);let a=s||Math.random();this.random=zd.alea(a.toString())}nextValue(){if(!isNaN(this.nextVal)){let n=this.nextVal;return this.nextVal=NaN,n}let t,e,o=!1;for(;!o;){let n,s,a;do n=2*this.random()-1,s=2*this.random()-1,a=n*n+s*s;while(a>=1||a===0);let i=Math.sqrt(-2*Math.log(a)/a);t=this.mean+this.stdDev*n*i,e=this.mean+this.stdDev*s*i,(!this.truncated||this.isValidTruncated(t))&&(o=!0)}return(!this.truncated||this.isValidTruncated(e))&&(this.nextVal=this.convertValue(e)),this.convertValue(t)}convertValue(t){return this.dtype==null||this.dtype===\"float32\"?t:Math.round(t)}isValidTruncated(t){return t<=this.upper&&t>=this.lower}},Ld=class{constructor(t,e,o,n){this.alpha=t,this.beta=1/e,this.dtype=o;let s=n||Math.random();this.randu=zd.alea(s.toString()),this.randn=new Hu(0,1,o,!1,this.randu()),t<1?this.d=t+2/3:this.d=t-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let t,e,o,n,s,a;for(;;){do n=this.randn.nextValue(),a=1+this.c*n;while(a<=0);if(a*=a*a,t=n*n,e=1-.331*t*t,o=.5*t+this.d*(1-a+Math.log(a)),s=this.randu(),sthis.dtype==null||this.dtype===\"float32\",this.min=t,this.range=e-t,this.dtype=o,n==null&&(n=Math.random()),typeof n==\"number\"&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${t} - ${e} <= 1 and dtype is not float`);this.random=zd.alea(n)}convertValue(t){return this.canReturnFloat()?t:Math.round(t)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function Lq(r,t,e=1,o=\"float32\",n){if(Ct(r),e==null&&(e=1),o==null&&(o=\"float32\"),o!==\"float32\"&&o!==\"int32\")throw new Error(`Unsupported data type ${o}`);let s=new Ld(t,e,o,n),a=me(r,o);for(let i=0;i`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),lo(t,0)}var w1=N({reverse1d_:jq});function Xq(r,t){let e=v(r,\"x\",\"reverse\");return $(e.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${e.rank}.`),lo(e,t)}var S1=N({reverse2d_:Xq});function Yq(r,t){let e=v(r,\"x\",\"reverse\");return $(e.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${e.rank}.`),lo(e,t)}var I1=N({reverse3d_:Yq});function Qq(r,t){let e=v(r,\"x\",\"reverse\");return $(e.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${e.rank}.`),lo(e,t)}var v1=N({reverse4d_:Qq});function Zq(r){let e={x:v(r,\"x\",\"round\")};return T.runKernel(cs,e)}var Ud=N({round_:Zq});function Jq(r){let e={x:v(r,\"x\",\"rsqrt\",\"float32\")};return T.runKernel(ls,e)}var k1=N({rsqrt_:Jq});function e6(r){let e={x:v(r,\"x\",\"selu\")};return T.runKernel(hs,e)}var N1=N({selu_:e6});function t6(r,t,e,o,n,s=[1,1],a=\"NHWC\"){let i=v(r,\"x\",\"separableConv2d\"),p=v(t,\"depthwiseFilter\",\"separableConv2d\"),u=v(e,\"pointwiseFilter\",\"separableConv2d\"),c=i,l=!1;if(i.rank===3&&(l=!0,c=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),a===\"NCHW\")throw new Error(\"separableConv2d currently does not support dataFormat NCHW; only NHWC is supported\");$(c.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`),$(p.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${p.rank}.`),$(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${p.rank}.`),$(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),$(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);let m=p.shape[2],d=p.shape[3];$(u.shape[2]===m*d,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${m*d}, but got ${u.shape[2]}.`);let f=oc(c,p,o,n,a,s),g=nu(f,u,1,\"valid\",a);return l?W(g,[g.shape[1],g.shape[2],g.shape[3]]):g}var T1=N({separableConv2d_:t6});async function r6(r,t){let e=v(r,\"x\",\"setdiff1d\"),o=v(t,\"y\",\"setdiff1d\");$(e.dtype===o.dtype,()=>`x and y should have the same dtype, but got x (${e.dtype}) and y (${o.dtype}).`),$(e.rank===1,()=>`x should be 1D tensor, but got x (${e.shape}).`),$(o.rank===1,()=>`y should be 1D tensor, but got y (${o.shape}).`);let n=await e.data(),s=await o.data(),a=new Set(s),i=0;for(let c=0;c`slice1d expects a rank-1 tensor, but got a rank-${o.rank} tensor`),Xe(o,[t],[e])}var D1=N({slice1d_:a6});function i6(r,t,e){let o=v(r,\"x\",\"slice2d\");return $(o.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${o.rank} tensor`),Xe(o,t,e)}var A1=N({slice2d_:i6});function u6(r,t,e){let o=v(r,\"x\",\"slice3d\");return $(o.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${o.rank} tensor`),Xe(o,t,e)}var F1=N({slice3d_:u6});function p6(r,t,e){let o=v(r,\"x\",\"slice4d\");return $(o.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${o.rank} tensor`),Xe(o,t,e)}var P1=N({slice4d_:p6});function c6(r,t=-1){let e=v(r,\"logits\",\"softmax\",\"float32\");if(t===-1&&(t=e.rank-1),t!==e.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${e.rank} and dim was ${t}`);let o={logits:e},n={dim:t};return T.runKernel(Is,o,n)}var O1=N({softmax_:c6});function l6(r){$(r.dtype===\"complex64\",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${r.dtype}.`);let t={input:r};return T.runKernel(Bi,t)}var ac=N({fft_:l6});function m6(r){$(r.dtype===\"complex64\",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${r.dtype}.`);let t={input:r};return T.runKernel(zi,t)}var Ku=N({ifft_:m6});function d6(r){let t=r.shape[r.shape.length-1],e=r.size/t,o;if(t<=2){let n=W(r,[e,t]);o=Ku(n)}else{let n=[e,2*(t-1)],s=W(pi(r),[e,t]),a=W(iu(r),[e,t]),i=lo(Xe(s,[0,1],[e,t-2]),1),p=se(lo(Xe(a,[0,1],[e,t-2]),1),ke(-1)),u=yt([s,i],1),c=yt([a,p],1),l=W($r(u,c),[n[0],n[1]]);o=Ku(l)}if(o=pi(o),r.rank===3&&r.shape[0]!==0){let n=o,s=r.shape[0];o=W(o,[s,o.shape[0]/s,o.shape[1]]),n.dispose()}return o}var Gd=N({irfft_:d6});function f6(r,t,e=0){let n={x:v(r,\"x\",\"split\")},s={numOrSizeSplits:t,axis:e};return T.runKernel(xa,n,s)}var ci=N({split_:f6});function h6(r,t){$(r.dtype===\"float32\",()=>`The dtype for rfft() must be real value but got ${r.dtype}`);let e=r.shape[r.shape.length-1],o=r.size/e,n;if(t!=null&&t0),h=r.shape.map(g=>g);h[r.shape.length-1]=t,n=Xe(r,f,h),e=t}else if(t!=null&&t>e){let f=r.shape.map(h=>h);f[r.shape.length-1]=t-e,n=yt([r,Ur(f)],r.shape.length-1),e=t}else n=r;let s=Gt(n),a=W($r(n,s),[o,e]),i=ac(a),p=Math.floor(e/2)+1,u=pi(i),c=iu(i),l=ci(u,[p,e-p],u.shape.length-1),m=ci(c,[p,e-p],c.shape.length-1),d=n.shape.slice();return d[n.shape.length-1]=p,W($r(l[0],m[0]),d)}var ic=N({rfft_:h6});function g6(r,t){let e=v(r,\"a\",\"squaredDifference\"),o=v(t,\"b\",\"squaredDifference\");[e,o]=Oe(e,o),rt(e.shape,o.shape);let n={a:e,b:o},s={};return T.runKernel(ks,n,s)}var Hd=N({squaredDifference_:g6});function x6(r,t){let e=v(r,\"x\",\"squeeze\",\"string_or_numeric\");return W(e,ZC(e.shape,t).newShape)}var uc=N({squeeze_:x6});function y6(r,t=0){let e=ni(r,\"tensors\",\"stack\",\"string_or_numeric\");$(e.length>=1,()=>\"Pass at least one tensor to tf.stack\"),e.length>0&&$(t<=e[0].rank,()=>\"Axis must be <= rank of the tensor\");let o=e,n={axis:t};return T.runKernel(la,o,n)}var vr=N({stack_:y6});function b6(r,t=0){let o={x:v(r,\"x\",\"step\")},n={alpha:t};return T.runKernel(wo,o,n)}var Kd=N({step_:b6});function C6(r,t,e,o,n=0,s=0,a=0,i=0,p=0){let c={x:v(r,\"x\",\"stridedSlice\",\"string_or_numeric\")},l={begin:t,end:e,strides:o,beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};return T.runKernel(Ns,c,l)}var M1=N({stridedSlice_:C6});function w6(r){let e={x:v(r,\"x\",\"tan\",\"float32\")};return T.runKernel(_s,e)}var L1=N({tan_:w6});function Jt(r,t){ao(r);let e=sr(r,t);if(e.length!==1)throw new Error(\"tensor1d() requires values to be a flat/TypedArray\");return wr(r,null,e,t)}function cu(r,t,e){if(ao(r),t!=null&&t.length!==2)throw new Error(\"tensor2d() requires shape to have two numbers\");let o=sr(r,e);if(o.length!==2&&o.length!==1)throw new Error(\"tensor2d() requires values to be number[][] or flat/TypedArray\");if(o.length===1&&t==null)throw new Error(\"tensor2d() requires shape to be provided when `values` are a flat/TypedArray\");return wr(r,t,o,e)}function qd(r,t,e){if(ao(r),t!=null&&t.length!==3)throw new Error(\"tensor3d() requires shape to have three numbers\");let o=sr(r,e);if(o.length!==3&&o.length!==1)throw new Error(\"tensor3d() requires values to be number[][][] or flat/TypedArray\");if(o.length===1&&t==null)throw new Error(\"tensor3d() requires shape to be provided when `values` are a flat array\");return wr(r,t,o,e)}function B1(r,t,e){if(ao(r),t!=null&&t.length!==4)throw new Error(\"tensor4d() requires shape to have four numbers\");let o=sr(r,e);if(o.length!==4&&o.length!==1)throw new Error(\"tensor4d() requires values to be number[][][][] or flat/TypedArray\");if(o.length===1&&t==null)throw new Error(\"tensor4d() requires shape to be provided when `values` are a flat array\");return wr(r,t,o,e)}function z1(r,t,e){if(ao(r),t!=null&&t.length!==5)throw new Error(\"tensor5d() requires shape to have five numbers\");let o=sr(r,e);if(o.length!==5&&o.length!==1)throw new Error(\"tensor5d() requires values to be number[][][][][] or flat/TypedArray\");if(o.length===1&&t==null)throw new Error(\"tensor5d() requires shape to be provided when `values` are a flat array\");return wr(r,t,o,e)}function V1(r,t,e){if(ao(r),t!=null&&t.length!==6)throw new Error(\"tensor6d() requires shape to have six numbers\");let o=sr(r,e);if(o.length!==6&&o.length!==1)throw new Error(\"tensor6d() requires values to be number[][][][][][] or flat/TypedArray\");if(o.length===1&&t==null)throw new Error(\"tensor6d() requires shape to be provided when `values` are a flat array\");return t=t||o,wr(r,t,o,e)}var lu={};qe(lu,{calculateShapes:()=>W1,validateInput:()=>pc,validateUpdateShape:()=>Yw});function Yw(r,t,e){let o=t.rank>1?t.shape[t.rank-1]:1,n=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${e.shape}, indices.shape: ${t.shape}, shape: ${r}, sliceDim: ${o}, and batchDim: ${n}.`;if(e.rank1?t.shape[o-1]:1,s=e.length,a=1;for(let l=n;l= 0 but got ${t}`);if(t>n)throw new Error(`'k' passed to topk() must be <= the last dimension (${n}) but got ${t}`);let s={x:o},a={k:t,sorted:e},[i,p]=T.runKernel(Es,s,a);return{values:i,indices:p}}var G1=N({topk_:I6});function v6(r,t=0,e=1,o,n){if(Ct(r),o!=null&&o===\"bool\")throw new Error(\"Unsupported data type $ { dtype }\");let s=new Hu(t,e,o,!0,n),a=me(r,o);for(let i=0;i0,()=>\"The input tensor must be at least 1D\");let o={x:e},n={axis:t},[s,a]=T.runKernel(Xi,o,n);return{values:s,indices:a}}var K1=N({unique_:k6});function N6(r,t,e){let o=v(r,\"x\",\"unsortedSegmentSum\"),n=v(t,\"segmentIds\",\"unsortedSegmentSum\",\"int32\");$(Ka(e),()=>\"numSegments must be of dtype int\");let s={x:o,segmentIds:n},a={numSegments:e};return T.runKernel(Yi,s,a)}var q1=N({unsortedSegmentSum_:N6});function T6(r,t=0){let e=v(r,\"x\",\"unstack\",\"string_or_numeric\");$(t>=-e.shape.length&&t`Axis = ${t} is not in [-${e.shape.length}, ${e.shape.length})`);let o={value:e},n={axis:t};return T.runKernel(wa,o,n)}var mo=N({unstack_:T6});function j1(r,t){return Nl(r,t,\"right\")}function X1(r,t=!0,e,o){return T.makeVariable(r,t,e,o)}function jd(r,t){let e=[];for(let s=0;s0,()=>\"mask cannot be scalar\"),xt(i.slice(s,s+a),n.shape,\"mask's shape must match the first K dimensions of tensor's shape,\");let p=1;for(let h=s;hi).reverse()),$(o.rank===t.length,()=>`Error in transpose: rank of input ${o.rank} must match length of perm ${t}.`),t.forEach(a=>{$(a>=0&&a`All entries in 'perm' must be between 0 and ${o.rank-1} but got ${t}`)}),o.rank<=1)return o.clone();let n={x:o},s={perm:t};return o.dtype===\"complex64\"?De(()=>{let a=pi(o),i=iu(o);return a=T.runKernel(po,{x:a},s),i=T.runKernel(po,{x:i},s),e&&(i=pr(i)),$r(a,i)}):T.runKernel(po,n,s)}var cc=N({transpose_:R6});function D6(r,t,e,o,n=!0){let s=v(r,\"v\",\"movingAverage\"),a=v(t,\"x\",\"movingAverage\"),i=v(e,\"decay\",\"movingAverage\");Cw(s,a),$(br(s.shape,a.shape),()=>\"Shape mismatch in v and x\");let p=ke(1),u=Te(p,i),c=se(Te(a,s),u);if(n){$(o!=null,()=>\"When using zeroDebias: true, step is required.\");let l=v(o,\"step\",\"movingAverage\");c=je(c,Te(p,ii(i,l)))}return Ce(s,c)}var A6=N({movingAverage_:D6});function F6(r,t,e){Ct(e);let o=v(r,\"indices\",\"scatterND\",\"int32\"),n=v(t,\"updates\",\"scatterND\");pc(n,o,e);let s={indices:o,updates:n},a={shape:e};return T.runKernel(ms,s,a)}var P6=N({scatterND_:F6});function Y1(r,t,e,o){if(r.dtype!==\"int32\")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${r.dtype}.`);if(r.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${r.shape}.`);let n=r.rank>0?r.shape[0]:1,s=r.rank>1?r.shape[1]:1;if(e.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${e.length}, should be: ${s}.`);let a=t.size;if(!(t.rank===0||t.rank===1&&a===n))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${n}]`);if(t.dtype!==o.dtype)throw new Error(\"sparseValues.dtype must match defaultValues.dtype\")}function M6(r,t,e,o=0){Ct(e);let n=v(r,\"sparseIndices\",\"sparseToDense\",\"int32\"),s=v(t,\"sparseValues\",\"sparseToDense\",\"string_or_numeric\"),a=v(o,\"defaultValue\",\"sparseToDense\",s.dtype);Y1(n,s,e,a);let i={sparseIndices:n,sparseValues:s,defaultValue:a},p={outputShape:e};return T.runKernel(vs,i,p)}var L6=N({sparseToDense_:M6});function B6(r,t){let e=v(t,\"indices\",\"gatherND\",\"int32\"),n={params:v(r,\"x\",\"gatherND\",\"string_or_numeric\"),indices:e};return T.runKernel(vn,n)}var z6=N({gatherND_:B6});function Q1(r,t){if(t==null)return r.shape.slice();if(br(r.shape,t))return t;if(r.shape.length===t.length){let e=[];for(let o=0;o`x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`),$(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return r instanceof mt?n.clone():n;let s=Q1(n,e),a=1-t,i=je(Cd(Ce(sc(s,0,1,\"float32\",o),a)),a);return se(n,i)}var W6=N({dropout_:V6});function Qw(r){return Math.floor(Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))))}function _l(r,t,e){let o=1-r%2,n=new Float32Array(r);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${o.rank}`),$(o.rank-1===n.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${o.rank} and targets rank ${n.rank}`),xt(o.shape.slice(0,o.shape.length-1),n.shape,\"predictions's shape should be align with the targets' shape, except the last dimension.\");let s=o.shape[o.shape.length-1];$(e>0&&e<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${e}`);let a=await o.data(),i=await n.data(),[p,u]=[a.length/s,s],c=JC(\"bool\",p);for(let l=0;lg.value-h.value),c[l]=0;for(let h=0;hJ1,depthwiseConv2d:()=>rN,matMul:()=>oN});function H6(r,t,e,o,n,s=\"NHWC\",a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=t;p.rank===3&&(p=W(t,[1,t.shape[0],t.shape[1],t.shape[2]])),$(i.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${i.shape}.`),$(p.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`),$(e.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${e}.`);let u=s===\"NHWC\"?i.shape[3]:i.shape[1],c=s===\"NHWC\"?p.shape[3]:p.shape[1];$(u===e[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${e[2]}.`),$(c===e[3],()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${e[3]}).`),Lt(\"conv2dDerFilter\",n,a);let l={x:i,dy:p},m={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,filterShape:e};return T.runKernel(Ai,l,m)}var Z1=N({conv2DBackpropFilter_:H6});function qu(r,t,e){if(e==null||e===\"linear\")return r;if(e===\"relu\")return se(r,Kd(t));throw new Error(`Cannot compute gradient for fused activation ${e}.`)}function ju(r,t){let e=t,o=gd(r.shape,t.shape);return o.length>0&&(e=ot(e,o)),W(e,r.shape)}function Xu(r,t,e,o){if(t===\"linear\")return r;if(t===\"relu\")return pu(r);if(t===\"elu\")return yd(r);if(t===\"relu6\")return Wd(r);if(t===\"prelu\")return Pd(r,e);if(t===\"leakyrelu\")return Id(r,o);if(t===\"sigmoid\")return $a(r);throw new Error(`Unknown fused activation ${t}.`)}var Yu=(r,t)=>!(r>0)||t===\"linear\";function K6({x:r,filter:t,strides:e,pad:o,dataFormat:n=\"NHWC\",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p=\"linear\",preluActivationWeights:u,leakyreluAlpha:c}){if(p=p||\"linear\",Yu(T.state.gradientDepth,p)===!1){$(n===\"NHWC\",()=>`Error in fused conv2d: got dataFormat of ${n} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let _=nu(r,t,e,o,n,s,a);return i!=null&&(_=Ce(_,i)),Xu(_,p,u,c)}let l=v(r,\"x\",\"conv2d\",\"float32\"),m=v(t,\"filter\",\"conv2d\",\"float32\"),d=l,f=!1;l.rank===3&&(f=!0,d=W(l,[1,l.shape[0],l.shape[1],l.shape[2]])),$(d.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${m.rank}.`),Lt(\"fused conv2d\",o,a);let h=n===\"NHWC\"?d.shape[3]:d.shape[1];$(m.shape[2]===h,()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${m.shape[2]}.`),$(gr(e,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`);let g=Lu(d.shape,m.shape,e,s,o,a),x;i!=null&&(x=v(i,\"bias\",\"fused conv2d\"),[x]=Oe(x,l),n===\"NHWC\"?rt(g.outShape,x.shape):($(x.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${x.shape.length}.`),$(x.shape.length===0||x.shape[0]===g.outChannels||x.shape[0]===1,()=>`Error in fused conv2d: bias shape (${x.shape}) is not compatible with the number of output channels (${g.outChannels})`)));let b;if(u!=null){let _=u.shape;if($(_.length<=1||_.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${_.length}.`),_.length===1)$(_[0]===1||_[0]===g.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${_}) is not compatible with the number of output channels (${g.outChannels}).`);else if(_.length===3)try{rt(_,g.outShape)}catch(E){let R=`Error in fused conv2d: PReLU activation weights (${_}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(R)}b=v(u,\"prelu weights\",\"fused conv2d\")}let C=(_,E)=>{$(n===\"NHWC\",()=>`Error in gradient of fused conv2D: got dataFormat of ${n} but only NHWC is currently supported.`);let[R,D,P,O]=E,M=qu(_,P,p);$(Mu(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let L=hd(D.shape,M,R,e,o),B=Z1(D,M,R.shape,e,o),z=[L,B];if(O!=null){let U=ju(O,M);z.push(U)}return z},S={x:d,filter:m,bias:x,preluActivationWeights:b},k={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:c};return i==null?Ir((E,R,D)=>{let P=T.runKernel(Io,S,k);return D([R,E,P]),f&&(P=W(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:C}})(d,m):Ir((E,R,D,P)=>{let O=T.runKernel(Io,S,k);return P([R,E,O,D]),f&&(O=W(O,[O.shape[1],O.shape[2],O.shape[3]])),{value:O,gradFunc:C}})(d,m,x)}var J1=N({fusedConv2d_:K6});function q6(r,t,e,o,n,s=[1,1],a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=t;p.rank===3&&(p=W(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={x:i,dy:p},c={strides:o,pad:n,dimRoundingMode:a,dilations:s,filterShape:e};return T.runKernel(Fi,u,c)}var eN=N({depthwiseConv2dNativeBackpropFilter_:q6});function j6(r,t,e,o,n,s=[1,1],a){let i=t,p=!1;t.rank===3&&(p=!0,i=W(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={dy:i,filter:e},c={strides:o,pad:n,dimRoundingMode:a,dilations:s,inputShape:r},l=T.runKernel(Pi,u,c);return p?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var tN=N({depthwiseConv2dNativeBackpropInput_:j6});function X6({x:r,filter:t,strides:e,pad:o,dataFormat:n=\"NHWC\",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p=\"linear\",preluActivationWeights:u,leakyreluAlpha:c}){if(Yu(T.state.gradientDepth,p)===!1){let k=oc(r,t,e,o,n,s,a);return i!=null&&(k=Ce(k,i)),Xu(k,p,u,c)}let l=v(r,\"x\",\"depthwiseConv2d\",\"float32\"),m=v(t,\"filter\",\"depthwiseConv2d\",\"float32\"),d=l,f=!1;l.rank===3&&(f=!0,d=W(l,[1,l.shape[0],l.shape[1],l.shape[2]])),$(d.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${m.rank}.`),$(d.shape[3]===m.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${m.shape[2]}.`),s==null&&(s=[1,1]),$(gr(e,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`),Lt(\"fused depthwiseConv2d\",o,a);let h=Lu(d.shape,m.shape,e,s,o,a,!0),g;i!=null&&(g=v(i,\"bias\",\"fused conv2d\"),[g]=Oe(g,l),rt(h.outShape,g.shape));let x;u!=null&&(x=v(u,\"prelu weights\",\"fused depthwiseConv2d\"));let b=(k,_)=>{$(Mu(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[E,R,D,P]=_,O=qu(k,D,p),M=tN(R.shape,O,E,e,o,s,a),L=eN(R,O,E.shape,e,o,s,a);if(P!=null){let B=ju(g,O);return[M,L,B]}return[M,L]},C={x:d,filter:m,bias:g,preluActivationWeights:x},S={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:c};return i==null?Ir((_,E,R)=>{let D=T.runKernel(vo,C,S);return R([E,_,D]),f&&(D=W(D,[D.shape[1],D.shape[2],D.shape[3]])),{value:D,gradFunc:b}})(d,m):Ir((_,E,R,D)=>{let P=T.runKernel(vo,C,S);return D([E,_,P,R]),f&&(P=W(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:b}})(d,m,g)}var rN=N({fusedDepthwiseConv2d_:X6});function Y6({a:r,b:t,transposeA:e=!1,transposeB:o=!1,bias:n,activation:s=\"linear\",preluActivationWeights:a,leakyreluAlpha:i=.2}){if(Yu(T.state.gradientDepth,s)===!1){let O=Ze(r,t,e,o);return n!=null&&(O=Ce(O,n)),Xu(O,s,a,i)}let p=v(r,\"a\",\"fused matMul\"),u=v(t,\"b\",\"fused matMul\");[p,u]=Oe(p,u);let c=e?p.shape[p.rank-2]:p.shape[p.rank-1],l=o?u.shape[u.rank-1]:u.shape[u.rank-2],m=e?p.shape[p.rank-1]:p.shape[p.rank-2],d=o?u.shape[u.rank-2]:u.shape[u.rank-1],f=p.shape.slice(0,-2),h=u.shape.slice(0,-2),g=He(f),x=He(h);$(c===l,()=>`Error in fused matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${p.shape} and ${u.shape} and transposeA=${e} and transposeB=${o} must match.`);let C=rt(p.shape.slice(0,-2),u.shape.slice(0,-2)).concat([m,d]),S=e?W(p,[g,c,m]):W(p,[g,m,c]),k=o?W(u,[x,d,l]):W(u,[x,l,d]),_;n!=null&&(_=v(n,\"bias\",\"fused matMul\"),[_]=Oe(_,p),rt(C,_.shape));let E;a!=null&&(E=v(a,\"prelu weights\",\"fused matMul\"));let R=(O,M)=>{let[L,B,z,U]=M,j=qu(W(O,z.shape),z,s),q,Y;if(!e&&!o?(q=Ze(j,B,!1,!0),Y=Ze(L,j,!0,!1)):!e&&o?(q=Ze(j,B,!1,!1),Y=Ze(j,L,!0,!1)):e&&!o?(q=Ze(B,j,!1,!0),Y=Ze(L,j,!1,!1)):(q=Ze(B,j,!0,!0),Y=Ze(j,L,!0,!0)),n!=null){let J=ju(U,j);return[q,Y,J]}else return[q,Y]},D={a:S,b:k,bias:_,preluActivationWeights:E},P={transposeA:e,transposeB:o,activation:s,leakyreluAlpha:i};return n==null?Ir((M,L,B)=>{let z=T.runKernel(So,D,P);return B([M,L,z]),{value:W(z,C),gradFunc:R}})(S,k):Ir((M,L,B,z)=>{let U=T.runKernel(So,D,P);return z([M,L,U,B]),{value:W(U,C),gradFunc:R}})(S,k,_)}var oN=N({fusedMatMul_:Y6});function Q6(r){return _l(r,.54,.46)}var nN=N({hammingWindow_:Q6});function Z6(r){return _l(r,.5,.5)}var Yd=N({hannWindow_:Z6});function J6(r,t,e,o=!1,n=0){let s=0,a=[];for(;s+t<=r.size;)a.push(Xe(r,s,t)),s+=e;if(o)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&i.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${i.shape}.`),$(p.rank===1&&p.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${i.shape}.`),$(o.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${o.length}.`),$(o[0]>=1&&o[1]>=1,()=>`cropSize must be atleast [1,1], but was ${o}`),$(n===\"bilinear\"||n===\"nearest\",()=>`method must be bilinear or nearest, but was ${n}`);let c={image:a,boxes:i,boxInd:p},l={method:n,extrapolationValue:s,cropSize:o};return T.runKernel(cn,c,l)}var aN=N({cropAndResize_:tj});function rj(r){let t=v(r,\"image\",\"flipLeftRight\",\"float32\");$(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let e={image:t};return T.runKernel(Cn,e,{})}var iN=N({flipLeftRight_:rj});function oj(r){let t=v(r,\"image\",\"grayscaleToRGB\"),e=t.rank-1,o=t.shape[e];$(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),$(o===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${o}.`);let n=new Array(t.rank);return n.fill(1,0,e),n[e]=3,au(t,n)}var uN=N({grayscaleToRGB_:oj});function nj(r){let t=v(r,\"image\",\"RGBToGrayscale\"),e=t.rank-1,o=t.shape[e];$(t.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`),$(o===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${o}.`);let n=t.dtype,s=We(t,\"float32\"),a=Jt([.2989,.587,.114]),i;switch(t.rank){case 2:i=su(\"ij,j->i\",s,a);break;case 3:i=su(\"ijk,k->ij\",s,a);break;case 4:i=su(\"ijkl,l->ijk\",s,a);break;case 5:i=su(\"ijklm,m->ijkl\",s,a);break;case 6:i=su(\"ijklmn,n->ijklm\",s,a);break;default:throw new Error(\"Not a valid tensor rank.\")}return i=Ms(i,-1),We(i,n)}var pN=N({rgbToGrayscale_:nj});function sj(r,t,e=0,o=.5){let n=v(r,\"image\",\"rotateWithOffset\",\"float32\");$(n.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${n.rank}.`);let s={image:n},a={radians:t,fillValue:e,center:o};return T.runKernel(Ds,s,a)}var cN=N({rotateWithOffset_:sj});function $o(r,t,e,o,n,s){o==null&&(o=.5),n==null&&(n=Number.NEGATIVE_INFINITY),s==null&&(s=0);let a=r.shape[0];return e=Math.min(e,a),$(0<=o&&o<=1,()=>`iouThreshold must be in [0, 1], but was '${o}'`),$(r.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${r.rank}'`),$(r.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${r.shape[1]}`),$(t.rank===1,()=>\"scores must be a 1D tensor\"),$(t.shape[0]===a,()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`),$(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:e,iouThreshold:o,scoreThreshold:n,softNmsSigma:s}}function aj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,\"boxes\",\"nonMaxSuppression\",\"float32\"),a=v(t,\"scores\",\"nonMaxSuppression\",\"float32\"),i=$o(s,a,e,o,n);e=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p={maxOutputSize:e,iouThreshold:o,scoreThreshold:n};return T.runKernel(Qn,{boxes:s,scores:a},p)}var lN=N({nonMaxSuppression_:aj});function mN(r,t,e){let o=ij(r,t,e),n=o<0?-(o+1):o;r.splice(n,0,t)}function ij(r,t,e){return pj(r,t,e||uj)}function uj(r,t){return r>t?1:r>>1);let i=e(t,r[s]);i>0?o=s+1:(n=s,a=!i)}return a?o:-o-1}function Zd(r,t,e,o,n){return Jw(r,t,e,o,n,0)}function Jd(r,t,e,o,n,s){return Jw(r,t,e,o,n,0,!1,s,!0)}function ef(r,t,e,o,n,s){return Jw(r,t,e,o,n,s,!0)}function Jw(r,t,e,o,n,s,a=!1,i=!1,p=!1){let u=[];for(let g=0;gn&&u.push({score:t[g],boxIndex:g,suppressBeginIndex:0});u.sort(dN);let c=s>0?-.5/s:0,l=[],m=[];for(;l.length0;){let g=u.pop(),{score:x,boxIndex:b,suppressBeginIndex:C}=g;if(x=C;--k){let _=cj(r,b,l[k]);if(_>=o){S=!0;break}if(g.score=g.score*lj(o,c,_),g.score<=n)break}g.suppressBeginIndex=l.length,S||(g.score===x?(l.push(b),m.push(g.score)):g.score>n&&mN(u,g,dN))}let d=l.length,f=e-d;i&&f>0&&(l.push(...new Array(f).fill(0)),m.push(...new Array(f).fill(0)));let h={selectedIndices:l};return a&&(h.selectedScores=m),p&&(h.validOutputs=d),h}function cj(r,t,e){let o=r.subarray(t*4,t*4+4),n=r.subarray(e*4,e*4+4),s=Math.min(o[0],o[2]),a=Math.min(o[1],o[3]),i=Math.max(o[0],o[2]),p=Math.max(o[1],o[3]),u=Math.min(n[0],n[2]),c=Math.min(n[1],n[3]),l=Math.max(n[0],n[2]),m=Math.max(n[1],n[3]),d=(i-s)*(p-a),f=(l-u)*(m-c);if(d<=0||f<=0)return 0;let h=Math.max(s,u),g=Math.max(a,c),x=Math.min(i,l),b=Math.min(p,m),C=Math.max(x-h,0)*Math.max(b-g,0);return C/(d+f-C)}function lj(r,t,e){let o=Math.exp(t*e*e);return e<=r?o:0}function dN(r,t){return r.score-t.score||r.score===t.score&&t.boxIndex-r.boxIndex}async function mj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,\"boxes\",\"nonMaxSuppressionAsync\"),a=v(t,\"scores\",\"nonMaxSuppressionAsync\"),i=$o(s,a,e,o,n);e=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p=await Promise.all([s.data(),a.data()]),u=p[0],c=p[1],{selectedIndices:l}=Zd(u,c,e,o,n);return s!==r&&s.dispose(),a!==t&&a.dispose(),Jt(l,\"int32\")}var fN=mj;function dj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,\"boxes\",\"nonMaxSuppression\"),i=v(t,\"scores\",\"nonMaxSuppression\"),p=$o(a,i,e,o,n,s);e=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u={boxes:a,scores:i},c={maxOutputSize:e,iouThreshold:o,scoreThreshold:n,softNmsSigma:s},l=T.runKernel(Zn,u,c);return{selectedIndices:l[0],selectedScores:l[1]}}var hN=N({nonMaxSuppressionWithScore_:dj});async function fj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,\"boxes\",\"nonMaxSuppressionAsync\"),i=v(t,\"scores\",\"nonMaxSuppressionAsync\"),p=$o(a,i,e,o,n,s);e=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u=await Promise.all([a.data(),i.data()]),c=u[0],l=u[1],{selectedIndices:m,selectedScores:d}=ef(c,l,e,o,n,s);return a!==r&&a.dispose(),i!==t&&i.dispose(),{selectedIndices:Jt(m,\"int32\"),selectedScores:Jt(d)}}var gN=fj;function hj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,\"boxes\",\"nonMaxSuppression\"),i=v(t,\"scores\",\"nonMaxSuppression\"),p=$o(a,i,e,o,n,null),u=p.maxOutputSize,c=p.iouThreshold,l=p.scoreThreshold,m={boxes:a,scores:i},d={maxOutputSize:u,iouThreshold:c,scoreThreshold:l,padToMaxOutputSize:s},f=T.runKernel(Qa,m,d);return{selectedIndices:f[0],validOutputs:f[1]}}var xN=N({nonMaxSuppressionPadded_:hj});async function gj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,\"boxes\",\"nonMaxSuppressionAsync\"),i=v(t,\"scores\",\"nonMaxSuppressionAsync\"),p=$o(a,i,e,o,n,null),u=p.maxOutputSize,c=p.iouThreshold,l=p.scoreThreshold,[m,d]=await Promise.all([a.data(),i.data()]),{selectedIndices:f,validOutputs:h}=Jd(m,d,u,c,l,s);return a!==r&&a.dispose(),i!==t&&i.dispose(),{selectedIndices:Jt(f,\"int32\"),validOutputs:ke(h,\"int32\")}}var yN=gj;function xj(r,t,e=!1,o=!1){let n=v(r,\"images\",\"resizeBilinear\");$(n.rank===3||n.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${n.rank}.`),$(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),$(o===!1||e===!1,()=>\"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.\");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=t,i={images:s},p={alignCorners:e,halfPixelCenters:o,size:t},u=T.runKernel(is,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var bN=N({resizeBilinear_:xj});function yj(r,t,e=!1,o=!1){let n=v(r,\"images\",\"resizeNearestNeighbor\");$(n.rank===3||n.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${n.rank}.`),$(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),$(n.dtype===\"float32\"||n.dtype===\"int32\",()=>\"`images` must have `int32` or `float32` as dtype\"),$(o===!1||e===!1,()=>\"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.\");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=t,i={images:s},p={alignCorners:e,halfPixelCenters:o,size:t},u=T.runKernel(as,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var CN=N({resizeNearestNeighbor_:yj});function bj(r,t=\"binary\",e=!1,o=.5){let n=v(r,\"image\",\"threshold\"),s=.2989,a=.587,i=.114,p=n.shape[0]*n.shape[1],u=se(Jt([o]),255),c,l,m,d;if($(n.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${n.rank}.`),$(n.shape[2]===3||n.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${n.shape[2]}.`),$(n.dtype===\"int32\"||n.dtype===\"float32\",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${n.dtype}.`),$(t===\"otsu\"||t===\"binary\",()=>`Method must be binary or otsu, but was ${t}`),n.shape[2]===3){[c,l,m]=ci(n,[1,1,1],-1);let g=se(c,s),x=se(l,a),b=se(m,i);d=Ce(Ce(g,x),b)}else d=r;if(t===\"otsu\"){let g=fd(We(Ud(d),\"int32\"),ar([]),256);u=Cj(g,p)}let f=e?nc(d,u):zu(d,u);return We(se(f,255),\"int32\")}function Cj(r,t){let e=Jt([-1]),o=Jt([0]),n=Jt([0]),s,a,i,p,u,c;for(let l=0;l`Error in transform: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&(i.shape[0]===a.shape[0]||i.shape[0]===1)&&i.shape[1]===8,()=>\"Error in transform: Input transform should be batch x 8 or 1 x 8\"),$(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let p={image:a,transforms:i},u={interpolation:e,fillMode:o,fillValue:n,outputShape:s};return T.runKernel(Rs,p,u)}var SN=N({transform_:wj});function Sj(r,t,e){let o=v(r,\"a\",\"bandPart\");$(o.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${o.rank}.`);let n=o.shape,[s,a]=o.shape.slice(-2),i,p;typeof t==\"number\"?($(t%1===0,()=>`bandPart(): numLower must be an integer, got ${t}.`),$(t<=s,()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`),i=v(t<0?s:t,\"numLower\",\"bandPart\")):($(t.dtype===\"int32\",()=>\"bandPart(): numLower's dtype must be an int32.\"),i=co(kl(t,0),s,Uu(t,s))),typeof e==\"number\"?($(e%1===0,()=>`bandPart(): numUpper must be an integer, got ${e}.`),$(e<=a,()=>`bandPart(): numUpper (${e}) must not be greater than the number of columns (${a}).`),p=v(e<0?a:e,\"numUpper\",\"bandPart\")):($(e.dtype===\"int32\",()=>\"bandPart(): numUpper's dtype must be an int32.\"),p=co(kl(e,0),a,Uu(e,a)));let u=W(uu(0,s,1,\"int32\"),[-1,1]),c=uu(0,a,1,\"int32\"),l=Te(u,c),m=Vu(nc(l,i),Sd(l,pr(p))),d=Ur([s,a],o.dtype);return W(vr(mo(W(o,[-1,s,a])).map(f=>co(m,f,d))),n)}var IN=N({bandPart_:Sj});function Ij(r){let t;if(Array.isArray(r)){t=!1,$(r!=null&&r.length>0,()=>\"Gram-Schmidt process: input must not be null, undefined, or empty\");let n=r[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${r[s].shape[0]} vs. ${n})`)}else t=!0,r=ci(r,r.shape[0],0).map(n=>uc(n,[0]));$(r.length<=r[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${r.length}) exceeds number of dimensions (${r[0].shape[0]}).`);let e=[],o=r;for(let n=0;n{let s=o[n];if(n>0)for(let a=0;a=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${r.rank}`),r.rank===2)return kN(r,t);{let e=r.shape.slice(0,r.shape.length-2).reduce((p,u)=>p*u),o=mo(W(r,[e,r.shape[r.shape.length-2],r.shape[r.shape.length-1]]),0),n=[],s=[];o.forEach(p=>{let[u,c]=kN(p,t);n.push(u),s.push(c)});let a=W(vr(n,0),r.shape),i=W(vr(s,0),r.shape);return[a,i]}}function kN(r,t=!1){return T.tidy(()=>{$(r.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${r.shape.length}D Tensor.`);let e=r.shape[0],o=r.shape[1],n=bd(e),s=Wr(r),a=cu([[1]],[1,1]),i=Wr(a),p=e>=o?o:e;for(let u=0;u{let d=Xe(s,[u,u],[e-u,1]),f=Bu(d),h=Xe(s,[u,u],[1,1]),g=co(zu(h,0),cu([[-1]]),cu([[1]])),x=Te(h,se(g,f)),b=je(d,x);b.shape[0]===1?i=Wr(a):i=yt([a,Xe(b,[1,0],[b.shape[0]-1,b.shape[1]])],0);let C=pr(je(Ze(g,x),f)),S=Xe(s,[u,0],[e-u,o]),k=se(C,i),_=cc(i);if(u===0)s=Te(S,Ze(k,Ze(_,S)));else{let D=Te(S,Ze(k,Ze(_,S)));s=yt([Xe(s,[0,0],[u,o]),D],0)}let E=cc(k),R=Xe(n,[0,u],[e,n.shape[1]-u]);if(u===0)n=Te(R,Ze(Ze(R,i),E));else{let D=Te(R,Ze(Ze(R,i),E));n=yt([Xe(n,[0,0],[e,u]),D],1)}return[i,s,n]}),Ot([c,l,m])}return!t&&e>o&&(n=Xe(n,[0,0],[e,o]),s=Xe(s,[0,0],[o,o])),[n,s]})}var NN=N({qr_:vj});var Et;(function(r){r[r.NONE=0]=\"NONE\",r[r.MEAN=1]=\"MEAN\",r[r.SUM=2]=\"SUM\",r[r.SUM_BY_NONZERO_WEIGHTS=3]=\"SUM_BY_NONZERO_WEIGHTS\"})(Et||(Et={}));function kj(r,t,e=Et.SUM_BY_NONZERO_WEIGHTS){let o=v(r,\"losses\",\"computeWeightedLoss\"),n=null;t!=null&&(n=v(t,\"weights\",\"computeWeightedLoss\"));let s=n==null?o:se(o,n);if(e===Et.NONE)return s;if(e===Et.SUM)return ot(s);if(e===Et.MEAN){if(n==null)return Wu(s);{let a=o.size/n.size,i=je(ot(s),ot(n));return a>1?je(i,ke(a)):i}}if(e===Et.SUM_BY_NONZERO_WEIGHTS){if(n==null)return je(ot(s),ke(o.size));{let a=se(n,Da(o.shape)),i=We(ot(Ad(a,ke(0))),\"float32\");return je(ot(s),i)}}throw Error(`Unknown reduction: ${e}`)}var cr=N({computeWeightedLoss_:kj});function Nj(r,t,e,o=Et.SUM_BY_NONZERO_WEIGHTS){let n=v(r,\"labels\",\"absoluteDifference\"),s=v(t,\"predictions\",\"absoluteDifference\"),a=null;e!=null&&(a=v(e,\"weights\",\"absoluteDifference\")),xt(n.shape,s.shape,\"Error in absoluteDifference: \");let i=Qt(Te(n,s));return cr(i,a,o)}var TN=N({absoluteDifference_:Nj});function Tj(r,t,e,o,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"labels\",\"cosineDistance\"),a=v(t,\"predictions\",\"cosineDistance\"),i=null;o!=null&&(i=v(o,\"weights\",\"cosineDistance\")),xt(s.shape,a.shape,\"Error in cosineDistance: \");let p=ke(1),u=Te(p,ot(se(s,a),e,!0));return cr(u,i,n)}var _N=N({cosineDistance_:Tj});function _j(r,t,e,o=Et.SUM_BY_NONZERO_WEIGHTS){let n=v(r,\"labels\",\"hingeLoss\"),s=v(t,\"predictions\",\"hingeLoss\"),a=null;e!=null&&(a=v(e,\"weights\",\"hingeLoss\")),xt(n.shape,s.shape,\"Error in hingeLoss: \");let i=ke(1);n=Te(se(ke(2),n),i);let p=pu(Te(i,se(n,s)));return cr(p,a,o)}var $N=N({hingeLoss_:_j});function $j(r,t,e,o=1,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"labels\",\"huberLoss\"),a=v(t,\"predictions\",\"huberLoss\"),i=null;e!=null&&(i=v(e,\"weights\",\"huberLoss\")),xt(s.shape,a.shape,\"Error in huberLoss: \");let p=ke(o),u=Qt(Te(a,s)),c=Uu(u,p),l=Te(u,c),m=Ce(se(ke(.5),Zt(c)),se(p,l));return cr(m,i,n)}var EN=N({huberLoss_:$j});function Ej(r,t,e,o=1e-7,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"labels\",\"logLoss\"),a=v(t,\"predictions\",\"logLoss\"),i=null;e!=null&&(i=v(e,\"weights\",\"logLoss\")),xt(s.shape,a.shape,\"Error in logLoss: \");let p=ke(1),u=ke(o),c=pr(se(s,ui(Ce(a,u)))),l=se(Te(p,s),ui(Ce(Te(p,a),u))),m=Te(c,l);return cr(m,i,n)}var RN=N({logLoss_:Ej});function Rj(r,t,e,o=Et.SUM_BY_NONZERO_WEIGHTS){let n=v(r,\"labels\",\"meanSquaredError\"),s=v(t,\"predictions\",\"meanSquaredError\"),a=null;e!=null&&(a=v(e,\"weights\",\"meanSquaredError\")),xt(n.shape,s.shape,\"Error in meanSquaredError: \");let i=Hd(n,s);return cr(i,a,o)}var DN=N({meanSquaredError_:Rj});function Dj(r,t){let e=v(r,\"labels\",\"sigmoidCrossEntropyWithLogits\"),o=v(t,\"logits\",\"sigmoidCrossEntropyWithLogits\");xt(e.shape,o.shape,\"Error in sigmoidCrossEntropyWithLogits: \");let n=pu(o),s=se(o,e),a=vd(_o(pr(Qt(o))));return Ce(Te(n,s),a)}function Aj(r,t,e,o=0,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"multiClassLabels\",\"sigmoidCrossEntropy\"),a=v(t,\"logits\",\"sigmoidCrossEntropy\"),i=null;if(e!=null&&(i=v(e,\"weights\",\"sigmoidCrossEntropy\")),xt(s.shape,a.shape,\"Error in sigmoidCrossEntropy: \"),o>0){let u=ke(o),c=ke(1),l=ke(.5);s=Ce(se(s,Te(c,u)),se(l,u))}let p=Dj(s,a);return cr(p,i,n)}var AN=N({sigmoidCrossEntropy_:Aj});function Fj(r,t,e=-1){if(e===-1&&(e=t.rank-1),e!==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 ${e}`);return Ir((n,s,a)=>{let p=Td(s,[e],!0),u=Te(We(s,\"float32\"),p);a([n,u]);let c=pr(se(u,n));return{value:ot(c,[e]),gradFunc:(d,f)=>{let[h,g]=f,x=ai(d.shape,[e]);return[se(W(d,x),Te(We(h,\"float32\"),_o(g))),se(W(d,x),Te(_o(g),We(h,\"float32\")))]}}})(r,t)}function Pj(r,t,e,o=0,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"onehotLabels\",\"softmaxCrossEntropy\"),a=v(t,\"logits\",\"softmaxCrossEntropy\"),i=null;if(e!=null&&(i=v(e,\"weights\",\"softmaxCrossEntropy\")),xt(s.shape,a.shape,\"Error in softmaxCrossEntropy: \"),o>0){let u=ke(o),c=ke(1),l=ke(s.shape[1]);s=Ce(se(s,Te(c,u)),je(u,l))}let p=Fj(s,a);return cr(p,i,n)}var FN=N({softmaxCrossEntropy_:Pj});function Oj(r,t,e,o){let n=v(r,\"indices\",\"sparseFillEmptyRows\",\"int32\"),s=v(t,\"values\",\"sparseFillEmptyRows\"),a=v(e,\"denseShape\",\"sparseFillEmptyRows\",\"int32\"),i=v(o,\"defaultValue\",\"sparseFillEmptyRows\",s.dtype);if(n.rank!==2)throw new Error(`Indices should be Tensor2D but received shape\n ${n.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(a.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(i.rank!==0)throw new Error(`Default value should be a scalar but received shape ${i.shape}`);let p={indices:n,values:s,denseShape:a,defaultValue:i},u=T.runKernel(Hi,p);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}var PN=N({sparseFillEmptyRows_:Oj});function Mj(r,t,e){let o=v(r,\"inputIndices\",\"sparseReshape\",\"int32\"),n=v(t,\"inputShape\",\"sparseReshape\",\"int32\"),s=v(e,\"newShape\",\"sparseReshape\",\"int32\");if(o.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape\n ${o.shape}`);if(n.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${n.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let a={inputIndices:o,inputShape:n,newShape:s},i=T.runKernel(ei,a);return{outputIndices:i[0],outputShape:i[1]}}var ON=N({sparseReshape_:Mj});function Lj(r,t,e){let o=v(r,\"data\",\"sparseSegmentMean\"),n=v(t,\"indices\",\"sparseSegmentMean\",\"int32\"),s=v(e,\"segmentIds\",\"sparseSegmentMean\",\"int32\");if(o.rank<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape\n ${n.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return T.runKernel(ya,a)}var MN=N({sparseSegmentMean_:Lj});function Bj(r,t,e){let o=v(r,\"data\",\"sparseSegmentSum\"),n=v(t,\"indices\",\"sparseSegmentSum\",\"int32\"),s=v(e,\"segmentIds\",\"sparseSegmentSum\",\"int32\");if(o.rank<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape\n ${n.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return T.runKernel(ba,a)}var LN=N({sparseSegmentSum_:Bj});function zj(r,t,e,o,n,s,a,i){let p=v(r,\"data\",\"stringNGrams\",\"string\");if(p.dtype!==\"string\")throw new Error(\"Data must be of datatype string\");if(p.shape.length!==1)throw new Error(`Data must be a vector, saw: ${p.shape}`);let u=v(t,\"dataSplits\",\"stringNGrams\");if(u.dtype!==\"int32\")throw new Error(\"Data splits must be of datatype int32\");let c={separator:e,nGramWidths:o,leftPad:n,rightPad:s,padWidth:a,preserveShortSequences:i},l={data:p,dataSplits:u},m=T.runKernel(Ca,l,c);return{nGrams:m[0],nGramsSplits:m[1]}}var BN=N({stringNGrams_:zj});function Vj(r,t,e=!0){let o=v(r,\"input\",\"stringSplit\",\"string\"),n=v(t,\"delimiter\",\"stringSplit\",\"string\");if(o.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${o.shape}`);if(n.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${n.shape}`);let s={skipEmpty:e},a={input:o,delimiter:n},i=T.runKernel(qi,a,s);return{indices:i[0],values:i[1],shape:i[2]}}var zN=N({stringSplit_:Vj});function Wj(r,t){let e=v(r,\"input\",\"stringToHashBucketFast\",\"string\"),o={numBuckets:t};if(t<=0)throw new Error(\"Number of buckets must be at least 1\");let n={input:e};return T.runKernel(ji,n,o)}var VN=N({stringToHashBucketFast_:Wj});function Uj(r,t,e,o=!0){let n=v(r,\"input\",\"staticRegexReplace\",\"string\"),s={pattern:t,rewrite:e,replaceGlobal:o};return T.runKernel($u,{x:n},s)}var WN=N({staticRegexReplace_:Uj});var Gj={fft:ac,ifft:Ku,rfft:ic,irfft:Gd},Hj={hammingWindow:nN,hannWindow:Yd,frame:Qd,stft:sN},Kj={flipLeftRight:iN,grayscaleToRGB:uN,resizeNearestNeighbor:CN,resizeBilinear:bN,rgbToGrayscale:pN,rotateWithOffset:cN,cropAndResize:aN,nonMaxSuppression:lN,nonMaxSuppressionAsync:fN,nonMaxSuppressionWithScore:hN,nonMaxSuppressionWithScoreAsync:gN,nonMaxSuppressionPadded:xN,nonMaxSuppressionPaddedAsync:yN,threshold:wN,transform:SN},qj={bandPart:IN,gramSchmidt:vN,qr:NN},jj={absoluteDifference:TN,computeWeightedLoss:cr,cosineDistance:_N,hingeLoss:$N,huberLoss:EN,logLoss:RN,meanSquaredError:DN,sigmoidCrossEntropy:AN,softmaxCrossEntropy:FN},Xj={sparseFillEmptyRows:PN,sparseReshape:ON,sparseSegmentMean:MN,sparseSegmentSum:LN},Yj={stringNGrams:BN,stringSplit:zN,stringToHashBucketFast:VN,staticRegexReplace:WN};var UN={};qe(UN,{Serializable:()=>$l,SerializationMap:()=>tf,getRegisteredName:()=>Zj,registerClass:()=>tS});var Qj=new Map,eS=new Map,$l=class{getClassName(){return this.constructor.className}static fromConfig(t,e){return new t(e)}},tf=class r{constructor(){this.classNameMap={}}static getMap(){return r.instance==null&&(r.instance=new r),r.instance}static register(t){r.getMap().classNameMap[t.className]=[t,t.fromConfig]}};function tS(r,t,e){$(r.className!=null,()=>\"Class being registered does not have the static className property defined.\"),$(typeof r.className==\"string\",()=>\"className is required to be a string, but got type \"+typeof r.className),$(r.className.length>0,()=>\"Class being registered has an empty-string as its className, which is disallowed.\"),typeof t==\"undefined\"&&(t=\"Custom\"),typeof e==\"undefined\"&&(e=r.className);let o=e,n=t+\">\"+o;return tf.register(r),Qj.set(n,r),eS.set(r,n),r}function Zj(r){return eS.has(r)?eS.get(r):r.className}var kr=class extends $l{minimize(t,e=!1,o){let{value:n,grads:s}=this.computeGradients(t,o);if(o!=null){let a=o.map(i=>({name:i.name,tensor:s[i.name]}));this.applyGradients(a)}else this.applyGradients(s);return Ot(s),e?n:(n.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(t,e){return zw(t,e)}dispose(){this.iterations_!=null&&Ot(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(t){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(t){return this.iterations_=(await t[0].tensor.data())[0],t.slice(1)}};Object.defineProperty(kr,Symbol.hasInstance,{value:r=>r.minimize!=null&&r.computeGradients!=null&&r.applyGradients!=null});var Qu=class extends kr{static get className(){return\"Adadelta\"}constructor(t,e,o=null){super(),this.learningRate=t,this.rho=e,this.epsilon=o,this.accumulatedGrads=[],this.accumulatedUpdates=[],o==null&&(this.epsilon=T.backend.epsilon())}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o],a=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accum_grad`,variable:De(()=>Gt(s).variable(a))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${o}/accum_var`,variable:De(()=>Gt(s).variable(a))});let i=Array.isArray(t)?t[n].tensor:t[o];if(i==null)return;let p=this.accumulatedGrads[n].variable,u=this.accumulatedUpdates[n].variable;De(()=>{let c=Ce(se(p,this.rho),se(Zt(i),1-this.rho)),l=se(je(Rr(Ce(u,this.epsilon)),Rr(Ce(p,this.epsilon))),i),m=Ce(se(u,this.rho),se(Zt(l),1-this.rho));p.assign(c),u.assign(m);let d=Ce(se(l,-this.learningRate),s);s.assign(d)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Ot(this.accumulatedGrads.map(t=>t.variable)),Ot(this.accumulatedUpdates.map(t=>t.variable)))}async getWeights(){let t=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(t.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=t.length/2,o=!1;this.accumulatedGrads=t.slice(0,e).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedUpdates=t.slice(e,e*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(t,e){return new t(e.learningRate,e.rho,e.epsilon)}};var Zu=class extends kr{static get className(){return\"Adagrad\"}constructor(t,e=.1){super(),this.learningRate=t,this.initialAccumulatorValue=e,this.accumulatedGrads=[]}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o];this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accumulator`,variable:De(()=>Ea(s.shape,this.initialAccumulatorValue).variable(!1))});let a=Array.isArray(t)?t[n].tensor:t[o];if(a==null)return;let i=this.accumulatedGrads[n].variable;De(()=>{let p=Ce(i,Zt(a));i.assign(p);let u=Ce(se(je(a,Rr(Ce(p,T.backend.epsilon()))),-this.learningRate),s);s.assign(u)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Ot(this.accumulatedGrads.map(t=>t.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=!1;this.accumulatedGrads=t.map(o=>({originalName:o.name,variable:o.tensor.variable(e)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(t,e){return new t(e.learningRate,e.initialAccumulatorValue)}};var Ju=class extends kr{static get className(){return\"Adam\"}constructor(t,e,o,n=null){super(),this.learningRate=t,this.beta1=e,this.beta2=o,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],De(()=>{this.accBeta1=ke(e).variable(),this.accBeta2=ke(o).variable()}),n==null&&(this.epsilon=T.backend.epsilon())}applyGradients(t){let e=Array.isArray(t)?t.map(o=>o.name):Object.keys(t);De(()=>{let o=Te(1,this.accBeta1),n=Te(1,this.accBeta2);e.forEach((s,a)=>{let i=T.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:De(()=>Gt(i).variable(p))}),this.accumulatedSecondMoment[a]==null&&(this.accumulatedSecondMoment[a]={originalName:`${s}/v`,variable:De(()=>Gt(i).variable(p))});let u=Array.isArray(t)?t[a].tensor:t[s];if(u==null)return;let c=this.accumulatedFirstMoment[a].variable,l=this.accumulatedSecondMoment[a].variable,m=Ce(se(c,this.beta1),se(u,1-this.beta1)),d=Ce(se(l,this.beta2),se(Zt(u),1-this.beta2)),f=je(m,o),h=je(d,n);c.assign(m),l.assign(d);let g=Ce(se(je(f,Ce(Rr(h),this.epsilon)),-this.learningRate),i);i.assign(g)}),this.accBeta1.assign(se(this.accBeta1,this.beta1)),this.accBeta2.assign(se(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Ot(this.accumulatedFirstMoment.map(t=>t.variable)),this.accumulatedSecondMoment!=null&&Ot(this.accumulatedSecondMoment.map(t=>t.variable))}async getWeights(){let t=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(t.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(t){t=await this.extractIterations(t),De(()=>{this.accBeta1.assign(ii(this.beta1,this.iterations_+1)),this.accBeta2.assign(ii(this.beta2,this.iterations_+1))});let e=t.length/2,o=!1;this.accumulatedFirstMoment=t.slice(0,e).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedSecondMoment=t.slice(e,e*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon)}};var ep=class extends kr{static get className(){return\"Adamax\"}constructor(t,e,o,n=null,s=0){super(),this.learningRate=t,this.beta1=e,this.beta2=o,this.epsilon=n,this.decay=s,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],De(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(e).variable()}),n==null&&(this.epsilon=T.backend.epsilon())}applyGradients(t){let e=Array.isArray(t)?t.map(o=>o.name):Object.keys(t);De(()=>{let o=Te(1,this.accBeta1),n=je(-this.learningRate,Ce(se(this.iteration,this.decay),1));e.forEach((s,a)=>{let i=T.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:Gt(i).variable(p)}),this.accumulatedWeightedInfNorm[a]==null&&(this.accumulatedWeightedInfNorm[a]={originalName:`${s}/v`,variable:Gt(i).variable(p)});let u=Array.isArray(t)?t[a].tensor:t[s];if(u==null)return;let c=this.accumulatedFirstMoment[a].variable,l=this.accumulatedWeightedInfNorm[a].variable,m=Ce(se(c,this.beta1),se(u,1-this.beta1)),d=se(l,this.beta2),f=Qt(u),h=Dd(d,f);c.assign(m),l.assign(h);let g=Ce(se(je(n,o),je(m,Ce(h,this.epsilon))),i);i.assign(g)}),this.iteration.assign(Ce(this.iteration,1)),this.accBeta1.assign(se(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Ot(this.accumulatedFirstMoment.map(t=>t.variable)),this.accumulatedWeightedInfNorm!=null&&Ot(this.accumulatedWeightedInfNorm.map(t=>t.variable))}async getWeights(){throw new Error(\"getWeights() is not implemented for Adamax yet.\")}async setWeights(t){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(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon,e.decay)}};var li=class extends kr{static get className(){return\"SGD\"}constructor(t){super(),this.learningRate=t,this.setLearningRate(t)}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=Array.isArray(t)?t[n].tensor:t[o];if(s==null)return;let a=T.registeredVariables[o];De(()=>{let i=Ce(se(this.c,s),a);a.assign(i)})}),this.incrementIterations()}setLearningRate(t){this.learningRate=t,this.c!=null&&this.c.dispose(),this.c=Er(ke(-t))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(t){if(t=await this.extractIterations(t),t.length!==0)throw new Error(\"SGD optimizer does not have settable weights.\")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(t,e){return new t(e.learningRate)}};var tp=class extends li{static get className(){return\"Momentum\"}constructor(t,e,o=!1){super(t),this.learningRate=t,this.momentum=e,this.useNesterov=o,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o];this.accumulations[n]==null&&(this.accumulations[n]={originalName:`${o}/momentum`,variable:De(()=>Gt(s).variable(!1))});let a=this.accumulations[n].variable,i=Array.isArray(t)?t[n].tensor:t[o];i!=null&&De(()=>{let p,u=Ce(se(this.m,a),i);this.useNesterov?p=Ce(se(this.c,Ce(i,se(u,this.m))),s):p=Ce(se(this.c,u),s),a.assign(u),s.assign(p)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Ot(this.accumulations.map(t=>t.variable))}setMomentum(t){this.momentum=t}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=!1;this.accumulations=t.map(o=>({originalName:o.name,variable:o.tensor.variable(e)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(t,e){return new t(e.learningRate,e.momentum,e.useNesterov)}};var rp=class extends kr{static get className(){return\"RMSProp\"}constructor(t,e=.9,o=0,n=null,s=!1){if(super(),this.learningRate=t,this.decay=e,this.momentum=o,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=s,n==null&&(this.epsilon=T.backend.epsilon()),t==null)throw new Error(\"learningRate for RMSPropOptimizer must be defined.\")}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o],a=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${o}/rms`,variable:De(()=>Gt(s).variable(a))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${o}/momentum`,variable:De(()=>Gt(s).variable(a))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${o}/mg`,variable:De(()=>Gt(s).variable(a))});let i=Array.isArray(t)?t[n].tensor:t[o];if(i==null)return;let p=this.accumulatedMeanSquares[n].variable,u=this.accumulatedMoments[n].variable;De(()=>{let c=Ce(se(p,this.decay),se(Zt(i),1-this.decay));if(this.centered){let l=this.accumulatedMeanGrads[n].variable,m=Ce(se(l,this.decay),se(i,1-this.decay)),d=je(se(i,this.learningRate),Rr(Te(c,Ce(Zt(m),this.epsilon)))),f=Ce(se(u,this.momentum),d);p.assign(c),l.assign(m),u.assign(f);let h=Te(s,f);s.assign(h)}else{let l=Ce(se(p,this.decay),se(Zt(i),1-this.decay)),m=Ce(se(u,this.momentum),je(se(i,this.learningRate),Rr(Ce(l,this.epsilon))));p.assign(l),u.assign(m);let d=Te(s,m);s.assign(d)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Ot(this.accumulatedMeanSquares.map(t=>t.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Ot(this.accumulatedMeanGrads.map(t=>t.variable)),this.accumulatedMoments!=null&&Ot(this.accumulatedMoments.map(t=>t.variable))}async getWeights(){let t=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&t.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(t.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=this.centered?t.length/3:t.length/2,o=!1;this.accumulatedMeanSquares=t.slice(0,e).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedMoments=t.slice(e,e*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.centered&&(this.accumulatedMeanGrads=t.slice(e*2,e*3).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(t,e){return new t(e.learningRate,e.decay,e.momentum,e.epsilon,e.centered)}};var Jj=[Qu,Zu,Ju,ep,tp,rp,li];function GN(){for(let r of Jj)tS(r)}var mi={};qe(mi,{CompositeArrayBuffer:()=>ir,browserFiles:()=>KN,browserHTTPRequest:()=>XN,concatenateArrayBuffers:()=>uk,copyModel:()=>Sk,decodeWeights:()=>nd,encodeWeights:()=>sk,fromMemory:()=>YN,fromMemorySync:()=>iS,getLoadHandlers:()=>mk,getModelArtifactsForJSON:()=>Jp,getModelArtifactsForJSONSync:()=>_w,getModelArtifactsInfoForJSON:()=>va,getSaveHandlers:()=>lk,getWeightSpecs:()=>ad,http:()=>of,isHTTPScheme:()=>rf,listModels:()=>Ck,loadWeights:()=>qN,moveModel:()=>Ik,registerLoadRouter:()=>ck,registerSaveRouter:()=>pk,removeModel:()=>wk,weightsLoaderFactory:()=>sS,withSaveHandler:()=>QN,withSaveHandlerSync:()=>ZN});var eX=\"model\",tX=\".json\",rX=\".weights.bin\";function HN(r){return new Promise(t=>setTimeout(t)).then(r)}var lc=class r{constructor(t){if(!A().getBool(\"IS_BROWSER\"))throw new Error(\"browserDownloads() cannot proceed because the current environment is not a browser.\");t.startsWith(r.URL_SCHEME)&&(t=t.slice(r.URL_SCHEME.length)),(t==null||t.length===0)&&(t=eX),this.modelJsonFileName=t+tX,this.weightDataFileName=t+rX}async save(t){if(typeof document==\"undefined\")throw new Error(\"Browser downloads are not supported in this environment since `document` is not present\");let e=ir.join(t.weightData),o=window.URL.createObjectURL(new Blob([e],{type:\"application/octet-stream\"}));if(t.modelTopology instanceof ArrayBuffer)throw new Error(\"BrowserDownloads.save() does not support saving model topology in binary formats yet.\");{let n=[{paths:[\"./\"+this.weightDataFileName],weights:t.weightSpecs}],s=sd(t,n),a=window.URL.createObjectURL(new Blob([JSON.stringify(s)],{type:\"application/json\"})),i=this.modelJsonAnchor==null?document.createElement(\"a\"):this.modelJsonAnchor;if(i.download=this.modelJsonFileName,i.href=a,await HN(()=>i.dispatchEvent(new MouseEvent(\"click\"))),t.weightData!=null){let p=this.weightDataAnchor==null?document.createElement(\"a\"):this.weightDataAnchor;p.download=this.weightDataFileName,p.href=o,await HN(()=>p.dispatchEvent(new MouseEvent(\"click\")))}return{modelArtifactsInfo:va(t)}}}};lc.URL_SCHEME=\"downloads://\";var rS=class{constructor(t){if(t==null||t.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${t}`);this.jsonFile=t[0],this.weightsFiles=t.slice(1)}async load(){return new Promise((t,e)=>{let o=new FileReader;o.onload=n=>{let s=JSON.parse(n.target.result),a=s.modelTopology;if(a==null){e(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(s.weightsManifest==null){e(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){t({modelTopology:a});return}let p=Jp(s,u=>this.loadWeights(u));t(p)},o.onerror=n=>e(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),o.readAsText(this.jsonFile)})}loadWeights(t){let e=[],o=[];for(let a of t)e.push(...a.weights),o.push(...a.paths);let n=this.checkManifestAndWeightFiles(t),s=o.map(a=>this.loadWeightsFile(a,n[a]));return Promise.all(s).then(a=>[e,a])}loadWeightsFile(t,e){return new Promise((o,n)=>{let s=new FileReader;s.onload=a=>{let i=a.target.result;o(i)},s.onerror=a=>n(`Failed to weights data from file of path '${t}'.`),s.readAsArrayBuffer(e)})}checkManifestAndWeightFiles(t){let e=[],o=this.weightsFiles.map(s=>Tw(s.name)),n={};for(let s of t)s.paths.forEach(a=>{let i=Tw(a);if(e.indexOf(i)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${i}'`);if(e.push(i),o.indexOf(i)===-1)throw new Error(`Weight file with basename '${i}' is not provided.`);n[a]=this.weightsFiles[o.indexOf(i)]});if(e.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${e.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}},oX=r=>A().getBool(\"IS_BROWSER\")&&!Array.isArray(r)&&r.startsWith(lc.URL_SCHEME)?nX(r.slice(lc.URL_SCHEME.length)):null;qt.registerSaveRouter(oX);function nX(r=\"model\"){return new lc(r)}function KN(r){return new rS(r)}function oS(r,t,e,o){a(r),e=e==null?0:e,o=o==null?1:o,i(e,o);let n=0,s=p=>(p.then(u=>{let c=e+ ++n/r.length*(o-e);return t(c),u}),p);function a(p){$(p!=null&&Array.isArray(p)&&p.length>0,()=>\"promises must be a none empty array\")}function i(p,u){$(p>=0&&p<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${p}`),$(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),$(u>=p,()=>`startFraction must be no more than endFraction, but got startFraction ${p} and endFraction ${u}`)}return Promise.all(r.map(s))}async function nS(r,t){t==null&&(t={});let e=t.fetchFunc==null?A().platform.fetch:t.fetchFunc,o=r.map(l=>e(l,t.requestInit,{isBinary:!0})),n=0,s=.5,i=(t.onProgress==null?await Promise.all(o):await oS(o,t.onProgress,n,s)).map(l=>l.arrayBuffer()),p=.5,u=1;return t.onProgress==null?await Promise.all(i):await oS(i,t.onProgress,p,u)}async function qN(r,t=\"\",e,o){return sS(a=>nS(a,{requestInit:o}))(r,t,e)}function sS(r){return async(t,e=\"\",o)=>{let n=t.map(()=>!1),s={},a=o!=null?o.map(()=>!1):[],i=[];if(t.forEach((d,f)=>{let h=0;d.weights.forEach(g=>{let x=\"quantization\"in g?g.quantization.dtype:g.dtype,b=Cl[x]*He(g.shape),C=()=>{n[f]=!0,s[f]==null&&(s[f]=[]),s[f].push({manifestEntry:g,groupOffset:h,sizeBytes:b})};o!=null?o.forEach((S,k)=>{S===g.name&&(C(),a[k]=!0)}):C(),i.push(g.name),h+=b})}),!a.every(d=>d)){let d=o.filter((f,h)=>!a[h]);throw new Error(`Could not find weights in manifest with names: ${d.join(\", \")}. \nManifest JSON has weights with names: ${i.join(\", \")}.`)}let p=n.reduce((d,f,h)=>(f&&d.push(h),d),[]),u=[];p.forEach(d=>{t[d].paths.forEach(f=>{let h=e+(e.endsWith(\"/\")?\"\":\"/\")+f;u.push(h)})});let c=await r(u),l={},m=0;return p.forEach(d=>{let f=t[d].paths.length,h=new ir(c.slice(m,m+f));s[d].forEach(x=>{let b=h.slice(x.groupOffset,x.groupOffset+x.sizeBytes),C=nd(b,[x.manifestEntry]);for(let S in C)l[S]=C[S]}),m+=f}),l}}var sX=\"application/octet-stream\",aX=\"application/json\",El=class{constructor(t,e){if(this.DEFAULT_METHOD=\"POST\",e==null&&(e={}),this.weightPathPrefix=e.weightPathPrefix,this.onProgress=e.onProgress,this.weightUrlConverter=e.weightUrlConverter,e.fetchFunc!=null?($(typeof e.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=e.fetchFunc):this.fetch=A().platform.fetch,$(t!=null&&t.length>0,()=>\"URL path for http must not be null, undefined or empty.\"),Array.isArray(t)&&$(t.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${t.length}).`),this.path=t,e.requestInit!=null&&e.requestInit.body!=null)throw new Error(\"requestInit is expected to have no pre-existing body, but has one.\");this.requestInit=e.requestInit||{}}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error(\"BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.\");let e=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);e.body=new FormData;let o=[{paths:[\"./model.weights.bin\"],weights:t.weightSpecs}],n=sd(t,o);if(e.body.append(\"model.json\",new Blob([JSON.stringify(n)],{type:aX}),\"model.json\"),t.weightData!=null){let a=ir.join(t.weightData);e.body.append(\"model.weights.bin\",new Blob([a],{type:sX}),\"model.weights.bin\")}let s=await this.fetch(this.path,e);if(s.ok)return{modelArtifactsInfo:va(t),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async load(){let t=await this.fetch(this.path,this.requestInit);if(!t.ok)throw new Error(`Request to ${this.path} failed with status code ${t.status}. Please verify this URL points to the model JSON of the model to load.`);let e;try{e=await t.json()}catch(s){let a=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(\".pb\")?a+=\" 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.\":a+=\" Please make sure the server is serving valid JSON for this request.\",new Error(a)}let o=e.modelTopology,n=e.weightsManifest;if(o==null&&n==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return Jp(e,s=>this.loadWeights(s))}async loadWeights(t){let e=Array.isArray(this.path)?this.path[1]:this.path,[o,n]=iX(e),s=this.weightPathPrefix||o,a=ad(t),i=[],p=[];for(let c of t)for(let l of c.paths)this.weightUrlConverter!=null?p.push(this.weightUrlConverter(l)):i.push(s+l+n);this.weightUrlConverter&&i.push(...await Promise.all(p));let u=await nS(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[a,u]}};El.URL_SCHEME_REGEX=/^https?:\\/\\//;function iX(r){let t=r.lastIndexOf(\"/\"),e=r.lastIndexOf(\"?\"),o=r.substring(0,t),n=e>t?r.substring(e):\"\";return[o+\"/\",n]}function rf(r){return r.match(El.URL_SCHEME_REGEX)!=null}var jN=(r,t)=>{if(typeof fetch==\"undefined\"&&(t==null||t.fetchFunc==null))return null;{let e=!0;if(Array.isArray(r)?e=r.every(o=>rf(o)):e=rf(r),e)return of(r,t)}return null};qt.registerSaveRouter(jN);qt.registerLoadRouter(jN);function of(r,t){return new El(r,t)}function XN(r,t){return of(r,t)}var Rl=class{constructor(t){this.modelArtifacts=t}load(){return this.modelArtifacts}},nf=class{constructor(t){this.saveHandler=t}save(t){return this.saveHandler(t)}},aS=class{constructor(t){t.load&&(this.load=()=>Promise.resolve(t.load())),t.save&&(this.save=e=>Promise.resolve(t.save(e)))}};function YN(r,t,e,o){let n=arguments;return new aS(iS(...n))}function iS(r,t,e,o){return arguments.length===1?r.modelTopology!=null||r.weightSpecs!=null?new Rl(r):(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 Rl({modelTopology:r})):(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 Rl({modelTopology:r,weightSpecs:t,weightData:e,trainingConfig:o}))}function QN(r){return new nf(r)}function ZN(r){return new nf(r)}var eT={};qe(eT,{confusionMatrix:()=>JN});function uX(r,t,e){let o=v(r,\"labels\",\"confusionMatrix\"),n=v(t,\"predictions\",\"confusionMatrix\");$(e==null||e>0&&Number.isInteger(e),()=>`If provided, numClasses must be a positive integer, but got ${e}`),$(o.rank===1,()=>`Expected the rank of labels to be 1, but got ${o.rank}`),$(n.rank===1,()=>`Expected the rank of predictions to be 1, but got ${n.rank}`),$(o.shape[0]===n.shape[0],()=>`Mismatch in the number of examples: ${o.shape[0]} vs. ${n.shape[0]}. Labels and predictions should have the same number of elements.`),$(e>0&&Number.isInteger(e),()=>`numClasses is required to be a positive integer, but got ${e}`);let s=Tl(We(o,\"int32\"),e),a=Tl(We(n,\"int32\"),e),i=cc(s),p=Ze(i,a);return We(p,\"int32\")}var JN=N({confusionMatrix_:uX});var nT={};qe(nT,{draw:()=>gX,fromPixels:()=>xX,fromPixelsAsync:()=>dX,toPixels:()=>hX});var op,tT=!1;function rT(r,t=3){if(t>4)throw new Error(\"Cannot construct Tensor with more than 4 channels from pixels.\");if(r==null)throw new Error(\"pixels passed to tf.browser.fromPixels() can not be null\");let e=!1,o=!1,n=!1,s=!1,a=!1,i=!1;if(r.data instanceof Uint8Array)e=!0;else if(typeof ImageData!=\"undefined\"&&r instanceof ImageData)o=!0;else if(typeof HTMLVideoElement!=\"undefined\"&&r instanceof HTMLVideoElement)n=!0;else if(typeof HTMLImageElement!=\"undefined\"&&r instanceof HTMLImageElement)s=!0;else if(r.getContext!=null)a=!0;else if(typeof ImageBitmap!=\"undefined\"&&r instanceof ImageBitmap)i=!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 ${r.constructor.name}`);if(qp(Eu,T.backendName)!=null){let f={pixels:r},h={numChannels:t};return T.runKernel(Eu,f,h)}let[u,c]=n?[r.videoWidth,r.videoHeight]:[r.width,r.height],l;if(a)l=r.getContext(\"2d\").getImageData(0,0,u,c).data;else if(o||e)l=r.data;else if(s||n||i){if(op==null)if(typeof document==\"undefined\")if(typeof OffscreenCanvas!=\"undefined\"&&typeof OffscreenCanvasRenderingContext2D!=\"undefined\")op=new OffscreenCanvas(1,1).getContext(\"2d\");else throw new Error(\"Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.\");else op=document.createElement(\"canvas\").getContext(\"2d\",{willReadFrequently:!0});op.canvas.width=u,op.canvas.height=c,op.drawImage(r,0,0,u,c),l=op.getImageData(0,0,u,c).data}let m;if(t===4)m=new Int32Array(l);else{let f=u*c;m=new Int32Array(f*t);for(let h=0;h4||t===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if(r.dtype!==\"float32\"&&r.dtype!==\"int32\")throw new Error(`Unsupported type for toPixels: ${r.dtype}. Please use float32 or int32 tensors.`)}function fX(r){let t=(r==null?void 0:r.alpha)||1;if(t>1||t<0)throw new Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}async function hX(r,t){let e=v(r,\"img\",\"toPixels\");if(!(r instanceof mt)){let u=e;e=We(u,\"int32\"),u.dispose()}oT(e);let[o,n]=e.shape.slice(0,2),s=e.rank===2?1:e.shape[2],a=await e.data(),i=e.dtype===\"float32\"?255:1,p=new Uint8ClampedArray(n*o*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${d}.`)}else if(e.dtype===\"int32\"&&(d<0||d>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${d}.`);s===1?(c[0]=d*i,c[1]=d*i,c[2]=d*i):c[m]=d*i}let l=u*4;p[l+0]=Math.round(c[0]),p[l+1]=Math.round(c[1]),p[l+2]=Math.round(c[2]),p[l+3]=Math.round(c[3])}if(t!=null){tT||qp(_u,T.backendName)!=null&&(console.warn(\"tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead.\"),tT=!0),t.width=n,t.height=o;let u=t.getContext(\"2d\"),c=new ImageData(p,n,o);u.putImageData(c,0,0)}return e!==r&&e.dispose(),p}function gX(r,t,e){let o=v(r,\"img\",\"draw\");if(!(r instanceof mt)){let a=o;o=We(a,\"int32\"),a.dispose()}oT(o),fX(e==null?void 0:e.imageOptions);let n={image:o},s={canvas:t,options:e};T.runKernel(_u,n,s)}var xX=N({fromPixels_:rT});var sf={};qe(sf,{prepareAndValidate:()=>sT});function sT(r,t){let e=r.shape.length,o=t.shape.length;if(e<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${e}.`);if(o<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${o}.`);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[o-1]>e)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[o-1]} vs. ${e}`);if(He(r.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${r.shape}.`);let n=t.shape,s=n[n.length-1],a=1;for(let l=0;ll/u),1].slice(0,s);return[p,a,u,c]}var pt={};qe(pt,{assertParamsValid:()=>bX,computeFlatOffset:()=>vX,computeOutShape:()=>wX,getNormalizedAxes:()=>SX,isSliceContinous:()=>IX,maskToAxes:()=>CX,parseSliceParams:()=>kX,sliceInfo:()=>NX,startForAxis:()=>dT,startIndicesWithElidedDims:()=>cT,stopForAxis:()=>fT,stopIndicesWithElidedDims:()=>lT,stridesForAxis:()=>mT,stridesWithElidedDims:()=>iT});var uS=-2,yX=-1;function bX(r,t,e){let o=r.shape.length;$(o===t.length,()=>`Error in slice${o}D: Length of begin ${t} must match the rank of the array (${o}).`),$(o===e.length,()=>`Error in slice${o}D: Length of size ${e} must match the rank of the array (${o}).`);for(let n=0;n`Error in slice${o}D: begin[${n}] + size[${n}] (${t[n]+e[n]}) would overflow input.shape[${n}] (${r.shape[n]})`)}function CX(r){let t=[],e=0;for(;r>0;)r&1&&t.push(e),r/=2,e++;return t}function wX(r,t,e){let o=[];for(let n=0;n0){let d=t[0],f=e+1;c=cT(a,d,f,o,r),l=lT(i,d,f,n,r),m=iT(s,d,f,r)}else for(let d=0;d-1)s[i]=0;else{let p=uT(t,e,i),u=o[p];r&1<-1)s[i]=Number.MAX_SAFE_INTEGER;else{let p=uT(t,e,i),u=o[p];r&1<0?a=Number.MIN_SAFE_INTEGER:a=Number.MAX_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),a=Bp(0,a,p-1),a}function fT(r,t,e,o,n,s){let a=t[n],i=e[n]||1;(r&1<0?a=Number.MAX_SAFE_INTEGER:a=Number.MIN_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),i>0?a=Bp(0,a,p):a=Bp(-1,a,p-1),a}function IX(r,t,e){let o=e.length;for(let n=0;n1){o=n;break}for(let n=o+1;n0||e[n]!==r[n])return!1;return!0}function vX(r,t){let e=r.length>0?r[r.length-1]:1;for(let o=0;o{$(a!==-1,()=>\"slice() does not support negative begin indexing.\")});let s;return e==null?s=new Array(n).fill(-1):typeof e==\"number\"?s=[e,...new Array(n-1).fill(-1)]:e.lengtha>=0?a:($(a===-1,()=>`Negative size values should be exactly -1 but got ${a} for the slice() size at index ${i}.`),r.shape[i]-o[i])),[o,s]}function NX(r,t,e,o,n,s,a,i,p){let u;if(o==null?(u=new Array(t.length),u.fill(1)):u=o,a!=null&&a&a-1)throw new Error(\"Multiple ellipses in slice is not allowed.\");let c=!1,l={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:e.slice(),strides:u.slice(),beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};for(let C=0;C0?0:-1,m.strides[C]>0?k:k-1];if(S&&m.strides[C]<=0)throw Error(\"only stride 1 allowed on non-range indexing.\");h=h&&m.strides[C]===1;let R=!!(m.beginMask&1<=k)throw Error(`slice index ${m.begin[C]} of dimension ${C} out of bounds.`)}else m.begin[C]=aT(m.begin[C],0,m.strides[C],k,_,E),m.end[C]=aT(m.end[C],1,m.strides[C],k,_,E);let O=m.strides[C]===1&&m.begin[C]===0&&m.end[C]===k;d=d&&O,f=f&&(C===0&&m.strides[C]===1||O)}else d=d&&m.strides[C]===1&&R,f=f&&(C===0&&m.strides[C]===1||R);let D,P=!1;if(m.beginValid&&m.endValid?(D=m.end[C]-m.begin[C],P=!0):S?(D=1,P=!0):R&&k>=0&&(m.strides[C]<0?D=-k:D=k,P=!0),P){let O;D===0||D<0!=m.strides[C]<0?O=0:O=Math.trunc(D/m.strides[C])+(D%m.strides[C]!==0?1:0),g.push(O)}else g.push(-1)}for(let C=0;C=0?x.push(g[S]):S===uS&&x.push(1)}return{finalShapeSparse:x.filter((C,S)=>m.finalShapeGatherIndices[S]!==uS),finalShape:x,isIdentity:d,sliceDim0:f,isSimpleSlice:h,begin:m.begin,end:m.end,strides:m.strides}}function TX(r,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let e=0;t.beginValid=r.begin!=null,t.endValid=r.end!=null,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let o=0;o0?s[t]:s[t+1&1];{let a=r<0?o+r:r;return as[1]?s[1]:a}}var _X=\"4.14.0\";var Dl=class{static sgd(t){return new li(t)}static momentum(t,e,o=!1){return new tp(t,e,o)}static rmsprop(t,e=.9,o=0,n=null,s=!1){return new rp(t,e,o,n,s)}static adam(t=.001,e=.9,o=.999,n=null){return new Ju(t,e,o,n)}static adadelta(t=.001,e=.95,o=null){return new Qu(t,e,o)}static adamax(t=.002,e=.9,o=.999,n=null,s=0){return new ep(t,e,o,n,s)}static adagrad(t,e=.1){return new Zu(t,e)}};var TGe=Dl;var $X=typeof requestAnimationFrame!=\"undefined\"?requestAnimationFrame:typeof setImmediate!=\"undefined\"?setImmediate:r=>r();function pS(){return new Promise(r=>$X(()=>r()))}var w={};qe(w,{ERF_A1:()=>KX,ERF_A2:()=>qX,ERF_A3:()=>jX,ERF_A4:()=>XX,ERF_A5:()=>YX,ERF_P:()=>HX,PARALLELIZE_THRESHOLD:()=>af,RowPartitionType:()=>Fa,SELU_SCALE:()=>GX,SELU_SCALEALPHA:()=>UX,applyActivation:()=>Xu,assertAndGetBroadcastShape:()=>rt,assertAxesAreInnerMostDims:()=>tK,assertParamsConsistent:()=>EX,assignToTypedArray:()=>r5,axesAreInnerMostDims:()=>Bw,calculateShapes:()=>W1,checkEinsumDimSizes:()=>u5,checkPadOnDimRoundingMode:()=>Lt,combineLocations:()=>y2,combineRaggedTensorToTensorShapes:()=>DX,complexWithEvenIndex:()=>JX,complexWithOddIndex:()=>e5,computeConv2DInfo:()=>Lu,computeConv3DInfo:()=>Lk,computeDefaultPad:()=>Lw,computeDilation2DInfo:()=>J4,computeOptimalWindowSize:()=>OX,computeOutAndReduceShapes:()=>eK,computeOutShape:()=>RX,computePool2DInfo:()=>Mw,computePool3DInfo:()=>eH,convertConv2DDataFormat:()=>Bk,decodeEinsumEquation:()=>a5,eitherStridesOrDilationsAreOne:()=>gr,expandShapeToKeepDim:()=>ai,exponent:()=>n5,exponents:()=>o5,fromStringArrayToUint8:()=>$5,fromUint8ToStringArray:()=>_5,getAxesPermutation:()=>rK,getBroadcastDims:()=>d2,getComplexWithIndex:()=>t5,getEinsumComputePath:()=>p5,getEinsumPermutation:()=>i5,getFusedBiasGradient:()=>ju,getFusedDyActivation:()=>qu,getImageCenter:()=>MX,getInnerMostAxes:()=>nK,getPermuted:()=>BX,getRaggedRank:()=>FX,getReductionAxes:()=>gd,getReshaped:()=>LX,getReshapedPermuted:()=>zX,getRowPartitionTypesHelper:()=>AX,getSliceBeginCoords:()=>VX,getSliceSize:()=>WX,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>d5,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>f5,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>h5,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>y5,getSparseReshapeInputOutputMismatchErrorMessage:()=>C5,getSparseReshapeInputOutputMultipleErrorMessage:()=>b5,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>g5,getSparseReshapeNegativeOutputDimErrorMessage:()=>x5,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>v5,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>w5,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>S5,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>I5,getUndoAxesPermutation:()=>oK,isIdentityPermutation:()=>c5,log:()=>XG,mergeRealAndImagArrays:()=>QX,prepareAndValidate:()=>sT,prepareSplitSize:()=>m5,segment_util:()=>lS,shouldFuse:()=>Yu,slice_util:()=>pt,splitRealAndImagArrays:()=>ZX,stridesOrDilationsArePositive:()=>Ta,tupleValuesAreOne:()=>Mu,upcastType:()=>dt,validateDefaultValueShape:()=>PX,validateInput:()=>pc,validateUpdateShape:()=>Yw,warn:()=>Ia});function EX(r,t){let e=r[0].length;r.forEach((n,s)=>{$(n.length===e,()=>`Error in concat${e}D: rank of tensors[${s}] must be the same as the rank of the rest (${e})`)}),$(t>=0&&t`Error in concat${e}D: axis must be between 0 and ${e-1}.`);let o=r[0];r.forEach((n,s)=>{for(let a=0;a`Error in concat${e}D: Shape of tensors[${s}] (${n}) does not match the shape of the rest (${o}) along the non-concatenated axis ${s}.`)})}function RX(r,t){let e=r[0].slice();for(let o=1;o=0)if(i>=0){if(i!==s)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${n+r}] = ${s} but shape[${n+r}] = ${i}`)}else o[a]=s}return o}function AX(r){let t={FIRST_DIM_SIZE:Fa.FIRST_DIM_SIZE,VALUE_ROWIDS:Fa.VALUE_ROWIDS,ROW_LENGTHS:Fa.ROW_LENGTHS,ROW_SPLITS:Fa.ROW_SPLITS,ROW_LIMITS:Fa.ROW_LIMITS,ROW_STARTS:Fa.ROW_STARTS},e=[];for(let o of r)if(o in t)e.push(t[o]);else break;return e}function FX(r){return r.length===0?0:r[0]===Fa.FIRST_DIM_SIZE?r.length-1:r.length}function PX(r,t){if(r==null||t==null)return;let e=r.length,o=t.length;if(e>=o)throw new Error(`defaultValue.shape=${r} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${e} must be less than ragged tensor input flatValues.rank = ${o})`);for(let n=0;n=0&&a>=0&&s!==1&&s!==a)throw new Error(`defaultValue.shape=${r}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${n-r.length}] = ${s} but ragged tensor input.flatValues.shape[${n-r.length}] = ${a}`)}}var af=30;function OX(r){return r<=af?r:Vp(r,Math.floor(Math.sqrt(r)))}function MX(r,t,e){let o=e*(typeof r==\"number\"?r:r[0]),n=t*(typeof r==\"number\"?r:r[1]);return[o,n]}function LX(r,t,e,o=!0){let n=[];if(o)n=n.concat(t.slice(0)),n.push(r[0]/e),n=n.concat(r.slice(1));else{n=n.concat(r[0]);let s=t.length;for(let a=0;a=t*2+1||a%2===1?s.push(a):n.push(a);o.push(...n),o.push(0),o.push(...s)}return o}function zX(r,t,e,o=!0){let n=[];o?n.push(r[0]/e):n.push(r[0]*e);for(let s=1;s\",s5=/->/g,hT=\",\",gT=\"...\";function a5(r,t){r=r.replace(/\\s/g,\"\");let e=(r.length-r.replace(s5,\"\").length)/cS.length;if(e<1)throw new Error(\"Equations without an arrow are not supported.\");if(e>1)throw new Error(`Equation must contain exactly one arrow (\"${cS}\").`);let[o,n]=r.split(cS);$(o.indexOf(gT)===-1,()=>`The ellipsis notation (\"${gT}\") is not supported yet.`);let s=o.split(hT),a=s.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>2)throw new Error(\"Support for more than 2 input tensors is not implemented yet.\");let i=[];for(let m=0;mf.indexOf(d)!==-1))throw new Error(`Output subscripts contain the label ${d} not present in the input subscripts.`);i.indexOf(d)===-1&&i.push(d)}for(let m=0;mn!==-1),{permutationIndices:e,expandDims:o}}function u5(r,t,e){let o=new Array(r);for(let n=0;n`Expected dimension ${o[t[n][a]]} at axis ${a} of input shaped ${JSON.stringify(s)}, but got dimension ${s[a]}`)}}function p5(r,t){let e=r,o=[],n=0;r.length===0&&e.push(-1),n=r.length+1;for(let a=0;at===e)}function l5(r,t){let e=[];for(let o=0;o\"Number of splits must evenly divide the axis.\"),o=new Array(t).fill(r.shape[e]/t);else{let n=t.reduce((a,i)=>(i===-1&&(a+=1),a),0);$(n<=1,()=>\"There should be only one negative value in split array.\");let s=t.indexOf(-1);if(s!==-1){let a=t.reduce((i,p)=>p>0?i+p:i);t[s]=r.shape[e]-a}$(r.shape[e]===t.reduce((a,i)=>a+i),()=>\"The sum of sizes must match the size of the axis dimension.\"),o=t}return o}function d5(r){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${r}`}function f5(r,t){return`indices(${r}, 0) is invalid: ${t} < 0`}function h5(r,t,e){return`indices(${r}, 0) is invalid: ${t} >= ${e}`}function g5(r,t){return`only one output dimension may be -1, not both ${r} and ${t}`}function x5(r,t){return`size ${r} must be non-negative, not ${t}`}function y5(){return\"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero\"}function b5(r,t){let e=He(r),o=He(t);return`Input to reshape is a SparseTensor with ${e}\n dense values, but the requested shape requires a multiple of ${o}. inputShape=${r} outputShape= ${t}`}function C5(r,t){let e=He(r),o=He(t);return`Input to reshape is a tensor with ${e} dense values, but the requested shape has ${o}. inputShape=${r} outputShape=${t}`}function w5(){return\"segment ids must be >= 0\"}function S5(){return\"segment ids are not increasing\"}function I5(r,t){return`Segment id ${r} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function v5(r,t,e){return`Bad: indices[${r}] == ${t} out of range [0, ${e})`}var lS={};qe(lS,{collectGatherOpShapeInfo:()=>T5,computeOutShape:()=>N5,segOpComputeOptimalWindowSize:()=>k5});function k5(r,t){let e=!1,o;for(r<=af?(o=r,e=!0):o=Vp(r,Math.floor(Math.sqrt(r)));!e;)o>t||o===r?e=!0:o=Vp(r,o+1);return o}function N5(r,t,e){let o=[],n=r.length;for(let s=0;sn))throw new Error(`Expect batchDims in the range of [-${n}, ${n}], but got ${o}`);if(o<0&&(o+=n),o>s)throw new Error(`batchDims (${o}) must be less than rank(x) (\n ${s}).`);if(eQp(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function $5(r){return r.map(t=>Zi(t))}var Vt={};qe(Vt,{nonMaxSuppressionV3Impl:()=>Zd,nonMaxSuppressionV4Impl:()=>Jd,nonMaxSuppressionV5Impl:()=>ef,whereImpl:()=>jd});GN();var E5=A();E5.registerFlag(\"KEEP_INTERMEDIATE_TENSORS\",()=>!1,r=>{r&&console.warn(\"Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.\")});var fo;(function(r){r[r.DT_INVALID=0]=\"DT_INVALID\",r[r.DT_FLOAT=1]=\"DT_FLOAT\",r[r.DT_DOUBLE=2]=\"DT_DOUBLE\",r[r.DT_INT32=3]=\"DT_INT32\",r[r.DT_UINT8=4]=\"DT_UINT8\",r[r.DT_INT16=5]=\"DT_INT16\",r[r.DT_INT8=6]=\"DT_INT8\",r[r.DT_STRING=7]=\"DT_STRING\",r[r.DT_COMPLEX64=8]=\"DT_COMPLEX64\",r[r.DT_INT64=9]=\"DT_INT64\",r[r.DT_BOOL=10]=\"DT_BOOL\",r[r.DT_QINT8=11]=\"DT_QINT8\",r[r.DT_QUINT8=12]=\"DT_QUINT8\",r[r.DT_QINT32=13]=\"DT_QINT32\",r[r.DT_BFLOAT16=14]=\"DT_BFLOAT16\",r[r.DT_QINT16=15]=\"DT_QINT16\",r[r.DT_QUINT16=16]=\"DT_QUINT16\",r[r.DT_UINT16=17]=\"DT_UINT16\",r[r.DT_COMPLEX128=18]=\"DT_COMPLEX128\",r[r.DT_HALF=19]=\"DT_HALF\",r[r.DT_RESOURCE=20]=\"DT_RESOURCE\",r[r.DT_VARIANT=21]=\"DT_VARIANT\",r[r.DT_UINT32=22]=\"DT_UINT32\",r[r.DT_UINT64=23]=\"DT_UINT64\",r[r.DT_FLOAT_REF=101]=\"DT_FLOAT_REF\",r[r.DT_DOUBLE_REF=102]=\"DT_DOUBLE_REF\",r[r.DT_INT32_REF=103]=\"DT_INT32_REF\",r[r.DT_UINT8_REF=104]=\"DT_UINT8_REF\",r[r.DT_INT16_REF=105]=\"DT_INT16_REF\",r[r.DT_INT8_REF=106]=\"DT_INT8_REF\",r[r.DT_STRING_REF=107]=\"DT_STRING_REF\",r[r.DT_COMPLEX64_REF=108]=\"DT_COMPLEX64_REF\",r[r.DT_INT64_REF=109]=\"DT_INT64_REF\",r[r.DT_BOOL_REF=110]=\"DT_BOOL_REF\",r[r.DT_QINT8_REF=111]=\"DT_QINT8_REF\",r[r.DT_QUINT8_REF=112]=\"DT_QUINT8_REF\",r[r.DT_QINT32_REF=113]=\"DT_QINT32_REF\",r[r.DT_BFLOAT16_REF=114]=\"DT_BFLOAT16_REF\",r[r.DT_QINT16_REF=115]=\"DT_QINT16_REF\",r[r.DT_QUINT16_REF=116]=\"DT_QUINT16_REF\",r[r.DT_UINT16_REF=117]=\"DT_UINT16_REF\",r[r.DT_COMPLEX128_REF=118]=\"DT_COMPLEX128_REF\",r[r.DT_HALF_REF=119]=\"DT_HALF_REF\",r[r.DT_RESOURCE_REF=120]=\"DT_RESOURCE_REF\",r[r.DT_VARIANT_REF=121]=\"DT_VARIANT_REF\",r[r.DT_UINT32_REF=122]=\"DT_UINT32_REF\",r[r.DT_UINT64_REF=123]=\"DT_UINT64_REF\"})(fo||(fo={}));var xT;(function(r){let t;(function(e){e[e.LEGACY=0]=\"LEGACY\",e[e.V1=1]=\"V1\",e[e.V2=2]=\"V2\"})(t=r.CheckpointFormatVersion||(r.CheckpointFormatVersion={}))})(xT||(xT={}));var dS={};function D5(r,t){let e={tfOpName:r,category:\"custom\",inputs:[],attrs:[],customExecutor:t};dS[r]=e}function uf(r){return dS[r]}function A5(r){delete dS[r]}function I(r,t,e,o,n){let s=t.inputParams[r];if(s&&s.inputIndexStart!==void 0){let i=s.inputIndexStart,p=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?i+1:s.inputIndexEnd,u=i<0?t.inputNames.length+i:i;if(s.type===\"tensor\")return Bt(t.inputNames[u],e,o,n);if(s.type===\"tensors\"){let m=t.inputs.slice(i,p);return t.inputNames.slice(i,p).filter((f,h)=>{var g;return((g=m[h])===null||g===void 0?void 0:g.op)!==\"NoOp\"}).map(f=>Bt(f,e,o,n))}let c=Bt(t.inputNames[u],e,o,n),l=c.dataSync();return s.type===\"number\"?l[0]:y.toNestedArray(c.shape,l)}let a=t.attrParams[r];return a&&a.value}function Bt(r,t,e,o){let[n,s]=Nr(r,e);if(o!=null){let i=o.getHashTableHandleByName(n);if(i!=null)return i}let a=e.currentContextIds.find(i=>!!t[pf(n,i)]);return a!==void 0?t[pf(n,a)][s]:void 0}function fS(r,t,e){return t[pf(r,e.currentContextId)]}function Ls(r,t){let[e,o,n]=Nr(r,t);return[pf(e,t&&t.currentContextId),o,n]}function pf(r,t){return t?`${r}-${t}`:r}function Nr(r,t){if(r===\"\")return[\"\",0,void 0];let e=t!=null&&t.parseNodeNameCache!=null;if(e){let s=t.parseNodeNameCache.get(r);if(s!=null)return s}let o=r.split(\":\"),n;if(o.length===1)n=[r,0,void 0];else{let s=o[0],a=o.length===3?o[1]:void 0,i=Number(o[o.length-1]);n=[s,i,a]}return e&&t.parseNodeNameCache.set(r,n),n}function Al(r,t,e){let o=I(\"pad\",r,t,e);if(o===\"explicit\"){o=I(\"explicitPaddings\",r,t,e);let n=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)n[s][0]=o[s*2],n[s][1]=o[s*2+1];return n}return o}function Bs(r){return r.kept?r:Wr(r)}var hS={};qe(hS,{json:()=>F5});var F5=[{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}]}];var gS={};qe(gS,{json:()=>P5});var P5=[{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:\"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}]},{tfOpName:\"IsFinite\",category:\"basic_math\",inputs:[{start:0,name:\"x\",type:\"tensor\"}],attrs:[{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]},{tfOpName:\"IsInf\",category:\"basic_math\",inputs:[{start:0,name:\"x\",type:\"tensor\"}],attrs:[{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]}];var xS={};qe(xS,{json:()=>O5});var O5=[{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:\"TensorListConcatV2\",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\"}]},{tfOpName:\"TensorListLength\",category:\"control\",inputs:[{start:0,name:\"tensorListId\",type:\"tensor\"}]},{tfOpName:\"TensorListResize\",category:\"control\",inputs:[{start:0,name:\"tensorListId\",type:\"tensor\"},{start:1,name:\"size\",type:\"number\"}]}];var yS={};qe(yS,{json:()=>M5});var M5=[{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\",defaultValue:.2}]},{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\"}]}];var bS={};qe(bS,{json:()=>L5});var L5=[{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\"}]},{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:\"RandomStandardNormal\",category:\"creation\",inputs:[{start:0,name:\"shape\",type:\"number[]\"}],attrs:[{tfName:\"seed\",name:\"seed\",type:\"number\",defaultValue:0},{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:\"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:\"RandomUniformInt\",category:\"creation\",inputs:[{start:0,name:\"shape\",type:\"number[]\"}],attrs:[{tfName:\"minval\",name:\"minval\",type:\"number\"},{tfName:\"maxval\",name:\"maxval\",type:\"number\"},{tfName:\"seed\",name:\"seed\",type:\"number\",defaultValue:0},{tfName:\"seed2\",name:\"seed2\",type:\"number\",defaultValue:0,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\"}]}];var CS={};qe(CS,{json:()=>B5});var B5=[{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}]}];var wS={};qe(wS,{json:()=>z5});var z5=[{tfOpName:\"LowerBound\",category:\"evaluation\",inputs:[{start:0,name:\"sortedSequence\",type:\"tensor\"},{start:1,name:\"values\",type:\"tensor\"}]},{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:\"UpperBound\",category:\"evaluation\",inputs:[{start:0,name:\"sortedSequence\",type:\"tensor\"},{start:1,name:\"values\",type:\"tensor\"}]},{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\"}]}];var SS={};qe(SS,{json:()=>V5});var V5=[{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\"}]}];var IS={};qe(IS,{json:()=>W5});var W5=[{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\"}]},{tfOpName:\"InitializeTable\",category:\"hash_table\",inputs:[{start:0,name:\"tableHandle\",type:\"tensor\"},{start:1,name:\"keys\",type:\"tensor\"},{start:2,name:\"values\",type:\"tensor\"}]},{tfOpName:\"InitializeTableV2\",category:\"hash_table\",inputs:[{start:0,name:\"tableHandle\",type:\"tensor\"},{start:1,name:\"keys\",type:\"tensor\"},{start:2,name:\"values\",type:\"tensor\"}]}];var vS={};qe(vS,{json:()=>U5});var U5=[{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\"}]},{tfOpName:\"ImageProjectiveTransformV3\",category:\"image\",inputs:[{start:0,name:\"images\",type:\"tensor\"},{start:1,name:\"transforms\",type:\"tensor\"},{start:2,name:\"outputShape\",type:\"number[]\"},{start:3,name:\"fillValue\",type:\"number\"}],attrs:[{tfName:\"interpolation\",name:\"interpolation\",type:\"string\"},{tfName:\"fill_mode\",name:\"fillMode\",type:\"string\"}]}];var kS={};qe(kS,{json:()=>G5});var G5=[{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}]},{tfOpName:\"BitwiseAnd\",category:\"logical\",inputs:[{start:0,name:\"x\",type:\"tensor\"},{start:1,name:\"y\",type:\"tensor\"}]}];var NS={};qe(NS,{json:()=>H5});var H5=[{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:\"leakyrelu_alpha\",name:\"leakyreluAlpha\",type:\"number\",defaultValue:.2},{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\"}]},{tfOpName:\"MatrixBandPart\",category:\"matrices\",inputs:[{start:0,name:\"a\",type:\"tensor\"},{start:1,name:\"numLower\",type:\"tensor\"},{start:1,name:\"numUpper\",type:\"tensor\"}]}];var TS={};qe(TS,{json:()=>K5});var K5=[{tfOpName:\"EuclideanNorm\",category:\"normalization\",inputs:[{start:0,name:\"x\",type:\"tensor\"},{start:1,name:\"axis\",type:\"number[]\"}],attrs:[{tfName:\"keep_dims\",name:\"keepDims\",type:\"bool\",defaultValue:!1}]},{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\"}]}];var _S={};qe(_S,{json:()=>q5});var q5=[{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\"},{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]},{tfOpName:\"Cumprod\",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\"}]},{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\"}]}];var $S={};qe($S,{json:()=>j5});var j5=[{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}]},{tfOpName:\"TensorScatterUpdate\",category:\"slice_join\",inputs:[{start:0,name:\"tensor\",type:\"tensor\"},{start:1,name:\"indices\",type:\"tensor\"},{start:2,name:\"values\",type:\"tensor\"}]}];var ES={};qe(ES,{json:()=>X5});var X5=[{tfOpName:\"SparseFillEmptyRows\",category:\"sparse\",inputs:[{start:0,name:\"indices\",type:\"tensor\"},{start:1,name:\"values\",type:\"tensor\"},{start:2,name:\"denseShape\",type:\"tensor\"},{start:3,name:\"defaultValue\",type:\"tensor\"}]},{tfOpName:\"SparseReshape\",category:\"sparse\",inputs:[{start:0,name:\"inputIndices\",type:\"tensor\"},{start:1,name:\"inputShape\",type:\"tensor\"},{start:2,name:\"newShape\",type:\"tensor\"}],attrs:[{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]},{tfOpName:\"SparseSegmentMean\",category:\"sparse\",inputs:[{start:0,name:\"data\",type:\"tensor\"},{start:1,name:\"indices\",type:\"tensor\"},{start:2,name:\"segmentIds\",type:\"tensor\"}]},{tfOpName:\"SparseSegmentSum\",category:\"sparse\",inputs:[{start:0,name:\"data\",type:\"tensor\"},{start:1,name:\"indices\",type:\"tensor\"},{start:2,name:\"segmentIds\",type:\"tensor\"}]}];var RS={};qe(RS,{json:()=>Y5});var Y5=[{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}]}];var DS={};qe(DS,{json:()=>Q5});var Q5=[{tfOpName:\"StaticRegexReplace\",category:\"string\",inputs:[{start:0,name:\"input\",type:\"tensor\"}],attrs:[{tfName:\"pattern\",name:\"pattern\",type:\"string\"},{tfName:\"rewrite\",name:\"rewrite\",type:\"string\"},{tfName:\"replace_global\",name:\"replaceGlobal\",type:\"bool\"}]},{tfOpName:\"StringNGrams\",category:\"string\",inputs:[{start:0,name:\"data\",type:\"tensor\"},{start:1,name:\"dataSplits\",type:\"tensor\"}],attrs:[{tfName:\"separator\",name:\"separator\",type:\"string\"},{tfName:\"ngram_widths\",name:\"nGramWidths\",type:\"number[]\"},{tfName:\"left_pad\",name:\"leftPad\",type:\"string\"},{tfName:\"right_pad\",name:\"rightPad\",type:\"string\"},{tfName:\"pad_width\",name:\"padWidth\",type:\"number\"},{tfName:\"preserve_short_sequences\",name:\"preserveShortSequences\",type:\"bool\"}],outputs:[\"ngrams\",\"ngrams_splits\"]},{tfOpName:\"StringSplit\",category:\"string\",inputs:[{start:0,name:\"input\",type:\"tensor\"},{start:1,name:\"delimiter\",type:\"tensor\"}],attrs:[{tfName:\"skip_empty\",name:\"skipEmpty\",type:\"bool\"}],outputs:[\"indices\",\"values\",\"shape\"]},{tfOpName:\"StringToHashBucketFast\",category:\"string\",inputs:[{start:0,name:\"input\",type:\"tensor\"}],attrs:[{tfName:\"num_buckets\",name:\"numBuckets\",type:\"number\"}]}];var AS={};qe(AS,{json:()=>Z5});var Z5=[{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:\"EnsureShape\",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:[]},{tfOpName:\"BroadcastArgs\",category:\"transformation\",inputs:[{start:0,name:\"s0\",type:\"tensor\"},{start:1,name:\"s1\",type:\"tensor\"}],attrs:[]}];var Fl=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let t=[hS,gS,xS,yS,bS,CS,wS,SS,IS,vS,kS,NS,TS,_S,$S,ES,RS,DS,AS],e=[].concat(...t.map(o=>o.json));this.opMappers=e.reduce((o,n)=>(o[n.tfOpName]=n,o),{})}transformGraph(t,e={}){let o=t.node,n=[],s=[],a=[],i=o.reduce((h,g)=>(h[g.name]=this.mapNode(g),g.op.startsWith(\"Placeholder\")?n.push(h[g.name]):g.op===\"Const\"?s.push(h[g.name]):(g.input==null||g.input.length===0)&&a.push(h[g.name]),h),{}),p=[],u=[],c={},l={};e!=null&&(c=this.mapSignatureEntries(e.inputs),l=this.mapSignatureEntries(e.outputs));let m=Object.keys(i);m.forEach(h=>{let g=i[h];g.inputNames.forEach((x,b)=>{let[C,,S]=Ls(x),k=i[C];if(k.outputs!=null){let _=k.outputs.indexOf(S);if(_!==-1){let E=`${C}:${_}`;g.inputNames[b]=E}}g.inputs.push(k),k.children.push(g)})}),Object.keys(l).length===0?m.forEach(h=>{let g=i[h];g.children.length===0&&u.push(g)}):Object.keys(l).forEach(h=>{let[g]=Ls(h),x=i[g];x!=null&&(x.signatureKey=l[h],u.push(x))}),Object.keys(c).length>0?Object.keys(c).forEach(h=>{let[g]=Ls(h),x=i[g];x&&(x.signatureKey=c[h],p.push(x))}):p=n;let d={};t.library!=null&&t.library.function!=null&&(d=t.library.function.reduce((h,g)=>(h[g.signature.name]=this.mapFunction(g),h),{}));let f={nodes:i,inputs:p,outputs:u,weights:s,placeholders:n,signature:e,functions:d};return a.length>0&&(f.initNodes=a),f}mapSignatureEntries(t){return Object.keys(t||{}).reduce((e,o)=>(e[t[o].name]=o,e),{})}mapNode(t){let e=uf(t.op)||this.opMappers[t.op]||{};t.attr==null&&(t.attr={});let o={name:t.name,op:t.op,category:e.category,inputNames:(t.input||[]).map(n=>n.startsWith(\"^\")?n.slice(1):n),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:t.attr,outputs:e.outputs};return e.inputs!=null&&(o.inputParams=e.inputs.reduce((n,s)=>(n[s.name]={type:s.type,inputIndexStart:s.start,inputIndexEnd:s.end},n),{})),e.attrs!=null&&(o.attrParams=e.attrs.reduce((n,s)=>{let a=s.type,i;switch(s.type){case\"string\":i=cf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=cf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"string[]\":i=xf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=xf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"number\":i=mf(t.attr,s.tfName,s.defaultValue||0),i===void 0&&s.tfDeprecatedName&&(i=mf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"number[]\":i=gf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=gf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"bool\":i=lf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=lf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"bool[]\":i=bf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=bf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"shape\":i=hf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=hf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"shape[]\":i=yf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=yf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"dtype\":i=df(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=df(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"dtype[]\":i=ff(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=ff(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"func\":i=yT(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=yT(t.attr,s.tfDeprecatedName,s.defaultValue));break;case\"tensor\":case\"tensors\":break;default:throw new Error(`Unsupported param type: ${s.type} for op: ${t.op}`)}return n[s.name]={value:i,type:a},n},{})),o}mapFunction(t){let e=t.nodeDef,o=[],n=[],s={};e!=null&&(s=e.reduce((l,m)=>(l[m.name]=this.mapNode(m),m.op===\"Const\"&&n.push(l[m.name]),l),{}));let a=[],i=[];t.signature.inputArg.forEach(l=>{let[m]=Ls(l.name),d={name:m,op:\"Placeholder\",inputs:[],inputNames:[],category:\"graph\",inputParams:{},attrParams:{dtype:{value:FS(l.type),type:\"dtype\"}},children:[]};d.signatureKey=l.name,a.push(d),s[m]=d}),Object.keys(s).forEach(l=>{let m=s[l];m.inputNames.forEach((d,f)=>{let[h,,g]=Ls(d),x=s[h];if(x.outputs!=null){let b=x.outputs.indexOf(g);if(b!==-1){let C=`${h}:${b}`;m.inputNames[f]=C}}m.inputs.push(x),x.children.push(m)})});let u=t.ret;t.signature.outputArg.forEach(l=>{let[m,d]=Ls(u[l.name]),f=s[m];f!=null&&(f.defaultOutput=d,i.push(f))});let c=this.mapArgsToSignature(t);return{nodes:s,inputs:a,outputs:i,weights:n,placeholders:o,signature:c}}mapArgsToSignature(t){return{methodName:t.signature.name,inputs:t.signature.inputArg.reduce((e,o)=>(e[o.name]=this.mapArgToTensorInfo(o),e),{}),outputs:t.signature.outputArg.reduce((e,o)=>(e[o.name]=this.mapArgToTensorInfo(o,t.ret),e),{})}}mapArgToTensorInfo(t,e){let o=t.name;return e!=null&&(o=e[o]),{name:o,dtype:t.type}}};function J5(r){let t=A().global;if(typeof t.atob!=\"undefined\")return t.atob(r);if(typeof Buffer!=\"undefined\")return new Buffer(r,\"base64\").toString();throw new Error(\"Unable to decode base64 in this environment. Missing built-in atob() or Buffer()\")}function bT(r,t){let e=Array.isArray(r)?String.fromCharCode.apply(null,r):J5(r);return t?e:e.toLowerCase()}function cf(r,t,e,o=!1){let n=r[t];return n!=null?bT(n.s,o):e}function lf(r,t,e){let o=r[t];return o?o.b:e}function mf(r,t,e){let o=r[t]||{},n=o.i!=null?o.i:o.f!=null?o.f:e;return typeof n==\"number\"?n:parseInt(n,10)}function FS(r){switch(typeof r==\"string\"&&(r=fo[r]),r){case fo.DT_FLOAT:case fo.DT_HALF:return\"float32\";case fo.DT_INT32:case fo.DT_INT64:case fo.DT_INT8:case fo.DT_UINT8:return\"int32\";case fo.DT_BOOL:return\"bool\";case fo.DT_DOUBLE:return\"float32\";case fo.DT_STRING:return\"string\";default:return null}}function yT(r,t,e){let o=r[t];return o&&o.func?o.func.name:e}function df(r,t,e){let o=r[t];return o&&o.type?FS(o.type):e}function ff(r,t,e){let o=r[t];return o&&o.list&&o.list.type?o.list.type.map(n=>FS(n)):e}function CT(r){if(!r.unknownRank)return r.dim!=null?r.dim.map(t=>typeof t.size==\"number\"?t.size:parseInt(t.size,10)):[]}function hf(r,t,e){let o=r[t];return o&&o.shape?CT(o.shape):e}function gf(r,t,e){let o=r[t];return o?((o.list.f&&o.list.f.length?o.list.f:o.list.i)||[]).map(n=>typeof n==\"number\"?n:parseInt(n,10)):e}function xf(r,t,e,o=!1){let n=r[t];return n&&n.list&&n.list.s?n.list.s.map(s=>bT(s,o)):e}function yf(r,t,e){let o=r[t];return o&&o.list&&o.list.shape?o.list.shape.map(n=>CT(n)):e}function bf(r,t,e){let o=r[t];return o&&o.list&&o.list.b?o.list.b:e}var Cf=class{constructor(t,e,o){this.node=t,this.tensorMap=e,this.context=o,this.inputs=[],this.attrs={},this.inputs=t.inputNames.map(n=>this.getInput(n)),t.rawAttrs!=null&&(this.attrs=Object.keys(t.rawAttrs).reduce((n,s)=>(n[s]=this.getAttr(s),n),{}))}getInput(t){return Bt(t,this.tensorMap,this.context)}getAttr(t,e){let o=this.node.rawAttrs[t];if(o.tensor!=null)return Bt(t,this.tensorMap,this.context);if(o.i!=null||o.f!=null)return mf(this.node.rawAttrs,t,e);if(o.s!=null)return cf(this.node.rawAttrs,t,e);if(o.b!=null)return lf(this.node.rawAttrs,t,e);if(o.shape!=null)return hf(this.node.rawAttrs,t,e);if(o.type!=null)return df(this.node.rawAttrs,t,e);if(o.list!=null){if(o.list.i!=null||o.list.f!=null)return gf(this.node.rawAttrs,t,e);if(o.list.s!=null)return xf(this.node.rawAttrs,t,e);if(o.list.shape!=null)return yf(this.node.rawAttrs,t,e);if(o.list.b!=null)return bf(this.node.rawAttrs,t,e);if(o.list.type!=null)return ff(this.node.rawAttrs,t,e)}return e}};var Je={};qe(Je,{OP_SCOPE_SUFFIX:()=>kw,abs:()=>Qt,acos:()=>Nk,acosh:()=>Tk,add:()=>Ce,addN:()=>_k,all:()=>$k,any:()=>Ek,argMax:()=>Rk,argMin:()=>Dk,asin:()=>Ak,asinh:()=>Fk,atan:()=>Pk,atan2:()=>Ok,atanh:()=>Mk,avgPool:()=>md,avgPool3d:()=>zk,basicLSTMCell:()=>Vk,batchNorm:()=>ru,batchNorm2d:()=>Uk,batchNorm3d:()=>Gk,batchNorm4d:()=>Hk,batchToSpaceND:()=>dd,bincount:()=>fd,bitwiseAnd:()=>Kk,booleanMaskAsync:()=>E6,broadcastArgs:()=>qk,broadcastTo:()=>ou,buffer:()=>me,cast:()=>We,ceil:()=>jk,clipByValue:()=>Xk,clone:()=>Wr,complex:()=>$r,concat:()=>yt,concat1d:()=>Yk,concat2d:()=>Qk,concat3d:()=>Zk,concat4d:()=>Jk,conv1d:()=>e2,conv2d:()=>nu,conv2dTranspose:()=>t2,conv3d:()=>r2,conv3dTranspose:()=>n2,cos:()=>s2,cosh:()=>a2,cosineWindow:()=>_l,cumprod:()=>i2,cumsum:()=>u2,denseBincount:()=>p2,depthToSpace:()=>c2,depthwiseConv2d:()=>oc,diag:()=>l2,dilation2d:()=>m2,div:()=>je,divNoNan:()=>f2,dot:()=>h2,dropout:()=>W6,einsum:()=>su,elu:()=>yd,enclosingPowerOfTwo:()=>Qw,ensureShape:()=>g2,equal:()=>xd,erf:()=>x2,euclideanNorm:()=>C2,exp:()=>_o,expandDims:()=>Ms,expm1:()=>w2,eye:()=>bd,fft:()=>ac,fill:()=>Ea,floor:()=>Cd,floorDiv:()=>ld,fused:()=>Zw,gather:()=>wd,gatherND:()=>z6,greater:()=>zu,greaterEqual:()=>Sd,ifft:()=>Ku,imag:()=>iu,image:()=>Kj,inTopKAsync:()=>G6,irfft:()=>Gd,isFinite:()=>S2,isInf:()=>I2,isNaN:()=>v2,leakyRelu:()=>Id,less:()=>kl,lessEqual:()=>nc,linalg:()=>qj,linspace:()=>k2,localResponseNormalization:()=>N2,log:()=>ui,log1p:()=>vd,logSigmoid:()=>T2,logSoftmax:()=>_2,logSumExp:()=>Td,logicalAnd:()=>Vu,logicalNot:()=>_d,logicalOr:()=>$d,logicalXor:()=>$2,losses:()=>jj,lowerBound:()=>E2,matMul:()=>Ze,max:()=>Ra,maxPool:()=>Rd,maxPool3d:()=>R2,maxPoolWithArgmax:()=>D2,maximum:()=>Dd,mean:()=>Wu,meshgrid:()=>A2,min:()=>vl,minimum:()=>Uu,mirrorPad:()=>F2,mod:()=>P2,moments:()=>O2,movingAverage:()=>A6,mul:()=>se,multiRNNCell:()=>M2,multinomial:()=>L2,neg:()=>pr,norm:()=>Bu,notEqual:()=>Ad,oneHot:()=>Tl,ones:()=>Da,onesLike:()=>B2,op:()=>N,outerProduct:()=>z2,pad:()=>Aa,pad1d:()=>V2,pad2d:()=>W2,pad3d:()=>U2,pad4d:()=>G2,pool:()=>H2,pow:()=>ii,prelu:()=>Pd,print:()=>cd,prod:()=>K2,raggedGather:()=>q2,raggedRange:()=>j2,raggedTensorToTensor:()=>X2,rand:()=>Y2,randomGamma:()=>x1,randomNormal:()=>Vd,randomStandardNormal:()=>y1,randomUniform:()=>sc,randomUniformInt:()=>b1,range:()=>uu,real:()=>pi,reciprocal:()=>C1,relu:()=>pu,relu6:()=>Wd,reshape:()=>W,reverse:()=>lo,reverse1d:()=>w1,reverse2d:()=>S1,reverse3d:()=>I1,reverse4d:()=>v1,rfft:()=>ic,round:()=>Ud,rsqrt:()=>k1,scalar:()=>ke,scatterND:()=>P6,searchSorted:()=>Nl,selu:()=>N1,separableConv2d:()=>T1,setdiff1dAsync:()=>_1,sigmoid:()=>$a,sign:()=>$1,signal:()=>Hj,sin:()=>E1,sinh:()=>R1,slice:()=>Xe,slice1d:()=>D1,slice2d:()=>A1,slice3d:()=>F1,slice4d:()=>P1,softmax:()=>O1,softplus:()=>Nd,spaceToBatchND:()=>Fd,sparse:()=>Xj,sparseToDense:()=>L6,spectral:()=>Gj,split:()=>ci,sqrt:()=>Rr,square:()=>Zt,squaredDifference:()=>Hd,squeeze:()=>uc,stack:()=>vr,step:()=>Kd,stridedSlice:()=>M1,string:()=>Yj,sub:()=>Te,sum:()=>ot,tan:()=>L1,tanh:()=>Il,tensor:()=>ar,tensor1d:()=>Jt,tensor2d:()=>cu,tensor3d:()=>qd,tensor4d:()=>B1,tensor5d:()=>z1,tensor6d:()=>V1,tensorScatterUpdate:()=>U1,tile:()=>au,topk:()=>G1,transpose:()=>cc,truncatedNormal:()=>H1,unique:()=>K1,unsortedSegmentSum:()=>q1,unstack:()=>mo,upperBound:()=>j1,variable:()=>X1,where:()=>co,whereAsync:()=>Xd,zeros:()=>Ur,zerosLike:()=>Gt});var wT=(r,t,e,o=Je)=>{switch(r.op){case\"BiasAdd\":case\"AddV2\":case\"Add\":return[o.add(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"AddN\":return[o.addN(I(\"tensors\",r,t,e))];case\"FloorMod\":case\"Mod\":return[o.mod(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Mul\":return[o.mul(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"RealDiv\":case\"Div\":return[o.div(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"DivNoNan\":return[o.divNoNan(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"FloorDiv\":return[o.floorDiv(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Sub\":return[o.sub(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Minimum\":return[o.minimum(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Maximum\":return[o.maximum(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Pow\":return[o.pow(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"SquaredDifference\":return[o.squaredDifference(I(\"a\",r,t,e),I(\"b\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var ST=(r,t,e,o=Je)=>{switch(r.op){case\"Abs\":case\"ComplexAbs\":return[o.abs(I(\"x\",r,t,e))];case\"Acos\":return[o.acos(I(\"x\",r,t,e))];case\"Acosh\":return[o.acosh(I(\"x\",r,t,e))];case\"Asin\":return[o.asin(I(\"x\",r,t,e))];case\"Asinh\":return[o.asinh(I(\"x\",r,t,e))];case\"Atan\":return[o.atan(I(\"x\",r,t,e))];case\"Atan2\":return[o.atan2(I(\"x\",r,t,e),I(\"y\",r,t,e))];case\"Atanh\":return[o.atanh(I(\"x\",r,t,e))];case\"Ceil\":return[o.ceil(I(\"x\",r,t,e))];case\"Complex\":return[o.complex(I(\"real\",r,t,e),I(\"imag\",r,t,e))];case\"Cos\":return[o.cos(I(\"x\",r,t,e))];case\"Cosh\":return[o.cosh(I(\"x\",r,t,e))];case\"Elu\":return[o.elu(I(\"x\",r,t,e))];case\"Erf\":return[o.erf(I(\"x\",r,t,e))];case\"Exp\":return[o.exp(I(\"x\",r,t,e))];case\"Expm1\":return[o.expm1(I(\"x\",r,t,e))];case\"Floor\":return[o.floor(I(\"x\",r,t,e))];case\"Log\":return[o.log(I(\"x\",r,t,e))];case\"Log1p\":return[o.log1p(I(\"x\",r,t,e))];case\"Imag\":return[o.imag(I(\"x\",r,t,e))];case\"Neg\":return[o.neg(I(\"x\",r,t,e))];case\"Reciprocal\":return[o.reciprocal(I(\"x\",r,t,e))];case\"Real\":return[o.real(I(\"x\",r,t,e))];case\"Relu\":return[o.relu(I(\"x\",r,t,e))];case\"Round\":return[o.round(I(\"x\",r,t,e))];case\"Selu\":return[o.selu(I(\"x\",r,t,e))];case\"Sigmoid\":return[o.sigmoid(I(\"x\",r,t,e))];case\"Sin\":return[o.sin(I(\"x\",r,t,e))];case\"Sign\":return[o.sign(I(\"x\",r,t,e))];case\"Sinh\":return[o.sinh(I(\"x\",r,t,e))];case\"Softplus\":return[o.softplus(I(\"x\",r,t,e))];case\"Sqrt\":return[o.sqrt(I(\"x\",r,t,e))];case\"Square\":return[o.square(I(\"x\",r,t,e))];case\"Tanh\":return[o.tanh(I(\"x\",r,t,e))];case\"Tan\":return[o.tan(I(\"x\",r,t,e))];case\"ClipByValue\":return[o.clipByValue(I(\"x\",r,t,e),I(\"clipValueMin\",r,t,e),I(\"clipValueMax\",r,t,e))];case\"Relu6\":return[o.relu6(I(\"x\",r,t,e))];case\"Rsqrt\":return[o.rsqrt(Bt(r.inputNames[0],t,e))];case\"LeakyRelu\":return[o.leakyRelu(I(\"x\",r,t,e),I(\"alpha\",r,t,e))];case\"Prelu\":return[o.prelu(I(\"x\",r,t,e),I(\"alpha\",r,t,e))];case\"IsNan\":return[o.isNaN(Bt(r.inputNames[0],t,e))];case\"IsInf\":return[o.isInf(Bt(r.inputNames[0],t,e))];case\"IsFinite\":return[o.isFinite(Bt(r.inputNames[0],t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function Gr(r,t,e=\"\"){if(!(typeof r==\"number\"||typeof t==\"number\")){y.assert(r.length===t.length,()=>e+` Shapes ${r} and ${t} must match`);for(let o=0;oe+` Shapes ${r} and ${t} must match`)}}}function IT(r){return!(typeof r==\"number\"||r.some(t=>t<0))}function mc(r,t,e){let o=wf(r,e),n=!IT(o);if(n&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${o}`);if(n&&t.forEach(s=>{o=wf(s.shape,o)}),!IT(o))throw new Error(`Non-fully-defined elementShape: ${o}`);return o}function wf(r,t){if(typeof r==\"number\")return t;if(typeof t==\"number\")return r;if(r.length!==t.length)throw new Error(`Incompatible ranks during merge: ${r} vs. ${t}`);let e=[];for(let o=0;o=0&&s>=0&&n!==s)throw new Error(`Incompatible shape during merge: ${r} vs. ${t}`);e[o]=n>=0?n:s}return e}var Sf=class{constructor(t,e,o,n,s,a,i){this.name=t,this.dtype=e,this.maxSize=o,this.elementShape=n,this.identicalElementShapes=s,this.dynamicSize=a,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Er(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(t){this.tensors.forEach(e=>{(t==null||!t.has(e.tensor.id))&&e.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||t>=this.size())throw new Error(`Tried to read from index ${t}, but array size is: ${this.size()}`);let e=this.tensors[t];if(e.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${t} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(e.cleared=!0),e.read=!0,e.tensor}readMany(t){return t.map(e=>this.read(e))}write(t,e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||!this.dynamicSize&&t>=this.maxSize)throw new Error(`Tried to write to index ${t}, but array is not resizeable and size is: ${this.maxSize}`);let o=this.tensors[t]||{};if(e.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t},\n because the value dtype is ${e.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=e.shape),Gr(this.elementShape,e.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${t}.`),o.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been read.`);if(o.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been written.`);o.tensor=e,Er(e),o.written=!0,this.tensors[t]=o}writeMany(t,e){if(t.length!==e.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${t.length} is not the same as tensors size: ${e.length}.`);t.forEach((o,n)=>this.write(o,e[n]))}gather(t,e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${e}`);if(t)t=t.slice(0,this.size());else{t=[];for(let n=0;n=this.maxSize)throw new Error(`Max index must be < array size (${o} vs. ${this.maxSize})`);this.writeMany(t,mo(e,0))}split(t,e){if(e.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`);let o=0,n=t.map(p=>(o+=p,o));if(o!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${o}, and tensor's shape is: ${e.shape}`);if(!this.dynamicSize&&t.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${t.length}), and the TensorArray is not marked as dynamically resizeable`);let s=o===0?0:e.size/o,a=[];De(()=>{e=W(e,[1,o,s]);for(let p=0;p{if(o!==s.dtype)throw new Error(`Invalid data types; op elements ${o}, but list elements ${s.dtype}`);Gr(e,s.shape,\"TensorList shape mismatch: \"),Er(s)}),this.idTensor=ke(0),this.maxNumElements=n,Er(this.idTensor)}copy(){return new r([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(t){this.tensors.forEach(e=>{(t==null||!t.has(e.id))&&e.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(t,e,o=-1){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(o!==-1&&this.tensors.length!==o)throw new Error(`Operation expected a list with ${o} elements but got a list with ${this.tensors.length} elements.`);Gr(t,this.elementShape,\"TensorList shape mismatch: \");let n=mc(this.elementShape,this.tensors,t);return De(()=>{let s=this.tensors.map(a=>W(a,n));return vr(s,0)})}popBack(t,e){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error(\"Trying to pop from an empty list.\");let o=mc(this.elementShape,this.tensors,t),n=this.tensors.pop();return n.kept=!1,Gr(n.shape,t,\"TensorList shape mismatch: \"),W(n,o)}pushBack(t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(Gr(t.shape,this.elementShape,\"TensorList shape mismatch: \"),this.maxNumElements===this.size())throw new Error(\"Trying to push element into a full list.\");Er(t),this.tensors.push(t)}resize(t){if(t<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${t}`);if(this.maxNumElements!==-1&&t>this.maxNumElements)throw new Error(`TensorListResize input size ${t} is greater maxNumElement ${this.maxNumElements}.`);let e=new r([],this.elementShape,this.elementDtype,this.maxNumElements);e.tensors.length=t;for(let o=0;othis.tensors.length)throw new Error(`Trying to access element ${t} in a list with ${this.tensors.length} elements.`);if(this.tensors[t]==null)throw new Error(`element at index ${t} is null.`);Gr(this.tensors[t].shape,e,\"TensorList shape mismatch: \");let n=mc(this.elementShape,this.tensors,e);return W(this.tensors[t],n)}setItem(t,e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(t<0||this.maxNumElements!==-1&&t>=this.maxNumElements)throw new Error(`Trying to set element ${t} in a list with max ${this.maxNumElements} elements.`);Gr(this.elementShape,e.shape,\"TensorList shape mismatch: \"),Er(e),this.tensors[t]!=null&&(this.tensors[t].kept=!1),this.tensors[t]=e}gather(t,e,o){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);Gr(this.elementShape,o,\"TensorList shape mismatch: \"),t=t.slice(0,this.size());let n=mc(this.elementShape,this.tensors,o);return t.length===0?ar([],[0].concat(n)):De(()=>{let s=t.map(a=>W(this.tensors[a],n));return vr(s,0)})}concat(t,e){if(t&&t!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t}`);Gr(this.elementShape,e,\"TensorList shape mismatch: \");let o=mc(this.elementShape,this.tensors,e);return this.size()===0?ar([],[0].concat(o)):De(()=>{let n=this.tensors.map(s=>W(s,o));return yt(n,0)})}};function vT(r,t,e){let o=r.dtype;if(r.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${r.shape}`);if(r.dtype!==e)throw new Error(`Invalid data types; op elements ${r.dtype}, but list elements ${e}`);let n=r.shape.slice(1);Gr(n,t,\"TensorList shape mismatch: \");let s=mo(r);return new dc(s,t,o)}function kT(r,t,e,o){return new dc([],r,t,o)}function NT(r,t,e,o){if(t.length!==r.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${r.shape[0]}`);let n=Math.max(...t);if(o!=null&&o!==-1&&n>=o)throw new Error(`Max index must be < array size (${n} vs. ${o})`);let s=new dc([],e,r.dtype,o),a=mo(r,0);return t.forEach((i,p)=>{s.setItem(i,a[p])}),s}function TT(r,t,e){let o=0,n=t.map(c=>(o+=c,o));if(o!==r.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${o}, and tensor's shape is: ${r.shape}`);let s=r.shape.slice(1),a=wf(s,e),i=o===0?0:r.size/o,p=De(()=>{let c=[];r=W(r,[1,o,i]);for(let l=0;l{switch(r.op){case\"If\":case\"StatelessIf\":{let o=I(\"thenBranch\",r,t,e),n=I(\"elseBranch\",r,t,e),s=I(\"cond\",r,t,e),a=I(\"args\",r,t,e);return(await s.data())[0]?e.functionMap[o].executeFunctionAsync(a,e.tensorArrayMap,e.tensorListMap):e.functionMap[n].executeFunctionAsync(a,e.tensorArrayMap,e.tensorListMap)}case\"While\":case\"StatelessWhile\":{let o=I(\"body\",r,t,e),n=I(\"cond\",r,t,e),s=I(\"args\",r,t,e),a=await e.functionMap[n].executeFunctionAsync(s,e.tensorArrayMap,e.tensorListMap),i=s.map(c=>c.id),p=await a[0].data();a.forEach(c=>{!c.kept&&i.indexOf(c.id)===-1&&c.dispose()});let u=s;for(;p[0];){let c=u;u=await e.functionMap[o].executeFunctionAsync(u,e.tensorArrayMap,e.tensorListMap);let l=u.map(d=>d.id);c.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&l.indexOf(d.id)===-1&&d.dispose()});let m=await e.functionMap[n].executeFunctionAsync(u,e.tensorArrayMap,e.tensorListMap);p=await m[0].data(),m.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&l.indexOf(d.id)===-1&&d.dispose()})}return u}case\"LoopCond\":{let o=I(\"pred\",r,t,e);return[Bs(o)]}case\"Switch\":{let o=I(\"pred\",r,t,e),n=I(\"data\",r,t,e);return n.kept||(n=Bs(n)),(await o.data())[0]?[void 0,n]:[n,void 0]}case\"Merge\":{let o=r.inputNames.find(n=>Bt(n,t,e)!==void 0);if(o){let n=Bt(o,t,e);return[Bs(n)]}return}case\"Enter\":{let o=I(\"frameName\",r,t,e),n=I(\"tensor\",r,t,e);return e.enterFrame(o),[Bs(n)]}case\"Exit\":{let o=I(\"tensor\",r,t,e);return e.exitFrame(),[Bs(o)]}case\"NextIteration\":{let o=I(\"tensor\",r,t,e);return e.nextIteration(),[Bs(o)]}case\"TensorArrayV3\":{let o=I(\"size\",r,t,e),n=I(\"dtype\",r,t,e),s=I(\"elementShape\",r,t,e),a=I(\"dynamicSize\",r,t,e),i=I(\"clearAfterRead\",r,t,e),p=I(\"identicalElementShapes\",r,t,e),u=I(\"name\",r,t,e),c=new Sf(u,n,o,s,p,a,i);return e.addTensorArray(c),[c.idTensor,ke(1)]}case\"TensorArrayWriteV3\":{let o=I(\"tensorArrayId\",r,t,e),n=I(\"index\",r,t,e),s=I(\"tensor\",r,t,e),a=e.getTensorArray(o.id);return a.write(n,s),[a.idTensor]}case\"TensorArrayReadV3\":{let o=I(\"tensorArrayId\",r,t,e),n=I(\"index\",r,t,e);return[e.getTensorArray(o.id).read(n)]}case\"TensorArrayGatherV3\":{let o=I(\"tensorArrayId\",r,t,e),n=I(\"indices\",r,t,e),s=I(\"dtype\",r,t,e);return[e.getTensorArray(o.id).gather(n,s)]}case\"TensorArrayScatterV3\":{let o=I(\"tensorArrayId\",r,t,e),n=I(\"indices\",r,t,e),s=I(\"tensor\",r,t,e),a=e.getTensorArray(o.id);return a.scatter(n,s),[a.idTensor]}case\"TensorArrayConcatV3\":{let o=I(\"tensorArrayId\",r,t,e),n=e.getTensorArray(o.id),s=I(\"dtype\",r,t,e);return[n.concat(s)]}case\"TensorArraySplitV3\":{let o=I(\"tensorArrayId\",r,t,e),n=I(\"tensor\",r,t,e),s=I(\"lengths\",r,t,e),a=e.getTensorArray(o.id);return a.split(s,n),[a.idTensor]}case\"TensorArraySizeV3\":{let o=I(\"tensorArrayId\",r,t,e),n=e.getTensorArray(o.id);return[ke(n.size(),\"int32\")]}case\"TensorArrayCloseV3\":{let o=I(\"tensorArrayId\",r,t,e),n=e.getTensorArray(o.id);return n.clearAndClose(),[n.idTensor]}case\"TensorListSetItem\":{let o=I(\"tensorListId\",r,t,e),n=I(\"index\",r,t,e),s=I(\"tensor\",r,t,e),a=e.getTensorList(o.id);return a.setItem(n,s),[a.idTensor]}case\"TensorListGetItem\":{let o=I(\"tensorListId\",r,t,e),n=I(\"index\",r,t,e),s=I(\"elementShape\",r,t,e),a=I(\"elementDType\",r,t,e);return[e.getTensorList(o.id).getItem(n,s,a)]}case\"TensorListScatterV2\":case\"TensorListScatter\":{let o=I(\"indices\",r,t,e),n=I(\"tensor\",r,t,e),s=I(\"elementShape\",r,t,e),a=I(\"numElements\",r,t,e),i=NT(n,o,s,a);return e.addTensorList(i),[i.idTensor]}case\"TensorListReserve\":case\"EmptyTensorList\":{let o=I(\"elementShape\",r,t,e),n=I(\"elementDType\",r,t,e),s;r.op===\"TensorListReserve\"?s=\"numElements\":s=\"maxNumElements\";let a=I(s,r,t,e),i=r.op===\"TensorListReserve\"?-1:a,p=kT(o,n,a,i);return e.addTensorList(p),[p.idTensor]}case\"TensorListGather\":{let o=I(\"tensorListId\",r,t,e),n=I(\"indices\",r,t,e),s=I(\"elementShape\",r,t,e),a=I(\"elementDType\",r,t,e);return[e.getTensorList(o.id).gather(n,a,s)]}case\"TensorListStack\":{let o=I(\"tensorListId\",r,t,e),n=I(\"elementShape\",r,t,e),s=I(\"elementDType\",r,t,e),a=I(\"numElements\",r,t,e);return[e.getTensorList(o.id).stack(n,s,a)]}case\"TensorListFromTensor\":{let o=I(\"tensor\",r,t,e),n=I(\"elementShape\",r,t,e),s=I(\"elementDType\",r,t,e),a=vT(o,n,s);return e.addTensorList(a),[a.idTensor]}case\"TensorListConcat\":case\"TensorListConcatV2\":{let o=I(\"tensorListId\",r,t,e),n=e.getTensorList(o.id),s=I(\"dtype\",r,t,e),a=I(\"elementShape\",r,t,e);return[n.concat(s,a)]}case\"TensorListPushBack\":{let o=I(\"tensorListId\",r,t,e),n=I(\"tensor\",r,t,e),s=e.getTensorList(o.id);return s.pushBack(n),[s.idTensor]}case\"TensorListPopBack\":{let o=I(\"tensorListId\",r,t,e),n=I(\"elementShape\",r,t,e),s=I(\"elementDType\",r,t,e);return[e.getTensorList(o.id).popBack(n,s)]}case\"TensorListSplit\":{let o=I(\"tensor\",r,t,e),n=I(\"elementShape\",r,t,e),s=I(\"lengths\",r,t,e),a=TT(o,s,n);return e.addTensorList(a),[a.idTensor]}case\"TensorListLength\":{let o=I(\"tensorListId\",r,t,e),n=e.getTensorList(o.id);return[ke(n.size(),\"int32\")]}case\"TensorListResize\":{let o=I(\"tensorListId\",r,t,e),n=I(\"size\",r,t,e),a=e.getTensorList(o.id).resize(n);return e.addTensorList(a),[a.idTensor]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};function $T(r,t,e){let[o,n]=I(\"fusedOps\",r,t,e),s=o===\"biasadd\",a=!s,i=n===\"prelu\",p=o===\"fusedbatchnorm\",u=I(\"numArgs\",r,t,e);if(s){if(i&&u!==2)throw new Error(\"FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.\");if(!i&&s&&u!==1)throw new Error(\"FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.\")}if(p)throw new Error(\"FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported\");let c=I(\"strides\",r,t,e),l=Al(r,t,e),m=I(\"dataFormat\",r,t,e).toUpperCase(),d=I(\"dilations\",r,t,e),[f,h]=I(\"args\",r,t,e);a&&(h=f,f=void 0);let g=I(\"leakyreluAlpha\",r,t,e);return{stride:c,pad:l,dataFormat:m,dilations:d,biasArg:f,preluArg:h,activationFunc:n,leakyreluAlpha:g}}var ET=(r,t,e,o=Je)=>{switch(r.op){case\"Conv1D\":{let n=I(\"stride\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"dataFormat\",r,t,e).toUpperCase(),i=I(\"dilation\",r,t,e);return[o.conv1d(I(\"x\",r,t,e),I(\"filter\",r,t,e),n,s,a,i)]}case\"Conv2D\":{let n=I(\"strides\",r,t,e),s=Al(r,t,e),a=I(\"dataFormat\",r,t,e).toUpperCase(),i=I(\"dilations\",r,t,e);return[o.conv2d(I(\"x\",r,t,e),I(\"filter\",r,t,e),[n[1],n[2]],s,a,[i[1],i[2]])]}case\"_FusedConv2D\":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:c,leakyreluAlpha:l}=$T(r,t,e);return[o.fused.conv2d({x:I(\"x\",r,t,e),filter:I(\"filter\",r,t,e),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:c,preluActivationWeights:u,leakyreluAlpha:l})]}case\"FusedDepthwiseConv2dNative\":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:c,leakyreluAlpha:l}=$T(r,t,e);return[o.fused.depthwiseConv2d({x:I(\"x\",r,t,e),filter:I(\"filter\",r,t,e),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:c,preluActivationWeights:u,leakyreluAlpha:l})]}case\"Conv2DBackpropInput\":case\"Conv2dTranspose\":{let n=I(\"outputShape\",r,t,e),s=I(\"strides\",r,t,e),a=Al(r,t,e);return[o.conv2dTranspose(I(\"x\",r,t,e),I(\"filter\",r,t,e),n,[s[1],s[2]],a)]}case\"DepthwiseConv2dNative\":case\"DepthwiseConv2d\":{let n=I(\"strides\",r,t,e),s=Al(r,t,e),a=I(\"dilations\",r,t,e),i=I(\"dataFormat\",r,t,e).toUpperCase();return[o.depthwiseConv2d(I(\"input\",r,t,e),I(\"filter\",r,t,e),[n[1],n[2]],s,i,[a[1],a[2]])]}case\"Conv3D\":{let n=I(\"strides\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"dataFormat\",r,t,e).toUpperCase(),i=I(\"dilations\",r,t,e);return[o.conv3d(I(\"x\",r,t,e),I(\"filter\",r,t,e),[n[1],n[2],n[3]],s,a,[i[1],i[2],i[3]])]}case\"AvgPool\":{let n=I(\"strides\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"kernelSize\",r,t,e);return[o.avgPool(I(\"x\",r,t,e),[a[1],a[2]],[n[1],n[2]],s)]}case\"MaxPool\":{let n=I(\"strides\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"kernelSize\",r,t,e);return[o.maxPool(I(\"x\",r,t,e),[a[1],a[2]],[n[1],n[2]],s)]}case\"MaxPoolWithArgmax\":{let n=I(\"strides\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"kernelSize\",r,t,e),i=I(\"includeBatchInIndex\",r,t,e),{result:p,indexes:u}=o.maxPoolWithArgmax(I(\"x\",r,t,e),[a[1],a[2]],[n[1],n[2]],s,i);return[p,u]}case\"AvgPool3D\":{let n=I(\"strides\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"kernelSize\",r,t,e);return[o.avgPool3d(I(\"x\",r,t,e),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case\"MaxPool3D\":{let n=I(\"strides\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"kernelSize\",r,t,e);return[o.maxPool3d(I(\"x\",r,t,e),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case\"Dilation2D\":{let n=I(\"strides\",r,t,e),s=I(\"pad\",r,t,e),a=I(\"dilations\",r,t,e),i=n[1],p=n[2],u=a[1],c=a[2];return[o.dilation2d(I(\"x\",r,t,e),I(\"filter\",r,t,e),[i,p],s,[u,c],\"NHWC\")]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var RT=(r,t,e,o=Je)=>{switch(r.op){case\"Fill\":{let n=I(\"shape\",r,t,e),s=I(\"dtype\",r,t,e),a=I(\"value\",r,t,e);return[o.fill(n,a,s)]}case\"LinSpace\":{let n=I(\"start\",r,t,e),s=I(\"stop\",r,t,e),a=I(\"num\",r,t,e);return[o.linspace(n,s,a)]}case\"Multinomial\":{let n=I(\"logits\",r,t,e),s=I(\"numSamples\",r,t,e),a=I(\"seed\",r,t,e);return[o.multinomial(n,s,a)]}case\"OneHot\":{let n=I(\"indices\",r,t,e),s=I(\"depth\",r,t,e),a=I(\"onValue\",r,t,e),i=I(\"offValue\",r,t,e),p=I(\"dtype\",r,t,e);return[o.oneHot(n,s,a,i,p)]}case\"Ones\":return[o.ones(I(\"shape\",r,t,e),I(\"dtype\",r,t,e))];case\"OnesLike\":return[o.onesLike(I(\"x\",r,t,e))];case\"RandomStandardNormal\":return[o.randomStandardNormal(I(\"shape\",r,t,e),I(\"dtype\",r,t,e),I(\"seed\",r,t,e))];case\"RandomUniform\":return[o.randomUniform(I(\"shape\",r,t,e),I(\"minval\",r,t,e),I(\"maxval\",r,t,e),I(\"dtype\",r,t,e))];case\"RandomUniformInt\":return[o.randomUniformInt(I(\"shape\",r,t,e),I(\"minval\",r,t,e),I(\"maxval\",r,t,e),I(\"seed\",r,t,e))];case\"Range\":{let n=I(\"start\",r,t,e),s=I(\"stop\",r,t,e),a=I(\"step\",r,t,e);return[o.range(n,s,a,I(\"dtype\",r,t,e))]}case\"TruncatedNormal\":{let n=I(\"shape\",r,t,e),s=I(\"mean\",r,t,e),a=I(\"stdDev\",r,t,e),i=I(\"seed\",r,t,e);return[o.truncatedNormal(n,s,a,I(\"dtype\",r,t,e),i)]}case\"Zeros\":return[o.zeros(I(\"shape\",r,t,e),I(\"dtype\",r,t,e))];case\"ZerosLike\":return[o.zerosLike(I(\"x\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function PS(r,t,e){let o=I(\"boxes\",r,t,e),n=I(\"scores\",r,t,e),s=I(\"maxOutputSize\",r,t,e),a=I(\"iouThreshold\",r,t,e),i=I(\"scoreThreshold\",r,t,e),p=I(\"softNmsSigma\",r,t,e);return{boxes:o,scores:n,maxOutputSize:s,iouThreshold:a,scoreThreshold:i,softNmsSigma:p}}var DT=async(r,t,e,o,n=Je)=>{switch(r.op){case\"NonMaxSuppressionV5\":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u,softNmsSigma:c}=PS(r,t,e),l=await n.image.nonMaxSuppressionWithScoreAsync(s,a,i,p,u,c);return[l.selectedIndices,l.selectedScores]}case\"NonMaxSuppressionV4\":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=PS(r,t,e),c=I(\"padToMaxOutputSize\",r,t,e),l=await n.image.nonMaxSuppressionPaddedAsync(s,a,i,p,u,c);return[l.selectedIndices,l.validOutputs]}case\"NonMaxSuppressionV3\":case\"NonMaxSuppressionV2\":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=PS(r,t,e);return[await n.image.nonMaxSuppressionAsync(s,a,i,p,u)]}case\"Where\":{let s=n.cast(I(\"condition\",r,t,e),\"bool\"),a=[await n.whereAsync(s)];return s.dispose(),a}case\"ListDiff\":return n.setdiff1dAsync(I(\"x\",r,t,e),I(\"y\",r,t,e));default:throw TypeError(`Node type ${r.op} is not implemented`)}};var AT=(r,t,e,o=Je)=>{switch(r.op){case\"LowerBound\":{let n=I(\"sortedSequence\",r,t,e),s=I(\"values\",r,t,e);return[o.lowerBound(n,s)]}case\"TopKV2\":{let n=I(\"x\",r,t,e),s=I(\"k\",r,t,e),a=I(\"sorted\",r,t,e),i=o.topk(n,s,a);return[i.values,i.indices]}case\"UpperBound\":{let n=I(\"sortedSequence\",r,t,e),s=I(\"values\",r,t,e);return[o.upperBound(n,s)]}case\"Unique\":{let n=I(\"x\",r,t,e),s=o.unique(n);return[s.values,s.indices]}case\"UniqueV2\":{let n=I(\"x\",r,t,e),s=I(\"axis\",r,t,e),a=o.unique(n,s);return[a.values,a.indices]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var FT=(r,t,e,o=Je)=>{switch(r.op){case\"Const\":return t[r.name];case\"PlaceholderWithDefault\":let n=I(\"default\",r,t,e);return[Bt(r.name,t,e)||n];case\"Placeholder\":return[Bt(r.name,t,e)];case\"Identity\":case\"StopGradient\":case\"FakeQuantWithMinMaxVars\":{let c=I(\"x\",r,t,e);return[Bs(c)]}case\"IdentityN\":return I(\"x\",r,t,e).map(c=>Bs(c));case\"Snapshot\":let s=I(\"x\",r,t,e);return[Bs(s)];case\"Shape\":return[o.tensor1d(I(\"x\",r,t,e).shape,\"int32\")];case\"ShapeN\":return I(\"x\",r,t,e).map(c=>o.tensor1d(c.shape));case\"Size\":return[o.scalar(I(\"x\",r,t,e).size,\"int32\")];case\"Rank\":return[o.scalar(I(\"x\",r,t,e).rank,\"int32\")];case\"NoOp\":return[o.scalar(1)];case\"Print\":let a=I(\"x\",r,t,e),i=I(\"data\",r,t,e),p=I(\"message\",r,t,e),u=I(\"summarize\",r,t,e);console.warn(\"The graph has a tf.print() operation,usually used for debugging, which slows down performance.\"),console.log(p);for(let c=0;ct.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return ke(this.size(),\"int32\")}async import(t,e){this.checkKeyAndValueTensor(t,e);let o=await t.data();return this.tensorMap.forEach(n=>n.dispose()),this.tensorMap.clear(),De(()=>{let n=mo(e),s=o.length,a=n.length;y.assert(s===a,()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${a} elements.`);for(let i=0;i{let n=[];for(let s=0;s{switch(r.op){case\"HashTable\":case\"HashTableV2\":{let n=o.getHashTableHandleByName(r.name);if(n!=null)return[n];{let s=I(\"keyDType\",r,t,e),a=I(\"valueDType\",r,t,e),i=new If(s,a);return o.addHashTable(r.name,i),[i.handle]}}case\"InitializeTable\":case\"InitializeTableV2\":case\"LookupTableImport\":case\"LookupTableImportV2\":{let n=I(\"tableHandle\",r,t,e,o),s=I(\"keys\",r,t,e),a=I(\"values\",r,t,e);return[await o.getHashTableById(n.id).import(s,a)]}case\"LookupTableFind\":case\"LookupTableFindV2\":{let n=I(\"tableHandle\",r,t,e,o),s=I(\"keys\",r,t,e),a=I(\"defaultValue\",r,t,e);return[await o.getHashTableById(n.id).find(s,a)]}case\"LookupTableSize\":case\"LookupTableSizeV2\":{let n=I(\"tableHandle\",r,t,e,o);return[o.getHashTableById(n.id).tensorSize()]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var OT=(r,t,e,o=Je)=>{switch(r.op){case\"ResizeBilinear\":{let n=I(\"images\",r,t,e),s=I(\"size\",r,t,e),a=I(\"alignCorners\",r,t,e),i=I(\"halfPixelCenters\",r,t,e);return[o.image.resizeBilinear(n,[s[0],s[1]],a,i)]}case\"ResizeNearestNeighbor\":{let n=I(\"images\",r,t,e),s=I(\"size\",r,t,e),a=I(\"alignCorners\",r,t,e),i=I(\"halfPixelCenters\",r,t,e);return[o.image.resizeNearestNeighbor(n,[s[0],s[1]],a,i)]}case\"CropAndResize\":{let n=I(\"image\",r,t,e),s=I(\"boxes\",r,t,e),a=I(\"boxInd\",r,t,e),i=I(\"cropSize\",r,t,e),p=I(\"method\",r,t,e),u=I(\"extrapolationValue\",r,t,e);return[o.image.cropAndResize(n,s,a,i,p,u)]}case\"ImageProjectiveTransformV3\":{let n=I(\"images\",r,t,e),s=I(\"transforms\",r,t,e),a=I(\"outputShape\",r,t,e),i=I(\"fillValue\",r,t,e),p=I(\"interpolation\",r,t,e),u=I(\"fillMode\",r,t,e);return[o.image.transform(n,s,p.toLowerCase(),u.toLowerCase(),i,a)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var MT=(r,t,e,o=Je)=>{switch(r.op){case\"Equal\":return[o.equal(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"NotEqual\":return[o.notEqual(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Greater\":return[o.greater(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"GreaterEqual\":return[o.greaterEqual(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Less\":return[o.less(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"LessEqual\":return[o.lessEqual(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"LogicalAnd\":return[o.logicalAnd(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"LogicalNot\":return[o.logicalNot(I(\"a\",r,t,e))];case\"LogicalOr\":return[o.logicalOr(I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"Select\":case\"SelectV2\":return[o.where(I(\"condition\",r,t,e),I(\"a\",r,t,e),I(\"b\",r,t,e))];case\"BitwiseAnd\":return[o.bitwiseAnd(I(\"a\",r,t,e),I(\"b\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var LT=(r,t,e,o=Je)=>{switch(r.op){case\"BatchMatMul\":case\"BatchMatMulV2\":case\"MatMul\":return[o.matMul(I(\"a\",r,t,e),I(\"b\",r,t,e),I(\"transposeA\",r,t,e),I(\"transposeB\",r,t,e))];case\"Einsum\":return[o.einsum(I(\"equation\",r,t,e),...I(\"tensors\",r,t,e))];case\"Transpose\":return[o.transpose(I(\"x\",r,t,e),I(\"perm\",r,t,e))];case\"_FusedMatMul\":let[n,s]=I(\"fusedOps\",r,t,e),a=n===\"biasadd\",i=s===\"prelu\",p=I(\"numArgs\",r,t,e),u=I(\"leakyreluAlpha\",r,t,e);if(a){if(i&&p!==2)throw new Error(\"Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.\");if(!i&&p!==1)throw new Error(\"Fused MatMul with BiasAdd must have one extra argument: bias.\")}let[c,l]=I(\"args\",r,t,e);return[o.fused.matMul({a:I(\"a\",r,t,e),b:I(\"b\",r,t,e),transposeA:I(\"transposeA\",r,t,e),transposeB:I(\"transposeB\",r,t,e),bias:c,activation:s,preluActivationWeights:l,leakyreluAlpha:u})];case\"MatrixBandPart\":return[o.linalg.bandPart(I(\"a\",r,t,e),I(\"numLower\",r,t,e),I(\"numUpper\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var BT=(r,t,e,o=Je)=>{switch(r.op){case\"EuclideanNorm\":return[o.euclideanNorm(I(\"x\",r,t,e),I(\"axis\",r,t,e),I(\"keepDims\",r,t,e))];case\"FusedBatchNorm\":case\"FusedBatchNormV2\":return[o.batchNorm(I(\"x\",r,t,e),I(\"mean\",r,t,e),I(\"variance\",r,t,e),I(\"offset\",r,t,e),I(\"scale\",r,t,e),I(\"epsilon\",r,t,e))];case\"FusedBatchNormV3\":return[o.batchNorm(I(\"x\",r,t,e),I(\"mean\",r,t,e),I(\"variance\",r,t,e),I(\"offset\",r,t,e),I(\"scale\",r,t,e),I(\"epsilon\",r,t,e))];case\"LRN\":return[o.localResponseNormalization(I(\"x\",r,t,e),I(\"radius\",r,t,e),I(\"bias\",r,t,e),I(\"alpha\",r,t,e),I(\"beta\",r,t,e))];case\"Softmax\":return[o.softmax(I(\"x\",r,t,e))];case\"LogSoftmax\":return[o.logSoftmax(I(\"x\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var zT=(r,t,e,o=Je)=>{switch(r.op){case\"RaggedGather\":{let{outputNestedSplits:n,outputDenseValues:s}=o.raggedGather(I(\"paramsNestedSplits\",r,t,e),I(\"paramsDenseValues\",r,t,e),I(\"indices\",r,t,e),I(\"outputRaggedRank\",r,t,e));return n.concat(s)}case\"RaggedRange\":{let{rtNestedSplits:n,rtDenseValues:s}=o.raggedRange(I(\"starts\",r,t,e),I(\"limits\",r,t,e),I(\"splits\",r,t,e));return[n,s]}case\"RaggedTensorToTensor\":return[o.raggedTensorToTensor(I(\"shape\",r,t,e),I(\"values\",r,t,e),I(\"defaultValue\",r,t,e),I(\"rowPartitionTensors\",r,t,e),I(\"rowPartitionTypes\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var VT=(r,t,e,o=Je)=>{switch(r.op){case\"Max\":{let i=I(\"axis\",r,t,e),p=I(\"keepDims\",r,t,e);return[o.max(I(\"x\",r,t,e),i,p)]}case\"Mean\":{let i=I(\"axis\",r,t,e),p=I(\"keepDims\",r,t,e);return[o.mean(I(\"x\",r,t,e),i,p)]}case\"Min\":{let i=I(\"axis\",r,t,e),p=I(\"keepDims\",r,t,e);return[o.min(I(\"x\",r,t,e),i,p)]}case\"Sum\":{let i=I(\"axis\",r,t,e),p=I(\"keepDims\",r,t,e);return[o.sum(I(\"x\",r,t,e),i,p)]}case\"All\":{let i=I(\"axis\",r,t,e),p=I(\"keepDims\",r,t,e);return[o.all(I(\"x\",r,t,e),i,p)]}case\"Any\":{let i=I(\"axis\",r,t,e),p=I(\"keepDims\",r,t,e);return[o.any(I(\"x\",r,t,e),i,p)]}case\"ArgMax\":{let i=I(\"axis\",r,t,e);return[o.argMax(I(\"x\",r,t,e),i)]}case\"ArgMin\":{let i=I(\"axis\",r,t,e);return[o.argMin(I(\"x\",r,t,e),i)]}case\"Prod\":{let i=I(\"axis\",r,t,e),p=I(\"keepDims\",r,t,e);return[o.prod(I(\"x\",r,t,e),i,p)]}case\"Cumprod\":{let i=I(\"axis\",r,t,e),p=I(\"exclusive\",r,t,e),u=I(\"reverse\",r,t,e);return[o.cumprod(I(\"x\",r,t,e),i,p,u)]}case\"Cumsum\":{let i=I(\"axis\",r,t,e),p=I(\"exclusive\",r,t,e),u=I(\"reverse\",r,t,e);return[o.cumsum(I(\"x\",r,t,e),i,p,u)]}case\"Bincount\":let n=I(\"x\",r,t,e),s=I(\"weights\",r,t,e),a=I(\"size\",r,t,e);return[o.bincount(n,s,a)];case\"DenseBincount\":{let i=I(\"x\",r,t,e),p=I(\"weights\",r,t,e),u=I(\"size\",r,t,e),c=I(\"binaryOutput\",r,t,e);return[o.denseBincount(i,p,u,c)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var WT=(r,t,e,o=Je)=>{switch(r.op){case\"ConcatV2\":case\"Concat\":{let n=I(\"n\",r,t,e),s=I(\"axis\",r,t,e),a=I(\"tensors\",r,t,e);return a=a.slice(0,n),[o.concat(a,s)]}case\"Gather\":{let n=I(\"x\",r,t,e),s=I(\"indices\",r,t,e);return[o.gather(n,o.cast(s,\"int32\"),0)]}case\"GatherV2\":{let n=I(\"axis\",r,t,e),s=I(\"batchDims\",r,t,e),a=I(\"x\",r,t,e),i=I(\"indices\",r,t,e);return[o.gather(a,o.cast(i,\"int32\"),n,s)]}case\"Reverse\":{let n=I(\"dims\",r,t,e),s=[];for(let i=0;i{let n=I(\"axis\",r,t,e),s=I(\"tensors\",r,t,e),a=s[0].shape,i=o.squeeze(s[0]).shape,p=s.map(u=>{let c=y.arraysEqual(u.shape,a);if(!c&&!y.arraysEqual(o.squeeze(u).shape,i))throw new Error(\"the input tensors shape does not match\");return c?u:o.reshape(u,a)});return[o.stack(p,n)]});case\"Unpack\":{let n=I(\"axis\",r,t,e),s=I(\"tensor\",r,t,e);return o.unstack(s,n)}case\"Tile\":{let n=I(\"reps\",r,t,e);return[o.tile(I(\"x\",r,t,e),n)]}case\"Split\":case\"SplitV\":{let n=I(\"axis\",r,t,e),s=I(\"numOrSizeSplits\",r,t,e),a=I(\"x\",r,t,e);return o.split(a,s,n)}case\"ScatterNd\":{let n=I(\"indices\",r,t,e),s=I(\"values\",r,t,e),a=I(\"shape\",r,t,e);return[o.scatterND(n,s,a)]}case\"GatherNd\":{let n=I(\"x\",r,t,e),s=I(\"indices\",r,t,e);return[o.gatherND(n,s)]}case\"SparseToDense\":{let n=I(\"sparseIndices\",r,t,e),s=I(\"outputShape\",r,t,e),a=I(\"sparseValues\",r,t,e),i=I(\"defaultValue\",r,t,e);return[o.sparseToDense(n,a,s,a.dtype===i.dtype?i:o.cast(i,a.dtype))]}case\"TensorScatterUpdate\":{let n=I(\"indices\",r,t,e),s=I(\"values\",r,t,e),a=I(\"tensor\",r,t,e);return[o.tensorScatterUpdate(a,n,s)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var UT=(r,t,e,o=Je)=>{switch(r.op){case\"SparseFillEmptyRows\":{let{outputIndices:n,outputValues:s,emptyRowIndicator:a,reverseIndexMap:i}=o.sparse.sparseFillEmptyRows(I(\"indices\",r,t,e),I(\"values\",r,t,e),I(\"denseShape\",r,t,e),I(\"defaultValue\",r,t,e));return[n,s,a,i]}case\"SparseReshape\":{let{outputIndices:n,outputShape:s}=o.sparse.sparseReshape(I(\"inputIndices\",r,t,e),I(\"inputShape\",r,t,e),I(\"newShape\",r,t,e));return[n,s]}case\"SparseSegmentMean\":return[o.sparse.sparseSegmentMean(I(\"data\",r,t,e),I(\"indices\",r,t,e),I(\"segmentIds\",r,t,e))];case\"SparseSegmentSum\":return[o.sparse.sparseSegmentSum(I(\"data\",r,t,e),I(\"indices\",r,t,e),I(\"segmentIds\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var GT=(r,t,e,o=Je)=>{switch(r.op){case\"FFT\":return[o.fft(I(\"x\",r,t,e))];case\"IFFT\":return[o.ifft(I(\"x\",r,t,e))];case\"RFFT\":return[o.rfft(I(\"x\",r,t,e))];case\"IRFFT\":return[o.irfft(I(\"x\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var HT=(r,t,e,o=Je)=>{switch(r.op){case\"StaticRegexReplace\":return[o.string.staticRegexReplace(I(\"input\",r,t,e),I(\"pattern\",r,t,e),I(\"rewrite\",r,t,e),I(\"replaceGlobal\",r,t,e))];case\"StringNGrams\":{let{nGrams:n,nGramsSplits:s}=o.string.stringNGrams(I(\"data\",r,t,e),I(\"dataSplits\",r,t,e),I(\"separator\",r,t,e),I(\"nGramWidths\",r,t,e),I(\"leftPad\",r,t,e),I(\"rightPad\",r,t,e),I(\"padWidth\",r,t,e),I(\"preserveShortSequences\",r,t,e));return[n,s]}case\"StringSplit\":{let{indices:n,values:s,shape:a}=o.string.stringSplit(I(\"input\",r,t,e),I(\"delimiter\",r,t,e),I(\"skipEmpty\",r,t,e));return[n,s,a]}case\"StringToHashBucketFast\":return[o.string.stringToHashBucketFast(I(\"input\",r,t,e),I(\"numBuckets\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var KT=(r,t,e,o=Je)=>{switch(r.op){case\"Cast\":return[o.cast(I(\"x\",r,t,e),I(\"dtype\",r,t,e))];case\"ExpandDims\":{let n=I(\"axis\",r,t,e);return[o.expandDims(I(\"x\",r,t,e),n)]}case\"Squeeze\":{let n=I(\"axis\",r,t,e);return[o.squeeze(I(\"x\",r,t,e),n)]}case\"Reshape\":return[o.reshape(I(\"x\",r,t,e),I(\"shape\",r,t,e))];case\"EnsureShape\":return[o.ensureShape(I(\"x\",r,t,e),I(\"shape\",r,t,e))];case\"MirrorPad\":return[o.mirrorPad(I(\"x\",r,t,e),I(\"padding\",r,t,e),I(\"mode\",r,t,e))];case\"PadV2\":case\"Pad\":return[o.pad(I(\"x\",r,t,e),I(\"padding\",r,t,e),I(\"constantValue\",r,t,e))];case\"SpaceToBatchND\":{let n=I(\"blockShape\",r,t,e),s=I(\"paddings\",r,t,e);return[o.spaceToBatchND(I(\"x\",r,t,e),n,s)]}case\"BatchToSpaceND\":{let n=I(\"blockShape\",r,t,e),s=I(\"crops\",r,t,e);return[o.batchToSpaceND(I(\"x\",r,t,e),n,s)]}case\"DepthToSpace\":{let n=I(\"blockSize\",r,t,e),s=I(\"dataFormat\",r,t,e).toUpperCase();return[o.depthToSpace(I(\"x\",r,t,e),n,s)]}case\"BroadcastTo\":return[o.broadcastTo(I(\"x\",r,t,e),I(\"shape\",r,t,e))];case\"BroadcastArgs\":return[o.broadcastArgs(I(\"s0\",r,t,e),I(\"s1\",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function OS(r,t,e,o,n=De){let s=((a,i,p)=>{switch(a.category){case\"arithmetic\":return n(()=>wT(a,i,p));case\"basic_math\":return n(()=>ST(a,i,p));case\"control\":return _T(a,i,p);case\"convolution\":return n(()=>ET(a,i,p));case\"creation\":return n(()=>RT(a,i,p));case\"dynamic\":return DT(a,i,p);case\"evaluation\":return n(()=>AT(a,i,p));case\"image\":return n(()=>OT(a,i,p));case\"graph\":return n(()=>FT(a,i,p));case\"logical\":return n(()=>MT(a,i,p));case\"matrices\":return n(()=>LT(a,i,p));case\"normalization\":return n(()=>BT(a,i,p));case\"ragged\":return n(()=>zT(a,i,p));case\"reduction\":return n(()=>VT(a,i,p));case\"slice_join\":return n(()=>WT(a,i,p));case\"sparse\":return n(()=>UT(a,i,p));case\"spectral\":return n(()=>GT(a,i,p));case\"string\":return n(()=>HT(a,i,p));case\"transformation\":return n(()=>KT(a,i,p));case\"hash_table\":return PT(a,i,p,o);case\"custom\":let u=uf(a.op);if(u&&u.customExecutor)return u.customExecutor(new Cf(a,i,p));throw TypeError(`Custom op ${a.op} is not registered.`);default:throw TypeError(`Unknown op '${a.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(r,t,e);return y.isPromise(s)?s.then(a=>[].concat(a)):[].concat(s)}var Pl=class{constructor(t={},e={},o={},n={},s){this.weightMap=t,this.tensorArrayMap=e,this.tensorListMap=o,this.functionMap=n,this.parseNodeNameCache=s,this.rootContext={id:0,frameName:\"\",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(t,e){return{id:t,frameName:e,iterationId:0}}set currentContext(t){this.contexts!==t&&(this.contexts=t,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){let t=[];for(let e=0;ee.id===0&&e.iterationId===0?\"\":`${e.frameName}-${e.iterationId}`).join(\"/\"):\"\"}enterFrame(t){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,t)),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 t=Object.assign({},this.contexts[this.contexts.length-1]);t.iterationId+=1,t.id=this.lastId,this.contexts.splice(-1,1,t),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error(\"Cannot increase frame iteration, the context is empty\")}getWeight(t){return this.weightMap[t]}addTensorArray(t){this.tensorArrayMap[t.id]=t}getTensorArray(t){return this.tensorArrayMap[t]}addTensorList(t){this.tensorListMap[t.id]=t}getTensorList(t){return this.tensorListMap[t]}dispose(t){for(let e in this.tensorArrayMap)this.tensorArrayMap[e].clearAndClose(t);for(let e in this.tensorListMap)this.tensorListMap[e].clearAndClose(t)}};function MS(r,t,e,o){let n=new Set,s=[],a=null,i=null,p=new Set,u=new Set(Object.keys(r).map(m=>Nr(m)[0]));o=o||[];let c=new Set(o.map(m=>Nr(m.name)[0])),l=[...t];for(;l.length>0;){let m=l.pop();if((mu(m)||k8(m)||N8(m))&&a==null&&(a=m,i=a.children.map(d=>d.name).filter(d=>n.has(d))),n.add(m.name),e[m.name]==null&&!u.has(m.name)&&!c.has(m.name)){if(m.inputs.length===0){s.push(m.name);continue}m.inputs.forEach(d=>{p.has(d.name)||(p.add(d.name),l.push(d))})}}return{inputs:r,outputs:t,usedNodes:n,missingInputs:s,dynamicNode:a,syncInputs:i}}function qT(r,t){let{usedNodes:e,inputs:o}=t,n=Object.keys(o).map(g=>Nr(g)[0]).map(g=>r.nodes[g]),s=r.initNodes||[],a=g=>e.has(typeof g==\"string\"?g:g.name);function i(g){return[...new Map(g.map(x=>[x.name,x])).values()]}let p=i([...n,...r.weights,...s]).filter(a),u=i([...p,...Object.values(r.nodes)]).filter(a),c=new Map(u.map(g=>[g.name,g])),l={};for(let g of u){l[g.name]=l[g.name]||0;for(let x of g.children)a(x)||(l[x.name]=Number.POSITIVE_INFINITY),l[x.name]=(l[x.name]||0)+1}let m=Object.entries(l).filter(([,g])=>g===0).map(([g])=>g),d=[...m];for(;m.length>0;){let g=m.pop(),x=c.get(g);for(let b of x.children.filter(a))--l[b.name]===0&&(d.push(b.name),m.push(b.name))}let f=d.map(g=>c.get(g)),h=C8(f,p);return w8(h,p),h}function C8(r,t){let e=new Map(r.map(a=>[a.name,a])),o=t.map(a=>a.name),n=new Set(o);for(;o.length>0;){let a=o.pop(),i=e.get(a);for(let p of i.children)!e.has(p.name)||n.has(p.name)||(n.add(p.name),o.push(p.name))}return r.filter(a=>n.has(a.name))}var fc=class extends Error{constructor(t){super(`NodesExecutionOrderError: ${t}`)}};function w8(r,t){let e=new Map(r.map((i,p)=>[i.name,p])),o=new Set(t.map(i=>i.name)),n=i=>o.has(typeof i==\"string\"?i:i.name),s=new Set(r.map(i=>i.name)),a=i=>s.has(typeof i==\"string\"?i:i.name);for(let i of r){for(let p of i.children.filter(a)){if(!e.has(p.name))throw new fc(`Child ${p.name} of node ${i.name} is unreachable.`);if(e.get(i.name)>e.get(p.name))throw new fc(`Node ${i.name} is scheduled to run after its child ${p.name}.`)}if(!n(i))for(let p of i.inputs){if(!e.has(p.name))throw new fc(`Input ${p.name} of node ${i.name} is unreachable.`);if(e.get(p.name)>e.get(i.name))throw new fc(`Node ${i.name} is scheduled to run before its input ${p.name}.`)}}}function jT(r){let t=new Map(r.map((i,p)=>[i.name,p])),e=Number.MAX_SAFE_INTEGER,o=r.map((i,p)=>mu(i)?e:p),n=i=>{let p=o[t.get(i.name)];return p==null?-1:p},s=r.map((i,p)=>i.children.map(n).reduce((u,c)=>Math.max(u,c),o[p])),a=new Map;for(let i=0;it[o].map(n=>n.id));this._weightIds=[].concat(...e),this._weightMap=t}set resourceManager(t){this._resourceManager=t}get inputs(){return this._inputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(t=>t.signatureKey||t.name)}get outputNodes(){return this._outputs.map(t=>{let e=t.signatureKey||t.name;return t.defaultOutput?`${e}:${t.defaultOutput}`:e})}get functions(){return Object.keys(this._functions).reduce((t,e)=>(t[e]=this._functions[e].signature,t),{})}constructor(t,e){this.graph=t,this.parent=e,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=\",\",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,t.functions!=null&&Object.keys(t.functions).forEach(o=>{this._functionExecutorMap[o]=new r(t.functions[o],this)})}getCompilationKey(t,e){let o=t.map(s=>s.name).sort(),n=e.map(s=>s.name).sort();return o.join(this.SEPARATOR)+\"--\"+n.join(this.SEPARATOR)}compile(t,e){let o=MS(t,e,this.weightMap,this._initNodes),{missingInputs:n,dynamicNode:s,syncInputs:a}=o;if(s!=null)throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`);if(n.length>0){let u=e.map(l=>l.name),c=Object.keys(t);throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${c}]. Missing the following inputs: [${n}]`)}let i=qT(this.graph,o),p=jT(i);return{orderedNodes:i,nodeLiveUntilMap:p}}cloneAndKeepTensor(t){if(t==null)return null;let e=t.clone();return Er(e),e}cloneTensorList(t){return t?t.map(o=>this.cloneAndKeepTensor(o)):null}cloneTensorMap(t){return Object.fromEntries(Object.entries(t).map(([e,o])=>[e,this.cloneTensorList(o)]))}execute(t,e){this.disposeIntermediateTensors(),t=this.mapInputs(t);let o=Object.keys(t).sort();this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e);let n=o.map(m=>this.graph.nodes[Nr(m)[0]]),s=e.map(m=>Nr(m)[0]),a=new Set(s),i=s.map(m=>this.graph.nodes[m]);i.length===0&&(i=this._outputs);let p=this.getCompilationKey(n,i),u=this.compiledMap.get(p);u==null&&(u=this.compile(t,i),this.compiledMap.set(p,u));try{this.keepIntermediateTensors=A().getBool(\"KEEP_INTERMEDIATE_TENSORS\")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let c={},l={};return De(()=>{let m=new Pl(this.weightMap,c,l,this.functionExecutorMap,this.parseNodeNameCache),d=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(t).forEach(x=>{let[b,C]=Nr(x,m),S=[];S[C]=t[x],d[b]=S,this.keepIntermediateTensors&&(this.clonedTensorsMap[b]=this.cloneTensorList(S))});let f=this.getFrozenTensorIds(d),{orderedNodes:h,nodeLiveUntilMap:g}=u;for(let x of h){if(d[x.name])continue;let b=OS(x,d,m,this._resourceManager);if(y.isPromise(b))throw new Error(`The execution of the op '${x.op}' returned a promise. Please use model.executeAsync() instead.`);d[x.name]=b,this.keepIntermediateTensors&&(this.clonedTensorsMap[x.name]=this.cloneTensorList(b)),this.checkTensorForDisposalWithNodeLiveUntilInfo(x,d,m,f,a,g.get(x.name))}return this.parent==null&&m.dispose(f),e.map(x=>Bt(x,d,m))})}getFrozenTensorIds(t){let e=[].concat.apply([],Object.keys(t).map(o=>t[o]).map(o=>o.map(n=>n.id)));return new Set(e)}checkTensorForDisposal(t,e,o,n,s,a,i){if(!(mu(e)||a.has(t))){for(let p of o[t])p!=null&&(i[p.id]=(i[p.id]||0)+e.children.length);for(let p of e.inputs){if(mu(p))continue;let u=fS(p.name,o,n);if(u!=null)for(let c of u){if(!c||c.kept||s.has(c.id))continue;let l=i[c.id];l===1?(c.dispose(),delete i[c.id]):l!=null&&i[c.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(t,e,o,n,s,a){function i(p){return mu(p)||s.has(p.name)}if(!(mu(t)||a==null))for(let p of a){if(i(p))continue;let u=fS(p.name,e,o);for(let c of u)!c||c.kept||n.has(c.id)||c.dispose()}}async executeAsync(t,e){return this._executeAsync(t,e)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(t=>{for(let e of t)e&&!e.isDisposed&&e.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(t,e,o=!1,n={},s={}){this.disposeIntermediateTensors(),o||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e));try{this.keepIntermediateTensors=A().getBool(\"KEEP_INTERMEDIATE_TENSORS\")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let a=new Pl(this.weightMap,n,s,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));let i=await this.executeWithControlFlow(t,a,e,o),p=e.map(m=>Bt(m,i,a)),u=p.map(m=>m.id),c=Object.keys(t).map(m=>t[m].id),l=new Set([...u,...c,...this.weightIds]);return Object.values(i).forEach(m=>{m.forEach(d=>{d&&!d.isDisposed&&!l.has(d.id)&&d.dispose()})}),this.parent==null&&a.dispose(l),p}async executeFunctionAsync(t,e,o){let n=t.reduce((s,a,i)=>(s[this.inputs[i].name]=a,s),{});return this._executeAsync(n,this.outputNodes,!0,e,o)}async executeWithControlFlow(t,e,o,n){let s=Object.keys(t),a=s.map(S=>this.graph.nodes[Nr(S)[0]]),i=o.map(S=>Nr(S)[0]),p=new Set(i),u=i.map(S=>this.graph.nodes[S]);u.length===0&&(u=this._outputs);let{usedNodes:c,missingInputs:l,dynamicNode:m,syncInputs:d}=MS(t,u,this.weightMap,this._initNodes),f=[...a,...this.graph.weights,...this._initNodes||[]].map(S=>({node:S,contexts:e.currentContext})),h=Object.assign({},this.weightMap);Object.keys(t).forEach(S=>{let[k,_]=Nr(S),E=[];E[_]=t[S],h[k]=E});let g={},x=this.getFrozenTensorIds(h),b={};for(;f.length>0;){let S=this.processStack(a,f,e,h,b,x,p,g,c);await Promise.all(S)}m==null&&!n&&console.warn(\"This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.\");let C=u.filter(S=>!mu(S)&&!Bt(S.name,h,e)).map(S=>S.name);if(C.length>0){let S=\"\";throw m!=null&&(S=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${C}] from the provided inputs [${s}]. Consider providing the following inputs: [${l}]. ${S}`)}return h}processStack(t,e,o,n,s,a,i,p,u){let c=[];for(;e.length>0;){let l=e.pop();o.currentContext=l.contexts;let m=\"\";if(l.node.op===\"Enter\"&&I(\"isConstant\",l.node,n,o)&&([m]=Ls(l.node.name,o)),n[l.node.name]==null){let d=OS(l.node,n,o,this._resourceManager);m||([m]=Ls(l.node.name,o));let f=o.currentContext;y.isPromise(d)?c.push(d.then(h=>(n[m]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(h)),o.currentContext=f,this.checkTensorForDisposal(m,l.node,n,o,a,i,p),this.processChildNodes(l.node,e,o,n,s,u),h))):(n[m]=d,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(d)),this.checkTensorForDisposal(m,l.node,n,o,a,i,p),this.processChildNodes(l.node,e,o,n,s,u))}else this.processChildNodes(l.node,e,o,n,s,u)}return c}processChildNodes(t,e,o,n,s,a){t.children.forEach(i=>{let[p]=Ls(i.name,o);s[p]||!a.has(i.name)||(i.op===\"Merge\"?i.inputNames.some(u=>!!Bt(u,n,o))&&(s[p]=!0,e.push({contexts:o.currentContext,node:i})):i.inputNames.every(u=>!!Bt(u,n,o))&&(s[p]=!0,e.push({contexts:o.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(t=>this.weightMap[t].forEach(e=>e.dispose()))}checkInputShapeAndType(t){Object.keys(t).forEach(e=>{let o=t[e],[n]=Nr(e),s=this.graph.nodes[n];if(s.attrParams.shape&&s.attrParams.shape.value){let a=s.attrParams.shape.value,i=a.length===o.shape.length&&o.shape.every((p,u)=>a[u]===-1||a[u]===p);y.assert(i,()=>`The shape of dict['${s.name}'] provided in model.execute(dict) must be [${a}], but was [${o.shape}]`)}s.attrParams.dtype&&s.attrParams.dtype.value&&y.assert(o.dtype===s.attrParams.dtype.value,()=>`The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${o.dtype}`)})}mapInputs(t){var e,o;let n={};for(let s in t){let a=(o=(e=this._signature)===null||e===void 0?void 0:e.inputs)===null||o===void 0?void 0:o[s];a!=null?n[a.name]=t[s]:n[s]=t[s]}return n}checkInputs(t){let e=Object.keys(t).filter(o=>{let[n]=Nr(o);return this.graph.nodes[n]==null});if(e.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${e}] that are not part of graph`)}mapOutputs(t){return t.map(e=>{var o,n;let s=(n=(o=this._signature)===null||o===void 0?void 0:o.outputs)===null||n===void 0?void 0:n[e];return s!=null?s.name:e},{})}checkOutputs(t){t.forEach(e=>{let[o]=Nr(e);if(!this.graph.nodes[o])throw new Error(`The output '${e}' is not found in the graph`)})}};var vf=class{constructor(t={},e={}){this.hashTableNameToHandle=t,this.hashTableMap=e}addHashTable(t,e){this.hashTableNameToHandle[t]=e.handle,this.hashTableMap[e.id]=e}getHashTableHandleByName(t){return this.hashTableNameToHandle[t]}getHashTableById(t){return this.hashTableMap[t]}dispose(){for(let t in this.hashTableMap)this.hashTableMap[t].clearAndClose(),delete this.hashTableMap[t];for(let t in this.hashTableNameToHandle)this.hashTableNameToHandle[t].dispose(),delete this.hashTableNameToHandle[t]}};var T8=\"?tfjs-format=file\",_8=\"model.json\",Ml=class{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}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(t,e={},o=mi){this.modelUrl=t,this.loadOptions=e,this.version=\"n/a\",this.io=o,e==null&&(this.loadOptions={}),this.resourceManager=new vf}findIOHandler(){let t=this.modelUrl;if(t.load!=null)this.handler=t;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(t,this.loadOptions);else{let e=this.io.getLoadHandlers(t,this.loadOptions);if(e.length===0)e.push(this.io.browserHTTPRequest(t,this.loadOptions));else if(e.length>1)throw new Error(`Found more than one (${e.length}) load handlers for URL '${[t]}'`);this.handler=e[0]}}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 t=this.handler.load();return y.isPromise(t)?t.then(e=>this.loadSync(e)):this.loadSync(t)}loadSync(t){this.artifacts=t;let e=this.artifacts.modelTopology,o=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){let s=this.artifacts.userDefinedMetadata;s.signature!=null&&(o=s.signature),s.structuredOutputKeys!=null&&(this.structuredOutputKeys=s.structuredOutputKeys)}this.signature=o,this.version=`${e.versions.producer}.${e.versions.minConsumer}`;let n=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new Ol(Fl.Instance.transformGraph(e,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(n),this.executor.resourceManager=this.resourceManager,t.modelInitializer!=null&&t.modelInitializer.node!=null){let s=Fl.Instance.transformGraph(t.modelInitializer);this.initializer=new Ol(s),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=t.initializerSignature}return!0}async save(t,e){if(typeof t==\"string\"){let o=this.io.getSaveHandlers(t);if(o.length===0)throw new Error(`Cannot find any save handlers for URL '${t}'`);if(o.length>1)throw new Error(`Found more than one (${o.length}) save handlers for URL '${t}'`);t=o[0]}if(t.save==null)throw new Error(\"GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.\");return t.save(this.artifacts)}addStructuredOutputNames(t){if(this.structuredOutputKeys){let e=t instanceof mt?[t]:t,o={};return e.forEach((n,s)=>o[this.structuredOutputKeys[s]]=n),o}return t}predict(t,e){let o=this.execute(t,this.outputNodes);return this.addStructuredOutputNames(o)}async predictAsync(t,e){let o=await this.executeAsync(t,this.outputNodes);return this.addStructuredOutputNames(o)}normalizeInputs(t){var e;if(!(t instanceof mt)&&!Array.isArray(t)){let s=(e=this.signature)===null||e===void 0?void 0:e.inputs;if(s!=null)for(let a in s){let i=s[a];i.resourceId!=null&&(t[a]=this.resourceIdToCapturedInput[i.resourceId])}return t}t=Array.isArray(t)?t:[t];let o=Object.keys(this.resourceIdToCapturedInput).length;if(t.length+o!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-o} non-resource placeholders, while there are ${t.length} input tensors provided.`);let n=0;return this.inputNodes.reduce((s,a)=>{var i,p,u;let c=(u=(p=(i=this.signature)===null||i===void 0?void 0:i.inputs)===null||p===void 0?void 0:p[a])===null||u===void 0?void 0:u.resourceId;return c!=null?s[a]=this.resourceIdToCapturedInput[c]:s[a]=t[n++],s},{})}normalizeOutputs(t){return t=t||this.outputNodes,Array.isArray(t)?t:[t]}executeInitializerGraph(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(t){if(this.resourceIdToCapturedInput={},this.initializerSignature){let e=this.initializerSignature.outputs,o=Object.keys(e);for(let n=0;n1?o:o[0]}async executeAsync(t,e){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),t=this.normalizeInputs(t),e=this.normalizeOutputs(e);let o=await this.executor.executeAsync(t,e);return o.length>1?o:o[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(t){return Object.keys(t).reduce((e,o)=>(e[o]=[t[o]],e),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&Ot(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}};async function $8(r,t={},e=mi){if(r==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&&typeof r==\"string\"&&(r=R8(r));let o=new Ml(r,t,e);return await o.load(),o}function E8(r){if(r==null)throw new Error(\"modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model\");let t;if(r instanceof Array){let[o,n]=r;if(!o)throw new Error(\"modelJSON must be the first element of the array\");if(!n||!(n instanceof ArrayBuffer))throw new Error(\"An ArrayBuffer of weights must be the second element of the array\");if(!(\"modelTopology\"in o))throw new Error(\"Model JSON is missing 'modelTopology'\");if(!(\"weightsManifest\"in o))throw new Error(\"Model JSON is missing 'weightsManifest'\");let s=mi.getWeightSpecs(o.weightsManifest),a=mi.getModelArtifactsForJSONSync(o,s,n);t=mi.fromMemorySync(a)}else if(\"load\"in r)t=r;else if(\"modelTopology\"in r&&\"weightSpecs\"in r&&\"weightData\"in r)t=mi.fromMemorySync(r);else throw new Error(\"Unknown model format\");let e=new Ml(t);return e.load(),e}function R8(r){return r.endsWith(\"/\")||(r=r+\"/\"),`${r}${_8}${T8}`}var D8=\"4.14.0\";function Q(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>{e!=null&&y.assert(e.dtype!==\"complex64\",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var A8=Vt.whereImpl,hc=class r extends so{nextDataId(){return r.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new Bo(this,ur())}write(t,e,o){this.firstUse&&(this.firstUse=!1,A().get(\"IS_NODE\")&&w.warn(`\n============================\nHi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. \n============================`));let n={id:this.nextDataId()};return this.data.set(n,{values:t,dtype:o,refCount:1}),n}makeTensorInfo(t,e,o){let n;if(e===\"string\"&&o!=null&&o.length>0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,t,e)}else n=this.write(o,t,e);return{dataId:n,shape:t,dtype:e}}refCount(t){return this.data.has(t)?this.data.get(t).refCount:0}incRef(t){let e=this.data.get(t);e.refCount++}decRef(t){if(this.data.has(t)){let e=this.data.get(t);e.refCount--}}move(t,e,o,n,s){this.data.set(t,{values:e,dtype:n,refCount:s})}numDataIds(){return this.data.numDataIds()}async read(t){return this.readSync(t)}readSync(t){let{dtype:e,complexTensorInfos:o}=this.data.get(t);if(e===\"complex64\"){let n=this.readSync(o.real.dataId),s=this.readSync(o.imag.dataId);return w.mergeRealAndImagArrays(n,s)}return y.convertBackendValuesAndArrayBuffer(this.data.get(t).values,e)}bufferSync(t){let e=this.readSync(t.dataId);if(t.dtype===\"string\")try{let o=e.map(n=>y.decodeString(n));return me(t.shape,t.dtype,o)}catch(o){throw new Error(\"Failed to decode encoded string bytes into utf-8\")}return me(t.shape,t.dtype,e)}makeOutput(t,e,o){return ur().makeTensorFromTensorInfo(this.makeTensorInfo(e,o,t),this)}disposeData(t,e=!1){if(this.data.has(t)){if(this.data.get(t).refCount--,!e&&this.data.get(t).refCount>0)return!1;let{complexTensorInfos:o}=this.data.get(t);o!=null&&(this.disposeData(o.real.dataId,!0),this.disposeData(o.imag.dataId,!0)),this.data.delete(t)}return!0}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}async time(t){let e=y.now();return t(),{kernelMs:y.now()-e}}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(t){Q([t],\"where\");let e=this.readSync(t.dataId);return A8(t.shape,e)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};hc.nextDataId=0;var wc={};qe(wc,{addImpl:()=>zS,bincountImpl:()=>yc,bincountReduceImpl:()=>kf,bitwiseAndImpl:()=>VS,castImpl:()=>BS,ceilImpl:()=>WS,concatImpl:()=>np,equalImpl:()=>US,expImpl:()=>HS,expm1Impl:()=>qS,floorDivImpl:()=>XS,floorImpl:()=>jS,gatherNdImpl:()=>Nf,gatherV2Impl:()=>Tf,greaterEqualImpl:()=>QS,greaterImpl:()=>YS,lessEqualImpl:()=>JS,lessImpl:()=>ZS,linSpaceImpl:()=>_f,logImpl:()=>eI,maxImpl:()=>$f,maximumImpl:()=>tI,minimumImpl:()=>rI,multiplyImpl:()=>Ll,negImpl:()=>oI,notEqualImpl:()=>nI,prodImpl:()=>sI,raggedGatherImpl:()=>Ef,raggedRangeImpl:()=>Rf,raggedTensorToTensorImpl:()=>Df,rangeImpl:()=>ap,rsqrtImpl:()=>iI,scatterImpl:()=>zs,sigmoidImpl:()=>k_,simpleAbsImpl:()=>LS,sliceImpl:()=>ip,sparseFillEmptyRowsImpl:()=>Af,sparseReshapeImpl:()=>Ff,sparseSegmentReductionImpl:()=>Cc,sqrtImpl:()=>__,squaredDifferenceImpl:()=>pI,staticRegexReplaceImpl:()=>cI,stridedSliceImpl:()=>Pf,stringNGramsImpl:()=>up,stringSplitImpl:()=>pp,stringToHashBucketFastImpl:()=>cp,subImpl:()=>mI,tileImpl:()=>Of,topKImpl:()=>Mf,transposeImpl:()=>bc,uniqueImpl:()=>lp});function LS(r){let t=new Float32Array(r.length);for(let e=0;e{let{x:t}=r.inputs,e=r.backend;Q(t,\"abs\");let o=new Float32Array(y.sizeFromShape(t.shape)),n=e.data.get(t.dataId).values;return o=LS(n),e.makeOutput(o,t.shape,t.dtype)},XT={kernelName:Xs,backendName:\"cpu\",kernelFunc:F8};function ze(r){return(t,e,o,n,s)=>{let a=w.assertAndGetBroadcastShape(t,e),i=a.length,p=y.computeStrides(a),u=y.sizeFromShape(a),c=y.getTypedArrayFromDType(s,u),l=t.length,m=e.length,d=y.computeStrides(t),f=y.computeStrides(e),h=w.getBroadcastDims(t,a),g=w.getBroadcastDims(e,a);if(h.length+g.length===0)for(let x=0;xC[E]=0);let S=y.locToIndex(C,l,d),k=b.slice(-m);g.forEach(E=>k[E]=0);let _=y.locToIndex(k,m,f);c[x]=r(o[S],n[_])}return[c,a]}}function Ht(r){let{inputs:t,backend:e}=r,{real:o,imag:n}=t,s=e.data.get(o.dataId).values,a=e.data.get(n.dataId).values,i=e.makeTensorInfo(o.shape,\"complex64\"),p=e.data.get(i.dataId);return p.complexTensorInfos={real:e.makeTensorInfo(o.shape,\"float32\",s),imag:e.makeTensorInfo(n.shape,\"float32\",a)},i}var YT={kernelName:Ri,backendName:\"cpu\",kernelFunc:Ht};function gc(r,t,e=\"float32\"){if(e===\"complex64\"){let n=gc(r,t,\"float32\"),s=gc(r,t,\"float32\");return Ht({inputs:{real:n,imag:s},backend:r})}let o=y.makeZerosTypedArray(y.sizeFromShape(t),e);return r.makeTensorInfo(t,e,o)}function lr(r){let{inputs:t,backend:e}=r,{x:o}=t;return e.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var QT={kernelName:Co,backendName:\"cpu\",kernelFunc:lr};function Eo(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.data.get(o.dataId).complexTensorInfos.real,s=e.data.get(n.dataId).values;return e.makeTensorInfo(n.shape,n.dtype,s)}var ZT={kernelName:Gi,backendName:\"cpu\",kernelFunc:Eo};function BS(r,t,e,o){if(o===\"int32\"){let n=Int32Array.from(r);return[t,\"int32\",n]}if(o===\"bool\"){let n=y.toTypedArray([0],e),[s,a]=ze((i,p)=>i!==p?1:0)(t,[],r,n,\"bool\");return[a,\"bool\",s]}throw new Error(`Error in Cast: failed to cast ${e} to ${o}`)}function Ro(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dtype:s}=o;if(s===\"complex64\"){if(n.dtype===\"complex64\")return lr({inputs:{x:n},backend:e});let c=gc(e,n.shape,n.dtype),l=Ro({inputs:{x:n},backend:e,attrs:{dtype:\"float32\"}}),m=Ht({inputs:{real:l,imag:c},backend:e});return e.disposeIntermediateTensorInfo(c),e.disposeIntermediateTensorInfo(l),m}if(n.dtype===\"complex64\"){let c=Eo({inputs:{input:n},backend:e}),l=Ro({inputs:{x:c},backend:e,attrs:{dtype:s}});return e.disposeIntermediateTensorInfo(c),l}if(!y.hasEncodingLoss(n.dtype,s)){let c=lr({inputs:{x:n},backend:e});return{dataId:c.dataId,shape:c.shape,dtype:s}}let a=e.data.get(n.dataId).values,[i,p,u]=BS(a,n.shape,n.dtype,s);return e.makeTensorInfo(i,p,u)}var JT={kernelName:yo,backendName:\"cpu\",kernelFunc:Ro};function Ye(r,t,e,o){return e==null?({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;Q([a,i],r);let u=p.data.get(a.dataId).values,c=p.data.get(i.dataId).values,l=a.dtype===\"string\"?w.fromUint8ToStringArray(u):u,m=a.dtype===\"string\"?w.fromUint8ToStringArray(c):c,d=o||a.dtype,[f,h]=t(a.shape,i.shape,l,m,d);return p.makeTensorInfo(h,d,f)}:({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(a.dtype===\"complex64\"||i.dtype===\"complex64\"){let u=Ro({inputs:{x:a},backend:p,attrs:{dtype:\"complex64\"}}),c=p.data.get(u.dataId),l=c.complexTensorInfos.real,m=c.complexTensorInfos.imag,d=p.data.get(l.dataId).values,f=p.data.get(m.dataId).values,h=Ro({inputs:{x:i},backend:p,attrs:{dtype:\"complex64\"}}),g=p.data.get(h.dataId),x=g.complexTensorInfos.real,b=g.complexTensorInfos.imag,C=p.data.get(x.dataId).values,S=p.data.get(b.dataId).values,[k,_,E]=e(a.shape,i.shape,d,f,C,S),R=p.makeTensorInfo(E,\"float32\",k),D=p.makeTensorInfo(E,\"float32\",_),P=Ht({inputs:{real:R,imag:D},backend:p});return p.disposeIntermediateTensorInfo(u),p.disposeIntermediateTensorInfo(h),p.disposeIntermediateTensorInfo(R),p.disposeIntermediateTensorInfo(D),P}else{let u=p.data.get(a.dataId).values,c=p.data.get(i.dataId).values,l=o||a.dtype,[m,d]=t(a.shape,i.shape,u,c,l);return p.makeTensorInfo(d,l,m)}}}function xc(r){return(t,e,o,n,s,a)=>{let i=w.assertAndGetBroadcastShape(t,e),p=y.sizeFromShape(i),u=i.length,c=y.computeStrides(i),l=y.getTypedArrayFromDType(\"float32\",p),m=y.getTypedArrayFromDType(\"float32\",p),d=w.getBroadcastDims(t,i),f=w.getBroadcastDims(e,i),h=w.mergeRealAndImagArrays(o,n),g=w.mergeRealAndImagArrays(s,a),x=t.length,b=y.computeStrides(t),C=e.length,S=y.computeStrides(e);if(d.length+f.length===0)for(let k=0;kE[M]=0);let R=y.locToIndex(E,x,b),D=_.slice(-C);f.forEach(M=>D[M]=0);let P=y.locToIndex(D,C,S),O=r(h[R*2],h[R*2+1],g[P*2],g[P*2+1]);l[k]=O.real,m[k]=O.imag}return[l,m,i]}}var zS=ze((r,t)=>r+t),P8=xc((r,t,e,o)=>({real:r+e,imag:t+o})),Pa=Ye(io,zS,P8),e_={kernelName:io,backendName:\"cpu\",kernelFunc:Pa};function yc(r,t,e,o,n){let s=y.sizeFromShape(o),a=y.makeZerosTypedArray(n,e);for(let i=0;i=n||(s>0?a[p]+=t[i]:a[p]+=1)}return a}function kf(r,t,e,o=!1){let n=r.shape[0],s=r.shape[1],a=me([n,e],t.dtype);for(let i=0;i=e||(o?a.set(1,i,u):t.size>0?a.set(a.get(i,u)+t.get(i,p),i,u):a.set(a.get(i,u)+1,i,u))}return a}var VS=ze((r,t)=>r&t),O8=Ye(qa,VS),t_={kernelName:qa,backendName:\"cpu\",kernelFunc:O8};function jt(r){return(t,e,o)=>{let n=y.getArrayFromDType(e,t.length);for(let s=0;s{let{x:a}=o;Q(a,r);let i=s,p=i.data.get(a.dataId).values,u;if(a.dtype===\"string\"){if(!Array.isArray(p))throw new Error(\"String tensor's value was not an instance of Array\");u=w.fromUint8ToStringArray(p)}else u=p;let c=e||a.dtype,l=t(u,c,n);return i.makeTensorInfo(a.shape,c,l)}}var WS=jt(r=>Math.ceil(r)),M8=Dr(en,WS),r_={kernelName:en,backendName:\"cpu\",kernelFunc:M8};function np(r,t,e,o){let n=y.getArrayFromDType(e,y.sizeFromShape(t));if(o&&e!==\"string\"){let s=0;r.forEach(a=>{let i=y.sizeFromShape(a.shape);n.set(a.vals,s),s+=i})}else{let s=0;r.forEach(a=>{let i=e===\"string\"?w.fromUint8ToStringArray(a.vals):a.vals,p=0;for(let u=0;ur===t?1:0),GS=Ye(xn,US,null,\"bool\"),o_={kernelName:xn,backendName:\"cpu\",kernelFunc:GS};var HS=jt(r=>Math.exp(r)),KS=Dr(yn,HS,\"float32\"),n_={kernelName:yn,backendName:\"cpu\",kernelFunc:KS};var qS=jt(r=>Math.expm1(r)),L8=Dr(bn,qS),s_={kernelName:bn,backendName:\"cpu\",kernelFunc:L8};var jS=jt(r=>Math.floor(r)),B8=Dr(wn,jS),a_={kernelName:wn,backendName:\"cpu\",kernelFunc:B8};var XS=ze((r,t)=>Math.floor(r/t)),z8=Ye(Sn,XS,null,\"int32\"),i_={kernelName:Sn,backendName:\"cpu\",kernelFunc:z8};function Nf(r,t,e,o,n,s,a,i,p){let u=me([o,s],e);for(let c=0;c=p/s)throw new Error(`Invalid indices: ${l} does not index into ${i}`);for(let d=0;dr>t?1:0),V8=Ye(kn,YS,null,\"bool\"),u_={kernelName:kn,backendName:\"cpu\",kernelFunc:V8};var QS=ze((r,t)=>r>=t?1:0),W8=Ye(Nn,QS,null,\"bool\"),p_={kernelName:Nn,backendName:\"cpu\",kernelFunc:W8};var ZS=ze((r,t)=>rr<=t?1:0),G8=Ye(Dn,JS,null,\"bool\"),l_={kernelName:Dn,backendName:\"cpu\",kernelFunc:G8};function _f(r,t,e){let o=(t-r)/(e-1),n=y.makeZerosTypedArray(e,\"float32\");n[0]=r;for(let s=1;sMath.log(r)),H8=Dr(Fn,eI),m_={kernelName:Fn,backendName:\"cpu\",kernelFunc:H8};function $f(r,t,e,o){let n=y.getTypedArrayFromDType(o,y.sizeFromShape(e));for(let s=0;si)&&(i=u)}n[s]=i}return n}var tI=ze((r,t)=>Math.max(r,t)),K8=Ye(Vn,tI),d_={kernelName:Vn,backendName:\"cpu\",kernelFunc:K8};var rI=ze((r,t)=>Math.min(r,t)),q8=Ye(Hn,rI),f_={kernelName:Hn,backendName:\"cpu\",kernelFunc:q8};var Ll=ze((r,t)=>r*t),j8=xc((r,t,e,o)=>({real:r*e-t*o,imag:r*o+t*e})),sp=Ye(Xn,Ll,j8),h_={kernelName:Xn,backendName:\"cpu\",kernelFunc:sp};function oI(r,t,e){let o=y.createScalarValue(-1,e);return Ll([],t,o,r,e)}function X8(r){let{inputs:t,backend:e}=r,{x:o}=t;Q(o,\"neg\");let n=e.data.get(o.dataId).values,[s,a]=oI(n,o.shape,o.dtype);return e.makeTensorInfo(a,o.dtype,s)}var g_={kernelName:pa,backendName:\"cpu\",kernelFunc:X8};var nI=ze((r,t)=>r!==t?1:0),Y8=Ye(Yn,nI,null,\"bool\"),x_={kernelName:Yn,backendName:\"cpu\",kernelFunc:Y8};function bc(r,t,e,o,n){let s=t.length,a=y.sizeFromShape(t),i=y.computeStrides(t),p=y.computeStrides(n),u=y.getTypedArrayFromDType(e,y.sizeFromShape(n));for(let c=0;ce.disposeIntermediateTensorInfo(b)),e.makeTensorInfo(x,g,f)}var b_={kernelName:os,backendName:\"cpu\",kernelFunc:Q8};function Z8(r,t,e){r.forEach((o,n)=>{if(o<0||o>=e){let s=y.indexToLoc(n,t.length,y.computeStrides(t)).join(\",\");throw new Error(`indices[${s}] = ${o} is not in [0, ${e})`)}})}function J8(r,t){for(let e=0;en)throw new Error(\"Ragged splits must not point past values\");for(let s=1;so[s])throw new Error(\"Ragged splits must be sorted in ascending order\")}}function eY(r,t,e,o){let n=[],s=0,a=t.length-1+e.length,i=new Array(a).fill(null).map(()=>[0]);J8(e,o);let p=1;for(let u=0;u=0){let h=i[f],g=h[h.length-1]-d[c];for(let x=c;xn[a]=s)}return t}function C_(r,t){let e=r.slice(0,t);for(;e.length1)throw new Error(\"starts must be a scalar or vector\");if(n.length>1)throw new Error(\"limits must be a scalar or vector\");if(a.length>1)throw new Error(\"deltas must be a scalar or vector\");let i=t.length===0,p=n.length===0,u=a.length===0,c=[];i||c.push(t[0]),p||c.push(n[0]),u||c.push(a[0]);for(let g=1;g0&&bx)S=0;else if(S=Math.ceil(Math.abs((b-x)/C)),S>w_)throw new Error(`Requires ((limit - start) / delta) <= ${w_}`);m[g+1]=m[g]+S}let d=m[l],f=y.getArrayFromDType(e,d),h=0;for(let g=0;go&&(o=s)}return o}static getMaxWidthValueRowID(t){let e=t.length;if(e===0)return 0;let o=0,n=t[0],s=0;for(let a=1;a\"Final length of result must be equal to firstDimension.\"),s}calculateOutputIndexRowSplit(t,e,o,n){let s=t.length,a=[];for(let i=0;i0&&a.length!==t[s-1])throw new Error(\"Invalid row split size.\");return a}calculateOutputIndexValueRowID(t,e,o,n){let s=t.length,a=[];if(s===0)return[];let i=0,p=t[0];if(p>=e.length)throw new Error(`Got currentValueRowId=${p}, which is not less than ${e.length}`);let u=e[p];a.push(u);for(let c=1;c=0&&(++i,i=e.length)throw new Error(`Got nextValueRowId=${l} which is not less than ${e.length}`);u=e[l]}a.push(u)}if(a.length!==t.length)throw new Error(\"Invalid row ids.\");return a}calculateOutputIndex(t,e,o,n){let s=this.getRowPartitionTensor(t),a=this.getRowPartitionTypeByDimension(t);switch(a){case Do.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,e,o,n);case Do.ROW_SPLITS:if(s.length-1>e.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${e.length}`);return this.calculateOutputIndexRowSplit(s,e,o,n);default:throw new Error(`Unsupported partition type: ${Do[a]}`)}}getFirstDimensionSize(){let t=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error(\"No row_partition_types given.\");let e=this.rowPartitionTypes[0];switch(e){case Do.FIRST_DIM_SIZE:return t[0];case Do.VALUE_ROWIDS:throw new Error(\"Cannot handle VALUE_ROWIDS in first dimension.\");case Do.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${Do[e]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error(\"Invalid first partition input. Tensor requires at least one element.\");let e=this.getFirstDimensionSize(),o=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let p=n.length-2;p>=0;--p)n[p]=n[p+1]*o[p+1];let s=I_(o,!1),a=y.getArrayFromDType(this.valuesDType,y.sizeFromShape(s));if(n[0]*o[0]>0){let p=this.calculateFirstParentOutputIndex(e,n[0],o[0]);for(let u=1;u<=this.raggedRank;++u)p=this.calculateOutputIndex(u-1,p,n[u],o[u]);this.setOutput(this.raggedRank,p,a,s)}return[s,a]}setOutput(t,e,o,n){if(o.length===0)return;let s=this.values,a=o,i=n.slice();i=i.slice(t+1);let p=y.sizeFromShape(i),u=e.length,c=this.defaultValue;if(c.length!==p&&c.length!==1){let f=this.defaultValueShape;De(()=>{let h=W(c,f);c=ou(h,i).dataSync()})}let l=0,m=0,d=0;for(let f=0;f<=u;++f){let h=f=u){let g=o.length;h=Math.floor(g/p)}if(h>d)if(this.defaultValue.length===1)a.subarray(d*p,h*p).fill(this.defaultValue[0]),d=h;else for(;h>d;){let g=a.slice(d*p);S_(g,c,p),++d}h<0?(l=f+1,m=d):(l=f,m=d,d=m+1)}}};function S_(r,t,e){for(let o=0;o= 0`);if(o<-1)throw new Error(`Dimension ${o} must be >= -1`);o=-1}e.push(o)}return e}function Df(r,t,e,o,n,s,a,i,p,u){return new aI(r,t,e,o,n,s,a,i,p,u).compute()}function ap(r,t,e,o){let n=r===t,s=r1;if(n||s||a)return y.makeZerosTypedArray(0,o);let i=Math.abs(Math.ceil((t-r)/e)),p=y.makeZerosTypedArray(i,o);t1/Math.sqrt(r)),nY=Dr(ls,iI),v_={kernelName:ls,backendName:\"cpu\",kernelFunc:nY};function zs(r,t,e,o,n,s,a,i,p,u){let c=[o/n,n],l=r.values,m=t.values;if(o===0)return me(e,t.dtype);let d=p instanceof tt?p:me(c,t.dtype);typeof p==\"string\"||typeof p==\"number\"?d.values.fill(p):typeof p==\"boolean\"&&d.values.fill(+p);for(let f=0;f=o/n)throw new Error(`Invalid indices: ${h} does not index into ${e}`);for(let x=0;x1/(1+Math.exp(-r))),uI=Ie(bs,r=>1/(1+Math.exp(-r))),N_={kernelName:bs,backendName:\"cpu\",kernelFunc:uI};function ip(r,t,e,o,n){let s=pt.isSliceContinous(o,t,e),a=y.sizeFromShape(e),i=y.computeStrides(o);if(s){let l=pt.computeFlatOffset(t,i);return n===\"string\"?r.slice(l,l+a):r.subarray(l,l+a)}let p=n===\"string\"?w.fromUint8ToStringArray(r):r,u=me(o,n,p),c=me(e,n);for(let l=0;lf+t[h]);c.set(u.get(...d),...m)}return n===\"string\"?w.fromStringArrayToUint8(c.values):c.values}function Ao(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,size:a}=o;Q(n,\"slice\");let[i,p]=pt.parseSliceParams(n,s,a);pt.assertParamsValid(n,i,p);let u=e.data.get(n.dataId).values,c=ip(u,i,p,n.shape,n.dtype);return e.makeTensorInfo(p,n.dtype,c)}var T_={kernelName:ha,backendName:\"cpu\",kernelFunc:Ao};function Af(r,t,e,o,n,s,a){let i=t[0],p=s[0],u=new Array(p),c=new Array(i),l=t[1];if(p===0){if(i!==0)throw new Error(w.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i));let g=y.getArrayFromDType(e,0),x=y.getArrayFromDType(n,0);return[g,[0,l],x,u,c]}let m=!0,d=0,f=new Array(p).fill(0);for(let g=0;g=p)throw new Error(w.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,x,p));++f[x],m=m&&x>=d,d=x}let h=!0;for(let g=0;g0&&(f[g]+=f[g-1])}if(h&&m){let g=r,x=o;for(let b=0;b0){d[m-1]=1;for(let g=m-2;g>=0;--g)d[g]=d[g+1]*o[g+1]}let f=[];if(i>0){f[i-1]=1;for(let g=i-2;g>=0;--g)f[g]=f[g+1]*p[g+1]}let h=y.getArrayFromDType(e,a*i);for(let g=0;g0?n[i-1]+1:0;if(l<0)throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=t.slice();m[0]=l;let d=m.reduce((C,S)=>C*S,1),f=y.getArrayFromDType(e,d);if(i===0)return l>0&&f.fill(a),[f,m];if(l<=0)throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let h=0,g=1,x=0,b=n[h];for(;;){let C=0;if(g=C)throw new Error(w.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(b<0||b>=l)throw new Error(w.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b,l));b>x&&f.fill(a,x*u,b*u);for(let S=h;S=p[0])throw new Error(w.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S,o[S],p[0]));for(let _=0;_i)break}return xMath.sqrt(r)),sY=Ie(ws,r=>Math.sqrt(r)),$_={kernelName:ws,backendName:\"cpu\",kernelFunc:sY};var pI=ze((r,t)=>{let e=r-t;return e*e}),aY=Ye(ks,pI),E_={kernelName:ks,backendName:\"cpu\",kernelFunc:aY};var cI=jt((r,t)=>{let{pattern:e,replaceGlobal:o,rewrite:n}=t;return r.replace(new RegExp(e,o?\"g\":\"\"),n)}),iY=Dr($u,cI),R_={kernelName:$u,backendName:\"cpu\",kernelFunc:iY};function Pf(r,t,e,o){let n=me(r,t.dtype);for(let s=0;s0?0:i-p),d=0;d+=u*this.leftPad.length;for(let b=0;bb.forEach(C=>h[g++]=C);for(let b=0;b0){x(t[m+l-1]);for(let b=0;b0){let p=e[0];if(p!==0)throw new Error(`First split value must be 0, got ${p}`);for(let u=1;u=p;if(c=c&&e[u]<=o,!c)throw new Error(`Invalid split value ${e[u]}, must be in [${p}, ${o}]`);p=e[u]}if(p!==o)throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`)}let s=n-1,a=y.getArrayFromDType(\"int32\",n);if(o===0||n===0){let p=new Array(o);for(let u=0;u<=s;++u)a[u]=0;return[p,a]}a[0]=0;for(let p=1;p<=s;++p){let u=e[p]-e[p-1],c=0;this.nGramWidths.forEach(l=>{c+=this.getNumNGrams(u,l)}),this.preserveShort&&u>0&&c===0&&(c=1),a[p]=a[p-1]+c}let i=new Array(a[s]);for(let p=0;p{let m=e[p+1]-e[p],d=this.getNumNGrams(m,l);this.createNGrams(t,u,i,c,d,l),c+=d}),this.preserveShort&&c===a[p]){let l=e[p+1]-e[p];if(l===0)continue;let m=l+2*this.padWidth,d=1;this.createNGrams(t,u,i,c,d,m)}}return[i,a]}};function up(r,t,e,o,n,s,a,i){return new lI(e,o,n,s,a,i).compute(r,t)}function uY(r,t,e,o){if(!r.length)return;if(t.length===0){for(let s=0;sr-t),pY=xc((r,t,e,o)=>({real:r-e,imag:t-o})),Bl=Ye(Ts,mI,pY),D_={kernelName:Ts,backendName:\"cpu\",kernelFunc:Bl};function Of(r,t){let e=new Array(r.rank);for(let n=0;n{let e=t.value-r.value;return e===0?r.index-t.index:e};function A_(r,t,e=0,o=r.length-1){for(;o>e;){if(o-e>600){let i=o-e+1,p=t-e+1,u=Math.log(i),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(i-c)/i)*Math.sign(p-i/2),m=Math.max(e,Math.floor(t-p*c/i+l)),d=Math.min(o,Math.floor(t+(i-p)*c/i+l));A_(r,t,m,d)}let n=r[t],s=e,a=o;for(y.swap(r,e,t),zl(r[o],n)>0&&y.swap(r,e,o);s0;)a=a-1}zl(r[e],n)===0?y.swap(r,e,a):(a=a+1,y.swap(r,a,o)),a<=t&&(e=a+1),t<=a&&(o=a-1)}}function Mf(r,t,e,o,n){let s=t[t.length-1],[a,i]=[r.length/s,s],p=y.getTypedArrayFromDType(e,a*o),u=y.getTypedArrayFromDType(\"int32\",a*o);for(let l=0;lf[C]={value:b,index:C}),o{for(let g=0;gnew hc,1);var dI=Ie(hn,r=>r>=0?r:Math.exp(r)-1),F_={kernelName:hn,backendName:\"cpu\",kernelFunc:dI};function fI(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{alpha:s}=o;Q([n],\"leakyRelu\");let a=y.sizeFromShape(n.shape),i=e.data.get(n.dataId).values,p=y.getTypedArrayFromDType(\"float32\",a);for(let u=0;ur<0?t*r:r);function hI(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t;Q([o,n],\"prelu\");let s=e.data.get(o.dataId).values,a=e.data.get(n.dataId).values,[i,p]=lY(o.shape,n.shape,s,a,\"float32\");return e.makeTensorInfo(p,\"float32\",i)}var O_={kernelName:rs,backendName:\"cpu\",kernelFunc:hI};var gI=Ie(ss,r=>Math.max(0,r)),M_={kernelName:ss,backendName:\"cpu\",kernelFunc:gI};var xI=Ie(us,r=>Math.min(Math.max(0,r),6)),L_={kernelName:us,backendName:\"cpu\",kernelFunc:xI};function mp(r,t,e,o,n){if(e===\"linear\")return lr({inputs:{x:t},backend:r});if(e===\"relu\")return gI({inputs:{x:t},backend:r});if(e===\"elu\")return dI({inputs:{x:t},backend:r});if(e===\"relu6\")return xI({inputs:{x:t},backend:r});if(e===\"prelu\")return hI({inputs:{x:t,alpha:o},backend:r});if(e===\"leakyrelu\")return fI({inputs:{x:t},backend:r,attrs:{alpha:n}});if(e===\"sigmoid\")return uI({inputs:{x:t},backend:r});throw new Error(`Activation ${e} has not been implemented for the CPU backend.`)}function Ve(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{shape:s}=o,a=y.sizeFromShape(n.shape),i=y.inferFromImplicitShape(s,a),p=y.sizeFromShape(i);y.assert(a===p,()=>`The new shape (${i}) has ${p} elements and the old shape (${n.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`),e.incRef(n.dataId);let u=e.data.get(n.dataId);if(u.complexTensorInfos!=null){let c=u.complexTensorInfos.real,l=u.complexTensorInfos.imag;c.shape=i,l.shape=i}return{dataId:n.dataId,shape:i,dtype:n.dtype}}var B_={kernelName:da,backendName:\"cpu\",kernelFunc:Ve};function yI(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;Q([n,s],\"matMul\");let p=n.shape.length,u=s.shape.length,c=a?n.shape[p-2]:n.shape[p-1],l=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),C=Sr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(c===l,()=>`Error in matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,c,m]:[g,m,c],k=i?[x,d,l]:[x,l,d],_=Ve({inputs:{x:n},backend:e,attrs:{shape:S}}),E=Ve({inputs:{x:s},backend:e,attrs:{shape:k}}),R=a?_.shape[1]:_.shape[2],D=a?_.shape[2]:_.shape[1],P=i?E.shape[1]:E.shape[2],O=Math.max(g,x),M=e.data.get(_.dataId).values,L=e.data.get(E.dataId).values,B=y.computeStrides(_.shape),z=y.computeStrides(E.shape),[U,j,q]=a?[B[0],1,B[1]]:[B[0],B[1],1],[Y,J,re]=i?[1,z[1],z[0]]:[z[1],1,z[0]],ne=D*P,ee=me([O,D,P],_.dtype),oe=ee.values,ie=e.blockSize;for(let le=0;leMath.acos(r)),W_={kernelName:Vo,backendName:\"cpu\",kernelFunc:dY};var fY=Ie(Wo,r=>Math.acosh(r)),U_={kernelName:Wo,backendName:\"cpu\",kernelFunc:fY};function hY(r){let{inputs:t,backend:e}=r,o=t;Q(t,\"addN\");let n=o.map(i=>e.data.get(i.dataId).values),s=me(o[0].shape,o[0].dtype),a=s.values;for(let i=0;ib&&(b=k,C=S)}d[g]=C}return u.forEach(g=>e.disposeIntermediateTensorInfo(g)),e.makeTensorInfo(c,\"int32\",d)}var q_={kernelName:Ys,backendName:\"cpu\",kernelFunc:yY};function bY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o;Q(n,\"argMin\");let a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=St({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),a=[a[0]],w.assertAxesAreInnerMostDims(\"argMin\",a,p.shape.length);let[c,l]=w.computeOutAndReduceShapes(p.shape,a),m=y.sizeFromShape(c),d=y.makeZerosTypedArray(m,\"int32\"),f=y.sizeFromShape(l),h=e.data.get(p.dataId).values;for(let g=0;ge.disposeIntermediateTensorInfo(g)),e.makeTensorInfo(c,\"int32\",d)}var j_={kernelName:Qs,backendName:\"cpu\",kernelFunc:bY};var CY=Ie(Ko,r=>Math.asin(r)),X_={kernelName:Ko,backendName:\"cpu\",kernelFunc:CY};var wY=Ie(qo,r=>Math.asinh(r)),Y_={kernelName:qo,backendName:\"cpu\",kernelFunc:wY};var SY=Ie(jo,r=>Math.atan(r)),Q_={kernelName:jo,backendName:\"cpu\",kernelFunc:SY};var IY=ze((r,t)=>Math.atan2(r,t)),vY=Ye(Yo,IY),Z_={kernelName:Yo,backendName:\"cpu\",kernelFunc:vY};var kY=Ie(Xo,r=>Math.atanh(r)),J_={kernelName:Xo,backendName:\"cpu\",kernelFunc:kY};function Sc(r,t,e,o,n,s){let a=n.strideHeight,i=n.strideWidth,p=n.dilationHeight,u=n.dilationWidth,c=n.effectiveFilterHeight,l=n.effectiveFilterWidth,m=n.padInfo.top,d=n.padInfo.left,f=s===\"max\"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,h=me(n.outShape,e),g=h.values,x=n.outShape[1]*n.outShape[2]*n.outShape[3],b=n.outShape[2]*n.outShape[3],C=n.outShape[3];for(let S=0;Sj?j=ie:s===\"avg\"&&(q+=ie,Y++)}if(isNaN(j))break}let J=M+L*C+E;g[J]=s===\"avg\"?q/Y:j}}}return h}function Lf(r,t,e,o,n=!1,s=!1){let a=me(o.outShape,\"int32\"),i=o.strideHeight,p=o.strideWidth,u=o.dilationHeight,c=o.dilationWidth,l=o.effectiveFilterHeight,m=o.effectiveFilterWidth,d=o.padInfo.top,f=o.padInfo.left,h=me(t,e,r);for(let g=0;gP&&(P=U,n?O=s?((g*o.inHeight+M)*o.inWidth+B)*o.inChannels+x:(M*o.inWidth+B)*o.inChannels+x:O=L*m+z)}}a.set(O,g,b,_,x)}}return a}function Bf(r,t,e,o,n,s){let a=n.strideDepth,i=n.strideHeight,p=n.strideWidth,u=n.dilationDepth,c=n.dilationHeight,l=n.dilationWidth,m=n.effectiveFilterDepth,d=n.effectiveFilterHeight,f=n.effectiveFilterWidth,h=n.padInfo.front,g=n.padInfo.top,x=n.padInfo.left,b=s===\"max\"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,C=me(n.outShape,e),S=C.values,k=n.outShape[1]*n.outShape[2]*n.outShape[3]*n.outShape[4],_=n.outShape[2]*n.outShape[3]*n.outShape[4],E=n.outShape[3]*n.outShape[4],R=n.outShape[4];for(let D=0;D_e?_e=gt:s===\"avg\"&&(ve+=gt,Fe++),isNaN(_e))break}if(isNaN(_e))break}if(isNaN(_e))break}let Pe=be+M;S[Pe]=s===\"avg\"?ve/Math.max(Fe,1):_e}}}}return C}function e$(r,t){let e=me(t.outShape,\"int32\"),o=t.strideDepth,n=t.strideHeight,s=t.strideWidth,a=t.dilationDepth,i=t.dilationHeight,p=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,l=t.effectiveFilterWidth,m=t.padInfo.front,d=t.padInfo.top,f=t.padInfo.left;for(let h=0;h=L&&(L=re,B=U*c*l+q*c+J)}}}e.set(B,h,x,k,D,g)}}}return e}function NY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t;Q(n,\"avgPool\");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(w.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p),l;if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))l=lr({inputs:{x:n},backend:e});else{let m=e.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=Sc(m,n.shape,n.dtype,d,c,\"avg\");l=e.makeTensorInfo(c.outShape,n.dtype,f.values)}return l}var t$={kernelName:Qo,backendName:\"cpu\",kernelFunc:NY};function TY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,\"avgPool3d\");let c=w.computePool3DInfo(n.shape,s,a,1,i,p,u),l=e.data.get(n.dataId).values,m=Bf(l,n.shape,n.dtype,y.computeStrides(n.shape),c,\"avg\");return e.makeTensorInfo(m.shape,\"float32\",m.values)}var r$={kernelName:Zs,backendName:\"cpu\",kernelFunc:TY};function _Y(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],\"avgPool3DGrad\");let c=w.computePool3DInfo(s.shape,a,i,1,p,u),l=c.strideDepth,m=c.strideHeight,d=c.strideWidth,f=c.filterDepth,h=c.filterHeight,g=c.filterWidth,x=c.dilationDepth,b=c.dilationHeight,C=c.dilationWidth,S=c.effectiveFilterDepth,k=c.effectiveFilterHeight,_=c.effectiveFilterWidth,E=S-1-c.padInfo.front,R=_-1-c.padInfo.left,D=k-1-c.padInfo.top,P=me(s.shape,\"float32\"),O=1/(f*h*g),M=e.bufferSync(n);for(let L=0;L=c.outDepth||Math.floor(ee)!==ee))for(let oe=0;oe=c.outHeight||Math.floor(ie)!==ie))for(let le=0;le<_;le+=C){let be=(J+le)/d;if(be<0||be>=c.outWidth||Math.floor(be)!==be)continue;let _e=M.get(L,ee,ie,be,B);re+=_e}}}P.set(re*O,L,z,U,j,B)}return e.makeTensorInfo(P.shape,P.dtype,P.values)}var o$={kernelName:Ei,backendName:\"cpu\",kernelFunc:_Y};function $Y(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s;Q([n,s],\"avgPoolGrad\");let{filterSize:i,strides:p,pad:u}=o,c=w.computePool2DInfo(a.shape,i,p,1,u),l=c.strideHeight,m=c.strideWidth,d=c.filterHeight,f=c.filterWidth,h=c.dilationHeight,g=c.dilationWidth,x=c.effectiveFilterHeight,b=c.effectiveFilterWidth,C=b-1-c.padInfo.left,S=x-1-c.padInfo.top,k=me(a.shape,\"float32\"),_=1/(d*f),E=e.data.get(n.dataId).values,R=me(n.shape,\"float32\",E);for(let D=0;D=c.outHeight||Math.floor(j)!==j))for(let q=0;q=c.outWidth||Math.floor(Y)!==Y)continue;let J=R.get(D,j,Y,P);z+=J}}k.set(z*_,D,O,M,P)}return e.makeTensorInfo(k.shape,k.dtype,k.values)}var n$={kernelName:$i,backendName:\"cpu\",kernelFunc:$Y};function EY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,scale:s,offset:a,mean:i,variance:p}=t;y.assert(i.shape.length===p.shape.length,()=>\"Batch normalization gradient requires mean and variance to have equal ranks.\"),y.assert(a==null||i.shape.length===a.shape.length,()=>\"Batch normalization gradient requires mean and offset to have equal ranks.\"),y.assert(s==null||i.shape.length===s.shape.length,()=>\"Batch normalization gradient requires mean and scale to have equal ranks.\"),Q([n,i,p,s,a],\"batchNorm\");let{varianceEpsilon:u}=o;u==null&&(u=.001);let c=e.data.get(n.dataId).values,l=e.data.get(i.dataId).values,m=e.data.get(p.dataId).values,d=s?e.data.get(s.dataId).values:new Float32Array([1]),f=a?e.data.get(a.dataId).values:new Float32Array([0]),h=new Float32Array(c.length),g=f.length,x=d.length,b=m.length,C=l.length,S=0,k=0,_=0,E=0;for(let R=0;R=g&&(S=0),k>=C&&(k=0),_>=x&&(_=0),E>=b&&(E=0);return e.makeTensorInfo(n.shape,n.dtype,h)}var s$={kernelName:In,backendName:\"cpu\",kernelFunc:EY};function RY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,crops:a}=o;Q([n],\"batchToSpaceND\");let i=s.reduce((x,b)=>x*b),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=Ve({inputs:{x:n},backend:e,attrs:{shape:p}}),f=St({inputs:{x:d},backend:e,attrs:{perm:u}}),h=Ve({inputs:{x:f},backend:e,attrs:{shape:c}}),g=Ao({inputs:{x:h},backend:e,attrs:{begin:l,size:m}});return e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),g}var a$={kernelName:Js,backendName:\"cpu\",kernelFunc:RY};function DY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,u=yc(i,p,s.dtype,s.shape,a);return e.makeTensorInfo([a],s.dtype,u)}var i$={kernelName:Jo,backendName:\"cpu\",kernelFunc:DY};function AY(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t,s=e.data.get(o.dataId).values,a=e.data.get(n.dataId).values,i=w.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return e.makeTensorInfo([i.length],\"int32\",Int32Array.from(i))}var u$={kernelName:ea,backendName:\"cpu\",kernelFunc:AY};var FY=Ie(bo,(r,t)=>{let e=t;return r>e.clipValueMax?e.clipValueMax:r{let{x:t}=r.inputs,e=r.backend,o=new Float32Array(y.sizeFromShape(t.shape)),n=e.data.get(t.dataId),s=n.complexTensorInfos.real,a=n.complexTensorInfos.imag,i=e.data.get(s.dataId).values,p=e.data.get(a.dataId).values;for(let u=0;uh.shape);w.assertParamsConsistent(a,s);let i=w.computeOutShape(t.map(h=>h.shape),s);if(y.sizeFromShape(i)===0)return e.makeTensorInfo(i,t[0].dtype,[]);let p=t.filter(h=>y.sizeFromShape(h.shape)>0);if(p.length===1)return lr({inputs:{x:p[0]},backend:e});if(p[0].dtype===\"complex64\"){let h=p.map(S=>Eo({inputs:{input:S},backend:e})),g=p.map(S=>Oa({inputs:{input:S},backend:e})),x=du({inputs:h,backend:e,attrs:{axis:s}}),b=du({inputs:g,backend:e,attrs:{axis:s}}),C=Ht({inputs:{real:x,imag:b},backend:e});return h.forEach(S=>e.disposeIntermediateTensorInfo(S)),g.forEach(S=>e.disposeIntermediateTensorInfo(S)),e.disposeIntermediateTensorInfo(x),e.disposeIntermediateTensorInfo(b),C}let u=p.map(h=>{let x=[-1,y.sizeFromShape(h.shape.slice(s))];return Ve({inputs:{x:h},backend:e,attrs:{shape:x}})}),c=u.map(h=>({vals:e.data.get(h.dataId).values,shape:h.shape}));i=w.computeOutShape(u.map(h=>h.shape),1);let l=u[0].shape[0]===1,m=np(c,i,t[0].dtype,l),d=w.computeOutShape(p.map(h=>h.shape),s),f=e.makeTensorInfo(d,t[0].dtype,m);return u.forEach(h=>e.disposeIntermediateTensorInfo(h)),f}var m$={kernelName:ta,backendName:\"cpu\",kernelFunc:du};function bI(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=o;Q([n,s],\"conv2d\");let l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,s.shape,a,u,i,c,!1,l),d=m.filterHeight,f=m.filterWidth,h=m.dilationHeight,g=m.dilationWidth,x=m.padInfo.left,b=m.padInfo.top,C=m.dataFormat===\"channelsLast\",S=new tt(m.outShape,n.dtype),k=y.computeStrides(n.shape),_=y.computeStrides(s.shape),E=k[0],R=C?k[1]:k[2],D=C?k[2]:1,P=C?1:k[1],O=S.strides[0],M=C?S.strides[1]:S.strides[2],L=C?S.strides[2]:1,B=C?1:S.strides[1],z=e.data.get(n.dataId).values,U=e.data.get(s.dataId).values,j=S.values;for(let q=0;q=m.inHeight)continue;let le=oe*_[0],be=Y+ie*R;for(let _e=0;_e=m.inWidth)continue;let ct=le+Pe*_[1],Ge=be+st*D,lt=ct;for(let it=0;it=u.inDepth)continue;let q=U*D[0],Y=O+j*R[1];for(let J=0;J=u.inHeight)continue;let ie=q+ee*D[1],le=Y+oe*R[2];for(let be=0;be=u.inWidth)continue;let st=ie+Fe*D[2],ct=le+Pe*u.inChannels,Ge=st;for(let lt=0;ltMath.cos(r)),b$={kernelName:sn,backendName:\"cpu\",kernelFunc:VY};var WY=Ie(an,r=>Math.cosh(r)),C$={kernelName:an,backendName:\"cpu\",kernelFunc:WY};function UY(r){let{inputs:t,backend:e,attrs:o}=r,{image:n,boxes:s,boxInd:a}=t,{cropSize:i,method:p,extrapolationValue:u}=o,[c,l,m,d]=n.shape,f=s.shape[0],[h,g]=i,x=me([f,h,g,d],\"float32\"),b=e.data.get(s.dataId).values,C=e.data.get(a.dataId).values,S=e.data.get(n.dataId).values,k=y.computeStrides(n.shape),_=y.computeStrides(x.shape);for(let E=0;E=c)continue;let B=h>1?(O-D)*(l-1)/(h-1):0,z=g>1?(M-P)*(m-1)/(g-1):0;for(let U=0;U1?D*(l-1)+U*B:.5*(D+O)*(l-1);if(j<0||j>l-1){for(let q=0;q1?P*(m-1)+re*z:.5*(P+M)*(m-1);if(ne<0||ne>m-1){for(let le=0;le1?P*(m-1)+q*z:.5*(P+M)*(m-1);if(Y<0||Y>m-1){for(let ne=0;nex+f-b-1:(x,b)=>x+b;for(let x=0;xx+f-b-1:(x,b)=>x+b;for(let x=0;x`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`);let i=n.shape[0],p=n.shape[1],u=n.shape[2],c=n.shape[3],l=p*s,m=u*s,d=c/(s*s),f=e.data.get(n.dataId).values,h=new Float32Array(i*l*m*d),g=0;for(let x=0;x`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${m}'`);let d=w.computeConv2DInfo(n.shape,s.shape,a,m,i,u,!0),{filterHeight:f,filterWidth:h,dilationHeight:g,dilationWidth:x,padInfo:b}=d,C=b.left,S=b.top,k=d.outChannels/d.inChannels,_=new tt(d.outShape,n.dtype),E=e.data.get(n.dataId).values,R=e.data.get(s.dataId).values,D=_.values;for(let P=0;P=d.inHeight)continue;let q=U*l[0],Y=O+j*c[1];for(let J=0;J=d.inWidth)continue;let ie=q+ee*l[1],le=Y+oe*d.inChannels,be=re,_e=ie;for(let ve=0;ve{let{x:o,filter:n}=r,{strides:s,pad:a,dilations:i}=e,p=t,u=p.data.get(o.dataId).values,c=o.shape.length,l=p.data.get(n.dataId).values,m=n.shape.length,{batchSize:d,inHeight:f,inWidth:h,inChannels:g,outHeight:x,outWidth:b,padInfo:C,strideHeight:S,strideWidth:k,filterHeight:_,filterWidth:E,dilationHeight:R,dilationWidth:D,outShape:P}=w.computeDilation2DInfo(o.shape,n.shape,s,a,\"NHWC\",i),O=y.sizeFromShape(P),M=P.length,L=y.getArrayFromDType(o.dtype,O);for(let z=0;z=0&&oe=0&&lere&&(re=ve)}}}let ne=y.locToIndex([z,U,q,J],M,y.computeStrides(P));L[ne]=re}}}return{dataId:p.write(y.toTypedArray(L,o.dtype),P,o.dtype),shape:P,dtype:o.dtype}}};var R$={kernelName:Mi,backendName:\"cpu\",kernelFunc:({inputs:r,backend:t,attrs:e})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=e,u=t,c=y.toNestedArray(o.shape,u.data.get(o.dataId).values),l=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:C,strideWidth:S,filterHeight:k,filterWidth:_,dilationHeight:E,dilationWidth:R,outShape:D}=w.computeDilation2DInfo(o.shape,n.shape,a,i,\"NHWC\",p);y.assert(s.rank===D.length,()=>`Error in ${Mi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let P=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(n.shape,n.dtype);for(let L=0;L=0&&ee=0&&ieY&&(Y=le,J=ne,re=oe)}}}O[J][re][q]+=P[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}};var D$={kernelName:Oi,backendName:\"cpu\",kernelFunc:({inputs:r,backend:t,attrs:e})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=e,u=t,c=y.toNestedArray(o.shape,u.data.get(o.dataId).values),l=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:C,strideWidth:S,filterHeight:k,filterWidth:_,dilationHeight:E,dilationWidth:R,outShape:D}=w.computeDilation2DInfo(o.shape,n.shape,a,i,\"NHWC\",p);y.assert(s.rank===D.length,()=>`Error in ${Oi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let P=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(o.shape,o.dtype);for(let L=0;L=0&&ee=0&&ieY&&(Y=le,J=ee,re=ie)}}}O[L][J][re][q]+=P[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),o.shape,o.dtype),shape:o.shape,dtype:o.dtype}}};function QY(r){let{inputs:t,backend:e,attrs:o}=r,{image:n}=t,{canvas:s,options:a}=o,{contextOptions:i,imageOptions:p}=a||{},u=(p==null?void 0:p.alpha)||1,c=(i==null?void 0:i.contextType)||\"2d\";if(c!==\"2d\")throw new Error(`Context type ${i.contextType} is not supported by the CPU backend.`);let l=s.getContext(c,(i==null?void 0:i.contextAttributes)||{});if(l==null)throw new Error(`Could not get the context with ${c} type.`);let[m,d]=n.shape.slice(0,2),f=n.shape.length===2?1:n.shape[2],h=e.data.get(n.dataId).values,g=n.dtype===\"float32\"?255:1,x=new Uint8ClampedArray(d*m*4);for(let C=0;C1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${E}.`)}else if(n.dtype===\"int32\"&&(E<0||E>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${E}.`);f===1?(S[0]=E*g,S[1]=E*g,S[2]=E*g):S[_]=E*g}let k=C*4;x[k+0]=Math.round(S[0]),x[k+1]=Math.round(S[1]),x[k+2]=Math.round(S[2]),x[k+3]=Math.round(S[3])}s.width=d,s.height=m;let b=new ImageData(x,d,m);return l.putImageData(b,0,0),n}var A$={kernelName:_u,backendName:\"cpu\",kernelFunc:QY};function di(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;Q(n,\"sum\");let i;n.dtype===\"bool\"?i=Ro({inputs:{x:n},backend:e,attrs:{dtype:\"int32\"}}):i=lr({inputs:{x:n},backend:e});let p=i.shape.length,u=y.parseAxisParam(s,i.shape),c=w.getAxesPermutation(u,p),l=u,m=i;c!=null&&(m=St({inputs:{x:i},backend:e,attrs:{perm:c}}),l=w.getInnerMostAxes(l.length,p)),w.assertAxesAreInnerMostDims(\"sum\",l,m.shape.length);let[d,f]=w.computeOutAndReduceShapes(m.shape,l),h=w.upcastType(m.dtype,\"int32\"),g=gc(e,d,h),x=y.sizeFromShape(f),b=e.data.get(g.dataId).values,C=e.data.get(m.dataId).values;for(let S=0;S=0&&(m=di({inputs:{x:m},backend:e,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&e.disposeIntermediateTensorInfo(h);return m}var P$={kernelName:Li,backendName:\"cpu\",kernelFunc:ZY};function JY(r){let{inputs:t,backend:e}=r,{dy:o,y:n}=t;Q([o,n],\"eluGrad\");let s=new Float32Array(y.sizeFromShape(n.shape)),a=e.data.get(n.dataId).values,i=e.data.get(o.dataId).values;for(let p=0;p=0?s[p]=i[p]:s[p]=i[p]*(u+1)}return e.makeTensorInfo(n.shape,\"float32\",s)}var O$={kernelName:Xa,backendName:\"cpu\",kernelFunc:JY};var eQ=w.ERF_P,tQ=w.ERF_A1,rQ=w.ERF_A2,oQ=w.ERF_A3,nQ=w.ERF_A4,sQ=w.ERF_A5,aQ=Ie(gn,r=>{let t=Math.sign(r),e=Math.abs(r),o=1/(1+eQ*e);return t*(1-((((sQ*o+nQ)*o+oQ)*o+rQ)*o+tQ)*o*Math.exp(-e*e))}),M$={kernelName:gn,backendName:\"cpu\",kernelFunc:aQ};function Ic(r){let{inputs:t,backend:e,attrs:o}=r,{input:n}=t,{dim:s}=o,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),Ve({inputs:{x:n},backend:e,attrs:{shape:i}})}var L$={kernelName:na,backendName:\"cpu\",kernelFunc:Ic};var iQ=ze((r,t)=>r/t),Vl=Ye(fn,iQ),Wl={kernelName:fn,backendName:\"cpu\",kernelFunc:Vl};function zf(r,t,e){let o=r.shape,n=o[0],s=o[1],a=e.data.get(r.dataId),i=a.complexTensorInfos.real,p=a.complexTensorInfos.imag,u=[n,s],c=y.sizeFromShape(u),l=y.getTypedArrayFromDType(\"float32\",c),m=y.getTypedArrayFromDType(\"float32\",c);for(let g=0;g{let{image:o}=r,n=e,s=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[a,i,p,u]=o.shape,c=n.data.get(o.dataId).values;for(let m=0;m=0&&C=0,()=>`GatherV2: the index value ${k} is not in [0, ${c-1}]`)}let l=i;i==null&&(l=0);let m=y.sizeFromShape(s.shape),d=w.segment_util.collectGatherOpShapeInfo(n,s,p,l),f=Ve({inputs:{x:n},backend:e,attrs:{shape:[d.batchSize,d.outerSize,d.dimSize,d.sliceSize]}}),h=Ve({inputs:{x:s},backend:e,attrs:{shape:[d.batchSize,m/d.batchSize]}}),g=[d.batchSize,d.outerSize,m/d.batchSize,d.sliceSize],x=e.bufferSync(h),b=e.bufferSync(f),C=Tf(b,x,g);return e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),e.makeTensorInfo(d.outputShape,C.dtype,C.values)}var H$={kernelName:aa,backendName:\"cpu\",kernelFunc:gQ};function xQ(r){let{inputs:t,backend:e}=r,{input:o}=t,n=y.sizeFromShape(o.shape),s=o.shape[o.shape.length-1],a=n/s,i=Ve({inputs:{x:o},backend:e,attrs:{shape:[a,s]}}),p=zf(i,!0,e),u=Ve({inputs:{x:p},backend:e,attrs:{shape:o.shape}});return e.disposeIntermediateTensorInfo(i),e.disposeIntermediateTensorInfo(p),u}var K$={kernelName:zi,backendName:\"cpu\",kernelFunc:xQ};var yQ=Ie(Tn,r=>Number.isFinite(r)?1:0,\"bool\"),q$={kernelName:Tn,backendName:\"cpu\",kernelFunc:yQ};var bQ=Ie(_n,r=>Math.abs(r)===1/0?1:0,\"bool\"),j$={kernelName:_n,backendName:\"cpu\",kernelFunc:bQ};var CQ=Ie($n,r=>Number.isNaN(r)?1:0,\"bool\"),X$={kernelName:$n,backendName:\"cpu\",kernelFunc:CQ};function wQ(r){let{backend:t,attrs:e}=r,{start:o,stop:n,num:s}=e,a=_f(o,n,s);return t.makeTensorInfo([a.length],\"float32\",a)}var Y$={kernelName:An,backendName:\"cpu\",kernelFunc:wQ};var SQ=Ie(Pn,r=>Math.log1p(r)),Q$={kernelName:Pn,backendName:\"cpu\",kernelFunc:SQ};var IQ=ze((r,t)=>r&&t),vQ=Ye(On,IQ,null,\"bool\"),Z$={kernelName:On,backendName:\"cpu\",kernelFunc:vQ};var kQ=Ie(Mn,r=>r?0:1,\"bool\"),J$={kernelName:Mn,backendName:\"cpu\",kernelFunc:kQ};var NQ=ze((r,t)=>r||t),TQ=Ye(Ln,NQ,null,\"bool\"),eE={kernelName:Ln,backendName:\"cpu\",kernelFunc:TQ};function _Q(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o;Q(n,\"LRN\");let u=n.shape[3],c=u-1,l=e.data.get(n.dataId).values,m=y.sizeFromShape(n.shape),d=new Float32Array(m);function f(h){let g=h%u,x=h-g+Math.max(0,g-s),b=h-g+Math.min(g+s,c),C=0;for(;x<=b;x++){let S=l[x];C+=S*S}return C}for(let h=0;h`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p),l;if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))l=lr({inputs:{x:n},backend:e});else{let m=e.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=Sc(m,n.shape,n.dtype,d,c,\"max\");l=e.makeTensorInfo(c.outShape,n.dtype,f.values)}return l}var nE={kernelName:Wn,backendName:\"cpu\",kernelFunc:EQ};function RQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,\"maxPool3d\");let c=w.computePool3DInfo(n.shape,s,a,1,i,p,u),l=e.data.get(n.dataId).values,m=Bf(l,n.shape,n.dtype,y.computeStrides(n.shape),c,\"max\");return e.makeTensorInfo(m.shape,\"float32\",m.values)}var sE={kernelName:ia,backendName:\"cpu\",kernelFunc:RQ};function DQ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],\"maxPool3DGrad\");let c=w.computePool3DInfo(s.shape,a,i,1,p,u),l=e.bufferSync(s),m=e$(l,c),d=c.strideDepth,f=c.strideHeight,h=c.strideWidth,g=c.dilationDepth,x=c.dilationHeight,b=c.dilationWidth,C=c.effectiveFilterDepth,S=c.effectiveFilterHeight,k=c.effectiveFilterWidth,_=C-1-c.padInfo.front,E=k-1-c.padInfo.left,R=S-1-c.padInfo.top,D=me(s.shape,\"float32\"),P=e.bufferSync(n);for(let O=0;O=c.outDepth||Math.floor(re)!==re))for(let ne=0;ne=c.outHeight||Math.floor(ee)!==ee))for(let oe=0;oe=c.outWidth||Math.floor(ie)!==ie)continue;let le=C*S*k-1-m.get(O,re,ee,ie,M),be=J*S*k+ne*k+oe,_e=le===be?1:0;if(_e===0)continue;let ve=P.get(O,re,ee,ie,M);Y+=ve*_e}}}D.set(Y,O,L,B,z,M)}return e.makeTensorInfo(D.shape,D.dtype,D.values)}var aE={kernelName:Ui,backendName:\"cpu\",kernelFunc:DQ};function AQ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s,output:a}=t,i=s;Q([s,a],\"maxPoolGrad\");let{filterSize:p,strides:u,pad:c,dimRoundingMode:l}=o,m=w.computePool2DInfo(i.shape,p,u,1,c,l),d=e.data.get(i.dataId).values,f=me(m.outShape,i.dtype,Lf(d,i.shape,i.dtype,m).values),h=m.strideHeight,g=m.strideWidth,x=m.dilationHeight,b=m.dilationWidth,C=m.effectiveFilterHeight,S=m.effectiveFilterWidth,k=S-1-m.padInfo.left,_=C-1-m.padInfo.top,E=me(i.shape,\"float32\"),R=e.data.get(n.dataId).values,D=me(n.shape,\"float32\",R);for(let P=0;P=m.outHeight||Math.floor(q)!==q))for(let Y=0;Y=m.outWidth||Math.floor(J)!==J)continue;let re=C*S-1-f.get(P,q,J,O),ne=j*S+Y,ee=re===ne?1:0;if(ee===0)continue;let oe=D.get(P,q,J,O);U+=oe*ee}}E.set(U,P,M,L,O)}return e.makeTensorInfo(E.shape,E.dtype,E.values)}var iE={kernelName:Wi,backendName:\"cpu\",kernelFunc:AQ};function uE(r,t,e,o,n){let s=y.computeStrides(t),a=Sc(r,t,e,s,n,\"max\"),i=Lf(r,t,e,n,!0,o);return[a.values,i.values]}var pE={kernelName:ua,backendName:\"cpu\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=t,p=e;Q(o,\"MaxPoolWithArgmax\");let u=p.data.get(o.dataId).values,c=w.computePool2DInfo(o.shape,n,s,[1,1],a),[l,m]=uE(u,o.shape,o.dtype,i,c),d=p.write(l,c.outShape,o.dtype),f=p.write(m,c.outShape,o.dtype);return[{dataId:d,shape:c.outShape,dtype:o.dtype},{dataId:f,shape:c.outShape,dtype:\"int32\"}]}};function FQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=y.parseAxisParam(s,n.shape),u=w.computeOutAndReduceShapes(n.shape,i)[1],c=y.sizeFromShape(u),l=[],m=e.makeTensorInfo([],\"float32\",new Float32Array([c]));l.push(m);let d=Ro({inputs:{x:n},backend:e,attrs:{dtype:\"float32\"}});l.push(d);let f=Vl({inputs:{a:d,b:m},backend:e});l.push(f);let h=di({inputs:{x:f},backend:e,attrs:{axis:s,keepDims:a}});return l.forEach(g=>e.disposeIntermediateTensorInfo(g)),h}var cE={kernelName:Un,backendName:\"cpu\",kernelFunc:FQ};function PQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;Q(n,\"min\");let i=y.parseAxisParam(s,n.shape),p=i,u=w.getAxesPermutation(p,n.shape.length),c=n;u!=null&&(c=St({inputs:{x:n},backend:e,attrs:{perm:u}}),p=w.getInnerMostAxes(p.length,n.shape.length)),w.assertAxesAreInnerMostDims(\"min\",p,c.shape.length);let[l,m]=w.computeOutAndReduceShapes(c.shape,p),d=y.sizeFromShape(m),f=y.makeZerosTypedArray(y.sizeFromShape(l),c.dtype),h=e.data.get(c.dataId).values;for(let x=0;xC[0]+n.shape[S]+C[1]),p=s.map(C=>C[0]),u=s.map((C,S)=>C[0]+n.shape[S]),c=a===\"reflect\"?0:1,l=e.data.get(n.dataId).values,m=n.shape.length,d=y.computeStrides(n.shape),f=y.sizeFromShape(i),h=i.length,g=y.computeStrides(i),x=y.getTypedArrayFromDType(n.dtype,f);for(let C=0;C=u[_]&&(S[_]=(u[_]-1)*2-S[_]+c);S=S.map((_,E)=>_-p[E]);let k=y.locToIndex(S,m,d);x[C]=l[k]}return{dataId:e.write(x,i,n.dtype),shape:i,dtype:n.dtype}}var mE={kernelName:Kn,backendName:\"cpu\",kernelFunc:OQ};var MQ=ze((r,t)=>{let e=r%t;return r<0&&t<0||r>=0&&t>=0?e:(e+t)%t}),LQ=Ye(qn,MQ),dE={kernelName:qn,backendName:\"cpu\",kernelFunc:LQ};var hE=Lp(qw());function II(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{dim:s}=o,a=n.shape.length,i=s;if(i===-1&&(i=a-1),i!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${i}`);let p=y.parseAxisParam([i],n.shape),u=SI({inputs:{x:n},backend:e,attrs:{reductionIndices:p,keepDims:!1}}),c=w.expandShapeToKeepDim(u.shape,p),l=Ve({inputs:{x:u},backend:e,attrs:{shape:c}}),m=Bl({inputs:{a:n,b:l},backend:e}),d=KS({inputs:{x:m},backend:e}),f=di({inputs:{x:d},backend:e,attrs:{axis:p,keepDims:!1}}),h=Ve({inputs:{x:f},backend:e,attrs:{shape:c}}),g=Vl({inputs:{a:d,b:h},backend:e});return e.disposeIntermediateTensorInfo(u),e.disposeIntermediateTensorInfo(l),e.disposeIntermediateTensorInfo(m),e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),g}var fE={kernelName:Is,backendName:\"cpu\",kernelFunc:II};function BQ(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o;Q(n,\"multinomial\");let p=i?n:II({inputs:{logits:n},backend:e,attrs:{dim:-1}}),u=p.shape[0],c=p.shape[1],l=e.data.get(p.dataId).values,m=[u,s],d=y.makeZerosTypedArray(y.sizeFromShape(m),\"int32\");for(let f=0;f=0&&l[m]{y.assertShapesMatch(s,c.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===c.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=t.map(c=>{let l=Ic({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=du({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeIntermediateTensorInfo(c)),u}var vE={kernelName:la,backendName:\"cpu\",kernelFunc:vI};function qQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{paddings:s,constantValue:a}=o;Q(n,\"pad\");let i=s.map((b,C)=>b[0]+n.shape[C]+b[1]),p=s.map(b=>b[0]),u=e.data.get(n.dataId).values,c=y.sizeFromShape(n.shape),l=n.shape.length,m=y.computeStrides(n.shape),d=y.sizeFromShape(i),f=i.length,h=y.computeStrides(i),g=y.getTypedArrayFromDType(n.dtype,d);a!==0&&g.fill(a);for(let b=0;b_+p[E]),k=y.locToIndex(S,f,h);g[k]=u[b]}return{dataId:e.write(g,i,n.dtype),shape:i,dtype:n.dtype}}var Vf={kernelName:es,backendName:\"cpu\",kernelFunc:qQ};var jQ=ze((r,t)=>Math.pow(r,t)),XQ=Ye(ts,jQ),kE={kernelName:ts,backendName:\"cpu\",kernelFunc:XQ};function YQ(r){let{inputs:t,backend:e,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=t,{outputRaggedRank:i}=o,p=n.map(x=>e.data.get(x.dataId).values),u=n.map(x=>x.shape),c=e.data.get(s.dataId).values,l=e.data.get(a.dataId).values,[m,d,f]=Ef(p,u,c,s.shape,s.dtype,l,a.shape,i),h=m.map(x=>e.makeTensorInfo([x.length],\"int32\",x)),g=e.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var NE={kernelName:Up,backendName:\"cpu\",kernelFunc:YQ};function QQ(r){let{inputs:t,backend:e}=r,{starts:o,limits:n,deltas:s}=t,a=e.data.get(o.dataId).values,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,[u,c]=Rf(a,o.shape,o.dtype,i,n.shape,p,s.shape),l=e.makeTensorInfo([u.length],\"int32\",u),m=e.makeTensorInfo([c.length],o.dtype,c);return[l,m]}var TE={kernelName:Gp,backendName:\"cpu\",kernelFunc:QQ};function ZQ(r){let{inputs:t,backend:e,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=t,{rowPartitionTypes:p}=o,u=e.data.get(n.dataId).values,c=e.data.get(s.dataId).values,l=e.data.get(a.dataId).values,m=i.map(g=>e.data.get(g.dataId).values),d=i.map(g=>g.shape),[f,h]=Df(u,n.shape,c,s.shape,s.dtype,l,a.shape,m,d,p);return e.makeTensorInfo(f,s.dtype,h)}var _E={kernelName:Hp,backendName:\"cpu\",kernelFunc:ZQ};function JQ(r){let{backend:t,attrs:e}=r,{start:o,stop:n,dtype:s,step:a}=e,i=ap(o,n,a,s);return t.makeTensorInfo([i.length],s,i)}var $E={kernelName:ma,backendName:\"cpu\",kernelFunc:JQ};var e7=Ie(ns,r=>1/r),EE={kernelName:ns,backendName:\"cpu\",kernelFunc:e7};function t7(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o;Q(n,\"resizeBilinear\");let p=y.computeStrides(n.shape),[u,c]=i,[l,m,d,f]=n.shape,h=e.data.get(n.dataId).values,g=new Float32Array(y.sizeFromShape([l,u,c,f])),x=[s&&u>1?m-1:m,s&&c>1?d-1:d],b=[s&&u>1?u-1:u,s&&c>1?c-1:c],C=0,S=x[0]/b[0],k=x[1]/b[1];for(let _=0;_1?u-1:u,a&&d>1?c-1:c],g=[a&&m>1?m-1:m,a&&d>1?d-1:d],x=h[0]/g[0],b=h[1]/g[1],C=e.data.get(s.dataId).values,S=0;for(let k=0;k1?m-1:m,s&&c>1?d-1:d],b=[s&&u>1?u-1:u,s&&c>1?c-1:c],C=x[0]/b[0],S=x[1]/b[1],k=0;for(let _=0;_1?c-1:c,a&&f>1?l-1:l],b=[a&&d>1?d-1:d,a&&f>1?f-1:f],C=x[0]/b[0],S=x[1]/b[1],k=1/C,_=1/S,E=Math.ceil(k)*2+2,R=Math.ceil(_)*2+2;for(let D=0;D=d)continue;let ee=P+ne*p[1],oe=ne*C,ie=Math.min(c-1,a?Math.round(oe):Math.floor(oe));if(O===ie)for(let le=0;le=f)continue;let _e=ee+be*p[2],ve=be*S,Fe=Math.min(l-1,a?Math.round(ve):Math.floor(ve));z===Fe&&(J+=g[_e+Y])}}h[U+Y]=J}}}}return e.makeTensorInfo(n.shape,n.dtype,h)}var FE={kernelName:Za,backendName:\"cpu\",kernelFunc:n7};function s7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o;Q(n,\"reverse\");let a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return lr({inputs:{x:n},backend:e});let p=new tt(n.shape,n.dtype),u=e.bufferSync(n);for(let c=0;cm[d]=n.shape[d]-1-m[d]),p.set(u.get(...m),...l)}return e.makeTensorInfo(p.shape,p.dtype,p.values)}var PE={kernelName:ps,backendName:\"cpu\",kernelFunc:s7};var OE={kernelName:Ds,backendName:\"cpu\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=t,i=e,p=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[u,c,l,m]=o.shape,[d,f]=w.getImageCenter(a,c,l),h=255,g=Math.sin(n),x=Math.cos(n),b=i.data.get(o.dataId).values;for(let S=0;S=0&&B=0&&z{let t=Math.floor(r);return r-t<.5?Math.floor(r):r-t>.5?Math.ceil(r):t%2===0?t:t+1}),ME={kernelName:cs,backendName:\"cpu\",kernelFunc:a7};function i7(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(s,n,a),m=!0,d=e.bufferSync(n),f=e.bufferSync(s),h=zs(d,f,a,l,u,p,i,c,0,m);return e.makeTensorInfo(a,h.dtype,h.values)}var LE={kernelName:ms,backendName:\"cpu\",kernelFunc:i7};function u7(r,t){let e=0,o=r.length,n=0;for(;e1||n.shape.length===1?1:y.sizeFromShape(n.shape.slice(1));for(let f=0;fr>=0?d7*r:m7*(Math.exp(r)-1)),WE={kernelName:hs,backendName:\"cpu\",kernelFunc:f7};var h7=Ie(ys,r=>r<0?-1:r>0?1:0),UE={kernelName:ys,backendName:\"cpu\",kernelFunc:h7};var g7=Ie(gs,r=>Math.sin(r)),GE={kernelName:gs,backendName:\"cpu\",kernelFunc:g7};var x7=Ie(xs,r=>Math.sinh(r)),HE={kernelName:xs,backendName:\"cpu\",kernelFunc:x7};var y7=11920928955078125e-23,KE=Math.log(y7)+2,b7=Ie(Cs,r=>{let t=r>-KE,e=rNumber(g)))),e.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var XE={kernelName:Hi,backendName:\"cpu\",kernelFunc:w7};function S7(r){let{inputs:t,backend:e}=r,{inputIndices:o,inputShape:n,newShape:s}=t;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape\n ${o.shape}`);if(n.shape.length!==1)throw new Error(`Input shape should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(e.data.get(n.dataId).values),i=e.data.get(o.dataId).values,p=Array.from(e.data.get(s.dataId).values),[u,c,l]=Ff(i,o.shape,o.dtype,a,p);return[e.makeTensorInfo(c,o.dtype,u),e.makeTensorInfo([l.length],s.dtype,new Int32Array(l))]}var YE={kernelName:ei,backendName:\"cpu\",kernelFunc:S7};function I7(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error(\"segmentIds and indices should have same size.\");let a=e.data.get(o.dataId).values,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,[u,c]=Cc(a,o.shape,o.dtype,i,p,!0);return e.makeTensorInfo(c,o.dtype,u)}var QE={kernelName:ya,backendName:\"cpu\",kernelFunc:I7};function v7(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error(\"segmentIds and indices should have same size.\");let a=e.data.get(o.dataId).values,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,[u,c]=Cc(a,o.shape,o.dtype,i,p);return e.makeTensorInfo(c,o.dtype,u)}var ZE={kernelName:ba,backendName:\"cpu\",kernelFunc:v7};function k7(r){let{inputs:t,backend:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=w.calculateShapes(s,n,i),d=!1,f=e.bufferSync(n),h;switch(s.dtype){case\"bool\":{let g=e.bufferSync(s),x=!!e.data.get(a.dataId).values[0];h=zs(f,g,i,m,c,u,p,l,x,d);break}case\"float32\":{let g=e.bufferSync(s),x=e.data.get(a.dataId).values[0];h=zs(f,g,i,m,c,u,p,l,x,d);break}case\"int32\":{let g=e.bufferSync(s),x=e.data.get(a.dataId).values[0];h=zs(f,g,i,m,c,u,p,l,x,d);break}case\"string\":{let g=e.bufferSync(s),x=y.decodeString(e.data.get(a.dataId).values[0]);h=zs(f,g,i,m,c,u,p,l,x,d);break}default:throw new Error(`Unsupported type ${s.dtype}`)}return e.makeTensorInfo(i,h.dtype,h.values)}var JE={kernelName:vs,backendName:\"cpu\",kernelFunc:k7};function N7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),c=n.shape.slice();return p.map(l=>{let m=[...c];m[i]=l;let d=Ao({inputs:{x:n},backend:e,attrs:{begin:u,size:m}});return u[i]+=l,d})}var eR={kernelName:xa,backendName:\"cpu\",kernelFunc:N7};var tR={kernelName:Ki,backendName:\"cpu\",kernelFunc:({inputs:r,backend:t})=>{let{x:e}=r,o=t;Q(e,\"square\");let n=o.data.get(e.dataId).values,s=new Float32Array(n.length);for(let i=0;i{let e=t;return isNaN(r)?NaN:r>0?1:e.alpha}),rR={kernelName:wo,backendName:\"cpu\",kernelFunc:T7};function _7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o;Q(n,\"stridedSlice\");let{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=Ve({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let _=pt.computeOutShape(b,C,S),E=Ao({inputs:{x:n},backend:e,attrs:{begin:b,size:_}});k=Ve({inputs:{x:E},backend:e,attrs:{shape:f}}),e.disposeIntermediateTensorInfo(E)}else{let _=e.bufferSync(n),E=Pf(d,_,S,b);k=e.makeTensorInfo(f,E.dtype,E.values)}return k}var oR={kernelName:Ns,backendName:\"cpu\",kernelFunc:_7};function $7(r){let{inputs:t,backend:e,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:c,dataSplits:l}=t,m=e.data.get(c.dataId).values,d=e.data.get(l.dataId).values,[f,h]=up(m,d,n,s,a,i,p,u);return[e.makeTensorInfo([f.length],\"string\",f),e.makeTensorInfo(l.shape,\"int32\",h)]}var nR={kernelName:Ca,backendName:\"cpu\",kernelFunc:$7};function E7(r){let{inputs:t,backend:e,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=t;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=e.data.get(s.dataId).values,p=e.data.get(a.dataId).values[0],[u,c,l]=pp(i,p,n),m=c.length;return[e.makeTensorInfo([m,2],\"int32\",u),e.makeTensorInfo([m],\"string\",c),e.makeTensorInfo([2],\"int32\",new Int32Array(l))]}var sR={kernelName:qi,backendName:\"cpu\",kernelFunc:E7};function R7(r){let{inputs:t,backend:e,attrs:o}=r,{numBuckets:n}=o,{input:s}=t;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(n<=0)throw new Error(\"Number of buckets must be at least 1\");let a=e.data.get(s.dataId).values,i=cp(a,n);return e.makeTensorInfo(s.shape,\"int32\",i)}var aR={kernelName:ji,backendName:\"cpu\",kernelFunc:R7};var D7=Ie(_s,r=>Math.tan(r)),iR={kernelName:_s,backendName:\"cpu\",kernelFunc:D7};var A7=Ie($s,r=>Math.tanh(r)),uR={kernelName:$s,backendName:\"cpu\",kernelFunc:A7};function F7(r){let{inputs:t,backend:e}=r,{tensor:o,indices:n,updates:s}=t,{sliceRank:a,numUpdates:i,sliceSize:p,strides:u,outputSize:c}=w.calculateShapes(s,n,o.shape),l=!1,m=e.bufferSync(n),d=e.bufferSync(s),f=e.bufferSync(o),h=zs(m,d,o.shape,c,p,i,a,u,f,l);return e.makeTensorInfo(o.shape,h.dtype,h.values)}var pR={kernelName:ds,backendName:\"cpu\",kernelFunc:F7};function P7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{reps:s}=o;Q(n,\"tile\");let a=Of(e.bufferSync(n),s);return e.makeTensorInfo(a.shape,a.dtype,a.values)}var cR={kernelName:uo,backendName:\"cpu\",kernelFunc:P7};function O7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{k:s,sorted:a}=o;Q(n,\"topk\");let i=e.data.get(n.dataId).values,[p,u]=Mf(i,n.shape,n.dtype,s,a);return[e.makeTensorInfo(p.shape,p.dtype,p.values),e.makeTensorInfo(u.shape,u.dtype,u.values)]}var lR={kernelName:Es,backendName:\"cpu\",kernelFunc:O7};function M7(r){let{inputs:t,attrs:e,backend:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=e,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=y.computeStrides(n.shape),b=x[0],C=x[1],S=x[2],k=y.computeStrides(g),_=k[0],E=k[1],R=k[2],D=y.getTypedArrayFromDType(n.dtype,y.sizeFromShape(g));D.fill(p);let P=o.data.get(n.dataId).values,O=o.data.get(s.dataId).values;for(let L=0;Lt-1)if(t<=1)e=0;else{let o=2*t;e-=o*Math.trunc(e/o),e>=t&&(e=o-e-1)}return y.clamp(0,e,t-1)}function B7(r,t){let e=r;if(e<0)if(t<=1)e=0;else{let o=t-1;e+=t*(Math.trunc(-e/o)+1)}else if(e>t-1)if(t<=1)e=0;else{let o=t-1;e-=t*Math.trunc(e/o)}return y.clamp(0,e,t-1)}function z7(r,t){return r}function V7(r,t){return y.clamp(0,r,t-1)}function Hl(r,t,e,o,n,s,a,i,p,u,c){let l=a*o+i*n+p*s+u;return 0<=i&&ie.disposeIntermediateTensorInfo(f)),d}var gR={kernelName:Yi,backendName:\"cpu\",kernelFunc:K7};var q7=[V_,XT,W_,U_,e_,G_,H_,K_,q_,j_,X_,Y_,Q_,Z_,J_,t$,r$,o$,n$,z_,s$,a$,i$,t_,u$,JT,r_,p$,YT,c$,m$,d$,f$,h$,g$,x$,y$,b$,C$,w$,S$,I$,v$,k$,N$,T$,_$,$$,E$,R$,D$,A$,P$,F_,O$,o_,M$,n_,L$,s_,B$,z$,V$,a_,i_,W$,U$,G$,H$,u_,p_,QT,K$,l$,q$,j$,X$,P_,c_,l_,Y$,m_,Q$,Z$,J$,eE,tE,rE,oE,d_,nE,sE,aE,iE,pE,cE,lE,f_,mE,dE,gE,h_,g_,xE,yE,bE,x_,CE,IE,vE,Vf,kE,O_,b_,NE,TE,_E,$E,ZT,Wl,EE,M_,L_,B_,RE,DE,AE,FE,PE,OE,ME,v_,LE,zE,VE,WE,N_,UE,GE,HE,T_,fE,qE,jE,XE,YE,QE,ZE,JE,eR,$_,tR,E_,R_,rR,oR,nR,sR,aR,D_,F$,iR,uR,pR,cR,lR,dR,y_,fR,hR,gR,wE];for(let r of q7)ti(r);var Tc={};qe(Tc,{assertNotComplex:()=>Vs,bindCanvasToFramebuffer:()=>rZ,bindColorTextureToFramebuffer:()=>Xl,bindTextureToProgramUniformSampler:()=>zI,bindTextureUnit:()=>CR,bindVertexBufferToProgramAttribute:()=>qf,callAndCheck:()=>ce,canBeRepresented:()=>_I,createFragmentShader:()=>EI,createFramebuffer:()=>MI,createProgram:()=>RI,createStaticIndexBuffer:()=>FI,createStaticVertexBuffer:()=>AI,createTexture:()=>PI,createVertexShader:()=>$I,getBatchDim:()=>hi,getExtensionOrThrow:()=>vc,getFramebufferErrorMessage:()=>wR,getMaxTexturesInShader:()=>UI,getNumChannels:()=>eZ,getProgramUniformLocation:()=>BI,getProgramUniformLocationOrThrow:()=>LI,getRowsCols:()=>gi,getShapeAs3D:()=>Nc,getTextureShapeFromLogicalShape:()=>VI,getWebGLDisjointQueryTimerVersion:()=>GI,getWebGLErrorMessage:()=>bR,getWebGLMaxTextureSize:()=>WI,hasExtension:()=>Kr,isCapableOfRenderingToFloatTexture:()=>HI,isDownloadFloatTextureEnabled:()=>KI,isReshapeFree:()=>hu,isWebGLFenceEnabled:()=>qI,isWebGLVersionEnabled:()=>Xf,linkProgram:()=>DI,logShaderSourceAndInfoLog:()=>Kf,resetMaxTextureSize:()=>oZ,resetMaxTexturesInShader:()=>nZ,unbindColorTextureFromFramebuffer:()=>jf,unbindTextureUnit:()=>tZ,validateFramebuffer:()=>kc,validateProgram:()=>jl,validateTextureSize:()=>OI});var dp={},Wf={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function kI(r,t){dp[r]=t}function Hr(r,t){if(!(r in dp)||t!=null){let o=X7(r,t);if(o!==null)dp[r]=o;else return console.log(\"Could not get context for WebGL version\",r),null}let e=dp[r];return e==null||e.isContextLost()?(delete dp[r],Hr(r)):(e.disable(e.DEPTH_TEST),e.disable(e.STENCIL_TEST),e.disable(e.BLEND),e.disable(e.DITHER),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SAMPLE_COVERAGE),e.enable(e.SCISSOR_TEST),e.enable(e.CULL_FACE),e.cullFace(e.BACK),dp[r])}function j7(r){if(!A().getBool(\"IS_SAFARI\")&&typeof OffscreenCanvas!=\"undefined\"&&r===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 X7(r,t){if(r!==1&&r!==2)throw new Error(\"Cannot get WebGL rendering context, WebGL is disabled.\");let e=t==null?j7(r):t;return e.addEventListener(\"webglcontextlost\",o=>{o.preventDefault(),delete dp[r]},!1),A().getBool(\"SOFTWARE_WEBGL_ENABLED\")&&(Wf.failIfMajorPerformanceCaveat=!1),r===1?e.getContext(\"webgl\",Wf)||e.getContext(\"experimental-webgl\",Wf):e.getContext(\"webgl2\",Wf)}var fu;(function(r){r[r.DENSE=0]=\"DENSE\",r[r.SHARED_BATCH=1]=\"SHARED_BATCH\"})(fu||(fu={}));var mr;(function(r){r[r.RENDER=0]=\"RENDER\",r[r.UPLOAD=1]=\"UPLOAD\",r[r.PIXELS=2]=\"PIXELS\",r[r.DOWNLOAD=3]=\"DOWNLOAD\"})(mr||(mr={}));var er;(function(r){r[r.UNPACKED_FLOAT16=0]=\"UNPACKED_FLOAT16\",r[r.UNPACKED_FLOAT32=1]=\"UNPACKED_FLOAT32\",r[r.PACKED_4X1_UNSIGNED_BYTE=2]=\"PACKED_4X1_UNSIGNED_BYTE\",r[r.PACKED_2X2_FLOAT32=3]=\"PACKED_2X2_FLOAT32\",r[r.PACKED_2X2_FLOAT16=4]=\"PACKED_2X2_FLOAT16\"})(er||(er={}));function fp(r,t){return[t,r]}function xR(r,t){return r*t}function Kl(r){let t=y.sizeFromShape(r),e=Math.ceil(t/4);return y.sizeToSquarishShape(e)}function Ma(r,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(r/2))]}function yR(r,t){let[e,o]=Ma(r,t);return e*o*4}function ql(r,t){let e=r,o,n,s,a,i,p,u,c,l,m;return A().getNumber(\"WEBGL_VERSION\")===2?(o=e.R32F,n=e.R16F,s=e.RGBA16F,a=e.RGBA32F,i=e.RED,u=4,c=1,l=e.HALF_FLOAT,m=e.FLOAT,p=e.RGBA8):(o=r.RGBA,n=r.RGBA,s=r.RGBA,a=e.RGBA,i=r.RGBA,u=4,c=4,l=t!=null?t.HALF_FLOAT_OES:null,m=r.FLOAT,p=r.RGBA),{internalFormatFloat:o,internalFormatHalfFloat:n,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:a,textureFormatFloat:i,downloadTextureFormat:p,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:l,textureTypeFloat:m}}function ce(r,t){let e=t();return A().getBool(\"DEBUG\")&&Y7(r),e}function Y7(r){let t=r.getError();if(t!==r.NO_ERROR)throw new Error(\"WebGL Error: \"+bR(r,t))}var Q7=596e-10,Z7=65504;function _I(r){return!!(A().getBool(\"WEBGL_RENDER_FLOAT32_ENABLED\")||r===0||Q7r.getExtension(t),'Extension \"'+t+'\" not supported on this browser.')}function $I(r,t){let e=fi(r,()=>r.createShader(r.VERTEX_SHADER),\"Unable to create vertex WebGLShader.\");if(ce(r,()=>r.shaderSource(e,t)),ce(r,()=>r.compileShader(e)),r.getShaderParameter(e,r.COMPILE_STATUS)===!1)throw console.log(r.getShaderInfoLog(e)),new Error(\"Failed to compile vertex shader.\");return e}function EI(r,t){let e=fi(r,()=>r.createShader(r.FRAGMENT_SHADER),\"Unable to create fragment WebGLShader.\");if(ce(r,()=>r.shaderSource(e,t)),ce(r,()=>r.compileShader(e)),A().get(\"ENGINE_COMPILE_ONLY\"))return e;if(r.getShaderParameter(e,r.COMPILE_STATUS)===!1)throw Kf(t,r.getShaderInfoLog(e)),new Error(\"Failed to compile fragment shader.\");return e}var J7=/ERROR: [0-9]+:([0-9]+):/g;function Kf(r,t){let e=J7.exec(t);if(e==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(r);return}let o=+e[1],n=r.split(`\n`),s=n.length.toString().length+2,a=n.map((l,m)=>y.rightPad((m+1).toString(),s)+l),i=0;for(let l=0;lr.createProgram(),\"Unable to create WebGLProgram.\")}function DI(r,t){if(ce(r,()=>r.linkProgram(t)),!A().get(\"ENGINE_COMPILE_ONLY\")&&r.getProgramParameter(t,r.LINK_STATUS)===!1)throw console.log(r.getProgramInfoLog(t)),new Error(\"Failed to link vertex and fragment shaders.\")}function jl(r,t){if(ce(r,()=>r.validateProgram(t)),r.getProgramParameter(t,r.VALIDATE_STATUS)===!1)throw console.log(r.getProgramInfoLog(t)),new Error(\"Shader program validation failed.\")}function AI(r,t){let e=fi(r,()=>r.createBuffer(),\"Unable to create WebGLBuffer\");return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,e)),ce(r,()=>r.bufferData(r.ARRAY_BUFFER,t,r.STATIC_DRAW)),e}function FI(r,t){let e=fi(r,()=>r.createBuffer(),\"Unable to create WebGLBuffer\");return ce(r,()=>r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e)),ce(r,()=>r.bufferData(r.ELEMENT_ARRAY_BUFFER,t,r.STATIC_DRAW)),e}function eZ(){return A().getNumber(\"WEBGL_VERSION\")===2?1:4}function PI(r){return fi(r,()=>r.createTexture(),\"Unable to create WebGLTexture.\")}function OI(r,t){let e=A().getNumber(\"WEBGL_MAX_TEXTURE_SIZE\");if(r<=0||t<=0){let o=`[${r}x${t}]`;throw new Error(\"Requested texture size \"+o+\" is invalid.\")}if(r>e||t>e){let o=`[${r}x${t}]`,n=`[${e}x${e}]`;throw new Error(\"Requested texture size \"+o+\" greater than WebGL maximum on this browser / GPU \"+n+\".\")}}function MI(r){return fi(r,()=>r.createFramebuffer(),\"Unable to create WebGLFramebuffer.\")}function qf(r,t,e,o,n,s,a){let i=r.getAttribLocation(t,e);return i===-1?!1:(ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,o)),ce(r,()=>r.vertexAttribPointer(i,n,r.FLOAT,!1,s,a)),ce(r,()=>r.enableVertexAttribArray(i)),!0)}function CR(r,t,e){SR(r,e),ce(r,()=>r.activeTexture(r.TEXTURE0+e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,t))}function tZ(r,t){SR(r,t),ce(r,()=>r.activeTexture(r.TEXTURE0+t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function LI(r,t,e){return fi(r,()=>r.getUniformLocation(t,e),'uniform \"'+e+'\" not present in program.')}function BI(r,t,e){return r.getUniformLocation(t,e)}function zI(r,t,e,o){ce(r,()=>CR(r,t,o)),ce(r,()=>r.uniform1i(e,o))}function rZ(r){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,null)),ce(r,()=>r.viewport(0,0,r.canvas.width,r.canvas.height)),ce(r,()=>r.scissor(0,0,r.canvas.width,r.canvas.height))}function Xl(r,t,e){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,e)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0))}function jf(r,t){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,t)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,null,0))}function kc(r){let t=r.checkFramebufferStatus(r.FRAMEBUFFER);if(t!==r.FRAMEBUFFER_COMPLETE)throw new Error(\"Error binding framebuffer: \"+wR(r,t))}function wR(r,t){switch(t){case r.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\";case r.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\";case r.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\";case r.FRAMEBUFFER_UNSUPPORTED:return\"FRAMEBUFFER_UNSUPPORTED\";default:return`unknown error ${t}`}}function fi(r,t,e){let o=ce(r,()=>t());if(o==null)throw new Error(e);return o}function SR(r,t){let e=r.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,o=t+r.TEXTURE0;if(oe){let n=`[gl.TEXTURE0, gl.TEXTURE${e}]`;throw new Error(`textureUnit must be in ${n}.`)}}function hi(r,t=2){return y.sizeFromShape(r.slice(0,r.length-t))}function gi(r){if(r.length===0)throw Error(\"Cannot get rows and columns of an empty shape array.\");return[r.length>1?r[r.length-2]:1,r[r.length-1]]}function Nc(r){let t=[1,1,1];return r.length===0||r.length===1&&r[0]===1||(t=[hi(r),...gi(r)]),t}function VI(r,t=!1){let e=A().getNumber(\"WEBGL_MAX_TEXTURE_SIZE\"),o=A().getNumber(\"WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE\");o===1/0&&A().getBool(\"WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE\")&&(o=e/2),t&&(e=e*2,o=o*2,r=r.map((i,p)=>p>=r.length-2?y.nearestLargerEven(r[p]):r[p]),r.length===1&&(r=[2,r[0]])),r.length!==2&&(r=y.squeezeShape(r).newShape);let n=y.sizeFromShape(r),s=null;r.length<=1&&n<=e?s=[1,n]:r.length===2&&r[0]<=e&&r[1]<=e?s=r:r.length===3&&r[0]*r[1]<=e&&r[2]<=e?s=[r[0]*r[1],r[2]]:r.length===3&&r[0]<=e&&r[1]*r[2]<=e?s=[r[0],r[1]*r[2]]:r.length===4&&r[0]*r[1]*r[2]<=e&&r[3]<=e?s=[r[0]*r[1]*r[2],r[3]]:r.length===4&&r[0]<=e&&r[1]*r[2]*r[3]<=e&&(s=[r[0],r[1]*r[2]*r[3]]);let a=s!=null&&Math.max(...s)>o&&Math.min(...s)<=(t?2:1)&&Math.min(...s)>0;if(s==null||a)if(t){let i=hi(r),p=2,u=2;r.length&&([p,u]=gi(r)),n=i*(p/2)*(u/2),s=y.sizeToSquarishShape(n).map(c=>c*2)}else s=y.sizeToSquarishShape(n);return s}function Uf(r){return r%2===0}function hu(r,t){if(r=r.slice(-2),t=t.slice(-2),y.arraysEqual(r,t)||!r.length||!t.length||r[0]===0||r[1]===0||t[0]===0||t[1]===0)return!0;if(r.length!==t.length){let e=r[r.length-1],o=t[t.length-1];if(e===o||Uf(e)&&Uf(o)&&(r[0]===1||t[0]===1))return!0}return r[1]===t[1]&&Uf(r[0])&&Uf(t[0])}var Gf,Hf;function WI(r){if(Gf==null){let t=Hr(r);Gf=t.getParameter(t.MAX_TEXTURE_SIZE)}return Gf}function oZ(){Gf=null}function nZ(){Hf=null}function UI(r){if(Hf==null){let t=Hr(r);Hf=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,Hf)}function GI(r){if(r===0)return 0;let t,e=Hr(r);return Kr(e,\"EXT_disjoint_timer_query_webgl2\")&&r===2?t=2:Kr(e,\"EXT_disjoint_timer_query\")?t=1:t=0,t}function Kr(r,t){return r.getExtension(t)!=null}function Xf(r){try{if(Hr(r)!=null)return!0}catch(t){return console.log(\"Error when getting WebGL context: \",t),!1}return!1}function HI(r){if(r===0)return!1;let t=Hr(r);if(r===1){if(!Kr(t,\"OES_texture_float\"))return!1}else if(!Kr(t,\"EXT_color_buffer_float\"))return!1;return TI(t)}function KI(r){if(r===0)return!1;let t=Hr(r);if(r===1){if(!Kr(t,\"OES_texture_float\")||!Kr(t,\"WEBGL_color_buffer_float\"))return!1}else{if(Kr(t,\"EXT_color_buffer_float\"))return TI(t);let o=\"EXT_color_buffer_half_float\";if(Kr(t,o)){let n=t.getExtension(o);return sZ(t,n)}return!1}return TI(t)}function TI(r){let t=ql(r),e=r.createTexture();r.bindTexture(r.TEXTURE_2D,e);let o=1,n=1;r.texImage2D(r.TEXTURE_2D,0,t.internalFormatFloat,o,n,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,s),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0);let a=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(e),r.deleteFramebuffer(s),a}function sZ(r,t){let e=ql(r,t),o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o);let n=1,s=1;r.texImage2D(r.TEXTURE_2D,0,e.internalFormatHalfFloat,n,s,0,e.textureFormatFloat,e.textureTypeHalfFloat,null);let a=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,a),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0);let i=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(o),r.deleteFramebuffer(a),i}function qI(r){return r!==2?!1:Hr(r).fenceSync!=null}function Vs(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>{e!=null&&y.assert(e.dtype!==\"complex64\",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Se=A();Se.registerFlag(\"HAS_WEBGL\",()=>Se.getNumber(\"WEBGL_VERSION\")>0);Se.registerFlag(\"WEBGL_VERSION\",()=>Xf(2)?2:Xf(1)?1:0);Se.registerFlag(\"WEBGL_CHECK_NUMERICAL_PROBLEMS\",()=>!1);Se.registerFlag(\"WEBGL_BUFFER_SUPPORTED\",()=>Se.get(\"WEBGL_VERSION\")===2);Se.registerFlag(\"WEBGL_CPU_FORWARD\",()=>!0);Se.registerFlag(\"WEBGL_FORCE_F16_TEXTURES\",()=>!1);Se.registerFlag(\"WEBGL_PACK\",()=>Se.getBool(\"HAS_WEBGL\"));Se.registerFlag(\"WEBGL_PACK_NORMALIZATION\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_CLIP\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_DEPTHWISECONV\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_BINARY_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_UNARY_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_ARRAY_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_IMAGE_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_REDUCE\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_LAZILY_UNPACK\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_CONV_IM2COL\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_CONV2DTRANSPOSE\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_MAX_TEXTURE_SIZE\",()=>WI(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_MAX_TEXTURES_IN_SHADER\",()=>UI(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\",()=>{let r=Se.getNumber(\"WEBGL_VERSION\");return r===0?0:GI(r)});Se.registerFlag(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\",()=>Se.getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0&&!Ji.isMobile());Se.registerFlag(\"WEBGL_RENDER_FLOAT32_CAPABLE\",()=>HI(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_RENDER_FLOAT32_ENABLED\",()=>Se.getBool(\"WEBGL_FORCE_F16_TEXTURES\")?!1:Se.getBool(\"WEBGL_RENDER_FLOAT32_CAPABLE\"));Se.registerFlag(\"WEBGL_DOWNLOAD_FLOAT_ENABLED\",()=>KI(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_FENCE_API_ENABLED\",()=>qI(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_SIZE_UPLOAD_UNIFORM\",()=>Se.getBool(\"WEBGL_RENDER_FLOAT32_ENABLED\")?4:0);Se.registerFlag(\"WEBGL_DELETE_TEXTURE_THRESHOLD\",()=>-1,r=>{if(typeof r!=\"number\")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${r}.`)});Se.registerFlag(\"WEBGL_FLUSH_THRESHOLD\",()=>Ji.isMobile()?1:-1,r=>{if(typeof r!=\"number\")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${r}.`)});Se.registerFlag(\"CPU_HANDOFF_SIZE_THRESHOLD\",()=>128);Se.registerFlag(\"WEBGL_USE_SHAPES_UNIFORMS\",()=>!1);Se.registerFlag(\"TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD\",()=>1e5);Se.registerFlag(\"TOPK_K_CPU_HANDOFF_THRESHOLD\",()=>128);Se.registerFlag(\"WEBGL_EXP_CONV\",()=>!1);Se.registerFlag(\"SOFTWARE_WEBGL_ENABLED\",()=>Se.getBool(\"IS_TEST\"));Se.registerFlag(\"WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE\",()=>1/0);Se.registerFlag(\"WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE\",()=>!1);Se.registerFlag(\"WEBGL2_ISNAN_CUSTOM\",()=>!1);Se.registerFlag(\"ENGINE_COMPILE_ONLY\",()=>!1);function It(){let r,t,e,o,n,s,a,i,p,u;return A().getNumber(\"WEBGL_VERSION\")===2?(r=\"#version 300 es\",t=\"in\",e=\"out\",o=\"in\",n=\"texture\",s=\"outputColor\",a=\"out vec4 outputColor;\",i=A().getBool(\"WEBGL2_ISNAN_CUSTOM\")?`\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n `:\"\",p=\"\",u=`\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n `):(r=\"\",t=\"attribute\",e=\"varying\",o=\"varying\",n=\"texture2D\",s=\"gl_FragColor\",a=\"\",i=`\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n `,p=`\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n `,u=`\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n `),{version:r,attribute:t,varyingVs:e,varyingFs:o,texture2D:n,output:s,defineOutput:a,defineSpecialNaN:i,defineSpecialInf:p,defineRound:u}}function Ws(r,t,e=\"index\"){let o=y.computeStrides(t);return o.map((n,s)=>{let a=`int ${r[s]} = ${e} / ${n}`,i=s===o.length-1?`int ${r[s+1]} = ${e} - ${r[s]} * ${n}`:`index -= ${r[s]} * ${n}`;return`${a}; ${i};`}).join(\"\")}function hp(r,t,e=\"index\"){let o=y.computeStrides(t);return o.map((n,s)=>{let a=`int ${r[s]} = ${e} / outShapeStrides[${s}]`,i=s===o.length-1?`int ${r[s+1]} = ${e} - ${r[s]} * outShapeStrides[${s}]`:`index -= ${r[s]} * outShapeStrides[${s}]`;return`${a}; ${i};`}).join(\"\")}function aZ(r,t){let e=r.length,o=r.map(s=>`${t}[${s}]`),n=new Array(e-1);n[e-2]=o[e-1];for(let s=e-3;s>=0;--s)n[s]=`(${n[s+1]} * ${o[s+1]})`;return n}function IR(r,t,e=\"index\"){let o=r.map((s,a)=>a),n=aZ(o,t);return n.map((s,a)=>{let i=`int ${r[a]} = ${e} / ${n[a]}`,p=a===n.length-1?`int ${r[a+1]} = ${e} - ${r[a]} * ${n[a]}`:`index -= ${r[a]} * ${n[a]}`;return`${i}; ${p};`}).join(\"\")}function _c(r){let t=y.computeStrides(r).map(e=>e.toString());return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z;\n }\n`}function $c(){return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n`}var Yf=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n`;var{getBroadcastDims:vR}=w;function kR(r,t,e){let o=[];if(r.forEach(d=>{let f=y.sizeFromShape(d.shapeInfo.logicalShape);if(d.shapeInfo.isUniform?o.push(`uniform float ${d.name}${f>1?`[${f}]`:\"\"};`):(o.push(`uniform sampler2D ${d.name};`),o.push(`uniform int offset${d.name};`)),e.enableShapeUniforms){let{uniformShape:h}=Qf(e.packedInputs,d.shapeInfo.logicalShape,d.shapeInfo.texShape);switch(h.length){case 1:o.push(`uniform int ${d.name}Shape;`);break;case 2:o.push(`uniform ivec2 ${d.name}Shape;`);break;case 3:o.push(`uniform ivec3 ${d.name}Shape;`);break;case 4:o.push(`uniform ivec4 ${d.name}Shape;`);break;default:break}o.push(`uniform ivec2 ${d.name}TexShape;`)}}),e.enableShapeUniforms){switch(t.logicalShape.length){case 1:o.push(\"uniform int outShape;\");break;case 2:o.push(\"uniform ivec2 outShape;\"),o.push(\"uniform int outShapeStrides;\");break;case 3:o.push(\"uniform ivec3 outShape;\"),o.push(\"uniform ivec2 outShapeStrides;\");break;case 4:o.push(\"uniform ivec4 outShape;\"),o.push(\"uniform ivec3 outShapeStrides;\");break;default:break}o.push(\"uniform ivec2 outTexShape;\")}e.customUniforms&&e.customUniforms.forEach(d=>{o.push(`uniform ${d.type} ${d.name}${d.arrayIndex?`[${d.arrayIndex}]`:\"\"};`)});let n=o.join(`\n`),s=r.map(d=>iZ(d,t,e.packedInputs,e.enableShapeUniforms)).join(`\n`),a=t.texShape,i=It(),p=cZ(i),u,c,l=dZ(i);return t.isPacked?(u=uZ(t.logicalShape,a,e.enableShapeUniforms),c=mZ(i)):(u=pZ(t.logicalShape,a,e.enableShapeUniforms),c=lZ(i)),e.packedInputs&&(l+=xZ),[l,p,c,n,u,s,e.userCode].join(`\n`)}function Rc(r,t=!1){let e=r.shapeInfo.logicalShape;switch(e.length){case 0:return $Z(r,t);case 1:return RZ(r,t);case 2:return AZ(r,t);case 3:return PZ(r,t);case 4:return MZ(r,t);case 5:return LZ(r);case 6:return BZ(r);default:throw new Error(`${e.length}-D input sampling is not yet supported`)}}function NR(r,t){switch(r.shapeInfo.logicalShape.length){case 0:return _Z(r);case 1:return EZ(r,t);case 2:return DZ(r,t);case 3:return FZ(r,t);default:return OZ(r,t)}}function iZ(r,t,e=!1,o){let n=\"\";e?n+=NR(r,o):n+=Rc(r,o);let s=r.shapeInfo.logicalShape,a=t.logicalShape;return s.length<=a.length&&(e?n+=zZ(r,t):n+=VZ(r,t)),n}function uZ(r,t,e){switch(r.length){case 0:return TR();case 1:return yZ(r,t,e);case 2:return NZ(r,t,e);case 3:return CZ(r,t,e);default:return SZ(r,t,e)}}function pZ(r,t,e){switch(r.length){case 0:return TR();case 1:return bZ(r,t,e);case 2:return TZ(r,t,e);case 3:return wZ(r,t,e);case 4:return IZ(r,t,e);case 5:return vZ(r,t);case 6:return kZ(r,t);default:throw new Error(`${r.length}-D output sampling is not yet supported`)}}function cZ(r){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${r.texture2D}(textureSampler, uv).r;\n }\n `}function lZ(r){return`\n void setOutput(float val) {\n ${r.output} = vec4(val, 0, 0, 0);\n }\n `}function mZ(r){return`\n void setOutput(vec4 val) {\n ${r.output} = val;\n }\n `}function dZ(r){return`${r.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${r.varyingFs} vec2 resultUV;\n ${r.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${r.defineSpecialNaN}\n ${r.defineSpecialInf}\n ${r.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${fZ}\n ${hZ}\n ${gZ}\n `}var fZ=`\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`,hZ=`\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`,gZ=`\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`,xZ=`\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n`;function TR(){return`\n int getOutputCoords() {\n return 0;\n }\n `}function yZ(r,t,e){let o=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return o[0]===1?e?`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n `:`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${o[1]}.0);\n }\n `:o[1]===1?e?`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n `:`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${o[0]}.0);\n }\n `:e?`\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n `:`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${o[0]}, ${o[1]}));\n return 2 * (resTexRC.x * ${o[1]} + resTexRC.y);\n }\n `}function bZ(r,t,e){return t[0]===1?e?`\n int getOutputCoords() {\n return int(resultUV.x * float(outTexShape[1]));\n }\n `:`\n int getOutputCoords() {\n return int(resultUV.x * ${t[1]}.0);\n }\n `:t[1]===1?e?`\n int getOutputCoords() {\n return int(resultUV.y * float(outTexShape[0]));\n }\n `:`\n int getOutputCoords() {\n return int(resultUV.y * ${t[0]}.0);\n }\n `:e?`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n return resTexRC.x * outTexShape[1] + resTexRC.y;\n }\n `:`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n return resTexRC.x * ${t[1]} + resTexRC.y;\n }\n `}function CZ(r,t,e){if(e)return`\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n `;let o=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],n=Math.ceil(r[2]/2),s=n*Math.ceil(r[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${o[0]}, ${o[1]}));\n int index = resTexRC.x * ${o[1]} + resTexRC.y;\n\n int b = index / ${s};\n index -= b * ${s};\n\n int r = 2 * (index / ${n});\n int c = imod(index, ${n}) * 2;\n\n return ivec3(b, r, c);\n }\n `}function wZ(r,t,e){if(e)return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ${hp([\"r\",\"c\",\"d\"],r)}\n return ivec3(r, c, d);\n }\n`;let o=Ws([\"r\",\"c\",\"d\"],r);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${t[0]}, ${t[1]}));\n int index = resTexRC.x * ${t[1]} + resTexRC.y;\n ${o}\n return ivec3(r, c, d);\n }\n `}function SZ(r,t,e){if(e)return`\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n `;let o=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],n=Math.ceil(r[r.length-1]/2),s=n*Math.ceil(r[r.length-2]/2),a=s,i=\"\",p=\"b, r, c\";for(let u=2;u=1?c=\"coords = 0;\":c=i.map(b=>`coords.${l[b+u]} = 0;`).join(`\n`);let m=\"\";a<2&&s>0?m=\"coords\":m=r.shapeInfo.logicalShape.map((b,C)=>`coords.${l[C+u]}`).join(\", \");let d=\"return outputValue;\",h=y.sizeFromShape(r.shapeInfo.logicalShape)===1,x=y.sizeFromShape(t.logicalShape)===1;if(s===1&&!h&&!x)d=`\n return vec4(outputValue.xy, outputValue.xy);\n `;else if(h&&!x)a===1?d=`\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n `:d=`\n return vec4(outputValue.x);\n `;else if(i.length){let b=s-2,C=s-1;i.indexOf(b)>-1&&i.indexOf(C)>-1?d=\"return vec4(outputValue.x);\":i.indexOf(b)>-1?d=\"return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);\":i.indexOf(C)>-1&&(d=\"return vec4(outputValue.xx, outputValue.zz);\")}return`\n vec4 ${n}() {\n ${p} coords = getOutputCoords();\n ${c}\n vec4 outputValue = get${o}(${m});\n ${d}\n }\n `}function VZ(r,t){let e=r.name,o=e.charAt(0).toUpperCase()+e.slice(1),n=\"get\"+o+\"AtOutCoords\",s=t.texShape,a=r.shapeInfo.texShape,i=r.shapeInfo.logicalShape.length,p=t.logicalShape.length;if(!r.shapeInfo.isUniform&&i===p&&r.shapeInfo.flatOffset==null&&y.arraysEqual(a,s))return`\n float ${n}() {\n return sampleTexture(${e}, resultUV);\n }\n `;let u=Re(p),c=vR(r.shapeInfo.logicalShape,t.logicalShape),l=p-i,m,d=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"];i===0?m=\"\":p<2&&c.length>=1?m=\"coords = 0;\":m=c.map(h=>`coords.${d[h+l]} = 0;`).join(`\n`);let f=\"\";return p<2&&i>0?f=\"coords\":f=r.shapeInfo.logicalShape.map((h,g)=>`coords.${d[g+l]}`).join(\", \"),`\n float ${n}() {\n ${u} coords = getOutputCoords();\n ${m}\n return get${o}(${f});\n }\n `}function Re(r){if(r<=1)return\"int\";if(r===2)return\"ivec2\";if(r===3)return\"ivec3\";if(r===4)return\"ivec4\";if(r===5)return\"ivec5\";if(r===6)return\"ivec6\";throw Error(`GPU for rank ${r} is not yet supported`)}function Qf(r,t,e){let{newShape:o,keptDims:n}=y.squeezeShape(t),s=t.length,a=r&&s===3&&t[0]===1,i=a?t.slice(1):o,p=!r&&s>1&&!y.arraysEqual(t,e)&&o.lengthr[e]).join(\", \")}function $R(r,t,e,o){let n=e.map((c,l)=>{let m={logicalShape:c.shape,texShape:c.isUniform?null:c.texData.texShape,isUniform:c.isUniform,isPacked:c.isUniform?!1:c.texData.isPacked,flatOffset:null};return c.texData!=null&&c.texData.slice!=null&&c.texData.slice.flatOffset>0&&(m.flatOffset=c.texData.slice.flatOffset),{name:t.variableNames[l],shapeInfo:m}}),s=n.map(c=>c.shapeInfo),a={logicalShape:o.shape,texShape:o.texData.texShape,isUniform:!1,isPacked:o.texData.isPacked,flatOffset:null},i=kR(n,a,t),p=EI(r.gl,i),u=r.createProgram(p);return A().get(\"ENGINE_COMPILE_ONLY\")?{program:t,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(r.buildVao(u),Object.assign({program:t,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a},jI(r,t,u)))}function jI(r,t,e){let o=[],n=[],s,a,i,p=null,u=null;u=r.getUniformLocation(e,\"NAN\",!1),A().getNumber(\"WEBGL_VERSION\")===1&&(p=r.getUniformLocation(e,\"INFINITY\",!1));let c=!1;for(let l of t.variableNames){let m={name:l,uniform:r.getUniformLocation(e,l,c),offset:r.getUniformLocation(e,`offset${l}`,c)};t.enableShapeUniforms&&(m.shape=r.getUniformLocation(e,`${l}Shape`,c),m.texShape=r.getUniformLocation(e,`${l}TexShape`,c)),o.push(m)}if(t.enableShapeUniforms&&(s=r.getUniformLocation(e,\"outShape\",c),i=r.getUniformLocation(e,\"outShapeStrides\",c),a=r.getUniformLocation(e,\"outTexShape\",c)),t.customUniforms)for(let l of t.customUniforms)n.push(r.getUniformLocation(e,l.name,c));return{variablesLocations:o,customUniformLocations:n,infLoc:p,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:i,outTexShapeLocation:a}}function _R(r,t){if(r.length!==t.length)throw Error(`Binary was compiled with ${r.length} inputs, but was executed with ${t.length} inputs`);r.forEach((e,o)=>{let n=e.logicalShape,s=t[o],a=s.shape;if(!y.arraysEqual(n,a))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${n} and ${a} must match`);if(e.isUniform&&s.isUniform)return;let i=e.texShape,p=s.isUniform?null:s.texData.texShape;if(!y.arraysEqual(i,p))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${i} and ${p} must match`)})}function ER(r,t,e,o,n){t.program.enableShapeUniforms||(_R(t.inShapeInfos,e),_R([t.outShapeInfo],[o]));let s=o.texData.texture,a=o.texData.texShape;o.texData.isPacked?r.setOutputPackedMatrixTexture(s.texture,a[0],a[1]):r.setOutputMatrixTexture(s.texture,a[0],a[1]),r.setProgram(t.webGLProgram),r.bindVertexArray(t.webGLProgram.vao),A().getNumber(\"WEBGL_VERSION\")===1&&t.infLoc!==null&&r.gl.uniform1f(t.infLoc,1/0),t.nanLoc!==null&&r.gl.uniform1f(t.nanLoc,NaN);for(let p=0;p{let i=a.texData!=null&&a.texData.slice!=null&&a.texData.slice.flatOffset>0;if(r.enableShapeUniforms&&!a.isUniform){let p=a.texData.texShape,{useSqueezeShape:u,uniformShape:c,keptDims:l}=Qf(r.packedInputs,a.shape,p),m=\"\",d=\"\",f=\"\";if(c.length===1&&r.packedInputs){let k=[Math.ceil(p[0]/2),Math.ceil(p[1]/2)];m=`${k[0]>1}_${k[1]>1}`}else if(c.length===2&&!r.packedInputs)d=`${c[0]>1}_${c[1]>1}`;else if(c.length>2&&!r.packedInputs){let k=y.computeStrides(c);f=`${k[0]===p[1]}_${k[k.length-1]===p[1]}`}let h=a.shape.length,g=c.length===2&&y.arraysEqual(a.shape,p),x=y.sizeFromShape(a.shape)===1,b=w.getBroadcastDims(a.shape,e.shape),C=!r.packedInputs&&h===e.shape.length&&y.arraysEqual(p,e.texData.texShape),S=r.packedInputs||c.length>2?\"\":`${p[0]>1}_${p[1]>1}`;o+=`${h}_${C}_${u?l:\"\"}_${c.length}_${x}_${b}_${g}_${m}_${d}_${f}_${S}_${i}`}else{let p=a.isUniform?\"uniform\":a.texData.texShape;o+=`${a.shape}_${p}_${i}`}});let n=r.userCode,s=r.constructor.name;return s+=\"_\"+o+\"_\"+n+`${A().getNumber(\"WEBGL_VERSION\")}`,s}function ut(r){return A().getBool(\"WEBGL_USE_SHAPES_UNIFORMS\")&&r<=4}var Zf=class{constructor(t){this.variableNames=[\"A\"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=fu.DENSE,this.customUniforms=[{name:\"texShape\",type:\"ivec2\"}];let e=It();this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?hp([\"r\",\"c\",\"d\"],t):Ws([\"r\",\"c\",\"d\"],t)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${e.output} = result;\n }\n `}};var Jf=class{constructor(t){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=fu.DENSE,this.customUniforms=[{name:\"texShape\",type:\"ivec2\"}];let e=It();this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?hp([\"r\",\"c\",\"d\"],t):Ws([\"r\",\"c\",\"d\"],t)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${e.output} = result;\n }\n `}};var eh=class{constructor(t){this.variableNames=[\"A\"],this.outTexUsage=mr.DOWNLOAD;let e=It();this.outputShape=t,this.userCode=`\n ${Yf}\n\n void main() {\n float x = getAAtOutCoords();\n ${e.output} = encode_float(x);\n }\n `}};var th=class{constructor(t){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=mr.DOWNLOAD;let e=It();this.outputShape=t,this.userCode=`\n ${Yf}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${e.output} = encode_float(x);\n }\n `}};var GZ={R:0,G:1,B:2,A:3},Yl=class{constructor(t,e=!1,o=\"RGBA\"){this.variableNames=[\"A\"],this.customUniforms=[{name:\"texShape\",type:\"ivec2\"}];let n=It();this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length);let s=\"result\";e&&(s=\"floor(result * 255. + 0.5)\");let a=\"\";for(let i=0;iov,createBufferFromOutputTexture:()=>av,createFloat16MatrixTexture:()=>JI,createFloat16PackedMatrixTexture:()=>rv,createFloat32MatrixTexture:()=>ZI,createIndexBuffer:()=>QI,createPackedMatrixTexture:()=>tv,createUnsignedBytesMatrixTexture:()=>ev,createVertexBuffer:()=>YI,createVertexShader:()=>XI,downloadByteEncodedFloatMatrixFromOutputTexture:()=>uv,downloadFloat32MatrixFromBuffer:()=>iv,downloadMatrixFromPackedOutputTexture:()=>cv,downloadPackedMatrixFromBuffer:()=>pv,getInternalFormatForFloat16MatrixTexture:()=>nh,getInternalFormatForFloat16PackedMatrixTexture:()=>ih,getInternalFormatForFloat32MatrixTexture:()=>oh,getInternalFormatForPackedMatrixTexture:()=>ah,getInternalFormatForUnsignedBytesMatrixTexture:()=>sh,uploadDenseMatrixToTexture:()=>nv,uploadPixelDataToTexture:()=>sv});function XI(r){let t=It(),e=`${t.version}\n precision highp float;\n ${t.attribute} vec3 clipSpacePos;\n ${t.attribute} vec2 uv;\n ${t.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`;return $I(r,e)}function YI(r){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 AI(r,t)}function QI(r){let t=new Uint16Array([0,1,2,2,1,3]);return FI(r,t)}function Ql(r,t,e,o,n,s){OI(t,e);let a=PI(r),i=r.TEXTURE_2D;return ce(r,()=>r.bindTexture(i,a)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MIN_FILTER,r.NEAREST)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MAG_FILTER,r.NEAREST)),A().getNumber(\"WEBGL_VERSION\")===1?ce(r,()=>r.texImage2D(i,0,o,t,e,0,n,s,null)):ce(r,()=>r.texStorage2D(i,1,o,t,e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null)),{texture:a,texShape:[e,t]}}function oh(r){return r.internalFormatFloat}function ZI(r,t,e,o){let[n,s]=fp(t,e);return Ql(r,n,s,oh(o),o.textureFormatFloat,r.FLOAT)}function nh(r){return r.internalFormatHalfFloat}function JI(r,t,e,o){let[n,s]=fp(t,e);return Ql(r,n,s,nh(o),o.textureFormatFloat,o.textureTypeHalfFloat)}function sh(r){return r.downloadTextureFormat}function ev(r,t,e,o){let[n,s]=fp(t,e);return Ql(r,n,s,sh(o),r.RGBA,r.UNSIGNED_BYTE)}function ah(r){return r.internalFormatPackedFloat}function tv(r,t,e,o){let[n,s]=Ma(t,e);return Ql(r,n,s,ah(o),r.RGBA,r.FLOAT)}function ih(r){return r.internalFormatPackedHalfFloat}function rv(r,t,e,o){let[n,s]=Ma(t,e);return Ql(r,n,s,ih(o),r.RGBA,o.textureTypeHalfFloat)}function ov(r,t,e){return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,e)),qf(r,t,\"clipSpacePos\",e,3,20,0)&&qf(r,t,\"uv\",e,2,20,12)}function nv(r,t,e,o,n,s){ce(r,()=>r.bindTexture(r.TEXTURE_2D,t));let a,i,p;n instanceof Uint8Array?(a=new Uint8Array(e*o*4),i=r.UNSIGNED_BYTE,p=r.RGBA):(a=new Float32Array(e*o*4),i=r.FLOAT,p=s.internalFormatPackedFloat),a.set(n),A().getNumber(\"WEBGL_VERSION\")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,e,o,r.RGBA,i,a)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,p,e,o,0,r.RGBA,i,a)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function sv(r,t,e){ce(r,()=>r.bindTexture(r.TEXTURE_2D,t)),e.data instanceof Uint8Array?A().getNumber(\"WEBGL_VERSION\")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.width,e.height,r.RGBA,r.UNSIGNED_BYTE,e.data)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width,e.height,0,r.RGBA,r.UNSIGNED_BYTE,e.data)):A().getNumber(\"WEBGL_VERSION\")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,e)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function av(r,t,e,o){let n=r.createBuffer();ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,n));let i=4*4*t*e;return ce(r,()=>r.bufferData(r.PIXEL_PACK_BUFFER,i,r.STREAM_READ)),ce(r,()=>r.readPixels(0,0,e,t,r.RGBA,r.FLOAT,0)),ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,null)),n}function iv(r,t,e){let o=r,n=new Float32Array(e);return o.bindBuffer(o.PIXEL_PACK_BUFFER,t),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,n),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),n}function uv(r,t,e,o){let[n,s]=fp(t,e),a=4,i=new Uint8Array(xR(t*e,a));return ce(r,()=>r.readPixels(0,0,n,s,o.downloadTextureFormat,r.UNSIGNED_BYTE,i)),new Float32Array(i.buffer)}function pv(r,t,e,o,n,s,a,i){let p=r,u=new Float32Array(yR(s,a));return p.bindBuffer(p.PIXEL_PACK_BUFFER,t),p.getBufferSubData(p.PIXEL_PACK_BUFFER,0,u),p.bindBuffer(p.PIXEL_PACK_BUFFER,null),u}function cv(r,t,e){let o=new Float32Array(t*e*4);return ce(r,()=>r.readPixels(0,0,e,t,r.RGBA,r.FLOAT,o)),o}var xp=class{constructor(t){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];let e=A().getNumber(\"WEBGL_VERSION\");if(t!=null?(this.gl=t,kI(e,t)):this.gl=Hr(e),t=this.gl,A().getNumber(\"WEBGL_VERSION\")===2){let s=t;this.createVertexArray=()=>ce(s,()=>s.createVertexArray()),this.bindVertexArray=a=>ce(s,()=>s.bindVertexArray(a)),this.deleteVertexArray=a=>ce(s,()=>s.deleteVertexArray(a)),this.getVertexArray=()=>ce(s,()=>s.getParameter(s.VERTEX_ARRAY_BINDING))}else if(t!=null){let s=t.getExtension(\"OES_vertex_array_object\");if(s==null)throw new Error(\"All WebGL1 implementations are expected to offer OES_vertex_array_object.\");this.createVertexArray=()=>ce(t,()=>s.createVertexArrayOES()),this.bindVertexArray=a=>ce(t,()=>s.bindVertexArrayOES(a)),this.deleteVertexArray=a=>ce(t,()=>s.deleteVertexArrayOES(a)),this.getVertexArray=()=>ce(t,()=>t.getParameter(s.VERTEX_ARRAY_BINDING_OES))}let o=\"WEBGL_color_buffer_float\",n=\"EXT_color_buffer_half_float\";if(this.parallelCompilationExtension=this.gl.getExtension(\"KHR_parallel_shader_compile\"),A().getNumber(\"WEBGL_VERSION\")===1){let s=\"OES_texture_float\",a=\"OES_texture_half_float\";if(this.textureFloatExtension=vc(this.gl,s),Kr(this.gl,a))this.textureHalfFloatExtension=vc(this.gl,a);else if(A().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(o),Kr(this.gl,n))this.colorBufferHalfFloatExtension=vc(this.gl,n);else if(A().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(o=\"EXT_color_buffer_float\",Kr(this.gl,o))this.colorBufferFloatExtension=this.gl.getExtension(o);else if(Kr(this.gl,n))this.colorBufferHalfFloatExtension=this.gl.getExtension(n);else throw new Error(\"GL context does not support color renderable floats\");this.vertexBuffer=YI(this.gl),this.indexBuffer=QI(this.gl),this.framebuffer=MI(this.gl),this.textureConfig=ql(this.gl,this.textureHalfFloatExtension)}get debug(){return A().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 t=this.gl;ce(t,()=>t.finish()),ce(t,()=>t.bindFramebuffer(t.FRAMEBUFFER,null)),ce(t,()=>t.deleteFramebuffer(this.framebuffer)),ce(t,()=>t.bindBuffer(t.ARRAY_BUFFER,null)),ce(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)),ce(t,()=>t.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(t,e){return this.throwIfDisposed(),ZI(this.gl,t,e,this.textureConfig)}createFloat16MatrixTexture(t,e){return this.throwIfDisposed(),JI(this.gl,t,e,this.textureConfig)}createUnsignedBytesMatrixTexture(t,e){return this.throwIfDisposed(),ev(this.gl,t,e,this.textureConfig)}uploadPixelDataToTexture(t,e){this.throwIfDisposed(),sv(this.gl,t,e)}uploadDenseMatrixToTexture(t,e,o,n){this.throwIfDisposed(),nv(this.gl,t,e,o,n,this.textureConfig)}createFloat16PackedMatrixTexture(t,e){return this.throwIfDisposed(),rv(this.gl,t,e,this.textureConfig)}createPackedMatrixTexture(t,e){return this.throwIfDisposed(),tv(this.gl,t,e,this.textureConfig)}deleteMatrixTexture(t){this.throwIfDisposed(),this.outputTexture===t&&(jf(this.gl,this.framebuffer),this.outputTexture=null),ce(this.gl,()=>this.gl.deleteTexture(t))}downloadByteEncodedFloatMatrixFromOutputTexture(t,e,o){return this.downloadMatrixDriver(t,()=>uv(this.gl,e,o,this.textureConfig))}downloadPackedMatrixFromBuffer(t,e,o,n,s,a){return pv(this.gl,t,e,o,n,s,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(t,e){return iv(this.gl,t,e)}createBufferFromTexture(t,e,o){this.bindTextureToFrameBuffer(t);let n=av(this.gl,e,o,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){let t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let e,o;if(A().getBool(\"WEBGL_FENCE_API_ENABLED\")){let n=t,s=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);t.flush(),o=()=>{let a=n.clientWaitSync(s,0,0);return a===n.ALREADY_SIGNALED||a===n.CONDITION_SATISFIED},e=s}else A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?(e=this.beginQuery(),this.endQuery(),o=()=>this.isQueryAvailable(e,A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))):o=()=>!0;return{query:e,isFencePassed:o}}downloadMatrixFromPackedTexture(t,e,o){return this.downloadMatrixDriver(t,()=>cv(this.gl,e,o))}createProgram(t){this.throwIfDisposed();let e=this.gl;this.vertexShader==null&&(this.vertexShader=XI(e));let o=RI(e);ce(e,()=>e.attachShader(o,this.vertexShader)),ce(e,()=>e.attachShader(o,t)),DI(e,o);let n=Object.assign(o,{vao:this.createVertexArray()});return this.debug&&jl(e,n),n}buildVao(t){this.setProgram(t),this.bindVertexArray(t.vao);let e=this.gl;ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),ov(e,t,this.vertexBuffer)}deleteProgram(t){this.throwIfDisposed(),t===this.program&&(this.program=null),t!=null&&(ce(this.gl,()=>this.gl.deleteProgram(t)),this.deleteVertexArray(t.vao))}setProgram(t){this.throwIfDisposed(),this.program=t,this.program!=null&&this.debug&&jl(this.gl,this.program),ce(this.gl,()=>this.gl.useProgram(t))}getUniformLocation(t,e,o=!0){return this.throwIfDisposed(),o?LI(this.gl,t,e):BI(this.gl,t,e)}getAttributeLocation(t,e){return this.throwIfDisposed(),ce(this.gl,()=>this.gl.getAttribLocation(t,e))}getUniformLocationNoThrow(t,e){return this.throwIfDisposed(),this.gl.getUniformLocation(t,e)}setInputMatrixTexture(t,e,o){this.throwIfDisposed(),this.throwIfNoProgram(),zI(this.gl,t,e,o)}setOutputMatrixTexture(t,e,o){this.setOutputMatrixTextureDriver(t,o,e)}setOutputPackedMatrixTexture(t,e,o){this.throwIfDisposed();let[n,s]=Ma(e,o);this.setOutputMatrixTextureDriver(t,n,s)}setOutputMatrixWriteRegion(t,e,o,n){this.setOutputMatrixWriteRegionDriver(o,t,n,e)}setOutputPackedMatrixWriteRegion(t,e,o,n){throw new Error(\"setOutputPackedMatrixWriteRegion not implemented.\")}debugValidate(){this.program!=null&&jl(this.gl,this.program),kc(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let t=this.gl;if(this.debug){let e=this.getVertexArray();console.assert(e===this.program.vao,\"VAO changed between setProgram and executeProgram!\"),this.debugValidate()}ce(t,()=>t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),ce(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=vc(this.gl,A().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(A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.createQuery();return o.beginQuery(n.TIME_ELAPSED_EXT,s),s}let t=this.getQueryTimerExtensionWebGL1(),e=t.createQueryEXT();return t.beginQueryEXT(t.TIME_ELAPSED_EXT,e),e}endQuery(){if(A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")===2){let e=this.gl,o=this.getQueryTimerExtensionWebGL2();e.endQuery(o.TIME_ELAPSED_EXT);return}let t=this.getQueryTimerExtensionWebGL1();t.endQueryEXT(t.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(t){return await y.repeatedTry(()=>this.disposed||this.isQueryAvailable(t,A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))),this.getQueryTime(t,A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))}getQueryTime(t,e){if(e===0)return null;if(e===2){let o=this.gl;return o.getQueryParameter(t,o.QUERY_RESULT)/1e6}else{let o=this.getQueryTimerExtensionWebGL1();return o.getQueryObjectEXT(t,o.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(t,e){if(e===0)return!0;if(e===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.getQueryParameter(t,o.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}else{let o=this.getQueryTimerExtensionWebGL1(),n=o.getQueryObjectEXT(t,o.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(o.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(t){return new Promise(e=>{this.addItemToPoll(()=>t.isFencePassed(),()=>e())})}pollItems(){let t=HZ(this.itemsToPoll.map(e=>e.isDoneFn));for(let e=0;e<=t;++e){let{resolveFn:o}=this.itemsToPoll[e];o()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}addItemToPoll(t,e){if(this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1)return;let o;\"setTimeoutCustom\"in A().platform&&(o=A().platform.setTimeoutCustom.bind(A().platform)),y.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,o)}bindTextureToFrameBuffer(t){this.throwIfDisposed(),Xl(this.gl,t,this.framebuffer),this.debug&&kc(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(Xl(this.gl,this.outputTexture,this.framebuffer),this.debug&&kc(this.gl)):jf(this.gl,this.framebuffer)}downloadMatrixDriver(t,e){this.bindTextureToFrameBuffer(t);let o=e();return this.unbindTextureToFrameBuffer(),o}setOutputMatrixTextureDriver(t,e,o){this.throwIfDisposed();let n=this.gl;Xl(n,t,this.framebuffer),this.debug&&kc(n),this.outputTexture=t,ce(n,()=>n.viewport(0,0,e,o)),ce(n,()=>n.scissor(0,0,e,o))}setOutputMatrixWriteRegionDriver(t,e,o,n){this.throwIfDisposed(),ce(this.gl,()=>this.gl.scissor(t,e,o,n))}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 HZ(r){let t=0;for(;t`${r}.${e}`)}function Rt(r,t){return t===1?[r]:mv(r,t)}function ID(r,t){if(r===1)return\"rc\";let e=\"\";for(let o=0;o ${this.enableShapeUniforms?\"outShape\":this.outputShape[0]}`;let e=\"\";for(let o=this.rank-2;o= ${this.enableShapeUniforms?`outShape[${o}]`:this.outputShape[o]}`,o= ${o};\n bool rEdge = rp1 >= ${n};\n `}getOutput(t){let e=this.getSourceCoordsArr(t);return this.rank===1?`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?\"outShape\":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${e[0]}),\n cEdge ? 0. : getA(${e[1]}),\n rEdge ? 0. : getA(${e[2]}),\n rEdge || cEdge ? 0. : getA(${e[3]})`}};var Pc=class{constructor(t,e){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"inputShape\",type:\"ivec3\"}],this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length);let o=\"\";for(let n=0;n<4;n++){let s=\"thisRC = rc;\";n%2===1&&(s+=\"thisRC.z += 1;\"),n>1&&(s+=\"thisRC.y += 1;\"),o+=`\n ${s}\n ${n>0?\"if(thisRC.y < rows && thisRC.z < cols){\":\"\"}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${n}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${n>0?\"}\":\"\"}\n `}this.userCode=`\n ${KZ(e,this.enableShapeUniforms)}\n ${this.enableShapeUniforms?$c():_c(t)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?\"outShape[1]\":t[1]};\n int cols = ${this.enableShapeUniforms?\"outShape[2]\":t[2]};\n\n ${o}\n\n setOutput(result);\n }\n `}};function KZ(r,t){return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${t?IR([\"r\",\"c\",\"d\"],\"inputShape\"):Ws([\"r\",\"c\",\"d\"],r)}\n return ivec3(r, c, d);\n }\n `}var mh=class{constructor(t){this.gpgpu=t,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(t,e,o){let n=kD(e,o),s=ND(t,n,o);s in this.freeTextures||(this.freeTextures[s]=[]),s in this.usedTextures||(this.usedTextures[s]=[]);let a=vD(t,n,this.gpgpu.gl,this.gpgpu.textureConfig,o);if(this.freeTextures[s].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=a,this.log();let p=this.freeTextures[s].pop();return this.usedTextures[s].push(p),p}let i;return n===er.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(t[0],t[1]):n===er.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(t[0],t[1]):n===er.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(t[0],t[1]):n===er.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(t[0],t[1]):n===er.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(t[0],t[1])),this.usedTextures[s].push(i),this.numUsedTextures++,this._numBytesAllocated+=a,this.log(),i}releaseTexture(t,e,o,n){if(this.freeTextures==null)return;let s=kD(o,n),a=ND(e,s,n);a in this.freeTextures||(this.freeTextures[a]=[]);let i=vD(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n),p=A().getNumber(\"WEBGL_DELETE_TEXTURE_THRESHOLD\");p!==-1&&this._numBytesAllocated>p?(this.gpgpu.deleteMatrixTexture(t.texture),this._numBytesAllocated-=i):(this.freeTextures[a].push(t),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let u=this.usedTextures[a],c=u&&u.indexOf(t);if(c==null||c<0)throw new Error(\"Cannot release a texture that was never provided by this texture manager\");u[c]=u[u.length-1],u.pop(),this.log()}log(){if(!this.logEnabled)return;let t=this.numFreeTextures+this.numUsedTextures;console.log(\"Free/Used\",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${t})`);let e=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*e)}%)`)}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 t in this.freeTextures)this.freeTextures[t].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});for(let t in this.usedTextures)this.usedTextures[t].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function qZ(r,t){let e=r;if(t===e.R32F)return 4;if(t===e.R16F)return 2;if(t===e.RGBA32F)return 16;if(t===r.RGBA)return 16;if(t===e.RGBA16F)return 8;if(t===e.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}function vD(r,t,e,o,n){let s=jZ(t,o),a;if(n){let[p,u]=Ma(r[0],r[1]);a=p*u}else{let[p,u]=fp(r[0],r[1]);a=p*u}let i=qZ(e,s);return a*i}function jZ(r,t){switch(r){case er.PACKED_2X2_FLOAT32:return ah(t);case er.PACKED_2X2_FLOAT16:return ih(t);case er.UNPACKED_FLOAT32:return oh(t);case er.UNPACKED_FLOAT16:return nh(t);case er.PACKED_4X1_UNSIGNED_BYTE:return sh(t);default:throw new Error(`Unknown physical texture type ${r}`)}}function XZ(r){return A().getBool(\"WEBGL_RENDER_FLOAT32_ENABLED\")?r?er.PACKED_2X2_FLOAT32:er.UNPACKED_FLOAT32:r?er.PACKED_2X2_FLOAT16:er.UNPACKED_FLOAT16}function kD(r,t){if(r===mr.UPLOAD)return er.PACKED_2X2_FLOAT32;if(r===mr.RENDER||r==null)return XZ(t);if(r===mr.DOWNLOAD||r===mr.PIXELS)return er.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${r}`)}function ND(r,t,e){return`${r[0]}_${r[1]}_${t}_${e}`}var tr=class{constructor(t,e){this.variableNames=[\"A\"],this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${e}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}},Wt=\"if (isnan(x)) return x;\",TD=\"return x;\",dv=\"return abs(x);\";var _D=\"return (x >= 0.0) ? x : (exp(x) - 1.0);\",$D=Wt+`\n return (x < 0.0) ? 0.0 : x;\n`,ED=Wt+`\n return (x < 0.0) ? 0.0 : min(6.0, x);\n`,La=\"return x;\",RD=\"return 1.0 / (1.0 + exp(-1.0 * x));\";var AD=\"return x;\",FD=`\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n`,PD=`\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,OD=`\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,MD=\"return 1.0 / (1.0 + exp(-1.0 * x));\",Ar=class{constructor(t,e){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${e}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}};var dh=class{constructor(t){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length);let e=t.length,o=Rt(\"rc\",e),n=Re(e),s=ID(e,o),a=o.slice(-2),i=e<=1?\"rc\":`vec2(${a.join(\",\")})`;this.userCode=`\n void main() {\n ${n} rc = getOutputCoords();\n vec4 packedInput = getA(${s});\n\n setOutput(getChannel(packedInput, ${i}));\n }\n `}};var QZ=Vt.whereImpl,ZZ=1e-7,JZ=1e-4,fh={};function e9(r){return r in fh||(fh[r]={}),fh[r]}var t9=A().getNumber(\"CPU_HANDOFF_SIZE_THRESHOLD\"),r9=600;function o9(){return A().global.screen==null?1024:A().global.screen.height*A().global.screen.width*window.devicePixelRatio*r9/1024/1024}var Oc=class r extends so{nextDataId(){return r.nextDataId++}constructor(t){if(super(),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,!A().getBool(\"HAS_WEBGL\"))throw new Error(\"WebGL is not supported on this device\");let e;if(t!=null){if(t instanceof xp)e=t;else{let o=Hr(A().getNumber(\"WEBGL_VERSION\"),t);e=new xp(o)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{let o=Hr(A().getNumber(\"WEBGL_VERSION\"));e=new xp(o),this.binaryCache=e9(A().getNumber(\"WEBGL_VERSION\")),this.gpgpuCreatedLocally=!0}this.gpgpu=e,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new mh(this.gpgpu),this.numMBBeforeWarning=o9(),this.texData=new Bo(this,ur())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(t,e,o,n,s,a){let i=this.makeTensorInfo(e,o),p=this.texData.get(i.dataId);p.isPacked=!1,p.texture={texture:t,texShape:[n,s]},p.texShape=[n,s];let u=Nc(e),c=new Yl(u,!1,a),l=this.runWebGLProgram(c,[i],o,[[n,s]]);return l.shape=e,p.texture=null,this.disposeIntermediateTensorInfo(i),l.dataId}write(t,e,o){if((A().getBool(\"WEBGL_CHECK_NUMERICAL_PROBLEMS\")||A().getBool(\"DEBUG\"))&&this.checkNumericalProblems(t),o===\"complex64\"&&t!=null)throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");let n={id:this.nextDataId()};return this.texData.set(n,{shape:e,dtype:o,values:t,usage:mr.UPLOAD,refCount:1}),n}refCount(t){return this.texData.has(t)?this.texData.get(t).refCount:0}incRef(t){let e=this.texData.get(t);e.refCount++}decRef(t){if(this.texData.has(t)){let e=this.texData.get(t);e.refCount--}}move(t,e,o,n,s){if(A().getBool(\"DEBUG\")&&this.checkNumericalProblems(e),n===\"complex64\")throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");this.texData.set(t,{shape:o,dtype:n,values:e,usage:mr.UPLOAD,refCount:s})}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}readSync(t){let e=this.texData.get(t),{values:o,dtype:n,complexTensorInfos:s,slice:a,shape:i,isPacked:p}=e;if(a!=null){let m;p?m=new Ar(i,La):m=new tr(i,La);let d=this.runWebGLProgram(m,[{dataId:t,shape:i,dtype:n}],n),f=this.readSync(d.dataId);return this.disposeIntermediateTensorInfo(d),f}if(o!=null)return this.convertAndCacheOnCPU(t);if(n===\"string\")return o;let u=this.activeTimers!=null,c;u&&(c=y.now());let l;if(n===\"complex64\"){let m=this.readSync(s.real.dataId),d=this.readSync(s.imag.dataId);l=w.mergeRealAndImagArrays(m,d)}else l=this.getValuesFromTexture(t);return u&&(this.downloadWaitMs+=y.now()-c),this.convertAndCacheOnCPU(t,l)}async read(t){if(this.pendingRead.has(t)){let f=this.pendingRead.get(t);return new Promise(h=>f.push(h))}let e=this.texData.get(t),{values:o,shape:n,slice:s,dtype:a,complexTensorInfos:i,isPacked:p}=e;if(s!=null){let f;p?f=new Ar(n,La):f=new tr(n,La);let h=this.runWebGLProgram(f,[{dataId:t,shape:n,dtype:a}],a),g=this.read(h.dataId);return this.disposeIntermediateTensorInfo(h),g}if(o!=null)return this.convertAndCacheOnCPU(t);if(A().getBool(\"DEBUG\")&&!A().getBool(\"WEBGL_DOWNLOAD_FLOAT_ENABLED\")&&A().getNumber(\"WEBGL_VERSION\")===2)throw new Error(\"tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.\");let u=null,c;if(a!==\"complex64\"&&A().get(\"WEBGL_BUFFER_SUPPORTED\")){c=this.decode(t);let f=this.texData.get(c.dataId);u=this.gpgpu.createBufferFromTexture(f.texture.texture,...Kl(n))}this.pendingRead.set(t,[]),a!==\"complex64\"&&await this.gpgpu.createAndWaitForFence();let l;if(a===\"complex64\"){let f=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),h=f[0],g=f[1];l=w.mergeRealAndImagArrays(h,g)}else if(u==null)l=this.getValuesFromTexture(t);else{let f=y.sizeFromShape(n);l=this.gpgpu.downloadFloat32MatrixFromBuffer(u,f)}if(c!=null&&this.disposeIntermediateTensorInfo(c),u!=null){let f=this.gpgpu.gl;ce(f,()=>f.deleteBuffer(u))}let m=this.convertAndCacheOnCPU(t,l),d=this.pendingRead.get(t);return this.pendingRead.delete(t),d.forEach(f=>f(m)),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t)&&ur().removeDataId(t,this),this.pendingDeletes--),m}readToGPU(t,e={}){let o=this.texData.get(t),{values:n,shape:s,slice:a,dtype:i,isPacked:p,texture:u}=o;if(i===\"complex64\")throw new Error(\"Does not support reading texture for complex64 dtype.\");if(a!=null){let d;p?d=new Ar(s,La):d=new tr(s,La);let f=this.runWebGLProgram(d,[{dataId:t,shape:s,dtype:i}],i),h=this.readToGPU(f,e);return this.disposeIntermediateTensorInfo(f),h}if(u==null)throw n!=null?new Error(\"Data is not on GPU but on CPU.\"):new Error(\"There is no data on GPU or CPU.\");let c=this.decode(t,e.customTexShape),l=ur().makeTensorFromTensorInfo(c),m=this.texData.get(c.dataId);return Object.assign({tensorRef:l},m.texture)}bufferSync(t){let e=this.readSync(t.dataId);if(t.dtype===\"string\")try{let o=e.map(n=>y.decodeString(n));return me(t.shape,t.dtype,o)}catch(o){throw new Error(\"Failed to decode encoded string bytes into utf-8\")}return me(t.shape,t.dtype,e)}checkNumericalProblems(t){if(t!=null)for(let e=0;e0}time(t){let e=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,t();let s=y.flatten(this.activeTimers.map(p=>p.query)).filter(p=>p!=null),a=y.flatten(this.activeTimers.map(p=>p.name)).filter(p=>p!=null);this.activeTimers=e,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\")>0){let p=await Promise.all(s);i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,c)=>({name:a[c],ms:u})).map(u=>`${u.name}: ${u.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 A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\")>0?this.gpgpu.beginQuery():{startMs:y.now(),endMs:null}}endTimer(t){return A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\")>0?(this.gpgpu.endQuery(),t):(t.endMs=y.now(),t)}async getQueryTime(t){if(A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\")>0)return this.gpgpu.waitForQueryAndGetTime(t);let e=t;return e.endMs-e.startMs}disposeData(t,e=!1){if(this.pendingDisposal.has(t))return!1;if(!this.texData.has(t))return!0;if(e?this.texData.get(t).refCount=0:this.texData.get(t).refCount--,!e&&this.texData.get(t).refCount>0)return!1;if(this.pendingRead.has(t))return this.pendingDisposal.add(t),this.pendingDeletes++,!1;this.releaseGPUData(t);let{complexTensorInfos:o}=this.texData.get(t);return o!=null&&(this.disposeData(o.real.dataId,e),this.disposeData(o.imag.dataId,e)),this.texData.delete(t),!0}releaseGPUData(t){let{texture:e,dtype:o,texShape:n,usage:s,isPacked:a,slice:i}=this.texData.get(t),p=i&&i.origDataId||t,u=this.dataRefCount.get(p);u>1?this.dataRefCount.set(p,u-1):(this.dataRefCount.delete(p),e!=null&&(this.numBytesInGPU-=this.computeBytes(n,o),this.textureManager.releaseTexture(e,n,s,a)));let c=this.texData.get(t);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(t){return this.uploadToGPU(t),this.texData.get(t).texture.texture}getDataInfo(t){return this.texData.get(t)}shouldExecuteOnCPU(t,e=t9){return A().getBool(\"WEBGL_CPU_FORWARD\")&&t.every(o=>this.texData.get(o.dataId).texture==null&&y.sizeFromShape(o.shape)0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,t,e)}else n=this.write(o,t,e);return this.texData.get(n).usage=null,{dataId:n,shape:t,dtype:e}}makeOutput(t,e,o){return ur().makeTensorFromTensorInfo(this.makeTensorInfo(t,e,o),this)}unpackTensor(t){let e=new dh(t.shape);return this.runWebGLProgram(e,[t],t.dtype)}packTensor(t){let e=new lh(t.shape),o=!0;return this.runWebGLProgram(e,[t],t.dtype,null,o)}packedReshape(t,e){let o=[hi(t.shape),...gi(t.shape)],n={dtype:t.dtype,shape:o,dataId:t.dataId},s=[hi(e),...gi(e)],a=new Pc(s,o),i=!0,p=[o],u=this.runWebGLProgram(a,[n],t.dtype,p,i);return{dataId:u.dataId,shape:e,dtype:u.dtype}}decode(t,e){let o=this.texData.get(t),{isPacked:n,shape:s,dtype:a}=o;if(e!=null){let m=y.sizeFromShape(s),d=e[0]*e[1]*4;y.assert(m<=d,()=>\"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.\")}let i=Nc(s),p;n?p=new Jf(i):p=new Zf(i);let u=!0,c=[e!=null?e:Kl(i)],l=this.runWebGLProgram(p,[{shape:i,dtype:a,dataId:t}],a,c,u,e);return{dtype:a,shape:s,dataId:l.dataId}}runWebGLProgram(t,e,o,n,s=!1,a){let i=this.makeTensorInfo(t.outputShape,o),p=this.texData.get(i.dataId);if(t.packedOutput&&(p.isPacked=!0),t.outPackingScheme===fu.DENSE){let x=a!=null?a:Kl(t.outputShape);p.texShape=x.map(b=>b*2)}if(t.outTexUsage!=null&&(p.usage=t.outTexUsage),y.sizeFromShape(i.shape)===0)return p.values=y.getTypedArrayFromDType(i.dtype,0),i;let u=[],c=e.map(x=>{if(x.dtype===\"complex64\")throw new Error(\"GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.\");let b=this.texData.get(x.dataId);if(b.texture==null){if(!t.packedInputs&&y.sizeFromShape(x.shape)<=A().getNumber(\"WEBGL_SIZE_UPLOAD_UNIFORM\"))return{shape:x.shape,texData:null,isUniform:!0,uniformValues:b.values};t.packedInputs&&(b.isPacked=!0,b.shape=x.shape)}if(this.uploadToGPU(x.dataId),!!b.isPacked!=!!t.packedInputs)x=b.isPacked?this.unpackTensor(x):this.packTensor(x),u.push(x),b=this.texData.get(x.dataId);else if(b.isPacked&&!hu(b.shape,x.shape)){let C=x,S=x.shape;x.shape=b.shape,x=this.packedReshape(x,S),u.push(x),b=this.texData.get(x.dataId),C.shape=S}return{shape:x.shape,texData:b,isUniform:!1}});this.uploadToGPU(i.dataId);let l={shape:i.shape,texData:p,isUniform:!1},m=RR(t,c,l),d=this.getAndSaveBinary(m,()=>$R(this.gpgpu,t,c,l)),f=this.activeTimers!=null,h;f&&(h=this.startTimer()),A().get(\"ENGINE_COMPILE_ONLY\")||ER(this.gpgpu,d,c,l,n),u.forEach(x=>this.disposeIntermediateTensorInfo(x)),f&&(h=this.endTimer(h),this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime(h)}));let g=A().getNumber(\"WEBGL_FLUSH_THRESHOLD\");if(g>0){let x=y.now();x-this.lastGlFlushTime>g&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=x)}if(!A().getBool(\"WEBGL_LAZILY_UNPACK\")&&p.isPacked&&s===!1){let x=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),x}return i}compileAndRun(t,e,o,n,s=!1){return o=o||e[0].dtype,this.runWebGLProgram(t,e,o,n,s)}getAndSaveBinary(t,e){return t in this.binaryCache||(this.binaryCache[t]=e()),this.binaryCache[t]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(A().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=De(()=>{if(!A().get(\"WEBGL_RENDER_FLOAT32_ENABLED\")){let t=A().getBool(\"DEBUG\");A().set(\"DEBUG\",!1);let e=this.abs(ke(1e-8)).dataSync()[0];if(A().set(\"DEBUG\",t),e>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?ZZ:JZ}uploadToGPU(t){let e=this.texData.get(t),{shape:o,dtype:n,values:s,texture:a,usage:i,isPacked:p}=e;if(a!=null)return;let u=this.activeTimers!=null,c;u&&(c=y.now());let l=e.texShape;if(l==null&&(l=VI(o,p),e.texShape=l),s!=null){let m=Nc(o),d,f=l[1],h=l[0],g=s instanceof Uint8Array||s instanceof Uint8ClampedArray;(p||!g)&&([f,h]=Ma(l[0],l[1])),p?d=new rh(m,g):d=new Yl(m,g);let x=g?[h,f]:l,b=this.makeTensorInfo(x,n),C=this.texData.get(b.dataId);g?C.usage=mr.PIXELS:C.usage=mr.UPLOAD,C.texShape=x,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(b.dataId),f,h,s);let S=[[h,f]],k=!0,_=this.runWebGLProgram(d,[b],n,S,k),E=this.texData.get(_.dataId);e.texShape=E.texShape,e.isPacked=E.isPacked,e.usage=E.usage,A().get(\"ENGINE_COMPILE_ONLY\")?this.disposeData(_.dataId):(e.texture=E.texture,e.values=null,this.texData.delete(_.dataId)),this.disposeIntermediateTensorInfo(b),u&&(this.uploadWaitMs+=y.now()-c)}else{let m=this.acquireTexture(l,i,n,p);e.texture=m}}convertAndCacheOnCPU(t,e){let o=this.texData.get(t),{dtype:n}=o;return e!=null&&(o.values=n9(e,n)),o.values}acquireTexture(t,e,o,n){if(this.numBytesInGPU+=this.computeBytes(t,o),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(t,e,n)}computeBytes(t,e){return t[0]*t[1]*y.bytesPerElement(e)}checkCompileCompletion(){for(let[,t]of Object.entries(this.binaryCache))this.checkCompletion_(t)}async checkCompileCompletionAsync(){let t=[];if(this.gpgpu.parallelCompilationExtension){for(let[,e]of Object.entries(this.binaryCache))t.push(this.checkCompletionAsync_(e));return Promise.all(t)}else{for(let[,e]of Object.entries(this.binaryCache)){let o=new Promise(n=>{try{this.checkCompletion_(e),n(!0)}catch(s){throw s}});t.push(o)}return Promise.all(t)}}async checkCompletionAsync_(t){return this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(t):(await pS(),this.checkCompletionAsync_(t))}checkCompletion_(t){if(this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(t.webGLProgram)),this.gpgpu.gl.getShaderParameter(t.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(Kf(t.source,this.gpgpu.gl.getShaderInfoLog(t.fragmentShader)),new Error(\"Failed to compile fragment shader.\")):new Error(\"Failed to link vertex and fragment shaders.\");return!0}getUniformLocations(){for(let t of Object.values(this.binaryCache)){this.gpgpu.buildVao(t.webGLProgram);let{variablesLocations:e,customUniformLocations:o,infLoc:n,nanLoc:s,outShapeLocation:a,outShapeStridesLocation:i,outTexShapeLocation:p}=jI(this.gpgpu,t.program,t.webGLProgram);t.variablesLocations=e,t.customUniformLocations=o,t.infLoc=n,t.nanLoc=s,t.outShapeLocation=a,t.outShapeStridesLocation=i,t.outTexShapeLocation=p}}createTensorFromGPUData(t,e,o){t.channels=t.channels||\"RGBA\";let{texture:n,height:s,width:a,channels:i}=t,p=ur().backend;if(!p.gpgpu.gl.isTexture(n))throw new Error(\"The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.\");let u=p.writeTexture(n,e,o,s,a,i);return ur().makeTensorFromDataId(u,e,o,p)}};Oc.nextDataId=0;function n9(r,t){if(t===\"float32\"||t===\"complex64\")return r;if(t===\"int32\"||t===\"bool\"){let e=t===\"int32\"?new Int32Array(r.length):new Uint8Array(r.length);for(let o=0;onew Oc,2);var Cat={forceHalfFloat:LD};var Mc=`\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n`;var Fr=class{constructor(t,e,o){this.variableNames=[\"A\",\"B\"],this.outputShape=w.assertAndGetBroadcastShape(e,o),this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${t}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}};var jr=`\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n`;var qr=class{constructor(t,e,o,n=!1){this.variableNames=[\"A\",\"B\"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=w.assertAndGetBroadcastShape(e,o);let s=this.outputShape.length;this.enableShapeUniforms=ut(s);let a=\"\";if(n)if(s===0||y.sizeFromShape(this.outputShape)===1)a=`\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n `;else if(a=`\n ${Re(s)} coords = getOutputCoords();\n `,s===1)this.enableShapeUniforms?a+=`\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `:a+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{let p=Rt(\"coords\",s);this.enableShapeUniforms?a+=`\n bool nextRowOutOfBounds =\n (${p[s-2]} + 1) >= outShape[${s} - 2];\n bool nextColOutOfBounds =\n (${p[s-1]} + 1) >= outShape[${s} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:a+=`\n bool nextRowOutOfBounds =\n (${p[s-2]} + 1) >= ${this.outputShape[s-2]};\n bool nextColOutOfBounds =\n (${p[s-1]} + 1) >= ${this.outputShape[s-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${t}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${a}\n\n setOutput(result);\n }\n `}};function Dt(r){let{inputs:t,backend:e}=r,{x:o}=t;return e.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var BD={kernelName:Co,backendName:\"webgl\",kernelFunc:Dt};function Pr(r){let{inputs:t,backend:e}=r,{real:o,imag:n}=t,s=e.makeTensorInfo(o.shape,\"complex64\"),a=e.texData.get(s.dataId),i=Dt({inputs:{x:o},backend:e}),p=Dt({inputs:{x:n},backend:e});return a.complexTensorInfos={real:i,imag:p},s}var zD={kernelName:Ri,backendName:\"webgl\",kernelFunc:Pr};var fv=\"return (a < 0.) ? b * a : a;\",hv=`\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`;function a9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{alpha:s}=o,a=e.makeTensorInfo([],\"float32\",y.createScalarValue(s,\"float32\")),i=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")?new qr(hv,n.shape,a.shape):new Fr(fv,n.shape,a.shape),p=e.runWebGLProgram(i,[n,a],\"float32\");return e.disposeIntermediateTensorInfo(a),p}var VD={kernelName:En,backendName:\"webgl\",kernelFunc:a9};var gv=\"return (a < 0.) ? b * a : a;\",xv=`\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`;function i9(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t,s=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")?new qr(xv,o.shape,n.shape):new Fr(gv,o.shape,n.shape);return e.runWebGLProgram(s,[o,n],\"float32\")}var WD={kernelName:rs,backendName:\"webgl\",kernelFunc:i9};var Fo=\"if (isnan(x)) return x;\";function xe({opSnippet:r,packedOpSnippet:t,cpuKernelImpl:e,dtype:o}){return({inputs:n,backend:s})=>{let{x:a}=n,i=s,p=o||a.dtype;if(i.shouldExecuteOnCPU([a])&&e!=null){let l=i.texData.get(a.dataId),m=e(l.values,p);return i.makeTensorInfo(a.shape,p,m)}let u=A().getBool(\"WEBGL_PACK_UNARY_OPERATIONS\")&&t!=null,c;return u?c=new Ar(a.shape,t):c=new tr(a.shape,r),i.runWebGLProgram(c,[a],p)}}function nt({opSnippet:r,packedOpSnippet:t,checkOutOfBounds:e=!1,supportsComplex:o=!1,cpuKernelImpl:n,dtype:s}){return({inputs:a,backend:i})=>{let{a:p,b:u}=a,c=i;if(o&&p.dtype===\"complex64\"){let f=c.texData.get(p.dataId),h=c.texData.get(u.dataId),[g,x]=[[f.complexTensorInfos.real,h.complexTensorInfos.real],[f.complexTensorInfos.imag,h.complexTensorInfos.imag]].map(C=>{let[S,k]=C,_={dataId:S.dataId,dtype:S.dtype,shape:p.shape},E={dataId:k.dataId,dtype:k.dtype,shape:u.shape},R=new Fr(r,p.shape,u.shape);return c.runWebGLProgram(R,[_,E],dt(S.dtype,k.dtype))}),b=Pr({inputs:{real:g,imag:x},backend:c});return c.disposeIntermediateTensorInfo(g),c.disposeIntermediateTensorInfo(x),b}let l=s||dt(p.dtype,u.dtype);if((p.dtype===\"string\"||u.dtype===\"string\"||c.shouldExecuteOnCPU([p,u]))&&n!=null){let f=c.texData.get(p.dataId).values,h=c.texData.get(u.dataId).values,g=p.dtype===\"string\"?w.fromUint8ToStringArray(f):f,x=p.dtype===\"string\"?w.fromUint8ToStringArray(h):h,[b,C]=n(p.shape,u.shape,g,x,l),S=c.makeTensorInfo(C,l),k=c.texData.get(S.dataId);return k.values=b,S}let m=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")&&t!=null,d;return m?d=new qr(t,p.shape,u.shape,e):d=new Fr(r,p.shape,u.shape),c.runWebGLProgram(d,[p,u],l)}}function xi(r,t=!1){if(r===\"linear\")return t?AD:TD;if(r===\"relu\")return t?PD:$D;if(r===\"elu\")return t?FD:_D;if(r===\"relu6\")return t?OD:ED;if(r===\"prelu\")return t?xv:gv;if(r===\"leakyrelu\")return t?hv:fv;if(r===\"sigmoid\")return t?MD:RD;throw new Error(`Activation ${r} has not been implemented for the WebGL backend.`)}var Lc=class{constructor(t,e,o,n=!1,s=!1,a=!1,i=null,p=!1,u=!1){this.variableNames=[\"matrixA\",\"matrixB\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=o,this.enableShapeUniforms=ut(this.outputShape.length);let c=n?t[1]:t[2],l=Math.ceil(c/2),m=n?\"i * 2, rc.y\":\"rc.y, i * 2\",d=s?\"rc.z, i * 2\":\"i * 2, rc.z\",f=n?[\"a.xxyy\",\"a.zzww\"]:[\"a.xxzz\",\"a.yyww\"],h=s?[\"b.xzxz\",\"b.ywyw\"]:[\"b.xyxy\",\"b.zwzw\"],g=\"\",x=\"\";i&&(p?g=`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${i}\n }`:u?g=`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${i}\n }`:g=`vec4 activation(vec4 x) {\n ${i}\n }`,x=\"result = activation(result);\");let b=a?\"result += getBiasAtOutCoords();\":\"\";a&&this.variableNames.push(\"bias\"),p&&this.variableNames.push(\"preluActivationWeights\"),u&&this.variableNames.push(\"leakyreluAlpha\");let C=\"rc.x\",S=\"rc.x\";t[0]`The new shape (${p}) has ${u} elements and the old shape (${n.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`);let c=a.texData.get(n.dataId);return c.isPacked&&!hu(n.shape,p)&&!(c.texture!==null&&hu(c.shape,p))?HD(n,p,a):(a.incRef(n.dataId),{dataId:n.dataId,shape:p,dtype:n.dtype})}var KD={kernelName:da,backendName:\"webgl\",kernelFunc:te};var em=class{constructor(t,e){this.variableNames=[\"x\"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=t;this.outputShape=[n,a];let i=Math.floor(o/4)*4,p=o%4,u=\"sumValue += dot(values, ones);\";if(e!=null){let l=1/e;u=`sumValue += dot(values * ${y.isInt(l)?l.toPrecision(2):l}, ones);`}let c=\"\";s%o>0&&(c=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${c}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${o};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${i}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${i};\n if (${p===1}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${u}\n } else if (${p===2}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${u}\n } else if (${p===3}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}};var hh=class{constructor(t,e){this.variableNames=[\"x\"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=t;this.outputShape=[n,a];let i=\"0.0\",p=\"\";e===\"prod\"?i=\"1.0\":e===\"min\"?(i=\"1.0 / 1e-20\",p=\"min\"):e===\"max\"&&(i=\"-1.0 / 1e-20\",p=\"max\");let u=`${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;e===\"sum\"?u=\"sumValue\":e===\"prod\"?u=\"prodValue\":e===\"all\"?u=\"allValue\":e===\"any\"&&(u=\"anyValue\");let c=Math.floor(o/4)*4,l=o%4,m=`\n if (${e===\"sum\"}) {\n sumValue += dot(values, ones);\n } else if (${e===\"prod\"}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${p}(values, minMaxValue);\n if (${e===\"min\"} || ${e===\"max\"}) {\n minMaxValue = ${p}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,d=\"vec4\";e===\"all\"?(i=\"1.0\",m=`\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n `,d=\"bvec4\"):e===\"any\"&&(i=\"0.0\",m=`\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n `,d=\"bvec4\");let f=\"\";s%o>0&&(f=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${i};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${f}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${o};\n\n vec4 minMaxValue = vec4(${i});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${c}; i += 4) {\n int inIdx = inOffset + i;\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${m}\n }\n\n int inIdx = inOffset + ${c};\n if (${l===1}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${m}\n } else if (${l===2}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${m}\n } else if (${l===3}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${m}\n }\n setOutput(${u});\n }\n `}};function p9(r){let t=[];for(;t.length===0||t[t.length-1].outSize!==1;){let e=t.length?t[t.length-1].outSize:r[1],o=w.computeOptimalWindowSize(e);t.push({inSize:e,windowSize:o,outSize:Math.ceil(e/o)})}return t}function Xr(r,t,e,o){let n=p9(r.shape),s=r;for(let a=0;a6)throw Error(`Transpose for rank ${t} is not yet supported`);let e=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\",\"resRC.v\"],o=new Array(t);for(let n=0;n6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let n=Re(this.rank),s=mv(\"rc\",this.rank),a=new Array(this.rank);for(let c=0;c`Error in matMul: inner shapes (${l}) and (${m}) of Tensors with shapes ${r.shape} and ${t.shape} and transposeA=${e} and transposeB=${o} must match.`);let k=e?[x,l,d]:[x,d,l],_=o?[b,f,m]:[b,m,f],E=te({inputs:{x:r},backend:n,attrs:{shape:k}}),R=te({inputs:{x:t},backend:n,attrs:{shape:_}}),D=[E,R],P=Math.max(x,b),O=e?E.shape[1]:E.shape[2],M=s!=null,L=a!=null,B=p===\"leakyrelu\",z=p!=null?xi(p,!0):null,U=M||L||B||z!=null,j;if((d===1||f===1)&&O>bv&&U===!1){let Y=E,J=R;e&&(Y=bt({inputs:{x:E},backend:n,attrs:{perm:[0,2,1]}}),D.push(Y)),o&&(J=bt({inputs:{x:R},backend:n,attrs:{perm:[0,2,1]}}),D.push(J));let re=f!==1,ne=f===1,ee=Y;re&&(ee=te({inputs:{x:Y},backend:n,attrs:{shape:[P,O,1]}}),D.push(ee));let oe=f===1?2:1,ie=J;ne&&(ie=te({inputs:{x:J},backend:n,attrs:{shape:[P,1,O]}}),D.push(ie));let le=Jl({inputs:{a:ee,b:ie},backend:n});j=bp({inputs:{x:le},backend:n,attrs:{axis:oe,keepDims:!0}}),D.push(le)}else{let Y=dt(r.dtype,t.dtype),J=new Lc(k,_,[P,d,f],e,o,M,z,L,B),re=[E,R];if(s!=null&&re.push(s),L&&re.push(a),B){let ne=n.makeTensorInfo([],\"float32\",y.createScalarValue(i,\"float32\"));re.push(ne),D.push(ne)}j=n.runWebGLProgram(J,re,Y)}let q=te({inputs:{x:j},backend:n,attrs:{shape:S}});D.push(j);for(let Y of D)n.disposeIntermediateTensorInfo(Y);return q}function l9(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=t,{transposeA:p,transposeB:u,activation:c,leakyreluAlpha:l}=o;return Cp({a:n,b:s,transposeA:p,transposeB:u,backend:e,bias:a,preluActivationWeights:i,leakyreluAlpha:l,activation:c})}var YD={kernelName:So,backendName:\"webgl\",kernelFunc:l9};var QD=\"return abs(x);\";function m9(r){let{inputs:t,backend:e}=r,{x:o}=t;if(e.shouldExecuteOnCPU([o])&&o.dtype!==\"complex64\"){let s=e.texData.get(o.dataId),a=ph(s.values);return e.makeTensorInfo(o.shape,o.dtype,a)}let n;return A().getBool(\"WEBGL_PACK_UNARY_OPERATIONS\")?n=new Ar(o.shape,QD):n=new tr(o.shape,QD),e.runWebGLProgram(n,[o],o.dtype)}var ZD={kernelName:Xs,backendName:\"webgl\",kernelFunc:m9};var d9=Wt+`\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n`,f9=xe({opSnippet:d9}),JD={kernelName:Vo,backendName:\"webgl\",kernelFunc:f9};var h9=Wt+`\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));`,g9=xe({opSnippet:h9}),eA={kernelName:Wo,backendName:\"webgl\",kernelFunc:g9};var tA=\"return a + b;\",x9=nt({opSnippet:tA,packedOpSnippet:tA,supportsComplex:!0,cpuKernelImpl:DR}),rA={kernelName:io,backendName:\"webgl\",kernelFunc:x9};var yh=class{constructor(t,e){this.outputShape=[],this.outputShape=t,this.variableNames=e.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`float v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(\" + \");this.userCode=`\n void main() {\n ${o.join(`\n `)}\n\n float result = ${n};\n setOutput(result);\n }\n `}};var bh=class{constructor(t,e){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.variableNames=e.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`vec4 v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(\" + \");this.userCode=`\n void main() {\n ${o.join(`\n `)}\n\n vec4 result = ${n};\n setOutput(result);\n }\n `}};function Ch(r){let{inputs:t,backend:e}=r,o=t;if(o.length===1)return Dt({inputs:{x:o[0]},backend:e});if(o.length>A().getNumber(\"WEBGL_MAX_TEXTURES_IN_SHADER\")){let p=Math.floor(o.length/2),u=Ch({inputs:o.slice(0,p),backend:e}),c=Ch({inputs:o.slice(p),backend:e});return Ch({inputs:[u,c],backend:e})}let n=o.map(p=>p.dtype).reduce((p,u)=>dt(p,u)),s=o.map(p=>p.shape),i=A().getBool(\"WEBGL_PACK\")?new bh(o[0].shape,s):new yh(o[0].shape,s);return e.runWebGLProgram(i,o,n)}var oA={kernelName:Uo,backendName:\"webgl\",kernelFunc:Ch};function y9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,c=w.getAxesPermutation(u,i),l=n;c!=null&&(l=bt({inputs:{x:n},backend:e,attrs:{perm:c}}),u=w.getInnerMostAxes(u.length,i)),w.assertAxesAreInnerMostDims(\"all\",u,i);let[m,d]=w.computeOutAndReduceShapes(l.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:l},backend:e,attrs:{shape:[-1,f]}}),g=Xr(h,h.dtype,\"all\",e),x;if(a){let b=w.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:e,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:e,attrs:{shape:m}});return e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(g),c!=null&&e.disposeIntermediateTensorInfo(l),x}var nA={kernelName:Go,backendName:\"webgl\",kernelFunc:y9};function b9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,c=w.getAxesPermutation(u,i),l=n;c!=null&&(l=bt({inputs:{x:n},backend:e,attrs:{perm:c}}),u=w.getInnerMostAxes(u.length,i)),w.assertAxesAreInnerMostDims(\"any\",u,i);let[m,d]=w.computeOutAndReduceShapes(l.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:l},backend:e,attrs:{shape:[-1,f]}}),g=Xr(h,h.dtype,\"any\",e),x;if(a){let b=w.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:e,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:e,attrs:{shape:m}});return e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(g),c!=null&&e.disposeIntermediateTensorInfo(l),x}var sA={kernelName:Ho,backendName:\"webgl\",kernelFunc:b9};var wh=class{constructor(t,e,o){this.variableNames=[\"A\"];let{windowSize:n,batchSize:s,outSize:a}=t;o||this.variableNames.push(\"bestIndicesA\"),this.outputShape=[s,a];let i=e===\"max\"?\">\":\"<\",p=o?\"inOffset + i;\":\"round(getBestIndicesA(batch, inOffset + i));\";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${n}; i++) {\n int inIdx = ${p};\n float candidate = getA(batch, inIdx);\n if (candidate ${i} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}};var Sh=class{constructor(t,e,o,n){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,y.assert(t.length>2,()=>`Packed arg${o.charAt(0).toUpperCase()+o.slice(1)} supports only inputs with rank above 2.`);let s=t[t.length-1],a=Math.ceil(s/e);this.outputShape=t.slice(0,-1),a>1&&this.outputShape.push(a),n||this.variableNames.push(\"bestIndicesA\");let i=this.outputShape,p=i.length,u=Re(p),c=Rt(\"coords\",p),l,m;if(a===1){m=p+1;let R=Re(m);l=`\n ${R} sourceLocR = ${R}(${c.join()}, 0);\n ++${c[p-1]};\n ${R} sourceLocG = ${R}(${c.join()}, 0);\n ++${c[p-2]};\n ${R} sourceLocA = ${R}(${c.join()}, 0);\n --${c[p-1]};\n ${R} sourceLocB = ${R}(${c.join()}, 0);\n --${c[p-2]};`}else m=p,l=`\n ${u} sourceLocR = coords;\n ++${c[p-1]};\n ${u} sourceLocG = coords;\n ++${c[p-2]};\n ${u} sourceLocA = coords;\n --${c[p-1]};\n ${u} sourceLocB = coords;\n --${c[p-2]};`;let d=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"].slice(0,m),f=\".\"+d[m-1],h=d.map(R=>\"int \"+R),g=Rt(\"sourceLocR\",m-1).concat(\"inIdx.r\"),x=Rt(\"sourceLocG\",m-1).concat(\"inIdx.g\"),b=Rt(\"sourceLocB\",m-1).concat(\"inIdx.b\"),C=Rt(\"sourceLocA\",m-1).concat(\"inIdx.a\"),S=o===\"max\"?\"greaterThan\":\"lessThan\",k=n?\"\":`\n inIdx = round(vec4(getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${x.join()}),\n getBestIndicesAChannel(${b.join()}),\n getBestIndicesAChannel(${C.join()})));`,_=`vec4(\n getAChannel(${g.join()}),\n hasNextCol ? getAChannel(${x.join()}) : 0.,\n hasNextRow ? getAChannel(${b.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${C.join()}) : 0.)`,E=n?\"\":`\n float getBestIndicesAChannel(${h.join()}) {\n return getChannel(getBestIndicesA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${h.join()}) {\n return getChannel(getA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }\n ${E}\n void main() {\n ${u} coords = getOutputCoords();\n bool hasNextCol = ${c[p-1]} < ${i[p-1]-1};\n bool hasNextRow = ${c[p-2]} < ${i[p-2]-1};\n ${l}\n ivec4 srcIdx = ivec4(sourceLocR${f}, sourceLocG${f},\n sourceLocB${f}, sourceLocA${f}) * ${e};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${_};\n\n for (int i = 0; i < ${e}; i++) {\n inIdx = srcIdx;\n ${k}\n vec4 candidate = ${_};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${S}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}};function aA(r,t,e,o=null){let n=t.shape[0],s=t.shape[1];o!=null&&(n=o.shape[0],s=o.shape[1]);let a=w.computeOptimalWindowSize(s),i={windowSize:a,inSize:s,batchSize:n,outSize:Math.ceil(s/a)},p=new wh(i,e,o==null),u=[t];o!=null&&u.push(o);let c=r.runWebGLProgram(p,u,\"int32\");if(c.shape[1]===1)return c;let l=aA(r,t,e,c);return r.disposeIntermediateTensorInfo(c),l}function iA(r,t,e,o=null){let n=o!=null?o.shape:t.shape,s=n[n.length-1],a=w.computeOptimalWindowSize(s),i=new Sh(n,a,e,o==null),p=o==null?[t]:[t,o],u=r.runWebGLProgram(i,p,\"int32\");if(u.shape.length===t.shape.length){let c=iA(r,t,e,u);return r.disposeIntermediateTensorInfo(u),c}return u}function Ih(r,t,e,o){let n=[e];if(w.assertAxesAreInnerMostDims(\"arg\"+o.charAt(0).toUpperCase()+o.slice(1),n,t.shape.length),!A().getBool(\"WEBGL_PACK_REDUCE\")||t.shape.length<=2){let s=[],a=r.texData.get(t.dataId),i=a!==null&&a.isPacked,p=t;i&&(p=r.unpackTensor(t),s.push(p));let[u,c]=w.computeOutAndReduceShapes(p.shape,n),l=y.sizeFromShape(c),m=te({inputs:{x:p},backend:r,attrs:{shape:[-1,l]}});s.push(m);let d=aA(r,m,o);s.push(d);let f=te({inputs:{x:d},backend:r,attrs:{shape:u}});return s.forEach(h=>r.disposeIntermediateTensorInfo(h)),f}return iA(r,t,o)}function C9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=bt({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims(\"argMax\",[a[0]],p.shape.length);let c=Ih(e,p,a[0],\"max\");return u.forEach(l=>e.disposeIntermediateTensorInfo(l)),c}var uA={kernelName:Ys,backendName:\"webgl\",kernelFunc:C9};function w9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=bt({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims(\"argMin\",[a[0]],p.shape.length);let c=Ih(e,p,a[0],\"min\");return u.forEach(l=>e.disposeIntermediateTensorInfo(l)),c}var pA={kernelName:Qs,backendName:\"webgl\",kernelFunc:w9};var S9=Wt+`\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n`,I9=xe({opSnippet:S9}),cA={kernelName:Ko,backendName:\"webgl\",kernelFunc:I9};var v9=Wt+\"return log(x + sqrt(x * x + 1.0));\",k9=xe({opSnippet:v9}),lA={kernelName:qo,backendName:\"webgl\",kernelFunc:k9};var N9=Wt+`\n return atan(x);\n`,T9=xe({opSnippet:N9}),mA={kernelName:jo,backendName:\"webgl\",kernelFunc:T9};var _9=Mc+`\n return atan(a, b);\n`,$9=`\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n `+jr+`\n return result;\n`,E9=nt({opSnippet:_9,packedOpSnippet:$9}),dA={kernelName:Yo,backendName:\"webgl\",kernelFunc:E9};var R9=Wt+`\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelName:Xo,backendName:\"webgl\",kernelFunc:D9};var Us=class{constructor(t,e,o,n=!1,s=!1){if(this.variableNames=[\"x\"],e===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");let a=t.filterWidth,i=t.strideHeight,p=t.strideWidth,u=t.dilationHeight,c=t.dilationWidth,l=t.effectiveFilterHeight,m=t.effectiveFilterWidth,d=t.padInfo.top,f=t.padInfo.left;this.outputShape=t.outShape;let h=e===\"avg\",g=`((batch * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + d`,x=`(xR * ${t.inWidth} + xC) * ${t.inChannels} + d`,b=\"0.0\";if(h||(b=\"-1.0 / 1e-20\"),o){let R=\">=\";this.userCode=`\n const ivec2 strides = ivec2(${i}, ${p});\n const ivec2 pads = ivec2(${d}, ${f});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${l};\n wR += ${u}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${m};\n wC += ${c}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${R} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${n?s?g:x:`wR * ${m} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `;return}let C=\"max\",S=`${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;e===\"avg\"&&(S=\"avgValue / max(count, 1.0)\");let k=Math.floor(a/4)*4,_=a%4,E=`\n if (${h}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ${C}(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${i}, ${p});\n const ivec2 pads = ivec2(${d}, ${f});\n const float initializationValue = ${b};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${t.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${b});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${l};\n wR += ${u}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${k}; wC += 4) {\n int xC = xCCorner + wC * ${c};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n getValue(batch, xR, xC + 2 * ${c}, d),\n getValue(batch, xR, xC + 3 * ${c}, d)\n );\n\n ${E}\n }\n\n int xC = xCCorner + ${k};\n if (${_===1}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${_===2}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${_===3}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${c}, d),\n getValue(batch, xR, xC + 2 * ${c}, d),\n initializationValue\n );\n\n ${E}\n }\n }\n setOutput(${S});\n }\n `}},xu=class{constructor(t,e,o,n=!1,s=!1){if(this.variableNames=[\"x\"],e===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");let a=t.filterWidth,i=t.strideDepth,p=t.strideHeight,u=t.strideWidth,c=t.dilationDepth,l=t.dilationHeight,m=t.dilationWidth,d=t.effectiveFilterDepth,f=t.effectiveFilterHeight,h=t.effectiveFilterWidth,g=t.padInfo.front,x=t.padInfo.top,b=t.padInfo.left;this.outputShape=t.outShape;let C=e===\"avg\",S=\"0.0\";if(C||(S=\"-1.0 / 1e-20\"),o){let P=\">=\";this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${p}, ${u});\n const ivec3 pads = ivec3(${g}, ${x}, ${b});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${d};\n wD += ${c}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${t.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${f};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h};\n wC += ${m}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${P} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${n?s?`(((batch * ${t.inDepth} + xD) * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + ch`:`((xD * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + ch`:`wD * ${f} * ${h} +\n wR * ${h} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `;return}let k=\"max\",_=`${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;e===\"avg\"&&(_=\"avgValue / max(count, 1.0)\");let E=Math.floor(a/4)*4,R=a%4,D=`\n if (${C}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ${k}(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${p}, ${u});\n const ivec3 pads = ivec3(${g}, ${x}, ${b});\n const float initializationValue = ${S};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${t.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${S});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${d};\n wD += ${c}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${t.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${f};\n wR += ${l}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${E}; wC += 4) {\n int xC = xCCorner + wC * ${m};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${m}, ch),\n getValue(batch, xD, xR, xC + 2 * ${m}, ch),\n getValue(batch, xD, xR, xC + 3 * ${m}, ch)\n );\n\n ${D}\n }\n\n int xC = xCCorner + ${E};\n if (${R===1}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${D}\n } else if (${R===2}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${m}, ch),\n initializationValue,\n initializationValue\n );\n\n ${D}\n } else if (${R===3}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${m}, ch),\n getValue(batch, xD, xR, xC + 2 * ${m}, ch),\n initializationValue\n );\n\n ${D}\n }\n }\n }\n setOutput(${_});\n }\n `}};function A9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t;Vs(n,\"avgPool\");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(w.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p);if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))return Dt({inputs:{x:n},backend:e});let l=new Us(c,\"avg\",!1);return e.runWebGLProgram(l,[n],\"float32\")}var hA={kernelName:Qo,backendName:\"webgl\",kernelFunc:A9};function F9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,p,u),m=new xu(l,\"avg\",!1);return e.runWebGLProgram(m,[n],\"float32\")}var gA={kernelName:Zs,backendName:\"webgl\",kernelFunc:F9};var vh=class{constructor(t){this.variableNames=[\"dy\"],this.outputShape=t.inShape;let e=t.filterHeight,o=t.filterWidth,n=t.strideHeight,s=t.strideWidth,a=t.dilationHeight,i=t.dilationWidth,p=t.effectiveFilterHeight,u=t.effectiveFilterWidth,c=p-1-t.padInfo.top,l=u-1-t.padInfo.left,m=1/(e*o);this.userCode=`\n const ivec2 pads = ivec2(${c}, ${l});\n const float avgMultiplier = float(${m});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${p};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC+= ${i}) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}},kh=class{constructor(t){this.variableNames=[\"dy\"],this.outputShape=t.inShape;let e=t.filterDepth,o=t.filterHeight,n=t.filterWidth,s=t.strideDepth,a=t.strideHeight,i=t.strideWidth,p=t.dilationDepth,u=t.dilationHeight,c=t.dilationWidth,l=t.effectiveFilterDepth,m=t.effectiveFilterHeight,d=t.effectiveFilterWidth,f=l-1-t.padInfo.front,h=m-1-t.padInfo.top,g=d-1-t.padInfo.left,x=1/(e*o*n);this.userCode=`\n const ivec3 pads = ivec3(${f}, ${h}, ${g});\n const float avgMultiplier = float(${x});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${l};\n wD += ${p}) {\n float dyD = float(dyDCorner + wD) / ${s}.0;\n\n if (dyD < 0.0 || dyD >= ${t.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${m};\n wR += ${u}) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${d};\n wC += ${c}) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function P9(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=[1,1,1],m=w.computePool3DInfo(a.shape,i,p,l,u,c),d=new kh(m);return e.runWebGLProgram(d,[n],a.dtype)}var xA={kernelName:Ei,backendName:\"webgl\",kernelFunc:P9};function O9(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s;Vs([n,s],\"avgPoolGrad\");let{filterSize:i,strides:p,pad:u}=o,c=w.computePool2DInfo(a.shape,i,p,1,u),l=new vh(c);return e.runWebGLProgram(l,[n],a.dtype)}var yA={kernelName:$i,backendName:\"webgl\",kernelFunc:O9};function M9(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;return Cp({a:n,b:s,transposeA:a,transposeB:i,backend:e})}var bA={kernelName:Zo,backendName:\"webgl\",kernelFunc:M9};var Nh=class{constructor(t,e,o,n,s,a){this.outputShape=[],this.variableNames=[\"x\",\"mean\",\"variance\"],w.assertAndGetBroadcastShape(t,e),w.assertAndGetBroadcastShape(t,o);let i=\"0.0\";n!=null&&(w.assertAndGetBroadcastShape(t,n),this.variableNames.push(\"offset\"),i=\"getOffsetAtOutCoords()\");let p=\"1.0\";s!=null&&(w.assertAndGetBroadcastShape(t,s),this.variableNames.push(\"scale\"),p=\"getScaleAtOutCoords()\"),this.outputShape=t,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${i};\n float scale = ${p};\n float inv = scale * inversesqrt(variance + float(${a}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}};var Th=class{constructor(t,e,o,n,s,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=[\"x\",\"mean\",\"variance\"],w.assertAndGetBroadcastShape(t,e),w.assertAndGetBroadcastShape(t,o);let i=\"vec4(0.0)\";n!=null&&(w.assertAndGetBroadcastShape(t,n),this.variableNames.push(\"offset\"),i=\"getOffsetAtOutCoords()\");let p=\"vec4(1.0)\";s!=null&&(w.assertAndGetBroadcastShape(t,s),this.variableNames.push(\"scale\"),p=\"getScaleAtOutCoords()\"),this.outputShape=t,this.userCode=`\n void main() {\n vec4 offset = ${i};\n vec4 scale = ${p};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${a}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}};var L9=({inputs:r,backend:t,attrs:e})=>{let{x:o,mean:n,variance:s,offset:a,scale:i}=r;y.assert(n.shape.length===s.shape.length,()=>\"Batch normalization gradient requires mean and variance to have equal ranks.\"),y.assert(a==null||n.shape.length===a.shape.length,()=>\"Batch normalization gradient requires mean and offset to have equal ranks.\"),y.assert(i==null||n.shape.length===i.shape.length,()=>\"Batch normalization gradient requires mean and scale to have equal ranks.\");let{varianceEpsilon:p}=e;p==null&&(p=.001);let u=[o,n,s],c=null;a!=null&&(c=a.shape,u.push(a));let l=null;i!=null&&(l=i.shape,u.push(i));let m=A().getBool(\"WEBGL_PACK_NORMALIZATION\")?new Th(o.shape,n.shape,s.shape,c,l,p):new Nh(o.shape,n.shape,s.shape,c,l,p);return t.runWebGLProgram(m,u,u[0].dtype)},CA={kernelName:In,backendName:\"webgl\",kernelFunc:L9};var _h=class{constructor(t){this.variableNames=[\"source\"],this.outputShape=t,this.rank=t.length;let e=Re(this.rank);this.customUniforms=[{name:\"start\",arrayIndex:this.rank,type:\"int\"}];let o=B9(this.rank),n,s=t.map((a,i)=>`sourceLoc.${Cv[i]} = start[${i}] + coords.${Cv[i]};`);n=`\n ${e} sourceLoc;\n ${e} coords = getOutputCoords();\n ${s.join(`\n`)}\n `,this.userCode=`\n void main() {\n ${n}\n setOutput(getSource(${o}));\n }\n `}},Cv=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"];function B9(r){if(r===1)return\"sourceLoc\";if(r<=6)return Cv.slice(0,r).map(t=>\"sourceLoc.\"+t).join(\",\");throw Error(`Slicing for rank ${r} is not yet supported`)}var $h=class{constructor(t){this.variableNames=[\"source\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.rank=t.length,this.customUniforms=[{name:\"start\",arrayIndex:this.rank,type:\"int\"}];let e=Re(this.rank),o=Rt(\"coords\",this.rank),n=Rt(\"sourceLoc\",this.rank),s=this.rank===1?\"sourceLoc\":`vec2(${n.slice(-2).join()})`,a=`getChannel(getSource(${n.join()}), ${s})`,i=`\n result.x = ${a};\n if (++${o[this.rank-1]} < ${t[this.rank-1]}) {\n ++${n[this.rank-1]};\n result.y = ${a};\n --${n[this.rank-1]};\n }\n `,p=this.rank===1?\"\":`\n --${o[this.rank-1]};\n if (++${o[this.rank-2]} < ${t[this.rank-2]}) {\n ++${n[this.rank-2]};\n result.z = ${a};\n if (++${o[this.rank-1]} < ${t[this.rank-1]}) {\n ++${n[this.rank-1]};\n result.w = ${a};\n }\n }\n `,u=this.rank<=4?`sourceLoc = coords +\n ${e}(${t.map((c,l)=>`start[${l}]`).join()});`:t.map((c,l)=>`${n[l]} = ${o[l]} + start[${l}];`).join(`\n`);this.userCode=`\n void main() {\n ${e} coords = getOutputCoords();\n ${e} sourceLoc;\n ${u}\n vec4 result = vec4(0.);\n ${i}\n ${p}\n setOutput(result);\n }\n `}};function z9(r,t,e,o){let n=o.texData.get(r.dataId),s=o.makeTensorInfo(e,r.dtype),a=o.texData.get(s.dataId);Object.assign(a,n),a.refCount=1,a.shape=e,a.dtype=r.dtype;let i=pt.computeFlatOffset(t,y.computeStrides(r.shape));n.slice&&(i+=n.slice.flatOffset),a.slice={flatOffset:i,origDataId:n.slice&&n.slice.origDataId||r.dataId};let p=o.dataRefCount.get(a.slice.origDataId)||1;return o.dataRefCount.set(a.slice.origDataId,p+1),s}function Gs(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,size:a}=o,[i,p]=pt.parseSliceParams(n,s,a);if(pt.assertParamsValid(n,i,p),y.sizeFromShape(p)===0)return e.makeTensorInfo(p,n.dtype,[]);if(e.shouldExecuteOnCPU([n])||n.dtype===\"string\"){let l=e.texData.get(n.dataId),m=cD(l.values,i,p,n.shape,n.dtype);return e.makeTensorInfo(p,n.dtype,m)}let{isPacked:u}=e.texData.get(n.dataId),c=pt.isSliceContinous(n.shape,i,p);if(u||!c){let l=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new $h(p):new _h(p),m=[i];return e.runWebGLProgram(l,[n],n.dtype,m)}return e.uploadToGPU(n.dataId),z9(n,i,p,e)}var wA={kernelName:ha,backendName:\"webgl\",kernelFunc:Gs};var V9=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>\"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet\");let i=s.reduce((b,C)=>b*C),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=[],f=te({inputs:{x:n},backend:e,attrs:{shape:p}}),h=bt({inputs:{x:f},backend:e,attrs:{perm:u}}),g=te({inputs:{x:h},backend:e,attrs:{shape:c}}),x=Gs({inputs:{x:g},backend:e,attrs:{begin:l,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>e.disposeIntermediateTensorInfo(b)),x},SA={kernelName:Js,backendName:\"webgl\",kernelFunc:V9};function W9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=e.readSync(n.dataId),p=e.readSync(s.dataId),u=uh(i,p,s.dtype,s.shape,a);return e.makeTensorInfo([a],s.dtype,u)}var IA={kernelName:Jo,backendName:\"webgl\",kernelFunc:W9};var U9=`\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n`,G9=`\n return float(int(a.r) & int(b.r));\n`;function H9(r){let{inputs:t,backend:e}=r,{a:o,b:n}=t,s=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\"),a=A().getNumber(\"WEBGL_VERSION\");if(e.shouldExecuteOnCPU([o,n])||a===1){let p=e.texData.get(o.dataId).values,u=e.texData.get(n.dataId).values,[c,l]=FR(o.shape,n.shape,p,u,o.dtype),m=e.makeTensorInfo(l,o.dtype),d=e.texData.get(m.dataId);return d.values=c,m}let i;return s?i=new qr(U9,o.shape,n.shape,!1):i=new Fr(G9,o.shape,n.shape),e.runWebGLProgram(i,[o,n],o.dtype)}var vA={kernelName:qa,backendName:\"webgl\",kernelFunc:H9};function K9(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t,s=e.readSync(o.dataId),a=e.readSync(n.dataId),i=w.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return e.makeTensorInfo([i.length],\"int32\",Int32Array.from(i))}var kA={kernelName:ea,backendName:\"webgl\",kernelFunc:K9};var q9=\"return float(a != b);\",wv=nt({opSnippet:q9,cpuKernelImpl:tD,dtype:\"bool\"}),NA={kernelName:Yn,backendName:\"webgl\",kernelFunc:wv};function yi(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.texData.get(o.dataId);return Dt({inputs:{x:n.complexTensorInfos.real},backend:e})}var TA={kernelName:Gi,backendName:\"webgl\",kernelFunc:yi};var j9=\"return float(int(x));\";function _A(r,t){let e=new tr(r.shape,j9),o=t.runWebGLProgram(e,[r],\"int32\");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function Sv(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dtype:s}=o;if(s===\"complex64\"){if(n.dtype===\"complex64\")return Dt({inputs:{x:n},backend:e});let a=Ur(n.shape),i=Sv({inputs:{x:n},backend:e,attrs:{dtype:\"float32\"}}),p=Pr({inputs:{real:i,imag:a},backend:e});return a.dispose(),e.disposeIntermediateTensorInfo(i),p}if(n.dtype===\"complex64\"){let a=yi({inputs:{input:n},backend:e}),i=Sv({inputs:{x:a},backend:e,attrs:{dtype:s}});return e.disposeIntermediateTensorInfo(a),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=Dt({inputs:{x:n},backend:e});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(e.shouldExecuteOnCPU([n])){let a=e.texData.get(n.dataId).values,[i,p,u]=PR(a,n.shape,n.dtype,s);return e.makeTensorInfo(i,p,u)}if(s===\"int32\")return _A(n,e);if(s===\"bool\"){let a=e.makeTensorInfo([],\"bool\",y.getTypedArrayFromDType(\"bool\",1)),p=wv({inputs:{a:n,b:a},backend:e});return e.disposeIntermediateTensorInfo(a),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var $A={kernelName:yo,backendName:\"webgl\",kernelFunc:Sv};var EA=\"return ceil(x);\",X9=xe({opSnippet:EA,packedOpSnippet:EA,cpuKernelImpl:OR}),RA={kernelName:en,backendName:\"webgl\",kernelFunc:X9};var Eh=class{constructor(t){this.variableNames=[\"A\"],this.customUniforms=[{name:\"minVal\",type:\"float\"},{name:\"maxVal\",type:\"float\"}],this.outputShape=t,this.userCode=`\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n `}};var Rh=class{constructor(t){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"minVal\",type:\"float\"},{name:\"maxVal\",type:\"float\"}],this.outputShape=t,this.userCode=`\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n `}};function Y9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{clipValueMin:s,clipValueMax:a}=o,i;A().getBool(\"WEBGL_PACK_CLIP\")?i=new Rh(n.shape):i=new Eh(n.shape);let p=[[s],[a]];return e.runWebGLProgram(i,[n],n.dtype,p)}var DA={kernelName:bo,backendName:\"webgl\",kernelFunc:Y9};var Dh=class{constructor(t){this.variableNames=[\"real\",\"imag\"],this.outputShape=t,this.userCode=`\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n `}};function AA(r,t){return{dataId:t.dataId,dtype:t.dtype,shape:r.shape}}function Q9(r){let{inputs:t,backend:e}=r,{x:o}=t,n=e.texData.get(o.dataId),s=new Dh(o.shape),a=[AA(o,n.complexTensorInfos.real),AA(o,n.complexTensorInfos.imag)];return e.runWebGLProgram(s,a,a[0].dtype)}var FA={kernelName:Di,backendName:\"webgl\",kernelFunc:Q9};var Ah=class{constructor(t){this.outputShape=[],this.outputShape=w.computeOutShape(t,1),this.variableNames=t.map((a,i)=>`T${i}`);let e=new Array(t.length-1);e[0]=t[0][1];for(let a=1;a`T${g}`);let p=new Array(t.length-1);p[0]=t[0][e];for(let h=1;h= ${p[h-1]}) {\n return getChannel(\n getT${h}(${Fh(i,u,g)}),\n vec2(${Fh(c,u,g)}));\n }`}let d=p.length,f=p[p.length-1];m+=`\n return getChannel(\n getT${d}(${Fh(i,u,f)}),\n vec2(${Fh(c,u,f)}));`,this.userCode=`\n float getValue(${i.map(h=>\"int \"+h)}) {\n ${m}\n }\n\n void main() {\n ${s} coords = getOutputCoords();\n vec4 result = vec4(getValue(${a}), 0., 0., 0.);\n\n ${a[n-1]} = ${a[n-1]} + 1;\n if (${a[n-1]} < ${o[n-1]}) {\n result.g = getValue(${a});\n }\n\n ${a[n-2]} = ${a[n-2]} + 1;\n if (${a[n-2]} < ${o[n-2]}) {\n result.a = getValue(${a});\n }\n\n ${a[n-1]} = ${a[n-1]} - 1;\n if (${a[n-2]} < ${o[n-2]} &&\n ${a[n-1]} < ${o[n-1]}) {\n result.b = getValue(${a});\n }\n setOutput(result);\n }\n `}};function Fh(r,t,e){let o=r.indexOf(t);return r.map((s,a)=>a===o?`${s} - ${e}`:s).join()}function wp(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.texData.get(o.dataId);return Dt({inputs:{x:n.complexTensorInfos.imag},backend:e})}var PA={kernelName:Vi,backendName:\"webgl\",kernelFunc:wp};function Bc(r,t,e){let o=r[0].dtype;if(o===\"complex64\"){let d=r.map(b=>yi({inputs:{input:b},backend:e})),f=r.map(b=>wp({inputs:{input:b},backend:e})),h=Bc(d,t,e),g=Bc(f,t,e),x=Pr({inputs:{real:h,imag:g},backend:e});return d.forEach(b=>e.disposeIntermediateTensorInfo(b)),f.forEach(b=>e.disposeIntermediateTensorInfo(b)),e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(g),x}let n=e.shouldExecuteOnCPU(r);if(o===\"string\"&&(n=!0),n){let d=r.map(S=>{let _=[-1,y.sizeFromShape(S.shape.slice(t))];return te({inputs:{x:S},backend:e,attrs:{shape:_}})}),f=d.map(S=>({vals:e.readSync(S.dataId),shape:S.shape})),h=w.computeOutShape(d.map(S=>S.shape),1),g=d[0].shape[0]===1,x=MR(f,h,o,g),b=w.computeOutShape(r.map(S=>S.shape),t),C=e.makeTensorInfo(b,o,x);return d.forEach(S=>e.disposeIntermediateTensorInfo(S)),C}let s=r.filter(d=>y.sizeFromShape(d.shape)>0),a=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")&&s[0].shape.length>1;if(s.length===1){let d=a?new tr(r[0].shape,La):new Ar(r[0].shape,La);return e.runWebGLProgram(d,r,o)}let i=A().getNumber(\"WEBGL_MAX_TEXTURES_IN_SHADER\");if(s.length>i){let d=[];for(let h=0;hf.shape),t);return e.runWebGLProgram(d,s,o)}let{tensors2D:p,outShape:u}=Z9(s,t,e),c=new Ah(p.map(d=>d.shape)),l=e.runWebGLProgram(c,p,o);p.forEach(d=>e.disposeIntermediateTensorInfo(d));let m=te({inputs:{x:l},attrs:{shape:u},backend:e});return e.disposeIntermediateTensorInfo(l),m}function Z9(r,t,e){let o=w.computeOutShape(r.map(s=>s.shape),t);return{tensors2D:r.map(s=>te({inputs:{x:s},attrs:{shape:[-1,y.sizeFromShape(s.shape.slice(t))]},backend:e})),outShape:o}}function Iv(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,t[0].shape)[0],a=t.map(u=>u.shape);w.assertParamsConsistent(a,s);let i=w.computeOutShape(t.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return e.makeTensorInfo(i,t[0].dtype,[]);let p=t.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?Dt({inputs:{x:p[0]},backend:e}):Bc(p,s,e)}var OA={kernelName:ta,backendName:\"webgl\",kernelFunc:Iv};var zc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.outputShape=t.outShape;let a=t.padInfo.top,i=t.padInfo.left,p=t.strideHeight,u=t.strideWidth,c=t.dilationHeight,l=t.dilationWidth,m=t.filterHeight,d=t.filterWidth,f=Math.floor(t.inChannels/4)*4,h=t.inChannels%4,g=t.dataFormat===\"channelsLast\",x=g?1:2,b=g?2:3,C=g?3:1,S=\"\",k=\"\";o&&(n?S=`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${o}\n }`:s?S=`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${o}\n }`:S=`\n float activation(float x) {\n ${o}\n }\n `,k=\"result = activation(result);\");let _=e?\"result += getBiasAtOutCoords();\":\"\";e&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),s&&this.variableNames.push(\"leakyreluAlpha\"),this.userCode=`\n ${S}\n\n const ivec2 strides = ivec2(${p}, ${u});\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${C}];\n\n ivec2 xRCCorner =\n ivec2(coords[${x}], coords[${b}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${m}; wR++) {\n int xR = xRCorner + wR * ${c};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${l};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${f}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${g}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${h===1}) {\n\n if (${g}) {\n dotProd +=\n getX(batch, xR, xC, ${f}) *\n getW(wR, wC, ${f}, d2);\n } else {\n dotProd +=\n getX(batch, ${f}, xR, xC) *\n getW(wR, wC, ${f}, d2);\n }\n\n } else if (${h===2}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${f}, d2),\n getW(wR, wC, ${f} + 1, d2)\n );\n\n if (${g}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${f}),\n getX(batch, xR, xC, ${f} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${f}, xR, xC),\n getX(batch, ${f} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${h===3}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${f}, d2),\n getW(wR, wC, ${f} + 1, d2),\n getW(wR, wC, ${f} + 2, d2)\n );\n\n if (${g}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${f}),\n getX(batch, xR, xC, ${f} + 1),\n getX(batch, xR, xC, ${f} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${f}, xR, xC),\n getX(batch, ${f} + 1, xR, xC),\n getX(batch, ${f} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${_}\n ${k}\n setOutput(result);\n }\n `}},Oh=class{constructor(t){this.variableNames=[\"x\",\"W\"],this.outputShape=t.outShape;let e=t.padInfo.front,o=t.padInfo.top,n=t.padInfo.left,s=t.strideDepth,a=t.strideHeight,i=t.strideWidth,p=t.dilationDepth,u=t.dilationHeight,c=t.dilationWidth,l=t.filterDepth,m=t.filterHeight,d=t.filterWidth,f=Math.floor(t.inChannels/4)*4,h=t.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${s}, ${a}, ${i});\n const ivec3 pads = ivec3(${e}, ${o}, ${n});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${l}; wF++) {\n int xF = xFCorner + wF * ${p};\n\n if (xF < 0 || xF >= ${t.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${m}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${f}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${h===1}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${f}) *\n getW(wF, wR, wC, ${f}, d2);\n } else if (${h===2}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${f}),\n getX(batch, xF, xR, xC, ${f} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${f}, d2),\n getW(wF, wR, wC, ${f} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${h===3}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${f}),\n getX(batch, xF, xR, xC, ${f} + 1),\n getX(batch, xF, xR, xC, ${f} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${f}, d2),\n getW(wF, wR, wC, ${f} + 1, d2),\n getW(wF, wR, wC, ${f} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}};var Vc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"pads\",type:\"ivec2\"},{name:\"strides\",type:\"ivec2\"},{name:\"dilations\",type:\"ivec2\"},{name:\"inDims\",type:\"ivec2\"}],this.outputShape=t.outShape,this.enableShapeUniforms=ut(this.outputShape.length);let a=t.padInfo.left,i=t.strideWidth,p=t.dilationWidth,u=t.filterHeight,c=t.filterWidth,l=c,m=`\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;`;for(let g=0;g=0 && xR < inDims[0]) {\n `;for(let g=0;g<(l+1)/2;g++){let x=g*2;if(m+=`\n xC = xCCorner + ${x*p};\n `,i===1){if(x= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n `,p===1&&x>0?m+=`\n xC${x} = vec4(xTexelC${x-2}.zw, xTexelC${x}.xy);\n `:m+=`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${x} = vec4(previous.zw, xTexelC${x}.xy);\n } else {\n xC${x} = vec4(0.0, 0.0, xTexelC${x}.xy);\n }\n `):m+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n\n xC${x} = xTexelC${x};\n `,x+1= 0 && xCOffset < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.0);\n }\n xTexelC${x+1}Ready = 1;\n }\n `,p>1?m+=`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${x+1} = vec4(previous.zw, xTexelC${x+1}.xy);\n } else {\n xC${x+1} = vec4(0.0, 0.0, xTexelC${x+1}.xy);\n }\n `:m+=`\n xC${x+1} = vec4(xTexelC${x}.zw, xTexelC${x+1}.xy);\n `):b===1?m+=`\n xC${x+1} = xTexelC${x};\n `:m+=`\n xCOffset = xC + ${b};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.0);\n }\n xTexelC${x+1}Ready = 1;\n }\n\n xC${x+1} = xTexelC${x+1};\n `}}else x= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.0);\n }\n xTexelC${x+1}Ready = 1;\n }\n\n xC${x} = vec4(xTexelC${x}.zw, xTexelC${x+1}.zw);\n `,x+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${x+1} = vec4(xTexelC${x+1}.xy, final.xy);\n `)):(m+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.);\n }\n xTexelC${x+1}Ready = 1;\n }\n\n xC${x} = vec4(\n xTexelC${x}.xy, xTexelC${x+1}.xy);\n `,x+1= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${i}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${s}) {\n innerDims = vec2(d1, ch);\n result[${c*2+l}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${c*2+l}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${u}\n\n ${n.output} = result;\n }\n `}};function Lh(r,t){let e=r.length;return e>=3?t?[...r.slice(0,-3),r[e-3]*r[e-2],r[e-1]]:[...r.slice(0,-3),r[e-3],r[e-2]*r[e-1]]:!t&&e===1&&r[0]>1?[r[0],1]:null}function Bh({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=r.shape,u=o.texData.get(r.dataId),c=e.inChannels,l=p[0]*p[1]*p[2],m=e.outChannels,d=e.dataFormat===\"channelsLast\",f=!1,h=!1,g,x=[];if(s!=null){let S=Lh(s.shape,d);S!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:S}}),x.push(s))}if(n!=null){let S=Lh(n.shape,d);S!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:S}}),x.push(n))}if(!((l===1||m===1)&&c>bv)&&u.isPacked&&d&&u.texture!=null&&p[2]%2!==0&&y.arraysEqual(u.shape.slice(-3),p.slice(-3))){let S=p[0]*p[1]*(p[2]+1),k={dataId:r.dataId,shape:[1,S,e.inChannels],dtype:r.dtype},_=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,y.assert(hu(u.shape,k.shape),()=>`packed reshape ${u.shape} to ${k.shape} isn't free`);let E=te({inputs:{x:t},backend:o,attrs:{shape:[1,e.inChannels,e.outChannels]}});x.push(E);let R=Cp({a:k,b:E,backend:o,transposeA:f,transposeB:h,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),D=o.texData.get(R.dataId);y.assert(D.isPacked,()=>\"batchMatMul result is expected to be packed\"),u.shape=_,D.shape=e.outShape,g=Dt({inputs:{x:R},backend:o}),g.shape=e.outShape,x.push(R)}else{let S=e.outHeight*e.outWidth,k=te({inputs:{x:r},backend:o,attrs:{shape:d?[e.batchSize,S,e.inChannels]:[e.batchSize,e.inChannels,S]}}),_=te({inputs:{x:t},backend:o,attrs:{shape:[1,e.inChannels,e.outChannels]}}),E=Cp({a:d?k:_,b:d?_:k,transposeA:!d,transposeB:h,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});g=te({inputs:{x:E},backend:o,attrs:{shape:e.outShape}}),x.push(k),x.push(_),x.push(E)}for(let S of x)o.disposeIntermediateTensorInfo(S);return g}function zh({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:c,outWidth:l,outHeight:m,dataFormat:d}=e,f=d===\"channelsLast\",h=p*u*c,g=m*l,x=[e.batchSize,h,g],b=!0,C=!1,S=[];if(s!=null){let q=Lh(s.shape,f);q!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:q}}),S.push(s))}if(n!=null){let q=Lh(n.shape,f);q!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:q}}),S.push(n))}let k=te({inputs:{x:t},backend:o,attrs:{shape:[1,h,y.sizeFromShape(t.shape)/h]}});S.push(k);let _=new Mh(x,e),E=[r.shape,[e.padInfo.top,e.padInfo.left],[e.strideHeight,e.strideWidth],[e.dilationHeight,e.dilationWidth],[e.inChannels],[e.filterWidth*e.inChannels],[e.outWidth]],R=o.runWebGLProgram(_,[r],\"float32\",E),D=te({inputs:{x:R},backend:o,attrs:{shape:x}});S.push(R),S.push(D);let P=n!=null,O=s!=null,M=i===\"leakyrelu\",L=i?xi(i,!0):null,B=new Lc(f?D.shape:k.shape,f?k.shape:D.shape,f?[e.batchSize,g,e.outChannels]:[e.batchSize,e.outChannels,g],b,C,P,L,O,M),z=f?[D,k]:[k,D];if(n&&z.push(n),O&&z.push(s),M){let q=o.makeTensorInfo([],\"float32\",y.createScalarValue(a,\"float32\"));z.push(q),S.push(q)}let U=o.runWebGLProgram(B,z,\"float32\"),j=te({inputs:{x:U},backend:o,attrs:{shape:e.outShape}});S.push(U);for(let q of S)o.disposeIntermediateTensorInfo(q);return j}function J9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,s.shape,a,u,i,c,!1,l),d;if(m.filterHeight===1&&m.filterWidth===1&&m.dilationHeight===1&&m.dilationWidth===1&&m.strideHeight===1&&m.strideWidth===1&&(m.padInfo.type===\"SAME\"||m.padInfo.type===\"VALID\"))d=Bh({x:n,filter:s,convInfo:m,backend:e});else if(m.strideWidth<=2&&l===\"channelsLast\"&&A().getBool(\"WEBGL_EXP_CONV\")){let h=new Vc(m),g=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]];d=e.runWebGLProgram(h,[n,s],\"float32\",g)}else if(A().getBool(\"WEBGL_CONV_IM2COL\"))d=zh({x:n,filter:s,convInfo:m,backend:e});else{let h=new zc(m);d=e.runWebGLProgram(h,[n,s],\"float32\")}let f=te({inputs:{x:d},backend:e,attrs:{shape:m.outShape}});return e.disposeIntermediateTensorInfo(d),f}var MA={kernelName:tn,backendName:\"webgl\",kernelFunc:J9};var Vh=class{constructor(t){this.variableNames=[\"x\",\"dy\"],this.outputShape=t.filterShape;let e=t.strideHeight,o=t.strideWidth,n=t.padInfo.top,s=t.padInfo.left,a=t.dataFormat===\"channelsLast\";this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${t.batchSize}; b++) {\n for (int yR = 0; yR < ${t.outHeight}; yR++) {\n int xR = wR + yR * ${e} - ${n};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${t.outWidth}; yC++) {\n int xC = wC + yC * ${o} - ${s};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n ${a?`float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);`:`float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);`}\n }\n }\n }\n setOutput(dotProd);\n }\n `}},Wh=class{constructor(t){this.variableNames=[\"dy\",\"W\"],this.outputShape=t.inShape;let e=t.filterHeight,o=t.filterWidth,n=t.strideHeight,s=t.strideWidth,a=t.dataFormat===\"channelsLast\",i=e-1-t.padInfo.top,p=o-1-t.padInfo.left,u=a?1:2,c=a?2:3,l=a?3:1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${l}];\n\n ivec2 dyCorner = ivec2(coords[${u}], coords[${c}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${e}; wR++) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${e} - 1 - wR;\n\n for (int wC = 0; wC < ${o}; wC++) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${o} - 1 - wC;\n\n for (int d2 = 0; d2 < ${t.outChannels}; d2++) {\n\n if (${a}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}},Uh=class{constructor(t){this.variableNames=[\"x\",\"dy\"],this.outputShape=t.filterShape;let e=t.strideDepth,o=t.strideHeight,n=t.strideWidth,s=t.padInfo.front,a=t.padInfo.top,i=t.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${t.batchSize}; b++) {\n for (int yF = 0; yF < ${t.outDepth}; yF++) {\n int xF = wF + yF * ${e} - ${s};\n\n if (xF < 0 || xF >= ${t.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${t.outHeight}; yR++) {\n int xR = wR + yR * ${o} - ${a};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${t.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${i};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}},Gh=class{constructor(t){this.variableNames=[\"dy\",\"W\"],this.outputShape=t.inShape;let e=t.filterDepth,o=t.filterHeight,n=t.filterWidth,s=t.strideDepth,a=t.strideHeight,i=t.strideWidth,p=e-1-t.padInfo.front,u=o-1-t.padInfo.top,c=n-1-t.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${p}, ${u}, ${c});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${e}; wF++) {\n float dyF = float(dyFCorner + wF) / ${s}.0;\n\n if (dyF < 0.0 || dyF >= ${t.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${e} - 1 - wF;\n\n for (int wR = 0; wR < ${o}; wR++) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${o} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${t.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function eJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:c}=o,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,c,a,1,i,u,!1,l),d=new Vh(m);return e.runWebGLProgram(d,[n,s],\"float32\")}var LA={kernelName:Ai,backendName:\"webgl\",kernelFunc:eJ};var Hh=class{constructor(t){this.variableNames=[\"dy\",\"W\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"strides\",type:\"vec2\"}],this.outputShape=t.inShape,this.enableShapeUniforms=ut(this.outputShape.length);let e=t.filterHeight,o=t.filterWidth,n=e-1-t.padInfo.top,s=o-1-t.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${n}, ${s});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${e}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${e} - 1 - wR;\n\n for (int wC = 0; wC < ${o}; wC++) {\n int wCPerm = ${o} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${t.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${t.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${t.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${t.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${t.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}};function tJ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(u),m=w.computeConv2DInfo(a,s.shape,i,1,p,c,!1,l);if(A().getBool(\"WEBGL_PACK_CONV2DTRANSPOSE\")&&l===\"channelsLast\"){let d=[[m.strideHeight,m.strideWidth]],f=new Hh(m);return e.runWebGLProgram(f,[n,s],\"float32\",d)}else{let d=new Wh(m);return e.runWebGLProgram(d,[n,s],\"float32\")}}var BA={kernelName:rn,backendName:\"webgl\",kernelFunc:tJ};function rJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeConv3DInfo(n.shape,s.shape,a,p,i),c=new Oh(u);return e.runWebGLProgram(c,[n,s],\"float32\")}var zA={kernelName:on,backendName:\"webgl\",kernelFunc:rJ};function oJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,filterShape:p}=o,u=w.computeConv3DInfo(n.shape,p,a,1,i),c=new Uh(u);return e.runWebGLProgram(c,[n,s],\"float32\")}var VA={kernelName:ja,backendName:\"webgl\",kernelFunc:oJ};function nJ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{pad:a,strides:i,inputShape:p}=o,u=w.computeConv3DInfo(p,s.shape,i,1,a),c=new Gh(u);return e.runWebGLProgram(c,[n,s],\"float32\")}var WA={kernelName:nn,backendName:\"webgl\",kernelFunc:nJ};var sJ=Fo+`\n return cos(x);\n`,aJ=`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${jr}\n return result;\n`,iJ=xe({opSnippet:sJ,packedOpSnippet:aJ}),UA={kernelName:sn,backendName:\"webgl\",kernelFunc:iJ};var uJ=`\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n`,pJ=xe({opSnippet:uJ}),GA={kernelName:an,backendName:\"webgl\",kernelFunc:pJ};var Kh=class{constructor(t,e,o,n,s){this.variableNames=[\"Image\",\"Boxes\",\"BoxInd\"],this.outputShape=[];let[a,i,p,u]=t,[c]=e,[l,m]=o;this.outputShape=[c,l,m,u];let d=n===\"bilinear\"?1:0,[f,h]=[`${i-1}.0`,`${p-1}.0`],[g,x,b]=l>1?[`${(i-1)/(l-1)}`,\"(y2-y1) * height_ratio\",`y1*${f} + float(y)*(height_scale)`]:[\"0.0\",\"0.0\",`0.5 * (y1+y2) * ${f}`],[C,S,k]=m>1?[`${(p-1)/(m-1)}`,\"(x2-x1) * width_ratio\",`x1*${h} + float(x)*(width_scale)`]:[\"0.0\",\"0.0\",`0.5 * (x1+x2) * ${h}`];this.userCode=`\n const float height_ratio = float(${g});\n const float width_ratio = float(${C});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${a}) {\n return;\n }\n\n float height_scale = ${x};\n float width_scale = ${S};\n\n float in_y = ${b};\n if( in_y < 0.0 || in_y > ${f} ) {\n setOutput(float(${s}));\n return;\n }\n float in_x = ${k};\n if( in_x < 0.0 || in_x > ${h} ) {\n setOutput(float(${s}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${d} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}};var cJ=r=>{let{inputs:t,backend:e,attrs:o}=r,{image:n,boxes:s,boxInd:a}=t,{cropSize:i,method:p,extrapolationValue:u}=o,c=new Kh(n.shape,s.shape,i,p,u);return e.runWebGLProgram(c,[n,s,a],\"float32\")},HA={kernelName:cn,backendName:\"webgl\",kernelFunc:cJ};var Sp;(function(r){r.Prod=\"*\",r.Sum=\"+\"})(Sp||(Sp={}));var tm=class{constructor(t,e,o,n){this.op=t,this.outputShape=e,this.variableNames=[\"x\"],this.customUniforms=[{name:\"index\",type:\"float\"}];let s=this.outputShape.length,a=this.op===Sp.Prod?\"1.0\":\"0.0\",i=o?a:`getX(${KA(s,\"coords\",this.op)})`,p=this.outputShape[this.outputShape.length-1],u=\"\",c=\"\";o?(u=n?`end != ${p-1}`:\"end != 0\",c=n?\"end + 1\":\"end - 1\"):(u=n?`end + pow2 < ${p}`:\"end >= pow2\",c=n?\"end + pow2\":\"end - pow2\"),this.userCode=`\n void main() {\n ${Re(s)} coords = getOutputCoords();\n int end = ${qA(s,\"coords\",this.op)};\n float val = ${i};\n int pow2 = int(pow(2.0, index));\n if (${u}) {\n int idx = ${c};\n ${qA(s,\"coords\",this.op)} = idx;\n val ${this.op}= getX(${KA(s,\"coords\",this.op)});\n }\n setOutput(val);\n }\n `}};function KA(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.x, ${t}.y`;if(r===3)return`${t}.x, ${t}.y, ${t}.z`;if(r===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function qA(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.y`;if(r===3)return`${t}.z`;if(r===4)return`${t}.w`;throw new Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function qh(r,t,e,o,n,s){let a=t.shape.length,i=w.getAxesPermutation([o],a),p=t;i!=null&&(p=bt({inputs:{x:t},backend:e,attrs:{perm:i}}));let u=w.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${o}`);let c=p.shape[u],l=Dt({inputs:{x:p},backend:e});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let d=new tm(r,p.shape,!1,s),f=[[m]],h=l;l=e.runWebGLProgram(d,[l],l.dtype,f),e.disposeIntermediateTensorInfo(h)}if(n){let m=new tm(r,p.shape,n,s),d=l;l=e.runWebGLProgram(m,[l],l.dtype),e.disposeIntermediateTensorInfo(d)}if(i!=null){let m=w.getUndoAxesPermutation(i),d=bt({inputs:{x:l},backend:e,attrs:{perm:m}});return e.disposeIntermediateTensorInfo(l),e.disposeIntermediateTensorInfo(p),d}return l}function lJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return qh(Sp.Prod,n,e,s,a,i)}var jA={kernelName:un,backendName:\"webgl\",kernelFunc:lJ};function mJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return qh(Sp.Sum,n,e,s,a,i)}var XA={kernelName:pn,backendName:\"webgl\",kernelFunc:mJ};function dJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a,binaryOutput:i}=o;if(n.shape.length===1){let p=e.readSync(n.dataId),u=e.readSync(s.dataId),c=uh(p,u,s.dtype,s.shape,a);return e.makeTensorInfo([a],s.dtype,c)}else if(n.shape.length===2){let p=e.bufferSync(n),u=e.bufferSync(s),c=AR(p,u,a,i);return e.makeTensorInfo(c.shape,s.dtype,c.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${n.shape.length}.`)}var YA={kernelName:ra,backendName:\"webgl\",kernelFunc:dJ};var jh=class{constructor(t,e,o){this.variableNames=[\"x\"],this.outputShape=[],this.outputShape=t,this.blockSize=e,this.dataFormat=o,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${e};\n int offset_h = imod(h, ${e});\n int in_w = w / ${e};\n int offset_w = imod(w, ${e});\n int offset_d = (offset_h * ${e} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}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 fJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a===\"NHWC\"?n.shape[1]:n.shape[2],u=a===\"NHWC\"?n.shape[2]:n.shape[3],c=a===\"NHWC\"?n.shape[3]:n.shape[1],l=p*s,m=u*s,d=c/(s*s),f=a===\"NHWC\"?[i,l,m,d]:[i,d,l,m],h=new jh(f,s,a);return e.runWebGLProgram(h,[n],n.dtype)}var QA={kernelName:ln,backendName:\"webgl\",kernelFunc:fJ};var Wc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.customUniforms=[{name:\"pads\",type:\"ivec2\"},{name:\"strides\",type:\"ivec2\"},{name:\"dilations\",type:\"ivec2\"},{name:\"inDims\",type:\"ivec2\"}],this.outputShape=t.outShape,this.enableShapeUniforms=ut(this.outputShape.length);let a=t.filterHeight,i=t.filterWidth,p=t.outChannels/t.inChannels,u=\"\",c=\"\";o&&(n?u=`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${o}\n }`:s?u=`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${o}\n }`:u=`\n float activation(float x) {\n ${o}\n }\n `,c=\"result = activation(result);\");let l=e?\"result += getBiasAtOutCoords();\":\"\";e&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),s&&this.variableNames.push(\"leakyreluAlpha\"),this.userCode=`\n ${u}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${p};\n int q = d2 - d1 * ${p};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${a}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${i}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${l}\n ${c}\n setOutput(result);\n }\n `}};var Uc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"pads\",type:\"ivec2\"},{name:\"strides\",type:\"ivec2\"},{name:\"dilations\",type:\"ivec2\"},{name:\"inDims\",type:\"ivec2\"}],this.outputShape=t.outShape,this.enableShapeUniforms=ut(this.outputShape.length);let a=t.outChannels/t.inChannels,i=t.padInfo.left,p=t.strideWidth,u=t.dilationWidth,c=t.filterHeight,l=t.filterWidth,m=l,d=`\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;`;for(let x=0;x=0 && xR < inDims[0]) {\n `;for(let x=0;x<(m+1)/2;x++){let b=x*2;if(d+=`\n xC = xCCorner + ${b*u};\n `,p===1){if(b= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n `,u===1&&b>0?d+=`\n xC${b} = vec4(xTexelC${b-2}.zw, xTexelC${b}.xy);\n `:d+=`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${b} = vec4(previous.zw, xTexelC${b}.xy);\n } else {\n xC${b} = vec4(0.0, 0.0, xTexelC${b}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n\n xC${b} = xTexelC${b};\n `,b+1= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.0);\n }\n xTexelC${b+1}Ready = 1;\n }\n `,u>1?d+=`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${b+1} = vec4(previous.zw, xTexelC${b+1}.xy);\n } else {\n xC${b+1} = vec4(0.0, 0.0, xTexelC${b+1}.xy);\n }\n `:d+=`\n xC${b+1} = vec4(xTexelC${b}.zw, xTexelC${b+1}.xy);\n `):C===1?d+=`\n xC${b+1} = xTexelC${b};\n `:d+=`\n xCOffset = xC + ${C};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.0);\n }\n xTexelC${b+1}Ready = 1;\n }\n\n xC${b+1} = xTexelC${b+1};\n `}}else b= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.0);\n }\n xTexelC${b+1}Ready = 1;\n }\n\n xC${b} = vec4(xTexelC${b}.zw, xTexelC${b+1}.zw);\n `,b+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${b+1} = vec4(xTexelC${b+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.);\n }\n xTexelC${b+1}Ready = 1;\n }\n\n xC${b} = vec4(\n xTexelC${b}.xy, xTexelC${b+1}.xy);\n `,b+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${c}'`);let l=w.computeConv2DInfo(n.shape,s.shape,a,c,i,u,!0),m;A().getBool(\"WEBGL_PACK_DEPTHWISECONV\")&&l.strideWidth<=2&&l.outChannels/l.inChannels===1?m=new Uc(l):m=new Wc(l);let d=[[l.padInfo.top,l.padInfo.left],[l.strideHeight,l.strideWidth],[l.dilationHeight,l.dilationWidth],[l.inHeight,l.inWidth]];return e.runWebGLProgram(m,[n,s],\"float32\",d)}var ZA={kernelName:mn,backendName:\"webgl\",kernelFunc:hJ};var Xh=class{constructor(t){this.variableNames=[\"x\",\"dy\"],this.outputShape=t.filterShape;let e=t.strideHeight,o=t.strideWidth,n=t.padInfo.top,s=t.padInfo.left,a=t.outChannels/t.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${a} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${t.batchSize}; b++) {\n for (int yR = 0; yR < ${t.outHeight}; yR++) {\n int xR = wR + yR * ${e} - ${n};\n\n if (xR < 0 || xR >= ${t.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${t.outWidth}; yC++) {\n int xC = wC + yC * ${o} - ${s};\n\n if (xC < 0 || xC >= ${t.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}},Yh=class{constructor(t){this.variableNames=[\"dy\",\"W\"],this.outputShape=t.inShape;let e=t.filterHeight,o=t.filterWidth,n=t.strideHeight,s=t.strideWidth,a=e-1-t.padInfo.top,i=o-1-t.padInfo.left,p=t.outChannels/t.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${e}; wR++) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${e} - 1 - wR;\n\n for (int wC = 0; wC < ${o}; wC++) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${o} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${p}; dm++) {\n int d2 = d1 * ${p} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function gJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:c}=o,l=w.computeConv2DInfo(n.shape,c,a,i,p,u,!0),m=new Xh(l);return e.runWebGLProgram(m,[n,s],\"float32\")}var JA={kernelName:Fi,backendName:\"webgl\",kernelFunc:gJ};function xJ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:c}=o,l=w.computeConv2DInfo(c,s.shape,a,i,p,u,!0),m=new Yh(l);return e.runWebGLProgram(m,[n,s],\"float32\")}var eF={kernelName:Pi,backendName:\"webgl\",kernelFunc:xJ};var Qh=class{constructor(t){this.variableNames=[\"X\"],this.outputShape=[t,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n `}};function yJ(r){let{inputs:t,backend:e}=r,{x:o}=t,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=te({inputs:{x:o},backend:e,attrs:{shape:[s]}}),i=new Qh(s),p=e.runWebGLProgram(i,[a],a.dtype),u=te({inputs:{x:p},backend:e,attrs:{shape:n}});return e.disposeIntermediateTensorInfo(a),e.disposeIntermediateTensorInfo(p),u}var tF={kernelName:oa,backendName:\"webgl\",kernelFunc:yJ};var Zh=class{constructor(t){this.variableNames=[\"x\",\"W\"],this.outputShape=t.outShape;let{inHeight:e,inWidth:o,padInfo:n,strideHeight:s,strideWidth:a,filterHeight:i,filterWidth:p,dilationHeight:u,dilationWidth:c}=t,{top:l,left:m}=n;this.userCode=`\n const ivec2 strides = ivec2(${s}, ${a});\n const ivec2 pads = ivec2(${l}, ${m});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${i}; h++) {\n int hIn = hBeg + h * ${u};\n\n if (hIn >= 0 && hIn < ${e}) {\n for (int w = 0; w < ${p}; w++) {\n int wIn = wBeg + w * ${c};\n\n if (wIn >= 0 && wIn < ${o}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}};function bJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeDilation2DInfo(n.shape,s.shape,a,i,\"NHWC\",p),c,l=new Zh(u);c=e.runWebGLProgram(l,[n,s],\"float32\");let m=te({inputs:{x:c},backend:e,attrs:{shape:u.outShape}});return e.disposeIntermediateTensorInfo(c),m}var rF={kernelName:dn,backendName:\"webgl\",kernelFunc:bJ};function CJ(r){let{inputs:t,backend:e,attrs:o}=r,{equation:n}=o,s=t,{allDims:a,summedDims:i,idDims:p}=w.decodeEinsumEquation(n,s.length);w.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:c}=w.getEinsumComputePath(i,p),l=c.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=bp({inputs:{x:m},backend:e,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&e.disposeIntermediateTensorInfo(h);return m}var oF={kernelName:Li,backendName:\"webgl\",kernelFunc:CJ};var wJ=\"return (x >= 0.0) ? x : (exp(x) - 1.0);\",SJ=`\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n`,IJ=xe({opSnippet:wJ,packedOpSnippet:SJ}),nF={kernelName:hn,backendName:\"webgl\",kernelFunc:IJ};var vJ=\"return (b >= 0.0) ? a : a * (b + 1.0);\",kJ=`\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n`,NJ=r=>{let{inputs:t,backend:e}=r,{dy:o,y:n}=t,s=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")?new qr(kJ,o.shape,n.shape):new Fr(vJ,o.shape,n.shape);return e.runWebGLProgram(s,[o,n],o.dtype)},sF={kernelName:Xa,backendName:\"webgl\",kernelFunc:NJ};var TJ=`\n return vec4(equal(a, b));\n`,_J=\"return float(a == b);\",$J=nt({opSnippet:_J,packedOpSnippet:TJ,dtype:\"bool\",cpuKernelImpl:LR}),aF={kernelName:xn,backendName:\"webgl\",kernelFunc:$J};var EJ=`\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n float p = ${w.ERF_P};\n float a1 = ${w.ERF_A1};\n float a2 = ${w.ERF_A2};\n float a3 = ${w.ERF_A3};\n float a4 = ${w.ERF_A4};\n float a5 = ${w.ERF_A5};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`,RJ=xe({opSnippet:EJ}),iF={kernelName:gn,backendName:\"webgl\",kernelFunc:RJ};var DJ=Fo+`\n return exp(x);\n`,AJ=`\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,vv=xe({opSnippet:DJ,packedOpSnippet:AJ,cpuKernelImpl:BR,dtype:\"float32\"}),uF={kernelName:yn,backendName:\"webgl\",kernelFunc:vv};function Jh(r){let{inputs:t,attrs:e,backend:o}=r,{dim:n}=e,{input:s}=t,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),te({inputs:{x:s},backend:o,attrs:{shape:i}})}var pF={kernelName:na,backendName:\"webgl\",kernelFunc:Jh};var cF=\"return exp(x) - 1.0;\",FJ=xe({opSnippet:cF,packedOpSnippet:cF,cpuKernelImpl:zR}),lF={kernelName:bn,backendName:\"webgl\",kernelFunc:FJ};var rm=class{constructor(t,e,o){this.variableNames=[\"real\",\"imag\"];let n=e[1];this.outputShape=e;let s=o?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,a=o?`${n}.0`:\"1.0\",i;if(t===\"real\")i=\"return real * expR - imag * expI;\";else if(t===\"imag\")i=\"return real * expI + imag * expR;\";else throw new Error(`FFT component must be either \"real\" or \"imag\", got ${t}.`);this.userCode=`\n const float exponentMultiplier = ${s};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${i}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${n});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${n}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${a};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}};function eg(r,t,e){let o=e.texData.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=te({inputs:{x:r},backend:e,attrs:{shape:[a,s]}}),p=i.shape,u=new rm(\"real\",p,t),c=new rm(\"imag\",p,t),l=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:p},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:p}],m=e.runWebGLProgram(u,l,\"float32\"),d=e.runWebGLProgram(c,l,\"float32\"),f=Pr({inputs:{real:m,imag:d},backend:e});e.disposeIntermediateTensorInfo(m),e.disposeIntermediateTensorInfo(d);let h=te({inputs:{x:f},backend:e,attrs:{shape:r.shape}});return e.disposeIntermediateTensorInfo(i),e.disposeIntermediateTensorInfo(f),h}function PJ(r){let{inputs:t,backend:e}=r,{input:o}=t;return eg(o,!1,e)}var mF={kernelName:Bi,backendName:\"webgl\",kernelFunc:PJ};var tg=class{constructor(t,e){this.outputShape=[],this.customUniforms=[{name:\"value\",type:\"float\"}],this.variableNames=[\"x\"],this.outputShape=t,this.userCode=`\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n `}};function bi(r){let{backend:t,attrs:e}=r,{shape:o,value:n}=e,{dtype:s}=e;if(s=s||y.inferDtype(n),s===\"string\"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),t.makeTensorInfo(o,s,a)}else{let a=new tg(o,n),i=[[n]];return t.runWebGLProgram(a,[],s,i)}}var dF={kernelName:sa,backendName:\"webgl\",kernelFunc:bi};var rg=class{constructor(t){this.variableNames=[\"Image\"],this.outputShape=[];let e=t[2];this.outputShape=t,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${e} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${e}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}};var fF={kernelName:Cn,backendName:\"webgl\",kernelFunc:({inputs:r,backend:t})=>{let{image:e}=r,o=t,n=new rg(e.shape);return o.runWebGLProgram(n,[e],e.dtype)}};var hF=\"return floor(x);\",OJ=xe({opSnippet:hF,packedOpSnippet:hF,cpuKernelImpl:VR}),gF={kernelName:wn,backendName:\"webgl\",kernelFunc:OJ};var MJ=`\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n`,LJ=`\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n`,BJ=nt({opSnippet:MJ,packedOpSnippet:LJ,dtype:\"int32\"}),xF={kernelName:Sn,backendName:\"webgl\",kernelFunc:BJ};var og=class{constructor(t){this.variableNames=[\"A\"];let e=It(),[o,n]=t;this.outputShape=t,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${o}.0);\n\n vec4 values = ${e.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}};var ng=class{constructor(t){this.variableNames=[\"A\"],this.packedInputs=!1,this.packedOutput=!0;let e=It(),[o,n]=t;this.outputShape=t,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${n}.0, ${o}.0);\n vec4 values = ${e.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${e.output} = result;\n }\n `}};var yF={kernelName:Eu,backendName:\"webgl\",kernelFunc:zJ},Gc,kv=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");function zJ(r){let{inputs:t,backend:e,attrs:o}=r,{pixels:n}=t,{numChannels:s}=o,a=typeof HTMLVideoElement!=\"undefined\"&&n instanceof HTMLVideoElement,i=typeof HTMLImageElement!=\"undefined\"&&n instanceof HTMLImageElement,[p,u]=a?[n.videoWidth,n.videoHeight]:[n.width,n.height],c=[u,p],l=[u,p,s];if(i||a){let h=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");(Gc==null||h!==kv)&&(kv=h,Gc=document.createElement(\"canvas\").getContext(\"2d\",{willReadFrequently:kv})),Gc.canvas.width=p,Gc.canvas.height=u,Gc.drawImage(n,0,0,p,u),n=Gc.canvas}let m=e.makeTensorInfo(c,\"int32\");e.texData.get(m.dataId).usage=mr.PIXELS,e.gpgpu.uploadPixelDataToTexture(e.getTexture(m.dataId),n);let d=A().getBool(\"WEBGL_PACK\")?new ng(l):new og(l),f=e.runWebGLProgram(d,[m],\"int32\");return e.disposeData(m.dataId),f}function VJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dataFormat:c,dilations:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=w.convertConv2DDataFormat(c),g=w.computeConv2DInfo(n.shape,s.shape,p,l,u,m,!1,h),x,b=[],C=a!=null,S=i!=null,k=d===\"leakyrelu\",_=()=>{let R=[n,s],D=(P,O)=>{if(O===\"NCHW\"&&P.shape.length===1&&P.shape[0]!==1){let M=te({inputs:{x:P},backend:e,attrs:{shape:[P.shape[0],1,1]}});return b.push(M),M}return P};if(C&&R.push(D(a,c)),S&&R.push(D(i,c)),k){let P=e.makeTensorInfo([],\"float32\",y.createScalarValue(f,\"float32\"));R.push(P),b.push(P)}return R};if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type===\"SAME\"||g.padInfo.type===\"VALID\"))x=Bh({x:n,filter:s,convInfo:g,backend:e,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else if(g.strideWidth<=2&&h===\"channelsLast\"&&A().getBool(\"WEBGL_EXP_CONV\")){let R=d?xi(d,!0):null,D=new Vc(g,C,R,S,k),P=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],O=_();x=e.runWebGLProgram(D,O,\"float32\",P)}else if(A().getBool(\"WEBGL_CONV_IM2COL\"))x=zh({x:n,filter:s,convInfo:g,backend:e,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else{let R=d?xi(d,!1):null,D=new zc(g,C,R,S,k),P=_();x=e.runWebGLProgram(D,P,\"float32\")}let E=te({inputs:{x},backend:e,attrs:{shape:g.outShape}});return b.push(x),b.forEach(R=>e.disposeIntermediateTensorInfo(R)),E}var bF={kernelName:Io,backendName:\"webgl\",kernelFunc:VJ};function WJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dimRoundingMode:l,activation:m,leakyreluAlpha:d}=o,f=[],h=c;h==null&&(h=[1,1]),y.assert(w.eitherStridesOrDilationsAreOne(p,h),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`);let g=w.computeConv2DInfo(n.shape,s.shape,p,h,u,l,!0),x=A().getBool(\"WEBGL_PACK_DEPTHWISECONV\")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,b=m?xi(m,x):null,C=[n,s],S=a!=null,k=i!=null,_=m===\"leakyrelu\";if(S&&C.push(a),k&&C.push(i),_){let P=e.makeTensorInfo([],\"float32\",y.createScalarValue(d,\"float32\"));C.push(P),f.push(P)}let E;x?E=new Uc(g,S,b,k,_):E=new Wc(g,S,b,k,_);let R=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],D=e.runWebGLProgram(E,C,\"float32\",R);return f.forEach(P=>e.disposeIntermediateTensorInfo(P)),D}var CF={kernelName:vo,backendName:\"webgl\",kernelFunc:WJ};var sg=class{constructor(t,e,o,n){this.sliceDim=t,this.strides=e,this.paramsShape=n,this.variableNames=[\"x\",\"indices\"],this.outputShape=o;let s=Re(o.length),a=`\n int index;`;for(let i=0;i= ${this.paramsShape[i]};\n flattenIndex += index * ${this.strides[i]};`;this.userCode=`\n void main() {\n ${s} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${a}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}};function UJ(r){let{inputs:t,backend:e}=r,{params:o,indices:n}=t,s=n.shape,a=s[s.length-1],i=y.sizeFromShape(o.shape),[p,u,c,l]=w.prepareAndValidate(o,n),m=te({inputs:{x:n},backend:e,attrs:{shape:[u,a]}}),d=te({inputs:{x:o},backend:e,attrs:{shape:[y.sizeFromShape(o.shape)/c,c]}});if(e.shouldExecuteOnCPU([o,n])||o.dtype===\"string\"){let x=e.readSync(n.dataId),b=e.bufferSync(o),C=WR(x,b,o.dtype,u,a,c,l,o.shape,i);return e.makeTensorInfo(p,o.dtype,C.values)}let f=new sg(a,l,[u,c],o.shape),h=e.runWebGLProgram(f,[d,m],d.dtype),g=te({inputs:{x:h},backend:e,attrs:{shape:p}});return e.disposeIntermediateTensorInfo(m),e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(h),g}var wF={kernelName:vn,backendName:\"webgl\",kernelFunc:UJ};var ag=class{constructor(t,e){this.variableNames=[\"A\",\"indices\"],this.outputShape=e,this.rank=e.length;let o=Re(this.rank),n=GJ(t,2);this.userCode=`\n void main() {\n ${o} resRC = getOutputCoords();\n int index = int(getIndices(resRC.x, resRC.z));\n float inBounds = (index >= 0) && (index < ${t[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${n}));\n }\n `}};function GJ(r,t){let e=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],o=[];for(let n=0;n=0,()=>`GatherV2: the index value ${k} is not in [0, ${C-1}]`)}}let u=w.segment_util.collectGatherOpShapeInfo(n,s,p,i),c=y.sizeFromShape(s.shape),l=[],m=te({inputs:{x:n},backend:e,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),d=te({inputs:{x:s},backend:e,attrs:{shape:[u.batchSize,c/u.batchSize]}});l.push(m),l.push(d);let f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(e.shouldExecuteOnCPU([n,s])||n.dtype===\"string\"){let b=e.bufferSync(d),C=e.bufferSync(m),S=UR(C,b,f);return l.forEach(k=>e.disposeIntermediateTensorInfo(k)),e.makeTensorInfo(u.outputShape,S.dtype,S.values)}let h=new ag(m.shape,f),g=e.runWebGLProgram(h,[m,d],m.dtype);l.push(g);let x=te({inputs:{x:g},backend:e,attrs:{shape:u.outputShape}});return l.forEach(b=>e.disposeIntermediateTensorInfo(b)),x}var SF={kernelName:aa,backendName:\"webgl\",kernelFunc:Nv};var HJ=\"return float(a > b);\",KJ=`\n return vec4(greaterThan(a, b));\n`,qJ=nt({opSnippet:HJ,packedOpSnippet:KJ,cpuKernelImpl:GR,dtype:\"bool\"}),IF={kernelName:kn,backendName:\"webgl\",kernelFunc:qJ};var jJ=\"return float(a >= b);\",XJ=`\n return vec4(greaterThanEqual(a, b));\n`,YJ=nt({opSnippet:jJ,packedOpSnippet:XJ,dtype:\"bool\",cpuKernelImpl:HR}),vF={kernelName:Nn,backendName:\"webgl\",kernelFunc:YJ};function QJ(r){let{inputs:t,backend:e}=r,{input:o}=t;return eg(o,!0,e)}var kF={kernelName:zi,backendName:\"webgl\",kernelFunc:QJ};var ZJ=\"return float(!isnan(x) && !isinf(x));\",JJ=xe({opSnippet:ZJ,dtype:\"bool\"}),NF={kernelName:Tn,backendName:\"webgl\",kernelFunc:JJ};var eee=\"return float(isinf(x));\",tee=xe({opSnippet:eee,dtype:\"bool\"}),TF={kernelName:_n,backendName:\"webgl\",kernelFunc:tee};var ree=\"return float(isnan(x));\",oee=xe({opSnippet:ree,dtype:\"bool\"}),_F={kernelName:$n,backendName:\"webgl\",kernelFunc:oee};var nee=\"return float(a < b);\",see=`\n return vec4(lessThan(a, b));\n`,aee=nt({opSnippet:nee,packedOpSnippet:see,cpuKernelImpl:KR,dtype:\"bool\"}),$F={kernelName:Rn,backendName:\"webgl\",kernelFunc:aee};var iee=\"return float(a <= b);\",uee=`\n return vec4(lessThanEqual(a, b));\n`,pee=nt({opSnippet:iee,packedOpSnippet:uee,cpuKernelImpl:qR,dtype:\"bool\"}),EF={kernelName:Dn,backendName:\"webgl\",kernelFunc:pee};function cee(r){let{backend:t,attrs:e}=r,{start:o,stop:n,num:s}=e,a=jR(o,n,s);return t.makeTensorInfo([a.length],\"float32\",a)}var RF={kernelName:An,backendName:\"webgl\",kernelFunc:cee};var lee=Fo+`\n return x < 0.0 ? 0./0. : log(x);\n`,mee=`\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n`,dee=xe({opSnippet:lee,packedOpSnippet:mee,cpuKernelImpl:XR}),DF={kernelName:Fn,backendName:\"webgl\",kernelFunc:dee};var fee=Fo+`\n return log(1.0 + x);\n`,hee=xe({opSnippet:fee}),AF={kernelName:Pn,backendName:\"webgl\",kernelFunc:hee};var gee=\"return float(a >= 1.0 && b >= 1.0);\",xee=`\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n`,yee=nt({opSnippet:gee,packedOpSnippet:xee,dtype:\"bool\"}),FF={kernelName:On,backendName:\"webgl\",kernelFunc:yee};var bee=\"return float(!(x >= 1.0));\",Cee=xe({opSnippet:bee}),PF={kernelName:Mn,backendName:\"webgl\",kernelFunc:Cee};var wee=\"return float(a >= 1.0 || b >= 1.0);\",See=`\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n`,Iee=nt({opSnippet:wee,packedOpSnippet:See,dtype:\"bool\"}),OF={kernelName:Ln,backendName:\"webgl\",kernelFunc:Iee};var ig=class{constructor(t,e,o,n,s){this.variableNames=[\"x\"],this.outputShape=[];let a=e,i=t[3]-1;this.outputShape=t;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${a}; j <= ${a}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${i}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${p};\n setOutput(val);\n }\n `}};var ug=class{constructor(t,e,o,n,s){this.variableNames=[\"x\"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let a=e,i=t[3]-1;this.outputShape=t;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${a};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${a}; j <= ${a}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${i}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${p};\n setOutput(result);\n }\n `}};var vee=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u=A().getBool(\"WEBGL_PACK_NORMALIZATION\")?new ug(n.shape,s,a,i,p):new ig(n.shape,s,a,i,p);return e.runWebGLProgram(u,[n],n.dtype)},MF={kernelName:Bn,backendName:\"webgl\",kernelFunc:vee};var pg=class{constructor(t,e,o,n,s){this.variableNames=[\"inputImage\",\"outputImage\",\"dy\"],this.outputShape=[],this.outputShape=t,this.depth=t[3],this.depthRadius=e,this.bias=o,this.alpha=n,this.beta=s,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${e})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${e} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${n}) * norm + float(${o});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${n})\n * float(${s})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${s});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}};var kee=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n,y:s,dy:a}=t,{depthRadius:i,bias:p,alpha:u,beta:c}=o,l=new pg(n.shape,i,p,u,c);return e.runWebGLProgram(l,[n,s,a],n.dtype)},LF={kernelName:Ya,backendName:\"webgl\",kernelFunc:kee};function BF(r,t,e,o){let n=y.sizeFromShape(t),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=Xr(i,r.dtype,\"max\",o),u=te({inputs:{x:p},attrs:{shape:e},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}function Tv(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{reductionIndices:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,c=w.getAxesPermutation(u,i),l=c!=null,m=e.shouldExecuteOnCPU([n]),d=n;if(l){if(m){let C=e.texData.get(d.dataId).values,S=new Array(i);for(let E=0;E`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p);if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))return Dt({inputs:{x:n},backend:e});let l=new Us(c,\"max\",!1);return e.runWebGLProgram(l,[n],n.dtype)}var WF={kernelName:Wn,backendName:\"webgl\",kernelFunc:$ee};function Eee(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,u,p),m=new xu(l,\"max\",!1);return e.runWebGLProgram(m,[n],n.dtype)}var UF={kernelName:ia,backendName:\"webgl\",kernelFunc:Eee};var cg=class{constructor(t){this.variableNames=[\"dy\",\"maxPos\"],this.outputShape=t.inShape;let e=t.strideHeight,o=t.strideWidth,n=t.dilationHeight,s=t.effectiveFilterHeight,a=t.effectiveFilterWidth,i=s-1-t.padInfo.top,p=a-1-t.padInfo.left,u=s*a-1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${s};\n wR += ${n}) {\n float dyR = float(dyRCorner + wR) / ${e}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${a}; wC++) {\n float dyC = float(dyCCorner + wC) / ${o}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${u} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${a} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}},lg=class{constructor(t){this.variableNames=[\"dy\",\"maxPos\"],this.outputShape=t.inShape;let e=t.strideDepth,o=t.strideHeight,n=t.strideWidth,s=t.dilationDepth,a=t.dilationHeight,i=t.dilationWidth,p=t.effectiveFilterDepth,u=t.effectiveFilterHeight,c=t.effectiveFilterWidth,l=p-1-t.padInfo.front,m=u-1-t.padInfo.top,d=c-1-t.padInfo.left,f=p*u*c-1;this.userCode=`\n const ivec3 pads = ivec3(${l}, ${m}, ${d});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${p};\n wD += ${s}) {\n float dyD = float(dyDCorner + wD) / ${e}.0;\n\n if (dyD < 0.0 || dyD >= ${t.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${u};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${o}.0;\n\n if (dyR < 0.0 || dyR >= ${t.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${c};\n wC += ${i}) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${t.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${f} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${u} * ${c} +\n wR * ${c} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function Ree(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=[1,1,1],m=w.computePool3DInfo(a.shape,i,p,l,u,c),d=new xu(m,\"max\",!0),f=e.runWebGLProgram(d,[a],a.dtype),h=new lg(m),g=e.runWebGLProgram(h,[n,f],a.dtype);return e.disposeIntermediateTensorInfo(f),g}var GF={kernelName:Ui,backendName:\"webgl\",kernelFunc:Ree};function Dee(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s,output:a}=t,i=s;Vs([s,a],\"maxPoolGrad\");let{filterSize:p,strides:u,pad:c,dimRoundingMode:l}=o,m=w.computePool2DInfo(i.shape,p,u,1,c,l),d=!0,f=new Us(m,\"max\",d),h=e.runWebGLProgram(f,[i],i.dtype),g=new cg(m),x=e.runWebGLProgram(g,[n,h],i.dtype);return e.disposeIntermediateTensorInfo(h),x}var HF={kernelName:Wi,backendName:\"webgl\",kernelFunc:Dee};function KF(r,t,e,o){let n=new Us(e,\"max\",!1),s=o.runWebGLProgram(n,[r],\"float32\");n=new Us(e,\"max\",!0,!0,t);let a=o.runWebGLProgram(n,[r],\"float32\");return[s,a]}var qF={kernelName:ua,backendName:\"webgl\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=t,p=e;y.assert(o.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${o.shape.length}.`);let u=[1,1];y.assert(w.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let c=w.computePool2DInfo(o.shape,n,s,u,a),[l,m]=KF(o,i,c,p);return[l,m]}};function jF(r,t,e,o){let n=y.sizeFromShape(t),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=Xr(i,\"float32\",\"mean\",o),u=te({inputs:{x:p},attrs:{shape:e},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}var XF={kernelName:Un,backendName:\"webgl\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{keepDims:n,axis:s}=t,a=e,i=o.shape.length,p=y.parseAxisParam(s,o.shape),u=p,c=w.getAxesPermutation(u,i),l=c!=null,m=a.shouldExecuteOnCPU([o]),d=[],f=o;if(l){if(m){let S=a.texData.get(f.dataId).values,k=new Array(i);for(let R=0;Rc[0]+t[l]+c[1]);let n=t.length,s=Re(n),a=e.map(c=>c[0]).join(\",\"),i=e.map((c,l)=>c[0]+t[l]).join(\",\"),p=[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,n),u=o===\"reflect\"?0:1;if(n===1){this.userCode=`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${u};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${u};\n }\n setOutput(getX(outC - start));\n }\n `;return}this.userCode=`\n ${s} start = ${s}(${a});\n ${s} end = ${s}(${i});\n\n void main() {\n ${s} outC = getOutputCoords();\n for (int i = 0; i < ${n}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${u};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${u};\n }\n }\n ${s} coords = outC - start;\n setOutput(getX(${p}));\n }\n `}};var dg=class{constructor(t,e,o){this.variableNames=[\"x\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.map((f,h)=>f[0]+t[h]+f[1]);let n=t.length,s=Re(n),a=e.map(f=>f[0]).join(\",\"),i=e.map((f,h)=>f[0]+t[h]).join(\",\"),p=Rt(\"rc\",n),u=Rt(\"source\",n),c=`${p[n-1]} < ${this.outputShape[n-1]}`,l=n===1?\"source\":`vec2(${u.slice(-2).join()})`,m=o===\"reflect\"?0:1,d=\"\";if(n===1){let f=`\n ${s} source = rc;\n if (source < start) {\n source = start * 2 - source - ${m};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${m};\n }\n source -= start;\n `;d=`\n ${s} rc = outputLoc;\n ${f}\n result[0] = getChannel(getX(${u.join()}), ${l});\n ${p[n-1]} += 1;\n if(${c}) {\n ${f}\n result[1] = getChannel(getX(${u.join()}), ${l});\n }\n `}else{let f=`\n ${s} source = rc;\n ${s} lt = ${s}(lessThan(source, start));\n ${s} gte = ${s}(greaterThanEqual(source, end));\n ${s} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${m}) +\n gte * ((end - 1) * 2 - source + ${m});\n source -= start;\n `;d=`\n ${s} rc = outputLoc;\n ${f}\n result[0] = getChannel(getX(${u.join()}), ${l});\n ${p[n-1]} += 1;\n if(${c}) {\n ${f}\n result[1] = getChannel(getX(${u.join()}), ${l});\n }\n rc = outputLoc;\n ${p[n-2]} += 1;\n if(${p[n-2]} < ${this.outputShape[n-2]}) {\n ${f}\n result[2] = getChannel(getX(${u.join()}), ${l});\n ${p[n-1]} += 1;\n if(${c}) {\n ${f}\n result[3] = getChannel(getX(${u.join()}), ${l});\n }\n }\n `}this.userCode=`\n const ${s} start = ${s}(${a});\n const ${s} end = ${s}(${i});\n\n void main() {\n ${s} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}};var Mee=({inputs:r,backend:t,attrs:e})=>{let{x:o}=r,{paddings:n,mode:s}=e,a=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new dg(o.shape,n,s):new mg(o.shape,n,s);return t.runWebGLProgram(a,[o],o.dtype)},ZF={kernelName:Kn,backendName:\"webgl\",kernelFunc:Mee};var Lee=`if (b == 0.0) return NAN;\n return mod(a, b);`,Bee=`\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n `+jr+`\n return result;\n`,zee=nt({opSnippet:Lee,packedOpSnippet:Bee}),JF={kernelName:qn,backendName:\"webgl\",kernelFunc:zee};var fg=class{constructor(t,e,o){this.variableNames=[\"probs\"],this.customUniforms=[{name:\"seed\",type:\"float\"}],this.outputShape=[t,o],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${e-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${e-1}));\n }\n `}};var Vee=`\nif (a == b) {\n return 1.0;\n};\nreturn a / b;`,Wee=`\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n`,_v=nt({opSnippet:Vee,packedOpSnippet:Wee,checkOutOfBounds:!0}),e3={kernelName:fn,backendName:\"webgl\",kernelFunc:_v};var t3=\"return a - b;\",$v=nt({opSnippet:t3,packedOpSnippet:t3,supportsComplex:!0,cpuKernelImpl:bD}),r3={kernelName:Ts,backendName:\"webgl\",kernelFunc:$v};function Ev(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{dim:s}=o,a=y.parseAxisParam([s],n.shape),i=Tv({inputs:{x:n},backend:e,attrs:{reductionIndices:a,keepDims:!1}}),p=w.expandShapeToKeepDim(i.shape,a),u=te({inputs:{x:i},backend:e,attrs:{shape:p}}),c=$v({inputs:{a:n,b:u},backend:e}),l=vv({inputs:{x:c},backend:e}),m=bp({inputs:{x:l},backend:e,attrs:{axis:a,keepDims:!1}}),d=te({inputs:{x:m},backend:e,attrs:{shape:p}}),f=_v({inputs:{a:l,b:d},backend:e});return e.disposeIntermediateTensorInfo(i),e.disposeIntermediateTensorInfo(u),e.disposeIntermediateTensorInfo(c),e.disposeIntermediateTensorInfo(l),e.disposeIntermediateTensorInfo(m),e.disposeIntermediateTensorInfo(d),f}var o3={kernelName:Is,backendName:\"webgl\",kernelFunc:Ev};function Uee(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o,p=i?n:Ev({inputs:{logits:n},backend:e,attrs:{dim:n.shape.length-1}}),u=p.shape[0],c=p.shape[1],l=new fg(u,c,s),m=[[a]],d=e.runWebGLProgram(l,[p],\"int32\",m);return i||e.disposeIntermediateTensorInfo(p),d}var n3={kernelName:jn,backendName:\"webgl\",kernelFunc:Uee};var Gee=Wt+`\n return -x;\n`,Hee=`\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`;function Kee(r){let{inputs:t,backend:e}=r,{x:o}=t;if(e.shouldExecuteOnCPU([o])){let s=e.texData.get(o.dataId),[a,i]=eD(s.values,o.shape,o.dtype);return e.makeTensorInfo(i,o.dtype,a)}let n;return A().getBool(\"WEBGL_PACK_UNARY_OPERATIONS\")?n=new Ar(o.shape,Hee):n=new tr(o.shape,Gee),e.runWebGLProgram(n,[o],o.dtype)}var s3={kernelName:pa,backendName:\"webgl\",kernelFunc:Kee};var qee=Vt.nonMaxSuppressionV3Impl;function jee(r){w.warn(\"tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=e.readSync(n.dataId),c=e.readSync(s.dataId),{selectedIndices:l}=qee(u,c,a,i,p);return e.makeTensorInfo([l.length],\"int32\",new Int32Array(l))}var a3={kernelName:Qn,backendName:\"webgl\",kernelFunc:jee};var Xee=Vt.nonMaxSuppressionV4Impl;function Yee(r){w.warn(\"tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,padToMaxOutputSize:u}=o,c=e.readSync(n.dataId),l=e.readSync(s.dataId),{selectedIndices:m,validOutputs:d}=Xee(c,l,a,i,p,u);return[e.makeTensorInfo([m.length],\"int32\",new Int32Array(m)),e.makeTensorInfo([],\"int32\",new Int32Array([d]))]}var i3={kernelName:Qa,backendName:\"webgl\",kernelFunc:Yee};var Qee=Vt.nonMaxSuppressionV5Impl;function Zee(r){w.warn(\"tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,c=e.readSync(n.dataId),l=e.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=Qee(c,l,m,d,f,h);return[e.makeTensorInfo([g.length],\"int32\",new Int32Array(g)),e.makeTensorInfo([x.length],\"float32\",new Float32Array(x))]}var u3={kernelName:Zn,backendName:\"webgl\",kernelFunc:Zee};var hg=class{constructor(t,e,o,n){this.variableNames=[\"indices\"],this.outputShape=[t,e],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${n}), float(${o}),\n float(index == coords.y)));\n }\n `}};var Jee=r=>{let{inputs:t,backend:e,attrs:o}=r,{indices:n}=t,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),c=new hg(u,a,i,p),l=te({inputs:{x:n},backend:e,attrs:{shape:[u]}}),m=e.runWebGLProgram(c,[l],s);e.disposeIntermediateTensorInfo(l);let d=[...n.shape,a],f=te({inputs:{x:m},backend:e,attrs:{shape:d}});return e.disposeIntermediateTensorInfo(m),f},p3={kernelName:Jn,backendName:\"webgl\",kernelFunc:Jee};function om(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype===\"complex64\"){let n=yi({inputs:{input:o},backend:e}),s=om({inputs:{x:n},backend:e}),a=wp({inputs:{input:o},backend:e}),i=om({inputs:{x:a},backend:e}),p=Pr({inputs:{real:s,imag:i},backend:e});return e.disposeIntermediateTensorInfo(n),e.disposeIntermediateTensorInfo(s),e.disposeIntermediateTensorInfo(a),e.disposeIntermediateTensorInfo(i),p}else return bi({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype===\"string\"?\"\":0},backend:e})}var c3={kernelName:Sa,backendName:\"webgl\",kernelFunc:om};function l3(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype===\"string\")throw new Error(\"onesLike is not supported under string dtype\");if(o.dtype===\"complex64\"){let n=yi({inputs:{input:o},backend:e}),s=l3({inputs:{x:n},backend:e}),a=wp({inputs:{input:o},backend:e}),i=om({inputs:{x:a},backend:e}),p=Pr({inputs:{real:s,imag:i},backend:e});return e.disposeIntermediateTensorInfo(n),e.disposeIntermediateTensorInfo(s),e.disposeIntermediateTensorInfo(a),e.disposeIntermediateTensorInfo(i),p}else return bi({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:e})}var m3={kernelName:ca,backendName:\"webgl\",kernelFunc:l3};function ete(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o;if(t.length===1)return Jh({inputs:{input:t[0]},backend:e,attrs:{dim:n}});let s=t[0].shape,a=t[0].dtype;t.forEach(c=>{y.assertShapesMatch(s,c.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===c.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=t.map(c=>{let l=Jh({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=Iv({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeIntermediateTensorInfo(c)),u}var d3={kernelName:la,backendName:\"webgl\",kernelFunc:ete};var gg=class{constructor(t,e,o){this.variableNames=[\"x\"],this.customUniforms=[{name:\"value\",type:\"float\"}],this.outputShape=e.map((u,c)=>u[0]+t[c]+u[1]);let n=t.length,s=Re(n),a=e.map(u=>u[0]).join(\",\"),i=e.map((u,c)=>u[0]+t[c]).join(\",\"),p=[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,n);if(n===1){this.userCode=`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `;return}this.userCode=`\n ${s} start = ${s}(${a});\n ${s} end = ${s}(${i});\n\n void main() {\n ${s} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${s} coords = outC - start;\n setOutput(getX(${p}));\n }\n }\n `}};var xg=class{constructor(t,e,o){this.variableNames=[\"x\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"value\",type:\"float\"}],this.outputShape=e.map((h,g)=>h[0]+t[g]+h[1]);let n=t.length,s=Re(n),a=e.map(h=>h[0]).join(\",\"),i=e.map((h,g)=>h[0]+t[g]).join(\",\"),p=Rt(\"rc\",n),u=Rt(\"source\",n),c=`${p[n-1]} < ${this.outputShape[n-1]}`,l=n===1?\"source\":`vec2(${u.slice(-2).join()})`,m=[`${s} rc = outputLoc;`,`${p[n-1]} += 1;\n if(${c}) {\n `,n===1?\"\":`}\n rc = outputLoc;\n ${p[n-2]} += 1;\n if(${p[n-2]} < ${this.outputShape[n-2]}) {`,n===1?\"\":` ${p[n-1]} += 1;\n if(${c}) {`],d=n===1?\"rc < start || rc >= end\":\"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))\",f=\"\";for(let h=0,g=n===1?2:4;h{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{paddings:s,constantValue:a}=o;if(y.sizeFromShape(n.shape)===0){let u=s.map((c,l)=>c[0]+n.shape[l]+c[1]);return bi({backend:e,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new xg(n.shape,s,a):new gg(n.shape,s,a),p=[[a]];return e.runWebGLProgram(i,[n],n.dtype,p)},f3={kernelName:es,backendName:\"webgl\",kernelFunc:Rv};var tte=`\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n`,rte=`\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n `+jr+`\n return result;\n`,ote=nt({opSnippet:tte,packedOpSnippet:rte}),h3={kernelName:ts,backendName:\"webgl\",kernelFunc:ote};function nte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=n.shape.length,p=[],u=y.parseAxisParam(s,n.shape),c=u,l=w.getAxesPermutation(c,i),m=n;l!=null&&(m=bt({inputs:{x:n},backend:e,attrs:{perm:l}}),c=w.getInnerMostAxes(c.length,i),p.push(m)),w.assertAxesAreInnerMostDims(\"prod\",c,i);let d;if(e.shouldExecuteOnCPU([m])){let f=e.texData.get(m.dataId).values,{outVals:h,outShape:g,outDtype:x}=rD(m.shape,m.dtype,f,c);d=e.makeTensorInfo(g,x,h)}else{let[f,h]=w.computeOutAndReduceShapes(m.shape,c),g=y.sizeFromShape(h),x=te({inputs:{x:m},backend:e,attrs:{shape:[-1,g]}}),b=oi(n.dtype),C=Xr(x,b,\"prod\",e);d=te({inputs:{x:C},backend:e,attrs:{shape:f}}),p.push(x),p.push(C)}if(a){p.push(d);let f=w.expandShapeToKeepDim(d.shape,u);d=te({inputs:{x:d},backend:e,attrs:{shape:f}})}return p.forEach(f=>e.disposeIntermediateTensorInfo(f)),d}var g3={kernelName:os,backendName:\"webgl\",kernelFunc:nte};function ste(r){let{inputs:t,backend:e,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=t,{outputRaggedRank:i}=o,p=n.map(x=>e.readSync(x.dataId)),u=n.map(x=>x.shape),c=e.readSync(s.dataId),l=e.readSync(a.dataId),[m,d,f]=oD(p,u,c,s.shape,s.dtype,l,a.shape,i),h=m.map(x=>e.makeTensorInfo([x.length],\"int32\",x)),g=e.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var x3={kernelName:Up,backendName:\"webgl\",kernelFunc:ste};function ate(r){let{inputs:t,backend:e}=r,{starts:o,limits:n,deltas:s}=t,a=e.readSync(o.dataId),i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,c]=nD(a,o.shape,o.dtype,i,n.shape,p,s.shape),l=e.makeTensorInfo([u.length],\"int32\",u),m=e.makeTensorInfo([c.length],o.dtype,c);return[l,m]}var y3={kernelName:Gp,backendName:\"webgl\",kernelFunc:ate};function ite(r){let{inputs:t,backend:e,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=t,{rowPartitionTypes:p}=o,u=e.readSync(n.dataId),c=e.readSync(s.dataId),l=e.readSync(a.dataId),m=i.map(g=>e.readSync(g.dataId)),d=i.map(g=>g.shape),[f,h]=sD(u,n.shape,c,s.shape,s.dtype,l,a.shape,m,d,p);return e.makeTensorInfo(f,s.dtype,h)}var b3={kernelName:Hp,backendName:\"webgl\",kernelFunc:ite};var Dv=r=>{let{backend:t,attrs:e}=r,{start:o,stop:n,step:s,dtype:a}=e,i=aD(o,n,s,a);return t.makeTensorInfo([i.length],a,i)},C3={kernelName:ma,backendName:\"webgl\",kernelFunc:Dv};var ute=\"return 1.0 / x;\",pte=xe({opSnippet:ute}),w3={kernelName:ns,backendName:\"webgl\",kernelFunc:pte};var cte=Wt+`\n return (x < 0.0) ? 0.0 : x;\n`,lte=`\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,mte=xe({opSnippet:cte,packedOpSnippet:lte}),S3={kernelName:ss,backendName:\"webgl\",kernelFunc:mte};var dte=Wt+`\n return (x < 0.0) ? 0.0 : min(6.0, x);\n`,fte=`\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,hte=xe({opSnippet:dte,packedOpSnippet:fte}),I3={kernelName:us,backendName:\"webgl\",kernelFunc:hte};var yg=class{constructor(t,e,o,n,s){this.variableNames=[\"A\"],this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m;s?m=\"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)\":m=\"vec2(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${c[0]/l[0]},\n ${c[1]/l[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${p}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${m};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}};var bg=class{constructor(t,e,o,n,s){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m;s?m=\"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)\":m=\"vec3(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${c[0]/l[0]},\n ${c[1]/l[1]},\n ${c[1]/l[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${p}.0,\n ${p}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${m};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${u-1};\n bool hasNextRow = coords.z < ${o-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}};function gte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,c=A().getBool(\"WEBGL_PACK_IMAGE_OPERATIONS\")?new bg(n.shape,p,u,s,a):new yg(n.shape,p,u,s,a);return e.runWebGLProgram(c,[n],\"float32\")}var v3={kernelName:is,backendName:\"webgl\",kernelFunc:gte};var Cg=class{constructor(t,e,o){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=e;let[,n,s]=e,[,a,i]=t,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],c=p[0]/u[0],l=p[1]/u[1],m=1/c,d=1/l,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${c});\n const float widthScale = float(${l});\n\n const float invHeightScale = float(${m});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${f});\n const int winWidth = int(${h});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${n-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${s-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}};function xte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=new Cg(s.shape,n.shape,a);return e.runWebGLProgram(i,[s],s.dtype)}var k3={kernelName:Ja,backendName:\"webgl\",kernelFunc:xte};var wg=class{constructor(t,e,o,n,s){this.variableNames=[\"A\"],this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m=n?\"0.5\":\"0.0\",d;s?d=\"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))\":d=\"vec2(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${c[0]/l[0]},\n ${c[1]/l[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${p}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${m})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}};var Sg=class{constructor(t,e,o,n,s){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m=n?\"0.5\":\"0.0\",d;s?d=\"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))\":d=\"vec3(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${c[0]/l[0]},\n ${c[1]/l[1]},\n ${c[1]/l[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${p}.0,\n ${p}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${m})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${u-1};\n bool hasNextRow = coords.z < ${o-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}};function yte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,c=A().getBool(\"WEBGL_PACK_IMAGE_OPERATIONS\")?new Sg(n.shape,p,u,s,a):new wg(n.shape,p,u,s,a);return e.runWebGLProgram(c,[n],n.dtype)}var N3={kernelName:as,backendName:\"webgl\",kernelFunc:yte};var Ig=class{constructor(t,e,o){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=e;let[,n,s]=e,[,a,i]=t,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],c=p[0]/u[0],l=p[1]/u[1],m=1/c,d=1/l,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${c});\n const float widthScale = float(${l});\n\n const float invHeightScale = float(${m});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${f});\n const int winWidth = int(${h});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float sourceFracRow =\n float(${p[0]}) *\n (float(dyR) / float(${u[0]}));\n\n float sourceFracCol =\n float(${p[1]}) *\n (float(dyC) / float(${u[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${n}) - 1),\n ${o} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${s}) - 1),\n ${o} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}};function bte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=new Ig(s.shape,n.shape,a);return e.runWebGLProgram(i,[s],s.dtype)}var T3={kernelName:Za,backendName:\"webgl\",kernelFunc:bte};var vg=class{constructor(t,e){this.variableNames=[\"x\"];let o=t.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);if(this.outputShape=t,o===1){this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${t[0]} - coord - 1));\n }\n `;return}let n=i=>e.indexOf(i)!==-1&&t[i]!==1?`${t[i]} - coords[${i}] - 1`:`coords[${i}]`,s=t.map((i,p)=>n(p)).join(\",\"),a=Re(o);this.userCode=`\n void main() {\n ${a} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}};var kg=class{constructor(t,e){this.variableNames=[\"x\"],this.packedInputs=!0,this.packedOutput=!0;let o=t.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);this.outputShape=t;let n=Rt(\"rc\",o),s=`${n[o-1]} + 1 < ${this.outputShape[o-1]}`,a=`${n[o-2]} + 1 < ${this.outputShape[o-2]}`,i=Re(o);o===1?this.userCode=`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${t[0]} - rc - 1),\n ${t[0]} - rc - 1);\n if(${s}){\n result.g = getChannel(getX(${t[0]} - (rc + 1) - 1),\n ${t[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:this.userCode=`\n void main() {\n ${i} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${p(n.slice())};\n if(${s}){\n result.g = ${u(n.slice())};\n }\n if(${a}) {\n result.b = ${c(n.slice())};\n if(${s}) {\n result.a = ${l(n.slice())};\n }\n }\n setOutput(result);\n }\n `;function p(f){return m(f)}function u(f){return f[o-1]=\"(\"+f[o-1]+\" + 1)\",m(f)}function c(f){return f[o-2]=\"(\"+f[o-2]+\" + 1)\",m(f)}function l(f){return f[o-1]=\"(\"+f[o-1]+\" + 1)\",f[o-2]=\"(\"+f[o-2]+\" + 1)\",m(f)}function m(f){let h=t.map((b,C)=>d(C,f)),g=h.join(\",\"),x=h.slice(-2).join(\",\");return`getChannel(getX(${g}), vec2(${x}))`}function d(f,h){return e.indexOf(f)!==-1&&t[f]!==1?`${t[f]} - ${h[f]} - 1`:`${h[f]}`}}};function Cte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o,a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return Dt({inputs:{x:n},backend:e});let p=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new kg(n.shape,i):new vg(n.shape,i);return e.runWebGLProgram(p,[n],n.dtype)}var _3={kernelName:ps,backendName:\"webgl\",kernelFunc:Cte};var Ng=class{constructor(t,e){this.variableNames=[\"Image\"],this.outputShape=[],this.customUniforms=[{name:\"params\",type:\"vec4\"}];let o=t[1],n=t[2];this.outputShape=t;let s=\"\";typeof e==\"number\"?s=`float outputValue = ${e.toFixed(2)};`:s=`\n vec3 fill = vec3(${e.join(\",\")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${s}\n if(coordX >= 0 && coordX < ${n} && coordY >= 0 && coordY < ${o}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}};var $3={kernelName:Ds,backendName:\"webgl\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=t,i=e,p=new Ng(o.shape,s),[u,c]=w.getImageCenter(a,o.shape[1],o.shape[2]),l=[[u,c,Math.sin(n),Math.cos(n)]];return i.runWebGLProgram(p,[o],o.dtype,l)}};var wte=`\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n`,Ste=xe({opSnippet:wte}),E3={kernelName:cs,backendName:\"webgl\",kernelFunc:Ste};var Ite=\"return inversesqrt(x);\",vte=xe({opSnippet:Ite,cpuKernelImpl:iD}),R3={kernelName:ls,backendName:\"webgl\",kernelFunc:vte};var yu=class{constructor(t,e,o,n,s,a,i=!0,p=!1){this.variableNames=[\"updates\",\"indices\",\"defaultValue\"],this.outputShape=a;let u=Re(s.length),c=Re(a.length),l=\"\";o===1?l=\"i\":o===2&&(l=\"i, j\");let m=`getIndices(${l})`,d=\"\";n===1?d=\"i\":n===2&&(d=\"i, coords[1]\");let f=`getUpdates(${d})`,h=\"\";p&&(h=\"coords[0], coords[1]\");let g=`getDefaultValue(${h})`,x=e>1?\"strides[j]\":\"strides\";this.userCode=`\n ${u} strides = ${u}(${s});\n\n void main() {\n ${c} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${t}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${e}; j++) {\n int index = round(${m});\n flattenedIndex += index * ${x};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${f};\n found = true;\n }\n }\n setOutput(mix(${g}, sum, float(found)));\n }\n `}};var Tg=class{constructor(t,e,o,n,s,a,i=!0,p=!1){this.variableNames=[\"updates\",\"indices\",\"defaultValue\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a;let u=Re(s.length),c=Re(a.length),l=\"\";o===1?l=\"i\":o===2&&(l=\"i, j\");let m=`getIndices(${l})`,d=\"\";n===1?d=\"i\":n===2&&(d=\"i, coords[1]\");let f=`getUpdates(${d})`,h=\"\";p&&(h=\"coords[0], coords[1]\");let g=`getDefaultValue(${h})`,x=e>1?\"strides[j]\":\"strides\",b=e>1?\"strides[j + 1]\":\"strides\";this.userCode=`\n ${u} strides = ${u}(${s});\n\n void main() {\n ${c} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${t}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${e}; j+=2) {\n ivec4 index = round(${m});\n flattenedIndex += index.xz * ${x};\n if (j + 1 < ${e}) {\n flattenedIndex += index.yw * ${b};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${f};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${g}, sum, found));\n }\n `}};function kte(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(s,n,a),m=[l/u,u];if(l===0)return e.makeTensorInfo(a,n.dtype);let d=te({inputs:{x:n},backend:e,attrs:{shape:[p,i]}}),f=te({inputs:{x:s},backend:e,attrs:{shape:[p,u]}}),h=e.makeTensorInfo([],\"float32\",new Float32Array([0])),g;A().getBool(\"WEBGL_PACK\")?g=new Tg(p,i,d.shape.length,f.shape.length,c,m):g=new yu(p,i,d.shape.length,f.shape.length,c,m);let x=e.runWebGLProgram(g,[f,d,h],f.dtype),b=te({inputs:{x},backend:e,attrs:{shape:a}});return e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(x),e.disposeIntermediateTensorInfo(h),b}var D3={kernelName:ms,backendName:\"webgl\",kernelFunc:kte};var _g=class{constructor(t,e,o,n){this.variableNames=[\"sortedSequence\",\"values\"],this.customUniforms=[{name:\"numInputs\",type:\"int\"}],this.outputShape=[t,o];let s=\"while (left < right) {\",a=`for (int i = 0; i < ${Math.ceil(Math.log2(e+1))}; ++i) { if (left >= right) break;`,i=A().getNumber(\"WEBGL_VERSION\")===2?s:a,p=n===\"left\"?\"<\":\"<=\";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${i}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${p} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}};function Nte(r){let{inputs:t,backend:e,attrs:o}=r,{sortedSequence:n,values:s}=t,{side:a}=o,i=new _g(n.shape[0],n.shape[1],s.shape[1],a),p=[[n.shape[1]]];return e.runWebGLProgram(i,[n,s],\"int32\",p)}var A3={kernelName:fs,backendName:\"webgl\",kernelFunc:Nte};var $g=class{constructor(t,e,o){this.variableNames=[\"c\",\"a\",\"b\"],this.outputShape=e;let n,s;if(o>4)throw Error(`Where for rank ${o} is not yet supported`);if(o===1)s=\"resRC\",n=\"resRC\";else{let i=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],p=[],u=[];for(let c=0;c= 1.0) {\n setOutput(getA(${s}));\n } else {\n setOutput(getB(${s}));\n }\n }\n `}};function Tte(r){let{inputs:t,backend:e}=r,{condition:o,t:n,e:s}=t,a=new $g(o.shape.length,n.shape,n.shape.length);return e.runWebGLProgram(a,[o,n,s],dt(n.dtype,s.dtype))}var F3={kernelName:fa,backendName:\"webgl\",kernelFunc:Tte};var _te=`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${w.SELU_SCALEALPHA};\n float scale = ${w.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`,$te=xe({opSnippet:_te}),P3={kernelName:hs,backendName:\"webgl\",kernelFunc:$te};var Ete=Fo+`\n return 1.0 / (1.0 + exp(-1.0 * x));\n`,Rte=`\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,Dte=xe({opSnippet:Ete,packedOpSnippet:Rte,cpuKernelImpl:pD}),O3={kernelName:bs,backendName:\"webgl\",kernelFunc:Dte};var Ate=`\n if (isnan(x)) { return 0.0; }\n return sign(x);\n`,Fte=xe({opSnippet:Ate}),M3={kernelName:ys,backendName:\"webgl\",kernelFunc:Fte};var Pte=Fo+`\n return sin(x);\n`,Ote=`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${jr}\n return result;\n`,Mte=xe({opSnippet:Pte,packedOpSnippet:Ote}),L3={kernelName:gs,backendName:\"webgl\",kernelFunc:Mte};var Lte=`\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n`,Bte=xe({opSnippet:Lte}),B3={kernelName:xs,backendName:\"webgl\",kernelFunc:Bte};var zte=`\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n`,Vte=xe({opSnippet:zte}),z3={kernelName:Cs,backendName:\"webgl\",kernelFunc:Vte};var Wte=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>\"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet\");let i=s.reduce((x,b)=>x*b),p=[[0,0]];p.push(...a);for(let x=1+s.length;xe.disposeIntermediateTensorInfo(x)),g},V3={kernelName:ga,backendName:\"webgl\",kernelFunc:Wte};function Ute(r){let{inputs:t,backend:e}=r,{indices:o,values:n,denseShape:s,defaultValue:a}=t;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw:\n ${s.shape}`);if(o.shape.length!==2)throw new Error(`Indices must be a matrix, saw:\n ${o.shape}`);if(n.shape.length!==1)throw new Error(`Values must be a vector, saw:\n ${n.shape}`);if(a.shape.length!==0)throw new Error(`Default value must be a scalar, saw:\n ${a.shape}`);let i=e.readSync(o.dataId),p=e.readSync(n.dataId),u=e.readSync(s.dataId),c=e.readSync(a.dataId)[0],[l,m,d,f,h]=lD(i,o.shape,o.dtype,p,n.dtype,u,c);return[e.makeTensorInfo(m,o.dtype,l),e.makeTensorInfo([m[0]],n.dtype,d),e.makeTensorInfo([f.length],\"bool\",new Uint8Array(f.map(g=>Number(g)))),e.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var W3={kernelName:Hi,backendName:\"webgl\",kernelFunc:Ute};function Gte(r){let{inputs:t,backend:e}=r,{inputIndices:o,inputShape:n,newShape:s}=t;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${o.shape}`);if(n.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(e.readSync(n.dataId)),i=e.readSync(o.dataId),p=Array.from(e.readSync(s.dataId)),[u,c,l]=mD(i,o.shape,o.dtype,a,p);return[e.makeTensorInfo(c,o.dtype,u),e.makeTensorInfo([l.length],s.dtype,new Int32Array(l))]}var U3={kernelName:ei,backendName:\"webgl\",kernelFunc:Gte};function Hte(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);let a=e.readSync(o.dataId),i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,c]=ch(a,o.shape,o.dtype,i,p,!0);return e.makeTensorInfo(c,o.dtype,u)}var G3={kernelName:ya,backendName:\"webgl\",kernelFunc:Hte};function Kte(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);let a=e.readSync(o.dataId),i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,c]=ch(a,o.shape,o.dtype,i,p);return e.makeTensorInfo(c,o.dtype,u)}var H3={kernelName:ba,backendName:\"webgl\",kernelFunc:Kte};function qte(r){let{inputs:t,backend:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=w.calculateShapes(s,n,i),d=!1;if(s.dtype===\"string\"){let x=e.bufferSync(n),b=e.bufferSync(s),C=y.decodeString(e.readSync(a.dataId)[0]),S=uD(x,b,i,m,c,u,p,l,C,d);return e.makeTensorInfo(i,S.dtype,S.values)}let f=new yu(u,p,n.shape.length,s.shape.length,l,[m,1],d),h=e.runWebGLProgram(f,[s,n,a],s.dtype),g=te({inputs:{x:h},backend:e,attrs:{shape:i}});return e.disposeIntermediateTensorInfo(h),g}var K3={kernelName:vs,backendName:\"webgl\",kernelFunc:qte};function jte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=n.shape.length,c=new Array(u).fill(0),l=n.shape.slice();return p.map(m=>{let d=[...l];d[i]=m;let f=Gs({inputs:{x:n},backend:e,attrs:{begin:c,size:d}});return c[i]+=m,f})}var q3={kernelName:xa,backendName:\"webgl\",kernelFunc:jte};var j3=\"return sqrt(x);\",Xte=xe({opSnippet:j3,packedOpSnippet:j3,cpuKernelImpl:dD}),X3={kernelName:ws,backendName:\"webgl\",kernelFunc:Xte};var Yte=\"return x * x;\",Qte=xe({opSnippet:Yte}),Y3={kernelName:Ki,backendName:\"webgl\",kernelFunc:Qte};var Q3=\"return (a - b) * (a - b);\",Zte=nt({opSnippet:Q3,packedOpSnippet:Q3}),Z3={kernelName:ks,backendName:\"webgl\",kernelFunc:Zte};function Jte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t;if(n.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");let s=e.readSync(n.dataId),a=w.fromUint8ToStringArray(s),i=fD(a,\"string\",o);return e.makeTensorInfo(n.shape,\"string\",i)}var J3={kernelName:$u,backendName:\"webgl\",kernelFunc:Jte};function ere({inputs:r,attrs:t,backend:e}){let{x:o}=r,n=Wt+`\n return x > 0.0 ? 1.0 : float(${t.alpha});\n `,s=new tr(o.shape,n);return e.runWebGLProgram(s,[o],o.dtype)}var eP={kernelName:wo,backendName:\"webgl\",kernelFunc:ere};var Eg=class{constructor(t,e,o){this.variableNames=[\"x\"],this.outputShape=o;let n=o.length,s=Re(o.length),a=Re(o.length),i=\"\";if(n===1)i=\"coords * strides + begin\";else{let p=0;i=o.map((u,c)=>(p++,o.length===1?`coords * strides[${c}] + begin[${c}]`:`coords[${p-1}] * strides[${c}] + begin[${c}]`)).join(\",\")}this.userCode=`\n ${s} begin = ${s}(${t});\n ${s} strides = ${s}(${e});\n\n void main() {\n ${a} coords = getOutputCoords();\n setOutput(getX(${i}));\n }\n `}};function tre(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=te({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let E=pt.computeOutShape(b,C,S),R=Gs({inputs:{x:n},backend:e,attrs:{begin:b,size:E}});k=te({inputs:{x:R},backend:e,attrs:{shape:f}}),e.disposeIntermediateTensorInfo(R)}else if(e.shouldExecuteOnCPU([n])){let R=e.readSync(n.dataId),D=me(n.shape,n.dtype,R),P=hD(d,D,S,b);k=e.makeTensorInfo(f,n.dtype,P.values)}else{let R=new Eg(b,S,d);k=e.runWebGLProgram(R,[n],n.dtype)}let _=te({inputs:{x:k},backend:e,attrs:{shape:f}});return e.disposeIntermediateTensorInfo(k),_}var tP={kernelName:Ns,backendName:\"webgl\",kernelFunc:tre};function rre(r){let{inputs:t,backend:e,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:c,dataSplits:l}=t,m=e.readSync(c.dataId),d=e.readSync(l.dataId),[f,h]=gD(m,d,n,s,a,i,p,u);return[e.makeTensorInfo([f.length],\"string\",f),e.makeTensorInfo(l.shape,\"int32\",h)]}var rP={kernelName:Ca,backendName:\"webgl\",kernelFunc:rre};function ore(r){let{inputs:t,backend:e,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=t;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=e.readSync(s.dataId),p=e.readSync(a.dataId)[0],[u,c,l]=xD(i,p,n),m=c.length;return[e.makeTensorInfo([m,2],\"int32\",u),e.makeTensorInfo([m],\"string\",c),e.makeTensorInfo([2],\"int32\",new Int32Array(l))]}var oP={kernelName:qi,backendName:\"webgl\",kernelFunc:ore};function nre(r){let{inputs:t,backend:e,attrs:o}=r,{numBuckets:n}=o,{input:s}=t;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(n<=0)throw new Error(\"Number of buckets must be at least 1\");let a=e.readSync(s.dataId),i=yD(a,n);return e.makeTensorInfo(s.shape,\"int32\",i)}var nP={kernelName:ji,backendName:\"webgl\",kernelFunc:nre};var sre=\"return tan(x);\",are=xe({opSnippet:sre}),sP={kernelName:_s,backendName:\"webgl\",kernelFunc:are};var ire=`\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n`,ure=xe({opSnippet:ire}),aP={kernelName:$s,backendName:\"webgl\",kernelFunc:ure};function pre(r){let{inputs:t,backend:e,attrs:o}=r,{tensor:n,indices:s,updates:a}=t,{}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(a,s,n.shape),m=[l/u,u];if(l===0)return e.makeTensorInfo(n.shape,s.dtype);let d=te({inputs:{x:s},backend:e,attrs:{shape:[p,i]}}),f=te({inputs:{x:a},backend:e,attrs:{shape:[p,u]}}),h=te({inputs:{x:n},backend:e,attrs:{shape:m}}),g=new yu(p,i,d.shape.length,f.shape.length,c,m,!1,!0),x=e.runWebGLProgram(g,[f,d,h],h.dtype),b=te({inputs:{x},backend:e,attrs:{shape:n.shape}});return e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(x),b}var iP={kernelName:ds,backendName:\"webgl\",kernelFunc:pre};var Rg=class{constructor(t,e){this.variableNames=[\"A\"];let o=new Array(t.length);for(let a=0;a5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${r[0]})`;let e=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\"],o=[];for(let n=0;n5){let p=e.readSync(n.dataId),u=n.dtype===\"string\"?p.map(m=>y.decodeString(m)):p,c=me(n.shape,n.dtype,u),l=CD(c,s);return e.makeTensorInfo(l.shape,l.dtype,l.values)}let a=new Rg(n.shape,s);return e.runWebGLProgram(a,[n],n.dtype)}var uP={kernelName:uo,backendName:\"webgl\",kernelFunc:Av};var Dg=class{constructor(t){this.variableNames=[\"x\",\"indices\"],this.customUniforms=[{name:\"n\",type:\"int\"},{name:\"firstPass\",type:\"int\"},{name:\"negativeInf\",type:\"float\"},{name:\"dir\",type:\"int\"},{name:\"inc\",type:\"int\"}],this.outputShape=t,this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n `}},Ag=class{constructor(t){this.variableNames=[\"x\",\"indices\"],this.customUniforms=[{name:\"n\",type:\"int\"},{name:\"firstPass\",type:\"int\"},{name:\"k\",type:\"int\"}],this.outputShape=t,this.userCode=`\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n `}};function Ip(r,t){t!==null&&r.disposeIntermediateTensorInfo(t)}function pP(r){let t=1;for(;tp){let P=e.readSync(n.dataId),[O,M]=wD(P,u,n.dtype,s,a);return[e.makeTensorInfo(O.shape,O.dtype,O.values),e.makeTensorInfo(M.shape,M.dtype,M.values)]}if(s===0)return u[u.length-1]=0,[e.makeTensorInfo(u,n.dtype,[]),e.makeTensorInfo(u,\"int32\",[])];if(c===1)return[n,bi({attrs:{shape:u,dtype:\"int32\",value:0},backend:e})];let l=e.texData.get(n.dataId),m=l!==null&&l.isPacked,d=m?e.unpackTensor(n):n,h=y.sizeFromShape(u)/c,g=te({inputs:{x:d},attrs:{shape:[h,c]},backend:e});m&&Ip(e,d);let x=pP(s),b=pP(c),C=null,S=()=>C===null?[g,g]:[g,C],k=(P,O,M)=>{let L=S(),B=new Dg(M),U=[[c],[C===null?1:0],[Number.NEGATIVE_INFINITY],[P],[O]],j=C;C=e.runWebGLProgram(B,L,\"int32\",U),Ip(e,j)};for(let P=1;P=1;M/=2)k(O,M,[h,b])}for(let P=b;P>x;P/=2){let O=S(),M=new Ag([h,P/2]),B=[[c],[C===null?1:0],[x]],z=C;C=e.runWebGLProgram(M,O,\"int32\",B),Ip(e,z);let U=x/2,j=U*2;for(let q=U;q>=1;q/=2)k(j,q,C.shape)}let _=C;C=Gs({inputs:{x:C},backend:e,attrs:{begin:0,size:[h,s]}}),Ip(e,_);let E=Nv({inputs:{x:g,indices:C},backend:e,attrs:{axis:1,batchDims:1}});Ip(e,g);let R=u.slice(0,-1);R.push(s),_=C,C=te({inputs:{x:C},attrs:{shape:R},backend:e}),Ip(e,_);let D=E;return E=te({inputs:{x:E},attrs:{shape:R},backend:e}),Ip(e,D),[E,C]}var cP={kernelName:Es,backendName:\"webgl\",kernelFunc:lre};var Fg=class{constructor(t,e,o,n,s,a){this.variableNames=[\"Image\",\"Transforms\"],this.outputShape=a;let i=o===\"nearest\"?1:2,p;switch(n){case\"constant\":p=1;break;case\"reflect\":p=2;break;case\"wrap\":p=3;break;case\"nearest\":p=4;break;default:p=1;break}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${p} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${p} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${p} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${t} && 0 <= coordX && coordX < ${e}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${s});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${s});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${e}));\n float mapY = mapCoord(inY, float(${t}));\n\n if (${i} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}};function mre(r){let{inputs:t,backend:e,attrs:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=new Fg(l,m,a,i,p,g);return e.runWebGLProgram(x,[n,s],\"float32\")}var lP={kernelName:Rs,backendName:\"webgl\",kernelFunc:mre};function dre(r){let{inputs:t,attrs:e,backend:o}=r,{axis:n}=e,{x:s}=t;Vs(s,\"unique\"),console.warn(\"WARNING: \",\"UI might be locked temporarily as data is being downloaded\");let a=o.readSync(s.dataId),{outputValues:i,outputShape:p,indices:u}=SD(a,n,s.shape,s.dtype);return[o.makeTensorInfo(p,s.dtype,i),o.makeTensorInfo([u.length],\"int32\",u)]}var mP={kernelName:Xi,backendName:\"webgl\",kernelFunc:dre};function fre(r){let{inputs:t,backend:e,attrs:o}=r,{value:n}=t,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),c=0;for(let h=0;he.disposeIntermediateTensorInfo(h)),f}var dP={kernelName:wa,backendName:\"webgl\",kernelFunc:fre};var Pg=class{constructor(t,e){this.variableNames=[\"x\",\"segmentIds\"];let o=t.windowSize,n=t.batchSize,s=t.inSize,a=t.numSegments,i=a*Math.ceil(s/o);this.outputShape=[n,i];let p=\"0.0\",u=\"sumValue\",c=Math.floor(o/4)*4,l=o%4,m=`\n sumValue += dot(values, segFilter);\n `,d=\"\";s%o>0&&(d=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return initializationValue;\n }\n `);let f=\"\";s%o>0&&(f=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = ${p};\n\n float getValue(int batch, int inIdx) {\n ${d}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${f}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${a})) * float(${o}));\n int currentSeg = int(mod(float(outIdx), float(${a})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${c}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${m}\n }\n\n int inIdx = inOffset + ${c};\n if (${l===1}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${m}\n } else if (${l===2}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${m}\n } else if (${l===3}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${m}\n }\n setOutput(${u});\n }\n `}};function hre(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,segmentIds:s}=t,{numSegments:a}=o,i=n.shape.length,p=[],u=0,c=w.getAxesPermutation([u],i),l=n;c!=null&&(l=bt({inputs:{x:n},backend:e,attrs:{perm:c}}),p.push(l),u=w.getInnerMostAxes(1,i)[0]);let m=w.segment_util.computeOutShape(l.shape,u,a),d=y.sizeFromShape([l.shape[u]]),f=te({inputs:{x:l},backend:e,attrs:{shape:[-1,d]}});p.push(f);let h=oi(n.dtype),g=(S,k,_,E,R)=>{let D=S.shape[0],P=S.shape[1],O=w.segment_util.segOpComputeOptimalWindowSize(P,R),M={windowSize:O,inSize:P,batchSize:D,numSegments:R},L=new Pg(M,k),B=e.compileAndRun(L,[S,_],E);if(p.push(B),B.shape[1]===R)return B;let z=Dv({backend:e,attrs:{start:0,stop:R,step:1,dtype:\"float32\"}}),U=Av({inputs:{x:z},backend:e,attrs:{reps:[P/O]}});return p.push(z),p.push(U),g(B,k,U,E,R)},x=g(f,\"unsortedSegmentSum\",s,h,a),b=te({inputs:{x},backend:e,attrs:{shape:m}}),C=b;if(c!=null){p.push(b);let S=w.getUndoAxesPermutation(c);C=bt({inputs:{x:C},backend:e,attrs:{perm:S}})}return p.forEach(S=>e.disposeIntermediateTensorInfo(S)),C}var fP={kernelName:Yi,backendName:\"webgl\",kernelFunc:hre};var gre=[YD,ZD,JD,eA,rA,oA,nA,sA,uA,pA,cA,lA,mA,dA,fA,hA,gA,xA,yA,bA,CA,SA,IA,vA,kA,$A,RA,DA,zD,FA,OA,MA,LA,BA,zA,VA,WA,UA,GA,HA,jA,XA,YA,QA,ZA,JA,eF,tF,rF,oF,nF,sF,aF,iF,uF,pF,lF,mF,dF,fF,gF,xF,yF,bF,CF,wF,SF,IF,vF,BD,kF,PA,NF,TF,_F,VD,$F,EF,RF,DF,AF,FF,PF,OF,MF,LF,zF,VF,WF,UF,GF,HF,qF,XF,YF,QF,ZF,JF,n3,GD,s3,a3,i3,u3,NA,p3,m3,d3,f3,h3,WD,g3,x3,y3,b3,C3,TA,e3,w3,S3,I3,KD,v3,k3,N3,T3,_3,$3,E3,R3,D3,A3,F3,P3,O3,M3,L3,B3,wA,o3,z3,V3,W3,U3,G3,H3,K3,q3,X3,Y3,Z3,J3,eP,tP,rP,oP,nP,r3,jD,sP,aP,iP,uP,cP,lP,XD,mP,dP,fP,c3];for(let r of gre)ti(r);var we;(function(r){r[r.float32=0]=\"float32\",r[r.int32=1]=\"int32\",r[r.bool=2]=\"bool\",r[r.string=3]=\"string\",r[r.complex64=4]=\"complex64\"})(we||(we={}));var bu;(function(r){r[r.linear=0]=\"linear\",r[r.relu=1]=\"relu\",r[r.relu6=2]=\"relu6\",r[r.prelu=3]=\"prelu\",r[r.leakyrelu=4]=\"leakyrelu\",r[r.sigmoid=5]=\"sigmoid\",r[r.elu=6]=\"elu\"})(bu||(bu={}));var hP;function xre(r){hP=r.wasm.cwrap(So,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function yre(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=t;if(n.dtype!==\"float32\"||s.dtype!==\"float32\")throw new Error(\"_FusedMatMul for non non-float32 tensors not yet supported.\");let{transposeA:p,transposeB:u,activation:c,leakyreluAlpha:l}=o,m=e.dataIdMap.get(n.dataId).id,d=e.dataIdMap.get(s.dataId).id,f=0;if(a!=null){let R=e.dataIdMap.get(a.dataId);if(R.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${R.shape.length}.`);f=R.id}let h=i==null?0:e.dataIdMap.get(i.dataId).id,g=bu[c];if(g==null)throw new Error(`${c} activation not yet supported for FusedConv2D in the wasm backend.`);let x=p?n.shape[2]:n.shape[1],b=u?s.shape[1]:s.shape[2],C=Sr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)),S=e.makeOutput([...C,x,b],n.dtype),k=e.dataIdMap.get(S.dataId).id,_=new Uint8Array(new Int32Array(n.shape).buffer),E=new Uint8Array(new Int32Array(s.shape).buffer);return hP(m,_,n.shape.length,d,E,s.shape.length,p,u,g,f,h,l||0,k),S}var gP={kernelName:So,backendName:\"wasm\",setupFunc:xre,kernelFunc:yre};function he(r,t){let e;function o(s){e=s.wasm.cwrap(r,null,[\"number\",\"number\",\"number\"])}function n(s){let{backend:a,inputs:{x:i}}=s,p=a.dataIdMap.get(i.dataId).id,u=a.makeOutput(i.shape,t||i.dtype),c=a.dataIdMap.get(u.dataId).id;return y.sizeFromShape(u.shape)===0||e(p,we[i.dtype],c),u}return{kernelName:r,backendName:\"wasm\",setupFunc:o,kernelFunc:n}}var xP=he(Xs);var yP=he(Vo);var bP=he(Wo);function Ue(r,t,e){let o;function n(a){o=a.wasm.cwrap(r,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\"])}function s(a){let{backend:i,inputs:p}=a,{a:u,b:c}=p,l=i.dataIdMap.get(u.dataId).id,m=i.dataIdMap.get(c.dataId).id,d=e!=null?e:u.dtype,f=w.assertAndGetBroadcastShape(u.shape,c.shape),h=i.makeOutput(f,d);if(y.sizeFromShape(f)===0)return h;let g=new Uint8Array(new Int32Array(u.shape).buffer),x=new Uint8Array(new Int32Array(c.shape).buffer),b=i.dataIdMap.get(h.dataId).id;return o(l,g,u.shape.length,m,x,c.shape.length,we[u.dtype],b),h}return{kernelName:r,backendName:\"wasm\",setupFunc:n,kernelFunc:s}}var bre=!0,CP=Ue(io,bre);var wP;function Cre(r){wP=r.wasm.cwrap(Uo,null,[\"array\",\"number\",\"number\",\"number\"])}function wre(r){let{inputs:t,backend:e}=r,o=e.makeOutput(t[0].shape,t[0].dtype);if(y.sizeFromShape(o.shape)===0)return o;let n=t.map(i=>e.dataIdMap.get(i.dataId).id),s=new Uint8Array(new Int32Array(n).buffer),a=e.dataIdMap.get(o.dataId).id;return wP(s,n.length,we[o.dtype],a),o}var SP={kernelName:Uo,backendName:\"wasm\",setupFunc:Cre,kernelFunc:wre};function vp(r){let{inputs:{x:t},backend:e}=r;if(t.dtype===\"string\")return ar(e.readSync(t.dataId),t.shape,t.dtype);let o=e.makeOutput(t.shape,t.dtype),n=e.typedArrayFromHeap(t);return e.typedArrayFromHeap(o).set(n),o}var IP={kernelName:Co,backendName:\"wasm\",kernelFunc:vp};var vP;function Sre(r){vP=r.wasm.cwrap(po,null,[\"number\",\"array\",\"number\",\"number\",\"number\",\"array\",\"number\"])}function ho(r){let{inputs:t,backend:e,attrs:o}=r,[n,s]=vre(t.x.shape,o.perm),a=!0;for(let f=0;f=n&&(s===-1||o[s]>o[a])&&(s=a);o[s]=n}return[e,o]}var kP={kernelName:po,backendName:\"wasm\",kernelFunc:ho,setupFunc:Sre};function Tr(r,t,e){let o=r.shape,n=r.shape.length,s=y.parseAxisParam(t,o),a=s,i=w.getAxesPermutation(a,n),p=null,u=!1;if(i!=null){let c=new Array(n);for(let d=0;d`new shape: ${a}, old shape: ${o.shape}. New shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var HP={kernelName:da,backendName:\"wasm\",kernelFunc:zt};var KP;function Mre(r){KP=r.wasm.cwrap(Zo,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\",\"number\"])}function Lre(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;if(n.dtype!==\"float32\"||s.dtype!==\"float32\")throw new Error(\"BatchMatMul for non non-float32 tensors not yet supported.\");let p=n.shape.length,u=s.shape.length,c=a?n.shape[p-2]:n.shape[p-1],l=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),C=Sr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(c===l,()=>`Error in matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,c,m]:[g,m,c],k=i?[x,d,l]:[x,l,d],_=zt({inputs:{x:n},backend:e,attrs:{shape:S}}),E=zt({inputs:{x:s},backend:e,attrs:{shape:k}}),R=e.dataIdMap.get(_.dataId).id,D=e.dataIdMap.get(E.dataId).id,P=a?_.shape[2]:_.shape[1],O=i?E.shape[1]:E.shape[2],M=Math.max(g,x),L=e.makeOutput([M,P,O],_.dtype),B=e.dataIdMap.get(L.dataId).id,z=new Uint8Array(new Int32Array(_.shape).buffer),U=new Uint8Array(new Int32Array(E.shape).buffer);return KP(R,z,_.shape.length,D,U,E.shape.length,a,i,B),e.disposeData(_.dataId),e.disposeData(E.dataId),L.shape=C,L}var qP={kernelName:Zo,backendName:\"wasm\",setupFunc:Mre,kernelFunc:Lre};function Po(r){let{inputs:{x:t},attrs:{begin:e,size:o},backend:n}=r,[s,a]=pt.parseSliceParams(t,e,o),i=pt.isSliceContinous(t.shape,s,a),p=n.readSync(t.dataId),u=n.makeOutput(a,t.dtype),c=y.computeStrides(t.shape),l=n.dataIdMap.get(u.dataId);if(i){let f=pt.computeFlatOffset(s,c);return t.dtype===\"string\"?l.stringBytes=p.slice(f,f+y.sizeFromShape(a)):n.typedArrayFromHeap(u).set(p.subarray(f,f+y.sizeFromShape(a))),u}if(t.dtype===\"string\"){let f=ip(p,s,a,t.shape,t.dtype);return l.stringBytes=f,u}let m=n.typedArrayFromHeap(u),d=t.shape.length;if(d===2)Bre(p,c[0],m,s,a);else if(d===3)zre(p,c[0],c[1],m,s,a);else if(d===4)Vre(p,c[0],c[1],c[2],m,s,a);else{let f=ip(p,s,a,t.shape,t.dtype);m.set(f)}return u}function Bre(r,t,e,o,n){let s=0,a=o[0],i=o[1],p=a+n[0];for(let u=a;ux*b),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=zt({inputs:{x:n},backend:e,attrs:{shape:p}}),f=ho({inputs:{x:d},backend:e,attrs:{perm:u}}),h=zt({inputs:{x:f},backend:e,attrs:{shape:c}}),g=Po({inputs:{x:h},backend:e,attrs:{begin:l,size:m}});return e.disposeData(d.dataId),e.disposeData(f.dataId),e.disposeData(h.dataId),g}var XP={kernelName:Js,backendName:\"wasm\",kernelFunc:Wre};var YP;function Ure(r){YP=r.wasm.cwrap(Jo,null,[\"number\",\"number\",\"boolean\",\"number\",\"number\",\"number\"])}function Gre(r){let{backend:t,inputs:e,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=s.shape.reduce((l,m)=>l*m,1)!==0,p=n.shape.length===1?[a]:[n.shape[0],a],u=t.makeOutput(p,s.dtype);function c(l){return t.dataIdMap.get(l.dataId).id}return YP(c(n),a,i,c(s),we[s.dtype],c(u)),u}var QP={kernelName:Jo,backendName:\"wasm\",setupFunc:Ure,kernelFunc:Gre};var Hre=!0,ZP=Ue(qa,Hre);function Kre(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t,s=e.typedArrayFromHeap(o),a=e.typedArrayFromHeap(n),i=w.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return e.makeOutput([i.length],\"int32\",void 0,new Int32Array(i))}var JP={kernelName:ea,backendName:\"wasm\",kernelFunc:Kre};function Or(r){let{inputs:{x:t},attrs:{dtype:e},backend:o}=r,n=o.makeOutput(t.shape,e),s=o.typedArrayFromHeap(t);return o.typedArrayFromHeap(n).set(s),n}var eO={kernelName:yo,backendName:\"wasm\",kernelFunc:Or};var tO=he(en);var rO;function qre(r){rO=r.wasm.cwrap(bo,null,[\"number\",\"number\",\"number\",\"number\"])}function jre(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{clipValueMin:s,clipValueMax:a}=o,i=e.dataIdMap.get(n.dataId).id,p=e.makeOutput(n.shape,n.dtype),u=e.dataIdMap.get(p.dataId).id;return rO(i,s,a,u),p}var oO={kernelName:bo,backendName:\"wasm\",setupFunc:qre,kernelFunc:jre};function Fv(r){let{inputs:t,backend:e}=r,o=y.parseAxisParam(r.attrs.axis,t[0].shape)[0],n=t.map(d=>d.shape);w.assertParamsConsistent(n,o);let s=w.computeOutShape(t.map(d=>d.shape),o),a=t.filter(d=>y.sizeFromShape(d.shape)>0);if(a.length===1)return vp({inputs:{x:a[0]},backend:e});let i=e.makeOutput(s,t[0].dtype);if(y.sizeFromShape(s)===0)return i;if(a[0].dtype===\"string\"){let d=a.map(C=>{let k=[-1,y.sizeFromShape(C.shape.slice(o))];return zt({inputs:{x:C},backend:e,attrs:{shape:k}})}),f=d.map(C=>({vals:e.readSync(C.dataId),shape:C.shape}));s=w.computeOutShape(d.map(C=>C.shape),1);let h=d[0].shape[0]===1,g=np(f,s,t[0].dtype,h),x=w.computeOutShape(a.map(C=>C.shape),o);i.shape=x;let b=e.dataIdMap.get(i.dataId);return b.stringBytes=w.fromStringArrayToUint8(g),d.forEach(C=>e.disposeData(C.dataId)),i}let p=y.sizeFromShape(a[0].shape.slice(0,o)),u=0,c=a.map(d=>{let f=y.sizeFromShape(d.shape.slice(o));return u+=f,f}),l=a.map(d=>e.typedArrayFromHeap(d)),m=e.typedArrayFromHeap(i);for(let d=0;d`cumprod does not support ${n.dtype} tensors in the WASM backend`);let u=w.getAxesPermutation([s],p),c=n;u!==null&&(c=ho({inputs:{x:n},attrs:{perm:u},backend:e}));let l=w.getInnerMostAxes(1,p)[0];w.assertAxesAreInnerMostDims(\"cumprod\",[l],p);let m=e.makeOutput(c.shape,c.dtype),d=c.shape[l],f=e.dataIdMap.get(c.dataId).id,h=e.dataIdMap.get(m.dataId).id;bO(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=w.getUndoAxesPermutation(u);g=ho({inputs:{x:m},attrs:{perm:x},backend:e}),e.disposeData(c.dataId),e.disposeData(m.dataId)}return g}var CO={kernelName:un,backendName:\"wasm\",setupFunc:ioe,kernelFunc:uoe};var wO;function poe(r){wO=r.wasm.cwrap(pn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function coe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o,p=n.shape.length;y.assert(n.dtype===\"float32\"||n.dtype===\"int32\",()=>`cumsum does not support ${n.dtype} tensors in the WASM backend`);let u=w.getAxesPermutation([s],p),c=n;u!==null&&(c=ho({inputs:{x:n},attrs:{perm:u},backend:e}));let l=w.getInnerMostAxes(1,p)[0];w.assertAxesAreInnerMostDims(\"cumsum\",[l],p);let m=e.makeOutput(c.shape,c.dtype),d=c.shape[l],f=e.dataIdMap.get(c.dataId).id,h=e.dataIdMap.get(m.dataId).id;wO(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=w.getUndoAxesPermutation(u);g=ho({inputs:{x:m},attrs:{perm:x},backend:e}),e.disposeData(c.dataId),e.disposeData(m.dataId)}return g}var SO={kernelName:pn,backendName:\"wasm\",setupFunc:poe,kernelFunc:coe};var IO;function loe(r){IO=r.wasm.cwrap(\"DenseBincount\",null,[\"number\",\"array\",\"number\",\"number\",\"boolean\",\"number\",\"number\",\"boolean\",\"number\"])}function moe(r){let{backend:t,inputs:e,attrs:o}=r,{x:n,weights:s}=e,{size:a,binaryOutput:i}=o,p=s.shape.reduce((m,d)=>m*d,1)!==0,u=n.shape.length===1?[a]:[n.shape[0],a],c=t.makeOutput(u,s.dtype);function l(m){return t.dataIdMap.get(m.dataId).id}return IO(l(n),new Uint8Array(new Int32Array(n.shape).buffer),n.shape.length,a,p,l(s),we[s.dtype],i,l(c)),c}var vO={kernelName:ra,backendName:\"wasm\",setupFunc:loe,kernelFunc:moe};var kO;function doe(r){kO=r.wasm.cwrap(ln,null,[\"number\",\"number\",\"number\",\"array\",\"number\",\"array\",\"array\",\"number\",\"number\"])}function foe(r){let{backend:t,inputs:e,attrs:o}=r,{x:n}=e,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a===\"NHWC\"?n.shape[1]:n.shape[2],u=a===\"NHWC\"?n.shape[2]:n.shape[3],c=a===\"NHWC\"?n.shape[3]:n.shape[1],l=p*s,m=u*s,d=c/(s*s),f=a===\"NHWC\"?[i,l,m,d]:[i,d,l,m],h=t.makeOutput(f,\"float32\"),x=t.dataIdMap.get(n.dataId).id,b=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),C=new Uint8Array(new Int32Array(f).buffer),S=new Uint8Array(new Int32Array(y.computeStrides(f)).buffer),k=t.dataIdMap.get(h.dataId).id;return kO(x,s,a===\"NHWC\"?1:0,b,n.shape.length-1,C,S,f.length,k),h}var NO={kernelName:ln,backendName:\"wasm\",setupFunc:doe,kernelFunc:foe};var TO;function hoe(r){TO=r.wasm.cwrap(mn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function goe(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s}=t,a=o.dataIdMap.get(n.dataId).id,i=o.dataIdMap.get(s.dataId).id,{strides:p,dilations:u,pad:c,dimRoundingMode:l}=e,m=u==null?[1,1]:u,d=w.computeConv2DInfo(n.shape,s.shape,p,m,c,l,!0),f=d.filterHeight,h=d.filterWidth,g=d.padInfo.top,x=d.padInfo.right,b=d.padInfo.bottom,C=d.padInfo.left,S=d.dilationHeight,k=d.dilationWidth,_=d.strideHeight,E=d.strideWidth,R=d.inChannels,D=d.outChannels,P=d.padInfo.type===\"SAME\"?1:0;if(d.dataFormat!==\"channelsLast\")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`);let O=o.makeOutput(d.outShape,\"float32\"),M=o.dataIdMap.get(O.dataId).id;return TO(a,n.shape[0],n.shape[1],n.shape[2],i,f,h,g,x,b,C,P,S,k,_,E,R,D,M),O}var _O={kernelName:mn,backendName:\"wasm\",setupFunc:hoe,kernelFunc:goe};var $O;function xoe(r){$O=r.wasm.cwrap(\"Diag\",null,[\"number\",\"number\",\"number\",\"number\"])}function yoe(r){let{inputs:t,backend:e}=r,{x:o}=t,n=y.sizeFromShape(o.shape),s=e.makeOutput([...o.shape,...o.shape],o.dtype);return $O(e.dataIdMap.get(o.dataId).id,we[o.dtype],n,e.dataIdMap.get(s.dataId).id),s}var EO={kernelName:oa,backendName:\"wasm\",setupFunc:xoe,kernelFunc:yoe};var RO;function boe(r){RO=r.wasm.cwrap(dn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Coe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o;if(n.dtype!==s.dtype)throw new Error(`Dilation2D error: x must have the same dtype as filter. Got ${n.dtype} and ${s.dtype}`);let u=w.computeDilation2DInfo(n.shape,s.shape,a,i,\"NHWC\",p),c=e.makeOutput(u.outShape,n.dtype);return RO(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(c.dataId).id,we[n.dtype],u.batchSize,u.inChannels,u.inHeight,u.inWidth,u.outHeight,u.outWidth,u.strideHeight,u.strideWidth,u.dilationHeight,u.dilationWidth,u.filterHeight,u.filterWidth,u.padInfo.top,u.padInfo.left),c}var DO={kernelName:dn,backendName:\"wasm\",setupFunc:boe,kernelFunc:Coe};var AO;function woe(r){AO=r.wasm.cwrap(Mi,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Soe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropFilter error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let c=w.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),l=e.makeOutput(s.shape,s.dtype);return AO(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(a.dataId).id,e.dataIdMap.get(l.dataId).id,we[n.dtype],c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.filterHeight,c.filterWidth,c.padInfo.top,c.padInfo.left),l}var FO={kernelName:Mi,backendName:\"wasm\",setupFunc:woe,kernelFunc:Soe};var PO;function Ioe(r){PO=r.wasm.cwrap(Oi,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function voe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropInput error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let c=w.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),l=e.makeOutput(n.shape,n.dtype);return PO(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(a.dataId).id,e.dataIdMap.get(l.dataId).id,we[n.dtype],c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.filterHeight,c.filterWidth,c.padInfo.top,c.padInfo.left),l}var OO={kernelName:Oi,backendName:\"wasm\",setupFunc:Ioe,kernelFunc:voe};var MO=he(hn);var LO;function koe(r){LO=r.wasm.cwrap(Xa,null,[\"number\",\"number\",\"number\"])}function Noe(r){let{inputs:t,backend:e}=r,{dy:o,y:n}=t,s=e.makeOutput(n.shape,\"float32\"),a=i=>e.dataIdMap.get(i.dataId).id;return LO(a(n),a(o),a(s)),s}var BO={kernelName:Xa,backendName:\"wasm\",setupFunc:koe,kernelFunc:Noe};var Toe=!1,zO=Ue(xn,Toe,\"bool\");var VO=he(gn);var WO=he(yn,\"float32\");function Mg(r){let{inputs:t,attrs:e,backend:o}=r,{input:n}=t,{dim:s}=e,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),zt({inputs:{x:n},backend:o,attrs:{shape:i}})}var UO={kernelName:na,backendName:\"wasm\",kernelFunc:Mg};var GO=he(bn,\"float32\");function Ov(r){let{attrs:{shape:t,value:e},backend:o}=r,{attrs:{dtype:n}}=r;n=n||y.inferDtype(e);let s=o.makeOutput(t,n);return o.typedArrayFromHeap(s).fill(e),s}var HO={kernelName:sa,backendName:\"wasm\",kernelFunc:Ov};var KO;function _oe(r){KO=r.wasm.cwrap(Cn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function $oe(r){let{inputs:t,backend:e}=r,{image:o}=t,n=e.makeOutput(o.shape,o.dtype),s=e.dataIdMap.get(o.dataId).id,a=e.dataIdMap.get(n.dataId).id,[i,p,u,c]=o.shape;return KO(s,i,p,u,c,a),n}var qO={kernelName:Cn,backendName:\"wasm\",kernelFunc:$oe,setupFunc:_oe};var jO=he(wn);var Eoe=!1,XO=Ue(Sn,Eoe);var YO;function Roe(r){YO=r.wasm.cwrap(In,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Doe(r){let{backend:t,inputs:e,attrs:o}=r,{varianceEpsilon:n}=o,{x:s,mean:a,variance:i,offset:p,scale:u}=e,c=t.dataIdMap.get(s.dataId).id,l=t.dataIdMap.get(a.dataId).id,m=t.dataIdMap.get(i.dataId).id,d=p!=null?t.dataIdMap.get(p.dataId).id:0,f=u!=null?t.dataIdMap.get(u.dataId).id:0,h=t.makeOutput(s.shape,s.dtype);if(y.sizeFromShape(s.shape)===0)return h;let g=t.dataIdMap.get(h.dataId).id;return YO(c,l,m,d,f,n,g),h}var QO={kernelName:In,backendName:\"wasm\",setupFunc:Roe,kernelFunc:Doe};var ZO;function Aoe(r){ZO=r.wasm.cwrap(Io,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 Foe(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dataFormat:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=e,h=w.computeConv2DInfo(n.shape,s.shape,p,c,u,m),g=bu[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,C=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==C)throw new Error(`FusedConv2D bias shape (${ee.shape}) does not match the number of output channels (${C})`);S=ee.id}let k=h.filterHeight,_=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,P=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type===\"SAME\"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(l!==\"NHWC\")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${l}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,\"float32\"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return ZO(x,j,q,Y,b,k,_,S,E,R,D,P,U,O,M,L,B,z,C,g,ne,f||0,re),J}var JO={kernelName:Io,backendName:\"wasm\",setupFunc:Aoe,kernelFunc:Foe};var eM;function Poe(r){eM=r.wasm.cwrap(vo,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 Ooe(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dataFormat:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=e,h=w.computeConv2DInfo(n.shape,s.shape,p,c,u,m,!0),g=bu[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,C=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==C)throw new Error(`FusedDepthwiseConv2D bias shape (${ee.shape}) does not match the number of output channels (${C})`);S=ee.id}let k=h.filterHeight,_=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,P=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type===\"SAME\"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(l!==\"NHWC\")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${l}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,\"float32\"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return eM(x,j,q,Y,b,k,_,S,E,R,D,P,U,O,M,L,B,z,C,g,ne,f||0,re),J}var tM={kernelName:vo,backendName:\"wasm\",setupFunc:Poe,kernelFunc:Ooe};var rM;function Moe(r){rM=r.wasm.cwrap(vn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\"])}function Loe(r){let{backend:t,inputs:e}=r,{params:o,indices:n}=e,[s,a,i,p]=sf.prepareAndValidate(o,n),u=t.makeOutput(s,o.dtype);if(a===0)return u;let c=n.shape,l=c[c.length-1],d=t.dataIdMap.get(o.dataId).id,h=t.dataIdMap.get(n.dataId).id,g=new Uint8Array(new Int32Array(p).buffer),x=t.dataIdMap.get(u.dataId).id;return rM(d,we[o.dtype],h,a,l,i,g,x),u}var oM={kernelName:vn,backendName:\"wasm\",setupFunc:Moe,kernelFunc:Loe};var nM;function Boe(r){nM=r.wasm.cwrap(\"Gather\",null,[\"number\",\"number\",\"array\",\"number\",\"number\",\"number\",\"array\",\"number\"])}function zoe(r){let{backend:t,inputs:e,attrs:o}=r,{x:n,indices:s}=e,{axis:a,batchDims:i}=o,p=y.parseAxisParam(a,n.shape)[0],u=t.readSync(s.dataId),c=n.shape[p];for(let D=0;D=0,()=>`GatherV2: the index value ${P} is not in [0, ${c-1}]`)}let l=w.segment_util.collectGatherOpShapeInfo(n,s,p,i),m=zt({inputs:{x:n},attrs:{shape:[l.batchSize,l.outerSize,l.dimSize,l.sliceSize]},backend:t}),d=y.sizeFromShape(s.shape),f=zt({inputs:{x:s},attrs:{shape:[l.batchSize,d/l.batchSize]},backend:t}),h=[l.batchSize,l.outerSize,d/l.batchSize,l.sliceSize],g=t.makeOutput(h,n.dtype);if(y.sizeFromShape(n.shape)===0)return g;let x=m.shape.length-1,C=t.dataIdMap.get(m.dataId).id,k=t.dataIdMap.get(f.dataId).id,_=t.dataIdMap.get(g.dataId).id,E=new Uint8Array(new Int32Array(y.computeStrides(m.shape)).buffer),R=new Uint8Array(new Int32Array(y.computeStrides(h)).buffer);return nM(C,we[n.dtype],E,x,k,l.batchSize,R,_),t.disposeData(m.dataId),t.disposeData(f.dataId),g.shape=l.outputShape,g}var sM={kernelName:aa,backendName:\"wasm\",setupFunc:Boe,kernelFunc:zoe};var Voe=!1,aM=Ue(kn,Voe,\"bool\");var Woe=!1,iM=Ue(Nn,Woe,\"bool\");var uM=he(Tn,\"bool\");var pM=he(_n,\"bool\");var cM=he($n,\"bool\");var lM;function Uoe(r){lM=r.wasm.cwrap(En,null,[\"number\",\"number\",\"number\",\"number\"])}function Goe(r){let{inputs:{x:t},attrs:{alpha:e},backend:o}=r,n=o.dataIdMap.get(t.dataId).id,s=o.makeOutput(t.shape,\"float32\");if(y.sizeFromShape(t.shape)!==0){let a=o.dataIdMap.get(s.dataId).id;lM(n,we[t.dtype],e,a)}return s}var mM={kernelName:En,backendName:\"wasm\",setupFunc:Uoe,kernelFunc:Goe};var Hoe=!1,dM=Ue(Rn,Hoe,\"bool\");var Koe=!1,fM=Ue(Dn,Koe,\"bool\");var hM;function qoe(r){hM=r.wasm.cwrap(An,null,[\"number\",\"number\",\"number\",\"number\"])}function joe(r){let{attrs:t,backend:e}=r,{start:o,stop:n,num:s}=t,a=Math.floor(s),i=e.makeOutput([a],\"float32\");return hM(e.dataIdMap.get(i.dataId).id,o,n,a),i}var gM={kernelName:An,backendName:\"wasm\",setupFunc:qoe,kernelFunc:joe};var xM=he(Fn);var yM=he(Pn);var Xoe=!1,bM=Ue(On,Xoe,\"bool\");var CM=he(Mn);var Yoe=!1,wM=Ue(Ln,Yoe,\"bool\");var Qoe=!1,SM=Ue(E0,Qoe,\"bool\");var IM;function Zoe(r){IM=r.wasm.cwrap(Bn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Joe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o;if(n.dtype!==\"float32\")throw new Error(\"LRN error: x must have dtype float32\");let u=e.makeOutput(n.shape,n.dtype);return IM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(u.dataId).id,n.shape[3],s,a,i,p),u}var vM={kernelName:Bn,backendName:\"wasm\",setupFunc:Zoe,kernelFunc:Joe};var kM;function ene(r){kM=r.wasm.cwrap(Ya,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function tne(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,y:s,dy:a}=t,{depthRadius:i,bias:p,alpha:u,beta:c}=o;if(n.dtype!==\"float32\"||s.dtype!==\"float32\"||a.dtype!==\"float32\")throw new Error(\"LRNGrad error: x, y, and dy must have dtype float32\");let l=e.makeOutput(n.shape,n.dtype);return kM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(a.dataId).id,e.dataIdMap.get(l.dataId).id,a.shape[3],i,p,u,c),l}var NM={kernelName:Ya,backendName:\"wasm\",setupFunc:ene,kernelFunc:tne};var TM;function rne(r){TM=r.wasm.cwrap(zn,null,[\"number\",\"number\",\"number\",\"number\"])}function one(r){let{backend:t,inputs:e,attrs:o}=r,{reductionIndices:n,keepDims:s}=o,{x:a}=e,p=t.dataIdMap.get(a.dataId).id,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t);if(d){let C=t.dataIdMap.get(c.dataId).id;u=c,p=C}let f=u.shape.length;w.assertAxesAreInnerMostDims(\"max\",l,f);let[h,g]=w.computeOutAndReduceShapes(u.shape,l),x=y.sizeFromShape(g),b=t.makeOutput(h,a.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;TM(p,we[a.dtype],x,C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var _M={kernelName:zn,backendName:\"wasm\",setupFunc:rne,kernelFunc:one};var nne=!1,$M=Ue(Vn,nne);var EM;function sne(r){EM=r.wasm.cwrap(Wn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function ane(r){let{inputs:t,attrs:e,backend:o}=r,n=t.x,s=o.dataIdMap.get(n.dataId).id;y.assert(n.dtype===\"float32\",()=>`Error in MaxPool: only float32 input is supported. Got ${n.dtype}.`);let{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=e,c=w.computePool2DInfo(n.shape,a,i,1,p,u),l=c.filterHeight,m=c.filterWidth,d=c.padInfo.top,f=c.padInfo.right,h=c.padInfo.bottom,g=c.padInfo.left,x=c.dilationHeight,b=c.dilationWidth,C=c.strideHeight,S=c.strideWidth,k=c.inChannels,_=c.outChannels;if(c.dataFormat!==\"channelsLast\")throw new Error(`wasm backend does not support dataFormat:'${c.dataFormat}'. Please use 'channelsLast'.`);let E=o.makeOutput(c.outShape,\"float32\"),R=o.dataIdMap.get(E.dataId).id;return EM(s,n.shape[0],n.shape[1],n.shape[2],l,m,d,f,h,g,x,b,C,S,k,_,R),E}var RM={kernelName:Wn,backendName:\"wasm\",setupFunc:sne,kernelFunc:ane};var DM;function ine(r){DM=r.wasm.cwrap(\"MaxPool3D\",null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function une(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,c=w.computePool3DInfo(n.shape,s,a,1,i,p,u),l=e.makeOutput(c.outShape,n.dtype);return DM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,c.batchSize,c.inChannels,c.inDepth,c.inHeight,c.inWidth,c.outDepth,c.outHeight,c.outWidth,c.strideDepth,c.strideHeight,c.strideWidth,c.dilationDepth,c.dilationHeight,c.dilationWidth,c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.front,c.padInfo.top,c.padInfo.left),l}var AM={kernelName:ia,backendName:\"wasm\",setupFunc:ine,kernelFunc:une};var FM;function pne(r){FM=r.wasm.cwrap(\"MaxPool3DGrad\",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 cne(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,c=w.computePool3DInfo(s.shape,a,i,1,p,u),l=e.makeOutput(s.shape,s.dtype);return FM(e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,c.batchSize,c.inChannels,c.inDepth,c.inHeight,c.inWidth,c.outDepth,c.outHeight,c.outWidth,c.strideDepth,c.strideHeight,c.strideWidth,c.dilationDepth,c.dilationHeight,c.dilationWidth,c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.front,c.padInfo.top,c.padInfo.left),l}var PM={kernelName:Ui,backendName:\"wasm\",setupFunc:pne,kernelFunc:cne};var OM;function lne(r){OM=r.wasm.cwrap(\"MaxPoolGrad\",null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function mne(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,c=w.computePool2DInfo(s.shape,a,i,1,p,u),l=e.makeOutput(s.shape,s.dtype);return OM(e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.top,c.padInfo.left),l}var MM={kernelName:Wi,backendName:\"wasm\",setupFunc:lne,kernelFunc:mne};var LM;function dne(r){LM=r.wasm.cwrap(\"MaxPoolWithArgmax\",null,[\"number\",\"number\",\"number\",\"number\",\"boolean\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function fne(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,includeBatchInIndex:p}=o;y.assert(n.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`);let u=[1,1];y.assert(w.eitherStridesOrDilationsAreOne(a,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,[1,1],i),l=e.makeOutput(c.outShape,n.dtype),m=e.makeOutput(c.outShape,\"int32\");return LM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,e.dataIdMap.get(m.dataId).id,we[n.dtype],p,c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.top,c.padInfo.left),[l,m]}var BM={kernelName:ua,backendName:\"wasm\",setupFunc:dne,kernelFunc:fne};var zM;function hne(r){zM=r.wasm.cwrap(Un,null,[\"number, number, number\"])}function gne(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t),f=l;if(d){let S=t.dataIdMap.get(c.dataId).id;S!==i&&(u=c,p=S,f=w.getInnerMostAxes(f.length,u.shape.length))}w.assertAxesAreInnerMostDims(\"mean\",f,u.shape.length);let[h,g]=w.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=u;u.dtype!==\"float32\"&&(b=Or({backend:t,inputs:{x:u},attrs:{dtype:\"float32\"}}),p=t.dataIdMap.get(b.dataId).id);let C=t.makeOutput(h,\"float32\");if(y.sizeFromShape(u.shape)!==0){let S=t.dataIdMap.get(C.dataId).id;zM(p,x,S)}if(d&&t.disposeData(c.dataId),s){let S=w.expandShapeToKeepDim(C.shape,m);C.shape=S}return u.dtype!==\"float32\"&&t.disposeData(b.dataId),C}var VM={kernelName:Un,backendName:\"wasm\",setupFunc:hne,kernelFunc:gne};var WM;function xne(r){WM=r.wasm.cwrap(Gn,null,[\"number\",\"number\",\"number\",\"number\"])}function yne(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t);if(d){let C=t.dataIdMap.get(c.dataId).id;C!==i&&(u=c,p=C)}let f=u.shape.length;w.assertAxesAreInnerMostDims(\"min\",l,f);let[h,g]=w.computeOutAndReduceShapes(u.shape,l),x=y.sizeFromShape(g),b=t.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;WM(p,we[a.dtype],x,C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var UM={kernelName:Gn,backendName:\"wasm\",setupFunc:xne,kernelFunc:yne};var bne=!1,GM=Ue(Hn,bne);var Mv;(function(r){r[r.reflect=0]=\"reflect\",r[r.symmetric=1]=\"symmetric\"})(Mv||(Mv={}));var HM;function Cne(r){HM=r.wasm.cwrap(Kn,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"array\",\"number\",\"number\"])}function wne(r){let{inputs:{x:t},backend:e,attrs:{paddings:o,mode:n}}=r,s=o.map((f,h)=>f[0]+t.shape[h]+f[1]),a=e.dataIdMap.get(t.dataId).id,i=e.makeOutput(s,t.dtype),p=e.dataIdMap.get(i.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),c=o.map(f=>f[0]),l=o.map(f=>f[1]),m=new Uint8Array(new Int32Array(c).buffer),d=new Uint8Array(new Int32Array(l).buffer);return HM(a,u,t.shape.length,we[t.dtype],m,d,Mv[n],p),i}var KM={kernelName:Kn,backendName:\"wasm\",kernelFunc:wne,setupFunc:Cne};var qM;function Sne(r){qM=r.wasm.cwrap(Is,null,[\"number\",\"number\",\"number\",\"number\"])}function Lv(r){let{backend:t,inputs:{logits:e},attrs:{dim:o}}=r,n=t.dataIdMap.get(e.dataId).id,s=t.makeOutput(e.shape,e.dtype),a=t.dataIdMap.get(s.dataId).id,i=e.shape[o],p=y.sizeFromShape(e.shape)/i;return y.sizeFromShape(s.shape)===0||qM(n,a,i,p),s}var jM={kernelName:Is,backendName:\"wasm\",setupFunc:Sne,kernelFunc:Lv};var XM;function Ine(r){XM=r.wasm.cwrap(jn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function vne(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o;if(n.dtype!==\"float32\")throw new Error(`Tensor logits must have dtype float32, got ${n.dtype}`);let p=i?n:Lv({inputs:{logits:n},backend:e,attrs:{dim:n.shape.length-1}}),[u,c]=p.shape,l=e.makeOutput([u,s],\"int32\");return XM(e.dataIdMap.get(p.dataId).id,u,c,s,a,e.dataIdMap.get(l.dataId).id),i||e.disposeData(p.dataId),l}var YM={kernelName:jn,backendName:\"wasm\",setupFunc:Ine,kernelFunc:vne};var QM=Ue(qn,!0);var kne=!0,ZM=Ue(Xn,kne);var JM=he(pa);function Hc(r,t){let e=new Int32Array(r.wasm.HEAPU8.buffer,t,4),o=e[0],n=e[1],s=e[2],a=e[3];return r.wasm._free(t),{pSelectedIndices:o,selectedSize:n,pSelectedScores:s,pValidOutputs:a}}var eL;function Nne(r){eL=r.wasm.cwrap(Qn,\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\"])}function Tne(r){let{backend:t,inputs:e,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a}=o,{boxes:i,scores:p}=e,u=t.dataIdMap.get(i.dataId).id,c=t.dataIdMap.get(p.dataId).id,l=eL(u,c,s,n,a),{pSelectedIndices:m,selectedSize:d,pSelectedScores:f,pValidOutputs:h}=Hc(t,l);return t.wasm._free(f),t.wasm._free(h),t.makeOutput([d],\"int32\",m)}var tL={kernelName:Qn,backendName:\"wasm\",setupFunc:Nne,kernelFunc:Tne};var rL;function _ne(r){rL=r.wasm.cwrap(Qa,\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\",\"bool\"])}function $ne(r){let{backend:t,inputs:e,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,padToMaxOutputSize:i}=o,{boxes:p,scores:u}=e,c=t.dataIdMap.get(p.dataId).id,l=t.dataIdMap.get(u.dataId).id,m=rL(c,l,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Hc(t,m);t.wasm._free(h);let x=t.makeOutput([f],\"int32\",d),b=t.makeOutput([],\"int32\",g);return[x,b]}var oL={kernelName:Qa,backendName:\"wasm\",setupFunc:_ne,kernelFunc:$ne};var nL;function Ene(r){nL=r.wasm.cwrap(Zn,\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Rne(r){let{backend:t,inputs:e,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,softNmsSigma:i}=o,{boxes:p,scores:u}=e,c=t.dataIdMap.get(p.dataId).id,l=t.dataIdMap.get(u.dataId).id,m=nL(c,l,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Hc(t,m);t.wasm._free(g);let x=t.makeOutput([f],\"int32\",d),b=t.makeOutput([f],\"float32\",h);return[x,b]}var sL={kernelName:Zn,backendName:\"wasm\",setupFunc:Ene,kernelFunc:Rne};var Dne=!1,aL=Ue(Yn,Dne,\"bool\");var iL;function Ane(r){iL=r.wasm.cwrap(Jn,null,[\"number\",\"number\",\"number\",\"number\",\"number\"])}function Fne(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n}=t,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=e.makeOutput([...n.shape,a],s),c=e.dataIdMap.get(u.dataId).id,m=e.dataIdMap.get(n.dataId).id;return iL(m,a,i,p,c),u}var uL={kernelName:Jn,backendName:\"wasm\",setupFunc:Ane,kernelFunc:Fne};function Pne(r){let{inputs:{x:t},backend:e}=r,o=e.makeOutput(t.shape,t.dtype);return e.typedArrayFromHeap(o).fill(1),o}var pL={kernelName:ca,backendName:\"wasm\",kernelFunc:Pne};function One(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o;if(t.length===1)return Mg({inputs:{input:t[0]},backend:e,attrs:{dim:n}});let s=t[0].shape,a=t[0].dtype;t.forEach(c=>{y.assertShapesMatch(s,c.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===c.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=t.map(c=>{let l=Mg({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=Fv({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeData(c.dataId)),u}var cL={kernelName:la,backendName:\"wasm\",kernelFunc:One};var lL;function Mne(r){lL=r.wasm.cwrap(es,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"array\",\"number\",\"number\"])}function Lne(r){let{inputs:{x:t},backend:e,attrs:{paddings:o,constantValue:n}}=r,s=o.map((h,g)=>h[0]+t.shape[g]+h[1]);if(y.sizeFromShape(t.shape)===0)return Ov({backend:e,attrs:{shape:s,value:n,dtype:t.dtype}});let a=e.dataIdMap.get(t.dataId).id,i=e.makeOutput(s,t.dtype),u=e.dataIdMap.get(i.dataId).id,c=new Uint8Array(new Int32Array(t.shape).buffer),l=o.map(h=>h[0]),m=o.map(h=>h[1]),d=new Uint8Array(new Int32Array(l).buffer),f=new Uint8Array(new Int32Array(m).buffer);return lL(a,c,t.shape.length,we[t.dtype],d,f,n,u),i}var Lg={kernelName:es,backendName:\"wasm\",kernelFunc:Lne,setupFunc:Mne};var Bne=!1,mL=Ue(ts,Bne);var dL;function zne(r){dL=r.wasm.cwrap(rs,null,[\"number\",\"number\",\"number\"])}function Vne(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t,s=e.dataIdMap.get(o.dataId).id,a=e.dataIdMap.get(n.dataId).id,i=s,p=o,u=p;p.dtype!==\"float32\"&&(u=Or({backend:e,inputs:{x:o},attrs:{dtype:\"float32\"}}),i=e.dataIdMap.get(u.dataId).id);let c=e.makeOutput(o.shape,\"float32\"),l=e.dataIdMap.get(c.dataId).id;return dL(i,a,l),p.dtype!==\"float32\"&&e.disposeData(u.dataId),c}var fL={kernelName:rs,backendName:\"wasm\",setupFunc:zne,kernelFunc:Vne};var hL;function Wne(r){hL=r.wasm.cwrap(os,null,[\"number\",\"number\",\"number\",\"number\"])}function Une(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t),f=l;if(d){let C=t.dataIdMap.get(c.dataId).id;C!==i&&(u=c,p=C,f=w.getInnerMostAxes(f.length,u.shape.length))}w.assertAxesAreInnerMostDims(\"prod\",f,u.shape.length);let[h,g]=w.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=t.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;hL(p,x,we[b.dtype],C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var gL={kernelName:os,backendName:\"wasm\",setupFunc:Wne,kernelFunc:Une};var Gne=r=>{let{backend:t,attrs:e}=r,{start:o,stop:n,step:s,dtype:a}=e,i=ap(o,n,s,a),p=t.makeOutput([i.length],a);return t.typedArrayFromHeap(p).set(i),p},xL={kernelName:ma,backendName:\"wasm\",kernelFunc:Gne};var Hne=!0,yL=Ue(fn,Hne);var bL=he(ns);var CL=he(ss);var wL=he(us);var SL;function Kne(r){SL=r.wasm.cwrap(is,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function qne(r){let{backend:t,inputs:e,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[c,l,m,d]=n.shape,f=[c,p,u,d],h=t.dataIdMap.get(n.dataId),g;h.dtype!==\"float32\"&&(g=Or({backend:t,inputs:{x:n},attrs:{dtype:\"float32\"}}),h=t.dataIdMap.get(g.dataId));let x=h.id,b=t.makeOutput(f,\"float32\");if(y.sizeFromShape(n.shape)===0)return b;let C=t.dataIdMap.get(b.dataId).id;return SL(x,c,l,m,d,p,u,s?1:0,a?1:0,C),g!=null&&t.disposeData(g.dataId),b}var IL={kernelName:is,backendName:\"wasm\",setupFunc:Kne,kernelFunc:qne};var vL;function jne(r){vL=r.wasm.cwrap(Ja,null,[\"number\",\"number\",\"number\",\"array\",\"array\",\"boolean\"])}function Xne(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=e.makeOutput(n.shape,\"float32\"),p=e.dataIdMap.get(n.dataId),u;return p.dtype!==\"float32\"&&(u=Or({backend:e,inputs:{x:n},attrs:{dtype:\"float32\"}}),p=e.dataIdMap.get(u.dataId)),vL(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&e.disposeData(u.dataId),i}var kL={kernelName:Ja,backendName:\"wasm\",setupFunc:jne,kernelFunc:Xne};var NL;function Yne(r){NL=r.wasm.cwrap(as,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Qne(r){let{backend:t,inputs:e,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[c,l,m,d]=n.shape,f=[c,p,u,d],h=t.makeOutput(f,\"float32\");if(y.sizeFromShape(n.shape)===0)return h;let g=t.dataIdMap.get(n.dataId),x;g.dtype!==\"float32\"&&(x=Or({backend:t,inputs:{x:n},attrs:{dtype:\"float32\"}}),g=t.dataIdMap.get(x.dataId));let b=g.id,C=t.dataIdMap.get(h.dataId).id;return NL(b,c,l,m,d,p,u,s?1:0,a?1:0,C),x!=null&&t.disposeData(x.dataId),h}var TL={kernelName:as,backendName:\"wasm\",setupFunc:Yne,kernelFunc:Qne};var _L;function Zne(r){_L=r.wasm.cwrap(Za,null,[\"number\",\"number\",\"number\",\"array\",\"array\",\"boolean\"])}function Jne(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=e.makeOutput(n.shape,\"float32\"),p=e.dataIdMap.get(n.dataId),u;return p.dtype!==\"float32\"&&(u=Or({backend:e,inputs:{x:n},attrs:{dtype:\"float32\"}}),p=e.dataIdMap.get(u.dataId)),_L(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&e.disposeData(u.dataId),i}var $L={kernelName:Za,backendName:\"wasm\",setupFunc:Zne,kernelFunc:Jne};var EL;function ese(r){EL=r.wasm.cwrap(ps,null,[\"number\",\"array\",\"number\",\"array\",\"number\",\"number\"])}function tse(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o,a=y.parseAxisParam(s,n.shape);if(n.shape.length===0)return vp({inputs:{x:n},backend:e});let i=e.makeOutput(n.shape,n.dtype),p=e.dataIdMap.get(n.dataId).id,u=e.dataIdMap.get(i.dataId).id,c=new Uint8Array(new Int32Array(a).buffer),l=new Uint8Array(new Int32Array(n.shape).buffer);EL(p,c,a.length,l,n.shape.length,u);let m=zt({inputs:{x:i},attrs:{shape:n.shape},backend:e});return e.disposeData(i.dataId),m}var RL={kernelName:ps,backendName:\"wasm\",kernelFunc:tse,setupFunc:ese};var DL;function rse(r){DL=r.wasm.cwrap(Ds,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\"])}function ose(r){let{inputs:t,backend:e,attrs:o}=r,{image:n}=t,{radians:s,fillValue:a,center:i}=o,p=e.makeOutput(n.shape,n.dtype),u=e.dataIdMap.get(n.dataId).id,c=e.dataIdMap.get(p.dataId).id,[l,m,d,f]=n.shape,[h,g]=w.getImageCenter(i,m,d),x=a===0,b=255,C=typeof a==\"number\"?[a,a,a,x?0:b]:[...a,b],S=new Uint8Array(new Int32Array(C).buffer);return DL(u,l,m,d,f,s,h,g,S,C.length,c),p}var AL={kernelName:Ds,backendName:\"wasm\",kernelFunc:ose,setupFunc:rse};var FL=he(cs);var PL=he(ls);var OL;function nse(r){OL=r.wasm.cwrap(ms,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\"])}function sse(r){let{backend:t,inputs:e,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,i=t.makeOutput(a,s.dtype);if(y.sizeFromShape(a)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=lu.calculateShapes(s,n,a),f=t.dataIdMap.get(n.dataId).id,g=t.dataIdMap.get(s.dataId).id,x=new Uint8Array(new Int32Array(l).buffer),b=t.dataIdMap.get(i.dataId).id;return OL(f,g,we[s.dtype],p,u,c,x,m,b),i}var ML={kernelName:ms,backendName:\"wasm\",setupFunc:nse,kernelFunc:sse};var LL;function ase(r){LL=r.wasm.cwrap(fs,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"bool\",\"number\"])}function ise(r){let{inputs:t,backend:e,attrs:o}=r,{sortedSequence:n,values:s}=t,{side:a}=o;if(n.dtype!==s.dtype)throw new Error(`SearchSorted error: sorted_sequence must have the same dtype as values. Got ${n.dtype} and ${s.dtype}`);let i=e.makeOutput(s.shape,\"int32\");function p(u){return e.dataIdMap.get(u.dataId).id}return LL(p(n),p(s),n.shape[0],n.shape[1],s.shape[1],we[n.dtype],a===\"left\",p(i)),i}var BL={kernelName:fs,backendName:\"wasm\",setupFunc:ase,kernelFunc:ise};var zL;function use(r){zL=r.wasm.cwrap(\"SelectV2\",null,[\"number\",\"number\",\"number\",\"number\",\"number\"])}function pse(r){let{inputs:t,backend:e}=r,{condition:o,t:n,e:s}=t,a=e.dataIdMap.get(o.dataId).id,i=e.dataIdMap.get(n.dataId).id,p=e.dataIdMap.get(s.dataId).id,u=e.makeOutput(n.shape,n.dtype),c=e.dataIdMap.get(u.dataId).id,l=o.shape.length,m=n.shape.length,d=l===0||l>1||m===1?1:y.sizeFromShape(n.shape.slice(1));return zL(a,i,p,d,c),u}var VL={kernelName:fa,backendName:\"wasm\",kernelFunc:pse,setupFunc:use};var WL=he(hs);var UL;function cse(r){UL=r.wasm.cwrap(bs,null,[\"number\",\"number\"])}function lse(r){let{backend:t,inputs:{x:e}}=r,o=t.dataIdMap.get(e.dataId).id,n=t.makeOutput(e.shape,e.dtype),s=t.dataIdMap.get(n.dataId).id;return y.sizeFromShape(n.shape)===0||UL(o,s),n}var GL={kernelName:\"Sigmoid\",backendName:\"wasm\",setupFunc:cse,kernelFunc:lse};var HL=he(ys);var KL=he(gs);var qL=he(xs);var jL=he(Cs);function mse(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,paddings:a}=o,i=y.sizeFromShape(s),p=[[0,0]];p.push(...a);for(let _=1+s.length;_0?p+1:0;if(c<0)throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let l=n.shape.slice();l[0]=c;let m=e.dataIdMap.get(n.dataId).id,d=e.dataIdMap.get(s.dataId).id,f=e.dataIdMap.get(a.dataId).id,h=e.makeOutput(l,n.dtype),g=e.dataIdMap.get(h.dataId).id,x=e.makeOutput([4],\"int32\"),b=e.dataIdMap.get(x.dataId).id;eB(m,we[n.dtype],n.shape[0],d,f,g,b,t,0);let C=e.readSync(x.dataId),S;switch(C[0]){case 0:{S=w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage();break}case 1:{S=w.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage();break}case 2:S=w.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(C[1],C[2]);break;case 3:S=w.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(C[1],C[2],C[3]);break;default:S=\"\"}if(e.disposeData(x.dataId),S)throw e.disposeData(h.dataId),new Error(S);return h}function xse(r){return zg(r,!0)}var tB={kernelName:ya,backendName:\"wasm\",setupFunc:Bg,kernelFunc:xse};function yse(r){return zg(r,!1)}var rB={kernelName:ba,backendName:\"wasm\",setupFunc:Bg,kernelFunc:yse};var oB;function bse(r){oB=r.wasm.cwrap(vs,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\"])}function Cse(r){let{backend:t,inputs:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,p=t.makeOutput(i,a.dtype);if(y.sizeFromShape(i)===0)return p;let{sliceRank:u,numUpdates:c,sliceSize:l,strides:m,outputSize:d}=w.calculateShapes(s,n,i),f=t.dataIdMap.get(n.dataId).id,h=t.dataIdMap.get(s.dataId).id,g=t.dataIdMap.get(a.dataId).id,x=new Uint8Array(new Int32Array(m).buffer),b=t.dataIdMap.get(p.dataId).id;return oB(f,h,s.shape.length,g,we[a.dtype],u,c,l,x,d,b),p}var nB={kernelName:vs,backendName:\"wasm\",setupFunc:bse,kernelFunc:Cse};function wse(r){let{inputs:t,attrs:e,backend:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=e,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),c=n.shape.slice();return p.map(l=>{let m=[...c];m[i]=l;let d=Po({inputs:{x:n},attrs:{begin:u,size:m},backend:o});return u[i]+=l,d})}var sB={kernelName:xa,backendName:\"wasm\",kernelFunc:wse};var aB=he(ws);var iB=he(Ki);var Sse=!0,uB=Ue(ks,Sse);var pB;function Ise(r){pB=r.wasm.cwrap(wo,null,[\"number\",\"number\",\"number\",\"number\"])}function vse(r){let{backend:t,inputs:e,attrs:o}=r,{alpha:n}=o,{x:s}=e,a=t.dataIdMap.get(s.dataId).id,i=t.makeOutput(s.shape,s.dtype),p=t.dataIdMap.get(i.dataId).id;return pB(a,n,we[s.dtype],p),i}var cB={kernelName:wo,backendName:\"wasm\",setupFunc:Ise,kernelFunc:vse};var lB;function kse(r){lB=r.wasm.cwrap(Ns,null,[\"number\",\"array\",\"number\",\"array\",\"array\",\"array\",\"array\",\"array\",\"number\",\"number\"])}function Nse(r){let{backend:t,inputs:e,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=zt({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let _=pt.computeOutShape(b,C,S),E=Po({inputs:{x:n},backend:t,attrs:{begin:b,size:_}});k=zt({inputs:{x:E},backend:t,attrs:{shape:f}}),t.disposeData(E.dataId)}else{let _=t.makeOutput(d,\"float32\"),E=t.dataIdMap.get(n.dataId).id,R=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),D=new Uint8Array(new Int32Array(b).buffer),P=new Uint8Array(new Int32Array(C).buffer),O=new Uint8Array(new Int32Array(S).buffer),M=new Uint8Array(new Int32Array(d).buffer),L=new Uint8Array(new Int32Array(y.computeStrides(d)).buffer),B=t.dataIdMap.get(_.dataId).id;lB(E,R,n.shape.length,D,P,O,M,L,d.length,B),k=zt({inputs:{x:_},backend:t,attrs:{shape:f}}),t.disposeData(_.dataId)}return k}var mB={kernelName:Ns,backendName:\"wasm\",setupFunc:kse,kernelFunc:Nse};function Tse(r){let{backend:t,inputs:e,attrs:o}=r,{data:n,dataSplits:s}=e,{separator:a,nGramWidths:i,leftPad:p,rightPad:u,padWidth:c,preserveShortSequences:l}=o,m=t.readSync(n.dataId),d=t.readSync(s.dataId),[f,h]=up(m,d,a,i,p,u,c,l),g=t.makeOutput([f.length],\"string\"),x=t.dataIdMap.get(g.dataId);x.stringBytes=f;let b=t.makeOutput(s.shape,\"int32\");return t.typedArrayFromHeap(b).set(h),[g,b]}var dB={kernelName:Ca,backendName:\"wasm\",kernelFunc:Tse};function _se(r){let{backend:t,inputs:e,attrs:o}=r,{input:n,delimiter:s}=e,{skipEmpty:a}=o,i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,c,l]=pp(i,p[0],a),m=c.length,d=t.makeOutput([m,2],\"int32\");t.typedArrayFromHeap(d).set(u);let h=t.makeOutput([m],\"string\"),g=t.dataIdMap.get(h.dataId);g.stringBytes=c;let x=t.makeOutput([2],\"int32\");return t.typedArrayFromHeap(x).set(l),[d,h,x]}var fB={kernelName:qi,backendName:\"wasm\",kernelFunc:_se};function $se(r){let{backend:t,inputs:e,attrs:o}=r,{input:n}=e,{numBuckets:s}=o,a=t.readSync(n.dataId),i=cp(a,s),p=t.makeOutput(n.shape,\"int32\");return t.typedArrayFromHeap(p).set(i),p}var hB={kernelName:ji,backendName:\"wasm\",kernelFunc:$se};var Ese=!0,gB=Ue(Ts,Ese);var xB;function Rse(r){xB=r.wasm.cwrap(Ss,null,[\"number\",\"number\",\"number\",\"number\"])}function Dse(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t),f=l;if(d){let C=t.dataIdMap.get(c.dataId).id;C!==i&&(u=c,p=C,f=w.getInnerMostAxes(f.length,u.shape.length))}w.assertAxesAreInnerMostDims(\"sum\",f,u.shape.length);let[h,g]=w.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=t.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;xB(p,x,we[b.dtype],C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var yB={kernelName:Ss,backendName:\"wasm\",setupFunc:Rse,kernelFunc:Dse};var bB=he(_s);var CB=he($s);var wB;function Ase(r){wB=r.wasm.cwrap(ds,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\"])}function Fse(r){let{backend:t,inputs:e,attrs:o}=r,{tensor:n,indices:s,updates:a}=e,{}=o,i=t.makeOutput(n.shape,n.dtype);if(y.sizeFromShape(n.shape)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=lu.calculateShapes(a,s,n.shape),f=t.dataIdMap.get(s.dataId).id,g=t.dataIdMap.get(a.dataId).id,b=t.dataIdMap.get(n.dataId).id,C=new Uint8Array(new Int32Array(l).buffer),S=t.dataIdMap.get(i.dataId).id;return wB(f,g,we[a.dtype],p,u,c,C,m,S,b),i}var SB={kernelName:ds,backendName:\"wasm\",setupFunc:Ase,kernelFunc:Fse};var IB;function Pse(r){IB=r.wasm.cwrap(uo,null,[\"number\",\"array\",\"number\",\"array\",\"number\",\"number\"])}function Ose(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,s=e.dataIdMap.get(n.dataId).id,{reps:a}=o,i=new Array(n.shape.length);for(let m=0;m{let{x:o}=r,{k:n,sorted:s}=e,a=t.dataIdMap.get(o.dataId).id,i=new Uint8Array(new Int32Array(o.shape).buffer),p=o.shape.slice();p[p.length-1]=n;let u=t.makeOutput(p,o.dtype),c=t.dataIdMap.get(u.dataId).id,l=t.makeOutput(p,\"int32\"),m=t.dataIdMap.get(l.dataId).id;return kB(a,i,o.shape.length,we[o.dtype],n,s,c,m),[u,l]},NB={kernelName:Es,backendName:\"wasm\",setupFunc:Mse,kernelFunc:Lse};var TB;function Bse(r){TB=r.wasm.cwrap(Rs,null,[\"number\",\"number\",\"bool\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"array\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function zse(r){let{backend:t,inputs:e,attrs:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),b=new Uint8Array(new Int32Array(y.computeStrides(g)).buffer),C=t.makeOutput(g,n.dtype),S=t.dataIdMap.get(C.dataId).id,_=t.dataIdMap.get(n.dataId).id,R=t.dataIdMap.get(s.dataId).id,D=a===\"nearest\"?1:2,P;switch(i){case\"constant\":P=1;break;case\"reflect\":P=2;break;case\"wrap\":P=3;break;case\"nearest\":P=4;break;default:P=1;break}return TB(_,R,s.shape[0]>1,c,f,h,d,m,l,x,n.shape.length-1,b,g.length-1,D,P,p,S),C}var _B={kernelName:Rs,backendName:\"wasm\",setupFunc:Bse,kernelFunc:zse};function Vse(r){let{inputs:t,attrs:e,backend:o}=r,{axis:n}=e,{x:s}=t,{outputValues:a,outputShape:i,indices:p}=lp(o.readSync(s.dataId),n,s.shape,s.dtype);return[o.makeOutput(i,s.dtype,void 0,a),o.makeOutput([p.length],\"int32\",void 0,p)]}var $B={kernelName:Xi,backendName:\"wasm\",kernelFunc:Vse};function Wse(r){let{inputs:t,backend:e,attrs:o}=r,{value:n}=t,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n.shape[s],i=n.shape.length,p=new Array(i-1),u=0;for(let d=0;d({dataId:d,dtype:f,shape:p}))}var EB={kernelName:wa,backendName:\"wasm\",kernelFunc:Wse};function Use(r){let{inputs:{x:t},backend:e}=r,o=e.makeOutput(t.shape,t.dtype);return e.typedArrayFromHeap(o).fill(0),o}var RB={kernelName:Sa,backendName:\"wasm\",kernelFunc:Use};var Gse=[gP,xP,yP,bP,CP,SP,TP,$P,EP,RP,DP,AP,FP,PP,OP,LP,GP,zP,WP,qP,XP,QP,ZP,JP,eO,tO,oO,nO,aO,uO,cO,mO,fO,hO,gO,yO,CO,SO,vO,NO,_O,EO,DO,FO,OO,MO,BO,zO,VO,WO,UO,GO,HO,qO,jO,XO,QO,JO,tM,oM,sM,aM,iM,IP,uM,pM,cM,mM,dM,fM,gM,yM,xM,bM,CM,wM,SM,vM,NM,_M,$M,RM,AM,PM,MM,BM,VM,UM,GM,KM,YM,QM,ZM,JM,tL,oL,sL,aL,uL,pL,cL,Lg,mL,fL,gL,xL,yL,bL,CL,wL,HP,IL,kL,TL,$L,RL,AL,FL,PL,ML,BL,VL,WL,GL,HL,KL,qL,jP,jM,jL,XL,QL,JL,tB,rB,nB,sB,aB,iB,uB,cB,mB,dB,fB,hB,gB,yB,bB,CB,SB,vB,NB,_B,kP,$B,EB,RB];for(let r of Gse)ti(r);var Bv=A();Bv.registerFlag(\"WASM_HAS_SIMD_SUPPORT\",async()=>{try{return 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]))}catch(r){return!1}});Bv.registerFlag(\"WASM_HAS_MULTITHREAD_SUPPORT\",async()=>{if(Bv.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(r){return!1}});var qv=Lp(PB()),VB=Lp(MB()),jv=Lp(LB());var BB=qv.default||qv,Hse=jv.default||jv,im=class extends so{constructor(t){super(),this.wasm=t,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(UB),Kv=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new Bo(this,ur())}write(t,e,o){let n={id:this.dataIdNextNumber++};return this.move(n,t,e,o,1),n}numDataIds(){return this.dataIdMap.numDataIds()}async time(t){let e=y.now();return t(),{kernelMs:y.now()-e}}move(t,e,o,n,s){let a=this.dataIdNextNumber++;if(n===\"string\"){let c=e;this.dataIdMap.set(t,{id:a,stringBytes:c,shape:o,dtype:n,memoryOffset:null,refCount:s});return}let i=y.sizeFromShape(o),p=i*y.bytesPerElement(n),u=this.wasm._malloc(p)>>>0;this.dataIdMap.set(t,{id:a,memoryOffset:u,shape:o,dtype:n,refCount:s}),this.wasm.tfjs.registerTensor(a,i,u),e!=null&&this.wasm.HEAPU8.set(new Uint8Array(e.buffer,e.byteOffset,p),u)}async read(t){return this.readSync(t)}readSync(t,e,o){let{memoryOffset:n,dtype:s,shape:a,stringBytes:i}=this.dataIdMap.get(t);if(s===\"string\")return(e==null||e===0)&&(o==null||o>=i.length)?i:i.slice(e,o);e=e||0,o=o||y.sizeFromShape(a);let p=y.bytesPerElement(s),u=this.wasm.HEAPU8.slice(n+e*p,n+o*p);return qse(u.buffer,s)}disposeData(t,e=!1){if(this.dataIdMap.has(t)){let o=this.dataIdMap.get(t);if(o.refCount--,!e&&o.refCount>0)return!1;this.wasm._free(o.memoryOffset),this.wasm.tfjs.disposeData(o.id),this.dataIdMap.delete(t)}return!0}refCount(t){return this.dataIdMap.has(t)?this.dataIdMap.get(t).refCount:0}incRef(t){let e=this.dataIdMap.get(t);e!=null&&e.refCount++}floatPrecision(){return 32}getMemoryOffset(t){return this.dataIdMap.get(t).memoryOffset}dispose(){this.wasm.tfjs.dispose(),\"PThread\"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(t,e,o,n){let s;if(o==null)s=this.write(n!=null?n:null,t,e);else{let a=this.dataIdNextNumber++;s={id:a},this.dataIdMap.set(s,{id:a,memoryOffset:o,shape:t,dtype:e,refCount:1});let i=y.sizeFromShape(t);this.wasm.tfjs.registerTensor(a,i,o)}return{dataId:s,shape:t,dtype:e}}typedArrayFromHeap({shape:t,dtype:e,dataId:o}){let n=this.wasm.HEAPU8.buffer,{memoryOffset:s}=this.dataIdMap.get(o),a=y.sizeFromShape(t);switch(e){case\"float32\":return new Float32Array(n,s,a);case\"int32\":return new Int32Array(n,s,a);case\"bool\":return new Uint8Array(n,s,a);default:throw new Error(`Unknown dtype ${e}`)}}};function Kse(r){return(t,e)=>(y.fetch(r,{credentials:\"same-origin\"}).then(o=>{o.ok||t.env.a(`failed to load wasm binary file at '${r}'`),o.arrayBuffer().then(n=>{WebAssembly.instantiate(n,t).then(s=>{e(s.instance,s.module)})})}),{})}function zB(r,t,e){if(Ug!=null)return Ug;let o=\"tfjs-backend-wasm.wasm\";return r&&t?o=\"tfjs-backend-wasm-threaded-simd.wasm\":r&&(o=\"tfjs-backend-wasm-simd.wasm\"),sm!=null&&sm[o]!=null?sm[o]:e+o}async function WB(){let[r,t]=await Promise.all([A().getAsync(\"WASM_HAS_SIMD_SUPPORT\"),A().getAsync(\"WASM_HAS_MULTITHREAD_SUPPORT\")]);return new Promise((e,o)=>{let n={};n.locateFile=(i,p)=>{if(i.endsWith(\".worker.js\")){let u=VB.wasmWorkerContents.replace(/\\n/g,\"\\\\n\"),c=new Blob([u],{type:\"application/javascript\"});return URL.createObjectURL(c)}return i.endsWith(\".wasm\")?zB(r,t,nm!=null?nm:p):p+i},Xv&&(n.instantiateWasm=Kse(zB(r,t,nm!=null?nm:\"\")));let s=!1;n.onAbort=()=>{if(s||am)return;am=!0,o({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 a;t&&r&&Ug==null?(n.mainScriptUrlOrBlob=new Blob([\"var WasmBackendModuleThreadedSimd = \"+BB.toString()],{type:\"text/javascript\"}),a=BB(n)):a=Hse(n),a.then(i=>{s=!0,am=!1;let p=null;i.tfjs={init:i.cwrap(\"init\",null,[]),initWithThreadsCount:i.cwrap(\"init_with_threads_count\",null,[\"number\"]),getThreadsCount:i.cwrap(\"get_threads_count\",\"number\",[]),registerTensor:i.cwrap(\"register_tensor\",null,[\"number\",\"number\",\"number\"]),disposeData:i.cwrap(\"dispose_data\",p,[\"number\"]),dispose:i.cwrap(\"dispose\",p,[])},e({wasm:i})}).catch(o)})}function qse(r,t){switch(t){case\"float32\":return new Float32Array(r);case\"int32\":return new Int32Array(r);case\"bool\":return new Uint8Array(r);default:throw new Error(`Unknown dtype ${t}`)}}var jse=[\"tfjs-backend-wasm.wasm\",\"tfjs-backend-wasm-simd.wasm\",\"tfjs-backend-wasm-threaded-simd.wasm\"],Ug=null,nm=null,sm={},am=!1,Xv=!1;function Xse(r,t=!1){if(Pw(\"setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release.\"),am)throw new Error(\"The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`\");Ug=r,Xv=t}function Yse(r,t=!1){if(am)throw new Error(\"The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`\");if(typeof r==\"string\")nm=r;else{sm=r;let e=jse.filter(o=>sm[o]==null);if(e.length>0)throw new Error(`There were no entries found for the following binaries: ${e.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.`)}Xv=t}var UB=-1,Kv=-1;function Qse(r){UB=r}function Zse(){if(Kv===-1)throw new Error(\"WASM backend not initialized.\");return Kv}var Jse=\"4.14.0\";var eae=2;tu(\"wasm\",async()=>{let{wasm:r}=await WB();return new im(r)},eae);var go=A();go.registerFlag(\"WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE\",()=>15);go.registerFlag(\"WEBGPU_CPU_FORWARD\",()=>!0);go.registerFlag(\"WEBGPU_MATMUL_PROGRAM_TYPE\",()=>-1);go.registerFlag(\"WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE\",()=>!0);go.registerFlag(\"WEBGPU_USE_LOW_POWER_GPU\",()=>!1);go.registerFlag(\"WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD\",()=>1e3);go.registerFlag(\"WEBGPU_USE_PROFILE_TOOL\",()=>!1);go.registerFlag(\"WEBGPU_IMPORT_EXTERNAL_TEXTURE\",()=>!0);go.registerFlag(\"WEBGPU_USE_NAIVE_CONV2D_DEBUG\",()=>!1);go.registerFlag(\"WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL\",()=>-1);go.registerFlag(\"WEBGPU_CONV_SEPARATE_IM2COL_SHADER\",()=>!1);go.registerFlag(\"WEBGPU_PRINT_SHADER\",()=>\"\");go.registerFlag(\"WEBGPU_ENGINE_COMPILE_ONLY\",()=>!1);var Gg=class{constructor(t){t&&(this.vendor=t.vendor,this.architecture=t.architecture,this.intelGPUGeneration=this.getIntelGPUGeneration())}getIntelGPUGeneration(){if(this.isIntel()){if(this.architecture.startsWith(\"gen\"))return Number(this.architecture.match(/\\d+/));if(this.architecture.startsWith(\"xe\"))return 12}return 0}isIntel(){return this.vendor===\"intel\"}};var Hg=class{constructor(t){this.device=t,this.numUsedBuffers=0,this.numFreeBuffers=0,this.freeBuffers=new Map,this.usedBuffers=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireBuffer(t,e,o=!1,n=!0){let s,a=GB(t,e);return n?(this.freeBuffers.has(a)||this.freeBuffers.set(a,[]),this.freeBuffers.get(a).length>0?(s=this.freeBuffers.get(a).pop(),this.numFreeBuffers--):(s=this.device.createBuffer({size:t,usage:e,mappedAtCreation:o}),this.numBytesAllocated+=t)):(s=this.device.createBuffer({size:t,usage:e,mappedAtCreation:o}),this.numBytesAllocated+=t),this.usedBuffers.has(a)||this.usedBuffers.set(a,[]),this.usedBuffers.get(a).push(s),this.numUsedBuffers++,this.numBytesUsed+=t,s}releaseBuffer(t,e=!0){if(this.freeBuffers.size===0)return;let o=t.size,n=t.usage,s=GB(o,n),a=this.usedBuffers.get(s),i=a.indexOf(t);if(i<0)throw new Error(\"Cannot find the buffer in buffer manager\");a[i]=a[a.length-1],a.pop(),this.numUsedBuffers--,this.numBytesUsed-=o,e?(this.freeBuffers.get(s).push(t),this.numFreeBuffers++):(t.destroy(),this.numBytesAllocated-=o)}getNumUsedBuffers(){return this.numUsedBuffers}getNumFreeBuffers(){return this.numFreeBuffers}dispose(){this.freeBuffers.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.usedBuffers.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.freeBuffers=new Map,this.usedBuffers=new Map,this.numUsedBuffers=0,this.numFreeBuffers=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function GB(r,t){return`${r}_${t}`}var Kg=class{constructor(t){this.device=t,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures=new Map,this.usedTextures=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireTexture(t,e,o,n){let s=KB(o),a=t*e*s,i=HB(t,e,o,n);if(this.freeTextures.has(i)||this.freeTextures.set(i,[]),this.usedTextures.has(i)||this.usedTextures.set(i,[]),this.numBytesUsed+=a,this.numUsedTextures++,this.freeTextures.get(i).length>0){this.numFreeTextures--;let u=this.freeTextures.get(i).shift();return this.usedTextures.get(i).push(u),u}this.numBytesAllocated+=a;let p=this.device.createTexture({size:[t,e],format:o,usage:n});return this.usedTextures.get(i).push(p),p}releaseTexture(t){if(this.freeTextures.size===0)return;let e=t.width,o=t.height,n=t.format,s=t.usage,a=HB(e,o,n,s);this.freeTextures.has(a)||this.freeTextures.set(a,[]),this.freeTextures.get(a).push(t),this.numFreeTextures++,this.numUsedTextures--;let i=this.usedTextures.get(a),p=i.indexOf(t);if(p<0)throw new Error(\"Cannot release a texture that was never provided by this texture manager\");i.splice(p,1);let u=KB(n),c=e*o*u;this.numBytesUsed-=c}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){this.freeTextures.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.usedTextures.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.freeTextures=new Map,this.usedTextures=new Map,this.numUsedTextures=0,this.numFreeTextures=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function HB(r,t,e,o){return`${r}_${t}_${e}_${o}`}function KB(r){if(r===\"rgba8unorm\")return 16;throw new Error(`${r} is not supported!`)}function qB(r,t){if(Math.max(...r)>5)throw new Error(\"Cannot symbolically compute strides for rank > 6 tensor.\");let e=r.length,o=\"xyzwuv\",n=r.map(a=>`${t}.${o[a]}`),s=new Array(e-1);s[e-2]=n[e-1];for(let a=e-3;a>=0;--a)s[a]=`(${s[a+1]} * ${n[a+1]})`;return s}var Yr=(r,t,e)=>e===\"int32\"?`atomicAdd(${r}, bitcast(${t}));`:`\n {\n var oldValue = 0;\n loop {\n let newValueF32 = bitcast(oldValue) + (${t});\n let newValue = bitcast(newValueF32);\n let res = atomicCompareExchangeWeak(${r}, oldValue, newValue);\n if res.exchanged {\n break;\n }\n oldValue = res.old_value;\n }\n }`;var Ci;(function(r){r[r.FROM_PIXELS=0]=\"FROM_PIXELS\",r[r.DRAW=1]=\"DRAW\"})(Ci||(Ci={}));var QB=(r,t,e,o,n)=>{let s={dtype:o.dtype,shape:o.shape},a=rae(e,s,t),i=r.createShaderModule({code:a,label:t.constructor.name}),p=A().get(\"WEBGPU_PRINT_SHADER\");if(p!==\"\"){p=p.toLowerCase();let u=p.split(\",\");(p===\"all\"||u.some(c=>t.shaderKey.toLowerCase().includes(c)))&&(console.group(t.shaderKey),console.debug(a),console.groupEnd())}return n?r.createComputePipelineAsync({compute:{module:i,entryPoint:\"_start\"},label:t.constructor.name,layout:\"auto\"}):r.createComputePipeline({compute:{module:i,entryPoint:\"_start\"},label:t.constructor.name,layout:\"auto\"})},Ae=(r,t=\"f32\")=>{switch(r){case 1:return`${t}`;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw new Error(`${r}-component ${t} is not supported.`)}};function ft(r){if(r<=1)return\"i32\";if(r===2)return\"vec2\";if(r===3)return\"vec3\";if(r===4)return\"vec4\";if(r===5)return\"vec5\";if(r===6)return\"vec6\";throw Error(`GPU for rank ${r} is not yet supported`)}function Oo(r){if(r===0)return\"x\";if(r===1)return\"y\";if(r===2)return\"z\";if(r===3)return\"w\";if(r===4)return\"u\";if(r===5)return\"v\";throw Error(`Index ${r} is not yet supported`)}function G(...r){let t;switch(r.length){case 0:t=`\n fn main()\n `;break;case 1:t=`\n fn main(${r[0]} : i32)\n `;break;default:throw Error(\"Unreachable\")}return t}function jB(r,t){let e;return e=`\n ${tae(t)}\n fn _start(@builtin(local_invocation_id) LocalId : vec3,\n @builtin(global_invocation_id) GlobalId : vec3,\n @builtin(local_invocation_index) LocalIndex: u32,\n @builtin(workgroup_id) WorkgroupId : vec3,\n @builtin(num_workgroups) NumWorkgroups : vec3) {\n localId = LocalId;\n localIndex = LocalIndex;\n globalId = GlobalId;\n numWorkgroups = NumWorkgroups;\n workgroupId = WorkgroupId;\n ${r?\"main(getGlobalIndex());\":\"main();\"};\n }\n `,e}function tae(r){return`\n @compute @workgroup_size(${r.workgroupSize[0]}, ${r.workgroupSize[1]}, ${r.workgroupSize[2]})\n`}function rae(r,t,e){let o=[],n=e.workgroupSize[0]*e.workgroupSize[1]*e.workgroupSize[2];if(e.outputComponent=e.outputComponent?e.outputComponent:1,o.push(`\n\n var localId: vec3;\n var localIndex: u32;\n var globalId: vec3;\n var numWorkgroups: vec3;\n var workgroupId: vec3;\n\n // Only used when the y/z dimension of workgroup size is 1.\n fn getGlobalIndex() -> i32 {\n ${JB(e)?\" return i32(globalId.x);\":` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y +\n workgroupId.y * numWorkgroups.x + workgroupId.x) * ${n}u +\n localIndex);\n `}\n }\n `),e.pixelsOpType!=null){let f=e.pixelsOpType===Ci.FROM_PIXELS?`@group(0) @binding(0) var result: array<${Cu(t.dtype,e.outputComponent)}>;`:`@group(0) @binding(1) var inBuf : array<${Cu(r[0].dtype,e.outputComponent)}>;`,h=t.shape.length===3?\"vec2\":\"i32\";o.push(`\n struct Uniform {\n outShapeStrides : ${h},\n size : i32,\n numChannels : i32,\n alpha : f32,\n };\n\n ${f}\n @group(0) @binding(2) var uniforms: Uniform;\n `);let g=YB(e);return[XB,o.join(`\n`),um(t.shape),e.getUserCode(),jB(g,e)].join(`\n`)}let s,a,i=\"struct Uniforms { NAN : f32, INFINITY : f32, \";e.variableNames.forEach((f,h)=>{let g=ft(r[h].shape.length);i+=`${f.charAt(0).toLowerCase()+f.slice(1)}Shape : ${g}, `,s=r[h].shape.length-1,a=ft(s),i+=`${f.charAt(0).toLowerCase()+f.slice(1)}ShapeStrides: ${a}, `});let p=ft(t.shape.length);i+=`outShape : ${p}, `,s=t.shape.length-1,a=ft(s),i+=`\n outShapeStrides: ${a}, `,e.size&&(i+=\"size : i32, \"),e.uniforms&&(i+=e.uniforms),i+=\"};\",i=cae(i),o.push(i),e.atomic?o.push(`\n @group(0) @binding(0) var result: array>;\n `):o.push(`\n @group(0) @binding(0) var result: array<${Cu(t.dtype,e.outputComponent)}>;\n `),e.variableNames.forEach((f,h)=>{o.push(`\n @group(0) @binding(${1+h}) var ${f}: array<${e.variableComponents?Cu(r[h].dtype,e.variableComponents[h]):Cu(r[h].dtype,e.outputComponent)}>;\n `)}),i!==\"\"&&o.push(`\n @group(0) @binding(${1+e.variableNames.length}) var uniforms: Uniforms;\n `);let u=iae(t.shape,e.dispatchLayout),c=[XB,o.join(`\n`)+oae,um(t.shape),u,uae(t.shape.length)];e.atomic||c.push(pae(t.shape,t.dtype,e.outputComponent)),e.variableNames.forEach((f,h)=>{c.push(`${um(r[h].shape,f)}`)});let l=r.map((f,h)=>aae(f,t.shape,e.variableComponents?e.variableComponents[h]:e.outputComponent,e.dispatchLayout.x.length===t.shape.length)).join(`\n`);c.push(l),c.push(e.getUserCode());let m=YB(e);return c.push(jB(m,e)),c.join(`\n`)}function ZB(r,t,e){let o=r.shaderKey;if(r.pixelsOpType!=null)return o;let n=[],s=[];t.forEach(c=>{n.push(c.shape),s.push(c.dtype)}),n.push(e.shape),s.push(e.dtype);let a=t.map(c=>w.getBroadcastDims(c.shape,e.shape)),i=t.map(c=>y.arraysEqual(c.shape,e.shape)).join(\"_\"),p=a.map(c=>c.join(\"_\")).join(\";\"),u=JB(r)?\"flatDispatch\":\"\";return o+=\"_\"+(r.workgroupSize?r.workgroupSize.join(\",\"):\"\")+n.map(c=>c.length).join(\",\")+s.join(\",\")+r.variableNames.join(\",\")+p+i+u,o}var XB=`\n struct vec5 {x: i32, y: i32, z: i32, w: i32, u: i32};\n struct vec6 {x: i32, y: i32, z: i32, w: i32, u: i32, v: i32};\n\n // Checks whether coordinates lie within the bounds of the shape.\n fn coordsInBounds2D(coord : vec2, shape : vec2) -> bool {\n return all(coord >= vec2(0)) && all(coord < shape);\n }\n fn coordsInBounds3D(coord : vec3, shape : vec3) -> bool {\n return all(coord >= vec3(0)) && all(coord < shape);\n }\n fn coordsInBounds4D(coord : vec4, shape : vec4) -> bool {\n return all(coord >= vec4(0)) && all(coord < shape);\n }\n\n fn getIndexFromCoords1D(coord : i32, shape : i32) -> i32 {\n return coord;\n }\n fn getIndexFromCoords2D(coords : vec2, shape : vec2) -> i32 {\n return dot(coords, vec2(shape.y, 1));\n }\n fn getIndexFromCoords3D(coords : vec3, shape : vec3) -> i32 {\n return dot(coords, vec3(shape.y * shape.z, shape.z, 1));\n }\n fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 {\n return dot(coords, vec4(\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\n }\n fn getIndexFromCoords5D(coords : vec5, shape : vec5) -> i32 {\n let shapeStrides: vec5 = vec5(shape.y * shape.z * shape.w * shape.u, shape.z * shape.w * shape.u, shape.w * shape.u, shape.u, 1);\n return coords.x*shapeStrides.x + coords.y*shapeStrides.y + coords.z*shapeStrides.z + coords.w*shapeStrides.w + coords.u*shapeStrides.u;\n }\n fn getIndexFromCoords6D(coords : vec6, shape : vec6) -> i32 {\n let shapeStrides: vec6 = vec6(shape.y * shape.z * shape.w * shape.u * shape.v, shape.z * shape.w * shape.u * shape.v, shape.w * shape.u * shape.v, shape.u * shape.v, shape.v, 1);\n return coords.x*shapeStrides.x + coords.y*shapeStrides.y + coords.z*shapeStrides.z + coords.w*shapeStrides.w + coords.u*shapeStrides.u + coords.v*shapeStrides.v;\n }\n\n // NaN defination in IEEE 754-1985 is :\n // - sign = either 0 or 1.\n // - biased exponent = all 1 bits.\n // - fraction = anything except all 0 bits (since all 0 bits represents infinity).\n // https://en.wikipedia.org/wiki/IEEE_754-1985#Representation_of_non-numbers\n fn isnan(val: f32) -> bool {\n let floatToUint: u32 = bitcast(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n fn isnanVec4(val : vec4) -> vec4 {\n let floatToUint: vec4 = bitcast>(val);\n return (floatToUint & vec4(0x7fffffffu)) > vec4(0x7f800000u);\n }\n`,oae=`\n fn isinf(val: f32) -> bool {\n return abs(val) == uniforms.INFINITY;\n }\n`;function um(r,t=\"\"){let e=r.length,o=t!==\"\"?`get${t.charAt(0).toUpperCase()+t.slice(1)}CoordsFromIndex`:\"getCoordsFromIndex\",n=t!==\"\"?`${t.charAt(0).toLowerCase()+t.slice(1)}ShapeStrides`:\"outShapeStrides\";if(e<=1)return`fn ${o}(index : i32) -> i32 { return index; }`;let s=y.computeStrides(r),a=ft(e),i=[];for(let u=0;u vec2 {\n let d0 = index / uniforms.${n}; let d1 = index - d0 * uniforms.${n};\n return vec2(d0, d1);\n }`;let p;return p=\"var index2 = index;\"+s.map((u,c)=>{let l=`let ${i[c]} = index2 / uniforms.${n}.${Oo(c)}`,m=c===s.length-1?`let ${i[c+1]} = index2 - ${i[c]} * uniforms.${n}.${Oo(c)}`:`index2 = index2 - ${i[c]} * uniforms.${n}.${Oo(c)}`;return`${l}; ${m};`}).join(\"\"),`\n fn ${o}(index : i32) -> ${a} {\n ${p}\n return ${a}(${i.join(\",\")});\n }\n `}function nae(r,t){let e=r.name,o=r.shape.length,n=ft(o),s=\"get\"+e.charAt(0).toUpperCase()+e.slice(1),a=[\"d0\",\"d1\",\"d2\",\"d3\",\"d4\",\"d5\"].slice(0,o),i=a.map(c=>`${c} : i32`).join(\", \");if(o<1)return`\n fn ${s}() -> ${Ae(t)} {\n return ${Ae(t)}(${e}[0]);\n }\n `;let p=`uniforms.${e.charAt(0).toLowerCase()+e.slice(1)}Shape`,u=`${o}D`;return o===0&&(u=\"1D\"),`\n fn ${s}(${i}) -> ${Ae(t)} {\n return ${Ae(t)}(${e}[getIndexFromCoords${u}(${n}(${a.join(\",\")}),\n ${p})${t===1?\"\":` / ${t}`}]);\n }\n `}function sae(r,t,e,o){let n=r.name,s=n.charAt(0).toUpperCase()+n.slice(1),a=\"get\"+s+\"ByOutput\",i=r.shape.length,p=t.length,u=ft(p);if(y.arraysEqual(r.shape,t)&&o)return`\n fn ${a}Index(globalIndex : i32) -> ${Ae(e)} {\n return ${Ae(e)}(${n}[globalIndex]);\n }\n\n fn ${a}Coords(coords : ${u}) -> ${Ae(e)} {\n return ${Ae(e)}(${n}[${p>1?\"getOutputIndexFromCoords(coords)\":\"coords\"}${e===1?\"\":` / ${e}`}]);\n }\n `;let c=w.getBroadcastDims(r.shape,t),l=p-i,m=\"\";if(i===0)return`\n fn ${a}Index(globalIndex : i32) -> ${Ae(e)}{\n return get${s}();\n }\n\n fn ${a}Coords(coords : ${u}) -> ${Ae(e)}{\n return get${s}();\n }\n `;p<2&&c.length>=1?m=\"coords = 0;\":m=c.map(g=>`coords.${Oo(g+l)} = 0;`).join(`\n`);let d=\"\";if(p<2&&i>0)d=\"coords\";else if(p>1){let g=ft(i),x=r.shape.map((b,C)=>`coords.${Oo(C+l)}`).join(\", \");d=`${g}(${x})`}else d=\"coords\";let f=`uniforms.${n.charAt(0).toLowerCase()+n.slice(1)}Shape`,h=`${i}D`;return`\n fn ${a}Index(globalIndex : i32) -> ${Ae(e)} {\n var coords = getCoordsFromIndex(globalIndex);\n ${m}\n return ${Ae(e)}(${n}[getIndexFromCoords${h}(${d}, ${f})${e===1?\"\":` / ${e}`}]);\n }\n\n fn ${a}Coords(coordsIn : ${u}) -> ${Ae(e)} {\n var coords = coordsIn;\n ${m}\n return ${Ae(e)}(${n}[getIndexFromCoords${h}(${d}, ${f})${e===1?\"\":` / ${e}`}]);\n }\n`}function aae(r,t,e,o){let n=nae(r,e);return r.shape.length<=t.length&&(n+=sae(r,t,e,o)),n}function iae(r,t){let{x:e,y:o=[],z:n=[]}=t,s=r.length,a=e.length+o.length+n.length;if(a!==s)return\"\";if(e.length===s)return`fn getOutputCoords() -> ${ft(s)}{\n let globalIndex = getGlobalIndex();\n return getCoordsFromIndex(globalIndex);\n }\n `;let i=\"\",p=[e,o,n];for(let m=0;m ${c} {\n ${i}\n`;return u.length===0?l+=`return ${c}(0); }`:l+=`return ${c}(${u.join(\",\")}); }`,l}function uae(r){let t=\"\";switch(r){case 0:case 1:t+=`\n fn getOutputIndexFromCoords(coords : i32) -> i32 {\n return coords;\n }\n `;break;case 2:t+=`\n fn getOutputIndexFromCoords(coords : vec2) -> i32 {\n return dot(coords, vec2(uniforms.outShapeStrides, 1));\n }\n `;break;case 3:t+=`\n fn getOutputIndexFromCoords(coords : vec3) -> i32 {\n return dot(coords, vec3(uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, 1));\n }\n `;break;case 4:t+=`\n fn getOutputIndexFromCoords(coords : vec4) -> i32 {\n return dot(coords, vec4(\n uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, uniforms.outShapeStrides.z, 1));\n }\n `;break;case 5:t+=`\n fn getOutputIndexFromCoords(coords : vec5) -> i32 {\n return coords.x * uniforms.outShapeStrides.x +\n coords.y * uniforms.outShapeStrides.y +\n coords.z * uniforms.outShapeStrides.z +\n coords.w * uniforms.outShapeStrides.w +\n coords.u;\n }\n `;break;case 6:t+=`\n fn getOutputIndexFromCoords(coords : vec6) -> i32 {\n return coords.x * uniforms.outShapeStrides.x +\n coords.y * uniforms.outShapeStrides.y +\n coords.z * uniforms.outShapeStrides.z +\n coords.w * uniforms.outShapeStrides.w +\n coords.u * uniforms.outShapeStrides.u +\n coords.v;\n }\n `;break;default:y.assert(!1,()=>`Unsupported ${r}D shape`);break}return t}function JB(r){return r.dispatch[1]===1&&r.dispatch[2]===1}function Cu(r,t=1){if(r===\"float32\")return Ae(t,\"f32\");if(r===\"int32\"||r===\"bool\")return Ae(t,\"i32\");throw new Error(`type ${r} is not supported.`)}function pae(r,t,e){let o=r.length,n=Cu(t,e),s=`fn setOutputAtIndex(flatIndex : i32, value : ${Ae(e)}) {\n result[flatIndex] = ${n}(value);\n }\n\n fn setOutputAtIndexI32(flatIndex : i32, value : ${Ae(e,\"i32\")}) {\n result[flatIndex] = ${n}(value);\n }\n `;if(o>=2){let a=[\"d0\",\"d1\",\"d2\",\"d3\",\"d4\",\"d5\"].slice(0,o),i=ft(o);s+=`\n fn setOutputAtCoords(${a.map(p=>`${p} : i32`).join(\", \")}, value : ${Ae(e)}) {\n let flatIndex = getOutputIndexFromCoords(${i}(${a.join(\", \")}));\n setOutputAtIndex(flatIndex${e===1?\"\":` / ${e}`}, value);\n }\n fn setOutputAtCoordsI32(${a.map(p=>`${p} : i32`).join(\", \")}, value : ${Ae(e,\"i32\")}) {\n let flatIndex = getOutputIndexFromCoords(${i}(${a.join(\", \")}));\n setOutputAtIndexI32(flatIndex${e===1?\"\":` / ${e}`}, value);\n }\n `}return s}function cae(r){let t=/(\\w+)\\s*:\\s*vec(5|6)/g;r=r.replace(t,o=>\"@align(16) \"+o);let e=/vec(5|6)\\s*,\\s*(\\w+)/g;return r=r.replace(e,(o,n,s)=>`vec${n}, @align(16) ${s}`),r}function YB(r){return!(r.dispatchLayout.hasOwnProperty(\"y\")&&r.dispatchLayout.y.length!==0||r.dispatchLayout.hasOwnProperty(\"z\")&&r.dispatchLayout.z.length!==0)}var Qv={};qe(Qv,{GPUBytesPerElement:()=>qg,MatMulProgramType:()=>Mo,assertNotComplex:()=>mm,computeDispatch:()=>H,computeWorkPerThreadForConv2d:()=>cm,computeWorkgroupInfoForMatMul:()=>Yv,computeWorkgroupSizeForConv2d:()=>pm,flatDispatchLayout:()=>X,isWebGPUSupported:()=>lm,tilesFitEvenlyIntoShape:()=>mae});var kp=r=>{let t=1;for(let e=0;ee%r[o]===0)}function H(r,t,e=[1,1,1],o=[1,1,1]){let[n,s,a]=[Math.ceil(kp(r.x.map(i=>t[i]))/(e[0]*o[0])),r.y?Math.ceil(kp(r.y.map(i=>t[i]))/(e[1]*o[1])):1,r.z?Math.ceil(kp(r.z.map(i=>t[i]))/(e[2]*o[2])):1];return[n,s,a]}function Yv(r,t,e,o=!1){let n=[8,8,1],s=[4,4,1];return o||(r<=8&&(s[1]=1),t<=16&&e<=16&&(n[0]=4)),{workgroupSize:n,elementsPerThread:s}}function pm(r,t,e=!1){if(e)return[8,8,1];let o=kp(r.x.map(s=>t[s])),n=kp(r.y.map(s=>t[s]));return o<=4?[4,16,1]:n<=4?[16,4,1]:[16,16,1]}function cm(r,t,e=!1){if(e)return[4,4,1];let o=kp(r.x.map(s=>t[s])),n=kp(r.y.map(s=>t[s]));return o<=4?[1,2,1]:n<=4?[2,1,1]:[2,2,1]}function X(r){return{x:r.map((t,e)=>e)}}function qg(r){if(r===\"float32\"||r===\"int32\"||r===\"bool\"||r===\"string\")return 4;if(r===\"complex64\")return 8;throw new Error(`Unknown dtype ${r}`)}function lm(){return!!(globalThis&&globalThis.navigator&&globalThis.navigator.gpu)}function mm(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>{e!=null&&y.assert(e.dtype!==\"complex64\",()=>`${t} does not support complex64 tensors in the WebGPU backend.`)})}var Mo;(function(r){r[r.MatMulReduceProgram=0]=\"MatMulReduceProgram\",r[r.MatMulSplitKProgram=1]=\"MatMulSplitKProgram\",r[r.MatMulSmallOutputSizeProgram=2]=\"MatMulSmallOutputSizeProgram\",r[r.MatMulPackedProgram=3]=\"MatMulPackedProgram\",r[r.MatMulMax=4]=\"MatMulMax\"})(Mo||(Mo={}));var dae=A().getNumber(\"WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD\"),fae=(r,t)=>{let e=r.limits.maxComputeWorkgroupsPerDimension,o=t.dispatchLayout,n=t.dispatch;if(n.every(a=>a<=e))return n;y.assert(n[0]>e&&o.y===void 0&&o.z===void 0,()=>\"Dispatch size exceeds WebGPU limits in Y or Z dimension.\");let s=Math.ceil(Math.sqrt(n[0]));return s>e?(s=Math.ceil(Math.cbrt(n[0])),y.assert(s<=e,()=>\"Total dispatch size exceeds WebGPU maximum.\"),[s,s,s]):[s,s,1]},Kc=class r extends so{nextDataId(){return r.nextDataId++}constructor(t,e){if(super(),this.commandQueueOwnedIds=new WeakSet,this.dispatchCountInPass=0,this.disposed=!1,this.downloadWaitMs=0,this.tensorDataPendingDisposal=[],this.queryResolveBuffer=null,this.querySet=null,this.querySetCount=2,this.stagingPendingDisposal=[],this.uniformPendingDisposal=[],this.uploadWaitMs=0,this.hasReadSyncWarned=!1,this.hasTimestampQueryWarned=!1,!lm())throw new Error(\"WebGPU is not supported on this device\");this.pipelineCache={},this.device=t,this.queue=t.queue,this.commandEncoder=null,this.computePassEncoder=null,this.adapterInfo=new Gg(e),this.supportTimestampQuery=this.device.features.has(\"timestamp-query\"),this.thresholdToIncreaseWorkgroups=this.adapterInfo.intelGPUGeneration>=12?16:8,this.bufferManager=new Hg(this.device),this.textureManager=new Kg(this.device),this.tensorMap=new Bo(this,ur()),A().getBool(\"WEBGPU_USE_PROFILE_TOOL\")&&(this.dummyCanvas=document.createElement(\"canvas\"),this.dummyCanvas.width=1,this.dummyCanvas.height=1,this.dummyContext=this.dummyCanvas.getContext(\"webgpu\"),this.dummyContext.configure({device:t,format:\"bgra8unorm\"}),document.body.appendChild(this.dummyCanvas))}floatPrecision(){return 32}disposeData(t,e=!1){if(!this.tensorMap.has(t))return!0;let o=this.tensorMap.get(t);return e?o.refCount=0:o.refCount--,o.refCount>0?!1:(o.complexTensorInfos!=null&&(this.disposeData(o.complexTensorInfos.real.dataId),this.disposeData(o.complexTensorInfos.imag.dataId)),this.commandQueueOwnedIds.has(t)?(this.tensorDataPendingDisposal.push(t),!0):(this.releaseResource(t),this.tensorMap.delete(t),!0))}memory(){return{numBytesInGPU:this.bufferManager.numBytesUsed,numBytesAllocatedInGPU:this.bufferManager.numBytesAllocated,unreliable:!1}}releaseResource(t){let e=this.tensorMap.get(t);if(!(!e||!e.resource)){if(e.external){e.resource=null;return}e.resource instanceof GPUBuffer?this.bufferManager.releaseBuffer(e.resource):e.resource instanceof GPUTexture&&this.textureManager.releaseTexture(e.resource),e.resource=null}}refCount(t){return this.tensorMap.has(t)?this.tensorMap.get(t).refCount:0}incRef(t){let e=this.tensorMap.get(t);e.refCount++}decRef(t){if(this.tensorMap.has(t)){let e=this.tensorMap.get(t);e.refCount--}}write(t,e,o){if(o===\"complex64\"&&t!=null)throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");let n={id:this.nextDataId()};return this.tensorMap.set(n,{dtype:o,shape:e,values:t,refCount:1}),n}move(t,e,o,n,s){if(n===\"complex64\")throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");this.tensorMap.set(t,{dtype:n,shape:o,values:e,refCount:s})}submitQueue(){this.queue.submit([this.commandEncoder.finish()]),this.commandEncoder=null,this.dispatchCountInPass=0,this.commandQueueOwnedIds=new WeakSet,this.tensorDataPendingDisposal.forEach(t=>{this.releaseResource(t),this.tensorMap.delete(t)}),this.uniformPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t)),this.stagingPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t,!1)),this.tensorDataPendingDisposal=[],this.uniformPendingDisposal=[],this.stagingPendingDisposal=[]}ensureCommandEncoderReady(){this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder())}endComputePassEncoder(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}async checkCompileCompletionAsync(){let t;try{t=await Promise.all(Object.values(this.pipelineCache))}catch(e){throw new Error(e.message)}Object.keys(this.pipelineCache).map((e,o)=>{this.pipelineCache[e]=t[o]})}async getBufferData(t){if(A().getBool(\"WEBGPU_ENGINE_COMPILE_ONLY\"))return console.warn(\"The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false\"),null;let e=t.size,o=this.bufferManager.acquireBuffer(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,o,0,e),this.submitQueue(),await o.mapAsync(GPUMapMode.READ);let n=o.getMappedRange().slice(0);return o.unmap(),o!=null&&this.bufferManager.releaseBuffer(o),A().getBool(\"WEBGPU_USE_PROFILE_TOOL\")&&(y.assert(this.dummyContext!==void 0,()=>\"Fail to get context for profiling tool\"),this.dummyContext.getCurrentTexture()),n}convertAndCacheOnCPU(t,e){let o=this.tensorMap.get(t);return o.values=e,o.values}readSync(t){let e=this.tensorMap.get(t),{values:o,complexTensorInfos:n}=e;if(o!=null||e.dtype===\"string\")return o;if(e.dtype===\"complex64\"){let h=this.readSync(n.real.dataId),g=this.readSync(n.imag.dataId),x=y.convertBackendValuesAndArrayBuffer(w.mergeRealAndImagArrays(h,g).buffer,\"float32\");return this.convertAndCacheOnCPU(t,x),x}this.hasReadSyncWarned||(this.hasReadSyncWarned=!0,console.warn(\"The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead.\"));let s=[\"opaque\",\"premultiplied\"],a=e.resource,i=a.size;y.assert(i%4===0,()=>\"Because there is 4 bytes for one pixel, buffer size must be multiple of 4.\");let p=i/4,u=new ArrayBuffer(i),c=256,l=256,m=s.map(h=>new OffscreenCanvas(c,l)),d=new OffscreenCanvas(c,l);this.endComputePassEncoder(),m.map((h,g)=>{let x=h.getContext(\"webgpu\");return x.configure({device:this.device,format:\"bgra8unorm\",usage:GPUTextureUsage.COPY_DST,alphaMode:s[g]}),x.getCurrentTexture()}).map((h,g)=>{let x=c*4,b=(R,D,P)=>{this.ensureCommandEncoderReady(),this.commandEncoder.copyBufferToTexture({buffer:a,bytesPerRow:x,offset:P},{texture:h},{width:R,height:D}),this.submitQueue();let O=d.getContext(\"2d\",{willReadFrequently:!0});O.clearRect(0,0,R,D),O.drawImage(m[g],0,0);let M=O.getImageData(0,0,R,D).data,L=s[g],B=new Uint8ClampedArray(u,P,R*D*4);for(let z=0;z0&&(b(S,k,_),_+=k*(c*4)),S=E%c,S>0&&b(S,1,_)});let f=y.convertBackendValuesAndArrayBuffer(u,e.dtype);return this.convertAndCacheOnCPU(t,f),f}async read(t){if(!this.tensorMap.has(t))throw new Error(`Tensor ${t} was not registered!`);let e=this.tensorMap.get(t),{values:o}=e;if(o!=null)return o;let n;if(e.dtype===\"complex64\"){let s=await Promise.all([this.read(e.complexTensorInfos.real.dataId),this.read(e.complexTensorInfos.imag.dataId)]),a=s[0],i=s[1];n=w.mergeRealAndImagArrays(a,i)}else{let s=await this.getBufferData(e.resource);n=y.convertBackendValuesAndArrayBuffer(s,e.dtype)}return this.convertAndCacheOnCPU(t,n),n}copyBuffer(t){let e=t.size,o=t.usage,n=this.bufferManager.acquireBuffer(e,o);return this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,n,0,e),this.submitQueue(),n}createTensorFromGPUData(t,e,o){let n=t.buffer;if(o===\"complex64\")throw new Error(\"Cannot write to a complex64 dtype. \");let s={id:this.nextDataId()};this.tensorMap.set(s,{dtype:o,shape:e,values:null,refCount:1,external:t.zeroCopy});let a=this.tensorMap.get(s),i=qg(a.dtype)*y.sizeFromShape(a.shape);if(t.buffer.sizey.decodeString(n));return me(t.shape,t.dtype,o)}catch(o){throw new Error(\"Failed to decode encoded string bytes into utf-8\")}return me(t.shape,t.dtype,e)}async time(t){!this.supportTimestampQuery&&!this.hasTimestampQueryWarned&&(console.warn(\"This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled.\"),this.hasTimestampQueryWarned=!0);let e=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,t();let s=y.flatten(this.activeTimers.map(u=>u.query)).filter(u=>u!=null),a=y.flatten(this.activeTimers.map(u=>u.name)).filter(u=>u!=null);this.activeTimers=e,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},p=await Promise.all(s);return i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,c)=>({name:a[c],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(\", \"),this.uploadWaitMs=0,this.downloadWaitMs=0,i}makeTensorInfo(t,e,o){return e===\"string\"&&o!=null&&o.length>0&&y.isString(o[0])&&(o=o.map(s=>y.encodeString(s))),{dataId:this.write(o,t,e),shape:t,dtype:e}}tensorToBinding(t){if(!t)return null;let o=this.tensorMap.get(t.dataId).resource;return o instanceof GPUBuffer?{buffer:o}:o instanceof GPUTexture?o.createView():o}uploadToGPU(t){let e=this.tensorMap.get(t);if(e.resource!=null)return;let o=qg(e.dtype)*y.sizeFromShape(e.shape),n,s=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;if(e.values){if(n=this.bufferManager.acquireBuffer(o,s,!0),n.mapState===\"unmapped\"){let a=this.bufferManager.acquireBuffer(o,GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC,!0,!1),i=a.getMappedRange();e.dtype===\"int32\"||e.dtype===\"bool\"?new Int32Array(i).set(e.values):new Float32Array(i).set(e.values),a.unmap(),this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(a,0,n,0,o),this.stagingPendingDisposal.push(a)}else{let a=n.getMappedRange();e.dtype===\"int32\"||e.dtype===\"bool\"?new Int32Array(a).set(e.values):new Float32Array(a).set(e.values),n.unmap()}e.values=null}else n=this.bufferManager.acquireBuffer(o,s);e.resource=n}makeUniforms(t){let e=0,o=0,n=[],s=1;t.forEach(p=>{p.data.length===0&&(p.data=[1]);let u;switch(p.data.length){case 1:u=4;break;case 2:u=8;break;case 3:u=16;break;case 4:u=16;break;case 5:u=16;break;case 6:u=16;break;default:y.assert(!1,()=>`Unsupported ${p.data.length}D shape`)}(o===5||o===6)&&(u=16),u>s&&(s=u),e=Math.ceil(e/u)*u,o=p.data.length,n.push(e),e+=p.data.length*4}),e=Math.ceil(e/s)*s;let a=new ArrayBuffer(e);t.forEach((p,u)=>{let c=n[u];p.type===\"int32\"?new Int32Array(a,c,p.data.length).set(p.data):p.type===\"uint32\"?new Uint32Array(a,c,p.data.length).set(p.data):new Float32Array(a,c,p.data.length).set(p.data)});let i=this.bufferManager.acquireBuffer(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);return this.queue.writeBuffer(i,0,a,0,e),this.uniformPendingDisposal.push(i),{offset:0,size:e,buffer:i}}runWebGPUProgram(t,e,o,n,s){if(s||(s=this.makeTensorInfo(t.outputShape,o)),y.sizeFromShape(s.shape)===0)return this.tensorMap.get(s.dataId).values=y.getTypedArrayFromDType(s.dtype,0),s;this.uploadToGPU(s.dataId),t.dispatch=fae(this.device,t);let a=e.map((p,u)=>{if(p.dtype===\"complex64\")throw new Error(\"GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.\");return this.uploadToGPU(p.dataId),{dtype:this.tensorMap.get(p.dataId).dtype,shape:p.shape,name:t.variableNames[u]}});t.shaderKey=ZB(t,a,s);let i=A().getBool(\"WEBGPU_ENGINE_COMPILE_ONLY\");return t.shaderKey in this.pipelineCache||(this.pipelineCache[t.shaderKey]=QB(this.device,t,a,s,i)),t.pipeline=this.pipelineCache[t.shaderKey],i||this.recordAndSubmit(t,s,e,n),s}recordAndSubmit(t,e,o,n){if(t.pipeline instanceof Promise)throw new Error(\"Please call checkCompileCompletionAsync to ensure parallel compilation is done!\");let s=[],a=[],i=\"int32\";if(t.pixelsOpType==null){s.push({type:\"float32\",data:[NaN]},{type:\"float32\",data:[1/0]}),a=o.concat(e).map(d=>d.shape);let m=\"int32\";a.map(d=>{s.push({type:m,data:d});let f=y.computeStrides(d);s.push({type:m,data:f})})}else{let m=y.computeStrides(e.shape);s.push({type:i,data:m})}if(t.size){let m=y.sizeFromShape(t.outputShape);s.push({type:i,data:[t.outputComponent?m/t.outputComponent:m]})}n&&(s=[...s,...n]);let p=[this.tensorToBinding(e),...o.map(m=>this.tensorToBinding(m)),this.makeUniforms(s)];o.forEach(m=>{this.commandQueueOwnedIds.add(m.dataId)}),this.commandQueueOwnedIds.add(e.dataId);let u=this.device.createBindGroup({layout:t.pipeline.getBindGroupLayout(0),entries:p.map((m,d)=>({binding:d,resource:m}))}),c=this.activeTimers!=null;this.ensureCommandEncoderReady();let l={};c&&this.supportTimestampQuery?(this.endComputePassEncoder(),this.querySet==null&&(this.querySet=this.device.createQuerySet({type:\"timestamp\",count:this.querySetCount})),l.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1},this.computePassEncoder=this.commandEncoder.beginComputePass(l)):this.computePassEncoder||(this.computePassEncoder=this.commandEncoder.beginComputePass(l)),this.computePassEncoder.setPipeline(t.pipeline),this.computePassEncoder.setBindGroup(0,u),this.computePassEncoder.dispatchWorkgroups(t.dispatch[0],t.dispatch[1],t.dispatch[2]),this.dispatchCountInPass++,(c||A().get(\"WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE\")<=this.dispatchCountInPass||t.pixelsOpType===Ci.DRAW)&&(this.endComputePassEncoder(),c?this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime()}):this.submitQueue())}async getQueryTime(){if(!this.supportTimestampQuery)return 0;this.queryResolveBuffer==null&&(this.queryResolveBuffer=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST|GPUBufferUsage.QUERY_RESOLVE)),this.commandEncoder.resolveQuerySet(this.querySet,0,this.querySetCount,this.queryResolveBuffer,0);let t=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,t,0,this.querySetCount*8),this.submitQueue(),await t.mapAsync(GPUMapMode.READ);let e=new BigUint64Array(t.getMappedRange()),o=Number(e[1]-e[0])/1e6;return t.unmap(),this.bufferManager.releaseBuffer(t),o}shouldExecuteOnCPU(t,e=dae){return A().getBool(\"WEBGPU_CPU_FORWARD\")&&t.every(o=>this.tensorMap.get(o.dataId).resource==null&&y.sizeFromShape(o.shape){let r={powerPreference:A().get(\"WEBGPU_USE_LOW_POWER_GPU\")?\"low-power\":\"high-performance\"},t=await navigator.gpu.requestAdapter(r),e={},o=[];t.features.has(\"timestamp-query\")&&o.push(\"timestamp-query\"),t.features.has(\"bgra8unorm-storage\")&&o.push([\"bgra8unorm-storage\"]),e.requiredFeatures=o;let n=t.limits;e.requiredLimits={maxComputeWorkgroupStorageSize:n.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:n.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:n.maxStorageBufferBindingSize,maxBufferSize:n.maxBufferSize,maxComputeWorkgroupSizeX:n.maxComputeWorkgroupSizeX,maxComputeInvocationsPerWorkgroup:n.maxComputeInvocationsPerWorkgroup};let s=await t.requestDevice(e),a=await t.requestAdapterInfo();return new Kc(s,a)},3);var fe;(function(r){r[r.ADD=0]=\"ADD\",r[r.ATAN2=1]=\"ATAN2\",r[r.COMPLEX_MULTIPLY_IMAG=2]=\"COMPLEX_MULTIPLY_IMAG\",r[r.COMPLEX_MULTIPLY_REAL=3]=\"COMPLEX_MULTIPLY_REAL\",r[r.DIV=4]=\"DIV\",r[r.ELU_DER=5]=\"ELU_DER\",r[r.EQUAL=6]=\"EQUAL\",r[r.FLOOR_DIV=7]=\"FLOOR_DIV\",r[r.GREATER=8]=\"GREATER\",r[r.GREATER_EQUAL=9]=\"GREATER_EQUAL\",r[r.LESS=10]=\"LESS\",r[r.LESS_EQUAL=11]=\"LESS_EQUAL\",r[r.LOGICAL_AND=12]=\"LOGICAL_AND\",r[r.LOGICAL_OR=13]=\"LOGICAL_OR\",r[r.MAX=14]=\"MAX\",r[r.MIN=15]=\"MIN\",r[r.MOD=16]=\"MOD\",r[r.MUL=17]=\"MUL\",r[r.NOT_EQUAL=18]=\"NOT_EQUAL\",r[r.POW=19]=\"POW\",r[r.PRELU=20]=\"PRELU\",r[r.SQUARED_DIFFERENCE=21]=\"SQUARED_DIFFERENCE\",r[r.SUB=22]=\"SUB\"})(fe||(fe={}));var hae=\"let resultTemp = a + b;\",gae=\"let resultTemp = atan2(a, b);\",xae=\"let resultTemp = areal * breal - aimag * bimag;\",yae=\"let resultTemp = areal * bimag + aimag * breal;\",bae=\"let resultTemp = a / b;\",Cae=\"let resultTemp = select(a * (b + 1.0), a, b >= b - b);\",wae=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a == b);\n`,Sae=`\n let remainder =\n select(a % b, round(a % b), (round(a) == a) & (round(b) == b));\n let quotient = (a - remainder) / b;\n let resultTemp =\n round(select(quotient, quotient - 1, sign(remainder) == -sign(b)));\n`,Iae=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a > b);\n`,vae=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a >= b);\n`,kae=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a < b);\n`,Nae=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a <= b);\n`,Tae=\"return f32(a >= 1.0 && b >= 1.0);\",_ae=`return (vec4(a >= vec4(1.0)) *\n vec4(b >= vec4(1.0)));`,$ae=\"return f32(a >= 1.0 || b >= 1.0);\",Eae=`return min(vec4(a >= vec4(1.0)) +\n vec4(b >= vec4(1.0)), vec4(1.0));`,Rae=\"let resultTemp = max(a, b);\",Dae=\"let resultTemp = min(a, b);\",Aae=`\n let isNaN = b == 0.;\n var resultTemp = a % b;\n resultTemp = select((resultTemp + b) % b, resultTemp,\n (a < 0. && b < 0.) || (a >= 0. && b > 0.));\n`,Fae=`\n let isNaN = !vec4(b);\n var resultTemp = vec4(a % b);\n if (!((a[0] < 0. && b[0] < 0.) || (a[0] >= 0. && b[0] > 0.))) {\n resultTemp[0] = (resultTemp[0] + b[0]) % b[0];\n }\n if (!((a[1] < 0. && b[1] < 0.) || (a[1] >= 0. && b[1] > 0.))) {\n resultTemp[1] = (resultTemp[1] + b[1]) % b[1];\n }\n if (!((a[2] < 0. && b[2] < 0.) || (a[2] >= 0. && b[2] > 0.))) {\n resultTemp[2] = (resultTemp[2] + b[2]) % b[2];\n }\n if (!((a[3] < 0. && b[3] < 0.) || (a[3] >= 0. && b[3] > 0.))) {\n resultTemp[3] = (resultTemp[3] + b[3]) % b[3];\n }\n`,Pae=\"let resultTemp = a * b;\",Oae=`\n var resultTemp = f32(a != b);\n let valueForNaN = 1.0;\n`,Mae=`\n var resultTemp = vec4(a != b);\n let valueForNaN = 1.0;\n`,Lae=`\n let isNaN = a < 0.0 && floor(b) < b;\n if (b == 0.0) {\n return 1.0;\n }\n var resultTemp = select(sign(a) * pow(abs(a), b), pow(abs(a), b),\n round(abs(b) % 2.0) != 1.0);\n`,Bae=`\n let isModRound1Bool = vec4(round(abs(b) % vec4(2.0))) == vec4(1);\n let isModRound1 = vec4(isModRound1Bool);\n let multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n var resultTemp = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n let isExpZero = b == vec4(0.0);\n if (isExpZero.r) {\n resultTemp.r = 1.0;\n }\n if (isExpZero.g) {\n resultTemp.g = 1.0;\n }\n if (isExpZero.b) {\n resultTemp.b = 1.0;\n }\n if (isExpZero.a) {\n resultTemp.a = 1.0;\n }\n let isNaN = (a < vec4(0.0)) & (floor(b) < b);\n`,zae=\"if (a < 0.0) { return b * a; } return a;\",Vae=`\n let aLessThanZero = vec4(a < vec4(0.0));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`,Wae=\"let resultTemp = (a - b) * (a - b);\",Uae=\"let resultTemp = a - b;\";function qc(r,t){let e;do{switch(r){case fe.ATAN2:e=gae;break;case fe.MAX:e=Rae;break;case fe.MIN:e=Dae;break;case fe.MOD:e=t?Fae:Aae;break;case fe.NOT_EQUAL:e=t?Mae:Oae;break;case fe.POW:e=t?Bae:Lae;break;default:continue}let o,n,s;return t?(o=\"isnanVec4\",n=\"vec4\",s=\"vec4\"):(o=\"isnan\",n=\"f32\",s=\"bool\"),`\n let aIsNaN = ${o}(a);\n let aPostLegalization = select(a, ${n}(42), aIsNaN);\n let bIsNaN = ${o}(b);\n let bPostLegalization = select(b, ${n}(42), bIsNaN);\n let isNaN = false;\n let valueForNaN = uniforms.NAN;\n {\n let a = aPostLegalization;\n let b = bPostLegalization;\n ${e}\n return select(\n resultTemp, ${n}(valueForNaN),\n ${s}(isNaN) | aIsNaN | bIsNaN);\n }\n `}while(!1);switch(r){case fe.ADD:e=hae;break;case fe.COMPLEX_MULTIPLY_IMAG:e=yae;break;case fe.COMPLEX_MULTIPLY_REAL:e=xae;break;case fe.DIV:e=bae;break;case fe.ELU_DER:e=Cae;break;case fe.EQUAL:e=wae;break;case fe.FLOOR_DIV:e=Sae;break;case fe.GREATER:e=Iae;break;case fe.GREATER_EQUAL:e=vae;break;case fe.LESS:e=kae;break;case fe.LESS_EQUAL:e=Nae;break;case fe.LOGICAL_AND:return t?_ae:Tae;case fe.LOGICAL_OR:return t?Eae:$ae;case fe.MUL:e=Pae;break;case fe.PRELU:return t?Vae:zae;case fe.SQUARED_DIFFERENCE:e=Wae;break;case fe.SUB:e=Uae;break;default:}return`\n ${e}\n return resultTemp;\n `}var Z;(function(r){r[r.ABS=0]=\"ABS\",r[r.ACOS=1]=\"ACOS\",r[r.ACOSH=2]=\"ACOSH\",r[r.ASIN=3]=\"ASIN\",r[r.ASINH=4]=\"ASINH\",r[r.ATAN=5]=\"ATAN\",r[r.ATANH=6]=\"ATANH\",r[r.CEIL=7]=\"CEIL\",r[r.COS=8]=\"COS\",r[r.COSH=9]=\"COSH\",r[r.ELU=10]=\"ELU\",r[r.ERF=11]=\"ERF\",r[r.EXP=12]=\"EXP\",r[r.EXPM1=13]=\"EXPM1\",r[r.FLOOR=14]=\"FLOOR\",r[r.IS_FINITE=15]=\"IS_FINITE\",r[r.IS_INF=16]=\"IS_INF\",r[r.IS_NAN=17]=\"IS_NAN\",r[r.LINEAR=18]=\"LINEAR\",r[r.LOG=19]=\"LOG\",r[r.LOG1P=20]=\"LOG1P\",r[r.LOGICAL_NOT=21]=\"LOGICAL_NOT\",r[r.NEG=22]=\"NEG\",r[r.RELU=23]=\"RELU\",r[r.RELU6=24]=\"RELU6\",r[r.LEAKYRELU=25]=\"LEAKYRELU\",r[r.RECIPROCAL=26]=\"RECIPROCAL\",r[r.ROUND=27]=\"ROUND\",r[r.RSQRT=28]=\"RSQRT\",r[r.SELU=29]=\"SELU\",r[r.SIGMOID=30]=\"SIGMOID\",r[r.SIGN=31]=\"SIGN\",r[r.SIN=32]=\"SIN\",r[r.SINH=33]=\"SINH\",r[r.SOFTPLUS=34]=\"SOFTPLUS\",r[r.SQRT=35]=\"SQRT\",r[r.SQUARE=36]=\"SQUARE\",r[r.STEP=37]=\"STEP\",r[r.TAN=38]=\"TAN\",r[r.TANH=39]=\"TANH\",r[r.TO_INT=40]=\"TO_INT\"})(Z||(Z={}));var Gae=\"return abs(a);\",Hae=`\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n return acos(a);\n`,Kae=`\n if (a < 1.) {\n return uniforms.NAN;\n }\n return acosh(a);\n`,qae=`\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n return asin(a);\n`,jae=\"return asinh(a);\",Xae=`\n if (isnan(a)) {\n return uniforms.NAN;\n }\n return atan(a);\n`,Yae=`\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n if (a == 1.) {\n return uniforms.INFINITY;\n }\n if (a == -1.) {\n return -uniforms.INFINITY;\n }\n return atanh(a);\n`,Qae=\"return ceil(a);\",Zae=\"return cos(a);\",Jae=`\n let e2x = exp(-a);\n return (e2x + 1.0 / e2x) / 2.0;\n`,eie=\"return exp(a) - 1.0;\",tie=\"if (a >= 0.0) { return a; } return (exp(a) - 1.0);\",rie=`\n var resFloat = exp(a) - vec4(1.0);\n if (a.r >= 0.0) {\n resFloat.r = a.r;\n }\n if (a.g >= 0.0) {\n resFloat.g = a.g;\n }\n if (a.b >= 0.0) {\n resFloat.b = a.b;\n }\n if (a.a >= 0.0) {\n resFloat.a = a.a;\n }\n return resFloat;\n`,oie=`\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n let p = ${w.ERF_P};\n let a1 = ${w.ERF_A1};\n let a2 = ${w.ERF_A2};\n let a3 = ${w.ERF_A3};\n let a4 = ${w.ERF_A4};\n let a5 = ${w.ERF_A5};\n\n let sign = sign(a);\n let absA = abs(a);\n let t = 1.0 / (1.0 + p * absA);\n return sign * (1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * exp(-absA * absA));\n`,nie=\"return exp(a);\",sie=\"return floor(a);\",aie=\"return f32(!isnan(a) && !isinf(a));\",iie=\"return f32(isinf(a));\",uie=\"return f32(isnan(a));\",pie=\"return a;\",cie=`if (a < 0.0) { return uniforms.NAN; }\n return log(a);`,lie=`\n if (isnan(a)) { return a; }\n return log(1.0 + a);\n`,mie=\"return f32(!(a >= 1.0));\",die=\"return -a;\",fie=\"if (a < 0.0) { return uniforms.alpha * a; } return a;\",hie=`\n let aLessThanZero = vec4(a < vec4(0.0));\n return (aLessThanZero * (uniforms.alpha * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`,gie=\"return 1.0 / a;\",xie=\"return select(a, 0.0, a < 0.0);\",yie=\"return clamp(a, 0.0, 6.0);\",bie=\"return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));\",Cie=`\n return select(a, vec4(0.0), a < vec4(0.0));\n`,wie=\"return round(a);\",Sie=\"return inverseSqrt(a);\",Iie=`\n if (a >= 0.0) {\n return ${w.SELU_SCALE} * a;\n } else {\n return ${w.SELU_SCALEALPHA} * (exp(a) - 1.0);\n }\n`,vie=\"return 1.0 / (1.0 + exp(-1.0 * a));\",kie=\"return sign(a);\",Nie=\"return sin(a);\",Tie=`\n let e2x = exp(a);\n return (e2x - 1.0 / e2x) / 2.0;\n`,_ie=`\n let epsilon = 1.1920928955078125e-7;\n let threshold = log(epsilon) + 2.0;\n\n let too_large = a > -threshold;\n let too_small = a < threshold;\n let exp_a = exp(a);\n\n if (too_large) {\n return a;\n } else if (too_small) {\n return exp_a;\n } else {\n return log(exp_a + 1.0);\n }\n`,$ie=\"return sqrt(a);\",Eie=\"return a * a;\",Rie=`\n if (isnan(a)) {\n return a;\n }\n\n return select(uniforms.stepAlpha, 1.0, a > 0.0);\n`,Die=\"return tan(a);\",Aie=`\n let e2x = exp(-2.0 * abs(a));\n return sign(a) * (1.0 - e2x) / (1.0 + e2x);\n`,Fie=\"return f32(i32((a)));\";function wi(r,t){switch(r){case Z.ABS:return Gae;case Z.ACOS:return Hae;case Z.ACOSH:return Kae;case Z.ASIN:return qae;case Z.ASINH:return jae;case Z.ATAN:return Xae;case Z.ATANH:return Yae;case Z.COS:return Zae;case Z.COSH:return Jae;case Z.CEIL:return Qae;case Z.ELU:return t?rie:tie;case Z.ERF:return oie;case Z.EXP:return nie;case Z.EXPM1:return eie;case Z.FLOOR:return sie;case Z.IS_FINITE:return aie;case Z.IS_INF:return iie;case Z.IS_NAN:return uie;case Z.LINEAR:return pie;case Z.LOG:return cie;case Z.LOG1P:return lie;case Z.LOGICAL_NOT:return mie;case Z.NEG:return die;case Z.LEAKYRELU:return t?hie:fie;case Z.RECIPROCAL:return gie;case Z.RELU:return t?Cie:xie;case Z.RELU6:return t?bie:yie;case Z.ROUND:return wie;case Z.RSQRT:return Sie;case Z.SELU:return Iie;case Z.SIGMOID:return vie;case Z.SIGN:return kie;case Z.SIN:return Nie;case Z.SINH:return Tie;case Z.SOFTPLUS:return _ie;case Z.SQRT:return $ie;case Z.SQUARE:return Eie;case Z.STEP:return Rie;case Z.TAN:return Die;case Z.TANH:return Aie;case Z.TO_INT:return Fie;default:throw new Error(`BinaryType ${r} is not implemented!`)}}function dr(r,t=!1,e=!1,o=3){if(r===null)return\"\";let n=\"\";if(r===\"linear\")n=wi(Z.LINEAR);else if(r===\"relu\")n=wi(Z.RELU,e);else if(r===\"elu\")n=wi(Z.ELU,e);else if(r===\"relu6\")n=wi(Z.RELU6,e);else if(r===\"prelu\")n=qc(fe.PRELU,e);else if(r===\"sigmoid\")n=wi(Z.SIGMOID,e);else if(r===\"leakyrelu\")n=wi(Z.LEAKYRELU,e);else throw new Error(`Activation ${r} has not been implemented for the WebGPU backend.`);let a=Ae(e?4:1),i=\"\";return t?i=`\n fn activation(a : ${a}, coords : vec${o}) -> ${a} {\n let b = getPreluActivationWeightsByOutputCoords(coords);\n ${n}\n }`:i=`\n fn activation(a : ${a}, coords : vec${o}) -> ${a} {\n ${n}\n }`,i}function Qr(r,t){return`\n ${r?\"value = value + getBiasByOutputCoords(coords);\":\"\"}\n ${t?\"value = activation(value, coords);\":\"\"}\n `}function Zv(r,t,e=!1,o=!1,n=!1,s=1){y.assert(r&&s===1||!r,()=>`transposeA ${r} is not compatible with component size ${s}`);let a=`\n ${r?\"value = getA(batch, col, row);\":\"value = getA(batch, row, col);\"}\n\n `,i=t?\"value = getB(batch, col, row);\":\"value = getB(batch, row, col);\";return`\n fn mm_readA(batch: i32, row: i32, col: i32) -> ${Ae(s)} {\n var value = ${Ae(s)}(0.0);\n ${e&&n?a:`\n ${r?\"if(row < uniforms.dimAOuter && col < uniforms.dimInner)\":\"if(row < uniforms.aShape[1] && col < uniforms.aShape[2])\"}\n {\n ${a}\n }\n `}\n return value;\n }\n\n fn mm_readB(batch: i32, row: i32, col: i32) -> ${Ae(s)} {\n var value = ${Ae(s)}(0.0);\n ${i}\n return value;\n }\n `}function dm(r,t,e,o,n=!1,s=!1,a=!1,i=1){return`\n ${Zv(e,o,n,s,a,i)}\n fn mm_write(batch: i32, row: i32, col: i32, valueIn: ${Ae(i)}) {\n ${n&&s?\"\":\"if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)\"}\n {\n var value = valueIn;\n let coords = vec3(batch, row, col);\n ${Qr(r,t)}\n setOutputAtCoords(coords[0], coords[1], coords[2], value);\n }\n }\n `}var Pie=(r,t)=>r?`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n kStart + inputRow,\n globalRowStart + inputCol * ${t});\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n globalRow + innerRow,\n kStart + inputCol * ${t});\n `,Oie=(r,t,e,o)=>{if(r)return`\n for (var k = 0; k < ${o}; k++) {\n let BCached0 = mm_Bsub[k][tileCol];\n let ACached0 = mm_Asub[k][localRow];\n for (var i = 0; i < ${e}; i++) {\n acc[i] = fma(BCached0, vec4(ACached0[i]), acc[i]);\n }\n }`;{let n=\"\",s=\"\";for(let a=0;a(ACached[${a}]), acc[i]);`;return`\n for (var k = 0; k < ${o/t}; k++) {\n ${n}\n for (var i = 0; i < ${e}; i++) {\n let ACached = mm_Asub[tileRow + i][k];\n ${s}\n }\n }`}};function Np(r,t,e=!1,o=32,n=!1,s=32,a=!1){let i=t[1]*r[1],p=t[0]*r[0],u=e?i:o,c=e?o:i,l=u/t[0],m=o/t[1],d=r[1],f=r[0];return y.assert((e&&l===4&&r[1]===4||!e&&(l===3||l===4))&&u%t[0]===0&&o%t[1]===0&&r[0]===4,()=>`If transposeA ${e} is true, innerElementSize ${l} and workPerThread[1] ${r[1]} must be 4.\n Otherwise, innerElementSize ${l} must be 3 or 4.\n tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${o} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${r[0]} must be 4.`),`\n var mm_Asub : array, ${u/l}>, ${c}>;\n var mm_Bsub : array, ${p/r[0]}>, ${o}>;\n\n ${G()} {\n let localRow = i32(localId.y);\n let tileRow = localRow * ${d};\n let tileCol = i32(localId.x);\n\n let globalRow = i32(globalId.y) * ${d};\n let globalCol = i32(globalId.x) * ${f};\n let batch = ${n?\"0\":\"i32(globalId.z)\"};\n let batchA = ${n||!a?\"batch\":\"batch % uniforms.aShape[0]\"};\n let batchB = ${n||!a?\"batch\":\"batch % uniforms.bShape[0]\"};\n let globalRowStart = i32(workgroupId.y) * ${i};\n\n let numTiles = ${n?`${Math.ceil(s/o)}`:`(uniforms.dimInner - 1) / ${o} + 1`};\n var kStart = ${n?`i32(globalId.z) * ${s}`:\"0\"};\n\n var acc: array, ${d}>;\n\n // Loop over shared dimension.\n let tileRowB = localRow * ${m};\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${d}; innerRow++) {\n let inputRow = tileRow + innerRow;\n let inputCol = tileCol;\n ${Pie(e,l)}\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${m}; innerRow++) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB, kStart + inputRow, globalCol);\n }\n kStart = kStart + ${o};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n ${Oie(e,l,d,o)}\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < ${d}; innerRow++) {\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\n }\n }`}var ez=r=>r?`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n kStart + inputRow,\n globalRowStart + inputCol);\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n globalRowStart + inputRow,\n kStart + inputCol);\n `,Mie=r=>r?\"let ACached = mm_Asub[k][tileRow + innerRow];\":\"let ACached = mm_Asub[tileRow + innerRow][k];\";function Tp(r,t,e=!1,o=32,n=!1,s=32,a=!1,i=!1){let p=r[1]*t[1],u=r[0]*t[0],c=e?p:o,l=e?o:p;y.assert(l%t[1]===0&&c%t[0]===0&&o%t[1]===0,()=>`tileAHight ${l} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${c} must be divisible by workgroupSize[0]${t[0]}, tileInner ${o} must be divisible by workgroupSize[1]${t[1]}`);let m=l/t[1],d=c/t[0],f=o/t[1],h=r[1],g=r[0],x=a?`\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n let globalRowStart = i32(workgroupId.y) * ${p};\n let globalColStart = i32(workgroupId.x) * ${u};\n\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var inputRow = localRow; inputRow < ${l}; inputRow = inputRow + ${t[1]}) {\n for (var inputCol = localCol; inputCol < ${c}; inputCol = inputCol + ${t[0]}) {\n ${ez(e)}\n }\n }\n // Load one tile of B into local memory.\n for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${t[1]}) {\n for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${t[0]}) {\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB,\n kStart + inputRow,\n globalColStart + inputCol);\n }\n }\n kStart = kStart + ${o};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array;\n for (var k = 0; k < ${o}; k++) {\n for (var inner = 0; inner < ${g}; inner++) {\n BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}];\n }\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n let ACached = ${e?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`}\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n acc[innerRow][innerCol] =\n fma(ACached, BCached[innerCol], acc[innerRow][innerCol]);\n }\n }\n }\n workgroupBarrier();\n }\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n let gRow = globalRowStart + localRow + innerRow * ${t[1]};\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n let gCol = globalColStart + localCol + innerCol * ${t[0]};\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\n }\n }\n `:`\n let tileRow = i32(localId.y) * ${h};\n let tileCol = i32(localId.x) * ${g};\n\n let globalRow = i32(globalId.y) * ${h};\n let globalCol = i32(globalId.x) * ${g};\n let globalRowStart = i32(workgroupId.y) * ${p};\n\n let tileRowA = i32(localId.y) * ${m};\n let tileColA = i32(localId.x) * ${d};\n let tileRowB = i32(localId.y) * ${f};\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${m}; innerRow++) {\n for (var innerCol = 0; innerCol < ${d}; innerCol++) {\n let inputRow = tileRowA + innerRow;\n let inputCol = tileColA + innerCol;\n ${ez(e)}\n }\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${f}; innerRow++) {\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol + innerCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB,\n kStart + inputRow,\n globalCol + innerCol);\n }\n }\n kStart = kStart + ${o};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array;\n for (var k = 0; k < ${o}; k++) {\n for (var inner = 0; inner < ${g}; inner++) {\n BCached[inner] = mm_Bsub[k][tileCol + inner];\n }\n\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n ${Mie(e)}\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n acc[innerRow][innerCol] =\n fma(ACached, BCached[innerCol], acc[innerRow][innerCol]);\n }\n }\n }\n\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\n acc[innerRow][innerCol]);\n }\n }\n `;return`\n var mm_Asub : array, ${l}>;\n var mm_Bsub : array, ${o}>;\n\n ${G()} {\n let batch = ${n?\"0\":\"i32(globalId.z)\"};\n let batchA = ${n||!i?\"batch\":\"batch % uniforms.aShape[0]\"};\n let batchB = ${n||!i?\"batch\":\"batch % uniforms.bShape[0]\"};\n let numTiles = ${n?`${Math.ceil(s/o)}`:`(uniforms.dimInner - 1) / ${o} + 1`};\n var kStart = ${n?`i32(globalId.z) * ${s}`:\"0\"};\n\n var acc : array, ${h}>;\n\n // Without this initialization strange values show up in acc.\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n acc[innerRow][innerCol] = 0.0;\n }\n }\n ${x}\n }\n `}var Lie=r=>r?`\n mm_readA(batchA, colA, globalRow),\n mm_readA(batchA, colA + 1, globalRow),\n mm_readA(batchA, colA + 2, globalRow),\n mm_readA(batchA, colA + 3, globalRow)\n `:`\n mm_readA(batchA, globalRow, colA),\n mm_readA(batchA, globalRow, colA + 1),\n mm_readA(batchA, globalRow, colA + 2),\n mm_readA(batchA, globalRow, colA + 3)\n `;function Bie(r,t=!1){y.assert(r[1]===1&&r[2]===1,()=>`A linear work group size is required. But got ${r}.`);let e=r[0]*4;return`\n var mm_Asub : array, ${r[0]}>;\n\n ${G()} {\n let tileCol = i32(localId.x);\n let globalCol = i32(globalId.x);\n let globalRow = i32(globalId.y);\n\n let numTiles = (uniforms.dimInner - 1) / ${e} + 1;\n let batch = i32(globalId.z);\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n // Without this initialization strange values show up in acc.\n var acc = 0.0;\n\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n let colA = t * ${e} + tileCol * 4;\n mm_Asub[tileCol] = vec4(${Lie(t)});\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n for (var k = 0; k < ${e/4}; k++) {\n let rowB = t * ${e} + k * 4;\n let BCached = vec4(mm_readB(batchB, rowB, globalCol),\n mm_readB(batchB, rowB + 1, globalCol),\n mm_readB(batchB, rowB + 2, globalCol),\n mm_readB(batchB, rowB + 3, globalCol));\n\n let ACached = mm_Asub[k];\n acc = acc + dot(ACached, BCached);\n }\n\n workgroupBarrier();\n }\n\n mm_write(batch, globalRow, globalCol, acc);\n }\n `}var jg=class{constructor(t,e,o=!1,n=!1,s=null,a=null,i=null,p=!1){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.outputShape=e,this.dispatchLayout={x:[2],y:[1],z:[0]};let u=o?t[1]:t[2];if(this.isVec4=(u%4===0&&!o||e[1]%4===0&&o)&&e[2]%4===0&&!n,this.outputComponent=this.isVec4?4:1,this.isVectorA=e[1]===1&&!o,!this.isVec4&&this.isVectorA)this.elementsPerThread=[1,1,1],this.workgroupSize=[32,1,1];else{let m=Yv(e[1],u,e[2],o);this.workgroupSize=m.workgroupSize,this.elementsPerThread=m.elementsPerThread}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread);let c=s!=null,l=i!=null;c&&this.variableNames.push(\"bias\"),l&&this.variableNames.push(\"preluActivationWeights\"),this.sequentialAccessByThreads=p,this.transposeA=o,this.transposeB=n,this.addBias=c,this.activation=a,this.hasPreluActivationWeights=l,[this.fitAOuter,this.fitBOuter,this.fitInner]=this.getShapeFit(e[1],e[2],u),this.shaderKey=`matMulPacked_${this.elementsPerThread}_${o}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`}getShapeFit(t,e,o){let n=this.workgroupSize[1]*this.elementsPerThread[1],s=this.workgroupSize[0]*this.elementsPerThread[0];!this.isVec4&&this.isVectorA?this.tileInner=this.workgroupSize[0]*4:this.tileInner=s;let a=t%n===0,i=e%s===0,p=o%this.tileInner===0;return[a,i,p]}getUserCode(){return`\n ${dr(this.activation,this.hasPreluActivationWeights,this.isVec4)}\n ${dm(this.addBias,this.activation,!1,this.transposeB,this.fitAOuter,this.fitBOuter,this.fitInner,this.isVec4?4:1)}\n ${this.isVec4?Np(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,!0):this.isVectorA?Bie(this.workgroupSize,this.transposeA):Tp(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,this.sequentialAccessByThreads,!0)}\n `}};function zie(r){return`\n var sumValues : array;\n ${G()} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n let row = coords[1];\n let col = coords[2];\n var sum = 0.0;\n let Length = uniforms.dimInner;\n for (var k = i32(localId.x); k < Length; k = k + ${r}) {\n let dataA = mm_readA(batchA, row, k);\n let dataB = mm_readB(batchB, k, col);\n sum = sum + dataA * dataB;\n }\n sumValues[localId.x] = sum;\n workgroupBarrier();\n\n for(var currentSize = ${r/2}u; currentSize > 1u;\n currentSize = currentSize / 2u) {\n if (localId.x < currentSize)\n {\n sumValues[localId.x] = sumValues[localId.x] + sumValues[localId.x + currentSize];\n }\n workgroupBarrier();\n }\n\n if (localId.x == 0u) {\n sum = sumValues[0] + sumValues[1];\n mm_write(batch, row, col, sum);\n }\n }\n `}var Xg=class{constructor(t,e=!1,o=!1,n=null,s=null,a=null){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.workgroupSize=[256,1,1],this.outputShape=t,this.dispatchLayout={x:[],y:[1,2],z:[0]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize);let i=n!=null,p=a!=null;i&&this.variableNames.push(\"bias\"),p&&this.variableNames.push(\"preluActivationWeights\"),this.transposeA=e,this.transposeB=o,this.addBias=i,this.activation=s,this.hasPreluActivationWeights=p,this.shaderKey=`matMulReduce_${this.activation}_${e}_${o}`}getUserCode(){return`\n ${dr(this.activation,this.hasPreluActivationWeights)}\n ${dm(this.addBias,this.activation,this.transposeA,this.transposeB)}\n ${zie(this.workgroupSize[0])}\n `}};function Vie(r){let t=r[1],e=r[0],o=t>e?t:e;return`\n var mm_Asub : array, ${t}>;\n var mm_Bsub : array, ${o}>;\n\n // If the output size is small for matrix multiplication, avoid to use vec4\n // and handle some elements per thread to optimally utilize the ALU.\n // Read data from global memory to registers firstly, then store them into\n // shared memory, so it is instruction-Level parallelism for arithmetic\n // operations and others handle IO operations between barrier api, makes ALU\n // and load/store units work simultaneously, could improves the performance.\n ${G()} {\n let tileRow = i32(localId.y);\n let tileCol = i32(localId.x);\n let globalRow = i32(globalId.y);\n let globalCol = i32(globalId.x);\n let batch = i32(globalId.z);\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n\n // uniforms.dimInner should be greater than 0.\n let numTiles = (uniforms.dimInner - 1) / ${o} + 1;\n var acc = 0.0;\n\n var globalColA = tileCol;\n var globalRowB = 0;\n var regA = mm_readA(batchA, globalRow, globalColA);\n var regB0 = mm_readB(batchB, globalRowB + 2 * tileRow, globalCol);\n var regB1 = mm_readB(batchB, globalRowB + 2 * tileRow + 1, globalCol);\n globalColA = globalColA + ${o};\n globalRowB = globalRowB + ${o};\n\n for (var t = 0; t < numTiles; t = t + 1) {\n mm_Asub[tileRow][tileCol] = regA;\n mm_Bsub[2 * tileRow][tileCol] = regB0;\n mm_Bsub[2 * tileRow + 1][tileCol] = regB1;\n\n workgroupBarrier();\n\n regA = mm_readA(batchA, globalRow, globalColA);\n regB0 = mm_readB(batchB, globalRowB + 2 * tileRow, globalCol);\n regB1 = mm_readB(batchB, globalRowB + 2 * tileRow + 1, globalCol);\n globalColA = globalColA + ${o};\n globalRowB = globalRowB + ${o};\n\n for (var k = 0; k < ${o}; k = k + 1) {\n acc = acc + mm_Asub[tileRow][k] * mm_Bsub[k][tileCol];\n }\n workgroupBarrier();\n }\n\n mm_write(batch, globalRow, globalCol, acc);\n }\n `}var Yg=class{constructor(t,e,o,n=!1,s=!1,a=null,i=null,p=null){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.workgroupSize=[16,8,1],this.outputShape=o,this.dispatchLayout={x:[2],y:[1],z:[0]},this.dispatch=[Math.ceil(o[2]/this.workgroupSize[0]),Math.ceil(o[1]/this.workgroupSize[1]),o[0]];let u=a!=null;u&&this.variableNames.push(\"bias\");let c=p!=null;c&&this.variableNames.push(\"preluActivationWeights\"),this.transposeA=n,this.transposeB=s,this.addBias=u,this.activation=i,this.hasPreluActivationWeights=c,this.shaderKey=`matMulSmallOutputSize_${this.activation}_${n}_${s}`}getUserCode(){return`\n ${dr(this.activation,this.hasPreluActivationWeights)}\n ${dm(this.addBias,this.activation,this.transposeA,this.transposeB)}\n ${Vie(this.workgroupSize)}\n `}};var Qg=class{constructor(t,e,o=!1,n=!1){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.workgroupSize=[8,8,1],this.atomic=!0,this.splitedDimInner=128,y.assert(t[0]===1,()=>\"MatMulSplitKProgram only supports batch = 1.\"),this.outputShape=t,this.dispatchLayout={x:[2],y:[1],z:[0,3]};let s=(o&&this.outputShape[1]%4===0||!o&&e%4===0)&&this.outputShape[2]%4===0;this.elementsPerThread=[4,4,this.splitedDimInner],this.outputComponent=s?4:1,s||(this.outputShape[1]<16&&(this.elementsPerThread[1]=1),this.outputShape[2]<16&&(this.elementsPerThread[0]=1)),this.dispatch=H(this.dispatchLayout,[this.outputShape[0],this.outputShape[1],this.outputShape[2],e],this.workgroupSize,this.elementsPerThread),this.transposeA=o,this.transposeB=n,this.shaderKey=`matMulSplitK_${o}_${n}_${this.elementsPerThread}_${this.outputComponent}`}getUserCode(){let t=this.outputComponent;return`\n ${Zv(!1,this.transposeB,!1,!1,!1,t)}\n fn mm_write(batch: i32, row : i32, col : i32, value : ${Ae(t)}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) {\n let coords = vec3(batch, row, col);\n let flatIndex = getOutputIndexFromCoords(coords);\n // The problem is that we should initialize output to zero before using.\n // Otherwise, the original value will be added to the result.\n for (var i = 0; i < ${t}; i = i + 1) {\n ${Yr(\"&result[flatIndex + i]\",`${t>1?\"value[i]\":\"value\"}`,\"float32\")}\n }\n }\n }\n ${t===4?Np(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner):Tp(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner)}\n `}},Zg=class{constructor(t,e=null,o=null,n=null){this.uniforms=\"\",this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=e!=null,this.hasPreluActivationWeights=n!=null,this.activation=o,this.addBias&&this.variableNames.push(\"bias\"),this.hasPreluActivationWeights&&this.variableNames.push(\"preluActivationWeights\"),this.shaderKey=`biasActivation_${o}`}getUserCode(){return`\n ${dr(this.activation,this.hasPreluActivationWeights)}\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var value = getXByOutputIndex(index);\n ${Qr(this.addBias,this.activation)}\n setOutputAtIndex(index, value);\n }\n }\n `}};var Jg=class{constructor(t){this.variableNames=[],this.outputShape=[],this.uniforms=\"value : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"fill\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n setOutputAtIndex(index, uniforms.value);\n }\n }\n `}};function vt(r){let{backend:t,attrs:e}=r,{shape:o,value:n}=e,{dtype:s}=e;if(s=s||y.inferDtype(n),s===\"string\"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),t.makeTensorInfo(o,s,a)}else{let a=new Jg(o),i=[{type:\"float32\",data:[n]}];return t.runWebGPUProgram(a,[],s,i)}}var tz={kernelName:sa,backendName:\"webgpu\",kernelFunc:vt};function pe(r){let{inputs:t,attrs:e}=r,{x:o}=t,{shape:n}=e,s=y.sizeFromShape(o.shape),a=y.inferFromImplicitShape(n,s),i=y.sizeFromShape(a);return y.assert(s===i,()=>`The new shape (${a}) has ${i} elements and the old shape (${o.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var rz={kernelName:da,backendName:\"webgpu\",kernelFunc:pe};function _p({a:r,b:t,transposeA:e,transposeB:o,backend:n,bias:s=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:p=null}){let u=r.shape.length,c=t.shape.length,l=e?r.shape[u-2]:r.shape[u-1],m=o?t.shape[c-1]:t.shape[c-2],d=e?r.shape[u-1]:r.shape[u-2],f=o?t.shape[c-2]:t.shape[c-1],h=r.shape.slice(0,-2),g=t.shape.slice(0,-2),x=y.sizeFromShape(h),b=y.sizeFromShape(g),S=Sr.assertAndGetBroadcastShape(r.shape.slice(0,-2),t.shape.slice(0,-2)).concat([d,f]);y.assert(l===m,()=>`Error in matMul: inner shapes (${l}) and (${m}) of Tensors with shapes ${r.shape} and ${t.shape} and transposeA=${e} and transposeB=${o} must match.`);let k=e?[x,l,d]:[x,d,l],_=o?[b,f,m]:[b,m,f],E=pe({inputs:{x:r},backend:n,attrs:{shape:k}}),R=pe({inputs:{x:t},backend:n,attrs:{shape:_}}),D=[E,R],P=Math.max(x,b),O=[E,R],M=[{type:\"int32\",data:[d]},{type:\"int32\",data:[f]},{type:\"int32\",data:[l]}],L,B,z=[P,d,f],U=A().get(\"WEBGPU_MATMUL_PROGRAM_TYPE\");if(U<0){let q=A().getNumber(\"WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL\"),Y=q>0?q:n.thresholdToIncreaseWorkgroups,J=P*Math.ceil(d/32)*Math.ceil(f/32);J<=Y||d<=8&&J<=Y*2?P*d*f<=128?U=Mo.MatMulReduceProgram:P===1&&m>=2e3?U=Mo.MatMulSplitKProgram:U=Mo.MatMulSmallOutputSizeProgram:U=Mo.MatMulPackedProgram}switch(U){case Mo.MatMulReduceProgram:L=new Xg(z,e,o,s,p,a);break;case Mo.MatMulSplitKProgram:{if(B=vt({backend:n,attrs:{shape:z,value:0,dtype:r.dtype}}),L=new Qg(z,m,e,o),s||p){B=n.runWebGPUProgram(L,O,r.dtype,M,B);let Y=new Zg(B.shape,s,p,a),J=null,re=[B];s&&re.push(s),a&&re.push(a),p===\"leakyrelu\"&&(J=[{type:\"float32\",data:[i]}],Y.uniforms+=\" alpha : f32,\");let ne=n.runWebGPUProgram(Y,re,B.dtype,J);D.push(B);let ee=pe({inputs:{x:ne},backend:n,attrs:{shape:S}});D.push(ne);for(let oe of D)n.disposeData(oe.dataId);return ee}break}case Mo.MatMulSmallOutputSizeProgram:L=new Yg(k,_,z,e,o,s,p,a);break;case Mo.MatMulPackedProgram:let q=n.adapterInfo.isIntel();L=new jg(k,z,e,o,s,p,a,q);break;default:throw new Error(`Unsupported MatMulProgramType ${U}.`)}s&&O.push(s),a&&O.push(a),p===\"leakyrelu\"&&(M.push({type:\"float32\",data:[i]}),L.uniforms+=\" alpha : f32,\"),B=n.runWebGPUProgram(L,O,r.dtype,M,B);let j=pe({inputs:{x:B},backend:n,attrs:{shape:S}});D.push(B);for(let q of D)n.disposeData(q.dataId);return j}function Wie(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=t,{transposeA:p,transposeB:u,activation:c,leakyreluAlpha:l}=o;return _p({a:n,b:s,transposeA:p,transposeB:u,backend:e,bias:a,preluActivationWeights:i,leakyreluAlpha:l,activation:c})}var oz={kernelName:So,backendName:\"webgpu\",kernelFunc:Wie};var fm=class{constructor(t,e,o){this.variableNames=[\"AReal\",\"AImag\",\"BReal\",\"BImag\"],this.workgroupSize=[128,1,1],this.size=!0,this.outputShape=w.assertAndGetBroadcastShape(e,o),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`binaryOpComplex_${t}`,this.op=t}getUserCode(){return`\n fn binaryOpComplex(\n areal : f32, aimag : f32, breal : f32, bimag : f32) -> f32 {\n ${qc(this.op,!1)}\n }\n\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let areal = getARealByOutputIndex(index);\n let aimag = getAImagByOutputIndex(index);\n let breal = getBRealByOutputIndex(index);\n let bimag = getBImagByOutputIndex(index);\n setOutputAtIndex(index, binaryOpComplex(areal, aimag, breal, bimag));\n }\n }\n `}};var Si=class{constructor(t,e,o){if(this.size=!0,this.variableNames=[\"A\",\"B\"],this.outputShape=w.assertAndGetBroadcastShape(e,o),this.dispatchLayout=X(this.outputShape),this.op=t,this.useSharedMemoryWithA=e.length<=1&&o.length>1&&e[0]<128,this.useSharedMemoryWithB=o.length<=1&&e.length>1&&o[0]<128,this.useSharedMemoryWithA||this.useSharedMemoryWithB)this.outputComponent=1,this.variableComponents=[1,1],this.lastDimensionSize=this.useSharedMemoryWithB?o[0]:e[0],this.shaderKey=`binary_${t}_${this.lastDimensionSize}`,this.type=\"shared\",this.workgroupSize=[256,1,1];else{let n=e.length>0&&e[e.length-1]%4===0,s=o.length>0&&o[o.length-1]%4===0;n&&s?(this.outputComponent=4,this.variableComponents=[4,4]):n&&(y.isScalarShape(o)||o[o.length-1]===1)||s&&(y.isScalarShape(e)||e[e.length-1]===1)?(this.outputComponent=4,this.variableComponents=n?[4,1]:[1,4]):(this.outputComponent=1,this.variableComponents=[1,1]),this.type=\"nonshared\",this.shaderKey=`binary_${t}_${this.variableComponents}`,this.workgroupSize=[128,1,1]}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.outputComponent,1,1])}getUserCode(){let t,e=this.outputComponent===4?\"vec4\":\"f32\",o=`\n fn binaryOperation(a : ${e}, b : ${e}) -> ${e} {\n ${qc(this.op,this.outputComponent===4)}\n };\n `;if(this.type===\"shared\"){let n=this.lastDimensionSize>1?`coords[${this.outputShape.length-1}]`:\"0\",s=this.useSharedMemoryWithB?`let a = getAByOutputIndex(index);\n let b = sharedBuf[${n}];`:`let a = sharedBuf[${n}];\n let b = getBByOutputIndex(index);`;t=`\n ${o}\n var sharedBuf : array;\n ${G(\"index\")} {\n // Fill in the shared memory buffer.\n let localIndex = i32(localId.x);\n if(localIndex < ${this.lastDimensionSize}) {\n sharedBuf[localIndex] = f32(${this.useSharedMemoryWithB?\"B\":\"A\"}[localIndex]);\n }\n workgroupBarrier();\n\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n ${s}\n setOutputAtIndex(index, binaryOperation(a, b));\n }\n }\n `}else t=`\n ${o}\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index * ${this.outputComponent});\n let a = ${e}(getAByOutputCoords(coords));\n let b = ${e}(getBByOutputCoords(coords));\n setOutputAtIndex(index, binaryOperation(a, b));\n }\n }\n `;return t}};function At(r){let{inputs:t}=r,{x:e}=t;return r.backend.incRef(e.dataId),{dataId:e.dataId,shape:e.shape,dtype:e.dtype}}var nz={kernelName:Co,backendName:\"webgpu\",kernelFunc:At};function xo(r){let{inputs:t,backend:e}=r,{real:o,imag:n}=t,s=e.makeTensorInfo(o.shape,\"complex64\"),a=e.tensorMap.get(s.dataId),i=At({inputs:{x:o},backend:e}),p=At({inputs:{x:n},backend:e});return a.complexTensorInfos={real:i,imag:p},s}var sz={kernelName:Ri,backendName:\"webgpu\",kernelFunc:xo};var Zr=class{constructor(t,e,o=\"\"){this.variableNames=[\"A\"],this.size=!0;let n=128;this.workgroupSize=[n,1,1],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.op=e,o!==\"\"&&(this.uniforms=o),this.shaderKey=`unary_${e}`}getUserCode(){return`\n fn unaryOperation(a : f32) -> f32 {\n ${wi(this.op,!1)}\n }\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let a = getAByOutputIndex(index);\n setOutputAtIndex(index, unaryOperation(a));\n }\n }\n `}};function ye({opType:r,cpuKernelImpl:t,dtype:e}){return({inputs:o,backend:n})=>{let{x:s}=o,a=n,i=e||s.dtype;if(a.shouldExecuteOnCPU([s])&&t!=null){let u=a.tensorMap.get(s.dataId),c=t(u.values,i);return a.makeTensorInfo(s.shape,i,c)}let p=new Zr(s.shape,r);return a.runWebGPUProgram(p,[s],i)}}function et({opType:r,cpuKernelImpl:t,supportsComplex:e=!1,dtype:o}){return({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(e&&a.dtype===\"complex64\"){let l=p.tensorMap.get(a.dataId),m=p.tensorMap.get(i.dataId),d,f;if(r!==fe.MUL)[d,f]=[[l.complexTensorInfos.real,m.complexTensorInfos.real],[l.complexTensorInfos.imag,m.complexTensorInfos.imag]].map(g=>{let[x,b]=g,C={dataId:x.dataId,dtype:x.dtype,shape:a.shape},S={dataId:b.dataId,dtype:b.dtype,shape:i.shape},k=new Si(r,a.shape,i.shape);return p.runWebGPUProgram(k,[C,S],dt(x.dtype,b.dtype))});else{let g=new fm(fe.COMPLEX_MULTIPLY_REAL,a.shape,i.shape),x=new fm(fe.COMPLEX_MULTIPLY_IMAG,a.shape,i.shape),b=[{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},{dataId:m.complexTensorInfos.real.dataId,dtype:m.complexTensorInfos.real.dtype,shape:i.shape},{dataId:m.complexTensorInfos.imag.dataId,dtype:m.complexTensorInfos.imag.dtype,shape:i.shape}];d=p.runWebGPUProgram(g,b,\"float32\"),f=p.runWebGPUProgram(x,b,\"float32\")}let h=xo({inputs:{real:d,imag:f},backend:p});return p.disposeData(d.dataId),p.disposeData(f.dataId),h}let u=o||dt(a.dtype,i.dtype);if((a.dtype===\"string\"||i.dtype===\"string\"||p.shouldExecuteOnCPU([a,i]))&&t!=null){let l=p.tensorMap.get(a.dataId).values,m=p.tensorMap.get(i.dataId).values,d=a.dtype===\"string\"?w.fromUint8ToStringArray(l):l,f=a.dtype===\"string\"?w.fromUint8ToStringArray(m):m,[h,g]=t(a.shape,i.shape,d,f,u);return p.makeTensorInfo(g,u,h)}let c=new Si(r,a.shape,i.shape);return p.runWebGPUProgram(c,[a,i],u)}}var{addImpl:az,castImpl:iz,ceilImpl:uz,concatImpl:pz,equalImpl:cz,expImpl:lz,expm1Impl:mz,floorImpl:dz,floorDivImpl:fz,gatherNdImpl:hz,gatherV2Impl:gz,greaterEqualImpl:xz,greaterImpl:yz,lessEqualImpl:bz,lessImpl:Cz,logImpl:wz,maxImpl:Sz,maximumImpl:Iz,minimumImpl:vz,multiplyImpl:kz,negImpl:Nz,notEqualImpl:Tz,prodImpl:_z,rangeImpl:$z,rsqrtImpl:Ez,scatterImpl:Rz,simpleAbsImpl:Dz,sliceImpl:Az,stridedSliceImpl:Fz,stringNGramsImpl:Pz,subImpl:Oz,tileImpl:Mz,topKImpl:Lz,transposeImpl:Bz,uniqueImpl:KPt}=wc;var Uie=ye({opType:Z.ABS,cpuKernelImpl:Dz}),zz={kernelName:Xs,backendName:\"webgpu\",kernelFunc:Uie};var Gie=ye({opType:Z.ACOS}),Vz={kernelName:Vo,backendName:\"webgpu\",kernelFunc:Gie};var Hie=ye({opType:Z.ACOSH}),Wz={kernelName:Wo,backendName:\"webgpu\",kernelFunc:Hie};var Kie=et({opType:fe.ADD,cpuKernelImpl:az,supportsComplex:!0}),Uz={kernelName:io,backendName:\"webgpu\",kernelFunc:Kie};var ex=class{constructor(t){this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t[0],this.variableNames=t.map((e,o)=>`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey=\"addN\"}getUserCode(){let t=[];this.variableNames.forEach(n=>{t.push(`let v${n} = get${n}ByOutputCoords(coords);`)});let e=this.variableNames.map(n=>`v${n}`).join(\" + \");return`\n ${G(\"index\")} {\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let flatIndex = index * ${this.workPerThread} + i;\n if (flatIndex < uniforms.size) {\n let coords = getCoordsFromIndex(flatIndex);\n ${t.join(`\n `)}\n setOutputAtIndex(flatIndex, ${e});\n }\n }\n }\n `}};function qie(r){let{inputs:t,backend:e}=r,o=t;if(o.length===1)return At({inputs:{x:o[0]},backend:e});let n=o.map(i=>i.dtype).reduce((i,p)=>dt(i,p)),s=o.map(i=>i.shape),a=new ex(s);return e.runWebGPUProgram(a,o,n)}var Gz={kernelName:Uo,backendName:\"webgpu\",kernelFunc:qie};var tx=class{constructor(t,e){this.variableNames=[\"A\"],this.workgroupSize=[16,16,1];let o=new Array(t.length);for(let n=0;n`Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`);let t=this.workgroupSize[0];return`\n var tile : array, ${this.workgroupSize[0]}>;\n ${G()} {\n var x = i32(workgroupId.x) * ${t} + i32(localId.x);\n var y = i32(workgroupId.y) * ${t} + i32(localId.y);\n let width = uniforms.outShape[0];\n let height = uniforms.outShape[1];\n if (x < width && y < height) {\n tile[localId.y][localId.x] = f32(A[y * width + x]);\n }\n workgroupBarrier();\n\n x = i32(workgroupId.y) * ${t} + i32(localId.x);\n y = i32(workgroupId.x) * ${t} + i32(localId.y);\n if (x < height && y < width) {\n setOutputAtIndex((y * height + x), tile[localId.x]\n [localId.y]);\n }\n }\n `}};var rx=class{constructor(t,e){this.variableNames=[\"A\"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0;let o=new Array(t.length);for(let n=0;n6)throw Error(`Transpose for rank ${t} is not yet supported`);let e=new Array(t);for(let o=0;o=32768&&o>=512?this.workgroupSize=[512,1,1]:t.inSize>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1]),this.reduceType=e,this.shaderKey=`reduce_${e}`}getUserCode(){let t=\"\",e=\"0.0\",o=this.workgroupSize[0];this.reduceType===\"min\"||this.reduceType===\"max\"?(t=`\n if (isnan(candidate)) {\n bestValue = uniforms.NAN;\n } else if (!isnan(bestValue) && candidate ${this.reduceType===\"min\"?\"<\":\">\"} bestValue)\n { bestValue = candidate; }`,e=\"f32(x[offset])\"):this.reduceType===\"sum\"||this.reduceType===\"mean\"?t=\" bestValue = bestValue + candidate; \":this.reduceType===\"prod\"?(t=\" bestValue = bestValue * candidate; \",e=\"1.0\"):this.reduceType===\"all\"?(t=\" bestValue = f32(bestValue >= 1.0 && candidate >= 1.0); \",e=\"1.0\"):this.reduceType===\"any\"&&(t=\" bestValue = f32(bestValue >= 1.0 || candidate >= 1.0); \",e=\"0.0\");let n=this.reduceType===\"mean\"?\"setOutputAtIndex(outputIndex, bestValue / f32(uniforms.reduceSize));\":\"setOutputAtIndex(outputIndex, bestValue);\";return`\n fn DIV_CEIL(a : u32, b : u32) -> u32 {\n return ((a - 1u) / b + 1u);\n }\n\n ${`\n var xBestValues : array;\n `}\n fn getOffset(outputIndex : i32) -> i32 {\n let outputCoords = getCoordsFromIndex(outputIndex);\n let offset = ${this.outputShape.length===1?\"outputCoords\":\"outputCoords[0]\"} * uniforms.reduceSize;\n return offset;\n }\n ${G(\"index\")} {\n let outputIndex = index / ${o};\n let offset = getOffset(outputIndex);\n var bestValue = ${e};\n let Length = uniforms.reduceSize;\n let WorkPerThread = DIV_CEIL(u32(Length), ${o}u);\n for (var k = i32(localId.x); k < Length && outputIndex < uniforms.size;\n k = k + ${o}) {\n let candidate = f32(x[offset + k]);\n ${t}\n }\n xBestValues[localId.x] = bestValue;\n workgroupBarrier();\n\n var reduceSize = min(u32(Length), ${o}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (localId.x < currentSize) {\n let candidate = xBestValues[localId.x + interval];\n ${t}\n xBestValues[localId.x] = bestValue;\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (localId.x == 0u && outputIndex < uniforms.size) {\n ${n}\n }\n }\n `}};var jie={mean:\"float32\",all:\"bool\",any:\"bool\"};function Jr(r,t,e,o,n){let s=r.shape.length,a=[],i=y.parseAxisParam(t,r.shape),p=i,u=w.getAxesPermutation(p,s),c=r;u!=null&&(c=xr({inputs:{x:r},attrs:{perm:u},backend:n}),p=w.getInnerMostAxes(p.length,s),a.push(c)),w.assertAxesAreInnerMostDims(o,p,s);let[l,m]=w.computeOutAndReduceShapes(c.shape,p),d=l;e&&(d=w.expandShapeToKeepDim(l,i));let f;if((o===\"max\"||o===\"prod\")&&n.shouldExecuteOnCPU([c])){let h=n.tensorMap.get(c.dataId).values;switch(o){case\"max\":let g=Sz(h,y.sizeFromShape(m),d,r.dtype);f=n.makeTensorInfo(d,r.dtype,g);break;case\"prod\":let{outVals:x,outShape:b,outDtype:C}=_z(c.shape,c.dtype,h,p);f=n.makeTensorInfo(b,C,x);break;default:throw new Error(`${o} CPU implementation is not yet supported.`)}}else{let h=y.sizeFromShape(m),x=y.sizeFromShape(c.shape)/h,b={windowSize:h,inSize:h,batchSize:x,outSize:1},C=jie[o]||oi(r.dtype),S=[{type:\"int32\",data:[h]}],k=new ox(b,o,n.device.limits.maxComputeWorkgroupSizeX),_=n.runWebGPUProgram(k,[c],C,S);a.push(_),f=pe({inputs:{x:_},attrs:{shape:d},backend:n})}return a.forEach(h=>n.disposeData(h.dataId)),f}function Xie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{keepDims:s,axis:a}=o;return Jr(n,a,s,\"all\",e)}var Kz={kernelName:Go,backendName:\"webgpu\",kernelFunc:Xie};function Yie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{keepDims:s,axis:a}=o;return Jr(n,a,s,\"any\",e)}var qz={kernelName:Ho,backendName:\"webgpu\",kernelFunc:Yie};var jc=class{constructor(t,e,o){this.workgroupSize=[64,1,1],this.variableNames=[\"x\"],this.uniforms=\"infinityValue : f32,\",this.size=!0;let n=[e];this.op=o===\"min\"?\"<\":\">\";let[s,a]=w.computeOutAndReduceShapes(t,n);this.outputShape=s.length===0?[1]:s,this.dispatchLayout=X(this.outputShape),y.sizeFromShape(a)<32?(this.type=\"plain\",this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)):(this.type=\"shared\",this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1])),this.inputShape=t,this.shaderKey=`argMinMax_${this.op}_${this.type}`}getUserCode(){let t=this.workgroupSize[0],e=()=>this.inputShape.length===1?\"uniforms.xShape\":`uniforms.xShape.${Oo(this.inputShape.length-1)}`,o=()=>{let n=\"\";if(this.outputShape.length===1)this.inputShape.length!==1&&(n+=\"outputCoords,\");else for(let s=0;s u32 {\n return ((a - 1u) / b + 1u);\n }\n\n ${`\n var xBestIndices : array;\n var xBestValues : array;\n `}\n\n ${G(\"index\")} {\n let outputIndex = index / ${t};\n let reduceLength = ${e()};\n\n var bestIndex = i32(localId.x);\n var bestValue = uniforms.infinityValue;\n let outputCoords = getCoordsFromIndex(outputIndex);\n for (var k = i32(localId.x); k < reduceLength && outputIndex < uniforms.size;\n k = k + ${t}) {\n let candidate = getX(${o()} k);\n if (!isnan(candidate) && candidate ${this.op} bestValue) {\n bestValue = candidate;\n bestIndex = k;\n }\n }\n xBestValues[localId.x] = bestValue;\n xBestIndices[localId.x] = bestIndex;\n workgroupBarrier();\n\n var reduceSize = min(u32(reduceLength), ${t}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (localId.x < currentSize) {\n let candidate = xBestValues[localId.x + interval];\n if (candidate ${this.op} bestValue) {\n bestValue = candidate;\n xBestValues[localId.x] = bestValue;\n xBestIndices[localId.x] = xBestIndices[localId.x + interval];\n }\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (localId.x == 0u && outputIndex < uniforms.size) {\n setOutputAtIndexI32(outputIndex, xBestIndices[localId.x]);\n }\n }\n `:`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let outputCoords = getCoordsFromIndex(index);\n var bestIndex = 0;\n var bestValue = getX(${o()} 0);\n let reduceLength = ${e()};\n for (var i = 1; i < reduceLength; i++) {\n let candidate = getX(${o()} i);\n if (candidate ${this.op} bestValue) {\n bestValue = candidate;\n bestIndex = i;\n }\n }\n setOutputAtIndexI32(index, bestIndex);\n }\n }\n `}};function Qie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=xr({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims(\"argMax\",[a[0]],p.shape.length);let c=new jc(p.shape,a[0],\"max\"),l=[{type:\"float32\",data:[Number.NEGATIVE_INFINITY]}],m=e.runWebGPUProgram(c,[p],\"int32\",l);return u.forEach(d=>e.disposeData(d.dataId)),m}var jz={kernelName:Ys,backendName:\"webgpu\",kernelFunc:Qie};function Zie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=xr({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims(\"argMin\",[a[0]],p.shape.length);let c=new jc(p.shape,a[0],\"min\"),l=[{type:\"float32\",data:[Number.POSITIVE_INFINITY]}],m=e.runWebGPUProgram(c,[p],\"int32\",l);return u.forEach(d=>e.disposeData(d.dataId)),m}var Xz={kernelName:Qs,backendName:\"webgpu\",kernelFunc:Zie};var Jie=ye({opType:Z.ASIN}),Yz={kernelName:Ko,backendName:\"webgpu\",kernelFunc:Jie};var eue=ye({opType:Z.ASINH}),Qz={kernelName:qo,backendName:\"webgpu\",kernelFunc:eue};var tue=ye({opType:Z.ATAN}),Zz={kernelName:jo,backendName:\"webgpu\",kernelFunc:tue};var rue=et({opType:fe.ATAN2}),Jz={kernelName:Yo,backendName:\"webgpu\",kernelFunc:rue};var oue=ye({opType:Z.ATANH}),eV={kernelName:Xo,backendName:\"webgpu\",kernelFunc:oue};var nx=class{constructor(t){this.variableNames=[\"x\"],this.uniforms=\"strides : vec2,\",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"poolWithFilterSizeEqualsOne\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let xRCCorner = coords.yz * uniforms.strides;\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n\n let value = getX(batch, xRCorner, xCCorner, d);\n setOutputAtIndex(index, value);\n }\n }\n `}};var Ba=class{constructor(t,e,o=!1,n=!1,s=!1){if(this.variableNames=[\"x\"],this.uniforms=\"strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,\",this.workgroupSize=[128,1,1],this.size=!0,e===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=e,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool2D_${e}_${o}_${n}_${s}`}getUserCode(){let t;this.poolType===\"avg\"?t=\"resultValue = resultValue + value; count = count + 1.0;\":this.computePositions?t=`let currMaxValue = mix(value, maxValue, maxValueFound);\n if (value >= currMaxValue) {\n maxValue = value;\n maxValueFound = 1.0;\n maxPosition = ${this.flattenPositions?this.includeBatchIndex?\"((batch * uniforms.xShape[1] + xR) * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d\":\"(xR * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d\":\"wR * uniforms.filterDims.y + wC\"};\n }`:t=\"resultValue = max(value, resultValue);\";let e=\"resultValue\";return this.poolType===\"avg\"&&(e=\"resultValue / max(count, 1.0)\"),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n let xRCCorner = vec2(coords.yz) * uniforms.strides - uniforms.pads;\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n\n ${this.computePositions?`var maxValue = 0.0;\n var maxValueFound = 0.0;\n var maxPosition = 0;`:`var resultValue = ${this.poolType===\"avg\"?\"0.0\":\"-1.0 / pow(10.0, -20.0)\"};`}\n\n var count = 0.0;\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + uniforms.dilations.x) {\n let xR = xRCorner + wR;\n\n if (xR < 0 || xR >= uniforms.convDims.x) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + uniforms.dilations.y) {\n let xC = xCCorner + wC;\n if (xC < 0 || xC >= uniforms.convDims.y) {\n continue;\n }\n\n let value = getX(batch, xR, xC, d);\n ${t}\n }\n }\n\n ${this.computePositions?\"setOutputAtIndexI32(index, maxPosition);\":`setOutputAtIndex(index, ${e});`}\n }\n }\n `}},wu=class{constructor(t,e,o=!1,n=!1,s=!1){if(this.variableNames=[\"x\"],this.uniforms=\"strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,\",this.workgroupSize=[128,1,1],this.size=!0,e===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=e,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool3D_${e}_${o}_${n}_${s}`}getUserCode(){let t;this.poolType===\"avg\"?t=\"resultValue += value; count += 1.0;\":this.computePositions?t=`let currMaxValue = mix(value, maxValue, maxValueFound);\n if (value >= currMaxValue) {\n maxValue = value;\n maxValueFound = 1.0;\n maxPosition = ${this.flattenPositions?this.includeBatchIndex?\"(((batch * uniforms.xShape.y + xD) * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch\":\"((xD * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch\":\"wD * uniforms.filterDims.y * uniforms.filterDims.y + wR * uniforms.filterDims.z + wC\"};\n }`:t=\"resultValue = max(value, resultValue);\";let e=\"resultValue\";return this.poolType===\"avg\"&&(e=\"resultValue / max(count, 1.0)\"),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let xCorner = vec3(coords.y, coords.z, coords.w) * uniforms.strides - uniforms.pads;\n let xDCorner = xCorner.x;\n let xRCorner = xCorner.y;\n let xCCorner = xCorner.z;\n\n ${this.computePositions?`var maxValue = 0.0;\n var maxValueFound = 0.0;\n var maxPosition = 0;`:`var resultValue = ${this.poolType===\"avg\"?\"0.0\":\"-1.0 / pow(10.0, -20.0)\"};`}\n\n var count = 0.0;\n for (var wD = 0; wD < uniforms.filterDims.x; wD++) {\n let xD = xDCorner + wD;\n if (xD < 0 || xD >= uniforms.convDims.x) {\n continue;\n }\n\n for (var wR = 0; wR < uniforms.filterDims.y; wR++) {\n let xR = xRCorner + wR;\n if (xR < 0 || xR >= uniforms.convDims.y) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims.z; wC++) {\n let xC = xCCorner + wC;\n if (xC < 0 || xC >= uniforms.convDims.z) {\n continue;\n }\n\n let value = getX(batch, xD, xR, xC, ch);\n ${t}\n }\n }\n }\n\n ${this.computePositions?\"setOutputAtIndexI32(index, maxPosition);\":`setOutputAtIndex(index, ${e});`}\n }\n }\n `}};function e0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{reductionIndices:s,keepDims:a}=o;return Jr(n,s,a,\"max\",e)}var tV={kernelName:zn,backendName:\"webgpu\",kernelFunc:e0};function t0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{keepDims:s,axis:a}=o;return Jr(n,a,s,\"mean\",e)}var rV={kernelName:Un,backendName:\"webgpu\",kernelFunc:t0};function sx(r,t,e,o){if(t.filterWidth===1&&t.filterHeight===1&&y.arraysEqual(t.inShape,t.outShape))return At({inputs:{x:r},backend:o});if(t.filterWidth===t.inWidth&&t.filterHeight===t.inHeight&&t.batchSize===1&&t.padInfo.type===\"VALID\"){let a=r.shape.length,i=pe({inputs:{x:r},backend:o,attrs:{shape:[r.shape[a-3]*r.shape[a-2],r.shape[a-1]]}}),p;e===\"avg\"?p=t0({inputs:{x:i},backend:o,attrs:{axis:0,keepDims:!1}}):(y.assert(e===\"max\",()=>`Invalid pool type ${e}`),p=e0({inputs:{x:i},backend:o,attrs:{reductionIndices:0,keepDims:!1}}));let u=pe({inputs:{x:p},backend:o,attrs:{shape:t.outShape}});return o.disposeData(i.dataId),o.disposeData(p.dataId),u}let n,s=[{type:\"int32\",data:[t.strideHeight,t.strideWidth]}];return t.filterHeight===1&&t.filterWidth===1?n=new nx(t):(e===\"avg\"?n=new Ba(t,\"avg\"):(y.assert(e===\"max\",()=>`Invalid pool type ${e}`),n=new Ba(t,\"max\")),s.push({type:\"int32\",data:[t.padInfo.top,t.padInfo.left]},{type:\"int32\",data:[t.dilationHeight,t.dilationWidth]},{type:\"int32\",data:[t.inHeight,t.inWidth]},{type:\"int32\",data:[t.effectiveFilterHeight,t.effectiveFilterWidth]})),o.runWebGPUProgram(n,[r],r.dtype,s)}function nue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1,c=w.computePool2DInfo(n.shape,s,a,u,i,p);return sx(n,c,\"avg\",e)}var oV={kernelName:Qo,backendName:\"webgpu\",kernelFunc:nue};function sue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,u,p),m=new wu(l,\"avg\"),d=[{type:\"int32\",data:[l.strideDepth,l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.padInfo.front,l.padInfo.top,l.padInfo.left]},{type:\"int32\",data:[l.inDepth,l.inHeight,l.inWidth]},{type:\"int32\",data:[l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth]}];return e.runWebGPUProgram(m,[n],n.dtype,d)}var nV={kernelName:Zs,backendName:\"webgpu\",kernelFunc:sue};var ax=class{constructor(t){this.variableNames=[\"dy\"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"avgPool2DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let dyRCCorner = vec2(coords.yz) - uniforms.pads;\n let dyRCorner = dyRCCorner.x;\n let dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR = wR + uniforms.dilations[0]) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC = wC + uniforms.dilations[1]) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyR, idyC, d);\n\n dotProd = dotProd + dyValue * uniforms.avgMultiplier;\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},ix=class{constructor(t){this.variableNames=[\"dy\"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"avgPool3DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyDCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wD = 0; wD < uniforms.filterDims[0]; wD++) {\n let dyD = f32(dyDCorner + wD) / f32(uniforms.strides[0]);\n\n if (dyD < 0.0 || dyD >= f32(uniforms.outDepth) || fract(dyD) > 0.0) {\n continue;\n }\n let idyD = i32(dyD);\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyD, idyR, idyC, ch);\n dotProd += dyValue * uniforms.avgMultiplier;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function aue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=w.computePool3DInfo(a.shape,i,p,1,u,c),m=new ix(l),d=1/(l.filterDepth*l.filterHeight*l.filterWidth),f=[{type:\"int32\",data:[l.strideDepth,l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.effectiveFilterDepth-1-l.padInfo.front,l.effectiveFilterHeight-1-l.padInfo.top,l.effectiveFilterWidth-1-l.padInfo.left]},{type:\"int32\",data:[l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth]},{type:\"int32\",data:[l.outDepth]},{type:\"int32\",data:[l.outHeight]},{type:\"int32\",data:[l.outWidth]},{type:\"float32\",data:[d]}];return e.runWebGPUProgram(m,[n],a.dtype,f)}var sV={kernelName:Ei,backendName:\"webgpu\",kernelFunc:aue};function iue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s;mm([n,s],\"avgPoolGrad\");let{filterSize:i,strides:p,pad:u}=o,c=w.computePool2DInfo(a.shape,i,p,1,u),l=new ax(c),m=1/(c.filterHeight*c.filterWidth),d=[{type:\"int32\",data:[c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.effectiveFilterHeight-1-c.padInfo.top,c.effectiveFilterWidth-1-c.padInfo.left]},{type:\"int32\",data:[c.dilationHeight,c.dilationWidth]},{type:\"int32\",data:[c.effectiveFilterHeight,c.effectiveFilterWidth]},{type:\"int32\",data:[c.outHeight]},{type:\"int32\",data:[c.outWidth]},{type:\"float32\",data:[m]}];return e.runWebGPUProgram(l,[n],a.dtype,d)}var aV={kernelName:$i,backendName:\"webgpu\",kernelFunc:iue};function uue(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;return _p({a:n,b:s,transposeA:a,transposeB:i,backend:e})}var iV={kernelName:Zo,backendName:\"webgpu\",kernelFunc:uue};var ux=class{constructor(t,e){this.variableNames=[\"source\"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.rank=e.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.start=t,this.uniforms=`start : ${ft(t.length)}, `,this.shaderKey=\"slice\"}getUserCode(){let t=ft(this.rank),e=pue(this.rank),o;return this.start.length===1?o=this.outputShape.map((s,a)=>\"sourceLoc = uniforms.start + coords;\"):o=this.outputShape.map((s,a)=>`sourceLoc.${r0[a]} = uniforms.start.${Oo(a)} + coords.${r0[a]};`),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var sourceLoc : ${t};\n let coords = getCoordsFromIndex(index);\n ${o.join(`\n`)}\n setOutputAtIndex(index, getSource(${e}));\n }\n }\n `}},r0=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"];function pue(r){if(r===1)return\"sourceLoc\";if(r<=6)return r0.slice(0,r).map(t=>`sourceLoc.${t}`).join(\",\");throw Error(`Slicing for rank ${r} is not yet supported`)}function Hs(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,size:a}=o,[i,p]=pt.parseSliceParams(n,s,a);if(pt.assertParamsValid(n,i,p),e.shouldExecuteOnCPU([n])||n.dtype===\"string\"){let l=e.tensorMap.get(n.dataId),m=Az(l.values,i,p,n.shape,n.dtype);return e.makeTensorInfo(p,n.dtype,m)}if(y.sizeFromShape(p)===0)return e.makeTensorInfo(p,n.dtype,[]);let u=new ux(i,p),c=[{type:\"int32\",data:i}];return e.runWebGPUProgram(u,[n],n.dtype,c)}var uV={kernelName:ha,backendName:\"webgpu\",kernelFunc:Hs};var cue=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>\"batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet\");let i=s.reduce((b,C)=>b*C),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=[],f=pe({inputs:{x:n},backend:e,attrs:{shape:p}}),h=xr({inputs:{x:f},backend:e,attrs:{perm:u}}),g=pe({inputs:{x:h},backend:e,attrs:{shape:c}}),x=Hs({inputs:{x:g},backend:e,attrs:{begin:l,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>e.disposeData(b.dataId)),x},pV={kernelName:Js,backendName:\"webgpu\",kernelFunc:cue};var lue=`\n fn bincount_write(index: i32, value: f32) {\n ${Yr(\"&result[index]\",\"value\",\"float32\")}\n }\n`,mue=`\n fn bincount_write(index: i32, value: f32) {\n atomicStore(&result[index], bitcast(value));\n }\n`,Xc=class{constructor(t,e,o=!1){this.outputShape=[],this.variableNames=[\"x\"],this.uniforms=\"binCountSize : i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.hasWeights=!0,this.binaryOutput=!1,this.outputShape=t,this.rank=t.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.binaryOutput=o,o&&(this.atomic=!1),this.hasWeights=e,this.hasWeights&&this.variableNames.push(\"w\"),this.shaderKey=`bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`}getUserCode(){return`\n ${this.binaryOutput?mue:lue}\n ${G(\"index\")} {\n ${this.rank===1?`if (index < uniforms.xShape) {\n let indexVal = i32(getX(index));\n if (indexVal < uniforms.binCountSize) {\n let value = ${this.binaryOutput?1:this.hasWeights?\"getW(index)\":\"1.\"};\n bincount_write(indexVal, value);\n }\n }`:`let coord = getCoordsFromIndex(index);\n if (coordsInBounds2D(coord, uniforms.xShape)) {\n let indexVal = i32(getX(coord[0], coord[1]));\n if (indexVal < uniforms.binCountSize) {\n let value = ${this.binaryOutput?1:this.hasWeights?\"getW(coord[0], coord[1])\":\"1.\"};\n bincount_write(coord.x * uniforms.binCountSize + indexVal, value);\n }\n }`}\n }\n `}};function due(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=y.sizeFromShape(n.shape),u=y.sizeFromShape(s.shape)>0,c=[a],l=s.dtype,m=vt({backend:e,attrs:{shape:c,value:0,dtype:l}}),d=new Xc([i],u),f=[{type:\"int32\",data:[a]}],h=u?[n,s]:[n];return e.runWebGPUProgram(d,h,l,f,m)}var cV={kernelName:Jo,backendName:\"webgpu\",kernelFunc:due};var px=class{constructor(t){this.outputShape=[],this.variableNames=[\"s0\",\"s1\"],this.uniforms=\"s0Size : i32, s1Size : i32, \",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"broadcastArgs\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var s0 = 1.0;\n var s1 = 1.0;\n let indexS0 = index - uniforms.size + uniforms.s0Size;\n let indexS1 = index - uniforms.size + uniforms.s1Size;\n if (indexS0 >= 0) {\n s0 = getS0(indexS0);\n }\n if (indexS1 >= 0) {\n s1 = getS1(indexS1);\n }\n\n if (s0 == 1.0) {\n setOutputAtIndex(index, s1);\n } else if (s1 == 1.0) {\n setOutputAtIndex(index, s0);\n } else if (s0 != s1) {\n setOutputAtIndex(index, uniforms.NAN);\n } else {\n setOutputAtIndex(index, s0);\n }\n }\n }\n `}};function fue(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t;if(e.shouldExecuteOnCPU([o,n])){let c=e.tensorMap.get(o.dataId),l=e.tensorMap.get(n.dataId),m=c.values,d=l.values,f=w.assertAndGetBroadcastShape(Array.from(m),Array.from(d));return e.makeTensorInfo([f.length],\"int32\",Int32Array.from(f))}let s=y.sizeFromShape(o.shape),a=y.sizeFromShape(n.shape),i=Math.max(s,a),p=new px(i),u=[{type:\"int32\",data:[s]},{type:\"int32\",data:[a]}];return e.runWebGPUProgram(p,[o,n],\"int32\",u)}var lV={kernelName:ea,backendName:\"webgpu\",kernelFunc:fue};var o0=et({opType:fe.NOT_EQUAL,dtype:\"bool\",cpuKernelImpl:Tz}),mV={kernelName:Yn,backendName:\"webgpu\",kernelFunc:o0};function Ii(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.tensorMap.get(o.dataId);return At({inputs:{x:n.complexTensorInfos.real},backend:e})}var dV={kernelName:Gi,backendName:\"webgpu\",kernelFunc:Ii};function fV(r,t){let e=new Zr(r.shape,Z.TO_INT),o=t.runWebGPUProgram(e,[r],\"int32\");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function n0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dtype:s}=o;if(s===\"complex64\"){if(n.dtype===\"complex64\")return At({inputs:{x:n},backend:e});let a=Ur(n.shape),i=n0({inputs:{x:n},backend:e,attrs:{dtype:\"float32\"}}),p=xo({inputs:{real:i,imag:a},backend:e});return a.dispose(),e.disposeData(i.dataId),p}if(n.dtype===\"complex64\"){let a=Ii({inputs:{input:n},backend:e}),i=n0({inputs:{x:a},backend:e,attrs:{dtype:s}});return e.disposeData(a.dataId),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=At({inputs:{x:n},backend:e});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(e.shouldExecuteOnCPU([n])){let a=e.tensorMap.get(n.dataId).values,[i,p,u]=iz(a,n.shape,n.dtype,s);return e.makeTensorInfo(i,p,u)}if(s===\"int32\")return fV(n,e);if(s===\"bool\"){let a=e.makeTensorInfo([],\"bool\",y.getTypedArrayFromDType(\"bool\",1)),p=o0({inputs:{a:n,b:a},backend:e});return e.disposeData(a.dataId),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var hV={kernelName:yo,backendName:\"webgpu\",kernelFunc:n0};var hue=ye({opType:Z.CEIL,cpuKernelImpl:uz}),gV={kernelName:en,backendName:\"webgpu\",kernelFunc:hue};var cx=class{constructor(t){this.variableNames=[\"A\"],this.uniforms=\"minVal : f32, maxVal : f32,\",this.workPerThread=4,this.workgroupSize=[64,1,1],this.outputComponent=4,this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey=\"clipVec4\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let value = getAByOutputIndex(index);\n var clampedValue = clamp(\n value, vec4(uniforms.minVal), vec4(uniforms.maxVal));\n clampedValue = select(clampedValue, value, isnanVec4(value));\n setOutputAtIndex(index, clampedValue);\n }\n }\n `}};var lx=class{constructor(t){this.variableNames=[\"A\"],this.uniforms=\"minVal : f32, maxVal : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"clip\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let value = getAByOutputIndex(index);\n if (isnan(value)) {\n setOutputAtIndex(index, value);\n return;\n }\n setOutputAtIndex(index, clamp(value, uniforms.minVal, uniforms.maxVal));\n }\n }\n `}};function gue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{clipValueMin:s,clipValueMax:a}=o,i,p=[{type:\"float32\",data:[s]},{type:\"float32\",data:[a]}];return y.sizeFromShape(n.shape)%4===0?i=new cx(n.shape):i=new lx(n.shape),e.runWebGPUProgram(i,[n],n.dtype,p)}var xV={kernelName:bo,backendName:\"webgpu\",kernelFunc:gue};var mx=class{constructor(t){this.outputShape=[],this.variableNames=[\"real\",\"imag\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"complexAbs\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let re = abs(getRealByOutputIndex(index));\n let im = abs(getImagByOutputIndex(index));\n let mx = max(re, im);\n\n // The length function in wgsl may be not underflow-safe on some GPUs.\n // So the safe solution is to ensure underflow-safety in all cases.\n setOutputAtIndex(index, select(mx * length(vec2(1, min(re, im)/mx)), 0.0, mx == 0.0));\n }\n }\n `}};function yV(r,t){return{dataId:t.dataId,dtype:t.dtype,shape:r.shape}}function xue(r){let{inputs:t,backend:e}=r,{x:o}=t,n=e.tensorMap.get(o.dataId),s=new mx(o.shape),a=[yV(o,n.complexTensorInfos.real),yV(o,n.complexTensorInfos.imag)];return e.runWebGPUProgram(s,a,a[0].dtype)}var bV={kernelName:Di,backendName:\"webgpu\",kernelFunc:xue};var dx=class{constructor(t){this.uniforms=\"\",this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=w.computeOutShape(t,1),this.variableNames=t.map((e,o)=>`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.offsetLength=t.length-1;for(let e=0;e0){t.push(\"if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }\");for(let s=1;sIi({inputs:{input:C},backend:e})),h=r.map(C=>$p({inputs:{input:C},backend:e})),g=Yc(f,t,e),x=Yc(h,t,e),b=xo({inputs:{real:g,imag:x},backend:e});return f.forEach(C=>e.disposeData(C.dataId)),h.forEach(C=>e.disposeData(C.dataId)),e.disposeData(g.dataId),e.disposeData(x.dataId),b}let n=e.shouldExecuteOnCPU(r);if(o===\"string\"&&(n=!0),n){let f=r.map(k=>{let E=[-1,y.sizeFromShape(k.shape.slice(t))];return pe({inputs:{x:k},backend:e,attrs:{shape:E}})}),h=f.map(k=>({vals:e.readSync(k.dataId),shape:k.shape})),g=w.computeOutShape(f.map(k=>k.shape),1),x=f[0].shape[0]===1,b=pz(h,g,o,x),C=w.computeOutShape(r.map(k=>k.shape),t),S=e.makeTensorInfo(C,o,b);return f.forEach(k=>e.disposeData(k.dataId)),S}let s=e.device.limits.maxStorageBuffersPerShaderStage-1;if(r.length>s){let f=[];for(let g=0;gf.shape),u=new dx(p),c=[],l=new Array(p.length-1);if(l.length>0){l[0]=p[0][1],c.push({type:\"int32\",data:[l[0]]});for(let f=1;fe.disposeData(f.dataId));let d=pe({inputs:{x:m},backend:e,attrs:{shape:i}});return e.disposeData(m.dataId),d}function yue(r,t,e){let o=w.computeOutShape(r.map(s=>s.shape),t);return{tensors2D:r.map(s=>pe({inputs:{x:s},backend:e,attrs:{shape:[y.sizeFromShape(s.shape.slice(0,t)),y.sizeFromShape(s.shape.slice(t))]}})),outShape:o}}function s0(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,t[0].shape)[0],a=t.map(u=>u.shape);w.assertParamsConsistent(a,s);let i=w.computeOutShape(t.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return e.makeTensorInfo(i,t[0].dtype,[]);let p=t.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?At({inputs:{x:p[0]},backend:e}):Yc(p,s,e)}var wV={kernelName:ta,backendName:\"webgpu\",kernelFunc:s0};function bue(r,t,e,o,n=!1,s=null,a=!1,i=4,p=4,u=4){let c=D=>{switch(D){case 1:return\"resData = f32(x[xIndex]);\";case 3:return\"resData = vec3(x[xIndex], x[xIndex + 1], x[xIndex + 2]);\";case 4:return\"resData = vec4(x[xIndex / 4]);\";default:throw new Error(`innerElementSize ${D} is not supported.`)}},l=D=>{switch(D){case 1:return\"return f32(W[row * uniforms.wShape[3] + col]);\";case 4:return\"return vec4(W[(row * uniforms.wShape[3] + col) / 4]);\";default:throw new Error(`innerElementSize ${D} is not supported.`)}},m=r?`\n let coord = vec4(batch, xRow, xCol, xCh);\n `:`\n let coord = vec4(batch, xCh, xRow, xCol);\n `,d=r?`\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n `:`\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `,f=r?\"uniforms.xShape[1]\":\"uniforms.xShape[2]\",h=r?\"uniforms.xShape[2]\":\"uniforms.xShape[3]\",g=r?\"row\":\"col\",x=r?\"col\":\"row\",b=`\n let inChannels = uniforms.wShape[2];\n let outWidth = ${r?\"uniforms.outShape[2]\":\"uniforms.outShape[3]\"};\n let outRow = ${g} / outWidth;\n let outCol = ${g} % outWidth;\n\n let WRow = ${x} / (uniforms.filterDims[1] * inChannels);\n let WCol = ${x} / inChannels % uniforms.filterDims[1];\n let xRow = outRow * uniforms.strides[0] + uniforms.dilations[0] * WRow - uniforms.pads[0];\n let xCol = outCol * uniforms.strides[1] + uniforms.dilations[1] * WCol - uniforms.pads[1];\n let xCh = ${x} % inChannels;\n var resData = ${Ae(i)}(0.0);\n // The bounds checking is always needed since we use it to pad zero for\n // the 'same' padding type.\n if (xRow >= 0 && xRow < ${f} && xCol >= 0 && xCol < ${h}) {\n ${m}\n let xIndex = getIndexFromCoords4D(coord, uniforms.xShape);\n ${c(i)}\n }\n return resData;`,C=r?t&&o?`\n ${b}`:`\n if (row < uniforms.dimAOuter && col < uniforms.dimInner) {\n ${b}\n }\n return ${Ae(i)}(0.0);`:o&&e?`\n ${b}`:`\n if (row < uniforms.dimInner && col < uniforms.dimBOuter) {\n ${b}\n }\n return ${Ae(i)}(0.0);`,S=`${l(p)}`,k=Ae(u),_=r?Ae(i):Ae(p),E=r?Ae(p):Ae(i);return`\n ${dr(s,a,u===4,4)}\n fn mm_readA(batch: i32, row : i32, col : i32) -> ${_} {\n ${r?C:S}\n }\n\n fn mm_readB(batch: i32, row : i32, col : i32) -> ${E} {\n ${r?S:C}\n }\n\n fn mm_write(batch: i32, row : i32, col : i32, valueIn : ${k}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)\n {\n var value = valueIn;\n let outWidth = ${r?\"uniforms.outShape[2]\":\"uniforms.outShape[3]\"};\n ${d}\n ${Qr(n,s)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }`}var fx=class{constructor(t,e,o,n,s=!1,a=null,i=!1,p=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.outputShape=t.outShape,this.isChannelsLast=t.dataFormat===\"channelsLast\",this.isVec4=((t.inChannels%4===0||t.inChannels%3===0)&&this.isChannelsLast||t.outWidth%4===0&&!this.isChannelsLast)&&t.outChannels%4===0,this.dispatchLayout=this.isChannelsLast?{x:[3],y:[1,2],z:[0]}:{x:[2,3],y:[1],z:[0]},this.workgroupSize=pm(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=cm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4?(this.outputComponent=4,this.isChannelsLast&&t.inChannels%4!==0?(this.innerElementSize=3,this.variableComponents=[1,4]):(this.innerElementSize=4,this.variableComponents=[4,4]),s&&(this.variableNames.push(\"bias\"),this.variableComponents.push(4)),i&&(this.variableNames.push(\"preluActivationWeights\"),this.variableComponents.push(4))):(this.innerElementSize=this.elementsPerThread[0],s&&this.variableNames.push(\"bias\"),i&&this.variableNames.push(\"preluActivationWeights\")),this.sequentialAccessByThreads=p,this.addBias=s,this.activation=a,this.hasPreluActivationWeights=i,this.tileAOuter=this.workgroupSize[1]*this.elementsPerThread[1],this.tileBOuter=this.workgroupSize[0]*this.elementsPerThread[0],this.tileInner=Math.max(this.workgroupSize[0]*this.innerElementSize,this.workgroupSize[1]),this.fitAOuter=e%this.tileAOuter===0,this.fitBOuter=o%this.tileBOuter===0,this.fitInner=n%this.tileInner===0,this.shaderKey=`conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`}getUserCode(){let t=this.isVec4?Np(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner):Tp(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner,!1,null,this.sequentialAccessByThreads),e=this.isVec4?[this.innerElementSize,4,4]:[1,1,1];return`\n ${bue(this.isChannelsLast,this.fitAOuter,this.fitBOuter,this.fitInner,this.addBias,this.activation,this.hasPreluActivationWeights,e[0],e[1],e[2])}\n ${t}\n `}};var hx=class{constructor(t,e=!1,o=null,n=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,\",this.workgroupSize=[4,4,8],this.outputShape=t.outShape,this.isChannelsLast=t.dataFormat===\"channelsLast\",this.dispatchLayout=this.isChannelsLast?{x:[2],y:[1],z:[0,3]}:{x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=e,this.activation=o,this.hasPreluActivationWeights=n,e&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),this.shaderKey=`conv2dnaive_${this.activation}_${this.isChannelsLast}`}getUserCode(){return`\n ${dr(this.activation,this.hasPreluActivationWeights,!1,4)}\n fn readInp(batch : i32, row : i32, col : i32, chan : i32) -> f32{\n let coords = vec4(batch, row, col, chan);\n if (coordsInBounds4D(coords, uniforms.xShape)) {\n return getX(batch, row, col, chan);\n } else {\n return 0.0;\n }\n }\n fn readFilt(row : i32, col : i32, xChannel : i32, outChannel : i32) -> f32{\n let coords = vec4(row, col, xChannel, outChannel);\n if(coordsInBounds4D(coords, uniforms.wShape)) {\n return getW(row, col, xChannel, outChannel);\n } else {\n return 0.0;\n }\n }\n fn writeResult(batch : i32, row : i32, col : i32, chan : i32, valueIn : f32) {\n let coords = ${this.isChannelsLast?\"vec4(batch, row, col, chan);\":\"vec4(batch, chan, row, col);\"}\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n var value = valueIn;\n ${Qr(this.addBias,this.activation)}\n setOutputAtCoords(coords.x, coords.y, coords.z, coords.w, value);\n }\n }\n ${G(\"index\")} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let outChannel = ${this.isChannelsLast?\"coords[3];\":\"coords[1];\"}\n let outRow = ${this.isChannelsLast?\"coords[1];\":\"coords[2];\"}\n let outCol = ${this.isChannelsLast?\"coords[2];\":\"coords[3];\"}\n var acc : f32 = 0.0;\n for (var row = 0; row < uniforms.filterDims[0]; row = row + 1) {\n for (var col = 0; col < uniforms.filterDims[1]; col = col + 1) {\n let xRow = outRow * uniforms.strides[0] + uniforms.dilations[0] * row - uniforms.pads[0];\n let xCol = outCol * uniforms.strides[1] + uniforms.dilations[1] * col - uniforms.pads[1];\n for (var xChannel = 0; xChannel < ${this.isChannelsLast?\"uniforms.xShape[3];\":\"uniforms.xShape[1];\"} xChannel = xChannel + 1) {\n ${this.isChannelsLast?\"let v = readInp(batch, xRow, xCol, xChannel);\":\"let v = readInp(batch, xChannel, xRow, xCol);\"}\n let f = readFilt(row, col, xChannel, outChannel);\n acc = acc + v * f;\n }\n }\n }\n writeResult(batch, outRow, outCol, outChannel, acc);\n }\n `}};var gx=class{constructor(t,e){this.variableNames=[\"x\"],this.uniforms=`pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32,\n inChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e,this.shaderKey=`im2col_${this.isChannelsLast}`}getUserCode(){let t=this.isChannelsLast?1:2,e=this.isChannelsLast?2:3,o=this.isChannelsLast?\"coords[1]\":\"coords[2]\",n=this.isChannelsLast?\"coords[2]\":\"coords[1]\",s=this.isChannelsLast?\"getX(batch, xRow, xCol, ch)\":\"getX(batch, ch, xRow, xCol)\";return`\n ${G(\"index\")} {\n let coords = getCoordsFromIndex(index);\n if(index < uniforms.size) {\n let batch = coords[0];\n let row = ${o};\n let col = ${n};\n let offsetY = (row / uniforms.outWidth) * uniforms.strides[0] - uniforms.pads[0];\n let xRow = offsetY + uniforms.dilations[0] * (col / uniforms.itemsPerBlockRow);\n var value = 0.0;\n if(xRow < uniforms.xShape[${t}] && xRow >= 0) {\n let offsetX = (row % uniforms.outWidth) * uniforms.strides[1] -\n uniforms.pads[1];\n let xCol = offsetX + uniforms.dilations[1] * ((col %\n uniforms.itemsPerBlockRow) / uniforms.inChannels);\n let ch = col % uniforms.inChannels;\n if(xCol < uniforms.xShape[${e}] && xCol >= 0) {\n value = ${s};\n }\n }\n setOutputAtIndex(index, value);\n }\n }\n `}};function xx(r,t){let e=r.length;return e>=3?t?[...r.slice(0,-3),r[e-3]*r[e-2],r[e-1]]:[...r.slice(0,-3),r[e-3],r[e-2]*r[e-1]]:!t&&e===1&&r[0]>1?[r[0],1]:null}function Cue({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=e.dataFormat===\"channelsLast\",u=!p,c=!1,l=p&&e.filterHeight===e.inHeight&&e.filterWidth===e.inWidth&&e.padInfo.type===\"VALID\",m=[],d,f;if(l){let x=e.inHeight*e.inWidth*e.inChannels;d=pe({inputs:{x:r},backend:o,attrs:{shape:[1,e.batchSize,x]}}),f=pe({inputs:{x:t},backend:o,attrs:{shape:[1,x,e.outChannels]}})}else d=pe({inputs:{x:r},backend:o,attrs:{shape:p?[e.batchSize,e.inHeight*e.inWidth,e.inChannels]:[e.batchSize,e.inChannels,e.inHeight*e.inWidth]}}),f=pe({inputs:{x:t},backend:o,attrs:{shape:[1,e.inChannels,e.outChannels]}});if(m.push(d),m.push(f),s!=null){let x=xx(s.shape,p);x!=null&&(s=pe({inputs:{x:s},backend:o,attrs:{shape:x}}),m.push(s))}if(n!=null){let x=xx(n.shape,p);x!=null&&(n=pe({inputs:{x:n},backend:o,attrs:{shape:x}}),m.push(n))}let h=_p({a:p?d:f,b:p?f:d,transposeA:u,transposeB:c,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),g=pe({inputs:{x:h},backend:o,attrs:{shape:e.outShape}});m.push(h);for(let x of m)o.disposeData(x.dataId);return g}function wue({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:c,strideWidth:l,strideHeight:m,padInfo:d,outWidth:f,outHeight:h,dilationWidth:g,dilationHeight:x,dataFormat:b}=e,C=b===\"channelsLast\",S=p*u*c,k=h*f,_=C?[e.batchSize,k,S]:[e.batchSize,S,k],E=new gx(_,C),R=[{type:\"int32\",data:[d.top,d.left]},{type:\"int32\",data:[m,l]},{type:\"int32\",data:[x,g]},{type:\"int32\",data:[f]},{type:\"int32\",data:[c*p]},{type:\"int32\",data:[c]}],D=o.runWebGPUProgram(E,[r],r.dtype,R),P=[];P.push(D);let O=pe({inputs:{x:t},backend:o,attrs:{shape:[1,S,-1]}});if(P.push(O),s!=null){let U=xx(s.shape,C);U!=null&&(s=pe({inputs:{x:s},backend:o,attrs:{shape:U}}),P.push(s))}if(n!=null){let U=xx(n.shape,C);U!=null&&(n=pe({inputs:{x:n},backend:o,attrs:{shape:U}}),P.push(n))}let B=_p({a:C?D:O,b:C?O:D,transposeA:!C,transposeB:!1,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),z=pe({inputs:{x:B},backend:o,attrs:{shape:e.outShape}});P.push(B);for(let U of P)o.disposeData(U.dataId);return z}function yx({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=n!=null,u=s!=null,c=e.dataFormat===\"channelsLast\",l=c&&e.filterHeight===e.inHeight&&e.filterWidth===e.inWidth&&e.padInfo.type===\"VALID\",m=A().getBool(\"WEBGPU_USE_NAIVE_CONV2D_DEBUG\");if(!m&&(l||e.filterHeight===1&&e.filterWidth===1&&e.dilationHeight===1&&e.dilationWidth===1&&e.strideHeight===1&&e.strideWidth===1&&(e.padInfo.type===\"SAME\"||e.padInfo.type===\"VALID\")))return Cue({x:r,filter:t,convInfo:e,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});let d=A().getNumber(\"WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL\"),f=d>-1?d:o.thresholdToIncreaseWorkgroups,h=e.batchSize*Math.ceil(e.outHeight*e.outWidth/32)*Math.ceil(e.outChannels/32);if(A().getBool(\"WEBGPU_CONV_SEPARATE_IM2COL_SHADER\")||h<=f)return wue({x:r,filter:t,convInfo:e,backend:o,bias:n,preluActivationWeights:s,leakyreluAlpha:a,activation:i});let g,x=[e.padInfo.top,e.padInfo.left],b=[{type:\"int32\",data:[e.filterHeight,e.filterWidth]},{type:\"int32\",data:[...x]},{type:\"int32\",data:[e.strideHeight,e.strideWidth]},{type:\"int32\",data:[e.dilationHeight,e.dilationWidth]}];if(m)g=new hx(e,p,i,u);else{let _=c?e.outHeight*e.outWidth:e.outChannels,E=c?e.outChannels:e.outHeight*e.outWidth,R=e.filterHeight*e.filterWidth*e.inChannels;b.push({type:\"int32\",data:[_]},{type:\"int32\",data:[E]},{type:\"int32\",data:[R]});let D=o.adapterInfo.isIntel();g=new fx(e,_,E,R,p,i,u,D)}let C=[],S=[r,t];p&&(!c&&n.shape.length===1&&(n=pe({inputs:{x:n},backend:o,attrs:{shape:[n.shape[0],1,1]}}),C.push(n)),S.push(n)),u&&(!c&&s.shape.length===1&&(s=pe({inputs:{x:s},backend:o,attrs:{shape:[s.shape[0],1,1]}}),C.push(s)),S.push(s)),i===\"leakyrelu\"&&(b.push({type:\"float32\",data:[a]}),g.uniforms+=\" alpha : f32,\");let k=o.runWebGPUProgram(g,S,r.dtype,b);for(let _ of C)o.disposeData(_.dataId);return k}function Sue(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=e,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,s.shape,a,u,i,c,!1,l);return yx({x:n,filter:s,convInfo:m,backend:o})}var SV={kernelName:tn,backendName:\"webgpu\",kernelFunc:Sue};var bx=class{constructor(t){this.variableNames=[\"dy\",\"W\"],this.uniforms=\"filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,\",this.workgroupSize=[64,1,1],this.size=!1,this.isVec4=!1,this.workPerThread=1,this.outputShape=t.inShape,this.isChannelsLast=t.dataFormat===\"channelsLast\",this.isVec4=this.isChannelsLast&&t.outChannels%4===0&&t.inChannels%4===0,this.isVec4?(this.workPerThread=2,this.outputComponent=4,this.workgroupSize=[4,4,4],this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[4,this.workPerThread,1])):(this.size=!0,this.workPerThread=1,this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)),this.shaderKey=`conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`}getUserCode(){let t=this.isChannelsLast?1:2,e=this.isChannelsLast?2:3,o=this.isChannelsLast?3:1,n=`\n ${G()} {\n let batch = i32(globalId.z) / uniforms.outShape[1];\n let r = i32(globalId.z) % uniforms.outShape[1];\n let c = i32(globalId.y) * ${this.workPerThread};\n let d1 = i32(globalId.x) * 4;\n\n let dyCorner = vec2(r, c) - uniforms.pads;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd: array, ${this.workPerThread}>;\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = vec4(0.0);\n }\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + 1) {\n let dyR = f32(dyCorner.x + wR) / f32(uniforms.strides.x);\n let wRPerm = uniforms.filterDims.x - 1 - wR;\n if (dyR < 0.0 || dyR >= f32(uniforms.outBackprop[1]) ||\n fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + 1) {\n let dyC = f32(dyCorner.y + wC) / f32(uniforms.strides.y);\n let dyC2 = f32(dyCorner.y + 1 + wC) / f32(uniforms.strides.y);\n let wCPerm = uniforms.filterDims.y - 1 - wC;\n var bDyCVal = true;\n var bDyCVal2 = true;\n if (dyC < 0.0 || dyC >= f32(uniforms.outBackprop[2]) ||\n fract(dyC) > 0.0) {\n bDyCVal = false;\n }\n if (dyC2 < 0.0 || dyC2 >= f32(uniforms.outBackprop[2]) ||\n fract(dyC2) > 0.0) {\n bDyCVal2 = false;\n }\n\n let idyC = i32(dyC);\n let idyC2 = i32(dyC2);\n if (bDyCVal && bDyCVal2) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n xValue = getDy(batch, idyR, idyC2, d2);\n dotProd[1] = dotProd[1] + vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n }\n } else if (bDyCVal) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n }\n } else if (bDyCVal2) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC2, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[1] = dotProd[1] + tmpval;\n }\n }\n }\n }\n\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let coords = vec4(batch, r, c + i, d1);\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], dotProd[i]);\n }\n }\n }\n `;return this.isVec4?`\n ${n}\n `:`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d1 = coords[${o}];\n\n let dyCorner = vec2(coords[${t}], coords[${e}]) - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + 1) {\n let dyR = (f32(dyRCorner) + f32(wR)) / f32(uniforms.strides.x);\n let wRPerm = uniforms.filterDims.x - 1 - wR;\n if (dyR < 0.0 || dyR >= f32(uniforms.outBackprop[1]) || fract(dyR) > 0.0 ||\n wRPerm < 0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + 1) {\n let dyC = (f32(dyCCorner) + f32(wC)) / f32(uniforms.strides.y);\n let wCPerm = uniforms.filterDims.y - 1 - wC;\n if (dyC < 0.0 || dyC >= f32(uniforms.outBackprop[2]) ||\n fract(dyC) > 0.0 || wCPerm < 0) {\n continue;\n }\n let idyC = i32(dyC);\n\n for (var d2 = 0; d2 < uniforms.outBackprop[3]; d2 = d2 + 1) {\n let xValue = ${this.isChannelsLast?\"getDy(batch, idyR, idyC, d2)\":\"getDy(batch, d2, idyR, idyC)\"};\n let wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd = dotProd + xValue * wValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},Cx=class{constructor(t){this.variableNames=[\"x\",\"dy\"],this.uniforms=\"pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=t.dataFormat===\"channelsLast\",this.shaderKey=`conv2DDerFilter_${this.isChannelsLast}`}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wR = coords[0];\n let wC = coords[1];\n let d1 = coords[2];\n let d2 = coords[3];\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b = b + 1) {\n for (var yR = 0; yR < uniforms.outHeight; yR = yR + 1) {\n let xR = wR + yR * uniforms.strides[0] - uniforms.pads[0];\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC = yC + 1) {\n let xC = wC + yC * uniforms.strides[1] - uniforms.pads[1];\n\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n if (${this.isChannelsLast}) {\n let dyValue = getDy(b, yR, yC, d2);\n let xValue = getX(b, xR, xC, d1);\n dotProd = dotProd + xValue * dyValue;\n } else {\n let dyValue = getDy(b, d2, yR, yC);\n let xValue = getX(b, d1, xR, xC);\n dotProd = dotProd + xValue * dyValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},wx=class{constructor(t){this.variableNames=[\"x\",\"dy\"],this.uniforms=`pads : vec3, strides : vec3, batchSize : i32, outDepth : i32,\n outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"conv3DDerFilter\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wF = coords.x;\n let wR = coords.y;\n let wC = coords.z;\n let d1 = coords.w;\n let d2 = coords.u;\n\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b++) {\n for (var yF = 0; yF < uniforms.outDepth; yF++) {\n let xF = wF + yF * uniforms.strides[0] - uniforms.pads[0];\n if (xF < 0 || xF >= uniforms.inDepth) {\n continue;\n }\n\n for (var yR = 0; yR < uniforms.outHeight; yR++) {\n let xR = wR + yR * uniforms.strides[1] - uniforms.pads[1];\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC++) {\n let xC = wC + yC * uniforms.strides[2] - uniforms.pads[2];\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n let dyValue = getDy(b, yF, yR, yC, d2);\n let xValue = getX(b, xF, xR, xC, d1);\n dotProd += xValue * dyValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},Sx=class{constructor(t){this.variableNames=[\"dy\",\"W\"],this.uniforms=`filterDims : vec3, pads : vec3, strides : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"conv3DDerInput\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let d1 = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyFCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n var dotProd = 0.0;\n for (var wF = 0; wF < uniforms.filterDims[0]; wF++) {\n let dyF = f32(dyFCorner + wF) / f32(uniforms.strides[0]);\n if (dyF < 0.0 || dyF >= f32(uniforms.outDepth) || fract(dyF) > 0.0) {\n continue;\n }\n let idyF = i32(dyF);\n\n let wFPerm = uniforms.filterDims[0] - 1 - wF;\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n let wRPerm = uniforms.filterDims[1] - 1 - wR;\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let wCPerm = uniforms.filterDims[2] - 1 - wC;\n\n for (var d2 = 0; d2 < uniforms.outChannels; d2++) {\n let xValue = getDy(batch, idyF, idyR, idyC, d2);\n let wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function Iue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:c}=o,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,c,a,1,i,u,!1,l),d=new Cx(m),f=[{type:\"int32\",data:[m.padInfo.top,m.padInfo.left]},{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.batchSize]},{type:\"int32\",data:[m.outHeight]},{type:\"int32\",data:[m.outWidth]},{type:\"int32\",data:[m.inHeight]},{type:\"int32\",data:[m.inWidth]}];return e.runWebGPUProgram(d,[n,s],n.dtype,f)}var IV={kernelName:Ai,backendName:\"webgpu\",kernelFunc:Iue};function vue(r=4){let t=s=>{switch(s){case 1:return\"return W[getIndexFromCoords4D(coord, uniforms.wShape)];\";case 4:return`\n let coord1 = vec4(coordX, coordY, col + 1, rowInner);\n let coord2 = vec4(coordX, coordY, col + 2, rowInner);\n let coord3 = vec4(coordX, coordY, col + 3, rowInner);\n let v0 = W[getIndexFromCoords4D(coord, uniforms.wShape)];\n let v1 = W[getIndexFromCoords4D(coord1, uniforms.wShape)];\n let v2 = W[getIndexFromCoords4D(coord2, uniforms.wShape)];\n let v3 = W[getIndexFromCoords4D(coord3, uniforms.wShape)];\n return vec4(v0, v1, v2, v3);\n `;default:throw new Error(`innerElementSize ${s} is not supported.`)}},o=`if (row < uniforms.dimAOuter && col < uniforms.dimInner) {\n ${`\n let outRow = row / uniforms.outShape[2];\n let outCol = row % uniforms.outShape[2];\n\n let WRow = col / (uniforms.filterDims[1] * uniforms.outBackprop[3]);\n let WCol = col / uniforms.outBackprop[3] % uniforms.filterDims[1];\n let xR = f32(outRow - uniforms.pads[0] + WRow) / f32(uniforms.strides[0]);\n let xC = f32(outCol - uniforms.pads[1] + WCol) / f32(uniforms.strides[1]);\n if (xR < 0.0 || xR >= f32(uniforms.outBackprop[1]) || fract(xR) > 0.0) {\n return ${Ae(r)}(0.0);\n }\n if (xC < 0.0 || xC >= f32(uniforms.outBackprop[2]) || fract(xC) > 0.0) {\n return ${Ae(r)}(0.0);\n }\n let coord = vec4(\n batch,\n i32(xR),\n i32(xC),\n col % uniforms.outBackprop[3]);\n return x[getIndexFromCoords4D(coord, uniforms.xShape)/${r}];`}\n }\n return ${Ae(r)}(0.0);`;return`\n fn mm_readA(batch: i32, row : i32, col : i32) -> ${Ae(r)} {\n ${o}\n }\n\n fn mm_readB(batch: i32, row : i32, col : i32) -> ${Ae(r)} {\n let coordX = uniforms.filterDims.x - 1 -\n row / (uniforms.filterDims[1] * uniforms.outBackprop[3]);\n let coordY = uniforms.filterDims.y - 1 -\n (row / uniforms.outBackprop[3]) % uniforms.filterDims[1];\n if (row < uniforms.dimInner && col < uniforms.dimBOuter &&\n coordX >= 0 && coordY >= 0) {\n let rowInner = row % uniforms.outBackprop[3];\n let coord = vec4(coordX, coordY, col, rowInner);\n ${t(r)}\n }\n return ${Ae(r)}(0.0);\n }\n\n fn mm_write(batch: i32, row : i32, col : i32, valueInput : ${Ae(r)}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) {\n var value = valueInput;\n let outCoord = vec4(\n batch,\n row / uniforms.outShape[2],\n row % uniforms.outShape[2],\n col);\n result[getIndexFromCoords4D(outCoord, uniforms.outShape)/${r}] = value;\n }\n }`}var Ix=class{constructor(t){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.outputShape=t.inShape,y.assert(t.dataFormat===\"channelsLast\",()=>\"TODO: NCHW is unimplemented\"),this.isVec4=t.inChannels%4===0&&t.outChannels%4===0,this.dispatchLayout={x:[3],y:[1,2],z:[0]},this.workgroupSize=pm(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=cm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4&&(this.outputComponent=4,this.variableComponents=[4,1]),this.shaderKey=`conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`}getUserCode(){let t=this.isVec4?Np(this.elementsPerThread,this.workgroupSize):Tp(this.elementsPerThread,this.workgroupSize);return`\n ${vue(this.isVec4?4:1)}\n ${t}\n `}};function kue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(u),m=w.computeConv2DInfo(a,s.shape,i,1,p,c,!1,l),d=[{type:\"int32\",data:[m.filterHeight,m.filterWidth]},{type:\"int32\",data:[m.filterHeight-1-m.padInfo.top,m.filterWidth-1-m.padInfo.left]},{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.batchSize,m.outHeight,m.outWidth,m.outChannels]}],f;if(A().getBool(\"WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE\")||m.dataFormat!==\"channelsLast\")f=new bx(m);else{f=new Ix(m);let h=m.inHeight*m.inWidth,g=m.inChannels,x=m.filterHeight*m.filterWidth*m.outChannels;d.push({type:\"uint32\",data:[h]},{type:\"uint32\",data:[g]},{type:\"uint32\",data:[x]})}return e.runWebGPUProgram(f,[n,s],\"float32\",d)}var vV={kernelName:rn,backendName:\"webgpu\",kernelFunc:kue};var vx=class{constructor(t){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"conv3dnaive\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords.x;\n let d2 = coords.u;\n\n let xFRCCorner = vec3(coords.y, coords.z, coords.w) * uniforms.strides - uniforms.pads;\n let xFCorner = xFRCCorner.x;\n let xRCorner = xFRCCorner.y;\n let xCCorner = xFRCCorner.z;\n\n let inputDepthNearestVec4 = (uniforms.xShape.u / 4) * 4;\n let inputDepthVec4Remainder = uniforms.xShape.u % 4;\n\n var dotProd = 0.0;\n for (var wF = 0; wF < uniforms.filterDims[0]; wF++) {\n let xF = xFCorner + wF * uniforms.dilations[0];\n if (xF < 0 || xF >= uniforms.xShape.y) {\n continue;\n }\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let xR = xRCorner + wR * uniforms.dilations[1];\n if (xR < 0 || xR >= uniforms.xShape.z) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let xC = xCCorner + wC * uniforms.dilations[2];\n if (xC < 0 || xC >= uniforms.xShape.w) {\n continue;\n }\n\n for (var d1 = 0; d1 < inputDepthNearestVec4; d1 += 4) {\n let xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n let wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (inputDepthVec4Remainder == 1) {\n dotProd += getX(batch, xF, xR, xC, inputDepthNearestVec4) *\n getW(wF, wR, wC, inputDepthNearestVec4, d2);\n } else if (inputDepthVec4Remainder == 2) {\n let xValues = vec2(\n getX(batch, xF, xR, xC, inputDepthNearestVec4),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)\n );\n let wValues = vec2(\n getW(wF, wR, wC, inputDepthNearestVec4, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (inputDepthVec4Remainder == 3) {\n let xValues = vec3(\n getX(batch, xF, xR, xC, inputDepthNearestVec4),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)\n );\n let wValues = vec3(\n getW(wF, wR, wC, inputDepthNearestVec4, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 1, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }`}};function Nue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeConv3DInfo(n.shape,s.shape,a,p,i),c=[u.padInfo.front,u.padInfo.top,u.padInfo.left],l=[{type:\"int32\",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:\"int32\",data:[...c]},{type:\"int32\",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.dilationDepth,u.dilationHeight,u.dilationWidth]}],m=new vx(u),d=dt(n.dtype,s.dtype);return e.runWebGPUProgram(m,[n,s],d,l)}var kV={kernelName:on,backendName:\"webgpu\",kernelFunc:Nue};function Tue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,filterShape:p}=o,u=w.computeConv3DInfo(n.shape,p,a,1,i),c=new wx(u),l=[{type:\"int32\",data:[u.padInfo.front,u.padInfo.top,u.padInfo.left]},{type:\"int32\",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.batchSize]},{type:\"int32\",data:[u.outDepth]},{type:\"int32\",data:[u.outHeight]},{type:\"int32\",data:[u.outWidth]},{type:\"int32\",data:[u.inDepth]},{type:\"int32\",data:[u.inHeight]},{type:\"int32\",data:[u.inWidth]}];return e.runWebGPUProgram(c,[n,s],s.dtype,l)}var NV={kernelName:ja,backendName:\"webgpu\",kernelFunc:Tue};function _ue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{strides:a,pad:i,inputShape:p}=o,u=w.computeConv3DInfo(p,s.shape,a,1,i),c=new Sx(u),l=[{type:\"int32\",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:\"int32\",data:[u.filterDepth-1-u.padInfo.front,u.filterHeight-1-u.padInfo.top,u.filterWidth-1-u.padInfo.left]},{type:\"int32\",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.outDepth]},{type:\"int32\",data:[u.outHeight]},{type:\"int32\",data:[u.outWidth]},{type:\"int32\",data:[u.outChannels]}];return e.runWebGPUProgram(c,[n,s],n.dtype,l)}var TV={kernelName:nn,backendName:\"webgpu\",kernelFunc:_ue};var $ue=ye({opType:Z.COS}),_V={kernelName:sn,backendName:\"webgpu\",kernelFunc:$ue};var Eue=ye({opType:Z.COSH}),$V={kernelName:an,backendName:\"webgpu\",kernelFunc:Eue};var kx=class{constructor(t,e,o,n){this.variableNames=[\"Image\",\"Boxes\",\"BoxInd\"],this.uniforms=\"extrapolationValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0;let[s]=e;this.outputShape=[s,o[0],o[1],t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.methodId=n===\"bilinear\"?1:0,this.cropHeightBiggerThan1=this.outputShape[1]>1,this.cropWidthBiggerThan1=this.outputShape[2]>1,this.shaderKey=`cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`}getUserCode(){let[t,e]=[\"f32(uniforms.imageShape[1] - 1)\",\"f32(uniforms.imageShape[2] - 1)\"],[o,n,s]=this.cropHeightBiggerThan1?[`(${t} / f32(uniforms.outShape[1] - 1))`,\"(y2-y1) * height_ratio\",`y1*${t} + f32(y)*(height_scale)`]:[\"0.0\",\"0.0\",`0.5 * (y1+y2) * ${t}`],[a,i,p]=this.cropWidthBiggerThan1?[`(${e} / f32(uniforms.outShape[2] - 1))`,\"(x2-x1) * width_ratio\",`x1*${e} + f32(x)*(width_scale)`]:[\"0.0\",\"0.0\",`0.5 * (x1+x2) * ${e}`];return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let height_ratio = f32(${o});\n let width_ratio = f32(${a});\n let b = coords[0];\n let y = coords[1];\n let x = coords[2];\n let d = coords[3];\n // get box vals\n let y1 = getBoxes(b, 0);\n let x1 = getBoxes(b, 1);\n let y2 = getBoxes(b, 2);\n let x2 = getBoxes(b, 3);\n // get image in batch index\n let bInd = i32(round(getBoxInd(b)));\n if(bInd < 0 || bInd >= uniforms.outShape[0]) {\n return;\n }\n let height_scale = ${n};\n let width_scale = ${i};\n let in_y = ${s};\n if( in_y < 0.0 || in_y > ${t} ) {\n setOutputAtIndex(index, uniforms.extrapolationValue);\n return;\n }\n let in_x = ${p};\n if( in_x < 0.0 || in_x > ${e} ) {\n setOutputAtIndex(index, uniforms.extrapolationValue);\n return;\n }\n let sourceFracIndexCR = vec2(in_x,in_y);\n if(${this.methodId} == 1) {\n // Compute the four integer indices.\n let sourceFloorCR = vec2(sourceFracIndexCR);\n let sourceCeilCR = vec2(ceil(sourceFracIndexCR));\n let topLeft = getImage(bInd, sourceFloorCR.y, sourceFloorCR.x, d);\n let bottomLeft = getImage(bInd, sourceCeilCR.y, sourceFloorCR.x, d);\n let topRight = getImage(bInd, sourceFloorCR.y, sourceCeilCR.x, d);\n let bottomRight = getImage(bInd, sourceCeilCR.y, sourceCeilCR.x, d);\n let fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n let top = topLeft + (topRight - topLeft) * fracCR.x;\n let bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n let newValue = top + (bottom - top) * fracCR.y;\n setOutputAtIndex(index, newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n let sourceNearestCR = vec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n let newValue = getImage(\n bInd, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutputAtIndex(index, newValue);\n }\n }\n }\n `}};var Rue=r=>{let{inputs:t,backend:e,attrs:o}=r,{image:n,boxes:s,boxInd:a}=t,{cropSize:i,method:p,extrapolationValue:u}=o,c=new kx(n.shape[3],s.shape,i,p),l=[{type:\"float32\",data:[u]}];return e.runWebGPUProgram(c,[n,s,a],\"float32\",l)},EV={kernelName:cn,backendName:\"webgpu\",kernelFunc:Rue};var Ep;(function(r){r.Prod=\"*\",r.Sum=\"+\"})(Ep||(Ep={}));var hm=class{constructor(t,e,o,n){this.variableNames=[\"x\"],this.uniforms=\"index : f32,\",this.size=!0,this.workgroupSize=[128,1,1],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.exclusive=o,this.reverse=n,this.op=t,this.shaderKey=`cum_${this.op}_${this.exclusive}_${this.reverse}`}getUserCode(){let t=this.outputShape.length,e=this.op===Ep.Prod?\"1.0\":\"0.0\",o=this.exclusive?e:`getX(${RV(t,\"coords\",this.op)})`,n=this.outputShape[this.outputShape.length-1],s=\"\",a=\"\";return this.exclusive?(s=this.reverse?`end != ${n-1}`:\"end != 0\",a=this.reverse?\"end + 1\":\"end - 1\"):(s=this.reverse?`end + pow2 < ${n}`:\"end >= pow2\",a=this.reverse?\"end + pow2\":\"end - pow2\"),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var coords = getCoordsFromIndex(index);\n\n let end = ${DV(t,\"coords\",this.op)};\n var val = ${o};\n let pow2 = i32(pow(2.0, uniforms.index));\n if (${s}) {\n let idx = ${a};\n ${DV(t,\"coords\",this.op)} = idx;\n val ${this.op}= getX(${RV(t,\"coords\",this.op)});\n }\n setOutputAtIndex(index, val);\n }\n }\n `}};function RV(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.x, ${t}.y`;if(r===3)return`${t}.x, ${t}.y, ${t}.z`;if(r===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function DV(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.y`;if(r===3)return`${t}.z`;if(r===4)return`${t}.w`;throw Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function Nx(r,t,e,o,n,s){let a=t.shape.length,i=w.getAxesPermutation([o],a),p=t;i!=null&&(p=xr({inputs:{x:t},backend:e,attrs:{perm:i}}));let u=w.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGPU cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${o}`);let c=p.shape[u],l=At({inputs:{x:p},backend:e});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let d=new hm(r,p.shape,!1,s),f=l,h=[{type:\"float32\",data:[m]}];l=e.runWebGPUProgram(d,[l],l.dtype,h),e.disposeData(f.dataId)}if(n){let m=new hm(r,p.shape,n,s),d=l,f=[{type:\"float32\",data:[0]}];l=e.runWebGPUProgram(m,[l],l.dtype,f),e.disposeData(d.dataId)}if(i!=null){let m=w.getUndoAxesPermutation(i),d=xr({inputs:{x:l},backend:e,attrs:{perm:m}});return e.disposeData(l.dataId),e.disposeData(p.dataId),d}return l}function Due(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return Nx(Ep.Prod,n,e,s,a,i)}var AV={kernelName:un,backendName:\"webgpu\",kernelFunc:Due};function Aue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return Nx(Ep.Sum,n,e,s,a,i)}var FV={kernelName:pn,backendName:\"webgpu\",kernelFunc:Aue};function Fue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a,binaryOutput:i}=o,p=n.shape.length===1,c=y.sizeFromShape(s.shape)>0,l=s.dtype,m=p?[n.shape[0]]:[n.shape[0],n.shape[1]],d=p?[a]:[n.shape[0],a],f=vt({backend:e,attrs:{shape:d,value:0,dtype:l}}),h=new Xc(m,c,i),g=[{type:\"int32\",data:[a]}],x=c?[n,s]:[n];return e.runWebGPUProgram(h,x,l,g,f)}var PV={kernelName:ra,backendName:\"webgpu\",kernelFunc:Fue};var Tx=class{constructor(t,e){this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.uniforms=\"blockSize : i32,\",this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`depthToSpace_${e}`,this.dataFormat=e}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let h = ${this.getHeightCoordString()};\n let w = ${this.getWidthCoordString()};\n let d = ${this.getDepthCoordString()};\n\n let in_h = h / uniforms.blockSize;\n let offset_h = h % uniforms.blockSize;\n let in_w = w / uniforms.blockSize;\n let offset_w = w % uniforms.blockSize;\n let offset_d = (offset_h * uniforms.blockSize + offset_w) *\n ${this.getOutputDepthSize()};\n let in_d = d + offset_d;\n\n let rlt = ${this.getInputSamplingString()};\n setOutputAtIndex(index, rlt);\n }\n }`}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\"?\"uniforms.outShape[3]\":\"uniforms.outShape[1]\"}getInputSamplingString(){return this.dataFormat===\"NHWC\"?\"getX(b, in_h, in_w, in_d)\":\"getX(b, in_d, in_h, in_w)\"}};function Pue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a===\"NHWC\"?n.shape[1]:n.shape[2],u=a===\"NHWC\"?n.shape[2]:n.shape[3],c=a===\"NHWC\"?n.shape[3]:n.shape[1],l=p*s,m=u*s,d=c/(s*s),f=a===\"NHWC\"?[i,l,m,d]:[i,d,l,m],h=[{type:\"int32\",data:[s]}],g=new Tx(f,a);return e.runWebGPUProgram(g,[n],n.dtype,h)}var OV={kernelName:ln,backendName:\"webgpu\",kernelFunc:Pue};var _x=class{constructor(t,e,o,n=!1,s=null,a=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=\"pads : vec2, inDims : vec2,\",this.workgroupSize=[16,16,1],this.outputShape=t,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),n&&this.variableNames.push(\"bias\"),a&&this.variableNames.push(\"preluActivationWeights\"),this.addBias=n,this.activation=s,this.hasPreluActivation=a,this.filterHeight=e,this.filterWidth=o,this.shaderKey=`depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`}getUserCode(){let t=this.filterWidth*this.filterHeight,e=this.workgroupSize[0]*this.workgroupSize[1]*this.workgroupSize[2],o=this.workgroupSize[1]+this.filterHeight-1,n=this.workgroupSize[0]+this.filterWidth-1;return`\n ${dr(this.activation,this.hasPreluActivation,!1,4)}\n\n var mm_Asub : array, ${o}>;\n var mm_Bsub : array, ${this.filterHeight}>;\n fn readX(batch : i32, channel : i32, row : i32, col : i32) -> f32 {\n var value = 0.0;\n if (row >=0 && row < uniforms.inDims[0] && col >=0 && col < uniforms.inDims[1])\n {\n value = getX(batch, channel, row, col);\n }\n return value;\n }\n\n ${G()} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let xRCCorner = vec2(coords.zw) - uniforms.pads;\n let channelMul = uniforms.wShape[3];\n let d1 = coords[1] / channelMul;\n let q = coords[1] % channelMul;\n\n let inputRowStart = xRCCorner.x;\n let inputColStart = xRCCorner.y;\n\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n\n // Load one tile of X into local memory.\n for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${this.workgroupSize[1]}) {\n for (var inputCol = localCol; inputCol < ${n}; inputCol = inputCol + ${this.workgroupSize[0]}) {\n let rowOffset = inputRow - localRow;\n let colOffset = inputCol - localCol;\n mm_Asub[inputRow][inputCol] = readX(batch, d1, inputRowStart + rowOffset, inputColStart + colOffset);\n }\n }\n\n // Load one tile of W into local memory.\n var wIndex = i32(localIndex);\n ${t, inDims : vec2, virtualWidth : i32,\",this.workgroupSize=[64,1,1],this.workPerThread=4,this.outputComponent=4,this.outputShape=t.outShape,this.virtualWidth=Math.ceil(this.outputShape[2]/this.workPerThread)*this.workPerThread;let s=[this.outputShape[0],this.outputShape[1],this.virtualWidth,this.outputShape[3]];this.dispatchLayout=X(s),this.dispatch=H(this.dispatchLayout,s,this.workgroupSize,[this.outputComponent*this.workPerThread,1,1]),y.assert(t.dataFormat===\"channelsLast\",()=>\"TODO: NCHW is unimplemented\"),e&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),this.convInfo=t,this.addBias=e,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwiseVec4_${o}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`}getUserCode(){let t=(this.workPerThread-1)*this.convInfo.strideWidth+this.convInfo.filterWidth,e=this.convInfo.strideHeight,o=this.convInfo.strideWidth;return`\n ${dr(this.activation,this.hasPreluActivation,!0,4)}\n fn readX(batch : i32, row : i32, col : i32, channel : i32) -> vec4 {\n var value = vec4(0.0);\n if (col >=0 && col < uniforms.inDims[1]) {\n value = getX(batch, row, col, channel);\n }\n return value;\n }\n\n ${G(\"index\")} {\n let width0 = uniforms.outShape[3] / ${this.outputComponent};\n let d1 = (index % width0) * ${this.outputComponent};\n var index1 = index / width0;\n let width1 = uniforms.virtualWidth / ${this.workPerThread};\n let c = (index1 % width1) * ${this.workPerThread};\n index1 = index1 / width1;\n let r = index1 % uniforms.outShape[1];\n let batch = index1 / uniforms.outShape[1];\n\n let xRCCorner = vec2(r, c) * vec2(${e}, ${o}) - uniforms.pads;\n\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n var xVals : array, ${t}>;\n var dotProd : array, ${this.workPerThread}>;\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = vec4(0.0);\n }\n\n // Use constant instead of uniform can give better performance.\n for (var wR = 0; wR < ${this.convInfo.filterHeight}; wR = wR + 1) {\n let xR = xRCorner + wR;\n if (xR >=0 && xR < uniforms.inDims[0]) {\n for (var i = 0; i < ${t}; i++) {\n xVals[i] = readX(batch, xR, xCCorner + i, d1);\n }\n for (var wC = 0; wC < ${this.convInfo.filterWidth}; wC = wC + 1) {\n let wValue = getW(wR, wC, d1, 0);\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = fma(xVals[i * ${o} + wC], wValue, dotProd[i]);\n }\n }\n }\n }\n\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let coords = vec4(batch, r, c + i, d1);\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n var value = dotProd[i];\n ${Qr(this.addBias,this.activation)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }\n }\n `}};var Zc=class{constructor(t,e=!1,o=null,n=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=`pads : vec2, inDims : vec2, filterHeight : i32,\n filterWidth : i32, strides : vec2, dilations : vec2,`,this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=t.dataFormat===\"channelsLast\",e&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),this.convInfo=t,this.addBias=e,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwise_${this.activation}_${this.isChannelsLast}`}getUserCode(){let t=this.isChannelsLast?\"getX(batch, xR, xC, d1);\":\"getX(batch, d1, xR, xC);\";return`\n ${dr(this.activation,this.hasPreluActivation,!1,4)}\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords[0];\n let xRCCorner = vec2(coords.${this.isChannelsLast?\"yz\":\"zw\"}) * uniforms.strides - uniforms.pads;\n let d2 = coords[${this.isChannelsLast?3:1}];\n let channelMul = uniforms.wShape[3];\n let d1 = d2 / channelMul;\n let q = d2 % channelMul;\n\n let inputRowStart = xRCCorner.x;\n let inputColStart = xRCCorner.y;\n let inputRowEnd = inputRowStart + uniforms.filterHeight *\n uniforms.dilations[0];\n let inputColEnd = inputColStart + uniforms.filterWidth *\n uniforms.dilations[1];\n\n // Convolve x(?, ?, d1)|x(d1, ?, ?) with w(:, :, d1, q) to get\n // y(yR, yC, d2)|y(d2, yR, yC). ? = to be determined. : = across all\n // values in that axis. x(?, ?, d1) and y(yR, yC, d2) is for NHWC.\n // x(d1, ?, ?) and y(d2, yR, yC) is for NCHW.\n var value = 0.0;\n\n // Extract if checking out of for loop for performance.\n if (inputRowStart >= 0 && inputColStart >= 0 &&\n inputRowEnd < uniforms.inDims[0] &&\n inputColEnd < uniforms.inDims[1]) {\n for (var wR = 0; wR < uniforms.filterHeight; wR = wR + 1) {\n let xR = inputRowStart + wR * uniforms.dilations[0];\n\n for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) {\n let xC = inputColStart + wC * uniforms.dilations[1];\n\n let xVal = ${t};\n let wVal = getW(wR, wC, d1, q);\n value = value + xVal * wVal;\n }\n }\n } else {\n for (var wR = 0; wR < uniforms.filterHeight; wR = wR + 1) {\n let xR = inputRowStart + wR * uniforms.dilations[0];\n\n if (xR < 0 || xR >= uniforms.inDims[0]) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) {\n let xC = inputColStart + wC * uniforms.dilations[1];\n\n if (xC < 0 || xC >= uniforms.inDims[1]) {\n continue;\n }\n\n let xVal = ${t};\n let wVal = getW(wR, wC, d1, q);\n value = value + xVal * wVal;\n }\n }\n }\n ${Qr(this.addBias,this.activation)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }\n `}};function Oue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(p),m=u;m==null&&(m=[1,1]);let d=w.computeConv2DInfo(n.shape,s.shape,a,m,i,c,!0,l),f=[{type:\"int32\",data:[d.padInfo.top,d.padInfo.left]},{type:\"int32\",data:[d.inHeight,d.inWidth]}],h=d.dataFormat===\"channelsLast\",g;return!h&&d.inHeight>16&&d.inWidth>16&&d.strideHeight===1&&d.strideWidth===1&&d.dilationWidth===1&&d.dilationHeight===1&&d.inChannels===d.outChannels?g=new _x(d.outShape,d.filterHeight,d.filterWidth):h&&d.outHeight>4&&d.outWidth>4&&d.strideWidth<=2&&d.inChannels===d.outChannels&&d.dilationHeight===1&&d.dilationWidth===1&&d.inChannels%4===0?(g=new Qc(d),f.push({type:\"int32\",data:[g.virtualWidth]})):(g=new Zc(d),f.push({type:\"int32\",data:[d.filterHeight]},{type:\"int32\",data:[d.filterWidth]},{type:\"int32\",data:[d.strideHeight,d.strideWidth]},{type:\"int32\",data:[d.dilationHeight,d.dilationWidth]})),e.runWebGPUProgram(g,[n,s],n.dtype,f)}var MV={kernelName:mn,backendName:\"webgpu\",kernelFunc:Oue};var $x=class{constructor(t){this.variableNames=[\"x\",\"dy\"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32,\n outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"depthwise_conv2d_backprop_filter\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wR = coords[0];\n let wC = coords[1];\n let d1 = coords[2];\n let dm = coords[3];\n let d2 = d1 * uniforms.channelMul + dm;\n\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b++) {\n for (var yR = 0; yR < uniforms.outHeight; yR++) {\n let xR = wR + yR * uniforms.strides[0] - uniforms.pads[0];\n\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC++) {\n let xC = wC + yC * uniforms.strides[1] - uniforms.pads[1];\n\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n let dyValue = getDy(b, yR, yC, d2);\n let xValue = getX(b, xR, xC, d1);\n dotProd += xValue * dyValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},Ex=class{constructor(t){this.variableNames=[\"dy\",\"W\"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"depthwise_conv2d_backprop_input\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d1 = coords[3];\n let dyCorner = coords.yz - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n\n let idyR = i32(dyR);\n let wRPerm = uniforms.filterDims[0] - 1 - wR;\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n\n let idyC = i32(dyC);\n let wCPerm = uniforms.filterDims[1] - 1 - wC;\n\n for (var dm = 0; dm < uniforms.channelMul; dm++) {\n let d2 = d1 * uniforms.channelMul + dm;\n let xValue = getDy(batch, idyR, idyC, d2);\n let wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function Mue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:c}=o,l=w.computeConv2DInfo(n.shape,c,a,i,p,u,!0),m=new $x(l),d=[{type:\"int32\",data:[l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.padInfo.top,l.padInfo.left]},{type:\"int32\",data:[l.filterHeight,l.filterWidth]},{type:\"int32\",data:[l.outHeight]},{type:\"int32\",data:[l.outWidth]},{type:\"int32\",data:[l.inHeight]},{type:\"int32\",data:[l.inWidth]},{type:\"int32\",data:[l.batchSize]},{type:\"int32\",data:[l.outChannels/l.inChannels]}];return e.runWebGPUProgram(m,[n,s],\"float32\",d)}var LV={kernelName:Fi,backendName:\"webgpu\",kernelFunc:Mue};function Lue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:c}=o,l=w.computeConv2DInfo(c,s.shape,a,i,p,u,!0),m=new Ex(l),d=[{type:\"int32\",data:[l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.filterHeight-1-l.padInfo.top,l.filterWidth-1-l.padInfo.left]},{type:\"int32\",data:[l.filterHeight,l.filterWidth]},{type:\"int32\",data:[l.outHeight]},{type:\"int32\",data:[l.outWidth]},{type:\"int32\",data:[l.outChannels/l.inChannels]}];return e.runWebGPUProgram(m,[n,s],n.dtype,d)}var BV={kernelName:Pi,backendName:\"webgpu\",kernelFunc:Lue};var Rx=class{constructor(t){this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"diag\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let value = select(0.0, getX(coords[0]), coords[0] == coords[1]);\n setOutputAtIndex(index, value);\n }\n }\n `}};function Bue(r){let{inputs:t,backend:e}=r,{x:o}=t,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=pe({inputs:{x:o},backend:e,attrs:{shape:[s]}}),i=new Rx(s),p=e.runWebGPUProgram(i,[a],a.dtype),u=pe({inputs:{x:p},backend:e,attrs:{shape:n}});return e.disposeData(a.dataId),e.disposeData(p.dataId),u}var zV={kernelName:oa,backendName:\"webgpu\",kernelFunc:Bue};var Dx=class{constructor(t){this.variableNames=[\"x\",\"w\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"dilation2d\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let neg_infinity = -3.4e38;\n let coords = getOutputCoords();\n let batch = coords.x;\n let d1 = coords.w;\n let outTopLeftCorner = coords.yz * uniforms.strides - uniforms.pads;\n let hBeg = outTopLeftCorner.x;\n let wBeg = outTopLeftCorner.y;\n\n var curVal = neg_infinity;\n for (var h = 0; h < uniforms.filterDims[0]; h = h + 1) {\n let hIn = hBeg + h * uniforms.dilations[0];\n\n if (hIn >= 0 && hIn < uniforms.xShape[1]) {\n for (var w = 0; w < uniforms.filterDims[1]; w = w + 1) {\n let wIn = wBeg + w * uniforms.dilations[1];\n\n if (wIn >= 0 && wIn < uniforms.xShape[2]) {\n let val = getX(batch, hIn, wIn, d1) + getW(h, w, d1);\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n setOutputAtIndex(index, curVal);\n }\n }\n `}};function zue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeDilation2DInfo(n.shape,s.shape,a,i,\"NHWC\",p),c=[u.padInfo.top,u.padInfo.left],l=[{type:\"int32\",data:[u.filterHeight,u.filterWidth]},{type:\"int32\",data:[...c]},{type:\"int32\",data:[u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.dilationHeight,u.dilationWidth]}],m=new Dx(u);return e.runWebGPUProgram(m,[n,s],n.dtype,l)}var VV={kernelName:dn,backendName:\"webgpu\",kernelFunc:zue};var Ax=class{constructor(t,e){if(this.variableNames=[\"x\",\"w\",\"dy\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t.inShape,this.dispatchLayout=X(t.outShape),this.dispatch=H(this.dispatchLayout,t.outShape,this.workgroupSize),e!==\"float32\"&&e!==\"int32\")throw new Error(`Dilation2DBackpropInput only supports float32 and int32\n types, does not support ${e} type.`);this.type=e,this.shaderKey=\"dilation2DBackpropInput\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.dySize) {\n let coords = getDyCoordsFromIndex(index);\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let dyCorner = vec2(r, c) * uniforms.strides - uniforms.pads;\n var curVal = -3.4e38; // neg_infinity\n var xRMax = 0;\n var xCMax = 0;\n\n // In the case of multiple argmax branches, we only back-propagate\n // along the last branch, i.e., the one with largest value of\n // 'wR * uniforms.filterDims[1] + wC', similarly to the max-pooling\n // backward routines.\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let xR = dyCorner.x + wR * uniforms.dilations[0];\n\n if (xR >= 0 && xR < uniforms.xShape[1]) {\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let xC = dyCorner.y + wC * uniforms.dilations[1];\n\n if (xC >= 0 && xC < uniforms.xShape[2]) {\n let val = getX(b, xR, xC, d) + getW(wR, wC, d);\n if (val > curVal) {\n curVal = val;\n xRMax = xR;\n xCMax = xC;\n }\n }\n }\n }\n }\n\n let flatIndexIn = d + uniforms.xShape[3] *\n (xCMax + uniforms.xShape[2] * (xRMax + uniforms.xShape[1] * b));\n let value = getDy(b, r, c, d);\n ${Yr(\"&result[flatIndexIn]\",\"value\",this.type)}\n }\n }\n `}},Fx=class{constructor(t,e,o){if(this.variableNames=[\"x\",\"w\",\"dy\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(t.outShape),this.dispatch=H(this.dispatchLayout,t.outShape,this.workgroupSize),o!==\"float32\"&&o!==\"int32\")throw new Error(`Dilation2DBackpropFilter only supports float32 and int32\n types, does not support ${o} type.`);this.type=o,this.shaderKey=\"dilation2DBackpropFilter\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.dySize) {\n let coords = getDyCoordsFromIndex(index);\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let dyCorner = vec2(r, c) * uniforms.strides - uniforms.pads;\n var curVal = -3.4e38; // neg_infinity\n var wRMax = 0;\n var wCMax = 0;\n\n // In the case of multiple argmax branches, we only back-propagate\n // along the last branch, i.e., the one with largest value of\n // 'wR * uniforms.filterDims[1] + wC', similarly to the max-pooling\n // backward routines.\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let xR = dyCorner.x + wR * uniforms.dilations[0];\n\n if (xR >= 0 && xR < uniforms.xShape[1]) {\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let xC = dyCorner.y + wC * uniforms.dilations[1];\n\n if (xC >= 0 && xC < uniforms.xShape[2]) {\n let val = getX(b, xR, xC, d) + getW(wR, wC, d);\n if (val > curVal) {\n curVal = val;\n wRMax = wR;\n wCMax = wC;\n }\n }\n }\n }\n }\n\n let flatIndexIn = d + uniforms.wShape[2] * (wCMax + wRMax * uniforms.wShape[1]);\n let value = getDy(b, r, c, d);\n ${Yr(\"&result[flatIndexIn]\",\"value\",this.type)}\n }\n }\n `}};function Vue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o,c=w.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),l=s.dtype,m=new Fx(c,s.shape,l),d=[{type:\"int32\",data:[c.filterHeight,c.filterWidth]},{type:\"int32\",data:[c.padInfo.top,c.padInfo.left]},{type:\"int32\",data:[c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.dilationHeight,c.dilationWidth]},{type:\"int32\",data:[y.sizeFromShape(c.outShape)]}],f=vt({backend:e,attrs:{shape:s.shape,value:0,dtype:l}});return e.runWebGPUProgram(m,[n,s,a],l,d,f)}var WV={kernelName:Mi,backendName:\"webgpu\",kernelFunc:Vue};function Wue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o,c=w.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),l=n.dtype,m=new Ax(c,l),d=[{type:\"int32\",data:[c.filterHeight,c.filterWidth]},{type:\"int32\",data:[c.padInfo.top,c.padInfo.left]},{type:\"int32\",data:[c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.dilationHeight,c.dilationWidth]},{type:\"int32\",data:[y.sizeFromShape(c.outShape)]}],f=vt({backend:e,attrs:{shape:c.inShape,value:0,dtype:l}});return e.runWebGPUProgram(m,[n,s,a],l,d,f)}var UV={kernelName:Oi,backendName:\"webgpu\",kernelFunc:Wue};var Px=class{constructor(t,e,o){this.variableNames=[\"Image\"],this.uniforms=\"alpha: f32,\",this.workgroupSize=[64,1,1],this.pixelsOpType=Ci.DRAW,this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.type=e,this.textureFormat=o,this.shaderKey=`draw_${e}_${o}`}getUserCode(){let t,e=this.type===\"float32\"?\"value\":\"value / 255.0\";return t=`\n if (uniforms.numChannels == 1) {\n rgba[0] = ${e};\n rgba[1] = ${e};\n rgba[2] = ${e};\n } else {\n rgba[d] = ${e};\n }`,`\n @group(0) @binding(0) var outImage : texture_storage_2d<${this.textureFormat}, write>;\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var rgba = vec4(0.0, 0.0, 0.0, uniforms.alpha);\n for (var d = 0; d < uniforms.numChannels; d = d + 1) {\n let value = f32(inBuf[index * uniforms.numChannels + d]);\n ${t}\n }\n rgba.x = rgba.x * rgba.w;\n rgba.y = rgba.y * rgba.w;\n rgba.z = rgba.z * rgba.w;\n let coords = getCoordsFromIndex(index);\n textureStore(outImage, vec2(coords.yx), rgba);\n }\n }\n `}};function Uue(r){let{inputs:t,backend:e,attrs:o}=r,{image:n}=t,{canvas:s,options:a}=o,[i,p]=n.shape.slice(0,2),{imageOptions:u}=a||{},c=(u==null?void 0:u.alpha)||1,l=e.device.features.has(\"bgra8unorm-storage\")?\"bgra8unorm\":\"rgba8unorm\",m=[i,p],d=new Px(m,n.dtype,l);s.width=p,s.height=i;let f=\"webgpu\",h=s.getContext(f),g;h||(g=new OffscreenCanvas(p,i),h=g.getContext(f));let x=n.shape.length===3?n.shape[2]:1;h.configure({device:e.device,format:l,usage:GPUTextureUsage.STORAGE_BINDING,alphaMode:\"premultiplied\"});let b=\"int32\",C=e.makeTensorInfo(m,b),S=e.tensorMap.get(C.dataId);S.resource=h.getCurrentTexture(),S.external=!0;let k=[{type:\"uint32\",data:[x]},{type:\"float32\",data:[c]}];if(e.runWebGPUProgram(d,[n],b,k,C),g){let _=s.getContext(\"2d\");if(!_)throw new Error(\"Please make sure this canvas has only been used for 2d or webgpu context!\");_.drawImage(g,0,0)}return e.disposeData(C.dataId),n}var GV={kernelName:_u,backendName:\"webgpu\",kernelFunc:Uue};var a0=et({opType:fe.MUL,cpuKernelImpl:kz,supportsComplex:!0}),HV={kernelName:Xn,backendName:\"webgpu\",kernelFunc:a0};function i0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;return Jr(n,s,a,\"sum\",e)}var KV={kernelName:Ss,backendName:\"webgpu\",kernelFunc:i0};function Gue(r){let{inputs:t,backend:e,attrs:o}=r,{equation:n}=o,s=t,{allDims:a,summedDims:i,idDims:p}=w.decodeEinsumEquation(n,s.length);w.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:c}=w.getEinsumComputePath(i,p),l=c.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=i0({inputs:{x:m},backend:e,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&e.disposeData(h.dataId);return m}var qV={kernelName:Li,backendName:\"webgpu\",kernelFunc:Gue};var Hue=ye({opType:Z.ELU}),jV={kernelName:hn,backendName:\"webgpu\",kernelFunc:Hue};var Kue=r=>{let{inputs:t,backend:e}=r,{dy:o,y:n}=t,s=new Si(fe.ELU_DER,o.shape,n.shape);return e.runWebGPUProgram(s,[o,n],o.dtype)},XV={kernelName:Xa,backendName:\"webgpu\",kernelFunc:Kue};var que=et({opType:fe.EQUAL,dtype:\"bool\",cpuKernelImpl:cz}),YV={kernelName:xn,backendName:\"webgpu\",kernelFunc:que};var jue=ye({opType:Z.ERF}),QV={kernelName:gn,backendName:\"webgpu\",kernelFunc:jue};var Xue=ye({opType:Z.EXP,cpuKernelImpl:lz,dtype:\"float32\"}),ZV={kernelName:yn,backendName:\"webgpu\",kernelFunc:Xue};function Ox(r){let{inputs:t,attrs:e,backend:o}=r,{dim:n}=e,{input:s}=t,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),pe({inputs:{x:s},backend:o,attrs:{shape:i}})}var JV={kernelName:na,backendName:\"webgpu\",kernelFunc:Ox};var Yue=ye({opType:Z.EXPM1,cpuKernelImpl:mz}),eW={kernelName:bn,backendName:\"webgpu\",kernelFunc:Yue};var gm=class{constructor(t,e){this.variableNames=[\"real\",\"imag\"],this.outputShape=[],this.uniforms=\"exponentMultiplier : f32, denominator: f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.component=t,this.shaderKey=`fft_${t}`}getUserCode(){return`\n fn unaryOpComplex(real: f32, expR: f32, imag: f32, expI: f32) -> f32 {\n ${this.component===\"real\"?\"return real * expR - imag * expI;\":\"return real * expI + imag * expR;\"}\n }\n\n fn mulMatDFT(batch: i32, index: i32) -> f32 {\n let indexRatio = f32(index) / f32(uniforms.realShape[1]);\n let exponentMultiplierTimesIndexRatio =\n uniforms.exponentMultiplier * indexRatio;\n\n var result = 0.0;\n\n for (var i = 0; i < uniforms.realShape[1]; i = i + 1) {\n // x = (-2|2 * PI / N) * index * i;\n let x = exponentMultiplierTimesIndexRatio * f32(i);\n let expR = cos(x);\n let expI = sin(x);\n let real = getReal(batch, i);\n let imag = getImag(batch, i);\n\n result = result +\n unaryOpComplex(real, expR, imag, expI) / uniforms.denominator;\n }\n\n return result;\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n setOutputAtIndex(index, mulMatDFT(coords[0], coords[1]));\n }\n }\n `}};function Mx(r,t,e){let o=e.tensorMap.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=[],p=pe({inputs:{x:r},backend:e,attrs:{shape:[a,s]}});i.push(p);let u=p.shape,c=new gm(\"real\",u),l=new gm(\"imag\",u),m=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:u},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:u}],d=t?2*Math.PI:-2*Math.PI,f=t?u[1]:1,h=[{type:\"float32\",data:[d]},{type:\"float32\",data:[f]}],g=e.runWebGPUProgram(c,m,\"float32\",h);i.push(g);let x=e.runWebGPUProgram(l,m,\"float32\",h);i.push(x);let b=xo({inputs:{real:g,imag:x},backend:e});i.push(b);let C=pe({inputs:{x:b},backend:e,attrs:{shape:r.shape}});return i.forEach(S=>e.disposeData(S.dataId)),C}function Que(r){let{inputs:t,backend:e}=r,{input:o}=t;return Mx(o,!1,e)}var tW={kernelName:Bi,backendName:\"webgpu\",kernelFunc:Que};var Lx=class{constructor(t){this.outputShape=[],this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"flipLeftRight\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let coordX = uniforms.xShape[2] - coords[2] - 1;\n let outputValue = getX(coords[0], coords[1], coordX, coords[3]);\n setOutputAtIndex(index, outputValue);\n }\n }\n `}};var rW={kernelName:Cn,backendName:\"webgpu\",kernelFunc:({inputs:r,backend:t})=>{let{image:e}=r,o=t,n=new Lx(e.shape);return o.runWebGPUProgram(n,[e],e.dtype)}};var Zue=ye({opType:Z.FLOOR,cpuKernelImpl:dz}),oW={kernelName:wn,backendName:\"webgpu\",kernelFunc:Zue};var Jue=et({opType:fe.FLOOR_DIV,cpuKernelImpl:fz,dtype:\"int32\"}),nW={kernelName:Sn,backendName:\"webgpu\",kernelFunc:Jue};var Bx=class{constructor(t,e,o=!1){this.pixelsOpType=Ci.FROM_PIXELS,this.outputShape=[0],this.variableNames=[],this.workgroupSize=[256,1,1],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[e,1,1]),this.importVideo=o,this.shaderKey=`fromPixels_${this.importVideo}`}getUserCode(){let t=this.importVideo?\"textureLoad(src, vec2(coords.yx));\":\"textureLoad(src, vec2(coords.yx), 0)\";return`\n @binding(1) @group(0) var src: ${this.importVideo?\"texture_external\":\"texture_2d\"};\n ${G(\"index\")} {\n let flatIndex = index * uniforms.numChannels;\n if (flatIndex < uniforms.size) {\n let coords = getCoordsFromIndex(flatIndex);\n let values = ${t};\n for (var i = 0; i < uniforms.numChannels; i = i + 1) {\n result[flatIndex + i] = i32(floor(255.0 * values[i]));\n }\n }\n }\n `}};var sW={kernelName:Eu,backendName:\"webgpu\",kernelFunc:epe},Jc,u0=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");function epe(r){let{inputs:t,backend:e,attrs:o}=r,{pixels:n}=t,{numChannels:s}=o;if(n==null)throw new Error(\"pixels passed to tf.browser.fromPixels() can not be null\");let a=typeof HTMLVideoElement!=\"undefined\"&&n instanceof HTMLVideoElement,i=typeof HTMLImageElement!=\"undefined\"&&n instanceof HTMLImageElement,p=typeof HTMLCanvasElement!=\"undefined\"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas!=\"undefined\"&&n instanceof OffscreenCanvas,u=typeof ImageBitmap!=\"undefined\"&&n instanceof ImageBitmap,[c,l]=a?[n.videoWidth,n.videoHeight]:[n.width,n.height],m=[l,c,s],d=A().getBool(\"WEBGPU_IMPORT_EXTERNAL_TEXTURE\")&&a,f=a||i;if(u||p||f){let b;if(d)b=e.device.importExternalTexture({source:n});else{if(f){let L=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");(Jc==null||L!==u0)&&(u0=L,Jc=document.createElement(\"canvas\").getContext(\"2d\",{willReadFrequently:u0})),Jc.canvas.width=c,Jc.canvas.height=l,Jc.drawImage(n,0,0,c,l),n=Jc.canvas}let P=GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING,O=\"rgba8unorm\",M=e.textureManager.acquireTexture(m[1],m[0],O,P);e.queue.copyExternalImageToTexture({source:n},{texture:M},[m[1],m[0]]),b=M}let C=y.sizeFromShape(m),S=y.computeStrides(m),k=new Bx(m,s,d),_=[{type:\"uint32\",data:[C]},{type:\"uint32\",data:[s]},{type:\"uint32\",data:[...S]}],E=e.makeTensorInfo([l,c],\"int32\"),R=e.tensorMap.get(E.dataId);R.resource=b;let D=e.runWebGPUProgram(k,[E],\"int32\",_);return e.disposeData(E.dataId),D}let h=n.data,g=h;if(s!=null&&s!==4){g=new Uint8Array(n.width*n.height*s);let b=h.length,C=0;for(let S=0;S(xValue, -meanValue, offsetValue), vec3(inv, inv, 1.0)));\n }\n }\n `}};var aW={kernelName:In,backendName:\"webgpu\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o,scale:n,offset:s,mean:a,variance:i}=r,{varianceEpsilon:p}=t,u=e,c=[o,a,i],l=null;s!=null&&(l=s.shape,c.push(s));let m=null;n!=null&&(m=n.shape,c.push(n));let d=new zx(o.shape,a.shape,i.shape,l,m),f=[{type:\"float32\",data:[p]}];return u.runWebGPUProgram(d,c,o.dtype,f)}};function tpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dataFormat:c,dilations:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=w.convertConv2DDataFormat(c),g=w.computeConv2DInfo(n.shape,s.shape,p,l,u,m,!1,h);return yx({x:n,filter:s,convInfo:g,backend:e,bias:a,preluActivationWeights:i,leakyreluAlpha:f,activation:d})}var iW={kernelName:Io,backendName:\"webgpu\",kernelFunc:tpe};function rpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dimRoundingMode:l,activation:m,leakyreluAlpha:d}=o,f=c;f==null&&(f=[1,1]),y.assert(w.eitherStridesOrDilationsAreOne(p,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${f}'`);let h=w.computeConv2DInfo(n.shape,s.shape,p,f,u,l,!0),g=[n,s],x=a!=null,b=i!=null;x&&g.push(a),b&&g.push(i);let C=[{type:\"int32\",data:[h.padInfo.top,h.padInfo.left]},{type:\"int32\",data:[h.inHeight,h.inWidth]}],S;return h.outHeight>4&&h.outWidth>4&&h.strideWidth<=2&&h.inChannels===h.outChannels&&h.dilationHeight===1&&h.dilationWidth===1&&h.inChannels%4===0?(S=new Qc(h,x,m,b),C.push({type:\"int32\",data:[S.virtualWidth]})):(S=new Zc(h,x,m,b),C.push({type:\"int32\",data:[h.filterHeight]},{type:\"int32\",data:[h.filterWidth]},{type:\"int32\",data:[h.strideHeight,h.strideWidth]},{type:\"int32\",data:[h.dilationHeight,h.dilationWidth]})),m===\"leakyrelu\"&&(C.push({type:\"float32\",data:[d]}),S.uniforms+=\" alpha : f32,\"),e.runWebGPUProgram(S,g,\"float32\",C)}var uW={kernelName:vo,backendName:\"webgpu\",kernelFunc:rpe};var Vx=class{constructor(t,e){this.variableNames=[\"A\",\"indices\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`gathernd_${t}`,this.sliceDim=t,this.uniforms=`sliceDim : i32, strides : ${ft(t)},`}getUserCode(){let t;return this.sliceDim>1?t=\"uniforms.strides[j]\":t=\"uniforms.strides\",`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var flattenIndex = 0;\n for (var j = 0; j < uniforms.sliceDim; j = j + 1) {\n let indexTemp = i32(round(getIndices(coords[0], j)));\n let strideNum = ${t};\n flattenIndex = flattenIndex + indexTemp * strideNum;\n }\n\n setOutputAtIndex(index, getA(flattenIndex, coords[1]));\n }\n }\n `}};function ope(r){let{inputs:t,backend:e}=r,{params:o,indices:n}=t,s=n.shape,a=s[s.length-1],i=y.sizeFromShape(o.shape),[p,u,c,l]=w.prepareAndValidate(o,n),m=pe({inputs:{x:n},backend:e,attrs:{shape:[u,a]}}),d=pe({inputs:{x:o},backend:e,attrs:{shape:[y.sizeFromShape(o.shape)/c,c]}});if(e.shouldExecuteOnCPU([o,n])||o.dtype===\"string\"){let b=e.readSync(n.dataId),C=e.bufferSync(o),S=hz(b,C,o.dtype,u,a,c,l,o.shape,i);return e.makeTensorInfo(p,o.dtype,S.values)}let f=new Vx(a,[u,c]),h=[{type:\"int32\",data:[a]},{type:\"int32\",data:l}],g=e.runWebGPUProgram(f,[d,m],d.dtype,h),x=pe({inputs:{x:g},backend:e,attrs:{shape:p}});return e.disposeData(m.dataId),e.disposeData(d.dataId),e.disposeData(g.dataId),x}var pW={kernelName:vn,backendName:\"webgpu\",kernelFunc:ope};var Wx=class{constructor(t,e){this.variableNames=[\"A\",\"indices\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.slice(),this.aShape=t,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"gather\"}getUserCode(){let t=npe(this.aShape);return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let resRC = getCoordsFromIndex(index);\n let indexZ = i32(getIndices(resRC.x, resRC.z));\n let inBounds = select(0.0, 1.0, indexZ >= 0 && indexZ < uniforms.aShape[2]);\n setOutputAtIndex(index, inBounds * getA(${t}));\n }\n }\n `}};function npe(r){let t=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],e=[];for(let o=0;oe.disposeData(D.dataId)),e.makeTensorInfo(u.outputShape,R.dtype,R.values)}let h=new Wx(m.shape,f),g=e.runWebGPUProgram(h,[m,d],m.dtype);l.push(g);let x=pe({inputs:{x:g},backend:e,attrs:{shape:u.outputShape}});return l.forEach(b=>e.disposeData(b.dataId)),x}var cW={kernelName:aa,backendName:\"webgpu\",kernelFunc:p0};var spe=et({opType:fe.GREATER,cpuKernelImpl:yz,dtype:\"bool\"}),lW={kernelName:kn,backendName:\"webgpu\",kernelFunc:spe};var ape=et({opType:fe.GREATER_EQUAL,dtype:\"bool\",cpuKernelImpl:xz}),mW={kernelName:Nn,backendName:\"webgpu\",kernelFunc:ape};function ipe(r){let{inputs:t,backend:e}=r,{input:o}=t;return Mx(o,!0,e)}var dW={kernelName:zi,backendName:\"webgpu\",kernelFunc:ipe};var upe=ye({opType:Z.IS_FINITE,dtype:\"bool\"}),fW={kernelName:Tn,backendName:\"webgpu\",kernelFunc:upe};var ppe=ye({opType:Z.IS_INF,dtype:\"bool\"}),hW={kernelName:_n,backendName:\"webgpu\",kernelFunc:ppe};var cpe=ye({opType:Z.IS_NAN,dtype:\"bool\"}),gW={kernelName:$n,backendName:\"webgpu\",kernelFunc:cpe};function lpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{alpha:s}=o,a=[{type:\"float32\",data:[s]}],i=new Zr(n.shape,Z.LEAKYRELU,\"alpha : f32,\");return e.runWebGPUProgram(i,[n],\"float32\",a)}var xW={kernelName:En,backendName:\"webgpu\",kernelFunc:lpe};var mpe=et({opType:fe.LESS,dtype:\"bool\",cpuKernelImpl:Cz}),yW={kernelName:Rn,backendName:\"webgpu\",kernelFunc:mpe};var dpe=et({opType:fe.LESS_EQUAL,dtype:\"bool\",cpuKernelImpl:bz}),bW={kernelName:Dn,backendName:\"webgpu\",kernelFunc:dpe};var Ux=class{constructor(t){this.variableNames=[],this.outputShape=[],this.uniforms=\"start : f32, step : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"linSpace\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n setOutputAtIndex(index, uniforms.start + f32(index) * uniforms.step);\n }\n }\n `}};function fpe(r){let{backend:t,attrs:e}=r,{start:o,stop:n,num:s}=e,a=(n-o)/(s-1),i=new Ux(s),p=[{type:\"float32\",data:[o]},{type:\"float32\",data:[a]}];return t.runWebGPUProgram(i,[],\"float32\",p)}var CW={kernelName:An,backendName:\"webgpu\",kernelFunc:fpe};var hpe=ye({opType:Z.LOG,cpuKernelImpl:wz}),wW={kernelName:Fn,backendName:\"webgpu\",kernelFunc:hpe};var gpe=ye({opType:Z.LOG1P}),SW={kernelName:Pn,backendName:\"webgpu\",kernelFunc:gpe};var xpe=et({opType:fe.LOGICAL_AND,dtype:\"bool\"}),IW={kernelName:On,backendName:\"webgpu\",kernelFunc:xpe};var ype=ye({opType:Z.LOGICAL_NOT}),vW={kernelName:Mn,backendName:\"webgpu\",kernelFunc:ype};var bpe=et({opType:fe.LOGICAL_OR}),kW={kernelName:Ln,backendName:\"webgpu\",kernelFunc:bpe};var NW=`\n var powValue = 0.0;\n let basis = uniforms.bias + uniforms.alpha * sum;\n if (uniforms.beta == 0.5) {\n powValue = inverseSqrt(basis);\n } else if (uniforms.beta == 1.0) {\n powValue = 1.0 / basis;\n } else {\n powValue = exp(log(basis) * (-uniforms.beta));\n }\n`,Gx=class{constructor(t){this.outputShape=[],this.variableNames=[\"x\"],this.uniforms=\"radius : i32, bias : f32, alpha : f32, beta : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"lrn\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let x = getX(b, r, c, d);\n var sum = 0.0;\n for (var i = -uniforms.radius; i <= uniforms.radius; i = i + 1) {\n let idx = d + i;\n if (idx >= 0 && idx < uniforms.xShape[3]) {\n let z = getX(b, r, c, idx);\n sum = sum + z * z;\n }\n }\n ${NW}\n\n setOutputAtIndex(index, x * powValue);\n }\n }\n `}},Hx=class{constructor(t,e){this.outputShape=[],this.variableNames=[\"x\"],this.uniforms=\"radius : i32, bias : f32, alpha : f32, beta : f32,\",this.workgroupSize=[256,1,1],this.maxAllowRadius=16,y.assert(e<=this.maxAllowRadius,()=>`Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${e}`),this.outputShape=t,this.elementsPerWorkgroup=this.workgroupSize[0]-2*this.maxAllowRadius,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,[this.elementsPerWorkgroup,this.workgroupSize[1],this.workgroupSize[2]]),this.shaderKey=\"lrn_shared\"}getUserCode(){return`\n var lrnSub: array;\n const elementsPerWorkgroup = ${this.elementsPerWorkgroup};\n const maxAllowRadius = ${this.maxAllowRadius};\n\n ${G()} {\n let localDepth = i32(localId.x);\n let workgroupDepth = i32(workgroupId.x) * elementsPerWorkgroup;\n let xDepth = workgroupDepth + localDepth - maxAllowRadius;\n let b = i32(globalId.z) / uniforms.xShape[1];\n let r = i32(globalId.z) - b * uniforms.xShape[1];\n let c = i32(globalId.y);\n let d = workgroupDepth + localDepth;\n\n var x = 0.0;\n if (xDepth >= 0 && xDepth < uniforms.xShape[3]) {\n x = getX(b, r, c, xDepth);\n }\n lrnSub[localDepth] = x;\n workgroupBarrier();\n\n if (localDepth < elementsPerWorkgroup && d < uniforms.outShape[3]) {\n var sum = 0.0;\n let index = localDepth + maxAllowRadius;\n for (var i = -uniforms.radius; i <= uniforms.radius; i = i + 1) {\n let z = lrnSub[index + i];\n sum = sum + z * z;\n }\n ${NW}\n\n setOutputAtCoords(b, r, c, d, lrnSub[index] * powValue);\n }\n } `}};function Cpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u;s>16?u=new Gx(n.shape):u=new Hx(n.shape,s);let c=[{type:\"int32\",data:[s]},{type:\"float32\",data:[a]},{type:\"float32\",data:[i]},{type:\"float32\",data:[p]}];return e.runWebGPUProgram(u,[n],n.dtype,c)}var TW={kernelName:Bn,backendName:\"webgpu\",kernelFunc:Cpe};var Kx=class{constructor(t){this.outputShape=[],this.variableNames=[\"inputImage\",\"outputImage\",\"dy\"],this.uniforms=\"depthRadius : i32, bias : f32, alpha : f32, beta : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"lrn_grad\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n\n let MIN_DEPTH_BEGIN = 0;\n let MAX_DEPTH_END = uniforms.outShape[3];\n var result = 0.0;\n for (var d = MIN_DEPTH_BEGIN; d < MAX_DEPTH_END; d++) {\n let depthBegin = max(MIN_DEPTH_BEGIN, d - uniforms.depthRadius);\n let depthEnd = min(MAX_DEPTH_END, d + uniforms.depthRadius + 1);\n\n var norm = 0.0;\n for (var k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; k++) {\n if (k < depthBegin) {\n continue;\n } else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n } else {\n break;\n }\n }\n\n norm = uniforms.alpha * norm + uniforms.bias;\n\n for (var k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; k++) {\n if (k < depthBegin) {\n continue;\n } else if (k >= depthBegin && k < depthEnd) {\n var dyi = -2.0 * uniforms.alpha * uniforms.beta\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d) / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * uniforms.beta);\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n } else {\n break;\n }\n }\n }\n\n setOutputAtIndex(index, result);\n }\n }\n `}};function wpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,y:s,dy:a}=t,{depthRadius:i,bias:p,alpha:u,beta:c}=o,l=new Kx(n.shape),m=[{type:\"int32\",data:[i]},{type:\"float32\",data:[p]},{type:\"float32\",data:[u]},{type:\"float32\",data:[c]}];return e.runWebGPUProgram(l,[n,s,a],n.dtype,m)}var _W={kernelName:Ya,backendName:\"webgpu\",kernelFunc:wpe};var Spe=et({opType:fe.MAX,cpuKernelImpl:Iz}),$W={kernelName:Vn,backendName:\"webgpu\",kernelFunc:Spe};function Ipe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1,c=w.computePool2DInfo(n.shape,s,a,u,i,p);return sx(n,c,\"max\",e)}var EW={kernelName:Wn,backendName:\"webgpu\",kernelFunc:Ipe};function vpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,u,p),m=new wu(l,\"max\"),d=[{type:\"int32\",data:[l.strideDepth,l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.padInfo.front,l.padInfo.top,l.padInfo.left]},{type:\"int32\",data:[l.inDepth,l.inHeight,l.inWidth]},{type:\"int32\",data:[l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth]}];return e.runWebGPUProgram(m,[n],n.dtype,d)}var RW={kernelName:ia,backendName:\"webgpu\",kernelFunc:vpe};var qx=class{constructor(t){this.variableNames=[\"dy\",\"maxPos\"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"maxPool2DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let dyRCCorner = vec2(coords.yz) - uniforms.pads;\n let dyRCorner = dyRCCorner.x;\n let dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n let lastIndex = uniforms.filterDims[0] * uniforms.filterDims[1] - 1;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR += uniforms.dilations[0]) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC += uniforms.dilations[1]) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyR, idyC, d);\n let maxPosValue = lastIndex - i32(getMaxPos(batch, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n let curPosValue = wR * uniforms.filterDims[1] + wC;\n let mask = select(0.0, 1.0, maxPosValue == curPosValue);\n dotProd += dyValue * mask;\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},jx=class{constructor(t){this.variableNames=[\"dy\",\"maxPos\"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"maxPool3DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyDCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n let lastIndex = uniforms.filterDims[0] * uniforms.filterDims[1] * uniforms.filterDims[2] - 1;\n\n for (var wD = 0; wD < uniforms.filterDims[0]; wD++) {\n let dyD = f32(dyDCorner + wD) / f32(uniforms.strides[0]);\n\n if (dyD < 0.0 || dyD >= f32(uniforms.outDepth) || fract(dyD) > 0.0) {\n continue;\n }\n let idyD = i32(dyD);\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyD, idyR, idyC, ch);\n let maxPosValue = lastIndex - i32(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n let curPosValue = wD * uniforms.filterDims[1] * uniforms.filterDims[2] + wR * uniforms.filterDims[2] + wC;\n let mask = select(0.0, 1.0, maxPosValue == curPosValue);\n dotProd += dyValue * mask;\n }\n }\n }\n\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function kpe(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=[1,1,1],m=w.computePool3DInfo(a.shape,i,p,l,u,c),d=new wu(m,\"max\",!0),f=[{type:\"int32\",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.padInfo.front,m.padInfo.top,m.padInfo.left]},{type:\"int32\",data:[m.inDepth,m.inHeight,m.inWidth]},{type:\"int32\",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=e.runWebGPUProgram(d,[a],\"int32\",f),g=new jx(m);f=[{type:\"int32\",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.effectiveFilterDepth-1-m.padInfo.front,m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:\"int32\",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:\"int32\",data:[m.outDepth]},{type:\"int32\",data:[m.outHeight]},{type:\"int32\",data:[m.outWidth]}];let x=e.runWebGPUProgram(g,[n,h],a.dtype,f);return e.disposeData(h.dataId),x}var DW={kernelName:Ui,backendName:\"webgpu\",kernelFunc:kpe};function Npe(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s,output:a}=t,i=s;mm([s,a],\"maxPoolGrad\");let{filterSize:p,strides:u,pad:c,dimRoundingMode:l}=o,m=w.computePool2DInfo(i.shape,p,u,1,c,l),d=new Ba(m,\"max\",!0),f=[{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.padInfo.top,m.padInfo.left]},{type:\"int32\",data:[m.dilationHeight,m.dilationWidth]},{type:\"int32\",data:[m.inHeight,m.inWidth]},{type:\"int32\",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=e.runWebGPUProgram(d,[i],\"int32\",f),g=new qx(m);f=[{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:\"int32\",data:[m.dilationHeight,m.dilationWidth]},{type:\"int32\",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:\"int32\",data:[m.outHeight]},{type:\"int32\",data:[m.outWidth]}];let x=e.runWebGPUProgram(g,[n,h],i.dtype,f);return e.disposeData(h.dataId),x}var AW={kernelName:Wi,backendName:\"webgpu\",kernelFunc:Npe};function Tpe(r){let{inputs:t,backend:e,attrs:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=o,{x:p}=t;y.assert(p.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${p.shape.length}.`);let u=[1,1];y.assert(w.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let c=w.computePool2DInfo(p.shape,n,s,u,a),l=[{type:\"int32\",data:[c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.padInfo.top,c.padInfo.left]},{type:\"int32\",data:[c.dilationHeight,c.dilationWidth]},{type:\"int32\",data:[c.inHeight,c.inWidth]},{type:\"int32\",data:[c.effectiveFilterHeight,c.effectiveFilterWidth]}],m=new Ba(c,\"max\",!1),d=e.runWebGPUProgram(m,[p],p.dtype,l);m=new Ba(c,\"max\",!0,!0,i);let f=e.runWebGPUProgram(m,[p],\"int32\",l);return[d,f]}var FW={kernelName:ua,backendName:\"webgpu\",kernelFunc:Tpe};function _pe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;return Jr(n,s,a,\"min\",e)}var PW={kernelName:Gn,backendName:\"webgpu\",kernelFunc:_pe};var $pe=et({opType:fe.MIN,cpuKernelImpl:vz}),OW={kernelName:Hn,backendName:\"webgpu\",kernelFunc:$pe};var Xx=class{constructor(t,e,o){this.uniforms=\"\",this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.map((n,s)=>n[0]+t[s]+n[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.xShape=t,e.map((n,s)=>{this.uniforms+=` pad${s} : vec2,`}),this.offset=o===\"reflect\"?0:1,this.shaderKey=`mirrorPad_${o}`}getUserCode(){let t=this.xShape.length,e=this.xShape.map((u,c)=>`uniforms.pad${c}[0]`).join(\",\"),o=this.xShape.map((u,c)=>`uniforms.pad${c}[0] + uniforms.xShape${t>1?`[${c}]`:\"\"}`).join(\",\"),n=t===1?\"start\":\"start[i]\",s=t===1?\"end\":\"end[i]\",a=t===1?\"outC\":\"outC[i]\",i=ft(t),p=t>1?[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,t):\"coords\";return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let start = ${i}(${e});\n let end = ${i}(${o});\n var outC = getCoordsFromIndex(index);\n for (var i = 0; i < ${t}; i = i + 1) {\n if (${a} < ${n}) {\n ${a} = ${n} * 2 - ${a} - ${this.offset};\n } else if(${a} >= ${s}) {\n ${a} = (${s} - 1) * 2 - ${a} + ${this.offset};\n }\n }\n let coords = outC - start;\n setOutputAtIndex(index, getX(${p}));\n }\n }\n `}};var MW={kernelName:Kn,backendName:\"webgpu\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{paddings:n,mode:s}=t,a=e,i=n.map(c=>({type:\"int32\",data:[c[0],c[1]]})),p=new Xx(o.shape,n,s);return a.runWebGPUProgram(p,[o],o.dtype,i)}};var Epe=et({opType:fe.MOD}),LW={kernelName:qn,backendName:\"webgpu\",kernelFunc:Epe};var Yx=class{constructor(t,e){this.variableNames=[\"probs\"],this.outputShape=[],this.uniforms=\"seed : f32, numOutcomes: i32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"multinomial\"}getUserCode(){return`\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n fn random (seed : f32, resultUV : vec2) -> f32 {\n let HASHSCALE1 = 443.8975;\n let p = resultUV * seed;\n var p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 = p3 + dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords[0];\n\n let resUV = vec2(f32(coords[1]) / f32(uniforms.outShape[1]),\n f32(coords[0]) / f32(uniforms.outShape[0]));\n let r = random(uniforms.seed, resUV);\n var cdf = 0.0;\n for (var i = 0; i < uniforms.numOutcomes - 1; i = i + 1) {\n cdf = cdf + getProbs(batch, i);\n\n if (r < cdf) {\n setOutputAtIndexI32(index, i);\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutputAtIndexI32(index, uniforms.numOutcomes - 1);\n }\n }\n `}};var Qx=class{constructor(t){this.variableNames=[\"logits\"],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=[this.outputShape[0],1,1],this.outputShape[1]>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.shaderKey=\"softmax\"}getUserCode(){return`\n var buf : array;\n var rowMaxShared : f32;\n var rowSumShared : f32;\n const blockSize = ${this.workgroupSize[0]};\n ${G(\"index\")} {\n let row = index / blockSize;\n let tid = i32(localId.x);\n let cols = uniforms.outShape[1];\n\n var threadMax = -3.402823e+38f;\n for (var col = tid; col < cols; col += blockSize) {\n let value = getLogits(row, col);\n threadMax = max(threadMax, value);\n }\n if (tid < cols) {\n buf[tid] = threadMax;\n }\n workgroupBarrier();\n\n var reduceSize = min(cols, blockSize);\n for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) {\n reduceSize = currSize + (reduceSize & 1);\n if (tid < currSize) {\n buf[tid] = max(buf[tid], buf[tid + reduceSize]);\n }\n workgroupBarrier();\n }\n\n if (tid == 0) {\n rowMaxShared = buf[0];\n }\n workgroupBarrier();\n\n var threadSum = 0.0;\n for (var col = tid; col < cols; col += blockSize) {\n let subExp = exp(getLogits(row, col) - rowMaxShared);\n threadSum += subExp;\n }\n buf[tid] = threadSum;\n workgroupBarrier();\n\n for (var currSize = blockSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (tid < currSize) {\n buf[tid] = buf[tid] + buf[tid + currSize];\n }\n workgroupBarrier();\n }\n\n if (tid == 0) {\n rowSumShared = buf[0];\n }\n workgroupBarrier();\n\n for (var col = tid; col < cols; col += blockSize) {\n let value = exp(getLogits(row, col) - rowMaxShared) / rowSumShared;\n setOutputAtCoords(row, col, value);\n }\n }\n `}};function c0(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{dim:s}=o,a=pe({inputs:{x:n},backend:e,attrs:{shape:[y.sizeFromShape(n.shape)/n.shape[s],n.shape[s]]}}),i=new Qx(a.shape),p=e.runWebGPUProgram(i,[a],n.dtype),u=pe({inputs:{x:p},backend:e,attrs:{shape:n.shape}});return e.disposeData(a.dataId),e.disposeData(p.dataId),u}var BW={kernelName:Is,backendName:\"webgpu\",kernelFunc:c0};function Rpe(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o,p=i?n:c0({inputs:{logits:n},backend:e,attrs:{dim:n.shape.length-1}}),u=p.shape[0],c=p.shape[1],l=new Yx(u,s),m=[{type:\"float32\",data:[a]},{type:\"int32\",data:[c]}],d=e.runWebGPUProgram(l,[p],\"int32\",m);return i||e.disposeData(p.dataId),d}var zW={kernelName:jn,backendName:\"webgpu\",kernelFunc:Rpe};function Dpe(r){let{inputs:t,backend:e}=r,{x:o}=t;if(e.shouldExecuteOnCPU([o])){let s=e.tensorMap.get(o.dataId),[a,i]=Nz(s.values,o.shape,o.dtype);return e.makeTensorInfo(i,o.dtype,a)}let n=new Zr(o.shape,Z.NEG);return e.runWebGPUProgram(n,[o],o.dtype)}var VW={kernelName:pa,backendName:\"webgpu\",kernelFunc:Dpe};function Ape(r){console.warn(\"tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=e.readSync(n.dataId),c=e.readSync(s.dataId),{selectedIndices:l}=Vt.nonMaxSuppressionV3Impl(u,c,a,i,p);return e.makeTensorInfo([l.length],\"int32\",new Int32Array(l))}var WW={kernelName:Qn,backendName:\"webgpu\",kernelFunc:Ape};function Fpe(r){console.warn(\"tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,c=e.readSync(n.dataId),l=e.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=Vt.nonMaxSuppressionV5Impl(c,l,m,d,f,h);return[e.makeTensorInfo([g.length],\"int32\",new Int32Array(g)),e.makeTensorInfo([x.length],\"float32\",new Float32Array(x))]}var UW={kernelName:Zn,backendName:\"webgpu\",kernelFunc:Fpe};var Zx=class{constructor(t,e){this.variableNames=[\"x\"],this.uniforms=\"onValue : f32, offValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"onehot\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n setOutputAtIndex(index, mix(uniforms.offValue, uniforms.onValue,\n f32(i32(round(getX(coords.x))) == coords.y)));\n }\n }\n `}};function Ppe(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n}=t,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),c=new Zx(u,a),l=pe({inputs:{x:n},backend:e,attrs:{shape:[u]}}),m=[{type:\"float32\",data:[i]},{type:\"float32\",data:[p]}],d=e.runWebGPUProgram(c,[l],s,m);e.disposeData(l.dataId);let f=[...n.shape,a],h=pe({inputs:{x:d},backend:e,attrs:{shape:f}});return e.disposeData(d.dataId),h}var GW={kernelName:Jn,backendName:\"webgpu\",kernelFunc:Ppe};function xm(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype===\"complex64\"){let n=Ii({inputs:{input:o},backend:e}),s=xm({inputs:{x:n},backend:e}),a=$p({inputs:{input:o},backend:e}),i=xm({inputs:{x:a},backend:e}),p=xo({inputs:{real:s,imag:i},backend:e});return e.disposeData(n.dataId),e.disposeData(s.dataId),e.disposeData(a.dataId),e.disposeData(i.dataId),p}else return vt({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype===\"string\"?\"\":0},backend:e})}var HW={kernelName:Sa,backendName:\"webgpu\",kernelFunc:xm};function KW(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype===\"string\")throw new Error(\"onesLike is not supported under string dtype\");if(o.dtype===\"complex64\"){let n=Ii({inputs:{input:o},backend:e}),s=KW({inputs:{x:n},backend:e}),a=$p({inputs:{input:o},backend:e}),i=xm({inputs:{x:a},backend:e}),p=xo({inputs:{real:s,imag:i},backend:e});return e.disposeData(n.dataId),e.disposeData(s.dataId),e.disposeData(a.dataId),e.disposeData(i.dataId),p}else return vt({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:e})}var qW={kernelName:ca,backendName:\"webgpu\",kernelFunc:KW};function Ope(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o;if(t.length===1)return Ox({inputs:{input:t[0]},backend:e,attrs:{dim:n}});let s=t[0].shape,a=t[0].dtype;t.forEach(c=>{y.assertShapesMatch(s,c.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===c.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=t.map(c=>{let l=Ox({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=s0({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeData(c.dataId)),u}var jW={kernelName:la,backendName:\"webgpu\",kernelFunc:Ope};function l0(r,t=!1){let e=r.length,o=ft(e),n=r.map((l,m)=>`uniforms.pad${m}[0]`).join(\",\"),s=r.map((l,m)=>`uniforms.pad${m}[0] + uniforms.xShape${e>1?`[${m}]`:\"\"}`).join(\",\"),a=e>1?`${o}(${n})`:`${n}`,i=e>1?`${o}(${s})`:`${s}`,p=e>1?\"any(paddedCoords < start)\":\"paddedCoords < start\",u=e>1?\"any(paddedCoords >= end)\":\"paddedCoords >= end\",c=e>1?[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,e):\"coords\";return`\n let start = ${a};\n let end = ${i};\n if (${p} || ${u}) {\n setOutputAtIndex(index, ${t?0:\"uniforms.constantValue\"});\n } else {\n let coords = paddedCoords - start;\n setOutputAtIndex(index, getX(${c}));\n }\n `}var Jx=class{constructor(t,e){this.variableNames=[\"x\"],this.uniforms=\"constantValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.map((o,n)=>o[0]+t[n]+o[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),e.map((o,n)=>{this.uniforms+=` pad${n} : vec2,`}),this.xShape=t,this.shaderKey=\"pad\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let paddedCoords = getCoordsFromIndex(index);\n ${l0(this.xShape)}\n }\n }\n `}};var Mpe=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{paddings:s,constantValue:a}=o;if(s.every(u=>y.arraysEqual(u,[0,0])))return At({inputs:{x:n},backend:e});if(y.sizeFromShape(n.shape)===0){let u=s.map((c,l)=>c[0]+n.shape[l]+c[1]);return vt({backend:e,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=[{type:\"float32\",data:[a]}];s.map(u=>i.push({type:\"int32\",data:[u[0],u[1]]}));let p=new Jx(n.shape,s);return e.runWebGPUProgram(p,[n],n.dtype,i)},XW={kernelName:es,backendName:\"webgpu\",kernelFunc:Mpe};var Lpe=et({opType:fe.POW}),YW={kernelName:ts,backendName:\"webgpu\",kernelFunc:Lpe};function Bpe(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t,s=new Si(fe.PRELU,o.shape,n.shape);return e.runWebGPUProgram(s,[o,n],\"float32\")}var QW={kernelName:rs,backendName:\"webgpu\",kernelFunc:Bpe};function zpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;return Jr(n,s,a,\"prod\",e)}var ZW={kernelName:os,backendName:\"webgpu\",kernelFunc:zpe};var Vpe=r=>{let{backend:t,attrs:e}=r,{start:o,stop:n,step:s,dtype:a}=e,i=$z(o,n,s,a);return t.makeTensorInfo([i.length],a,i)},JW={kernelName:ma,backendName:\"webgpu\",kernelFunc:Vpe};var Wpe=et({opType:fe.DIV}),eU={kernelName:fn,backendName:\"webgpu\",kernelFunc:Wpe};var Upe=ye({opType:Z.RECIPROCAL}),tU={kernelName:ns,backendName:\"webgpu\",kernelFunc:Upe};var Gpe=ye({opType:Z.RELU}),rU={kernelName:ss,backendName:\"webgpu\",kernelFunc:Gpe};var Hpe=ye({opType:Z.RELU6}),oU={kernelName:us,backendName:\"webgpu\",kernelFunc:Hpe};var ey=class{constructor(t,e,o){this.variableNames=[\"x\"],this.uniforms=\"adjustHeightWidth : vec2, halfPixelCenters : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t[0],e,o,t[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"resizeBilinear\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let d = coords[3];\n let rc = coords.yz;\n\n let effectiveInSize = vec2(\n f32(uniforms.xShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.xShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveOutSize = vec2(\n f32(uniforms.outShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.outShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveInputOverOutputRatioRC =\n effectiveInSize / effectiveOutSize;\n\n // Fractional source index\n let sourceFracIndexRC =\n (vec2(rc) + vec2(uniforms.halfPixelCenters)) *\n effectiveInputOverOutputRatioRC - vec2(uniforms.halfPixelCenters);\n\n // Compute the four integer indices.\n let sourceFloorRC = vec2(sourceFracIndexRC);\n let sourceCeilRC = vec2(\n min(vec2(uniforms.xShape.yz) - vec2(1.0), ceil(sourceFracIndexRC)));\n\n let topLeft = getX(b, sourceFloorRC.x, sourceFloorRC.y, d);\n let bottomLeft = getX(b, sourceCeilRC.x, sourceFloorRC.y, d);\n let topRight = getX(b, sourceFloorRC.x, sourceCeilRC.y, d);\n let bottomRight = getX(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n let fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n let top = topLeft + (topRight - topLeft) * fracRC.y;\n let bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n let newValue = top + (bottom - top) * fracRC.x;\n\n setOutputAtIndex(index, newValue);\n }\n }\n `}};function Kpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,size:a,halfPixelCenters:i}=o,[p,u]=a,c=s&&p>1?1:0,l=s&&u>1?1:0,d=[{type:\"float32\",data:[c,l]},{type:\"float32\",data:[i?.5:0]}],f=new ey(n.shape,p,u);return e.runWebGPUProgram(f,[n],\"float32\",d)}var nU={kernelName:is,backendName:\"webgpu\",kernelFunc:Kpe};var ty=class{constructor(t,e){this.variableNames=[\"dy\"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32,\n invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=e,this.shaderKey=`resizeBilinearBackprop_${e}`}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let d = coords[3];\n let r = coords[1];\n let c = coords[2];\n\n var accumulator = 0.0;\n\n // Compute bounds for where in dy we will look\n let startRLerp = floor(f32(r) * uniforms.invHeightScale);\n let startDyR = i32(startRLerp - f32(uniforms.winHeight / 2));\n\n let startCLerp = floor(f32(c) * uniforms.invWidthScale);\n let startDyC = i32(startCLerp - f32(uniforms.winWidth / 2));\n\n // Loop over dy\n for (var dyROffset = 0; dyROffset < uniforms.winHeight; dyROffset++) {\n let dyR = startDyR + dyROffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= uniforms.dyShape[1]) {\n continue;\n }\n\n for (var dyCOffset = 0; dyCOffset < uniforms.winWidth; dyCOffset++) {\n let dyC = startDyC + dyCOffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= uniforms.dyShape[2]) {\n continue;\n }\n\n let dxR = f32(dyR) * uniforms.heightScale;\n let topDxRIndex = i32(floor(dxR));\n let bottomDxRIndex = i32(min(ceil(dxR), f32(uniforms.outShape[1] - 1)));\n let dxRLerp = dxR - f32(topDxRIndex);\n let inverseDxRLerp = 1.0 - dxRLerp;\n\n let dxC = f32(dyC) * uniforms.widthScale;\n let leftDxCIndex = i32(floor(dxC));\n let rightDxCIndex = i32(min(ceil(dxC), f32(uniforms.outShape[2] - 1)));\n let dxCLerp = dxC - f32(leftDxCIndex);\n let inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutputAtIndex(index, accumulator);\n }\n }\n `}};function qpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,[,i,p]=n.shape,[,u,c]=s.shape,l=[a&&u>1?i-1:i,a&&c>1?p-1:p],m=[a&&u>1?u-1:u,a&&c>1?c-1:c],d=l[0]/m[0],f=l[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,C=new ty(n.shape,a),S=[{type:\"int32\",data:l},{type:\"int32\",data:m},{type:\"float32\",data:[d]},{type:\"float32\",data:[f]},{type:\"float32\",data:[h]},{type:\"float32\",data:[g]},{type:\"int32\",data:[x]},{type:\"int32\",data:[b]}];return e.runWebGPUProgram(C,[s],s.dtype,S)}var sU={kernelName:Ja,backendName:\"webgpu\",kernelFunc:qpe};var ry=class{constructor(t,e,o,n){this.variableNames=[\"x\"],this.uniforms=\"adjustHeightWidth : vec2, roundBase : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t[0],e,o,t[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.halfPixelCenters=n,this.shaderKey=`resizeNearest_${n}`}getUserCode(){let t;return this.halfPixelCenters?t=\"max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))\":t=\"vec2(rc) * effectiveInputOverOutputRatioRC\",`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let d = coords[3];\n let rc = coords.yz;\n\n let effectiveInSize = vec2(\n f32(uniforms.xShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.xShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveOutSize = vec2(\n f32(uniforms.outShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.outShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveInputOverOutputRatioRC =\n effectiveInSize / effectiveOutSize;\n\n // Fractional source index\n let sourceFracIndexRC = ${t};\n\n // Compute the coordinators of nearest neighbor point.\n let inputShapeRC = vec2(f32(uniforms.xShape.y), f32(uniforms.xShape.z));\n let sourceNearestRC = vec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + uniforms.roundBase)));\n let newValue = getX(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutputAtIndex(index, newValue);\n }\n }\n `}};function jpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,c=s&&p>1?1:0,l=s&&u>1?1:0,d=[{type:\"float32\",data:[c,l]},{type:\"float32\",data:[s?.5:0]}],f=new ry(n.shape,p,u,a);return e.runWebGPUProgram(f,[n],n.dtype,d)}var aU={kernelName:as,backendName:\"webgpu\",kernelFunc:jpe};var oy=class{constructor(t,e){this.variableNames=[\"dy\"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32,\n winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=e,this.shaderKey=`resizeNearestNeigborBackprop_${e}`}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let d = coords[3];\n let r = coords[1];\n let c = coords[2];\n\n var accumulator = 0.0;\n\n // Compute bounds for where in dy we will look\n let startRLerp = floor(f32(r) * uniforms.invHeightScale);\n let startDyR = i32(floor(startRLerp - f32(uniforms.winHeight / 2)));\n\n let startCLerp = floor(f32(c) * uniforms.invWidthScale);\n let startDyC = i32(floor(startCLerp - f32(uniforms.winWidth / 2)));\n\n // Loop over dy\n for (var dyROffset = 0; dyROffset < uniforms.winHeight; dyROffset++) {\n let dyR = startDyR + dyROffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= uniforms.dyShape[1]) {\n continue;\n }\n\n for (var dyCOffset = 0; dyCOffset < uniforms.winWidth; dyCOffset++) {\n let dyC = startDyC + dyCOffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= uniforms.dyShape[2]) {\n continue;\n }\n\n let sourceFracRow = f32(uniforms.effectiveXSize[0]) *\n (f32(dyR) / f32(uniforms.effectiveYSize[0]));\n\n let sourceFracCol = f32(uniforms.effectiveXSize[1]) *\n (f32(dyC) / f32(uniforms.effectiveYSize[1]));\n\n let sourceNearestRow =\n i32(min(f32(uniforms.outShape[1] - 1),\n ${this.alignCorners?\"floor(sourceFracRow + 0.5)\":\"floor(sourceFracRow)\"}));\n\n let sourceNearestCol =\n i32(min(f32(uniforms.outShape[2] - 1),\n ${this.alignCorners?\"floor(sourceFracCol + 0.5)\":\"floor(sourceFracCol)\"}));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutputAtIndex(index, accumulator);\n }\n }\n `}};function Xpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,[,i,p]=n.shape,[,u,c]=s.shape,l=[a&&u>1?i-1:i,a&&c>1?p-1:p],m=[a&&u>1?u-1:u,a&&c>1?c-1:c],d=l[0]/m[0],f=l[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,C=new oy(n.shape,a),S=[{type:\"int32\",data:l},{type:\"int32\",data:m},{type:\"float32\",data:[h]},{type:\"float32\",data:[g]},{type:\"int32\",data:[x]},{type:\"int32\",data:[b]}];return e.runWebGPUProgram(C,[s],s.dtype,S)}var iU={kernelName:Za,backendName:\"webgpu\",kernelFunc:Xpe};var ny=class{constructor(t){this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=\" axis : vec4,\",this.shaderKey=\"reverse\"}getUserCode(){return`\n \n // Using uniform variables as judging conditions, so the function has\n // coherent execution within all threads.\n fn getReverseCoords(coords : vec4) -> vec4 {\n var reverseCoords = coords;\n if (uniforms.axis[0] == 1) {\n reverseCoords[0] = uniforms.xShape[0] - coords[0] - 1;\n }\n if (uniforms.axis[1] == 1) {\n reverseCoords[1] = uniforms.xShape[1] - coords[1] - 1;\n }\n if (uniforms.axis[2] == 1) {\n reverseCoords[2] = uniforms.xShape[2] - coords[2] - 1;\n }\n if (uniforms.axis[3] == 1) {\n reverseCoords[3] = uniforms.xShape[3] - coords[3] - 1;\n }\n\n return reverseCoords;\n }\n \n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let reverseCoords = getReverseCoords(coords);\n setOutputAtIndex(index, getX(reverseCoords[0],\n reverseCoords[1], reverseCoords[2], reverseCoords[3]));\n }\n }\n `}};function Ype(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o,a=n.shape.length;if(a===0)return At({inputs:{x:n},backend:e});let i=n.shape,p=[1,1,1,1];i.forEach((g,x)=>{let b=x+4-a;p[b]=g});let u=y.parseAxisParam(s,n.shape),c=[0,0,0,0];u.forEach(g=>{let x=g+4-a;c[x]=1});let l=[{type:\"int32\",data:c}],m=pe({inputs:{x:n},backend:e,attrs:{shape:p}}),d=new ny(p),f=e.runWebGPUProgram(d,[m],m.dtype,l);e.disposeData(m.dataId);let h=pe({inputs:{x:f},backend:e,attrs:{shape:i}});return e.disposeData(f.dataId),h}var uU={kernelName:ps,backendName:\"webgpu\",kernelFunc:Ype};var sy=class{constructor(t,e){this.outputShape=[],this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`centerX : f32, centerY : f32, sinRadians : f32,\n cosRadians : f32,`,this.shaderKey=\"rotate\",this.outputShape=t,typeof e==\"number\"?(this.uniforms+=\" fillValue : f32,\",this.fillSnippet=\"var outputValue = uniforms.fillValue;\",this.shaderKey+=\"_float\"):(this.uniforms+=\" fillValue : vec3,\",this.fillSnippet=\"var outputValue = uniforms.fillValue[coords[3]];\",this.shaderKey+=\"_vec3\")}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let coordXFloat = (f32(coords[2]) - uniforms.centerX) *\n uniforms.cosRadians - (f32(coords[1]) - uniforms.centerY) *\n uniforms.sinRadians;\n let coordYFloat = (f32(coords[2]) - uniforms.centerX) *\n uniforms.sinRadians + (f32(coords[1]) - uniforms.centerY) *\n uniforms.cosRadians;\n let coordX = i32(round(coordXFloat + uniforms.centerX));\n let coordY = i32(round(coordYFloat + uniforms.centerY));\n ${this.fillSnippet}\n if(coordX >= 0 && coordX < uniforms.xShape[2] && coordY >= 0 &&\n coordY < uniforms.xShape[1]) {\n outputValue = getX(coords[0], coordY, coordX, coords[3]);\n }\n setOutputAtIndex(index, outputValue);\n }\n }\n `}};var pU={kernelName:Ds,backendName:\"webgpu\",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=t,i=e,p=new sy(o.shape,s),[u,c]=w.getImageCenter(a,o.shape[1],o.shape[2]),l=[{type:\"float32\",data:[u]},{type:\"float32\",data:[c]},{type:\"float32\",data:[Math.sin(n)]},{type:\"float32\",data:[Math.cos(n)]}];return typeof s==\"number\"?l.push({type:\"float32\",data:[Number.parseFloat(s.toFixed(2))]}):l.push({type:\"float32\",data:s}),i.runWebGPUProgram(p,[o],o.dtype,l)}};var Qpe=ye({opType:Z.ROUND}),cU={kernelName:cs,backendName:\"webgpu\",kernelFunc:Qpe};var Zpe=ye({opType:Z.RSQRT,cpuKernelImpl:Ez}),lU={kernelName:ls,backendName:\"webgpu\",kernelFunc:Zpe};var za=class{constructor(t,e,o,n,s,a,i,p=!0){this.variableNames=[\"updates\",\"indices\"],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=a,this.type=i,this.sumDupeIndices=p,this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),this.sliceDimGreaterThanOne=e>1,this.shaderKey=`scatter_${o}_${n}_${this.sliceDimGreaterThanOne}_${i}_${p}_${s.length}`;let u=ft(s.length);this.uniforms=`sliceDim : i32, strides: ${u}, updatesSize: i32,`,this.updatesRank=n,this.indicesRank=o}getUserCode(){let t=\"\";this.indicesRank===1?t=\"coords[0]\":this.indicesRank===2&&(t=\"coords[0], j\");let e=`getIndices(${t})`,o=this.sliceDimGreaterThanOne?\"uniforms.strides[j]\":\"uniforms.strides\",n=\"\",s=\"\";this.dispatchLayout.x.length===1?(n=\"flattenedIndex\",s=`\n fn getUpdatesCoordsFromFlatIndex(index : i32) -> i32 {\n return index;\n }\n `):this.dispatchLayout.x.length===2&&(n=\"vec2(flattenedIndex, coords[1])\",s=`\n fn getUpdatesCoordsFromFlatIndex(index : i32) -> vec2 {\n // N.B. |updates| could be a scalar tensor, conceptually representing a\n // 2D tensor with all values equal to that. By design, its size must be\n // the same as |outShape[1]| in one dimension, and |indicesShape[0]|\n // gives the other.\n let sliceSize = uniforms.outShape[1];\n let d0 = index / sliceSize;\n let d1 = index - d0 * sliceSize;\n return vec2(d0, d1);\n }\n `);let i=`getUpdates(${Array.from({length:this.updatesRank},(u,c)=>`coords[${c}]`).join(\", \")})`;return`\n ${s}\n ${G(\"index\")} {\n if (index < uniforms.updatesSize) {\n let coords = getUpdatesCoordsFromFlatIndex(index);\n var flattenedIndex = 0;\n for (var j = 0; j < uniforms.sliceDim; j = j + 1) {\n let indexInside = i32(round(${e}));\n flattenedIndex = flattenedIndex + indexInside * ${o};\n }\n let updateValue =\n ${Cu(this.type)}(${i});\n let flatIndex = getOutputIndexFromCoords(${n});\n\n ${this.sumDupeIndices?Yr(\"&result[flatIndex]\",\"updateValue\",this.type):\"atomicStore(&result[flatIndex], bitcast(updateValue));\"}\n }\n }`}};function Jpe(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(s,n,a),m=[l/u,u];if(l===0)return e.makeTensorInfo(a,n.dtype);let d=pe({inputs:{x:n},backend:e,attrs:{shape:[p,i]}}),f=pe({inputs:{x:s},backend:e,attrs:{shape:[p,u]}}),h=f.dtype,g=vt({backend:e,attrs:{shape:m,value:0,dtype:h}}),x=y.sizeFromShape(f.shape),b=[{type:\"int32\",data:[i]},{type:\"int32\",data:c},{type:\"int32\",data:[x]}],C=new za(f.shape,i,d.shape.length,f.shape.length,c,m,h),S=e.runWebGPUProgram(C,[f,d],h,b,g),k=pe({inputs:{x:S},backend:e,attrs:{shape:a}});return e.disposeData(d.dataId),e.disposeData(f.dataId),e.disposeData(S.dataId),k}var mU={kernelName:ms,backendName:\"webgpu\",kernelFunc:Jpe};var ay=class{constructor(t,e){this.outputShape=[],this.variableNames=[\"sortedSequence\",\"values\"],this.uniforms=\"numInputs : i32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.side=e,this.shaderKey=`search_sorted_${e}`}getUserCode(){return`\n fn findBound(batch: i32, value: f32) -> i32 {\n var left = i32(0);\n var right = uniforms.numInputs;\n while (left < right) {\n var mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${this.side===\"left\"?\"<\":\"<=\"} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let value = getValuesByOutputIndex(index);\n setOutputAtIndexI32(index, findBound(coords[0], value));\n }\n }\n `}};function ece(r){let{inputs:t,backend:e,attrs:o}=r,{sortedSequence:n,values:s}=t,{side:a}=o,i=new ay([s.shape[0],s.shape[1]],a),p=[{type:\"int32\",data:[n.shape[1]]}];return e.runWebGPUProgram(i,[n,s],\"int32\",p)}var dU={kernelName:fs,backendName:\"webgpu\",kernelFunc:ece};var iy=class{constructor(t,e,o){this.variableNames=[\"c\",\"a\",\"b\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.cRank=t,this.rank=o,this.shaderKey=\"select\"}getUserCode(){let t,e;if(this.rank>4)throw Error(`Where for rank ${this.rank} is not yet supported`);if(this.rank===1)e=\"resRC\",t=\"resRC\";else{let n=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],s=[],a=[];for(let i=0;i= 1.0) {\n setOutputAtIndex(index, getA(${e}));\n } else {\n setOutputAtIndex(index, getB(${e}));\n }\n }\n }\n `}};function tce(r){let{inputs:t,backend:e}=r,{condition:o,t:n,e:s}=t,a=new iy(o.shape.length,n.shape,n.shape.length);return e.runWebGPUProgram(a,[o,n,s],dt(n.dtype,s.dtype))}var fU={kernelName:fa,backendName:\"webgpu\",kernelFunc:tce};var rce=ye({opType:Z.SELU}),hU={kernelName:hs,backendName:\"webgpu\",kernelFunc:rce};var oce=ye({opType:Z.SIGMOID}),gU={kernelName:bs,backendName:\"webgpu\",kernelFunc:oce};var nce=ye({opType:Z.SIGN}),xU={kernelName:ys,backendName:\"webgpu\",kernelFunc:nce};var sce=ye({opType:Z.SIN}),yU={kernelName:gs,backendName:\"webgpu\",kernelFunc:sce};var ace=ye({opType:Z.SINH}),bU={kernelName:xs,backendName:\"webgpu\",kernelFunc:ace};var ice=ye({opType:Z.SOFTPLUS}),CU={kernelName:Cs,backendName:\"webgpu\",kernelFunc:ice};var uy=class{constructor(t,e,o,n,s,a){this.variableNames=[\"x\"],this.outputShape=[],this.uniforms=\"\",this.workgroupSize=[64,1,1],this.size=!0;let i=new Array(n.length);for(let p=0;p{this.uniforms+=` pad${u} : vec2,`}),this.shaderKey=`spaceToBatchND_${s}`}getUserCode(){let t=ft(this.outputShape.length),e=Jv(this.newDim);return`\n ${um(this.paddedXShape,\"PaddedX\")}\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${t}(${e}), uniforms.reshapedPaddedXShape);\n let paddedCoords = getPaddedXCoordsFromIndex(switchedIndex);\n ${l0(this.xShape,!0)}\n }\n }\n `}};var uce=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>\"spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet\");let i=s.reduce((b,C)=>b*C),p=[[0,0]];p.push(...a);for(let b=1+s.length;bb[0]+n.shape[C]+b[1]),c=w.getReshaped(u,s,i,!1),l=w.getPermuted(c.length,s.length,!1),m=w.getReshapedPermuted(u,s,i,!1),d=y.computeStrides(u),f=new uy(n.shape,u,p,c,l,d.length),h=[{type:\"int32\",data:c},{type:\"int32\",data:d}];p.map(b=>h.push({type:\"int32\",data:[b[0],b[1]]}));let g=e.runWebGPUProgram(f,[n],n.dtype,h),x=pe({inputs:{x:g},backend:e,attrs:{shape:m}});return e.disposeData(g.dataId),x},wU={kernelName:ga,backendName:\"webgpu\",kernelFunc:uce};var py=class{constructor(t,e,o){this.variableNames=[\"input\",\"indices\",\"segmentIds\"],this.outputShape=[],this.uniforms=\"segmentSize : i32, sparseSize : i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t,this.type=o,this.dispatchLayout=X([e]),this.dispatch=H(this.dispatchLayout,[e],this.workgroupSize),this.shaderKey=\"sparseSegmentSum\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.sparseSize) {\n let indexInSegmentIds = index / uniforms.segmentSize;\n let indexInSegment = index % uniforms.segmentSize;\n let indexInInput = indices[indexInSegmentIds];\n let segmentId = segmentIds[indexInSegmentIds];\n\n let value = input[indexInInput * uniforms.segmentSize + indexInSegment];\n let outIndex = segmentId * uniforms.segmentSize + indexInSegment;\n ${Yr(\"&result[outIndex]\",\"value\",this.type)}\n }\n }\n `}},cy=class{constructor(t,e){this.variableNames=[\"segmentIds\"],this.outputShape=[],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=[t],this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),this.shaderKey=\"sparseSegmentIdCountProgram\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.segmentIdsShape) {\n let segmentId = segmentIds[index];\n ${Yr(\"&result[segmentId]\",\"1\",\"int32\")}\n }\n }\n `}},ly=class{constructor(t,e){this.variableNames=[\"segmentSum\",\"sameSegmentIdCount\"],this.outputShape=[],this.uniforms=\"segmentSize : i32\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.type=e,this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),this.shaderKey=\"sparseSegmentMean\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let segmentId = index / uniforms.segmentSize;\n let count = sameSegmentIdCount[segmentId];\n if (count != 0) {\n ${this.type===\"float32\"?\"setOutputAtIndex(index, segmentSum[index] / f32(count));\":\"setOutputAtIndexI32(index, segmentSum[index] / count);\"}\n }\n }\n }\n `}};function my(r,t,e,o=!1,n){let a=y.sizeFromShape(r.shape)/r.shape[0],i=r.dtype,p=y.sizeFromShape(t.shape),u=n.readSync(e.dataId),l=p>0?u[p-1]+1:0,m,d=r.shape.slice();d[0]=l;let f=p*a,h=vt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new py(d,f,i);let g=[{type:\"int32\",data:[a]},{type:\"int32\",data:[f]}],x=n.runWebGPUProgram(m,[r,t,e],i,g,h);if(o)return x;let b=vt({backend:n,attrs:{shape:[l],value:0,dtype:\"int32\"}});m=new cy(l,e.shape);let C=n.runWebGPUProgram(m,[e],\"int32\",null,b),S=vt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new ly(d,i),g=[{type:\"int32\",data:[a]}];let k=n.runWebGPUProgram(m,[x,C],i,g,S);return n.disposeData(x.dataId),n.disposeData(C.dataId),k}function pce(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;return my(o,n,s,!1,e)}var SU={kernelName:ya,backendName:\"webgpu\",kernelFunc:pce};function cce(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;return my(o,n,s,!0,e)}var IU={kernelName:ba,backendName:\"webgpu\",kernelFunc:cce};var dy=class{constructor(t,e){this.variableNames=[\"A\"],this.workgroupSize=[64,1,1],this.size=!0;let o=new Array(t.length);for(let n=0;n=5)throw Error(`Tile for rank ${r} is not yet supported`);if(r===1)return`(resRC % ${t}aShape)`;let e=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],o=[];for(let n=0;n=5){let p=e.readSync(n.dataId),u=n.dtype===\"string\"?p.map(m=>y.decodeString(m)):p,c=me(n.shape,n.dtype,u),l=Mz(c,s);return e.makeTensorInfo(l.shape,l.dtype,l.values)}let a=new dy(n.shape,s);return e.runWebGPUProgram(a,[n],n.dtype)}var vU={kernelName:uo,backendName:\"webgpu\",kernelFunc:ym};function mce(r){let{inputs:t,backend:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=w.calculateShapes(s,n,i),d=!1;if(s.dtype===\"string\"){let R=e.bufferSync(n),D=e.bufferSync(s),P=y.decodeString(e.readSync(a.dataId)[0]),O=Rz(R,D,i,m,c,u,p,l,P,d);return e.makeTensorInfo(i,O.dtype,O.values)}let f=[m/c,c],h=pe({inputs:{x:n},backend:e,attrs:{shape:[u,p]}}),g=s.shape.length?pe({inputs:{x:s},backend:e,attrs:{shape:[u,c]}}):At({inputs:{x:s},backend:e}),x=g.dtype,b=e.makeTensorInfo([],x,y.makeZerosTypedArray(1,x)),C=pe({inputs:{x:a},backend:e,attrs:{shape:Array(f.length).fill(1)}}),S=ym({inputs:{x:C},backend:e,attrs:{reps:f}}),k=y.sizeFromShape([u,c]),_=[{type:\"int32\",data:[p]},{type:\"int32\",data:l},{type:\"int32\",data:[k]}];switch(u){case 0:break;case 1:{let R=new za([u,c],p,h.shape.length,g.shape.length,l,f,x,d);e.runWebGPUProgram(R,[g,h],x,_,S)}break;default:{let R=new za([u,c],p,h.shape.length,b.shape.length,l,f,x,d);e.runWebGPUProgram(R,[b,h],x,_,S)}{let R=new za([u,c],p,h.shape.length,g.shape.length,l,f,x);e.runWebGPUProgram(R,[g,h],x,_,S)}}let E=pe({inputs:{x:S},backend:e,attrs:{shape:i}});return e.disposeData(h.dataId),e.disposeData(g.dataId),e.disposeData(C.dataId),e.disposeData(b.dataId),e.disposeData(S.dataId),E}var kU={kernelName:vs,backendName:\"webgpu\",kernelFunc:mce};function dce(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=n.shape.length,c=new Array(u).fill(0),l=n.shape.slice();return p.map(m=>{let d=[...l];d[i]=m;let f=Hs({inputs:{x:n},backend:e,attrs:{begin:c,size:d}});return c[i]+=m,f})}var NU={kernelName:xa,backendName:\"webgpu\",kernelFunc:dce};var fce=ye({opType:Z.SQRT}),TU={kernelName:ws,backendName:\"webgpu\",kernelFunc:fce};var _U={kernelName:Ki,backendName:\"webgpu\",kernelFunc:({inputs:r,backend:t})=>{let{x:e}=r,o=t,n=new Zr(e.shape,Z.SQUARE);return o.runWebGPUProgram(n,[e],e.dtype)}};var hce=et({opType:fe.SQUARED_DIFFERENCE}),$U={kernelName:ks,backendName:\"webgpu\",kernelFunc:hce};function gce({inputs:r,attrs:t,backend:e}){let{x:o}=r,n=new Zr(o.shape,Z.STEP,\"stepAlpha : f32,\"),s=[{type:\"float32\",data:[t.alpha]}];return e.runWebGPUProgram(n,[o],o.dtype,s)}var EU={kernelName:wo,backendName:\"webgpu\",kernelFunc:gce};var fy=class{constructor(t){this.variableNames=[\"x\"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]);let e=ft(this.outputShape.length);this.uniforms=`begin : ${e}, strides : ${e}, `,this.shaderKey=\"stridedSlice\"}getUserCode(){let t=this.outputShape.length,e=\"\";if(t===1)e=\"coords * uniforms.strides + uniforms.begin\";else{let n=0;e=this.outputShape.map((s,a)=>(n++,this.outputShape.length===1?`coords * uniforms.strides[${a}] + uniforms.begin[${a}]`:`coords[${n-1}] * uniforms.strides[${a}] + uniforms.begin[${a}]`)).join(\",\")}return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n setOutputAtIndex(index, getX(${e}));\n }\n }\n `}};function xce(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=pe({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let _=pt.computeOutShape(b,C,S),E=Hs({inputs:{x:n},backend:e,attrs:{begin:b,size:_}});k=pe({inputs:{x:E},backend:e,attrs:{shape:f}}),e.disposeData(E.dataId)}else if(e.shouldExecuteOnCPU([n])){let E=e.readSync(n.dataId),R=me(n.shape,n.dtype,E),D=Fz(d,R,S,b);k=e.makeTensorInfo(f,n.dtype,D.values)}else{let E=new fy(d),R=[{type:\"int32\",data:b},{type:\"int32\",data:S}],D=e.runWebGPUProgram(E,[n],n.dtype,R);k=pe({inputs:{x:D},backend:e,attrs:{shape:f}}),e.disposeData(D.dataId)}return k}var RU={kernelName:Ns,backendName:\"webgpu\",kernelFunc:xce};function yce(r){let{inputs:t,backend:e,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:c,dataSplits:l}=t,m=e.readSync(c.dataId),d=e.readSync(l.dataId),[f,h]=Pz(m,d,n,s,a,i,p,u);return[e.makeTensorInfo([f.length],\"string\",f),e.makeTensorInfo(l.shape,\"int32\",h)]}var DU={kernelName:Ca,backendName:\"webgpu\",kernelFunc:yce};var bce=et({opType:fe.SUB,cpuKernelImpl:Oz,supportsComplex:!0}),AU={kernelName:Ts,backendName:\"webgpu\",kernelFunc:bce};var Cce=ye({opType:Z.TAN}),FU={kernelName:_s,backendName:\"webgpu\",kernelFunc:Cce};var wce=ye({opType:Z.TANH}),PU={kernelName:$s,backendName:\"webgpu\",kernelFunc:wce};function Sce(r){let{inputs:t,backend:e,attrs:o}=r,{tensor:n,indices:s,updates:a}=t,{}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(a,s,n.shape),m=[l/u,u];if(l===0)return e.makeTensorInfo(n.shape,s.dtype);let d=[],f=pe({inputs:{x:s},backend:e,attrs:{shape:[p,i]}});d.push(f);let h=pe({inputs:{x:a},backend:e,attrs:{shape:[p,u]}});d.push(h);let g=pe({inputs:{x:n},backend:e,attrs:{shape:m}});d.push(g);let x=ym({inputs:{x:g},backend:e,attrs:{reps:Array(m.length).fill(1)}}),b=new za([p,u],i,f.shape.length,h.shape.length,c,m,n.dtype,!1),C=y.sizeFromShape([p,u]),S=[{type:\"int32\",data:[i]},{type:\"int32\",data:c},{type:\"int32\",data:[C]}],k=e.runWebGPUProgram(b,[h,f],g.dtype,S,x);d.push(k);let _=pe({inputs:{x:k},backend:e,attrs:{shape:n.shape}});return d.forEach(E=>e.disposeData(E.dataId)),_}var OU={kernelName:ds,backendName:\"webgpu\",kernelFunc:Sce};var hy=class{constructor(t){this.variableNames=[\"x\",\"indices\"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`inputSize : i32, firstPass : i32, negativeInf : f32,\n dir : i32, inc : i32,`,this.shaderKey=\"swap\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let outC = getCoordsFromIndex(index);\n let batch = outC[0];\n let elemIdx = outC[1];\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced\n // above, Figure5(a) shows that element[1] is in the second half of\n // the group when group size is 2, but it is in the first half of\n // the group when group size is 4.\n let isFirstInPair = elemIdx % (2 * uniforms.inc) < uniforms.inc;\n var i = 0;\n if (isFirstInPair) {\n i = elemIdx;\n } else {\n i = elemIdx - uniforms.inc;\n }\n\n var i0 = 0;\n if (uniforms.firstPass == 1) {\n i0 = i;\n } else {\n i0 = i32(getIndices(batch, i));\n }\n\n var i1 = 0;\n if (uniforms.firstPass == 1) {\n i1 = i + uniforms.inc;\n } else {\n i1 = i32(getIndices(batch, i + uniforms.inc));\n }\n\n var x0 = f32(0.0);\n var x1 = f32(0.0);\n if (i0 < uniforms.inputSize) {\n x0 = getX(batch, i0);\n } else {\n x0 = uniforms.negativeInf;\n }\n if (i1 < uniforms.inputSize) {\n x1 = getX(batch, i1);\n } else {\n x1 = uniforms.negativeInf;\n }\n\n let reverse = elemIdx % (2 * uniforms.dir) >= uniforms.dir;\n let isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) {\n // Elements in opposite order of direction\n let iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutputAtIndex(index, f32(i0));\n } else {\n setOutputAtIndex(index, f32(i1));\n }\n }\n }\n `}},gy=class{constructor(t){this.variableNames=[\"x\",\"indices\"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=\"inputSize : i32, firstPass : i32, k : i32,\",this.shaderKey=\"merge\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let outC = getCoordsFromIndex(index);\n let batch = outC[0];\n let elemIdx = outC[1];\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _\n // (k=4), we only need to output the indices at positions |, the\n // indices at positions _ can be thrown away, see Figure5(b) After\n // Phase 2 (Merge phase) in the Bitonic Top K paper referenced\n // above.\n // For example, the paper shows we only need to output the orange\n // bars. The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back to\n // the previous sequence to find the corresponding value, we need\n // to double the index. When we double the index, we basically\n // interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k\n // position of each 2k positions by - elemIdx % k. E.g. for output\n // at index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n var i = 0;\n if (elemIdx < uniforms.k) {\n i = elemIdx;\n } else {\n i = elemIdx * 2 - elemIdx % uniforms.k;\n }\n var i0 = 0;\n if (uniforms.firstPass == 1) {\n i0 = i;\n } else {\n i0 = i32(getIndices(batch, i));\n }\n var i1 = 0;\n if (uniforms.firstPass == 1) {\n i1 = i + uniforms.k;\n } else {\n i1 = i32(getIndices(batch, i + uniforms.k));\n }\n\n let x0 = getX(batch, i0);\n var x1 = f32(0.0);\n if (i1 < uniforms.inputSize) {\n x1 = getX(batch, i1);\n } else {\n x1 = x0;\n }\n\n if (x0 >= x1) {\n setOutputAtIndex(index, f32(i0));\n } else {\n setOutputAtIndex(index, f32(i1));\n }\n }\n }\n `}};function el(r,t){t!==null&&r.disposeData(t.dataId)}function MU(r){let t=1;for(;tf===null?[l,l]:[l,f],g=(k,_,E)=>{let R=h(),D=new hy(E),O=[{type:\"int32\",data:[p]},{type:\"int32\",data:[f===null?1:0]},{type:\"float32\",data:[Number.NEGATIVE_INFINITY]},{type:\"int32\",data:[k]},{type:\"int32\",data:[_]}],M=f;f=e.runWebGPUProgram(D,R,\"int32\",O),el(e,M)};for(let k=1;k=1;E/=2)g(_,E,[c,d])}for(let k=d;k>m;k/=2){let _=h(),E=new gy([c,k/2]),D=[{type:\"int32\",data:[p]},{type:\"int32\",data:[f===null?1:0]},{type:\"int32\",data:[m]}],P=f;f=e.runWebGPUProgram(E,_,\"int32\",D),el(e,P);let O=m/2,M=O*2;for(let L=O;L>=1;L/=2)g(M,L,f.shape)}let x=f;f=Hs({inputs:{x:f},backend:e,attrs:{begin:0,size:[c,s]}}),el(e,x);let b=p0({inputs:{x:l,indices:f},backend:e,attrs:{axis:1,batchDims:1}});el(e,l);let C=i.slice(0,-1);C.push(s),x=f,f=pe({inputs:{x:f},attrs:{shape:C},backend:e}),el(e,x);let S=b;return b=pe({inputs:{x:b},attrs:{shape:C},backend:e}),el(e,S),[b,f]}var LU={kernelName:Es,backendName:\"webgpu\",kernelFunc:Ice};var xy=class{constructor(t){this.variableNames=[\"Image\",\"Transforms\"],this.uniforms=\"interpolationModeId : i32, fillModeId : i32, fillValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"transform\"}getUserCode(){return`\n fn mapCoord(outCoord : f32, len : f32) -> f32{\n var inCoord = outCoord;\n if(uniforms.fillModeId == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * f32(i32(f32(-inCoord / sz2))) +\n inCoord;\n }\n if (inCoord < -len) {\n inCoord = inCoord + sz2;\n } else {\n inCoord = -inCoord - 1.0;\n }\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz2 = 2.0 * len;\n inCoord = inCoord - sz2 * f32(i32(f32(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (uniforms.fillModeId == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz = len - 1.0;\n inCoord = inCoord + len * (f32(i32(f32(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz = len - 1.0;\n inCoord = inCoord - len * f32(i32(f32(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (uniforms.fillModeId == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n }\n return outCoord;\n }\n fn readWithFillValue(batch : i32, coordY : i32, coordX : i32,\n channel : i32) -> f32 {\n var outputValue : f32;\n if (0 <= coordY && coordY < uniforms.imageShape[1] && 0 <= coordX && coordX < uniforms.imageShape[2]) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = uniforms.fillValue;\n }\n return outputValue;\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var outputValue : f32;\n let batch = coords[0];\n let x = coords[2];\n let y = coords[1];\n let channel = coords[3];\n let xf = f32(x);\n let yf = f32(y);\n let a1 = getTransforms(batch, 0);\n let a2 = getTransforms(batch, 1);\n let a3 = getTransforms(batch, 2);\n let b1 = getTransforms(batch, 3);\n let b2 = getTransforms(batch, 4);\n let b3 = getTransforms(batch, 5);\n let c1 = getTransforms(batch, 6);\n let c2 = getTransforms(batch, 7);\n let projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = uniforms.fillValue;\n } else {\n let inX = (a1 * xf + a2 * yf + a3) / projection;\n let inY = (b1 * xf + b2 * yf + b3) / projection;\n let mapX = mapCoord(inX, f32(uniforms.imageShape[2]));\n let mapY = mapCoord(inY, f32(uniforms.imageShape[1]));\n\n if (uniforms.interpolationModeId == 1) {\n let coordY = i32(round(mapY));\n let coordX = i32(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n let yFloor = floor(mapY);\n let xFloor = floor(mapX);\n let yCeil = yFloor + 1.0;\n let xCeil = xFloor + 1.0;\n let valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, i32(yFloor), i32(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, i32(yFloor), i32(xCeil), channel);\n let valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, i32(yCeil), i32(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, i32(yCeil), i32(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutputAtIndex(index, outputValue);\n }\n }\n `}};function vce(r){let{inputs:t,backend:e,attrs:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=new xy(g),b=a===\"nearest\"?1:2,C;switch(i){case\"constant\":C=1;break;case\"reflect\":C=2;break;case\"wrap\":C=3;break;case\"nearest\":C=4;break;default:C=1;break}let S=[{type:\"int32\",data:[b]},{type:\"int32\",data:[C]},{type:\"float32\",data:[p]}];return e.runWebGPUProgram(x,[n,s],\"float32\",S)}var BU={kernelName:Rs,backendName:\"webgpu\",kernelFunc:vce};function kce(r){let{inputs:t,backend:e,attrs:o}=r,{value:n}=t,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),c=0;for(let h=0;he.disposeData(h.dataId)),f}var zU={kernelName:wa,backendName:\"webgpu\",kernelFunc:kce};var yy=class{constructor(t,e,o){if(this.outputShape=[],this.variableNames=[\"x\",\"segmentIds\"],this.uniforms=\"numSegments : i32, xSize: i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e,this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),o!==\"float32\"&&o!==\"int32\")throw new Error(`UnsortedSegmentSum only supports float32 and int32\n types, does not support ${o} type.`);this.type=o,this.shaderKey=\"unsortedSegmentSum\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.xSize) {\n let coords = getXCoordsFromIndex(index);\n let b = coords[0];\n let inCol = coords[1];\n\n let segmentId = i32(getSegmentIds(inCol));\n if (segmentId >= 0) {\n let flatIndex = b * uniforms.numSegments + segmentId % uniforms.numSegments;\n let value = getX(b, inCol);\n\n ${Yr(\"&result[flatIndex]\",\"value\",this.type)}\n }\n }\n }\n `}};function Nce(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,segmentIds:s}=t,{numSegments:a}=o,i=n.shape.length,p=[],u=0,c=w.getAxesPermutation([u],i),l=n;c!=null&&(l=xr({inputs:{x:n},backend:e,attrs:{perm:c}}),p.push(l),u=w.getInnerMostAxes(1,i)[0]);let m=w.segment_util.computeOutShape(l.shape,u,a),d=y.sizeFromShape([l.shape[u]]),f=pe({inputs:{x:l},backend:e,attrs:{shape:[-1,d]}});p.push(f);let h=n.dtype,g=[f.shape[0],a],x=vt({backend:e,attrs:{shape:g,value:0,dtype:h}}),b=new yy(f.shape,g,h),C=[{type:\"int32\",data:[a]},{type:\"int32\",data:[y.sizeFromShape(f.shape)]}],S=e.runWebGPUProgram(b,[f,s],h,C,x),k=pe({inputs:{x:S},backend:e,attrs:{shape:m}});p.push(S);let _=k;if(c!=null){p.push(k);let E=w.getUndoAxesPermutation(c);_=xr({inputs:{x:_},backend:e,attrs:{perm:E}})}return p.forEach(E=>e.disposeData(E.dataId)),_}var VU={kernelName:Yi,backendName:\"webgpu\",kernelFunc:Nce};var Tce=[oz,zz,Vz,Wz,Uz,Gz,Kz,qz,jz,Xz,Yz,Qz,Zz,Jz,eV,oV,nV,sV,aV,iV,pV,cV,lV,hV,gV,xV,sz,bV,wV,SV,IV,vV,kV,NV,TV,_V,$V,EV,AV,FV,PV,OV,LV,BV,MV,zV,VV,WV,UV,GV,qV,jV,XV,YV,QV,ZV,JV,eW,tW,tz,rW,sW,oW,nW,aW,iW,uW,pW,cW,lW,mW,nz,dW,CV,fW,hW,gW,xW,yW,bW,CW,SW,wW,IW,vW,kW,TW,_W,tV,$W,EW,AW,RW,DW,FW,rV,PW,OW,MW,LW,zW,HV,VW,WW,UW,mV,GW,qW,jW,XW,YW,QW,ZW,JW,dV,eU,tU,rU,oU,rz,nU,sU,aU,iU,uU,pU,cU,lU,mU,dU,fU,hU,gU,xU,yU,bU,uV,EU,RU,DU,BW,CU,wU,SU,IU,kU,NU,TU,_U,$U,AU,KV,FU,PU,OU,vU,LU,BU,Hz,zU,VU,HW];for(let r of Tce)ti(r);var WU=\"4.14.0\",_ce=\"4.14.0\",$ce=\"4.14.0\",Ece=\"4.14.0\",Rce=\"4.14.0\",Dce=\"4.14.0\",Ace={tfjs:WU,\"tfjs-core\":WU,\"tfjs-converter\":_ce,\"tfjs-backend-cpu\":$ce,\"tfjs-backend-webgl\":Ece,\"tfjs-backend-wasm\":Rce,\"tfjs-backend-webgpu\":Dce};var bQt=void 0;export{Xs as Abs,Vo as Acos,Wo as Acosh,Qu as AdadeltaOptimizer,Zu as AdagradOptimizer,Ju as AdamOptimizer,ep as AdamaxOptimizer,io as Add,Uo as AddN,Go as All,Ho as Any,Ys as ArgMax,Qs as ArgMin,Ko as Asin,qo as Asinh,jo as Atan,Yo as Atan2,Xo as Atanh,Qo as AvgPool,Zs as AvgPool3D,Ei as AvgPool3DGrad,$i as AvgPoolGrad,im as BackendWasm,Zo as BatchMatMul,Js as BatchToSpaceND,Jo as Bincount,qa as BitwiseAnd,ea as BroadcastArgs,Bce as BroadcastTo,yo as Cast,en as Ceil,bo as ClipByValue,Ri as Complex,Di as ComplexAbs,ta as Concat,tn as Conv2D,Ai as Conv2DBackpropFilter,rn as Conv2DBackpropInput,on as Conv3D,ja as Conv3DBackpropFilterV2,nn as Conv3DBackpropInputV2,sn as Cos,an as Cosh,cn as CropAndResize,un as Cumprod,pn as Cumsum,Bo as DataStorage,ra as DenseBincount,ln as DepthToSpace,mn as DepthwiseConv2dNative,Fi as DepthwiseConv2dNativeBackpropFilter,Pi as DepthwiseConv2dNativeBackpropInput,oa as Diag,dn as Dilation2D,Mi as Dilation2DBackpropFilter,Oi as Dilation2DBackpropInput,_u as Draw,ow as ENV,Li as Einsum,hn as Elu,Xa as EluGrad,ll as Environment,xn as Equal,gn as Erf,yn as Exp,na as ExpandDims,bn as Expm1,Bi as FFT,sa as Fill,Cn as FlipLeftRight,wn as Floor,Sn as FloorDiv,Eu as FromPixels,In as FusedBatchNorm,Io as FusedConv2D,vo as FusedDepthwiseConv2D,xp as GPGPUContext,vn as GatherNd,aa as GatherV2,Ml as GraphModel,kn as Greater,Nn as GreaterEqual,zi as IFFT,Co as Identity,Vi as Imag,Tn as IsFinite,_n as IsInf,$n as IsNan,so as KernelBackend,Bn as LRN,Ya as LRNGrad,En as LeakyRelu,Rn as Less,Dn as LessEqual,An as LinSpace,Fn as Log,Pn as Log1p,zce as LogSoftmax,On as LogicalAnd,Mn as LogicalNot,Ln as LogicalOr,E0 as LogicalXor,Vce as LowerBound,hc as MathBackendCPU,Oc as MathBackendWebGL,Wce as MatrixBandPart,zn as Max,Wn as MaxPool,ia as MaxPool3D,Ui as MaxPool3DGrad,Wi as MaxPoolGrad,ua as MaxPoolWithArgmax,Vn as Maximum,Un as Mean,Gn as Min,Hn as Minimum,Kn as MirrorPad,qn as Mod,tp as MomentumOptimizer,jn as Multinomial,Xn as Multiply,pa as Neg,Qn as NonMaxSuppressionV3,Qa as NonMaxSuppressionV4,Zn as NonMaxSuppressionV5,Yn as NotEqual,kw as OP_SCOPE_SUFFIX,Jn as OneHot,ca as OnesLike,kr as Optimizer,Dl as OptimizerConstructors,la as Pack,es as PadV2,Uce as Pool,ts as Pow,rs as Prelu,os as Prod,rp as RMSPropOptimizer,Up as RaggedGather,Gp as RaggedRange,Hp as RaggedTensorToTensor,ma as Range,hw as Rank,Gi as Real,fn as RealDiv,ns as Reciprocal,Et as Reduction,ss as Relu,us as Relu6,da as Reshape,is as ResizeBilinear,Ja as ResizeBilinearGrad,as as ResizeNearestNeighbor,Za as ResizeNearestNeighborGrad,ps as Reverse,Ds as RotateWithOffset,cs as Round,ls as Rsqrt,li as SGDOptimizer,ms as ScatterNd,fs as SearchSorted,fa as Select,hs as Selu,bs as Sigmoid,ys as Sign,gs as Sin,xs as Sinh,ha as Slice,Is as Softmax,Cs as Softplus,ga as SpaceToBatchND,Hi as SparseFillEmptyRows,ei as SparseReshape,ya as SparseSegmentMean,ba as SparseSegmentSum,vs as SparseToDense,xa as SplitV,ws as Sqrt,Ki as Square,ks as SquaredDifference,$u as StaticRegexReplace,wo as Step,Ns as StridedSlice,Ca as StringNGrams,qi as StringSplit,ji as StringToHashBucketFast,Ts as Sub,Ss as Sum,_s as Tan,$s as Tanh,mt as Tensor,tt as TensorBuffer,ds as TensorScatterUpdate,uo as Tile,Es as TopK,Rs as Transform,po as Transpose,Xi as Unique,wa as Unpack,Yi as UnsortedSegmentSum,Gce as UpperBound,ri as Variable,Kc as WebGPUBackend,Sa as ZerosLike,So as _FusedMatMul,Qt as abs,Nk as acos,Tk as acosh,Ce as add,_k as addN,$k as all,Ek as any,Rk as argMax,Dk as argMin,Ak as asin,Fk as asinh,Pk as atan,Ok as atan2,Mk as atanh,md as avgPool,zk as avgPool3d,vde as backend,w as backend_util,Vk as basicLSTMCell,ru as batchNorm,Uk as batchNorm2d,Gk as batchNorm3d,Hk as batchNorm4d,dd as batchToSpaceND,fd as bincount,Kk as bitwiseAnd,E6 as booleanMaskAsync,qk as broadcastArgs,ou as broadcastTo,Sr as broadcast_util,nT as browser,me as buffer,We as cast,jk as ceil,Xk as clipByValue,Wr as clone,$r as complex,yt as concat,Yk as concat1d,Qk as concat2d,Zk as concat3d,Jk as concat4d,e2 as conv1d,nu as conv2d,t2 as conv2dTranspose,r2 as conv3d,n2 as conv3dTranspose,Zce as copyRegisteredKernels,s2 as cos,a2 as cosh,_l as cosineWindow,i2 as cumprod,u2 as cumsum,Ir as customGrad,p2 as denseBincount,Pw as deprecationWarn,c2 as depthToSpace,oc as depthwiseConv2d,A5 as deregisterOp,Ji as device_util,l2 as diag,m2 as dilation2d,dde as disableDeprecationWarnings,Ot as dispose,fde as disposeVariables,je as div,f2 as divNoNan,h2 as dot,W6 as dropout,su as einsum,yd as elu,mde as enableDebugMode,lde as enableProdMode,Qw as enclosingPowerOfTwo,ur as engine,g2 as ensureShape,A as env,xd as equal,x2 as erf,C2 as euclideanNorm,_o as exp,Ms as expandDims,w2 as expm1,bd as eye,ac as fft,Ea as fill,Sde as findBackend,Ide as findBackendFactory,Cd as floor,ld as floorDiv,LD as forceHalfFloat,Zw as fused,wd as gather,z6 as gatherND,sf as gather_util,Cde as getBackend,aw as getGradient,qp as getKernel,jm as getKernelsForBackend,Zse as getThreadsCount,lv as gpgpu_util,AK as grad,FK as grads,zu as greater,Sd as greaterEqual,Ku as ifft,iu as imag,Kj as image,G6 as inTopKAsync,mi as io,Gd as irfft,S2 as isFinite,I2 as isInf,v2 as isNaN,Er as keep,Vt as kernel_impls,Id as leakyRelu,kl as less,nc as lessEqual,qj as linalg,k2 as linspace,$8 as loadGraphModel,E8 as loadGraphModelSync,N2 as localResponseNormalization,ui as log,vd as log1p,T2 as logSigmoid,_2 as logSoftmax,Td as logSumExp,Vu as logicalAnd,_d as logicalNot,$d as logicalOr,$2 as logicalXor,jj as losses,E2 as lowerBound,Ze as matMul,eT as math,Ra as max,Rd as maxPool,R2 as maxPool3d,D2 as maxPoolWithArgmax,Dd as maximum,Wu as mean,hde as memory,A2 as meshgrid,vl as min,Uu as minimum,F2 as mirrorPad,P2 as mod,O2 as moments,A6 as movingAverage,se as mul,M2 as multiRNNCell,L2 as multinomial,pr as neg,pS as nextFrame,bQt as node,Bu as norm,Ad as notEqual,Tl as oneHot,Da as ones,B2 as onesLike,N as op,z2 as outerProduct,Aa as pad,V2 as pad1d,W2 as pad2d,U2 as pad3d,G2 as pad4d,H2 as pool,ii as pow,Pd as prelu,cd as print,K2 as prod,gde as profile,q2 as raggedGather,j2 as raggedRange,X2 as raggedTensorToTensor,Y2 as rand,x1 as randomGamma,Vd as randomNormal,y1 as randomStandardNormal,sc as randomUniform,b1 as randomUniformInt,uu as range,bde as ready,pi as real,C1 as reciprocal,tu as registerBackend,Xce as registerGradient,ti as registerKernel,D5 as registerOp,pu as relu,Wd as relu6,wde as removeBackend,W as reshape,lo as reverse,w1 as reverse1d,S1 as reverse2d,I1 as reverse3d,v1 as reverse4d,ic as rfft,Ud as round,k1 as rsqrt,ke as scalar,P6 as scatterND,lu as scatter_util,Nl as searchSorted,N1 as selu,T1 as separableConv2d,UN as serialization,yde as setBackend,kde as setPlatform,Qse as setThreadsCount,Xse as setWasmPath,Yse as setWasmPaths,kI as setWebGLContext,_1 as setdiff1dAsync,wc as shared,$a as sigmoid,$1 as sign,Hj as signal,E1 as sin,R1 as sinh,Xe as slice,D1 as slice1d,A1 as slice2d,F1 as slice3d,P1 as slice4d,pt as slice_util,O1 as softmax,Nd as softplus,Fd as spaceToBatchND,Xj as sparse,L6 as sparseToDense,Gj as spectral,ci as split,Rr as sqrt,Zt as square,Hd as squaredDifference,uc as squeeze,vr as stack,Kd as step,M1 as stridedSlice,Yj as string,Te as sub,ot as sum,oi as sumOutType,L1 as tan,Il as tanh,ar as tensor,Jt as tensor1d,cu as tensor2d,qd as tensor3d,B1 as tensor4d,z1 as tensor5d,V1 as tensor6d,U1 as tensorScatterUpdate,tk as tensor_util,g1 as test_util,De as tidy,au as tile,xde as time,G1 as topk,TGe as train,cc as transpose,H1 as truncatedNormal,K1 as unique,Qce as unregisterGradient,Yce as unregisterKernel,q1 as unsortedSegmentSum,mo as unstack,dt as upcastType,j1 as upperBound,y as util,PK as valueAndGrad,OK as valueAndGrads,X1 as variable,zw as variableGrads,Ace as version,D8 as version_converter,_X as version_core,cY as version_cpu,Jse as version_wasm,s9 as version_webgl,Cat as webgl,Tc as webgl_util,Qv as webgpu_util,co as where,Xd as whereAsync,Ur as zeros,Gt as zerosLike};\n", "import type { Config } from '../exports';\n\n/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\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 if (msg) console.log(ts, 'Human:', ...msg); // eslint-disable-line no-console\n}\n\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(`modelpath error: expecting json file: ${path}`);\n return path;\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: checks current config validity\nexport function validate(defaults: Partial, config: Partial, parent = 'config', msgs: { reason: string, where: string, expected?: string }[] = []) {\n for (const key of Object.keys(config)) {\n if (typeof config[key] === 'object') {\n validate(defaults[key], config[key], key, msgs);\n } else {\n const defined = defaults && (typeof defaults[key] !== 'undefined');\n if (!defined) msgs.push({ reason: 'unknown property', where: `${parent}.${key} = ${config[key]}` });\n const same = defaults && typeof defaults[key] === typeof config[key];\n if (defined && !same) msgs.push({ reason: 'property type mismatch', where: `${parent}.${key} = ${config[key]}`, expected: typeof defaults[key] });\n }\n // ok = ok && defined && same;\n }\n if (config.debug && parent === 'config' && msgs.length > 0) log('invalid configuration', msgs);\n return msgs;\n}\n\n// helper function: perform deep merge of multiple objects so it allows full inheritance 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\n// helper function: return min and max from input array\nexport const minmax = (data: number[]) => data.reduce((acc: number[], val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n\n// helper function: async wait\nexport async function wait(time: number) {\n const waiting = new Promise((resolve) => { setTimeout(() => resolve(true), time); });\n await waiting;\n}\n", "/* eslint-disable no-multi-spaces */\n\n/** Possible TensorFlow backends */\nexport type BackendEnum = '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu';\n\n/** Possible values for `human.warmup` */\nexport type WarmupEnum = '' | 'none' | 'face' | 'full' | 'body';\n\n/** Possible segmentation model behavior */\nexport type SegmentationEnum = 'default' | 'alpha' | 'foreground' | 'state'\n\n/** Generic config type inherited by all module types */\nexport interface GenericConfig {\n /** is module enabled? */\n enabled: boolean,\n /** path to model json file (relative to `modelBasePath` */\n modelPath: string,\n /** how many max frames to go without re-running model if cached results are acceptable\n * for two-phase models such as face and hand caching applies to bounding boxes detection only */\n skipFrames: number,\n /** how many max milliseconds to go without re-running model if cached results are acceptable\n * for two-phase models such as face and hand caching applies to bounding boxes detection only */\n skipTime: number,\n}\n\n/** Detector part of face configuration */\nexport interface FaceDetectorConfig extends GenericConfig {\n /** is face rotation correction performed after detecting face?\n * used to correctly analyze faces under high angles\n */\n rotation: boolean,\n /** maximum number of detected faces */\n maxDetected: number,\n /** minimum confidence for a detected face before results are discarded */\n minConfidence: number,\n /** minimum size in pixels of a detected face box before resutls are discared */\n minSize: number,\n /** minimum overlap between two detected faces before one is discarded */\n iouThreshold: number,\n /** should child models perform on masked image of a face */\n mask: boolean,\n /** should face detection return processed and cropped face tensor that can with an external model for addtional processing?\n * if enabled it must be manually deallocated to avoid memory leak */\n return: boolean,\n}\n\n/** Mesh part of face configuration */\nexport interface FaceMeshConfig extends GenericConfig {\n /** Keep detected faces that cannot be verified using facemesh */\n keepInvalid: boolean\n}\n\n/** Iris part of face configuration */\nexport interface FaceIrisConfig extends GenericConfig {}\n\n/** Attention part of face configuration */\nexport interface FaceAttentionConfig extends GenericConfig {}\n\n/** Description or face embedding part of face configuration\n * - also used by age and gender detection\n */\nexport interface FaceDescriptionConfig extends GenericConfig {\n /** minimum confidence for a detected face before results are discarded */\n minConfidence: number,\n}\n\n/** Emotion part of face configuration */\nexport interface FaceEmotionConfig extends GenericConfig {\n /** minimum confidence for a detected face before results are discarded */\n minConfidence: number,\n}\n\n/** Anti-spoofing part of face configuration */\nexport interface FaceAntiSpoofConfig extends GenericConfig {}\n\n/** Liveness part of face configuration */\nexport interface FaceLivenessConfig extends GenericConfig {}\n\n/** Gear part of face configuration */\nexport interface FaceGearConfig extends GenericConfig {\n /** minimum confidence for a detected race before results are discarded */\n minConfidence: number,\n}\n\n/** Configures all face-specific options: face detection, mesh analysis, age, gender, emotion detection and face description */\nexport interface FaceConfig extends GenericConfig {\n detector: Partial,\n mesh: Partial,\n attention: Partial,\n iris: Partial,\n description: Partial,\n emotion: Partial,\n antispoof: Partial,\n liveness: Partial,\n gear: Partial,\n}\n\n/** Configures all body detection specific options */\nexport interface BodyConfig extends GenericConfig {\n /** maximum number of detected bodies */\n maxDetected: number,\n /** minimum confidence for a detected body before results are discarded */\n minConfidence: number,\n /* experimental\n /** experimental: detector used for body model before actual analysis\n detector?: {\n /** experimental: enable body detector before body landmarks\n enabled: boolean,\n /** experimental: path to optional body detector model json file\n modelPath: string,\n /** experimental: minimum confidence for a detected body before results are discarded\n minConfidence: number,\n /** experimental: minimum overlap between two detected bodies before one is discarded\n iouThreshold: number\n },\n */\n}\n\n/** Configures all hand detection specific options */\nexport interface HandConfig extends GenericConfig {\n /** should hand rotation correction be performed after hand detection? */\n rotation: boolean,\n /** minimum confidence for a detected hand before results are discarded */\n minConfidence: number,\n /** minimum overlap between two detected hands before one is discarded */\n iouThreshold: number,\n /** maximum number of detected hands */\n maxDetected: number,\n /** should hand landmarks be detected or just return detected hand box */\n landmarks: boolean,\n detector: {\n /** path to hand detector model json */\n modelPath?: string,\n },\n skeleton: {\n /** path to hand skeleton model json */\n modelPath?: string,\n },\n}\n\n/** Configures all object detection specific options */\nexport interface ObjectConfig extends GenericConfig {\n /** minimum confidence for a detected objects before results are discarded */\n minConfidence: number,\n /** minimum overlap between two detected objects before one is discarded */\n iouThreshold: number,\n /** maximum number of detected objects */\n maxDetected: number,\n}\n\n/** Configures all body segmentation module\n * removes background from input containing person\n * if segmentation is enabled it will run as preprocessing task before any other model\n * alternatively leave it disabled and use it on-demand using human.segmentation method which can\n * remove background or replace it with user-provided background\n*/\nexport interface SegmentationConfig extends GenericConfig {\n /** downsample ratio, adjust to reflect approximately how much of input is taken by body */\n ratio: number,\n /** possible rvm segmentation mode */\n mode: SegmentationEnum,\n}\n\n/** Run input through image filters before inference\n * - available only in Browser environments\n * - image filters run with near-zero latency as they are executed on the GPU using WebGL\n*/\nexport interface FilterConfig {\n /** are image filters enabled? */\n enabled: boolean,\n /** perform image histogram equalization\n * - equalization is performed on input as a whole and detected face before its passed for further analysis\n */\n equalization: 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 /** apply auto-brighness */\n autoBrightness: 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\n/** Controlls gesture detection */\nexport interface GestureConfig {\n /** is gesture detection enabled? */\n enabled: boolean,\n}\n/**\n * Configuration interface definition for **Human** library\n * Contains all configurable parameters\n * Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L262)\n */\nexport interface Config {\n /** Backend used for TFJS operations\n * valid build-in backends are:\n * - Browser: `cpu`, `wasm`, `webgl`, `humangl`, `webgpu`\n * - NodeJS: `cpu`, `wasm`, `tensorflow`\n * default: `webgl` for browser and `tensorflow` for nodejs\n */\n backend: BackendEnum,\n\n /** Path to *.wasm files if backend is set to `wasm`\n *\n * default: auto-detects to link to CDN `jsdelivr` when running in browser\n */\n wasmPath: string,\n\n /** Force WASM loader to use platform fetch\n *\n * default: false\n */\n wasmPlatformFetch: boolean,\n\n /** Print debug statements to console\n *\n * default: `true`\n */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially\n *\n * default: `true`\n */\n async: 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 * - used by `webgl`, `humangl` and `webgpu` backends\n *\n * default: `full`\n */\n warmup: WarmupEnum,\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 * default: `../models/` for browsers and `file://models/` for nodejs\n */\n modelBasePath: string,\n\n /** Cache models in IndexDB on first sucessfull load\n * default: true if indexdb is available (browsers), false if its not (nodejs)\n */\n cacheModels: boolean,\n\n /** Validate kernel ops used in model during model load\n * default: true\n * any errors will be printed on console but will be treated as non-fatal\n */\n validateModels: boolean,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n *\n * default: 0.7\n */\n cacheSensitivity: number;\n\n /** Explicit flags passed to initialize TFJS */\n flags: Record,\n\n /** Software Kernels\n * Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend\n */\n softwareKernels: boolean,\n\n /** Perform immediate garbage collection on deallocated tensors instead of caching them */\n deallocate: boolean;\n\n /** Internal Variable */\n skipAllowed: boolean;\n\n /** Filter config {@link FilterConfig} */\n filter: Partial,\n\n /** Gesture config {@link GestureConfig} */\n gesture: Partial;\n\n /** Face config {@link FaceConfig} */\n face: Partial,\n\n /** Body config {@link BodyConfig} */\n body: Partial,\n\n /** Hand config {@link HandConfig} */\n hand: Partial,\n\n /** Object config {@link ObjectConfig} */\n object: Partial,\n\n /** Segmentation config {@link SegmentationConfig} */\n segmentation: Partial,\n}\n\n/** - [See all default Config values...](https://github.com/vladmandic/human/blob/main/src/config.ts#L262) */\nconst config: Config = {\n backend: '',\n modelBasePath: '',\n cacheModels: true,\n validateModels: true,\n wasmPath: '',\n wasmPlatformFetch: false,\n debug: false,\n async: true,\n warmup: 'full',\n cacheSensitivity: 0.70,\n skipAllowed: false,\n deallocate: false,\n flags: {},\n softwareKernels: false,\n filter: {\n enabled: true,\n equalization: false,\n width: 0,\n height: 0,\n flip: false,\n return: true,\n autoBrightness: true,\n brightness: 0,\n contrast: 0,\n sharpness: 0,\n blur: 0,\n saturation: 0,\n hue: 0,\n negative: false,\n sepia: false,\n vintage: false,\n kodachrome: false,\n technicolor: false,\n polaroid: false,\n pixelate: 0,\n },\n gesture: {\n enabled: true,\n },\n face: {\n enabled: true,\n detector: {\n modelPath: 'blazeface.json',\n rotation: false,\n maxDetected: 1,\n skipFrames: 99,\n skipTime: 2500,\n minConfidence: 0.2,\n minSize: 0,\n iouThreshold: 0.1,\n mask: false,\n return: false,\n },\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json',\n keepInvalid: false,\n },\n attention: {\n enabled: false,\n modelPath: 'facemesh-attention.json',\n },\n iris: {\n enabled: true,\n modelPath: 'iris.json',\n },\n emotion: {\n enabled: true,\n minConfidence: 0.1,\n skipFrames: 99,\n skipTime: 1500,\n modelPath: 'emotion.json',\n },\n description: {\n enabled: true,\n modelPath: 'faceres.json',\n skipFrames: 99,\n skipTime: 3000,\n minConfidence: 0.1,\n },\n antispoof: {\n enabled: false,\n skipFrames: 99,\n skipTime: 4000,\n modelPath: 'antispoof.json',\n },\n liveness: {\n enabled: false,\n skipFrames: 99,\n skipTime: 4000,\n modelPath: 'liveness.json',\n },\n },\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json',\n maxDetected: -1,\n minConfidence: 0.3,\n skipFrames: 1,\n skipTime: 200,\n },\n hand: {\n enabled: true,\n rotation: true,\n skipFrames: 99,\n skipTime: 1000,\n minConfidence: 0.50,\n iouThreshold: 0.2,\n maxDetected: -1,\n landmarks: true,\n detector: {\n modelPath: 'handtrack.json',\n },\n skeleton: {\n modelPath: 'handlandmark-lite.json',\n },\n },\n object: {\n enabled: false,\n modelPath: 'centernet.json',\n minConfidence: 0.2,\n iouThreshold: 0.4,\n maxDetected: 10,\n skipFrames: 99,\n skipTime: 2000,\n },\n segmentation: {\n enabled: false,\n modelPath: 'rvm.json',\n ratio: 0.5,\n mode: 'default',\n },\n};\n\nexport { config as defaults };\n", "export const vertexIdentity = `\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`;\n\nexport const fragmentIdentity = `\n precision highp float;\n varying vec2 vUv;\n uniform sampler2D texture;\n void main(void) {\n gl_FragColor = texture2D(texture, vUv);\n }\n`;\n\nexport const colorMatrixWithAlpha = `\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`;\n\nexport const colorMatrixWithoutAlpha = `\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`;\n\nexport const pixelate = `\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`;\n\nexport const blur = `\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`;\n\nexport const convolution = `\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`;\n", "/**\n * Image Filters in WebGL algoritm implementation\n * Based on: [WebGLImageFilter](https://github.com/phoboslab/WebGLImageFilter)\n */\n\n/* eslint-disable func-names */\n\nimport * as shaders from './imagefxshaders';\nimport { canvas } from './image';\nimport { log } from '../util/util';\n\nconst collect = (source, prefix: string, 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\nclass GLProgram {\n uniform = {};\n attribute = {};\n gl: WebGLRenderingContext;\n id: WebGLProgram;\n\n constructor(gl, vertexSource, fragmentSource) {\n this.gl = gl;\n const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);\n const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);\n this.id = this.gl.createProgram() as WebGLProgram;\n if (!vertexShader || !fragmentShader) return;\n if (!this.id) {\n log('filter: could not create webgl program');\n return;\n }\n this.gl.attachShader(this.id, vertexShader);\n this.gl.attachShader(this.id, fragmentShader);\n this.gl.linkProgram(this.id);\n if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {\n log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id) || 'unknown'}`);\n return;\n }\n this.gl.useProgram(this.id);\n collect(vertexSource, 'attribute', this.attribute); // Collect attributes\n for (const a in this.attribute) this.attribute[a] = this.gl.getAttribLocation(this.id, a);\n collect(vertexSource, 'uniform', this.uniform); // Collect uniforms\n collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = this.gl.getUniformLocation(this.id, u);\n }\n\n compile = (source, type): WebGLShader | null => {\n const shader = this.gl.createShader(type);\n if (!shader) {\n log('filter: could not create shader');\n return null;\n }\n this.gl.shaderSource(shader, source);\n this.gl.compileShader(shader);\n if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {\n log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader) || 'unknown'}`);\n return null;\n }\n return shader;\n };\n}\n\n// function that is instantiated as class so it has private this members\n/**\n * @class GLImageFilter\n * @property {function} reset reset current filter chain\n * @property {function} add add specified filter to filter chain\n * @property {function} apply execute filter chain and draw result\n * @property {function} draw just draw input to result\n */\n\nexport function GLImageFilter() {\n let drawCount = 0;\n let sourceTexture: WebGLTexture | null = null;\n let lastInChain = false;\n let currentFramebufferIndex = -1;\n let tempFramebuffers: [null, null] | [{ fbo: WebGLFramebuffer | null, texture: WebGLTexture | null }] = [null, null];\n let filterChain: Record[] = [];\n let vertexBuffer: WebGLBuffer | null = null;\n let currentProgram: GLProgram | null = null;\n const fxcanvas = canvas(100, 100) as HTMLCanvasElement;\n const shaderProgramCache = { }; // key is the shader program source, value is the compiled program\n const DRAW = { INTERMEDIATE: 1 };\n const gl = fxcanvas.getContext('webgl') as WebGLRenderingContext;\n if (!gl) {\n log('filter: cannot get webgl context');\n return;\n }\n // @ts-ignore used for sanity checks outside of imagefx\n this.gl = gl;\n\n function resize(width, height) {\n if (width === fxcanvas.width && height === fxcanvas.height) return; // Same width/height? Nothing to do here\n fxcanvas.width = width;\n fxcanvas.height = height;\n if (!vertexBuffer) { // Create the context if we don't have it yet\n const vertices = 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]); // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n vertexBuffer = gl.createBuffer();\n 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, fxcanvas.width, fxcanvas.height);\n tempFramebuffers = [null, null]; // Delete old temp framebuffers\n }\n\n function createFramebufferTexture(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 function getTempFramebuffer(index): { fbo: WebGLFramebuffer | null, texture: WebGLTexture | null } {\n tempFramebuffers[index] = tempFramebuffers[index] || createFramebufferTexture(fxcanvas.width, fxcanvas.height);\n return tempFramebuffers[index] as { fbo: WebGLFramebuffer, texture: WebGLTexture };\n }\n\n function draw(flags = 0) {\n if (!currentProgram) return;\n let source: WebGLTexture | null = null;\n let target: WebGLFramebuffer | null = null;\n let flipY = false;\n if (drawCount === 0) source = sourceTexture; // First draw call - use the source texture\n else source = getTempFramebuffer(currentFramebufferIndex).texture || null; // All following draw calls use the temp buffer last drawn to\n drawCount++;\n if (lastInChain && !(flags & DRAW.INTERMEDIATE)) { // Last filter in our chain - draw directly to the WebGL Canvas. We may also have to flip the image vertically now\n target = null;\n flipY = drawCount % 2 === 0;\n } else {\n currentFramebufferIndex = (currentFramebufferIndex + 1) % 2;\n target = getTempFramebuffer(currentFramebufferIndex).fbo || null; // Intermediate draw call - get a temp buffer to draw to\n }\n gl.bindTexture(gl.TEXTURE_2D, source); // Bind the source and target and draw the two triangles\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 function compileShader(fragmentSource): GLProgram | null {\n if (shaderProgramCache[fragmentSource]) {\n currentProgram = shaderProgramCache[fragmentSource];\n gl.useProgram((currentProgram ? currentProgram.id : null) || null);\n return currentProgram;\n }\n currentProgram = new GLProgram(gl, shaders.vertexIdentity, fragmentSource);\n if (!currentProgram) {\n log('filter: could not get webgl program');\n return null;\n }\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 const filter = {\n colorMatrix: (matrix: number[]) => { // general color matrix filter\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\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) // Can we ignore the alpha value? Makes things a bit faster.\n ? shaders.colorMatrixWithoutAlpha\n : shaders.colorMatrixWithAlpha;\n const program = compileShader(shader);\n if (!program) return;\n gl.uniform1fv(program.uniform['m'], m);\n draw();\n },\n\n brightness: (brightness: number) => {\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 saturation: (amount: number) => {\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 desaturate: () => {\n filter.saturation(-1);\n },\n\n contrast: (amount: number) => {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\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 negative: () => {\n filter.contrast(-2);\n },\n\n hue: (rotation: number) => {\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 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 desaturateLuminance: () => {\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 sepia: () => {\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 brownie: () => {\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 vintagePinhole: () => {\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 kodachrome: () => {\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 technicolor: () => {\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 polaroid: () => {\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 shiftToBGR: () => {\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 convolution: (matrix: number[]) => { // general convolution Filter\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / fxcanvas.width;\n const pixelSizeY = 1 / fxcanvas.height;\n const program = compileShader(shaders.convolution);\n if (!program) return;\n gl.uniform1fv(program.uniform['m'], m);\n gl.uniform2f(program.uniform['px'], pixelSizeX, pixelSizeY);\n draw();\n },\n\n detectEdges: () => {\n // @ts-ignore this\n filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n },\n\n sobelX: () => {\n // @ts-ignore this\n filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n },\n\n sobelY: () => {\n // @ts-ignore this\n filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n },\n\n sharpen: (amount) => {\n const a = amount || 1;\n // @ts-ignore this\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 emboss: (size: number) => {\n const s = size || 1;\n // @ts-ignore this\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 blur: (size: number) => {\n const blurSizeX = (size / 7) / fxcanvas.width;\n const blurSizeY = (size / 7) / fxcanvas.height;\n const program = compileShader(shaders.blur);\n if (!program) return;\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 pixelate: (size: number) => {\n const blurSizeX = (size) / fxcanvas.width;\n const blurSizeY = (size) / fxcanvas.height;\n const program = compileShader(shaders.pixelate);\n if (!program) return;\n gl.uniform2f(program.uniform['size'], blurSizeX, blurSizeY);\n draw();\n },\n };\n\n // @ts-ignore this\n this.add = function (name) {\n const args = Array.prototype.slice.call(arguments, 1); // eslint-disable-line prefer-rest-params\n const func = filter[name];\n filterChain.push({ func, args });\n };\n\n // @ts-ignore this\n this.reset = function () {\n filterChain = [];\n };\n\n // @ts-ignore this\n this.get = function () {\n return filterChain;\n };\n\n // @ts-ignore this\n this.apply = function (image) {\n resize(image.width, image.height);\n drawCount = 0;\n if (!sourceTexture) sourceTexture = gl.createTexture(); // Create the texture for the input image if we haven't yet\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 for (let i = 0; i < filterChain.length; i++) {\n lastInChain = (i === filterChain.length - 1);\n const f = filterChain[i];\n // @ts-ignore function assigment\n f.func.apply(this, f.args || []);\n }\n return fxcanvas;\n };\n\n // @ts-ignore this\n this.draw = function (image) {\n this.add('brightness', 0);\n return this.apply(image);\n };\n}\n", "/**\n * Image enhancements\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Tensor } from '../tfjs/types';\n\nexport async function histogramEqualization(inputImage: Tensor): Promise {\n const squeeze = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;\n const rgb = tf.split(squeeze, 3, 2);\n const min: Tensor[] = [tf.min(rgb[0]), tf.min(rgb[1]), tf.min(rgb[2])]; // minimum pixel value per channel T[]\n const max: Tensor[] = [tf.max(rgb[0]), tf.max(rgb[1]), tf.max(rgb[2])]; // maximum pixel value per channel T[]\n // const absMin = await Promise.all(min.map((channel) => channel.data())); // minimum pixel value per channel A[]\n // const minValue = Math.min(absMax[0][0], absMin[1][0], absMin[2][0]);\n const absMax = await Promise.all(max.map((channel) => channel.data())); // maximum pixel value per channel A[]\n const maxValue = Math.max(absMax[0][0], absMax[1][0], absMax[2][0]);\n const maxRange = maxValue > 1 ? 255 : 1;\n const factor = maxRange / maxValue;\n let final: Tensor;\n if (factor > 1) {\n const sub = [tf.sub(rgb[0], min[0]), tf.sub(rgb[1], min[1]), tf.sub(rgb[2], min[2])]; // channels offset by min values\n const range = [tf.sub(max[0], min[0]), tf.sub(max[1], min[1]), tf.sub(max[2], min[2])]; // channel ranges\n // const fact = [tf.div(maxRange, absMax[0]), tf.div(maxRange, absMax[1]), tf.div(maxRange, absMax[1])]; // factors between\n const enh = [tf.mul(sub[0], factor), tf.mul(sub[1], factor), tf.mul(sub[2], factor)];\n const stack = tf.stack([enh[0], enh[1], enh[2]], 2);\n final = tf.reshape(stack, [1, squeeze.shape[0] || 0, squeeze.shape[1] || 0, 3]);\n tf.dispose([...sub, ...range, ...enh, stack]);\n } else {\n final = tf.expandDims(squeeze, 0);\n }\n tf.dispose([...rgb, ...min, ...max, rgb, squeeze, inputImage]);\n return final;\n}\n", "/**\n * Image Processing algorithm implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\nimport type { Input, AnyCanvas, Config } from '../exports';\nimport type { Tensor, Tensor3D, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { log } from '../util/util';\nimport * as enhance from './enhance';\n\nconst maxSize = 3840;\n// internal temp canvases\nlet inCanvas: AnyCanvas | null = null; // use global variable to avoid recreating canvas on each frame\nlet outCanvas: AnyCanvas | null = null; // use global variable to avoid recreating canvas on each frame\nlet tmpCanvas: AnyCanvas | null = null; // use global variable to avoid recreating canvas on each frame\n// @ts-ignore // imagefx is js module that should be converted to a class\nlet fx: fxImage.GLImageFilter | null; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n\nconst last: { inputSum: number, cacheDiff: number, sumMethod: number, inputTensor: undefined | Tensor } = {\n inputSum: 0,\n cacheDiff: 1,\n sumMethod: 0,\n inputTensor: undefined,\n};\n\nexport function reset() {\n last.inputSum = 0;\n last.cacheDiff = 1;\n last.sumMethod = 0;\n last.inputTensor = undefined;\n}\n\nexport function canvas(width: number, height: number): AnyCanvas {\n let c: AnyCanvas;\n if (env.browser) { // browser defines canvas object\n if (env.worker) { // if runing in web worker use OffscreenCanvas\n if (typeof OffscreenCanvas === 'undefined') throw new Error('canvas error: attempted to run in web worker but OffscreenCanvas is not supported');\n c = new OffscreenCanvas(width, height);\n } else { // otherwise use DOM canvas\n if (typeof document !== 'undefined') {\n c = document.createElement('canvas');\n c.width = width;\n c.height = height;\n } else if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n // @ts-ignore // env.canvas is an external monkey-patch\n if (typeof env.Canvas !== 'undefined') c = new env.Canvas(width, height);\n else if (typeof globalThis.Canvas !== 'undefined') c = new globalThis.Canvas(width, height);\n else throw new Error('canvas error: attempted to use canvas in react-native without canvas support installed');\n } else {\n throw new Error('canvas error: attempted to run in browser but DOM is not defined');\n }\n }\n } else { // if not running in browser, there is no \"default\" canvas object, so we need monkey patch or fail\n // @ts-ignore // env.canvas is an external monkey-patch\n if (typeof env.Canvas !== 'undefined') c = new env.Canvas(width, height);\n else if (typeof globalThis.Canvas !== 'undefined') c = new globalThis.Canvas(width, height);\n // else throw new Error('canvas error: attempted to use canvas in nodejs without canvas support installed');\n }\n // @ts-ignore its either defined or we already threw an error\n return c;\n}\n\n// helper function to copy canvas from input to output\nexport function copy(input: AnyCanvas, output?: AnyCanvas) {\n const outputCanvas = output || canvas(input.width, input.height);\n const ctx = outputCanvas.getContext('2d') as CanvasRenderingContext2D;\n ctx.drawImage(input, 0, 0);\n return outputCanvas;\n}\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 async function process(input: Input, config: Config, getTensor: boolean = true): Promise<{ tensor: Tensor4D | null, canvas: AnyCanvas | null }> {\n if (!input) {\n // throw new Error('input is missing');\n if (config.debug) log('input error: input is missing');\n return { tensor: null, canvas: null }; // video may become temporarily unavailable due to onresize\n }\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 globalThis.Canvas !== 'undefined' && input instanceof globalThis.Canvas)\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('input error: type not recognized');\n }\n if (input instanceof tf.Tensor) { // if input is tensor use as-is without filters but correct shape as needed\n let tensor: Tensor | null = null;\n if (input['isDisposedInternal']) throw new Error('input error: attempted to use tensor but it is disposed');\n if (!(input as Tensor).shape) throw new Error('input error: attempted to use tensor without a shape');\n if ((input as Tensor).shape.length === 3) { // [height, width, 3 || 4]\n if ((input as Tensor).shape[2] === 3) { // [height, width, 3] so add batch\n tensor = tf.expandDims(input, 0);\n } else if ((input as Tensor).shape[2] === 4) { // [height, width, 4] so strip alpha and add batch\n const rgb = tf.slice3d(input as Tensor3D, [0, 0, 0], [-1, -1, 3]);\n tensor = tf.expandDims(rgb, 0);\n tf.dispose(rgb);\n }\n } else if ((input as Tensor).shape.length === 4) { // [1, width, height, 3 || 4]\n if ((input as Tensor).shape[3] === 3) { // [1, width, height, 3] just clone\n tensor = tf.clone(input);\n } else if ((input as Tensor).shape[3] === 4) { // [1, width, height, 4] so strip alpha\n tensor = tf.slice4d(input as Tensor4D, [0, 0, 0, 0], [-1, -1, -1, 3]);\n }\n }\n // at the end shape must be [1, height, width, 3]\n if (tensor == null || tensor.shape.length !== 4 || tensor.shape[0] !== 1 || tensor.shape[3] !== 3) throw new Error(`input error: attempted to use tensor with unrecognized shape: ${((input as Tensor).shape).toString()}`);\n if ((tensor).dtype === 'int32') {\n const cast = tf.cast(tensor, 'float32');\n tf.dispose(tensor);\n tensor = cast;\n }\n return { tensor: tensor as Tensor4D, canvas: (config.filter.return ? outCanvas : null) };\n }\n // check if resizing will be needed\n if (typeof input['readyState'] !== 'undefined' && (input as HTMLMediaElement).readyState <= 2) {\n if (config.debug) log('input stream is not ready');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n const originalWidth: number = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight: number = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n if (!originalWidth || !originalHeight) {\n if (config.debug) log('cannot determine input dimensions');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n let targetWidth: number = originalWidth;\n let targetHeight: number = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);\n }\n\n // create our canvas and resize it if needed\n if ((config.filter?.width || 0) > 0) targetWidth = config.filter.width as number;\n else if ((config.filter?.height || 0) > 0) targetWidth = originalWidth * ((config.filter.height || 0) / originalHeight);\n if ((config.filter.height || 0) > 0) targetHeight = config.filter.height as number;\n else if ((config.filter.width || 0) > 0) targetHeight = originalHeight * ((config.filter.width || 0) / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('input error: cannot determine dimension');\n if (!inCanvas || (inCanvas.width !== targetWidth) || (inCanvas.height !== targetHeight)) inCanvas = canvas(targetWidth, targetHeight);\n\n // draw input to our canvas\n const inCtx = inCanvas.getContext('2d') as CanvasRenderingContext2D;\n if ((typeof ImageData !== 'undefined') && (input instanceof ImageData)) {\n inCtx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof inCtx.translate !== 'undefined') {\n inCtx.translate(originalWidth, 0);\n inCtx.scale(-1, 1);\n inCtx.drawImage(input as AnyCanvas, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas.width, inCanvas.height);\n inCtx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n inCtx.drawImage(input as AnyCanvas, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas.width, inCanvas.height);\n }\n }\n\n if (!outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas.height !== outCanvas.height)) outCanvas = canvas(inCanvas.width, inCanvas.height); // init output canvas\n\n // imagefx transforms using gl from input canvas to output canvas\n if (config.filter.enabled && env.webgl.supported) {\n if (!fx) fx = env.browser ? new fxImage.GLImageFilter() : null; // && (typeof document !== 'undefined')\n env.filter = !!fx;\n if (!fx?.add) {\n if (config.debug) log('input process error: cannot initialize filters');\n env.webgl.supported = false;\n config.filter.enabled = false;\n copy(inCanvas, outCanvas); // filter failed to initialize\n // return { tensor: null, canvas: inCanvas };\n } else {\n fx.reset();\n if (config.filter.brightness !== 0) fx.add('brightness', config.filter.brightness);\n if (config.filter.contrast !== 0) fx.add('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.add('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.add('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.add('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.add('hue', config.filter.hue);\n if (config.filter.negative) fx.add('negative');\n if (config.filter.sepia) fx.add('sepia');\n if (config.filter.vintage) fx.add('brownie');\n if (config.filter.sepia) fx.add('sepia');\n if (config.filter.kodachrome) fx.add('kodachrome');\n if (config.filter.technicolor) fx.add('technicolor');\n if (config.filter.polaroid) fx.add('polaroid');\n if (config.filter.pixelate !== 0) fx.add('pixelate', config.filter.pixelate);\n if (fx.get()?.length > 1) outCanvas = fx.apply(inCanvas);\n else outCanvas = fx.draw(inCanvas);\n }\n } else {\n copy(inCanvas, outCanvas); // if no filters applied, output canvas is input canvas\n if (fx) fx = null;\n env.filter = !!fx;\n }\n\n if (!getTensor) return { tensor: null, canvas: outCanvas }; // just canvas was requested\n if (!outCanvas) throw new Error('canvas error: cannot create output');\n\n // create tensor from image unless input was a tensor already\n let pixels;\n let depth = 3;\n if ((typeof ImageData !== 'undefined' && input instanceof ImageData) || ((input as ImageData).data && (input as ImageData).width && (input as ImageData).height)) { // if input is imagedata, just use it\n if (env.browser && tf.browser) {\n pixels = tf.browser ? tf.browser.fromPixels(input as ImageData) : null;\n } else {\n depth = (input as ImageData).data.length / (input as ImageData).height / (input as ImageData).width;\n // const arr = Uint8Array.from(input['data']);\n const arr = new Uint8Array((input as ImageData).data.buffer);\n pixels = tf.tensor(arr, [(input as ImageData).height, (input as ImageData).width, depth], 'int32');\n }\n } else {\n if (!tmpCanvas || (outCanvas.width !== tmpCanvas.width) || (outCanvas.height !== tmpCanvas.height)) tmpCanvas = canvas(outCanvas.width, outCanvas.height); // init output canvas\n if (tf.browser && env.browser) {\n if (config.backend === 'webgl' || config.backend === 'humangl' || config.backend === 'webgpu') {\n pixels = tf.browser.fromPixels(outCanvas as HTMLCanvasElement); // safe to reuse since both backend and context are gl based\n } else {\n tmpCanvas = copy(outCanvas); // cannot use output canvas as it already has gl context so we do a silly one more canvas\n pixels = tf.browser.fromPixels(tmpCanvas as HTMLCanvasElement);\n }\n } else {\n const tempCanvas = copy(outCanvas); // cannot use output canvas as it already has gl context so we do a silly one more canvas\n const tempCtx = tempCanvas.getContext('2d') as CanvasRenderingContext2D;\n const tempData = tempCtx.getImageData(0, 0, targetWidth, targetHeight);\n depth = tempData.data.length / targetWidth / targetHeight;\n const arr = new Uint8Array(tempData.data.buffer);\n pixels = tf.tensor(arr, [targetWidth, targetHeight, depth]);\n }\n }\n if (depth === 4) { // rgba to rgb\n const rgb = tf.slice3d(pixels, [0, 0, 0], [-1, -1, 3]); // strip alpha channel\n tf.dispose(pixels);\n pixels = rgb;\n }\n if (!pixels) throw new Error('input error: cannot create tensor');\n const casted: Tensor = tf.cast(pixels, 'float32');\n const tensor: Tensor = config.filter.equalization ? await enhance.histogramEqualization(casted) : tf.expandDims(casted, 0);\n tf.dispose([pixels, casted]);\n\n if (config.filter.autoBrightness) {\n const max = tf.max(tensor);\n const maxVal = await max.data();\n config.filter.brightness = maxVal[0] > 1 ? (1 - maxVal[0] / 255) : (1 - maxVal[0]);\n tf.dispose(max);\n }\n\n return { tensor: tensor as Tensor4D, canvas: (config.filter.return ? outCanvas : null) };\n}\n\n/*\nconst checksum = async (input: Tensor): Promise => { // use tf sum or js based sum loop depending on which is faster\n const resizeFact = 48;\n const reduced: Tensor = tf.image.resizeBilinear(input, [Math.trunc((input.shape[1] || 1) / resizeFact), Math.trunc((input.shape[2] || 1) / resizeFact)]);\n const tfSum = async (): Promise => {\n const sumT = tf.sum(reduced);\n const sum0 = await sumT.data();\n tf.dispose(sumT);\n return sum0[0];\n };\n const jsSum = async (): Promise => {\n const reducedData = await reduced.data(); // raw image rgb array\n let sum0 = 0;\n for (let i = 0; i < reducedData.length / 3; i++) sum0 += reducedData[3 * i + 2]; // look only at green value of each pixel\n return sum0;\n };\n if (last.sumMethod === 0) {\n const t0 = now();\n await jsSum();\n const t1 = now();\n await tfSum();\n const t2 = now();\n last.sumMethod = t1 - t0 < t2 - t1 ? 1 : 2;\n }\n const res = last.sumMethod === 1 ? await jsSum() : await tfSum();\n tf.dispose(reduced);\n return res;\n};\n*/\n\nexport async function skip(config: Partial, input: Tensor) {\n let skipFrame = false;\n if (config.cacheSensitivity === 0 || !input.shape || input.shape.length !== 4 || input.shape[1] > 3840 || input.shape[2] > 2160) return skipFrame; // cache disabled or input is invalid or too large for cache analysis\n\n /*\n const checkSum = await checksum(input);\n const diff = 100 * (Math.max(checkSum, last.inputSum) / Math.min(checkSum, last.inputSum) - 1);\n last.inputSum = checkSum;\n // if previous frame was skipped, skip this frame if changed more than cacheSensitivity\n // if previous frame was not skipped, then look for cacheSensitivity or difference larger than one in previous frame to avoid resetting cache in subsequent frames unnecessarily\n let skipFrame = diff < Math.max(config.cacheSensitivity, last.cacheDiff);\n // if difference is above 10x threshold, don't use last value to force reset cache for significant change of scenes or images\n last.cacheDiff = diff > 10 * config.cacheSensitivity ? 0 : diff;\n skipFrame = skipFrame && (last.cacheDiff > 0); // if no cached diff value then force no skip\n */\n\n if (!last.inputTensor) {\n last.inputTensor = tf.clone(input);\n } else if (last.inputTensor.shape[1] !== input.shape[1] || last.inputTensor.shape[2] !== input.shape[2]) { // input resolution changed\n tf.dispose(last.inputTensor);\n last.inputTensor = tf.clone(input);\n } else {\n const t: Record = {};\n t.diff = tf.sub(input, last.inputTensor);\n t.squared = tf.mul(t.diff, t.diff);\n t.sum = tf.sum(t.squared);\n const diffSum = await t.sum.data();\n const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; // squared difference relative to input resolution and averaged per channel\n tf.dispose([last.inputTensor, t.diff, t.squared, t.sum]);\n last.inputTensor = tf.clone(input);\n skipFrame = diffRelative <= (config.cacheSensitivity || 0);\n }\n return skipFrame;\n}\n\nexport async function compare(config: Partial, input1: Tensor, input2: Tensor): Promise {\n const t: Record = {};\n if (!input1 || !input2 || input1.shape.length !== 4 || input1.shape.length !== input2.shape.length) {\n if (!config.debug) log('invalid input tensor or tensor shapes do not match:', input1.shape, input2.shape);\n return 0;\n }\n if (input1.shape[0] !== 1 || input2.shape[0] !== 1 || input1.shape[3] !== 3 || input2.shape[3] !== 3) {\n if (!config.debug) log('input tensors must be of shape [1, height, width, 3]:', input1.shape, input2.shape);\n return 0;\n }\n t.input1 = tf.clone(input1);\n t.input2 = (input1.shape[1] !== input2.shape[1] || input1.shape[2] !== input2.shape[2]) ? tf.image.resizeBilinear(input2 as Tensor3D, [input1.shape[1], input1.shape[2]]) : tf.clone(input2);\n t.diff = tf.sub(t.input1, t.input2);\n t.squared = tf.mul(t.diff, t.diff);\n t.sum = tf.sum(t.squared);\n const diffSum = await t.sum.data();\n const diffRelative = diffSum[0] / (input1.shape[1] || 1) / (input1.shape[2] || 1) / 255 / 3;\n tf.dispose([t.input1, t.input2, t.diff, t.squared, t.sum]);\n return diffRelative;\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport * as image from '../image/image';\n\n/** Env class that holds detected capabilities */\nexport class Env {\n /** Running in Browser */\n browser: boolean;\n /** Running in NodeJS */\n node: boolean;\n /** Running in WebWorker thread */\n worker: boolean;\n /** Detected platform */\n platform: string = '';\n /** Detected agent */\n agent: string = '';\n /** List of supported backends */\n backends: string[] = [];\n /** Has any work been performed so far */\n initial: boolean;\n /** Are image filters supported? */\n filter: boolean | undefined;\n /** TFJS instance details */\n tfjs: {\n version: undefined | string,\n };\n /** Is offscreenCanvas supported? */\n offscreen: undefined | boolean;\n /** Are performance counter instant values or additive */\n perfadd: boolean = false;\n /** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */\n tensorflow: {\n version: undefined | string,\n gpu: undefined | boolean,\n } = {\n version: undefined,\n gpu: undefined,\n };\n /** WASM detected capabilities */\n wasm: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n simd: undefined | boolean,\n multithread: undefined | boolean,\n } = {\n supported: undefined,\n backend: undefined,\n simd: undefined,\n multithread: undefined,\n };\n /** WebGL detected capabilities */\n webgl: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n version: undefined | string,\n renderer: undefined | string,\n shader: undefined | string,\n vendor: undefined | string,\n } = {\n supported: undefined,\n backend: undefined,\n version: undefined,\n renderer: undefined,\n shader: undefined,\n vendor: undefined,\n };\n /** WebGPU detected capabilities */\n webgpu: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n adapter: undefined | GPUAdapterInfo,\n } = {\n supported: undefined,\n backend: undefined,\n adapter: undefined,\n };\n /** CPU info */\n cpu: {\n model: undefined | string,\n flags: string[],\n } = {\n model: undefined,\n flags: [],\n };\n /** List of supported kernels for current backend */\n kernels: string[] = [];\n\n /** MonkeyPatch for Canvas/Image/ImageData */\n #canvas: undefined;\n #image: undefined;\n #imageData: undefined;\n\n get Canvas() { return this.#canvas; }\n set Canvas(val) { this.#canvas = val; globalThis.Canvas = val; }\n get Image() { return this.#image; }\n // @ts-ignore monkey-patch;\n set Image(val) { this.#image = val; globalThis.Image = val; }\n get ImageData() { return this.#imageData; }\n // @ts-ignore monkey-patch;\n set ImageData(val) { this.#imageData = val; globalThis.ImageData = val; }\n\n constructor() {\n this.browser = (typeof navigator !== 'undefined') && (typeof navigator.appVersion !== 'undefined');\n this.node = (typeof process !== 'undefined') && (typeof process.versions !== 'undefined') && (typeof process.versions.node !== 'undefined');\n this.tfjs = { version: tf.version['tfjs-core'] };\n this.offscreen = typeof OffscreenCanvas !== 'undefined';\n this.initial = true;\n\n // @ts-ignore WorkerGlobalScope evaluated in browser only\n this.worker = this.browser && this.offscreen ? (typeof WorkerGlobalScope !== 'undefined') : undefined;\n if ((typeof navigator !== 'undefined') && (typeof navigator.userAgent !== 'undefined')) { // TBD replace with navigator.userAgentData once in mainline\n const agent = navigator.userAgent || '';\n const raw = agent.match(/\\(([^()]+)\\)/g);\n if (raw?.[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n this.platform = (platformMatch?.[0]) ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n this.agent = agent.replace(raw[0], '');\n if (this.platform[1]) this.agent = this.agent.replace(raw[1], '');\n this.agent = this.agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n this.platform = `${process.platform} ${process.arch}`;\n this.agent = `NodeJS ${process.version}`;\n }\n }\n\n /** update backend information */\n async updateBackend() {\n // analyze backends\n this.backends = Object.keys(tf.engine().registryFactory);\n try { // backend may not be initialized\n this.tensorflow = {\n version: (tf.backend()['binding'] ? tf.backend()['binding'].TF_Version : undefined),\n gpu: (tf.backend()['binding'] ? tf.backend()['binding'].isUsingGpuDevice() : undefined),\n };\n } catch { /**/ }\n this.wasm.supported = typeof WebAssembly !== 'undefined';\n this.wasm.backend = this.backends.includes('wasm');\n if (this.wasm.supported && this.wasm.backend) {\n this.wasm.simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT') as boolean;\n this.wasm.multithread = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT') as boolean;\n }\n const c = image.canvas(100, 100);\n const gl = c ? c.getContext('webgl2') as WebGL2RenderingContext : undefined; // causes too many gl contexts\n this.webgl.supported = typeof gl !== 'undefined';\n this.webgl.backend = this.backends.includes('webgl');\n if (this.webgl.supported && this.webgl.backend && gl) {\n this.webgl.version = gl.getParameter(gl.VERSION);\n this.webgl.vendor = gl.getParameter(gl.VENDOR);\n this.webgl.renderer = gl.getParameter(gl.RENDERER);\n this.webgl.shader = gl.getParameter(gl.SHADING_LANGUAGE_VERSION);\n }\n this.webgpu.supported = this.browser && typeof navigator !== 'undefined' && typeof navigator.gpu !== 'undefined';\n this.webgpu.backend = this.backends.includes('webgpu');\n try {\n if (this.webgpu.supported) {\n const adapter = await navigator.gpu.requestAdapter();\n this.webgpu.adapter = await adapter?.requestAdapterInfo();\n }\n } catch {\n this.webgpu.supported = false;\n }\n try {\n this.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());\n } catch { /**/ }\n }\n\n /** update cpu information */\n updateCPU() {\n const cpu = { model: '', flags: [] };\n if (this.node && this.platform.startsWith('linux')) {\n /*\n const fs = require('fs');\n try {\n const data = fs.readFileSync('/proc/cpuinfo').toString();\n for (const line of data.split('\\n')) {\n if (line.startsWith('model name')) cpu.model = line.match(/:(.*)/g)[0].replace(':', '').trim();\n if (line.startsWith('flags')) cpu.flags = line.match(/:(.*)/g)[0].replace(':', '').trim().split(' ').sort();\n }\n } catch { }\n */\n }\n if (!this.cpu) Object.defineProperty(this, 'cpu', { value: cpu });\n else this.cpu = cpu;\n }\n}\n\nexport const env = new Env();\n", "import { log } from './util';\n\n// const log = (...msg) => console.log('webcam', ...msg); // eslint-disable-line no-console\n\n/** WebCam configuration */\nexport interface WebCamConfig {\n /**\n * element can be:\n * - string which indicates dom element id\n * - actual HTMLVideo dom element\n * - undefined in which case a new HTMLVideoElement will be created\n */\n element: string | HTMLVideoElement | undefined,\n /** print messages on console */\n debug: boolean,\n /** use front or back camera */\n mode: 'front' | 'back',\n /** camera crop mode */\n crop: boolean,\n /** desired webcam width */\n width: number,\n /** desired webcam height */\n height: number,\n /** deviceId of the video device to use */\n id?: string,\n}\n\nexport class WebCam { // eslint-disable-line @typescript-eslint/no-extraneous-class\n /** current webcam configuration */\n config: WebCamConfig;\n /** instance of dom element associated with webcam stream */\n element: HTMLVideoElement | undefined;\n /** active webcam stream */\n stream: MediaStream | undefined;\n /** enumerated video devices */\n devices: MediaDeviceInfo[] = [];\n\n constructor() {\n this.config = {\n element: undefined,\n debug: true,\n mode: 'front',\n crop: false,\n width: 0,\n height: 0,\n };\n }\n\n /** get active webcam stream track */\n public get track(): MediaStreamTrack | undefined {\n if (!this.stream) return undefined;\n return this.stream.getVideoTracks()[0];\n }\n\n /** get webcam capabilities */\n public get capabilities(): MediaTrackCapabilities | undefined {\n if (!this.track) return undefined;\n return this.track.getCapabilities ? this.track.getCapabilities() : undefined;\n }\n\n /** get webcam constraints */\n public get constraints(): MediaTrackConstraints | undefined {\n if (!this.track) return undefined;\n return this.track.getConstraints ? this.track.getConstraints() : undefined;\n }\n\n /** get webcam settings */\n public get settings(): MediaTrackSettings | undefined {\n if (!this.stream) return undefined;\n const track: MediaStreamTrack = this.stream.getVideoTracks()[0];\n return track.getSettings ? track.getSettings() : undefined;\n }\n\n /** get webcam label */\n public get label(): string {\n if (!this.track) return '';\n return this.track.label;\n }\n\n /** is webcam paused */\n public get paused(): boolean {\n return this.element?.paused || false;\n }\n\n /** webcam current width */\n public get width(): number {\n return this.element?.videoWidth || 0;\n }\n\n /** webcam current height */\n public get height(): number {\n return this.element?.videoHeight || 0;\n }\n\n public enumerate = async (): Promise => {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n this.devices = devices.filter((device) => device.kind === 'videoinput');\n } catch {\n this.devices = [];\n }\n return this.devices;\n };\n\n /** start method initializizes webcam stream and associates it with a dom video element */\n public start = async (webcamConfig?: Partial): Promise => {\n // set config\n if (webcamConfig?.debug) this.config.debug = webcamConfig?.debug;\n if (webcamConfig?.crop) this.config.crop = webcamConfig?.crop;\n if (webcamConfig?.mode) this.config.mode = webcamConfig?.mode;\n if (webcamConfig?.width) this.config.width = webcamConfig?.width;\n if (webcamConfig?.height) this.config.height = webcamConfig?.height;\n if (webcamConfig?.id) this.config.id = webcamConfig?.id;\n\n // use or create dom element\n if (webcamConfig?.element) {\n if (typeof webcamConfig.element === 'string') {\n const el = document.getElementById(webcamConfig.element);\n if (el && el instanceof HTMLVideoElement) {\n this.element = el;\n } else {\n if (this.config.debug) log('webcam', 'cannot get dom element', webcamConfig.element);\n return `webcam error: cannot get dom element: ${webcamConfig.element}`;\n }\n } else if (webcamConfig.element instanceof HTMLVideoElement) {\n this.element = webcamConfig.element;\n } else {\n if (this.config.debug) log('webcam', 'unknown dom element', webcamConfig.element);\n return `webcam error: unknown dom element: ${webcamConfig.element}`;\n }\n } else {\n this.element = document.createElement('video');\n }\n\n // set constraints to use\n const requestedConstraints: MediaStreamConstraints = {\n audio: false,\n video: {\n facingMode: this.config.mode === 'front' ? 'user' : 'environment',\n // @ts-ignore // resizeMode is still not defined in tslib\n resizeMode: this.config.crop ? 'crop-and-scale' : 'none',\n },\n };\n if (this.config?.width > 0) (requestedConstraints.video as MediaTrackConstraints).width = { ideal: this.config.width };\n if (this.config?.height > 0) (requestedConstraints.video as MediaTrackConstraints).height = { ideal: this.config.height };\n if (this.config.id) (requestedConstraints.video as MediaTrackConstraintSet).deviceId = this.config.id;\n\n // set default event listeners\n this.element.addEventListener('play', () => { if (this.config.debug) log('webcam', 'play'); });\n this.element.addEventListener('pause', () => { if (this.config.debug) log('webcam', 'pause'); });\n this.element.addEventListener('click', async () => { // pause when clicked on screen and resume on next click\n if (!this.element || !this.stream) return;\n if (this.element.paused) await this.element.play();\n else this.element.pause();\n });\n\n // get webcam and set it to run in dom element\n if (!navigator?.mediaDevices) {\n if (this.config.debug) log('webcam error', 'no devices');\n return 'webcam error: no devices';\n }\n try {\n this.stream = await navigator.mediaDevices.getUserMedia(requestedConstraints); // get stream that satisfies constraints\n } catch (err) {\n log('webcam', err);\n return `webcam error: ${err}`;\n }\n if (!this.stream) {\n if (this.config.debug) log('webcam error', 'no stream');\n return 'webcam error no stream';\n }\n this.element.srcObject = this.stream; // assign it to dom element\n const ready = new Promise((resolve) => { // wait until stream is ready\n if (!this.element) resolve(false);\n else this.element.onloadeddata = () => resolve(true);\n });\n await ready;\n await this.element.play(); // start playing\n\n if (this.config.debug) {\n log('webcam', {\n width: this.width,\n height: this.height,\n label: this.label,\n stream: this.stream,\n track: this.track,\n settings: this.settings,\n constraints: this.constraints,\n capabilities: this.capabilities,\n });\n }\n return `webcam: ${this.label}`;\n };\n\n /** pause webcam video method */\n public pause = (): void => {\n if (this.element) this.element.pause();\n };\n\n /** play webcam video method */\n public play = async (): Promise => {\n if (this.element) await this.element.play();\n };\n\n /** stop method stops active webcam stream track and disconnects webcam */\n public stop = (): void => {\n if (this.config.debug) log('webcam', 'stop');\n if (this.track) this.track.stop();\n };\n}\n", "{\n \"antispoof\": 853098,\n \"blazeface\": 538928,\n \"centernet\": 4030290,\n \"emotion\": 820516,\n \"facemesh\": 1477958,\n \"faceres\": 6978814,\n \"handlandmark-lite\": 2023432,\n \"handtrack\": 2964837,\n \"iris\": 2599092,\n \"liveness\": 592976,\n \"models\": 0,\n \"movenet-lightning\": 4650216,\n \"affectnet-mobilenet\": 6920630,\n \"age\": 161240,\n \"blazeface-back\": 538928,\n \"blazeface-front\": 402048,\n \"blazepose-detector\": 5928856,\n \"blazepose-full\": 6339202,\n \"blazepose-heavy\": 27502466,\n \"blazepose-lite\": 2726402,\n \"efficientpose\": 5651240,\n \"faceboxes\": 2013002,\n \"facemesh-attention-pinto\": 2387598,\n \"facemesh-attention\": 2382414,\n \"facemesh-detection-full\": 1026192,\n \"facemesh-detection-short\": 201268,\n \"faceres-deep\": 13957620,\n \"gear-e1\": 112438,\n \"gear-e2\": 112438,\n \"gear\": 1498916,\n \"gender-ssrnet-imdb\": 161236,\n \"gender\": 201808,\n \"handdetect\": 3515612,\n \"handlandmark-full\": 5431368,\n \"handlandmark-sparse\": 5286322,\n \"handskeleton\": 5502280,\n \"meet\": 372228,\n \"mobileface\": 2183192,\n \"mobilefacenet\": 5171976,\n \"movenet-multipose\": 9448838,\n \"movenet-thunder\": 12477112,\n \"nanodet\": 7574558,\n \"posenet\": 5032780,\n \"rvm\": 3739355,\n \"selfie\": 212886,\n \"anti-spoofing\": 853098,\n \"efficientpose-i-lite\": 2269064,\n \"efficientpose-ii-lite\": 5651240,\n \"efficientpose-iv\": 25643252,\n \"insightface-efficientnet-b0\": 13013224,\n \"insightface-ghostnet-strides1\": 8093408,\n \"insightface-ghostnet-strides2\": 8049584,\n \"insightface-mobilenet-emore\": 6938536,\n \"insightface-mobilenet-swish\": 12168584,\n \"nanodet-e\": 12319156,\n \"nanodet-g\": 7574558,\n \"nanodet-m\": 1887474,\n \"nanodet-t\": 5294216\n}", "import * as tf from 'dist/tfjs.esm.js';\nimport { log, join } from '../util/util';\nimport type { GraphModel } from './types';\nimport type { Config } from '../config';\nimport * as modelsDefs from '../../models/models.json';\n\nconst options = {\n cacheModels: true,\n cacheSupported: true,\n verbose: true,\n debug: false,\n modelBasePath: '',\n};\n\nexport interface ModelInfo {\n name: string,\n inCache: boolean,\n sizeDesired: number,\n sizeFromManifest: number,\n sizeLoadedWeights: number,\n url: string,\n}\n\nexport const modelStats: Record = {};\n\nasync function httpHandler(url: string, init?: RequestInit): Promise {\n if (options.debug) log('load model fetch:', url, init);\n return fetch(url, init);\n}\n\nexport function setModelLoadOptions(config: Config) {\n options.cacheModels = config.cacheModels;\n options.verbose = config.debug;\n options.modelBasePath = config.modelBasePath;\n}\n\nexport async function loadModel(modelPath: string | undefined): Promise {\n let modelUrl = join(options.modelBasePath, modelPath || '');\n if (!modelUrl.toLowerCase().endsWith('.json')) modelUrl += '.json';\n const modelPathSegments = modelUrl.includes('/') ? modelUrl.split('/') : modelUrl.split('\\\\');\n const shortModelName = modelPathSegments[modelPathSegments.length - 1].replace('.json', '');\n const cachedModelName = 'indexeddb://' + shortModelName; // generate short model name for cache\n modelStats[shortModelName] = {\n name: shortModelName,\n sizeFromManifest: 0,\n sizeLoadedWeights: 0,\n sizeDesired: modelsDefs[shortModelName],\n inCache: false,\n url: '',\n };\n options.cacheSupported = (typeof indexedDB !== 'undefined'); // check if localStorage and indexedb are available\n let cachedModels = {};\n try {\n cachedModels = (options.cacheSupported && options.cacheModels) ? await tf.io.listModels() : {}; // list all models already in cache // this fails for webview although localStorage is defined\n } catch {\n options.cacheSupported = false;\n }\n modelStats[shortModelName].inCache = (options.cacheSupported && options.cacheModels) && Object.keys(cachedModels).includes(cachedModelName); // is model found in cache\n modelStats[shortModelName].url = modelStats[shortModelName].inCache ? cachedModelName : modelUrl;\n const tfLoadOptions = typeof fetch === 'undefined' ? {} : { fetchFunc: (url: string, init?: RequestInit) => httpHandler(url, init) };\n let model: GraphModel = new tf.GraphModel(modelStats[shortModelName].url, tfLoadOptions) as unknown as GraphModel; // create model prototype and decide if load from cache or from original modelurl\n let loaded = false;\n try {\n // @ts-ignore private function\n model.findIOHandler(); // decide how to actually load a model\n if (options.debug) log('model load handler:', model['handler']);\n } catch (err) {\n log('error finding model i/o handler:', modelUrl, err);\n }\n try {\n // @ts-ignore private property\n const artifacts = await model.handler?.load() || null; // load manifest\n modelStats[shortModelName].sizeFromManifest = artifacts?.weightData?.byteLength || 0;\n if (artifacts) model.loadSync(artifacts); // load weights\n else model = await tf.loadGraphModel(modelStats[shortModelName].inCache ? cachedModelName : modelUrl, tfLoadOptions) as unknown as GraphModel;\n // @ts-ignore private property\n modelStats[shortModelName].sizeLoadedWeights = model.artifacts?.weightData?.byteLength || 0;\n if (options.verbose) log('load:', { model: shortModelName, url: model['modelUrl'], bytes: modelStats[shortModelName].sizeLoadedWeights });\n loaded = true;\n } catch (err) {\n log('error loading model:', modelUrl, err);\n }\n if (loaded && options.cacheModels && options.cacheSupported && !modelStats[shortModelName].inCache) { // save model to cache\n try {\n const saveResult = await model.save(cachedModelName);\n if (options.debug) log('model saved:', cachedModelName, saveResult);\n } catch (err) {\n log('error saving model:', modelUrl, err);\n }\n }\n return model;\n}\n", "{\n \"name\": \"@vladmandic/human\",\n \"version\": \"3.2.0\",\n \"description\": \"Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition\",\n \"sideEffects\": false,\n \"main\": \"dist/human.node.js\",\n \"module\": \"dist/human.esm.js\",\n \"browser\": \"dist/human.esm.js\",\n \"types\": \"types/human.d.ts\",\n \"exports\": {\n \"node\": {\n \"require\": \"./dist/human.node.js\",\n \"import\": \"./dist/human.node.js\",\n \"module\": \"./dist/human.node.js\"\n },\n \"require\": \"./dist/human.node.js\",\n \"import\": \"./dist/human.esm.js\",\n \"script\": \"./dist/human.js\",\n \"module\": \"./dist/human.esm.js\",\n \"types\": \"./types/human.d.ts\",\n \"dist/human\": \"./dist/human.js\",\n \"dist/human.js\": \"./dist/human.js\",\n \"dist/human.esm\": \"./dist/human.esm.js\",\n \"dist/human.esm.js\": \"./dist/human.esm.js\",\n \"dist/human.esm-nobundle\": \"./dist/human.esm-nobundle.js\",\n \"dist/human.esm-nobundle.js\": \"./dist/human.esm-nobundle.js\",\n \"dist/human.node\": \"./dist/human.node.js\",\n \"dist/human.node.js\": \"./dist/human.node.js\",\n \"dist/human.node-wasm\": \"./dist/human.node-wasm.js\",\n \"dist/human.node-wasm.js\": \"./dist/human.node-wasm.js\",\n \"dist/human.node-gpu\": \"./dist/human.node-gpu.js\",\n \"dist/human.node-gpu.js\": \"./dist/human.node-gpu.js\"\n },\n \"author\": \"Vladimir Mandic \",\n \"bugs\": {\n \"url\": \"https://github.com/vladmandic/human/issues\"\n },\n \"homepage\": \"https://vladmandic.github.io/human/demo/index.html\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=14.0.0\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/vladmandic/human.git\"\n },\n \"scripts\": {\n \"start\": \"node --no-warnings demo/nodejs/node.js\",\n \"dev\": \"build --profile development\",\n \"clean\": \"build --profile clean\",\n \"build\": \"rimraf test/build.log && node build.js\",\n \"test\": \"node --no-warnings --unhandled-rejections=strict --trace-uncaught test/node.js\",\n \"lint\": \"eslint *.json *.js src demo test models wiki\",\n \"scan\": \"npx auditjs@latest ossi --dev --quiet\"\n },\n \"keywords\": [\n \"human\",\n \"human-library\",\n \"face-detection\",\n \"faceid\",\n \"face-geometry\",\n \"face-embedding\",\n \"face-recognition\",\n \"face-description\",\n \"face-matching\",\n \"body-tracking\",\n \"body-segmentation\",\n \"hand-tracking\",\n \"iris-tracking\",\n \"age-estimation\",\n \"emotion-detection\",\n \"gender-prediction\",\n \"gesture-recognition\",\n \"gaze-tracking\",\n \"age-gender\",\n \"tensorflowjs\",\n \"tfjs\",\n \"tensorflow\"\n ],\n \"devDependencies\": {\n \"@html-eslint/eslint-plugin\": \"^0.21.0\",\n \"@html-eslint/parser\": \"^0.21.0\",\n \"@microsoft/api-extractor\": \"^7.38.4\",\n \"@tensorflow/tfjs-backend-cpu\": \"^4.14.0\",\n \"@tensorflow/tfjs-backend-wasm\": \"^4.14.0\",\n \"@tensorflow/tfjs-backend-webgl\": \"^4.14.0\",\n \"@tensorflow/tfjs-backend-webgpu\": \"4.14.0\",\n \"@tensorflow/tfjs-converter\": \"^4.14.0\",\n \"@tensorflow/tfjs-core\": \"^4.14.0\",\n \"@tensorflow/tfjs-data\": \"^4.14.0\",\n \"@tensorflow/tfjs-layers\": \"^4.14.0\",\n \"@tensorflow/tfjs-node\": \"^4.14.0\",\n \"@tensorflow/tfjs-node-gpu\": \"^4.14.0\",\n \"@types/node\": \"^20.10.3\",\n \"@types/offscreencanvas\": \"^2019.7.3\",\n \"@typescript-eslint/eslint-plugin\": \"^6.13.2\",\n \"@typescript-eslint/parser\": \"^6.13.2\",\n \"@vladmandic/build\": \"^0.9.3\",\n \"@vladmandic/pilogger\": \"^0.4.9\",\n \"@vladmandic/tfjs\": \"github:vladmandic/tfjs\",\n \"canvas\": \"^2.11.2\",\n \"esbuild\": \"^0.19.8\",\n \"eslint\": \"8.55.0\",\n \"eslint-config-airbnb-base\": \"^15.0.0\",\n \"eslint-plugin-html\": \"^7.1.0\",\n \"eslint-plugin-import\": \"^2.29.0\",\n \"eslint-plugin-json\": \"^3.1.0\",\n \"eslint-plugin-markdown\": \"^3.0.1\",\n \"eslint-plugin-node\": \"^11.1.0\",\n \"eslint-plugin-promise\": \"^6.1.1\",\n \"rimraf\": \"^5.0.5\",\n \"tslib\": \"^2.6.2\",\n \"typedoc\": \"0.25.4\",\n \"typescript\": \"~5.3.0\"\n }\n}\n", "/** TFJS custom backend registration */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Human } from '../human';\nimport { log } from '../util/util';\nimport * as image from '../image/image';\nimport type { AnyCanvas } from '../exports';\n\nexport const config = {\n name: 'humangl',\n priority: 999,\n canvas: null as null | AnyCanvas,\n gl: null as null | WebGL2RenderingContext,\n extensions: [] as string[] | null,\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, // default=true\n desynchronized: true, // default=undefined\n },\n};\n\nfunction extensions(): void {\n /*\n https://www.khronos.org/registry/webgl/extensions/\n https://webglreport.com/?v=2\n */\n const gl = config.gl;\n if (!gl) return;\n config.extensions = gl.getSupportedExtensions();\n // gl.getExtension('KHR_parallel_shader_compile');\n}\n\n/**\n * Registers custom WebGL2 backend to be used by Human library\n *\n * @returns void\n */\nexport function register(instance: Human): void {\n // force backend reload if gl context is not valid\n if (instance.config.backend !== 'humangl') return;\n if ((config.name in tf.engine().registry) && !config?.gl?.getParameter(config.gl.VERSION)) {\n log('humangl error: backend invalid context');\n instance.models.reset();\n /*\n log('resetting humangl backend');\n await tf.removeBackend(config.name);\n await register(instance); // re-register\n */\n }\n if (!tf.findBackend(config.name)) {\n try {\n config.canvas = image.canvas(100, 100);\n } catch (err) {\n log('humangl error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas.getContext('webgl2', config.webGLattr) as WebGL2RenderingContext;\n if (!config.gl) {\n log('humangl error: cannot get webgl context');\n return;\n }\n const glv2 = config.gl.getParameter(config.gl.VERSION).includes('2.0');\n if (!glv2) {\n log('backend override: using fallback webgl backend as webgl 2.0 is not detected');\n instance.config.backend = 'webgl';\n return;\n }\n if (config.canvas) {\n config.canvas.addEventListener('webglcontextlost', (e) => {\n log('humangl error:', e.type);\n log('possible browser memory leak using webgl or conflict with multiple backend registrations');\n instance.emit('error');\n throw new Error('backend error: webgl context lost');\n });\n config.canvas.addEventListener('webglcontextrestored', (e) => {\n log('humangl error: context restored:', e);\n });\n config.canvas.addEventListener('webglcontextcreationerror', (e) => {\n log('humangl error: context create:', e);\n });\n }\n } catch (err) {\n log('humangl error: cannot get webgl context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('humangl error: cannot set webgl context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n // @ts-ignore uncompatible kernelMs timing info\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('humangl 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('humangl error: cannot update webgl backend registration:', err);\n return;\n }\n try {\n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_VERSION) tf.env().set('WEBGL_VERSION', 2);\n } catch (err) {\n log('humangl error: cannot set WebGL backend flags:', err);\n return;\n }\n extensions();\n const backend = tf.backend();\n const current = typeof backend['gpgpu'] !== 'undefined' ? backend['getGPGPUContext']().gl : null;\n if (current) {\n if (instance.config.debug) log('humangl backend registered:', { webgl: current.getParameter(current.VERSION) as string, renderer: current.getParameter(current.RENDERER) as string });\n } else {\n log('humangl error: no current gl context:', current, config.gl);\n }\n }\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport type { Tensor } from './types';\n\nexport const constants: Record = {\n tf255: 255.0,\n tf1: 1.0,\n tf2: 2.0,\n tf05: 0.5,\n tf127: 127.5,\n rgb: [0.2989, 0.5870, 0.1140],\n};\n\nexport function init() {\n constants.tf255 = tf.scalar(255.0, 'float32');\n constants.tf1 = tf.scalar(1.0, 'float32');\n constants.tf2 = tf.scalar(2.0, 'float32');\n constants.tf05 = tf.scalar(0.5, 'float32');\n constants.tf127 = tf.scalar(127.5, 'float32');\n constants.rgb = tf.tensor1d([0.2989, 0.5870, 0.1140], 'float32'); // factors for red/green/blue colors when converting to grayscale\n}\n", "/** TFJS backend initialization and customization */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Human, Config, BackendEnum } from '../human';\nimport { log, now } from '../util/util';\nimport { env } from '../util/env';\nimport * as humangl from './humangl';\nimport * as constants from './constants';\nimport type { TensorInfo } from './types';\n\nexport async function getBestBackend(): Promise {\n await env.updateBackend(); // update env on backend init\n if (env.tensorflow?.version) return 'tensorflow';\n if (env.webgpu.supported && env.webgpu.backend) return 'webgpu';\n if (env.webgl.supported && env.webgl.backend) return 'webgl';\n if (env.wasm.supported && env.wasm.backend) return 'wasm';\n return 'cpu';\n}\n\nfunction registerCustomOps(config: Config) {\n const newKernels: string[] = [];\n if (!env.kernels.includes('mod')) {\n const kernelMod = {\n kernelName: 'Mod',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => tf.sub(op.inputs.a, tf.mul(tf.div(op.inputs.a, op.inputs.b), op.inputs.b))),\n };\n tf.registerKernel(kernelMod);\n env.kernels.push('mod');\n newKernels.push('mod');\n }\n if (!env.kernels.includes('floormod')) {\n const kernelFloorMod = {\n kernelName: 'FloorMod',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => tf.add(tf.mul(tf.floorDiv(op.inputs.a, op.inputs.b), op.inputs.b), tf.mod(op.inputs.a, op.inputs.b))),\n };\n tf.registerKernel(kernelFloorMod);\n env.kernels.push('floormod');\n newKernels.push('floormod');\n }\n /*\n if (!env.kernels.includes('atan2') && config.softwareKernels) {\n const kernelAtan2 = {\n kernelName: 'Atan2',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => {\n const backend = tf.getBackend();\n tf.setBackend('cpu');\n const t = tf.atan2(op.inputs.a, op.inputs.b);\n tf.setBackend(backend);\n return t;\n }),\n };\n if (config.debug) log('registered kernel:', 'atan2');\n log('registered kernel:', 'atan2');\n tf.registerKernel(kernelAtan2);\n env.kernels.push('atan2');\n newKernels.push('atan2');\n }\n */\n if (!env.kernels.includes('rotatewithoffset') && config.softwareKernels) {\n const kernelRotateWithOffset = {\n kernelName: 'RotateWithOffset',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => {\n const backend = tf.getBackend();\n tf.setBackend('cpu'); // eslint-disable-line @typescript-eslint/no-floating-promises\n const t = tf.image.rotateWithOffset(op.inputs.image, op.attrs.radians, op.attrs.fillValue, op.attrs.center);\n tf.setBackend(backend); // eslint-disable-line @typescript-eslint/no-floating-promises\n return t;\n }),\n };\n tf.registerKernel(kernelRotateWithOffset);\n env.kernels.push('rotatewithoffset');\n newKernels.push('rotatewithoffset');\n }\n if ((newKernels.length > 0) && config.debug) log('registered kernels:', newKernels);\n}\n\nlet defaultFlags: Record = {};\n\nexport async function check(instance: Human, force = false) {\n instance.state = 'backend';\n if (instance.config.backend?.length === 0) instance.config.backend = await getBestBackend();\n if (force || env.initial || (instance.config.backend && (instance.config.backend.length > 0) && (tf.getBackend() !== instance.config.backend))) {\n const timeStamp = now();\n\n if (instance.config.backend && instance.config.backend.length > 0) {\n // detect web worker\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && instance.config.debug) {\n if (instance.config.debug) log('running inside web worker');\n }\n\n if (typeof navigator !== 'undefined' && navigator?.userAgent?.toLowerCase().includes('electron')) {\n if (instance.config.debug) log('running inside electron');\n }\n\n // check available backends\n let available = Object.keys(tf.engine().registryFactory as Record);\n if (instance.config.backend === 'humangl' && !available.includes('humangl')) {\n humangl.register(instance);\n available = Object.keys(tf.engine().registryFactory as Record);\n }\n if (instance.config.debug) log('available backends:', available);\n\n // force browser vs node backend\n if (env.browser && !env.node && (instance.config.backend === 'tensorflow') && available.includes('webgl')) {\n if (instance.config.debug) log('override: backend set to tensorflow while running in browser');\n instance.config.backend = 'webgl';\n }\n if (env.node && !env.browser && (instance.config.backend === 'webgl' || instance.config.backend === 'humangl') && available.includes('tensorflow')) {\n if (instance.config.debug) log(`override: backend set to ${instance.config.backend} while running in nodejs`);\n instance.config.backend = 'tensorflow';\n }\n\n // handle webgpu\n if (env.browser && instance.config.backend === 'webgpu') {\n if (typeof navigator === 'undefined' || typeof navigator.gpu === 'undefined') {\n log('override: backend set to webgpu but browser does not support webgpu');\n instance.config.backend = 'webgl';\n } else {\n const adapter = await navigator.gpu.requestAdapter();\n if (instance.config.debug) log('enumerated webgpu adapter:', adapter);\n if (!adapter) {\n log('override: backend set to webgpu but browser reports no available gpu');\n instance.config.backend = 'webgl';\n } else {\n // @ts-ignore requestAdapterInfo is not in tslib\n const adapterInfo = 'requestAdapterInfo' in adapter ? await adapter.requestAdapterInfo() : undefined;\n // if (adapter.features) adapter.features.forEach((feature) => log('webgpu features:', feature));\n log('webgpu adapter info:', adapterInfo);\n }\n }\n }\n\n if (!available.includes(instance.config.backend)) {\n log(`error: backend ${instance.config.backend} not found in registry`);\n instance.config.backend = env.node ? 'tensorflow' : 'webgl';\n if (instance.config.debug) log(`override: setting backend ${instance.config.backend}`);\n }\n\n if (instance.config.debug) log('setting backend:', [instance.config.backend]);\n\n // customize wasm\n if (instance.config.backend === 'wasm') {\n // @ts-ignore private property\n if (tf.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY) tf.env().set('CANVAS2D_WILL_READ_FREQUENTLY', true);\n if (instance.config.debug) log('wasm path:', instance.config.wasmPath);\n if (typeof tf.setWasmPaths !== 'undefined') tf.setWasmPaths(instance.config.wasmPath, instance.config.wasmPlatformFetch);\n else throw new Error('backend error: attempting to use wasm backend but wasm path is not set');\n let mt = false;\n let simd = false;\n try {\n mt = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT') as boolean;\n simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT') as boolean;\n if (instance.config.debug) log(`wasm execution: ${simd ? 'simd' : 'no simd'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (instance.config.debug && !simd) log('warning: wasm simd support is not enabled');\n } catch {\n log('wasm detection failed');\n }\n }\n\n try {\n await tf.setBackend(instance.config.backend);\n await tf.ready();\n } catch (err) {\n log('error: cannot set backend:', instance.config.backend, err);\n return false;\n }\n // @ts-ignore private property\n if (instance.config.debug) defaultFlags = JSON.parse(JSON.stringify(tf.env().flags));\n }\n\n // customize humangl\n if (tf.getBackend() === 'humangl' || tf.getBackend() === 'webgl') {\n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', true); // default=false \n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_EXP_CONV) tf.env().set('WEBGL_EXP_CONV', true); // default=false \n // if (tf.env().flagRegistry['WEBGL_PACK_DEPTHWISECONV']) tf.env().set('WEBGL_PACK_DEPTHWISECONV', false); // default=true \n // if (tf.env().flagRegistry.USE_SETTIMEOUTCUSTOM) tf.env().set('USE_SETTIMEOUTCUSTOM', true); // default=false \n // if (tf.env().flagRegistry.CPU_HANDOFF_SIZE_THRESHOLD) tf.env().set('CPU_HANDOFF_SIZE_THRESHOLD', 1024); // default=1000\n // if (tf.env().flagRegistry['WEBGL_FORCE_F16_TEXTURES'] && !instance.config.object.enabled) tf.env().set('WEBGL_FORCE_F16_TEXTURES', true); // safe to use 16bit precision\n if (instance.config.debug && typeof instance.config.deallocate !== 'undefined' && instance.config.deallocate) { // hidden param\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n tf.env().set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n }\n\n // customize webgpu\n if (tf.getBackend() === 'webgpu') {\n // if (tf.env().flagRegistry['WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD']) tf.env().set('WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD', 512);\n // if (tf.env().flagRegistry['WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE']) tf.env().set('WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE', 0);\n // if (tf.env().flagRegistry['WEBGPU_CPU_FORWARD']) tf.env().set('WEBGPU_CPU_FORWARD', true);\n }\n\n if (instance.config.debug) {\n // @ts-ignore private property\n const newFlags = tf.env().flags;\n const updatedFlags = {};\n for (const key of Object.keys(newFlags)) {\n if (defaultFlags[key] === newFlags[key]) continue;\n updatedFlags[key] = newFlags[key];\n }\n if (instance.config.debug && Object.keys(updatedFlags).length > 0) log('backend:', tf.getBackend(), 'flags:', updatedFlags);\n }\n\n if (instance.config.flags && Object.keys(instance.config.flags).length > 0) {\n if (instance.config.debug) log('flags:', instance.config['flags']);\n for (const [key, val] of Object.entries(instance.config.flags)) {\n tf.env().set(key, val as number | boolean);\n }\n }\n\n tf.enableProdMode();\n constants.init();\n instance.performance.initBackend = Math.trunc(now() - timeStamp);\n instance.config.backend = tf.getBackend() as BackendEnum;\n await env.updateBackend(); // update env on backend init\n registerCustomOps(instance.config);\n // await env.updateBackend(); // update env on backend init\n // env.initial = false;\n }\n return true;\n}\n\n// register fake missing tfjs ops\nexport function fakeOps(kernelNames: string[], config) {\n // if (config.debug) log('registerKernel:', kernelNames);\n for (const kernelName of kernelNames) {\n const kernelConfig = {\n kernelName,\n backendName: config.backend,\n kernelFunc: (param): TensorInfo => {\n if (config.debug) log('kernelFunc', kernelName, config.backend, param);\n return param?.inputs?.info as TensorInfo;\n },\n // setupFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n // disposeFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n };\n tf.registerKernel(kernelConfig);\n }\n env.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase()); // re-scan registered ops\n}\n", "/**\n * Module that implements helper draw functions, exposed as human.draw\n */\n\nimport { mergeDeep, now } from '../util/util';\nimport { env } from '../util/env';\nimport { getCanvasContext, rect } from './primitives';\nimport { options } from './options';\nimport { face } from './face';\nimport { body } from './body';\nimport { hand } from './hand';\nimport { object } from './object';\nimport { gesture } from './gesture';\nimport { defaultLabels } from './labels';\nimport type { Result, PersonResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\nlet drawTime = 0;\n\nexport { options } from './options';\nexport { face } from './face';\nexport { body } from './body';\nexport { hand } from './hand';\nexport { object } from './object';\nexport { gesture } from './gesture';\n\n/** draw combined person results instead of individual detection result objects */\nexport function person(inCanvas: AnyCanvas, result: PersonResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n\n for (let i = 0; i < result.length; i++) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\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 const label = `person #${i}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 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(label, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\n/** draw processed canvas */\nexport function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas) {\n if (!input || !output) return;\n const ctx = getCanvasContext(output) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.drawImage(input, 0, 0);\n}\n\n/** meta-function that performs draw for: canvas, face, body, hand */\nexport async function all(inCanvas: AnyCanvas, result: Result, drawOptions?: Partial) {\n if (!result?.performance || !inCanvas) return null;\n const timeStamp = now();\n const localOptions = mergeDeep(options, drawOptions);\n const promise = Promise.all([\n face(inCanvas, result.face, localOptions),\n body(inCanvas, result.body, localOptions),\n hand(inCanvas, result.hand, localOptions),\n object(inCanvas, result.object, localOptions),\n gesture(inCanvas, result.gesture, localOptions), // gestures do not have buffering\n // person(inCanvas, result.persons, localOptions); // already included above\n ]);\n drawTime = env.perfadd ? drawTime + Math.round(now() - timeStamp) : Math.round(now() - timeStamp);\n result.performance.draw = drawTime;\n return promise;\n}\n\n/** sets default label templates for face/body/hand/object/gestures */\nexport function init() {\n options.faceLabels = defaultLabels.face;\n options.bodyLabels = defaultLabels.body;\n options.bodyPartLabels = defaultLabels.bodyPart;\n options.handLabels = defaultLabels.hand;\n options.fingerLabels = defaultLabels.finger;\n options.objectLabels = defaultLabels.object;\n options.gestureLabels = defaultLabels.gesture;\n}\n", "import { log } from '../util/util';\nimport type { AnyCanvas } from '../exports';\nimport type { Point } from '../result';\nimport type { DrawOptions } from './options';\n\nexport const getCanvasContext = (input: AnyCanvas) => {\n if (!input) log('draw error: invalid canvas');\n else if (!input.getContext) log('draw error: canvas context not defined');\n else {\n const ctx = input.getContext('2d', { willReadFrequently: true });\n if (!ctx) log('draw error: cannot get canvas context');\n else return ctx;\n }\n return null;\n};\n\nexport const rad2deg = (theta: number) => Math.round((theta * 180) / Math.PI);\n\nexport const replace = (str: string, source: string, target: string | number) => str.replace(source, typeof target === 'number' ? target.toFixed(1) : target);\n\nexport const colorDepth = (z: number | undefined, opt: DrawOptions): string => { // performance optimization needed\n if (!opt.useDepth || typeof z === 'undefined') return opt.color;\n const rgb = Uint8ClampedArray.from([127 + (2 * z), 127 - (2 * z), 255]);\n return `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${opt.alpha})`;\n};\n\nexport function labels(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, str: string, startX: number, startY: number, localOptions: DrawOptions) {\n const line: string[] = str.replace(/\\[.*\\]/g, '').split('\\n').map((l) => l.trim()); // remove unmatched templates and split into array\n const x = Math.max(0, startX);\n for (let i = line.length - 1; i >= 0; i--) {\n const y = i * localOptions.lineHeight + startY;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(line[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(line[i], x + 4, y + 15);\n }\n}\n\nexport function point(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number, z: number | undefined, localOptions: DrawOptions) {\n ctx.fillStyle = colorDepth(z, localOptions);\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nexport function rect(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number, width: number, height: number, localOptions: DrawOptions) {\n ctx.beginPath();\n ctx.lineWidth = localOptions.lineWidth;\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.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\nexport function lines(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, points: Point[], localOptions: DrawOptions) {\n if (points.length < 2) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n ctx.strokeStyle = colorDepth(pt[2] || 0, localOptions);\n ctx.lineTo(Math.trunc(pt[0]), Math.trunc(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport function curves(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, points: Point[], localOptions: DrawOptions) {\n if (points.length < 2) return;\n ctx.lineWidth = localOptions.lineWidth;\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 function arrow(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, from: Point, to: Point, radius = 5) {\n let angle;\n let x;\n let y;\n ctx.beginPath();\n ctx.moveTo(from[0], from[1]);\n ctx.lineTo(to[0], to[1]);\n angle = Math.atan2(to[1] - from[1], to[0] - from[0]);\n x = radius * Math.cos(angle) + to[0];\n y = radius * Math.sin(angle) + to[1];\n ctx.moveTo(x, y);\n angle += (1.0 / 3.0) * (2 * Math.PI);\n x = radius * Math.cos(angle) + to[0];\n y = radius * Math.sin(angle) + to[1];\n ctx.lineTo(x, y);\n angle += (1.0 / 3.0) * (2 * Math.PI);\n x = radius * Math.cos(angle) + to[0];\n y = radius * Math.sin(angle) + to[1];\n ctx.lineTo(x, y);\n ctx.closePath();\n ctx.stroke();\n ctx.fill();\n}\n", "/** Draw Options\n * - Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n */\n\nexport interface DrawOptions {\n /** draw line color */\n color: string,\n /** alpha value used for lines */\n alpha: number,\n /** label color */\n labelColor: string,\n /** label shadow color */\n shadowColor: string,\n /** label font */\n font: string,\n /** line spacing between labels */\n lineHeight: number,\n /** line width for drawn lines */\n lineWidth: number,\n /** size of drawn points */\n pointSize: number,\n /** draw rounded boxes by n pixels */\n roundRect: number,\n /** should points be drawn? */\n drawPoints: boolean,\n /** should labels be drawn? */\n drawLabels: boolean,\n /** should face attention keypoints be highlighted */\n drawAttention: boolean;\n /** should detected gestures be drawn? */\n drawGestures: boolean,\n /** should draw boxes around detection results? */\n drawBoxes: boolean,\n /** should draw polygons from detection points? */\n drawPolygons: boolean,\n /** should draw gaze arrows? */\n drawGaze: boolean,\n /** should fill polygons? */\n fillPolygons: boolean,\n /** use z-coordinate when available */\n useDepth: boolean,\n /** should lines be curved? */\n useCurves: boolean,\n /** string template for face labels */\n faceLabels: string,\n /** string template for body labels */\n bodyLabels: string,\n /** string template for body part labels */\n bodyPartLabels: string,\n /** string template for hand labels */\n handLabels: string,\n /** string template for hand labels */\n fingerLabels: string,\n /** string template for object labels */\n objectLabels: string,\n /** string template for gesture labels */\n gestureLabels: string,\n}\n\n/** currently set draw options {@link DrawOptions} */\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.6)' as string, // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)' as string, // 'lightblue' with dark alpha channel\n shadowColor: 'black' as string,\n alpha: 0.5 as number,\n font: 'small-caps 16px \"Segoe UI\"' as string,\n lineHeight: 18 as number,\n lineWidth: 4 as number,\n pointSize: 2 as number,\n roundRect: 8 as number,\n drawPoints: false as boolean,\n drawLabels: true as boolean,\n drawBoxes: true as boolean,\n drawAttention: true as boolean,\n drawGestures: true as boolean,\n drawPolygons: true as boolean,\n drawGaze: true as boolean,\n fillPolygons: false as boolean,\n useDepth: true as boolean,\n useCurves: false as boolean,\n faceLabels: '' as string,\n bodyLabels: '' as string,\n bodyPartLabels: '' as string,\n objectLabels: '' as string,\n handLabels: '' as string,\n fingerLabels: '' as string,\n gestureLabels: '' as string,\n};\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nexport const meshAnnotations: Record = {\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], // 11\n // lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291], // 10\n // lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308], // 11\n // lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308], // 11\n lipsUpperOuter: [185, 40, 39, 37, 0, 267, 269, 270, 409],\n lipsLowerOuter: [61, 146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [191, 80, 81, 82, 13, 312, 311, 310, 415],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n lipsLowerSemiOuter: [76, 77, 90, 180, 85, 16, 315, 404, 320, 307, 306],\n lipsUpperSemiOuter: [184, 74, 73, 72, 11, 302, 303, 304, 408],\n lipsLowerSemiInner: [62, 96, 89, 179, 86, 15, 316, 403, 319, 325, 292],\n lipsUpperSemiInner: [183, 42, 41, 38, 12, 268, 271, 272, 407],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173], // 7\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133], // 9\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190], // 7\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243], // 9\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189], // 7\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244], // 9\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245], // 9\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193], // 8\n rightEyebrowLower: [35, 124, 46, 53, 52, 65], // 6\n rightEyeIris: [473, 474, 475, 476, 477], // 5\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 meshLandmarks: Record = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, meshAnnotations.midwayBetweenEyes[0]],\n};\n\nexport const blazeFaceLandmarks: Record = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nexport const irisIndices: { key: string, indices: number[] }[] = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] }, // 7 x 3d\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] }, // 7 x 3d\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] }, // 7 x 3d\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] }, // 7 x 3d\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] }, // 9 x 3d\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] }, // 9 x 3d\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] }, // 9 x 3d\n { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] }, // 8 x 3d\n { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] }, // 6 x 3d\n];\n\nexport const UV468: [number, number][] = [\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: number[] = [\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: number[] = [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: number[] = [\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: number[] = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68: number[] = [\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: number[] = [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: number[] = [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\n// https://github.com/tensorflow/tfjs-models/blob/master/face-landmarks-detection/src/constants.ts\n// https://github.com/google/mediapipe/mediapipe/python/solutions/face_mesh_connections.py\n\ntype PairArray = [number, number][];\n\nfunction connectionsToIndices(connections: PairArray) {\n const indices = connections.map((connection) => connection[0]);\n indices.push(connections[connections.length - 1][1]);\n return indices;\n}\n\nexport const pairsLips: PairArray = [\n [61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314], [314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40], [40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270], [270, 409], [409, 291],\n [78, 95], [95, 88], [88, 178], [178, 87], [87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308], [78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312], [312, 311], [311, 310], [310, 415], [415, 308],\n];\n\nexport const pairsLeftEye: PairArray = [[263, 249], [249, 390], [390, 373], [373, 374], [374, 380], [380, 381], [381, 382], [382, 362], [263, 466], [466, 388], [388, 387], [387, 386], [386, 385], [385, 384], [384, 398], [398, 362]];\n\nexport const pairsLeftEyebrow: PairArray = [[276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]];\n\nexport const pairsLeftIris: PairArray = [[474, 475], [475, 476], [476, 477], [477, 474]];\n\nexport const pairsRightEye: PairArray = [[33, 7], [7, 163], [163, 144], [144, 145], [145, 153], [153, 154], [154, 155], [155, 133], [33, 246], [246, 161], [161, 160], [160, 159], [159, 158], [158, 157], [157, 173], [173, 133]];\n\nexport const pairsRightEyebrow: PairArray = [[46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]];\n\nexport const pairsRightIris: PairArray = [[469, 470], [470, 471], [471, 472], [472, 469]];\n\nexport const pairsFaceContour: PairArray = [\n [10, 338], [338, 297], [297, 332], [332, 284], [284, 251], [251, 389],\n [389, 356], [356, 454], [454, 323], [323, 361], [361, 288], [288, 397],\n [397, 365], [365, 379], [379, 378], [378, 400], [400, 377], [377, 152],\n [152, 148], [148, 176], [176, 149], [149, 150], [150, 136], [136, 172],\n [172, 58], [58, 132], [132, 93], [93, 234], [234, 127], [127, 162],\n [162, 21], [21, 54], [54, 103], [103, 67], [67, 109], [109, 10],\n];\n\nexport const contourKeypoints = {\n lips: connectionsToIndices(pairsLips),\n leftEye: connectionsToIndices(pairsLeftEye),\n leftEyebrow: connectionsToIndices(pairsLeftEyebrow),\n leftIris: connectionsToIndices(pairsLeftIris),\n rightEye: connectionsToIndices(pairsRightEye),\n rightEyebrow: connectionsToIndices(pairsRightEyebrow),\n rightIris: connectionsToIndices(pairsRightIris),\n faceOval: connectionsToIndices(pairsFaceContour),\n};\n\nexport const pairsFaceMesh: PairArray = [\n [127, 34], [34, 139], [139, 127], [11, 0], [0, 37], [37, 11],\n [232, 231], [231, 120], [120, 232], [72, 37], [37, 39], [39, 72],\n [128, 121], [121, 47], [47, 128], [232, 121], [121, 128], [128, 232],\n [104, 69], [69, 67], [67, 104], [175, 171], [171, 148], [148, 175],\n [118, 50], [50, 101], [101, 118], [73, 39], [39, 40], [40, 73],\n [9, 151], [151, 108], [108, 9], [48, 115], [115, 131], [131, 48],\n [194, 204], [204, 211], [211, 194], [74, 40], [40, 185], [185, 74],\n [80, 42], [42, 183], [183, 80], [40, 92], [92, 186], [186, 40],\n [230, 229], [229, 118], [118, 230], [202, 212], [212, 214], [214, 202],\n [83, 18], [18, 17], [17, 83], [76, 61], [61, 146], [146, 76],\n [160, 29], [29, 30], [30, 160], [56, 157], [157, 173], [173, 56],\n [106, 204], [204, 194], [194, 106], [135, 214], [214, 192], [192, 135],\n [203, 165], [165, 98], [98, 203], [21, 71], [71, 68], [68, 21],\n [51, 45], [45, 4], [4, 51], [144, 24], [24, 23], [23, 144],\n [77, 146], [146, 91], [91, 77], [205, 50], [50, 187], [187, 205],\n [201, 200], [200, 18], [18, 201], [91, 106], [106, 182], [182, 91],\n [90, 91], [91, 181], [181, 90], [85, 84], [84, 17], [17, 85],\n [206, 203], [203, 36], [36, 206], [148, 171], [171, 140], [140, 148],\n [92, 40], [40, 39], [39, 92], [193, 189], [189, 244], [244, 193],\n [159, 158], [158, 28], [28, 159], [247, 246], [246, 161], [161, 247],\n [236, 3], [3, 196], [196, 236], [54, 68], [68, 104], [104, 54],\n [193, 168], [168, 8], [8, 193], [117, 228], [228, 31], [31, 117],\n [189, 193], [193, 55], [55, 189], [98, 97], [97, 99], [99, 98],\n [126, 47], [47, 100], [100, 126], [166, 79], [79, 218], [218, 166],\n [155, 154], [154, 26], [26, 155], [209, 49], [49, 131], [131, 209],\n [135, 136], [136, 150], [150, 135], [47, 126], [126, 217], [217, 47],\n [223, 52], [52, 53], [53, 223], [45, 51], [51, 134], [134, 45],\n [211, 170], [170, 140], [140, 211], [67, 69], [69, 108], [108, 67],\n [43, 106], [106, 91], [91, 43], [230, 119], [119, 120], [120, 230],\n [226, 130], [130, 247], [247, 226], [63, 53], [53, 52], [52, 63],\n [238, 20], [20, 242], [242, 238], [46, 70], [70, 156], [156, 46],\n [78, 62], [62, 96], [96, 78], [46, 53], [53, 63], [63, 46],\n [143, 34], [34, 227], [227, 143], [123, 117], [117, 111], [111, 123],\n [44, 125], [125, 19], [19, 44], [236, 134], [134, 51], [51, 236],\n [216, 206], [206, 205], [205, 216], [154, 153], [153, 22], [22, 154],\n [39, 37], [37, 167], [167, 39], [200, 201], [201, 208], [208, 200],\n [36, 142], [142, 100], [100, 36], [57, 212], [212, 202], [202, 57],\n [20, 60], [60, 99], [99, 20], [28, 158], [158, 157], [157, 28],\n [35, 226], [226, 113], [113, 35], [160, 159], [159, 27], [27, 160],\n [204, 202], [202, 210], [210, 204], [113, 225], [225, 46], [46, 113],\n [43, 202], [202, 204], [204, 43], [62, 76], [76, 77], [77, 62],\n [137, 123], [123, 116], [116, 137], [41, 38], [38, 72], [72, 41],\n [203, 129], [129, 142], [142, 203], [64, 98], [98, 240], [240, 64],\n [49, 102], [102, 64], [64, 49], [41, 73], [73, 74], [74, 41],\n [212, 216], [216, 207], [207, 212], [42, 74], [74, 184], [184, 42],\n [169, 170], [170, 211], [211, 169], [170, 149], [149, 176], [176, 170],\n [105, 66], [66, 69], [69, 105], [122, 6], [6, 168], [168, 122],\n [123, 147], [147, 187], [187, 123], [96, 77], [77, 90], [90, 96],\n [65, 55], [55, 107], [107, 65], [89, 90], [90, 180], [180, 89],\n [101, 100], [100, 120], [120, 101], [63, 105], [105, 104], [104, 63],\n [93, 137], [137, 227], [227, 93], [15, 86], [86, 85], [85, 15],\n [129, 102], [102, 49], [49, 129], [14, 87], [87, 86], [86, 14],\n [55, 8], [8, 9], [9, 55], [100, 47], [47, 121], [121, 100],\n [145, 23], [23, 22], [22, 145], [88, 89], [89, 179], [179, 88],\n [6, 122], [122, 196], [196, 6], [88, 95], [95, 96], [96, 88],\n [138, 172], [172, 136], [136, 138], [215, 58], [58, 172], [172, 215],\n [115, 48], [48, 219], [219, 115], [42, 80], [80, 81], [81, 42],\n [195, 3], [3, 51], [51, 195], [43, 146], [146, 61], [61, 43],\n [171, 175], [175, 199], [199, 171], [81, 82], [82, 38], [38, 81],\n [53, 46], [46, 225], [225, 53], [144, 163], [163, 110], [110, 144],\n [52, 65], [65, 66], [66, 52], [229, 228], [228, 117], [117, 229],\n [34, 127], [127, 234], [234, 34], [107, 108], [108, 69], [69, 107],\n [109, 108], [108, 151], [151, 109], [48, 64], [64, 235], [235, 48],\n [62, 78], [78, 191], [191, 62], [129, 209], [209, 126], [126, 129],\n [111, 35], [35, 143], [143, 111], [117, 123], [123, 50], [50, 117],\n [222, 65], [65, 52], [52, 222], [19, 125], [125, 141], [141, 19],\n [221, 55], [55, 65], [65, 221], [3, 195], [195, 197], [197, 3],\n [25, 7], [7, 33], [33, 25], [220, 237], [237, 44], [44, 220],\n [70, 71], [71, 139], [139, 70], [122, 193], [193, 245], [245, 122],\n [247, 130], [130, 33], [33, 247], [71, 21], [21, 162], [162, 71],\n [170, 169], [169, 150], [150, 170], [188, 174], [174, 196], [196, 188],\n [216, 186], [186, 92], [92, 216], [2, 97], [97, 167], [167, 2],\n [141, 125], [125, 241], [241, 141], [164, 167], [167, 37], [37, 164],\n [72, 38], [38, 12], [12, 72], [38, 82], [82, 13], [13, 38],\n [63, 68], [68, 71], [71, 63], [226, 35], [35, 111], [111, 226],\n [101, 50], [50, 205], [205, 101], [206, 92], [92, 165], [165, 206],\n [209, 198], [198, 217], [217, 209], [165, 167], [167, 97], [97, 165],\n [220, 115], [115, 218], [218, 220], [133, 112], [112, 243], [243, 133],\n [239, 238], [238, 241], [241, 239], [214, 135], [135, 169], [169, 214],\n [190, 173], [173, 133], [133, 190], [171, 208], [208, 32], [32, 171],\n [125, 44], [44, 237], [237, 125], [86, 87], [87, 178], [178, 86],\n [85, 86], [86, 179], [179, 85], [84, 85], [85, 180], [180, 84],\n [83, 84], [84, 181], [181, 83], [201, 83], [83, 182], [182, 201],\n [137, 93], [93, 132], [132, 137], [76, 62], [62, 183], [183, 76],\n [61, 76], [76, 184], [184, 61], [57, 61], [61, 185], [185, 57],\n [212, 57], [57, 186], [186, 212], [214, 207], [207, 187], [187, 214],\n [34, 143], [143, 156], [156, 34], [79, 239], [239, 237], [237, 79],\n [123, 137], [137, 177], [177, 123], [44, 1], [1, 4], [4, 44],\n [201, 194], [194, 32], [32, 201], [64, 102], [102, 129], [129, 64],\n [213, 215], [215, 138], [138, 213], [59, 166], [166, 219], [219, 59],\n [242, 99], [99, 97], [97, 242], [2, 94], [94, 141], [141, 2],\n [75, 59], [59, 235], [235, 75], [24, 110], [110, 228], [228, 24],\n [25, 130], [130, 226], [226, 25], [23, 24], [24, 229], [229, 23],\n [22, 23], [23, 230], [230, 22], [26, 22], [22, 231], [231, 26],\n [112, 26], [26, 232], [232, 112], [189, 190], [190, 243], [243, 189],\n [221, 56], [56, 190], [190, 221], [28, 56], [56, 221], [221, 28],\n [27, 28], [28, 222], [222, 27], [29, 27], [27, 223], [223, 29],\n [30, 29], [29, 224], [224, 30], [247, 30], [30, 225], [225, 247],\n [238, 79], [79, 20], [20, 238], [166, 59], [59, 75], [75, 166],\n [60, 75], [75, 240], [240, 60], [147, 177], [177, 215], [215, 147],\n [20, 79], [79, 166], [166, 20], [187, 147], [147, 213], [213, 187],\n [112, 233], [233, 244], [244, 112], [233, 128], [128, 245], [245, 233],\n [128, 114], [114, 188], [188, 128], [114, 217], [217, 174], [174, 114],\n [131, 115], [115, 220], [220, 131], [217, 198], [198, 236], [236, 217],\n [198, 131], [131, 134], [134, 198], [177, 132], [132, 58], [58, 177],\n [143, 35], [35, 124], [124, 143], [110, 163], [163, 7], [7, 110],\n [228, 110], [110, 25], [25, 228], [356, 389], [389, 368], [368, 356],\n [11, 302], [302, 267], [267, 11], [452, 350], [350, 349], [349, 452],\n [302, 303], [303, 269], [269, 302], [357, 343], [343, 277], [277, 357],\n [452, 453], [453, 357], [357, 452], [333, 332], [332, 297], [297, 333],\n [175, 152], [152, 377], [377, 175], [347, 348], [348, 330], [330, 347],\n [303, 304], [304, 270], [270, 303], [9, 336], [336, 337], [337, 9],\n [278, 279], [279, 360], [360, 278], [418, 262], [262, 431], [431, 418],\n [304, 408], [408, 409], [409, 304], [310, 415], [415, 407], [407, 310],\n [270, 409], [409, 410], [410, 270], [450, 348], [348, 347], [347, 450],\n [422, 430], [430, 434], [434, 422], [313, 314], [314, 17], [17, 313],\n [306, 307], [307, 375], [375, 306], [387, 388], [388, 260], [260, 387],\n [286, 414], [414, 398], [398, 286], [335, 406], [406, 418], [418, 335],\n [364, 367], [367, 416], [416, 364], [423, 358], [358, 327], [327, 423],\n [251, 284], [284, 298], [298, 251], [281, 5], [5, 4], [4, 281],\n [373, 374], [374, 253], [253, 373], [307, 320], [320, 321], [321, 307],\n [425, 427], [427, 411], [411, 425], [421, 313], [313, 18], [18, 421],\n [321, 405], [405, 406], [406, 321], [320, 404], [404, 405], [405, 320],\n [315, 16], [16, 17], [17, 315], [426, 425], [425, 266], [266, 426],\n [377, 400], [400, 369], [369, 377], [322, 391], [391, 269], [269, 322],\n [417, 465], [465, 464], [464, 417], [386, 257], [257, 258], [258, 386],\n [466, 260], [260, 388], [388, 466], [456, 399], [399, 419], [419, 456],\n [284, 332], [332, 333], [333, 284], [417, 285], [285, 8], [8, 417],\n [346, 340], [340, 261], [261, 346], [413, 441], [441, 285], [285, 413],\n [327, 460], [460, 328], [328, 327], [355, 371], [371, 329], [329, 355],\n [392, 439], [439, 438], [438, 392], [382, 341], [341, 256], [256, 382],\n [429, 420], [420, 360], [360, 429], [364, 394], [394, 379], [379, 364],\n [277, 343], [343, 437], [437, 277], [443, 444], [444, 283], [283, 443],\n [275, 440], [440, 363], [363, 275], [431, 262], [262, 369], [369, 431],\n [297, 338], [338, 337], [337, 297], [273, 375], [375, 321], [321, 273],\n [450, 451], [451, 349], [349, 450], [446, 342], [342, 467], [467, 446],\n [293, 334], [334, 282], [282, 293], [458, 461], [461, 462], [462, 458],\n [276, 353], [353, 383], [383, 276], [308, 324], [324, 325], [325, 308],\n [276, 300], [300, 293], [293, 276], [372, 345], [345, 447], [447, 372],\n [352, 345], [345, 340], [340, 352], [274, 1], [1, 19], [19, 274],\n [456, 248], [248, 281], [281, 456], [436, 427], [427, 425], [425, 436],\n [381, 256], [256, 252], [252, 381], [269, 391], [391, 393], [393, 269],\n [200, 199], [199, 428], [428, 200], [266, 330], [330, 329], [329, 266],\n [287, 273], [273, 422], [422, 287], [250, 462], [462, 328], [328, 250],\n [258, 286], [286, 384], [384, 258], [265, 353], [353, 342], [342, 265],\n [387, 259], [259, 257], [257, 387], [424, 431], [431, 430], [430, 424],\n [342, 353], [353, 276], [276, 342], [273, 335], [335, 424], [424, 273],\n [292, 325], [325, 307], [307, 292], [366, 447], [447, 345], [345, 366],\n [271, 303], [303, 302], [302, 271], [423, 266], [266, 371], [371, 423],\n [294, 455], [455, 460], [460, 294], [279, 278], [278, 294], [294, 279],\n [271, 272], [272, 304], [304, 271], [432, 434], [434, 427], [427, 432],\n [272, 407], [407, 408], [408, 272], [394, 430], [430, 431], [431, 394],\n [395, 369], [369, 400], [400, 395], [334, 333], [333, 299], [299, 334],\n [351, 417], [417, 168], [168, 351], [352, 280], [280, 411], [411, 352],\n [325, 319], [319, 320], [320, 325], [295, 296], [296, 336], [336, 295],\n [319, 403], [403, 404], [404, 319], [330, 348], [348, 349], [349, 330],\n [293, 298], [298, 333], [333, 293], [323, 454], [454, 447], [447, 323],\n [15, 16], [16, 315], [315, 15], [358, 429], [429, 279], [279, 358],\n [14, 15], [15, 316], [316, 14], [285, 336], [336, 9], [9, 285],\n [329, 349], [349, 350], [350, 329], [374, 380], [380, 252], [252, 374],\n [318, 402], [402, 403], [403, 318], [6, 197], [197, 419], [419, 6],\n [318, 319], [319, 325], [325, 318], [367, 364], [364, 365], [365, 367],\n [435, 367], [367, 397], [397, 435], [344, 438], [438, 439], [439, 344],\n [272, 271], [271, 311], [311, 272], [195, 5], [5, 281], [281, 195],\n [273, 287], [287, 291], [291, 273], [396, 428], [428, 199], [199, 396],\n [311, 271], [271, 268], [268, 311], [283, 444], [444, 445], [445, 283],\n [373, 254], [254, 339], [339, 373], [282, 334], [334, 296], [296, 282],\n [449, 347], [347, 346], [346, 449], [264, 447], [447, 454], [454, 264],\n [336, 296], [296, 299], [299, 336], [338, 10], [10, 151], [151, 338],\n [278, 439], [439, 455], [455, 278], [292, 407], [407, 415], [415, 292],\n [358, 371], [371, 355], [355, 358], [340, 345], [345, 372], [372, 340],\n [346, 347], [347, 280], [280, 346], [442, 443], [443, 282], [282, 442],\n [19, 94], [94, 370], [370, 19], [441, 442], [442, 295], [295, 441],\n [248, 419], [419, 197], [197, 248], [263, 255], [255, 359], [359, 263],\n [440, 275], [275, 274], [274, 440], [300, 383], [383, 368], [368, 300],\n [351, 412], [412, 465], [465, 351], [263, 467], [467, 466], [466, 263],\n [301, 368], [368, 389], [389, 301], [395, 378], [378, 379], [379, 395],\n [412, 351], [351, 419], [419, 412], [436, 426], [426, 322], [322, 436],\n [2, 164], [164, 393], [393, 2], [370, 462], [462, 461], [461, 370],\n [164, 0], [0, 267], [267, 164], [302, 11], [11, 12], [12, 302],\n [268, 12], [12, 13], [13, 268], [293, 300], [300, 301], [301, 293],\n [446, 261], [261, 340], [340, 446], [330, 266], [266, 425], [425, 330],\n [426, 423], [423, 391], [391, 426], [429, 355], [355, 437], [437, 429],\n [391, 327], [327, 326], [326, 391], [440, 457], [457, 438], [438, 440],\n [341, 382], [382, 362], [362, 341], [459, 457], [457, 461], [461, 459],\n [434, 430], [430, 394], [394, 434], [414, 463], [463, 362], [362, 414],\n [396, 369], [369, 262], [262, 396], [354, 461], [461, 457], [457, 354],\n [316, 403], [403, 402], [402, 316], [315, 404], [404, 403], [403, 315],\n [314, 405], [405, 404], [404, 314], [313, 406], [406, 405], [405, 313],\n [421, 418], [418, 406], [406, 421], [366, 401], [401, 361], [361, 366],\n [306, 408], [408, 407], [407, 306], [291, 409], [409, 408], [408, 291],\n [287, 410], [410, 409], [409, 287], [432, 436], [436, 410], [410, 432],\n [434, 416], [416, 411], [411, 434], [264, 368], [368, 383], [383, 264],\n [309, 438], [438, 457], [457, 309], [352, 376], [376, 401], [401, 352],\n [274, 275], [275, 4], [4, 274], [421, 428], [428, 262], [262, 421],\n [294, 327], [327, 358], [358, 294], [433, 416], [416, 367], [367, 433],\n [289, 455], [455, 439], [439, 289], [462, 370], [370, 326], [326, 462],\n [2, 326], [326, 370], [370, 2], [305, 460], [460, 455], [455, 305],\n [254, 449], [449, 448], [448, 254], [255, 261], [261, 446], [446, 255],\n [253, 450], [450, 449], [449, 253], [252, 451], [451, 450], [450, 252],\n [256, 452], [452, 451], [451, 256], [341, 453], [453, 452], [452, 341],\n [413, 464], [464, 463], [463, 413], [441, 413], [413, 414], [414, 441],\n [258, 442], [442, 441], [441, 258], [257, 443], [443, 442], [442, 257],\n [259, 444], [444, 443], [443, 259], [260, 445], [445, 444], [444, 260],\n [467, 342], [342, 445], [445, 467], [459, 458], [458, 250], [250, 459],\n [289, 392], [392, 290], [290, 289], [290, 328], [328, 460], [460, 290],\n [376, 433], [433, 435], [435, 376], [250, 290], [290, 392], [392, 250],\n [411, 416], [416, 433], [433, 411], [341, 463], [463, 464], [464, 341],\n [453, 464], [464, 465], [465, 453], [357, 465], [465, 412], [412, 357],\n [343, 412], [412, 399], [399, 343], [360, 363], [363, 440], [440, 360],\n [437, 399], [399, 456], [456, 437], [420, 456], [456, 363], [363, 420],\n [401, 435], [435, 288], [288, 401], [372, 383], [383, 353], [353, 372],\n [339, 255], [255, 249], [249, 339], [448, 261], [261, 255], [255, 448],\n [133, 243], [243, 190], [190, 133], [133, 155], [155, 112], [112, 133],\n [33, 246], [246, 247], [247, 33], [33, 130], [130, 25], [25, 33],\n [398, 384], [384, 286], [286, 398], [362, 398], [398, 414], [414, 362],\n [362, 463], [463, 341], [341, 362], [263, 359], [359, 467], [467, 263],\n [263, 249], [249, 255], [255, 263], [466, 467], [467, 260], [260, 466],\n [75, 60], [60, 166], [166, 75], [238, 239], [239, 79], [79, 238],\n [162, 127], [127, 139], [139, 162], [72, 11], [11, 37], [37, 72],\n [121, 232], [232, 120], [120, 121], [73, 72], [72, 39], [39, 73],\n [114, 128], [128, 47], [47, 114], [233, 232], [232, 128], [128, 233],\n [103, 104], [104, 67], [67, 103], [152, 175], [175, 148], [148, 152],\n [119, 118], [118, 101], [101, 119], [74, 73], [73, 40], [40, 74],\n [107, 9], [9, 108], [108, 107], [49, 48], [48, 131], [131, 49],\n [32, 194], [194, 211], [211, 32], [184, 74], [74, 185], [185, 184],\n [191, 80], [80, 183], [183, 191], [185, 40], [40, 186], [186, 185],\n [119, 230], [230, 118], [118, 119], [210, 202], [202, 214], [214, 210],\n [84, 83], [83, 17], [17, 84], [77, 76], [76, 146], [146, 77],\n [161, 160], [160, 30], [30, 161], [190, 56], [56, 173], [173, 190],\n [182, 106], [106, 194], [194, 182], [138, 135], [135, 192], [192, 138],\n [129, 203], [203, 98], [98, 129], [54, 21], [21, 68], [68, 54],\n [5, 51], [51, 4], [4, 5], [145, 144], [144, 23], [23, 145],\n [90, 77], [77, 91], [91, 90], [207, 205], [205, 187], [187, 207],\n [83, 201], [201, 18], [18, 83], [181, 91], [91, 182], [182, 181],\n [180, 90], [90, 181], [181, 180], [16, 85], [85, 17], [17, 16],\n [205, 206], [206, 36], [36, 205], [176, 148], [148, 140], [140, 176],\n [165, 92], [92, 39], [39, 165], [245, 193], [193, 244], [244, 245],\n [27, 159], [159, 28], [28, 27], [30, 247], [247, 161], [161, 30],\n [174, 236], [236, 196], [196, 174], [103, 54], [54, 104], [104, 103],\n [55, 193], [193, 8], [8, 55], [111, 117], [117, 31], [31, 111],\n [221, 189], [189, 55], [55, 221], [240, 98], [98, 99], [99, 240],\n [142, 126], [126, 100], [100, 142], [219, 166], [166, 218], [218, 219],\n [112, 155], [155, 26], [26, 112], [198, 209], [209, 131], [131, 198],\n [169, 135], [135, 150], [150, 169], [114, 47], [47, 217], [217, 114],\n [224, 223], [223, 53], [53, 224], [220, 45], [45, 134], [134, 220],\n [32, 211], [211, 140], [140, 32], [109, 67], [67, 108], [108, 109],\n [146, 43], [43, 91], [91, 146], [231, 230], [230, 120], [120, 231],\n [113, 226], [226, 247], [247, 113], [105, 63], [63, 52], [52, 105],\n [241, 238], [238, 242], [242, 241], [124, 46], [46, 156], [156, 124],\n [95, 78], [78, 96], [96, 95], [70, 46], [46, 63], [63, 70],\n [116, 143], [143, 227], [227, 116], [116, 123], [123, 111], [111, 116],\n [1, 44], [44, 19], [19, 1], [3, 236], [236, 51], [51, 3],\n [207, 216], [216, 205], [205, 207], [26, 154], [154, 22], [22, 26],\n [165, 39], [39, 167], [167, 165], [199, 200], [200, 208], [208, 199],\n [101, 36], [36, 100], [100, 101], [43, 57], [57, 202], [202, 43],\n [242, 20], [20, 99], [99, 242], [56, 28], [28, 157], [157, 56],\n [124, 35], [35, 113], [113, 124], [29, 160], [160, 27], [27, 29],\n [211, 204], [204, 210], [210, 211], [124, 113], [113, 46], [46, 124],\n [106, 43], [43, 204], [204, 106], [96, 62], [62, 77], [77, 96],\n [227, 137], [137, 116], [116, 227], [73, 41], [41, 72], [72, 73],\n [36, 203], [203, 142], [142, 36], [235, 64], [64, 240], [240, 235],\n [48, 49], [49, 64], [64, 48], [42, 41], [41, 74], [74, 42],\n [214, 212], [212, 207], [207, 214], [183, 42], [42, 184], [184, 183],\n [210, 169], [169, 211], [211, 210], [140, 170], [170, 176], [176, 140],\n [104, 105], [105, 69], [69, 104], [193, 122], [122, 168], [168, 193],\n [50, 123], [123, 187], [187, 50], [89, 96], [96, 90], [90, 89],\n [66, 65], [65, 107], [107, 66], [179, 89], [89, 180], [180, 179],\n [119, 101], [101, 120], [120, 119], [68, 63], [63, 104], [104, 68],\n [234, 93], [93, 227], [227, 234], [16, 15], [15, 85], [85, 16],\n [209, 129], [129, 49], [49, 209], [15, 14], [14, 86], [86, 15],\n [107, 55], [55, 9], [9, 107], [120, 100], [100, 121], [121, 120],\n [153, 145], [145, 22], [22, 153], [178, 88], [88, 179], [179, 178],\n [197, 6], [6, 196], [196, 197], [89, 88], [88, 96], [96, 89],\n [135, 138], [138, 136], [136, 135], [138, 215], [215, 172], [172, 138],\n [218, 115], [115, 219], [219, 218], [41, 42], [42, 81], [81, 41],\n [5, 195], [195, 51], [51, 5], [57, 43], [43, 61], [61, 57],\n [208, 171], [171, 199], [199, 208], [41, 81], [81, 38], [38, 41],\n [224, 53], [53, 225], [225, 224], [24, 144], [144, 110], [110, 24],\n [105, 52], [52, 66], [66, 105], [118, 229], [229, 117], [117, 118],\n [227, 34], [34, 234], [234, 227], [66, 107], [107, 69], [69, 66],\n [10, 109], [109, 151], [151, 10], [219, 48], [48, 235], [235, 219],\n [183, 62], [62, 191], [191, 183], [142, 129], [129, 126], [126, 142],\n [116, 111], [111, 143], [143, 116], [118, 117], [117, 50], [50, 118],\n [223, 222], [222, 52], [52, 223], [94, 19], [19, 141], [141, 94],\n [222, 221], [221, 65], [65, 222], [196, 3], [3, 197], [197, 196],\n [45, 220], [220, 44], [44, 45], [156, 70], [70, 139], [139, 156],\n [188, 122], [122, 245], [245, 188], [139, 71], [71, 162], [162, 139],\n [149, 170], [170, 150], [150, 149], [122, 188], [188, 196], [196, 122],\n [206, 216], [216, 92], [92, 206], [164, 2], [2, 167], [167, 164],\n [242, 141], [141, 241], [241, 242], [0, 164], [164, 37], [37, 0],\n [11, 72], [72, 12], [12, 11], [12, 38], [38, 13], [13, 12],\n [70, 63], [63, 71], [71, 70], [31, 226], [226, 111], [111, 31],\n [36, 101], [101, 205], [205, 36], [203, 206], [206, 165], [165, 203],\n [126, 209], [209, 217], [217, 126], [98, 165], [165, 97], [97, 98],\n [237, 220], [220, 218], [218, 237], [237, 239], [239, 241], [241, 237],\n [210, 214], [214, 169], [169, 210], [140, 171], [171, 32], [32, 140],\n [241, 125], [125, 237], [237, 241], [179, 86], [86, 178], [178, 179],\n [180, 85], [85, 179], [179, 180], [181, 84], [84, 180], [180, 181],\n [182, 83], [83, 181], [181, 182], [194, 201], [201, 182], [182, 194],\n [177, 137], [137, 132], [132, 177], [184, 76], [76, 183], [183, 184],\n [185, 61], [61, 184], [184, 185], [186, 57], [57, 185], [185, 186],\n [216, 212], [212, 186], [186, 216], [192, 214], [214, 187], [187, 192],\n [139, 34], [34, 156], [156, 139], [218, 79], [79, 237], [237, 218],\n [147, 123], [123, 177], [177, 147], [45, 44], [44, 4], [4, 45],\n [208, 201], [201, 32], [32, 208], [98, 64], [64, 129], [129, 98],\n [192, 213], [213, 138], [138, 192], [235, 59], [59, 219], [219, 235],\n [141, 242], [242, 97], [97, 141], [97, 2], [2, 141], [141, 97],\n [240, 75], [75, 235], [235, 240], [229, 24], [24, 228], [228, 229],\n [31, 25], [25, 226], [226, 31], [230, 23], [23, 229], [229, 230],\n [231, 22], [22, 230], [230, 231], [232, 26], [26, 231], [231, 232],\n [233, 112], [112, 232], [232, 233], [244, 189], [189, 243], [243, 244],\n [189, 221], [221, 190], [190, 189], [222, 28], [28, 221], [221, 222],\n [223, 27], [27, 222], [222, 223], [224, 29], [29, 223], [223, 224],\n [225, 30], [30, 224], [224, 225], [113, 247], [247, 225], [225, 113],\n [99, 60], [60, 240], [240, 99], [213, 147], [147, 215], [215, 213],\n [60, 20], [20, 166], [166, 60], [192, 187], [187, 213], [213, 192],\n [243, 112], [112, 244], [244, 243], [244, 233], [233, 245], [245, 244],\n [245, 128], [128, 188], [188, 245], [188, 114], [114, 174], [174, 188],\n [134, 131], [131, 220], [220, 134], [174, 217], [217, 236], [236, 174],\n [236, 198], [198, 134], [134, 236], [215, 177], [177, 58], [58, 215],\n [156, 143], [143, 124], [124, 156], [25, 110], [110, 7], [7, 25],\n [31, 228], [228, 25], [25, 31], [264, 356], [356, 368], [368, 264],\n [0, 11], [11, 267], [267, 0], [451, 452], [452, 349], [349, 451],\n [267, 302], [302, 269], [269, 267], [350, 357], [357, 277], [277, 350],\n [350, 452], [452, 357], [357, 350], [299, 333], [333, 297], [297, 299],\n [396, 175], [175, 377], [377, 396], [280, 347], [347, 330], [330, 280],\n [269, 303], [303, 270], [270, 269], [151, 9], [9, 337], [337, 151],\n [344, 278], [278, 360], [360, 344], [424, 418], [418, 431], [431, 424],\n [270, 304], [304, 409], [409, 270], [272, 310], [310, 407], [407, 272],\n [322, 270], [270, 410], [410, 322], [449, 450], [450, 347], [347, 449],\n [432, 422], [422, 434], [434, 432], [18, 313], [313, 17], [17, 18],\n [291, 306], [306, 375], [375, 291], [259, 387], [387, 260], [260, 259],\n [424, 335], [335, 418], [418, 424], [434, 364], [364, 416], [416, 434],\n [391, 423], [423, 327], [327, 391], [301, 251], [251, 298], [298, 301],\n [275, 281], [281, 4], [4, 275], [254, 373], [373, 253], [253, 254],\n [375, 307], [307, 321], [321, 375], [280, 425], [425, 411], [411, 280],\n [200, 421], [421, 18], [18, 200], [335, 321], [321, 406], [406, 335],\n [321, 320], [320, 405], [405, 321], [314, 315], [315, 17], [17, 314],\n [423, 426], [426, 266], [266, 423], [396, 377], [377, 369], [369, 396],\n [270, 322], [322, 269], [269, 270], [413, 417], [417, 464], [464, 413],\n [385, 386], [386, 258], [258, 385], [248, 456], [456, 419], [419, 248],\n [298, 284], [284, 333], [333, 298], [168, 417], [417, 8], [8, 168],\n [448, 346], [346, 261], [261, 448], [417, 413], [413, 285], [285, 417],\n [326, 327], [327, 328], [328, 326], [277, 355], [355, 329], [329, 277],\n [309, 392], [392, 438], [438, 309], [381, 382], [382, 256], [256, 381],\n [279, 429], [429, 360], [360, 279], [365, 364], [364, 379], [379, 365],\n [355, 277], [277, 437], [437, 355], [282, 443], [443, 283], [283, 282],\n [281, 275], [275, 363], [363, 281], [395, 431], [431, 369], [369, 395],\n [299, 297], [297, 337], [337, 299], [335, 273], [273, 321], [321, 335],\n [348, 450], [450, 349], [349, 348], [359, 446], [446, 467], [467, 359],\n [283, 293], [293, 282], [282, 283], [250, 458], [458, 462], [462, 250],\n [300, 276], [276, 383], [383, 300], [292, 308], [308, 325], [325, 292],\n [283, 276], [276, 293], [293, 283], [264, 372], [372, 447], [447, 264],\n [346, 352], [352, 340], [340, 346], [354, 274], [274, 19], [19, 354],\n [363, 456], [456, 281], [281, 363], [426, 436], [436, 425], [425, 426],\n [380, 381], [381, 252], [252, 380], [267, 269], [269, 393], [393, 267],\n [421, 200], [200, 428], [428, 421], [371, 266], [266, 329], [329, 371],\n [432, 287], [287, 422], [422, 432], [290, 250], [250, 328], [328, 290],\n [385, 258], [258, 384], [384, 385], [446, 265], [265, 342], [342, 446],\n [386, 387], [387, 257], [257, 386], [422, 424], [424, 430], [430, 422],\n [445, 342], [342, 276], [276, 445], [422, 273], [273, 424], [424, 422],\n [306, 292], [292, 307], [307, 306], [352, 366], [366, 345], [345, 352],\n [268, 271], [271, 302], [302, 268], [358, 423], [423, 371], [371, 358],\n [327, 294], [294, 460], [460, 327], [331, 279], [279, 294], [294, 331],\n [303, 271], [271, 304], [304, 303], [436, 432], [432, 427], [427, 436],\n [304, 272], [272, 408], [408, 304], [395, 394], [394, 431], [431, 395],\n [378, 395], [395, 400], [400, 378], [296, 334], [334, 299], [299, 296],\n [6, 351], [351, 168], [168, 6], [376, 352], [352, 411], [411, 376],\n [307, 325], [325, 320], [320, 307], [285, 295], [295, 336], [336, 285],\n [320, 319], [319, 404], [404, 320], [329, 330], [330, 349], [349, 329],\n [334, 293], [293, 333], [333, 334], [366, 323], [323, 447], [447, 366],\n [316, 15], [15, 315], [315, 316], [331, 358], [358, 279], [279, 331],\n [317, 14], [14, 316], [316, 317], [8, 285], [285, 9], [9, 8],\n [277, 329], [329, 350], [350, 277], [253, 374], [374, 252], [252, 253],\n [319, 318], [318, 403], [403, 319], [351, 6], [6, 419], [419, 351],\n [324, 318], [318, 325], [325, 324], [397, 367], [367, 365], [365, 397],\n [288, 435], [435, 397], [397, 288], [278, 344], [344, 439], [439, 278],\n [310, 272], [272, 311], [311, 310], [248, 195], [195, 281], [281, 248],\n [375, 273], [273, 291], [291, 375], [175, 396], [396, 199], [199, 175],\n [312, 311], [311, 268], [268, 312], [276, 283], [283, 445], [445, 276],\n [390, 373], [373, 339], [339, 390], [295, 282], [282, 296], [296, 295],\n [448, 449], [449, 346], [346, 448], [356, 264], [264, 454], [454, 356],\n [337, 336], [336, 299], [299, 337], [337, 338], [338, 151], [151, 337],\n [294, 278], [278, 455], [455, 294], [308, 292], [292, 415], [415, 308],\n [429, 358], [358, 355], [355, 429], [265, 340], [340, 372], [372, 265],\n [352, 346], [346, 280], [280, 352], [295, 442], [442, 282], [282, 295],\n [354, 19], [19, 370], [370, 354], [285, 441], [441, 295], [295, 285],\n [195, 248], [248, 197], [197, 195], [457, 440], [440, 274], [274, 457],\n [301, 300], [300, 368], [368, 301], [417, 351], [351, 465], [465, 417],\n [251, 301], [301, 389], [389, 251], [394, 395], [395, 379], [379, 394],\n [399, 412], [412, 419], [419, 399], [410, 436], [436, 322], [322, 410],\n [326, 2], [2, 393], [393, 326], [354, 370], [370, 461], [461, 354],\n [393, 164], [164, 267], [267, 393], [268, 302], [302, 12], [12, 268],\n [312, 268], [268, 13], [13, 312], [298, 293], [293, 301], [301, 298],\n [265, 446], [446, 340], [340, 265], [280, 330], [330, 425], [425, 280],\n [322, 426], [426, 391], [391, 322], [420, 429], [429, 437], [437, 420],\n [393, 391], [391, 326], [326, 393], [344, 440], [440, 438], [438, 344],\n [458, 459], [459, 461], [461, 458], [364, 434], [434, 394], [394, 364],\n [428, 396], [396, 262], [262, 428], [274, 354], [354, 457], [457, 274],\n [317, 316], [316, 402], [402, 317], [316, 315], [315, 403], [403, 316],\n [315, 314], [314, 404], [404, 315], [314, 313], [313, 405], [405, 314],\n [313, 421], [421, 406], [406, 313], [323, 366], [366, 361], [361, 323],\n [292, 306], [306, 407], [407, 292], [306, 291], [291, 408], [408, 306],\n [291, 287], [287, 409], [409, 291], [287, 432], [432, 410], [410, 287],\n [427, 434], [434, 411], [411, 427], [372, 264], [264, 383], [383, 372],\n [459, 309], [309, 457], [457, 459], [366, 352], [352, 401], [401, 366],\n [1, 274], [274, 4], [4, 1], [418, 421], [421, 262], [262, 418],\n [331, 294], [294, 358], [358, 331], [435, 433], [433, 367], [367, 435],\n [392, 289], [289, 439], [439, 392], [328, 462], [462, 326], [326, 328],\n [94, 2], [2, 370], [370, 94], [289, 305], [305, 455], [455, 289],\n [339, 254], [254, 448], [448, 339], [359, 255], [255, 446], [446, 359],\n [254, 253], [253, 449], [449, 254], [253, 252], [252, 450], [450, 253],\n [252, 256], [256, 451], [451, 252], [256, 341], [341, 452], [452, 256],\n [414, 413], [413, 463], [463, 414], [286, 441], [441, 414], [414, 286],\n [286, 258], [258, 441], [441, 286], [258, 257], [257, 442], [442, 258],\n [257, 259], [259, 443], [443, 257], [259, 260], [260, 444], [444, 259],\n [260, 467], [467, 445], [445, 260], [309, 459], [459, 250], [250, 309],\n [305, 289], [289, 290], [290, 305], [305, 290], [290, 460], [460, 305],\n [401, 376], [376, 435], [435, 401], [309, 250], [250, 392], [392, 309],\n [376, 411], [411, 433], [433, 376], [453, 341], [341, 464], [464, 453],\n [357, 453], [453, 465], [465, 357], [343, 357], [357, 412], [412, 343],\n [437, 343], [343, 399], [399, 437], [344, 360], [360, 440], [440, 344],\n [420, 437], [437, 456], [456, 420], [360, 420], [420, 363], [363, 360],\n [361, 401], [401, 288], [288, 361], [265, 372], [372, 353], [353, 265],\n [390, 339], [339, 249], [249, 390], [339, 448], [448, 255], [255, 339],\n];\n", "// @tensorflow/tfjs-models/face-landmark-detection/src/constants.ts\n// https://github.com/google/mediapipe/mediapipe/python/solutions/face_mesh_connections.py\n\ntype PairArray = [number, number][];\n\nconst LIPS_CONNECTIONS: PairArray = [\n [61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314], [314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40], [40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270], [270, 409], [409, 291],\n [78, 95], [95, 88], [88, 178], [178, 87], [87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308], [78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312], [312, 311], [311, 310], [310, 415], [415, 308],\n];\n\nconst LEFT_EYE_CONNECTIONS: PairArray = [[263, 249], [249, 390], [390, 373], [373, 374], [374, 380], [380, 381], [381, 382], [382, 362], [263, 466], [466, 388], [388, 387], [387, 386], [386, 385], [385, 384], [384, 398], [398, 362]];\n\nconst LEFT_EYEBROW_CONNECTIONS: PairArray = [[276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]];\n\nconst LEFT_IRIS_CONNECTIONS: PairArray = [[474, 475], [475, 476], [476, 477], [477, 474]];\n\nconst RIGHT_EYE_CONNECTIONS: PairArray = [[33, 7], [7, 163], [163, 144], [144, 145], [145, 153], [153, 154], [154, 155], [155, 133], [33, 246], [246, 161], [161, 160], [160, 159], [159, 158], [158, 157], [157, 173], [173, 133]];\n\nconst RIGHT_EYEBROW_CONNECTIONS: PairArray = [[46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]];\n\nconst RIGHT_IRIS_CONNECTIONS: PairArray = [[469, 470], [470, 471], [471, 472], [472, 469]];\n\nconst FACE_OVAL_CONNECTIONS: PairArray = [\n [10, 338], [338, 297], [297, 332], [332, 284], [284, 251], [251, 389], [389, 356], [356, 454], [454, 323], [323, 361], [361, 288], [288, 397], [397, 365], [365, 379], [379, 378], [378, 400], [400, 377], [377, 152],\n [152, 148], [148, 176], [176, 149], [149, 150], [150, 136], [136, 172], [172, 58], [58, 132], [132, 93], [93, 234], [234, 127], [127, 162], [162, 21], [21, 54], [54, 103], [103, 67], [67, 109], [109, 10],\n];\n\nexport const MEDIAPIPE_FACE_MESH_CONNECTED_KEYPOINTS_PAIRS: PairArray = [\n [127, 34], [34, 139], [139, 127], [11, 0], [0, 37], [37, 11], [232, 231], [231, 120], [120, 232], [72, 37], [37, 39], [39, 72], [128, 121], [121, 47], [47, 128], [232, 121], [121, 128], [128, 232],\n [104, 69], [69, 67], [67, 104], [175, 171], [171, 148], [148, 175], [118, 50], [50, 101], [101, 118], [73, 39], [39, 40], [40, 73], [9, 151], [151, 108], [108, 9], [48, 115], [115, 131], [131, 48],\n [194, 204], [204, 211], [211, 194], [74, 40], [40, 185], [185, 74], [80, 42], [42, 183], [183, 80], [40, 92], [92, 186], [186, 40], [230, 229], [229, 118], [118, 230], [202, 212], [212, 214], [214, 202],\n [83, 18], [18, 17], [17, 83], [76, 61], [61, 146], [146, 76], [160, 29], [29, 30], [30, 160], [56, 157], [157, 173], [173, 56], [106, 204], [204, 194], [194, 106], [135, 214], [214, 192], [192, 135],\n [203, 165], [165, 98], [98, 203], [21, 71], [71, 68], [68, 21], [51, 45], [45, 4], [4, 51], [144, 24], [24, 23], [23, 144], [77, 146], [146, 91], [91, 77], [205, 50], [50, 187], [187, 205],\n [201, 200], [200, 18], [18, 201], [91, 106], [106, 182], [182, 91], [90, 91], [91, 181], [181, 90], [85, 84], [84, 17], [17, 85], [206, 203], [203, 36], [36, 206], [148, 171], [171, 140], [140, 148],\n [92, 40], [40, 39], [39, 92], [193, 189], [189, 244], [244, 193], [159, 158], [158, 28], [28, 159], [247, 246], [246, 161], [161, 247], [236, 3], [3, 196], [196, 236], [54, 68], [68, 104], [104, 54],\n [193, 168], [168, 8], [8, 193], [117, 228], [228, 31], [31, 117], [189, 193], [193, 55], [55, 189], [98, 97], [97, 99], [99, 98], [126, 47], [47, 100], [100, 126], [166, 79], [79, 218], [218, 166],\n [155, 154], [154, 26], [26, 155], [209, 49], [49, 131], [131, 209], [135, 136], [136, 150], [150, 135], [47, 126], [126, 217], [217, 47], [223, 52], [52, 53], [53, 223], [45, 51], [51, 134], [134, 45],\n [211, 170], [170, 140], [140, 211], [67, 69], [69, 108], [108, 67], [43, 106], [106, 91], [91, 43], [230, 119], [119, 120], [120, 230], [226, 130], [130, 247], [247, 226], [63, 53], [53, 52], [52, 63],\n [238, 20], [20, 242], [242, 238], [46, 70], [70, 156], [156, 46], [78, 62], [62, 96], [96, 78], [46, 53], [53, 63], [63, 46], [143, 34], [34, 227], [227, 143], [123, 117], [117, 111], [111, 123],\n [44, 125], [125, 19], [19, 44], [236, 134], [134, 51], [51, 236], [216, 206], [206, 205], [205, 216], [154, 153], [153, 22], [22, 154], [39, 37], [37, 167], [167, 39], [200, 201], [201, 208], [208, 200],\n [36, 142], [142, 100], [100, 36], [57, 212], [212, 202], [202, 57], [20, 60], [60, 99], [99, 20], [28, 158], [158, 157], [157, 28], [35, 226], [226, 113], [113, 35], [160, 159], [159, 27], [27, 160],\n [204, 202], [202, 210], [210, 204], [113, 225], [225, 46], [46, 113], [43, 202], [202, 204], [204, 43], [62, 76], [76, 77], [77, 62], [137, 123], [123, 116], [116, 137], [41, 38], [38, 72], [72, 41],\n [203, 129], [129, 142], [142, 203], [64, 98], [98, 240], [240, 64], [49, 102], [102, 64], [64, 49], [41, 73], [73, 74], [74, 41], [212, 216], [216, 207], [207, 212], [42, 74], [74, 184], [184, 42],\n [169, 170], [170, 211], [211, 169], [170, 149], [149, 176], [176, 170], [105, 66], [66, 69], [69, 105], [122, 6], [6, 168], [168, 122], [123, 147], [147, 187], [187, 123], [96, 77], [77, 90], [90, 96],\n [65, 55], [55, 107], [107, 65], [89, 90], [90, 180], [180, 89], [101, 100], [100, 120], [120, 101], [63, 105], [105, 104], [104, 63], [93, 137], [137, 227], [227, 93], [15, 86], [86, 85], [85, 15],\n [129, 102], [102, 49], [49, 129], [14, 87], [87, 86], [86, 14], [55, 8], [8, 9], [9, 55], [100, 47], [47, 121], [121, 100], [145, 23], [23, 22], [22, 145], [88, 89], [89, 179], [179, 88],\n [6, 122], [122, 196], [196, 6], [88, 95], [95, 96], [96, 88], [138, 172], [172, 136], [136, 138], [215, 58], [58, 172], [172, 215], [115, 48], [48, 219], [219, 115], [42, 80], [80, 81], [81, 42],\n [195, 3], [3, 51], [51, 195], [43, 146], [146, 61], [61, 43], [171, 175], [175, 199], [199, 171], [81, 82], [82, 38], [38, 81], [53, 46], [46, 225], [225, 53], [144, 163], [163, 110], [110, 144],\n [52, 65], [65, 66], [66, 52], [229, 228], [228, 117], [117, 229], [34, 127], [127, 234], [234, 34], [107, 108], [108, 69], [69, 107], [109, 108], [108, 151], [151, 109], [48, 64], [64, 235], [235, 48],\n [62, 78], [78, 191], [191, 62], [129, 209], [209, 126], [126, 129], [111, 35], [35, 143], [143, 111], [117, 123], [123, 50], [50, 117], [222, 65], [65, 52], [52, 222], [19, 125], [125, 141], [141, 19],\n [221, 55], [55, 65], [65, 221], [3, 195], [195, 197], [197, 3], [25, 7], [7, 33], [33, 25], [220, 237], [237, 44], [44, 220], [70, 71], [71, 139], [139, 70], [122, 193], [193, 245], [245, 122],\n [247, 130], [130, 33], [33, 247], [71, 21], [21, 162], [162, 71], [170, 169], [169, 150], [150, 170], [188, 174], [174, 196], [196, 188], [216, 186], [186, 92], [92, 216], [2, 97], [97, 167], [167, 2],\n [141, 125], [125, 241], [241, 141], [164, 167], [167, 37], [37, 164], [72, 38], [38, 12], [12, 72], [38, 82], [82, 13], [13, 38], [63, 68], [68, 71], [71, 63], [226, 35], [35, 111], [111, 226],\n [101, 50], [50, 205], [205, 101], [206, 92], [92, 165], [165, 206], [209, 198], [198, 217], [217, 209], [165, 167], [167, 97], [97, 165], [220, 115], [115, 218], [218, 220], [133, 112], [112, 243], [243, 133],\n [239, 238], [238, 241], [241, 239], [214, 135], [135, 169], [169, 214], [190, 173], [173, 133], [133, 190], [171, 208], [208, 32], [32, 171], [125, 44], [44, 237], [237, 125], [86, 87], [87, 178], [178, 86],\n [85, 86], [86, 179], [179, 85], [84, 85], [85, 180], [180, 84], [83, 84], [84, 181], [181, 83], [201, 83], [83, 182], [182, 201], [137, 93], [93, 132], [132, 137], [76, 62], [62, 183], [183, 76],\n [61, 76], [76, 184], [184, 61], [57, 61], [61, 185], [185, 57], [212, 57], [57, 186], [186, 212], [214, 207], [207, 187], [187, 214], [34, 143], [143, 156], [156, 34], [79, 239], [239, 237], [237, 79],\n [123, 137], [137, 177], [177, 123], [44, 1], [1, 4], [4, 44], [201, 194], [194, 32], [32, 201], [64, 102], [102, 129], [129, 64], [213, 215], [215, 138], [138, 213], [59, 166], [166, 219], [219, 59],\n [242, 99], [99, 97], [97, 242], [2, 94], [94, 141], [141, 2], [75, 59], [59, 235], [235, 75], [24, 110], [110, 228], [228, 24], [25, 130], [130, 226], [226, 25], [23, 24], [24, 229], [229, 23],\n [22, 23], [23, 230], [230, 22], [26, 22], [22, 231], [231, 26], [112, 26], [26, 232], [232, 112], [189, 190], [190, 243], [243, 189], [221, 56], [56, 190], [190, 221], [28, 56], [56, 221], [221, 28],\n [27, 28], [28, 222], [222, 27], [29, 27], [27, 223], [223, 29], [30, 29], [29, 224], [224, 30], [247, 30], [30, 225], [225, 247], [238, 79], [79, 20], [20, 238], [166, 59], [59, 75], [75, 166],\n [60, 75], [75, 240], [240, 60], [147, 177], [177, 215], [215, 147], [20, 79], [79, 166], [166, 20], [187, 147], [147, 213], [213, 187], [112, 233], [233, 244], [244, 112], [233, 128], [128, 245], [245, 233],\n [128, 114], [114, 188], [188, 128], [114, 217], [217, 174], [174, 114], [131, 115], [115, 220], [220, 131], [217, 198], [198, 236], [236, 217], [198, 131], [131, 134], [134, 198], [177, 132], [132, 58], [58, 177],\n [143, 35], [35, 124], [124, 143], [110, 163], [163, 7], [7, 110], [228, 110], [110, 25], [25, 228], [356, 389], [389, 368], [368, 356], [11, 302], [302, 267], [267, 11], [452, 350], [350, 349], [349, 452],\n [302, 303], [303, 269], [269, 302], [357, 343], [343, 277], [277, 357], [452, 453], [453, 357], [357, 452], [333, 332], [332, 297], [297, 333], [175, 152], [152, 377], [377, 175], [347, 348], [348, 330], [330, 347],\n [303, 304], [304, 270], [270, 303], [9, 336], [336, 337], [337, 9], [278, 279], [279, 360], [360, 278], [418, 262], [262, 431], [431, 418], [304, 408], [408, 409], [409, 304], [310, 415], [415, 407], [407, 310],\n [270, 409], [409, 410], [410, 270], [450, 348], [348, 347], [347, 450], [422, 430], [430, 434], [434, 422], [313, 314], [314, 17], [17, 313], [306, 307], [307, 375], [375, 306], [387, 388], [388, 260], [260, 387],\n [286, 414], [414, 398], [398, 286], [335, 406], [406, 418], [418, 335], [364, 367], [367, 416], [416, 364], [423, 358], [358, 327], [327, 423], [251, 284], [284, 298], [298, 251], [281, 5], [5, 4], [4, 281],\n [373, 374], [374, 253], [253, 373], [307, 320], [320, 321], [321, 307], [425, 427], [427, 411], [411, 425], [421, 313], [313, 18], [18, 421], [321, 405], [405, 406], [406, 321], [320, 404], [404, 405], [405, 320],\n [315, 16], [16, 17], [17, 315], [426, 425], [425, 266], [266, 426], [377, 400], [400, 369], [369, 377], [322, 391], [391, 269], [269, 322], [417, 465], [465, 464], [464, 417], [386, 257], [257, 258], [258, 386],\n [466, 260], [260, 388], [388, 466], [456, 399], [399, 419], [419, 456], [284, 332], [332, 333], [333, 284], [417, 285], [285, 8], [8, 417], [346, 340], [340, 261], [261, 346], [413, 441], [441, 285], [285, 413],\n [327, 460], [460, 328], [328, 327], [355, 371], [371, 329], [329, 355], [392, 439], [439, 438], [438, 392], [382, 341], [341, 256], [256, 382], [429, 420], [420, 360], [360, 429], [364, 394], [394, 379], [379, 364],\n [277, 343], [343, 437], [437, 277], [443, 444], [444, 283], [283, 443], [275, 440], [440, 363], [363, 275], [431, 262], [262, 369], [369, 431], [297, 338], [338, 337], [337, 297], [273, 375], [375, 321], [321, 273],\n [450, 451], [451, 349], [349, 450], [446, 342], [342, 467], [467, 446], [293, 334], [334, 282], [282, 293], [458, 461], [461, 462], [462, 458], [276, 353], [353, 383], [383, 276], [308, 324], [324, 325], [325, 308],\n [276, 300], [300, 293], [293, 276], [372, 345], [345, 447], [447, 372], [352, 345], [345, 340], [340, 352], [274, 1], [1, 19], [19, 274], [456, 248], [248, 281], [281, 456], [436, 427], [427, 425], [425, 436],\n [381, 256], [256, 252], [252, 381], [269, 391], [391, 393], [393, 269], [200, 199], [199, 428], [428, 200], [266, 330], [330, 329], [329, 266], [287, 273], [273, 422], [422, 287], [250, 462], [462, 328], [328, 250],\n [258, 286], [286, 384], [384, 258], [265, 353], [353, 342], [342, 265], [387, 259], [259, 257], [257, 387], [424, 431], [431, 430], [430, 424], [342, 353], [353, 276], [276, 342], [273, 335], [335, 424], [424, 273],\n [292, 325], [325, 307], [307, 292], [366, 447], [447, 345], [345, 366], [271, 303], [303, 302], [302, 271], [423, 266], [266, 371], [371, 423], [294, 455], [455, 460], [460, 294], [279, 278], [278, 294], [294, 279],\n [271, 272], [272, 304], [304, 271], [432, 434], [434, 427], [427, 432], [272, 407], [407, 408], [408, 272], [394, 430], [430, 431], [431, 394], [395, 369], [369, 400], [400, 395], [334, 333], [333, 299], [299, 334],\n [351, 417], [417, 168], [168, 351], [352, 280], [280, 411], [411, 352], [325, 319], [319, 320], [320, 325], [295, 296], [296, 336], [336, 295], [319, 403], [403, 404], [404, 319], [330, 348], [348, 349], [349, 330],\n [293, 298], [298, 333], [333, 293], [323, 454], [454, 447], [447, 323], [15, 16], [16, 315], [315, 15], [358, 429], [429, 279], [279, 358], [14, 15], [15, 316], [316, 14], [285, 336], [336, 9], [9, 285],\n [329, 349], [349, 350], [350, 329], [374, 380], [380, 252], [252, 374], [318, 402], [402, 403], [403, 318], [6, 197], [197, 419], [419, 6], [318, 319], [319, 325], [325, 318], [367, 364], [364, 365], [365, 367],\n [435, 367], [367, 397], [397, 435], [344, 438], [438, 439], [439, 344], [272, 271], [271, 311], [311, 272], [195, 5], [5, 281], [281, 195], [273, 287], [287, 291], [291, 273], [396, 428], [428, 199], [199, 396],\n [311, 271], [271, 268], [268, 311], [283, 444], [444, 445], [445, 283], [373, 254], [254, 339], [339, 373], [282, 334], [334, 296], [296, 282], [449, 347], [347, 346], [346, 449], [264, 447], [447, 454], [454, 264],\n [336, 296], [296, 299], [299, 336], [338, 10], [10, 151], [151, 338], [278, 439], [439, 455], [455, 278], [292, 407], [407, 415], [415, 292], [358, 371], [371, 355], [355, 358], [340, 345], [345, 372], [372, 340],\n [346, 347], [347, 280], [280, 346], [442, 443], [443, 282], [282, 442], [19, 94], [94, 370], [370, 19], [441, 442], [442, 295], [295, 441], [248, 419], [419, 197], [197, 248], [263, 255], [255, 359], [359, 263],\n [440, 275], [275, 274], [274, 440], [300, 383], [383, 368], [368, 300], [351, 412], [412, 465], [465, 351], [263, 467], [467, 466], [466, 263], [301, 368], [368, 389], [389, 301], [395, 378], [378, 379], [379, 395],\n [412, 351], [351, 419], [419, 412], [436, 426], [426, 322], [322, 436], [2, 164], [164, 393], [393, 2], [370, 462], [462, 461], [461, 370], [164, 0], [0, 267], [267, 164], [302, 11], [11, 12], [12, 302],\n [268, 12], [12, 13], [13, 268], [293, 300], [300, 301], [301, 293], [446, 261], [261, 340], [340, 446], [330, 266], [266, 425], [425, 330], [426, 423], [423, 391], [391, 426], [429, 355], [355, 437], [437, 429],\n [391, 327], [327, 326], [326, 391], [440, 457], [457, 438], [438, 440], [341, 382], [382, 362], [362, 341], [459, 457], [457, 461], [461, 459], [434, 430], [430, 394], [394, 434], [414, 463], [463, 362], [362, 414],\n [396, 369], [369, 262], [262, 396], [354, 461], [461, 457], [457, 354], [316, 403], [403, 402], [402, 316], [315, 404], [404, 403], [403, 315], [314, 405], [405, 404], [404, 314], [313, 406], [406, 405], [405, 313],\n [421, 418], [418, 406], [406, 421], [366, 401], [401, 361], [361, 366], [306, 408], [408, 407], [407, 306], [291, 409], [409, 408], [408, 291], [287, 410], [410, 409], [409, 287], [432, 436], [436, 410], [410, 432],\n [434, 416], [416, 411], [411, 434], [264, 368], [368, 383], [383, 264], [309, 438], [438, 457], [457, 309], [352, 376], [376, 401], [401, 352], [274, 275], [275, 4], [4, 274], [421, 428], [428, 262], [262, 421],\n [294, 327], [327, 358], [358, 294], [433, 416], [416, 367], [367, 433], [289, 455], [455, 439], [439, 289], [462, 370], [370, 326], [326, 462], [2, 326], [326, 370], [370, 2], [305, 460], [460, 455], [455, 305],\n [254, 449], [449, 448], [448, 254], [255, 261], [261, 446], [446, 255], [253, 450], [450, 449], [449, 253], [252, 451], [451, 450], [450, 252], [256, 452], [452, 451], [451, 256], [341, 453], [453, 452], [452, 341],\n [413, 464], [464, 463], [463, 413], [441, 413], [413, 414], [414, 441], [258, 442], [442, 441], [441, 258], [257, 443], [443, 442], [442, 257], [259, 444], [444, 443], [443, 259], [260, 445], [445, 444], [444, 260],\n [467, 342], [342, 445], [445, 467], [459, 458], [458, 250], [250, 459], [289, 392], [392, 290], [290, 289], [290, 328], [328, 460], [460, 290], [376, 433], [433, 435], [435, 376], [250, 290], [290, 392], [392, 250],\n [411, 416], [416, 433], [433, 411], [341, 463], [463, 464], [464, 341], [453, 464], [464, 465], [465, 453], [357, 465], [465, 412], [412, 357], [343, 412], [412, 399], [399, 343], [360, 363], [363, 440], [440, 360],\n [437, 399], [399, 456], [456, 437], [420, 456], [456, 363], [363, 420], [401, 435], [435, 288], [288, 401], [372, 383], [383, 353], [353, 372], [339, 255], [255, 249], [249, 339], [448, 261], [261, 255], [255, 448],\n [133, 243], [243, 190], [190, 133], [133, 155], [155, 112], [112, 133], [33, 246], [246, 247], [247, 33], [33, 130], [130, 25], [25, 33], [398, 384], [384, 286], [286, 398], [362, 398], [398, 414], [414, 362],\n [362, 463], [463, 341], [341, 362], [263, 359], [359, 467], [467, 263], [263, 249], [249, 255], [255, 263], [466, 467], [467, 260], [260, 466], [75, 60], [60, 166], [166, 75], [238, 239], [239, 79], [79, 238],\n [162, 127], [127, 139], [139, 162], [72, 11], [11, 37], [37, 72], [121, 232], [232, 120], [120, 121], [73, 72], [72, 39], [39, 73], [114, 128], [128, 47], [47, 114], [233, 232], [232, 128], [128, 233],\n [103, 104], [104, 67], [67, 103], [152, 175], [175, 148], [148, 152], [119, 118], [118, 101], [101, 119], [74, 73], [73, 40], [40, 74], [107, 9], [9, 108], [108, 107], [49, 48], [48, 131], [131, 49],\n [32, 194], [194, 211], [211, 32], [184, 74], [74, 185], [185, 184], [191, 80], [80, 183], [183, 191], [185, 40], [40, 186], [186, 185], [119, 230], [230, 118], [118, 119], [210, 202], [202, 214], [214, 210],\n [84, 83], [83, 17], [17, 84], [77, 76], [76, 146], [146, 77], [161, 160], [160, 30], [30, 161], [190, 56], [56, 173], [173, 190], [182, 106], [106, 194], [194, 182], [138, 135], [135, 192], [192, 138],\n [129, 203], [203, 98], [98, 129], [54, 21], [21, 68], [68, 54], [5, 51], [51, 4], [4, 5], [145, 144], [144, 23], [23, 145], [90, 77], [77, 91], [91, 90], [207, 205], [205, 187], [187, 207],\n [83, 201], [201, 18], [18, 83], [181, 91], [91, 182], [182, 181], [180, 90], [90, 181], [181, 180], [16, 85], [85, 17], [17, 16], [205, 206], [206, 36], [36, 205], [176, 148], [148, 140], [140, 176],\n [165, 92], [92, 39], [39, 165], [245, 193], [193, 244], [244, 245], [27, 159], [159, 28], [28, 27], [30, 247], [247, 161], [161, 30], [174, 236], [236, 196], [196, 174], [103, 54], [54, 104], [104, 103],\n [55, 193], [193, 8], [8, 55], [111, 117], [117, 31], [31, 111], [221, 189], [189, 55], [55, 221], [240, 98], [98, 99], [99, 240], [142, 126], [126, 100], [100, 142], [219, 166], [166, 218], [218, 219],\n [112, 155], [155, 26], [26, 112], [198, 209], [209, 131], [131, 198], [169, 135], [135, 150], [150, 169], [114, 47], [47, 217], [217, 114], [224, 223], [223, 53], [53, 224], [220, 45], [45, 134], [134, 220],\n [32, 211], [211, 140], [140, 32], [109, 67], [67, 108], [108, 109], [146, 43], [43, 91], [91, 146], [231, 230], [230, 120], [120, 231], [113, 226], [226, 247], [247, 113], [105, 63], [63, 52], [52, 105],\n [241, 238], [238, 242], [242, 241], [124, 46], [46, 156], [156, 124], [95, 78], [78, 96], [96, 95], [70, 46], [46, 63], [63, 70], [116, 143], [143, 227], [227, 116], [116, 123], [123, 111], [111, 116],\n [1, 44], [44, 19], [19, 1], [3, 236], [236, 51], [51, 3], [207, 216], [216, 205], [205, 207], [26, 154], [154, 22], [22, 26], [165, 39], [39, 167], [167, 165], [199, 200], [200, 208], [208, 199],\n [101, 36], [36, 100], [100, 101], [43, 57], [57, 202], [202, 43], [242, 20], [20, 99], [99, 242], [56, 28], [28, 157], [157, 56], [124, 35], [35, 113], [113, 124], [29, 160], [160, 27], [27, 29],\n [211, 204], [204, 210], [210, 211], [124, 113], [113, 46], [46, 124], [106, 43], [43, 204], [204, 106], [96, 62], [62, 77], [77, 96], [227, 137], [137, 116], [116, 227], [73, 41], [41, 72], [72, 73],\n [36, 203], [203, 142], [142, 36], [235, 64], [64, 240], [240, 235], [48, 49], [49, 64], [64, 48], [42, 41], [41, 74], [74, 42], [214, 212], [212, 207], [207, 214], [183, 42], [42, 184], [184, 183],\n [210, 169], [169, 211], [211, 210], [140, 170], [170, 176], [176, 140], [104, 105], [105, 69], [69, 104], [193, 122], [122, 168], [168, 193], [50, 123], [123, 187], [187, 50], [89, 96], [96, 90], [90, 89],\n [66, 65], [65, 107], [107, 66], [179, 89], [89, 180], [180, 179], [119, 101], [101, 120], [120, 119], [68, 63], [63, 104], [104, 68], [234, 93], [93, 227], [227, 234], [16, 15], [15, 85], [85, 16],\n [209, 129], [129, 49], [49, 209], [15, 14], [14, 86], [86, 15], [107, 55], [55, 9], [9, 107], [120, 100], [100, 121], [121, 120], [153, 145], [145, 22], [22, 153], [178, 88], [88, 179], [179, 178],\n [197, 6], [6, 196], [196, 197], [89, 88], [88, 96], [96, 89], [135, 138], [138, 136], [136, 135], [138, 215], [215, 172], [172, 138], [218, 115], [115, 219], [219, 218], [41, 42], [42, 81], [81, 41],\n [5, 195], [195, 51], [51, 5], [57, 43], [43, 61], [61, 57], [208, 171], [171, 199], [199, 208], [41, 81], [81, 38], [38, 41], [224, 53], [53, 225], [225, 224], [24, 144], [144, 110], [110, 24],\n [105, 52], [52, 66], [66, 105], [118, 229], [229, 117], [117, 118], [227, 34], [34, 234], [234, 227], [66, 107], [107, 69], [69, 66], [10, 109], [109, 151], [151, 10], [219, 48], [48, 235], [235, 219],\n [183, 62], [62, 191], [191, 183], [142, 129], [129, 126], [126, 142], [116, 111], [111, 143], [143, 116], [118, 117], [117, 50], [50, 118], [223, 222], [222, 52], [52, 223], [94, 19], [19, 141], [141, 94],\n [222, 221], [221, 65], [65, 222], [196, 3], [3, 197], [197, 196], [45, 220], [220, 44], [44, 45], [156, 70], [70, 139], [139, 156], [188, 122], [122, 245], [245, 188], [139, 71], [71, 162], [162, 139],\n [149, 170], [170, 150], [150, 149], [122, 188], [188, 196], [196, 122], [206, 216], [216, 92], [92, 206], [164, 2], [2, 167], [167, 164], [242, 141], [141, 241], [241, 242], [0, 164], [164, 37], [37, 0],\n [11, 72], [72, 12], [12, 11], [12, 38], [38, 13], [13, 12], [70, 63], [63, 71], [71, 70], [31, 226], [226, 111], [111, 31], [36, 101], [101, 205], [205, 36], [203, 206], [206, 165], [165, 203],\n [126, 209], [209, 217], [217, 126], [98, 165], [165, 97], [97, 98], [237, 220], [220, 218], [218, 237], [237, 239], [239, 241], [241, 237], [210, 214], [214, 169], [169, 210], [140, 171], [171, 32], [32, 140],\n [241, 125], [125, 237], [237, 241], [179, 86], [86, 178], [178, 179], [180, 85], [85, 179], [179, 180], [181, 84], [84, 180], [180, 181], [182, 83], [83, 181], [181, 182], [194, 201], [201, 182], [182, 194],\n [177, 137], [137, 132], [132, 177], [184, 76], [76, 183], [183, 184], [185, 61], [61, 184], [184, 185], [186, 57], [57, 185], [185, 186], [216, 212], [212, 186], [186, 216], [192, 214], [214, 187], [187, 192],\n [139, 34], [34, 156], [156, 139], [218, 79], [79, 237], [237, 218], [147, 123], [123, 177], [177, 147], [45, 44], [44, 4], [4, 45], [208, 201], [201, 32], [32, 208], [98, 64], [64, 129], [129, 98],\n [192, 213], [213, 138], [138, 192], [235, 59], [59, 219], [219, 235], [141, 242], [242, 97], [97, 141], [97, 2], [2, 141], [141, 97], [240, 75], [75, 235], [235, 240], [229, 24], [24, 228], [228, 229],\n [31, 25], [25, 226], [226, 31], [230, 23], [23, 229], [229, 230], [231, 22], [22, 230], [230, 231], [232, 26], [26, 231], [231, 232], [233, 112], [112, 232], [232, 233], [244, 189], [189, 243], [243, 244],\n [189, 221], [221, 190], [190, 189], [222, 28], [28, 221], [221, 222], [223, 27], [27, 222], [222, 223], [224, 29], [29, 223], [223, 224], [225, 30], [30, 224], [224, 225], [113, 247], [247, 225], [225, 113],\n [99, 60], [60, 240], [240, 99], [213, 147], [147, 215], [215, 213], [60, 20], [20, 166], [166, 60], [192, 187], [187, 213], [213, 192], [243, 112], [112, 244], [244, 243], [244, 233], [233, 245], [245, 244],\n [245, 128], [128, 188], [188, 245], [188, 114], [114, 174], [174, 188], [134, 131], [131, 220], [220, 134], [174, 217], [217, 236], [236, 174], [236, 198], [198, 134], [134, 236], [215, 177], [177, 58], [58, 215],\n [156, 143], [143, 124], [124, 156], [25, 110], [110, 7], [7, 25], [31, 228], [228, 25], [25, 31], [264, 356], [356, 368], [368, 264], [0, 11], [11, 267], [267, 0], [451, 452], [452, 349], [349, 451],\n [267, 302], [302, 269], [269, 267], [350, 357], [357, 277], [277, 350], [350, 452], [452, 357], [357, 350], [299, 333], [333, 297], [297, 299], [396, 175], [175, 377], [377, 396], [280, 347], [347, 330], [330, 280],\n [269, 303], [303, 270], [270, 269], [151, 9], [9, 337], [337, 151], [344, 278], [278, 360], [360, 344], [424, 418], [418, 431], [431, 424], [270, 304], [304, 409], [409, 270], [272, 310], [310, 407], [407, 272],\n [322, 270], [270, 410], [410, 322], [449, 450], [450, 347], [347, 449], [432, 422], [422, 434], [434, 432], [18, 313], [313, 17], [17, 18], [291, 306], [306, 375], [375, 291], [259, 387], [387, 260], [260, 259],\n [424, 335], [335, 418], [418, 424], [434, 364], [364, 416], [416, 434], [391, 423], [423, 327], [327, 391], [301, 251], [251, 298], [298, 301], [275, 281], [281, 4], [4, 275], [254, 373], [373, 253], [253, 254],\n [375, 307], [307, 321], [321, 375], [280, 425], [425, 411], [411, 280], [200, 421], [421, 18], [18, 200], [335, 321], [321, 406], [406, 335], [321, 320], [320, 405], [405, 321], [314, 315], [315, 17], [17, 314],\n [423, 426], [426, 266], [266, 423], [396, 377], [377, 369], [369, 396], [270, 322], [322, 269], [269, 270], [413, 417], [417, 464], [464, 413], [385, 386], [386, 258], [258, 385], [248, 456], [456, 419], [419, 248],\n [298, 284], [284, 333], [333, 298], [168, 417], [417, 8], [8, 168], [448, 346], [346, 261], [261, 448], [417, 413], [413, 285], [285, 417], [326, 327], [327, 328], [328, 326], [277, 355], [355, 329], [329, 277],\n [309, 392], [392, 438], [438, 309], [381, 382], [382, 256], [256, 381], [279, 429], [429, 360], [360, 279], [365, 364], [364, 379], [379, 365], [355, 277], [277, 437], [437, 355], [282, 443], [443, 283], [283, 282],\n [281, 275], [275, 363], [363, 281], [395, 431], [431, 369], [369, 395], [299, 297], [297, 337], [337, 299], [335, 273], [273, 321], [321, 335], [348, 450], [450, 349], [349, 348], [359, 446], [446, 467], [467, 359],\n [283, 293], [293, 282], [282, 283], [250, 458], [458, 462], [462, 250], [300, 276], [276, 383], [383, 300], [292, 308], [308, 325], [325, 292], [283, 276], [276, 293], [293, 283], [264, 372], [372, 447], [447, 264],\n [346, 352], [352, 340], [340, 346], [354, 274], [274, 19], [19, 354], [363, 456], [456, 281], [281, 363], [426, 436], [436, 425], [425, 426], [380, 381], [381, 252], [252, 380], [267, 269], [269, 393], [393, 267],\n [421, 200], [200, 428], [428, 421], [371, 266], [266, 329], [329, 371], [432, 287], [287, 422], [422, 432], [290, 250], [250, 328], [328, 290], [385, 258], [258, 384], [384, 385], [446, 265], [265, 342], [342, 446],\n [386, 387], [387, 257], [257, 386], [422, 424], [424, 430], [430, 422], [445, 342], [342, 276], [276, 445], [422, 273], [273, 424], [424, 422], [306, 292], [292, 307], [307, 306], [352, 366], [366, 345], [345, 352],\n [268, 271], [271, 302], [302, 268], [358, 423], [423, 371], [371, 358], [327, 294], [294, 460], [460, 327], [331, 279], [279, 294], [294, 331], [303, 271], [271, 304], [304, 303], [436, 432], [432, 427], [427, 436],\n [304, 272], [272, 408], [408, 304], [395, 394], [394, 431], [431, 395], [378, 395], [395, 400], [400, 378], [296, 334], [334, 299], [299, 296], [6, 351], [351, 168], [168, 6], [376, 352], [352, 411], [411, 376],\n [307, 325], [325, 320], [320, 307], [285, 295], [295, 336], [336, 285], [320, 319], [319, 404], [404, 320], [329, 330], [330, 349], [349, 329], [334, 293], [293, 333], [333, 334], [366, 323], [323, 447], [447, 366],\n [316, 15], [15, 315], [315, 316], [331, 358], [358, 279], [279, 331], [317, 14], [14, 316], [316, 317], [8, 285], [285, 9], [9, 8], [277, 329], [329, 350], [350, 277], [253, 374], [374, 252], [252, 253],\n [319, 318], [318, 403], [403, 319], [351, 6], [6, 419], [419, 351], [324, 318], [318, 325], [325, 324], [397, 367], [367, 365], [365, 397], [288, 435], [435, 397], [397, 288], [278, 344], [344, 439], [439, 278],\n [310, 272], [272, 311], [311, 310], [248, 195], [195, 281], [281, 248], [375, 273], [273, 291], [291, 375], [175, 396], [396, 199], [199, 175], [312, 311], [311, 268], [268, 312], [276, 283], [283, 445], [445, 276],\n [390, 373], [373, 339], [339, 390], [295, 282], [282, 296], [296, 295], [448, 449], [449, 346], [346, 448], [356, 264], [264, 454], [454, 356], [337, 336], [336, 299], [299, 337], [337, 338], [338, 151], [151, 337],\n [294, 278], [278, 455], [455, 294], [308, 292], [292, 415], [415, 308], [429, 358], [358, 355], [355, 429], [265, 340], [340, 372], [372, 265], [352, 346], [346, 280], [280, 352], [295, 442], [442, 282], [282, 295],\n [354, 19], [19, 370], [370, 354], [285, 441], [441, 295], [295, 285], [195, 248], [248, 197], [197, 195], [457, 440], [440, 274], [274, 457], [301, 300], [300, 368], [368, 301], [417, 351], [351, 465], [465, 417],\n [251, 301], [301, 389], [389, 251], [394, 395], [395, 379], [379, 394], [399, 412], [412, 419], [419, 399], [410, 436], [436, 322], [322, 410], [326, 2], [2, 393], [393, 326], [354, 370], [370, 461], [461, 354],\n [393, 164], [164, 267], [267, 393], [268, 302], [302, 12], [12, 268], [312, 268], [268, 13], [13, 312], [298, 293], [293, 301], [301, 298], [265, 446], [446, 340], [340, 265], [280, 330], [330, 425], [425, 280],\n [322, 426], [426, 391], [391, 322], [420, 429], [429, 437], [437, 420], [393, 391], [391, 326], [326, 393], [344, 440], [440, 438], [438, 344], [458, 459], [459, 461], [461, 458], [364, 434], [434, 394], [394, 364],\n [428, 396], [396, 262], [262, 428], [274, 354], [354, 457], [457, 274], [317, 316], [316, 402], [402, 317], [316, 315], [315, 403], [403, 316], [315, 314], [314, 404], [404, 315], [314, 313], [313, 405], [405, 314],\n [313, 421], [421, 406], [406, 313], [323, 366], [366, 361], [361, 323], [292, 306], [306, 407], [407, 292], [306, 291], [291, 408], [408, 306], [291, 287], [287, 409], [409, 291], [287, 432], [432, 410], [410, 287],\n [427, 434], [434, 411], [411, 427], [372, 264], [264, 383], [383, 372], [459, 309], [309, 457], [457, 459], [366, 352], [352, 401], [401, 366], [1, 274], [274, 4], [4, 1], [418, 421], [421, 262], [262, 418],\n [331, 294], [294, 358], [358, 331], [435, 433], [433, 367], [367, 435], [392, 289], [289, 439], [439, 392], [328, 462], [462, 326], [326, 328], [94, 2], [2, 370], [370, 94], [289, 305], [305, 455], [455, 289],\n [339, 254], [254, 448], [448, 339], [359, 255], [255, 446], [446, 359], [254, 253], [253, 449], [449, 254], [253, 252], [252, 450], [450, 253], [252, 256], [256, 451], [451, 252], [256, 341], [341, 452], [452, 256],\n [414, 413], [413, 463], [463, 414], [286, 441], [441, 414], [414, 286], [286, 258], [258, 441], [441, 286], [258, 257], [257, 442], [442, 258], [257, 259], [259, 443], [443, 257], [259, 260], [260, 444], [444, 259],\n [260, 467], [467, 445], [445, 260], [309, 459], [459, 250], [250, 309], [305, 289], [289, 290], [290, 305], [305, 290], [290, 460], [460, 305], [401, 376], [376, 435], [435, 401], [309, 250], [250, 392], [392, 309],\n [376, 411], [411, 433], [433, 376], [453, 341], [341, 464], [464, 453], [357, 453], [453, 465], [465, 357], [343, 357], [357, 412], [412, 343], [437, 343], [343, 399], [399, 437], [344, 360], [360, 440], [440, 344],\n [420, 437], [437, 456], [456, 420], [360, 420], [420, 363], [363, 360], [361, 401], [401, 288], [288, 361], [265, 372], [372, 353], [353, 265], [390, 339], [339, 249], [249, 390], [339, 448], [448, 255], [255, 339],\n];\n\nfunction connectionsToIndices(connections: PairArray) {\n const indices = connections.map((connection) => connection[0]);\n indices.push(connections[connections.length - 1][1]);\n return indices;\n}\n\nexport const MEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR = {\n lips: connectionsToIndices(LIPS_CONNECTIONS),\n leftEye: connectionsToIndices(LEFT_EYE_CONNECTIONS),\n leftEyebrow: connectionsToIndices(LEFT_EYEBROW_CONNECTIONS),\n leftIris: connectionsToIndices(LEFT_IRIS_CONNECTIONS),\n rightEye: connectionsToIndices(RIGHT_EYE_CONNECTIONS),\n rightEyebrow: connectionsToIndices(RIGHT_EYEBROW_CONNECTIONS),\n rightIris: connectionsToIndices(RIGHT_IRIS_CONNECTIONS),\n faceOval: connectionsToIndices(FACE_OVAL_CONNECTIONS),\n};\n\nconst indexLabelPairs: [number, string][] = Object.entries(MEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR)\n .map(([label, indices]) => indices.map((index) => [index, label] as [number, string]))\n .flat();\n\nexport const MEDIAPIPE_FACE_MESH_KEYPOINTS = new Map(indexLabelPairs);\n\ntype AssignAverage = number[];\nexport interface LandmarksRefinementConfig {\n indexesMapping: number[]; // Maps indexes of the given set of landmarks to indexes of the resulting set of landmarks. Should be non empty and contain the same amount of indexes as landmarks in the corresponding input\n zRefinement: 'none'|'copy'|AssignAverage; // Z refinement instructions.\n}\n\nexport const LANDMARKS_REFINEMENT_LIPS_CONFIG = [\n 61, 146, 91, 181, 84, 17, 314, 405, 321, 375, 291, // Lower outer.\n 185, 40, 39, 37, 0, 267, 269, 270, 409, // Upper outer(excluding corners).\n 78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308, // Lower inner.\n 191, 80, 81, 82, 13, 312, 311, 310, 415, // Upper inner(excluding corners).\n 76, 77, 90, 180, 85, 16, 315, 404, 320, 307, 306, // Lower semi - outer.\n 184, 74, 73, 72, 11, 302, 303, 304, 408, // Upper semi - outer(excluding corners).\n 62, 96, 89, 179, 86, 15, 316, 403, 319, 325, 292, // Lower semi - inner.\n 183, 42, 41, 38, 12, 268, 271, 272, 407, // Upper semi - inner(excluding corners).\n];\n\nexport const LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG = [\n 33, 7, 163, 144, 145, 153, 154, 155, 133, // Lower contour.\n 246, 161, 160, 159, 158, 157, 173, // upper contour (excluding corners).\n 130, 25, 110, 24, 23, 22, 26, 112, 243, // Halo x2 lower contour.\n 247, 30, 29, 27, 28, 56, 190, // Halo x2 upper contour (excluding corners).\n 226, 31, 228, 229, 230, 231, 232, 233, 244, // Halo x3 lower contour.\n 113, 225, 224, 223, 222, 221, 189, // Halo x3 upper contour (excluding corners).\n 35, 124, 46, 53, 52, 65, // Halo x4 upper contour (no lower because of mesh structure) or eyebrow inner contour.\n 143, 111, 117, 118, 119, 120, 121, 128, 245, // Halo x5 lower contour.\n 156, 70, 63, 105, 66, 107, 55, 193, // Halo x5 upper contour (excluding corners) or eyebrow outer contour.\n];\n\nexport const LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG = [\n 263, 249, 390, 373, 374, 380, 381, 382, 362, // Lower contour.\n 466, 388, 387, 386, 385, 384, 398, // Upper contour (excluding corners).\n 359, 255, 339, 254, 253, 252, 256, 341, 463, // Halo x2 lower contour.\n 467, 260, 259, 257, 258, 286, 414, // Halo x2 upper contour (excluding corners).\n 446, 261, 448, 449, 450, 451, 452, 453, 464, // Halo x3 lower contour.\n 342, 445, 444, 443, 442, 441, 413, // Halo x3 upper contour (excluding corners).\n 265, 353, 276, 283, 282, 295, // Halo x4 upper contour (no lower because of mesh structure) or/ eyebrow inner contour.\n 372, 340, 346, 347, 348, 349, 350, 357, 465, // Halo x5 lower contour.\n 383, 300, 293, 334, 296, 336, 285, 417, // Halo x5 upper contour (excluding corners) or eyebrow outer contour.\n];\n\nexport const LANDMARKS_REFINEMENT_LEFT_IRIS_CONFIG = [\n 468, // Center.\n 469, // Iris right edge.\n 470, // Iris top edge.\n 471, // Iris left edge.\n 472, // Iris bottom edge.\n];\n/*\nzRefinement: [\n 33, 7, 163, 144, 145, 153, 154, 155, 133, // Lower contour.\n 246, 161, 160, 159, 158, 157, 173, // Upper contour (excluding corners).\n];\n*/\n\nexport const LANDMARKS_REFINEMENT_RIGHT_IRIS_CONFIG = [\n 473, // Center.\n 474, // Iris right edge.\n 475, // Iris top edge.\n 476, // Iris left edge.\n 477, // Iris bottom edge.\n];\n/*\nzRefinement: [\n 263, 249, 390, 373, 374, 380, 381, 382, 362, // Lower contour.\n 466, 388, 387, 386, 385, 384, 398, // Upper contour (excluding corners).\n];\n*/\n", "import { TRI468 as triangulation } from '../face/facemeshcoords';\nimport { mergeDeep } from '../util/util';\nimport { getCanvasContext, rad2deg, rect, point, lines, arrow, labels, replace } from './primitives';\nimport { options } from './options';\nimport * as facemeshConstants from '../face/constants';\nimport type { FaceResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\nlet localOptions: DrawOptions;\n\nfunction drawLabels(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (!localOptions.drawLabels || (localOptions.faceLabels?.length === 0)) return;\n let l = localOptions.faceLabels.slice();\n l = replace(l, '[id]', f.id.toFixed(0));\n if (f.score) l = replace(l, '[score]', 100 * f.score);\n if (f.gender) l = replace(l, '[gender]', f.gender);\n if (f.genderScore) l = replace(l, '[genderScore]', 100 * f.genderScore);\n if (f.age) l = replace(l, '[age]', f.age);\n if (f.distance) l = replace(l, '[distance]', 100 * f.distance);\n if (f.real) l = replace(l, '[real]', 100 * f.real);\n if (f.live) l = replace(l, '[live]', 100 * f.live);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n if (emotion.length > 3) emotion.length = 3;\n l = replace(l, '[emotions]', emotion.join(' '));\n }\n if (f.rotation?.angle?.roll) l = replace(l, '[roll]', rad2deg(f.rotation.angle.roll));\n if (f.rotation?.angle?.yaw) l = replace(l, '[yaw]', rad2deg(f.rotation.angle.yaw));\n if (f.rotation?.angle?.pitch) l = replace(l, '[pitch]', rad2deg(f.rotation.angle.pitch));\n if (f.rotation?.gaze?.bearing) l = replace(l, '[gaze]', rad2deg(f.rotation.gaze.bearing));\n labels(ctx, l, f.box[0], f.box[1], localOptions);\n}\n\nfunction drawIrisElipse(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n // iris: array[center, left, top, right, bottom]\n if (f.annotations?.leftEyeIris && f.annotations?.leftEyeIris[0]) {\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?.rightEyeIris && f.annotations?.rightEyeIris[0]) {\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\nfunction drawGazeSpheres(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawGaze && f.rotation?.angle && typeof Path2D !== 'undefined') {\n ctx.strokeStyle = 'pink';\n const valX = (f.box[0] + f.box[2] / 2) - (f.box[3] * rad2deg(f.rotation.angle.yaw) / 90);\n const valY = (f.box[1] + f.box[3] / 2) + (f.box[2] * rad2deg(f.rotation.angle.pitch) / 90);\n const pathV = new Path2D(`\n M ${f.box[0] + f.box[2] / 2} ${f.box[1]}\n C\n ${valX} ${f.box[1]},\n ${valX} ${f.box[1] + f.box[3]},\n ${f.box[0] + f.box[2] / 2} ${f.box[1] + f.box[3]}\n `);\n const pathH = new Path2D(`\n M ${f.box[0]} ${f.box[1] + f.box[3] / 2}\n C \n ${f.box[0]} ${valY},\n ${f.box[0] + f.box[2]} ${valY},\n ${f.box[0] + f.box[2]} ${f.box[1] + f.box[3] / 2}\n `);\n ctx.stroke(pathH);\n ctx.stroke(pathV);\n }\n}\n\nfunction drawGazeArrows(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawGaze && f.rotation?.gaze.strength && f.rotation.gaze.bearing && f.annotations.leftEyeIris && f.annotations.rightEyeIris && f.annotations.leftEyeIris[0] && f.annotations.rightEyeIris[0]) {\n ctx.strokeStyle = 'pink';\n ctx.fillStyle = 'pink';\n const leftGaze = [\n f.annotations.leftEyeIris[0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations.leftEyeIris[0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n arrow(ctx, [f.annotations.leftEyeIris[0][0], f.annotations.leftEyeIris[0][1]], [leftGaze[0], leftGaze[1]], 4);\n const rightGaze = [\n f.annotations.rightEyeIris[0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations.rightEyeIris[0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n arrow(ctx, [f.annotations.rightEyeIris[0][0], f.annotations.rightEyeIris[0][1]], [rightGaze[0], rightGaze[1]], 4);\n }\n}\n\nfunction drawFacePolygons(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawPolygons && f.mesh.length >= 468) {\n ctx.lineWidth = 1;\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [triangulation[i * 3 + 0], triangulation[i * 3 + 1], triangulation[i * 3 + 2]].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n drawIrisElipse(f, ctx);\n }\n /*\n if (localOptions.drawPolygons && f.contours.length > 1) {\n ctx.lineWidth = 5;\n lines(ctx, f.contours, opt);\n }\n ctx.lineWidth = 1;\n */\n}\n\nfunction drawFacePoints(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawPoints) {\n if (f?.mesh.length >= 468) {\n for (let i = 0; i < f.mesh.length; i++) {\n point(ctx, f.mesh[i][0], f.mesh[i][1], f.mesh[i][2], localOptions);\n if (localOptions.drawAttention) {\n if (facemeshConstants.LANDMARKS_REFINEMENT_LIPS_CONFIG.includes(i)) point(ctx, f.mesh[i][0], f.mesh[i][1], (f.mesh[i][2] as number) + 127, localOptions);\n if (facemeshConstants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.includes(i)) point(ctx, f.mesh[i][0], f.mesh[i][1], (f.mesh[i][2] as number) - 127, localOptions);\n if (facemeshConstants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.includes(i)) point(ctx, f.mesh[i][0], f.mesh[i][1], (f.mesh[i][2] as number) - 127, localOptions);\n }\n }\n } else {\n for (const [k, v] of Object.entries(f?.annotations || {})) {\n if (!v?.[0]) continue;\n const pt = v[0];\n point(ctx, pt[0], pt[1], 0, localOptions);\n if (localOptions.drawLabels) labels(ctx, k, pt[0], pt[1], localOptions);\n }\n }\n }\n}\n\nfunction drawFaceBoxes(f: FaceResult, ctx) {\n if (localOptions.drawBoxes) {\n rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n }\n}\n\n/** draw detected faces */\nexport function face(inCanvas: AnyCanvas, result: FaceResult[], drawOptions?: Partial) {\n localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n for (const f of result) {\n drawFaceBoxes(f, ctx);\n drawLabels(f, ctx);\n if (f.mesh && f.mesh.length > 0) {\n drawFacePoints(f, ctx);\n drawFacePolygons(f, ctx);\n drawGazeSpheres(f, ctx);\n drawGazeArrows(f, ctx);\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, rect, point, curves, colorDepth, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { BodyResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\n/** draw detected bodies */\nexport function body(inCanvas: AnyCanvas, result: BodyResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; 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 && result[i].box && result[i].box.length === 4) {\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels && (localOptions.bodyLabels?.length > 0)) {\n let l = localOptions.bodyLabels.slice();\n l = replace(l, '[id]', result[i].id.toFixed(0));\n l = replace(l, '[score]', 100 * result[i].score);\n labels(ctx, l, result[i].box[0], result[i].box[1], localOptions);\n }\n }\n if (localOptions.drawPoints && result[i].keypoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n if (!result[i].keypoints[pt].score || (result[i].keypoints[pt].score === 0)) continue;\n ctx.fillStyle = colorDepth(result[i].keypoints[pt].position[2], localOptions);\n point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions);\n }\n }\n if (localOptions.drawLabels && (localOptions.bodyPartLabels?.length > 0) && result[i].keypoints) {\n ctx.font = localOptions.font;\n for (const pt of result[i].keypoints) {\n if (!pt.score || (pt.score === 0)) continue;\n let l = localOptions.bodyPartLabels.slice();\n l = replace(l, '[label]', pt.part);\n l = replace(l, '[score]', 100 * pt.score);\n labels(ctx, l, pt.position[0], pt.position[1], localOptions);\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints && result[i].annotations) {\n for (const part of Object.values(result[i].annotations)) {\n for (const connected of part) curves(ctx, connected, localOptions);\n }\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, rect, point, colorDepth, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { HandResult } from '../result';\nimport type { AnyCanvas, DrawOptions, Point } from '../exports';\n\n/** draw detected hands */\nexport function hand(inCanvas: AnyCanvas, result: HandResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\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 rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels && (localOptions.handLabels?.length > 0)) {\n let l = localOptions.handLabels.slice();\n l = replace(l, '[id]', h.id.toFixed(0));\n l = replace(l, '[label]', h.label);\n l = replace(l, '[score]', 100 * h.score);\n labels(ctx, l, h.box[0], h.box[1], localOptions);\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.keypoints && h.keypoints.length > 0) {\n for (const pt of h.keypoints) {\n ctx.fillStyle = colorDepth(pt[2], localOptions);\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels && h.annotations && (localOptions.fingerLabels?.length > 0)) {\n for (const [part, pt] of Object.entries(h.annotations)) {\n let l = localOptions.fingerLabels.slice();\n l = replace(l, '[label]', part);\n labels(ctx, l, pt[pt.length - 1][0], pt[pt.length - 1][1], localOptions);\n }\n }\n if (localOptions.drawPolygons && h.annotations) {\n const addHandLine = (part: Point[]) => {\n if (!part || part.length === 0 || !part[0]) return;\n for (let i = 0; i < part.length; i++) {\n ctx.beginPath();\n const z = part[i][2] || 0;\n ctx.strokeStyle = colorDepth(i * z, localOptions);\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 ctx.lineWidth = localOptions.lineWidth;\n addHandLine(h.annotations.index);\n addHandLine(h.annotations.middle);\n addHandLine(h.annotations.ring);\n addHandLine(h.annotations.pinky);\n addHandLine(h.annotations.thumb);\n // addPart(h.annotations.palm);\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, rect, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { ObjectResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\n/** draw detected objects */\nexport function object(inCanvas: AnyCanvas, result: ObjectResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\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 rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels && (localOptions.objectLabels?.length > 0)) {\n let l = localOptions.objectLabels.slice();\n l = replace(l, '[id]', h.id.toFixed(0));\n l = replace(l, '[label]', h.label);\n l = replace(l, '[score]', 100 * h.score);\n labels(ctx, l, h.box[0], h.box[1], localOptions);\n }\n ctx.stroke();\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { GestureResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\n/** draw detected gestures */\nexport function gesture(inCanvas: AnyCanvas, result: GestureResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (localOptions.drawGestures && (localOptions.gestureLabels?.length > 0)) {\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\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 const [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && ((what[1] as string).length > 0)) {\n const who = where[1] as number > 0 ? `#${where[1]}` : '';\n let l = localOptions.gestureLabels.slice();\n l = replace(l, '[where]', where[0]);\n l = replace(l, '[who]', who);\n l = replace(l, '[what]', what[1]);\n labels(ctx, l, 8, 2 + (i * localOptions.lineHeight), localOptions);\n i += 1;\n }\n }\n }\n}\n", "export const defaultLabels = {\n face: `face\n confidence: [score]%\n [gender] [genderScore]%\n age: [age] years\n distance: [distance]cm\n real: [real]%\n live: [live]%\n [emotions]\n roll: [roll]\u00B0 yaw:[yaw]\u00B0 pitch:[pitch]\u00B0\n gaze: [gaze]\u00B0`,\n body: 'body [score]%',\n bodyPart: '[label] [score]%',\n object: '[label] [score]%',\n hand: '[label] [score]%',\n finger: '[label]',\n gesture: '[where] [who]: [what]',\n};\n", "/* eslint-disable no-multi-spaces */\n\nexport const kpt: string[] = [\n 'nose', // 0\n 'leftEyeInside', // 1\n 'leftEye', // 2\n 'leftEyeOutside', // 3\n 'rightEyeInside', // 4\n 'rightEye', // 5\n 'rightEyeOutside', // 6\n 'leftEar', // 7\n 'rightEar', // 8\n 'leftMouth', // 9\n 'rightMouth', // 10\n 'leftShoulder', // 11\n 'rightShoulder', // 12\n 'leftElbow', // 13\n 'rightElbow', // 14\n 'leftWrist', // 15\n 'rightWrist', // 16\n 'leftPinky', // 17\n 'rightPinky', // 18\n 'leftIndex', // 19\n 'rightIndex', // 20\n 'leftThumb', // 21\n 'rightThumb', // 22\n 'leftHip', // 23\n 'rightHip', // 24\n 'leftKnee', // 25\n 'rightKnee', // 26\n 'leftAnkle', // 27\n 'rightAnkle', // 28\n 'leftHeel', // 29\n 'rightHeel', // 30\n 'leftFoot', // 31\n 'rightFoot', // 32\n 'bodyCenter', // 33\n 'bodyTop', // 34\n 'leftPalm', // 35 // z-coord not ok\n 'leftHand', // 36 // similar to wrist but z-coord not ok\n 'rightPalm', // 37 // z-coord not ok\n 'rightHand', // 38 // similar to wrist but z-coord not ok\n];\n\nexport const connected: Record = {\n shoulders: ['leftShoulder', 'rightShoulder'],\n hips: ['rightHip', 'leftHip'],\n mouth: ['leftMouth', 'rightMouth'],\n leftLegUpper: ['leftHip', 'leftKnee'],\n leftLegLower: ['leftKnee', 'leftAnkle'],\n leftFoot: ['leftAnkle', 'leftHeel', 'leftFoot'],\n leftTorso: ['leftShoulder', 'leftHip'],\n leftArmUpper: ['leftShoulder', 'leftElbow'],\n leftArmLower: ['leftElbow', 'leftWrist'],\n leftHand: ['leftWrist', 'leftPalm'],\n leftHandPinky: ['leftPalm', 'leftPinky'],\n leftHandIndex: ['leftPalm', 'leftIndex'],\n leftHandThumb: ['leftPalm', 'leftThumb'],\n leftEyeOutline: ['leftEyeInside', 'leftEyeOutside'],\n rightLegUpper: ['rightHip', 'rightKnee'],\n rightLegLower: ['rightKnee', 'rightAnkle'],\n rightFoot: ['rightAnkle', 'rightHeel', 'rightFoot'],\n rightTorso: ['rightShoulder', 'rightHip'],\n rightArmUpper: ['rightShoulder', 'rightElbow'],\n rightArmLower: ['rightElbow', 'rightWrist'],\n rightHand: ['rightWrist', 'rightPalm'],\n rightHandPinky: ['rightPalm', 'rightPinky'],\n rightHandIndex: ['rightPalm', 'rightIndex'],\n rightHandThumb: ['rightPalm', 'rightThumb'],\n rightEyeOutline: ['rightEyeInside', 'rightEyeOutside'],\n};\n", "import * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { env } from '../util/env';\nimport { loadModel } from '../tfjs/load';\nimport type { Box } from '../result';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor1D, Tensor2D } from '../tfjs/types';\n\nexport interface DetectedBox { box: Box, boxRaw: Box, score: number }\n\nlet model: GraphModel | null;\nlet inputSize = 224;\nlet anchorTensor: { x, y };\nconst numLayers = 5;\nconst strides = [8, 16, 32, 32, 32];\n\nexport function createAnchors() {\n const anchors: { x: number, y: number }[] = [];\n let layerId = 0;\n while (layerId < numLayers) {\n let anchorCount = 0;\n let lastSameStrideLayer = layerId;\n while (lastSameStrideLayer < strides.length && strides[lastSameStrideLayer] === strides[layerId]) {\n anchorCount += 2;\n lastSameStrideLayer++;\n }\n const stride = strides[layerId];\n const featureMapHeight = Math.ceil(inputSize / stride);\n const featureMapWidth = Math.ceil(inputSize / stride);\n for (let y = 0; y < featureMapHeight; ++y) {\n for (let x = 0; x < featureMapWidth; ++x) {\n for (let anchorId = 0; anchorId < anchorCount; ++anchorId) {\n anchors.push({ x: (x + 0.5) / featureMapWidth, y: (y + 0.5) / featureMapHeight });\n }\n }\n }\n layerId = lastSameStrideLayer;\n }\n anchorTensor = { x: tf.tensor1d(anchors.map((a) => a.x)), y: tf.tensor1d(anchors.map((a) => a.y)) };\n}\n\nexport async function loadDetector(config: Config): Promise {\n if (env.initial) model = null;\n if (!model && config.body['detector'] && config.body['detector'].modelPath || '') {\n model = await loadModel(config.body['detector'].modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n } else if (config.debug && model) log('cached model:', model['modelUrl']);\n createAnchors();\n return model as GraphModel;\n}\n\nconst cropFactor = [5.0, 5.0];\nexport function decodeBoxes(boxesTensor, anchor) {\n return tf.tidy(() => {\n const split = tf.split(boxesTensor, 12, 1); // first 4 are box data [x,y,w,h] and 4 are keypoints data [x,y] for total of 12\n let xCenter = tf.squeeze(split[0]);\n let yCenter = tf.squeeze(split[1]);\n let width = tf.squeeze(split[2]);\n let height = tf.squeeze(split[3]);\n xCenter = tf.add(tf.div(xCenter, inputSize), anchor.x);\n yCenter = tf.add(tf.div(yCenter, inputSize), anchor.y);\n width = tf.mul(tf.div(width, inputSize), cropFactor[0]);\n height = tf.mul(tf.div(height, inputSize), cropFactor[1]);\n const xMin = tf.sub(xCenter, tf.div(width, 2));\n const yMin = tf.sub(yCenter, tf.div(height, 2));\n const xMax = tf.add(xMin, width);\n const yMax = tf.add(yMin, height);\n const boxes = tf.stack([xMin, yMin, xMax, yMax], 1);\n return boxes;\n });\n}\n\nasync function decodeResults(boxesTensor: Tensor, logitsTensor: Tensor, config: Config, outputSize: [number, number]): Promise {\n const detectedBoxes: DetectedBox[] = [];\n const t: Record = {};\n t.boxes = decodeBoxes(boxesTensor, anchorTensor);\n t.scores = tf.sigmoid(logitsTensor);\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.scores as Tensor1D, 1, config.body['detector']?.minConfidence || 0.1, config.body['detector']?.iouThreshold || 0.1);\n const nms = await t.nms.data();\n const scores = await t.scores.data();\n const boxes = await t.boxes.array();\n for (const i of Array.from(nms)) {\n const score = scores[i];\n const boxRaw: Box = boxes[i];\n const box: Box = [Math.round(boxRaw[0] * outputSize[0]), Math.round(boxRaw[1] * outputSize[1]), Math.round(boxRaw[2] * outputSize[0]), Math.round(boxRaw[3] * outputSize[1])];\n const detectedBox: DetectedBox = { score, boxRaw, box };\n detectedBoxes.push(detectedBox);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return detectedBoxes;\n}\n\nexport async function detectBoxes(input: Tensor, config: Config, outputSize: [number, number]) {\n const t: Record = {};\n t.res = model?.execute(input, ['Identity']) as Tensor; //\n t.logitsRaw = tf.slice(t.res, [0, 0, 0], [1, -1, 1]);\n t.boxesRaw = tf.slice(t.res, [0, 0, 1], [1, -1, -1]);\n t.logits = tf.squeeze(t.logitsRaw);\n t.boxes = tf.squeeze(t.boxesRaw);\n const boxes = await decodeResults(t.boxes, t.logits, config, outputSize);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return boxes;\n}\n", "import type { Point, Box } from '../result';\n\nexport function calc(keypoints: Point[], outputSize: [number, number] = [1, 1]) {\n const coords = [keypoints.map((pt) => pt[0]), keypoints.map((pt) => pt[1])]; // all x/y coords\n const min = [Math.min(...coords[0]), Math.min(...coords[1])];\n const max = [Math.max(...coords[0]), Math.max(...coords[1])];\n const box: Box = [min[0], min[1], max[0] - min[0], max[1] - min[1]];\n const boxRaw: Box = [box[0] / outputSize[0], box[1] / outputSize[1], box[2] / outputSize[0], box[3] / outputSize[1]];\n return { box, boxRaw };\n}\n\nexport function square(keypoints: Point[], outputSize: [number, number] = [1, 1]) {\n const coords = [keypoints.map((pt) => pt[0]), keypoints.map((pt) => pt[1])]; // all x/y coords\n const min = [Math.min(...coords[0]), Math.min(...coords[1])];\n const max = [Math.max(...coords[0]), Math.max(...coords[1])];\n const center = [(min[0] + max[0]) / 2, (min[1] + max[1]) / 2]; // find center x and y coord of all fingers\n const dist = Math.max(center[0] - min[0], center[1] - min[1], -center[0] + max[0], -center[1] + max[1]); // largest distance from center in any direction\n const box: Box = [Math.trunc(center[0] - dist), Math.trunc(center[1] - dist), Math.trunc(2 * dist), Math.trunc(2 * dist)];\n const boxRaw: Box = [box[0] / outputSize[0], box[1] / outputSize[1], box[2] / outputSize[0], box[3] / outputSize[1]];\n return { box, boxRaw };\n}\n\nexport function scale(box: Box, scaleFact: number) {\n const dist = [box[2] * scaleFact, box[3] * scaleFact];\n const newBox: Box = [\n box[0] - (dist[0] - box[2]) / 2,\n box[1] - (dist[1] - box[3]) / 2,\n dist[0],\n dist[1],\n ];\n return newBox;\n}\n\nexport function crop(box: Box) { // [y1, x1, y2, x2] clamped to 0..1\n const yxBox: Box = [Math.max(0, box[1]), Math.max(0, box[0]), Math.min(1, box[3] + box[1]), Math.min(1, box[2] + box[0])];\n return yxBox;\n}\n", "/**\n * BlazePose model implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport { log, now } from '../util/util';\nimport type { BodyKeypoint, BodyResult, BodyLandmark, Box, Point, BodyAnnotation } from '../result';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport * as coords from './blazeposecoords';\nimport { loadDetector, detectBoxes, DetectedBox } from './blazeposedetector';\nimport * as box from '../util/box';\nimport { env } from '../util/env';\n\n// const models: [GraphModel | null, GraphModel | null] = [null, null];\nlet model: GraphModel | null;\nlet inputSize = 256;\nlet skipped = Number.MAX_SAFE_INTEGER;\nconst outputNodes: { detector: string[], landmarks: string[] } = {\n landmarks: ['ld_3d', 'activation_segmentation', 'activation_heatmap', 'world_3d', 'output_poseflag'],\n detector: [],\n};\n\nconst cache: BodyResult[] = [];\nlet padding: [number, number][] = [[0, 0], [0, 0], [0, 0], [0, 0]];\nlet lastTime = 0;\n\nconst sigmoid = (x) => (1 - (1 / (1 + Math.exp(x))));\n\nexport const loadDetect = (config: Config): Promise => loadDetector(config);\n\nexport async function loadPose(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await loadModel(config.body.modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nfunction prepareImage(input: Tensor4D, size: number, cropBox?: Box): Tensor {\n const t: Record = {};\n if (!input?.shape?.[1] || !input?.shape?.[2]) return input;\n let final: Tensor;\n if (cropBox) {\n t.cropped = tf.image.cropAndResize(input, [cropBox], [0], [input.shape[1], input.shape[2]]); // if we have cached box use it to crop input\n }\n if (input.shape[1] !== input.shape[2]) { // only pad if width different than height\n const height: [number, number] = [\n input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0,\n input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0,\n ];\n const width: [number, number] = [\n input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0,\n input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0,\n ];\n padding = [\n [0, 0], // dont touch batch\n height, // height before&after\n width, // width before&after\n [0, 0], // dont touch rbg\n ];\n t.pad = tf.pad(t.cropped || input, padding); // use cropped box if it exists\n t.resize = tf.image.resizeBilinear(t.pad as Tensor4D, [size, size]);\n final = tf.div(t.resize, constants.tf255);\n } else if (input.shape[1] !== size) { // if input needs resizing\n t.resize = tf.image.resizeBilinear(t.cropped as Tensor4D || input, [size, size]);\n final = tf.div(t.resize, constants.tf255);\n } else { // if input is already in a correct resolution just normalize it\n final = tf.div(t.cropped || input, constants.tf255);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return final;\n}\n\nfunction rescaleKeypoints(keypoints: BodyKeypoint[], outputSize: [number, number], cropBox?: Box): BodyKeypoint[] {\n for (const kpt of keypoints) { // first rescale due to padding\n kpt.position = [\n Math.trunc(kpt.position[0] * (outputSize[0] + padding[2][0] + padding[2][1]) / outputSize[0] - padding[2][0]),\n Math.trunc(kpt.position[1] * (outputSize[1] + padding[1][0] + padding[1][1]) / outputSize[1] - padding[1][0]),\n kpt.position[2] as number,\n ];\n kpt.positionRaw = [kpt.position[0] / outputSize[0], kpt.position[1] / outputSize[1], 2 * (kpt.position[2] as number) / (outputSize[0] + outputSize[1])];\n }\n if (cropBox) { // second rescale due to cropping\n const width = cropBox[2] - cropBox[0];\n const height = cropBox[3] - cropBox[1];\n for (const kpt of keypoints) {\n kpt.positionRaw = [\n kpt.positionRaw[0] / height + cropBox[1], // correct offset due to crop\n kpt.positionRaw[1] / width + cropBox[0], // correct offset due to crop\n kpt.positionRaw[2] as number,\n ];\n kpt.position = [\n Math.trunc(kpt.positionRaw[0] * outputSize[0]),\n Math.trunc(kpt.positionRaw[1] * outputSize[1]),\n kpt.positionRaw[2] as number,\n ];\n }\n }\n return keypoints;\n}\n\nfunction fixKeypoints(keypoints: BodyKeypoint[]) {\n // palm z-coord is incorrect around near-zero so we approximate it\n const leftPalm = keypoints.find((k) => k.part === 'leftPalm') as BodyKeypoint;\n const leftWrist = keypoints.find((k) => k.part === 'leftWrist') as BodyKeypoint;\n const leftIndex = keypoints.find((k) => k.part === 'leftIndex') as BodyKeypoint;\n leftPalm.position[2] = ((leftWrist.position[2] || 0) + (leftIndex.position[2] || 0)) / 2;\n const rightPalm = keypoints.find((k) => k.part === 'rightPalm') as BodyKeypoint;\n const rightWrist = keypoints.find((k) => k.part === 'rightWrist') as BodyKeypoint;\n const rightIndex = keypoints.find((k) => k.part === 'rightIndex') as BodyKeypoint;\n rightPalm.position[2] = ((rightWrist.position[2] || 0) + (rightIndex.position[2] || 0)) / 2;\n}\n\nasync function detectLandmarks(input: Tensor, config: Config, outputSize: [number, number]): Promise {\n /**\n * t.ld: 39 keypoints [x,y,z,score,presence] normalized to input size\n * t.segmentation:\n * t.heatmap:\n * t.world: 39 keypoints [x,y,z] normalized to -1..1\n * t.poseflag: body score\n */\n if (!model?.['executor']) return null;\n const t: Record = {};\n [t.ld/* 1,195(39*5) */, t.segmentation/* 1,256,256,1 */, t.heatmap/* 1,64,64,39 */, t.world/* 1,117(39*3) */, t.poseflag/* 1,1 */] = model?.execute(input, outputNodes.landmarks) as Tensor[]; // run model\n const poseScore = (await t.poseflag.data())[0];\n const points = await t.ld.data();\n const distances = await t.world.data();\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor])); // dont need tensors after this\n const keypointsRelative: BodyKeypoint[] = [];\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n const score = sigmoid(points[depth * i + 3]);\n const presence = sigmoid(points[depth * i + 4]);\n const adjScore = Math.trunc(100 * score * presence * poseScore) / 100;\n const positionRaw: Point = [points[depth * i + 0] / inputSize, points[depth * i + 1] / inputSize, points[depth * i + 2] + 0];\n const position: Point = [Math.trunc(outputSize[0] * positionRaw[0]), Math.trunc(outputSize[1] * positionRaw[1]), positionRaw[2] as number];\n const distance: Point = [distances[depth * i + 0], distances[depth * i + 1], distances[depth * i + 2] + 0];\n keypointsRelative.push({ part: coords.kpt[i] as BodyLandmark, positionRaw, position, distance, score: adjScore });\n }\n if (poseScore < (config.body.minConfidence || 0)) return null;\n fixKeypoints(keypointsRelative);\n const keypoints: BodyKeypoint[] = rescaleKeypoints(keypointsRelative, outputSize); // keypoints were relative to input image which is padded\n const kpts = keypoints.map((k) => k.position);\n const boxes = box.calc(kpts, [outputSize[0], outputSize[1]]); // now find boxes based on rescaled keypoints\n const annotations: Record = {} as Record;\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kpt) => kpt.part === indexes[i]);\n const pt1 = keypoints.find((kpt) => kpt.part === indexes[i + 1]);\n if (pt0 && pt1) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n const body = { id: 0, score: Math.trunc(100 * poseScore) / 100, box: boxes.box, boxRaw: boxes.boxRaw, keypoints, annotations };\n return body;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n const outputSize: [number, number] = [input.shape[2] || 0, input.shape[1] || 0];\n const skipTime = (config.body.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.body.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && cache !== null) {\n skipped++;\n } else {\n let boxes: DetectedBox[] = [];\n if (config.body?.['detector']?.['enabled']) {\n const preparedImage = prepareImage(input, 224);\n boxes = await detectBoxes(preparedImage, config, outputSize);\n tf.dispose(preparedImage);\n } else {\n boxes = [{ box: [0, 0, 0, 0] as Box, boxRaw: [0, 0, 1, 1], score: 0 }]; // running without detector\n }\n for (let i = 0; i < boxes.length; i++) {\n const preparedBox = prepareImage(input, 256, boxes[i]?.boxRaw); // padded and resized\n cache.length = 0;\n const bodyResult = await detectLandmarks(preparedBox, config, outputSize);\n tf.dispose(preparedBox);\n if (!bodyResult) continue;\n bodyResult.id = i;\n // bodyResult.score = 0; // TBD\n cache.push(bodyResult);\n }\n /*\n cropBox = [0, 0, 1, 1]; // reset crop coordinates\n if (cache?.boxRaw && config.skipAllowed) {\n const cx = (2.0 * cache.boxRaw[0] + cache.boxRaw[2]) / 2;\n const cy = (2.0 * cache.boxRaw[1] + cache.boxRaw[3]) / 2;\n let size = cache.boxRaw[2] > cache.boxRaw[3] ? cache.boxRaw[2] : cache.boxRaw[3];\n size = (size * 1.0) / 2; // enlarge and half it\n if (cx > 0.1 && cx < 0.9 && cy > 0.1 && cy < 0.9 && size > 0.1) { // only update if box is sane\n const y = 0; // cy - size;\n const x = cx - size;\n cropBox = [y, x, y + 1, x + 1]; // [y0,x0,y1,x1] used for cropping but width/height are not yet implemented so we only reposition image to center of body\n }\n }\n */\n lastTime = now();\n skipped = 0;\n }\n return cache;\n}\n", "/**\n * CoCo Labels used by object detection implementations\n */\nexport 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", "/**\n * CenterNet object detection model implementation\n *\n * Based on: [**MB3-CenterNet**](https://github.com/610265158/mobilenetv3_centernet)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { labels } from './labels';\nimport type { ObjectResult, ObjectType, Box } from '../result';\nimport type { GraphModel, Tensor, Tensor1D, Tensor2D, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nlet last: ObjectResult[] = [];\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n // fakeOps(['floormod'], config);\n model = await loadModel(config.object.modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nasync function process(res: Tensor | null, outputShape: [number, number], config: Config) {\n if (!res) return [];\n const t: Record = {};\n const results: ObjectResult[] = [];\n const detections = await res.array() as number[][][];\n t.squeeze = tf.squeeze(res);\n const arr = tf.split(t.squeeze, 6, 1); // x1, y1, x2, y2, score, class\n t.stack = tf.stack([arr[1], arr[0], arr[3], arr[2]], 1); // reorder dims as tf.nms expects y, x\n t.boxes = tf.squeeze(t.stack);\n t.scores = tf.squeeze(arr[4]);\n t.classes = tf.squeeze(arr[5]);\n tf.dispose([res, ...arr]);\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.scores as Tensor1D, config.object.maxDetected || 0, config.object.iouThreshold, (config.object.minConfidence || 0));\n const nms = await t.nms.data();\n let i = 0;\n for (const id of Array.from(nms)) {\n const score = Math.trunc(100 * detections[0][id][4]) / 100;\n const classVal = detections[0][id][5];\n if (Number.isNaN(classVal)) continue;\n const label = labels[classVal].label as ObjectType;\n const [x, y] = [\n detections[0][id][0] / inputSize,\n detections[0][id][1] / inputSize,\n ];\n const boxRaw: Box = [\n x,\n y,\n detections[0][id][2] / inputSize - x,\n detections[0][id][3] / inputSize - y,\n ];\n const box: Box = [\n Math.trunc(boxRaw[0] * outputShape[0]),\n Math.trunc(boxRaw[1] * outputShape[1]),\n Math.trunc(boxRaw[2] * outputShape[0]),\n Math.trunc(boxRaw[3] * outputShape[1]),\n ];\n results.push({ id: i++, score, class: classVal, label, box, boxRaw });\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return results;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model?.['executor']) return [];\n const skipTime = (config.object.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.object.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const outputSize = [input.shape[2] || 0, input.shape[1] || 0] as [number, number];\n const resize = tf.image.resizeBilinear(input, [inputSize, inputSize]);\n const objectT = config.object.enabled ? model?.execute(resize, ['tower_0/detections']) as Tensor : null;\n lastTime = now();\n tf.dispose(resize);\n\n const obj = await process(objectT, outputSize, config);\n last = obj;\n\n resolve(obj);\n });\n}\n", "export const kpt: string[] = [\n 'head',\n 'neck',\n 'rightShoulder',\n 'rightElbow',\n 'rightWrist',\n 'chest',\n 'leftShoulder',\n 'leftElbow',\n 'leftWrist',\n 'bodyCenter',\n 'rightHip',\n 'rightKnee',\n 'rightAnkle',\n 'leftHip',\n 'leftKnee',\n 'leftAnkle',\n];\n\nexport const connected: Record = {\n leftLeg: ['leftHip', 'leftKnee', 'leftAnkle'],\n rightLeg: ['rightHip', 'rightKnee', 'rightAnkle'],\n torso: ['leftShoulder', 'rightShoulder', 'rightHip', 'leftHip', 'leftShoulder'],\n leftArm: ['leftShoulder', 'leftElbow', 'leftWrist'],\n rightArm: ['rightShoulder', 'rightElbow', 'rightWrist'],\n head: [],\n};\n", "/**\n * EfficientPose model implementation\n *\n * Based on: [**EfficientPose**](https://github.com/daniegr/EfficientPose)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport * as coords from './efficientposecoords';\nimport { constants } from '../tfjs/constants';\nimport type { BodyResult, Point, BodyLandmark, BodyAnnotation } from '../result';\nimport type { GraphModel, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet lastTime = 0;\nconst cache: BodyResult = { id: 0, keypoints: [], box: [0, 0, 0, 0], boxRaw: [0, 0, 0, 0], score: 0, annotations: {} as Record };\n\n// const keypoints: Array = [];\n// let box: Box = [0, 0, 0, 0];\n// let boxRaw: Box = [0, 0, 0, 0];\n// let score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.body.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// performs argmax and max functions on a 2d tensor\nasync function max2d(inputs, minScore): Promise<[number, number, number]> {\n const [width, height] = inputs.shape;\n const reshaped = tf.reshape(inputs, [height * width]); // combine all data\n const max = tf.max(reshaped, 0);\n const newScore: number = (await max.data())[0]; // get highest score\n if (newScore > minScore) { // skip coordinate calculation is score is too low\n const coordinates = tf.argMax(reshaped, 0);\n const mod = tf.mod(coordinates, width);\n const x = (await mod.data())[0];\n const div = tf.div(coordinates, width);\n const y: number = (await div.data())[0];\n tf.dispose([reshaped, max, coordinates, mod, div]);\n return [x, y, newScore];\n }\n tf.dispose([reshaped, max]);\n return [0, 0, newScore];\n}\n\nexport async function predict(image: Tensor4D, config: Config): Promise {\n if (!model?.['executor'] || !model?.inputs[0].shape) return [];\n const skipTime = (config.body.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.body.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && Object.keys(cache.keypoints).length > 0) {\n skipped++;\n return [cache];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape?.[2] || 0, model?.inputs[0].shape?.[1] || 0], false);\n const enhance = tf.mul(resize, constants.tf2);\n const norm = tf.sub(enhance, constants.tf1);\n return norm;\n });\n let resT;\n if (config.body.enabled) resT = model?.execute(tensor);\n lastTime = now();\n tf.dispose(tensor);\n\n if (resT) {\n cache.keypoints.length = 0;\n const squeeze = tf.squeeze(resT);\n tf.dispose(resT);\n // body parts are basically just a stack of 2d tensors\n const stack = tf.unstack(squeeze, 2);\n tf.dispose(squeeze);\n\n // process each unstacked tensor as a separate body part\n for (let id = 0; id < stack.length; id++) {\n // actual processing to get coordinates and score\n const [x, y, partScore] = await max2d(stack[id], config.body.minConfidence);\n if (partScore > (config.body.minConfidence || 0)) {\n cache.keypoints.push({\n score: Math.round(100 * partScore) / 100,\n part: coords.kpt[id] as BodyLandmark,\n positionRaw: [ // normalized to 0..1\n // @ts-ignore model is not undefined here\n x / model.inputs[0].shape[2], y / model.inputs[0].shape[1],\n ],\n position: [ // normalized to input image size\n // @ts-ignore model is not undefined here\n Math.round(image.shape[2] * x / model.inputs[0].shape[2]), Math.round(image.shape[1] * y / model.inputs[0].shape[1]),\n ],\n });\n }\n }\n stack.forEach((s) => tf.dispose(s));\n }\n cache.score = cache.keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = cache.keypoints.map((a) => a.position[0]);\n const y = cache.keypoints.map((a) => a.position[1]);\n cache.box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = cache.keypoints.map((a) => a.positionRaw[0]);\n const yRaw = cache.keypoints.map((a) => a.positionRaw[1]);\n cache.boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = cache.keypoints.find((kpt) => kpt.part === indexes[i]);\n const pt1 = cache.keypoints.find((kpt) => kpt.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n cache.annotations[name] = pt;\n }\n resolve([cache]);\n });\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as coords from './facemeshcoords';\nimport { constants } from '../tfjs/constants';\nimport type { Box, Point } from '../result';\nimport { env } from '../util/env';\n\nexport const createBox = (startEndTensor) => ({ startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]), endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]) });\n\nexport const disposeBox = (t) => tf.dispose([t.startPoint, t.endPoint]);\n\nexport const getBoxSize = (box): [number, number] => [Math.abs(box.endPoint[0] - box.startPoint[0]), Math.abs(box.endPoint[1] - box.startPoint[1])];\n\nexport const getBoxCenter = (box): [number, number, number] => [box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2, box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2, 1];\n\nexport const clampBox = (box, input): Box => (box ? [\n Math.trunc(Math.max(0, box.startPoint[0])),\n Math.trunc(Math.max(0, box.startPoint[1])),\n Math.trunc(Math.min((input.shape[2] || 0), box.endPoint[0]) - Math.max(0, box.startPoint[0])),\n Math.trunc(Math.min((input.shape[1] || 0), box.endPoint[1]) - Math.max(0, box.startPoint[1])),\n] : [0, 0, 0, 0]);\n\nexport const getRawBox = (box, input): Box => (box ? [\n box.startPoint[0] / (input.shape[2] || 0),\n box.startPoint[1] / (input.shape[1] || 0),\n (box.endPoint[0] - box.startPoint[0]) / (input.shape[2] || 0),\n (box.endPoint[1] - box.startPoint[1]) / (input.shape[1] || 0),\n] : [0, 0, 0, 0]);\n\nexport const scaleBoxCoordinates = (box, factor, anchor) => {\n const startPoint: Point = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint: Point = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n // const centerPoint = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];\n const landmarks = box.landmarks.map((pt) => [(pt[0] + anchor[0]) * factor[0], (pt[1] + anchor[1]) * factor[1]]);\n /**\n face.mesh = box.landmarks.map((pt) => [\n ((box.startPoint[0] + box.endPoint[0]) / 2) + (pt[0] * input.shape[2] / blazeface.size()),\n ((box.startPoint[1] + box.endPoint[1]) / 2) + (pt[1] * input.shape[1] / blazeface.size()),\n ]);\n */\n\n return { startPoint, endPoint, landmarks, confidence: box.confidence };\n};\n\nexport const cutAndResize = (box, image, cropSize) => {\n const h = image.shape[1];\n const w = image.shape[2];\n const cutBox = [box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h, box.endPoint[0] / w];\n const crop = tf.image.cropAndResize(image, [cutBox], [0], cropSize);\n const norm = tf.div(crop, constants.tf255);\n tf.dispose(crop);\n return norm;\n};\n\nexport const enlargeBox = (box, factor) => {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize: [number, number] = [factor * size[0] / 2, factor * size[1] / 2];\n return {\n startPoint: [center[0] - halfSize[0], center[1] - halfSize[1]] as Point,\n endPoint: [center[0] + halfSize[0], center[1] + halfSize[1]] as Point,\n landmarks: box.landmarks,\n confidence: box.confidence,\n size,\n };\n};\n\nexport const squarifyBox = (box) => {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize = Math.max(...size) / 2;\n return {\n startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)] as Point,\n endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)] as Point,\n landmarks: box.landmarks,\n confidence: box.confidence,\n size: [Math.round(size[0]), Math.round(size[1])] as [number, number],\n };\n};\n\nexport const calculateLandmarksBoundingBox = (landmarks) => {\n const x = landmarks.map((d) => d[0]);\n const y = landmarks.map((d) => d[1]);\n return {\n startPoint: [Math.min(...x), Math.min(...y)] as Point,\n endPoint: [Math.max(...x), Math.max(...y)] as Point,\n landmarks,\n };\n};\n\nexport const fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n\nexport const normalizeRadians = (angle: number) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n\nexport const computeRotation = (point1, point2) => normalizeRadians(Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]));\n\nexport const radToDegrees = (rad) => rad * 180 / Math.PI;\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport const dot = (v1: number[], v2: number[]) => {\n let product = 0;\n for (let i = 0; i < v1.length; i++) product += v1[i] * v2[i];\n return product;\n};\n\nexport const getColumnFrom2DArr = (arr, columnIndex) => {\n const column: number[] = [];\n for (let i = 0; i < arr.length; i++) column.push(arr[i][columnIndex]);\n return column;\n};\n\nexport const multiplyTransformMatrices = (mat1, mat2) => {\n const product: number[][] = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n return product;\n};\n\nexport const 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 const 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 = [-dot(rotationComponent[0], translationComponent), -dot(rotationComponent[1], translationComponent)];\n return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];\n};\n\nexport const rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];\n\nexport const xyDistanceBetweenPoints = (a, b) => Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n\nexport function generateAnchors(inputSize: number) {\n const spec = inputSize === 192\n ? { strides: [4], anchors: [1] } // facemesh-detector\n : { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] }; // blazeface\n const anchors: [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++) anchors.push([anchorX, anchorY]);\n }\n }\n }\n return anchors;\n}\n\nexport function transformRawCoords(coordsRaw, box, angle, rotationMatrix, inputSize) {\n const boxSize = getBoxSize(box);\n const coordsScaled = coordsRaw.map((coord) => ([ // scaled around zero-point\n (boxSize[0] / inputSize) * (coord[0] - (inputSize / 2)),\n (boxSize[1] / inputSize) * (coord[1] - (inputSize / 2)),\n (coord[2] || 0),\n ]));\n const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2);\n const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix;\n const coordsRotated = largeAngle ? coordsScaled.map((coord) => ([...rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix;\n const boxCenter = getBoxCenter(box);\n const offsets = [dot(boxCenter, inverseRotationMatrix[0]), dot(boxCenter, inverseRotationMatrix[1])];\n return coordsRotated.map((coord) => ([\n Math.trunc(coord[0] + offsets[0]),\n Math.trunc(coord[1] + offsets[1]),\n Math.trunc(coord[2] || 0),\n ]));\n}\n\nexport function correctFaceRotation(rotate, box, input, inputSize) {\n const symmetryLine = (box.landmarks.length >= coords.meshLandmarks.count)\n ? coords.meshLandmarks.symmetryLine\n : coords.blazeFaceLandmarks.symmetryLine;\n let angle = 0; // default\n let rotationMatrix = fixedRotationMatrix; // default\n let face; // default\n\n if (rotate && env.kernels.includes('rotatewithoffset')) {\n angle = computeRotation(box.landmarks[symmetryLine[0]], box.landmarks[symmetryLine[1]]);\n const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2);\n if (largeAngle) { // perform rotation only if angle is sufficiently high\n const center: Point = getBoxCenter(box);\n const centerRaw: Point = [center[0] / input.shape[2], center[1] / input.shape[1]];\n const rotated = tf.image.rotateWithOffset(input, angle, 0, [centerRaw[0], centerRaw[1]]);\n rotationMatrix = buildRotationMatrix(-angle, center);\n face = cutAndResize(box, rotated, [inputSize, inputSize]);\n tf.dispose(rotated);\n } else {\n face = cutAndResize(box, input, [inputSize, inputSize]);\n }\n } else {\n face = cutAndResize(box, input, [inputSize, inputSize]);\n }\n return [angle, rotationMatrix, face];\n}\n\nexport const findFaceCenter = (mesh) => {\n const x = mesh.map((m) => m[0]);\n const y = mesh.map((m) => m[1]);\n // weighted center\n /*\n const sum = (arr: number[]) => arr.reduce((prev, curr) => prev + curr, 0);\n return [sum(x) / mesh.length, sum(y) / mesh.length];\n */\n // absolute center\n return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y) + (Math.max(...y) - Math.min(...y)) / 2];\n};\n\nexport const calculateFaceBox = (mesh, previousBox) => {\n const center = findFaceCenter(mesh);\n const boxSize = getBoxSize(previousBox);\n const calculatedBox = {\n startPoint: [center[0] - boxSize[0] / 2, center[1] - boxSize[1] / 2] as Point,\n endPoint: [center[0] + boxSize[0] / 2, center[1] + boxSize[1] / 2] as Point,\n };\n return calculatedBox;\n};\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport * as util from './facemeshutil';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { Config } from '../config';\nimport type { Tensor, GraphModel, Tensor1D, Tensor2D, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\nimport type { Point } from '../result';\n\nconst keypointsCount = 6;\nconst faceBoxScaleFactor = 1.4;\nlet model: GraphModel | null;\nlet anchors: Tensor | null = null;\nlet inputSize = 0;\nlet inputSizeT: Tensor | null = null;\n\nexport interface DetectBox { startPoint: Point, endPoint: Point, landmarks: Point[], confidence: number, size: [number, number] }\n\nexport const size = () => inputSize;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.detector?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = (model['executor'] && model.inputs[0].shape) ? model.inputs[0].shape[2] : 256;\n inputSizeT = tf.scalar(inputSize, 'int32') as Tensor;\n anchors = tf.tensor2d(util.generateAnchors(inputSize)) as Tensor;\n return model;\n}\n\nfunction decodeBoxes(boxOutputs: Tensor) {\n if (!anchors || !inputSizeT) return tf.zeros([0, 0]);\n const t: Record = {};\n t.boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n t.centers = tf.add(t.boxStarts, anchors);\n t.boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n t.boxSizesNormalized = tf.div(t.boxSizes, inputSizeT);\n t.centersNormalized = tf.div(t.centers, inputSizeT);\n t.halfBoxSize = tf.div(t.boxSizesNormalized, constants.tf2);\n t.starts = tf.sub(t.centersNormalized, t.halfBoxSize);\n t.ends = tf.add(t.centersNormalized, t.halfBoxSize);\n t.startNormalized = tf.mul(t.starts, inputSizeT);\n t.endNormalized = tf.mul(t.ends, inputSizeT);\n const boxes = tf.concat2d([t.startNormalized as Tensor2D, t.endNormalized as Tensor2D], 1);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return boxes;\n}\n\nexport async function getBoxes(inputImage: Tensor4D, config: Config): Promise {\n // sanity check on input\n if ((!inputImage) || (inputImage['isDisposedInternal']) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return [];\n const t: Record = {};\n t.resized = tf.image.resizeBilinear(inputImage, [inputSize, inputSize]);\n t.div = tf.div(t.resized, constants.tf127);\n t.normalized = tf.sub(t.div, constants.tf05);\n const res = model?.execute(t.normalized) as Tensor[];\n if (Array.isArray(res) && res.length > 2) { // pinto converted model?\n const sorted = res.sort((a, b) => a.size - b.size);\n t.concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n t.concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n t.concat = tf.concat([t.concat512, t.concat384], 1);\n t.batch = tf.squeeze(t.concat, [0]);\n } else if (Array.isArray(res)) { // new facemesh-detection tfhub model\n t.batch = tf.squeeze(res[0]);\n } else { // original blazeface tfhub model\n t.batch = tf.squeeze(res);\n }\n tf.dispose(res);\n t.boxes = decodeBoxes(t.batch);\n t.logits = tf.slice(t.batch, [0, 0], [-1, 1]);\n t.sigmoid = tf.sigmoid(t.logits);\n t.scores = tf.squeeze(t.sigmoid);\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.scores as Tensor1D, (config.face.detector?.maxDetected || 0), (config.face.detector?.iouThreshold || 0), (config.face.detector?.minConfidence || 0));\n const nms = await t.nms.array() as number[];\n const boxes: DetectBox[] = [];\n const scores = await t.scores.data();\n for (let i = 0; i < nms.length; i++) {\n const confidence = scores[nms[i]];\n\n if (confidence > (config.face.detector?.minConfidence || 0)) {\n const b: Record = {};\n b.bbox = tf.slice(t.boxes, [nms[i], 0], [1, -1]);\n b.slice = tf.slice(t.batch, [nms[i], keypointsCount - 1], [1, -1]);\n b.squeeze = tf.squeeze(b.slice);\n b.landmarks = tf.reshape(b.squeeze, [keypointsCount, -1]);\n const points = await b.bbox.data();\n const rawBox = {\n startPoint: [points[0], points[1]] as Point,\n endPoint: [points[2], points[3]] as Point,\n landmarks: (await b.landmarks.array()) as Point[],\n confidence,\n };\n b.anchor = tf.slice(anchors as Tensor, [nms[i], 0], [1, 2]);\n const anchor = await b.anchor.data();\n const scaledBox = util.scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize], anchor);\n const enlargedBox = util.enlargeBox(scaledBox, config.face['scale'] || faceBoxScaleFactor);\n const squaredBox = util.squarifyBox(enlargedBox);\n if (squaredBox.size[0] > (config.face.detector?.['minSize'] || 0) && squaredBox.size[1] > (config.face.detector?.['minSize'] || 0)) boxes.push(squaredBox);\n Object.keys(b).forEach((tensor) => tf.dispose(b[tensor]));\n }\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return boxes;\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport * as coords from './facemeshcoords';\nimport * as util from './facemeshutil';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Config } from '../config';\nimport type { Point } from '../result';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\n\nconst irisEnlarge = 2.3;\n\nconst leftOutline = coords.meshAnnotations.leftEyeLower0;\nconst rightOutline = coords.meshAnnotations.rightEyeLower0;\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.iris?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = (model?.['executor'] && model.inputs?.[0].shape) ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n return model;\n}\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates and update the z coordinate to be an average of the original and the new.\nexport function replaceIrisCoords(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.irisIndices.length; i++) {\n const { key, indices } = coords.irisIndices[i];\n const originalIndices = coords.meshAnnotations[`${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],\n newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n\nexport const 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.\nexport const getEyeBox = (rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, meshSize, flip = false) => {\n const box = util.squarifyBox(util.enlargeBox(util.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), irisEnlarge));\n const boxSize = util.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / meshSize,\n box.startPoint[0] / meshSize, box.endPoint[1] / meshSize,\n box.endPoint[0] / meshSize,\n ]], [0], [inputSize, inputSize]);\n if (flip && env.kernels.includes('flipleftright')) {\n const flipped = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n tf.dispose(crop);\n crop = flipped;\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.\nexport const getEyeCoords = (eyeData, eyeBox, eyeBoxSize, flip = false) => {\n const eyeRawCoords: Point[] = [];\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 / inputSize)) : (x / inputSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / inputSize) * 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.\nexport const getAdjustedIrisCoords = (rawCoords, irisCoords, direction) => {\n const upperCenterZ = rawCoords[coords.meshAnnotations[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.meshAnnotations[`${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\nexport async function augmentIris(rawCoords, face, meshSize) {\n if (!model?.['executor']) return rawCoords;\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], meshSize, true);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], meshSize, true);\n const combined = tf.concat([leftEyeCrop, rightEyeCrop]);\n tf.dispose(leftEyeCrop);\n tf.dispose(rightEyeCrop);\n const eyePredictions = model.execute(combined) as Tensor;\n tf.dispose(combined);\n const eyePredictionsData = await eyePredictions.data();\n tf.dispose(eyePredictions);\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize, false);\n const leftToRightEyeDepthDifference = getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceIrisCoords(rawCoords, leftEyeRawCoords, 'left', null);\n replaceIrisCoords(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 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 replaceIrisCoords(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceIrisCoords(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n const newCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n return newCoords;\n}\n", "import * as constants from './constants';\nimport type { Tensor } from '../tfjs/types';\n\nexport async function augment(rawCoords, results: Tensor[]) {\n const t: Record = { // all attention models produce 2d results so it needs to be later augmented with correct z-coords\n // mesh: results[0], // already have it in rawCoords // output_mesh_identity\n // flag: results[1], // already processed in parent // conv_faceflag\n lips: await results.filter((r) => r.size === 160)?.[0]?.data() as Float32Array, // 80 x 2d = 160 // output_lips\n irisL: await results.filter((r) => r.size === 10)?.[0]?.data() as Float32Array, // 5 x 2d = 10 // output_right_iris\n eyeL: await results.filter((r) => r.size === 142)?.[0]?.data() as Float32Array, // 71 x 2d = 142 // output_right_eye\n irisR: await results.filter((r) => r.size === 10)?.[1]?.data() as Float32Array, // 5 x 2d = 10 // output_left_iris\n eyeR: await results.filter((r) => r.size === 142)?.[1]?.data() as Float32Array, // 71 x 2d = 142// output_left_eye\n };\n for (const val of Object.values(t)) {\n if (!val) return rawCoords; // could not find tensor\n }\n\n // augment iris: adds additional 5 keypoints per eye\n const irisLDepth = constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.reduce((prev, curr) => prev += rawCoords[curr][2], 0) / constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.length; // get average z-coord for iris\n for (let i = 0; i < t.irisL.length / 2; i++) rawCoords.push([t.irisL[2 * i + 0], t.irisL[2 * i + 1], irisLDepth]);\n const irisRDepth = constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.reduce((prev, curr) => prev += rawCoords[curr][2], 0) / constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.length; // get average z-coord for iris\n for (let i = 0; i < t.irisR.length / 2; i++) rawCoords.push([t.irisR[2 * i + 0], t.irisR[2 * i + 1], irisRDepth]);\n\n // augment eyes: replaces eye keypoints based on heuristic mapping\n for (let i = 0; i < t.eyeL.length / 2; i++) rawCoords[constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]] = [t.eyeL[2 * i + 0], t.eyeL[2 * i + 1], rawCoords[constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]][2]];\n for (let i = 0; i < t.eyeR.length / 2; i++) rawCoords[constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]] = [t.eyeR[2 * i + 0], t.eyeR[2 * i + 1], rawCoords[constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]][2]];\n\n // augment lips: replaces eye keypoints based on heuristic mapping\n for (let i = 0; i < t.lips.length / 2; i++) rawCoords[constants.LANDMARKS_REFINEMENT_LIPS_CONFIG[i]] = [t.lips[2 * i + 0], t.lips[2 * i + 1], rawCoords[constants.LANDMARKS_REFINEMENT_LIPS_CONFIG[i]][2]];\n\n return rawCoords;\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n *\n * Based on:\n * - [**MediaPipe BlazeFace**](https://drive.google.com/file/d/1f39lSzU5Oq-j_OXgS67KfN5wNsoeAZ4V/view)\n * - Facial Spacial Geometry: [**MediaPipe FaceMesh**](https://drive.google.com/file/d/1VFC_wIpw4O7xBOiTgUldl79d9LA-LsnA/view)\n * - Eye Iris Details: [**MediaPipe Iris**](https://drive.google.com/file/d/1bsWbokp9AklH2ANjCfmjqEzzxO1CNbMu/view)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport * as blazeface from './blazeface';\nimport * as util from './facemeshutil';\nimport * as coords from './facemeshcoords';\nimport * as iris from './iris';\nimport * as attention from './attention';\nimport { histogramEqualization } from '../image/enhance';\nimport { env } from '../util/env';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { FaceResult, FaceLandmark, Point } from '../result';\nimport type { Config } from '../config';\nimport type { DetectBox } from './blazeface';\n\nconst cache = {\n boxes: [] as DetectBox[],\n skipped: Number.MAX_SAFE_INTEGER,\n timestamp: 0,\n};\n\nlet model: GraphModel | null = null;\nlet inputSize = 0;\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n // reset cached boxes\n const skipTime = (config.face.detector?.skipTime || 0) > (now() - cache.timestamp);\n const skipFrame = cache.skipped < (config.face.detector?.skipFrames || 0);\n if (!config.skipAllowed || !skipTime || !skipFrame || cache.boxes.length === 0) {\n cache.boxes = await blazeface.getBoxes(input, config); // get results from blazeface detector\n cache.timestamp = now();\n cache.skipped = 0;\n } else {\n cache.skipped++;\n }\n const faces: FaceResult[] = [];\n const newCache: DetectBox[] = [];\n let id = 0;\n const size = inputSize;\n for (let i = 0; i < cache.boxes.length; i++) {\n const box = cache.boxes[i];\n let angle = 0;\n let rotationMatrix;\n const face: FaceResult = { // init face result\n id: id++,\n mesh: [],\n meshRaw: [],\n box: [0, 0, 0, 0],\n boxRaw: [0, 0, 0, 0],\n score: 0,\n boxScore: 0,\n faceScore: 0,\n size: [0, 0],\n // contoursRaw: [],\n // contours: [],\n annotations: {} as Record,\n };\n\n // optional rotation correction based on detector data only if mesh is disabled otherwise perform it later when we have more accurate mesh data. if no rotation correction this function performs crop\n [angle, rotationMatrix, face.tensor] = util.correctFaceRotation(config.face.detector?.rotation, box, input, config.face.mesh?.enabled ? inputSize : blazeface.size());\n if (config.filter.equalization) {\n const equilized = face.tensor ? await histogramEqualization(face.tensor) : undefined;\n tf.dispose(face.tensor);\n if (equilized) face.tensor = equilized;\n }\n face.boxScore = Math.round(100 * box.confidence) / 100;\n if (!config.face.mesh?.enabled || !model?.['executor']) { // mesh not enabled or not loaded, return resuts from detector only\n face.box = util.clampBox(box, input);\n face.boxRaw = util.getRawBox(box, input);\n face.score = face.boxScore;\n face.size = box.size;\n face.mesh = box.landmarks;\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / size]);\n for (const key of Object.keys(coords.blazeFaceLandmarks)) face.annotations[key] = [face.mesh[coords.blazeFaceLandmarks[key] as number]]; // add annotations\n } else if (!model) { // mesh enabled, but not loaded\n if (config.debug) log('face mesh detection requested, but model is not loaded');\n } else { // mesh enabled\n if (config.face.attention?.enabled && !env.kernels.includes('atan2')) {\n config.face.attention.enabled = false;\n tf.dispose(face.tensor);\n return faces;\n }\n const results = model.execute(face.tensor as Tensor) as Tensor[];\n const confidenceT = results.find((t) => t.shape[t.shape.length - 1] === 1) as Tensor;\n const faceConfidence = await confidenceT.data();\n face.faceScore = Math.round(100 * faceConfidence[0]) / 100;\n if (face.faceScore < (config.face.detector?.minConfidence || 1)) { // low confidence in detected mesh\n box.confidence = face.faceScore; // reset confidence of cached box\n if (config.face.mesh['keepInvalid']) {\n face.box = util.clampBox(box, input);\n face.boxRaw = util.getRawBox(box, input);\n face.size = box.size;\n face.score = face.boxScore;\n face.mesh = box.landmarks;\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 1), pt[1] / (input.shape[1] || 1), (pt[2] || 0) / size]);\n for (const key of Object.keys(coords.blazeFaceLandmarks)) {\n face.annotations[key] = [face.mesh[coords.blazeFaceLandmarks[key] as number]]; // add annotations\n }\n }\n } else {\n const meshT = results.find((t) => t.shape[t.shape.length - 1] === 1404) as Tensor;\n const coordsReshaped = tf.reshape(meshT, [-1, 3]);\n let rawCoords = await coordsReshaped.array();\n tf.dispose(coordsReshaped);\n if (config.face.attention?.enabled) {\n rawCoords = await attention.augment(rawCoords, results); // augment iris results using attention model results\n } else if (config.face.iris?.enabled) {\n rawCoords = await iris.augmentIris(rawCoords, face.tensor, inputSize); // run iris model and augment results\n }\n face.mesh = util.transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize); // get processed mesh\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / size]);\n for (const key of Object.keys(coords.meshAnnotations)) face.annotations[key] = coords.meshAnnotations[key].map((index) => face.mesh[index]); // add annotations\n face.score = face.faceScore;\n const calculatedBox = {\n ...util.calculateFaceBox(face.mesh, box),\n confidence: box.confidence,\n landmarks: box.landmarks,\n size: box.size,\n };\n face.box = util.clampBox(calculatedBox, input);\n face.boxRaw = util.getRawBox(calculatedBox, input);\n face.size = calculatedBox.size;\n /*\n const contoursT = results.find((t) => t.shape[t.shape.length - 1] === 266) as Tensor;\n const contoursData = contoursT && await contoursT.data(); // 133 x 2d points\n face.contoursRaw = [];\n for (let j = 0; j < contoursData.length / 2; j++) face.contoursRaw.push([contoursData[2 * j + 0] / inputSize, contoursData[2 * j + 1] / inputSize]);\n face.contours = face.contoursRaw.map((c) => [Math.trunc((input.shape[2] || 1) * c[0]), Math.trunc((input.shape[1] || 1) * c[1])]);\n */\n newCache.push(calculatedBox);\n }\n tf.dispose(results);\n }\n if (face.score > (config.face.detector?.minConfidence || 1)) faces.push(face);\n else tf.dispose(face.tensor);\n }\n cache.boxes = newCache; // reset cache\n return faces;\n}\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (config.face.attention?.enabled && model?.['signature']) {\n if (Object.keys(model?.['signature']?.outputs || {}).length < 6) model = null;\n }\n if (!model) {\n if (config.face.attention?.enabled) model = await loadModel(config.face.attention.modelPath);\n else model = await loadModel(config.face.mesh?.modelPath);\n } else if (config.debug) {\n log('cached model:', model['modelUrl']);\n }\n inputSize = (model['executor'] && model?.inputs?.[0].shape) ? model?.inputs?.[0].shape[2] : 256;\n return model;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "/**\n * Emotion model implementation\n *\n * [**Oarriaga**](https://github.com/oarriaga/face_classification)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Emotion } from '../result';\nimport { log, now } from '../util/util';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { loadModel } from '../tfjs/load';\nimport { env } from '../util/env';\nimport { constants } from '../tfjs/constants';\n\nlet annotations: string[] = [];\nlet model: GraphModel | null;\nconst last: { score: number, emotion: Emotion }[][] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet rgb = false;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await loadModel(config.face.emotion?.modelPath);\n rgb = model?.inputs?.[0].shape?.[3] === 3;\n if (!rgb) annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral']; // oarriaga and gear\n else annotations = ['angry', 'disgust', 'fear', 'happy', 'neutral', 'sad', 'surprise']; // affectnet\n } else if (config.debug) {\n log('cached model:', model['modelUrl']);\n }\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise<{ score: number, emotion: Emotion }[]> {\n if (!model) return [];\n const skipFrame = skipped < (config.face.emotion?.skipFrames || 0);\n const skipTime = (config.face.emotion?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const obj: { score: number, emotion: Emotion }[] = [];\n if (config.face.emotion?.enabled) {\n const t: Record = {};\n const inputSize = model?.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (config.face.emotion?.['crop'] > 0) { // optional crop\n const crop = config.face.emotion?.['crop'];\n const box = [[crop, crop, 1 - crop, 1 - crop]];\n t.resize = tf.image.cropAndResize(image, box, [0], [inputSize, inputSize]);\n } else {\n t.resize = tf.image.resizeBilinear(image, [inputSize, inputSize], false);\n }\n if (rgb) {\n t.mul = tf.mul(t.resize, 255);\n t.normalize = tf.sub(t.mul, [103.939, 116.779, 123.68]); // affectnet uses specific norm values\n t.emotion = model?.execute(t.normalize) as Tensor; // result is already in range 0..1, no need for additional activation\n } else {\n // [t.red, t.green, t.blue] = tf.split(t.resize, 3, 3);\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n // t.redNorm = tf.mul(t.red, rgb[0]);\n // t.greenNorm = tf.mul(t.green, rgb[1]);\n // t.blueNorm = tf.mul(t.blue, rgb[2]);\n // t.grayscale = tf.addN([t.redNorm, t.greenNorm, t.blueNorm]);\n t.channels = tf.mul(t.resize, constants.rgb);\n t.grayscale = tf.sum(t.channels, 3, true);\n t.grayscaleSub = tf.sub(t.grayscale, constants.tf05);\n t.grayscaleMul = tf.mul(t.grayscaleSub, constants.tf2);\n t.emotion = model?.execute(t.grayscaleMul) as Tensor; // result is already in range 0..1, no need for additional activation\n }\n lastTime = now();\n const data = await t.emotion.data();\n for (let i = 0; i < data.length; i++) {\n if (data[i] > (config.face.emotion.minConfidence || 0)) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] as Emotion });\n }\n obj.sort((a, b) => b.score - a.score);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * FaceRes model implementation\n *\n * Returns Age, Gender, Descriptor\n * Implements Face similarity function\n *\n * Based on: [**HSE-FaceRes**](https://github.com/HSE-asavchenko/HSE_FaceRec_tf)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { env } from '../util/env';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { Tensor, GraphModel, Tensor4D, Tensor1D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport type { Gender, Race } from '../result';\n\nexport interface FaceRes { age: number, gender: Gender, genderScore: number, descriptor: number[], race?: { score: number, race: Race }[] }\n\nlet model: GraphModel | null;\nconst last: FaceRes[] = [];\n\nlet lastTime = 0;\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.description?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport function enhance(input, config: Config): Tensor {\n const tensor = (input.image || input.tensor || input) as Tensor4D; // input received from detector is already normalized to 0..1, input is also assumed to be straightened\n if (!model?.inputs[0].shape) return tensor; // model has no shape so no point continuing\n let crop: Tensor;\n if (config.face.description?.['crop'] > 0) { // optional crop\n const cropval = config.face.description?.['crop'];\n const box = [[cropval, cropval, 1 - cropval, 1 - cropval]];\n crop = tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n } else {\n crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n }\n const norm: Tensor = tf.mul(crop, constants.tf255);\n tf.dispose(crop);\n return norm;\n /*\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 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 */\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\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n const obj: FaceRes = {\n age: 0 as number,\n gender: 'unknown' as Gender,\n genderScore: 0 as number,\n descriptor: [] as number[],\n };\n if (!model?.['executor']) return obj;\n const skipFrame = skipped < (config.face.description?.skipFrames || 0);\n const skipTime = (config.face.description?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipFrame && skipTime && (lastCount === count) && (last?.[idx]?.age > 0) && (last?.[idx]?.genderScore > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (config.face.description?.enabled) {\n const enhanced = enhance(image, config);\n const resT = model?.execute(enhanced) as Tensor[];\n lastTime = now();\n tf.dispose(enhanced);\n const genderT = resT.find((t) => t.shape[1] === 1) as Tensor;\n const gender = await genderT.data();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > (config.face.description.minConfidence || 0)) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderScore = Math.min(0.99, confidence);\n }\n const argmax = tf.argMax(resT.find((t) => t.shape[1] === 100) as Tensor1D, 1);\n const ageIdx: number = (await argmax.data())[0];\n tf.dispose(argmax);\n const ageT = resT.find((t) => t.shape[1] === 100) as Tensor;\n const all = await ageT.data();\n obj.age = Math.round(all[ageIdx - 1] > all[ageIdx + 1] ? 10 * ageIdx - 100 * all[ageIdx - 1] : 10 * ageIdx + 100 * all[ageIdx + 1]) / 10;\n\n if (Number.isNaN(gender[0]) || Number.isNaN(all[0])) log('faceres error:', { model, result: resT });\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]); // reshape large 1024-element descriptor to 128 x 8\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it which leaves us with 128-element descriptor\n const descriptor = desc ? await desc.data() : [] as number[];\n obj.descriptor = Array.from(descriptor);\n resT.forEach((t) => tf.dispose(t));\n }\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "import type { Tensor } from '../tfjs/types';\nimport type { FaceResult } from '../result';\n// import * as tf from 'dist/tfjs.esm.js';\nimport { meshAnnotations } from './facemeshcoords';\n\nconst expandFact = 0.1;\nconst alpha = 0.5;\n\n// point inclusion in polygon based on https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\nfunction insidePoly(x: number, y: number, polygon: { x: number, y: number }[]): boolean {\n let inside = false;\n let j = polygon.length - 1;\n for (let i = 0; i < polygon.length; j = i++) {\n if (((polygon[i].y > y) !== (polygon[j].y > y)) && (x < (polygon[j].x - polygon[i].x) * (y - polygon[i].y) / (polygon[j].y - polygon[i].y) + polygon[i].x)) inside = !inside;\n }\n return inside;\n}\n\nexport async function mask(face: FaceResult): Promise {\n if (!face.tensor) return face.tensor;\n if (!face.mesh || face.mesh.length < 100) return face.tensor;\n const width = face.tensor.shape[2] || 0;\n const height = face.tensor.shape[1] || 0;\n const buffer = await face.tensor.buffer();\n let silhouette: { x: number, y: number }[] = [];\n for (const pt of meshAnnotations.silhouette) silhouette.push({ x: (face.mesh[pt][0] - face.box[0]) / face.box[2], y: (face.mesh[pt][1] - face.box[1]) / face.box[3] }); // add all silhouette points scaled to local box\n if (expandFact && expandFact > 0) silhouette = silhouette.map((pt) => ({ x: pt.x > 0.5 ? pt.x + expandFact : pt.x - expandFact, y: pt.y > 0.5 ? pt.y + expandFact : pt.y - expandFact })); // expand silhouette\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n const inside = insidePoly(x / width, y / width, silhouette);\n if (!inside) {\n buffer.set(alpha * buffer.get(0, y, x, 0), 0, y, x, 0);\n buffer.set(alpha * buffer.get(0, y, x, 1), 0, y, x, 1);\n buffer.set(alpha * buffer.get(0, y, x, 2), 0, y, x, 2);\n }\n }\n }\n const output = buffer.toTensor();\n // tf.dispose(buffer);\n return output;\n}\n", "/**\n * Anti-spoofing model implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { loadModel } from '../tfjs/load';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst cached: number[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet lastCount = 0;\nlet lastTime = 0;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.antispoof?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n if (!model?.['executor']) return 0;\n const skipTime = (config.face.antispoof?.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.face.antispoof?.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && cached[idx]) {\n skipped++;\n return cached[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape ? model.inputs[0].shape[2] : 0, model?.inputs[0].shape ? model.inputs[0].shape[1] : 0], false);\n const res = model?.execute(resize) as Tensor;\n const num = (await res.data())[0];\n cached[idx] = Math.round(100 * num) / 100;\n lastCount = count;\n lastTime = now();\n tf.dispose([resize, res]);\n resolve(cached[idx]);\n });\n}\n", "/**\n * Anti-spoofing model implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst cached: number[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet lastCount = 0;\nlet lastTime = 0;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.liveness?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n if (!model?.['executor']) return 0;\n const skipTime = (config.face.liveness?.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.face.liveness?.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && cached[idx]) {\n skipped++;\n return cached[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape ? model.inputs[0].shape[2] : 0, model?.inputs[0].shape ? model.inputs[0].shape[1] : 0], false);\n const res = model?.execute(resize) as Tensor;\n const num = (await res.data())[0];\n cached[idx] = Math.round(100 * num) / 100;\n lastCount = count;\n lastTime = now();\n tf.dispose([resize, res]);\n resolve(cached[idx]);\n });\n}\n", "/**\n * GEAR [gender/emotion/age/race] model implementation\n *\n * Based on: [**GEAR Predictor**](https://github.com/Udolf15/GEAR-Predictor)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Gender, Race } from '../result';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\n\nexport interface GearType { age: number, gender: Gender, genderScore: number, race: { score: number, race: Race }[] }\nlet model: GraphModel | null;\nconst last: GearType[] = [];\nconst raceNames = ['white', 'black', 'asian', 'indian', 'other'];\nconst ageWeights = [15, 23, 28, 35.5, 45.5, 55.5, 65];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config) {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.gear?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n if (!model) return { age: 0, gender: 'unknown', genderScore: 0, race: [] };\n const skipFrame = skipped < (config.face.gear?.skipFrames || 0);\n const skipTime = (config.face.gear?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx]) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs[0].shape) return;\n const t: Record = {};\n // t.resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape[2], model?.inputs[0].shape[1]], false);\n let box = [[0.0, 0.10, 0.90, 0.90]]; // empyrical values for top, left, bottom, right\n if (config.face.gear?.['crop'] > 0) { // optional crop config value\n const crop = config.face.gear?.['crop'];\n box = [[crop, crop, 1 - crop, 1 - crop]];\n }\n t.resize = tf.image.cropAndResize(image, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const obj: GearType = { age: 0, gender: 'unknown', genderScore: 0, race: [] };\n if (config.face.gear?.enabled) [t.age, t.gender, t.race] = model.execute(t.resize, ['age_output', 'gender_output', 'race_output']) as Tensor[];\n const gender = await t.gender.data();\n obj.gender = gender[0] > gender[1] ? 'male' : 'female';\n obj.genderScore = Math.round(100 * (gender[0] > gender[1] ? gender[0] : gender[1])) / 100;\n const race = await t.race.data();\n for (let i = 0; i < race.length; i++) {\n if (race[i] > (config.face.gear?.minConfidence || 0.2)) obj.race.push({ score: Math.round(100 * race[i]) / 100, race: raceNames[i] as Race });\n }\n obj.race.sort((a, b) => b.score - a.score);\n // {0: 'Below20', 1: '21-25', 2: '26-30', 3: '31-40',4: '41-50', 5: '51-60', 6: 'Above60'}\n const ageDistribution = Array.from(await t.age.data());\n const ageSorted = ageDistribution.map((a, i) => [ageWeights[i], a]).sort((a, b) => b[1] - a[1]);\n let age = ageSorted[0][0]; // pick best starting point\n for (let i = 1; i < ageSorted.length; i++) age += ageSorted[i][1] * (ageSorted[i][0] - age); // adjust with each other choice by weight\n obj.age = Math.round(10 * age) / 10;\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n last[idx] = obj;\n lastCount = count;\n lastTime = now();\n resolve(obj);\n });\n}\n", "/**\n * Age model implementation\n *\n * Based on: [**SSR-Net**](https://github.com/shamangary/SSR-Net)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { env } from '../util/env';\nimport { constants } from '../tfjs/constants';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\n\nlet model: GraphModel | null;\nconst last: { age: number }[] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config) {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['ssrnet'].modelPathAge);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise<{ age: number }> {\n if (!model) return { age: 0 };\n const skipFrame = skipped < (config.face['ssrnet']?.skipFrames || 0);\n const skipTime = (config.face['ssrnet']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipFrame && skipTime && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs || !model.inputs[0] || !model.inputs[0].shape) return;\n const t: Record = {};\n if (config.face['ssrnet']?.['crop'] > 0) { // optional crop\n const crop = config.face['ssrnet']?.['crop'];\n const box = [[crop, crop, 1 - crop, 1 - crop]];\n t.resize = tf.image.cropAndResize(image, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n } else {\n t.resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n }\n t.enhance = tf.mul(t.resize, constants.tf255);\n const obj = { age: 0 };\n if (config.face['ssrnet']?.enabled) t.age = model.execute(t.enhance) as Tensor;\n if (t.age) {\n const data = await t.age.data();\n obj.age = Math.trunc(10 * data[0]) / 10;\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n last[idx] = obj;\n lastCount = count;\n lastTime = now();\n resolve(obj);\n });\n}\n", "/**\n * Gender model implementation\n *\n * Based on: [**SSR-Net**](https://github.com/shamangary/SSR-Net)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { Gender } from '../result';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: { gender: Gender, genderScore: number }[] = [];\nlet lastCount = 0;\nlet lastTime = 0;\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: Config) {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['ssrnet']?.modelPathGender);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx, count): Promise<{ gender: Gender, genderScore: number }> {\n if (!model) return { gender: 'unknown', genderScore: 0 };\n const skipFrame = skipped < (config.face['ssrnet']?.skipFrames || 0);\n const skipTime = (config.face['ssrnet']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipFrame && skipTime && (lastCount === count) && last[idx]?.gender && (last[idx]?.genderScore > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs[0].shape) return;\n const t: Record = {};\n if (config.face['ssrnet']?.['crop'] > 0) { // optional crop\n const crop = config.face['ssrnet']?.['crop'];\n const box = [[crop, crop, 1 - crop, 1 - crop]];\n t.resize = tf.image.cropAndResize(image, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n } else {\n t.resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n }\n t.enhance = tf.tidy(() => {\n let normalize: Tensor;\n if (model?.inputs?.[0].shape?.[3] === 1) {\n const [red, green, blue] = tf.split(t.resize, 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 normalize = tf.mul(tf.sub(grayscale, constants.tf05), 2); // range grayscale:-1..1\n } else {\n normalize = tf.mul(tf.sub(t.resize, constants.tf05), 2); // range rgb:-1..1\n }\n return normalize;\n });\n const obj: { gender: Gender, genderScore: number } = { gender: 'unknown', genderScore: 0 };\n if (config.face['ssrnet']?.enabled) t.gender = model.execute(t.enhance) as Tensor;\n const data = await t.gender.data();\n obj.gender = data[0] > data[1] ? 'female' : 'male'; // returns two values 0..1, bigger one is prediction\n obj.genderScore = data[0] > data[1] ? (Math.trunc(100 * data[0]) / 100) : (Math.trunc(100 * data[1]) / 100);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n last[idx] = obj;\n lastCount = count;\n lastTime = now();\n resolve(obj);\n });\n}\n", "/**\n * MobileFaceNet model implementation\n *\n * Based on: [**BecauseofAI MobileFace**](https://github.com/becauseofAI/MobileFace)\n *\n * Obsolete and replaced by `faceres` that performs age/gender/descriptor analysis\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Tensor, Tensor4D, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: number[][] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['mobilefacenet']?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n/*\n// convert to black&white to avoid colorization impact\nconst 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\nconst [red, green, blue] = tf.split(crop, 3, 3);\nconst redNorm = tf.mul(red, rgb[0]);\nconst greenNorm = tf.mul(green, rgb[1]);\nconst blueNorm = tf.mul(blue, rgb[2]);\nconst grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\nconst merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\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\nconst mean = merge.mean();\nconst factor = 5;\nconst contrast = merge.sub(mean).mul(factor).add(mean);\n*/\n\nexport async function predict(input: Tensor4D, config: Config, idx, count): Promise {\n if (!model?.['executor']) return [];\n const skipFrame = skipped < (config.face['mobilefacenet']?.skipFrames || 0);\n const skipTime = (config.face['mobilefacenet']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx]) {\n skipped++;\n return last[idx];\n }\n return new Promise(async (resolve) => {\n let data: number[] = [];\n if (config.face['mobilefacenet']?.enabled && model?.inputs[0].shape) {\n const t: Record = {};\n t.crop = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false); // just resize to fit the embedding model\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 // t.crop = tf.image.cropAndResize(input, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n t.data = model.execute(t.crop) as Tensor;\n /*\n // optional normalize outputs with l2 normalization\n const scaled = tf.tidy(() => {\n const l2 = res.norm('euclidean');\n const scale = res.div(l2);\n return scale;\n });\n\n // optional reduce feature vector complexity\n const reshape = tf.reshape(res, [128, 2]); // split 256 vectors into 128 x 2\n const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it\n */\n const output = await t.data.data();\n data = Array.from(output); // convert typed array to simple array\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n last[idx] = data;\n lastCount = count;\n lastTime = now();\n resolve(data);\n });\n}\n", "/**\n * InsightFace model implementation\n *\n * Based on: [**DeepInsight InsightFace**](https://github.com/deepinsight/insightface)\n *\n * Alternative face embedding detection\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Tensor, Tensor4D, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: number[][] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['insightface'].modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(input: Tensor4D, config: Config, idx, count): Promise {\n if (!model?.['executor']) return [];\n const skipFrame = skipped < (config.face['insightface']?.skipFrames || 0);\n const skipTime = (config.face['insightface']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx]) {\n skipped++;\n return last[idx];\n }\n return new Promise(async (resolve) => {\n let data: number[] = [];\n if (config.face['insightface']?.enabled && model?.inputs[0].shape) {\n const t: Record = {};\n t.crop = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false); // just resize to fit the embedding model\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 // t.crop = tf.image.cropAndResize(input, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n t.data = model.execute(t.crop) as Tensor;\n const output = await t.data.data();\n data = Array.from(output); // convert typed array to simple array\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n last[idx] = data;\n lastCount = count;\n lastTime = now();\n resolve(data);\n });\n}\n", "import type { Point, FaceResult } from '../result';\n\ntype Vector = [number, number, number];\n\nconst calculateGaze = (face: FaceResult): { bearing: number, strength: number } => {\n const radians = (pt1: Point, pt2: Point) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points\n if (!face.annotations.rightEyeIris || !face.annotations.leftEyeIris) return { bearing: 0, strength: 0 };\n\n const offsetIris = [0, -0.1]; // iris center may not align with average of eye extremes\n const eyeRatio = 1; // factor to normalize changes x vs y\n\n const left = (face.mesh[33][2] || 0) > (face.mesh[263][2] || 0); // pick left or right eye depending which one is closer bazed on outsize point z axis\n const irisCenter = left ? face.mesh[473] : face.mesh[468];\n const eyeCenter = left // eye center is average of extreme points on x axis for both x and y, ignoring y extreme points as eyelids naturally open/close more when gazing up/down so relative point is less precise\n ? [(face.mesh[133][0] + face.mesh[33][0]) / 2, (face.mesh[133][1] + face.mesh[33][1]) / 2]\n : [(face.mesh[263][0] + face.mesh[362][0]) / 2, (face.mesh[263][1] + face.mesh[362][1]) / 2];\n const eyeSize = left // eye size is difference between extreme points for both x and y, used to normalize & squarify eye dimensions\n ? [face.mesh[133][0] - face.mesh[33][0], face.mesh[23][1] - face.mesh[27][1]]\n : [face.mesh[263][0] - face.mesh[362][0], face.mesh[253][1] - face.mesh[257][1]];\n const eyeDiff: Point = [ // x distance between extreme point and center point normalized with eye size\n (eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],\n eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],\n ];\n let strength = Math.sqrt((eyeDiff[0] * eyeDiff[0]) + (eyeDiff[1] * eyeDiff[1])); // vector length is a diagonal between two differences\n strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision\n const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees\n return { bearing, strength };\n};\n\nexport const calculateFaceAngle = (face: FaceResult, imageSize: [number, number]): {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n} => {\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v: Vector): Vector => { // 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: Vector, b: Vector): Vector => { // 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: Vector, b: Vector): Vector => { // 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: number[]): { pitch: number, yaw: number, roll: number } => {\n const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r; // eslint-disable-line @typescript-eslint/no-unused-vars\n let thetaX: number;\n let thetaY: number;\n let thetaZ: number;\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 if (Number.isNaN(thetaX)) thetaX = 0;\n if (Number.isNaN(thetaY)) thetaY = 0;\n if (Number.isNaN(thetaZ)) thetaZ = 0;\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n\n /*\n const meshToEulerAngle = (mesh) => { // simple Euler angle calculation based existing 3D mesh\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n return { // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center\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 // pitch is face move up/down\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 // yaw is face turn 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 // roll is face lean left/right\n };\n };\n */\n\n // initialize gaze and mesh\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], gaze: { bearing: 0, strength: 0 } };\n\n const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;\n // top, bottom, left, right\n const pts: Point[] = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size, pt[1] * imageSize[1] / size, pt[2]] as Point); // make the xyz coordinates proportional, independent of the image/box size\n\n const yAxis = normalize(subVectors(pts[1] as Vector, pts[0] as Vector));\n let xAxis = normalize(subVectors(pts[3] as Vector, pts[2] as Vector));\n const zAxis = normalize(crossVectors(xAxis, yAxis));\n // adjust xAxis to make sure that all axes are perpendicular to each other\n xAxis = crossVectors(yAxis, zAxis);\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 xAxis[0], xAxis[1], xAxis[2],\n yAxis[0], yAxis[1], yAxis[2],\n zAxis[0], zAxis[1], zAxis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n\n // we have iris keypoints so we can calculate gaze direction\n const gaze = mesh.length === 478 ? calculateGaze(face) : { bearing: 0, strength: 0 };\n\n return { angle, matrix, gaze };\n};\n", "import type { FaceResult } from '../result';\n\nexport function calculateCameraDistance(face: FaceResult, width: number): number {\n // iris points are [center, left, top, right, bottom]\n // average size of human iris is 11.7mm - fairly constant for all ages/genders/races\n const f = face?.annotations;\n if (!f?.leftEyeIris || !f?.rightEyeIris) return 0;\n // get size of left and right iris in pixels, pick larger one as its likely to be more accurate and normalize to 0..1 range instead of pixels\n const irisSize = Math.max(Math.abs(f.leftEyeIris[3][0] - f.leftEyeIris[1][0]), Math.abs(f.rightEyeIris[3][0] - f.rightEyeIris[1][0])) / width;\n // distance of eye from camera in meters\n const cameraDistance = Math.round(1.17 / irisSize) / 100;\n return cameraDistance;\n}\n\nexport function calculateEyesDistance(face: FaceResult, width: number): number {\n // average distance between eyes is 65mm - fairly constant for typical adult male, but varies otherwise\n const f = face?.annotations;\n if (!f?.leftEyeIris || !f?.rightEyeIris) return 0;\n // get size of left and right iris in pixels, pick larger one as its likely to be more accurate and normalize to 0..1 range instead of pixels\n const irisSize = Math.max(Math.abs(f.leftEyeIris[3][0] - f.leftEyeIris[1][0]), Math.abs(f.rightEyeIris[3][0] - f.rightEyeIris[1][0])) / width;\n // pixel x and y distance of centers of left and right iris, you can use edges instead\n const irisDistanceXY = [f.leftEyeIris[0][0] - f.rightEyeIris[0][0], f.leftEyeIris[0][1] - f.rightEyeIris[0][1]];\n // absolute distance bewtween eyes in 0..1 range to account for head pitch (we can ignore yaw)\n const irisDistance = Math.sqrt((irisDistanceXY[0] * irisDistanceXY[0]) + (irisDistanceXY[1] * irisDistanceXY[1])) / width;\n // distance between eyes in meters\n const eyesDistance = Math.round(1.17 * irisDistance / irisSize) / 100;\n return eyesDistance;\n}\n", "/**\n * Face algorithm implementation\n * Uses FaceMesh, Emotion and FaceRes models to create a unified pipeline\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { env } from '../util/env';\nimport * as facemesh from './facemesh';\nimport * as emotion from '../gear/emotion';\nimport * as faceres from './faceres';\nimport * as mask from './mask';\nimport * as antispoof from './antispoof';\nimport * as liveness from './liveness';\nimport * as gear from '../gear/gear';\nimport * as ssrnetAge from '../gear/ssrnet-age';\nimport * as ssrnetGender from '../gear/ssrnet-gender';\nimport * as mobilefacenet from './mobilefacenet';\nimport * as insightface from './insightface';\nimport type { FaceResult, Emotion, Gender, Race } from '../result';\nimport type { Tensor4D } from '../tfjs/types';\nimport type { Human } from '../human';\nimport { calculateFaceAngle } from './angles';\nimport { calculateCameraDistance } from './anthropometry';\n\ninterface DescRes { age: number, gender: Gender, genderScore: number, descriptor: number[], race?: { score: number, race: Race }[] }\n\nexport const detectFace = async (instance: Human /* instance of human */, input: Tensor4D): Promise => {\n // run facemesh, includes blazeface and iris\n let timeStamp: number = now();\n let ageRes: { age: number } | Promise<{ age: number }> | null;\n let gearRes: gear.GearType | Promise | null;\n let genderRes: { gender: string, genderScore: number } | Promise<{ gender: string, genderScore: number }> | null;\n let emotionRes: { score: number, emotion: Emotion }[] | Promise<{ score: number, emotion: Emotion }[]>;\n let mobilefacenetRes: number[] | Promise | null;\n let insightfaceRes: number[] | Promise | null;\n let antispoofRes: number | Promise | null;\n let livenessRes: number | Promise | null;\n let descRes: DescRes | Promise | null;\n\n const faceRes: FaceResult[] = [];\n instance.state = 'run:face';\n const faces: FaceResult[] = await facemesh.predict(input, instance.config);\n instance.performance.face = env.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n if (!input.shape || input.shape.length !== 4) return [];\n if (!faces) return [];\n // for (const face of faces) {\n for (let i = 0; i < faces.length; i++) {\n instance.analyze('Get Face');\n\n // is something went wrong, skip the face\n // @ts-ignore possibly undefied\n if (!faces[i].tensor || faces[i].tensor.isDisposedInternal) {\n log('Face object is disposed:', faces[i].tensor);\n continue;\n }\n\n // optional face mask\n if (instance.config.face.detector?.mask) {\n const masked = await mask.mask(faces[i]);\n tf.dispose(faces[i].tensor);\n if (masked) faces[i].tensor = masked;\n }\n\n // calculate face angles\n const rotation = faces[i].mesh && (faces[i].mesh.length > 200) ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;\n\n // run emotion, inherits face from blazeface\n instance.analyze('Start Emotion:');\n if (instance.config.async) {\n emotionRes = instance.config.face.emotion?.enabled ? emotion.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : [];\n } else {\n instance.state = 'run:emotion';\n timeStamp = now();\n emotionRes = instance.config.face.emotion?.enabled ? await emotion.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : [];\n instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End Emotion:');\n\n // run antispoof, inherits face from blazeface\n instance.analyze('Start AntiSpoof:');\n if (instance.config.async) {\n antispoofRes = instance.config.face.antispoof?.enabled ? antispoof.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n } else {\n instance.state = 'run:antispoof';\n timeStamp = now();\n antispoofRes = instance.config.face.antispoof?.enabled ? await antispoof.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End AntiSpoof:');\n\n // run liveness, inherits face from blazeface\n instance.analyze('Start Liveness:');\n if (instance.config.async) {\n livenessRes = instance.config.face.liveness?.enabled ? liveness.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n } else {\n instance.state = 'run:liveness';\n timeStamp = now();\n livenessRes = instance.config.face.liveness?.enabled ? await liveness.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End Liveness:');\n\n // run gear, inherits face from blazeface\n instance.analyze('Start GEAR:');\n if (instance.config.async) {\n gearRes = instance.config.face.gear?.enabled ? gear.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:gear';\n timeStamp = now();\n gearRes = instance.config.face.gear?.enabled ? await gear.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.gear = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End GEAR:');\n\n // run gear, inherits face from blazeface\n instance.analyze('Start SSRNet:');\n if (instance.config.async) {\n ageRes = instance.config.face['ssrnet']?.enabled ? ssrnetAge.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n genderRes = instance.config.face['ssrnet']?.enabled ? ssrnetGender.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:ssrnet';\n timeStamp = now();\n ageRes = instance.config.face['ssrnet']?.enabled ? await ssrnetAge.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n genderRes = instance.config.face['ssrnet']?.enabled ? await ssrnetGender.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.ssrnet = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End SSRNet:');\n\n // run mobilefacenet alternative, inherits face from blazeface\n instance.analyze('Start MobileFaceNet:');\n if (instance.config.async) {\n mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? mobilefacenet.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:mobilefacenet';\n timeStamp = now();\n mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? await mobilefacenet.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End MobileFaceNet:');\n\n // run insightface alternative, inherits face from blazeface\n instance.analyze('Start InsightFace:');\n if (instance.config.async) {\n insightfaceRes = instance.config.face['insightface']?.enabled ? insightface.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:mobilefacenet';\n timeStamp = now();\n insightfaceRes = instance.config.face['insightface']?.enabled ? await insightface.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End InsightFace:');\n\n // run faceres, inherits face from blazeface\n instance.analyze('Start Description:');\n if (instance.config.async) {\n descRes = faceres.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length);\n } else {\n instance.state = 'run:description';\n timeStamp = now();\n descRes = await faceres.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length);\n instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End Description:');\n\n // if async wait for results\n if (instance.config.async) {\n [ageRes, genderRes, emotionRes, mobilefacenetRes, insightfaceRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, insightfaceRes, descRes, gearRes, antispoofRes, livenessRes]);\n }\n instance.analyze('Finish Face:');\n\n if (instance.config.face['ssrnet']?.enabled && ageRes && genderRes) { // override age/gender if ssrnet model is used\n descRes = {\n ...(descRes as DescRes),\n age: (ageRes as { age: number}).age,\n gender: (genderRes as { gender: Gender, genderScore: number }).gender,\n genderScore: (genderRes as { gender: Gender, genderScore: number }).genderScore,\n };\n }\n if (instance.config.face.gear?.enabled && gearRes) { // override age/gender/race if gear model is used\n descRes = {\n ...(descRes as DescRes),\n age: (gearRes as gear.GearType).age,\n gender: (gearRes as gear.GearType).gender,\n genderScore: (gearRes as gear.GearType).genderScore,\n race: (gearRes as gear.GearType).race,\n };\n }\n if (instance.config.face['mobilefacenet']?.enabled && mobilefacenetRes) { // override descriptor if mobilefacenet model is used\n (descRes as DescRes).descriptor = mobilefacenetRes as number[];\n }\n\n if (instance.config.face['insightface']?.enabled && insightfaceRes) { // override descriptor if insightface model is used\n (descRes as DescRes).descriptor = insightfaceRes as number[];\n }\n\n const irisSize = instance.config.face.iris?.enabled ? calculateCameraDistance(faces[i], input.shape[2]) : 0;\n\n // optionally return tensor\n const tensor = instance.config.face.detector?.return ? tf.squeeze(faces[i].tensor as Tensor4D) : null;\n // dispose original face tensor\n tf.dispose(faces[i].tensor);\n // delete temp face image\n if (faces[i].tensor) delete faces[i].tensor;\n // combine results\n const res: FaceResult = {\n ...faces[i],\n id: i,\n };\n if ((descRes as DescRes).age) res.age = (descRes as DescRes).age;\n if ((descRes as DescRes).gender) res.gender = (descRes as DescRes).gender;\n if ((descRes as DescRes).genderScore) res.genderScore = (descRes as DescRes).genderScore;\n if ((descRes as DescRes).descriptor) res.embedding = (descRes as DescRes).descriptor;\n if ((descRes as DescRes).race) res.race = (descRes as DescRes).race as { score: number, race: Race }[];\n if (emotionRes) res.emotion = emotionRes as { score: number, emotion: Emotion }[];\n if (antispoofRes) res.real = antispoofRes as number;\n if (livenessRes) res.live = livenessRes as number;\n if (irisSize > 0) res.distance = irisSize;\n if (rotation) res.rotation = rotation;\n if (tensor) res.tensor = tensor;\n faceRes.push(res);\n instance.analyze('End Face');\n }\n instance.analyze('End FaceMesh:');\n if (instance.config.async) {\n if (instance.performance.face) delete instance.performance.face;\n if (instance.performance.age) delete instance.performance.age;\n if (instance.performance.gender) delete instance.performance.gender;\n if (instance.performance.emotion) delete instance.performance.emotion;\n }\n return faceRes;\n};\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nexport const Finger = {\n thumb: 0,\n index: 1,\n middle: 2,\n ring: 3,\n pinky: 4,\n all: [0, 1, 2, 3, 4], // just for convenience\n nameMapping: { 0: 'thumb', 1: 'index', 2: 'middle', 3: 'ring', 4: 'pinky' },\n // Describes mapping of joints based on the 21 points returned by handpose.\n // [0] Palm\n // [1-4] Thumb\n // [5-8] Index\n // [9-12] Middle\n // [13-16] Ring\n // [17-20] Pinky\n pointsMapping: {\n 0: [[0, 1], [1, 2], [2, 3], [3, 4]],\n 1: [[0, 5], [5, 6], [6, 7], [7, 8]],\n 2: [[0, 9], [9, 10], [10, 11], [11, 12]],\n 3: [[0, 13], [13, 14], [14, 15], [15, 16]],\n 4: [[0, 17], [17, 18], [18, 19], [19, 20]],\n },\n getName: (value) => Finger.nameMapping[value],\n getPoints: (value) => Finger.pointsMapping[value],\n};\n\nexport const FingerCurl = {\n none: 0,\n half: 1,\n full: 2,\n nameMapping: { 0: 'none', 1: 'half', 2: 'full' },\n getName: (value) => FingerCurl.nameMapping[value],\n};\n\nexport const FingerDirection = {\n verticalUp: 0,\n verticalDown: 1,\n horizontalLeft: 2,\n horizontalRight: 3,\n diagonalUpRight: 4,\n diagonalUpLeft: 5,\n diagonalDownRight: 6,\n diagonalDownLeft: 7,\n nameMapping: { 0: 'verticalUp', 1: 'verticalDown', 2: 'horizontalLeft', 3: 'horizontalRight', 4: 'diagonalUpRight', 5: 'diagonalUpLeft', 6: 'diagonalDownRight', 7: 'diagonalDownLeft' },\n getName: (value) => FingerDirection.nameMapping[value],\n};\n\nexport class FingerGesture {\n name;\n curls;\n directions;\n weights;\n weightsRelative;\n\n constructor(name) {\n // name (should be unique)\n this.name = name;\n this.curls = {};\n this.directions = {};\n this.weights = [1.0, 1.0, 1.0, 1.0, 1.0];\n this.weightsRelative = [1.0, 1.0, 1.0, 1.0, 1.0];\n }\n\n curl(finger, curl, confidence) {\n if (typeof this.curls[finger] === 'undefined') this.curls[finger] = [];\n this.curls[finger].push([curl, confidence]);\n }\n\n direction(finger, position, confidence) {\n if (!this.directions[finger]) this.directions[finger] = [];\n this.directions[finger].push([position, confidence]);\n }\n\n weight(finger, weight) {\n this.weights[finger] = weight;\n // recalculate relative weights\n const total = this.weights.reduce((a, b) => a + b, 0);\n this.weightsRelative = this.weights.map((el) => el * 5 / total);\n }\n\n matchAgainst(detectedCurls, detectedDirections) {\n let confidence = 0.0;\n // look at the detected curl of each finger and compare with\n // the expected curl of this finger inside current gesture\n for (const fingerIdx in detectedCurls) {\n const detectedCurl = detectedCurls[fingerIdx];\n const expectedCurls = this.curls[fingerIdx];\n if (typeof expectedCurls === 'undefined') {\n // no curl description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible curl of this specific finger\n for (const [expectedCurl, score] of expectedCurls) {\n if (detectedCurl === expectedCurl) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n // same for detected direction of each finger\n for (const fingerIdx in detectedDirections) {\n const detectedDirection = detectedDirections[fingerIdx];\n const expectedDirections = this.directions[fingerIdx];\n if (typeof expectedDirections === 'undefined') {\n // no direction description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible direction of this specific finger\n for (const [expectedDirection, score] of expectedDirections) {\n if (detectedDirection === expectedDirection) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n return confidence / 10;\n }\n}\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nimport { Finger, FingerCurl, FingerDirection, FingerGesture } from './fingerdef';\n\nexport const { thumb, index, middle, ring, pinky } = Finger;\nexport const { none, half, full } = FingerCurl;\nexport const { verticalUp, verticalDown, horizontalLeft, horizontalRight, diagonalUpRight, diagonalUpLeft, diagonalDownRight, diagonalDownLeft } = FingerDirection;\n\n// describe thumbs up gesture \uD83D\uDC4D\nconst ThumbsUp = new FingerGesture('thumbs up');\nThumbsUp.curl(thumb, none, 1.0);\nThumbsUp.direction(thumb, verticalUp, 1.0);\nThumbsUp.direction(thumb, diagonalUpLeft, 0.25);\nThumbsUp.direction(thumb, diagonalUpRight, 0.25);\nfor (const finger of [Finger.index, Finger.middle, Finger.ring, Finger.pinky]) {\n ThumbsUp.curl(finger, full, 1.0);\n ThumbsUp.direction(finger, horizontalLeft, 1.0);\n ThumbsUp.direction(finger, horizontalRight, 1.0);\n}\n\n// describe Victory gesture \u270C\uFE0F\nconst Victory = new FingerGesture('victory');\nVictory.curl(thumb, half, 0.5);\nVictory.curl(thumb, none, 0.5);\nVictory.direction(thumb, verticalUp, 1.0);\nVictory.direction(thumb, diagonalUpLeft, 1.0);\nVictory.curl(index, none, 1.0);\nVictory.direction(index, verticalUp, 0.75);\nVictory.direction(index, diagonalUpLeft, 1.0);\nVictory.curl(middle, none, 1.0);\nVictory.direction(middle, verticalUp, 1.0);\nVictory.direction(middle, diagonalUpLeft, 0.75);\nVictory.curl(ring, full, 1.0);\nVictory.direction(ring, verticalUp, 0.2);\nVictory.direction(ring, diagonalUpLeft, 1.0);\nVictory.direction(ring, horizontalLeft, 0.2);\nVictory.curl(pinky, full, 1.0);\nVictory.direction(pinky, verticalUp, 0.2);\nVictory.direction(pinky, diagonalUpLeft, 1.0);\nVictory.direction(pinky, horizontalLeft, 0.2);\nVictory.weight(index, 2);\nVictory.weight(middle, 2);\n\n// describe Point gesture \u270C\uFE0F\nconst Point = new FingerGesture('point');\nPoint.curl(thumb, full, 1.0);\nPoint.curl(index, none, 0.5);\nPoint.curl(middle, full, 0.5);\nPoint.curl(ring, full, 0.5);\nPoint.curl(pinky, full, 0.5);\nPoint.weight(index, 2);\nPoint.weight(middle, 2);\n\n// describe Point gesture \u270C\uFE0F\nconst MiddleFinger = new FingerGesture('middle finger');\nMiddleFinger.curl(thumb, none, 1.0);\nMiddleFinger.curl(index, full, 0.5);\nMiddleFinger.curl(middle, full, 0.5);\nMiddleFinger.curl(ring, full, 0.5);\nMiddleFinger.curl(pinky, full, 0.5);\nMiddleFinger.weight(index, 2);\nMiddleFinger.weight(middle, 2);\n\n// describe Open Palm gesture \u270C\uFE0F\nconst OpenPalm = new FingerGesture('open palm');\nOpenPalm.curl(thumb, none, 0.75);\nOpenPalm.curl(index, none, 0.75);\nOpenPalm.curl(middle, none, 0.75);\nOpenPalm.curl(ring, none, 0.75);\nOpenPalm.curl(pinky, none, 0.75);\n\nexport default [ThumbsUp, Victory, Point, MiddleFinger, OpenPalm];\n", "/**\n * FingerPose algorithm implementation constants\n *\n * Based on: [**FingerPose***](https://github.com/andypotato/fingerpose)\n */\n\n/* eslint-disable camelcase */\n\nimport { Finger, FingerCurl, FingerDirection } from './fingerdef';\nimport Gestures from '../hand/fingergesture';\n\nconst minConfidence = 0.7;\nconst options = {\n // curl estimation\n HALF_CURL_START_LIMIT: 60.0,\n NO_CURL_START_LIMIT: 130.0,\n // direction estimation\n DISTANCE_VOTE_POWER: 1.1,\n SINGLE_ANGLE_VOTE_POWER: 0.9,\n TOTAL_ANGLE_VOTE_POWER: 1.6,\n};\n\nfunction calculateSlope(point1x, point1y, point2x, point2y) {\n const value = (point1y - point2y) / (point1x - point2x);\n let slope = Math.atan(value) * 180 / Math.PI;\n if (slope <= 0) slope = -slope;\n else if (slope > 0) slope = 180 - slope;\n return slope;\n}\n\n// point1, point2 are 2d or 3d point arrays (xy[z])\n// returns either a single scalar (2d) or array of two slopes (3d)\nfunction getSlopes(point1, point2) {\n if (!point1 || !point2) return [0, 0];\n const slopeXY = calculateSlope(point1[0], point1[1], point2[0], point2[1]);\n if (point1.length === 2) return slopeXY;\n const slopeYZ = calculateSlope(point1[1], point1[2], point2[1], point2[2]);\n return [slopeXY, slopeYZ];\n}\n\nfunction angleOrientationAt(angle, weightageAt = 1.0) {\n let isVertical = 0;\n let isDiagonal = 0;\n let isHorizontal = 0;\n if (angle >= 75.0 && angle <= 105.0) isVertical = 1 * weightageAt;\n else if (angle >= 25.0 && angle <= 155.0) isDiagonal = 1 * weightageAt;\n else isHorizontal = 1 * weightageAt;\n return [isVertical, isDiagonal, isHorizontal];\n}\n\nfunction estimateFingerCurl(startPoint, midPoint, endPoint) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const start_mid_z_dist = startPoint[2] - midPoint[2];\n const start_end_z_dist = startPoint[2] - endPoint[2];\n const mid_end_z_dist = midPoint[2] - endPoint[2];\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist + start_mid_z_dist * start_mid_z_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist + start_end_z_dist * start_end_z_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist + mid_end_z_dist * mid_end_z_dist);\n let cos_in = (mid_end_dist * mid_end_dist + start_mid_dist * start_mid_dist - start_end_dist * start_end_dist) / (2 * mid_end_dist * start_mid_dist);\n if (cos_in > 1.0) cos_in = 1.0;\n else if (cos_in < -1.0) cos_in = -1.0;\n let angleOfCurve = Math.acos(cos_in);\n angleOfCurve = (57.2958 * angleOfCurve) % 180;\n let fingerCurl;\n if (angleOfCurve > options.NO_CURL_START_LIMIT) fingerCurl = FingerCurl.none;\n else if (angleOfCurve > options.HALF_CURL_START_LIMIT) fingerCurl = FingerCurl.half;\n else fingerCurl = FingerCurl.full;\n return fingerCurl;\n}\n\nfunction estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n if (max_dist_x === Math.abs(start_end_x_dist)) {\n if (start_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else if (max_dist_x === Math.abs(start_mid_x_dist)) {\n if (start_mid_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else {\n if (mid_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n }\n return estimatedDirection;\n}\n\nfunction estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y) {\n let estimatedDirection;\n if (max_dist_y === Math.abs(start_end_y_dist)) {\n if (start_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else if (max_dist_y === Math.abs(start_mid_y_dist)) {\n if (start_mid_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else {\n if (mid_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n }\n return estimatedDirection;\n}\n\nfunction estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n const reqd_vertical_direction = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n const reqd_horizontal_direction = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n if (reqd_vertical_direction === FingerDirection.verticalUp) {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalUpLeft;\n else estimatedDirection = FingerDirection.diagonalUpRight;\n } else {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalDownLeft;\n else estimatedDirection = FingerDirection.diagonalDownRight;\n }\n return estimatedDirection;\n}\n\nfunction calculateFingerDirection(startPoint, midPoint, endPoint, fingerSlopes) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const max_dist_x = Math.max(Math.abs(start_mid_x_dist), Math.abs(start_end_x_dist), Math.abs(mid_end_x_dist));\n const max_dist_y = Math.max(Math.abs(start_mid_y_dist), Math.abs(start_end_y_dist), Math.abs(mid_end_y_dist));\n let voteVertical = 0.0;\n let voteDiagonal = 0.0;\n let voteHorizontal = 0.0;\n const start_end_x_y_dist_ratio = max_dist_y / (max_dist_x + 0.00001);\n if (start_end_x_y_dist_ratio > 1.5) voteVertical += options.DISTANCE_VOTE_POWER;\n else if (start_end_x_y_dist_ratio > 0.66) voteDiagonal += options.DISTANCE_VOTE_POWER;\n else voteHorizontal += options.DISTANCE_VOTE_POWER;\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist);\n const max_dist = Math.max(start_mid_dist, start_end_dist, mid_end_dist);\n let calc_start_point_x = startPoint[0];\n let calc_start_point_y = startPoint[1];\n let calc_end_point_x = endPoint[0];\n let calc_end_point_y = endPoint[1];\n if (max_dist === start_mid_dist) {\n calc_end_point_x = endPoint[0];\n calc_end_point_y = endPoint[1];\n } else if (max_dist === mid_end_dist) {\n calc_start_point_x = midPoint[0];\n calc_start_point_y = midPoint[1];\n }\n const calcStartPoint = [calc_start_point_x, calc_start_point_y];\n const calcEndPoint = [calc_end_point_x, calc_end_point_y];\n const totalAngle = getSlopes(calcStartPoint, calcEndPoint);\n const votes = angleOrientationAt(totalAngle, options.TOTAL_ANGLE_VOTE_POWER);\n voteVertical += votes[0];\n voteDiagonal += votes[1];\n voteHorizontal += votes[2];\n for (const fingerSlope of fingerSlopes) {\n const fingerVotes = angleOrientationAt(fingerSlope, options.SINGLE_ANGLE_VOTE_POWER);\n voteVertical += fingerVotes[0];\n voteDiagonal += fingerVotes[1];\n voteHorizontal += fingerVotes[2];\n }\n // in case of tie, highest preference goes to Vertical,\n // followed by horizontal and then diagonal\n let estimatedDirection;\n if (voteVertical === Math.max(voteVertical, voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n } else if (voteHorizontal === Math.max(voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n } else {\n estimatedDirection = estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n }\n return estimatedDirection;\n}\n\nfunction estimate(landmarks) {\n // step 1: calculate slopes\n const slopesXY: number[][] = [];\n const slopesYZ: number[][] = [];\n const fingerCurls: number[] = [];\n const fingerDirections: number[] = [];\n if (!landmarks) return { curls: fingerCurls, directions: fingerDirections };\n\n // step 1: calculate slopes\n for (const finger of Finger.all) {\n const points = Finger.getPoints(finger);\n const slopeAtXY: number[] = [];\n const slopeAtYZ: number[] = [];\n for (const point of points) {\n const point1 = landmarks[point[0]];\n const point2 = landmarks[point[1]];\n // calculate single slope\n const slopes = getSlopes(point1, point2);\n const slopeXY = slopes[0];\n const slopeYZ = slopes[1];\n slopeAtXY.push(slopeXY);\n slopeAtYZ.push(slopeYZ);\n }\n slopesXY.push(slopeAtXY);\n slopesYZ.push(slopeAtYZ);\n }\n\n // step 2: calculate orientations\n for (const finger of Finger.all) {\n // start finger predictions from palm - except for thumb\n const pointIndexAt = (finger === Finger.thumb) ? 1 : 0;\n const fingerPointsAt = Finger.getPoints(finger);\n const startPoint = landmarks[fingerPointsAt[pointIndexAt][0]];\n const midPoint = landmarks[fingerPointsAt[pointIndexAt + 1][1]];\n const endPoint = landmarks[fingerPointsAt[3][1]];\n // check if finger is curled\n const fingerCurled = estimateFingerCurl(startPoint, midPoint, endPoint);\n const fingerPosition = calculateFingerDirection(startPoint, midPoint, endPoint, slopesXY[finger].slice(pointIndexAt));\n fingerCurls[finger] = fingerCurled;\n fingerDirections[finger] = fingerPosition;\n }\n return { curls: fingerCurls, directions: fingerDirections };\n}\n\nexport function analyze(keypoints) { // get estimations of curl / direction for each finger\n if (!keypoints || keypoints.length === 0) return null;\n const estimatorRes = estimate(keypoints);\n const landmarks = {};\n for (const fingerIdx of Finger.all) {\n landmarks[Finger.getName(fingerIdx)] = {\n curl: FingerCurl.getName(estimatorRes.curls[fingerIdx]),\n direction: FingerDirection.getName(estimatorRes.directions[fingerIdx]),\n };\n }\n return landmarks;\n}\n\nexport function match(keypoints) { // compare gesture description to each known gesture\n const poses: { name: string, confidence: number }[] = [];\n if (!keypoints || keypoints.length === 0) return poses;\n const estimatorRes = estimate(keypoints);\n for (const gesture of Gestures) {\n const confidence = gesture.matchAgainst(estimatorRes.curls, estimatorRes.directions);\n if (confidence >= minConfidence) poses.push({ name: gesture.name, confidence });\n }\n return poses;\n}\n", "/**\n * Gesture detection algorithm\n */\n\nimport type { GestureResult, BodyResult, FaceResult, HandResult, Point } from '../result';\nimport * as fingerPose from '../hand/fingerpose';\n\n/** face gesture type */\nexport type FaceGesture =\n `facing ${'left' | 'center' | 'right'}`\n | `blink ${'left' | 'right'} eye`\n | `mouth ${number}% open`\n | `head ${'up' | 'down'}`;\n\n/** iris gesture type */\nexport type IrisGesture =\n 'facing center'\n | `looking ${'left' | 'right' | 'up' | 'down'}`\n | 'looking center';\n\n/** body gesture type */\nexport type BodyGesture =\n `leaning ${'left' | 'right'}`\n | `raise ${'left' | 'right'} hand`\n | 'i give up';\n\n/** hand gesture type */\nexport type HandGesture =\n `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} forward`\n | `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} up`\n | 'victory'\n | 'thumbs up';\n\nexport const body = (res: BodyResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { body: number, gesture: BodyGesture }[] = [];\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[1] < nose.position[1]) && (rightWrist.position[1] < nose.position[1])) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position[1] < nose.position[1])) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position[1] < nose.position[1])) 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 && Math.abs(leftShoulder.positionRaw[1] - rightShoulder.positionRaw[1]) > 0.1) {\n gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position[1] > rightShoulder.position[1]) ? 'left' : 'right'}` });\n }\n }\n return gestures;\n};\n\nexport const face = (res: FaceResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { face: number, gesture: FaceGesture }[] = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 450) {\n const zDiff = (res[i].mesh[33][2] || 0) - (res[i].mesh[263][2] || 0);\n const xDiff = res[i].mesh[33][0] - res[i].mesh[263][0];\n if (Math.abs(zDiff / xDiff) <= 0.15) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${zDiff < 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] || 0;\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: FaceResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { iris: number, gesture: IrisGesture }[] = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations?.leftEyeIris?.[0] || !res[i].annotations?.rightEyeIris?.[0]) 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 leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].box[2];\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].box[2];\n if (leftIrisCenterX > 0.06 || rightIrisCenterX > 0.06) center = false;\n if (leftIrisCenterX > rightIrisCenterX) { // check eye with bigger offset\n if (rightIrisCenterX > 0.04) gestures.push({ iris: i, gesture: 'looking right' });\n } else {\n if (leftIrisCenterX > 0.04) gestures.push({ iris: i, gesture: 'looking left' });\n }\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].box[3];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].box[3];\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01 || leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) center = false;\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) 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: HandResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { hand: number, gesture: HandGesture }[] = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: { name: string, position: Point }[] = [];\n if (res[i].annotations) {\n for (const [finger, pos] of Object.entries(res[i].annotations)) {\n if (finger !== 'palmBase' && Array.isArray(pos) && pos[0]) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => ((best.position[2] || 0) < (a.position[2] || 0) ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward` as HandGesture });\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${highest.name} up` as HandGesture });\n }\n if (res[i].keypoints) {\n const poses = fingerPose.match(res[i].keypoints);\n for (const pose of poses) gestures.push({ hand: i, gesture: pose.name as HandGesture });\n }\n }\n return gestures;\n};\n", "import * as tf from 'dist/tfjs.esm.js';\nimport type { Point } from '../result';\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]] as Point;\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]] as Point;\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]] as Point;\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]] as Point;\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] as Point;\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize] as Point;\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]] as Point;\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]] as Point;\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport 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: number[] = [];\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: number[][] = [];\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", "/**\n * HandPose model implementation constants\n * See `handpose.ts` for entry point\n */\n\nexport const anchors = [\n { x: 0.015625, y: 0.015625 },\n { x: 0.015625, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n];\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as util from './handposeutil';\nimport * as anchors from './handposeanchors';\nimport { constants } from '../tfjs/constants';\nimport type { Tensor, Tensor1D, Tensor2D, Tensor4D, GraphModel } from '../tfjs/types';\nimport type { Point } from '../result';\nimport type { Config } from '../config';\n\nexport class HandDetector {\n model: GraphModel;\n anchors: number[][];\n anchorsTensor: Tensor;\n inputSize: number;\n inputSizeTensor: Tensor;\n doubleInputSizeTensor: Tensor;\n\n constructor(model: GraphModel) {\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] || 0;\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 const t: Record = {};\n t.boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n t.boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n t.div = tf.div(t.boxOffsets, this.inputSizeTensor);\n t.boxCenterPoints = tf.add(t.div, this.anchorsTensor);\n t.halfBoxSizes = tf.div(t.boxSizes, this.doubleInputSizeTensor);\n t.sub = tf.sub(t.boxCenterPoints, t.halfBoxSizes);\n t.startPoints = tf.mul(t.sub, this.inputSizeTensor);\n t.add = tf.add(t.boxCenterPoints, t.halfBoxSizes);\n t.endPoints = tf.mul(t.add, this.inputSizeTensor);\n const res = tf.concat2d([t.startPoints as Tensor2D, t.endPoints as Tensor2D], 1);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return res as Tensor;\n }\n\n normalizeLandmarks(rawPalmLandmarks, index: number): Tensor {\n const t: Record = {};\n t.reshape = tf.reshape(rawPalmLandmarks, [-1, 7, 2]);\n t.div = tf.div(t.reshape, this.inputSizeTensor);\n t.landmarks = tf.add(t.div, this.anchors[index] ? this.anchors[index] : 0);\n const res = tf.mul(t.landmarks, this.inputSizeTensor);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return res;\n }\n\n async predict(input: Tensor4D, config: Config): Promise<{ startPoint: Point; endPoint: Point, palmLandmarks: Point[]; confidence: number }[]> {\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [this.inputSize, this.inputSize]);\n t.div = tf.div(t.resize, constants.tf127);\n t.image = tf.sub(t.div, constants.tf1);\n t.batched = this.model.execute(t.image) as Tensor;\n t.predictions = tf.squeeze(t.batched);\n t.slice = tf.slice(t.predictions, [0, 0], [-1, 1]);\n t.sigmoid = tf.sigmoid(t.slice);\n t.scores = tf.squeeze(t.sigmoid);\n const scores = await t.scores.data();\n t.boxes = tf.slice(t.predictions, [0, 1], [-1, 4]);\n t.norm = this.normalizeBoxes(t.boxes);\n // box detection is flaky so we look for 3x boxes than we need results\n t.nms = await tf.image.nonMaxSuppressionAsync(t.norm as Tensor2D, t.scores as Tensor1D, 3 * (config.hand?.maxDetected || 1), config.hand.iouThreshold, config.hand.minConfidence);\n const nms = await t.nms.array() as number[];\n const hands: { startPoint: Point; endPoint: Point; palmLandmarks: Point[]; confidence: number }[] = [];\n for (const index of nms) {\n const p: Record = {};\n p.box = tf.slice(t.norm, [index, 0], [1, -1]);\n p.slice = tf.slice(t.predictions, [index, 5], [1, 14]);\n p.norm = this.normalizeLandmarks(p.slice, index);\n p.palmLandmarks = tf.reshape(p.norm, [-1, 2]);\n const box = await p.box.data();\n const startPoint = box.slice(0, 2) as unknown as Point;\n const endPoint = box.slice(2, 4) as unknown as Point;\n const palmLandmarks = await p.palmLandmarks.array();\n const hand = { startPoint, endPoint, palmLandmarks, confidence: scores[index] };\n const scaled = util.scaleBoxCoordinates(hand, [(input.shape[2] || 1) / this.inputSize, (input.shape[1] || 0) / this.inputSize]);\n hands.push(scaled);\n Object.keys(p).forEach((tensor) => tf.dispose(p[tensor]));\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return hands;\n }\n}\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as util from './handposeutil';\nimport type * as detector from './handposedetector';\nimport { constants } from '../tfjs/constants';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { now } from '../util/util';\nimport type { Point } from '../result';\n\nconst palmBoxEnlargeFactor = 5; // default 3\nconst handBoxEnlargeFactor = 1.65; // default 1.65\nconst palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];\nconst palmLandmarksPalmBase = 0;\nconst palmLandmarksMiddleFingerBase = 2;\nlet lastTime = 0;\n\nexport class HandPipeline {\n handDetector: detector.HandDetector;\n handPoseModel: GraphModel;\n inputSize: number;\n storedBoxes: ({ startPoint: Point; endPoint: Point; palmLandmarks: Point[]; confidence: number } | null)[];\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, handPoseModel) {\n this.handDetector = handDetector;\n this.handPoseModel = handPoseModel;\n this.inputSize = this.handPoseModel?.inputs?.[0].shape?.[2] || 0;\n this.storedBoxes = [];\n this.skipped = Number.MAX_SAFE_INTEGER;\n this.detectedHands = 0;\n }\n\n calculateLandmarksBoundingBox(landmarks) { // eslint-disable-line class-methods-use-this\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 getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n return util.enlargeBox(util.squarifyBox(boxAroundPalm), palmBoxEnlargeFactor);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = util.enlargeBox(util.squarifyBox(boundingBox), handBoxEnlargeFactor);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < palmLandmarkIds.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[palmLandmarkIds[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = util.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 = [...util.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 Math.trunc(coord[0] + originalBoxCenter[0]),\n Math.trunc(coord[1] + originalBoxCenter[1]),\n Math.trunc(coord[2]),\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames\n let boxes;\n const skipTime = (config.hand.skipTime || 0) > (now() - lastTime);\n const skipFrame = this.skipped < (config.hand.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame) {\n this.skipped++;\n } else {\n boxes = await this.handDetector.predict(image, config);\n this.skipped = 0;\n }\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: { landmarks: Point[], confidence: number, boxConfidence: number, fingerConfidence: number, box: { topLeft: Point, bottomRight: Point } }[] = [];\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[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0;\n const palmCenter = util.getBoxCenter(currentBox);\n const palmCenterNormalized: [number, number] = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation && env.kernels.includes('rotatewithoffset') ? 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 = util.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = tf.div(croppedInput, constants.tf255);\n tf.dispose(croppedInput);\n tf.dispose(rotatedImage);\n const [confidenceT, keypoints] = this.handPoseModel.execute(handImage) as Tensor[];\n lastTime = now();\n tf.dispose(handImage);\n const confidence = (await confidenceT.data())[0];\n tf.dispose(confidenceT);\n if (confidence >= config.hand.minConfidence / 4) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n tf.dispose(keypoints);\n tf.dispose(keypointsReshaped);\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = { ...nextBoundingBox, confidence };\n const result = {\n landmarks: coords,\n confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n this.storedBoxes[i] = null;\n }\n tf.dispose(keypoints);\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), handBoxEnlargeFactor);\n const enlarged = util.enlargeBox(util.squarifyBox(currentBox), handBoxEnlargeFactor);\n const result = {\n confidence: currentBox.confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: 0,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n landmarks: [],\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n if (hands.length > config.hand.maxDetected) hands.length = config.hand.maxDetected;\n return hands;\n }\n}\n", "/**\n * HandPose model implementation\n *\n * Based on: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n */\n\nimport { log } from '../util/util';\nimport * as handdetector from './handposedetector';\nimport * as handpipeline from './handposepipeline';\nimport * as fingerPose from './fingerpose';\nimport { loadModel } from '../tfjs/load';\nimport type { HandResult, Box, Point } from '../result';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nconst meshAnnotations = {\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palm: [0],\n};\n\nlet handDetectorModel: GraphModel | null;\nlet handPoseModel: GraphModel | null;\nlet handPipeline: handpipeline.HandPipeline;\n\nexport function initPipeline() {\n const handDetector = handDetectorModel ? new handdetector.HandDetector(handDetectorModel) : undefined;\n if (handDetector && handPoseModel) handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel);\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!handPipeline) initPipeline();\n const predictions = await handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: HandResult[] = [];\n for (let i = 0; i < predictions.length; i++) {\n const annotations = {};\n if (predictions[i].landmarks) {\n for (const key of Object.keys(meshAnnotations)) {\n annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);\n }\n }\n const keypoints = predictions[i].landmarks as unknown as Point[];\n let box: Box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work\n let boxRaw: Box = [0, 0, 0, 0];\n if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks\n for (const pt of keypoints) {\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 boxRaw = [box[0] / (input.shape[2] || 0), box[1] / (input.shape[1] || 0), box[2] / (input.shape[2] || 0), box[3] / (input.shape[1] || 0)];\n } else { // otherwise use box from prediction\n box = predictions[i].box ? [\n Math.trunc(Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.max(0, predictions[i].box.topLeft[1])),\n Math.trunc(Math.min((input.shape[2] || 0), predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.min((input.shape[1] || 0), predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])),\n ] : [0, 0, 0, 0];\n boxRaw = [\n (predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n ];\n }\n const landmarks = fingerPose.analyze(keypoints);\n hands.push({\n id: i,\n score: Math.round(100 * predictions[i].confidence) / 100,\n boxScore: Math.round(100 * predictions[i].boxConfidence) / 100,\n fingerScore: Math.round(100 * predictions[i].fingerConfidence) / 100,\n label: 'hand',\n box,\n boxRaw,\n keypoints,\n annotations: annotations as HandResult['annotations'],\n landmarks: landmarks as HandResult['landmarks'],\n });\n }\n return hands;\n}\n\nexport async function loadDetect(config: Config): Promise {\n if (env.initial) handDetectorModel = null;\n if (!handDetectorModel) handDetectorModel = await loadModel(config.hand.detector?.modelPath);\n else if (config.debug) log('cached model:', handDetectorModel['modelUrl']);\n return handDetectorModel;\n}\n\nexport async function loadSkeleton(config: Config): Promise {\n if (env.initial) handPoseModel = null;\n if (!handPoseModel) handPoseModel = await loadModel(config.hand.skeleton?.modelPath);\n else if (config.debug) log('cached model:', handPoseModel['modelUrl']);\n return handPoseModel;\n}\n", "/**\n * HandTrack model implementation\n *\n * Based on:\n * - Hand Detection & Skeleton: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n * - Hand Tracking: [**HandTracking**](https://github.com/victordibia/handtracking)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport * as box from '../util/box';\nimport { loadModel } from '../tfjs/load';\nimport type { HandResult, HandType, Box, Point } from '../result';\nimport type { GraphModel, Tensor, Tensor1D, Tensor2D, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as fingerPose from './fingerpose';\nimport { fakeOps } from '../tfjs/backend';\nimport { constants } from '../tfjs/constants';\n\nconst models: [GraphModel | null, GraphModel | null] = [null, null];\nconst modelOutputNodes = ['StatefulPartitionedCall/Postprocessor/Slice', 'StatefulPartitionedCall/Postprocessor/ExpandDims_1'];\n\nconst inputSize = [[0, 0], [0, 0]];\n\nconst classes = ['hand', 'fist', 'pinch', 'point', 'face', 'tip', 'pinchtip'];\nconst faceIndex = 4;\n\nconst boxExpandFact = 1.6;\nconst maxDetectorResolution = 512;\nconst detectorExpandFact = 1.4;\n\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet lastTime = 0;\nlet outputSize: [number, number] = [0, 0];\n\ninterface HandDetectResult {\n id: number,\n score: number,\n box: Box,\n boxRaw: Box,\n label: HandType,\n}\n\nconst cache: {\n boxes: HandDetectResult[],\n hands: HandResult[];\n} = {\n boxes: [],\n hands: [],\n};\n\nconst fingerMap = {\n /*\n thumb: [0, 1, 2, 3, 4],\n index: [0, 5, 6, 7, 8],\n middle: [0, 9, 10, 11, 12],\n ring: [0, 13, 14, 15, 16],\n pinky: [0, 17, 18, 19, 20],\n palm: [0],\n */\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n base: [0],\n palm: [0, 17, 13, 9, 5, 1, 0],\n};\n\nexport async function loadDetect(config: Config): Promise {\n // HandTrack Model: Original: TFJS Port: \n if (env.initial) models[0] = null;\n if (!models[0]) {\n // handtrack model has some kernel ops defined in model but those are never referenced and non-existent in tfjs\n // ideally need to prune the model itself\n fakeOps(['tensorlistreserve', 'enter', 'tensorlistfromtensor', 'merge', 'loopcond', 'switch', 'exit', 'tensorliststack', 'nextiteration', 'tensorlistsetitem', 'tensorlistgetitem', 'reciprocal', 'shape', 'split', 'where'], config);\n models[0] = await loadModel(config.hand.detector?.modelPath);\n const inputs = models[0]['executor'] ? Object.values(models[0].modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n } else if (config.debug) log('cached model:', models[0]['modelUrl']);\n return models[0];\n}\n\nexport async function loadSkeleton(config: Config): Promise {\n if (env.initial) models[1] = null;\n if (!models[1]) {\n models[1] = await loadModel(config.hand.skeleton?.modelPath);\n const inputs = models[1]['executor'] ? Object.values(models[1].modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n } else if (config.debug) log('cached model:', models[1]['modelUrl']);\n return models[1];\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (!models[0]) await loadDetect(config);\n if (!models[1]) await loadSkeleton(config);\n return models;\n}\n\nasync function detectHands(input: Tensor4D, config: Config): Promise {\n const hands: HandDetectResult[] = [];\n if (!input || !models[0]) return hands;\n const t: Record = {};\n const ratio = (input.shape[2] || 1) / (input.shape[1] || 1);\n const height = Math.min(Math.round((input.shape[1] || 0) / 8) * 8, maxDetectorResolution); // use dynamic input size but cap at 512\n const width = Math.round(height * ratio / 8) * 8;\n t.resize = tf.image.resizeBilinear(input, [height, width]); // todo: resize with padding\n t.cast = tf.cast(t.resize, 'int32');\n [t.rawScores, t.rawBoxes] = await models[0].executeAsync(t.cast, modelOutputNodes) as Tensor[];\n t.boxes = tf.squeeze(t.rawBoxes, [0, 2]);\n t.scores = tf.squeeze(t.rawScores, [0]);\n const classScores: Tensor[] = tf.unstack(t.scores, 1); // unstack scores based on classes\n tf.dispose(classScores[faceIndex]);\n classScores.splice(faceIndex, 1); // remove faces\n t.filtered = tf.stack(classScores, 1); // restack\n tf.dispose(classScores);\n // t.filtered = t.scores;\n t.max = tf.max(t.filtered, 1); // max overall score\n t.argmax = tf.argMax(t.filtered, 1); // class index of max overall score\n let id = 0;\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.max as Tensor1D, (config.hand.maxDetected || 0) + 1, config.hand.iouThreshold || 0, config.hand.minConfidence || 1);\n const nms = await t.nms.data();\n const scores = await t.max.data();\n const classNum = await t.argmax.data();\n for (const nmsIndex of Array.from(nms)) { // generates results for each class\n const boxSlice = tf.slice(t.boxes, nmsIndex, 1);\n const boxYX = await boxSlice.data();\n tf.dispose(boxSlice);\n const boxData: Box = [boxYX[1], boxYX[0], boxYX[3] - boxYX[1], boxYX[2] - boxYX[0]]; // yx box reshaped to standard box\n const boxRaw: Box = box.scale(boxData, detectorExpandFact);\n const boxFull: Box = [Math.trunc(boxData[0] * outputSize[0]), Math.trunc(boxData[1] * outputSize[1]), Math.trunc(boxData[2] * outputSize[0]), Math.trunc(boxData[3] * outputSize[1])];\n const score = scores[nmsIndex];\n const label = classes[classNum[nmsIndex]] as HandType;\n const hand: HandDetectResult = { id: id++, score, box: boxFull, boxRaw, label };\n hands.push(hand);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n hands.sort((a, b) => b.score - a.score);\n if (hands.length > (config.hand.maxDetected || 1)) hands.length = (config.hand.maxDetected || 1);\n return hands;\n}\n\nasync function detectFingers(input: Tensor4D, h: HandDetectResult, config: Config): Promise {\n const hand: HandResult = { // initial values inherited from hand detect\n id: h.id,\n score: Math.round(100 * h.score) / 100,\n boxScore: Math.round(100 * h.score) / 100,\n fingerScore: 0,\n box: h.box,\n boxRaw: h.boxRaw,\n label: h.label,\n keypoints: [],\n landmarks: {} as HandResult['landmarks'],\n annotations: {} as HandResult['annotations'],\n };\n if (input && models[1] && config.hand.landmarks && h.score > (config.hand.minConfidence || 0)) {\n const t: Record = {};\n const boxCrop = [h.boxRaw[1], h.boxRaw[0], h.boxRaw[3] + h.boxRaw[1], h.boxRaw[2] + h.boxRaw[0]] as Box;\n t.crop = tf.image.cropAndResize(input, [boxCrop], [0], [inputSize[1][0], inputSize[1][1]], 'bilinear');\n t.div = tf.div(t.crop, constants.tf255);\n [t.score, t.keypoints] = models[1].execute(t.div, ['Identity_1', 'Identity']) as Tensor[];\n const rawScore = (await t.score.data())[0];\n const score = (100 - Math.trunc(100 / (1 + Math.exp(rawScore)))) / 100; // reverse sigmoid value\n if (score >= (config.hand.minConfidence || 0)) {\n hand.fingerScore = score;\n t.reshaped = tf.reshape(t.keypoints, [-1, 3]);\n const coordsData: Point[] = await t.reshaped.array() as Point[];\n const coordsRaw: Point[] = coordsData.map((kpt) => [kpt[0] / inputSize[1][1], kpt[1] / inputSize[1][0], (kpt[2] || 0)]);\n const coordsNorm: Point[] = coordsRaw.map((kpt) => [kpt[0] * h.boxRaw[2], kpt[1] * h.boxRaw[3], (kpt[2] || 0)]);\n hand.keypoints = (coordsNorm).map((kpt) => [outputSize[0] * (kpt[0] + h.boxRaw[0]), outputSize[1] * (kpt[1] + h.boxRaw[1]), (kpt[2] || 0)]);\n hand.landmarks = fingerPose.analyze(hand.keypoints) as HandResult['landmarks']; // calculate finger gestures\n for (const key of Object.keys(fingerMap)) { // map keypoints to per-finger annotations\n hand.annotations[key] = fingerMap[key].map((index: number) => (hand.landmarks && hand.keypoints[index] ? hand.keypoints[index] : null));\n }\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n return hand;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!models[0]?.['executor'] || !models[1]?.['executor'] || !models[0].inputs[0].shape || !models[1].inputs[0].shape) return []; // something is wrong with the model\n outputSize = [input.shape[2] || 0, input.shape[1] || 0];\n skipped++; // increment skip frames\n const skipTime = (config.hand.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.hand.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame) {\n return cache.hands; // return cached results without running anything\n }\n return new Promise(async (resolve) => {\n const skipTimeExtended = 3 * (config.hand.skipTime || 0) > (now() - lastTime);\n const skipFrameExtended = skipped < 3 * (config.hand.skipFrames || 0);\n if (config.skipAllowed && cache.hands.length === config.hand.maxDetected) { // we have all detected hands so we're definitely skipping\n cache.hands = await Promise.all(cache.boxes.map((handBox) => detectFingers(input, handBox, config)));\n } else if (config.skipAllowed && skipTimeExtended && skipFrameExtended && cache.hands.length > 0) { // we have some cached results: maybe not enough but anyhow continue for bit longer\n cache.hands = await Promise.all(cache.boxes.map((handBox) => detectFingers(input, handBox, config)));\n } else { // finally rerun detector\n cache.boxes = await detectHands(input, config);\n lastTime = now();\n cache.hands = await Promise.all(cache.boxes.map((handBox) => detectFingers(input, handBox, config)));\n skipped = 0;\n }\n\n const oldCache = [...cache.boxes];\n cache.boxes.length = 0; // reset cache\n if (config.cacheSensitivity > 0) {\n for (let i = 0; i < cache.hands.length; i++) {\n const boxKpt = box.square(cache.hands[i].keypoints, outputSize);\n if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache.hands[i].fingerScore && cache.hands[i].fingerScore > (config.hand.minConfidence || 0)) {\n const boxScale = box.scale(boxKpt.box, boxExpandFact);\n const boxScaleRaw = box.scale(boxKpt.boxRaw, boxExpandFact);\n // const boxCrop = box.crop(boxScaleRaw);\n cache.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw });\n }\n }\n }\n for (let i = 0; i < cache.hands.length; i++) { // replace detected boxes with calculated boxes in final output\n const bbox = box.calc(cache.hands[i].keypoints, outputSize);\n cache.hands[i].box = bbox.box;\n cache.hands[i].boxRaw = bbox.boxRaw;\n }\n resolve(cache.hands);\n });\n}\n", "/**\n * Type definitions for Human result object\n */\n\nimport type { Tensor } from './tfjs/types';\nimport type { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/gesture';\nimport type { AnyCanvas } from './exports';\n\n/** generic box as [x, y, width, height] */\nexport type Box = [number, number, number, number];\n/** generic point as [x, y, z?] */\nexport type Point = [number, number, number?];\n\nexport type Emotion = 'angry' | 'disgust' | 'fear' | 'happy' | 'sad' | 'surprise' | 'neutral';\nexport type Gender = 'male' | 'female' | 'unknown';\nexport type Race = 'white' | 'black' | 'asian' | 'indian' | 'other';\nexport type FaceLandmark = 'leftEye' | 'rightEye' | 'nose' | 'mouth' | 'leftEar' | 'rightEar' | 'symmetryLine' | 'silhouette'\n | 'lipsUpperOuter' | 'lipsLowerOuter' | 'lipsUpperInner' | 'lipsLowerInner'\n | 'rightEyeUpper0' | 'rightEyeLower0' | 'rightEyeUpper1' | 'rightEyeLower1' | 'rightEyeUpper2' | 'rightEyeLower2' | 'rightEyeLower3' | 'rightEyebrowUpper' | 'rightEyebrowLower' | 'rightEyeIris'\n | 'leftEyeUpper0' | 'leftEyeLower0' | 'leftEyeUpper1' | 'leftEyeLower1' | 'leftEyeUpper2' | 'leftEyeLower2' | 'leftEyeLower3' | 'leftEyebrowUpper' | 'leftEyebrowLower' | 'leftEyeIris'\n | 'midwayBetweenEyes' | 'noseTip' | 'noseBottom' | 'noseRightCorner' | 'noseLeftCorner' | 'rightCheek' | 'leftCheek';\n\n/** Face results\n * - Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models\n * - Some values may be null if specific model is not enabled\n */\nexport interface FaceResult {\n /** face id */\n id: number\n /** overall face score */\n score: number,\n /** detection score */\n boxScore: number,\n /** mesh score */\n faceScore: number,\n /** detected face box */\n box: Box,\n /** detected face box normalized to 0..1 */\n boxRaw: Box,\n /** detected face box size */\n size: [number, number],\n /** detected face mesh */\n mesh: Point[]\n /** detected face mesh normalized to 0..1 */\n meshRaw: Point[],\n /** face contours as array of 2d points normalized to 0..1 */\n // contoursRaw: Array<[number, number]>,\n /** face contours as array of 2d points */\n // contours: Array<[number, number]>,\n /** mesh keypoints combined into annotated results */\n annotations: Record,\n /** detected age */\n age?: number,\n /** detected gender */\n gender?: Gender,\n /** gender detection score */\n genderScore?: number,\n /** detected emotions */\n emotion?: { score: number, emotion: Emotion }[],\n /** detected race */\n race?: { score: number, race: Race }[],\n /** face descriptor */\n embedding?: number[],\n /** face distance from camera */\n distance?: number,\n /** face anti-spoofing result confidence */\n real?: number,\n /** face liveness result confidence */\n live?: number,\n /** face rotation details */\n rotation?: {\n angle: { roll: number, yaw: number, pitch: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n } | null,\n /** detected face as tensor that can be used in further pipelines */\n tensor?: Tensor,\n}\n\nexport type BodyLandmarkPoseNet = 'nose' | 'leftEye' | 'rightEye' | 'leftEar' | 'rightEar' | 'leftShoulder' | 'rightShoulder' | 'leftElbow' | 'rightElbow' | 'leftWrist' | 'rightWrist' | 'leftHip' | 'rightHip' | 'leftKnee' | 'rightKnee' | 'leftAnkle' | 'rightAnkle';\nexport type BodyLandmarkMoveNet = 'nose' | 'leftEye' | 'rightEye' | 'leftEar' | 'rightEar' | 'leftShoulder' | 'rightShoulder' | 'leftElbow' | 'rightElbow' | 'leftWrist' | 'rightWrist' | 'leftHip' | 'rightHip' | 'leftKnee' | 'rightKnee' | 'leftAnkle' | 'rightAnkle';\nexport type BodyLandmarkEfficientNet = 'head' | 'neck' | 'rightShoulder' | 'rightElbow' | 'rightWrist' | 'chest' | 'leftShoulder' | 'leftElbow' | 'leftWrist' | 'bodyCenter' | 'rightHip' | 'rightKnee' | 'rightAnkle' | 'leftHip' | 'leftKnee' | 'leftAnkle';\nexport type BodyLandmarkBlazePose = 'nose' | 'leftEyeInside' | 'leftEye' | 'leftEyeOutside' | 'rightEyeInside' | 'rightEye' | 'rightEyeOutside' | 'leftEar' | 'rightEar' | 'leftMouth' | 'rightMouth' | 'leftShoulder' | 'rightShoulder'\n | 'leftElbow' | 'rightElbow' | 'leftWrist' | 'rightWrist' | 'leftPinky' | 'rightPinky' | 'leftIndex' | 'rightIndex' | 'leftThumb' | 'rightThumb' | 'leftHip' | 'rightHip' | 'leftKnee' | 'rightKnee' | 'leftAnkle' | 'rightAnkle'\n | 'leftHeel' | 'rightHeel' | 'leftFoot' | 'rightFoot' | 'bodyCenter' | 'bodyTop' | 'leftPalm' | 'leftHand' | 'rightPalm' | 'rightHand';\nexport type BodyLandmark = BodyLandmarkPoseNet | BodyLandmarkMoveNet | BodyLandmarkEfficientNet | BodyLandmarkBlazePose;\nexport type BodyAnnotationBlazePose = 'leftLeg' | 'rightLeg' | 'torso' | 'leftArm' | 'rightArm' | 'leftEye' | 'rightEye' | 'mouth';\nexport type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'torso' | 'leftArm' | 'rightArm' | 'head';\nexport type BodyAnnotation = BodyAnnotationBlazePose | BodyAnnotationEfficientPose;\n\n/** Body Result keypoints */\nexport interface BodyKeypoint {\n /** body part name */\n part: BodyLandmark,\n /** body part position */\n position: Point,\n /** body part position normalized to 0..1 */\n positionRaw: Point,\n /** body part position relative to body center in meters */\n distance?: Point,\n /** body part detection score */\n score: number,\n}\n\n/** Body results */\nexport interface BodyResult {\n /** body id */\n id: number,\n /** body detection score */\n score: number,\n /** detected body box */\n box: Box,\n /** detected body box normalized to 0..1 */\n boxRaw: Box,\n /** detected body keypoints */\n keypoints: BodyKeypoint[]\n /** detected body keypoints combined into annotated parts */\n annotations: Record,\n}\n\nexport type HandType = 'hand' | 'fist' | 'pinch' | 'point' | 'face' | 'tip' | 'pinchtip';\nexport type Finger = 'index' | 'middle' | 'pinky' | 'ring' | 'thumb' | 'palm';\nexport type FingerCurl = 'none' | 'half' | 'full';\nexport type FingerDirection = 'verticalUp' | 'verticalDown' | 'horizontalLeft' | 'horizontalRight' | 'diagonalUpRight' | 'diagonalUpLeft' | 'diagonalDownRight' | 'diagonalDownLeft';\n\n/** Hand results */\nexport interface HandResult {\n /** hand id */\n id: number,\n /** hand overal score */\n score: number,\n /** hand detection score */\n boxScore: number,\n /** hand skelton score */\n fingerScore: number,\n /** detected hand box */\n box: Box,\n /** detected hand box normalized to 0..1 */\n boxRaw: Box,\n /** detected hand keypoints */\n keypoints: Point[],\n /** detected hand class */\n label: HandType,\n /** detected hand keypoints combined into annotated parts */\n annotations: Record,\n /** detected hand parts annotated with part gestures */\n landmarks: Record,\n}\n\nexport type ObjectType = 'person' | 'bicycle' | 'car' | 'motorcycle' | 'airplane' | 'bus' | 'train' | 'truck' | 'boat' | 'traffic light' | 'fire hydrant' | 'stop sign' | 'parking meter'\n | 'bench' | 'bird' | 'cat' | 'dog' | 'horse' | 'sheep' | 'cow' | 'elephant' | 'bear' | 'zebra' | 'giraffe' | 'backpack' | 'umbrella' | 'handbag' | 'tie' | 'suitcase' | 'frisbee'\n | 'skis' | 'snowboard' | 'sports ball' | 'kite' | 'baseball bat' | 'baseball glove' | 'skateboard' | 'surfboard' | 'tennis racket' | 'bottle' | 'wine glass' | 'cup' | 'fork'\n | 'knife' | 'spoon' | 'bowl' | 'banana' | 'apple' | 'sandwich' | 'orange' | 'broccoli' | 'carrot' | 'hot dog' | 'pizza' | 'donut' | 'cake' | 'chair' | 'couch' | 'potted plant'\n | 'bed' | 'dining table' | 'toilet' | 'tv' | 'laptop' | 'mouse' | 'remote' | 'keyboard' | 'cell phone' | 'microwave' | 'oven' | 'toaster' | 'sink' | 'refrigerator' | 'book'\n | 'clock' | 'vase' | 'scissors' | 'teddy bear' | 'hair drier' | 'toothbrush';\n\n/** Object results */\nexport interface ObjectResult {\n /** object id */\n id: number,\n /** object detection score */\n score: number,\n /** detected object class id */\n class: number,\n /** detected object class name */\n label: ObjectType,\n /** detected object box */\n box: Box,\n /** detected object box normalized to 0..1 */\n boxRaw: Box,\n}\n\n/** Gesture combined results\n * Each result has:\n * - part: part name and number where gesture was detected: `face`, `iris`, `body`, `hand`\n * - gesture: gesture detected\n */\nexport type GestureResult =\n { 'face': number, gesture: FaceGesture }\n | { 'iris': number, gesture: IrisGesture }\n | { 'body': number, gesture: BodyGesture }\n | { 'hand': number, gesture: HandGesture }\n\n/** Person getter\n* - Triggers combining all individual results into a virtual person object\n*/\nexport interface PersonResult {\n /** person id */\n id: number,\n /** face result that belongs to this person */\n face: FaceResult,\n /** body result that belongs to this person */\n body: BodyResult | null,\n /** left and right hand results that belong to this person */\n hands: { left: HandResult | null, right: HandResult | null },\n /** detected gestures specific to this person */\n gestures: GestureResult[],\n /** box that defines the person */\n box: Box,\n /** box that defines the person normalized to 0..1 */\n boxRaw?: Box,\n}\n\n/**\n * Result interface definition for **Human** library\n *\n * Contains all possible detection results\n */\nexport interface Result {\n /** {@link FaceResult}: detection & analysis results */\n face: FaceResult[],\n /** {@link BodyResult}: detection & analysis results */\n body: BodyResult[],\n /** {@link HandResult}: detection & analysis results */\n hand: HandResult[],\n /** {@link GestureResult}: detection & analysis results */\n gesture: GestureResult[],\n /** {@link ObjectResult}: detection & analysis results */\n object: ObjectResult[]\n /** global performance object with timing values for each operation */\n performance: Record,\n /** optional processed canvas that can be used to draw input on screen */\n canvas?: AnyCanvas | null,\n /** timestamp of detection representing the milliseconds elapsed since the UNIX epoch */\n readonly timestamp: number,\n /** getter property that returns unified persons object */\n persons: PersonResult[],\n /** Last known error message */\n error: string | null;\n /** Resolution width */\n width: number,\n /** Resolution height */\n height: number,\n}\n\nexport const empty = (error: string | null = null): Result => ({ face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, width: 0, height: 0, error });\n", "export const kpt: string[] = [ // used to create part labels\n 'nose',\n 'leftEye',\n 'rightEye',\n 'leftEar',\n 'rightEar',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n];\n\nexport const horizontal: string[][] = [ // used to fix left vs right\n ['leftEye', 'rightEye'],\n ['leftEar', 'rightEar'],\n ['leftShoulder', 'rightShoulder'],\n ['leftElbow', 'rightElbow'],\n ['leftWrist', 'rightWrist'],\n ['leftHip', 'rightHip'],\n ['leftKnee', 'rightKnee'],\n ['leftAnkle', 'rightAnkle'],\n];\n\nexport const vertical: string[][] = [ // used to remove unlikely keypoint positions\n ['leftKnee', 'leftShoulder'],\n ['rightKnee', 'rightShoulder'],\n ['leftAnkle', 'leftKnee'],\n ['rightAnkle', 'rightKnee'],\n];\n\nexport const relative: string[][][] = [ // used to match relative body parts\n [['leftHip', 'rightHip'], ['leftShoulder', 'rightShoulder']],\n [['leftElbow', 'rightElbow'], ['leftShoulder', 'rightShoulder']],\n];\n\nexport const connected: Record = { // used to create body outline in annotations\n leftLeg: ['leftHip', 'leftKnee', 'leftAnkle'],\n rightLeg: ['rightHip', 'rightKnee', 'rightAnkle'],\n torso: ['leftShoulder', 'rightShoulder', 'rightHip', 'leftHip', 'leftShoulder'],\n leftArm: ['leftShoulder', 'leftElbow', 'leftWrist'],\n rightArm: ['rightShoulder', 'rightElbow', 'rightWrist'],\n head: [],\n};\n", "/**\n * Results interpolation for smoothening of video detection results inbetween detected frames\n */\n\nimport { Result, FaceResult, BodyResult, HandResult, ObjectResult, PersonResult, Box, Point, BodyLandmark, BodyAnnotation, empty, FaceLandmark } from '../result';\nimport type { Config } from '../config';\n\nimport * as moveNetCoords from '../body/movenetcoords';\nimport * as blazePoseCoords from '../body/blazeposecoords';\nimport * as efficientPoseCoords from '../body/efficientposecoords';\nimport { now } from './util';\nimport { env } from './env';\n\nconst bufferedResult: Result = empty();\nlet interpolateTime = 0;\n\nexport function calc(newResult: Result, config: Config): Result {\n const t0 = now();\n if (!newResult) return empty();\n // each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself\n // otherwise bufferedResult is a shallow clone of result plus updated local calculated values\n // thus mixing by-reference and by-value assignments to minimize memory operations\n\n const elapsed = Date.now() - newResult.timestamp;\n\n /* curve fitted: buffer = 8 - ln(delay)\n interpolation formula: current = ((buffer - 1) * previous + live) / buffer\n - at 50ms delay buffer = ~4.1 => 28% towards live data\n - at 250ms delay buffer = ~2.5 => 40% towards live data\n - at 500ms delay buffer = ~1.8 => 55% towards live data\n - at 750ms delay buffer = ~1.4 => 71% towards live data\n - at 1sec delay buffer = 1 which means live data is used\n */\n const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed + 1) : 1;\n\n if (newResult.canvas) bufferedResult.canvas = newResult.canvas;\n if (newResult.error) bufferedResult.error = newResult.error;\n\n // interpolate body results\n if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {\n bufferedResult.body = JSON.parse(JSON.stringify(newResult.body)) as BodyResult[]; // deep clone once\n } else {\n for (let i = 0; i < newResult.body.length; i++) {\n const box = newResult.body[i].box // update box\n .map((newBoxCoord, j) => ((bufferedFactor - 1) * bufferedResult.body[i].box[j] + newBoxCoord) / bufferedFactor) as Box;\n const boxRaw = newResult.body[i].boxRaw // update boxRaw\n .map((newBoxCoord, j) => ((bufferedFactor - 1) * bufferedResult.body[i].boxRaw[j] + newBoxCoord) / bufferedFactor) as Box;\n const keypoints = (newResult.body[i].keypoints // update keypoints\n .map((newKpt, j) => ({\n score: newKpt.score,\n part: newKpt.part,\n position: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].position[0] || 0) + (newKpt.position[0] || 0)) / bufferedFactor : newKpt.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].position[1] || 0) + (newKpt.position[1] || 0)) / bufferedFactor : newKpt.position[1],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].position[2] || 0) + (newKpt.position[2] || 0)) / bufferedFactor : newKpt.position[2],\n ],\n positionRaw: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].positionRaw[0] || 0) + (newKpt.positionRaw[0] || 0)) / bufferedFactor : newKpt.positionRaw[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].positionRaw[1] || 0) + (newKpt.positionRaw[1] || 0)) / bufferedFactor : newKpt.positionRaw[1],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].positionRaw[2] || 0) + (newKpt.positionRaw[2] || 0)) / bufferedFactor : newKpt.positionRaw[2],\n ],\n distance: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].distance?.[0] || 0) + (newKpt.distance?.[0] || 0)) / bufferedFactor : newKpt.distance?.[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].distance?.[1] || 0) + (newKpt.distance?.[1] || 0)) / bufferedFactor : newKpt.distance?.[1],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].distance?.[2] || 0) + (newKpt.distance?.[2] || 0)) / bufferedFactor : newKpt.distance?.[2],\n ],\n }))) as { score: number, part: BodyLandmark, position: [number, number, number?], positionRaw: [number, number, number?] }[];\n\n const annotations: Record = {} as Record; // recreate annotations\n let coords = { connected: {} };\n if (config.body.modelPath?.includes('efficientpose')) coords = efficientPoseCoords;\n else if (config.body.modelPath?.includes('blazepose')) coords = blazePoseCoords;\n else if (config.body.modelPath?.includes('movenet')) coords = moveNetCoords;\n for (const [name, indexes] of Object.entries(coords.connected as Record)) {\n const pt: Point[][] = [];\n for (let j = 0; j < indexes.length - 1; j++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[j]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[j + 1]);\n // if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n if (pt0 && pt1) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n bufferedResult.body[i] = { ...newResult.body[i], box, boxRaw, keypoints, annotations }; // shallow clone plus updated values\n }\n }\n\n // interpolate hand results\n if (!bufferedResult.hand || (newResult.hand.length !== bufferedResult.hand.length)) {\n bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand)); // deep clone once\n } else {\n for (let i = 0; i < newResult.hand.length; i++) {\n const box = (newResult.hand[i].box// update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.hand[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n if (bufferedResult.hand[i].keypoints.length !== newResult.hand[i].keypoints.length) bufferedResult.hand[i].keypoints = newResult.hand[i].keypoints; // reset keypoints as previous frame did not have them\n const keypoints = newResult.hand[i].keypoints && newResult.hand[i].keypoints.length > 0 ? newResult.hand[i].keypoints // update landmarks\n .map((landmark, j) => landmark\n .map((coord, k) => (((bufferedFactor - 1) * (bufferedResult.hand[i].keypoints[j][k] || 1) + (coord || 0)) / bufferedFactor)) as Point)\n : [];\n let annotations = {};\n if (Object.keys(bufferedResult.hand[i].annotations).length !== Object.keys(newResult.hand[i].annotations).length) {\n bufferedResult.hand[i].annotations = newResult.hand[i].annotations; // reset annotations as previous frame did not have them\n annotations = bufferedResult.hand[i].annotations;\n } else if (newResult.hand[i].annotations) {\n for (const key of Object.keys(newResult.hand[i].annotations)) { // update annotations\n annotations[key] = newResult.hand[i]?.annotations?.[key]?.[0]\n ? newResult.hand[i].annotations[key]\n .map((val, j: number) => val\n .map((coord: number, k: number) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor))\n : null;\n }\n }\n bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations: annotations as HandResult['annotations'] }; // shallow clone plus updated values\n }\n }\n\n // interpolate face results\n if (!bufferedResult.face || (newResult.face.length !== bufferedResult.face.length)) {\n bufferedResult.face = JSON.parse(JSON.stringify(newResult.face)) as FaceResult[]; // deep clone once\n } else {\n for (let i = 0; i < newResult.face.length; i++) {\n const box = (newResult.face[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.face[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n let annotations: Record = newResult.face[i].annotations;\n if (Object.keys(bufferedResult.face[i].annotations).length !== Object.keys(newResult.face[i].annotations).length) {\n bufferedResult.face[i].annotations = newResult.face[i].annotations; // reset annotations as previous frame did not have them\n annotations = bufferedResult.face[i].annotations;\n } else if (newResult.face[i].annotations) {\n for (const key of Object.keys(newResult.face[i].annotations)) { // update annotations\n annotations[key] = newResult.face[i]?.annotations?.[key]?.[0]\n ? newResult.face[i].annotations[key]\n .map((val, j: number) => val\n .map((coord: number, k: number) => ((bufferedFactor - 1) * bufferedResult.face[i].annotations[key][j][k] + coord) / bufferedFactor))\n : null;\n }\n }\n if (newResult.face[i].rotation) {\n const rotation: {\n matrix: [number, number, number, number, number, number, number, number, number],\n angle: { roll: number, yaw: number, pitch: number },\n gaze: { bearing: number, strength: number }\n } = { matrix: [0, 0, 0, 0, 0, 0, 0, 0, 0], angle: { roll: 0, yaw: 0, pitch: 0 }, gaze: { bearing: 0, strength: 0 } };\n rotation.matrix = newResult.face[i].rotation?.matrix as [number, number, number, number, number, number, number, number, number];\n rotation.angle = {\n roll: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.roll || 0) + (newResult.face[i].rotation?.angle?.roll || 0)) / bufferedFactor,\n yaw: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.yaw || 0) + (newResult.face[i].rotation?.angle?.yaw || 0)) / bufferedFactor,\n pitch: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.pitch || 0) + (newResult.face[i].rotation?.angle?.pitch || 0)) / bufferedFactor,\n };\n rotation.gaze = {\n // not fully correct due projection on circle, also causes wrap-around draw on jump from negative to positive\n bearing: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze.bearing || 0) + (newResult.face[i].rotation?.gaze.bearing || 0)) / bufferedFactor,\n strength: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze.strength || 0) + (newResult.face[i].rotation?.gaze.strength || 0)) / bufferedFactor,\n };\n bufferedResult.face[i] = { ...newResult.face[i], rotation, box, boxRaw, annotations }; // shallow clone plus updated values\n } else {\n bufferedResult.face[i] = { ...newResult.face[i], box, boxRaw, annotations }; // shallow clone plus updated values\n }\n }\n }\n\n // interpolate object detection results\n if (!bufferedResult.object || (newResult.object.length !== bufferedResult.object.length)) {\n bufferedResult.object = JSON.parse(JSON.stringify(newResult.object)) as ObjectResult[]; // deep clone once\n } else {\n for (let i = 0; i < newResult.object.length; i++) {\n const box = (newResult.object[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.object[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n bufferedResult.object[i] = { ...newResult.object[i], box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate person results\n if (newResult.persons) {\n const newPersons = newResult.persons; // trigger getter function\n if (!bufferedResult.persons || (newPersons.length !== bufferedResult.persons.length)) {\n bufferedResult.persons = JSON.parse(JSON.stringify(newPersons)) as PersonResult[];\n } else {\n for (let i = 0; i < newPersons.length; i++) { // update person box, we don't update the rest as it's updated as reference anyhow\n bufferedResult.persons[i].box = (newPersons[i].box\n .map((box, j) => ((bufferedFactor - 1) * bufferedResult.persons[i].box[j] + box) / bufferedFactor)) as Box;\n }\n }\n }\n\n // copy latest gestures without interpolation\n if (newResult.gesture) bufferedResult.gesture = newResult.gesture;\n\n // copy resolution info\n bufferedResult.width = newResult.width;\n bufferedResult.height = newResult.height;\n\n // append interpolation performance data\n const t1 = now();\n interpolateTime = env.perfadd ? interpolateTime + Math.round(t1 - t0) : Math.round(t1 - t0);\n if (newResult.performance) bufferedResult.performance = { ...newResult.performance, interpolate: interpolateTime };\n\n return bufferedResult;\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**MediaPipe Meet**](https://drive.google.com/file/d/1lnP1bRi9CSqQQXUHa13159vLELYDgDu0/preview)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.segmentation.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model) model = await load(config);\n if (!model?.['executor'] || !model?.inputs?.[0].shape) return null; // something is wrong with the model\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [model.inputs[0].shape ? model.inputs[0].shape[1] : 0, model.inputs[0].shape ? model.inputs[0].shape[2] : 0], false);\n t.norm = tf.div(t.resize, constants.tf255);\n t.res = model.execute(t.norm) as Tensor;\n t.squeeze = tf.squeeze(t.res, [0]);\n // t.softmax = tf.softmax(t.squeeze); // model meet has two channels for fg and bg\n [t.bgRaw, t.fgRaw] = tf.unstack(t.squeeze, 2);\n // t.bg = tf.softmax(t.bgRaw); // we can ignore bg channel\n t.fg = tf.softmax(t.fgRaw);\n t.mul = tf.mul(t.fg, constants.tf255);\n t.expand = tf.expandDims(t.mul, 2);\n t.output = tf.image.resizeBilinear(t.expand as Tensor4D, [input.shape[1] || 0, input.shape[2] || 0]);\n let rgba: Tensor;\n switch (config.segmentation.mode || 'default') {\n case 'default':\n t.input = tf.squeeze(input);\n t.concat = tf.concat([t.input, t.output], -1);\n rgba = tf.cast(t.concat, 'int32'); // combined original with alpha\n break;\n case 'alpha':\n rgba = tf.cast(t.output, 'int32'); // just get alpha value from model\n break;\n default:\n rgba = tf.tensor(0);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return rgba;\n}\n", "/** Face descriptor type as number array */\nexport type Descriptor = number[]\nexport type MatchOptions = { order?: number, threshold?: number, multiplier?: number, min?: number, max?: number } | undefined;\n\n/** Calculates distance between two descriptors\n * @param options - calculation options\n * - order - algorithm to use\n * Euclidean distance if `order` is 2 (default), Minkowski distance algorithm of nth order if `order` is higher than 2\n * - multiplier - by how much to enhance difference analysis in range of 1..100\n * default is 20 which normalizes results to similarity above 0.5 can be considered a match\n */\nexport function distance(descriptor1: Descriptor, descriptor2: Descriptor, options: MatchOptions = { order: 2, multiplier: 25 }) {\n // general minkowski distance, euclidean distance is limited case where order is 2\n if (!descriptor1 || !descriptor1) return Number.MAX_SAFE_INTEGER;\n let sum = 0;\n for (let i = 0; i < descriptor1.length; i++) {\n const diff = (!options.order || options.order === 2) ? (descriptor1[i] - descriptor2[i]) : (Math.abs(descriptor1[i] - descriptor2[i]));\n sum += (!options.order || options.order === 2) ? (diff * diff) : (diff ** options.order);\n }\n return (options.multiplier || 20) * sum;\n}\n\n// invert distance to similarity, normalize to given range and clamp\nconst normalizeDistance = (dist, order, min, max) => {\n if (dist === 0) return 1; // short circuit for identical inputs\n const root = order === 2 ? Math.sqrt(dist) : dist ** (1 / order); // take root of distance\n const norm = (1 - (root / 100) - min) / (max - min); // normalize to range\n const clamp = Math.max(Math.min(norm, 1), 0); // clamp to 0..1\n return clamp;\n};\n\n/** Calculates normalized similarity between two face descriptors based on their `distance`\n * @param options - calculation options\n * - order - algorithm to use\n * Euclidean distance if `order` is 2 (default), Minkowski distance algorithm of nth order if `order` is higher than 2\n * - multiplier - by how much to enhance difference analysis in range of 1..100\n * default is 20 which normalizes results to similarity above 0.5 can be considered a match\n * - min - normalize similarity result to a given range\n * - max - normalzie similarity resutl to a given range\n * default is 0.2...0.8\n * Returns similarity between two face descriptors normalized to 0..1 range where 0 is no similarity and 1 is perfect similarity\n */\nexport function similarity(descriptor1: Descriptor, descriptor2: Descriptor, options: MatchOptions = { order: 2, multiplier: 25, min: 0.2, max: 0.8 }) {\n const dist = distance(descriptor1, descriptor2, options);\n return normalizeDistance(dist, options.order || 2, options.min || 0, options.max || 1);\n}\n\n/** Matches given descriptor to a closest entry in array of descriptors\n * @param descriptor - face descriptor\n * @param descriptors - array of face descriptors to commpare given descriptor to\n * @param options - see `similarity` method for options description\n * Returns\n * - `index` index array index where best match was found or -1 if no matches\n * - `distance` calculated `distance` of given descriptor to the best match\n * - `similarity` calculated normalized `similarity` of given descriptor to the best match\n*/\nexport function find(descriptor: Descriptor, descriptors: Descriptor[], options: MatchOptions = { order: 2, multiplier: 25, threshold: 0, min: 0.2, max: 0.8 }) {\n if (!Array.isArray(descriptor) || !Array.isArray(descriptors) || descriptor.length < 64 || descriptors.length === 0) { // validate input\n return { index: -1, distance: Number.POSITIVE_INFINITY, similarity: 0 };\n }\n let lowestDistance = Number.MAX_SAFE_INTEGER;\n let index = -1;\n for (let i = 0; i < descriptors.length; i++) {\n const res = descriptors[i].length === descriptor.length ? distance(descriptor, descriptors[i], options) : Number.MAX_SAFE_INTEGER;\n if (res < lowestDistance) {\n lowestDistance = res;\n index = i;\n }\n if (lowestDistance < (options.threshold || 0)) break;\n }\n const normalizedSimilarity = normalizeDistance(lowestDistance, options.order || 2, options.min || 0, options.max || 1);\n return { index, distance: lowestDistance, similarity: normalizedSimilarity };\n}\n", "/**\n * Loader and Validator for all models used by Human\n */\n\nimport { env } from './util/env';\nimport { log } from './util/util';\nimport * as antispoof from './face/antispoof';\nimport * as blazeface from './face/blazeface';\nimport * as blazepose from './body/blazepose';\nimport * as centernet from './object/centernet';\nimport * as efficientpose from './body/efficientpose';\nimport * as emotion from './gear/emotion';\nimport * as facemesh from './face/facemesh';\nimport * as faceres from './face/faceres';\nimport * as gear from './gear/gear';\nimport * as handpose from './hand/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as insightface from './face/insightface';\nimport * as iris from './face/iris';\nimport * as liveness from './face/liveness';\nimport * as meet from './segmentation/meet';\nimport * as mobilefacenet from './face/mobilefacenet';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as posenet from './body/posenet';\nimport * as rvm from './segmentation/rvm';\nimport * as selfie from './segmentation/selfie';\nimport * as ssrnetAge from './gear/ssrnet-age';\nimport * as ssrnetGender from './gear/ssrnet-gender';\nimport { modelStats, ModelInfo } from './tfjs/load';\nimport type { GraphModel } from './tfjs/types';\nimport type { Human } from './human';\n\nexport interface KernelOps { name: string, url: string, missing: string[], ops: string[] }\n\nexport function validateModel(instance: Human | null, model: GraphModel | null, name: string): KernelOps | null {\n if (!model) return null;\n if (!instance?.config?.validateModels) return null;\n const simpleOps = ['const', 'placeholder', 'noop', 'pad', 'squeeze', 'add', 'sub', 'mul', 'div'];\n const ignoreOps = ['biasadd', 'fusedbatchnormv3', 'matmul', 'switch', 'shape', 'merge', 'split', 'broadcastto'];\n const ops: string[] = [];\n const missing: string[] = [];\n interface Op { name: string, category: string, op: string }\n const url = model['modelUrl'] as string;\n const executor = model['executor'];\n if (executor?.graph?.nodes) {\n for (const kernel of Object.values(executor.graph.nodes)) {\n const op = (kernel as Op).op.toLowerCase();\n if (!ops.includes(op)) ops.push(op);\n }\n } else {\n if (!executor && instance.config.debug) {\n log('model not loaded', name);\n }\n }\n for (const op of ops) {\n if (!simpleOps.includes(op) // exclude simple ops\n && !ignoreOps.includes(op) // exclude specific ops\n && !instance.env.kernels.includes(op) // check actual kernel ops\n && !instance.env.kernels.includes(op.replace('_', '')) // check variation without _\n && !instance.env.kernels.includes(op.replace('native', '')) // check standard variation\n && !instance.env.kernels.includes(op.replace('v2', ''))) { // check non-versioned variation\n missing.push(op);\n }\n }\n if (instance.config.debug && missing.length > 0) log('model validation failed:', name, missing);\n return missing.length > 0 ? { name, missing, ops, url } : null;\n}\n\n/** structure that holds global stats for currently loaded models */\nexport interface ModelStats {\n numLoadedModels: number,\n numDefinedModels: number,\n percentageLoaded: number,\n totalSizeFromManifest: number,\n totalSizeWeights: number,\n totalSizeLoading: number,\n modelStats: ModelInfo[],\n}\n\n/** Models class used by Human\n * - models: record of all GraphModels\n * - list: returns list of configured models with their stats\n * - loaded: returns array of loaded models\n * - reset: unloads all models\n * - validate: checks loaded models for valid kernel ops vs current backend\n * - stats: live detailed model stats that can be checked during model load phase\n */\nexport class Models {\n private instance: Human;\n models: Record = {};\n\n constructor(currentInstance: Human) {\n this.models = {};\n this.instance = currentInstance;\n }\n\n stats(): ModelStats {\n let totalSizeFromManifest = 0;\n let totalSizeWeights = 0;\n let totalSizeLoading = 0;\n for (const m of Object.values(modelStats)) {\n totalSizeFromManifest += m.sizeFromManifest;\n totalSizeWeights += m.sizeLoadedWeights;\n totalSizeLoading += m.sizeDesired;\n }\n const percentageLoaded = totalSizeLoading > 0 ? totalSizeWeights / totalSizeLoading : 0;\n return {\n numLoadedModels: Object.values(modelStats).length,\n numDefinedModels: Object.keys(this.models).length,\n percentageLoaded,\n totalSizeFromManifest,\n totalSizeWeights,\n totalSizeLoading,\n modelStats: Object.values(modelStats),\n };\n }\n\n reset(): void {\n for (const model of Object.keys(this.models)) this.models[model] = null;\n }\n\n async load(instance?: Human): Promise {\n if (env.initial) this.reset();\n if (instance) this.instance = instance;\n const m: Record> = {};\n // face main models\n m.blazeface = (this.instance.config.face.enabled && !this.models.blazeface) ? blazeface.load(this.instance.config) : null;\n m.antispoof = (this.instance.config.face.enabled && this.instance.config.face.antispoof?.enabled && !this.models.antispoof) ? antispoof.load(this.instance.config) : null;\n m.liveness = (this.instance.config.face.enabled && this.instance.config.face.liveness?.enabled && !this.models.liveness) ? liveness.load(this.instance.config) : null;\n m.faceres = (this.instance.config.face.enabled && this.instance.config.face.description?.enabled && !this.models.faceres) ? faceres.load(this.instance.config) : null;\n m.emotion = (this.instance.config.face.enabled && this.instance.config.face.emotion?.enabled && !this.models.emotion) ? emotion.load(this.instance.config) : null;\n m.iris = (this.instance.config.face.enabled && this.instance.config.face.iris?.enabled && !this.instance.config.face.attention?.enabled && !this.models.iris) ? iris.load(this.instance.config) : null;\n m.facemesh = (this.instance.config.face.enabled && this.instance.config.face.mesh?.enabled && (!this.models.facemesh)) ? facemesh.load(this.instance.config) : null;\n // face alternatives\n m.gear = (this.instance.config.face.enabled && this.instance.config.face['gear']?.enabled && !this.models.gear) ? gear.load(this.instance.config) : null;\n m.ssrnetage = (this.instance.config.face.enabled && this.instance.config.face['ssrnet']?.enabled && !this.models.ssrnetage) ? ssrnetAge.load(this.instance.config) : null;\n m.ssrnetgender = (this.instance.config.face.enabled && this.instance.config.face['ssrnet']?.enabled && !this.models.ssrnetgender) ? ssrnetGender.load(this.instance.config) : null;\n m.mobilefacenet = (this.instance.config.face.enabled && this.instance.config.face['mobilefacenet']?.enabled && !this.models.mobilefacenet) ? mobilefacenet.load(this.instance.config) : null;\n m.insightface = (this.instance.config.face.enabled && this.instance.config.face['insightface']?.enabled && !this.models.insightface) ? insightface.load(this.instance.config) : null;\n // body alterinatives\n m.blazepose = (this.instance.config.body.enabled && !this.models.blazepose && this.instance.config.body.modelPath?.includes('blazepose')) ? blazepose.loadPose(this.instance.config) : null;\n m.blazeposedetect = (this.instance.config.body.enabled && !this.models.blazeposedetect && this.instance.config.body['detector'] && this.instance.config.body['detector'].modelPath) ? blazepose.loadDetect(this.instance.config) : null;\n m.efficientpose = (this.instance.config.body.enabled && !this.models.efficientpose && this.instance.config.body.modelPath?.includes('efficientpose')) ? efficientpose.load(this.instance.config) : null;\n m.movenet = (this.instance.config.body.enabled && !this.models.movenet && this.instance.config.body.modelPath?.includes('movenet')) ? movenet.load(this.instance.config) : null;\n m.posenet = (this.instance.config.body.enabled && !this.models.posenet && this.instance.config.body.modelPath?.includes('posenet')) ? posenet.load(this.instance.config) : null;\n // hand alternatives\n m.handtrack = (this.instance.config.hand.enabled && !this.models.handtrack && this.instance.config.hand.detector?.modelPath?.includes('handtrack')) ? handtrack.loadDetect(this.instance.config) : null;\n m.handskeleton = (this.instance.config.hand.enabled && this.instance.config.hand.landmarks && !this.models.handskeleton && this.instance.config.hand.detector?.modelPath?.includes('handtrack')) ? handtrack.loadSkeleton(this.instance.config) : null;\n // if (this.instance.config.hand.detector?.modelPath?.includes('handdetect')) [m.handpose, m.handskeleton] = (!this.models.handpose) ? await handpose.load(this.instance.config) : [null, null];\n if (this.instance.config.hand.enabled && !this.models.handdetect && this.instance.config.hand.detector?.modelPath?.includes('handdetect')) {\n m.handdetect = handpose.loadDetect(this.instance.config);\n m.handskeleton = handpose.loadSkeleton(this.instance.config);\n }\n // object detection alternatives\n m.centernet = (this.instance.config.object.enabled && !this.models.centernet && this.instance.config.object.modelPath?.includes('centernet')) ? centernet.load(this.instance.config) : null;\n m.nanodet = (this.instance.config.object.enabled && !this.models.nanodet && this.instance.config.object.modelPath?.includes('nanodet')) ? nanodet.load(this.instance.config) : null;\n // segmentation alternatives\n m.selfie = (this.instance.config.segmentation.enabled && !this.models.selfie && this.instance.config.segmentation.modelPath?.includes('selfie')) ? selfie.load(this.instance.config) : null;\n m.meet = (this.instance.config.segmentation.enabled && !this.models.meet && this.instance.config.segmentation.modelPath?.includes('meet')) ? meet.load(this.instance.config) : null;\n m.rvm = (this.instance.config.segmentation.enabled && !this.models.rvm && this.instance.config.segmentation.modelPath?.includes('rvm')) ? rvm.load(this.instance.config) : null;\n\n // models are loaded in parallel asynchronously so lets wait until they are actually loaded\n for (const [model, promise] of Object.entries(m)) {\n if (promise?.['then']) promise['then']((val) => this.models[model] = val);\n }\n await Promise.all(Object.values(m)); // wait so this function does not resolve prematurely\n }\n\n list() {\n const models = Object.keys(this.models).map((model) => ({ name: model, loaded: (this.models[model] !== null), size: 0, url: this.models[model] ? this.models[model]?.['modelUrl'] : null }));\n for (const m of models) {\n const stats = Object.keys(modelStats).find((s) => s.startsWith(m.name));\n if (!stats) continue;\n m.size = modelStats[stats].sizeLoadedWeights;\n m.url = modelStats[stats].url;\n }\n return models;\n }\n\n loaded() {\n const list = this.list();\n const loaded = list.filter((model) => model.loaded).map((model) => model.name);\n return loaded;\n }\n\n validate(): { name: string, missing: string[] }[] {\n const missing: KernelOps[] = [];\n for (const defined of Object.keys(this.models)) {\n const model: GraphModel | null = this.models[defined as keyof Models];\n if (!model) continue;\n const res = validateModel(this.instance, model, defined);\n if (res) missing.push(res);\n }\n return missing;\n }\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport type { BodyKeypoint, BodyResult } from '../result';\nimport * as box from '../util/box';\nimport * as coords from './movenetcoords';\nimport type { Tensor, Tensor3D } from '../tfjs/types';\n\nconst maxJitter = 0.005; // default allowed jitter is within 0.5%\n\nconst cache: {\n keypoints: BodyKeypoint[],\n padding: [number, number][];\n} = {\n keypoints: [],\n padding: [[0, 0], [0, 0], [0, 0], [0, 0]],\n};\n\nexport function bodyParts(body: BodyResult) { // model sometimes mixes up left vs right keypoints so we fix them\n for (const pair of coords.horizontal) { // fix body parts left vs right\n const left = body.keypoints.findIndex((kp) => kp.part === pair[0]);\n const right = body.keypoints.findIndex((kp) => kp.part === pair[1]);\n if (body.keypoints[left] && body.keypoints[right]) {\n if (body.keypoints[left].position[0] < body.keypoints[right].position[0]) {\n const tmp = body.keypoints[left];\n body.keypoints[left] = body.keypoints[right];\n body.keypoints[right] = tmp;\n }\n }\n }\n for (const pair of coords.vertical) { // remove body parts with improbable vertical position\n const lower = body.keypoints.findIndex((kp) => (kp && kp.part === pair[0]));\n const higher = body.keypoints.findIndex((kp) => (kp && kp.part === pair[1]));\n if (body.keypoints[lower] && body.keypoints[higher]) {\n if (body.keypoints[lower].position[1] < body.keypoints[higher].position[1]) {\n body.keypoints.splice(lower, 1);\n }\n }\n }\n for (const [pair, compare] of coords.relative) { // rearrange body parts according to their relative position\n const left = body.keypoints.findIndex((kp) => (kp && kp.part === pair[0]));\n const right = body.keypoints.findIndex((kp) => (kp && kp.part === pair[1]));\n const leftTo = body.keypoints.findIndex((kp) => (kp && kp.part === compare[0]));\n const rightTo = body.keypoints.findIndex((kp) => (kp && kp.part === compare[1]));\n if (!body.keypoints[leftTo] || !body.keypoints[rightTo]) continue; // only if we have both compare points\n const distanceLeft = body.keypoints[left] ? [\n Math.abs(body.keypoints[leftTo].position[0] - body.keypoints[left].position[0]),\n Math.abs(body.keypoints[rightTo].position[0] - body.keypoints[left].position[0]),\n ] : [0, 0];\n const distanceRight = body.keypoints[right] ? [\n Math.abs(body.keypoints[rightTo].position[0] - body.keypoints[right].position[0]),\n Math.abs(body.keypoints[leftTo].position[0] - body.keypoints[right].position[0]),\n ] : [0, 0];\n if (distanceLeft[0] > distanceLeft[1] || distanceRight[0] > distanceRight[1]) { // should flip keypoints\n const tmp = body.keypoints[left];\n body.keypoints[left] = body.keypoints[right];\n body.keypoints[right] = tmp;\n }\n }\n}\n\nexport function jitter(keypoints: BodyKeypoint[]): BodyKeypoint[] {\n for (let i = 0; i < keypoints.length; i++) {\n if (keypoints[i] && cache.keypoints[i]) {\n const diff = [Math.abs(keypoints[i].positionRaw[0] - cache.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache.keypoints[i].positionRaw[1])];\n if (diff[0] < maxJitter && diff[1] < maxJitter) {\n keypoints[i] = cache.keypoints[i]; // below jitter so replace keypoint\n } else {\n cache.keypoints[i] = keypoints[i]; // above jitter so update cache\n }\n } else {\n cache.keypoints[i] = keypoints[i]; // cache for keypoint doesnt exist so create it here\n }\n }\n return keypoints;\n}\n\nexport function padInput(input: Tensor, inputSize: number): Tensor {\n const t: Record = {};\n if (!input?.shape?.[1] || !input?.shape?.[2]) return input;\n cache.padding = [\n [0, 0], // dont touch batch\n [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], // height before&after\n [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], // width before&after\n [0, 0], // dont touch rbg\n ];\n t.pad = tf.pad(input, cache.padding);\n t.resize = tf.image.resizeBilinear(t.pad as Tensor3D, [inputSize, inputSize]);\n const final = tf.cast(t.resize, 'int32');\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return final;\n}\n\nexport function rescaleBody(body: BodyResult, outputSize: [number, number]): BodyResult {\n body.keypoints = body.keypoints.filter((kpt) => kpt?.position); // filter invalid keypoints\n for (const kpt of body.keypoints) {\n kpt.position = [\n kpt.position[0] * (outputSize[0] + cache.padding[2][0] + cache.padding[2][1]) / outputSize[0] - cache.padding[2][0],\n kpt.position[1] * (outputSize[1] + cache.padding[1][0] + cache.padding[1][1]) / outputSize[1] - cache.padding[1][0],\n ];\n kpt.positionRaw = [\n kpt.position[0] / outputSize[0], kpt.position[1] / outputSize[1],\n ];\n }\n const rescaledBoxes = box.calc(body.keypoints.map((pt) => pt.position), outputSize);\n body.box = rescaledBoxes.box;\n body.boxRaw = rescaledBoxes.boxRaw;\n return body;\n}\n", "/**\n * MoveNet model implementation\n *\n * Based on: [**MoveNet**](https://blog.tensorflow.org/2021/05/next-generation-pose-detection-with-movenet-and-tensorflowjs.html)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport * as box from '../util/box';\nimport * as coords from './movenetcoords';\nimport * as fix from './movenetfix';\nimport { loadModel } from '../tfjs/load';\nimport type { BodyKeypoint, BodyResult, BodyLandmark, BodyAnnotation, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { fakeOps } from '../tfjs/backend';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n// const boxExpandFact = 1.5; // increase to 150%\n\nconst cache: {\n boxes: Box[], // unused\n bodies: BodyResult[];\n last: number,\n} = {\n boxes: [],\n bodies: [],\n last: 0,\n};\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n fakeOps(['size'], config);\n model = await loadModel(config.body.modelPath);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = (model?.['executor'] && model?.inputs?.[0].shape) ? model.inputs[0].shape[2] : 0;\n if (inputSize < 64) inputSize = 256;\n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', false); // default=false \n return model;\n}\n\nfunction parseSinglePose(res, config, image) {\n const kpt = res[0][0];\n const keypoints: BodyKeypoint[] = [];\n let score = 0;\n for (let id = 0; id < kpt.length; id++) {\n score = kpt[id][2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [kpt[id][1], kpt[id][0]];\n keypoints.push({\n score: Math.round(100 * score) / 100,\n part: coords.kpt[id] as BodyLandmark,\n positionRaw,\n position: [ // normalized to input image size\n Math.round((image.shape[2] || 0) * positionRaw[0]),\n Math.round((image.shape[1] || 0) * positionRaw[1]),\n ],\n });\n }\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const bodies: BodyResult[] = [];\n const newBox = box.calc(keypoints.map((pt) => pt.position), [image.shape[2], image.shape[1]]);\n const annotations: Record = {};\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[i]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n const body: BodyResult = { id: 0, score, box: newBox.box, boxRaw: newBox.boxRaw, keypoints, annotations };\n fix.bodyParts(body);\n bodies.push(body);\n return bodies;\n}\n\nfunction parseMultiPose(res, config, image) {\n const bodies: BodyResult[] = [];\n for (let id = 0; id < res[0].length; id++) {\n const kpt = res[0][id];\n const boxScore = Math.round(100 * kpt[51 + 4]) / 100;\n if (boxScore > config.body.minConfidence) {\n const keypoints: BodyKeypoint[] = [];\n for (let i = 0; i < 17; i++) {\n const score = kpt[3 * i + 2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [kpt[3 * i + 1], kpt[3 * i + 0]];\n keypoints.push({\n part: coords.kpt[i] as BodyLandmark,\n score: Math.round(100 * score) / 100,\n positionRaw,\n position: [Math.round((image.shape[2] || 0) * positionRaw[0]), Math.round((image.shape[1] || 0) * positionRaw[1])],\n });\n }\n }\n // const newBox = box.calc(keypoints.map((pt) => pt.position), [image.shape[2], image.shape[1]]);\n // movenet-multipose has built-in box details\n const boxRaw: Box = [kpt[51 + 1], kpt[51 + 0], kpt[51 + 3] - kpt[51 + 1], kpt[51 + 2] - kpt[51 + 0]];\n const boxNorm: Box = [Math.trunc(boxRaw[0] * (image.shape[2] || 0)), Math.trunc(boxRaw[1] * (image.shape[1] || 0)), Math.trunc(boxRaw[2] * (image.shape[2] || 0)), Math.trunc(boxRaw[3] * (image.shape[1] || 0))];\n const annotations: Record = {} as Record;\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[i]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n // const body: BodyResult = { id, score: totalScore, box: newBox.box, boxRaw: newBox.boxRaw, keypoints: [...keypoints], annotations };\n const body: BodyResult = { id, score: boxScore, box: boxNorm, boxRaw, keypoints: [...keypoints], annotations };\n fix.bodyParts(body);\n bodies.push(body);\n }\n }\n bodies.sort((a, b) => b.score - a.score);\n if (bodies.length > config.body.maxDetected) bodies.length = config.body.maxDetected;\n return bodies;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!model?.['executor'] || !model?.inputs?.[0].shape) return []; // something is wrong with the model\n if (!config.skipAllowed) cache.boxes.length = 0; // allowed to use cache or not\n skipped++; // increment skip frames\n const skipTime = (config.body.skipTime || 0) > (now() - cache.last);\n const skipFrame = skipped < (config.body.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame) {\n return cache.bodies; // return cached results without running anything\n }\n return new Promise(async (resolve) => {\n const t: Record = {};\n skipped = 0;\n // run detection on squared input and no cached boxes\n t.input = fix.padInput(input, inputSize);\n t.res = model?.execute(t.input) as Tensor;\n cache.last = now();\n const res = await t.res.array();\n cache.bodies = (t.res.shape[2] === 17)\n ? parseSinglePose(res, config, input)\n : parseMultiPose(res, config, input);\n for (const body of cache.bodies) {\n fix.rescaleBody(body, [input.shape[2] || 1, input.shape[1] || 1]);\n fix.jitter(body.keypoints);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n\n resolve(cache.bodies);\n });\n}\n", "/**\n * NanoDet object detection model implementation\n *\n * Based on: [**NanoDet**](https://github.com/RangiLyu/nanodet)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport { labels } from './labels';\nimport type { ObjectResult, ObjectType, Box } from '../result';\nimport type { GraphModel, Tensor, Tensor2D, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\nlet last: ObjectResult[] = [];\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet inputSize = 0;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await loadModel(config.object.modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 416;\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nasync function process(res: Tensor[], outputShape: [number, number], config: Config) {\n let id = 0;\n let results: ObjectResult[] = [];\n const size = inputSize;\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 const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = tf.squeeze(res.find((a) => (a.shape[1] === (baseSize ** 2) && (a.shape[2] || 0) === labels.length)) as Tensor2D);\n const scores = await scoresT.array(); // optionally use exponential scores or just as-is\n const featuresT = tf.squeeze(res.find((a) => (a.shape[1] === (baseSize ** 2) && (a.shape[2] || 0) < labels.length)) as Tensor2D);\n const boxesMaxT = tf.reshape(featuresT, [-1, 4, (featuresT.shape?.[1] || 0) / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdxT = tf.argMax(boxesMaxT, 2); // what we need is indexes of features with highest scores, not values itself\n const boxIdx = await boxIdxT.array(); // what we need is indexes of features with highest scores, not values itself\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < (scoresT.shape?.[1] || 0); j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > (config.object.minConfidence || 0) && 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: number) => a * (baseSize / strideSize / (size))); // 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: Box = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))) as Box; // 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 as ObjectType,\n // center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n // centerRaw: [cx, cy],\n box: box.map((a) => Math.trunc(a)) as Box,\n boxRaw,\n };\n results.push(result);\n }\n }\n }\n tf.dispose([scoresT, featuresT, boxesMaxT, boxIdxT]);\n }\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[1], a.boxRaw[0], a.boxRaw[3], a.boxRaw[2]]); // switches coordinates from x,y to y,x as expected by tf.nms\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: number[] = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected || 0, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = Array.from(await nms.data());\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((_val, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image: Tensor4D, config: Config): Promise {\n if (!model?.['executor']) return [];\n const skipTime = (config.object.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.object.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n if (!env.kernels.includes('mod') || !env.kernels.includes('sparsetodense')) return last;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2] || 0, image.shape[1] || 0];\n const resizeT = tf.image.resizeBilinear(image, [inputSize, inputSize], false);\n const normT = tf.div(resizeT, constants.tf255);\n const transposeT = tf.transpose(normT, [0, 3, 1, 2]);\n\n let objectT;\n if (config.object.enabled) objectT = model.execute(transposeT);\n lastTime = now();\n\n const obj = await process(objectT as Tensor[], outputSize as [number, number], config);\n last = obj;\n tf.dispose([resizeT, normT, transposeT, ...objectT]);\n resolve(obj);\n });\n}\n", "/**\n * PoseNet body detection model implementation constants\n * See `posenet.ts` for entry point\n */\n\nimport type { Point, BodyResult, BodyAnnotation, BodyLandmark } from '../result';\n\nexport 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\nexport function eitherPointDoesntMeetConfidence(a: number, b: number, minConfidence: number) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence: number) {\n return 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): [number, number, number, number] {\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]): BodyResult[] {\n const scaleY = height / inputResolutionHeight;\n const scaleX = width / inputResolutionWidth;\n const scalePose = (pose, i): BodyResult => ({\n id: i,\n score: pose.score,\n boxRaw: [pose.box[0] / inputResolutionWidth, pose.box[1] / inputResolutionHeight, pose.box[2] / inputResolutionWidth, pose.box[3] / inputResolutionHeight],\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: score as number,\n part: part as BodyLandmark,\n position: [Math.trunc(position.x * scaleX), Math.trunc(position.y * scaleY)] as Point,\n positionRaw: [position.x / inputResolutionHeight, position.y / inputResolutionHeight] as Point,\n })),\n annotations: {} as Record,\n });\n const scaledPoses = poses.map((pose, i) => scalePose(pose, i));\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: unknown[]; // don't touch\n numberOfElements: number;\n getElementValue: unknown; // function call\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 // @ts-ignore getter is of unknown type\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: number, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + count),\n };\n}\n\nexport function getImageCoords(part, outputStride: number, 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: { x: number, y: number }, b: { x: number, y: number }) {\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", "/**\n * PoseNet body detection model implementation\n *\n * Based on: [**PoseNet**](https://medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { BodyResult, BodyLandmark, Box } from '../result';\nimport type { Tensor, GraphModel, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as utils from './posenetutils';\n\nlet model: GraphModel;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\nconst localMaximumRadius = 1;\nconst outputStride = 16;\nconst squaredNmsRadius = 50 ** 2;\n\nfunction traverse(edgeId: number, sourceKeypoint, targetId, scores, offsets, 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] = scores.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, targetId, offsets);\n targetKeypoint = utils.addVectors(\n { x: targetKeypointIndices.x * outputStride, y: targetKeypointIndices.y * outputStride },\n { x: offsetPoint.x, y: offsetPoint.y },\n );\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scores.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetId);\n return { position: targetKeypoint, part: utils.partNames[targetId], score };\n}\n\nexport function decodePose(root, scores, offsets, displacementsFwd, displacementsBwd) {\n const tuples = utils.poseChain.map(([parentJoinName, childJoinName]) => ([utils.partIds[parentJoinName], utils.partIds[childJoinName]]));\n const edgesFwd = tuples.map(([, childJointId]) => childJointId);\n const edgesBwd = tuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2]; // [21,21,17]\n const numEdges = edgesFwd.length;\n const keypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const rootPoint = utils.getImageCoords(root.part, outputStride, offsets);\n keypoints[root.part.id] = {\n score: root.score,\n part: utils.partNames[root.part.id] as BodyLandmark,\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 sourceId = edgesFwd[edge];\n const targetId = edgesBwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, 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 sourceId = edgesBwd[edge];\n const targetId = edgesFwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsFwd);\n }\n }\n return keypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score: number, heatmapY: number, heatmapX: number, scores) {\n const [height, width]: [number, number] = 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 if (!correspondingKeypoint) return false;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, keypoints) {\n const notOverlappedKeypointScores = keypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / keypoints.length;\n}\n\nexport function decode(offsets, scores, displacementsFwd, displacementsBwd, maxDetected, minConfidence) {\n const poses: { keypoints, box: Box, score: number }[] = [];\n const queue = buildPartWithScoreQueue(minConfidence, scores);\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 // @ts-ignore this one is tree walk\n const rootImageCoords = utils.getImageCoords(root.part, outputStride, offsets);\n // @ts-ignore this one is tree walk\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n let keypoints = decodePose(root, scores, offsets, displacementsFwd, displacementsBwd);\n keypoints = keypoints.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\nexport async function predict(input: Tensor4D, config: Config): Promise {\n /** posenet is mostly obsolete\n * caching is not implemented\n */\n if (!model?.['executor']) return [];\n const res = tf.tidy(() => {\n if (!model.inputs[0].shape) return [];\n const resized = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = tf.sub(tf.div(tf.cast(resized, 'float32'), 127.5), 1.0);\n const results: Tensor[] = model.execute(normalized, poseNetOutputs) as Tensor[];\n const results3d = results.map((y) => tf.squeeze(y, [0]));\n results3d[1] = tf.sigmoid(results3d[1]); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor: Tensor) => tensor.buffer()));\n for (const t of res) tf.dispose(t);\n\n const decoded = decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n if (!model.inputs[0].shape) return [];\n const scaled = utils.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n return scaled;\n}\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.body.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**Robust Video Matting**](https://github.com/PeterL1n/RobustVideoMatting)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\n\n// internal state varaibles\nconst outputNodes = ['fgr', 'pha', 'r1o', 'r2o', 'r3o', 'r4o'];\nconst t: Record = {}; // contains input tensor and recurrent states\nlet ratio = 0;\n\nfunction init(config: Config) {\n tf.dispose([t.r1i, t.r2i, t.r3i, t.r4i, t.downsample_ratio]);\n t.r1i = tf.tensor(0.0);\n t.r2i = tf.tensor(0.0);\n t.r3i = tf.tensor(0.0);\n t.r4i = tf.tensor(0.0);\n ratio = config.segmentation.ratio || 0.5;\n t.downsample_ratio = tf.tensor(ratio); // initialize downsample ratio\n}\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.segmentation.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n init(config);\n return model;\n}\n\nconst normalize = (r: Tensor): Tensor => tf.tidy(() => {\n const squeeze = tf.squeeze(r, ([0]));\n const mul = tf.mul(squeeze, constants.tf255);\n const cast = tf.cast(mul, 'int32');\n return cast;\n});\n\nfunction getRGBA(fgr: Tensor | null, pha: Tensor | null): Tensor { // gets rgba // either fgr or pha must be present\n const rgb = fgr\n ? normalize(fgr) // normalize and use value\n : tf.fill([pha!.shape[1] || 0, pha!.shape[2] || 0, 3], 255, 'int32'); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n const a = pha\n ? normalize(pha) // normalize and use value\n : tf.fill([fgr!.shape[1] || 0, fgr!.shape[2] || 0, 1], 255, 'int32'); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n const rgba = tf.concat([rgb, a], -1);\n tf.dispose([rgb, a]);\n return rgba;\n}\n\nfunction getState(state: Tensor): Tensor { // gets internal recurrent states\n return tf.tidy(() => {\n const r: Record = {};\n r.unstack = tf.unstack(state, -1);\n r.concat = tf.concat(r.unstack, 1);\n r.split = tf.split(r.concat, 4, 1);\n r.stack = tf.concat(r.split, 2);\n r.squeeze = tf.squeeze(r.stack, [0]);\n r.expand = tf.expandDims(r.squeeze, -1);\n r.add = tf.add(r.expand, 1);\n r.mul = tf.mul(r.add, 127.5);\n r.cast = tf.cast(r.mul, 'int32');\n r.tile = tf.tile(r.cast, [1, 1, 3]);\n r.alpha = tf.fill([(r.tile as Tensor).shape[0] || 0, (r.tile as Tensor).shape[1] || 0, 1], 255, 'int32'); // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion\n return tf.concat([r.tile, r.alpha], -1);\n });\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model) model = await load(config);\n if (!model?.['executor']) return null;\n // const expand = tf.expandDims(input, 0);\n t.src = tf.div(input, 255);\n if (ratio !== config.segmentation.ratio) init(config); // reinitialize recurrent states if requested downsample ratio changed\n const [fgr, pha, r1o, r2o, r3o, r4o] = await model.executeAsync(t, outputNodes) as Tensor[]; // execute model\n let rgba: Tensor;\n switch (config.segmentation.mode || 'default') {\n case 'default':\n rgba = getRGBA(fgr, pha);\n break;\n case 'alpha':\n rgba = getRGBA(null, pha);\n break;\n case 'foreground':\n rgba = getRGBA(fgr, null);\n break;\n case 'state':\n rgba = getState(r1o); // can view any internal recurrent state r10, r20, r3o, r4o\n break;\n default:\n rgba = tf.tensor(0);\n }\n tf.dispose([t.src, fgr, pha, t.r1i, t.r2i, t.r3i, t.r4i]);\n [t.r1i, t.r2i, t.r3i, t.r4i] = [r1o, r2o, r3o, r4o]; // update recurrent states\n return rgba;\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**MediaPipe Selfie**](https://drive.google.com/file/d/1dCfozqknMa068vVsO2j_1FgZkW_e3VWv/preview)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.segmentation.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model) model = await load(config);\n if (!model?.['executor'] || !model?.inputs?.[0].shape) return null; // something is wrong with the model\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [model.inputs[0].shape ? model.inputs[0].shape[1] : 0, model.inputs[0].shape ? model.inputs[0].shape[2] : 0], false);\n t.norm = tf.div(t.resize, constants.tf255);\n t.res = model.execute(t.norm) as Tensor;\n t.squeeze = tf.squeeze(t.res, [0]); // meet.shape:[1,256,256,1], selfie.shape:[1,144,256,2]\n t.alpha = tf.image.resizeBilinear(t.squeeze as Tensor4D, [input.shape[1] || 0, input.shape[2] || 0]); // model selfie has a single channel that we can use directly\n t.mul = tf.mul(t.alpha, constants.tf255);\n let rgba: Tensor;\n switch (config.segmentation.mode || 'default') {\n case 'default':\n t.input = tf.squeeze(input);\n t.concat = tf.concat([t.input, t.mul], -1);\n rgba = tf.cast(t.concat, 'int32'); // combined original with alpha\n break;\n case 'alpha':\n rgba = tf.cast(t.mul, 'int32'); // just get alpha value from model\n break;\n default:\n rgba = tf.tensor(0);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return rgba;\n}\n", "/**\n * Analyze detection Results and sort&combine them into per-person view\n */\n\nimport type { FaceResult, BodyResult, HandResult, GestureResult, PersonResult, Box } from '../result';\n\nexport function join(faces: FaceResult[], bodies: BodyResult[], hands: HandResult[], gestures: GestureResult[], shape: number[] | undefined): PersonResult[] {\n let id = 0;\n const persons: PersonResult[] = [];\n for (const face of faces) { // person is defined primarily by face and then we append other objects as found\n const person: PersonResult = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };\n for (const body of bodies) {\n if (face.box[0] > body.box[0] // x within body\n && face.box[0] < body.box[0] + body.box[2]\n && face.box[1] + face.box[3] > body.box[1] // y within body\n && face.box[1] + face.box[3] < body.box[1] + body.box[3]) {\n person.body = body;\n }\n }\n if (person.body) { // only try to join hands if body is found\n for (const hand of hands) {\n if (hand.box[0] + hand.box[2] > person.body.box[0] // x within body for left hand\n && hand.box[0] + hand.box[2] < person.body.box[0] + person.body.box[2]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for left hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.left = hand;\n }\n if (hand.box[0] < person.body.box[0] + person.body.box[2] // x within body for right hand\n && hand.box[0] > person.body.box[0]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for right hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.right = hand;\n }\n }\n }\n for (const gesture of gestures) { // append all gestures according to ids\n if (gesture['face'] !== undefined && gesture['face'] === face.id) person.gestures.push(gesture);\n else if (gesture['iris'] !== undefined && gesture['iris'] === face.id) person.gestures.push(gesture);\n else if (gesture['body'] !== undefined && gesture['body'] === person.body?.id) person.gestures.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands.left?.id) person.gestures.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands.right?.id) person.gestures.push(gesture);\n }\n\n // create new overarching box from all boxes belonging to person\n const x: number[] = [];\n const y: number[] = [];\n const extractXY = (box: Box | undefined) => { // extract all [x, y] coordinates from boxes [x, y, width, height]\n if (box && box.length === 4) {\n x.push(box[0], box[0] + box[2]);\n y.push(box[1], box[1] + box[3]);\n }\n };\n extractXY(person.face.box);\n extractXY(person.body?.box);\n extractXY(person.hands.left?.box);\n extractXY(person.hands.right?.box);\n const minX = Math.min(...x);\n const minY = Math.min(...y);\n person.box = [minX, minY, Math.max(...x) - minX, Math.max(...y) - minY]; // create new overarching box\n\n // shape is known so we calculate boxRaw as well\n if (shape?.[1] && shape?.[2]) person.boxRaw = [person.box[0] / shape[2], person.box[1] / shape[1], person.box[2] / shape[2], person.box[3] / shape[1]];\n\n persons.push(person);\n }\n return persons;\n}\n", "/**\n * Embedded sample images used during warmup in dataURL format\n */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NwZ7\npiVe6YkFsSziVMWZRILolMSriWUSCyJTuwhMSDMRCQSI3SAlACRCQAAEoAEoASAAAAAAAAACUACR\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", "/**\n * Warmup algorithm that uses embedded images to exercise loaded models for faster future inference\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now, mergeDeep } from './util/util';\nimport * as sample from './sample';\nimport * as image from './image/image';\nimport * as backend from './tfjs/backend';\nimport { env } from './util/env';\nimport { empty, Result } from './result';\nimport type { Config } from './config';\nimport type { Human } from './human';\nimport type { Tensor, DataType } from './tfjs/types';\n\nasync function warmupBitmap(instance: Human): Promise {\n const b64toBlob = (base64: string, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob: Blob | null;\n let res: Result | undefined;\n switch (instance.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'body':\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 instance.detect(bitmap, instance.config);\n bitmap.close();\n }\n return res;\n}\n\nasync function warmupCanvas(instance: Human): Promise {\n return new Promise((resolve) => {\n let src: string;\n // let size = 0;\n switch (instance.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 = '';\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n let img: HTMLImageElement;\n if (typeof Image !== 'undefined') img = new Image();\n // @ts-ignore env.image is an external monkey-patch\n else if (env.Image) img = new env.Image();\n else {\n resolve(undefined);\n return;\n }\n img.onload = async () => {\n const canvas = image.canvas(img.naturalWidth, img.naturalHeight);\n if (!canvas) {\n log('Warmup: Canvas not found');\n resolve(undefined);\n } else {\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n if (ctx) ctx.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const tensor = await instance.image(canvas, true);\n const res = tensor.tensor ? await instance.detect(tensor.tensor, instance.config) : undefined;\n resolve(res);\n }\n };\n if (src) img.src = src;\n else resolve(undefined);\n });\n}\n\nasync function warmupNode(instance: Human): Promise {\n const atob = (str: string) => Buffer.from(str, 'base64');\n let img;\n if (instance.config.warmup === 'face') img = atob(sample.face);\n else img = atob(sample.body);\n let res: Result;\n if (('node' in tf) && (tf.getBackend() === 'tensorflow')) {\n // @ts-ignore\n const data: Tensor = tf['node'].decodeJpeg(img); // eslint-disable-line import/namespace\n const expanded: Tensor = tf.expandDims(data, 0);\n instance.tf.dispose(data);\n // log('Input:', expanded);\n res = await instance.detect(expanded, instance.config);\n instance.tf.dispose(expanded);\n } else {\n if (instance.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 instance.detect(input, instance.config);\n */\n }\n // @ts-ignore\n return res;\n}\n\nasync function runInference(instance: Human) {\n let res: Result | undefined;\n if (typeof createImageBitmap === 'function') res = await warmupBitmap(instance);\n else if ((typeof Image !== 'undefined') || (env.Canvas !== undefined)) res = await warmupCanvas(instance);\n else res = await warmupNode(instance);\n return res;\n}\n\n/** Runs pre-compile on all loaded models */\nexport async function runCompile(instance: Human) {\n // @ts-ignore private property\n if (!tf.env().flagRegistry.ENGINE_COMPILE_ONLY) return; // tfjs does not support compile-only inference\n const backendType = tf.getBackend();\n const webGLBackend = tf.backend();\n if ((backendType !== 'webgl' && backendType !== 'humangl') || !webGLBackend?.['checkCompileCompletion']) {\n // log('compile pass: skip');\n return;\n }\n tf.env().set('ENGINE_COMPILE_ONLY', true);\n const numTensorsStart = tf.engine().state.numTensors;\n const compiledModels: string[] = [];\n for (const [modelName, model] of Object.entries(instance.models.models)) {\n if (!model) continue;\n const shape = (model?.modelSignature && model?.inputs?.[0]?.shape) ? [...model.inputs[0].shape] : [1, 64, 64, 3];\n const dtype: DataType = (model?.modelSignature && model?.inputs?.[0]?.dtype) ? model.inputs[0].dtype : 'float32';\n for (let dim = 0; dim < shape.length; dim++) {\n if (shape[dim] === -1) shape[dim] = dim === 0 ? 1 : 64; // override batch number and any dynamic dimensions\n }\n const tensor = tf.zeros(shape, dtype);\n try {\n const res = model.execute(tensor);\n compiledModels.push(modelName);\n if (Array.isArray(res)) res.forEach((t) => tf.dispose(t));\n else tf.dispose(res);\n } catch {\n if (instance.config.debug) log('compile fail model:', modelName);\n }\n tf.dispose(tensor);\n }\n const kernels = await webGLBackend['checkCompileCompletionAsync']();\n webGLBackend['getUniformLocations']();\n if (instance.config.debug) log('compile pass:', { models: compiledModels, kernels: kernels.length });\n tf.env().set('ENGINE_COMPILE_ONLY', false);\n const numTensorsEnd = tf.engine().state.numTensors;\n if ((numTensorsEnd - numTensorsStart) > 0) log('tensor leak:', numTensorsEnd - numTensorsStart);\n}\n\n/** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used in browser environments for `webgl` and `humangl` backends\n * @param userConfig?: Config\n*/\nexport async function warmup(instance: Human, userConfig?: Partial): Promise {\n await backend.check(instance, false);\n const t0 = now();\n instance.state = 'warmup';\n if (userConfig) instance.config = mergeDeep(instance.config, userConfig) as Config;\n if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === 'none') {\n return empty();\n }\n return new Promise(async (resolve) => {\n await instance.models.load();\n await runCompile(instance);\n const res = await runInference(instance);\n const t1 = now();\n if (instance.config.debug) log('warmup', instance.config.warmup, Math.round(t1 - t0), 'ms');\n instance.emit('warmup');\n resolve(res);\n });\n}\n", "/**\n * Human main module\n * @default Human Library\n * @summary \n * @author \n * @copyright \n * @license MIT\n */\n\n// module imports\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now, mergeDeep, validate } from './util/util';\nimport { defaults } from './config';\nimport { env, Env } from './util/env';\nimport { WebCam } from './util/webcam';\nimport { setModelLoadOptions } from './tfjs/load';\nimport * as app from '../package.json';\nimport * as backend from './tfjs/backend';\nimport * as draw from './draw/draw';\nimport * as blazepose from './body/blazepose';\nimport * as centernet from './object/centernet';\nimport * as efficientpose from './body/efficientpose';\nimport * as face from './face/face';\nimport * as facemesh from './face/facemesh';\nimport * as gesture from './gesture/gesture';\nimport * as handpose from './hand/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as image from './image/image';\nimport * as interpolate from './util/interpolate';\nimport * as meet from './segmentation/meet';\nimport * as match from './face/match';\nimport * as models from './models';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as persons from './util/persons';\nimport * as posenet from './body/posenet';\nimport * as rvm from './segmentation/rvm';\nimport * as selfie from './segmentation/selfie';\nimport * as warmups from './warmup';\n\n// type definitions\nimport { Input, Config, Result, FaceResult, HandResult, BodyResult, ObjectResult, GestureResult, AnyCanvas, empty } from './exports';\nimport type { Tensor, Tensor4D } from './tfjs/types';\n// type exports\nexport * from './exports';\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 *\n * @param userConfig - {@link Config}\n * @returns instance of {@link Human}\n */\nexport class Human {\n /** Current version of Human library in *semver* format */\n version: string;\n\n /** Current configuration\n * - Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L262)\n */\n config: Config;\n\n /** Last known result of detect run\n * - Can be accessed anytime after initial detection\n */\n result: Result;\n\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n * - Progresses through: 'config', 'check', 'backend', 'load', 'run:', 'idle'\n */\n state: string;\n\n /** currenty processed image tensor and canvas */\n process: { tensor: Tensor | null, canvas: AnyCanvas | null };\n\n /** Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n * [TFJS API](https://js.tensorflow.org/api/latest/)\n */\n tf;\n\n /** Object containing environment information used for diagnostics */\n env: Env = env;\n\n /** Draw helper classes that can draw detected objects on canvas using specified draw\n * - canvas: draws input to canvas\n * - options: are global settings for all draw operations, can be overriden for each draw method {@link DrawOptions}\n * - face, body, hand, gesture, object, person: draws detected results as overlays on canvas\n */\n // draw: { canvas: typeof draw.canvas, face: typeof draw.face, body: typeof draw.body, hand: typeof draw.hand, gesture: typeof draw.gesture, object: typeof draw.object, person: typeof draw.person, all: typeof draw.all, options: DrawOptions };\n draw: typeof draw = draw;\n\n /** Face Matching\n * - similarity: compare two face descriptors and return similarity index\n * - distance: compare two face descriptors and return raw calculated differences\n * - find: compare face descriptor to array of face descriptors and return best match\n */\n match: typeof match = match;\n\n /** Currently loaded models\n * @internal\n * {@link models#Models}\n */\n models: models.Models;\n\n /** Container for events dispatched by Human\n * Possible events:\n * - `create`: triggered when Human object is instantiated\n * - `load`: triggered when models are loaded (explicitly or on-demand)\n * - `image`: triggered when input image is processed\n * - `result`: triggered when detection is complete\n * - `warmup`: triggered when warmup is complete\n * - `error`: triggered on some errors\n */\n events: EventTarget | undefined;\n /** Reference face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: number[];\n /** Refernce UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: [number, number][];\n /** Performance object that contains values for all recently performed operations */\n performance: Record; // perf members are dynamically defined as needed\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n // definition end\n\n /** Constructor for **Human** library that is futher used for all operations\n * @param userConfig - user configuration object {@link Config}\n */\n constructor(userConfig?: Partial) {\n /*\n defaults.wasmPath = tf.version['tfjs-core'].includes('-') // custom build or official build\n ? 'https://vladmandic.github.io/tfjs/dist/'\n : `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf.version_core}/dist/`;\n */\n const tfVersion = (tf.version.tfjs || tf.version_core).replace(/-(.*)/, '');\n defaults.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tfVersion}/dist/`;\n defaults.modelBasePath = env.browser ? '../models/' : 'file://models/';\n this.version = app.version; // expose version property on instance of class\n Object.defineProperty(this, 'version', { value: app.version }); // expose version property directly on class itself\n this.config = JSON.parse(JSON.stringify(defaults));\n Object.seal(this.config);\n this.config.cacheModels = typeof indexedDB !== 'undefined';\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n setModelLoadOptions(this.config);\n this.tf = tf;\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.performance = {};\n this.events = (typeof EventTarget !== 'undefined') ? new EventTarget() : undefined;\n // object that contains all initialized models\n this.models = new models.Models(this);\n // reexport draw methods\n draw.init();\n this.result = empty();\n // export access to image processing\n this.process = { tensor: null, canvas: null };\n // export raw access to underlying models\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // init model validation\n models.validateModel(this, null, '');\n // include platform info\n this.emit('create');\n if (this.config.debug || this.env.browser) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version['tfjs-core']}`);\n const envTemp = JSON.parse(JSON.stringify(this.env));\n delete envTemp.kernels;\n delete envTemp.initial;\n delete envTemp.perfadd;\n if (this.config.debug) log('environment:', envTemp);\n }\n\n /** internal function to measure tensor leaks */\n analyze = (...msg: string[]) => {\n if (!this.#analyzeMemoryLeaks) return;\n const currentTensors = this.tf.engine().state.numTensors;\n const previousTensors = this.#numTensors;\n this.#numTensors = currentTensors;\n const leaked = currentTensors - previousTensors;\n if (leaked !== 0) log(...msg, leaked);\n };\n\n /** internal function for quick sanity check on inputs @hidden */\n #sanity = (input: Input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.env.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 /** Reset configuration to default values */\n reset(): void {\n const currentBackend = this.config.backend; // save backend;\n this.config = JSON.parse(JSON.stringify(defaults));\n this.config.backend = currentBackend;\n image.reset();\n env.initial = true;\n }\n\n /** Validate current configuration schema */\n validate(userConfig?: Partial) {\n const msgs = validate(defaults, userConfig || this.config);\n if (msgs.length === 0) this.config = mergeDeep(this.config, userConfig) as Config;\n return msgs;\n }\n\n /** Utility wrapper for performance.now() */\n now(): number { // eslint-disable-line class-methods-use-this\n return now();\n }\n\n /** Process input as return canvas and tensor\n *\n * @param input - any input {@link Input}\n * @param getTensor - should image processing also return tensor or just canvas\n * Returns object with `tensor` and `canvas`\n */\n image(input: Input, getTensor: boolean = false) {\n return image.process(input, this.config, getTensor);\n }\n\n /** Segmentation method takes any input and returns RGBA tensor\n * Note: Segmentation is not triggered as part of detect process\n *\n * @param input - {@link Input}\n * Returns tensor which contains image data in RGBA format\n */\n async segmentation(input: Input, userConfig?: Partial): Promise {\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n if (!this.config.segmentation.enabled) return null;\n const processed = await image.process(input, this.config);\n if (!processed.tensor) return null;\n let tensor: Tensor | null = null;\n if (this.config.segmentation.modelPath?.includes('rvm')) tensor = await rvm.predict(processed.tensor, this.config);\n if (this.config.segmentation.modelPath?.includes('meet')) tensor = await meet.predict(processed.tensor, this.config);\n if (this.config.segmentation.modelPath?.includes('selfie')) tensor = await selfie.predict(processed.tensor, this.config);\n tf.dispose(processed.tensor);\n return tensor;\n }\n\n /** Compare two input tensors for pixel similarity\n * - use `human.image` to process any valid input and get a tensor that can be used for compare\n * - when passing manually generated tensors:\n * - both input tensors must be in format [1, height, width, 3]\n * - if resolution of tensors does not match, second tensor will be resized to match resolution of the first tensor\n * - return value is pixel similarity score normalized by input resolution and rgb channels\n */\n compare(firstImageTensor: Tensor, secondImageTensor: Tensor): Promise {\n return image.compare(this.config, firstImageTensor, secondImageTensor);\n }\n\n /** Explicit backend initialization\n * - Normally done implicitly during initial load phase\n * - Call to explictly register and initialize TFJS backend without any other operations\n * - Use when changing backend during runtime\n */\n async init(): Promise {\n await backend.check(this, true);\n await this.tf.ready();\n image.reset();\n }\n\n /** WebCam helper methods\n *\n */\n public webcam = new WebCam();\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 * @param userConfig - {@link Config}\n */\n async load(userConfig?: Partial): Promise {\n this.state = 'load';\n const timeStamp = now();\n const count = Object.values(this.models.models).filter((model) => model).length;\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n if (this.env.initial) { // print version info on first run and check for correct backend setup\n if (!await backend.check(this, false)) log('error: backend check failed');\n await tf.ready();\n if (this.env.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\n await this.models.load(this); // actually loads models\n if (this.env.initial && this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors'); // print memory stats on first run\n this.env.initial = false;\n\n const loaded = Object.values(this.models.models).filter((model) => model).length;\n if (loaded !== count) { // number of loaded models changed\n this.models.validate(); // validate kernel ops used by model against current backend\n this.emit('load');\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.performance.loadModels || 0)) this.performance.loadModels = this.env.perfadd ? (this.performance.loadModels || 0) + current : current;\n }\n\n /** emit event */\n emit = (event: string) => {\n if (this.events?.dispatchEvent) this.events.dispatchEvent(new Event(event));\n };\n\n /** Runs interpolation using last known result and returns smoothened result\n * Interpolation is based on time since last known result so can be called independently\n *\n * @param result - {@link Result} optional use specific result set to run interpolation on\n * @returns result - {@link Result}\n */\n next(result: Result = this.result): Result {\n return interpolate.calc(result, this.config);\n }\n\n /** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig - {@link Config}\n * @returns result - {@link Result}\n */\n async warmup(userConfig?: Partial) {\n const t0 = now();\n const res = await warmups.warmup(this, userConfig);\n const t1 = now();\n this.performance.warmup = Math.trunc(t1 - t0);\n return res;\n }\n\n /** Run detect with tensorflow profiling\n * - result object will contain total exeuction time information for top-20 kernels\n * - actual detection object can be accessed via `human.result`\n */\n async profile(input: Input, userConfig?: Partial): Promise<{ kernel: string, time: number, perc: number }[]> {\n // @ts-ignore profile wraps method return values\n const profile = await this.tf.profile(() => this.detect(input, userConfig));\n const kernels: Record = {};\n let total = 0;\n for (const kernel of profile.kernels) { // sum kernel time values per kernel\n const ms = Number(kernel.kernelTimeMs) || 0;\n if (kernels[kernel.name]) kernels[kernel.name] += ms;\n else kernels[kernel.name] = ms;\n total += ms;\n }\n const kernelArr: { kernel: string, time: number, perc: number }[] = [];\n Object.entries(kernels).forEach((key) => kernelArr.push({ kernel: key[0], time: key[1] as unknown as number, perc: 0 })); // convert to array\n for (const kernel of kernelArr) {\n kernel.perc = Math.round(1000 * kernel.time / total) / 1000;\n kernel.time = Math.round(1000 * kernel.time) / 1000;\n }\n kernelArr.sort((a, b) => b.time - a.time); // sort\n kernelArr.length = 20; // crop\n return kernelArr;\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 * @param input - {@link Input}\n * @param userConfig - {@link Config}\n * @returns result - {@link Result}\n */\n async detect(input: Input, userConfig?: Partial): Promise {\n // detection happens inside a promise\n this.state = 'detect';\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig) as Config;\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n this.emit('error');\n resolve(empty(error));\n }\n\n const timeStart = now();\n\n // load models if enabled\n await this.load();\n\n timeStamp = now();\n this.state = 'image';\n const img = await image.process(input, this.config) as { canvas: AnyCanvas, tensor: Tensor4D };\n this.process = img;\n this.performance.inputProcess = this.env.perfadd ? (this.performance.inputProcess || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n if (!img.tensor) {\n if (this.config.debug) log('could not convert input to tensor');\n this.emit('error');\n resolve(empty('could not convert input to tensor'));\n return;\n }\n this.emit('image');\n\n timeStamp = now();\n this.config.skipAllowed = await image.skip(this.config, img.tensor);\n this.config.filter.autoBrightness = (this.config.filter.autoBrightness || false) && this.config.skipAllowed; // disable autoBrightness on scene change\n if (!this.performance.totalFrames) this.performance.totalFrames = 0;\n if (!this.performance.cachedFrames) this.performance.cachedFrames = 0;\n (this.performance.totalFrames)++;\n if (this.config.skipAllowed) this.performance.cachedFrames++;\n this.performance.cacheCheck = this.env.perfadd ? (this.performance.cacheCheck || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n this.analyze('Check Changed:');\n\n // prepare where to store model results\n // keep them with weak typing as it can be promise or not\n let faceRes: FaceResult[] | Promise | never[] = [];\n let bodyRes: BodyResult[] | Promise | never[] = [];\n let handRes: HandResult[] | Promise | never[] = [];\n let objectRes: ObjectResult[] | Promise | never[] = [];\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n this.state = 'detect:face';\n if (this.config.async) {\n faceRes = this.config.face.enabled ? face.detectFace(this, img.tensor) : [];\n if (this.performance.face) delete this.performance.face;\n } else {\n timeStamp = now();\n faceRes = this.config.face.enabled ? await face.detectFace(this, img.tensor) : [];\n this.performance.face = this.env.perfadd ? (this.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n\n if (this.config.async && (this.config.body.maxDetected === -1 || this.config.hand.maxDetected === -1)) faceRes = await faceRes; // need face result for auto-detect number of hands or bodies\n\n // run body: can be posenet, blazepose, efficientpose, movenet\n this.analyze('Start Body:');\n this.state = 'detect:body';\n const bodyConfig = this.config.body.maxDetected === -1 ? mergeDeep(this.config, { body: { maxDetected: this.config.face.enabled ? 1 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of bodies\n if (this.config.async) {\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(img.tensor, bodyConfig) : [];\n if (this.performance.body) delete this.performance.body;\n } else {\n timeStamp = now();\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(img.tensor, bodyConfig) : [];\n this.performance.body = this.env.perfadd ? (this.performance.body || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n this.state = 'detect:hand';\n const handConfig = this.config.hand.maxDetected === -1 ? mergeDeep(this.config, { hand: { maxDetected: this.config.face.enabled ? 2 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of hands\n if (this.config.async) {\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? handtrack.predict(img.tensor, handConfig) : [];\n if (this.performance.hand) delete this.performance.hand;\n } else {\n timeStamp = now();\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? await handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? await handtrack.predict(img.tensor, handConfig) : [];\n this.performance.hand = this.env.perfadd ? (this.performance.hand || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n this.analyze('End Hand:');\n\n // run object detection\n this.analyze('Start Object:');\n this.state = 'detect:object';\n if (this.config.async) {\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(img.tensor, this.config) : [];\n if (this.performance.object) delete this.performance.object;\n } else {\n timeStamp = now();\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(img.tensor, this.config) : [];\n this.performance.object = this.env.perfadd ? (this.performance.object || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n this.analyze('End Object:');\n\n // if async wait for results\n this.state = 'detect:await';\n if (this.config.async) [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n\n // run gesture analysis last\n this.state = 'detect:gesture';\n let gestureRes: GestureResult[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes as FaceResult[]), ...gesture.body(bodyRes as BodyResult[]), ...gesture.hand(handRes as HandResult[]), ...gesture.iris(faceRes as FaceResult[])];\n if (!this.config.async) this.performance.gesture = this.env.perfadd ? (this.performance.gesture || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n else if (this.performance.gesture) delete this.performance.gesture;\n }\n\n this.performance.total = this.env.perfadd ? (this.performance.total || 0) + Math.trunc(now() - timeStart) : Math.trunc(now() - timeStart);\n const shape = this.process.tensor?.shape || [0, 0, 0, 0];\n this.result = {\n face: faceRes as FaceResult[],\n body: bodyRes as BodyResult[],\n hand: handRes as HandResult[],\n gesture: gestureRes,\n object: objectRes as ObjectResult[],\n performance: this.performance,\n canvas: this.process.canvas,\n timestamp: Date.now(),\n error: null,\n width: shape[2],\n height: shape[1],\n get persons() { return persons.join(faceRes as FaceResult[], bodyRes as BodyResult[], handRes as HandResult[], gestureRes, shape); },\n };\n\n // finally dispose input tensor\n tf.dispose(img.tensor);\n\n // log('Result:', result);\n this.emit('detect');\n this.state = 'idle';\n resolve(this.result);\n });\n }\n\n /** Helper function\n * @param ms - sleep time in miliseconds\n */\n async sleep(ms: number): Promise { // eslint-disable-line class-methods-use-this\n return new Promise((resolve) => { setTimeout(resolve, ms); });\n }\n\n /** internal structure that keeps track of processed videos @hidden */\n #loops: Record = {};\n /** Continously detect video frames\n * @param element - HTMLVideoElement input\n * @param run - boolean run continously or stop if already running, default true\n * @param delay - number delay detection between frames for number of miliseconds, default 0\n */\n async video(element: HTMLVideoElement, run: boolean = true, delay: number = 0) {\n if (run) {\n if (!this.#loops[element.id]) {\n if (this.config.debug) log('video start', element.id);\n this.#loops[element.id] = true;\n }\n if (!element.paused && this.#loops[element.id] && (element.readyState >= 2)) await this.detect(element);\n if (delay > 0) await this.sleep(delay);\n if (this.#loops[element.id]) requestAnimationFrame(() => this.video(element, run, delay));\n } else {\n if (this.config.debug) log('video stop', element.id);\n this.#loops[element.id] = false;\n }\n }\n}\n\n/** Class Human as default export */\n/* eslint no-restricted-exports: [\"off\", { \"restrictedNamedExports\": [\"default\"] }] */\nexport { Human as default, match, draw, models };\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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;AAAA;AAAA,EAKA,MAAM,MAAMnB,KAA2B;AACrC,WAAO,IAAI,QAAQ,CAAC,YAAY;AAAE,iBAAW,SAASA,GAAE;AAAA,IAAG,CAAC;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAM,SAA2B,MAAe,MAAM,QAAgB,GAAG;AAC7E,QAAI,KAAK;AACP,UAAI,CAAC,mBAAK,QAAO,QAAQ,EAAE,GAAG;AAC5B,YAAI,KAAK,OAAO;AAAO,cAAI,eAAe,QAAQ,EAAE;AACpD,2BAAK,QAAO,QAAQ,EAAE,IAAI;AAAA,MAC5B;AACA,UAAI,CAAC,QAAQ,UAAU,mBAAK,QAAO,QAAQ,EAAE,KAAM,QAAQ,cAAc;AAAI,cAAM,KAAK,OAAO,OAAO;AACtG,UAAI,QAAQ;AAAG,cAAM,KAAK,MAAM,KAAK;AACrC,UAAI,mBAAK,QAAO,QAAQ,EAAE;AAAG,8BAAsB,MAAM,KAAK,MAAM,SAAS,KAAK,KAAK,CAAC;AAAA,IAC1F,OAAO;AACL,UAAI,KAAK,OAAO;AAAO,YAAI,cAAc,QAAQ,EAAE;AACnD,yBAAK,QAAO,QAAQ,EAAE,IAAI;AAAA,IAC5B;AAAA,EACF;AACF;AAzbE;AACA;AACA;AA+DA;AAoWA;", - "names": ["r2", "r", "t", "r5", "r7", "r9", "r3", "dt", "ts", "config", "r", "match", "gl", "index", "y", "v", "size", "rgb", "fx", "process", "config", "_c", "tensor", "rgb", "t", "gl", "el", "affectnet-mobilenet", "anti-spoofing", "blazeface-back", "blazeface-front", "blazepose-detector", "blazepose-full", "blazepose-heavy", "blazepose-lite", "efficientpose-i-lite", "efficientpose-ii-lite", "efficientpose-iv", "facemesh-attention", "facemesh-attention-pinto", "facemesh-detection-full", "facemesh-detection-short", "faceres-deep", "gear-e1", "gear-e2", "gender-ssrnet-imdb", "handlandmark-full", "handlandmark-lite", "handlandmark-sparse", "insightface-efficientnet-b0", "insightface-ghostnet-strides1", "insightface-ghostnet-strides2", "insightface-mobilenet-emore", "insightface-mobilenet-swish", "movenet-lightning", "movenet-multipose", "movenet-thunder", "nanodet-e", "nanodet-g", "nanodet-m", "nanodet-t", "init", "config", "_c", "_d", "model", "config", "gl", "config", "op", "t", "mt", "canvas", "init", "options", "rgb", "localOptions", "y", "cx", "cy", "pt", "xc", "yc", "options", "connectionsToIndices", "index", "_c", "_d", "_f", "_g", "_h", "_i", "emotion", "index", "v", "pt", "inCanvas", "options", "inCanvas", "localOptions", "options", "pt", "connected", "inCanvas", "localOptions", "options", "pt", "inCanvas", "localOptions", "options", "inCanvas", "localOptions", "options", "inCanvas", "localOptions", "options", "canvas", "init", "anchors", "y", "config", "outputSize", "t", "outputSize", "pt", "model", "inputSize", "config", "size", "t", "outputSize", "kpt", "distance", "annotations", "pt", "body", "_c", "labels", "model", "inputSize", "last", "lastTime", "skipped", "config", "process", "t", "id", "labels", "y", "predict", "outputSize", "connected", "kpt", "model", "lastTime", "cache", "skipped", "load", "config", "y", "predict", "enhance", "id", "x", "kpt", "connected", "pt", "pt", "w", "size", "y", "y", "v1", "v2", "size", "inputSize", "anchors", "face", "y", "model", "inputSize", "load", "config", "decodeBoxes", "t", "_c", "_d", "_f", "model", "inputSize", "load", "config", "index", "face", "y", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "t", "r", "cache", "model", "inputSize", "predict", "config", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "id", "size", "face", "pt", "t", "index", "load", "model", "last", "lastTime", "skipped", "load", "config", "_c", "predict", "count", "_a", "_b", "t", "inputSize", "model", "last", "lastTime", "lastCount", "skipped", "load", "config", "predict", "count", "_c", "_d", "_a", "t", "gender", "all", "y", "face", "pt", "model", "skipped", "lastCount", "lastTime", "load", "config", "predict", "count", "model", "cached", "skipped", "lastCount", "lastTime", "load", "config", "predict", "count", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "predict", "count", "_a", "_b", "_c", "_d", "t", "gender", "age", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "predict", "count", "_c", "_d", "_a", "_b", "t", "model", "last", "lastCount", "lastTime", "skipped", "rgb", "load", "config", "predict", "count", "_c", "_d", "_a", "_b", "t", "normalize", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "predict", "count", "_a", "t", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "predict", "count", "_a", "t", "face", "normalize", "v", "y", "r", "r10", "r11", "r12", "r22", "size", "pt", "face", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_n", "_o", "_p", "_r", "_s", "_u", "_v", "_w", "predict", "el", "options", "point", "point2", "gesture", "body", "face", "iris", "_c", "_d", "hand", "getBoxSize", "getBoxCenter", "w", "scaleBoxCoordinates", "enlargeBox", "size", "squarifyBox", "normalizeRadians", "computeRotation", "buildTranslationMatrix", "y", "dot", "v1", "v2", "getColumnFrom2DArr", "multiplyTransformMatrices", "size", "buildRotationMatrix", "invertTransformMatrix", "rotatePoint", "anchors", "model", "_c", "_d", "anchors", "t", "index", "config", "hand", "scaleBoxCoordinates", "lastTime", "handPoseModel", "_c", "xs", "ys", "rotatePoint", "enlargeBox", "squarifyBox", "getBoxSize", "buildRotationMatrix", "invertTransformMatrix", "getBoxCenter", "dot", "config", "computeRotation", "meshAnnotations", "predict", "config", "annotations", "index", "pt", "loadDetect", "models", "inputSize", "skipped", "lastTime", "cache", "loadDetect", "config", "loadSkeleton", "config", "models", "t", "ratio", "id", "hand", "inputSize", "kpt", "index", "predict", "skipped", "lastTime", "cache", "connected", "kpt", "calc", "config", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_n", "_o", "_p", "_r", "_s", "_u", "_v", "_w", "_x", "_z", "t0", "_a", "_b", "_e", "annotations", "pt", "kp", "model", "load", "config", "predict", "t", "options", "clamp", "index", "models_exports", "cache", "body", "kp", "compare", "inputSize", "t", "outputSize", "kpt", "pt", "model", "inputSize", "skipped", "cache", "load", "config", "kpt", "id", "pt", "annotations", "connected", "kp", "body", "predict", "t", "model", "last", "lastTime", "skipped", "inputSize", "load", "config", "process", "id", "size", "labels", "cx", "cy", "y", "w", "predict", "outputSize", "y", "maxSize", "t", "outputStride", "y1", "x1", "y2", "x2", "dy", "dx", "model", "point", "height", "width", "minConfidence", "y", "predict", "config", "t", "load", "model", "outputNodes", "init", "config", "load", "r", "rgb", "predict", "model", "load", "config", "predict", "t", "model", "op", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_n", "_o", "_p", "_r", "_s", "_u", "_v", "_w", "_x", "_z", "_A", "load", "loadDetect", "loadSkeleton", "models", "join", "_c", "_d", "_f", "id", "face", "person", "body", "hand", "gesture", "y", "face", "body", "res", "face", "body", "canvas", "atob", "_c", "_d", "model", "t", "t0", "init", "process", "_c", "predict", "count", "model", "calc", "t0", "ms", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_n", "_o", "_p", "_r", "_s", "_u", "face", "body", "hand", "iris", "join"] + "sourcesContent": ["/*\n Human\n homepage: \n author: '\n*/\n\nvar q4=Object.create;var lw=Object.defineProperty;var j4=Object.getOwnPropertyDescriptor;var X4=Object.getOwnPropertyNames;var Y4=Object.getPrototypeOf,Q4=Object.prototype.hasOwnProperty;var jt=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),qe=(r,e)=>{for(var t in e)lw(r,t,{get:e[t],enumerable:!0})},Z4=(r,e,t,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of X4(e))!Q4.call(r,n)&&n!==t&&lw(r,n,{get:()=>e[n],enumerable:!(o=j4(e,n))||o.enumerable});return r};var Kp=(r,e,t)=>(t=r!=null?q4(Y4(r)):{},Z4(e||!r||!r.__esModule?lw(t,\"default\",{value:r,enumerable:!0}):t,r));var _k=jt((Lme,Tk)=>{Tk.exports=Tt;var Yo=null;try{Yo=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(r){}function Tt(r,e,t){this.low=r|0,this.high=e|0,this.unsigned=!!t}Tt.prototype.__isLong__;Object.defineProperty(Tt.prototype,\"__isLong__\",{value:!0});function jr(r){return(r&&r.__isLong__)===!0}Tt.isLong=jr;var yk={},bk={};function zu(r,e){var t,o,n;return e?(r>>>=0,(n=0<=r&&r<256)&&(o=bk[r],o)?o:(t=_t(r,(r|0)<0?-1:0,!0),n&&(bk[r]=t),t)):(r|=0,(n=-128<=r&&r<128)&&(o=yk[r],o)?o:(t=_t(r,r<0?-1:0,!1),n&&(yk[r]=t),t))}Tt.fromInt=zu;function Qo(r,e){if(isNaN(r))return e?Bu:Zo;if(e){if(r<0)return Bu;if(r>=Ik)return Nk}else{if(r<=-wk)return qr;if(r+1>=wk)return kk}return r<0?Qo(-r,e).neg():_t(r%ol|0,r/ol|0,e)}Tt.fromNumber=Qo;function _t(r,e,t){return new Tt(r,e,t)}Tt.fromBits=_t;var ud=Math.pow;function Iw(r,e,t){if(r.length===0)throw Error(\"empty string\");if(r===\"NaN\"||r===\"Infinity\"||r===\"+Infinity\"||r===\"-Infinity\")return Zo;if(typeof e==\"number\"?(t=e,e=!1):e=!!e,t=t||10,t<2||360)throw Error(\"interior hyphen\");if(o===0)return Iw(r.substring(1),e,t).neg();for(var n=Qo(ud(t,8)),s=Zo,a=0;a>>0:this.low};de.toNumber=function(){return this.unsigned?(this.high>>>0)*ol+(this.low>>>0):this.high*ol+(this.low>>>0)};de.toString=function(e){if(e=e||10,e<2||36>>0,l=u.toString(e);if(a=p,a.isZero())return l+i;for(;l.length<6;)l=\"0\"+l;i=\"\"+l+i}};de.getHighBits=function(){return this.high};de.getHighBitsUnsigned=function(){return this.high>>>0};de.getLowBits=function(){return this.low};de.getLowBitsUnsigned=function(){return this.low>>>0};de.getNumBitsAbs=function(){if(this.isNegative())return this.eq(qr)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,t=31;t>0&&!(e&1<=0};de.isOdd=function(){return(this.low&1)===1};de.isEven=function(){return(this.low&1)===0};de.equals=function(e){return jr(e)||(e=Ws(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};de.eq=de.equals;de.notEquals=function(e){return!this.eq(e)};de.neq=de.notEquals;de.ne=de.notEquals;de.lessThan=function(e){return this.comp(e)<0};de.lt=de.lessThan;de.lessThanOrEqual=function(e){return this.comp(e)<=0};de.lte=de.lessThanOrEqual;de.le=de.lessThanOrEqual;de.greaterThan=function(e){return this.comp(e)>0};de.gt=de.greaterThan;de.greaterThanOrEqual=function(e){return this.comp(e)>=0};de.gte=de.greaterThanOrEqual;de.ge=de.greaterThanOrEqual;de.compare=function(e){if(jr(e)||(e=Ws(e)),this.eq(e))return 0;var t=this.isNegative(),o=e.isNegative();return t&&!o?-1:!t&&o?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};de.comp=de.compare;de.negate=function(){return!this.unsigned&&this.eq(qr)?qr:this.not().add(rl)};de.neg=de.negate;de.add=function(e){jr(e)||(e=Ws(e));var t=this.high>>>16,o=this.high&65535,n=this.low>>>16,s=this.low&65535,a=e.high>>>16,i=e.high&65535,p=e.low>>>16,u=e.low&65535,l=0,c=0,m=0,d=0;return d+=s+u,m+=d>>>16,d&=65535,m+=n+p,c+=m>>>16,m&=65535,c+=o+i,l+=c>>>16,c&=65535,l+=t+a,l&=65535,_t(m<<16|d,l<<16|c,this.unsigned)};de.subtract=function(e){return jr(e)||(e=Ws(e)),this.add(e.neg())};de.sub=de.subtract;de.multiply=function(e){if(this.isZero())return Zo;if(jr(e)||(e=Ws(e)),Yo){var t=Yo.mul(this.low,this.high,e.low,e.high);return _t(t,Yo.get_high(),this.unsigned)}if(e.isZero())return Zo;if(this.eq(qr))return e.isOdd()?qr:Zo;if(e.eq(qr))return this.isOdd()?qr:Zo;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Sk)&&e.lt(Sk))return Qo(this.toNumber()*e.toNumber(),this.unsigned);var o=this.high>>>16,n=this.high&65535,s=this.low>>>16,a=this.low&65535,i=e.high>>>16,p=e.high&65535,u=e.low>>>16,l=e.low&65535,c=0,m=0,d=0,f=0;return f+=a*l,d+=f>>>16,f&=65535,d+=s*l,m+=d>>>16,d&=65535,d+=a*u,m+=d>>>16,d&=65535,m+=n*l,c+=m>>>16,m&=65535,m+=s*u,c+=m>>>16,m&=65535,m+=a*p,c+=m>>>16,m&=65535,c+=o*l+n*u+s*p+a*i,c&=65535,_t(d<<16|f,c<<16|m,this.unsigned)};de.mul=de.multiply;de.divide=function(e){if(jr(e)||(e=Ws(e)),e.isZero())throw Error(\"division by zero\");if(Yo){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var t=(this.unsigned?Yo.div_u:Yo.div_s)(this.low,this.high,e.low,e.high);return _t(t,Yo.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Bu:Zo;var o,n,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Bu;if(e.gt(this.shru(1)))return vk;s=Bu}else{if(this.eq(qr)){if(e.eq(rl)||e.eq(Sw))return qr;if(e.eq(qr))return rl;var a=this.shr(1);return o=a.div(e).shl(1),o.eq(Zo)?e.isNegative()?rl:Sw:(n=this.sub(e.mul(o)),s=o.add(n.div(e)),s)}else if(e.eq(qr))return this.unsigned?Bu:Zo;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=Zo}for(n=this;n.gte(e);){o=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(o)/Math.LN2),p=i<=48?1:ud(2,i-48),u=Qo(o),l=u.mul(e);l.isNegative()||l.gt(n);)o-=p,u=Qo(o,this.unsigned),l=u.mul(e);u.isZero()&&(u=rl),s=s.add(u),n=n.sub(l)}return s};de.div=de.divide;de.modulo=function(e){if(jr(e)||(e=Ws(e)),Yo){var t=(this.unsigned?Yo.rem_u:Yo.rem_s)(this.low,this.high,e.low,e.high);return _t(t,Yo.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};de.mod=de.modulo;de.rem=de.modulo;de.not=function(){return _t(~this.low,~this.high,this.unsigned)};de.and=function(e){return jr(e)||(e=Ws(e)),_t(this.low&e.low,this.high&e.high,this.unsigned)};de.or=function(e){return jr(e)||(e=Ws(e)),_t(this.low|e.low,this.high|e.high,this.unsigned)};de.xor=function(e){return jr(e)||(e=Ws(e)),_t(this.low^e.low,this.high^e.high,this.unsigned)};de.shiftLeft=function(e){return jr(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?_t(this.low<>>32-e,this.unsigned):_t(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):_t(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};de.shr=de.shiftRight;de.shiftRightUnsigned=function(e){if(jr(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var o=this.low;return _t(o>>>e|t<<32-e,t>>>e,this.unsigned)}else return e===32?_t(t,0,this.unsigned):_t(t>>>e-32,0,this.unsigned)};de.shru=de.shiftRightUnsigned;de.shr_u=de.shiftRightUnsigned;de.toSigned=function(){return this.unsigned?_t(this.low,this.high,!1):this};de.toUnsigned=function(){return this.unsigned?this:_t(this.low,this.high,!0)};de.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};de.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};de.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};Tt.fromBytes=function(e,t,o){return o?Tt.fromBytesLE(e,t):Tt.fromBytesBE(e,t)};Tt.fromBytesLE=function(e,t){return new Tt(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)};Tt.fromBytesBE=function(e,t){return new Tt(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}});var f1=jt(()=>{});var h1=jt(()=>{});var W2=jt((V2,tS)=>{(function(r,e,t){function o(i){var p=this,u=a();p.next=function(){var l=2091639*p.s0+p.c*23283064365386963e-26;return p.s0=p.s1,p.s1=p.s2,p.s2=l-(p.c=l|0)},p.c=1,p.s0=u(\" \"),p.s1=u(\" \"),p.s2=u(\" \"),p.s0-=u(i),p.s0<0&&(p.s0+=1),p.s1-=u(i),p.s1<0&&(p.s1+=1),p.s2-=u(i),p.s2<0&&(p.s2+=1),u=null}function n(i,p){return p.c=i.c,p.s0=i.s0,p.s1=i.s1,p.s2=i.s2,p}function s(i,p){var u=new o(i),l=p&&p.state,c=u.next;return c.int32=function(){return u.next()*4294967296|0},c.double=function(){return c()+(c()*2097152|0)*11102230246251565e-32},c.quick=c,l&&(typeof l==\"object\"&&n(l,u),c.state=function(){return n(u,{})}),c}function a(){var i=4022871197,p=function(u){u=String(u);for(var l=0;l>>0,c-=i,c*=i,i=c>>>0,c-=i,i+=c*4294967296}return(i>>>0)*23283064365386963e-26};return p}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.alea=s})(V2,typeof tS==\"object\"&&tS,typeof define==\"function\"&&define)});var G2=jt((U2,rS)=>{(function(r,e,t){function o(a){var i=this,p=\"\";i.x=0,i.y=0,i.z=0,i.w=0,i.next=function(){var l=i.x^i.x<<11;return i.x=i.y,i.y=i.z,i.z=i.w,i.w^=i.w>>>19^l^l>>>8},a===(a|0)?i.x=a:p+=a;for(var u=0;u>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(typeof u==\"object\"&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xor128=s})(U2,typeof rS==\"object\"&&rS,typeof define==\"function\"&&define)});var K2=jt((H2,oS)=>{(function(r,e,t){function o(a){var i=this,p=\"\";i.next=function(){var l=i.x^i.x>>>2;return i.x=i.y,i.y=i.z,i.z=i.w,i.w=i.v,(i.d=i.d+362437|0)+(i.v=i.v^i.v<<4^(l^l<<1))|0},i.x=0,i.y=0,i.z=0,i.w=0,i.v=0,a===(a|0)?i.x=a:p+=a;for(var u=0;u>>4),i.next()}function n(a,i){return i.x=a.x,i.y=a.y,i.z=a.z,i.w=a.w,i.v=a.v,i.d=a.d,i}function s(a,i){var p=new o(a),u=i&&i.state,l=function(){return(p.next()>>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(typeof u==\"object\"&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xorwow=s})(H2,typeof oS==\"object\"&&oS,typeof define==\"function\"&&define)});var j2=jt((q2,nS)=>{(function(r,e,t){function o(a){var i=this;i.next=function(){var u=i.x,l=i.i,c,m,d;return c=u[l],c^=c>>>7,m=c^c<<24,c=u[l+1&7],m^=c^c>>>10,c=u[l+3&7],m^=c^c>>>3,c=u[l+4&7],m^=c^c<<7,c=u[l+7&7],c=c^c<<13,m^=c^c<<9,u[l]=m,i.i=l+1&7,m};function p(u,l){var c,m,d=[];if(l===(l|0))m=d[0]=l;else for(l=\"\"+l,c=0;c0;--c)u.next()}p(i,a)}function n(a,i){return i.x=a.x.slice(),i.i=a.i,i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,l=function(){return(p.next()>>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(u.x&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xorshift7=s})(q2,typeof nS==\"object\"&&nS,typeof define==\"function\"&&define)});var Y2=jt((X2,sS)=>{(function(r,e,t){function o(a){var i=this;i.next=function(){var u=i.w,l=i.X,c=i.i,m,d;return i.w=u=u+1640531527|0,d=l[c+34&127],m=l[c=c+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=l[c]=d^m,i.i=c,d+(u^u>>>16)|0};function p(u,l){var c,m,d,f,h,g=[],x=128;for(l===(l|0)?(m=l,l=null):(l=l+\"\\0\",m=0,x=Math.max(x,l.length)),d=0,f=-32;f>>15,m^=m<<4,m^=m>>>13,f>=0&&(h=h+1640531527|0,c=g[f&127]^=m+h,d=c==0?d+1:0);for(d>=128&&(g[(l&&l.length||0)&127]=-1),d=127,f=4*128;f>0;--f)m=g[d+34&127],c=g[d=d+1&127],m^=m<<13,c^=c<<17,m^=m>>>15,c^=c>>>12,g[d]=m^c;u.w=h,u.X=g,u.i=d}p(i,a)}function n(a,i){return i.i=a.i,i.w=a.w,i.X=a.X.slice(),i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,l=function(){return(p.next()>>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(u.X&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xor4096=s})(X2,typeof sS==\"object\"&&sS,typeof define==\"function\"&&define)});var Z2=jt((Q2,aS)=>{(function(r,e,t){function o(a){var i=this,p=\"\";i.next=function(){var l=i.b,c=i.c,m=i.d,d=i.a;return l=l<<25^l>>>7^c,c=c-m|0,m=m<<24^m>>>8^d,d=d-l|0,i.b=l=l<<20^l>>>12^c,i.c=c=c-m|0,i.d=m<<16^c>>>16^d,i.a=d-l|0},i.a=0,i.b=0,i.c=-1640531527,i.d=1367130551,a===Math.floor(a)?(i.a=a/4294967296|0,i.b=a|0):p+=a;for(var u=0;u>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(typeof u==\"object\"&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.tychei=s})(Q2,typeof aS==\"object\"&&aS,typeof define==\"function\"&&define)});var J2=jt(()=>{});var tN=jt((eN,qd)=>{(function(r,e,t){var o=256,n=6,s=52,a=\"random\",i=t.pow(o,n),p=t.pow(2,s),u=p*2,l=o-1,c;function m(w,S,k){var T=[];S=S==!0?{entropy:!0}:S||{};var E=g(h(S.entropy?[w,b(e)]:w==null?x():w,3),T),R=new d(T),D=function(){for(var F=R.g(n),O=i,M=0;F=u;)F/=2,O/=2,M>>>=1;return(F+M)/O};return D.int32=function(){return R.g(4)|0},D.quick=function(){return R.g(4)/4294967296},D.double=D,g(b(R.S),e),(S.pass||k||function(F,O,M,L){return L&&(L.S&&f(L,R),F.state=function(){return f(R,{})}),M?(t[a]=F,O):F})(D,E,\"global\"in S?S.global:this==t,S.state)}function d(w){var S,k=w.length,T=this,E=0,R=T.i=T.j=0,D=T.S=[];for(k||(w=[k++]);E{var Q6=W2(),Z6=G2(),J6=K2(),ej=j2(),tj=Y2(),rj=Z2(),Zu=tN();Zu.alea=Q6;Zu.xor128=Z6;Zu.xorwow=J6;Zu.xorshift7=ej;Zu.xor4096=tj;Zu.tychei=rj;rN.exports=Zu});var ev=jt(()=>{});var tv=jt(()=>{});var Iz=jt(()=>{});var vz=jt(()=>{});var kz=jt(()=>{});var Nz=jt((Jg,ov)=>{var rv=(()=>{var r=typeof document!=\"undefined\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!=\"undefined\"&&(r=r||__filename),function(e){e=e||{};function t(){return oe.buffer!=Ke&&Et(oe.buffer),mt}function o(){return oe.buffer!=Ke&&Et(oe.buffer),ut}function n(){return oe.buffer!=Ke&&Et(oe.buffer),gt}function s(){return oe.buffer!=Ke&&Et(oe.buffer),Ur}function a(){return oe.buffer!=Ke&&Et(oe.buffer),Bt}function i(){return oe.buffer!=Ke&&Et(oe.buffer),io}function p(){return oe.buffer!=Ke&&Et(oe.buffer),sr}var u=typeof e!=\"undefined\"?e:{},l,c;u.ready=new Promise(function(P,V){l=P,c=V});var m;typeof process!=\"undefined\"&&process.listeners&&(m={uncaughtException:process.listeners(\"uncaughtException\"),unhandledRejection:process.listeners(\"unhandledRejection\")});var d=Object.assign({},u),f=[],h=\"./this.program\",g=(P,V)=>{throw V},x=typeof window==\"object\",b=typeof importScripts==\"function\",w=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",S=u.ENVIRONMENT_IS_PTHREAD||!1,k=\"\";function T(P){return u.locateFile?u.locateFile(P,k):k+P}var E,R,D,F;function O(P){if(P instanceof Du)return;j(\"exiting due to exception: \"+P)}if(w){var M=ev(),L=tv();b?k=L.dirname(k)+\"/\":k=__dirname+\"/\",E=(V,pe)=>(V=zp(V)?new URL(V):L.normalize(V),M.readFileSync(V,pe?void 0:\"utf8\")),D=V=>{var pe=E(V,!0);return pe.buffer||(pe=new Uint8Array(pe)),pe},R=(V,pe,$e)=>{V=zp(V)?new URL(V):L.normalize(V),M.readFile(V,function(Be,Le){Be?$e(Be):pe(Le.buffer)})},process.argv.length>1&&(h=process.argv[1].replace(/\\\\/g,\"/\")),f=process.argv.slice(2),process.on(\"uncaughtException\",function(V){if(!(V instanceof Du))throw V}),process.on(\"unhandledRejection\",function(V){throw V}),g=(V,pe)=>{if(cn())throw process.exitCode=V,pe;O(pe),process.exit(V)},u.inspect=function(){return\"[Emscripten Module object]\"};let P;try{P=Iz()}catch(V){throw console.error('The \"worker_threads\" module is not supported in this node.js build - perhaps a newer version is needed?'),V}global.Worker=P.Worker}else(x||b)&&(b?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.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):k=\"\",w||(E=P=>{var V=new XMLHttpRequest;return V.open(\"GET\",P,!1),V.send(null),V.responseText},b&&(D=P=>{var V=new XMLHttpRequest;return V.open(\"GET\",P,!1),V.responseType=\"arraybuffer\",V.send(null),new Uint8Array(V.response)}),R=(P,V,pe)=>{var $e=new XMLHttpRequest;$e.open(\"GET\",P,!0),$e.responseType=\"arraybuffer\",$e.onload=()=>{if($e.status==200||$e.status==0&&$e.response){V($e.response);return}pe()},$e.onerror=pe,$e.send(null)}),F=P=>document.title=P);w&&typeof performance==\"undefined\"&&(global.performance=vz().performance);var B=console.log.bind(console),z=console.warn.bind(console);w&&(B=P=>M.writeSync(1,P+`\n`),z=P=>M.writeSync(2,P+`\n`));var U=u.print||B,j=u.printErr||z;Object.assign(u,d),d=null,u.arguments&&(f=u.arguments),u.thisProgram&&(h=u.thisProgram),u.quit&&(g=u.quit);var q=4,Y=Atomics.load,J=Atomics.store,re=Atomics.compareExchange,ne;u.wasmBinary&&(ne=u.wasmBinary);var ee=u.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&Ru(\"no native wasm support detected\");var oe,ue,me=!1,be;function _e(P,V){P||Ru(V)}var ve=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):void 0;function Fe(P,V,pe){V>>>=0;for(var $e=V+pe,Be=V;P[Be]&&!(Be>=$e);)++Be;if(Be-V>16&&P.buffer&&ve)return ve.decode(P.buffer instanceof SharedArrayBuffer?P.slice(V,Be):P.subarray(V,Be));for(var Le=\"\";V>10,56320|co&1023)}}return Le}function Pe(P,V){return P>>>=0,P?Fe(o(),P,V):\"\"}function at(P,V,pe,$e){if(pe>>>=0,!($e>0))return 0;for(var Be=pe,Le=pe+$e-1,ge=0;ge=55296&&Ne<=57343){var Ot=P.charCodeAt(++ge);Ne=65536+((Ne&1023)<<10)|Ot&1023}if(Ne<=127){if(pe>=Le)break;V[pe++>>>0]=Ne}else if(Ne<=2047){if(pe+1>=Le)break;V[pe++>>>0]=192|Ne>>6,V[pe++>>>0]=128|Ne&63}else if(Ne<=65535){if(pe+2>=Le)break;V[pe++>>>0]=224|Ne>>12,V[pe++>>>0]=128|Ne>>6&63,V[pe++>>>0]=128|Ne&63}else{if(pe+3>=Le)break;V[pe++>>>0]=240|Ne>>18,V[pe++>>>0]=128|Ne>>12&63,V[pe++>>>0]=128|Ne>>6&63,V[pe++>>>0]=128|Ne&63}}return V[pe>>>0]=0,pe-Be}function ct(P,V,pe){return at(P,o(),V,pe)}var Ke,mt,ut,gt,xt,Ur,Bt,io,sr;S&&(Ke=u.buffer);function Et(P){Ke=P,u.HEAP8=mt=new Int8Array(P),u.HEAP16=gt=new Int16Array(P),u.HEAP32=Ur=new Int32Array(P),u.HEAPU8=ut=new Uint8Array(P),u.HEAPU16=xt=new Uint16Array(P),u.HEAPU32=Bt=new Uint32Array(P),u.HEAPF32=io=new Float32Array(P),u.HEAPF64=sr=new Float64Array(P)}var ar=u.INITIAL_MEMORY||16777216;if(S)oe=u.wasmMemory,Ke=u.buffer;else if(u.wasmMemory)oe=u.wasmMemory;else if(oe=new WebAssembly.Memory({initial:ar/65536,maximum:65536,shared:!0}),!(oe.buffer instanceof SharedArrayBuffer))throw j(\"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\"),w&&j(\"(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)\"),Error(\"bad memory\");oe&&(Ke=oe.buffer),ar=Ke.byteLength,Et(Ke);var ir,uo=[],po=[],xr=[],ja=!1;function cn(){return ee}function ta(){if(u.preRun)for(typeof u.preRun==\"function\"&&(u.preRun=[u.preRun]);u.preRun.length;)lc(u.preRun.shift());dc(uo)}function Zt(){ja=!0,!S&&dc(po)}function Xa(){if(!S){if(u.postRun)for(typeof u.postRun==\"function\"&&(u.postRun=[u.postRun]);u.postRun.length;)Zv(u.postRun.shift());dc(xr)}}function lc(P){uo.unshift(P)}function cc(P){po.unshift(P)}function Zv(P){xr.unshift(P)}var Pi=0,Bp=null,Ya=null;function Ay(P){Pi++,u.monitorRunDependencies&&u.monitorRunDependencies(Pi)}function Rm(P){if(Pi--,u.monitorRunDependencies&&u.monitorRunDependencies(Pi),Pi==0&&(Bp!==null&&(clearInterval(Bp),Bp=null),Ya)){var V=Ya;Ya=null,V()}}function Ru(P){u.onAbort&&u.onAbort(P),P=\"Aborted(\"+P+\")\",j(P),me=!0,be=1,P+=\". Build with -sASSERTIONS for more info.\";var V=new WebAssembly.RuntimeError(P);throw c(V),V}var Fy=\"data:application/octet-stream;base64,\";function Dm(P){return P.startsWith(Fy)}function zp(P){return P.startsWith(\"file://\")}var yr;yr=\"tfjs-backend-wasm-threaded-simd.wasm\",Dm(yr)||(yr=T(yr));function Am(P){try{if(P==yr&&ne)return new Uint8Array(ne);if(D)return D(P);throw\"both async and sync fetching of the wasm failed\"}catch(V){Ru(V)}}function Py(){if(!ne&&(x||b)){if(typeof fetch==\"function\"&&!zp(yr))return fetch(yr,{credentials:\"same-origin\"}).then(function(P){if(!P.ok)throw\"failed to load wasm binary file at '\"+yr+\"'\";return P.arrayBuffer()}).catch(function(){return Am(yr)});if(R)return new Promise(function(P,V){R(yr,function(pe){P(new Uint8Array(pe))},V)})}return Promise.resolve().then(function(){return Am(yr)})}function Oy(){var P={env:Km,wasi_snapshot_preview1:Km};function V(ge,Ne){var Ot=ge.exports;if(u.asm=Ot,Hy(u.asm._emscripten_tls_init),ir=u.asm.__indirect_function_table,cc(u.asm.__wasm_call_ctors),ue=Ne,!S){var co=Me.unusedWorkers.length;Me.unusedWorkers.forEach(function(Za){Me.loadWasmModuleToWorker(Za,function(){--co||Rm(\"wasm-instantiate\")})})}}S||Ay(\"wasm-instantiate\");function pe(ge){V(ge.instance,ge.module)}function $e(ge){return Py().then(function(Ne){return WebAssembly.instantiate(Ne,P)}).then(function(Ne){return Ne}).then(ge,function(Ne){j(\"failed to asynchronously prepare wasm: \"+Ne),Ru(Ne)})}function Be(){return!ne&&typeof WebAssembly.instantiateStreaming==\"function\"&&!Dm(yr)&&!zp(yr)&&!w&&typeof fetch==\"function\"?fetch(yr,{credentials:\"same-origin\"}).then(function(ge){var Ne=WebAssembly.instantiateStreaming(ge,P);return Ne.then(pe,function(Ot){return j(\"wasm streaming compile failed: \"+Ot),j(\"falling back to ArrayBuffer instantiation\"),$e(pe)})}):$e(pe)}if(u.instantiateWasm)try{var Le=u.instantiateWasm(P,V);return Le}catch(ge){j(\"Module.instantiateWasm callback failed with error: \"+ge),c(ge)}return Be().catch(c),{}}var Jv,ek,Fm={};function Du(P){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+P+\")\",this.status=P}function My(P){var V=Me.pthreads[P];delete Me.pthreads[P],V.terminate(),iw(P),Me.runningWorkers.splice(Me.runningWorkers.indexOf(V),1),V.pthread_ptr=0}function Ly(P){var V=Me.pthreads[P];V.postMessage({cmd:\"cancel\"})}function mc(P){var V=Me.pthreads[P];_e(V),Me.returnWorkerToPool(V)}function By(P){var V=Me.getNewWorker();if(!V)return 6;Me.runningWorkers.push(V),Me.pthreads[P.pthread_ptr]=V,V.pthread_ptr=P.pthread_ptr;var pe={cmd:\"run\",start_routine:P.startRoutine,arg:P.arg,pthread_ptr:P.pthread_ptr};return V.runPthread=()=>{w&&V.ref(),V.postMessage(pe,P.transferList),delete V.runPthread},V.loaded&&V.runPthread(),0}var Pm={varargs:void 0,get:function(){Pm.varargs+=4;var P=s()[Pm.varargs-4>>>2];return P},getStr:function(P){var V=Pe(P);return V}};function Om(P){if(S)return Oi(1,1,P);be=P,cn()||(Me.terminateAllThreads(),u.onExit&&u.onExit(P),me=!0),g(P,new Du(P))}function zy(P,V){if(be=P,!V&&S)throw Lm(P),\"unwind\";Om(P)}var Mm=zy;function Vy(P){if(P instanceof Du||P==\"unwind\")return be;g(1,P)}var Me={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){S?Me.initWorker():Me.initMainThread()},initMainThread:function(){for(var P=8;P--;)Me.allocateUnusedWorker()},initWorker:function(){ee=!1},setExitStatus:function(P){be=P},terminateAllThreads:function(){for(var P of Object.values(Me.pthreads))Me.returnWorkerToPool(P);for(var P of Me.unusedWorkers)P.terminate();Me.unusedWorkers=[]},returnWorkerToPool:function(P){var V=P.pthread_ptr;delete Me.pthreads[V],Me.unusedWorkers.push(P),Me.runningWorkers.splice(Me.runningWorkers.indexOf(P),1),P.pthread_ptr=0,w&&P.unref(),iw(V)},receiveObjectTransfer:function(P){},threadInitTLS:function(){Me.tlsInitFunctions.forEach(P=>P())},loadWasmModuleToWorker:function(P,V){P.onmessage=Le=>{var ge=Le.data,Ne=ge.cmd;if(P.pthread_ptr&&(Me.currentProxiedOperationCallerThread=P.pthread_ptr),ge.targetThread&&ge.targetThread!=Zm()){var Ot=Me.pthreads[ge.targetThread];Ot?Ot.postMessage(ge,ge.transferList):j('Internal error! Worker sent a message \"'+Ne+'\" to target pthread '+ge.targetThread+\", but that thread no longer exists!\"),Me.currentProxiedOperationCallerThread=void 0;return}Ne===\"processProxyingQueue\"?fc(ge.queue):Ne===\"spawnThread\"?By(ge):Ne===\"cleanupThread\"?mc(ge.thread):Ne===\"killThread\"?My(ge.thread):Ne===\"cancelThread\"?Ly(ge.thread):Ne===\"loaded\"?(P.loaded=!0,w&&P.unref(),V&&V(P),P.runPthread&&P.runPthread()):Ne===\"print\"?U(\"Thread \"+ge.threadId+\": \"+ge.text):Ne===\"printErr\"?j(\"Thread \"+ge.threadId+\": \"+ge.text):Ne===\"alert\"?alert(\"Thread \"+ge.threadId+\": \"+ge.text):ge.target===\"setimmediate\"?P.postMessage(ge):Ne===\"callHandler\"?u[ge.handler](...ge.args):Ne&&j(\"worker sent an unknown command \"+Ne),Me.currentProxiedOperationCallerThread=void 0},P.onerror=Le=>{var ge=\"worker sent an error!\";throw j(ge+\" \"+Le.filename+\":\"+Le.lineno+\": \"+Le.message),Le},w&&(P.on(\"message\",function(Le){P.onmessage({data:Le})}),P.on(\"error\",function(Le){P.onerror(Le)}),P.on(\"detachedExit\",function(){}));var pe=[],$e=[\"onExit\",\"onAbort\",\"print\",\"printErr\"];for(var Be of $e)u.hasOwnProperty(Be)&&pe.push(Be);P.postMessage({cmd:\"load\",handlers:pe,urlOrBlob:u.mainScriptUrlOrBlob||r,wasmMemory:oe,wasmModule:ue})},allocateUnusedWorker:function(){var P,V=T(\"tfjs-backend-wasm-threaded-simd.worker.js\");P=new Worker(V),Me.unusedWorkers.push(P)},getNewWorker:function(){return Me.unusedWorkers.length==0&&(Me.allocateUnusedWorker(),Me.loadWasmModuleToWorker(Me.unusedWorkers[0])),Me.unusedWorkers.pop()}};u.PThread=Me;function dc(P){for(;P.length>0;)P.shift()(u)}function Wy(){var P=Zm(),V=s()[P+52>>>2],pe=s()[P+56>>>2],$e=V-pe;ak(V,$e),Jm(V)}u.establishStackSpace=Wy;function Lm(P){if(S)return Oi(2,0,P);try{Mm(P)}catch(V){Vy(V)}}var Vp=[];function Uy(P){var V=Vp[P];return V||(P>=Vp.length&&(Vp.length=P+1),Vp[P]=V=ir.get(P)),V}function Gy(P,V){var pe=Uy(P)(V);cn()?Me.setExitStatus(pe):sk(pe)}u.invokeEntryPoint=Gy;function Hy(P){Me.tlsInitFunctions.push(P)}function Ky(P){rk(P,!b,1,!x),Me.threadInitTLS()}function qy(P){S?postMessage({cmd:\"cleanupThread\",thread:P}):mc(P)}function Bm(P,V,pe,$e){return S?Oi(3,1,P,V,pe,$e):zm(P,V,pe,$e)}function zm(P,V,pe,$e){if(typeof SharedArrayBuffer==\"undefined\")return j(\"Current environment does not support SharedArrayBuffer, pthreads are not available!\"),6;var Be=[],Le=0;if(S&&(Be.length===0||Le))return Bm(P,V,pe,$e);if(Le)return Le;var ge={startRoutine:pe,pthread_ptr:P,arg:$e,transferList:Be};return S?(ge.cmd=\"spawnThread\",postMessage(ge,Be),0):By(ge)}function jy(){return 65536}var Xy=!0;function Yy(){return Xy}function fc(P){Atomics.store(s(),P>>2,1),Zm()&&nk(P),Atomics.compareExchange(s(),P>>2,1,0)}u.executeNotifiedProxyingQueue=fc;function Qy(P,V,pe,$e){if(P==V)setTimeout(()=>fc($e));else if(S)postMessage({targetThread:P,cmd:\"processProxyingQueue\",queue:$e});else{var Be=Me.pthreads[P];if(!Be)return;Be.postMessage({cmd:\"processProxyingQueue\",queue:$e})}return 1}function Zy(P,V,pe){return-1}function Jy(){Ru(\"\")}function Au(P){Au.shown||(Au.shown={}),Au.shown[P]||(Au.shown[P]=1,w&&(P=\"warning: \"+P),j(P))}function eb(){w||b||Au(\"Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread\")}function tb(){return Date.now()}function Vm(){return 4294901760}function rb(){return Vm()}var hc;w?hc=()=>{var P=process.hrtime();return P[0]*1e3+P[1]/1e6}:hc=()=>performance.timeOrigin+performance.now();function ob(P,V,pe){o().copyWithin(P>>>0,V>>>0,V+pe>>>0)}function nb(){return w?kz().cpus().length:navigator.hardwareConcurrency}function sb(P){var V=uw(),pe=P();return Jm(V),pe}function Oi(P,V){var pe=arguments.length-2,$e=arguments;return sb(()=>{for(var Be=pe,Le=ed(Be*8),ge=Le>>3,Ne=0;Ne>>0]=Ot}return ok(P,Be,Le,V)})}var gc=[];function ab(P,V,pe){gc.length=V;for(var $e=pe>>3,Be=0;Be>>0];var Le=P<0,ge=Le?Fm[-P-1]:hb[P];return ge.apply(null,gc)}function ib(P){try{return oe.grow(P-Ke.byteLength+65535>>>16),Et(oe.buffer),1}catch(V){}}function ub(P){var V=o().length;if(P=P>>>0,P<=V)return!1;var pe=Vm();if(P>pe)return!1;let $e=(Ot,co)=>Ot+(co-Ot%co)%co;for(var Be=1;Be<=4;Be*=2){var Le=V*(1+.2/Be);Le=Math.min(Le,P+100663296);var ge=Math.min(pe,$e(Math.max(P,Le),65536)),Ne=ib(ge);if(Ne)return!0}return!1}function pb(){throw\"unwind\"}function Wm(P){return S?Oi(4,1,P):52}function Um(P,V,pe,$e,Be){return S?Oi(5,1,P,V,pe,$e,Be):70}var lb=[null,[],[]];function cb(P,V){var pe=lb[P];V===0||V===10?((P===1?U:j)(Fe(pe,0)),pe.length=0):pe.push(V)}function Gm(P,V,pe,$e){if(S)return Oi(6,1,P,V,pe,$e);for(var Be=0,Le=0;Le>>2],Ne=a()[V+4>>>2];V+=8;for(var Ot=0;Ot>>0]);Be+=Ne}return a()[$e>>>2]=Be,0}function Hm(P){var V=u[\"_\"+P];return V}function mb(P,V){t().set(P,V>>>0)}function db(P,V,pe,$e,Be){var Le={string:Gr=>{var Hp=0;if(Gr!=null&&Gr!==0){var pk=(Gr.length<<2)+1;Hp=ed(pk),ct(Gr,Hp,pk)}return Hp},array:Gr=>{var Hp=ed(Gr.length);return mb(Gr,Hp),Hp}};function ge(Gr){return V===\"string\"?Pe(Gr):V===\"boolean\"?!!Gr:Gr}var Ne=Hm(P),Ot=[],co=0;if($e)for(var Za=0;Za<$e.length;Za++){var uk=Le[pe[Za]];uk?(co===0&&(co=uw()),Ot[Za]=uk($e[Za])):Ot[Za]=$e[Za]}var pw=Ne.apply(null,Ot);function K4(Gr){return co!==0&&Jm(co),ge(Gr)}return pw=K4(pw),pw}function fb(P,V,pe,$e){pe=pe||[];var Be=pe.every(ge=>ge===\"number\"||ge===\"boolean\"),Le=V!==\"string\";return Le&&Be&&!$e?Hm(P):function(){return db(P,V,pe,arguments,$e)}}Me.init();var hb=[null,Om,Lm,Bm,Wm,Um,Gm],Km={__emscripten_init_main_thread_js:Ky,__emscripten_thread_cleanup:qy,__pthread_create_js:zm,_emscripten_default_pthread_stack_size:jy,_emscripten_get_now_is_monotonic:Yy,_emscripten_notify_task_queue:Qy,_emscripten_set_offscreencanvas_size:Zy,abort:Jy,emscripten_check_blocking_allowed:eb,emscripten_date_now:tb,emscripten_get_heap_max:rb,emscripten_get_now:hc,emscripten_memcpy_big:ob,emscripten_num_logical_cores:nb,emscripten_receive_on_main_thread_js:ab,emscripten_resize_heap:ub,emscripten_unwind_to_js_event_loop:pb,exit:Mm,fd_close:Wm,fd_seek:Um,fd_write:Gm,memory:oe||u.wasmMemory},tk=Oy(),gb=u.___wasm_call_ctors=function(){return(gb=u.___wasm_call_ctors=u.asm.__wasm_call_ctors).apply(null,arguments)},xb=u._init=function(){return(xb=u._init=u.asm.init).apply(null,arguments)},yb=u._init_with_threads_count=function(){return(yb=u._init_with_threads_count=u.asm.init_with_threads_count).apply(null,arguments)},bb=u._get_threads_count=function(){return(bb=u._get_threads_count=u.asm.get_threads_count).apply(null,arguments)},Cb=u._register_tensor=function(){return(Cb=u._register_tensor=u.asm.register_tensor).apply(null,arguments)},wb=u._dispose_data=function(){return(wb=u._dispose_data=u.asm.dispose_data).apply(null,arguments)},Sb=u._dispose=function(){return(Sb=u._dispose=u.asm.dispose).apply(null,arguments)},Ib=u._Abs=function(){return(Ib=u._Abs=u.asm.Abs).apply(null,arguments)},vb=u._Acos=function(){return(vb=u._Acos=u.asm.Acos).apply(null,arguments)},kb=u._Acosh=function(){return(kb=u._Acosh=u.asm.Acosh).apply(null,arguments)},Nb=u._Add=function(){return(Nb=u._Add=u.asm.Add).apply(null,arguments)},Tb=u._AddN=function(){return(Tb=u._AddN=u.asm.AddN).apply(null,arguments)},_b=u._All=function(){return(_b=u._All=u.asm.All).apply(null,arguments)},Eb=u._Any=function(){return(Eb=u._Any=u.asm.Any).apply(null,arguments)},$b=u._ArgMax=function(){return($b=u._ArgMax=u.asm.ArgMax).apply(null,arguments)},Rb=u._ArgMin=function(){return(Rb=u._ArgMin=u.asm.ArgMin).apply(null,arguments)},Db=u._Asin=function(){return(Db=u._Asin=u.asm.Asin).apply(null,arguments)},Ab=u._Asinh=function(){return(Ab=u._Asinh=u.asm.Asinh).apply(null,arguments)},Fb=u._Atan=function(){return(Fb=u._Atan=u.asm.Atan).apply(null,arguments)},Pb=u._Atan2=function(){return(Pb=u._Atan2=u.asm.Atan2).apply(null,arguments)},Ob=u._Atanh=function(){return(Ob=u._Atanh=u.asm.Atanh).apply(null,arguments)},Mb=u._AvgPool=function(){return(Mb=u._AvgPool=u.asm.AvgPool).apply(null,arguments)},Lb=u._AvgPool3D=function(){return(Lb=u._AvgPool3D=u.asm.AvgPool3D).apply(null,arguments)},Bb=u._AvgPool3DGrad=function(){return(Bb=u._AvgPool3DGrad=u.asm.AvgPool3DGrad).apply(null,arguments)},zb=u._AvgPoolGrad=function(){return(zb=u._AvgPoolGrad=u.asm.AvgPoolGrad).apply(null,arguments)},Vb=u._BatchMatMul=function(){return(Vb=u._BatchMatMul=u.asm.BatchMatMul).apply(null,arguments)},Wb=u._Bincount=function(){return(Wb=u._Bincount=u.asm.Bincount).apply(null,arguments)},Ub=u._BitwiseAnd=function(){return(Ub=u._BitwiseAnd=u.asm.BitwiseAnd).apply(null,arguments)},Gb=u._Ceil=function(){return(Gb=u._Ceil=u.asm.Ceil).apply(null,arguments)},Hb=u._ClipByValue=function(){return(Hb=u._ClipByValue=u.asm.ClipByValue).apply(null,arguments)},Kb=u._Conv2D=function(){return(Kb=u._Conv2D=u.asm.Conv2D).apply(null,arguments)},qb=u._Conv2DBackpropInput=function(){return(qb=u._Conv2DBackpropInput=u.asm.Conv2DBackpropInput).apply(null,arguments)},jb=u._Conv3D=function(){return(jb=u._Conv3D=u.asm.Conv3D).apply(null,arguments)},Xb=u._Conv3DBackpropFilterV2=function(){return(Xb=u._Conv3DBackpropFilterV2=u.asm.Conv3DBackpropFilterV2).apply(null,arguments)},Yb=u._Conv3DBackpropInputV2=function(){return(Yb=u._Conv3DBackpropInputV2=u.asm.Conv3DBackpropInputV2).apply(null,arguments)},Qb=u._Cos=function(){return(Qb=u._Cos=u.asm.Cos).apply(null,arguments)},Zb=u._Cosh=function(){return(Zb=u._Cosh=u.asm.Cosh).apply(null,arguments)},Jb=u._CropAndResize=function(){return(Jb=u._CropAndResize=u.asm.CropAndResize).apply(null,arguments)},eC=u._Cumprod=function(){return(eC=u._Cumprod=u.asm.Cumprod).apply(null,arguments)},tC=u._Cumsum=function(){return(tC=u._Cumsum=u.asm.Cumsum).apply(null,arguments)},rC=u._DenseBincount=function(){return(rC=u._DenseBincount=u.asm.DenseBincount).apply(null,arguments)},oC=u._DepthToSpace=function(){return(oC=u._DepthToSpace=u.asm.DepthToSpace).apply(null,arguments)},nC=u._DepthwiseConv2dNative=function(){return(nC=u._DepthwiseConv2dNative=u.asm.DepthwiseConv2dNative).apply(null,arguments)},sC=u._Diag=function(){return(sC=u._Diag=u.asm.Diag).apply(null,arguments)},aC=u._Dilation2D=function(){return(aC=u._Dilation2D=u.asm.Dilation2D).apply(null,arguments)},iC=u._Dilation2DBackpropFilter=function(){return(iC=u._Dilation2DBackpropFilter=u.asm.Dilation2DBackpropFilter).apply(null,arguments)},uC=u._Dilation2DBackpropInput=function(){return(uC=u._Dilation2DBackpropInput=u.asm.Dilation2DBackpropInput).apply(null,arguments)},pC=u._Elu=function(){return(pC=u._Elu=u.asm.Elu).apply(null,arguments)},lC=u._EluGrad=function(){return(lC=u._EluGrad=u.asm.EluGrad).apply(null,arguments)},cC=u._Equal=function(){return(cC=u._Equal=u.asm.Equal).apply(null,arguments)},mC=u._Erf=function(){return(mC=u._Erf=u.asm.Erf).apply(null,arguments)},dC=u._Exp=function(){return(dC=u._Exp=u.asm.Exp).apply(null,arguments)},fC=u._Expm1=function(){return(fC=u._Expm1=u.asm.Expm1).apply(null,arguments)},hC=u._FlipLeftRight=function(){return(hC=u._FlipLeftRight=u.asm.FlipLeftRight).apply(null,arguments)},gC=u._Floor=function(){return(gC=u._Floor=u.asm.Floor).apply(null,arguments)},xC=u._FloorDiv=function(){return(xC=u._FloorDiv=u.asm.FloorDiv).apply(null,arguments)},yC=u._FusedBatchNorm=function(){return(yC=u._FusedBatchNorm=u.asm.FusedBatchNorm).apply(null,arguments)},bC=u._FusedConv2D=function(){return(bC=u._FusedConv2D=u.asm.FusedConv2D).apply(null,arguments)},CC=u._FusedDepthwiseConv2D=function(){return(CC=u._FusedDepthwiseConv2D=u.asm.FusedDepthwiseConv2D).apply(null,arguments)},wC=u._Gather=function(){return(wC=u._Gather=u.asm.Gather).apply(null,arguments)},SC=u._GatherNd=function(){return(SC=u._GatherNd=u.asm.GatherNd).apply(null,arguments)},IC=u._Greater=function(){return(IC=u._Greater=u.asm.Greater).apply(null,arguments)},vC=u._GreaterEqual=function(){return(vC=u._GreaterEqual=u.asm.GreaterEqual).apply(null,arguments)},kC=u._IsFinite=function(){return(kC=u._IsFinite=u.asm.IsFinite).apply(null,arguments)},NC=u._IsInf=function(){return(NC=u._IsInf=u.asm.IsInf).apply(null,arguments)},TC=u._IsNan=function(){return(TC=u._IsNan=u.asm.IsNan).apply(null,arguments)},_C=u._LRN=function(){return(_C=u._LRN=u.asm.LRN).apply(null,arguments)},EC=u._LRNGrad=function(){return(EC=u._LRNGrad=u.asm.LRNGrad).apply(null,arguments)},$C=u._LeakyRelu=function(){return($C=u._LeakyRelu=u.asm.LeakyRelu).apply(null,arguments)},RC=u._Less=function(){return(RC=u._Less=u.asm.Less).apply(null,arguments)},DC=u._LessEqual=function(){return(DC=u._LessEqual=u.asm.LessEqual).apply(null,arguments)},AC=u._LinSpace=function(){return(AC=u._LinSpace=u.asm.LinSpace).apply(null,arguments)},FC=u._Log=function(){return(FC=u._Log=u.asm.Log).apply(null,arguments)},PC=u._Log1p=function(){return(PC=u._Log1p=u.asm.Log1p).apply(null,arguments)},OC=u._LogicalAnd=function(){return(OC=u._LogicalAnd=u.asm.LogicalAnd).apply(null,arguments)},MC=u._LogicalNot=function(){return(MC=u._LogicalNot=u.asm.LogicalNot).apply(null,arguments)},LC=u._LogicalOr=function(){return(LC=u._LogicalOr=u.asm.LogicalOr).apply(null,arguments)},BC=u._LogicalXor=function(){return(BC=u._LogicalXor=u.asm.LogicalXor).apply(null,arguments)},zC=u._Max=function(){return(zC=u._Max=u.asm.Max).apply(null,arguments)},VC=u._MaxPool=function(){return(VC=u._MaxPool=u.asm.MaxPool).apply(null,arguments)},WC=u._MaxPool3D=function(){return(WC=u._MaxPool3D=u.asm.MaxPool3D).apply(null,arguments)},UC=u._MaxPool3DGrad=function(){return(UC=u._MaxPool3DGrad=u.asm.MaxPool3DGrad).apply(null,arguments)},GC=u._MaxPoolGrad=function(){return(GC=u._MaxPoolGrad=u.asm.MaxPoolGrad).apply(null,arguments)},HC=u._MaxPoolWithArgmax=function(){return(HC=u._MaxPoolWithArgmax=u.asm.MaxPoolWithArgmax).apply(null,arguments)},KC=u._Maximum=function(){return(KC=u._Maximum=u.asm.Maximum).apply(null,arguments)},qC=u._Mean=function(){return(qC=u._Mean=u.asm.Mean).apply(null,arguments)},jC=u._Min=function(){return(jC=u._Min=u.asm.Min).apply(null,arguments)},XC=u._Minimum=function(){return(XC=u._Minimum=u.asm.Minimum).apply(null,arguments)},YC=u._MirrorPad=function(){return(YC=u._MirrorPad=u.asm.MirrorPad).apply(null,arguments)},QC=u._Mod=function(){return(QC=u._Mod=u.asm.Mod).apply(null,arguments)},ZC=u._Multinomial=function(){return(ZC=u._Multinomial=u.asm.Multinomial).apply(null,arguments)},JC=u._Multiply=function(){return(JC=u._Multiply=u.asm.Multiply).apply(null,arguments)},ew=u._Neg=function(){return(ew=u._Neg=u.asm.Neg).apply(null,arguments)},tw=u._NonMaxSuppressionV3=function(){return(tw=u._NonMaxSuppressionV3=u.asm.NonMaxSuppressionV3).apply(null,arguments)},rw=u._NonMaxSuppressionV4=function(){return(rw=u._NonMaxSuppressionV4=u.asm.NonMaxSuppressionV4).apply(null,arguments)},qm=u._NonMaxSuppressionV5=function(){return(qm=u._NonMaxSuppressionV5=u.asm.NonMaxSuppressionV5).apply(null,arguments)},jm=u._NotEqual=function(){return(jm=u._NotEqual=u.asm.NotEqual).apply(null,arguments)},xc=u._OneHot=function(){return(xc=u._OneHot=u.asm.OneHot).apply(null,arguments)},ow=u._PadV2=function(){return(ow=u._PadV2=u.asm.PadV2).apply(null,arguments)},nw=u._Pow=function(){return(nw=u._Pow=u.asm.Pow).apply(null,arguments)},Wp=u._Prelu=function(){return(Wp=u._Prelu=u.asm.Prelu).apply(null,arguments)},Xm=u._Prod=function(){return(Xm=u._Prod=u.asm.Prod).apply(null,arguments)},Up=u._RealDiv=function(){return(Up=u._RealDiv=u.asm.RealDiv).apply(null,arguments)},Gp=u._Reciprocal=function(){return(Gp=u._Reciprocal=u.asm.Reciprocal).apply(null,arguments)},sw=u._Relu=function(){return(sw=u._Relu=u.asm.Relu).apply(null,arguments)},K=u._Relu6=function(){return(K=u._Relu6=u.asm.Relu6).apply(null,arguments)},ae=u._ResizeBilinear=function(){return(ae=u._ResizeBilinear=u.asm.ResizeBilinear).apply(null,arguments)},Ee=u._ResizeBilinearGrad=function(){return(Ee=u._ResizeBilinearGrad=u.asm.ResizeBilinearGrad).apply(null,arguments)},it=u._ResizeNearestNeighbor=function(){return(it=u._ResizeNearestNeighbor=u.asm.ResizeNearestNeighbor).apply(null,arguments)},$t=u._ResizeNearestNeighborGrad=function(){return($t=u._ResizeNearestNeighborGrad=u.asm.ResizeNearestNeighborGrad).apply(null,arguments)},Rt=u._Reverse=function(){return(Rt=u._Reverse=u.asm.Reverse).apply(null,arguments)},Ze=u._RotateWithOffset=function(){return(Ze=u._RotateWithOffset=u.asm.RotateWithOffset).apply(null,arguments)},je=u._Round=function(){return(je=u._Round=u.asm.Round).apply(null,arguments)},Ht=u._Rsqrt=function(){return(Ht=u._Rsqrt=u.asm.Rsqrt).apply(null,arguments)},lo=u._ScatterNd=function(){return(lo=u._ScatterNd=u.asm.ScatterNd).apply(null,arguments)},Qa=u._SearchSorted=function(){return(Qa=u._SearchSorted=u.asm.SearchSorted).apply(null,arguments)},Ym=u._SelectV2=function(){return(Ym=u._SelectV2=u.asm.SelectV2).apply(null,arguments)},yc=u._Selu=function(){return(yc=u._Selu=u.asm.Selu).apply(null,arguments)},aw=u._Sigmoid=function(){return(aw=u._Sigmoid=u.asm.Sigmoid).apply(null,arguments)},wr=u._Sign=function(){return(wr=u._Sign=u.asm.Sign).apply(null,arguments)},Mi=u._Sin=function(){return(Mi=u._Sin=u.asm.Sin).apply(null,arguments)},Qm=u._Sinh=function(){return(Qm=u._Sinh=u.asm.Sinh).apply(null,arguments)},f4=u._Softmax=function(){return(f4=u._Softmax=u.asm.Softmax).apply(null,arguments)},h4=u._Softplus=function(){return(h4=u._Softplus=u.asm.Softplus).apply(null,arguments)},g4=u._SparseFillEmptyRows=function(){return(g4=u._SparseFillEmptyRows=u.asm.SparseFillEmptyRows).apply(null,arguments)},x4=u._SparseReshape=function(){return(x4=u._SparseReshape=u.asm.SparseReshape).apply(null,arguments)},y4=u._SparseSegmentReduction=function(){return(y4=u._SparseSegmentReduction=u.asm.SparseSegmentReduction).apply(null,arguments)},b4=u._SparseToDense=function(){return(b4=u._SparseToDense=u.asm.SparseToDense).apply(null,arguments)},C4=u._Sqrt=function(){return(C4=u._Sqrt=u.asm.Sqrt).apply(null,arguments)},w4=u._Square=function(){return(w4=u._Square=u.asm.Square).apply(null,arguments)},S4=u._SquaredDifference=function(){return(S4=u._SquaredDifference=u.asm.SquaredDifference).apply(null,arguments)},I4=u._Step=function(){return(I4=u._Step=u.asm.Step).apply(null,arguments)},v4=u._StridedSlice=function(){return(v4=u._StridedSlice=u.asm.StridedSlice).apply(null,arguments)},k4=u._Sub=function(){return(k4=u._Sub=u.asm.Sub).apply(null,arguments)},N4=u._Sum=function(){return(N4=u._Sum=u.asm.Sum).apply(null,arguments)},T4=u._Tan=function(){return(T4=u._Tan=u.asm.Tan).apply(null,arguments)},_4=u._Tanh=function(){return(_4=u._Tanh=u.asm.Tanh).apply(null,arguments)},E4=u._TensorScatterUpdate=function(){return(E4=u._TensorScatterUpdate=u.asm.TensorScatterUpdate).apply(null,arguments)},$4=u._Tile=function(){return($4=u._Tile=u.asm.Tile).apply(null,arguments)},R4=u._TopK=function(){return(R4=u._TopK=u.asm.TopK).apply(null,arguments)},D4=u._Transform=function(){return(D4=u._Transform=u.asm.Transform).apply(null,arguments)},A4=u._Transpose=function(){return(A4=u._Transpose=u.asm.Transpose).apply(null,arguments)},F4=u.__FusedMatMul=function(){return(F4=u.__FusedMatMul=u.asm._FusedMatMul).apply(null,arguments)},P4=u._malloc=function(){return(P4=u._malloc=u.asm.malloc).apply(null,arguments)},O4=u._free=function(){return(O4=u._free=u.asm.free).apply(null,arguments)},M4=u.__emscripten_tls_init=function(){return(M4=u.__emscripten_tls_init=u.asm._emscripten_tls_init).apply(null,arguments)},Zm=u._pthread_self=function(){return(Zm=u._pthread_self=u.asm.pthread_self).apply(null,arguments)},L4=u.___errno_location=function(){return(L4=u.___errno_location=u.asm.__errno_location).apply(null,arguments)},rk=u.__emscripten_thread_init=function(){return(rk=u.__emscripten_thread_init=u.asm._emscripten_thread_init).apply(null,arguments)},B4=u.__emscripten_thread_crashed=function(){return(B4=u.__emscripten_thread_crashed=u.asm._emscripten_thread_crashed).apply(null,arguments)},z4=u._emscripten_main_thread_process_queued_calls=function(){return(z4=u._emscripten_main_thread_process_queued_calls=u.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},V4=u._emscripten_main_browser_thread_id=function(){return(V4=u._emscripten_main_browser_thread_id=u.asm.emscripten_main_browser_thread_id).apply(null,arguments)},ok=u._emscripten_run_in_main_runtime_thread_js=function(){return(ok=u._emscripten_run_in_main_runtime_thread_js=u.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)},W4=u._emscripten_dispatch_to_thread_=function(){return(W4=u._emscripten_dispatch_to_thread_=u.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},nk=u.__emscripten_proxy_execute_task_queue=function(){return(nk=u.__emscripten_proxy_execute_task_queue=u.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)},iw=u.__emscripten_thread_free_data=function(){return(iw=u.__emscripten_thread_free_data=u.asm._emscripten_thread_free_data).apply(null,arguments)},sk=u.__emscripten_thread_exit=function(){return(sk=u.__emscripten_thread_exit=u.asm._emscripten_thread_exit).apply(null,arguments)},ak=u._emscripten_stack_set_limits=function(){return(ak=u._emscripten_stack_set_limits=u.asm.emscripten_stack_set_limits).apply(null,arguments)},uw=u.stackSave=function(){return(uw=u.stackSave=u.asm.stackSave).apply(null,arguments)},Jm=u.stackRestore=function(){return(Jm=u.stackRestore=u.asm.stackRestore).apply(null,arguments)},ed=u.stackAlloc=function(){return(ed=u.stackAlloc=u.asm.stackAlloc).apply(null,arguments)},U4=u.dynCall_iijjiiii=function(){return(U4=u.dynCall_iijjiiii=u.asm.dynCall_iijjiiii).apply(null,arguments)},G4=u.dynCall_jiji=function(){return(G4=u.dynCall_jiji=u.asm.dynCall_jiji).apply(null,arguments)};u.keepRuntimeAlive=cn,u.wasmMemory=oe,u.cwrap=fb,u.ExitStatus=Du,u.PThread=Me;var td;Ya=function P(){td||ik(),td||(Ya=P)};function ik(P){if(P=P||f,Pi>0)return;if(S){l(u),Zt(),startWorker(u);return}if(ta(),Pi>0)return;function V(){td||(td=!0,u.calledRun=!0,!me&&(Zt(),l(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Xa()))}u.setStatus?(u.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){u.setStatus(\"\")},1),V()},1)):V()}if(u.preInit)for(typeof u.preInit==\"function\"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();ik();var rd;m&&(rd={uncaughtException:process.listeners(\"uncaughtException\").filter(function(P){return!m.uncaughtException.indexOf(P)>-1}),unhandledRejection:process.listeners(\"unhandledRejection\").filter(function(P){return!m.unhandledRejection.indexOf(P)>-1})});var od;if(typeof WasmBackendModule!=\"undefined\")od=WasmBackendModule;else if(typeof e!=\"undefined\")od=e;else throw new Error(\"Could not find wasm module in post.js\");if(rd){var H4=od._dispose;od._dispose=function(){H4(),rd.uncaughtException.forEach(function(P){process.removeListener(\"uncaughtException\",P)}),rd.unhandledRejection.forEach(function(P){process.removeListener(\"unhandledRejection\",P)})}}return e.ready}})();typeof Jg==\"object\"&&typeof ov==\"object\"?ov.exports=rv:typeof define==\"function\"&&define.amd?define([],function(){return rv}):typeof Jg==\"object\"&&(Jg.WasmBackendModuleThreadedSimd=rv)});var _z=jt((EPt,Tz)=>{Tz.exports.wasmWorkerContents=`\"use strict\";var Module={};var ENVIRONMENT_IS_NODE=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require(\"worker_threads\");var parentPort=nodeWorkerThreads.parentPort;parentPort.on(\"message\",data=>onmessage({data:data}));var fs=require(\"fs\");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,\"utf8\")+\"//# sourceURL=\"+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(\" \");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+\"\n\");return}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;self.alert=threadAlert;Module[\"instantiateWasm\"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module[\"wasmModule\"],info);receiveInstance(instance);Module[\"wasmModule\"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({\"cmd\":\"loaded\"})};self.onmessage=e=>{try{if(e.data.cmd===\"load\"){Module[\"wasmModule\"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:\"callHandler\",handler:handler,args:[...arguments]})}}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)}else if(e.data.cmd===\"run\"){Module[\"__emscripten_thread_init\"](e.data.pthread_ptr,0,0,1);Module[\"establishStackSpace\"]();Module[\"PThread\"].receiveObjectTransfer(e.data);Module[\"PThread\"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module[\"executeNotifiedProxyingQueue\"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module[\"invokeEntryPoint\"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!=\"unwind\"){if(ex instanceof Module[\"ExitStatus\"]){if(Module[\"keepRuntimeAlive\"]()){}else{Module[\"__emscripten_thread_exit\"](ex.status)}}else{throw ex}}}}else if(e.data.cmd===\"cancel\"){if(Module[\"_pthread_self\"]()){Module[\"__emscripten_thread_exit\"](-1)}}else if(e.data.target===\"setimmediate\"){}else if(e.data.cmd===\"processProxyingQueue\"){if(initializedJS){Module[\"executeNotifiedProxyingQueue\"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err(\"worker.js received unknown command \"+e.data.cmd);err(e.data)}}catch(ex){if(Module[\"__emscripten_thread_crashed\"]){Module[\"__emscripten_thread_crashed\"]()}throw ex}};`});var Ez=jt((ex,sv)=>{var nv=(()=>{var r=typeof document!=\"undefined\"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!=\"undefined\"&&(r=r||__filename),function(e){e=e||{};var t=typeof e!=\"undefined\"?e:{},o,n;t.ready=new Promise(function(K,ae){o=K,n=ae});var s;typeof process!=\"undefined\"&&process.listeners&&(s={uncaughtException:process.listeners(\"uncaughtException\"),unhandledRejection:process.listeners(\"unhandledRejection\")});var a=Object.assign({},t),i=[],p=\"./this.program\",u=(K,ae)=>{throw ae},l=typeof window==\"object\",c=typeof importScripts==\"function\",m=typeof process==\"object\"&&typeof process.versions==\"object\"&&typeof process.versions.node==\"string\",d=\"\";function f(K){return t.locateFile?t.locateFile(K,d):d+K}var h,g,x,b;function w(K){if(K instanceof Bp)return;E(\"exiting due to exception: \"+K)}if(m){var S=ev(),k=tv();c?d=k.dirname(d)+\"/\":d=__dirname+\"/\",h=(K,ae)=>(K=ta(K)?new URL(K):k.normalize(K),S.readFileSync(K,ae?void 0:\"utf8\")),x=K=>{var ae=h(K,!0);return ae.buffer||(ae=new Uint8Array(ae)),ae},g=(K,ae,Ee)=>{K=ta(K)?new URL(K):k.normalize(K),S.readFile(K,function(it,$t){it?Ee(it):ae($t.buffer)})},process.argv.length>1&&(p=process.argv[1].replace(/\\\\/g,\"/\")),i=process.argv.slice(2),process.on(\"uncaughtException\",function(K){if(!(K instanceof Bp))throw K}),process.on(\"unhandledRejection\",function(K){throw K}),u=(K,ae)=>{if(ut())throw process.exitCode=K,ae;w(ae),process.exit(K)},t.inspect=function(){return\"[Emscripten Module object]\"}}else(l||c)&&(c?d=self.location.href:typeof document!=\"undefined\"&&document.currentScript&&(d=document.currentScript.src),r&&(d=r),d.indexOf(\"blob:\")!==0?d=d.substr(0,d.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1):d=\"\",h=K=>{var ae=new XMLHttpRequest;return ae.open(\"GET\",K,!1),ae.send(null),ae.responseText},c&&(x=K=>{var ae=new XMLHttpRequest;return ae.open(\"GET\",K,!1),ae.responseType=\"arraybuffer\",ae.send(null),new Uint8Array(ae.response)}),g=(K,ae,Ee)=>{var it=new XMLHttpRequest;it.open(\"GET\",K,!0),it.responseType=\"arraybuffer\",it.onload=()=>{if(it.status==200||it.status==0&&it.response){ae(it.response);return}Ee()},it.onerror=Ee,it.send(null)},b=K=>document.title=K);var T=t.print||console.log.bind(console),E=t.printErr||console.warn.bind(console);Object.assign(t,a),a=null,t.arguments&&(i=t.arguments),t.thisProgram&&(p=t.thisProgram),t.quit&&(u=t.quit);var R=4,D;t.wasmBinary&&(D=t.wasmBinary);var F=t.noExitRuntime||!0;typeof WebAssembly!=\"object\"&&xr(\"no native wasm support detected\");var O,M=!1,L;function B(K,ae){K||xr(ae)}var z=typeof TextDecoder!=\"undefined\"?new TextDecoder(\"utf8\"):void 0;function U(K,ae,Ee){ae>>>=0;for(var it=ae+Ee,$t=ae;K[$t]&&!($t>=it);)++$t;if($t-ae>16&&K.buffer&&z)return z.decode(K.subarray(ae,$t));for(var Rt=\"\";ae<$t;){var Ze=K[ae++];if(!(Ze&128)){Rt+=String.fromCharCode(Ze);continue}var je=K[ae++]&63;if((Ze&224)==192){Rt+=String.fromCharCode((Ze&31)<<6|je);continue}var Ht=K[ae++]&63;if((Ze&240)==224?Ze=(Ze&15)<<12|je<<6|Ht:Ze=(Ze&7)<<18|je<<12|Ht<<6|K[ae++]&63,Ze<65536)Rt+=String.fromCharCode(Ze);else{var lo=Ze-65536;Rt+=String.fromCharCode(55296|lo>>10,56320|lo&1023)}}return Rt}function j(K,ae){return K>>>=0,K?U(ne,K,ae):\"\"}function q(K,ae,Ee,it){if(Ee>>>=0,!(it>0))return 0;for(var $t=Ee,Rt=Ee+it-1,Ze=0;Ze=55296&&je<=57343){var Ht=K.charCodeAt(++Ze);je=65536+((je&1023)<<10)|Ht&1023}if(je<=127){if(Ee>=Rt)break;ae[Ee++>>>0]=je}else if(je<=2047){if(Ee+1>=Rt)break;ae[Ee++>>>0]=192|je>>6,ae[Ee++>>>0]=128|je&63}else if(je<=65535){if(Ee+2>=Rt)break;ae[Ee++>>>0]=224|je>>12,ae[Ee++>>>0]=128|je>>6&63,ae[Ee++>>>0]=128|je&63}else{if(Ee+3>=Rt)break;ae[Ee++>>>0]=240|je>>18,ae[Ee++>>>0]=128|je>>12&63,ae[Ee++>>>0]=128|je>>6&63,ae[Ee++>>>0]=128|je&63}}return ae[Ee>>>0]=0,Ee-$t}function Y(K,ae,Ee){return q(K,ne,ae,Ee)}var J,re,ne,ee,oe,ue,me,be,_e;function ve(K){J=K,t.HEAP8=re=new Int8Array(K),t.HEAP16=ee=new Int16Array(K),t.HEAP32=ue=new Int32Array(K),t.HEAPU8=ne=new Uint8Array(K),t.HEAPU16=oe=new Uint16Array(K),t.HEAPU32=me=new Uint32Array(K),t.HEAPF32=be=new Float32Array(K),t.HEAPF64=_e=new Float64Array(K)}var Fe=t.INITIAL_MEMORY||16777216,Pe,at=[],ct=[],Ke=[],mt=!1;function ut(){return F}function gt(){if(t.preRun)for(typeof t.preRun==\"function\"&&(t.preRun=[t.preRun]);t.preRun.length;)Bt(t.preRun.shift());Ya(at)}function xt(){mt=!0,Ya(ct)}function Ur(){if(t.postRun)for(typeof t.postRun==\"function\"&&(t.postRun=[t.postRun]);t.postRun.length;)sr(t.postRun.shift());Ya(Ke)}function Bt(K){at.unshift(K)}function io(K){ct.unshift(K)}function sr(K){Ke.unshift(K)}var Et=0,ar=null,ir=null;function uo(K){Et++,t.monitorRunDependencies&&t.monitorRunDependencies(Et)}function po(K){if(Et--,t.monitorRunDependencies&&t.monitorRunDependencies(Et),Et==0&&(ar!==null&&(clearInterval(ar),ar=null),ir)){var ae=ir;ir=null,ae()}}function xr(K){t.onAbort&&t.onAbort(K),K=\"Aborted(\"+K+\")\",E(K),M=!0,L=1,K+=\". Build with -sASSERTIONS for more info.\";var ae=new WebAssembly.RuntimeError(K);throw n(ae),ae}var ja=\"data:application/octet-stream;base64,\";function cn(K){return K.startsWith(ja)}function ta(K){return K.startsWith(\"file://\")}var Zt;Zt=\"tfjs-backend-wasm.wasm\",cn(Zt)||(Zt=f(Zt));function Xa(K){try{if(K==Zt&&D)return new Uint8Array(D);if(x)return x(K);throw\"both async and sync fetching of the wasm failed\"}catch(ae){xr(ae)}}function lc(){if(!D&&(l||c)){if(typeof fetch==\"function\"&&!ta(Zt))return fetch(Zt,{credentials:\"same-origin\"}).then(function(K){if(!K.ok)throw\"failed to load wasm binary file at '\"+Zt+\"'\";return K.arrayBuffer()}).catch(function(){return Xa(Zt)});if(g)return new Promise(function(K,ae){g(Zt,function(Ee){K(new Uint8Array(Ee))},ae)})}return Promise.resolve().then(function(){return Xa(Zt)})}function cc(){var K={env:mc,wasi_snapshot_preview1:mc};function ae(Ze,je){var Ht=Ze.exports;t.asm=Ht,O=t.asm.memory,ve(O.buffer),Pe=t.asm.__indirect_function_table,io(t.asm.__wasm_call_ctors),po(\"wasm-instantiate\")}uo(\"wasm-instantiate\");function Ee(Ze){ae(Ze.instance)}function it(Ze){return lc().then(function(je){return WebAssembly.instantiate(je,K)}).then(function(je){return je}).then(Ze,function(je){E(\"failed to asynchronously prepare wasm: \"+je),xr(je)})}function $t(){return!D&&typeof WebAssembly.instantiateStreaming==\"function\"&&!cn(Zt)&&!ta(Zt)&&!m&&typeof fetch==\"function\"?fetch(Zt,{credentials:\"same-origin\"}).then(function(Ze){var je=WebAssembly.instantiateStreaming(Ze,K);return je.then(Ee,function(Ht){return E(\"wasm streaming compile failed: \"+Ht),E(\"falling back to ArrayBuffer instantiation\"),it(Ee)})}):it(Ee)}if(t.instantiateWasm)try{var Rt=t.instantiateWasm(K,ae);return Rt}catch(Ze){E(\"Module.instantiateWasm callback failed with error: \"+Ze),n(Ze)}return $t().catch(n),{}}var Zv,Pi;function Bp(K){this.name=\"ExitStatus\",this.message=\"Program terminated with exit(\"+K+\")\",this.status=K}function Ya(K){for(;K.length>0;)K.shift()(t)}function Ay(){xr(\"\")}function Rm(){return 4294901760}function Ru(){return Rm()}function Fy(K,ae,Ee){ne.copyWithin(K>>>0,ae>>>0,ae+Ee>>>0)}function Dm(K){try{return O.grow(K-J.byteLength+65535>>>16),ve(O.buffer),1}catch(ae){}}function zp(K){var ae=ne.length;K=K>>>0;var Ee=Rm();if(K>Ee)return!1;let it=(Ht,lo)=>Ht+(lo-Ht%lo)%lo;for(var $t=1;$t<=4;$t*=2){var Rt=ae*(1+.2/$t);Rt=Math.min(Rt,K+100663296);var Ze=Math.min(Ee,it(Math.max(K,Rt),65536)),je=Dm(Ze);if(je)return!0}return!1}var yr={varargs:void 0,get:function(){yr.varargs+=4;var K=ue[yr.varargs-4>>>2];return K},getStr:function(K){var ae=j(K);return ae}};function Am(K){return 52}function Py(K,ae,Ee,it,$t){return 70}var Oy=[null,[],[]];function Jv(K,ae){var Ee=Oy[K];ae===0||ae===10?((K===1?T:E)(U(Ee,0)),Ee.length=0):Ee.push(ae)}function ek(K,ae,Ee,it){for(var $t=0,Rt=0;Rt>>2],je=me[ae+4>>>2];ae+=8;for(var Ht=0;Ht>>0]);$t+=je}return me[it>>>2]=$t,0}function Fm(K){var ae=t[\"_\"+K];return ae}function Du(K,ae){re.set(K,ae>>>0)}function My(K,ae,Ee,it,$t){var Rt={string:wr=>{var Mi=0;if(wr!=null&&wr!==0){var Qm=(wr.length<<2)+1;Mi=xc(Qm),Y(wr,Mi,Qm)}return Mi},array:wr=>{var Mi=xc(wr.length);return Du(wr,Mi),Mi}};function Ze(wr){return ae===\"string\"?j(wr):ae===\"boolean\"?!!wr:wr}var je=Fm(K),Ht=[],lo=0;if(it)for(var Qa=0;QaZe===\"number\"||Ze===\"boolean\"),Rt=ae!==\"string\";return Rt&&$t&&!it?Fm(K):function(){return My(K,ae,Ee,arguments,it)}}var mc={abort:Ay,emscripten_get_heap_max:Ru,emscripten_memcpy_big:Fy,emscripten_resize_heap:zp,fd_close:Am,fd_seek:Py,fd_write:ek},By=cc(),Pm=t.___wasm_call_ctors=function(){return(Pm=t.___wasm_call_ctors=t.asm.__wasm_call_ctors).apply(null,arguments)},Om=t._init=function(){return(Om=t._init=t.asm.init).apply(null,arguments)},zy=t._init_with_threads_count=function(){return(zy=t._init_with_threads_count=t.asm.init_with_threads_count).apply(null,arguments)},Mm=t._get_threads_count=function(){return(Mm=t._get_threads_count=t.asm.get_threads_count).apply(null,arguments)},Vy=t._register_tensor=function(){return(Vy=t._register_tensor=t.asm.register_tensor).apply(null,arguments)},Me=t._dispose_data=function(){return(Me=t._dispose_data=t.asm.dispose_data).apply(null,arguments)},dc=t._dispose=function(){return(dc=t._dispose=t.asm.dispose).apply(null,arguments)},Wy=t._Abs=function(){return(Wy=t._Abs=t.asm.Abs).apply(null,arguments)},Lm=t._Acos=function(){return(Lm=t._Acos=t.asm.Acos).apply(null,arguments)},Vp=t._Acosh=function(){return(Vp=t._Acosh=t.asm.Acosh).apply(null,arguments)},Uy=t._Add=function(){return(Uy=t._Add=t.asm.Add).apply(null,arguments)},Gy=t._AddN=function(){return(Gy=t._AddN=t.asm.AddN).apply(null,arguments)},Hy=t._All=function(){return(Hy=t._All=t.asm.All).apply(null,arguments)},Ky=t._Any=function(){return(Ky=t._Any=t.asm.Any).apply(null,arguments)},qy=t._ArgMax=function(){return(qy=t._ArgMax=t.asm.ArgMax).apply(null,arguments)},Bm=t._ArgMin=function(){return(Bm=t._ArgMin=t.asm.ArgMin).apply(null,arguments)},zm=t._Asin=function(){return(zm=t._Asin=t.asm.Asin).apply(null,arguments)},jy=t._Asinh=function(){return(jy=t._Asinh=t.asm.Asinh).apply(null,arguments)},Xy=t._Atan=function(){return(Xy=t._Atan=t.asm.Atan).apply(null,arguments)},Yy=t._Atan2=function(){return(Yy=t._Atan2=t.asm.Atan2).apply(null,arguments)},fc=t._Atanh=function(){return(fc=t._Atanh=t.asm.Atanh).apply(null,arguments)},Qy=t._AvgPool=function(){return(Qy=t._AvgPool=t.asm.AvgPool).apply(null,arguments)},Zy=t._AvgPool3D=function(){return(Zy=t._AvgPool3D=t.asm.AvgPool3D).apply(null,arguments)},Jy=t._AvgPool3DGrad=function(){return(Jy=t._AvgPool3DGrad=t.asm.AvgPool3DGrad).apply(null,arguments)},Au=t._AvgPoolGrad=function(){return(Au=t._AvgPoolGrad=t.asm.AvgPoolGrad).apply(null,arguments)},eb=t._BatchMatMul=function(){return(eb=t._BatchMatMul=t.asm.BatchMatMul).apply(null,arguments)},tb=t._Bincount=function(){return(tb=t._Bincount=t.asm.Bincount).apply(null,arguments)},Vm=t._BitwiseAnd=function(){return(Vm=t._BitwiseAnd=t.asm.BitwiseAnd).apply(null,arguments)},rb=t._Ceil=function(){return(rb=t._Ceil=t.asm.Ceil).apply(null,arguments)},hc=t._ClipByValue=function(){return(hc=t._ClipByValue=t.asm.ClipByValue).apply(null,arguments)},ob=t._Conv2D=function(){return(ob=t._Conv2D=t.asm.Conv2D).apply(null,arguments)},nb=t._Conv2DBackpropInput=function(){return(nb=t._Conv2DBackpropInput=t.asm.Conv2DBackpropInput).apply(null,arguments)},sb=t._Conv3D=function(){return(sb=t._Conv3D=t.asm.Conv3D).apply(null,arguments)},Oi=t._Conv3DBackpropFilterV2=function(){return(Oi=t._Conv3DBackpropFilterV2=t.asm.Conv3DBackpropFilterV2).apply(null,arguments)},gc=t._Conv3DBackpropInputV2=function(){return(gc=t._Conv3DBackpropInputV2=t.asm.Conv3DBackpropInputV2).apply(null,arguments)},ab=t._Cos=function(){return(ab=t._Cos=t.asm.Cos).apply(null,arguments)},ib=t._Cosh=function(){return(ib=t._Cosh=t.asm.Cosh).apply(null,arguments)},ub=t._CropAndResize=function(){return(ub=t._CropAndResize=t.asm.CropAndResize).apply(null,arguments)},pb=t._Cumprod=function(){return(pb=t._Cumprod=t.asm.Cumprod).apply(null,arguments)},Wm=t._Cumsum=function(){return(Wm=t._Cumsum=t.asm.Cumsum).apply(null,arguments)},Um=t._DenseBincount=function(){return(Um=t._DenseBincount=t.asm.DenseBincount).apply(null,arguments)},lb=t._DepthToSpace=function(){return(lb=t._DepthToSpace=t.asm.DepthToSpace).apply(null,arguments)},cb=t._DepthwiseConv2dNative=function(){return(cb=t._DepthwiseConv2dNative=t.asm.DepthwiseConv2dNative).apply(null,arguments)},Gm=t._Diag=function(){return(Gm=t._Diag=t.asm.Diag).apply(null,arguments)},Hm=t._Dilation2D=function(){return(Hm=t._Dilation2D=t.asm.Dilation2D).apply(null,arguments)},mb=t._Dilation2DBackpropFilter=function(){return(mb=t._Dilation2DBackpropFilter=t.asm.Dilation2DBackpropFilter).apply(null,arguments)},db=t._Dilation2DBackpropInput=function(){return(db=t._Dilation2DBackpropInput=t.asm.Dilation2DBackpropInput).apply(null,arguments)},fb=t._Elu=function(){return(fb=t._Elu=t.asm.Elu).apply(null,arguments)},hb=t._EluGrad=function(){return(hb=t._EluGrad=t.asm.EluGrad).apply(null,arguments)},Km=t._Equal=function(){return(Km=t._Equal=t.asm.Equal).apply(null,arguments)},tk=t._Erf=function(){return(tk=t._Erf=t.asm.Erf).apply(null,arguments)},gb=t._Exp=function(){return(gb=t._Exp=t.asm.Exp).apply(null,arguments)},xb=t._Expm1=function(){return(xb=t._Expm1=t.asm.Expm1).apply(null,arguments)},yb=t._FlipLeftRight=function(){return(yb=t._FlipLeftRight=t.asm.FlipLeftRight).apply(null,arguments)},bb=t._Floor=function(){return(bb=t._Floor=t.asm.Floor).apply(null,arguments)},Cb=t._FloorDiv=function(){return(Cb=t._FloorDiv=t.asm.FloorDiv).apply(null,arguments)},wb=t._FusedBatchNorm=function(){return(wb=t._FusedBatchNorm=t.asm.FusedBatchNorm).apply(null,arguments)},Sb=t._FusedConv2D=function(){return(Sb=t._FusedConv2D=t.asm.FusedConv2D).apply(null,arguments)},Ib=t._FusedDepthwiseConv2D=function(){return(Ib=t._FusedDepthwiseConv2D=t.asm.FusedDepthwiseConv2D).apply(null,arguments)},vb=t._Gather=function(){return(vb=t._Gather=t.asm.Gather).apply(null,arguments)},kb=t._GatherNd=function(){return(kb=t._GatherNd=t.asm.GatherNd).apply(null,arguments)},Nb=t._Greater=function(){return(Nb=t._Greater=t.asm.Greater).apply(null,arguments)},Tb=t._GreaterEqual=function(){return(Tb=t._GreaterEqual=t.asm.GreaterEqual).apply(null,arguments)},_b=t._IsFinite=function(){return(_b=t._IsFinite=t.asm.IsFinite).apply(null,arguments)},Eb=t._IsInf=function(){return(Eb=t._IsInf=t.asm.IsInf).apply(null,arguments)},$b=t._IsNan=function(){return($b=t._IsNan=t.asm.IsNan).apply(null,arguments)},Rb=t._LRN=function(){return(Rb=t._LRN=t.asm.LRN).apply(null,arguments)},Db=t._LRNGrad=function(){return(Db=t._LRNGrad=t.asm.LRNGrad).apply(null,arguments)},Ab=t._LeakyRelu=function(){return(Ab=t._LeakyRelu=t.asm.LeakyRelu).apply(null,arguments)},Fb=t._Less=function(){return(Fb=t._Less=t.asm.Less).apply(null,arguments)},Pb=t._LessEqual=function(){return(Pb=t._LessEqual=t.asm.LessEqual).apply(null,arguments)},Ob=t._LinSpace=function(){return(Ob=t._LinSpace=t.asm.LinSpace).apply(null,arguments)},Mb=t._Log=function(){return(Mb=t._Log=t.asm.Log).apply(null,arguments)},Lb=t._Log1p=function(){return(Lb=t._Log1p=t.asm.Log1p).apply(null,arguments)},Bb=t._LogicalAnd=function(){return(Bb=t._LogicalAnd=t.asm.LogicalAnd).apply(null,arguments)},zb=t._LogicalNot=function(){return(zb=t._LogicalNot=t.asm.LogicalNot).apply(null,arguments)},Vb=t._LogicalOr=function(){return(Vb=t._LogicalOr=t.asm.LogicalOr).apply(null,arguments)},Wb=t._LogicalXor=function(){return(Wb=t._LogicalXor=t.asm.LogicalXor).apply(null,arguments)},Ub=t._Max=function(){return(Ub=t._Max=t.asm.Max).apply(null,arguments)},Gb=t._MaxPool=function(){return(Gb=t._MaxPool=t.asm.MaxPool).apply(null,arguments)},Hb=t._MaxPool3D=function(){return(Hb=t._MaxPool3D=t.asm.MaxPool3D).apply(null,arguments)},Kb=t._MaxPool3DGrad=function(){return(Kb=t._MaxPool3DGrad=t.asm.MaxPool3DGrad).apply(null,arguments)},qb=t._MaxPoolGrad=function(){return(qb=t._MaxPoolGrad=t.asm.MaxPoolGrad).apply(null,arguments)},jb=t._MaxPoolWithArgmax=function(){return(jb=t._MaxPoolWithArgmax=t.asm.MaxPoolWithArgmax).apply(null,arguments)},Xb=t._Maximum=function(){return(Xb=t._Maximum=t.asm.Maximum).apply(null,arguments)},Yb=t._Mean=function(){return(Yb=t._Mean=t.asm.Mean).apply(null,arguments)},Qb=t._Min=function(){return(Qb=t._Min=t.asm.Min).apply(null,arguments)},Zb=t._Minimum=function(){return(Zb=t._Minimum=t.asm.Minimum).apply(null,arguments)},Jb=t._MirrorPad=function(){return(Jb=t._MirrorPad=t.asm.MirrorPad).apply(null,arguments)},eC=t._Mod=function(){return(eC=t._Mod=t.asm.Mod).apply(null,arguments)},tC=t._Multinomial=function(){return(tC=t._Multinomial=t.asm.Multinomial).apply(null,arguments)},rC=t._Multiply=function(){return(rC=t._Multiply=t.asm.Multiply).apply(null,arguments)},oC=t._Neg=function(){return(oC=t._Neg=t.asm.Neg).apply(null,arguments)},nC=t._NonMaxSuppressionV3=function(){return(nC=t._NonMaxSuppressionV3=t.asm.NonMaxSuppressionV3).apply(null,arguments)},sC=t._NonMaxSuppressionV4=function(){return(sC=t._NonMaxSuppressionV4=t.asm.NonMaxSuppressionV4).apply(null,arguments)},aC=t._NonMaxSuppressionV5=function(){return(aC=t._NonMaxSuppressionV5=t.asm.NonMaxSuppressionV5).apply(null,arguments)},iC=t._NotEqual=function(){return(iC=t._NotEqual=t.asm.NotEqual).apply(null,arguments)},uC=t._OneHot=function(){return(uC=t._OneHot=t.asm.OneHot).apply(null,arguments)},pC=t._PadV2=function(){return(pC=t._PadV2=t.asm.PadV2).apply(null,arguments)},lC=t._Pow=function(){return(lC=t._Pow=t.asm.Pow).apply(null,arguments)},cC=t._Prelu=function(){return(cC=t._Prelu=t.asm.Prelu).apply(null,arguments)},mC=t._Prod=function(){return(mC=t._Prod=t.asm.Prod).apply(null,arguments)},dC=t._RealDiv=function(){return(dC=t._RealDiv=t.asm.RealDiv).apply(null,arguments)},fC=t._Reciprocal=function(){return(fC=t._Reciprocal=t.asm.Reciprocal).apply(null,arguments)},hC=t._Relu=function(){return(hC=t._Relu=t.asm.Relu).apply(null,arguments)},gC=t._Relu6=function(){return(gC=t._Relu6=t.asm.Relu6).apply(null,arguments)},xC=t._ResizeBilinear=function(){return(xC=t._ResizeBilinear=t.asm.ResizeBilinear).apply(null,arguments)},yC=t._ResizeBilinearGrad=function(){return(yC=t._ResizeBilinearGrad=t.asm.ResizeBilinearGrad).apply(null,arguments)},bC=t._ResizeNearestNeighbor=function(){return(bC=t._ResizeNearestNeighbor=t.asm.ResizeNearestNeighbor).apply(null,arguments)},CC=t._ResizeNearestNeighborGrad=function(){return(CC=t._ResizeNearestNeighborGrad=t.asm.ResizeNearestNeighborGrad).apply(null,arguments)},wC=t._Reverse=function(){return(wC=t._Reverse=t.asm.Reverse).apply(null,arguments)},SC=t._RotateWithOffset=function(){return(SC=t._RotateWithOffset=t.asm.RotateWithOffset).apply(null,arguments)},IC=t._Round=function(){return(IC=t._Round=t.asm.Round).apply(null,arguments)},vC=t._Rsqrt=function(){return(vC=t._Rsqrt=t.asm.Rsqrt).apply(null,arguments)},kC=t._ScatterNd=function(){return(kC=t._ScatterNd=t.asm.ScatterNd).apply(null,arguments)},NC=t._SearchSorted=function(){return(NC=t._SearchSorted=t.asm.SearchSorted).apply(null,arguments)},TC=t._SelectV2=function(){return(TC=t._SelectV2=t.asm.SelectV2).apply(null,arguments)},_C=t._Selu=function(){return(_C=t._Selu=t.asm.Selu).apply(null,arguments)},EC=t._Sigmoid=function(){return(EC=t._Sigmoid=t.asm.Sigmoid).apply(null,arguments)},$C=t._Sign=function(){return($C=t._Sign=t.asm.Sign).apply(null,arguments)},RC=t._Sin=function(){return(RC=t._Sin=t.asm.Sin).apply(null,arguments)},DC=t._Sinh=function(){return(DC=t._Sinh=t.asm.Sinh).apply(null,arguments)},AC=t._Softmax=function(){return(AC=t._Softmax=t.asm.Softmax).apply(null,arguments)},FC=t._Softplus=function(){return(FC=t._Softplus=t.asm.Softplus).apply(null,arguments)},PC=t._SparseFillEmptyRows=function(){return(PC=t._SparseFillEmptyRows=t.asm.SparseFillEmptyRows).apply(null,arguments)},OC=t._SparseReshape=function(){return(OC=t._SparseReshape=t.asm.SparseReshape).apply(null,arguments)},MC=t._SparseSegmentReduction=function(){return(MC=t._SparseSegmentReduction=t.asm.SparseSegmentReduction).apply(null,arguments)},LC=t._SparseToDense=function(){return(LC=t._SparseToDense=t.asm.SparseToDense).apply(null,arguments)},BC=t._Sqrt=function(){return(BC=t._Sqrt=t.asm.Sqrt).apply(null,arguments)},zC=t._Square=function(){return(zC=t._Square=t.asm.Square).apply(null,arguments)},VC=t._SquaredDifference=function(){return(VC=t._SquaredDifference=t.asm.SquaredDifference).apply(null,arguments)},WC=t._Step=function(){return(WC=t._Step=t.asm.Step).apply(null,arguments)},UC=t._StridedSlice=function(){return(UC=t._StridedSlice=t.asm.StridedSlice).apply(null,arguments)},GC=t._Sub=function(){return(GC=t._Sub=t.asm.Sub).apply(null,arguments)},HC=t._Sum=function(){return(HC=t._Sum=t.asm.Sum).apply(null,arguments)},KC=t._Tan=function(){return(KC=t._Tan=t.asm.Tan).apply(null,arguments)},qC=t._Tanh=function(){return(qC=t._Tanh=t.asm.Tanh).apply(null,arguments)},jC=t._TensorScatterUpdate=function(){return(jC=t._TensorScatterUpdate=t.asm.TensorScatterUpdate).apply(null,arguments)},XC=t._Tile=function(){return(XC=t._Tile=t.asm.Tile).apply(null,arguments)},YC=t._TopK=function(){return(YC=t._TopK=t.asm.TopK).apply(null,arguments)},QC=t._Transform=function(){return(QC=t._Transform=t.asm.Transform).apply(null,arguments)},ZC=t._Transpose=function(){return(ZC=t._Transpose=t.asm.Transpose).apply(null,arguments)},JC=t.__FusedMatMul=function(){return(JC=t.__FusedMatMul=t.asm._FusedMatMul).apply(null,arguments)},ew=t._malloc=function(){return(ew=t._malloc=t.asm.malloc).apply(null,arguments)},tw=t._free=function(){return(tw=t._free=t.asm.free).apply(null,arguments)},rw=t.___errno_location=function(){return(rw=t.___errno_location=t.asm.__errno_location).apply(null,arguments)},qm=t.stackSave=function(){return(qm=t.stackSave=t.asm.stackSave).apply(null,arguments)},jm=t.stackRestore=function(){return(jm=t.stackRestore=t.asm.stackRestore).apply(null,arguments)},xc=t.stackAlloc=function(){return(xc=t.stackAlloc=t.asm.stackAlloc).apply(null,arguments)},ow=t.dynCall_iijjiiii=function(){return(ow=t.dynCall_iijjiiii=t.asm.dynCall_iijjiiii).apply(null,arguments)},nw=t.dynCall_jiji=function(){return(nw=t.dynCall_jiji=t.asm.dynCall_jiji).apply(null,arguments)};t.cwrap=Ly;var Wp;ir=function K(){Wp||Xm(),Wp||(ir=K)};function Xm(K){if(K=K||i,Et>0||(gt(),Et>0))return;function ae(){Wp||(Wp=!0,t.calledRun=!0,!M&&(xt(),o(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Ur()))}t.setStatus?(t.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){t.setStatus(\"\")},1),ae()},1)):ae()}if(t.preInit)for(typeof t.preInit==\"function\"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();Xm();var Up;s&&(Up={uncaughtException:process.listeners(\"uncaughtException\").filter(function(K){return!s.uncaughtException.indexOf(K)>-1}),unhandledRejection:process.listeners(\"unhandledRejection\").filter(function(K){return!s.unhandledRejection.indexOf(K)>-1})});var Gp;if(typeof e!=\"undefined\")Gp=e;else if(typeof WasmBackendModuleThreadedSimd!=\"undefined\")Gp=WasmBackendModuleThreadedSimd;else throw new Error(\"Could not find wasm module in post.js\");if(Up){var sw=Gp._dispose;Gp._dispose=function(){sw(),Up.uncaughtException.forEach(function(K){process.removeListener(\"uncaughtException\",K)}),Up.unhandledRejection.forEach(function(K){process.removeListener(\"unhandledRejection\",K)})}}return e.ready}})();typeof ex==\"object\"&&typeof sv==\"object\"?sv.exports=nv:typeof define==\"function\"&&define.amd?define([],function(){return nv}):typeof ex==\"object\"&&(ex.WasmBackendModule=nv)});var mn=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}},mo=class{refCount(e){return Hr(\"refCount\")}incRef(e){return Hr(\"incRef\")}timerAvailable(){return!0}time(e){return Hr(\"time\")}read(e){return Hr(\"read\")}readSync(e){return Hr(\"readSync\")}readToGPU(e,t){return Hr(\"readToGPU\")}numDataIds(){return Hr(\"numDataIds\")}disposeData(e,t){return Hr(\"disposeData\")}write(e,t,o){return Hr(\"write\")}move(e,t,o,n,s){return Hr(\"move\")}createTensorFromGPUData(e,t,o){return Hr(\"createTensorFromGPUData\")}memory(){return Hr(\"memory\")}floatPrecision(){return Hr(\"floatPrecision\")}epsilon(){return this.floatPrecision()===32?1e-7:1e-4}dispose(){return Hr(\"dispose\")}};function Hr(r){throw new Error(`'${r}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function lk(r){let e=r.length,t=0;for(;e>0;)t=Math.random()*e|0,e--,nd(r,e,t)}function J4(r,e){if(r.length!==e.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${r.length}Second array length was ${e.length}`);let t=r.length,o=0;for(;t>0;)o=Math.random()*t|0,t--,nd(r,t,o),nd(e,t,o)}function qp(r,e,t){return Math.max(r,Math.min(e,t))}function eH(r){return r%2===0?r:r+1}function nd(r,e,t){let o=r[e];r[e]=r[t],r[t]=o}function tH(r){let e=0;for(let t=0;tt+` Shapes ${r} and ${e} must match`)}function fo(r){$(r!=null,()=>\"The input to the tensor constructor must be a non-null value.\")}function ze(r){if(r.length===0)return 1;let e=r[0];for(let t=1;t0,t,o){return new Promise((n,s)=>{let a=0,i=()=>{if(r()){n();return}a++;let p=e(a);if(t!=null&&a>=t){s();return}o!=null?o(i,p):setTimeout(i,p)};i()})}function pH(r,e){let t=1,o=-1;for(let s=0;s=0)t*=r[s];else if(r[s]===-1){if(o!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${o} and dim ${s}`);o=s}else if(r[s]<0)throw Error(`Shapes can not be < 0. Found ${r[s]} at dim ${s}`);if(o===-1){if(e>0&&e!==t)throw Error(`Size(${e}) must match the product of shape ${r}`);return r}if(t===0)throw Error(`Cannot infer the missing size in [${r}] when there are 0 elements`);if(e%t!==0)throw Error(`The implicit shape can't be a fractional number. Got ${e} / ${t}`);let n=r.slice();return n[o]=e/t,n}function Li(r,e){let t=e.length;return r=r==null?e.map((o,n)=>n):[].concat(r),$(r.every(o=>o>=-t&&o`All values in axis param must be in range [-${t}, ${t}) but got axis ${r}`),$(r.every(o=>Ja(o)),()=>`All values in axis param must be integers but got axis ${r}`),r.map(o=>o<0?t+o:o)}function mw(r,e){let t=[],o=[],n=e!=null&&Array.isArray(e)&&e.length===0,s=e==null||n?null:Li(e,r).sort(),a=0;for(let i=0;ii)&&r[i]===1&&(t.push(r[i]),o.push(i)),s[a]<=i&&a++}r[i]!==1&&(t.push(r[i]),o.push(i))}return{newShape:t,keptDims:o}}function dw(r,e){return sd(r,e)}function sd(r,e){let t=null;if(r==null||r===\"float32\")t=new Float32Array(e);else if(r===\"int32\")t=new Int32Array(e);else if(r===\"bool\")t=new Uint8Array(e);else if(r===\"string\")t=new Array(e);else throw new Error(`Unknown data type ${r}`);return t}function fw(r,e){for(let t=0;te+=t.length),e}function dn(r){return typeof r==\"string\"||r instanceof String}function ck(r){return typeof r==\"boolean\"}function mk(r){return typeof r==\"number\"}function Bi(r){return Array.isArray(r)?Bi(r[0]):r instanceof Float32Array?\"float32\":r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray?\"int32\":mk(r)?\"float32\":dn(r)?\"string\":ck(r)?\"bool\":\"float32\"}function ra(r){return!!(r&&r.constructor&&r.call&&r.apply)}function Xp(r,e){for(let t=e;t=0;--o)t[o]=t[o+1]*r[o+1];return t}function dk(r,e,t,o=!1){let n=new Array;if(e.length===1){let s=e[0]*(o?2:1);for(let a=0;ap*u)*(o?2:1);for(let p=0;pn*s)*(t?2:1);if(o===0)return[];if(o!==e.length)throw new Error(`[${r}] does not match the input size ${e.length}${t?\" for a complex tensor\":\"\"}.`);return dk(0,r,e,t)}function cH(r,e){if(Array.isArray(r))return r;if(e===\"float32\")return r instanceof Float32Array?r:new Float32Array(r);if(e===\"int32\")return r instanceof Int32Array?r:new Int32Array(r);if(e===\"bool\"||e===\"string\")return Uint8Array.from(new Int32Array(r));throw new Error(`Unknown dtype ${e}`)}function bc(r,e){let t=Yp(r,e);for(let o=0;oo*n,1);if(e==null||e===\"float32\")return Fu(r,new Float32Array(t));if(e===\"int32\")return Fu(r,new Int32Array(t));if(e===\"bool\")return Fu(r,new Uint8Array(t));throw new Error(`Unknown data type ${e}`)}function St(r){r.forEach(e=>{$(Number.isInteger(e)&&e>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${r}].`)})}function dH(r,e,t){if(e===0)return 0;if(e===1)return r[0];let o=r[r.length-1];for(let n=0;n{let[n,s]=o.split(\":\");this.urlFlags[n]=yH(n,s)})}};function gH(r){let e={};return r.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(t,...o)=>(xH(e,o[0],o[1]),o.join(\"=\"))),e}function xH(r,e,t){r[decodeURIComponent(e)]=decodeURIComponent(t||\"\")}function yH(r,e){let t=e.toLowerCase();return t===\"true\"||t===\"false\"?t===\"true\":`${+t}`===t?+t:e}function A(){return xw}var xw=null;function hk(r){xw=r}var yw;function bw(){if(yw==null){let r;if(typeof window!=\"undefined\")r=window;else if(typeof global!=\"undefined\")r=global;else if(typeof process!=\"undefined\")r=process;else if(typeof self!=\"undefined\")r=self;else throw new Error(\"Could not find a global object\");yw=r}return yw}function bH(){let r=bw();return r._tfGlobals==null&&(r._tfGlobals=new Map),r._tfGlobals}function wc(r,e){let t=bH();if(t.has(r))return t.get(r);{let o=e();return t.set(r,o),t.get(r)}}var fn=\"Abs\",hn=\"Acos\",gn=\"Acosh\",Rr=\"Add\",xn=\"AddN\",yn=\"All\",bn=\"Any\",na=\"ArgMax\",sa=\"ArgMin\",Cn=\"Asin\",wn=\"Asinh\",Sn=\"Atan\",In=\"Atanh\",vn=\"Atan2\",kn=\"AvgPool\",zi=\"AvgPoolGrad\",aa=\"AvgPool3D\",Vi=\"AvgPool3DGrad\",Nn=\"BatchMatMul\",ia=\"BatchToSpaceND\",Tn=\"Bincount\",_n=\"BitwiseAnd\",Sme=\"BroadcastTo\",ua=\"BroadcastArgs\",ho=\"Cast\",go=\"Ceil\",Go=\"ClipByValue\",ei=\"Complex\",Wi=\"ComplexAbs\",pa=\"Concat\",En=\"Conv2D\",Ui=\"Conv2DBackpropFilter\",$n=\"Conv2DBackpropInput\",Rn=\"Conv3D\",ti=\"Conv3DBackpropFilterV2\",Dn=\"Conv3DBackpropInputV2\",An=\"Cos\",Fn=\"Cosh\",Pn=\"Cumprod\",On=\"Cumsum\",Mn=\"CropAndResize\",la=\"DenseBincount\",Ln=\"DepthToSpace\",Bn=\"DepthwiseConv2dNative\",Gi=\"DepthwiseConv2dNativeBackpropFilter\",Hi=\"DepthwiseConv2dNativeBackpropInput\",ca=\"Diag\",zn=\"Dilation2D\",Ki=\"Dilation2DBackpropInput\",qi=\"Dilation2DBackpropFilter\",Mu=\"Draw\",Vn=\"RealDiv\",ji=\"Einsum\",Wn=\"Elu\",ri=\"EluGrad\",Un=\"Erf\",xo=\"Equal\",yo=\"Exp\",ma=\"ExpandDims\",bo=\"Expm1\",Xi=\"FFT\",da=\"Fill\",Gn=\"FlipLeftRight\",Co=\"Floor\",wo=\"FloorDiv\",Hn=\"FusedBatchNorm\",fa=\"GatherV2\",Kn=\"GatherNd\",So=\"Greater\",Io=\"GreaterEqual\",vo=\"Identity\",Yi=\"IFFT\",Qi=\"Imag\",qn=\"IsFinite\",jn=\"IsInf\",Xn=\"IsNan\",Yn=\"LeakyRelu\",ko=\"Less\",No=\"LessEqual\",Qn=\"LinSpace\",To=\"Log\",Zn=\"Log1p\",Jn=\"LogicalAnd\",es=\"LogicalNot\",ts=\"LogicalOr\",gk=\"LogicalXor\",Ime=\"LogSoftmax\",vme=\"LowerBound\",rs=\"LRN\",oi=\"LRNGrad\",kme=\"MatrixBandPart\",os=\"Max\",_o=\"Maximum\",ns=\"MaxPool\",Zi=\"MaxPoolGrad\",ha=\"MaxPool3D\",Ji=\"MaxPool3DGrad\",ga=\"MaxPoolWithArgmax\",ss=\"Mean\",as=\"Min\",Eo=\"Minimum\",is=\"MirrorPad\",us=\"Mod\",ps=\"Multinomial\",$o=\"Multiply\",ls=\"Neg\",Ro=\"NotEqual\",cs=\"NonMaxSuppressionV3\",ni=\"NonMaxSuppressionV4\",ms=\"NonMaxSuppressionV5\",xa=\"OnesLike\",ds=\"OneHot\",ya=\"Pack\",fs=\"PadV2\",Nme=\"Pool\",hs=\"Pow\",gs=\"Prelu\",Ho=\"Prod\",Qp=\"RaggedGather\",Zp=\"RaggedRange\",Jp=\"RaggedTensorToTensor\",ba=\"Range\",si=\"Real\",xs=\"Reciprocal\",ys=\"Relu\",Ca=\"Reshape\",bs=\"ResizeNearestNeighbor\",ai=\"ResizeNearestNeighborGrad\",Cs=\"ResizeBilinear\",ii=\"ResizeBilinearGrad\",ws=\"Relu6\",Ss=\"Reverse\",Is=\"Round\",Do=\"Rsqrt\",vs=\"ScatterNd\",ks=\"TensorScatterUpdate\",Ns=\"SearchSorted\",wa=\"Select\",Ts=\"Selu\",_s=\"Slice\",Es=\"Sin\",$s=\"Sinh\",Rs=\"Sign\",Ao=\"Sigmoid\",Ds=\"Softplus\",Fo=\"Sqrt\",As=\"Sum\",Sa=\"SpaceToBatchND\",Ia=\"SplitV\",Fs=\"Softmax\",eu=\"SparseFillEmptyRows\",ui=\"SparseReshape\",va=\"SparseSegmentMean\",ka=\"SparseSegmentSum\",Ps=\"SparseToDense\",Po=\"SquaredDifference\",tu=\"Square\",pi=\"StaticRegexReplace\",Os=\"StridedSlice\",Na=\"StringNGrams\",ru=\"StringSplit\",ou=\"StringToHashBucketFast\",Oo=\"Sub\",Ms=\"Tan\",Ls=\"Tanh\",Mo=\"Tile\",Bs=\"TopK\",zs=\"Transform\",Kr=\"Transpose\",nu=\"Unique\",Ta=\"Unpack\",su=\"UnsortedSegmentSum\",Tme=\"UpperBound\",_a=\"ZerosLike\",Ko=\"Step\",Lu=\"FromPixels\",Vs=\"RotateWithOffset\",qo=\"_FusedMatMul\",jo=\"FusedConv2D\",Xo=\"FusedDepthwiseConv2D\";function Ea(...r){A().getBool(\"IS_TEST\")||A().getBool(\"PROD\")||console.warn(...r)}function CH(...r){A().getBool(\"IS_TEST\")||A().getBool(\"PROD\")||console.log(...r)}var el=wc(\"kernelRegistry\",()=>new Map),Sc=wc(\"gradRegistry\",()=>new Map);function tl(r,e){let t=ww(r,e);return el.get(t)}function Cw(r){return Sc.get(r)}function ad(r){let e=el.entries(),t=[];for(;;){let{done:o,value:n}=e.next();if(o)break;let[s,a]=n,[i]=s.split(\"_\");i===r&&t.push(a)}return t}function li(r){let{kernelName:e,backendName:t}=r,o=ww(e,t);el.has(o)&&Ea(`The kernel '${e}' for backend '${t}' is already registered`),el.set(o,r)}function Dme(r){let{kernelName:e}=r;Sc.has(e)&&A().getBool(\"DEBUG\")&&Ea(`Overriding the gradient for '${e}'`),Sc.set(e,r)}function Ame(r,e){let t=ww(r,e);if(!el.has(t))throw new Error(`The kernel '${r}' for backend '${e}' is not registered`);el.delete(t)}function Fme(r){if(!Sc.has(r))throw new Error(`The gradient '${r}' for backend is not registered`);Sc.delete(r)}function Pme(r,e){ad(r).forEach(o=>{let n=Object.assign({},o,{backendName:e});li(n)})}function ww(r,e){return`${e}_${r}`}var y={};qe(y,{arraysEqual:()=>Sr,arraysEqualWithNull:()=>cw,assert:()=>$,assertNonNegativeIntegerDimensions:()=>St,assertNonNull:()=>fo,assertShapesMatch:()=>yt,bytesFromStringArray:()=>gw,bytesPerElement:()=>jp,checkConversionForErrors:()=>fw,clamp:()=>qp,computeStrides:()=>oa,convertBackendValuesAndArrayBuffer:()=>cH,createScalarValue:()=>TH,createShuffledIndices:()=>iH,decodeString:()=>sl,distSquared:()=>oH,encodeString:()=>iu,fetch:()=>EH,fingerPrint64:()=>NH,flatten:()=>Us,getArrayFromDType:()=>sd,getTypedArrayFromDType:()=>dw,hasEncodingLoss:()=>lH,hexToLong:()=>Ic,indexToLoc:()=>fH,inferDtype:()=>Bi,inferFromImplicitShape:()=>pH,isBoolean:()=>ck,isFunction:()=>ra,isInt:()=>Ja,isNumber:()=>mk,isPromise:()=>Ou,isScalarShape:()=>nH,isString:()=>dn,isTypedArray:()=>Mt,isValidDtype:()=>hw,locToIndex:()=>dH,makeOnesTypedArray:()=>bc,makeZerosNestedTypedArray:()=>mH,makeZerosTypedArray:()=>Yp,nearestDivisor:()=>Xp,nearestLargerEven:()=>eH,now:()=>Uu,parseAxisParam:()=>Li,randUniform:()=>rH,repeatedTry:()=>uH,rightPad:()=>Pu,shuffle:()=>lk,shuffleCombo:()=>J4,sizeFromShape:()=>ze,sizeToSquarishShape:()=>aH,squeezeShape:()=>mw,sum:()=>tH,swap:()=>nd,tanh:()=>sH,toNestedArray:()=>Fu,toTypedArray:()=>nl});function id(r){return r instanceof Float32Array||r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray}var kw=Kp(_k());var Wu=kw.default||kw;function Ic(r){return Wu.fromString(r,!0,16)}var $k=Ic(\"c3a5c85c97cb3127\"),Vu=Ic(\"b492b66fbe98f273\"),Ir=Ic(\"9ae16a3b2f90404f\");function vw(r){return r.xor(r.shru(47))}function Rk(r,e,t){let o=r.slice(e,e+t);return Wu.fromBytes(Array.from(o),!0,!0)}function It(r,e){return Rk(r,e,8)}function Ek(r,e){return Rk(r,e,4)}function Jt(r,e){return e===0?r:r.shru(e).or(r.shl(64-e))}function au(r,e,t=Ic(\"9ddfea08eb382d69\")){let o=r.xor(e).mul(t);o=o.xor(o.shru(47));let n=e.xor(o).mul(t);return n=n.xor(n.shru(47)),n=n.mul(t),n}function SH(r,e,t,o,n,s){n=n.add(r),s=Jt(s.add(n).add(o),21);let a=n;return n=n.add(e),n=n.add(t),s=s.add(Jt(n,44)),[n.add(o),s.add(a)]}function pd(r,e,t,o){return SH(It(r,e),It(r,e+8),It(r,e+16),It(r,e+24),t,o)}function IH(r,e=r.length){if(e>=8){let t=Ir.add(e*2),o=It(r,0).add(Ir),n=It(r,e-8),s=Jt(n,37).mul(t).add(o),a=Jt(o,25).add(n).mul(t);return au(s,a,t)}if(e>=4){let t=Ir.add(e*2),o=Ek(r,0);return au(o.shl(3).add(e),Ek(r,e-4),t)}if(e>0){let t=r[0],o=r[e>>1],n=r[e-1],s=t+(o<<8),a=e+(n<<2);return vw(Ir.mul(s).xor($k.mul(a))).mul(Ir)}return Ir}function vH(r,e=r.length){let t=Ir.add(e*2),o=It(r,0).mul(Vu),n=It(r,8),s=It(r,e-8).mul(t),a=It(r,e-16).mul(Ir);return au(Jt(o.add(n),43).add(Jt(s,30)).add(a),o.add(Jt(n.add(Ir),18)).add(s),t)}function kH(r,e=r.length){let t=Ir.add(e*2),o=It(r,0).mul(Ir),n=It(r,8),s=It(r,e-8).mul(t),a=It(r,e-16).mul(Ir),i=Jt(o.add(n),43).add(Jt(s,30)).add(a),p=au(i,o.add(Jt(n.add(Ir),18)).add(s),t),u=It(r,16).mul(t),l=It(r,24),c=i.add(It(r,e-32)).mul(t),m=p.add(It(r,e-24)).mul(t);return au(Jt(u.add(l),43).add(Jt(c,30)).add(m),u.add(Jt(l.add(o),18)).add(c),t)}function NH(r,e=r.length){let t=Wu.fromNumber(81,!0);if(e<=32)return e<=16?IH(r,e):vH(r,e);if(e<=64)return kH(r,e);let o=t,n=t.mul(Vu).add(113),s=vw(n.mul(Ir).add(113)).mul(Ir),a=[Wu.UZERO,Wu.UZERO],i=[Wu.UZERO,Wu.UZERO];o=o.mul(Ir).add(It(r,0));let p=0,u=(e-1>>6)*64,l=u+(e-1&63)-63;do o=Jt(o.add(n).add(a[0]).add(It(r,p+8)),37).mul(Vu),n=Jt(n.add(a[1]).add(It(r,p+48)),42).mul(Vu),o=o.xor(i[1]),n=n.add(a[0]).add(It(r,p+40)),s=Jt(s.add(i[0]),33).mul(Vu),a=pd(r,p,a[1].mul(Vu),o.add(i[0])),i=pd(r,p+32,s.add(i[1]),n.add(It(r,p+16))),[s,o]=[o,s],p+=64;while(p!==u);let c=Vu.add(s.and(255).shl(1));return p=l,i[0]=i[0].add(e-1&63),a[0]=a[0].add(i[0]),i[0]=i[0].add(a[0]),o=Jt(o.add(n).add(a[0]).add(It(r,p+8)),37).mul(c),n=Jt(n.add(a[1]).add(It(r,p+48)),42).mul(c),o=o.xor(i[1].mul(9)),n=n.add(a[0].mul(9).add(It(r,p+40))),s=Jt(s.add(i[0]),33).mul(c),a=pd(r,p,a[1].mul(c),o.add(i[0])),i=pd(r,p+32,s.add(i[1]),n.add(It(r,p+16))),[s,o]=[o,s],au(au(a[0],i[0],c).add(vw(n).mul($k)).add(s),au(a[1],i[1],c).add(o),c)}function TH(r,e){return e===\"string\"?iu(r):nl([r],e)}function _H(r,e){return r instanceof Float32Array&&e===\"float32\"||r instanceof Int32Array&&e===\"int32\"||r instanceof Uint8Array&&e===\"bool\"}function nl(r,e){if(e===\"string\")throw new Error(\"Cannot convert a string[] to a TypedArray\");if(Array.isArray(r)&&(r=Us(r)),A().getBool(\"DEBUG\")&&fw(r,e),_H(r,e))return r;if(e==null||e===\"float32\"||e===\"complex64\")return new Float32Array(r);if(e===\"int32\")return new Int32Array(r);if(e===\"bool\"){let t=new Uint8Array(r.length);for(let o=0;o{n=o()},a,i=Uu();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(s);else{s();for(let u of n)u.dataSync();a=Promise.resolve({kernelMs:Uu()-i})}if(A().getBool(\"CHECK_COMPUTATION_FOR_ERRORS\"))for(let u=0;u{$H(c,l.dtype,e)})}return{kernelName:e,outputs:n,inputs:t,timeMs:a.then(u=>u.kernelMs),extraInfo:a.then(u=>u.getExtraProfileInfo!=null?u.getExtraProfileInfo():\"\")}}logKernelProfile(e){let{kernelName:t,outputs:o,timeMs:n,inputs:s,extraInfo:a}=e;o.forEach(i=>{Promise.all([i.data(),n,a]).then(p=>{this.logger.logKernelProfile(t,i,p[0],p[1],s,p[2])})})}};function $H(r,e,t){if(e!==\"float32\")return!1;for(let o=0;o0?h:\"\"} `}}console.log(`%c${p}\t%c${i}\t%c${u}D ${c}\t%c${l}\t%c${m}\t%c${a}`,\"font-weight:bold\",\"color:red\",\"color:blue\",\"color: orange\",\"color: green\",\"color: steelblue\")}};function Dk(r,e,t){let o={},n={};for(let p=0;po[h.id]=!0),d=!0,n[u.id]=!0;break}if(d)break}}let s={};s[t.id]=!0;let a={};for(let p=r.length-1;p>=0;p--){let u=r[p],l=u.inputs;for(let c=0;c=0;n--){let s=e[n],a=[];if(s.outputs.forEach(p=>{let u=r[p.id];u!=null?a.push(u):a.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let i=s.gradient(a);for(let p in s.inputs){if(!(p in i))throw new Error(`Cannot backprop through input ${p}. Available gradients found: ${Object.keys(i)}.`);let u=t(()=>i[p]());if(u.dtype!==\"float32\")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${p} must have 'float32' dtype, but has '${u.dtype}'`);let l=s.inputs[p];if(!Sr(u.shape,l.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${p}' has shape '${u.shape}', which does not match the shape of the input '${l.shape}'`);if(r[l.id]==null)r[l.id]=u;else{let c=r[l.id];r[l.id]=o(c,u),c.dispose()}}}}var Fk=20,vc=3,Tw=7;function Pk(r,e,t,o){let n=oa(e),s=RH(r,e,t,n),a=e.length,i=cd(r,e,t,n,s),p=[\"Tensor\"];return o&&(p.push(` dtype: ${t}`),p.push(` rank: ${a}`),p.push(` shape: [${e}]`),p.push(\" values:\")),p.push(i.map(u=>\" \"+u).join(`\n`)),p.join(`\n`)}function RH(r,e,t,o){let n=ze(e),s=o[o.length-1],a=new Array(s).fill(0),i=e.length,p=t===\"complex64\"?Nc(r):r;if(i>1)for(let u=0;uFk){let g=vc*a,x=Array.from(r.slice(0,g)),b=Array.from(r.slice((i-vc)*a,i*a));return t===\"complex64\"&&(x=Nc(x),b=Nc(b)),[\"[\"+x.map((w,S)=>kc(w,n[S],t)).join(\", \")+\", ..., \"+b.map((w,S)=>kc(w,n[i-vc+S],t)).join(\", \")+\"]\"]}return[\"[\"+(t===\"complex64\"?Nc(r):Array.from(r)).map((g,x)=>kc(g,n[x],t)).join(\", \")+\"]\"]}let u=e.slice(1),l=o.slice(1),c=o[0]*a,m=[];if(i>Fk){for(let h=0;h0?m[0]+d:\"\");for(let h=1;h`Length of values '${n}' 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=o||sd(t,this.size),this.strides=oa(e)}set(e,...t){t.length===0&&(t=[0]),$(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let o=this.locToIndex(t);this.values[o]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let n of e){if(n<0||n>=this.shape[t]){let s=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(s)}t++}let o=e[e.length-1];for(let n=0;nsl(o))}catch(o){throw new Error(\"Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().\")}}return e}dataToGPU(e){return this.throwIfDisposed(),Gs().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();let e=Gs().readSync(this.dataId);if(this.dtype===\"string\")try{return e.map(t=>sl(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 Gs().read(this.dataId);return this.dtype===\"string\"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Gs().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 Pk(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),al.cast(this,e)}variable(e=!0,t,o){return this.throwIfDisposed(),Gs().makeVariable(this,e,t,o)}};Object.defineProperty(dt,Symbol.hasInstance,{value:r=>!!r&&r.data!=null&&r.dataSync!=null&&r.throwIfDisposed!=null});function _w(){return wc(\"Tensor\",()=>dt)}_w();var ci=class extends dt{constructor(e,t,o,n){super(e.shape,e.dtype,e.dataId,n),this.trainable=t,this.name=o}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(!Sr(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Gs().disposeTensor(this),this.dataId=e.dataId,Gs().incRef(this,null)}dispose(){Gs().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(ci,Symbol.hasInstance,{value:r=>r instanceof dt&&r.assign!=null&&r.assign instanceof Function});var Vk={};qe(Vk,{assertTypesMatch:()=>Fw,getTensorsInContainer:()=>Tc,isTensorInList:()=>FH,makeTypesMatch:()=>Oe});var Ew;(function(r){r.R0=\"R0\",r.R1=\"R1\",r.R2=\"R2\",r.R3=\"R3\",r.R4=\"R4\",r.R5=\"R5\",r.R6=\"R6\"})(Ew||(Ew={}));var $w;(function(r){r.float32=\"float32\",r.int32=\"int32\",r.bool=\"int32\",r.complex64=\"complex64\"})($w||($w={}));var Rw;(function(r){r.float32=\"float32\",r.int32=\"int32\",r.bool=\"bool\",r.complex64=\"complex64\"})(Rw||(Rw={}));var Dw;(function(r){r.float32=\"float32\",r.int32=\"float32\",r.bool=\"float32\",r.complex64=\"complex64\"})(Dw||(Dw={}));var Aw;(function(r){r.float32=\"complex64\",r.int32=\"complex64\",r.bool=\"complex64\",r.complex64=\"complex64\"})(Aw||(Aw={}));var AH={float32:Dw,int32:$w,bool:Rw,complex64:Aw};function pt(r,e){if(r===\"string\"||e===\"string\"){if(r===\"string\"&&e===\"string\")return\"string\";throw new Error(`Can not upcast ${r} with ${e}`)}return AH[r][e]}function mi(r){return pt(r,\"int32\")}function md(r){return r!=null&&typeof r==\"object\"&&\"texture\"in r&&r.texture instanceof WebGLTexture}function dd(r){return typeof GPUBuffer!=\"undefined\"&&r!=null&&typeof r==\"object\"&&\"buffer\"in r&&r.buffer instanceof GPUBuffer}function Oe(r,e){if(r.dtype===e.dtype)return[r,e];let t=pt(r.dtype,e.dtype);return[r.cast(t),e.cast(t)]}function Fw(r,e){$(r.dtype===e.dtype,()=>`The dtypes of the first(${r.dtype}) and second(${e.dtype}) input must match`)}function FH(r,e){return e.some(t=>t.id===r.id)}function Tc(r){let e=[];return zk(r,e,new Set),e}function zk(r,e,t){if(r==null)return;if(r instanceof dt){e.push(r);return}if(!PH(r))return;let o=r;for(let n in o){let s=o[n];t.has(s)||(t.add(s),zk(s,e,t))}}function PH(r){return Array.isArray(r)||typeof r==\"object\"}function Pw(r){return r.kernelName!=null}var fd=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()}},_c=class r{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new fd}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{t.setupFunc!=null&&t.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){ad(e).forEach(o=>{o.disposeFunc!=null&&o.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 o=t.factory();if(o&&!(o instanceof mo)&&typeof o.then==\"function\"){let n=++this.pendingBackendInitId,s=o.then(a=>n(nthis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(o),()=>this.endScope(n),()=>(n=t(),n instanceof Promise&&console.error(\"Cannot return a Promise inside of tidy.\"),n))}scopedRun(e,t,o){e();try{let n=o();return t(),n}catch(n){throw t(),n}}nextTensorId(){return r.nextTensorId++}nextVariableId(){return r.nextVariableId++}clone(e){let t=_.runKernel(vo,{x:e}),o={x:e},n=a=>({x:()=>{let i=\"float32\",p={x:a},u={dtype:i};return _.runKernel(ho,p,u)}}),s=[];return this.addTapeNode(this.state.activeScope.name,o,[t],n,s,{}),t}runKernel(e,t,o){if(this.backendName==null&&this.backend,!(tl(e,this.backendName)!=null))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:o})}shouldCheckForMemLeaks(){return this.ENV.getBool(\"IS_TEST\")}checkKernelForMemLeak(e,t,o){let n=this.backend.numDataIds(),s=0;o.forEach(p=>{s+=p.dtype===\"complex64\"?3:1});let a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=n-t-s-a;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,o=[],n=this.isTapeOn(),s=this.state.numBytes,a=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let p,u=Pw(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:\"\";if(Pw(e)){let{kernelName:f,inputs:h,attrs:g}=e;this.backendName==null&&this.backend;let x=tl(f,this.backendName);$(x!=null,()=>`Cannot find registered kernel '${f}' for backend '${this.backendName}'`),i=()=>{let b=this.backend.numDataIds();p=x.kernelFunc({inputs:h,attrs:g,backend:this.backend});let w=Array.isArray(p)?p:[p];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(f,b,w);let S=w.map(k=>k.rank!=null?k:this.makeTensorFromTensorInfo(k));if(n){let k=this.getTensorsForGradient(f,h,S);o=this.saveTensorsForBackwardMode(k)}return S}}else{let{forwardFunc:f}=e,h=g=>{n&&(o=g.map(x=>this.keep(this.clone(x))))};i=()=>{let g=this.backend.numDataIds();p=this.tidy(()=>f(this.backend,h));let x=Array.isArray(p)?p:[p];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,g,x),x}}let{inputs:l,attrs:c}=e,m=Pw(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(u,l,()=>i()),this.ENV.getBool(\"DEBUG\")&&this.profiler.logKernelProfile(d),t=d.outputs)}),n&&this.addTapeNode(u,l,t,m,o,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(l).map(f=>l[f]!=null?l[f].shape:null),outputShapes:t.map(f=>f.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(p)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(o=>this.keep(this.clone(o)))}getTensorsForGradient(e,t,o){let n=Cw(e);if(n!=null){let s=n.inputsToSave||[],a=n.outputsToSave||[],i;n.saveAllInputs?($(Array.isArray(t),()=>\"saveAllInputs is true, expected inputs to be an array.\"),i=Object.keys(t).map(u=>t[u])):i=s.map(u=>t[u]);let p=o.filter((u,l)=>a[l]);return i.concat(p)}return[]}makeTensor(e,t,o,n){if(e==null)throw new Error(\"Values passed to engine.makeTensor() are null\");o=o||\"float32\",n=n||this.backend;let s=e;o===\"string\"&&dn(e[0])&&(s=e.map(p=>iu(p)));let a=n.write(s,t,o),i=new dt(t,o,a,this.nextTensorId());if(this.trackTensor(i,n),o===\"string\"){let p=this.state.tensorInfo.get(a),u=gw(s);this.state.numBytes+=u-p.bytes,p.bytes=u}return i}makeTensorFromDataId(e,t,o,n){o=o||\"float32\";let s={dataId:e,shape:t,dtype:o};return this.makeTensorFromTensorInfo(s,n)}makeTensorFromTensorInfo(e,t){let{dataId:o,shape:n,dtype:s}=e,a=new dt(n,s,o,this.nextTensorId());return this.trackTensor(a,t),a}makeVariable(e,t=!0,o,n){o=o||this.nextVariableId().toString(),n!=null&&n!==e.dtype&&(e=e.cast(n));let s=new ci(e,t,o,this.nextTensorId());if(this.state.registeredVariables[s.name]!=null)throw new Error(`Variable with name ${s.name} was already registered`);return this.state.registeredVariables[s.name]=s,this.incRef(s,this.backend),s}trackTensor(e,t){this.state.numTensors++,e.dtype===\"string\"&&this.state.numStringTensors++;let o=0;e.dtype!==\"complex64\"&&e.dtype!==\"string\"&&(o=e.size*jp(e.dtype)),this.state.numBytes+=o,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:o})),e instanceof ci||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 o=e.size*jp(e.dtype);this.state.numBytes-=o}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,o=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(n=>n.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-o;for(let n of this.state.activeProfile.kernels)n.kernelTimeMs=await n.kernelTimeMs,n.extraInfo=await n.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,o,n,s,a){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:o,saved:s},p=Cw(e);p!=null&&(n=p.gradFunc),n!=null&&(i.gradient=u=>(u=u.map((l,c)=>{if(l==null){let m=o[c],d=Yp(m.size,m.dtype);return this.makeTensor(d,m.shape,m.dtype)}return l}),n(u.length>1?u:u[0],s,a))),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=Tc(e),o=new Set(t.map(s=>s.id));for(let s=0;s{!s.kept&&s.scopeId===n.id&&this.track(s)})}gradients(e,t,o,n=!1){if($(t.length>0,()=>\"gradients() received an empty list of xs.\"),o!=null&&o.dtype!==\"float32\")throw new Error(`dy must have 'float32' dtype, but has '${o.dtype}'`);let s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy(\"forward\",e));$(s instanceof dt,()=>\"The result y returned by f() must be a tensor.\");let a=Dk(this.state.activeTape,t,s);if(!n&&a.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[s.id]=o==null?OH(s.shape):o,Ak(i,a,u=>this.tidy(u),MH);let p=t.map(u=>i[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(let l of u.saved)l.dispose()}),this.state.activeTape=null),{value:s,grads:p}})}customGrad(e){return $(ra(e),()=>\"The f passed in customGrad(f) must be a function.\"),(...t)=>{$(t.every(i=>i instanceof dt),()=>\"The args passed in customGrad(f)(x1, x2,...) must all be tensors\");let o,n={};t.forEach((i,p)=>{n[p]=i});let s=(i,p)=>(o=e(...t,p),$(o.value instanceof dt,()=>\"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor\"),$(ra(o.gradFunc),()=>\"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function.\"),o.value),a=(i,p)=>{let u=o.gradFunc(i,p),l=Array.isArray(u)?u:[u];$(l.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(...).\"),$(l.every(m=>m instanceof dt),()=>\"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 c={};return l.forEach((m,d)=>{c[d]=()=>m}),c};return this.runKernelFunc({forwardFunc:s,backwardsFunc:a,inputs:n})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){let t=Uu(),o=await this.backend.time(e);return o.wallMs=Uu()-t,o}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 fd;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}};_c.nextTensorId=0;_c.nextVariableId=0;function OH(r){let e=bc(ze(r),\"float32\");return _.makeTensor(e,r,\"float32\")}function Ow(){let r=bw();if(r._tfengine==null){let e=new Cc(r);r._tfengine=new _c(e)}return hk(r._tfengine.ENV),Mk(()=>r._tfengine),r._tfengine}var _=Ow();function MH(r,e){let t={a:r,b:e};return _.runKernel(Rr,t)}var uu={};qe(uu,{isBrowser:()=>Lw,isMobile:()=>zH,mockIsMobile:()=>BH});function LH(){return typeof navigator!=\"undefined\"&&navigator!=null}var Mw;function BH(r){Mw=r}function zH(r){if(Mw!==void 0)return Mw;if(r||LH()){if(r||(r=navigator),r.product===\"ReactNative\")return!0;let e=r.userAgent||r.vendor||(typeof window!=\"undefined\"?window.opera:\"\");if(!e){let t=r;return t.userAgentData&&t.userAgentData.mobile}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(e)||/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(e.substr(0,4))}return!1}function Lw(){return typeof window!=\"undefined\"&&window.document!=null||typeof WorkerGlobalScope!=\"undefined\"}var Dr=A();Dr.registerFlag(\"DEBUG\",()=>!1,r=>{r&&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.\")});Dr.registerFlag(\"IS_BROWSER\",()=>Lw());Dr.registerFlag(\"IS_NODE\",()=>typeof process!=\"undefined\"&&typeof process.versions!=\"undefined\"&&typeof process.versions.node!=\"undefined\");Dr.registerFlag(\"IS_CHROME\",()=>typeof navigator!=\"undefined\"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));Dr.registerFlag(\"IS_SAFARI\",()=>typeof navigator!=\"undefined\"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));Dr.registerFlag(\"PROD\",()=>!1);Dr.registerFlag(\"TENSORLIKE_CHECK_SHAPE_CONSISTENCY\",()=>Dr.getBool(\"DEBUG\"));Dr.registerFlag(\"DEPRECATION_WARNINGS_ENABLED\",()=>!0);Dr.registerFlag(\"IS_TEST\",()=>!1);Dr.registerFlag(\"CHECK_COMPUTATION_FOR_ERRORS\",()=>Dr.getBool(\"DEBUG\"));Dr.registerFlag(\"WRAP_TO_IMAGEBITMAP\",()=>!1);Dr.registerFlag(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\",()=>!1);Dr.registerFlag(\"USE_SETTIMEOUTCUSTOM\",()=>!1);function ur(r,e){let t=r;if(Mt(r))return e===\"string\"?[]:[r.length];if(md(r)){let n=r.channels||\"RGBA\";return[r.height,r.width*n.length]}else if(dd(r))return[r.buffer.size/(e==null?4:jp(e))];if(!Array.isArray(r))return[];let o=[];for(;Array.isArray(t)||Mt(t)&&e!==\"string\";)o.push(t.length),t=t[0];return Array.isArray(r)&&A().getBool(\"TENSORLIKE_CHECK_SHAPE_CONSISTENCY\")&&Uk(r,o,[]),o}function Uk(r,e,t){if(t=t||[],!Array.isArray(r)&&!Mt(r)){$(e.length===0,()=>`Element arr[${t.join(\"][\")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`);return}$(e.length>0,()=>`Element arr[${t.join(\"][\")}] should be a primitive, but is an array of ${r.length} elements`),$(r.length===e[0],()=>`Element arr[${t.join(\"][\")}] should have ${e[0]} elements, but has ${r.length} elements`);let o=e.slice(1);for(let n=0;n=0&&(n=o),Wk(o,n,e,t),r==null||!Mt(r)&&!Array.isArray(r)&&typeof r!=\"number\"&&typeof r!=\"boolean\"&&typeof r!=\"string\"){let p=r==null?\"null\":r.constructor.name;throw new Error(`Argument '${e}' passed to '${t}' must be a Tensor or TensorLike, but got '${p}'`)}let s=ur(r,n);!Mt(r)&&!Array.isArray(r)&&(r=[r]);let i=n!==\"string\"?nl(r,n):Us(r,[],!0);return _.makeTensor(i,s,n)}function di(r,e,t,o=\"numeric\"){if(!Array.isArray(r))throw new Error(`Argument ${e} passed to ${t} must be a \\`Tensor[]\\` or \\`TensorLike[]\\``);return r.map((s,a)=>v(s,`${e}[${a}]`,t,o))}var Bw=\"__op\";function N(r){let e=Object.keys(r);if(e.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let t=e[0],o=r[t];t.endsWith(\"_\")&&(t=t.substring(0,t.length-1)),t=t+Bw;let n=(...s)=>{_.startScope(t);try{let a=o(...s);return Ou(a)&&console.error(\"Cannot return a Promise inside of tidy.\"),_.endScope(a),a}catch(a){throw _.endScope(null),a}};return Object.defineProperty(n,\"name\",{value:t,configurable:!0}),n}function VH(r,e){let t=v(r,\"real\",\"complex\"),o=v(e,\"imag\",\"complex\");yt(t.shape,o.shape,`real and imag shapes, ${t.shape} and ${o.shape}, must match in call to tf.complex().`);let n={real:t,imag:o};return _.runKernel(ei,n)}var Ar=N({complex_:VH});function vr(r,e,t,o){if(o==null)o=Bi(r);else if(o===\"complex64\")throw new Error(\"Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).\");if(dd(r)||md(r)){if(o!==\"float32\"&&o!==\"int32\")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${o}.`);return _.backend.createTensorFromGPUData(r,e||t,o)}if(!Mt(r)&&!Array.isArray(r)&&typeof r!=\"number\"&&typeof r!=\"boolean\"&&typeof r!=\"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(e!=null){St(e);let n=ze(e),s=ze(t);$(n===s,()=>`Based on the provided shape, [${e}], the tensor should have ${n} values but has ${s}`);for(let a=0;a`Error creating a new Tensor. Inferred shape (${t}) does not match the provided shape (${e}). `)}}return!Mt(r)&&!Array.isArray(r)&&(r=[r]),e=e||t,r=o!==\"string\"?nl(r,o):Us(r,[],!0),_.makeTensor(r,e,o)}function pr(r,e,t){let o=ur(r,t);return vr(r,e,o,t)}var fi={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};var lr=class r{static join(e){return new r(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,e==null||(e instanceof Array||(e=[e]),e=e.map(o=>Mt(o)?o.buffer:o),e.length===0))return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let o=0;o=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(n){return e=n.end?1:0}if(t(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;let o=WH(this.shards,t);return o===-1?-1:(this.previousShardIndex=o,this.previousShardIndex)}};function WH(r,e){let t=0,o=r.length;for(;t<=o;){let n=Math.floor((o-t)/2)+t,s=e(r[n]);if(s===0)return n;s<0?o=n:t=n+1}return-1}function Gde(){A().set(\"PROD\",!0)}function Hde(){A().set(\"DEBUG\",!0)}function Kde(){A().set(\"DEPRECATION_WARNINGS_ENABLED\",!1),console.warn(\"TensorFlow.js deprecation warnings have been disabled.\")}function zw(r){A().getBool(\"DEPRECATION_WARNINGS_ENABLED\")&&console.warn(r+\" You can disable deprecation warnings with tf.disableDeprecationWarnings().\")}Bk(zw);function qde(){_.disposeVariables()}function cr(){return _}function jde(){return _.memory()}function Xde(r){return _.profile(r)}function De(r,e){return _.tidy(r,e)}function Lt(r){Tc(r).forEach(t=>t.dispose())}function Fr(r){return _.keep(r)}function Yde(r){return _.time(r)}function Qde(r){return _.setBackend(r)}function Zde(){return _.ready()}function Gk(){return _.backendName}function Jde(r){_.removeBackend(r)}function efe(r){return _.findBackend(r)}function tfe(r){return _.findBackendFactory(r)}function pu(r,e,t=1){return _.registerBackend(r,e,t)}function Hk(){return _.backend}function rfe(r,e){A().setPlatform(r,e)}var lu=4;async function jk(r,e){let t=[],o=[],n=Array.isArray(r)?r.map(a=>a.name):Object.keys(r);for(let a=0;a{let m=await p.bytes(),d=m.reduce((g,x)=>g+x.length,0)+lu*m.length,f=new Uint8Array(d),h=0;for(let g=0;gt.slice(n+i,n+p));o[s.name]=Xk(s,t.slice(n,n+a)),n+=a}return o}function UH(r,e){let t=ze(r.shape),o;if(\"quantization\"in r){let n=r.quantization;o=fi[n.dtype]}else if(r.dtype===\"string\"){let n=0;for(let s=0;s(n=await Kk(o,n,l),n.slice(u,l)));n=await Kk(o,n,a);let i=n.slice(0,a);n=n.slice(a);let p=Xk(s,i);if(t[s.name]=p,Gk()===\"webgpu\"){let u=Hk();\"uploadToGPU\"in u&&ze(p.shape)>=A().get(\"WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD\")&&u.uploadToGPU(p.dataId)}}return t}function HH(r){if(r===null)throw new Error(`Invalid input value: ${JSON.stringify(r)}`);let e=0,t=[];r.forEach(s=>{if(e+=s.byteLength,t.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 o=new Uint8Array(e),n=0;return t.forEach(s=>{o.set(new Uint8Array(s.buffer),n),n+=s.byteLength}),o.buffer}var Vw=typeof Buffer!=\"undefined\"&&(typeof Blob==\"undefined\"||typeof atob==\"undefined\"||typeof btoa==\"undefined\");function qk(r){return Vw?Buffer.byteLength(r,\"utf8\"):new Blob([r]).size}function Yk(r){if(Vw)return Buffer.from(r).toString(\"base64\");let e=new Uint8Array(r),t=\"\";for(let o=0,n=e.length;o{let o=t<<13,n=0;for(;!(o&8388608);)n-=8388608,o<<=1;return o&=-8388609,n+=947912704,o|n},e=new Uint32Array(2048);e[0]=0;for(let t=1;t<1024;t++)e[t]=r(t);for(let t=1024;t<2048;t++)e[t]=939524096+(t-1024<<13);return e}function qH(){let r=new Uint32Array(64);r[0]=0,r[31]=1199570944,r[32]=2147483648,r[63]=3347054592;for(let e=1;e<31;e++)r[e]=e<<23;for(let e=33;e<63;e++)r[e]=2147483648+(e-32<<23);return r}function jH(){let r=new Uint32Array(64);for(let e=0;e<64;e++)r[e]=1024;return r[0]=r[32]=0,r}function XH(){let r=KH(),e=qH(),t=jH();return o=>{let n=new ArrayBuffer(4*o.length),s=new Uint32Array(n);for(let a=0;a>10]+(i&1023)]+e[i>>10];s[a]=p}return new Float32Array(n)}}var Xt=class r{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return r.instance==null&&(r.instance=new r),r.instance}static registerSaveRouter(e){r.getInstance().saveRouters.push(e)}static registerLoadRouter(e){r.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return r.getHandlers(e,\"save\")}static getLoadHandlers(e,t){return r.getHandlers(e,\"load\",t)}static getHandlers(e,t,o){let n=[];return(t===\"load\"?r.getInstance().loadRouters:r.getInstance().saveRouters).forEach(a=>{let i=a(e,o);i!==null&&n.push(i)}),n}},Jk=r=>Xt.registerSaveRouter(r),e1=r=>Xt.registerLoadRouter(r),t1=r=>Xt.getSaveHandlers(r),r1=(r,e)=>Xt.getLoadHandlers(r,e);var Gw=\"tensorflowjs\",Hw=1,Gu=\"models_store\",cu=\"model_info_store\";function o1(){if(!A().getBool(\"IS_BROWSER\"))throw new Error(\"Failed to obtain IndexedDB factory because the current environmentis not a web browser.\");let r=typeof window==\"undefined\"?self:window,e=r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB||r.shimIndexedDB;if(e==null)throw new Error(\"The current browser does not appear to support IndexedDB.\");return e}function Kw(r){let e=r.result;e.createObjectStore(Gu,{keyPath:\"modelPath\"}),e.createObjectStore(cu,{keyPath:\"modelPath\"})}var Ra=class{constructor(e){if(this.indexedDB=o1(),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((o,n)=>{let s=this.indexedDB.open(Gw,Hw);s.onupgradeneeded=()=>Kw(s),s.onsuccess=()=>{let a=s.result;if(t==null){let i=a.transaction(Gu,\"readonly\"),u=i.objectStore(Gu).get(this.modelPath);u.onsuccess=()=>{if(u.result==null)return a.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));o(u.result.modelArtifacts)},u.onerror=l=>(a.close(),n(u.error)),i.oncomplete=()=>a.close()}else{t.weightData=lr.join(t.weightData);let i=$a(t),p=a.transaction(cu,\"readwrite\"),u=p.objectStore(cu),l;try{l=u.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(m){return n(m)}let c;l.onsuccess=()=>{c=a.transaction(Gu,\"readwrite\");let m=c.objectStore(Gu),d;try{d=m.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i})}catch(f){return n(f)}d.onsuccess=()=>o({modelArtifactsInfo:i}),d.onerror=f=>{u=p.objectStore(cu);let h=u.delete(this.modelPath);h.onsuccess=()=>(a.close(),n(d.error)),h.onerror=g=>(a.close(),n(d.error))}},l.onerror=m=>(a.close(),n(l.error)),p.oncomplete=()=>{c==null?a.close():c.oncomplete=()=>a.close()}}},s.onerror=a=>n(s.error)})}};Ra.URL_SCHEME=\"indexeddb://\";var n1=r=>A().getBool(\"IS_BROWSER\")&&!Array.isArray(r)&&r.startsWith(Ra.URL_SCHEME)?YH(r.slice(Ra.URL_SCHEME.length)):null;Xt.registerSaveRouter(n1);Xt.registerLoadRouter(n1);function YH(r){return new Ra(r)}function QH(r){return r.startsWith(Ra.URL_SCHEME)?r.slice(Ra.URL_SCHEME.length):r}var yd=class{constructor(){this.indexedDB=o1()}async listModels(){return new Promise((e,t)=>{let o=this.indexedDB.open(Gw,Hw);o.onupgradeneeded=()=>Kw(o),o.onsuccess=()=>{let n=o.result,s=n.transaction(cu,\"readonly\"),i=s.objectStore(cu).getAll();i.onsuccess=()=>{let p={};for(let u of i.result)p[u.modelPath]=u.modelArtifactsInfo;e(p)},i.onerror=p=>(n.close(),t(i.error)),s.oncomplete=()=>n.close()},o.onerror=n=>t(o.error)})}async removeModel(e){return e=QH(e),new Promise((t,o)=>{let n=this.indexedDB.open(Gw,Hw);n.onupgradeneeded=()=>Kw(n),n.onsuccess=()=>{let s=n.result,a=s.transaction(cu,\"readwrite\"),i=a.objectStore(cu),p=i.get(e),u;p.onsuccess=()=>{if(p.result==null)return s.close(),o(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let l=i.delete(e),c=()=>{u=s.transaction(Gu,\"readwrite\");let d=u.objectStore(Gu).delete(e);d.onsuccess=()=>t(p.result.modelArtifactsInfo),d.onerror=f=>o(p.error)};l.onsuccess=c,l.onerror=m=>(c(),s.close(),o(p.error))}},p.onerror=l=>(s.close(),o(p.error)),a.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}},n.onerror=s=>o(n.error)})}};var hi=\"/\",ul=\"tensorflowjs_models\",s1=\"info\",ZH=\"model_topology\",JH=\"weight_specs\",eK=\"weight_data\",tK=\"model_metadata\";function a1(r){return{info:[ul,r,s1].join(hi),topology:[ul,r,ZH].join(hi),weightSpecs:[ul,r,JH].join(hi),weightData:[ul,r,eK].join(hi),modelMetadata:[ul,r,tK].join(hi)}}function i1(r){for(let e of Object.values(r))window.localStorage.removeItem(e)}function rK(r){let e=r.split(hi);if(e.length<3)throw new Error(`Invalid key format: ${r}`);return e.slice(1,e.length-1).join(hi)}function oK(r){return r.startsWith(Da.URL_SCHEME)?r.slice(Da.URL_SCHEME.length):r}var Da=class{constructor(e){if(!A().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=a1(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),o=JSON.stringify(e.weightSpecs),n=$a(e),s=lr.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(n)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,o),this.LS.setItem(this.keys.weightData,Yk(s));let a={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,initializerSignature:e.initializerSignature!=null?e.initializerSignature:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:n}}catch(a){throw i1(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.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={},o=JSON.parse(this.LS.getItem(this.keys.topology));if(o==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=o;let n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(n==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=n;let s=this.LS.getItem(this.keys.modelMetadata);if(s!=null){let i=JSON.parse(s);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),i.initializerSignature!=null&&(t.initializerSignature=i.initializerSignature),i.trainingConfig!=null&&(t.trainingConfig=i.trainingConfig)}let a=this.LS.getItem(this.keys.weightData);if(a==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=Qk(a),t}};Da.URL_SCHEME=\"localstorage://\";var u1=r=>A().getBool(\"IS_BROWSER\")&&!Array.isArray(r)&&r.startsWith(Da.URL_SCHEME)?nK(r.slice(Da.URL_SCHEME.length)):null;Xt.registerSaveRouter(u1);Xt.registerLoadRouter(u1);function nK(r){return new Da(r)}var bd=class{constructor(){$(A().getBool(\"IS_BROWSER\"),()=>\"Current environment is not a web browser\"),$(typeof window==\"undefined\"||typeof window.localStorage!=\"undefined\",()=>\"Current browser does not appear to support localStorage\"),this.LS=window.localStorage}async listModels(){let e={},t=ul+hi,o=hi+s1;for(let n=0;n\"scheme must not be undefined or null.\"),e.endsWith(pl)&&(e=e.slice(0,e.indexOf(pl))),$(e.length>0,()=>\"scheme must not be an empty string.\");let o=r.getInstance();$(o.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),o.managers[e]=t}static getManager(e){let t=r.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(r.getInstance().managers)}};function Cd(r){if(r.indexOf(pl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Hs.getSchemes().join(\",\")}`);return{scheme:r.split(pl)[0],path:r.split(pl)[1]}}async function p1(r,e,t=!1){$(r!==e,()=>`Old path and new path are the same: '${r}'`);let o=Xt.getLoadHandlers(r);$(o.length>0,()=>`Copying failed because no load handler is found for source URL ${r}.`),$(o.length<2,()=>`Copying failed because more than one (${o.length}) load handlers for source URL ${r}.`);let n=o[0],s=Xt.getSaveHandlers(e);$(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${e}.`),$(s.length<2,()=>`Copying failed because more than one (${o.length}) save handlers for destination URL ${e}.`);let a=s[0],i=Cd(r).scheme,p=Cd(r).path,u=i===Cd(r).scheme,l=await n.load();t&&u&&await Hs.getManager(i).removeModel(p);let c=await a.save(l);return t&&!u&&await Hs.getManager(i).removeModel(p),c.modelArtifactsInfo}async function l1(){let r=Hs.getSchemes(),e={};for(let t of r){let o=await Hs.getManager(t).listModels();for(let n in o){let s=t+pl+n;e[s]=o[n]}}return e}async function c1(r){let e=Cd(r);return Hs.getManager(e.scheme).removeModel(e.path)}async function m1(r,e){return p1(r,e,!1)}async function d1(r,e){return p1(r,e,!0)}var qw=class{constructor(){this.messageName=\"setTimeoutCustom\",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}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)}setTimeoutCustom(e,t){if(typeof window==\"undefined\"||!A().getBool(\"USE_SETTIMEOUTCUSTOM\")){setTimeout(e,t);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},\"*\")},t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener(\"message\",o=>{if(o.source===window&&o.data.name===this.messageName){o.stopPropagation();let n=this.functionRefs[o.data.index];n(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(e){return id(e)}};if(A().get(\"IS_BROWSER\")){A().setPlatform(\"browser\",new qw);try{Hs.registerManager(Da.URL_SCHEME,new bd)}catch(r){}try{Hs.registerManager(Ra.URL_SCHEME,new yd)}catch(r){}}var sK={importFetch:()=>f1()},jw;var Xw=class{constructor(){this.util=h1(),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return A().global.fetch!=null?A().global.fetch(e,t):(jw==null&&(jw=sK.importFetch()),jw(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)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}};A().get(\"IS_NODE\")&&!A().get(\"IS_BROWSER\")&&A().setPlatform(\"node\",new Xw);function ie(r,e=\"float32\",t){return e=e||\"float32\",St(r),new Ge(r,e,t)}function aK(r,e){let t=v(r,\"x\",\"cast\");if(!hw(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if(e===\"string\"&&t.dtype!==\"string\"||e!==\"string\"&&t.dtype===\"string\")throw new Error(\"Only strings can be casted to strings\");let o={x:t},n={dtype:e};return _.runKernel(ho,o,n)}var Ue=N({cast_:aK});function iK(r){let t={x:v(r,\"x\",\"clone\",\"string_or_numeric\")};return _.runKernel(vo,t)}var Xr=N({clone_:iK});function wd(r,e=!1){console.log(r.toString(e))}Ow();var uK={buffer:ie,cast:Ue,clone:Xr,print:wd};Lk(uK);function pK(r,e){let t=v(r,\"a\",\"add\"),o=v(e,\"b\",\"add\");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(Rr,n)}var Ce=N({add_:pK});function lK(r,e){let t=v(r,\"a\",\"floorDiv\"),o=v(e,\"b\",\"floorDiv\");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(wo,n)}var Sd=N({floorDiv_:lK});function cK(r,e){let t=v(r,\"a\",\"div\"),o=v(e,\"b\",\"div\");if([t,o]=Oe(t,o),t.dtype===\"int32\"&&o.dtype===\"int32\")return Sd(t,o);let n={a:t,b:o},s={};return _.runKernel(Vn,n,s)}var Xe=N({div_:cK});function mK(r,e){let t=v(r,\"a\",\"mul\"),o=v(e,\"b\",\"mul\");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel($o,n)}var se=N({mul_:mK});function dK(r){let e=v(r,\"x\",\"abs\");if(e.dtype===\"complex64\"){let t={x:e};return _.runKernel(Wi,t)}else{let t={x:e};return _.runKernel(fn,t)}}var er=N({abs_:dK});function fK(r){let t={x:v(r,\"x\",\"acos\")};return _.runKernel(hn,t)}var g1=N({acos_:fK});function hK(r){let t={x:v(r,\"x\",\"acosh\")};return _.runKernel(gn,t)}var x1=N({acosh_:hK});function gK(r){$(Array.isArray(r),()=>\"The argument passed to tf.addN() must be a list of tensors\"),$(r.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${r.length}`);let e=r.map((n,s)=>v(n,`tensors${s}`,\"addN\")),t=e[0];e.forEach(n=>{if(n.dtype!==t.dtype)throw new Error(\"All tensors passed to tf.addN() must have the same dtype\")}),e.forEach(n=>{if(!Sr(n.shape,t.shape))throw new Error(\"All tensors passed to tf.addN() must have the same shape\")});let o=e;return _.runKernel(xn,o)}var y1=N({addN_:gK});function xK(r,e=null,t=!1){let n={x:v(r,\"x\",\"all\",\"bool\")},s={axis:e,keepDims:t};return _.runKernel(yn,n,s)}var b1=N({all_:xK});function yK(r,e=null,t=!1){let n={x:v(r,\"x\",\"any\",\"bool\")},s={axis:e,keepDims:t};return _.runKernel(bn,n,s)}var C1=N({any_:yK});function bK(r,e=0){let o={x:v(r,\"x\",\"argMax\")},n={axis:e};return _.runKernel(na,o,n)}var w1=N({argMax_:bK});function CK(r,e=0){let o={x:v(r,\"x\",\"argMin\")},n={axis:e};return _.runKernel(sa,o,n)}var S1=N({argMin_:CK});function wK(r){let t={x:v(r,\"x\",\"asin\")};return _.runKernel(Cn,t)}var I1=N({asin_:wK});function SK(r){let t={x:v(r,\"x\",\"asinh\")};return _.runKernel(wn,t)}var v1=N({asinh_:SK});function IK(r){let t={x:v(r,\"x\",\"atan\")};return _.runKernel(Sn,t)}var k1=N({atan_:IK});function vK(r,e){let t=v(r,\"a\",\"atan2\"),o=v(e,\"b\",\"atan2\");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(vn,n)}var N1=N({atan2_:vK});function kK(r){let t={x:v(r,\"x\",\"atanh\")};return _.runKernel(In,t)}var T1=N({atanh_:kK});function NK(r,e,t,o,n=\"NHWC\",s){let a=r[3],i=[...e,a],p=E1(n);return Ku(r,i,t,s,o,null,null,p)}function Qw(r,e,t,o,n,s,a=\"channelsLast\"){let[i,p]=$c(e),u;if(a===\"channelsLast\")u=[i,p,r[3],r[3]];else if(a===\"channelsFirst\")u=[i,p,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return Ku(r,u,t,o,n,s,!1,a)}function TK(r,e,t,o,n,s,a=\"NDHWC\"){let[i,p,u]=Yw(e),l,c;if(a===\"NDHWC\")c=\"channelsLast\",l=[i,p,u,r[4],r[4]];else if(a===\"NCDHW\")c=\"channelsFirst\",l=[i,p,u,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return _1(r,l,t,o,n,!1,c,s)}function Ku(r,e,t,o,n,s,a=!1,i=\"channelsLast\"){let[p,u,l,c]=[-1,-1,-1,-1];if(i===\"channelsLast\")[p,u,l,c]=r;else if(i===\"channelsFirst\")[p,c,u,l]=r;else throw new Error(`Unknown dataFormat ${i}`);let[m,d,,f]=e,[h,g]=$c(t),[x,b]=$c(o),w=ll(m,x),S=ll(d,b),{padInfo:k,outHeight:T,outWidth:E}=$K(n,u,l,h,g,w,S,s,i),R=a?f*c:f,D;return i===\"channelsFirst\"?D=[p,R,T,E]:i===\"channelsLast\"&&(D=[p,T,E,R]),{batchSize:p,dataFormat:i,inHeight:u,inWidth:l,inChannels:c,outHeight:T,outWidth:E,outChannels:R,padInfo:k,strideHeight:h,strideWidth:g,filterHeight:m,filterWidth:d,effectiveFilterHeight:w,effectiveFilterWidth:S,dilationHeight:x,dilationWidth:b,inShape:r,outShape:D,filterShape:e}}function _1(r,e,t,o,n,s=!1,a=\"channelsLast\",i){let[p,u,l,c,m]=[-1,-1,-1,-1,-1];if(a===\"channelsLast\")[p,u,l,c,m]=r;else if(a===\"channelsFirst\")[p,m,u,l,c]=r;else throw new Error(`Unknown dataFormat ${a}`);let[d,f,h,,g]=e,[x,b,w]=Yw(t),[S,k,T]=Yw(o),E=ll(d,S),R=ll(f,k),D=ll(h,T),{padInfo:F,outDepth:O,outHeight:M,outWidth:L}=RK(n,u,l,c,x,b,w,E,R,D,i),B=s?g*m:g,z;return a===\"channelsFirst\"?z=[p,B,O,M,L]:a===\"channelsLast\"&&(z=[p,O,M,L,B]),{batchSize:p,dataFormat:a,inDepth:u,inHeight:l,inWidth:c,inChannels:m,outDepth:O,outHeight:M,outWidth:L,outChannels:B,padInfo:F,strideDepth:x,strideHeight:b,strideWidth:w,filterDepth:d,filterHeight:f,filterWidth:h,effectiveFilterDepth:E,effectiveFilterHeight:R,effectiveFilterWidth:D,dilationDepth:S,dilationHeight:k,dilationWidth:T,inShape:r,outShape:z,filterShape:e}}function _K(r,e,t,o,n){o==null&&(o=Zw(r,e,t));let s=r[0],a=r[1],i=Rc((s-e+2*o)/t+1,n),p=Rc((a-e+2*o)/t+1,n);return[i,p]}function EK(r,e,t,o,n,s){n==null&&(n=Zw(r,e[0],o[0]));let a=[0,0,0,t];for(let i=0;i<3;i++)r[i]+2*n>=e[i]&&(a[i]=Rc((r[i]-e[i]+2*n)/o[i]+1,s));return a}function Zw(r,e,t,o=1){let n=ll(e,o);return Math.floor((r[0]*(t-1)-t+n)/2)}function $c(r){return typeof r==\"number\"?[r,r,r]:r.length===2?[r[0],r[1],1]:r}function Yw(r){return typeof r==\"number\"?[r,r,r]:r}function ll(r,e){return e<=1?r:r+(r-1)*(e-1)}function $K(r,e,t,o,n,s,a,i,p){let u,l,c;if(typeof r==\"number\"){u={top:r,bottom:r,left:r,right:r,type:r===0?\"VALID\":\"NUMBER\"};let d=_K([e,t],s,o,r,i);l=d[0],c=d[1]}else if(r===\"same\"){l=Math.ceil(e/o),c=Math.ceil(t/n);let m=Math.max(0,(l-1)*o+s-e),d=Math.max(0,(c-1)*n+a-t),f=Math.floor(m/2),h=m-f,g=Math.floor(d/2),x=d-g;u={top:f,bottom:h,left:g,right:x,type:\"SAME\"}}else if(r===\"valid\")u={top:0,bottom:0,left:0,right:0,type:\"VALID\"},l=Math.ceil((e-s+1)/o),c=Math.ceil((t-a+1)/n);else if(typeof r==\"object\"){let m=p===\"channelsLast\"?r[1][0]:r[2][0],d=p===\"channelsLast\"?r[1][1]:r[2][1],f=p===\"channelsLast\"?r[2][0]:r[3][0],h=p===\"channelsLast\"?r[2][1]:r[3][1];u={top:m,bottom:d,left:f,right:h,type:m===0&&d===0&&f===0&&h===0?\"VALID\":\"EXPLICIT\"},l=Rc((e-s+m+d)/o+1,i),c=Rc((t-a+f+h)/n+1,i)}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:u,outHeight:l,outWidth:c}}function RK(r,e,t,o,n,s,a,i,p,u,l){let c,m,d,f;if(r===\"valid\"&&(r=0),typeof r==\"number\"){c={top:r,bottom:r,left:r,right:r,front:r,back:r,type:r===0?\"VALID\":\"NUMBER\"};let g=EK([e,t,o,1],[i,p,u],1,[n,s,a],r,l);m=g[0],d=g[1],f=g[2]}else if(r===\"same\"){m=Math.ceil(e/n),d=Math.ceil(t/s),f=Math.ceil(o/a);let h=(m-1)*n+i-e,g=(d-1)*s+p-t,x=(f-1)*a+u-o,b=Math.floor(h/2),w=h-b,S=Math.floor(g/2),k=g-S,T=Math.floor(x/2),E=x-T;c={top:S,bottom:k,left:T,right:E,front:b,back:w,type:\"SAME\"}}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:c,outDepth:m,outHeight:d,outWidth:f}}function Rc(r,e){if(!e)return Math.trunc(r);switch(e){case\"round\":return Math.round(r);case\"ceil\":return Math.ceil(r);case\"floor\":return Math.floor(r);default:throw new Error(`Unknown roundingMode ${e}`)}}function Hu(r){let[e,t,o]=$c(r);return e===1&&t===1&&o===1}function br(r,e){return Hu(r)||Hu(e)}function Aa(r){return $c(r).every(e=>e>0)}function E1(r){if(r===\"NHWC\")return\"channelsLast\";if(r===\"NCHW\")return\"channelsFirst\";throw new Error(`Unknown dataFormat ${r}`)}function zt(r,e,t){if(t!=null){if(typeof e==\"string\")throw Error(`Error in ${r}: pad must be an integer when using dimRoundingMode ${t} but got pad ${e}.`);if(typeof e==\"number\")$(Ja(e),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${t} but got pad ${e}.`);else if(typeof e==\"object\")e.forEach(o=>{o.forEach(n=>{$(Ja(n),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${t} but got pad ${n}.`)})});else throw Error(`Error in ${r}: Unknown padding parameter: ${e}`)}}function DK(r,e){let o={x:v(r,\"x\",\"reshape\",\"string_or_numeric\")},n={shape:e};return _.runKernel(Ca,o,n)}var W=N({reshape_:DK});function AK(r,e,t,o,n){let s=v(r,\"x\",\"avgPool\",\"float32\"),a=1;$(br(t,a),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${a}'`);let i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${i.rank}.`),zt(\"avgPool\",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n},c=_.runKernel(kn,u,l);return c=Ue(c,s.dtype),p?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var Id=N({avgPool_:AK});function FK(r,e,t,o,n,s=\"NDHWC\"){let a=v(r,\"x\",\"avgPool3d\",\"float32\"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s===\"NDHWC\",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),$(typeof t==\"number\"&&t>0||Array.isArray(t)&&t[0]>0&&t[1]>0&&t[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${t}'`),zt(\"avgPool3d\",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n,dataFormat:s},c=_.runKernel(aa,u,l);return c=Ue(c,i.dtype),p?W(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var $1=N({avgPool3d_:FK});function PK(r,e=0){$(r.length>=1,()=>\"Pass at least one tensor to concat\");let t=di(r,\"tensors\",\"concat\",\"string_or_numeric\");if(t[0].dtype===\"complex64\"&&t.forEach(s=>{if(s.dtype!==\"complex64\")throw new Error(`Cannot concatenate complex64 tensors with a tensor\n with dtype ${s.dtype}. `)}),t.length===1)return Xr(t[0]);let o=t,n={axis:e};return _.runKernel(pa,o,n)}var bt=N({concat_:PK});function OK(r,e,t=!1,o=!1){let n=v(r,\"a\",\"matMul\"),s=v(e,\"b\",\"matMul\");[n,s]=Oe(n,s);let a={a:n,b:s},i={transposeA:t,transposeB:o};return _.runKernel(Nn,a,i)}var Je=N({matMul_:OK});function MK(r){let t={x:v(r,\"x\",\"sigmoid\",\"float32\")};return _.runKernel(Ao,t)}var Pa=N({sigmoid_:MK});function LK(r,e,t){let o=v(r,\"x\",\"slice\",\"string_or_numeric\");if(o.rank===0)throw new Error(\"Slicing scalar is not possible\");let n={x:o},s={begin:e,size:t};return _.runKernel(_s,n,s)}var Ye=N({slice_:LK});function BK(r){let t={x:v(r,\"x\",\"tanh\",\"float32\")};return _.runKernel(Ls,t)}var Dc=N({tanh_:BK});function zK(r,e,t,o,n,s){let a=v(r,\"forgetBias\",\"basicLSTMCell\"),i=v(e,\"lstmKernel\",\"basicLSTMCell\"),p=v(t,\"lstmBias\",\"basicLSTMCell\"),u=v(o,\"data\",\"basicLSTMCell\"),l=v(n,\"c\",\"basicLSTMCell\"),c=v(s,\"h\",\"basicLSTMCell\"),m=bt([u,c],1),d=Je(m,i),f=Ce(d,p),h=f.shape[0],g=f.shape[1]/4,x=[h,g],b=Ye(f,[0,0],x),w=Ye(f,[0,g],x),S=Ye(f,[0,g*2],x),k=Ye(f,[0,g*3],x),T=Ce(se(Pa(b),Dc(w)),se(l,Pa(Ce(a,S)))),E=se(Dc(T),Pa(k));return[T,E]}var R1=N({basicLSTMCell_:zK});function VK(r,e,t){let o=v(r,\"x\",\"batchToSpaceND\"),n=e.reduce((i,p)=>i*p);$(o.rank>=1+e.length,()=>`input rank is ${o.rank} but should be > than blockShape.length ${e.length}`),$(t.length===e.length,()=>`crops.length is ${t.length} but should be equal to blockShape.length ${e.length}`),$(o.shape[0]%n===0,()=>`input tensor batch is ${o.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(\" * \")} === ${n}`);let s={x:o},a={blockShape:e,crops:t};return _.runKernel(ia,s,a)}var vd=N({batchToSpaceND_:VK});function D1(r){let e;return r.rank===0||r.rank===1?e=W(r,[1,1,1,r.size]):r.rank===2?e=W(r,[1,1,r.shape[0],r.shape[1]]):r.rank===3?e=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]):e=r,e}function WK(r,e,t,o,n,s){s==null&&(s=.001);let a=v(r,\"x\",\"batchNorm\"),i=v(e,\"mean\",\"batchNorm\"),p=v(t,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let l;o!=null&&(l=v(o,\"offset\",\"batchNorm\")),$(i.rank===p.rank,()=>\"Batch normalization gradient requires mean and variance to have equal ranks.\"),$(l==null||i.rank===l.rank,()=>\"Batch normalization gradient requires mean and offset to have equal ranks.\"),$(u==null||i.rank===u.rank,()=>\"Batch normalization gradient requires mean and scale to have equal ranks.\");let m={x:D1(a),scale:u,offset:l,mean:i,variance:p},d={varianceEpsilon:s},f=_.runKernel(Hn,m,d);return W(f,a.shape)}var mu=N({batchNorm_:WK});function UK(r,e,t,o,n,s){let a=v(r,\"x\",\"batchNorm\"),i=v(e,\"mean\",\"batchNorm\"),p=v(t,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let l;return o!=null&&(l=v(o,\"offset\",\"batchNorm\")),$(a.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`),$(i.rank===2||i.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`),$(p.rank===2||p.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),l!=null&&$(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${l.rank}.`),mu(a,i,p,l,u,s)}var A1=N({batchNorm2d_:UK});function GK(r,e,t,o,n,s){let a=v(r,\"x\",\"batchNorm\"),i=v(e,\"mean\",\"batchNorm\"),p=v(t,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let l;return o!=null&&(l=v(o,\"offset\",\"batchNorm\")),$(a.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`),$(i.rank===3||i.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`),$(p.rank===3||p.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),l!=null&&$(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${l.rank}.`),mu(a,i,p,l,u,s)}var F1=N({batchNorm3d_:GK});function HK(r,e,t,o,n,s){let a=v(r,\"x\",\"batchNorm\"),i=v(e,\"mean\",\"batchNorm\"),p=v(t,\"variance\",\"batchNorm\"),u;n!=null&&(u=v(n,\"scale\",\"batchNorm\"));let l;return o!=null&&(l=v(o,\"offset\",\"batchNorm\")),$(a.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`),$(i.rank===4||i.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`),$(p.rank===4||p.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),l!=null&&$(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${l.rank}.`),mu(a,i,p,l,u,s)}var P1=N({batchNorm4d_:HK});function KK(r,e,t){let o=v(r,\"x\",\"bincount\"),n=v(e,\"weights\",\"bincount\");$(o.dtype===\"int32\",()=>`Error in bincount: input dtype must be int32, but got ${o.dtype}`),$(t>=0,()=>`size must be non-negative, but got ${t}.`),$(n.size===o.size||n.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${o.shape}, weights shape: ${n.shape}.`);let s={x:o,weights:n},a={size:t};return _.runKernel(Tn,s,a)}var kd=N({bincount_:KK});function qK(r,e){let t=v(r,\"x\",\"bitwiseAnd\"),o=v(e,\"y\",\"bitwiseAnd\");if(!Sr(t.shape,o.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${t.shape}, y: ${o.shape}`);if(t.dtype!==\"int32\"||o.dtype!==\"int32\")throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${t.dtype} and type of y: ${o.dtype}`);let n={a:t,b:o};return _.runKernel(_n,n)}var O1=N({bitwiseAnd_:qK});function jK(r,e){let t=v(r,\"s0\",\"broadcastArgs\",\"int32\"),o=v(e,\"s1\",\"broadcastArgs\",\"int32\");if(t.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${t.rank}`);if(o.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${o.rank}`);let n={s0:t,s1:o};return _.runKernel(ua,n)}var M1=N({broadcastArgs_:jK});function XK(r,e){let t=v(r,\"broadcastTo\",\"x\"),o=t.shape;if(St(e),e.lengtht.rank){let u=t.shape.slice();for(;u.length=0;u--)if(n[u]===e[u])s[u]=1;else if(t.shape[u]!==1)throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${e}].`);if(s.map((u,l)=>u>1?l:-1).filter(u=>u>=0).length===0)return Xr(t);let i={x:t},p={reps:s};return _.runKernel(Mo,i,p)}var Oa=N({broadcastTo_:XK});function YK(r){let t={x:v(r,\"x\",\"ceil\",\"float32\")};return _.runKernel(go,t)}var L1=N({ceil_:YK});function Ma(r,e,t){St(r),t=t||Bi(e);let o={shape:r,value:e,dtype:t};return _.runKernel(da,{},o)}function QK(r,e,t){let o=v(r,\"x\",\"clipByValue\");if($(e<=t,()=>`Error in clip: min (${e}) must be less than or equal to max (${t}).`),e===t)return Ma(o.shape,e,o.dtype);let n={x:o},s={clipValueMin:e,clipValueMax:t};return _.runKernel(Go,n,s)}var B1=N({clipByValue_:QK});function ZK(r){return bt(r,0)}var z1=N({concat1d_:ZK});function JK(r,e){return bt(r,e)}var V1=N({concat2d_:JK});function eq(r,e){return bt(r,e)}var W1=N({concat3d_:eq});function tq(r,e){return bt(r,e)}var U1=N({concat4d_:tq});function rq(r,e,t,o,n=\"NHWC\",s=[1,1],a){let i=v(r,\"x\",\"conv2d\",\"float32\"),p=v(e,\"filter\",\"conv2d\",\"float32\"),u=i,l=!1;i.rank===3&&(l=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${p.rank}.`),zt(\"conv2d\",o,a);let c=n===\"NHWC\"?u.shape[3]:u.shape[1];$(c===p.shape[2],()=>`Error in conv2d: depth of input (${c}) must match input depth for filter ${p.shape[2]}.`),$(br(t,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),$(Aa(s),()=>\"Error in conv2D: Dilated rates should be larger than 0.\"),$(Aa(t),()=>\"Error in conv2D: Strides should be larger than 0.\");let m={x:u,filter:p},d={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=_.runKernel(En,m,d);return l?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var du=N({conv2d_:rq});function oq(r,e,t,o,n=\"NWC\",s=1,a){let i=v(r,\"x\",\"conv1d\"),p=v(e,\"filter\",\"conv1d\"),u=i,l=!1;i.rank===2&&(l=!0,u=W(i,[1,i.shape[0],i.shape[1]])),$(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),$(p.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${p.rank}.`),zt(\"conv1d\",o,a),$(u.shape[2]===p.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${p.shape[1]}.`),$(br(t,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${t} and dilation '${s}'`),$(Aa(s),()=>\"Error in conv1D: Dilated rates should be larger than 0.\"),$(Aa(t),()=>\"Error in conv1D: Stride should be larger than 0.\"),$(n===\"NWC\",()=>`Error in conv1d: got dataFormat of ${n} but only NWC is currently supported.`);let c=W(p,[1,p.shape[0],p.shape[1],p.shape[2]]),m=W(u,[u.shape[0],1,u.shape[1],u.shape[2]]),g=du(m,c,[1,t],o,\"NHWC\",[1,s],a);return l?W(g,[g.shape[2],g.shape[3]]):W(g,[g.shape[0],g.shape[2],g.shape[3]])}var G1=N({conv1d_:oq});function nq(r,e,t,o,n,s=\"NHWC\",a){$(r.length===e.rank,()=>`Length of inShape (${r.length}) and rank of dy (${e.rank}) must match`);let i=r,p=e,u=!1;e.rank===3&&(u=!0,p=W(e,[1,e.shape[0],e.shape[1],e.shape[2]]),i=[1,r[0],r[1],r[2]]),$(i.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${i.length}.`),$(p.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${p.rank}`),$(t.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${t.rank}`);let l=s===\"NHWC\"?i[3]:i[1],c=s===\"NHWC\"?p.shape[3]:p.shape[1];$(l===t.shape[2],()=>`Error in conv2dDerInput: depth of input (${l}) must match input depth for filter ${t.shape[2]}.`),$(c===t.shape[3],()=>`Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${t.shape[3]}.`),zt(\"conv2dDerInput\",n,a);let m={dy:p,filter:t},d={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,inputShape:i},f=_.runKernel($n,m,d);return u?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var Nd=N({conv2DBackpropInput_:nq});function sq(r,e,t,o,n,s){let a=v(r,\"x\",\"conv2dTranspose\"),i=v(e,\"filter\",\"conv2dTranspose\");return Nd(t,a,i,o,n,\"NHWC\",s)}var H1=N({conv2dTranspose_:sq});function aq(r,e,t,o,n=\"NDHWC\",s=[1,1,1]){let a=v(r,\"x\",\"conv3d\"),i=v(e,\"filter\",\"conv3d\"),p=a,u=!1;a.rank===4&&(u=!0,p=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(p.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${p.rank}.`),$(i.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`),$(p.shape[4]===i.shape[3],()=>`Error in conv3d: depth of input (${p.shape[4]}) must match input depth for filter ${i.shape[3]}.`),$(br(t,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),$(n===\"NDHWC\",()=>`Error in conv3d: got dataFormat of ${n} but only NDHWC is currently supported.`),$(Aa(s),()=>\"Error in conv3D: Dilated rates should be larger than 0.\"),$(Aa(t),()=>\"Error in conv3D: Strides should be larger than 0.\");let l={x:p,filter:i},c={strides:t,pad:o,dataFormat:n,dilations:s},m=_.runKernel(Rn,l,c);return u?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var K1=N({conv3d_:aq});function iq(r,e,t,o,n){$(r.length===e.rank,()=>`Length of inShape (${r.length}) and rank of dy (${e.rank}) must match`);let s=r,a=e,i=!1;e.rank===4&&(i=!0,a=W(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),s=[1,r[0],r[1],r[2],r[3]]);let p=s[4],u=a.shape[4];$(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),$(a.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`),$(t.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${t.rank}`),$(p===t.shape[3],()=>`Error in conv3dDerInput: depth of input (${p}) must match input depth for filter ${t.shape[3]}.`),$(u===t.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${t.shape[4]}.`);let l={dy:a,filter:t},c={pad:n,strides:o,inputShape:s},m=_.runKernel(Dn,l,c);return i?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var q1=N({conv3DBackpropInput_:iq});function uq(r,e,t,o,n){let s=v(r,\"x\",\"conv3dTranspose\"),a=v(e,\"filter\",\"conv3dTranspose\");return q1(t,s,a,o,n)}var j1=N({conv3dTranspose_:uq});function pq(r){let t={x:v(r,\"x\",\"cos\",\"float32\")};return _.runKernel(An,t)}var X1=N({cos_:pq});function lq(r){let t={x:v(r,\"x\",\"cosh\",\"float32\")};return _.runKernel(Fn,t)}var Y1=N({cosh_:lq});function cq(r,e=0,t=!1,o=!1){let s={x:v(r,\"x\",\"cumprod\")},a={axis:e,exclusive:t,reverse:o};return _.runKernel(Pn,s,a)}var Q1=N({cumprod_:cq});function mq(r,e=0,t=!1,o=!1){let s={x:v(r,\"x\",\"cumsum\")},a={axis:e,exclusive:t,reverse:o};return _.runKernel(On,s,a)}var Z1=N({cumsum_:mq});function dq(r,e,t,o=!1){let n=v(r,\"x\",\"denseBincount\"),s=v(e,\"weights\",\"denseBincount\");$(n.dtype===\"int32\",()=>`Error in denseBincount: input dtype must be int32, but got ${n.dtype}`),$(n.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${n.rank}.`),$(t>=0,()=>`size must be non-negative, but got ${t}.`),$(s.size===n.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${n.shape}, weights shape: ${s.shape}.`);let a={x:n,weights:s},i={size:t,binaryOutput:o};return _.runKernel(la,a,i)}var J1=N({denseBincount_:dq});function fq(r,e,t=\"NHWC\"){let o=v(r,\"x\",\"depthToSpace\",\"float32\"),n=t===\"NHWC\"?o.shape[1]:o.shape[2],s=t===\"NHWC\"?o.shape[2]:o.shape[3],a=t===\"NHWC\"?o.shape[3]:o.shape[1];$(e>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${e}`),$(n*e>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${n} and ${e} for depthToSpace with input shape\n ${o.shape}`),$(s*e>=0,()=>`Negative dimension size caused by overflow when multiplying\n ${s} and ${e} for depthToSpace with input shape\n ${o.shape}`),$(a%(e*e)===0,()=>`Dimension size must be evenly divisible by ${e*e} but is ${a} for depthToSpace with input shape ${o.shape}`);let i={x:o},p={blockSize:e,dataFormat:t};return _.runKernel(Ln,i,p)}var e2=N({depthToSpace_:fq});function hq(r,e,t,o,n=\"NHWC\",s=[1,1],a){let i=v(r,\"x\",\"depthwiseConv2d\",\"float32\"),p=v(e,\"filter\",\"depthwiseConv2d\",\"float32\"),u=i,l=!1;i.rank===3&&(l=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`);let c=n===\"NHWC\"?u.shape[3]:u.shape[1];$(c===p.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${c}) must match the inChannels dimension in filter ${p.shape[2]}.`),zt(\"depthwiseConv2d\",o,a);let m={x:u,filter:p},d={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=_.runKernel(Bn,m,d);return l?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var cl=N({depthwiseConv2d_:hq});function gq(r){let t={x:v(r,\"x\",\"diag\")};return _.runKernel(ca,t)}var t2=N({diag_:gq});function xq(r,e,t,o,n=[1,1],s=\"NHWC\"){let a=v(r,\"x\",\"dilation2d\"),i=v(e,\"filter\",\"dilation2d\");$(a.rank===3||a.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`),$(i.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${i.rank}.`),$(s===\"NHWC\",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let p=a,u=!1;a.rank===3&&(p=W(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0),$(p.shape[3]===i.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${p.shape[3]} vs ${i.shape[2]}`);let l={x:p,filter:i},c={strides:t,pad:o,dilations:n},m=_.runKernel(zn,l,c);return u?W(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var r2=N({dilation2d_:xq});var kr={};qe(kr,{assertAndGetBroadcastShape:()=>rt,getBroadcastDims:()=>o2,getReductionAxes:()=>Td});function o2(r,e){let t=r.length,o=[];for(let n=0;n1&&a===1&&o.unshift(s)}return o}function Td(r,e){let t=[];for(let o=0;o1)&&t.unshift(s)}return t}function rt(r,e){let t=Math.max(r.length,e.length),o=new Array(t);for(let n=0;n`Error in dot: inputs must all be rank 1 or 2, but got ranks ${t.rank} and ${o.rank}.`);let n=t.rank===1?t.size:t.shape[1],s=o.rank===1?o.size:o.shape[0];if($(n===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${n} and ${s}.`),t.rank===1&&o.rank===1){let a=W(t,[1,-1]),i=W(o,[-1,1]),p=Je(a,i);return W(p,[])}else if(t.rank===1&&o.rank===2){let a=W(t,[1,-1]),i=W(o,[o.shape[0],o.shape[1]]),p=Je(a,i);return W(p,[p.size])}else if(t.rank===2&&o.rank===1){let a=W(o,[-1,1]),i=Je(t,a);return W(i,[i.size])}else{let a=W(o,[o.shape[0],o.shape[1]]);return Je(t,a)}}var s2=N({dot_:Sq});function Iq(r,...e){let t=e.map((n,s)=>v(n,`tensors${s}`,\"einsum\")),o={equation:r};return _.runKernel(ji,t,o)}var fu=N({einsum_:Iq});function vq(r){let t={x:v(r,\"x\",\"elu\",\"float32\")};return _.runKernel(Wn,t)}var Ed=N({elu_:vq});function kq(r,e){let t=v(r,\"x\",\"ensureShape\",\"string_or_numeric\");if(!cw(t.shape,e))throw new Error(`EnsureShape: Shape of tensor ${t.shape} is not compatible with expected shape ${e}`);return r}var a2=N({ensureShape_:kq});function Nq(r){let e=v(r,\"x\",\"erf\");$(e.dtype===\"int32\"||e.dtype===\"float32\",()=>\"Input dtype must be `int32` or `float32`.\"),e.dtype===\"int32\"&&(e=Ue(e,\"float32\"));let t={x:e};return _.runKernel(Un,t)}var i2=N({erf_:Nq});function Jw(r,e){for(let t=0;tr[s]);return[t,n]}function gi(r,e){let t=e.map(o=>1);return u2(r,t,e)}function _q(r,e,t){$(Jw(e,t),()=>`${r} supports only inner-most axes for now. Got axes ${e} and rank-${t} input.`)}function Eq(r,e){if(Jw(r,e))return null;let t=[];for(let o=0;ot.push(o)),t}function $q(r){return r.map((e,t)=>[t,e]).sort((e,t)=>e[1]-t[1]).map(e=>e[0])}function Rq(r,e){let t=[];for(let o=e-r;o\"Axis must be <= rank of the tensor\");let o={input:t},n={dim:e};return _.runKernel(ma,o,n)}var Ks=N({expandDims_:Wq});function Uq(r){let t={x:v(r,\"x\",\"expm1\")};return _.runKernel(bo,t)}var c2=N({expm1_:Uq});function Gq(r,e){let t=v(r,\"x\",\"tile\",\"string_or_numeric\");$(t.rank===e.length,()=>`Error in transpose: rank of input ${t.rank} must match length of reps ${e}.`);let o={x:t},n={reps:e};return _.runKernel(Mo,o,n)}var hu=N({tile_:Gq});function Hq(r,e,t,o=\"float32\"){e==null&&(e=r);let n=ie([r,e],o),s=r<=e?r:e;for(let i=0;i`Error in localResponseNormalization: x must be rank 3 or 4 but got\n rank ${s.rank}.`),$(Ja(e),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`);let a=s,i=!1;s.rank===3&&(i=!0,a=W(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let p={x:a},u={depthRadius:e,bias:t,alpha:o,beta:n},l=_.runKernel(rs,p,u);return i?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var g2=N({localResponseNormalization_:o6});function n6(r){let t={x:v(r,\"x\",\"log\",\"float32\")};return _.runKernel(To,t)}var yi=N({log_:n6});function s6(r){let t={x:v(r,\"x\",\"log1p\")};return _.runKernel(Zn,t)}var Pd=N({log1p_:s6});function a6(r){return $(ra(r),()=>\"The f passed in grad(f) must be a function\"),(e,t)=>{let o=v(e,\"x\",\"tf.grad\",\"string_or_numeric\"),n=t!=null?v(t,\"dy\",\"tf.grad\"):null;return _.tidy(()=>{let{value:s,grads:a}=_.gradients(()=>r(o),[o],n);return n!=null&&yt(s.shape,n.shape,\"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)\"),Od(a),a[0]})}}function i6(r){return $(ra(r),()=>\"The f passed in grads(f) must be a function\"),(e,t)=>{$(Array.isArray(e),()=>\"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s\");let o=di(e,\"args\",\"tf.grads\",\"string_or_numeric\"),n=t!=null?v(t,\"dy\",\"tf.grads\"):null;return _.tidy(()=>{let{value:s,grads:a}=_.gradients(()=>r(...o),o,n);return n!=null&&yt(s.shape,n.shape,\"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),Od(a),a})}}function u6(r){return $(ra(r),()=>\"The f passed in valueAndGrad(f) must be a function\"),(e,t)=>{$(e instanceof dt,()=>\"The x passed in valueAndGrad(f)(x) must be a tensor\"),$(t==null||t instanceof dt,()=>\"The dy passed in valueAndGrad(f)(x, dy) must be a tensor\");let{grads:o,value:n}=_.gradients(()=>r(e),[e],t);return Od(o),{grad:o[0],value:n}}}function p6(r){return $(ra(r),()=>\"The f passed in valueAndGrads(f) must be a function\"),(e,t)=>{$(Array.isArray(e)&&e.every(n=>n instanceof dt),()=>\"The args passed in valueAndGrads(f)(args) must be array of tensors\"),$(t==null||t instanceof dt,()=>\"The dy passed in valueAndGrads(f)(args, dy) must be a tensor\");let o=_.gradients(()=>r(...e),e,t);return t!=null&&yt(o.value.shape,t.shape,\"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])\"),Od(o.grads),o}}function eS(r,e){$(ra(r),()=>\"The f passed in variableGrads(f) must be a function\"),$(e==null||Array.isArray(e)&&e.every(u=>u instanceof ci),()=>\"The varList passed in variableGrads(f, varList) must be an array of variables\");let t=e!=null;if(!t){e=[];for(let u in _.registeredVariables)e.push(_.registeredVariables[u])}let o=t?e.filter(u=>!u.trainable):null,n=e.length;e=e.filter(u=>u.trainable),$(e.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${n} variables is trainable.`);let s=!0,{value:a,grads:i}=_.gradients(r,e,null,s);$(i.some(u=>u!=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().\"),$(a.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`);let p={};return e.forEach((u,l)=>{i[l]!=null&&(p[u.name]=i[l])}),o!=null&&o.forEach(u=>p[u.name]=null),{value:a,grads:p}}function Nr(r){return _.customGrad(r)}function Od(r){if(r.filter(t=>t==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.`)}function l6(r){let t={x:v(r,\"x\",\"neg\")};return _.runKernel(ls,t)}var mr=N({neg_:l6});function c6(r){let t={x:v(r,\"x\",\"softplus\")};return _.runKernel(Ds,t)}var Md=N({softplus_:c6});function m6(r){let e=v(r,\"x\",\"logSigmoid\");return Nr(o=>({value:mr(Md(mr(o))),gradFunc:a=>se(a,Pa(mr(o)))}))(e)}var x2=N({logSigmoid_:m6});function d6(r,e){let t=v(r,\"a\",\"sub\"),o=v(e,\"b\",\"sub\");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(Oo,n)}var Te=N({sub_:d6});function f6(r,e=-1){let t=v(r,\"logits\",\"logSoftmax\");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and axis was ${e}`);return Nr((n,s)=>{let i=La(n,e,!0),p=Te(n,i),u=Te(Ue(p,\"float32\"),yi(ot(Jo(p),e,!0)));return s([u]),{value:u,gradFunc:(c,m)=>{let[d]=m,f=!0,h=Jo(d);return Te(c,se(ot(c,e,f),h))}}})(t)}var y2=N({logSoftmax_:f6});function h6(r,e=null,t=!1){let o=v(r,\"x\",\"logSumExp\"),n=Li(e,o.shape),s=La(o,n,!0),a=Te(o,s),i=Jo(a),p=ot(i,n),u=yi(p),l=Ce(W(s,u.shape),u);if(t){let c=gi(l.shape,n);return W(l,c)}return l}var Ld=N({logSumExp_:h6});function g6(r,e){let t=v(r,\"a\",\"logicalAnd\",\"bool\"),o=v(e,\"b\",\"logicalAnd\",\"bool\");rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(Jn,n)}var Xu=N({logicalAnd_:g6});function x6(r){let t={x:v(r,\"x\",\"logicalNot\",\"bool\")};return _.runKernel(es,t)}var Bd=N({logicalNot_:x6});function y6(r,e){let t=v(r,\"a\",\"logicalOr\",\"bool\"),o=v(e,\"b\",\"logicalOr\",\"bool\");rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(ts,n)}var zd=N({logicalOr_:y6});function b6(r,e){let t=v(r,\"a\",\"logicalXor\",\"bool\"),o=v(e,\"b\",\"logicalXor\",\"bool\");return rt(t.shape,o.shape),Xu(zd(r,e),Bd(Xu(r,e)))}var b2=N({logicalXor_:b6});var Vd=2147483648;function C6(r,e,t=\"left\"){let o=v(r,\"sortedSequence\",\"searchSorted\"),n=v(e,\"values\",\"searchSorted\"),s=o.shape[o.shape.length-1],a=n.shape[n.shape.length-1],i=W(o,[-1,s]),p=W(n,[-1,a]);if(i.rank<2)throw new Error(\"Sorted input argument must be at least 2-dimensional\");if(i.shape[0]!==p.shape[0])throw new Error(\"Leading dimension of 'sortedSequence' and 'values' must match.\");if(ze(p.shape)>=Vd)throw new Error(`values tensor size must less than ${Vd}`);if(i.shape[1]>=Vd)throw new Error(`trailing dim_size must less than ${Vd} for int32 output type, was ${i.shape[1]}`);let u={sortedSequence:i,values:p},l={side:t};return _.runKernel(Ns,u,l)}var Pc=N({searchSorted_:C6});function C2(r,e){return Pc(r,e,\"left\")}function w6(r,e,t,o,n){let s=v(r,\"x\",\"maxPool\"),a=1,i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${i.rank}.`),$(br(t,a),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${a}'`),zt(\"maxPool\",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n},c=_.runKernel(ns,u,l);return p?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var Wd=N({maxPool_:w6});function S6(r,e=[1,1,1],t,o,n,s=\"NDHWC\"){let a=v(r,\"x\",\"maxPool3d\"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s===\"NDHWC\",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),zt(\"maxPool3d\",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n,dataFormat:s},c=_.runKernel(ha,u,l);return p?W(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var w2=N({maxPool3d_:S6});function I6(r,e,t,o,n=!1){let a={x:v(r,\"x\",\"maxPoolWithArgmax\")},i={filterSize:e,strides:t,pad:o,includeBatchInIndex:n},p=_.runKernel(ga,a,i);return{result:p[0],indexes:p[1]}}var S2=N({maxPoolWithArgmax_:I6});function v6(r,e){let t=v(r,\"a\",\"maximum\"),o=v(e,\"b\",\"maximum\");[t,o]=Oe(t,o),t.dtype===\"bool\"&&(t=Ue(t,\"int32\"),o=Ue(o,\"int32\")),rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(_o,n)}var Ud=N({maximum_:v6});function k6(r,e=null,t=!1){let n={x:v(r,\"x\",\"mean\")},s={axis:e,keepDims:t};return _.runKernel(ss,n,s)}var Yu=N({mean_:k6});function Yr(r,e=\"float32\"){if(St(r),e===\"complex64\"){let o=Yr(r,\"float32\"),n=Yr(r,\"float32\");return Ar(o,n)}let t=Yp(ze(r),e);return _.makeTensor(t,r,e)}function Ba(r,e=\"float32\"){if(St(r),e===\"complex64\"){let o=Ba(r,\"float32\"),n=Yr(r,\"float32\");return Ar(o,n)}let t=bc(ze(r),e);return _.makeTensor(t,r,e)}function I2(r,e,{indexing:t=\"xy\"}={}){if(t!==\"xy\"&&t!==\"ij\")throw new TypeError(`${t} is not a valid third argument to meshgrid`);if(r===void 0)return[];let o=v(r,\"x\",\"meshgrid\",r instanceof dt?r.dtype:\"float32\");if(e===void 0)return[o];let n=v(e,\"y\",\"meshgrid\",e instanceof dt?e.dtype:\"float32\"),s=ze(o.shape),a=ze(n.shape);return t===\"xy\"?(o=W(o,[1,-1]),n=W(n,[-1,1]),[Je(Ba([a,1],o.dtype),o),Je(n,Ba([1,s],n.dtype))]):(o=W(o,[-1,1]),n=W(n,[1,-1]),[Je(o,Ba([1,a],o.dtype)),Je(Ba([s,1],n.dtype),n)])}function N6(r,e){let t=v(r,\"a\",\"minimum\"),o=v(e,\"b\",\"minimum\");[t,o]=Oe(t,o),t.dtype===\"bool\"&&(t=Ue(t,\"int32\"),o=Ue(o,\"int32\")),rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(Eo,n)}var Qu=N({minimum_:N6});function T6(r,e,t){$(t===\"reflect\"||t===\"symmetric\",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${t}.`);let o=v(r,\"x\",\"mirrorPad\");if(o.rank===0)throw new Error(\"mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad\");$(e.length===o.rank,()=>`Padding doesn't match input. Must be ${o.rank}. Got ${e.length}.`);let n=t===\"reflect\"?1:0;for(let i=0;i\"Invalid number of paddings. Must be length of 2 each.\"),$(e[i][0]>=0&&e[i][0]<=o.shape[i]-n&&e[i][1]>=0&&e[i][1]<=o.shape[i]-n,()=>`Padding in dimension ${i} cannot be greater than or equal to ${o.shape[i]-n} or less than 0 for input of shape ${o.shape}`);let s={paddings:e,mode:t},a={x:o};return _.runKernel(is,a,s)}var v2=N({mirrorPad_:T6});function _6(r,e){let t=v(r,\"a\",\"mod\"),o=v(e,\"b\",\"mod\");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(us,n)}var k2=N({mod_:_6});function E6(r,e=null,t=!1){r=v(r,\"x\",\"moments\");let o=Li(e,r.shape),n=Yu(r,o,t),s=n.shape;t||(s=gi(n.shape,o));let a=tr(Te(Ue(r,\"float32\"),W(n,s))),i=Yu(a,o,t);return{mean:n,variance:i}}var N2=N({moments_:E6});function $6(r,e,t,o){let n=v(e,\"data\",\"multiRNNCell\"),s=di(t,\"c\",\"multiRNNCell\"),a=di(o,\"h\",\"multiRNNCell\"),i=n,p=[];for(let c=0;c2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);t=t||Math.random();let p={logits:a===1?W(n,[1,-1]):n},u={numSamples:e,seed:t,normalized:o},l=_.runKernel(ps,p,u);return a===1?W(l,[l.size]):l}var _2=N({multinomial_:R6});function D6(r,e){let t=v(r,\"a\",\"notEqual\",\"string_or_numeric\"),o=v(e,\"b\",\"notEqual\",\"string_or_numeric\");[t,o]=Oe(t,o),rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(Ro,n)}var Gd=N({notEqual_:D6});function A6(r,e,t=1,o=0,n=\"int32\"){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);let a={indices:v(r,\"indices\",\"oneHot\",\"int32\")},i={dtype:n,depth:e,onValue:t,offValue:o};return _.runKernel(ds,a,i)}var Oc=N({oneHot_:A6});function F6(r){let t={x:v(r,\"x\",\"onesLike\")};return _.runKernel(xa,t)}var E2=N({onesLike_:F6});function P6(r,e){let t=v(r,\"v1\",\"outerProduct\"),o=v(e,\"v2\",\"outerProduct\");$(t.rank===1&&o.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${t.rank} and ${o.rank}.`);let n=W(t,[-1,1]),s=W(o,[1,-1]);return Je(n,s)}var $2=N({outerProduct_:P6});function O6(r,e,t=0){let o=v(r,\"x\",\"pad\");if(o.rank===0)throw new Error(\"pad(scalar) is not defined. Pass non-scalar to pad\");let n={paddings:e,constantValue:t},s={x:o};return _.runKernel(fs,s,n)}var za=N({pad_:O6});function M6(r,e,t=0){return $(e.length===2,()=>\"Invalid number of paddings. Must be length of 2.\"),za(r,[e],t)}var R2=N({pad1d_:M6});function L6(r,e,t=0){return $(e.length===2&&e[0].length===2&&e[1].length===2,()=>\"Invalid number of paddings. Must be length of 2 each.\"),za(r,e,t)}var D2=N({pad2d_:L6});function B6(r,e,t=0){return $(e.length===3&&e[0].length===2&&e[1].length===2&&e[2].length===2,()=>\"Invalid number of paddings. Must be length of 2 each.\"),za(r,e,t)}var A2=N({pad3d_:B6});function z6(r,e,t=0){return $(e.length===4&&e[0].length===2&&e[1].length===2&&e[2].length===2&&e[3].length===2,()=>\"Invalid number of paddings. Must be length of 2 each.\"),za(r,e,t)}var F2=N({pad4d_:z6});function V6(r,e,t){let o=v(r,\"x\",\"spaceToBatchND\");$(o.rank>=1+e.length,()=>`input rank ${o.rank} should be > than [blockShape] ${e.length}`),$(t.length===e.length,()=>`paddings.shape[0] ${t.length} must be equal to [blockShape] ${e.length}`),$(o.shape.reduce((a,i,p)=>p>0&&p<=e.length?a&&(i+t[p-1][0]+t[p-1][1])%e[p-1]===0:a,!0),()=>`input spatial dimensions ${o.shape.slice(1)} with paddings ${t.toString()} must be divisible by blockShapes ${e.toString()}`);let n={x:o},s={blockShape:e,paddings:t};return _.runKernel(Sa,n,s)}var Hd=N({spaceToBatchND_:V6});function W6(r,e,t,o,n,s,a){n==null&&(n=[1,1]),s==null&&(s=1),o===0&&(o=\"valid\");let i=v(r,\"x\",\"maxPool\"),p=i,u=!1;i.rank===3&&(u=!0,p=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(br(s,n),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${n}'`);let l=Qw(p.shape,e,s,n,o),c=[l.dilationHeight,l.dilationWidth],m;o===\"same\"?m=G6([l.filterHeight,l.filterWidth],c):m=[[0,0],[0,0]];let d=c[0]===1&&c[1]===1,[f,h]=U6([l.inHeight,l.inWidth],c,m),g=d?o:\"valid\",x=d?p:Hd(p,c,f),w=(t===\"avg\"?()=>Id(x,e,s,g,a):()=>Wd(x,e,s,g,a))(),S=d?w:vd(w,c,h);return u?W(S,[S.shape[1],S.shape[2],S.shape[3]]):S}function U6(r,e,t){let o=t.map(l=>l[0]),n=t.map(l=>l[1]),s=r.concat(o,n),a=e.map((l,c)=>(l-s[c]%l)%l),i=n.map((l,c)=>l+a[c]),p=e.map((l,c)=>[o[c],i[c]]),u=e.map((l,c)=>[0,a[c]]);return[p,u]}function G6(r,e){let o=r.map((a,i)=>a+(a-1)*(e[i]-1)).map(a=>a-1),n=o.map(a=>Math.floor(a/2)),s=o.map((a,i)=>a-n[i]);return o.map((a,i)=>[n[i],s[i]])}var P2=N({pool_:W6});function H6(r,e){let t=v(r,\"x\",\"prelu\"),o=v(e,\"alpha\",\"prelu\"),n={x:t,alpha:o};return _.runKernel(gs,n)}var Kd=N({prelu_:H6});function K6(r,e=null,t=!1){let o=v(r,\"x\",\"prod\");o.dtype===\"bool\"&&(o=Ue(o,\"int32\"));let n={x:o},s={axis:e,keepDims:t};return _.runKernel(Ho,n,s)}var O2=N({prod_:K6});function q6(r,e,t,o){let n=r.map((l,c)=>v(l,`tensors${c}`,\"raggedGather\",\"int32\")),s=v(e,\"paramsDenseValues\",\"raggedGather\"),a=v(t,\"indices\",\"raggedGather\",\"int32\"),i={paramsNestedSplits:n,paramsDenseValues:s,indices:a},p={outputRaggedRank:o},u=_.runKernel(Qp,i,p);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}var M2=N({raggedGather_:q6});function j6(r,e,t){let o=v(r,\"starts\",\"raggedRange\"),n=v(e,\"limits\",\"raggedRange\",o.dtype),s=v(t,\"deltas\",\"raggedRange\",o.dtype),a={starts:o,limits:n,deltas:s},i=_.runKernel(Zp,a);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}var L2=N({raggedRange_:j6});function X6(r,e,t,o,n){let s=v(r,\"shape\",\"raggedTensorToTensor\",\"int32\"),a=v(e,\"values\",\"raggedTensorToTensor\"),i=v(t,\"defaultValue\",\"raggedTensorToTensor\",a.dtype),p=o.map((c,m)=>v(c,`tensors${m}`,\"raggedTensorToTensor\",\"int32\")),u={shape:s,values:a,defaultValue:i,rowPartitionTensors:p},l={rowPartitionTypes:n};return _.runKernel(Jp,u,l)}var B2=N({raggedTensorToTensor_:X6});function Y6(r,e,t){St(r);let o=ze(r),n=null;if(t==null||t===\"float32\")n=new Float32Array(o);else if(t===\"int32\")n=new Int32Array(o);else if(t===\"bool\")n=new Uint8Array(o);else throw new Error(`Unknown data type ${t}`);for(let s=0;soN,createVideoElement:()=>pj,encodeStrings:()=>sN,expectArrayBuffersEqual:()=>uj,expectArraysClose:()=>nj,expectArraysEqual:()=>aj,expectNumbersClose:()=>nN,expectPromiseToFail:()=>sj,expectValuesInRange:()=>ij,play:()=>lj,testEpsilon:()=>jd});var oj=.001,oN=.1;function nj(r,e,t){return t==null&&(t=jd()),uS(r,e,(o,n)=>pS(o,n,t))}function jd(){return _.backend.floatPrecision()===32?oj:oN}function uS(r,e,t){let o=!0;if((Mt(r)||Mt(e))&&(o=!1),Mt(r)&&Mt(e)&&(o=!0),o){let a=r.constructor.name,i=e.constructor.name;if(a!==i)throw new Error(`Arrays are of different type. Actual: ${a}. Expected: ${i}`)}if(Array.isArray(r)&&Array.isArray(e)){let a=ur(r),i=ur(e);if(!Sr(a,i))throw new Error(`Arrays have different shapes. Actual: [${a}]. Expected: [${i}]`)}let n=Mt(r)?r:Us(r),s=Mt(e)?e:Us(e);if(n.length!==s.length)throw new Error(`Arrays have different lengths actual: ${n.length} vs expected: ${s.length}.\nActual: ${n}.\nExpected: ${s}.`);for(let a=0;ae.fail(),()=>e()),typeof expect!=\"undefined\"&&expect().nothing()}function aj(r,e){let t=typeof e==\"string\"||typeof e==\"number\"||typeof e==\"boolean\"?[e]:e;return dn(r)||dn(r[0])||dn(e)||dn(e[0])?uS(r,t,(o,n)=>o==n):uS(r,e,(o,n)=>pS(o,n,0))}function nN(r,e,t){if(t==null&&(t=jd()),!pS(r,e,t))throw new Error(`Numbers differ: actual === ${r}, expected === ${e}`);typeof expect!=\"undefined\"&&expect().nothing()}function pS(r,e,t){return!isFinite(r)&&!isFinite(e)?!0:!(isNaN(r)||isNaN(e)||Math.abs(r-e)>t)}function ij(r,e,t){for(let o=0;ot)throw new Error(`Value out of range:${r[o]} low: ${e}, high: ${t}`)}function uj(r,e){let t=new Float32Array(r),o=new Float32Array(e);if(t.length!==o.length)throw new Error(`Expected ArrayBuffer to be of length ${o.length}, but it was ${t.length}`);for(let n=0;n{e.addEventListener(\"loadeddata\",o=>t(e)),e.load()})}async function lj(r){await r.play(),\"requestVideoFrameCallback\"in r&&await new Promise(e=>{r.requestVideoFrameCallback(e)})}var Ju=class{constructor(e,t,o,n,s){this.mean=e,this.stdDev=t,this.dtype=o,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);let a=s||Math.random();this.random=Qd.alea(a.toString())}nextValue(){if(!isNaN(this.nextVal)){let n=this.nextVal;return this.nextVal=NaN,n}let e,t,o=!1;for(;!o;){let n,s,a;do n=2*this.random()-1,s=2*this.random()-1,a=n*n+s*s;while(a>=1||a===0);let i=Math.sqrt(-2*Math.log(a)/a);e=this.mean+this.stdDev*n*i,t=this.mean+this.stdDev*s*i,(!this.truncated||this.isValidTruncated(e))&&(o=!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}},Xd=class{constructor(e,t,o,n){this.alpha=e,this.beta=1/t,this.dtype=o;let s=n||Math.random();this.randu=Qd.alea(s.toString()),this.randn=new Ju(0,1,o,!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,o,n,s,a;for(;;){do n=this.randn.nextValue(),a=1+this.c*n;while(a<=0);if(a*=a*a,e=n*n,t=1-.331*e*e,o=.5*e+this.d*(1-a+Math.log(a)),s=this.randu(),sthis.dtype==null||this.dtype===\"float32\",this.min=e,this.range=t-e,this.dtype=o,n==null&&(n=Math.random()),typeof n==\"number\"&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=Qd.alea(n)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function cj(r,e,t=1,o=\"float32\",n){if(St(r),t==null&&(t=1),o==null&&(o=\"float32\"),o!==\"float32\"&&o!==\"int32\")throw new Error(`Unsupported data type ${o}`);let s=new Xd(e,t,o,n),a=ie(r,o);for(let i=0;i`Error in reverse1D: x must be rank 1 but got rank ${e.rank}.`),Bo(e,0)}var cN=N({reverse1d_:wj});function Sj(r,e){let t=v(r,\"x\",\"reverse\");return $(t.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${t.rank}.`),Bo(t,e)}var mN=N({reverse2d_:Sj});function Ij(r,e){let t=v(r,\"x\",\"reverse\");return $(t.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${t.rank}.`),Bo(t,e)}var dN=N({reverse3d_:Ij});function vj(r,e){let t=v(r,\"x\",\"reverse\");return $(t.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${t.rank}.`),Bo(t,e)}var fN=N({reverse4d_:vj});function kj(r){let t={x:v(r,\"x\",\"round\")};return _.runKernel(Is,t)}var ef=N({round_:kj});function Nj(r){let t={x:v(r,\"x\",\"rsqrt\",\"float32\")};return _.runKernel(Do,t)}var hN=N({rsqrt_:Nj});function Tj(r){let t={x:v(r,\"x\",\"selu\")};return _.runKernel(Ts,t)}var gN=N({selu_:Tj});function _j(r,e,t,o,n,s=[1,1],a=\"NHWC\"){let i=v(r,\"x\",\"separableConv2d\"),p=v(e,\"depthwiseFilter\",\"separableConv2d\"),u=v(t,\"pointwiseFilter\",\"separableConv2d\"),l=i,c=!1;if(i.rank===3&&(c=!0,l=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),a===\"NCHW\")throw new Error(\"separableConv2d currently does not support dataFormat NCHW; only NHWC is supported\");$(l.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${l.rank}.`),$(p.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${p.rank}.`),$(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${p.rank}.`),$(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),$(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);let m=p.shape[2],d=p.shape[3];$(u.shape[2]===m*d,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${m*d}, but got ${u.shape[2]}.`);let f=cl(l,p,o,n,a,s),g=du(f,u,1,\"valid\",a);return c?W(g,[g.shape[1],g.shape[2],g.shape[3]]):g}var xN=N({separableConv2d_:_j});async function Ej(r,e){let t=v(r,\"x\",\"setdiff1d\"),o=v(e,\"y\",\"setdiff1d\");$(t.dtype===o.dtype,()=>`x and y should have the same dtype, but got x (${t.dtype}) and y (${o.dtype}).`),$(t.rank===1,()=>`x should be 1D tensor, but got x (${t.shape}).`),$(o.rank===1,()=>`y should be 1D tensor, but got y (${o.shape}).`);let n=await t.data(),s=await o.data(),a=new Set(s),i=0;for(let l=0;l`slice1d expects a rank-1 tensor, but got a rank-${o.rank} tensor`),Ye(o,[e],[t])}var SN=N({slice1d_:Aj});function Fj(r,e,t){let o=v(r,\"x\",\"slice2d\");return $(o.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${o.rank} tensor`),Ye(o,e,t)}var IN=N({slice2d_:Fj});function Pj(r,e,t){let o=v(r,\"x\",\"slice3d\");return $(o.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${o.rank} tensor`),Ye(o,e,t)}var vN=N({slice3d_:Pj});function Oj(r,e,t){let o=v(r,\"x\",\"slice4d\");return $(o.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${o.rank} tensor`),Ye(o,e,t)}var kN=N({slice4d_:Oj});function Mj(r,e=-1){let t=v(r,\"logits\",\"softmax\",\"float32\");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and dim was ${e}`);let o={logits:t},n={dim:e};return _.runKernel(Fs,o,n)}var NN=N({softmax_:Mj});function Lj(r){$(r.dtype===\"complex64\",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${r.dtype}.`);let e={input:r};return _.runKernel(Xi,e)}var fl=N({fft_:Lj});function Bj(r){$(r.dtype===\"complex64\",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${r.dtype}.`);let e={input:r};return _.runKernel(Yi,e)}var ep=N({ifft_:Bj});function zj(r){let e=r.shape[r.shape.length-1],t=r.size/e,o;if(e<=2){let n=W(r,[t,e]);o=ep(n)}else{let n=[t,2*(e-1)],s=W(bi(r),[t,e]),a=W(gu(r),[t,e]),i=Bo(Ye(s,[0,1],[t,e-2]),1),p=se(Bo(Ye(a,[0,1],[t,e-2]),1),ke(-1)),u=bt([s,i],1),l=bt([a,p],1),c=W(Ar(u,l),[n[0],n[1]]);o=ep(c)}if(o=bi(o),r.rank===3&&r.shape[0]!==0){let n=o,s=r.shape[0];o=W(o,[s,o.shape[0]/s,o.shape[1]]),n.dispose()}return o}var tf=N({irfft_:zj});function Vj(r,e,t=0){let n={x:v(r,\"x\",\"split\")},s={numOrSizeSplits:e,axis:t};return _.runKernel(Ia,n,s)}var Ci=N({split_:Vj});function Wj(r,e){$(r.dtype===\"float32\",()=>`The dtype for rfft() must be real value but got ${r.dtype}`);let t=r.shape[r.shape.length-1],o=r.size/t,n;if(e!=null&&e0),h=r.shape.map(g=>g);h[r.shape.length-1]=e,n=Ye(r,f,h),t=e}else if(e!=null&&e>t){let f=r.shape.map(h=>h);f[r.shape.length-1]=e-t,n=bt([r,Yr(f)],r.shape.length-1),t=e}else n=r;let s=Kt(n),a=W(Ar(n,s),[o,t]),i=fl(a),p=Math.floor(t/2)+1,u=bi(i),l=gu(i),c=Ci(u,[p,t-p],u.shape.length-1),m=Ci(l,[p,t-p],l.shape.length-1),d=n.shape.slice();return d[n.shape.length-1]=p,W(Ar(c[0],m[0]),d)}var hl=N({rfft_:Wj});function Uj(r,e){let t=v(r,\"a\",\"squaredDifference\"),o=v(e,\"b\",\"squaredDifference\");[t,o]=Oe(t,o),rt(t.shape,o.shape);let n={a:t,b:o},s={};return _.runKernel(Po,n,s)}var rf=N({squaredDifference_:Uj});function Gj(r,e){let t=v(r,\"x\",\"squeeze\",\"string_or_numeric\");return W(t,mw(t.shape,e).newShape)}var gl=N({squeeze_:Gj});function Hj(r,e=0){let t=di(r,\"tensors\",\"stack\",\"string_or_numeric\");$(t.length>=1,()=>\"Pass at least one tensor to tf.stack\"),t.length>0&&$(e<=t[0].rank,()=>\"Axis must be <= rank of the tensor\");let o=t,n={axis:e};return _.runKernel(ya,o,n)}var Tr=N({stack_:Hj});function Kj(r,e=0){let o={x:v(r,\"x\",\"step\")},n={alpha:e};return _.runKernel(Ko,o,n)}var of=N({step_:Kj});function qj(r,e,t,o,n=0,s=0,a=0,i=0,p=0){let l={x:v(r,\"x\",\"stridedSlice\",\"string_or_numeric\")},c={begin:e,end:t,strides:o,beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};return _.runKernel(Os,l,c)}var TN=N({stridedSlice_:qj});function jj(r){let t={x:v(r,\"x\",\"tan\",\"float32\")};return _.runKernel(Ms,t)}var _N=N({tan_:jj});function rr(r,e){fo(r);let t=ur(r,e);if(t.length!==1)throw new Error(\"tensor1d() requires values to be a flat/TypedArray\");return vr(r,null,t,e)}function bu(r,e,t){if(fo(r),e!=null&&e.length!==2)throw new Error(\"tensor2d() requires shape to have two numbers\");let o=ur(r,t);if(o.length!==2&&o.length!==1)throw new Error(\"tensor2d() requires values to be number[][] or flat/TypedArray\");if(o.length===1&&e==null)throw new Error(\"tensor2d() requires shape to be provided when `values` are a flat/TypedArray\");return vr(r,e,o,t)}function nf(r,e,t){if(fo(r),e!=null&&e.length!==3)throw new Error(\"tensor3d() requires shape to have three numbers\");let o=ur(r,t);if(o.length!==3&&o.length!==1)throw new Error(\"tensor3d() requires values to be number[][][] or flat/TypedArray\");if(o.length===1&&e==null)throw new Error(\"tensor3d() requires shape to be provided when `values` are a flat array\");return vr(r,e,o,t)}function EN(r,e,t){if(fo(r),e!=null&&e.length!==4)throw new Error(\"tensor4d() requires shape to have four numbers\");let o=ur(r,t);if(o.length!==4&&o.length!==1)throw new Error(\"tensor4d() requires values to be number[][][][] or flat/TypedArray\");if(o.length===1&&e==null)throw new Error(\"tensor4d() requires shape to be provided when `values` are a flat array\");return vr(r,e,o,t)}function $N(r,e,t){if(fo(r),e!=null&&e.length!==5)throw new Error(\"tensor5d() requires shape to have five numbers\");let o=ur(r,t);if(o.length!==5&&o.length!==1)throw new Error(\"tensor5d() requires values to be number[][][][][] or flat/TypedArray\");if(o.length===1&&e==null)throw new Error(\"tensor5d() requires shape to be provided when `values` are a flat array\");return vr(r,e,o,t)}function RN(r,e,t){if(fo(r),e!=null&&e.length!==6)throw new Error(\"tensor6d() requires shape to have six numbers\");let o=ur(r,t);if(o.length!==6&&o.length!==1)throw new Error(\"tensor6d() requires values to be number[][][][][][] or flat/TypedArray\");if(o.length===1&&e==null)throw new Error(\"tensor6d() requires shape to be provided when `values` are a flat array\");return e=e||o,vr(r,e,o,t)}var Cu={};qe(Cu,{calculateShapes:()=>DN,validateInput:()=>xl,validateUpdateShape:()=>lS});function lS(r,e,t){let o=e.rank>1?e.shape[e.rank-1]:1,n=e.rank>1?e.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${t.shape}, indices.shape: ${e.shape}, shape: ${r}, sliceDim: ${o}, and batchDim: ${n}.`;if(t.rank1?e.shape[o-1]:1,s=t.length,a=1;for(let c=n;c= 0 but got ${e}`);if(e>n)throw new Error(`'k' passed to topk() must be <= the last dimension (${n}) but got ${e}`);let s={x:o},a={k:e,sorted:t},[i,p]=_.runKernel(Bs,s,a);return{values:i,indices:p}}var FN=N({topk_:Yj});function Qj(r,e=0,t=1,o,n){if(St(r),o!=null&&o===\"bool\")throw new Error(\"Unsupported data type $ { dtype }\");let s=new Ju(e,t,o,!0,n),a=ie(r,o);for(let i=0;i0,()=>\"The input tensor must be at least 1D\");let o={x:t},n={axis:e},[s,a]=_.runKernel(nu,o,n);return{values:s,indices:a}}var ON=N({unique_:Zj});function Jj(r,e,t){let o=v(r,\"x\",\"unsortedSegmentSum\"),n=v(e,\"segmentIds\",\"unsortedSegmentSum\",\"int32\");$(Ja(t),()=>\"numSegments must be of dtype int\");let s={x:o,segmentIds:n},a={numSegments:t};return _.runKernel(su,s,a)}var MN=N({unsortedSegmentSum_:Jj});function eX(r,e=0){let t=v(r,\"x\",\"unstack\",\"string_or_numeric\");$(e>=-t.shape.length&&e`Axis = ${e} is not in [-${t.shape.length}, ${t.shape.length})`);let o={value:t},n={axis:e};return _.runKernel(Ta,o,n)}var zo=N({unstack_:eX});function LN(r,e){return Pc(r,e,\"right\")}function BN(r,e=!0,t,o){return _.makeVariable(r,e,t,o)}function sf(r,e){let t=[];for(let s=0;s0,()=>\"mask cannot be scalar\"),yt(i.slice(s,s+a),n.shape,\"mask's shape must match the first K dimensions of tensor's shape,\");let p=1;for(let h=s;hi).reverse()),$(o.rank===e.length,()=>`Error in transpose: rank of input ${o.rank} must match length of perm ${e}.`),e.forEach(a=>{$(a>=0&&a`All entries in 'perm' must be between 0 and ${o.rank-1} but got ${e}`)}),o.rank<=1)return o.clone();let n={x:o},s={perm:e};return o.dtype===\"complex64\"?De(()=>{let a=bi(o),i=gu(o);return a=_.runKernel(Kr,{x:a},s),i=_.runKernel(Kr,{x:i},s),t&&(i=mr(i)),Ar(a,i)}):_.runKernel(Kr,n,s)}var yl=N({transpose_:nX});function sX(r,e,t,o,n=!0){let s=v(r,\"v\",\"movingAverage\"),a=v(e,\"x\",\"movingAverage\"),i=v(t,\"decay\",\"movingAverage\");Fw(s,a),$(Sr(s.shape,a.shape),()=>\"Shape mismatch in v and x\");let p=ke(1),u=Te(p,i),l=se(Te(a,s),u);if(n){$(o!=null,()=>\"When using zeroDebias: true, step is required.\");let c=v(o,\"step\",\"movingAverage\");l=Xe(l,Te(p,xi(i,c)))}return Ce(s,l)}var aX=N({movingAverage_:sX});function iX(r,e,t){St(t);let o=v(r,\"indices\",\"scatterND\",\"int32\"),n=v(e,\"updates\",\"scatterND\");xl(n,o,t);let s={indices:o,updates:n},a={shape:t};return _.runKernel(vs,s,a)}var uX=N({scatterND_:iX});function zN(r,e,t,o){if(r.dtype!==\"int32\")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${r.dtype}.`);if(r.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${r.shape}.`);let n=r.rank>0?r.shape[0]:1,s=r.rank>1?r.shape[1]:1;if(t.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${t.length}, should be: ${s}.`);let a=e.size;if(!(e.rank===0||e.rank===1&&a===n))throw new Error(`sparseValues has incorrect shape ${e.shape}, should be [] or [${n}]`);if(e.dtype!==o.dtype)throw new Error(\"sparseValues.dtype must match defaultValues.dtype\")}function lX(r,e,t,o=0){St(t);let n=v(r,\"sparseIndices\",\"sparseToDense\",\"int32\"),s=v(e,\"sparseValues\",\"sparseToDense\",\"string_or_numeric\"),a=v(o,\"defaultValue\",\"sparseToDense\",s.dtype);zN(n,s,t,a);let i={sparseIndices:n,sparseValues:s,defaultValue:a},p={outputShape:t};return _.runKernel(Ps,i,p)}var cX=N({sparseToDense_:lX});function mX(r,e){let t=v(e,\"indices\",\"gatherND\",\"int32\"),n={params:v(r,\"x\",\"gatherND\",\"string_or_numeric\"),indices:t};return _.runKernel(Kn,n)}var dX=N({gatherND_:mX});function VN(r,e){if(e==null)return r.shape.slice();if(Sr(r.shape,e))return e;if(r.shape.length===e.length){let t=[];for(let o=0;o`x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`),$(e>=0&&e<1,()=>`rate must be a float in the range [0, 1), but got ${e}.`),e===0)return r instanceof dt?n.clone():n;let s=VN(n,t),a=1-e,i=Xe(Rd(Ce(dl(s,0,1,\"float32\",o),a)),a);return se(n,i)}var hX=N({dropout_:fX});function cS(r){return Math.floor(Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))))}function Mc(r,e,t){let o=1-r%2,n=new Float32Array(r);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${o.rank}`),$(o.rank-1===n.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${o.rank} and targets rank ${n.rank}`),yt(o.shape.slice(0,o.shape.length-1),n.shape,\"predictions's shape should be align with the targets' shape, except the last dimension.\");let s=o.shape[o.shape.length-1];$(t>0&&t<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${t}`);let a=await o.data(),i=await n.data(),[p,u]=[a.length/s,s],l=dw(\"bool\",p);for(let c=0;cg.value-h.value),l[c]=0;for(let h=0;hUN,depthwiseConv2d:()=>KN,matMul:()=>qN});function yX(r,e,t,o,n,s=\"NHWC\",a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=e;p.rank===3&&(p=W(e,[1,e.shape[0],e.shape[1],e.shape[2]])),$(i.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${i.shape}.`),$(p.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`),$(t.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${t}.`);let u=s===\"NHWC\"?i.shape[3]:i.shape[1],l=s===\"NHWC\"?p.shape[3]:p.shape[1];$(u===t[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${t[2]}.`),$(l===t[3],()=>`Error in conv2dDerFilter: depth of dy (${l}) must match output depth for filter (${t[3]}).`),zt(\"conv2dDerFilter\",n,a);let c={x:i,dy:p},m={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,filterShape:t};return _.runKernel(Ui,c,m)}var WN=N({conv2DBackpropFilter_:yX});function tp(r,e,t){if(t==null||t===\"linear\")return r;if(t===\"relu\")return se(r,of(e));throw new Error(`Cannot compute gradient for fused activation ${t}.`)}function rp(r,e){let t=e,o=Td(r.shape,e.shape);return o.length>0&&(t=ot(t,o)),W(t,r.shape)}function op(r,e,t,o){if(e===\"linear\")return r;if(e===\"relu\")return yu(r);if(e===\"elu\")return Ed(r);if(e===\"relu6\")return Jd(r);if(e===\"prelu\")return Kd(r,t);if(e===\"leakyrelu\")return Fd(r,o);if(e===\"sigmoid\")return Pa(r);throw new Error(`Unknown fused activation ${e}.`)}var np=(r,e)=>!(r>0)||e===\"linear\";function bX({x:r,filter:e,strides:t,pad:o,dataFormat:n=\"NHWC\",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p=\"linear\",preluActivationWeights:u,leakyreluAlpha:l}){if(p=p||\"linear\",np(_.state.gradientDepth,p)===!1){$(n===\"NHWC\",()=>`Error in fused conv2d: got dataFormat of ${n} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let T=du(r,e,t,o,n,s,a);return i!=null&&(T=Ce(T,i)),op(T,p,u,l)}let c=v(r,\"x\",\"conv2d\",\"float32\"),m=v(e,\"filter\",\"conv2d\",\"float32\"),d=c,f=!1;c.rank===3&&(f=!0,d=W(c,[1,c.shape[0],c.shape[1],c.shape[2]])),$(d.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${m.rank}.`),zt(\"fused conv2d\",o,a);let h=n===\"NHWC\"?d.shape[3]:d.shape[1];$(m.shape[2]===h,()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${m.shape[2]}.`),$(br(t,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`);let g=Ku(d.shape,m.shape,t,s,o,a),x;i!=null&&(x=v(i,\"bias\",\"fused conv2d\"),[x]=Oe(x,c),n===\"NHWC\"?rt(g.outShape,x.shape):($(x.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${x.shape.length}.`),$(x.shape.length===0||x.shape[0]===g.outChannels||x.shape[0]===1,()=>`Error in fused conv2d: bias shape (${x.shape}) is not compatible with the number of output channels (${g.outChannels})`)));let b;if(u!=null){let T=u.shape;if($(T.length<=1||T.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${T.length}.`),T.length===1)$(T[0]===1||T[0]===g.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${T}) is not compatible with the number of output channels (${g.outChannels}).`);else if(T.length===3)try{rt(T,g.outShape)}catch(E){let R=`Error in fused conv2d: PReLU activation weights (${T}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(R)}b=v(u,\"prelu weights\",\"fused conv2d\")}let w=(T,E)=>{$(n===\"NHWC\",()=>`Error in gradient of fused conv2D: got dataFormat of ${n} but only NHWC is currently supported.`);let[R,D,F,O]=E,M=tp(T,F,p);$(Hu(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let L=Nd(D.shape,M,R,t,o),B=WN(D,M,R.shape,t,o),z=[L,B];if(O!=null){let U=rp(O,M);z.push(U)}return z},S={x:d,filter:m,bias:x,preluActivationWeights:b},k={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:l};return i==null?Nr((E,R,D)=>{let F=_.runKernel(jo,S,k);return D([R,E,F]),f&&(F=W(F,[F.shape[1],F.shape[2],F.shape[3]])),{value:F,gradFunc:w}})(d,m):Nr((E,R,D,F)=>{let O=_.runKernel(jo,S,k);return F([R,E,O,D]),f&&(O=W(O,[O.shape[1],O.shape[2],O.shape[3]])),{value:O,gradFunc:w}})(d,m,x)}var UN=N({fusedConv2d_:bX});function CX(r,e,t,o,n,s=[1,1],a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=e;p.rank===3&&(p=W(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let u={x:i,dy:p},l={strides:o,pad:n,dimRoundingMode:a,dilations:s,filterShape:t};return _.runKernel(Gi,u,l)}var GN=N({depthwiseConv2dNativeBackpropFilter_:CX});function wX(r,e,t,o,n,s=[1,1],a){let i=e,p=!1;e.rank===3&&(p=!0,i=W(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let u={dy:i,filter:t},l={strides:o,pad:n,dimRoundingMode:a,dilations:s,inputShape:r},c=_.runKernel(Hi,u,l);return p?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var HN=N({depthwiseConv2dNativeBackpropInput_:wX});function SX({x:r,filter:e,strides:t,pad:o,dataFormat:n=\"NHWC\",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p=\"linear\",preluActivationWeights:u,leakyreluAlpha:l}){if(np(_.state.gradientDepth,p)===!1){let k=cl(r,e,t,o,n,s,a);return i!=null&&(k=Ce(k,i)),op(k,p,u,l)}let c=v(r,\"x\",\"depthwiseConv2d\",\"float32\"),m=v(e,\"filter\",\"depthwiseConv2d\",\"float32\"),d=c,f=!1;c.rank===3&&(f=!0,d=W(c,[1,c.shape[0],c.shape[1],c.shape[2]])),$(d.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${m.rank}.`),$(d.shape[3]===m.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${m.shape[2]}.`),s==null&&(s=[1,1]),$(br(t,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),zt(\"fused depthwiseConv2d\",o,a);let h=Ku(d.shape,m.shape,t,s,o,a,!0),g;i!=null&&(g=v(i,\"bias\",\"fused conv2d\"),[g]=Oe(g,c),rt(h.outShape,g.shape));let x;u!=null&&(x=v(u,\"prelu weights\",\"fused depthwiseConv2d\"));let b=(k,T)=>{$(Hu(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[E,R,D,F]=T,O=tp(k,D,p),M=HN(R.shape,O,E,t,o,s,a),L=GN(R,O,E.shape,t,o,s,a);if(F!=null){let B=rp(g,O);return[M,L,B]}return[M,L]},w={x:d,filter:m,bias:g,preluActivationWeights:x},S={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:l};return i==null?Nr((T,E,R)=>{let D=_.runKernel(Xo,w,S);return R([E,T,D]),f&&(D=W(D,[D.shape[1],D.shape[2],D.shape[3]])),{value:D,gradFunc:b}})(d,m):Nr((T,E,R,D)=>{let F=_.runKernel(Xo,w,S);return D([E,T,F,R]),f&&(F=W(F,[F.shape[1],F.shape[2],F.shape[3]])),{value:F,gradFunc:b}})(d,m,g)}var KN=N({fusedDepthwiseConv2d_:SX});function IX({a:r,b:e,transposeA:t=!1,transposeB:o=!1,bias:n,activation:s=\"linear\",preluActivationWeights:a,leakyreluAlpha:i=.2}){if(np(_.state.gradientDepth,s)===!1){let O=Je(r,e,t,o);return n!=null&&(O=Ce(O,n)),op(O,s,a,i)}let p=v(r,\"a\",\"fused matMul\"),u=v(e,\"b\",\"fused matMul\");[p,u]=Oe(p,u);let l=t?p.shape[p.rank-2]:p.shape[p.rank-1],c=o?u.shape[u.rank-1]:u.shape[u.rank-2],m=t?p.shape[p.rank-1]:p.shape[p.rank-2],d=o?u.shape[u.rank-2]:u.shape[u.rank-1],f=p.shape.slice(0,-2),h=u.shape.slice(0,-2),g=ze(f),x=ze(h);$(l===c,()=>`Error in fused matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${p.shape} and ${u.shape} and transposeA=${t} and transposeB=${o} must match.`);let w=rt(p.shape.slice(0,-2),u.shape.slice(0,-2)).concat([m,d]),S=t?W(p,[g,l,m]):W(p,[g,m,l]),k=o?W(u,[x,d,c]):W(u,[x,c,d]),T;n!=null&&(T=v(n,\"bias\",\"fused matMul\"),[T]=Oe(T,p),rt(w,T.shape));let E;a!=null&&(E=v(a,\"prelu weights\",\"fused matMul\"));let R=(O,M)=>{let[L,B,z,U]=M,j=tp(W(O,z.shape),z,s),q,Y;if(!t&&!o?(q=Je(j,B,!1,!0),Y=Je(L,j,!0,!1)):!t&&o?(q=Je(j,B,!1,!1),Y=Je(j,L,!0,!1)):t&&!o?(q=Je(B,j,!1,!0),Y=Je(L,j,!1,!1)):(q=Je(B,j,!0,!0),Y=Je(j,L,!0,!0)),n!=null){let J=rp(U,j);return[q,Y,J]}else return[q,Y]},D={a:S,b:k,bias:T,preluActivationWeights:E},F={transposeA:t,transposeB:o,activation:s,leakyreluAlpha:i};return n==null?Nr((M,L,B)=>{let z=_.runKernel(qo,D,F);return B([M,L,z]),{value:W(z,w),gradFunc:R}})(S,k):Nr((M,L,B,z)=>{let U=_.runKernel(qo,D,F);return z([M,L,U,B]),{value:W(U,w),gradFunc:R}})(S,k,T)}var qN=N({fusedMatMul_:IX});function vX(r){return Mc(r,.54,.46)}var jN=N({hammingWindow_:vX});function kX(r){return Mc(r,.5,.5)}var uf=N({hannWindow_:kX});function NX(r,e,t,o=!1,n=0){let s=0,a=[];for(;s+e<=r.size;)a.push(Ye(r,s,e)),s+=t;if(o)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&i.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${i.shape}.`),$(p.rank===1&&p.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${i.shape}.`),$(o.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${o.length}.`),$(o[0]>=1&&o[1]>=1,()=>`cropSize must be atleast [1,1], but was ${o}`),$(n===\"bilinear\"||n===\"nearest\",()=>`method must be bilinear or nearest, but was ${n}`);let l={image:a,boxes:i,boxInd:p},c={method:n,extrapolationValue:s,cropSize:o};return _.runKernel(Mn,l,c)}var YN=N({cropAndResize_:_X});function EX(r){let e=v(r,\"image\",\"flipLeftRight\",\"float32\");$(e.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${e.rank}.`);let t={image:e};return _.runKernel(Gn,t,{})}var QN=N({flipLeftRight_:EX});function $X(r){let e=v(r,\"image\",\"grayscaleToRGB\"),t=e.rank-1,o=e.shape[t];$(e.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${e.rank}.`),$(o===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${o}.`);let n=new Array(e.rank);return n.fill(1,0,t),n[t]=3,hu(e,n)}var ZN=N({grayscaleToRGB_:$X});function RX(r){let e=v(r,\"image\",\"RGBToGrayscale\"),t=e.rank-1,o=e.shape[t];$(e.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${e.rank}.`),$(o===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${o}.`);let n=e.dtype,s=Ue(e,\"float32\"),a=rr([.2989,.587,.114]),i;switch(e.rank){case 2:i=fu(\"ij,j->i\",s,a);break;case 3:i=fu(\"ijk,k->ij\",s,a);break;case 4:i=fu(\"ijkl,l->ijk\",s,a);break;case 5:i=fu(\"ijklm,m->ijkl\",s,a);break;case 6:i=fu(\"ijklmn,n->ijklm\",s,a);break;default:throw new Error(\"Not a valid tensor rank.\")}return i=Ks(i,-1),Ue(i,n)}var JN=N({rgbToGrayscale_:RX});function DX(r,e,t=0,o=.5){let n=v(r,\"image\",\"rotateWithOffset\",\"float32\");$(n.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${n.rank}.`);let s={image:n},a={radians:e,fillValue:t,center:o};return _.runKernel(Vs,s,a)}var eT=N({rotateWithOffset_:DX});function en(r,e,t,o,n,s){o==null&&(o=.5),n==null&&(n=Number.NEGATIVE_INFINITY),s==null&&(s=0);let a=r.shape[0];return t=Math.min(t,a),$(0<=o&&o<=1,()=>`iouThreshold must be in [0, 1], but was '${o}'`),$(r.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${r.rank}'`),$(r.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${r.shape[1]}`),$(e.rank===1,()=>\"scores must be a 1D tensor\"),$(e.shape[0]===a,()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${e.shape[0]}`),$(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:t,iouThreshold:o,scoreThreshold:n,softNmsSigma:s}}function AX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,\"boxes\",\"nonMaxSuppression\",\"float32\"),a=v(e,\"scores\",\"nonMaxSuppression\",\"float32\"),i=en(s,a,t,o,n);t=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p={maxOutputSize:t,iouThreshold:o,scoreThreshold:n};return _.runKernel(cs,{boxes:s,scores:a},p)}var tT=N({nonMaxSuppression_:AX});function rT(r,e,t){let o=FX(r,e,t),n=o<0?-(o+1):o;r.splice(n,0,e)}function FX(r,e,t){return OX(r,e,t||PX)}function PX(r,e){return r>e?1:r>>1);let i=t(e,r[s]);i>0?o=s+1:(n=s,a=!i)}return a?o:-o-1}function lf(r,e,t,o,n){return dS(r,e,t,o,n,0)}function cf(r,e,t,o,n,s){return dS(r,e,t,o,n,0,!1,s,!0)}function mf(r,e,t,o,n,s){return dS(r,e,t,o,n,s,!0)}function dS(r,e,t,o,n,s,a=!1,i=!1,p=!1){let u=[];for(let g=0;gn&&u.push({score:e[g],boxIndex:g,suppressBeginIndex:0});u.sort(oT);let l=s>0?-.5/s:0,c=[],m=[];for(;c.length0;){let g=u.pop(),{score:x,boxIndex:b,suppressBeginIndex:w}=g;if(x=w;--k){let T=MX(r,b,c[k]);if(T>=o){S=!0;break}if(g.score=g.score*LX(o,l,T),g.score<=n)break}g.suppressBeginIndex=c.length,S||(g.score===x?(c.push(b),m.push(g.score)):g.score>n&&rT(u,g,oT))}let d=c.length,f=t-d;i&&f>0&&(c.push(...new Array(f).fill(0)),m.push(...new Array(f).fill(0)));let h={selectedIndices:c};return a&&(h.selectedScores=m),p&&(h.validOutputs=d),h}function MX(r,e,t){let o=r.subarray(e*4,e*4+4),n=r.subarray(t*4,t*4+4),s=Math.min(o[0],o[2]),a=Math.min(o[1],o[3]),i=Math.max(o[0],o[2]),p=Math.max(o[1],o[3]),u=Math.min(n[0],n[2]),l=Math.min(n[1],n[3]),c=Math.max(n[0],n[2]),m=Math.max(n[1],n[3]),d=(i-s)*(p-a),f=(c-u)*(m-l);if(d<=0||f<=0)return 0;let h=Math.max(s,u),g=Math.max(a,l),x=Math.min(i,c),b=Math.min(p,m),w=Math.max(x-h,0)*Math.max(b-g,0);return w/(d+f-w)}function LX(r,e,t){let o=Math.exp(e*t*t);return t<=r?o:0}function oT(r,e){return r.score-e.score||r.score===e.score&&e.boxIndex-r.boxIndex}async function BX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,\"boxes\",\"nonMaxSuppressionAsync\"),a=v(e,\"scores\",\"nonMaxSuppressionAsync\"),i=en(s,a,t,o,n);t=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p=await Promise.all([s.data(),a.data()]),u=p[0],l=p[1],{selectedIndices:c}=lf(u,l,t,o,n);return s!==r&&s.dispose(),a!==e&&a.dispose(),rr(c,\"int32\")}var nT=BX;function zX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,\"boxes\",\"nonMaxSuppression\"),i=v(e,\"scores\",\"nonMaxSuppression\"),p=en(a,i,t,o,n,s);t=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u={boxes:a,scores:i},l={maxOutputSize:t,iouThreshold:o,scoreThreshold:n,softNmsSigma:s},c=_.runKernel(ms,u,l);return{selectedIndices:c[0],selectedScores:c[1]}}var sT=N({nonMaxSuppressionWithScore_:zX});async function VX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,\"boxes\",\"nonMaxSuppressionAsync\"),i=v(e,\"scores\",\"nonMaxSuppressionAsync\"),p=en(a,i,t,o,n,s);t=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u=await Promise.all([a.data(),i.data()]),l=u[0],c=u[1],{selectedIndices:m,selectedScores:d}=mf(l,c,t,o,n,s);return a!==r&&a.dispose(),i!==e&&i.dispose(),{selectedIndices:rr(m,\"int32\"),selectedScores:rr(d)}}var aT=VX;function WX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,\"boxes\",\"nonMaxSuppression\"),i=v(e,\"scores\",\"nonMaxSuppression\"),p=en(a,i,t,o,n,null),u=p.maxOutputSize,l=p.iouThreshold,c=p.scoreThreshold,m={boxes:a,scores:i},d={maxOutputSize:u,iouThreshold:l,scoreThreshold:c,padToMaxOutputSize:s},f=_.runKernel(ni,m,d);return{selectedIndices:f[0],validOutputs:f[1]}}var iT=N({nonMaxSuppressionPadded_:WX});async function UX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,\"boxes\",\"nonMaxSuppressionAsync\"),i=v(e,\"scores\",\"nonMaxSuppressionAsync\"),p=en(a,i,t,o,n,null),u=p.maxOutputSize,l=p.iouThreshold,c=p.scoreThreshold,[m,d]=await Promise.all([a.data(),i.data()]),{selectedIndices:f,validOutputs:h}=cf(m,d,u,l,c,s);return a!==r&&a.dispose(),i!==e&&i.dispose(),{selectedIndices:rr(f,\"int32\"),validOutputs:ke(h,\"int32\")}}var uT=UX;function GX(r,e,t=!1,o=!1){let n=v(r,\"images\",\"resizeBilinear\");$(n.rank===3||n.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${n.rank}.`),$(e.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`),$(o===!1||t===!1,()=>\"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.\");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=e,i={images:s},p={alignCorners:t,halfPixelCenters:o,size:e},u=_.runKernel(Cs,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var pT=N({resizeBilinear_:GX});function HX(r,e,t=!1,o=!1){let n=v(r,\"images\",\"resizeNearestNeighbor\");$(n.rank===3||n.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${n.rank}.`),$(e.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`),$(n.dtype===\"float32\"||n.dtype===\"int32\",()=>\"`images` must have `int32` or `float32` as dtype\"),$(o===!1||t===!1,()=>\"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.\");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=e,i={images:s},p={alignCorners:t,halfPixelCenters:o,size:e},u=_.runKernel(bs,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var lT=N({resizeNearestNeighbor_:HX});function KX(r,e=\"binary\",t=!1,o=.5){let n=v(r,\"image\",\"threshold\"),s=.2989,a=.587,i=.114,p=n.shape[0]*n.shape[1],u=se(rr([o]),255),l,c,m,d;if($(n.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${n.rank}.`),$(n.shape[2]===3||n.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${n.shape[2]}.`),$(n.dtype===\"int32\"||n.dtype===\"float32\",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${n.dtype}.`),$(e===\"otsu\"||e===\"binary\",()=>`Method must be binary or otsu, but was ${e}`),n.shape[2]===3){[l,c,m]=Ci(n,[1,1,1],-1);let g=se(l,s),x=se(c,a),b=se(m,i);d=Ce(Ce(g,x),b)}else d=r;if(e===\"otsu\"){let g=kd(Ue(ef(d),\"int32\"),pr([]),256);u=qX(g,p)}let f=t?ml(d,u):ju(d,u);return Ue(se(f,255),\"int32\")}function qX(r,e){let t=rr([-1]),o=rr([0]),n=rr([0]),s,a,i,p,u,l;for(let c=0;c`Error in transform: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&(i.shape[0]===a.shape[0]||i.shape[0]===1)&&i.shape[1]===8,()=>\"Error in transform: Input transform should be batch x 8 or 1 x 8\"),$(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let p={image:a,transforms:i},u={interpolation:t,fillMode:o,fillValue:n,outputShape:s};return _.runKernel(zs,p,u)}var mT=N({transform_:jX});function XX(r,e,t){let o=v(r,\"a\",\"bandPart\");$(o.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${o.rank}.`);let n=o.shape,[s,a]=o.shape.slice(-2),i,p;typeof e==\"number\"?($(e%1===0,()=>`bandPart(): numLower must be an integer, got ${e}.`),$(e<=s,()=>`bandPart(): numLower (${e}) must not be greater than the number of rows (${s}).`),i=v(e<0?s:e,\"numLower\",\"bandPart\")):($(e.dtype===\"int32\",()=>\"bandPart(): numLower's dtype must be an int32.\"),i=Lo(Fc(e,0),s,Qu(e,s))),typeof t==\"number\"?($(t%1===0,()=>`bandPart(): numUpper must be an integer, got ${t}.`),$(t<=a,()=>`bandPart(): numUpper (${t}) must not be greater than the number of columns (${a}).`),p=v(t<0?a:t,\"numUpper\",\"bandPart\")):($(t.dtype===\"int32\",()=>\"bandPart(): numUpper's dtype must be an int32.\"),p=Lo(Fc(t,0),a,Qu(t,a)));let u=W(xu(0,s,1,\"int32\"),[-1,1]),l=xu(0,a,1,\"int32\"),c=Te(u,l),m=Xu(ml(c,i),Ad(c,mr(p))),d=Yr([s,a],o.dtype);return W(Tr(zo(W(o,[-1,s,a])).map(f=>Lo(m,f,d))),n)}var dT=N({bandPart_:XX});function YX(r){let e;if(Array.isArray(r)){e=!1,$(r!=null&&r.length>0,()=>\"Gram-Schmidt process: input must not be null, undefined, or empty\");let n=r[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${r[s].shape[0]} vs. ${n})`)}else e=!0,r=Ci(r,r.shape[0],0).map(n=>gl(n,[0]));$(r.length<=r[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${r.length}) exceeds number of dimensions (${r[0].shape[0]}).`);let t=[],o=r;for(let n=0;n{let s=o[n];if(n>0)for(let a=0;a=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${r.rank}`),r.rank===2)return hT(r,e);{let t=r.shape.slice(0,r.shape.length-2).reduce((p,u)=>p*u),o=zo(W(r,[t,r.shape[r.shape.length-2],r.shape[r.shape.length-1]]),0),n=[],s=[];o.forEach(p=>{let[u,l]=hT(p,e);n.push(u),s.push(l)});let a=W(Tr(n,0),r.shape),i=W(Tr(s,0),r.shape);return[a,i]}}function hT(r,e=!1){return _.tidy(()=>{$(r.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${r.shape.length}D Tensor.`);let t=r.shape[0],o=r.shape[1],n=$d(t),s=Xr(r),a=bu([[1]],[1,1]),i=Xr(a),p=t>=o?o:t;for(let u=0;u{let d=Ye(s,[u,u],[t-u,1]),f=qu(d),h=Ye(s,[u,u],[1,1]),g=Lo(ju(h,0),bu([[-1]]),bu([[1]])),x=Te(h,se(g,f)),b=Xe(d,x);b.shape[0]===1?i=Xr(a):i=bt([a,Ye(b,[1,0],[b.shape[0]-1,b.shape[1]])],0);let w=mr(Xe(Je(g,x),f)),S=Ye(s,[u,0],[t-u,o]),k=se(w,i),T=yl(i);if(u===0)s=Te(S,Je(k,Je(T,S)));else{let D=Te(S,Je(k,Je(T,S)));s=bt([Ye(s,[0,0],[u,o]),D],0)}let E=yl(k),R=Ye(n,[0,u],[t,n.shape[1]-u]);if(u===0)n=Te(R,Je(Je(R,i),E));else{let D=Te(R,Je(Je(R,i),E));n=bt([Ye(n,[0,0],[t,u]),D],1)}return[i,s,n]}),Lt([l,c,m])}return!e&&t>o&&(n=Ye(n,[0,0],[t,o]),s=Ye(s,[0,0],[o,o])),[n,s]})}var gT=N({qr_:QX});var Dt;(function(r){r[r.NONE=0]=\"NONE\",r[r.MEAN=1]=\"MEAN\",r[r.SUM=2]=\"SUM\",r[r.SUM_BY_NONZERO_WEIGHTS=3]=\"SUM_BY_NONZERO_WEIGHTS\"})(Dt||(Dt={}));function ZX(r,e,t=Dt.SUM_BY_NONZERO_WEIGHTS){let o=v(r,\"losses\",\"computeWeightedLoss\"),n=null;e!=null&&(n=v(e,\"weights\",\"computeWeightedLoss\"));let s=n==null?o:se(o,n);if(t===Dt.NONE)return s;if(t===Dt.SUM)return ot(s);if(t===Dt.MEAN){if(n==null)return Yu(s);{let a=o.size/n.size,i=Xe(ot(s),ot(n));return a>1?Xe(i,ke(a)):i}}if(t===Dt.SUM_BY_NONZERO_WEIGHTS){if(n==null)return Xe(ot(s),ke(o.size));{let a=se(n,Ba(o.shape)),i=Ue(ot(Gd(a,ke(0))),\"float32\");return Xe(ot(s),i)}}throw Error(`Unknown reduction: ${t}`)}var dr=N({computeWeightedLoss_:ZX});function JX(r,e,t,o=Dt.SUM_BY_NONZERO_WEIGHTS){let n=v(r,\"labels\",\"absoluteDifference\"),s=v(e,\"predictions\",\"absoluteDifference\"),a=null;t!=null&&(a=v(t,\"weights\",\"absoluteDifference\")),yt(n.shape,s.shape,\"Error in absoluteDifference: \");let i=er(Te(n,s));return dr(i,a,o)}var xT=N({absoluteDifference_:JX});function e5(r,e,t,o,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"labels\",\"cosineDistance\"),a=v(e,\"predictions\",\"cosineDistance\"),i=null;o!=null&&(i=v(o,\"weights\",\"cosineDistance\")),yt(s.shape,a.shape,\"Error in cosineDistance: \");let p=ke(1),u=Te(p,ot(se(s,a),t,!0));return dr(u,i,n)}var yT=N({cosineDistance_:e5});function t5(r,e,t,o=Dt.SUM_BY_NONZERO_WEIGHTS){let n=v(r,\"labels\",\"hingeLoss\"),s=v(e,\"predictions\",\"hingeLoss\"),a=null;t!=null&&(a=v(t,\"weights\",\"hingeLoss\")),yt(n.shape,s.shape,\"Error in hingeLoss: \");let i=ke(1);n=Te(se(ke(2),n),i);let p=yu(Te(i,se(n,s)));return dr(p,a,o)}var bT=N({hingeLoss_:t5});function r5(r,e,t,o=1,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"labels\",\"huberLoss\"),a=v(e,\"predictions\",\"huberLoss\"),i=null;t!=null&&(i=v(t,\"weights\",\"huberLoss\")),yt(s.shape,a.shape,\"Error in huberLoss: \");let p=ke(o),u=er(Te(a,s)),l=Qu(u,p),c=Te(u,l),m=Ce(se(ke(.5),tr(l)),se(p,c));return dr(m,i,n)}var CT=N({huberLoss_:r5});function o5(r,e,t,o=1e-7,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"labels\",\"logLoss\"),a=v(e,\"predictions\",\"logLoss\"),i=null;t!=null&&(i=v(t,\"weights\",\"logLoss\")),yt(s.shape,a.shape,\"Error in logLoss: \");let p=ke(1),u=ke(o),l=mr(se(s,yi(Ce(a,u)))),c=se(Te(p,s),yi(Ce(Te(p,a),u))),m=Te(l,c);return dr(m,i,n)}var wT=N({logLoss_:o5});function n5(r,e,t,o=Dt.SUM_BY_NONZERO_WEIGHTS){let n=v(r,\"labels\",\"meanSquaredError\"),s=v(e,\"predictions\",\"meanSquaredError\"),a=null;t!=null&&(a=v(t,\"weights\",\"meanSquaredError\")),yt(n.shape,s.shape,\"Error in meanSquaredError: \");let i=rf(n,s);return dr(i,a,o)}var ST=N({meanSquaredError_:n5});function s5(r,e){let t=v(r,\"labels\",\"sigmoidCrossEntropyWithLogits\"),o=v(e,\"logits\",\"sigmoidCrossEntropyWithLogits\");yt(t.shape,o.shape,\"Error in sigmoidCrossEntropyWithLogits: \");let n=yu(o),s=se(o,t),a=Pd(Jo(mr(er(o))));return Ce(Te(n,s),a)}function a5(r,e,t,o=0,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"multiClassLabels\",\"sigmoidCrossEntropy\"),a=v(e,\"logits\",\"sigmoidCrossEntropy\"),i=null;if(t!=null&&(i=v(t,\"weights\",\"sigmoidCrossEntropy\")),yt(s.shape,a.shape,\"Error in sigmoidCrossEntropy: \"),o>0){let u=ke(o),l=ke(1),c=ke(.5);s=Ce(se(s,Te(l,u)),se(c,u))}let p=s5(s,a);return dr(p,i,n)}var IT=N({sigmoidCrossEntropy_:a5});function i5(r,e,t=-1){if(t===-1&&(t=e.rank-1),t!==e.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${e.rank} and dim was ${t}`);return Nr((n,s,a)=>{let p=Ld(s,[t],!0),u=Te(Ue(s,\"float32\"),p);a([n,u]);let l=mr(se(u,n));return{value:ot(l,[t]),gradFunc:(d,f)=>{let[h,g]=f,x=gi(d.shape,[t]);return[se(W(d,x),Te(Ue(h,\"float32\"),Jo(g))),se(W(d,x),Te(Jo(g),Ue(h,\"float32\")))]}}})(r,e)}function u5(r,e,t,o=0,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,\"onehotLabels\",\"softmaxCrossEntropy\"),a=v(e,\"logits\",\"softmaxCrossEntropy\"),i=null;if(t!=null&&(i=v(t,\"weights\",\"softmaxCrossEntropy\")),yt(s.shape,a.shape,\"Error in softmaxCrossEntropy: \"),o>0){let u=ke(o),l=ke(1),c=ke(s.shape[1]);s=Ce(se(s,Te(l,u)),Xe(u,c))}let p=i5(s,a);return dr(p,i,n)}var vT=N({softmaxCrossEntropy_:u5});function p5(r,e,t,o){let n=v(r,\"indices\",\"sparseFillEmptyRows\",\"int32\"),s=v(e,\"values\",\"sparseFillEmptyRows\"),a=v(t,\"denseShape\",\"sparseFillEmptyRows\",\"int32\"),i=v(o,\"defaultValue\",\"sparseFillEmptyRows\",s.dtype);if(n.rank!==2)throw new Error(`Indices should be Tensor2D but received shape\n ${n.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(a.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(i.rank!==0)throw new Error(`Default value should be a scalar but received shape ${i.shape}`);let p={indices:n,values:s,denseShape:a,defaultValue:i},u=_.runKernel(eu,p);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}var kT=N({sparseFillEmptyRows_:p5});function l5(r,e,t){let o=v(r,\"inputIndices\",\"sparseReshape\",\"int32\"),n=v(e,\"inputShape\",\"sparseReshape\",\"int32\"),s=v(t,\"newShape\",\"sparseReshape\",\"int32\");if(o.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape\n ${o.shape}`);if(n.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${n.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let a={inputIndices:o,inputShape:n,newShape:s},i=_.runKernel(ui,a);return{outputIndices:i[0],outputShape:i[1]}}var NT=N({sparseReshape_:l5});function c5(r,e,t){let o=v(r,\"data\",\"sparseSegmentMean\"),n=v(e,\"indices\",\"sparseSegmentMean\",\"int32\"),s=v(t,\"segmentIds\",\"sparseSegmentMean\",\"int32\");if(o.rank<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape\n ${n.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return _.runKernel(va,a)}var TT=N({sparseSegmentMean_:c5});function m5(r,e,t){let o=v(r,\"data\",\"sparseSegmentSum\"),n=v(e,\"indices\",\"sparseSegmentSum\",\"int32\"),s=v(t,\"segmentIds\",\"sparseSegmentSum\",\"int32\");if(o.rank<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape\n ${n.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape\n ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return _.runKernel(ka,a)}var _T=N({sparseSegmentSum_:m5});function d5(r,e,t,o,n,s,a,i){let p=v(r,\"data\",\"stringNGrams\",\"string\");if(p.dtype!==\"string\")throw new Error(\"Data must be of datatype string\");if(p.shape.length!==1)throw new Error(`Data must be a vector, saw: ${p.shape}`);let u=v(e,\"dataSplits\",\"stringNGrams\");if(u.dtype!==\"int32\")throw new Error(\"Data splits must be of datatype int32\");let l={separator:t,nGramWidths:o,leftPad:n,rightPad:s,padWidth:a,preserveShortSequences:i},c={data:p,dataSplits:u},m=_.runKernel(Na,c,l);return{nGrams:m[0],nGramsSplits:m[1]}}var ET=N({stringNGrams_:d5});function f5(r,e,t=!0){let o=v(r,\"input\",\"stringSplit\",\"string\"),n=v(e,\"delimiter\",\"stringSplit\",\"string\");if(o.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${o.shape}`);if(n.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${n.shape}`);let s={skipEmpty:t},a={input:o,delimiter:n},i=_.runKernel(ru,a,s);return{indices:i[0],values:i[1],shape:i[2]}}var $T=N({stringSplit_:f5});function h5(r,e){let t=v(r,\"input\",\"stringToHashBucketFast\",\"string\"),o={numBuckets:e};if(e<=0)throw new Error(\"Number of buckets must be at least 1\");let n={input:t};return _.runKernel(ou,n,o)}var RT=N({stringToHashBucketFast_:h5});function g5(r,e,t,o=!0){let n=v(r,\"input\",\"staticRegexReplace\",\"string\"),s={pattern:e,rewrite:t,replaceGlobal:o};return _.runKernel(pi,{x:n},s)}var DT=N({staticRegexReplace_:g5});var x5={fft:fl,ifft:ep,rfft:hl,irfft:tf},y5={hammingWindow:jN,hannWindow:uf,frame:pf,stft:XN},b5={flipLeftRight:QN,grayscaleToRGB:ZN,resizeNearestNeighbor:lT,resizeBilinear:pT,rgbToGrayscale:JN,rotateWithOffset:eT,cropAndResize:YN,nonMaxSuppression:tT,nonMaxSuppressionAsync:nT,nonMaxSuppressionWithScore:sT,nonMaxSuppressionWithScoreAsync:aT,nonMaxSuppressionPadded:iT,nonMaxSuppressionPaddedAsync:uT,threshold:cT,transform:mT},C5={bandPart:dT,gramSchmidt:fT,qr:gT},w5={absoluteDifference:xT,computeWeightedLoss:dr,cosineDistance:yT,hingeLoss:bT,huberLoss:CT,logLoss:wT,meanSquaredError:ST,sigmoidCrossEntropy:IT,softmaxCrossEntropy:vT},S5={sparseFillEmptyRows:kT,sparseReshape:NT,sparseSegmentMean:TT,sparseSegmentSum:_T},I5={stringNGrams:ET,stringSplit:$T,stringToHashBucketFast:RT,staticRegexReplace:DT};var AT={};qe(AT,{Serializable:()=>Lc,SerializationMap:()=>df,getRegisteredName:()=>k5,registerClass:()=>hS});var v5=new Map,fS=new Map,Lc=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},df=class r{constructor(){this.classNameMap={}}static getMap(){return r.instance==null&&(r.instance=new r),r.instance}static register(e){r.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function hS(r,e,t){$(r.className!=null,()=>\"Class being registered does not have the static className property defined.\"),$(typeof r.className==\"string\",()=>\"className is required to be a string, but got type \"+typeof r.className),$(r.className.length>0,()=>\"Class being registered has an empty-string as its className, which is disallowed.\"),typeof e==\"undefined\"&&(e=\"Custom\"),typeof t==\"undefined\"&&(t=r.className);let o=t,n=e+\">\"+o;return df.register(r),v5.set(n,r),fS.set(r,n),r}function k5(r){return fS.has(r)?fS.get(r):r.className}var _r=class extends Lc{minimize(e,t=!1,o){let{value:n,grads:s}=this.computeGradients(e,o);if(o!=null){let a=o.map(i=>({name:i.name,tensor:s[i.name]}));this.applyGradients(a)}else this.applyGradients(s);return Lt(s),t?n:(n.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return eS(e,t)}dispose(){this.iterations_!=null&&Lt(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(_r,Symbol.hasInstance,{value:r=>r.minimize!=null&&r.computeGradients!=null&&r.applyGradients!=null});var sp=class extends _r{static get className(){return\"Adadelta\"}constructor(e,t,o=null){super(),this.learningRate=e,this.rho=t,this.epsilon=o,this.accumulatedGrads=[],this.accumulatedUpdates=[],o==null&&(this.epsilon=_.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o],a=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accum_grad`,variable:De(()=>Kt(s).variable(a))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${o}/accum_var`,variable:De(()=>Kt(s).variable(a))});let i=Array.isArray(e)?e[n].tensor:e[o];if(i==null)return;let p=this.accumulatedGrads[n].variable,u=this.accumulatedUpdates[n].variable;De(()=>{let l=Ce(se(p,this.rho),se(tr(i),1-this.rho)),c=se(Xe(Pr(Ce(u,this.epsilon)),Pr(Ce(p,this.epsilon))),i),m=Ce(se(u,this.rho),se(tr(c),1-this.rho));p.assign(l),u.assign(m);let d=Ce(se(c,-this.learningRate),s);s.assign(d)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Lt(this.accumulatedGrads.map(e=>e.variable)),Lt(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,o=!1;this.accumulatedGrads=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedUpdates=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};var ap=class extends _r{static get className(){return\"Adagrad\"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o];this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accumulator`,variable:De(()=>Ma(s.shape,this.initialAccumulatorValue).variable(!1))});let a=Array.isArray(e)?e[n].tensor:e[o];if(a==null)return;let i=this.accumulatedGrads[n].variable;De(()=>{let p=Ce(i,tr(a));i.assign(p);let u=Ce(se(Xe(a,Pr(Ce(p,_.backend.epsilon()))),-this.learningRate),s);s.assign(u)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Lt(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(o=>({originalName:o.name,variable:o.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};var ip=class extends _r{static get className(){return\"Adam\"}constructor(e,t,o,n=null){super(),this.learningRate=e,this.beta1=t,this.beta2=o,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],De(()=>{this.accBeta1=ke(t).variable(),this.accBeta2=ke(o).variable()}),n==null&&(this.epsilon=_.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(o=>o.name):Object.keys(e);De(()=>{let o=Te(1,this.accBeta1),n=Te(1,this.accBeta2);t.forEach((s,a)=>{let i=_.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:De(()=>Kt(i).variable(p))}),this.accumulatedSecondMoment[a]==null&&(this.accumulatedSecondMoment[a]={originalName:`${s}/v`,variable:De(()=>Kt(i).variable(p))});let u=Array.isArray(e)?e[a].tensor:e[s];if(u==null)return;let l=this.accumulatedFirstMoment[a].variable,c=this.accumulatedSecondMoment[a].variable,m=Ce(se(l,this.beta1),se(u,1-this.beta1)),d=Ce(se(c,this.beta2),se(tr(u),1-this.beta2)),f=Xe(m,o),h=Xe(d,n);l.assign(m),c.assign(d);let g=Ce(se(Xe(f,Ce(Pr(h),this.epsilon)),-this.learningRate),i);i.assign(g)}),this.accBeta1.assign(se(this.accBeta1,this.beta1)),this.accBeta2.assign(se(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Lt(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&Lt(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),De(()=>{this.accBeta1.assign(xi(this.beta1,this.iterations_+1)),this.accBeta2.assign(xi(this.beta2,this.iterations_+1))});let t=e.length/2,o=!1;this.accumulatedFirstMoment=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}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)}};var up=class extends _r{static get className(){return\"Adamax\"}constructor(e,t,o,n=null,s=0){super(),this.learningRate=e,this.beta1=t,this.beta2=o,this.epsilon=n,this.decay=s,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],De(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(t).variable()}),n==null&&(this.epsilon=_.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(o=>o.name):Object.keys(e);De(()=>{let o=Te(1,this.accBeta1),n=Xe(-this.learningRate,Ce(se(this.iteration,this.decay),1));t.forEach((s,a)=>{let i=_.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:Kt(i).variable(p)}),this.accumulatedWeightedInfNorm[a]==null&&(this.accumulatedWeightedInfNorm[a]={originalName:`${s}/v`,variable:Kt(i).variable(p)});let u=Array.isArray(e)?e[a].tensor:e[s];if(u==null)return;let l=this.accumulatedFirstMoment[a].variable,c=this.accumulatedWeightedInfNorm[a].variable,m=Ce(se(l,this.beta1),se(u,1-this.beta1)),d=se(c,this.beta2),f=er(u),h=Ud(d,f);l.assign(m),c.assign(h);let g=Ce(se(Xe(n,o),Xe(m,Ce(h,this.epsilon))),i);i.assign(g)}),this.iteration.assign(Ce(this.iteration,1)),this.accBeta1.assign(se(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Lt(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&Lt(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)}};var wi=class extends _r{static get className(){return\"SGD\"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=Array.isArray(e)?e[n].tensor:e[o];if(s==null)return;let a=_.registeredVariables[o];De(()=>{let i=Ce(se(this.c,s),a);a.assign(i)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Fr(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)}};var pp=class extends wi{static get className(){return\"Momentum\"}constructor(e,t,o=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=o,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o];this.accumulations[n]==null&&(this.accumulations[n]={originalName:`${o}/momentum`,variable:De(()=>Kt(s).variable(!1))});let a=this.accumulations[n].variable,i=Array.isArray(e)?e[n].tensor:e[o];i!=null&&De(()=>{let p,u=Ce(se(this.m,a),i);this.useNesterov?p=Ce(se(this.c,Ce(i,se(u,this.m))),s):p=Ce(se(this.c,u),s),a.assign(u),s.assign(p)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Lt(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(o=>({originalName:o.name,variable:o.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)}};var lp=class extends _r{static get className(){return\"RMSProp\"}constructor(e,t=.9,o=0,n=null,s=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=o,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=s,n==null&&(this.epsilon=_.backend.epsilon()),e==null)throw new Error(\"learningRate for RMSPropOptimizer must be defined.\")}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o],a=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${o}/rms`,variable:De(()=>Kt(s).variable(a))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${o}/momentum`,variable:De(()=>Kt(s).variable(a))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${o}/mg`,variable:De(()=>Kt(s).variable(a))});let i=Array.isArray(e)?e[n].tensor:e[o];if(i==null)return;let p=this.accumulatedMeanSquares[n].variable,u=this.accumulatedMoments[n].variable;De(()=>{let l=Ce(se(p,this.decay),se(tr(i),1-this.decay));if(this.centered){let c=this.accumulatedMeanGrads[n].variable,m=Ce(se(c,this.decay),se(i,1-this.decay)),d=Xe(se(i,this.learningRate),Pr(Te(l,Ce(tr(m),this.epsilon)))),f=Ce(se(u,this.momentum),d);p.assign(l),c.assign(m),u.assign(f);let h=Te(s,f);s.assign(h)}else{let c=Ce(se(p,this.decay),se(tr(i),1-this.decay)),m=Ce(se(u,this.momentum),Xe(se(i,this.learningRate),Pr(Ce(c,this.epsilon))));p.assign(c),u.assign(m);let d=Te(s,m);s.assign(d)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Lt(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Lt(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&Lt(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,o=!1;this.accumulatedMeanSquares=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedMoments=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})))}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)}};var N5=[sp,ap,ip,up,pp,lp,wi];function FT(){for(let r of N5)hS(r)}var Si={};qe(Si,{CompositeArrayBuffer:()=>lr,browserFiles:()=>OT,browserHTTPRequest:()=>zT,concatenateArrayBuffers:()=>Zk,copyModel:()=>m1,decodeWeights:()=>hd,decodeWeightsStream:()=>gd,encodeWeights:()=>jk,fromMemory:()=>VT,fromMemorySync:()=>wS,getLoadHandlers:()=>r1,getModelArtifactsForJSON:()=>il,getModelArtifactsForJSONSync:()=>Uw,getModelArtifactsInfoForJSON:()=>$a,getSaveHandlers:()=>t1,getWeightSpecs:()=>Ec,http:()=>hf,isHTTPScheme:()=>ff,listModels:()=>l1,loadWeights:()=>LT,moveModel:()=>d1,registerLoadRouter:()=>e1,registerSaveRouter:()=>Jk,removeModel:()=>c1,weightsLoaderFactory:()=>bS,withSaveHandler:()=>WT,withSaveHandlerSync:()=>UT});var T5=\"model\",_5=\".json\",E5=\".weights.bin\";function PT(r){return new Promise(e=>setTimeout(e)).then(r)}var bl=class r{constructor(e){if(!A().getBool(\"IS_BROWSER\"))throw new Error(\"browserDownloads() cannot proceed because the current environment is not a browser.\");e.startsWith(r.URL_SCHEME)&&(e=e.slice(r.URL_SCHEME.length)),(e==null||e.length===0)&&(e=T5),this.modelJsonFileName=e+_5,this.weightDataFileName=e+E5}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=lr.join(e.weightData),o=window.URL.createObjectURL(new Blob([t],{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}],s=xd(e,n),a=window.URL.createObjectURL(new Blob([JSON.stringify(s)],{type:\"application/json\"})),i=this.modelJsonAnchor==null?document.createElement(\"a\"):this.modelJsonAnchor;if(i.download=this.modelJsonFileName,i.href=a,await PT(()=>i.dispatchEvent(new MouseEvent(\"click\"))),e.weightData!=null){let p=this.weightDataAnchor==null?document.createElement(\"a\"):this.weightDataAnchor;p.download=this.weightDataFileName,p.href=o,await PT(()=>p.dispatchEvent(new MouseEvent(\"click\")))}return{modelArtifactsInfo:$a(e)}}}};bl.URL_SCHEME=\"downloads://\";var gS=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.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise((e,t)=>{let o=new FileReader;o.onload=n=>{let s=JSON.parse(n.target.result),a=s.modelTopology;if(a==null){t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(s.weightsManifest==null){t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){e({modelTopology:a});return}let p=il(s,u=>this.loadWeights(u));e(p)},o.onerror=n=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),o.readAsText(this.jsonFile)})}loadWeights(e){let t=[],o=[];for(let a of e)t.push(...a.weights),o.push(...a.paths);let n=this.checkManifestAndWeightFiles(e),s=o.map(a=>this.loadWeightsFile(a,n[a]));return Promise.all(s).then(a=>[t,a])}loadWeightsFile(e,t){return new Promise((o,n)=>{let s=new FileReader;s.onload=a=>{let i=a.target.result;o(i)},s.onerror=a=>n(`Failed to weights data from file of path '${e}'.`),s.readAsArrayBuffer(t)})}checkManifestAndWeightFiles(e){let t=[],o=this.weightsFiles.map(s=>Ww(s.name)),n={};for(let s of e)s.paths.forEach(a=>{let i=Ww(a);if(t.indexOf(i)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${i}'`);if(t.push(i),o.indexOf(i)===-1)throw new Error(`Weight file with basename '${i}' is not provided.`);n[a]=this.weightsFiles[o.indexOf(i)]});if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}},$5=r=>A().getBool(\"IS_BROWSER\")&&!Array.isArray(r)&&r.startsWith(bl.URL_SCHEME)?R5(r.slice(bl.URL_SCHEME.length)):null;Xt.registerSaveRouter($5);function R5(r=\"model\"){return new bl(r)}function OT(r){return new gS(r)}function xS(r,e,t,o){a(r),t=t==null?0:t,o=o==null?1:o,i(t,o);let n=0,s=p=>(p.then(u=>{let l=t+ ++n/r.length*(o-t);return e(l),u}),p);function a(p){$(p!=null&&Array.isArray(p)&&p.length>0,()=>\"promises must be a none empty array\")}function i(p,u){$(p>=0&&p<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${p}`),$(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),$(u>=p,()=>`startFraction must be no more than endFraction, but got startFraction ${p} and endFraction ${u}`)}return Promise.all(r.map(s))}async function yS(r,e){e==null&&(e={});let t=e.fetchFunc==null?A().platform.fetch:e.fetchFunc,o=r.map(c=>t(c,e.requestInit,{isBinary:!0})),i=(e.onProgress==null?await Promise.all(o):await xS(o,e.onProgress,0,.5)).map(c=>c.arrayBuffer());return e.onProgress==null?await Promise.all(i):await xS(i,e.onProgress,.5,1)}function MT(r,e){var t;let o=e.fetchFunc==null?A().platform.fetch:e.fetchFunc,n=0,s;return(t=e.onProgress)===null||t===void 0||t.call(e,0),new ReadableStream({pull:async a=>{for(var i;nyS(a,{requestInit:o}))(r,e,t)}function bS(r){return async(e,t=\"\",o)=>{let n=e.map(()=>!1),s={},a=o!=null?o.map(()=>!1):[],i=[];if(e.forEach((d,f)=>{let h=0;d.weights.forEach(g=>{let x=\"quantization\"in g?g.quantization.dtype:g.dtype,b=fi[x]*ze(g.shape),w=()=>{n[f]=!0,s[f]==null&&(s[f]=[]),s[f].push({manifestEntry:g,groupOffset:h,sizeBytes:b})};o!=null?o.forEach((S,k)=>{S===g.name&&(w(),a[k]=!0)}):w(),i.push(g.name),h+=b})}),!a.every(d=>d)){let d=o.filter((f,h)=>!a[h]);throw new Error(`Could not find weights in manifest with names: ${d.join(\", \")}. \nManifest JSON has weights with names: ${i.join(\", \")}.`)}let p=n.reduce((d,f,h)=>(f&&d.push(h),d),[]),u=[];p.forEach(d=>{e[d].paths.forEach(f=>{let h=t+(t.endsWith(\"/\")?\"\":\"/\")+f;u.push(h)})});let l=await r(u),c={},m=0;return p.forEach(d=>{let f=e[d].paths.length,h=new lr(l.slice(m,m+f));s[d].forEach(x=>{let b=h.slice(x.groupOffset,x.groupOffset+x.sizeBytes),w=hd(b,[x.manifestEntry]);for(let S in w)c[S]=w[S]}),m+=f}),c}}var D5=\"application/octet-stream\",A5=\"application/json\",Bc=class{constructor(e,t){if(this.DEFAULT_METHOD=\"POST\",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?($(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=A().platform.fetch,$(e!=null&&e.length>0,()=>\"URL path for http must not be null, undefined or empty.\"),Array.isArray(e)&&$(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||{},this.loadOptions=t}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 o=[{paths:[\"./model.weights.bin\"],weights:e.weightSpecs}],n=xd(e,o);if(t.body.append(\"model.json\",new Blob([JSON.stringify(n)],{type:A5}),\"model.json\"),e.weightData!=null){let a=lr.join(e.weightData);t.body.append(\"model.weights.bin\",new Blob([a],{type:D5}),\"model.weights.bin\")}let s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:$a(e),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){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(s){let a=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(\".pb\")?a+=\" 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.\":a+=\" Please make sure the server is serving valid JSON for this request.\",new Error(a)}let o=t.modelTopology,n=t.weightsManifest;if(o==null&&n==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();let e=await this.loadModelJSON();return il(e,t=>this.loadWeights(t))}async loadStream(){let e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),o=Ec(e.weightsManifest),n=()=>MT(t,this.loadOptions);return Object.assign(Object.assign({},e),{weightSpecs:o,getWeightStream:n})}async getWeightUrls(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[o,n]=F5(t),s=this.weightPathPrefix||o,a=[],i=[];for(let p of e)for(let u of p.paths)this.weightUrlConverter!=null?i.push(this.weightUrlConverter(u)):a.push(s+u+n);return this.weightUrlConverter&&a.push(...await Promise.all(i)),a}async loadWeights(e){let t=await this.getWeightUrls(e),o=Ec(e),n=await yS(t,this.loadOptions);return[o,n]}};Bc.URL_SCHEME_REGEX=/^https?:\\/\\//;function F5(r){let e=r.lastIndexOf(\"/\"),t=r.lastIndexOf(\"?\"),o=r.substring(0,e),n=t>e?r.substring(t):\"\";return[o+\"/\",n]}function ff(r){return r.match(Bc.URL_SCHEME_REGEX)!=null}var BT=(r,e)=>{if(typeof fetch==\"undefined\"&&(e==null||e.fetchFunc==null))return null;{let t=!0;if(Array.isArray(r)?t=r.every(o=>ff(o)):t=ff(r),t)return hf(r,e)}return null};Xt.registerSaveRouter(BT);Xt.registerLoadRouter(BT);function hf(r,e){return new Bc(r,e)}function zT(r,e){return hf(r,e)}var zc=class{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}},gf=class{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}},CS=class{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}};function VT(r,e,t,o){let n=arguments;return new CS(wS(...n))}function wS(r,e,t,o){return arguments.length===1?r.modelTopology!=null||r.weightSpecs!=null?new zc(r):(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 zc({modelTopology:r})):(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 zc({modelTopology:r,weightSpecs:e,weightData:t,trainingConfig:o}))}function WT(r){return new gf(r)}function UT(r){return new gf(r)}var HT={};qe(HT,{confusionMatrix:()=>GT});function P5(r,e,t){let o=v(r,\"labels\",\"confusionMatrix\"),n=v(e,\"predictions\",\"confusionMatrix\");$(t==null||t>0&&Number.isInteger(t),()=>`If provided, numClasses must be a positive integer, but got ${t}`),$(o.rank===1,()=>`Expected the rank of labels to be 1, but got ${o.rank}`),$(n.rank===1,()=>`Expected the rank of predictions to be 1, but got ${n.rank}`),$(o.shape[0]===n.shape[0],()=>`Mismatch in the number of examples: ${o.shape[0]} vs. ${n.shape[0]}. Labels and predictions should have the same number of elements.`),$(t>0&&Number.isInteger(t),()=>`numClasses is required to be a positive integer, but got ${t}`);let s=Oc(Ue(o,\"int32\"),t),a=Oc(Ue(n,\"int32\"),t),i=yl(s),p=Je(i,a);return Ue(p,\"int32\")}var GT=N({confusionMatrix_:P5});var XT={};qe(XT,{draw:()=>U5,fromPixels:()=>G5,fromPixelsAsync:()=>z5,toPixels:()=>W5});var cp,KT=!1;function qT(r,e=3){if(e>4)throw new Error(\"Cannot construct Tensor with more than 4 channels from pixels.\");if(r==null)throw new Error(\"pixels passed to tf.browser.fromPixels() can not be null\");let t=!1,o=!1,n=!1,s=!1,a=!1,i=!1;if(r.data instanceof Uint8Array)t=!0;else if(typeof ImageData!=\"undefined\"&&r instanceof ImageData)o=!0;else if(typeof HTMLVideoElement!=\"undefined\"&&r instanceof HTMLVideoElement)n=!0;else if(typeof HTMLImageElement!=\"undefined\"&&r instanceof HTMLImageElement)s=!0;else if(r.getContext!=null)a=!0;else if(typeof ImageBitmap!=\"undefined\"&&r instanceof ImageBitmap)i=!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 ${r.constructor.name}`);if(tl(Lu,_.backendName)!=null){let f={pixels:r},h={numChannels:e};return _.runKernel(Lu,f,h)}let[u,l]=n?[r.videoWidth,r.videoHeight]:[r.width,r.height],c;if(a)c=r.getContext(\"2d\").getImageData(0,0,u,l).data;else if(o||t)c=r.data;else if(s||n||i){if(cp==null)if(typeof document==\"undefined\")if(typeof OffscreenCanvas!=\"undefined\"&&typeof OffscreenCanvasRenderingContext2D!=\"undefined\")cp=new OffscreenCanvas(1,1).getContext(\"2d\");else throw new Error(\"Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.\");else cp=document.createElement(\"canvas\").getContext(\"2d\",{willReadFrequently:!0});cp.canvas.width=u,cp.canvas.height=l,cp.drawImage(r,0,0,u,l),c=cp.getImageData(0,0,u,l).data}let m;if(e===4)m=new Int32Array(c);else{let f=u*l;m=new Int32Array(f*e);for(let h=0;h4||e===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${e}`);if(r.dtype!==\"float32\"&&r.dtype!==\"int32\")throw new Error(`Unsupported type for toPixels: ${r.dtype}. Please use float32 or int32 tensors.`)}function V5(r){let e=(r==null?void 0:r.alpha)||1;if(e>1||e<0)throw new Error(`Alpha value ${e} is suppoed to be in range [0 - 1].`)}async function W5(r,e){let t=v(r,\"img\",\"toPixels\");if(!(r instanceof dt)){let u=t;t=Ue(u,\"int32\"),u.dispose()}jT(t);let[o,n]=t.shape.slice(0,2),s=t.rank===2?1:t.shape[2],a=await t.data(),i=t.dtype===\"float32\"?255:1,p=new Uint8ClampedArray(n*o*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${d}.`)}else if(t.dtype===\"int32\"&&(d<0||d>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${d}.`);s===1?(l[0]=d*i,l[1]=d*i,l[2]=d*i):l[m]=d*i}let c=u*4;p[c+0]=Math.round(l[0]),p[c+1]=Math.round(l[1]),p[c+2]=Math.round(l[2]),p[c+3]=Math.round(l[3])}if(e!=null){KT||tl(Mu,_.backendName)!=null&&(console.warn(\"tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead.\"),KT=!0),e.width=n,e.height=o;let u=e.getContext(\"2d\"),l=new ImageData(p,n,o);u.putImageData(l,0,0)}return t!==r&&t.dispose(),p}function U5(r,e,t){let o=v(r,\"img\",\"draw\");if(!(r instanceof dt)){let a=o;o=Ue(a,\"int32\"),a.dispose()}jT(o),V5(t==null?void 0:t.imageOptions);let n={image:o},s={canvas:e,options:t};_.runKernel(Mu,n,s)}var G5=N({fromPixels_:qT});var xf={};qe(xf,{prepareAndValidate:()=>YT});function YT(r,e){let t=r.shape.length,o=e.shape.length;if(t<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${t}.`);if(o<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${o}.`);if(e.dtype!==\"int32\")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.shape[o-1]>t)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${e.shape[o-1]} vs. ${t}`);if(ze(r.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${r.shape}.`);let n=e.shape,s=n[n.length-1],a=1;for(let c=0;cc/u),1].slice(0,s);return[p,a,u,l]}var nt={};qe(nt,{assertParamsValid:()=>K5,computeFlatOffset:()=>Q5,computeOutShape:()=>j5,getNormalizedAxes:()=>X5,isSliceContinous:()=>Y5,maskToAxes:()=>q5,parseSliceParams:()=>Z5,sliceInfo:()=>J5,startForAxis:()=>n_,startIndicesWithElidedDims:()=>t_,stopForAxis:()=>s_,stopIndicesWithElidedDims:()=>r_,stridesForAxis:()=>o_,stridesWithElidedDims:()=>ZT});var SS=-2,H5=-1;function K5(r,e,t){let o=r.shape.length;$(o===e.length,()=>`Error in slice${o}D: Length of begin ${e} must match the rank of the array (${o}).`),$(o===t.length,()=>`Error in slice${o}D: Length of size ${t} must match the rank of the array (${o}).`);for(let n=0;n`Error in slice${o}D: begin[${n}] + size[${n}] (${e[n]+t[n]}) would overflow input.shape[${n}] (${r.shape[n]})`)}function q5(r){let e=[],t=0;for(;r>0;)r&1&&e.push(t),r/=2,t++;return e}function j5(r,e,t){let o=[];for(let n=0;n0){let d=e[0],f=t+1;l=t_(a,d,f,o,r),c=r_(i,d,f,n,r),m=ZT(s,d,f,r)}else for(let d=0;d-1)s[i]=0;else{let p=JT(e,t,i),u=o[p];r&1<-1)s[i]=Number.MAX_SAFE_INTEGER;else{let p=JT(e,t,i),u=o[p];r&1<0?a=Number.MIN_SAFE_INTEGER:a=Number.MAX_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),a=qp(0,a,p-1),a}function s_(r,e,t,o,n,s){let a=e[n],i=t[n]||1;(r&1<0?a=Number.MAX_SAFE_INTEGER:a=Number.MIN_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),i>0?a=qp(0,a,p):a=qp(-1,a,p-1),a}function Y5(r,e,t){let o=t.length;for(let n=0;n1){o=n;break}for(let n=o+1;n0||t[n]!==r[n])return!1;return!0}function Q5(r,e){let t=r.length>0?r[r.length-1]:1;for(let o=0;o{$(a!==-1,()=>\"slice() does not support negative begin indexing.\")});let s;return t==null?s=new Array(n).fill(-1):typeof t==\"number\"?s=[t,...new Array(n-1).fill(-1)]:t.lengtha>=0?a:($(a===-1,()=>`Negative size values should be exactly -1 but got ${a} for the slice() size at index ${i}.`),r.shape[i]-o[i])),[o,s]}function J5(r,e,t,o,n,s,a,i,p){let u;if(o==null?(u=new Array(e.length),u.fill(1)):u=o,a!=null&&a&a-1)throw new Error(\"Multiple ellipses in slice is not allowed.\");let l=!1,c={dims:u.length,numAddAxisAfterEllipsis:0,begin:e.slice(),end:t.slice(),strides:u.slice(),beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};for(let w=0;w0?0:-1,m.strides[w]>0?k:k-1];if(S&&m.strides[w]<=0)throw Error(\"only stride 1 allowed on non-range indexing.\");h=h&&m.strides[w]===1;let R=!!(m.beginMask&1<=k)throw Error(`slice index ${m.begin[w]} of dimension ${w} out of bounds.`)}else m.begin[w]=QT(m.begin[w],0,m.strides[w],k,T,E),m.end[w]=QT(m.end[w],1,m.strides[w],k,T,E);let O=m.strides[w]===1&&m.begin[w]===0&&m.end[w]===k;d=d&&O,f=f&&(w===0&&m.strides[w]===1||O)}else d=d&&m.strides[w]===1&&R,f=f&&(w===0&&m.strides[w]===1||R);let D,F=!1;if(m.beginValid&&m.endValid?(D=m.end[w]-m.begin[w],F=!0):S?(D=1,F=!0):R&&k>=0&&(m.strides[w]<0?D=-k:D=k,F=!0),F){let O;D===0||D<0!=m.strides[w]<0?O=0:O=Math.trunc(D/m.strides[w])+(D%m.strides[w]!==0?1:0),g.push(O)}else g.push(-1)}for(let w=0;w=0?x.push(g[S]):S===SS&&x.push(1)}return{finalShapeSparse:x.filter((w,S)=>m.finalShapeGatherIndices[S]!==SS),finalShape:x,isIdentity:d,sliceDim0:f,isSimpleSlice:h,begin:m.begin,end:m.end,strides:m.strides}}function e8(r,e){e.beginMask=0,e.endMask=0,e.shrinkAxisMask=0;let t=0;e.beginValid=r.begin!=null,e.endValid=r.end!=null,e.begin=new Array(e.dims),e.end=new Array(e.dims),e.strides=new Array(e.dims),e.finalShapeGatherIndices=[],e.finalShapeGatherIndicesSparse=[],e.inputShapeGatherIndicesSparse=new Array(e.dims);for(let o=0;o0?s[e]:s[e+1&1];{let a=r<0?o+r:r;return as[1]?s[1]:a}}var t8=\"4.17.0\";var Vc=class{static sgd(e){return new wi(e)}static momentum(e,t,o=!1){return new pp(e,t,o)}static rmsprop(e,t=.9,o=0,n=null,s=!1){return new lp(e,t,o,n,s)}static adam(e=.001,t=.9,o=.999,n=null){return new ip(e,t,o,n)}static adadelta(e=.001,t=.95,o=null){return new sp(e,t,o)}static adamax(e=.002,t=.9,o=.999,n=null,s=0){return new up(e,t,o,n,s)}static adagrad(e,t=.1){return new ap(e,t)}};var cHe=Vc;var r8=typeof requestAnimationFrame!=\"undefined\"?requestAnimationFrame:typeof setImmediate!=\"undefined\"?setImmediate:r=>r();function IS(){return new Promise(r=>r8(()=>r()))}var C={};qe(C,{ERF_A1:()=>b8,ERF_A2:()=>C8,ERF_A3:()=>w8,ERF_A4:()=>S8,ERF_A5:()=>I8,ERF_P:()=>y8,PARALLELIZE_THRESHOLD:()=>yf,RowPartitionType:()=>Va,SELU_SCALE:()=>x8,SELU_SCALEALPHA:()=>g8,applyActivation:()=>op,assertAndGetBroadcastShape:()=>rt,assertAxesAreInnerMostDims:()=>_q,assertParamsConsistent:()=>o8,assignToTypedArray:()=>E8,axesAreInnerMostDims:()=>Jw,calculateShapes:()=>DN,checkEinsumDimSizes:()=>P8,checkPadOnDimRoundingMode:()=>zt,combineLocations:()=>u2,combineRaggedTensorToTensorShapes:()=>s8,complexWithEvenIndex:()=>N8,complexWithOddIndex:()=>T8,computeConv2DInfo:()=>Ku,computeConv3DInfo:()=>_1,computeDefaultPad:()=>Zw,computeDilation2DInfo:()=>NK,computeOptimalWindowSize:()=>p8,computeOutAndReduceShapes:()=>Tq,computeOutShape:()=>n8,computePool2DInfo:()=>Qw,computePool3DInfo:()=>TK,convertConv2DDataFormat:()=>E1,decodeEinsumEquation:()=>A8,eitherStridesOrDilationsAreOne:()=>br,expandShapeToKeepDim:()=>gi,exponent:()=>R8,exponents:()=>$8,fromStringArrayToUint8:()=>rY,fromUint8ToStringArray:()=>tY,getAxesPermutation:()=>Eq,getBroadcastDims:()=>o2,getComplexWithIndex:()=>_8,getEinsumComputePath:()=>O8,getEinsumPermutation:()=>F8,getFusedBiasGradient:()=>rp,getFusedDyActivation:()=>tp,getImageCenter:()=>l8,getInnerMostAxes:()=>Rq,getPermuted:()=>m8,getRaggedRank:()=>i8,getReductionAxes:()=>Td,getReshaped:()=>c8,getReshapedPermuted:()=>d8,getRowPartitionTypesHelper:()=>a8,getSliceBeginCoords:()=>f8,getSliceSize:()=>h8,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>z8,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>V8,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>W8,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>H8,getSparseReshapeInputOutputMismatchErrorMessage:()=>q8,getSparseReshapeInputOutputMultipleErrorMessage:()=>K8,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>U8,getSparseReshapeNegativeOutputDimErrorMessage:()=>G8,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>Q8,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>j8,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>X8,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>Y8,getUndoAxesPermutation:()=>$q,isIdentityPermutation:()=>M8,log:()=>CH,mergeRealAndImagArrays:()=>v8,prepareAndValidate:()=>YT,prepareSplitSize:()=>B8,segment_util:()=>kS,shouldFuse:()=>np,slice_util:()=>nt,splitRealAndImagArrays:()=>k8,stridesOrDilationsArePositive:()=>Aa,tupleValuesAreOne:()=>Hu,upcastType:()=>pt,validateDefaultValueShape:()=>u8,validateInput:()=>xl,validateUpdateShape:()=>lS,warn:()=>Ea});function o8(r,e){let t=r[0].length;r.forEach((n,s)=>{$(n.length===t,()=>`Error in concat${t}D: rank of tensors[${s}] must be the same as the rank of the rest (${t})`)}),$(e>=0&&e`Error in concat${t}D: axis must be between 0 and ${t-1}.`);let o=r[0];r.forEach((n,s)=>{for(let a=0;a`Error in concat${t}D: Shape of tensors[${s}] (${n}) does not match the shape of the rest (${o}) along the non-concatenated axis ${s}.`)})}function n8(r,e){let t=r[0].slice();for(let o=1;o=0)if(i>=0){if(i!==s)throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.shape[${n+r}] = ${s} but shape[${n+r}] = ${i}`)}else o[a]=s}return o}function a8(r){let e={FIRST_DIM_SIZE:Va.FIRST_DIM_SIZE,VALUE_ROWIDS:Va.VALUE_ROWIDS,ROW_LENGTHS:Va.ROW_LENGTHS,ROW_SPLITS:Va.ROW_SPLITS,ROW_LIMITS:Va.ROW_LIMITS,ROW_STARTS:Va.ROW_STARTS},t=[];for(let o of r)if(o in e)t.push(e[o]);else break;return t}function i8(r){return r.length===0?0:r[0]===Va.FIRST_DIM_SIZE?r.length-1:r.length}function u8(r,e){if(r==null||e==null)return;let t=r.length,o=e.length;if(t>=o)throw new Error(`defaultValue.shape=${r} and ragged tensor flatValues.shape=${e}, are incompatible: defaultValue.rank = ${t} must be less than ragged tensor input flatValues.rank = ${o})`);for(let n=0;n=0&&a>=0&&s!==1&&s!==a)throw new Error(`defaultValue.shape=${r}, and ragged tensor input flatValues.shape=${e} are incompatible: defaultValue.shape[${n-r.length}] = ${s} but ragged tensor input.flatValues.shape[${n-r.length}] = ${a}`)}}var yf=30;function p8(r){return r<=yf?r:Xp(r,Math.floor(Math.sqrt(r)))}function l8(r,e,t){let o=t*(typeof r==\"number\"?r:r[0]),n=e*(typeof r==\"number\"?r:r[1]);return[o,n]}function c8(r,e,t,o=!0){let n=[];if(o)n=n.concat(e.slice(0)),n.push(r[0]/t),n=n.concat(r.slice(1));else{n=n.concat(r[0]);let s=e.length;for(let a=0;a=e*2+1||a%2===1?s.push(a):n.push(a);o.push(...n),o.push(0),o.push(...s)}return o}function d8(r,e,t,o=!0){let n=[];o?n.push(r[0]/t):n.push(r[0]*t);for(let s=1;s\",D8=/->/g,a_=\",\",i_=\"...\";function A8(r,e){r=r.replace(/\\s/g,\"\");let t=(r.length-r.replace(D8,\"\").length)/vS.length;if(t<1)throw new Error(\"Equations without an arrow are not supported.\");if(t>1)throw new Error(`Equation must contain exactly one arrow (\"${vS}\").`);let[o,n]=r.split(vS);$(o.indexOf(i_)===-1,()=>`The ellipsis notation (\"${i_}\") is not supported yet.`);let s=o.split(a_),a=s.length;if(e!==a)throw new Error(`Expected ${a} input tensors, received ${e}`);if(a>2)throw new Error(\"Support for more than 2 input tensors is not implemented yet.\");let i=[];for(let m=0;mf.indexOf(d)!==-1))throw new Error(`Output subscripts contain the label ${d} not present in the input subscripts.`);i.indexOf(d)===-1&&i.push(d)}for(let m=0;mn!==-1),{permutationIndices:t,expandDims:o}}function P8(r,e,t){let o=new Array(r);for(let n=0;n`Expected dimension ${o[e[n][a]]} at axis ${a} of input shaped ${JSON.stringify(s)}, but got dimension ${s[a]}`)}}function O8(r,e){let t=r,o=[],n=0;r.length===0&&t.push(-1),n=r.length+1;for(let a=0;ae===t)}function L8(r,e){let t=[];for(let o=0;o\"Number of splits must evenly divide the axis.\"),o=new Array(e).fill(r.shape[t]/e);else{let n=e.reduce((a,i)=>(i===-1&&(a+=1),a),0);$(n<=1,()=>\"There should be only one negative value in split array.\");let s=e.indexOf(-1);if(s!==-1){let a=e.reduce((i,p)=>p>0?i+p:i);e[s]=r.shape[t]-a}$(r.shape[t]===e.reduce((a,i)=>a+i),()=>\"The sum of sizes must match the size of the axis dimension.\"),o=e}return o}function z8(r){return`Received SparseTensor with denseShape[0] = 0 but\n indices.shape[0] = ${r}`}function V8(r,e){return`indices(${r}, 0) is invalid: ${e} < 0`}function W8(r,e,t){return`indices(${r}, 0) is invalid: ${e} >= ${t}`}function U8(r,e){return`only one output dimension may be -1, not both ${r} and ${e}`}function G8(r,e){return`size ${r} must be non-negative, not ${e}`}function H8(){return\"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero\"}function K8(r,e){let t=ze(r),o=ze(e);return`Input to reshape is a SparseTensor with ${t}\n dense values, but the requested shape requires a multiple of ${o}. inputShape=${r} outputShape= ${e}`}function q8(r,e){let t=ze(r),o=ze(e);return`Input to reshape is a tensor with ${t} dense values, but the requested shape has ${o}. inputShape=${r} outputShape=${e}`}function j8(){return\"segment ids must be >= 0\"}function X8(){return\"segment ids are not increasing\"}function Y8(r,e){return`Segment id ${r} out of range [0, ${e}), possibly because segmentIds input is not sorted.`}function Q8(r,e,t){return`Bad: indices[${r}] == ${e} out of range [0, ${t})`}var kS={};qe(kS,{collectGatherOpShapeInfo:()=>eY,computeOutShape:()=>J8,segOpComputeOptimalWindowSize:()=>Z8});function Z8(r,e){let t=!1,o;for(r<=yf?(o=r,t=!0):o=Xp(r,Math.floor(Math.sqrt(r)));!t;)o>e||o===r?t=!0:o=Xp(r,o+1);return o}function J8(r,e,t){let o=[],n=r.length;for(let s=0;sn))throw new Error(`Expect batchDims in the range of [-${n}, ${n}], but got ${o}`);if(o<0&&(o+=n),o>s)throw new Error(`batchDims (${o}) must be less than rank(x) (\n ${s}).`);if(tsl(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function rY(r){return r.map(e=>iu(e))}var Ut={};qe(Ut,{nonMaxSuppressionV3Impl:()=>lf,nonMaxSuppressionV4Impl:()=>cf,nonMaxSuppressionV5Impl:()=>mf,whereImpl:()=>sf});FT();var oY=A();oY.registerFlag(\"KEEP_INTERMEDIATE_TENSORS\",()=>!1,r=>{r&&console.warn(\"Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.\")});var Or;(function(r){r[r.DT_INVALID=0]=\"DT_INVALID\",r[r.DT_FLOAT=1]=\"DT_FLOAT\",r[r.DT_DOUBLE=2]=\"DT_DOUBLE\",r[r.DT_INT32=3]=\"DT_INT32\",r[r.DT_UINT8=4]=\"DT_UINT8\",r[r.DT_INT16=5]=\"DT_INT16\",r[r.DT_INT8=6]=\"DT_INT8\",r[r.DT_STRING=7]=\"DT_STRING\",r[r.DT_COMPLEX64=8]=\"DT_COMPLEX64\",r[r.DT_INT64=9]=\"DT_INT64\",r[r.DT_BOOL=10]=\"DT_BOOL\",r[r.DT_QINT8=11]=\"DT_QINT8\",r[r.DT_QUINT8=12]=\"DT_QUINT8\",r[r.DT_QINT32=13]=\"DT_QINT32\",r[r.DT_BFLOAT16=14]=\"DT_BFLOAT16\",r[r.DT_QINT16=15]=\"DT_QINT16\",r[r.DT_QUINT16=16]=\"DT_QUINT16\",r[r.DT_UINT16=17]=\"DT_UINT16\",r[r.DT_COMPLEX128=18]=\"DT_COMPLEX128\",r[r.DT_HALF=19]=\"DT_HALF\",r[r.DT_RESOURCE=20]=\"DT_RESOURCE\",r[r.DT_VARIANT=21]=\"DT_VARIANT\",r[r.DT_UINT32=22]=\"DT_UINT32\",r[r.DT_UINT64=23]=\"DT_UINT64\",r[r.DT_FLOAT_REF=101]=\"DT_FLOAT_REF\",r[r.DT_DOUBLE_REF=102]=\"DT_DOUBLE_REF\",r[r.DT_INT32_REF=103]=\"DT_INT32_REF\",r[r.DT_UINT8_REF=104]=\"DT_UINT8_REF\",r[r.DT_INT16_REF=105]=\"DT_INT16_REF\",r[r.DT_INT8_REF=106]=\"DT_INT8_REF\",r[r.DT_STRING_REF=107]=\"DT_STRING_REF\",r[r.DT_COMPLEX64_REF=108]=\"DT_COMPLEX64_REF\",r[r.DT_INT64_REF=109]=\"DT_INT64_REF\",r[r.DT_BOOL_REF=110]=\"DT_BOOL_REF\",r[r.DT_QINT8_REF=111]=\"DT_QINT8_REF\",r[r.DT_QUINT8_REF=112]=\"DT_QUINT8_REF\",r[r.DT_QINT32_REF=113]=\"DT_QINT32_REF\",r[r.DT_BFLOAT16_REF=114]=\"DT_BFLOAT16_REF\",r[r.DT_QINT16_REF=115]=\"DT_QINT16_REF\",r[r.DT_QUINT16_REF=116]=\"DT_QUINT16_REF\",r[r.DT_UINT16_REF=117]=\"DT_UINT16_REF\",r[r.DT_COMPLEX128_REF=118]=\"DT_COMPLEX128_REF\",r[r.DT_HALF_REF=119]=\"DT_HALF_REF\",r[r.DT_RESOURCE_REF=120]=\"DT_RESOURCE_REF\",r[r.DT_VARIANT_REF=121]=\"DT_VARIANT_REF\",r[r.DT_UINT32_REF=122]=\"DT_UINT32_REF\",r[r.DT_UINT64_REF=123]=\"DT_UINT64_REF\"})(Or||(Or={}));var u_;(function(r){let e;(function(t){t[t.LEGACY=0]=\"LEGACY\",t[t.V1=1]=\"V1\",t[t.V2=2]=\"V2\"})(e=r.CheckpointFormatVersion||(r.CheckpointFormatVersion={}))})(u_||(u_={}));var TS={};function sY(r,e){let t={tfOpName:r,category:\"custom\",inputs:[],attrs:[],customExecutor:e};TS[r]=t}function bf(r){return TS[r]}function aY(r){delete TS[r]}function I(r,e,t,o,n){let s=e.inputParams[r];if(s&&s.inputIndexStart!==void 0){let i=s.inputIndexStart,p=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?i+1:s.inputIndexEnd,u=i<0?e.inputNames.length+i:i;if(s.type===\"tensor\")return Vt(e.inputNames[u],t,o,n);if(s.type===\"tensors\"){let m=e.inputs.slice(i,p);return e.inputNames.slice(i,p).filter((f,h)=>{var g;return((g=m[h])===null||g===void 0?void 0:g.op)!==\"NoOp\"}).map(f=>Vt(f,t,o,n))}let l=Vt(e.inputNames[u],t,o,n),c=l.dataSync();return s.type===\"number\"?c[0]:y.toNestedArray(l.shape,c)}let a=e.attrParams[r];return a&&a.value}function Vt(r,e,t,o){let[n,s]=Er(r,t);if(o!=null){let i=o.getHashTableHandleByName(n);if(i!=null)return i}let a=t.currentContextIds.find(i=>!!e[Cf(n,i)]);return a!==void 0?e[Cf(n,a)][s]:void 0}function _S(r,e,t){return e[Cf(r,t.currentContextId)]}function qs(r,e){let[t,o,n]=Er(r,e);return[Cf(t,e&&e.currentContextId),o,n]}function Cf(r,e){return e?`${r}-${e}`:r}function Er(r,e){if(r===\"\")return[\"\",0,void 0];let t=e!=null&&e.parseNodeNameCache!=null;if(t){let s=e.parseNodeNameCache.get(r);if(s!=null)return s}let o=r.split(\":\"),n;if(o.length===1)n=[r,0,void 0];else{let s=o[0],a=o.length===3?o[1]:void 0,i=Number(o[o.length-1]);n=[s,i,a]}return t&&e.parseNodeNameCache.set(r,n),n}function Wc(r,e,t){let o=I(\"pad\",r,e,t);if(o===\"explicit\"){o=I(\"explicitPaddings\",r,e,t);let n=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)n[s][0]=o[s*2],n[s][1]=o[s*2+1];return n}return o}function js(r){return r.kept?r:Xr(r)}var ES={};qe(ES,{json:()=>iY});var iY=[{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}]}];var $S={};qe($S,{json:()=>uY});var uY=[{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:\"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}]},{tfOpName:\"IsFinite\",category:\"basic_math\",inputs:[{start:0,name:\"x\",type:\"tensor\"}],attrs:[{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]},{tfOpName:\"IsInf\",category:\"basic_math\",inputs:[{start:0,name:\"x\",type:\"tensor\"}],attrs:[{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]}];var RS={};qe(RS,{json:()=>pY});var pY=[{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:\"TensorListConcatV2\",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\"}]},{tfOpName:\"TensorListLength\",category:\"control\",inputs:[{start:0,name:\"tensorListId\",type:\"tensor\"}]},{tfOpName:\"TensorListResize\",category:\"control\",inputs:[{start:0,name:\"tensorListId\",type:\"tensor\"},{start:1,name:\"size\",type:\"number\"}]}];var DS={};qe(DS,{json:()=>lY});var lY=[{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\",defaultValue:.2}]},{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\"}]}];var AS={};qe(AS,{json:()=>cY});var cY=[{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\"}]},{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:\"RandomStandardNormal\",category:\"creation\",inputs:[{start:0,name:\"shape\",type:\"number[]\"}],attrs:[{tfName:\"seed\",name:\"seed\",type:\"number\",defaultValue:0},{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:\"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:\"RandomUniformInt\",category:\"creation\",inputs:[{start:0,name:\"shape\",type:\"number[]\"}],attrs:[{tfName:\"minval\",name:\"minval\",type:\"number\"},{tfName:\"maxval\",name:\"maxval\",type:\"number\"},{tfName:\"seed\",name:\"seed\",type:\"number\",defaultValue:0},{tfName:\"seed2\",name:\"seed2\",type:\"number\",defaultValue:0,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\"}]}];var FS={};qe(FS,{json:()=>mY});var mY=[{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}]}];var PS={};qe(PS,{json:()=>dY});var dY=[{tfOpName:\"LowerBound\",category:\"evaluation\",inputs:[{start:0,name:\"sortedSequence\",type:\"tensor\"},{start:1,name:\"values\",type:\"tensor\"}]},{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:\"UpperBound\",category:\"evaluation\",inputs:[{start:0,name:\"sortedSequence\",type:\"tensor\"},{start:1,name:\"values\",type:\"tensor\"}]},{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\"}]}];var OS={};qe(OS,{json:()=>fY});var fY=[{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\"}]}];var MS={};qe(MS,{json:()=>hY});var hY=[{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\"}]},{tfOpName:\"InitializeTable\",category:\"hash_table\",inputs:[{start:0,name:\"tableHandle\",type:\"tensor\"},{start:1,name:\"keys\",type:\"tensor\"},{start:2,name:\"values\",type:\"tensor\"}]},{tfOpName:\"InitializeTableV2\",category:\"hash_table\",inputs:[{start:0,name:\"tableHandle\",type:\"tensor\"},{start:1,name:\"keys\",type:\"tensor\"},{start:2,name:\"values\",type:\"tensor\"}]}];var LS={};qe(LS,{json:()=>gY});var gY=[{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\"}]},{tfOpName:\"ImageProjectiveTransformV3\",category:\"image\",inputs:[{start:0,name:\"images\",type:\"tensor\"},{start:1,name:\"transforms\",type:\"tensor\"},{start:2,name:\"outputShape\",type:\"number[]\"},{start:3,name:\"fillValue\",type:\"number\"}],attrs:[{tfName:\"interpolation\",name:\"interpolation\",type:\"string\"},{tfName:\"fill_mode\",name:\"fillMode\",type:\"string\"}]}];var BS={};qe(BS,{json:()=>xY});var xY=[{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}]},{tfOpName:\"BitwiseAnd\",category:\"logical\",inputs:[{start:0,name:\"x\",type:\"tensor\"},{start:1,name:\"y\",type:\"tensor\"}]}];var zS={};qe(zS,{json:()=>yY});var yY=[{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:\"leakyrelu_alpha\",name:\"leakyreluAlpha\",type:\"number\",defaultValue:.2},{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\"}]},{tfOpName:\"MatrixBandPart\",category:\"matrices\",inputs:[{start:0,name:\"a\",type:\"tensor\"},{start:1,name:\"numLower\",type:\"tensor\"},{start:1,name:\"numUpper\",type:\"tensor\"}]}];var VS={};qe(VS,{json:()=>bY});var bY=[{tfOpName:\"EuclideanNorm\",category:\"normalization\",inputs:[{start:0,name:\"x\",type:\"tensor\"},{start:1,name:\"axis\",type:\"number[]\"}],attrs:[{tfName:\"keep_dims\",name:\"keepDims\",type:\"bool\",defaultValue:!1}]},{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\"}]}];var WS={};qe(WS,{json:()=>CY});var CY=[{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\"},{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]},{tfOpName:\"Cumprod\",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\"}]},{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\"}]}];var US={};qe(US,{json:()=>wY});var wY=[{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}]},{tfOpName:\"TensorScatterUpdate\",category:\"slice_join\",inputs:[{start:0,name:\"tensor\",type:\"tensor\"},{start:1,name:\"indices\",type:\"tensor\"},{start:2,name:\"values\",type:\"tensor\"}]}];var GS={};qe(GS,{json:()=>SY});var SY=[{tfOpName:\"SparseFillEmptyRows\",category:\"sparse\",inputs:[{start:0,name:\"indices\",type:\"tensor\"},{start:1,name:\"values\",type:\"tensor\"},{start:2,name:\"denseShape\",type:\"tensor\"},{start:3,name:\"defaultValue\",type:\"tensor\"}]},{tfOpName:\"SparseReshape\",category:\"sparse\",inputs:[{start:0,name:\"inputIndices\",type:\"tensor\"},{start:1,name:\"inputShape\",type:\"tensor\"},{start:2,name:\"newShape\",type:\"tensor\"}],attrs:[{tfName:\"T\",name:\"dtype\",type:\"dtype\",notSupported:!0}]},{tfOpName:\"SparseSegmentMean\",category:\"sparse\",inputs:[{start:0,name:\"data\",type:\"tensor\"},{start:1,name:\"indices\",type:\"tensor\"},{start:2,name:\"segmentIds\",type:\"tensor\"}]},{tfOpName:\"SparseSegmentSum\",category:\"sparse\",inputs:[{start:0,name:\"data\",type:\"tensor\"},{start:1,name:\"indices\",type:\"tensor\"},{start:2,name:\"segmentIds\",type:\"tensor\"}]}];var HS={};qe(HS,{json:()=>IY});var IY=[{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}]}];var KS={};qe(KS,{json:()=>vY});var vY=[{tfOpName:\"StaticRegexReplace\",category:\"string\",inputs:[{start:0,name:\"input\",type:\"tensor\"}],attrs:[{tfName:\"pattern\",name:\"pattern\",type:\"string\"},{tfName:\"rewrite\",name:\"rewrite\",type:\"string\"},{tfName:\"replace_global\",name:\"replaceGlobal\",type:\"bool\"}]},{tfOpName:\"StringNGrams\",category:\"string\",inputs:[{start:0,name:\"data\",type:\"tensor\"},{start:1,name:\"dataSplits\",type:\"tensor\"}],attrs:[{tfName:\"separator\",name:\"separator\",type:\"string\"},{tfName:\"ngram_widths\",name:\"nGramWidths\",type:\"number[]\"},{tfName:\"left_pad\",name:\"leftPad\",type:\"string\"},{tfName:\"right_pad\",name:\"rightPad\",type:\"string\"},{tfName:\"pad_width\",name:\"padWidth\",type:\"number\"},{tfName:\"preserve_short_sequences\",name:\"preserveShortSequences\",type:\"bool\"}],outputs:[\"ngrams\",\"ngrams_splits\"]},{tfOpName:\"StringSplit\",category:\"string\",inputs:[{start:0,name:\"input\",type:\"tensor\"},{start:1,name:\"delimiter\",type:\"tensor\"}],attrs:[{tfName:\"skip_empty\",name:\"skipEmpty\",type:\"bool\"}],outputs:[\"indices\",\"values\",\"shape\"]},{tfOpName:\"StringToHashBucketFast\",category:\"string\",inputs:[{start:0,name:\"input\",type:\"tensor\"}],attrs:[{tfName:\"num_buckets\",name:\"numBuckets\",type:\"number\"}]}];var qS={};qe(qS,{json:()=>kY});var kY=[{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:\"EnsureShape\",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:[]},{tfOpName:\"BroadcastArgs\",category:\"transformation\",inputs:[{start:0,name:\"s0\",type:\"tensor\"},{start:1,name:\"s1\",type:\"tensor\"}],attrs:[]}];var Uc=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[ES,$S,RS,DS,AS,FS,PS,OS,MS,LS,BS,zS,VS,WS,US,GS,HS,KS,qS],t=[].concat(...e.map(o=>o.json));this.opMappers=t.reduce((o,n)=>(o[n.tfOpName]=n,o),{})}transformGraph(e,t={}){let o=e.node,n=[],s=[],a=[],i=o.reduce((h,g)=>(h[g.name]=this.mapNode(g),g.op.startsWith(\"Placeholder\")?n.push(h[g.name]):g.op===\"Const\"?s.push(h[g.name]):(g.input==null||g.input.length===0)&&a.push(h[g.name]),h),{}),p=[],u=[],l={},c={};t!=null&&(l=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));let m=Object.keys(i);m.forEach(h=>{let g=i[h];g.inputNames.forEach((x,b)=>{let[w,,S]=qs(x),k=i[w];if(k.outputs!=null){let T=k.outputs.indexOf(S);if(T!==-1){let E=`${w}:${T}`;g.inputNames[b]=E}}g.inputs.push(k),k.children.push(g)})}),Object.keys(c).length===0?m.forEach(h=>{let g=i[h];g.children.length===0&&u.push(g)}):Object.keys(c).forEach(h=>{let[g]=qs(h),x=i[g];x!=null&&(x.signatureKey=c[h],u.push(x))}),Object.keys(l).length>0?Object.keys(l).forEach(h=>{let[g]=qs(h),x=i[g];x&&(x.signatureKey=l[h],p.push(x))}):p=n;let d={};e.library!=null&&e.library.function!=null&&(d=e.library.function.reduce((h,g)=>(h[g.signature.name]=this.mapFunction(g),h),{}));let f={nodes:i,inputs:p,outputs:u,weights:s,placeholders:n,signature:t,functions:d};return a.length>0&&(f.initNodes=a),f}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,o)=>(t[e[o].name]=o,t),{})}mapNode(e){let t=bf(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let o={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(n=>n.startsWith(\"^\")?n.slice(1):n),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return t.inputs!=null&&(o.inputParams=t.inputs.reduce((n,s)=>(n[s.name]={type:s.type,inputIndexStart:s.start,inputIndexEnd:s.end},n),{})),t.attrs!=null&&(o.attrParams=t.attrs.reduce((n,s)=>{let a=s.type,i;switch(s.type){case\"string\":i=wf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=wf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"string[]\":i=_f(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=_f(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"number\":i=If(e.attr,s.tfName,s.defaultValue||0),i===void 0&&s.tfDeprecatedName&&(i=If(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"number[]\":i=Tf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Tf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"bool\":i=Sf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Sf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"bool[]\":i=$f(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=$f(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"shape\":i=Nf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Nf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"shape[]\":i=Ef(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Ef(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"dtype\":i=vf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=vf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"dtype[]\":i=kf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=kf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"func\":i=p_(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=p_(e.attr,s.tfDeprecatedName,s.defaultValue));break;case\"tensor\":case\"tensors\":break;default:throw new Error(`Unsupported param type: ${s.type} for op: ${e.op}`)}return n[s.name]={value:i,type:a},n},{})),o}mapFunction(e){let t=e.nodeDef,o=[],n=[],s={};t!=null&&(s=t.reduce((c,m)=>(c[m.name]=this.mapNode(m),m.op===\"Const\"&&n.push(c[m.name]),c),{}));let a=[],i=[];e.signature.inputArg.forEach(c=>{let[m]=qs(c.name),d={name:m,op:\"Placeholder\",inputs:[],inputNames:[],category:\"graph\",inputParams:{},attrParams:{dtype:{value:jS(c.type),type:\"dtype\"}},children:[]};d.signatureKey=c.name,a.push(d),s[m]=d}),Object.keys(s).forEach(c=>{let m=s[c];m.inputNames.forEach((d,f)=>{let[h,,g]=qs(d),x=s[h];if(x.outputs!=null){let b=x.outputs.indexOf(g);if(b!==-1){let w=`${h}:${b}`;m.inputNames[f]=w}}m.inputs.push(x),x.children.push(m)})});let u=e.ret;e.signature.outputArg.forEach(c=>{let[m,d]=qs(u[c.name]),f=s[m];f!=null&&(f.defaultOutput=d,i.push(f))});let l=this.mapArgsToSignature(e);return{nodes:s,inputs:a,outputs:i,weights:n,placeholders:o,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,o)=>(t[o.name]=this.mapArgToTensorInfo(o),t),{}),outputs:e.signature.outputArg.reduce((t,o)=>(t[o.name]=this.mapArgToTensorInfo(o,e.ret),t),{})}}mapArgToTensorInfo(e,t){let o=e.name;return t!=null&&(o=t[o]),{name:o,dtype:e.type}}};function NY(r){let e=A().global;if(typeof e.atob!=\"undefined\")return e.atob(r);if(typeof Buffer!=\"undefined\")return new Buffer(r,\"base64\").toString();throw new Error(\"Unable to decode base64 in this environment. Missing built-in atob() or Buffer()\")}function l_(r,e){let t=Array.isArray(r)?String.fromCharCode.apply(null,r):NY(r);return e?t:t.toLowerCase()}function wf(r,e,t,o=!1){let n=r[e];return n!=null?l_(n.s,o):t}function Sf(r,e,t){let o=r[e];return o?o.b:t}function If(r,e,t){let o=r[e]||{},n=o.i!=null?o.i:o.f!=null?o.f:t;return typeof n==\"number\"?n:parseInt(n,10)}function jS(r){switch(typeof r==\"string\"&&(r=Or[r]),r){case Or.DT_FLOAT:case Or.DT_HALF:return\"float32\";case Or.DT_INT32:case Or.DT_INT64:case Or.DT_INT8:case Or.DT_UINT8:return\"int32\";case Or.DT_BOOL:return\"bool\";case Or.DT_DOUBLE:return\"float32\";case Or.DT_STRING:return\"string\";case Or.DT_COMPLEX64:case Or.DT_COMPLEX128:return\"complex64\";default:return null}}function p_(r,e,t){let o=r[e];return o&&o.func?o.func.name:t}function vf(r,e,t){let o=r[e];return o&&o.type?jS(o.type):t}function kf(r,e,t){let o=r[e];return o&&o.list&&o.list.type?o.list.type.map(n=>jS(n)):t}function c_(r){if(!r.unknownRank)return r.dim!=null?r.dim.map(e=>typeof e.size==\"number\"?e.size:parseInt(e.size,10)):[]}function Nf(r,e,t){let o=r[e];return o&&o.shape?c_(o.shape):t}function Tf(r,e,t){let o=r[e];return o?((o.list.f&&o.list.f.length?o.list.f:o.list.i)||[]).map(n=>typeof n==\"number\"?n:parseInt(n,10)):t}function _f(r,e,t,o=!1){let n=r[e];return n&&n.list&&n.list.s?n.list.s.map(s=>l_(s,o)):t}function Ef(r,e,t){let o=r[e];return o&&o.list&&o.list.shape?o.list.shape.map(n=>c_(n)):t}function $f(r,e,t){let o=r[e];return o&&o.list&&o.list.b?o.list.b:t}var Rf=class{constructor(e,t,o){this.node=e,this.tensorMap=t,this.context=o,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(n=>this.getInput(n)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((n,s)=>(n[s]=this.getAttr(s),n),{}))}getInput(e){return Vt(e,this.tensorMap,this.context)}getAttr(e,t){let o=this.node.rawAttrs[e];if(o.tensor!=null)return Vt(e,this.tensorMap,this.context);if(o.i!=null||o.f!=null)return If(this.node.rawAttrs,e,t);if(o.s!=null)return wf(this.node.rawAttrs,e,t);if(o.b!=null)return Sf(this.node.rawAttrs,e,t);if(o.shape!=null)return Nf(this.node.rawAttrs,e,t);if(o.type!=null)return vf(this.node.rawAttrs,e,t);if(o.list!=null){if(o.list.i!=null||o.list.f!=null)return Tf(this.node.rawAttrs,e,t);if(o.list.s!=null)return _f(this.node.rawAttrs,e,t);if(o.list.shape!=null)return Ef(this.node.rawAttrs,e,t);if(o.list.b!=null)return $f(this.node.rawAttrs,e,t);if(o.list.type!=null)return kf(this.node.rawAttrs,e,t)}return t}};var et={};qe(et,{OP_SCOPE_SUFFIX:()=>Bw,abs:()=>er,acos:()=>g1,acosh:()=>x1,add:()=>Ce,addN:()=>y1,all:()=>b1,any:()=>C1,argMax:()=>w1,argMin:()=>S1,asin:()=>I1,asinh:()=>v1,atan:()=>k1,atan2:()=>N1,atanh:()=>T1,avgPool:()=>Id,avgPool3d:()=>$1,basicLSTMCell:()=>R1,batchNorm:()=>mu,batchNorm2d:()=>A1,batchNorm3d:()=>F1,batchNorm4d:()=>P1,batchToSpaceND:()=>vd,bincount:()=>kd,bitwiseAnd:()=>O1,booleanMaskAsync:()=>oX,broadcastArgs:()=>M1,broadcastTo:()=>Oa,buffer:()=>ie,cast:()=>Ue,ceil:()=>L1,clipByValue:()=>B1,clone:()=>Xr,complex:()=>Ar,concat:()=>bt,concat1d:()=>z1,concat2d:()=>V1,concat3d:()=>W1,concat4d:()=>U1,conv1d:()=>G1,conv2d:()=>du,conv2dTranspose:()=>H1,conv3d:()=>K1,conv3dTranspose:()=>j1,cos:()=>X1,cosh:()=>Y1,cosineWindow:()=>Mc,cumprod:()=>Q1,cumsum:()=>Z1,denseBincount:()=>J1,depthToSpace:()=>e2,depthwiseConv2d:()=>cl,diag:()=>t2,dilation2d:()=>r2,div:()=>Xe,divNoNan:()=>n2,dot:()=>s2,dropout:()=>hX,einsum:()=>fu,elu:()=>Ed,enclosingPowerOfTwo:()=>cS,ensureShape:()=>a2,equal:()=>_d,erf:()=>i2,euclideanNorm:()=>l2,exp:()=>Jo,expandDims:()=>Ks,expm1:()=>c2,eye:()=>$d,fft:()=>fl,fill:()=>Ma,floor:()=>Rd,floorDiv:()=>Sd,fused:()=>mS,gather:()=>Dd,gatherND:()=>dX,greater:()=>ju,greaterEqual:()=>Ad,ifft:()=>ep,imag:()=>gu,image:()=>b5,inTopKAsync:()=>xX,irfft:()=>tf,isFinite:()=>m2,isInf:()=>d2,isNaN:()=>f2,leakyRelu:()=>Fd,less:()=>Fc,lessEqual:()=>ml,linalg:()=>C5,linspace:()=>h2,localResponseNormalization:()=>g2,log:()=>yi,log1p:()=>Pd,logSigmoid:()=>x2,logSoftmax:()=>y2,logSumExp:()=>Ld,logicalAnd:()=>Xu,logicalNot:()=>Bd,logicalOr:()=>zd,logicalXor:()=>b2,losses:()=>w5,lowerBound:()=>C2,matMul:()=>Je,max:()=>La,maxPool:()=>Wd,maxPool3d:()=>w2,maxPoolWithArgmax:()=>S2,maximum:()=>Ud,mean:()=>Yu,meshgrid:()=>I2,min:()=>Ac,minimum:()=>Qu,mirrorPad:()=>v2,mod:()=>k2,moments:()=>N2,movingAverage:()=>aX,mul:()=>se,multiRNNCell:()=>T2,multinomial:()=>_2,neg:()=>mr,norm:()=>qu,notEqual:()=>Gd,oneHot:()=>Oc,ones:()=>Ba,onesLike:()=>E2,op:()=>N,outerProduct:()=>$2,pad:()=>za,pad1d:()=>R2,pad2d:()=>D2,pad3d:()=>A2,pad4d:()=>F2,pool:()=>P2,pow:()=>xi,prelu:()=>Kd,print:()=>wd,prod:()=>O2,raggedGather:()=>M2,raggedRange:()=>L2,raggedTensorToTensor:()=>B2,rand:()=>z2,randomGamma:()=>iN,randomNormal:()=>Zd,randomStandardNormal:()=>uN,randomUniform:()=>dl,randomUniformInt:()=>pN,range:()=>xu,real:()=>bi,reciprocal:()=>lN,relu:()=>yu,relu6:()=>Jd,reshape:()=>W,reverse:()=>Bo,reverse1d:()=>cN,reverse2d:()=>mN,reverse3d:()=>dN,reverse4d:()=>fN,rfft:()=>hl,round:()=>ef,rsqrt:()=>hN,scalar:()=>ke,scatterND:()=>uX,searchSorted:()=>Pc,selu:()=>gN,separableConv2d:()=>xN,setdiff1dAsync:()=>yN,sigmoid:()=>Pa,sign:()=>bN,signal:()=>y5,sin:()=>CN,sinh:()=>wN,slice:()=>Ye,slice1d:()=>SN,slice2d:()=>IN,slice3d:()=>vN,slice4d:()=>kN,softmax:()=>NN,softplus:()=>Md,spaceToBatchND:()=>Hd,sparse:()=>S5,sparseToDense:()=>cX,spectral:()=>x5,split:()=>Ci,sqrt:()=>Pr,square:()=>tr,squaredDifference:()=>rf,squeeze:()=>gl,stack:()=>Tr,step:()=>of,stridedSlice:()=>TN,string:()=>I5,sub:()=>Te,sum:()=>ot,tan:()=>_N,tanh:()=>Dc,tensor:()=>pr,tensor1d:()=>rr,tensor2d:()=>bu,tensor3d:()=>nf,tensor4d:()=>EN,tensor5d:()=>$N,tensor6d:()=>RN,tensorScatterUpdate:()=>AN,tile:()=>hu,topk:()=>FN,transpose:()=>yl,truncatedNormal:()=>PN,unique:()=>ON,unsortedSegmentSum:()=>MN,unstack:()=>zo,upperBound:()=>LN,variable:()=>BN,where:()=>Lo,whereAsync:()=>af,zeros:()=>Yr,zerosLike:()=>Kt});var m_=(r,e,t,o=et)=>{switch(r.op){case\"BiasAdd\":case\"AddV2\":case\"Add\":return[o.add(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"AddN\":return[o.addN(I(\"tensors\",r,e,t))];case\"FloorMod\":case\"Mod\":return[o.mod(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Mul\":return[o.mul(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"RealDiv\":case\"Div\":return[o.div(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"DivNoNan\":return[o.divNoNan(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"FloorDiv\":return[o.floorDiv(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Sub\":return[o.sub(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Minimum\":return[o.minimum(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Maximum\":return[o.maximum(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Pow\":return[o.pow(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"SquaredDifference\":return[o.squaredDifference(I(\"a\",r,e,t),I(\"b\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var d_=(r,e,t,o=et)=>{switch(r.op){case\"Abs\":case\"ComplexAbs\":return[o.abs(I(\"x\",r,e,t))];case\"Acos\":return[o.acos(I(\"x\",r,e,t))];case\"Acosh\":return[o.acosh(I(\"x\",r,e,t))];case\"Asin\":return[o.asin(I(\"x\",r,e,t))];case\"Asinh\":return[o.asinh(I(\"x\",r,e,t))];case\"Atan\":return[o.atan(I(\"x\",r,e,t))];case\"Atan2\":return[o.atan2(I(\"x\",r,e,t),I(\"y\",r,e,t))];case\"Atanh\":return[o.atanh(I(\"x\",r,e,t))];case\"Ceil\":return[o.ceil(I(\"x\",r,e,t))];case\"Complex\":return[o.complex(I(\"real\",r,e,t),I(\"imag\",r,e,t))];case\"Cos\":return[o.cos(I(\"x\",r,e,t))];case\"Cosh\":return[o.cosh(I(\"x\",r,e,t))];case\"Elu\":return[o.elu(I(\"x\",r,e,t))];case\"Erf\":return[o.erf(I(\"x\",r,e,t))];case\"Exp\":return[o.exp(I(\"x\",r,e,t))];case\"Expm1\":return[o.expm1(I(\"x\",r,e,t))];case\"Floor\":return[o.floor(I(\"x\",r,e,t))];case\"Log\":return[o.log(I(\"x\",r,e,t))];case\"Log1p\":return[o.log1p(I(\"x\",r,e,t))];case\"Imag\":return[o.imag(I(\"x\",r,e,t))];case\"Neg\":return[o.neg(I(\"x\",r,e,t))];case\"Reciprocal\":return[o.reciprocal(I(\"x\",r,e,t))];case\"Real\":return[o.real(I(\"x\",r,e,t))];case\"Relu\":return[o.relu(I(\"x\",r,e,t))];case\"Round\":return[o.round(I(\"x\",r,e,t))];case\"Selu\":return[o.selu(I(\"x\",r,e,t))];case\"Sigmoid\":return[o.sigmoid(I(\"x\",r,e,t))];case\"Sin\":return[o.sin(I(\"x\",r,e,t))];case\"Sign\":return[o.sign(I(\"x\",r,e,t))];case\"Sinh\":return[o.sinh(I(\"x\",r,e,t))];case\"Softplus\":return[o.softplus(I(\"x\",r,e,t))];case\"Sqrt\":return[o.sqrt(I(\"x\",r,e,t))];case\"Square\":return[o.square(I(\"x\",r,e,t))];case\"Tanh\":return[o.tanh(I(\"x\",r,e,t))];case\"Tan\":return[o.tan(I(\"x\",r,e,t))];case\"ClipByValue\":return[o.clipByValue(I(\"x\",r,e,t),I(\"clipValueMin\",r,e,t),I(\"clipValueMax\",r,e,t))];case\"Relu6\":return[o.relu6(I(\"x\",r,e,t))];case\"Rsqrt\":return[o.rsqrt(Vt(r.inputNames[0],e,t))];case\"LeakyRelu\":return[o.leakyRelu(I(\"x\",r,e,t),I(\"alpha\",r,e,t))];case\"Prelu\":return[o.prelu(I(\"x\",r,e,t),I(\"alpha\",r,e,t))];case\"IsNan\":return[o.isNaN(Vt(r.inputNames[0],e,t))];case\"IsInf\":return[o.isInf(Vt(r.inputNames[0],e,t))];case\"IsFinite\":return[o.isFinite(Vt(r.inputNames[0],e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function Qr(r,e,t=\"\"){if(!(typeof r==\"number\"||typeof e==\"number\")){y.assert(r.length===e.length,()=>t+` Shapes ${r} and ${e} must match`);for(let o=0;ot+` Shapes ${r} and ${e} must match`)}}}function f_(r){return!(typeof r==\"number\"||r.some(e=>e<0))}function Cl(r,e,t){let o=Df(r,t),n=!f_(o);if(n&&e.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${o}`);if(n&&e.forEach(s=>{o=Df(s.shape,o)}),!f_(o))throw new Error(`Non-fully-defined elementShape: ${o}`);return o}function Df(r,e){if(typeof r==\"number\")return e;if(typeof e==\"number\")return r;if(r.length!==e.length)throw new Error(`Incompatible ranks during merge: ${r} vs. ${e}`);let t=[];for(let o=0;o=0&&s>=0&&n!==s)throw new Error(`Incompatible shape during merge: ${r} vs. ${e}`);t[o]=n>=0?n:s}return t}var Af=class{constructor(e,t,o,n,s,a,i){this.name=e,this.dtype=t,this.maxSize=o,this.elementShape=n,this.identicalElementShapes=s,this.dynamicSize=a,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Fr(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 o=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e},\n 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),Qr(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),o.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(o.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);o.tensor=t,Fr(t),o.written=!0,this.tensors[e]=o}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((o,n)=>this.write(o,t[n]))}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 n=0;n=this.maxSize)throw new Error(`Max index must be < array size (${o} vs. ${this.maxSize})`);this.writeMany(e,zo(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 o=0,n=e.map(p=>(o+=p,o));if(o!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${o}, 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 s=o===0?0:t.size/o,a=[];De(()=>{t=W(t,[1,o,s]);for(let p=0;p{if(o!==s.dtype)throw new Error(`Invalid data types; op elements ${o}, but list elements ${s.dtype}`);Qr(t,s.shape,\"TensorList shape mismatch: \"),Fr(s)}),this.idTensor=ke(0),this.maxNumElements=n,Fr(this.idTensor)}copy(){return new r([...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,o=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(o!==-1&&this.tensors.length!==o)throw new Error(`Operation expected a list with ${o} elements but got a list with ${this.tensors.length} elements.`);Qr(e,this.elementShape,\"TensorList shape mismatch: \");let n=Cl(this.elementShape,this.tensors,e);return De(()=>{let s=this.tensors.map(a=>W(a,n));return Tr(s,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 o=Cl(this.elementShape,this.tensors,e),n=this.tensors.pop();return n.kept=!1,Qr(n.shape,e,\"TensorList shape mismatch: \"),W(n,o)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Qr(e.shape,this.elementShape,\"TensorList shape mismatch: \"),this.maxNumElements===this.size())throw new Error(\"Trying to push element into a full list.\");Fr(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}.`);let t=new r([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let o=0;othis.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.`);Qr(this.tensors[e].shape,t,\"TensorList shape mismatch: \");let n=Cl(this.elementShape,this.tensors,t);return W(this.tensors[e],n)}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.`);Qr(this.elementShape,t.shape,\"TensorList shape mismatch: \"),Fr(t),this.tensors[e]!=null&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,o){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);Qr(this.elementShape,o,\"TensorList shape mismatch: \"),e=e.slice(0,this.size());let n=Cl(this.elementShape,this.tensors,o);return e.length===0?pr([],[0].concat(n)):De(()=>{let s=e.map(a=>W(this.tensors[a],n));return Tr(s,0)})}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Qr(this.elementShape,t,\"TensorList shape mismatch: \");let o=Cl(this.elementShape,this.tensors,t);return this.size()===0?pr([],[0].concat(o)):De(()=>{let n=this.tensors.map(s=>W(s,o));return bt(n,0)})}};function h_(r,e,t){let o=r.dtype;if(r.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${r.shape}`);if(r.dtype!==t)throw new Error(`Invalid data types; op elements ${r.dtype}, but list elements ${t}`);let n=r.shape.slice(1);Qr(n,e,\"TensorList shape mismatch: \");let s=zo(r);return new wl(s,e,o)}function g_(r,e,t,o){return new wl([],r,e,o)}function x_(r,e,t,o){if(e.length!==r.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${r.shape[0]}`);let n=Math.max(...e);if(o!=null&&o!==-1&&n>=o)throw new Error(`Max index must be < array size (${n} vs. ${o})`);let s=new wl([],t,r.dtype,o),a=zo(r,0);return e.forEach((i,p)=>{s.setItem(i,a[p])}),s}function y_(r,e,t){let o=0,n=e.map(l=>(o+=l,o));if(o!==r.shape[0])throw new Error(`Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n ${o}, and tensor's shape is: ${r.shape}`);let s=r.shape.slice(1),a=Df(s,t),i=o===0?0:r.size/o,p=De(()=>{let l=[];r=W(r,[1,o,i]);for(let c=0;c{switch(r.op){case\"If\":case\"StatelessIf\":{let o=I(\"thenBranch\",r,e,t),n=I(\"elseBranch\",r,e,t),s=I(\"cond\",r,e,t),a=I(\"args\",r,e,t);return(await s.data())[0]?t.functionMap[o].executeFunctionAsync(a,t.tensorArrayMap,t.tensorListMap):t.functionMap[n].executeFunctionAsync(a,t.tensorArrayMap,t.tensorListMap)}case\"While\":case\"StatelessWhile\":{let o=I(\"body\",r,e,t),n=I(\"cond\",r,e,t),s=I(\"args\",r,e,t),a=await t.functionMap[n].executeFunctionAsync(s,t.tensorArrayMap,t.tensorListMap),i=s.map(l=>l.id),p=await a[0].data();a.forEach(l=>{!l.kept&&i.indexOf(l.id)===-1&&l.dispose()});let u=s;for(;p[0];){let l=u;u=await t.functionMap[o].executeFunctionAsync(u,t.tensorArrayMap,t.tensorListMap);let c=u.map(d=>d.id);l.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&c.indexOf(d.id)===-1&&d.dispose()});let m=await t.functionMap[n].executeFunctionAsync(u,t.tensorArrayMap,t.tensorListMap);p=await m[0].data(),m.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&c.indexOf(d.id)===-1&&d.dispose()})}return u}case\"LoopCond\":{let o=I(\"pred\",r,e,t);return[js(o)]}case\"Switch\":{let o=I(\"pred\",r,e,t),n=I(\"data\",r,e,t);return n.kept||(n=js(n)),(await o.data())[0]?[void 0,n]:[n,void 0]}case\"Merge\":{let o=r.inputNames.find(n=>Vt(n,e,t)!==void 0);if(o){let n=Vt(o,e,t);return[js(n)]}return}case\"Enter\":{let o=I(\"frameName\",r,e,t),n=I(\"tensor\",r,e,t);return t.enterFrame(o),[js(n)]}case\"Exit\":{let o=I(\"tensor\",r,e,t);return t.exitFrame(),[js(o)]}case\"NextIteration\":{let o=I(\"tensor\",r,e,t);return t.nextIteration(),[js(o)]}case\"TensorArrayV3\":{let o=I(\"size\",r,e,t),n=I(\"dtype\",r,e,t),s=I(\"elementShape\",r,e,t),a=I(\"dynamicSize\",r,e,t),i=I(\"clearAfterRead\",r,e,t),p=I(\"identicalElementShapes\",r,e,t),u=I(\"name\",r,e,t),l=new Af(u,n,o,s,p,a,i);return t.addTensorArray(l),[l.idTensor,ke(1)]}case\"TensorArrayWriteV3\":{let o=I(\"tensorArrayId\",r,e,t),n=I(\"index\",r,e,t),s=I(\"tensor\",r,e,t),a=t.getTensorArray(o.id);return a.write(n,s),[a.idTensor]}case\"TensorArrayReadV3\":{let o=I(\"tensorArrayId\",r,e,t),n=I(\"index\",r,e,t);return[t.getTensorArray(o.id).read(n)]}case\"TensorArrayGatherV3\":{let o=I(\"tensorArrayId\",r,e,t),n=I(\"indices\",r,e,t),s=I(\"dtype\",r,e,t);return[t.getTensorArray(o.id).gather(n,s)]}case\"TensorArrayScatterV3\":{let o=I(\"tensorArrayId\",r,e,t),n=I(\"indices\",r,e,t),s=I(\"tensor\",r,e,t),a=t.getTensorArray(o.id);return a.scatter(n,s),[a.idTensor]}case\"TensorArrayConcatV3\":{let o=I(\"tensorArrayId\",r,e,t),n=t.getTensorArray(o.id),s=I(\"dtype\",r,e,t);return[n.concat(s)]}case\"TensorArraySplitV3\":{let o=I(\"tensorArrayId\",r,e,t),n=I(\"tensor\",r,e,t),s=I(\"lengths\",r,e,t),a=t.getTensorArray(o.id);return a.split(s,n),[a.idTensor]}case\"TensorArraySizeV3\":{let o=I(\"tensorArrayId\",r,e,t),n=t.getTensorArray(o.id);return[ke(n.size(),\"int32\")]}case\"TensorArrayCloseV3\":{let o=I(\"tensorArrayId\",r,e,t),n=t.getTensorArray(o.id);return n.clearAndClose(),[n.idTensor]}case\"TensorListSetItem\":{let o=I(\"tensorListId\",r,e,t),n=I(\"index\",r,e,t),s=I(\"tensor\",r,e,t),a=t.getTensorList(o.id);return a.setItem(n,s),[a.idTensor]}case\"TensorListGetItem\":{let o=I(\"tensorListId\",r,e,t),n=I(\"index\",r,e,t),s=I(\"elementShape\",r,e,t),a=I(\"elementDType\",r,e,t);return[t.getTensorList(o.id).getItem(n,s,a)]}case\"TensorListScatterV2\":case\"TensorListScatter\":{let o=I(\"indices\",r,e,t),n=I(\"tensor\",r,e,t),s=I(\"elementShape\",r,e,t),a=I(\"numElements\",r,e,t),i=x_(n,o,s,a);return t.addTensorList(i),[i.idTensor]}case\"TensorListReserve\":case\"EmptyTensorList\":{let o=I(\"elementShape\",r,e,t),n=I(\"elementDType\",r,e,t),s;r.op===\"TensorListReserve\"?s=\"numElements\":s=\"maxNumElements\";let a=I(s,r,e,t),i=r.op===\"TensorListReserve\"?-1:a,p=g_(o,n,a,i);return t.addTensorList(p),[p.idTensor]}case\"TensorListGather\":{let o=I(\"tensorListId\",r,e,t),n=I(\"indices\",r,e,t),s=I(\"elementShape\",r,e,t),a=I(\"elementDType\",r,e,t);return[t.getTensorList(o.id).gather(n,a,s)]}case\"TensorListStack\":{let o=I(\"tensorListId\",r,e,t),n=I(\"elementShape\",r,e,t),s=I(\"elementDType\",r,e,t),a=I(\"numElements\",r,e,t);return[t.getTensorList(o.id).stack(n,s,a)]}case\"TensorListFromTensor\":{let o=I(\"tensor\",r,e,t),n=I(\"elementShape\",r,e,t),s=I(\"elementDType\",r,e,t),a=h_(o,n,s);return t.addTensorList(a),[a.idTensor]}case\"TensorListConcat\":case\"TensorListConcatV2\":{let o=I(\"tensorListId\",r,e,t),n=t.getTensorList(o.id),s=I(\"dtype\",r,e,t),a=I(\"elementShape\",r,e,t);return[n.concat(s,a)]}case\"TensorListPushBack\":{let o=I(\"tensorListId\",r,e,t),n=I(\"tensor\",r,e,t),s=t.getTensorList(o.id);return s.pushBack(n),[s.idTensor]}case\"TensorListPopBack\":{let o=I(\"tensorListId\",r,e,t),n=I(\"elementShape\",r,e,t),s=I(\"elementDType\",r,e,t);return[t.getTensorList(o.id).popBack(n,s)]}case\"TensorListSplit\":{let o=I(\"tensor\",r,e,t),n=I(\"elementShape\",r,e,t),s=I(\"lengths\",r,e,t),a=y_(o,s,n);return t.addTensorList(a),[a.idTensor]}case\"TensorListLength\":{let o=I(\"tensorListId\",r,e,t),n=t.getTensorList(o.id);return[ke(n.size(),\"int32\")]}case\"TensorListResize\":{let o=I(\"tensorListId\",r,e,t),n=I(\"size\",r,e,t),a=t.getTensorList(o.id).resize(n);return t.addTensorList(a),[a.idTensor]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};function C_(r,e,t){let[o,n]=I(\"fusedOps\",r,e,t),s=o===\"biasadd\",a=!s,i=n===\"prelu\",p=o===\"fusedbatchnorm\",u=I(\"numArgs\",r,e,t);if(s){if(i&&u!==2)throw new Error(\"FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.\");if(!i&&s&&u!==1)throw new Error(\"FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.\")}if(p)throw new Error(\"FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported\");let l=I(\"strides\",r,e,t),c=Wc(r,e,t),m=I(\"dataFormat\",r,e,t).toUpperCase(),d=I(\"dilations\",r,e,t),[f,h]=I(\"args\",r,e,t);a&&(h=f,f=void 0);let g=I(\"leakyreluAlpha\",r,e,t);return{stride:l,pad:c,dataFormat:m,dilations:d,biasArg:f,preluArg:h,activationFunc:n,leakyreluAlpha:g}}var w_=(r,e,t,o=et)=>{switch(r.op){case\"Conv1D\":{let n=I(\"stride\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"dataFormat\",r,e,t).toUpperCase(),i=I(\"dilation\",r,e,t);return[o.conv1d(I(\"x\",r,e,t),I(\"filter\",r,e,t),n,s,a,i)]}case\"Conv2D\":{let n=I(\"strides\",r,e,t),s=Wc(r,e,t),a=I(\"dataFormat\",r,e,t).toUpperCase(),i=I(\"dilations\",r,e,t);return[o.conv2d(I(\"x\",r,e,t),I(\"filter\",r,e,t),[n[1],n[2]],s,a,[i[1],i[2]])]}case\"_FusedConv2D\":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:l,leakyreluAlpha:c}=C_(r,e,t);return[o.fused.conv2d({x:I(\"x\",r,e,t),filter:I(\"filter\",r,e,t),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:l,preluActivationWeights:u,leakyreluAlpha:c})]}case\"FusedDepthwiseConv2dNative\":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:l,leakyreluAlpha:c}=C_(r,e,t);return[o.fused.depthwiseConv2d({x:I(\"x\",r,e,t),filter:I(\"filter\",r,e,t),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:l,preluActivationWeights:u,leakyreluAlpha:c})]}case\"Conv2DBackpropInput\":case\"Conv2dTranspose\":{let n=I(\"outputShape\",r,e,t),s=I(\"strides\",r,e,t),a=Wc(r,e,t);return[o.conv2dTranspose(I(\"x\",r,e,t),I(\"filter\",r,e,t),n,[s[1],s[2]],a)]}case\"DepthwiseConv2dNative\":case\"DepthwiseConv2d\":{let n=I(\"strides\",r,e,t),s=Wc(r,e,t),a=I(\"dilations\",r,e,t),i=I(\"dataFormat\",r,e,t).toUpperCase();return[o.depthwiseConv2d(I(\"input\",r,e,t),I(\"filter\",r,e,t),[n[1],n[2]],s,i,[a[1],a[2]])]}case\"Conv3D\":{let n=I(\"strides\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"dataFormat\",r,e,t).toUpperCase(),i=I(\"dilations\",r,e,t);return[o.conv3d(I(\"x\",r,e,t),I(\"filter\",r,e,t),[n[1],n[2],n[3]],s,a,[i[1],i[2],i[3]])]}case\"AvgPool\":{let n=I(\"strides\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"kernelSize\",r,e,t);return[o.avgPool(I(\"x\",r,e,t),[a[1],a[2]],[n[1],n[2]],s)]}case\"MaxPool\":{let n=I(\"strides\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"kernelSize\",r,e,t);return[o.maxPool(I(\"x\",r,e,t),[a[1],a[2]],[n[1],n[2]],s)]}case\"MaxPoolWithArgmax\":{let n=I(\"strides\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"kernelSize\",r,e,t),i=I(\"includeBatchInIndex\",r,e,t),{result:p,indexes:u}=o.maxPoolWithArgmax(I(\"x\",r,e,t),[a[1],a[2]],[n[1],n[2]],s,i);return[p,u]}case\"AvgPool3D\":{let n=I(\"strides\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"kernelSize\",r,e,t);return[o.avgPool3d(I(\"x\",r,e,t),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case\"MaxPool3D\":{let n=I(\"strides\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"kernelSize\",r,e,t);return[o.maxPool3d(I(\"x\",r,e,t),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case\"Dilation2D\":{let n=I(\"strides\",r,e,t),s=I(\"pad\",r,e,t),a=I(\"dilations\",r,e,t),i=n[1],p=n[2],u=a[1],l=a[2];return[o.dilation2d(I(\"x\",r,e,t),I(\"filter\",r,e,t),[i,p],s,[u,l],\"NHWC\")]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var S_=(r,e,t,o=et)=>{switch(r.op){case\"Fill\":{let n=I(\"shape\",r,e,t),s=I(\"dtype\",r,e,t),a=I(\"value\",r,e,t);return[o.fill(n,a,s)]}case\"LinSpace\":{let n=I(\"start\",r,e,t),s=I(\"stop\",r,e,t),a=I(\"num\",r,e,t);return[o.linspace(n,s,a)]}case\"Multinomial\":{let n=I(\"logits\",r,e,t),s=I(\"numSamples\",r,e,t),a=I(\"seed\",r,e,t);return[o.multinomial(n,s,a)]}case\"OneHot\":{let n=I(\"indices\",r,e,t),s=I(\"depth\",r,e,t),a=I(\"onValue\",r,e,t),i=I(\"offValue\",r,e,t),p=I(\"dtype\",r,e,t);return[o.oneHot(n,s,a,i,p)]}case\"Ones\":return[o.ones(I(\"shape\",r,e,t),I(\"dtype\",r,e,t))];case\"OnesLike\":return[o.onesLike(I(\"x\",r,e,t))];case\"RandomStandardNormal\":return[o.randomStandardNormal(I(\"shape\",r,e,t),I(\"dtype\",r,e,t),I(\"seed\",r,e,t))];case\"RandomUniform\":return[o.randomUniform(I(\"shape\",r,e,t),I(\"minval\",r,e,t),I(\"maxval\",r,e,t),I(\"dtype\",r,e,t))];case\"RandomUniformInt\":return[o.randomUniformInt(I(\"shape\",r,e,t),I(\"minval\",r,e,t),I(\"maxval\",r,e,t),I(\"seed\",r,e,t))];case\"Range\":{let n=I(\"start\",r,e,t),s=I(\"stop\",r,e,t),a=I(\"step\",r,e,t);return[o.range(n,s,a,I(\"dtype\",r,e,t))]}case\"TruncatedNormal\":{let n=I(\"shape\",r,e,t),s=I(\"mean\",r,e,t),a=I(\"stdDev\",r,e,t),i=I(\"seed\",r,e,t);return[o.truncatedNormal(n,s,a,I(\"dtype\",r,e,t),i)]}case\"Zeros\":return[o.zeros(I(\"shape\",r,e,t),I(\"dtype\",r,e,t))];case\"ZerosLike\":return[o.zerosLike(I(\"x\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function XS(r,e,t){let o=I(\"boxes\",r,e,t),n=I(\"scores\",r,e,t),s=I(\"maxOutputSize\",r,e,t),a=I(\"iouThreshold\",r,e,t),i=I(\"scoreThreshold\",r,e,t),p=I(\"softNmsSigma\",r,e,t);return{boxes:o,scores:n,maxOutputSize:s,iouThreshold:a,scoreThreshold:i,softNmsSigma:p}}var I_=async(r,e,t,o,n=et)=>{switch(r.op){case\"NonMaxSuppressionV5\":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u,softNmsSigma:l}=XS(r,e,t),c=await n.image.nonMaxSuppressionWithScoreAsync(s,a,i,p,u,l);return[c.selectedIndices,c.selectedScores]}case\"NonMaxSuppressionV4\":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=XS(r,e,t),l=I(\"padToMaxOutputSize\",r,e,t),c=await n.image.nonMaxSuppressionPaddedAsync(s,a,i,p,u,l);return[c.selectedIndices,c.validOutputs]}case\"NonMaxSuppressionV3\":case\"NonMaxSuppressionV2\":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=XS(r,e,t);return[await n.image.nonMaxSuppressionAsync(s,a,i,p,u)]}case\"Where\":{let s=n.cast(I(\"condition\",r,e,t),\"bool\"),a=[await n.whereAsync(s)];return s.dispose(),a}case\"ListDiff\":return n.setdiff1dAsync(I(\"x\",r,e,t),I(\"y\",r,e,t));default:throw TypeError(`Node type ${r.op} is not implemented`)}};var v_=(r,e,t,o=et)=>{switch(r.op){case\"LowerBound\":{let n=I(\"sortedSequence\",r,e,t),s=I(\"values\",r,e,t);return[o.lowerBound(n,s)]}case\"TopKV2\":{let n=I(\"x\",r,e,t),s=I(\"k\",r,e,t),a=I(\"sorted\",r,e,t),i=o.topk(n,s,a);return[i.values,i.indices]}case\"UpperBound\":{let n=I(\"sortedSequence\",r,e,t),s=I(\"values\",r,e,t);return[o.upperBound(n,s)]}case\"Unique\":{let n=I(\"x\",r,e,t),s=o.unique(n);return[s.values,s.indices]}case\"UniqueV2\":{let n=I(\"x\",r,e,t),s=I(\"axis\",r,e,t),a=o.unique(n,s);return[a.values,a.indices]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var k_=(r,e,t,o=et)=>{switch(r.op){case\"Const\":return e[r.name];case\"PlaceholderWithDefault\":let n=I(\"default\",r,e,t);return[Vt(r.name,e,t)||n];case\"Placeholder\":return[Vt(r.name,e,t)];case\"Identity\":case\"StopGradient\":case\"FakeQuantWithMinMaxVars\":{let l=I(\"x\",r,e,t);return[js(l)]}case\"IdentityN\":return I(\"x\",r,e,t).map(l=>js(l));case\"Snapshot\":let s=I(\"x\",r,e,t);return[js(s)];case\"Shape\":return[o.tensor1d(I(\"x\",r,e,t).shape,\"int32\")];case\"ShapeN\":return I(\"x\",r,e,t).map(l=>o.tensor1d(l.shape));case\"Size\":return[o.scalar(I(\"x\",r,e,t).size,\"int32\")];case\"Rank\":return[o.scalar(I(\"x\",r,e,t).rank,\"int32\")];case\"NoOp\":return[o.scalar(1)];case\"Print\":let a=I(\"x\",r,e,t),i=I(\"data\",r,e,t),p=I(\"message\",r,e,t),u=I(\"summarize\",r,e,t);console.warn(\"The graph has a tf.print() operation,usually used for debugging, which slows down performance.\"),console.log(p);for(let l=0;le.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 o=await e.data();return this.tensorMap.forEach(n=>n.dispose()),this.tensorMap.clear(),De(()=>{let n=zo(t),s=o.length,a=n.length;y.assert(s===a,()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${a} elements.`);for(let i=0;i{let n=[];for(let s=0;s{switch(r.op){case\"HashTable\":case\"HashTableV2\":{let n=o.getHashTableHandleByName(r.name);if(n!=null)return[n];{let s=I(\"keyDType\",r,e,t),a=I(\"valueDType\",r,e,t),i=new Ff(s,a);return o.addHashTable(r.name,i),[i.handle]}}case\"InitializeTable\":case\"InitializeTableV2\":case\"LookupTableImport\":case\"LookupTableImportV2\":{let n=I(\"tableHandle\",r,e,t,o),s=I(\"keys\",r,e,t),a=I(\"values\",r,e,t);return[await o.getHashTableById(n.id).import(s,a)]}case\"LookupTableFind\":case\"LookupTableFindV2\":{let n=I(\"tableHandle\",r,e,t,o),s=I(\"keys\",r,e,t),a=I(\"defaultValue\",r,e,t);return[await o.getHashTableById(n.id).find(s,a)]}case\"LookupTableSize\":case\"LookupTableSizeV2\":{let n=I(\"tableHandle\",r,e,t,o);return[o.getHashTableById(n.id).tensorSize()]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var T_=(r,e,t,o=et)=>{switch(r.op){case\"ResizeBilinear\":{let n=I(\"images\",r,e,t),s=I(\"size\",r,e,t),a=I(\"alignCorners\",r,e,t),i=I(\"halfPixelCenters\",r,e,t);return[o.image.resizeBilinear(n,[s[0],s[1]],a,i)]}case\"ResizeNearestNeighbor\":{let n=I(\"images\",r,e,t),s=I(\"size\",r,e,t),a=I(\"alignCorners\",r,e,t),i=I(\"halfPixelCenters\",r,e,t);return[o.image.resizeNearestNeighbor(n,[s[0],s[1]],a,i)]}case\"CropAndResize\":{let n=I(\"image\",r,e,t),s=I(\"boxes\",r,e,t),a=I(\"boxInd\",r,e,t),i=I(\"cropSize\",r,e,t),p=I(\"method\",r,e,t),u=I(\"extrapolationValue\",r,e,t);return[o.image.cropAndResize(n,s,a,i,p,u)]}case\"ImageProjectiveTransformV3\":{let n=I(\"images\",r,e,t),s=I(\"transforms\",r,e,t),a=I(\"outputShape\",r,e,t),i=I(\"fillValue\",r,e,t),p=I(\"interpolation\",r,e,t),u=I(\"fillMode\",r,e,t);return[o.image.transform(n,s,p.toLowerCase(),u.toLowerCase(),i,a)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var __=(r,e,t,o=et)=>{switch(r.op){case\"Equal\":return[o.equal(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"NotEqual\":return[o.notEqual(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Greater\":return[o.greater(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"GreaterEqual\":return[o.greaterEqual(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Less\":return[o.less(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"LessEqual\":return[o.lessEqual(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"LogicalAnd\":return[o.logicalAnd(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"LogicalNot\":return[o.logicalNot(I(\"a\",r,e,t))];case\"LogicalOr\":return[o.logicalOr(I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"Select\":case\"SelectV2\":return[o.where(I(\"condition\",r,e,t),I(\"a\",r,e,t),I(\"b\",r,e,t))];case\"BitwiseAnd\":return[o.bitwiseAnd(I(\"a\",r,e,t),I(\"b\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var E_=(r,e,t,o=et)=>{switch(r.op){case\"BatchMatMul\":case\"BatchMatMulV2\":case\"MatMul\":return[o.matMul(I(\"a\",r,e,t),I(\"b\",r,e,t),I(\"transposeA\",r,e,t),I(\"transposeB\",r,e,t))];case\"Einsum\":return[o.einsum(I(\"equation\",r,e,t),...I(\"tensors\",r,e,t))];case\"Transpose\":return[o.transpose(I(\"x\",r,e,t),I(\"perm\",r,e,t))];case\"_FusedMatMul\":let[n,s]=I(\"fusedOps\",r,e,t),a=n===\"biasadd\",i=s===\"prelu\",p=I(\"numArgs\",r,e,t),u=I(\"leakyreluAlpha\",r,e,t);if(a){if(i&&p!==2)throw new Error(\"Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.\");if(!i&&p!==1)throw new Error(\"Fused MatMul with BiasAdd must have one extra argument: bias.\")}let[l,c]=I(\"args\",r,e,t);return[o.fused.matMul({a:I(\"a\",r,e,t),b:I(\"b\",r,e,t),transposeA:I(\"transposeA\",r,e,t),transposeB:I(\"transposeB\",r,e,t),bias:l,activation:s,preluActivationWeights:c,leakyreluAlpha:u})];case\"MatrixBandPart\":return[o.linalg.bandPart(I(\"a\",r,e,t),I(\"numLower\",r,e,t),I(\"numUpper\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var $_=(r,e,t,o=et)=>{switch(r.op){case\"EuclideanNorm\":return[o.euclideanNorm(I(\"x\",r,e,t),I(\"axis\",r,e,t),I(\"keepDims\",r,e,t))];case\"FusedBatchNorm\":case\"FusedBatchNormV2\":return[o.batchNorm(I(\"x\",r,e,t),I(\"mean\",r,e,t),I(\"variance\",r,e,t),I(\"offset\",r,e,t),I(\"scale\",r,e,t),I(\"epsilon\",r,e,t))];case\"FusedBatchNormV3\":return[o.batchNorm(I(\"x\",r,e,t),I(\"mean\",r,e,t),I(\"variance\",r,e,t),I(\"offset\",r,e,t),I(\"scale\",r,e,t),I(\"epsilon\",r,e,t))];case\"LRN\":return[o.localResponseNormalization(I(\"x\",r,e,t),I(\"radius\",r,e,t),I(\"bias\",r,e,t),I(\"alpha\",r,e,t),I(\"beta\",r,e,t))];case\"Softmax\":return[o.softmax(I(\"x\",r,e,t))];case\"LogSoftmax\":return[o.logSoftmax(I(\"x\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var R_=(r,e,t,o=et)=>{switch(r.op){case\"RaggedGather\":{let{outputNestedSplits:n,outputDenseValues:s}=o.raggedGather(I(\"paramsNestedSplits\",r,e,t),I(\"paramsDenseValues\",r,e,t),I(\"indices\",r,e,t),I(\"outputRaggedRank\",r,e,t));return n.concat(s)}case\"RaggedRange\":{let{rtNestedSplits:n,rtDenseValues:s}=o.raggedRange(I(\"starts\",r,e,t),I(\"limits\",r,e,t),I(\"splits\",r,e,t));return[n,s]}case\"RaggedTensorToTensor\":return[o.raggedTensorToTensor(I(\"shape\",r,e,t),I(\"values\",r,e,t),I(\"defaultValue\",r,e,t),I(\"rowPartitionTensors\",r,e,t),I(\"rowPartitionTypes\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var D_=(r,e,t,o=et)=>{switch(r.op){case\"Max\":{let i=I(\"axis\",r,e,t),p=I(\"keepDims\",r,e,t);return[o.max(I(\"x\",r,e,t),i,p)]}case\"Mean\":{let i=I(\"axis\",r,e,t),p=I(\"keepDims\",r,e,t);return[o.mean(I(\"x\",r,e,t),i,p)]}case\"Min\":{let i=I(\"axis\",r,e,t),p=I(\"keepDims\",r,e,t);return[o.min(I(\"x\",r,e,t),i,p)]}case\"Sum\":{let i=I(\"axis\",r,e,t),p=I(\"keepDims\",r,e,t);return[o.sum(I(\"x\",r,e,t),i,p)]}case\"All\":{let i=I(\"axis\",r,e,t),p=I(\"keepDims\",r,e,t);return[o.all(I(\"x\",r,e,t),i,p)]}case\"Any\":{let i=I(\"axis\",r,e,t),p=I(\"keepDims\",r,e,t);return[o.any(I(\"x\",r,e,t),i,p)]}case\"ArgMax\":{let i=I(\"axis\",r,e,t);return[o.argMax(I(\"x\",r,e,t),i)]}case\"ArgMin\":{let i=I(\"axis\",r,e,t);return[o.argMin(I(\"x\",r,e,t),i)]}case\"Prod\":{let i=I(\"axis\",r,e,t),p=I(\"keepDims\",r,e,t);return[o.prod(I(\"x\",r,e,t),i,p)]}case\"Cumprod\":{let i=I(\"axis\",r,e,t),p=I(\"exclusive\",r,e,t),u=I(\"reverse\",r,e,t);return[o.cumprod(I(\"x\",r,e,t),i,p,u)]}case\"Cumsum\":{let i=I(\"axis\",r,e,t),p=I(\"exclusive\",r,e,t),u=I(\"reverse\",r,e,t);return[o.cumsum(I(\"x\",r,e,t),i,p,u)]}case\"Bincount\":let n=I(\"x\",r,e,t),s=I(\"weights\",r,e,t),a=I(\"size\",r,e,t);return[o.bincount(n,s,a)];case\"DenseBincount\":{let i=I(\"x\",r,e,t),p=I(\"weights\",r,e,t),u=I(\"size\",r,e,t),l=I(\"binaryOutput\",r,e,t);return[o.denseBincount(i,p,u,l)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var A_=(r,e,t,o=et)=>{switch(r.op){case\"ConcatV2\":case\"Concat\":{let n=I(\"n\",r,e,t),s=I(\"axis\",r,e,t),a=I(\"tensors\",r,e,t);return a=a.slice(0,n),[o.concat(a,s)]}case\"Gather\":{let n=I(\"x\",r,e,t),s=I(\"indices\",r,e,t);return[o.gather(n,o.cast(s,\"int32\"),0)]}case\"GatherV2\":{let n=I(\"axis\",r,e,t),s=I(\"batchDims\",r,e,t),a=I(\"x\",r,e,t),i=I(\"indices\",r,e,t);return[o.gather(a,o.cast(i,\"int32\"),n,s)]}case\"Reverse\":{let n=I(\"dims\",r,e,t),s=[];for(let i=0;i{let n=I(\"axis\",r,e,t),s=I(\"tensors\",r,e,t),a=s[0].shape,i=o.squeeze(s[0]).shape,p=s.map(u=>{let l=y.arraysEqual(u.shape,a);if(!l&&!y.arraysEqual(o.squeeze(u).shape,i))throw new Error(\"the input tensors shape does not match\");return l?u:o.reshape(u,a)});return[o.stack(p,n)]});case\"Unpack\":{let n=I(\"axis\",r,e,t),s=I(\"tensor\",r,e,t);return o.unstack(s,n)}case\"Tile\":{let n=I(\"reps\",r,e,t);return[o.tile(I(\"x\",r,e,t),n)]}case\"Split\":case\"SplitV\":{let n=I(\"axis\",r,e,t),s=I(\"numOrSizeSplits\",r,e,t),a=I(\"x\",r,e,t);return o.split(a,s,n)}case\"ScatterNd\":{let n=I(\"indices\",r,e,t),s=I(\"values\",r,e,t),a=I(\"shape\",r,e,t);return[o.scatterND(n,s,a)]}case\"GatherNd\":{let n=I(\"x\",r,e,t),s=I(\"indices\",r,e,t);return[o.gatherND(n,s)]}case\"SparseToDense\":{let n=I(\"sparseIndices\",r,e,t),s=I(\"outputShape\",r,e,t),a=I(\"sparseValues\",r,e,t),i=I(\"defaultValue\",r,e,t);return[o.sparseToDense(n,a,s,a.dtype===i.dtype?i:o.cast(i,a.dtype))]}case\"TensorScatterUpdate\":{let n=I(\"indices\",r,e,t),s=I(\"values\",r,e,t),a=I(\"tensor\",r,e,t);return[o.tensorScatterUpdate(a,n,s)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var F_=(r,e,t,o=et)=>{switch(r.op){case\"SparseFillEmptyRows\":{let{outputIndices:n,outputValues:s,emptyRowIndicator:a,reverseIndexMap:i}=o.sparse.sparseFillEmptyRows(I(\"indices\",r,e,t),I(\"values\",r,e,t),I(\"denseShape\",r,e,t),I(\"defaultValue\",r,e,t));return[n,s,a,i]}case\"SparseReshape\":{let{outputIndices:n,outputShape:s}=o.sparse.sparseReshape(I(\"inputIndices\",r,e,t),I(\"inputShape\",r,e,t),I(\"newShape\",r,e,t));return[n,s]}case\"SparseSegmentMean\":return[o.sparse.sparseSegmentMean(I(\"data\",r,e,t),I(\"indices\",r,e,t),I(\"segmentIds\",r,e,t))];case\"SparseSegmentSum\":return[o.sparse.sparseSegmentSum(I(\"data\",r,e,t),I(\"indices\",r,e,t),I(\"segmentIds\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var P_=(r,e,t,o=et)=>{switch(r.op){case\"FFT\":return[o.fft(I(\"x\",r,e,t))];case\"IFFT\":return[o.ifft(I(\"x\",r,e,t))];case\"RFFT\":return[o.rfft(I(\"x\",r,e,t))];case\"IRFFT\":return[o.irfft(I(\"x\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var O_=(r,e,t,o=et)=>{switch(r.op){case\"StaticRegexReplace\":return[o.string.staticRegexReplace(I(\"input\",r,e,t),I(\"pattern\",r,e,t),I(\"rewrite\",r,e,t),I(\"replaceGlobal\",r,e,t))];case\"StringNGrams\":{let{nGrams:n,nGramsSplits:s}=o.string.stringNGrams(I(\"data\",r,e,t),I(\"dataSplits\",r,e,t),I(\"separator\",r,e,t),I(\"nGramWidths\",r,e,t),I(\"leftPad\",r,e,t),I(\"rightPad\",r,e,t),I(\"padWidth\",r,e,t),I(\"preserveShortSequences\",r,e,t));return[n,s]}case\"StringSplit\":{let{indices:n,values:s,shape:a}=o.string.stringSplit(I(\"input\",r,e,t),I(\"delimiter\",r,e,t),I(\"skipEmpty\",r,e,t));return[n,s,a]}case\"StringToHashBucketFast\":return[o.string.stringToHashBucketFast(I(\"input\",r,e,t),I(\"numBuckets\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var M_=(r,e,t,o=et)=>{switch(r.op){case\"Cast\":return[o.cast(I(\"x\",r,e,t),I(\"dtype\",r,e,t))];case\"ExpandDims\":{let n=I(\"axis\",r,e,t);return[o.expandDims(I(\"x\",r,e,t),n)]}case\"Squeeze\":{let n=I(\"axis\",r,e,t);return[o.squeeze(I(\"x\",r,e,t),n)]}case\"Reshape\":return[o.reshape(I(\"x\",r,e,t),I(\"shape\",r,e,t))];case\"EnsureShape\":return[o.ensureShape(I(\"x\",r,e,t),I(\"shape\",r,e,t))];case\"MirrorPad\":return[o.mirrorPad(I(\"x\",r,e,t),I(\"padding\",r,e,t),I(\"mode\",r,e,t))];case\"PadV2\":case\"Pad\":return[o.pad(I(\"x\",r,e,t),I(\"padding\",r,e,t),I(\"constantValue\",r,e,t))];case\"SpaceToBatchND\":{let n=I(\"blockShape\",r,e,t),s=I(\"paddings\",r,e,t);return[o.spaceToBatchND(I(\"x\",r,e,t),n,s)]}case\"BatchToSpaceND\":{let n=I(\"blockShape\",r,e,t),s=I(\"crops\",r,e,t);return[o.batchToSpaceND(I(\"x\",r,e,t),n,s)]}case\"DepthToSpace\":{let n=I(\"blockSize\",r,e,t),s=I(\"dataFormat\",r,e,t).toUpperCase();return[o.depthToSpace(I(\"x\",r,e,t),n,s)]}case\"BroadcastTo\":return[o.broadcastTo(I(\"x\",r,e,t),I(\"shape\",r,e,t))];case\"BroadcastArgs\":return[o.broadcastArgs(I(\"s0\",r,e,t),I(\"s1\",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function YS(r,e,t,o,n=De){let s=((a,i,p)=>{switch(a.category){case\"arithmetic\":return n(()=>m_(a,i,p));case\"basic_math\":return n(()=>d_(a,i,p));case\"control\":return b_(a,i,p);case\"convolution\":return n(()=>w_(a,i,p));case\"creation\":return n(()=>S_(a,i,p));case\"dynamic\":return I_(a,i,p);case\"evaluation\":return n(()=>v_(a,i,p));case\"image\":return n(()=>T_(a,i,p));case\"graph\":return n(()=>k_(a,i,p));case\"logical\":return n(()=>__(a,i,p));case\"matrices\":return n(()=>E_(a,i,p));case\"normalization\":return n(()=>$_(a,i,p));case\"ragged\":return n(()=>R_(a,i,p));case\"reduction\":return n(()=>D_(a,i,p));case\"slice_join\":return n(()=>A_(a,i,p));case\"sparse\":return n(()=>F_(a,i,p));case\"spectral\":return n(()=>P_(a,i,p));case\"string\":return n(()=>O_(a,i,p));case\"transformation\":return n(()=>M_(a,i,p));case\"hash_table\":return N_(a,i,p,o);case\"custom\":let u=bf(a.op);if(u&&u.customExecutor)return u.customExecutor(new Rf(a,i,p));throw TypeError(`Custom op ${a.op} is not registered.`);default:throw TypeError(`Unknown op '${a.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(r,e,t);return y.isPromise(s)?s.then(a=>[].concat(a)):[].concat(s)}var Gc=class{constructor(e={},t={},o={},n={},s){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=o,this.functionMap=n,this.parseNodeNameCache=s,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 QS(r,e,t,o){let n=new Set,s=[],a=null,i=null,p=new Set,u=new Set(Object.keys(r).map(m=>Er(m)[0]));o=o||[];let l=new Set(o.map(m=>Er(m.name)[0])),c=[...e];for(;c.length>0;){let m=c.pop();if((wu(m)||ZY(m)||JY(m))&&a==null&&(a=m,i=a.children.map(d=>d.name).filter(d=>n.has(d))),n.add(m.name),t[m.name]==null&&!u.has(m.name)&&!l.has(m.name)){if(m.inputs.length===0){s.push(m.name);continue}m.inputs.forEach(d=>{p.has(d.name)||(p.add(d.name),c.push(d))})}}return{inputs:r,outputs:e,usedNodes:n,missingInputs:s,dynamicNode:a,syncInputs:i}}function L_(r,e){let{usedNodes:t,inputs:o}=e,n=Object.keys(o).map(g=>Er(g)[0]).map(g=>r.nodes[g]),s=r.initNodes||[],a=g=>t.has(typeof g==\"string\"?g:g.name);function i(g){return[...new Map(g.map(x=>[x.name,x])).values()]}let p=i([...n,...r.weights,...s]).filter(a),u=i([...p,...Object.values(r.nodes)]).filter(a),l=new Map(u.map(g=>[g.name,g])),c={};for(let g of u){c[g.name]=c[g.name]||0;for(let x of g.children)a(x)||(c[x.name]=Number.POSITIVE_INFINITY),c[x.name]=(c[x.name]||0)+1}let m=Object.entries(c).filter(([,g])=>g===0).map(([g])=>g),d=[...m];for(;m.length>0;){let g=m.pop(),x=l.get(g);for(let b of x.children.filter(a))--c[b.name]===0&&(d.push(b.name),m.push(b.name))}let f=d.map(g=>l.get(g)),h=qY(f,p);return jY(h,p),h}function qY(r,e){let t=new Map(r.map(a=>[a.name,a])),o=e.map(a=>a.name),n=new Set(o);for(;o.length>0;){let a=o.pop(),i=t.get(a);for(let p of i.children)!t.has(p.name)||n.has(p.name)||(n.add(p.name),o.push(p.name))}return r.filter(a=>n.has(a.name))}var Sl=class extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}};function jY(r,e){let t=new Map(r.map((i,p)=>[i.name,p])),o=new Set(e.map(i=>i.name)),n=i=>o.has(typeof i==\"string\"?i:i.name),s=new Set(r.map(i=>i.name)),a=i=>s.has(typeof i==\"string\"?i:i.name);for(let i of r){for(let p of i.children.filter(a)){if(!t.has(p.name))throw new Sl(`Child ${p.name} of node ${i.name} is unreachable.`);if(t.get(i.name)>t.get(p.name))throw new Sl(`Node ${i.name} is scheduled to run after its child ${p.name}.`)}if(!n(i))for(let p of i.inputs){if(!t.has(p.name))throw new Sl(`Input ${p.name} of node ${i.name} is unreachable.`);if(t.get(p.name)>t.get(i.name))throw new Sl(`Node ${i.name} is scheduled to run before its input ${p.name}.`)}}}function B_(r){let e=new Map(r.map((i,p)=>[i.name,p])),t=Number.MAX_SAFE_INTEGER,o=r.map((i,p)=>wu(i)?t:p),n=i=>{let p=o[e.get(i.name)];return p==null?-1:p},s=r.map((i,p)=>i.children.map(n).reduce((u,l)=>Math.max(u,l),o[p])),a=new Map;for(let i=0;ie[o].map(n=>n.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),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=\",\",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,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(o=>{this._functionExecutorMap[o]=new r(e.functions[o],this)})}getCompilationKey(e,t){let o=e.map(s=>s.name).sort(),n=t.map(s=>s.name).sort();return o.join(this.SEPARATOR)+\"--\"+n.join(this.SEPARATOR)}compile(e,t){let o=QS(e,t,this.weightMap,this._initNodes),{missingInputs:n,dynamicNode:s,syncInputs:a}=o;if(s!=null)throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`);if(n.length>0){let u=t.map(c=>c.name),l=Object.keys(e);throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${l}]. Missing the following inputs: [${n}]`)}let i=L_(this.graph,o),p=B_(i);return{orderedNodes:i,nodeLiveUntilMap:p}}cloneAndKeepTensor(e){if(e==null)return null;let t=e.clone();return Fr(t),t}cloneTensorList(e){return e?e.map(o=>this.cloneAndKeepTensor(o)):null}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,this.cloneTensorList(o)]))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);let o=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let n=o.map(m=>this.graph.nodes[Er(m)[0]]),s=t.map(m=>Er(m)[0]),a=new Set(s),i=s.map(m=>this.graph.nodes[m]);i.length===0&&(i=this._outputs);let p=this.getCompilationKey(n,i),u=this.compiledMap.get(p);u==null&&(u=this.compile(e,i),this.compiledMap.set(p,u));try{this.keepIntermediateTensors=A().getBool(\"KEEP_INTERMEDIATE_TENSORS\")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let l={},c={};return De(()=>{let m=new Gc(this.weightMap,l,c,this.functionExecutorMap,this.parseNodeNameCache),d=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach(x=>{let[b,w]=Er(x,m),S=[];S[w]=e[x],d[b]=S,this.keepIntermediateTensors&&(this.clonedTensorsMap[b]=this.cloneTensorList(S))});let f=this.getFrozenTensorIds(d),{orderedNodes:h,nodeLiveUntilMap:g}=u;for(let x of h){if(d[x.name])continue;let b=YS(x,d,m,this._resourceManager);if(y.isPromise(b))throw new Error(`The execution of the op '${x.op}' returned a promise. Please use model.executeAsync() instead.`);d[x.name]=b,this.keepIntermediateTensors&&(this.clonedTensorsMap[x.name]=this.cloneTensorList(b)),this.checkTensorForDisposalWithNodeLiveUntilInfo(x,d,m,f,a,g.get(x.name))}return this.parent==null&&m.dispose(f),t.map(x=>Vt(x,d,m))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(o=>e[o]).map(o=>o.map(n=>n.id)));return new Set(t)}checkTensorForDisposal(e,t,o,n,s,a,i){if(!(wu(t)||a.has(e))){for(let p of o[e])p!=null&&(i[p.id]=(i[p.id]||0)+t.children.length);for(let p of t.inputs){if(wu(p))continue;let u=_S(p.name,o,n);if(u!=null)for(let l of u){if(!l||l.kept||s.has(l.id))continue;let c=i[l.id];c===1?(l.dispose(),delete i[l.id]):c!=null&&i[l.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,o,n,s,a){function i(p){return wu(p)||s.has(p.name)}if(!(wu(e)||a==null))for(let p of a){if(i(p))continue;let u=_S(p.name,t,o);for(let l of u)!l||l.kept||n.has(l.id)||l.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(e=>{for(let t of e)t&&!t.isDisposed&&t.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,o=!1,n={},s={}){this.disposeIntermediateTensors(),o||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=A().getBool(\"KEEP_INTERMEDIATE_TENSORS\")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let a=new Gc(this.weightMap,n,s,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));let i=await this.executeWithControlFlow(e,a,t,o),p=t.map(m=>Vt(m,i,a)),u=p.map(m=>m.id),l=Object.keys(e).map(m=>e[m].id),c=new Set([...u,...l,...this.weightIds]);return Object.values(i).forEach(m=>{m.forEach(d=>{d&&!d.isDisposed&&!c.has(d.id)&&d.dispose()})}),this.parent==null&&a.dispose(c),p}async executeFunctionAsync(e,t,o){let n=e.reduce((s,a,i)=>(s[this.inputs[i].name]=a,s),{});return this._executeAsync(n,this.outputNodes,!0,t,o)}async executeWithControlFlow(e,t,o,n){let s=Object.keys(e),a=s.map(S=>this.graph.nodes[Er(S)[0]]),i=o.map(S=>Er(S)[0]),p=new Set(i),u=i.map(S=>this.graph.nodes[S]);u.length===0&&(u=this._outputs);let{usedNodes:l,missingInputs:c,dynamicNode:m,syncInputs:d}=QS(e,u,this.weightMap,this._initNodes),f=[...a,...this.graph.weights,...this._initNodes||[]].map(S=>({node:S,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(S=>{let[k,T]=Er(S),E=[];E[T]=e[S],h[k]=E});let g={},x=this.getFrozenTensorIds(h),b={};for(;f.length>0;){let S=this.processStack(a,f,t,h,b,x,p,g,l);await Promise.all(S)}m==null&&!n&&console.warn(\"This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.\");let w=u.filter(S=>!wu(S)&&!Vt(S.name,h,t)).map(S=>S.name);if(w.length>0){let S=\"\";throw m!=null&&(S=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${w}] from the provided inputs [${s}]. Consider providing the following inputs: [${c}]. ${S}`)}return h}processStack(e,t,o,n,s,a,i,p,u){let l=[];for(;t.length>0;){let c=t.pop();o.currentContext=c.contexts;let m=\"\";if(c.node.op===\"Enter\"&&I(\"isConstant\",c.node,n,o)&&([m]=qs(c.node.name,o)),n[c.node.name]==null){let d=YS(c.node,n,o,this._resourceManager);m||([m]=qs(c.node.name,o));let f=o.currentContext;y.isPromise(d)?l.push(d.then(h=>(n[m]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(h)),o.currentContext=f,this.checkTensorForDisposal(m,c.node,n,o,a,i,p),this.processChildNodes(c.node,t,o,n,s,u),h))):(n[m]=d,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(d)),this.checkTensorForDisposal(m,c.node,n,o,a,i,p),this.processChildNodes(c.node,t,o,n,s,u))}else this.processChildNodes(c.node,t,o,n,s,u)}return l}processChildNodes(e,t,o,n,s,a){e.children.forEach(i=>{let[p]=qs(i.name,o);s[p]||!a.has(i.name)||(i.op===\"Merge\"?i.inputNames.some(u=>!!Vt(u,n,o))&&(s[p]=!0,t.push({contexts:o.currentContext,node:i})):i.inputNames.every(u=>!!Vt(u,n,o))&&(s[p]=!0,t.push({contexts:o.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 o=e[t],[n]=Er(t),s=this.graph.nodes[n];if(s.attrParams.shape&&s.attrParams.shape.value){let a=s.attrParams.shape.value,i=a.length===o.shape.length&&o.shape.every((p,u)=>a[u]===-1||a[u]===p);y.assert(i,()=>`The shape of dict['${s.name}'] provided in model.execute(dict) must be [${a}], but was [${o.shape}]`)}s.attrParams.dtype&&s.attrParams.dtype.value&&y.assert(o.dtype===s.attrParams.dtype.value,()=>`The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${o.dtype}`)})}mapInputs(e){var t,o;let n={};for(let s in e){let a=(o=(t=this._signature)===null||t===void 0?void 0:t.inputs)===null||o===void 0?void 0:o[s];a!=null?n[a.name]=e[s]:n[s]=e[s]}return n}checkInputs(e){let t=Object.keys(e).filter(o=>{let[n]=Er(o);return this.graph.nodes[n]==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=>{var o,n;let s=(n=(o=this._signature)===null||o===void 0?void 0:o.outputs)===null||n===void 0?void 0:n[t];return s!=null?s.name:t},{})}checkOutputs(e){e.forEach(t=>{let[o]=Er(t);if(!this.graph.nodes[o])throw new Error(`The output '${t}' is not found in the graph`)})}};var Pf=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]}};var e7=\"?tfjs-format=file\",t7=\"model.json\",Kc=class{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}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},o=Si){this.modelUrl=e,this.loadOptions=t,this.version=\"n/a\",this.io=o,t==null&&(this.loadOptions={}),this.resourceManager=new Pf}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{let t=this.io.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(this.io.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]}}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=this.handler.load();return y.isPromise(e)?e.then(t=>t.getWeightStream==null?this.loadSync(t):this.loadStreaming(t)):this.loadSync(e)}loadSync(e){let t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(e.getWeightStream==null)throw new Error(\"Model artifacts missing streamWeights function\");let t=await gd(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;let o=this.artifacts.modelTopology,n=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){let s=this.artifacts.userDefinedMetadata;s.signature!=null&&(n=s.signature),s.structuredOutputKeys!=null&&(this.structuredOutputKeys=s.structuredOutputKeys)}if(this.signature=n,this.version=`${o.versions.producer}.${o.versions.minConsumer}`,this.executor=new Hc(Uc.Instance.transformGraph(o,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let s=Uc.Instance.transformGraph(e.modelInitializer);this.initializer=new Hc(s),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if(typeof e==\"string\"){let o=this.io.getSaveHandlers(e);if(o.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(o.length>1)throw new Error(`Found more than one (${o.length}) save handlers for URL '${e}'`);e=o[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)}addStructuredOutputNames(e){if(this.structuredOutputKeys){let t=e instanceof dt?[e]:e,o={};return t.forEach((n,s)=>o[this.structuredOutputKeys[s]]=n),o}return e}predict(e,t){let o=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(o)}async predictAsync(e,t){let o=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(o)}normalizeInputs(e){var t;if(!(e instanceof dt)&&!Array.isArray(e)){let s=(t=this.signature)===null||t===void 0?void 0:t.inputs;if(s!=null)for(let a in s){let i=s[a];i.resourceId!=null&&(e[a]=this.resourceIdToCapturedInput[i.resourceId])}return e}e=Array.isArray(e)?e:[e];let o=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+o!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-o} non-resource placeholders, while there are ${e.length} input tensors provided.`);let n=0;return this.inputNodes.reduce((s,a)=>{var i,p,u;let l=(u=(p=(i=this.signature)===null||i===void 0?void 0:i.inputs)===null||p===void 0?void 0:p[a])===null||u===void 0?void 0:u.resourceId;return l!=null?s[a]=this.resourceIdToCapturedInput[l]:s[a]=e[n++],s},{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){let t=this.initializerSignature.outputs,o=Object.keys(t);for(let n=0;n1?o:o[0]}async executeAsync(e,t){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let o=await this.executor.executeAsync(e,t);return o.length>1?o:o[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,o)=>(t[o]=[e[o]],t),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&Lt(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}};async function r7(r,e={},t=Si){if(r==null)throw new Error(\"modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model\");e==null&&(e={}),e.fromTFHub&&typeof r==\"string\"&&(r=n7(r));let o=new Kc(r,e,t);return await o.load(),o}function o7(r){if(r==null)throw new Error(\"modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model\");let e;if(r instanceof Array){let[o,n]=r;if(!o)throw new Error(\"modelJSON must be the first element of the array\");if(!n||!(n instanceof ArrayBuffer))throw new Error(\"An ArrayBuffer of weights must be the second element of the array\");if(!(\"modelTopology\"in o))throw new Error(\"Model JSON is missing 'modelTopology'\");if(!(\"weightsManifest\"in o))throw new Error(\"Model JSON is missing 'weightsManifest'\");let s=Si.getWeightSpecs(o.weightsManifest),a=Si.getModelArtifactsForJSONSync(o,s,n);e=Si.fromMemorySync(a)}else if(\"load\"in r)e=r;else if(\"modelTopology\"in r&&\"weightSpecs\"in r&&\"weightData\"in r)e=Si.fromMemorySync(r);else throw new Error(\"Unknown model format\");let t=new Kc(e);return t.load(),t}function n7(r){return r.endsWith(\"/\")||(r=r+\"/\"),`${r}${t7}${e7}`}var s7=\"4.17.0\";function Q(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!==\"complex64\",()=>`${e} does not support complex64 tensors in the CPU backend.`)})}var a7=Ut.whereImpl,Il=class r extends mo{nextDataId(){return r.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new mn(this,cr())}write(e,t,o){this.firstUse&&(this.firstUse=!1,A().get(\"IS_NODE\")&&C.warn(`\n============================\nHi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. \n============================`));let n={id:this.nextDataId()};return this.data.set(n,{values:e,dtype:o,refCount:1}),n}makeTensorInfo(e,t,o){let n;if(t===\"string\"&&o!=null&&o.length>0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,e,t)}else n=this.write(o,e,t);return{dataId:n,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,o,n,s){this.data.set(e,{values:t,dtype:n,refCount:s})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:o}=this.data.get(e);if(t===\"complex64\"){let n=this.readSync(o.real.dataId),s=this.readSync(o.imag.dataId);return C.mergeRealAndImagArrays(n,s)}return y.convertBackendValuesAndArrayBuffer(this.data.get(e).values,t)}bufferSync(e){let t=this.readSync(e.dataId);if(e.dtype===\"string\")try{let o=t.map(n=>y.decodeString(n));return ie(e.shape,e.dtype,o)}catch(o){throw new Error(\"Failed to decode encoded string bytes into utf-8\")}return ie(e.shape,e.dtype,t)}makeOutput(e,t,o){return cr().makeTensorFromTensorInfo(this.makeTensorInfo(t,o,e),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:o}=this.data.get(e);o!=null&&(this.disposeData(o.real.dataId,!0),this.disposeData(o.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=y.now();return e(),{kernelMs:y.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){Q([e],\"where\");let t=this.readSync(e.dataId);return a7(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};Il.nextDataId=0;var Xf={};qe(Xf,{addImpl:()=>eI,bincountImpl:()=>Nl,bincountReduceImpl:()=>Of,bitwiseAndImpl:()=>tI,castImpl:()=>JS,ceilImpl:()=>rI,concatImpl:()=>mp,equalImpl:()=>oI,expImpl:()=>sI,expm1Impl:()=>iI,floorDivImpl:()=>pI,floorImpl:()=>uI,gatherNdImpl:()=>Mf,gatherV2Impl:()=>Lf,greaterEqualImpl:()=>cI,greaterImpl:()=>lI,lessEqualImpl:()=>dI,lessImpl:()=>mI,linSpaceImpl:()=>Bf,logImpl:()=>fI,maxImpl:()=>zf,maximumImpl:()=>hI,minimumImpl:()=>gI,multiplyImpl:()=>qc,negImpl:()=>xI,notEqualImpl:()=>yI,prodImpl:()=>bI,raggedGatherImpl:()=>Vf,raggedRangeImpl:()=>Wf,raggedTensorToTensorImpl:()=>Uf,rangeImpl:()=>fp,rsqrtImpl:()=>wI,scatterImpl:()=>Xs,sigmoidImpl:()=>gE,simpleAbsImpl:()=>ZS,sliceImpl:()=>hp,sparseFillEmptyRowsImpl:()=>Gf,sparseReshapeImpl:()=>Hf,sparseSegmentReductionImpl:()=>_l,sqrtImpl:()=>bE,squaredDifferenceImpl:()=>II,staticRegexReplaceImpl:()=>vI,stridedSliceImpl:()=>Kf,stringNGramsImpl:()=>gp,stringSplitImpl:()=>xp,stringToHashBucketFastImpl:()=>yp,subImpl:()=>NI,tileImpl:()=>qf,topKImpl:()=>jf,transposeImpl:()=>Tl,uniqueImpl:()=>bp});function ZS(r){let e=new Float32Array(r.length);for(let t=0;t{let{x:e}=r.inputs,t=r.backend;Q(e,\"abs\");let o=new Float32Array(y.sizeFromShape(e.shape)),n=t.data.get(e.dataId).values;return o=ZS(n),t.makeOutput(o,e.shape,e.dtype)},z_={kernelName:fn,backendName:\"cpu\",kernelFunc:i7};function Ve(r){return(e,t,o,n,s)=>{let a=C.assertAndGetBroadcastShape(e,t),i=a.length,p=y.computeStrides(a),u=y.sizeFromShape(a),l=y.getTypedArrayFromDType(s,u),c=e.length,m=t.length,d=y.computeStrides(e),f=y.computeStrides(t),h=C.getBroadcastDims(e,a),g=C.getBroadcastDims(t,a);if(h.length+g.length===0)for(let x=0;xw[E]=0);let S=y.locToIndex(w,c,d),k=b.slice(-m);g.forEach(E=>k[E]=0);let T=y.locToIndex(k,m,f);l[x]=r(o[S],n[T])}return[l,a]}}function qt(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,i=t.makeTensorInfo(o.shape,\"complex64\"),p=t.data.get(i.dataId);return p.complexTensorInfos={real:t.makeTensorInfo(o.shape,\"float32\",s),imag:t.makeTensorInfo(n.shape,\"float32\",a)},i}var V_={kernelName:ei,backendName:\"cpu\",kernelFunc:qt};function vl(r,e,t=\"float32\"){if(t===\"complex64\"){let n=vl(r,e,\"float32\"),s=vl(r,e,\"float32\");return qt({inputs:{real:n,imag:s},backend:r})}let o=y.makeZerosTypedArray(y.sizeFromShape(e),t);return r.makeTensorInfo(e,t,o)}function fr(r){let{inputs:e,backend:t}=r,{x:o}=e;return t.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var W_={kernelName:vo,backendName:\"cpu\",kernelFunc:fr};function tn(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.data.get(o.dataId).complexTensorInfos.real,s=t.data.get(n.dataId).values;return t.makeTensorInfo(n.shape,n.dtype,s)}var U_={kernelName:si,backendName:\"cpu\",kernelFunc:tn};function JS(r,e,t,o){if(o===\"int32\"){let n=Int32Array.from(r);return[e,\"int32\",n]}if(o===\"bool\"){let n=y.toTypedArray([0],t),[s,a]=Ve((i,p)=>i!==p?1:0)(e,[],r,n,\"bool\");return[a,\"bool\",s]}throw new Error(`Error in Cast: failed to cast ${t} to ${o}`)}function rn(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s===\"complex64\"){if(n.dtype===\"complex64\")return fr({inputs:{x:n},backend:t});let l=vl(t,n.shape,n.dtype),c=rn({inputs:{x:n},backend:t,attrs:{dtype:\"float32\"}}),m=qt({inputs:{real:c,imag:l},backend:t});return t.disposeIntermediateTensorInfo(l),t.disposeIntermediateTensorInfo(c),m}if(n.dtype===\"complex64\"){let l=tn({inputs:{input:n},backend:t}),c=rn({inputs:{x:l},backend:t,attrs:{dtype:s}});return t.disposeIntermediateTensorInfo(l),c}if(!y.hasEncodingLoss(n.dtype,s)){let l=fr({inputs:{x:n},backend:t});return{dataId:l.dataId,shape:l.shape,dtype:s}}let a=t.data.get(n.dataId).values,[i,p,u]=JS(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}var G_={kernelName:ho,backendName:\"cpu\",kernelFunc:rn};function Qe(r,e,t,o){return t==null?({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;Q([a,i],r);let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=a.dtype===\"string\"?C.fromUint8ToStringArray(u):u,m=a.dtype===\"string\"?C.fromUint8ToStringArray(l):l,d=o||a.dtype,[f,h]=e(a.shape,i.shape,c,m,d);return p.makeTensorInfo(h,d,f)}:({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(a.dtype===\"complex64\"||i.dtype===\"complex64\"){let u=rn({inputs:{x:a},backend:p,attrs:{dtype:\"complex64\"}}),l=p.data.get(u.dataId),c=l.complexTensorInfos.real,m=l.complexTensorInfos.imag,d=p.data.get(c.dataId).values,f=p.data.get(m.dataId).values,h=rn({inputs:{x:i},backend:p,attrs:{dtype:\"complex64\"}}),g=p.data.get(h.dataId),x=g.complexTensorInfos.real,b=g.complexTensorInfos.imag,w=p.data.get(x.dataId).values,S=p.data.get(b.dataId).values,[k,T,E]=t(a.shape,i.shape,d,f,w,S),R=p.makeTensorInfo(E,\"float32\",k),D=p.makeTensorInfo(E,\"float32\",T),F=qt({inputs:{real:R,imag:D},backend:p});return p.disposeIntermediateTensorInfo(u),p.disposeIntermediateTensorInfo(h),p.disposeIntermediateTensorInfo(R),p.disposeIntermediateTensorInfo(D),F}else{let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=o||a.dtype,[m,d]=e(a.shape,i.shape,u,l,c);return p.makeTensorInfo(d,c,m)}}}function kl(r){return(e,t,o,n,s,a)=>{let i=C.assertAndGetBroadcastShape(e,t),p=y.sizeFromShape(i),u=i.length,l=y.computeStrides(i),c=y.getTypedArrayFromDType(\"float32\",p),m=y.getTypedArrayFromDType(\"float32\",p),d=C.getBroadcastDims(e,i),f=C.getBroadcastDims(t,i),h=C.mergeRealAndImagArrays(o,n),g=C.mergeRealAndImagArrays(s,a),x=e.length,b=y.computeStrides(e),w=t.length,S=y.computeStrides(t);if(d.length+f.length===0)for(let k=0;kE[M]=0);let R=y.locToIndex(E,x,b),D=T.slice(-w);f.forEach(M=>D[M]=0);let F=y.locToIndex(D,w,S),O=r(h[R*2],h[R*2+1],g[F*2],g[F*2+1]);c[k]=O.real,m[k]=O.imag}return[c,m,i]}}var eI=Ve((r,e)=>r+e),u7=kl((r,e,t,o)=>({real:r+t,imag:e+o})),Wa=Qe(Rr,eI,u7),H_={kernelName:Rr,backendName:\"cpu\",kernelFunc:Wa};function Nl(r,e,t,o,n){let s=y.sizeFromShape(o),a=y.makeZerosTypedArray(n,t);for(let i=0;i=n||(s>0?a[p]+=e[i]:a[p]+=1)}return a}function Of(r,e,t,o=!1){let n=r.shape[0],s=r.shape[1],a=ie([n,t],e.dtype);for(let i=0;i=t||(o?a.set(1,i,u):e.size>0?a.set(a.get(i,u)+e.get(i,p),i,u):a.set(a.get(i,u)+1,i,u))}return a}var tI=Ve((r,e)=>r&e),p7=Qe(_n,tI),K_={kernelName:_n,backendName:\"cpu\",kernelFunc:p7};function Yt(r){return(e,t,o)=>{let n=y.getArrayFromDType(t,e.length);for(let s=0;s{let{x:a}=o;Q(a,r);let i=s,p=i.data.get(a.dataId).values,u;if(a.dtype===\"string\"){if(!Array.isArray(p))throw new Error(\"String tensor's value was not an instance of Array\");u=C.fromUint8ToStringArray(p)}else u=p;let l=t||a.dtype,c=e(u,l,n);return i.makeTensorInfo(a.shape,l,c)}}var rI=Yt(r=>Math.ceil(r)),l7=Mr(go,rI),q_={kernelName:go,backendName:\"cpu\",kernelFunc:l7};function mp(r,e,t,o){let n=y.getArrayFromDType(t,y.sizeFromShape(e));if(o&&t!==\"string\"){let s=0;r.forEach(a=>{let i=y.sizeFromShape(a.shape);n.set(a.vals,s),s+=i})}else{let s=0;r.forEach(a=>{let i=t===\"string\"?C.fromUint8ToStringArray(a.vals):a.vals,p=0;for(let u=0;ur===e?1:0),nI=Qe(xo,oI,null,\"bool\"),j_={kernelName:xo,backendName:\"cpu\",kernelFunc:nI};var sI=Yt(r=>Math.exp(r)),aI=Mr(yo,sI,\"float32\"),X_={kernelName:yo,backendName:\"cpu\",kernelFunc:aI};var iI=Yt(r=>Math.expm1(r)),c7=Mr(bo,iI),Y_={kernelName:bo,backendName:\"cpu\",kernelFunc:c7};var uI=Yt(r=>Math.floor(r)),m7=Mr(Co,uI),Q_={kernelName:Co,backendName:\"cpu\",kernelFunc:m7};var pI=Ve((r,e)=>Math.floor(r/e)),d7=Qe(wo,pI,null,\"int32\"),Z_={kernelName:wo,backendName:\"cpu\",kernelFunc:d7};function Mf(r,e,t,o,n,s,a,i,p){let u=ie([o,s],t);for(let l=0;l=p/s)throw new Error(`Invalid indices: ${c} does not index into ${i}`);for(let d=0;dr>e?1:0),f7=Qe(So,lI,null,\"bool\"),J_={kernelName:So,backendName:\"cpu\",kernelFunc:f7};var cI=Ve((r,e)=>r>=e?1:0),h7=Qe(Io,cI,null,\"bool\"),eE={kernelName:Io,backendName:\"cpu\",kernelFunc:h7};var mI=Ve((r,e)=>rr<=e?1:0),x7=Qe(No,dI,null,\"bool\"),rE={kernelName:No,backendName:\"cpu\",kernelFunc:x7};function Bf(r,e,t){let o=(e-r)/(t-1),n=y.makeZerosTypedArray(t,\"float32\");n[0]=r;for(let s=1;sMath.log(r)),y7=Mr(To,fI),oE={kernelName:To,backendName:\"cpu\",kernelFunc:y7};function zf(r,e,t,o){let n=y.getTypedArrayFromDType(o,y.sizeFromShape(t));for(let s=0;si)&&(i=u)}n[s]=i}return n}var hI=Ve((r,e)=>Math.max(r,e)),b7=Qe(_o,hI),nE={kernelName:_o,backendName:\"cpu\",kernelFunc:b7};var gI=Ve((r,e)=>Math.min(r,e)),C7=Qe(Eo,gI),sE={kernelName:Eo,backendName:\"cpu\",kernelFunc:C7};var qc=Ve((r,e)=>r*e),w7=kl((r,e,t,o)=>({real:r*t-e*o,imag:r*o+e*t})),dp=Qe($o,qc,w7),aE={kernelName:$o,backendName:\"cpu\",kernelFunc:dp};function xI(r,e,t){let o=y.createScalarValue(-1,t);return qc([],e,o,r,t)}function S7(r){let{inputs:e,backend:t}=r,{x:o}=e;Q(o,\"neg\");let n=t.data.get(o.dataId).values,[s,a]=xI(n,o.shape,o.dtype);return t.makeTensorInfo(a,o.dtype,s)}var iE={kernelName:ls,backendName:\"cpu\",kernelFunc:S7};var yI=Ve((r,e)=>r!==e?1:0),I7=Qe(Ro,yI,null,\"bool\"),uE={kernelName:Ro,backendName:\"cpu\",kernelFunc:I7};function Tl(r,e,t,o,n){let s=e.length,a=y.sizeFromShape(e),i=y.computeStrides(e),p=y.computeStrides(n),u=y.getTypedArrayFromDType(t,y.sizeFromShape(n));for(let l=0;lt.disposeIntermediateTensorInfo(b)),t.makeTensorInfo(x,g,f)}var lE={kernelName:Ho,backendName:\"cpu\",kernelFunc:v7};function k7(r,e,t){r.forEach((o,n)=>{if(o<0||o>=t){let s=y.indexToLoc(n,e.length,y.computeStrides(e)).join(\",\");throw new Error(`indices[${s}] = ${o} is not in [0, ${t})`)}})}function N7(r,e){for(let t=0;tn)throw new Error(\"Ragged splits must not point past values\");for(let s=1;so[s])throw new Error(\"Ragged splits must be sorted in ascending order\")}}function T7(r,e,t,o){let n=[],s=0,a=e.length-1+t.length,i=new Array(a).fill(null).map(()=>[0]);N7(t,o);let p=1;for(let u=0;u=0){let h=i[f],g=h[h.length-1]-d[l];for(let x=l;xn[a]=s)}return e}function cE(r,e){let t=r.slice(0,e);for(;t.length1)throw new Error(\"starts must be a scalar or vector\");if(n.length>1)throw new Error(\"limits must be a scalar or vector\");if(a.length>1)throw new Error(\"deltas must be a scalar or vector\");let i=e.length===0,p=n.length===0,u=a.length===0,l=[];i||l.push(e[0]),p||l.push(n[0]),u||l.push(a[0]);for(let g=1;g0&&bx)S=0;else if(S=Math.ceil(Math.abs((b-x)/w)),S>mE)throw new Error(`Requires ((limit - start) / delta) <= ${mE}`);m[g+1]=m[g]+S}let d=m[c],f=y.getArrayFromDType(t,d),h=0;for(let g=0;go&&(o=s)}return o}static getMaxWidthValueRowID(e){let t=e.length;if(t===0)return 0;let o=0,n=e[0],s=0;for(let a=1;a\"Final length of result must be equal to firstDimension.\"),s}calculateOutputIndexRowSplit(e,t,o,n){let s=e.length,a=[];for(let i=0;i0&&a.length!==e[s-1])throw new Error(\"Invalid row split size.\");return a}calculateOutputIndexValueRowID(e,t,o,n){let s=e.length,a=[];if(s===0)return[];let i=0,p=e[0];if(p>=t.length)throw new Error(`Got currentValueRowId=${p}, which is not less than ${t.length}`);let u=t[p];a.push(u);for(let l=1;l=0&&(++i,i=t.length)throw new Error(`Got nextValueRowId=${c} which is not less than ${t.length}`);u=t[c]}a.push(u)}if(a.length!==e.length)throw new Error(\"Invalid row ids.\");return a}calculateOutputIndex(e,t,o,n){let s=this.getRowPartitionTensor(e),a=this.getRowPartitionTypeByDimension(e);switch(a){case on.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,t,o,n);case on.ROW_SPLITS:if(s.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(s,t,o,n);default:throw new Error(`Unsupported partition type: ${on[a]}`)}}getFirstDimensionSize(){let e=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error(\"No row_partition_types given.\");let t=this.rowPartitionTypes[0];switch(t){case on.FIRST_DIM_SIZE:return e[0];case on.VALUE_ROWIDS:throw new Error(\"Cannot handle VALUE_ROWIDS in first dimension.\");case on.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${on[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error(\"Invalid first partition input. Tensor requires at least one element.\");let t=this.getFirstDimensionSize(),o=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let p=n.length-2;p>=0;--p)n[p]=n[p+1]*o[p+1];let s=fE(o,!1),a=y.getArrayFromDType(this.valuesDType,y.sizeFromShape(s));if(n[0]*o[0]>0){let p=this.calculateFirstParentOutputIndex(t,n[0],o[0]);for(let u=1;u<=this.raggedRank;++u)p=this.calculateOutputIndex(u-1,p,n[u],o[u]);this.setOutput(this.raggedRank,p,a,s)}return[s,a]}setOutput(e,t,o,n){if(o.length===0)return;let s=this.values,a=o,i=n.slice();i=i.slice(e+1);let p=y.sizeFromShape(i),u=t.length,l=this.defaultValue;if(l.length!==p&&l.length!==1){let f=this.defaultValueShape;De(()=>{let h=W(l,f);l=Oa(h,i).dataSync()})}let c=0,m=0,d=0;for(let f=0;f<=u;++f){let h=f=u){let g=o.length;h=Math.floor(g/p)}if(h>d)if(this.defaultValue.length===1)a.subarray(d*p,h*p).fill(this.defaultValue[0]),d=h;else for(;h>d;){let g=a.slice(d*p);dE(g,l,p),++d}h<0?(c=f+1,m=d):(c=f,m=d,d=m+1)}}};function dE(r,e,t){for(let o=0;o= 0`);if(o<-1)throw new Error(`Dimension ${o} must be >= -1`);o=-1}t.push(o)}return t}function Uf(r,e,t,o,n,s,a,i,p,u){return new CI(r,e,t,o,n,s,a,i,p,u).compute()}function fp(r,e,t,o){let n=r===e,s=r1;if(n||s||a)return y.makeZerosTypedArray(0,o);let i=Math.abs(Math.ceil((e-r)/t)),p=y.makeZerosTypedArray(i,o);e1/Math.sqrt(r)),R7=Mr(Do,wI),hE={kernelName:Do,backendName:\"cpu\",kernelFunc:R7};function Xs(r,e,t,o,n,s,a,i,p,u){let l=[o/n,n],c=r.values,m=e.values;if(o===0)return ie(t,e.dtype);let d=p instanceof Ge?p:ie(l,e.dtype);typeof p==\"string\"||typeof p==\"number\"?d.values.fill(p):typeof p==\"boolean\"&&d.values.fill(+p);for(let f=0;f=o/n)throw new Error(`Invalid indices: ${h} does not index into ${t}`);for(let x=0;x1/(1+Math.exp(-r))),SI=Ie(Ao,r=>1/(1+Math.exp(-r))),xE={kernelName:Ao,backendName:\"cpu\",kernelFunc:SI};function hp(r,e,t,o,n){let s=nt.isSliceContinous(o,e,t),a=y.sizeFromShape(t),i=y.computeStrides(o);if(s){let c=nt.computeFlatOffset(e,i);return n===\"string\"?r.slice(c,c+a):r.subarray(c,c+a)}let p=n===\"string\"?C.fromUint8ToStringArray(r):r,u=ie(o,n,p),l=ie(t,n);for(let c=0;cf+e[h]);l.set(u.get(...d),...m)}return n===\"string\"?C.fromStringArrayToUint8(l.values):l.values}function nn(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,size:a}=o;Q(n,\"slice\");let[i,p]=nt.parseSliceParams(n,s,a);nt.assertParamsValid(n,i,p);let u=t.data.get(n.dataId).values,l=hp(u,i,p,n.shape,n.dtype);return t.makeTensorInfo(p,n.dtype,l)}var yE={kernelName:_s,backendName:\"cpu\",kernelFunc:nn};function Gf(r,e,t,o,n,s,a){let i=e[0],p=s[0],u=new Array(p),l=new Array(i),c=e[1];if(p===0){if(i!==0)throw new Error(C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i));let g=y.getArrayFromDType(t,0),x=y.getArrayFromDType(n,0);return[g,[0,c],x,u,l]}let m=!0,d=0,f=new Array(p).fill(0);for(let g=0;g=p)throw new Error(C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,x,p));++f[x],m=m&&x>=d,d=x}let h=!0;for(let g=0;g0&&(f[g]+=f[g-1])}if(h&&m){let g=r,x=o;for(let b=0;b0){d[m-1]=1;for(let g=m-2;g>=0;--g)d[g]=d[g+1]*o[g+1]}let f=[];if(i>0){f[i-1]=1;for(let g=i-2;g>=0;--g)f[g]=f[g+1]*p[g+1]}let h=y.getArrayFromDType(t,a*i);for(let g=0;g0?n[i-1]+1:0;if(c<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=e.slice();m[0]=c;let d=m.reduce((w,S)=>w*S,1),f=y.getArrayFromDType(t,d);if(i===0)return c>0&&f.fill(a),[f,m];if(c<=0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let h=0,g=1,x=0,b=n[h];for(;;){let w=0;if(g=w)throw new Error(C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(b<0||b>=c)throw new Error(C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b,c));b>x&&f.fill(a,x*u,b*u);for(let S=h;S=p[0])throw new Error(C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S,o[S],p[0]));for(let T=0;Ti)break}return xMath.sqrt(r)),D7=Ie(Fo,r=>Math.sqrt(r)),CE={kernelName:Fo,backendName:\"cpu\",kernelFunc:D7};var II=Ve((r,e)=>{let t=r-e;return t*t}),A7=Qe(Po,II),wE={kernelName:Po,backendName:\"cpu\",kernelFunc:A7};var vI=Yt((r,e)=>{let{pattern:t,replaceGlobal:o,rewrite:n}=e;return r.replace(new RegExp(t,o?\"g\":\"\"),n)}),F7=Mr(pi,vI),SE={kernelName:pi,backendName:\"cpu\",kernelFunc:F7};function Kf(r,e,t,o){let n=ie(r,e.dtype);for(let s=0;s0?0:i-p),d=0;d+=u*this.leftPad.length;for(let b=0;bb.forEach(w=>h[g++]=w);for(let b=0;b0){x(e[m+c-1]);for(let b=0;b0){let p=t[0];if(p!==0)throw new Error(`First split value must be 0, got ${p}`);for(let u=1;u=p;if(l=l&&t[u]<=o,!l)throw new Error(`Invalid split value ${t[u]}, must be in [${p}, ${o}]`);p=t[u]}if(p!==o)throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`)}let s=n-1,a=y.getArrayFromDType(\"int32\",n);if(o===0||n===0){let p=new Array(o);for(let u=0;u<=s;++u)a[u]=0;return[p,a]}a[0]=0;for(let p=1;p<=s;++p){let u=t[p]-t[p-1],l=0;this.nGramWidths.forEach(c=>{l+=this.getNumNGrams(u,c)}),this.preserveShort&&u>0&&l===0&&(l=1),a[p]=a[p-1]+l}let i=new Array(a[s]);for(let p=0;p{let m=t[p+1]-t[p],d=this.getNumNGrams(m,c);this.createNGrams(e,u,i,l,d,c),l+=d}),this.preserveShort&&l===a[p]){let c=t[p+1]-t[p];if(c===0)continue;let m=c+2*this.padWidth;this.createNGrams(e,u,i,l,1,m)}}return[i,a]}};function gp(r,e,t,o,n,s,a,i){return new kI(t,o,n,s,a,i).compute(r,e)}function P7(r,e,t,o){if(!r.length)return;if(e.length===0){for(let s=0;sr-e),O7=kl((r,e,t,o)=>({real:r-t,imag:e-o})),jc=Qe(Oo,NI,O7),IE={kernelName:Oo,backendName:\"cpu\",kernelFunc:jc};function qf(r,e){let t=new Array(r.rank);for(let n=0;n{let t=e.value-r.value;return t===0?r.index-e.index:t};function vE(r,e,t=0,o=r.length-1){for(;o>t;){if(o-t>600){let i=o-t+1,p=e-t+1,u=Math.log(i),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(i-l)/i)*Math.sign(p-i/2),m=Math.max(t,Math.floor(e-p*l/i+c)),d=Math.min(o,Math.floor(e+(i-p)*l/i+c));vE(r,e,m,d)}let n=r[e],s=t,a=o;for(y.swap(r,t,e),Xc(r[o],n)>0&&y.swap(r,t,o);s0;)a=a-1}Xc(r[t],n)===0?y.swap(r,t,a):(a=a+1,y.swap(r,a,o)),a<=e&&(t=a+1),e<=a&&(o=a-1)}}function jf(r,e,t,o,n){let s=e[e.length-1],[a,i]=[r.length/s,s],p=y.getTypedArrayFromDType(t,a*o),u=y.getTypedArrayFromDType(\"int32\",a*o);for(let c=0;cf[w]={value:b,index:w}),o{for(let g=0;gnew Il,1);var TI=Ie(Wn,r=>r>=0?r:Math.exp(r)-1),kE={kernelName:Wn,backendName:\"cpu\",kernelFunc:TI};function _I(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{alpha:s}=o;Q([n],\"leakyRelu\");let a=y.sizeFromShape(n.shape),i=t.data.get(n.dataId).values,p=y.getTypedArrayFromDType(\"float32\",a);for(let u=0;ur<0?e*r:r);function EI(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e;Q([o,n],\"prelu\");let s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,[i,p]=L7(o.shape,n.shape,s,a,\"float32\");return t.makeTensorInfo(p,\"float32\",i)}var TE={kernelName:gs,backendName:\"cpu\",kernelFunc:EI};var $I=Ie(ys,r=>Math.max(0,r)),_E={kernelName:ys,backendName:\"cpu\",kernelFunc:$I};var RI=Ie(ws,r=>Math.min(Math.max(0,r),6)),EE={kernelName:ws,backendName:\"cpu\",kernelFunc:RI};function Cp(r,e,t,o,n){if(t===\"linear\")return fr({inputs:{x:e},backend:r});if(t===\"relu\")return $I({inputs:{x:e},backend:r});if(t===\"elu\")return TI({inputs:{x:e},backend:r});if(t===\"relu6\")return RI({inputs:{x:e},backend:r});if(t===\"prelu\")return EI({inputs:{x:e,alpha:o},backend:r});if(t===\"leakyrelu\")return _I({inputs:{x:e},backend:r,attrs:{alpha:n}});if(t===\"sigmoid\")return SI({inputs:{x:e},backend:r});throw new Error(`Activation ${t} has not been implemented for the CPU backend.`)}function We(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{shape:s}=o,a=y.sizeFromShape(n.shape),i=y.inferFromImplicitShape(s,a),p=y.sizeFromShape(i);y.assert(a===p,()=>`The new shape (${i}) has ${p} elements and the old shape (${n.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`),t.incRef(n.dataId);let u=t.data.get(n.dataId);if(u.complexTensorInfos!=null){let l=u.complexTensorInfos.real,c=u.complexTensorInfos.imag;l.shape=i,c.shape=i}return{dataId:n.dataId,shape:i,dtype:n.dtype}}var $E={kernelName:Ca,backendName:\"cpu\",kernelFunc:We};function DI(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;Q([n,s],\"matMul\");let p=n.shape.length,u=s.shape.length,l=a?n.shape[p-2]:n.shape[p-1],c=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),w=kr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(l===c,()=>`Error in matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,l,m]:[g,m,l],k=i?[x,d,c]:[x,c,d],T=We({inputs:{x:n},backend:t,attrs:{shape:S}}),E=We({inputs:{x:s},backend:t,attrs:{shape:k}}),R=a?T.shape[1]:T.shape[2],D=a?T.shape[2]:T.shape[1],F=i?E.shape[1]:E.shape[2],O=Math.max(g,x),M=t.data.get(T.dataId).values,L=t.data.get(E.dataId).values,B=y.computeStrides(T.shape),z=y.computeStrides(E.shape),[U,j,q]=a?[B[0],1,B[1]]:[B[0],B[1],1],[Y,J,re]=i?[1,z[1],z[0]]:[z[1],1,z[0]],ne=D*F,ee=ie([O,D,F],T.dtype),oe=ee.values,ue=t.blockSize;for(let me=0;meMath.acos(r)),AE={kernelName:hn,backendName:\"cpu\",kernelFunc:z7};var V7=Ie(gn,r=>Math.acosh(r)),FE={kernelName:gn,backendName:\"cpu\",kernelFunc:V7};function W7(r){let{inputs:e,backend:t}=r,o=e;Q(e,\"addN\");let n=o.map(i=>t.data.get(i.dataId).values),s=ie(o[0].shape,o[0].dtype),a=s.values;for(let i=0;ib&&(b=k,w=S)}d[g]=w}return u.forEach(g=>t.disposeIntermediateTensorInfo(g)),t.makeTensorInfo(l,\"int32\",d)}var LE={kernelName:na,backendName:\"cpu\",kernelFunc:H7};function K7(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o;Q(n,\"argMin\");let a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=vt({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),a=[a[0]],C.assertAxesAreInnerMostDims(\"argMin\",a,p.shape.length);let[l,c]=C.computeOutAndReduceShapes(p.shape,a),m=y.sizeFromShape(l),d=y.makeZerosTypedArray(m,\"int32\"),f=y.sizeFromShape(c),h=t.data.get(p.dataId).values;for(let g=0;gt.disposeIntermediateTensorInfo(g)),t.makeTensorInfo(l,\"int32\",d)}var BE={kernelName:sa,backendName:\"cpu\",kernelFunc:K7};var q7=Ie(Cn,r=>Math.asin(r)),zE={kernelName:Cn,backendName:\"cpu\",kernelFunc:q7};var j7=Ie(wn,r=>Math.asinh(r)),VE={kernelName:wn,backendName:\"cpu\",kernelFunc:j7};var X7=Ie(Sn,r=>Math.atan(r)),WE={kernelName:Sn,backendName:\"cpu\",kernelFunc:X7};var Y7=Ve((r,e)=>Math.atan2(r,e)),Q7=Qe(vn,Y7),UE={kernelName:vn,backendName:\"cpu\",kernelFunc:Q7};var Z7=Ie(In,r=>Math.atanh(r)),GE={kernelName:In,backendName:\"cpu\",kernelFunc:Z7};function El(r,e,t,o,n,s){let a=n.strideHeight,i=n.strideWidth,p=n.dilationHeight,u=n.dilationWidth,l=n.effectiveFilterHeight,c=n.effectiveFilterWidth,m=n.padInfo.top,d=n.padInfo.left,f=s===\"max\"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,h=ie(n.outShape,t),g=h.values,x=n.outShape[1]*n.outShape[2]*n.outShape[3],b=n.outShape[2]*n.outShape[3],w=n.outShape[3];for(let S=0;Sj?j=ue:s===\"avg\"&&(q+=ue,Y++)}if(isNaN(j))break}let J=M+L*w+E;g[J]=s===\"avg\"?q/Y:j}}}return h}function Yf(r,e,t,o,n=!1,s=!1){let a=ie(o.outShape,\"int32\"),i=o.strideHeight,p=o.strideWidth,u=o.dilationHeight,l=o.dilationWidth,c=o.effectiveFilterHeight,m=o.effectiveFilterWidth,d=o.padInfo.top,f=o.padInfo.left,h=ie(e,t,r);for(let g=0;gF&&(F=U,n?O=s?((g*o.inHeight+M)*o.inWidth+B)*o.inChannels+x:(M*o.inWidth+B)*o.inChannels+x:O=L*m+z)}}a.set(O,g,b,T,x)}}return a}function Qf(r,e,t,o,n,s){let a=n.strideDepth,i=n.strideHeight,p=n.strideWidth,u=n.dilationDepth,l=n.dilationHeight,c=n.dilationWidth,m=n.effectiveFilterDepth,d=n.effectiveFilterHeight,f=n.effectiveFilterWidth,h=n.padInfo.front,g=n.padInfo.top,x=n.padInfo.left,b=s===\"max\"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=ie(n.outShape,t),S=w.values,k=n.outShape[1]*n.outShape[2]*n.outShape[3]*n.outShape[4],T=n.outShape[2]*n.outShape[3]*n.outShape[4],E=n.outShape[3]*n.outShape[4],R=n.outShape[4];for(let D=0;D_e?_e=xt:s===\"avg\"&&(ve+=xt,Fe++),isNaN(_e))break}if(isNaN(_e))break}if(isNaN(_e))break}let Pe=be+M;S[Pe]=s===\"avg\"?ve/Math.max(Fe,1):_e}}}}return w}function HE(r,e){let t=ie(e.outShape,\"int32\"),o=e.strideDepth,n=e.strideHeight,s=e.strideWidth,a=e.dilationDepth,i=e.dilationHeight,p=e.dilationWidth,u=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,m=e.padInfo.front,d=e.padInfo.top,f=e.padInfo.left;for(let h=0;h=L&&(L=re,B=U*l*c+q*l+J)}}}t.set(B,h,x,k,D,g)}}}return t}function J7(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e;Q(n,\"avgPool\");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(C.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p),c;if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))c=fr({inputs:{x:n},backend:t});else{let m=t.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=El(m,n.shape,n.dtype,d,l,\"avg\");c=t.makeTensorInfo(l.outShape,n.dtype,f.values)}return c}var KE={kernelName:kn,backendName:\"cpu\",kernelFunc:J7};function eQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,\"avgPool3d\");let l=C.computePool3DInfo(n.shape,s,a,1,i,p,u),c=t.data.get(n.dataId).values,m=Qf(c,n.shape,n.dtype,y.computeStrides(n.shape),l,\"avg\");return t.makeTensorInfo(m.shape,\"float32\",m.values)}var qE={kernelName:aa,backendName:\"cpu\",kernelFunc:eQ};function tQ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],\"avgPool3DGrad\");let l=C.computePool3DInfo(s.shape,a,i,1,p,u),c=l.strideDepth,m=l.strideHeight,d=l.strideWidth,f=l.filterDepth,h=l.filterHeight,g=l.filterWidth,x=l.dilationDepth,b=l.dilationHeight,w=l.dilationWidth,S=l.effectiveFilterDepth,k=l.effectiveFilterHeight,T=l.effectiveFilterWidth,E=S-1-l.padInfo.front,R=T-1-l.padInfo.left,D=k-1-l.padInfo.top,F=ie(s.shape,\"float32\"),O=1/(f*h*g),M=t.bufferSync(n);for(let L=0;L=l.outDepth||Math.floor(ee)!==ee))for(let oe=0;oe=l.outHeight||Math.floor(ue)!==ue))for(let me=0;me=l.outWidth||Math.floor(be)!==be)continue;let _e=M.get(L,ee,ue,be,B);re+=_e}}}F.set(re*O,L,z,U,j,B)}return t.makeTensorInfo(F.shape,F.dtype,F.values)}var jE={kernelName:Vi,backendName:\"cpu\",kernelFunc:tQ};function rQ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s;Q([n,s],\"avgPoolGrad\");let{filterSize:i,strides:p,pad:u}=o,l=C.computePool2DInfo(a.shape,i,p,1,u),c=l.strideHeight,m=l.strideWidth,d=l.filterHeight,f=l.filterWidth,h=l.dilationHeight,g=l.dilationWidth,x=l.effectiveFilterHeight,b=l.effectiveFilterWidth,w=b-1-l.padInfo.left,S=x-1-l.padInfo.top,k=ie(a.shape,\"float32\"),T=1/(d*f),E=t.data.get(n.dataId).values,R=ie(n.shape,\"float32\",E);for(let D=0;D=l.outHeight||Math.floor(j)!==j))for(let q=0;q=l.outWidth||Math.floor(Y)!==Y)continue;let J=R.get(D,j,Y,F);z+=J}}k.set(z*T,D,O,M,F)}return t.makeTensorInfo(k.shape,k.dtype,k.values)}var XE={kernelName:zi,backendName:\"cpu\",kernelFunc:rQ};function oQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,scale:s,offset:a,mean:i,variance:p}=e;y.assert(i.shape.length===p.shape.length,()=>\"Batch normalization gradient requires mean and variance to have equal ranks.\"),y.assert(a==null||i.shape.length===a.shape.length,()=>\"Batch normalization gradient requires mean and offset to have equal ranks.\"),y.assert(s==null||i.shape.length===s.shape.length,()=>\"Batch normalization gradient requires mean and scale to have equal ranks.\"),Q([n,i,p,s,a],\"batchNorm\");let{varianceEpsilon:u}=o;u==null&&(u=.001);let l=t.data.get(n.dataId).values,c=t.data.get(i.dataId).values,m=t.data.get(p.dataId).values,d=s?t.data.get(s.dataId).values:new Float32Array([1]),f=a?t.data.get(a.dataId).values:new Float32Array([0]),h=new Float32Array(l.length),g=f.length,x=d.length,b=m.length,w=c.length,S=0,k=0,T=0,E=0;for(let R=0;R=g&&(S=0),k>=w&&(k=0),T>=x&&(T=0),E>=b&&(E=0);return t.makeTensorInfo(n.shape,n.dtype,h)}var YE={kernelName:Hn,backendName:\"cpu\",kernelFunc:oQ};function nQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,crops:a}=o;Q([n],\"batchToSpaceND\");let i=s.reduce((x,b)=>x*b),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=We({inputs:{x:n},backend:t,attrs:{shape:p}}),f=vt({inputs:{x:d},backend:t,attrs:{perm:u}}),h=We({inputs:{x:f},backend:t,attrs:{shape:l}}),g=nn({inputs:{x:h},backend:t,attrs:{begin:c,size:m}});return t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(h),g}var QE={kernelName:ia,backendName:\"cpu\",kernelFunc:nQ};function sQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,u=Nl(i,p,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,u)}var ZE={kernelName:Tn,backendName:\"cpu\",kernelFunc:sQ};function aQ(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e,s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,i=C.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return t.makeTensorInfo([i.length],\"int32\",Int32Array.from(i))}var JE={kernelName:ua,backendName:\"cpu\",kernelFunc:aQ};var iQ=Ie(Go,(r,e)=>{let t=e;return r>t.clipValueMax?t.clipValueMax:r{let{x:e}=r.inputs,t=r.backend,o=new Float32Array(y.sizeFromShape(e.shape)),n=t.data.get(e.dataId),s=n.complexTensorInfos.real,a=n.complexTensorInfos.imag,i=t.data.get(s.dataId).values,p=t.data.get(a.dataId).values;for(let u=0;uh.shape);C.assertParamsConsistent(a,s);let i=C.computeOutShape(e.map(h=>h.shape),s);if(y.sizeFromShape(i)===0)return t.makeTensorInfo(i,e[0].dtype,[]);let p=e.filter(h=>y.sizeFromShape(h.shape)>0);if(p.length===1)return fr({inputs:{x:p[0]},backend:t});if(p[0].dtype===\"complex64\"){let h=p.map(S=>tn({inputs:{input:S},backend:t})),g=p.map(S=>Ua({inputs:{input:S},backend:t})),x=Su({inputs:h,backend:t,attrs:{axis:s}}),b=Su({inputs:g,backend:t,attrs:{axis:s}}),w=qt({inputs:{real:x,imag:b},backend:t});return h.forEach(S=>t.disposeIntermediateTensorInfo(S)),g.forEach(S=>t.disposeIntermediateTensorInfo(S)),t.disposeIntermediateTensorInfo(x),t.disposeIntermediateTensorInfo(b),w}let u=p.map(h=>{let x=[-1,y.sizeFromShape(h.shape.slice(s))];return We({inputs:{x:h},backend:t,attrs:{shape:x}})}),l=u.map(h=>({vals:t.data.get(h.dataId).values,shape:h.shape}));i=C.computeOutShape(u.map(h=>h.shape),1);let c=u[0].shape[0]===1,m=mp(l,i,e[0].dtype,c),d=C.computeOutShape(p.map(h=>h.shape),s),f=t.makeTensorInfo(d,e[0].dtype,m);return u.forEach(h=>t.disposeIntermediateTensorInfo(h)),f}var o$={kernelName:pa,backendName:\"cpu\",kernelFunc:Su};function AI(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=o;Q([n,s],\"conv2d\");let c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,s.shape,a,u,i,l,!1,c),d=m.filterHeight,f=m.filterWidth,h=m.dilationHeight,g=m.dilationWidth,x=m.padInfo.left,b=m.padInfo.top,w=m.dataFormat===\"channelsLast\",S=new Ge(m.outShape,n.dtype),k=y.computeStrides(n.shape),T=y.computeStrides(s.shape),E=k[0],R=w?k[1]:k[2],D=w?k[2]:1,F=w?1:k[1],O=S.strides[0],M=w?S.strides[1]:S.strides[2],L=w?S.strides[2]:1,B=w?1:S.strides[1],z=t.data.get(n.dataId).values,U=t.data.get(s.dataId).values,j=S.values;for(let q=0;q=m.inHeight)continue;let me=oe*T[0],be=Y+ue*R;for(let _e=0;_e=m.inWidth)continue;let ct=me+Pe*T[1],Ke=be+at*D,mt=ct;for(let ut=0;ut=u.inDepth)continue;let q=U*D[0],Y=O+j*R[1];for(let J=0;J=u.inHeight)continue;let ue=q+ee*D[1],me=Y+oe*R[2];for(let be=0;be=u.inWidth)continue;let at=ue+Fe*D[2],ct=me+Pe*u.inChannels,Ke=at;for(let mt=0;mtMath.cos(r)),l$={kernelName:An,backendName:\"cpu\",kernelFunc:fQ};var hQ=Ie(Fn,r=>Math.cosh(r)),c$={kernelName:Fn,backendName:\"cpu\",kernelFunc:hQ};function gQ(r){let{inputs:e,backend:t,attrs:o}=r,{image:n,boxes:s,boxInd:a}=e,{cropSize:i,method:p,extrapolationValue:u}=o,[l,c,m,d]=n.shape,f=s.shape[0],[h,g]=i,x=ie([f,h,g,d],\"float32\"),b=t.data.get(s.dataId).values,w=t.data.get(a.dataId).values,S=t.data.get(n.dataId).values,k=y.computeStrides(n.shape),T=y.computeStrides(x.shape);for(let E=0;E=l)continue;let B=h>1?(O-D)*(c-1)/(h-1):0,z=g>1?(M-F)*(m-1)/(g-1):0;for(let U=0;U1?D*(c-1)+U*B:.5*(D+O)*(c-1);if(j<0||j>c-1){for(let q=0;q1?F*(m-1)+re*z:.5*(F+M)*(m-1);if(ne<0||ne>m-1){for(let me=0;me1?F*(m-1)+q*z:.5*(F+M)*(m-1);if(Y<0||Y>m-1){for(let ne=0;nex+f-b-1:(x,b)=>x+b;for(let x=0;xx+f-b-1:(x,b)=>x+b;for(let x=0;x`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`);let i=n.shape[0],p=n.shape[1],u=n.shape[2],l=n.shape[3],c=p*s,m=u*s,d=l/(s*s),f=t.data.get(n.dataId).values,h=new Float32Array(i*c*m*d),g=0;for(let x=0;x`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${m}'`);let d=C.computeConv2DInfo(n.shape,s.shape,a,m,i,u,!0),{filterHeight:f,filterWidth:h,dilationHeight:g,dilationWidth:x,padInfo:b}=d,w=b.left,S=b.top,k=d.outChannels/d.inChannels,T=new Ge(d.outShape,n.dtype),E=t.data.get(n.dataId).values,R=t.data.get(s.dataId).values,D=T.values;for(let F=0;F=d.inHeight)continue;let q=U*c[0],Y=O+j*l[1];for(let J=0;J=d.inWidth)continue;let ue=q+ee*c[1],me=Y+oe*d.inChannels,be=re,_e=ue;for(let ve=0;ve{let{x:o,filter:n}=r,{strides:s,pad:a,dilations:i}=t,p=e,u=p.data.get(o.dataId).values,l=o.shape.length,c=p.data.get(n.dataId).values,m=n.shape.length,{batchSize:d,inHeight:f,inWidth:h,inChannels:g,outHeight:x,outWidth:b,padInfo:w,strideHeight:S,strideWidth:k,filterHeight:T,filterWidth:E,dilationHeight:R,dilationWidth:D,outShape:F}=C.computeDilation2DInfo(o.shape,n.shape,s,a,\"NHWC\",i),O=y.sizeFromShape(F),M=F.length,L=y.getArrayFromDType(o.dtype,O);for(let z=0;z=0&&oe=0&&mere&&(re=ve)}}}let ne=y.locToIndex([z,U,q,J],M,y.computeStrides(F));L[ne]=re}}}return{dataId:p.write(y.toTypedArray(L,o.dtype),F,o.dtype),shape:F,dtype:o.dtype}}};var S$={kernelName:qi,backendName:\"cpu\",kernelFunc:({inputs:r,backend:e,attrs:t})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=t,u=e,l=y.toNestedArray(o.shape,u.data.get(o.dataId).values),c=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:w,strideWidth:S,filterHeight:k,filterWidth:T,dilationHeight:E,dilationWidth:R,outShape:D}=C.computeDilation2DInfo(o.shape,n.shape,a,i,\"NHWC\",p);y.assert(s.rank===D.length,()=>`Error in ${qi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let F=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(n.shape,n.dtype);for(let L=0;L=0&&ee=0&&ueY&&(Y=me,J=ne,re=oe)}}}O[J][re][q]+=F[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}};var I$={kernelName:Ki,backendName:\"cpu\",kernelFunc:({inputs:r,backend:e,attrs:t})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=t,u=e,l=y.toNestedArray(o.shape,u.data.get(o.dataId).values),c=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:w,strideWidth:S,filterHeight:k,filterWidth:T,dilationHeight:E,dilationWidth:R,outShape:D}=C.computeDilation2DInfo(o.shape,n.shape,a,i,\"NHWC\",p);y.assert(s.rank===D.length,()=>`Error in ${Ki}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let F=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(o.shape,o.dtype);for(let L=0;L=0&&ee=0&&ueY&&(Y=me,J=ee,re=ue)}}}O[L][J][re][q]+=F[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),o.shape,o.dtype),shape:o.shape,dtype:o.dtype}}};function vQ(r){let{inputs:e,backend:t,attrs:o}=r,{image:n}=e,{canvas:s,options:a}=o,{contextOptions:i,imageOptions:p}=a||{},u=(p==null?void 0:p.alpha)||1,l=(i==null?void 0:i.contextType)||\"2d\";if(l!==\"2d\")throw new Error(`Context type ${i.contextType} is not supported by the CPU backend.`);let c=s.getContext(l,(i==null?void 0:i.contextAttributes)||{});if(c==null)throw new Error(`Could not get the context with ${l} type.`);let[m,d]=n.shape.slice(0,2),f=n.shape.length===2?1:n.shape[2],h=t.data.get(n.dataId).values,g=n.dtype===\"float32\"?255:1,x=new Uint8ClampedArray(d*m*4);for(let w=0;w1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${E}.`)}else if(n.dtype===\"int32\"&&(E<0||E>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${E}.`);f===1?(S[0]=E*g,S[1]=E*g,S[2]=E*g):S[T]=E*g}let k=w*4;x[k+0]=Math.round(S[0]),x[k+1]=Math.round(S[1]),x[k+2]=Math.round(S[2]),x[k+3]=Math.round(S[3])}s.width=d,s.height=m;let b=new ImageData(x,d,m);return c.putImageData(b,0,0),n}var v$={kernelName:Mu,backendName:\"cpu\",kernelFunc:vQ};function Ii(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;Q(n,\"sum\");let i;n.dtype===\"bool\"?i=rn({inputs:{x:n},backend:t,attrs:{dtype:\"int32\"}}):i=fr({inputs:{x:n},backend:t});let p=i.shape.length,u=y.parseAxisParam(s,i.shape),l=C.getAxesPermutation(u,p),c=u,m=i;l!=null&&(m=vt({inputs:{x:i},backend:t,attrs:{perm:l}}),c=C.getInnerMostAxes(c.length,p)),C.assertAxesAreInnerMostDims(\"sum\",c,m.shape.length);let[d,f]=C.computeOutAndReduceShapes(m.shape,c),h=C.upcastType(m.dtype,\"int32\"),g=vl(t,d,h),x=y.sizeFromShape(f),b=t.data.get(g.dataId).values,w=t.data.get(m.dataId).values;for(let S=0;S=0&&(m=Ii({inputs:{x:m},backend:t,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&t.disposeIntermediateTensorInfo(h);return m}var N$={kernelName:ji,backendName:\"cpu\",kernelFunc:kQ};function NQ(r){let{inputs:e,backend:t}=r,{dy:o,y:n}=e;Q([o,n],\"eluGrad\");let s=new Float32Array(y.sizeFromShape(n.shape)),a=t.data.get(n.dataId).values,i=t.data.get(o.dataId).values;for(let p=0;p=0?s[p]=i[p]:s[p]=i[p]*(u+1)}return t.makeTensorInfo(n.shape,\"float32\",s)}var T$={kernelName:ri,backendName:\"cpu\",kernelFunc:NQ};var TQ=C.ERF_P,_Q=C.ERF_A1,EQ=C.ERF_A2,$Q=C.ERF_A3,RQ=C.ERF_A4,DQ=C.ERF_A5,AQ=Ie(Un,r=>{let e=Math.sign(r),t=Math.abs(r),o=1/(1+TQ*t);return e*(1-((((DQ*o+RQ)*o+$Q)*o+EQ)*o+_Q)*o*Math.exp(-t*t))}),_$={kernelName:Un,backendName:\"cpu\",kernelFunc:AQ};function $l(r){let{inputs:e,backend:t,attrs:o}=r,{input:n}=e,{dim:s}=o,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),We({inputs:{x:n},backend:t,attrs:{shape:i}})}var E$={kernelName:ma,backendName:\"cpu\",kernelFunc:$l};var FQ=Ve((r,e)=>r/e),Yc=Qe(Vn,FQ),Qc={kernelName:Vn,backendName:\"cpu\",kernelFunc:Yc};function Zf(r,e,t){let o=r.shape,n=o[0],s=o[1],a=t.data.get(r.dataId),i=a.complexTensorInfos.real,p=a.complexTensorInfos.imag,u=[n,s],l=y.sizeFromShape(u),c=y.getTypedArrayFromDType(\"float32\",l),m=y.getTypedArrayFromDType(\"float32\",l);for(let g=0;g{let{image:o}=r,n=t,s=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[a,i,p,u]=o.shape,l=n.data.get(o.dataId).values;for(let m=0;m=0&&w=0,()=>`GatherV2: the index value ${k} is not in [0, ${l-1}]`)}let c=i;i==null&&(c=0);let m=y.sizeFromShape(s.shape),d=C.segment_util.collectGatherOpShapeInfo(n,s,p,c),f=We({inputs:{x:n},backend:t,attrs:{shape:[d.batchSize,d.outerSize,d.dimSize,d.sliceSize]}}),h=We({inputs:{x:s},backend:t,attrs:{shape:[d.batchSize,m/d.batchSize]}}),g=[d.batchSize,d.outerSize,m/d.batchSize,d.sliceSize],x=t.bufferSync(h),b=t.bufferSync(f),w=Lf(b,x,g);return t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(h),t.makeTensorInfo(d.outputShape,w.dtype,w.values)}var O$={kernelName:fa,backendName:\"cpu\",kernelFunc:UQ};function GQ(r){let{inputs:e,backend:t}=r,{input:o}=e,n=y.sizeFromShape(o.shape),s=o.shape[o.shape.length-1],a=n/s,i=We({inputs:{x:o},backend:t,attrs:{shape:[a,s]}}),p=Zf(i,!0,t),u=We({inputs:{x:p},backend:t,attrs:{shape:o.shape}});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(p),u}var M$={kernelName:Yi,backendName:\"cpu\",kernelFunc:GQ};var HQ=Ie(qn,r=>Number.isFinite(r)?1:0,\"bool\"),L$={kernelName:qn,backendName:\"cpu\",kernelFunc:HQ};var KQ=Ie(jn,r=>Math.abs(r)===1/0?1:0,\"bool\"),B$={kernelName:jn,backendName:\"cpu\",kernelFunc:KQ};var qQ=Ie(Xn,r=>Number.isNaN(r)?1:0,\"bool\"),z$={kernelName:Xn,backendName:\"cpu\",kernelFunc:qQ};function jQ(r){let{backend:e,attrs:t}=r,{start:o,stop:n,num:s}=t,a=Bf(o,n,s);return e.makeTensorInfo([a.length],\"float32\",a)}var V$={kernelName:Qn,backendName:\"cpu\",kernelFunc:jQ};var XQ=Ie(Zn,r=>Math.log1p(r)),W$={kernelName:Zn,backendName:\"cpu\",kernelFunc:XQ};var YQ=Ve((r,e)=>r&&e),QQ=Qe(Jn,YQ,null,\"bool\"),U$={kernelName:Jn,backendName:\"cpu\",kernelFunc:QQ};var ZQ=Ie(es,r=>r?0:1,\"bool\"),G$={kernelName:es,backendName:\"cpu\",kernelFunc:ZQ};var JQ=Ve((r,e)=>r||e),eZ=Qe(ts,JQ,null,\"bool\"),H$={kernelName:ts,backendName:\"cpu\",kernelFunc:eZ};function tZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o;Q(n,\"LRN\");let u=n.shape[3],l=u-1,c=t.data.get(n.dataId).values,m=y.sizeFromShape(n.shape),d=new Float32Array(m);function f(h){let g=h%u,x=h-g+Math.max(0,g-s),b=h-g+Math.min(g+s,l),w=0;for(;x<=b;x++){let S=c[x];w+=S*S}return w}for(let h=0;h`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p),c;if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))c=fr({inputs:{x:n},backend:t});else{let m=t.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=El(m,n.shape,n.dtype,d,l,\"max\");c=t.makeTensorInfo(l.outShape,n.dtype,f.values)}return c}var X$={kernelName:ns,backendName:\"cpu\",kernelFunc:oZ};function nZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,\"maxPool3d\");let l=C.computePool3DInfo(n.shape,s,a,1,i,p,u),c=t.data.get(n.dataId).values,m=Qf(c,n.shape,n.dtype,y.computeStrides(n.shape),l,\"max\");return t.makeTensorInfo(m.shape,\"float32\",m.values)}var Y$={kernelName:ha,backendName:\"cpu\",kernelFunc:nZ};function sZ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],\"maxPool3DGrad\");let l=C.computePool3DInfo(s.shape,a,i,1,p,u),c=t.bufferSync(s),m=HE(c,l),d=l.strideDepth,f=l.strideHeight,h=l.strideWidth,g=l.dilationDepth,x=l.dilationHeight,b=l.dilationWidth,w=l.effectiveFilterDepth,S=l.effectiveFilterHeight,k=l.effectiveFilterWidth,T=w-1-l.padInfo.front,E=k-1-l.padInfo.left,R=S-1-l.padInfo.top,D=ie(s.shape,\"float32\"),F=t.bufferSync(n);for(let O=0;O=l.outDepth||Math.floor(re)!==re))for(let ne=0;ne=l.outHeight||Math.floor(ee)!==ee))for(let oe=0;oe=l.outWidth||Math.floor(ue)!==ue)continue;let me=w*S*k-1-m.get(O,re,ee,ue,M),be=J*S*k+ne*k+oe,_e=me===be?1:0;if(_e===0)continue;let ve=F.get(O,re,ee,ue,M);Y+=ve*_e}}}D.set(Y,O,L,B,z,M)}return t.makeTensorInfo(D.shape,D.dtype,D.values)}var Q$={kernelName:Ji,backendName:\"cpu\",kernelFunc:sZ};function aZ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s,output:a}=e,i=s;Q([s,a],\"maxPoolGrad\");let{filterSize:p,strides:u,pad:l,dimRoundingMode:c}=o,m=C.computePool2DInfo(i.shape,p,u,1,l,c),d=t.data.get(i.dataId).values,f=ie(m.outShape,i.dtype,Yf(d,i.shape,i.dtype,m).values),h=m.strideHeight,g=m.strideWidth,x=m.dilationHeight,b=m.dilationWidth,w=m.effectiveFilterHeight,S=m.effectiveFilterWidth,k=S-1-m.padInfo.left,T=w-1-m.padInfo.top,E=ie(i.shape,\"float32\"),R=t.data.get(n.dataId).values,D=ie(n.shape,\"float32\",R);for(let F=0;F=m.outHeight||Math.floor(q)!==q))for(let Y=0;Y=m.outWidth||Math.floor(J)!==J)continue;let re=w*S-1-f.get(F,q,J,O),ne=j*S+Y,ee=re===ne?1:0;if(ee===0)continue;let oe=D.get(F,q,J,O);U+=oe*ee}}E.set(U,F,M,L,O)}return t.makeTensorInfo(E.shape,E.dtype,E.values)}var Z$={kernelName:Zi,backendName:\"cpu\",kernelFunc:aZ};function J$(r,e,t,o,n){let s=y.computeStrides(e),a=El(r,e,t,s,n,\"max\"),i=Yf(r,e,t,n,!0,o);return[a.values,i.values]}var eR={kernelName:ga,backendName:\"cpu\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=e,p=t;Q(o,\"MaxPoolWithArgmax\");let u=p.data.get(o.dataId).values,l=C.computePool2DInfo(o.shape,n,s,[1,1],a),[c,m]=J$(u,o.shape,o.dtype,i,l),d=p.write(c,l.outShape,o.dtype),f=p.write(m,l.outShape,o.dtype);return[{dataId:d,shape:l.outShape,dtype:o.dtype},{dataId:f,shape:l.outShape,dtype:\"int32\"}]}};function iZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=y.parseAxisParam(s,n.shape),u=C.computeOutAndReduceShapes(n.shape,i)[1],l=y.sizeFromShape(u),c=[],m=t.makeTensorInfo([],\"float32\",new Float32Array([l]));c.push(m);let d=rn({inputs:{x:n},backend:t,attrs:{dtype:\"float32\"}});c.push(d);let f=Yc({inputs:{a:d,b:m},backend:t});c.push(f);let h=Ii({inputs:{x:f},backend:t,attrs:{axis:s,keepDims:a}});return c.forEach(g=>t.disposeIntermediateTensorInfo(g)),h}var tR={kernelName:ss,backendName:\"cpu\",kernelFunc:iZ};function uZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;Q(n,\"min\");let i=y.parseAxisParam(s,n.shape),p=i,u=C.getAxesPermutation(p,n.shape.length),l=n;u!=null&&(l=vt({inputs:{x:n},backend:t,attrs:{perm:u}}),p=C.getInnerMostAxes(p.length,n.shape.length)),C.assertAxesAreInnerMostDims(\"min\",p,l.shape.length);let[c,m]=C.computeOutAndReduceShapes(l.shape,p),d=y.sizeFromShape(m),f=y.makeZerosTypedArray(y.sizeFromShape(c),l.dtype),h=t.data.get(l.dataId).values;for(let x=0;xw[0]+n.shape[S]+w[1]),p=s.map(w=>w[0]),u=s.map((w,S)=>w[0]+n.shape[S]),l=a===\"reflect\"?0:1,c=t.data.get(n.dataId).values,m=n.shape.length,d=y.computeStrides(n.shape),f=y.sizeFromShape(i),h=i.length,g=y.computeStrides(i),x=y.getTypedArrayFromDType(n.dtype,f);for(let w=0;w=u[T]&&(S[T]=(u[T]-1)*2-S[T]+l);S=S.map((T,E)=>T-p[E]);let k=y.locToIndex(S,m,d);x[w]=c[k]}return{dataId:t.write(x,i,n.dtype),shape:i,dtype:n.dtype}}var oR={kernelName:is,backendName:\"cpu\",kernelFunc:pZ};var lZ=Ve((r,e)=>{let t=r%e;return r<0&&e<0||r>=0&&e>=0?t:(t+e)%e}),cZ=Qe(us,lZ),nR={kernelName:us,backendName:\"cpu\",kernelFunc:cZ};var aR=Kp(iS());function MI(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{dim:s}=o,a=n.shape.length,i=s;if(i===-1&&(i=a-1),i!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${i}`);let p=y.parseAxisParam([i],n.shape),u=OI({inputs:{x:n},backend:t,attrs:{reductionIndices:p,keepDims:!1}}),l=C.expandShapeToKeepDim(u.shape,p),c=We({inputs:{x:u},backend:t,attrs:{shape:l}}),m=jc({inputs:{a:n,b:c},backend:t}),d=aI({inputs:{x:m},backend:t}),f=Ii({inputs:{x:d},backend:t,attrs:{axis:p,keepDims:!1}}),h=We({inputs:{x:f},backend:t,attrs:{shape:l}}),g=Yc({inputs:{a:d,b:h},backend:t});return t.disposeIntermediateTensorInfo(u),t.disposeIntermediateTensorInfo(c),t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(h),g}var sR={kernelName:Fs,backendName:\"cpu\",kernelFunc:MI};function mZ(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o;Q(n,\"multinomial\");let p=i?n:MI({inputs:{logits:n},backend:t,attrs:{dim:-1}}),u=p.shape[0],l=p.shape[1],c=t.data.get(p.dataId).values,m=[u,s],d=y.makeZerosTypedArray(y.sizeFromShape(m),\"int32\");for(let f=0;f=0&&c[m]{y.assertShapesMatch(s,l.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===l.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=e.map(l=>{let c=$l({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=Su({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeIntermediateTensorInfo(l)),u}var hR={kernelName:ya,backendName:\"cpu\",kernelFunc:LI};function CZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{paddings:s,constantValue:a}=o;Q(n,\"pad\");let i=s.map((b,w)=>b[0]+n.shape[w]+b[1]),p=s.map(b=>b[0]),u=t.data.get(n.dataId).values,l=y.sizeFromShape(n.shape),c=n.shape.length,m=y.computeStrides(n.shape),d=y.sizeFromShape(i),f=i.length,h=y.computeStrides(i),g=y.getTypedArrayFromDType(n.dtype,d);a!==0&&g.fill(a);for(let b=0;bT+p[E]),k=y.locToIndex(S,f,h);g[k]=u[b]}return{dataId:t.write(g,i,n.dtype),shape:i,dtype:n.dtype}}var Jf={kernelName:fs,backendName:\"cpu\",kernelFunc:CZ};var wZ=Ve((r,e)=>Math.pow(r,e)),SZ=Qe(hs,wZ),gR={kernelName:hs,backendName:\"cpu\",kernelFunc:SZ};function IZ(r){let{inputs:e,backend:t,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=e,{outputRaggedRank:i}=o,p=n.map(x=>t.data.get(x.dataId).values),u=n.map(x=>x.shape),l=t.data.get(s.dataId).values,c=t.data.get(a.dataId).values,[m,d,f]=Vf(p,u,l,s.shape,s.dtype,c,a.shape,i),h=m.map(x=>t.makeTensorInfo([x.length],\"int32\",x)),g=t.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var xR={kernelName:Qp,backendName:\"cpu\",kernelFunc:IZ};function vZ(r){let{inputs:e,backend:t}=r,{starts:o,limits:n,deltas:s}=e,a=t.data.get(o.dataId).values,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,[u,l]=Wf(a,o.shape,o.dtype,i,n.shape,p,s.shape),c=t.makeTensorInfo([u.length],\"int32\",u),m=t.makeTensorInfo([l.length],o.dtype,l);return[c,m]}var yR={kernelName:Zp,backendName:\"cpu\",kernelFunc:vZ};function kZ(r){let{inputs:e,backend:t,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=e,{rowPartitionTypes:p}=o,u=t.data.get(n.dataId).values,l=t.data.get(s.dataId).values,c=t.data.get(a.dataId).values,m=i.map(g=>t.data.get(g.dataId).values),d=i.map(g=>g.shape),[f,h]=Uf(u,n.shape,l,s.shape,s.dtype,c,a.shape,m,d,p);return t.makeTensorInfo(f,s.dtype,h)}var bR={kernelName:Jp,backendName:\"cpu\",kernelFunc:kZ};function NZ(r){let{backend:e,attrs:t}=r,{start:o,stop:n,dtype:s,step:a}=t,i=fp(o,n,a,s);return e.makeTensorInfo([i.length],s,i)}var CR={kernelName:ba,backendName:\"cpu\",kernelFunc:NZ};var TZ=Ie(xs,r=>1/r),wR={kernelName:xs,backendName:\"cpu\",kernelFunc:TZ};function _Z(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o;Q(n,\"resizeBilinear\");let p=y.computeStrides(n.shape),[u,l]=i,[c,m,d,f]=n.shape,h=t.data.get(n.dataId).values,g=new Float32Array(y.sizeFromShape([c,u,l,f])),x=[s&&u>1?m-1:m,s&&l>1?d-1:d],b=[s&&u>1?u-1:u,s&&l>1?l-1:l],w=0,S=x[0]/b[0],k=x[1]/b[1];for(let T=0;T1?u-1:u,a&&d>1?l-1:l],g=[a&&m>1?m-1:m,a&&d>1?d-1:d],x=h[0]/g[0],b=h[1]/g[1],w=t.data.get(s.dataId).values,S=0;for(let k=0;k1?m-1:m,s&&l>1?d-1:d],b=[s&&u>1?u-1:u,s&&l>1?l-1:l],w=x[0]/b[0],S=x[1]/b[1],k=0;for(let T=0;T1?l-1:l,a&&f>1?c-1:c],b=[a&&d>1?d-1:d,a&&f>1?f-1:f],w=x[0]/b[0],S=x[1]/b[1],k=1/w,T=1/S,E=Math.ceil(k)*2+2,R=Math.ceil(T)*2+2;for(let D=0;D=d)continue;let ee=F+ne*p[1],oe=ne*w,ue=Math.min(l-1,a?Math.round(oe):Math.floor(oe));if(O===ue)for(let me=0;me=f)continue;let _e=ee+be*p[2],ve=be*S,Fe=Math.min(c-1,a?Math.round(ve):Math.floor(ve));z===Fe&&(J+=g[_e+Y])}}h[U+Y]=J}}}}return t.makeTensorInfo(n.shape,n.dtype,h)}var kR={kernelName:ai,backendName:\"cpu\",kernelFunc:RZ};function DZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o;Q(n,\"reverse\");let a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return fr({inputs:{x:n},backend:t});let p=new Ge(n.shape,n.dtype),u=t.bufferSync(n);for(let l=0;lm[d]=n.shape[d]-1-m[d]),p.set(u.get(...m),...c)}return t.makeTensorInfo(p.shape,p.dtype,p.values)}var NR={kernelName:Ss,backendName:\"cpu\",kernelFunc:DZ};var TR={kernelName:Vs,backendName:\"cpu\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=e,i=t,p=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[u,l,c,m]=o.shape,[d,f]=C.getImageCenter(a,l,c),h=255,g=Math.sin(n),x=Math.cos(n),b=i.data.get(o.dataId).values;for(let S=0;S=0&&B=0&&z{let e=Math.floor(r);return r-e<.5?Math.floor(r):r-e>.5?Math.ceil(r):e%2===0?e:e+1}),_R={kernelName:Is,backendName:\"cpu\",kernelFunc:AZ};function FZ(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(s,n,a),m=!0,d=t.bufferSync(n),f=t.bufferSync(s),h=Xs(d,f,a,c,u,p,i,l,0,m);return t.makeTensorInfo(a,h.dtype,h.values)}var ER={kernelName:vs,backendName:\"cpu\",kernelFunc:FZ};function PZ(r,e){let t=0,o=r.length,n=0;for(;t1||n.shape.length===1?1:y.sizeFromShape(n.shape.slice(1));for(let f=0;fr>=0?zZ*r:BZ*(Math.exp(r)-1)),AR={kernelName:Ts,backendName:\"cpu\",kernelFunc:VZ};var WZ=Ie(Rs,r=>r<0?-1:r>0?1:0),FR={kernelName:Rs,backendName:\"cpu\",kernelFunc:WZ};var UZ=Ie(Es,r=>Math.sin(r)),PR={kernelName:Es,backendName:\"cpu\",kernelFunc:UZ};var GZ=Ie($s,r=>Math.sinh(r)),OR={kernelName:$s,backendName:\"cpu\",kernelFunc:GZ};var HZ=11920928955078125e-23,MR=Math.log(HZ)+2,KZ=Ie(Ds,r=>{let e=r>-MR,t=rNumber(g)))),t.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var zR={kernelName:eu,backendName:\"cpu\",kernelFunc:jZ};function XZ(r){let{inputs:e,backend:t}=r,{inputIndices:o,inputShape:n,newShape:s}=e;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape\n ${o.shape}`);if(n.shape.length!==1)throw new Error(`Input shape should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(t.data.get(n.dataId).values),i=t.data.get(o.dataId).values,p=Array.from(t.data.get(s.dataId).values),[u,l,c]=Hf(i,o.shape,o.dtype,a,p);return[t.makeTensorInfo(l,o.dtype,u),t.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var VR={kernelName:ui,backendName:\"cpu\",kernelFunc:XZ};function YZ(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error(\"segmentIds and indices should have same size.\");let a=t.data.get(o.dataId).values,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,[u,l]=_l(a,o.shape,o.dtype,i,p,!0);return t.makeTensorInfo(l,o.dtype,u)}var WR={kernelName:va,backendName:\"cpu\",kernelFunc:YZ};function QZ(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error(\"segmentIds and indices should have same size.\");let a=t.data.get(o.dataId).values,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,[u,l]=_l(a,o.shape,o.dtype,i,p);return t.makeTensorInfo(l,o.dtype,u)}var UR={kernelName:ka,backendName:\"cpu\",kernelFunc:QZ};function ZZ(r){let{inputs:e,backend:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=C.calculateShapes(s,n,i),d=!1,f=t.bufferSync(n),h;switch(s.dtype){case\"bool\":{let g=t.bufferSync(s),x=!!t.data.get(a.dataId).values[0];h=Xs(f,g,i,m,l,u,p,c,x,d);break}case\"float32\":{let g=t.bufferSync(s),x=t.data.get(a.dataId).values[0];h=Xs(f,g,i,m,l,u,p,c,x,d);break}case\"int32\":{let g=t.bufferSync(s),x=t.data.get(a.dataId).values[0];h=Xs(f,g,i,m,l,u,p,c,x,d);break}case\"string\":{let g=t.bufferSync(s),x=y.decodeString(t.data.get(a.dataId).values[0]);h=Xs(f,g,i,m,l,u,p,c,x,d);break}default:throw new Error(`Unsupported type ${s.dtype}`)}return t.makeTensorInfo(i,h.dtype,h.values)}var GR={kernelName:Ps,backendName:\"cpu\",kernelFunc:ZZ};function JZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),l=n.shape.slice();return p.map(c=>{let m=[...l];m[i]=c;let d=nn({inputs:{x:n},backend:t,attrs:{begin:u,size:m}});return u[i]+=c,d})}var HR={kernelName:Ia,backendName:\"cpu\",kernelFunc:JZ};var KR={kernelName:tu,backendName:\"cpu\",kernelFunc:({inputs:r,backend:e})=>{let{x:t}=r,o=e;Q(t,\"square\");let n=o.data.get(t.dataId).values,s=new Float32Array(n.length);for(let i=0;i{let t=e;return isNaN(r)?NaN:r>0?1:t.alpha}),qR={kernelName:Ko,backendName:\"cpu\",kernelFunc:e9};function t9(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o;Q(n,\"stridedSlice\");let{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=We({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let T=nt.computeOutShape(b,w,S),E=nn({inputs:{x:n},backend:t,attrs:{begin:b,size:T}});k=We({inputs:{x:E},backend:t,attrs:{shape:f}}),t.disposeIntermediateTensorInfo(E)}else{let T=t.bufferSync(n),E=Kf(d,T,S,b);k=t.makeTensorInfo(f,E.dtype,E.values)}return k}var jR={kernelName:Os,backendName:\"cpu\",kernelFunc:t9};function r9(r){let{inputs:e,backend:t,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:l,dataSplits:c}=e,m=t.data.get(l.dataId).values,d=t.data.get(c.dataId).values,[f,h]=gp(m,d,n,s,a,i,p,u);return[t.makeTensorInfo([f.length],\"string\",f),t.makeTensorInfo(c.shape,\"int32\",h)]}var XR={kernelName:Na,backendName:\"cpu\",kernelFunc:r9};function o9(r){let{inputs:e,backend:t,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=e;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=t.data.get(s.dataId).values,p=t.data.get(a.dataId).values[0],[u,l,c]=xp(i,p,n),m=l.length;return[t.makeTensorInfo([m,2],\"int32\",u),t.makeTensorInfo([m],\"string\",l),t.makeTensorInfo([2],\"int32\",new Int32Array(c))]}var YR={kernelName:ru,backendName:\"cpu\",kernelFunc:o9};function n9(r){let{inputs:e,backend:t,attrs:o}=r,{numBuckets:n}=o,{input:s}=e;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(n<=0)throw new Error(\"Number of buckets must be at least 1\");let a=t.data.get(s.dataId).values,i=yp(a,n);return t.makeTensorInfo(s.shape,\"int32\",i)}var QR={kernelName:ou,backendName:\"cpu\",kernelFunc:n9};var s9=Ie(Ms,r=>Math.tan(r)),ZR={kernelName:Ms,backendName:\"cpu\",kernelFunc:s9};var a9=Ie(Ls,r=>Math.tanh(r)),JR={kernelName:Ls,backendName:\"cpu\",kernelFunc:a9};function i9(r){let{inputs:e,backend:t}=r,{tensor:o,indices:n,updates:s}=e,{sliceRank:a,numUpdates:i,sliceSize:p,strides:u,outputSize:l}=C.calculateShapes(s,n,o.shape),c=!1,m=t.bufferSync(n),d=t.bufferSync(s),f=t.bufferSync(o),h=Xs(m,d,o.shape,l,p,i,a,u,f,c);return t.makeTensorInfo(o.shape,h.dtype,h.values)}var eD={kernelName:ks,backendName:\"cpu\",kernelFunc:i9};function u9(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{reps:s}=o;Q(n,\"tile\");let a=qf(t.bufferSync(n),s);return t.makeTensorInfo(a.shape,a.dtype,a.values)}var tD={kernelName:Mo,backendName:\"cpu\",kernelFunc:u9};function p9(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{k:s,sorted:a}=o;Q(n,\"topk\");let i=t.data.get(n.dataId).values,[p,u]=jf(i,n.shape,n.dtype,s,a);return[t.makeTensorInfo(p.shape,p.dtype,p.values),t.makeTensorInfo(u.shape,u.dtype,u.values)]}var rD={kernelName:Bs,backendName:\"cpu\",kernelFunc:p9};function l9(r){let{inputs:e,attrs:t,backend:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=t,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=y.computeStrides(n.shape),b=x[0],w=x[1],S=x[2],k=y.computeStrides(g),T=k[0],E=k[1],R=k[2],D=y.getTypedArrayFromDType(n.dtype,y.sizeFromShape(g));D.fill(p);let F=o.data.get(n.dataId).values,O=o.data.get(s.dataId).values;for(let L=0;Le-1)if(e<=1)t=0;else{let o=2*e;t-=o*Math.trunc(t/o),t>=e&&(t=o-t-1)}return y.clamp(0,t,e-1)}function m9(r,e){let t=r;if(t<0)if(e<=1)t=0;else{let o=e-1;t+=e*(Math.trunc(-t/o)+1)}else if(t>e-1)if(e<=1)t=0;else{let o=e-1;t-=e*Math.trunc(t/o)}return y.clamp(0,t,e-1)}function d9(r,e){return r}function f9(r,e){return y.clamp(0,r,e-1)}function em(r,e,t,o,n,s,a,i,p,u,l){let c=a*o+i*n+p*s+u;return 0<=i&&it.disposeIntermediateTensorInfo(f)),d}var iD={kernelName:su,backendName:\"cpu\",kernelFunc:b9};var C9=[DE,z_,AE,FE,H_,PE,OE,ME,LE,BE,zE,VE,WE,UE,GE,KE,qE,jE,XE,RE,YE,QE,ZE,K_,JE,G_,q_,e$,V_,t$,o$,n$,s$,a$,i$,u$,p$,l$,c$,m$,d$,f$,h$,g$,x$,y$,b$,C$,w$,S$,I$,v$,N$,kE,T$,j_,_$,X_,E$,Y_,$$,R$,D$,Q_,Z_,A$,F$,P$,O$,J_,eE,W_,M$,r$,L$,B$,z$,NE,tE,rE,V$,oE,W$,U$,G$,H$,K$,q$,j$,nE,X$,Y$,Q$,Z$,eR,tR,rR,sE,oR,nR,iR,aE,iE,uR,pR,lR,uE,cR,fR,hR,Jf,gR,TE,lE,xR,yR,bR,CR,U_,Qc,wR,_E,EE,$E,SR,IR,vR,kR,NR,TR,_R,hE,ER,RR,DR,AR,xE,FR,PR,OR,yE,sR,LR,BR,zR,VR,WR,UR,GR,HR,CE,KR,wE,SE,qR,jR,XR,YR,QR,IE,k$,ZR,JR,eD,tD,rD,nD,pE,sD,aD,iD,mR];for(let r of C9)li(r);var Fl={};qe(Fl,{assertNotComplex:()=>Ys,bindCanvasToFramebuffer:()=>E9,bindColorTextureToFramebuffer:()=>nm,bindTextureToProgramUniformSampler:()=>e0,bindTextureUnit:()=>cD,bindVertexBufferToProgramAttribute:()=>sh,callAndCheck:()=>ce,canBeRepresented:()=>WI,createFragmentShader:()=>GI,createFramebuffer:()=>QI,createProgram:()=>HI,createStaticIndexBuffer:()=>jI,createStaticVertexBuffer:()=>qI,createTexture:()=>XI,createVertexShader:()=>UI,getBatchDim:()=>ki,getExtensionOrThrow:()=>Rl,getFramebufferErrorMessage:()=>mD,getMaxTexturesInShader:()=>o0,getNumChannels:()=>T9,getProgramUniformLocation:()=>JI,getProgramUniformLocationOrThrow:()=>ZI,getRowsCols:()=>Ni,getShapeAs3D:()=>Al,getTextureShapeFromLogicalShape:()=>t0,getWebGLDisjointQueryTimerVersion:()=>n0,getWebGLErrorMessage:()=>lD,getWebGLMaxTextureSize:()=>r0,hasExtension:()=>Jr,isCapableOfRenderingToFloatTexture:()=>s0,isDownloadFloatTextureEnabled:()=>a0,isReshapeFree:()=>vu,isWebGLFenceEnabled:()=>i0,isWebGLVersionEnabled:()=>ih,linkProgram:()=>KI,logShaderSourceAndInfoLog:()=>nh,resetMaxTextureSize:()=>$9,resetMaxTexturesInShader:()=>R9,unbindColorTextureFromFramebuffer:()=>ah,unbindTextureUnit:()=>_9,validateFramebuffer:()=>Dl,validateProgram:()=>om,validateTextureSize:()=>YI});var wp={},eh={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function BI(r,e){wp[r]=e}function Zr(r,e){if(!(r in wp)||e!=null){let o=S9(r,e);if(o!==null)wp[r]=o;else return console.log(\"Could not get context for WebGL version\",r),null}let t=wp[r];return t==null||t.isContextLost()?(delete wp[r],Zr(r)):(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),wp[r])}function w9(r){if(!A().getBool(\"IS_SAFARI\")&&typeof OffscreenCanvas!=\"undefined\"&&r===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 S9(r,e){if(r!==1&&r!==2)throw new Error(\"Cannot get WebGL rendering context, WebGL is disabled.\");let t=e==null?w9(r):e;return t.addEventListener(\"webglcontextlost\",o=>{o.preventDefault(),delete wp[r]},!1),A().getBool(\"SOFTWARE_WEBGL_ENABLED\")&&(eh.failIfMajorPerformanceCaveat=!1),r===1?t.getContext(\"webgl\",eh)||t.getContext(\"experimental-webgl\",eh):t.getContext(\"webgl2\",eh)}var Iu;(function(r){r[r.DENSE=0]=\"DENSE\",r[r.SHARED_BATCH=1]=\"SHARED_BATCH\"})(Iu||(Iu={}));var hr;(function(r){r[r.RENDER=0]=\"RENDER\",r[r.UPLOAD=1]=\"UPLOAD\",r[r.PIXELS=2]=\"PIXELS\",r[r.DOWNLOAD=3]=\"DOWNLOAD\"})(hr||(hr={}));var or;(function(r){r[r.UNPACKED_FLOAT16=0]=\"UNPACKED_FLOAT16\",r[r.UNPACKED_FLOAT32=1]=\"UNPACKED_FLOAT32\",r[r.PACKED_4X1_UNSIGNED_BYTE=2]=\"PACKED_4X1_UNSIGNED_BYTE\",r[r.PACKED_2X2_FLOAT32=3]=\"PACKED_2X2_FLOAT32\",r[r.PACKED_2X2_FLOAT16=4]=\"PACKED_2X2_FLOAT16\"})(or||(or={}));function Sp(r,e){return[e,r]}function uD(r,e){return r*e}function tm(r){let e=y.sizeFromShape(r),t=Math.ceil(e/4);return y.sizeToSquarishShape(t)}function Ga(r,e){return[Math.max(1,Math.ceil(e/2)),Math.max(1,Math.ceil(r/2))]}function pD(r,e){let[t,o]=Ga(r,e);return t*o*4}function rm(r,e){let t=r,o,n,s,a,i,p,u,l,c,m;return A().getNumber(\"WEBGL_VERSION\")===2?(o=t.R32F,n=t.R16F,s=t.RGBA16F,a=t.RGBA32F,i=t.RED,u=4,l=1,c=t.HALF_FLOAT,m=t.FLOAT,p=t.RGBA8):(o=r.RGBA,n=r.RGBA,s=r.RGBA,a=t.RGBA,i=r.RGBA,u=4,l=4,c=e!=null?e.HALF_FLOAT_OES:null,m=r.FLOAT,p=r.RGBA),{internalFormatFloat:o,internalFormatHalfFloat:n,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:a,textureFormatFloat:i,downloadTextureFormat:p,downloadUnpackNumChannels:u,defaultNumChannels:l,textureTypeHalfFloat:c,textureTypeFloat:m}}function ce(r,e){let t=e();return A().getBool(\"DEBUG\")&&I9(r),t}function I9(r){let e=r.getError();if(e!==r.NO_ERROR)throw new Error(\"WebGL Error: \"+lD(r,e))}var v9=596e-10,k9=65504;function WI(r){return!!(A().getBool(\"WEBGL_RENDER_FLOAT32_ENABLED\")||r===0||v9r.getExtension(e),'Extension \"'+e+'\" not supported on this browser.')}function UI(r,e){let t=vi(r,()=>r.createShader(r.VERTEX_SHADER),\"Unable to create vertex WebGLShader.\");if(ce(r,()=>r.shaderSource(t,e)),ce(r,()=>r.compileShader(t)),r.getShaderParameter(t,r.COMPILE_STATUS)===!1)throw console.log(r.getShaderInfoLog(t)),new Error(\"Failed to compile vertex shader.\");return t}function GI(r,e){let t=vi(r,()=>r.createShader(r.FRAGMENT_SHADER),\"Unable to create fragment WebGLShader.\");if(ce(r,()=>r.shaderSource(t,e)),ce(r,()=>r.compileShader(t)),A().get(\"ENGINE_COMPILE_ONLY\"))return t;if(r.getShaderParameter(t,r.COMPILE_STATUS)===!1)throw nh(e,r.getShaderInfoLog(t)),new Error(\"Failed to compile fragment shader.\");return t}var N9=/ERROR: [0-9]+:([0-9]+):/g;function nh(r,e){let t=N9.exec(e);if(t==null){console.log(`Couldn't parse line number in error: ${e}`),console.log(r);return}let o=+t[1],n=r.split(`\n`),s=n.length.toString().length+2,a=n.map((c,m)=>y.rightPad((m+1).toString(),s)+c),i=0;for(let c=0;cr.createProgram(),\"Unable to create WebGLProgram.\")}function KI(r,e){if(ce(r,()=>r.linkProgram(e)),!A().get(\"ENGINE_COMPILE_ONLY\")&&r.getProgramParameter(e,r.LINK_STATUS)===!1)throw console.log(r.getProgramInfoLog(e)),new Error(\"Failed to link vertex and fragment shaders.\")}function om(r,e){if(ce(r,()=>r.validateProgram(e)),r.getProgramParameter(e,r.VALIDATE_STATUS)===!1)throw console.log(r.getProgramInfoLog(e)),new Error(\"Shader program validation failed.\")}function qI(r,e){let t=vi(r,()=>r.createBuffer(),\"Unable to create WebGLBuffer\");return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,t)),ce(r,()=>r.bufferData(r.ARRAY_BUFFER,e,r.STATIC_DRAW)),t}function jI(r,e){let t=vi(r,()=>r.createBuffer(),\"Unable to create WebGLBuffer\");return ce(r,()=>r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t)),ce(r,()=>r.bufferData(r.ELEMENT_ARRAY_BUFFER,e,r.STATIC_DRAW)),t}function T9(){return A().getNumber(\"WEBGL_VERSION\")===2?1:4}function XI(r){return vi(r,()=>r.createTexture(),\"Unable to create WebGLTexture.\")}function YI(r,e){let t=A().getNumber(\"WEBGL_MAX_TEXTURE_SIZE\");if(r<=0||e<=0){let o=`[${r}x${e}]`;throw new Error(\"Requested texture size \"+o+\" is invalid.\")}if(r>t||e>t){let o=`[${r}x${e}]`,n=`[${t}x${t}]`;throw new Error(\"Requested texture size \"+o+\" greater than WebGL maximum on this browser / GPU \"+n+\".\")}}function QI(r){return vi(r,()=>r.createFramebuffer(),\"Unable to create WebGLFramebuffer.\")}function sh(r,e,t,o,n,s,a){let i=r.getAttribLocation(e,t);return i===-1?!1:(ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,o)),ce(r,()=>r.vertexAttribPointer(i,n,r.FLOAT,!1,s,a)),ce(r,()=>r.enableVertexAttribArray(i)),!0)}function cD(r,e,t){dD(r,t),ce(r,()=>r.activeTexture(r.TEXTURE0+t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,e))}function _9(r,e){dD(r,e),ce(r,()=>r.activeTexture(r.TEXTURE0+e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function ZI(r,e,t){return vi(r,()=>r.getUniformLocation(e,t),'uniform \"'+t+'\" not present in program.')}function JI(r,e,t){return r.getUniformLocation(e,t)}function e0(r,e,t,o){ce(r,()=>cD(r,e,o)),ce(r,()=>r.uniform1i(t,o))}function E9(r){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,null)),ce(r,()=>r.viewport(0,0,r.canvas.width,r.canvas.height)),ce(r,()=>r.scissor(0,0,r.canvas.width,r.canvas.height))}function nm(r,e,t){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,t)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0))}function ah(r,e){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,e)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,null,0))}function Dl(r){let e=r.checkFramebufferStatus(r.FRAMEBUFFER);if(e!==r.FRAMEBUFFER_COMPLETE)throw new Error(\"Error binding framebuffer: \"+mD(r,e))}function mD(r,e){switch(e){case r.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\";case r.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\";case r.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\";case r.FRAMEBUFFER_UNSUPPORTED:return\"FRAMEBUFFER_UNSUPPORTED\";default:return`unknown error ${e}`}}function vi(r,e,t){let o=ce(r,()=>e());if(o==null)throw new Error(t);return o}function dD(r,e){let t=r.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,o=e+r.TEXTURE0;if(ot){let n=`[gl.TEXTURE0, gl.TEXTURE${t}]`;throw new Error(`textureUnit must be in ${n}.`)}}function ki(r,e=2){return y.sizeFromShape(r.slice(0,r.length-e))}function Ni(r){if(r.length===0)throw Error(\"Cannot get rows and columns of an empty shape array.\");return[r.length>1?r[r.length-2]:1,r[r.length-1]]}function Al(r){let e=[1,1,1];return r.length===0||r.length===1&&r[0]===1||(e=[ki(r),...Ni(r)]),e}function t0(r,e=!1){let t=A().getNumber(\"WEBGL_MAX_TEXTURE_SIZE\"),o=A().getNumber(\"WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE\");o===1/0&&A().getBool(\"WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE\")&&(o=t/2),e&&(t=t*2,o=o*2,r=r.map((i,p)=>p>=r.length-2?y.nearestLargerEven(r[p]):r[p]),r.length===1&&(r=[2,r[0]])),r.length!==2&&(r=y.squeezeShape(r).newShape);let n=y.sizeFromShape(r),s=null;r.length<=1&&n<=t?s=[1,n]:r.length===2&&r[0]<=t&&r[1]<=t?s=r:r.length===3&&r[0]*r[1]<=t&&r[2]<=t?s=[r[0]*r[1],r[2]]:r.length===3&&r[0]<=t&&r[1]*r[2]<=t?s=[r[0],r[1]*r[2]]:r.length===4&&r[0]*r[1]*r[2]<=t&&r[3]<=t?s=[r[0]*r[1]*r[2],r[3]]:r.length===4&&r[0]<=t&&r[1]*r[2]*r[3]<=t&&(s=[r[0],r[1]*r[2]*r[3]]);let a=s!=null&&Math.max(...s)>o&&Math.min(...s)<=(e?2:1)&&Math.min(...s)>0;if(s==null||a)if(e){let i=ki(r),p=2,u=2;r.length&&([p,u]=Ni(r)),n=i*(p/2)*(u/2),s=y.sizeToSquarishShape(n).map(l=>l*2)}else s=y.sizeToSquarishShape(n);return s}function th(r){return r%2===0}function vu(r,e){if(r=r.slice(-2),e=e.slice(-2),y.arraysEqual(r,e)||!r.length||!e.length||r[0]===0||r[1]===0||e[0]===0||e[1]===0)return!0;if(r.length!==e.length){let t=r[r.length-1],o=e[e.length-1];if(t===o||th(t)&&th(o)&&(r[0]===1||e[0]===1))return!0}return r[1]===e[1]&&th(r[0])&&th(e[0])}var rh,oh;function r0(r){if(rh==null){let e=Zr(r);rh=e.getParameter(e.MAX_TEXTURE_SIZE)}return rh}function $9(){rh=null}function R9(){oh=null}function o0(r){if(oh==null){let e=Zr(r);oh=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,oh)}function n0(r){if(r===0)return 0;let e,t=Zr(r);return Jr(t,\"EXT_disjoint_timer_query_webgl2\")&&r===2?e=2:Jr(t,\"EXT_disjoint_timer_query\")?e=1:e=0,e}function Jr(r,e){return r.getExtension(e)!=null}function ih(r){try{if(Zr(r)!=null)return!0}catch(e){return console.log(\"Error when getting WebGL context: \",e),!1}return!1}function s0(r){if(r===0)return!1;let e=Zr(r);if(r===1){if(!Jr(e,\"OES_texture_float\"))return!1}else if(!Jr(e,\"EXT_color_buffer_float\"))return!1;return VI(e)}function a0(r){if(r===0)return!1;let e=Zr(r);if(r===1){if(!Jr(e,\"OES_texture_float\")||!Jr(e,\"WEBGL_color_buffer_float\"))return!1}else{if(Jr(e,\"EXT_color_buffer_float\"))return VI(e);let o=\"EXT_color_buffer_half_float\";if(Jr(e,o)){let n=e.getExtension(o);return D9(e,n)}return!1}return VI(e)}function VI(r){let e=rm(r),t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,e.internalFormatFloat,1,1,0,e.textureFormatFloat,e.textureTypeFloat,null);let s=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,s),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0);let a=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(t),r.deleteFramebuffer(s),a}function D9(r,e){let t=rm(r,e),o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,t.internalFormatHalfFloat,1,1,0,t.textureFormatFloat,t.textureTypeHalfFloat,null);let a=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,a),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0);let i=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(o),r.deleteFramebuffer(a),i}function i0(r){return r!==2?!1:Zr(r).fenceSync!=null}function Ys(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!==\"complex64\",()=>`${e} does not support complex64 tensors in the WebGL backend.`)})}var Se=A();Se.registerFlag(\"HAS_WEBGL\",()=>Se.getNumber(\"WEBGL_VERSION\")>0);Se.registerFlag(\"WEBGL_VERSION\",()=>ih(2)?2:ih(1)?1:0);Se.registerFlag(\"WEBGL_CHECK_NUMERICAL_PROBLEMS\",()=>!1);Se.registerFlag(\"WEBGL_BUFFER_SUPPORTED\",()=>Se.get(\"WEBGL_VERSION\")===2);Se.registerFlag(\"WEBGL_CPU_FORWARD\",()=>!0);Se.registerFlag(\"WEBGL_FORCE_F16_TEXTURES\",()=>!1);Se.registerFlag(\"WEBGL_PACK\",()=>Se.getBool(\"HAS_WEBGL\"));Se.registerFlag(\"WEBGL_PACK_NORMALIZATION\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_CLIP\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_DEPTHWISECONV\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_BINARY_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_UNARY_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_ARRAY_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_IMAGE_OPERATIONS\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_REDUCE\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_LAZILY_UNPACK\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_CONV_IM2COL\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_PACK_CONV2DTRANSPOSE\",()=>Se.getBool(\"WEBGL_PACK\"));Se.registerFlag(\"WEBGL_MAX_TEXTURE_SIZE\",()=>r0(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_MAX_TEXTURES_IN_SHADER\",()=>o0(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\",()=>{let r=Se.getNumber(\"WEBGL_VERSION\");return r===0?0:n0(r)});Se.registerFlag(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\",()=>Se.getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0&&!uu.isMobile());Se.registerFlag(\"WEBGL_RENDER_FLOAT32_CAPABLE\",()=>s0(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_RENDER_FLOAT32_ENABLED\",()=>Se.getBool(\"WEBGL_FORCE_F16_TEXTURES\")?!1:Se.getBool(\"WEBGL_RENDER_FLOAT32_CAPABLE\"));Se.registerFlag(\"WEBGL_DOWNLOAD_FLOAT_ENABLED\",()=>a0(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_FENCE_API_ENABLED\",()=>i0(Se.getNumber(\"WEBGL_VERSION\")));Se.registerFlag(\"WEBGL_SIZE_UPLOAD_UNIFORM\",()=>Se.getBool(\"WEBGL_RENDER_FLOAT32_ENABLED\")?4:0);Se.registerFlag(\"WEBGL_DELETE_TEXTURE_THRESHOLD\",()=>-1,r=>{if(typeof r!=\"number\")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${r}.`)});Se.registerFlag(\"WEBGL_FLUSH_THRESHOLD\",()=>uu.isMobile()?1:-1,r=>{if(typeof r!=\"number\")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${r}.`)});Se.registerFlag(\"CPU_HANDOFF_SIZE_THRESHOLD\",()=>128);Se.registerFlag(\"WEBGL_USE_SHAPES_UNIFORMS\",()=>!1);Se.registerFlag(\"TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD\",()=>1e5);Se.registerFlag(\"TOPK_K_CPU_HANDOFF_THRESHOLD\",()=>128);Se.registerFlag(\"WEBGL_EXP_CONV\",()=>!1);Se.registerFlag(\"SOFTWARE_WEBGL_ENABLED\",()=>Se.getBool(\"IS_TEST\"));Se.registerFlag(\"WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE\",()=>1/0);Se.registerFlag(\"WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE\",()=>!1);Se.registerFlag(\"WEBGL2_ISNAN_CUSTOM\",()=>!1);Se.registerFlag(\"ENGINE_COMPILE_ONLY\",()=>!1);function kt(){let r,e,t,o,n,s,a,i,p,u;return A().getNumber(\"WEBGL_VERSION\")===2?(r=\"#version 300 es\",e=\"in\",t=\"out\",o=\"in\",n=\"texture\",s=\"outputColor\",a=\"out vec4 outputColor;\",i=A().getBool(\"WEBGL2_ISNAN_CUSTOM\")?`\n bool isnan_custom(float val) {\n uint floatToUint = floatBitsToUint(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan_custom(val.x),\n isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w));\n }\n\n #define isnan(value) isnan_custom(value)\n `:\"\",p=\"\",u=`\n #define round(value) newRound(value)\n int newRound(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 newRound(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n `):(r=\"\",e=\"attribute\",t=\"varying\",o=\"varying\",n=\"texture2D\",s=\"gl_FragColor\",a=\"\",i=`\n #define isnan(value) isnan_custom(value)\n bool isnan_custom(float val) {\n return (val > 0. || val < 1. || val == 0.) ? false : true;\n }\n bvec4 isnan_custom(vec4 val) {\n return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w));\n }\n `,p=`\n uniform float INFINITY;\n\n bool isinf(float val) {\n return abs(val) == INFINITY;\n }\n bvec4 isinf(vec4 val) {\n return equal(abs(val), vec4(INFINITY));\n }\n `,u=`\n int round(float value) {\n return int(floor(value + 0.5));\n }\n\n ivec4 round(vec4 value) {\n return ivec4(floor(value + vec4(0.5)));\n }\n `),{version:r,attribute:e,varyingVs:t,varyingFs:o,texture2D:n,output:s,defineOutput:a,defineSpecialNaN:i,defineSpecialInf:p,defineRound:u}}function Qs(r,e,t=\"index\"){let o=y.computeStrides(e);return o.map((n,s)=>{let a=`int ${r[s]} = ${t} / ${n}`,i=s===o.length-1?`int ${r[s+1]} = ${t} - ${r[s]} * ${n}`:`index -= ${r[s]} * ${n}`;return`${a}; ${i};`}).join(\"\")}function Ip(r,e,t=\"index\"){let o=y.computeStrides(e);return o.map((n,s)=>{let a=`int ${r[s]} = ${t} / outShapeStrides[${s}]`,i=s===o.length-1?`int ${r[s+1]} = ${t} - ${r[s]} * outShapeStrides[${s}]`:`index -= ${r[s]} * outShapeStrides[${s}]`;return`${a}; ${i};`}).join(\"\")}function A9(r,e){let t=r.length,o=r.map(s=>`${e}[${s}]`),n=new Array(t-1);n[t-2]=o[t-1];for(let s=t-3;s>=0;--s)n[s]=`(${n[s+1]} * ${o[s+1]})`;return n}function fD(r,e,t=\"index\"){let o=r.map((s,a)=>a),n=A9(o,e);return n.map((s,a)=>{let i=`int ${r[a]} = ${t} / ${n[a]}`,p=a===n.length-1?`int ${r[a+1]} = ${t} - ${r[a]} * ${n[a]}`:`index -= ${r[a]} * ${n[a]}`;return`${i}; ${p};`}).join(\"\")}function Pl(r){let e=y.computeStrides(r).map(t=>t.toString());return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * ${e[0]} + coords.y * ${e[1]} + coords.z;\n }\n`}function Ol(){return`\n int getFlatIndex(ivec3 coords) {\n return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z;\n }\n`}var uh=`\n const float FLOAT_MAX = 1.70141184e38;\n const float FLOAT_MIN = 1.17549435e-38;\n\n lowp vec4 encode_float(highp float v) {\n if (isnan(v)) {\n return vec4(255, 255, 255, 255);\n }\n\n highp float av = abs(v);\n\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n`;var{getBroadcastDims:hD}=C;function gD(r,e,t){let o=[];if(r.forEach(d=>{let f=y.sizeFromShape(d.shapeInfo.logicalShape);if(d.shapeInfo.isUniform?o.push(`uniform float ${d.name}${f>1?`[${f}]`:\"\"};`):(o.push(`uniform sampler2D ${d.name};`),o.push(`uniform int offset${d.name};`)),t.enableShapeUniforms){let{uniformShape:h}=ph(t.packedInputs,d.shapeInfo.logicalShape,d.shapeInfo.texShape);switch(h.length){case 1:o.push(`uniform int ${d.name}Shape;`);break;case 2:o.push(`uniform ivec2 ${d.name}Shape;`);break;case 3:o.push(`uniform ivec3 ${d.name}Shape;`);break;case 4:o.push(`uniform ivec4 ${d.name}Shape;`);break;default:break}o.push(`uniform ivec2 ${d.name}TexShape;`)}}),t.enableShapeUniforms){switch(e.logicalShape.length){case 1:o.push(\"uniform int outShape;\");break;case 2:o.push(\"uniform ivec2 outShape;\"),o.push(\"uniform int outShapeStrides;\");break;case 3:o.push(\"uniform ivec3 outShape;\"),o.push(\"uniform ivec2 outShapeStrides;\");break;case 4:o.push(\"uniform ivec4 outShape;\"),o.push(\"uniform ivec3 outShapeStrides;\");break;default:break}o.push(\"uniform ivec2 outTexShape;\")}t.customUniforms&&t.customUniforms.forEach(d=>{o.push(`uniform ${d.type} ${d.name}${d.arrayIndex?`[${d.arrayIndex}]`:\"\"};`)});let n=o.join(`\n`),s=r.map(d=>F9(d,e,t.packedInputs,t.enableShapeUniforms)).join(`\n`),a=e.texShape,i=kt(),p=M9(i),u,l,c=z9(i);return e.isPacked?(u=P9(e.logicalShape,a,t.enableShapeUniforms),l=B9(i)):(u=O9(e.logicalShape,a,t.enableShapeUniforms),l=L9(i)),t.packedInputs&&(c+=G9),[c,p,l,n,u,s,t.userCode].join(`\n`)}function Ll(r,e=!1){let t=r.shapeInfo.logicalShape;switch(t.length){case 0:return rJ(r,e);case 1:return nJ(r,e);case 2:return aJ(r,e);case 3:return uJ(r,e);case 4:return lJ(r,e);case 5:return cJ(r);case 6:return mJ(r);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function xD(r,e){switch(r.shapeInfo.logicalShape.length){case 0:return tJ(r);case 1:return oJ(r,e);case 2:return sJ(r,e);case 3:return iJ(r,e);default:return pJ(r,e)}}function F9(r,e,t=!1,o){let n=\"\";t?n+=xD(r,o):n+=Ll(r,o);let s=r.shapeInfo.logicalShape,a=e.logicalShape;return s.length<=a.length&&(t?n+=dJ(r,e):n+=fJ(r,e)),n}function P9(r,e,t){switch(r.length){case 0:return yD();case 1:return H9(r,e,t);case 2:return J9(r,e,t);case 3:return q9(r,e,t);default:return X9(r,e,t)}}function O9(r,e,t){switch(r.length){case 0:return yD();case 1:return K9(r,e,t);case 2:return eJ(r,e,t);case 3:return j9(r,e,t);case 4:return Y9(r,e,t);case 5:return Q9(r,e);case 6:return Z9(r,e);default:throw new Error(`${r.length}-D output sampling is not yet supported`)}}function M9(r){return`\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ${r.texture2D}(textureSampler, uv).r;\n }\n `}function L9(r){return`\n void setOutput(float val) {\n ${r.output} = vec4(val, 0, 0, 0);\n }\n `}function B9(r){return`\n void setOutput(vec4 val) {\n ${r.output} = val;\n }\n `}function z9(r){return`${r.version}\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ${r.varyingFs} vec2 resultUV;\n ${r.defineOutput}\n const vec2 halfCR = vec2(0.5, 0.5);\n\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n uniform float NAN;\n ${r.defineSpecialNaN}\n ${r.defineSpecialInf}\n ${r.defineRound}\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n int idiv(int a, int b, float sign) {\n int res = a / b;\n int mod = imod(a, b);\n if (sign < 0. && mod != 0) {\n res -= 1;\n }\n return res;\n }\n\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n #define HASHSCALE1 443.8975\n float random(float seed){\n vec2 p = resultUV * seed;\n vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 += dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${V9}\n ${W9}\n ${U9}\n `}var V9=`\nvec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\nvec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`,W9=`\nvec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR,\n int texNumC, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`,U9=`\nvec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n}\n`,G9=`\n float getChannel(vec4 frag, vec2 innerDims) {\n vec2 modCoord = mod(innerDims, 2.);\n return modCoord.x == 0. ?\n (modCoord.y == 0. ? frag.r : frag.g) :\n (modCoord.y == 0. ? frag.b : frag.a);\n }\n float getChannel(vec4 frag, int dim) {\n float modCoord = mod(float(dim), 2.);\n return modCoord == 0. ? frag.r : frag.g;\n }\n`;function yD(){return`\n int getOutputCoords() {\n return 0;\n }\n `}function H9(r,e,t){let o=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];return o[0]===1?t?`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0));\n }\n `:`\n int getOutputCoords() {\n return 2 * int(resultUV.x * ${o[1]}.0);\n }\n `:o[1]===1?t?`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0));\n }\n `:`\n int getOutputCoords() {\n return 2 * int(resultUV.y * ${o[0]}.0);\n }\n `:t?`\n int getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y);\n }\n `:`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${o[0]}, ${o[1]}));\n return 2 * (resTexRC.x * ${o[1]} + resTexRC.y);\n }\n `}function K9(r,e,t){return e[0]===1?t?`\n int getOutputCoords() {\n return int(resultUV.x * float(outTexShape[1]));\n }\n `:`\n int getOutputCoords() {\n return int(resultUV.x * ${e[1]}.0);\n }\n `:e[1]===1?t?`\n int getOutputCoords() {\n return int(resultUV.y * float(outTexShape[0]));\n }\n `:`\n int getOutputCoords() {\n return int(resultUV.y * ${e[0]}.0);\n }\n `:t?`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n return resTexRC.x * outTexShape[1] + resTexRC.y;\n }\n `:`\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n return resTexRC.x * ${e[1]} + resTexRC.y;\n }\n `}function q9(r,e,t){if(t)return`\n ivec3 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec3(b, r, c);\n }\n `;let o=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],n=Math.ceil(r[2]/2),s=n*Math.ceil(r[1]/2);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${o[0]}, ${o[1]}));\n int index = resTexRC.x * ${o[1]} + resTexRC.y;\n\n int b = index / ${s};\n index -= b * ${s};\n\n int r = 2 * (index / ${n});\n int c = imod(index, ${n}) * 2;\n\n return ivec3(b, r, c);\n }\n `}function j9(r,e,t){if(t)return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(outTexShape[0], outTexShape[1]));\n int index = resTexRC.x * outTexShape[1] + resTexRC.y;\n ${Ip([\"r\",\"c\",\"d\"],r)}\n return ivec3(r, c, d);\n }\n`;let o=Qs([\"r\",\"c\",\"d\"],r);return`\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(${e[0]}, ${e[1]}));\n int index = resTexRC.x * ${e[1]} + resTexRC.y;\n ${o}\n return ivec3(r, c, d);\n }\n `}function X9(r,e,t){if(t)return`\n ivec4 getOutputCoords() {\n ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0));\n ivec2 resTexRC = ivec2(resultUV.yx *\n vec2(packedTexShape[0], packedTexShape[1]));\n int index = resTexRC.x * packedTexShape[1] + resTexRC.y;\n\n int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0));\n int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0));\n int texelsInBatchN = texelsInBatch * outShape[1];\n\n int b2 = index / texelsInBatchN;\n index -= b2 * texelsInBatchN;\n\n int b = index / texelsInBatch;\n index -= b * texelsInBatch;\n\n int r = 2 * (index / texelsInLogicalRow);\n int c = imod(index, texelsInLogicalRow) * 2;\n\n return ivec4(b2, b, r, c);\n }\n `;let o=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],n=Math.ceil(r[r.length-1]/2),s=n*Math.ceil(r[r.length-2]/2),a=s,i=\"\",p=\"b, r, c\";for(let u=2;u=1?l=\"coords = 0;\":l=i.map(b=>`coords.${c[b+u]} = 0;`).join(`\n`);let m=\"\";a<2&&s>0?m=\"coords\":m=r.shapeInfo.logicalShape.map((b,w)=>`coords.${c[w+u]}`).join(\", \");let d=\"return outputValue;\",h=y.sizeFromShape(r.shapeInfo.logicalShape)===1,x=y.sizeFromShape(e.logicalShape)===1;if(s===1&&!h&&!x)d=`\n return vec4(outputValue.xy, outputValue.xy);\n `;else if(h&&!x)a===1?d=`\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n `:d=`\n return vec4(outputValue.x);\n `;else if(i.length){let b=s-2,w=s-1;i.indexOf(b)>-1&&i.indexOf(w)>-1?d=\"return vec4(outputValue.x);\":i.indexOf(b)>-1?d=\"return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);\":i.indexOf(w)>-1&&(d=\"return vec4(outputValue.xx, outputValue.zz);\")}return`\n vec4 ${n}() {\n ${p} coords = getOutputCoords();\n ${l}\n vec4 outputValue = get${o}(${m});\n ${d}\n }\n `}function fJ(r,e){let t=r.name,o=t.charAt(0).toUpperCase()+t.slice(1),n=\"get\"+o+\"AtOutCoords\",s=e.texShape,a=r.shapeInfo.texShape,i=r.shapeInfo.logicalShape.length,p=e.logicalShape.length;if(!r.shapeInfo.isUniform&&i===p&&r.shapeInfo.flatOffset==null&&y.arraysEqual(a,s))return`\n float ${n}() {\n return sampleTexture(${t}, resultUV);\n }\n `;let u=Re(p),l=hD(r.shapeInfo.logicalShape,e.logicalShape),c=p-i,m,d=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"];i===0?m=\"\":p<2&&l.length>=1?m=\"coords = 0;\":m=l.map(h=>`coords.${d[h+c]} = 0;`).join(`\n`);let f=\"\";return p<2&&i>0?f=\"coords\":f=r.shapeInfo.logicalShape.map((h,g)=>`coords.${d[g+c]}`).join(\", \"),`\n float ${n}() {\n ${u} coords = getOutputCoords();\n ${m}\n return get${o}(${f});\n }\n `}function Re(r){if(r<=1)return\"int\";if(r===2)return\"ivec2\";if(r===3)return\"ivec3\";if(r===4)return\"ivec4\";if(r===5)return\"ivec5\";if(r===6)return\"ivec6\";throw Error(`GPU for rank ${r} is not yet supported`)}function ph(r,e,t){let{newShape:o,keptDims:n}=y.squeezeShape(e),s=e.length,a=r&&s===3&&e[0]===1,i=a?e.slice(1):o,p=!r&&s>1&&!y.arraysEqual(e,t)&&o.lengthr[t]).join(\", \")}function CD(r,e,t,o){let n=t.map((l,c)=>{let m={logicalShape:l.shape,texShape:l.isUniform?null:l.texData.texShape,isUniform:l.isUniform,isPacked:l.isUniform?!1:l.texData.isPacked,flatOffset:null};return l.texData!=null&&l.texData.slice!=null&&l.texData.slice.flatOffset>0&&(m.flatOffset=l.texData.slice.flatOffset),{name:e.variableNames[c],shapeInfo:m}}),s=n.map(l=>l.shapeInfo),a={logicalShape:o.shape,texShape:o.texData.texShape,isUniform:!1,isPacked:o.texData.isPacked,flatOffset:null},i=gD(n,a,e),p=GI(r.gl,i),u=r.createProgram(p);return A().get(\"ENGINE_COMPILE_ONLY\")?{program:e,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(r.buildVao(u),Object.assign({program:e,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a},u0(r,e,u)))}function u0(r,e,t){let o=[],n=[],s,a,i,p=null,u=null;u=r.getUniformLocation(t,\"NAN\",!1),A().getNumber(\"WEBGL_VERSION\")===1&&(p=r.getUniformLocation(t,\"INFINITY\",!1));let l=!1;for(let c of e.variableNames){let m={name:c,uniform:r.getUniformLocation(t,c,l),offset:r.getUniformLocation(t,`offset${c}`,l)};e.enableShapeUniforms&&(m.shape=r.getUniformLocation(t,`${c}Shape`,l),m.texShape=r.getUniformLocation(t,`${c}TexShape`,l)),o.push(m)}if(e.enableShapeUniforms&&(s=r.getUniformLocation(t,\"outShape\",l),i=r.getUniformLocation(t,\"outShapeStrides\",l),a=r.getUniformLocation(t,\"outTexShape\",l)),e.customUniforms)for(let c of e.customUniforms)n.push(r.getUniformLocation(t,c.name,l));return{variablesLocations:o,customUniformLocations:n,infLoc:p,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:i,outTexShapeLocation:a}}function bD(r,e){if(r.length!==e.length)throw Error(`Binary was compiled with ${r.length} inputs, but was executed with ${e.length} inputs`);r.forEach((t,o)=>{let n=t.logicalShape,s=e[o],a=s.shape;if(!y.arraysEqual(n,a))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${n} and ${a} must match`);if(t.isUniform&&s.isUniform)return;let i=t.texShape,p=s.isUniform?null:s.texData.texShape;if(!y.arraysEqual(i,p))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${i} and ${p} must match`)})}function wD(r,e,t,o,n){e.program.enableShapeUniforms||(bD(e.inShapeInfos,t),bD([e.outShapeInfo],[o]));let s=o.texData.texture,a=o.texData.texShape;o.texData.isPacked?r.setOutputPackedMatrixTexture(s.texture,a[0],a[1]):r.setOutputMatrixTexture(s.texture,a[0],a[1]),r.setProgram(e.webGLProgram),r.bindVertexArray(e.webGLProgram.vao),A().getNumber(\"WEBGL_VERSION\")===1&&e.infLoc!==null&&r.gl.uniform1f(e.infLoc,1/0),e.nanLoc!==null&&r.gl.uniform1f(e.nanLoc,NaN);for(let p=0;p{let i=a.texData!=null&&a.texData.slice!=null&&a.texData.slice.flatOffset>0;if(r.enableShapeUniforms&&!a.isUniform){let p=a.texData.texShape,{useSqueezeShape:u,uniformShape:l,keptDims:c}=ph(r.packedInputs,a.shape,p),m=\"\",d=\"\",f=\"\";if(l.length===1&&r.packedInputs){let k=[Math.ceil(p[0]/2),Math.ceil(p[1]/2)];m=`${k[0]>1}_${k[1]>1}`}else if(l.length===2&&!r.packedInputs)d=`${l[0]>1}_${l[1]>1}`;else if(l.length>2&&!r.packedInputs){let k=y.computeStrides(l);f=`${k[0]===p[1]}_${k[k.length-1]===p[1]}`}let h=a.shape.length,g=l.length===2&&y.arraysEqual(a.shape,p),x=y.sizeFromShape(a.shape)===1,b=C.getBroadcastDims(a.shape,t.shape),w=!r.packedInputs&&h===t.shape.length&&y.arraysEqual(p,t.texData.texShape),S=r.packedInputs||l.length>2?\"\":`${p[0]>1}_${p[1]>1}`;o+=`${h}_${w}_${u?c:\"\"}_${l.length}_${x}_${b}_${g}_${m}_${d}_${f}_${S}_${i}`}else{let p=a.isUniform?\"uniform\":a.texData.texShape;o+=`${a.shape}_${p}_${i}`}});let n=r.userCode,s=r.constructor.name;return s+=\"_\"+o+\"_\"+n+`${A().getNumber(\"WEBGL_VERSION\")}`,s}function lt(r){return A().getBool(\"WEBGL_USE_SHAPES_UNIFORMS\")&&r<=4}var lh=class{constructor(e){this.variableNames=[\"A\"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=Iu.DENSE,this.customUniforms=[{name:\"texShape\",type:\"ivec2\"}];let t=kt();this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?Ip([\"r\",\"c\",\"d\"],e):Qs([\"r\",\"c\",\"d\"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getA(rc.x, rc.y, rc.z);\n }\n\n ${t.output} = result;\n }\n `}};var ch=class{constructor(e){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=Iu.DENSE,this.customUniforms=[{name:\"texShape\",type:\"ivec2\"}];let t=kt();this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=`\n ivec3 outCoordsFromFlatIndex(int index) {\n ${this.enableShapeUniforms?Ip([\"r\",\"c\",\"d\"],e):Qs([\"r\",\"c\",\"d\"],e)}\n return ivec3(r, c, d);\n }\n\n void main() {\n ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1]));\n int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y);\n\n vec4 result = vec4(0.);\n\n for (int i=0; i<4; i++) {\n int flatIndex = index + i;\n ivec3 rc = outCoordsFromFlatIndex(flatIndex);\n result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z));\n }\n\n ${t.output} = result;\n }\n `}};var mh=class{constructor(e){this.variableNames=[\"A\"],this.outTexUsage=hr.DOWNLOAD;let t=kt();this.outputShape=e,this.userCode=`\n ${uh}\n\n void main() {\n float x = getAAtOutCoords();\n ${t.output} = encode_float(x);\n }\n `}};var dh=class{constructor(e){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=hr.DOWNLOAD;let t=kt();this.outputShape=e,this.userCode=`\n ${uh}\n\n void main() {\n ivec3 coords = getOutputCoords();\n float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z));\n ${t.output} = encode_float(x);\n }\n `}};var xJ={R:0,G:1,B:2,A:3},sm=class{constructor(e,t=!1,o=\"RGBA\"){this.variableNames=[\"A\"],this.customUniforms=[{name:\"texShape\",type:\"ivec2\"}];let n=kt();this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length);let s=\"result\";t&&(s=\"floor(result * 255. + 0.5)\");let a=\"\";for(let i=0;ix0,createBufferFromOutputTexture:()=>C0,createFloat16MatrixTexture:()=>d0,createFloat16PackedMatrixTexture:()=>g0,createFloat32MatrixTexture:()=>m0,createIndexBuffer:()=>c0,createPackedMatrixTexture:()=>h0,createUnsignedBytesMatrixTexture:()=>f0,createVertexBuffer:()=>l0,createVertexShader:()=>p0,downloadByteEncodedFloatMatrixFromOutputTexture:()=>S0,downloadFloat32MatrixFromBuffer:()=>w0,downloadMatrixFromPackedOutputTexture:()=>v0,downloadPackedMatrixFromBuffer:()=>I0,getInternalFormatForFloat16MatrixTexture:()=>gh,getInternalFormatForFloat16PackedMatrixTexture:()=>bh,getInternalFormatForFloat32MatrixTexture:()=>hh,getInternalFormatForPackedMatrixTexture:()=>yh,getInternalFormatForUnsignedBytesMatrixTexture:()=>xh,uploadDenseMatrixToTexture:()=>y0,uploadPixelDataToTexture:()=>b0});function p0(r){let e=kt(),t=`${e.version}\n precision highp float;\n ${e.attribute} vec3 clipSpacePos;\n ${e.attribute} vec2 uv;\n ${e.varyingVs} vec2 resultUV;\n\n void main() {\n gl_Position = vec4(clipSpacePos, 1);\n resultUV = uv;\n }`;return UI(r,t)}function l0(r){let e=new Float32Array([-1,1,0,0,1,-1,-1,0,0,0,1,1,0,1,1,1,-1,0,1,0]);return qI(r,e)}function c0(r){let e=new Uint16Array([0,1,2,2,1,3]);return jI(r,e)}function am(r,e,t,o,n,s){YI(e,t);let a=XI(r),i=r.TEXTURE_2D;return ce(r,()=>r.bindTexture(i,a)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MIN_FILTER,r.NEAREST)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MAG_FILTER,r.NEAREST)),A().getNumber(\"WEBGL_VERSION\")===1?ce(r,()=>r.texImage2D(i,0,o,e,t,0,n,s,null)):ce(r,()=>r.texStorage2D(i,1,o,e,t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null)),{texture:a,texShape:[t,e]}}function hh(r){return r.internalFormatFloat}function m0(r,e,t,o){let[n,s]=Sp(e,t);return am(r,n,s,hh(o),o.textureFormatFloat,r.FLOAT)}function gh(r){return r.internalFormatHalfFloat}function d0(r,e,t,o){let[n,s]=Sp(e,t);return am(r,n,s,gh(o),o.textureFormatFloat,o.textureTypeHalfFloat)}function xh(r){return r.downloadTextureFormat}function f0(r,e,t,o){let[n,s]=Sp(e,t);return am(r,n,s,xh(o),r.RGBA,r.UNSIGNED_BYTE)}function yh(r){return r.internalFormatPackedFloat}function h0(r,e,t,o){let[n,s]=Ga(e,t);return am(r,n,s,yh(o),r.RGBA,r.FLOAT)}function bh(r){return r.internalFormatPackedHalfFloat}function g0(r,e,t,o){let[n,s]=Ga(e,t);return am(r,n,s,bh(o),r.RGBA,o.textureTypeHalfFloat)}function x0(r,e,t){return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,t)),sh(r,e,\"clipSpacePos\",t,3,20,0)&&sh(r,e,\"uv\",t,2,20,12)}function y0(r,e,t,o,n,s){ce(r,()=>r.bindTexture(r.TEXTURE_2D,e));let a,i,p;n instanceof Uint8Array?(a=new Uint8Array(t*o*4),i=r.UNSIGNED_BYTE,p=r.RGBA):(a=new Float32Array(t*o*4),i=r.FLOAT,p=s.internalFormatPackedFloat),a.set(n),A().getNumber(\"WEBGL_VERSION\")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,t,o,r.RGBA,i,a)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,p,t,o,0,r.RGBA,i,a)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function b0(r,e,t){ce(r,()=>r.bindTexture(r.TEXTURE_2D,e)),t.data instanceof Uint8Array?A().getNumber(\"WEBGL_VERSION\")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.width,t.height,r.RGBA,r.UNSIGNED_BYTE,t.data)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t.width,t.height,0,r.RGBA,r.UNSIGNED_BYTE,t.data)):A().getNumber(\"WEBGL_VERSION\")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,t)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function C0(r,e,t,o){let n=r.createBuffer();ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,n));let i=4*4*e*t;return ce(r,()=>r.bufferData(r.PIXEL_PACK_BUFFER,i,r.STREAM_READ)),ce(r,()=>r.readPixels(0,0,t,e,r.RGBA,r.FLOAT,0)),ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,null)),n}function w0(r,e,t){let o=r,n=new Float32Array(t);return o.bindBuffer(o.PIXEL_PACK_BUFFER,e),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,n),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),n}function S0(r,e,t,o){let[n,s]=Sp(e,t),a=4,i=new Uint8Array(uD(e*t,a));return ce(r,()=>r.readPixels(0,0,n,s,o.downloadTextureFormat,r.UNSIGNED_BYTE,i)),new Float32Array(i.buffer)}function I0(r,e,t,o,n,s,a,i){let p=r,u=new Float32Array(pD(s,a));return p.bindBuffer(p.PIXEL_PACK_BUFFER,e),p.getBufferSubData(p.PIXEL_PACK_BUFFER,0,u),p.bindBuffer(p.PIXEL_PACK_BUFFER,null),u}function v0(r,e,t){let o=new Float32Array(e*t*4);return ce(r,()=>r.readPixels(0,0,t,e,r.RGBA,r.FLOAT,o)),o}var kp=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];let t=A().getNumber(\"WEBGL_VERSION\");if(e!=null?(this.gl=e,BI(t,e)):this.gl=Zr(t),e=this.gl,A().getNumber(\"WEBGL_VERSION\")===2){let s=e;this.createVertexArray=()=>ce(s,()=>s.createVertexArray()),this.bindVertexArray=a=>ce(s,()=>s.bindVertexArray(a)),this.deleteVertexArray=a=>ce(s,()=>s.deleteVertexArray(a)),this.getVertexArray=()=>ce(s,()=>s.getParameter(s.VERTEX_ARRAY_BINDING))}else if(e!=null){let s=e.getExtension(\"OES_vertex_array_object\");if(s==null)throw new Error(\"All WebGL1 implementations are expected to offer OES_vertex_array_object.\");this.createVertexArray=()=>ce(e,()=>s.createVertexArrayOES()),this.bindVertexArray=a=>ce(e,()=>s.bindVertexArrayOES(a)),this.deleteVertexArray=a=>ce(e,()=>s.deleteVertexArrayOES(a)),this.getVertexArray=()=>ce(e,()=>e.getParameter(s.VERTEX_ARRAY_BINDING_OES))}let o=\"WEBGL_color_buffer_float\",n=\"EXT_color_buffer_half_float\";if(this.parallelCompilationExtension=this.gl.getExtension(\"KHR_parallel_shader_compile\"),A().getNumber(\"WEBGL_VERSION\")===1){let s=\"OES_texture_float\",a=\"OES_texture_half_float\";if(this.textureFloatExtension=Rl(this.gl,s),Jr(this.gl,a))this.textureHalfFloatExtension=Rl(this.gl,a);else if(A().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(o),Jr(this.gl,n))this.colorBufferHalfFloatExtension=Rl(this.gl,n);else if(A().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(o=\"EXT_color_buffer_float\",Jr(this.gl,o))this.colorBufferFloatExtension=this.gl.getExtension(o);else if(Jr(this.gl,n))this.colorBufferHalfFloatExtension=this.gl.getExtension(n);else throw new Error(\"GL context does not support color renderable floats\");this.vertexBuffer=l0(this.gl),this.indexBuffer=c0(this.gl),this.framebuffer=QI(this.gl),this.textureConfig=rm(this.gl,this.textureHalfFloatExtension)}get debug(){return A().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;ce(e,()=>e.finish()),ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),ce(e,()=>e.deleteFramebuffer(this.framebuffer)),ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),ce(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),m0(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),d0(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),f0(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),b0(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,o,n){this.throwIfDisposed(),y0(this.gl,e,t,o,n,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),g0(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),h0(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(ah(this.gl,this.framebuffer),this.outputTexture=null),ce(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,o){return this.downloadMatrixDriver(e,()=>S0(this.gl,t,o,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,o,n,s,a){return I0(this.gl,e,t,o,n,s,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return w0(this.gl,e,t)}createBufferFromTexture(e,t,o){this.bindTextureToFrameBuffer(e);let n=C0(this.gl,t,o,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,o;if(A().getBool(\"WEBGL_FENCE_API_ENABLED\")){let n=e,s=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),o=()=>{let a=n.clientWaitSync(s,0,0);return a===n.ALREADY_SIGNALED||a===n.CONDITION_SATISFIED},t=s}else A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")>0?(t=this.beginQuery(),this.endQuery(),o=()=>this.isQueryAvailable(t,A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))):o=()=>!0;return{query:t,isFencePassed:o}}downloadMatrixFromPackedTexture(e,t,o){return this.downloadMatrixDriver(e,()=>v0(this.gl,t,o))}createProgram(e){this.throwIfDisposed();let t=this.gl;this.vertexShader==null&&(this.vertexShader=p0(t));let o=HI(t);ce(t,()=>t.attachShader(o,this.vertexShader)),ce(t,()=>t.attachShader(o,e)),KI(t,o);let n=Object.assign(o,{vao:this.createVertexArray()});return this.debug&&om(t,n),n}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);let t=this.gl;ce(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),x0(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&(ce(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&om(this.gl,this.program),ce(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,o=!0){return this.throwIfDisposed(),o?ZI(this.gl,e,t):JI(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),ce(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,o){this.throwIfDisposed(),this.throwIfNoProgram(),e0(this.gl,e,t,o)}setOutputMatrixTexture(e,t,o){this.setOutputMatrixTextureDriver(e,o,t)}setOutputPackedMatrixTexture(e,t,o){this.throwIfDisposed();let[n,s]=Ga(t,o);this.setOutputMatrixTextureDriver(e,n,s)}setOutputMatrixWriteRegion(e,t,o,n){this.setOutputMatrixWriteRegionDriver(o,e,n,t)}setOutputPackedMatrixWriteRegion(e,t,o,n){throw new Error(\"setOutputPackedMatrixWriteRegion not implemented.\")}debugValidate(){this.program!=null&&om(this.gl,this.program),Dl(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;if(this.debug){let t=this.getVertexArray();console.assert(t===this.program.vao,\"VAO changed between setProgram and executeProgram!\"),this.debugValidate()}ce(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),ce(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=Rl(this.gl,A().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(A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.createQuery();return o.beginQuery(n.TIME_ELAPSED_EXT,s),s}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\")===2){let t=this.gl,o=this.getQueryTimerExtensionWebGL2();t.endQuery(o.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await y.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))),this.getQueryTime(e,A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION\"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let o=this.gl;return o.getQueryParameter(e,o.QUERY_RESULT)/1e6}else{let o=this.getQueryTimerExtensionWebGL1();return o.getQueryObjectEXT(e,o.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.getQueryParameter(e,o.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}else{let o=this.getQueryTimerExtensionWebGL1(),n=o.getQueryObjectEXT(e,o.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(o.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=yJ(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:o}=this.itemsToPoll[t];o()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let o;\"setTimeoutCustom\"in A().platform&&(o=A().platform.setTimeoutCustom.bind(A().platform)),y.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,o)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),nm(this.gl,e,this.framebuffer),this.debug&&Dl(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(nm(this.gl,this.outputTexture,this.framebuffer),this.debug&&Dl(this.gl)):ah(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let o=t();return this.unbindTextureToFrameBuffer(),o}setOutputMatrixTextureDriver(e,t,o){this.throwIfDisposed();let n=this.gl;nm(n,e,this.framebuffer),this.debug&&Dl(n),this.outputTexture=e,ce(n,()=>n.viewport(0,0,t,o)),ce(n,()=>n.scissor(0,0,t,o))}setOutputMatrixWriteRegionDriver(e,t,o,n){this.throwIfDisposed(),ce(this.gl,()=>this.gl.scissor(e,t,o,n))}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 yJ(r){let e=0;for(;e`${r}.${t}`)}function At(r,e){return e===1?[r]:N0(r,e)}function fA(r,e){if(r===1)return\"rc\";let t=\"\";for(let o=0;o ${this.enableShapeUniforms?\"outShape\":this.outputShape[0]}`;let t=\"\";for(let o=this.rank-2;o= ${this.enableShapeUniforms?`outShape[${o}]`:this.outputShape[o]}`,o= ${o};\n bool rEdge = rp1 >= ${n};\n `}getOutput(e){let t=this.getSourceCoordsArr(e);return this.rank===1?`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?\"outShape\":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${t[0]}),\n cEdge ? 0. : getA(${t[1]}),\n rEdge ? 0. : getA(${t[2]}),\n rEdge || cEdge ? 0. : getA(${t[3]})`}};var Wl=class{constructor(e,t){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"inputShape\",type:\"ivec3\"}],this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length);let o=\"\";for(let n=0;n<4;n++){let s=\"thisRC = rc;\";n%2===1&&(s+=\"thisRC.z += 1;\"),n>1&&(s+=\"thisRC.y += 1;\"),o+=`\n ${s}\n ${n>0?\"if(thisRC.y < rows && thisRC.z < cols){\":\"\"}\n int flatIndex = getFlatIndex(thisRC);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex);\n vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[${n}] =\n getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims);\n ${n>0?\"}\":\"\"}\n `}this.userCode=`\n ${bJ(t,this.enableShapeUniforms)}\n ${this.enableShapeUniforms?Ol():Pl(e)}\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.);\n\n ivec3 thisRC;\n int rows = ${this.enableShapeUniforms?\"outShape[1]\":e[1]};\n int cols = ${this.enableShapeUniforms?\"outShape[2]\":e[2]};\n\n ${o}\n\n setOutput(result);\n }\n `}};function bJ(r,e){return`\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ${e?fD([\"r\",\"c\",\"d\"],\"inputShape\"):Qs([\"r\",\"c\",\"d\"],r)}\n return ivec3(r, c, d);\n }\n `}var vh=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,o){let n=gA(t,o),s=xA(e,n,o);s in this.freeTextures||(this.freeTextures[s]=[]),s in this.usedTextures||(this.usedTextures[s]=[]);let a=hA(e,n,this.gpgpu.gl,this.gpgpu.textureConfig,o);if(this.freeTextures[s].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=a,this.log();let p=this.freeTextures[s].pop();return this.usedTextures[s].push(p),p}let i;return n===or.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):n===or.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):n===or.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):n===or.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):n===or.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[s].push(i),this.numUsedTextures++,this._numBytesAllocated+=a,this.log(),i}releaseTexture(e,t,o,n){if(this.freeTextures==null)return;let s=gA(o,n),a=xA(t,s,n);a in this.freeTextures||(this.freeTextures[a]=[]);let i=hA(t,s,this.gpgpu.gl,this.gpgpu.textureConfig,n),p=A().getNumber(\"WEBGL_DELETE_TEXTURE_THRESHOLD\");p!==-1&&this._numBytesAllocated>p?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=i):(this.freeTextures[a].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let u=this.usedTextures[a],l=u&&u.indexOf(e);if(l==null||l<0)throw new Error(\"Cannot release a texture that was never provided by this texture manager\");u[l]=u[u.length-1],u.pop(),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.texture)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function CJ(r,e){let t=r;if(e===t.R32F)return 4;if(e===t.R16F)return 2;if(e===t.RGBA32F)return 16;if(e===r.RGBA)return 16;if(e===t.RGBA16F)return 8;if(e===t.RGBA8)return 4;throw new Error(`Unknown internal format ${e}`)}function hA(r,e,t,o,n){let s=wJ(e,o),a;if(n){let[p,u]=Ga(r[0],r[1]);a=p*u}else{let[p,u]=Sp(r[0],r[1]);a=p*u}let i=CJ(t,s);return a*i}function wJ(r,e){switch(r){case or.PACKED_2X2_FLOAT32:return yh(e);case or.PACKED_2X2_FLOAT16:return bh(e);case or.UNPACKED_FLOAT32:return hh(e);case or.UNPACKED_FLOAT16:return gh(e);case or.PACKED_4X1_UNSIGNED_BYTE:return xh(e);default:throw new Error(`Unknown physical texture type ${r}`)}}function SJ(r){return A().getBool(\"WEBGL_RENDER_FLOAT32_ENABLED\")?r?or.PACKED_2X2_FLOAT32:or.UNPACKED_FLOAT32:r?or.PACKED_2X2_FLOAT16:or.UNPACKED_FLOAT16}function gA(r,e){if(r===hr.UPLOAD)return or.PACKED_2X2_FLOAT32;if(r===hr.RENDER||r==null)return SJ(e);if(r===hr.DOWNLOAD||r===hr.PIXELS)return or.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${r}`)}function xA(r,e,t){return`${r[0]}_${r[1]}_${e}_${t}`}var nr=class{constructor(e,t){this.variableNames=[\"A\"],this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=`\n float unaryOperation(float x) {\n ${t}\n }\n\n void main() {\n float x = getAAtOutCoords();\n float y = unaryOperation(x);\n\n setOutput(y);\n }\n `}},Gt=\"if (isnan(x)) return x;\",yA=\"return x;\",T0=\"return abs(x);\";var bA=\"return (x >= 0.0) ? x : (exp(x) - 1.0);\",CA=Gt+`\n return (x < 0.0) ? 0.0 : x;\n`,wA=Gt+`\n return (x < 0.0) ? 0.0 : min(6.0, x);\n`,Ha=\"return x;\",SA=\"return 1.0 / (1.0 + exp(-1.0 * x));\";var vA=\"return x;\",kA=`\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n`,NA=`\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,TA=`\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,_A=\"return 1.0 / (1.0 + exp(-1.0 * x));\",Lr=class{constructor(e,t){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=`\n vec4 unaryOperation(vec4 x) {\n ${t}\n }\n\n void main() {\n vec4 x = getAAtOutCoords();\n vec4 y = unaryOperation(x);\n\n setOutput(y);\n }\n `}};var kh=class{constructor(e){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length);let t=e.length,o=At(\"rc\",t),n=Re(t),s=fA(t,o),a=o.slice(-2),i=t<=1?\"rc\":`vec2(${a.join(\",\")})`;this.userCode=`\n void main() {\n ${n} rc = getOutputCoords();\n vec4 packedInput = getA(${s});\n\n setOutput(getChannel(packedInput, ${i}));\n }\n `}};var vJ=Ut.whereImpl,kJ=1e-7,NJ=1e-4,Nh={};function TJ(r){return r in Nh||(Nh[r]={}),Nh[r]}var _J=A().getNumber(\"CPU_HANDOFF_SIZE_THRESHOLD\"),EJ=600;function $J(){return A().global.screen==null?1024:A().global.screen.height*A().global.screen.width*window.devicePixelRatio*EJ/1024/1024}var Ul=class r extends mo{nextDataId(){return r.nextDataId++}constructor(e){if(super(),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,!A().getBool(\"HAS_WEBGL\"))throw new Error(\"WebGL is not supported on this device\");let t;if(e!=null){if(e instanceof kp)t=e;else{let o=Zr(A().getNumber(\"WEBGL_VERSION\"),e);t=new kp(o)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{let o=Zr(A().getNumber(\"WEBGL_VERSION\"));t=new kp(o),this.binaryCache=TJ(A().getNumber(\"WEBGL_VERSION\")),this.gpgpuCreatedLocally=!0}this.gpgpu=t,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new vh(this.gpgpu),this.numMBBeforeWarning=$J(),this.texData=new mn(this,cr())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(e,t,o,n,s,a){let i=this.makeTensorInfo(t,o),p=this.texData.get(i.dataId);p.isPacked=!1,p.texture={texture:e,texShape:[n,s]},p.texShape=[n,s];let u=Al(t),l=new sm(u,!1,a),c=this.runWebGLProgram(l,[i],o,[[n,s]]);return c.shape=t,p.texture=null,this.disposeIntermediateTensorInfo(i),c.dataId}write(e,t,o){if((A().getBool(\"WEBGL_CHECK_NUMERICAL_PROBLEMS\")||A().getBool(\"DEBUG\"))&&this.checkNumericalProblems(e),o===\"complex64\"&&e!=null)throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");let n={id:this.nextDataId()};return this.texData.set(n,{shape:t,dtype:o,values:e,usage:hr.UPLOAD,refCount:1}),n}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,o,n,s){if(A().getBool(\"DEBUG\")&&this.checkNumericalProblems(t),n===\"complex64\")throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");this.texData.set(e,{shape:o,dtype:n,values:t,usage:hr.UPLOAD,refCount:s})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:o,dtype:n,complexTensorInfos:s,slice:a,shape:i,isPacked:p}=t;if(a!=null){let m;p?m=new Lr(i,Ha):m=new nr(i,Ha);let d=this.runWebGLProgram(m,[{dataId:e,shape:i,dtype:n}],n),f=this.readSync(d.dataId);return this.disposeIntermediateTensorInfo(d),f}if(o!=null)return this.convertAndCacheOnCPU(e);if(n===\"string\")return o;let u=this.activeTimers!=null,l;u&&(l=y.now());let c;if(n===\"complex64\"){let m=this.readSync(s.real.dataId),d=this.readSync(s.imag.dataId);c=C.mergeRealAndImagArrays(m,d)}else c=this.getValuesFromTexture(e);return u&&(this.downloadWaitMs+=y.now()-l),this.convertAndCacheOnCPU(e,c)}async read(e){if(this.pendingRead.has(e)){let f=this.pendingRead.get(e);return new Promise(h=>f.push(h))}let t=this.texData.get(e),{values:o,shape:n,slice:s,dtype:a,complexTensorInfos:i,isPacked:p}=t;if(s!=null){let f;p?f=new Lr(n,Ha):f=new nr(n,Ha);let h=this.runWebGLProgram(f,[{dataId:e,shape:n,dtype:a}],a),g=this.read(h.dataId);return this.disposeIntermediateTensorInfo(h),g}if(o!=null)return this.convertAndCacheOnCPU(e);if(A().getBool(\"DEBUG\")&&!A().getBool(\"WEBGL_DOWNLOAD_FLOAT_ENABLED\")&&A().getNumber(\"WEBGL_VERSION\")===2)throw new Error(\"tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.\");let u=null,l;if(a!==\"complex64\"&&A().get(\"WEBGL_BUFFER_SUPPORTED\")){l=this.decode(e);let f=this.texData.get(l.dataId);u=this.gpgpu.createBufferFromTexture(f.texture.texture,...tm(n))}this.pendingRead.set(e,[]),a!==\"complex64\"&&await this.gpgpu.createAndWaitForFence();let c;if(a===\"complex64\"){let f=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),h=f[0],g=f[1];c=C.mergeRealAndImagArrays(h,g)}else if(u==null)c=this.getValuesFromTexture(e);else{let f=y.sizeFromShape(n);c=this.gpgpu.downloadFloat32MatrixFromBuffer(u,f)}if(l!=null&&this.disposeIntermediateTensorInfo(l),u!=null){let f=this.gpgpu.gl;ce(f,()=>f.deleteBuffer(u))}let m=this.convertAndCacheOnCPU(e,c),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach(f=>f(m)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&cr().removeDataId(e,this),this.pendingDeletes--),m}readToGPU(e,t={}){let o=this.texData.get(e),{values:n,shape:s,slice:a,dtype:i,isPacked:p,texture:u}=o;if(i===\"complex64\")throw new Error(\"Does not support reading texture for complex64 dtype.\");if(a!=null){let d;p?d=new Lr(s,Ha):d=new nr(s,Ha);let f=this.runWebGLProgram(d,[{dataId:e,shape:s,dtype:i}],i),h=this.readToGPU(f,t);return this.disposeIntermediateTensorInfo(f),h}if(u==null)throw n!=null?new Error(\"Data is not on GPU but on CPU.\"):new Error(\"There is no data on GPU or CPU.\");let l=this.decode(e,t.customTexShape),c=cr().makeTensorFromTensorInfo(l),m=this.texData.get(l.dataId);return Object.assign({tensorRef:c},m.texture)}bufferSync(e){let t=this.readSync(e.dataId);if(e.dtype===\"string\")try{let o=t.map(n=>y.decodeString(n));return ie(e.shape,e.dtype,o)}catch(o){throw new Error(\"Failed to decode encoded string bytes into utf-8\")}return ie(e.shape,e.dtype,t)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}time(e){let t=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,e();let s=y.flatten(this.activeTimers.map(p=>p.query)).filter(p=>p!=null),a=y.flatten(this.activeTimers.map(p=>p.name)).filter(p=>p!=null);this.activeTimers=t,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\")>0){let p=await Promise.all(s);i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,l)=>({name:a[l],ms:u})).map(u=>`${u.name}: ${u.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 A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\")>0?this.gpgpu.beginQuery():{startMs:y.now(),endMs:null}}endTimer(e){return A().getNumber(\"WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE\")>0?(this.gpgpu.endQuery(),e):(e.endMs=y.now(),e)}async getQueryTime(e){if(A().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:o}=this.texData.get(e);return o!=null&&(this.disposeData(o.real.dataId,t),this.disposeData(o.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:o,texShape:n,usage:s,isPacked:a,slice:i}=this.texData.get(e),p=i&&i.origDataId||e,u=this.dataRefCount.get(p);u>1?this.dataRefCount.set(p,u-1):(this.dataRefCount.delete(p),t!=null&&(this.numBytesInGPU-=this.computeBytes(n,o),this.textureManager.releaseTexture(t,n,s,a)));let l=this.texData.get(e);l.texture=null,l.texShape=null,l.isPacked=!1,l.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=_J){return A().getBool(\"WEBGL_CPU_FORWARD\")&&e.every(o=>this.texData.get(o.dataId).texture==null&&y.sizeFromShape(o.shape)0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,e,t)}else n=this.write(o,e,t);return this.texData.get(n).usage=null,{dataId:n,shape:e,dtype:t}}makeOutput(e,t,o){return cr().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,o),this)}unpackTensor(e){let t=new kh(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new Ih(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){let o=[ki(e.shape),...Ni(e.shape)],n={dtype:e.dtype,shape:o,dataId:e.dataId},s=[ki(t),...Ni(t)],a=new Wl(s,o),i=!0,p=[o],u=this.runWebGLProgram(a,[n],e.dtype,p,i);return{dataId:u.dataId,shape:t,dtype:u.dtype}}decode(e,t){let o=this.texData.get(e),{isPacked:n,shape:s,dtype:a}=o;if(t!=null){let m=y.sizeFromShape(s),d=t[0]*t[1]*4;y.assert(m<=d,()=>\"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.\")}let i=Al(s),p;n?p=new ch(i):p=new lh(i);let u=!0,l=[t!=null?t:tm(i)],c=this.runWebGLProgram(p,[{shape:i,dtype:a,dataId:e}],a,l,u,t);return{dtype:a,shape:s,dataId:c.dataId}}runWebGLProgram(e,t,o,n,s=!1,a){let i=this.makeTensorInfo(e.outputShape,o),p=this.texData.get(i.dataId);if(e.packedOutput&&(p.isPacked=!0),e.outPackingScheme===Iu.DENSE){let x=a!=null?a:tm(e.outputShape);p.texShape=x.map(b=>b*2)}if(e.outTexUsage!=null&&(p.usage=e.outTexUsage),y.sizeFromShape(i.shape)===0)return p.values=y.getTypedArrayFromDType(i.dtype,0),i;let u=[],l=t.map(x=>{if(x.dtype===\"complex64\")throw new Error(\"GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.\");let b=this.texData.get(x.dataId);if(b.texture==null){if(!e.packedInputs&&y.sizeFromShape(x.shape)<=A().getNumber(\"WEBGL_SIZE_UPLOAD_UNIFORM\"))return{shape:x.shape,texData:null,isUniform:!0,uniformValues:b.values};e.packedInputs&&(b.isPacked=!0,b.shape=x.shape)}if(this.uploadToGPU(x.dataId),!!b.isPacked!=!!e.packedInputs)x=b.isPacked?this.unpackTensor(x):this.packTensor(x),u.push(x),b=this.texData.get(x.dataId);else if(b.isPacked&&!vu(b.shape,x.shape)){let w=x,S=x.shape;x.shape=b.shape,x=this.packedReshape(x,S),u.push(x),b=this.texData.get(x.dataId),w.shape=S}return{shape:x.shape,texData:b,isUniform:!1}});this.uploadToGPU(i.dataId);let c={shape:i.shape,texData:p,isUniform:!1},m=SD(e,l,c),d=this.getAndSaveBinary(m,()=>CD(this.gpgpu,e,l,c)),f=this.activeTimers!=null,h;f&&(h=this.startTimer()),A().get(\"ENGINE_COMPILE_ONLY\")||wD(this.gpgpu,d,l,c,n),u.forEach(x=>this.disposeIntermediateTensorInfo(x)),f&&(h=this.endTimer(h),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(h)}));let g=A().getNumber(\"WEBGL_FLUSH_THRESHOLD\");if(g>0){let x=y.now();x-this.lastGlFlushTime>g&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=x)}if(!A().getBool(\"WEBGL_LAZILY_UNPACK\")&&p.isPacked&&s===!1){let x=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),x}return i}compileAndRun(e,t,o,n,s=!1){return o=o||t[0].dtype,this.runWebGLProgram(e,t,o,n,s)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(A().getBool(\"IS_TEST\")||Object.keys(this.binaryCache).forEach(t=>{this.gpgpu.deleteProgram(this.binaryCache[t].webGLProgram),delete this.binaryCache[t]}),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=De(()=>{if(!A().get(\"WEBGL_RENDER_FLOAT32_ENABLED\")){let e=A().getBool(\"DEBUG\");A().set(\"DEBUG\",!1);let t=this.abs(ke(1e-8)).dataSync()[0];if(A().set(\"DEBUG\",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?kJ:NJ}uploadToGPU(e){let t=this.texData.get(e),{shape:o,dtype:n,values:s,texture:a,usage:i,isPacked:p}=t;if(a!=null)return;let u=this.activeTimers!=null,l;u&&(l=y.now());let c=t.texShape;if(c==null&&(c=t0(o,p),t.texShape=c),s!=null){let m=Al(o),d,f=c[1],h=c[0],g=s instanceof Uint8Array||s instanceof Uint8ClampedArray;(p||!g)&&([f,h]=Ga(c[0],c[1])),p?d=new fh(m,g):d=new sm(m,g);let x=g?[h,f]:c,b=this.makeTensorInfo(x,n),w=this.texData.get(b.dataId);g?w.usage=hr.PIXELS:w.usage=hr.UPLOAD,w.texShape=x,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(b.dataId),f,h,s);let S=[[h,f]],T=this.runWebGLProgram(d,[b],n,S,!0),E=this.texData.get(T.dataId);t.texShape=E.texShape,t.isPacked=E.isPacked,t.usage=E.usage,A().get(\"ENGINE_COMPILE_ONLY\")?this.disposeData(T.dataId):(t.texture=E.texture,t.values=null,this.texData.delete(T.dataId)),this.disposeIntermediateTensorInfo(b),u&&(this.uploadWaitMs+=y.now()-l)}else{let m=this.acquireTexture(c,i,n,p);t.texture=m}}convertAndCacheOnCPU(e,t){let o=this.texData.get(e),{dtype:n}=o;return t!=null&&(o.values=RJ(t,n)),o.values}acquireTexture(e,t,o,n){if(this.numBytesInGPU+=this.computeBytes(e,o),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,n)}computeBytes(e,t){return e[0]*e[1]*y.bytesPerElement(t)}checkCompileCompletion(){for(let[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){let e=[];if(this.gpgpu.parallelCompilationExtension){for(let[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}else{for(let[,t]of Object.entries(this.binaryCache)){let o=new Promise(n=>{try{this.checkCompletion_(t),n(!0)}catch(s){throw s}});e.push(o)}return Promise.all(e)}}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await IS(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(nh(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error(\"Failed to compile fragment shader.\")):new Error(\"Failed to link vertex and fragment shaders.\");return!0}getUniformLocations(){for(let e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);let{variablesLocations:t,customUniformLocations:o,infLoc:n,nanLoc:s,outShapeLocation:a,outShapeStridesLocation:i,outTexShapeLocation:p}=u0(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=o,e.infLoc=n,e.nanLoc=s,e.outShapeLocation=a,e.outShapeStridesLocation=i,e.outTexShapeLocation=p}}createTensorFromGPUData(e,t,o){e.channels=e.channels||\"RGBA\";let{texture:n,height:s,width:a,channels:i}=e,p=cr().backend;if(!p.gpgpu.gl.isTexture(n))throw new Error(\"The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.\");let u=p.writeTexture(n,t,o,s,a,i);return cr().makeTensorFromDataId(u,t,o,p)}};Ul.nextDataId=0;function RJ(r,e){if(e===\"float32\"||e===\"complex64\")return r;if(e===\"int32\"||e===\"bool\"){let t=e===\"int32\"?new Int32Array(r.length):new Uint8Array(r.length);for(let o=0;onew Ul,2);var sut={forceHalfFloat:EA};var Gl=`\n if (isnan(a)) return a;\n if (isnan(b)) return b;\n`;var Br=class{constructor(e,t,o){this.variableNames=[\"A\",\"B\"],this.outputShape=C.assertAndGetBroadcastShape(t,o),this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=`\n float binaryOperation(float a, float b) {\n ${e}\n }\n\n void main() {\n float a = getAAtOutCoords();\n float b = getBAtOutCoords();\n setOutput(binaryOperation(a, b));\n }\n `}};var to=`\n result.r = isNaN.r ? NAN : result.r;\n result.g = isNaN.g ? NAN : result.g;\n result.b = isNaN.b ? NAN : result.b;\n result.a = isNaN.a ? NAN : result.a;\n`;var eo=class{constructor(e,t,o,n=!1){this.variableNames=[\"A\",\"B\"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=C.assertAndGetBroadcastShape(t,o);let s=this.outputShape.length;this.enableShapeUniforms=lt(s);let a=\"\";if(n)if(s===0||y.sizeFromShape(this.outputShape)===1)a=`\n result.y = 0.;\n result.z = 0.;\n result.w = 0.;\n `;else if(a=`\n ${Re(s)} coords = getOutputCoords();\n `,s===1)this.enableShapeUniforms?a+=`\n result.y = (coords + 1) >= outShape ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `:a+=`\n result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y;\n result.z = 0.;\n result.w = 0.;\n `;else{let p=At(\"coords\",s);this.enableShapeUniforms?a+=`\n bool nextRowOutOfBounds =\n (${p[s-2]} + 1) >= outShape[${s} - 2];\n bool nextColOutOfBounds =\n (${p[s-1]} + 1) >= outShape[${s} - 1];\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `:a+=`\n bool nextRowOutOfBounds =\n (${p[s-2]} + 1) >= ${this.outputShape[s-2]};\n bool nextColOutOfBounds =\n (${p[s-1]} + 1) >= ${this.outputShape[s-1]};\n result.y = nextColOutOfBounds ? 0. : result.y;\n result.z = nextRowOutOfBounds ? 0. : result.z;\n result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;\n `}this.userCode=`\n vec4 binaryOperation(vec4 a, vec4 b) {\n ${e}\n }\n\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n\n vec4 result = binaryOperation(a, b);\n ${a}\n\n setOutput(result);\n }\n `}};function Ft(r){let{inputs:e,backend:t}=r,{x:o}=e;return t.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var $A={kernelName:vo,backendName:\"webgl\",kernelFunc:Ft};function zr(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.makeTensorInfo(o.shape,\"complex64\"),a=t.texData.get(s.dataId),i=Ft({inputs:{x:o},backend:t}),p=Ft({inputs:{x:n},backend:t});return a.complexTensorInfos={real:i,imag:p},s}var RA={kernelName:ei,backendName:\"webgl\",kernelFunc:zr};var _0=\"return (a < 0.) ? b * a : a;\",E0=`\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`;function AJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{alpha:s}=o,a=t.makeTensorInfo([],\"float32\",y.createScalarValue(s,\"float32\")),i=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")?new eo(E0,n.shape,a.shape):new Br(_0,n.shape,a.shape),p=t.runWebGLProgram(i,[n,a],\"float32\");return t.disposeIntermediateTensorInfo(a),p}var DA={kernelName:Yn,backendName:\"webgl\",kernelFunc:AJ};var $0=\"return (a < 0.) ? b * a : a;\",R0=`\n vec4 aLessThanZero = vec4(lessThan(a, vec4(0.)));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`;function FJ(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e,s=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")?new eo(R0,o.shape,n.shape):new Br($0,o.shape,n.shape);return t.runWebGLProgram(s,[o,n],\"float32\")}var AA={kernelName:gs,backendName:\"webgl\",kernelFunc:FJ};var sn=\"if (isnan(x)) return x;\";function xe({opSnippet:r,packedOpSnippet:e,cpuKernelImpl:t,dtype:o}){return({inputs:n,backend:s})=>{let{x:a}=n,i=s,p=o||a.dtype;if(i.shouldExecuteOnCPU([a])&&t!=null){let c=i.texData.get(a.dataId),m=t(c.values,p);return i.makeTensorInfo(a.shape,p,m)}let u=A().getBool(\"WEBGL_PACK_UNARY_OPERATIONS\")&&e!=null,l;return u?l=new Lr(a.shape,e):l=new nr(a.shape,r),i.runWebGLProgram(l,[a],p)}}function st({opSnippet:r,packedOpSnippet:e,checkOutOfBounds:t=!1,supportsComplex:o=!1,cpuKernelImpl:n,dtype:s}){return({inputs:a,backend:i})=>{let{a:p,b:u}=a,l=i;if(o&&p.dtype===\"complex64\"){let f=l.texData.get(p.dataId),h=l.texData.get(u.dataId),[g,x]=[[f.complexTensorInfos.real,h.complexTensorInfos.real],[f.complexTensorInfos.imag,h.complexTensorInfos.imag]].map(w=>{let[S,k]=w,T={dataId:S.dataId,dtype:S.dtype,shape:p.shape},E={dataId:k.dataId,dtype:k.dtype,shape:u.shape},R=new Br(r,p.shape,u.shape);return l.runWebGLProgram(R,[T,E],pt(S.dtype,k.dtype))}),b=zr({inputs:{real:g,imag:x},backend:l});return l.disposeIntermediateTensorInfo(g),l.disposeIntermediateTensorInfo(x),b}let c=s||pt(p.dtype,u.dtype);if((p.dtype===\"string\"||u.dtype===\"string\"||l.shouldExecuteOnCPU([p,u]))&&n!=null){let f=l.texData.get(p.dataId).values,h=l.texData.get(u.dataId).values,g=p.dtype===\"string\"?C.fromUint8ToStringArray(f):f,x=p.dtype===\"string\"?C.fromUint8ToStringArray(h):h,[b,w]=n(p.shape,u.shape,g,x,c),S=l.makeTensorInfo(w,c),k=l.texData.get(S.dataId);return k.values=b,S}let m=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")&&e!=null,d;return m?d=new eo(e,p.shape,u.shape,t):d=new Br(r,p.shape,u.shape),l.runWebGLProgram(d,[p,u],c)}}function Ti(r,e=!1){if(r===\"linear\")return e?vA:yA;if(r===\"relu\")return e?NA:CA;if(r===\"elu\")return e?kA:bA;if(r===\"relu6\")return e?TA:wA;if(r===\"prelu\")return e?R0:$0;if(r===\"leakyrelu\")return e?E0:_0;if(r===\"sigmoid\")return e?_A:SA;throw new Error(`Activation ${r} has not been implemented for the WebGL backend.`)}var Hl=class{constructor(e,t,o,n=!1,s=!1,a=!1,i=null,p=!1,u=!1){this.variableNames=[\"matrixA\",\"matrixB\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=o,this.enableShapeUniforms=lt(this.outputShape.length);let l=n?e[1]:e[2],c=Math.ceil(l/2),m=n?\"i * 2, rc.y\":\"rc.y, i * 2\",d=s?\"rc.z, i * 2\":\"i * 2, rc.z\",f=n?[\"a.xxyy\",\"a.zzww\"]:[\"a.xxzz\",\"a.yyww\"],h=s?[\"b.xzxz\",\"b.ywyw\"]:[\"b.xyxy\",\"b.zwzw\"],g=\"\",x=\"\";i&&(p?g=`vec4 activation(vec4 a) {\n vec4 b = getPreluActivationWeightsAtOutCoords();\n ${i}\n }`:u?g=`vec4 activation(vec4 a) {\n vec4 b = getLeakyreluAlphaAtOutCoords();\n ${i}\n }`:g=`vec4 activation(vec4 x) {\n ${i}\n }`,x=\"result = activation(result);\");let b=a?\"result += getBiasAtOutCoords();\":\"\";a&&this.variableNames.push(\"bias\"),p&&this.variableNames.push(\"preluActivationWeights\"),u&&this.variableNames.push(\"leakyreluAlpha\");let w=\"rc.x\",S=\"rc.x\";e[0]`The new shape (${p}) has ${u} elements and the old shape (${n.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`);let l=a.texData.get(n.dataId);return l.isPacked&&!vu(n.shape,p)&&!(l.texture!==null&&vu(l.shape,p))?OA(n,p,a):(a.incRef(n.dataId),{dataId:n.dataId,shape:p,dtype:n.dtype})}var MA={kernelName:Ca,backendName:\"webgl\",kernelFunc:te};var pm=class{constructor(e,t){this.variableNames=[\"x\"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=e;this.outputShape=[n,a];let i=Math.floor(o/4)*4,p=o%4,u=\"sumValue += dot(values, ones);\";if(t!=null){let c=1/t;u=`sumValue += dot(values * ${y.isInt(c)?c.toPrecision(2):c}, ones);`}let l=\"\";s%o>0&&(l=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return 0.0;\n }\n `),this.userCode=`\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${l}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${o};\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${i}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${u}\n }\n\n int inIdx = inOffset + ${i};\n if (${p===1}) {\n vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0);\n\n ${u}\n } else if (${p===2}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1), 0.0, 0.0);\n\n ${u}\n } else if (${p===3}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2), 0.0);\n\n ${u}\n }\n setOutput(sumValue);\n }\n `}};var Th=class{constructor(e,t){this.variableNames=[\"x\"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=e;this.outputShape=[n,a];let i=\"0.0\",p=\"\";t===\"prod\"?i=\"1.0\":t===\"min\"?(i=\"1.0 / 1e-20\",p=\"min\"):t===\"max\"&&(i=\"-1.0 / 1e-20\",p=\"max\");let u=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t===\"sum\"?u=\"sumValue\":t===\"prod\"?u=\"prodValue\":t===\"all\"?u=\"allValue\":t===\"any\"&&(u=\"anyValue\");let l=Math.floor(o/4)*4,c=o%4,m=`\n if (${t===\"sum\"}) {\n sumValue += dot(values, ones);\n } else if (${t===\"prod\"}) {\n vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]);\n prodValue *= tmp[0] * tmp[1];\n } else {\n minMaxValue = ${p}(values, minMaxValue);\n if (${t===\"min\"} || ${t===\"max\"}) {\n minMaxValue = ${p}(values, minMaxValue);\n bvec4 isNaN = isnan(values);\n if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) {\n minMaxValue = vec4(NAN);\n }\n }\n }\n `,d=\"vec4\";t===\"all\"?(i=\"1.0\",m=`\n bool reducedAllValue = all(values);\n float floatedReducedAllValue = float(reducedAllValue);\n allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0);\n `,d=\"bvec4\"):t===\"any\"&&(i=\"0.0\",m=`\n bool reducedAnyValue = any(values);\n float floatedReducedAnyValue = float(reducedAnyValue);\n anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0);\n `,d=\"bvec4\");let f=\"\";s%o>0&&(f=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return initializationValue;\n }\n `),this.userCode=`\n const float initializationValue = ${i};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float getValue(int batch, int inIdx) {\n ${f}\n return getX(batch, inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${o};\n\n vec4 minMaxValue = vec4(${i});\n float prodValue = 1.0;\n float sumValue = 0.0;\n float allValue = 1.0;\n float anyValue = 0.0;\n\n for (int i = 0; i < ${l}; i += 4) {\n int inIdx = inOffset + i;\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n ${m}\n }\n\n int inIdx = inOffset + ${l};\n if (${c===1}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${m}\n } else if (${c===2}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n ${m}\n } else if (${c===3}) {\n ${d} values = ${d}(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n ${m}\n }\n setOutput(${u});\n }\n `}};function OJ(r){let e=[];for(;e.length===0||e[e.length-1].outSize!==1;){let t=e.length?e[e.length-1].outSize:r[1],o=C.computeOptimalWindowSize(t);e.push({inSize:t,windowSize:o,outSize:Math.ceil(t/o)})}return e}function ro(r,e,t,o){let n=OJ(r.shape),s=r;for(let a=0;a6)throw Error(`Transpose for rank ${e} is not yet supported`);let t=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\",\"resRC.v\"],o=new Array(e);for(let n=0;n6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let n=Re(this.rank),s=N0(\"rc\",this.rank),a=new Array(this.rank);for(let l=0;l`Error in matMul: inner shapes (${c}) and (${m}) of Tensors with shapes ${r.shape} and ${e.shape} and transposeA=${t} and transposeB=${o} must match.`);let k=t?[x,c,d]:[x,d,c],T=o?[b,f,m]:[b,m,f],E=te({inputs:{x:r},backend:n,attrs:{shape:k}}),R=te({inputs:{x:e},backend:n,attrs:{shape:T}}),D=[E,R],F=Math.max(x,b),O=t?E.shape[1]:E.shape[2],M=s!=null,L=a!=null,B=p===\"leakyrelu\",z=p!=null?Ti(p,!0):null,U=M||L||B||z!=null,j;if((d===1||f===1)&&O>A0&&U===!1){let Y=E,J=R;t&&(Y=Ct({inputs:{x:E},backend:n,attrs:{perm:[0,2,1]}}),D.push(Y)),o&&(J=Ct({inputs:{x:R},backend:n,attrs:{perm:[0,2,1]}}),D.push(J));let re=f!==1,ne=f===1,ee=Y;re&&(ee=te({inputs:{x:Y},backend:n,attrs:{shape:[F,O,1]}}),D.push(ee));let oe=f===1?2:1,ue=J;ne&&(ue=te({inputs:{x:J},backend:n,attrs:{shape:[F,1,O]}}),D.push(ue));let me=um({inputs:{a:ee,b:ue},backend:n});j=Tp({inputs:{x:me},backend:n,attrs:{axis:oe,keepDims:!0}}),D.push(me)}else{let Y=pt(r.dtype,e.dtype),J=new Hl(k,T,[F,d,f],t,o,M,z,L,B),re=[E,R];if(s!=null&&re.push(s),L&&re.push(a),B){let ne=n.makeTensorInfo([],\"float32\",y.createScalarValue(i,\"float32\"));re.push(ne),D.push(ne)}j=n.runWebGLProgram(J,re,Y)}let q=te({inputs:{x:j},backend:n,attrs:{shape:S}});D.push(j);for(let Y of D)n.disposeIntermediateTensorInfo(Y);return q}function LJ(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=e,{transposeA:p,transposeB:u,activation:l,leakyreluAlpha:c}=o;return _p({a:n,b:s,transposeA:p,transposeB:u,backend:t,bias:a,preluActivationWeights:i,leakyreluAlpha:c,activation:l})}var VA={kernelName:qo,backendName:\"webgl\",kernelFunc:LJ};var WA=\"return abs(x);\";function BJ(r){let{inputs:e,backend:t}=r,{x:o}=e;if(t.shouldExecuteOnCPU([o])&&o.dtype!==\"complex64\"){let s=t.texData.get(o.dataId),a=wh(s.values);return t.makeTensorInfo(o.shape,o.dtype,a)}let n;return A().getBool(\"WEBGL_PACK_UNARY_OPERATIONS\")?n=new Lr(o.shape,WA):n=new nr(o.shape,WA),t.runWebGLProgram(n,[o],o.dtype)}var UA={kernelName:fn,backendName:\"webgl\",kernelFunc:BJ};var zJ=Gt+`\n if (abs(x) > 1.) {\n return NAN;\n }\n return acos(x);\n`,VJ=xe({opSnippet:zJ}),GA={kernelName:hn,backendName:\"webgl\",kernelFunc:VJ};var WJ=Gt+`\n if (x < 1.0) return NAN;\nreturn log(x + sqrt(x * x - 1.0));`,UJ=xe({opSnippet:WJ}),HA={kernelName:gn,backendName:\"webgl\",kernelFunc:UJ};var KA=\"return a + b;\",GJ=st({opSnippet:KA,packedOpSnippet:KA,supportsComplex:!0,cpuKernelImpl:ID}),qA={kernelName:Rr,backendName:\"webgl\",kernelFunc:GJ};var $h=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`float v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(\" + \");this.userCode=`\n void main() {\n ${o.join(`\n `)}\n\n float result = ${n};\n setOutput(result);\n }\n `}};var Rh=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`vec4 v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(\" + \");this.userCode=`\n void main() {\n ${o.join(`\n `)}\n\n vec4 result = ${n};\n setOutput(result);\n }\n `}};function Dh(r){let{inputs:e,backend:t}=r,o=e;if(o.length===1)return Ft({inputs:{x:o[0]},backend:t});if(o.length>A().getNumber(\"WEBGL_MAX_TEXTURES_IN_SHADER\")){let p=Math.floor(o.length/2),u=Dh({inputs:o.slice(0,p),backend:t}),l=Dh({inputs:o.slice(p),backend:t});return Dh({inputs:[u,l],backend:t})}let n=o.map(p=>p.dtype).reduce((p,u)=>pt(p,u)),s=o.map(p=>p.shape),i=A().getBool(\"WEBGL_PACK\")?new Rh(o[0].shape,s):new $h(o[0].shape,s);return t.runWebGLProgram(i,o,n)}var jA={kernelName:xn,backendName:\"webgl\",kernelFunc:Dh};function HJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,l=C.getAxesPermutation(u,i),c=n;l!=null&&(c=Ct({inputs:{x:n},backend:t,attrs:{perm:l}}),u=C.getInnerMostAxes(u.length,i)),C.assertAxesAreInnerMostDims(\"all\",u,i);let[m,d]=C.computeOutAndReduceShapes(c.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:c},backend:t,attrs:{shape:[-1,f]}}),g=ro(h,h.dtype,\"all\",t),x;if(a){let b=C.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:t,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:t,attrs:{shape:m}});return t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(g),l!=null&&t.disposeIntermediateTensorInfo(c),x}var XA={kernelName:yn,backendName:\"webgl\",kernelFunc:HJ};function KJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,l=C.getAxesPermutation(u,i),c=n;l!=null&&(c=Ct({inputs:{x:n},backend:t,attrs:{perm:l}}),u=C.getInnerMostAxes(u.length,i)),C.assertAxesAreInnerMostDims(\"any\",u,i);let[m,d]=C.computeOutAndReduceShapes(c.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:c},backend:t,attrs:{shape:[-1,f]}}),g=ro(h,h.dtype,\"any\",t),x;if(a){let b=C.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:t,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:t,attrs:{shape:m}});return t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(g),l!=null&&t.disposeIntermediateTensorInfo(c),x}var YA={kernelName:bn,backendName:\"webgl\",kernelFunc:KJ};var Ah=class{constructor(e,t,o){this.variableNames=[\"A\"];let{windowSize:n,batchSize:s,outSize:a}=e;o||this.variableNames.push(\"bestIndicesA\"),this.outputShape=[s,a];let i=t===\"max\"?\">\":\"<\",p=o?\"inOffset + i;\":\"round(getBestIndicesA(batch, inOffset + i));\";this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = outIdx * ${n};\n\n int bestIndex = inOffset;\n float bestValue = getA(batch, bestIndex);\n\n for (int i = 0; i < ${n}; i++) {\n int inIdx = ${p};\n float candidate = getA(batch, inIdx);\n if (candidate ${i} bestValue) {\n bestValue = candidate;\n bestIndex = inIdx;\n }\n }\n setOutput(float(bestIndex));\n }\n `}};var Fh=class{constructor(e,t,o,n){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,y.assert(e.length>2,()=>`Packed arg${o.charAt(0).toUpperCase()+o.slice(1)} supports only inputs with rank above 2.`);let s=e[e.length-1],a=Math.ceil(s/t);this.outputShape=e.slice(0,-1),a>1&&this.outputShape.push(a),n||this.variableNames.push(\"bestIndicesA\");let i=this.outputShape,p=i.length,u=Re(p),l=At(\"coords\",p),c,m;if(a===1){m=p+1;let R=Re(m);c=`\n ${R} sourceLocR = ${R}(${l.join()}, 0);\n ++${l[p-1]};\n ${R} sourceLocG = ${R}(${l.join()}, 0);\n ++${l[p-2]};\n ${R} sourceLocA = ${R}(${l.join()}, 0);\n --${l[p-1]};\n ${R} sourceLocB = ${R}(${l.join()}, 0);\n --${l[p-2]};`}else m=p,c=`\n ${u} sourceLocR = coords;\n ++${l[p-1]};\n ${u} sourceLocG = coords;\n ++${l[p-2]};\n ${u} sourceLocA = coords;\n --${l[p-1]};\n ${u} sourceLocB = coords;\n --${l[p-2]};`;let d=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"].slice(0,m),f=\".\"+d[m-1],h=d.map(R=>\"int \"+R),g=At(\"sourceLocR\",m-1).concat(\"inIdx.r\"),x=At(\"sourceLocG\",m-1).concat(\"inIdx.g\"),b=At(\"sourceLocB\",m-1).concat(\"inIdx.b\"),w=At(\"sourceLocA\",m-1).concat(\"inIdx.a\"),S=o===\"max\"?\"greaterThan\":\"lessThan\",k=n?\"\":`\n inIdx = round(vec4(getBestIndicesAChannel(${g.join()}),\n getBestIndicesAChannel(${x.join()}),\n getBestIndicesAChannel(${b.join()}),\n getBestIndicesAChannel(${w.join()})));`,T=`vec4(\n getAChannel(${g.join()}),\n hasNextCol ? getAChannel(${x.join()}) : 0.,\n hasNextRow ? getAChannel(${b.join()}) : 0.,\n hasNextRow && hasNextCol ? getAChannel(${w.join()}) : 0.)`,E=n?\"\":`\n float getBestIndicesAChannel(${h.join()}) {\n return getChannel(getBestIndicesA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }`;this.userCode=`\n float getAChannel(${h.join()}) {\n return getChannel(getA(${d.join()}),\n vec2(${d.slice(-2).join()}));\n }\n ${E}\n void main() {\n ${u} coords = getOutputCoords();\n bool hasNextCol = ${l[p-1]} < ${i[p-1]-1};\n bool hasNextRow = ${l[p-2]} < ${i[p-2]-1};\n ${c}\n ivec4 srcIdx = ivec4(sourceLocR${f}, sourceLocG${f},\n sourceLocB${f}, sourceLocA${f}) * ${t};\n ivec4 inIdx = srcIdx;\n vec4 bestIndex = vec4(inIdx);\n vec4 bestValue = ${T};\n\n for (int i = 0; i < ${t}; i++) {\n inIdx = srcIdx;\n ${k}\n vec4 candidate = ${T};\n bvec4 nan = isnan(candidate);\n bvec4 replace = bvec4(\n vec4(${S}(candidate, bestValue)) * (vec4(1.0) - vec4(nan)));\n\n bestValue = vec4(replace.x ? candidate.x : bestValue.x,\n replace.y ? candidate.y : bestValue.y,\n replace.z ? candidate.z : bestValue.z,\n replace.w ? candidate.w : bestValue.w);\n bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace));\n srcIdx++;\n }\n setOutput(bestIndex);\n }\n `}};function QA(r,e,t,o=null){let n=e.shape[0],s=e.shape[1];o!=null&&(n=o.shape[0],s=o.shape[1]);let a=C.computeOptimalWindowSize(s),i={windowSize:a,inSize:s,batchSize:n,outSize:Math.ceil(s/a)},p=new Ah(i,t,o==null),u=[e];o!=null&&u.push(o);let l=r.runWebGLProgram(p,u,\"int32\");if(l.shape[1]===1)return l;let c=QA(r,e,t,l);return r.disposeIntermediateTensorInfo(l),c}function ZA(r,e,t,o=null){let n=o!=null?o.shape:e.shape,s=n[n.length-1],a=C.computeOptimalWindowSize(s),i=new Fh(n,a,t,o==null),p=o==null?[e]:[e,o],u=r.runWebGLProgram(i,p,\"int32\");if(u.shape.length===e.shape.length){let l=ZA(r,e,t,u);return r.disposeIntermediateTensorInfo(u),l}return u}function Ph(r,e,t,o){let n=[t];if(C.assertAxesAreInnerMostDims(\"arg\"+o.charAt(0).toUpperCase()+o.slice(1),n,e.shape.length),!A().getBool(\"WEBGL_PACK_REDUCE\")||e.shape.length<=2){let s=[],a=r.texData.get(e.dataId),i=a!==null&&a.isPacked,p=e;i&&(p=r.unpackTensor(e),s.push(p));let[u,l]=C.computeOutAndReduceShapes(p.shape,n),c=y.sizeFromShape(l),m=te({inputs:{x:p},backend:r,attrs:{shape:[-1,c]}});s.push(m);let d=QA(r,m,o);s.push(d);let f=te({inputs:{x:d},backend:r,attrs:{shape:u}});return s.forEach(h=>r.disposeIntermediateTensorInfo(h)),f}return ZA(r,e,o)}function qJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Ct({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims(\"argMax\",[a[0]],p.shape.length);let l=Ph(t,p,a[0],\"max\");return u.forEach(c=>t.disposeIntermediateTensorInfo(c)),l}var JA={kernelName:na,backendName:\"webgl\",kernelFunc:qJ};function jJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Ct({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims(\"argMin\",[a[0]],p.shape.length);let l=Ph(t,p,a[0],\"min\");return u.forEach(c=>t.disposeIntermediateTensorInfo(c)),l}var eF={kernelName:sa,backendName:\"webgl\",kernelFunc:jJ};var XJ=Gt+`\n if (abs(x) > 1.) {\n return NAN;\n }\n return asin(x);\n`,YJ=xe({opSnippet:XJ}),tF={kernelName:Cn,backendName:\"webgl\",kernelFunc:YJ};var QJ=Gt+\"return log(x + sqrt(x * x + 1.0));\",ZJ=xe({opSnippet:QJ}),rF={kernelName:wn,backendName:\"webgl\",kernelFunc:ZJ};var JJ=Gt+`\n return atan(x);\n`,eee=xe({opSnippet:JJ}),oF={kernelName:Sn,backendName:\"webgl\",kernelFunc:eee};var tee=Gl+`\n return atan(a, b);\n`,ree=`\n vec4 result = atan(a, b);\n bvec4 isNaNA = isnan(a);\n bvec4 isNaNB = isnan(b);\n bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w);\n `+to+`\n return result;\n`,oee=st({opSnippet:tee,packedOpSnippet:ree}),nF={kernelName:vn,backendName:\"webgl\",kernelFunc:oee};var nee=Gt+`\n if ((x < -1.0) || (x > 1.0)) return NAN;\nreturn (log(1.0 + x) - log(1.0 - x)) / 2.0;`,see=xe({opSnippet:nee}),sF={kernelName:In,backendName:\"webgl\",kernelFunc:see};var Zs=class{constructor(e,t,o,n=!1,s=!1){if(this.variableNames=[\"x\"],t===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");let a=e.filterWidth,i=e.strideHeight,p=e.strideWidth,u=e.dilationHeight,l=e.dilationWidth,c=e.effectiveFilterHeight,m=e.effectiveFilterWidth,d=e.padInfo.top,f=e.padInfo.left;this.outputShape=e.outShape;let h=t===\"avg\",g=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,x=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,b=\"0.0\";if(h||(b=\"-1.0 / 1e-20\"),o){let R=\">=\";this.userCode=`\n const ivec2 strides = ivec2(${i}, ${p});\n const ivec2 pads = ivec2(${d}, ${f});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n float avgValue = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${u}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${m};\n wC += ${l}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xR, xC, d);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${R} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${n?s?g:x:`wR * ${m} + wC`};\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `;return}let w=\"max\",S=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t===\"avg\"&&(S=\"avgValue / max(count, 1.0)\");let k=Math.floor(a/4)*4,T=a%4,E=`\n if (${h}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ${w}(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec2 strides = ivec2(${i}, ${p});\n const ivec2 pads = ivec2(${d}, ${f});\n const float initializationValue = ${b};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xR, int xC, int d) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xR, xC, d);\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d = coords[3];\n\n ivec2 xRCCorner = coords.yz * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // max/min x(?, ?, d) to get y(yR, yC, d).\n // ? = to be determined\n vec4 minMaxValue = vec4(${b});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wR = 0; wR < ${c};\n wR += ${u}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${k}; wC += 4) {\n int xC = xCCorner + wC * ${l};\n\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${l}, d),\n getValue(batch, xR, xC + 2 * ${l}, d),\n getValue(batch, xR, xC + 3 * ${l}, d)\n );\n\n ${E}\n }\n\n int xC = xCCorner + ${k};\n if (${T===1}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${T===2}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${l}, d),\n initializationValue,\n initializationValue\n );\n\n ${E}\n } else if (${T===3}) {\n vec4 values = vec4(\n getValue(batch, xR, xC, d),\n getValue(batch, xR, xC + ${l}, d),\n getValue(batch, xR, xC + 2 * ${l}, d),\n initializationValue\n );\n\n ${E}\n }\n }\n setOutput(${S});\n }\n `}},Nu=class{constructor(e,t,o,n=!1,s=!1){if(this.variableNames=[\"x\"],t===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");let a=e.filterWidth,i=e.strideDepth,p=e.strideHeight,u=e.strideWidth,l=e.dilationDepth,c=e.dilationHeight,m=e.dilationWidth,d=e.effectiveFilterDepth,f=e.effectiveFilterHeight,h=e.effectiveFilterWidth,g=e.padInfo.front,x=e.padInfo.top,b=e.padInfo.left;this.outputShape=e.outShape;let w=t===\"avg\",S=\"0.0\";if(w||(S=\"-1.0 / 1e-20\"),o){let F=\">=\";this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${p}, ${u});\n const ivec3 pads = ivec3(${g}, ${x}, ${b});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch).\n // ? = to be determined\n float minMaxValue = 0.0;\n float minMaxValueFound = 0.0;\n int minMaxPosition = 0;\n\n for (int wD = 0; wD < ${d};\n wD += ${l}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${f};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${h};\n wC += ${m}) {\n int xC = xCCorner + wC;\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float value = getX(batch, xD, xR, xC, ch);\n\n // If a min / max value has already been found, use it. If not,\n // use the current value.\n float currMinMaxValue = mix(\n value, minMaxValue, minMaxValueFound);\n if (value ${F} currMinMaxValue) {\n minMaxValue = value;\n minMaxValueFound = 1.0;\n minMaxPosition = ${n?s?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${f} * ${h} +\n wR * ${h} + wC`};\n }\n }\n }\n }\n setOutput(float(minMaxPosition));\n }\n `;return}let k=\"max\",T=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t===\"avg\"&&(T=\"avgValue / max(count, 1.0)\");let E=Math.floor(a/4)*4,R=a%4,D=`\n if (${w}) {\n avgValue += dot(values, ones);\n } else {\n minMaxValue = ${k}(values, minMaxValue);\n }\n `;this.userCode=`\n const ivec3 strides =\n ivec3(${i}, ${p}, ${u});\n const ivec3 pads = ivec3(${g}, ${x}, ${b});\n const float initializationValue = ${S};\n const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0);\n\n float count = 0.0;\n\n float getValue(int batch, int xD, int xR, int xC, int ch) {\n if (xC < 0 || xC >= ${e.inWidth}) {\n return initializationValue;\n }\n count += 1.0;\n return getX(batch, xD, xR, xC, ch);\n }\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xDCorner = xCorner.x;\n int xRCorner = xCorner.y;\n int xCCorner = xCorner.z;\n\n // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch).\n // ? = to be determined\n vec4 minMaxValue = vec4(${S});\n float avgValue = 0.0;\n count = 0.0;\n\n for (int wD = 0; wD < ${d};\n wD += ${l}) {\n int xD = xDCorner + wD;\n\n if (xD < 0 || xD >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${f};\n wR += ${c}) {\n int xR = xRCorner + wR;\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${E}; wC += 4) {\n int xC = xCCorner + wC * ${m};\n\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${m}, ch),\n getValue(batch, xD, xR, xC + 2 * ${m}, ch),\n getValue(batch, xD, xR, xC + 3 * ${m}, ch)\n );\n\n ${D}\n }\n\n int xC = xCCorner + ${E};\n if (${R===1}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n ${D}\n } else if (${R===2}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${m}, ch),\n initializationValue,\n initializationValue\n );\n\n ${D}\n } else if (${R===3}) {\n vec4 values = vec4(\n getValue(batch, xD, xR, xC, ch),\n getValue(batch, xD, xR, xC + ${m}, ch),\n getValue(batch, xD, xR, xC + 2 * ${m}, ch),\n initializationValue\n );\n\n ${D}\n }\n }\n }\n setOutput(${T});\n }\n `}};function aee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e;Ys(n,\"avgPool\");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(C.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p);if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))return Ft({inputs:{x:n},backend:t});let c=new Zs(l,\"avg\",!1);return t.runWebGLProgram(c,[n],\"float32\")}var aF={kernelName:kn,backendName:\"webgl\",kernelFunc:aee};function iee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,p,u),m=new Nu(c,\"avg\",!1);return t.runWebGLProgram(m,[n],\"float32\")}var iF={kernelName:aa,backendName:\"webgl\",kernelFunc:iee};var Oh=class{constructor(e){this.variableNames=[\"dy\"],this.outputShape=e.inShape;let t=e.filterHeight,o=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=e.dilationHeight,i=e.dilationWidth,p=e.effectiveFilterHeight,u=e.effectiveFilterWidth,l=p-1-e.padInfo.top,c=u-1-e.padInfo.left,m=1/(t*o);this.userCode=`\n const ivec2 pads = ivec2(${l}, ${c});\n const float avgMultiplier = float(${m});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${p};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${u};\n wC+= ${i}) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n setOutput(dotProd);\n }\n `}},Mh=class{constructor(e){this.variableNames=[\"dy\"],this.outputShape=e.inShape;let t=e.filterDepth,o=e.filterHeight,n=e.filterWidth,s=e.strideDepth,a=e.strideHeight,i=e.strideWidth,p=e.dilationDepth,u=e.dilationHeight,l=e.dilationWidth,c=e.effectiveFilterDepth,m=e.effectiveFilterHeight,d=e.effectiveFilterWidth,f=c-1-e.padInfo.front,h=m-1-e.padInfo.top,g=d-1-e.padInfo.left,x=1/(t*o*n);this.userCode=`\n const ivec3 pads = ivec3(${f}, ${h}, ${g});\n const float avgMultiplier = float(${x});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${c};\n wD += ${p}) {\n float dyD = float(dyDCorner + wD) / ${s}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${m};\n wR += ${u}) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${d};\n wC += ${l}) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n\n dotProd += dyValue * avgMultiplier;\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function uee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:l}=o,c=[1,1,1],m=C.computePool3DInfo(a.shape,i,p,c,u,l),d=new Mh(m);return t.runWebGLProgram(d,[n],a.dtype)}var uF={kernelName:Vi,backendName:\"webgl\",kernelFunc:uee};function pee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s;Ys([n,s],\"avgPoolGrad\");let{filterSize:i,strides:p,pad:u}=o,l=C.computePool2DInfo(a.shape,i,p,1,u),c=new Oh(l);return t.runWebGLProgram(c,[n],a.dtype)}var pF={kernelName:zi,backendName:\"webgl\",kernelFunc:pee};function lee(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;return _p({a:n,b:s,transposeA:a,transposeB:i,backend:t})}var lF={kernelName:Nn,backendName:\"webgl\",kernelFunc:lee};var Lh=class{constructor(e,t,o,n,s,a){this.outputShape=[],this.variableNames=[\"x\",\"mean\",\"variance\"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,o);let i=\"0.0\";n!=null&&(C.assertAndGetBroadcastShape(e,n),this.variableNames.push(\"offset\"),i=\"getOffsetAtOutCoords()\");let p=\"1.0\";s!=null&&(C.assertAndGetBroadcastShape(e,s),this.variableNames.push(\"scale\"),p=\"getScaleAtOutCoords()\"),this.outputShape=e,this.userCode=`\n void main() {\n float x = getXAtOutCoords();\n float mean = getMeanAtOutCoords();\n float variance = getVarianceAtOutCoords();\n float offset = ${i};\n float scale = ${p};\n float inv = scale * inversesqrt(variance + float(${a}));\n setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1)));\n }\n `}};var Bh=class{constructor(e,t,o,n,s,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=[\"x\",\"mean\",\"variance\"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,o);let i=\"vec4(0.0)\";n!=null&&(C.assertAndGetBroadcastShape(e,n),this.variableNames.push(\"offset\"),i=\"getOffsetAtOutCoords()\");let p=\"vec4(1.0)\";s!=null&&(C.assertAndGetBroadcastShape(e,s),this.variableNames.push(\"scale\"),p=\"getScaleAtOutCoords()\"),this.outputShape=e,this.userCode=`\n void main() {\n vec4 offset = ${i};\n vec4 scale = ${p};\n\n vec4 x = getXAtOutCoords();\n vec4 mean = getMeanAtOutCoords();\n vec4 variance = getVarianceAtOutCoords();\n\n vec4 inv = scale * inversesqrt(variance + vec4(${a}));\n\n setOutput((x - mean) * inv + offset);\n }\n `}};var cee=({inputs:r,backend:e,attrs:t})=>{let{x:o,mean:n,variance:s,offset:a,scale:i}=r;y.assert(n.shape.length===s.shape.length,()=>\"Batch normalization gradient requires mean and variance to have equal ranks.\"),y.assert(a==null||n.shape.length===a.shape.length,()=>\"Batch normalization gradient requires mean and offset to have equal ranks.\"),y.assert(i==null||n.shape.length===i.shape.length,()=>\"Batch normalization gradient requires mean and scale to have equal ranks.\");let{varianceEpsilon:p}=t;p==null&&(p=.001);let u=[o,n,s],l=null;a!=null&&(l=a.shape,u.push(a));let c=null;i!=null&&(c=i.shape,u.push(i));let m=A().getBool(\"WEBGL_PACK_NORMALIZATION\")?new Bh(o.shape,n.shape,s.shape,l,c,p):new Lh(o.shape,n.shape,s.shape,l,c,p);return e.runWebGLProgram(m,u,u[0].dtype)},cF={kernelName:Hn,backendName:\"webgl\",kernelFunc:cee};var zh=class{constructor(e){this.variableNames=[\"source\"],this.outputShape=e,this.rank=e.length;let t=Re(this.rank);this.customUniforms=[{name:\"start\",arrayIndex:this.rank,type:\"int\"}];let o=mee(this.rank),n,s=e.map((a,i)=>`sourceLoc.${F0[i]} = start[${i}] + coords.${F0[i]};`);n=`\n ${t} sourceLoc;\n ${t} coords = getOutputCoords();\n ${s.join(`\n`)}\n `,this.userCode=`\n void main() {\n ${n}\n setOutput(getSource(${o}));\n }\n `}},F0=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"];function mee(r){if(r===1)return\"sourceLoc\";if(r<=6)return F0.slice(0,r).map(e=>\"sourceLoc.\"+e).join(\",\");throw Error(`Slicing for rank ${r} is not yet supported`)}var Vh=class{constructor(e){this.variableNames=[\"source\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:\"start\",arrayIndex:this.rank,type:\"int\"}];let t=Re(this.rank),o=At(\"coords\",this.rank),n=At(\"sourceLoc\",this.rank),s=this.rank===1?\"sourceLoc\":`vec2(${n.slice(-2).join()})`,a=`getChannel(getSource(${n.join()}), ${s})`,i=`\n result.x = ${a};\n if (++${o[this.rank-1]} < ${e[this.rank-1]}) {\n ++${n[this.rank-1]};\n result.y = ${a};\n --${n[this.rank-1]};\n }\n `,p=this.rank===1?\"\":`\n --${o[this.rank-1]};\n if (++${o[this.rank-2]} < ${e[this.rank-2]}) {\n ++${n[this.rank-2]};\n result.z = ${a};\n if (++${o[this.rank-1]} < ${e[this.rank-1]}) {\n ++${n[this.rank-1]};\n result.w = ${a};\n }\n }\n `,u=this.rank<=4?`sourceLoc = coords +\n ${t}(${e.map((l,c)=>`start[${c}]`).join()});`:e.map((l,c)=>`${n[c]} = ${o[c]} + start[${c}];`).join(`\n`);this.userCode=`\n void main() {\n ${t} coords = getOutputCoords();\n ${t} sourceLoc;\n ${u}\n vec4 result = vec4(0.);\n ${i}\n ${p}\n setOutput(result);\n }\n `}};function dee(r,e,t,o){let n=o.texData.get(r.dataId),s=o.makeTensorInfo(t,r.dtype),a=o.texData.get(s.dataId);Object.assign(a,n),a.refCount=1,a.shape=t,a.dtype=r.dtype;let i=nt.computeFlatOffset(e,y.computeStrides(r.shape));n.slice&&(i+=n.slice.flatOffset),a.slice={flatOffset:i,origDataId:n.slice&&n.slice.origDataId||r.dataId};let p=o.dataRefCount.get(a.slice.origDataId)||1;return o.dataRefCount.set(a.slice.origDataId,p+1),s}function Js(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,size:a}=o,[i,p]=nt.parseSliceParams(n,s,a);if(nt.assertParamsValid(n,i,p),y.sizeFromShape(p)===0)return t.makeTensorInfo(p,n.dtype,[]);if(t.shouldExecuteOnCPU([n])||n.dtype===\"string\"){let c=t.texData.get(n.dataId),m=tA(c.values,i,p,n.shape,n.dtype);return t.makeTensorInfo(p,n.dtype,m)}let{isPacked:u}=t.texData.get(n.dataId),l=nt.isSliceContinous(n.shape,i,p);if(u||!l){let c=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new Vh(p):new zh(p),m=[i];return t.runWebGLProgram(c,[n],n.dtype,m)}return t.uploadToGPU(n.dataId),dee(n,i,p,t)}var mF={kernelName:_s,backendName:\"webgl\",kernelFunc:Js};var fee=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>\"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet\");let i=s.reduce((b,w)=>b*w),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=[],f=te({inputs:{x:n},backend:t,attrs:{shape:p}}),h=Ct({inputs:{x:f},backend:t,attrs:{perm:u}}),g=te({inputs:{x:h},backend:t,attrs:{shape:l}}),x=Js({inputs:{x:g},backend:t,attrs:{begin:c,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>t.disposeIntermediateTensorInfo(b)),x},dF={kernelName:ia,backendName:\"webgl\",kernelFunc:fee};function hee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=t.readSync(n.dataId),p=t.readSync(s.dataId),u=Ch(i,p,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,u)}var fF={kernelName:Tn,backendName:\"webgl\",kernelFunc:hee};var gee=`\n int r = int(a.r) & int(b.r);\n int g = int(a.g) & int(b.g);\n int rb = int(a.b) & int(b.b);\n int ra = int(a.a) & int(b.a);\n return vec4(r, g, rb, ra);\n`,xee=`\n return float(int(a.r) & int(b.r));\n`;function yee(r){let{inputs:e,backend:t}=r,{a:o,b:n}=e,s=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\"),a=A().getNumber(\"WEBGL_VERSION\");if(t.shouldExecuteOnCPU([o,n])||a===1){let p=t.texData.get(o.dataId).values,u=t.texData.get(n.dataId).values,[l,c]=kD(o.shape,n.shape,p,u,o.dtype),m=t.makeTensorInfo(c,o.dtype),d=t.texData.get(m.dataId);return d.values=l,m}let i;return s?i=new eo(gee,o.shape,n.shape,!1):i=new Br(xee,o.shape,n.shape),t.runWebGLProgram(i,[o,n],o.dtype)}var hF={kernelName:_n,backendName:\"webgl\",kernelFunc:yee};function bee(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e,s=t.readSync(o.dataId),a=t.readSync(n.dataId),i=C.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return t.makeTensorInfo([i.length],\"int32\",Int32Array.from(i))}var gF={kernelName:ua,backendName:\"webgl\",kernelFunc:bee};var Cee=\"return float(a != b);\",P0=st({opSnippet:Cee,cpuKernelImpl:KD,dtype:\"bool\"}),xF={kernelName:Ro,backendName:\"webgl\",kernelFunc:P0};function _i(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.texData.get(o.dataId);return Ft({inputs:{x:n.complexTensorInfos.real},backend:t})}var yF={kernelName:si,backendName:\"webgl\",kernelFunc:_i};var wee=\"return float(int(x));\";function bF(r,e){let t=new nr(r.shape,wee),o=e.runWebGLProgram(t,[r],\"int32\");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function O0(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s===\"complex64\"){if(n.dtype===\"complex64\")return Ft({inputs:{x:n},backend:t});let a=Yr(n.shape),i=O0({inputs:{x:n},backend:t,attrs:{dtype:\"float32\"}}),p=zr({inputs:{real:i,imag:a},backend:t});return a.dispose(),t.disposeIntermediateTensorInfo(i),p}if(n.dtype===\"complex64\"){let a=_i({inputs:{input:n},backend:t}),i=O0({inputs:{x:a},backend:t,attrs:{dtype:s}});return t.disposeIntermediateTensorInfo(a),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=Ft({inputs:{x:n},backend:t});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(t.shouldExecuteOnCPU([n])){let a=t.texData.get(n.dataId).values,[i,p,u]=ND(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}if(s===\"int32\")return bF(n,t);if(s===\"bool\"){let a=t.makeTensorInfo([],\"bool\",y.getTypedArrayFromDType(\"bool\",1)),p=P0({inputs:{a:n,b:a},backend:t});return t.disposeIntermediateTensorInfo(a),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var CF={kernelName:ho,backendName:\"webgl\",kernelFunc:O0};var wF=\"return ceil(x);\",See=xe({opSnippet:wF,packedOpSnippet:wF,cpuKernelImpl:TD}),SF={kernelName:go,backendName:\"webgl\",kernelFunc:See};var Wh=class{constructor(e){this.variableNames=[\"A\"],this.customUniforms=[{name:\"minVal\",type:\"float\"},{name:\"maxVal\",type:\"float\"}],this.outputShape=e,this.userCode=`\n\n void main() {\n float value = getAAtOutCoords();\n if (isnan(value)) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, minVal, maxVal));\n }\n `}};var Uh=class{constructor(e){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"minVal\",type:\"float\"},{name:\"maxVal\",type:\"float\"}],this.outputShape=e,this.userCode=`\n void main() {\n vec4 value = getAAtOutCoords();\n\n if (any(isnan(value))) {\n setOutput(value);\n return;\n }\n\n setOutput(clamp(value, vec4(minVal), vec4(maxVal)));\n }\n `}};function Iee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{clipValueMin:s,clipValueMax:a}=o,i;A().getBool(\"WEBGL_PACK_CLIP\")?i=new Uh(n.shape):i=new Wh(n.shape);let p=[[s],[a]];return t.runWebGLProgram(i,[n],n.dtype,p)}var IF={kernelName:Go,backendName:\"webgl\",kernelFunc:Iee};var Gh=class{constructor(e){this.variableNames=[\"real\",\"imag\"],this.outputShape=e,this.userCode=`\n void main() {\n float re = abs(getRealAtOutCoords());\n float im = abs(getImagAtOutCoords());\n float mx = max(re, im);\n\n // sadly the length function in glsl is not underflow-safe\n // (at least not on Intel GPUs). So the safe solution is\n // to ensure underflow-safety in all cases.\n setOutput(\n mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx))\n );\n }\n `}};function vF(r,e){return{dataId:e.dataId,dtype:e.dtype,shape:r.shape}}function vee(r){let{inputs:e,backend:t}=r,{x:o}=e,n=t.texData.get(o.dataId),s=new Gh(o.shape),a=[vF(o,n.complexTensorInfos.real),vF(o,n.complexTensorInfos.imag)];return t.runWebGLProgram(s,a,a[0].dtype)}var kF={kernelName:Wi,backendName:\"webgl\",kernelFunc:vee};var Hh=class{constructor(e){this.outputShape=[],this.outputShape=C.computeOutShape(e,1),this.variableNames=e.map((a,i)=>`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let a=1;a`T${g}`);let p=new Array(e.length-1);p[0]=e[0][t];for(let h=1;h= ${p[h-1]}) {\n return getChannel(\n getT${h}(${Kh(i,u,g)}),\n vec2(${Kh(l,u,g)}));\n }`}let d=p.length,f=p[p.length-1];m+=`\n return getChannel(\n getT${d}(${Kh(i,u,f)}),\n vec2(${Kh(l,u,f)}));`,this.userCode=`\n float getValue(${i.map(h=>\"int \"+h)}) {\n ${m}\n }\n\n void main() {\n ${s} coords = getOutputCoords();\n vec4 result = vec4(getValue(${a}), 0., 0., 0.);\n\n ${a[n-1]} = ${a[n-1]} + 1;\n if (${a[n-1]} < ${o[n-1]}) {\n result.g = getValue(${a});\n }\n\n ${a[n-2]} = ${a[n-2]} + 1;\n if (${a[n-2]} < ${o[n-2]}) {\n result.a = getValue(${a});\n }\n\n ${a[n-1]} = ${a[n-1]} - 1;\n if (${a[n-2]} < ${o[n-2]} &&\n ${a[n-1]} < ${o[n-1]}) {\n result.b = getValue(${a});\n }\n setOutput(result);\n }\n `}};function Kh(r,e,t){let o=r.indexOf(e);return r.map((s,a)=>a===o?`${s} - ${t}`:s).join()}function Ep(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.texData.get(o.dataId);return Ft({inputs:{x:n.complexTensorInfos.imag},backend:t})}var NF={kernelName:Qi,backendName:\"webgl\",kernelFunc:Ep};function Kl(r,e,t){let o=r[0].dtype;if(o===\"complex64\"){let d=r.map(b=>_i({inputs:{input:b},backend:t})),f=r.map(b=>Ep({inputs:{input:b},backend:t})),h=Kl(d,e,t),g=Kl(f,e,t),x=zr({inputs:{real:h,imag:g},backend:t});return d.forEach(b=>t.disposeIntermediateTensorInfo(b)),f.forEach(b=>t.disposeIntermediateTensorInfo(b)),t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(g),x}let n=t.shouldExecuteOnCPU(r);if(o===\"string\"&&(n=!0),n){let d=r.map(S=>{let T=[-1,y.sizeFromShape(S.shape.slice(e))];return te({inputs:{x:S},backend:t,attrs:{shape:T}})}),f=d.map(S=>({vals:t.readSync(S.dataId),shape:S.shape})),h=C.computeOutShape(d.map(S=>S.shape),1),g=d[0].shape[0]===1,x=_D(f,h,o,g),b=C.computeOutShape(r.map(S=>S.shape),e),w=t.makeTensorInfo(b,o,x);return d.forEach(S=>t.disposeIntermediateTensorInfo(S)),w}let s=r.filter(d=>y.sizeFromShape(d.shape)>0),a=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")&&s[0].shape.length>1;if(s.length===1){let d=a?new nr(r[0].shape,Ha):new Lr(r[0].shape,Ha);return t.runWebGLProgram(d,r,o)}let i=A().getNumber(\"WEBGL_MAX_TEXTURES_IN_SHADER\");if(s.length>i){let d=[];for(let h=0;hf.shape),e);return t.runWebGLProgram(d,s,o)}let{tensors2D:p,outShape:u}=kee(s,e,t),l=new Hh(p.map(d=>d.shape)),c=t.runWebGLProgram(l,p,o);p.forEach(d=>t.disposeIntermediateTensorInfo(d));let m=te({inputs:{x:c},attrs:{shape:u},backend:t});return t.disposeIntermediateTensorInfo(c),m}function kee(r,e,t){let o=C.computeOutShape(r.map(s=>s.shape),e);return{tensors2D:r.map(s=>te({inputs:{x:s},attrs:{shape:[-1,y.sizeFromShape(s.shape.slice(e))]},backend:t})),outShape:o}}function M0(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,e[0].shape)[0],a=e.map(u=>u.shape);C.assertParamsConsistent(a,s);let i=C.computeOutShape(e.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return t.makeTensorInfo(i,e[0].dtype,[]);let p=e.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?Ft({inputs:{x:p[0]},backend:t}):Kl(p,s,t)}var TF={kernelName:pa,backendName:\"webgl\",kernelFunc:M0};var ql=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.outputShape=e.outShape;let a=e.padInfo.top,i=e.padInfo.left,p=e.strideHeight,u=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,m=e.filterHeight,d=e.filterWidth,f=Math.floor(e.inChannels/4)*4,h=e.inChannels%4,g=e.dataFormat===\"channelsLast\",x=g?1:2,b=g?2:3,w=g?3:1,S=\"\",k=\"\";o&&(n?S=`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${o}\n }`:s?S=`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${o}\n }`:S=`\n float activation(float x) {\n ${o}\n }\n `,k=\"result = activation(result);\");let T=t?\"result += getBiasAtOutCoords();\":\"\";t&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),s&&this.variableNames.push(\"leakyreluAlpha\"),this.userCode=`\n ${S}\n\n const ivec2 strides = ivec2(${p}, ${u});\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d2 = coords[${w}];\n\n ivec2 xRCCorner =\n ivec2(coords[${x}], coords[${b}]) * strides - pads;\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${m}; wR++) {\n int xR = xRCorner + wR * ${l};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${c};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${f}; d1 += 4) {\n vec4 wValues = vec4(\n getW(wR, wC, d1, d2),\n getW(wR, wC, d1 + 1, d2),\n getW(wR, wC, d1 + 2, d2),\n getW(wR, wC, d1 + 3, d2)\n );\n\n if (${g}) {\n vec4 xValues = vec4(\n getX(batch, xR, xC, d1),\n getX(batch, xR, xC, d1 + 1),\n getX(batch, xR, xC, d1 + 2),\n getX(batch, xR, xC, d1 + 3)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec4 xValues = vec4(\n getX(batch, d1, xR, xC),\n getX(batch, d1 + 1, xR, xC),\n getX(batch, d1 + 2, xR, xC),\n getX(batch, d1 + 3, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n\n if (${h===1}) {\n\n if (${g}) {\n dotProd +=\n getX(batch, xR, xC, ${f}) *\n getW(wR, wC, ${f}, d2);\n } else {\n dotProd +=\n getX(batch, ${f}, xR, xC) *\n getW(wR, wC, ${f}, d2);\n }\n\n } else if (${h===2}) {\n vec2 wValues = vec2(\n getW(wR, wC, ${f}, d2),\n getW(wR, wC, ${f} + 1, d2)\n );\n\n if (${g}) {\n vec2 xValues = vec2(\n getX(batch, xR, xC, ${f}),\n getX(batch, xR, xC, ${f} + 1)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec2 xValues = vec2(\n getX(batch, ${f}, xR, xC),\n getX(batch, ${f} + 1, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n } else if (${h===3}) {\n vec3 wValues = vec3(\n getW(wR, wC, ${f}, d2),\n getW(wR, wC, ${f} + 1, d2),\n getW(wR, wC, ${f} + 2, d2)\n );\n\n if (${g}) {\n vec3 xValues = vec3(\n getX(batch, xR, xC, ${f}),\n getX(batch, xR, xC, ${f} + 1),\n getX(batch, xR, xC, ${f} + 2)\n );\n dotProd += dot(xValues, wValues);\n } else {\n vec3 xValues = vec3(\n getX(batch, ${f}, xR, xC),\n getX(batch, ${f} + 1, xR, xC),\n getX(batch, ${f} + 2, xR, xC)\n );\n dotProd += dot(xValues, wValues);\n }\n\n }\n }\n }\n\n float result = dotProd;\n ${T}\n ${k}\n setOutput(result);\n }\n `}},jh=class{constructor(e){this.variableNames=[\"x\",\"W\"],this.outputShape=e.outShape;let t=e.padInfo.front,o=e.padInfo.top,n=e.padInfo.left,s=e.strideDepth,a=e.strideHeight,i=e.strideWidth,p=e.dilationDepth,u=e.dilationHeight,l=e.dilationWidth,c=e.filterDepth,m=e.filterHeight,d=e.filterWidth,f=Math.floor(e.inChannels/4)*4,h=e.inChannels%4;this.userCode=`\n const ivec3 strides = ivec3(${s}, ${a}, ${i});\n const ivec3 pads = ivec3(${t}, ${o}, ${n});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d2 = coords.u;\n\n ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads;\n int xFCorner = xFRCCorner.x;\n int xRCorner = xFRCCorner.y;\n int xCCorner = xFRCCorner.z;\n\n // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get\n // y(yF, yR, yC, d2). ? = to be determined. : = across all\n // values in that axis.\n float dotProd = 0.0;\n for (int wF = 0; wF < ${c}; wF++) {\n int xF = xFCorner + wF * ${p};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int wR = 0; wR < ${m}; wR++) {\n int xR = xRCorner + wR * ${u};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int wC = 0; wC < ${d}; wC++) {\n int xC = xCCorner + wC * ${l};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n for (int d1 = 0; d1 < ${f}; d1 += 4) {\n vec4 xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n vec4 wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (${h===1}) {\n dotProd +=\n getX(batch, xF, xR, xC, ${f}) *\n getW(wF, wR, wC, ${f}, d2);\n } else if (${h===2}) {\n vec2 xValues = vec2(\n getX(batch, xF, xR, xC, ${f}),\n getX(batch, xF, xR, xC, ${f} + 1)\n );\n vec2 wValues = vec2(\n getW(wF, wR, wC, ${f}, d2),\n getW(wF, wR, wC, ${f} + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (${h===3}) {\n vec3 xValues = vec3(\n getX(batch, xF, xR, xC, ${f}),\n getX(batch, xF, xR, xC, ${f} + 1),\n getX(batch, xF, xR, xC, ${f} + 2)\n );\n vec3 wValues = vec3(\n getW(wF, wR, wC, ${f}, d2),\n getW(wF, wR, wC, ${f} + 1, d2),\n getW(wF, wR, wC, ${f} + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}};var jl=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"pads\",type:\"ivec2\"},{name:\"strides\",type:\"ivec2\"},{name:\"dilations\",type:\"ivec2\"},{name:\"inDims\",type:\"ivec2\"}],this.outputShape=e.outShape,this.enableShapeUniforms=lt(this.outputShape.length);let a=e.padInfo.left,i=e.strideWidth,p=e.dilationWidth,u=e.filterHeight,l=e.filterWidth,c=l,m=`\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;`;for(let g=0;g=0 && xR < inDims[0]) {\n `;for(let g=0;g<(c+1)/2;g++){let x=g*2;if(m+=`\n xC = xCCorner + ${x*p};\n `,i===1){if(x= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n `,p===1&&x>0?m+=`\n xC${x} = vec4(xTexelC${x-2}.zw, xTexelC${x}.xy);\n `:m+=`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${x} = vec4(previous.zw, xTexelC${x}.xy);\n } else {\n xC${x} = vec4(0.0, 0.0, xTexelC${x}.xy);\n }\n `):m+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n\n xC${x} = xTexelC${x};\n `,x+1= 0 && xCOffset < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.0);\n }\n xTexelC${x+1}Ready = 1;\n }\n `,p>1?m+=`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${x+1} = vec4(previous.zw, xTexelC${x+1}.xy);\n } else {\n xC${x+1} = vec4(0.0, 0.0, xTexelC${x+1}.xy);\n }\n `:m+=`\n xC${x+1} = vec4(xTexelC${x}.zw, xTexelC${x+1}.xy);\n `):b===1?m+=`\n xC${x+1} = xTexelC${x};\n `:m+=`\n xCOffset = xC + ${b};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.0);\n }\n xTexelC${x+1}Ready = 1;\n }\n\n xC${x+1} = xTexelC${x+1};\n `}}else x= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.0);\n }\n xTexelC${x+1}Ready = 1;\n }\n\n xC${x} = vec4(xTexelC${x}.zw, xTexelC${x+1}.zw);\n `,x+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${x+1} = vec4(xTexelC${x+1}.xy, final.xy);\n `)):(m+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${x}Ready == 0) {\n xTexelC${x} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${x}.zw = vec2(0.0);\n }\n xTexelC${x}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${x+1}Ready == 0) {\n xTexelC${x+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${x+1}.zw = vec2(0.);\n }\n xTexelC${x+1}Ready = 1;\n }\n\n xC${x} = vec4(\n xTexelC${x}.xy, xTexelC${x+1}.xy);\n `,x+1= 0) {\n // Use custom imod instead mod. On Intel GPU, mod may generate\n // unexpected value.\n // https://github.com/tensorflow/tfjs/issues/5447\n offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1];\n d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) /\n inChannels);\n\n if(d1 < inputShape[${i}] && d1 >= 0) {\n\n ch = imod(pos, inChannels);\n\n if (${s}) {\n innerDims = vec2(d1, ch);\n result[${l*2+c}] = getChannel(\n getA(rc.x, d0, int(innerDims.x),\n int(innerDims.y)), innerDims);\n } else {\n innerDims = vec2(d0, d1);\n result[${l*2+c}] = getChannel(\n getA(rc.x, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n }\n `;this.userCode=`\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0);\n\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n\n ${u}\n\n ${n.output} = result;\n }\n `}};function Yh(r,e){let t=r.length;return t>=3?e?[...r.slice(0,-3),r[t-3]*r[t-2],r[t-1]]:[...r.slice(0,-3),r[t-3],r[t-2]*r[t-1]]:!e&&t===1&&r[0]>1?[r[0],1]:null}function Qh({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=r.shape,u=o.texData.get(r.dataId),l=t.inChannels,c=p[0]*p[1]*p[2],m=t.outChannels,d=t.dataFormat===\"channelsLast\",f=!1,h=!1,g,x=[];if(s!=null){let S=Yh(s.shape,d);S!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:S}}),x.push(s))}if(n!=null){let S=Yh(n.shape,d);S!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:S}}),x.push(n))}if(!((c===1||m===1)&&l>A0)&&u.isPacked&&d&&u.texture!=null&&p[2]%2!==0&&y.arraysEqual(u.shape.slice(-3),p.slice(-3))){let S=p[0]*p[1]*(p[2]+1),k={dataId:r.dataId,shape:[1,S,t.inChannels],dtype:r.dtype},T=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,y.assert(vu(u.shape,k.shape),()=>`packed reshape ${u.shape} to ${k.shape} isn't free`);let E=te({inputs:{x:e},backend:o,attrs:{shape:[1,t.inChannels,t.outChannels]}});x.push(E);let R=_p({a:k,b:E,backend:o,transposeA:f,transposeB:h,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),D=o.texData.get(R.dataId);y.assert(D.isPacked,()=>\"batchMatMul result is expected to be packed\"),u.shape=T,D.shape=t.outShape,g=Ft({inputs:{x:R},backend:o}),g.shape=t.outShape,x.push(R)}else{let S=t.outHeight*t.outWidth,k=te({inputs:{x:r},backend:o,attrs:{shape:d?[t.batchSize,S,t.inChannels]:[t.batchSize,t.inChannels,S]}}),T=te({inputs:{x:e},backend:o,attrs:{shape:[1,t.inChannels,t.outChannels]}}),E=_p({a:d?k:T,b:d?T:k,transposeA:!d,transposeB:h,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});g=te({inputs:{x:E},backend:o,attrs:{shape:t.outShape}}),x.push(k),x.push(T),x.push(E)}for(let S of x)o.disposeIntermediateTensorInfo(S);return g}function Zh({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:l,outWidth:c,outHeight:m,dataFormat:d}=t,f=d===\"channelsLast\",h=p*u*l,g=m*c,x=[t.batchSize,h,g],b=!0,w=!1,S=[];if(s!=null){let q=Yh(s.shape,f);q!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:q}}),S.push(s))}if(n!=null){let q=Yh(n.shape,f);q!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:q}}),S.push(n))}let k=te({inputs:{x:e},backend:o,attrs:{shape:[1,h,y.sizeFromShape(e.shape)/h]}});S.push(k);let T=new Xh(x,t),E=[r.shape,[t.padInfo.top,t.padInfo.left],[t.strideHeight,t.strideWidth],[t.dilationHeight,t.dilationWidth],[t.inChannels],[t.filterWidth*t.inChannels],[t.outWidth]],R=o.runWebGLProgram(T,[r],\"float32\",E),D=te({inputs:{x:R},backend:o,attrs:{shape:x}});S.push(R),S.push(D);let F=n!=null,O=s!=null,M=i===\"leakyrelu\",L=i?Ti(i,!0):null,B=new Hl(f?D.shape:k.shape,f?k.shape:D.shape,f?[t.batchSize,g,t.outChannels]:[t.batchSize,t.outChannels,g],b,w,F,L,O,M),z=f?[D,k]:[k,D];if(n&&z.push(n),O&&z.push(s),M){let q=o.makeTensorInfo([],\"float32\",y.createScalarValue(a,\"float32\"));z.push(q),S.push(q)}let U=o.runWebGLProgram(B,z,\"float32\"),j=te({inputs:{x:U},backend:o,attrs:{shape:t.outShape}});S.push(U);for(let q of S)o.disposeIntermediateTensorInfo(q);return j}function Nee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,s.shape,a,u,i,l,!1,c),d;if(m.filterHeight===1&&m.filterWidth===1&&m.dilationHeight===1&&m.dilationWidth===1&&m.strideHeight===1&&m.strideWidth===1&&(m.padInfo.type===\"SAME\"||m.padInfo.type===\"VALID\"))d=Qh({x:n,filter:s,convInfo:m,backend:t});else if(m.strideWidth<=2&&c===\"channelsLast\"&&A().getBool(\"WEBGL_EXP_CONV\")){let h=new jl(m),g=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]];d=t.runWebGLProgram(h,[n,s],\"float32\",g)}else if(A().getBool(\"WEBGL_CONV_IM2COL\"))d=Zh({x:n,filter:s,convInfo:m,backend:t});else{let h=new ql(m);d=t.runWebGLProgram(h,[n,s],\"float32\")}let f=te({inputs:{x:d},backend:t,attrs:{shape:m.outShape}});return t.disposeIntermediateTensorInfo(d),f}var _F={kernelName:En,backendName:\"webgl\",kernelFunc:Nee};var Jh=class{constructor(e){this.variableNames=[\"x\",\"dy\"],this.outputShape=e.filterShape;let t=e.strideHeight,o=e.strideWidth,n=e.padInfo.top,s=e.padInfo.left,a=e.dataFormat===\"channelsLast\";this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int d2 = coords.w;\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${n};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${o} - ${s};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n ${a?`float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);`:`float dyValue = getDy(b, d2, yR, yC);\n float xValue = getX(b, d1, xR, xC);\n dotProd += (xValue * dyValue);`}\n }\n }\n }\n setOutput(dotProd);\n }\n `}},eg=class{constructor(e){this.variableNames=[\"dy\",\"W\"],this.outputShape=e.inShape;let t=e.filterHeight,o=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=e.dataFormat===\"channelsLast\",i=t-1-e.padInfo.top,p=o-1-e.padInfo.left,u=a?1:2,l=a?2:3,c=a?3:1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[${c}];\n\n ivec2 dyCorner = ivec2(coords[${u}], coords[${l}]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${o}; wC++) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${o} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n\n if (${a}) {\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n } else {\n float xValue = getDy(batch, d2, idyR, idyC);\n float wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n\n }\n }\n }\n setOutput(dotProd);\n }\n `}},tg=class{constructor(e){this.variableNames=[\"x\",\"dy\"],this.outputShape=e.filterShape;let t=e.strideDepth,o=e.strideHeight,n=e.strideWidth,s=e.padInfo.front,a=e.padInfo.top,i=e.padInfo.left;this.userCode=`\n void main() {\n ivec5 coords = getOutputCoords();\n int wF = coords.x;\n int wR = coords.y;\n int wC = coords.z;\n int d1 = coords.w;\n int d2 = coords.u;\n\n float dotProd = 0.0;\n\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yF = 0; yF < ${e.outDepth}; yF++) {\n int xF = wF + yF * ${t} - ${s};\n\n if (xF < 0 || xF >= ${e.inDepth}) {\n continue;\n }\n\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${o} - ${a};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${n} - ${i};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yF, yR, yC, d2);\n float xValue = getX(b, xF, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}},rg=class{constructor(e){this.variableNames=[\"dy\",\"W\"],this.outputShape=e.inShape;let t=e.filterDepth,o=e.filterHeight,n=e.filterWidth,s=e.strideDepth,a=e.strideHeight,i=e.strideWidth,p=t-1-e.padInfo.front,u=o-1-e.padInfo.top,l=n-1-e.padInfo.left;this.userCode=`\n const ivec3 pads = ivec3(${p}, ${u}, ${l});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.u;\n\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyFCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n float dotProd = 0.0;\n for (int wF = 0; wF < ${t}; wF++) {\n float dyF = float(dyFCorner + wF) / ${s}.0;\n\n if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) {\n continue;\n }\n int idyF = int(dyF);\n\n int wFPerm = ${t} - 1 - wF;\n\n for (int wR = 0; wR < ${o}; wR++) {\n float dyR = float(dyRCorner + wR) / ${a}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${o} - 1 - wR;\n\n for (int wC = 0; wC < ${n}; wC++) {\n float dyC = float(dyCCorner + wC) / ${i}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${n} - 1 - wC;\n\n for (int d2 = 0; d2 < ${e.outChannels}; d2++) {\n float xValue = getDy(batch, idyF, idyR, idyC, d2);\n float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function Tee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:l}=o,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,l,a,1,i,u,!1,c),d=new Jh(m);return t.runWebGLProgram(d,[n,s],\"float32\")}var EF={kernelName:Ui,backendName:\"webgl\",kernelFunc:Tee};var og=class{constructor(e){this.variableNames=[\"dy\",\"W\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"strides\",type:\"vec2\"}],this.outputShape=e.inShape,this.enableShapeUniforms=lt(this.outputShape.length);let t=e.filterHeight,o=e.filterWidth,n=t-1-e.padInfo.top,s=o-1-e.padInfo.left;this.userCode=`\n const ivec2 pads = ivec2(${n}, ${s});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n\n ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n vec4 result = vec4(0.);\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / strides[0];\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${o}; wC++) {\n int wCPerm = ${o} - 1 - wC;\n\n float dyC = float(dyCCorner + wC) / strides[1];\n bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0)\n && (fract(dyC) == 0.0);\n int idyC = int(dyC);\n\n float dyC2 = float(dyCCorner + wC + 1) / strides[1];\n bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0)\n && (fract(dyC2) == 0.0);\n int idyC2 = int(dyC2);\n\n if (idyCVal && idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec4 dySample2 = (idyC / 2 == idyC2 / 2) ?\n dySample : getDy(batch, idyR, idyC2, d2);\n\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n\n dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample2.xy : dySample2.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC, d2);\n vec2 dyValue = mod(float(idyC), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.xy += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n } else if (idyCVal2) {\n for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) {\n vec4 wValue = getW(wRPerm, wCPerm, d1, d2);\n vec4 dySample = getDy(batch, idyR, idyC2, d2);\n vec2 dyValue = mod(float(idyC2), 2.) == 0. ?\n dySample.xy : dySample.zw;\n result.zw += vec2(dot(dyValue, wValue.xy),\n dot(dyValue, wValue.zw));\n }\n }\n }\n }\n setOutput(result);\n }\n `}};function _ee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(u),m=C.computeConv2DInfo(a,s.shape,i,1,p,l,!1,c);if(A().getBool(\"WEBGL_PACK_CONV2DTRANSPOSE\")&&c===\"channelsLast\"){let d=[[m.strideHeight,m.strideWidth]],f=new og(m);return t.runWebGLProgram(f,[n,s],\"float32\",d)}else{let d=new eg(m);return t.runWebGLProgram(d,[n,s],\"float32\")}}var $F={kernelName:$n,backendName:\"webgl\",kernelFunc:_ee};function Eee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeConv3DInfo(n.shape,s.shape,a,p,i),l=new jh(u);return t.runWebGLProgram(l,[n,s],\"float32\")}var RF={kernelName:Rn,backendName:\"webgl\",kernelFunc:Eee};function $ee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,filterShape:p}=o,u=C.computeConv3DInfo(n.shape,p,a,1,i),l=new tg(u);return t.runWebGLProgram(l,[n,s],\"float32\")}var DF={kernelName:ti,backendName:\"webgl\",kernelFunc:$ee};function Ree(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{pad:a,strides:i,inputShape:p}=o,u=C.computeConv3DInfo(p,s.shape,i,1,a),l=new rg(u);return t.runWebGLProgram(l,[n,s],\"float32\")}var AF={kernelName:Dn,backendName:\"webgl\",kernelFunc:Ree};var Dee=sn+`\n return cos(x);\n`,Aee=`\n vec4 result = cos(x);\n bvec4 isNaN = isnan(x);\n ${to}\n return result;\n`,Fee=xe({opSnippet:Dee,packedOpSnippet:Aee}),FF={kernelName:An,backendName:\"webgl\",kernelFunc:Fee};var Pee=`\n float e2x = exp(-x);\n return (e2x + 1.0 / e2x) / 2.0;\n`,Oee=xe({opSnippet:Pee}),PF={kernelName:Fn,backendName:\"webgl\",kernelFunc:Oee};var ng=class{constructor(e,t,o,n,s){this.variableNames=[\"Image\",\"Boxes\",\"BoxInd\"],this.outputShape=[];let[a,i,p,u]=e,[l]=t,[c,m]=o;this.outputShape=[l,c,m,u];let d=n===\"bilinear\"?1:0,[f,h]=[`${i-1}.0`,`${p-1}.0`],[g,x,b]=c>1?[`${(i-1)/(c-1)}`,\"(y2-y1) * height_ratio\",`y1*${f} + float(y)*(height_scale)`]:[\"0.0\",\"0.0\",`0.5 * (y1+y2) * ${f}`],[w,S,k]=m>1?[`${(p-1)/(m-1)}`,\"(x2-x1) * width_ratio\",`x1*${h} + float(x)*(width_scale)`]:[\"0.0\",\"0.0\",`0.5 * (x1+x2) * ${h}`];this.userCode=`\n const float height_ratio = float(${g});\n const float width_ratio = float(${w});\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int y = coords[1];\n int x = coords[2];\n int d = coords[3];\n\n // get box vals\n float y1 = getBoxes(b,0);\n float x1 = getBoxes(b,1);\n float y2 = getBoxes(b,2);\n float x2 = getBoxes(b,3);\n\n // get image in batch index\n int bInd = round(getBoxInd(b));\n if(bInd < 0 || bInd >= ${a}) {\n return;\n }\n\n float height_scale = ${x};\n float width_scale = ${S};\n\n float in_y = ${b};\n if( in_y < 0.0 || in_y > ${f} ) {\n setOutput(float(${s}));\n return;\n }\n float in_x = ${k};\n if( in_x < 0.0 || in_x > ${h} ) {\n setOutput(float(${s}));\n return;\n }\n\n vec2 sourceFracIndexCR = vec2(in_x,in_y);\n if(${d} == 1) {\n // Compute the four integer indices.\n ivec2 sourceFloorCR = ivec2(sourceFracIndexCR);\n ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR));\n\n float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d);\n float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d);\n float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d);\n float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d);\n\n vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n\n float top = topLeft + (topRight - topLeft) * fracCR.x;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n float newValue = top + (bottom - top) * fracCR.y;\n setOutput(newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestCR = ivec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutput(newValue);\n }\n }\n `}};var Mee=r=>{let{inputs:e,backend:t,attrs:o}=r,{image:n,boxes:s,boxInd:a}=e,{cropSize:i,method:p,extrapolationValue:u}=o,l=new ng(n.shape,s.shape,i,p,u);return t.runWebGLProgram(l,[n,s,a],\"float32\")},OF={kernelName:Mn,backendName:\"webgl\",kernelFunc:Mee};var $p;(function(r){r.Prod=\"*\",r.Sum=\"+\"})($p||($p={}));var lm=class{constructor(e,t,o,n){this.op=e,this.outputShape=t,this.variableNames=[\"x\"],this.customUniforms=[{name:\"index\",type:\"float\"}];let s=this.outputShape.length,a=this.op===$p.Prod?\"1.0\":\"0.0\",i=o?a:`getX(${MF(s,\"coords\",this.op)})`,p=this.outputShape[this.outputShape.length-1],u=\"\",l=\"\";o?(u=n?`end != ${p-1}`:\"end != 0\",l=n?\"end + 1\":\"end - 1\"):(u=n?`end + pow2 < ${p}`:\"end >= pow2\",l=n?\"end + pow2\":\"end - pow2\"),this.userCode=`\n void main() {\n ${Re(s)} coords = getOutputCoords();\n int end = ${LF(s,\"coords\",this.op)};\n float val = ${i};\n int pow2 = int(pow(2.0, index));\n if (${u}) {\n int idx = ${l};\n ${LF(s,\"coords\",this.op)} = idx;\n val ${this.op}= getX(${MF(s,\"coords\",this.op)});\n }\n setOutput(val);\n }\n `}};function MF(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.x, ${e}.y`;if(r===3)return`${e}.x, ${e}.y, ${e}.z`;if(r===4)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw new Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function LF(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.y`;if(r===3)return`${e}.z`;if(r===4)return`${e}.w`;throw new Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function sg(r,e,t,o,n,s){let a=e.shape.length,i=C.getAxesPermutation([o],a),p=e;i!=null&&(p=Ct({inputs:{x:e},backend:t,attrs:{perm:i}}));let u=C.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${e.shape.length-1} but got axis=${o}`);let l=p.shape[u],c=Ft({inputs:{x:p},backend:t});for(let m=0;m<=Math.ceil(Math.log2(l))-1;m++){let d=new lm(r,p.shape,!1,s),f=[[m]],h=c;c=t.runWebGLProgram(d,[c],c.dtype,f),t.disposeIntermediateTensorInfo(h)}if(n){let m=new lm(r,p.shape,n,s),d=c;c=t.runWebGLProgram(m,[c],c.dtype),t.disposeIntermediateTensorInfo(d)}if(i!=null){let m=C.getUndoAxesPermutation(i),d=Ct({inputs:{x:c},backend:t,attrs:{perm:m}});return t.disposeIntermediateTensorInfo(c),t.disposeIntermediateTensorInfo(p),d}return c}function Lee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return sg($p.Prod,n,t,s,a,i)}var BF={kernelName:Pn,backendName:\"webgl\",kernelFunc:Lee};function Bee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return sg($p.Sum,n,t,s,a,i)}var zF={kernelName:On,backendName:\"webgl\",kernelFunc:Bee};function zee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a,binaryOutput:i}=o;if(n.shape.length===1){let p=t.readSync(n.dataId),u=t.readSync(s.dataId),l=Ch(p,u,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,l)}else if(n.shape.length===2){let p=t.bufferSync(n),u=t.bufferSync(s),l=vD(p,u,a,i);return t.makeTensorInfo(l.shape,s.dtype,l.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${n.shape.length}.`)}var VF={kernelName:la,backendName:\"webgl\",kernelFunc:zee};var ag=class{constructor(e,t,o){this.variableNames=[\"x\"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=o,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int h = ${this.getHeightCoordString()};\n int w = ${this.getWidthCoordString()};\n int d = ${this.getDepthCoordString()};\n\n int in_h = h / ${t};\n int offset_h = imod(h, ${t});\n int in_w = w / ${t};\n int offset_w = imod(w, ${t});\n int offset_d = (offset_h * ${t} + offset_w) *\n ${this.getOutputDepthSize()};\n int in_d = d + offset_d;\n\n float result = ${this.getInputSamplingString()};\n setOutput(result);\n }\n `}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 Vee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a===\"NHWC\"?n.shape[1]:n.shape[2],u=a===\"NHWC\"?n.shape[2]:n.shape[3],l=a===\"NHWC\"?n.shape[3]:n.shape[1],c=p*s,m=u*s,d=l/(s*s),f=a===\"NHWC\"?[i,c,m,d]:[i,d,c,m],h=new ag(f,s,a);return t.runWebGLProgram(h,[n],n.dtype)}var WF={kernelName:Ln,backendName:\"webgl\",kernelFunc:Vee};var Xl=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.customUniforms=[{name:\"pads\",type:\"ivec2\"},{name:\"strides\",type:\"ivec2\"},{name:\"dilations\",type:\"ivec2\"},{name:\"inDims\",type:\"ivec2\"}],this.outputShape=e.outShape,this.enableShapeUniforms=lt(this.outputShape.length);let a=e.filterHeight,i=e.filterWidth,p=e.outChannels/e.inChannels,u=\"\",l=\"\";o&&(n?u=`float activation(float a) {\n float b = getPreluActivationWeightsAtOutCoords();\n ${o}\n }`:s?u=`float activation(float a) {\n float b = getLeakyreluAlphaAtOutCoords();\n ${o}\n }`:u=`\n float activation(float x) {\n ${o}\n }\n `,l=\"result = activation(result);\");let c=t?\"result += getBiasAtOutCoords();\":\"\";t&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),s&&this.variableNames.push(\"leakyreluAlpha\"),this.userCode=`\n ${u}\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n ivec2 xRCCorner = coords.yz * strides - pads;\n int d2 = coords.w;\n int d1 = d2 / ${p};\n int q = d2 - d1 * ${p};\n\n int xRCorner = xRCCorner.x;\n int xCCorner = xRCCorner.y;\n\n // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations.\n for (int wR = 0; wR < ${a}; wR++) {\n int xR = xRCorner + wR * dilations[0];\n\n if (xR < 0 || xR >= inDims[0]) {\n continue;\n }\n\n for (int wC = 0; wC < ${i}; wC++) {\n int xC = xCCorner + wC * dilations[1];\n\n if (xC < 0 || xC >= inDims[1]) {\n continue;\n }\n\n float xVal = getX(batch, xR, xC, d1);\n float wVal = getW(wR, wC, d1, q);\n dotProd += xVal * wVal;\n }\n }\n\n float result = dotProd;\n ${c}\n ${l}\n setOutput(result);\n }\n `}};var Yl=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=[\"x\",\"W\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"pads\",type:\"ivec2\"},{name:\"strides\",type:\"ivec2\"},{name:\"dilations\",type:\"ivec2\"},{name:\"inDims\",type:\"ivec2\"}],this.outputShape=e.outShape,this.enableShapeUniforms=lt(this.outputShape.length);let a=e.outChannels/e.inChannels,i=e.padInfo.left,p=e.strideWidth,u=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,m=c,d=`\n int xR; int xC; int xCOffset;\n vec4 wTexel; vec4 previous; vec4 final;`;for(let x=0;x=0 && xR < inDims[0]) {\n `;for(let x=0;x<(m+1)/2;x++){let b=x*2;if(d+=`\n xC = xCCorner + ${b*u};\n `,p===1){if(b= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n `,u===1&&b>0?d+=`\n xC${b} = vec4(xTexelC${b-2}.zw, xTexelC${b}.xy);\n `:d+=`\n xCOffset = xC + 1 - 2;\n\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n previous.zw = vec2(0.0);\n }\n\n xC${b} = vec4(previous.zw, xTexelC${b}.xy);\n } else {\n xC${b} = vec4(0.0, 0.0, xTexelC${b}.xy);\n }\n `):d+=`\n if (xC >= 0 && xC < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n\n xC${b} = xTexelC${b};\n `,b+1= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xCOffset, d1);\n\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.0);\n }\n xTexelC${b+1}Ready = 1;\n }\n `,u>1?d+=`\n xCOffset -= 2;\n if (xCOffset >= 0 && xCOffset < inDims[1]) {\n previous = getX(batch, xR, xCOffset, d1);\n xC${b+1} = vec4(previous.zw, xTexelC${b+1}.xy);\n } else {\n xC${b+1} = vec4(0.0, 0.0, xTexelC${b+1}.xy);\n }\n `:d+=`\n xC${b+1} = vec4(xTexelC${b}.zw, xTexelC${b+1}.xy);\n `):w===1?d+=`\n xC${b+1} = xTexelC${b};\n `:d+=`\n xCOffset = xC + ${w};\n\n if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.0);\n }\n xTexelC${b+1}Ready = 1;\n }\n\n xC${b+1} = xTexelC${b+1};\n `}}else b= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xCOffset, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n\n if(xC + 1 >= 0 && xC + 1 < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xC + 1, d1);\n // Need to manually clear unused channels in case\n // we're reading from recycled texture.\n if (xC + 2 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.0);\n }\n xTexelC${b+1}Ready = 1;\n }\n\n xC${b} = vec4(xTexelC${b}.zw, xTexelC${b+1}.zw);\n `,b+1= 0 && xCOffset < inDims[1]) {\n final = getX(batch, xR, xCOffset, d1);\n }\n xC${b+1} = vec4(xTexelC${b+1}.xy, final.xy);\n `)):(d+=`\n if(xC >= 0 && xC < inDims[1] && xTexelC${b}Ready == 0) {\n xTexelC${b} = getX(batch, xR, xC, d1);\n if (xC + 1 >= inDims[1]) {\n xTexelC${b}.zw = vec2(0.0);\n }\n xTexelC${b}Ready = 1;\n }\n\n xCOffset = xC + strides[1];\n if(xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) {\n xTexelC${b+1} = getX(batch, xR, xCOffset, d1);\n if (xCOffset + 1 >= inDims[1]) {\n xTexelC${b+1}.zw = vec2(0.);\n }\n xTexelC${b+1}Ready = 1;\n }\n\n xC${b} = vec4(\n xTexelC${b}.xy, xTexelC${b+1}.xy);\n `,b+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${l}'`);let c=C.computeConv2DInfo(n.shape,s.shape,a,l,i,u,!0),m;A().getBool(\"WEBGL_PACK_DEPTHWISECONV\")&&c.strideWidth<=2&&c.outChannels/c.inChannels===1?m=new Yl(c):m=new Xl(c);let d=[[c.padInfo.top,c.padInfo.left],[c.strideHeight,c.strideWidth],[c.dilationHeight,c.dilationWidth],[c.inHeight,c.inWidth]];return t.runWebGLProgram(m,[n,s],\"float32\",d)}var UF={kernelName:Bn,backendName:\"webgl\",kernelFunc:Wee};var ig=class{constructor(e){this.variableNames=[\"x\",\"dy\"],this.outputShape=e.filterShape;let t=e.strideHeight,o=e.strideWidth,n=e.padInfo.top,s=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int wR = coords.x;\n int wC = coords.y;\n int d1 = coords.z;\n int dm = coords.w;\n int d2 = d1 * ${a} + dm;\n\n float dotProd = 0.0;\n\n // TO DO: Vec4 over the batch size\n for (int b = 0; b < ${e.batchSize}; b++) {\n for (int yR = 0; yR < ${e.outHeight}; yR++) {\n int xR = wR + yR * ${t} - ${n};\n\n if (xR < 0 || xR >= ${e.inHeight}) {\n continue;\n }\n\n for (int yC = 0; yC < ${e.outWidth}; yC++) {\n int xC = wC + yC * ${o} - ${s};\n\n if (xC < 0 || xC >= ${e.inWidth}) {\n continue;\n }\n\n float dyValue = getDy(b, yR, yC, d2);\n float xValue = getX(b, xR, xC, d1);\n dotProd += (xValue * dyValue);\n }\n }\n }\n setOutput(dotProd);\n }\n `}},ug=class{constructor(e){this.variableNames=[\"dy\",\"W\"],this.outputShape=e.inShape;let t=e.filterHeight,o=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=t-1-e.padInfo.top,i=o-1-e.padInfo.left,p=e.outChannels/e.inChannels;this.userCode=`\n const ivec2 pads = ivec2(${a}, ${i});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords[0];\n int d1 = coords[3];\n ivec2 dyCorner = coords.yz - pads;\n int dyRCorner = dyCorner.x;\n int dyCCorner = dyCorner.y;\n\n float dotProd = 0.0;\n\n for (int wR = 0; wR < ${t}; wR++) {\n float dyR = float(dyRCorner + wR) / ${n}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n int wRPerm = ${t} - 1 - wR;\n\n for (int wC = 0; wC < ${o}; wC++) {\n float dyC = float(dyCCorner + wC) / ${s}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n int wCPerm = ${o} - 1 - wC;\n\n // TO DO: Vec4 over the channelMul\n for (int dm = 0; dm < ${p}; dm++) {\n int d2 = d1 * ${p} + dm;\n float xValue = getDy(batch, idyR, idyC, d2);\n float wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function Uee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:l}=o,c=C.computeConv2DInfo(n.shape,l,a,i,p,u,!0),m=new ig(c);return t.runWebGLProgram(m,[n,s],\"float32\")}var GF={kernelName:Gi,backendName:\"webgl\",kernelFunc:Uee};function Gee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:l}=o,c=C.computeConv2DInfo(l,s.shape,a,i,p,u,!0),m=new ug(c);return t.runWebGLProgram(m,[n,s],\"float32\")}var HF={kernelName:Hi,backendName:\"webgl\",kernelFunc:Gee};var pg=class{constructor(e){this.variableNames=[\"X\"],this.outputShape=[e,e],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n float val = coords[0] == coords[1] ? getX(coords[0]) : 0.0;\n setOutput(val);\n }\n `}};function Hee(r){let{inputs:e,backend:t}=r,{x:o}=e,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=te({inputs:{x:o},backend:t,attrs:{shape:[s]}}),i=new pg(s),p=t.runWebGLProgram(i,[a],a.dtype),u=te({inputs:{x:p},backend:t,attrs:{shape:n}});return t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(p),u}var KF={kernelName:ca,backendName:\"webgl\",kernelFunc:Hee};var lg=class{constructor(e){this.variableNames=[\"x\",\"W\"],this.outputShape=e.outShape;let{inHeight:t,inWidth:o,padInfo:n,strideHeight:s,strideWidth:a,filterHeight:i,filterWidth:p,dilationHeight:u,dilationWidth:l}=e,{top:c,left:m}=n;this.userCode=`\n const ivec2 strides = ivec2(${s}, ${a});\n const ivec2 pads = ivec2(${c}, ${m});\n const float neg_infinity = -3.4e38;\n\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int d1 = coords.w;\n ivec2 outTopLeftCorner =\n coords.yz * strides - pads;\n int hBeg = outTopLeftCorner.x;\n int wBeg = outTopLeftCorner.y;\n\n float curVal = neg_infinity;\n for (int h = 0; h < ${i}; h++) {\n int hIn = hBeg + h * ${u};\n\n if (hIn >= 0 && hIn < ${t}) {\n for (int w = 0; w < ${p}; w++) {\n int wIn = wBeg + w * ${l};\n\n if (wIn >= 0 && wIn < ${o}) {\n float xVal = getX(batch, hIn, wIn, d1);\n float wVal = getW(h, w, d1);\n\n float val = xVal + wVal;\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n float result = curVal;\n setOutput(result);\n }\n `}};function Kee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeDilation2DInfo(n.shape,s.shape,a,i,\"NHWC\",p),l,c=new lg(u);l=t.runWebGLProgram(c,[n,s],\"float32\");let m=te({inputs:{x:l},backend:t,attrs:{shape:u.outShape}});return t.disposeIntermediateTensorInfo(l),m}var qF={kernelName:zn,backendName:\"webgl\",kernelFunc:Kee};function qee(r){let{inputs:e,backend:t,attrs:o}=r,{equation:n}=o,s=e,{allDims:a,summedDims:i,idDims:p}=C.decodeEinsumEquation(n,s.length);C.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:l}=C.getEinsumComputePath(i,p),c=l.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=Tp({inputs:{x:m},backend:t,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&t.disposeIntermediateTensorInfo(h);return m}var jF={kernelName:ji,backendName:\"webgl\",kernelFunc:qee};var jee=\"return (x >= 0.0) ? x : (exp(x) - 1.0);\",Xee=`\n vec4 result;\n\n result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);\n result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);\n result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);\n result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);\n\n return result;\n`,Yee=xe({opSnippet:jee,packedOpSnippet:Xee}),XF={kernelName:Wn,backendName:\"webgl\",kernelFunc:Yee};var Qee=\"return (b >= 0.0) ? a : a * (b + 1.0);\",Zee=`\n vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.)));\n return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0))));\n`,Jee=r=>{let{inputs:e,backend:t}=r,{dy:o,y:n}=e,s=A().getBool(\"WEBGL_PACK_BINARY_OPERATIONS\")?new eo(Zee,o.shape,n.shape):new Br(Qee,o.shape,n.shape);return t.runWebGLProgram(s,[o,n],o.dtype)},YF={kernelName:ri,backendName:\"webgl\",kernelFunc:Jee};var ete=`\n return vec4(equal(a, b));\n`,tte=\"return float(a == b);\",rte=st({opSnippet:tte,packedOpSnippet:ete,dtype:\"bool\",cpuKernelImpl:ED}),QF={kernelName:xo,backendName:\"webgl\",kernelFunc:rte};var ote=`\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n float p = ${C.ERF_P};\n float a1 = ${C.ERF_A1};\n float a2 = ${C.ERF_A2};\n float a3 = ${C.ERF_A3};\n float a4 = ${C.ERF_A4};\n float a5 = ${C.ERF_A5};\n\n float sign = sign(x);\n x = abs(x);\n float t = 1.0 / (1.0 + p * x);\n return sign * (1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x));\n`,nte=xe({opSnippet:ote}),ZF={kernelName:Un,backendName:\"webgl\",kernelFunc:nte};var ste=sn+`\n return exp(x);\n`,ate=`\n vec4 result = exp(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,L0=xe({opSnippet:ste,packedOpSnippet:ate,cpuKernelImpl:$D,dtype:\"float32\"}),JF={kernelName:yo,backendName:\"webgl\",kernelFunc:L0};function cg(r){let{inputs:e,attrs:t,backend:o}=r,{dim:n}=t,{input:s}=e,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),te({inputs:{x:s},backend:o,attrs:{shape:i}})}var e3={kernelName:ma,backendName:\"webgl\",kernelFunc:cg};var t3=\"return exp(x) - 1.0;\",ite=xe({opSnippet:t3,packedOpSnippet:t3,cpuKernelImpl:RD}),r3={kernelName:bo,backendName:\"webgl\",kernelFunc:ite};var cm=class{constructor(e,t,o){this.variableNames=[\"real\",\"imag\"];let n=t[1];this.outputShape=t;let s=o?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,a=o?`${n}.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=`\n const float exponentMultiplier = ${s};\n\n float unaryOpComplex(float real, float expR, float imag, float expI) {\n ${i}\n }\n\n float mulMatDFT(int batch, int index) {\n float indexRatio = float(index) / float(${n});\n float exponentMultiplierTimesIndexRatio =\n exponentMultiplier * indexRatio;\n\n float result = 0.0;\n\n for (int i = 0; i < ${n}; i++) {\n // x = (-2|2 * PI / N) * index * i;\n float x = exponentMultiplierTimesIndexRatio * float(i);\n float expR = cos(x);\n float expI = sin(x);\n float real = getReal(batch, i);\n float imag = getImag(batch, i);\n\n result +=\n unaryOpComplex(real, expR, imag, expI) / ${a};\n }\n\n return result;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n setOutput(mulMatDFT(coords[0], coords[1]));\n }\n `}};function mg(r,e,t){let o=t.texData.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=te({inputs:{x:r},backend:t,attrs:{shape:[a,s]}}),p=i.shape,u=new cm(\"real\",p,e),l=new cm(\"imag\",p,e),c=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:p},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:p}],m=t.runWebGLProgram(u,c,\"float32\"),d=t.runWebGLProgram(l,c,\"float32\"),f=zr({inputs:{real:m,imag:d},backend:t});t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d);let h=te({inputs:{x:f},backend:t,attrs:{shape:r.shape}});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(f),h}function ute(r){let{inputs:e,backend:t}=r,{input:o}=e;return mg(o,!1,t)}var o3={kernelName:Xi,backendName:\"webgl\",kernelFunc:ute};var dg=class{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:\"value\",type:\"float\"}],this.variableNames=[\"x\"],this.outputShape=e,this.userCode=`\n void main() {\n // Input can be obtained from uniform value.\n setOutput(value);\n }\n `}};function Ei(r){let{backend:e,attrs:t}=r,{shape:o,value:n}=t,{dtype:s}=t;if(s=s||y.inferDtype(n),s===\"string\"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),e.makeTensorInfo(o,s,a)}else{let a=new dg(o,n),i=[[n]];return e.runWebGLProgram(a,[],s,i)}}var n3={kernelName:da,backendName:\"webgl\",kernelFunc:Ei};var fg=class{constructor(e){this.variableNames=[\"Image\"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n\n int coordX = ${t} - x - 1;\n float outputValue;\n if(coordX >= 0 && coordX < ${t}) {\n outputValue = getImage(coords[0], coords[1], coordX, coords[3]);\n } else {\n outputValue = getImage(coords[0], coords[1], coords[2], coords[3]);\n }\n setOutput(outputValue);\n }\n `}};var s3={kernelName:Gn,backendName:\"webgl\",kernelFunc:({inputs:r,backend:e})=>{let{image:t}=r,o=e,n=new fg(t.shape);return o.runWebGLProgram(n,[t],t.dtype)}};var a3=\"return floor(x);\",pte=xe({opSnippet:a3,packedOpSnippet:a3,cpuKernelImpl:DD}),i3={kernelName:Co,backendName:\"webgl\",kernelFunc:pte};var lte=`\n float s = sign(a) * sign(b);\n int ia = round(a);\n int ib = round(b);\n if (ib != 0) {\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n return float(idiv(ia, ib, s));\n } else {\n return NAN;\n }\n`,cte=`\n ivec4 ia = round(a);\n ivec4 ib = round(b);\n bvec4 cond = notEqual(ib, ivec4(0));\n ivec4 result = ivec4(0);\n vec4 s = sign(a) * sign(b);\n\n // Windows (D3D) wants guaranteed non-zero int division at compile-time.\n if (cond[0]) {\n result[0] = idiv(ia[0], ib[0], s[0]);\n }\n if (cond[1]) {\n result[1] = idiv(ia[1], ib[1], s[1]);\n }\n if (cond[2]) {\n result[2] = idiv(ia[2], ib[2], s[2]);\n }\n if (cond[3]) {\n result[3] = idiv(ia[3], ib[3], s[3]);\n }\n return vec4(result);\n`,mte=st({opSnippet:lte,packedOpSnippet:cte,dtype:\"int32\"}),u3={kernelName:wo,backendName:\"webgl\",kernelFunc:mte};var hg=class{constructor(e){this.variableNames=[\"A\"];let t=kt(),[o,n]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${o}.0);\n\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n setOutput(floor(value * 255.0 + 0.5));\n }\n `}};var gg=class{constructor(e){this.variableNames=[\"A\"],this.packedInputs=!1,this.packedOutput=!0;let t=kt(),[o,n]=e;this.outputShape=e,this.userCode=`\n void main() {\n ivec3 coords = getOutputCoords();\n int texR = coords[0];\n int texC = coords[1];\n int depth = coords[2];\n\n vec4 result = vec4(0.);\n\n for(int row=0; row<=1; row++) {\n for(int col=0; col<=1; col++) {\n texC = coords[1] + row;\n depth = coords[2] + col;\n\n vec2 uv = (vec2(texC, texR) + halfCR) /\n vec2(${n}.0, ${o}.0);\n vec4 values = ${t.texture2D}(A, uv);\n float value;\n if (depth == 0) {\n value = values.r;\n } else if (depth == 1) {\n value = values.g;\n } else if (depth == 2) {\n value = values.b;\n } else if (depth == 3) {\n value = values.a;\n }\n\n result[row * 2 + col] = floor(value * 255.0 + 0.5);\n }\n }\n\n ${t.output} = result;\n }\n `}};var p3={kernelName:Lu,backendName:\"webgl\",kernelFunc:dte},Ql,B0=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");function dte(r){let{inputs:e,backend:t,attrs:o}=r,{pixels:n}=e,{numChannels:s}=o,a=typeof HTMLVideoElement!=\"undefined\"&&n instanceof HTMLVideoElement,i=typeof HTMLImageElement!=\"undefined\"&&n instanceof HTMLImageElement,[p,u]=a?[n.videoWidth,n.videoHeight]:[n.width,n.height],l=[u,p],c=[u,p,s];if(i||a){let h=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");(Ql==null||h!==B0)&&(B0=h,Ql=document.createElement(\"canvas\").getContext(\"2d\",{willReadFrequently:B0})),Ql.canvas.width=p,Ql.canvas.height=u,Ql.drawImage(n,0,0,p,u),n=Ql.canvas}let m=t.makeTensorInfo(l,\"int32\");t.texData.get(m.dataId).usage=hr.PIXELS,t.gpgpu.uploadPixelDataToTexture(t.getTexture(m.dataId),n);let d=A().getBool(\"WEBGL_PACK\")?new gg(c):new hg(c),f=t.runWebGLProgram(d,[m],\"int32\");return t.disposeData(m.dataId),f}function fte(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dataFormat:l,dilations:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=C.convertConv2DDataFormat(l),g=C.computeConv2DInfo(n.shape,s.shape,p,c,u,m,!1,h),x,b=[],w=a!=null,S=i!=null,k=d===\"leakyrelu\",T=()=>{let R=[n,s],D=(F,O)=>{if(O===\"NCHW\"&&F.shape.length===1&&F.shape[0]!==1){let M=te({inputs:{x:F},backend:t,attrs:{shape:[F.shape[0],1,1]}});return b.push(M),M}return F};if(w&&R.push(D(a,l)),S&&R.push(D(i,l)),k){let F=t.makeTensorInfo([],\"float32\",y.createScalarValue(f,\"float32\"));R.push(F),b.push(F)}return R};if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type===\"SAME\"||g.padInfo.type===\"VALID\"))x=Qh({x:n,filter:s,convInfo:g,backend:t,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else if(g.strideWidth<=2&&h===\"channelsLast\"&&A().getBool(\"WEBGL_EXP_CONV\")){let R=d?Ti(d,!0):null,D=new jl(g,w,R,S,k),F=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],O=T();x=t.runWebGLProgram(D,O,\"float32\",F)}else if(A().getBool(\"WEBGL_CONV_IM2COL\"))x=Zh({x:n,filter:s,convInfo:g,backend:t,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else{let R=d?Ti(d,!1):null,D=new ql(g,w,R,S,k),F=T();x=t.runWebGLProgram(D,F,\"float32\")}let E=te({inputs:{x},backend:t,attrs:{shape:g.outShape}});return b.push(x),b.forEach(R=>t.disposeIntermediateTensorInfo(R)),E}var l3={kernelName:jo,backendName:\"webgl\",kernelFunc:fte};function hte(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dimRoundingMode:c,activation:m,leakyreluAlpha:d}=o,f=[],h=l;h==null&&(h=[1,1]),y.assert(C.eitherStridesOrDilationsAreOne(p,h),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`);let g=C.computeConv2DInfo(n.shape,s.shape,p,h,u,c,!0),x=A().getBool(\"WEBGL_PACK_DEPTHWISECONV\")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,b=m?Ti(m,x):null,w=[n,s],S=a!=null,k=i!=null,T=m===\"leakyrelu\";if(S&&w.push(a),k&&w.push(i),T){let F=t.makeTensorInfo([],\"float32\",y.createScalarValue(d,\"float32\"));w.push(F),f.push(F)}let E;x?E=new Yl(g,S,b,k,T):E=new Xl(g,S,b,k,T);let R=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],D=t.runWebGLProgram(E,w,\"float32\",R);return f.forEach(F=>t.disposeIntermediateTensorInfo(F)),D}var c3={kernelName:Xo,backendName:\"webgl\",kernelFunc:hte};var xg=class{constructor(e,t,o,n){this.sliceDim=e,this.strides=t,this.paramsShape=n,this.variableNames=[\"x\",\"indices\"],this.outputShape=o;let s=Re(o.length),a=`\n int index;`;for(let i=0;i= ${this.paramsShape[i]};\n flattenIndex += index * ${this.strides[i]};`;this.userCode=`\n void main() {\n ${s} coords = getOutputCoords();\n int flattenIndex = 0;\n bool out_of_bounds = false;\n\n ${a}\n\n setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1]));\n }\n `}};function gte(r){let{inputs:e,backend:t}=r,{params:o,indices:n}=e,s=n.shape,a=s[s.length-1],i=y.sizeFromShape(o.shape),[p,u,l,c]=C.prepareAndValidate(o,n),m=te({inputs:{x:n},backend:t,attrs:{shape:[u,a]}}),d=te({inputs:{x:o},backend:t,attrs:{shape:[y.sizeFromShape(o.shape)/l,l]}});if(t.shouldExecuteOnCPU([o,n])||o.dtype===\"string\"){let x=t.readSync(n.dataId),b=t.bufferSync(o),w=AD(x,b,o.dtype,u,a,l,c,o.shape,i);return t.makeTensorInfo(p,o.dtype,w.values)}let f=new xg(a,c,[u,l],o.shape),h=t.runWebGLProgram(f,[d,m],d.dtype),g=te({inputs:{x:h},backend:t,attrs:{shape:p}});return t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(h),g}var m3={kernelName:Kn,backendName:\"webgl\",kernelFunc:gte};var yg=class{constructor(e,t){this.variableNames=[\"A\",\"indices\"],this.outputShape=t,this.rank=t.length;let o=Re(this.rank),n=xte(e,2);this.userCode=`\n void main() {\n ${o} resRC = getOutputCoords();\n int index = int(getIndices(resRC.x, resRC.z));\n float inBounds = (index >= 0) && (index < ${e[2]}) ? 1.0 : 0.0;\n setOutput(inBounds * getA(${n}));\n }\n `}};function xte(r,e){let t=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],o=[];for(let n=0;n=0,()=>`GatherV2: the index value ${k} is not in [0, ${w-1}]`)}}let u=C.segment_util.collectGatherOpShapeInfo(n,s,p,i),l=y.sizeFromShape(s.shape),c=[],m=te({inputs:{x:n},backend:t,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),d=te({inputs:{x:s},backend:t,attrs:{shape:[u.batchSize,l/u.batchSize]}});c.push(m),c.push(d);let f=[u.batchSize,u.outerSize,l/u.batchSize,u.sliceSize];if(t.shouldExecuteOnCPU([n,s])||n.dtype===\"string\"){let b=t.bufferSync(d),w=t.bufferSync(m),S=FD(w,b,f);return c.forEach(k=>t.disposeIntermediateTensorInfo(k)),t.makeTensorInfo(u.outputShape,S.dtype,S.values)}let h=new yg(m.shape,f),g=t.runWebGLProgram(h,[m,d],m.dtype);c.push(g);let x=te({inputs:{x:g},backend:t,attrs:{shape:u.outputShape}});return c.forEach(b=>t.disposeIntermediateTensorInfo(b)),x}var d3={kernelName:fa,backendName:\"webgl\",kernelFunc:z0};var yte=\"return float(a > b);\",bte=`\n return vec4(greaterThan(a, b));\n`,Cte=st({opSnippet:yte,packedOpSnippet:bte,cpuKernelImpl:PD,dtype:\"bool\"}),f3={kernelName:So,backendName:\"webgl\",kernelFunc:Cte};var wte=\"return float(a >= b);\",Ste=`\n return vec4(greaterThanEqual(a, b));\n`,Ite=st({opSnippet:wte,packedOpSnippet:Ste,dtype:\"bool\",cpuKernelImpl:OD}),h3={kernelName:Io,backendName:\"webgl\",kernelFunc:Ite};function vte(r){let{inputs:e,backend:t}=r,{input:o}=e;return mg(o,!0,t)}var g3={kernelName:Yi,backendName:\"webgl\",kernelFunc:vte};var kte=\"return float(!isnan(x) && !isinf(x));\",Nte=xe({opSnippet:kte,dtype:\"bool\"}),x3={kernelName:qn,backendName:\"webgl\",kernelFunc:Nte};var Tte=\"return float(isinf(x));\",_te=xe({opSnippet:Tte,dtype:\"bool\"}),y3={kernelName:jn,backendName:\"webgl\",kernelFunc:_te};var Ete=\"return float(isnan(x));\",$te=xe({opSnippet:Ete,dtype:\"bool\"}),b3={kernelName:Xn,backendName:\"webgl\",kernelFunc:$te};var Rte=\"return float(a < b);\",Dte=`\n return vec4(lessThan(a, b));\n`,Ate=st({opSnippet:Rte,packedOpSnippet:Dte,cpuKernelImpl:MD,dtype:\"bool\"}),C3={kernelName:ko,backendName:\"webgl\",kernelFunc:Ate};var Fte=\"return float(a <= b);\",Pte=`\n return vec4(lessThanEqual(a, b));\n`,Ote=st({opSnippet:Fte,packedOpSnippet:Pte,cpuKernelImpl:LD,dtype:\"bool\"}),w3={kernelName:No,backendName:\"webgl\",kernelFunc:Ote};function Mte(r){let{backend:e,attrs:t}=r,{start:o,stop:n,num:s}=t,a=BD(o,n,s);return e.makeTensorInfo([a.length],\"float32\",a)}var S3={kernelName:Qn,backendName:\"webgl\",kernelFunc:Mte};var Lte=sn+`\n return x < 0.0 ? 0./0. : log(x);\n`,Bte=`\n vec4 result = log(x);\n bvec4 isNaN = isnan(x);\n result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r);\n result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g);\n result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b);\n result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a);\n return result;\n`,zte=xe({opSnippet:Lte,packedOpSnippet:Bte,cpuKernelImpl:zD}),I3={kernelName:To,backendName:\"webgl\",kernelFunc:zte};var Vte=sn+`\n return log(1.0 + x);\n`,Wte=xe({opSnippet:Vte}),v3={kernelName:Zn,backendName:\"webgl\",kernelFunc:Wte};var Ute=\"return float(a >= 1.0 && b >= 1.0);\",Gte=`\n return vec4(\n vec4(greaterThanEqual(a, vec4(1.0))) *\n vec4(greaterThanEqual(b, vec4(1.0))));\n`,Hte=st({opSnippet:Ute,packedOpSnippet:Gte,dtype:\"bool\"}),k3={kernelName:Jn,backendName:\"webgl\",kernelFunc:Hte};var Kte=\"return float(!(x >= 1.0));\",qte=xe({opSnippet:Kte}),N3={kernelName:es,backendName:\"webgl\",kernelFunc:qte};var jte=\"return float(a >= 1.0 || b >= 1.0);\",Xte=`\n return min(\n vec4(greaterThanEqual(a, vec4(1.0))) +\n vec4(greaterThanEqual(b, vec4(1.0))),\n vec4(1.0));\n`,Yte=st({opSnippet:jte,packedOpSnippet:Xte,dtype:\"bool\"}),T3={kernelName:ts,backendName:\"webgl\",kernelFunc:Yte};var bg=class{constructor(e,t,o,n,s){this.variableNames=[\"x\"],this.outputShape=[];let a=t,i=e[3]-1;this.outputShape=e;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n int d = coords[3];\n float x = getX(b, r, c, d);\n float sum = 0.0;\n for (int j = -${a}; j <= ${a}; j++) {\n int idx = d + j;\n if (idx >= 0 && idx <= ${i}) {\n float z = getX(b, r, c, idx);\n sum += z * z;\n }\n }\n float val = x * ${p};\n setOutput(val);\n }\n `}};var Cg=class{constructor(e,t,o,n,s){this.variableNames=[\"x\"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let a=t,i=e[3]-1;this.outputShape=e;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords.x;\n int r = coords.y;\n int c = coords.z;\n int d = coords.w;\n\n bool hasNextCol = d < ${this.outputShape[3]};\n bool hasNextRow = c < ${this.outputShape[2]};\n\n vec4 sum = vec4(0.);\n vec4 xFragAtOutputCoords = getX(b, r, c, d);\n\n vec4 xAtOutputCoords = vec4(\n getChannel(xFragAtOutputCoords, vec2(c, d)),\n hasNextCol ?\n getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0,\n hasNextRow ?\n getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0,\n (hasNextRow && hasNextCol) ?\n getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0\n );\n\n int firstChannel = d - ${a};\n vec2 cache = vec2(0.);\n if(firstChannel >= 0){\n vec4 firstChannelFrag = getX(b, r, c, firstChannel);\n cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel));\n if(hasNextRow){\n cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel));\n }\n }\n\n ivec2 depth = ivec2(d, d + 1);\n for (int j = - ${a}; j <= ${a}; j++) {\n ivec2 idx = depth + j;\n bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0));\n bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${i}));\n\n bool depthInRange = aboveLowerBound.x && belowUpperBound.x;\n bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y;\n\n if(depthInRange || depthPlusOneInRange){\n vec4 z = vec4(0.);\n vec4 xFragAtCurrentDepth;\n z.xz = cache.xy;\n if(depthPlusOneInRange && hasNextCol){\n xFragAtCurrentDepth = idx.y != d ?\n getX(b, r, c, idx.y) : xFragAtOutputCoords;\n z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y));\n if(hasNextRow){\n z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y));\n }\n }\n cache.xy = z.yw;\n sum += z * z;\n }\n }\n vec4 result = xAtOutputCoords * ${p};\n setOutput(result);\n }\n `}};var Qte=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u=A().getBool(\"WEBGL_PACK_NORMALIZATION\")?new Cg(n.shape,s,a,i,p):new bg(n.shape,s,a,i,p);return t.runWebGLProgram(u,[n],n.dtype)},_3={kernelName:rs,backendName:\"webgl\",kernelFunc:Qte};var wg=class{constructor(e,t,o,n,s){this.variableNames=[\"inputImage\",\"outputImage\",\"dy\"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=o,this.alpha=n,this.beta=s,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int r = coords[1];\n int c = coords[2];\n\n float result = 0.0;\n for (int d = 0; d < ${this.depth}; ++d) {\n int depthBegin = int(max(0.0, float(d - ${t})));\n int depthEnd = int(min(float(${this.depth}),\n float(d + ${t} + 1)));\n\n const int MIN_DEPTH_BEGIN = 0;\n const int MAX_DEPTH_END = ${this.depth};\n\n float norm = 0.0;\n for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) {\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n }\n else {\n break;\n }\n }\n\n norm = float(${n}) * norm + float(${o});\n\n for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){\n if (k < depthBegin){\n continue;\n }\n else if (k >= depthBegin && k < depthEnd){\n float dyi = -2.0 * float(${n})\n * float(${s})\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d)\n / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * ${s});\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n }\n else {\n break;\n }\n }\n }\n setOutput(result);\n }\n `}};var Zte=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n,y:s,dy:a}=e,{depthRadius:i,bias:p,alpha:u,beta:l}=o,c=new wg(n.shape,i,p,u,l);return t.runWebGLProgram(c,[n,s,a],n.dtype)},E3={kernelName:oi,backendName:\"webgl\",kernelFunc:Zte};function $3(r,e,t,o){let n=y.sizeFromShape(e),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=ro(i,r.dtype,\"max\",o),u=te({inputs:{x:p},attrs:{shape:t},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}function V0(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{reductionIndices:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,l=C.getAxesPermutation(u,i),c=l!=null,m=t.shouldExecuteOnCPU([n]),d=n;if(c){if(m){let w=t.texData.get(d.dataId).values,S=new Array(i);for(let E=0;E`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p);if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))return Ft({inputs:{x:n},backend:t});let c=new Zs(l,\"max\",!1);return t.runWebGLProgram(c,[n],n.dtype)}var A3={kernelName:ns,backendName:\"webgl\",kernelFunc:rre};function ore(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,u,p),m=new Nu(c,\"max\",!1);return t.runWebGLProgram(m,[n],n.dtype)}var F3={kernelName:ha,backendName:\"webgl\",kernelFunc:ore};var Sg=class{constructor(e){this.variableNames=[\"dy\",\"maxPos\"],this.outputShape=e.inShape;let t=e.strideHeight,o=e.strideWidth,n=e.dilationHeight,s=e.effectiveFilterHeight,a=e.effectiveFilterWidth,i=s-1-e.padInfo.top,p=a-1-e.padInfo.left,u=s*a-1;this.userCode=`\n const ivec2 pads = ivec2(${i}, ${p});\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n\n ivec2 dyRCCorner = coords.yz - pads;\n int dyRCorner = dyRCCorner.x;\n int dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n for (int wR = 0; wR < ${s};\n wR += ${n}) {\n float dyR = float(dyRCorner + wR) / ${t}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${a}; wC++) {\n float dyC = float(dyCCorner + wC) / ${o}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(b, idyR, idyC, d);\n int maxPosValue = ${u} - int(getMaxPos(b, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue = wR * ${a} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n setOutput(dotProd);\n }\n `}},Ig=class{constructor(e){this.variableNames=[\"dy\",\"maxPos\"],this.outputShape=e.inShape;let t=e.strideDepth,o=e.strideHeight,n=e.strideWidth,s=e.dilationDepth,a=e.dilationHeight,i=e.dilationWidth,p=e.effectiveFilterDepth,u=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=p-1-e.padInfo.front,m=u-1-e.padInfo.top,d=l-1-e.padInfo.left,f=p*u*l-1;this.userCode=`\n const ivec3 pads = ivec3(${c}, ${m}, ${d});\n\n void main() {\n ivec5 coords = getOutputCoords();\n int batch = coords.x;\n int ch = coords.u;\n\n ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads;\n int dyDCorner = dyCorner.x;\n int dyRCorner = dyCorner.y;\n int dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n float dotProd = 0.0;\n\n for (int wD = 0; wD < ${p};\n wD += ${s}) {\n float dyD = float(dyDCorner + wD) / ${t}.0;\n\n if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) {\n continue;\n }\n int idyD = int(dyD);\n\n for (int wR = 0; wR < ${u};\n wR += ${a}) {\n float dyR = float(dyRCorner + wR) / ${o}.0;\n\n if (dyR < 0.0 || dyR >= ${e.outHeight}.0 ||\n fract(dyR) > 0.0) {\n continue;\n }\n int idyR = int(dyR);\n\n for (int wC = 0; wC < ${l};\n wC += ${i}) {\n float dyC = float(dyCCorner + wC) / ${n}.0;\n\n if (dyC < 0.0 || dyC >= ${e.outWidth}.0 ||\n fract(dyC) > 0.0) {\n continue;\n }\n int idyC = int(dyC);\n\n float dyValue = getDy(batch, idyD, idyR, idyC, ch);\n int maxPosValue = ${f} -\n int(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n int curPosValue =\n wD * ${u} * ${l} +\n wR * ${l} + wC;\n float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0);\n\n dotProd += dyValue * mask;\n }\n }\n }\n setOutput(dotProd);\n }\n `}};function nre(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:l}=o,c=[1,1,1],m=C.computePool3DInfo(a.shape,i,p,c,u,l),d=new Nu(m,\"max\",!0),f=t.runWebGLProgram(d,[a],a.dtype),h=new Ig(m),g=t.runWebGLProgram(h,[n,f],a.dtype);return t.disposeIntermediateTensorInfo(f),g}var P3={kernelName:Ji,backendName:\"webgl\",kernelFunc:nre};function sre(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s,output:a}=e,i=s;Ys([s,a],\"maxPoolGrad\");let{filterSize:p,strides:u,pad:l,dimRoundingMode:c}=o,m=C.computePool2DInfo(i.shape,p,u,1,l,c),d=!0,f=new Zs(m,\"max\",d),h=t.runWebGLProgram(f,[i],i.dtype),g=new Sg(m),x=t.runWebGLProgram(g,[n,h],i.dtype);return t.disposeIntermediateTensorInfo(h),x}var O3={kernelName:Zi,backendName:\"webgl\",kernelFunc:sre};function M3(r,e,t,o){let n=new Zs(t,\"max\",!1),s=o.runWebGLProgram(n,[r],\"float32\");n=new Zs(t,\"max\",!0,!0,e);let a=o.runWebGLProgram(n,[r],\"float32\");return[s,a]}var L3={kernelName:ga,backendName:\"webgl\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=e,p=t;y.assert(o.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${o.shape.length}.`);let u=[1,1];y.assert(C.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let l=C.computePool2DInfo(o.shape,n,s,u,a),[c,m]=M3(o,i,l,p);return[c,m]}};function B3(r,e,t,o){let n=y.sizeFromShape(e),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=ro(i,\"float32\",\"mean\",o),u=te({inputs:{x:p},attrs:{shape:t},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}var z3={kernelName:ss,backendName:\"webgl\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o}=r,{keepDims:n,axis:s}=e,a=t,i=o.shape.length,p=y.parseAxisParam(s,o.shape),u=p,l=C.getAxesPermutation(u,i),c=l!=null,m=a.shouldExecuteOnCPU([o]),d=[],f=o;if(c){if(m){let S=a.texData.get(f.dataId).values,k=new Array(i);for(let R=0;Rl[0]+e[c]+l[1]);let n=e.length,s=Re(n),a=t.map(l=>l[0]).join(\",\"),i=t.map((l,c)=>l[0]+e[c]).join(\",\"),p=[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,n),u=o===\"reflect\"?0:1;if(n===1){this.userCode=`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start) {\n outC = start * 2 - outC - ${u};\n } else if(outC >= end) {\n outC = (end - 1) * 2 - outC + ${u};\n }\n setOutput(getX(outC - start));\n }\n `;return}this.userCode=`\n ${s} start = ${s}(${a});\n ${s} end = ${s}(${i});\n\n void main() {\n ${s} outC = getOutputCoords();\n for (int i = 0; i < ${n}; i++) {\n if (outC[i] < start[i]) {\n outC[i] = start[i] * 2 - outC[i] - ${u};\n } else if(outC[i] >= end[i]) {\n outC[i] = (end[i] - 1) * 2 - outC[i] + ${u};\n }\n }\n ${s} coords = outC - start;\n setOutput(getX(${p}));\n }\n `}};var kg=class{constructor(e,t,o){this.variableNames=[\"x\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((f,h)=>f[0]+e[h]+f[1]);let n=e.length,s=Re(n),a=t.map(f=>f[0]).join(\",\"),i=t.map((f,h)=>f[0]+e[h]).join(\",\"),p=At(\"rc\",n),u=At(\"source\",n),l=`${p[n-1]} < ${this.outputShape[n-1]}`,c=n===1?\"source\":`vec2(${u.slice(-2).join()})`,m=o===\"reflect\"?0:1,d=\"\";if(n===1){let f=`\n ${s} source = rc;\n if (source < start) {\n source = start * 2 - source - ${m};\n } else if (source >= end) {\n source = (end - 1) * 2 - source + ${m};\n }\n source -= start;\n `;d=`\n ${s} rc = outputLoc;\n ${f}\n result[0] = getChannel(getX(${u.join()}), ${c});\n ${p[n-1]} += 1;\n if(${l}) {\n ${f}\n result[1] = getChannel(getX(${u.join()}), ${c});\n }\n `}else{let f=`\n ${s} source = rc;\n ${s} lt = ${s}(lessThan(source, start));\n ${s} gte = ${s}(greaterThanEqual(source, end));\n ${s} orig = 1 - (lt + gte);\n source = orig * source +\n lt * (start * 2 - source - ${m}) +\n gte * ((end - 1) * 2 - source + ${m});\n source -= start;\n `;d=`\n ${s} rc = outputLoc;\n ${f}\n result[0] = getChannel(getX(${u.join()}), ${c});\n ${p[n-1]} += 1;\n if(${l}) {\n ${f}\n result[1] = getChannel(getX(${u.join()}), ${c});\n }\n rc = outputLoc;\n ${p[n-2]} += 1;\n if(${p[n-2]} < ${this.outputShape[n-2]}) {\n ${f}\n result[2] = getChannel(getX(${u.join()}), ${c});\n ${p[n-1]} += 1;\n if(${l}) {\n ${f}\n result[3] = getChannel(getX(${u.join()}), ${c});\n }\n }\n `}this.userCode=`\n const ${s} start = ${s}(${a});\n const ${s} end = ${s}(${i});\n\n void main() {\n ${s} outputLoc = getOutputCoords();\n vec4 result = vec4(0.);\n ${d}\n setOutput(result);\n }\n `}};var lre=({inputs:r,backend:e,attrs:t})=>{let{x:o}=r,{paddings:n,mode:s}=t,a=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new kg(o.shape,n,s):new vg(o.shape,n,s);return e.runWebGLProgram(a,[o],o.dtype)},U3={kernelName:is,backendName:\"webgl\",kernelFunc:lre};var cre=`if (b == 0.0) return NAN;\n return mod(a, b);`,mre=`\n vec4 result = mod(a, b);\n bvec4 isNaN = equal(b, vec4(0.0));\n `+to+`\n return result;\n`,dre=st({opSnippet:cre,packedOpSnippet:mre}),G3={kernelName:us,backendName:\"webgl\",kernelFunc:dre};var Ng=class{constructor(e,t,o){this.variableNames=[\"probs\"],this.customUniforms=[{name:\"seed\",type:\"float\"}],this.outputShape=[e,o],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n\n float r = random(seed);\n float cdf = 0.0;\n\n for (int i = 0; i < ${t-1}; i++) {\n cdf += getProbs(batch, i);\n\n if (r < cdf) {\n setOutput(float(i));\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutput(float(${t-1}));\n }\n `}};var fre=`\nif (a == b) {\n return 1.0;\n};\nreturn a / b;`,hre=`\n // vec4 one = vec4(equal(a, b));\n // return one + (vec4(1.0) - one) * a / b;\n vec4 result = a / b;\n if(a.x == b.x) {\n result.x = 1.;\n }\n if(a.y == b.y) {\n result.y = 1.;\n }\n if(a.z == b.z) {\n result.z = 1.;\n }\n if(a.w == b.w) {\n result.w = 1.;\n }\n\n return result;\n`,W0=st({opSnippet:fre,packedOpSnippet:hre,checkOutOfBounds:!0}),H3={kernelName:Vn,backendName:\"webgl\",kernelFunc:W0};var K3=\"return a - b;\",U0=st({opSnippet:K3,packedOpSnippet:K3,supportsComplex:!0,cpuKernelImpl:lA}),q3={kernelName:Oo,backendName:\"webgl\",kernelFunc:U0};function G0(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{dim:s}=o,a=y.parseAxisParam([s],n.shape),i=V0({inputs:{x:n},backend:t,attrs:{reductionIndices:a,keepDims:!1}}),p=C.expandShapeToKeepDim(i.shape,a),u=te({inputs:{x:i},backend:t,attrs:{shape:p}}),l=U0({inputs:{a:n,b:u},backend:t}),c=L0({inputs:{x:l},backend:t}),m=Tp({inputs:{x:c},backend:t,attrs:{axis:a,keepDims:!1}}),d=te({inputs:{x:m},backend:t,attrs:{shape:p}}),f=W0({inputs:{a:c,b:d},backend:t});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(u),t.disposeIntermediateTensorInfo(l),t.disposeIntermediateTensorInfo(c),t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d),f}var j3={kernelName:Fs,backendName:\"webgl\",kernelFunc:G0};function gre(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o,p=i?n:G0({inputs:{logits:n},backend:t,attrs:{dim:n.shape.length-1}}),u=p.shape[0],l=p.shape[1],c=new Ng(u,l,s),m=[[a]],d=t.runWebGLProgram(c,[p],\"int32\",m);return i||t.disposeIntermediateTensorInfo(p),d}var X3={kernelName:ps,backendName:\"webgl\",kernelFunc:gre};var xre=Gt+`\n return -x;\n`,yre=`\n vec4 result = -x;\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`;function bre(r){let{inputs:e,backend:t}=r,{x:o}=e;if(t.shouldExecuteOnCPU([o])){let s=t.texData.get(o.dataId),[a,i]=HD(s.values,o.shape,o.dtype);return t.makeTensorInfo(i,o.dtype,a)}let n;return A().getBool(\"WEBGL_PACK_UNARY_OPERATIONS\")?n=new Lr(o.shape,yre):n=new nr(o.shape,xre),t.runWebGLProgram(n,[o],o.dtype)}var Y3={kernelName:ls,backendName:\"webgl\",kernelFunc:bre};var Cre=Ut.nonMaxSuppressionV3Impl;function wre(r){C.warn(\"tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=t.readSync(n.dataId),l=t.readSync(s.dataId),{selectedIndices:c}=Cre(u,l,a,i,p);return t.makeTensorInfo([c.length],\"int32\",new Int32Array(c))}var Q3={kernelName:cs,backendName:\"webgl\",kernelFunc:wre};var Sre=Ut.nonMaxSuppressionV4Impl;function Ire(r){C.warn(\"tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,padToMaxOutputSize:u}=o,l=t.readSync(n.dataId),c=t.readSync(s.dataId),{selectedIndices:m,validOutputs:d}=Sre(l,c,a,i,p,u);return[t.makeTensorInfo([m.length],\"int32\",new Int32Array(m)),t.makeTensorInfo([],\"int32\",new Int32Array([d]))]}var Z3={kernelName:ni,backendName:\"webgl\",kernelFunc:Ire};var vre=Ut.nonMaxSuppressionV5Impl;function kre(r){C.warn(\"tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,l=t.readSync(n.dataId),c=t.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=vre(l,c,m,d,f,h);return[t.makeTensorInfo([g.length],\"int32\",new Int32Array(g)),t.makeTensorInfo([x.length],\"float32\",new Float32Array(x))]}var J3={kernelName:ms,backendName:\"webgl\",kernelFunc:kre};var Tg=class{constructor(e,t,o,n){this.variableNames=[\"indices\"],this.outputShape=[e,t],this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(${n}), float(${o}),\n float(index == coords.y)));\n }\n `}};var Nre=r=>{let{inputs:e,backend:t,attrs:o}=r,{indices:n}=e,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),l=new Tg(u,a,i,p),c=te({inputs:{x:n},backend:t,attrs:{shape:[u]}}),m=t.runWebGLProgram(l,[c],s);t.disposeIntermediateTensorInfo(c);let d=[...n.shape,a],f=te({inputs:{x:m},backend:t,attrs:{shape:d}});return t.disposeIntermediateTensorInfo(m),f},eP={kernelName:ds,backendName:\"webgl\",kernelFunc:Nre};function mm(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype===\"complex64\"){let n=_i({inputs:{input:o},backend:t}),s=mm({inputs:{x:n},backend:t}),a=Ep({inputs:{input:o},backend:t}),i=mm({inputs:{x:a},backend:t}),p=zr({inputs:{real:s,imag:i},backend:t});return t.disposeIntermediateTensorInfo(n),t.disposeIntermediateTensorInfo(s),t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(i),p}else return Ei({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype===\"string\"?\"\":0},backend:t})}var tP={kernelName:_a,backendName:\"webgl\",kernelFunc:mm};function rP(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype===\"string\")throw new Error(\"onesLike is not supported under string dtype\");if(o.dtype===\"complex64\"){let n=_i({inputs:{input:o},backend:t}),s=rP({inputs:{x:n},backend:t}),a=Ep({inputs:{input:o},backend:t}),i=mm({inputs:{x:a},backend:t}),p=zr({inputs:{real:s,imag:i},backend:t});return t.disposeIntermediateTensorInfo(n),t.disposeIntermediateTensorInfo(s),t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(i),p}else return Ei({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:t})}var oP={kernelName:xa,backendName:\"webgl\",kernelFunc:rP};function Tre(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o;if(e.length===1)return cg({inputs:{input:e[0]},backend:t,attrs:{dim:n}});let s=e[0].shape,a=e[0].dtype;e.forEach(l=>{y.assertShapesMatch(s,l.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===l.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=e.map(l=>{let c=cg({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=M0({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeIntermediateTensorInfo(l)),u}var nP={kernelName:ya,backendName:\"webgl\",kernelFunc:Tre};var _g=class{constructor(e,t,o){this.variableNames=[\"x\"],this.customUniforms=[{name:\"value\",type:\"float\"}],this.outputShape=t.map((u,l)=>u[0]+e[l]+u[1]);let n=e.length,s=Re(n),a=t.map(u=>u[0]).join(\",\"),i=t.map((u,l)=>u[0]+e[l]).join(\",\"),p=[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,n);if(n===1){this.userCode=`\n int start = ${a};\n int end = ${i};\n\n void main() {\n int outC = getOutputCoords();\n if (outC < start || outC >= end) {\n setOutput(value);\n } else {\n setOutput(getX(outC - start));\n }\n }\n `;return}this.userCode=`\n ${s} start = ${s}(${a});\n ${s} end = ${s}(${i});\n\n void main() {\n ${s} outC = getOutputCoords();\n if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) {\n setOutput(value);\n } else {\n ${s} coords = outC - start;\n setOutput(getX(${p}));\n }\n }\n `}};var Eg=class{constructor(e,t,o){this.variableNames=[\"x\"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:\"value\",type:\"float\"}],this.outputShape=t.map((h,g)=>h[0]+e[g]+h[1]);let n=e.length,s=Re(n),a=t.map(h=>h[0]).join(\",\"),i=t.map((h,g)=>h[0]+e[g]).join(\",\"),p=At(\"rc\",n),u=At(\"source\",n),l=`${p[n-1]} < ${this.outputShape[n-1]}`,c=n===1?\"source\":`vec2(${u.slice(-2).join()})`,m=[`${s} rc = outputLoc;`,`${p[n-1]} += 1;\n if(${l}) {\n `,n===1?\"\":`}\n rc = outputLoc;\n ${p[n-2]} += 1;\n if(${p[n-2]} < ${this.outputShape[n-2]}) {`,n===1?\"\":` ${p[n-1]} += 1;\n if(${l}) {`],d=n===1?\"rc < start || rc >= end\":\"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))\",f=\"\";for(let h=0,g=n===1?2:4;h{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{paddings:s,constantValue:a}=o;if(y.sizeFromShape(n.shape)===0){let u=s.map((l,c)=>l[0]+n.shape[c]+l[1]);return Ei({backend:t,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new Eg(n.shape,s,a):new _g(n.shape,s,a),p=[[a]];return t.runWebGLProgram(i,[n],n.dtype,p)},sP={kernelName:fs,backendName:\"webgl\",kernelFunc:H0};var _re=`\n if(a < 0.0 && floor(b) < b){\n return NAN;\n }\n if (b == 0.0) {\n return 1.0;\n }\n return (round(mod(b, 2.0)) != 1) ?\n pow(abs(a), b) : sign(a) * pow(abs(a), b);\n`,Ere=`\n // isModRound1 has 1 for components with round(mod(b, 2.0)) == 1, 0 otherwise.\n vec4 isModRound1 = vec4(equal(round(mod(b, 2.0)), ivec4(1)));\n vec4 multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n vec4 result = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n bvec4 isExpZero = equal(b, vec4(0.0));\n result.r = isExpZero.r ? 1.0 : result.r;\n result.g = isExpZero.g ? 1.0 : result.g;\n result.b = isExpZero.b ? 1.0 : result.b;\n result.a = isExpZero.a ? 1.0 : result.a;\n\n bvec4 isNaN1 = lessThan(a, vec4(0.0));\n bvec4 isNaN2 = lessThan(floor(b), b);\n bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w);\n `+to+`\n return result;\n`,$re=st({opSnippet:_re,packedOpSnippet:Ere}),aP={kernelName:hs,backendName:\"webgl\",kernelFunc:$re};function Rre(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=n.shape.length,p=[],u=y.parseAxisParam(s,n.shape),l=u,c=C.getAxesPermutation(l,i),m=n;c!=null&&(m=Ct({inputs:{x:n},backend:t,attrs:{perm:c}}),l=C.getInnerMostAxes(l.length,i),p.push(m)),C.assertAxesAreInnerMostDims(\"prod\",l,i);let d;if(t.shouldExecuteOnCPU([m])){let f=t.texData.get(m.dataId).values,{outVals:h,outShape:g,outDtype:x}=qD(m.shape,m.dtype,f,l);d=t.makeTensorInfo(g,x,h)}else{let[f,h]=C.computeOutAndReduceShapes(m.shape,l),g=y.sizeFromShape(h),x=te({inputs:{x:m},backend:t,attrs:{shape:[-1,g]}}),b=mi(n.dtype),w=ro(x,b,\"prod\",t);d=te({inputs:{x:w},backend:t,attrs:{shape:f}}),p.push(x),p.push(w)}if(a){p.push(d);let f=C.expandShapeToKeepDim(d.shape,u);d=te({inputs:{x:d},backend:t,attrs:{shape:f}})}return p.forEach(f=>t.disposeIntermediateTensorInfo(f)),d}var iP={kernelName:Ho,backendName:\"webgl\",kernelFunc:Rre};function Dre(r){let{inputs:e,backend:t,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=e,{outputRaggedRank:i}=o,p=n.map(x=>t.readSync(x.dataId)),u=n.map(x=>x.shape),l=t.readSync(s.dataId),c=t.readSync(a.dataId),[m,d,f]=jD(p,u,l,s.shape,s.dtype,c,a.shape,i),h=m.map(x=>t.makeTensorInfo([x.length],\"int32\",x)),g=t.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var uP={kernelName:Qp,backendName:\"webgl\",kernelFunc:Dre};function Are(r){let{inputs:e,backend:t}=r,{starts:o,limits:n,deltas:s}=e,a=t.readSync(o.dataId),i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,l]=XD(a,o.shape,o.dtype,i,n.shape,p,s.shape),c=t.makeTensorInfo([u.length],\"int32\",u),m=t.makeTensorInfo([l.length],o.dtype,l);return[c,m]}var pP={kernelName:Zp,backendName:\"webgl\",kernelFunc:Are};function Fre(r){let{inputs:e,backend:t,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=e,{rowPartitionTypes:p}=o,u=t.readSync(n.dataId),l=t.readSync(s.dataId),c=t.readSync(a.dataId),m=i.map(g=>t.readSync(g.dataId)),d=i.map(g=>g.shape),[f,h]=YD(u,n.shape,l,s.shape,s.dtype,c,a.shape,m,d,p);return t.makeTensorInfo(f,s.dtype,h)}var lP={kernelName:Jp,backendName:\"webgl\",kernelFunc:Fre};var K0=r=>{let{backend:e,attrs:t}=r,{start:o,stop:n,step:s,dtype:a}=t,i=QD(o,n,s,a);return e.makeTensorInfo([i.length],a,i)},cP={kernelName:ba,backendName:\"webgl\",kernelFunc:K0};var Pre=\"return 1.0 / x;\",Ore=xe({opSnippet:Pre}),mP={kernelName:xs,backendName:\"webgl\",kernelFunc:Ore};var Mre=Gt+`\n return (x < 0.0) ? 0.0 : x;\n`,Lre=`\n vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,Bre=xe({opSnippet:Mre,packedOpSnippet:Lre}),dP={kernelName:ys,backendName:\"webgl\",kernelFunc:Bre};var zre=Gt+`\n return (x < 0.0) ? 0.0 : min(6.0, x);\n`,Vre=`\n vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0)));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,Wre=xe({opSnippet:zre,packedOpSnippet:Vre}),fP={kernelName:ws,backendName:\"webgl\",kernelFunc:Wre};var $g=class{constructor(e,t,o,n,s){this.variableNames=[\"A\"],this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m;s?m=\"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)\":m=\"vec2(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${l[0]/c[0]},\n ${l[1]/c[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${p}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${m};\n\n // Compute the four integer indices.\n ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0)));\n ivec2 sourceCeilRC = ivec2(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d);\n float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d);\n float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d);\n float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n float top = topLeft + (topRight - topLeft) * fracRC.y;\n float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n float newValue = top + (bottom - top) * fracRC.x;\n\n setOutput(newValue);\n }\n `}};var Rg=class{constructor(e,t,o,n,s){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m;s?m=\"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)\":m=\"vec3(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${l[0]/c[0]},\n ${l[1]/c[1]},\n ${l[1]/c[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${p}.0,\n ${p}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${m};\n\n // Compute the four integer indices.\n ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0)));\n ivec3 sourceCeilRC = ivec3(\n min(inputShapeRC - 1.0, ceil(sourceFracIndexRC)));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${u-1};\n bool hasNextRow = coords.z < ${o-1};\n\n // In parallel, construct four corners for all four components in\n // packed 2x2 cell.\n vec4 topLeft = vec4(\n getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 bottomLeft = vec4(\n getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0);\n\n vec4 topRight = vec4(\n getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec4 bottomRight = vec4(\n getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d),\n hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0);\n\n vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC);\n\n vec4 top = mix(topLeft, topRight, fracRC.yyzz);\n vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz);\n vec4 newValue = mix(top, bottom, fracRC.x);\n\n setOutput(newValue);\n }\n `}};function Ure(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,l=A().getBool(\"WEBGL_PACK_IMAGE_OPERATIONS\")?new Rg(n.shape,p,u,s,a):new $g(n.shape,p,u,s,a);return t.runWebGLProgram(l,[n],\"float32\")}var hP={kernelName:Cs,backendName:\"webgl\",kernelFunc:Ure};var Dg=class{constructor(e,t,o){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=t;let[,n,s]=t,[,a,i]=e,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],l=p[0]/u[0],c=p[1]/u[1],m=1/l,d=1/c,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${l});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${m});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${f});\n const int winWidth = int(${h});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(startRLerp - float(winHeight / 2));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(startCLerp - float(winWidth / 2));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float dxR = float(dyR) * heightScale;\n int topDxRIndex = int(floor(dxR));\n int bottomDxRIndex = int(min(ceil(dxR), ${n-1}.0));\n float dxRLerp = dxR - float(topDxRIndex);\n float inverseDxRLerp = 1.0 - dxRLerp;\n\n float dxC = float(dyC) * widthScale;\n int leftDxCIndex = int(floor(dxC));\n int rightDxCIndex = int(min(ceil(dxC), ${s-1}.0));\n float dxCLerp = dxC - float(leftDxCIndex);\n float inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}};function Gre(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=new Dg(s.shape,n.shape,a);return t.runWebGLProgram(i,[s],s.dtype)}var gP={kernelName:ii,backendName:\"webgl\",kernelFunc:Gre};var Ag=class{constructor(e,t,o,n,s){this.variableNames=[\"A\"],this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m=n?\"0.5\":\"0.0\",d;s?d=\"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))\":d=\"vec2(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec2 effectiveInputOverOutputRatioRC = vec2(\n ${l[0]/c[0]},\n ${l[1]/c[1]});\n const vec2 inputShapeRC = vec2(${i}.0, ${p}.0);\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n ivec2 yRC = coords.yz;\n\n // Fractional source index.\n vec2 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec2 sourceNearestRC = ivec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${m})));\n float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutput(newValue);\n }\n `}};var Fg=class{constructor(e,t,o,n,s){this.variableNames=[\"A\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m=n?\"0.5\":\"0.0\",d;s?d=\"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))\":d=\"vec3(yRC) * effectiveInputOverOutputRatioRC\",this.userCode=`\n const vec3 effectiveInputOverOutputRatioRC = vec3(\n ${l[0]/c[0]},\n ${l[1]/c[1]},\n ${l[1]/c[1]});\n const vec3 inputShapeRC = vec3(${i}.0, ${p}.0,\n ${p}.0);\n\n float getAValue(int b, int r, int c, int d) {\n return getChannel(getA(b, r, c, d), vec2(c, d));\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n // Calculate values for next column in yRC.z.\n ivec3 yRC = coords.yzz + ivec3(0, 0, 1);\n\n // Fractional source index.\n vec3 sourceFracIndexRC = ${d};\n\n // Compute the coordinators of nearest neighbor point.\n ivec3 sourceNearestRC = ivec3(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${m})));\n\n // Should we calculate next column and row elements in 2x2 packed cell.\n bool hasNextCol = d < ${u-1};\n bool hasNextRow = coords.z < ${o-1};\n\n vec4 newValue = vec4(\n getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d),\n hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1)\n : 0.0,\n hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d)\n : 0.0,\n (hasNextRow && hasNextCol) ?\n getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0);\n\n setOutput(newValue);\n }\n `}};function Hre(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,l=A().getBool(\"WEBGL_PACK_IMAGE_OPERATIONS\")?new Fg(n.shape,p,u,s,a):new Ag(n.shape,p,u,s,a);return t.runWebGLProgram(l,[n],n.dtype)}var xP={kernelName:bs,backendName:\"webgl\",kernelFunc:Hre};var Pg=class{constructor(e,t,o){this.variableNames=[\"dy\"],this.outputShape=[],this.outputShape=t;let[,n,s]=t,[,a,i]=e,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],l=p[0]/u[0],c=p[1]/u[1],m=1/l,d=1/c,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int b = coords[0];\n int d = coords[3];\n int r = coords[1];\n int c = coords[2];\n\n float accumulator = 0.0;\n\n const float heightScale = float(${l});\n const float widthScale = float(${c});\n\n const float invHeightScale = float(${m});\n const float invWidthScale = float(${d});\n\n const int winHeight = int(${f});\n const int winWidth = int(${h});\n\n // Compute bounds for where in dy we will look\n float startRLerp = floor(float(r) * invHeightScale);\n int startDyR = int(floor(startRLerp - float(winHeight / 2)));\n\n float startCLerp = floor(float(c) * invWidthScale);\n int startDyC = int(floor(startCLerp - float(winWidth / 2)));\n\n // Loop over dy\n for (int dyROffset = 0; dyROffset < winHeight; dyROffset++) {\n int dyR = dyROffset + startDyR;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= ${a}) {\n continue;\n }\n\n for (int dyCOffset = 0; dyCOffset < winWidth; dyCOffset++) {\n int dyC = dyCOffset + startDyC;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= ${i}) {\n continue;\n }\n\n float sourceFracRow =\n float(${p[0]}) *\n (float(dyR) / float(${u[0]}));\n\n float sourceFracCol =\n float(${p[1]}) *\n (float(dyC) / float(${u[1]}));\n\n int sourceNearestRow = int(min(\n float(int(${n}) - 1),\n ${o} ? float(round(sourceFracRow)) :\n float(floor(sourceFracRow))));\n\n int sourceNearestCol = int(min(\n float(int(${s}) - 1),\n ${o} ? float(round(sourceFracCol)) :\n float(floor(sourceFracCol))));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutput(accumulator);\n }\n `}};function Kre(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=new Pg(s.shape,n.shape,a);return t.runWebGLProgram(i,[s],s.dtype)}var yP={kernelName:ai,backendName:\"webgl\",kernelFunc:Kre};var Og=class{constructor(e,t){this.variableNames=[\"x\"];let o=e.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);if(this.outputShape=e,o===1){this.userCode=`\n void main() {\n int coord = getOutputCoords();\n setOutput(getX(${e[0]} - coord - 1));\n }\n `;return}let n=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,s=e.map((i,p)=>n(p)).join(\",\"),a=Re(o);this.userCode=`\n void main() {\n ${a} coords = getOutputCoords();\n setOutput(getX(${s}));\n }\n `}};var Mg=class{constructor(e,t){this.variableNames=[\"x\"],this.packedInputs=!0,this.packedOutput=!0;let o=e.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);this.outputShape=e;let n=At(\"rc\",o),s=`${n[o-1]} + 1 < ${this.outputShape[o-1]}`,a=`${n[o-2]} + 1 < ${this.outputShape[o-2]}`,i=Re(o);o===1?this.userCode=`\n void main(){\n int rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = getChannel(getX(${e[0]} - rc - 1),\n ${e[0]} - rc - 1);\n if(${s}){\n result.g = getChannel(getX(${e[0]} - (rc + 1) - 1),\n ${e[0]} - (rc + 1) - 1);\n }\n setOutput(result);\n }\n `:this.userCode=`\n void main() {\n ${i} rc = getOutputCoords();\n vec4 result = vec4(0.);\n result.r = ${p(n.slice())};\n if(${s}){\n result.g = ${u(n.slice())};\n }\n if(${a}) {\n result.b = ${l(n.slice())};\n if(${s}) {\n result.a = ${c(n.slice())};\n }\n }\n setOutput(result);\n }\n `;function p(f){return m(f)}function u(f){return f[o-1]=\"(\"+f[o-1]+\" + 1)\",m(f)}function l(f){return f[o-2]=\"(\"+f[o-2]+\" + 1)\",m(f)}function c(f){return f[o-1]=\"(\"+f[o-1]+\" + 1)\",f[o-2]=\"(\"+f[o-2]+\" + 1)\",m(f)}function m(f){let h=e.map((b,w)=>d(w,f)),g=h.join(\",\"),x=h.slice(-2).join(\",\");return`getChannel(getX(${g}), vec2(${x}))`}function d(f,h){return t.indexOf(f)!==-1&&e[f]!==1?`${e[f]} - ${h[f]} - 1`:`${h[f]}`}}};function qre(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o,a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return Ft({inputs:{x:n},backend:t});let p=A().getBool(\"WEBGL_PACK_ARRAY_OPERATIONS\")?new Mg(n.shape,i):new Og(n.shape,i);return t.runWebGLProgram(p,[n],n.dtype)}var bP={kernelName:Ss,backendName:\"webgl\",kernelFunc:qre};var Lg=class{constructor(e,t){this.variableNames=[\"Image\"],this.outputShape=[],this.customUniforms=[{name:\"params\",type:\"vec4\"}];let o=e[1],n=e[2];this.outputShape=e;let s=\"\";typeof t==\"number\"?s=`float outputValue = ${t.toFixed(2)};`:s=`\n vec3 fill = vec3(${t.join(\",\")});\n float outputValue = fill[coords[3]];`,this.userCode=`\n void main() {\n ivec4 coords = getOutputCoords();\n int x = coords[2];\n int y = coords[1];\n float coordXFloat = (float(x) - params[0]) * params[3] -\n (float(y) - params[1]) * params[2];\n float coordYFloat = (float(x) - params[0]) * params[2] +\n (float(y) - params[1]) * params[3];\n int coordX = int(round(coordXFloat + params[0]));\n int coordY = int(round(coordYFloat + params[1]));\n ${s}\n if(coordX >= 0 && coordX < ${n} && coordY >= 0 && coordY < ${o}) {\n outputValue = getImage(coords[0], coordY, coordX, coords[3]);\n }\n setOutput(outputValue);\n }\n `}};var CP={kernelName:Vs,backendName:\"webgl\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=e,i=t,p=new Lg(o.shape,s),[u,l]=C.getImageCenter(a,o.shape[1],o.shape[2]),c=[[u,l,Math.sin(n),Math.cos(n)]];return i.runWebGLProgram(p,[o],o.dtype,c)}};var jre=`\n // OpenGL ES does not support round function.\n // The algorithm is based on banker's rounding.\n float base = floor(x);\n if ((x - base) < 0.5) {\n return floor(x);\n } else if ((x - base) > 0.5) {\n return ceil(x);\n } else {\n if (mod(base, 2.0) == 0.0) {\n return base;\n } else {\n return base + 1.0;\n }\n }\n`,Xre=xe({opSnippet:jre}),wP={kernelName:Is,backendName:\"webgl\",kernelFunc:Xre};var Yre=\"return inversesqrt(x);\",Qre=xe({opSnippet:Yre,cpuKernelImpl:ZD}),SP={kernelName:Do,backendName:\"webgl\",kernelFunc:Qre};var Tu=class{constructor(e,t,o,n,s,a,i=!0,p=!1){this.variableNames=[\"updates\",\"indices\",\"defaultValue\"],this.outputShape=a;let u=Re(s.length),l=Re(a.length),c=\"\";o===1?c=\"i\":o===2&&(c=\"i, j\");let m=`getIndices(${c})`,d=\"\";n===1?d=\"i\":n===2&&(d=\"i, coords[1]\");let f=`getUpdates(${d})`,h=\"\";p&&(h=\"coords[0], coords[1]\");let g=`getDefaultValue(${h})`,x=t>1?\"strides[j]\":\"strides\";this.userCode=`\n ${u} strides = ${u}(${s});\n\n void main() {\n ${l} coords = getOutputCoords();\n float sum = 0.0;\n bool found = false;\n for (int i = 0; i < ${e}; i++) {\n int flattenedIndex = 0;\n for (int j = 0; j < ${t}; j++) {\n int index = round(${m});\n flattenedIndex += index * ${x};\n }\n if (flattenedIndex == coords[0]) {\n sum += ${f};\n found = true;\n }\n }\n setOutput(mix(${g}, sum, float(found)));\n }\n `}};var Bg=class{constructor(e,t,o,n,s,a,i=!0,p=!1){this.variableNames=[\"updates\",\"indices\",\"defaultValue\"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a;let u=Re(s.length),l=Re(a.length),c=\"\";o===1?c=\"i\":o===2&&(c=\"i, j\");let m=`getIndices(${c})`,d=\"\";n===1?d=\"i\":n===2&&(d=\"i, coords[1]\");let f=`getUpdates(${d})`,h=\"\";p&&(h=\"coords[0], coords[1]\");let g=`getDefaultValue(${h})`,x=t>1?\"strides[j]\":\"strides\",b=t>1?\"strides[j + 1]\":\"strides\";this.userCode=`\n ${u} strides = ${u}(${s});\n\n void main() {\n ${l} coords = getOutputCoords();\n vec4 sum = vec4(0.);\n vec4 found = vec4(0.);\n for (int i = 0; i < ${e}; i+=2) {\n ivec2 flattenedIndex = ivec2(0);\n for (int j = 0; j < ${t}; j+=2) {\n ivec4 index = round(${m});\n flattenedIndex += index.xz * ${x};\n if (j + 1 < ${t}) {\n flattenedIndex += index.yw * ${b};\n }\n }\n if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] ||\n flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) {\n vec4 updVals = ${f};\n if (flattenedIndex[0] == coords[0]) {\n sum.xy += updVals.xy;\n found.xy = vec2(1.);\n } else if (flattenedIndex[0] == coords[0] + 1) {\n sum.zw += updVals.xy;\n found.zw = vec2(1.);\n }\n if (flattenedIndex[1] == coords[0]) {\n sum.xy += updVals.zw;\n found.xy = vec2(1.);\n } else if (flattenedIndex[1] == coords[0] + 1) {\n sum.zw += updVals.zw;\n found.zw = vec2(1.);\n }\n }\n }\n setOutput(mix(${g}, sum, found));\n }\n `}};function Zre(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(s,n,a),m=[c/u,u];if(c===0)return t.makeTensorInfo(a,n.dtype);let d=te({inputs:{x:n},backend:t,attrs:{shape:[p,i]}}),f=te({inputs:{x:s},backend:t,attrs:{shape:[p,u]}}),h=t.makeTensorInfo([],\"float32\",new Float32Array([0])),g;A().getBool(\"WEBGL_PACK\")?g=new Bg(p,i,d.shape.length,f.shape.length,l,m):g=new Tu(p,i,d.shape.length,f.shape.length,l,m);let x=t.runWebGLProgram(g,[f,d,h],f.dtype),b=te({inputs:{x},backend:t,attrs:{shape:a}});return t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(x),t.disposeIntermediateTensorInfo(h),b}var IP={kernelName:vs,backendName:\"webgl\",kernelFunc:Zre};var zg=class{constructor(e,t,o,n){this.variableNames=[\"sortedSequence\",\"values\"],this.customUniforms=[{name:\"numInputs\",type:\"int\"}],this.outputShape=[e,o];let s=\"while (left < right) {\",a=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,i=A().getNumber(\"WEBGL_VERSION\")===2?s:a,p=n===\"left\"?\"<\":\"<=\";this.userCode=`\n int findBound(int batch, float value) {\n int left = 0;\n int right = numInputs;\n int mid;\n ${i}\n mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${p} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int valueIndex = coords[1];\n\n float value = getValues(batch, valueIndex);\n\n setOutput(float(findBound(batch, value)));\n }\n `}};function Jre(r){let{inputs:e,backend:t,attrs:o}=r,{sortedSequence:n,values:s}=e,{side:a}=o,i=new zg(n.shape[0],n.shape[1],s.shape[1],a),p=[[n.shape[1]]];return t.runWebGLProgram(i,[n,s],\"int32\",p)}var vP={kernelName:Ns,backendName:\"webgl\",kernelFunc:Jre};var Vg=class{constructor(e,t,o){this.variableNames=[\"c\",\"a\",\"b\"],this.outputShape=t;let n,s;if(o>4)throw Error(`Where for rank ${o} is not yet supported`);if(o===1)s=\"resRC\",n=\"resRC\";else{let i=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],p=[],u=[];for(let l=0;l= 1.0) {\n setOutput(getA(${s}));\n } else {\n setOutput(getB(${s}));\n }\n }\n `}};function eoe(r){let{inputs:e,backend:t}=r,{condition:o,t:n,e:s}=e,a=new Vg(o.shape.length,n.shape,n.shape.length);return t.runWebGLProgram(a,[o,n,s],pt(n.dtype,s.dtype))}var kP={kernelName:wa,backendName:\"webgl\",kernelFunc:eoe};var toe=`\n // Stable and Attracting Fixed Point (0, 1) for Normalized Weights.\n // see: https://arxiv.org/abs/1706.02515\n float scaleAlpha = ${C.SELU_SCALEALPHA};\n float scale = ${C.SELU_SCALE};\n return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0);\n`,roe=xe({opSnippet:toe}),NP={kernelName:Ts,backendName:\"webgl\",kernelFunc:roe};var ooe=sn+`\n return 1.0 / (1.0 + exp(-1.0 * x));\n`,noe=`\n vec4 result = 1.0 / (1.0 + exp(-1.0 * x));\n bvec4 isNaN = isnan(x);\n\n result.r = isNaN.r ? x.r : result.r;\n result.g = isNaN.g ? x.g : result.g;\n result.b = isNaN.b ? x.b : result.b;\n result.a = isNaN.a ? x.a : result.a;\n\n return result;\n`,soe=xe({opSnippet:ooe,packedOpSnippet:noe,cpuKernelImpl:eA}),TP={kernelName:Ao,backendName:\"webgl\",kernelFunc:soe};var aoe=`\n if (isnan(x)) { return 0.0; }\n return sign(x);\n`,ioe=xe({opSnippet:aoe}),_P={kernelName:Rs,backendName:\"webgl\",kernelFunc:ioe};var uoe=sn+`\n return sin(x);\n`,poe=`\n vec4 result = sin(x);\n bvec4 isNaN = isnan(x);\n ${to}\n return result;\n`,loe=xe({opSnippet:uoe,packedOpSnippet:poe}),EP={kernelName:Es,backendName:\"webgl\",kernelFunc:loe};var coe=`\n float e2x = exp(x);\n return (e2x - 1.0 / e2x) / 2.0;\n`,moe=xe({opSnippet:coe}),$P={kernelName:$s,backendName:\"webgl\",kernelFunc:moe};var doe=`\n float epsilon = 1.1920928955078125e-7;\n float threshold = log(epsilon) + 2.0;\n\n bool too_large = x > -threshold;\n bool too_small = x < threshold;\n\n float result;\n float exp_x = exp(x);\n\n if (too_large){\n result = x;\n }\n else if (too_small){\n result = exp_x;\n }\n else{\n result = log(exp_x + 1.0);\n }\n return result;\n`,foe=xe({opSnippet:doe}),RP={kernelName:Ds,backendName:\"webgl\",kernelFunc:foe};var hoe=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>\"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet\");let i=s.reduce((x,b)=>x*b),p=[[0,0]];p.push(...a);for(let x=1+s.length;xt.disposeIntermediateTensorInfo(x)),g},DP={kernelName:Sa,backendName:\"webgl\",kernelFunc:hoe};function goe(r){let{inputs:e,backend:t}=r,{indices:o,values:n,denseShape:s,defaultValue:a}=e;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw:\n ${s.shape}`);if(o.shape.length!==2)throw new Error(`Indices must be a matrix, saw:\n ${o.shape}`);if(n.shape.length!==1)throw new Error(`Values must be a vector, saw:\n ${n.shape}`);if(a.shape.length!==0)throw new Error(`Default value must be a scalar, saw:\n ${a.shape}`);let i=t.readSync(o.dataId),p=t.readSync(n.dataId),u=t.readSync(s.dataId),l=t.readSync(a.dataId)[0],[c,m,d,f,h]=rA(i,o.shape,o.dtype,p,n.dtype,u,l);return[t.makeTensorInfo(m,o.dtype,c),t.makeTensorInfo([m[0]],n.dtype,d),t.makeTensorInfo([f.length],\"bool\",new Uint8Array(f.map(g=>Number(g)))),t.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var AP={kernelName:eu,backendName:\"webgl\",kernelFunc:goe};function xoe(r){let{inputs:e,backend:t}=r,{inputIndices:o,inputShape:n,newShape:s}=e;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${o.shape}`);if(n.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(t.readSync(n.dataId)),i=t.readSync(o.dataId),p=Array.from(t.readSync(s.dataId)),[u,l,c]=oA(i,o.shape,o.dtype,a,p);return[t.makeTensorInfo(l,o.dtype,u),t.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var FP={kernelName:ui,backendName:\"webgl\",kernelFunc:xoe};function yoe(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);let a=t.readSync(o.dataId),i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,l]=Sh(a,o.shape,o.dtype,i,p,!0);return t.makeTensorInfo(l,o.dtype,u)}var PP={kernelName:va,backendName:\"webgl\",kernelFunc:yoe};function boe(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error(\"Data should be at least 1 dimensional but received scalar\");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape\n ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape\n ${s.shape}`);let a=t.readSync(o.dataId),i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,l]=Sh(a,o.shape,o.dtype,i,p);return t.makeTensorInfo(l,o.dtype,u)}var OP={kernelName:ka,backendName:\"webgl\",kernelFunc:boe};function Coe(r){let{inputs:e,backend:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=C.calculateShapes(s,n,i),d=!1;if(s.dtype===\"string\"){let x=t.bufferSync(n),b=t.bufferSync(s),w=y.decodeString(t.readSync(a.dataId)[0]),S=JD(x,b,i,m,l,u,p,c,w,d);return t.makeTensorInfo(i,S.dtype,S.values)}let f=new Tu(u,p,n.shape.length,s.shape.length,c,[m,1],d),h=t.runWebGLProgram(f,[s,n,a],s.dtype),g=te({inputs:{x:h},backend:t,attrs:{shape:i}});return t.disposeIntermediateTensorInfo(h),g}var MP={kernelName:Ps,backendName:\"webgl\",kernelFunc:Coe};function woe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=n.shape.length,l=new Array(u).fill(0),c=n.shape.slice();return p.map(m=>{let d=[...c];d[i]=m;let f=Js({inputs:{x:n},backend:t,attrs:{begin:l,size:d}});return l[i]+=m,f})}var LP={kernelName:Ia,backendName:\"webgl\",kernelFunc:woe};var BP=\"return sqrt(x);\",Soe=xe({opSnippet:BP,packedOpSnippet:BP,cpuKernelImpl:nA}),zP={kernelName:Fo,backendName:\"webgl\",kernelFunc:Soe};var Ioe=\"return x * x;\",voe=xe({opSnippet:Ioe}),VP={kernelName:tu,backendName:\"webgl\",kernelFunc:voe};var WP=\"return (a - b) * (a - b);\",koe=st({opSnippet:WP,packedOpSnippet:WP}),UP={kernelName:Po,backendName:\"webgl\",kernelFunc:koe};function Noe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e;if(n.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");let s=t.readSync(n.dataId),a=C.fromUint8ToStringArray(s),i=sA(a,\"string\",o);return t.makeTensorInfo(n.shape,\"string\",i)}var GP={kernelName:pi,backendName:\"webgl\",kernelFunc:Noe};function Toe({inputs:r,attrs:e,backend:t}){let{x:o}=r,n=Gt+`\n return x > 0.0 ? 1.0 : float(${e.alpha});\n `,s=new nr(o.shape,n);return t.runWebGLProgram(s,[o],o.dtype)}var HP={kernelName:Ko,backendName:\"webgl\",kernelFunc:Toe};var Wg=class{constructor(e,t,o){this.variableNames=[\"x\"],this.outputShape=o;let n=o.length,s=Re(o.length),a=Re(o.length),i=\"\";if(n===1)i=\"coords * strides + begin\";else{let p=0;i=o.map((u,l)=>(p++,o.length===1?`coords * strides[${l}] + begin[${l}]`:`coords[${p-1}] * strides[${l}] + begin[${l}]`)).join(\",\")}this.userCode=`\n ${s} begin = ${s}(${e});\n ${s} strides = ${s}(${t});\n\n void main() {\n ${a} coords = getOutputCoords();\n setOutput(getX(${i}));\n }\n `}};function _oe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=te({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let E=nt.computeOutShape(b,w,S),R=Js({inputs:{x:n},backend:t,attrs:{begin:b,size:E}});k=te({inputs:{x:R},backend:t,attrs:{shape:f}}),t.disposeIntermediateTensorInfo(R)}else if(t.shouldExecuteOnCPU([n])){let R=t.readSync(n.dataId),D=ie(n.shape,n.dtype,R),F=aA(d,D,S,b);k=t.makeTensorInfo(f,n.dtype,F.values)}else{let R=new Wg(b,S,d);k=t.runWebGLProgram(R,[n],n.dtype)}let T=te({inputs:{x:k},backend:t,attrs:{shape:f}});return t.disposeIntermediateTensorInfo(k),T}var KP={kernelName:Os,backendName:\"webgl\",kernelFunc:_oe};function Eoe(r){let{inputs:e,backend:t,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:l,dataSplits:c}=e,m=t.readSync(l.dataId),d=t.readSync(c.dataId),[f,h]=iA(m,d,n,s,a,i,p,u);return[t.makeTensorInfo([f.length],\"string\",f),t.makeTensorInfo(c.shape,\"int32\",h)]}var qP={kernelName:Na,backendName:\"webgl\",kernelFunc:Eoe};function $oe(r){let{inputs:e,backend:t,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=e;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=t.readSync(s.dataId),p=t.readSync(a.dataId)[0],[u,l,c]=uA(i,p,n),m=l.length;return[t.makeTensorInfo([m,2],\"int32\",u),t.makeTensorInfo([m],\"string\",l),t.makeTensorInfo([2],\"int32\",new Int32Array(c))]}var jP={kernelName:ru,backendName:\"webgl\",kernelFunc:$oe};function Roe(r){let{inputs:e,backend:t,attrs:o}=r,{numBuckets:n}=o,{input:s}=e;if(s.dtype!==\"string\")throw new Error(\"Input must be of datatype string\");if(n<=0)throw new Error(\"Number of buckets must be at least 1\");let a=t.readSync(s.dataId),i=pA(a,n);return t.makeTensorInfo(s.shape,\"int32\",i)}var XP={kernelName:ou,backendName:\"webgl\",kernelFunc:Roe};var Doe=\"return tan(x);\",Aoe=xe({opSnippet:Doe}),YP={kernelName:Ms,backendName:\"webgl\",kernelFunc:Aoe};var Foe=`\n float e2x = exp(-2.0 * abs(x));\n return sign(x) * (1.0 - e2x) / (1.0 + e2x);\n`,Poe=xe({opSnippet:Foe}),QP={kernelName:Ls,backendName:\"webgl\",kernelFunc:Poe};function Ooe(r){let{inputs:e,backend:t,attrs:o}=r,{tensor:n,indices:s,updates:a}=e,{}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(a,s,n.shape),m=[c/u,u];if(c===0)return t.makeTensorInfo(n.shape,s.dtype);let d=te({inputs:{x:s},backend:t,attrs:{shape:[p,i]}}),f=te({inputs:{x:a},backend:t,attrs:{shape:[p,u]}}),h=te({inputs:{x:n},backend:t,attrs:{shape:m}}),g=new Tu(p,i,d.shape.length,f.shape.length,l,m,!1,!0),x=t.runWebGLProgram(g,[f,d,h],h.dtype),b=te({inputs:{x},backend:t,attrs:{shape:n.shape}});return t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(x),b}var ZP={kernelName:ks,backendName:\"webgl\",kernelFunc:Ooe};var Ug=class{constructor(e,t){this.variableNames=[\"A\"];let o=new Array(e.length);for(let a=0;a5)throw Error(`Tile for rank ${e} is not yet supported`);if(e===1)return`imod(resRC, ${r[0]})`;let t=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\",\"resRC.u\"],o=[];for(let n=0;n5){let p=t.readSync(n.dataId),u=n.dtype===\"string\"?p.map(m=>y.decodeString(m)):p,l=ie(n.shape,n.dtype,u),c=cA(l,s);return t.makeTensorInfo(c.shape,c.dtype,c.values)}let a=new Ug(n.shape,s);return t.runWebGLProgram(a,[n],n.dtype)}var JP={kernelName:Mo,backendName:\"webgl\",kernelFunc:q0};var Gg=class{constructor(e){this.variableNames=[\"x\",\"indices\"],this.customUniforms=[{name:\"n\",type:\"int\"},{name:\"firstPass\",type:\"int\"},{name:\"negativeInf\",type:\"float\"},{name:\"dir\",type:\"int\"},{name:\"inc\",type:\"int\"}],this.outputShape=e,this.userCode=`\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced above,\n // Figure5(a) shows that element[1] is in the\n // second half of the group when group size is 2, but it is in the\n // first half of the group when group size is 4.\n\n bool isFirstInPair = imod(elemIdx, 2 * inc) < inc;\n int i = isFirstInPair ? elemIdx : elemIdx - inc;\n\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc));\n float x0 = i0 < n ? getX(batch, i0) : negativeInf;\n float x1 = i1 < n ? getX(batch, i1) : negativeInf;\n\n // Denotes which direction indices are in (ascending or descending).\n bool reverse = imod(elemIdx, 2 * dir) >= dir;\n bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) { // Elements in opposite order of direction\n int iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutput(float(i0));\n } else {\n setOutput(float(i1));\n }\n }\n `}},Hg=class{constructor(e){this.variableNames=[\"x\",\"indices\"],this.customUniforms=[{name:\"n\",type:\"int\"},{name:\"firstPass\",type:\"int\"},{name:\"k\",type:\"int\"}],this.outputShape=e,this.userCode=`\n void main() {\n // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ...\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int elemIdx = coords[1];\n\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4),\n // we only need to output the indices at positions |, the indices at\n // positions _ can be thrown away, see Figure5(b) After Phase 2\n // (Merge phase) in the Bitonic Top K paper referenced above.\n // For example, the paper shows we only need to output the orange bars.\n // The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back\n // to the previous sequence to find the corresponding value,\n // we need to double the index. When we double the index,\n // we basically interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position\n // of each 2k positions by - elemIdx % k. E.g. for output at\n // index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n int i = elemIdx < k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k));\n int i0 = firstPass == 1 ? i : int(getIndices(batch, i));\n int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k));\n\n float x0 = getX(batch, i0);\n float x1 = i1 < n ? getX(batch, i1) : x0;\n\n setOutput(x0 >= x1 ? float(i0) : float(i1));\n }\n `}};function Rp(r,e){e!==null&&r.disposeIntermediateTensorInfo(e)}function eO(r){let e=1;for(;ep){let F=t.readSync(n.dataId),[O,M]=mA(F,u,n.dtype,s,a);return[t.makeTensorInfo(O.shape,O.dtype,O.values),t.makeTensorInfo(M.shape,M.dtype,M.values)]}if(s===0)return u[u.length-1]=0,[t.makeTensorInfo(u,n.dtype,[]),t.makeTensorInfo(u,\"int32\",[])];if(l===1)return[n,Ei({attrs:{shape:u,dtype:\"int32\",value:0},backend:t})];let c=t.texData.get(n.dataId),m=c!==null&&c.isPacked,d=m?t.unpackTensor(n):n,h=y.sizeFromShape(u)/l,g=te({inputs:{x:d},attrs:{shape:[h,l]},backend:t});m&&Rp(t,d);let x=eO(s),b=eO(l),w=null,S=()=>w===null?[g,g]:[g,w],k=(F,O,M)=>{let L=S(),B=new Gg(M),U=[[l],[w===null?1:0],[Number.NEGATIVE_INFINITY],[F],[O]],j=w;w=t.runWebGLProgram(B,L,\"int32\",U),Rp(t,j)};for(let F=1;F=1;M/=2)k(O,M,[h,b])}for(let F=b;F>x;F/=2){let O=S(),M=new Hg([h,F/2]),B=[[l],[w===null?1:0],[x]],z=w;w=t.runWebGLProgram(M,O,\"int32\",B),Rp(t,z);let U=x/2,j=U*2;for(let q=U;q>=1;q/=2)k(j,q,w.shape)}let T=w;w=Js({inputs:{x:w},backend:t,attrs:{begin:0,size:[h,s]}}),Rp(t,T);let E=z0({inputs:{x:g,indices:w},backend:t,attrs:{axis:1,batchDims:1}});Rp(t,g);let R=u.slice(0,-1);R.push(s),T=w,w=te({inputs:{x:w},attrs:{shape:R},backend:t}),Rp(t,T);let D=E;return E=te({inputs:{x:E},attrs:{shape:R},backend:t}),Rp(t,D),[E,w]}var tO={kernelName:Bs,backendName:\"webgl\",kernelFunc:Loe};var Kg=class{constructor(e,t,o,n,s,a){this.variableNames=[\"Image\",\"Transforms\"],this.outputShape=a;let i=o===\"nearest\"?1:2,p;switch(n){case\"constant\":p=1;break;case\"reflect\":p=2;break;case\"wrap\":p=3;break;case\"nearest\":p=4;break;default:p=1;break}this.userCode=`\n float mapCoord(float outCoord, float len) {\n float inCoord = outCoord;\n if(${p} == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * float(int(float(-inCoord / sz2))) +\n inCoord;\n }\n inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0;\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz2 = 2.0 * len;\n inCoord -= sz2 * float(int(float(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${p} == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord += len * (float(int(float(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n float sz = len - 1.0;\n inCoord -= len * float(int(float(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (${p} == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n } else {\n return outCoord;\n }\n }\n\n float readWithFillValue(int batch, int coordY, int coordX,\n int channel) {\n float outputValue;\n if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = float(${s});\n }\n return outputValue;\n }\n\n void main() {\n ivec4 coords = getOutputCoords();\n float outputValue;\n int batch = coords[0];\n int x = coords[2];\n int y = coords[1];\n int channel = coords[3];\n float xf = float(x);\n float yf = float(y);\n float a1 = getTransforms(batch, 0);\n float a2 = getTransforms(batch, 1);\n float a3 = getTransforms(batch, 2);\n float b1 = getTransforms(batch, 3);\n float b2 = getTransforms(batch, 4);\n float b3 = getTransforms(batch, 5);\n float c1 = getTransforms(batch, 6);\n float c2 = getTransforms(batch, 7);\n float projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = float(${s});\n } else {\n float inX = (a1 * xf + a2 * yf + a3) / projection;\n float inY = (b1 * xf + b2 * yf + b3) / projection;\n float mapX = mapCoord(inX, float(${t}));\n float mapY = mapCoord(inY, float(${e}));\n\n if (${i} == 1) {\n int coordY = int(round(mapY));\n int coordX = int(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n float yFloor = floor(mapY);\n float xFloor = floor(mapX);\n float yCeil = yFloor + 1.0;\n float xCeil = xFloor + 1.0;\n float valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, int(yFloor), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yFloor), int(xCeil), channel);\n float valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, int(yCeil), int(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, int(yCeil), int(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutput(outputValue);\n }\n `}};function Boe(r){let{inputs:e,backend:t,attrs:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=new Kg(c,m,a,i,p,g);return t.runWebGLProgram(x,[n,s],\"float32\")}var rO={kernelName:zs,backendName:\"webgl\",kernelFunc:Boe};function zoe(r){let{inputs:e,attrs:t,backend:o}=r,{axis:n}=t,{x:s}=e;Ys(s,\"unique\"),console.warn(\"WARNING: \",\"UI might be locked temporarily as data is being downloaded\");let a=o.readSync(s.dataId),{outputValues:i,outputShape:p,indices:u}=dA(a,n,s.shape,s.dtype);return[o.makeTensorInfo(p,s.dtype,i),o.makeTensorInfo([u.length],\"int32\",u)]}var oO={kernelName:nu,backendName:\"webgl\",kernelFunc:zoe};function Voe(r){let{inputs:e,backend:t,attrs:o}=r,{value:n}=e,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),l=0;for(let h=0;ht.disposeIntermediateTensorInfo(h)),f}var nO={kernelName:Ta,backendName:\"webgl\",kernelFunc:Voe};var qg=class{constructor(e,t){this.variableNames=[\"x\",\"segmentIds\"];let o=e.windowSize,n=e.batchSize,s=e.inSize,a=e.numSegments,i=a*Math.ceil(s/o);this.outputShape=[n,i];let p=\"0.0\",u=\"sumValue\",l=Math.floor(o/4)*4,c=o%4,m=`\n sumValue += dot(values, segFilter);\n `,d=\"\";s%o>0&&(d=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return initializationValue;\n }\n `);let f=\"\";s%o>0&&(f=`\n if (inIdx < 0 || inIdx >= ${s}) {\n return -1.0;\n }\n `),this.userCode=`\n const float initializationValue = ${p};\n\n float getValue(int batch, int inIdx) {\n ${d}\n return getX(batch, inIdx);\n }\n\n float getSegmentIdAtIndex(int inIdx) {\n ${f}\n return getSegmentIds(inIdx);\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int batch = coords[0];\n int outIdx = coords[1];\n int inOffset = int(floor(float(outIdx) / float(\n ${a})) * float(${o}));\n int currentSeg = int(mod(float(outIdx), float(${a})));\n\n float sumValue = 0.0;\n\n for (int i = 0; i < ${l}; i += 4) {\n int inIdx = inOffset + i;\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n getValue(batch, inIdx + 3)\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0\n );\n\n ${m}\n }\n\n int inIdx = inOffset + ${l};\n if (${c===1}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n initializationValue,\n initializationValue,\n initializationValue\n );\n\n int inIdxSeg = int(getSegmentIdAtIndex(inIdx));\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n 0,\n 0,\n 0\n );\n\n ${m}\n } else if (${c===2}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n initializationValue,\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n 0,\n 0\n );\n\n ${m}\n } else if (${c===3}) {\n vec4 values = vec4(\n getValue(batch, inIdx),\n getValue(batch, inIdx + 1),\n getValue(batch, inIdx + 2),\n initializationValue\n );\n\n vec4 segFilter = vec4(\n int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0,\n int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0,\n 0\n );\n\n ${m}\n }\n setOutput(${u});\n }\n `}};function Woe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,segmentIds:s}=e,{numSegments:a}=o,i=n.shape.length,p=[],u=0,l=C.getAxesPermutation([u],i),c=n;l!=null&&(c=Ct({inputs:{x:n},backend:t,attrs:{perm:l}}),p.push(c),u=C.getInnerMostAxes(1,i)[0]);let m=C.segment_util.computeOutShape(c.shape,u,a),d=y.sizeFromShape([c.shape[u]]),f=te({inputs:{x:c},backend:t,attrs:{shape:[-1,d]}});p.push(f);let h=mi(n.dtype),g=(S,k,T,E,R)=>{let D=S.shape[0],F=S.shape[1],O=C.segment_util.segOpComputeOptimalWindowSize(F,R),M={windowSize:O,inSize:F,batchSize:D,numSegments:R},L=new qg(M,k),B=t.compileAndRun(L,[S,T],E);if(p.push(B),B.shape[1]===R)return B;let z=K0({backend:t,attrs:{start:0,stop:R,step:1,dtype:\"float32\"}}),U=q0({inputs:{x:z},backend:t,attrs:{reps:[F/O]}});return p.push(z),p.push(U),g(B,k,U,E,R)},x=g(f,\"unsortedSegmentSum\",s,h,a),b=te({inputs:{x},backend:t,attrs:{shape:m}}),w=b;if(l!=null){p.push(b);let S=C.getUndoAxesPermutation(l);w=Ct({inputs:{x:w},backend:t,attrs:{perm:S}})}return p.forEach(S=>t.disposeIntermediateTensorInfo(S)),w}var sO={kernelName:su,backendName:\"webgl\",kernelFunc:Woe};var Uoe=[VA,UA,GA,HA,qA,jA,XA,YA,JA,eF,tF,rF,oF,nF,sF,aF,iF,uF,pF,lF,cF,dF,fF,hF,gF,CF,SF,IF,RA,kF,TF,_F,EF,$F,RF,DF,AF,FF,PF,OF,BF,zF,VF,WF,UF,GF,HF,KF,qF,jF,XF,YF,QF,ZF,JF,e3,r3,o3,n3,s3,i3,u3,p3,l3,c3,m3,d3,f3,h3,$A,g3,NF,x3,y3,b3,DA,C3,w3,S3,I3,v3,k3,N3,T3,_3,E3,R3,D3,A3,F3,P3,O3,L3,z3,V3,W3,U3,G3,X3,PA,Y3,Q3,Z3,J3,xF,eP,oP,nP,sP,aP,AA,iP,uP,pP,lP,cP,yF,H3,mP,dP,fP,MA,hP,gP,xP,yP,bP,CP,wP,SP,IP,vP,kP,NP,TP,_P,EP,$P,mF,j3,RP,DP,AP,FP,PP,OP,MP,LP,zP,VP,UP,GP,HP,KP,qP,jP,XP,q3,BA,YP,QP,ZP,JP,tO,rO,zA,oO,nO,sO,tP];for(let r of Uoe)li(r);var we;(function(r){r[r.float32=0]=\"float32\",r[r.int32=1]=\"int32\",r[r.bool=2]=\"bool\",r[r.string=3]=\"string\",r[r.complex64=4]=\"complex64\"})(we||(we={}));var _u;(function(r){r[r.linear=0]=\"linear\",r[r.relu=1]=\"relu\",r[r.relu6=2]=\"relu6\",r[r.prelu=3]=\"prelu\",r[r.leakyrelu=4]=\"leakyrelu\",r[r.sigmoid=5]=\"sigmoid\",r[r.elu=6]=\"elu\"})(_u||(_u={}));var aO;function Goe(r){aO=r.wasm.cwrap(qo,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Hoe(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=e;if(n.dtype!==\"float32\"||s.dtype!==\"float32\")throw new Error(\"_FusedMatMul for non non-float32 tensors not yet supported.\");let{transposeA:p,transposeB:u,activation:l,leakyreluAlpha:c}=o,m=t.dataIdMap.get(n.dataId).id,d=t.dataIdMap.get(s.dataId).id,f=0;if(a!=null){let R=t.dataIdMap.get(a.dataId);if(R.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${R.shape.length}.`);f=R.id}let h=i==null?0:t.dataIdMap.get(i.dataId).id,g=_u[l];if(g==null)throw new Error(`${l} activation not yet supported for FusedConv2D in the wasm backend.`);let x=p?n.shape[2]:n.shape[1],b=u?s.shape[1]:s.shape[2],w=kr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)),S=t.makeOutput([...w,x,b],n.dtype),k=t.dataIdMap.get(S.dataId).id,T=new Uint8Array(new Int32Array(n.shape).buffer),E=new Uint8Array(new Int32Array(s.shape).buffer);return aO(m,T,n.shape.length,d,E,s.shape.length,p,u,g,f,h,c||0,k),S}var iO={kernelName:qo,backendName:\"wasm\",setupFunc:Goe,kernelFunc:Hoe};function he(r,e){let t;function o(s){t=s.wasm.cwrap(r,null,[\"number\",\"number\",\"number\"])}function n(s){let{backend:a,inputs:{x:i}}=s,p=a.dataIdMap.get(i.dataId).id,u=a.makeOutput(i.shape,e||i.dtype),l=a.dataIdMap.get(u.dataId).id;return y.sizeFromShape(u.shape)===0||t(p,we[i.dtype],l),u}return{kernelName:r,backendName:\"wasm\",setupFunc:o,kernelFunc:n}}var uO=he(fn);var pO=he(hn);var lO=he(gn);function He(r,e,t){let o;function n(a){o=a.wasm.cwrap(r,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\"])}function s(a){let{backend:i,inputs:p}=a,{a:u,b:l}=p,c=i.dataIdMap.get(u.dataId).id,m=i.dataIdMap.get(l.dataId).id,d=t!=null?t:u.dtype,f=C.assertAndGetBroadcastShape(u.shape,l.shape),h=i.makeOutput(f,d);if(y.sizeFromShape(f)===0)return h;let g=new Uint8Array(new Int32Array(u.shape).buffer),x=new Uint8Array(new Int32Array(l.shape).buffer),b=i.dataIdMap.get(h.dataId).id;return o(c,g,u.shape.length,m,x,l.shape.length,we[u.dtype],b),h}return{kernelName:r,backendName:\"wasm\",setupFunc:n,kernelFunc:s}}var Koe=!0,cO=He(Rr,Koe);var mO;function qoe(r){mO=r.wasm.cwrap(xn,null,[\"array\",\"number\",\"number\",\"number\"])}function joe(r){let{inputs:e,backend:t}=r,o=t.makeOutput(e[0].shape,e[0].dtype);if(y.sizeFromShape(o.shape)===0)return o;let n=e.map(i=>t.dataIdMap.get(i.dataId).id),s=new Uint8Array(new Int32Array(n).buffer),a=t.dataIdMap.get(o.dataId).id;return mO(s,n.length,we[o.dtype],a),o}var dO={kernelName:xn,backendName:\"wasm\",setupFunc:qoe,kernelFunc:joe};function Dp(r){let{inputs:{x:e},backend:t}=r;if(e.dtype===\"string\")return pr(t.readSync(e.dataId),e.shape,e.dtype);let o=t.makeOutput(e.shape,e.dtype),n=t.typedArrayFromHeap(e);return t.typedArrayFromHeap(o).set(n),o}var fO={kernelName:vo,backendName:\"wasm\",kernelFunc:Dp};var hO;function Xoe(r){hO=r.wasm.cwrap(Kr,null,[\"number\",\"array\",\"number\",\"number\",\"number\",\"array\",\"number\"])}function Vo(r){let{inputs:e,backend:t,attrs:o}=r,[n,s]=Qoe(e.x.shape,o.perm),a=!0;for(let f=0;f=n&&(s===-1||o[s]>o[a])&&(s=a);o[s]=n}return[t,o]}var gO={kernelName:Kr,backendName:\"wasm\",kernelFunc:Vo,setupFunc:Xoe};function $r(r,e,t){let o=r.shape,n=r.shape.length,s=y.parseAxisParam(e,o),a=s,i=C.getAxesPermutation(a,n),p=null,u=!1;if(i!=null){let l=new Array(n);for(let d=0;d`new shape: ${a}, old shape: ${o.shape}. New shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var OO={kernelName:Ca,backendName:\"wasm\",kernelFunc:Wt};var MO;function lne(r){MO=r.wasm.cwrap(Nn,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\",\"number\"])}function cne(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;if(n.dtype!==\"float32\"||s.dtype!==\"float32\")throw new Error(\"BatchMatMul for non non-float32 tensors not yet supported.\");let p=n.shape.length,u=s.shape.length,l=a?n.shape[p-2]:n.shape[p-1],c=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),w=kr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(l===c,()=>`Error in matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,l,m]:[g,m,l],k=i?[x,d,c]:[x,c,d],T=Wt({inputs:{x:n},backend:t,attrs:{shape:S}}),E=Wt({inputs:{x:s},backend:t,attrs:{shape:k}}),R=t.dataIdMap.get(T.dataId).id,D=t.dataIdMap.get(E.dataId).id,F=a?T.shape[2]:T.shape[1],O=i?E.shape[1]:E.shape[2],M=Math.max(g,x),L=t.makeOutput([M,F,O],T.dtype),B=t.dataIdMap.get(L.dataId).id,z=new Uint8Array(new Int32Array(T.shape).buffer),U=new Uint8Array(new Int32Array(E.shape).buffer);return MO(R,z,T.shape.length,D,U,E.shape.length,a,i,B),t.disposeData(T.dataId),t.disposeData(E.dataId),L.shape=w,L}var LO={kernelName:Nn,backendName:\"wasm\",setupFunc:lne,kernelFunc:cne};function an(r){let{inputs:{x:e},attrs:{begin:t,size:o},backend:n}=r,[s,a]=nt.parseSliceParams(e,t,o),i=nt.isSliceContinous(e.shape,s,a),p=n.readSync(e.dataId),u=n.makeOutput(a,e.dtype),l=y.computeStrides(e.shape),c=n.dataIdMap.get(u.dataId);if(i){let f=nt.computeFlatOffset(s,l);return e.dtype===\"string\"?c.stringBytes=p.slice(f,f+y.sizeFromShape(a)):n.typedArrayFromHeap(u).set(p.subarray(f,f+y.sizeFromShape(a))),u}if(e.dtype===\"string\"){let f=hp(p,s,a,e.shape,e.dtype);return c.stringBytes=f,u}let m=n.typedArrayFromHeap(u),d=e.shape.length;if(d===2)mne(p,l[0],m,s,a);else if(d===3)dne(p,l[0],l[1],m,s,a);else if(d===4)fne(p,l[0],l[1],l[2],m,s,a);else{let f=hp(p,s,a,e.shape,e.dtype);m.set(f)}return u}function mne(r,e,t,o,n){let s=0,a=o[0],i=o[1],p=a+n[0];for(let u=a;ux*b),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=Wt({inputs:{x:n},backend:t,attrs:{shape:p}}),f=Vo({inputs:{x:d},backend:t,attrs:{perm:u}}),h=Wt({inputs:{x:f},backend:t,attrs:{shape:l}}),g=an({inputs:{x:h},backend:t,attrs:{begin:c,size:m}});return t.disposeData(d.dataId),t.disposeData(f.dataId),t.disposeData(h.dataId),g}var zO={kernelName:ia,backendName:\"wasm\",kernelFunc:hne};var VO;function gne(r){VO=r.wasm.cwrap(Tn,null,[\"number\",\"number\",\"boolean\",\"number\",\"number\",\"number\"])}function xne(r){let{backend:e,inputs:t,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=s.shape.reduce((c,m)=>c*m,1)!==0,p=n.shape.length===1?[a]:[n.shape[0],a],u=e.makeOutput(p,s.dtype);function l(c){return e.dataIdMap.get(c.dataId).id}return VO(l(n),a,i,l(s),we[s.dtype],l(u)),u}var WO={kernelName:Tn,backendName:\"wasm\",setupFunc:gne,kernelFunc:xne};var yne=!0,UO=He(_n,yne);function bne(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e,s=t.typedArrayFromHeap(o),a=t.typedArrayFromHeap(n),i=C.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return t.makeOutput([i.length],\"int32\",void 0,new Int32Array(i))}var GO={kernelName:ua,backendName:\"wasm\",kernelFunc:bne};function Vr(r){let{inputs:{x:e},attrs:{dtype:t},backend:o}=r,n=o.makeOutput(e.shape,t),s=o.typedArrayFromHeap(e);return o.typedArrayFromHeap(n).set(s),n}var HO={kernelName:ho,backendName:\"wasm\",kernelFunc:Vr};var KO=he(go);var qO;function Cne(r){qO=r.wasm.cwrap(Go,null,[\"number\",\"number\",\"number\",\"number\"])}function wne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{clipValueMin:s,clipValueMax:a}=o,i=t.dataIdMap.get(n.dataId).id,p=t.makeOutput(n.shape,n.dtype),u=t.dataIdMap.get(p.dataId).id;return qO(i,s,a,u),p}var jO={kernelName:Go,backendName:\"wasm\",setupFunc:Cne,kernelFunc:wne};function j0(r){let{inputs:e,backend:t}=r,o=y.parseAxisParam(r.attrs.axis,e[0].shape)[0],n=e.map(d=>d.shape);C.assertParamsConsistent(n,o);let s=C.computeOutShape(e.map(d=>d.shape),o),a=e.filter(d=>y.sizeFromShape(d.shape)>0);if(a.length===1)return Dp({inputs:{x:a[0]},backend:t});let i=t.makeOutput(s,e[0].dtype);if(y.sizeFromShape(s)===0)return i;if(a[0].dtype===\"string\"){let d=a.map(w=>{let k=[-1,y.sizeFromShape(w.shape.slice(o))];return Wt({inputs:{x:w},backend:t,attrs:{shape:k}})}),f=d.map(w=>({vals:t.readSync(w.dataId),shape:w.shape}));s=C.computeOutShape(d.map(w=>w.shape),1);let h=d[0].shape[0]===1,g=mp(f,s,e[0].dtype,h),x=C.computeOutShape(a.map(w=>w.shape),o);i.shape=x;let b=t.dataIdMap.get(i.dataId);return b.stringBytes=C.fromStringArrayToUint8(g),d.forEach(w=>t.disposeData(w.dataId)),i}let p=y.sizeFromShape(a[0].shape.slice(0,o)),u=0,l=a.map(d=>{let f=y.sizeFromShape(d.shape.slice(o));return u+=f,f}),c=a.map(d=>t.typedArrayFromHeap(d)),m=t.typedArrayFromHeap(i);for(let d=0;d`cumprod does not support ${n.dtype} tensors in the WASM backend`);let u=C.getAxesPermutation([s],p),l=n;u!==null&&(l=Vo({inputs:{x:n},attrs:{perm:u},backend:t}));let c=C.getInnerMostAxes(1,p)[0];C.assertAxesAreInnerMostDims(\"cumprod\",[c],p);let m=t.makeOutput(l.shape,l.dtype),d=l.shape[c],f=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(m.dataId).id;lM(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=C.getUndoAxesPermutation(u);g=Vo({inputs:{x:m},attrs:{perm:x},backend:t}),t.disposeData(l.dataId),t.disposeData(m.dataId)}return g}var cM={kernelName:Pn,backendName:\"wasm\",setupFunc:Fne,kernelFunc:Pne};var mM;function One(r){mM=r.wasm.cwrap(On,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Mne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o,p=n.shape.length;y.assert(n.dtype===\"float32\"||n.dtype===\"int32\",()=>`cumsum does not support ${n.dtype} tensors in the WASM backend`);let u=C.getAxesPermutation([s],p),l=n;u!==null&&(l=Vo({inputs:{x:n},attrs:{perm:u},backend:t}));let c=C.getInnerMostAxes(1,p)[0];C.assertAxesAreInnerMostDims(\"cumsum\",[c],p);let m=t.makeOutput(l.shape,l.dtype),d=l.shape[c],f=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(m.dataId).id;mM(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=C.getUndoAxesPermutation(u);g=Vo({inputs:{x:m},attrs:{perm:x},backend:t}),t.disposeData(l.dataId),t.disposeData(m.dataId)}return g}var dM={kernelName:On,backendName:\"wasm\",setupFunc:One,kernelFunc:Mne};var fM;function Lne(r){fM=r.wasm.cwrap(\"DenseBincount\",null,[\"number\",\"array\",\"number\",\"number\",\"boolean\",\"number\",\"number\",\"boolean\",\"number\"])}function Bne(r){let{backend:e,inputs:t,attrs:o}=r,{x:n,weights:s}=t,{size:a,binaryOutput:i}=o,p=s.shape.reduce((m,d)=>m*d,1)!==0,u=n.shape.length===1?[a]:[n.shape[0],a],l=e.makeOutput(u,s.dtype);function c(m){return e.dataIdMap.get(m.dataId).id}return fM(c(n),new Uint8Array(new Int32Array(n.shape).buffer),n.shape.length,a,p,c(s),we[s.dtype],i,c(l)),l}var hM={kernelName:la,backendName:\"wasm\",setupFunc:Lne,kernelFunc:Bne};var gM;function zne(r){gM=r.wasm.cwrap(Ln,null,[\"number\",\"number\",\"number\",\"array\",\"number\",\"array\",\"array\",\"number\",\"number\"])}function Vne(r){let{backend:e,inputs:t,attrs:o}=r,{x:n}=t,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a===\"NHWC\"?n.shape[1]:n.shape[2],u=a===\"NHWC\"?n.shape[2]:n.shape[3],l=a===\"NHWC\"?n.shape[3]:n.shape[1],c=p*s,m=u*s,d=l/(s*s),f=a===\"NHWC\"?[i,c,m,d]:[i,d,c,m],h=e.makeOutput(f,\"float32\"),x=e.dataIdMap.get(n.dataId).id,b=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),w=new Uint8Array(new Int32Array(f).buffer),S=new Uint8Array(new Int32Array(y.computeStrides(f)).buffer),k=e.dataIdMap.get(h.dataId).id;return gM(x,s,a===\"NHWC\"?1:0,b,n.shape.length-1,w,S,f.length,k),h}var xM={kernelName:Ln,backendName:\"wasm\",setupFunc:zne,kernelFunc:Vne};var yM;function Wne(r){yM=r.wasm.cwrap(Bn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Une(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s}=e,a=o.dataIdMap.get(n.dataId).id,i=o.dataIdMap.get(s.dataId).id,{strides:p,dilations:u,pad:l,dimRoundingMode:c}=t,m=u==null?[1,1]:u,d=C.computeConv2DInfo(n.shape,s.shape,p,m,l,c,!0),f=d.filterHeight,h=d.filterWidth,g=d.padInfo.top,x=d.padInfo.right,b=d.padInfo.bottom,w=d.padInfo.left,S=d.dilationHeight,k=d.dilationWidth,T=d.strideHeight,E=d.strideWidth,R=d.inChannels,D=d.outChannels,F=d.padInfo.type===\"SAME\"?1:0;if(d.dataFormat!==\"channelsLast\")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`);let O=o.makeOutput(d.outShape,\"float32\"),M=o.dataIdMap.get(O.dataId).id;return yM(a,n.shape[0],n.shape[1],n.shape[2],i,f,h,g,x,b,w,F,S,k,T,E,R,D,M),O}var bM={kernelName:Bn,backendName:\"wasm\",setupFunc:Wne,kernelFunc:Une};var CM;function Gne(r){CM=r.wasm.cwrap(\"Diag\",null,[\"number\",\"number\",\"number\",\"number\"])}function Hne(r){let{inputs:e,backend:t}=r,{x:o}=e,n=y.sizeFromShape(o.shape),s=t.makeOutput([...o.shape,...o.shape],o.dtype);return CM(t.dataIdMap.get(o.dataId).id,we[o.dtype],n,t.dataIdMap.get(s.dataId).id),s}var wM={kernelName:ca,backendName:\"wasm\",setupFunc:Gne,kernelFunc:Hne};var SM;function Kne(r){SM=r.wasm.cwrap(zn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function qne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o;if(n.dtype!==s.dtype)throw new Error(`Dilation2D error: x must have the same dtype as filter. Got ${n.dtype} and ${s.dtype}`);let u=C.computeDilation2DInfo(n.shape,s.shape,a,i,\"NHWC\",p),l=t.makeOutput(u.outShape,n.dtype);return SM(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(l.dataId).id,we[n.dtype],u.batchSize,u.inChannels,u.inHeight,u.inWidth,u.outHeight,u.outWidth,u.strideHeight,u.strideWidth,u.dilationHeight,u.dilationWidth,u.filterHeight,u.filterWidth,u.padInfo.top,u.padInfo.left),l}var IM={kernelName:zn,backendName:\"wasm\",setupFunc:Kne,kernelFunc:qne};var vM;function jne(r){vM=r.wasm.cwrap(qi,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Xne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropFilter error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let l=C.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),c=t.makeOutput(s.shape,s.dtype);return vM(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(a.dataId).id,t.dataIdMap.get(c.dataId).id,we[n.dtype],l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.filterHeight,l.filterWidth,l.padInfo.top,l.padInfo.left),c}var kM={kernelName:qi,backendName:\"wasm\",setupFunc:jne,kernelFunc:Xne};var NM;function Yne(r){NM=r.wasm.cwrap(Ki,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Qne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropInput error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let l=C.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),c=t.makeOutput(n.shape,n.dtype);return NM(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(a.dataId).id,t.dataIdMap.get(c.dataId).id,we[n.dtype],l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.filterHeight,l.filterWidth,l.padInfo.top,l.padInfo.left),c}var TM={kernelName:Ki,backendName:\"wasm\",setupFunc:Yne,kernelFunc:Qne};var _M=he(Wn);var EM;function Zne(r){EM=r.wasm.cwrap(ri,null,[\"number\",\"number\",\"number\"])}function Jne(r){let{inputs:e,backend:t}=r,{dy:o,y:n}=e,s=t.makeOutput(n.shape,\"float32\"),a=i=>t.dataIdMap.get(i.dataId).id;return EM(a(n),a(o),a(s)),s}var $M={kernelName:ri,backendName:\"wasm\",setupFunc:Zne,kernelFunc:Jne};var ese=!1,RM=He(xo,ese,\"bool\");var DM=he(Un);var AM=he(yo,\"float32\");function Xg(r){let{inputs:e,attrs:t,backend:o}=r,{input:n}=e,{dim:s}=t,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),Wt({inputs:{x:n},backend:o,attrs:{shape:i}})}var FM={kernelName:ma,backendName:\"wasm\",kernelFunc:Xg};var PM=he(bo,\"float32\");function Y0(r){let{attrs:{shape:e,value:t},backend:o}=r,{attrs:{dtype:n}}=r;n=n||y.inferDtype(t);let s=o.makeOutput(e,n);return o.typedArrayFromHeap(s).fill(t),s}var OM={kernelName:da,backendName:\"wasm\",kernelFunc:Y0};var MM;function tse(r){MM=r.wasm.cwrap(Gn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function rse(r){let{inputs:e,backend:t}=r,{image:o}=e,n=t.makeOutput(o.shape,o.dtype),s=t.dataIdMap.get(o.dataId).id,a=t.dataIdMap.get(n.dataId).id,[i,p,u,l]=o.shape;return MM(s,i,p,u,l,a),n}var LM={kernelName:Gn,backendName:\"wasm\",kernelFunc:rse,setupFunc:tse};var BM=he(Co);var ose=!1,zM=He(wo,ose);var VM;function nse(r){VM=r.wasm.cwrap(Hn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function sse(r){let{backend:e,inputs:t,attrs:o}=r,{varianceEpsilon:n}=o,{x:s,mean:a,variance:i,offset:p,scale:u}=t,l=e.dataIdMap.get(s.dataId).id,c=e.dataIdMap.get(a.dataId).id,m=e.dataIdMap.get(i.dataId).id,d=p!=null?e.dataIdMap.get(p.dataId).id:0,f=u!=null?e.dataIdMap.get(u.dataId).id:0,h=e.makeOutput(s.shape,s.dtype);if(y.sizeFromShape(s.shape)===0)return h;let g=e.dataIdMap.get(h.dataId).id;return VM(l,c,m,d,f,n,g),h}var WM={kernelName:Hn,backendName:\"wasm\",setupFunc:nse,kernelFunc:sse};var UM;function ase(r){UM=r.wasm.cwrap(jo,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 ise(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dataFormat:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=t,h=C.computeConv2DInfo(n.shape,s.shape,p,l,u,m),g=_u[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,w=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==w)throw new Error(`FusedConv2D bias shape (${ee.shape}) does not match the number of output channels (${w})`);S=ee.id}let k=h.filterHeight,T=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,F=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type===\"SAME\"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(c!==\"NHWC\")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,\"float32\"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return UM(x,j,q,Y,b,k,T,S,E,R,D,F,U,O,M,L,B,z,w,g,ne,f||0,re),J}var GM={kernelName:jo,backendName:\"wasm\",setupFunc:ase,kernelFunc:ise};var HM;function use(r){HM=r.wasm.cwrap(Xo,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 pse(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dataFormat:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=t,h=C.computeConv2DInfo(n.shape,s.shape,p,l,u,m,!0),g=_u[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,w=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==w)throw new Error(`FusedDepthwiseConv2D bias shape (${ee.shape}) does not match the number of output channels (${w})`);S=ee.id}let k=h.filterHeight,T=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,F=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type===\"SAME\"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(c!==\"NHWC\")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,\"float32\"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return HM(x,j,q,Y,b,k,T,S,E,R,D,F,U,O,M,L,B,z,w,g,ne,f||0,re),J}var KM={kernelName:Xo,backendName:\"wasm\",setupFunc:use,kernelFunc:pse};var qM;function lse(r){qM=r.wasm.cwrap(Kn,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\"])}function cse(r){let{backend:e,inputs:t}=r,{params:o,indices:n}=t,[s,a,i,p]=xf.prepareAndValidate(o,n),u=e.makeOutput(s,o.dtype);if(a===0)return u;let l=n.shape,c=l[l.length-1],d=e.dataIdMap.get(o.dataId).id,h=e.dataIdMap.get(n.dataId).id,g=new Uint8Array(new Int32Array(p).buffer),x=e.dataIdMap.get(u.dataId).id;return qM(d,we[o.dtype],h,a,c,i,g,x),u}var jM={kernelName:Kn,backendName:\"wasm\",setupFunc:lse,kernelFunc:cse};var XM;function mse(r){XM=r.wasm.cwrap(\"Gather\",null,[\"number\",\"number\",\"array\",\"number\",\"number\",\"number\",\"array\",\"number\"])}function dse(r){let{backend:e,inputs:t,attrs:o}=r,{x:n,indices:s}=t,{axis:a,batchDims:i}=o,p=y.parseAxisParam(a,n.shape)[0],u=e.readSync(s.dataId),l=n.shape[p];for(let D=0;D=0,()=>`GatherV2: the index value ${F} is not in [0, ${l-1}]`)}let c=C.segment_util.collectGatherOpShapeInfo(n,s,p,i),m=Wt({inputs:{x:n},attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]},backend:e}),d=y.sizeFromShape(s.shape),f=Wt({inputs:{x:s},attrs:{shape:[c.batchSize,d/c.batchSize]},backend:e}),h=[c.batchSize,c.outerSize,d/c.batchSize,c.sliceSize],g=e.makeOutput(h,n.dtype);if(y.sizeFromShape(n.shape)===0)return g;let x=m.shape.length-1,w=e.dataIdMap.get(m.dataId).id,k=e.dataIdMap.get(f.dataId).id,T=e.dataIdMap.get(g.dataId).id,E=new Uint8Array(new Int32Array(y.computeStrides(m.shape)).buffer),R=new Uint8Array(new Int32Array(y.computeStrides(h)).buffer);return XM(w,we[n.dtype],E,x,k,c.batchSize,R,T),e.disposeData(m.dataId),e.disposeData(f.dataId),g.shape=c.outputShape,g}var YM={kernelName:fa,backendName:\"wasm\",setupFunc:mse,kernelFunc:dse};var fse=!1,QM=He(So,fse,\"bool\");var hse=!1,ZM=He(Io,hse,\"bool\");var JM=he(qn,\"bool\");var eL=he(jn,\"bool\");var tL=he(Xn,\"bool\");var rL;function gse(r){rL=r.wasm.cwrap(Yn,null,[\"number\",\"number\",\"number\",\"number\"])}function xse(r){let{inputs:{x:e},attrs:{alpha:t},backend:o}=r,n=o.dataIdMap.get(e.dataId).id,s=o.makeOutput(e.shape,\"float32\");if(y.sizeFromShape(e.shape)!==0){let a=o.dataIdMap.get(s.dataId).id;rL(n,we[e.dtype],t,a)}return s}var oL={kernelName:Yn,backendName:\"wasm\",setupFunc:gse,kernelFunc:xse};var yse=!1,nL=He(ko,yse,\"bool\");var bse=!1,sL=He(No,bse,\"bool\");var aL;function Cse(r){aL=r.wasm.cwrap(Qn,null,[\"number\",\"number\",\"number\",\"number\"])}function wse(r){let{attrs:e,backend:t}=r,{start:o,stop:n,num:s}=e,a=Math.floor(s),i=t.makeOutput([a],\"float32\");return aL(t.dataIdMap.get(i.dataId).id,o,n,a),i}var iL={kernelName:Qn,backendName:\"wasm\",setupFunc:Cse,kernelFunc:wse};var uL=he(To);var pL=he(Zn);var Sse=!1,lL=He(Jn,Sse,\"bool\");var cL=he(es);var Ise=!1,mL=He(ts,Ise,\"bool\");var vse=!1,dL=He(gk,vse,\"bool\");var fL;function kse(r){fL=r.wasm.cwrap(rs,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Nse(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o;if(n.dtype!==\"float32\")throw new Error(\"LRN error: x must have dtype float32\");let u=t.makeOutput(n.shape,n.dtype);return fL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(u.dataId).id,n.shape[3],s,a,i,p),u}var hL={kernelName:rs,backendName:\"wasm\",setupFunc:kse,kernelFunc:Nse};var gL;function Tse(r){gL=r.wasm.cwrap(oi,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function _se(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,y:s,dy:a}=e,{depthRadius:i,bias:p,alpha:u,beta:l}=o;if(n.dtype!==\"float32\"||s.dtype!==\"float32\"||a.dtype!==\"float32\")throw new Error(\"LRNGrad error: x, y, and dy must have dtype float32\");let c=t.makeOutput(n.shape,n.dtype);return gL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(a.dataId).id,t.dataIdMap.get(c.dataId).id,a.shape[3],i,p,u,l),c}var xL={kernelName:oi,backendName:\"wasm\",setupFunc:Tse,kernelFunc:_se};var yL;function Ese(r){yL=r.wasm.cwrap(os,null,[\"number\",\"number\",\"number\",\"number\"])}function $se(r){let{backend:e,inputs:t,attrs:o}=r,{reductionIndices:n,keepDims:s}=o,{x:a}=t,p=e.dataIdMap.get(a.dataId).id,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e);if(d){let w=e.dataIdMap.get(l.dataId).id;u=l,p=w}let f=u.shape.length;C.assertAxesAreInnerMostDims(\"max\",c,f);let[h,g]=C.computeOutAndReduceShapes(u.shape,c),x=y.sizeFromShape(g),b=e.makeOutput(h,a.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;yL(p,we[a.dtype],x,w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var bL={kernelName:os,backendName:\"wasm\",setupFunc:Ese,kernelFunc:$se};var Rse=!1,CL=He(_o,Rse);var wL;function Dse(r){wL=r.wasm.cwrap(ns,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Ase(r){let{inputs:e,attrs:t,backend:o}=r,n=e.x,s=o.dataIdMap.get(n.dataId).id;y.assert(n.dtype===\"float32\",()=>`Error in MaxPool: only float32 input is supported. Got ${n.dtype}.`);let{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=t,l=C.computePool2DInfo(n.shape,a,i,1,p,u),c=l.filterHeight,m=l.filterWidth,d=l.padInfo.top,f=l.padInfo.right,h=l.padInfo.bottom,g=l.padInfo.left,x=l.dilationHeight,b=l.dilationWidth,w=l.strideHeight,S=l.strideWidth,k=l.inChannels,T=l.outChannels;if(l.dataFormat!==\"channelsLast\")throw new Error(`wasm backend does not support dataFormat:'${l.dataFormat}'. Please use 'channelsLast'.`);let E=o.makeOutput(l.outShape,\"float32\"),R=o.dataIdMap.get(E.dataId).id;return wL(s,n.shape[0],n.shape[1],n.shape[2],c,m,d,f,h,g,x,b,w,S,k,T,R),E}var SL={kernelName:ns,backendName:\"wasm\",setupFunc:Dse,kernelFunc:Ase};var IL;function Fse(r){IL=r.wasm.cwrap(\"MaxPool3D\",null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Pse(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,l=C.computePool3DInfo(n.shape,s,a,1,i,p,u),c=t.makeOutput(l.outShape,n.dtype);return IL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,l.batchSize,l.inChannels,l.inDepth,l.inHeight,l.inWidth,l.outDepth,l.outHeight,l.outWidth,l.strideDepth,l.strideHeight,l.strideWidth,l.dilationDepth,l.dilationHeight,l.dilationWidth,l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.front,l.padInfo.top,l.padInfo.left),c}var vL={kernelName:ha,backendName:\"wasm\",setupFunc:Fse,kernelFunc:Pse};var kL;function Ose(r){kL=r.wasm.cwrap(\"MaxPool3DGrad\",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 Mse(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,l=C.computePool3DInfo(s.shape,a,i,1,p,u),c=t.makeOutput(s.shape,s.dtype);return kL(t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,l.batchSize,l.inChannels,l.inDepth,l.inHeight,l.inWidth,l.outDepth,l.outHeight,l.outWidth,l.strideDepth,l.strideHeight,l.strideWidth,l.dilationDepth,l.dilationHeight,l.dilationWidth,l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.front,l.padInfo.top,l.padInfo.left),c}var NL={kernelName:Ji,backendName:\"wasm\",setupFunc:Ose,kernelFunc:Mse};var TL;function Lse(r){TL=r.wasm.cwrap(\"MaxPoolGrad\",null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Bse(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,l=C.computePool2DInfo(s.shape,a,i,1,p,u),c=t.makeOutput(s.shape,s.dtype);return TL(t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.top,l.padInfo.left),c}var _L={kernelName:Zi,backendName:\"wasm\",setupFunc:Lse,kernelFunc:Bse};var EL;function zse(r){EL=r.wasm.cwrap(\"MaxPoolWithArgmax\",null,[\"number\",\"number\",\"number\",\"number\",\"boolean\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Vse(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,includeBatchInIndex:p}=o;y.assert(n.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`);let u=[1,1];y.assert(C.eitherStridesOrDilationsAreOne(a,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,[1,1],i),c=t.makeOutput(l.outShape,n.dtype),m=t.makeOutput(l.outShape,\"int32\");return EL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,t.dataIdMap.get(m.dataId).id,we[n.dtype],p,l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.top,l.padInfo.left),[c,m]}var $L={kernelName:ga,backendName:\"wasm\",setupFunc:zse,kernelFunc:Vse};var RL;function Wse(r){RL=r.wasm.cwrap(ss,null,[\"number, number, number\"])}function Use(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e),f=c;if(d){let S=e.dataIdMap.get(l.dataId).id;S!==i&&(u=l,p=S,f=C.getInnerMostAxes(f.length,u.shape.length))}C.assertAxesAreInnerMostDims(\"mean\",f,u.shape.length);let[h,g]=C.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=u;u.dtype!==\"float32\"&&(b=Vr({backend:e,inputs:{x:u},attrs:{dtype:\"float32\"}}),p=e.dataIdMap.get(b.dataId).id);let w=e.makeOutput(h,\"float32\");if(y.sizeFromShape(u.shape)!==0){let S=e.dataIdMap.get(w.dataId).id;RL(p,x,S)}if(d&&e.disposeData(l.dataId),s){let S=C.expandShapeToKeepDim(w.shape,m);w.shape=S}return u.dtype!==\"float32\"&&e.disposeData(b.dataId),w}var DL={kernelName:ss,backendName:\"wasm\",setupFunc:Wse,kernelFunc:Use};var AL;function Gse(r){AL=r.wasm.cwrap(as,null,[\"number\",\"number\",\"number\",\"number\"])}function Hse(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e);if(d){let w=e.dataIdMap.get(l.dataId).id;w!==i&&(u=l,p=w)}let f=u.shape.length;C.assertAxesAreInnerMostDims(\"min\",c,f);let[h,g]=C.computeOutAndReduceShapes(u.shape,c),x=y.sizeFromShape(g),b=e.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;AL(p,we[a.dtype],x,w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var FL={kernelName:as,backendName:\"wasm\",setupFunc:Gse,kernelFunc:Hse};var Kse=!1,PL=He(Eo,Kse);var Q0;(function(r){r[r.reflect=0]=\"reflect\",r[r.symmetric=1]=\"symmetric\"})(Q0||(Q0={}));var OL;function qse(r){OL=r.wasm.cwrap(is,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"array\",\"number\",\"number\"])}function jse(r){let{inputs:{x:e},backend:t,attrs:{paddings:o,mode:n}}=r,s=o.map((f,h)=>f[0]+e.shape[h]+f[1]),a=t.dataIdMap.get(e.dataId).id,i=t.makeOutput(s,e.dtype),p=t.dataIdMap.get(i.dataId).id,u=new Uint8Array(new Int32Array(e.shape).buffer),l=o.map(f=>f[0]),c=o.map(f=>f[1]),m=new Uint8Array(new Int32Array(l).buffer),d=new Uint8Array(new Int32Array(c).buffer);return OL(a,u,e.shape.length,we[e.dtype],m,d,Q0[n],p),i}var ML={kernelName:is,backendName:\"wasm\",kernelFunc:jse,setupFunc:qse};var LL;function Xse(r){LL=r.wasm.cwrap(Fs,null,[\"number\",\"number\",\"number\",\"number\"])}function Z0(r){let{backend:e,inputs:{logits:t},attrs:{dim:o}}=r,n=e.dataIdMap.get(t.dataId).id,s=e.makeOutput(t.shape,t.dtype),a=e.dataIdMap.get(s.dataId).id,i=t.shape[o],p=y.sizeFromShape(t.shape)/i;return y.sizeFromShape(s.shape)===0||LL(n,a,i,p),s}var BL={kernelName:Fs,backendName:\"wasm\",setupFunc:Xse,kernelFunc:Z0};var zL;function Yse(r){zL=r.wasm.cwrap(ps,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Qse(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o;if(n.dtype!==\"float32\")throw new Error(`Tensor logits must have dtype float32, got ${n.dtype}`);let p=i?n:Z0({inputs:{logits:n},backend:t,attrs:{dim:n.shape.length-1}}),[u,l]=p.shape,c=t.makeOutput([u,s],\"int32\");return zL(t.dataIdMap.get(p.dataId).id,u,l,s,a,t.dataIdMap.get(c.dataId).id),i||t.disposeData(p.dataId),c}var VL={kernelName:ps,backendName:\"wasm\",setupFunc:Yse,kernelFunc:Qse};var WL=He(us,!0);var Zse=!0,UL=He($o,Zse);var GL=he(ls);function Zl(r,e){let t=new Int32Array(r.wasm.HEAPU8.buffer,e,4),o=t[0],n=t[1],s=t[2],a=t[3];return r.wasm._free(e),{pSelectedIndices:o,selectedSize:n,pSelectedScores:s,pValidOutputs:a}}var HL;function Jse(r){HL=r.wasm.cwrap(cs,\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\"])}function eae(r){let{backend:e,inputs:t,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a}=o,{boxes:i,scores:p}=t,u=e.dataIdMap.get(i.dataId).id,l=e.dataIdMap.get(p.dataId).id,c=HL(u,l,s,n,a),{pSelectedIndices:m,selectedSize:d,pSelectedScores:f,pValidOutputs:h}=Zl(e,c);return e.wasm._free(f),e.wasm._free(h),e.makeOutput([d],\"int32\",m)}var KL={kernelName:cs,backendName:\"wasm\",setupFunc:Jse,kernelFunc:eae};var qL;function tae(r){qL=r.wasm.cwrap(ni,\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\",\"bool\"])}function rae(r){let{backend:e,inputs:t,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,padToMaxOutputSize:i}=o,{boxes:p,scores:u}=t,l=e.dataIdMap.get(p.dataId).id,c=e.dataIdMap.get(u.dataId).id,m=qL(l,c,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Zl(e,m);e.wasm._free(h);let x=e.makeOutput([f],\"int32\",d),b=e.makeOutput([],\"int32\",g);return[x,b]}var jL={kernelName:ni,backendName:\"wasm\",setupFunc:tae,kernelFunc:rae};var XL;function oae(r){XL=r.wasm.cwrap(ms,\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function nae(r){let{backend:e,inputs:t,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,softNmsSigma:i}=o,{boxes:p,scores:u}=t,l=e.dataIdMap.get(p.dataId).id,c=e.dataIdMap.get(u.dataId).id,m=XL(l,c,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Zl(e,m);e.wasm._free(g);let x=e.makeOutput([f],\"int32\",d),b=e.makeOutput([f],\"float32\",h);return[x,b]}var YL={kernelName:ms,backendName:\"wasm\",setupFunc:oae,kernelFunc:nae};var sae=!1,QL=He(Ro,sae,\"bool\");var ZL;function aae(r){ZL=r.wasm.cwrap(ds,null,[\"number\",\"number\",\"number\",\"number\",\"number\"])}function iae(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n}=e,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=t.makeOutput([...n.shape,a],s),l=t.dataIdMap.get(u.dataId).id,m=t.dataIdMap.get(n.dataId).id;return ZL(m,a,i,p,l),u}var JL={kernelName:ds,backendName:\"wasm\",setupFunc:aae,kernelFunc:iae};function uae(r){let{inputs:{x:e},backend:t}=r,o=t.makeOutput(e.shape,e.dtype);return t.typedArrayFromHeap(o).fill(1),o}var eB={kernelName:xa,backendName:\"wasm\",kernelFunc:uae};function pae(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o;if(e.length===1)return Xg({inputs:{input:e[0]},backend:t,attrs:{dim:n}});let s=e[0].shape,a=e[0].dtype;e.forEach(l=>{y.assertShapesMatch(s,l.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===l.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=e.map(l=>{let c=Xg({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=j0({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeData(l.dataId)),u}var tB={kernelName:ya,backendName:\"wasm\",kernelFunc:pae};var rB;function lae(r){rB=r.wasm.cwrap(fs,null,[\"number\",\"array\",\"number\",\"number\",\"array\",\"array\",\"number\",\"number\"])}function cae(r){let{inputs:{x:e},backend:t,attrs:{paddings:o,constantValue:n}}=r,s=o.map((h,g)=>h[0]+e.shape[g]+h[1]);if(y.sizeFromShape(e.shape)===0)return Y0({backend:t,attrs:{shape:s,value:n,dtype:e.dtype}});let a=t.dataIdMap.get(e.dataId).id,i=t.makeOutput(s,e.dtype),u=t.dataIdMap.get(i.dataId).id,l=new Uint8Array(new Int32Array(e.shape).buffer),c=o.map(h=>h[0]),m=o.map(h=>h[1]),d=new Uint8Array(new Int32Array(c).buffer),f=new Uint8Array(new Int32Array(m).buffer);return rB(a,l,e.shape.length,we[e.dtype],d,f,n,u),i}var Yg={kernelName:fs,backendName:\"wasm\",kernelFunc:cae,setupFunc:lae};var mae=!1,oB=He(hs,mae);var nB;function dae(r){nB=r.wasm.cwrap(gs,null,[\"number\",\"number\",\"number\"])}function fae(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e,s=t.dataIdMap.get(o.dataId).id,a=t.dataIdMap.get(n.dataId).id,i=s,p=o,u=p;p.dtype!==\"float32\"&&(u=Vr({backend:t,inputs:{x:o},attrs:{dtype:\"float32\"}}),i=t.dataIdMap.get(u.dataId).id);let l=t.makeOutput(o.shape,\"float32\"),c=t.dataIdMap.get(l.dataId).id;return nB(i,a,c),p.dtype!==\"float32\"&&t.disposeData(u.dataId),l}var sB={kernelName:gs,backendName:\"wasm\",setupFunc:dae,kernelFunc:fae};var aB;function hae(r){aB=r.wasm.cwrap(Ho,null,[\"number\",\"number\",\"number\",\"number\"])}function gae(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e),f=c;if(d){let w=e.dataIdMap.get(l.dataId).id;w!==i&&(u=l,p=w,f=C.getInnerMostAxes(f.length,u.shape.length))}C.assertAxesAreInnerMostDims(\"prod\",f,u.shape.length);let[h,g]=C.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=e.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;aB(p,x,we[b.dtype],w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var iB={kernelName:Ho,backendName:\"wasm\",setupFunc:hae,kernelFunc:gae};var xae=r=>{let{backend:e,attrs:t}=r,{start:o,stop:n,step:s,dtype:a}=t,i=fp(o,n,s,a),p=e.makeOutput([i.length],a);return e.typedArrayFromHeap(p).set(i),p},uB={kernelName:ba,backendName:\"wasm\",kernelFunc:xae};var yae=!0,pB=He(Vn,yae);var lB=he(xs);var cB=he(ys);var mB=he(ws);var dB;function bae(r){dB=r.wasm.cwrap(Cs,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function Cae(r){let{backend:e,inputs:t,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[l,c,m,d]=n.shape,f=[l,p,u,d],h=e.dataIdMap.get(n.dataId),g;h.dtype!==\"float32\"&&(g=Vr({backend:e,inputs:{x:n},attrs:{dtype:\"float32\"}}),h=e.dataIdMap.get(g.dataId));let x=h.id,b=e.makeOutput(f,\"float32\");if(y.sizeFromShape(n.shape)===0)return b;let w=e.dataIdMap.get(b.dataId).id;return dB(x,l,c,m,d,p,u,s?1:0,a?1:0,w),g!=null&&e.disposeData(g.dataId),b}var fB={kernelName:Cs,backendName:\"wasm\",setupFunc:bae,kernelFunc:Cae};var hB;function wae(r){hB=r.wasm.cwrap(ii,null,[\"number\",\"number\",\"number\",\"array\",\"array\",\"boolean\"])}function Sae(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=t.makeOutput(n.shape,\"float32\"),p=t.dataIdMap.get(n.dataId),u;return p.dtype!==\"float32\"&&(u=Vr({backend:t,inputs:{x:n},attrs:{dtype:\"float32\"}}),p=t.dataIdMap.get(u.dataId)),hB(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&t.disposeData(u.dataId),i}var gB={kernelName:ii,backendName:\"wasm\",setupFunc:wae,kernelFunc:Sae};var xB;function Iae(r){xB=r.wasm.cwrap(bs,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function vae(r){let{backend:e,inputs:t,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[l,c,m,d]=n.shape,f=[l,p,u,d],h=e.makeOutput(f,\"float32\");if(y.sizeFromShape(n.shape)===0)return h;let g=e.dataIdMap.get(n.dataId),x;g.dtype!==\"float32\"&&(x=Vr({backend:e,inputs:{x:n},attrs:{dtype:\"float32\"}}),g=e.dataIdMap.get(x.dataId));let b=g.id,w=e.dataIdMap.get(h.dataId).id;return xB(b,l,c,m,d,p,u,s?1:0,a?1:0,w),x!=null&&e.disposeData(x.dataId),h}var yB={kernelName:bs,backendName:\"wasm\",setupFunc:Iae,kernelFunc:vae};var bB;function kae(r){bB=r.wasm.cwrap(ai,null,[\"number\",\"number\",\"number\",\"array\",\"array\",\"boolean\"])}function Nae(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=t.makeOutput(n.shape,\"float32\"),p=t.dataIdMap.get(n.dataId),u;return p.dtype!==\"float32\"&&(u=Vr({backend:t,inputs:{x:n},attrs:{dtype:\"float32\"}}),p=t.dataIdMap.get(u.dataId)),bB(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&t.disposeData(u.dataId),i}var CB={kernelName:ai,backendName:\"wasm\",setupFunc:kae,kernelFunc:Nae};var wB;function Tae(r){wB=r.wasm.cwrap(Ss,null,[\"number\",\"array\",\"number\",\"array\",\"number\",\"number\"])}function _ae(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o,a=y.parseAxisParam(s,n.shape);if(n.shape.length===0)return Dp({inputs:{x:n},backend:t});let i=t.makeOutput(n.shape,n.dtype),p=t.dataIdMap.get(n.dataId).id,u=t.dataIdMap.get(i.dataId).id,l=new Uint8Array(new Int32Array(a).buffer),c=new Uint8Array(new Int32Array(n.shape).buffer);wB(p,l,a.length,c,n.shape.length,u);let m=Wt({inputs:{x:i},attrs:{shape:n.shape},backend:t});return t.disposeData(i.dataId),m}var SB={kernelName:Ss,backendName:\"wasm\",kernelFunc:_ae,setupFunc:Tae};var IB;function Eae(r){IB=r.wasm.cwrap(Vs,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\"])}function $ae(r){let{inputs:e,backend:t,attrs:o}=r,{image:n}=e,{radians:s,fillValue:a,center:i}=o,p=t.makeOutput(n.shape,n.dtype),u=t.dataIdMap.get(n.dataId).id,l=t.dataIdMap.get(p.dataId).id,[c,m,d,f]=n.shape,[h,g]=C.getImageCenter(i,m,d),x=a===0,b=255,w=typeof a==\"number\"?[a,a,a,x?0:b]:[...a,b],S=new Uint8Array(new Int32Array(w).buffer);return IB(u,c,m,d,f,s,h,g,S,w.length,l),p}var vB={kernelName:Vs,backendName:\"wasm\",kernelFunc:$ae,setupFunc:Eae};var kB=he(Is);var NB=he(Do);var TB;function Rae(r){TB=r.wasm.cwrap(vs,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\"])}function Dae(r){let{backend:e,inputs:t,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,i=e.makeOutput(a,s.dtype);if(y.sizeFromShape(a)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=Cu.calculateShapes(s,n,a),f=e.dataIdMap.get(n.dataId).id,g=e.dataIdMap.get(s.dataId).id,x=new Uint8Array(new Int32Array(c).buffer),b=e.dataIdMap.get(i.dataId).id;return TB(f,g,we[s.dtype],p,u,l,x,m,b),i}var _B={kernelName:vs,backendName:\"wasm\",setupFunc:Rae,kernelFunc:Dae};var EB;function Aae(r){EB=r.wasm.cwrap(Ns,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"bool\",\"number\"])}function Fae(r){let{inputs:e,backend:t,attrs:o}=r,{sortedSequence:n,values:s}=e,{side:a}=o;if(n.dtype!==s.dtype)throw new Error(`SearchSorted error: sorted_sequence must have the same dtype as values. Got ${n.dtype} and ${s.dtype}`);let i=t.makeOutput(s.shape,\"int32\");function p(u){return t.dataIdMap.get(u.dataId).id}return EB(p(n),p(s),n.shape[0],n.shape[1],s.shape[1],we[n.dtype],a===\"left\",p(i)),i}var $B={kernelName:Ns,backendName:\"wasm\",setupFunc:Aae,kernelFunc:Fae};var RB;function Pae(r){RB=r.wasm.cwrap(\"SelectV2\",null,[\"number\",\"number\",\"number\",\"number\",\"number\"])}function Oae(r){let{inputs:e,backend:t}=r,{condition:o,t:n,e:s}=e,a=t.dataIdMap.get(o.dataId).id,i=t.dataIdMap.get(n.dataId).id,p=t.dataIdMap.get(s.dataId).id,u=t.makeOutput(n.shape,n.dtype),l=t.dataIdMap.get(u.dataId).id,c=o.shape.length,m=n.shape.length,d=c===0||c>1||m===1?1:y.sizeFromShape(n.shape.slice(1));return RB(a,i,p,d,l),u}var DB={kernelName:wa,backendName:\"wasm\",kernelFunc:Oae,setupFunc:Pae};var AB=he(Ts);var FB;function Mae(r){FB=r.wasm.cwrap(Ao,null,[\"number\",\"number\"])}function Lae(r){let{backend:e,inputs:{x:t}}=r,o=e.dataIdMap.get(t.dataId).id,n=e.makeOutput(t.shape,t.dtype),s=e.dataIdMap.get(n.dataId).id;return y.sizeFromShape(n.shape)===0||FB(o,s),n}var PB={kernelName:\"Sigmoid\",backendName:\"wasm\",setupFunc:Mae,kernelFunc:Lae};var OB=he(Rs);var MB=he(Es);var LB=he($s);var BB=he(Ds);function Bae(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,paddings:a}=o,i=y.sizeFromShape(s),p=[[0,0]];p.push(...a);for(let T=1+s.length;T0?p+1:0;if(l<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let c=n.shape.slice();c[0]=l;let m=t.dataIdMap.get(n.dataId).id,d=t.dataIdMap.get(s.dataId).id,f=t.dataIdMap.get(a.dataId).id,h=t.makeOutput(c,n.dtype),g=t.dataIdMap.get(h.dataId).id,x=t.makeOutput([4],\"int32\"),b=t.dataIdMap.get(x.dataId).id;HB(m,we[n.dtype],n.shape[0],d,f,g,b,e,0);let w=t.readSync(x.dataId),S;switch(w[0]){case 0:{S=C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage();break}case 1:{S=C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage();break}case 2:S=C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(w[1],w[2]);break;case 3:S=C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(w[1],w[2],w[3]);break;default:S=\"\"}if(t.disposeData(x.dataId),S)throw t.disposeData(h.dataId),new Error(S);return h}function Gae(r){return Zg(r,!0)}var KB={kernelName:va,backendName:\"wasm\",setupFunc:Qg,kernelFunc:Gae};function Hae(r){return Zg(r,!1)}var qB={kernelName:ka,backendName:\"wasm\",setupFunc:Qg,kernelFunc:Hae};var jB;function Kae(r){jB=r.wasm.cwrap(Ps,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\"])}function qae(r){let{backend:e,inputs:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,p=e.makeOutput(i,a.dtype);if(y.sizeFromShape(i)===0)return p;let{sliceRank:u,numUpdates:l,sliceSize:c,strides:m,outputSize:d}=C.calculateShapes(s,n,i),f=e.dataIdMap.get(n.dataId).id,h=e.dataIdMap.get(s.dataId).id,g=e.dataIdMap.get(a.dataId).id,x=new Uint8Array(new Int32Array(m).buffer),b=e.dataIdMap.get(p.dataId).id;return jB(f,h,s.shape.length,g,we[a.dtype],u,l,c,x,d,b),p}var XB={kernelName:Ps,backendName:\"wasm\",setupFunc:Kae,kernelFunc:qae};function jae(r){let{inputs:e,attrs:t,backend:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=t,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),l=n.shape.slice();return p.map(c=>{let m=[...l];m[i]=c;let d=an({inputs:{x:n},attrs:{begin:u,size:m},backend:o});return u[i]+=c,d})}var YB={kernelName:Ia,backendName:\"wasm\",kernelFunc:jae};var QB=he(Fo);var ZB=he(tu);var Xae=!0,JB=He(Po,Xae);var ez;function Yae(r){ez=r.wasm.cwrap(Ko,null,[\"number\",\"number\",\"number\",\"number\"])}function Qae(r){let{backend:e,inputs:t,attrs:o}=r,{alpha:n}=o,{x:s}=t,a=e.dataIdMap.get(s.dataId).id,i=e.makeOutput(s.shape,s.dtype),p=e.dataIdMap.get(i.dataId).id;return ez(a,n,we[s.dtype],p),i}var tz={kernelName:Ko,backendName:\"wasm\",setupFunc:Yae,kernelFunc:Qae};var rz;function Zae(r){rz=r.wasm.cwrap(Os,null,[\"number\",\"array\",\"number\",\"array\",\"array\",\"array\",\"array\",\"array\",\"number\",\"number\"])}function Jae(r){let{backend:e,inputs:t,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=Wt({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let T=nt.computeOutShape(b,w,S),E=an({inputs:{x:n},backend:e,attrs:{begin:b,size:T}});k=Wt({inputs:{x:E},backend:e,attrs:{shape:f}}),e.disposeData(E.dataId)}else{let T=e.makeOutput(d,\"float32\"),E=e.dataIdMap.get(n.dataId).id,R=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),D=new Uint8Array(new Int32Array(b).buffer),F=new Uint8Array(new Int32Array(w).buffer),O=new Uint8Array(new Int32Array(S).buffer),M=new Uint8Array(new Int32Array(d).buffer),L=new Uint8Array(new Int32Array(y.computeStrides(d)).buffer),B=e.dataIdMap.get(T.dataId).id;rz(E,R,n.shape.length,D,F,O,M,L,d.length,B),k=Wt({inputs:{x:T},backend:e,attrs:{shape:f}}),e.disposeData(T.dataId)}return k}var oz={kernelName:Os,backendName:\"wasm\",setupFunc:Zae,kernelFunc:Jae};function eie(r){let{backend:e,inputs:t,attrs:o}=r,{data:n,dataSplits:s}=t,{separator:a,nGramWidths:i,leftPad:p,rightPad:u,padWidth:l,preserveShortSequences:c}=o,m=e.readSync(n.dataId),d=e.readSync(s.dataId),[f,h]=gp(m,d,a,i,p,u,l,c),g=e.makeOutput([f.length],\"string\"),x=e.dataIdMap.get(g.dataId);x.stringBytes=f;let b=e.makeOutput(s.shape,\"int32\");return e.typedArrayFromHeap(b).set(h),[g,b]}var nz={kernelName:Na,backendName:\"wasm\",kernelFunc:eie};function tie(r){let{backend:e,inputs:t,attrs:o}=r,{input:n,delimiter:s}=t,{skipEmpty:a}=o,i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,l,c]=xp(i,p[0],a),m=l.length,d=e.makeOutput([m,2],\"int32\");e.typedArrayFromHeap(d).set(u);let h=e.makeOutput([m],\"string\"),g=e.dataIdMap.get(h.dataId);g.stringBytes=l;let x=e.makeOutput([2],\"int32\");return e.typedArrayFromHeap(x).set(c),[d,h,x]}var sz={kernelName:ru,backendName:\"wasm\",kernelFunc:tie};function rie(r){let{backend:e,inputs:t,attrs:o}=r,{input:n}=t,{numBuckets:s}=o,a=e.readSync(n.dataId),i=yp(a,s),p=e.makeOutput(n.shape,\"int32\");return e.typedArrayFromHeap(p).set(i),p}var az={kernelName:ou,backendName:\"wasm\",kernelFunc:rie};var oie=!0,iz=He(Oo,oie);var uz;function nie(r){uz=r.wasm.cwrap(As,null,[\"number\",\"number\",\"number\",\"number\"])}function sie(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e),f=c;if(d){let w=e.dataIdMap.get(l.dataId).id;w!==i&&(u=l,p=w,f=C.getInnerMostAxes(f.length,u.shape.length))}C.assertAxesAreInnerMostDims(\"sum\",f,u.shape.length);let[h,g]=C.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=e.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;uz(p,x,we[b.dtype],w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var pz={kernelName:As,backendName:\"wasm\",setupFunc:nie,kernelFunc:sie};var lz=he(Ms);var cz=he(Ls);var mz;function aie(r){mz=r.wasm.cwrap(ks,null,[\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"number\",\"number\"])}function iie(r){let{backend:e,inputs:t,attrs:o}=r,{tensor:n,indices:s,updates:a}=t,{}=o,i=e.makeOutput(n.shape,n.dtype);if(y.sizeFromShape(n.shape)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=Cu.calculateShapes(a,s,n.shape),f=e.dataIdMap.get(s.dataId).id,g=e.dataIdMap.get(a.dataId).id,b=e.dataIdMap.get(n.dataId).id,w=new Uint8Array(new Int32Array(c).buffer),S=e.dataIdMap.get(i.dataId).id;return mz(f,g,we[a.dtype],p,u,l,w,m,S,b),i}var dz={kernelName:ks,backendName:\"wasm\",setupFunc:aie,kernelFunc:iie};var fz;function uie(r){fz=r.wasm.cwrap(Mo,null,[\"number\",\"array\",\"number\",\"array\",\"number\",\"number\"])}function pie(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,s=t.dataIdMap.get(n.dataId).id,{reps:a}=o,i=new Array(n.shape.length);for(let m=0;m{let{x:o}=r,{k:n,sorted:s}=t,a=e.dataIdMap.get(o.dataId).id,i=new Uint8Array(new Int32Array(o.shape).buffer),p=o.shape.slice();p[p.length-1]=n;let u=e.makeOutput(p,o.dtype),l=e.dataIdMap.get(u.dataId).id,c=e.makeOutput(p,\"int32\"),m=e.dataIdMap.get(c.dataId).id;return gz(a,i,o.shape.length,we[o.dtype],n,s,l,m),[u,c]},xz={kernelName:Bs,backendName:\"wasm\",setupFunc:lie,kernelFunc:cie};var yz;function mie(r){yz=r.wasm.cwrap(zs,null,[\"number\",\"number\",\"bool\",\"number\",\"number\",\"number\",\"number\",\"number\",\"number\",\"array\",\"number\",\"array\",\"number\",\"number\",\"number\",\"number\",\"number\"])}function die(r){let{backend:e,inputs:t,attrs:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),b=new Uint8Array(new Int32Array(y.computeStrides(g)).buffer),w=e.makeOutput(g,n.dtype),S=e.dataIdMap.get(w.dataId).id,T=e.dataIdMap.get(n.dataId).id,R=e.dataIdMap.get(s.dataId).id,D=a===\"nearest\"?1:2,F;switch(i){case\"constant\":F=1;break;case\"reflect\":F=2;break;case\"wrap\":F=3;break;case\"nearest\":F=4;break;default:F=1;break}return yz(T,R,s.shape[0]>1,l,f,h,d,m,c,x,n.shape.length-1,b,g.length-1,D,F,p,S),w}var bz={kernelName:zs,backendName:\"wasm\",setupFunc:mie,kernelFunc:die};function fie(r){let{inputs:e,attrs:t,backend:o}=r,{axis:n}=t,{x:s}=e,{outputValues:a,outputShape:i,indices:p}=bp(o.readSync(s.dataId),n,s.shape,s.dtype);return[o.makeOutput(i,s.dtype,void 0,a),o.makeOutput([p.length],\"int32\",void 0,p)]}var Cz={kernelName:nu,backendName:\"wasm\",kernelFunc:fie};function hie(r){let{inputs:e,backend:t,attrs:o}=r,{value:n}=e,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n.shape[s],i=n.shape.length,p=new Array(i-1),u=0;for(let d=0;d({dataId:d,dtype:f,shape:p}))}var wz={kernelName:Ta,backendName:\"wasm\",kernelFunc:hie};function gie(r){let{inputs:{x:e},backend:t}=r,o=t.makeOutput(e.shape,e.dtype);return t.typedArrayFromHeap(o).fill(0),o}var Sz={kernelName:_a,backendName:\"wasm\",kernelFunc:gie};var xie=[iO,uO,pO,lO,cO,dO,yO,CO,wO,SO,IO,vO,kO,NO,TO,EO,PO,RO,AO,LO,zO,WO,UO,GO,HO,KO,jO,XO,QO,JO,tM,oM,sM,aM,iM,pM,cM,dM,hM,xM,bM,wM,IM,kM,TM,_M,$M,RM,DM,AM,FM,PM,OM,LM,BM,zM,WM,GM,KM,jM,YM,QM,ZM,fO,JM,eL,tL,oL,nL,sL,iL,pL,uL,lL,cL,mL,dL,hL,xL,bL,CL,SL,vL,NL,_L,$L,DL,FL,PL,ML,VL,WL,UL,GL,KL,jL,YL,QL,JL,eB,tB,Yg,oB,sB,iB,uB,pB,lB,cB,mB,OO,fB,gB,yB,CB,SB,vB,kB,NB,_B,$B,DB,AB,PB,OB,MB,LB,BO,BL,BB,zB,WB,GB,KB,qB,XB,YB,QB,ZB,JB,tz,oz,nz,sz,az,iz,pz,lz,cz,dz,hz,xz,bz,gO,Cz,wz,Sz];for(let r of xie)li(r);var J0=A();J0.registerFlag(\"WASM_HAS_SIMD_SUPPORT\",async()=>{try{return 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]))}catch(r){return!1}});J0.registerFlag(\"WASM_HAS_MULTITHREAD_SUPPORT\",async()=>{if(J0.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(r){return!1}});var iv=Kp(Nz()),Dz=Kp(_z()),uv=Kp(Ez());var $z=iv.default||iv,yie=uv.default||uv,gm=class extends mo{constructor(e){super(),this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(Fz),av=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new mn(this,cr())}write(e,t,o){let n={id:this.dataIdNextNumber++};return this.move(n,e,t,o,1),n}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=y.now();return e(),{kernelMs:y.now()-t}}move(e,t,o,n,s){let a=this.dataIdNextNumber++;if(n===\"string\"){let l=t;this.dataIdMap.set(e,{id:a,stringBytes:l,shape:o,dtype:n,memoryOffset:null,refCount:s});return}let i=y.sizeFromShape(o),p=i*y.bytesPerElement(n),u=this.wasm._malloc(p)>>>0;this.dataIdMap.set(e,{id:a,memoryOffset:u,shape:o,dtype:n,refCount:s}),this.wasm.tfjs.registerTensor(a,i,u),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,p),u)}async read(e){return this.readSync(e)}readSync(e,t,o){let{memoryOffset:n,dtype:s,shape:a,stringBytes:i}=this.dataIdMap.get(e);if(s===\"string\")return(t==null||t===0)&&(o==null||o>=i.length)?i:i.slice(t,o);t=t||0,o=o||y.sizeFromShape(a);let p=y.bytesPerElement(s),u=this.wasm.HEAPU8.slice(n+t*p,n+o*p);return Cie(u.buffer,s)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let o=this.dataIdMap.get(e);if(o.refCount--,!t&&o.refCount>0)return!1;this.wasm._free(o.memoryOffset),this.wasm.tfjs.disposeData(o.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,o,n){let s;if(o==null)s=this.write(n!=null?n:null,e,t);else{let a=this.dataIdNextNumber++;s={id:a},this.dataIdMap.set(s,{id:a,memoryOffset:o,shape:e,dtype:t,refCount:1});let i=y.sizeFromShape(e);this.wasm.tfjs.registerTensor(a,i,o)}return{dataId:s,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:o}){let n=this.wasm.HEAPU8.buffer,{memoryOffset:s}=this.dataIdMap.get(o),a=y.sizeFromShape(e);switch(t){case\"float32\":return new Float32Array(n,s,a);case\"int32\":return new Int32Array(n,s,a);case\"bool\":return new Uint8Array(n,s,a);default:throw new Error(`Unknown dtype ${t}`)}}};function bie(r){return(e,t)=>(y.fetch(r,{credentials:\"same-origin\"}).then(o=>{o.ok||e.env.a(`failed to load wasm binary file at '${r}'`),o.arrayBuffer().then(n=>{WebAssembly.instantiate(n,e).then(s=>{t(s.instance,s.module)})})}),{})}function Rz(r,e,t){if(tx!=null)return tx;let o=\"tfjs-backend-wasm.wasm\";return r&&e?o=\"tfjs-backend-wasm-threaded-simd.wasm\":r&&(o=\"tfjs-backend-wasm-simd.wasm\"),fm!=null&&fm[o]!=null?fm[o]:t+o}async function Az(){let[r,e]=await Promise.all([A().getAsync(\"WASM_HAS_SIMD_SUPPORT\"),A().getAsync(\"WASM_HAS_MULTITHREAD_SUPPORT\")]);return new Promise((t,o)=>{let n={};n.locateFile=(i,p)=>{if(i.endsWith(\".worker.js\")){let u=Dz.wasmWorkerContents.replace(/\\n/g,\"\\\\n\"),l=new Blob([u],{type:\"application/javascript\"});return URL.createObjectURL(l)}return i.endsWith(\".wasm\")?Rz(r,e,dm!=null?dm:p):p+i},pv&&(n.instantiateWasm=bie(Rz(r,e,dm!=null?dm:\"\")));let s=!1;n.onAbort=()=>{if(s||hm)return;hm=!0,o({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 a;e&&r&&tx==null?(n.mainScriptUrlOrBlob=new Blob([\"var WasmBackendModuleThreadedSimd = \"+$z.toString()],{type:\"text/javascript\"}),a=$z(n)):a=yie(n),a.then(i=>{s=!0,hm=!1;let p=null;i.tfjs={init:i.cwrap(\"init\",null,[]),initWithThreadsCount:i.cwrap(\"init_with_threads_count\",null,[\"number\"]),getThreadsCount:i.cwrap(\"get_threads_count\",\"number\",[]),registerTensor:i.cwrap(\"register_tensor\",null,[\"number\",\"number\",\"number\"]),disposeData:i.cwrap(\"dispose_data\",p,[\"number\"]),dispose:i.cwrap(\"dispose\",p,[])},t({wasm:i})}).catch(o)})}function Cie(r,e){switch(e){case\"float32\":return new Float32Array(r);case\"int32\":return new Int32Array(r);case\"bool\":return new Uint8Array(r);default:throw new Error(`Unknown dtype ${e}`)}}var wie=[\"tfjs-backend-wasm.wasm\",\"tfjs-backend-wasm-simd.wasm\",\"tfjs-backend-wasm-threaded-simd.wasm\"],tx=null,dm=null,fm={},hm=!1,pv=!1;function Sie(r,e=!1){if(zw(\"setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release.\"),hm)throw new Error(\"The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`\");tx=r,pv=e}function Iie(r,e=!1){if(hm)throw new Error(\"The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`\");if(typeof r==\"string\")dm=r;else{fm=r;let t=wie.filter(o=>fm[o]==null);if(t.length>0)throw new Error(`There were no entries found for the following binaries: ${t.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.`)}pv=e}var Fz=-1,av=-1;function vie(r){Fz=r}function kie(){if(av===-1)throw new Error(\"WASM backend not initialized.\");return av}var Nie=\"4.17.0\";var Tie=2;pu(\"wasm\",async()=>{let{wasm:r}=await Az();return new gm(r)},Tie);var Wo=A();Wo.registerFlag(\"WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE\",()=>15);Wo.registerFlag(\"WEBGPU_CPU_FORWARD\",()=>!0);Wo.registerFlag(\"WEBGPU_MATMUL_PROGRAM_TYPE\",()=>-1);Wo.registerFlag(\"WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE\",()=>!0);Wo.registerFlag(\"WEBGPU_USE_LOW_POWER_GPU\",()=>!1);Wo.registerFlag(\"WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD\",()=>1e3);Wo.registerFlag(\"WEBGPU_USE_PROFILE_TOOL\",()=>!1);Wo.registerFlag(\"WEBGPU_IMPORT_EXTERNAL_TEXTURE\",()=>!0);Wo.registerFlag(\"WEBGPU_USE_NAIVE_CONV2D_DEBUG\",()=>!1);Wo.registerFlag(\"WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL\",()=>-1);Wo.registerFlag(\"WEBGPU_CONV_SEPARATE_IM2COL_SHADER\",()=>!1);Wo.registerFlag(\"WEBGPU_PRINT_SHADER\",()=>\"\");Wo.registerFlag(\"WEBGPU_ENGINE_COMPILE_ONLY\",()=>!1);var rx=class{constructor(e){e&&(this.vendor=e.vendor,this.architecture=e.architecture,this.intelGPUGeneration=this.getIntelGPUGeneration())}getIntelGPUGeneration(){if(this.isIntel()){if(this.architecture.startsWith(\"gen\"))return Number(this.architecture.match(/\\d+/));if(this.architecture.startsWith(\"xe\"))return 12}return 0}isIntel(){return this.vendor===\"intel\"}};var ox=class{constructor(e){this.device=e,this.numUsedBuffers=0,this.numFreeBuffers=0,this.freeBuffers=new Map,this.usedBuffers=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireBuffer(e,t,o=!1,n=!0){let s,a=Pz(e,t);return n?(this.freeBuffers.has(a)||this.freeBuffers.set(a,[]),this.freeBuffers.get(a).length>0?(s=this.freeBuffers.get(a).pop(),this.numFreeBuffers--):(s=this.device.createBuffer({size:e,usage:t,mappedAtCreation:o}),this.numBytesAllocated+=e)):(s=this.device.createBuffer({size:e,usage:t,mappedAtCreation:o}),this.numBytesAllocated+=e),this.usedBuffers.has(a)||this.usedBuffers.set(a,[]),this.usedBuffers.get(a).push(s),this.numUsedBuffers++,this.numBytesUsed+=e,s}releaseBuffer(e,t=!0){if(this.freeBuffers.size===0)return;let o=e.size,n=e.usage,s=Pz(o,n),a=this.usedBuffers.get(s),i=a.indexOf(e);if(i<0)throw new Error(\"Cannot find the buffer in buffer manager\");a[i]=a[a.length-1],a.pop(),this.numUsedBuffers--,this.numBytesUsed-=o,t?(this.freeBuffers.get(s).push(e),this.numFreeBuffers++):(e.destroy(),this.numBytesAllocated-=o)}getNumUsedBuffers(){return this.numUsedBuffers}getNumFreeBuffers(){return this.numFreeBuffers}dispose(){this.freeBuffers.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.usedBuffers.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.freeBuffers=new Map,this.usedBuffers=new Map,this.numUsedBuffers=0,this.numFreeBuffers=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function Pz(r,e){return`${r}_${e}`}var nx=class{constructor(e){this.device=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures=new Map,this.usedTextures=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireTexture(e,t,o,n){let s=Mz(o),a=e*t*s,i=Oz(e,t,o,n);if(this.freeTextures.has(i)||this.freeTextures.set(i,[]),this.usedTextures.has(i)||this.usedTextures.set(i,[]),this.numBytesUsed+=a,this.numUsedTextures++,this.freeTextures.get(i).length>0){this.numFreeTextures--;let u=this.freeTextures.get(i).shift();return this.usedTextures.get(i).push(u),u}this.numBytesAllocated+=a;let p=this.device.createTexture({size:[e,t],format:o,usage:n});return this.usedTextures.get(i).push(p),p}releaseTexture(e){if(this.freeTextures.size===0)return;let t=e.width,o=e.height,n=e.format,s=e.usage,a=Oz(t,o,n,s);this.freeTextures.has(a)||this.freeTextures.set(a,[]),this.freeTextures.get(a).push(e),this.numFreeTextures++,this.numUsedTextures--;let i=this.usedTextures.get(a),p=i.indexOf(e);if(p<0)throw new Error(\"Cannot release a texture that was never provided by this texture manager\");i.splice(p,1);let u=Mz(n),l=t*o*u;this.numBytesUsed-=l}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){this.freeTextures.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.usedTextures.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.freeTextures=new Map,this.usedTextures=new Map,this.numUsedTextures=0,this.numFreeTextures=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function Oz(r,e,t,o){return`${r}_${e}_${t}_${o}`}function Mz(r){if(r===\"rgba8unorm\")return 16;throw new Error(`${r} is not supported!`)}function Lz(r,e){if(Math.max(...r)>5)throw new Error(\"Cannot symbolically compute strides for rank > 6 tensor.\");let t=r.length,o=\"xyzwuv\",n=r.map(a=>`${e}.${o[a]}`),s=new Array(t-1);s[t-2]=n[t-1];for(let a=t-3;a>=0;--a)s[a]=`(${s[a+1]} * ${n[a+1]})`;return s}var oo=(r,e,t)=>t===\"int32\"?`atomicAdd(${r}, bitcast(${e}));`:`\n {\n var oldValue = 0;\n loop {\n let newValueF32 = bitcast(oldValue) + (${e});\n let newValue = bitcast(newValueF32);\n let res = atomicCompareExchangeWeak(${r}, oldValue, newValue);\n if res.exchanged {\n break;\n }\n oldValue = res.old_value;\n }\n }`;var $i;(function(r){r[r.FROM_PIXELS=0]=\"FROM_PIXELS\",r[r.DRAW=1]=\"DRAW\"})($i||($i={}));var Wz=(r,e,t,o,n)=>{let s={dtype:o.dtype,shape:o.shape},a=Eie(t,s,e),i=r.createShaderModule({code:a,label:e.constructor.name}),p=A().get(\"WEBGPU_PRINT_SHADER\");if(p!==\"\"){p=p.toLowerCase();let u=p.split(\",\");(p===\"all\"||u.some(l=>e.shaderKey.toLowerCase().includes(l)))&&(console.group(e.shaderKey),console.debug(a),console.groupEnd())}return n?r.createComputePipelineAsync({compute:{module:i,entryPoint:\"_start\"},label:e.constructor.name,layout:\"auto\"}):r.createComputePipeline({compute:{module:i,entryPoint:\"_start\"},label:e.constructor.name,layout:\"auto\"})},Ae=(r,e=\"f32\")=>{switch(r){case 1:return`${e}`;case 2:return`vec2<${e}>`;case 3:return`vec3<${e}>`;case 4:return`vec4<${e}>`;default:throw new Error(`${r}-component ${e} is not supported.`)}};function ft(r){if(r<=1)return\"i32\";if(r===2)return\"vec2\";if(r===3)return\"vec3\";if(r===4)return\"vec4\";if(r===5)return\"vec5\";if(r===6)return\"vec6\";throw Error(`GPU for rank ${r} is not yet supported`)}function un(r){if(r===0)return\"x\";if(r===1)return\"y\";if(r===2)return\"z\";if(r===3)return\"w\";if(r===4)return\"u\";if(r===5)return\"v\";throw Error(`Index ${r} is not yet supported`)}function G(...r){let e;switch(r.length){case 0:e=`\n fn main()\n `;break;case 1:e=`\n fn main(${r[0]} : i32)\n `;break;default:throw Error(\"Unreachable\")}return e}function Bz(r,e){let t;return t=`\n ${_ie(e)}\n fn _start(@builtin(local_invocation_id) LocalId : vec3,\n @builtin(global_invocation_id) GlobalId : vec3,\n @builtin(local_invocation_index) LocalIndex: u32,\n @builtin(workgroup_id) WorkgroupId : vec3,\n @builtin(num_workgroups) NumWorkgroups : vec3) {\n localId = LocalId;\n localIndex = LocalIndex;\n globalId = GlobalId;\n numWorkgroups = NumWorkgroups;\n workgroupId = WorkgroupId;\n ${r?\"main(getGlobalIndex());\":\"main();\"};\n }\n `,t}function _ie(r){return`\n @compute @workgroup_size(${r.workgroupSize[0]}, ${r.workgroupSize[1]}, ${r.workgroupSize[2]})\n`}function Eie(r,e,t){let o=[],n=t.workgroupSize[0]*t.workgroupSize[1]*t.workgroupSize[2];if(t.outputComponent=t.outputComponent?t.outputComponent:1,o.push(`\n\n var localId: vec3;\n var localIndex: u32;\n var globalId: vec3;\n var numWorkgroups: vec3;\n var workgroupId: vec3;\n\n // Only used when the y/z dimension of workgroup size is 1.\n fn getGlobalIndex() -> i32 {\n ${Gz(t)?\" return i32(globalId.x);\":` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y +\n workgroupId.y * numWorkgroups.x + workgroupId.x) * ${n}u +\n localIndex);\n `}\n }\n `),t.pixelsOpType!=null){let f=t.pixelsOpType===$i.FROM_PIXELS?`@group(0) @binding(0) var result: array<${Eu(e.dtype,t.outputComponent)}>;`:`@group(0) @binding(1) var inBuf : array<${Eu(r[0].dtype,t.outputComponent)}>;`,h=e.shape.length===3?\"vec2\":\"i32\";o.push(`\n struct Uniform {\n outShapeStrides : ${h},\n size : i32,\n numChannels : i32,\n alpha : f32,\n };\n\n ${f}\n @group(0) @binding(2) var uniforms: Uniform;\n `);let g=Vz(t);return[zz,o.join(`\n`),xm(e.shape),t.getUserCode(),Bz(g,t)].join(`\n`)}let s,a,i=\"struct Uniforms { NAN : f32, INFINITY : f32, \";t.variableNames.forEach((f,h)=>{let g=ft(r[h].shape.length);i+=`${f.charAt(0).toLowerCase()+f.slice(1)}Shape : ${g}, `,s=r[h].shape.length-1,a=ft(s),i+=`${f.charAt(0).toLowerCase()+f.slice(1)}ShapeStrides: ${a}, `});let p=ft(e.shape.length);i+=`outShape : ${p}, `,s=e.shape.length-1,a=ft(s),i+=`\n outShapeStrides: ${a}, `,t.size&&(i+=\"size : i32, \"),t.uniforms&&(i+=t.uniforms),i+=\"};\",i=Mie(i),o.push(i),t.atomic?o.push(`\n @group(0) @binding(0) var result: array>;\n `):o.push(`\n @group(0) @binding(0) var result: array<${Eu(e.dtype,t.outputComponent)}>;\n `),t.variableNames.forEach((f,h)=>{o.push(`\n @group(0) @binding(${1+h}) var ${f}: array<${t.variableComponents?Eu(r[h].dtype,t.variableComponents[h]):Eu(r[h].dtype,t.outputComponent)}>;\n `)}),i!==\"\"&&o.push(`\n @group(0) @binding(${1+t.variableNames.length}) var uniforms: Uniforms;\n `);let u=Fie(e.shape,t.dispatchLayout),l=[zz,o.join(`\n`)+$ie,xm(e.shape),u,Pie(e.shape.length)];t.atomic||l.push(Oie(e.shape,e.dtype,t.outputComponent)),t.variableNames.forEach((f,h)=>{l.push(`${xm(r[h].shape,f)}`)});let c=r.map((f,h)=>Aie(f,e.shape,t.variableComponents?t.variableComponents[h]:t.outputComponent,t.dispatchLayout.x.length===e.shape.length)).join(`\n`);l.push(c),l.push(t.getUserCode());let m=Vz(t);return l.push(Bz(m,t)),l.join(`\n`)}function Uz(r,e,t){let o=r.shaderKey;if(r.pixelsOpType!=null)return o;let n=[],s=[];e.forEach(l=>{n.push(l.shape),s.push(l.dtype)}),n.push(t.shape),s.push(t.dtype);let a=e.map(l=>C.getBroadcastDims(l.shape,t.shape)),i=e.map(l=>y.arraysEqual(l.shape,t.shape)).join(\"_\"),p=a.map(l=>l.join(\"_\")).join(\";\"),u=Gz(r)?\"flatDispatch\":\"\";return o+=\"_\"+(r.workgroupSize?r.workgroupSize.join(\",\"):\"\")+n.map(l=>l.length).join(\",\")+s.join(\",\")+r.variableNames.join(\",\")+p+i+u,o}var zz=`\n struct vec5 {x: i32, y: i32, z: i32, w: i32, u: i32};\n struct vec6 {x: i32, y: i32, z: i32, w: i32, u: i32, v: i32};\n\n // Checks whether coordinates lie within the bounds of the shape.\n fn coordsInBounds2D(coord : vec2, shape : vec2) -> bool {\n return all(coord >= vec2(0)) && all(coord < shape);\n }\n fn coordsInBounds3D(coord : vec3, shape : vec3) -> bool {\n return all(coord >= vec3(0)) && all(coord < shape);\n }\n fn coordsInBounds4D(coord : vec4, shape : vec4) -> bool {\n return all(coord >= vec4(0)) && all(coord < shape);\n }\n\n fn getIndexFromCoords1D(coord : i32, shape : i32) -> i32 {\n return coord;\n }\n fn getIndexFromCoords2D(coords : vec2, shape : vec2) -> i32 {\n return dot(coords, vec2(shape.y, 1));\n }\n fn getIndexFromCoords3D(coords : vec3, shape : vec3) -> i32 {\n return dot(coords, vec3(shape.y * shape.z, shape.z, 1));\n }\n fn getIndexFromCoords4D(coords : vec4, shape : vec4) -> i32 {\n return dot(coords, vec4(\n shape.y * shape.z * shape.w, shape.z * shape.w, shape.w, 1));\n }\n fn getIndexFromCoords5D(coords : vec5, shape : vec5) -> i32 {\n let shapeStrides: vec5 = vec5(shape.y * shape.z * shape.w * shape.u, shape.z * shape.w * shape.u, shape.w * shape.u, shape.u, 1);\n return coords.x*shapeStrides.x + coords.y*shapeStrides.y + coords.z*shapeStrides.z + coords.w*shapeStrides.w + coords.u*shapeStrides.u;\n }\n fn getIndexFromCoords6D(coords : vec6, shape : vec6) -> i32 {\n let shapeStrides: vec6 = vec6(shape.y * shape.z * shape.w * shape.u * shape.v, shape.z * shape.w * shape.u * shape.v, shape.w * shape.u * shape.v, shape.u * shape.v, shape.v, 1);\n return coords.x*shapeStrides.x + coords.y*shapeStrides.y + coords.z*shapeStrides.z + coords.w*shapeStrides.w + coords.u*shapeStrides.u + coords.v*shapeStrides.v;\n }\n\n // NaN defination in IEEE 754-1985 is :\n // - sign = either 0 or 1.\n // - biased exponent = all 1 bits.\n // - fraction = anything except all 0 bits (since all 0 bits represents infinity).\n // https://en.wikipedia.org/wiki/IEEE_754-1985#Representation_of_non-numbers\n fn isnan(val: f32) -> bool {\n let floatToUint: u32 = bitcast(val);\n return (floatToUint & 0x7fffffffu) > 0x7f800000u;\n }\n fn isnanVec4(val : vec4) -> vec4 {\n let floatToUint: vec4 = bitcast>(val);\n return (floatToUint & vec4(0x7fffffffu)) > vec4(0x7f800000u);\n }\n`,$ie=`\n fn isinf(val: f32) -> bool {\n return abs(val) == uniforms.INFINITY;\n }\n`;function xm(r,e=\"\"){let t=r.length,o=e!==\"\"?`get${e.charAt(0).toUpperCase()+e.slice(1)}CoordsFromIndex`:\"getCoordsFromIndex\",n=e!==\"\"?`${e.charAt(0).toLowerCase()+e.slice(1)}ShapeStrides`:\"outShapeStrides\";if(t<=1)return`fn ${o}(index : i32) -> i32 { return index; }`;let s=y.computeStrides(r),a=ft(t),i=[];for(let u=0;u vec2 {\n let d0 = index / uniforms.${n}; let d1 = index - d0 * uniforms.${n};\n return vec2(d0, d1);\n }`;let p;return p=\"var index2 = index;\"+s.map((u,l)=>{let c=`let ${i[l]} = index2 / uniforms.${n}.${un(l)}`,m=l===s.length-1?`let ${i[l+1]} = index2 - ${i[l]} * uniforms.${n}.${un(l)}`:`index2 = index2 - ${i[l]} * uniforms.${n}.${un(l)}`;return`${c}; ${m};`}).join(\"\"),`\n fn ${o}(index : i32) -> ${a} {\n ${p}\n return ${a}(${i.join(\",\")});\n }\n `}function Rie(r,e){let t=r.name,o=r.shape.length,n=ft(o),s=\"get\"+t.charAt(0).toUpperCase()+t.slice(1),a=[\"d0\",\"d1\",\"d2\",\"d3\",\"d4\",\"d5\"].slice(0,o),i=a.map(l=>`${l} : i32`).join(\", \");if(o<1)return`\n fn ${s}() -> ${Ae(e)} {\n return ${Ae(e)}(${t}[0]);\n }\n `;let p=`uniforms.${t.charAt(0).toLowerCase()+t.slice(1)}Shape`,u=`${o}D`;return o===0&&(u=\"1D\"),`\n fn ${s}(${i}) -> ${Ae(e)} {\n return ${Ae(e)}(${t}[getIndexFromCoords${u}(${n}(${a.join(\",\")}),\n ${p})${e===1?\"\":` / ${e}`}]);\n }\n `}function Die(r,e,t,o){let n=r.name,s=n.charAt(0).toUpperCase()+n.slice(1),a=\"get\"+s+\"ByOutput\",i=r.shape.length,p=e.length,u=ft(p);if(y.arraysEqual(r.shape,e)&&o)return`\n fn ${a}Index(globalIndex : i32) -> ${Ae(t)} {\n return ${Ae(t)}(${n}[globalIndex]);\n }\n\n fn ${a}Coords(coords : ${u}) -> ${Ae(t)} {\n return ${Ae(t)}(${n}[${p>1?\"getOutputIndexFromCoords(coords)\":\"coords\"}${t===1?\"\":` / ${t}`}]);\n }\n `;let l=C.getBroadcastDims(r.shape,e),c=p-i,m=\"\";if(i===0)return`\n fn ${a}Index(globalIndex : i32) -> ${Ae(t)}{\n return get${s}();\n }\n\n fn ${a}Coords(coords : ${u}) -> ${Ae(t)}{\n return get${s}();\n }\n `;p<2&&l.length>=1?m=\"coords = 0;\":m=l.map(g=>`coords.${un(g+c)} = 0;`).join(`\n`);let d=\"\";if(p<2&&i>0)d=\"coords\";else if(p>1){let g=ft(i),x=r.shape.map((b,w)=>`coords.${un(w+c)}`).join(\", \");d=`${g}(${x})`}else d=\"coords\";let f=`uniforms.${n.charAt(0).toLowerCase()+n.slice(1)}Shape`,h=`${i}D`;return`\n fn ${a}Index(globalIndex : i32) -> ${Ae(t)} {\n var coords = getCoordsFromIndex(globalIndex);\n ${m}\n return ${Ae(t)}(${n}[getIndexFromCoords${h}(${d}, ${f})${t===1?\"\":` / ${t}`}]);\n }\n\n fn ${a}Coords(coordsIn : ${u}) -> ${Ae(t)} {\n var coords = coordsIn;\n ${m}\n return ${Ae(t)}(${n}[getIndexFromCoords${h}(${d}, ${f})${t===1?\"\":` / ${t}`}]);\n }\n`}function Aie(r,e,t,o){let n=Rie(r,t);return r.shape.length<=e.length&&(n+=Die(r,e,t,o)),n}function Fie(r,e){let{x:t,y:o=[],z:n=[]}=e,s=r.length,a=t.length+o.length+n.length;if(a!==s)return\"\";if(t.length===s)return`fn getOutputCoords() -> ${ft(s)}{\n let globalIndex = getGlobalIndex();\n return getCoordsFromIndex(globalIndex);\n }\n `;let i=\"\",p=[t,o,n];for(let m=0;m ${l} {\n ${i}\n`;return u.length===0?c+=`return ${l}(0); }`:c+=`return ${l}(${u.join(\",\")}); }`,c}function Pie(r){let e=\"\";switch(r){case 0:case 1:e+=`\n fn getOutputIndexFromCoords(coords : i32) -> i32 {\n return coords;\n }\n `;break;case 2:e+=`\n fn getOutputIndexFromCoords(coords : vec2) -> i32 {\n return dot(coords, vec2(uniforms.outShapeStrides, 1));\n }\n `;break;case 3:e+=`\n fn getOutputIndexFromCoords(coords : vec3) -> i32 {\n return dot(coords, vec3(uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, 1));\n }\n `;break;case 4:e+=`\n fn getOutputIndexFromCoords(coords : vec4) -> i32 {\n return dot(coords, vec4(\n uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, uniforms.outShapeStrides.z, 1));\n }\n `;break;case 5:e+=`\n fn getOutputIndexFromCoords(coords : vec5) -> i32 {\n return coords.x * uniforms.outShapeStrides.x +\n coords.y * uniforms.outShapeStrides.y +\n coords.z * uniforms.outShapeStrides.z +\n coords.w * uniforms.outShapeStrides.w +\n coords.u;\n }\n `;break;case 6:e+=`\n fn getOutputIndexFromCoords(coords : vec6) -> i32 {\n return coords.x * uniforms.outShapeStrides.x +\n coords.y * uniforms.outShapeStrides.y +\n coords.z * uniforms.outShapeStrides.z +\n coords.w * uniforms.outShapeStrides.w +\n coords.u * uniforms.outShapeStrides.u +\n coords.v;\n }\n `;break;default:y.assert(!1,()=>`Unsupported ${r}D shape`);break}return e}function Gz(r){return r.dispatch[1]===1&&r.dispatch[2]===1}function Eu(r,e=1){if(r===\"float32\")return Ae(e,\"f32\");if(r===\"int32\"||r===\"bool\")return Ae(e,\"i32\");throw new Error(`type ${r} is not supported.`)}function Oie(r,e,t){let o=r.length,n=Eu(e,t),s=`fn setOutputAtIndex(flatIndex : i32, value : ${Ae(t)}) {\n result[flatIndex] = ${n}(value);\n }\n\n fn setOutputAtIndexI32(flatIndex : i32, value : ${Ae(t,\"i32\")}) {\n result[flatIndex] = ${n}(value);\n }\n `;if(o>=2){let a=[\"d0\",\"d1\",\"d2\",\"d3\",\"d4\",\"d5\"].slice(0,o),i=ft(o);s+=`\n fn setOutputAtCoords(${a.map(p=>`${p} : i32`).join(\", \")}, value : ${Ae(t)}) {\n let flatIndex = getOutputIndexFromCoords(${i}(${a.join(\", \")}));\n setOutputAtIndex(flatIndex${t===1?\"\":` / ${t}`}, value);\n }\n fn setOutputAtCoordsI32(${a.map(p=>`${p} : i32`).join(\", \")}, value : ${Ae(t,\"i32\")}) {\n let flatIndex = getOutputIndexFromCoords(${i}(${a.join(\", \")}));\n setOutputAtIndexI32(flatIndex${t===1?\"\":` / ${t}`}, value);\n }\n `}return s}function Mie(r){let e=/(\\w+)\\s*:\\s*vec(5|6)/g;r=r.replace(e,o=>\"@align(16) \"+o);let t=/vec(5|6)\\s*,\\s*(\\w+)/g;return r=r.replace(t,(o,n,s)=>`vec${n}, @align(16) ${s}`),r}function Vz(r){return!(r.dispatchLayout.hasOwnProperty(\"y\")&&r.dispatchLayout.y.length!==0||r.dispatchLayout.hasOwnProperty(\"z\")&&r.dispatchLayout.z.length!==0)}var cv={};qe(cv,{GPUBytesPerElement:()=>sx,MatMulProgramType:()=>pn,assertNotComplex:()=>wm,computeDispatch:()=>H,computeWorkPerThreadForConv2d:()=>bm,computeWorkgroupInfoForMatMul:()=>lv,computeWorkgroupSizeForConv2d:()=>ym,flatDispatchLayout:()=>X,isWebGPUSupported:()=>Cm,tilesFitEvenlyIntoShape:()=>Bie});var Ap=r=>{let e=1;for(let t=0;tt%r[o]===0)}function H(r,e,t=[1,1,1],o=[1,1,1]){let[n,s,a]=[Math.ceil(Ap(r.x.map(i=>e[i]))/(t[0]*o[0])),r.y?Math.ceil(Ap(r.y.map(i=>e[i]))/(t[1]*o[1])):1,r.z?Math.ceil(Ap(r.z.map(i=>e[i]))/(t[2]*o[2])):1];return[n,s,a]}function lv(r,e,t,o=!1){let n=[8,8,1],s=[4,4,1];return o||(r<=8&&(s[1]=1),e<=16&&t<=16&&(n[0]=4)),{workgroupSize:n,elementsPerThread:s}}function ym(r,e,t=!1){if(t)return[8,8,1];let o=Ap(r.x.map(s=>e[s])),n=Ap(r.y.map(s=>e[s]));return o<=4?[4,16,1]:n<=4?[16,4,1]:[16,16,1]}function bm(r,e,t=!1){if(t)return[4,4,1];let o=Ap(r.x.map(s=>e[s])),n=Ap(r.y.map(s=>e[s]));return o<=4?[1,2,1]:n<=4?[2,1,1]:[2,2,1]}function X(r){return{x:r.map((e,t)=>t)}}function sx(r){if(r===\"float32\"||r===\"int32\"||r===\"bool\"||r===\"string\")return 4;if(r===\"complex64\")return 8;throw new Error(`Unknown dtype ${r}`)}function Cm(){return!!(globalThis&&globalThis.navigator&&globalThis.navigator.gpu)}function wm(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!==\"complex64\",()=>`${e} does not support complex64 tensors in the WebGPU backend.`)})}var pn;(function(r){r[r.MatMulReduceProgram=0]=\"MatMulReduceProgram\",r[r.MatMulSplitKProgram=1]=\"MatMulSplitKProgram\",r[r.MatMulSmallOutputSizeProgram=2]=\"MatMulSmallOutputSizeProgram\",r[r.MatMulPackedProgram=3]=\"MatMulPackedProgram\",r[r.MatMulMax=4]=\"MatMulMax\"})(pn||(pn={}));var zie=A().getNumber(\"WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD\"),Vie=(r,e)=>{let t=r.limits.maxComputeWorkgroupsPerDimension,o=e.dispatchLayout,n=e.dispatch;if(n.every(a=>a<=t))return n;y.assert(n[0]>t&&o.y===void 0&&o.z===void 0,()=>\"Dispatch size exceeds WebGPU limits in Y or Z dimension.\");let s=Math.ceil(Math.sqrt(n[0]));return s>t?(s=Math.ceil(Math.cbrt(n[0])),y.assert(s<=t,()=>\"Total dispatch size exceeds WebGPU maximum.\"),[s,s,s]):[s,s,1]},Jl=class r extends mo{nextDataId(){return r.nextDataId++}constructor(e,t){if(super(),this.commandQueueOwnedIds=new WeakSet,this.dispatchCountInPass=0,this.disposed=!1,this.downloadWaitMs=0,this.tensorDataPendingDisposal=[],this.queryResolveBuffer=null,this.querySet=null,this.querySetCount=2,this.stagingPendingDisposal=[],this.uniformPendingDisposal=[],this.uploadWaitMs=0,this.hasReadSyncWarned=!1,this.hasTimestampQueryWarned=!1,!Cm())throw new Error(\"WebGPU is not supported on this device\");this.pipelineCache={},this.device=e,this.queue=e.queue,this.commandEncoder=null,this.computePassEncoder=null,this.adapterInfo=new rx(t),this.supportTimestampQuery=this.device.features.has(\"timestamp-query\"),this.thresholdToIncreaseWorkgroups=this.adapterInfo.intelGPUGeneration>=12?16:8,this.bufferManager=new ox(this.device),this.textureManager=new nx(this.device),this.tensorMap=new mn(this,cr()),A().getBool(\"WEBGPU_USE_PROFILE_TOOL\")&&(this.dummyCanvas=document.createElement(\"canvas\"),this.dummyCanvas.width=1,this.dummyCanvas.height=1,this.dummyContext=this.dummyCanvas.getContext(\"webgpu\"),this.dummyContext.configure({device:e,format:\"bgra8unorm\"}),document.body.appendChild(this.dummyCanvas))}floatPrecision(){return 32}disposeData(e,t=!1){if(!this.tensorMap.has(e))return!0;let o=this.tensorMap.get(e);return t?o.refCount=0:o.refCount--,o.refCount>0?!1:(o.complexTensorInfos!=null&&(this.disposeData(o.complexTensorInfos.real.dataId),this.disposeData(o.complexTensorInfos.imag.dataId)),this.commandQueueOwnedIds.has(e)?(this.tensorDataPendingDisposal.push(e),!0):(this.releaseResource(e),this.tensorMap.delete(e),!0))}memory(){return{numBytesInGPU:this.bufferManager.numBytesUsed,numBytesAllocatedInGPU:this.bufferManager.numBytesAllocated,unreliable:!1}}releaseResource(e){let t=this.tensorMap.get(e);if(!(!t||!t.resource)){if(t.external){t.resource=null;return}t.resource instanceof GPUBuffer?this.bufferManager.releaseBuffer(t.resource):t.resource instanceof GPUTexture&&this.textureManager.releaseTexture(t.resource),t.resource=null}}refCount(e){return this.tensorMap.has(e)?this.tensorMap.get(e).refCount:0}incRef(e){let t=this.tensorMap.get(e);t.refCount++}decRef(e){if(this.tensorMap.has(e)){let t=this.tensorMap.get(e);t.refCount--}}write(e,t,o){if(o===\"complex64\"&&e!=null)throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");let n={id:this.nextDataId()};return this.tensorMap.set(n,{dtype:o,shape:t,values:e,refCount:1}),n}move(e,t,o,n,s){if(n===\"complex64\")throw new Error(\"Cannot write to a complex64 dtype. Please use tf.complex(real, imag).\");this.tensorMap.set(e,{dtype:n,shape:o,values:t,refCount:s})}submitQueue(){this.queue.submit([this.commandEncoder.finish()]),this.commandEncoder=null,this.dispatchCountInPass=0,this.commandQueueOwnedIds=new WeakSet,this.tensorDataPendingDisposal.forEach(e=>{this.releaseResource(e),this.tensorMap.delete(e)}),this.uniformPendingDisposal.forEach(e=>this.bufferManager.releaseBuffer(e)),this.stagingPendingDisposal.forEach(e=>this.bufferManager.releaseBuffer(e,!1)),this.tensorDataPendingDisposal=[],this.uniformPendingDisposal=[],this.stagingPendingDisposal=[]}ensureCommandEncoderReady(){this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder())}endComputePassEncoder(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}async checkCompileCompletionAsync(){let e;try{e=await Promise.all(Object.values(this.pipelineCache))}catch(t){throw new Error(t.message)}Object.keys(this.pipelineCache).map((t,o)=>{this.pipelineCache[t]=e[o]})}async getBufferData(e){if(A().getBool(\"WEBGPU_ENGINE_COMPILE_ONLY\"))return console.warn(\"The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false\"),null;let t=e.size,o=this.bufferManager.acquireBuffer(t,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(e,0,o,0,t),this.submitQueue(),await o.mapAsync(GPUMapMode.READ);let n=o.getMappedRange().slice(0);return o.unmap(),o!=null&&this.bufferManager.releaseBuffer(o),A().getBool(\"WEBGPU_USE_PROFILE_TOOL\")&&(y.assert(this.dummyContext!==void 0,()=>\"Fail to get context for profiling tool\"),this.dummyContext.getCurrentTexture()),n}convertAndCacheOnCPU(e,t){let o=this.tensorMap.get(e);return o.values=t,o.values}readSync(e){let t=this.tensorMap.get(e),{values:o,complexTensorInfos:n}=t;if(o!=null||t.dtype===\"string\")return o;if(t.dtype===\"complex64\"){let h=this.readSync(n.real.dataId),g=this.readSync(n.imag.dataId),x=y.convertBackendValuesAndArrayBuffer(C.mergeRealAndImagArrays(h,g).buffer,\"float32\");return this.convertAndCacheOnCPU(e,x),x}this.hasReadSyncWarned||(this.hasReadSyncWarned=!0,console.warn(\"The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead.\"));let s=[\"opaque\",\"premultiplied\"],a=t.resource,i=a.size;y.assert(i%4===0,()=>\"Because there is 4 bytes for one pixel, buffer size must be multiple of 4.\");let p=i/4,u=new ArrayBuffer(i),l=256,c=256,m=s.map(h=>new OffscreenCanvas(l,c)),d=new OffscreenCanvas(l,c);this.endComputePassEncoder(),m.map((h,g)=>{let x=h.getContext(\"webgpu\");return x.configure({device:this.device,format:\"bgra8unorm\",usage:GPUTextureUsage.COPY_DST,alphaMode:s[g]}),x.getCurrentTexture()}).map((h,g)=>{let x=l*4,b=(R,D,F)=>{this.ensureCommandEncoderReady(),this.commandEncoder.copyBufferToTexture({buffer:a,bytesPerRow:x,offset:F},{texture:h},{width:R,height:D}),this.submitQueue();let O=d.getContext(\"2d\",{willReadFrequently:!0});O.clearRect(0,0,R,D),O.drawImage(m[g],0,0);let M=O.getImageData(0,0,R,D).data,L=s[g],B=new Uint8ClampedArray(u,F,R*D*4);for(let z=0;z0&&(b(S,k,T),T+=k*(l*4)),S=E%l,S>0&&b(S,1,T)});let f=y.convertBackendValuesAndArrayBuffer(u,t.dtype);return this.convertAndCacheOnCPU(e,f),f}async read(e){if(!this.tensorMap.has(e))throw new Error(`Tensor ${e} was not registered!`);let t=this.tensorMap.get(e),{values:o}=t;if(o!=null)return o;let n;if(t.dtype===\"complex64\"){let s=await Promise.all([this.read(t.complexTensorInfos.real.dataId),this.read(t.complexTensorInfos.imag.dataId)]),a=s[0],i=s[1];n=C.mergeRealAndImagArrays(a,i)}else{let s=await this.getBufferData(t.resource);n=y.convertBackendValuesAndArrayBuffer(s,t.dtype)}return this.convertAndCacheOnCPU(e,n),n}copyBuffer(e){let t=e.size,o=e.usage,n=this.bufferManager.acquireBuffer(t,o);return this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(e,0,n,0,t),this.submitQueue(),n}createTensorFromGPUData(e,t,o){let n=e.buffer;if(o===\"complex64\")throw new Error(\"Cannot write to a complex64 dtype. \");let s={id:this.nextDataId()};this.tensorMap.set(s,{dtype:o,shape:t,values:null,refCount:1,external:e.zeroCopy});let a=this.tensorMap.get(s),i=sx(a.dtype)*y.sizeFromShape(a.shape);if(e.buffer.sizey.decodeString(n));return ie(e.shape,e.dtype,o)}catch(o){throw new Error(\"Failed to decode encoded string bytes into utf-8\")}return ie(e.shape,e.dtype,t)}async time(e){!this.supportTimestampQuery&&!this.hasTimestampQueryWarned&&(console.warn(\"This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled.\"),this.hasTimestampQueryWarned=!0);let t=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,e();let s=y.flatten(this.activeTimers.map(u=>u.query)).filter(u=>u!=null),a=y.flatten(this.activeTimers.map(u=>u.name)).filter(u=>u!=null);this.activeTimers=t,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},p=await Promise.all(s);return i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,l)=>({name:a[l],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(\", \"),this.uploadWaitMs=0,this.downloadWaitMs=0,i}makeTensorInfo(e,t,o){return t===\"string\"&&o!=null&&o.length>0&&y.isString(o[0])&&(o=o.map(s=>y.encodeString(s))),{dataId:this.write(o,e,t),shape:e,dtype:t}}tensorToBinding(e){if(!e)return null;let o=this.tensorMap.get(e.dataId).resource;return o instanceof GPUBuffer?{buffer:o}:o instanceof GPUTexture?o.createView():o}uploadToGPU(e){let t=this.tensorMap.get(e);if(t.resource!=null)return;let o=sx(t.dtype)*y.sizeFromShape(t.shape),n,s=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;if(t.values){if(n=this.bufferManager.acquireBuffer(o,s,!0),n.mapState===\"unmapped\"){let a=this.bufferManager.acquireBuffer(o,GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC,!0,!1),i=a.getMappedRange();t.dtype===\"int32\"||t.dtype===\"bool\"?new Int32Array(i).set(t.values):new Float32Array(i).set(t.values),a.unmap(),this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(a,0,n,0,o),this.stagingPendingDisposal.push(a)}else{let a=n.getMappedRange();t.dtype===\"int32\"||t.dtype===\"bool\"?new Int32Array(a).set(t.values):new Float32Array(a).set(t.values),n.unmap()}t.values=null}else n=this.bufferManager.acquireBuffer(o,s);t.resource=n}makeUniforms(e){let t=0,o=0,n=[],s=1;e.forEach(p=>{p.data.length===0&&(p.data=[1]);let u;switch(p.data.length){case 1:u=4;break;case 2:u=8;break;case 3:u=16;break;case 4:u=16;break;case 5:u=16;break;case 6:u=16;break;default:y.assert(!1,()=>`Unsupported ${p.data.length}D shape`)}(o===5||o===6)&&(u=16),u>s&&(s=u),t=Math.ceil(t/u)*u,o=p.data.length,n.push(t),t+=p.data.length*4}),t=Math.ceil(t/s)*s;let a=new ArrayBuffer(t);e.forEach((p,u)=>{let l=n[u];p.type===\"int32\"?new Int32Array(a,l,p.data.length).set(p.data):p.type===\"uint32\"?new Uint32Array(a,l,p.data.length).set(p.data):new Float32Array(a,l,p.data.length).set(p.data)});let i=this.bufferManager.acquireBuffer(t,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);return this.queue.writeBuffer(i,0,a,0,t),this.uniformPendingDisposal.push(i),{offset:0,size:t,buffer:i}}runWebGPUProgram(e,t,o,n,s){if(s||(s=this.makeTensorInfo(e.outputShape,o)),y.sizeFromShape(s.shape)===0)return this.tensorMap.get(s.dataId).values=y.getTypedArrayFromDType(s.dtype,0),s;this.uploadToGPU(s.dataId),e.dispatch=Vie(this.device,e);let a=t.map((p,u)=>{if(p.dtype===\"complex64\")throw new Error(\"GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.\");return this.uploadToGPU(p.dataId),{dtype:this.tensorMap.get(p.dataId).dtype,shape:p.shape,name:e.variableNames[u]}});e.shaderKey=Uz(e,a,s);let i=A().getBool(\"WEBGPU_ENGINE_COMPILE_ONLY\");return e.shaderKey in this.pipelineCache||(this.pipelineCache[e.shaderKey]=Wz(this.device,e,a,s,i)),e.pipeline=this.pipelineCache[e.shaderKey],i||this.recordAndSubmit(e,s,t,n),s}recordAndSubmit(e,t,o,n){if(e.pipeline instanceof Promise)throw new Error(\"Please call checkCompileCompletionAsync to ensure parallel compilation is done!\");let s=[],a=[],i=\"int32\";if(e.pixelsOpType==null){s.push({type:\"float32\",data:[NaN]},{type:\"float32\",data:[1/0]}),a=o.concat(t).map(d=>d.shape);let m=\"int32\";a.map(d=>{s.push({type:m,data:d});let f=y.computeStrides(d);s.push({type:m,data:f})})}else{let m=y.computeStrides(t.shape);s.push({type:i,data:m})}if(e.size){let m=y.sizeFromShape(e.outputShape);s.push({type:i,data:[e.outputComponent?m/e.outputComponent:m]})}n&&(s=[...s,...n]);let p=[this.tensorToBinding(t),...o.map(m=>this.tensorToBinding(m)),this.makeUniforms(s)];o.forEach(m=>{this.commandQueueOwnedIds.add(m.dataId)}),this.commandQueueOwnedIds.add(t.dataId);let u=this.device.createBindGroup({layout:e.pipeline.getBindGroupLayout(0),entries:p.map((m,d)=>({binding:d,resource:m}))}),l=this.activeTimers!=null;this.ensureCommandEncoderReady();let c={};l&&this.supportTimestampQuery?(this.endComputePassEncoder(),this.querySet==null&&(this.querySet=this.device.createQuerySet({type:\"timestamp\",count:this.querySetCount})),c.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1},this.computePassEncoder=this.commandEncoder.beginComputePass(c)):this.computePassEncoder||(this.computePassEncoder=this.commandEncoder.beginComputePass(c)),this.computePassEncoder.setPipeline(e.pipeline),this.computePassEncoder.setBindGroup(0,u),this.computePassEncoder.dispatchWorkgroups(e.dispatch[0],e.dispatch[1],e.dispatch[2]),this.dispatchCountInPass++,(l||A().get(\"WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE\")<=this.dispatchCountInPass||e.pixelsOpType===$i.DRAW)&&(this.endComputePassEncoder(),l?this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime()}):this.submitQueue())}async getQueryTime(){if(!this.supportTimestampQuery)return 0;this.queryResolveBuffer==null&&(this.queryResolveBuffer=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST|GPUBufferUsage.QUERY_RESOLVE)),this.commandEncoder.resolveQuerySet(this.querySet,0,this.querySetCount,this.queryResolveBuffer,0);let e=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.querySetCount*8),this.submitQueue(),await e.mapAsync(GPUMapMode.READ);let t=new BigUint64Array(e.getMappedRange()),o=Number(t[1]-t[0])/1e6;return e.unmap(),this.bufferManager.releaseBuffer(e),o}shouldExecuteOnCPU(e,t=zie){return A().getBool(\"WEBGPU_CPU_FORWARD\")&&e.every(o=>this.tensorMap.get(o.dataId).resource==null&&y.sizeFromShape(o.shape){let r={powerPreference:A().get(\"WEBGPU_USE_LOW_POWER_GPU\")?\"low-power\":\"high-performance\"},e=await navigator.gpu.requestAdapter(r),t={},o=[];e.features.has(\"timestamp-query\")&&o.push(\"timestamp-query\"),e.features.has(\"bgra8unorm-storage\")&&o.push([\"bgra8unorm-storage\"]),t.requiredFeatures=o;let n=e.limits;t.requiredLimits={maxComputeWorkgroupStorageSize:n.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:n.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:n.maxStorageBufferBindingSize,maxBufferSize:n.maxBufferSize,maxComputeWorkgroupSizeX:n.maxComputeWorkgroupSizeX,maxComputeInvocationsPerWorkgroup:n.maxComputeInvocationsPerWorkgroup};let s=await e.requestDevice(t),a=await e.requestAdapterInfo();return new Jl(s,a)},3);var fe;(function(r){r[r.ADD=0]=\"ADD\",r[r.ATAN2=1]=\"ATAN2\",r[r.COMPLEX_MULTIPLY_IMAG=2]=\"COMPLEX_MULTIPLY_IMAG\",r[r.COMPLEX_MULTIPLY_REAL=3]=\"COMPLEX_MULTIPLY_REAL\",r[r.DIV=4]=\"DIV\",r[r.ELU_DER=5]=\"ELU_DER\",r[r.EQUAL=6]=\"EQUAL\",r[r.FLOOR_DIV=7]=\"FLOOR_DIV\",r[r.GREATER=8]=\"GREATER\",r[r.GREATER_EQUAL=9]=\"GREATER_EQUAL\",r[r.LESS=10]=\"LESS\",r[r.LESS_EQUAL=11]=\"LESS_EQUAL\",r[r.LOGICAL_AND=12]=\"LOGICAL_AND\",r[r.LOGICAL_OR=13]=\"LOGICAL_OR\",r[r.MAX=14]=\"MAX\",r[r.MIN=15]=\"MIN\",r[r.MOD=16]=\"MOD\",r[r.MUL=17]=\"MUL\",r[r.NOT_EQUAL=18]=\"NOT_EQUAL\",r[r.POW=19]=\"POW\",r[r.PRELU=20]=\"PRELU\",r[r.SQUARED_DIFFERENCE=21]=\"SQUARED_DIFFERENCE\",r[r.SUB=22]=\"SUB\"})(fe||(fe={}));var Wie=\"let resultTemp = a + b;\",Uie=\"let resultTemp = atan2(a, b);\",Gie=\"let resultTemp = areal * breal - aimag * bimag;\",Hie=\"let resultTemp = areal * bimag + aimag * breal;\",Kie=\"let resultTemp = a / b;\",qie=\"let resultTemp = select(a * (b + 1.0), a, b >= b - b);\",jie=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a == b);\n`,Xie=`\n let remainder =\n select(a % b, round(a % b), (round(a) == a) & (round(b) == b));\n let quotient = (a - remainder) / b;\n let resultTemp =\n round(select(quotient, quotient - 1, sign(remainder) == -sign(b)));\n`,Yie=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a > b);\n`,Qie=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a >= b);\n`,Zie=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a < b);\n`,Jie=`\n let zero = sign(a) * 0 + 0;\n let one = sign(b) * 0 + 1;\n let resultTemp = select(zero, one, a <= b);\n`,eue=\"return f32(a >= 1.0 && b >= 1.0);\",tue=`return (vec4(a >= vec4(1.0)) *\n vec4(b >= vec4(1.0)));`,rue=\"return f32(a >= 1.0 || b >= 1.0);\",oue=`return min(vec4(a >= vec4(1.0)) +\n vec4(b >= vec4(1.0)), vec4(1.0));`,nue=\"let resultTemp = max(a, b);\",sue=\"let resultTemp = min(a, b);\",aue=`\n let isNaN = b == 0.;\n var resultTemp = a % b;\n resultTemp = select((resultTemp + b) % b, resultTemp,\n (a < 0. && b < 0.) || (a >= 0. && b > 0.));\n`,iue=`\n let isNaN = !vec4(b);\n var resultTemp = vec4(a % b);\n if (!((a[0] < 0. && b[0] < 0.) || (a[0] >= 0. && b[0] > 0.))) {\n resultTemp[0] = (resultTemp[0] + b[0]) % b[0];\n }\n if (!((a[1] < 0. && b[1] < 0.) || (a[1] >= 0. && b[1] > 0.))) {\n resultTemp[1] = (resultTemp[1] + b[1]) % b[1];\n }\n if (!((a[2] < 0. && b[2] < 0.) || (a[2] >= 0. && b[2] > 0.))) {\n resultTemp[2] = (resultTemp[2] + b[2]) % b[2];\n }\n if (!((a[3] < 0. && b[3] < 0.) || (a[3] >= 0. && b[3] > 0.))) {\n resultTemp[3] = (resultTemp[3] + b[3]) % b[3];\n }\n`,uue=\"let resultTemp = a * b;\",pue=`\n var resultTemp = f32(a != b);\n let valueForNaN = 1.0;\n`,lue=`\n var resultTemp = vec4(a != b);\n let valueForNaN = 1.0;\n`,cue=`\n let isNaN = a < 0.0 && floor(b) < b;\n if (b == 0.0) {\n return 1.0;\n }\n var resultTemp = select(sign(a) * pow(abs(a), b), pow(abs(a), b),\n round(abs(b) % 2.0) != 1.0);\n`,mue=`\n let isModRound1Bool = vec4(round(abs(b) % vec4(2.0))) == vec4(1);\n let isModRound1 = vec4(isModRound1Bool);\n let multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1);\n var resultTemp = multiplier * pow(abs(a), b);\n\n // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS\n let isExpZero = b == vec4(0.0);\n if (isExpZero.r) {\n resultTemp.r = 1.0;\n }\n if (isExpZero.g) {\n resultTemp.g = 1.0;\n }\n if (isExpZero.b) {\n resultTemp.b = 1.0;\n }\n if (isExpZero.a) {\n resultTemp.a = 1.0;\n }\n let isNaN = (a < vec4(0.0)) & (floor(b) < b);\n`,due=\"if (a < 0.0) { return b * a; } return a;\",fue=`\n let aLessThanZero = vec4(a < vec4(0.0));\n return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`,hue=\"let resultTemp = (a - b) * (a - b);\",gue=\"let resultTemp = a - b;\";function ec(r,e){let t;do{switch(r){case fe.ATAN2:t=Uie;break;case fe.MAX:t=nue;break;case fe.MIN:t=sue;break;case fe.MOD:t=e?iue:aue;break;case fe.NOT_EQUAL:t=e?lue:pue;break;case fe.POW:t=e?mue:cue;break;default:continue}let o,n,s;return e?(o=\"isnanVec4\",n=\"vec4\",s=\"vec4\"):(o=\"isnan\",n=\"f32\",s=\"bool\"),`\n let aIsNaN = ${o}(a);\n let aPostLegalization = select(a, ${n}(42), aIsNaN);\n let bIsNaN = ${o}(b);\n let bPostLegalization = select(b, ${n}(42), bIsNaN);\n let isNaN = false;\n let valueForNaN = uniforms.NAN;\n {\n let a = aPostLegalization;\n let b = bPostLegalization;\n ${t}\n return select(\n resultTemp, ${n}(valueForNaN),\n ${s}(isNaN) | aIsNaN | bIsNaN);\n }\n `}while(!1);switch(r){case fe.ADD:t=Wie;break;case fe.COMPLEX_MULTIPLY_IMAG:t=Hie;break;case fe.COMPLEX_MULTIPLY_REAL:t=Gie;break;case fe.DIV:t=Kie;break;case fe.ELU_DER:t=qie;break;case fe.EQUAL:t=jie;break;case fe.FLOOR_DIV:t=Xie;break;case fe.GREATER:t=Yie;break;case fe.GREATER_EQUAL:t=Qie;break;case fe.LESS:t=Zie;break;case fe.LESS_EQUAL:t=Jie;break;case fe.LOGICAL_AND:return e?tue:eue;case fe.LOGICAL_OR:return e?oue:rue;case fe.MUL:t=uue;break;case fe.PRELU:return e?fue:due;case fe.SQUARED_DIFFERENCE:t=hue;break;case fe.SUB:t=gue;break;default:}return`\n ${t}\n return resultTemp;\n `}var Z;(function(r){r[r.ABS=0]=\"ABS\",r[r.ACOS=1]=\"ACOS\",r[r.ACOSH=2]=\"ACOSH\",r[r.ASIN=3]=\"ASIN\",r[r.ASINH=4]=\"ASINH\",r[r.ATAN=5]=\"ATAN\",r[r.ATANH=6]=\"ATANH\",r[r.CEIL=7]=\"CEIL\",r[r.COS=8]=\"COS\",r[r.COSH=9]=\"COSH\",r[r.ELU=10]=\"ELU\",r[r.ERF=11]=\"ERF\",r[r.EXP=12]=\"EXP\",r[r.EXPM1=13]=\"EXPM1\",r[r.FLOOR=14]=\"FLOOR\",r[r.IS_FINITE=15]=\"IS_FINITE\",r[r.IS_INF=16]=\"IS_INF\",r[r.IS_NAN=17]=\"IS_NAN\",r[r.LINEAR=18]=\"LINEAR\",r[r.LOG=19]=\"LOG\",r[r.LOG1P=20]=\"LOG1P\",r[r.LOGICAL_NOT=21]=\"LOGICAL_NOT\",r[r.NEG=22]=\"NEG\",r[r.RELU=23]=\"RELU\",r[r.RELU6=24]=\"RELU6\",r[r.LEAKYRELU=25]=\"LEAKYRELU\",r[r.RECIPROCAL=26]=\"RECIPROCAL\",r[r.ROUND=27]=\"ROUND\",r[r.RSQRT=28]=\"RSQRT\",r[r.SELU=29]=\"SELU\",r[r.SIGMOID=30]=\"SIGMOID\",r[r.SIGN=31]=\"SIGN\",r[r.SIN=32]=\"SIN\",r[r.SINH=33]=\"SINH\",r[r.SOFTPLUS=34]=\"SOFTPLUS\",r[r.SQRT=35]=\"SQRT\",r[r.SQUARE=36]=\"SQUARE\",r[r.STEP=37]=\"STEP\",r[r.TAN=38]=\"TAN\",r[r.TANH=39]=\"TANH\",r[r.TO_INT=40]=\"TO_INT\"})(Z||(Z={}));var xue=\"return abs(a);\",yue=`\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n return acos(a);\n`,bue=`\n if (a < 1.) {\n return uniforms.NAN;\n }\n return acosh(a);\n`,Cue=`\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n return asin(a);\n`,wue=\"return asinh(a);\",Sue=`\n if (isnan(a)) {\n return uniforms.NAN;\n }\n return atan(a);\n`,Iue=`\n if (abs(a) > 1.) {\n return uniforms.NAN;\n }\n if (a == 1.) {\n return uniforms.INFINITY;\n }\n if (a == -1.) {\n return -uniforms.INFINITY;\n }\n return atanh(a);\n`,vue=\"return ceil(a);\",kue=\"return cos(a);\",Nue=`\n let e2x = exp(-a);\n return (e2x + 1.0 / e2x) / 2.0;\n`,Tue=\"return exp(a) - 1.0;\",_ue=\"if (a >= 0.0) { return a; } return (exp(a) - 1.0);\",Eue=`\n var resFloat = exp(a) - vec4(1.0);\n if (a.r >= 0.0) {\n resFloat.r = a.r;\n }\n if (a.g >= 0.0) {\n resFloat.g = a.g;\n }\n if (a.b >= 0.0) {\n resFloat.b = a.b;\n }\n if (a.a >= 0.0) {\n resFloat.a = a.a;\n }\n return resFloat;\n`,$ue=`\n // Error function is calculated approximately with elementary function.\n // See \"Handbook of Mathematical Functions with Formulas,\n // Graphs, and Mathematical Tables\", Abramowitz and Stegun.\n let p = ${C.ERF_P};\n let a1 = ${C.ERF_A1};\n let a2 = ${C.ERF_A2};\n let a3 = ${C.ERF_A3};\n let a4 = ${C.ERF_A4};\n let a5 = ${C.ERF_A5};\n\n let sign = sign(a);\n let absA = abs(a);\n let t = 1.0 / (1.0 + p * absA);\n return sign * (1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * exp(-absA * absA));\n`,Rue=\"return exp(a);\",Due=\"return floor(a);\",Aue=\"return f32(!isnan(a) && !isinf(a));\",Fue=\"return f32(isinf(a));\",Pue=\"return f32(isnan(a));\",Oue=\"return a;\",Mue=`if (a < 0.0) { return uniforms.NAN; }\n return log(a);`,Lue=`\n if (isnan(a)) { return a; }\n return log(1.0 + a);\n`,Bue=\"return f32(!(a >= 1.0));\",zue=\"return -a;\",Vue=\"if (a < 0.0) { return uniforms.alpha * a; } return a;\",Wue=`\n let aLessThanZero = vec4(a < vec4(0.0));\n return (aLessThanZero * (uniforms.alpha * a)) + ((vec4(1.0) - aLessThanZero) * a);\n`,Uue=\"return 1.0 / a;\",Gue=\"return select(a, 0.0, a < 0.0);\",Hue=\"return clamp(a, 0.0, 6.0);\",Kue=\"return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));\",que=`\n return select(a, vec4(0.0), a < vec4(0.0));\n`,jue=\"return round(a);\",Xue=\"return inverseSqrt(a);\",Yue=`\n if (a >= 0.0) {\n return ${C.SELU_SCALE} * a;\n } else {\n return ${C.SELU_SCALEALPHA} * (exp(a) - 1.0);\n }\n`,Que=\"return 1.0 / (1.0 + exp(-1.0 * a));\",Zue=\"return sign(a);\",Jue=\"return sin(a);\",epe=`\n let e2x = exp(a);\n return (e2x - 1.0 / e2x) / 2.0;\n`,tpe=`\n let epsilon = 1.1920928955078125e-7;\n let threshold = log(epsilon) + 2.0;\n\n let too_large = a > -threshold;\n let too_small = a < threshold;\n let exp_a = exp(a);\n\n if (too_large) {\n return a;\n } else if (too_small) {\n return exp_a;\n } else {\n return log(exp_a + 1.0);\n }\n`,rpe=\"return sqrt(a);\",ope=\"return a * a;\",npe=`\n if (isnan(a)) {\n return a;\n }\n\n return select(uniforms.stepAlpha, 1.0, a > 0.0);\n`,spe=\"return tan(a);\",ape=`\n let e2x = exp(-2.0 * abs(a));\n return sign(a) * (1.0 - e2x) / (1.0 + e2x);\n`,ipe=\"return f32(i32((a)));\";function Ri(r,e){switch(r){case Z.ABS:return xue;case Z.ACOS:return yue;case Z.ACOSH:return bue;case Z.ASIN:return Cue;case Z.ASINH:return wue;case Z.ATAN:return Sue;case Z.ATANH:return Iue;case Z.COS:return kue;case Z.COSH:return Nue;case Z.CEIL:return vue;case Z.ELU:return e?Eue:_ue;case Z.ERF:return $ue;case Z.EXP:return Rue;case Z.EXPM1:return Tue;case Z.FLOOR:return Due;case Z.IS_FINITE:return Aue;case Z.IS_INF:return Fue;case Z.IS_NAN:return Pue;case Z.LINEAR:return Oue;case Z.LOG:return Mue;case Z.LOG1P:return Lue;case Z.LOGICAL_NOT:return Bue;case Z.NEG:return zue;case Z.LEAKYRELU:return e?Wue:Vue;case Z.RECIPROCAL:return Uue;case Z.RELU:return e?que:Gue;case Z.RELU6:return e?Kue:Hue;case Z.ROUND:return jue;case Z.RSQRT:return Xue;case Z.SELU:return Yue;case Z.SIGMOID:return Que;case Z.SIGN:return Zue;case Z.SIN:return Jue;case Z.SINH:return epe;case Z.SOFTPLUS:return tpe;case Z.SQRT:return rpe;case Z.SQUARE:return ope;case Z.STEP:return npe;case Z.TAN:return spe;case Z.TANH:return ape;case Z.TO_INT:return ipe;default:throw new Error(`BinaryType ${r} is not implemented!`)}}function gr(r,e=!1,t=!1,o=3){if(r===null)return\"\";let n=\"\";if(r===\"linear\")n=Ri(Z.LINEAR);else if(r===\"relu\")n=Ri(Z.RELU,t);else if(r===\"elu\")n=Ri(Z.ELU,t);else if(r===\"relu6\")n=Ri(Z.RELU6,t);else if(r===\"prelu\")n=ec(fe.PRELU,t);else if(r===\"sigmoid\")n=Ri(Z.SIGMOID,t);else if(r===\"leakyrelu\")n=Ri(Z.LEAKYRELU,t);else throw new Error(`Activation ${r} has not been implemented for the WebGPU backend.`);let a=Ae(t?4:1),i=\"\";return e?i=`\n fn activation(a : ${a}, coords : vec${o}) -> ${a} {\n let b = getPreluActivationWeightsByOutputCoords(coords);\n ${n}\n }`:i=`\n fn activation(a : ${a}, coords : vec${o}) -> ${a} {\n ${n}\n }`,i}function no(r,e){return`\n ${r?\"value = value + getBiasByOutputCoords(coords);\":\"\"}\n ${e?\"value = activation(value, coords);\":\"\"}\n `}function mv(r,e,t=!1,o=!1,n=!1,s=1){y.assert(r&&s===1||!r,()=>`transposeA ${r} is not compatible with component size ${s}`);let a=`\n ${r?\"value = getA(batch, col, row);\":\"value = getA(batch, row, col);\"}\n\n `,i=e?\"value = getB(batch, col, row);\":\"value = getB(batch, row, col);\";return`\n fn mm_readA(batch: i32, row: i32, col: i32) -> ${Ae(s)} {\n var value = ${Ae(s)}(0.0);\n ${t&&n?a:`\n ${r?\"if(row < uniforms.dimAOuter && col < uniforms.dimInner)\":\"if(row < uniforms.aShape[1] && col < uniforms.aShape[2])\"}\n {\n ${a}\n }\n `}\n return value;\n }\n\n fn mm_readB(batch: i32, row: i32, col: i32) -> ${Ae(s)} {\n var value = ${Ae(s)}(0.0);\n ${i}\n return value;\n }\n `}function Sm(r,e,t,o,n=!1,s=!1,a=!1,i=1){return`\n ${mv(t,o,n,s,a,i)}\n fn mm_write(batch: i32, row: i32, col: i32, valueIn: ${Ae(i)}) {\n ${n&&s?\"\":\"if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)\"}\n {\n var value = valueIn;\n let coords = vec3(batch, row, col);\n ${no(r,e)}\n setOutputAtCoords(coords[0], coords[1], coords[2], value);\n }\n }\n `}var upe=(r,e)=>r?`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n kStart + inputRow,\n globalRowStart + inputCol * ${e});\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n globalRow + innerRow,\n kStart + inputCol * ${e});\n `,ppe=(r,e,t,o)=>{if(r)return`\n for (var k = 0; k < ${o}; k++) {\n let BCached0 = mm_Bsub[k][tileCol];\n let ACached0 = mm_Asub[k][localRow];\n for (var i = 0; i < ${t}; i++) {\n acc[i] = fma(BCached0, vec4(ACached0[i]), acc[i]);\n }\n }`;{let n=\"\",s=\"\";for(let a=0;a(ACached[${a}]), acc[i]);`;return`\n for (var k = 0; k < ${o/e}; k++) {\n ${n}\n for (var i = 0; i < ${t}; i++) {\n let ACached = mm_Asub[tileRow + i][k];\n ${s}\n }\n }`}};function Fp(r,e,t=!1,o=32,n=!1,s=32,a=!1){let i=e[1]*r[1],p=e[0]*r[0],u=t?i:o,l=t?o:i,c=u/e[0],m=o/e[1],d=r[1],f=r[0];return y.assert((t&&c===4&&r[1]===4||!t&&(c===3||c===4))&&u%e[0]===0&&o%e[1]===0&&r[0]===4,()=>`If transposeA ${t} is true, innerElementSize ${c} and workPerThread[1] ${r[1]} must be 4.\n Otherwise, innerElementSize ${c} must be 3 or 4.\n tileAWidth ${u} must be divisible by workgroupSize[0]${e[0]}. tileInner ${o} must be divisible by workgroupSize[1] ${e[1]}. colPerThread ${r[0]} must be 4.`),`\n var mm_Asub : array, ${u/c}>, ${l}>;\n var mm_Bsub : array, ${p/r[0]}>, ${o}>;\n\n ${G()} {\n let localRow = i32(localId.y);\n let tileRow = localRow * ${d};\n let tileCol = i32(localId.x);\n\n let globalRow = i32(globalId.y) * ${d};\n let globalCol = i32(globalId.x) * ${f};\n let batch = ${n?\"0\":\"i32(globalId.z)\"};\n let batchA = ${n||!a?\"batch\":\"batch % uniforms.aShape[0]\"};\n let batchB = ${n||!a?\"batch\":\"batch % uniforms.bShape[0]\"};\n let globalRowStart = i32(workgroupId.y) * ${i};\n\n let numTiles = ${n?`${Math.ceil(s/o)}`:`(uniforms.dimInner - 1) / ${o} + 1`};\n var kStart = ${n?`i32(globalId.z) * ${s}`:\"0\"};\n\n var acc: array, ${d}>;\n\n // Loop over shared dimension.\n let tileRowB = localRow * ${m};\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${d}; innerRow++) {\n let inputRow = tileRow + innerRow;\n let inputCol = tileCol;\n ${upe(t,c)}\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${m}; innerRow++) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB, kStart + inputRow, globalCol);\n }\n kStart = kStart + ${o};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n ${ppe(t,c,d,o)}\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < ${d}; innerRow++) {\n mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]);\n }\n }`}var Hz=r=>r?`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n kStart + inputRow,\n globalRowStart + inputCol);\n `:`\n mm_Asub[inputRow][inputCol] = mm_readA(batchA,\n globalRowStart + inputRow,\n kStart + inputCol);\n `,lpe=r=>r?\"let ACached = mm_Asub[k][tileRow + innerRow];\":\"let ACached = mm_Asub[tileRow + innerRow][k];\";function Pp(r,e,t=!1,o=32,n=!1,s=32,a=!1,i=!1){let p=r[1]*e[1],u=r[0]*e[0],l=t?p:o,c=t?o:p;y.assert(c%e[1]===0&&l%e[0]===0&&o%e[1]===0,()=>`tileAHight ${c} must be divisible by workgroupSize[1]${e[1]}, tileAWidth ${l} must be divisible by workgroupSize[0]${e[0]}, tileInner ${o} must be divisible by workgroupSize[1]${e[1]}`);let m=c/e[1],d=l/e[0],f=o/e[1],h=r[1],g=r[0],x=a?`\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n let globalRowStart = i32(workgroupId.y) * ${p};\n let globalColStart = i32(workgroupId.x) * ${u};\n\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var inputRow = localRow; inputRow < ${c}; inputRow = inputRow + ${e[1]}) {\n for (var inputCol = localCol; inputCol < ${l}; inputCol = inputCol + ${e[0]}) {\n ${Hz(t)}\n }\n }\n // Load one tile of B into local memory.\n for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${e[1]}) {\n for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${e[0]}) {\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB,\n kStart + inputRow,\n globalColStart + inputCol);\n }\n }\n kStart = kStart + ${o};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array;\n for (var k = 0; k < ${o}; k++) {\n for (var inner = 0; inner < ${g}; inner++) {\n BCached[inner] = mm_Bsub[k][localCol + inner * ${e[0]}];\n }\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n let ACached = ${t?`mm_Asub[k][localRow + innerRow * ${e[1]}];`:`mm_Asub[localRow + innerRow * ${e[1]}][k];`}\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n acc[innerRow][innerCol] =\n fma(ACached, BCached[innerCol], acc[innerRow][innerCol]);\n }\n }\n }\n workgroupBarrier();\n }\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n let gRow = globalRowStart + localRow + innerRow * ${e[1]};\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n let gCol = globalColStart + localCol + innerCol * ${e[0]};\n mm_write(batch, gRow, gCol, acc[innerRow][innerCol]);\n }\n }\n `:`\n let tileRow = i32(localId.y) * ${h};\n let tileCol = i32(localId.x) * ${g};\n\n let globalRow = i32(globalId.y) * ${h};\n let globalCol = i32(globalId.x) * ${g};\n let globalRowStart = i32(workgroupId.y) * ${p};\n\n let tileRowA = i32(localId.y) * ${m};\n let tileColA = i32(localId.x) * ${d};\n let tileRowB = i32(localId.y) * ${f};\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n for (var innerRow = 0; innerRow < ${m}; innerRow++) {\n for (var innerCol = 0; innerCol < ${d}; innerCol++) {\n let inputRow = tileRowA + innerRow;\n let inputCol = tileColA + innerCol;\n ${Hz(t)}\n }\n }\n\n // Load one tile of B into local memory.\n for (var innerRow = 0; innerRow < ${f}; innerRow++) {\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n let inputRow = tileRowB + innerRow;\n let inputCol = tileCol + innerCol;\n mm_Bsub[inputRow][inputCol] = mm_readB(batchB,\n kStart + inputRow,\n globalCol + innerCol);\n }\n }\n kStart = kStart + ${o};\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n var BCached : array;\n for (var k = 0; k < ${o}; k++) {\n for (var inner = 0; inner < ${g}; inner++) {\n BCached[inner] = mm_Bsub[k][tileCol + inner];\n }\n\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n ${lpe(t)}\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n acc[innerRow][innerCol] =\n fma(ACached, BCached[innerCol], acc[innerRow][innerCol]);\n }\n }\n }\n\n workgroupBarrier();\n }\n\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n mm_write(batch, globalRow + innerRow, globalCol + innerCol,\n acc[innerRow][innerCol]);\n }\n }\n `;return`\n var mm_Asub : array, ${c}>;\n var mm_Bsub : array, ${o}>;\n\n ${G()} {\n let batch = ${n?\"0\":\"i32(globalId.z)\"};\n let batchA = ${n||!i?\"batch\":\"batch % uniforms.aShape[0]\"};\n let batchB = ${n||!i?\"batch\":\"batch % uniforms.bShape[0]\"};\n let numTiles = ${n?`${Math.ceil(s/o)}`:`(uniforms.dimInner - 1) / ${o} + 1`};\n var kStart = ${n?`i32(globalId.z) * ${s}`:\"0\"};\n\n var acc : array, ${h}>;\n\n // Without this initialization strange values show up in acc.\n for (var innerRow = 0; innerRow < ${h}; innerRow++) {\n for (var innerCol = 0; innerCol < ${g}; innerCol++) {\n acc[innerRow][innerCol] = 0.0;\n }\n }\n ${x}\n }\n `}var cpe=r=>r?`\n mm_readA(batchA, colA, globalRow),\n mm_readA(batchA, colA + 1, globalRow),\n mm_readA(batchA, colA + 2, globalRow),\n mm_readA(batchA, colA + 3, globalRow)\n `:`\n mm_readA(batchA, globalRow, colA),\n mm_readA(batchA, globalRow, colA + 1),\n mm_readA(batchA, globalRow, colA + 2),\n mm_readA(batchA, globalRow, colA + 3)\n `;function mpe(r,e=!1){y.assert(r[1]===1&&r[2]===1,()=>`A linear work group size is required. But got ${r}.`);let t=r[0]*4;return`\n var mm_Asub : array, ${r[0]}>;\n\n ${G()} {\n let tileCol = i32(localId.x);\n let globalCol = i32(globalId.x);\n let globalRow = i32(globalId.y);\n\n let numTiles = (uniforms.dimInner - 1) / ${t} + 1;\n let batch = i32(globalId.z);\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n // Without this initialization strange values show up in acc.\n var acc = 0.0;\n\n // Loop over shared dimension.\n for (var t = 0; t < numTiles; t++) {\n // Load one tile of A into local memory.\n let colA = t * ${t} + tileCol * 4;\n mm_Asub[tileCol] = vec4(${cpe(e)});\n workgroupBarrier();\n\n // Compute acc values for a single thread.\n for (var k = 0; k < ${t/4}; k++) {\n let rowB = t * ${t} + k * 4;\n let BCached = vec4(mm_readB(batchB, rowB, globalCol),\n mm_readB(batchB, rowB + 1, globalCol),\n mm_readB(batchB, rowB + 2, globalCol),\n mm_readB(batchB, rowB + 3, globalCol));\n\n let ACached = mm_Asub[k];\n acc = acc + dot(ACached, BCached);\n }\n\n workgroupBarrier();\n }\n\n mm_write(batch, globalRow, globalCol, acc);\n }\n `}var ax=class{constructor(e,t,o=!1,n=!1,s=null,a=null,i=null,p=!1){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.outputShape=t,this.dispatchLayout={x:[2],y:[1],z:[0]};let u=o?e[1]:e[2];if(this.isVec4=(u%4===0&&!o||t[1]%4===0&&o)&&t[2]%4===0&&!n,this.outputComponent=this.isVec4?4:1,this.isVectorA=t[1]===1&&!o,!this.isVec4&&this.isVectorA)this.elementsPerThread=[1,1,1],this.workgroupSize=[32,1,1];else{let m=lv(t[1],u,t[2],o);this.workgroupSize=m.workgroupSize,this.elementsPerThread=m.elementsPerThread}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread);let l=s!=null,c=i!=null;l&&this.variableNames.push(\"bias\"),c&&this.variableNames.push(\"preluActivationWeights\"),this.sequentialAccessByThreads=p,this.transposeA=o,this.transposeB=n,this.addBias=l,this.activation=a,this.hasPreluActivationWeights=c,[this.fitAOuter,this.fitBOuter,this.fitInner]=this.getShapeFit(t[1],t[2],u),this.shaderKey=`matMulPacked_${this.elementsPerThread}_${o}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`}getShapeFit(e,t,o){let n=this.workgroupSize[1]*this.elementsPerThread[1],s=this.workgroupSize[0]*this.elementsPerThread[0];!this.isVec4&&this.isVectorA?this.tileInner=this.workgroupSize[0]*4:this.tileInner=s;let a=e%n===0,i=t%s===0,p=o%this.tileInner===0;return[a,i,p]}getUserCode(){return`\n ${gr(this.activation,this.hasPreluActivationWeights,this.isVec4)}\n ${Sm(this.addBias,this.activation,!1,this.transposeB,this.fitAOuter,this.fitBOuter,this.fitInner,this.isVec4?4:1)}\n ${this.isVec4?Fp(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,!0):this.isVectorA?mpe(this.workgroupSize,this.transposeA):Pp(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,this.sequentialAccessByThreads,!0)}\n `}};function dpe(r){return`\n var sumValues : array;\n ${G()} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n let row = coords[1];\n let col = coords[2];\n var sum = 0.0;\n let Length = uniforms.dimInner;\n for (var k = i32(localId.x); k < Length; k = k + ${r}) {\n let dataA = mm_readA(batchA, row, k);\n let dataB = mm_readB(batchB, k, col);\n sum = sum + dataA * dataB;\n }\n sumValues[localId.x] = sum;\n workgroupBarrier();\n\n for(var currentSize = ${r/2}u; currentSize > 1u;\n currentSize = currentSize / 2u) {\n if (localId.x < currentSize)\n {\n sumValues[localId.x] = sumValues[localId.x] + sumValues[localId.x + currentSize];\n }\n workgroupBarrier();\n }\n\n if (localId.x == 0u) {\n sum = sumValues[0] + sumValues[1];\n mm_write(batch, row, col, sum);\n }\n }\n `}var ix=class{constructor(e,t=!1,o=!1,n=null,s=null,a=null){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout={x:[],y:[1,2],z:[0]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize);let i=n!=null,p=a!=null;i&&this.variableNames.push(\"bias\"),p&&this.variableNames.push(\"preluActivationWeights\"),this.transposeA=t,this.transposeB=o,this.addBias=i,this.activation=s,this.hasPreluActivationWeights=p,this.shaderKey=`matMulReduce_${this.activation}_${t}_${o}`}getUserCode(){return`\n ${gr(this.activation,this.hasPreluActivationWeights)}\n ${Sm(this.addBias,this.activation,this.transposeA,this.transposeB)}\n ${dpe(this.workgroupSize[0])}\n `}};function fpe(r){let e=r[1],t=r[0],o=e>t?e:t;return`\n var mm_Asub : array, ${e}>;\n var mm_Bsub : array, ${o}>;\n\n // If the output size is small for matrix multiplication, avoid to use vec4\n // and handle some elements per thread to optimally utilize the ALU.\n // Read data from global memory to registers firstly, then store them into\n // shared memory, so it is instruction-Level parallelism for arithmetic\n // operations and others handle IO operations between barrier api, makes ALU\n // and load/store units work simultaneously, could improves the performance.\n ${G()} {\n let tileRow = i32(localId.y);\n let tileCol = i32(localId.x);\n let globalRow = i32(globalId.y);\n let globalCol = i32(globalId.x);\n let batch = i32(globalId.z);\n let batchA = batch % uniforms.aShape[0];\n let batchB = batch % uniforms.bShape[0];\n\n // uniforms.dimInner should be greater than 0.\n let numTiles = (uniforms.dimInner - 1) / ${o} + 1;\n var acc = 0.0;\n\n var globalColA = tileCol;\n var globalRowB = 0;\n var regA = mm_readA(batchA, globalRow, globalColA);\n var regB0 = mm_readB(batchB, globalRowB + 2 * tileRow, globalCol);\n var regB1 = mm_readB(batchB, globalRowB + 2 * tileRow + 1, globalCol);\n globalColA = globalColA + ${o};\n globalRowB = globalRowB + ${o};\n\n for (var t = 0; t < numTiles; t = t + 1) {\n mm_Asub[tileRow][tileCol] = regA;\n mm_Bsub[2 * tileRow][tileCol] = regB0;\n mm_Bsub[2 * tileRow + 1][tileCol] = regB1;\n\n workgroupBarrier();\n\n regA = mm_readA(batchA, globalRow, globalColA);\n regB0 = mm_readB(batchB, globalRowB + 2 * tileRow, globalCol);\n regB1 = mm_readB(batchB, globalRowB + 2 * tileRow + 1, globalCol);\n globalColA = globalColA + ${o};\n globalRowB = globalRowB + ${o};\n\n for (var k = 0; k < ${o}; k = k + 1) {\n acc = acc + mm_Asub[tileRow][k] * mm_Bsub[k][tileCol];\n }\n workgroupBarrier();\n }\n\n mm_write(batch, globalRow, globalCol, acc);\n }\n `}var ux=class{constructor(e,t,o,n=!1,s=!1,a=null,i=null,p=null){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.workgroupSize=[16,8,1],this.outputShape=o,this.dispatchLayout={x:[2],y:[1],z:[0]},this.dispatch=[Math.ceil(o[2]/this.workgroupSize[0]),Math.ceil(o[1]/this.workgroupSize[1]),o[0]];let u=a!=null;u&&this.variableNames.push(\"bias\");let l=p!=null;l&&this.variableNames.push(\"preluActivationWeights\"),this.transposeA=n,this.transposeB=s,this.addBias=u,this.activation=i,this.hasPreluActivationWeights=l,this.shaderKey=`matMulSmallOutputSize_${this.activation}_${n}_${s}`}getUserCode(){return`\n ${gr(this.activation,this.hasPreluActivationWeights)}\n ${Sm(this.addBias,this.activation,this.transposeA,this.transposeB)}\n ${fpe(this.workgroupSize)}\n `}};var px=class{constructor(e,t,o=!1,n=!1){this.variableNames=[\"A\",\"B\"],this.uniforms=\"dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.workgroupSize=[8,8,1],this.atomic=!0,this.splitedDimInner=128,y.assert(e[0]===1,()=>\"MatMulSplitKProgram only supports batch = 1.\"),this.outputShape=e,this.dispatchLayout={x:[2],y:[1],z:[0,3]};let s=(o&&this.outputShape[1]%4===0||!o&&t%4===0)&&this.outputShape[2]%4===0;this.elementsPerThread=[4,4,this.splitedDimInner],this.outputComponent=s?4:1,s||(this.outputShape[1]<16&&(this.elementsPerThread[1]=1),this.outputShape[2]<16&&(this.elementsPerThread[0]=1)),this.dispatch=H(this.dispatchLayout,[this.outputShape[0],this.outputShape[1],this.outputShape[2],t],this.workgroupSize,this.elementsPerThread),this.transposeA=o,this.transposeB=n,this.shaderKey=`matMulSplitK_${o}_${n}_${this.elementsPerThread}_${this.outputComponent}`}getUserCode(){let e=this.outputComponent;return`\n ${mv(!1,this.transposeB,!1,!1,!1,e)}\n fn mm_write(batch: i32, row : i32, col : i32, value : ${Ae(e)}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) {\n let coords = vec3(batch, row, col);\n let flatIndex = getOutputIndexFromCoords(coords);\n // The problem is that we should initialize output to zero before using.\n // Otherwise, the original value will be added to the result.\n for (var i = 0; i < ${e}; i = i + 1) {\n ${oo(\"&result[flatIndex + i]\",`${e>1?\"value[i]\":\"value\"}`,\"float32\")}\n }\n }\n }\n ${e===4?Fp(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner):Pp(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner)}\n `}},lx=class{constructor(e,t=null,o=null,n=null){this.uniforms=\"\",this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t!=null,this.hasPreluActivationWeights=n!=null,this.activation=o,this.addBias&&this.variableNames.push(\"bias\"),this.hasPreluActivationWeights&&this.variableNames.push(\"preluActivationWeights\"),this.shaderKey=`biasActivation_${o}`}getUserCode(){return`\n ${gr(this.activation,this.hasPreluActivationWeights)}\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var value = getXByOutputIndex(index);\n ${no(this.addBias,this.activation)}\n setOutputAtIndex(index, value);\n }\n }\n `}};var cx=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms=\"value : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"fill\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n setOutputAtIndex(index, uniforms.value);\n }\n }\n `}};function Nt(r){let{backend:e,attrs:t}=r,{shape:o,value:n}=t,{dtype:s}=t;if(s=s||y.inferDtype(n),s===\"string\"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),e.makeTensorInfo(o,s,a)}else{let a=new cx(o),i=[{type:\"float32\",data:[n]}];return e.runWebGPUProgram(a,[],s,i)}}var Kz={kernelName:da,backendName:\"webgpu\",kernelFunc:Nt};function le(r){let{inputs:e,attrs:t}=r,{x:o}=e,{shape:n}=t,s=y.sizeFromShape(o.shape),a=y.inferFromImplicitShape(n,s),i=y.sizeFromShape(a);return y.assert(s===i,()=>`The new shape (${a}) has ${i} elements and the old shape (${o.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var qz={kernelName:Ca,backendName:\"webgpu\",kernelFunc:le};function Op({a:r,b:e,transposeA:t,transposeB:o,backend:n,bias:s=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:p=null}){let u=r.shape.length,l=e.shape.length,c=t?r.shape[u-2]:r.shape[u-1],m=o?e.shape[l-1]:e.shape[l-2],d=t?r.shape[u-1]:r.shape[u-2],f=o?e.shape[l-2]:e.shape[l-1],h=r.shape.slice(0,-2),g=e.shape.slice(0,-2),x=y.sizeFromShape(h),b=y.sizeFromShape(g),S=kr.assertAndGetBroadcastShape(r.shape.slice(0,-2),e.shape.slice(0,-2)).concat([d,f]);y.assert(c===m,()=>`Error in matMul: inner shapes (${c}) and (${m}) of Tensors with shapes ${r.shape} and ${e.shape} and transposeA=${t} and transposeB=${o} must match.`);let k=t?[x,c,d]:[x,d,c],T=o?[b,f,m]:[b,m,f],E=le({inputs:{x:r},backend:n,attrs:{shape:k}}),R=le({inputs:{x:e},backend:n,attrs:{shape:T}}),D=[E,R],F=Math.max(x,b),O=[E,R],M=[{type:\"int32\",data:[d]},{type:\"int32\",data:[f]},{type:\"int32\",data:[c]}],L,B,z=[F,d,f],U=A().get(\"WEBGPU_MATMUL_PROGRAM_TYPE\");if(U<0){let q=A().getNumber(\"WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL\"),Y=q>0?q:n.thresholdToIncreaseWorkgroups,J=F*Math.ceil(d/32)*Math.ceil(f/32);J<=Y||d<=8&&J<=Y*2?F*d*f<=128?U=pn.MatMulReduceProgram:F===1&&m>=2e3?U=pn.MatMulSplitKProgram:U=pn.MatMulSmallOutputSizeProgram:U=pn.MatMulPackedProgram}switch(U){case pn.MatMulReduceProgram:L=new ix(z,t,o,s,p,a);break;case pn.MatMulSplitKProgram:{if(B=Nt({backend:n,attrs:{shape:z,value:0,dtype:r.dtype}}),L=new px(z,m,t,o),s||p){B=n.runWebGPUProgram(L,O,r.dtype,M,B);let Y=new lx(B.shape,s,p,a),J=null,re=[B];s&&re.push(s),a&&re.push(a),p===\"leakyrelu\"&&(J=[{type:\"float32\",data:[i]}],Y.uniforms+=\" alpha : f32,\");let ne=n.runWebGPUProgram(Y,re,B.dtype,J);D.push(B);let ee=le({inputs:{x:ne},backend:n,attrs:{shape:S}});D.push(ne);for(let oe of D)n.disposeData(oe.dataId);return ee}break}case pn.MatMulSmallOutputSizeProgram:L=new ux(k,T,z,t,o,s,p,a);break;case pn.MatMulPackedProgram:let q=n.adapterInfo.isIntel();L=new ax(k,z,t,o,s,p,a,q);break;default:throw new Error(`Unsupported MatMulProgramType ${U}.`)}s&&O.push(s),a&&O.push(a),p===\"leakyrelu\"&&(M.push({type:\"float32\",data:[i]}),L.uniforms+=\" alpha : f32,\"),B=n.runWebGPUProgram(L,O,r.dtype,M,B);let j=le({inputs:{x:B},backend:n,attrs:{shape:S}});D.push(B);for(let q of D)n.disposeData(q.dataId);return j}function hpe(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=e,{transposeA:p,transposeB:u,activation:l,leakyreluAlpha:c}=o;return Op({a:n,b:s,transposeA:p,transposeB:u,backend:t,bias:a,preluActivationWeights:i,leakyreluAlpha:c,activation:l})}var jz={kernelName:qo,backendName:\"webgpu\",kernelFunc:hpe};var Im=class{constructor(e,t,o){this.variableNames=[\"AReal\",\"AImag\",\"BReal\",\"BImag\"],this.workgroupSize=[128,1,1],this.size=!0,this.outputShape=C.assertAndGetBroadcastShape(t,o),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`binaryOpComplex_${e}`,this.op=e}getUserCode(){return`\n fn binaryOpComplex(\n areal : f32, aimag : f32, breal : f32, bimag : f32) -> f32 {\n ${ec(this.op,!1)}\n }\n\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let areal = getARealByOutputIndex(index);\n let aimag = getAImagByOutputIndex(index);\n let breal = getBRealByOutputIndex(index);\n let bimag = getBImagByOutputIndex(index);\n setOutputAtIndex(index, binaryOpComplex(areal, aimag, breal, bimag));\n }\n }\n `}};var Di=class{constructor(e,t,o){if(this.size=!0,this.variableNames=[\"A\",\"B\"],this.outputShape=C.assertAndGetBroadcastShape(t,o),this.dispatchLayout=X(this.outputShape),this.op=e,this.useSharedMemoryWithA=t.length<=1&&o.length>1&&t[0]<128,this.useSharedMemoryWithB=o.length<=1&&t.length>1&&o[0]<128,this.useSharedMemoryWithA||this.useSharedMemoryWithB)this.outputComponent=1,this.variableComponents=[1,1],this.lastDimensionSize=this.useSharedMemoryWithB?o[0]:t[0],this.shaderKey=`binary_${e}_${this.lastDimensionSize}`,this.type=\"shared\",this.workgroupSize=[256,1,1];else{let n=t.length>0&&t[t.length-1]%4===0,s=o.length>0&&o[o.length-1]%4===0;n&&s?(this.outputComponent=4,this.variableComponents=[4,4]):n&&(y.isScalarShape(o)||o[o.length-1]===1)||s&&(y.isScalarShape(t)||t[t.length-1]===1)?(this.outputComponent=4,this.variableComponents=n?[4,1]:[1,4]):(this.outputComponent=1,this.variableComponents=[1,1]),this.type=\"nonshared\",this.shaderKey=`binary_${e}_${this.variableComponents}`,this.workgroupSize=[128,1,1]}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.outputComponent,1,1])}getUserCode(){let e,t=this.outputComponent===4?\"vec4\":\"f32\",o=`\n fn binaryOperation(a : ${t}, b : ${t}) -> ${t} {\n ${ec(this.op,this.outputComponent===4)}\n };\n `;if(this.type===\"shared\"){let n=this.lastDimensionSize>1?`coords[${this.outputShape.length-1}]`:\"0\",s=this.useSharedMemoryWithB?`let a = getAByOutputIndex(index);\n let b = sharedBuf[${n}];`:`let a = sharedBuf[${n}];\n let b = getBByOutputIndex(index);`;e=`\n ${o}\n var sharedBuf : array;\n ${G(\"index\")} {\n // Fill in the shared memory buffer.\n let localIndex = i32(localId.x);\n if(localIndex < ${this.lastDimensionSize}) {\n sharedBuf[localIndex] = f32(${this.useSharedMemoryWithB?\"B\":\"A\"}[localIndex]);\n }\n workgroupBarrier();\n\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n ${s}\n setOutputAtIndex(index, binaryOperation(a, b));\n }\n }\n `}else e=`\n ${o}\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index * ${this.outputComponent});\n let a = ${t}(getAByOutputCoords(coords));\n let b = ${t}(getBByOutputCoords(coords));\n setOutputAtIndex(index, binaryOperation(a, b));\n }\n }\n `;return e}};function Pt(r){let{inputs:e}=r,{x:t}=e;return r.backend.incRef(t.dataId),{dataId:t.dataId,shape:t.shape,dtype:t.dtype}}var Xz={kernelName:vo,backendName:\"webgpu\",kernelFunc:Pt};function Uo(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.makeTensorInfo(o.shape,\"complex64\"),a=t.tensorMap.get(s.dataId),i=Pt({inputs:{x:o},backend:t}),p=Pt({inputs:{x:n},backend:t});return a.complexTensorInfos={real:i,imag:p},s}var Yz={kernelName:ei,backendName:\"webgpu\",kernelFunc:Uo};var so=class{constructor(e,t,o=\"\"){this.variableNames=[\"A\"],this.size=!0;let n=128;this.workgroupSize=[n,1,1],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.op=t,o!==\"\"&&(this.uniforms=o),this.shaderKey=`unary_${t}`}getUserCode(){return`\n fn unaryOperation(a : f32) -> f32 {\n ${Ri(this.op,!1)}\n }\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let a = getAByOutputIndex(index);\n setOutputAtIndex(index, unaryOperation(a));\n }\n }\n `}};function ye({opType:r,cpuKernelImpl:e,dtype:t}){return({inputs:o,backend:n})=>{let{x:s}=o,a=n,i=t||s.dtype;if(a.shouldExecuteOnCPU([s])&&e!=null){let u=a.tensorMap.get(s.dataId),l=e(u.values,i);return a.makeTensorInfo(s.shape,i,l)}let p=new so(s.shape,r);return a.runWebGPUProgram(p,[s],i)}}function tt({opType:r,cpuKernelImpl:e,supportsComplex:t=!1,dtype:o}){return({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(t&&a.dtype===\"complex64\"){let c=p.tensorMap.get(a.dataId),m=p.tensorMap.get(i.dataId),d,f;if(r!==fe.MUL)[d,f]=[[c.complexTensorInfos.real,m.complexTensorInfos.real],[c.complexTensorInfos.imag,m.complexTensorInfos.imag]].map(g=>{let[x,b]=g,w={dataId:x.dataId,dtype:x.dtype,shape:a.shape},S={dataId:b.dataId,dtype:b.dtype,shape:i.shape},k=new Di(r,a.shape,i.shape);return p.runWebGPUProgram(k,[w,S],pt(x.dtype,b.dtype))});else{let g=new Im(fe.COMPLEX_MULTIPLY_REAL,a.shape,i.shape),x=new Im(fe.COMPLEX_MULTIPLY_IMAG,a.shape,i.shape),b=[{dataId:c.complexTensorInfos.real.dataId,dtype:c.complexTensorInfos.real.dtype,shape:a.shape},{dataId:c.complexTensorInfos.imag.dataId,dtype:c.complexTensorInfos.imag.dtype,shape:a.shape},{dataId:m.complexTensorInfos.real.dataId,dtype:m.complexTensorInfos.real.dtype,shape:i.shape},{dataId:m.complexTensorInfos.imag.dataId,dtype:m.complexTensorInfos.imag.dtype,shape:i.shape}];d=p.runWebGPUProgram(g,b,\"float32\"),f=p.runWebGPUProgram(x,b,\"float32\")}let h=Uo({inputs:{real:d,imag:f},backend:p});return p.disposeData(d.dataId),p.disposeData(f.dataId),h}let u=o||pt(a.dtype,i.dtype);if((a.dtype===\"string\"||i.dtype===\"string\"||p.shouldExecuteOnCPU([a,i]))&&e!=null){let c=p.tensorMap.get(a.dataId).values,m=p.tensorMap.get(i.dataId).values,d=a.dtype===\"string\"?C.fromUint8ToStringArray(c):c,f=a.dtype===\"string\"?C.fromUint8ToStringArray(m):m,[h,g]=e(a.shape,i.shape,d,f,u);return p.makeTensorInfo(g,u,h)}let l=new Di(r,a.shape,i.shape);return p.runWebGPUProgram(l,[a,i],u)}}var Lv={};qe(Lv,{addImpl:()=>hv,bincountImpl:()=>Jz,bincountReduceImpl:()=>eV,bitwiseAndImpl:()=>gv,castImpl:()=>fv,ceilImpl:()=>xv,concatImpl:()=>tV,equalImpl:()=>yv,expImpl:()=>bv,expm1Impl:()=>Cv,floorDivImpl:()=>Sv,floorImpl:()=>wv,gatherNdImpl:()=>rV,gatherV2Impl:()=>oV,greaterEqualImpl:()=>vv,greaterImpl:()=>Iv,lessEqualImpl:()=>Nv,lessImpl:()=>kv,linSpaceImpl:()=>nV,logImpl:()=>Tv,maxImpl:()=>sV,maximumImpl:()=>_v,minimumImpl:()=>Ev,multiplyImpl:()=>km,negImpl:()=>aV,notEqualImpl:()=>$v,prodImpl:()=>iV,raggedGatherImpl:()=>pV,raggedRangeImpl:()=>cV,raggedTensorToTensorImpl:()=>fV,rangeImpl:()=>hV,rsqrtImpl:()=>Av,scatterImpl:()=>gV,sigmoidImpl:()=>xV,simpleAbsImpl:()=>Qz,sliceImpl:()=>yV,sparseFillEmptyRowsImpl:()=>bV,sparseReshapeImpl:()=>CV,sparseSegmentReductionImpl:()=>wV,sqrtImpl:()=>SV,squaredDifferenceImpl:()=>Fv,staticRegexReplaceImpl:()=>Pv,stridedSliceImpl:()=>IV,stringNGramsImpl:()=>vV,stringSplitImpl:()=>kV,stringToHashBucketFastImpl:()=>NV,subImpl:()=>Mv,tileImpl:()=>TV,topKImpl:()=>EV,transposeImpl:()=>Rv,uniqueImpl:()=>$V});function Ai(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!==\"complex64\",()=>`${e} does not support complex64 tensors in the CPU backend.`)})}function Qz(r){let e=new Float32Array(r.length);for(let t=0;t{let a=C.assertAndGetBroadcastShape(e,t),i=a.length,p=y.computeStrides(a),u=y.sizeFromShape(a),l=y.getTypedArrayFromDType(s,u),c=e.length,m=t.length,d=y.computeStrides(e),f=y.computeStrides(t),h=C.getBroadcastDims(e,a),g=C.getBroadcastDims(t,a);if(h.length+g.length===0)for(let x=0;xw[E]=0);let S=y.locToIndex(w,c,d),k=b.slice(-m);g.forEach(E=>k[E]=0);let T=y.locToIndex(k,m,f);l[x]=r(o[S],n[T])}return[l,a]}}function tc(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,i=t.makeTensorInfo(o.shape,\"complex64\"),p=t.data.get(i.dataId);return p.complexTensorInfos={real:t.makeTensorInfo(o.shape,\"float32\",s),imag:t.makeTensorInfo(n.shape,\"float32\",a)},i}function mx(r,e,t=\"float32\"){if(t===\"complex64\"){let n=mx(r,e,\"float32\"),s=mx(r,e,\"float32\");return tc({inputs:{real:n,imag:s},backend:r})}let o=y.makeZerosTypedArray(y.sizeFromShape(e),t);return r.makeTensorInfo(e,t,o)}function dv(r){let{inputs:e,backend:t}=r,{x:o}=e;return t.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function Zz(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.data.get(o.dataId).complexTensorInfos.real,s=t.data.get(n.dataId).values;return t.makeTensorInfo(n.shape,n.dtype,s)}function fv(r,e,t,o){if(o===\"int32\"){let n=Int32Array.from(r);return[e,\"int32\",n]}if(o===\"bool\"){let n=y.toTypedArray([0],t),[s,a]=ht((i,p)=>i!==p?1:0)(e,[],r,n,\"bool\");return[a,\"bool\",s]}throw new Error(`Error in Cast: failed to cast ${t} to ${o}`)}function vm(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s===\"complex64\"){if(n.dtype===\"complex64\")return dv({inputs:{x:n},backend:t});let l=mx(t,n.shape,n.dtype),c=vm({inputs:{x:n},backend:t,attrs:{dtype:\"float32\"}}),m=tc({inputs:{real:c,imag:l},backend:t});return t.disposeIntermediateTensorInfo(l),t.disposeIntermediateTensorInfo(c),m}if(n.dtype===\"complex64\"){let l=Zz({inputs:{input:n},backend:t}),c=vm({inputs:{x:l},backend:t,attrs:{dtype:s}});return t.disposeIntermediateTensorInfo(l),c}if(!y.hasEncodingLoss(n.dtype,s)){let l=dv({inputs:{x:n},backend:t});return{dataId:l.dataId,shape:l.shape,dtype:s}}let a=t.data.get(n.dataId).values,[i,p,u]=fv(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}function wt(r,e,t,o){return t==null?({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;Ai([a,i],r);let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=a.dtype===\"string\"?C.fromUint8ToStringArray(u):u,m=a.dtype===\"string\"?C.fromUint8ToStringArray(l):l,d=o||a.dtype,[f,h]=e(a.shape,i.shape,c,m,d);return p.makeTensorInfo(h,d,f)}:({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(a.dtype===\"complex64\"||i.dtype===\"complex64\"){let u=vm({inputs:{x:a},backend:p,attrs:{dtype:\"complex64\"}}),l=p.data.get(u.dataId),c=l.complexTensorInfos.real,m=l.complexTensorInfos.imag,d=p.data.get(c.dataId).values,f=p.data.get(m.dataId).values,h=vm({inputs:{x:i},backend:p,attrs:{dtype:\"complex64\"}}),g=p.data.get(h.dataId),x=g.complexTensorInfos.real,b=g.complexTensorInfos.imag,w=p.data.get(x.dataId).values,S=p.data.get(b.dataId).values,[k,T,E]=t(a.shape,i.shape,d,f,w,S),R=p.makeTensorInfo(E,\"float32\",k),D=p.makeTensorInfo(E,\"float32\",T),F=tc({inputs:{real:R,imag:D},backend:p});return p.disposeIntermediateTensorInfo(u),p.disposeIntermediateTensorInfo(h),p.disposeIntermediateTensorInfo(R),p.disposeIntermediateTensorInfo(D),F}else{let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=o||a.dtype,[m,d]=e(a.shape,i.shape,u,l,c);return p.makeTensorInfo(d,c,m)}}}function rc(r){return(e,t,o,n,s,a)=>{let i=C.assertAndGetBroadcastShape(e,t),p=y.sizeFromShape(i),u=i.length,l=y.computeStrides(i),c=y.getTypedArrayFromDType(\"float32\",p),m=y.getTypedArrayFromDType(\"float32\",p),d=C.getBroadcastDims(e,i),f=C.getBroadcastDims(t,i),h=C.mergeRealAndImagArrays(o,n),g=C.mergeRealAndImagArrays(s,a),x=e.length,b=y.computeStrides(e),w=t.length,S=y.computeStrides(t);if(d.length+f.length===0)for(let k=0;kE[M]=0);let R=y.locToIndex(E,x,b),D=T.slice(-w);f.forEach(M=>D[M]=0);let F=y.locToIndex(D,w,S),O=r(h[R*2],h[R*2+1],g[F*2],g[F*2+1]);c[k]=O.real,m[k]=O.imag}return[c,m,i]}}var hv=ht((r,e)=>r+e),gpe=rc((r,e,t,o)=>({real:r+t,imag:e+o})),uLt=wt(Rr,hv,gpe);function Jz(r,e,t,o,n){let s=y.sizeFromShape(o),a=y.makeZerosTypedArray(n,t);for(let i=0;i=n||(s>0?a[p]+=e[i]:a[p]+=1)}return a}function eV(r,e,t,o=!1){let n=r.shape[0],s=r.shape[1],a=ie([n,t],e.dtype);for(let i=0;i=t||(o?a.set(1,i,u):e.size>0?a.set(a.get(i,u)+e.get(i,p),i,u):a.set(a.get(i,u)+1,i,u))}return a}var gv=ht((r,e)=>r&e),hLt=wt(_n,gv);function Qt(r){return(e,t,o)=>{let n=y.getArrayFromDType(t,e.length);for(let s=0;s{let{x:a}=o;Ai(a,r);let i=s,p=i.data.get(a.dataId).values,u;if(a.dtype===\"string\"){if(!Array.isArray(p))throw new Error(\"String tensor's value was not an instance of Array\");u=C.fromUint8ToStringArray(p)}else u=p;let l=t||a.dtype,c=e(u,l,n);return i.makeTensorInfo(a.shape,l,c)}}var xv=Qt(r=>Math.ceil(r)),NLt=Wr(go,xv);function tV(r,e,t,o){let n=y.getArrayFromDType(t,y.sizeFromShape(e));if(o&&t!==\"string\"){let s=0;r.forEach(a=>{let i=y.sizeFromShape(a.shape);n.set(a.vals,s),s+=i})}else{let s=0;r.forEach(a=>{let i=t===\"string\"?C.fromUint8ToStringArray(a.vals):a.vals,p=0;for(let u=0;ur===e?1:0),ALt=wt(xo,yv,null,\"bool\");var bv=Qt(r=>Math.exp(r)),LLt=Wr(yo,bv,\"float32\");var Cv=Qt(r=>Math.expm1(r)),ULt=Wr(bo,Cv);var wv=Qt(r=>Math.floor(r)),jLt=Wr(Co,wv);var Sv=ht((r,e)=>Math.floor(r/e)),JLt=wt(wo,Sv,null,\"int32\");function rV(r,e,t,o,n,s,a,i,p){let u=ie([o,s],t);for(let l=0;l=p/s)throw new Error(`Invalid indices: ${c} does not index into ${i}`);for(let d=0;dr>e?1:0),uBt=wt(So,Iv,null,\"bool\");var vv=ht((r,e)=>r>=e?1:0),dBt=wt(Io,vv,null,\"bool\");var kv=ht((r,e)=>rr<=e?1:0),IBt=wt(No,Nv,null,\"bool\");function nV(r,e,t){let o=(e-r)/(t-1),n=y.makeZerosTypedArray(t,\"float32\");n[0]=r;for(let s=1;sMath.log(r)),$Bt=Wr(To,Tv);function sV(r,e,t,o){let n=y.getTypedArrayFromDType(o,y.sizeFromShape(t));for(let s=0;si)&&(i=u)}n[s]=i}return n}var _v=ht((r,e)=>Math.max(r,e)),MBt=wt(_o,_v);var Ev=ht((r,e)=>Math.min(r,e)),WBt=wt(Eo,Ev);var km=ht((r,e)=>r*e),xpe=rc((r,e,t,o)=>({real:r*t-e*o,imag:r*o+e*t})),qBt=wt($o,km,xpe);function aV(r,e,t){let o=y.createScalarValue(-1,t);return km([],e,o,r,t)}var $v=ht((r,e)=>r!==e?1:0),rzt=wt(Ro,$v,null,\"bool\");function Rv(r,e,t,o,n){let s=e.length,a=y.sizeFromShape(e),i=y.computeStrides(e),p=y.computeStrides(n),u=y.getTypedArrayFromDType(t,y.sizeFromShape(n));for(let l=0;l{if(o<0||o>=t){let s=y.indexToLoc(n,e.length,y.computeStrides(e)).join(\",\");throw new Error(`indices[${s}] = ${o} is not in [0, ${t})`)}})}function bpe(r,e){for(let t=0;tn)throw new Error(\"Ragged splits must not point past values\");for(let s=1;so[s])throw new Error(\"Ragged splits must be sorted in ascending order\")}}function Cpe(r,e,t,o){let n=[],s=0,a=e.length-1+t.length,i=new Array(a).fill(null).map(()=>[0]);bpe(t,o);let p=1;for(let u=0;u=0){let h=i[f],g=h[h.length-1]-d[l];for(let x=l;xn[a]=s)}return e}function uV(r,e){let t=r.slice(0,e);for(;t.length1)throw new Error(\"starts must be a scalar or vector\");if(n.length>1)throw new Error(\"limits must be a scalar or vector\");if(a.length>1)throw new Error(\"deltas must be a scalar or vector\");let i=e.length===0,p=n.length===0,u=a.length===0,l=[];i||l.push(e[0]),p||l.push(n[0]),u||l.push(a[0]);for(let g=1;g0&&bx)S=0;else if(S=Math.ceil(Math.abs((b-x)/w)),S>lV)throw new Error(`Requires ((limit - start) / delta) <= ${lV}`);m[g+1]=m[g]+S}let d=m[c],f=y.getArrayFromDType(t,d),h=0;for(let g=0;go&&(o=s)}return o}static getMaxWidthValueRowID(e){let t=e.length;if(t===0)return 0;let o=0,n=e[0],s=0;for(let a=1;a\"Final length of result must be equal to firstDimension.\"),s}calculateOutputIndexRowSplit(e,t,o,n){let s=e.length,a=[];for(let i=0;i0&&a.length!==e[s-1])throw new Error(\"Invalid row split size.\");return a}calculateOutputIndexValueRowID(e,t,o,n){let s=e.length,a=[];if(s===0)return[];let i=0,p=e[0];if(p>=t.length)throw new Error(`Got currentValueRowId=${p}, which is not less than ${t.length}`);let u=t[p];a.push(u);for(let l=1;l=0&&(++i,i=t.length)throw new Error(`Got nextValueRowId=${c} which is not less than ${t.length}`);u=t[c]}a.push(u)}if(a.length!==e.length)throw new Error(\"Invalid row ids.\");return a}calculateOutputIndex(e,t,o,n){let s=this.getRowPartitionTensor(e),a=this.getRowPartitionTypeByDimension(e);switch(a){case ln.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,t,o,n);case ln.ROW_SPLITS:if(s.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(s,t,o,n);default:throw new Error(`Unsupported partition type: ${ln[a]}`)}}getFirstDimensionSize(){let e=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error(\"No row_partition_types given.\");let t=this.rowPartitionTypes[0];switch(t){case ln.FIRST_DIM_SIZE:return e[0];case ln.VALUE_ROWIDS:throw new Error(\"Cannot handle VALUE_ROWIDS in first dimension.\");case ln.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${ln[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error(\"Invalid first partition input. Tensor requires at least one element.\");let t=this.getFirstDimensionSize(),o=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let p=n.length-2;p>=0;--p)n[p]=n[p+1]*o[p+1];let s=dV(o,!1),a=y.getArrayFromDType(this.valuesDType,y.sizeFromShape(s));if(n[0]*o[0]>0){let p=this.calculateFirstParentOutputIndex(t,n[0],o[0]);for(let u=1;u<=this.raggedRank;++u)p=this.calculateOutputIndex(u-1,p,n[u],o[u]);this.setOutput(this.raggedRank,p,a,s)}return[s,a]}setOutput(e,t,o,n){if(o.length===0)return;let s=this.values,a=o,i=n.slice();i=i.slice(e+1);let p=y.sizeFromShape(i),u=t.length,l=this.defaultValue;if(l.length!==p&&l.length!==1){let f=this.defaultValueShape;De(()=>{let h=W(l,f);l=Oa(h,i).dataSync()})}let c=0,m=0,d=0;for(let f=0;f<=u;++f){let h=f=u){let g=o.length;h=Math.floor(g/p)}if(h>d)if(this.defaultValue.length===1)a.subarray(d*p,h*p).fill(this.defaultValue[0]),d=h;else for(;h>d;){let g=a.slice(d*p);mV(g,l,p),++d}h<0?(c=f+1,m=d):(c=f,m=d,d=m+1)}}};function mV(r,e,t){for(let o=0;o= 0`);if(o<-1)throw new Error(`Dimension ${o} must be >= -1`);o=-1}t.push(o)}return t}function fV(r,e,t,o,n,s,a,i,p,u){return new Dv(r,e,t,o,n,s,a,i,p,u).compute()}function hV(r,e,t,o){let n=r===e,s=r1;if(n||s||a)return y.makeZerosTypedArray(0,o);let i=Math.abs(Math.ceil((e-r)/t)),p=y.makeZerosTypedArray(i,o);e1/Math.sqrt(r)),Nzt=Wr(Do,Av);function gV(r,e,t,o,n,s,a,i,p,u){let l=[o/n,n],c=r.values,m=e.values;if(o===0)return ie(t,e.dtype);let d=p instanceof Ge?p:ie(l,e.dtype);typeof p==\"string\"||typeof p==\"number\"?d.values.fill(p):typeof p==\"boolean\"&&d.values.fill(+p);for(let f=0;f=o/n)throw new Error(`Invalid indices: ${h} does not index into ${t}`);for(let x=0;x1/(1+Math.exp(-r))),Azt=dx(Ao,r=>1/(1+Math.exp(-r)));function yV(r,e,t,o,n){let s=nt.isSliceContinous(o,e,t),a=y.sizeFromShape(t),i=y.computeStrides(o);if(s){let c=nt.computeFlatOffset(e,i);return n===\"string\"?r.slice(c,c+a):r.subarray(c,c+a)}let p=n===\"string\"?C.fromUint8ToStringArray(r):r,u=ie(o,n,p),l=ie(t,n);for(let c=0;cf+e[h]);l.set(u.get(...d),...m)}return n===\"string\"?C.fromStringArrayToUint8(l.values):l.values}function bV(r,e,t,o,n,s,a){let i=e[0],p=s[0],u=new Array(p),l=new Array(i),c=e[1];if(p===0){if(i!==0)throw new Error(C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i));let g=y.getArrayFromDType(t,0),x=y.getArrayFromDType(n,0);return[g,[0,c],x,u,l]}let m=!0,d=0,f=new Array(p).fill(0);for(let g=0;g=p)throw new Error(C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,x,p));++f[x],m=m&&x>=d,d=x}let h=!0;for(let g=0;g0&&(f[g]+=f[g-1])}if(h&&m){let g=r,x=o;for(let b=0;b0){d[m-1]=1;for(let g=m-2;g>=0;--g)d[g]=d[g+1]*o[g+1]}let f=[];if(i>0){f[i-1]=1;for(let g=i-2;g>=0;--g)f[g]=f[g+1]*p[g+1]}let h=y.getArrayFromDType(t,a*i);for(let g=0;g0?n[i-1]+1:0;if(c<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=e.slice();m[0]=c;let d=m.reduce((w,S)=>w*S,1),f=y.getArrayFromDType(t,d);if(i===0)return c>0&&f.fill(a),[f,m];if(c<=0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let h=0,g=1,x=0,b=n[h];for(;;){let w=0;if(g=w)throw new Error(C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(b<0||b>=c)throw new Error(C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b,c));b>x&&f.fill(a,x*u,b*u);for(let S=h;S=p[0])throw new Error(C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S,o[S],p[0]));for(let T=0;Ti)break}return xMath.sqrt(r)),qzt=dx(Fo,r=>Math.sqrt(r));var Fv=ht((r,e)=>{let t=r-e;return t*t}),Zzt=wt(Po,Fv);var Pv=Qt((r,e)=>{let{pattern:t,replaceGlobal:o,rewrite:n}=e;return r.replace(new RegExp(t,o?\"g\":\"\"),n)}),oVt=Wr(pi,Pv);function IV(r,e,t,o){let n=ie(r,e.dtype);for(let s=0;s0?0:i-p),d=0;d+=u*this.leftPad.length;for(let b=0;bb.forEach(w=>h[g++]=w);for(let b=0;b0){x(e[m+c-1]);for(let b=0;b0){let p=t[0];if(p!==0)throw new Error(`First split value must be 0, got ${p}`);for(let u=1;u=p;if(l=l&&t[u]<=o,!l)throw new Error(`Invalid split value ${t[u]}, must be in [${p}, ${o}]`);p=t[u]}if(p!==o)throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`)}let s=n-1,a=y.getArrayFromDType(\"int32\",n);if(o===0||n===0){let p=new Array(o);for(let u=0;u<=s;++u)a[u]=0;return[p,a]}a[0]=0;for(let p=1;p<=s;++p){let u=t[p]-t[p-1],l=0;this.nGramWidths.forEach(c=>{l+=this.getNumNGrams(u,c)}),this.preserveShort&&u>0&&l===0&&(l=1),a[p]=a[p-1]+l}let i=new Array(a[s]);for(let p=0;p{let m=t[p+1]-t[p],d=this.getNumNGrams(m,c);this.createNGrams(e,u,i,l,d,c),l+=d}),this.preserveShort&&l===a[p]){let c=t[p+1]-t[p];if(c===0)continue;let m=c+2*this.padWidth;this.createNGrams(e,u,i,l,1,m)}}return[i,a]}};function vV(r,e,t,o,n,s,a,i){return new Ov(t,o,n,s,a,i).compute(r,e)}function vpe(r,e,t,o){if(!r.length)return;if(e.length===0){for(let s=0;sr-e),kpe=rc((r,e,t,o)=>({real:r-t,imag:e-o})),gVt=wt(Oo,Mv,kpe);function TV(r,e){let t=new Array(r.rank);for(let n=0;n{let t=e.value-r.value;return t===0?r.index-e.index:t};function _V(r,e,t=0,o=r.length-1){for(;o>t;){if(o-t>600){let i=o-t+1,p=e-t+1,u=Math.log(i),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(i-l)/i)*Math.sign(p-i/2),m=Math.max(t,Math.floor(e-p*l/i+c)),d=Math.min(o,Math.floor(e+(i-p)*l/i+c));_V(r,e,m,d)}let n=r[e],s=t,a=o;for(y.swap(r,t,e),Nm(r[o],n)>0&&y.swap(r,t,o);s0;)a=a-1}Nm(r[t],n)===0?y.swap(r,t,a):(a=a+1,y.swap(r,a,o)),a<=e&&(t=a+1),e<=a&&(o=a-1)}}function EV(r,e,t,o,n){let s=e[e.length-1],[a,i]=[r.length/s,s],p=y.getTypedArrayFromDType(t,a*o),u=y.getTypedArrayFromDType(\"int32\",a*o);for(let c=0;cf[w]={value:b,index:w}),o{for(let g=0;g`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey=\"addN\"}getUserCode(){let e=[];this.variableNames.forEach(n=>{e.push(`let v${n} = get${n}ByOutputCoords(coords);`)});let t=this.variableNames.map(n=>`v${n}`).join(\" + \");return`\n ${G(\"index\")} {\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let flatIndex = index * ${this.workPerThread} + i;\n if (flatIndex < uniforms.size) {\n let coords = getCoordsFromIndex(flatIndex);\n ${e.join(`\n `)}\n setOutputAtIndex(flatIndex, ${t});\n }\n }\n }\n `}};function $pe(r){let{inputs:e,backend:t}=r,o=e;if(o.length===1)return Pt({inputs:{x:o[0]},backend:t});let n=o.map(i=>i.dtype).reduce((i,p)=>pt(i,p)),s=o.map(i=>i.shape),a=new fx(s);return t.runWebGPUProgram(a,o,n)}var hW={kernelName:xn,backendName:\"webgpu\",kernelFunc:$pe};var hx=class{constructor(e,t){this.variableNames=[\"A\"],this.workgroupSize=[16,16,1];let o=new Array(e.length);for(let n=0;n`Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`);let e=this.workgroupSize[0];return`\n var tile : array, ${this.workgroupSize[0]}>;\n ${G()} {\n var x = i32(workgroupId.x) * ${e} + i32(localId.x);\n var y = i32(workgroupId.y) * ${e} + i32(localId.y);\n let width = uniforms.outShape[0];\n let height = uniforms.outShape[1];\n if (x < width && y < height) {\n tile[localId.y][localId.x] = f32(A[y * width + x]);\n }\n workgroupBarrier();\n\n x = i32(workgroupId.y) * ${e} + i32(localId.x);\n y = i32(workgroupId.x) * ${e} + i32(localId.y);\n if (x < height && y < width) {\n setOutputAtIndex((y * height + x), tile[localId.x]\n [localId.y]);\n }\n }\n `}};var gx=class{constructor(e,t){this.variableNames=[\"A\"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0;let o=new Array(e.length);for(let n=0;n6)throw Error(`Transpose for rank ${e} is not yet supported`);let t=new Array(e);for(let o=0;o=32768&&o>=512?this.workgroupSize=[512,1,1]:e.inSize>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1]),this.reduceType=t,this.shaderKey=`reduce_${t}`}getUserCode(){let e=\"\",t=\"0.0\",o=this.workgroupSize[0];this.reduceType===\"min\"||this.reduceType===\"max\"?(e=`\n if (isnan(candidate)) {\n bestValue = uniforms.NAN;\n } else if (!isnan(bestValue) && candidate ${this.reduceType===\"min\"?\"<\":\">\"} bestValue)\n { bestValue = candidate; }`,t=\"f32(x[offset])\"):this.reduceType===\"sum\"||this.reduceType===\"mean\"?e=\" bestValue = bestValue + candidate; \":this.reduceType===\"prod\"?(e=\" bestValue = bestValue * candidate; \",t=\"1.0\"):this.reduceType===\"all\"?(e=\" bestValue = f32(bestValue >= 1.0 && candidate >= 1.0); \",t=\"1.0\"):this.reduceType===\"any\"&&(e=\" bestValue = f32(bestValue >= 1.0 || candidate >= 1.0); \",t=\"0.0\");let n=this.reduceType===\"mean\"?\"setOutputAtIndex(outputIndex, bestValue / f32(uniforms.reduceSize));\":\"setOutputAtIndex(outputIndex, bestValue);\";return`\n fn DIV_CEIL(a : u32, b : u32) -> u32 {\n return ((a - 1u) / b + 1u);\n }\n\n ${`\n var xBestValues : array;\n `}\n fn getOffset(outputIndex : i32) -> i32 {\n let outputCoords = getCoordsFromIndex(outputIndex);\n let offset = ${this.outputShape.length===1?\"outputCoords\":\"outputCoords[0]\"} * uniforms.reduceSize;\n return offset;\n }\n ${G(\"index\")} {\n let outputIndex = index / ${o};\n let offset = getOffset(outputIndex);\n var bestValue = ${t};\n let Length = uniforms.reduceSize;\n let WorkPerThread = DIV_CEIL(u32(Length), ${o}u);\n for (var k = i32(localId.x); k < Length && outputIndex < uniforms.size;\n k = k + ${o}) {\n let candidate = f32(x[offset + k]);\n ${e}\n }\n xBestValues[localId.x] = bestValue;\n workgroupBarrier();\n\n var reduceSize = min(u32(Length), ${o}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (localId.x < currentSize) {\n let candidate = xBestValues[localId.x + interval];\n ${e}\n xBestValues[localId.x] = bestValue;\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (localId.x == 0u && outputIndex < uniforms.size) {\n ${n}\n }\n }\n `}};var Rpe={mean:\"float32\",all:\"bool\",any:\"bool\"};function ao(r,e,t,o,n){let s=r.shape.length,a=[],i=y.parseAxisParam(e,r.shape),p=i,u=C.getAxesPermutation(p,s),l=r;u!=null&&(l=Cr({inputs:{x:r},attrs:{perm:u},backend:n}),p=C.getInnerMostAxes(p.length,s),a.push(l)),C.assertAxesAreInnerMostDims(o,p,s);let[c,m]=C.computeOutAndReduceShapes(l.shape,p),d=c;t&&(d=C.expandShapeToKeepDim(c,i));let f;if((o===\"max\"||o===\"prod\")&&n.shouldExecuteOnCPU([l])){let h=n.tensorMap.get(l.dataId).values;switch(o){case\"max\":let g=qV(h,y.sizeFromShape(m),d,r.dtype);f=n.makeTensorInfo(d,r.dtype,g);break;case\"prod\":let{outVals:x,outShape:b,outDtype:w}=JV(l.shape,l.dtype,h,p);f=n.makeTensorInfo(b,w,x);break;default:throw new Error(`${o} CPU implementation is not yet supported.`)}}else{let h=y.sizeFromShape(m),x=y.sizeFromShape(l.shape)/h,b={windowSize:h,inSize:h,batchSize:x,outSize:1},w=Rpe[o]||mi(r.dtype),S=[{type:\"int32\",data:[h]}],k=new xx(b,o,n.device.limits.maxComputeWorkgroupSizeX),T=n.runWebGPUProgram(k,[l],w,S);a.push(T),f=le({inputs:{x:T},attrs:{shape:d},backend:n})}return a.forEach(h=>n.disposeData(h.dataId)),f}function Dpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{keepDims:s,axis:a}=o;return ao(n,a,s,\"all\",t)}var xW={kernelName:yn,backendName:\"webgpu\",kernelFunc:Dpe};function Ape(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{keepDims:s,axis:a}=o;return ao(n,a,s,\"any\",t)}var yW={kernelName:bn,backendName:\"webgpu\",kernelFunc:Ape};var oc=class{constructor(e,t,o){this.workgroupSize=[64,1,1],this.variableNames=[\"x\"],this.uniforms=\"infinityValue : f32,\",this.size=!0;let n=[t];this.op=o===\"min\"?\"<\":\">\";let[s,a]=C.computeOutAndReduceShapes(e,n);this.outputShape=s.length===0?[1]:s,this.dispatchLayout=X(this.outputShape),y.sizeFromShape(a)<32?(this.type=\"plain\",this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)):(this.type=\"shared\",this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1])),this.inputShape=e,this.shaderKey=`argMinMax_${this.op}_${this.type}`}getUserCode(){let e=this.workgroupSize[0],t=()=>this.inputShape.length===1?\"uniforms.xShape\":`uniforms.xShape.${un(this.inputShape.length-1)}`,o=()=>{let n=\"\";if(this.outputShape.length===1)this.inputShape.length!==1&&(n+=\"outputCoords,\");else for(let s=0;s u32 {\n return ((a - 1u) / b + 1u);\n }\n\n ${`\n var xBestIndices : array;\n var xBestValues : array;\n `}\n\n ${G(\"index\")} {\n let outputIndex = index / ${e};\n let reduceLength = ${t()};\n\n var bestIndex = i32(localId.x);\n var bestValue = uniforms.infinityValue;\n let outputCoords = getCoordsFromIndex(outputIndex);\n for (var k = i32(localId.x); k < reduceLength && outputIndex < uniforms.size;\n k = k + ${e}) {\n let candidate = getX(${o()} k);\n if (!isnan(candidate) && candidate ${this.op} bestValue) {\n bestValue = candidate;\n bestIndex = k;\n }\n }\n xBestValues[localId.x] = bestValue;\n xBestIndices[localId.x] = bestIndex;\n workgroupBarrier();\n\n var reduceSize = min(u32(reduceLength), ${e}u);\n for (var currentSize = reduceSize / 2u; reduceSize > 1u;\n currentSize = reduceSize / 2u) {\n let interval = DIV_CEIL(reduceSize, 2u);\n if (localId.x < currentSize) {\n let candidate = xBestValues[localId.x + interval];\n if (candidate ${this.op} bestValue) {\n bestValue = candidate;\n xBestValues[localId.x] = bestValue;\n xBestIndices[localId.x] = xBestIndices[localId.x + interval];\n }\n }\n reduceSize = interval;\n workgroupBarrier();\n }\n\n if (localId.x == 0u && outputIndex < uniforms.size) {\n setOutputAtIndexI32(outputIndex, xBestIndices[localId.x]);\n }\n }\n `:`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let outputCoords = getCoordsFromIndex(index);\n var bestIndex = 0;\n var bestValue = getX(${o()} 0);\n let reduceLength = ${t()};\n for (var i = 1; i < reduceLength; i++) {\n let candidate = getX(${o()} i);\n if (candidate ${this.op} bestValue) {\n bestValue = candidate;\n bestIndex = i;\n }\n }\n setOutputAtIndexI32(index, bestIndex);\n }\n }\n `}};function Fpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Cr({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims(\"argMax\",[a[0]],p.shape.length);let l=new oc(p.shape,a[0],\"max\"),c=[{type:\"float32\",data:[Number.NEGATIVE_INFINITY]}],m=t.runWebGPUProgram(l,[p],\"int32\",c);return u.forEach(d=>t.disposeData(d.dataId)),m}var bW={kernelName:na,backendName:\"webgpu\",kernelFunc:Fpe};function Ppe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Cr({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims(\"argMin\",[a[0]],p.shape.length);let l=new oc(p.shape,a[0],\"min\"),c=[{type:\"float32\",data:[Number.POSITIVE_INFINITY]}],m=t.runWebGPUProgram(l,[p],\"int32\",c);return u.forEach(d=>t.disposeData(d.dataId)),m}var CW={kernelName:sa,backendName:\"webgpu\",kernelFunc:Ppe};var Ope=ye({opType:Z.ASIN}),wW={kernelName:Cn,backendName:\"webgpu\",kernelFunc:Ope};var Mpe=ye({opType:Z.ASINH}),SW={kernelName:wn,backendName:\"webgpu\",kernelFunc:Mpe};var Lpe=ye({opType:Z.ATAN}),IW={kernelName:Sn,backendName:\"webgpu\",kernelFunc:Lpe};var Bpe=tt({opType:fe.ATAN2}),vW={kernelName:vn,backendName:\"webgpu\",kernelFunc:Bpe};var zpe=ye({opType:Z.ATANH}),kW={kernelName:In,backendName:\"webgpu\",kernelFunc:zpe};var yx=class{constructor(e){this.variableNames=[\"x\"],this.uniforms=\"strides : vec2,\",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"poolWithFilterSizeEqualsOne\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let xRCCorner = coords.yz * uniforms.strides;\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n\n let value = getX(batch, xRCorner, xCCorner, d);\n setOutputAtIndex(index, value);\n }\n }\n `}};var Ka=class{constructor(e,t,o=!1,n=!1,s=!1){if(this.variableNames=[\"x\"],this.uniforms=\"strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,\",this.workgroupSize=[128,1,1],this.size=!0,t===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool2D_${t}_${o}_${n}_${s}`}getUserCode(){let e;this.poolType===\"avg\"?e=\"resultValue = resultValue + value; count = count + 1.0;\":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound);\n if (value >= currMaxValue) {\n maxValue = value;\n maxValueFound = 1.0;\n maxPosition = ${this.flattenPositions?this.includeBatchIndex?\"((batch * uniforms.xShape[1] + xR) * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d\":\"(xR * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d\":\"wR * uniforms.filterDims.y + wC\"};\n }`:e=\"resultValue = max(value, resultValue);\";let t=\"resultValue\";return this.poolType===\"avg\"&&(t=\"resultValue / max(count, 1.0)\"),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n let xRCCorner = vec2(coords.yz) * uniforms.strides - uniforms.pads;\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n\n ${this.computePositions?`var maxValue = 0.0;\n var maxValueFound = 0.0;\n var maxPosition = 0;`:`var resultValue = ${this.poolType===\"avg\"?\"0.0\":\"-1.0 / pow(10.0, -20.0)\"};`}\n\n var count = 0.0;\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + uniforms.dilations.x) {\n let xR = xRCorner + wR;\n\n if (xR < 0 || xR >= uniforms.convDims.x) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + uniforms.dilations.y) {\n let xC = xCCorner + wC;\n if (xC < 0 || xC >= uniforms.convDims.y) {\n continue;\n }\n\n let value = getX(batch, xR, xC, d);\n ${e}\n }\n }\n\n ${this.computePositions?\"setOutputAtIndexI32(index, maxPosition);\":`setOutputAtIndex(index, ${t});`}\n }\n }\n `}},$u=class{constructor(e,t,o=!1,n=!1,s=!1){if(this.variableNames=[\"x\"],this.uniforms=\"strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,\",this.workgroupSize=[128,1,1],this.size=!0,t===\"avg\"&&o)throw new Error(\"Cannot compute positions for average pool.\");this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool3D_${t}_${o}_${n}_${s}`}getUserCode(){let e;this.poolType===\"avg\"?e=\"resultValue += value; count += 1.0;\":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound);\n if (value >= currMaxValue) {\n maxValue = value;\n maxValueFound = 1.0;\n maxPosition = ${this.flattenPositions?this.includeBatchIndex?\"(((batch * uniforms.xShape.y + xD) * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch\":\"((xD * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch\":\"wD * uniforms.filterDims.y * uniforms.filterDims.y + wR * uniforms.filterDims.z + wC\"};\n }`:e=\"resultValue = max(value, resultValue);\";let t=\"resultValue\";return this.poolType===\"avg\"&&(t=\"resultValue / max(count, 1.0)\"),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let xCorner = vec3(coords.y, coords.z, coords.w) * uniforms.strides - uniforms.pads;\n let xDCorner = xCorner.x;\n let xRCorner = xCorner.y;\n let xCCorner = xCorner.z;\n\n ${this.computePositions?`var maxValue = 0.0;\n var maxValueFound = 0.0;\n var maxPosition = 0;`:`var resultValue = ${this.poolType===\"avg\"?\"0.0\":\"-1.0 / pow(10.0, -20.0)\"};`}\n\n var count = 0.0;\n for (var wD = 0; wD < uniforms.filterDims.x; wD++) {\n let xD = xDCorner + wD;\n if (xD < 0 || xD >= uniforms.convDims.x) {\n continue;\n }\n\n for (var wR = 0; wR < uniforms.filterDims.y; wR++) {\n let xR = xRCorner + wR;\n if (xR < 0 || xR >= uniforms.convDims.y) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims.z; wC++) {\n let xC = xCCorner + wC;\n if (xC < 0 || xC >= uniforms.convDims.z) {\n continue;\n }\n\n let value = getX(batch, xD, xR, xC, ch);\n ${e}\n }\n }\n }\n\n ${this.computePositions?\"setOutputAtIndexI32(index, maxPosition);\":`setOutputAtIndex(index, ${t});`}\n }\n }\n `}};function zv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{reductionIndices:s,keepDims:a}=o;return ao(n,s,a,\"max\",t)}var NW={kernelName:os,backendName:\"webgpu\",kernelFunc:zv};function Vv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{keepDims:s,axis:a}=o;return ao(n,a,s,\"mean\",t)}var TW={kernelName:ss,backendName:\"webgpu\",kernelFunc:Vv};function bx(r,e,t,o){if(e.filterWidth===1&&e.filterHeight===1&&y.arraysEqual(e.inShape,e.outShape))return Pt({inputs:{x:r},backend:o});if(e.filterWidth===e.inWidth&&e.filterHeight===e.inHeight&&e.batchSize===1&&e.padInfo.type===\"VALID\"){let a=r.shape.length,i=le({inputs:{x:r},backend:o,attrs:{shape:[r.shape[a-3]*r.shape[a-2],r.shape[a-1]]}}),p;t===\"avg\"?p=Vv({inputs:{x:i},backend:o,attrs:{axis:0,keepDims:!1}}):(y.assert(t===\"max\",()=>`Invalid pool type ${t}`),p=zv({inputs:{x:i},backend:o,attrs:{reductionIndices:0,keepDims:!1}}));let u=le({inputs:{x:p},backend:o,attrs:{shape:e.outShape}});return o.disposeData(i.dataId),o.disposeData(p.dataId),u}let n,s=[{type:\"int32\",data:[e.strideHeight,e.strideWidth]}];return e.filterHeight===1&&e.filterWidth===1?n=new yx(e):(t===\"avg\"?n=new Ka(e,\"avg\"):(y.assert(t===\"max\",()=>`Invalid pool type ${t}`),n=new Ka(e,\"max\")),s.push({type:\"int32\",data:[e.padInfo.top,e.padInfo.left]},{type:\"int32\",data:[e.dilationHeight,e.dilationWidth]},{type:\"int32\",data:[e.inHeight,e.inWidth]},{type:\"int32\",data:[e.effectiveFilterHeight,e.effectiveFilterWidth]})),o.runWebGPUProgram(n,[r],r.dtype,s)}function Vpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,l=C.computePool2DInfo(n.shape,s,a,1,i,p);return bx(n,l,\"avg\",t)}var _W={kernelName:kn,backendName:\"webgpu\",kernelFunc:Vpe};function Wpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,u,p),m=new $u(c,\"avg\"),d=[{type:\"int32\",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:\"int32\",data:[c.inDepth,c.inHeight,c.inWidth]},{type:\"int32\",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return t.runWebGPUProgram(m,[n],n.dtype,d)}var EW={kernelName:aa,backendName:\"webgpu\",kernelFunc:Wpe};var Cx=class{constructor(e){this.variableNames=[\"dy\"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"avgPool2DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let dyRCCorner = vec2(coords.yz) - uniforms.pads;\n let dyRCorner = dyRCCorner.x;\n let dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR = wR + uniforms.dilations[0]) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC = wC + uniforms.dilations[1]) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyR, idyC, d);\n\n dotProd = dotProd + dyValue * uniforms.avgMultiplier;\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},wx=class{constructor(e){this.variableNames=[\"dy\"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"avgPool3DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyDCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wD = 0; wD < uniforms.filterDims[0]; wD++) {\n let dyD = f32(dyDCorner + wD) / f32(uniforms.strides[0]);\n\n if (dyD < 0.0 || dyD >= f32(uniforms.outDepth) || fract(dyD) > 0.0) {\n continue;\n }\n let idyD = i32(dyD);\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyD, idyR, idyC, ch);\n dotProd += dyValue * uniforms.avgMultiplier;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function Upe(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:l}=o,c=C.computePool3DInfo(a.shape,i,p,1,u,l),m=new wx(c),d=1/(c.filterDepth*c.filterHeight*c.filterWidth),f=[{type:\"int32\",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.effectiveFilterDepth-1-c.padInfo.front,c.effectiveFilterHeight-1-c.padInfo.top,c.effectiveFilterWidth-1-c.padInfo.left]},{type:\"int32\",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]},{type:\"int32\",data:[c.outDepth]},{type:\"int32\",data:[c.outHeight]},{type:\"int32\",data:[c.outWidth]},{type:\"float32\",data:[d]}];return t.runWebGPUProgram(m,[n],a.dtype,f)}var $W={kernelName:Vi,backendName:\"webgpu\",kernelFunc:Upe};function Gpe(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s;wm([n,s],\"avgPoolGrad\");let{filterSize:i,strides:p,pad:u}=o,l=C.computePool2DInfo(a.shape,i,p,1,u),c=new Cx(l),m=1/(l.filterHeight*l.filterWidth),d=[{type:\"int32\",data:[l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.effectiveFilterHeight-1-l.padInfo.top,l.effectiveFilterWidth-1-l.padInfo.left]},{type:\"int32\",data:[l.dilationHeight,l.dilationWidth]},{type:\"int32\",data:[l.effectiveFilterHeight,l.effectiveFilterWidth]},{type:\"int32\",data:[l.outHeight]},{type:\"int32\",data:[l.outWidth]},{type:\"float32\",data:[m]}];return t.runWebGPUProgram(c,[n],a.dtype,d)}var RW={kernelName:zi,backendName:\"webgpu\",kernelFunc:Gpe};function Hpe(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;return Op({a:n,b:s,transposeA:a,transposeB:i,backend:t})}var DW={kernelName:Nn,backendName:\"webgpu\",kernelFunc:Hpe};var Sx=class{constructor(e,t){this.variableNames=[\"source\"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.rank=t.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.start=e,this.uniforms=`start : ${ft(e.length)}, `,this.shaderKey=\"slice\"}getUserCode(){let e=ft(this.rank),t=Kpe(this.rank),o;return this.start.length===1?o=this.outputShape.map((s,a)=>\"sourceLoc = uniforms.start + coords;\"):o=this.outputShape.map((s,a)=>`sourceLoc.${Wv[a]} = uniforms.start.${un(a)} + coords.${Wv[a]};`),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var sourceLoc : ${e};\n let coords = getCoordsFromIndex(index);\n ${o.join(`\n`)}\n setOutputAtIndex(index, getSource(${t}));\n }\n }\n `}},Wv=[\"x\",\"y\",\"z\",\"w\",\"u\",\"v\"];function Kpe(r){if(r===1)return\"sourceLoc\";if(r<=6)return Wv.slice(0,r).map(e=>`sourceLoc.${e}`).join(\",\");throw Error(`Slicing for rank ${r} is not yet supported`)}function ea(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,size:a}=o,[i,p]=nt.parseSliceParams(n,s,a);if(nt.assertParamsValid(n,i,p),t.shouldExecuteOnCPU([n])||n.dtype===\"string\"){let c=t.tensorMap.get(n.dataId),m=nW(c.values,i,p,n.shape,n.dtype);return t.makeTensorInfo(p,n.dtype,m)}if(y.sizeFromShape(p)===0)return t.makeTensorInfo(p,n.dtype,[]);let u=new Sx(i,p),l=[{type:\"int32\",data:i}];return t.runWebGPUProgram(u,[n],n.dtype,l)}var AW={kernelName:_s,backendName:\"webgpu\",kernelFunc:ea};var qpe=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>\"batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet\");let i=s.reduce((b,w)=>b*w),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=[],f=le({inputs:{x:n},backend:t,attrs:{shape:p}}),h=Cr({inputs:{x:f},backend:t,attrs:{perm:u}}),g=le({inputs:{x:h},backend:t,attrs:{shape:l}}),x=ea({inputs:{x:g},backend:t,attrs:{begin:c,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>t.disposeData(b.dataId)),x},FW={kernelName:ia,backendName:\"webgpu\",kernelFunc:qpe};var jpe=`\n fn bincount_write(index: i32, value: f32) {\n ${oo(\"&result[index]\",\"value\",\"float32\")}\n }\n`,Xpe=`\n fn bincount_write(index: i32, value: f32) {\n atomicStore(&result[index], bitcast(value));\n }\n`,nc=class{constructor(e,t,o=!1){this.outputShape=[],this.variableNames=[\"x\"],this.uniforms=\"binCountSize : i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.hasWeights=!0,this.binaryOutput=!1,this.outputShape=e,this.rank=e.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.binaryOutput=o,o&&(this.atomic=!1),this.hasWeights=t,this.hasWeights&&this.variableNames.push(\"w\"),this.shaderKey=`bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`}getUserCode(){return`\n ${this.binaryOutput?Xpe:jpe}\n ${G(\"index\")} {\n ${this.rank===1?`if (index < uniforms.xShape) {\n let indexVal = i32(getX(index));\n if (indexVal < uniforms.binCountSize) {\n let value = ${this.binaryOutput?1:this.hasWeights?\"getW(index)\":\"1.\"};\n bincount_write(indexVal, value);\n }\n }`:`let coord = getCoordsFromIndex(index);\n if (coordsInBounds2D(coord, uniforms.xShape)) {\n let indexVal = i32(getX(coord[0], coord[1]));\n if (indexVal < uniforms.binCountSize) {\n let value = ${this.binaryOutput?1:this.hasWeights?\"getW(coord[0], coord[1])\":\"1.\"};\n bincount_write(coord.x * uniforms.binCountSize + indexVal, value);\n }\n }`}\n }\n `}};function Ype(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=y.sizeFromShape(n.shape),u=y.sizeFromShape(s.shape)>0,l=[a],c=s.dtype,m=Nt({backend:t,attrs:{shape:l,value:0,dtype:c}}),d=new nc([i],u),f=[{type:\"int32\",data:[a]}],h=u?[n,s]:[n];return t.runWebGPUProgram(d,h,c,f,m)}var PW={kernelName:Tn,backendName:\"webgpu\",kernelFunc:Ype};var Ix=class{constructor(e){this.outputShape=[],this.variableNames=[\"s0\",\"s1\"],this.uniforms=\"s0Size : i32, s1Size : i32, \",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"broadcastArgs\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var s0 = 1.0;\n var s1 = 1.0;\n let indexS0 = index - uniforms.size + uniforms.s0Size;\n let indexS1 = index - uniforms.size + uniforms.s1Size;\n if (indexS0 >= 0) {\n s0 = getS0(indexS0);\n }\n if (indexS1 >= 0) {\n s1 = getS1(indexS1);\n }\n\n if (s0 == 1.0) {\n setOutputAtIndex(index, s1);\n } else if (s1 == 1.0) {\n setOutputAtIndex(index, s0);\n } else if (s0 != s1) {\n setOutputAtIndex(index, uniforms.NAN);\n } else {\n setOutputAtIndex(index, s0);\n }\n }\n }\n `}};function Qpe(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e;if(t.shouldExecuteOnCPU([o,n])){let l=t.tensorMap.get(o.dataId),c=t.tensorMap.get(n.dataId),m=l.values,d=c.values,f=C.assertAndGetBroadcastShape(Array.from(m),Array.from(d));return t.makeTensorInfo([f.length],\"int32\",Int32Array.from(f))}let s=y.sizeFromShape(o.shape),a=y.sizeFromShape(n.shape),i=Math.max(s,a),p=new Ix(i),u=[{type:\"int32\",data:[s]},{type:\"int32\",data:[a]}];return t.runWebGPUProgram(p,[o,n],\"int32\",u)}var OW={kernelName:ua,backendName:\"webgpu\",kernelFunc:Qpe};var Uv=tt({opType:fe.NOT_EQUAL,dtype:\"bool\",cpuKernelImpl:ZV}),MW={kernelName:Ro,backendName:\"webgpu\",kernelFunc:Uv};function Fi(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.tensorMap.get(o.dataId);return Pt({inputs:{x:n.complexTensorInfos.real},backend:t})}var LW={kernelName:si,backendName:\"webgpu\",kernelFunc:Fi};function BW(r,e){let t=new so(r.shape,Z.TO_INT),o=e.runWebGPUProgram(t,[r],\"int32\");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function Gv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s===\"complex64\"){if(n.dtype===\"complex64\")return Pt({inputs:{x:n},backend:t});let a=Yr(n.shape),i=Gv({inputs:{x:n},backend:t,attrs:{dtype:\"float32\"}}),p=Uo({inputs:{real:i,imag:a},backend:t});return a.dispose(),t.disposeData(i.dataId),p}if(n.dtype===\"complex64\"){let a=Fi({inputs:{input:n},backend:t}),i=Gv({inputs:{x:a},backend:t,attrs:{dtype:s}});return t.disposeData(a.dataId),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=Pt({inputs:{x:n},backend:t});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(t.shouldExecuteOnCPU([n])){let a=t.tensorMap.get(n.dataId).values,[i,p,u]=DV(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}if(s===\"int32\")return BW(n,t);if(s===\"bool\"){let a=t.makeTensorInfo([],\"bool\",y.getTypedArrayFromDType(\"bool\",1)),p=Uv({inputs:{a:n,b:a},backend:t});return t.disposeData(a.dataId),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var zW={kernelName:ho,backendName:\"webgpu\",kernelFunc:Gv};var Zpe=ye({opType:Z.CEIL,cpuKernelImpl:AV}),VW={kernelName:go,backendName:\"webgpu\",kernelFunc:Zpe};var vx=class{constructor(e){this.variableNames=[\"A\"],this.uniforms=\"minVal : f32, maxVal : f32,\",this.workPerThread=4,this.workgroupSize=[64,1,1],this.outputComponent=4,this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey=\"clipVec4\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let value = getAByOutputIndex(index);\n var clampedValue = clamp(\n value, vec4(uniforms.minVal), vec4(uniforms.maxVal));\n clampedValue = select(clampedValue, value, isnanVec4(value));\n setOutputAtIndex(index, clampedValue);\n }\n }\n `}};var kx=class{constructor(e){this.variableNames=[\"A\"],this.uniforms=\"minVal : f32, maxVal : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"clip\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let value = getAByOutputIndex(index);\n if (isnan(value)) {\n setOutputAtIndex(index, value);\n return;\n }\n setOutputAtIndex(index, clamp(value, uniforms.minVal, uniforms.maxVal));\n }\n }\n `}};function Jpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{clipValueMin:s,clipValueMax:a}=o,i,p=[{type:\"float32\",data:[s]},{type:\"float32\",data:[a]}];return y.sizeFromShape(n.shape)%4===0?i=new vx(n.shape):i=new kx(n.shape),t.runWebGPUProgram(i,[n],n.dtype,p)}var WW={kernelName:Go,backendName:\"webgpu\",kernelFunc:Jpe};var Nx=class{constructor(e){this.outputShape=[],this.variableNames=[\"real\",\"imag\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"complexAbs\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let re = abs(getRealByOutputIndex(index));\n let im = abs(getImagByOutputIndex(index));\n let mx = max(re, im);\n\n // The length function in wgsl may be not underflow-safe on some GPUs.\n // So the safe solution is to ensure underflow-safety in all cases.\n setOutputAtIndex(index, select(mx * length(vec2(1, min(re, im)/mx)), 0.0, mx == 0.0));\n }\n }\n `}};function UW(r,e){return{dataId:e.dataId,dtype:e.dtype,shape:r.shape}}function ele(r){let{inputs:e,backend:t}=r,{x:o}=e,n=t.tensorMap.get(o.dataId),s=new Nx(o.shape),a=[UW(o,n.complexTensorInfos.real),UW(o,n.complexTensorInfos.imag)];return t.runWebGPUProgram(s,a,a[0].dtype)}var GW={kernelName:Wi,backendName:\"webgpu\",kernelFunc:ele};var Tx=class{constructor(e){this.uniforms=\"\",this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=C.computeOutShape(e,1),this.variableNames=e.map((t,o)=>`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.offsetLength=e.length-1;for(let t=0;t0){e.push(\"if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }\");for(let s=1;sFi({inputs:{input:w},backend:t})),h=r.map(w=>Mp({inputs:{input:w},backend:t})),g=sc(f,e,t),x=sc(h,e,t),b=Uo({inputs:{real:g,imag:x},backend:t});return f.forEach(w=>t.disposeData(w.dataId)),h.forEach(w=>t.disposeData(w.dataId)),t.disposeData(g.dataId),t.disposeData(x.dataId),b}let n=t.shouldExecuteOnCPU(r);if(o===\"string\"&&(n=!0),n){let f=r.map(k=>{let E=[-1,y.sizeFromShape(k.shape.slice(e))];return le({inputs:{x:k},backend:t,attrs:{shape:E}})}),h=f.map(k=>({vals:t.readSync(k.dataId),shape:k.shape})),g=C.computeOutShape(f.map(k=>k.shape),1),x=f[0].shape[0]===1,b=FV(h,g,o,x),w=C.computeOutShape(r.map(k=>k.shape),e),S=t.makeTensorInfo(w,o,b);return f.forEach(k=>t.disposeData(k.dataId)),S}let s=t.device.limits.maxStorageBuffersPerShaderStage-1;if(r.length>s){let f=[];for(let g=0;gf.shape),u=new Tx(p),l=[],c=new Array(p.length-1);if(c.length>0){c[0]=p[0][1],l.push({type:\"int32\",data:[c[0]]});for(let f=1;ft.disposeData(f.dataId));let d=le({inputs:{x:m},backend:t,attrs:{shape:i}});return t.disposeData(m.dataId),d}function tle(r,e,t){let o=C.computeOutShape(r.map(s=>s.shape),e);return{tensors2D:r.map(s=>le({inputs:{x:s},backend:t,attrs:{shape:[y.sizeFromShape(s.shape.slice(0,e)),y.sizeFromShape(s.shape.slice(e))]}})),outShape:o}}function Hv(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,e[0].shape)[0],a=e.map(u=>u.shape);C.assertParamsConsistent(a,s);let i=C.computeOutShape(e.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return t.makeTensorInfo(i,e[0].dtype,[]);let p=e.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?Pt({inputs:{x:p[0]},backend:t}):sc(p,s,t)}var KW={kernelName:pa,backendName:\"webgpu\",kernelFunc:Hv};function rle(r,e,t,o,n=!1,s=null,a=!1,i=4,p=4,u=4){let l=D=>{switch(D){case 1:return\"resData = f32(x[xIndex]);\";case 3:return\"resData = vec3(x[xIndex], x[xIndex + 1], x[xIndex + 2]);\";case 4:return\"resData = vec4(x[xIndex / 4]);\";default:throw new Error(`innerElementSize ${D} is not supported.`)}},c=D=>{switch(D){case 1:return\"return f32(W[row * uniforms.wShape[3] + col]);\";case 4:return\"return vec4(W[(row * uniforms.wShape[3] + col) / 4]);\";default:throw new Error(`innerElementSize ${D} is not supported.`)}},m=r?`\n let coord = vec4(batch, xRow, xCol, xCh);\n `:`\n let coord = vec4(batch, xCh, xRow, xCol);\n `,d=r?`\n let coords = vec4(\n batch,\n row / outWidth,\n row % outWidth,\n col);\n `:`\n let coords = vec4(\n batch,\n row,\n col / outWidth,\n col % outWidth);\n `,f=r?\"uniforms.xShape[1]\":\"uniforms.xShape[2]\",h=r?\"uniforms.xShape[2]\":\"uniforms.xShape[3]\",g=r?\"row\":\"col\",x=r?\"col\":\"row\",b=`\n let inChannels = uniforms.wShape[2];\n let outWidth = ${r?\"uniforms.outShape[2]\":\"uniforms.outShape[3]\"};\n let outRow = ${g} / outWidth;\n let outCol = ${g} % outWidth;\n\n let WRow = ${x} / (uniforms.filterDims[1] * inChannels);\n let WCol = ${x} / inChannels % uniforms.filterDims[1];\n let xRow = outRow * uniforms.strides[0] + uniforms.dilations[0] * WRow - uniforms.pads[0];\n let xCol = outCol * uniforms.strides[1] + uniforms.dilations[1] * WCol - uniforms.pads[1];\n let xCh = ${x} % inChannels;\n var resData = ${Ae(i)}(0.0);\n // The bounds checking is always needed since we use it to pad zero for\n // the 'same' padding type.\n if (xRow >= 0 && xRow < ${f} && xCol >= 0 && xCol < ${h}) {\n ${m}\n let xIndex = getIndexFromCoords4D(coord, uniforms.xShape);\n ${l(i)}\n }\n return resData;`,w=r?e&&o?`\n ${b}`:`\n if (row < uniforms.dimAOuter && col < uniforms.dimInner) {\n ${b}\n }\n return ${Ae(i)}(0.0);`:o&&t?`\n ${b}`:`\n if (row < uniforms.dimInner && col < uniforms.dimBOuter) {\n ${b}\n }\n return ${Ae(i)}(0.0);`,S=`${c(p)}`,k=Ae(u),T=r?Ae(i):Ae(p),E=r?Ae(p):Ae(i);return`\n ${gr(s,a,u===4,4)}\n fn mm_readA(batch: i32, row : i32, col : i32) -> ${T} {\n ${r?w:S}\n }\n\n fn mm_readB(batch: i32, row : i32, col : i32) -> ${E} {\n ${r?S:w}\n }\n\n fn mm_write(batch: i32, row : i32, col : i32, valueIn : ${k}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)\n {\n var value = valueIn;\n let outWidth = ${r?\"uniforms.outShape[2]\":\"uniforms.outShape[3]\"};\n ${d}\n ${no(n,s)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }`}var _x=class{constructor(e,t,o,n,s=!1,a=null,i=!1,p=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat===\"channelsLast\",this.isVec4=((e.inChannels%4===0||e.inChannels%3===0)&&this.isChannelsLast||e.outWidth%4===0&&!this.isChannelsLast)&&e.outChannels%4===0,this.dispatchLayout=this.isChannelsLast?{x:[3],y:[1,2],z:[0]}:{x:[2,3],y:[1],z:[0]},this.workgroupSize=ym(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=bm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4?(this.outputComponent=4,this.isChannelsLast&&e.inChannels%4!==0?(this.innerElementSize=3,this.variableComponents=[1,4]):(this.innerElementSize=4,this.variableComponents=[4,4]),s&&(this.variableNames.push(\"bias\"),this.variableComponents.push(4)),i&&(this.variableNames.push(\"preluActivationWeights\"),this.variableComponents.push(4))):(this.innerElementSize=this.elementsPerThread[0],s&&this.variableNames.push(\"bias\"),i&&this.variableNames.push(\"preluActivationWeights\")),this.sequentialAccessByThreads=p,this.addBias=s,this.activation=a,this.hasPreluActivationWeights=i,this.tileAOuter=this.workgroupSize[1]*this.elementsPerThread[1],this.tileBOuter=this.workgroupSize[0]*this.elementsPerThread[0],this.tileInner=Math.max(this.workgroupSize[0]*this.innerElementSize,this.workgroupSize[1]),this.fitAOuter=t%this.tileAOuter===0,this.fitBOuter=o%this.tileBOuter===0,this.fitInner=n%this.tileInner===0,this.shaderKey=`conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`}getUserCode(){let e=this.isVec4?Fp(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner):Pp(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner,!1,null,this.sequentialAccessByThreads),t=this.isVec4?[this.innerElementSize,4,4]:[1,1,1];return`\n ${rle(this.isChannelsLast,this.fitAOuter,this.fitBOuter,this.fitInner,this.addBias,this.activation,this.hasPreluActivationWeights,t[0],t[1],t[2])}\n ${e}\n `}};var Ex=class{constructor(e,t=!1,o=null,n=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,\",this.workgroupSize=[4,4,8],this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat===\"channelsLast\",this.dispatchLayout=this.isChannelsLast?{x:[2],y:[1],z:[0,3]}:{x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t,this.activation=o,this.hasPreluActivationWeights=n,t&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),this.shaderKey=`conv2dnaive_${this.activation}_${this.isChannelsLast}`}getUserCode(){return`\n ${gr(this.activation,this.hasPreluActivationWeights,!1,4)}\n fn readInp(batch : i32, row : i32, col : i32, chan : i32) -> f32{\n let coords = vec4(batch, row, col, chan);\n if (coordsInBounds4D(coords, uniforms.xShape)) {\n return getX(batch, row, col, chan);\n } else {\n return 0.0;\n }\n }\n fn readFilt(row : i32, col : i32, xChannel : i32, outChannel : i32) -> f32{\n let coords = vec4(row, col, xChannel, outChannel);\n if(coordsInBounds4D(coords, uniforms.wShape)) {\n return getW(row, col, xChannel, outChannel);\n } else {\n return 0.0;\n }\n }\n fn writeResult(batch : i32, row : i32, col : i32, chan : i32, valueIn : f32) {\n let coords = ${this.isChannelsLast?\"vec4(batch, row, col, chan);\":\"vec4(batch, chan, row, col);\"}\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n var value = valueIn;\n ${no(this.addBias,this.activation)}\n setOutputAtCoords(coords.x, coords.y, coords.z, coords.w, value);\n }\n }\n ${G(\"index\")} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let outChannel = ${this.isChannelsLast?\"coords[3];\":\"coords[1];\"}\n let outRow = ${this.isChannelsLast?\"coords[1];\":\"coords[2];\"}\n let outCol = ${this.isChannelsLast?\"coords[2];\":\"coords[3];\"}\n var acc : f32 = 0.0;\n for (var row = 0; row < uniforms.filterDims[0]; row = row + 1) {\n for (var col = 0; col < uniforms.filterDims[1]; col = col + 1) {\n let xRow = outRow * uniforms.strides[0] + uniforms.dilations[0] * row - uniforms.pads[0];\n let xCol = outCol * uniforms.strides[1] + uniforms.dilations[1] * col - uniforms.pads[1];\n for (var xChannel = 0; xChannel < ${this.isChannelsLast?\"uniforms.xShape[3];\":\"uniforms.xShape[1];\"} xChannel = xChannel + 1) {\n ${this.isChannelsLast?\"let v = readInp(batch, xRow, xCol, xChannel);\":\"let v = readInp(batch, xChannel, xRow, xCol);\"}\n let f = readFilt(row, col, xChannel, outChannel);\n acc = acc + v * f;\n }\n }\n }\n writeResult(batch, outRow, outCol, outChannel, acc);\n }\n `}};var $x=class{constructor(e,t){this.variableNames=[\"x\"],this.uniforms=`pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32,\n inChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=t,this.shaderKey=`im2col_${this.isChannelsLast}`}getUserCode(){let e=this.isChannelsLast?1:2,t=this.isChannelsLast?2:3,o=this.isChannelsLast?\"coords[1]\":\"coords[2]\",n=this.isChannelsLast?\"coords[2]\":\"coords[1]\",s=this.isChannelsLast?\"getX(batch, xRow, xCol, ch)\":\"getX(batch, ch, xRow, xCol)\";return`\n ${G(\"index\")} {\n let coords = getCoordsFromIndex(index);\n if(index < uniforms.size) {\n let batch = coords[0];\n let row = ${o};\n let col = ${n};\n let offsetY = (row / uniforms.outWidth) * uniforms.strides[0] - uniforms.pads[0];\n let xRow = offsetY + uniforms.dilations[0] * (col / uniforms.itemsPerBlockRow);\n var value = 0.0;\n if(xRow < uniforms.xShape[${e}] && xRow >= 0) {\n let offsetX = (row % uniforms.outWidth) * uniforms.strides[1] -\n uniforms.pads[1];\n let xCol = offsetX + uniforms.dilations[1] * ((col %\n uniforms.itemsPerBlockRow) / uniforms.inChannels);\n let ch = col % uniforms.inChannels;\n if(xCol < uniforms.xShape[${t}] && xCol >= 0) {\n value = ${s};\n }\n }\n setOutputAtIndex(index, value);\n }\n }\n `}};function Rx(r,e){let t=r.length;return t>=3?e?[...r.slice(0,-3),r[t-3]*r[t-2],r[t-1]]:[...r.slice(0,-3),r[t-3],r[t-2]*r[t-1]]:!e&&t===1&&r[0]>1?[r[0],1]:null}function ole({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=t.dataFormat===\"channelsLast\",u=!p,l=!1,c=p&&t.filterHeight===t.inHeight&&t.filterWidth===t.inWidth&&t.padInfo.type===\"VALID\",m=[],d,f;if(c){let x=t.inHeight*t.inWidth*t.inChannels;d=le({inputs:{x:r},backend:o,attrs:{shape:[1,t.batchSize,x]}}),f=le({inputs:{x:e},backend:o,attrs:{shape:[1,x,t.outChannels]}})}else d=le({inputs:{x:r},backend:o,attrs:{shape:p?[t.batchSize,t.inHeight*t.inWidth,t.inChannels]:[t.batchSize,t.inChannels,t.inHeight*t.inWidth]}}),f=le({inputs:{x:e},backend:o,attrs:{shape:[1,t.inChannels,t.outChannels]}});if(m.push(d),m.push(f),s!=null){let x=Rx(s.shape,p);x!=null&&(s=le({inputs:{x:s},backend:o,attrs:{shape:x}}),m.push(s))}if(n!=null){let x=Rx(n.shape,p);x!=null&&(n=le({inputs:{x:n},backend:o,attrs:{shape:x}}),m.push(n))}let h=Op({a:p?d:f,b:p?f:d,transposeA:u,transposeB:l,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),g=le({inputs:{x:h},backend:o,attrs:{shape:t.outShape}});m.push(h);for(let x of m)o.disposeData(x.dataId);return g}function nle({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:l,strideWidth:c,strideHeight:m,padInfo:d,outWidth:f,outHeight:h,dilationWidth:g,dilationHeight:x,dataFormat:b}=t,w=b===\"channelsLast\",S=p*u*l,k=h*f,T=w?[t.batchSize,k,S]:[t.batchSize,S,k],E=new $x(T,w),R=[{type:\"int32\",data:[d.top,d.left]},{type:\"int32\",data:[m,c]},{type:\"int32\",data:[x,g]},{type:\"int32\",data:[f]},{type:\"int32\",data:[l*p]},{type:\"int32\",data:[l]}],D=o.runWebGPUProgram(E,[r],r.dtype,R),F=[];F.push(D);let O=le({inputs:{x:e},backend:o,attrs:{shape:[1,S,-1]}});if(F.push(O),s!=null){let U=Rx(s.shape,w);U!=null&&(s=le({inputs:{x:s},backend:o,attrs:{shape:U}}),F.push(s))}if(n!=null){let U=Rx(n.shape,w);U!=null&&(n=le({inputs:{x:n},backend:o,attrs:{shape:U}}),F.push(n))}let B=Op({a:w?D:O,b:w?O:D,transposeA:!w,transposeB:!1,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),z=le({inputs:{x:B},backend:o,attrs:{shape:t.outShape}});F.push(B);for(let U of F)o.disposeData(U.dataId);return z}function Dx({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=n!=null,u=s!=null,l=t.dataFormat===\"channelsLast\",c=l&&t.filterHeight===t.inHeight&&t.filterWidth===t.inWidth&&t.padInfo.type===\"VALID\",m=A().getBool(\"WEBGPU_USE_NAIVE_CONV2D_DEBUG\");if(!m&&(c||t.filterHeight===1&&t.filterWidth===1&&t.dilationHeight===1&&t.dilationWidth===1&&t.strideHeight===1&&t.strideWidth===1&&(t.padInfo.type===\"SAME\"||t.padInfo.type===\"VALID\")))return ole({x:r,filter:e,convInfo:t,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});let d=A().getNumber(\"WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL\"),f=d>-1?d:o.thresholdToIncreaseWorkgroups,h=t.batchSize*Math.ceil(t.outHeight*t.outWidth/32)*Math.ceil(t.outChannels/32);if(A().getBool(\"WEBGPU_CONV_SEPARATE_IM2COL_SHADER\")||h<=f)return nle({x:r,filter:e,convInfo:t,backend:o,bias:n,preluActivationWeights:s,leakyreluAlpha:a,activation:i});let g,x=[t.padInfo.top,t.padInfo.left],b=[{type:\"int32\",data:[t.filterHeight,t.filterWidth]},{type:\"int32\",data:[...x]},{type:\"int32\",data:[t.strideHeight,t.strideWidth]},{type:\"int32\",data:[t.dilationHeight,t.dilationWidth]}];if(m)g=new Ex(t,p,i,u);else{let T=l?t.outHeight*t.outWidth:t.outChannels,E=l?t.outChannels:t.outHeight*t.outWidth,R=t.filterHeight*t.filterWidth*t.inChannels;b.push({type:\"int32\",data:[T]},{type:\"int32\",data:[E]},{type:\"int32\",data:[R]});let D=o.adapterInfo.isIntel();g=new _x(t,T,E,R,p,i,u,D)}let w=[],S=[r,e];p&&(!l&&n.shape.length===1&&(n=le({inputs:{x:n},backend:o,attrs:{shape:[n.shape[0],1,1]}}),w.push(n)),S.push(n)),u&&(!l&&s.shape.length===1&&(s=le({inputs:{x:s},backend:o,attrs:{shape:[s.shape[0],1,1]}}),w.push(s)),S.push(s)),i===\"leakyrelu\"&&(b.push({type:\"float32\",data:[a]}),g.uniforms+=\" alpha : f32,\");let k=o.runWebGPUProgram(g,S,r.dtype,b);for(let T of w)o.disposeData(T.dataId);return k}function sle(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=t,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,s.shape,a,u,i,l,!1,c);return Dx({x:n,filter:s,convInfo:m,backend:o})}var qW={kernelName:En,backendName:\"webgpu\",kernelFunc:sle};var Ax=class{constructor(e){this.variableNames=[\"dy\",\"W\"],this.uniforms=\"filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,\",this.workgroupSize=[64,1,1],this.size=!1,this.isVec4=!1,this.workPerThread=1,this.outputShape=e.inShape,this.isChannelsLast=e.dataFormat===\"channelsLast\",this.isVec4=this.isChannelsLast&&e.outChannels%4===0&&e.inChannels%4===0,this.isVec4?(this.workPerThread=2,this.outputComponent=4,this.workgroupSize=[4,4,4],this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[4,this.workPerThread,1])):(this.size=!0,this.workPerThread=1,this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)),this.shaderKey=`conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`}getUserCode(){let e=this.isChannelsLast?1:2,t=this.isChannelsLast?2:3,o=this.isChannelsLast?3:1,n=`\n ${G()} {\n let batch = i32(globalId.z) / uniforms.outShape[1];\n let r = i32(globalId.z) % uniforms.outShape[1];\n let c = i32(globalId.y) * ${this.workPerThread};\n let d1 = i32(globalId.x) * 4;\n\n let dyCorner = vec2(r, c) - uniforms.pads;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd: array, ${this.workPerThread}>;\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = vec4(0.0);\n }\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + 1) {\n let dyR = f32(dyCorner.x + wR) / f32(uniforms.strides.x);\n let wRPerm = uniforms.filterDims.x - 1 - wR;\n if (dyR < 0.0 || dyR >= f32(uniforms.outBackprop[1]) ||\n fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + 1) {\n let dyC = f32(dyCorner.y + wC) / f32(uniforms.strides.y);\n let dyC2 = f32(dyCorner.y + 1 + wC) / f32(uniforms.strides.y);\n let wCPerm = uniforms.filterDims.y - 1 - wC;\n var bDyCVal = true;\n var bDyCVal2 = true;\n if (dyC < 0.0 || dyC >= f32(uniforms.outBackprop[2]) ||\n fract(dyC) > 0.0) {\n bDyCVal = false;\n }\n if (dyC2 < 0.0 || dyC2 >= f32(uniforms.outBackprop[2]) ||\n fract(dyC2) > 0.0) {\n bDyCVal2 = false;\n }\n\n let idyC = i32(dyC);\n let idyC2 = i32(dyC2);\n if (bDyCVal && bDyCVal2) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n xValue = getDy(batch, idyR, idyC2, d2);\n dotProd[1] = dotProd[1] + vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n }\n } else if (bDyCVal) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[0] = dotProd[0] + tmpval;\n }\n } else if (bDyCVal2) {\n let d2Length = uniforms.outBackprop[3];\n for (var d2 = 0; d2 < d2Length; d2 = d2 + 4) {\n let wValue0 = getW(wRPerm, wCPerm, d1, d2);\n let wValue1 = getW(wRPerm, wCPerm, d1 + 1, d2);\n let wValue2 = getW(wRPerm, wCPerm, d1 + 2, d2);\n let wValue3 = getW(wRPerm, wCPerm, d1 + 3, d2);\n var xValue = getDy(batch, idyR, idyC2, d2);\n let tmpval = vec4(dot(xValue, wValue0),\n dot(xValue, wValue1),\n dot(xValue, wValue2),\n dot(xValue, wValue3));\n dotProd[1] = dotProd[1] + tmpval;\n }\n }\n }\n }\n\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let coords = vec4(batch, r, c + i, d1);\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], dotProd[i]);\n }\n }\n }\n `;return this.isVec4?`\n ${n}\n `:`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d1 = coords[${o}];\n\n let dyCorner = vec2(coords[${e}], coords[${t}]) - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n\n // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims.x; wR = wR + 1) {\n let dyR = (f32(dyRCorner) + f32(wR)) / f32(uniforms.strides.x);\n let wRPerm = uniforms.filterDims.x - 1 - wR;\n if (dyR < 0.0 || dyR >= f32(uniforms.outBackprop[1]) || fract(dyR) > 0.0 ||\n wRPerm < 0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims.y; wC = wC + 1) {\n let dyC = (f32(dyCCorner) + f32(wC)) / f32(uniforms.strides.y);\n let wCPerm = uniforms.filterDims.y - 1 - wC;\n if (dyC < 0.0 || dyC >= f32(uniforms.outBackprop[2]) ||\n fract(dyC) > 0.0 || wCPerm < 0) {\n continue;\n }\n let idyC = i32(dyC);\n\n for (var d2 = 0; d2 < uniforms.outBackprop[3]; d2 = d2 + 1) {\n let xValue = ${this.isChannelsLast?\"getDy(batch, idyR, idyC, d2)\":\"getDy(batch, d2, idyR, idyC)\"};\n let wValue = getW(wRPerm, wCPerm, d1, d2);\n dotProd = dotProd + xValue * wValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},Fx=class{constructor(e){this.variableNames=[\"x\",\"dy\"],this.uniforms=\"pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e.dataFormat===\"channelsLast\",this.shaderKey=`conv2DDerFilter_${this.isChannelsLast}`}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wR = coords[0];\n let wC = coords[1];\n let d1 = coords[2];\n let d2 = coords[3];\n\n // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b = b + 1) {\n for (var yR = 0; yR < uniforms.outHeight; yR = yR + 1) {\n let xR = wR + yR * uniforms.strides[0] - uniforms.pads[0];\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC = yC + 1) {\n let xC = wC + yC * uniforms.strides[1] - uniforms.pads[1];\n\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n if (${this.isChannelsLast}) {\n let dyValue = getDy(b, yR, yC, d2);\n let xValue = getX(b, xR, xC, d1);\n dotProd = dotProd + xValue * dyValue;\n } else {\n let dyValue = getDy(b, d2, yR, yC);\n let xValue = getX(b, d1, xR, xC);\n dotProd = dotProd + xValue * dyValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},Px=class{constructor(e){this.variableNames=[\"x\",\"dy\"],this.uniforms=`pads : vec3, strides : vec3, batchSize : i32, outDepth : i32,\n outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"conv3DDerFilter\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wF = coords.x;\n let wR = coords.y;\n let wC = coords.z;\n let d1 = coords.w;\n let d2 = coords.u;\n\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b++) {\n for (var yF = 0; yF < uniforms.outDepth; yF++) {\n let xF = wF + yF * uniforms.strides[0] - uniforms.pads[0];\n if (xF < 0 || xF >= uniforms.inDepth) {\n continue;\n }\n\n for (var yR = 0; yR < uniforms.outHeight; yR++) {\n let xR = wR + yR * uniforms.strides[1] - uniforms.pads[1];\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC++) {\n let xC = wC + yC * uniforms.strides[2] - uniforms.pads[2];\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n let dyValue = getDy(b, yF, yR, yC, d2);\n let xValue = getX(b, xF, xR, xC, d1);\n dotProd += xValue * dyValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},Ox=class{constructor(e){this.variableNames=[\"dy\",\"W\"],this.uniforms=`filterDims : vec3, pads : vec3, strides : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"conv3DDerInput\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let d1 = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyFCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n var dotProd = 0.0;\n for (var wF = 0; wF < uniforms.filterDims[0]; wF++) {\n let dyF = f32(dyFCorner + wF) / f32(uniforms.strides[0]);\n if (dyF < 0.0 || dyF >= f32(uniforms.outDepth) || fract(dyF) > 0.0) {\n continue;\n }\n let idyF = i32(dyF);\n\n let wFPerm = uniforms.filterDims[0] - 1 - wF;\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n let wRPerm = uniforms.filterDims[1] - 1 - wR;\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let wCPerm = uniforms.filterDims[2] - 1 - wC;\n\n for (var d2 = 0; d2 < uniforms.outChannels; d2++) {\n let xValue = getDy(batch, idyF, idyR, idyC, d2);\n let wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2);\n dotProd += xValue * wValue;\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function ale(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:l}=o,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,l,a,1,i,u,!1,c),d=new Fx(m),f=[{type:\"int32\",data:[m.padInfo.top,m.padInfo.left]},{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.batchSize]},{type:\"int32\",data:[m.outHeight]},{type:\"int32\",data:[m.outWidth]},{type:\"int32\",data:[m.inHeight]},{type:\"int32\",data:[m.inWidth]}];return t.runWebGPUProgram(d,[n,s],n.dtype,f)}var jW={kernelName:Ui,backendName:\"webgpu\",kernelFunc:ale};function ile(r=4){let e=s=>{switch(s){case 1:return\"return W[getIndexFromCoords4D(coord, uniforms.wShape)];\";case 4:return`\n let coord1 = vec4(coordX, coordY, col + 1, rowInner);\n let coord2 = vec4(coordX, coordY, col + 2, rowInner);\n let coord3 = vec4(coordX, coordY, col + 3, rowInner);\n let v0 = W[getIndexFromCoords4D(coord, uniforms.wShape)];\n let v1 = W[getIndexFromCoords4D(coord1, uniforms.wShape)];\n let v2 = W[getIndexFromCoords4D(coord2, uniforms.wShape)];\n let v3 = W[getIndexFromCoords4D(coord3, uniforms.wShape)];\n return vec4(v0, v1, v2, v3);\n `;default:throw new Error(`innerElementSize ${s} is not supported.`)}},o=`if (row < uniforms.dimAOuter && col < uniforms.dimInner) {\n ${`\n let outRow = row / uniforms.outShape[2];\n let outCol = row % uniforms.outShape[2];\n\n let WRow = col / (uniforms.filterDims[1] * uniforms.outBackprop[3]);\n let WCol = col / uniforms.outBackprop[3] % uniforms.filterDims[1];\n let xR = f32(outRow - uniforms.pads[0] + WRow) / f32(uniforms.strides[0]);\n let xC = f32(outCol - uniforms.pads[1] + WCol) / f32(uniforms.strides[1]);\n if (xR < 0.0 || xR >= f32(uniforms.outBackprop[1]) || fract(xR) > 0.0) {\n return ${Ae(r)}(0.0);\n }\n if (xC < 0.0 || xC >= f32(uniforms.outBackprop[2]) || fract(xC) > 0.0) {\n return ${Ae(r)}(0.0);\n }\n let coord = vec4(\n batch,\n i32(xR),\n i32(xC),\n col % uniforms.outBackprop[3]);\n return x[getIndexFromCoords4D(coord, uniforms.xShape)/${r}];`}\n }\n return ${Ae(r)}(0.0);`;return`\n fn mm_readA(batch: i32, row : i32, col : i32) -> ${Ae(r)} {\n ${o}\n }\n\n fn mm_readB(batch: i32, row : i32, col : i32) -> ${Ae(r)} {\n let coordX = uniforms.filterDims.x - 1 -\n row / (uniforms.filterDims[1] * uniforms.outBackprop[3]);\n let coordY = uniforms.filterDims.y - 1 -\n (row / uniforms.outBackprop[3]) % uniforms.filterDims[1];\n if (row < uniforms.dimInner && col < uniforms.dimBOuter &&\n coordX >= 0 && coordY >= 0) {\n let rowInner = row % uniforms.outBackprop[3];\n let coord = vec4(coordX, coordY, col, rowInner);\n ${e(r)}\n }\n return ${Ae(r)}(0.0);\n }\n\n fn mm_write(batch: i32, row : i32, col : i32, valueInput : ${Ae(r)}) {\n if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) {\n var value = valueInput;\n let outCoord = vec4(\n batch,\n row / uniforms.outShape[2],\n row % uniforms.outShape[2],\n col);\n result[getIndexFromCoords4D(outCoord, uniforms.outShape)/${r}] = value;\n }\n }`}var Mx=class{constructor(e){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,\",this.outputShape=e.inShape,y.assert(e.dataFormat===\"channelsLast\",()=>\"TODO: NCHW is unimplemented\"),this.isVec4=e.inChannels%4===0&&e.outChannels%4===0,this.dispatchLayout={x:[3],y:[1,2],z:[0]},this.workgroupSize=ym(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=bm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4&&(this.outputComponent=4,this.variableComponents=[4,1]),this.shaderKey=`conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`}getUserCode(){let e=this.isVec4?Fp(this.elementsPerThread,this.workgroupSize):Pp(this.elementsPerThread,this.workgroupSize);return`\n ${ile(this.isVec4?4:1)}\n ${e}\n `}};function ule(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(u),m=C.computeConv2DInfo(a,s.shape,i,1,p,l,!1,c),d=[{type:\"int32\",data:[m.filterHeight,m.filterWidth]},{type:\"int32\",data:[m.filterHeight-1-m.padInfo.top,m.filterWidth-1-m.padInfo.left]},{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.batchSize,m.outHeight,m.outWidth,m.outChannels]}],f;if(A().getBool(\"WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE\")||m.dataFormat!==\"channelsLast\")f=new Ax(m);else{f=new Mx(m);let h=m.inHeight*m.inWidth,g=m.inChannels,x=m.filterHeight*m.filterWidth*m.outChannels;d.push({type:\"uint32\",data:[h]},{type:\"uint32\",data:[g]},{type:\"uint32\",data:[x]})}return t.runWebGPUProgram(f,[n,s],\"float32\",d)}var XW={kernelName:$n,backendName:\"webgpu\",kernelFunc:ule};var Lx=class{constructor(e){this.variableNames=[\"x\",\"W\"],this.uniforms=\"filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"conv3dnaive\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords.x;\n let d2 = coords.u;\n\n let xFRCCorner = vec3(coords.y, coords.z, coords.w) * uniforms.strides - uniforms.pads;\n let xFCorner = xFRCCorner.x;\n let xRCorner = xFRCCorner.y;\n let xCCorner = xFRCCorner.z;\n\n let inputDepthNearestVec4 = (uniforms.xShape.u / 4) * 4;\n let inputDepthVec4Remainder = uniforms.xShape.u % 4;\n\n var dotProd = 0.0;\n for (var wF = 0; wF < uniforms.filterDims[0]; wF++) {\n let xF = xFCorner + wF * uniforms.dilations[0];\n if (xF < 0 || xF >= uniforms.xShape.y) {\n continue;\n }\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let xR = xRCorner + wR * uniforms.dilations[1];\n if (xR < 0 || xR >= uniforms.xShape.z) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let xC = xCCorner + wC * uniforms.dilations[2];\n if (xC < 0 || xC >= uniforms.xShape.w) {\n continue;\n }\n\n for (var d1 = 0; d1 < inputDepthNearestVec4; d1 += 4) {\n let xValues = vec4(\n getX(batch, xF, xR, xC, d1),\n getX(batch, xF, xR, xC, d1 + 1),\n getX(batch, xF, xR, xC, d1 + 2),\n getX(batch, xF, xR, xC, d1 + 3)\n );\n let wValues = vec4(\n getW(wF, wR, wC, d1, d2),\n getW(wF, wR, wC, d1 + 1, d2),\n getW(wF, wR, wC, d1 + 2, d2),\n getW(wF, wR, wC, d1 + 3, d2)\n );\n\n dotProd += dot(xValues, wValues);\n }\n\n if (inputDepthVec4Remainder == 1) {\n dotProd += getX(batch, xF, xR, xC, inputDepthNearestVec4) *\n getW(wF, wR, wC, inputDepthNearestVec4, d2);\n } else if (inputDepthVec4Remainder == 2) {\n let xValues = vec2(\n getX(batch, xF, xR, xC, inputDepthNearestVec4),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1)\n );\n let wValues = vec2(\n getW(wF, wR, wC, inputDepthNearestVec4, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 1, d2)\n );\n dotProd += dot(xValues, wValues);\n } else if (inputDepthVec4Remainder == 3) {\n let xValues = vec3(\n getX(batch, xF, xR, xC, inputDepthNearestVec4),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 1),\n getX(batch, xF, xR, xC, inputDepthNearestVec4 + 2)\n );\n let wValues = vec3(\n getW(wF, wR, wC, inputDepthNearestVec4, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 1, d2),\n getW(wF, wR, wC, inputDepthNearestVec4 + 2, d2)\n );\n dotProd += dot(xValues, wValues);\n }\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }`}};function ple(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeConv3DInfo(n.shape,s.shape,a,p,i),l=[u.padInfo.front,u.padInfo.top,u.padInfo.left],c=[{type:\"int32\",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:\"int32\",data:[...l]},{type:\"int32\",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.dilationDepth,u.dilationHeight,u.dilationWidth]}],m=new Lx(u),d=pt(n.dtype,s.dtype);return t.runWebGPUProgram(m,[n,s],d,c)}var YW={kernelName:Rn,backendName:\"webgpu\",kernelFunc:ple};function lle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,filterShape:p}=o,u=C.computeConv3DInfo(n.shape,p,a,1,i),l=new Px(u),c=[{type:\"int32\",data:[u.padInfo.front,u.padInfo.top,u.padInfo.left]},{type:\"int32\",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.batchSize]},{type:\"int32\",data:[u.outDepth]},{type:\"int32\",data:[u.outHeight]},{type:\"int32\",data:[u.outWidth]},{type:\"int32\",data:[u.inDepth]},{type:\"int32\",data:[u.inHeight]},{type:\"int32\",data:[u.inWidth]}];return t.runWebGPUProgram(l,[n,s],s.dtype,c)}var QW={kernelName:ti,backendName:\"webgpu\",kernelFunc:lle};function cle(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{strides:a,pad:i,inputShape:p}=o,u=C.computeConv3DInfo(p,s.shape,a,1,i),l=new Ox(u),c=[{type:\"int32\",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:\"int32\",data:[u.filterDepth-1-u.padInfo.front,u.filterHeight-1-u.padInfo.top,u.filterWidth-1-u.padInfo.left]},{type:\"int32\",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.outDepth]},{type:\"int32\",data:[u.outHeight]},{type:\"int32\",data:[u.outWidth]},{type:\"int32\",data:[u.outChannels]}];return t.runWebGPUProgram(l,[n,s],n.dtype,c)}var ZW={kernelName:Dn,backendName:\"webgpu\",kernelFunc:cle};var mle=ye({opType:Z.COS}),JW={kernelName:An,backendName:\"webgpu\",kernelFunc:mle};var dle=ye({opType:Z.COSH}),eU={kernelName:Fn,backendName:\"webgpu\",kernelFunc:dle};var Bx=class{constructor(e,t,o,n){this.variableNames=[\"Image\",\"Boxes\",\"BoxInd\"],this.uniforms=\"extrapolationValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0;let[s]=t;this.outputShape=[s,o[0],o[1],e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.methodId=n===\"bilinear\"?1:0,this.cropHeightBiggerThan1=this.outputShape[1]>1,this.cropWidthBiggerThan1=this.outputShape[2]>1,this.shaderKey=`cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`}getUserCode(){let[e,t]=[\"f32(uniforms.imageShape[1] - 1)\",\"f32(uniforms.imageShape[2] - 1)\"],[o,n,s]=this.cropHeightBiggerThan1?[`(${e} / f32(uniforms.outShape[1] - 1))`,\"(y2-y1) * height_ratio\",`y1*${e} + f32(y)*(height_scale)`]:[\"0.0\",\"0.0\",`0.5 * (y1+y2) * ${e}`],[a,i,p]=this.cropWidthBiggerThan1?[`(${t} / f32(uniforms.outShape[2] - 1))`,\"(x2-x1) * width_ratio\",`x1*${t} + f32(x)*(width_scale)`]:[\"0.0\",\"0.0\",`0.5 * (x1+x2) * ${t}`];return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let height_ratio = f32(${o});\n let width_ratio = f32(${a});\n let b = coords[0];\n let y = coords[1];\n let x = coords[2];\n let d = coords[3];\n // get box vals\n let y1 = getBoxes(b, 0);\n let x1 = getBoxes(b, 1);\n let y2 = getBoxes(b, 2);\n let x2 = getBoxes(b, 3);\n // get image in batch index\n let bInd = i32(round(getBoxInd(b)));\n if(bInd < 0 || bInd >= uniforms.outShape[0]) {\n return;\n }\n let height_scale = ${n};\n let width_scale = ${i};\n let in_y = ${s};\n if( in_y < 0.0 || in_y > ${e} ) {\n setOutputAtIndex(index, uniforms.extrapolationValue);\n return;\n }\n let in_x = ${p};\n if( in_x < 0.0 || in_x > ${t} ) {\n setOutputAtIndex(index, uniforms.extrapolationValue);\n return;\n }\n let sourceFracIndexCR = vec2(in_x,in_y);\n if(${this.methodId} == 1) {\n // Compute the four integer indices.\n let sourceFloorCR = vec2(sourceFracIndexCR);\n let sourceCeilCR = vec2(ceil(sourceFracIndexCR));\n let topLeft = getImage(bInd, sourceFloorCR.y, sourceFloorCR.x, d);\n let bottomLeft = getImage(bInd, sourceCeilCR.y, sourceFloorCR.x, d);\n let topRight = getImage(bInd, sourceFloorCR.y, sourceCeilCR.x, d);\n let bottomRight = getImage(bInd, sourceCeilCR.y, sourceCeilCR.x, d);\n let fracCR = sourceFracIndexCR - vec2(sourceFloorCR);\n let top = topLeft + (topRight - topLeft) * fracCR.x;\n let bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x;\n let newValue = top + (bottom - top) * fracCR.y;\n setOutputAtIndex(index, newValue);\n } else {\n // Compute the coordinators of nearest neighbor point.\n let sourceNearestCR = vec2(floor(\n sourceFracIndexCR + vec2(0.5,0.5)));\n let newValue = getImage(\n bInd, sourceNearestCR.y, sourceNearestCR.x, d);\n setOutputAtIndex(index, newValue);\n }\n }\n }\n `}};var fle=r=>{let{inputs:e,backend:t,attrs:o}=r,{image:n,boxes:s,boxInd:a}=e,{cropSize:i,method:p,extrapolationValue:u}=o,l=new Bx(n.shape[3],s.shape,i,p),c=[{type:\"float32\",data:[u]}];return t.runWebGPUProgram(l,[n,s,a],\"float32\",c)},tU={kernelName:Mn,backendName:\"webgpu\",kernelFunc:fle};var Lp;(function(r){r.Prod=\"*\",r.Sum=\"+\"})(Lp||(Lp={}));var Tm=class{constructor(e,t,o,n){this.variableNames=[\"x\"],this.uniforms=\"index : f32,\",this.size=!0,this.workgroupSize=[128,1,1],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.exclusive=o,this.reverse=n,this.op=e,this.shaderKey=`cum_${this.op}_${this.exclusive}_${this.reverse}`}getUserCode(){let e=this.outputShape.length,t=this.op===Lp.Prod?\"1.0\":\"0.0\",o=this.exclusive?t:`getX(${rU(e,\"coords\",this.op)})`,n=this.outputShape[this.outputShape.length-1],s=\"\",a=\"\";return this.exclusive?(s=this.reverse?`end != ${n-1}`:\"end != 0\",a=this.reverse?\"end + 1\":\"end - 1\"):(s=this.reverse?`end + pow2 < ${n}`:\"end >= pow2\",a=this.reverse?\"end + pow2\":\"end - pow2\"),`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var coords = getCoordsFromIndex(index);\n\n let end = ${oU(e,\"coords\",this.op)};\n var val = ${o};\n let pow2 = i32(pow(2.0, uniforms.index));\n if (${s}) {\n let idx = ${a};\n ${oU(e,\"coords\",this.op)} = idx;\n val ${this.op}= getX(${rU(e,\"coords\",this.op)});\n }\n setOutputAtIndex(index, val);\n }\n }\n `}};function rU(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.x, ${e}.y`;if(r===3)return`${e}.x, ${e}.y, ${e}.z`;if(r===4)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function oU(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.y`;if(r===3)return`${e}.z`;if(r===4)return`${e}.w`;throw Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function zx(r,e,t,o,n,s){let a=e.shape.length,i=C.getAxesPermutation([o],a),p=e;i!=null&&(p=Cr({inputs:{x:e},backend:t,attrs:{perm:i}}));let u=C.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGPU cumprod shader expects an inner-most axis=${e.shape.length-1} but got axis=${o}`);let l=p.shape[u],c=Pt({inputs:{x:p},backend:t});for(let m=0;m<=Math.ceil(Math.log2(l))-1;m++){let d=new Tm(r,p.shape,!1,s),f=c,h=[{type:\"float32\",data:[m]}];c=t.runWebGPUProgram(d,[c],c.dtype,h),t.disposeData(f.dataId)}if(n){let m=new Tm(r,p.shape,n,s),d=c,f=[{type:\"float32\",data:[0]}];c=t.runWebGPUProgram(m,[c],c.dtype,f),t.disposeData(d.dataId)}if(i!=null){let m=C.getUndoAxesPermutation(i),d=Cr({inputs:{x:c},backend:t,attrs:{perm:m}});return t.disposeData(c.dataId),t.disposeData(p.dataId),d}return c}function hle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return zx(Lp.Prod,n,t,s,a,i)}var nU={kernelName:Pn,backendName:\"webgpu\",kernelFunc:hle};function gle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return zx(Lp.Sum,n,t,s,a,i)}var sU={kernelName:On,backendName:\"webgpu\",kernelFunc:gle};function xle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a,binaryOutput:i}=o,p=n.shape.length===1,l=y.sizeFromShape(s.shape)>0,c=s.dtype,m=p?[n.shape[0]]:[n.shape[0],n.shape[1]],d=p?[a]:[n.shape[0],a],f=Nt({backend:t,attrs:{shape:d,value:0,dtype:c}}),h=new nc(m,l,i),g=[{type:\"int32\",data:[a]}],x=l?[n,s]:[n];return t.runWebGPUProgram(h,x,c,g,f)}var aU={kernelName:la,backendName:\"webgpu\",kernelFunc:xle};var Vx=class{constructor(e,t){this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.uniforms=\"blockSize : i32,\",this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`depthToSpace_${t}`,this.dataFormat=t}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let h = ${this.getHeightCoordString()};\n let w = ${this.getWidthCoordString()};\n let d = ${this.getDepthCoordString()};\n\n let in_h = h / uniforms.blockSize;\n let offset_h = h % uniforms.blockSize;\n let in_w = w / uniforms.blockSize;\n let offset_w = w % uniforms.blockSize;\n let offset_d = (offset_h * uniforms.blockSize + offset_w) *\n ${this.getOutputDepthSize()};\n let in_d = d + offset_d;\n\n let rlt = ${this.getInputSamplingString()};\n setOutputAtIndex(index, rlt);\n }\n }`}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\"?\"uniforms.outShape[3]\":\"uniforms.outShape[1]\"}getInputSamplingString(){return this.dataFormat===\"NHWC\"?\"getX(b, in_h, in_w, in_d)\":\"getX(b, in_d, in_h, in_w)\"}};function yle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a===\"NHWC\"?n.shape[1]:n.shape[2],u=a===\"NHWC\"?n.shape[2]:n.shape[3],l=a===\"NHWC\"?n.shape[3]:n.shape[1],c=p*s,m=u*s,d=l/(s*s),f=a===\"NHWC\"?[i,c,m,d]:[i,d,c,m],h=[{type:\"int32\",data:[s]}],g=new Vx(f,a);return t.runWebGPUProgram(g,[n],n.dtype,h)}var iU={kernelName:Ln,backendName:\"webgpu\",kernelFunc:yle};var Wx=class{constructor(e,t,o,n=!1,s=null,a=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=\"pads : vec2, inDims : vec2,\",this.workgroupSize=[16,16,1],this.outputShape=e,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),n&&this.variableNames.push(\"bias\"),a&&this.variableNames.push(\"preluActivationWeights\"),this.addBias=n,this.activation=s,this.hasPreluActivation=a,this.filterHeight=t,this.filterWidth=o,this.shaderKey=`depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`}getUserCode(){let e=this.filterWidth*this.filterHeight,t=this.workgroupSize[0]*this.workgroupSize[1]*this.workgroupSize[2],o=this.workgroupSize[1]+this.filterHeight-1,n=this.workgroupSize[0]+this.filterWidth-1;return`\n ${gr(this.activation,this.hasPreluActivation,!1,4)}\n\n var mm_Asub : array, ${o}>;\n var mm_Bsub : array, ${this.filterHeight}>;\n fn readX(batch : i32, channel : i32, row : i32, col : i32) -> f32 {\n var value = 0.0;\n if (row >=0 && row < uniforms.inDims[0] && col >=0 && col < uniforms.inDims[1])\n {\n value = getX(batch, channel, row, col);\n }\n return value;\n }\n\n ${G()} {\n let coords = getOutputCoords();\n let batch = coords[0];\n let xRCCorner = vec2(coords.zw) - uniforms.pads;\n let channelMul = uniforms.wShape[3];\n let d1 = coords[1] / channelMul;\n let q = coords[1] % channelMul;\n\n let inputRowStart = xRCCorner.x;\n let inputColStart = xRCCorner.y;\n\n let localRow = i32(localId.y);\n let localCol = i32(localId.x);\n\n // Load one tile of X into local memory.\n for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${this.workgroupSize[1]}) {\n for (var inputCol = localCol; inputCol < ${n}; inputCol = inputCol + ${this.workgroupSize[0]}) {\n let rowOffset = inputRow - localRow;\n let colOffset = inputCol - localCol;\n mm_Asub[inputRow][inputCol] = readX(batch, d1, inputRowStart + rowOffset, inputColStart + colOffset);\n }\n }\n\n // Load one tile of W into local memory.\n var wIndex = i32(localIndex);\n ${e, inDims : vec2, virtualWidth : i32,\",this.workgroupSize=[64,1,1],this.workPerThread=4,this.outputComponent=4,this.outputShape=e.outShape,this.virtualWidth=Math.ceil(this.outputShape[2]/this.workPerThread)*this.workPerThread;let s=[this.outputShape[0],this.outputShape[1],this.virtualWidth,this.outputShape[3]];this.dispatchLayout=X(s),this.dispatch=H(this.dispatchLayout,s,this.workgroupSize,[this.outputComponent*this.workPerThread,1,1]),y.assert(e.dataFormat===\"channelsLast\",()=>\"TODO: NCHW is unimplemented\"),t&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),this.convInfo=e,this.addBias=t,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwiseVec4_${o}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`}getUserCode(){let e=(this.workPerThread-1)*this.convInfo.strideWidth+this.convInfo.filterWidth,t=this.convInfo.strideHeight,o=this.convInfo.strideWidth;return`\n ${gr(this.activation,this.hasPreluActivation,!0,4)}\n fn readX(batch : i32, row : i32, col : i32, channel : i32) -> vec4 {\n var value = vec4(0.0);\n if (col >=0 && col < uniforms.inDims[1]) {\n value = getX(batch, row, col, channel);\n }\n return value;\n }\n\n ${G(\"index\")} {\n let width0 = uniforms.outShape[3] / ${this.outputComponent};\n let d1 = (index % width0) * ${this.outputComponent};\n var index1 = index / width0;\n let width1 = uniforms.virtualWidth / ${this.workPerThread};\n let c = (index1 % width1) * ${this.workPerThread};\n index1 = index1 / width1;\n let r = index1 % uniforms.outShape[1];\n let batch = index1 / uniforms.outShape[1];\n\n let xRCCorner = vec2(r, c) * vec2(${t}, ${o}) - uniforms.pads;\n\n let xRCorner = xRCCorner.x;\n let xCCorner = xRCCorner.y;\n var xVals : array, ${e}>;\n var dotProd : array, ${this.workPerThread}>;\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = vec4(0.0);\n }\n\n // Use constant instead of uniform can give better performance.\n for (var wR = 0; wR < ${this.convInfo.filterHeight}; wR = wR + 1) {\n let xR = xRCorner + wR;\n if (xR >=0 && xR < uniforms.inDims[0]) {\n for (var i = 0; i < ${e}; i++) {\n xVals[i] = readX(batch, xR, xCCorner + i, d1);\n }\n for (var wC = 0; wC < ${this.convInfo.filterWidth}; wC = wC + 1) {\n let wValue = getW(wR, wC, d1, 0);\n for (var i = 0; i < ${this.workPerThread}; i++) {\n dotProd[i] = fma(xVals[i * ${o} + wC], wValue, dotProd[i]);\n }\n }\n }\n }\n\n for (var i = 0; i < ${this.workPerThread}; i = i + 1) {\n let coords = vec4(batch, r, c + i, d1);\n if (coordsInBounds4D(coords, uniforms.outShape)) {\n var value = dotProd[i];\n ${no(this.addBias,this.activation)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }\n }\n `}};var ic=class{constructor(e,t=!1,o=null,n=!1){this.variableNames=[\"x\",\"W\"],this.uniforms=`pads : vec2, inDims : vec2, filterHeight : i32,\n filterWidth : i32, strides : vec2, dilations : vec2,`,this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e.dataFormat===\"channelsLast\",t&&this.variableNames.push(\"bias\"),n&&this.variableNames.push(\"preluActivationWeights\"),this.convInfo=e,this.addBias=t,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwise_${this.activation}_${this.isChannelsLast}`}getUserCode(){let e=this.isChannelsLast?\"getX(batch, xR, xC, d1);\":\"getX(batch, d1, xR, xC);\";return`\n ${gr(this.activation,this.hasPreluActivation,!1,4)}\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords[0];\n let xRCCorner = vec2(coords.${this.isChannelsLast?\"yz\":\"zw\"}) * uniforms.strides - uniforms.pads;\n let d2 = coords[${this.isChannelsLast?3:1}];\n let channelMul = uniforms.wShape[3];\n let d1 = d2 / channelMul;\n let q = d2 % channelMul;\n\n let inputRowStart = xRCCorner.x;\n let inputColStart = xRCCorner.y;\n let inputRowEnd = inputRowStart + uniforms.filterHeight *\n uniforms.dilations[0];\n let inputColEnd = inputColStart + uniforms.filterWidth *\n uniforms.dilations[1];\n\n // Convolve x(?, ?, d1)|x(d1, ?, ?) with w(:, :, d1, q) to get\n // y(yR, yC, d2)|y(d2, yR, yC). ? = to be determined. : = across all\n // values in that axis. x(?, ?, d1) and y(yR, yC, d2) is for NHWC.\n // x(d1, ?, ?) and y(d2, yR, yC) is for NCHW.\n var value = 0.0;\n\n // Extract if checking out of for loop for performance.\n if (inputRowStart >= 0 && inputColStart >= 0 &&\n inputRowEnd < uniforms.inDims[0] &&\n inputColEnd < uniforms.inDims[1]) {\n for (var wR = 0; wR < uniforms.filterHeight; wR = wR + 1) {\n let xR = inputRowStart + wR * uniforms.dilations[0];\n\n for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) {\n let xC = inputColStart + wC * uniforms.dilations[1];\n\n let xVal = ${e};\n let wVal = getW(wR, wC, d1, q);\n value = value + xVal * wVal;\n }\n }\n } else {\n for (var wR = 0; wR < uniforms.filterHeight; wR = wR + 1) {\n let xR = inputRowStart + wR * uniforms.dilations[0];\n\n if (xR < 0 || xR >= uniforms.inDims[0]) {\n continue;\n }\n\n for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) {\n let xC = inputColStart + wC * uniforms.dilations[1];\n\n if (xC < 0 || xC >= uniforms.inDims[1]) {\n continue;\n }\n\n let xVal = ${e};\n let wVal = getW(wR, wC, d1, q);\n value = value + xVal * wVal;\n }\n }\n }\n ${no(this.addBias,this.activation)}\n setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value);\n }\n }\n `}};function ble(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(p),m=u;m==null&&(m=[1,1]);let d=C.computeConv2DInfo(n.shape,s.shape,a,m,i,l,!0,c),f=[{type:\"int32\",data:[d.padInfo.top,d.padInfo.left]},{type:\"int32\",data:[d.inHeight,d.inWidth]}],h=d.dataFormat===\"channelsLast\",g;return!h&&d.inHeight>16&&d.inWidth>16&&d.strideHeight===1&&d.strideWidth===1&&d.dilationWidth===1&&d.dilationHeight===1&&d.inChannels===d.outChannels?g=new Wx(d.outShape,d.filterHeight,d.filterWidth):h&&d.outHeight>4&&d.outWidth>4&&d.strideWidth<=2&&d.inChannels===d.outChannels&&d.dilationHeight===1&&d.dilationWidth===1&&d.inChannels%4===0?(g=new ac(d),f.push({type:\"int32\",data:[g.virtualWidth]})):(g=new ic(d),f.push({type:\"int32\",data:[d.filterHeight]},{type:\"int32\",data:[d.filterWidth]},{type:\"int32\",data:[d.strideHeight,d.strideWidth]},{type:\"int32\",data:[d.dilationHeight,d.dilationWidth]})),t.runWebGPUProgram(g,[n,s],n.dtype,f)}var uU={kernelName:Bn,backendName:\"webgpu\",kernelFunc:ble};var Ux=class{constructor(e){this.variableNames=[\"x\",\"dy\"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32,\n outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"depthwise_conv2d_backprop_filter\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let wR = coords[0];\n let wC = coords[1];\n let d1 = coords[2];\n let dm = coords[3];\n let d2 = d1 * uniforms.channelMul + dm;\n\n var dotProd = 0.0;\n for (var b = 0; b < uniforms.batchSize; b++) {\n for (var yR = 0; yR < uniforms.outHeight; yR++) {\n let xR = wR + yR * uniforms.strides[0] - uniforms.pads[0];\n\n if (xR < 0 || xR >= uniforms.inHeight) {\n continue;\n }\n\n for (var yC = 0; yC < uniforms.outWidth; yC++) {\n let xC = wC + yC * uniforms.strides[1] - uniforms.pads[1];\n\n if (xC < 0 || xC >= uniforms.inWidth) {\n continue;\n }\n\n let dyValue = getDy(b, yR, yC, d2);\n let xValue = getX(b, xR, xC, d1);\n dotProd += xValue * dyValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},Gx=class{constructor(e){this.variableNames=[\"dy\",\"W\"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"depthwise_conv2d_backprop_input\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d1 = coords[3];\n let dyCorner = coords.yz - uniforms.pads;\n let dyRCorner = dyCorner.x;\n let dyCCorner = dyCorner.y;\n\n var dotProd = 0.0;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n\n let idyR = i32(dyR);\n let wRPerm = uniforms.filterDims[0] - 1 - wR;\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n\n let idyC = i32(dyC);\n let wCPerm = uniforms.filterDims[1] - 1 - wC;\n\n for (var dm = 0; dm < uniforms.channelMul; dm++) {\n let d2 = d1 * uniforms.channelMul + dm;\n let xValue = getDy(batch, idyR, idyC, d2);\n let wValue = getW(wRPerm, wCPerm, d1, dm);\n dotProd += xValue * wValue;\n }\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function Cle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:l}=o,c=C.computeConv2DInfo(n.shape,l,a,i,p,u,!0),m=new Ux(c),d=[{type:\"int32\",data:[c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.padInfo.top,c.padInfo.left]},{type:\"int32\",data:[c.filterHeight,c.filterWidth]},{type:\"int32\",data:[c.outHeight]},{type:\"int32\",data:[c.outWidth]},{type:\"int32\",data:[c.inHeight]},{type:\"int32\",data:[c.inWidth]},{type:\"int32\",data:[c.batchSize]},{type:\"int32\",data:[c.outChannels/c.inChannels]}];return t.runWebGPUProgram(m,[n,s],\"float32\",d)}var pU={kernelName:Gi,backendName:\"webgpu\",kernelFunc:Cle};function wle(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:l}=o,c=C.computeConv2DInfo(l,s.shape,a,i,p,u,!0),m=new Gx(c),d=[{type:\"int32\",data:[c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.filterHeight-1-c.padInfo.top,c.filterWidth-1-c.padInfo.left]},{type:\"int32\",data:[c.filterHeight,c.filterWidth]},{type:\"int32\",data:[c.outHeight]},{type:\"int32\",data:[c.outWidth]},{type:\"int32\",data:[c.outChannels/c.inChannels]}];return t.runWebGPUProgram(m,[n,s],n.dtype,d)}var lU={kernelName:Hi,backendName:\"webgpu\",kernelFunc:wle};var Hx=class{constructor(e){this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"diag\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let value = select(0.0, getX(coords[0]), coords[0] == coords[1]);\n setOutputAtIndex(index, value);\n }\n }\n `}};function Sle(r){let{inputs:e,backend:t}=r,{x:o}=e,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=le({inputs:{x:o},backend:t,attrs:{shape:[s]}}),i=new Hx(s),p=t.runWebGPUProgram(i,[a],a.dtype),u=le({inputs:{x:p},backend:t,attrs:{shape:n}});return t.disposeData(a.dataId),t.disposeData(p.dataId),u}var cU={kernelName:ca,backendName:\"webgpu\",kernelFunc:Sle};var Kx=class{constructor(e){this.variableNames=[\"x\",\"w\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"dilation2d\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let neg_infinity = -3.4e38;\n let coords = getOutputCoords();\n let batch = coords.x;\n let d1 = coords.w;\n let outTopLeftCorner = coords.yz * uniforms.strides - uniforms.pads;\n let hBeg = outTopLeftCorner.x;\n let wBeg = outTopLeftCorner.y;\n\n var curVal = neg_infinity;\n for (var h = 0; h < uniforms.filterDims[0]; h = h + 1) {\n let hIn = hBeg + h * uniforms.dilations[0];\n\n if (hIn >= 0 && hIn < uniforms.xShape[1]) {\n for (var w = 0; w < uniforms.filterDims[1]; w = w + 1) {\n let wIn = wBeg + w * uniforms.dilations[1];\n\n if (wIn >= 0 && wIn < uniforms.xShape[2]) {\n let val = getX(batch, hIn, wIn, d1) + getW(h, w, d1);\n if (val > curVal) {\n curVal = val;\n }\n }\n }\n }\n }\n\n setOutputAtIndex(index, curVal);\n }\n }\n `}};function Ile(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeDilation2DInfo(n.shape,s.shape,a,i,\"NHWC\",p),l=[u.padInfo.top,u.padInfo.left],c=[{type:\"int32\",data:[u.filterHeight,u.filterWidth]},{type:\"int32\",data:[...l]},{type:\"int32\",data:[u.strideHeight,u.strideWidth]},{type:\"int32\",data:[u.dilationHeight,u.dilationWidth]}],m=new Kx(u);return t.runWebGPUProgram(m,[n,s],n.dtype,c)}var mU={kernelName:zn,backendName:\"webgpu\",kernelFunc:Ile};var qx=class{constructor(e,t){if(this.variableNames=[\"x\",\"w\",\"dy\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.inShape,this.dispatchLayout=X(e.outShape),this.dispatch=H(this.dispatchLayout,e.outShape,this.workgroupSize),t!==\"float32\"&&t!==\"int32\")throw new Error(`Dilation2DBackpropInput only supports float32 and int32\n types, does not support ${t} type.`);this.type=t,this.shaderKey=\"dilation2DBackpropInput\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.dySize) {\n let coords = getDyCoordsFromIndex(index);\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let dyCorner = vec2(r, c) * uniforms.strides - uniforms.pads;\n var curVal = -3.4e38; // neg_infinity\n var xRMax = 0;\n var xCMax = 0;\n\n // In the case of multiple argmax branches, we only back-propagate\n // along the last branch, i.e., the one with largest value of\n // 'wR * uniforms.filterDims[1] + wC', similarly to the max-pooling\n // backward routines.\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let xR = dyCorner.x + wR * uniforms.dilations[0];\n\n if (xR >= 0 && xR < uniforms.xShape[1]) {\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let xC = dyCorner.y + wC * uniforms.dilations[1];\n\n if (xC >= 0 && xC < uniforms.xShape[2]) {\n let val = getX(b, xR, xC, d) + getW(wR, wC, d);\n if (val > curVal) {\n curVal = val;\n xRMax = xR;\n xCMax = xC;\n }\n }\n }\n }\n }\n\n let flatIndexIn = d + uniforms.xShape[3] *\n (xCMax + uniforms.xShape[2] * (xRMax + uniforms.xShape[1] * b));\n let value = getDy(b, r, c, d);\n ${oo(\"&result[flatIndexIn]\",\"value\",this.type)}\n }\n }\n `}},jx=class{constructor(e,t,o){if(this.variableNames=[\"x\",\"w\",\"dy\"],this.uniforms=\"filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(e.outShape),this.dispatch=H(this.dispatchLayout,e.outShape,this.workgroupSize),o!==\"float32\"&&o!==\"int32\")throw new Error(`Dilation2DBackpropFilter only supports float32 and int32\n types, does not support ${o} type.`);this.type=o,this.shaderKey=\"dilation2DBackpropFilter\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.dySize) {\n let coords = getDyCoordsFromIndex(index);\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let dyCorner = vec2(r, c) * uniforms.strides - uniforms.pads;\n var curVal = -3.4e38; // neg_infinity\n var wRMax = 0;\n var wCMax = 0;\n\n // In the case of multiple argmax branches, we only back-propagate\n // along the last branch, i.e., the one with largest value of\n // 'wR * uniforms.filterDims[1] + wC', similarly to the max-pooling\n // backward routines.\n for (var wR = 0; wR < uniforms.filterDims[0]; wR++) {\n let xR = dyCorner.x + wR * uniforms.dilations[0];\n\n if (xR >= 0 && xR < uniforms.xShape[1]) {\n for (var wC = 0; wC < uniforms.filterDims[1]; wC++) {\n let xC = dyCorner.y + wC * uniforms.dilations[1];\n\n if (xC >= 0 && xC < uniforms.xShape[2]) {\n let val = getX(b, xR, xC, d) + getW(wR, wC, d);\n if (val > curVal) {\n curVal = val;\n wRMax = wR;\n wCMax = wC;\n }\n }\n }\n }\n }\n\n let flatIndexIn = d + uniforms.wShape[2] * (wCMax + wRMax * uniforms.wShape[1]);\n let value = getDy(b, r, c, d);\n ${oo(\"&result[flatIndexIn]\",\"value\",this.type)}\n }\n }\n `}};function vle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o,l=C.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),c=s.dtype,m=new jx(l,s.shape,c),d=[{type:\"int32\",data:[l.filterHeight,l.filterWidth]},{type:\"int32\",data:[l.padInfo.top,l.padInfo.left]},{type:\"int32\",data:[l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.dilationHeight,l.dilationWidth]},{type:\"int32\",data:[y.sizeFromShape(l.outShape)]}],f=Nt({backend:t,attrs:{shape:s.shape,value:0,dtype:c}});return t.runWebGPUProgram(m,[n,s,a],c,d,f)}var dU={kernelName:qi,backendName:\"webgpu\",kernelFunc:vle};function kle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o,l=C.computeDilation2DInfo(n.shape,s.shape,i,p,\"NHWC\",u),c=n.dtype,m=new qx(l,c),d=[{type:\"int32\",data:[l.filterHeight,l.filterWidth]},{type:\"int32\",data:[l.padInfo.top,l.padInfo.left]},{type:\"int32\",data:[l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.dilationHeight,l.dilationWidth]},{type:\"int32\",data:[y.sizeFromShape(l.outShape)]}],f=Nt({backend:t,attrs:{shape:l.inShape,value:0,dtype:c}});return t.runWebGPUProgram(m,[n,s,a],c,d,f)}var fU={kernelName:Ki,backendName:\"webgpu\",kernelFunc:kle};var Xx=class{constructor(e,t,o){this.variableNames=[\"Image\"],this.uniforms=\"alpha: f32,\",this.workgroupSize=[64,1,1],this.pixelsOpType=$i.DRAW,this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.type=t,this.textureFormat=o,this.shaderKey=`draw_${t}_${o}`}getUserCode(){let e,t=this.type===\"float32\"?\"value\":\"value / 255.0\";return e=`\n if (uniforms.numChannels == 1) {\n rgba[0] = ${t};\n rgba[1] = ${t};\n rgba[2] = ${t};\n } else {\n rgba[d] = ${t};\n }`,`\n @group(0) @binding(0) var outImage : texture_storage_2d<${this.textureFormat}, write>;\n ${G(\"index\")} {\n if (index < uniforms.size) {\n var rgba = vec4(0.0, 0.0, 0.0, uniforms.alpha);\n for (var d = 0; d < uniforms.numChannels; d = d + 1) {\n let value = f32(inBuf[index * uniforms.numChannels + d]);\n ${e}\n }\n rgba.x = rgba.x * rgba.w;\n rgba.y = rgba.y * rgba.w;\n rgba.z = rgba.z * rgba.w;\n let coords = getCoordsFromIndex(index);\n textureStore(outImage, vec2(coords.yx), rgba);\n }\n }\n `}};function Nle(r){let{inputs:e,backend:t,attrs:o}=r,{image:n}=e,{canvas:s,options:a}=o,[i,p]=n.shape.slice(0,2),{imageOptions:u}=a||{},l=(u==null?void 0:u.alpha)||1,c=t.device.features.has(\"bgra8unorm-storage\")?\"bgra8unorm\":\"rgba8unorm\",m=[i,p],d=new Xx(m,n.dtype,c);s.width=p,s.height=i;let f=\"webgpu\",h=s.getContext(f),g;h||(g=new OffscreenCanvas(p,i),h=g.getContext(f));let x=n.shape.length===3?n.shape[2]:1;h.configure({device:t.device,format:c,usage:GPUTextureUsage.STORAGE_BINDING,alphaMode:\"premultiplied\"});let b=\"int32\",w=t.makeTensorInfo(m,b),S=t.tensorMap.get(w.dataId);S.resource=h.getCurrentTexture(),S.external=!0;let k=[{type:\"uint32\",data:[x]},{type:\"float32\",data:[l]}];if(t.runWebGPUProgram(d,[n],b,k,w),g){let T=s.getContext(\"2d\");if(!T)throw new Error(\"Please make sure this canvas has only been used for 2d or webgpu context!\");T.drawImage(g,0,0)}return t.disposeData(w.dataId),n}var hU={kernelName:Mu,backendName:\"webgpu\",kernelFunc:Nle};var Kv=tt({opType:fe.MUL,cpuKernelImpl:YV,supportsComplex:!0}),gU={kernelName:$o,backendName:\"webgpu\",kernelFunc:Kv};function qv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;return ao(n,s,a,\"sum\",t)}var xU={kernelName:As,backendName:\"webgpu\",kernelFunc:qv};function Tle(r){let{inputs:e,backend:t,attrs:o}=r,{equation:n}=o,s=e,{allDims:a,summedDims:i,idDims:p}=C.decodeEinsumEquation(n,s.length);C.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:l}=C.getEinsumComputePath(i,p),c=l.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=qv({inputs:{x:m},backend:t,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&t.disposeData(h.dataId);return m}var yU={kernelName:ji,backendName:\"webgpu\",kernelFunc:Tle};var _le=ye({opType:Z.ELU}),bU={kernelName:Wn,backendName:\"webgpu\",kernelFunc:_le};var Ele=r=>{let{inputs:e,backend:t}=r,{dy:o,y:n}=e,s=new Di(fe.ELU_DER,o.shape,n.shape);return t.runWebGPUProgram(s,[o,n],o.dtype)},CU={kernelName:ri,backendName:\"webgpu\",kernelFunc:Ele};var $le=tt({opType:fe.EQUAL,dtype:\"bool\",cpuKernelImpl:PV}),wU={kernelName:xo,backendName:\"webgpu\",kernelFunc:$le};var Rle=ye({opType:Z.ERF}),SU={kernelName:Un,backendName:\"webgpu\",kernelFunc:Rle};var Dle=ye({opType:Z.EXP,cpuKernelImpl:OV,dtype:\"float32\"}),IU={kernelName:yo,backendName:\"webgpu\",kernelFunc:Dle};function Yx(r){let{inputs:e,attrs:t,backend:o}=r,{dim:n}=t,{input:s}=e,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),le({inputs:{x:s},backend:o,attrs:{shape:i}})}var vU={kernelName:ma,backendName:\"webgpu\",kernelFunc:Yx};var Ale=ye({opType:Z.EXPM1,cpuKernelImpl:MV}),kU={kernelName:bo,backendName:\"webgpu\",kernelFunc:Ale};var _m=class{constructor(e,t){this.variableNames=[\"real\",\"imag\"],this.outputShape=[],this.uniforms=\"exponentMultiplier : f32, denominator: f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.component=e,this.shaderKey=`fft_${e}`}getUserCode(){return`\n fn unaryOpComplex(real: f32, expR: f32, imag: f32, expI: f32) -> f32 {\n ${this.component===\"real\"?\"return real * expR - imag * expI;\":\"return real * expI + imag * expR;\"}\n }\n\n fn mulMatDFT(batch: i32, index: i32) -> f32 {\n let indexRatio = f32(index) / f32(uniforms.realShape[1]);\n let exponentMultiplierTimesIndexRatio =\n uniforms.exponentMultiplier * indexRatio;\n\n var result = 0.0;\n\n for (var i = 0; i < uniforms.realShape[1]; i = i + 1) {\n // x = (-2|2 * PI / N) * index * i;\n let x = exponentMultiplierTimesIndexRatio * f32(i);\n let expR = cos(x);\n let expI = sin(x);\n let real = getReal(batch, i);\n let imag = getImag(batch, i);\n\n result = result +\n unaryOpComplex(real, expR, imag, expI) / uniforms.denominator;\n }\n\n return result;\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n setOutputAtIndex(index, mulMatDFT(coords[0], coords[1]));\n }\n }\n `}};function Qx(r,e,t){let o=t.tensorMap.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=[],p=le({inputs:{x:r},backend:t,attrs:{shape:[a,s]}});i.push(p);let u=p.shape,l=new _m(\"real\",u),c=new _m(\"imag\",u),m=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:u},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:u}],d=e?2*Math.PI:-2*Math.PI,f=e?u[1]:1,h=[{type:\"float32\",data:[d]},{type:\"float32\",data:[f]}],g=t.runWebGPUProgram(l,m,\"float32\",h);i.push(g);let x=t.runWebGPUProgram(c,m,\"float32\",h);i.push(x);let b=Uo({inputs:{real:g,imag:x},backend:t});i.push(b);let w=le({inputs:{x:b},backend:t,attrs:{shape:r.shape}});return i.forEach(S=>t.disposeData(S.dataId)),w}function Fle(r){let{inputs:e,backend:t}=r,{input:o}=e;return Qx(o,!1,t)}var NU={kernelName:Xi,backendName:\"webgpu\",kernelFunc:Fle};var Zx=class{constructor(e){this.outputShape=[],this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"flipLeftRight\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let coordX = uniforms.xShape[2] - coords[2] - 1;\n let outputValue = getX(coords[0], coords[1], coordX, coords[3]);\n setOutputAtIndex(index, outputValue);\n }\n }\n `}};var TU={kernelName:Gn,backendName:\"webgpu\",kernelFunc:({inputs:r,backend:e})=>{let{image:t}=r,o=e,n=new Zx(t.shape);return o.runWebGPUProgram(n,[t],t.dtype)}};var Ple=ye({opType:Z.FLOOR,cpuKernelImpl:LV}),_U={kernelName:Co,backendName:\"webgpu\",kernelFunc:Ple};var Ole=tt({opType:fe.FLOOR_DIV,cpuKernelImpl:BV,dtype:\"int32\"}),EU={kernelName:wo,backendName:\"webgpu\",kernelFunc:Ole};var Jx=class{constructor(e,t,o=!1){this.pixelsOpType=$i.FROM_PIXELS,this.outputShape=[0],this.variableNames=[],this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[t,1,1]),this.importVideo=o,this.shaderKey=`fromPixels_${this.importVideo}`}getUserCode(){let e=this.importVideo?\"textureLoad(src, vec2(coords.yx));\":\"textureLoad(src, vec2(coords.yx), 0)\";return`\n @binding(1) @group(0) var src: ${this.importVideo?\"texture_external\":\"texture_2d\"};\n ${G(\"index\")} {\n let flatIndex = index * uniforms.numChannels;\n if (flatIndex < uniforms.size) {\n let coords = getCoordsFromIndex(flatIndex);\n let values = ${e};\n for (var i = 0; i < uniforms.numChannels; i = i + 1) {\n result[flatIndex + i] = i32(floor(255.0 * values[i]));\n }\n }\n }\n `}};var $U={kernelName:Lu,backendName:\"webgpu\",kernelFunc:Mle},uc,jv=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");function Mle(r){let{inputs:e,backend:t,attrs:o}=r,{pixels:n}=e,{numChannels:s}=o;if(n==null)throw new Error(\"pixels passed to tf.browser.fromPixels() can not be null\");let a=typeof HTMLVideoElement!=\"undefined\"&&n instanceof HTMLVideoElement,i=typeof HTMLImageElement!=\"undefined\"&&n instanceof HTMLImageElement,p=typeof HTMLCanvasElement!=\"undefined\"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas!=\"undefined\"&&n instanceof OffscreenCanvas,u=typeof ImageBitmap!=\"undefined\"&&n instanceof ImageBitmap,[l,c]=a?[n.videoWidth,n.videoHeight]:[n.width,n.height],m=[c,l,s],d=A().getBool(\"WEBGPU_IMPORT_EXTERNAL_TEXTURE\")&&a,f=a||i;if(u||p||f){let b;if(d)b=t.device.importExternalTexture({source:n});else{if(f){let L=A().getBool(\"CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU\");(uc==null||L!==jv)&&(jv=L,uc=document.createElement(\"canvas\").getContext(\"2d\",{willReadFrequently:jv})),uc.canvas.width=l,uc.canvas.height=c,uc.drawImage(n,0,0,l,c),n=uc.canvas}let F=GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING,M=t.textureManager.acquireTexture(m[1],m[0],\"rgba8unorm\",F);t.queue.copyExternalImageToTexture({source:n},{texture:M},[m[1],m[0]]),b=M}let w=y.sizeFromShape(m),S=y.computeStrides(m),k=new Jx(m,s,d),T=[{type:\"uint32\",data:[w]},{type:\"uint32\",data:[s]},{type:\"uint32\",data:[...S]}],E=t.makeTensorInfo([c,l],\"int32\"),R=t.tensorMap.get(E.dataId);R.resource=b;let D=t.runWebGPUProgram(k,[E],\"int32\",T);return t.disposeData(E.dataId),D}let h=n.data,g=h;if(s!=null&&s!==4){g=new Uint8Array(n.width*n.height*s);let b=h.length,w=0;for(let S=0;S(xValue, -meanValue, offsetValue), vec3(inv, inv, 1.0)));\n }\n }\n `}};var RU={kernelName:Hn,backendName:\"webgpu\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o,scale:n,offset:s,mean:a,variance:i}=r,{varianceEpsilon:p}=e,u=t,l=[o,a,i],c=null;s!=null&&(c=s.shape,l.push(s));let m=null;n!=null&&(m=n.shape,l.push(n));let d=new ey(o.shape,a.shape,i.shape,c,m),f=[{type:\"float32\",data:[p]}];return u.runWebGPUProgram(d,l,o.dtype,f)}};function Lle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dataFormat:l,dilations:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=C.convertConv2DDataFormat(l),g=C.computeConv2DInfo(n.shape,s.shape,p,c,u,m,!1,h);return Dx({x:n,filter:s,convInfo:g,backend:t,bias:a,preluActivationWeights:i,leakyreluAlpha:f,activation:d})}var DU={kernelName:jo,backendName:\"webgpu\",kernelFunc:Lle};function Ble(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dimRoundingMode:c,activation:m,leakyreluAlpha:d}=o,f=l;f==null&&(f=[1,1]),y.assert(C.eitherStridesOrDilationsAreOne(p,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${f}'`);let h=C.computeConv2DInfo(n.shape,s.shape,p,f,u,c,!0),g=[n,s],x=a!=null,b=i!=null;x&&g.push(a),b&&g.push(i);let w=[{type:\"int32\",data:[h.padInfo.top,h.padInfo.left]},{type:\"int32\",data:[h.inHeight,h.inWidth]}],S;return h.outHeight>4&&h.outWidth>4&&h.strideWidth<=2&&h.inChannels===h.outChannels&&h.dilationHeight===1&&h.dilationWidth===1&&h.inChannels%4===0?(S=new ac(h,x,m,b),w.push({type:\"int32\",data:[S.virtualWidth]})):(S=new ic(h,x,m,b),w.push({type:\"int32\",data:[h.filterHeight]},{type:\"int32\",data:[h.filterWidth]},{type:\"int32\",data:[h.strideHeight,h.strideWidth]},{type:\"int32\",data:[h.dilationHeight,h.dilationWidth]})),m===\"leakyrelu\"&&(w.push({type:\"float32\",data:[d]}),S.uniforms+=\" alpha : f32,\"),t.runWebGPUProgram(S,g,\"float32\",w)}var AU={kernelName:Xo,backendName:\"webgpu\",kernelFunc:Ble};var ty=class{constructor(e,t){this.variableNames=[\"A\",\"indices\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`gathernd_${e}`,this.sliceDim=e,this.uniforms=`sliceDim : i32, strides : ${ft(e)},`}getUserCode(){let e;return this.sliceDim>1?e=\"uniforms.strides[j]\":e=\"uniforms.strides\",`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var flattenIndex = 0;\n for (var j = 0; j < uniforms.sliceDim; j = j + 1) {\n let indexTemp = i32(round(getIndices(coords[0], j)));\n let strideNum = ${e};\n flattenIndex = flattenIndex + indexTemp * strideNum;\n }\n\n setOutputAtIndex(index, getA(flattenIndex, coords[1]));\n }\n }\n `}};function zle(r){let{inputs:e,backend:t}=r,{params:o,indices:n}=e,s=n.shape,a=s[s.length-1],i=y.sizeFromShape(o.shape),[p,u,l,c]=C.prepareAndValidate(o,n),m=le({inputs:{x:n},backend:t,attrs:{shape:[u,a]}}),d=le({inputs:{x:o},backend:t,attrs:{shape:[y.sizeFromShape(o.shape)/l,l]}});if(t.shouldExecuteOnCPU([o,n])||o.dtype===\"string\"){let b=t.readSync(n.dataId),w=t.bufferSync(o),S=zV(b,w,o.dtype,u,a,l,c,o.shape,i);return t.makeTensorInfo(p,o.dtype,S.values)}let f=new ty(a,[u,l]),h=[{type:\"int32\",data:[a]},{type:\"int32\",data:c}],g=t.runWebGPUProgram(f,[d,m],d.dtype,h),x=le({inputs:{x:g},backend:t,attrs:{shape:p}});return t.disposeData(m.dataId),t.disposeData(d.dataId),t.disposeData(g.dataId),x}var FU={kernelName:Kn,backendName:\"webgpu\",kernelFunc:zle};var ry=class{constructor(e,t){this.variableNames=[\"A\",\"indices\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.slice(),this.aShape=e,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"gather\"}getUserCode(){let e=Vle(this.aShape);return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let resRC = getCoordsFromIndex(index);\n let indexZ = i32(getIndices(resRC.x, resRC.z));\n let inBounds = select(0.0, 1.0, indexZ >= 0 && indexZ < uniforms.aShape[2]);\n setOutputAtIndex(index, inBounds * getA(${e}));\n }\n }\n `}};function Vle(r){let e=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],t=[];for(let o=0;ot.disposeData(D.dataId)),t.makeTensorInfo(u.outputShape,R.dtype,R.values)}let h=new ry(m.shape,f),g=t.runWebGPUProgram(h,[m,d],m.dtype);c.push(g);let x=le({inputs:{x:g},backend:t,attrs:{shape:u.outputShape}});return c.forEach(b=>t.disposeData(b.dataId)),x}var PU={kernelName:fa,backendName:\"webgpu\",kernelFunc:Xv};var Wle=tt({opType:fe.GREATER,cpuKernelImpl:UV,dtype:\"bool\"}),OU={kernelName:So,backendName:\"webgpu\",kernelFunc:Wle};var Ule=tt({opType:fe.GREATER_EQUAL,dtype:\"bool\",cpuKernelImpl:WV}),MU={kernelName:Io,backendName:\"webgpu\",kernelFunc:Ule};function Gle(r){let{inputs:e,backend:t}=r,{input:o}=e;return Qx(o,!0,t)}var LU={kernelName:Yi,backendName:\"webgpu\",kernelFunc:Gle};var Hle=ye({opType:Z.IS_FINITE,dtype:\"bool\"}),BU={kernelName:qn,backendName:\"webgpu\",kernelFunc:Hle};var Kle=ye({opType:Z.IS_INF,dtype:\"bool\"}),zU={kernelName:jn,backendName:\"webgpu\",kernelFunc:Kle};var qle=ye({opType:Z.IS_NAN,dtype:\"bool\"}),VU={kernelName:Xn,backendName:\"webgpu\",kernelFunc:qle};function jle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{alpha:s}=o,a=[{type:\"float32\",data:[s]}],i=new so(n.shape,Z.LEAKYRELU,\"alpha : f32,\");return t.runWebGPUProgram(i,[n],\"float32\",a)}var WU={kernelName:Yn,backendName:\"webgpu\",kernelFunc:jle};var Xle=tt({opType:fe.LESS,dtype:\"bool\",cpuKernelImpl:HV}),UU={kernelName:ko,backendName:\"webgpu\",kernelFunc:Xle};var Yle=tt({opType:fe.LESS_EQUAL,dtype:\"bool\",cpuKernelImpl:GV}),GU={kernelName:No,backendName:\"webgpu\",kernelFunc:Yle};var oy=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms=\"start : f32, step : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"linSpace\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n setOutputAtIndex(index, uniforms.start + f32(index) * uniforms.step);\n }\n }\n `}};function Qle(r){let{backend:e,attrs:t}=r,{start:o,stop:n,num:s}=t,a=(n-o)/(s-1),i=new oy(s),p=[{type:\"float32\",data:[o]},{type:\"float32\",data:[a]}];return e.runWebGPUProgram(i,[],\"float32\",p)}var HU={kernelName:Qn,backendName:\"webgpu\",kernelFunc:Qle};var Zle=ye({opType:Z.LOG,cpuKernelImpl:KV}),KU={kernelName:To,backendName:\"webgpu\",kernelFunc:Zle};var Jle=ye({opType:Z.LOG1P}),qU={kernelName:Zn,backendName:\"webgpu\",kernelFunc:Jle};var ece=tt({opType:fe.LOGICAL_AND,dtype:\"bool\"}),jU={kernelName:Jn,backendName:\"webgpu\",kernelFunc:ece};var tce=ye({opType:Z.LOGICAL_NOT}),XU={kernelName:es,backendName:\"webgpu\",kernelFunc:tce};var rce=tt({opType:fe.LOGICAL_OR}),YU={kernelName:ts,backendName:\"webgpu\",kernelFunc:rce};var QU=`\n var powValue = 0.0;\n let basis = uniforms.bias + uniforms.alpha * sum;\n if (uniforms.beta == 0.5) {\n powValue = inverseSqrt(basis);\n } else if (uniforms.beta == 1.0) {\n powValue = 1.0 / basis;\n } else {\n powValue = exp(log(basis) * (-uniforms.beta));\n }\n`,ny=class{constructor(e){this.outputShape=[],this.variableNames=[\"x\"],this.uniforms=\"radius : i32, bias : f32, alpha : f32, beta : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"lrn\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n let d = coords[3];\n\n let x = getX(b, r, c, d);\n var sum = 0.0;\n for (var i = -uniforms.radius; i <= uniforms.radius; i = i + 1) {\n let idx = d + i;\n if (idx >= 0 && idx < uniforms.xShape[3]) {\n let z = getX(b, r, c, idx);\n sum = sum + z * z;\n }\n }\n ${QU}\n\n setOutputAtIndex(index, x * powValue);\n }\n }\n `}},sy=class{constructor(e,t){this.outputShape=[],this.variableNames=[\"x\"],this.uniforms=\"radius : i32, bias : f32, alpha : f32, beta : f32,\",this.workgroupSize=[256,1,1],this.maxAllowRadius=16,y.assert(t<=this.maxAllowRadius,()=>`Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${t}`),this.outputShape=e,this.elementsPerWorkgroup=this.workgroupSize[0]-2*this.maxAllowRadius,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,[this.elementsPerWorkgroup,this.workgroupSize[1],this.workgroupSize[2]]),this.shaderKey=\"lrn_shared\"}getUserCode(){return`\n var lrnSub: array;\n const elementsPerWorkgroup = ${this.elementsPerWorkgroup};\n const maxAllowRadius = ${this.maxAllowRadius};\n\n ${G()} {\n let localDepth = i32(localId.x);\n let workgroupDepth = i32(workgroupId.x) * elementsPerWorkgroup;\n let xDepth = workgroupDepth + localDepth - maxAllowRadius;\n let b = i32(globalId.z) / uniforms.xShape[1];\n let r = i32(globalId.z) - b * uniforms.xShape[1];\n let c = i32(globalId.y);\n let d = workgroupDepth + localDepth;\n\n var x = 0.0;\n if (xDepth >= 0 && xDepth < uniforms.xShape[3]) {\n x = getX(b, r, c, xDepth);\n }\n lrnSub[localDepth] = x;\n workgroupBarrier();\n\n if (localDepth < elementsPerWorkgroup && d < uniforms.outShape[3]) {\n var sum = 0.0;\n let index = localDepth + maxAllowRadius;\n for (var i = -uniforms.radius; i <= uniforms.radius; i = i + 1) {\n let z = lrnSub[index + i];\n sum = sum + z * z;\n }\n ${QU}\n\n setOutputAtCoords(b, r, c, d, lrnSub[index] * powValue);\n }\n } `}};function oce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u;s>16?u=new ny(n.shape):u=new sy(n.shape,s);let l=[{type:\"int32\",data:[s]},{type:\"float32\",data:[a]},{type:\"float32\",data:[i]},{type:\"float32\",data:[p]}];return t.runWebGPUProgram(u,[n],n.dtype,l)}var ZU={kernelName:rs,backendName:\"webgpu\",kernelFunc:oce};var ay=class{constructor(e){this.outputShape=[],this.variableNames=[\"inputImage\",\"outputImage\",\"dy\"],this.uniforms=\"depthRadius : i32, bias : f32, alpha : f32, beta : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"lrn_grad\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let r = coords[1];\n let c = coords[2];\n\n let MIN_DEPTH_BEGIN = 0;\n let MAX_DEPTH_END = uniforms.outShape[3];\n var result = 0.0;\n for (var d = MIN_DEPTH_BEGIN; d < MAX_DEPTH_END; d++) {\n let depthBegin = max(MIN_DEPTH_BEGIN, d - uniforms.depthRadius);\n let depthEnd = min(MAX_DEPTH_END, d + uniforms.depthRadius + 1);\n\n var norm = 0.0;\n for (var k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; k++) {\n if (k < depthBegin) {\n continue;\n } else if (k >= depthBegin && k < depthEnd) {\n norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k);\n } else {\n break;\n }\n }\n\n norm = uniforms.alpha * norm + uniforms.bias;\n\n for (var k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; k++) {\n if (k < depthBegin) {\n continue;\n } else if (k >= depthBegin && k < depthEnd) {\n var dyi = -2.0 * uniforms.alpha * uniforms.beta\n * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d) / norm;\n if (k == d) {\n dyi += pow(norm, -1.0 * uniforms.beta);\n }\n if (k == coords[3]) {\n dyi *= getDy(b, r, c, d);\n result += dyi;\n }\n } else {\n break;\n }\n }\n }\n\n setOutputAtIndex(index, result);\n }\n }\n `}};function nce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,y:s,dy:a}=e,{depthRadius:i,bias:p,alpha:u,beta:l}=o,c=new ay(n.shape),m=[{type:\"int32\",data:[i]},{type:\"float32\",data:[p]},{type:\"float32\",data:[u]},{type:\"float32\",data:[l]}];return t.runWebGPUProgram(c,[n,s,a],n.dtype,m)}var JU={kernelName:oi,backendName:\"webgpu\",kernelFunc:nce};var sce=tt({opType:fe.MAX,cpuKernelImpl:jV}),eG={kernelName:_o,backendName:\"webgpu\",kernelFunc:sce};function ace(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,l=C.computePool2DInfo(n.shape,s,a,1,i,p);return bx(n,l,\"max\",t)}var tG={kernelName:ns,backendName:\"webgpu\",kernelFunc:ace};function ice(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,u,p),m=new $u(c,\"max\"),d=[{type:\"int32\",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:\"int32\",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:\"int32\",data:[c.inDepth,c.inHeight,c.inWidth]},{type:\"int32\",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return t.runWebGPUProgram(m,[n],n.dtype,d)}var rG={kernelName:ha,backendName:\"webgpu\",kernelFunc:ice};var iy=class{constructor(e){this.variableNames=[\"dy\",\"maxPos\"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2,\n outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"maxPool2DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords[0];\n let d = coords[3];\n\n let dyRCCorner = vec2(coords.yz) - uniforms.pads;\n let dyRCorner = dyRCCorner.x;\n let dyCCorner = dyRCCorner.y;\n\n // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n let lastIndex = uniforms.filterDims[0] * uniforms.filterDims[1] - 1;\n for (var wR = 0; wR < uniforms.filterDims[0]; wR += uniforms.dilations[0]) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[0]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[1]; wC += uniforms.dilations[1]) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[1]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyR, idyC, d);\n let maxPosValue = lastIndex - i32(getMaxPos(batch, idyR, idyC, d));\n\n // Get the current value, check it against the value from the\n // position matrix.\n let curPosValue = wR * uniforms.filterDims[1] + wC;\n let mask = select(0.0, 1.0, maxPosValue == curPosValue);\n dotProd += dyValue * mask;\n }\n }\n setOutputAtIndex(index, dotProd);\n }\n }\n `}},uy=class{constructor(e){this.variableNames=[\"dy\",\"maxPos\"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3,\n outDepth : i32, outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"maxPool3DBackprop\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let batch = coords.x;\n let ch = coords.u;\n\n let dyCorner = vec3(coords.y, coords.z, coords.w) - uniforms.pads;\n let dyDCorner = dyCorner.x;\n let dyRCorner = dyCorner.y;\n let dyCCorner = dyCorner.z;\n\n // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get\n // dx(xD, xR, xC, ch).\n // ? = to be determined. : = across all values in that axis.\n var dotProd = 0.0;\n let lastIndex = uniforms.filterDims[0] * uniforms.filterDims[1] * uniforms.filterDims[2] - 1;\n\n for (var wD = 0; wD < uniforms.filterDims[0]; wD++) {\n let dyD = f32(dyDCorner + wD) / f32(uniforms.strides[0]);\n\n if (dyD < 0.0 || dyD >= f32(uniforms.outDepth) || fract(dyD) > 0.0) {\n continue;\n }\n let idyD = i32(dyD);\n\n for (var wR = 0; wR < uniforms.filterDims[1]; wR++) {\n let dyR = f32(dyRCorner + wR) / f32(uniforms.strides[1]);\n\n if (dyR < 0.0 || dyR >= f32(uniforms.outHeight) || fract(dyR) > 0.0) {\n continue;\n }\n let idyR = i32(dyR);\n\n for (var wC = 0; wC < uniforms.filterDims[2]; wC++) {\n let dyC = f32(dyCCorner + wC) / f32(uniforms.strides[2]);\n\n if (dyC < 0.0 || dyC >= f32(uniforms.outWidth) || fract(dyC) > 0.0) {\n continue;\n }\n let idyC = i32(dyC);\n\n let dyValue = getDy(batch, idyD, idyR, idyC, ch);\n let maxPosValue = lastIndex - i32(getMaxPos(batch, idyD, idyR, idyC, ch));\n\n // Get the current value, check it against the value from the\n // position matrix.\n let curPosValue = wD * uniforms.filterDims[1] * uniforms.filterDims[2] + wR * uniforms.filterDims[2] + wC;\n let mask = select(0.0, 1.0, maxPosValue == curPosValue);\n dotProd += dyValue * mask;\n }\n }\n }\n\n setOutputAtIndex(index, dotProd);\n }\n }\n `}};function uce(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:l}=o,c=[1,1,1],m=C.computePool3DInfo(a.shape,i,p,c,u,l),d=new $u(m,\"max\",!0),f=[{type:\"int32\",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.padInfo.front,m.padInfo.top,m.padInfo.left]},{type:\"int32\",data:[m.inDepth,m.inHeight,m.inWidth]},{type:\"int32\",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=t.runWebGPUProgram(d,[a],\"int32\",f),g=new uy(m);f=[{type:\"int32\",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.effectiveFilterDepth-1-m.padInfo.front,m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:\"int32\",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:\"int32\",data:[m.outDepth]},{type:\"int32\",data:[m.outHeight]},{type:\"int32\",data:[m.outWidth]}];let x=t.runWebGPUProgram(g,[n,h],a.dtype,f);return t.disposeData(h.dataId),x}var oG={kernelName:Ji,backendName:\"webgpu\",kernelFunc:uce};function pce(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s,output:a}=e,i=s;wm([s,a],\"maxPoolGrad\");let{filterSize:p,strides:u,pad:l,dimRoundingMode:c}=o,m=C.computePool2DInfo(i.shape,p,u,1,l,c),d=new Ka(m,\"max\",!0),f=[{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.padInfo.top,m.padInfo.left]},{type:\"int32\",data:[m.dilationHeight,m.dilationWidth]},{type:\"int32\",data:[m.inHeight,m.inWidth]},{type:\"int32\",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=t.runWebGPUProgram(d,[i],\"int32\",f),g=new iy(m);f=[{type:\"int32\",data:[m.strideHeight,m.strideWidth]},{type:\"int32\",data:[m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:\"int32\",data:[m.dilationHeight,m.dilationWidth]},{type:\"int32\",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:\"int32\",data:[m.outHeight]},{type:\"int32\",data:[m.outWidth]}];let x=t.runWebGPUProgram(g,[n,h],i.dtype,f);return t.disposeData(h.dataId),x}var nG={kernelName:Zi,backendName:\"webgpu\",kernelFunc:pce};function lce(r){let{inputs:e,backend:t,attrs:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=o,{x:p}=e;y.assert(p.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${p.shape.length}.`);let u=[1,1];y.assert(C.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let l=C.computePool2DInfo(p.shape,n,s,u,a),c=[{type:\"int32\",data:[l.strideHeight,l.strideWidth]},{type:\"int32\",data:[l.padInfo.top,l.padInfo.left]},{type:\"int32\",data:[l.dilationHeight,l.dilationWidth]},{type:\"int32\",data:[l.inHeight,l.inWidth]},{type:\"int32\",data:[l.effectiveFilterHeight,l.effectiveFilterWidth]}],m=new Ka(l,\"max\",!1),d=t.runWebGPUProgram(m,[p],p.dtype,c);m=new Ka(l,\"max\",!0,!0,i);let f=t.runWebGPUProgram(m,[p],\"int32\",c);return[d,f]}var sG={kernelName:ga,backendName:\"webgpu\",kernelFunc:lce};function cce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;return ao(n,s,a,\"min\",t)}var aG={kernelName:as,backendName:\"webgpu\",kernelFunc:cce};var mce=tt({opType:fe.MIN,cpuKernelImpl:XV}),iG={kernelName:Eo,backendName:\"webgpu\",kernelFunc:mce};var py=class{constructor(e,t,o){this.uniforms=\"\",this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((n,s)=>n[0]+e[s]+n[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.xShape=e,t.map((n,s)=>{this.uniforms+=` pad${s} : vec2,`}),this.offset=o===\"reflect\"?0:1,this.shaderKey=`mirrorPad_${o}`}getUserCode(){let e=this.xShape.length,t=this.xShape.map((u,l)=>`uniforms.pad${l}[0]`).join(\",\"),o=this.xShape.map((u,l)=>`uniforms.pad${l}[0] + uniforms.xShape${e>1?`[${l}]`:\"\"}`).join(\",\"),n=e===1?\"start\":\"start[i]\",s=e===1?\"end\":\"end[i]\",a=e===1?\"outC\":\"outC[i]\",i=ft(e),p=e>1?[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,e):\"coords\";return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let start = ${i}(${t});\n let end = ${i}(${o});\n var outC = getCoordsFromIndex(index);\n for (var i = 0; i < ${e}; i = i + 1) {\n if (${a} < ${n}) {\n ${a} = ${n} * 2 - ${a} - ${this.offset};\n } else if(${a} >= ${s}) {\n ${a} = (${s} - 1) * 2 - ${a} + ${this.offset};\n }\n }\n let coords = outC - start;\n setOutputAtIndex(index, getX(${p}));\n }\n }\n `}};var uG={kernelName:is,backendName:\"webgpu\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o}=r,{paddings:n,mode:s}=e,a=t,i=n.map(l=>({type:\"int32\",data:[l[0],l[1]]})),p=new py(o.shape,n,s);return a.runWebGPUProgram(p,[o],o.dtype,i)}};var dce=tt({opType:fe.MOD}),pG={kernelName:us,backendName:\"webgpu\",kernelFunc:dce};var ly=class{constructor(e,t){this.variableNames=[\"probs\"],this.outputShape=[],this.uniforms=\"seed : f32, numOutcomes: i32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"multinomial\"}getUserCode(){return`\n //Based on the work of Dave Hoskins\n //https://www.shadertoy.com/view/4djSRW\n fn random (seed : f32, resultUV : vec2) -> f32 {\n let HASHSCALE1 = 443.8975;\n let p = resultUV * seed;\n var p3 = fract(vec3(p.xyx) * HASHSCALE1);\n p3 = p3 + dot(p3, p3.yzx + 19.19);\n return fract((p3.x + p3.y) * p3.z);\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let batch = coords[0];\n\n let resUV = vec2(f32(coords[1]) / f32(uniforms.outShape[1]),\n f32(coords[0]) / f32(uniforms.outShape[0]));\n let r = random(uniforms.seed, resUV);\n var cdf = 0.0;\n for (var i = 0; i < uniforms.numOutcomes - 1; i = i + 1) {\n cdf = cdf + getProbs(batch, i);\n\n if (r < cdf) {\n setOutputAtIndexI32(index, i);\n return;\n }\n }\n\n // If no other event happened, last event happened.\n setOutputAtIndexI32(index, uniforms.numOutcomes - 1);\n }\n }\n `}};var cy=class{constructor(e){this.variableNames=[\"logits\"],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=[this.outputShape[0],1,1],this.outputShape[1]>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.shaderKey=\"softmax\"}getUserCode(){return`\n var buf : array;\n var rowMaxShared : f32;\n var rowSumShared : f32;\n const blockSize = ${this.workgroupSize[0]};\n ${G(\"index\")} {\n let row = index / blockSize;\n let tid = i32(localId.x);\n let cols = uniforms.outShape[1];\n\n var threadMax = -3.402823e+38f;\n for (var col = tid; col < cols; col += blockSize) {\n let value = getLogits(row, col);\n threadMax = max(threadMax, value);\n }\n if (tid < cols) {\n buf[tid] = threadMax;\n }\n workgroupBarrier();\n\n var reduceSize = min(cols, blockSize);\n for (var currSize = reduceSize >> 1; currSize > 0; currSize = reduceSize >> 1) {\n reduceSize = currSize + (reduceSize & 1);\n if (tid < currSize) {\n buf[tid] = max(buf[tid], buf[tid + reduceSize]);\n }\n workgroupBarrier();\n }\n\n if (tid == 0) {\n rowMaxShared = buf[0];\n }\n workgroupBarrier();\n\n var threadSum = 0.0;\n for (var col = tid; col < cols; col += blockSize) {\n let subExp = exp(getLogits(row, col) - rowMaxShared);\n threadSum += subExp;\n }\n buf[tid] = threadSum;\n workgroupBarrier();\n\n for (var currSize = blockSize >> 1; currSize > 0; currSize = currSize >> 1) {\n if (tid < currSize) {\n buf[tid] = buf[tid] + buf[tid + currSize];\n }\n workgroupBarrier();\n }\n\n if (tid == 0) {\n rowSumShared = buf[0];\n }\n workgroupBarrier();\n\n for (var col = tid; col < cols; col += blockSize) {\n let value = exp(getLogits(row, col) - rowMaxShared) / rowSumShared;\n setOutputAtCoords(row, col, value);\n }\n }\n `}};function Yv(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{dim:s}=o,a=le({inputs:{x:n},backend:t,attrs:{shape:[y.sizeFromShape(n.shape)/n.shape[s],n.shape[s]]}}),i=new cy(a.shape),p=t.runWebGPUProgram(i,[a],n.dtype),u=le({inputs:{x:p},backend:t,attrs:{shape:n.shape}});return t.disposeData(a.dataId),t.disposeData(p.dataId),u}var lG={kernelName:Fs,backendName:\"webgpu\",kernelFunc:Yv};function fce(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o,p=i?n:Yv({inputs:{logits:n},backend:t,attrs:{dim:n.shape.length-1}}),u=p.shape[0],l=p.shape[1],c=new ly(u,s),m=[{type:\"float32\",data:[a]},{type:\"int32\",data:[l]}],d=t.runWebGPUProgram(c,[p],\"int32\",m);return i||t.disposeData(p.dataId),d}var cG={kernelName:ps,backendName:\"webgpu\",kernelFunc:fce};function hce(r){let{inputs:e,backend:t}=r,{x:o}=e;if(t.shouldExecuteOnCPU([o])){let s=t.tensorMap.get(o.dataId),[a,i]=QV(s.values,o.shape,o.dtype);return t.makeTensorInfo(i,o.dtype,a)}let n=new so(o.shape,Z.NEG);return t.runWebGPUProgram(n,[o],o.dtype)}var mG={kernelName:ls,backendName:\"webgpu\",kernelFunc:hce};function gce(r){console.warn(\"tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=t.readSync(n.dataId),l=t.readSync(s.dataId),{selectedIndices:c}=Ut.nonMaxSuppressionV3Impl(u,l,a,i,p);return t.makeTensorInfo([c.length],\"int32\",new Int32Array(c))}var dG={kernelName:cs,backendName:\"webgpu\",kernelFunc:gce};function xce(r){console.warn(\"tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead\");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,l=t.readSync(n.dataId),c=t.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=Ut.nonMaxSuppressionV5Impl(l,c,m,d,f,h);return[t.makeTensorInfo([g.length],\"int32\",new Int32Array(g)),t.makeTensorInfo([x.length],\"float32\",new Float32Array(x))]}var fG={kernelName:ms,backendName:\"webgpu\",kernelFunc:xce};var my=class{constructor(e,t){this.variableNames=[\"x\"],this.uniforms=\"onValue : f32, offValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"onehot\"}getUserCode(){return`\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n setOutputAtIndex(index, mix(uniforms.offValue, uniforms.onValue,\n f32(i32(round(getX(coords.x))) == coords.y)));\n }\n }\n `}};function yce(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n}=e,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),l=new my(u,a),c=le({inputs:{x:n},backend:t,attrs:{shape:[u]}}),m=[{type:\"float32\",data:[i]},{type:\"float32\",data:[p]}],d=t.runWebGPUProgram(l,[c],s,m);t.disposeData(c.dataId);let f=[...n.shape,a],h=le({inputs:{x:d},backend:t,attrs:{shape:f}});return t.disposeData(d.dataId),h}var hG={kernelName:ds,backendName:\"webgpu\",kernelFunc:yce};function Em(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype===\"complex64\"){let n=Fi({inputs:{input:o},backend:t}),s=Em({inputs:{x:n},backend:t}),a=Mp({inputs:{input:o},backend:t}),i=Em({inputs:{x:a},backend:t}),p=Uo({inputs:{real:s,imag:i},backend:t});return t.disposeData(n.dataId),t.disposeData(s.dataId),t.disposeData(a.dataId),t.disposeData(i.dataId),p}else return Nt({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype===\"string\"?\"\":0},backend:t})}var gG={kernelName:_a,backendName:\"webgpu\",kernelFunc:Em};function xG(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype===\"string\")throw new Error(\"onesLike is not supported under string dtype\");if(o.dtype===\"complex64\"){let n=Fi({inputs:{input:o},backend:t}),s=xG({inputs:{x:n},backend:t}),a=Mp({inputs:{input:o},backend:t}),i=Em({inputs:{x:a},backend:t}),p=Uo({inputs:{real:s,imag:i},backend:t});return t.disposeData(n.dataId),t.disposeData(s.dataId),t.disposeData(a.dataId),t.disposeData(i.dataId),p}else return Nt({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:t})}var yG={kernelName:xa,backendName:\"webgpu\",kernelFunc:xG};function bce(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o;if(e.length===1)return Yx({inputs:{input:e[0]},backend:t,attrs:{dim:n}});let s=e[0].shape,a=e[0].dtype;e.forEach(l=>{y.assertShapesMatch(s,l.shape,\"All tensors passed to stack must have matching shapes\"),y.assert(a===l.dtype,()=>\"All tensors passed to stack must have matching dtypes\")});let i=[],p=e.map(l=>{let c=Yx({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=Hv({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeData(l.dataId)),u}var bG={kernelName:ya,backendName:\"webgpu\",kernelFunc:bce};function Qv(r,e=!1){let t=r.length,o=ft(t),n=r.map((c,m)=>`uniforms.pad${m}[0]`).join(\",\"),s=r.map((c,m)=>`uniforms.pad${m}[0] + uniforms.xShape${t>1?`[${m}]`:\"\"}`).join(\",\"),a=t>1?`${o}(${n})`:`${n}`,i=t>1?`${o}(${s})`:`${s}`,p=t>1?\"any(paddedCoords < start)\":\"paddedCoords < start\",u=t>1?\"any(paddedCoords >= end)\":\"paddedCoords >= end\",l=t>1?[\"coords[0]\",\"coords[1]\",\"coords[2]\",\"coords[3]\"].slice(0,t):\"coords\";return`\n let start = ${a};\n let end = ${i};\n if (${p} || ${u}) {\n setOutputAtIndex(index, ${e?0:\"uniforms.constantValue\"});\n } else {\n let coords = paddedCoords - start;\n setOutputAtIndex(index, getX(${l}));\n }\n `}var dy=class{constructor(e,t){this.variableNames=[\"x\"],this.uniforms=\"constantValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((o,n)=>o[0]+e[n]+o[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),t.map((o,n)=>{this.uniforms+=` pad${n} : vec2,`}),this.xShape=e,this.shaderKey=\"pad\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let paddedCoords = getCoordsFromIndex(index);\n ${Qv(this.xShape)}\n }\n }\n `}};var Cce=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{paddings:s,constantValue:a}=o;if(s.every(u=>y.arraysEqual(u,[0,0])))return Pt({inputs:{x:n},backend:t});if(y.sizeFromShape(n.shape)===0){let u=s.map((l,c)=>l[0]+n.shape[c]+l[1]);return Nt({backend:t,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=[{type:\"float32\",data:[a]}];s.map(u=>i.push({type:\"int32\",data:[u[0],u[1]]}));let p=new dy(n.shape,s);return t.runWebGPUProgram(p,[n],n.dtype,i)},CG={kernelName:fs,backendName:\"webgpu\",kernelFunc:Cce};var wce=tt({opType:fe.POW}),wG={kernelName:hs,backendName:\"webgpu\",kernelFunc:wce};function Sce(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e,s=new Di(fe.PRELU,o.shape,n.shape);return t.runWebGPUProgram(s,[o,n],\"float32\")}var SG={kernelName:gs,backendName:\"webgpu\",kernelFunc:Sce};function Ice(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;return ao(n,s,a,\"prod\",t)}var IG={kernelName:Ho,backendName:\"webgpu\",kernelFunc:Ice};var vce=r=>{let{backend:e,attrs:t}=r,{start:o,stop:n,step:s,dtype:a}=t,i=eW(o,n,s,a);return e.makeTensorInfo([i.length],a,i)},vG={kernelName:ba,backendName:\"webgpu\",kernelFunc:vce};var kce=tt({opType:fe.DIV}),kG={kernelName:Vn,backendName:\"webgpu\",kernelFunc:kce};var Nce=ye({opType:Z.RECIPROCAL}),NG={kernelName:xs,backendName:\"webgpu\",kernelFunc:Nce};var Tce=ye({opType:Z.RELU}),TG={kernelName:ys,backendName:\"webgpu\",kernelFunc:Tce};var _ce=ye({opType:Z.RELU6}),_G={kernelName:ws,backendName:\"webgpu\",kernelFunc:_ce};var fy=class{constructor(e,t,o){this.variableNames=[\"x\"],this.uniforms=\"adjustHeightWidth : vec2, halfPixelCenters : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,o,e[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"resizeBilinear\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let d = coords[3];\n let rc = coords.yz;\n\n let effectiveInSize = vec2(\n f32(uniforms.xShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.xShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveOutSize = vec2(\n f32(uniforms.outShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.outShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveInputOverOutputRatioRC =\n effectiveInSize / effectiveOutSize;\n\n // Fractional source index\n let sourceFracIndexRC =\n (vec2(rc) + vec2(uniforms.halfPixelCenters)) *\n effectiveInputOverOutputRatioRC - vec2(uniforms.halfPixelCenters);\n\n // Compute the four integer indices.\n let sourceFloorRC = vec2(sourceFracIndexRC);\n let sourceCeilRC = vec2(\n min(vec2(uniforms.xShape.yz) - vec2(1.0), ceil(sourceFracIndexRC)));\n\n let topLeft = getX(b, sourceFloorRC.x, sourceFloorRC.y, d);\n let bottomLeft = getX(b, sourceCeilRC.x, sourceFloorRC.y, d);\n let topRight = getX(b, sourceFloorRC.x, sourceCeilRC.y, d);\n let bottomRight = getX(b, sourceCeilRC.x, sourceCeilRC.y, d);\n\n let fracRC = sourceFracIndexRC - vec2(sourceFloorRC);\n\n let top = topLeft + (topRight - topLeft) * fracRC.y;\n let bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y;\n let newValue = top + (bottom - top) * fracRC.x;\n\n setOutputAtIndex(index, newValue);\n }\n }\n `}};function Ece(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,size:a,halfPixelCenters:i}=o,[p,u]=a,l=s&&p>1?1:0,c=s&&u>1?1:0,d=[{type:\"float32\",data:[l,c]},{type:\"float32\",data:[i?.5:0]}],f=new fy(n.shape,p,u);return t.runWebGPUProgram(f,[n],\"float32\",d)}var EG={kernelName:Cs,backendName:\"webgpu\",kernelFunc:Ece};var hy=class{constructor(e,t){this.variableNames=[\"dy\"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32,\n invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=t,this.shaderKey=`resizeBilinearBackprop_${t}`}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let d = coords[3];\n let r = coords[1];\n let c = coords[2];\n\n var accumulator = 0.0;\n\n // Compute bounds for where in dy we will look\n let startRLerp = floor(f32(r) * uniforms.invHeightScale);\n let startDyR = i32(startRLerp - f32(uniforms.winHeight / 2));\n\n let startCLerp = floor(f32(c) * uniforms.invWidthScale);\n let startDyC = i32(startCLerp - f32(uniforms.winWidth / 2));\n\n // Loop over dy\n for (var dyROffset = 0; dyROffset < uniforms.winHeight; dyROffset++) {\n let dyR = startDyR + dyROffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= uniforms.dyShape[1]) {\n continue;\n }\n\n for (var dyCOffset = 0; dyCOffset < uniforms.winWidth; dyCOffset++) {\n let dyC = startDyC + dyCOffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= uniforms.dyShape[2]) {\n continue;\n }\n\n let dxR = f32(dyR) * uniforms.heightScale;\n let topDxRIndex = i32(floor(dxR));\n let bottomDxRIndex = i32(min(ceil(dxR), f32(uniforms.outShape[1] - 1)));\n let dxRLerp = dxR - f32(topDxRIndex);\n let inverseDxRLerp = 1.0 - dxRLerp;\n\n let dxC = f32(dyC) * uniforms.widthScale;\n let leftDxCIndex = i32(floor(dxC));\n let rightDxCIndex = i32(min(ceil(dxC), f32(uniforms.outShape[2] - 1)));\n let dxCLerp = dxC - f32(leftDxCIndex);\n let inverseDxCLerp = 1.0 - dxCLerp;\n\n if (r == topDxRIndex && c == leftDxCIndex) {\n // topLeft\n accumulator +=\n getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp;\n }\n\n if (r == topDxRIndex && c == rightDxCIndex) {\n // topRight\n accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp;\n }\n\n if (r == bottomDxRIndex && c == leftDxCIndex) {\n // bottomLeft\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp;\n }\n\n if (r == bottomDxRIndex && c == rightDxCIndex) {\n // bottomRight\n accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp;\n }\n }\n }\n // End loop over dy\n\n setOutputAtIndex(index, accumulator);\n }\n }\n `}};function $ce(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,[,i,p]=n.shape,[,u,l]=s.shape,c=[a&&u>1?i-1:i,a&&l>1?p-1:p],m=[a&&u>1?u-1:u,a&&l>1?l-1:l],d=c[0]/m[0],f=c[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,w=new hy(n.shape,a),S=[{type:\"int32\",data:c},{type:\"int32\",data:m},{type:\"float32\",data:[d]},{type:\"float32\",data:[f]},{type:\"float32\",data:[h]},{type:\"float32\",data:[g]},{type:\"int32\",data:[x]},{type:\"int32\",data:[b]}];return t.runWebGPUProgram(w,[s],s.dtype,S)}var $G={kernelName:ii,backendName:\"webgpu\",kernelFunc:$ce};var gy=class{constructor(e,t,o,n){this.variableNames=[\"x\"],this.uniforms=\"adjustHeightWidth : vec2, roundBase : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,o,e[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.halfPixelCenters=n,this.shaderKey=`resizeNearest_${n}`}getUserCode(){let e;return this.halfPixelCenters?e=\"max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))\":e=\"vec2(rc) * effectiveInputOverOutputRatioRC\",`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let b = coords[0];\n let d = coords[3];\n let rc = coords.yz;\n\n let effectiveInSize = vec2(\n f32(uniforms.xShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.xShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveOutSize = vec2(\n f32(uniforms.outShape.y) - uniforms.adjustHeightWidth[0],\n f32(uniforms.outShape.z) - uniforms.adjustHeightWidth[1]);\n\n let effectiveInputOverOutputRatioRC =\n effectiveInSize / effectiveOutSize;\n\n // Fractional source index\n let sourceFracIndexRC = ${e};\n\n // Compute the coordinators of nearest neighbor point.\n let inputShapeRC = vec2(f32(uniforms.xShape.y), f32(uniforms.xShape.z));\n let sourceNearestRC = vec2(\n min(inputShapeRC - 1.0, floor(sourceFracIndexRC + uniforms.roundBase)));\n let newValue = getX(b, sourceNearestRC.x, sourceNearestRC.y, d);\n\n setOutputAtIndex(index, newValue);\n }\n }\n `}};function Rce(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,l=s&&p>1?1:0,c=s&&u>1?1:0,d=[{type:\"float32\",data:[l,c]},{type:\"float32\",data:[s?.5:0]}],f=new gy(n.shape,p,u,a);return t.runWebGPUProgram(f,[n],n.dtype,d)}var RG={kernelName:bs,backendName:\"webgpu\",kernelFunc:Rce};var xy=class{constructor(e,t){this.variableNames=[\"dy\"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32,\n winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=t,this.shaderKey=`resizeNearestNeigborBackprop_${t}`}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getOutputCoords();\n let b = coords[0];\n let d = coords[3];\n let r = coords[1];\n let c = coords[2];\n\n var accumulator = 0.0;\n\n // Compute bounds for where in dy we will look\n let startRLerp = floor(f32(r) * uniforms.invHeightScale);\n let startDyR = i32(floor(startRLerp - f32(uniforms.winHeight / 2)));\n\n let startCLerp = floor(f32(c) * uniforms.invWidthScale);\n let startDyC = i32(floor(startCLerp - f32(uniforms.winWidth / 2)));\n\n // Loop over dy\n for (var dyROffset = 0; dyROffset < uniforms.winHeight; dyROffset++) {\n let dyR = startDyR + dyROffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyR < 0 || dyR >= uniforms.dyShape[1]) {\n continue;\n }\n\n for (var dyCOffset = 0; dyCOffset < uniforms.winWidth; dyCOffset++) {\n let dyC = startDyC + dyCOffset;\n\n // Guard against the window exceeding the bounds of dy\n if (dyC < 0 || dyC >= uniforms.dyShape[2]) {\n continue;\n }\n\n let sourceFracRow = f32(uniforms.effectiveXSize[0]) *\n (f32(dyR) / f32(uniforms.effectiveYSize[0]));\n\n let sourceFracCol = f32(uniforms.effectiveXSize[1]) *\n (f32(dyC) / f32(uniforms.effectiveYSize[1]));\n\n let sourceNearestRow =\n i32(min(f32(uniforms.outShape[1] - 1),\n ${this.alignCorners?\"floor(sourceFracRow + 0.5)\":\"floor(sourceFracRow)\"}));\n\n let sourceNearestCol =\n i32(min(f32(uniforms.outShape[2] - 1),\n ${this.alignCorners?\"floor(sourceFracCol + 0.5)\":\"floor(sourceFracCol)\"}));\n\n if (r == sourceNearestRow && c == sourceNearestCol) {\n accumulator += getDy(b, dyR, dyC, d);\n }\n }\n }\n // End loop over dy\n\n setOutputAtIndex(index, accumulator);\n }\n }\n `}};function Dce(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,[,i,p]=n.shape,[,u,l]=s.shape,c=[a&&u>1?i-1:i,a&&l>1?p-1:p],m=[a&&u>1?u-1:u,a&&l>1?l-1:l],d=c[0]/m[0],f=c[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,w=new xy(n.shape,a),S=[{type:\"int32\",data:c},{type:\"int32\",data:m},{type:\"float32\",data:[h]},{type:\"float32\",data:[g]},{type:\"int32\",data:[x]},{type:\"int32\",data:[b]}];return t.runWebGPUProgram(w,[s],s.dtype,S)}var DG={kernelName:ai,backendName:\"webgpu\",kernelFunc:Dce};var yy=class{constructor(e){this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=\" axis : vec4,\",this.shaderKey=\"reverse\"}getUserCode(){return`\n \n // Using uniform variables as judging conditions, so the function has\n // coherent execution within all threads.\n fn getReverseCoords(coords : vec4) -> vec4 {\n var reverseCoords = coords;\n if (uniforms.axis[0] == 1) {\n reverseCoords[0] = uniforms.xShape[0] - coords[0] - 1;\n }\n if (uniforms.axis[1] == 1) {\n reverseCoords[1] = uniforms.xShape[1] - coords[1] - 1;\n }\n if (uniforms.axis[2] == 1) {\n reverseCoords[2] = uniforms.xShape[2] - coords[2] - 1;\n }\n if (uniforms.axis[3] == 1) {\n reverseCoords[3] = uniforms.xShape[3] - coords[3] - 1;\n }\n\n return reverseCoords;\n }\n \n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let reverseCoords = getReverseCoords(coords);\n setOutputAtIndex(index, getX(reverseCoords[0],\n reverseCoords[1], reverseCoords[2], reverseCoords[3]));\n }\n }\n `}};function Ace(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o,a=n.shape.length;if(a===0)return Pt({inputs:{x:n},backend:t});let i=n.shape,p=[1,1,1,1];i.forEach((g,x)=>{let b=x+4-a;p[b]=g});let u=y.parseAxisParam(s,n.shape),l=[0,0,0,0];u.forEach(g=>{let x=g+4-a;l[x]=1});let c=[{type:\"int32\",data:l}],m=le({inputs:{x:n},backend:t,attrs:{shape:p}}),d=new yy(p),f=t.runWebGPUProgram(d,[m],m.dtype,c);t.disposeData(m.dataId);let h=le({inputs:{x:f},backend:t,attrs:{shape:i}});return t.disposeData(f.dataId),h}var AG={kernelName:Ss,backendName:\"webgpu\",kernelFunc:Ace};var by=class{constructor(e,t){this.outputShape=[],this.variableNames=[\"x\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`centerX : f32, centerY : f32, sinRadians : f32,\n cosRadians : f32,`,this.shaderKey=\"rotate\",this.outputShape=e,typeof t==\"number\"?(this.uniforms+=\" fillValue : f32,\",this.fillSnippet=\"var outputValue = uniforms.fillValue;\",this.shaderKey+=\"_float\"):(this.uniforms+=\" fillValue : vec3,\",this.fillSnippet=\"var outputValue = uniforms.fillValue[coords[3]];\",this.shaderKey+=\"_vec3\")}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let coordXFloat = (f32(coords[2]) - uniforms.centerX) *\n uniforms.cosRadians - (f32(coords[1]) - uniforms.centerY) *\n uniforms.sinRadians;\n let coordYFloat = (f32(coords[2]) - uniforms.centerX) *\n uniforms.sinRadians + (f32(coords[1]) - uniforms.centerY) *\n uniforms.cosRadians;\n let coordX = i32(round(coordXFloat + uniforms.centerX));\n let coordY = i32(round(coordYFloat + uniforms.centerY));\n ${this.fillSnippet}\n if(coordX >= 0 && coordX < uniforms.xShape[2] && coordY >= 0 &&\n coordY < uniforms.xShape[1]) {\n outputValue = getX(coords[0], coordY, coordX, coords[3]);\n }\n setOutputAtIndex(index, outputValue);\n }\n }\n `}};var FG={kernelName:Vs,backendName:\"webgpu\",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=e,i=t,p=new by(o.shape,s),[u,l]=C.getImageCenter(a,o.shape[1],o.shape[2]),c=[{type:\"float32\",data:[u]},{type:\"float32\",data:[l]},{type:\"float32\",data:[Math.sin(n)]},{type:\"float32\",data:[Math.cos(n)]}];return typeof s==\"number\"?c.push({type:\"float32\",data:[Number.parseFloat(s.toFixed(2))]}):c.push({type:\"float32\",data:s}),i.runWebGPUProgram(p,[o],o.dtype,c)}};var Fce=ye({opType:Z.ROUND}),PG={kernelName:Is,backendName:\"webgpu\",kernelFunc:Fce};var Pce=ye({opType:Z.RSQRT,cpuKernelImpl:tW}),OG={kernelName:Do,backendName:\"webgpu\",kernelFunc:Pce};var qa=class{constructor(e,t,o,n,s,a,i,p=!0){this.variableNames=[\"updates\",\"indices\"],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=a,this.type=i,this.sumDupeIndices=p,this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),this.sliceDimGreaterThanOne=t>1,this.shaderKey=`scatter_${o}_${n}_${this.sliceDimGreaterThanOne}_${i}_${p}_${s.length}`;let u=ft(s.length);this.uniforms=`sliceDim : i32, strides: ${u}, updatesSize: i32,`,this.updatesRank=n,this.indicesRank=o}getUserCode(){let e=\"\";this.indicesRank===1?e=\"coords[0]\":this.indicesRank===2&&(e=\"coords[0], j\");let t=`getIndices(${e})`,o=this.sliceDimGreaterThanOne?\"uniforms.strides[j]\":\"uniforms.strides\",n=\"\",s=\"\";this.dispatchLayout.x.length===1?(n=\"flattenedIndex\",s=`\n fn getUpdatesCoordsFromFlatIndex(index : i32) -> i32 {\n return index;\n }\n `):this.dispatchLayout.x.length===2&&(n=\"vec2(flattenedIndex, coords[1])\",s=`\n fn getUpdatesCoordsFromFlatIndex(index : i32) -> vec2 {\n // N.B. |updates| could be a scalar tensor, conceptually representing a\n // 2D tensor with all values equal to that. By design, its size must be\n // the same as |outShape[1]| in one dimension, and |indicesShape[0]|\n // gives the other.\n let sliceSize = uniforms.outShape[1];\n let d0 = index / sliceSize;\n let d1 = index - d0 * sliceSize;\n return vec2(d0, d1);\n }\n `);let i=`getUpdates(${Array.from({length:this.updatesRank},(u,l)=>`coords[${l}]`).join(\", \")})`;return`\n ${s}\n ${G(\"index\")} {\n if (index < uniforms.updatesSize) {\n let coords = getUpdatesCoordsFromFlatIndex(index);\n var flattenedIndex = 0;\n for (var j = 0; j < uniforms.sliceDim; j = j + 1) {\n let indexInside = i32(round(${t}));\n flattenedIndex = flattenedIndex + indexInside * ${o};\n }\n let updateValue =\n ${Eu(this.type)}(${i});\n let flatIndex = getOutputIndexFromCoords(${n});\n\n ${this.sumDupeIndices?oo(\"&result[flatIndex]\",\"updateValue\",this.type):\"atomicStore(&result[flatIndex], bitcast(updateValue));\"}\n }\n }`}};function Oce(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(s,n,a),m=[c/u,u];if(c===0)return t.makeTensorInfo(a,n.dtype);let d=le({inputs:{x:n},backend:t,attrs:{shape:[p,i]}}),f=le({inputs:{x:s},backend:t,attrs:{shape:[p,u]}}),h=f.dtype,g=Nt({backend:t,attrs:{shape:m,value:0,dtype:h}}),x=y.sizeFromShape(f.shape),b=[{type:\"int32\",data:[i]},{type:\"int32\",data:l},{type:\"int32\",data:[x]}],w=new qa(f.shape,i,d.shape.length,f.shape.length,l,m,h),S=t.runWebGPUProgram(w,[f,d],h,b,g),k=le({inputs:{x:S},backend:t,attrs:{shape:a}});return t.disposeData(d.dataId),t.disposeData(f.dataId),t.disposeData(S.dataId),k}var MG={kernelName:vs,backendName:\"webgpu\",kernelFunc:Oce};var Cy=class{constructor(e,t){this.outputShape=[],this.variableNames=[\"sortedSequence\",\"values\"],this.uniforms=\"numInputs : i32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.side=t,this.shaderKey=`search_sorted_${t}`}getUserCode(){return`\n fn findBound(batch: i32, value: f32) -> i32 {\n var left = i32(0);\n var right = uniforms.numInputs;\n while (left < right) {\n var mid = (left + right) / 2;\n if (getSortedSequence(batch, mid) ${this.side===\"left\"?\"<\":\"<=\"} value) {\n left = mid + 1;\n } else {\n right = mid;\n }\n }\n return right;\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let value = getValuesByOutputIndex(index);\n setOutputAtIndexI32(index, findBound(coords[0], value));\n }\n }\n `}};function Mce(r){let{inputs:e,backend:t,attrs:o}=r,{sortedSequence:n,values:s}=e,{side:a}=o,i=new Cy([s.shape[0],s.shape[1]],a),p=[{type:\"int32\",data:[n.shape[1]]}];return t.runWebGPUProgram(i,[n,s],\"int32\",p)}var LG={kernelName:Ns,backendName:\"webgpu\",kernelFunc:Mce};var wy=class{constructor(e,t,o){this.variableNames=[\"c\",\"a\",\"b\"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.cRank=e,this.rank=o,this.shaderKey=\"select\"}getUserCode(){let e,t;if(this.rank>4)throw Error(`Where for rank ${this.rank} is not yet supported`);if(this.rank===1)t=\"resRC\",e=\"resRC\";else{let n=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],s=[],a=[];for(let i=0;i= 1.0) {\n setOutputAtIndex(index, getA(${t}));\n } else {\n setOutputAtIndex(index, getB(${t}));\n }\n }\n }\n `}};function Lce(r){let{inputs:e,backend:t}=r,{condition:o,t:n,e:s}=e,a=new wy(o.shape.length,n.shape,n.shape.length);return t.runWebGPUProgram(a,[o,n,s],pt(n.dtype,s.dtype))}var BG={kernelName:wa,backendName:\"webgpu\",kernelFunc:Lce};var Bce=ye({opType:Z.SELU}),zG={kernelName:Ts,backendName:\"webgpu\",kernelFunc:Bce};var zce=ye({opType:Z.SIGMOID}),VG={kernelName:Ao,backendName:\"webgpu\",kernelFunc:zce};var Vce=ye({opType:Z.SIGN}),WG={kernelName:Rs,backendName:\"webgpu\",kernelFunc:Vce};var Wce=ye({opType:Z.SIN}),UG={kernelName:Es,backendName:\"webgpu\",kernelFunc:Wce};var Uce=ye({opType:Z.SINH}),GG={kernelName:$s,backendName:\"webgpu\",kernelFunc:Uce};var Gce=ye({opType:Z.SOFTPLUS}),HG={kernelName:Ds,backendName:\"webgpu\",kernelFunc:Gce};var Sy=class{constructor(e,t,o,n,s,a){this.variableNames=[\"x\"],this.outputShape=[],this.uniforms=\"\",this.workgroupSize=[64,1,1],this.size=!0;let i=new Array(n.length);for(let p=0;p{this.uniforms+=` pad${u} : vec2,`}),this.shaderKey=`spaceToBatchND_${s}`}getUserCode(){let e=ft(this.outputShape.length),t=Bv(this.newDim);return`\n ${xm(this.paddedXShape,\"PaddedX\")}\n ${G(\"index\")} {\n if(index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${e}(${t}), uniforms.reshapedPaddedXShape);\n let paddedCoords = getPaddedXCoordsFromIndex(switchedIndex);\n ${Qv(this.xShape,!0)}\n }\n }\n `}};var Hce=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>\"spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet\");let i=s.reduce((b,w)=>b*w),p=[[0,0]];p.push(...a);for(let b=1+s.length;bb[0]+n.shape[w]+b[1]),l=C.getReshaped(u,s,i,!1),c=C.getPermuted(l.length,s.length,!1),m=C.getReshapedPermuted(u,s,i,!1),d=y.computeStrides(u),f=new Sy(n.shape,u,p,l,c,d.length),h=[{type:\"int32\",data:l},{type:\"int32\",data:d}];p.map(b=>h.push({type:\"int32\",data:[b[0],b[1]]}));let g=t.runWebGPUProgram(f,[n],n.dtype,h),x=le({inputs:{x:g},backend:t,attrs:{shape:m}});return t.disposeData(g.dataId),x},KG={kernelName:Sa,backendName:\"webgpu\",kernelFunc:Hce};var Iy=class{constructor(e,t,o){this.variableNames=[\"input\",\"indices\",\"segmentIds\"],this.outputShape=[],this.uniforms=\"segmentSize : i32, sparseSize : i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e,this.type=o,this.dispatchLayout=X([t]),this.dispatch=H(this.dispatchLayout,[t],this.workgroupSize),this.shaderKey=\"sparseSegmentSum\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.sparseSize) {\n let indexInSegmentIds = index / uniforms.segmentSize;\n let indexInSegment = index % uniforms.segmentSize;\n let indexInInput = indices[indexInSegmentIds];\n let segmentId = segmentIds[indexInSegmentIds];\n\n let value = input[indexInInput * uniforms.segmentSize + indexInSegment];\n let outIndex = segmentId * uniforms.segmentSize + indexInSegment;\n ${oo(\"&result[outIndex]\",\"value\",this.type)}\n }\n }\n `}},vy=class{constructor(e,t){this.variableNames=[\"segmentIds\"],this.outputShape=[],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=[e],this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),this.shaderKey=\"sparseSegmentIdCountProgram\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.segmentIdsShape) {\n let segmentId = segmentIds[index];\n ${oo(\"&result[segmentId]\",\"1\",\"int32\")}\n }\n }\n `}},ky=class{constructor(e,t){this.variableNames=[\"segmentSum\",\"sameSegmentIdCount\"],this.outputShape=[],this.uniforms=\"segmentSize : i32\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.type=t,this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),this.shaderKey=\"sparseSegmentMean\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let segmentId = index / uniforms.segmentSize;\n let count = sameSegmentIdCount[segmentId];\n if (count != 0) {\n ${this.type===\"float32\"?\"setOutputAtIndex(index, segmentSum[index] / f32(count));\":\"setOutputAtIndexI32(index, segmentSum[index] / count);\"}\n }\n }\n }\n `}};function Ny(r,e,t,o=!1,n){let a=y.sizeFromShape(r.shape)/r.shape[0],i=r.dtype,p=y.sizeFromShape(e.shape),u=n.readSync(t.dataId),c=p>0?u[p-1]+1:0,m,d=r.shape.slice();d[0]=c;let f=p*a,h=Nt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new Iy(d,f,i);let g=[{type:\"int32\",data:[a]},{type:\"int32\",data:[f]}],x=n.runWebGPUProgram(m,[r,e,t],i,g,h);if(o)return x;let b=Nt({backend:n,attrs:{shape:[c],value:0,dtype:\"int32\"}});m=new vy(c,t.shape);let w=n.runWebGPUProgram(m,[t],\"int32\",null,b),S=Nt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new ky(d,i),g=[{type:\"int32\",data:[a]}];let k=n.runWebGPUProgram(m,[x,w],i,g,S);return n.disposeData(x.dataId),n.disposeData(w.dataId),k}function Kce(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;return Ny(o,n,s,!1,t)}var qG={kernelName:va,backendName:\"webgpu\",kernelFunc:Kce};function qce(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;return Ny(o,n,s,!0,t)}var jG={kernelName:ka,backendName:\"webgpu\",kernelFunc:qce};var Ty=class{constructor(e,t){this.variableNames=[\"A\"],this.workgroupSize=[64,1,1],this.size=!0;let o=new Array(e.length);for(let n=0;n=5)throw Error(`Tile for rank ${r} is not yet supported`);if(r===1)return`(resRC % ${e}aShape)`;let t=[\"resRC.x\",\"resRC.y\",\"resRC.z\",\"resRC.w\"],o=[];for(let n=0;n=5){let p=t.readSync(n.dataId),u=n.dtype===\"string\"?p.map(m=>y.decodeString(m)):p,l=ie(n.shape,n.dtype,u),c=uW(l,s);return t.makeTensorInfo(c.shape,c.dtype,c.values)}let a=new Ty(n.shape,s);return t.runWebGPUProgram(a,[n],n.dtype)}var XG={kernelName:Mo,backendName:\"webgpu\",kernelFunc:$m};function Xce(r){let{inputs:e,backend:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=C.calculateShapes(s,n,i),d=!1;if(s.dtype===\"string\"){let R=t.bufferSync(n),D=t.bufferSync(s),F=y.decodeString(t.readSync(a.dataId)[0]),O=rW(R,D,i,m,l,u,p,c,F,d);return t.makeTensorInfo(i,O.dtype,O.values)}let f=[m/l,l],h=le({inputs:{x:n},backend:t,attrs:{shape:[u,p]}}),g=s.shape.length?le({inputs:{x:s},backend:t,attrs:{shape:[u,l]}}):Pt({inputs:{x:s},backend:t}),x=g.dtype,b=t.makeTensorInfo([],x,y.makeZerosTypedArray(1,x)),w=le({inputs:{x:a},backend:t,attrs:{shape:Array(f.length).fill(1)}}),S=$m({inputs:{x:w},backend:t,attrs:{reps:f}}),k=y.sizeFromShape([u,l]),T=[{type:\"int32\",data:[p]},{type:\"int32\",data:c},{type:\"int32\",data:[k]}];switch(u){case 0:break;case 1:{let R=new qa([u,l],p,h.shape.length,g.shape.length,c,f,x,d);t.runWebGPUProgram(R,[g,h],x,T,S)}break;default:{let R=new qa([u,l],p,h.shape.length,b.shape.length,c,f,x,d);t.runWebGPUProgram(R,[b,h],x,T,S)}{let R=new qa([u,l],p,h.shape.length,g.shape.length,c,f,x);t.runWebGPUProgram(R,[g,h],x,T,S)}}let E=le({inputs:{x:S},backend:t,attrs:{shape:i}});return t.disposeData(h.dataId),t.disposeData(g.dataId),t.disposeData(w.dataId),t.disposeData(b.dataId),t.disposeData(S.dataId),E}var YG={kernelName:Ps,backendName:\"webgpu\",kernelFunc:Xce};function Yce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=n.shape.length,l=new Array(u).fill(0),c=n.shape.slice();return p.map(m=>{let d=[...c];d[i]=m;let f=ea({inputs:{x:n},backend:t,attrs:{begin:l,size:d}});return l[i]+=m,f})}var QG={kernelName:Ia,backendName:\"webgpu\",kernelFunc:Yce};var Qce=ye({opType:Z.SQRT}),ZG={kernelName:Fo,backendName:\"webgpu\",kernelFunc:Qce};var JG={kernelName:tu,backendName:\"webgpu\",kernelFunc:({inputs:r,backend:e})=>{let{x:t}=r,o=e,n=new so(t.shape,Z.SQUARE);return o.runWebGPUProgram(n,[t],t.dtype)}};var Zce=tt({opType:fe.SQUARED_DIFFERENCE}),e4={kernelName:Po,backendName:\"webgpu\",kernelFunc:Zce};function Jce({inputs:r,attrs:e,backend:t}){let{x:o}=r,n=new so(o.shape,Z.STEP,\"stepAlpha : f32,\"),s=[{type:\"float32\",data:[e.alpha]}];return t.runWebGPUProgram(n,[o],o.dtype,s)}var t4={kernelName:Ko,backendName:\"webgpu\",kernelFunc:Jce};var _y=class{constructor(e){this.variableNames=[\"x\"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]);let t=ft(this.outputShape.length);this.uniforms=`begin : ${t}, strides : ${t}, `,this.shaderKey=\"stridedSlice\"}getUserCode(){let e=this.outputShape.length,t=\"\";if(e===1)t=\"coords * uniforms.strides + uniforms.begin\";else{let n=0;t=this.outputShape.map((s,a)=>(n++,this.outputShape.length===1?`coords * uniforms.strides[${a}] + uniforms.begin[${a}]`:`coords[${n-1}] * uniforms.strides[${a}] + uniforms.begin[${a}]`)).join(\",\")}return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n setOutputAtIndex(index, getX(${t}));\n }\n }\n `}};function eme(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=le({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let T=nt.computeOutShape(b,w,S),E=ea({inputs:{x:n},backend:t,attrs:{begin:b,size:T}});k=le({inputs:{x:E},backend:t,attrs:{shape:f}}),t.disposeData(E.dataId)}else if(t.shouldExecuteOnCPU([n])){let E=t.readSync(n.dataId),R=ie(n.shape,n.dtype,E),D=sW(d,R,S,b);k=t.makeTensorInfo(f,n.dtype,D.values)}else{let E=new _y(d),R=[{type:\"int32\",data:b},{type:\"int32\",data:S}],D=t.runWebGPUProgram(E,[n],n.dtype,R);k=le({inputs:{x:D},backend:t,attrs:{shape:f}}),t.disposeData(D.dataId)}return k}var r4={kernelName:Os,backendName:\"webgpu\",kernelFunc:eme};function tme(r){let{inputs:e,backend:t,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:l,dataSplits:c}=e,m=t.readSync(l.dataId),d=t.readSync(c.dataId),[f,h]=aW(m,d,n,s,a,i,p,u);return[t.makeTensorInfo([f.length],\"string\",f),t.makeTensorInfo(c.shape,\"int32\",h)]}var o4={kernelName:Na,backendName:\"webgpu\",kernelFunc:tme};var rme=tt({opType:fe.SUB,cpuKernelImpl:iW,supportsComplex:!0}),n4={kernelName:Oo,backendName:\"webgpu\",kernelFunc:rme};var ome=ye({opType:Z.TAN}),s4={kernelName:Ms,backendName:\"webgpu\",kernelFunc:ome};var nme=ye({opType:Z.TANH}),a4={kernelName:Ls,backendName:\"webgpu\",kernelFunc:nme};function sme(r){let{inputs:e,backend:t,attrs:o}=r,{tensor:n,indices:s,updates:a}=e,{}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(a,s,n.shape),m=[c/u,u];if(c===0)return t.makeTensorInfo(n.shape,s.dtype);let d=[],f=le({inputs:{x:s},backend:t,attrs:{shape:[p,i]}});d.push(f);let h=le({inputs:{x:a},backend:t,attrs:{shape:[p,u]}});d.push(h);let g=le({inputs:{x:n},backend:t,attrs:{shape:m}});d.push(g);let x=$m({inputs:{x:g},backend:t,attrs:{reps:Array(m.length).fill(1)}}),b=new qa([p,u],i,f.shape.length,h.shape.length,l,m,n.dtype,!1),w=y.sizeFromShape([p,u]),S=[{type:\"int32\",data:[i]},{type:\"int32\",data:l},{type:\"int32\",data:[w]}],k=t.runWebGPUProgram(b,[h,f],g.dtype,S,x);d.push(k);let T=le({inputs:{x:k},backend:t,attrs:{shape:n.shape}});return d.forEach(E=>t.disposeData(E.dataId)),T}var i4={kernelName:ks,backendName:\"webgpu\",kernelFunc:sme};var Ey=class{constructor(e){this.variableNames=[\"x\",\"indices\"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`inputSize : i32, firstPass : i32, negativeInf : f32,\n dir : i32, inc : i32,`,this.shaderKey=\"swap\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let outC = getCoordsFromIndex(index);\n let batch = outC[0];\n let elemIdx = outC[1];\n // We compare elements pair-wise within a group of size 2 * inc.\n // The comparing rule for each group alternates between ascending\n // and descending. Within each group, we compare each pair at\n // positions i and i+inc. To decide whether an element at position i\n // is x0 or x1, we mod it by 2 * inc, if the result is smaller than\n // inc, it is in the first half of the group, we denote it as x0,\n // otherwise we denote it as x1.\n // For example, as shown in the Bitonic top K paper referenced\n // above, Figure5(a) shows that element[1] is in the second half of\n // the group when group size is 2, but it is in the first half of\n // the group when group size is 4.\n let isFirstInPair = elemIdx % (2 * uniforms.inc) < uniforms.inc;\n var i = 0;\n if (isFirstInPair) {\n i = elemIdx;\n } else {\n i = elemIdx - uniforms.inc;\n }\n\n var i0 = 0;\n if (uniforms.firstPass == 1) {\n i0 = i;\n } else {\n i0 = i32(getIndices(batch, i));\n }\n\n var i1 = 0;\n if (uniforms.firstPass == 1) {\n i1 = i + uniforms.inc;\n } else {\n i1 = i32(getIndices(batch, i + uniforms.inc));\n }\n\n var x0 = f32(0.0);\n var x1 = f32(0.0);\n if (i0 < uniforms.inputSize) {\n x0 = getX(batch, i0);\n } else {\n x0 = uniforms.negativeInf;\n }\n if (i1 < uniforms.inputSize) {\n x1 = getX(batch, i1);\n } else {\n x1 = uniforms.negativeInf;\n }\n\n let reverse = elemIdx % (2 * uniforms.dir) >= uniforms.dir;\n let isGreater = x0 > x1 || (x0 == x1 && i1 > i0);\n if (reverse == isGreater) {\n // Elements in opposite order of direction\n let iTemp = i0;\n i0 = i1;\n i1 = iTemp;\n }\n if (isFirstInPair) {\n setOutputAtIndex(index, f32(i0));\n } else {\n setOutputAtIndex(index, f32(i1));\n }\n }\n }\n `}},$y=class{constructor(e){this.variableNames=[\"x\",\"indices\"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=\"inputSize : i32, firstPass : i32, k : i32,\",this.shaderKey=\"merge\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let outC = getCoordsFromIndex(index);\n let batch = outC[0];\n let elemIdx = outC[1];\n // The output size is half of the previous size.\n // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _\n // (k=4), we only need to output the indices at positions |, the\n // indices at positions _ can be thrown away, see Figure5(b) After\n // Phase 2 (Merge phase) in the Bitonic Top K paper referenced\n // above.\n // For example, the paper shows we only need to output the orange\n // bars. The output sequence should look like this | | | | | | | |.\n // Because the sequence is halved, to map the output index back to\n // the previous sequence to find the corresponding value, we need\n // to double the index. When we double the index, we basically\n // interpolate a position, so 2i looks like\n // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k\n // position of each 2k positions by - elemIdx % k. E.g. for output\n // at index 4,5,6,7, we want to get the corresponding element at\n // original index 8,9,10,11, for output at index 8,9,10,11,\n // we want to get the corresponding element at original index\n // 16,17,18,19, so on and so forth.\n\n var i = 0;\n if (elemIdx < uniforms.k) {\n i = elemIdx;\n } else {\n i = elemIdx * 2 - elemIdx % uniforms.k;\n }\n var i0 = 0;\n if (uniforms.firstPass == 1) {\n i0 = i;\n } else {\n i0 = i32(getIndices(batch, i));\n }\n var i1 = 0;\n if (uniforms.firstPass == 1) {\n i1 = i + uniforms.k;\n } else {\n i1 = i32(getIndices(batch, i + uniforms.k));\n }\n\n let x0 = getX(batch, i0);\n var x1 = f32(0.0);\n if (i1 < uniforms.inputSize) {\n x1 = getX(batch, i1);\n } else {\n x1 = x0;\n }\n\n if (x0 >= x1) {\n setOutputAtIndex(index, f32(i0));\n } else {\n setOutputAtIndex(index, f32(i1));\n }\n }\n }\n `}};function pc(r,e){e!==null&&r.disposeData(e.dataId)}function u4(r){let e=1;for(;ef===null?[c,c]:[c,f],g=(k,T,E)=>{let R=h(),D=new Ey(E),O=[{type:\"int32\",data:[p]},{type:\"int32\",data:[f===null?1:0]},{type:\"float32\",data:[Number.NEGATIVE_INFINITY]},{type:\"int32\",data:[k]},{type:\"int32\",data:[T]}],M=f;f=t.runWebGPUProgram(D,R,\"int32\",O),pc(t,M)};for(let k=1;k=1;E/=2)g(T,E,[l,d])}for(let k=d;k>m;k/=2){let T=h(),E=new $y([l,k/2]),D=[{type:\"int32\",data:[p]},{type:\"int32\",data:[f===null?1:0]},{type:\"int32\",data:[m]}],F=f;f=t.runWebGPUProgram(E,T,\"int32\",D),pc(t,F);let O=m/2,M=O*2;for(let L=O;L>=1;L/=2)g(M,L,f.shape)}let x=f;f=ea({inputs:{x:f},backend:t,attrs:{begin:0,size:[l,s]}}),pc(t,x);let b=Xv({inputs:{x:c,indices:f},backend:t,attrs:{axis:1,batchDims:1}});pc(t,c);let w=i.slice(0,-1);w.push(s),x=f,f=le({inputs:{x:f},attrs:{shape:w},backend:t}),pc(t,x);let S=b;return b=le({inputs:{x:b},attrs:{shape:w},backend:t}),pc(t,S),[b,f]}var p4={kernelName:Bs,backendName:\"webgpu\",kernelFunc:ame};var Ry=class{constructor(e){this.variableNames=[\"Image\",\"Transforms\"],this.uniforms=\"interpolationModeId : i32, fillModeId : i32, fillValue : f32,\",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=\"transform\"}getUserCode(){return`\n fn mapCoord(outCoord : f32, len : f32) -> f32{\n var inCoord = outCoord;\n if(uniforms.fillModeId == 2) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz2 = 2.0 * len;\n if (inCoord < sz2) {\n inCoord = sz2 * f32(i32(f32(-inCoord / sz2))) +\n inCoord;\n }\n if (inCoord < -len) {\n inCoord = inCoord + sz2;\n } else {\n inCoord = -inCoord - 1.0;\n }\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz2 = 2.0 * len;\n inCoord = inCoord - sz2 * f32(i32(f32(inCoord / sz2)));\n if (inCoord >= len) {\n inCoord = sz2 - inCoord - 1.0;\n }\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (uniforms.fillModeId == 3) {\n if (inCoord < 0.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz = len - 1.0;\n inCoord = inCoord + len * (f32(i32(f32(-inCoord / sz))) + 1.0);\n }\n } else if (inCoord > len - 1.0) {\n if (len <= 1.0) {\n inCoord = 0.0;\n } else {\n let sz = len - 1.0;\n inCoord = inCoord - len * f32(i32(f32(inCoord / sz)));\n }\n }\n return clamp(inCoord, 0.0, len - 1.0);\n } else if (uniforms.fillModeId == 4) {\n return clamp(outCoord, 0.0, len - 1.0);\n }\n return outCoord;\n }\n fn readWithFillValue(batch : i32, coordY : i32, coordX : i32,\n channel : i32) -> f32 {\n var outputValue : f32;\n if (0 <= coordY && coordY < uniforms.imageShape[1] && 0 <= coordX && coordX < uniforms.imageShape[2]) {\n outputValue = getImage(batch, coordY, coordX, channel);\n } else {\n outputValue = uniforms.fillValue;\n }\n return outputValue;\n }\n\n ${G(\"index\")} {\n if (index < uniforms.size) {\n let coords = getCoordsFromIndex(index);\n var outputValue : f32;\n let batch = coords[0];\n let x = coords[2];\n let y = coords[1];\n let channel = coords[3];\n let xf = f32(x);\n let yf = f32(y);\n let a1 = getTransforms(batch, 0);\n let a2 = getTransforms(batch, 1);\n let a3 = getTransforms(batch, 2);\n let b1 = getTransforms(batch, 3);\n let b2 = getTransforms(batch, 4);\n let b3 = getTransforms(batch, 5);\n let c1 = getTransforms(batch, 6);\n let c2 = getTransforms(batch, 7);\n let projection = c1 * xf + c2 * yf + 1.0;\n if (projection == 0.0) {\n outputValue = uniforms.fillValue;\n } else {\n let inX = (a1 * xf + a2 * yf + a3) / projection;\n let inY = (b1 * xf + b2 * yf + b3) / projection;\n let mapX = mapCoord(inX, f32(uniforms.imageShape[2]));\n let mapY = mapCoord(inY, f32(uniforms.imageShape[1]));\n\n if (uniforms.interpolationModeId == 1) {\n let coordY = i32(round(mapY));\n let coordX = i32(round(mapX));\n outputValue = readWithFillValue(batch, coordY, coordX,\n channel);\n } else {\n let yFloor = floor(mapY);\n let xFloor = floor(mapX);\n let yCeil = yFloor + 1.0;\n let xCeil = xFloor + 1.0;\n let valueYFloor = (xCeil - mapX) *\n readWithFillValue(batch, i32(yFloor), i32(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, i32(yFloor), i32(xCeil), channel);\n let valueYCeil = (xCeil - mapX) *\n readWithFillValue(batch, i32(yCeil), i32(xFloor), channel) +\n (mapX - xFloor) *\n readWithFillValue(batch, i32(yCeil), i32(xCeil), channel);\n outputValue = (yCeil - mapY) * valueYFloor +\n (mapY - yFloor) * valueYCeil;\n }\n }\n setOutputAtIndex(index, outputValue);\n }\n }\n `}};function ime(r){let{inputs:e,backend:t,attrs:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=new Ry(g),b=a===\"nearest\"?1:2,w;switch(i){case\"constant\":w=1;break;case\"reflect\":w=2;break;case\"wrap\":w=3;break;case\"nearest\":w=4;break;default:w=1;break}let S=[{type:\"int32\",data:[b]},{type:\"int32\",data:[w]},{type:\"float32\",data:[p]}];return t.runWebGPUProgram(x,[n,s],\"float32\",S)}var l4={kernelName:zs,backendName:\"webgpu\",kernelFunc:ime};function ume(r){let{inputs:e,backend:t,attrs:o}=r,{value:n}=e,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),l=0;for(let h=0;ht.disposeData(h.dataId)),f}var c4={kernelName:Ta,backendName:\"webgpu\",kernelFunc:ume};var Dy=class{constructor(e,t,o){if(this.outputShape=[],this.variableNames=[\"x\",\"segmentIds\"],this.uniforms=\"numSegments : i32, xSize: i32,\",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t,this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),o!==\"float32\"&&o!==\"int32\")throw new Error(`UnsortedSegmentSum only supports float32 and int32\n types, does not support ${o} type.`);this.type=o,this.shaderKey=\"unsortedSegmentSum\"}getUserCode(){return`\n ${G(\"index\")} {\n if (index < uniforms.xSize) {\n let coords = getXCoordsFromIndex(index);\n let b = coords[0];\n let inCol = coords[1];\n\n let segmentId = i32(getSegmentIds(inCol));\n if (segmentId >= 0) {\n let flatIndex = b * uniforms.numSegments + segmentId % uniforms.numSegments;\n let value = getX(b, inCol);\n\n ${oo(\"&result[flatIndex]\",\"value\",this.type)}\n }\n }\n }\n `}};function pme(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,segmentIds:s}=e,{numSegments:a}=o,i=n.shape.length,p=[],u=0,l=C.getAxesPermutation([u],i),c=n;l!=null&&(c=Cr({inputs:{x:n},backend:t,attrs:{perm:l}}),p.push(c),u=C.getInnerMostAxes(1,i)[0]);let m=C.segment_util.computeOutShape(c.shape,u,a),d=y.sizeFromShape([c.shape[u]]),f=le({inputs:{x:c},backend:t,attrs:{shape:[-1,d]}});p.push(f);let h=n.dtype,g=[f.shape[0],a],x=Nt({backend:t,attrs:{shape:g,value:0,dtype:h}}),b=new Dy(f.shape,g,h),w=[{type:\"int32\",data:[a]},{type:\"int32\",data:[y.sizeFromShape(f.shape)]}],S=t.runWebGPUProgram(b,[f,s],h,w,x),k=le({inputs:{x:S},backend:t,attrs:{shape:m}});p.push(S);let T=k;if(l!=null){p.push(k);let E=C.getUndoAxesPermutation(l);T=Cr({inputs:{x:T},backend:t,attrs:{perm:E}})}return p.forEach(E=>t.disposeData(E.dataId)),T}var m4={kernelName:su,backendName:\"webgpu\",kernelFunc:pme};var lme=[jz,cW,mW,dW,fW,hW,xW,yW,bW,CW,wW,SW,IW,vW,kW,_W,EW,$W,RW,DW,FW,PW,OW,zW,VW,WW,Yz,GW,KW,qW,jW,XW,YW,QW,ZW,JW,eU,tU,nU,sU,aU,iU,pU,lU,uU,cU,mU,dU,fU,hU,yU,bU,CU,wU,SU,IU,vU,kU,NU,Kz,TU,$U,_U,EU,RU,DU,AU,FU,PU,OU,MU,Xz,LU,HW,BU,zU,VU,WU,UU,GU,HU,qU,KU,jU,XU,YU,ZU,JU,NW,eG,tG,nG,rG,oG,sG,TW,aG,iG,uG,pG,cG,gU,mG,dG,fG,MW,hG,yG,bG,CG,wG,SG,IG,vG,LW,kG,NG,TG,_G,qz,EG,$G,RG,DG,AG,FG,PG,OG,MG,LG,BG,zG,VG,WG,UG,GG,AW,t4,r4,o4,lG,HG,KG,qG,jG,YG,QG,ZG,JG,e4,n4,xU,s4,a4,i4,XG,p4,l4,gW,c4,m4,gG];for(let r of lme)li(r);var d4=\"4.17.0\",cme=\"4.17.0\",mme=\"4.17.0\",dme=\"4.17.0\",fme=\"4.17.0\",hme=\"4.14.0\",gme={tfjs:d4,\"tfjs-core\":d4,\"tfjs-converter\":cme,\"tfjs-backend-cpu\":mme,\"tfjs-backend-webgl\":dme,\"tfjs-backend-wasm\":fme,\"tfjs-backend-webgpu\":hme};var qtr=void 0;export{fn as Abs,hn as Acos,gn as Acosh,sp as AdadeltaOptimizer,ap as AdagradOptimizer,ip as AdamOptimizer,up as AdamaxOptimizer,Rr as Add,xn as AddN,yn as All,bn as Any,na as ArgMax,sa as ArgMin,Cn as Asin,wn as Asinh,Sn as Atan,vn as Atan2,In as Atanh,kn as AvgPool,aa as AvgPool3D,Vi as AvgPool3DGrad,zi as AvgPoolGrad,gm as BackendWasm,Nn as BatchMatMul,ia as BatchToSpaceND,Tn as Bincount,_n as BitwiseAnd,ua as BroadcastArgs,Sme as BroadcastTo,ho as Cast,go as Ceil,Go as ClipByValue,ei as Complex,Wi as ComplexAbs,pa as Concat,En as Conv2D,Ui as Conv2DBackpropFilter,$n as Conv2DBackpropInput,Rn as Conv3D,ti as Conv3DBackpropFilterV2,Dn as Conv3DBackpropInputV2,An as Cos,Fn as Cosh,Mn as CropAndResize,Pn as Cumprod,On as Cumsum,mn as DataStorage,la as DenseBincount,Ln as DepthToSpace,Bn as DepthwiseConv2dNative,Gi as DepthwiseConv2dNativeBackpropFilter,Hi as DepthwiseConv2dNativeBackpropInput,ca as Diag,zn as Dilation2D,qi as Dilation2DBackpropFilter,Ki as Dilation2DBackpropInput,Mu as Draw,xw as ENV,ji as Einsum,Wn as Elu,ri as EluGrad,Cc as Environment,xo as Equal,Un as Erf,yo as Exp,ma as ExpandDims,bo as Expm1,Xi as FFT,da as Fill,Gn as FlipLeftRight,Co as Floor,wo as FloorDiv,Lu as FromPixels,Hn as FusedBatchNorm,jo as FusedConv2D,Xo as FusedDepthwiseConv2D,kp as GPGPUContext,Kn as GatherNd,fa as GatherV2,Kc as GraphModel,So as Greater,Io as GreaterEqual,Yi as IFFT,vo as Identity,Qi as Imag,qn as IsFinite,jn as IsInf,Xn as IsNan,mo as KernelBackend,rs as LRN,oi as LRNGrad,Yn as LeakyRelu,ko as Less,No as LessEqual,Qn as LinSpace,To as Log,Zn as Log1p,Ime as LogSoftmax,Jn as LogicalAnd,es as LogicalNot,ts as LogicalOr,gk as LogicalXor,vme as LowerBound,Il as MathBackendCPU,Ul as MathBackendWebGL,kme as MatrixBandPart,os as Max,ns as MaxPool,ha as MaxPool3D,Ji as MaxPool3DGrad,Zi as MaxPoolGrad,ga as MaxPoolWithArgmax,_o as Maximum,ss as Mean,as as Min,Eo as Minimum,is as MirrorPad,us as Mod,pp as MomentumOptimizer,ps as Multinomial,$o as Multiply,ls as Neg,cs as NonMaxSuppressionV3,ni as NonMaxSuppressionV4,ms as NonMaxSuppressionV5,Ro as NotEqual,Bw as OP_SCOPE_SUFFIX,ds as OneHot,xa as OnesLike,_r as Optimizer,Vc as OptimizerConstructors,ya as Pack,fs as PadV2,Nme as Pool,hs as Pow,gs as Prelu,Ho as Prod,lp as RMSPropOptimizer,Qp as RaggedGather,Zp as RaggedRange,Jp as RaggedTensorToTensor,ba as Range,Ew as Rank,si as Real,Vn as RealDiv,xs as Reciprocal,Dt as Reduction,ys as Relu,ws as Relu6,Ca as Reshape,Cs as ResizeBilinear,ii as ResizeBilinearGrad,bs as ResizeNearestNeighbor,ai as ResizeNearestNeighborGrad,Ss as Reverse,Vs as RotateWithOffset,Is as Round,Do as Rsqrt,wi as SGDOptimizer,vs as ScatterNd,Ns as SearchSorted,wa as Select,Ts as Selu,Ao as Sigmoid,Rs as Sign,Es as Sin,$s as Sinh,_s as Slice,Fs as Softmax,Ds as Softplus,Sa as SpaceToBatchND,eu as SparseFillEmptyRows,ui as SparseReshape,va as SparseSegmentMean,ka as SparseSegmentSum,Ps as SparseToDense,Ia as SplitV,Fo as Sqrt,tu as Square,Po as SquaredDifference,pi as StaticRegexReplace,Ko as Step,Os as StridedSlice,Na as StringNGrams,ru as StringSplit,ou as StringToHashBucketFast,Oo as Sub,As as Sum,Ms as Tan,Ls as Tanh,dt as Tensor,Ge as TensorBuffer,ks as TensorScatterUpdate,Mo as Tile,Bs as TopK,zs as Transform,Kr as Transpose,nu as Unique,Ta as Unpack,su as UnsortedSegmentSum,Tme as UpperBound,ci as Variable,Jl as WebGPUBackend,_a as ZerosLike,qo as _FusedMatMul,er as abs,g1 as acos,x1 as acosh,Ce as add,y1 as addN,b1 as all,C1 as any,w1 as argMax,S1 as argMin,I1 as asin,v1 as asinh,k1 as atan,N1 as atan2,T1 as atanh,Id as avgPool,$1 as avgPool3d,Hk as backend,C as backend_util,R1 as basicLSTMCell,mu as batchNorm,A1 as batchNorm2d,F1 as batchNorm3d,P1 as batchNorm4d,vd as batchToSpaceND,kd as bincount,O1 as bitwiseAnd,oX as booleanMaskAsync,M1 as broadcastArgs,Oa as broadcastTo,kr as broadcast_util,XT as browser,ie as buffer,Ue as cast,L1 as ceil,B1 as clipByValue,Xr as clone,Ar as complex,bt as concat,z1 as concat1d,V1 as concat2d,W1 as concat3d,U1 as concat4d,G1 as conv1d,du as conv2d,H1 as conv2dTranspose,K1 as conv3d,j1 as conv3dTranspose,Pme as copyRegisteredKernels,X1 as cos,Y1 as cosh,Mc as cosineWindow,Q1 as cumprod,Z1 as cumsum,Nr as customGrad,J1 as denseBincount,zw as deprecationWarn,e2 as depthToSpace,cl as depthwiseConv2d,aY as deregisterOp,uu as device_util,t2 as diag,r2 as dilation2d,Kde as disableDeprecationWarnings,Lt as dispose,qde as disposeVariables,Xe as div,n2 as divNoNan,s2 as dot,hX as dropout,fu as einsum,Ed as elu,Hde as enableDebugMode,Gde as enableProdMode,cS as enclosingPowerOfTwo,cr as engine,a2 as ensureShape,A as env,_d as equal,i2 as erf,l2 as euclideanNorm,Jo as exp,Ks as expandDims,c2 as expm1,$d as eye,fl as fft,Ma as fill,efe as findBackend,tfe as findBackendFactory,Rd as floor,Sd as floorDiv,EA as forceHalfFloat,mS as fused,Dd as gather,dX as gatherND,xf as gather_util,Gk as getBackend,Cw as getGradient,tl as getKernel,ad as getKernelsForBackend,kie as getThreadsCount,k0 as gpgpu_util,a6 as grad,i6 as grads,ju as greater,Ad as greaterEqual,ep as ifft,gu as imag,b5 as image,xX as inTopKAsync,Si as io,tf as irfft,m2 as isFinite,d2 as isInf,f2 as isNaN,Fr as keep,Ut as kernel_impls,Fd as leakyRelu,Fc as less,ml as lessEqual,C5 as linalg,h2 as linspace,r7 as loadGraphModel,o7 as loadGraphModelSync,g2 as localResponseNormalization,yi as log,Pd as log1p,x2 as logSigmoid,y2 as logSoftmax,Ld as logSumExp,Xu as logicalAnd,Bd as logicalNot,zd as logicalOr,b2 as logicalXor,w5 as losses,C2 as lowerBound,Je as matMul,HT as math,La as max,Wd as maxPool,w2 as maxPool3d,S2 as maxPoolWithArgmax,Ud as maximum,Yu as mean,jde as memory,I2 as meshgrid,Ac as min,Qu as minimum,v2 as mirrorPad,k2 as mod,N2 as moments,aX as movingAverage,se as mul,T2 as multiRNNCell,_2 as multinomial,mr as neg,IS as nextFrame,qtr as node,qu as norm,Gd as notEqual,Oc as oneHot,Ba as ones,E2 as onesLike,N as op,$2 as outerProduct,za as pad,R2 as pad1d,D2 as pad2d,A2 as pad3d,F2 as pad4d,P2 as pool,xi as pow,Kd as prelu,wd as print,O2 as prod,Xde as profile,M2 as raggedGather,L2 as raggedRange,B2 as raggedTensorToTensor,z2 as rand,iN as randomGamma,Zd as randomNormal,uN as randomStandardNormal,dl as randomUniform,pN as randomUniformInt,xu as range,Zde as ready,bi as real,lN as reciprocal,pu as registerBackend,Dme as registerGradient,li as registerKernel,sY as registerOp,yu as relu,Jd as relu6,Jde as removeBackend,W as reshape,Bo as reverse,cN as reverse1d,mN as reverse2d,dN as reverse3d,fN as reverse4d,hl as rfft,ef as round,hN as rsqrt,ke as scalar,uX as scatterND,Cu as scatter_util,Pc as searchSorted,gN as selu,xN as separableConv2d,AT as serialization,Qde as setBackend,rfe as setPlatform,vie as setThreadsCount,Sie as setWasmPath,Iie as setWasmPaths,BI as setWebGLContext,yN as setdiff1dAsync,Xf as shared,Pa as sigmoid,bN as sign,y5 as signal,CN as sin,wN as sinh,Ye as slice,SN as slice1d,IN as slice2d,vN as slice3d,kN as slice4d,nt as slice_util,NN as softmax,Md as softplus,Hd as spaceToBatchND,S5 as sparse,cX as sparseToDense,x5 as spectral,Ci as split,Pr as sqrt,tr as square,rf as squaredDifference,gl as squeeze,Tr as stack,of as step,TN as stridedSlice,I5 as string,Te as sub,ot as sum,mi as sumOutType,_N as tan,Dc as tanh,pr as tensor,rr as tensor1d,bu as tensor2d,nf as tensor3d,EN as tensor4d,$N as tensor5d,RN as tensor6d,AN as tensorScatterUpdate,Vk as tensor_util,aN as test_util,De as tidy,hu as tile,Yde as time,FN as topk,cHe as train,yl as transpose,PN as truncatedNormal,ON as unique,Fme as unregisterGradient,Ame as unregisterKernel,MN as unsortedSegmentSum,zo as unstack,pt as upcastType,LN as upperBound,y as util,u6 as valueAndGrad,p6 as valueAndGrads,BN as variable,eS as variableGrads,gme as version,s7 as version_converter,t8 as version_core,M7 as version_cpu,Nie as version_wasm,DJ as version_webgl,sut as webgl,Fl as webgl_util,cv as webgpu_util,Lo as where,af as whereAsync,Yr as zeros,Kt as zerosLike};\n", "import type { Config } from '../exports';\n\n/**\n * Simple helper functions used accross codebase\n */\n\n// helper function: wrapper around console output\nexport function log(...msg): void {\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 if (msg) console.log(ts, 'Human:', ...msg); // eslint-disable-line no-console\n}\n\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(`modelpath error: expecting json file: ${path}`);\n return path;\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: checks current config validity\nexport function validate(defaults: Partial, config: Partial, parent = 'config', msgs: { reason: string, where: string, expected?: string }[] = []) {\n for (const key of Object.keys(config)) {\n if (typeof config[key] === 'object') {\n validate(defaults[key], config[key], key, msgs);\n } else {\n const defined = defaults && (typeof defaults[key] !== 'undefined');\n if (!defined) msgs.push({ reason: 'unknown property', where: `${parent}.${key} = ${config[key]}` });\n const same = defaults && typeof defaults[key] === typeof config[key];\n if (defined && !same) msgs.push({ reason: 'property type mismatch', where: `${parent}.${key} = ${config[key]}`, expected: typeof defaults[key] });\n }\n // ok = ok && defined && same;\n }\n if (config.debug && parent === 'config' && msgs.length > 0) log('invalid configuration', msgs);\n return msgs;\n}\n\n// helper function: perform deep merge of multiple objects so it allows full inheritance 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\n// helper function: return min and max from input array\nexport const minmax = (data: number[]) => data.reduce((acc: number[], val) => {\n acc[0] = (acc[0] === undefined || val < acc[0]) ? val : acc[0];\n acc[1] = (acc[1] === undefined || val > acc[1]) ? val : acc[1];\n return acc;\n}, []);\n\n// helper function: async wait\nexport async function wait(time: number) {\n const waiting = new Promise((resolve) => { setTimeout(() => resolve(true), time); });\n await waiting;\n}\n", "/* eslint-disable no-multi-spaces */\n\n/** Possible TensorFlow backends */\nexport type BackendEnum = '' | 'cpu' | 'wasm' | 'webgl' | 'humangl' | 'tensorflow' | 'webgpu';\n\n/** Possible values for `human.warmup` */\nexport type WarmupEnum = '' | 'none' | 'face' | 'full' | 'body';\n\n/** Possible segmentation model behavior */\nexport type SegmentationEnum = 'default' | 'alpha' | 'foreground' | 'state'\n\n/** Generic config type inherited by all module types */\nexport interface GenericConfig {\n /** is module enabled? */\n enabled: boolean,\n /** path to model json file (relative to `modelBasePath` */\n modelPath: string,\n /** how many max frames to go without re-running model if cached results are acceptable\n * for two-phase models such as face and hand caching applies to bounding boxes detection only */\n skipFrames: number,\n /** how many max milliseconds to go without re-running model if cached results are acceptable\n * for two-phase models such as face and hand caching applies to bounding boxes detection only */\n skipTime: number,\n}\n\n/** Detector part of face configuration */\nexport interface FaceDetectorConfig extends GenericConfig {\n /** is face rotation correction performed after detecting face?\n * used to correctly analyze faces under high angles\n */\n rotation: boolean,\n /** maximum number of detected faces */\n maxDetected: number,\n /** minimum confidence for a detected face before results are discarded */\n minConfidence: number,\n /** minimum size in pixels of a detected face box before resutls are discared */\n minSize: number,\n /** minimum overlap between two detected faces before one is discarded */\n iouThreshold: number,\n /** how much should face box be enlarged over the min/max facial coordinates */\n scale: number,\n /** should child models perform on masked image of a face */\n mask: boolean,\n /** should face detection return processed and cropped face tensor that can with an external model for addtional processing?\n * if enabled it must be manually deallocated to avoid memory leak */\n return: boolean,\n}\n\n/** Mesh part of face configuration */\nexport interface FaceMeshConfig extends GenericConfig {\n /** Keep detected faces that cannot be verified using facemesh */\n keepInvalid: boolean\n}\n\n/** Iris part of face configuration */\nexport interface FaceIrisConfig extends GenericConfig {\n /** how much should iris box be enlarged over the min/max iris coordinates */\n scale: number,\n}\n\n/** Attention part of face configuration */\nexport interface FaceAttentionConfig extends GenericConfig {}\n\n/** Description or face embedding part of face configuration\n * - also used by age and gender detection\n */\nexport interface FaceDescriptionConfig extends GenericConfig {\n /** minimum confidence for a detected face before results are discarded */\n minConfidence: number,\n}\n\n/** Emotion part of face configuration */\nexport interface FaceEmotionConfig extends GenericConfig {\n /** minimum confidence for a detected face before results are discarded */\n minConfidence: number,\n}\n\n/** Anti-spoofing part of face configuration */\nexport interface FaceAntiSpoofConfig extends GenericConfig {}\n\n/** Liveness part of face configuration */\nexport interface FaceLivenessConfig extends GenericConfig {}\n\n/** Gear part of face configuration */\nexport interface FaceGearConfig extends GenericConfig {\n /** minimum confidence for a detected race before results are discarded */\n minConfidence: number,\n}\n\n/** Configures all face-specific options: face detection, mesh analysis, age, gender, emotion detection and face description */\nexport interface FaceConfig extends GenericConfig {\n detector: Partial,\n mesh: Partial,\n attention: Partial,\n iris: Partial,\n description: Partial,\n emotion: Partial,\n antispoof: Partial,\n liveness: Partial,\n gear: Partial,\n}\n\n/** Configures all body detection specific options */\nexport interface BodyConfig extends GenericConfig {\n /** maximum number of detected bodies */\n maxDetected: number,\n /** minimum confidence for a detected body before results are discarded */\n minConfidence: number,\n /* experimental\n /** experimental: detector used for body model before actual analysis\n detector?: {\n /** experimental: enable body detector before body landmarks\n enabled: boolean,\n /** experimental: path to optional body detector model json file\n modelPath: string,\n /** experimental: minimum confidence for a detected body before results are discarded\n minConfidence: number,\n /** experimental: minimum overlap between two detected bodies before one is discarded\n iouThreshold: number\n },\n */\n}\n\n/** Configures all hand detection specific options */\nexport interface HandConfig extends GenericConfig {\n /** should hand rotation correction be performed after hand detection? */\n rotation: boolean,\n /** minimum confidence for a detected hand before results are discarded */\n minConfidence: number,\n /** minimum overlap between two detected hands before one is discarded */\n iouThreshold: number,\n /** maximum number of detected hands */\n maxDetected: number,\n /** should hand landmarks be detected or just return detected hand box */\n landmarks: boolean,\n detector: {\n /** path to hand detector model json */\n modelPath?: string,\n },\n skeleton: {\n /** path to hand skeleton model json */\n modelPath?: string,\n },\n}\n\n/** Configures all object detection specific options */\nexport interface ObjectConfig extends GenericConfig {\n /** minimum confidence for a detected objects before results are discarded */\n minConfidence: number,\n /** minimum overlap between two detected objects before one is discarded */\n iouThreshold: number,\n /** maximum number of detected objects */\n maxDetected: number,\n}\n\n/** Configures all body segmentation module\n * removes background from input containing person\n * if segmentation is enabled it will run as preprocessing task before any other model\n * alternatively leave it disabled and use it on-demand using human.segmentation method which can\n * remove background or replace it with user-provided background\n*/\nexport interface SegmentationConfig extends GenericConfig {\n /** downsample ratio, adjust to reflect approximately how much of input is taken by body */\n ratio: number,\n /** possible rvm segmentation mode */\n mode: SegmentationEnum,\n}\n\n/** Run input through image filters before inference\n * - available only in Browser environments\n * - image filters run with near-zero latency as they are executed on the GPU using WebGL\n*/\nexport interface FilterConfig {\n /** are image filters enabled? */\n enabled: boolean,\n /** perform image histogram equalization\n * - equalization is performed on input as a whole and detected face before its passed for further analysis\n */\n equalization: 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 /** apply auto-brighness */\n autoBrightness: 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\n/** Controlls gesture detection */\nexport interface GestureConfig {\n /** is gesture detection enabled? */\n enabled: boolean,\n}\n/**\n * Configuration interface definition for **Human** library\n * Contains all configurable parameters\n * Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L262)\n */\nexport interface Config {\n /** Backend used for TFJS operations\n * valid build-in backends are:\n * - Browser: `cpu`, `wasm`, `webgl`, `humangl`, `webgpu`\n * - NodeJS: `cpu`, `wasm`, `tensorflow`\n * default: `webgl` for browser and `tensorflow` for nodejs\n */\n backend: BackendEnum,\n\n /** Path to *.wasm files if backend is set to `wasm`\n *\n * default: auto-detects to link to CDN `jsdelivr` when running in browser\n */\n wasmPath: string,\n\n /** Force WASM loader to use platform fetch\n *\n * default: false\n */\n wasmPlatformFetch: boolean,\n\n /** Print debug statements to console\n *\n * default: `true`\n */\n debug: boolean,\n\n /** Perform model loading and inference concurrently or sequentially\n *\n * default: `true`\n */\n async: 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 * - used by `webgl`, `humangl` and `webgpu` backends\n *\n * default: `full`\n */\n warmup: WarmupEnum,\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 * default: `../models/` for browsers and `file://models/` for nodejs\n */\n modelBasePath: string,\n\n /** Cache models in IndexDB on first sucessfull load\n * default: true if indexdb is available (browsers), false if its not (nodejs)\n */\n cacheModels: boolean,\n\n /** Validate kernel ops used in model during model load\n * default: true\n * any errors will be printed on console but will be treated as non-fatal\n */\n validateModels: boolean,\n\n /** Cache sensitivity\n * - values 0..1 where 0.01 means reset cache if input changed more than 1%\n * - set to 0 to disable caching\n *\n * default: 0.7\n */\n cacheSensitivity: number;\n\n /** Explicit flags passed to initialize TFJS */\n flags: Record,\n\n /** Software Kernels\n * Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend\n */\n softwareKernels: boolean,\n\n /** Perform immediate garbage collection on deallocated tensors instead of caching them */\n deallocate: boolean;\n\n /** Internal Variable */\n skipAllowed: boolean;\n\n /** Filter config {@link FilterConfig} */\n filter: Partial,\n\n /** Gesture config {@link GestureConfig} */\n gesture: Partial;\n\n /** Face config {@link FaceConfig} */\n face: Partial,\n\n /** Body config {@link BodyConfig} */\n body: Partial,\n\n /** Hand config {@link HandConfig} */\n hand: Partial,\n\n /** Object config {@link ObjectConfig} */\n object: Partial,\n\n /** Segmentation config {@link SegmentationConfig} */\n segmentation: Partial,\n}\n\n/** - [See all default Config values...](https://github.com/vladmandic/human/blob/main/src/config.ts#L262) */\nconst config: Config = {\n backend: '',\n modelBasePath: '',\n cacheModels: true,\n validateModels: true,\n wasmPath: '',\n wasmPlatformFetch: false,\n debug: false,\n async: true,\n warmup: 'full',\n cacheSensitivity: 0.70,\n skipAllowed: false,\n deallocate: false,\n flags: {},\n softwareKernels: false,\n filter: {\n enabled: true,\n equalization: false,\n width: 0,\n height: 0,\n flip: false,\n return: true,\n autoBrightness: true,\n brightness: 0,\n contrast: 0,\n sharpness: 0,\n blur: 0,\n saturation: 0,\n hue: 0,\n negative: false,\n sepia: false,\n vintage: false,\n kodachrome: false,\n technicolor: false,\n polaroid: false,\n pixelate: 0,\n },\n gesture: {\n enabled: true,\n },\n face: {\n enabled: true,\n detector: {\n modelPath: 'blazeface.json',\n rotation: false,\n maxDetected: 1,\n skipFrames: 99,\n skipTime: 2500,\n minConfidence: 0.2,\n minSize: 0,\n iouThreshold: 0.1,\n scale: 1.4,\n mask: false,\n return: false,\n },\n mesh: {\n enabled: true,\n modelPath: 'facemesh.json',\n keepInvalid: false,\n },\n attention: {\n enabled: false,\n modelPath: 'facemesh-attention.json',\n },\n iris: {\n enabled: true,\n scale: 2.3,\n modelPath: 'iris.json',\n },\n emotion: {\n enabled: true,\n minConfidence: 0.1,\n skipFrames: 99,\n skipTime: 1500,\n modelPath: 'emotion.json',\n },\n description: {\n enabled: true,\n modelPath: 'faceres.json',\n skipFrames: 99,\n skipTime: 3000,\n minConfidence: 0.1,\n },\n antispoof: {\n enabled: false,\n skipFrames: 99,\n skipTime: 4000,\n modelPath: 'antispoof.json',\n },\n liveness: {\n enabled: false,\n skipFrames: 99,\n skipTime: 4000,\n modelPath: 'liveness.json',\n },\n },\n body: {\n enabled: true,\n modelPath: 'movenet-lightning.json',\n maxDetected: -1,\n minConfidence: 0.3,\n skipFrames: 1,\n skipTime: 200,\n },\n hand: {\n enabled: true,\n rotation: true,\n skipFrames: 99,\n skipTime: 1000,\n minConfidence: 0.50,\n iouThreshold: 0.2,\n maxDetected: -1,\n landmarks: true,\n detector: {\n modelPath: 'handtrack.json',\n },\n skeleton: {\n modelPath: 'handlandmark-lite.json',\n },\n },\n object: {\n enabled: false,\n modelPath: 'centernet.json',\n minConfidence: 0.2,\n iouThreshold: 0.4,\n maxDetected: 10,\n skipFrames: 99,\n skipTime: 2000,\n },\n segmentation: {\n enabled: false,\n modelPath: 'rvm.json',\n ratio: 0.5,\n mode: 'default',\n },\n};\n\nexport { config as defaults };\n", "export const vertexIdentity = `\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`;\n\nexport const fragmentIdentity = `\n precision highp float;\n varying vec2 vUv;\n uniform sampler2D texture;\n void main(void) {\n gl_FragColor = texture2D(texture, vUv);\n }\n`;\n\nexport const colorMatrixWithAlpha = `\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`;\n\nexport const colorMatrixWithoutAlpha = `\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`;\n\nexport const pixelate = `\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`;\n\nexport const blur = `\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`;\n\nexport const convolution = `\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`;\n", "/**\n * Image Filters in WebGL algoritm implementation\n * Based on: [WebGLImageFilter](https://github.com/phoboslab/WebGLImageFilter)\n */\n\n/* eslint-disable func-names */\n\nimport * as shaders from './imagefxshaders';\nimport { canvas } from './image';\nimport { log } from '../util/util';\n\nconst collect = (source, prefix: string, 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\nclass GLProgram {\n uniform = {};\n attribute = {};\n gl: WebGLRenderingContext;\n id: WebGLProgram;\n\n constructor(gl, vertexSource, fragmentSource) {\n this.gl = gl;\n const vertexShader = this.compile(vertexSource, this.gl.VERTEX_SHADER);\n const fragmentShader = this.compile(fragmentSource, this.gl.FRAGMENT_SHADER);\n this.id = this.gl.createProgram() as WebGLProgram;\n if (!vertexShader || !fragmentShader) return;\n if (!this.id) {\n log('filter: could not create webgl program');\n return;\n }\n this.gl.attachShader(this.id, vertexShader);\n this.gl.attachShader(this.id, fragmentShader);\n this.gl.linkProgram(this.id);\n if (!this.gl.getProgramParameter(this.id, this.gl.LINK_STATUS)) {\n log(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id) || 'unknown'}`);\n return;\n }\n this.gl.useProgram(this.id);\n collect(vertexSource, 'attribute', this.attribute); // Collect attributes\n for (const a in this.attribute) this.attribute[a] = this.gl.getAttribLocation(this.id, a);\n collect(vertexSource, 'uniform', this.uniform); // Collect uniforms\n collect(fragmentSource, 'uniform', this.uniform);\n for (const u in this.uniform) this.uniform[u] = this.gl.getUniformLocation(this.id, u);\n }\n\n compile = (source, type): WebGLShader | null => {\n const shader = this.gl.createShader(type);\n if (!shader) {\n log('filter: could not create shader');\n return null;\n }\n this.gl.shaderSource(shader, source);\n this.gl.compileShader(shader);\n if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {\n log(`filter: gl compile failed: ${this.gl.getShaderInfoLog(shader) || 'unknown'}`);\n return null;\n }\n return shader;\n };\n}\n\n// function that is instantiated as class so it has private this members\n/**\n * @class GLImageFilter\n * @property {function} reset reset current filter chain\n * @property {function} add add specified filter to filter chain\n * @property {function} apply execute filter chain and draw result\n * @property {function} draw just draw input to result\n */\n\nexport function GLImageFilter() {\n let drawCount = 0;\n let sourceTexture: WebGLTexture | null = null;\n let lastInChain = false;\n let currentFramebufferIndex = -1;\n let tempFramebuffers: [null, null] | [{ fbo: WebGLFramebuffer | null, texture: WebGLTexture | null }] = [null, null];\n let filterChain: Record[] = [];\n let vertexBuffer: WebGLBuffer | null = null;\n let currentProgram: GLProgram | null = null;\n const fxcanvas = canvas(100, 100) as HTMLCanvasElement;\n const shaderProgramCache = { }; // key is the shader program source, value is the compiled program\n const DRAW = { INTERMEDIATE: 1 };\n const gl = fxcanvas.getContext('webgl') as WebGLRenderingContext;\n if (!gl) {\n log('filter: cannot get webgl context');\n return;\n }\n // @ts-ignore used for sanity checks outside of imagefx\n this.gl = gl;\n\n function resize(width, height) {\n if (width === fxcanvas.width && height === fxcanvas.height) return; // Same width/height? Nothing to do here\n fxcanvas.width = width;\n fxcanvas.height = height;\n if (!vertexBuffer) { // Create the context if we don't have it yet\n const vertices = 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]); // Create the vertex buffer for the two triangles [x, y, u, v] * 6\n vertexBuffer = gl.createBuffer();\n 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, fxcanvas.width, fxcanvas.height);\n tempFramebuffers = [null, null]; // Delete old temp framebuffers\n }\n\n function createFramebufferTexture(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 function getTempFramebuffer(index): { fbo: WebGLFramebuffer | null, texture: WebGLTexture | null } {\n tempFramebuffers[index] = tempFramebuffers[index] || createFramebufferTexture(fxcanvas.width, fxcanvas.height);\n return tempFramebuffers[index] as { fbo: WebGLFramebuffer, texture: WebGLTexture };\n }\n\n function draw(flags = 0) {\n if (!currentProgram) return;\n let source: WebGLTexture | null = null;\n let target: WebGLFramebuffer | null = null;\n let flipY = false;\n if (drawCount === 0) source = sourceTexture; // First draw call - use the source texture\n else source = getTempFramebuffer(currentFramebufferIndex).texture || null; // All following draw calls use the temp buffer last drawn to\n drawCount++;\n if (lastInChain && !(flags & DRAW.INTERMEDIATE)) { // Last filter in our chain - draw directly to the WebGL Canvas. We may also have to flip the image vertically now\n target = null;\n flipY = drawCount % 2 === 0;\n } else {\n currentFramebufferIndex = (currentFramebufferIndex + 1) % 2;\n target = getTempFramebuffer(currentFramebufferIndex).fbo || null; // Intermediate draw call - get a temp buffer to draw to\n }\n gl.bindTexture(gl.TEXTURE_2D, source); // Bind the source and target and draw the two triangles\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 function compileShader(fragmentSource): GLProgram | null {\n if (shaderProgramCache[fragmentSource]) {\n currentProgram = shaderProgramCache[fragmentSource];\n gl.useProgram((currentProgram ? currentProgram.id : null) || null);\n return currentProgram;\n }\n currentProgram = new GLProgram(gl, shaders.vertexIdentity, fragmentSource);\n if (!currentProgram) {\n log('filter: could not get webgl program');\n return null;\n }\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 const filter = {\n colorMatrix: (matrix: number[]) => { // general color matrix filter\n const m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\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) // Can we ignore the alpha value? Makes things a bit faster.\n ? shaders.colorMatrixWithoutAlpha\n : shaders.colorMatrixWithAlpha;\n const program = compileShader(shader);\n if (!program) return;\n gl.uniform1fv(program.uniform['m'], m);\n draw();\n },\n\n brightness: (brightness: number) => {\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 saturation: (amount: number) => {\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 desaturate: () => {\n filter.saturation(-1);\n },\n\n contrast: (amount: number) => {\n const v = (amount || 0) + 1;\n const o = -128 * (v - 1);\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 negative: () => {\n filter.contrast(-2);\n },\n\n hue: (rotation: number) => {\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 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 desaturateLuminance: () => {\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 sepia: () => {\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 brownie: () => {\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 vintagePinhole: () => {\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 kodachrome: () => {\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 technicolor: () => {\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 polaroid: () => {\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 shiftToBGR: () => {\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 convolution: (matrix: number[]) => { // general convolution Filter\n const m = new Float32Array(matrix);\n const pixelSizeX = 1 / fxcanvas.width;\n const pixelSizeY = 1 / fxcanvas.height;\n const program = compileShader(shaders.convolution);\n if (!program) return;\n gl.uniform1fv(program.uniform['m'], m);\n gl.uniform2f(program.uniform['px'], pixelSizeX, pixelSizeY);\n draw();\n },\n\n detectEdges: () => {\n // @ts-ignore this\n filter.convolution.call(this, [\n 0, 1, 0,\n 1, -4, 1,\n 0, 1, 0,\n ]);\n },\n\n sobelX: () => {\n // @ts-ignore this\n filter.convolution.call(this, [\n -1, 0, 1,\n -2, 0, 2,\n -1, 0, 1,\n ]);\n },\n\n sobelY: () => {\n // @ts-ignore this\n filter.convolution.call(this, [\n -1, -2, -1,\n 0, 0, 0,\n 1, 2, 1,\n ]);\n },\n\n sharpen: (amount) => {\n const a = amount || 1;\n // @ts-ignore this\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 emboss: (size: number) => {\n const s = size || 1;\n // @ts-ignore this\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 blur: (size: number) => {\n const blurSizeX = (size / 7) / fxcanvas.width;\n const blurSizeY = (size / 7) / fxcanvas.height;\n const program = compileShader(shaders.blur);\n if (!program) return;\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 pixelate: (size: number) => {\n const blurSizeX = (size) / fxcanvas.width;\n const blurSizeY = (size) / fxcanvas.height;\n const program = compileShader(shaders.pixelate);\n if (!program) return;\n gl.uniform2f(program.uniform['size'], blurSizeX, blurSizeY);\n draw();\n },\n };\n\n // @ts-ignore this\n this.add = function (name) {\n const args = Array.prototype.slice.call(arguments, 1); // eslint-disable-line prefer-rest-params\n const func = filter[name];\n filterChain.push({ func, args });\n };\n\n // @ts-ignore this\n this.reset = function () {\n filterChain = [];\n };\n\n // @ts-ignore this\n this.get = function () {\n return filterChain;\n };\n\n // @ts-ignore this\n this.apply = function (image) {\n resize(image.width, image.height);\n drawCount = 0;\n if (!sourceTexture) sourceTexture = gl.createTexture(); // Create the texture for the input image if we haven't yet\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 for (let i = 0; i < filterChain.length; i++) {\n lastInChain = (i === filterChain.length - 1);\n const f = filterChain[i];\n // @ts-ignore function assigment\n f.func.apply(this, f.args || []);\n }\n return fxcanvas;\n };\n\n // @ts-ignore this\n this.draw = function (image) {\n this.add('brightness', 0);\n return this.apply(image);\n };\n}\n", "/**\n * Image enhancements\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Tensor } from '../tfjs/types';\n\nexport async function histogramEqualization(inputImage: Tensor): Promise {\n const squeeze = inputImage.shape.length === 4 ? tf.squeeze(inputImage) : inputImage;\n const rgb = tf.split(squeeze, 3, 2);\n const min: Tensor[] = [tf.min(rgb[0]), tf.min(rgb[1]), tf.min(rgb[2])]; // minimum pixel value per channel T[]\n const max: Tensor[] = [tf.max(rgb[0]), tf.max(rgb[1]), tf.max(rgb[2])]; // maximum pixel value per channel T[]\n // const absMin = await Promise.all(min.map((channel) => channel.data())); // minimum pixel value per channel A[]\n // const minValue = Math.min(absMax[0][0], absMin[1][0], absMin[2][0]);\n const absMax = await Promise.all(max.map((channel) => channel.data())); // maximum pixel value per channel A[]\n const maxValue = Math.max(absMax[0][0], absMax[1][0], absMax[2][0]);\n const maxRange = maxValue > 1 ? 255 : 1;\n const factor = maxRange / maxValue;\n let final: Tensor;\n if (factor > 1) {\n const sub = [tf.sub(rgb[0], min[0]), tf.sub(rgb[1], min[1]), tf.sub(rgb[2], min[2])]; // channels offset by min values\n const range = [tf.sub(max[0], min[0]), tf.sub(max[1], min[1]), tf.sub(max[2], min[2])]; // channel ranges\n // const fact = [tf.div(maxRange, absMax[0]), tf.div(maxRange, absMax[1]), tf.div(maxRange, absMax[1])]; // factors between\n const enh = [tf.mul(sub[0], factor), tf.mul(sub[1], factor), tf.mul(sub[2], factor)];\n const stack = tf.stack([enh[0], enh[1], enh[2]], 2);\n final = tf.reshape(stack, [1, squeeze.shape[0] || 0, squeeze.shape[1] || 0, 3]);\n tf.dispose([...sub, ...range, ...enh, stack]);\n } else {\n final = tf.expandDims(squeeze, 0);\n }\n tf.dispose([...rgb, ...min, ...max, rgb, squeeze, inputImage]);\n return final;\n}\n", "/**\n * Image Processing algorithm implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as fxImage from './imagefx';\nimport type { Input, AnyCanvas, Config } from '../exports';\nimport type { Tensor, Tensor3D, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { log } from '../util/util';\nimport * as enhance from './enhance';\n\nconst maxSize = 3840;\n// internal temp canvases\nlet inCanvas: AnyCanvas | null = null; // use global variable to avoid recreating canvas on each frame\nlet outCanvas: AnyCanvas | null = null; // use global variable to avoid recreating canvas on each frame\nlet tmpCanvas: AnyCanvas | null = null; // use global variable to avoid recreating canvas on each frame\n// @ts-ignore // imagefx is js module that should be converted to a class\nlet fx: fxImage.GLImageFilter | null; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n\nconst last: { inputSum: number, cacheDiff: number, sumMethod: number, inputTensor: undefined | Tensor } = {\n inputSum: 0,\n cacheDiff: 1,\n sumMethod: 0,\n inputTensor: undefined,\n};\n\nexport function reset() {\n last.inputSum = 0;\n last.cacheDiff = 1;\n last.sumMethod = 0;\n last.inputTensor = undefined;\n}\n\nexport function canvas(width: number, height: number): AnyCanvas {\n let c: AnyCanvas;\n if (env.browser) { // browser defines canvas object\n if (env.worker) { // if runing in web worker use OffscreenCanvas\n if (typeof OffscreenCanvas === 'undefined') throw new Error('canvas error: attempted to run in web worker but OffscreenCanvas is not supported');\n c = new OffscreenCanvas(width, height);\n } else { // otherwise use DOM canvas\n if (typeof document !== 'undefined') {\n c = document.createElement('canvas');\n c.width = width;\n c.height = height;\n } else if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n // @ts-ignore // env.canvas is an external monkey-patch\n if (typeof env.Canvas !== 'undefined') c = new env.Canvas(width, height);\n else if (typeof globalThis.Canvas !== 'undefined') c = new globalThis.Canvas(width, height);\n else throw new Error('canvas error: attempted to use canvas in react-native without canvas support installed');\n } else {\n throw new Error('canvas error: attempted to run in browser but DOM is not defined');\n }\n }\n } else { // if not running in browser, there is no \"default\" canvas object, so we need monkey patch or fail\n // @ts-ignore // env.canvas is an external monkey-patch\n if (typeof env.Canvas !== 'undefined') c = new env.Canvas(width, height);\n else if (typeof globalThis.Canvas !== 'undefined') c = new globalThis.Canvas(width, height);\n // else throw new Error('canvas error: attempted to use canvas in nodejs without canvas support installed');\n }\n // @ts-ignore its either defined or we already threw an error\n return c;\n}\n\n// helper function to copy canvas from input to output\nexport function copy(input: AnyCanvas, output?: AnyCanvas) {\n const outputCanvas = output || canvas(input.width, input.height);\n const ctx = outputCanvas.getContext('2d') as CanvasRenderingContext2D;\n ctx.drawImage(input, 0, 0);\n return outputCanvas;\n}\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 async function process(input: Input, config: Config, getTensor: boolean = true): Promise<{ tensor: Tensor4D | null, canvas: AnyCanvas | null }> {\n if (!input) {\n // throw new Error('input is missing');\n if (config.debug) log('input error: input is missing');\n return { tensor: null, canvas: null }; // video may become temporarily unavailable due to onresize\n }\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 globalThis.Canvas !== 'undefined' && input instanceof globalThis.Canvas)\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('input error: type not recognized');\n }\n if (input instanceof tf.Tensor) { // if input is tensor use as-is without filters but correct shape as needed\n let tensor: Tensor | null = null;\n if (input['isDisposedInternal']) throw new Error('input error: attempted to use tensor but it is disposed');\n if (!(input as Tensor).shape) throw new Error('input error: attempted to use tensor without a shape');\n if ((input as Tensor).shape.length === 3) { // [height, width, 3 || 4]\n if ((input as Tensor).shape[2] === 3) { // [height, width, 3] so add batch\n tensor = tf.expandDims(input, 0);\n } else if ((input as Tensor).shape[2] === 4) { // [height, width, 4] so strip alpha and add batch\n const rgb = tf.slice3d(input as Tensor3D, [0, 0, 0], [-1, -1, 3]);\n tensor = tf.expandDims(rgb, 0);\n tf.dispose(rgb);\n }\n } else if ((input as Tensor).shape.length === 4) { // [1, width, height, 3 || 4]\n if ((input as Tensor).shape[3] === 3) { // [1, width, height, 3] just clone\n tensor = tf.clone(input);\n } else if ((input as Tensor).shape[3] === 4) { // [1, width, height, 4] so strip alpha\n tensor = tf.slice4d(input as Tensor4D, [0, 0, 0, 0], [-1, -1, -1, 3]);\n }\n }\n // at the end shape must be [1, height, width, 3]\n if (tensor == null || tensor.shape.length !== 4 || tensor.shape[0] !== 1 || tensor.shape[3] !== 3) throw new Error(`input error: attempted to use tensor with unrecognized shape: ${((input as Tensor).shape).toString()}`);\n if ((tensor).dtype === 'int32') {\n const cast = tf.cast(tensor, 'float32');\n tf.dispose(tensor);\n tensor = cast;\n }\n return { tensor: tensor as Tensor4D, canvas: (config.filter.return ? outCanvas : null) };\n }\n // check if resizing will be needed\n if (typeof input['readyState'] !== 'undefined' && (input as HTMLMediaElement).readyState <= 2) {\n if (config.debug) log('input stream is not ready');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n const originalWidth: number = input['naturalWidth'] || input['videoWidth'] || input['width'] || (input['shape'] && (input['shape'][1] > 0));\n const originalHeight: number = input['naturalHeight'] || input['videoHeight'] || input['height'] || (input['shape'] && (input['shape'][2] > 0));\n if (!originalWidth || !originalHeight) {\n if (config.debug) log('cannot determine input dimensions');\n return { tensor: null, canvas: inCanvas }; // video may become temporarily unavailable due to onresize\n }\n let targetWidth: number = originalWidth;\n let targetHeight: number = originalHeight;\n if (targetWidth > maxSize) {\n targetWidth = maxSize;\n targetHeight = Math.trunc(targetWidth * originalHeight / originalWidth);\n }\n if (targetHeight > maxSize) {\n targetHeight = maxSize;\n targetWidth = Math.trunc(targetHeight * originalWidth / originalHeight);\n }\n\n // create our canvas and resize it if needed\n if ((config.filter?.width || 0) > 0) targetWidth = config.filter.width as number;\n else if ((config.filter?.height || 0) > 0) targetWidth = originalWidth * ((config.filter.height || 0) / originalHeight);\n if ((config.filter.height || 0) > 0) targetHeight = config.filter.height as number;\n else if ((config.filter.width || 0) > 0) targetHeight = originalHeight * ((config.filter.width || 0) / originalWidth);\n if (!targetWidth || !targetHeight) throw new Error('input error: cannot determine dimension');\n if (!inCanvas || (inCanvas.width !== targetWidth) || (inCanvas.height !== targetHeight)) inCanvas = canvas(targetWidth, targetHeight);\n\n // draw input to our canvas\n const inCtx = inCanvas.getContext('2d') as CanvasRenderingContext2D;\n if ((typeof ImageData !== 'undefined') && (input instanceof ImageData)) {\n inCtx.putImageData(input, 0, 0);\n } else {\n if (config.filter.flip && typeof inCtx.translate !== 'undefined') {\n inCtx.translate(originalWidth, 0);\n inCtx.scale(-1, 1);\n inCtx.drawImage(input as AnyCanvas, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas.width, inCanvas.height);\n inCtx.setTransform(1, 0, 0, 1, 0, 0); // resets transforms to defaults\n } else {\n inCtx.drawImage(input as AnyCanvas, 0, 0, originalWidth, originalHeight, 0, 0, inCanvas.width, inCanvas.height);\n }\n }\n\n if (!outCanvas || (inCanvas.width !== outCanvas.width) || (inCanvas.height !== outCanvas.height)) outCanvas = canvas(inCanvas.width, inCanvas.height); // init output canvas\n\n // imagefx transforms using gl from input canvas to output canvas\n if (config.filter.enabled && env.webgl.supported) {\n if (!fx) fx = env.browser ? new fxImage.GLImageFilter() : null; // && (typeof document !== 'undefined')\n env.filter = !!fx;\n if (!fx?.add) {\n if (config.debug) log('input process error: cannot initialize filters');\n env.webgl.supported = false;\n config.filter.enabled = false;\n copy(inCanvas, outCanvas); // filter failed to initialize\n // return { tensor: null, canvas: inCanvas };\n } else {\n fx.reset();\n if (config.filter.brightness !== 0) fx.add('brightness', config.filter.brightness);\n if (config.filter.contrast !== 0) fx.add('contrast', config.filter.contrast);\n if (config.filter.sharpness !== 0) fx.add('sharpen', config.filter.sharpness);\n if (config.filter.blur !== 0) fx.add('blur', config.filter.blur);\n if (config.filter.saturation !== 0) fx.add('saturation', config.filter.saturation);\n if (config.filter.hue !== 0) fx.add('hue', config.filter.hue);\n if (config.filter.negative) fx.add('negative');\n if (config.filter.sepia) fx.add('sepia');\n if (config.filter.vintage) fx.add('brownie');\n if (config.filter.sepia) fx.add('sepia');\n if (config.filter.kodachrome) fx.add('kodachrome');\n if (config.filter.technicolor) fx.add('technicolor');\n if (config.filter.polaroid) fx.add('polaroid');\n if (config.filter.pixelate !== 0) fx.add('pixelate', config.filter.pixelate);\n if (fx.get()?.length > 1) outCanvas = fx.apply(inCanvas);\n else outCanvas = fx.draw(inCanvas);\n }\n } else {\n copy(inCanvas, outCanvas); // if no filters applied, output canvas is input canvas\n if (fx) fx = null;\n env.filter = !!fx;\n }\n\n if (!getTensor) return { tensor: null, canvas: outCanvas }; // just canvas was requested\n if (!outCanvas) throw new Error('canvas error: cannot create output');\n\n // create tensor from image unless input was a tensor already\n let pixels;\n let depth = 3;\n if ((typeof ImageData !== 'undefined' && input instanceof ImageData) || ((input as ImageData).data && (input as ImageData).width && (input as ImageData).height)) { // if input is imagedata, just use it\n if (env.browser && tf.browser) {\n pixels = tf.browser ? tf.browser.fromPixels(input as ImageData) : null;\n } else {\n depth = (input as ImageData).data.length / (input as ImageData).height / (input as ImageData).width;\n // const arr = Uint8Array.from(input['data']);\n const arr = new Uint8Array((input as ImageData).data.buffer);\n pixels = tf.tensor(arr, [(input as ImageData).height, (input as ImageData).width, depth], 'int32');\n }\n } else {\n if (!tmpCanvas || (outCanvas.width !== tmpCanvas.width) || (outCanvas.height !== tmpCanvas.height)) tmpCanvas = canvas(outCanvas.width, outCanvas.height); // init output canvas\n if (tf.browser && env.browser) {\n if (config.backend === 'webgl' || config.backend === 'humangl' || config.backend === 'webgpu') {\n pixels = tf.browser.fromPixels(outCanvas as HTMLCanvasElement); // safe to reuse since both backend and context are gl based\n } else {\n tmpCanvas = copy(outCanvas); // cannot use output canvas as it already has gl context so we do a silly one more canvas\n pixels = tf.browser.fromPixels(tmpCanvas as HTMLCanvasElement);\n }\n } else {\n const tempCanvas = copy(outCanvas); // cannot use output canvas as it already has gl context so we do a silly one more canvas\n const tempCtx = tempCanvas.getContext('2d') as CanvasRenderingContext2D;\n const tempData = tempCtx.getImageData(0, 0, targetWidth, targetHeight);\n depth = tempData.data.length / targetWidth / targetHeight;\n const arr = new Uint8Array(tempData.data.buffer);\n pixels = tf.tensor(arr, [targetWidth, targetHeight, depth]);\n }\n }\n if (depth === 4) { // rgba to rgb\n const rgb = tf.slice3d(pixels, [0, 0, 0], [-1, -1, 3]); // strip alpha channel\n tf.dispose(pixels);\n pixels = rgb;\n }\n if (!pixels) throw new Error('input error: cannot create tensor');\n const casted: Tensor = tf.cast(pixels, 'float32');\n const tensor: Tensor = config.filter.equalization ? await enhance.histogramEqualization(casted) : tf.expandDims(casted, 0);\n tf.dispose([pixels, casted]);\n\n if (config.filter.autoBrightness) {\n const max = tf.max(tensor);\n const maxVal = await max.data();\n config.filter.brightness = maxVal[0] > 1 ? (1 - maxVal[0] / 255) : (1 - maxVal[0]);\n tf.dispose(max);\n }\n\n return { tensor: tensor as Tensor4D, canvas: (config.filter.return ? outCanvas : null) };\n}\n\n/*\nconst checksum = async (input: Tensor): Promise => { // use tf sum or js based sum loop depending on which is faster\n const resizeFact = 48;\n const reduced: Tensor = tf.image.resizeBilinear(input, [Math.trunc((input.shape[1] || 1) / resizeFact), Math.trunc((input.shape[2] || 1) / resizeFact)]);\n const tfSum = async (): Promise => {\n const sumT = tf.sum(reduced);\n const sum0 = await sumT.data();\n tf.dispose(sumT);\n return sum0[0];\n };\n const jsSum = async (): Promise => {\n const reducedData = await reduced.data(); // raw image rgb array\n let sum0 = 0;\n for (let i = 0; i < reducedData.length / 3; i++) sum0 += reducedData[3 * i + 2]; // look only at green value of each pixel\n return sum0;\n };\n if (last.sumMethod === 0) {\n const t0 = now();\n await jsSum();\n const t1 = now();\n await tfSum();\n const t2 = now();\n last.sumMethod = t1 - t0 < t2 - t1 ? 1 : 2;\n }\n const res = last.sumMethod === 1 ? await jsSum() : await tfSum();\n tf.dispose(reduced);\n return res;\n};\n*/\n\nexport async function skip(config: Partial, input: Tensor) {\n let skipFrame = false;\n if (config.cacheSensitivity === 0 || !input.shape || input.shape.length !== 4 || input.shape[1] > 3840 || input.shape[2] > 2160) return skipFrame; // cache disabled or input is invalid or too large for cache analysis\n\n /*\n const checkSum = await checksum(input);\n const diff = 100 * (Math.max(checkSum, last.inputSum) / Math.min(checkSum, last.inputSum) - 1);\n last.inputSum = checkSum;\n // if previous frame was skipped, skip this frame if changed more than cacheSensitivity\n // if previous frame was not skipped, then look for cacheSensitivity or difference larger than one in previous frame to avoid resetting cache in subsequent frames unnecessarily\n let skipFrame = diff < Math.max(config.cacheSensitivity, last.cacheDiff);\n // if difference is above 10x threshold, don't use last value to force reset cache for significant change of scenes or images\n last.cacheDiff = diff > 10 * config.cacheSensitivity ? 0 : diff;\n skipFrame = skipFrame && (last.cacheDiff > 0); // if no cached diff value then force no skip\n */\n\n if (!last.inputTensor) {\n last.inputTensor = tf.clone(input);\n } else if (last.inputTensor.shape[1] !== input.shape[1] || last.inputTensor.shape[2] !== input.shape[2]) { // input resolution changed\n tf.dispose(last.inputTensor);\n last.inputTensor = tf.clone(input);\n } else {\n const t: Record = {};\n t.diff = tf.sub(input, last.inputTensor);\n t.squared = tf.mul(t.diff, t.diff);\n t.sum = tf.sum(t.squared);\n const diffSum = await t.sum.data();\n const diffRelative = diffSum[0] / (input.shape[1] || 1) / (input.shape[2] || 1) / 255 / 3; // squared difference relative to input resolution and averaged per channel\n tf.dispose([last.inputTensor, t.diff, t.squared, t.sum]);\n last.inputTensor = tf.clone(input);\n skipFrame = diffRelative <= (config.cacheSensitivity || 0);\n }\n return skipFrame;\n}\n\nexport async function compare(config: Partial, input1: Tensor, input2: Tensor): Promise {\n const t: Record = {};\n if (!input1 || !input2 || input1.shape.length !== 4 || input1.shape.length !== input2.shape.length) {\n if (!config.debug) log('invalid input tensor or tensor shapes do not match:', input1.shape, input2.shape);\n return 0;\n }\n if (input1.shape[0] !== 1 || input2.shape[0] !== 1 || input1.shape[3] !== 3 || input2.shape[3] !== 3) {\n if (!config.debug) log('input tensors must be of shape [1, height, width, 3]:', input1.shape, input2.shape);\n return 0;\n }\n t.input1 = tf.clone(input1);\n t.input2 = (input1.shape[1] !== input2.shape[1] || input1.shape[2] !== input2.shape[2]) ? tf.image.resizeBilinear(input2 as Tensor3D, [input1.shape[1], input1.shape[2]]) : tf.clone(input2);\n t.diff = tf.sub(t.input1, t.input2);\n t.squared = tf.mul(t.diff, t.diff);\n t.sum = tf.sum(t.squared);\n const diffSum = await t.sum.data();\n const diffRelative = diffSum[0] / (input1.shape[1] || 1) / (input1.shape[2] || 1) / 255 / 3;\n tf.dispose([t.input1, t.input2, t.diff, t.squared, t.sum]);\n return diffRelative;\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport * as image from '../image/image';\n\n/** Env class that holds detected capabilities */\nexport class Env {\n /** Running in Browser */\n browser: boolean;\n /** Running in NodeJS */\n node: boolean;\n /** Running in WebWorker thread */\n worker: boolean;\n /** Detected platform */\n platform: string = '';\n /** Detected agent */\n agent: string = '';\n /** List of supported backends */\n backends: string[] = [];\n /** Has any work been performed so far */\n initial: boolean;\n /** Are image filters supported? */\n filter: boolean | undefined;\n /** TFJS instance details */\n tfjs: {\n version: undefined | string,\n };\n /** Is offscreenCanvas supported? */\n offscreen: undefined | boolean;\n /** Are performance counter instant values or additive */\n perfadd: boolean = false;\n /** If using tfjs-node get version of underlying tensorflow shared library and if gpu acceleration is enabled */\n tensorflow: {\n version: undefined | string,\n gpu: undefined | boolean,\n } = {\n version: undefined,\n gpu: undefined,\n };\n /** WASM detected capabilities */\n wasm: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n simd: undefined | boolean,\n multithread: undefined | boolean,\n } = {\n supported: undefined,\n backend: undefined,\n simd: undefined,\n multithread: undefined,\n };\n /** WebGL detected capabilities */\n webgl: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n version: undefined | string,\n renderer: undefined | string,\n shader: undefined | string,\n vendor: undefined | string,\n } = {\n supported: undefined,\n backend: undefined,\n version: undefined,\n renderer: undefined,\n shader: undefined,\n vendor: undefined,\n };\n /** WebGPU detected capabilities */\n webgpu: {\n supported: undefined | boolean,\n backend: undefined | boolean,\n adapter: undefined | GPUAdapterInfo,\n } = {\n supported: undefined,\n backend: undefined,\n adapter: undefined,\n };\n /** CPU info */\n cpu: {\n model: undefined | string,\n flags: string[],\n } = {\n model: undefined,\n flags: [],\n };\n /** List of supported kernels for current backend */\n kernels: string[] = [];\n\n /** MonkeyPatch for Canvas/Image/ImageData */\n #canvas: undefined;\n #image: undefined;\n #imageData: undefined;\n\n get Canvas() { return this.#canvas; }\n set Canvas(val) { this.#canvas = val; globalThis.Canvas = val; }\n get Image() { return this.#image; }\n // @ts-ignore monkey-patch;\n set Image(val) { this.#image = val; globalThis.Image = val; }\n get ImageData() { return this.#imageData; }\n // @ts-ignore monkey-patch;\n set ImageData(val) { this.#imageData = val; globalThis.ImageData = val; }\n\n constructor() {\n this.browser = (typeof navigator !== 'undefined') && (typeof navigator.appVersion !== 'undefined');\n this.node = (typeof process !== 'undefined') && (typeof process.versions !== 'undefined') && (typeof process.versions.node !== 'undefined');\n this.tfjs = { version: tf.version['tfjs-core'] };\n this.offscreen = typeof OffscreenCanvas !== 'undefined';\n this.initial = true;\n\n // @ts-ignore WorkerGlobalScope evaluated in browser only\n this.worker = this.browser && this.offscreen ? (typeof WorkerGlobalScope !== 'undefined') : undefined;\n if ((typeof navigator !== 'undefined') && (typeof navigator.userAgent !== 'undefined')) { // TBD replace with navigator.userAgentData once in mainline\n const agent = navigator.userAgent || '';\n const raw = agent.match(/\\(([^()]+)\\)/g);\n if (raw?.[0]) {\n const platformMatch = raw[0].match(/\\(([^()]+)\\)/g);\n this.platform = (platformMatch?.[0]) ? platformMatch[0].replace(/\\(|\\)/g, '') : '';\n this.agent = agent.replace(raw[0], '');\n if (this.platform[1]) this.agent = this.agent.replace(raw[1], '');\n this.agent = this.agent.replace(/ /g, ' ');\n }\n } else if (typeof process !== 'undefined') {\n this.platform = `${process.platform} ${process.arch}`;\n this.agent = `NodeJS ${process.version}`;\n }\n }\n\n /** update backend information */\n async updateBackend() {\n // analyze backends\n this.backends = Object.keys(tf.engine().registryFactory);\n try { // backend may not be initialized\n this.tensorflow = {\n version: (tf.backend()['binding'] ? tf.backend()['binding'].TF_Version : undefined),\n gpu: (tf.backend()['binding'] ? tf.backend()['binding'].isUsingGpuDevice() : undefined),\n };\n } catch { /**/ }\n this.wasm.supported = typeof WebAssembly !== 'undefined';\n this.wasm.backend = this.backends.includes('wasm');\n if (this.wasm.supported && this.wasm.backend) {\n this.wasm.simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT') as boolean;\n this.wasm.multithread = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT') as boolean;\n }\n const c = image.canvas(100, 100);\n const gl = c ? c.getContext('webgl2') as WebGL2RenderingContext : undefined; // causes too many gl contexts\n this.webgl.supported = typeof gl !== 'undefined';\n this.webgl.backend = this.backends.includes('webgl');\n if (this.webgl.supported && this.webgl.backend && gl) {\n this.webgl.version = gl.getParameter(gl.VERSION);\n this.webgl.vendor = gl.getParameter(gl.VENDOR);\n this.webgl.renderer = gl.getParameter(gl.RENDERER);\n this.webgl.shader = gl.getParameter(gl.SHADING_LANGUAGE_VERSION);\n }\n this.webgpu.supported = this.browser && typeof navigator !== 'undefined' && typeof navigator.gpu !== 'undefined';\n this.webgpu.backend = this.backends.includes('webgpu');\n try {\n if (this.webgpu.supported) {\n const adapter = await navigator.gpu.requestAdapter();\n this.webgpu.adapter = await adapter?.requestAdapterInfo();\n }\n } catch {\n this.webgpu.supported = false;\n }\n try {\n this.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase());\n } catch { /**/ }\n }\n\n /** update cpu information */\n updateCPU() {\n const cpu = { model: '', flags: [] };\n if (this.node && this.platform.startsWith('linux')) {\n /*\n const fs = require('fs');\n try {\n const data = fs.readFileSync('/proc/cpuinfo').toString();\n for (const line of data.split('\\n')) {\n if (line.startsWith('model name')) cpu.model = line.match(/:(.*)/g)[0].replace(':', '').trim();\n if (line.startsWith('flags')) cpu.flags = line.match(/:(.*)/g)[0].replace(':', '').trim().split(' ').sort();\n }\n } catch { }\n */\n }\n if (!this.cpu) Object.defineProperty(this, 'cpu', { value: cpu });\n else this.cpu = cpu;\n }\n}\n\nexport const env = new Env();\n", "import { log } from './util';\n\n// const log = (...msg) => console.log('webcam', ...msg); // eslint-disable-line no-console\n\n/** WebCam configuration */\nexport interface WebCamConfig {\n /**\n * element can be:\n * - string which indicates dom element id\n * - actual HTMLVideo dom element\n * - undefined in which case a new HTMLVideoElement will be created\n */\n element: string | HTMLVideoElement | undefined,\n /** print messages on console */\n debug: boolean,\n /** use front or back camera */\n mode: 'front' | 'back',\n /** camera crop mode */\n crop: boolean,\n /** desired webcam width */\n width: number,\n /** desired webcam height */\n height: number,\n /** deviceId of the video device to use */\n id?: string,\n}\n\nexport class WebCam { // eslint-disable-line @typescript-eslint/no-extraneous-class\n /** current webcam configuration */\n config: WebCamConfig;\n /** instance of dom element associated with webcam stream */\n element: HTMLVideoElement | undefined;\n /** active webcam stream */\n stream: MediaStream | undefined;\n /** enumerated video devices */\n devices: MediaDeviceInfo[] = [];\n\n constructor() {\n this.config = {\n element: undefined,\n debug: true,\n mode: 'front',\n crop: false,\n width: 0,\n height: 0,\n };\n }\n\n /** get active webcam stream track */\n public get track(): MediaStreamTrack | undefined {\n if (!this.stream) return undefined;\n return this.stream.getVideoTracks()[0];\n }\n\n /** get webcam capabilities */\n public get capabilities(): MediaTrackCapabilities | undefined {\n if (!this.track) return undefined;\n return this.track.getCapabilities ? this.track.getCapabilities() : undefined;\n }\n\n /** get webcam constraints */\n public get constraints(): MediaTrackConstraints | undefined {\n if (!this.track) return undefined;\n return this.track.getConstraints ? this.track.getConstraints() : undefined;\n }\n\n /** get webcam settings */\n public get settings(): MediaTrackSettings | undefined {\n if (!this.stream) return undefined;\n const track: MediaStreamTrack = this.stream.getVideoTracks()[0];\n return track.getSettings ? track.getSettings() : undefined;\n }\n\n /** get webcam label */\n public get label(): string {\n if (!this.track) return '';\n return this.track.label;\n }\n\n /** is webcam paused */\n public get paused(): boolean {\n return this.element?.paused || false;\n }\n\n /** webcam current width */\n public get width(): number {\n return this.element?.videoWidth || 0;\n }\n\n /** webcam current height */\n public get height(): number {\n return this.element?.videoHeight || 0;\n }\n\n public enumerate = async (): Promise => {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n this.devices = devices.filter((device) => device.kind === 'videoinput');\n } catch {\n this.devices = [];\n }\n return this.devices;\n };\n\n /** start method initializizes webcam stream and associates it with a dom video element */\n public start = async (webcamConfig?: Partial): Promise => {\n // set config\n if (webcamConfig?.debug) this.config.debug = webcamConfig?.debug;\n if (webcamConfig?.crop) this.config.crop = webcamConfig?.crop;\n if (webcamConfig?.mode) this.config.mode = webcamConfig?.mode;\n if (webcamConfig?.width) this.config.width = webcamConfig?.width;\n if (webcamConfig?.height) this.config.height = webcamConfig?.height;\n if (webcamConfig?.id) this.config.id = webcamConfig?.id;\n\n // use or create dom element\n if (webcamConfig?.element) {\n if (typeof webcamConfig.element === 'string') {\n const el = document.getElementById(webcamConfig.element);\n if (el && el instanceof HTMLVideoElement) {\n this.element = el;\n } else {\n if (this.config.debug) log('webcam', 'cannot get dom element', webcamConfig.element);\n return `webcam error: cannot get dom element: ${webcamConfig.element}`;\n }\n } else if (webcamConfig.element instanceof HTMLVideoElement) {\n this.element = webcamConfig.element;\n } else {\n if (this.config.debug) log('webcam', 'unknown dom element', webcamConfig.element);\n return `webcam error: unknown dom element: ${webcamConfig.element}`;\n }\n } else {\n this.element = document.createElement('video');\n }\n\n // set constraints to use\n const requestedConstraints: MediaStreamConstraints = {\n audio: false,\n video: {\n facingMode: this.config.mode === 'front' ? 'user' : 'environment',\n // @ts-ignore // resizeMode is still not defined in tslib\n resizeMode: this.config.crop ? 'crop-and-scale' : 'none',\n },\n };\n if (this.config?.width > 0) (requestedConstraints.video as MediaTrackConstraints).width = { ideal: this.config.width };\n if (this.config?.height > 0) (requestedConstraints.video as MediaTrackConstraints).height = { ideal: this.config.height };\n if (this.config.id) (requestedConstraints.video as MediaTrackConstraintSet).deviceId = this.config.id;\n\n // set default event listeners\n this.element.addEventListener('play', () => { if (this.config.debug) log('webcam', 'play'); });\n this.element.addEventListener('pause', () => { if (this.config.debug) log('webcam', 'pause'); });\n this.element.addEventListener('click', async () => { // pause when clicked on screen and resume on next click\n if (!this.element || !this.stream) return;\n if (this.element.paused) await this.element.play();\n else this.element.pause();\n });\n\n // get webcam and set it to run in dom element\n if (!navigator?.mediaDevices) {\n if (this.config.debug) log('webcam error', 'no devices');\n return 'webcam error: no devices';\n }\n try {\n this.stream = await navigator.mediaDevices.getUserMedia(requestedConstraints); // get stream that satisfies constraints\n } catch (err) {\n log('webcam', err);\n return `webcam error: ${err}`;\n }\n if (!this.stream) {\n if (this.config.debug) log('webcam error', 'no stream');\n return 'webcam error no stream';\n }\n this.element.srcObject = this.stream; // assign it to dom element\n const ready = new Promise((resolve) => { // wait until stream is ready\n if (!this.element) resolve(false);\n else this.element.onloadeddata = () => resolve(true);\n });\n await ready;\n await this.element.play(); // start playing\n\n if (this.config.debug) {\n log('webcam', {\n width: this.width,\n height: this.height,\n label: this.label,\n stream: this.stream,\n track: this.track,\n settings: this.settings,\n constraints: this.constraints,\n capabilities: this.capabilities,\n });\n }\n return `webcam: ${this.label}`;\n };\n\n /** pause webcam video method */\n public pause = (): void => {\n if (this.element) this.element.pause();\n };\n\n /** play webcam video method */\n public play = async (): Promise => {\n if (this.element) await this.element.play();\n };\n\n /** stop method stops active webcam stream track and disconnects webcam */\n public stop = (): void => {\n if (this.config.debug) log('webcam', 'stop');\n if (this.track) this.track.stop();\n };\n}\n", "{\n \"antispoof\": 853098,\n \"blazeface\": 538928,\n \"centernet\": 4030290,\n \"emotion\": 820516,\n \"facemesh\": 1477958,\n \"faceres\": 6978814,\n \"handlandmark-lite\": 2023432,\n \"handtrack\": 2964837,\n \"iris\": 2599092,\n \"liveness\": 592976,\n \"models\": 0,\n \"movenet-lightning\": 4650216,\n \"affectnet-mobilenet\": 6920630,\n \"age\": 161240,\n \"blazeface-back\": 538928,\n \"blazeface-front\": 402048,\n \"blazepose-detector\": 5928856,\n \"blazepose-full\": 6339202,\n \"blazepose-heavy\": 27502466,\n \"blazepose-lite\": 2726402,\n \"efficientpose\": 5651240,\n \"faceboxes\": 2013002,\n \"facemesh-attention-pinto\": 2387598,\n \"facemesh-attention\": 2382414,\n \"facemesh-detection-full\": 1026192,\n \"facemesh-detection-short\": 201268,\n \"faceres-deep\": 13957620,\n \"gear-e1\": 112438,\n \"gear-e2\": 112438,\n \"gear\": 1498916,\n \"gender-ssrnet-imdb\": 161236,\n \"gender\": 201808,\n \"handdetect\": 3515612,\n \"handlandmark-full\": 5431368,\n \"handlandmark-sparse\": 5286322,\n \"handskeleton\": 5502280,\n \"meet\": 372228,\n \"mobileface\": 2183192,\n \"mobilefacenet\": 5171976,\n \"movenet-multipose\": 9448838,\n \"movenet-thunder\": 12477112,\n \"nanodet\": 7574558,\n \"posenet\": 5032780,\n \"rvm\": 3739355,\n \"selfie\": 212886,\n \"anti-spoofing\": 853098,\n \"efficientpose-i-lite\": 2269064,\n \"efficientpose-ii-lite\": 5651240,\n \"efficientpose-iv\": 25643252,\n \"insightface-efficientnet-b0\": 13013224,\n \"insightface-ghostnet-strides1\": 8093408,\n \"insightface-ghostnet-strides2\": 8049584,\n \"insightface-mobilenet-emore\": 6938536,\n \"insightface-mobilenet-swish\": 12168584,\n \"nanodet-e\": 12319156,\n \"nanodet-g\": 7574558,\n \"nanodet-m\": 1887474,\n \"nanodet-t\": 5294216\n}", "import * as tf from 'dist/tfjs.esm.js';\nimport { log, join } from '../util/util';\nimport type { GraphModel } from './types';\nimport type { Config } from '../config';\nimport * as modelsDefs from '../../models/models.json';\n\nconst options = {\n cacheModels: true,\n cacheSupported: true,\n verbose: true,\n debug: false,\n modelBasePath: '',\n};\n\nexport interface ModelInfo {\n name: string,\n inCache: boolean,\n sizeDesired: number,\n sizeFromManifest: number,\n sizeLoadedWeights: number,\n url: string,\n}\n\nexport const modelStats: Record = {};\n\nasync function httpHandler(url: string, init?: RequestInit): Promise {\n if (options.debug) log('load model fetch:', url, init);\n return fetch(url, init);\n}\n\nexport function setModelLoadOptions(config: Config) {\n options.cacheModels = config.cacheModels;\n options.verbose = config.debug;\n options.modelBasePath = config.modelBasePath;\n}\n\nexport async function loadModel(modelPath: string | undefined): Promise {\n let modelUrl = join(options.modelBasePath, modelPath || '');\n if (!modelUrl.toLowerCase().endsWith('.json')) modelUrl += '.json';\n const modelPathSegments = modelUrl.includes('/') ? modelUrl.split('/') : modelUrl.split('\\\\');\n const shortModelName = modelPathSegments[modelPathSegments.length - 1].replace('.json', '');\n const cachedModelName = 'indexeddb://' + shortModelName; // generate short model name for cache\n modelStats[shortModelName] = {\n name: shortModelName,\n sizeFromManifest: 0,\n sizeLoadedWeights: 0,\n sizeDesired: modelsDefs[shortModelName],\n inCache: false,\n url: '',\n };\n options.cacheSupported = (typeof indexedDB !== 'undefined'); // check if localStorage and indexedb are available\n let cachedModels = {};\n try {\n cachedModels = (options.cacheSupported && options.cacheModels) ? await tf.io.listModels() : {}; // list all models already in cache // this fails for webview although localStorage is defined\n } catch {\n options.cacheSupported = false;\n }\n modelStats[shortModelName].inCache = (options.cacheSupported && options.cacheModels) && Object.keys(cachedModels).includes(cachedModelName); // is model found in cache\n modelStats[shortModelName].url = modelStats[shortModelName].inCache ? cachedModelName : modelUrl;\n const tfLoadOptions = typeof fetch === 'undefined' ? {} : { fetchFunc: (url: string, init?: RequestInit) => httpHandler(url, init) };\n let model: GraphModel = new tf.GraphModel(modelStats[shortModelName].url, tfLoadOptions) as unknown as GraphModel; // create model prototype and decide if load from cache or from original modelurl\n let loaded = false;\n try {\n // @ts-ignore private function\n model.findIOHandler(); // decide how to actually load a model\n if (options.debug) log('model load handler:', model['handler']);\n } catch (err) {\n log('error finding model i/o handler:', modelUrl, err);\n }\n try {\n // @ts-ignore private property\n const artifacts = await model.handler?.load() || null; // load manifest\n modelStats[shortModelName].sizeFromManifest = artifacts?.weightData?.byteLength || 0;\n if (artifacts) model.loadSync(artifacts); // load weights\n else model = await tf.loadGraphModel(modelStats[shortModelName].inCache ? cachedModelName : modelUrl, tfLoadOptions) as unknown as GraphModel;\n // @ts-ignore private property\n modelStats[shortModelName].sizeLoadedWeights = model.artifacts?.weightData?.byteLength || 0;\n if (options.verbose) log('load:', { model: shortModelName, url: model['modelUrl'], bytes: modelStats[shortModelName].sizeLoadedWeights });\n loaded = true;\n } catch (err) {\n log('error loading model:', modelUrl, err);\n }\n if (loaded && options.cacheModels && options.cacheSupported && !modelStats[shortModelName].inCache) { // save model to cache\n try {\n const saveResult = await model.save(cachedModelName);\n if (options.debug) log('model saved:', cachedModelName, saveResult);\n } catch (err) {\n log('error saving model:', modelUrl, err);\n }\n }\n return model;\n}\n", "{\n \"name\": \"@vladmandic/human\",\n \"version\": \"3.2.1\",\n \"description\": \"Human: AI-powered 3D Face Detection & Rotation Tracking, Face Description & Recognition, Body Pose Tracking, 3D Hand & Finger Tracking, Iris Analysis, Age & Gender & Emotion Prediction, Gesture Recognition\",\n \"sideEffects\": false,\n \"main\": \"dist/human.node.js\",\n \"module\": \"dist/human.esm.js\",\n \"browser\": \"dist/human.esm.js\",\n \"types\": \"types/human.d.ts\",\n \"exports\": {\n \"node\": {\n \"require\": \"./dist/human.node.js\",\n \"import\": \"./dist/human.node.js\",\n \"module\": \"./dist/human.node.js\"\n },\n \"require\": \"./dist/human.node.js\",\n \"import\": \"./dist/human.esm.js\",\n \"script\": \"./dist/human.js\",\n \"module\": \"./dist/human.esm.js\",\n \"types\": \"./types/human.d.ts\",\n \"dist/human\": \"./dist/human.js\",\n \"dist/human.js\": \"./dist/human.js\",\n \"dist/human.esm\": \"./dist/human.esm.js\",\n \"dist/human.esm.js\": \"./dist/human.esm.js\",\n \"dist/human.esm-nobundle\": \"./dist/human.esm-nobundle.js\",\n \"dist/human.esm-nobundle.js\": \"./dist/human.esm-nobundle.js\",\n \"dist/human.node\": \"./dist/human.node.js\",\n \"dist/human.node.js\": \"./dist/human.node.js\",\n \"dist/human.node-wasm\": \"./dist/human.node-wasm.js\",\n \"dist/human.node-wasm.js\": \"./dist/human.node-wasm.js\",\n \"dist/human.node-gpu\": \"./dist/human.node-gpu.js\",\n \"dist/human.node-gpu.js\": \"./dist/human.node-gpu.js\"\n },\n \"author\": \"Vladimir Mandic \",\n \"bugs\": {\n \"url\": \"https://github.com/vladmandic/human/issues\"\n },\n \"homepage\": \"https://vladmandic.github.io/human/demo/index.html\",\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=14.0.0\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/vladmandic/human.git\"\n },\n \"scripts\": {\n \"start\": \"node --no-warnings demo/nodejs/node.js\",\n \"dev\": \"build --profile development\",\n \"clean\": \"build --profile clean\",\n \"build\": \"rimraf test/build.log && node build.js\",\n \"test\": \"node --no-warnings --unhandled-rejections=strict --trace-uncaught test/node.js\",\n \"lint\": \"eslint *.json *.js src demo test models wiki\",\n \"scan\": \"npx auditjs@latest ossi --dev --quiet\"\n },\n \"keywords\": [\n \"human\",\n \"human-library\",\n \"face-detection\",\n \"faceid\",\n \"face-geometry\",\n \"face-embedding\",\n \"face-recognition\",\n \"face-description\",\n \"face-matching\",\n \"body-tracking\",\n \"body-segmentation\",\n \"hand-tracking\",\n \"iris-tracking\",\n \"age-estimation\",\n \"emotion-detection\",\n \"gender-prediction\",\n \"gesture-recognition\",\n \"gaze-tracking\",\n \"age-gender\",\n \"tensorflowjs\",\n \"tfjs\",\n \"tensorflow\"\n ],\n \"devDependencies\": {\n \"@html-eslint/eslint-plugin\": \"^0.21.0\",\n \"@html-eslint/parser\": \"^0.21.0\",\n \"@microsoft/api-extractor\": \"^7.40.1\",\n \"@tensorflow/tfjs-backend-cpu\": \"^4.17.0\",\n \"@tensorflow/tfjs-backend-wasm\": \"^4.17.0\",\n \"@tensorflow/tfjs-backend-webgl\": \"^4.17.0\",\n \"@tensorflow/tfjs-backend-webgpu\": \"4.14.0\",\n \"@tensorflow/tfjs-converter\": \"^4.17.0\",\n \"@tensorflow/tfjs-core\": \"^4.17.0\",\n \"@tensorflow/tfjs-data\": \"^4.17.0\",\n \"@tensorflow/tfjs-layers\": \"^4.17.0\",\n \"@tensorflow/tfjs-node\": \"^4.17.0\",\n \"@tensorflow/tfjs-node-gpu\": \"^4.17.0\",\n \"@types/node\": \"^20.11.19\",\n \"@types/offscreencanvas\": \"^2019.7.3\",\n \"@typescript-eslint/eslint-plugin\": \"^6.21.0\",\n \"@typescript-eslint/parser\": \"^6.21.0\",\n \"@vladmandic/build\": \"^0.9.3\",\n \"@vladmandic/pilogger\": \"^0.4.9\",\n \"@vladmandic/tfjs\": \"github:vladmandic/tfjs\",\n \"canvas\": \"^2.11.2\",\n \"esbuild\": \"^0.19.12\",\n \"eslint\": \"8.55.0\",\n \"eslint-config-airbnb-base\": \"^15.0.0\",\n \"eslint-plugin-html\": \"^7.1.0\",\n \"eslint-plugin-import\": \"^2.29.1\",\n \"eslint-plugin-json\": \"^3.1.0\",\n \"eslint-plugin-markdown\": \"^3.0.1\",\n \"eslint-plugin-node\": \"^11.1.0\",\n \"eslint-plugin-promise\": \"^6.1.1\",\n \"rimraf\": \"^5.0.5\",\n \"tslib\": \"^2.6.2\",\n \"typedoc\": \"0.25.4\",\n \"typescript\": \"~5.3.3\"\n }\n}\n", "/** TFJS custom backend registration */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Human } from '../human';\nimport { log } from '../util/util';\nimport * as image from '../image/image';\nimport type { AnyCanvas } from '../exports';\n\nexport const config = {\n name: 'humangl',\n priority: 999,\n canvas: null as null | AnyCanvas,\n gl: null as null | WebGL2RenderingContext,\n extensions: [] as string[] | null,\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, // default=true\n desynchronized: true, // default=undefined\n },\n};\n\nfunction extensions(): void {\n /*\n https://www.khronos.org/registry/webgl/extensions/\n https://webglreport.com/?v=2\n */\n const gl = config.gl;\n if (!gl) return;\n config.extensions = gl.getSupportedExtensions();\n // gl.getExtension('KHR_parallel_shader_compile');\n}\n\n/**\n * Registers custom WebGL2 backend to be used by Human library\n *\n * @returns void\n */\nexport function register(instance: Human): void {\n // force backend reload if gl context is not valid\n if (instance.config.backend !== 'humangl') return;\n if ((config.name in tf.engine().registry) && !config?.gl?.getParameter(config.gl.VERSION)) {\n log('humangl error: backend invalid context');\n instance.models.reset();\n /*\n log('resetting humangl backend');\n await tf.removeBackend(config.name);\n await register(instance); // re-register\n */\n }\n if (!tf.findBackend(config.name)) {\n try {\n config.canvas = image.canvas(100, 100);\n } catch (err) {\n log('humangl error: cannot create canvas:', err);\n return;\n }\n try {\n config.gl = config.canvas.getContext('webgl2', config.webGLattr) as WebGL2RenderingContext;\n if (!config.gl) {\n log('humangl error: cannot get webgl context');\n return;\n }\n const glv2 = config.gl.getParameter(config.gl.VERSION).includes('2.0');\n if (!glv2) {\n log('backend override: using fallback webgl backend as webgl 2.0 is not detected');\n instance.config.backend = 'webgl';\n return;\n }\n if (config.canvas) {\n config.canvas.addEventListener('webglcontextlost', (e) => {\n log('humangl error:', e.type);\n log('possible browser memory leak using webgl or conflict with multiple backend registrations');\n instance.emit('error');\n throw new Error('backend error: webgl context lost');\n });\n config.canvas.addEventListener('webglcontextrestored', (e) => {\n log('humangl error: context restored:', e);\n });\n config.canvas.addEventListener('webglcontextcreationerror', (e) => {\n log('humangl error: context create:', e);\n });\n }\n } catch (err) {\n log('humangl error: cannot get webgl context:', err);\n return;\n }\n try {\n tf.setWebGLContext(2, config.gl);\n } catch (err) {\n log('humangl error: cannot set webgl context:', err);\n return;\n }\n try {\n const ctx = new tf.GPGPUContext(config.gl);\n // @ts-ignore uncompatible kernelMs timing info\n tf.registerBackend(config.name, () => new tf.MathBackendWebGL(ctx), config.priority);\n } catch (err) {\n log('humangl 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('humangl error: cannot update webgl backend registration:', err);\n return;\n }\n try {\n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_VERSION) tf.env().set('WEBGL_VERSION', 2);\n } catch (err) {\n log('humangl error: cannot set WebGL backend flags:', err);\n return;\n }\n extensions();\n const backend = tf.backend();\n const current = typeof backend['gpgpu'] !== 'undefined' ? backend['getGPGPUContext']().gl : null;\n if (current) {\n if (instance.config.debug) log('humangl backend registered:', { webgl: current.getParameter(current.VERSION) as string, renderer: current.getParameter(current.RENDERER) as string });\n } else {\n log('humangl error: no current gl context:', current, config.gl);\n }\n }\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport type { Tensor } from './types';\n\nexport const constants: Record = {\n tf255: 255.0,\n tf1: 1.0,\n tf2: 2.0,\n tf05: 0.5,\n tf127: 127.5,\n rgb: [0.2989, 0.5870, 0.1140],\n};\n\nexport function init() {\n constants.tf255 = tf.scalar(255.0, 'float32');\n constants.tf1 = tf.scalar(1.0, 'float32');\n constants.tf2 = tf.scalar(2.0, 'float32');\n constants.tf05 = tf.scalar(0.5, 'float32');\n constants.tf127 = tf.scalar(127.5, 'float32');\n constants.rgb = tf.tensor1d([0.2989, 0.5870, 0.1140], 'float32'); // factors for red/green/blue colors when converting to grayscale\n}\n", "/** TFJS backend initialization and customization */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Human, Config, BackendEnum } from '../human';\nimport { log, now } from '../util/util';\nimport { env } from '../util/env';\nimport * as humangl from './humangl';\nimport * as constants from './constants';\nimport type { TensorInfo } from './types';\n\nexport async function getBestBackend(): Promise {\n await env.updateBackend(); // update env on backend init\n if (env.tensorflow?.version) return 'tensorflow';\n if (env.webgpu.supported && env.webgpu.backend) return 'webgpu';\n if (env.webgl.supported && env.webgl.backend) return 'webgl';\n if (env.wasm.supported && env.wasm.backend) return 'wasm';\n return 'cpu';\n}\n\nfunction registerCustomOps(config: Config) {\n const newKernels: string[] = [];\n if (!env.kernels.includes('mod')) {\n const kernelMod = {\n kernelName: 'Mod',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => tf.sub(op.inputs.a, tf.mul(tf.div(op.inputs.a, op.inputs.b), op.inputs.b))),\n };\n tf.registerKernel(kernelMod);\n env.kernels.push('mod');\n newKernels.push('mod');\n }\n if (!env.kernels.includes('floormod')) {\n const kernelFloorMod = {\n kernelName: 'FloorMod',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => tf.add(tf.mul(tf.floorDiv(op.inputs.a, op.inputs.b), op.inputs.b), tf.mod(op.inputs.a, op.inputs.b))),\n };\n tf.registerKernel(kernelFloorMod);\n env.kernels.push('floormod');\n newKernels.push('floormod');\n }\n /*\n if (!env.kernels.includes('atan2') && config.softwareKernels) {\n const kernelAtan2 = {\n kernelName: 'Atan2',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => {\n const backend = tf.getBackend();\n tf.setBackend('cpu');\n const t = tf.atan2(op.inputs.a, op.inputs.b);\n tf.setBackend(backend);\n return t;\n }),\n };\n if (config.debug) log('registered kernel:', 'atan2');\n log('registered kernel:', 'atan2');\n tf.registerKernel(kernelAtan2);\n env.kernels.push('atan2');\n newKernels.push('atan2');\n }\n */\n if (!env.kernels.includes('rotatewithoffset') && config.softwareKernels) {\n const kernelRotateWithOffset = {\n kernelName: 'RotateWithOffset',\n backendName: tf.getBackend(),\n kernelFunc: (op) => tf.tidy(() => {\n const backend = tf.getBackend();\n tf.setBackend('cpu'); // eslint-disable-line @typescript-eslint/no-floating-promises\n const t = tf.image.rotateWithOffset(op.inputs.image, op.attrs.radians, op.attrs.fillValue, op.attrs.center);\n tf.setBackend(backend); // eslint-disable-line @typescript-eslint/no-floating-promises\n return t;\n }),\n };\n tf.registerKernel(kernelRotateWithOffset);\n env.kernels.push('rotatewithoffset');\n newKernels.push('rotatewithoffset');\n }\n if ((newKernels.length > 0) && config.debug) log('registered kernels:', newKernels);\n}\n\nlet defaultFlags: Record = {};\n\nexport async function check(instance: Human, force = false) {\n instance.state = 'backend';\n if (instance.config.backend?.length === 0) instance.config.backend = await getBestBackend();\n if (force || env.initial || (instance.config.backend && (instance.config.backend.length > 0) && (tf.getBackend() !== instance.config.backend))) {\n const timeStamp = now();\n\n if (instance.config.backend && instance.config.backend.length > 0) {\n // detect web worker\n // @ts-ignore ignore missing type for WorkerGlobalScope as that is the point\n if (typeof window === 'undefined' && typeof WorkerGlobalScope !== 'undefined' && instance.config.debug) {\n if (instance.config.debug) log('running inside web worker');\n }\n\n if (typeof navigator !== 'undefined' && navigator?.userAgent?.toLowerCase().includes('electron')) {\n if (instance.config.debug) log('running inside electron');\n }\n\n // check available backends\n let available = Object.keys(tf.engine().registryFactory as Record);\n if (instance.config.backend === 'humangl' && !available.includes('humangl')) {\n humangl.register(instance);\n available = Object.keys(tf.engine().registryFactory as Record);\n }\n if (instance.config.debug) log('available backends:', available);\n\n // force browser vs node backend\n if (env.browser && !env.node && (instance.config.backend === 'tensorflow') && available.includes('webgl')) {\n if (instance.config.debug) log('override: backend set to tensorflow while running in browser');\n instance.config.backend = 'webgl';\n }\n if (env.node && !env.browser && (instance.config.backend === 'webgl' || instance.config.backend === 'humangl') && available.includes('tensorflow')) {\n if (instance.config.debug) log(`override: backend set to ${instance.config.backend} while running in nodejs`);\n instance.config.backend = 'tensorflow';\n }\n\n // handle webgpu\n if (env.browser && instance.config.backend === 'webgpu') {\n if (typeof navigator === 'undefined' || typeof navigator.gpu === 'undefined') {\n log('override: backend set to webgpu but browser does not support webgpu');\n instance.config.backend = 'webgl';\n } else {\n const adapter = await navigator.gpu.requestAdapter();\n if (instance.config.debug) log('enumerated webgpu adapter:', adapter);\n if (!adapter) {\n log('override: backend set to webgpu but browser reports no available gpu');\n instance.config.backend = 'webgl';\n } else {\n // @ts-ignore requestAdapterInfo is not in tslib\n const adapterInfo = 'requestAdapterInfo' in adapter ? await adapter.requestAdapterInfo() : undefined;\n // if (adapter.features) adapter.features.forEach((feature) => log('webgpu features:', feature));\n log('webgpu adapter info:', adapterInfo);\n }\n }\n }\n\n if (!available.includes(instance.config.backend)) {\n log(`error: backend ${instance.config.backend} not found in registry`);\n instance.config.backend = env.node ? 'tensorflow' : 'webgl';\n if (instance.config.debug) log(`override: setting backend ${instance.config.backend}`);\n }\n\n if (instance.config.debug) log('setting backend:', [instance.config.backend]);\n\n // customize wasm\n if (instance.config.backend === 'wasm') {\n // @ts-ignore private property\n if (tf.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY) tf.env().set('CANVAS2D_WILL_READ_FREQUENTLY', true);\n if (instance.config.debug) log('wasm path:', instance.config.wasmPath);\n if (typeof tf.setWasmPaths !== 'undefined') tf.setWasmPaths(instance.config.wasmPath, instance.config.wasmPlatformFetch);\n else throw new Error('backend error: attempting to use wasm backend but wasm path is not set');\n let mt = false;\n let simd = false;\n try {\n mt = await tf.env().getAsync('WASM_HAS_MULTITHREAD_SUPPORT') as boolean;\n simd = await tf.env().getAsync('WASM_HAS_SIMD_SUPPORT') as boolean;\n if (instance.config.debug) log(`wasm execution: ${simd ? 'simd' : 'no simd'} ${mt ? 'multithreaded' : 'singlethreaded'}`);\n if (instance.config.debug && !simd) log('warning: wasm simd support is not enabled');\n } catch {\n log('wasm detection failed');\n }\n }\n\n try {\n await tf.setBackend(instance.config.backend);\n await tf.ready();\n } catch (err) {\n log('error: cannot set backend:', instance.config.backend, err);\n return false;\n }\n // @ts-ignore private property\n if (instance.config.debug) defaultFlags = JSON.parse(JSON.stringify(tf.env().flags));\n }\n\n // customize humangl\n if (tf.getBackend() === 'humangl' || tf.getBackend() === 'webgl') {\n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', true); // default=false \n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_EXP_CONV) tf.env().set('WEBGL_EXP_CONV', true); // default=false \n // if (tf.env().flagRegistry['WEBGL_PACK_DEPTHWISECONV']) tf.env().set('WEBGL_PACK_DEPTHWISECONV', false); // default=true \n // if (tf.env().flagRegistry.USE_SETTIMEOUTCUSTOM) tf.env().set('USE_SETTIMEOUTCUSTOM', true); // default=false \n // if (tf.env().flagRegistry.CPU_HANDOFF_SIZE_THRESHOLD) tf.env().set('CPU_HANDOFF_SIZE_THRESHOLD', 1024); // default=1000\n // if (tf.env().flagRegistry['WEBGL_FORCE_F16_TEXTURES'] && !instance.config.object.enabled) tf.env().set('WEBGL_FORCE_F16_TEXTURES', true); // safe to use 16bit precision\n if (instance.config.debug && typeof instance.config.deallocate !== 'undefined' && instance.config.deallocate) { // hidden param\n log('changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:', true);\n tf.env().set('WEBGL_DELETE_TEXTURE_THRESHOLD', 0);\n }\n }\n\n // customize webgpu\n if (tf.getBackend() === 'webgpu') {\n // if (tf.env().flagRegistry['WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD']) tf.env().set('WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD', 512);\n // if (tf.env().flagRegistry['WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE']) tf.env().set('WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE', 0);\n // if (tf.env().flagRegistry['WEBGPU_CPU_FORWARD']) tf.env().set('WEBGPU_CPU_FORWARD', true);\n }\n\n if (instance.config.debug) {\n // @ts-ignore private property\n const newFlags = tf.env().flags;\n const updatedFlags = {};\n for (const key of Object.keys(newFlags)) {\n if (defaultFlags[key] === newFlags[key]) continue;\n updatedFlags[key] = newFlags[key];\n }\n if (instance.config.debug && Object.keys(updatedFlags).length > 0) log('backend:', tf.getBackend(), 'flags:', updatedFlags);\n }\n\n if (instance.config.flags && Object.keys(instance.config.flags).length > 0) {\n if (instance.config.debug) log('flags:', instance.config['flags']);\n for (const [key, val] of Object.entries(instance.config.flags)) {\n tf.env().set(key, val as number | boolean);\n }\n }\n\n tf.enableProdMode();\n constants.init();\n instance.performance.initBackend = Math.trunc(now() - timeStamp);\n instance.config.backend = tf.getBackend() as BackendEnum;\n await env.updateBackend(); // update env on backend init\n registerCustomOps(instance.config);\n // await env.updateBackend(); // update env on backend init\n // env.initial = false;\n }\n return true;\n}\n\n// register fake missing tfjs ops\nexport function fakeOps(kernelNames: string[], config) {\n // if (config.debug) log('registerKernel:', kernelNames);\n for (const kernelName of kernelNames) {\n const kernelConfig = {\n kernelName,\n backendName: config.backend,\n kernelFunc: (param): TensorInfo => {\n if (config.debug) log('kernelFunc', kernelName, config.backend, param);\n return param?.inputs?.info as TensorInfo;\n },\n // setupFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n // disposeFunc: () => { if (config.debug) log('kernelFunc', kernelName, config.backend); },\n };\n tf.registerKernel(kernelConfig);\n }\n env.kernels = tf.getKernelsForBackend(tf.getBackend()).map((kernel) => kernel.kernelName.toLowerCase()); // re-scan registered ops\n}\n", "/**\n * Module that implements helper draw functions, exposed as human.draw\n */\n\nimport { mergeDeep, now } from '../util/util';\nimport { env } from '../util/env';\nimport { getCanvasContext, rect } from './primitives';\nimport { options } from './options';\nimport { face } from './face';\nimport { body } from './body';\nimport { hand } from './hand';\nimport { object } from './object';\nimport { gesture } from './gesture';\nimport { defaultLabels } from './labels';\nimport type { Result, PersonResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\nlet drawTime = 0;\n\nexport { options } from './options';\nexport { face } from './face';\nexport { body } from './body';\nexport { hand } from './hand';\nexport { object } from './object';\nexport { gesture } from './gesture';\n\n/** draw combined person results instead of individual detection result objects */\nexport function person(inCanvas: AnyCanvas, result: PersonResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.lineJoin = 'round';\n ctx.font = localOptions.font;\n\n for (let i = 0; i < result.length; i++) {\n if (localOptions.drawBoxes) {\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\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 const label = `person #${i}`;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(label, 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(label, result[i].box[0] + 2, 0 + result[i].box[1] + localOptions.lineHeight, result[i].box[2]);\n }\n ctx.stroke();\n }\n }\n}\n\n/** draw processed canvas */\nexport function canvas(input: AnyCanvas | HTMLImageElement | HTMLVideoElement, output: AnyCanvas) {\n if (!input || !output) return;\n const ctx = getCanvasContext(output) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.drawImage(input, 0, 0);\n}\n\n/** meta-function that performs draw for: canvas, face, body, hand */\nexport async function all(inCanvas: AnyCanvas, result: Result, drawOptions?: Partial) {\n if (!result?.performance || !inCanvas) return null;\n const timeStamp = now();\n const localOptions = mergeDeep(options, drawOptions);\n const promise = Promise.all([\n face(inCanvas, result.face, localOptions),\n body(inCanvas, result.body, localOptions),\n hand(inCanvas, result.hand, localOptions),\n object(inCanvas, result.object, localOptions),\n gesture(inCanvas, result.gesture, localOptions), // gestures do not have buffering\n // person(inCanvas, result.persons, localOptions); // already included above\n ]);\n drawTime = env.perfadd ? drawTime + Math.round(now() - timeStamp) : Math.round(now() - timeStamp);\n result.performance.draw = drawTime;\n return promise;\n}\n\n/** sets default label templates for face/body/hand/object/gestures */\nexport function init() {\n options.faceLabels = defaultLabels.face;\n options.bodyLabels = defaultLabels.body;\n options.bodyPartLabels = defaultLabels.bodyPart;\n options.handLabels = defaultLabels.hand;\n options.fingerLabels = defaultLabels.finger;\n options.objectLabels = defaultLabels.object;\n options.gestureLabels = defaultLabels.gesture;\n}\n", "import { log } from '../util/util';\nimport type { AnyCanvas } from '../exports';\nimport type { Point } from '../result';\nimport type { DrawOptions } from './options';\n\nexport const getCanvasContext = (input: AnyCanvas) => {\n if (!input) log('draw error: invalid canvas');\n else if (!input.getContext) log('draw error: canvas context not defined');\n else {\n const ctx = input.getContext('2d', { willReadFrequently: true });\n if (!ctx) log('draw error: cannot get canvas context');\n else return ctx;\n }\n return null;\n};\n\nexport const rad2deg = (theta: number) => Math.round((theta * 180) / Math.PI);\n\nexport const replace = (str: string, source: string, target: string | number) => str.replace(source, typeof target === 'number' ? target.toFixed(1) : target);\n\nexport const colorDepth = (z: number | undefined, opt: DrawOptions): string => { // performance optimization needed\n if (!opt.useDepth || typeof z === 'undefined') return opt.color;\n const rgb = Uint8ClampedArray.from([127 + (2 * z), 127 - (2 * z), 255]);\n return `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, ${opt.alpha})`;\n};\n\nexport function labels(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, str: string, startX: number, startY: number, localOptions: DrawOptions) {\n const line: string[] = str.replace(/\\[.*\\]/g, '').split('\\n').map((l) => l.trim()); // remove unmatched templates and split into array\n const x = Math.max(0, startX);\n for (let i = line.length - 1; i >= 0; i--) {\n const y = i * localOptions.lineHeight + startY;\n if (localOptions.shadowColor && localOptions.shadowColor !== '') {\n ctx.fillStyle = localOptions.shadowColor;\n ctx.fillText(line[i], x + 5, y + 16);\n }\n ctx.fillStyle = localOptions.labelColor;\n ctx.fillText(line[i], x + 4, y + 15);\n }\n}\n\nexport function point(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number, z: number | undefined, localOptions: DrawOptions) {\n ctx.fillStyle = colorDepth(z, localOptions);\n ctx.beginPath();\n ctx.arc(x, y, localOptions.pointSize, 0, 2 * Math.PI);\n ctx.fill();\n}\n\nexport function rect(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number, width: number, height: number, localOptions: DrawOptions) {\n ctx.beginPath();\n ctx.lineWidth = localOptions.lineWidth;\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.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\nexport function lines(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, points: Point[], localOptions: DrawOptions) {\n if (points.length < 2) return;\n ctx.beginPath();\n ctx.moveTo(points[0][0], points[0][1]);\n for (const pt of points) {\n ctx.strokeStyle = colorDepth(pt[2] || 0, localOptions);\n ctx.lineTo(Math.trunc(pt[0]), Math.trunc(pt[1]));\n }\n ctx.stroke();\n if (localOptions.fillPolygons) {\n ctx.closePath();\n ctx.fill();\n }\n}\n\nexport function curves(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, points: Point[], localOptions: DrawOptions) {\n if (points.length < 2) return;\n ctx.lineWidth = localOptions.lineWidth;\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 function arrow(ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, from: Point, to: Point, radius = 5) {\n let angle;\n let x;\n let y;\n ctx.beginPath();\n ctx.moveTo(from[0], from[1]);\n ctx.lineTo(to[0], to[1]);\n angle = Math.atan2(to[1] - from[1], to[0] - from[0]);\n x = radius * Math.cos(angle) + to[0];\n y = radius * Math.sin(angle) + to[1];\n ctx.moveTo(x, y);\n angle += (1.0 / 3.0) * (2 * Math.PI);\n x = radius * Math.cos(angle) + to[0];\n y = radius * Math.sin(angle) + to[1];\n ctx.lineTo(x, y);\n angle += (1.0 / 3.0) * (2 * Math.PI);\n x = radius * Math.cos(angle) + to[0];\n y = radius * Math.sin(angle) + to[1];\n ctx.lineTo(x, y);\n ctx.closePath();\n ctx.stroke();\n ctx.fill();\n}\n", "/** Draw Options\n * - Accessed via `human.draw.options` or provided per each draw method as the drawOptions optional parameter\n */\n\nexport interface DrawOptions {\n /** draw line color */\n color: string,\n /** alpha value used for lines */\n alpha: number,\n /** label color */\n labelColor: string,\n /** label shadow color */\n shadowColor: string,\n /** label font */\n font: string,\n /** line spacing between labels */\n lineHeight: number,\n /** line width for drawn lines */\n lineWidth: number,\n /** size of drawn points */\n pointSize: number,\n /** draw rounded boxes by n pixels */\n roundRect: number,\n /** should points be drawn? */\n drawPoints: boolean,\n /** should labels be drawn? */\n drawLabels: boolean,\n /** should face attention keypoints be highlighted */\n drawAttention: boolean;\n /** should detected gestures be drawn? */\n drawGestures: boolean,\n /** should draw boxes around detection results? */\n drawBoxes: boolean,\n /** should draw polygons from detection points? */\n drawPolygons: boolean,\n /** should draw gaze arrows? */\n drawGaze: boolean,\n /** should fill polygons? */\n fillPolygons: boolean,\n /** use z-coordinate when available */\n useDepth: boolean,\n /** should lines be curved? */\n useCurves: boolean,\n /** string template for face labels */\n faceLabels: string,\n /** string template for body labels */\n bodyLabels: string,\n /** string template for body part labels */\n bodyPartLabels: string,\n /** string template for hand labels */\n handLabels: string,\n /** string template for hand labels */\n fingerLabels: string,\n /** string template for object labels */\n objectLabels: string,\n /** string template for gesture labels */\n gestureLabels: string,\n}\n\n/** currently set draw options {@link DrawOptions} */\nexport const options: DrawOptions = {\n color: 'rgba(173, 216, 230, 0.6)' as string, // 'lightblue' with light alpha channel\n labelColor: 'rgba(173, 216, 230, 1)' as string, // 'lightblue' with dark alpha channel\n shadowColor: 'black' as string,\n alpha: 0.5 as number,\n font: 'small-caps 16px \"Segoe UI\"' as string,\n lineHeight: 18 as number,\n lineWidth: 4 as number,\n pointSize: 2 as number,\n roundRect: 8 as number,\n drawPoints: false as boolean,\n drawLabels: true as boolean,\n drawBoxes: true as boolean,\n drawAttention: true as boolean,\n drawGestures: true as boolean,\n drawPolygons: true as boolean,\n drawGaze: true as boolean,\n fillPolygons: false as boolean,\n useDepth: true as boolean,\n useCurves: false as boolean,\n faceLabels: '' as string,\n bodyLabels: '' as string,\n bodyPartLabels: '' as string,\n objectLabels: '' as string,\n handLabels: '' as string,\n fingerLabels: '' as string,\n gestureLabels: '' as string,\n};\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nexport const meshAnnotations: Record = {\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], // 11\n // lipsLowerOuter: [146, 91, 181, 84, 17, 314, 405, 321, 375, 291], // 10\n // lipsUpperInner: [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308], // 11\n // lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308], // 11\n lipsUpperOuter: [185, 40, 39, 37, 0, 267, 269, 270, 409],\n lipsLowerOuter: [61, 146, 91, 181, 84, 17, 314, 405, 321, 375, 291],\n lipsUpperInner: [191, 80, 81, 82, 13, 312, 311, 310, 415],\n lipsLowerInner: [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308],\n lipsLowerSemiOuter: [76, 77, 90, 180, 85, 16, 315, 404, 320, 307, 306],\n lipsUpperSemiOuter: [184, 74, 73, 72, 11, 302, 303, 304, 408],\n lipsLowerSemiInner: [62, 96, 89, 179, 86, 15, 316, 403, 319, 325, 292],\n lipsUpperSemiInner: [183, 42, 41, 38, 12, 268, 271, 272, 407],\n rightEyeUpper0: [246, 161, 160, 159, 158, 157, 173], // 7\n rightEyeLower0: [33, 7, 163, 144, 145, 153, 154, 155, 133], // 9\n rightEyeUpper1: [247, 30, 29, 27, 28, 56, 190], // 7\n rightEyeLower1: [130, 25, 110, 24, 23, 22, 26, 112, 243], // 9\n rightEyeUpper2: [113, 225, 224, 223, 222, 221, 189], // 7\n rightEyeLower2: [226, 31, 228, 229, 230, 231, 232, 233, 244], // 9\n rightEyeLower3: [143, 111, 117, 118, 119, 120, 121, 128, 245], // 9\n rightEyebrowUpper: [156, 70, 63, 105, 66, 107, 55, 193], // 8\n rightEyebrowLower: [35, 124, 46, 53, 52, 65], // 6\n rightEyeIris: [473, 474, 475, 476, 477], // 5\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 meshLandmarks: Record = {\n count: 468,\n mouth: 13,\n symmetryLine: [13, meshAnnotations.midwayBetweenEyes[0]],\n};\n\nexport const blazeFaceLandmarks: Record = {\n leftEye: 0,\n rightEye: 1,\n nose: 2,\n mouth: 3,\n leftEar: 4,\n rightEar: 5,\n symmetryLine: [3, 2],\n};\n\nexport const irisIndices: { key: string, indices: number[] }[] = [ // A mapping from facemesh model keypoints to iris model keypoints.\n { key: 'EyeUpper0', indices: [9, 10, 11, 12, 13, 14, 15] }, // 7 x 3d\n { key: 'EyeUpper1', indices: [25, 26, 27, 28, 29, 30, 31] }, // 7 x 3d\n { key: 'EyeUpper2', indices: [41, 42, 43, 44, 45, 46, 47] }, // 7 x 3d\n { key: 'EyeLower0', indices: [0, 1, 2, 3, 4, 5, 6, 7, 8] }, // 7 x 3d\n { key: 'EyeLower1', indices: [16, 17, 18, 19, 20, 21, 22, 23, 24] }, // 9 x 3d\n { key: 'EyeLower2', indices: [32, 33, 34, 35, 36, 37, 38, 39, 40] }, // 9 x 3d\n { key: 'EyeLower3', indices: [54, 55, 56, 57, 58, 59, 60, 61, 62] }, // 9 x 3d\n { key: 'EyebrowUpper', indices: [63, 64, 65, 66, 67, 68, 69, 70] }, // 8 x 3d\n { key: 'EyebrowLower', indices: [48, 49, 50, 51, 52, 53] }, // 6 x 3d\n];\n\nexport const UV468: [number, number][] = [\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: number[] = [\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: number[] = [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: number[] = [\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: number[] = [0, 4, 1, 2, 4, 3, 4, 5, 6];\n\nexport const VTX68: number[] = [\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: number[] = [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: number[] = [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\n// https://github.com/tensorflow/tfjs-models/blob/master/face-landmarks-detection/src/constants.ts\n// https://github.com/google/mediapipe/mediapipe/python/solutions/face_mesh_connections.py\n\ntype PairArray = [number, number][];\n\nfunction connectionsToIndices(connections: PairArray) {\n const indices = connections.map((connection) => connection[0]);\n indices.push(connections[connections.length - 1][1]);\n return indices;\n}\n\nexport const pairsLips: PairArray = [\n [61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314], [314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40], [40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270], [270, 409], [409, 291],\n [78, 95], [95, 88], [88, 178], [178, 87], [87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308], [78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312], [312, 311], [311, 310], [310, 415], [415, 308],\n];\n\nexport const pairsLeftEye: PairArray = [[263, 249], [249, 390], [390, 373], [373, 374], [374, 380], [380, 381], [381, 382], [382, 362], [263, 466], [466, 388], [388, 387], [387, 386], [386, 385], [385, 384], [384, 398], [398, 362]];\n\nexport const pairsLeftEyebrow: PairArray = [[276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]];\n\nexport const pairsLeftIris: PairArray = [[474, 475], [475, 476], [476, 477], [477, 474]];\n\nexport const pairsRightEye: PairArray = [[33, 7], [7, 163], [163, 144], [144, 145], [145, 153], [153, 154], [154, 155], [155, 133], [33, 246], [246, 161], [161, 160], [160, 159], [159, 158], [158, 157], [157, 173], [173, 133]];\n\nexport const pairsRightEyebrow: PairArray = [[46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]];\n\nexport const pairsRightIris: PairArray = [[469, 470], [470, 471], [471, 472], [472, 469]];\n\nexport const pairsFaceContour: PairArray = [\n [10, 338], [338, 297], [297, 332], [332, 284], [284, 251], [251, 389],\n [389, 356], [356, 454], [454, 323], [323, 361], [361, 288], [288, 397],\n [397, 365], [365, 379], [379, 378], [378, 400], [400, 377], [377, 152],\n [152, 148], [148, 176], [176, 149], [149, 150], [150, 136], [136, 172],\n [172, 58], [58, 132], [132, 93], [93, 234], [234, 127], [127, 162],\n [162, 21], [21, 54], [54, 103], [103, 67], [67, 109], [109, 10],\n];\n\nexport const contourKeypoints = {\n lips: connectionsToIndices(pairsLips),\n leftEye: connectionsToIndices(pairsLeftEye),\n leftEyebrow: connectionsToIndices(pairsLeftEyebrow),\n leftIris: connectionsToIndices(pairsLeftIris),\n rightEye: connectionsToIndices(pairsRightEye),\n rightEyebrow: connectionsToIndices(pairsRightEyebrow),\n rightIris: connectionsToIndices(pairsRightIris),\n faceOval: connectionsToIndices(pairsFaceContour),\n};\n\nexport const pairsFaceMesh: PairArray = [\n [127, 34], [34, 139], [139, 127], [11, 0], [0, 37], [37, 11],\n [232, 231], [231, 120], [120, 232], [72, 37], [37, 39], [39, 72],\n [128, 121], [121, 47], [47, 128], [232, 121], [121, 128], [128, 232],\n [104, 69], [69, 67], [67, 104], [175, 171], [171, 148], [148, 175],\n [118, 50], [50, 101], [101, 118], [73, 39], [39, 40], [40, 73],\n [9, 151], [151, 108], [108, 9], [48, 115], [115, 131], [131, 48],\n [194, 204], [204, 211], [211, 194], [74, 40], [40, 185], [185, 74],\n [80, 42], [42, 183], [183, 80], [40, 92], [92, 186], [186, 40],\n [230, 229], [229, 118], [118, 230], [202, 212], [212, 214], [214, 202],\n [83, 18], [18, 17], [17, 83], [76, 61], [61, 146], [146, 76],\n [160, 29], [29, 30], [30, 160], [56, 157], [157, 173], [173, 56],\n [106, 204], [204, 194], [194, 106], [135, 214], [214, 192], [192, 135],\n [203, 165], [165, 98], [98, 203], [21, 71], [71, 68], [68, 21],\n [51, 45], [45, 4], [4, 51], [144, 24], [24, 23], [23, 144],\n [77, 146], [146, 91], [91, 77], [205, 50], [50, 187], [187, 205],\n [201, 200], [200, 18], [18, 201], [91, 106], [106, 182], [182, 91],\n [90, 91], [91, 181], [181, 90], [85, 84], [84, 17], [17, 85],\n [206, 203], [203, 36], [36, 206], [148, 171], [171, 140], [140, 148],\n [92, 40], [40, 39], [39, 92], [193, 189], [189, 244], [244, 193],\n [159, 158], [158, 28], [28, 159], [247, 246], [246, 161], [161, 247],\n [236, 3], [3, 196], [196, 236], [54, 68], [68, 104], [104, 54],\n [193, 168], [168, 8], [8, 193], [117, 228], [228, 31], [31, 117],\n [189, 193], [193, 55], [55, 189], [98, 97], [97, 99], [99, 98],\n [126, 47], [47, 100], [100, 126], [166, 79], [79, 218], [218, 166],\n [155, 154], [154, 26], [26, 155], [209, 49], [49, 131], [131, 209],\n [135, 136], [136, 150], [150, 135], [47, 126], [126, 217], [217, 47],\n [223, 52], [52, 53], [53, 223], [45, 51], [51, 134], [134, 45],\n [211, 170], [170, 140], [140, 211], [67, 69], [69, 108], [108, 67],\n [43, 106], [106, 91], [91, 43], [230, 119], [119, 120], [120, 230],\n [226, 130], [130, 247], [247, 226], [63, 53], [53, 52], [52, 63],\n [238, 20], [20, 242], [242, 238], [46, 70], [70, 156], [156, 46],\n [78, 62], [62, 96], [96, 78], [46, 53], [53, 63], [63, 46],\n [143, 34], [34, 227], [227, 143], [123, 117], [117, 111], [111, 123],\n [44, 125], [125, 19], [19, 44], [236, 134], [134, 51], [51, 236],\n [216, 206], [206, 205], [205, 216], [154, 153], [153, 22], [22, 154],\n [39, 37], [37, 167], [167, 39], [200, 201], [201, 208], [208, 200],\n [36, 142], [142, 100], [100, 36], [57, 212], [212, 202], [202, 57],\n [20, 60], [60, 99], [99, 20], [28, 158], [158, 157], [157, 28],\n [35, 226], [226, 113], [113, 35], [160, 159], [159, 27], [27, 160],\n [204, 202], [202, 210], [210, 204], [113, 225], [225, 46], [46, 113],\n [43, 202], [202, 204], [204, 43], [62, 76], [76, 77], [77, 62],\n [137, 123], [123, 116], [116, 137], [41, 38], [38, 72], [72, 41],\n [203, 129], [129, 142], [142, 203], [64, 98], [98, 240], [240, 64],\n [49, 102], [102, 64], [64, 49], [41, 73], [73, 74], [74, 41],\n [212, 216], [216, 207], [207, 212], [42, 74], [74, 184], [184, 42],\n [169, 170], [170, 211], [211, 169], [170, 149], [149, 176], [176, 170],\n [105, 66], [66, 69], [69, 105], [122, 6], [6, 168], [168, 122],\n [123, 147], [147, 187], [187, 123], [96, 77], [77, 90], [90, 96],\n [65, 55], [55, 107], [107, 65], [89, 90], [90, 180], [180, 89],\n [101, 100], [100, 120], [120, 101], [63, 105], [105, 104], [104, 63],\n [93, 137], [137, 227], [227, 93], [15, 86], [86, 85], [85, 15],\n [129, 102], [102, 49], [49, 129], [14, 87], [87, 86], [86, 14],\n [55, 8], [8, 9], [9, 55], [100, 47], [47, 121], [121, 100],\n [145, 23], [23, 22], [22, 145], [88, 89], [89, 179], [179, 88],\n [6, 122], [122, 196], [196, 6], [88, 95], [95, 96], [96, 88],\n [138, 172], [172, 136], [136, 138], [215, 58], [58, 172], [172, 215],\n [115, 48], [48, 219], [219, 115], [42, 80], [80, 81], [81, 42],\n [195, 3], [3, 51], [51, 195], [43, 146], [146, 61], [61, 43],\n [171, 175], [175, 199], [199, 171], [81, 82], [82, 38], [38, 81],\n [53, 46], [46, 225], [225, 53], [144, 163], [163, 110], [110, 144],\n [52, 65], [65, 66], [66, 52], [229, 228], [228, 117], [117, 229],\n [34, 127], [127, 234], [234, 34], [107, 108], [108, 69], [69, 107],\n [109, 108], [108, 151], [151, 109], [48, 64], [64, 235], [235, 48],\n [62, 78], [78, 191], [191, 62], [129, 209], [209, 126], [126, 129],\n [111, 35], [35, 143], [143, 111], [117, 123], [123, 50], [50, 117],\n [222, 65], [65, 52], [52, 222], [19, 125], [125, 141], [141, 19],\n [221, 55], [55, 65], [65, 221], [3, 195], [195, 197], [197, 3],\n [25, 7], [7, 33], [33, 25], [220, 237], [237, 44], [44, 220],\n [70, 71], [71, 139], [139, 70], [122, 193], [193, 245], [245, 122],\n [247, 130], [130, 33], [33, 247], [71, 21], [21, 162], [162, 71],\n [170, 169], [169, 150], [150, 170], [188, 174], [174, 196], [196, 188],\n [216, 186], [186, 92], [92, 216], [2, 97], [97, 167], [167, 2],\n [141, 125], [125, 241], [241, 141], [164, 167], [167, 37], [37, 164],\n [72, 38], [38, 12], [12, 72], [38, 82], [82, 13], [13, 38],\n [63, 68], [68, 71], [71, 63], [226, 35], [35, 111], [111, 226],\n [101, 50], [50, 205], [205, 101], [206, 92], [92, 165], [165, 206],\n [209, 198], [198, 217], [217, 209], [165, 167], [167, 97], [97, 165],\n [220, 115], [115, 218], [218, 220], [133, 112], [112, 243], [243, 133],\n [239, 238], [238, 241], [241, 239], [214, 135], [135, 169], [169, 214],\n [190, 173], [173, 133], [133, 190], [171, 208], [208, 32], [32, 171],\n [125, 44], [44, 237], [237, 125], [86, 87], [87, 178], [178, 86],\n [85, 86], [86, 179], [179, 85], [84, 85], [85, 180], [180, 84],\n [83, 84], [84, 181], [181, 83], [201, 83], [83, 182], [182, 201],\n [137, 93], [93, 132], [132, 137], [76, 62], [62, 183], [183, 76],\n [61, 76], [76, 184], [184, 61], [57, 61], [61, 185], [185, 57],\n [212, 57], [57, 186], [186, 212], [214, 207], [207, 187], [187, 214],\n [34, 143], [143, 156], [156, 34], [79, 239], [239, 237], [237, 79],\n [123, 137], [137, 177], [177, 123], [44, 1], [1, 4], [4, 44],\n [201, 194], [194, 32], [32, 201], [64, 102], [102, 129], [129, 64],\n [213, 215], [215, 138], [138, 213], [59, 166], [166, 219], [219, 59],\n [242, 99], [99, 97], [97, 242], [2, 94], [94, 141], [141, 2],\n [75, 59], [59, 235], [235, 75], [24, 110], [110, 228], [228, 24],\n [25, 130], [130, 226], [226, 25], [23, 24], [24, 229], [229, 23],\n [22, 23], [23, 230], [230, 22], [26, 22], [22, 231], [231, 26],\n [112, 26], [26, 232], [232, 112], [189, 190], [190, 243], [243, 189],\n [221, 56], [56, 190], [190, 221], [28, 56], [56, 221], [221, 28],\n [27, 28], [28, 222], [222, 27], [29, 27], [27, 223], [223, 29],\n [30, 29], [29, 224], [224, 30], [247, 30], [30, 225], [225, 247],\n [238, 79], [79, 20], [20, 238], [166, 59], [59, 75], [75, 166],\n [60, 75], [75, 240], [240, 60], [147, 177], [177, 215], [215, 147],\n [20, 79], [79, 166], [166, 20], [187, 147], [147, 213], [213, 187],\n [112, 233], [233, 244], [244, 112], [233, 128], [128, 245], [245, 233],\n [128, 114], [114, 188], [188, 128], [114, 217], [217, 174], [174, 114],\n [131, 115], [115, 220], [220, 131], [217, 198], [198, 236], [236, 217],\n [198, 131], [131, 134], [134, 198], [177, 132], [132, 58], [58, 177],\n [143, 35], [35, 124], [124, 143], [110, 163], [163, 7], [7, 110],\n [228, 110], [110, 25], [25, 228], [356, 389], [389, 368], [368, 356],\n [11, 302], [302, 267], [267, 11], [452, 350], [350, 349], [349, 452],\n [302, 303], [303, 269], [269, 302], [357, 343], [343, 277], [277, 357],\n [452, 453], [453, 357], [357, 452], [333, 332], [332, 297], [297, 333],\n [175, 152], [152, 377], [377, 175], [347, 348], [348, 330], [330, 347],\n [303, 304], [304, 270], [270, 303], [9, 336], [336, 337], [337, 9],\n [278, 279], [279, 360], [360, 278], [418, 262], [262, 431], [431, 418],\n [304, 408], [408, 409], [409, 304], [310, 415], [415, 407], [407, 310],\n [270, 409], [409, 410], [410, 270], [450, 348], [348, 347], [347, 450],\n [422, 430], [430, 434], [434, 422], [313, 314], [314, 17], [17, 313],\n [306, 307], [307, 375], [375, 306], [387, 388], [388, 260], [260, 387],\n [286, 414], [414, 398], [398, 286], [335, 406], [406, 418], [418, 335],\n [364, 367], [367, 416], [416, 364], [423, 358], [358, 327], [327, 423],\n [251, 284], [284, 298], [298, 251], [281, 5], [5, 4], [4, 281],\n [373, 374], [374, 253], [253, 373], [307, 320], [320, 321], [321, 307],\n [425, 427], [427, 411], [411, 425], [421, 313], [313, 18], [18, 421],\n [321, 405], [405, 406], [406, 321], [320, 404], [404, 405], [405, 320],\n [315, 16], [16, 17], [17, 315], [426, 425], [425, 266], [266, 426],\n [377, 400], [400, 369], [369, 377], [322, 391], [391, 269], [269, 322],\n [417, 465], [465, 464], [464, 417], [386, 257], [257, 258], [258, 386],\n [466, 260], [260, 388], [388, 466], [456, 399], [399, 419], [419, 456],\n [284, 332], [332, 333], [333, 284], [417, 285], [285, 8], [8, 417],\n [346, 340], [340, 261], [261, 346], [413, 441], [441, 285], [285, 413],\n [327, 460], [460, 328], [328, 327], [355, 371], [371, 329], [329, 355],\n [392, 439], [439, 438], [438, 392], [382, 341], [341, 256], [256, 382],\n [429, 420], [420, 360], [360, 429], [364, 394], [394, 379], [379, 364],\n [277, 343], [343, 437], [437, 277], [443, 444], [444, 283], [283, 443],\n [275, 440], [440, 363], [363, 275], [431, 262], [262, 369], [369, 431],\n [297, 338], [338, 337], [337, 297], [273, 375], [375, 321], [321, 273],\n [450, 451], [451, 349], [349, 450], [446, 342], [342, 467], [467, 446],\n [293, 334], [334, 282], [282, 293], [458, 461], [461, 462], [462, 458],\n [276, 353], [353, 383], [383, 276], [308, 324], [324, 325], [325, 308],\n [276, 300], [300, 293], [293, 276], [372, 345], [345, 447], [447, 372],\n [352, 345], [345, 340], [340, 352], [274, 1], [1, 19], [19, 274],\n [456, 248], [248, 281], [281, 456], [436, 427], [427, 425], [425, 436],\n [381, 256], [256, 252], [252, 381], [269, 391], [391, 393], [393, 269],\n [200, 199], [199, 428], [428, 200], [266, 330], [330, 329], [329, 266],\n [287, 273], [273, 422], [422, 287], [250, 462], [462, 328], [328, 250],\n [258, 286], [286, 384], [384, 258], [265, 353], [353, 342], [342, 265],\n [387, 259], [259, 257], [257, 387], [424, 431], [431, 430], [430, 424],\n [342, 353], [353, 276], [276, 342], [273, 335], [335, 424], [424, 273],\n [292, 325], [325, 307], [307, 292], [366, 447], [447, 345], [345, 366],\n [271, 303], [303, 302], [302, 271], [423, 266], [266, 371], [371, 423],\n [294, 455], [455, 460], [460, 294], [279, 278], [278, 294], [294, 279],\n [271, 272], [272, 304], [304, 271], [432, 434], [434, 427], [427, 432],\n [272, 407], [407, 408], [408, 272], [394, 430], [430, 431], [431, 394],\n [395, 369], [369, 400], [400, 395], [334, 333], [333, 299], [299, 334],\n [351, 417], [417, 168], [168, 351], [352, 280], [280, 411], [411, 352],\n [325, 319], [319, 320], [320, 325], [295, 296], [296, 336], [336, 295],\n [319, 403], [403, 404], [404, 319], [330, 348], [348, 349], [349, 330],\n [293, 298], [298, 333], [333, 293], [323, 454], [454, 447], [447, 323],\n [15, 16], [16, 315], [315, 15], [358, 429], [429, 279], [279, 358],\n [14, 15], [15, 316], [316, 14], [285, 336], [336, 9], [9, 285],\n [329, 349], [349, 350], [350, 329], [374, 380], [380, 252], [252, 374],\n [318, 402], [402, 403], [403, 318], [6, 197], [197, 419], [419, 6],\n [318, 319], [319, 325], [325, 318], [367, 364], [364, 365], [365, 367],\n [435, 367], [367, 397], [397, 435], [344, 438], [438, 439], [439, 344],\n [272, 271], [271, 311], [311, 272], [195, 5], [5, 281], [281, 195],\n [273, 287], [287, 291], [291, 273], [396, 428], [428, 199], [199, 396],\n [311, 271], [271, 268], [268, 311], [283, 444], [444, 445], [445, 283],\n [373, 254], [254, 339], [339, 373], [282, 334], [334, 296], [296, 282],\n [449, 347], [347, 346], [346, 449], [264, 447], [447, 454], [454, 264],\n [336, 296], [296, 299], [299, 336], [338, 10], [10, 151], [151, 338],\n [278, 439], [439, 455], [455, 278], [292, 407], [407, 415], [415, 292],\n [358, 371], [371, 355], [355, 358], [340, 345], [345, 372], [372, 340],\n [346, 347], [347, 280], [280, 346], [442, 443], [443, 282], [282, 442],\n [19, 94], [94, 370], [370, 19], [441, 442], [442, 295], [295, 441],\n [248, 419], [419, 197], [197, 248], [263, 255], [255, 359], [359, 263],\n [440, 275], [275, 274], [274, 440], [300, 383], [383, 368], [368, 300],\n [351, 412], [412, 465], [465, 351], [263, 467], [467, 466], [466, 263],\n [301, 368], [368, 389], [389, 301], [395, 378], [378, 379], [379, 395],\n [412, 351], [351, 419], [419, 412], [436, 426], [426, 322], [322, 436],\n [2, 164], [164, 393], [393, 2], [370, 462], [462, 461], [461, 370],\n [164, 0], [0, 267], [267, 164], [302, 11], [11, 12], [12, 302],\n [268, 12], [12, 13], [13, 268], [293, 300], [300, 301], [301, 293],\n [446, 261], [261, 340], [340, 446], [330, 266], [266, 425], [425, 330],\n [426, 423], [423, 391], [391, 426], [429, 355], [355, 437], [437, 429],\n [391, 327], [327, 326], [326, 391], [440, 457], [457, 438], [438, 440],\n [341, 382], [382, 362], [362, 341], [459, 457], [457, 461], [461, 459],\n [434, 430], [430, 394], [394, 434], [414, 463], [463, 362], [362, 414],\n [396, 369], [369, 262], [262, 396], [354, 461], [461, 457], [457, 354],\n [316, 403], [403, 402], [402, 316], [315, 404], [404, 403], [403, 315],\n [314, 405], [405, 404], [404, 314], [313, 406], [406, 405], [405, 313],\n [421, 418], [418, 406], [406, 421], [366, 401], [401, 361], [361, 366],\n [306, 408], [408, 407], [407, 306], [291, 409], [409, 408], [408, 291],\n [287, 410], [410, 409], [409, 287], [432, 436], [436, 410], [410, 432],\n [434, 416], [416, 411], [411, 434], [264, 368], [368, 383], [383, 264],\n [309, 438], [438, 457], [457, 309], [352, 376], [376, 401], [401, 352],\n [274, 275], [275, 4], [4, 274], [421, 428], [428, 262], [262, 421],\n [294, 327], [327, 358], [358, 294], [433, 416], [416, 367], [367, 433],\n [289, 455], [455, 439], [439, 289], [462, 370], [370, 326], [326, 462],\n [2, 326], [326, 370], [370, 2], [305, 460], [460, 455], [455, 305],\n [254, 449], [449, 448], [448, 254], [255, 261], [261, 446], [446, 255],\n [253, 450], [450, 449], [449, 253], [252, 451], [451, 450], [450, 252],\n [256, 452], [452, 451], [451, 256], [341, 453], [453, 452], [452, 341],\n [413, 464], [464, 463], [463, 413], [441, 413], [413, 414], [414, 441],\n [258, 442], [442, 441], [441, 258], [257, 443], [443, 442], [442, 257],\n [259, 444], [444, 443], [443, 259], [260, 445], [445, 444], [444, 260],\n [467, 342], [342, 445], [445, 467], [459, 458], [458, 250], [250, 459],\n [289, 392], [392, 290], [290, 289], [290, 328], [328, 460], [460, 290],\n [376, 433], [433, 435], [435, 376], [250, 290], [290, 392], [392, 250],\n [411, 416], [416, 433], [433, 411], [341, 463], [463, 464], [464, 341],\n [453, 464], [464, 465], [465, 453], [357, 465], [465, 412], [412, 357],\n [343, 412], [412, 399], [399, 343], [360, 363], [363, 440], [440, 360],\n [437, 399], [399, 456], [456, 437], [420, 456], [456, 363], [363, 420],\n [401, 435], [435, 288], [288, 401], [372, 383], [383, 353], [353, 372],\n [339, 255], [255, 249], [249, 339], [448, 261], [261, 255], [255, 448],\n [133, 243], [243, 190], [190, 133], [133, 155], [155, 112], [112, 133],\n [33, 246], [246, 247], [247, 33], [33, 130], [130, 25], [25, 33],\n [398, 384], [384, 286], [286, 398], [362, 398], [398, 414], [414, 362],\n [362, 463], [463, 341], [341, 362], [263, 359], [359, 467], [467, 263],\n [263, 249], [249, 255], [255, 263], [466, 467], [467, 260], [260, 466],\n [75, 60], [60, 166], [166, 75], [238, 239], [239, 79], [79, 238],\n [162, 127], [127, 139], [139, 162], [72, 11], [11, 37], [37, 72],\n [121, 232], [232, 120], [120, 121], [73, 72], [72, 39], [39, 73],\n [114, 128], [128, 47], [47, 114], [233, 232], [232, 128], [128, 233],\n [103, 104], [104, 67], [67, 103], [152, 175], [175, 148], [148, 152],\n [119, 118], [118, 101], [101, 119], [74, 73], [73, 40], [40, 74],\n [107, 9], [9, 108], [108, 107], [49, 48], [48, 131], [131, 49],\n [32, 194], [194, 211], [211, 32], [184, 74], [74, 185], [185, 184],\n [191, 80], [80, 183], [183, 191], [185, 40], [40, 186], [186, 185],\n [119, 230], [230, 118], [118, 119], [210, 202], [202, 214], [214, 210],\n [84, 83], [83, 17], [17, 84], [77, 76], [76, 146], [146, 77],\n [161, 160], [160, 30], [30, 161], [190, 56], [56, 173], [173, 190],\n [182, 106], [106, 194], [194, 182], [138, 135], [135, 192], [192, 138],\n [129, 203], [203, 98], [98, 129], [54, 21], [21, 68], [68, 54],\n [5, 51], [51, 4], [4, 5], [145, 144], [144, 23], [23, 145],\n [90, 77], [77, 91], [91, 90], [207, 205], [205, 187], [187, 207],\n [83, 201], [201, 18], [18, 83], [181, 91], [91, 182], [182, 181],\n [180, 90], [90, 181], [181, 180], [16, 85], [85, 17], [17, 16],\n [205, 206], [206, 36], [36, 205], [176, 148], [148, 140], [140, 176],\n [165, 92], [92, 39], [39, 165], [245, 193], [193, 244], [244, 245],\n [27, 159], [159, 28], [28, 27], [30, 247], [247, 161], [161, 30],\n [174, 236], [236, 196], [196, 174], [103, 54], [54, 104], [104, 103],\n [55, 193], [193, 8], [8, 55], [111, 117], [117, 31], [31, 111],\n [221, 189], [189, 55], [55, 221], [240, 98], [98, 99], [99, 240],\n [142, 126], [126, 100], [100, 142], [219, 166], [166, 218], [218, 219],\n [112, 155], [155, 26], [26, 112], [198, 209], [209, 131], [131, 198],\n [169, 135], [135, 150], [150, 169], [114, 47], [47, 217], [217, 114],\n [224, 223], [223, 53], [53, 224], [220, 45], [45, 134], [134, 220],\n [32, 211], [211, 140], [140, 32], [109, 67], [67, 108], [108, 109],\n [146, 43], [43, 91], [91, 146], [231, 230], [230, 120], [120, 231],\n [113, 226], [226, 247], [247, 113], [105, 63], [63, 52], [52, 105],\n [241, 238], [238, 242], [242, 241], [124, 46], [46, 156], [156, 124],\n [95, 78], [78, 96], [96, 95], [70, 46], [46, 63], [63, 70],\n [116, 143], [143, 227], [227, 116], [116, 123], [123, 111], [111, 116],\n [1, 44], [44, 19], [19, 1], [3, 236], [236, 51], [51, 3],\n [207, 216], [216, 205], [205, 207], [26, 154], [154, 22], [22, 26],\n [165, 39], [39, 167], [167, 165], [199, 200], [200, 208], [208, 199],\n [101, 36], [36, 100], [100, 101], [43, 57], [57, 202], [202, 43],\n [242, 20], [20, 99], [99, 242], [56, 28], [28, 157], [157, 56],\n [124, 35], [35, 113], [113, 124], [29, 160], [160, 27], [27, 29],\n [211, 204], [204, 210], [210, 211], [124, 113], [113, 46], [46, 124],\n [106, 43], [43, 204], [204, 106], [96, 62], [62, 77], [77, 96],\n [227, 137], [137, 116], [116, 227], [73, 41], [41, 72], [72, 73],\n [36, 203], [203, 142], [142, 36], [235, 64], [64, 240], [240, 235],\n [48, 49], [49, 64], [64, 48], [42, 41], [41, 74], [74, 42],\n [214, 212], [212, 207], [207, 214], [183, 42], [42, 184], [184, 183],\n [210, 169], [169, 211], [211, 210], [140, 170], [170, 176], [176, 140],\n [104, 105], [105, 69], [69, 104], [193, 122], [122, 168], [168, 193],\n [50, 123], [123, 187], [187, 50], [89, 96], [96, 90], [90, 89],\n [66, 65], [65, 107], [107, 66], [179, 89], [89, 180], [180, 179],\n [119, 101], [101, 120], [120, 119], [68, 63], [63, 104], [104, 68],\n [234, 93], [93, 227], [227, 234], [16, 15], [15, 85], [85, 16],\n [209, 129], [129, 49], [49, 209], [15, 14], [14, 86], [86, 15],\n [107, 55], [55, 9], [9, 107], [120, 100], [100, 121], [121, 120],\n [153, 145], [145, 22], [22, 153], [178, 88], [88, 179], [179, 178],\n [197, 6], [6, 196], [196, 197], [89, 88], [88, 96], [96, 89],\n [135, 138], [138, 136], [136, 135], [138, 215], [215, 172], [172, 138],\n [218, 115], [115, 219], [219, 218], [41, 42], [42, 81], [81, 41],\n [5, 195], [195, 51], [51, 5], [57, 43], [43, 61], [61, 57],\n [208, 171], [171, 199], [199, 208], [41, 81], [81, 38], [38, 41],\n [224, 53], [53, 225], [225, 224], [24, 144], [144, 110], [110, 24],\n [105, 52], [52, 66], [66, 105], [118, 229], [229, 117], [117, 118],\n [227, 34], [34, 234], [234, 227], [66, 107], [107, 69], [69, 66],\n [10, 109], [109, 151], [151, 10], [219, 48], [48, 235], [235, 219],\n [183, 62], [62, 191], [191, 183], [142, 129], [129, 126], [126, 142],\n [116, 111], [111, 143], [143, 116], [118, 117], [117, 50], [50, 118],\n [223, 222], [222, 52], [52, 223], [94, 19], [19, 141], [141, 94],\n [222, 221], [221, 65], [65, 222], [196, 3], [3, 197], [197, 196],\n [45, 220], [220, 44], [44, 45], [156, 70], [70, 139], [139, 156],\n [188, 122], [122, 245], [245, 188], [139, 71], [71, 162], [162, 139],\n [149, 170], [170, 150], [150, 149], [122, 188], [188, 196], [196, 122],\n [206, 216], [216, 92], [92, 206], [164, 2], [2, 167], [167, 164],\n [242, 141], [141, 241], [241, 242], [0, 164], [164, 37], [37, 0],\n [11, 72], [72, 12], [12, 11], [12, 38], [38, 13], [13, 12],\n [70, 63], [63, 71], [71, 70], [31, 226], [226, 111], [111, 31],\n [36, 101], [101, 205], [205, 36], [203, 206], [206, 165], [165, 203],\n [126, 209], [209, 217], [217, 126], [98, 165], [165, 97], [97, 98],\n [237, 220], [220, 218], [218, 237], [237, 239], [239, 241], [241, 237],\n [210, 214], [214, 169], [169, 210], [140, 171], [171, 32], [32, 140],\n [241, 125], [125, 237], [237, 241], [179, 86], [86, 178], [178, 179],\n [180, 85], [85, 179], [179, 180], [181, 84], [84, 180], [180, 181],\n [182, 83], [83, 181], [181, 182], [194, 201], [201, 182], [182, 194],\n [177, 137], [137, 132], [132, 177], [184, 76], [76, 183], [183, 184],\n [185, 61], [61, 184], [184, 185], [186, 57], [57, 185], [185, 186],\n [216, 212], [212, 186], [186, 216], [192, 214], [214, 187], [187, 192],\n [139, 34], [34, 156], [156, 139], [218, 79], [79, 237], [237, 218],\n [147, 123], [123, 177], [177, 147], [45, 44], [44, 4], [4, 45],\n [208, 201], [201, 32], [32, 208], [98, 64], [64, 129], [129, 98],\n [192, 213], [213, 138], [138, 192], [235, 59], [59, 219], [219, 235],\n [141, 242], [242, 97], [97, 141], [97, 2], [2, 141], [141, 97],\n [240, 75], [75, 235], [235, 240], [229, 24], [24, 228], [228, 229],\n [31, 25], [25, 226], [226, 31], [230, 23], [23, 229], [229, 230],\n [231, 22], [22, 230], [230, 231], [232, 26], [26, 231], [231, 232],\n [233, 112], [112, 232], [232, 233], [244, 189], [189, 243], [243, 244],\n [189, 221], [221, 190], [190, 189], [222, 28], [28, 221], [221, 222],\n [223, 27], [27, 222], [222, 223], [224, 29], [29, 223], [223, 224],\n [225, 30], [30, 224], [224, 225], [113, 247], [247, 225], [225, 113],\n [99, 60], [60, 240], [240, 99], [213, 147], [147, 215], [215, 213],\n [60, 20], [20, 166], [166, 60], [192, 187], [187, 213], [213, 192],\n [243, 112], [112, 244], [244, 243], [244, 233], [233, 245], [245, 244],\n [245, 128], [128, 188], [188, 245], [188, 114], [114, 174], [174, 188],\n [134, 131], [131, 220], [220, 134], [174, 217], [217, 236], [236, 174],\n [236, 198], [198, 134], [134, 236], [215, 177], [177, 58], [58, 215],\n [156, 143], [143, 124], [124, 156], [25, 110], [110, 7], [7, 25],\n [31, 228], [228, 25], [25, 31], [264, 356], [356, 368], [368, 264],\n [0, 11], [11, 267], [267, 0], [451, 452], [452, 349], [349, 451],\n [267, 302], [302, 269], [269, 267], [350, 357], [357, 277], [277, 350],\n [350, 452], [452, 357], [357, 350], [299, 333], [333, 297], [297, 299],\n [396, 175], [175, 377], [377, 396], [280, 347], [347, 330], [330, 280],\n [269, 303], [303, 270], [270, 269], [151, 9], [9, 337], [337, 151],\n [344, 278], [278, 360], [360, 344], [424, 418], [418, 431], [431, 424],\n [270, 304], [304, 409], [409, 270], [272, 310], [310, 407], [407, 272],\n [322, 270], [270, 410], [410, 322], [449, 450], [450, 347], [347, 449],\n [432, 422], [422, 434], [434, 432], [18, 313], [313, 17], [17, 18],\n [291, 306], [306, 375], [375, 291], [259, 387], [387, 260], [260, 259],\n [424, 335], [335, 418], [418, 424], [434, 364], [364, 416], [416, 434],\n [391, 423], [423, 327], [327, 391], [301, 251], [251, 298], [298, 301],\n [275, 281], [281, 4], [4, 275], [254, 373], [373, 253], [253, 254],\n [375, 307], [307, 321], [321, 375], [280, 425], [425, 411], [411, 280],\n [200, 421], [421, 18], [18, 200], [335, 321], [321, 406], [406, 335],\n [321, 320], [320, 405], [405, 321], [314, 315], [315, 17], [17, 314],\n [423, 426], [426, 266], [266, 423], [396, 377], [377, 369], [369, 396],\n [270, 322], [322, 269], [269, 270], [413, 417], [417, 464], [464, 413],\n [385, 386], [386, 258], [258, 385], [248, 456], [456, 419], [419, 248],\n [298, 284], [284, 333], [333, 298], [168, 417], [417, 8], [8, 168],\n [448, 346], [346, 261], [261, 448], [417, 413], [413, 285], [285, 417],\n [326, 327], [327, 328], [328, 326], [277, 355], [355, 329], [329, 277],\n [309, 392], [392, 438], [438, 309], [381, 382], [382, 256], [256, 381],\n [279, 429], [429, 360], [360, 279], [365, 364], [364, 379], [379, 365],\n [355, 277], [277, 437], [437, 355], [282, 443], [443, 283], [283, 282],\n [281, 275], [275, 363], [363, 281], [395, 431], [431, 369], [369, 395],\n [299, 297], [297, 337], [337, 299], [335, 273], [273, 321], [321, 335],\n [348, 450], [450, 349], [349, 348], [359, 446], [446, 467], [467, 359],\n [283, 293], [293, 282], [282, 283], [250, 458], [458, 462], [462, 250],\n [300, 276], [276, 383], [383, 300], [292, 308], [308, 325], [325, 292],\n [283, 276], [276, 293], [293, 283], [264, 372], [372, 447], [447, 264],\n [346, 352], [352, 340], [340, 346], [354, 274], [274, 19], [19, 354],\n [363, 456], [456, 281], [281, 363], [426, 436], [436, 425], [425, 426],\n [380, 381], [381, 252], [252, 380], [267, 269], [269, 393], [393, 267],\n [421, 200], [200, 428], [428, 421], [371, 266], [266, 329], [329, 371],\n [432, 287], [287, 422], [422, 432], [290, 250], [250, 328], [328, 290],\n [385, 258], [258, 384], [384, 385], [446, 265], [265, 342], [342, 446],\n [386, 387], [387, 257], [257, 386], [422, 424], [424, 430], [430, 422],\n [445, 342], [342, 276], [276, 445], [422, 273], [273, 424], [424, 422],\n [306, 292], [292, 307], [307, 306], [352, 366], [366, 345], [345, 352],\n [268, 271], [271, 302], [302, 268], [358, 423], [423, 371], [371, 358],\n [327, 294], [294, 460], [460, 327], [331, 279], [279, 294], [294, 331],\n [303, 271], [271, 304], [304, 303], [436, 432], [432, 427], [427, 436],\n [304, 272], [272, 408], [408, 304], [395, 394], [394, 431], [431, 395],\n [378, 395], [395, 400], [400, 378], [296, 334], [334, 299], [299, 296],\n [6, 351], [351, 168], [168, 6], [376, 352], [352, 411], [411, 376],\n [307, 325], [325, 320], [320, 307], [285, 295], [295, 336], [336, 285],\n [320, 319], [319, 404], [404, 320], [329, 330], [330, 349], [349, 329],\n [334, 293], [293, 333], [333, 334], [366, 323], [323, 447], [447, 366],\n [316, 15], [15, 315], [315, 316], [331, 358], [358, 279], [279, 331],\n [317, 14], [14, 316], [316, 317], [8, 285], [285, 9], [9, 8],\n [277, 329], [329, 350], [350, 277], [253, 374], [374, 252], [252, 253],\n [319, 318], [318, 403], [403, 319], [351, 6], [6, 419], [419, 351],\n [324, 318], [318, 325], [325, 324], [397, 367], [367, 365], [365, 397],\n [288, 435], [435, 397], [397, 288], [278, 344], [344, 439], [439, 278],\n [310, 272], [272, 311], [311, 310], [248, 195], [195, 281], [281, 248],\n [375, 273], [273, 291], [291, 375], [175, 396], [396, 199], [199, 175],\n [312, 311], [311, 268], [268, 312], [276, 283], [283, 445], [445, 276],\n [390, 373], [373, 339], [339, 390], [295, 282], [282, 296], [296, 295],\n [448, 449], [449, 346], [346, 448], [356, 264], [264, 454], [454, 356],\n [337, 336], [336, 299], [299, 337], [337, 338], [338, 151], [151, 337],\n [294, 278], [278, 455], [455, 294], [308, 292], [292, 415], [415, 308],\n [429, 358], [358, 355], [355, 429], [265, 340], [340, 372], [372, 265],\n [352, 346], [346, 280], [280, 352], [295, 442], [442, 282], [282, 295],\n [354, 19], [19, 370], [370, 354], [285, 441], [441, 295], [295, 285],\n [195, 248], [248, 197], [197, 195], [457, 440], [440, 274], [274, 457],\n [301, 300], [300, 368], [368, 301], [417, 351], [351, 465], [465, 417],\n [251, 301], [301, 389], [389, 251], [394, 395], [395, 379], [379, 394],\n [399, 412], [412, 419], [419, 399], [410, 436], [436, 322], [322, 410],\n [326, 2], [2, 393], [393, 326], [354, 370], [370, 461], [461, 354],\n [393, 164], [164, 267], [267, 393], [268, 302], [302, 12], [12, 268],\n [312, 268], [268, 13], [13, 312], [298, 293], [293, 301], [301, 298],\n [265, 446], [446, 340], [340, 265], [280, 330], [330, 425], [425, 280],\n [322, 426], [426, 391], [391, 322], [420, 429], [429, 437], [437, 420],\n [393, 391], [391, 326], [326, 393], [344, 440], [440, 438], [438, 344],\n [458, 459], [459, 461], [461, 458], [364, 434], [434, 394], [394, 364],\n [428, 396], [396, 262], [262, 428], [274, 354], [354, 457], [457, 274],\n [317, 316], [316, 402], [402, 317], [316, 315], [315, 403], [403, 316],\n [315, 314], [314, 404], [404, 315], [314, 313], [313, 405], [405, 314],\n [313, 421], [421, 406], [406, 313], [323, 366], [366, 361], [361, 323],\n [292, 306], [306, 407], [407, 292], [306, 291], [291, 408], [408, 306],\n [291, 287], [287, 409], [409, 291], [287, 432], [432, 410], [410, 287],\n [427, 434], [434, 411], [411, 427], [372, 264], [264, 383], [383, 372],\n [459, 309], [309, 457], [457, 459], [366, 352], [352, 401], [401, 366],\n [1, 274], [274, 4], [4, 1], [418, 421], [421, 262], [262, 418],\n [331, 294], [294, 358], [358, 331], [435, 433], [433, 367], [367, 435],\n [392, 289], [289, 439], [439, 392], [328, 462], [462, 326], [326, 328],\n [94, 2], [2, 370], [370, 94], [289, 305], [305, 455], [455, 289],\n [339, 254], [254, 448], [448, 339], [359, 255], [255, 446], [446, 359],\n [254, 253], [253, 449], [449, 254], [253, 252], [252, 450], [450, 253],\n [252, 256], [256, 451], [451, 252], [256, 341], [341, 452], [452, 256],\n [414, 413], [413, 463], [463, 414], [286, 441], [441, 414], [414, 286],\n [286, 258], [258, 441], [441, 286], [258, 257], [257, 442], [442, 258],\n [257, 259], [259, 443], [443, 257], [259, 260], [260, 444], [444, 259],\n [260, 467], [467, 445], [445, 260], [309, 459], [459, 250], [250, 309],\n [305, 289], [289, 290], [290, 305], [305, 290], [290, 460], [460, 305],\n [401, 376], [376, 435], [435, 401], [309, 250], [250, 392], [392, 309],\n [376, 411], [411, 433], [433, 376], [453, 341], [341, 464], [464, 453],\n [357, 453], [453, 465], [465, 357], [343, 357], [357, 412], [412, 343],\n [437, 343], [343, 399], [399, 437], [344, 360], [360, 440], [440, 344],\n [420, 437], [437, 456], [456, 420], [360, 420], [420, 363], [363, 360],\n [361, 401], [401, 288], [288, 361], [265, 372], [372, 353], [353, 265],\n [390, 339], [339, 249], [249, 390], [339, 448], [448, 255], [255, 339],\n];\n", "// @tensorflow/tfjs-models/face-landmark-detection/src/constants.ts\n// https://github.com/google/mediapipe/mediapipe/python/solutions/face_mesh_connections.py\n\ntype PairArray = [number, number][];\n\nconst LIPS_CONNECTIONS: PairArray = [\n [61, 146], [146, 91], [91, 181], [181, 84], [84, 17], [17, 314], [314, 405], [405, 321], [321, 375], [375, 291], [61, 185], [185, 40], [40, 39], [39, 37], [37, 0], [0, 267], [267, 269], [269, 270], [270, 409], [409, 291],\n [78, 95], [95, 88], [88, 178], [178, 87], [87, 14], [14, 317], [317, 402], [402, 318], [318, 324], [324, 308], [78, 191], [191, 80], [80, 81], [81, 82], [82, 13], [13, 312], [312, 311], [311, 310], [310, 415], [415, 308],\n];\n\nconst LEFT_EYE_CONNECTIONS: PairArray = [[263, 249], [249, 390], [390, 373], [373, 374], [374, 380], [380, 381], [381, 382], [382, 362], [263, 466], [466, 388], [388, 387], [387, 386], [386, 385], [385, 384], [384, 398], [398, 362]];\n\nconst LEFT_EYEBROW_CONNECTIONS: PairArray = [[276, 283], [283, 282], [282, 295], [295, 285], [300, 293], [293, 334], [334, 296], [296, 336]];\n\nconst LEFT_IRIS_CONNECTIONS: PairArray = [[474, 475], [475, 476], [476, 477], [477, 474]];\n\nconst RIGHT_EYE_CONNECTIONS: PairArray = [[33, 7], [7, 163], [163, 144], [144, 145], [145, 153], [153, 154], [154, 155], [155, 133], [33, 246], [246, 161], [161, 160], [160, 159], [159, 158], [158, 157], [157, 173], [173, 133]];\n\nconst RIGHT_EYEBROW_CONNECTIONS: PairArray = [[46, 53], [53, 52], [52, 65], [65, 55], [70, 63], [63, 105], [105, 66], [66, 107]];\n\nconst RIGHT_IRIS_CONNECTIONS: PairArray = [[469, 470], [470, 471], [471, 472], [472, 469]];\n\nconst FACE_OVAL_CONNECTIONS: PairArray = [\n [10, 338], [338, 297], [297, 332], [332, 284], [284, 251], [251, 389], [389, 356], [356, 454], [454, 323], [323, 361], [361, 288], [288, 397], [397, 365], [365, 379], [379, 378], [378, 400], [400, 377], [377, 152],\n [152, 148], [148, 176], [176, 149], [149, 150], [150, 136], [136, 172], [172, 58], [58, 132], [132, 93], [93, 234], [234, 127], [127, 162], [162, 21], [21, 54], [54, 103], [103, 67], [67, 109], [109, 10],\n];\n\nexport const MEDIAPIPE_FACE_MESH_CONNECTED_KEYPOINTS_PAIRS: PairArray = [\n [127, 34], [34, 139], [139, 127], [11, 0], [0, 37], [37, 11], [232, 231], [231, 120], [120, 232], [72, 37], [37, 39], [39, 72], [128, 121], [121, 47], [47, 128], [232, 121], [121, 128], [128, 232],\n [104, 69], [69, 67], [67, 104], [175, 171], [171, 148], [148, 175], [118, 50], [50, 101], [101, 118], [73, 39], [39, 40], [40, 73], [9, 151], [151, 108], [108, 9], [48, 115], [115, 131], [131, 48],\n [194, 204], [204, 211], [211, 194], [74, 40], [40, 185], [185, 74], [80, 42], [42, 183], [183, 80], [40, 92], [92, 186], [186, 40], [230, 229], [229, 118], [118, 230], [202, 212], [212, 214], [214, 202],\n [83, 18], [18, 17], [17, 83], [76, 61], [61, 146], [146, 76], [160, 29], [29, 30], [30, 160], [56, 157], [157, 173], [173, 56], [106, 204], [204, 194], [194, 106], [135, 214], [214, 192], [192, 135],\n [203, 165], [165, 98], [98, 203], [21, 71], [71, 68], [68, 21], [51, 45], [45, 4], [4, 51], [144, 24], [24, 23], [23, 144], [77, 146], [146, 91], [91, 77], [205, 50], [50, 187], [187, 205],\n [201, 200], [200, 18], [18, 201], [91, 106], [106, 182], [182, 91], [90, 91], [91, 181], [181, 90], [85, 84], [84, 17], [17, 85], [206, 203], [203, 36], [36, 206], [148, 171], [171, 140], [140, 148],\n [92, 40], [40, 39], [39, 92], [193, 189], [189, 244], [244, 193], [159, 158], [158, 28], [28, 159], [247, 246], [246, 161], [161, 247], [236, 3], [3, 196], [196, 236], [54, 68], [68, 104], [104, 54],\n [193, 168], [168, 8], [8, 193], [117, 228], [228, 31], [31, 117], [189, 193], [193, 55], [55, 189], [98, 97], [97, 99], [99, 98], [126, 47], [47, 100], [100, 126], [166, 79], [79, 218], [218, 166],\n [155, 154], [154, 26], [26, 155], [209, 49], [49, 131], [131, 209], [135, 136], [136, 150], [150, 135], [47, 126], [126, 217], [217, 47], [223, 52], [52, 53], [53, 223], [45, 51], [51, 134], [134, 45],\n [211, 170], [170, 140], [140, 211], [67, 69], [69, 108], [108, 67], [43, 106], [106, 91], [91, 43], [230, 119], [119, 120], [120, 230], [226, 130], [130, 247], [247, 226], [63, 53], [53, 52], [52, 63],\n [238, 20], [20, 242], [242, 238], [46, 70], [70, 156], [156, 46], [78, 62], [62, 96], [96, 78], [46, 53], [53, 63], [63, 46], [143, 34], [34, 227], [227, 143], [123, 117], [117, 111], [111, 123],\n [44, 125], [125, 19], [19, 44], [236, 134], [134, 51], [51, 236], [216, 206], [206, 205], [205, 216], [154, 153], [153, 22], [22, 154], [39, 37], [37, 167], [167, 39], [200, 201], [201, 208], [208, 200],\n [36, 142], [142, 100], [100, 36], [57, 212], [212, 202], [202, 57], [20, 60], [60, 99], [99, 20], [28, 158], [158, 157], [157, 28], [35, 226], [226, 113], [113, 35], [160, 159], [159, 27], [27, 160],\n [204, 202], [202, 210], [210, 204], [113, 225], [225, 46], [46, 113], [43, 202], [202, 204], [204, 43], [62, 76], [76, 77], [77, 62], [137, 123], [123, 116], [116, 137], [41, 38], [38, 72], [72, 41],\n [203, 129], [129, 142], [142, 203], [64, 98], [98, 240], [240, 64], [49, 102], [102, 64], [64, 49], [41, 73], [73, 74], [74, 41], [212, 216], [216, 207], [207, 212], [42, 74], [74, 184], [184, 42],\n [169, 170], [170, 211], [211, 169], [170, 149], [149, 176], [176, 170], [105, 66], [66, 69], [69, 105], [122, 6], [6, 168], [168, 122], [123, 147], [147, 187], [187, 123], [96, 77], [77, 90], [90, 96],\n [65, 55], [55, 107], [107, 65], [89, 90], [90, 180], [180, 89], [101, 100], [100, 120], [120, 101], [63, 105], [105, 104], [104, 63], [93, 137], [137, 227], [227, 93], [15, 86], [86, 85], [85, 15],\n [129, 102], [102, 49], [49, 129], [14, 87], [87, 86], [86, 14], [55, 8], [8, 9], [9, 55], [100, 47], [47, 121], [121, 100], [145, 23], [23, 22], [22, 145], [88, 89], [89, 179], [179, 88],\n [6, 122], [122, 196], [196, 6], [88, 95], [95, 96], [96, 88], [138, 172], [172, 136], [136, 138], [215, 58], [58, 172], [172, 215], [115, 48], [48, 219], [219, 115], [42, 80], [80, 81], [81, 42],\n [195, 3], [3, 51], [51, 195], [43, 146], [146, 61], [61, 43], [171, 175], [175, 199], [199, 171], [81, 82], [82, 38], [38, 81], [53, 46], [46, 225], [225, 53], [144, 163], [163, 110], [110, 144],\n [52, 65], [65, 66], [66, 52], [229, 228], [228, 117], [117, 229], [34, 127], [127, 234], [234, 34], [107, 108], [108, 69], [69, 107], [109, 108], [108, 151], [151, 109], [48, 64], [64, 235], [235, 48],\n [62, 78], [78, 191], [191, 62], [129, 209], [209, 126], [126, 129], [111, 35], [35, 143], [143, 111], [117, 123], [123, 50], [50, 117], [222, 65], [65, 52], [52, 222], [19, 125], [125, 141], [141, 19],\n [221, 55], [55, 65], [65, 221], [3, 195], [195, 197], [197, 3], [25, 7], [7, 33], [33, 25], [220, 237], [237, 44], [44, 220], [70, 71], [71, 139], [139, 70], [122, 193], [193, 245], [245, 122],\n [247, 130], [130, 33], [33, 247], [71, 21], [21, 162], [162, 71], [170, 169], [169, 150], [150, 170], [188, 174], [174, 196], [196, 188], [216, 186], [186, 92], [92, 216], [2, 97], [97, 167], [167, 2],\n [141, 125], [125, 241], [241, 141], [164, 167], [167, 37], [37, 164], [72, 38], [38, 12], [12, 72], [38, 82], [82, 13], [13, 38], [63, 68], [68, 71], [71, 63], [226, 35], [35, 111], [111, 226],\n [101, 50], [50, 205], [205, 101], [206, 92], [92, 165], [165, 206], [209, 198], [198, 217], [217, 209], [165, 167], [167, 97], [97, 165], [220, 115], [115, 218], [218, 220], [133, 112], [112, 243], [243, 133],\n [239, 238], [238, 241], [241, 239], [214, 135], [135, 169], [169, 214], [190, 173], [173, 133], [133, 190], [171, 208], [208, 32], [32, 171], [125, 44], [44, 237], [237, 125], [86, 87], [87, 178], [178, 86],\n [85, 86], [86, 179], [179, 85], [84, 85], [85, 180], [180, 84], [83, 84], [84, 181], [181, 83], [201, 83], [83, 182], [182, 201], [137, 93], [93, 132], [132, 137], [76, 62], [62, 183], [183, 76],\n [61, 76], [76, 184], [184, 61], [57, 61], [61, 185], [185, 57], [212, 57], [57, 186], [186, 212], [214, 207], [207, 187], [187, 214], [34, 143], [143, 156], [156, 34], [79, 239], [239, 237], [237, 79],\n [123, 137], [137, 177], [177, 123], [44, 1], [1, 4], [4, 44], [201, 194], [194, 32], [32, 201], [64, 102], [102, 129], [129, 64], [213, 215], [215, 138], [138, 213], [59, 166], [166, 219], [219, 59],\n [242, 99], [99, 97], [97, 242], [2, 94], [94, 141], [141, 2], [75, 59], [59, 235], [235, 75], [24, 110], [110, 228], [228, 24], [25, 130], [130, 226], [226, 25], [23, 24], [24, 229], [229, 23],\n [22, 23], [23, 230], [230, 22], [26, 22], [22, 231], [231, 26], [112, 26], [26, 232], [232, 112], [189, 190], [190, 243], [243, 189], [221, 56], [56, 190], [190, 221], [28, 56], [56, 221], [221, 28],\n [27, 28], [28, 222], [222, 27], [29, 27], [27, 223], [223, 29], [30, 29], [29, 224], [224, 30], [247, 30], [30, 225], [225, 247], [238, 79], [79, 20], [20, 238], [166, 59], [59, 75], [75, 166],\n [60, 75], [75, 240], [240, 60], [147, 177], [177, 215], [215, 147], [20, 79], [79, 166], [166, 20], [187, 147], [147, 213], [213, 187], [112, 233], [233, 244], [244, 112], [233, 128], [128, 245], [245, 233],\n [128, 114], [114, 188], [188, 128], [114, 217], [217, 174], [174, 114], [131, 115], [115, 220], [220, 131], [217, 198], [198, 236], [236, 217], [198, 131], [131, 134], [134, 198], [177, 132], [132, 58], [58, 177],\n [143, 35], [35, 124], [124, 143], [110, 163], [163, 7], [7, 110], [228, 110], [110, 25], [25, 228], [356, 389], [389, 368], [368, 356], [11, 302], [302, 267], [267, 11], [452, 350], [350, 349], [349, 452],\n [302, 303], [303, 269], [269, 302], [357, 343], [343, 277], [277, 357], [452, 453], [453, 357], [357, 452], [333, 332], [332, 297], [297, 333], [175, 152], [152, 377], [377, 175], [347, 348], [348, 330], [330, 347],\n [303, 304], [304, 270], [270, 303], [9, 336], [336, 337], [337, 9], [278, 279], [279, 360], [360, 278], [418, 262], [262, 431], [431, 418], [304, 408], [408, 409], [409, 304], [310, 415], [415, 407], [407, 310],\n [270, 409], [409, 410], [410, 270], [450, 348], [348, 347], [347, 450], [422, 430], [430, 434], [434, 422], [313, 314], [314, 17], [17, 313], [306, 307], [307, 375], [375, 306], [387, 388], [388, 260], [260, 387],\n [286, 414], [414, 398], [398, 286], [335, 406], [406, 418], [418, 335], [364, 367], [367, 416], [416, 364], [423, 358], [358, 327], [327, 423], [251, 284], [284, 298], [298, 251], [281, 5], [5, 4], [4, 281],\n [373, 374], [374, 253], [253, 373], [307, 320], [320, 321], [321, 307], [425, 427], [427, 411], [411, 425], [421, 313], [313, 18], [18, 421], [321, 405], [405, 406], [406, 321], [320, 404], [404, 405], [405, 320],\n [315, 16], [16, 17], [17, 315], [426, 425], [425, 266], [266, 426], [377, 400], [400, 369], [369, 377], [322, 391], [391, 269], [269, 322], [417, 465], [465, 464], [464, 417], [386, 257], [257, 258], [258, 386],\n [466, 260], [260, 388], [388, 466], [456, 399], [399, 419], [419, 456], [284, 332], [332, 333], [333, 284], [417, 285], [285, 8], [8, 417], [346, 340], [340, 261], [261, 346], [413, 441], [441, 285], [285, 413],\n [327, 460], [460, 328], [328, 327], [355, 371], [371, 329], [329, 355], [392, 439], [439, 438], [438, 392], [382, 341], [341, 256], [256, 382], [429, 420], [420, 360], [360, 429], [364, 394], [394, 379], [379, 364],\n [277, 343], [343, 437], [437, 277], [443, 444], [444, 283], [283, 443], [275, 440], [440, 363], [363, 275], [431, 262], [262, 369], [369, 431], [297, 338], [338, 337], [337, 297], [273, 375], [375, 321], [321, 273],\n [450, 451], [451, 349], [349, 450], [446, 342], [342, 467], [467, 446], [293, 334], [334, 282], [282, 293], [458, 461], [461, 462], [462, 458], [276, 353], [353, 383], [383, 276], [308, 324], [324, 325], [325, 308],\n [276, 300], [300, 293], [293, 276], [372, 345], [345, 447], [447, 372], [352, 345], [345, 340], [340, 352], [274, 1], [1, 19], [19, 274], [456, 248], [248, 281], [281, 456], [436, 427], [427, 425], [425, 436],\n [381, 256], [256, 252], [252, 381], [269, 391], [391, 393], [393, 269], [200, 199], [199, 428], [428, 200], [266, 330], [330, 329], [329, 266], [287, 273], [273, 422], [422, 287], [250, 462], [462, 328], [328, 250],\n [258, 286], [286, 384], [384, 258], [265, 353], [353, 342], [342, 265], [387, 259], [259, 257], [257, 387], [424, 431], [431, 430], [430, 424], [342, 353], [353, 276], [276, 342], [273, 335], [335, 424], [424, 273],\n [292, 325], [325, 307], [307, 292], [366, 447], [447, 345], [345, 366], [271, 303], [303, 302], [302, 271], [423, 266], [266, 371], [371, 423], [294, 455], [455, 460], [460, 294], [279, 278], [278, 294], [294, 279],\n [271, 272], [272, 304], [304, 271], [432, 434], [434, 427], [427, 432], [272, 407], [407, 408], [408, 272], [394, 430], [430, 431], [431, 394], [395, 369], [369, 400], [400, 395], [334, 333], [333, 299], [299, 334],\n [351, 417], [417, 168], [168, 351], [352, 280], [280, 411], [411, 352], [325, 319], [319, 320], [320, 325], [295, 296], [296, 336], [336, 295], [319, 403], [403, 404], [404, 319], [330, 348], [348, 349], [349, 330],\n [293, 298], [298, 333], [333, 293], [323, 454], [454, 447], [447, 323], [15, 16], [16, 315], [315, 15], [358, 429], [429, 279], [279, 358], [14, 15], [15, 316], [316, 14], [285, 336], [336, 9], [9, 285],\n [329, 349], [349, 350], [350, 329], [374, 380], [380, 252], [252, 374], [318, 402], [402, 403], [403, 318], [6, 197], [197, 419], [419, 6], [318, 319], [319, 325], [325, 318], [367, 364], [364, 365], [365, 367],\n [435, 367], [367, 397], [397, 435], [344, 438], [438, 439], [439, 344], [272, 271], [271, 311], [311, 272], [195, 5], [5, 281], [281, 195], [273, 287], [287, 291], [291, 273], [396, 428], [428, 199], [199, 396],\n [311, 271], [271, 268], [268, 311], [283, 444], [444, 445], [445, 283], [373, 254], [254, 339], [339, 373], [282, 334], [334, 296], [296, 282], [449, 347], [347, 346], [346, 449], [264, 447], [447, 454], [454, 264],\n [336, 296], [296, 299], [299, 336], [338, 10], [10, 151], [151, 338], [278, 439], [439, 455], [455, 278], [292, 407], [407, 415], [415, 292], [358, 371], [371, 355], [355, 358], [340, 345], [345, 372], [372, 340],\n [346, 347], [347, 280], [280, 346], [442, 443], [443, 282], [282, 442], [19, 94], [94, 370], [370, 19], [441, 442], [442, 295], [295, 441], [248, 419], [419, 197], [197, 248], [263, 255], [255, 359], [359, 263],\n [440, 275], [275, 274], [274, 440], [300, 383], [383, 368], [368, 300], [351, 412], [412, 465], [465, 351], [263, 467], [467, 466], [466, 263], [301, 368], [368, 389], [389, 301], [395, 378], [378, 379], [379, 395],\n [412, 351], [351, 419], [419, 412], [436, 426], [426, 322], [322, 436], [2, 164], [164, 393], [393, 2], [370, 462], [462, 461], [461, 370], [164, 0], [0, 267], [267, 164], [302, 11], [11, 12], [12, 302],\n [268, 12], [12, 13], [13, 268], [293, 300], [300, 301], [301, 293], [446, 261], [261, 340], [340, 446], [330, 266], [266, 425], [425, 330], [426, 423], [423, 391], [391, 426], [429, 355], [355, 437], [437, 429],\n [391, 327], [327, 326], [326, 391], [440, 457], [457, 438], [438, 440], [341, 382], [382, 362], [362, 341], [459, 457], [457, 461], [461, 459], [434, 430], [430, 394], [394, 434], [414, 463], [463, 362], [362, 414],\n [396, 369], [369, 262], [262, 396], [354, 461], [461, 457], [457, 354], [316, 403], [403, 402], [402, 316], [315, 404], [404, 403], [403, 315], [314, 405], [405, 404], [404, 314], [313, 406], [406, 405], [405, 313],\n [421, 418], [418, 406], [406, 421], [366, 401], [401, 361], [361, 366], [306, 408], [408, 407], [407, 306], [291, 409], [409, 408], [408, 291], [287, 410], [410, 409], [409, 287], [432, 436], [436, 410], [410, 432],\n [434, 416], [416, 411], [411, 434], [264, 368], [368, 383], [383, 264], [309, 438], [438, 457], [457, 309], [352, 376], [376, 401], [401, 352], [274, 275], [275, 4], [4, 274], [421, 428], [428, 262], [262, 421],\n [294, 327], [327, 358], [358, 294], [433, 416], [416, 367], [367, 433], [289, 455], [455, 439], [439, 289], [462, 370], [370, 326], [326, 462], [2, 326], [326, 370], [370, 2], [305, 460], [460, 455], [455, 305],\n [254, 449], [449, 448], [448, 254], [255, 261], [261, 446], [446, 255], [253, 450], [450, 449], [449, 253], [252, 451], [451, 450], [450, 252], [256, 452], [452, 451], [451, 256], [341, 453], [453, 452], [452, 341],\n [413, 464], [464, 463], [463, 413], [441, 413], [413, 414], [414, 441], [258, 442], [442, 441], [441, 258], [257, 443], [443, 442], [442, 257], [259, 444], [444, 443], [443, 259], [260, 445], [445, 444], [444, 260],\n [467, 342], [342, 445], [445, 467], [459, 458], [458, 250], [250, 459], [289, 392], [392, 290], [290, 289], [290, 328], [328, 460], [460, 290], [376, 433], [433, 435], [435, 376], [250, 290], [290, 392], [392, 250],\n [411, 416], [416, 433], [433, 411], [341, 463], [463, 464], [464, 341], [453, 464], [464, 465], [465, 453], [357, 465], [465, 412], [412, 357], [343, 412], [412, 399], [399, 343], [360, 363], [363, 440], [440, 360],\n [437, 399], [399, 456], [456, 437], [420, 456], [456, 363], [363, 420], [401, 435], [435, 288], [288, 401], [372, 383], [383, 353], [353, 372], [339, 255], [255, 249], [249, 339], [448, 261], [261, 255], [255, 448],\n [133, 243], [243, 190], [190, 133], [133, 155], [155, 112], [112, 133], [33, 246], [246, 247], [247, 33], [33, 130], [130, 25], [25, 33], [398, 384], [384, 286], [286, 398], [362, 398], [398, 414], [414, 362],\n [362, 463], [463, 341], [341, 362], [263, 359], [359, 467], [467, 263], [263, 249], [249, 255], [255, 263], [466, 467], [467, 260], [260, 466], [75, 60], [60, 166], [166, 75], [238, 239], [239, 79], [79, 238],\n [162, 127], [127, 139], [139, 162], [72, 11], [11, 37], [37, 72], [121, 232], [232, 120], [120, 121], [73, 72], [72, 39], [39, 73], [114, 128], [128, 47], [47, 114], [233, 232], [232, 128], [128, 233],\n [103, 104], [104, 67], [67, 103], [152, 175], [175, 148], [148, 152], [119, 118], [118, 101], [101, 119], [74, 73], [73, 40], [40, 74], [107, 9], [9, 108], [108, 107], [49, 48], [48, 131], [131, 49],\n [32, 194], [194, 211], [211, 32], [184, 74], [74, 185], [185, 184], [191, 80], [80, 183], [183, 191], [185, 40], [40, 186], [186, 185], [119, 230], [230, 118], [118, 119], [210, 202], [202, 214], [214, 210],\n [84, 83], [83, 17], [17, 84], [77, 76], [76, 146], [146, 77], [161, 160], [160, 30], [30, 161], [190, 56], [56, 173], [173, 190], [182, 106], [106, 194], [194, 182], [138, 135], [135, 192], [192, 138],\n [129, 203], [203, 98], [98, 129], [54, 21], [21, 68], [68, 54], [5, 51], [51, 4], [4, 5], [145, 144], [144, 23], [23, 145], [90, 77], [77, 91], [91, 90], [207, 205], [205, 187], [187, 207],\n [83, 201], [201, 18], [18, 83], [181, 91], [91, 182], [182, 181], [180, 90], [90, 181], [181, 180], [16, 85], [85, 17], [17, 16], [205, 206], [206, 36], [36, 205], [176, 148], [148, 140], [140, 176],\n [165, 92], [92, 39], [39, 165], [245, 193], [193, 244], [244, 245], [27, 159], [159, 28], [28, 27], [30, 247], [247, 161], [161, 30], [174, 236], [236, 196], [196, 174], [103, 54], [54, 104], [104, 103],\n [55, 193], [193, 8], [8, 55], [111, 117], [117, 31], [31, 111], [221, 189], [189, 55], [55, 221], [240, 98], [98, 99], [99, 240], [142, 126], [126, 100], [100, 142], [219, 166], [166, 218], [218, 219],\n [112, 155], [155, 26], [26, 112], [198, 209], [209, 131], [131, 198], [169, 135], [135, 150], [150, 169], [114, 47], [47, 217], [217, 114], [224, 223], [223, 53], [53, 224], [220, 45], [45, 134], [134, 220],\n [32, 211], [211, 140], [140, 32], [109, 67], [67, 108], [108, 109], [146, 43], [43, 91], [91, 146], [231, 230], [230, 120], [120, 231], [113, 226], [226, 247], [247, 113], [105, 63], [63, 52], [52, 105],\n [241, 238], [238, 242], [242, 241], [124, 46], [46, 156], [156, 124], [95, 78], [78, 96], [96, 95], [70, 46], [46, 63], [63, 70], [116, 143], [143, 227], [227, 116], [116, 123], [123, 111], [111, 116],\n [1, 44], [44, 19], [19, 1], [3, 236], [236, 51], [51, 3], [207, 216], [216, 205], [205, 207], [26, 154], [154, 22], [22, 26], [165, 39], [39, 167], [167, 165], [199, 200], [200, 208], [208, 199],\n [101, 36], [36, 100], [100, 101], [43, 57], [57, 202], [202, 43], [242, 20], [20, 99], [99, 242], [56, 28], [28, 157], [157, 56], [124, 35], [35, 113], [113, 124], [29, 160], [160, 27], [27, 29],\n [211, 204], [204, 210], [210, 211], [124, 113], [113, 46], [46, 124], [106, 43], [43, 204], [204, 106], [96, 62], [62, 77], [77, 96], [227, 137], [137, 116], [116, 227], [73, 41], [41, 72], [72, 73],\n [36, 203], [203, 142], [142, 36], [235, 64], [64, 240], [240, 235], [48, 49], [49, 64], [64, 48], [42, 41], [41, 74], [74, 42], [214, 212], [212, 207], [207, 214], [183, 42], [42, 184], [184, 183],\n [210, 169], [169, 211], [211, 210], [140, 170], [170, 176], [176, 140], [104, 105], [105, 69], [69, 104], [193, 122], [122, 168], [168, 193], [50, 123], [123, 187], [187, 50], [89, 96], [96, 90], [90, 89],\n [66, 65], [65, 107], [107, 66], [179, 89], [89, 180], [180, 179], [119, 101], [101, 120], [120, 119], [68, 63], [63, 104], [104, 68], [234, 93], [93, 227], [227, 234], [16, 15], [15, 85], [85, 16],\n [209, 129], [129, 49], [49, 209], [15, 14], [14, 86], [86, 15], [107, 55], [55, 9], [9, 107], [120, 100], [100, 121], [121, 120], [153, 145], [145, 22], [22, 153], [178, 88], [88, 179], [179, 178],\n [197, 6], [6, 196], [196, 197], [89, 88], [88, 96], [96, 89], [135, 138], [138, 136], [136, 135], [138, 215], [215, 172], [172, 138], [218, 115], [115, 219], [219, 218], [41, 42], [42, 81], [81, 41],\n [5, 195], [195, 51], [51, 5], [57, 43], [43, 61], [61, 57], [208, 171], [171, 199], [199, 208], [41, 81], [81, 38], [38, 41], [224, 53], [53, 225], [225, 224], [24, 144], [144, 110], [110, 24],\n [105, 52], [52, 66], [66, 105], [118, 229], [229, 117], [117, 118], [227, 34], [34, 234], [234, 227], [66, 107], [107, 69], [69, 66], [10, 109], [109, 151], [151, 10], [219, 48], [48, 235], [235, 219],\n [183, 62], [62, 191], [191, 183], [142, 129], [129, 126], [126, 142], [116, 111], [111, 143], [143, 116], [118, 117], [117, 50], [50, 118], [223, 222], [222, 52], [52, 223], [94, 19], [19, 141], [141, 94],\n [222, 221], [221, 65], [65, 222], [196, 3], [3, 197], [197, 196], [45, 220], [220, 44], [44, 45], [156, 70], [70, 139], [139, 156], [188, 122], [122, 245], [245, 188], [139, 71], [71, 162], [162, 139],\n [149, 170], [170, 150], [150, 149], [122, 188], [188, 196], [196, 122], [206, 216], [216, 92], [92, 206], [164, 2], [2, 167], [167, 164], [242, 141], [141, 241], [241, 242], [0, 164], [164, 37], [37, 0],\n [11, 72], [72, 12], [12, 11], [12, 38], [38, 13], [13, 12], [70, 63], [63, 71], [71, 70], [31, 226], [226, 111], [111, 31], [36, 101], [101, 205], [205, 36], [203, 206], [206, 165], [165, 203],\n [126, 209], [209, 217], [217, 126], [98, 165], [165, 97], [97, 98], [237, 220], [220, 218], [218, 237], [237, 239], [239, 241], [241, 237], [210, 214], [214, 169], [169, 210], [140, 171], [171, 32], [32, 140],\n [241, 125], [125, 237], [237, 241], [179, 86], [86, 178], [178, 179], [180, 85], [85, 179], [179, 180], [181, 84], [84, 180], [180, 181], [182, 83], [83, 181], [181, 182], [194, 201], [201, 182], [182, 194],\n [177, 137], [137, 132], [132, 177], [184, 76], [76, 183], [183, 184], [185, 61], [61, 184], [184, 185], [186, 57], [57, 185], [185, 186], [216, 212], [212, 186], [186, 216], [192, 214], [214, 187], [187, 192],\n [139, 34], [34, 156], [156, 139], [218, 79], [79, 237], [237, 218], [147, 123], [123, 177], [177, 147], [45, 44], [44, 4], [4, 45], [208, 201], [201, 32], [32, 208], [98, 64], [64, 129], [129, 98],\n [192, 213], [213, 138], [138, 192], [235, 59], [59, 219], [219, 235], [141, 242], [242, 97], [97, 141], [97, 2], [2, 141], [141, 97], [240, 75], [75, 235], [235, 240], [229, 24], [24, 228], [228, 229],\n [31, 25], [25, 226], [226, 31], [230, 23], [23, 229], [229, 230], [231, 22], [22, 230], [230, 231], [232, 26], [26, 231], [231, 232], [233, 112], [112, 232], [232, 233], [244, 189], [189, 243], [243, 244],\n [189, 221], [221, 190], [190, 189], [222, 28], [28, 221], [221, 222], [223, 27], [27, 222], [222, 223], [224, 29], [29, 223], [223, 224], [225, 30], [30, 224], [224, 225], [113, 247], [247, 225], [225, 113],\n [99, 60], [60, 240], [240, 99], [213, 147], [147, 215], [215, 213], [60, 20], [20, 166], [166, 60], [192, 187], [187, 213], [213, 192], [243, 112], [112, 244], [244, 243], [244, 233], [233, 245], [245, 244],\n [245, 128], [128, 188], [188, 245], [188, 114], [114, 174], [174, 188], [134, 131], [131, 220], [220, 134], [174, 217], [217, 236], [236, 174], [236, 198], [198, 134], [134, 236], [215, 177], [177, 58], [58, 215],\n [156, 143], [143, 124], [124, 156], [25, 110], [110, 7], [7, 25], [31, 228], [228, 25], [25, 31], [264, 356], [356, 368], [368, 264], [0, 11], [11, 267], [267, 0], [451, 452], [452, 349], [349, 451],\n [267, 302], [302, 269], [269, 267], [350, 357], [357, 277], [277, 350], [350, 452], [452, 357], [357, 350], [299, 333], [333, 297], [297, 299], [396, 175], [175, 377], [377, 396], [280, 347], [347, 330], [330, 280],\n [269, 303], [303, 270], [270, 269], [151, 9], [9, 337], [337, 151], [344, 278], [278, 360], [360, 344], [424, 418], [418, 431], [431, 424], [270, 304], [304, 409], [409, 270], [272, 310], [310, 407], [407, 272],\n [322, 270], [270, 410], [410, 322], [449, 450], [450, 347], [347, 449], [432, 422], [422, 434], [434, 432], [18, 313], [313, 17], [17, 18], [291, 306], [306, 375], [375, 291], [259, 387], [387, 260], [260, 259],\n [424, 335], [335, 418], [418, 424], [434, 364], [364, 416], [416, 434], [391, 423], [423, 327], [327, 391], [301, 251], [251, 298], [298, 301], [275, 281], [281, 4], [4, 275], [254, 373], [373, 253], [253, 254],\n [375, 307], [307, 321], [321, 375], [280, 425], [425, 411], [411, 280], [200, 421], [421, 18], [18, 200], [335, 321], [321, 406], [406, 335], [321, 320], [320, 405], [405, 321], [314, 315], [315, 17], [17, 314],\n [423, 426], [426, 266], [266, 423], [396, 377], [377, 369], [369, 396], [270, 322], [322, 269], [269, 270], [413, 417], [417, 464], [464, 413], [385, 386], [386, 258], [258, 385], [248, 456], [456, 419], [419, 248],\n [298, 284], [284, 333], [333, 298], [168, 417], [417, 8], [8, 168], [448, 346], [346, 261], [261, 448], [417, 413], [413, 285], [285, 417], [326, 327], [327, 328], [328, 326], [277, 355], [355, 329], [329, 277],\n [309, 392], [392, 438], [438, 309], [381, 382], [382, 256], [256, 381], [279, 429], [429, 360], [360, 279], [365, 364], [364, 379], [379, 365], [355, 277], [277, 437], [437, 355], [282, 443], [443, 283], [283, 282],\n [281, 275], [275, 363], [363, 281], [395, 431], [431, 369], [369, 395], [299, 297], [297, 337], [337, 299], [335, 273], [273, 321], [321, 335], [348, 450], [450, 349], [349, 348], [359, 446], [446, 467], [467, 359],\n [283, 293], [293, 282], [282, 283], [250, 458], [458, 462], [462, 250], [300, 276], [276, 383], [383, 300], [292, 308], [308, 325], [325, 292], [283, 276], [276, 293], [293, 283], [264, 372], [372, 447], [447, 264],\n [346, 352], [352, 340], [340, 346], [354, 274], [274, 19], [19, 354], [363, 456], [456, 281], [281, 363], [426, 436], [436, 425], [425, 426], [380, 381], [381, 252], [252, 380], [267, 269], [269, 393], [393, 267],\n [421, 200], [200, 428], [428, 421], [371, 266], [266, 329], [329, 371], [432, 287], [287, 422], [422, 432], [290, 250], [250, 328], [328, 290], [385, 258], [258, 384], [384, 385], [446, 265], [265, 342], [342, 446],\n [386, 387], [387, 257], [257, 386], [422, 424], [424, 430], [430, 422], [445, 342], [342, 276], [276, 445], [422, 273], [273, 424], [424, 422], [306, 292], [292, 307], [307, 306], [352, 366], [366, 345], [345, 352],\n [268, 271], [271, 302], [302, 268], [358, 423], [423, 371], [371, 358], [327, 294], [294, 460], [460, 327], [331, 279], [279, 294], [294, 331], [303, 271], [271, 304], [304, 303], [436, 432], [432, 427], [427, 436],\n [304, 272], [272, 408], [408, 304], [395, 394], [394, 431], [431, 395], [378, 395], [395, 400], [400, 378], [296, 334], [334, 299], [299, 296], [6, 351], [351, 168], [168, 6], [376, 352], [352, 411], [411, 376],\n [307, 325], [325, 320], [320, 307], [285, 295], [295, 336], [336, 285], [320, 319], [319, 404], [404, 320], [329, 330], [330, 349], [349, 329], [334, 293], [293, 333], [333, 334], [366, 323], [323, 447], [447, 366],\n [316, 15], [15, 315], [315, 316], [331, 358], [358, 279], [279, 331], [317, 14], [14, 316], [316, 317], [8, 285], [285, 9], [9, 8], [277, 329], [329, 350], [350, 277], [253, 374], [374, 252], [252, 253],\n [319, 318], [318, 403], [403, 319], [351, 6], [6, 419], [419, 351], [324, 318], [318, 325], [325, 324], [397, 367], [367, 365], [365, 397], [288, 435], [435, 397], [397, 288], [278, 344], [344, 439], [439, 278],\n [310, 272], [272, 311], [311, 310], [248, 195], [195, 281], [281, 248], [375, 273], [273, 291], [291, 375], [175, 396], [396, 199], [199, 175], [312, 311], [311, 268], [268, 312], [276, 283], [283, 445], [445, 276],\n [390, 373], [373, 339], [339, 390], [295, 282], [282, 296], [296, 295], [448, 449], [449, 346], [346, 448], [356, 264], [264, 454], [454, 356], [337, 336], [336, 299], [299, 337], [337, 338], [338, 151], [151, 337],\n [294, 278], [278, 455], [455, 294], [308, 292], [292, 415], [415, 308], [429, 358], [358, 355], [355, 429], [265, 340], [340, 372], [372, 265], [352, 346], [346, 280], [280, 352], [295, 442], [442, 282], [282, 295],\n [354, 19], [19, 370], [370, 354], [285, 441], [441, 295], [295, 285], [195, 248], [248, 197], [197, 195], [457, 440], [440, 274], [274, 457], [301, 300], [300, 368], [368, 301], [417, 351], [351, 465], [465, 417],\n [251, 301], [301, 389], [389, 251], [394, 395], [395, 379], [379, 394], [399, 412], [412, 419], [419, 399], [410, 436], [436, 322], [322, 410], [326, 2], [2, 393], [393, 326], [354, 370], [370, 461], [461, 354],\n [393, 164], [164, 267], [267, 393], [268, 302], [302, 12], [12, 268], [312, 268], [268, 13], [13, 312], [298, 293], [293, 301], [301, 298], [265, 446], [446, 340], [340, 265], [280, 330], [330, 425], [425, 280],\n [322, 426], [426, 391], [391, 322], [420, 429], [429, 437], [437, 420], [393, 391], [391, 326], [326, 393], [344, 440], [440, 438], [438, 344], [458, 459], [459, 461], [461, 458], [364, 434], [434, 394], [394, 364],\n [428, 396], [396, 262], [262, 428], [274, 354], [354, 457], [457, 274], [317, 316], [316, 402], [402, 317], [316, 315], [315, 403], [403, 316], [315, 314], [314, 404], [404, 315], [314, 313], [313, 405], [405, 314],\n [313, 421], [421, 406], [406, 313], [323, 366], [366, 361], [361, 323], [292, 306], [306, 407], [407, 292], [306, 291], [291, 408], [408, 306], [291, 287], [287, 409], [409, 291], [287, 432], [432, 410], [410, 287],\n [427, 434], [434, 411], [411, 427], [372, 264], [264, 383], [383, 372], [459, 309], [309, 457], [457, 459], [366, 352], [352, 401], [401, 366], [1, 274], [274, 4], [4, 1], [418, 421], [421, 262], [262, 418],\n [331, 294], [294, 358], [358, 331], [435, 433], [433, 367], [367, 435], [392, 289], [289, 439], [439, 392], [328, 462], [462, 326], [326, 328], [94, 2], [2, 370], [370, 94], [289, 305], [305, 455], [455, 289],\n [339, 254], [254, 448], [448, 339], [359, 255], [255, 446], [446, 359], [254, 253], [253, 449], [449, 254], [253, 252], [252, 450], [450, 253], [252, 256], [256, 451], [451, 252], [256, 341], [341, 452], [452, 256],\n [414, 413], [413, 463], [463, 414], [286, 441], [441, 414], [414, 286], [286, 258], [258, 441], [441, 286], [258, 257], [257, 442], [442, 258], [257, 259], [259, 443], [443, 257], [259, 260], [260, 444], [444, 259],\n [260, 467], [467, 445], [445, 260], [309, 459], [459, 250], [250, 309], [305, 289], [289, 290], [290, 305], [305, 290], [290, 460], [460, 305], [401, 376], [376, 435], [435, 401], [309, 250], [250, 392], [392, 309],\n [376, 411], [411, 433], [433, 376], [453, 341], [341, 464], [464, 453], [357, 453], [453, 465], [465, 357], [343, 357], [357, 412], [412, 343], [437, 343], [343, 399], [399, 437], [344, 360], [360, 440], [440, 344],\n [420, 437], [437, 456], [456, 420], [360, 420], [420, 363], [363, 360], [361, 401], [401, 288], [288, 361], [265, 372], [372, 353], [353, 265], [390, 339], [339, 249], [249, 390], [339, 448], [448, 255], [255, 339],\n];\n\nfunction connectionsToIndices(connections: PairArray) {\n const indices = connections.map((connection) => connection[0]);\n indices.push(connections[connections.length - 1][1]);\n return indices;\n}\n\nexport const MEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR = {\n lips: connectionsToIndices(LIPS_CONNECTIONS),\n leftEye: connectionsToIndices(LEFT_EYE_CONNECTIONS),\n leftEyebrow: connectionsToIndices(LEFT_EYEBROW_CONNECTIONS),\n leftIris: connectionsToIndices(LEFT_IRIS_CONNECTIONS),\n rightEye: connectionsToIndices(RIGHT_EYE_CONNECTIONS),\n rightEyebrow: connectionsToIndices(RIGHT_EYEBROW_CONNECTIONS),\n rightIris: connectionsToIndices(RIGHT_IRIS_CONNECTIONS),\n faceOval: connectionsToIndices(FACE_OVAL_CONNECTIONS),\n};\n\nconst indexLabelPairs: [number, string][] = Object.entries(MEDIAPIPE_FACE_MESH_KEYPOINTS_BY_CONTOUR)\n .map(([label, indices]) => indices.map((index) => [index, label] as [number, string]))\n .flat();\n\nexport const MEDIAPIPE_FACE_MESH_KEYPOINTS = new Map(indexLabelPairs);\n\ntype AssignAverage = number[];\nexport interface LandmarksRefinementConfig {\n indexesMapping: number[]; // Maps indexes of the given set of landmarks to indexes of the resulting set of landmarks. Should be non empty and contain the same amount of indexes as landmarks in the corresponding input\n zRefinement: 'none'|'copy'|AssignAverage; // Z refinement instructions.\n}\n\nexport const LANDMARKS_REFINEMENT_LIPS_CONFIG = [\n 61, 146, 91, 181, 84, 17, 314, 405, 321, 375, 291, // Lower outer.\n 185, 40, 39, 37, 0, 267, 269, 270, 409, // Upper outer(excluding corners).\n 78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308, // Lower inner.\n 191, 80, 81, 82, 13, 312, 311, 310, 415, // Upper inner(excluding corners).\n 76, 77, 90, 180, 85, 16, 315, 404, 320, 307, 306, // Lower semi - outer.\n 184, 74, 73, 72, 11, 302, 303, 304, 408, // Upper semi - outer(excluding corners).\n 62, 96, 89, 179, 86, 15, 316, 403, 319, 325, 292, // Lower semi - inner.\n 183, 42, 41, 38, 12, 268, 271, 272, 407, // Upper semi - inner(excluding corners).\n];\n\nexport const LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG = [\n 33, 7, 163, 144, 145, 153, 154, 155, 133, // Lower contour.\n 246, 161, 160, 159, 158, 157, 173, // upper contour (excluding corners).\n 130, 25, 110, 24, 23, 22, 26, 112, 243, // Halo x2 lower contour.\n 247, 30, 29, 27, 28, 56, 190, // Halo x2 upper contour (excluding corners).\n 226, 31, 228, 229, 230, 231, 232, 233, 244, // Halo x3 lower contour.\n 113, 225, 224, 223, 222, 221, 189, // Halo x3 upper contour (excluding corners).\n 35, 124, 46, 53, 52, 65, // Halo x4 upper contour (no lower because of mesh structure) or eyebrow inner contour.\n 143, 111, 117, 118, 119, 120, 121, 128, 245, // Halo x5 lower contour.\n 156, 70, 63, 105, 66, 107, 55, 193, // Halo x5 upper contour (excluding corners) or eyebrow outer contour.\n];\n\nexport const LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG = [\n 263, 249, 390, 373, 374, 380, 381, 382, 362, // Lower contour.\n 466, 388, 387, 386, 385, 384, 398, // Upper contour (excluding corners).\n 359, 255, 339, 254, 253, 252, 256, 341, 463, // Halo x2 lower contour.\n 467, 260, 259, 257, 258, 286, 414, // Halo x2 upper contour (excluding corners).\n 446, 261, 448, 449, 450, 451, 452, 453, 464, // Halo x3 lower contour.\n 342, 445, 444, 443, 442, 441, 413, // Halo x3 upper contour (excluding corners).\n 265, 353, 276, 283, 282, 295, // Halo x4 upper contour (no lower because of mesh structure) or/ eyebrow inner contour.\n 372, 340, 346, 347, 348, 349, 350, 357, 465, // Halo x5 lower contour.\n 383, 300, 293, 334, 296, 336, 285, 417, // Halo x5 upper contour (excluding corners) or eyebrow outer contour.\n];\n\nexport const LANDMARKS_REFINEMENT_LEFT_IRIS_CONFIG = [\n 468, // Center.\n 469, // Iris right edge.\n 470, // Iris top edge.\n 471, // Iris left edge.\n 472, // Iris bottom edge.\n];\n/*\nzRefinement: [\n 33, 7, 163, 144, 145, 153, 154, 155, 133, // Lower contour.\n 246, 161, 160, 159, 158, 157, 173, // Upper contour (excluding corners).\n];\n*/\n\nexport const LANDMARKS_REFINEMENT_RIGHT_IRIS_CONFIG = [\n 473, // Center.\n 474, // Iris right edge.\n 475, // Iris top edge.\n 476, // Iris left edge.\n 477, // Iris bottom edge.\n];\n/*\nzRefinement: [\n 263, 249, 390, 373, 374, 380, 381, 382, 362, // Lower contour.\n 466, 388, 387, 386, 385, 384, 398, // Upper contour (excluding corners).\n];\n*/\n", "import { TRI468 as triangulation } from '../face/facemeshcoords';\nimport { mergeDeep } from '../util/util';\nimport { getCanvasContext, rad2deg, rect, point, lines, arrow, labels, replace } from './primitives';\nimport { options } from './options';\nimport * as facemeshConstants from '../face/constants';\nimport type { FaceResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\nlet localOptions: DrawOptions;\n\nfunction drawLabels(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (!localOptions.drawLabels || (localOptions.faceLabels?.length === 0)) return;\n let l = localOptions.faceLabels.slice();\n l = replace(l, '[id]', f.id.toFixed(0));\n if (f.score) l = replace(l, '[score]', 100 * f.score);\n if (f.gender) l = replace(l, '[gender]', f.gender);\n if (f.genderScore) l = replace(l, '[genderScore]', 100 * f.genderScore);\n if (f.age) l = replace(l, '[age]', f.age);\n if (f.distance) l = replace(l, '[distance]', 100 * f.distance);\n if (f.real) l = replace(l, '[real]', 100 * f.real);\n if (f.live) l = replace(l, '[live]', 100 * f.live);\n if (f.emotion && f.emotion.length > 0) {\n const emotion = f.emotion.map((a) => `${Math.trunc(100 * a.score)}% ${a.emotion}`);\n if (emotion.length > 3) emotion.length = 3;\n l = replace(l, '[emotions]', emotion.join(' '));\n }\n if (f.rotation?.angle?.roll) l = replace(l, '[roll]', rad2deg(f.rotation.angle.roll));\n if (f.rotation?.angle?.yaw) l = replace(l, '[yaw]', rad2deg(f.rotation.angle.yaw));\n if (f.rotation?.angle?.pitch) l = replace(l, '[pitch]', rad2deg(f.rotation.angle.pitch));\n if (f.rotation?.gaze?.bearing) l = replace(l, '[gaze]', rad2deg(f.rotation.gaze.bearing));\n labels(ctx, l, f.box[0], f.box[1], localOptions);\n}\n\nfunction drawIrisElipse(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n // iris: array[center, left, top, right, bottom]\n if (f.annotations?.leftEyeIris && f.annotations?.leftEyeIris[0]) {\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?.rightEyeIris && f.annotations?.rightEyeIris[0]) {\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\nfunction drawGazeSpheres(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawGaze && f.rotation?.angle && typeof Path2D !== 'undefined') {\n ctx.strokeStyle = 'pink';\n const valX = (f.box[0] + f.box[2] / 2) - (f.box[3] * rad2deg(f.rotation.angle.yaw) / 90);\n const valY = (f.box[1] + f.box[3] / 2) + (f.box[2] * rad2deg(f.rotation.angle.pitch) / 90);\n const pathV = new Path2D(`\n M ${f.box[0] + f.box[2] / 2} ${f.box[1]}\n C\n ${valX} ${f.box[1]},\n ${valX} ${f.box[1] + f.box[3]},\n ${f.box[0] + f.box[2] / 2} ${f.box[1] + f.box[3]}\n `);\n const pathH = new Path2D(`\n M ${f.box[0]} ${f.box[1] + f.box[3] / 2}\n C \n ${f.box[0]} ${valY},\n ${f.box[0] + f.box[2]} ${valY},\n ${f.box[0] + f.box[2]} ${f.box[1] + f.box[3] / 2}\n `);\n ctx.stroke(pathH);\n ctx.stroke(pathV);\n }\n}\n\nfunction drawGazeArrows(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawGaze && f.rotation?.gaze.strength && f.rotation.gaze.bearing && f.annotations.leftEyeIris && f.annotations.rightEyeIris && f.annotations.leftEyeIris[0] && f.annotations.rightEyeIris[0]) {\n ctx.strokeStyle = 'pink';\n ctx.fillStyle = 'pink';\n const leftGaze = [\n f.annotations.leftEyeIris[0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations.leftEyeIris[0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n arrow(ctx, [f.annotations.leftEyeIris[0][0], f.annotations.leftEyeIris[0][1]], [leftGaze[0], leftGaze[1]], 4);\n const rightGaze = [\n f.annotations.rightEyeIris[0][0] + (Math.sin(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[3]),\n f.annotations.rightEyeIris[0][1] + (Math.cos(f.rotation.gaze.bearing) * f.rotation.gaze.strength * f.box[2]),\n ];\n arrow(ctx, [f.annotations.rightEyeIris[0][0], f.annotations.rightEyeIris[0][1]], [rightGaze[0], rightGaze[1]], 4);\n }\n}\n\nfunction drawFacePolygons(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawPolygons && f.mesh.length >= 468) {\n ctx.lineWidth = 1;\n for (let i = 0; i < triangulation.length / 3; i++) {\n const points = [triangulation[i * 3 + 0], triangulation[i * 3 + 1], triangulation[i * 3 + 2]].map((index) => f.mesh[index]);\n lines(ctx, points, localOptions);\n }\n drawIrisElipse(f, ctx);\n }\n /*\n if (localOptions.drawPolygons && f.contours.length > 1) {\n ctx.lineWidth = 5;\n lines(ctx, f.contours, opt);\n }\n ctx.lineWidth = 1;\n */\n}\n\nfunction drawFacePoints(f: FaceResult, ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) {\n if (localOptions.drawPoints) {\n if (f?.mesh.length >= 468) {\n for (let i = 0; i < f.mesh.length; i++) {\n point(ctx, f.mesh[i][0], f.mesh[i][1], f.mesh[i][2], localOptions);\n if (localOptions.drawAttention) {\n if (facemeshConstants.LANDMARKS_REFINEMENT_LIPS_CONFIG.includes(i)) point(ctx, f.mesh[i][0], f.mesh[i][1], (f.mesh[i][2] as number) + 127, localOptions);\n if (facemeshConstants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.includes(i)) point(ctx, f.mesh[i][0], f.mesh[i][1], (f.mesh[i][2] as number) - 127, localOptions);\n if (facemeshConstants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.includes(i)) point(ctx, f.mesh[i][0], f.mesh[i][1], (f.mesh[i][2] as number) - 127, localOptions);\n }\n }\n } else {\n for (const [k, v] of Object.entries(f?.annotations || {})) {\n if (!v?.[0]) continue;\n const pt = v[0];\n point(ctx, pt[0], pt[1], 0, localOptions);\n if (localOptions.drawLabels) labels(ctx, k, pt[0], pt[1], localOptions);\n }\n }\n }\n}\n\nfunction drawFaceBoxes(f: FaceResult, ctx) {\n if (localOptions.drawBoxes) {\n rect(ctx, f.box[0], f.box[1], f.box[2], f.box[3], localOptions);\n }\n}\n\n/** draw detected faces */\nexport function face(inCanvas: AnyCanvas, result: FaceResult[], drawOptions?: Partial) {\n localOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.font = localOptions.font;\n ctx.strokeStyle = localOptions.color;\n ctx.fillStyle = localOptions.color;\n for (const f of result) {\n drawFaceBoxes(f, ctx);\n drawLabels(f, ctx);\n if (f.mesh && f.mesh.length > 0) {\n drawFacePoints(f, ctx);\n drawFacePolygons(f, ctx);\n drawGazeSpheres(f, ctx);\n drawGazeArrows(f, ctx);\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, rect, point, curves, colorDepth, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { BodyResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\n/** draw detected bodies */\nexport function body(inCanvas: AnyCanvas, result: BodyResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\n if (!ctx) return;\n ctx.lineJoin = 'round';\n for (let i = 0; i < result.length; 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 && result[i].box && result[i].box.length === 4) {\n rect(ctx, result[i].box[0], result[i].box[1], result[i].box[2], result[i].box[3], localOptions);\n if (localOptions.drawLabels && (localOptions.bodyLabels?.length > 0)) {\n let l = localOptions.bodyLabels.slice();\n l = replace(l, '[id]', result[i].id.toFixed(0));\n l = replace(l, '[score]', 100 * result[i].score);\n labels(ctx, l, result[i].box[0], result[i].box[1], localOptions);\n }\n }\n if (localOptions.drawPoints && result[i].keypoints) {\n for (let pt = 0; pt < result[i].keypoints.length; pt++) {\n if (!result[i].keypoints[pt].score || (result[i].keypoints[pt].score === 0)) continue;\n ctx.fillStyle = colorDepth(result[i].keypoints[pt].position[2], localOptions);\n point(ctx, result[i].keypoints[pt].position[0], result[i].keypoints[pt].position[1], 0, localOptions);\n }\n }\n if (localOptions.drawLabels && (localOptions.bodyPartLabels?.length > 0) && result[i].keypoints) {\n ctx.font = localOptions.font;\n for (const pt of result[i].keypoints) {\n if (!pt.score || (pt.score === 0)) continue;\n let l = localOptions.bodyPartLabels.slice();\n l = replace(l, '[label]', pt.part);\n l = replace(l, '[score]', 100 * pt.score);\n labels(ctx, l, pt.position[0], pt.position[1], localOptions);\n }\n }\n if (localOptions.drawPolygons && result[i].keypoints && result[i].annotations) {\n for (const part of Object.values(result[i].annotations)) {\n for (const connected of part) curves(ctx, connected, localOptions);\n }\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, rect, point, colorDepth, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { HandResult } from '../result';\nimport type { AnyCanvas, DrawOptions, Point } from '../exports';\n\n/** draw detected hands */\nexport function hand(inCanvas: AnyCanvas, result: HandResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\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 rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels && (localOptions.handLabels?.length > 0)) {\n let l = localOptions.handLabels.slice();\n l = replace(l, '[id]', h.id.toFixed(0));\n l = replace(l, '[label]', h.label);\n l = replace(l, '[score]', 100 * h.score);\n labels(ctx, l, h.box[0], h.box[1], localOptions);\n }\n ctx.stroke();\n }\n if (localOptions.drawPoints) {\n if (h.keypoints && h.keypoints.length > 0) {\n for (const pt of h.keypoints) {\n ctx.fillStyle = colorDepth(pt[2], localOptions);\n point(ctx, pt[0], pt[1], 0, localOptions);\n }\n }\n }\n if (localOptions.drawLabels && h.annotations && (localOptions.fingerLabels?.length > 0)) {\n for (const [part, pt] of Object.entries(h.annotations)) {\n let l = localOptions.fingerLabels.slice();\n l = replace(l, '[label]', part);\n labels(ctx, l, pt[pt.length - 1][0], pt[pt.length - 1][1], localOptions);\n }\n }\n if (localOptions.drawPolygons && h.annotations) {\n const addHandLine = (part: Point[]) => {\n if (!part || part.length === 0 || !part[0]) return;\n for (let i = 0; i < part.length; i++) {\n ctx.beginPath();\n const z = part[i][2] || 0;\n ctx.strokeStyle = colorDepth(i * z, localOptions);\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 ctx.lineWidth = localOptions.lineWidth;\n addHandLine(h.annotations.index);\n addHandLine(h.annotations.middle);\n addHandLine(h.annotations.ring);\n addHandLine(h.annotations.pinky);\n addHandLine(h.annotations.thumb);\n // addPart(h.annotations.palm);\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, rect, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { ObjectResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\n/** draw detected objects */\nexport function object(inCanvas: AnyCanvas, result: ObjectResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\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 rect(ctx, h.box[0], h.box[1], h.box[2], h.box[3], localOptions);\n if (localOptions.drawLabels && (localOptions.objectLabels?.length > 0)) {\n let l = localOptions.objectLabels.slice();\n l = replace(l, '[id]', h.id.toFixed(0));\n l = replace(l, '[label]', h.label);\n l = replace(l, '[score]', 100 * h.score);\n labels(ctx, l, h.box[0], h.box[1], localOptions);\n }\n ctx.stroke();\n }\n }\n}\n", "import { mergeDeep } from '../util/util';\nimport { getCanvasContext, replace, labels } from './primitives';\nimport { options } from './options';\nimport type { GestureResult } from '../result';\nimport type { AnyCanvas, DrawOptions } from '../exports';\n\n/** draw detected gestures */\nexport function gesture(inCanvas: AnyCanvas, result: GestureResult[], drawOptions?: Partial) {\n const localOptions: DrawOptions = mergeDeep(options, drawOptions);\n if (!result || !inCanvas) return;\n if (localOptions.drawGestures && (localOptions.gestureLabels?.length > 0)) {\n const ctx = getCanvasContext(inCanvas) as CanvasRenderingContext2D;\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 const [where, what] = Object.entries(result[j]);\n if ((what.length > 1) && ((what[1] as string).length > 0)) {\n const who = where[1] as number > 0 ? `#${where[1]}` : '';\n let l = localOptions.gestureLabels.slice();\n l = replace(l, '[where]', where[0]);\n l = replace(l, '[who]', who);\n l = replace(l, '[what]', what[1]);\n labels(ctx, l, 8, 2 + (i * localOptions.lineHeight), localOptions);\n i += 1;\n }\n }\n }\n}\n", "export const defaultLabels = {\n face: `face\n confidence: [score]%\n [gender] [genderScore]%\n age: [age] years\n distance: [distance]cm\n real: [real]%\n live: [live]%\n [emotions]\n roll: [roll]\u00B0 yaw:[yaw]\u00B0 pitch:[pitch]\u00B0\n gaze: [gaze]\u00B0`,\n body: 'body [score]%',\n bodyPart: '[label] [score]%',\n object: '[label] [score]%',\n hand: '[label] [score]%',\n finger: '[label]',\n gesture: '[where] [who]: [what]',\n};\n", "/* eslint-disable no-multi-spaces */\n\nexport const kpt: string[] = [\n 'nose', // 0\n 'leftEyeInside', // 1\n 'leftEye', // 2\n 'leftEyeOutside', // 3\n 'rightEyeInside', // 4\n 'rightEye', // 5\n 'rightEyeOutside', // 6\n 'leftEar', // 7\n 'rightEar', // 8\n 'leftMouth', // 9\n 'rightMouth', // 10\n 'leftShoulder', // 11\n 'rightShoulder', // 12\n 'leftElbow', // 13\n 'rightElbow', // 14\n 'leftWrist', // 15\n 'rightWrist', // 16\n 'leftPinky', // 17\n 'rightPinky', // 18\n 'leftIndex', // 19\n 'rightIndex', // 20\n 'leftThumb', // 21\n 'rightThumb', // 22\n 'leftHip', // 23\n 'rightHip', // 24\n 'leftKnee', // 25\n 'rightKnee', // 26\n 'leftAnkle', // 27\n 'rightAnkle', // 28\n 'leftHeel', // 29\n 'rightHeel', // 30\n 'leftFoot', // 31\n 'rightFoot', // 32\n 'bodyCenter', // 33\n 'bodyTop', // 34\n 'leftPalm', // 35 // z-coord not ok\n 'leftHand', // 36 // similar to wrist but z-coord not ok\n 'rightPalm', // 37 // z-coord not ok\n 'rightHand', // 38 // similar to wrist but z-coord not ok\n];\n\nexport const connected: Record = {\n shoulders: ['leftShoulder', 'rightShoulder'],\n hips: ['rightHip', 'leftHip'],\n mouth: ['leftMouth', 'rightMouth'],\n leftLegUpper: ['leftHip', 'leftKnee'],\n leftLegLower: ['leftKnee', 'leftAnkle'],\n leftFoot: ['leftAnkle', 'leftHeel', 'leftFoot'],\n leftTorso: ['leftShoulder', 'leftHip'],\n leftArmUpper: ['leftShoulder', 'leftElbow'],\n leftArmLower: ['leftElbow', 'leftWrist'],\n leftHand: ['leftWrist', 'leftPalm'],\n leftHandPinky: ['leftPalm', 'leftPinky'],\n leftHandIndex: ['leftPalm', 'leftIndex'],\n leftHandThumb: ['leftPalm', 'leftThumb'],\n leftEyeOutline: ['leftEyeInside', 'leftEyeOutside'],\n rightLegUpper: ['rightHip', 'rightKnee'],\n rightLegLower: ['rightKnee', 'rightAnkle'],\n rightFoot: ['rightAnkle', 'rightHeel', 'rightFoot'],\n rightTorso: ['rightShoulder', 'rightHip'],\n rightArmUpper: ['rightShoulder', 'rightElbow'],\n rightArmLower: ['rightElbow', 'rightWrist'],\n rightHand: ['rightWrist', 'rightPalm'],\n rightHandPinky: ['rightPalm', 'rightPinky'],\n rightHandIndex: ['rightPalm', 'rightIndex'],\n rightHandThumb: ['rightPalm', 'rightThumb'],\n rightEyeOutline: ['rightEyeInside', 'rightEyeOutside'],\n};\n", "import * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { env } from '../util/env';\nimport { loadModel } from '../tfjs/load';\nimport type { Box } from '../result';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor1D, Tensor2D } from '../tfjs/types';\n\nexport interface DetectedBox { box: Box, boxRaw: Box, score: number }\n\nlet model: GraphModel | null;\nlet inputSize = 224;\nlet anchorTensor: { x, y };\nconst numLayers = 5;\nconst strides = [8, 16, 32, 32, 32];\n\nexport function createAnchors() {\n const anchors: { x: number, y: number }[] = [];\n let layerId = 0;\n while (layerId < numLayers) {\n let anchorCount = 0;\n let lastSameStrideLayer = layerId;\n while (lastSameStrideLayer < strides.length && strides[lastSameStrideLayer] === strides[layerId]) {\n anchorCount += 2;\n lastSameStrideLayer++;\n }\n const stride = strides[layerId];\n const featureMapHeight = Math.ceil(inputSize / stride);\n const featureMapWidth = Math.ceil(inputSize / stride);\n for (let y = 0; y < featureMapHeight; ++y) {\n for (let x = 0; x < featureMapWidth; ++x) {\n for (let anchorId = 0; anchorId < anchorCount; ++anchorId) {\n anchors.push({ x: (x + 0.5) / featureMapWidth, y: (y + 0.5) / featureMapHeight });\n }\n }\n }\n layerId = lastSameStrideLayer;\n }\n anchorTensor = { x: tf.tensor1d(anchors.map((a) => a.x)), y: tf.tensor1d(anchors.map((a) => a.y)) };\n}\n\nexport async function loadDetector(config: Config): Promise {\n if (env.initial) model = null;\n if (!model && config.body['detector'] && config.body['detector'].modelPath || '') {\n model = await loadModel(config.body['detector'].modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n } else if (config.debug && model) log('cached model:', model['modelUrl']);\n createAnchors();\n return model as GraphModel;\n}\n\nconst cropFactor = [5.0, 5.0];\nexport function decodeBoxes(boxesTensor, anchor) {\n return tf.tidy(() => {\n const split = tf.split(boxesTensor, 12, 1); // first 4 are box data [x,y,w,h] and 4 are keypoints data [x,y] for total of 12\n let xCenter = tf.squeeze(split[0]);\n let yCenter = tf.squeeze(split[1]);\n let width = tf.squeeze(split[2]);\n let height = tf.squeeze(split[3]);\n xCenter = tf.add(tf.div(xCenter, inputSize), anchor.x);\n yCenter = tf.add(tf.div(yCenter, inputSize), anchor.y);\n width = tf.mul(tf.div(width, inputSize), cropFactor[0]);\n height = tf.mul(tf.div(height, inputSize), cropFactor[1]);\n const xMin = tf.sub(xCenter, tf.div(width, 2));\n const yMin = tf.sub(yCenter, tf.div(height, 2));\n const xMax = tf.add(xMin, width);\n const yMax = tf.add(yMin, height);\n const boxes = tf.stack([xMin, yMin, xMax, yMax], 1);\n return boxes;\n });\n}\n\nasync function decodeResults(boxesTensor: Tensor, logitsTensor: Tensor, config: Config, outputSize: [number, number]): Promise {\n const detectedBoxes: DetectedBox[] = [];\n const t: Record = {};\n t.boxes = decodeBoxes(boxesTensor, anchorTensor);\n t.scores = tf.sigmoid(logitsTensor);\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.scores as Tensor1D, 1, config.body['detector']?.minConfidence || 0.1, config.body['detector']?.iouThreshold || 0.1);\n const nms = await t.nms.data();\n const scores = await t.scores.data();\n const boxes = await t.boxes.array();\n for (const i of Array.from(nms)) {\n const score = scores[i];\n const boxRaw: Box = boxes[i];\n const box: Box = [Math.round(boxRaw[0] * outputSize[0]), Math.round(boxRaw[1] * outputSize[1]), Math.round(boxRaw[2] * outputSize[0]), Math.round(boxRaw[3] * outputSize[1])];\n const detectedBox: DetectedBox = { score, boxRaw, box };\n detectedBoxes.push(detectedBox);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return detectedBoxes;\n}\n\nexport async function detectBoxes(input: Tensor, config: Config, outputSize: [number, number]) {\n const t: Record = {};\n t.res = model?.execute(input, ['Identity']) as Tensor; //\n t.logitsRaw = tf.slice(t.res, [0, 0, 0], [1, -1, 1]);\n t.boxesRaw = tf.slice(t.res, [0, 0, 1], [1, -1, -1]);\n t.logits = tf.squeeze(t.logitsRaw);\n t.boxes = tf.squeeze(t.boxesRaw);\n const boxes = await decodeResults(t.boxes, t.logits, config, outputSize);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return boxes;\n}\n", "import type { Point, Box } from '../result';\n\nexport function calc(keypoints: Point[], outputSize: [number, number] = [1, 1]) {\n const coords = [keypoints.map((pt) => pt[0]), keypoints.map((pt) => pt[1])]; // all x/y coords\n const min = [Math.min(...coords[0]), Math.min(...coords[1])];\n const max = [Math.max(...coords[0]), Math.max(...coords[1])];\n const box: Box = [min[0], min[1], max[0] - min[0], max[1] - min[1]];\n const boxRaw: Box = [box[0] / outputSize[0], box[1] / outputSize[1], box[2] / outputSize[0], box[3] / outputSize[1]];\n return { box, boxRaw };\n}\n\nexport function square(keypoints: Point[], outputSize: [number, number] = [1, 1]) {\n const coords = [keypoints.map((pt) => pt[0]), keypoints.map((pt) => pt[1])]; // all x/y coords\n const min = [Math.min(...coords[0]), Math.min(...coords[1])];\n const max = [Math.max(...coords[0]), Math.max(...coords[1])];\n const center = [(min[0] + max[0]) / 2, (min[1] + max[1]) / 2]; // find center x and y coord of all fingers\n const dist = Math.max(center[0] - min[0], center[1] - min[1], -center[0] + max[0], -center[1] + max[1]); // largest distance from center in any direction\n const box: Box = [Math.trunc(center[0] - dist), Math.trunc(center[1] - dist), Math.trunc(2 * dist), Math.trunc(2 * dist)];\n const boxRaw: Box = [box[0] / outputSize[0], box[1] / outputSize[1], box[2] / outputSize[0], box[3] / outputSize[1]];\n return { box, boxRaw };\n}\n\nexport function scale(box: Box, scaleFact: number) {\n const dist = [box[2] * scaleFact, box[3] * scaleFact];\n const newBox: Box = [\n box[0] - (dist[0] - box[2]) / 2,\n box[1] - (dist[1] - box[3]) / 2,\n dist[0],\n dist[1],\n ];\n return newBox;\n}\n\nexport function crop(box: Box) { // [y1, x1, y2, x2] clamped to 0..1\n const yxBox: Box = [Math.max(0, box[1]), Math.max(0, box[0]), Math.min(1, box[3] + box[1]), Math.min(1, box[2] + box[0])];\n return yxBox;\n}\n", "/**\n * BlazePose model implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport { log, now } from '../util/util';\nimport type { BodyKeypoint, BodyResult, BodyLandmark, Box, Point, BodyAnnotation } from '../result';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport * as coords from './blazeposecoords';\nimport { loadDetector, detectBoxes, DetectedBox } from './blazeposedetector';\nimport * as box from '../util/box';\nimport { env } from '../util/env';\n\n// const models: [GraphModel | null, GraphModel | null] = [null, null];\nlet model: GraphModel | null;\nlet inputSize = 256;\nlet skipped = Number.MAX_SAFE_INTEGER;\nconst outputNodes: { detector: string[], landmarks: string[] } = {\n landmarks: ['ld_3d', 'activation_segmentation', 'activation_heatmap', 'world_3d', 'output_poseflag'],\n detector: [],\n};\n\nconst cache: BodyResult[] = [];\nlet padding: [number, number][] = [[0, 0], [0, 0], [0, 0], [0, 0]];\nlet lastTime = 0;\n\nconst sigmoid = (x) => (1 - (1 / (1 + Math.exp(x))));\n\nexport const loadDetect = (config: Config): Promise => loadDetector(config);\n\nexport async function loadPose(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await loadModel(config.body.modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nfunction prepareImage(input: Tensor4D, size: number, cropBox?: Box): Tensor {\n const t: Record = {};\n if (!input?.shape?.[1] || !input?.shape?.[2]) return input;\n let final: Tensor;\n if (cropBox) {\n t.cropped = tf.image.cropAndResize(input, [cropBox], [0], [input.shape[1], input.shape[2]]); // if we have cached box use it to crop input\n }\n if (input.shape[1] !== input.shape[2]) { // only pad if width different than height\n const height: [number, number] = [\n input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0,\n input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0,\n ];\n const width: [number, number] = [\n input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0,\n input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0,\n ];\n padding = [\n [0, 0], // dont touch batch\n height, // height before&after\n width, // width before&after\n [0, 0], // dont touch rbg\n ];\n t.pad = tf.pad(t.cropped || input, padding); // use cropped box if it exists\n t.resize = tf.image.resizeBilinear(t.pad as Tensor4D, [size, size]);\n final = tf.div(t.resize, constants.tf255);\n } else if (input.shape[1] !== size) { // if input needs resizing\n t.resize = tf.image.resizeBilinear(t.cropped as Tensor4D || input, [size, size]);\n final = tf.div(t.resize, constants.tf255);\n } else { // if input is already in a correct resolution just normalize it\n final = tf.div(t.cropped || input, constants.tf255);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return final;\n}\n\nfunction rescaleKeypoints(keypoints: BodyKeypoint[], outputSize: [number, number], cropBox?: Box): BodyKeypoint[] {\n for (const kpt of keypoints) { // first rescale due to padding\n kpt.position = [\n Math.trunc(kpt.position[0] * (outputSize[0] + padding[2][0] + padding[2][1]) / outputSize[0] - padding[2][0]),\n Math.trunc(kpt.position[1] * (outputSize[1] + padding[1][0] + padding[1][1]) / outputSize[1] - padding[1][0]),\n kpt.position[2] as number,\n ];\n kpt.positionRaw = [kpt.position[0] / outputSize[0], kpt.position[1] / outputSize[1], 2 * (kpt.position[2] as number) / (outputSize[0] + outputSize[1])];\n }\n if (cropBox) { // second rescale due to cropping\n const width = cropBox[2] - cropBox[0];\n const height = cropBox[3] - cropBox[1];\n for (const kpt of keypoints) {\n kpt.positionRaw = [\n kpt.positionRaw[0] / height + cropBox[1], // correct offset due to crop\n kpt.positionRaw[1] / width + cropBox[0], // correct offset due to crop\n kpt.positionRaw[2] as number,\n ];\n kpt.position = [\n Math.trunc(kpt.positionRaw[0] * outputSize[0]),\n Math.trunc(kpt.positionRaw[1] * outputSize[1]),\n kpt.positionRaw[2] as number,\n ];\n }\n }\n return keypoints;\n}\n\nfunction fixKeypoints(keypoints: BodyKeypoint[]) {\n // palm z-coord is incorrect around near-zero so we approximate it\n const leftPalm = keypoints.find((k) => k.part === 'leftPalm') as BodyKeypoint;\n const leftWrist = keypoints.find((k) => k.part === 'leftWrist') as BodyKeypoint;\n const leftIndex = keypoints.find((k) => k.part === 'leftIndex') as BodyKeypoint;\n leftPalm.position[2] = ((leftWrist.position[2] || 0) + (leftIndex.position[2] || 0)) / 2;\n const rightPalm = keypoints.find((k) => k.part === 'rightPalm') as BodyKeypoint;\n const rightWrist = keypoints.find((k) => k.part === 'rightWrist') as BodyKeypoint;\n const rightIndex = keypoints.find((k) => k.part === 'rightIndex') as BodyKeypoint;\n rightPalm.position[2] = ((rightWrist.position[2] || 0) + (rightIndex.position[2] || 0)) / 2;\n}\n\nasync function detectLandmarks(input: Tensor, config: Config, outputSize: [number, number]): Promise {\n /**\n * t.ld: 39 keypoints [x,y,z,score,presence] normalized to input size\n * t.segmentation:\n * t.heatmap:\n * t.world: 39 keypoints [x,y,z] normalized to -1..1\n * t.poseflag: body score\n */\n if (!model?.['executor']) return null;\n const t: Record = {};\n [t.ld/* 1,195(39*5) */, t.segmentation/* 1,256,256,1 */, t.heatmap/* 1,64,64,39 */, t.world/* 1,117(39*3) */, t.poseflag/* 1,1 */] = model?.execute(input, outputNodes.landmarks) as Tensor[]; // run model\n const poseScore = (await t.poseflag.data())[0];\n const points = await t.ld.data();\n const distances = await t.world.data();\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor])); // dont need tensors after this\n const keypointsRelative: BodyKeypoint[] = [];\n const depth = 5; // each points has x,y,z,visibility,presence\n for (let i = 0; i < points.length / depth; i++) {\n const score = sigmoid(points[depth * i + 3]);\n const presence = sigmoid(points[depth * i + 4]);\n const adjScore = Math.trunc(100 * score * presence * poseScore) / 100;\n const positionRaw: Point = [points[depth * i + 0] / inputSize, points[depth * i + 1] / inputSize, points[depth * i + 2] + 0];\n const position: Point = [Math.trunc(outputSize[0] * positionRaw[0]), Math.trunc(outputSize[1] * positionRaw[1]), positionRaw[2] as number];\n const distance: Point = [distances[depth * i + 0], distances[depth * i + 1], distances[depth * i + 2] + 0];\n keypointsRelative.push({ part: coords.kpt[i] as BodyLandmark, positionRaw, position, distance, score: adjScore });\n }\n if (poseScore < (config.body.minConfidence || 0)) return null;\n fixKeypoints(keypointsRelative);\n const keypoints: BodyKeypoint[] = rescaleKeypoints(keypointsRelative, outputSize); // keypoints were relative to input image which is padded\n const kpts = keypoints.map((k) => k.position);\n const boxes = box.calc(kpts, [outputSize[0], outputSize[1]]); // now find boxes based on rescaled keypoints\n const annotations: Record = {} as Record;\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kpt) => kpt.part === indexes[i]);\n const pt1 = keypoints.find((kpt) => kpt.part === indexes[i + 1]);\n if (pt0 && pt1) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n const body = { id: 0, score: Math.trunc(100 * poseScore) / 100, box: boxes.box, boxRaw: boxes.boxRaw, keypoints, annotations };\n return body;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n const outputSize: [number, number] = [input.shape[2] || 0, input.shape[1] || 0];\n const skipTime = (config.body.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.body.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && cache !== null) {\n skipped++;\n } else {\n let boxes: DetectedBox[] = [];\n if (config.body?.['detector']?.['enabled']) {\n const preparedImage = prepareImage(input, 224);\n boxes = await detectBoxes(preparedImage, config, outputSize);\n tf.dispose(preparedImage);\n } else {\n boxes = [{ box: [0, 0, 0, 0] as Box, boxRaw: [0, 0, 1, 1], score: 0 }]; // running without detector\n }\n for (let i = 0; i < boxes.length; i++) {\n const preparedBox = prepareImage(input, 256, boxes[i]?.boxRaw); // padded and resized\n cache.length = 0;\n const bodyResult = await detectLandmarks(preparedBox, config, outputSize);\n tf.dispose(preparedBox);\n if (!bodyResult) continue;\n bodyResult.id = i;\n // bodyResult.score = 0; // TBD\n cache.push(bodyResult);\n }\n /*\n cropBox = [0, 0, 1, 1]; // reset crop coordinates\n if (cache?.boxRaw && config.skipAllowed) {\n const cx = (2.0 * cache.boxRaw[0] + cache.boxRaw[2]) / 2;\n const cy = (2.0 * cache.boxRaw[1] + cache.boxRaw[3]) / 2;\n let size = cache.boxRaw[2] > cache.boxRaw[3] ? cache.boxRaw[2] : cache.boxRaw[3];\n size = (size * 1.0) / 2; // enlarge and half it\n if (cx > 0.1 && cx < 0.9 && cy > 0.1 && cy < 0.9 && size > 0.1) { // only update if box is sane\n const y = 0; // cy - size;\n const x = cx - size;\n cropBox = [y, x, y + 1, x + 1]; // [y0,x0,y1,x1] used for cropping but width/height are not yet implemented so we only reposition image to center of body\n }\n }\n */\n lastTime = now();\n skipped = 0;\n }\n return cache;\n}\n", "/**\n * CoCo Labels used by object detection implementations\n */\nexport 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", "/**\n * CenterNet object detection model implementation\n *\n * Based on: [**MB3-CenterNet**](https://github.com/610265158/mobilenetv3_centernet)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { labels } from './labels';\nimport type { ObjectResult, ObjectType, Box } from '../result';\nimport type { GraphModel, Tensor, Tensor1D, Tensor2D, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nlet last: ObjectResult[] = [];\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n // fakeOps(['floormod'], config);\n model = await loadModel(config.object.modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nasync function process(res: Tensor | null, outputShape: [number, number], config: Config) {\n if (!res) return [];\n const t: Record = {};\n const results: ObjectResult[] = [];\n const detections = await res.array() as number[][][];\n t.squeeze = tf.squeeze(res);\n const arr = tf.split(t.squeeze, 6, 1); // x1, y1, x2, y2, score, class\n t.stack = tf.stack([arr[1], arr[0], arr[3], arr[2]], 1); // reorder dims as tf.nms expects y, x\n t.boxes = tf.squeeze(t.stack);\n t.scores = tf.squeeze(arr[4]);\n t.classes = tf.squeeze(arr[5]);\n tf.dispose([res, ...arr]);\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.scores as Tensor1D, config.object.maxDetected || 0, config.object.iouThreshold, (config.object.minConfidence || 0));\n const nms = await t.nms.data();\n let i = 0;\n for (const id of Array.from(nms)) {\n const score = Math.trunc(100 * detections[0][id][4]) / 100;\n const classVal = detections[0][id][5];\n if (Number.isNaN(classVal)) continue;\n const label = labels[classVal].label as ObjectType;\n const [x, y] = [\n detections[0][id][0] / inputSize,\n detections[0][id][1] / inputSize,\n ];\n const boxRaw: Box = [\n x,\n y,\n detections[0][id][2] / inputSize - x,\n detections[0][id][3] / inputSize - y,\n ];\n const box: Box = [\n Math.trunc(boxRaw[0] * outputShape[0]),\n Math.trunc(boxRaw[1] * outputShape[1]),\n Math.trunc(boxRaw[2] * outputShape[0]),\n Math.trunc(boxRaw[3] * outputShape[1]),\n ];\n results.push({ id: i++, score, class: classVal, label, box, boxRaw });\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return results;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model?.['executor']) return [];\n const skipTime = (config.object.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.object.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const outputSize = [input.shape[2] || 0, input.shape[1] || 0] as [number, number];\n const resize = tf.image.resizeBilinear(input, [inputSize, inputSize]);\n const objectT = config.object.enabled ? model?.execute(resize, ['tower_0/detections']) as Tensor : null;\n lastTime = now();\n tf.dispose(resize);\n\n const obj = await process(objectT, outputSize, config);\n last = obj;\n\n resolve(obj);\n });\n}\n", "export const kpt: string[] = [\n 'head',\n 'neck',\n 'rightShoulder',\n 'rightElbow',\n 'rightWrist',\n 'chest',\n 'leftShoulder',\n 'leftElbow',\n 'leftWrist',\n 'bodyCenter',\n 'rightHip',\n 'rightKnee',\n 'rightAnkle',\n 'leftHip',\n 'leftKnee',\n 'leftAnkle',\n];\n\nexport const connected: Record = {\n leftLeg: ['leftHip', 'leftKnee', 'leftAnkle'],\n rightLeg: ['rightHip', 'rightKnee', 'rightAnkle'],\n torso: ['leftShoulder', 'rightShoulder', 'rightHip', 'leftHip', 'leftShoulder'],\n leftArm: ['leftShoulder', 'leftElbow', 'leftWrist'],\n rightArm: ['rightShoulder', 'rightElbow', 'rightWrist'],\n head: [],\n};\n", "/**\n * EfficientPose model implementation\n *\n * Based on: [**EfficientPose**](https://github.com/daniegr/EfficientPose)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport * as coords from './efficientposecoords';\nimport { constants } from '../tfjs/constants';\nimport type { BodyResult, Point, BodyLandmark, BodyAnnotation } from '../result';\nimport type { GraphModel, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet lastTime = 0;\nconst cache: BodyResult = { id: 0, keypoints: [], box: [0, 0, 0, 0], boxRaw: [0, 0, 0, 0], score: 0, annotations: {} as Record };\n\n// const keypoints: Array = [];\n// let box: Box = [0, 0, 0, 0];\n// let boxRaw: Box = [0, 0, 0, 0];\n// let score = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.body.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n// performs argmax and max functions on a 2d tensor\nasync function max2d(inputs, minScore): Promise<[number, number, number]> {\n const [width, height] = inputs.shape;\n const reshaped = tf.reshape(inputs, [height * width]); // combine all data\n const max = tf.max(reshaped, 0);\n const newScore: number = (await max.data())[0]; // get highest score\n if (newScore > minScore) { // skip coordinate calculation is score is too low\n const coordinates = tf.argMax(reshaped, 0);\n const mod = tf.mod(coordinates, width);\n const x = (await mod.data())[0];\n const div = tf.div(coordinates, width);\n const y: number = (await div.data())[0];\n tf.dispose([reshaped, max, coordinates, mod, div]);\n return [x, y, newScore];\n }\n tf.dispose([reshaped, max]);\n return [0, 0, newScore];\n}\n\nexport async function predict(image: Tensor4D, config: Config): Promise {\n if (!model?.['executor'] || !model?.inputs[0].shape) return [];\n const skipTime = (config.body.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.body.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && Object.keys(cache.keypoints).length > 0) {\n skipped++;\n return [cache];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const tensor = tf.tidy(() => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape?.[2] || 0, model?.inputs[0].shape?.[1] || 0], false);\n const enhance = tf.mul(resize, constants.tf2);\n const norm = tf.sub(enhance, constants.tf1);\n return norm;\n });\n let resT;\n if (config.body.enabled) resT = model?.execute(tensor);\n lastTime = now();\n tf.dispose(tensor);\n\n if (resT) {\n cache.keypoints.length = 0;\n const squeeze = tf.squeeze(resT);\n tf.dispose(resT);\n // body parts are basically just a stack of 2d tensors\n const stack = tf.unstack(squeeze, 2);\n tf.dispose(squeeze);\n\n // process each unstacked tensor as a separate body part\n for (let id = 0; id < stack.length; id++) {\n // actual processing to get coordinates and score\n const [x, y, partScore] = await max2d(stack[id], config.body.minConfidence);\n if (partScore > (config.body.minConfidence || 0)) {\n cache.keypoints.push({\n score: Math.round(100 * partScore) / 100,\n part: coords.kpt[id] as BodyLandmark,\n positionRaw: [ // normalized to 0..1\n // @ts-ignore model is not undefined here\n x / model.inputs[0].shape[2], y / model.inputs[0].shape[1],\n ],\n position: [ // normalized to input image size\n // @ts-ignore model is not undefined here\n Math.round(image.shape[2] * x / model.inputs[0].shape[2]), Math.round(image.shape[1] * y / model.inputs[0].shape[1]),\n ],\n });\n }\n }\n stack.forEach((s) => tf.dispose(s));\n }\n cache.score = cache.keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const x = cache.keypoints.map((a) => a.position[0]);\n const y = cache.keypoints.map((a) => a.position[1]);\n cache.box = [\n Math.min(...x),\n Math.min(...y),\n Math.max(...x) - Math.min(...x),\n Math.max(...y) - Math.min(...y),\n ];\n const xRaw = cache.keypoints.map((a) => a.positionRaw[0]);\n const yRaw = cache.keypoints.map((a) => a.positionRaw[1]);\n cache.boxRaw = [\n Math.min(...xRaw),\n Math.min(...yRaw),\n Math.max(...xRaw) - Math.min(...xRaw),\n Math.max(...yRaw) - Math.min(...yRaw),\n ];\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = cache.keypoints.find((kpt) => kpt.part === indexes[i]);\n const pt1 = cache.keypoints.find((kpt) => kpt.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n cache.annotations[name] = pt;\n }\n resolve([cache]);\n });\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as coords from './facemeshcoords';\nimport { constants } from '../tfjs/constants';\nimport type { Box, Point } from '../result';\nimport { env } from '../util/env';\n\nexport const createBox = (startEndTensor) => ({ startPoint: tf.slice(startEndTensor, [0, 0], [-1, 2]), endPoint: tf.slice(startEndTensor, [0, 2], [-1, 2]) });\n\nexport const disposeBox = (t) => tf.dispose([t.startPoint, t.endPoint]);\n\nexport const getBoxSize = (box): [number, number] => [Math.abs(box.endPoint[0] - box.startPoint[0]), Math.abs(box.endPoint[1] - box.startPoint[1])];\n\nexport const getBoxCenter = (box): [number, number, number] => [box.startPoint[0] + (box.endPoint[0] - box.startPoint[0]) / 2, box.startPoint[1] + (box.endPoint[1] - box.startPoint[1]) / 2, 1];\n\nexport const clampBox = (box, input): Box => (box ? [\n Math.trunc(Math.max(0, box.startPoint[0])),\n Math.trunc(Math.max(0, box.startPoint[1])),\n Math.trunc(Math.min((input.shape[2] || 0), box.endPoint[0]) - Math.max(0, box.startPoint[0])),\n Math.trunc(Math.min((input.shape[1] || 0), box.endPoint[1]) - Math.max(0, box.startPoint[1])),\n] : [0, 0, 0, 0]);\n\nexport const getRawBox = (box, input): Box => (box ? [\n box.startPoint[0] / (input.shape[2] || 0),\n box.startPoint[1] / (input.shape[1] || 0),\n (box.endPoint[0] - box.startPoint[0]) / (input.shape[2] || 0),\n (box.endPoint[1] - box.startPoint[1]) / (input.shape[1] || 0),\n] : [0, 0, 0, 0]);\n\nexport const scaleBoxCoordinates = (box, factor, anchor) => {\n const startPoint: Point = [box.startPoint[0] * factor[0], box.startPoint[1] * factor[1]];\n const endPoint: Point = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]];\n // const centerPoint = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];\n const landmarks = box.landmarks.map((pt) => [(pt[0] + anchor[0]) * factor[0], (pt[1] + anchor[1]) * factor[1]]);\n /**\n face.mesh = box.landmarks.map((pt) => [\n ((box.startPoint[0] + box.endPoint[0]) / 2) + (pt[0] * input.shape[2] / blazeface.size()),\n ((box.startPoint[1] + box.endPoint[1]) / 2) + (pt[1] * input.shape[1] / blazeface.size()),\n ]);\n */\n\n return { startPoint, endPoint, landmarks, confidence: box.confidence };\n};\n\nexport const cutAndResize = (box, image, cropSize) => {\n const h = image.shape[1];\n const w = image.shape[2];\n const cutBox = [box.startPoint[1] / h, box.startPoint[0] / w, box.endPoint[1] / h, box.endPoint[0] / w];\n const crop = tf.image.cropAndResize(image, [cutBox], [0], cropSize);\n const norm = tf.div(crop, constants.tf255);\n tf.dispose(crop);\n return norm;\n};\n\nexport const enlargeBox = (box, factor) => {\n const center = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize: [number, number] = [factor * size[0] / 2, factor * size[1] / 2];\n return {\n startPoint: [center[0] - halfSize[0], center[1] - halfSize[1]] as Point,\n endPoint: [center[0] + halfSize[0], center[1] + halfSize[1]] as Point,\n landmarks: box.landmarks,\n confidence: box.confidence,\n size,\n };\n};\n\nexport const squarifyBox = (box) => {\n const centers = getBoxCenter(box);\n const size = getBoxSize(box);\n const halfSize = Math.max(...size) / 2;\n return {\n startPoint: [Math.round(centers[0] - halfSize), Math.round(centers[1] - halfSize)] as Point,\n endPoint: [Math.round(centers[0] + halfSize), Math.round(centers[1] + halfSize)] as Point,\n landmarks: box.landmarks,\n confidence: box.confidence,\n size: [Math.round(size[0]), Math.round(size[1])] as [number, number],\n };\n};\n\nexport const calculateLandmarksBoundingBox = (landmarks) => {\n const x = landmarks.map((d) => d[0]);\n const y = landmarks.map((d) => d[1]);\n return {\n startPoint: [Math.min(...x), Math.min(...y)] as Point,\n endPoint: [Math.max(...x), Math.max(...y)] as Point,\n landmarks,\n };\n};\n\nexport const fixedRotationMatrix = [[1, 0, 0], [0, 1, 0], [0, 0, 1]];\n\nexport const normalizeRadians = (angle: number) => angle - 2 * Math.PI * Math.floor((angle + Math.PI) / (2 * Math.PI));\n\nexport const computeRotation = (point1, point2) => normalizeRadians(Math.PI / 2 - Math.atan2(-(point2[1] - point1[1]), point2[0] - point1[0]));\n\nexport const radToDegrees = (rad) => rad * 180 / Math.PI;\n\nexport const buildTranslationMatrix = (x, y) => [[1, 0, x], [0, 1, y], [0, 0, 1]];\n\nexport const dot = (v1: number[], v2: number[]) => {\n let product = 0;\n for (let i = 0; i < v1.length; i++) product += v1[i] * v2[i];\n return product;\n};\n\nexport const getColumnFrom2DArr = (arr, columnIndex) => {\n const column: number[] = [];\n for (let i = 0; i < arr.length; i++) column.push(arr[i][columnIndex]);\n return column;\n};\n\nexport const multiplyTransformMatrices = (mat1, mat2) => {\n const product: number[][] = [];\n const size = mat1.length;\n for (let row = 0; row < size; row++) {\n product.push([]);\n for (let col = 0; col < size; col++) product[row].push(dot(mat1[row], getColumnFrom2DArr(mat2, col)));\n }\n return product;\n};\n\nexport const 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 const 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 = [-dot(rotationComponent[0], translationComponent), -dot(rotationComponent[1], translationComponent)];\n return [rotationComponent[0].concat(invertedTranslation[0]), rotationComponent[1].concat(invertedTranslation[1]), [0, 0, 1]];\n};\n\nexport const rotatePoint = (homogeneousCoordinate, rotationMatrix) => [dot(homogeneousCoordinate, rotationMatrix[0]), dot(homogeneousCoordinate, rotationMatrix[1])];\n\nexport const xyDistanceBetweenPoints = (a, b) => Math.sqrt(((a[0] - b[0]) ** 2) + ((a[1] - b[1]) ** 2));\n\nexport function generateAnchors(inputSize: number) {\n const spec = inputSize === 192\n ? { strides: [4], anchors: [1] } // facemesh-detector\n : { strides: [inputSize / 16, inputSize / 8], anchors: [2, 6] }; // blazeface\n const anchors: [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++) anchors.push([anchorX, anchorY]);\n }\n }\n }\n return anchors;\n}\n\nexport function transformRawCoords(coordsRaw, box, angle, rotationMatrix, inputSize) {\n const boxSize = getBoxSize(box);\n const coordsScaled = coordsRaw.map((coord) => ([ // scaled around zero-point\n (boxSize[0] / inputSize) * (coord[0] - (inputSize / 2)),\n (boxSize[1] / inputSize) * (coord[1] - (inputSize / 2)),\n (coord[2] || 0),\n ]));\n const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2);\n const coordsRotationMatrix = largeAngle ? buildRotationMatrix(angle, [0, 0]) : fixedRotationMatrix;\n const coordsRotated = largeAngle ? coordsScaled.map((coord) => ([...rotatePoint(coord, coordsRotationMatrix), coord[2]])) : coordsScaled;\n const inverseRotationMatrix = largeAngle ? invertTransformMatrix(rotationMatrix) : fixedRotationMatrix;\n const boxCenter = getBoxCenter(box);\n const offsets = [dot(boxCenter, inverseRotationMatrix[0]), dot(boxCenter, inverseRotationMatrix[1])];\n return coordsRotated.map((coord) => ([\n Math.trunc(coord[0] + offsets[0]),\n Math.trunc(coord[1] + offsets[1]),\n Math.trunc(coord[2] || 0),\n ]));\n}\n\nexport function correctFaceRotation(rotate, box, input, inputSize) {\n const symmetryLine = (box.landmarks.length >= coords.meshLandmarks.count)\n ? coords.meshLandmarks.symmetryLine\n : coords.blazeFaceLandmarks.symmetryLine;\n let angle = 0; // default\n let rotationMatrix = fixedRotationMatrix; // default\n let face; // default\n\n if (rotate && env.kernels.includes('rotatewithoffset')) {\n angle = computeRotation(box.landmarks[symmetryLine[0]], box.landmarks[symmetryLine[1]]);\n const largeAngle = angle && (angle !== 0) && (Math.abs(angle) > 0.2);\n if (largeAngle) { // perform rotation only if angle is sufficiently high\n const center: Point = getBoxCenter(box);\n const centerRaw: Point = [center[0] / input.shape[2], center[1] / input.shape[1]];\n const rotated = tf.image.rotateWithOffset(input, angle, 0, [centerRaw[0], centerRaw[1]]);\n rotationMatrix = buildRotationMatrix(-angle, center);\n face = cutAndResize(box, rotated, [inputSize, inputSize]);\n tf.dispose(rotated);\n } else {\n face = cutAndResize(box, input, [inputSize, inputSize]);\n }\n } else {\n face = cutAndResize(box, input, [inputSize, inputSize]);\n }\n return [angle, rotationMatrix, face];\n}\n\nexport const findFaceCenter = (mesh) => {\n const x = mesh.map((m) => m[0]);\n const y = mesh.map((m) => m[1]);\n // weighted center\n /*\n const sum = (arr: number[]) => arr.reduce((prev, curr) => prev + curr, 0);\n return [sum(x) / mesh.length, sum(y) / mesh.length];\n */\n // absolute center\n return [Math.min(...x) + (Math.max(...x) - Math.min(...x)) / 2, Math.min(...y) + (Math.max(...y) - Math.min(...y)) / 2];\n};\n\nexport const calculateFaceBox = (mesh, previousBox) => {\n const center = findFaceCenter(mesh);\n const boxSize = getBoxSize(previousBox);\n const calculatedBox = {\n startPoint: [center[0] - boxSize[0] / 2, center[1] - boxSize[1] / 2] as Point,\n endPoint: [center[0] + boxSize[0] / 2, center[1] + boxSize[1] / 2] as Point,\n };\n return calculatedBox;\n};\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n * See `facemesh.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport * as util from './facemeshutil';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { Config } from '../config';\nimport type { Tensor, GraphModel, Tensor1D, Tensor2D, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\nimport type { Point } from '../result';\n\nconst keypointsCount = 6;\nlet model: GraphModel | null;\nlet anchors: Tensor | null = null;\nlet inputSize = 0;\nlet inputSizeT: Tensor | null = null;\n\nexport interface DetectBox { startPoint: Point, endPoint: Point, landmarks: Point[], confidence: number, size: [number, number] }\n\nexport const size = () => inputSize;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.detector?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = (model['executor'] && model.inputs[0].shape) ? model.inputs[0].shape[2] : 256;\n inputSizeT = tf.scalar(inputSize, 'int32') as Tensor;\n anchors = tf.tensor2d(util.generateAnchors(inputSize)) as Tensor;\n return model;\n}\n\nfunction decodeBoxes(boxOutputs: Tensor) {\n if (!anchors || !inputSizeT) return tf.zeros([0, 0]);\n const t: Record = {};\n t.boxStarts = tf.slice(boxOutputs, [0, 1], [-1, 2]);\n t.centers = tf.add(t.boxStarts, anchors);\n t.boxSizes = tf.slice(boxOutputs, [0, 3], [-1, 2]);\n t.boxSizesNormalized = tf.div(t.boxSizes, inputSizeT);\n t.centersNormalized = tf.div(t.centers, inputSizeT);\n t.halfBoxSize = tf.div(t.boxSizesNormalized, constants.tf2);\n t.starts = tf.sub(t.centersNormalized, t.halfBoxSize);\n t.ends = tf.add(t.centersNormalized, t.halfBoxSize);\n t.startNormalized = tf.mul(t.starts, inputSizeT);\n t.endNormalized = tf.mul(t.ends, inputSizeT);\n const boxes = tf.concat2d([t.startNormalized as Tensor2D, t.endNormalized as Tensor2D], 1);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return boxes;\n}\n\nexport async function getBoxes(inputImage: Tensor4D, config: Config): Promise {\n // sanity check on input\n if ((!inputImage) || (inputImage['isDisposedInternal']) || (inputImage.shape.length !== 4) || (inputImage.shape[1] < 1) || (inputImage.shape[2] < 1)) return [];\n const t: Record = {};\n t.resized = tf.image.resizeBilinear(inputImage, [inputSize, inputSize]);\n t.div = tf.div(t.resized, constants.tf127);\n t.normalized = tf.sub(t.div, constants.tf05);\n const res = model?.execute(t.normalized) as Tensor[];\n if (Array.isArray(res) && res.length > 2) { // pinto converted model?\n const sorted = res.sort((a, b) => a.size - b.size);\n t.concat384 = tf.concat([sorted[0], sorted[2]], 2); // dim: 384, 1 + 16\n t.concat512 = tf.concat([sorted[1], sorted[3]], 2); // dim: 512, 1 + 16\n t.concat = tf.concat([t.concat512, t.concat384], 1);\n t.batch = tf.squeeze(t.concat, [0]);\n } else if (Array.isArray(res)) { // new facemesh-detection tfhub model\n t.batch = tf.squeeze(res[0]);\n } else { // original blazeface tfhub model\n t.batch = tf.squeeze(res);\n }\n tf.dispose(res);\n t.boxes = decodeBoxes(t.batch);\n t.logits = tf.slice(t.batch, [0, 0], [-1, 1]);\n t.sigmoid = tf.sigmoid(t.logits);\n t.scores = tf.squeeze(t.sigmoid);\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.scores as Tensor1D, (config.face.detector?.maxDetected || 0), (config.face.detector?.iouThreshold || 0), (config.face.detector?.minConfidence || 0));\n const nms = await t.nms.array() as number[];\n const boxes: DetectBox[] = [];\n const scores = await t.scores.data();\n for (let i = 0; i < nms.length; i++) {\n const confidence = scores[nms[i]];\n\n if (confidence > (config.face.detector?.minConfidence || 0)) {\n const b: Record = {};\n b.bbox = tf.slice(t.boxes, [nms[i], 0], [1, -1]);\n b.slice = tf.slice(t.batch, [nms[i], keypointsCount - 1], [1, -1]);\n b.squeeze = tf.squeeze(b.slice);\n b.landmarks = tf.reshape(b.squeeze, [keypointsCount, -1]);\n const points = await b.bbox.data();\n const rawBox = {\n startPoint: [points[0], points[1]] as Point,\n endPoint: [points[2], points[3]] as Point,\n landmarks: (await b.landmarks.array()) as Point[],\n confidence,\n };\n b.anchor = tf.slice(anchors as Tensor, [nms[i], 0], [1, 2]);\n const anchor = await b.anchor.data();\n const scaledBox = util.scaleBoxCoordinates(rawBox, [(inputImage.shape[2] || 0) / inputSize, (inputImage.shape[1] || 0) / inputSize], anchor);\n const enlargedBox = util.enlargeBox(scaledBox, config.face.detector?.scale || 1.4);\n const squaredBox = util.squarifyBox(enlargedBox);\n if (squaredBox.size[0] > (config.face.detector?.['minSize'] || 0) && squaredBox.size[1] > (config.face.detector?.['minSize'] || 0)) boxes.push(squaredBox);\n Object.keys(b).forEach((tensor) => tf.dispose(b[tensor]));\n }\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return boxes;\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport * as coords from './facemeshcoords';\nimport * as util from './facemeshutil';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Config } from '../config';\nimport type { Point } from '../result';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\n\nconst leftOutline = coords.meshAnnotations.leftEyeLower0;\nconst rightOutline = coords.meshAnnotations.rightEyeLower0;\n\nconst eyeLandmarks = {\n leftBounds: [leftOutline[0], leftOutline[leftOutline.length - 1]],\n rightBounds: [rightOutline[0], rightOutline[rightOutline.length - 1]],\n};\n\nconst irisLandmarks = {\n upperCenter: 3,\n lowerCenter: 4,\n index: 71,\n numCoordinates: 76,\n};\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.iris?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = (model?.['executor'] && model.inputs?.[0].shape) ? model.inputs[0].shape[2] : 0;\n if (inputSize === -1) inputSize = 64;\n return model;\n}\n\n// Replace the raw coordinates returned by facemesh with refined iris model coordinates and update the z coordinate to be an average of the original and the new.\nexport function replaceIrisCoords(rawCoords, newCoords, prefix, keys) {\n for (let i = 0; i < coords.irisIndices.length; i++) {\n const { key, indices } = coords.irisIndices[i];\n const originalIndices = coords.meshAnnotations[`${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],\n newCoords[index][1],\n (newCoords[index][2] + rawCoords[originalIndices[j]][2]) / 2,\n ];\n }\n }\n }\n}\n\nexport const 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.\nexport const getEyeBox = (rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, meshSize, flip = false, scale = 2.3) => {\n const box = util.squarifyBox(util.enlargeBox(util.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), scale));\n const boxSize = util.getBoxSize(box);\n let crop = tf.image.cropAndResize(face, [[\n box.startPoint[1] / meshSize,\n box.startPoint[0] / meshSize, box.endPoint[1] / meshSize,\n box.endPoint[0] / meshSize,\n ]], [0], [inputSize, inputSize]);\n if (flip && env.kernels.includes('flipleftright')) {\n const flipped = tf.image.flipLeftRight(crop); // flipLeftRight is not defined for tfjs-node\n tf.dispose(crop);\n crop = flipped;\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.\nexport const getEyeCoords = (eyeData, eyeBox, eyeBoxSize, flip = false) => {\n const eyeRawCoords: Point[] = [];\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 / inputSize)) : (x / inputSize)) * eyeBoxSize[0] + eyeBox.startPoint[0],\n (y / inputSize) * 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.\nexport const getAdjustedIrisCoords = (rawCoords, irisCoords, direction) => {\n const upperCenterZ = rawCoords[coords.meshAnnotations[`${direction}EyeUpper0`][irisLandmarks.upperCenter]][2];\n const lowerCenterZ = rawCoords[coords.meshAnnotations[`${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\nexport async function augmentIris(rawCoords, face, meshSize, config: Config) {\n if (!model?.['executor']) return rawCoords;\n const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], meshSize, true, config.face.iris?.scale || 2.3);\n const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], meshSize, true, config.face.iris?.scale || 2.3);\n const combined = tf.concat([leftEyeCrop, rightEyeCrop]);\n tf.dispose(leftEyeCrop);\n tf.dispose(rightEyeCrop);\n const eyePredictions = model.execute(combined) as Tensor;\n tf.dispose(combined);\n const eyePredictionsData = await eyePredictions.data();\n tf.dispose(eyePredictions);\n const leftEyeData = eyePredictionsData.slice(0, irisLandmarks.numCoordinates * 3);\n const { rawCoords: leftEyeRawCoords, iris: leftIrisRawCoords } = getEyeCoords(leftEyeData, leftEyeBox, leftEyeBoxSize, true);\n const rightEyeData = eyePredictionsData.slice(irisLandmarks.numCoordinates * 3);\n const { rawCoords: rightEyeRawCoords, iris: rightIrisRawCoords } = getEyeCoords(rightEyeData, rightEyeBox, rightEyeBoxSize, false);\n const leftToRightEyeDepthDifference = getLeftToRightEyeDepthDifference(rawCoords);\n if (Math.abs(leftToRightEyeDepthDifference) < 30) { // User is looking straight ahead.\n replaceIrisCoords(rawCoords, leftEyeRawCoords, 'left', null);\n replaceIrisCoords(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 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 replaceIrisCoords(rawCoords, leftEyeRawCoords, 'left', ['EyeUpper0', 'EyeLower0']);\n } else { // User is looking towards the left.\n replaceIrisCoords(rawCoords, rightEyeRawCoords, 'right', ['EyeUpper0', 'EyeLower0']);\n }\n const adjustedLeftIrisCoords = getAdjustedIrisCoords(rawCoords, leftIrisRawCoords, 'left');\n const adjustedRightIrisCoords = getAdjustedIrisCoords(rawCoords, rightIrisRawCoords, 'right');\n const newCoords = rawCoords.concat(adjustedLeftIrisCoords).concat(adjustedRightIrisCoords);\n return newCoords;\n}\n", "import * as constants from './constants';\nimport type { Tensor } from '../tfjs/types';\n\nexport async function augment(rawCoords, results: Tensor[]) {\n const t: Record = { // all attention models produce 2d results so it needs to be later augmented with correct z-coords\n // mesh: results[0], // already have it in rawCoords // output_mesh_identity\n // flag: results[1], // already processed in parent // conv_faceflag\n lips: await results.filter((r) => r.size === 160)?.[0]?.data() as Float32Array, // 80 x 2d = 160 // output_lips\n irisL: await results.filter((r) => r.size === 10)?.[0]?.data() as Float32Array, // 5 x 2d = 10 // output_right_iris\n eyeL: await results.filter((r) => r.size === 142)?.[0]?.data() as Float32Array, // 71 x 2d = 142 // output_right_eye\n irisR: await results.filter((r) => r.size === 10)?.[1]?.data() as Float32Array, // 5 x 2d = 10 // output_left_iris\n eyeR: await results.filter((r) => r.size === 142)?.[1]?.data() as Float32Array, // 71 x 2d = 142// output_left_eye\n };\n for (const val of Object.values(t)) {\n if (!val) return rawCoords; // could not find tensor\n }\n\n // augment iris: adds additional 5 keypoints per eye\n const irisLDepth = constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.reduce((prev, curr) => prev += rawCoords[curr][2], 0) / constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG.length; // get average z-coord for iris\n for (let i = 0; i < t.irisL.length / 2; i++) rawCoords.push([t.irisL[2 * i + 0], t.irisL[2 * i + 1], irisLDepth]);\n const irisRDepth = constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.reduce((prev, curr) => prev += rawCoords[curr][2], 0) / constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG.length; // get average z-coord for iris\n for (let i = 0; i < t.irisR.length / 2; i++) rawCoords.push([t.irisR[2 * i + 0], t.irisR[2 * i + 1], irisRDepth]);\n\n // augment eyes: replaces eye keypoints based on heuristic mapping\n for (let i = 0; i < t.eyeL.length / 2; i++) rawCoords[constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]] = [t.eyeL[2 * i + 0], t.eyeL[2 * i + 1], rawCoords[constants.LANDMARKS_REFINEMENT_LEFT_EYE_CONFIG[i]][2]];\n for (let i = 0; i < t.eyeR.length / 2; i++) rawCoords[constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]] = [t.eyeR[2 * i + 0], t.eyeR[2 * i + 1], rawCoords[constants.LANDMARKS_REFINEMENT_RIGHT_EYE_CONFIG[i]][2]];\n\n // augment lips: replaces eye keypoints based on heuristic mapping\n for (let i = 0; i < t.lips.length / 2; i++) rawCoords[constants.LANDMARKS_REFINEMENT_LIPS_CONFIG[i]] = [t.lips[2 * i + 0], t.lips[2 * i + 1], rawCoords[constants.LANDMARKS_REFINEMENT_LIPS_CONFIG[i]][2]];\n\n return rawCoords;\n}\n", "/**\n * BlazeFace, FaceMesh & Iris model implementation\n *\n * Based on:\n * - [**MediaPipe BlazeFace**](https://drive.google.com/file/d/1f39lSzU5Oq-j_OXgS67KfN5wNsoeAZ4V/view)\n * - Facial Spacial Geometry: [**MediaPipe FaceMesh**](https://drive.google.com/file/d/1VFC_wIpw4O7xBOiTgUldl79d9LA-LsnA/view)\n * - Eye Iris Details: [**MediaPipe Iris**](https://drive.google.com/file/d/1bsWbokp9AklH2ANjCfmjqEzzxO1CNbMu/view)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport * as blazeface from './blazeface';\nimport * as util from './facemeshutil';\nimport * as coords from './facemeshcoords';\nimport * as iris from './iris';\nimport * as attention from './attention';\nimport { histogramEqualization } from '../image/enhance';\nimport { env } from '../util/env';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { FaceResult, FaceLandmark, Point } from '../result';\nimport type { Config } from '../config';\nimport type { DetectBox } from './blazeface';\n\nconst cache = {\n boxes: [] as DetectBox[],\n skipped: Number.MAX_SAFE_INTEGER,\n timestamp: 0,\n};\n\nlet model: GraphModel | null = null;\nlet inputSize = 0;\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n // reset cached boxes\n const skipTime = (config.face.detector?.skipTime || 0) > (now() - cache.timestamp);\n const skipFrame = cache.skipped < (config.face.detector?.skipFrames || 0);\n if (!config.skipAllowed || !skipTime || !skipFrame || cache.boxes.length === 0) {\n cache.boxes = await blazeface.getBoxes(input, config); // get results from blazeface detector\n cache.timestamp = now();\n cache.skipped = 0;\n } else {\n cache.skipped++;\n }\n const faces: FaceResult[] = [];\n const newCache: DetectBox[] = [];\n let id = 0;\n const size = inputSize;\n for (let i = 0; i < cache.boxes.length; i++) {\n const box = cache.boxes[i];\n let angle = 0;\n let rotationMatrix;\n const face: FaceResult = { // init face result\n id: id++,\n mesh: [],\n meshRaw: [],\n box: [0, 0, 0, 0],\n boxRaw: [0, 0, 0, 0],\n score: 0,\n boxScore: 0,\n faceScore: 0,\n size: [0, 0],\n // contoursRaw: [],\n // contours: [],\n annotations: {} as Record,\n };\n\n // optional rotation correction based on detector data only if mesh is disabled otherwise perform it later when we have more accurate mesh data. if no rotation correction this function performs crop\n [angle, rotationMatrix, face.tensor] = util.correctFaceRotation(config.face.detector?.rotation, box, input, config.face.mesh?.enabled ? inputSize : blazeface.size());\n if (config.filter.equalization) {\n const equilized = face.tensor ? await histogramEqualization(face.tensor) : undefined;\n tf.dispose(face.tensor);\n if (equilized) face.tensor = equilized;\n }\n face.boxScore = Math.round(100 * box.confidence) / 100;\n if (!config.face.mesh?.enabled || !model?.['executor']) { // mesh not enabled or not loaded, return resuts from detector only\n face.box = util.clampBox(box, input);\n face.boxRaw = util.getRawBox(box, input);\n face.score = face.boxScore;\n face.size = box.size;\n face.mesh = box.landmarks;\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / size]);\n for (const key of Object.keys(coords.blazeFaceLandmarks)) face.annotations[key] = [face.mesh[coords.blazeFaceLandmarks[key] as number]]; // add annotations\n } else if (!model) { // mesh enabled, but not loaded\n if (config.debug) log('face mesh detection requested, but model is not loaded');\n } else { // mesh enabled\n if (config.face.attention?.enabled && !env.kernels.includes('atan2')) {\n config.face.attention.enabled = false;\n tf.dispose(face.tensor);\n return faces;\n }\n const results = model.execute(face.tensor as Tensor) as Tensor[];\n const confidenceT = results.find((t) => t.shape[t.shape.length - 1] === 1) as Tensor;\n const faceConfidence = await confidenceT.data();\n face.faceScore = Math.round(100 * faceConfidence[0]) / 100;\n if (face.faceScore < (config.face.detector?.minConfidence || 1)) { // low confidence in detected mesh\n box.confidence = face.faceScore; // reset confidence of cached box\n if (config.face.mesh['keepInvalid']) {\n face.box = util.clampBox(box, input);\n face.boxRaw = util.getRawBox(box, input);\n face.size = box.size;\n face.score = face.boxScore;\n face.mesh = box.landmarks;\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 1), pt[1] / (input.shape[1] || 1), (pt[2] || 0) / size]);\n for (const key of Object.keys(coords.blazeFaceLandmarks)) {\n face.annotations[key] = [face.mesh[coords.blazeFaceLandmarks[key] as number]]; // add annotations\n }\n }\n } else {\n const meshT = results.find((t) => t.shape[t.shape.length - 1] === 1404) as Tensor;\n const coordsReshaped = tf.reshape(meshT, [-1, 3]);\n let rawCoords = await coordsReshaped.array();\n tf.dispose(coordsReshaped);\n if (config.face.attention?.enabled) {\n rawCoords = await attention.augment(rawCoords, results); // augment iris results using attention model results\n } else if (config.face.iris?.enabled) {\n rawCoords = await iris.augmentIris(rawCoords, face.tensor, inputSize, config); // run iris model and augment results\n }\n face.mesh = util.transformRawCoords(rawCoords, box, angle, rotationMatrix, inputSize); // get processed mesh\n face.meshRaw = face.mesh.map((pt) => [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / size]);\n for (const key of Object.keys(coords.meshAnnotations)) face.annotations[key] = coords.meshAnnotations[key].map((index) => face.mesh[index]); // add annotations\n face.score = face.faceScore;\n const calculatedBox = {\n ...util.calculateFaceBox(face.mesh, box),\n confidence: box.confidence,\n landmarks: box.landmarks,\n size: box.size,\n };\n face.box = util.clampBox(calculatedBox, input);\n face.boxRaw = util.getRawBox(calculatedBox, input);\n face.size = calculatedBox.size;\n /*\n const contoursT = results.find((t) => t.shape[t.shape.length - 1] === 266) as Tensor;\n const contoursData = contoursT && await contoursT.data(); // 133 x 2d points\n face.contoursRaw = [];\n for (let j = 0; j < contoursData.length / 2; j++) face.contoursRaw.push([contoursData[2 * j + 0] / inputSize, contoursData[2 * j + 1] / inputSize]);\n face.contours = face.contoursRaw.map((c) => [Math.trunc((input.shape[2] || 1) * c[0]), Math.trunc((input.shape[1] || 1) * c[1])]);\n */\n newCache.push(calculatedBox);\n }\n tf.dispose(results);\n }\n if (face.score > (config.face.detector?.minConfidence || 1)) faces.push(face);\n else tf.dispose(face.tensor);\n }\n cache.boxes = newCache; // reset cache\n return faces;\n}\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (config.face.attention?.enabled && model?.['signature']) {\n if (Object.keys(model?.['signature']?.outputs || {}).length < 6) model = null;\n }\n if (!model) {\n if (config.face.attention?.enabled) model = await loadModel(config.face.attention.modelPath);\n else model = await loadModel(config.face.mesh?.modelPath);\n } else if (config.debug) {\n log('cached model:', model['modelUrl']);\n }\n inputSize = (model['executor'] && model?.inputs?.[0].shape) ? model?.inputs?.[0].shape[2] : 256;\n return model;\n}\n\nexport const triangulation = coords.TRI468;\nexport const uvmap = coords.UV468;\n", "/**\n * Emotion model implementation\n *\n * [**Oarriaga**](https://github.com/oarriaga/face_classification)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport type { Emotion } from '../result';\nimport { log, now } from '../util/util';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { loadModel } from '../tfjs/load';\nimport { env } from '../util/env';\nimport { constants } from '../tfjs/constants';\n\nlet annotations: string[] = [];\nlet model: GraphModel | null;\nconst last: { score: number, emotion: Emotion }[][] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet rgb = false;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n model = await loadModel(config.face.emotion?.modelPath);\n rgb = model?.inputs?.[0].shape?.[3] === 3;\n if (!rgb) annotations = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral']; // oarriaga and gear\n else annotations = ['angry', 'disgust', 'fear', 'happy', 'neutral', 'sad', 'surprise']; // affectnet\n } else if (config.debug) {\n log('cached model:', model['modelUrl']);\n }\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise<{ score: number, emotion: Emotion }[]> {\n if (!model) return [];\n const skipFrame = skipped < (config.face.emotion?.skipFrames || 0);\n const skipTime = (config.face.emotion?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx] && (last[idx].length > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const obj: { score: number, emotion: Emotion }[] = [];\n if (config.face.emotion?.enabled) {\n const t: Record = {};\n const inputSize = model?.inputs[0].shape ? model.inputs[0].shape[2] : 0;\n if (config.face.emotion?.['crop'] > 0) { // optional crop\n const crop = config.face.emotion?.['crop'];\n const box = [[crop, crop, 1 - crop, 1 - crop]];\n t.resize = tf.image.cropAndResize(image, box, [0], [inputSize, inputSize]);\n } else {\n t.resize = tf.image.resizeBilinear(image, [inputSize, inputSize], false);\n }\n if (rgb) {\n t.mul = tf.mul(t.resize, 255);\n t.normalize = tf.sub(t.mul, [103.939, 116.779, 123.68]); // affectnet uses specific norm values\n t.emotion = model?.execute(t.normalize) as Tensor; // result is already in range 0..1, no need for additional activation\n } else {\n // [t.red, t.green, t.blue] = tf.split(t.resize, 3, 3);\n // weighted rgb to grayscale: https://www.mathworks.com/help/matlab/ref/rgb2gray.html\n // t.redNorm = tf.mul(t.red, rgb[0]);\n // t.greenNorm = tf.mul(t.green, rgb[1]);\n // t.blueNorm = tf.mul(t.blue, rgb[2]);\n // t.grayscale = tf.addN([t.redNorm, t.greenNorm, t.blueNorm]);\n t.channels = tf.mul(t.resize, constants.rgb);\n t.grayscale = tf.sum(t.channels, 3, true);\n t.grayscaleSub = tf.sub(t.grayscale, constants.tf05);\n t.grayscaleMul = tf.mul(t.grayscaleSub, constants.tf2);\n t.emotion = model?.execute(t.grayscaleMul) as Tensor; // result is already in range 0..1, no need for additional activation\n }\n lastTime = now();\n const data = await t.emotion.data();\n for (let i = 0; i < data.length; i++) {\n if (data[i] > (config.face.emotion.minConfidence || 0)) obj.push({ score: Math.min(0.99, Math.trunc(100 * data[i]) / 100), emotion: annotations[i] as Emotion });\n }\n obj.sort((a, b) => b.score - a.score);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "/**\n * FaceRes model implementation\n *\n * Returns Age, Gender, Descriptor\n * Implements Face similarity function\n *\n * Based on: [**HSE-FaceRes**](https://github.com/HSE-asavchenko/HSE_FaceRec_tf)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { env } from '../util/env';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { Tensor, GraphModel, Tensor4D, Tensor1D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport type { Gender, Race } from '../result';\n\nexport interface FaceRes { age: number, gender: Gender, genderScore: number, descriptor: number[], race?: { score: number, race: Race }[] }\n\nlet model: GraphModel | null;\nconst last: FaceRes[] = [];\n\nlet lastTime = 0;\nlet lastCount = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.description?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport function enhance(input, config: Config): Tensor {\n const tensor = (input.image || input.tensor || input) as Tensor4D; // input received from detector is already normalized to 0..1, input is also assumed to be straightened\n if (!model?.inputs[0].shape) return tensor; // model has no shape so no point continuing\n let crop: Tensor;\n if (config.face.description?.['crop'] > 0) { // optional crop\n const cropval = config.face.description?.['crop'];\n const box = [[cropval, cropval, 1 - cropval, 1 - cropval]];\n crop = tf.image.cropAndResize(tensor, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n } else {\n crop = tf.image.resizeBilinear(tensor, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n }\n const norm: Tensor = tf.mul(crop, constants.tf255);\n tf.dispose(crop);\n return norm;\n /*\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 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 */\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\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n const obj: FaceRes = {\n age: 0 as number,\n gender: 'unknown' as Gender,\n genderScore: 0 as number,\n descriptor: [] as number[],\n };\n if (!model?.['executor']) return obj;\n const skipFrame = skipped < (config.face.description?.skipFrames || 0);\n const skipTime = (config.face.description?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipFrame && skipTime && (lastCount === count) && (last?.[idx]?.age > 0) && (last?.[idx]?.genderScore > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (config.face.description?.enabled) {\n const enhanced = enhance(image, config);\n const resT = model?.execute(enhanced) as Tensor[];\n lastTime = now();\n tf.dispose(enhanced);\n const genderT = resT.find((t) => t.shape[1] === 1) as Tensor;\n const gender = await genderT.data();\n const confidence = Math.trunc(200 * Math.abs((gender[0] - 0.5))) / 100;\n if (confidence > (config.face.description.minConfidence || 0)) {\n obj.gender = gender[0] <= 0.5 ? 'female' : 'male';\n obj.genderScore = Math.min(0.99, confidence);\n }\n const argmax = tf.argMax(resT.find((t) => t.shape[1] === 100) as Tensor1D, 1);\n const ageIdx: number = (await argmax.data())[0];\n tf.dispose(argmax);\n const ageT = resT.find((t) => t.shape[1] === 100) as Tensor;\n const all = await ageT.data();\n obj.age = Math.round(all[ageIdx - 1] > all[ageIdx + 1] ? 10 * ageIdx - 100 * all[ageIdx - 1] : 10 * ageIdx + 100 * all[ageIdx + 1]) / 10;\n\n if (Number.isNaN(gender[0]) || Number.isNaN(all[0])) log('faceres error:', { model, result: resT });\n\n const desc = resT.find((t) => t.shape[1] === 1024);\n // const reshape = desc.reshape([128, 8]); // reshape large 1024-element descriptor to 128 x 8\n // const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it which leaves us with 128-element descriptor\n const descriptor = desc ? await desc.data() : [] as number[];\n obj.descriptor = Array.from(descriptor);\n resT.forEach((t) => tf.dispose(t));\n }\n last[idx] = obj;\n lastCount = count;\n resolve(obj);\n });\n}\n", "import type { Tensor } from '../tfjs/types';\nimport type { FaceResult } from '../result';\n// import * as tf from 'dist/tfjs.esm.js';\nimport { meshAnnotations } from './facemeshcoords';\n\nconst expandFact = 0.1;\nconst alpha = 0.5;\n\n// point inclusion in polygon based on https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\nfunction insidePoly(x: number, y: number, polygon: { x: number, y: number }[]): boolean {\n let inside = false;\n let j = polygon.length - 1;\n for (let i = 0; i < polygon.length; j = i++) {\n if (((polygon[i].y > y) !== (polygon[j].y > y)) && (x < (polygon[j].x - polygon[i].x) * (y - polygon[i].y) / (polygon[j].y - polygon[i].y) + polygon[i].x)) inside = !inside;\n }\n return inside;\n}\n\nexport async function mask(face: FaceResult): Promise {\n if (!face.tensor) return face.tensor;\n if (!face.mesh || face.mesh.length < 100) return face.tensor;\n const width = face.tensor.shape[2] || 0;\n const height = face.tensor.shape[1] || 0;\n const buffer = await face.tensor.buffer();\n let silhouette: { x: number, y: number }[] = [];\n for (const pt of meshAnnotations.silhouette) silhouette.push({ x: (face.mesh[pt][0] - face.box[0]) / face.box[2], y: (face.mesh[pt][1] - face.box[1]) / face.box[3] }); // add all silhouette points scaled to local box\n if (expandFact && expandFact > 0) silhouette = silhouette.map((pt) => ({ x: pt.x > 0.5 ? pt.x + expandFact : pt.x - expandFact, y: pt.y > 0.5 ? pt.y + expandFact : pt.y - expandFact })); // expand silhouette\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n const inside = insidePoly(x / width, y / width, silhouette);\n if (!inside) {\n buffer.set(alpha * buffer.get(0, y, x, 0), 0, y, x, 0);\n buffer.set(alpha * buffer.get(0, y, x, 1), 0, y, x, 1);\n buffer.set(alpha * buffer.get(0, y, x, 2), 0, y, x, 2);\n }\n }\n }\n const output = buffer.toTensor();\n // tf.dispose(buffer);\n return output;\n}\n", "/**\n * Anti-spoofing model implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { loadModel } from '../tfjs/load';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst cached: number[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet lastCount = 0;\nlet lastTime = 0;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.antispoof?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n if (!model?.['executor']) return 0;\n const skipTime = (config.face.antispoof?.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.face.antispoof?.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && cached[idx]) {\n skipped++;\n return cached[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape ? model.inputs[0].shape[2] : 0, model?.inputs[0].shape ? model.inputs[0].shape[1] : 0], false);\n const res = model?.execute(resize) as Tensor;\n const num = (await res.data())[0];\n cached[idx] = Math.round(100 * num) / 100;\n lastCount = count;\n lastTime = now();\n tf.dispose([resize, res]);\n resolve(cached[idx]);\n });\n}\n", "/**\n * Anti-spoofing model implementation\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst cached: number[] = [];\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet lastCount = 0;\nlet lastTime = 0;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.liveness?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n if (!model?.['executor']) return 0;\n const skipTime = (config.face.liveness?.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.face.liveness?.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && cached[idx]) {\n skipped++;\n return cached[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n const resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape ? model.inputs[0].shape[2] : 0, model?.inputs[0].shape ? model.inputs[0].shape[1] : 0], false);\n const res = model?.execute(resize) as Tensor;\n const num = (await res.data())[0];\n cached[idx] = Math.round(100 * num) / 100;\n lastCount = count;\n lastTime = now();\n tf.dispose([resize, res]);\n resolve(cached[idx]);\n });\n}\n", "/**\n * GEAR [gender/emotion/age/race] model implementation\n *\n * Based on: [**GEAR Predictor**](https://github.com/Udolf15/GEAR-Predictor)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Gender, Race } from '../result';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\n\nexport interface GearType { age: number, gender: Gender, genderScore: number, race: { score: number, race: Race }[] }\nlet model: GraphModel | null;\nconst last: GearType[] = [];\nconst raceNames = ['white', 'black', 'asian', 'indian', 'other'];\nconst ageWeights = [15, 23, 28, 35.5, 45.5, 55.5, 65];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config) {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face.gear?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise {\n if (!model) return { age: 0, gender: 'unknown', genderScore: 0, race: [] };\n const skipFrame = skipped < (config.face.gear?.skipFrames || 0);\n const skipTime = (config.face.gear?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx]) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs[0].shape) return;\n const t: Record = {};\n // t.resize = tf.image.resizeBilinear(image, [model?.inputs[0].shape[2], model?.inputs[0].shape[1]], false);\n let box = [[0.0, 0.10, 0.90, 0.90]]; // empyrical values for top, left, bottom, right\n if (config.face.gear?.['crop'] > 0) { // optional crop config value\n const crop = config.face.gear?.['crop'];\n box = [[crop, crop, 1 - crop, 1 - crop]];\n }\n t.resize = tf.image.cropAndResize(image, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const obj: GearType = { age: 0, gender: 'unknown', genderScore: 0, race: [] };\n if (config.face.gear?.enabled) [t.age, t.gender, t.race] = model.execute(t.resize, ['age_output', 'gender_output', 'race_output']) as Tensor[];\n const gender = await t.gender.data();\n obj.gender = gender[0] > gender[1] ? 'male' : 'female';\n obj.genderScore = Math.round(100 * (gender[0] > gender[1] ? gender[0] : gender[1])) / 100;\n const race = await t.race.data();\n for (let i = 0; i < race.length; i++) {\n if (race[i] > (config.face.gear?.minConfidence || 0.2)) obj.race.push({ score: Math.round(100 * race[i]) / 100, race: raceNames[i] as Race });\n }\n obj.race.sort((a, b) => b.score - a.score);\n // {0: 'Below20', 1: '21-25', 2: '26-30', 3: '31-40',4: '41-50', 5: '51-60', 6: 'Above60'}\n const ageDistribution = Array.from(await t.age.data());\n const ageSorted = ageDistribution.map((a, i) => [ageWeights[i], a]).sort((a, b) => b[1] - a[1]);\n let age = ageSorted[0][0]; // pick best starting point\n for (let i = 1; i < ageSorted.length; i++) age += ageSorted[i][1] * (ageSorted[i][0] - age); // adjust with each other choice by weight\n obj.age = Math.round(10 * age) / 10;\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n last[idx] = obj;\n lastCount = count;\n lastTime = now();\n resolve(obj);\n });\n}\n", "/**\n * Age model implementation\n *\n * Based on: [**SSR-Net**](https://github.com/shamangary/SSR-Net)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { env } from '../util/env';\nimport { constants } from '../tfjs/constants';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\n\nlet model: GraphModel | null;\nconst last: { age: number }[] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config) {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['ssrnet'].modelPathAge);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx: number, count: number): Promise<{ age: number }> {\n if (!model) return { age: 0 };\n const skipFrame = skipped < (config.face['ssrnet']?.skipFrames || 0);\n const skipTime = (config.face['ssrnet']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipFrame && skipTime && (lastCount === count) && last[idx]?.age && (last[idx]?.age > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs || !model.inputs[0] || !model.inputs[0].shape) return;\n const t: Record = {};\n if (config.face['ssrnet']?.['crop'] > 0) { // optional crop\n const crop = config.face['ssrnet']?.['crop'];\n const box = [[crop, crop, 1 - crop, 1 - crop]];\n t.resize = tf.image.cropAndResize(image, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n } else {\n t.resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n }\n t.enhance = tf.mul(t.resize, constants.tf255);\n const obj = { age: 0 };\n if (config.face['ssrnet']?.enabled) t.age = model.execute(t.enhance) as Tensor;\n if (t.age) {\n const data = await t.age.data();\n obj.age = Math.trunc(10 * data[0]) / 10;\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n last[idx] = obj;\n lastCount = count;\n lastTime = now();\n resolve(obj);\n });\n}\n", "/**\n * Gender model implementation\n *\n * Based on: [**SSR-Net**](https://github.com/shamangary/SSR-Net)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { Gender } from '../result';\nimport type { Config } from '../config';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: { gender: Gender, genderScore: number }[] = [];\nlet lastCount = 0;\nlet lastTime = 0;\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: Config) {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['ssrnet']?.modelPathGender);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(image: Tensor4D, config: Config, idx, count): Promise<{ gender: Gender, genderScore: number }> {\n if (!model) return { gender: 'unknown', genderScore: 0 };\n const skipFrame = skipped < (config.face['ssrnet']?.skipFrames || 0);\n const skipTime = (config.face['ssrnet']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipFrame && skipTime && (lastCount === count) && last[idx]?.gender && (last[idx]?.genderScore > 0)) {\n skipped++;\n return last[idx];\n }\n skipped = 0;\n return new Promise(async (resolve) => {\n if (!model?.inputs[0].shape) return;\n const t: Record = {};\n if (config.face['ssrnet']?.['crop'] > 0) { // optional crop\n const crop = config.face['ssrnet']?.['crop'];\n const box = [[crop, crop, 1 - crop, 1 - crop]];\n t.resize = tf.image.cropAndResize(image, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n } else {\n t.resize = tf.image.resizeBilinear(image, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false);\n }\n t.enhance = tf.tidy(() => {\n let normalize: Tensor;\n if (model?.inputs?.[0].shape?.[3] === 1) {\n const [red, green, blue] = tf.split(t.resize, 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 normalize = tf.mul(tf.sub(grayscale, constants.tf05), 2); // range grayscale:-1..1\n } else {\n normalize = tf.mul(tf.sub(t.resize, constants.tf05), 2); // range rgb:-1..1\n }\n return normalize;\n });\n const obj: { gender: Gender, genderScore: number } = { gender: 'unknown', genderScore: 0 };\n if (config.face['ssrnet']?.enabled) t.gender = model.execute(t.enhance) as Tensor;\n const data = await t.gender.data();\n obj.gender = data[0] > data[1] ? 'female' : 'male'; // returns two values 0..1, bigger one is prediction\n obj.genderScore = data[0] > data[1] ? (Math.trunc(100 * data[0]) / 100) : (Math.trunc(100 * data[1]) / 100);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n last[idx] = obj;\n lastCount = count;\n lastTime = now();\n resolve(obj);\n });\n}\n", "/**\n * MobileFaceNet model implementation\n *\n * Based on: [**BecauseofAI MobileFace**](https://github.com/becauseofAI/MobileFace)\n *\n * Obsolete and replaced by `faceres` that performs age/gender/descriptor analysis\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Tensor, Tensor4D, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: number[][] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['mobilefacenet']?.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\n/*\n// convert to black&white to avoid colorization impact\nconst 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\nconst [red, green, blue] = tf.split(crop, 3, 3);\nconst redNorm = tf.mul(red, rgb[0]);\nconst greenNorm = tf.mul(green, rgb[1]);\nconst blueNorm = tf.mul(blue, rgb[2]);\nconst grayscale = tf.addN([redNorm, greenNorm, blueNorm]);\nconst merge = tf.stack([grayscale, grayscale, grayscale], 3).squeeze(4);\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\nconst mean = merge.mean();\nconst factor = 5;\nconst contrast = merge.sub(mean).mul(factor).add(mean);\n*/\n\nexport async function predict(input: Tensor4D, config: Config, idx, count): Promise {\n if (!model?.['executor']) return [];\n const skipFrame = skipped < (config.face['mobilefacenet']?.skipFrames || 0);\n const skipTime = (config.face['mobilefacenet']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx]) {\n skipped++;\n return last[idx];\n }\n return new Promise(async (resolve) => {\n let data: number[] = [];\n if (config.face['mobilefacenet']?.enabled && model?.inputs[0].shape) {\n const t: Record = {};\n t.crop = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false); // just resize to fit the embedding model\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 // t.crop = tf.image.cropAndResize(input, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n t.data = model.execute(t.crop) as Tensor;\n /*\n // optional normalize outputs with l2 normalization\n const scaled = tf.tidy(() => {\n const l2 = res.norm('euclidean');\n const scale = res.div(l2);\n return scale;\n });\n\n // optional reduce feature vector complexity\n const reshape = tf.reshape(res, [128, 2]); // split 256 vectors into 128 x 2\n const reduce = reshape.logSumExp(1); // reduce 2nd dimension by calculating logSumExp on it\n */\n const output = await t.data.data();\n data = Array.from(output); // convert typed array to simple array\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n last[idx] = data;\n lastCount = count;\n lastTime = now();\n resolve(data);\n });\n}\n", "/**\n * InsightFace model implementation\n *\n * Based on: [**DeepInsight InsightFace**](https://github.com/deepinsight/insightface)\n *\n * Alternative face embedding detection\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { Tensor, Tensor4D, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nconst last: number[][] = [];\nlet lastCount = 0;\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) model = await loadModel(config.face['insightface'].modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(input: Tensor4D, config: Config, idx, count): Promise {\n if (!model?.['executor']) return [];\n const skipFrame = skipped < (config.face['insightface']?.skipFrames || 0);\n const skipTime = (config.face['insightface']?.skipTime || 0) > (now() - lastTime);\n if (config.skipAllowed && skipTime && skipFrame && (lastCount === count) && last[idx]) {\n skipped++;\n return last[idx];\n }\n return new Promise(async (resolve) => {\n let data: number[] = [];\n if (config.face['insightface']?.enabled && model?.inputs[0].shape) {\n const t: Record = {};\n t.crop = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]], false); // just resize to fit the embedding model\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 // t.crop = tf.image.cropAndResize(input, box, [0], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n t.data = model.execute(t.crop) as Tensor;\n const output = await t.data.data();\n data = Array.from(output); // convert typed array to simple array\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n last[idx] = data;\n lastCount = count;\n lastTime = now();\n resolve(data);\n });\n}\n", "import type { Point, FaceResult } from '../result';\n\ntype Vector = [number, number, number];\n\nconst calculateGaze = (face: FaceResult): { bearing: number, strength: number } => {\n const radians = (pt1: Point, pt2: Point) => Math.atan2(pt1[1] - pt2[1], pt1[0] - pt2[0]); // function to calculate angle between any two points\n if (!face.annotations.rightEyeIris || !face.annotations.leftEyeIris) return { bearing: 0, strength: 0 };\n\n const offsetIris = [0, -0.1]; // iris center may not align with average of eye extremes\n const eyeRatio = 1; // factor to normalize changes x vs y\n\n const left = (face.mesh[33][2] || 0) > (face.mesh[263][2] || 0); // pick left or right eye depending which one is closer bazed on outsize point z axis\n const irisCenter = left ? face.mesh[473] : face.mesh[468];\n const eyeCenter = left // eye center is average of extreme points on x axis for both x and y, ignoring y extreme points as eyelids naturally open/close more when gazing up/down so relative point is less precise\n ? [(face.mesh[133][0] + face.mesh[33][0]) / 2, (face.mesh[133][1] + face.mesh[33][1]) / 2]\n : [(face.mesh[263][0] + face.mesh[362][0]) / 2, (face.mesh[263][1] + face.mesh[362][1]) / 2];\n const eyeSize = left // eye size is difference between extreme points for both x and y, used to normalize & squarify eye dimensions\n ? [face.mesh[133][0] - face.mesh[33][0], face.mesh[23][1] - face.mesh[27][1]]\n : [face.mesh[263][0] - face.mesh[362][0], face.mesh[253][1] - face.mesh[257][1]];\n const eyeDiff: Point = [ // x distance between extreme point and center point normalized with eye size\n (eyeCenter[0] - irisCenter[0]) / eyeSize[0] - offsetIris[0],\n eyeRatio * (irisCenter[1] - eyeCenter[1]) / eyeSize[1] - offsetIris[1],\n ];\n let strength = Math.sqrt((eyeDiff[0] * eyeDiff[0]) + (eyeDiff[1] * eyeDiff[1])); // vector length is a diagonal between two differences\n strength = Math.min(strength, face.boxRaw[2] / 2, face.boxRaw[3] / 2); // limit strength to half of box size to avoid clipping due to low precision\n const bearing = (radians([0, 0], eyeDiff) + (Math.PI / 2)) % Math.PI; // using eyeDiff instead eyeCenter/irisCenter combo due to manual adjustments and rotate clockwise 90degrees\n return { bearing, strength };\n};\n\nexport const calculateFaceAngle = (face: FaceResult, imageSize: [number, number]): {\n angle: { pitch: number, yaw: number, roll: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n} => {\n // const degrees = (theta) => Math.abs(((theta * 180) / Math.PI) % 360);\n const normalize = (v: Vector): Vector => { // 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: Vector, b: Vector): Vector => { // 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: Vector, b: Vector): Vector => { // 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: number[]): { pitch: number, yaw: number, roll: number } => {\n const [r00, _r01, _r02, r10, r11, r12, r20, r21, r22] = r; // eslint-disable-line @typescript-eslint/no-unused-vars\n let thetaX: number;\n let thetaY: number;\n let thetaZ: number;\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 if (Number.isNaN(thetaX)) thetaX = 0;\n if (Number.isNaN(thetaY)) thetaY = 0;\n if (Number.isNaN(thetaZ)) thetaZ = 0;\n return { pitch: 2 * -thetaX, yaw: 2 * -thetaY, roll: 2 * -thetaZ };\n };\n\n /*\n const meshToEulerAngle = (mesh) => { // simple Euler angle calculation based existing 3D mesh\n const radians = (a1, a2, b1, b2) => Math.atan2(b2 - a2, b1 - a1);\n return { // values are in radians in range of -pi/2 to pi/2 which is -90 to +90 degrees, value of 0 means center\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 // pitch is face move up/down\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 // yaw is face turn 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 // roll is face lean left/right\n };\n };\n */\n\n // initialize gaze and mesh\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], gaze: { bearing: 0, strength: 0 } };\n\n const size = Math.max(face.boxRaw[2] * imageSize[0], face.boxRaw[3] * imageSize[1]) / 1.5;\n // top, bottom, left, right\n const pts: Point[] = [mesh[10], mesh[152], mesh[234], mesh[454]].map((pt) => [pt[0] * imageSize[0] / size, pt[1] * imageSize[1] / size, pt[2]] as Point); // make the xyz coordinates proportional, independent of the image/box size\n\n const yAxis = normalize(subVectors(pts[1] as Vector, pts[0] as Vector));\n let xAxis = normalize(subVectors(pts[3] as Vector, pts[2] as Vector));\n const zAxis = normalize(crossVectors(xAxis, yAxis));\n // adjust xAxis to make sure that all axes are perpendicular to each other\n xAxis = crossVectors(yAxis, zAxis);\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 xAxis[0], xAxis[1], xAxis[2],\n yAxis[0], yAxis[1], yAxis[2],\n zAxis[0], zAxis[1], zAxis[2],\n ];\n const angle = rotationMatrixToEulerAngle(matrix);\n // const angle = meshToEulerAngle(mesh);\n\n // we have iris keypoints so we can calculate gaze direction\n const gaze = mesh.length === 478 ? calculateGaze(face) : { bearing: 0, strength: 0 };\n\n return { angle, matrix, gaze };\n};\n", "import type { FaceResult } from '../result';\n\nexport function calculateCameraDistance(face: FaceResult, width: number): number {\n // iris points are [center, left, top, right, bottom]\n // average size of human iris is 11.7mm - fairly constant for all ages/genders/races\n const f = face?.annotations;\n if (!f?.leftEyeIris || !f?.rightEyeIris) return 0;\n // get size of left and right iris in pixels, pick larger one as its likely to be more accurate and normalize to 0..1 range instead of pixels\n const irisSize = Math.max(Math.abs(f.leftEyeIris[3][0] - f.leftEyeIris[1][0]), Math.abs(f.rightEyeIris[3][0] - f.rightEyeIris[1][0])) / width;\n // distance of eye from camera in meters\n const cameraDistance = Math.round(1.17 / irisSize) / 100;\n return cameraDistance;\n}\n\nexport function calculateEyesDistance(face: FaceResult, width: number): number {\n // average distance between eyes is 65mm - fairly constant for typical adult male, but varies otherwise\n const f = face?.annotations;\n if (!f?.leftEyeIris || !f?.rightEyeIris) return 0;\n // get size of left and right iris in pixels, pick larger one as its likely to be more accurate and normalize to 0..1 range instead of pixels\n const irisSize = Math.max(Math.abs(f.leftEyeIris[3][0] - f.leftEyeIris[1][0]), Math.abs(f.rightEyeIris[3][0] - f.rightEyeIris[1][0])) / width;\n // pixel x and y distance of centers of left and right iris, you can use edges instead\n const irisDistanceXY = [f.leftEyeIris[0][0] - f.rightEyeIris[0][0], f.leftEyeIris[0][1] - f.rightEyeIris[0][1]];\n // absolute distance bewtween eyes in 0..1 range to account for head pitch (we can ignore yaw)\n const irisDistance = Math.sqrt((irisDistanceXY[0] * irisDistanceXY[0]) + (irisDistanceXY[1] * irisDistanceXY[1])) / width;\n // distance between eyes in meters\n const eyesDistance = Math.round(1.17 * irisDistance / irisSize) / 100;\n return eyesDistance;\n}\n", "/**\n * Face algorithm implementation\n * Uses FaceMesh, Emotion and FaceRes models to create a unified pipeline\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { env } from '../util/env';\nimport * as facemesh from './facemesh';\nimport * as emotion from '../gear/emotion';\nimport * as faceres from './faceres';\nimport * as mask from './mask';\nimport * as antispoof from './antispoof';\nimport * as liveness from './liveness';\nimport * as gear from '../gear/gear';\nimport * as ssrnetAge from '../gear/ssrnet-age';\nimport * as ssrnetGender from '../gear/ssrnet-gender';\nimport * as mobilefacenet from './mobilefacenet';\nimport * as insightface from './insightface';\nimport type { FaceResult, Emotion, Gender, Race } from '../result';\nimport type { Tensor4D } from '../tfjs/types';\nimport type { Human } from '../human';\nimport { calculateFaceAngle } from './angles';\nimport { calculateCameraDistance } from './anthropometry';\n\ninterface DescRes { age: number, gender: Gender, genderScore: number, descriptor: number[], race?: { score: number, race: Race }[] }\n\nexport const detectFace = async (instance: Human /* instance of human */, input: Tensor4D): Promise => {\n // run facemesh, includes blazeface and iris\n let timeStamp: number = now();\n let ageRes: { age: number } | Promise<{ age: number }> | null;\n let gearRes: gear.GearType | Promise | null;\n let genderRes: { gender: string, genderScore: number } | Promise<{ gender: string, genderScore: number }> | null;\n let emotionRes: { score: number, emotion: Emotion }[] | Promise<{ score: number, emotion: Emotion }[]>;\n let mobilefacenetRes: number[] | Promise | null;\n let insightfaceRes: number[] | Promise | null;\n let antispoofRes: number | Promise | null;\n let livenessRes: number | Promise | null;\n let descRes: DescRes | Promise | null;\n\n const faceRes: FaceResult[] = [];\n instance.state = 'run:face';\n const faces: FaceResult[] = await facemesh.predict(input, instance.config);\n instance.performance.face = env.perfadd ? (instance.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n if (!input.shape || input.shape.length !== 4) return [];\n if (!faces) return [];\n // for (const face of faces) {\n for (let i = 0; i < faces.length; i++) {\n instance.analyze('Get Face');\n\n // is something went wrong, skip the face\n // @ts-ignore possibly undefied\n if (!faces[i].tensor || faces[i].tensor.isDisposedInternal) {\n log('Face object is disposed:', faces[i].tensor);\n continue;\n }\n\n // optional face mask\n if (instance.config.face.detector?.mask) {\n const masked = await mask.mask(faces[i]);\n tf.dispose(faces[i].tensor);\n if (masked) faces[i].tensor = masked;\n }\n\n // calculate face angles\n const rotation = faces[i].mesh && (faces[i].mesh.length > 200) ? calculateFaceAngle(faces[i], [input.shape[2], input.shape[1]]) : null;\n\n // run emotion, inherits face from blazeface\n instance.analyze('Start Emotion:');\n if (instance.config.async) {\n emotionRes = instance.config.face.emotion?.enabled ? emotion.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : [];\n } else {\n instance.state = 'run:emotion';\n timeStamp = now();\n emotionRes = instance.config.face.emotion?.enabled ? await emotion.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : [];\n instance.performance.emotion = env.perfadd ? (instance.performance.emotion || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End Emotion:');\n\n // run antispoof, inherits face from blazeface\n instance.analyze('Start AntiSpoof:');\n if (instance.config.async) {\n antispoofRes = instance.config.face.antispoof?.enabled ? antispoof.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n } else {\n instance.state = 'run:antispoof';\n timeStamp = now();\n antispoofRes = instance.config.face.antispoof?.enabled ? await antispoof.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n instance.performance.antispoof = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End AntiSpoof:');\n\n // run liveness, inherits face from blazeface\n instance.analyze('Start Liveness:');\n if (instance.config.async) {\n livenessRes = instance.config.face.liveness?.enabled ? liveness.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n } else {\n instance.state = 'run:liveness';\n timeStamp = now();\n livenessRes = instance.config.face.liveness?.enabled ? await liveness.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : 0;\n instance.performance.liveness = env.perfadd ? (instance.performance.antispoof || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End Liveness:');\n\n // run gear, inherits face from blazeface\n instance.analyze('Start GEAR:');\n if (instance.config.async) {\n gearRes = instance.config.face.gear?.enabled ? gear.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:gear';\n timeStamp = now();\n gearRes = instance.config.face.gear?.enabled ? await gear.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.gear = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End GEAR:');\n\n // run gear, inherits face from blazeface\n instance.analyze('Start SSRNet:');\n if (instance.config.async) {\n ageRes = instance.config.face['ssrnet']?.enabled ? ssrnetAge.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n genderRes = instance.config.face['ssrnet']?.enabled ? ssrnetGender.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:ssrnet';\n timeStamp = now();\n ageRes = instance.config.face['ssrnet']?.enabled ? await ssrnetAge.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n genderRes = instance.config.face['ssrnet']?.enabled ? await ssrnetGender.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.ssrnet = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End SSRNet:');\n\n // run mobilefacenet alternative, inherits face from blazeface\n instance.analyze('Start MobileFaceNet:');\n if (instance.config.async) {\n mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? mobilefacenet.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:mobilefacenet';\n timeStamp = now();\n mobilefacenetRes = instance.config.face['mobilefacenet']?.enabled ? await mobilefacenet.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End MobileFaceNet:');\n\n // run insightface alternative, inherits face from blazeface\n instance.analyze('Start InsightFace:');\n if (instance.config.async) {\n insightfaceRes = instance.config.face['insightface']?.enabled ? insightface.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n } else {\n instance.state = 'run:mobilefacenet';\n timeStamp = now();\n insightfaceRes = instance.config.face['insightface']?.enabled ? await insightface.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length) : null;\n instance.performance.mobilefacenet = Math.trunc(now() - timeStamp);\n }\n instance.analyze('End InsightFace:');\n\n // run faceres, inherits face from blazeface\n instance.analyze('Start Description:');\n if (instance.config.async) {\n descRes = faceres.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length);\n } else {\n instance.state = 'run:description';\n timeStamp = now();\n descRes = await faceres.predict(faces[i].tensor as Tensor4D || tf.tensor([]), instance.config, i, faces.length);\n instance.performance.description = env.perfadd ? (instance.performance.description || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n instance.analyze('End Description:');\n\n // if async wait for results\n if (instance.config.async) {\n [ageRes, genderRes, emotionRes, mobilefacenetRes, insightfaceRes, descRes, gearRes, antispoofRes, livenessRes] = await Promise.all([ageRes, genderRes, emotionRes, mobilefacenetRes, insightfaceRes, descRes, gearRes, antispoofRes, livenessRes]);\n }\n instance.analyze('Finish Face:');\n\n if (instance.config.face['ssrnet']?.enabled && ageRes && genderRes) { // override age/gender if ssrnet model is used\n descRes = {\n ...(descRes as DescRes),\n age: (ageRes as { age: number}).age,\n gender: (genderRes as { gender: Gender, genderScore: number }).gender,\n genderScore: (genderRes as { gender: Gender, genderScore: number }).genderScore,\n };\n }\n if (instance.config.face.gear?.enabled && gearRes) { // override age/gender/race if gear model is used\n descRes = {\n ...(descRes as DescRes),\n age: (gearRes as gear.GearType).age,\n gender: (gearRes as gear.GearType).gender,\n genderScore: (gearRes as gear.GearType).genderScore,\n race: (gearRes as gear.GearType).race,\n };\n }\n if (instance.config.face['mobilefacenet']?.enabled && mobilefacenetRes) { // override descriptor if mobilefacenet model is used\n (descRes as DescRes).descriptor = mobilefacenetRes as number[];\n }\n\n if (instance.config.face['insightface']?.enabled && insightfaceRes) { // override descriptor if insightface model is used\n (descRes as DescRes).descriptor = insightfaceRes as number[];\n }\n\n const irisSize = instance.config.face.iris?.enabled ? calculateCameraDistance(faces[i], input.shape[2]) : 0;\n\n // optionally return tensor\n const tensor = instance.config.face.detector?.return ? tf.squeeze(faces[i].tensor as Tensor4D) : null;\n // dispose original face tensor\n tf.dispose(faces[i].tensor);\n // delete temp face image\n if (faces[i].tensor) delete faces[i].tensor;\n // combine results\n const res: FaceResult = {\n ...faces[i],\n id: i,\n };\n if ((descRes as DescRes).age) res.age = (descRes as DescRes).age;\n if ((descRes as DescRes).gender) res.gender = (descRes as DescRes).gender;\n if ((descRes as DescRes).genderScore) res.genderScore = (descRes as DescRes).genderScore;\n if ((descRes as DescRes).descriptor) res.embedding = (descRes as DescRes).descriptor;\n if ((descRes as DescRes).race) res.race = (descRes as DescRes).race as { score: number, race: Race }[];\n if (emotionRes) res.emotion = emotionRes as { score: number, emotion: Emotion }[];\n if (antispoofRes) res.real = antispoofRes as number;\n if (livenessRes) res.live = livenessRes as number;\n if (irisSize > 0) res.distance = irisSize;\n if (rotation) res.rotation = rotation;\n if (tensor) res.tensor = tensor;\n faceRes.push(res);\n instance.analyze('End Face');\n }\n instance.analyze('End FaceMesh:');\n if (instance.config.async) {\n if (instance.performance.face) delete instance.performance.face;\n if (instance.performance.age) delete instance.performance.age;\n if (instance.performance.gender) delete instance.performance.gender;\n if (instance.performance.emotion) delete instance.performance.emotion;\n }\n return faceRes;\n};\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nexport const Finger = {\n thumb: 0,\n index: 1,\n middle: 2,\n ring: 3,\n pinky: 4,\n all: [0, 1, 2, 3, 4], // just for convenience\n nameMapping: { 0: 'thumb', 1: 'index', 2: 'middle', 3: 'ring', 4: 'pinky' },\n // Describes mapping of joints based on the 21 points returned by handpose.\n // [0] Palm\n // [1-4] Thumb\n // [5-8] Index\n // [9-12] Middle\n // [13-16] Ring\n // [17-20] Pinky\n pointsMapping: {\n 0: [[0, 1], [1, 2], [2, 3], [3, 4]],\n 1: [[0, 5], [5, 6], [6, 7], [7, 8]],\n 2: [[0, 9], [9, 10], [10, 11], [11, 12]],\n 3: [[0, 13], [13, 14], [14, 15], [15, 16]],\n 4: [[0, 17], [17, 18], [18, 19], [19, 20]],\n },\n getName: (value) => Finger.nameMapping[value],\n getPoints: (value) => Finger.pointsMapping[value],\n};\n\nexport const FingerCurl = {\n none: 0,\n half: 1,\n full: 2,\n nameMapping: { 0: 'none', 1: 'half', 2: 'full' },\n getName: (value) => FingerCurl.nameMapping[value],\n};\n\nexport const FingerDirection = {\n verticalUp: 0,\n verticalDown: 1,\n horizontalLeft: 2,\n horizontalRight: 3,\n diagonalUpRight: 4,\n diagonalUpLeft: 5,\n diagonalDownRight: 6,\n diagonalDownLeft: 7,\n nameMapping: { 0: 'verticalUp', 1: 'verticalDown', 2: 'horizontalLeft', 3: 'horizontalRight', 4: 'diagonalUpRight', 5: 'diagonalUpLeft', 6: 'diagonalDownRight', 7: 'diagonalDownLeft' },\n getName: (value) => FingerDirection.nameMapping[value],\n};\n\nexport class FingerGesture {\n name;\n curls;\n directions;\n weights;\n weightsRelative;\n\n constructor(name) {\n // name (should be unique)\n this.name = name;\n this.curls = {};\n this.directions = {};\n this.weights = [1.0, 1.0, 1.0, 1.0, 1.0];\n this.weightsRelative = [1.0, 1.0, 1.0, 1.0, 1.0];\n }\n\n curl(finger, curl, confidence) {\n if (typeof this.curls[finger] === 'undefined') this.curls[finger] = [];\n this.curls[finger].push([curl, confidence]);\n }\n\n direction(finger, position, confidence) {\n if (!this.directions[finger]) this.directions[finger] = [];\n this.directions[finger].push([position, confidence]);\n }\n\n weight(finger, weight) {\n this.weights[finger] = weight;\n // recalculate relative weights\n const total = this.weights.reduce((a, b) => a + b, 0);\n this.weightsRelative = this.weights.map((el) => el * 5 / total);\n }\n\n matchAgainst(detectedCurls, detectedDirections) {\n let confidence = 0.0;\n // look at the detected curl of each finger and compare with\n // the expected curl of this finger inside current gesture\n for (const fingerIdx in detectedCurls) {\n const detectedCurl = detectedCurls[fingerIdx];\n const expectedCurls = this.curls[fingerIdx];\n if (typeof expectedCurls === 'undefined') {\n // no curl description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible curl of this specific finger\n for (const [expectedCurl, score] of expectedCurls) {\n if (detectedCurl === expectedCurl) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n // same for detected direction of each finger\n for (const fingerIdx in detectedDirections) {\n const detectedDirection = detectedDirections[fingerIdx];\n const expectedDirections = this.directions[fingerIdx];\n if (typeof expectedDirections === 'undefined') {\n // no direction description available for this finger\n // add default confidence of \"1\"\n confidence += this.weightsRelative[fingerIdx];\n continue;\n }\n // compare to each possible direction of this specific finger\n for (const [expectedDirection, score] of expectedDirections) {\n if (detectedDirection === expectedDirection) {\n confidence += score * this.weightsRelative[fingerIdx];\n break;\n }\n }\n }\n return confidence / 10;\n }\n}\n", "/**\n * FingerPose algorithm implementation\n * See `fingerpose.ts` for entry point\n */\n\nimport { Finger, FingerCurl, FingerDirection, FingerGesture } from './fingerdef';\n\nexport const { thumb, index, middle, ring, pinky } = Finger;\nexport const { none, half, full } = FingerCurl;\nexport const { verticalUp, verticalDown, horizontalLeft, horizontalRight, diagonalUpRight, diagonalUpLeft, diagonalDownRight, diagonalDownLeft } = FingerDirection;\n\n// describe thumbs up gesture \uD83D\uDC4D\nconst ThumbsUp = new FingerGesture('thumbs up');\nThumbsUp.curl(thumb, none, 1.0);\nThumbsUp.direction(thumb, verticalUp, 1.0);\nThumbsUp.direction(thumb, diagonalUpLeft, 0.25);\nThumbsUp.direction(thumb, diagonalUpRight, 0.25);\nfor (const finger of [Finger.index, Finger.middle, Finger.ring, Finger.pinky]) {\n ThumbsUp.curl(finger, full, 1.0);\n ThumbsUp.direction(finger, horizontalLeft, 1.0);\n ThumbsUp.direction(finger, horizontalRight, 1.0);\n}\n\n// describe Victory gesture \u270C\uFE0F\nconst Victory = new FingerGesture('victory');\nVictory.curl(thumb, half, 0.5);\nVictory.curl(thumb, none, 0.5);\nVictory.direction(thumb, verticalUp, 1.0);\nVictory.direction(thumb, diagonalUpLeft, 1.0);\nVictory.curl(index, none, 1.0);\nVictory.direction(index, verticalUp, 0.75);\nVictory.direction(index, diagonalUpLeft, 1.0);\nVictory.curl(middle, none, 1.0);\nVictory.direction(middle, verticalUp, 1.0);\nVictory.direction(middle, diagonalUpLeft, 0.75);\nVictory.curl(ring, full, 1.0);\nVictory.direction(ring, verticalUp, 0.2);\nVictory.direction(ring, diagonalUpLeft, 1.0);\nVictory.direction(ring, horizontalLeft, 0.2);\nVictory.curl(pinky, full, 1.0);\nVictory.direction(pinky, verticalUp, 0.2);\nVictory.direction(pinky, diagonalUpLeft, 1.0);\nVictory.direction(pinky, horizontalLeft, 0.2);\nVictory.weight(index, 2);\nVictory.weight(middle, 2);\n\n// describe Point gesture \u270C\uFE0F\nconst Point = new FingerGesture('point');\nPoint.curl(thumb, full, 1.0);\nPoint.curl(index, none, 0.5);\nPoint.curl(middle, full, 0.5);\nPoint.curl(ring, full, 0.5);\nPoint.curl(pinky, full, 0.5);\nPoint.weight(index, 2);\nPoint.weight(middle, 2);\n\n// describe Point gesture \u270C\uFE0F\nconst MiddleFinger = new FingerGesture('middle finger');\nMiddleFinger.curl(thumb, none, 1.0);\nMiddleFinger.curl(index, full, 0.5);\nMiddleFinger.curl(middle, full, 0.5);\nMiddleFinger.curl(ring, full, 0.5);\nMiddleFinger.curl(pinky, full, 0.5);\nMiddleFinger.weight(index, 2);\nMiddleFinger.weight(middle, 2);\n\n// describe Open Palm gesture \u270C\uFE0F\nconst OpenPalm = new FingerGesture('open palm');\nOpenPalm.curl(thumb, none, 0.75);\nOpenPalm.curl(index, none, 0.75);\nOpenPalm.curl(middle, none, 0.75);\nOpenPalm.curl(ring, none, 0.75);\nOpenPalm.curl(pinky, none, 0.75);\n\nexport default [ThumbsUp, Victory, Point, MiddleFinger, OpenPalm];\n", "/**\n * FingerPose algorithm implementation constants\n *\n * Based on: [**FingerPose***](https://github.com/andypotato/fingerpose)\n */\n\n/* eslint-disable camelcase */\n\nimport { Finger, FingerCurl, FingerDirection } from './fingerdef';\nimport Gestures from '../hand/fingergesture';\n\nconst minConfidence = 0.7;\nconst options = {\n // curl estimation\n HALF_CURL_START_LIMIT: 60.0,\n NO_CURL_START_LIMIT: 130.0,\n // direction estimation\n DISTANCE_VOTE_POWER: 1.1,\n SINGLE_ANGLE_VOTE_POWER: 0.9,\n TOTAL_ANGLE_VOTE_POWER: 1.6,\n};\n\nfunction calculateSlope(point1x, point1y, point2x, point2y) {\n const value = (point1y - point2y) / (point1x - point2x);\n let slope = Math.atan(value) * 180 / Math.PI;\n if (slope <= 0) slope = -slope;\n else if (slope > 0) slope = 180 - slope;\n return slope;\n}\n\n// point1, point2 are 2d or 3d point arrays (xy[z])\n// returns either a single scalar (2d) or array of two slopes (3d)\nfunction getSlopes(point1, point2) {\n if (!point1 || !point2) return [0, 0];\n const slopeXY = calculateSlope(point1[0], point1[1], point2[0], point2[1]);\n if (point1.length === 2) return slopeXY;\n const slopeYZ = calculateSlope(point1[1], point1[2], point2[1], point2[2]);\n return [slopeXY, slopeYZ];\n}\n\nfunction angleOrientationAt(angle, weightageAt = 1.0) {\n let isVertical = 0;\n let isDiagonal = 0;\n let isHorizontal = 0;\n if (angle >= 75.0 && angle <= 105.0) isVertical = 1 * weightageAt;\n else if (angle >= 25.0 && angle <= 155.0) isDiagonal = 1 * weightageAt;\n else isHorizontal = 1 * weightageAt;\n return [isVertical, isDiagonal, isHorizontal];\n}\n\nfunction estimateFingerCurl(startPoint, midPoint, endPoint) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const start_mid_z_dist = startPoint[2] - midPoint[2];\n const start_end_z_dist = startPoint[2] - endPoint[2];\n const mid_end_z_dist = midPoint[2] - endPoint[2];\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist + start_mid_z_dist * start_mid_z_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist + start_end_z_dist * start_end_z_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist + mid_end_z_dist * mid_end_z_dist);\n let cos_in = (mid_end_dist * mid_end_dist + start_mid_dist * start_mid_dist - start_end_dist * start_end_dist) / (2 * mid_end_dist * start_mid_dist);\n if (cos_in > 1.0) cos_in = 1.0;\n else if (cos_in < -1.0) cos_in = -1.0;\n let angleOfCurve = Math.acos(cos_in);\n angleOfCurve = (57.2958 * angleOfCurve) % 180;\n let fingerCurl;\n if (angleOfCurve > options.NO_CURL_START_LIMIT) fingerCurl = FingerCurl.none;\n else if (angleOfCurve > options.HALF_CURL_START_LIMIT) fingerCurl = FingerCurl.half;\n else fingerCurl = FingerCurl.full;\n return fingerCurl;\n}\n\nfunction estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n if (max_dist_x === Math.abs(start_end_x_dist)) {\n if (start_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else if (max_dist_x === Math.abs(start_mid_x_dist)) {\n if (start_mid_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n } else {\n if (mid_end_x_dist > 0) estimatedDirection = FingerDirection.horizontalLeft;\n else estimatedDirection = FingerDirection.horizontalRight;\n }\n return estimatedDirection;\n}\n\nfunction estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y) {\n let estimatedDirection;\n if (max_dist_y === Math.abs(start_end_y_dist)) {\n if (start_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else if (max_dist_y === Math.abs(start_mid_y_dist)) {\n if (start_mid_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n } else {\n if (mid_end_y_dist < 0) estimatedDirection = FingerDirection.verticalDown;\n else estimatedDirection = FingerDirection.verticalUp;\n }\n return estimatedDirection;\n}\n\nfunction estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x) {\n let estimatedDirection;\n const reqd_vertical_direction = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n const reqd_horizontal_direction = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n if (reqd_vertical_direction === FingerDirection.verticalUp) {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalUpLeft;\n else estimatedDirection = FingerDirection.diagonalUpRight;\n } else {\n if (reqd_horizontal_direction === FingerDirection.horizontalLeft) estimatedDirection = FingerDirection.diagonalDownLeft;\n else estimatedDirection = FingerDirection.diagonalDownRight;\n }\n return estimatedDirection;\n}\n\nfunction calculateFingerDirection(startPoint, midPoint, endPoint, fingerSlopes) {\n const start_mid_x_dist = startPoint[0] - midPoint[0];\n const start_end_x_dist = startPoint[0] - endPoint[0];\n const mid_end_x_dist = midPoint[0] - endPoint[0];\n const start_mid_y_dist = startPoint[1] - midPoint[1];\n const start_end_y_dist = startPoint[1] - endPoint[1];\n const mid_end_y_dist = midPoint[1] - endPoint[1];\n const max_dist_x = Math.max(Math.abs(start_mid_x_dist), Math.abs(start_end_x_dist), Math.abs(mid_end_x_dist));\n const max_dist_y = Math.max(Math.abs(start_mid_y_dist), Math.abs(start_end_y_dist), Math.abs(mid_end_y_dist));\n let voteVertical = 0.0;\n let voteDiagonal = 0.0;\n let voteHorizontal = 0.0;\n const start_end_x_y_dist_ratio = max_dist_y / (max_dist_x + 0.00001);\n if (start_end_x_y_dist_ratio > 1.5) voteVertical += options.DISTANCE_VOTE_POWER;\n else if (start_end_x_y_dist_ratio > 0.66) voteDiagonal += options.DISTANCE_VOTE_POWER;\n else voteHorizontal += options.DISTANCE_VOTE_POWER;\n const start_mid_dist = Math.sqrt(start_mid_x_dist * start_mid_x_dist + start_mid_y_dist * start_mid_y_dist);\n const start_end_dist = Math.sqrt(start_end_x_dist * start_end_x_dist + start_end_y_dist * start_end_y_dist);\n const mid_end_dist = Math.sqrt(mid_end_x_dist * mid_end_x_dist + mid_end_y_dist * mid_end_y_dist);\n const max_dist = Math.max(start_mid_dist, start_end_dist, mid_end_dist);\n let calc_start_point_x = startPoint[0];\n let calc_start_point_y = startPoint[1];\n let calc_end_point_x = endPoint[0];\n let calc_end_point_y = endPoint[1];\n if (max_dist === start_mid_dist) {\n calc_end_point_x = endPoint[0];\n calc_end_point_y = endPoint[1];\n } else if (max_dist === mid_end_dist) {\n calc_start_point_x = midPoint[0];\n calc_start_point_y = midPoint[1];\n }\n const calcStartPoint = [calc_start_point_x, calc_start_point_y];\n const calcEndPoint = [calc_end_point_x, calc_end_point_y];\n const totalAngle = getSlopes(calcStartPoint, calcEndPoint);\n const votes = angleOrientationAt(totalAngle, options.TOTAL_ANGLE_VOTE_POWER);\n voteVertical += votes[0];\n voteDiagonal += votes[1];\n voteHorizontal += votes[2];\n for (const fingerSlope of fingerSlopes) {\n const fingerVotes = angleOrientationAt(fingerSlope, options.SINGLE_ANGLE_VOTE_POWER);\n voteVertical += fingerVotes[0];\n voteDiagonal += fingerVotes[1];\n voteHorizontal += fingerVotes[2];\n }\n // in case of tie, highest preference goes to Vertical,\n // followed by horizontal and then diagonal\n let estimatedDirection;\n if (voteVertical === Math.max(voteVertical, voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateVerticalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y);\n } else if (voteHorizontal === Math.max(voteDiagonal, voteHorizontal)) {\n estimatedDirection = estimateHorizontalDirection(start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n } else {\n estimatedDirection = estimateDiagonalDirection(start_end_y_dist, start_mid_y_dist, mid_end_y_dist, max_dist_y, start_end_x_dist, start_mid_x_dist, mid_end_x_dist, max_dist_x);\n }\n return estimatedDirection;\n}\n\nfunction estimate(landmarks) {\n // step 1: calculate slopes\n const slopesXY: number[][] = [];\n const slopesYZ: number[][] = [];\n const fingerCurls: number[] = [];\n const fingerDirections: number[] = [];\n if (!landmarks) return { curls: fingerCurls, directions: fingerDirections };\n\n // step 1: calculate slopes\n for (const finger of Finger.all) {\n const points = Finger.getPoints(finger);\n const slopeAtXY: number[] = [];\n const slopeAtYZ: number[] = [];\n for (const point of points) {\n const point1 = landmarks[point[0]];\n const point2 = landmarks[point[1]];\n // calculate single slope\n const slopes = getSlopes(point1, point2);\n const slopeXY = slopes[0];\n const slopeYZ = slopes[1];\n slopeAtXY.push(slopeXY);\n slopeAtYZ.push(slopeYZ);\n }\n slopesXY.push(slopeAtXY);\n slopesYZ.push(slopeAtYZ);\n }\n\n // step 2: calculate orientations\n for (const finger of Finger.all) {\n // start finger predictions from palm - except for thumb\n const pointIndexAt = (finger === Finger.thumb) ? 1 : 0;\n const fingerPointsAt = Finger.getPoints(finger);\n const startPoint = landmarks[fingerPointsAt[pointIndexAt][0]];\n const midPoint = landmarks[fingerPointsAt[pointIndexAt + 1][1]];\n const endPoint = landmarks[fingerPointsAt[3][1]];\n // check if finger is curled\n const fingerCurled = estimateFingerCurl(startPoint, midPoint, endPoint);\n const fingerPosition = calculateFingerDirection(startPoint, midPoint, endPoint, slopesXY[finger].slice(pointIndexAt));\n fingerCurls[finger] = fingerCurled;\n fingerDirections[finger] = fingerPosition;\n }\n return { curls: fingerCurls, directions: fingerDirections };\n}\n\nexport function analyze(keypoints) { // get estimations of curl / direction for each finger\n if (!keypoints || keypoints.length === 0) return null;\n const estimatorRes = estimate(keypoints);\n const landmarks = {};\n for (const fingerIdx of Finger.all) {\n landmarks[Finger.getName(fingerIdx)] = {\n curl: FingerCurl.getName(estimatorRes.curls[fingerIdx]),\n direction: FingerDirection.getName(estimatorRes.directions[fingerIdx]),\n };\n }\n return landmarks;\n}\n\nexport function match(keypoints) { // compare gesture description to each known gesture\n const poses: { name: string, confidence: number }[] = [];\n if (!keypoints || keypoints.length === 0) return poses;\n const estimatorRes = estimate(keypoints);\n for (const gesture of Gestures) {\n const confidence = gesture.matchAgainst(estimatorRes.curls, estimatorRes.directions);\n if (confidence >= minConfidence) poses.push({ name: gesture.name, confidence });\n }\n return poses;\n}\n", "/**\n * Gesture detection algorithm\n */\n\nimport type { GestureResult, BodyResult, FaceResult, HandResult, Point } from '../result';\nimport * as fingerPose from '../hand/fingerpose';\n\n/** face gesture type */\nexport type FaceGesture =\n `facing ${'left' | 'center' | 'right'}`\n | `blink ${'left' | 'right'} eye`\n | `mouth ${number}% open`\n | `head ${'up' | 'down'}`;\n\n/** iris gesture type */\nexport type IrisGesture =\n 'facing center'\n | `looking ${'left' | 'right' | 'up' | 'down'}`\n | 'looking center';\n\n/** body gesture type */\nexport type BodyGesture =\n `leaning ${'left' | 'right'}`\n | `raise ${'left' | 'right'} hand`\n | 'i give up';\n\n/** hand gesture type */\nexport type HandGesture =\n `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} forward`\n | `${'thumb' | 'index' | 'middle' | 'ring' | 'pinky'} up`\n | 'victory'\n | 'thumbs up';\n\nexport const body = (res: BodyResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { body: number, gesture: BodyGesture }[] = [];\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[1] < nose.position[1]) && (rightWrist.position[1] < nose.position[1])) gestures.push({ body: i, gesture: 'i give up' });\n else if (nose && leftWrist && (leftWrist.position[1] < nose.position[1])) gestures.push({ body: i, gesture: 'raise left hand' });\n else if (nose && rightWrist && (rightWrist.position[1] < nose.position[1])) 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 && Math.abs(leftShoulder.positionRaw[1] - rightShoulder.positionRaw[1]) > 0.1) {\n gestures.push({ body: i, gesture: `leaning ${(leftShoulder.position[1] > rightShoulder.position[1]) ? 'left' : 'right'}` });\n }\n }\n return gestures;\n};\n\nexport const face = (res: FaceResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { face: number, gesture: FaceGesture }[] = [];\n for (let i = 0; i < res.length; i++) {\n if (res[i].mesh && res[i].mesh.length > 450) {\n const zDiff = (res[i].mesh[33][2] || 0) - (res[i].mesh[263][2] || 0);\n const xDiff = res[i].mesh[33][0] - res[i].mesh[263][0];\n if (Math.abs(zDiff / xDiff) <= 0.15) gestures.push({ face: i, gesture: 'facing center' });\n else gestures.push({ face: i, gesture: `facing ${zDiff < 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] || 0;\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: FaceResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { iris: number, gesture: IrisGesture }[] = [];\n for (let i = 0; i < res.length; i++) {\n if (!res[i].annotations?.leftEyeIris?.[0] || !res[i].annotations?.rightEyeIris?.[0]) 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 leftIrisCenterX = Math.abs(res[i].mesh[263][0] - res[i].annotations.leftEyeIris[0][0]) / res[i].box[2];\n const rightIrisCenterX = Math.abs(res[i].mesh[33][0] - res[i].annotations.rightEyeIris[0][0]) / res[i].box[2];\n if (leftIrisCenterX > 0.06 || rightIrisCenterX > 0.06) center = false;\n if (leftIrisCenterX > rightIrisCenterX) { // check eye with bigger offset\n if (rightIrisCenterX > 0.04) gestures.push({ iris: i, gesture: 'looking right' });\n } else {\n if (leftIrisCenterX > 0.04) gestures.push({ iris: i, gesture: 'looking left' });\n }\n\n const rightIrisCenterY = Math.abs(res[i].mesh[145][1] - res[i].annotations.rightEyeIris[0][1]) / res[i].box[3];\n const leftIrisCenterY = Math.abs(res[i].mesh[374][1] - res[i].annotations.leftEyeIris[0][1]) / res[i].box[3];\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01 || leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) center = false;\n if (leftIrisCenterY < 0.01 || rightIrisCenterY < 0.01) gestures.push({ iris: i, gesture: 'looking down' });\n if (leftIrisCenterY > 0.022 || rightIrisCenterY > 0.022) 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: HandResult[]): GestureResult[] => {\n if (!res) return [];\n const gestures: { hand: number, gesture: HandGesture }[] = [];\n for (let i = 0; i < res.length; i++) {\n const fingers: { name: string, position: Point }[] = [];\n if (res[i].annotations) {\n for (const [finger, pos] of Object.entries(res[i].annotations)) {\n if (finger !== 'palmBase' && Array.isArray(pos) && pos[0]) fingers.push({ name: finger.toLowerCase(), position: pos[0] }); // get tip of each finger\n }\n }\n if (fingers && fingers.length > 0) {\n const closest = fingers.reduce((best, a) => ((best.position[2] || 0) < (a.position[2] || 0) ? best : a));\n gestures.push({ hand: i, gesture: `${closest.name} forward` as HandGesture });\n const highest = fingers.reduce((best, a) => (best.position[1] < a.position[1] ? best : a));\n gestures.push({ hand: i, gesture: `${highest.name} up` as HandGesture });\n }\n if (res[i].keypoints) {\n const poses = fingerPose.match(res[i].keypoints);\n for (const pose of poses) gestures.push({ hand: i, gesture: pose.name as HandGesture });\n }\n }\n return gestures;\n};\n", "import * as tf from 'dist/tfjs.esm.js';\nimport type { Point } from '../result';\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]] as Point;\n const endPoint = [box.endPoint[0] * factor[0], box.endPoint[1] * factor[1]] as Point;\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]] as Point;\n const endPoint = [center[0] + newHalfSize[0], center[1] + newHalfSize[1]] as Point;\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] as Point;\n const endPoint = [centers[0] + halfSize, centers[1] + halfSize] as Point;\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]] as Point;\n const endPoint = [box.endPoint[0] + shiftVector[0], box.endPoint[1] + shiftVector[1]] as Point;\n return { startPoint, endPoint, palmLandmarks: box.palmLandmarks };\n}\n\nexport 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: number[] = [];\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: number[][] = [];\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", "/**\n * HandPose model implementation constants\n * See `handpose.ts` for entry point\n */\n\nexport const anchors = [\n { x: 0.015625, y: 0.015625 },\n { x: 0.015625, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.046875, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.078125, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.109375, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.140625, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.171875, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.203125, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.234375, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.265625, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.296875, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.328125, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.359375, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.390625, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.421875, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.453125, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.484375, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.515625, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.546875, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.578125, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.609375, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.640625, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.671875, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.703125, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.734375, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.765625, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.796875, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.828125, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.859375, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.890625, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.921875, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.953125, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.984375, y: 0.015625 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.015625, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.046875, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.078125, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.109375, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.140625, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.171875, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.203125, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.234375, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.265625, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.296875, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.328125, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.359375, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.390625, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.421875, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.453125, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.484375, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.515625, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.546875, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.578125, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.609375, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.640625, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.671875, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.703125, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.734375, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.765625, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.796875, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.828125, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.859375, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.890625, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.921875, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.953125, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.984375, y: 0.046875 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.015625, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.046875, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.078125, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.109375, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.140625, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.171875, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.203125, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.234375, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.265625, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.296875, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.328125, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.359375, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.390625, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.421875, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.453125, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.484375, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.515625, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.546875, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.578125, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.609375, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.640625, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.671875, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.703125, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.734375, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.765625, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.796875, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.828125, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.859375, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.890625, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.921875, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.953125, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.984375, y: 0.078125 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.015625, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.046875, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.078125, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.109375, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.140625, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.171875, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.203125, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.234375, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.265625, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.296875, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.328125, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.359375, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.390625, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.421875, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.453125, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.484375, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.515625, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.546875, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.578125, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.609375, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.640625, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.671875, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.703125, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.734375, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.765625, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.796875, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.828125, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.859375, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.890625, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.921875, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.953125, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.984375, y: 0.109375 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.015625, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.046875, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.078125, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.109375, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.140625, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.171875, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.203125, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.234375, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.265625, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.296875, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.328125, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.359375, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.390625, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.421875, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.453125, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.484375, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.515625, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.546875, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.578125, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.609375, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.640625, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.671875, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.703125, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.734375, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.765625, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.796875, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.828125, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.859375, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.890625, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.921875, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.953125, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.984375, y: 0.140625 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.015625, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.046875, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.078125, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.109375, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.140625, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.171875, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.203125, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.234375, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.265625, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.296875, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.328125, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.359375, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.390625, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.421875, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.453125, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.484375, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.515625, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.546875, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.578125, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.609375, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.640625, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.671875, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.703125, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.734375, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.765625, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.796875, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.828125, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.859375, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.890625, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.921875, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.953125, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.984375, y: 0.171875 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.015625, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.046875, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.078125, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.109375, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.140625, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.171875, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.203125, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.234375, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.265625, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.296875, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.328125, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.359375, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.390625, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.421875, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.453125, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.484375, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.515625, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.546875, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.578125, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.609375, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.640625, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.671875, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.703125, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.734375, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.765625, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.796875, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.828125, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.859375, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.890625, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.921875, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.953125, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.984375, y: 0.203125 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.015625, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.046875, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.078125, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.109375, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.140625, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.171875, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.203125, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.234375, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.265625, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.296875, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.328125, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.359375, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.390625, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.421875, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.453125, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.484375, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.515625, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.546875, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.578125, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.609375, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.640625, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.671875, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.703125, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.734375, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.765625, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.796875, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.828125, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.859375, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.890625, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.921875, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.953125, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.984375, y: 0.234375 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.015625, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.046875, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.078125, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.109375, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.140625, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.171875, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.203125, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.234375, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.265625, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.296875, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.328125, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.359375, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.390625, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.421875, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.453125, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.484375, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.515625, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.546875, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.578125, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.609375, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.640625, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.671875, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.703125, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.734375, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.765625, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.796875, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.828125, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.859375, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.890625, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.921875, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.953125, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.984375, y: 0.265625 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.015625, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.046875, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.078125, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.109375, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.140625, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.171875, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.203125, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.234375, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.265625, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.296875, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.328125, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.359375, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.390625, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.421875, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.453125, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.484375, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.515625, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.546875, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.578125, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.609375, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.640625, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.671875, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.703125, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.734375, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.765625, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.796875, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.828125, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.859375, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.890625, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.921875, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.953125, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.984375, y: 0.296875 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.015625, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.046875, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.078125, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.109375, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.140625, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.171875, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.203125, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.234375, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.265625, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.296875, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.328125, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.359375, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.390625, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.421875, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.453125, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.484375, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.515625, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.546875, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.578125, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.609375, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.640625, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.671875, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.703125, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.734375, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.765625, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.796875, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.828125, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.859375, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.890625, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.921875, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.953125, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.984375, y: 0.328125 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.015625, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.046875, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.078125, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.109375, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.140625, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.171875, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.203125, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.234375, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.265625, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.296875, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.328125, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.359375, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.390625, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.421875, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.453125, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.484375, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.515625, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.546875, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.578125, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.609375, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.640625, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.671875, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.703125, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.734375, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.765625, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.796875, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.828125, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.859375, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.890625, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.921875, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.953125, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.984375, y: 0.359375 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.015625, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.046875, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.078125, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.109375, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.140625, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.171875, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.203125, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.234375, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.265625, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.296875, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.328125, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.359375, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.390625, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.421875, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.453125, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.484375, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.515625, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.546875, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.578125, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.609375, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.640625, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.671875, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.703125, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.734375, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.765625, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.796875, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.828125, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.859375, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.890625, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.921875, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.953125, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.984375, y: 0.390625 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.015625, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.046875, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.078125, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.109375, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.140625, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.171875, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.203125, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.234375, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.265625, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.296875, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.328125, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.359375, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.390625, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.421875, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.453125, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.484375, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.515625, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.546875, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.578125, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.609375, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.640625, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.671875, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.703125, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.734375, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.765625, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.796875, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.828125, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.859375, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.890625, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.921875, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.953125, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.984375, y: 0.421875 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.015625, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.046875, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.078125, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.109375, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.140625, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.171875, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.203125, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.234375, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.265625, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.296875, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.328125, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.359375, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.390625, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.421875, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.453125, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.484375, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.515625, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.546875, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.578125, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.609375, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.640625, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.671875, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.703125, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.734375, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.765625, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.796875, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.828125, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.859375, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.890625, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.921875, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.953125, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.984375, y: 0.453125 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.015625, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.046875, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.078125, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.109375, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.140625, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.171875, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.203125, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.234375, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.265625, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.296875, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.328125, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.359375, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.390625, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.421875, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.453125, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.484375, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.515625, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.546875, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.578125, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.609375, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.640625, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.671875, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.703125, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.734375, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.765625, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.796875, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.828125, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.859375, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.890625, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.921875, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.953125, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.984375, y: 0.484375 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.015625, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.046875, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.078125, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.109375, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.140625, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.171875, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.203125, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.234375, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.265625, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.296875, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.328125, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.359375, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.390625, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.421875, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.453125, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.484375, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.515625, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.546875, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.578125, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.609375, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.640625, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.671875, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.703125, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.734375, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.765625, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.796875, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.828125, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.859375, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.890625, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.921875, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.953125, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.984375, y: 0.515625 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.015625, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.046875, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.078125, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.109375, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.140625, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.171875, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.203125, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.234375, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.265625, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.296875, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.328125, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.359375, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.390625, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.421875, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.453125, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.484375, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.515625, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.546875, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.578125, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.609375, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.640625, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.671875, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.703125, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.734375, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.765625, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.796875, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.828125, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.859375, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.890625, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.921875, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.953125, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.984375, y: 0.546875 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.015625, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.046875, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.078125, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.109375, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.140625, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.171875, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.203125, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.234375, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.265625, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.296875, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.328125, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.359375, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.390625, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.421875, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.453125, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.484375, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.515625, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.546875, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.578125, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.609375, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.640625, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.671875, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.703125, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.734375, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.765625, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.796875, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.828125, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.859375, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.890625, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.921875, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.953125, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.984375, y: 0.578125 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.015625, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.046875, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.078125, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.109375, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.140625, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.171875, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.203125, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.234375, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.265625, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.296875, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.328125, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.359375, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.390625, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.421875, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.453125, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.484375, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.515625, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.546875, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.578125, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.609375, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.640625, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.671875, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.703125, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.734375, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.765625, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.796875, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.828125, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.859375, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.890625, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.921875, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.953125, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.984375, y: 0.609375 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.015625, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.046875, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.078125, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.109375, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.140625, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.171875, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.203125, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.234375, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.265625, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.296875, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.328125, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.359375, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.390625, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.421875, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.453125, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.484375, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.515625, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.546875, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.578125, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.609375, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.640625, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.671875, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.703125, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.734375, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.765625, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.796875, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.828125, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.859375, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.890625, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.921875, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.953125, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.984375, y: 0.640625 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.015625, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.046875, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.078125, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.109375, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.140625, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.171875, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.203125, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.234375, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.265625, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.296875, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.328125, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.359375, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.390625, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.421875, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.453125, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.484375, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.515625, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.546875, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.578125, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.609375, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.640625, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.671875, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.703125, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.734375, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.765625, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.796875, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.828125, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.859375, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.890625, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.921875, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.953125, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.984375, y: 0.671875 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.015625, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.046875, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.078125, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.109375, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.140625, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.171875, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.203125, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.234375, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.265625, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.296875, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.328125, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.359375, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.390625, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.421875, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.453125, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.484375, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.515625, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.546875, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.578125, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.609375, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.640625, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.671875, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.703125, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.734375, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.765625, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.796875, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.828125, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.859375, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.890625, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.921875, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.953125, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.984375, y: 0.703125 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.015625, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.046875, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.078125, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.109375, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.140625, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.171875, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.203125, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.234375, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.265625, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.296875, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.328125, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.359375, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.390625, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.421875, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.453125, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.484375, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.515625, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.546875, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.578125, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.609375, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.640625, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.671875, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.703125, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.734375, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.765625, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.796875, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.828125, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.859375, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.890625, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.921875, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.953125, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.984375, y: 0.734375 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.015625, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.046875, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.078125, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.109375, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.140625, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.171875, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.203125, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.234375, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.265625, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.296875, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.328125, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.359375, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.390625, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.421875, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.453125, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.484375, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.515625, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.546875, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.578125, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.609375, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.640625, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.671875, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.703125, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.734375, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.765625, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.796875, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.828125, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.859375, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.890625, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.921875, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.953125, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.984375, y: 0.765625 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.015625, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.046875, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.078125, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.109375, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.140625, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.171875, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.203125, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.234375, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.265625, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.296875, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.328125, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.359375, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.390625, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.421875, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.453125, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.484375, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.515625, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.546875, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.578125, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.609375, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.640625, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.671875, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.703125, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.734375, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.765625, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.796875, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.828125, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.859375, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.890625, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.921875, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.953125, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.984375, y: 0.796875 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.015625, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.046875, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.078125, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.109375, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.140625, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.171875, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.203125, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.234375, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.265625, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.296875, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.328125, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.359375, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.390625, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.421875, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.453125, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.484375, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.515625, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.546875, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.578125, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.609375, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.640625, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.671875, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.703125, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.734375, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.765625, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.796875, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.828125, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.859375, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.890625, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.921875, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.953125, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.984375, y: 0.828125 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.015625, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.046875, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.078125, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.109375, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.140625, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.171875, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.203125, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.234375, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.265625, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.296875, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.328125, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.359375, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.390625, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.421875, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.453125, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.484375, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.515625, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.546875, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.578125, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.609375, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.640625, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.671875, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.703125, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.734375, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.765625, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.796875, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.828125, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.859375, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.890625, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.921875, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.953125, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.984375, y: 0.859375 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.015625, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.046875, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.078125, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.109375, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.140625, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.171875, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.203125, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.234375, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.265625, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.296875, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.328125, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.359375, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.390625, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.421875, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.453125, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.484375, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.515625, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.546875, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.578125, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.609375, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.640625, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.671875, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.703125, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.734375, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.765625, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.796875, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.828125, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.859375, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.890625, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.921875, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.953125, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.984375, y: 0.890625 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.015625, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.046875, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.078125, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.109375, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.140625, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.171875, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.203125, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.234375, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.265625, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.296875, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.328125, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.359375, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.390625, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.421875, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.453125, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.484375, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.515625, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.546875, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.578125, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.609375, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.640625, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.671875, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.703125, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.734375, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.765625, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.796875, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.828125, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.859375, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.890625, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.921875, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.953125, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.984375, y: 0.921875 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.015625, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.046875, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.078125, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.109375, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.140625, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.171875, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.203125, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.234375, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.265625, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.296875, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.328125, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.359375, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.390625, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.421875, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.453125, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.484375, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.515625, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.546875, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.578125, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.609375, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.640625, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.671875, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.703125, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.734375, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.765625, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.796875, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.828125, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.859375, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.890625, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.921875, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.953125, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.984375, y: 0.953125 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.015625, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.046875, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.078125, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.109375, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.140625, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.171875, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.203125, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.234375, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.265625, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.296875, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.328125, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.359375, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.390625, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.421875, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.453125, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.484375, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.515625, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.546875, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.578125, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.609375, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.640625, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.671875, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.703125, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.734375, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.765625, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.796875, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.828125, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.859375, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.890625, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.921875, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.953125, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.984375, y: 0.984375 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.03125, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.09375, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.15625, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.21875, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.28125, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.34375, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.40625, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.46875, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.53125, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.59375, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.65625, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.71875, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.78125, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.84375, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.90625, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.96875, y: 0.03125 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.03125, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.09375, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.15625, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.21875, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.28125, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.34375, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.40625, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.46875, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.53125, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.59375, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.65625, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.71875, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.78125, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.84375, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.90625, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.96875, y: 0.09375 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.03125, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.09375, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.15625, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.21875, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.28125, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.34375, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.40625, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.46875, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.53125, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.59375, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.65625, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.71875, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.78125, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.84375, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.90625, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.96875, y: 0.15625 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.03125, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.09375, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.15625, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.21875, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.28125, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.34375, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.40625, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.46875, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.53125, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.59375, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.65625, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.71875, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.78125, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.84375, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.90625, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.96875, y: 0.21875 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.03125, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.09375, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.15625, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.21875, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.28125, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.34375, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.40625, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.46875, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.53125, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.59375, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.65625, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.71875, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.78125, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.84375, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.90625, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.96875, y: 0.28125 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.03125, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.09375, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.15625, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.21875, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.28125, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.34375, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.40625, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.46875, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.53125, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.59375, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.65625, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.71875, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.78125, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.84375, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.90625, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.96875, y: 0.34375 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.03125, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.09375, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.15625, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.21875, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.28125, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.34375, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.40625, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.46875, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.53125, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.59375, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.65625, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.71875, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.78125, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.84375, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.90625, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.96875, y: 0.40625 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.03125, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.09375, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.15625, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.21875, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.28125, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.34375, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.40625, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.46875, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.53125, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.59375, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.65625, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.71875, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.78125, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.84375, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.90625, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.96875, y: 0.46875 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.03125, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.09375, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.15625, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.21875, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.28125, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.34375, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.40625, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.46875, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.53125, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.59375, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.65625, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.71875, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.78125, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.84375, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.90625, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.96875, y: 0.53125 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.03125, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.09375, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.15625, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.21875, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.28125, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.34375, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.40625, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.46875, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.53125, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.59375, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.65625, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.71875, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.78125, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.84375, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.90625, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.96875, y: 0.59375 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.03125, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.09375, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.15625, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.21875, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.28125, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.34375, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.40625, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.46875, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.53125, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.59375, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.65625, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.71875, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.78125, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.84375, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.90625, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.96875, y: 0.65625 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.03125, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.09375, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.15625, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.21875, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.28125, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.34375, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.40625, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.46875, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.53125, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.59375, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.65625, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.71875, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.78125, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.84375, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.90625, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.96875, y: 0.71875 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.03125, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.09375, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.15625, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.21875, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.28125, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.34375, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.40625, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.46875, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.53125, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.59375, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.65625, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.71875, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.78125, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.84375, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.90625, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.96875, y: 0.78125 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.03125, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.09375, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.15625, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.21875, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.28125, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.34375, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.40625, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.46875, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.53125, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.59375, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.65625, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.71875, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.78125, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.84375, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.90625, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.96875, y: 0.84375 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.03125, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.09375, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.15625, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.21875, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.28125, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.34375, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.40625, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.46875, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.53125, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.59375, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.65625, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.71875, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.78125, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.84375, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.90625, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.96875, y: 0.90625 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.03125, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.09375, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.15625, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.21875, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.28125, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.34375, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.40625, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.46875, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.53125, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.59375, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.65625, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.71875, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.78125, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.84375, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.90625, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.96875, y: 0.96875 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.0625, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.1875, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.3125, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.4375, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.5625, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.6875, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.8125, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.9375, y: 0.0625 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.0625, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.1875, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.3125, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.4375, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.5625, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.6875, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.8125, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.9375, y: 0.1875 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.0625, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.1875, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.3125, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.4375, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.5625, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.6875, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.8125, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.9375, y: 0.3125 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.0625, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.1875, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.3125, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.4375, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.5625, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.6875, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.8125, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.9375, y: 0.4375 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.0625, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.1875, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.3125, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.4375, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.5625, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.6875, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.8125, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.9375, y: 0.5625 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.0625, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.1875, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.3125, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.4375, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.5625, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.6875, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.8125, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.9375, y: 0.6875 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.0625, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.1875, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.3125, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.4375, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.5625, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.6875, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.8125, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.9375, y: 0.8125 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.0625, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.1875, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.3125, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.4375, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.5625, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.6875, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.8125, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n { x: 0.9375, y: 0.9375 },\n];\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as util from './handposeutil';\nimport * as anchors from './handposeanchors';\nimport { constants } from '../tfjs/constants';\nimport type { Tensor, Tensor1D, Tensor2D, Tensor4D, GraphModel } from '../tfjs/types';\nimport type { Point } from '../result';\nimport type { Config } from '../config';\n\nexport class HandDetector {\n model: GraphModel;\n anchors: number[][];\n anchorsTensor: Tensor;\n inputSize: number;\n inputSizeTensor: Tensor;\n doubleInputSizeTensor: Tensor;\n\n constructor(model: GraphModel) {\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] || 0;\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 const t: Record = {};\n t.boxOffsets = tf.slice(boxes, [0, 0], [-1, 2]);\n t.boxSizes = tf.slice(boxes, [0, 2], [-1, 2]);\n t.div = tf.div(t.boxOffsets, this.inputSizeTensor);\n t.boxCenterPoints = tf.add(t.div, this.anchorsTensor);\n t.halfBoxSizes = tf.div(t.boxSizes, this.doubleInputSizeTensor);\n t.sub = tf.sub(t.boxCenterPoints, t.halfBoxSizes);\n t.startPoints = tf.mul(t.sub, this.inputSizeTensor);\n t.add = tf.add(t.boxCenterPoints, t.halfBoxSizes);\n t.endPoints = tf.mul(t.add, this.inputSizeTensor);\n const res = tf.concat2d([t.startPoints as Tensor2D, t.endPoints as Tensor2D], 1);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return res as Tensor;\n }\n\n normalizeLandmarks(rawPalmLandmarks, index: number): Tensor {\n const t: Record = {};\n t.reshape = tf.reshape(rawPalmLandmarks, [-1, 7, 2]);\n t.div = tf.div(t.reshape, this.inputSizeTensor);\n t.landmarks = tf.add(t.div, this.anchors[index] ? this.anchors[index] : 0);\n const res = tf.mul(t.landmarks, this.inputSizeTensor);\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return res;\n }\n\n async predict(input: Tensor4D, config: Config): Promise<{ startPoint: Point; endPoint: Point, palmLandmarks: Point[]; confidence: number }[]> {\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [this.inputSize, this.inputSize]);\n t.div = tf.div(t.resize, constants.tf127);\n t.image = tf.sub(t.div, constants.tf1);\n t.batched = this.model.execute(t.image) as Tensor;\n t.predictions = tf.squeeze(t.batched);\n t.slice = tf.slice(t.predictions, [0, 0], [-1, 1]);\n t.sigmoid = tf.sigmoid(t.slice);\n t.scores = tf.squeeze(t.sigmoid);\n const scores = await t.scores.data();\n t.boxes = tf.slice(t.predictions, [0, 1], [-1, 4]);\n t.norm = this.normalizeBoxes(t.boxes);\n // box detection is flaky so we look for 3x boxes than we need results\n t.nms = await tf.image.nonMaxSuppressionAsync(t.norm as Tensor2D, t.scores as Tensor1D, 3 * (config.hand?.maxDetected || 1), config.hand.iouThreshold, config.hand.minConfidence);\n const nms = await t.nms.array() as number[];\n const hands: { startPoint: Point; endPoint: Point; palmLandmarks: Point[]; confidence: number }[] = [];\n for (const index of nms) {\n const p: Record = {};\n p.box = tf.slice(t.norm, [index, 0], [1, -1]);\n p.slice = tf.slice(t.predictions, [index, 5], [1, 14]);\n p.norm = this.normalizeLandmarks(p.slice, index);\n p.palmLandmarks = tf.reshape(p.norm, [-1, 2]);\n const box = await p.box.data();\n const startPoint = box.slice(0, 2) as unknown as Point;\n const endPoint = box.slice(2, 4) as unknown as Point;\n const palmLandmarks = await p.palmLandmarks.array();\n const hand = { startPoint, endPoint, palmLandmarks, confidence: scores[index] };\n const scaled = util.scaleBoxCoordinates(hand, [(input.shape[2] || 1) / this.inputSize, (input.shape[1] || 0) / this.inputSize]);\n hands.push(scaled);\n Object.keys(p).forEach((tensor) => tf.dispose(p[tensor]));\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return hands;\n }\n}\n", "/**\n * HandPose model implementation\n * See `handpose.ts` for entry point\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport * as util from './handposeutil';\nimport type * as detector from './handposedetector';\nimport { constants } from '../tfjs/constants';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport { env } from '../util/env';\nimport { now } from '../util/util';\nimport type { Point } from '../result';\n\nconst palmBoxEnlargeFactor = 5; // default 3\nconst handBoxEnlargeFactor = 1.65; // default 1.65\nconst palmLandmarkIds = [0, 5, 9, 13, 17, 1, 2];\nconst palmLandmarksPalmBase = 0;\nconst palmLandmarksMiddleFingerBase = 2;\nlet lastTime = 0;\n\nexport class HandPipeline {\n handDetector: detector.HandDetector;\n handPoseModel: GraphModel;\n inputSize: number;\n storedBoxes: ({ startPoint: Point; endPoint: Point; palmLandmarks: Point[]; confidence: number } | null)[];\n skipped: number;\n detectedHands: number;\n\n constructor(handDetector, handPoseModel) {\n this.handDetector = handDetector;\n this.handPoseModel = handPoseModel;\n this.inputSize = this.handPoseModel?.inputs?.[0].shape?.[2] || 0;\n this.storedBoxes = [];\n this.skipped = Number.MAX_SAFE_INTEGER;\n this.detectedHands = 0;\n }\n\n calculateLandmarksBoundingBox(landmarks) { // eslint-disable-line class-methods-use-this\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 getBoxForPalmLandmarks(palmLandmarks, rotationMatrix) {\n const rotatedPalmLandmarks = palmLandmarks.map((coord) => util.rotatePoint([...coord, 1], rotationMatrix));\n const boxAroundPalm = this.calculateLandmarksBoundingBox(rotatedPalmLandmarks);\n return util.enlargeBox(util.squarifyBox(boxAroundPalm), palmBoxEnlargeFactor);\n }\n\n getBoxForHandLandmarks(landmarks) {\n const boundingBox = this.calculateLandmarksBoundingBox(landmarks);\n const boxAroundHand = util.enlargeBox(util.squarifyBox(boundingBox), handBoxEnlargeFactor);\n boxAroundHand.palmLandmarks = [];\n for (let i = 0; i < palmLandmarkIds.length; i++) {\n boxAroundHand.palmLandmarks.push(landmarks[palmLandmarkIds[i]].slice(0, 2));\n }\n return boxAroundHand;\n }\n\n transformRawCoords(rawCoords, box2, angle, rotationMatrix) {\n const boxSize = util.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 = [...util.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 Math.trunc(coord[0] + originalBoxCenter[0]),\n Math.trunc(coord[1] + originalBoxCenter[1]),\n Math.trunc(coord[2]),\n ]);\n }\n\n async estimateHands(image, config) {\n let useFreshBox = false;\n\n // run new detector every skipFrames\n let boxes;\n const skipTime = (config.hand.skipTime || 0) > (now() - lastTime);\n const skipFrame = this.skipped < (config.hand.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame) {\n this.skipped++;\n } else {\n boxes = await this.handDetector.predict(image, config);\n this.skipped = 0;\n }\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: { landmarks: Point[], confidence: number, boxConfidence: number, fingerConfidence: number, box: { topLeft: Point, bottomRight: Point } }[] = [];\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[palmLandmarksPalmBase], currentBox.palmLandmarks[palmLandmarksMiddleFingerBase]) : 0;\n const palmCenter = util.getBoxCenter(currentBox);\n const palmCenterNormalized: [number, number] = [palmCenter[0] / image.shape[2], palmCenter[1] / image.shape[1]];\n const rotatedImage = config.hand.rotation && env.kernels.includes('rotatewithoffset') ? 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 = util.cutBoxFromImageAndResize(newBox, rotatedImage, [this.inputSize, this.inputSize]);\n const handImage = tf.div(croppedInput, constants.tf255);\n tf.dispose(croppedInput);\n tf.dispose(rotatedImage);\n const [confidenceT, keypoints] = this.handPoseModel.execute(handImage) as Tensor[];\n lastTime = now();\n tf.dispose(handImage);\n const confidence = (await confidenceT.data())[0];\n tf.dispose(confidenceT);\n if (confidence >= config.hand.minConfidence / 4) {\n const keypointsReshaped = tf.reshape(keypoints, [-1, 3]);\n const rawCoords = await keypointsReshaped.array();\n tf.dispose(keypoints);\n tf.dispose(keypointsReshaped);\n const coords = this.transformRawCoords(rawCoords, newBox, angle, rotationMatrix);\n const nextBoundingBox = this.getBoxForHandLandmarks(coords);\n this.storedBoxes[i] = { ...nextBoundingBox, confidence };\n const result = {\n landmarks: coords,\n confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: confidence,\n box: { topLeft: nextBoundingBox.startPoint, bottomRight: nextBoundingBox.endPoint },\n };\n hands.push(result);\n } else {\n this.storedBoxes[i] = null;\n }\n tf.dispose(keypoints);\n } else {\n // const enlarged = box.enlargeBox(box.squarifyBox(box.shiftBox(currentBox, HAND_BOX_SHIFT_VECTOR)), handBoxEnlargeFactor);\n const enlarged = util.enlargeBox(util.squarifyBox(currentBox), handBoxEnlargeFactor);\n const result = {\n confidence: currentBox.confidence,\n boxConfidence: currentBox.confidence,\n fingerConfidence: 0,\n box: { topLeft: enlarged.startPoint, bottomRight: enlarged.endPoint },\n landmarks: [],\n };\n hands.push(result);\n }\n }\n this.storedBoxes = this.storedBoxes.filter((a) => a !== null);\n this.detectedHands = hands.length;\n if (hands.length > config.hand.maxDetected) hands.length = config.hand.maxDetected;\n return hands;\n }\n}\n", "/**\n * HandPose model implementation\n *\n * Based on: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n */\n\nimport { log } from '../util/util';\nimport * as handdetector from './handposedetector';\nimport * as handpipeline from './handposepipeline';\nimport * as fingerPose from './fingerpose';\nimport { loadModel } from '../tfjs/load';\nimport type { HandResult, Box, Point } from '../result';\nimport type { Tensor, GraphModel } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nconst meshAnnotations = {\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n palm: [0],\n};\n\nlet handDetectorModel: GraphModel | null;\nlet handPoseModel: GraphModel | null;\nlet handPipeline: handpipeline.HandPipeline;\n\nexport function initPipeline() {\n const handDetector = handDetectorModel ? new handdetector.HandDetector(handDetectorModel) : undefined;\n if (handDetector && handPoseModel) handPipeline = new handpipeline.HandPipeline(handDetector, handPoseModel);\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!handPipeline) initPipeline();\n const predictions = await handPipeline.estimateHands(input, config);\n if (!predictions) return [];\n const hands: HandResult[] = [];\n for (let i = 0; i < predictions.length; i++) {\n const annotations = {};\n if (predictions[i].landmarks) {\n for (const key of Object.keys(meshAnnotations)) {\n annotations[key] = meshAnnotations[key].map((index) => predictions[i].landmarks[index]);\n }\n }\n const keypoints = predictions[i].landmarks as unknown as Point[];\n let box: Box = [Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, 0, 0]; // maximums so conditionals work\n let boxRaw: Box = [0, 0, 0, 0];\n if (keypoints && keypoints.length > 0) { // if we have landmarks, calculate box based on landmarks\n for (const pt of keypoints) {\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 boxRaw = [box[0] / (input.shape[2] || 0), box[1] / (input.shape[1] || 0), box[2] / (input.shape[2] || 0), box[3] / (input.shape[1] || 0)];\n } else { // otherwise use box from prediction\n box = predictions[i].box ? [\n Math.trunc(Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.max(0, predictions[i].box.topLeft[1])),\n Math.trunc(Math.min((input.shape[2] || 0), predictions[i].box.bottomRight[0]) - Math.max(0, predictions[i].box.topLeft[0])),\n Math.trunc(Math.min((input.shape[1] || 0), predictions[i].box.bottomRight[1]) - Math.max(0, predictions[i].box.topLeft[1])),\n ] : [0, 0, 0, 0];\n boxRaw = [\n (predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n (predictions[i].box.bottomRight[0] - predictions[i].box.topLeft[0]) / (input.shape[2] || 0),\n (predictions[i].box.bottomRight[1] - predictions[i].box.topLeft[1]) / (input.shape[1] || 0),\n ];\n }\n const landmarks = fingerPose.analyze(keypoints);\n hands.push({\n id: i,\n score: Math.round(100 * predictions[i].confidence) / 100,\n boxScore: Math.round(100 * predictions[i].boxConfidence) / 100,\n fingerScore: Math.round(100 * predictions[i].fingerConfidence) / 100,\n label: 'hand',\n box,\n boxRaw,\n keypoints,\n annotations: annotations as HandResult['annotations'],\n landmarks: landmarks as HandResult['landmarks'],\n });\n }\n return hands;\n}\n\nexport async function loadDetect(config: Config): Promise {\n if (env.initial) handDetectorModel = null;\n if (!handDetectorModel) handDetectorModel = await loadModel(config.hand.detector?.modelPath);\n else if (config.debug) log('cached model:', handDetectorModel['modelUrl']);\n return handDetectorModel;\n}\n\nexport async function loadSkeleton(config: Config): Promise {\n if (env.initial) handPoseModel = null;\n if (!handPoseModel) handPoseModel = await loadModel(config.hand.skeleton?.modelPath);\n else if (config.debug) log('cached model:', handPoseModel['modelUrl']);\n return handPoseModel;\n}\n", "/**\n * HandTrack model implementation\n *\n * Based on:\n * - Hand Detection & Skeleton: [**MediaPipe HandPose**](https://drive.google.com/file/d/1sv4sSb9BSNVZhLzxXJ0jBv9DqD-4jnAz/view)\n * - Hand Tracking: [**HandTracking**](https://github.com/victordibia/handtracking)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport * as box from '../util/box';\nimport { loadModel } from '../tfjs/load';\nimport type { HandResult, HandType, Box, Point } from '../result';\nimport type { GraphModel, Tensor, Tensor1D, Tensor2D, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as fingerPose from './fingerpose';\nimport { fakeOps } from '../tfjs/backend';\nimport { constants } from '../tfjs/constants';\n\nconst models: [GraphModel | null, GraphModel | null] = [null, null];\nconst modelOutputNodes = ['StatefulPartitionedCall/Postprocessor/Slice', 'StatefulPartitionedCall/Postprocessor/ExpandDims_1'];\n\nconst inputSize = [[0, 0], [0, 0]];\n\nconst classes = ['hand', 'fist', 'pinch', 'point', 'face', 'tip', 'pinchtip'];\nconst faceIndex = 4;\n\nconst boxExpandFact = 1.6;\nconst maxDetectorResolution = 512;\nconst detectorExpandFact = 1.4;\n\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet lastTime = 0;\nlet outputSize: [number, number] = [0, 0];\n\ninterface HandDetectResult {\n id: number,\n score: number,\n box: Box,\n boxRaw: Box,\n label: HandType,\n}\n\nconst cache: {\n boxes: HandDetectResult[],\n hands: HandResult[];\n} = {\n boxes: [],\n hands: [],\n};\n\nconst fingerMap = {\n /*\n thumb: [0, 1, 2, 3, 4],\n index: [0, 5, 6, 7, 8],\n middle: [0, 9, 10, 11, 12],\n ring: [0, 13, 14, 15, 16],\n pinky: [0, 17, 18, 19, 20],\n palm: [0],\n */\n thumb: [1, 2, 3, 4],\n index: [5, 6, 7, 8],\n middle: [9, 10, 11, 12],\n ring: [13, 14, 15, 16],\n pinky: [17, 18, 19, 20],\n base: [0],\n palm: [0, 17, 13, 9, 5, 1, 0],\n};\n\nexport async function loadDetect(config: Config): Promise {\n // HandTrack Model: Original: TFJS Port: \n if (env.initial) models[0] = null;\n if (!models[0]) {\n // handtrack model has some kernel ops defined in model but those are never referenced and non-existent in tfjs\n // ideally need to prune the model itself\n fakeOps(['tensorlistreserve', 'enter', 'tensorlistfromtensor', 'merge', 'loopcond', 'switch', 'exit', 'tensorliststack', 'nextiteration', 'tensorlistsetitem', 'tensorlistgetitem', 'reciprocal', 'shape', 'split', 'where'], config);\n models[0] = await loadModel(config.hand.detector?.modelPath);\n const inputs = models[0]['executor'] ? Object.values(models[0].modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[0][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[0][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n } else if (config.debug) log('cached model:', models[0]['modelUrl']);\n return models[0];\n}\n\nexport async function loadSkeleton(config: Config): Promise {\n if (env.initial) models[1] = null;\n if (!models[1]) {\n models[1] = await loadModel(config.hand.skeleton?.modelPath);\n const inputs = models[1]['executor'] ? Object.values(models[1].modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[1][0] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[1].size) : 0;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize[1][1] = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 0;\n } else if (config.debug) log('cached model:', models[1]['modelUrl']);\n return models[1];\n}\n\nexport async function load(config: Config): Promise<[GraphModel | null, GraphModel | null]> {\n if (!models[0]) await loadDetect(config);\n if (!models[1]) await loadSkeleton(config);\n return models;\n}\n\nasync function detectHands(input: Tensor4D, config: Config): Promise {\n const hands: HandDetectResult[] = [];\n if (!input || !models[0]) return hands;\n const t: Record = {};\n const ratio = (input.shape[2] || 1) / (input.shape[1] || 1);\n const height = Math.min(Math.round((input.shape[1] || 0) / 8) * 8, maxDetectorResolution); // use dynamic input size but cap at 512\n const width = Math.round(height * ratio / 8) * 8;\n t.resize = tf.image.resizeBilinear(input, [height, width]); // todo: resize with padding\n t.cast = tf.cast(t.resize, 'int32');\n [t.rawScores, t.rawBoxes] = await models[0].executeAsync(t.cast, modelOutputNodes) as Tensor[];\n t.boxes = tf.squeeze(t.rawBoxes, [0, 2]);\n t.scores = tf.squeeze(t.rawScores, [0]);\n const classScores: Tensor[] = tf.unstack(t.scores, 1); // unstack scores based on classes\n tf.dispose(classScores[faceIndex]);\n classScores.splice(faceIndex, 1); // remove faces\n t.filtered = tf.stack(classScores, 1); // restack\n tf.dispose(classScores);\n // t.filtered = t.scores;\n t.max = tf.max(t.filtered, 1); // max overall score\n t.argmax = tf.argMax(t.filtered, 1); // class index of max overall score\n let id = 0;\n t.nms = await tf.image.nonMaxSuppressionAsync(t.boxes as Tensor2D, t.max as Tensor1D, (config.hand.maxDetected || 0) + 1, config.hand.iouThreshold || 0, config.hand.minConfidence || 1);\n const nms = await t.nms.data();\n const scores = await t.max.data();\n const classNum = await t.argmax.data();\n for (const nmsIndex of Array.from(nms)) { // generates results for each class\n const boxSlice = tf.slice(t.boxes, nmsIndex, 1);\n const boxYX = await boxSlice.data();\n tf.dispose(boxSlice);\n const boxData: Box = [boxYX[1], boxYX[0], boxYX[3] - boxYX[1], boxYX[2] - boxYX[0]]; // yx box reshaped to standard box\n const boxRaw: Box = box.scale(boxData, detectorExpandFact);\n const boxFull: Box = [Math.trunc(boxData[0] * outputSize[0]), Math.trunc(boxData[1] * outputSize[1]), Math.trunc(boxData[2] * outputSize[0]), Math.trunc(boxData[3] * outputSize[1])];\n const score = scores[nmsIndex];\n const label = classes[classNum[nmsIndex]] as HandType;\n const hand: HandDetectResult = { id: id++, score, box: boxFull, boxRaw, label };\n hands.push(hand);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n hands.sort((a, b) => b.score - a.score);\n if (hands.length > (config.hand.maxDetected || 1)) hands.length = (config.hand.maxDetected || 1);\n return hands;\n}\n\nasync function detectFingers(input: Tensor4D, h: HandDetectResult, config: Config): Promise {\n const hand: HandResult = { // initial values inherited from hand detect\n id: h.id,\n score: Math.round(100 * h.score) / 100,\n boxScore: Math.round(100 * h.score) / 100,\n fingerScore: 0,\n box: h.box,\n boxRaw: h.boxRaw,\n label: h.label,\n keypoints: [],\n landmarks: {} as HandResult['landmarks'],\n annotations: {} as HandResult['annotations'],\n };\n if (input && models[1] && config.hand.landmarks && h.score > (config.hand.minConfidence || 0)) {\n const t: Record = {};\n const boxCrop = [h.boxRaw[1], h.boxRaw[0], h.boxRaw[3] + h.boxRaw[1], h.boxRaw[2] + h.boxRaw[0]] as Box;\n t.crop = tf.image.cropAndResize(input, [boxCrop], [0], [inputSize[1][0], inputSize[1][1]], 'bilinear');\n t.div = tf.div(t.crop, constants.tf255);\n [t.score, t.keypoints] = models[1].execute(t.div, ['Identity_1', 'Identity']) as Tensor[];\n const rawScore = (await t.score.data())[0];\n const score = (100 - Math.trunc(100 / (1 + Math.exp(rawScore)))) / 100; // reverse sigmoid value\n if (score >= (config.hand.minConfidence || 0)) {\n hand.fingerScore = score;\n t.reshaped = tf.reshape(t.keypoints, [-1, 3]);\n const coordsData: Point[] = await t.reshaped.array() as Point[];\n const coordsRaw: Point[] = coordsData.map((kpt) => [kpt[0] / inputSize[1][1], kpt[1] / inputSize[1][0], (kpt[2] || 0)]);\n const coordsNorm: Point[] = coordsRaw.map((kpt) => [kpt[0] * h.boxRaw[2], kpt[1] * h.boxRaw[3], (kpt[2] || 0)]);\n hand.keypoints = (coordsNorm).map((kpt) => [outputSize[0] * (kpt[0] + h.boxRaw[0]), outputSize[1] * (kpt[1] + h.boxRaw[1]), (kpt[2] || 0)]);\n hand.landmarks = fingerPose.analyze(hand.keypoints) as HandResult['landmarks']; // calculate finger gestures\n for (const key of Object.keys(fingerMap)) { // map keypoints to per-finger annotations\n hand.annotations[key] = fingerMap[key].map((index: number) => (hand.landmarks && hand.keypoints[index] ? hand.keypoints[index] : null));\n }\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n }\n return hand;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!models[0]?.['executor'] || !models[1]?.['executor'] || !models[0].inputs[0].shape || !models[1].inputs[0].shape) return []; // something is wrong with the model\n outputSize = [input.shape[2] || 0, input.shape[1] || 0];\n skipped++; // increment skip frames\n const skipTime = (config.hand.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.hand.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame) {\n return cache.hands; // return cached results without running anything\n }\n return new Promise(async (resolve) => {\n const skipTimeExtended = 3 * (config.hand.skipTime || 0) > (now() - lastTime);\n const skipFrameExtended = skipped < 3 * (config.hand.skipFrames || 0);\n if (config.skipAllowed && cache.hands.length === config.hand.maxDetected) { // we have all detected hands so we're definitely skipping\n cache.hands = await Promise.all(cache.boxes.map((handBox) => detectFingers(input, handBox, config)));\n } else if (config.skipAllowed && skipTimeExtended && skipFrameExtended && cache.hands.length > 0) { // we have some cached results: maybe not enough but anyhow continue for bit longer\n cache.hands = await Promise.all(cache.boxes.map((handBox) => detectFingers(input, handBox, config)));\n } else { // finally rerun detector\n cache.boxes = await detectHands(input, config);\n lastTime = now();\n cache.hands = await Promise.all(cache.boxes.map((handBox) => detectFingers(input, handBox, config)));\n skipped = 0;\n }\n\n const oldCache = [...cache.boxes];\n cache.boxes.length = 0; // reset cache\n if (config.cacheSensitivity > 0) {\n for (let i = 0; i < cache.hands.length; i++) {\n const boxKpt = box.square(cache.hands[i].keypoints, outputSize);\n if (boxKpt.box[2] / (input.shape[2] || 1) > 0.05 && boxKpt.box[3] / (input.shape[1] || 1) > 0.05 && cache.hands[i].fingerScore && cache.hands[i].fingerScore > (config.hand.minConfidence || 0)) {\n const boxScale = box.scale(boxKpt.box, boxExpandFact);\n const boxScaleRaw = box.scale(boxKpt.boxRaw, boxExpandFact);\n // const boxCrop = box.crop(boxScaleRaw);\n cache.boxes.push({ ...oldCache[i], box: boxScale, boxRaw: boxScaleRaw });\n }\n }\n }\n for (let i = 0; i < cache.hands.length; i++) { // replace detected boxes with calculated boxes in final output\n const bbox = box.calc(cache.hands[i].keypoints, outputSize);\n cache.hands[i].box = bbox.box;\n cache.hands[i].boxRaw = bbox.boxRaw;\n }\n resolve(cache.hands);\n });\n}\n", "/**\n * Type definitions for Human result object\n */\n\nimport type { Tensor } from './tfjs/types';\nimport type { FaceGesture, BodyGesture, HandGesture, IrisGesture } from './gesture/gesture';\nimport type { AnyCanvas } from './exports';\n\n/** generic box as [x, y, width, height] */\nexport type Box = [number, number, number, number];\n/** generic point as [x, y, z?] */\nexport type Point = [number, number, number?];\n\nexport type Emotion = 'angry' | 'disgust' | 'fear' | 'happy' | 'sad' | 'surprise' | 'neutral';\nexport type Gender = 'male' | 'female' | 'unknown';\nexport type Race = 'white' | 'black' | 'asian' | 'indian' | 'other';\nexport type FaceLandmark = 'leftEye' | 'rightEye' | 'nose' | 'mouth' | 'leftEar' | 'rightEar' | 'symmetryLine' | 'silhouette'\n | 'lipsUpperOuter' | 'lipsLowerOuter' | 'lipsUpperInner' | 'lipsLowerInner'\n | 'rightEyeUpper0' | 'rightEyeLower0' | 'rightEyeUpper1' | 'rightEyeLower1' | 'rightEyeUpper2' | 'rightEyeLower2' | 'rightEyeLower3' | 'rightEyebrowUpper' | 'rightEyebrowLower' | 'rightEyeIris'\n | 'leftEyeUpper0' | 'leftEyeLower0' | 'leftEyeUpper1' | 'leftEyeLower1' | 'leftEyeUpper2' | 'leftEyeLower2' | 'leftEyeLower3' | 'leftEyebrowUpper' | 'leftEyebrowLower' | 'leftEyeIris'\n | 'midwayBetweenEyes' | 'noseTip' | 'noseBottom' | 'noseRightCorner' | 'noseLeftCorner' | 'rightCheek' | 'leftCheek';\n\n/** Face results\n * - Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models\n * - Some values may be null if specific model is not enabled\n */\nexport interface FaceResult {\n /** face id */\n id: number\n /** overall face score */\n score: number,\n /** detection score */\n boxScore: number,\n /** mesh score */\n faceScore: number,\n /** detected face box */\n box: Box,\n /** detected face box normalized to 0..1 */\n boxRaw: Box,\n /** detected face box size */\n size: [number, number],\n /** detected face mesh */\n mesh: Point[]\n /** detected face mesh normalized to 0..1 */\n meshRaw: Point[],\n /** face contours as array of 2d points normalized to 0..1 */\n // contoursRaw: Array<[number, number]>,\n /** face contours as array of 2d points */\n // contours: Array<[number, number]>,\n /** mesh keypoints combined into annotated results */\n annotations: Record,\n /** detected age */\n age?: number,\n /** detected gender */\n gender?: Gender,\n /** gender detection score */\n genderScore?: number,\n /** detected emotions */\n emotion?: { score: number, emotion: Emotion }[],\n /** detected race */\n race?: { score: number, race: Race }[],\n /** face descriptor */\n embedding?: number[],\n /** face distance from camera */\n distance?: number,\n /** face anti-spoofing result confidence */\n real?: number,\n /** face liveness result confidence */\n live?: number,\n /** face rotation details */\n rotation?: {\n angle: { roll: number, yaw: number, pitch: number },\n matrix: [number, number, number, number, number, number, number, number, number],\n gaze: { bearing: number, strength: number },\n } | null,\n /** detected face as tensor that can be used in further pipelines */\n tensor?: Tensor,\n}\n\nexport type BodyLandmarkPoseNet = 'nose' | 'leftEye' | 'rightEye' | 'leftEar' | 'rightEar' | 'leftShoulder' | 'rightShoulder' | 'leftElbow' | 'rightElbow' | 'leftWrist' | 'rightWrist' | 'leftHip' | 'rightHip' | 'leftKnee' | 'rightKnee' | 'leftAnkle' | 'rightAnkle';\nexport type BodyLandmarkMoveNet = 'nose' | 'leftEye' | 'rightEye' | 'leftEar' | 'rightEar' | 'leftShoulder' | 'rightShoulder' | 'leftElbow' | 'rightElbow' | 'leftWrist' | 'rightWrist' | 'leftHip' | 'rightHip' | 'leftKnee' | 'rightKnee' | 'leftAnkle' | 'rightAnkle';\nexport type BodyLandmarkEfficientNet = 'head' | 'neck' | 'rightShoulder' | 'rightElbow' | 'rightWrist' | 'chest' | 'leftShoulder' | 'leftElbow' | 'leftWrist' | 'bodyCenter' | 'rightHip' | 'rightKnee' | 'rightAnkle' | 'leftHip' | 'leftKnee' | 'leftAnkle';\nexport type BodyLandmarkBlazePose = 'nose' | 'leftEyeInside' | 'leftEye' | 'leftEyeOutside' | 'rightEyeInside' | 'rightEye' | 'rightEyeOutside' | 'leftEar' | 'rightEar' | 'leftMouth' | 'rightMouth' | 'leftShoulder' | 'rightShoulder'\n | 'leftElbow' | 'rightElbow' | 'leftWrist' | 'rightWrist' | 'leftPinky' | 'rightPinky' | 'leftIndex' | 'rightIndex' | 'leftThumb' | 'rightThumb' | 'leftHip' | 'rightHip' | 'leftKnee' | 'rightKnee' | 'leftAnkle' | 'rightAnkle'\n | 'leftHeel' | 'rightHeel' | 'leftFoot' | 'rightFoot' | 'bodyCenter' | 'bodyTop' | 'leftPalm' | 'leftHand' | 'rightPalm' | 'rightHand';\nexport type BodyLandmark = BodyLandmarkPoseNet | BodyLandmarkMoveNet | BodyLandmarkEfficientNet | BodyLandmarkBlazePose;\nexport type BodyAnnotationBlazePose = 'leftLeg' | 'rightLeg' | 'torso' | 'leftArm' | 'rightArm' | 'leftEye' | 'rightEye' | 'mouth';\nexport type BodyAnnotationEfficientPose = 'leftLeg' | 'rightLeg' | 'torso' | 'leftArm' | 'rightArm' | 'head';\nexport type BodyAnnotation = BodyAnnotationBlazePose | BodyAnnotationEfficientPose;\n\n/** Body Result keypoints */\nexport interface BodyKeypoint {\n /** body part name */\n part: BodyLandmark,\n /** body part position */\n position: Point,\n /** body part position normalized to 0..1 */\n positionRaw: Point,\n /** body part position relative to body center in meters */\n distance?: Point,\n /** body part detection score */\n score: number,\n}\n\n/** Body results */\nexport interface BodyResult {\n /** body id */\n id: number,\n /** body detection score */\n score: number,\n /** detected body box */\n box: Box,\n /** detected body box normalized to 0..1 */\n boxRaw: Box,\n /** detected body keypoints */\n keypoints: BodyKeypoint[]\n /** detected body keypoints combined into annotated parts */\n annotations: Record,\n}\n\nexport type HandType = 'hand' | 'fist' | 'pinch' | 'point' | 'face' | 'tip' | 'pinchtip';\nexport type Finger = 'index' | 'middle' | 'pinky' | 'ring' | 'thumb' | 'palm';\nexport type FingerCurl = 'none' | 'half' | 'full';\nexport type FingerDirection = 'verticalUp' | 'verticalDown' | 'horizontalLeft' | 'horizontalRight' | 'diagonalUpRight' | 'diagonalUpLeft' | 'diagonalDownRight' | 'diagonalDownLeft';\n\n/** Hand results */\nexport interface HandResult {\n /** hand id */\n id: number,\n /** hand overal score */\n score: number,\n /** hand detection score */\n boxScore: number,\n /** hand skelton score */\n fingerScore: number,\n /** detected hand box */\n box: Box,\n /** detected hand box normalized to 0..1 */\n boxRaw: Box,\n /** detected hand keypoints */\n keypoints: Point[],\n /** detected hand class */\n label: HandType,\n /** detected hand keypoints combined into annotated parts */\n annotations: Record,\n /** detected hand parts annotated with part gestures */\n landmarks: Record,\n}\n\nexport type ObjectType = 'person' | 'bicycle' | 'car' | 'motorcycle' | 'airplane' | 'bus' | 'train' | 'truck' | 'boat' | 'traffic light' | 'fire hydrant' | 'stop sign' | 'parking meter'\n | 'bench' | 'bird' | 'cat' | 'dog' | 'horse' | 'sheep' | 'cow' | 'elephant' | 'bear' | 'zebra' | 'giraffe' | 'backpack' | 'umbrella' | 'handbag' | 'tie' | 'suitcase' | 'frisbee'\n | 'skis' | 'snowboard' | 'sports ball' | 'kite' | 'baseball bat' | 'baseball glove' | 'skateboard' | 'surfboard' | 'tennis racket' | 'bottle' | 'wine glass' | 'cup' | 'fork'\n | 'knife' | 'spoon' | 'bowl' | 'banana' | 'apple' | 'sandwich' | 'orange' | 'broccoli' | 'carrot' | 'hot dog' | 'pizza' | 'donut' | 'cake' | 'chair' | 'couch' | 'potted plant'\n | 'bed' | 'dining table' | 'toilet' | 'tv' | 'laptop' | 'mouse' | 'remote' | 'keyboard' | 'cell phone' | 'microwave' | 'oven' | 'toaster' | 'sink' | 'refrigerator' | 'book'\n | 'clock' | 'vase' | 'scissors' | 'teddy bear' | 'hair drier' | 'toothbrush';\n\n/** Object results */\nexport interface ObjectResult {\n /** object id */\n id: number,\n /** object detection score */\n score: number,\n /** detected object class id */\n class: number,\n /** detected object class name */\n label: ObjectType,\n /** detected object box */\n box: Box,\n /** detected object box normalized to 0..1 */\n boxRaw: Box,\n}\n\n/** Gesture combined results\n * Each result has:\n * - part: part name and number where gesture was detected: `face`, `iris`, `body`, `hand`\n * - gesture: gesture detected\n */\nexport type GestureResult =\n { 'face': number, gesture: FaceGesture }\n | { 'iris': number, gesture: IrisGesture }\n | { 'body': number, gesture: BodyGesture }\n | { 'hand': number, gesture: HandGesture }\n\n/** Person getter\n* - Triggers combining all individual results into a virtual person object\n*/\nexport interface PersonResult {\n /** person id */\n id: number,\n /** face result that belongs to this person */\n face: FaceResult,\n /** body result that belongs to this person */\n body: BodyResult | null,\n /** left and right hand results that belong to this person */\n hands: { left: HandResult | null, right: HandResult | null },\n /** detected gestures specific to this person */\n gestures: GestureResult[],\n /** box that defines the person */\n box: Box,\n /** box that defines the person normalized to 0..1 */\n boxRaw?: Box,\n}\n\n/**\n * Result interface definition for **Human** library\n *\n * Contains all possible detection results\n */\nexport interface Result {\n /** {@link FaceResult}: detection & analysis results */\n face: FaceResult[],\n /** {@link BodyResult}: detection & analysis results */\n body: BodyResult[],\n /** {@link HandResult}: detection & analysis results */\n hand: HandResult[],\n /** {@link GestureResult}: detection & analysis results */\n gesture: GestureResult[],\n /** {@link ObjectResult}: detection & analysis results */\n object: ObjectResult[]\n /** global performance object with timing values for each operation */\n performance: Record,\n /** optional processed canvas that can be used to draw input on screen */\n canvas?: AnyCanvas | null,\n /** timestamp of detection representing the milliseconds elapsed since the UNIX epoch */\n readonly timestamp: number,\n /** getter property that returns unified persons object */\n persons: PersonResult[],\n /** Last known error message */\n error: string | null;\n /** Resolution width */\n width: number,\n /** Resolution height */\n height: number,\n}\n\nexport const empty = (error: string | null = null): Result => ({ face: [], body: [], hand: [], gesture: [], object: [], persons: [], performance: {}, timestamp: 0, width: 0, height: 0, error });\n", "export const kpt: string[] = [ // used to create part labels\n 'nose',\n 'leftEye',\n 'rightEye',\n 'leftEar',\n 'rightEar',\n 'leftShoulder',\n 'rightShoulder',\n 'leftElbow',\n 'rightElbow',\n 'leftWrist',\n 'rightWrist',\n 'leftHip',\n 'rightHip',\n 'leftKnee',\n 'rightKnee',\n 'leftAnkle',\n 'rightAnkle',\n];\n\nexport const horizontal: string[][] = [ // used to fix left vs right\n ['leftEye', 'rightEye'],\n ['leftEar', 'rightEar'],\n ['leftShoulder', 'rightShoulder'],\n ['leftElbow', 'rightElbow'],\n ['leftWrist', 'rightWrist'],\n ['leftHip', 'rightHip'],\n ['leftKnee', 'rightKnee'],\n ['leftAnkle', 'rightAnkle'],\n];\n\nexport const vertical: string[][] = [ // used to remove unlikely keypoint positions\n ['leftKnee', 'leftShoulder'],\n ['rightKnee', 'rightShoulder'],\n ['leftAnkle', 'leftKnee'],\n ['rightAnkle', 'rightKnee'],\n];\n\nexport const relative: string[][][] = [ // used to match relative body parts\n [['leftHip', 'rightHip'], ['leftShoulder', 'rightShoulder']],\n [['leftElbow', 'rightElbow'], ['leftShoulder', 'rightShoulder']],\n];\n\nexport const connected: Record = { // used to create body outline in annotations\n leftLeg: ['leftHip', 'leftKnee', 'leftAnkle'],\n rightLeg: ['rightHip', 'rightKnee', 'rightAnkle'],\n torso: ['leftShoulder', 'rightShoulder', 'rightHip', 'leftHip', 'leftShoulder'],\n leftArm: ['leftShoulder', 'leftElbow', 'leftWrist'],\n rightArm: ['rightShoulder', 'rightElbow', 'rightWrist'],\n head: [],\n};\n", "/**\n * Results interpolation for smoothening of video detection results inbetween detected frames\n */\n\nimport { Result, FaceResult, BodyResult, HandResult, ObjectResult, PersonResult, Box, Point, BodyLandmark, BodyAnnotation, empty, FaceLandmark } from '../result';\nimport type { Config } from '../config';\n\nimport * as moveNetCoords from '../body/movenetcoords';\nimport * as blazePoseCoords from '../body/blazeposecoords';\nimport * as efficientPoseCoords from '../body/efficientposecoords';\nimport { now } from './util';\nimport { env } from './env';\n\nconst bufferedResult: Result = empty();\nlet interpolateTime = 0;\n\nexport function calc(newResult: Result, config: Config): Result {\n const t0 = now();\n if (!newResult) return empty();\n // each record is only updated using deep clone when number of detected record changes, otherwise it will converge by itself\n // otherwise bufferedResult is a shallow clone of result plus updated local calculated values\n // thus mixing by-reference and by-value assignments to minimize memory operations\n\n const elapsed = Date.now() - newResult.timestamp;\n\n /* curve fitted: buffer = 8 - ln(delay)\n interpolation formula: current = ((buffer - 1) * previous + live) / buffer\n - at 50ms delay buffer = ~4.1 => 28% towards live data\n - at 250ms delay buffer = ~2.5 => 40% towards live data\n - at 500ms delay buffer = ~1.8 => 55% towards live data\n - at 750ms delay buffer = ~1.4 => 71% towards live data\n - at 1sec delay buffer = 1 which means live data is used\n */\n const bufferedFactor = elapsed < 1000 ? 8 - Math.log(elapsed + 1) : 1;\n\n if (newResult.canvas) bufferedResult.canvas = newResult.canvas;\n if (newResult.error) bufferedResult.error = newResult.error;\n\n // interpolate body results\n if (!bufferedResult.body || (newResult.body.length !== bufferedResult.body.length)) {\n bufferedResult.body = JSON.parse(JSON.stringify(newResult.body)) as BodyResult[]; // deep clone once\n } else {\n for (let i = 0; i < newResult.body.length; i++) {\n const box = newResult.body[i].box // update box\n .map((newBoxCoord, j) => ((bufferedFactor - 1) * bufferedResult.body[i].box[j] + newBoxCoord) / bufferedFactor) as Box;\n const boxRaw = newResult.body[i].boxRaw // update boxRaw\n .map((newBoxCoord, j) => ((bufferedFactor - 1) * bufferedResult.body[i].boxRaw[j] + newBoxCoord) / bufferedFactor) as Box;\n const keypoints = (newResult.body[i].keypoints // update keypoints\n .map((newKpt, j) => ({\n score: newKpt.score,\n part: newKpt.part,\n position: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].position[0] || 0) + (newKpt.position[0] || 0)) / bufferedFactor : newKpt.position[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].position[1] || 0) + (newKpt.position[1] || 0)) / bufferedFactor : newKpt.position[1],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].position[2] || 0) + (newKpt.position[2] || 0)) / bufferedFactor : newKpt.position[2],\n ],\n positionRaw: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].positionRaw[0] || 0) + (newKpt.positionRaw[0] || 0)) / bufferedFactor : newKpt.positionRaw[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].positionRaw[1] || 0) + (newKpt.positionRaw[1] || 0)) / bufferedFactor : newKpt.positionRaw[1],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].positionRaw[2] || 0) + (newKpt.positionRaw[2] || 0)) / bufferedFactor : newKpt.positionRaw[2],\n ],\n distance: [\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].distance?.[0] || 0) + (newKpt.distance?.[0] || 0)) / bufferedFactor : newKpt.distance?.[0],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].distance?.[1] || 0) + (newKpt.distance?.[1] || 0)) / bufferedFactor : newKpt.distance?.[1],\n bufferedResult.body[i].keypoints[j] ? ((bufferedFactor - 1) * (bufferedResult.body[i].keypoints[j].distance?.[2] || 0) + (newKpt.distance?.[2] || 0)) / bufferedFactor : newKpt.distance?.[2],\n ],\n }))) as { score: number, part: BodyLandmark, position: [number, number, number?], positionRaw: [number, number, number?] }[];\n\n const annotations: Record = {} as Record; // recreate annotations\n let coords = { connected: {} };\n if (config.body.modelPath?.includes('efficientpose')) coords = efficientPoseCoords;\n else if (config.body.modelPath?.includes('blazepose')) coords = blazePoseCoords;\n else if (config.body.modelPath?.includes('movenet')) coords = moveNetCoords;\n for (const [name, indexes] of Object.entries(coords.connected as Record)) {\n const pt: Point[][] = [];\n for (let j = 0; j < indexes.length - 1; j++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[j]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[j + 1]);\n // if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n if (pt0 && pt1) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n bufferedResult.body[i] = { ...newResult.body[i], box, boxRaw, keypoints, annotations }; // shallow clone plus updated values\n }\n }\n\n // interpolate hand results\n if (!bufferedResult.hand || (newResult.hand.length !== bufferedResult.hand.length)) {\n bufferedResult.hand = JSON.parse(JSON.stringify(newResult.hand)); // deep clone once\n } else {\n for (let i = 0; i < newResult.hand.length; i++) {\n const box = (newResult.hand[i].box// update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.hand[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.hand[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n if (bufferedResult.hand[i].keypoints.length !== newResult.hand[i].keypoints.length) bufferedResult.hand[i].keypoints = newResult.hand[i].keypoints; // reset keypoints as previous frame did not have them\n const keypoints = newResult.hand[i].keypoints && newResult.hand[i].keypoints.length > 0 ? newResult.hand[i].keypoints // update landmarks\n .map((landmark, j) => landmark\n .map((coord, k) => (((bufferedFactor - 1) * (bufferedResult.hand[i].keypoints[j][k] || 1) + (coord || 0)) / bufferedFactor)) as Point)\n : [];\n let annotations = {};\n if (Object.keys(bufferedResult.hand[i].annotations).length !== Object.keys(newResult.hand[i].annotations).length) {\n bufferedResult.hand[i].annotations = newResult.hand[i].annotations; // reset annotations as previous frame did not have them\n annotations = bufferedResult.hand[i].annotations;\n } else if (newResult.hand[i].annotations) {\n for (const key of Object.keys(newResult.hand[i].annotations)) { // update annotations\n annotations[key] = newResult.hand[i]?.annotations?.[key]?.[0]\n ? newResult.hand[i].annotations[key]\n .map((val, j: number) => val\n .map((coord: number, k: number) => ((bufferedFactor - 1) * bufferedResult.hand[i].annotations[key][j][k] + coord) / bufferedFactor))\n : null;\n }\n }\n bufferedResult.hand[i] = { ...newResult.hand[i], box, boxRaw, keypoints, annotations: annotations as HandResult['annotations'] }; // shallow clone plus updated values\n }\n }\n\n // interpolate face results\n if (!bufferedResult.face || (newResult.face.length !== bufferedResult.face.length)) {\n bufferedResult.face = JSON.parse(JSON.stringify(newResult.face)) as FaceResult[]; // deep clone once\n } else {\n for (let i = 0; i < newResult.face.length; i++) {\n const box = (newResult.face[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.face[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.face[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n let annotations: Record = newResult.face[i].annotations;\n if (Object.keys(bufferedResult.face[i].annotations).length !== Object.keys(newResult.face[i].annotations).length) {\n bufferedResult.face[i].annotations = newResult.face[i].annotations; // reset annotations as previous frame did not have them\n annotations = bufferedResult.face[i].annotations;\n } else if (newResult.face[i].annotations) {\n for (const key of Object.keys(newResult.face[i].annotations)) { // update annotations\n annotations[key] = newResult.face[i]?.annotations?.[key]?.[0]\n ? newResult.face[i].annotations[key]\n .map((val, j: number) => val\n .map((coord: number, k: number) => ((bufferedFactor - 1) * bufferedResult.face[i].annotations[key][j][k] + coord) / bufferedFactor))\n : null;\n }\n }\n if (newResult.face[i].rotation) {\n const rotation: {\n matrix: [number, number, number, number, number, number, number, number, number],\n angle: { roll: number, yaw: number, pitch: number },\n gaze: { bearing: number, strength: number }\n } = { matrix: [0, 0, 0, 0, 0, 0, 0, 0, 0], angle: { roll: 0, yaw: 0, pitch: 0 }, gaze: { bearing: 0, strength: 0 } };\n rotation.matrix = newResult.face[i].rotation?.matrix as [number, number, number, number, number, number, number, number, number];\n rotation.angle = {\n roll: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.roll || 0) + (newResult.face[i].rotation?.angle?.roll || 0)) / bufferedFactor,\n yaw: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.yaw || 0) + (newResult.face[i].rotation?.angle?.yaw || 0)) / bufferedFactor,\n pitch: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.angle?.pitch || 0) + (newResult.face[i].rotation?.angle?.pitch || 0)) / bufferedFactor,\n };\n rotation.gaze = {\n // not fully correct due projection on circle, also causes wrap-around draw on jump from negative to positive\n bearing: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze.bearing || 0) + (newResult.face[i].rotation?.gaze.bearing || 0)) / bufferedFactor,\n strength: ((bufferedFactor - 1) * (bufferedResult.face[i].rotation?.gaze.strength || 0) + (newResult.face[i].rotation?.gaze.strength || 0)) / bufferedFactor,\n };\n bufferedResult.face[i] = { ...newResult.face[i], rotation, box, boxRaw, annotations }; // shallow clone plus updated values\n } else {\n bufferedResult.face[i] = { ...newResult.face[i], box, boxRaw, annotations }; // shallow clone plus updated values\n }\n }\n }\n\n // interpolate object detection results\n if (!bufferedResult.object || (newResult.object.length !== bufferedResult.object.length)) {\n bufferedResult.object = JSON.parse(JSON.stringify(newResult.object)) as ObjectResult[]; // deep clone once\n } else {\n for (let i = 0; i < newResult.object.length; i++) {\n const box = (newResult.object[i].box // update box\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].box[j] + b) / bufferedFactor)) as Box;\n const boxRaw = (newResult.object[i].boxRaw // update boxRaw\n .map((b, j) => ((bufferedFactor - 1) * bufferedResult.object[i].boxRaw[j] + b) / bufferedFactor)) as Box;\n bufferedResult.object[i] = { ...newResult.object[i], box, boxRaw }; // shallow clone plus updated values\n }\n }\n\n // interpolate person results\n if (newResult.persons) {\n const newPersons = newResult.persons; // trigger getter function\n if (!bufferedResult.persons || (newPersons.length !== bufferedResult.persons.length)) {\n bufferedResult.persons = JSON.parse(JSON.stringify(newPersons)) as PersonResult[];\n } else {\n for (let i = 0; i < newPersons.length; i++) { // update person box, we don't update the rest as it's updated as reference anyhow\n bufferedResult.persons[i].box = (newPersons[i].box\n .map((box, j) => ((bufferedFactor - 1) * bufferedResult.persons[i].box[j] + box) / bufferedFactor)) as Box;\n }\n }\n }\n\n // copy latest gestures without interpolation\n if (newResult.gesture) bufferedResult.gesture = newResult.gesture;\n\n // copy resolution info\n bufferedResult.width = newResult.width;\n bufferedResult.height = newResult.height;\n\n // append interpolation performance data\n const t1 = now();\n interpolateTime = env.perfadd ? interpolateTime + Math.round(t1 - t0) : Math.round(t1 - t0);\n if (newResult.performance) bufferedResult.performance = { ...newResult.performance, interpolate: interpolateTime };\n\n return bufferedResult;\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**MediaPipe Meet**](https://drive.google.com/file/d/1lnP1bRi9CSqQQXUHa13159vLELYDgDu0/preview)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.segmentation.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model) model = await load(config);\n if (!model?.['executor'] || !model?.inputs?.[0].shape) return null; // something is wrong with the model\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [model.inputs[0].shape ? model.inputs[0].shape[1] : 0, model.inputs[0].shape ? model.inputs[0].shape[2] : 0], false);\n t.norm = tf.div(t.resize, constants.tf255);\n t.res = model.execute(t.norm) as Tensor;\n t.squeeze = tf.squeeze(t.res, [0]);\n // t.softmax = tf.softmax(t.squeeze); // model meet has two channels for fg and bg\n [t.bgRaw, t.fgRaw] = tf.unstack(t.squeeze, 2);\n // t.bg = tf.softmax(t.bgRaw); // we can ignore bg channel\n t.fg = tf.softmax(t.fgRaw);\n t.mul = tf.mul(t.fg, constants.tf255);\n t.expand = tf.expandDims(t.mul, 2);\n t.output = tf.image.resizeBilinear(t.expand as Tensor4D, [input.shape[1] || 0, input.shape[2] || 0]);\n let rgba: Tensor;\n switch (config.segmentation.mode || 'default') {\n case 'default':\n t.input = tf.squeeze(input);\n t.concat = tf.concat([t.input, t.output], -1);\n rgba = tf.cast(t.concat, 'int32'); // combined original with alpha\n break;\n case 'alpha':\n rgba = tf.cast(t.output, 'int32'); // just get alpha value from model\n break;\n default:\n rgba = tf.tensor(0);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return rgba;\n}\n", "/** Face descriptor type as number array */\nexport type Descriptor = number[]\nexport type MatchOptions = { order?: number, threshold?: number, multiplier?: number, min?: number, max?: number } | undefined;\n\n/** Calculates distance between two descriptors\n * @param options - calculation options\n * - order - algorithm to use\n * Euclidean distance if `order` is 2 (default), Minkowski distance algorithm of nth order if `order` is higher than 2\n * - multiplier - by how much to enhance difference analysis in range of 1..100\n * default is 20 which normalizes results to similarity above 0.5 can be considered a match\n */\nexport function distance(descriptor1: Descriptor, descriptor2: Descriptor, options: MatchOptions = { order: 2, multiplier: 25 }) {\n // general minkowski distance, euclidean distance is limited case where order is 2\n if (!descriptor1 || !descriptor1) return Number.MAX_SAFE_INTEGER;\n let sum = 0;\n for (let i = 0; i < descriptor1.length; i++) {\n const diff = (!options.order || options.order === 2) ? (descriptor1[i] - descriptor2[i]) : (Math.abs(descriptor1[i] - descriptor2[i]));\n sum += (!options.order || options.order === 2) ? (diff * diff) : (diff ** options.order);\n }\n return (options.multiplier || 20) * sum;\n}\n\n// invert distance to similarity, normalize to given range and clamp\nconst normalizeDistance = (dist, order, min, max) => {\n if (dist === 0) return 1; // short circuit for identical inputs\n const root = order === 2 ? Math.sqrt(dist) : dist ** (1 / order); // take root of distance\n const norm = (1 - (root / 100) - min) / (max - min); // normalize to range\n const clamp = Math.max(Math.min(norm, 1), 0); // clamp to 0..1\n return clamp;\n};\n\n/** Calculates normalized similarity between two face descriptors based on their `distance`\n * @param options - calculation options\n * - order - algorithm to use\n * Euclidean distance if `order` is 2 (default), Minkowski distance algorithm of nth order if `order` is higher than 2\n * - multiplier - by how much to enhance difference analysis in range of 1..100\n * default is 20 which normalizes results to similarity above 0.5 can be considered a match\n * - min - normalize similarity result to a given range\n * - max - normalzie similarity resutl to a given range\n * default is 0.2...0.8\n * Returns similarity between two face descriptors normalized to 0..1 range where 0 is no similarity and 1 is perfect similarity\n */\nexport function similarity(descriptor1: Descriptor, descriptor2: Descriptor, options: MatchOptions = { order: 2, multiplier: 25, min: 0.2, max: 0.8 }) {\n const dist = distance(descriptor1, descriptor2, options);\n return normalizeDistance(dist, options.order || 2, options.min || 0, options.max || 1);\n}\n\n/** Matches given descriptor to a closest entry in array of descriptors\n * @param descriptor - face descriptor\n * @param descriptors - array of face descriptors to commpare given descriptor to\n * @param options - see `similarity` method for options description\n * Returns\n * - `index` index array index where best match was found or -1 if no matches\n * - `distance` calculated `distance` of given descriptor to the best match\n * - `similarity` calculated normalized `similarity` of given descriptor to the best match\n*/\nexport function find(descriptor: Descriptor, descriptors: Descriptor[], options: MatchOptions = { order: 2, multiplier: 25, threshold: 0, min: 0.2, max: 0.8 }) {\n if (!Array.isArray(descriptor) || !Array.isArray(descriptors) || descriptor.length < 64 || descriptors.length === 0) { // validate input\n return { index: -1, distance: Number.POSITIVE_INFINITY, similarity: 0 };\n }\n let lowestDistance = Number.MAX_SAFE_INTEGER;\n let index = -1;\n for (let i = 0; i < descriptors.length; i++) {\n const res = descriptors[i].length === descriptor.length ? distance(descriptor, descriptors[i], options) : Number.MAX_SAFE_INTEGER;\n if (res < lowestDistance) {\n lowestDistance = res;\n index = i;\n }\n if (lowestDistance < (options.threshold || 0)) break;\n }\n const normalizedSimilarity = normalizeDistance(lowestDistance, options.order || 2, options.min || 0, options.max || 1);\n return { index, distance: lowestDistance, similarity: normalizedSimilarity };\n}\n", "/**\n * Loader and Validator for all models used by Human\n */\n\nimport { env } from './util/env';\nimport { log } from './util/util';\nimport * as antispoof from './face/antispoof';\nimport * as blazeface from './face/blazeface';\nimport * as blazepose from './body/blazepose';\nimport * as centernet from './object/centernet';\nimport * as efficientpose from './body/efficientpose';\nimport * as emotion from './gear/emotion';\nimport * as facemesh from './face/facemesh';\nimport * as faceres from './face/faceres';\nimport * as gear from './gear/gear';\nimport * as handpose from './hand/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as insightface from './face/insightface';\nimport * as iris from './face/iris';\nimport * as liveness from './face/liveness';\nimport * as meet from './segmentation/meet';\nimport * as mobilefacenet from './face/mobilefacenet';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as posenet from './body/posenet';\nimport * as rvm from './segmentation/rvm';\nimport * as selfie from './segmentation/selfie';\nimport * as ssrnetAge from './gear/ssrnet-age';\nimport * as ssrnetGender from './gear/ssrnet-gender';\nimport { modelStats, ModelInfo } from './tfjs/load';\nimport type { GraphModel } from './tfjs/types';\nimport type { Human } from './human';\n\nexport interface KernelOps { name: string, url: string, missing: string[], ops: string[] }\n\nexport function validateModel(instance: Human | null, model: GraphModel | null, name: string): KernelOps | null {\n if (!model) return null;\n if (!instance?.config?.validateModels) return null;\n const simpleOps = ['const', 'placeholder', 'noop', 'pad', 'squeeze', 'add', 'sub', 'mul', 'div'];\n const ignoreOps = ['biasadd', 'fusedbatchnormv3', 'matmul', 'switch', 'shape', 'merge', 'split', 'broadcastto'];\n const ops: string[] = [];\n const missing: string[] = [];\n interface Op { name: string, category: string, op: string }\n const url = model['modelUrl'] as string;\n const executor = model['executor'];\n if (executor?.graph?.nodes) {\n for (const kernel of Object.values(executor.graph.nodes)) {\n const op = (kernel as Op).op.toLowerCase();\n if (!ops.includes(op)) ops.push(op);\n }\n } else {\n if (!executor && instance.config.debug) {\n log('model not loaded', name);\n }\n }\n for (const op of ops) {\n if (!simpleOps.includes(op) // exclude simple ops\n && !ignoreOps.includes(op) // exclude specific ops\n && !instance.env.kernels.includes(op) // check actual kernel ops\n && !instance.env.kernels.includes(op.replace('_', '')) // check variation without _\n && !instance.env.kernels.includes(op.replace('native', '')) // check standard variation\n && !instance.env.kernels.includes(op.replace('v2', ''))) { // check non-versioned variation\n missing.push(op);\n }\n }\n if (instance.config.debug && missing.length > 0) log('model validation failed:', name, missing);\n return missing.length > 0 ? { name, missing, ops, url } : null;\n}\n\n/** structure that holds global stats for currently loaded models */\nexport interface ModelStats {\n numLoadedModels: number,\n numDefinedModels: number,\n percentageLoaded: number,\n totalSizeFromManifest: number,\n totalSizeWeights: number,\n totalSizeLoading: number,\n modelStats: ModelInfo[],\n}\n\n/** Models class used by Human\n * - models: record of all GraphModels\n * - list: returns list of configured models with their stats\n * - loaded: returns array of loaded models\n * - reset: unloads all models\n * - validate: checks loaded models for valid kernel ops vs current backend\n * - stats: live detailed model stats that can be checked during model load phase\n */\nexport class Models {\n private instance: Human;\n models: Record = {};\n\n constructor(currentInstance: Human) {\n this.models = {};\n this.instance = currentInstance;\n }\n\n stats(): ModelStats {\n let totalSizeFromManifest = 0;\n let totalSizeWeights = 0;\n let totalSizeLoading = 0;\n for (const m of Object.values(modelStats)) {\n totalSizeFromManifest += m.sizeFromManifest;\n totalSizeWeights += m.sizeLoadedWeights;\n totalSizeLoading += m.sizeDesired;\n }\n const percentageLoaded = totalSizeLoading > 0 ? totalSizeWeights / totalSizeLoading : 0;\n return {\n numLoadedModels: Object.values(modelStats).length,\n numDefinedModels: Object.keys(this.models).length,\n percentageLoaded,\n totalSizeFromManifest,\n totalSizeWeights,\n totalSizeLoading,\n modelStats: Object.values(modelStats),\n };\n }\n\n reset(): void {\n for (const model of Object.keys(this.models)) this.models[model] = null;\n }\n\n async load(instance?: Human): Promise {\n if (env.initial) this.reset();\n if (instance) this.instance = instance;\n const m: Record> = {};\n // face main models\n m.blazeface = (this.instance.config.face.enabled && !this.models.blazeface) ? blazeface.load(this.instance.config) : null;\n m.antispoof = (this.instance.config.face.enabled && this.instance.config.face.antispoof?.enabled && !this.models.antispoof) ? antispoof.load(this.instance.config) : null;\n m.liveness = (this.instance.config.face.enabled && this.instance.config.face.liveness?.enabled && !this.models.liveness) ? liveness.load(this.instance.config) : null;\n m.faceres = (this.instance.config.face.enabled && this.instance.config.face.description?.enabled && !this.models.faceres) ? faceres.load(this.instance.config) : null;\n m.emotion = (this.instance.config.face.enabled && this.instance.config.face.emotion?.enabled && !this.models.emotion) ? emotion.load(this.instance.config) : null;\n m.iris = (this.instance.config.face.enabled && this.instance.config.face.iris?.enabled && !this.instance.config.face.attention?.enabled && !this.models.iris) ? iris.load(this.instance.config) : null;\n m.facemesh = (this.instance.config.face.enabled && this.instance.config.face.mesh?.enabled && (!this.models.facemesh)) ? facemesh.load(this.instance.config) : null;\n // face alternatives\n m.gear = (this.instance.config.face.enabled && this.instance.config.face['gear']?.enabled && !this.models.gear) ? gear.load(this.instance.config) : null;\n m.ssrnetage = (this.instance.config.face.enabled && this.instance.config.face['ssrnet']?.enabled && !this.models.ssrnetage) ? ssrnetAge.load(this.instance.config) : null;\n m.ssrnetgender = (this.instance.config.face.enabled && this.instance.config.face['ssrnet']?.enabled && !this.models.ssrnetgender) ? ssrnetGender.load(this.instance.config) : null;\n m.mobilefacenet = (this.instance.config.face.enabled && this.instance.config.face['mobilefacenet']?.enabled && !this.models.mobilefacenet) ? mobilefacenet.load(this.instance.config) : null;\n m.insightface = (this.instance.config.face.enabled && this.instance.config.face['insightface']?.enabled && !this.models.insightface) ? insightface.load(this.instance.config) : null;\n // body alterinatives\n m.blazepose = (this.instance.config.body.enabled && !this.models.blazepose && this.instance.config.body.modelPath?.includes('blazepose')) ? blazepose.loadPose(this.instance.config) : null;\n m.blazeposedetect = (this.instance.config.body.enabled && !this.models.blazeposedetect && this.instance.config.body['detector'] && this.instance.config.body['detector'].modelPath) ? blazepose.loadDetect(this.instance.config) : null;\n m.efficientpose = (this.instance.config.body.enabled && !this.models.efficientpose && this.instance.config.body.modelPath?.includes('efficientpose')) ? efficientpose.load(this.instance.config) : null;\n m.movenet = (this.instance.config.body.enabled && !this.models.movenet && this.instance.config.body.modelPath?.includes('movenet')) ? movenet.load(this.instance.config) : null;\n m.posenet = (this.instance.config.body.enabled && !this.models.posenet && this.instance.config.body.modelPath?.includes('posenet')) ? posenet.load(this.instance.config) : null;\n // hand alternatives\n m.handtrack = (this.instance.config.hand.enabled && !this.models.handtrack && this.instance.config.hand.detector?.modelPath?.includes('handtrack')) ? handtrack.loadDetect(this.instance.config) : null;\n m.handskeleton = (this.instance.config.hand.enabled && this.instance.config.hand.landmarks && !this.models.handskeleton && this.instance.config.hand.detector?.modelPath?.includes('handtrack')) ? handtrack.loadSkeleton(this.instance.config) : null;\n // if (this.instance.config.hand.detector?.modelPath?.includes('handdetect')) [m.handpose, m.handskeleton] = (!this.models.handpose) ? await handpose.load(this.instance.config) : [null, null];\n if (this.instance.config.hand.enabled && !this.models.handdetect && this.instance.config.hand.detector?.modelPath?.includes('handdetect')) {\n m.handdetect = handpose.loadDetect(this.instance.config);\n m.handskeleton = handpose.loadSkeleton(this.instance.config);\n }\n // object detection alternatives\n m.centernet = (this.instance.config.object.enabled && !this.models.centernet && this.instance.config.object.modelPath?.includes('centernet')) ? centernet.load(this.instance.config) : null;\n m.nanodet = (this.instance.config.object.enabled && !this.models.nanodet && this.instance.config.object.modelPath?.includes('nanodet')) ? nanodet.load(this.instance.config) : null;\n // segmentation alternatives\n m.selfie = (this.instance.config.segmentation.enabled && !this.models.selfie && this.instance.config.segmentation.modelPath?.includes('selfie')) ? selfie.load(this.instance.config) : null;\n m.meet = (this.instance.config.segmentation.enabled && !this.models.meet && this.instance.config.segmentation.modelPath?.includes('meet')) ? meet.load(this.instance.config) : null;\n m.rvm = (this.instance.config.segmentation.enabled && !this.models.rvm && this.instance.config.segmentation.modelPath?.includes('rvm')) ? rvm.load(this.instance.config) : null;\n\n // models are loaded in parallel asynchronously so lets wait until they are actually loaded\n for (const [model, promise] of Object.entries(m)) {\n if (promise?.['then']) promise['then']((val) => this.models[model] = val);\n }\n await Promise.all(Object.values(m)); // wait so this function does not resolve prematurely\n }\n\n list() {\n const models = Object.keys(this.models).map((model) => ({ name: model, loaded: (this.models[model] !== null), size: 0, url: this.models[model] ? this.models[model]?.['modelUrl'] : null }));\n for (const m of models) {\n const stats = Object.keys(modelStats).find((s) => s.startsWith(m.name));\n if (!stats) continue;\n m.size = modelStats[stats].sizeLoadedWeights;\n m.url = modelStats[stats].url;\n }\n return models;\n }\n\n loaded() {\n const list = this.list();\n const loaded = list.filter((model) => model.loaded).map((model) => model.name);\n return loaded;\n }\n\n validate(): { name: string, missing: string[] }[] {\n const missing: KernelOps[] = [];\n for (const defined of Object.keys(this.models)) {\n const model: GraphModel | null = this.models[defined as keyof Models];\n if (!model) continue;\n const res = validateModel(this.instance, model, defined);\n if (res) missing.push(res);\n }\n return missing;\n }\n}\n", "import * as tf from 'dist/tfjs.esm.js';\nimport type { BodyKeypoint, BodyResult } from '../result';\nimport * as box from '../util/box';\nimport * as coords from './movenetcoords';\nimport type { Tensor, Tensor3D } from '../tfjs/types';\n\nconst maxJitter = 0.005; // default allowed jitter is within 0.5%\n\nconst cache: {\n keypoints: BodyKeypoint[],\n padding: [number, number][];\n} = {\n keypoints: [],\n padding: [[0, 0], [0, 0], [0, 0], [0, 0]],\n};\n\nexport function bodyParts(body: BodyResult) { // model sometimes mixes up left vs right keypoints so we fix them\n for (const pair of coords.horizontal) { // fix body parts left vs right\n const left = body.keypoints.findIndex((kp) => kp.part === pair[0]);\n const right = body.keypoints.findIndex((kp) => kp.part === pair[1]);\n if (body.keypoints[left] && body.keypoints[right]) {\n if (body.keypoints[left].position[0] < body.keypoints[right].position[0]) {\n const tmp = body.keypoints[left];\n body.keypoints[left] = body.keypoints[right];\n body.keypoints[right] = tmp;\n }\n }\n }\n for (const pair of coords.vertical) { // remove body parts with improbable vertical position\n const lower = body.keypoints.findIndex((kp) => (kp && kp.part === pair[0]));\n const higher = body.keypoints.findIndex((kp) => (kp && kp.part === pair[1]));\n if (body.keypoints[lower] && body.keypoints[higher]) {\n if (body.keypoints[lower].position[1] < body.keypoints[higher].position[1]) {\n body.keypoints.splice(lower, 1);\n }\n }\n }\n for (const [pair, compare] of coords.relative) { // rearrange body parts according to their relative position\n const left = body.keypoints.findIndex((kp) => (kp && kp.part === pair[0]));\n const right = body.keypoints.findIndex((kp) => (kp && kp.part === pair[1]));\n const leftTo = body.keypoints.findIndex((kp) => (kp && kp.part === compare[0]));\n const rightTo = body.keypoints.findIndex((kp) => (kp && kp.part === compare[1]));\n if (!body.keypoints[leftTo] || !body.keypoints[rightTo]) continue; // only if we have both compare points\n const distanceLeft = body.keypoints[left] ? [\n Math.abs(body.keypoints[leftTo].position[0] - body.keypoints[left].position[0]),\n Math.abs(body.keypoints[rightTo].position[0] - body.keypoints[left].position[0]),\n ] : [0, 0];\n const distanceRight = body.keypoints[right] ? [\n Math.abs(body.keypoints[rightTo].position[0] - body.keypoints[right].position[0]),\n Math.abs(body.keypoints[leftTo].position[0] - body.keypoints[right].position[0]),\n ] : [0, 0];\n if (distanceLeft[0] > distanceLeft[1] || distanceRight[0] > distanceRight[1]) { // should flip keypoints\n const tmp = body.keypoints[left];\n body.keypoints[left] = body.keypoints[right];\n body.keypoints[right] = tmp;\n }\n }\n}\n\nexport function jitter(keypoints: BodyKeypoint[]): BodyKeypoint[] {\n for (let i = 0; i < keypoints.length; i++) {\n if (keypoints[i] && cache.keypoints[i]) {\n const diff = [Math.abs(keypoints[i].positionRaw[0] - cache.keypoints[i].positionRaw[0]), Math.abs(keypoints[i].positionRaw[1] - cache.keypoints[i].positionRaw[1])];\n if (diff[0] < maxJitter && diff[1] < maxJitter) {\n keypoints[i] = cache.keypoints[i]; // below jitter so replace keypoint\n } else {\n cache.keypoints[i] = keypoints[i]; // above jitter so update cache\n }\n } else {\n cache.keypoints[i] = keypoints[i]; // cache for keypoint doesnt exist so create it here\n }\n }\n return keypoints;\n}\n\nexport function padInput(input: Tensor, inputSize: number): Tensor {\n const t: Record = {};\n if (!input?.shape?.[1] || !input?.shape?.[2]) return input;\n cache.padding = [\n [0, 0], // dont touch batch\n [input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0, input.shape[2] > input.shape[1] ? Math.trunc((input.shape[2] - input.shape[1]) / 2) : 0], // height before&after\n [input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0, input.shape[1] > input.shape[2] ? Math.trunc((input.shape[1] - input.shape[2]) / 2) : 0], // width before&after\n [0, 0], // dont touch rbg\n ];\n t.pad = tf.pad(input, cache.padding);\n t.resize = tf.image.resizeBilinear(t.pad as Tensor3D, [inputSize, inputSize]);\n const final = tf.cast(t.resize, 'int32');\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return final;\n}\n\nexport function rescaleBody(body: BodyResult, outputSize: [number, number]): BodyResult {\n body.keypoints = body.keypoints.filter((kpt) => kpt?.position); // filter invalid keypoints\n for (const kpt of body.keypoints) {\n kpt.position = [\n kpt.position[0] * (outputSize[0] + cache.padding[2][0] + cache.padding[2][1]) / outputSize[0] - cache.padding[2][0],\n kpt.position[1] * (outputSize[1] + cache.padding[1][0] + cache.padding[1][1]) / outputSize[1] - cache.padding[1][0],\n ];\n kpt.positionRaw = [\n kpt.position[0] / outputSize[0], kpt.position[1] / outputSize[1],\n ];\n }\n const rescaledBoxes = box.calc(body.keypoints.map((pt) => pt.position), outputSize);\n body.box = rescaledBoxes.box;\n body.boxRaw = rescaledBoxes.boxRaw;\n return body;\n}\n", "/**\n * MoveNet model implementation\n *\n * Based on: [**MoveNet**](https://blog.tensorflow.org/2021/05/next-generation-pose-detection-with-movenet-and-tensorflowjs.html)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport * as box from '../util/box';\nimport * as coords from './movenetcoords';\nimport * as fix from './movenetfix';\nimport { loadModel } from '../tfjs/load';\nimport type { BodyKeypoint, BodyResult, BodyLandmark, BodyAnnotation, Box, Point } from '../result';\nimport type { GraphModel, Tensor } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { fakeOps } from '../tfjs/backend';\nimport { env } from '../util/env';\n\nlet model: GraphModel | null;\nlet inputSize = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\n// const boxExpandFact = 1.5; // increase to 150%\n\nconst cache: {\n boxes: Box[], // unused\n bodies: BodyResult[];\n last: number,\n} = {\n boxes: [],\n bodies: [],\n last: 0,\n};\n\nexport async function load(config: Config): Promise {\n if (env.initial) model = null;\n if (!model) {\n fakeOps(['size'], config);\n model = await loadModel(config.body.modelPath);\n } else if (config.debug) log('cached model:', model['modelUrl']);\n inputSize = (model?.['executor'] && model?.inputs?.[0].shape) ? model.inputs[0].shape[2] : 0;\n if (inputSize < 64) inputSize = 256;\n // @ts-ignore private property\n if (tf.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS) tf.env().set('WEBGL_USE_SHAPES_UNIFORMS', false); // default=false \n return model;\n}\n\nfunction parseSinglePose(res, config, image) {\n const kpt = res[0][0];\n const keypoints: BodyKeypoint[] = [];\n let score = 0;\n for (let id = 0; id < kpt.length; id++) {\n score = kpt[id][2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [kpt[id][1], kpt[id][0]];\n keypoints.push({\n score: Math.round(100 * score) / 100,\n part: coords.kpt[id] as BodyLandmark,\n positionRaw,\n position: [ // normalized to input image size\n Math.round((image.shape[2] || 0) * positionRaw[0]),\n Math.round((image.shape[1] || 0) * positionRaw[1]),\n ],\n });\n }\n }\n score = keypoints.reduce((prev, curr) => (curr.score > prev ? curr.score : prev), 0);\n const bodies: BodyResult[] = [];\n const newBox = box.calc(keypoints.map((pt) => pt.position), [image.shape[2], image.shape[1]]);\n const annotations: Record = {};\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[i]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n const body: BodyResult = { id: 0, score, box: newBox.box, boxRaw: newBox.boxRaw, keypoints, annotations };\n fix.bodyParts(body);\n bodies.push(body);\n return bodies;\n}\n\nfunction parseMultiPose(res, config, image) {\n const bodies: BodyResult[] = [];\n for (let id = 0; id < res[0].length; id++) {\n const kpt = res[0][id];\n const boxScore = Math.round(100 * kpt[51 + 4]) / 100;\n if (boxScore > config.body.minConfidence) {\n const keypoints: BodyKeypoint[] = [];\n for (let i = 0; i < 17; i++) {\n const score = kpt[3 * i + 2];\n if (score > config.body.minConfidence) {\n const positionRaw: Point = [kpt[3 * i + 1], kpt[3 * i + 0]];\n keypoints.push({\n part: coords.kpt[i] as BodyLandmark,\n score: Math.round(100 * score) / 100,\n positionRaw,\n position: [Math.round((image.shape[2] || 0) * positionRaw[0]), Math.round((image.shape[1] || 0) * positionRaw[1])],\n });\n }\n }\n // const newBox = box.calc(keypoints.map((pt) => pt.position), [image.shape[2], image.shape[1]]);\n // movenet-multipose has built-in box details\n const boxRaw: Box = [kpt[51 + 1], kpt[51 + 0], kpt[51 + 3] - kpt[51 + 1], kpt[51 + 2] - kpt[51 + 0]];\n const boxNorm: Box = [Math.trunc(boxRaw[0] * (image.shape[2] || 0)), Math.trunc(boxRaw[1] * (image.shape[1] || 0)), Math.trunc(boxRaw[2] * (image.shape[2] || 0)), Math.trunc(boxRaw[3] * (image.shape[1] || 0))];\n const annotations: Record = {} as Record;\n for (const [name, indexes] of Object.entries(coords.connected)) {\n const pt: Point[][] = [];\n for (let i = 0; i < indexes.length - 1; i++) {\n const pt0 = keypoints.find((kp) => kp.part === indexes[i]);\n const pt1 = keypoints.find((kp) => kp.part === indexes[i + 1]);\n if (pt0 && pt1 && pt0.score > (config.body.minConfidence || 0) && pt1.score > (config.body.minConfidence || 0)) pt.push([pt0.position, pt1.position]);\n }\n annotations[name] = pt;\n }\n // const body: BodyResult = { id, score: totalScore, box: newBox.box, boxRaw: newBox.boxRaw, keypoints: [...keypoints], annotations };\n const body: BodyResult = { id, score: boxScore, box: boxNorm, boxRaw, keypoints: [...keypoints], annotations };\n fix.bodyParts(body);\n bodies.push(body);\n }\n }\n bodies.sort((a, b) => b.score - a.score);\n if (bodies.length > config.body.maxDetected) bodies.length = config.body.maxDetected;\n return bodies;\n}\n\nexport async function predict(input: Tensor, config: Config): Promise {\n if (!model?.['executor'] || !model?.inputs?.[0].shape) return []; // something is wrong with the model\n if (!config.skipAllowed) cache.boxes.length = 0; // allowed to use cache or not\n skipped++; // increment skip frames\n const skipTime = (config.body.skipTime || 0) > (now() - cache.last);\n const skipFrame = skipped < (config.body.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame) {\n return cache.bodies; // return cached results without running anything\n }\n return new Promise(async (resolve) => {\n const t: Record = {};\n skipped = 0;\n // run detection on squared input and no cached boxes\n t.input = fix.padInput(input, inputSize);\n t.res = model?.execute(t.input) as Tensor;\n cache.last = now();\n const res = await t.res.array();\n cache.bodies = (t.res.shape[2] === 17)\n ? parseSinglePose(res, config, input)\n : parseMultiPose(res, config, input);\n for (const body of cache.bodies) {\n fix.rescaleBody(body, [input.shape[2] || 1, input.shape[1] || 1]);\n fix.jitter(body.keypoints);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n\n resolve(cache.bodies);\n });\n}\n", "/**\n * NanoDet object detection model implementation\n *\n * Based on: [**NanoDet**](https://github.com/RangiLyu/nanodet)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport { labels } from './labels';\nimport type { ObjectResult, ObjectType, Box } from '../result';\nimport type { GraphModel, Tensor, Tensor2D, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\nlet last: ObjectResult[] = [];\nlet lastTime = 0;\nlet skipped = Number.MAX_SAFE_INTEGER;\nlet inputSize = 0;\n\nconst scaleBox = 2.5; // increase box size\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) {\n model = await loadModel(config.object.modelPath);\n const inputs = model?.['executor'] ? Object.values(model.modelSignature['inputs']) : undefined;\n // @ts-ignore model signature properties are not typed and inputs are unreliable for this model\n inputSize = Array.isArray(inputs) ? parseInt(inputs[0].tensorShape.dim[2].size) : 416;\n } else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nasync function process(res: Tensor[], outputShape: [number, number], config: Config) {\n let id = 0;\n let results: ObjectResult[] = [];\n const size = inputSize;\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 const baseSize = strideSize * 13; // 13x13=169, 26x26=676, 52x52=2704\n // find boxes and scores output depending on stride\n const scoresT = tf.squeeze(res.find((a) => (a.shape[1] === (baseSize ** 2) && (a.shape[2] || 0) === labels.length)) as Tensor2D);\n const scores = await scoresT.array(); // optionally use exponential scores or just as-is\n const featuresT = tf.squeeze(res.find((a) => (a.shape[1] === (baseSize ** 2) && (a.shape[2] || 0) < labels.length)) as Tensor2D);\n const boxesMaxT = tf.reshape(featuresT, [-1, 4, (featuresT.shape?.[1] || 0) / 4]); // reshape [output] to [4, output / 4] where number is number of different features inside each stride\n const boxIdxT = tf.argMax(boxesMaxT, 2); // what we need is indexes of features with highest scores, not values itself\n const boxIdx = await boxIdxT.array(); // what we need is indexes of features with highest scores, not values itself\n for (let i = 0; i < scoresT.shape[0]; i++) { // total strides (x * y matrix)\n for (let j = 0; j < (scoresT.shape?.[1] || 0); j++) { // one score for each class\n const score = scores[i][j]; // get score for current position\n if (score > (config.object.minConfidence || 0) && 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: number) => a * (baseSize / strideSize / (size))); // 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: Box = [x, y, w, h]; // results normalized to range 0..1\n boxRaw = boxRaw.map((a) => Math.max(0, Math.min(a, 1))) as Box; // 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 as ObjectType,\n // center: [Math.trunc(outputShape[0] * cx), Math.trunc(outputShape[1] * cy)],\n // centerRaw: [cx, cy],\n box: box.map((a) => Math.trunc(a)) as Box,\n boxRaw,\n };\n results.push(result);\n }\n }\n }\n tf.dispose([scoresT, featuresT, boxesMaxT, boxIdxT]);\n }\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[1], a.boxRaw[0], a.boxRaw[3], a.boxRaw[2]]); // switches coordinates from x,y to y,x as expected by tf.nms\n const nmsScores = results.map((a) => a.score);\n let nmsIdx: number[] = [];\n if (nmsBoxes && nmsBoxes.length > 0) {\n const nms = await tf.image.nonMaxSuppressionAsync(nmsBoxes, nmsScores, config.object.maxDetected || 0, config.object.iouThreshold, config.object.minConfidence);\n nmsIdx = Array.from(await nms.data());\n tf.dispose(nms);\n }\n\n // filter & sort results\n results = results\n .filter((_val, idx) => nmsIdx.includes(idx))\n .sort((a, b) => (b.score - a.score));\n\n return results;\n}\n\nexport async function predict(image: Tensor4D, config: Config): Promise {\n if (!model?.['executor']) return [];\n const skipTime = (config.object.skipTime || 0) > (now() - lastTime);\n const skipFrame = skipped < (config.object.skipFrames || 0);\n if (config.skipAllowed && skipTime && skipFrame && (last.length > 0)) {\n skipped++;\n return last;\n }\n skipped = 0;\n if (!env.kernels.includes('mod') || !env.kernels.includes('sparsetodense')) return last;\n return new Promise(async (resolve) => {\n const outputSize = [image.shape[2] || 0, image.shape[1] || 0];\n const resizeT = tf.image.resizeBilinear(image, [inputSize, inputSize], false);\n const normT = tf.div(resizeT, constants.tf255);\n const transposeT = tf.transpose(normT, [0, 3, 1, 2]);\n\n let objectT;\n if (config.object.enabled) objectT = model.execute(transposeT);\n lastTime = now();\n\n const obj = await process(objectT as Tensor[], outputSize as [number, number], config);\n last = obj;\n tf.dispose([resizeT, normT, transposeT, ...objectT]);\n resolve(obj);\n });\n}\n", "/**\n * PoseNet body detection model implementation constants\n * See `posenet.ts` for entry point\n */\n\nimport type { Point, BodyResult, BodyAnnotation, BodyLandmark } from '../result';\n\nexport 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\nexport function eitherPointDoesntMeetConfidence(a: number, b: number, minConfidence: number) {\n return (a < minConfidence || b < minConfidence);\n}\n\nexport function getAdjacentKeyPoints(keypoints, minConfidence: number) {\n return 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): [number, number, number, number] {\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]): BodyResult[] {\n const scaleY = height / inputResolutionHeight;\n const scaleX = width / inputResolutionWidth;\n const scalePose = (pose, i): BodyResult => ({\n id: i,\n score: pose.score,\n boxRaw: [pose.box[0] / inputResolutionWidth, pose.box[1] / inputResolutionHeight, pose.box[2] / inputResolutionWidth, pose.box[3] / inputResolutionHeight],\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: score as number,\n part: part as BodyLandmark,\n position: [Math.trunc(position.x * scaleX), Math.trunc(position.y * scaleY)] as Point,\n positionRaw: [position.x / inputResolutionHeight, position.y / inputResolutionHeight] as Point,\n })),\n annotations: {} as Record,\n });\n const scaledPoses = poses.map((pose, i) => scalePose(pose, i));\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: unknown[]; // don't touch\n numberOfElements: number;\n getElementValue: unknown; // function call\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 // @ts-ignore getter is of unknown type\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: number, offsets) {\n return {\n y: offsets.get(y, x, keypoint),\n x: offsets.get(y, x, keypoint + count),\n };\n}\n\nexport function getImageCoords(part, outputStride: number, 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: { x: number, y: number }, b: { x: number, y: number }) {\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", "/**\n * PoseNet body detection model implementation\n *\n * Based on: [**PoseNet**](https://medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport type { BodyResult, BodyLandmark, Box } from '../result';\nimport type { Tensor, GraphModel, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\nimport * as utils from './posenetutils';\n\nlet model: GraphModel;\nconst poseNetOutputs = ['MobilenetV1/offset_2/BiasAdd'/* offsets */, 'MobilenetV1/heatmap_2/BiasAdd'/* heatmapScores */, 'MobilenetV1/displacement_fwd_2/BiasAdd'/* displacementFwd */, 'MobilenetV1/displacement_bwd_2/BiasAdd'/* displacementBwd */];\nconst localMaximumRadius = 1;\nconst outputStride = 16;\nconst squaredNmsRadius = 50 ** 2;\n\nfunction traverse(edgeId: number, sourceKeypoint, targetId, scores, offsets, 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] = scores.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, targetId, offsets);\n targetKeypoint = utils.addVectors(\n { x: targetKeypointIndices.x * outputStride, y: targetKeypointIndices.y * outputStride },\n { x: offsetPoint.x, y: offsetPoint.y },\n );\n }\n const targetKeyPointIndices = getStridedIndexNearPoint(targetKeypoint, height, width);\n const score = scores.get(targetKeyPointIndices.y, targetKeyPointIndices.x, targetId);\n return { position: targetKeypoint, part: utils.partNames[targetId], score };\n}\n\nexport function decodePose(root, scores, offsets, displacementsFwd, displacementsBwd) {\n const tuples = utils.poseChain.map(([parentJoinName, childJoinName]) => ([utils.partIds[parentJoinName], utils.partIds[childJoinName]]));\n const edgesFwd = tuples.map(([, childJointId]) => childJointId);\n const edgesBwd = tuples.map(([parentJointId]) => parentJointId);\n const numParts = scores.shape[2]; // [21,21,17]\n const numEdges = edgesFwd.length;\n const keypoints = new Array(numParts);\n // Start a new detection instance at the position of the root.\n const rootPoint = utils.getImageCoords(root.part, outputStride, offsets);\n keypoints[root.part.id] = {\n score: root.score,\n part: utils.partNames[root.part.id] as BodyLandmark,\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 sourceId = edgesFwd[edge];\n const targetId = edgesBwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, 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 sourceId = edgesBwd[edge];\n const targetId = edgesFwd[edge];\n if (keypoints[sourceId] && !keypoints[targetId]) {\n keypoints[targetId] = traverse(edge, keypoints[sourceId], targetId, scores, offsets, displacementsFwd);\n }\n }\n return keypoints;\n}\n\nfunction scoreIsMaximumInLocalWindow(keypointId, score: number, heatmapY: number, heatmapX: number, scores) {\n const [height, width]: [number, number] = 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 if (!correspondingKeypoint) return false;\n return utils.squaredDistance(y, x, correspondingKeypoint.y, correspondingKeypoint.x) <= squaredNmsRadius;\n });\n}\n\nfunction getInstanceScore(existingPoses, keypoints) {\n const notOverlappedKeypointScores = keypoints.reduce((result, { position, score }, keypointId) => {\n if (!withinRadius(existingPoses, position, keypointId)) result += score;\n return result;\n }, 0.0);\n return notOverlappedKeypointScores / keypoints.length;\n}\n\nexport function decode(offsets, scores, displacementsFwd, displacementsBwd, maxDetected, minConfidence) {\n const poses: { keypoints, box: Box, score: number }[] = [];\n const queue = buildPartWithScoreQueue(minConfidence, scores);\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 // @ts-ignore this one is tree walk\n const rootImageCoords = utils.getImageCoords(root.part, outputStride, offsets);\n // @ts-ignore this one is tree walk\n if (withinRadius(poses, rootImageCoords, root.part.id)) continue;\n // Else start a new detection instance at the position of the root.\n let keypoints = decodePose(root, scores, offsets, displacementsFwd, displacementsBwd);\n keypoints = keypoints.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\nexport async function predict(input: Tensor4D, config: Config): Promise {\n /** posenet is mostly obsolete\n * caching is not implemented\n */\n if (!model?.['executor']) return [];\n const res = tf.tidy(() => {\n if (!model.inputs[0].shape) return [];\n const resized = tf.image.resizeBilinear(input, [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n const normalized = tf.sub(tf.div(tf.cast(resized, 'float32'), 127.5), 1.0);\n const results: Tensor[] = model.execute(normalized, poseNetOutputs) as Tensor[];\n const results3d = results.map((y) => tf.squeeze(y, [0]));\n results3d[1] = tf.sigmoid(results3d[1]); // apply sigmoid on scores\n return results3d;\n });\n\n const buffers = await Promise.all(res.map((tensor: Tensor) => tensor.buffer()));\n for (const t of res) tf.dispose(t);\n\n const decoded = decode(buffers[0], buffers[1], buffers[2], buffers[3], config.body.maxDetected, config.body.minConfidence);\n if (!model.inputs[0].shape) return [];\n const scaled = utils.scalePoses(decoded, [input.shape[1], input.shape[2]], [model.inputs[0].shape[2], model.inputs[0].shape[1]]);\n return scaled;\n}\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.body.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**Robust Video Matting**](https://github.com/PeterL1n/RobustVideoMatting)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\n\n// internal state varaibles\nconst outputNodes = ['fgr', 'pha', 'r1o', 'r2o', 'r3o', 'r4o'];\nconst t: Record = {}; // contains input tensor and recurrent states\nlet ratio = 0;\n\nfunction init(config: Config) {\n tf.dispose([t.r1i, t.r2i, t.r3i, t.r4i, t.downsample_ratio]);\n t.r1i = tf.tensor(0.0);\n t.r2i = tf.tensor(0.0);\n t.r3i = tf.tensor(0.0);\n t.r4i = tf.tensor(0.0);\n ratio = config.segmentation.ratio || 0.5;\n t.downsample_ratio = tf.tensor(ratio); // initialize downsample ratio\n}\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.segmentation.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n init(config);\n return model;\n}\n\nconst normalize = (r: Tensor): Tensor => tf.tidy(() => {\n const squeeze = tf.squeeze(r, ([0]));\n const mul = tf.mul(squeeze, constants.tf255);\n const cast = tf.cast(mul, 'int32');\n return cast;\n});\n\nfunction getRGBA(fgr: Tensor | null, pha: Tensor | null): Tensor { // gets rgba // either fgr or pha must be present\n const rgb = fgr\n ? normalize(fgr) // normalize and use value\n : tf.fill([pha!.shape[1] || 0, pha!.shape[2] || 0, 3], 255, 'int32'); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n const a = pha\n ? normalize(pha) // normalize and use value\n : tf.fill([fgr!.shape[1] || 0, fgr!.shape[2] || 0, 1], 255, 'int32'); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n const rgba = tf.concat([rgb, a], -1);\n tf.dispose([rgb, a]);\n return rgba;\n}\n\nfunction getState(state: Tensor): Tensor { // gets internal recurrent states\n return tf.tidy(() => {\n const r: Record = {};\n r.unstack = tf.unstack(state, -1);\n r.concat = tf.concat(r.unstack, 1);\n r.split = tf.split(r.concat, 4, 1);\n r.stack = tf.concat(r.split, 2);\n r.squeeze = tf.squeeze(r.stack, [0]);\n r.expand = tf.expandDims(r.squeeze, -1);\n r.add = tf.add(r.expand, 1);\n r.mul = tf.mul(r.add, 127.5);\n r.cast = tf.cast(r.mul, 'int32');\n r.tile = tf.tile(r.cast, [1, 1, 3]);\n r.alpha = tf.fill([(r.tile as Tensor).shape[0] || 0, (r.tile as Tensor).shape[1] || 0, 1], 255, 'int32'); // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion\n return tf.concat([r.tile, r.alpha], -1);\n });\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model) model = await load(config);\n if (!model?.['executor']) return null;\n // const expand = tf.expandDims(input, 0);\n t.src = tf.div(input, 255);\n if (ratio !== config.segmentation.ratio) init(config); // reinitialize recurrent states if requested downsample ratio changed\n const [fgr, pha, r1o, r2o, r3o, r4o] = await model.executeAsync(t, outputNodes) as Tensor[]; // execute model\n let rgba: Tensor;\n switch (config.segmentation.mode || 'default') {\n case 'default':\n rgba = getRGBA(fgr, pha);\n break;\n case 'alpha':\n rgba = getRGBA(null, pha);\n break;\n case 'foreground':\n rgba = getRGBA(fgr, null);\n break;\n case 'state':\n rgba = getState(r1o); // can view any internal recurrent state r10, r20, r3o, r4o\n break;\n default:\n rgba = tf.tensor(0);\n }\n tf.dispose([t.src, fgr, pha, t.r1i, t.r2i, t.r3i, t.r4i]);\n [t.r1i, t.r2i, t.r3i, t.r4i] = [r1o, r2o, r3o, r4o]; // update recurrent states\n return rgba;\n}\n", "/**\n * Image segmentation for body detection model\n *\n * Based on:\n * - [**MediaPipe Selfie**](https://drive.google.com/file/d/1dCfozqknMa068vVsO2j_1FgZkW_e3VWv/preview)\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log } from '../util/util';\nimport { loadModel } from '../tfjs/load';\nimport { constants } from '../tfjs/constants';\nimport type { GraphModel, Tensor, Tensor4D } from '../tfjs/types';\nimport type { Config } from '../config';\nimport { env } from '../util/env';\n\nlet model: GraphModel;\n\nexport async function load(config: Config): Promise {\n if (!model || env.initial) model = await loadModel(config.segmentation.modelPath);\n else if (config.debug) log('cached model:', model['modelUrl']);\n return model;\n}\n\nexport async function predict(input: Tensor4D, config: Config): Promise {\n if (!model) model = await load(config);\n if (!model?.['executor'] || !model?.inputs?.[0].shape) return null; // something is wrong with the model\n const t: Record = {};\n t.resize = tf.image.resizeBilinear(input, [model.inputs[0].shape ? model.inputs[0].shape[1] : 0, model.inputs[0].shape ? model.inputs[0].shape[2] : 0], false);\n t.norm = tf.div(t.resize, constants.tf255);\n t.res = model.execute(t.norm) as Tensor;\n t.squeeze = tf.squeeze(t.res, [0]); // meet.shape:[1,256,256,1], selfie.shape:[1,144,256,2]\n t.alpha = tf.image.resizeBilinear(t.squeeze as Tensor4D, [input.shape[1] || 0, input.shape[2] || 0]); // model selfie has a single channel that we can use directly\n t.mul = tf.mul(t.alpha, constants.tf255);\n let rgba: Tensor;\n switch (config.segmentation.mode || 'default') {\n case 'default':\n t.input = tf.squeeze(input);\n t.concat = tf.concat([t.input, t.mul], -1);\n rgba = tf.cast(t.concat, 'int32'); // combined original with alpha\n break;\n case 'alpha':\n rgba = tf.cast(t.mul, 'int32'); // just get alpha value from model\n break;\n default:\n rgba = tf.tensor(0);\n }\n Object.keys(t).forEach((tensor) => tf.dispose(t[tensor]));\n return rgba;\n}\n", "/**\n * Analyze detection Results and sort&combine them into per-person view\n */\n\nimport type { FaceResult, BodyResult, HandResult, GestureResult, PersonResult, Box } from '../result';\n\nexport function join(faces: FaceResult[], bodies: BodyResult[], hands: HandResult[], gestures: GestureResult[], shape: number[] | undefined): PersonResult[] {\n let id = 0;\n const persons: PersonResult[] = [];\n for (const face of faces) { // person is defined primarily by face and then we append other objects as found\n const person: PersonResult = { id: id++, face, body: null, hands: { left: null, right: null }, gestures: [], box: [0, 0, 0, 0] };\n for (const body of bodies) {\n if (face.box[0] > body.box[0] // x within body\n && face.box[0] < body.box[0] + body.box[2]\n && face.box[1] + face.box[3] > body.box[1] // y within body\n && face.box[1] + face.box[3] < body.box[1] + body.box[3]) {\n person.body = body;\n }\n }\n if (person.body) { // only try to join hands if body is found\n for (const hand of hands) {\n if (hand.box[0] + hand.box[2] > person.body.box[0] // x within body for left hand\n && hand.box[0] + hand.box[2] < person.body.box[0] + person.body.box[2]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for left hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.left = hand;\n }\n if (hand.box[0] < person.body.box[0] + person.body.box[2] // x within body for right hand\n && hand.box[0] > person.body.box[0]\n && hand.box[1] + hand.box[3] > person.body.box[1] // x within body for right hand\n && hand.box[1] + hand.box[3] < person.body.box[1] + person.body.box[3]) {\n if (person.hands) person.hands.right = hand;\n }\n }\n }\n for (const gesture of gestures) { // append all gestures according to ids\n if (gesture['face'] !== undefined && gesture['face'] === face.id) person.gestures.push(gesture);\n else if (gesture['iris'] !== undefined && gesture['iris'] === face.id) person.gestures.push(gesture);\n else if (gesture['body'] !== undefined && gesture['body'] === person.body?.id) person.gestures.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands.left?.id) person.gestures.push(gesture);\n else if (gesture['hand'] !== undefined && gesture['hand'] === person.hands.right?.id) person.gestures.push(gesture);\n }\n\n // create new overarching box from all boxes belonging to person\n const x: number[] = [];\n const y: number[] = [];\n const extractXY = (box: Box | undefined) => { // extract all [x, y] coordinates from boxes [x, y, width, height]\n if (box && box.length === 4) {\n x.push(box[0], box[0] + box[2]);\n y.push(box[1], box[1] + box[3]);\n }\n };\n extractXY(person.face.box);\n extractXY(person.body?.box);\n extractXY(person.hands.left?.box);\n extractXY(person.hands.right?.box);\n const minX = Math.min(...x);\n const minY = Math.min(...y);\n person.box = [minX, minY, Math.max(...x) - minX, Math.max(...y) - minY]; // create new overarching box\n\n // shape is known so we calculate boxRaw as well\n if (shape?.[1] && shape?.[2]) person.boxRaw = [person.box[0] / shape[2], person.box[1] / shape[1], person.box[2] / shape[2], person.box[3] / shape[1]];\n\n persons.push(person);\n }\n return persons;\n}\n", "/**\n * Embedded sample images used during warmup in dataURL format\n */\n\n// data:image/jpeg;base64,\nexport const face = `\n/9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA\nAAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu\nbmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8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ukulmxxlx2paN4mNng+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", "/**\n * Warmup algorithm that uses embedded images to exercise loaded models for faster future inference\n */\n\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now, mergeDeep } from './util/util';\nimport * as sample from './sample';\nimport * as image from './image/image';\nimport * as backend from './tfjs/backend';\nimport { env } from './util/env';\nimport { empty, Result } from './result';\nimport type { Config } from './config';\nimport type { Human } from './human';\nimport type { Tensor, DataType } from './tfjs/types';\n\nasync function warmupBitmap(instance: Human): Promise {\n const b64toBlob = (base64: string, type = 'application/octet-stream') => fetch(`data:${type};base64,${base64}`).then((res) => res.blob());\n let blob: Blob | null;\n let res: Result | undefined;\n switch (instance.config.warmup) {\n case 'face': blob = await b64toBlob(sample.face); break;\n case 'body':\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 instance.detect(bitmap, instance.config);\n bitmap.close();\n }\n return res;\n}\n\nasync function warmupCanvas(instance: Human): Promise {\n return new Promise((resolve) => {\n let src: string;\n // let size = 0;\n switch (instance.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 = '';\n }\n // src = encodeURI('../assets/human-sample-upper.jpg');\n let img: HTMLImageElement;\n if (typeof Image !== 'undefined') img = new Image();\n // @ts-ignore env.image is an external monkey-patch\n else if (env.Image) img = new env.Image();\n else {\n resolve(undefined);\n return;\n }\n img.onload = async () => {\n const canvas = image.canvas(img.naturalWidth, img.naturalHeight);\n if (!canvas) {\n log('Warmup: Canvas not found');\n resolve(undefined);\n } else {\n const ctx = canvas.getContext('2d') as CanvasRenderingContext2D;\n if (ctx) ctx.drawImage(img, 0, 0);\n // const data = ctx?.getImageData(0, 0, canvas.height, canvas.width);\n const tensor = await instance.image(canvas, true);\n const res = tensor.tensor ? await instance.detect(tensor.tensor, instance.config) : undefined;\n resolve(res);\n }\n };\n if (src) img.src = src;\n else resolve(undefined);\n });\n}\n\nasync function warmupNode(instance: Human): Promise {\n const atob = (str: string) => Buffer.from(str, 'base64');\n let img;\n if (instance.config.warmup === 'face') img = atob(sample.face);\n else img = atob(sample.body);\n let res: Result;\n if (('node' in tf) && (tf.getBackend() === 'tensorflow')) {\n // @ts-ignore\n const data: Tensor = tf['node'].decodeJpeg(img); // eslint-disable-line import/namespace\n const expanded: Tensor = tf.expandDims(data, 0);\n instance.tf.dispose(data);\n // log('Input:', expanded);\n res = await instance.detect(expanded, instance.config);\n instance.tf.dispose(expanded);\n } else {\n if (instance.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 instance.detect(input, instance.config);\n */\n }\n // @ts-ignore\n return res;\n}\n\nasync function runInference(instance: Human) {\n let res: Result | undefined;\n if (typeof createImageBitmap === 'function') res = await warmupBitmap(instance);\n else if ((typeof Image !== 'undefined') || (env.Canvas !== undefined)) res = await warmupCanvas(instance);\n else res = await warmupNode(instance);\n return res;\n}\n\n/** Runs pre-compile on all loaded models */\nexport async function runCompile(instance: Human) {\n // @ts-ignore private property\n if (!tf.env().flagRegistry.ENGINE_COMPILE_ONLY) return; // tfjs does not support compile-only inference\n const backendType = tf.getBackend();\n const webGLBackend = tf.backend();\n if ((backendType !== 'webgl' && backendType !== 'humangl') || !webGLBackend?.['checkCompileCompletion']) {\n // log('compile pass: skip');\n return;\n }\n tf.env().set('ENGINE_COMPILE_ONLY', true);\n const numTensorsStart = tf.engine().state.numTensors;\n const compiledModels: string[] = [];\n for (const [modelName, model] of Object.entries(instance.models.models)) {\n if (!model) continue;\n const shape = (model?.modelSignature && model?.inputs?.[0]?.shape) ? [...model.inputs[0].shape] : [1, 64, 64, 3];\n const dtype: DataType = (model?.modelSignature && model?.inputs?.[0]?.dtype) ? model.inputs[0].dtype : 'float32';\n for (let dim = 0; dim < shape.length; dim++) {\n if (shape[dim] === -1) shape[dim] = dim === 0 ? 1 : 64; // override batch number and any dynamic dimensions\n }\n const tensor = tf.zeros(shape, dtype);\n try {\n const res = model.execute(tensor);\n compiledModels.push(modelName);\n if (Array.isArray(res)) res.forEach((t) => tf.dispose(t));\n else tf.dispose(res);\n } catch {\n if (instance.config.debug) log('compile fail model:', modelName);\n }\n tf.dispose(tensor);\n }\n const kernels = await webGLBackend['checkCompileCompletionAsync']();\n webGLBackend['getUniformLocations']();\n if (instance.config.debug) log('compile pass:', { models: compiledModels, kernels: kernels.length });\n tf.env().set('ENGINE_COMPILE_ONLY', false);\n const numTensorsEnd = tf.engine().state.numTensors;\n if ((numTensorsEnd - numTensorsStart) > 0) log('tensor leak:', numTensorsEnd - numTensorsStart);\n}\n\n/** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used in browser environments for `webgl` and `humangl` backends\n * @param userConfig?: Config\n*/\nexport async function warmup(instance: Human, userConfig?: Partial): Promise {\n await backend.check(instance, false);\n const t0 = now();\n instance.state = 'warmup';\n if (userConfig) instance.config = mergeDeep(instance.config, userConfig) as Config;\n if (!instance.config.warmup || instance.config.warmup.length === 0 || instance.config.warmup === 'none') {\n return empty();\n }\n return new Promise(async (resolve) => {\n await instance.models.load();\n await runCompile(instance);\n const res = await runInference(instance);\n const t1 = now();\n if (instance.config.debug) log('warmup', instance.config.warmup, Math.round(t1 - t0), 'ms');\n instance.emit('warmup');\n resolve(res);\n });\n}\n", "/**\n * Human main module\n * @default Human Library\n * @summary \n * @author \n * @copyright \n * @license MIT\n */\n\n// module imports\nimport * as tf from 'dist/tfjs.esm.js';\nimport { log, now, mergeDeep, validate } from './util/util';\nimport { defaults } from './config';\nimport { env, Env } from './util/env';\nimport { WebCam } from './util/webcam';\nimport { setModelLoadOptions } from './tfjs/load';\nimport * as app from '../package.json';\nimport * as backend from './tfjs/backend';\nimport * as draw from './draw/draw';\nimport * as blazepose from './body/blazepose';\nimport * as centernet from './object/centernet';\nimport * as efficientpose from './body/efficientpose';\nimport * as face from './face/face';\nimport * as facemesh from './face/facemesh';\nimport * as gesture from './gesture/gesture';\nimport * as handpose from './hand/handpose';\nimport * as handtrack from './hand/handtrack';\nimport * as image from './image/image';\nimport * as interpolate from './util/interpolate';\nimport * as meet from './segmentation/meet';\nimport * as match from './face/match';\nimport * as models from './models';\nimport * as movenet from './body/movenet';\nimport * as nanodet from './object/nanodet';\nimport * as persons from './util/persons';\nimport * as posenet from './body/posenet';\nimport * as rvm from './segmentation/rvm';\nimport * as selfie from './segmentation/selfie';\nimport * as warmups from './warmup';\n\n// type definitions\nimport { Input, Config, Result, FaceResult, HandResult, BodyResult, ObjectResult, GestureResult, AnyCanvas, empty } from './exports';\nimport type { Tensor, Tensor4D } from './tfjs/types';\n// type exports\nexport * from './exports';\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 *\n * @param userConfig - {@link Config}\n * @returns instance of {@link Human}\n */\nexport class Human {\n /** Current version of Human library in *semver* format */\n version: string;\n\n /** Current configuration\n * - Defaults: [config](https://github.com/vladmandic/human/blob/main/src/config.ts#L262)\n */\n config: Config;\n\n /** Last known result of detect run\n * - Can be accessed anytime after initial detection\n */\n result: Result;\n\n /** Current state of Human library\n * - Can be polled to determine operations that are currently executed\n * - Progresses through: 'config', 'check', 'backend', 'load', 'run:', 'idle'\n */\n state: string;\n\n /** currenty processed image tensor and canvas */\n process: { tensor: Tensor | null, canvas: AnyCanvas | null };\n\n /** Instance of TensorFlow/JS used by Human\n * - Can be embedded or externally provided\n * [TFJS API](https://js.tensorflow.org/api/latest/)\n */\n tf;\n\n /** Object containing environment information used for diagnostics */\n env: Env = env;\n\n /** Draw helper classes that can draw detected objects on canvas using specified draw\n * - canvas: draws input to canvas\n * - options: are global settings for all draw operations, can be overriden for each draw method {@link DrawOptions}\n * - face, body, hand, gesture, object, person: draws detected results as overlays on canvas\n */\n // draw: { canvas: typeof draw.canvas, face: typeof draw.face, body: typeof draw.body, hand: typeof draw.hand, gesture: typeof draw.gesture, object: typeof draw.object, person: typeof draw.person, all: typeof draw.all, options: DrawOptions };\n draw: typeof draw = draw;\n\n /** Face Matching\n * - similarity: compare two face descriptors and return similarity index\n * - distance: compare two face descriptors and return raw calculated differences\n * - find: compare face descriptor to array of face descriptors and return best match\n */\n match: typeof match = match;\n\n /** Currently loaded models\n * @internal\n * {@link models#Models}\n */\n models: models.Models;\n\n /** Container for events dispatched by Human\n * Possible events:\n * - `create`: triggered when Human object is instantiated\n * - `load`: triggered when models are loaded (explicitly or on-demand)\n * - `image`: triggered when input image is processed\n * - `result`: triggered when detection is complete\n * - `warmup`: triggered when warmup is complete\n * - `error`: triggered on some errors\n */\n events: EventTarget | undefined;\n /** Reference face triangualtion array of 468 points, used for triangle references between points */\n faceTriangulation: number[];\n /** Refernce UV map of 468 values, used for 3D mapping of the face mesh */\n faceUVMap: [number, number][];\n /** Performance object that contains values for all recently performed operations */\n performance: Record; // perf members are dynamically defined as needed\n #numTensors: number;\n #analyzeMemoryLeaks: boolean;\n #checkSanity: boolean;\n // definition end\n\n /** Constructor for **Human** library that is futher used for all operations\n * @param userConfig - user configuration object {@link Config}\n */\n constructor(userConfig?: Partial) {\n /*\n defaults.wasmPath = tf.version['tfjs-core'].includes('-') // custom build or official build\n ? 'https://vladmandic.github.io/tfjs/dist/'\n : `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tf.version_core}/dist/`;\n */\n const tfVersion = (tf.version.tfjs || tf.version_core).replace(/-(.*)/, '');\n defaults.wasmPath = `https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${tfVersion}/dist/`;\n defaults.modelBasePath = env.browser ? '../models/' : 'file://models/';\n this.version = app.version; // expose version property on instance of class\n Object.defineProperty(this, 'version', { value: app.version }); // expose version property directly on class itself\n this.config = JSON.parse(JSON.stringify(defaults));\n Object.seal(this.config);\n this.config.cacheModels = typeof indexedDB !== 'undefined';\n if (userConfig) this.config = mergeDeep(this.config, userConfig);\n setModelLoadOptions(this.config);\n this.tf = tf;\n this.state = 'idle';\n this.#numTensors = 0;\n this.#analyzeMemoryLeaks = false;\n this.#checkSanity = false;\n this.performance = {};\n this.events = (typeof EventTarget !== 'undefined') ? new EventTarget() : undefined;\n // object that contains all initialized models\n this.models = new models.Models(this);\n // reexport draw methods\n draw.init();\n this.result = empty();\n // export access to image processing\n this.process = { tensor: null, canvas: null };\n // export raw access to underlying models\n this.faceTriangulation = facemesh.triangulation;\n this.faceUVMap = facemesh.uvmap;\n // init model validation\n models.validateModel(this, null, '');\n // include platform info\n this.emit('create');\n if (this.config.debug || this.env.browser) log(`version: ${this.version}`);\n if (this.config.debug) log(`tfjs version: ${this.tf.version['tfjs-core']}`);\n const envTemp = JSON.parse(JSON.stringify(this.env));\n delete envTemp.kernels;\n delete envTemp.initial;\n delete envTemp.perfadd;\n if (this.config.debug) log('environment:', envTemp);\n }\n\n /** internal function to measure tensor leaks */\n analyze = (...msg: string[]) => {\n if (!this.#analyzeMemoryLeaks) return;\n const currentTensors = this.tf.engine().state.numTensors;\n const previousTensors = this.#numTensors;\n this.#numTensors = currentTensors;\n const leaked = currentTensors - previousTensors;\n if (leaked !== 0) log(...msg, leaked);\n };\n\n /** internal function for quick sanity check on inputs @hidden */\n #sanity = (input: Input): null | string => {\n if (!this.#checkSanity) return null;\n if (!input) return 'input is not defined';\n if (this.env.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 /** Reset configuration to default values */\n reset(): void {\n const currentBackend = this.config.backend; // save backend;\n this.config = JSON.parse(JSON.stringify(defaults));\n this.config.backend = currentBackend;\n image.reset();\n env.initial = true;\n }\n\n /** Validate current configuration schema */\n validate(userConfig?: Partial) {\n const msgs = validate(defaults, userConfig || this.config);\n if (msgs.length === 0) this.config = mergeDeep(this.config, userConfig) as Config;\n return msgs;\n }\n\n /** Utility wrapper for performance.now() */\n now(): number { // eslint-disable-line class-methods-use-this\n return now();\n }\n\n /** Process input as return canvas and tensor\n *\n * @param input - any input {@link Input}\n * @param getTensor - should image processing also return tensor or just canvas\n * Returns object with `tensor` and `canvas`\n */\n image(input: Input, getTensor: boolean = false) {\n return image.process(input, this.config, getTensor);\n }\n\n /** Segmentation method takes any input and returns RGBA tensor\n * Note: Segmentation is not triggered as part of detect process\n *\n * @param input - {@link Input}\n * Returns tensor which contains image data in RGBA format\n */\n async segmentation(input: Input, userConfig?: Partial): Promise {\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n if (!this.config.segmentation.enabled) return null;\n const processed = await image.process(input, this.config);\n if (!processed.tensor) return null;\n let tensor: Tensor | null = null;\n if (this.config.segmentation.modelPath?.includes('rvm')) tensor = await rvm.predict(processed.tensor, this.config);\n if (this.config.segmentation.modelPath?.includes('meet')) tensor = await meet.predict(processed.tensor, this.config);\n if (this.config.segmentation.modelPath?.includes('selfie')) tensor = await selfie.predict(processed.tensor, this.config);\n tf.dispose(processed.tensor);\n return tensor;\n }\n\n /** Compare two input tensors for pixel similarity\n * - use `human.image` to process any valid input and get a tensor that can be used for compare\n * - when passing manually generated tensors:\n * - both input tensors must be in format [1, height, width, 3]\n * - if resolution of tensors does not match, second tensor will be resized to match resolution of the first tensor\n * - return value is pixel similarity score normalized by input resolution and rgb channels\n */\n compare(firstImageTensor: Tensor, secondImageTensor: Tensor): Promise {\n return image.compare(this.config, firstImageTensor, secondImageTensor);\n }\n\n /** Explicit backend initialization\n * - Normally done implicitly during initial load phase\n * - Call to explictly register and initialize TFJS backend without any other operations\n * - Use when changing backend during runtime\n */\n async init(): Promise {\n await backend.check(this, true);\n await this.tf.ready();\n image.reset();\n }\n\n /** WebCam helper methods\n *\n */\n public webcam = new WebCam();\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 * @param userConfig - {@link Config}\n */\n async load(userConfig?: Partial): Promise {\n this.state = 'load';\n const timeStamp = now();\n const count = Object.values(this.models.models).filter((model) => model).length;\n if (userConfig) this.config = mergeDeep(this.config, userConfig) as Config;\n if (this.env.initial) { // print version info on first run and check for correct backend setup\n if (!await backend.check(this, false)) log('error: backend check failed');\n await tf.ready();\n if (this.env.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\n await this.models.load(this); // actually loads models\n if (this.env.initial && this.config.debug) log('tf engine state:', this.tf.engine().state.numBytes, 'bytes', this.tf.engine().state.numTensors, 'tensors'); // print memory stats on first run\n this.env.initial = false;\n\n const loaded = Object.values(this.models.models).filter((model) => model).length;\n if (loaded !== count) { // number of loaded models changed\n this.models.validate(); // validate kernel ops used by model against current backend\n this.emit('load');\n }\n\n const current = Math.trunc(now() - timeStamp);\n if (current > (this.performance.loadModels || 0)) this.performance.loadModels = this.env.perfadd ? (this.performance.loadModels || 0) + current : current;\n }\n\n /** emit event */\n emit = (event: string) => {\n if (this.events?.dispatchEvent) this.events.dispatchEvent(new Event(event));\n };\n\n /** Runs interpolation using last known result and returns smoothened result\n * Interpolation is based on time since last known result so can be called independently\n *\n * @param result - {@link Result} optional use specific result set to run interpolation on\n * @returns result - {@link Result}\n */\n next(result: Result = this.result): Result {\n return interpolate.calc(result, this.config);\n }\n\n /** Warmup method pre-initializes all configured models for faster inference\n * - can take significant time on startup\n * - only used for `webgl` and `humangl` backends\n * @param userConfig - {@link Config}\n * @returns result - {@link Result}\n */\n async warmup(userConfig?: Partial) {\n const t0 = now();\n const res = await warmups.warmup(this, userConfig);\n const t1 = now();\n this.performance.warmup = Math.trunc(t1 - t0);\n return res;\n }\n\n /** Run detect with tensorflow profiling\n * - result object will contain total exeuction time information for top-20 kernels\n * - actual detection object can be accessed via `human.result`\n */\n async profile(input: Input, userConfig?: Partial): Promise<{ kernel: string, time: number, perc: number }[]> {\n // @ts-ignore profile wraps method return values\n const profile = await this.tf.profile(() => this.detect(input, userConfig));\n const kernels: Record = {};\n let total = 0;\n for (const kernel of profile.kernels) { // sum kernel time values per kernel\n const ms = Number(kernel.kernelTimeMs) || 0;\n if (kernels[kernel.name]) kernels[kernel.name] += ms;\n else kernels[kernel.name] = ms;\n total += ms;\n }\n const kernelArr: { kernel: string, time: number, perc: number }[] = [];\n Object.entries(kernels).forEach((key) => kernelArr.push({ kernel: key[0], time: key[1] as unknown as number, perc: 0 })); // convert to array\n for (const kernel of kernelArr) {\n kernel.perc = Math.round(1000 * kernel.time / total) / 1000;\n kernel.time = Math.round(1000 * kernel.time) / 1000;\n }\n kernelArr.sort((a, b) => b.time - a.time); // sort\n kernelArr.length = 20; // crop\n return kernelArr;\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 * @param input - {@link Input}\n * @param userConfig - {@link Config}\n * @returns result - {@link Result}\n */\n async detect(input: Input, userConfig?: Partial): Promise {\n // detection happens inside a promise\n this.state = 'detect';\n return new Promise(async (resolve) => {\n this.state = 'config';\n let timeStamp;\n\n // update configuration\n this.config = mergeDeep(this.config, userConfig) as Config;\n\n // sanity checks\n this.state = 'check';\n const error = this.#sanity(input);\n if (error) {\n log(error, input);\n this.emit('error');\n resolve(empty(error));\n }\n\n const timeStart = now();\n\n // load models if enabled\n await this.load();\n\n timeStamp = now();\n this.state = 'image';\n const img = await image.process(input, this.config) as { canvas: AnyCanvas, tensor: Tensor4D };\n this.process = img;\n this.performance.inputProcess = this.env.perfadd ? (this.performance.inputProcess || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n this.analyze('Get Image:');\n\n if (!img.tensor) {\n if (this.config.debug) log('could not convert input to tensor');\n this.emit('error');\n resolve(empty('could not convert input to tensor'));\n return;\n }\n this.emit('image');\n\n timeStamp = now();\n this.config.skipAllowed = await image.skip(this.config, img.tensor);\n this.config.filter.autoBrightness = (this.config.filter.autoBrightness || false) && this.config.skipAllowed; // disable autoBrightness on scene change\n if (!this.performance.totalFrames) this.performance.totalFrames = 0;\n if (!this.performance.cachedFrames) this.performance.cachedFrames = 0;\n (this.performance.totalFrames)++;\n if (this.config.skipAllowed) this.performance.cachedFrames++;\n this.performance.cacheCheck = this.env.perfadd ? (this.performance.cacheCheck || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n this.analyze('Check Changed:');\n\n // prepare where to store model results\n // keep them with weak typing as it can be promise or not\n let faceRes: FaceResult[] | Promise | never[] = [];\n let bodyRes: BodyResult[] | Promise | never[] = [];\n let handRes: HandResult[] | Promise | never[] = [];\n let objectRes: ObjectResult[] | Promise | never[] = [];\n\n // run face detection followed by all models that rely on face bounding box: face mesh, age, gender, emotion\n this.state = 'detect:face';\n if (this.config.async) {\n faceRes = this.config.face.enabled ? face.detectFace(this, img.tensor) : [];\n if (this.performance.face) delete this.performance.face;\n } else {\n timeStamp = now();\n faceRes = this.config.face.enabled ? await face.detectFace(this, img.tensor) : [];\n this.performance.face = this.env.perfadd ? (this.performance.face || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n\n if (this.config.async && (this.config.body.maxDetected === -1 || this.config.hand.maxDetected === -1)) faceRes = await faceRes; // need face result for auto-detect number of hands or bodies\n\n // run body: can be posenet, blazepose, efficientpose, movenet\n this.analyze('Start Body:');\n this.state = 'detect:body';\n const bodyConfig = this.config.body.maxDetected === -1 ? mergeDeep(this.config, { body: { maxDetected: this.config.face.enabled ? 1 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of bodies\n if (this.config.async) {\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? movenet.predict(img.tensor, bodyConfig) : [];\n if (this.performance.body) delete this.performance.body;\n } else {\n timeStamp = now();\n if (this.config.body.modelPath?.includes('posenet')) bodyRes = this.config.body.enabled ? await posenet.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('blazepose')) bodyRes = this.config.body.enabled ? await blazepose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('efficientpose')) bodyRes = this.config.body.enabled ? await efficientpose.predict(img.tensor, bodyConfig) : [];\n else if (this.config.body.modelPath?.includes('movenet')) bodyRes = this.config.body.enabled ? await movenet.predict(img.tensor, bodyConfig) : [];\n this.performance.body = this.env.perfadd ? (this.performance.body || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n this.analyze('End Body:');\n\n // run handpose\n this.analyze('Start Hand:');\n this.state = 'detect:hand';\n const handConfig = this.config.hand.maxDetected === -1 ? mergeDeep(this.config, { hand: { maxDetected: this.config.face.enabled ? 2 * (faceRes as FaceResult[]).length : 1 } }) : this.config; // autodetect number of hands\n if (this.config.async) {\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? handtrack.predict(img.tensor, handConfig) : [];\n if (this.performance.hand) delete this.performance.hand;\n } else {\n timeStamp = now();\n if (this.config.hand.detector?.modelPath?.includes('handdetect')) handRes = this.config.hand.enabled ? await handpose.predict(img.tensor, handConfig) : [];\n else if (this.config.hand.detector?.modelPath?.includes('handtrack')) handRes = this.config.hand.enabled ? await handtrack.predict(img.tensor, handConfig) : [];\n this.performance.hand = this.env.perfadd ? (this.performance.hand || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n this.analyze('End Hand:');\n\n // run object detection\n this.analyze('Start Object:');\n this.state = 'detect:object';\n if (this.config.async) {\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? centernet.predict(img.tensor, this.config) : [];\n if (this.performance.object) delete this.performance.object;\n } else {\n timeStamp = now();\n if (this.config.object.modelPath?.includes('nanodet')) objectRes = this.config.object.enabled ? await nanodet.predict(img.tensor, this.config) : [];\n else if (this.config.object.modelPath?.includes('centernet')) objectRes = this.config.object.enabled ? await centernet.predict(img.tensor, this.config) : [];\n this.performance.object = this.env.perfadd ? (this.performance.object || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n }\n this.analyze('End Object:');\n\n // if async wait for results\n this.state = 'detect:await';\n if (this.config.async) [faceRes, bodyRes, handRes, objectRes] = await Promise.all([faceRes, bodyRes, handRes, objectRes]);\n\n // run gesture analysis last\n this.state = 'detect:gesture';\n let gestureRes: GestureResult[] = [];\n if (this.config.gesture.enabled) {\n timeStamp = now();\n gestureRes = [...gesture.face(faceRes as FaceResult[]), ...gesture.body(bodyRes as BodyResult[]), ...gesture.hand(handRes as HandResult[]), ...gesture.iris(faceRes as FaceResult[])];\n if (!this.config.async) this.performance.gesture = this.env.perfadd ? (this.performance.gesture || 0) + Math.trunc(now() - timeStamp) : Math.trunc(now() - timeStamp);\n else if (this.performance.gesture) delete this.performance.gesture;\n }\n\n this.performance.total = this.env.perfadd ? (this.performance.total || 0) + Math.trunc(now() - timeStart) : Math.trunc(now() - timeStart);\n const shape = this.process.tensor?.shape || [0, 0, 0, 0];\n this.result = {\n face: faceRes as FaceResult[],\n body: bodyRes as BodyResult[],\n hand: handRes as HandResult[],\n gesture: gestureRes,\n object: objectRes as ObjectResult[],\n performance: this.performance,\n canvas: this.process.canvas,\n timestamp: Date.now(),\n error: null,\n width: shape[2],\n height: shape[1],\n get persons() { return persons.join(faceRes as FaceResult[], bodyRes as BodyResult[], handRes as HandResult[], gestureRes, shape); },\n };\n\n // finally dispose input tensor\n tf.dispose(img.tensor);\n\n // log('Result:', result);\n this.emit('detect');\n this.state = 'idle';\n resolve(this.result);\n });\n }\n\n /** Helper function\n * @param ms - sleep time in miliseconds\n */\n async sleep(ms: number): Promise { // eslint-disable-line class-methods-use-this\n return new Promise((resolve) => { setTimeout(resolve, ms); });\n }\n\n /** internal structure that keeps track of processed videos @hidden */\n #loops: Record = {};\n /** Continously detect video frames\n * @param element - HTMLVideoElement input\n * @param run - boolean run continously or stop if already running, default true\n * @param delay - number delay detection between frames for number of miliseconds, default 0\n */\n async video(element: HTMLVideoElement, run: boolean = true, delay: number = 0) {\n if (run) {\n if (!this.#loops[element.id]) {\n if (this.config.debug) log('video start', element.id);\n this.#loops[element.id] = true;\n }\n if (!element.paused && this.#loops[element.id] && (element.readyState >= 2)) await this.detect(element);\n if (delay > 0) await this.sleep(delay);\n if (this.#loops[element.id]) requestAnimationFrame(() => this.video(element, run, delay));\n } else {\n if (this.config.debug) log('video stop', element.id);\n this.#loops[element.id] = false;\n }\n }\n}\n\n/** Class Human as default export */\n/* eslint no-restricted-exports: [\"off\", { \"restrictedNamedExports\": [\"default\"] }] */\nexport { Human as default, match, draw, models };\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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f,IAAI,UAAU;AAAE,iBAAeK,MAAK,SAAyB,SAAyB,SAAyB,YAAY,KAAK;AAAA,QAAG;AAAA,MACrI;AAGA,MAAG,GAAQ,IAAI,MAAM;AAGrB,WAAK,KAAK,QAAQ;AAClB,WAAK,QAAQ;AACb,cAAQ,KAAK,MAAM;AAAA,IACrB,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAMrB,KAA2B;AACrC,WAAO,IAAI,QAAQ,CAAC,YAAY;AAAE,iBAAW,SAASA,GAAE;AAAA,IAAG,CAAC;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAM,SAA2B,MAAe,MAAM,QAAgB,GAAG;AAC7E,QAAI,KAAK;AACP,UAAI,CAAC,mBAAK,QAAO,QAAQ,EAAE,GAAG;AAC5B,YAAI,KAAK,OAAO;AAAO,cAAI,eAAe,QAAQ,EAAE;AACpD,2BAAK,QAAO,QAAQ,EAAE,IAAI;AAAA,MAC5B;AACA,UAAI,CAAC,QAAQ,UAAU,mBAAK,QAAO,QAAQ,EAAE,KAAM,QAAQ,cAAc;AAAI,cAAM,KAAK,OAAO,OAAO;AACtG,UAAI,QAAQ;AAAG,cAAM,KAAK,MAAM,KAAK;AACrC,UAAI,mBAAK,QAAO,QAAQ,EAAE;AAAG,8BAAsB,MAAM,KAAK,MAAM,SAAS,KAAK,KAAK,CAAC;AAAA,IAC1F,OAAO;AACL,UAAI,KAAK,OAAO;AAAO,YAAI,cAAc,QAAQ,EAAE;AACnD,yBAAK,QAAO,QAAQ,EAAE,IAAI;AAAA,IAC5B;AAAA,EACF;AACF;AAzbE;AACA;AACA;AA+DA;AAoWA;", + "names": ["r2", "r7", "r", "t", "r8", "r9", "r3", "r4", "dt", "ts", "config", "r", "match", "gl", "index", "y", "v", "size", "rgb", "fx", "process", "config", "_a", "_c", "tensor", "rgb", "t", "gl", "_a", "el", "affectnet-mobilenet", "anti-spoofing", "blazeface-back", "blazeface-front", "blazepose-detector", "blazepose-full", "blazepose-heavy", "blazepose-lite", "efficientpose-i-lite", "efficientpose-ii-lite", "efficientpose-iv", "facemesh-attention", "facemesh-attention-pinto", "facemesh-detection-full", "facemesh-detection-short", "faceres-deep", "gear-e1", "gear-e2", "gender-ssrnet-imdb", "handlandmark-full", "handlandmark-lite", "handlandmark-sparse", "insightface-efficientnet-b0", "insightface-ghostnet-strides1", "insightface-ghostnet-strides2", "insightface-mobilenet-emore", "insightface-mobilenet-swish", "movenet-lightning", "movenet-multipose", "movenet-thunder", "nanodet-e", "nanodet-g", "nanodet-m", "nanodet-t", "init", "config", "_a", "_c", "_d", "model", "r7", "config", "gl", "_a", "_a", "config", "op", "t", "canvas", "init", "options", "rgb", "localOptions", "y", "cx", "cy", "pt", "to", "options", "connectionsToIndices", "index", "_a", "_c", "_d", "_f", "_g", "_h", "_i", "emotion", "index", "v", "pt", "inCanvas", "options", "inCanvas", "_a", "localOptions", "options", "pt", "connected", "inCanvas", "_a", "localOptions", "options", "pt", "inCanvas", "_a", "localOptions", "options", "inCanvas", "_a", "localOptions", "options", "inCanvas", "localOptions", "options", "canvas", "init", "anchors", "y", "config", "outputSize", "_a", "t", "outputSize", "pt", "model", "inputSize", "config", "size", "_a", "t", "outputSize", "kpt", "distance", "annotations", "pt", "body", "_c", "labels", "model", "inputSize", "last", "lastTime", "skipped", "config", "process", "t", "id", "labels", "y", "predict", "outputSize", "connected", "kpt", "model", "lastTime", "cache", "skipped", "load", "config", "y", "predict", "_a", "enhance", "id", "x", "kpt", "connected", "pt", "pt", "size", "y", "y", "v1", "v2", "size", "inputSize", "anchors", "face", "y", "model", "inputSize", "load", "config", "_a", "decodeBoxes", "t", "_c", "_d", "_f", "_g", "model", "inputSize", "load", "config", "_a", "index", "face", "scale", "y", "_a", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "t", "r", "cache", "model", "inputSize", "predict", "config", "_a", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "id", "size", "face", "pt", "t", "index", "load", "model", "last", "lastTime", "skipped", "load", "config", "_a", "_c", "predict", "count", "_b", "t", "inputSize", "model", "last", "lastTime", "lastCount", "skipped", "load", "config", "_a", "predict", "count", "_c", "_d", "t", "gender", "all", "y", "face", "pt", "model", "skipped", "lastCount", "lastTime", "load", "config", "_a", "predict", "count", "model", "cached", "skipped", "lastCount", "lastTime", "load", "config", "_a", "predict", "count", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "_a", "predict", "count", "_b", "_c", "_d", "t", "gender", "age", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "predict", "count", "_a", "_c", "_d", "_b", "t", "model", "last", "lastCount", "lastTime", "skipped", "rgb", "load", "config", "_a", "predict", "count", "_c", "_d", "_b", "t", "normalize", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "_a", "predict", "count", "t", "model", "last", "lastCount", "lastTime", "skipped", "load", "config", "predict", "count", "_a", "t", "face", "normalize", "v", "y", "r", "r10", "r11", "r12", "r22", "size", "pt", "face", "_a", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_m", "_n", "_o", "_p", "_q", "_r", "_s", "_u", "_v", "_w", "predict", "el", "options", "point", "point2", "gesture", "body", "face", "iris", "_a", "_c", "_d", "hand", "getBoxSize", "getBoxCenter", "scaleBoxCoordinates", "enlargeBox", "size", "squarifyBox", "normalizeRadians", "computeRotation", "buildTranslationMatrix", "y", "dot", "v1", "v2", "getColumnFrom2DArr", "multiplyTransformMatrices", "size", "buildRotationMatrix", "invertTransformMatrix", "rotatePoint", "anchors", "model", "_a", "_c", "_d", "anchors", "t", "index", "config", "hand", "scaleBoxCoordinates", "lastTime", "handPoseModel", "_a", "_c", "xs", "ys", "rotatePoint", "enlargeBox", "squarifyBox", "getBoxSize", "buildRotationMatrix", "invertTransformMatrix", "getBoxCenter", "dot", "config", "computeRotation", "meshAnnotations", "predict", "config", "annotations", "index", "pt", "loadDetect", "_a", "models", "inputSize", "skipped", "lastTime", "cache", "loadDetect", "config", "_a", "loadSkeleton", "config", "models", "t", "ratio", "id", "hand", "inputSize", "kpt", "index", "predict", "_a", "skipped", "lastTime", "cache", "connected", "kpt", "calc", "config", "_a", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_m", "_n", "_o", "_p", "_q", "_r", "_s", "_u", "_v", "_w", "_x", "_y", "_z", "t0", "_b", "_e", "annotations", "pt", "kp", "t1", "model", "load", "config", "predict", "_a", "t", "options", "clamp", "index", "models_exports", "cache", "body", "kp", "compare", "inputSize", "_a", "t", "outputSize", "kpt", "pt", "model", "inputSize", "skipped", "cache", "load", "config", "_a", "kpt", "id", "pt", "annotations", "connected", "kp", "body", "predict", "t", "model", "last", "lastTime", "skipped", "inputSize", "load", "config", "process", "_a", "id", "size", "labels", "cx", "cy", "y", "predict", "outputSize", "y", "maxSize", "t", "outputStride", "y1", "x1", "y2", "x2", "dy", "dx", "model", "point", "height", "width", "minConfidence", "y", "_a", "predict", "config", "t", "load", "model", "outputNodes", "init", "config", "load", "r", "rgb", "predict", "model", "load", "config", "predict", "_a", "t", "model", "_a", "op", "_c", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_m", "_n", "_o", "_p", "_q", "_r", "_s", "_u", "_v", "_w", "_x", "_y", "_z", "_A", "load", "loadDetect", "loadSkeleton", "models", "join", "_a", "_c", "_d", "_f", "id", "face", "person", "body", "hand", "gesture", "y", "face", "body", "res", "face", "body", "canvas", "atob", "_a", "_c", "_d", "model", "t", "t0", "t1", "_a", "init", "process", "_c", "predict", "count", "model", "calc", "t0", "t1", "ms", "_d", "_f", "_g", "_h", "_i", "_j", "_k", "_l", "_m", "_n", "_o", "_p", "_q", "_r", "_s", "_u", "face", "body", "hand", "iris", "join"] } diff --git a/dist/human.js b/dist/human.js index af678deb..f96187b0 100644 --- a/dist/human.js +++ b/dist/human.js @@ -4,57 +4,57 @@ author: ' */ -"use strict";var Human=(()=>{var Gc=Object.defineProperty;var TC=Object.getOwnPropertyDescriptor;var NC=Object.getOwnPropertyNames;var RC=Object.prototype.hasOwnProperty;var EC=(e,t,a)=>t in e?Gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var yr=(e,t)=>{for(var a in t)Gc(e,a,{get:t[a],enumerable:!0})},MC=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of NC(t))!RC.call(e,r)&&r!==a&&Gc(e,r,{get:()=>t[r],enumerable:!(n=TC(t,r))||n.enumerable});return e};var PC=e=>MC(Gc({},"__esModule",{value:!0}),e);var he=(e,t,a)=>(EC(e,typeof t!="symbol"?t+"":t,a),a),Ux=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)};var qa=(e,t,a)=>(Ux(e,t,"read from private field"),a?a.call(e):t.get(e)),jn=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},xr=(e,t,a,n)=>(Ux(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);var rye={};yr(rye,{Env:()=>tc,Human:()=>Ex,default:()=>Ex,defaults:()=>ll,draw:()=>S0,empty:()=>pr,env:()=>ne,match:()=>Q0,models:()=>Rx});var Ke={};yr(Ke,{Abs:()=>ru,Acos:()=>si,Acosh:()=>ii,AdadeltaOptimizer:()=>Yg,AdagradOptimizer:()=>Zg,AdamOptimizer:()=>Jg,AdamaxOptimizer:()=>Qg,Add:()=>is,AddN:()=>oi,All:()=>li,Any:()=>ui,ArgMax:()=>su,ArgMin:()=>iu,Asin:()=>di,Asinh:()=>pi,Atan:()=>ci,Atan2:()=>mi,Atanh:()=>hi,AvgPool:()=>fi,AvgPool3D:()=>ou,AvgPool3DGrad:()=>lp,AvgPoolGrad:()=>op,BackendWasm:()=>bk,BatchMatMul:()=>gi,BatchToSpaceND:()=>lu,Bincount:()=>yi,BitwiseAnd:()=>uu,BroadcastArgs:()=>du,BroadcastTo:()=>kT,Cast:()=>xi,Ceil:()=>Ai,ClipByValue:()=>os,Complex:()=>up,ComplexAbs:()=>dp,Concat:()=>pu,Conv2D:()=>bi,Conv2DBackpropFilter:()=>pp,Conv2DBackpropInput:()=>vi,Conv3D:()=>wi,Conv3DBackpropFilterV2:()=>cu,Conv3DBackpropInputV2:()=>ki,Cos:()=>Ii,Cosh:()=>Si,CropAndResize:()=>Ni,Cumprod:()=>Ci,Cumsum:()=>Ti,DataStorage:()=>rp,DenseBincount:()=>hu,DepthToSpace:()=>Ri,DepthwiseConv2dNative:()=>Ei,DepthwiseConv2dNativeBackpropFilter:()=>cp,DepthwiseConv2dNativeBackpropInput:()=>hp,Diag:()=>mu,Dilation2D:()=>Mi,Dilation2DBackpropFilter:()=>Hl,Dilation2DBackpropInput:()=>Gl,Draw:()=>mp,ENV:()=>Q1,Einsum:()=>fp,Elu:()=>_i,EluGrad:()=>fu,Environment:()=>IA,Equal:()=>Fi,Erf:()=>$i,Exp:()=>Di,ExpandDims:()=>gu,Expm1:()=>Oi,FFT:()=>gp,Fill:()=>yu,FlipLeftRight:()=>zi,Floor:()=>Li,FloorDiv:()=>Wi,FromPixels:()=>Od,FusedBatchNorm:()=>Bi,FusedConv2D:()=>Zr,FusedDepthwiseConv2D:()=>Jr,GPGPUContext:()=>Vl,GatherNd:()=>Vi,GatherV2:()=>xu,GraphModel:()=>jp,Greater:()=>Ui,GreaterEqual:()=>Gi,IFFT:()=>yp,Identity:()=>Hi,Imag:()=>xp,IsFinite:()=>ji,IsInf:()=>qi,IsNan:()=>Xi,KernelBackend:()=>au,LRN:()=>ro,LRNGrad:()=>Au,LeakyRelu:()=>Ki,Less:()=>Yi,LessEqual:()=>Zi,LinSpace:()=>Ji,Log:()=>Qi,Log1p:()=>eo,LogSoftmax:()=>IT,LogicalAnd:()=>to,LogicalNot:()=>ao,LogicalOr:()=>no,LogicalXor:()=>CA,LowerBound:()=>ST,MathBackendCPU:()=>d3,MathBackendWebGL:()=>Yp,MatrixBandPart:()=>CT,Max:()=>so,MaxPool:()=>oo,MaxPool3D:()=>bu,MaxPool3DGrad:()=>bp,MaxPoolGrad:()=>Ap,MaxPoolWithArgmax:()=>vu,Maximum:()=>io,Mean:()=>lo,Min:()=>uo,Minimum:()=>po,MirrorPad:()=>co,Mod:()=>ho,MomentumOptimizer:()=>e3,Multinomial:()=>mo,Multiply:()=>fo,Neg:()=>wu,NonMaxSuppressionV3:()=>yo,NonMaxSuppressionV4:()=>ku,NonMaxSuppressionV5:()=>xo,NotEqual:()=>go,OP_SCOPE_SUFFIX:()=>rg,OneHot:()=>Ao,OnesLike:()=>Iu,Optimizer:()=>ps,OptimizerConstructors:()=>L7,Pack:()=>Su,PadV2:()=>bo,Pool:()=>TT,Pow:()=>vo,Prelu:()=>wo,Prod:()=>ko,RMSPropOptimizer:()=>t3,RaggedGather:()=>Mh,RaggedRange:()=>Ph,RaggedTensorToTensor:()=>_h,Range:()=>Cu,Rank:()=>a1,Real:()=>vp,RealDiv:()=>Pi,Reciprocal:()=>Io,Reduction:()=>wa,Relu:()=>So,Relu6:()=>No,Reshape:()=>Tu,ResizeBilinear:()=>To,ResizeBilinearGrad:()=>Ru,ResizeNearestNeighbor:()=>Co,ResizeNearestNeighborGrad:()=>Nu,Reverse:()=>Ro,RotateWithOffset:()=>Jo,Round:()=>Eo,Rsqrt:()=>Mo,SGDOptimizer:()=>Jh,ScatterNd:()=>Po,SearchSorted:()=>$o,Select:()=>Eu,Selu:()=>Fo,Sigmoid:()=>Lo,Sign:()=>zo,Sin:()=>Do,Sinh:()=>Oo,Slice:()=>Mu,Softmax:()=>Uo,Softplus:()=>Wo,SpaceToBatchND:()=>Pu,SparseFillEmptyRows:()=>wp,SparseReshape:()=>$u,SparseSegmentMean:()=>Fu,SparseSegmentSum:()=>Du,SparseToDense:()=>Go,SplitV:()=>_u,Sqrt:()=>Bo,Square:()=>kp,SquaredDifference:()=>Ho,StaticRegexReplace:()=>Ip,Step:()=>us,StridedSlice:()=>jo,StringNGrams:()=>Ou,StringSplit:()=>Sp,StringToHashBucketFast:()=>Cp,Sub:()=>qo,Sum:()=>Vo,Tan:()=>Xo,Tanh:()=>Ko,Tensor:()=>gt,TensorBuffer:()=>Vt,TensorScatterUpdate:()=>_o,Tile:()=>ls,TopK:()=>Yo,Transform:()=>Zo,Transpose:()=>wr,Unique:()=>Tp,Unpack:()=>zu,UnsortedSegmentSum:()=>Np,UpperBound:()=>NT,Variable:()=>Bd,WebGPUBackend:()=>q3,ZerosLike:()=>Lu,_FusedMatMul:()=>Yr,abs:()=>Ya,acos:()=>JA,acosh:()=>QA,add:()=>we,addN:()=>Fh,all:()=>eb,any:()=>tb,argMax:()=>rr,argMin:()=>ab,asin:()=>nb,asinh:()=>rb,atan:()=>sb,atan2:()=>ib,atanh:()=>ob,avgPool:()=>cg,avgPool3d:()=>pb,backend:()=>nr,backend_util:()=>C,basicLSTMCell:()=>cb,batchNorm:()=>zp,batchNorm2d:()=>hb,batchNorm3d:()=>mb,batchNorm4d:()=>fb,batchToSpaceND:()=>hg,bincount:()=>mg,bitwiseAnd:()=>gb,booleanMaskAsync:()=>e7,broadcastArgs:()=>yb,broadcastTo:()=>Bl,broadcast_util:()=>el,browser:()=>Er,buffer:()=>$e,cast:()=>Ue,ceil:()=>xb,clipByValue:()=>Ab,clone:()=>Ia,complex:()=>Sr,concat:()=>lt,concat1d:()=>bb,concat2d:()=>Wu,concat3d:()=>vb,concat4d:()=>wb,conv1d:()=>kb,conv2d:()=>Lp,conv2dTranspose:()=>Sb,conv3d:()=>Cb,conv3dTranspose:()=>Tb,copyRegisteredKernels:()=>_T,cos:()=>Nb,cosh:()=>Rb,cosineWindow:()=>qh,cumprod:()=>Eb,cumsum:()=>Mb,customGrad:()=>er,denseBincount:()=>Pb,deprecationWarn:()=>ug,depthToSpace:()=>_b,depthwiseConv2d:()=>Dh,deregisterOp:()=>PD,device_util:()=>Pp,diag:()=>$b,dilation2d:()=>Fb,disableDeprecationWarnings:()=>GN,dispose:()=>J,disposeVariables:()=>HN,div:()=>ve,divNoNan:()=>Ob,dot:()=>zb,dropout:()=>s7,einsum:()=>Bs,elu:()=>yg,enableDebugMode:()=>UN,enableProdMode:()=>lg,enclosingPowerOfTwo:()=>qg,engine:()=>It,ensureShape:()=>Lb,env:()=>B,equal:()=>gg,erf:()=>Wb,euclideanNorm:()=>Ub,exp:()=>as,expandDims:()=>Wt,expm1:()=>Gb,eye:()=>Ag,fft:()=>Uh,fill:()=>sr,findBackend:()=>dg,findBackendFactory:()=>YN,floor:()=>bg,floorDiv:()=>Dp,forceHalfFloat:()=>m8,fused:()=>Xg,gather:()=>vg,gatherND:()=>r7,gather_util:()=>r3,getBackend:()=>ca,getGradient:()=>e1,getKernel:()=>Ld,getKernelsForBackend:()=>Zn,getThreadsCount:()=>nle,gpgpu_util:()=>Hv,grad:()=>YE,grads:()=>ZE,greater:()=>Vp,greaterEqual:()=>wg,ifft:()=>Kd,imag:()=>Up,image:()=>fe,inTopKAsync:()=>i7,io:()=>Xn,irfft:()=>Bg,isFinite:()=>Hb,isInf:()=>jb,isNaN:()=>qb,keep:()=>zn,kernel_impls:()=>Rn,leakyRelu:()=>kg,less:()=>hh,lessEqual:()=>Oh,linalg:()=>m7,linspace:()=>Xb,loadGraphModel:()=>u3,loadGraphModelSync:()=>zO,localResponseNormalization:()=>Kb,log:()=>Xl,log1p:()=>Ig,logSigmoid:()=>Zb,logSoftmax:()=>Jb,logSumExp:()=>Cg,logicalAnd:()=>jd,logicalNot:()=>Tg,logicalOr:()=>Ng,logicalXor:()=>Qb,losses:()=>f7,lowerBound:()=>e4,matMul:()=>pt,math:()=>T7,max:()=>fa,maxPool:()=>Rg,maxPool3d:()=>t4,maxPoolWithArgmax:()=>a4,maximum:()=>Eg,mean:()=>qd,memory:()=>jN,meshgrid:()=>n4,min:()=>ts,minimum:()=>Xd,mirrorPad:()=>r4,mod:()=>Bu,moments:()=>s4,movingAverage:()=>t7,mul:()=>te,multiRNNCell:()=>i4,multinomial:()=>o4,neg:()=>Ln,nextFrame:()=>W7,node:()=>J3,norm:()=>Bp,notEqual:()=>Mg,oneHot:()=>mh,ones:()=>Hr,onesLike:()=>l4,op:()=>z,outerProduct:()=>u4,pad:()=>ir,pad1d:()=>d4,pad2d:()=>p4,pad3d:()=>c4,pad4d:()=>h4,pool:()=>m4,pow:()=>ql,prelu:()=>_g,print:()=>og,prod:()=>f4,profile:()=>qN,raggedGather:()=>g4,raggedRange:()=>y4,raggedTensorToTensor:()=>x4,rand:()=>A4,randomGamma:()=>k4,randomNormal:()=>zg,randomStandardNormal:()=>I4,randomUniform:()=>Wh,randomUniformInt:()=>S4,range:()=>Kl,ready:()=>Fp,real:()=>Yl,reciprocal:()=>C4,registerBackend:()=>Qo,registerGradient:()=>ET,registerKernel:()=>yn,registerOp:()=>MD,relu:()=>Gp,relu6:()=>Lg,removeBackend:()=>KN,reshape:()=>Q,reverse:()=>ns,reverse1d:()=>T4,reverse2d:()=>N4,reverse3d:()=>R4,reverse4d:()=>E4,rfft:()=>Gh,round:()=>Wg,rsqrt:()=>M4,scalar:()=>Ge,scatterND:()=>a7,scatter_util:()=>Hh,searchSorted:()=>Lh,selu:()=>P4,separableConv2d:()=>_4,serialization:()=>x7,setBackend:()=>$p,setPlatform:()=>ZN,setThreadsCount:()=>ale,setWasmPath:()=>tle,setWasmPaths:()=>l0,setWebGLContext:()=>a0,setdiff1dAsync:()=>$4,shared:()=>e0,sigmoid:()=>za,sign:()=>F4,signal:()=>h7,sin:()=>D4,sinh:()=>O4,slice:()=>Fe,slice1d:()=>z4,slice2d:()=>L4,slice3d:()=>Hp,slice4d:()=>Bh,slice_util:()=>Nt,softmax:()=>Vh,softplus:()=>Sg,spaceToBatchND:()=>Pg,sparse:()=>g7,sparseToDense:()=>n7,spectral:()=>c7,split:()=>Sa,sqrt:()=>Qn,square:()=>Tn,squaredDifference:()=>Vg,squeeze:()=>Oe,stack:()=>pa,step:()=>Ug,stridedSlice:()=>W4,string:()=>y7,sub:()=>xe,sum:()=>ot,sumOutType:()=>Mp,tan:()=>B4,tanh:()=>ch,tensor:()=>Ve,tensor1d:()=>Bt,tensor2d:()=>Yn,tensor3d:()=>Gg,tensor4d:()=>V4,tensor5d:()=>U4,tensor6d:()=>G4,tensorScatterUpdate:()=>j4,tensor_util:()=>PA,test_util:()=>b4,tidy:()=>De,tile:()=>Xr,time:()=>XN,topk:()=>q4,train:()=>NF,transpose:()=>Zs,truncatedNormal:()=>X4,unique:()=>K4,unregisterGradient:()=>PT,unregisterKernel:()=>MT,unsortedSegmentSum:()=>Y4,unstack:()=>Na,upcastType:()=>da,upperBound:()=>Z4,util:()=>v,valueAndGrad:()=>JE,valueAndGrads:()=>QE,variable:()=>J4,variableGrads:()=>Yb,version:()=>ec,version_converter:()=>WO,version_core:()=>s3,version_cpu:()=>eL,version_wasm:()=>rle,version_webgl:()=>Uj,webgl:()=>Gj,webgl_util:()=>fv,webgpu_util:()=>kk,where:()=>kr,whereAsync:()=>jg,zeros:()=>gn,zerosLike:()=>Ja});var _C=Object.create,Y1=Object.defineProperty,$C=Object.getOwnPropertyDescriptor,FC=Object.getOwnPropertyNames,DC=Object.getPrototypeOf,OC=Object.prototype.hasOwnProperty,Xt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ze=(e,t)=>{for(var a in t)Y1(e,a,{get:t[a],enumerable:!0})},zC=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of FC(t))!OC.call(e,r)&&r!==a&&Y1(e,r,{get:()=>t[r],enumerable:!(n=$C(t,r))||n.enumerable});return e},tu=(e,t,a)=>(a=e!=null?_C(DC(e)):{},zC(t||!e||!e.__esModule?Y1(a,"default",{value:e,enumerable:!0}):a,e)),LC=Xt((e,t)=>{t.exports=n;var a=null;try{a=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(S){}function n(S,_,O){this.low=S|0,this.high=_|0,this.unsigned=!!O}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0});function r(S){return(S&&S.__isLong__)===!0}n.isLong=r;var s={},i={};function o(S,_){var O,W,$;return _?(S>>>=0,($=0<=S&&S<256)&&(W=i[S],W)?W:(O=u(S,(S|0)<0?-1:0,!0),$&&(i[S]=O),O)):(S|=0,($=-128<=S&&S<128)&&(W=s[S],W)?W:(O=u(S,S<0?-1:0,!1),$&&(s[S]=O),O))}n.fromInt=o;function l(S,_){if(isNaN(S))return _?b:A;if(_){if(S<0)return b;if(S>=g)return M}else{if(S<=-y)return P;if(S+1>=y)return N}return S<0?l(-S,_).neg():u(S%f|0,S/f|0,_)}n.fromNumber=l;function u(S,_,O){return new n(S,_,O)}n.fromBits=u;var p=Math.pow;function c(S,_,O){if(S.length===0)throw Error("empty string");if(S==="NaN"||S==="Infinity"||S==="+Infinity"||S==="-Infinity")return A;if(typeof _=="number"?(O=_,_=!1):_=!!_,O=O||10,O<2||360)throw Error("interior hyphen");if(W===0)return c(S.substring(1),_,O).neg();for(var $=l(p(O,8)),U=A,G=0;G>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},E.toString=function(S){if(S=S||10,S<2||36>>0,V=H.toString(S);if(U=q,U.isZero())return V+G;for(;V.length<6;)V="0"+V;G=""+V+G}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(P)?64:this.neg().getNumBitsAbs();for(var S=this.high!=0?this.high:this.low,_=31;_>0&&!(S&1<<_);_--);return this.high!=0?_+33:_+1},E.isZero=function(){return this.high===0&&this.low===0},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return(this.low&1)===1},E.isEven=function(){return(this.low&1)===0},E.equals=function(S){return r(S)||(S=d(S)),this.unsigned!==S.unsigned&&this.high>>>31===1&&S.high>>>31===1?!1:this.high===S.high&&this.low===S.low},E.eq=E.equals,E.notEquals=function(S){return!this.eq(S)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(S){return this.comp(S)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(S){return this.comp(S)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(S){return this.comp(S)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(S){return this.comp(S)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(S){if(r(S)||(S=d(S)),this.eq(S))return 0;var _=this.isNegative(),O=S.isNegative();return _&&!O?-1:!_&&O?1:this.unsigned?S.high>>>0>this.high>>>0||S.high===this.high&&S.low>>>0>this.low>>>0?-1:1:this.sub(S).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(P)?P:this.not().add(w)},E.neg=E.negate,E.add=function(S){r(S)||(S=d(S));var _=this.high>>>16,O=this.high&65535,W=this.low>>>16,$=this.low&65535,U=S.high>>>16,G=S.high&65535,q=S.low>>>16,H=S.low&65535,V=0,Z=0,X=0,re=0;return re+=$+H,X+=re>>>16,re&=65535,X+=W+q,Z+=X>>>16,X&=65535,Z+=O+G,V+=Z>>>16,Z&=65535,V+=_+U,V&=65535,u(X<<16|re,V<<16|Z,this.unsigned)},E.subtract=function(S){return r(S)||(S=d(S)),this.add(S.neg())},E.sub=E.subtract,E.multiply=function(S){if(this.isZero())return A;if(r(S)||(S=d(S)),a){var _=a.mul(this.low,this.high,S.low,S.high);return u(_,a.get_high(),this.unsigned)}if(S.isZero())return A;if(this.eq(P))return S.isOdd()?P:A;if(S.eq(P))return this.isOdd()?P:A;if(this.isNegative())return S.isNegative()?this.neg().mul(S.neg()):this.neg().mul(S).neg();if(S.isNegative())return this.mul(S.neg()).neg();if(this.lt(x)&&S.lt(x))return l(this.toNumber()*S.toNumber(),this.unsigned);var O=this.high>>>16,W=this.high&65535,$=this.low>>>16,U=this.low&65535,G=S.high>>>16,q=S.high&65535,H=S.low>>>16,V=S.low&65535,Z=0,X=0,re=0,ee=0;return ee+=U*V,re+=ee>>>16,ee&=65535,re+=$*V,X+=re>>>16,re&=65535,re+=U*H,X+=re>>>16,re&=65535,X+=W*V,Z+=X>>>16,X&=65535,X+=$*H,Z+=X>>>16,X&=65535,X+=U*q,Z+=X>>>16,X&=65535,Z+=O*V+W*H+$*q+U*G,Z&=65535,u(re<<16|ee,Z<<16|X,this.unsigned)},E.mul=E.multiply,E.divide=function(S){if(r(S)||(S=d(S)),S.isZero())throw Error("division by zero");if(a){if(!this.unsigned&&this.high===-2147483648&&S.low===-1&&S.high===-1)return this;var _=(this.unsigned?a.div_u:a.div_s)(this.low,this.high,S.low,S.high);return u(_,a.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?b:A;var O,W,$;if(this.unsigned){if(S.unsigned||(S=S.toUnsigned()),S.gt(this))return b;if(S.gt(this.shru(1)))return I;$=b}else{if(this.eq(P)){if(S.eq(w)||S.eq(T))return P;if(S.eq(P))return w;var U=this.shr(1);return O=U.div(S).shl(1),O.eq(A)?S.isNegative()?w:T:(W=this.sub(S.mul(O)),$=O.add(W.div(S)),$)}else if(S.eq(P))return this.unsigned?b:A;if(this.isNegative())return S.isNegative()?this.neg().div(S.neg()):this.neg().div(S).neg();if(S.isNegative())return this.div(S.neg()).neg();$=A}for(W=this;W.gte(S);){O=Math.max(1,Math.floor(W.toNumber()/S.toNumber()));for(var G=Math.ceil(Math.log(O)/Math.LN2),q=G<=48?1:p(2,G-48),H=l(O),V=H.mul(S);V.isNegative()||V.gt(W);)O-=q,H=l(O,this.unsigned),V=H.mul(S);H.isZero()&&(H=w),$=$.add(H),W=W.sub(V)}return $},E.div=E.divide,E.modulo=function(S){if(r(S)||(S=d(S)),a){var _=(this.unsigned?a.rem_u:a.rem_s)(this.low,this.high,S.low,S.high);return u(_,a.get_high(),this.unsigned)}return this.sub(this.div(S).mul(S))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return u(~this.low,~this.high,this.unsigned)},E.and=function(S){return r(S)||(S=d(S)),u(this.low&S.low,this.high&S.high,this.unsigned)},E.or=function(S){return r(S)||(S=d(S)),u(this.low|S.low,this.high|S.high,this.unsigned)},E.xor=function(S){return r(S)||(S=d(S)),u(this.low^S.low,this.high^S.high,this.unsigned)},E.shiftLeft=function(S){return r(S)&&(S=S.toInt()),(S&=63)===0?this:S<32?u(this.low<>>32-S,this.unsigned):u(0,this.low<>>S|this.high<<32-S,this.high>>S,this.unsigned):u(this.high>>S-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(S){if(r(S)&&(S=S.toInt()),S&=63,S===0)return this;var _=this.high;if(S<32){var O=this.low;return u(O>>>S|_<<32-S,_>>>S,this.unsigned)}else return S===32?u(_,0,this.unsigned):u(_>>>S-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},E.toBytes=function(S){return S?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var S=this.high,_=this.low;return[_&255,_>>>8&255,_>>>16&255,_>>>24,S&255,S>>>8&255,S>>>16&255,S>>>24]},E.toBytesBE=function(){var S=this.high,_=this.low;return[S>>>24,S>>>16&255,S>>>8&255,S&255,_>>>24,_>>>16&255,_>>>8&255,_&255]},n.fromBytes=function(S,_,O){return O?n.fromBytesLE(S,_):n.fromBytesBE(S,_)},n.fromBytesLE=function(S,_){return new n(S[0]|S[1]<<8|S[2]<<16|S[3]<<24,S[4]|S[5]<<8|S[6]<<16|S[7]<<24,_)},n.fromBytesBE=function(S,_){return new n(S[4]<<24|S[5]<<16|S[6]<<8|S[7],S[0]<<24|S[1]<<16|S[2]<<8|S[3],_)}}),WC=Xt(()=>{}),BC=Xt(()=>{}),VC=Xt((e,t)=>{(function(a,n,r){function s(u){var p=this,c=l();p.next=function(){var d=2091639*p.s0+p.c*23283064365386963e-26;return p.s0=p.s1,p.s1=p.s2,p.s2=d-(p.c=d|0)},p.c=1,p.s0=c(" "),p.s1=c(" "),p.s2=c(" "),p.s0-=c(u),p.s0<0&&(p.s0+=1),p.s1-=c(u),p.s1<0&&(p.s1+=1),p.s2-=c(u),p.s2<0&&(p.s2+=1),c=null}function i(u,p){return p.c=u.c,p.s0=u.s0,p.s1=u.s1,p.s2=u.s2,p}function o(u,p){var c=new s(u),d=p&&p.state,h=c.next;return h.int32=function(){return c.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,d&&(typeof d=="object"&&i(d,c),h.state=function(){return i(c,{})}),h}function l(){var u=4022871197,p=function(c){c=String(c);for(var d=0;d>>0,h-=u,h*=u,u=h>>>0,h-=u,u+=h*4294967296}return(u>>>0)*23283064365386963e-26};return p}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),UC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this,p="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var d=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^d^d>>>8},l===(l|0)?u.x=l:p+=l;for(var c=0;c>>0)/4294967296};return d.double=function(){do var h=p.next()>>>11,m=(p.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},d.int32=p.next,d.quick=d,c&&(typeof c=="object"&&i(c,p),d.state=function(){return i(p,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),GC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this,p="";u.next=function(){var d=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(d^d<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:p+=l;for(var c=0;c>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var p=new s(l),c=u&&u.state,d=function(){return(p.next()>>>0)/4294967296};return d.double=function(){do var h=p.next()>>>11,m=(p.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},d.int32=p.next,d.quick=d,c&&(typeof c=="object"&&i(c,p),d.state=function(){return i(p,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),HC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this;u.next=function(){var c=u.x,d=u.i,h,m,f;return h=c[d],h^=h>>>7,m=h^h<<24,h=c[d+1&7],m^=h^h>>>10,h=c[d+3&7],m^=h^h>>>3,h=c[d+4&7],m^=h^h<<7,h=c[d+7&7],h=h^h<<13,m^=h^h<<9,c[d]=m,u.i=d+1&7,m};function p(c,d){var h,m,f=[];if(d===(d|0))m=f[0]=d;else for(d=""+d,h=0;h0;--h)c.next()}p(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var p=new s(l),c=u&&u.state,d=function(){return(p.next()>>>0)/4294967296};return d.double=function(){do var h=p.next()>>>11,m=(p.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},d.int32=p.next,d.quick=d,c&&(c.x&&i(c,p),d.state=function(){return i(p,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),jC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this;u.next=function(){var c=u.w,d=u.X,h=u.i,m,f;return u.w=c=c+1640531527|0,f=d[h+34&127],m=d[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=d[h]=f^m,u.i=h,f+(c^c>>>16)|0};function p(c,d){var h,m,f,g,y,x=[],A=128;for(d===(d|0)?(m=d,d=null):(d=d+"\0",m=0,A=Math.max(A,d.length)),f=0,g=-32;g>>15,m^=m<<4,m^=m>>>13,g>=0&&(y=y+1640531527|0,h=x[g&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(x[(d&&d.length||0)&127]=-1),f=127,g=4*128;g>0;--g)m=x[f+34&127],h=x[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,x[f]=m^h;c.w=y,c.X=x,c.i=f}p(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var p=new s(l),c=u&&u.state,d=function(){return(p.next()>>>0)/4294967296};return d.double=function(){do var h=p.next()>>>11,m=(p.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},d.int32=p.next,d.quick=d,c&&(c.X&&i(c,p),d.state=function(){return i(p,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),qC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this,p="";u.next=function(){var d=u.b,h=u.c,m=u.d,f=u.a;return d=d<<25^d>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-d|0,u.b=d=d<<20^d>>>12^h,u.c=h=h-m|0,u.d=m<<16^h>>>16^f,u.a=f-d|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):p+=l;for(var c=0;c>>0)/4294967296};return d.double=function(){do var h=p.next()>>>11,m=(p.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},d.int32=p.next,d.quick=d,c&&(typeof c=="object"&&i(c,p),d.state=function(){return i(p,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),XC=Xt(()=>{}),KC=Xt((e,t)=>{(function(a,n,r){var s=256,i=6,o=52,l="random",u=r.pow(s,i),p=r.pow(2,o),c=p*2,d=s-1,h;function m(w,I,T){var N=[];I=I==!0?{entropy:!0}:I||{};var M=x(y(I.entropy?[w,b(n)]:w==null?A():w,3),N),P=new f(N),E=function(){for(var S=P.g(i),_=u,O=0;S=c;)S/=2,_/=2,O>>>=1;return(S+O)/_};return E.int32=function(){return P.g(4)|0},E.quick=function(){return P.g(4)/4294967296},E.double=E,x(b(P.S),n),(I.pass||T||function(S,_,O,W){return W&&(W.S&&g(W,P),S.state=function(){return g(P,{})}),O?(r[l]=S,_):S})(E,M,"global"in I?I.global:this==r,I.state)}function f(w){var I,T=w.length,N=this,M=0,P=N.i=N.j=0,E=N.S=[];for(T||(w=[T++]);M{var a=VC(),n=UC(),r=GC(),s=HC(),i=jC(),o=qC(),l=KC();l.alea=a,l.xor128=n,l.xorwow=r,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),cA=Xt(()=>{}),hA=Xt(()=>{}),YC=Xt(()=>{}),ZC=Xt(()=>{}),JC=Xt(()=>{}),QC=Xt((e,t)=>{var a=(()=>{var n=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(n=n||__filename),function(r){r=r||{};function s(){return ie.buffer!=He&&ht(ie.buffer),yt}function i(){return ie.buffer!=He&&ht(ie.buffer),Ha}function o(){return ie.buffer!=He&&ht(ie.buffer),zt}function l(){return ie.buffer!=He&&ht(ie.buffer),oa}function u(){return ie.buffer!=He&&ht(ie.buffer),$a}function p(){return ie.buffer!=He&&ht(ie.buffer),un}function c(){return ie.buffer!=He&&ht(ie.buffer),Fa}var d=typeof r!="undefined"?r:{},h,m;d.ready=new Promise(function(D,j){h=D,m=j});var f;typeof process!="undefined"&&process.listeners&&(f={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var g=Object.assign({},d),y=[],x="./this.program",A=(D,j)=>{throw j},b=typeof window=="object",w=typeof importScripts=="function",I=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",T=d.ENVIRONMENT_IS_PTHREAD||!1,N="";function M(D){return d.locateFile?d.locateFile(D,N):N+D}var P,E,S,_;function O(D){D instanceof $s||H("exiting due to exception: "+D)}if(I){var W=cA(),$=hA();w?N=$.dirname(N)+"/":N=__dirname+"/",P=(j,oe)=>(j=Cl(j)?new URL(j):$.normalize(j),W.readFileSync(j,oe?void 0:"utf8")),S=j=>{var oe=P(j,!0);return oe.buffer||(oe=new Uint8Array(oe)),oe},E=(j,oe,Me)=>{j=Cl(j)?new URL(j):$.normalize(j),W.readFile(j,function(je,Be){je?Me(je):oe(Be.buffer)})},process.argv.length>1&&(x=process.argv[1].replace(/\\/g,"/")),y=process.argv.slice(2),process.on("uncaughtException",function(j){if(!(j instanceof $s))throw j}),process.on("unhandledRejection",function(j){throw j}),A=(j,oe)=>{if(kn())throw process.exitCode=j,oe;O(oe),process.exit(j)},d.inspect=function(){return"[Emscripten Module object]"};let D;try{D=YC()}catch(j){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),j}global.Worker=D.Worker}else(b||w)&&(w?N=self.location.href:typeof document!="undefined"&&document.currentScript&&(N=document.currentScript.src),typeof n!="undefined"&&n&&(N=n),N.indexOf("blob:")!==0?N=N.substr(0,N.replace(/[?#].*/,"").lastIndexOf("/")+1):N="",I||(P=D=>{var j=new XMLHttpRequest;return j.open("GET",D,!1),j.send(null),j.responseText},w&&(S=D=>{var j=new XMLHttpRequest;return j.open("GET",D,!1),j.responseType="arraybuffer",j.send(null),new Uint8Array(j.response)}),E=(D,j,oe)=>{var Me=new XMLHttpRequest;Me.open("GET",D,!0),Me.responseType="arraybuffer",Me.onload=()=>{if(Me.status==200||Me.status==0&&Me.response){j(Me.response);return}oe()},Me.onerror=oe,Me.send(null)}),_=D=>document.title=D);I&&typeof performance=="undefined"&&(global.performance=ZC().performance);var U=console.log.bind(console),G=console.warn.bind(console);I&&(U=D=>W.writeSync(1,D+` -`),G=D=>W.writeSync(2,D+` -`));var q=d.print||U,H=d.printErr||G;Object.assign(d,g),g=null,d.arguments&&(y=d.arguments),d.thisProgram&&(x=d.thisProgram),d.quit&&(A=d.quit);var V=4,Z=Atomics.load,X=Atomics.store,re=Atomics.compareExchange,ee;d.wasmBinary&&(ee=d.wasmBinary);var ge=d.noExitRuntime||!0;typeof WebAssembly!="object"&&_s("no native wasm support detected");var ie,be,Ce=!1,Re;function Le(D,j){D||_s(j)}var qe=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function ft(D,j,oe){j>>>=0;for(var Me=j+oe,je=j;D[je]&&!(je>=Me);)++je;if(je-j>16&&D.buffer&&qe)return qe.decode(D.buffer instanceof SharedArrayBuffer?D.slice(j,je):D.subarray(j,je));for(var Be="";j>10,56320|pn&1023)}}return Be}function dt(D,j){return D>>>=0,D?ft(i(),D,j):""}function st(D,j,oe,Me){if(oe>>>=0,!(Me>0))return 0;for(var je=oe,Be=oe+Me-1,ye=0;ye=55296&&Ne<=57343){var Tt=D.charCodeAt(++ye);Ne=65536+((Ne&1023)<<10)|Tt&1023}if(Ne<=127){if(oe>=Be)break;j[oe++>>>0]=Ne}else if(Ne<=2047){if(oe+1>=Be)break;j[oe++>>>0]=192|Ne>>6,j[oe++>>>0]=128|Ne&63}else if(Ne<=65535){if(oe+2>=Be)break;j[oe++>>>0]=224|Ne>>12,j[oe++>>>0]=128|Ne>>6&63,j[oe++>>>0]=128|Ne&63}else{if(oe+3>=Be)break;j[oe++>>>0]=240|Ne>>18,j[oe++>>>0]=128|Ne>>12&63,j[oe++>>>0]=128|Ne>>6&63,j[oe++>>>0]=128|Ne&63}}return j[oe>>>0]=0,oe-je}function it(D,j,oe){return st(D,i(),j,oe)}var He,yt,Ha,zt,ln,oa,$a,un,Fa;T&&(He=d.buffer);function ht(D){He=D,d.HEAP8=yt=new Int8Array(D),d.HEAP16=zt=new Int16Array(D),d.HEAP32=oa=new Int32Array(D),d.HEAPU8=Ha=new Uint8Array(D),d.HEAPU16=ln=new Uint16Array(D),d.HEAPU32=$a=new Uint32Array(D),d.HEAPF32=un=new Float32Array(D),d.HEAPF64=Fa=new Float64Array(D)}var Da=d.INITIAL_MEMORY||16777216;if(T)ie=d.wasmMemory,He=d.buffer;else if(d.wasmMemory)ie=d.wasmMemory;else if(ie=new WebAssembly.Memory({initial:Da/65536,maximum:65536,shared:!0}),!(ie.buffer instanceof SharedArrayBuffer))throw H("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"),I&&H("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");ie&&(He=ie.buffer),Da=He.byteLength,ht(He);var ja,hr=[],Il=[],Hn=[],cd=!1;function kn(){return ge}function Dr(){if(d.preRun)for(typeof d.preRun=="function"&&(d.preRun=[d.preRun]);d.preRun.length;)dm(d.preRun.shift());md(hr)}function Yt(){cd=!0,!T&&md(Il)}function gc(){if(!T){if(d.postRun)for(typeof d.postRun=="function"&&(d.postRun=[d.postRun]);d.postRun.length;)Mx(d.postRun.shift());md(Hn)}}function dm(D){hr.unshift(D)}function pm(D){Il.unshift(D)}function Mx(D){Hn.unshift(D)}var Or=0,Sl=null,mr=null;function cm(D){Or++,d.monitorRunDependencies&&d.monitorRunDependencies(Or)}function yc(D){if(Or--,d.monitorRunDependencies&&d.monitorRunDependencies(Or),Or==0&&(Sl!==null&&(clearInterval(Sl),Sl=null),mr)){var j=mr;mr=null,j()}}function _s(D){d.onAbort&&d.onAbort(D),D="Aborted("+D+")",H(D),Ce=!0,Re=1,D+=". Build with -sASSERTIONS for more info.";var j=new WebAssembly.RuntimeError(D);throw m(j),j}var hm="data:application/octet-stream;base64,";function xc(D){return D.startsWith(hm)}function Cl(D){return D.startsWith("file://")}var ma;ma="tfjs-backend-wasm-threaded-simd.wasm",xc(ma)||(ma=M(ma));function Ac(D){try{if(D==ma&&ee)return new Uint8Array(ee);if(S)return S(D);throw"both async and sync fetching of the wasm failed"}catch(j){_s(j)}}function mm(){if(!ee&&(b||w)){if(typeof fetch=="function"&&!Cl(ma))return fetch(ma,{credentials:"same-origin"}).then(function(D){if(!D.ok)throw"failed to load wasm binary file at '"+ma+"'";return D.arrayBuffer()}).catch(function(){return Ac(ma)});if(E)return new Promise(function(D,j){E(ma,function(oe){D(new Uint8Array(oe))},j)})}return Promise.resolve().then(function(){return Ac(ma)})}function fm(){var D={env:Pc,wasi_snapshot_preview1:Pc};function j(ye,Ne){var Tt=ye.exports;if(d.asm=Tt,Im(d.asm._emscripten_tls_init),ja=d.asm.__indirect_function_table,pm(d.asm.__wasm_call_ctors),be=Ne,!T){var pn=We.unusedWorkers.length;We.unusedWorkers.forEach(function(gr){We.loadWasmModuleToWorker(gr,function(){--pn||yc("wasm-instantiate")})})}}T||cm("wasm-instantiate");function oe(ye){j(ye.instance,ye.module)}function Me(ye){return mm().then(function(Ne){return WebAssembly.instantiate(Ne,D)}).then(function(Ne){return Ne}).then(ye,function(Ne){H("failed to asynchronously prepare wasm: "+Ne),_s(Ne)})}function je(){return!ee&&typeof WebAssembly.instantiateStreaming=="function"&&!xc(ma)&&!Cl(ma)&&!I&&typeof fetch=="function"?fetch(ma,{credentials:"same-origin"}).then(function(ye){var Ne=WebAssembly.instantiateStreaming(ye,D);return Ne.then(oe,function(Tt){return H("wasm streaming compile failed: "+Tt),H("falling back to ArrayBuffer instantiation"),Me(oe)})}):Me(oe)}if(d.instantiateWasm)try{var Be=d.instantiateWasm(D,j);return Be}catch(ye){H("Module.instantiateWasm callback failed with error: "+ye),m(ye)}return je().catch(m),{}}var Px,_x,bc={};function $s(D){this.name="ExitStatus",this.message="Program terminated with exit("+D+")",this.status=D}function gm(D){var j=We.pthreads[D];delete We.pthreads[D],j.terminate(),B2(D),We.runningWorkers.splice(We.runningWorkers.indexOf(j),1),j.pthread_ptr=0}function ym(D){var j=We.pthreads[D];j.postMessage({cmd:"cancel"})}function hd(D){var j=We.pthreads[D];Le(j),We.returnWorkerToPool(j)}function xm(D){var j=We.getNewWorker();if(!j)return 6;We.runningWorkers.push(j),We.pthreads[D.pthread_ptr]=j,j.pthread_ptr=D.pthread_ptr;var oe={cmd:"run",start_routine:D.startRoutine,arg:D.arg,pthread_ptr:D.pthread_ptr};return j.runPthread=()=>{I&&j.ref(),j.postMessage(oe,D.transferList),delete j.runPthread},j.loaded&&j.runPthread(),0}var vc={varargs:void 0,get:function(){vc.varargs+=4;var D=l()[vc.varargs-4>>>2];return D},getStr:function(D){var j=dt(D);return j}};function wc(D){if(T)return zr(1,1,D);Re=D,kn()||(We.terminateAllThreads(),d.onExit&&d.onExit(D),Ce=!0),A(D,new $s(D))}function Am(D,j){if(Re=D,!j&&T)throw Ic(D),"unwind";wc(D)}var kc=Am;function bm(D){if(D instanceof $s||D=="unwind")return Re;A(1,D)}var We={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){T?We.initWorker():We.initMainThread()},initMainThread:function(){for(var D=8;D--;)We.allocateUnusedWorker()},initWorker:function(){ge=!1},setExitStatus:function(D){Re=D},terminateAllThreads:function(){for(var D of Object.values(We.pthreads))We.returnWorkerToPool(D);for(var D of We.unusedWorkers)D.terminate();We.unusedWorkers=[]},returnWorkerToPool:function(D){var j=D.pthread_ptr;delete We.pthreads[j],We.unusedWorkers.push(D),We.runningWorkers.splice(We.runningWorkers.indexOf(D),1),D.pthread_ptr=0,I&&D.unref(),B2(j)},receiveObjectTransfer:function(D){},threadInitTLS:function(){We.tlsInitFunctions.forEach(D=>D())},loadWasmModuleToWorker:function(D,j){D.onmessage=Be=>{var ye=Be.data,Ne=ye.cmd;if(D.pthread_ptr&&(We.currentProxiedOperationCallerThread=D.pthread_ptr),ye.targetThread&&ye.targetThread!=zc()){var Tt=We.pthreads[ye.targetThread];Tt?Tt.postMessage(ye,ye.transferList):H('Internal error! Worker sent a message "'+Ne+'" to target pthread '+ye.targetThread+", but that thread no longer exists!"),We.currentProxiedOperationCallerThread=void 0;return}Ne==="processProxyingQueue"?fd(ye.queue):Ne==="spawnThread"?xm(ye):Ne==="cleanupThread"?hd(ye.thread):Ne==="killThread"?gm(ye.thread):Ne==="cancelThread"?ym(ye.thread):Ne==="loaded"?(D.loaded=!0,I&&D.unref(),j&&j(D),D.runPthread&&D.runPthread()):Ne==="print"?q("Thread "+ye.threadId+": "+ye.text):Ne==="printErr"?H("Thread "+ye.threadId+": "+ye.text):Ne==="alert"?alert("Thread "+ye.threadId+": "+ye.text):ye.target==="setimmediate"?D.postMessage(ye):Ne==="callHandler"?d[ye.handler](...ye.args):Ne&&H("worker sent an unknown command "+Ne),We.currentProxiedOperationCallerThread=void 0},D.onerror=Be=>{var ye="worker sent an error!";throw H(ye+" "+Be.filename+":"+Be.lineno+": "+Be.message),Be},I&&(D.on("message",function(Be){D.onmessage({data:Be})}),D.on("error",function(Be){D.onerror(Be)}),D.on("detachedExit",function(){}));var oe=[],Me=["onExit","onAbort","print","printErr"];for(var je of Me)d.hasOwnProperty(je)&&oe.push(je);D.postMessage({cmd:"load",handlers:oe,urlOrBlob:d.mainScriptUrlOrBlob||n,wasmMemory:ie,wasmModule:be})},allocateUnusedWorker:function(){var D,j=M("tfjs-backend-wasm-threaded-simd.worker.js");D=new Worker(j),We.unusedWorkers.push(D)},getNewWorker:function(){return We.unusedWorkers.length==0&&(We.allocateUnusedWorker(),We.loadWasmModuleToWorker(We.unusedWorkers[0])),We.unusedWorkers.pop()}};d.PThread=We;function md(D){for(;D.length>0;)D.shift()(d)}function vm(){var D=zc(),j=l()[D+52>>>2],oe=l()[D+56>>>2],Me=j-oe;Lx(j,Me),Lc(j)}d.establishStackSpace=vm;function Ic(D){if(T)return zr(2,0,D);try{kc(D)}catch(j){bm(j)}}var Tl=[];function wm(D){var j=Tl[D];return j||(D>=Tl.length&&(Tl.length=D+1),Tl[D]=j=ja.get(D)),j}function km(D,j){var oe=wm(D)(j);kn()?We.setExitStatus(oe):zx(oe)}d.invokeEntryPoint=km;function Im(D){We.tlsInitFunctions.push(D)}function Sm(D){Fx(D,!w,1,!b),We.threadInitTLS()}function Cm(D){T?postMessage({cmd:"cleanupThread",thread:D}):hd(D)}function Sc(D,j,oe,Me){return T?zr(3,1,D,j,oe,Me):Cc(D,j,oe,Me)}function Cc(D,j,oe,Me){if(typeof SharedArrayBuffer=="undefined")return H("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var je=[],Be=0;if(T&&(je.length===0||Be))return Sc(D,j,oe,Me);if(Be)return Be;var ye={startRoutine:oe,pthread_ptr:D,arg:Me,transferList:je};return T?(ye.cmd="spawnThread",postMessage(ye,je),0):xm(ye)}function Tm(){return 65536}var Nm=!0;function Rm(){return Nm}function fd(D){Atomics.store(l(),D>>2,1),zc()&&Ox(D),Atomics.compareExchange(l(),D>>2,1,0)}d.executeNotifiedProxyingQueue=fd;function Em(D,j,oe,Me){if(D==j)setTimeout(()=>fd(Me));else if(T)postMessage({targetThread:D,cmd:"processProxyingQueue",queue:Me});else{var je=We.pthreads[D];if(!je)return;je.postMessage({cmd:"processProxyingQueue",queue:Me})}return 1}function Mm(D,j,oe){return-1}function Pm(){_s("")}function Fs(D){Fs.shown||(Fs.shown={}),Fs.shown[D]||(Fs.shown[D]=1,I&&(D="warning: "+D),H(D))}function _m(){I||w||Fs("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function $m(){return Date.now()}function Tc(){return 4294901760}function Fm(){return Tc()}var gd;I?gd=()=>{var D=process.hrtime();return D[0]*1e3+D[1]/1e6}:gd=()=>performance.timeOrigin+performance.now();function Dm(D,j,oe){i().copyWithin(D>>>0,j>>>0,j+oe>>>0)}function Om(){return I?JC().cpus().length:navigator.hardwareConcurrency}function zm(D){var j=V2(),oe=D();return Lc(j),oe}function zr(D,j){var oe=arguments.length-2,Me=arguments;return zm(()=>{for(var je=oe,Be=Wc(je*8),ye=Be>>3,Ne=0;Ne>>0]=Tt}return Dx(D,je,Be,j)})}var yd=[];function Lm(D,j,oe){yd.length=j;for(var Me=oe>>3,je=0;je>>0];var Be=D<0,ye=Be?bc[-D-1]:Xm[D];return ye.apply(null,yd)}function Wm(D){try{return ie.grow(D-He.byteLength+65535>>>16),ht(ie.buffer),1}catch(j){}}function Bm(D){var j=i().length;if(D=D>>>0,D<=j)return!1;var oe=Tc();if(D>oe)return!1;let Me=(Tt,pn)=>Tt+(pn-Tt%pn)%pn;for(var je=1;je<=4;je*=2){var Be=j*(1+.2/je);Be=Math.min(Be,D+100663296);var ye=Math.min(oe,Me(Math.max(D,Be),65536)),Ne=Wm(ye);if(Ne)return!0}return!1}function Vm(){throw"unwind"}function Nc(D){return T?zr(4,1,D):52}function Rc(D,j,oe,Me,je){return T?zr(5,1,D,j,oe,Me,je):70}var Um=[null,[],[]];function Gm(D,j){var oe=Um[D];j===0||j===10?((D===1?q:H)(ft(oe,0)),oe.length=0):oe.push(j)}function Ec(D,j,oe,Me){if(T)return zr(6,1,D,j,oe,Me);for(var je=0,Be=0;Be>>2],Ne=u()[j+4>>>2];j+=8;for(var Tt=0;Tt>>0]);je+=Ne}return u()[Me>>>2]=je,0}function Mc(D){var j=d["_"+D];return j}function Hm(D,j){s().set(D,j>>>0)}function jm(D,j,oe,Me,je){var Be={string:cn=>{var Ml=0;if(cn!=null&&cn!==0){var Vx=(cn.length<<2)+1;Ml=Wc(Vx),it(cn,Ml,Vx)}return Ml},array:cn=>{var Ml=Wc(cn.length);return Hm(cn,Ml),Ml}};function ye(cn){return j==="string"?dt(cn):j==="boolean"?!!cn:cn}var Ne=Mc(D),Tt=[],pn=0;if(Me)for(var gr=0;grye==="number"||ye==="boolean"),Be=j!=="string";return Be&&je&&!Me?Mc(D):function(){return jm(D,j,oe,arguments,Me)}}We.init();var Xm=[null,wc,Ic,Sc,Nc,Rc,Ec],Pc={__emscripten_init_main_thread_js:Sm,__emscripten_thread_cleanup:Cm,__pthread_create_js:Cc,_emscripten_default_pthread_stack_size:Tm,_emscripten_get_now_is_monotonic:Rm,_emscripten_notify_task_queue:Em,_emscripten_set_offscreencanvas_size:Mm,abort:Pm,emscripten_check_blocking_allowed:_m,emscripten_date_now:$m,emscripten_get_heap_max:Fm,emscripten_get_now:gd,emscripten_memcpy_big:Dm,emscripten_num_logical_cores:Om,emscripten_receive_on_main_thread_js:Lm,emscripten_resize_heap:Bm,emscripten_unwind_to_js_event_loop:Vm,exit:kc,fd_close:Nc,fd_seek:Rc,fd_write:Ec,memory:ie||d.wasmMemory},$x=fm(),Km=d.___wasm_call_ctors=function(){return(Km=d.___wasm_call_ctors=d.asm.__wasm_call_ctors).apply(null,arguments)},Ym=d._init=function(){return(Ym=d._init=d.asm.init).apply(null,arguments)},Zm=d._init_with_threads_count=function(){return(Zm=d._init_with_threads_count=d.asm.init_with_threads_count).apply(null,arguments)},Jm=d._get_threads_count=function(){return(Jm=d._get_threads_count=d.asm.get_threads_count).apply(null,arguments)},Qm=d._register_tensor=function(){return(Qm=d._register_tensor=d.asm.register_tensor).apply(null,arguments)},ef=d._dispose_data=function(){return(ef=d._dispose_data=d.asm.dispose_data).apply(null,arguments)},tf=d._dispose=function(){return(tf=d._dispose=d.asm.dispose).apply(null,arguments)},af=d._Abs=function(){return(af=d._Abs=d.asm.Abs).apply(null,arguments)},nf=d._Acos=function(){return(nf=d._Acos=d.asm.Acos).apply(null,arguments)},rf=d._Acosh=function(){return(rf=d._Acosh=d.asm.Acosh).apply(null,arguments)},sf=d._Add=function(){return(sf=d._Add=d.asm.Add).apply(null,arguments)},of=d._AddN=function(){return(of=d._AddN=d.asm.AddN).apply(null,arguments)},lf=d._All=function(){return(lf=d._All=d.asm.All).apply(null,arguments)},uf=d._Any=function(){return(uf=d._Any=d.asm.Any).apply(null,arguments)},df=d._ArgMax=function(){return(df=d._ArgMax=d.asm.ArgMax).apply(null,arguments)},pf=d._ArgMin=function(){return(pf=d._ArgMin=d.asm.ArgMin).apply(null,arguments)},cf=d._Asin=function(){return(cf=d._Asin=d.asm.Asin).apply(null,arguments)},hf=d._Asinh=function(){return(hf=d._Asinh=d.asm.Asinh).apply(null,arguments)},mf=d._Atan=function(){return(mf=d._Atan=d.asm.Atan).apply(null,arguments)},ff=d._Atan2=function(){return(ff=d._Atan2=d.asm.Atan2).apply(null,arguments)},gf=d._Atanh=function(){return(gf=d._Atanh=d.asm.Atanh).apply(null,arguments)},yf=d._AvgPool=function(){return(yf=d._AvgPool=d.asm.AvgPool).apply(null,arguments)},xf=d._AvgPool3D=function(){return(xf=d._AvgPool3D=d.asm.AvgPool3D).apply(null,arguments)},Af=d._AvgPool3DGrad=function(){return(Af=d._AvgPool3DGrad=d.asm.AvgPool3DGrad).apply(null,arguments)},bf=d._AvgPoolGrad=function(){return(bf=d._AvgPoolGrad=d.asm.AvgPoolGrad).apply(null,arguments)},vf=d._BatchMatMul=function(){return(vf=d._BatchMatMul=d.asm.BatchMatMul).apply(null,arguments)},wf=d._Bincount=function(){return(wf=d._Bincount=d.asm.Bincount).apply(null,arguments)},kf=d._BitwiseAnd=function(){return(kf=d._BitwiseAnd=d.asm.BitwiseAnd).apply(null,arguments)},If=d._Ceil=function(){return(If=d._Ceil=d.asm.Ceil).apply(null,arguments)},Sf=d._ClipByValue=function(){return(Sf=d._ClipByValue=d.asm.ClipByValue).apply(null,arguments)},Cf=d._Conv2D=function(){return(Cf=d._Conv2D=d.asm.Conv2D).apply(null,arguments)},Tf=d._Conv2DBackpropInput=function(){return(Tf=d._Conv2DBackpropInput=d.asm.Conv2DBackpropInput).apply(null,arguments)},Nf=d._Conv3D=function(){return(Nf=d._Conv3D=d.asm.Conv3D).apply(null,arguments)},Rf=d._Conv3DBackpropFilterV2=function(){return(Rf=d._Conv3DBackpropFilterV2=d.asm.Conv3DBackpropFilterV2).apply(null,arguments)},Ef=d._Conv3DBackpropInputV2=function(){return(Ef=d._Conv3DBackpropInputV2=d.asm.Conv3DBackpropInputV2).apply(null,arguments)},Mf=d._Cos=function(){return(Mf=d._Cos=d.asm.Cos).apply(null,arguments)},Pf=d._Cosh=function(){return(Pf=d._Cosh=d.asm.Cosh).apply(null,arguments)},_f=d._CropAndResize=function(){return(_f=d._CropAndResize=d.asm.CropAndResize).apply(null,arguments)},$f=d._Cumprod=function(){return($f=d._Cumprod=d.asm.Cumprod).apply(null,arguments)},Ff=d._Cumsum=function(){return(Ff=d._Cumsum=d.asm.Cumsum).apply(null,arguments)},Df=d._DenseBincount=function(){return(Df=d._DenseBincount=d.asm.DenseBincount).apply(null,arguments)},Of=d._DepthToSpace=function(){return(Of=d._DepthToSpace=d.asm.DepthToSpace).apply(null,arguments)},zf=d._DepthwiseConv2dNative=function(){return(zf=d._DepthwiseConv2dNative=d.asm.DepthwiseConv2dNative).apply(null,arguments)},Lf=d._Diag=function(){return(Lf=d._Diag=d.asm.Diag).apply(null,arguments)},Wf=d._Dilation2D=function(){return(Wf=d._Dilation2D=d.asm.Dilation2D).apply(null,arguments)},Bf=d._Dilation2DBackpropFilter=function(){return(Bf=d._Dilation2DBackpropFilter=d.asm.Dilation2DBackpropFilter).apply(null,arguments)},Vf=d._Dilation2DBackpropInput=function(){return(Vf=d._Dilation2DBackpropInput=d.asm.Dilation2DBackpropInput).apply(null,arguments)},Uf=d._Elu=function(){return(Uf=d._Elu=d.asm.Elu).apply(null,arguments)},Gf=d._EluGrad=function(){return(Gf=d._EluGrad=d.asm.EluGrad).apply(null,arguments)},Hf=d._Equal=function(){return(Hf=d._Equal=d.asm.Equal).apply(null,arguments)},jf=d._Erf=function(){return(jf=d._Erf=d.asm.Erf).apply(null,arguments)},qf=d._Exp=function(){return(qf=d._Exp=d.asm.Exp).apply(null,arguments)},Xf=d._Expm1=function(){return(Xf=d._Expm1=d.asm.Expm1).apply(null,arguments)},Kf=d._FlipLeftRight=function(){return(Kf=d._FlipLeftRight=d.asm.FlipLeftRight).apply(null,arguments)},Yf=d._Floor=function(){return(Yf=d._Floor=d.asm.Floor).apply(null,arguments)},Zf=d._FloorDiv=function(){return(Zf=d._FloorDiv=d.asm.FloorDiv).apply(null,arguments)},Jf=d._FusedBatchNorm=function(){return(Jf=d._FusedBatchNorm=d.asm.FusedBatchNorm).apply(null,arguments)},Qf=d._FusedConv2D=function(){return(Qf=d._FusedConv2D=d.asm.FusedConv2D).apply(null,arguments)},e2=d._FusedDepthwiseConv2D=function(){return(e2=d._FusedDepthwiseConv2D=d.asm.FusedDepthwiseConv2D).apply(null,arguments)},t2=d._Gather=function(){return(t2=d._Gather=d.asm.Gather).apply(null,arguments)},a2=d._GatherNd=function(){return(a2=d._GatherNd=d.asm.GatherNd).apply(null,arguments)},n2=d._Greater=function(){return(n2=d._Greater=d.asm.Greater).apply(null,arguments)},r2=d._GreaterEqual=function(){return(r2=d._GreaterEqual=d.asm.GreaterEqual).apply(null,arguments)},s2=d._IsFinite=function(){return(s2=d._IsFinite=d.asm.IsFinite).apply(null,arguments)},i2=d._IsInf=function(){return(i2=d._IsInf=d.asm.IsInf).apply(null,arguments)},o2=d._IsNan=function(){return(o2=d._IsNan=d.asm.IsNan).apply(null,arguments)},l2=d._LRN=function(){return(l2=d._LRN=d.asm.LRN).apply(null,arguments)},u2=d._LRNGrad=function(){return(u2=d._LRNGrad=d.asm.LRNGrad).apply(null,arguments)},d2=d._LeakyRelu=function(){return(d2=d._LeakyRelu=d.asm.LeakyRelu).apply(null,arguments)},p2=d._Less=function(){return(p2=d._Less=d.asm.Less).apply(null,arguments)},c2=d._LessEqual=function(){return(c2=d._LessEqual=d.asm.LessEqual).apply(null,arguments)},h2=d._LinSpace=function(){return(h2=d._LinSpace=d.asm.LinSpace).apply(null,arguments)},m2=d._Log=function(){return(m2=d._Log=d.asm.Log).apply(null,arguments)},f2=d._Log1p=function(){return(f2=d._Log1p=d.asm.Log1p).apply(null,arguments)},g2=d._LogicalAnd=function(){return(g2=d._LogicalAnd=d.asm.LogicalAnd).apply(null,arguments)},y2=d._LogicalNot=function(){return(y2=d._LogicalNot=d.asm.LogicalNot).apply(null,arguments)},x2=d._LogicalOr=function(){return(x2=d._LogicalOr=d.asm.LogicalOr).apply(null,arguments)},A2=d._LogicalXor=function(){return(A2=d._LogicalXor=d.asm.LogicalXor).apply(null,arguments)},b2=d._Max=function(){return(b2=d._Max=d.asm.Max).apply(null,arguments)},v2=d._MaxPool=function(){return(v2=d._MaxPool=d.asm.MaxPool).apply(null,arguments)},w2=d._MaxPool3D=function(){return(w2=d._MaxPool3D=d.asm.MaxPool3D).apply(null,arguments)},k2=d._MaxPool3DGrad=function(){return(k2=d._MaxPool3DGrad=d.asm.MaxPool3DGrad).apply(null,arguments)},I2=d._MaxPoolGrad=function(){return(I2=d._MaxPoolGrad=d.asm.MaxPoolGrad).apply(null,arguments)},S2=d._MaxPoolWithArgmax=function(){return(S2=d._MaxPoolWithArgmax=d.asm.MaxPoolWithArgmax).apply(null,arguments)},C2=d._Maximum=function(){return(C2=d._Maximum=d.asm.Maximum).apply(null,arguments)},T2=d._Mean=function(){return(T2=d._Mean=d.asm.Mean).apply(null,arguments)},N2=d._Min=function(){return(N2=d._Min=d.asm.Min).apply(null,arguments)},R2=d._Minimum=function(){return(R2=d._Minimum=d.asm.Minimum).apply(null,arguments)},E2=d._MirrorPad=function(){return(E2=d._MirrorPad=d.asm.MirrorPad).apply(null,arguments)},M2=d._Mod=function(){return(M2=d._Mod=d.asm.Mod).apply(null,arguments)},P2=d._Multinomial=function(){return(P2=d._Multinomial=d.asm.Multinomial).apply(null,arguments)},_2=d._Multiply=function(){return(_2=d._Multiply=d.asm.Multiply).apply(null,arguments)},$2=d._Neg=function(){return($2=d._Neg=d.asm.Neg).apply(null,arguments)},F2=d._NonMaxSuppressionV3=function(){return(F2=d._NonMaxSuppressionV3=d.asm.NonMaxSuppressionV3).apply(null,arguments)},D2=d._NonMaxSuppressionV4=function(){return(D2=d._NonMaxSuppressionV4=d.asm.NonMaxSuppressionV4).apply(null,arguments)},_c=d._NonMaxSuppressionV5=function(){return(_c=d._NonMaxSuppressionV5=d.asm.NonMaxSuppressionV5).apply(null,arguments)},$c=d._NotEqual=function(){return($c=d._NotEqual=d.asm.NotEqual).apply(null,arguments)},xd=d._OneHot=function(){return(xd=d._OneHot=d.asm.OneHot).apply(null,arguments)},O2=d._PadV2=function(){return(O2=d._PadV2=d.asm.PadV2).apply(null,arguments)},z2=d._Pow=function(){return(z2=d._Pow=d.asm.Pow).apply(null,arguments)},Nl=d._Prelu=function(){return(Nl=d._Prelu=d.asm.Prelu).apply(null,arguments)},Fc=d._Prod=function(){return(Fc=d._Prod=d.asm.Prod).apply(null,arguments)},Rl=d._RealDiv=function(){return(Rl=d._RealDiv=d.asm.RealDiv).apply(null,arguments)},El=d._Reciprocal=function(){return(El=d._Reciprocal=d.asm.Reciprocal).apply(null,arguments)},L2=d._Relu=function(){return(L2=d._Relu=d.asm.Relu).apply(null,arguments)},Y=d._Relu6=function(){return(Y=d._Relu6=d.asm.Relu6).apply(null,arguments)},se=d._ResizeBilinear=function(){return(se=d._ResizeBilinear=d.asm.ResizeBilinear).apply(null,arguments)},Ee=d._ResizeBilinearGrad=function(){return(Ee=d._ResizeBilinearGrad=d.asm.ResizeBilinearGrad).apply(null,arguments)},et=d._ResizeNearestNeighbor=function(){return(et=d._ResizeNearestNeighbor=d.asm.ResizeNearestNeighbor).apply(null,arguments)},wt=d._ResizeNearestNeighborGrad=function(){return(wt=d._ResizeNearestNeighborGrad=d.asm.ResizeNearestNeighborGrad).apply(null,arguments)},kt=d._Reverse=function(){return(kt=d._Reverse=d.asm.Reverse).apply(null,arguments)},Je=d._RotateWithOffset=function(){return(Je=d._RotateWithOffset=d.asm.RotateWithOffset).apply(null,arguments)},Ye=d._Round=function(){return(Ye=d._Round=d.asm.Round).apply(null,arguments)},Lt=d._Rsqrt=function(){return(Lt=d._Rsqrt=d.asm.Rsqrt).apply(null,arguments)},dn=d._ScatterNd=function(){return(dn=d._ScatterNd=d.asm.ScatterNd).apply(null,arguments)},fr=d._SearchSorted=function(){return(fr=d._SearchSorted=d.asm.SearchSorted).apply(null,arguments)},Dc=d._SelectV2=function(){return(Dc=d._SelectV2=d.asm.SelectV2).apply(null,arguments)},Ad=d._Selu=function(){return(Ad=d._Selu=d.asm.Selu).apply(null,arguments)},W2=d._Sigmoid=function(){return(W2=d._Sigmoid=d.asm.Sigmoid).apply(null,arguments)},Oa=d._Sign=function(){return(Oa=d._Sign=d.asm.Sign).apply(null,arguments)},Lr=d._Sin=function(){return(Lr=d._Sin=d.asm.Sin).apply(null,arguments)},Oc=d._Sinh=function(){return(Oc=d._Sinh=d.asm.Sinh).apply(null,arguments)},XS=d._Softmax=function(){return(XS=d._Softmax=d.asm.Softmax).apply(null,arguments)},KS=d._Softplus=function(){return(KS=d._Softplus=d.asm.Softplus).apply(null,arguments)},YS=d._SparseFillEmptyRows=function(){return(YS=d._SparseFillEmptyRows=d.asm.SparseFillEmptyRows).apply(null,arguments)},ZS=d._SparseReshape=function(){return(ZS=d._SparseReshape=d.asm.SparseReshape).apply(null,arguments)},JS=d._SparseSegmentReduction=function(){return(JS=d._SparseSegmentReduction=d.asm.SparseSegmentReduction).apply(null,arguments)},QS=d._SparseToDense=function(){return(QS=d._SparseToDense=d.asm.SparseToDense).apply(null,arguments)},eC=d._Sqrt=function(){return(eC=d._Sqrt=d.asm.Sqrt).apply(null,arguments)},tC=d._Square=function(){return(tC=d._Square=d.asm.Square).apply(null,arguments)},aC=d._SquaredDifference=function(){return(aC=d._SquaredDifference=d.asm.SquaredDifference).apply(null,arguments)},nC=d._Step=function(){return(nC=d._Step=d.asm.Step).apply(null,arguments)},rC=d._StridedSlice=function(){return(rC=d._StridedSlice=d.asm.StridedSlice).apply(null,arguments)},sC=d._Sub=function(){return(sC=d._Sub=d.asm.Sub).apply(null,arguments)},iC=d._Sum=function(){return(iC=d._Sum=d.asm.Sum).apply(null,arguments)},oC=d._Tan=function(){return(oC=d._Tan=d.asm.Tan).apply(null,arguments)},lC=d._Tanh=function(){return(lC=d._Tanh=d.asm.Tanh).apply(null,arguments)},uC=d._TensorScatterUpdate=function(){return(uC=d._TensorScatterUpdate=d.asm.TensorScatterUpdate).apply(null,arguments)},dC=d._Tile=function(){return(dC=d._Tile=d.asm.Tile).apply(null,arguments)},pC=d._TopK=function(){return(pC=d._TopK=d.asm.TopK).apply(null,arguments)},cC=d._Transform=function(){return(cC=d._Transform=d.asm.Transform).apply(null,arguments)},hC=d._Transpose=function(){return(hC=d._Transpose=d.asm.Transpose).apply(null,arguments)},mC=d.__FusedMatMul=function(){return(mC=d.__FusedMatMul=d.asm._FusedMatMul).apply(null,arguments)},fC=d._malloc=function(){return(fC=d._malloc=d.asm.malloc).apply(null,arguments)},gC=d._free=function(){return(gC=d._free=d.asm.free).apply(null,arguments)},yC=d.__emscripten_tls_init=function(){return(yC=d.__emscripten_tls_init=d.asm._emscripten_tls_init).apply(null,arguments)},zc=d._pthread_self=function(){return(zc=d._pthread_self=d.asm.pthread_self).apply(null,arguments)},xC=d.___errno_location=function(){return(xC=d.___errno_location=d.asm.__errno_location).apply(null,arguments)},Fx=d.__emscripten_thread_init=function(){return(Fx=d.__emscripten_thread_init=d.asm._emscripten_thread_init).apply(null,arguments)},AC=d.__emscripten_thread_crashed=function(){return(AC=d.__emscripten_thread_crashed=d.asm._emscripten_thread_crashed).apply(null,arguments)},bC=d._emscripten_main_thread_process_queued_calls=function(){return(bC=d._emscripten_main_thread_process_queued_calls=d.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},vC=d._emscripten_main_browser_thread_id=function(){return(vC=d._emscripten_main_browser_thread_id=d.asm.emscripten_main_browser_thread_id).apply(null,arguments)},Dx=d._emscripten_run_in_main_runtime_thread_js=function(){return(Dx=d._emscripten_run_in_main_runtime_thread_js=d.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)},wC=d._emscripten_dispatch_to_thread_=function(){return(wC=d._emscripten_dispatch_to_thread_=d.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},Ox=d.__emscripten_proxy_execute_task_queue=function(){return(Ox=d.__emscripten_proxy_execute_task_queue=d.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)},B2=d.__emscripten_thread_free_data=function(){return(B2=d.__emscripten_thread_free_data=d.asm._emscripten_thread_free_data).apply(null,arguments)},zx=d.__emscripten_thread_exit=function(){return(zx=d.__emscripten_thread_exit=d.asm._emscripten_thread_exit).apply(null,arguments)},Lx=d._emscripten_stack_set_limits=function(){return(Lx=d._emscripten_stack_set_limits=d.asm.emscripten_stack_set_limits).apply(null,arguments)},V2=d.stackSave=function(){return(V2=d.stackSave=d.asm.stackSave).apply(null,arguments)},Lc=d.stackRestore=function(){return(Lc=d.stackRestore=d.asm.stackRestore).apply(null,arguments)},Wc=d.stackAlloc=function(){return(Wc=d.stackAlloc=d.asm.stackAlloc).apply(null,arguments)},kC=d.dynCall_iijjiiii=function(){return(kC=d.dynCall_iijjiiii=d.asm.dynCall_iijjiiii).apply(null,arguments)},IC=d.dynCall_jiji=function(){return(IC=d.dynCall_jiji=d.asm.dynCall_jiji).apply(null,arguments)};d.keepRuntimeAlive=kn,d.wasmMemory=ie,d.cwrap=qm,d.ExitStatus=$s,d.PThread=We;var Bc;mr=function D(){Bc||Wx(),Bc||(mr=D)};function Wx(D){if(D=D||y,Or>0)return;if(T){h(d),Yt(),startWorker(d);return}if(Dr(),Or>0)return;function j(){Bc||(Bc=!0,d.calledRun=!0,!Ce&&(Yt(),h(d),d.onRuntimeInitialized&&d.onRuntimeInitialized(),gc()))}d.setStatus?(d.setStatus("Running..."),setTimeout(function(){setTimeout(function(){d.setStatus("")},1),j()},1)):j()}if(d.preInit)for(typeof d.preInit=="function"&&(d.preInit=[d.preInit]);d.preInit.length>0;)d.preInit.pop()();Wx();var Vc;f&&(Vc={uncaughtException:process.listeners("uncaughtException").filter(function(D){return!f.uncaughtException.indexOf(D)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(D){return!f.unhandledRejection.indexOf(D)>-1})});var Uc;if(typeof WasmBackendModule!="undefined")Uc=WasmBackendModule;else if(typeof r!="undefined")Uc=r;else throw new Error("Could not find wasm module in post.js");if(Vc){var SC=Uc._dispose;Uc._dispose=function(){SC(),Vc.uncaughtException.forEach(function(D){process.removeListener("uncaughtException",D)}),Vc.unhandledRejection.forEach(function(D){process.removeListener("unhandledRejection",D)})}}return r.ready}})();typeof e=="object"&&typeof t=="object"?t.exports=a:typeof define=="function"&&define.amd?define([],function(){return a}):typeof e=="object"&&(e.WasmBackendModuleThreadedSimd=a)}),eT=Xt((e,t)=>{t.exports.wasmWorkerContents=`"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+" -");return}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;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"})};self.onmessage=e=>{try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}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)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}};`}),tT=Xt((e,t)=>{var a=(()=>{var n=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(n=n||__filename),function(r){r=r||{};var s=typeof r!="undefined"?r:{},i,o;s.ready=new Promise(function(Y,se){i=Y,o=se});var l;typeof process!="undefined"&&process.listeners&&(l={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var u=Object.assign({},s),p=[],c="./this.program",d=(Y,se)=>{throw se},h=typeof window=="object",m=typeof importScripts=="function",f=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",g="";function y(Y){return s.locateFile?s.locateFile(Y,g):g+Y}var x,A,b,w;function I(Y){Y instanceof Sl||P("exiting due to exception: "+Y)}if(f){var T=cA(),N=hA();m?g=N.dirname(g)+"/":g=__dirname+"/",x=(Y,se)=>(Y=Dr(Y)?new URL(Y):N.normalize(Y),T.readFileSync(Y,se?void 0:"utf8")),b=Y=>{var se=x(Y,!0);return se.buffer||(se=new Uint8Array(se)),se},A=(Y,se,Ee)=>{Y=Dr(Y)?new URL(Y):N.normalize(Y),T.readFile(Y,function(et,wt){et?Ee(et):se(wt.buffer)})},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",function(Y){if(!(Y instanceof Sl))throw Y}),process.on("unhandledRejection",function(Y){throw Y}),d=(Y,se)=>{if(Ha())throw process.exitCode=Y,se;I(se),process.exit(Y)},s.inspect=function(){return"[Emscripten Module object]"}}else(h||m)&&(m?g=self.location.href:typeof document!="undefined"&&document.currentScript&&(g=document.currentScript.src),n&&(g=n),g.indexOf("blob:")!==0?g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):g="",x=Y=>{var se=new XMLHttpRequest;return se.open("GET",Y,!1),se.send(null),se.responseText},m&&(b=Y=>{var se=new XMLHttpRequest;return se.open("GET",Y,!1),se.responseType="arraybuffer",se.send(null),new Uint8Array(se.response)}),A=(Y,se,Ee)=>{var et=new XMLHttpRequest;et.open("GET",Y,!0),et.responseType="arraybuffer",et.onload=()=>{if(et.status==200||et.status==0&&et.response){se(et.response);return}Ee()},et.onerror=Ee,et.send(null)},w=Y=>document.title=Y);var M=s.print||console.log.bind(console),P=s.printErr||console.warn.bind(console);Object.assign(s,u),u=null,s.arguments&&(p=s.arguments),s.thisProgram&&(c=s.thisProgram),s.quit&&(d=s.quit);var E=4,S;s.wasmBinary&&(S=s.wasmBinary);var _=s.noExitRuntime||!0;typeof WebAssembly!="object"&&Hn("no native wasm support detected");var O,W=!1,$;function U(Y,se){Y||Hn(se)}var G=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function q(Y,se,Ee){se>>>=0;for(var et=se+Ee,wt=se;Y[wt]&&!(wt>=et);)++wt;if(wt-se>16&&Y.buffer&&G)return G.decode(Y.subarray(se,wt));for(var kt="";se>10,56320|dn&1023)}}return kt}function H(Y,se){return Y>>>=0,Y?q(ee,Y,se):""}function V(Y,se,Ee,et){if(Ee>>>=0,!(et>0))return 0;for(var wt=Ee,kt=Ee+et-1,Je=0;Je=55296&&Ye<=57343){var Lt=Y.charCodeAt(++Je);Ye=65536+((Ye&1023)<<10)|Lt&1023}if(Ye<=127){if(Ee>=kt)break;se[Ee++>>>0]=Ye}else if(Ye<=2047){if(Ee+1>=kt)break;se[Ee++>>>0]=192|Ye>>6,se[Ee++>>>0]=128|Ye&63}else if(Ye<=65535){if(Ee+2>=kt)break;se[Ee++>>>0]=224|Ye>>12,se[Ee++>>>0]=128|Ye>>6&63,se[Ee++>>>0]=128|Ye&63}else{if(Ee+3>=kt)break;se[Ee++>>>0]=240|Ye>>18,se[Ee++>>>0]=128|Ye>>12&63,se[Ee++>>>0]=128|Ye>>6&63,se[Ee++>>>0]=128|Ye&63}}return se[Ee>>>0]=0,Ee-wt}function Z(Y,se,Ee){return V(Y,ee,se,Ee)}var X,re,ee,ge,ie,be,Ce,Re,Le;function qe(Y){X=Y,s.HEAP8=re=new Int8Array(Y),s.HEAP16=ge=new Int16Array(Y),s.HEAP32=be=new Int32Array(Y),s.HEAPU8=ee=new Uint8Array(Y),s.HEAPU16=ie=new Uint16Array(Y),s.HEAPU32=Ce=new Uint32Array(Y),s.HEAPF32=Re=new Float32Array(Y),s.HEAPF64=Le=new Float64Array(Y)}var ft=s.INITIAL_MEMORY||16777216,dt,st=[],it=[],He=[],yt=!1;function Ha(){return _}function zt(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)$a(s.preRun.shift());mr(st)}function ln(){yt=!0,mr(it)}function oa(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)Fa(s.postRun.shift());mr(He)}function $a(Y){st.unshift(Y)}function un(Y){it.unshift(Y)}function Fa(Y){He.unshift(Y)}var ht=0,Da=null,ja=null;function hr(Y){ht++,s.monitorRunDependencies&&s.monitorRunDependencies(ht)}function Il(Y){if(ht--,s.monitorRunDependencies&&s.monitorRunDependencies(ht),ht==0&&(Da!==null&&(clearInterval(Da),Da=null),ja)){var se=ja;ja=null,se()}}function Hn(Y){s.onAbort&&s.onAbort(Y),Y="Aborted("+Y+")",P(Y),W=!0,$=1,Y+=". Build with -sASSERTIONS for more info.";var se=new WebAssembly.RuntimeError(Y);throw o(se),se}var cd="data:application/octet-stream;base64,";function kn(Y){return Y.startsWith(cd)}function Dr(Y){return Y.startsWith("file://")}var Yt;Yt="tfjs-backend-wasm.wasm",kn(Yt)||(Yt=y(Yt));function gc(Y){try{if(Y==Yt&&S)return new Uint8Array(S);if(b)return b(Y);throw"both async and sync fetching of the wasm failed"}catch(se){Hn(se)}}function dm(){if(!S&&(h||m)){if(typeof fetch=="function"&&!Dr(Yt))return fetch(Yt,{credentials:"same-origin"}).then(function(Y){if(!Y.ok)throw"failed to load wasm binary file at '"+Yt+"'";return Y.arrayBuffer()}).catch(function(){return gc(Yt)});if(A)return new Promise(function(Y,se){A(Yt,function(Ee){Y(new Uint8Array(Ee))},se)})}return Promise.resolve().then(function(){return gc(Yt)})}function pm(){var Y={env:hd,wasi_snapshot_preview1:hd};function se(Je,Ye){var Lt=Je.exports;s.asm=Lt,O=s.asm.memory,qe(O.buffer),dt=s.asm.__indirect_function_table,un(s.asm.__wasm_call_ctors),Il("wasm-instantiate")}hr("wasm-instantiate");function Ee(Je){se(Je.instance)}function et(Je){return dm().then(function(Ye){return WebAssembly.instantiate(Ye,Y)}).then(function(Ye){return Ye}).then(Je,function(Ye){P("failed to asynchronously prepare wasm: "+Ye),Hn(Ye)})}function wt(){return!S&&typeof WebAssembly.instantiateStreaming=="function"&&!kn(Yt)&&!Dr(Yt)&&!f&&typeof fetch=="function"?fetch(Yt,{credentials:"same-origin"}).then(function(Je){var Ye=WebAssembly.instantiateStreaming(Je,Y);return Ye.then(Ee,function(Lt){return P("wasm streaming compile failed: "+Lt),P("falling back to ArrayBuffer instantiation"),et(Ee)})}):et(Ee)}if(s.instantiateWasm)try{var kt=s.instantiateWasm(Y,se);return kt}catch(Je){P("Module.instantiateWasm callback failed with error: "+Je),o(Je)}return wt().catch(o),{}}var Mx,Or;function Sl(Y){this.name="ExitStatus",this.message="Program terminated with exit("+Y+")",this.status=Y}function mr(Y){for(;Y.length>0;)Y.shift()(s)}function cm(){Hn("")}function yc(){return 4294901760}function _s(){return yc()}function hm(Y,se,Ee){ee.copyWithin(Y>>>0,se>>>0,se+Ee>>>0)}function xc(Y){try{return O.grow(Y-X.byteLength+65535>>>16),qe(O.buffer),1}catch(se){}}function Cl(Y){var se=ee.length;Y=Y>>>0;var Ee=yc();if(Y>Ee)return!1;let et=(Lt,dn)=>Lt+(dn-Lt%dn)%dn;for(var wt=1;wt<=4;wt*=2){var kt=se*(1+.2/wt);kt=Math.min(kt,Y+100663296);var Je=Math.min(Ee,et(Math.max(Y,kt),65536)),Ye=xc(Je);if(Ye)return!0}return!1}var ma={varargs:void 0,get:function(){ma.varargs+=4;var Y=be[ma.varargs-4>>>2];return Y},getStr:function(Y){var se=H(Y);return se}};function Ac(Y){return 52}function mm(Y,se,Ee,et,wt){return 70}var fm=[null,[],[]];function Px(Y,se){var Ee=fm[Y];se===0||se===10?((Y===1?M:P)(q(Ee,0)),Ee.length=0):Ee.push(se)}function _x(Y,se,Ee,et){for(var wt=0,kt=0;kt>>2],Ye=Ce[se+4>>>2];se+=8;for(var Lt=0;Lt>>0]);wt+=Ye}return Ce[et>>>2]=wt,0}function bc(Y){var se=s["_"+Y];return se}function $s(Y,se){re.set(Y,se>>>0)}function gm(Y,se,Ee,et,wt){var kt={string:Oa=>{var Lr=0;if(Oa!=null&&Oa!==0){var Oc=(Oa.length<<2)+1;Lr=xd(Oc),Z(Oa,Lr,Oc)}return Lr},array:Oa=>{var Lr=xd(Oa.length);return $s(Oa,Lr),Lr}};function Je(Oa){return se==="string"?H(Oa):se==="boolean"?!!Oa:Oa}var Ye=bc(Y),Lt=[],dn=0;if(et)for(var fr=0;frJe==="number"||Je==="boolean"),kt=se!=="string";return kt&&wt&&!et?bc(Y):function(){return gm(Y,se,Ee,arguments,et)}}var hd={abort:cm,emscripten_get_heap_max:_s,emscripten_memcpy_big:hm,emscripten_resize_heap:Cl,fd_close:Ac,fd_seek:mm,fd_write:_x},xm=pm(),vc=s.___wasm_call_ctors=function(){return(vc=s.___wasm_call_ctors=s.asm.__wasm_call_ctors).apply(null,arguments)},wc=s._init=function(){return(wc=s._init=s.asm.init).apply(null,arguments)},Am=s._init_with_threads_count=function(){return(Am=s._init_with_threads_count=s.asm.init_with_threads_count).apply(null,arguments)},kc=s._get_threads_count=function(){return(kc=s._get_threads_count=s.asm.get_threads_count).apply(null,arguments)},bm=s._register_tensor=function(){return(bm=s._register_tensor=s.asm.register_tensor).apply(null,arguments)},We=s._dispose_data=function(){return(We=s._dispose_data=s.asm.dispose_data).apply(null,arguments)},md=s._dispose=function(){return(md=s._dispose=s.asm.dispose).apply(null,arguments)},vm=s._Abs=function(){return(vm=s._Abs=s.asm.Abs).apply(null,arguments)},Ic=s._Acos=function(){return(Ic=s._Acos=s.asm.Acos).apply(null,arguments)},Tl=s._Acosh=function(){return(Tl=s._Acosh=s.asm.Acosh).apply(null,arguments)},wm=s._Add=function(){return(wm=s._Add=s.asm.Add).apply(null,arguments)},km=s._AddN=function(){return(km=s._AddN=s.asm.AddN).apply(null,arguments)},Im=s._All=function(){return(Im=s._All=s.asm.All).apply(null,arguments)},Sm=s._Any=function(){return(Sm=s._Any=s.asm.Any).apply(null,arguments)},Cm=s._ArgMax=function(){return(Cm=s._ArgMax=s.asm.ArgMax).apply(null,arguments)},Sc=s._ArgMin=function(){return(Sc=s._ArgMin=s.asm.ArgMin).apply(null,arguments)},Cc=s._Asin=function(){return(Cc=s._Asin=s.asm.Asin).apply(null,arguments)},Tm=s._Asinh=function(){return(Tm=s._Asinh=s.asm.Asinh).apply(null,arguments)},Nm=s._Atan=function(){return(Nm=s._Atan=s.asm.Atan).apply(null,arguments)},Rm=s._Atan2=function(){return(Rm=s._Atan2=s.asm.Atan2).apply(null,arguments)},fd=s._Atanh=function(){return(fd=s._Atanh=s.asm.Atanh).apply(null,arguments)},Em=s._AvgPool=function(){return(Em=s._AvgPool=s.asm.AvgPool).apply(null,arguments)},Mm=s._AvgPool3D=function(){return(Mm=s._AvgPool3D=s.asm.AvgPool3D).apply(null,arguments)},Pm=s._AvgPool3DGrad=function(){return(Pm=s._AvgPool3DGrad=s.asm.AvgPool3DGrad).apply(null,arguments)},Fs=s._AvgPoolGrad=function(){return(Fs=s._AvgPoolGrad=s.asm.AvgPoolGrad).apply(null,arguments)},_m=s._BatchMatMul=function(){return(_m=s._BatchMatMul=s.asm.BatchMatMul).apply(null,arguments)},$m=s._Bincount=function(){return($m=s._Bincount=s.asm.Bincount).apply(null,arguments)},Tc=s._BitwiseAnd=function(){return(Tc=s._BitwiseAnd=s.asm.BitwiseAnd).apply(null,arguments)},Fm=s._Ceil=function(){return(Fm=s._Ceil=s.asm.Ceil).apply(null,arguments)},gd=s._ClipByValue=function(){return(gd=s._ClipByValue=s.asm.ClipByValue).apply(null,arguments)},Dm=s._Conv2D=function(){return(Dm=s._Conv2D=s.asm.Conv2D).apply(null,arguments)},Om=s._Conv2DBackpropInput=function(){return(Om=s._Conv2DBackpropInput=s.asm.Conv2DBackpropInput).apply(null,arguments)},zm=s._Conv3D=function(){return(zm=s._Conv3D=s.asm.Conv3D).apply(null,arguments)},zr=s._Conv3DBackpropFilterV2=function(){return(zr=s._Conv3DBackpropFilterV2=s.asm.Conv3DBackpropFilterV2).apply(null,arguments)},yd=s._Conv3DBackpropInputV2=function(){return(yd=s._Conv3DBackpropInputV2=s.asm.Conv3DBackpropInputV2).apply(null,arguments)},Lm=s._Cos=function(){return(Lm=s._Cos=s.asm.Cos).apply(null,arguments)},Wm=s._Cosh=function(){return(Wm=s._Cosh=s.asm.Cosh).apply(null,arguments)},Bm=s._CropAndResize=function(){return(Bm=s._CropAndResize=s.asm.CropAndResize).apply(null,arguments)},Vm=s._Cumprod=function(){return(Vm=s._Cumprod=s.asm.Cumprod).apply(null,arguments)},Nc=s._Cumsum=function(){return(Nc=s._Cumsum=s.asm.Cumsum).apply(null,arguments)},Rc=s._DenseBincount=function(){return(Rc=s._DenseBincount=s.asm.DenseBincount).apply(null,arguments)},Um=s._DepthToSpace=function(){return(Um=s._DepthToSpace=s.asm.DepthToSpace).apply(null,arguments)},Gm=s._DepthwiseConv2dNative=function(){return(Gm=s._DepthwiseConv2dNative=s.asm.DepthwiseConv2dNative).apply(null,arguments)},Ec=s._Diag=function(){return(Ec=s._Diag=s.asm.Diag).apply(null,arguments)},Mc=s._Dilation2D=function(){return(Mc=s._Dilation2D=s.asm.Dilation2D).apply(null,arguments)},Hm=s._Dilation2DBackpropFilter=function(){return(Hm=s._Dilation2DBackpropFilter=s.asm.Dilation2DBackpropFilter).apply(null,arguments)},jm=s._Dilation2DBackpropInput=function(){return(jm=s._Dilation2DBackpropInput=s.asm.Dilation2DBackpropInput).apply(null,arguments)},qm=s._Elu=function(){return(qm=s._Elu=s.asm.Elu).apply(null,arguments)},Xm=s._EluGrad=function(){return(Xm=s._EluGrad=s.asm.EluGrad).apply(null,arguments)},Pc=s._Equal=function(){return(Pc=s._Equal=s.asm.Equal).apply(null,arguments)},$x=s._Erf=function(){return($x=s._Erf=s.asm.Erf).apply(null,arguments)},Km=s._Exp=function(){return(Km=s._Exp=s.asm.Exp).apply(null,arguments)},Ym=s._Expm1=function(){return(Ym=s._Expm1=s.asm.Expm1).apply(null,arguments)},Zm=s._FlipLeftRight=function(){return(Zm=s._FlipLeftRight=s.asm.FlipLeftRight).apply(null,arguments)},Jm=s._Floor=function(){return(Jm=s._Floor=s.asm.Floor).apply(null,arguments)},Qm=s._FloorDiv=function(){return(Qm=s._FloorDiv=s.asm.FloorDiv).apply(null,arguments)},ef=s._FusedBatchNorm=function(){return(ef=s._FusedBatchNorm=s.asm.FusedBatchNorm).apply(null,arguments)},tf=s._FusedConv2D=function(){return(tf=s._FusedConv2D=s.asm.FusedConv2D).apply(null,arguments)},af=s._FusedDepthwiseConv2D=function(){return(af=s._FusedDepthwiseConv2D=s.asm.FusedDepthwiseConv2D).apply(null,arguments)},nf=s._Gather=function(){return(nf=s._Gather=s.asm.Gather).apply(null,arguments)},rf=s._GatherNd=function(){return(rf=s._GatherNd=s.asm.GatherNd).apply(null,arguments)},sf=s._Greater=function(){return(sf=s._Greater=s.asm.Greater).apply(null,arguments)},of=s._GreaterEqual=function(){return(of=s._GreaterEqual=s.asm.GreaterEqual).apply(null,arguments)},lf=s._IsFinite=function(){return(lf=s._IsFinite=s.asm.IsFinite).apply(null,arguments)},uf=s._IsInf=function(){return(uf=s._IsInf=s.asm.IsInf).apply(null,arguments)},df=s._IsNan=function(){return(df=s._IsNan=s.asm.IsNan).apply(null,arguments)},pf=s._LRN=function(){return(pf=s._LRN=s.asm.LRN).apply(null,arguments)},cf=s._LRNGrad=function(){return(cf=s._LRNGrad=s.asm.LRNGrad).apply(null,arguments)},hf=s._LeakyRelu=function(){return(hf=s._LeakyRelu=s.asm.LeakyRelu).apply(null,arguments)},mf=s._Less=function(){return(mf=s._Less=s.asm.Less).apply(null,arguments)},ff=s._LessEqual=function(){return(ff=s._LessEqual=s.asm.LessEqual).apply(null,arguments)},gf=s._LinSpace=function(){return(gf=s._LinSpace=s.asm.LinSpace).apply(null,arguments)},yf=s._Log=function(){return(yf=s._Log=s.asm.Log).apply(null,arguments)},xf=s._Log1p=function(){return(xf=s._Log1p=s.asm.Log1p).apply(null,arguments)},Af=s._LogicalAnd=function(){return(Af=s._LogicalAnd=s.asm.LogicalAnd).apply(null,arguments)},bf=s._LogicalNot=function(){return(bf=s._LogicalNot=s.asm.LogicalNot).apply(null,arguments)},vf=s._LogicalOr=function(){return(vf=s._LogicalOr=s.asm.LogicalOr).apply(null,arguments)},wf=s._LogicalXor=function(){return(wf=s._LogicalXor=s.asm.LogicalXor).apply(null,arguments)},kf=s._Max=function(){return(kf=s._Max=s.asm.Max).apply(null,arguments)},If=s._MaxPool=function(){return(If=s._MaxPool=s.asm.MaxPool).apply(null,arguments)},Sf=s._MaxPool3D=function(){return(Sf=s._MaxPool3D=s.asm.MaxPool3D).apply(null,arguments)},Cf=s._MaxPool3DGrad=function(){return(Cf=s._MaxPool3DGrad=s.asm.MaxPool3DGrad).apply(null,arguments)},Tf=s._MaxPoolGrad=function(){return(Tf=s._MaxPoolGrad=s.asm.MaxPoolGrad).apply(null,arguments)},Nf=s._MaxPoolWithArgmax=function(){return(Nf=s._MaxPoolWithArgmax=s.asm.MaxPoolWithArgmax).apply(null,arguments)},Rf=s._Maximum=function(){return(Rf=s._Maximum=s.asm.Maximum).apply(null,arguments)},Ef=s._Mean=function(){return(Ef=s._Mean=s.asm.Mean).apply(null,arguments)},Mf=s._Min=function(){return(Mf=s._Min=s.asm.Min).apply(null,arguments)},Pf=s._Minimum=function(){return(Pf=s._Minimum=s.asm.Minimum).apply(null,arguments)},_f=s._MirrorPad=function(){return(_f=s._MirrorPad=s.asm.MirrorPad).apply(null,arguments)},$f=s._Mod=function(){return($f=s._Mod=s.asm.Mod).apply(null,arguments)},Ff=s._Multinomial=function(){return(Ff=s._Multinomial=s.asm.Multinomial).apply(null,arguments)},Df=s._Multiply=function(){return(Df=s._Multiply=s.asm.Multiply).apply(null,arguments)},Of=s._Neg=function(){return(Of=s._Neg=s.asm.Neg).apply(null,arguments)},zf=s._NonMaxSuppressionV3=function(){return(zf=s._NonMaxSuppressionV3=s.asm.NonMaxSuppressionV3).apply(null,arguments)},Lf=s._NonMaxSuppressionV4=function(){return(Lf=s._NonMaxSuppressionV4=s.asm.NonMaxSuppressionV4).apply(null,arguments)},Wf=s._NonMaxSuppressionV5=function(){return(Wf=s._NonMaxSuppressionV5=s.asm.NonMaxSuppressionV5).apply(null,arguments)},Bf=s._NotEqual=function(){return(Bf=s._NotEqual=s.asm.NotEqual).apply(null,arguments)},Vf=s._OneHot=function(){return(Vf=s._OneHot=s.asm.OneHot).apply(null,arguments)},Uf=s._PadV2=function(){return(Uf=s._PadV2=s.asm.PadV2).apply(null,arguments)},Gf=s._Pow=function(){return(Gf=s._Pow=s.asm.Pow).apply(null,arguments)},Hf=s._Prelu=function(){return(Hf=s._Prelu=s.asm.Prelu).apply(null,arguments)},jf=s._Prod=function(){return(jf=s._Prod=s.asm.Prod).apply(null,arguments)},qf=s._RealDiv=function(){return(qf=s._RealDiv=s.asm.RealDiv).apply(null,arguments)},Xf=s._Reciprocal=function(){return(Xf=s._Reciprocal=s.asm.Reciprocal).apply(null,arguments)},Kf=s._Relu=function(){return(Kf=s._Relu=s.asm.Relu).apply(null,arguments)},Yf=s._Relu6=function(){return(Yf=s._Relu6=s.asm.Relu6).apply(null,arguments)},Zf=s._ResizeBilinear=function(){return(Zf=s._ResizeBilinear=s.asm.ResizeBilinear).apply(null,arguments)},Jf=s._ResizeBilinearGrad=function(){return(Jf=s._ResizeBilinearGrad=s.asm.ResizeBilinearGrad).apply(null,arguments)},Qf=s._ResizeNearestNeighbor=function(){return(Qf=s._ResizeNearestNeighbor=s.asm.ResizeNearestNeighbor).apply(null,arguments)},e2=s._ResizeNearestNeighborGrad=function(){return(e2=s._ResizeNearestNeighborGrad=s.asm.ResizeNearestNeighborGrad).apply(null,arguments)},t2=s._Reverse=function(){return(t2=s._Reverse=s.asm.Reverse).apply(null,arguments)},a2=s._RotateWithOffset=function(){return(a2=s._RotateWithOffset=s.asm.RotateWithOffset).apply(null,arguments)},n2=s._Round=function(){return(n2=s._Round=s.asm.Round).apply(null,arguments)},r2=s._Rsqrt=function(){return(r2=s._Rsqrt=s.asm.Rsqrt).apply(null,arguments)},s2=s._ScatterNd=function(){return(s2=s._ScatterNd=s.asm.ScatterNd).apply(null,arguments)},i2=s._SearchSorted=function(){return(i2=s._SearchSorted=s.asm.SearchSorted).apply(null,arguments)},o2=s._SelectV2=function(){return(o2=s._SelectV2=s.asm.SelectV2).apply(null,arguments)},l2=s._Selu=function(){return(l2=s._Selu=s.asm.Selu).apply(null,arguments)},u2=s._Sigmoid=function(){return(u2=s._Sigmoid=s.asm.Sigmoid).apply(null,arguments)},d2=s._Sign=function(){return(d2=s._Sign=s.asm.Sign).apply(null,arguments)},p2=s._Sin=function(){return(p2=s._Sin=s.asm.Sin).apply(null,arguments)},c2=s._Sinh=function(){return(c2=s._Sinh=s.asm.Sinh).apply(null,arguments)},h2=s._Softmax=function(){return(h2=s._Softmax=s.asm.Softmax).apply(null,arguments)},m2=s._Softplus=function(){return(m2=s._Softplus=s.asm.Softplus).apply(null,arguments)},f2=s._SparseFillEmptyRows=function(){return(f2=s._SparseFillEmptyRows=s.asm.SparseFillEmptyRows).apply(null,arguments)},g2=s._SparseReshape=function(){return(g2=s._SparseReshape=s.asm.SparseReshape).apply(null,arguments)},y2=s._SparseSegmentReduction=function(){return(y2=s._SparseSegmentReduction=s.asm.SparseSegmentReduction).apply(null,arguments)},x2=s._SparseToDense=function(){return(x2=s._SparseToDense=s.asm.SparseToDense).apply(null,arguments)},A2=s._Sqrt=function(){return(A2=s._Sqrt=s.asm.Sqrt).apply(null,arguments)},b2=s._Square=function(){return(b2=s._Square=s.asm.Square).apply(null,arguments)},v2=s._SquaredDifference=function(){return(v2=s._SquaredDifference=s.asm.SquaredDifference).apply(null,arguments)},w2=s._Step=function(){return(w2=s._Step=s.asm.Step).apply(null,arguments)},k2=s._StridedSlice=function(){return(k2=s._StridedSlice=s.asm.StridedSlice).apply(null,arguments)},I2=s._Sub=function(){return(I2=s._Sub=s.asm.Sub).apply(null,arguments)},S2=s._Sum=function(){return(S2=s._Sum=s.asm.Sum).apply(null,arguments)},C2=s._Tan=function(){return(C2=s._Tan=s.asm.Tan).apply(null,arguments)},T2=s._Tanh=function(){return(T2=s._Tanh=s.asm.Tanh).apply(null,arguments)},N2=s._TensorScatterUpdate=function(){return(N2=s._TensorScatterUpdate=s.asm.TensorScatterUpdate).apply(null,arguments)},R2=s._Tile=function(){return(R2=s._Tile=s.asm.Tile).apply(null,arguments)},E2=s._TopK=function(){return(E2=s._TopK=s.asm.TopK).apply(null,arguments)},M2=s._Transform=function(){return(M2=s._Transform=s.asm.Transform).apply(null,arguments)},P2=s._Transpose=function(){return(P2=s._Transpose=s.asm.Transpose).apply(null,arguments)},_2=s.__FusedMatMul=function(){return(_2=s.__FusedMatMul=s.asm._FusedMatMul).apply(null,arguments)},$2=s._malloc=function(){return($2=s._malloc=s.asm.malloc).apply(null,arguments)},F2=s._free=function(){return(F2=s._free=s.asm.free).apply(null,arguments)},D2=s.___errno_location=function(){return(D2=s.___errno_location=s.asm.__errno_location).apply(null,arguments)},_c=s.stackSave=function(){return(_c=s.stackSave=s.asm.stackSave).apply(null,arguments)},$c=s.stackRestore=function(){return($c=s.stackRestore=s.asm.stackRestore).apply(null,arguments)},xd=s.stackAlloc=function(){return(xd=s.stackAlloc=s.asm.stackAlloc).apply(null,arguments)},O2=s.dynCall_iijjiiii=function(){return(O2=s.dynCall_iijjiiii=s.asm.dynCall_iijjiiii).apply(null,arguments)},z2=s.dynCall_jiji=function(){return(z2=s.dynCall_jiji=s.asm.dynCall_jiji).apply(null,arguments)};s.cwrap=ym;var Nl;ja=function Y(){Nl||Fc(),Nl||(ja=Y)};function Fc(Y){if(Y=Y||p,ht>0||(zt(),ht>0))return;function se(){Nl||(Nl=!0,s.calledRun=!0,!W&&(ln(),i(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),oa()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),se()},1)):se()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();Fc();var Rl;l&&(Rl={uncaughtException:process.listeners("uncaughtException").filter(function(Y){return!l.uncaughtException.indexOf(Y)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(Y){return!l.unhandledRejection.indexOf(Y)>-1})});var El;if(typeof r!="undefined")El=r;else if(typeof WasmBackendModuleThreadedSimd!="undefined")El=WasmBackendModuleThreadedSimd;else throw new Error("Could not find wasm module in post.js");if(Rl){var L2=El._dispose;El._dispose=function(){L2(),Rl.uncaughtException.forEach(function(Y){process.removeListener("uncaughtException",Y)}),Rl.unhandledRejection.forEach(function(Y){process.removeListener("unhandledRejection",Y)})}}return r.ready}})();typeof e=="object"&&typeof t=="object"?t.exports=a:typeof define=="function"&&define.amd?define([],function(){return a}):typeof e=="object"&&(e.WasmBackendModule=a)}),rp=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}},au=class{refCount(e){return Xa("refCount")}incRef(e){return Xa("incRef")}timerAvailable(){return!0}time(e){return Xa("time")}read(e){return Xa("read")}readSync(e){return Xa("readSync")}readToGPU(e,t){return Xa("readToGPU")}numDataIds(){return Xa("numDataIds")}disposeData(e,t){return Xa("disposeData")}write(e,t,a){return Xa("write")}move(e,t,a,n,r){return Xa("move")}createTensorFromGPUData(e,t,a){return Xa("createTensorFromGPUData")}memory(){return Xa("memory")}floatPrecision(){return Xa("floatPrecision")}epsilon(){return this.floatPrecision()===32?1e-7:1e-4}dispose(){return Xa("dispose")}};function Xa(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 mA(e){let t=e.length,a=0;for(;t>0;)a=Math.random()*t|0,t--,oh(e,t,a)}function aT(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 a=e.length,n=0;for(;a>0;)n=Math.random()*a|0,a--,oh(e,a,n),oh(t,a,n)}function Dd(e,t,a){return Math.max(e,Math.min(t,a))}function nT(e){return e%2===0?e:e+1}function oh(e,t,a){let n=e[t];e[t]=e[a],e[a]=n}function rT(e){let t=0;for(let a=0;aa+` Shapes ${e} and ${t} must match`)}function ri(e){F(e!=null,()=>"The input to the tensor constructor must be a non-null value.")}function vt(e){if(e.length===0)return 1;let t=e[0];for(let a=1;a0,a,n){return new Promise((r,s)=>{let i=0,o=()=>{if(e()){r();return}i++;let l=t(i);if(a!=null&&i>=a){s();return}n!=null?n(o,l):setTimeout(o,l)};o()})}function cT(e,t){let a=1,n=-1;for(let s=0;s=0)a*=e[s];else if(e[s]===-1){if(n!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${n} and dim ${s}`);n=s}else if(e[s]<0)throw Error(`Shapes can not be < 0. Found ${e[s]} at dim ${s}`);if(n===-1){if(t>0&&t!==a)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(a===0)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%a!==0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${a}`);let r=e.slice();return r[n]=t/a,r}function sp(e,t){let a=t.length;return e=e==null?t.map((n,r)=>r):[].concat(e),F(e.every(n=>n>=-a&&n`All values in axis param must be in range [-${a}, ${a}) but got axis ${e}`),F(e.every(n=>Ul(n)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(n=>n<0?a+n:n)}function gA(e,t){let a=[],n=[],r=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||r?null:sp(t,e).sort(),i=0;for(let o=0;oo)&&e[o]===1&&(a.push(e[o]),n.push(o)),s[i]<=o&&i++}e[o]!==1&&(a.push(e[o]),n.push(o))}return{newShape:a,keptDims:n}}function yA(e,t){return Z1(e,t)}function Z1(e,t){let a=null;if(e==null||e==="float32")a=new Float32Array(t);else if(e==="int32")a=new Int32Array(t);else if(e==="bool")a=new Uint8Array(t);else if(e==="string")a=new Array(t);else throw new Error(`Unknown data type ${e}`);return a}function xA(e,t){for(let a=0;at+=a.length),t}function Ur(e){return typeof e=="string"||e instanceof String}function vA(e){return typeof e=="boolean"}function wA(e){return typeof e=="number"}function ip(e){return Array.isArray(e)?ip(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":wA(e)?"float32":Ur(e)?"string":vA(e)?"bool":"float32"}function Kr(e){return!!(e&&e.constructor&&e.call&&e.apply)}function uh(e,t){for(let a=t;a=0;--n)a[n]=a[n+1]*e[n+1];return a}function kA(e,t,a,n=!1){let r=new Array;if(t.length===1){let s=t[0]*(n?2:1);for(let i=0;il*u)*(n?2:1);for(let l=0;lr*s)*(a?2:1);if(n===0)return[];if(n!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${a?" for a complex tensor":""}.`);return kA(0,e,t,a)}function mT(e,t){if(Array.isArray(e))return e;if(t==="float32")return e instanceof Float32Array?e:new Float32Array(e);if(t==="int32")return e instanceof Int32Array?e:new Int32Array(e);if(t==="bool"||t==="string")return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}function J1(e,t){let a=Rh(e,t);for(let n=0;nn*r,1);if(t==null||t==="float32")return zl(e,new Float32Array(a));if(t==="int32")return zl(e,new Int32Array(a));if(t==="bool")return zl(e,new Uint8Array(a));throw new Error(`Unknown data type ${t}`)}function tn(e){e.forEach(t=>{F(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function gT(e,t,a){if(t===0)return 0;if(t===1)return e[0];let n=e[e.length-1];for(let r=0;r{let[a,n]=t.split(":");this.urlFlags[a]=bT(a,n)})}};function xT(e){let t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(a,...n)=>(AT(t,n[0],n[1]),n.join("="))),t}function AT(e,t,a){e[decodeURIComponent(t)]=decodeURIComponent(a||"")}function bT(e,t){let a=t.toLowerCase();return a==="true"||a==="false"?a==="true":`${+a}`===a?+a:t}function B(){return Q1}var Q1=null;function vT(e){Q1=e}var G2;function SA(){if(G2==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");G2=e}return G2}function wT(){let e=SA();return e._tfGlobals==null&&(e._tfGlobals=new Map),e._tfGlobals}function eg(e,t){let a=wT();if(a.has(e))return a.get(e);{let n=t();return a.set(e,n),a.get(e)}}var ru="Abs",si="Acos",ii="Acosh",is="Add",oi="AddN",li="All",ui="Any",su="ArgMax",iu="ArgMin",di="Asin",pi="Asinh",ci="Atan",hi="Atanh",mi="Atan2",fi="AvgPool",op="AvgPoolGrad",ou="AvgPool3D",lp="AvgPool3DGrad",gi="BatchMatMul",lu="BatchToSpaceND",yi="Bincount",uu="BitwiseAnd",kT="BroadcastTo",du="BroadcastArgs",xi="Cast",Ai="Ceil",os="ClipByValue",up="Complex",dp="ComplexAbs",pu="Concat",bi="Conv2D",pp="Conv2DBackpropFilter",vi="Conv2DBackpropInput",wi="Conv3D",cu="Conv3DBackpropFilterV2",ki="Conv3DBackpropInputV2",Ii="Cos",Si="Cosh",Ci="Cumprod",Ti="Cumsum",Ni="CropAndResize",hu="DenseBincount",Ri="DepthToSpace",Ei="DepthwiseConv2dNative",cp="DepthwiseConv2dNativeBackpropFilter",hp="DepthwiseConv2dNativeBackpropInput",mu="Diag",Mi="Dilation2D",Gl="Dilation2DBackpropInput",Hl="Dilation2DBackpropFilter",mp="Draw",Pi="RealDiv",fp="Einsum",_i="Elu",fu="EluGrad",$i="Erf",Fi="Equal",Di="Exp",gu="ExpandDims",Oi="Expm1",gp="FFT",yu="Fill",zi="FlipLeftRight",Li="Floor",Wi="FloorDiv",Bi="FusedBatchNorm",xu="GatherV2",Vi="GatherNd",Ui="Greater",Gi="GreaterEqual",Hi="Identity",yp="IFFT",xp="Imag",ji="IsFinite",qi="IsInf",Xi="IsNan",Ki="LeakyRelu",Yi="Less",Zi="LessEqual",Ji="LinSpace",Qi="Log",eo="Log1p",to="LogicalAnd",ao="LogicalNot",no="LogicalOr",CA="LogicalXor",IT="LogSoftmax",ST="LowerBound",ro="LRN",Au="LRNGrad",CT="MatrixBandPart",so="Max",io="Maximum",oo="MaxPool",Ap="MaxPoolGrad",bu="MaxPool3D",bp="MaxPool3DGrad",vu="MaxPoolWithArgmax",lo="Mean",uo="Min",po="Minimum",co="MirrorPad",ho="Mod",mo="Multinomial",fo="Multiply",wu="Neg",go="NotEqual",yo="NonMaxSuppressionV3",ku="NonMaxSuppressionV4",xo="NonMaxSuppressionV5",Iu="OnesLike",Ao="OneHot",Su="Pack",bo="PadV2",TT="Pool",vo="Pow",wo="Prelu",ko="Prod",Mh="RaggedGather",Ph="RaggedRange",_h="RaggedTensorToTensor",Cu="Range",vp="Real",Io="Reciprocal",So="Relu",Tu="Reshape",Co="ResizeNearestNeighbor",Nu="ResizeNearestNeighborGrad",To="ResizeBilinear",Ru="ResizeBilinearGrad",No="Relu6",Ro="Reverse",Eo="Round",Mo="Rsqrt",Po="ScatterNd",_o="TensorScatterUpdate",$o="SearchSorted",Eu="Select",Fo="Selu",Mu="Slice",Do="Sin",Oo="Sinh",zo="Sign",Lo="Sigmoid",Wo="Softplus",Bo="Sqrt",Vo="Sum",Pu="SpaceToBatchND",_u="SplitV",Uo="Softmax",wp="SparseFillEmptyRows",$u="SparseReshape",Fu="SparseSegmentMean",Du="SparseSegmentSum",Go="SparseToDense",Ho="SquaredDifference",kp="Square",Ip="StaticRegexReplace",jo="StridedSlice",Ou="StringNGrams",Sp="StringSplit",Cp="StringToHashBucketFast",qo="Sub",Xo="Tan",Ko="Tanh",ls="Tile",Yo="TopK",Zo="Transform",wr="Transpose",Tp="Unique",zu="Unpack",Np="UnsortedSegmentSum",NT="UpperBound",Lu="ZerosLike",us="Step",Od="FromPixels",Jo="RotateWithOffset",Yr="_FusedMatMul",Zr="FusedConv2D",Jr="FusedDepthwiseConv2D";function Vr(...e){B().getBool("IS_TEST")||B().getBool("PROD")||console.warn(...e)}function RT(...e){B().getBool("IS_TEST")||B().getBool("PROD")||console.log(...e)}var jl=eg("kernelRegistry",()=>new Map),zd=eg("gradRegistry",()=>new Map);function Ld(e,t){let a=tg(e,t);return jl.get(a)}function e1(e){return zd.get(e)}function Zn(e){let t=jl.entries(),a=[];for(;;){let{done:n,value:r}=t.next();if(n)break;let[s,i]=r,[o]=s.split("_");o===e&&a.push(i)}return a}function yn(e){let{kernelName:t,backendName:a}=e,n=tg(t,a);jl.has(n)&&Vr(`The kernel '${t}' for backend '${a}' is already registered`),jl.set(n,e)}function ET(e){let{kernelName:t}=e;zd.has(t)&&B().getBool("DEBUG")&&Vr(`Overriding the gradient for '${t}'`),zd.set(t,e)}function MT(e,t){let a=tg(e,t);if(!jl.has(a))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);jl.delete(a)}function PT(e){if(!zd.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);zd.delete(e)}function _T(e,t){Zn(e).forEach(a=>{let n=Object.assign({},a,{backendName:t});yn(n)})}function tg(e,t){return`${t}_${e}`}var v={};Ze(v,{arraysEqual:()=>Cr,arraysEqualWithNull:()=>fA,assert:()=>F,assertNonNegativeIntegerDimensions:()=>tn,assertNonNull:()=>ri,assertShapesMatch:()=>Ta,bytesFromStringArray:()=>bA,bytesPerElement:()=>lh,checkConversionForErrors:()=>xA,clamp:()=>Dd,computeStrides:()=>nu,convertBackendValuesAndArrayBuffer:()=>mT,createScalarValue:()=>LT,createShuffledIndices:()=>dT,decodeString:()=>dh,distSquared:()=>iT,encodeString:()=>Ep,fetch:()=>BT,fingerPrint64:()=>zT,flatten:()=>Qr,getArrayFromDType:()=>Z1,getTypedArrayFromDType:()=>yA,hasEncodingLoss:()=>hT,hexToLong:()=>Rp,indexToLoc:()=>yT,inferDtype:()=>ip,inferFromImplicitShape:()=>cT,isBoolean:()=>vA,isFunction:()=>Kr,isInt:()=>Ul,isNumber:()=>wA,isPromise:()=>Eh,isScalarShape:()=>oT,isString:()=>Ur,isTypedArray:()=>Jt,isValidDtype:()=>AA,locToIndex:()=>gT,makeOnesTypedArray:()=>J1,makeZerosNestedTypedArray:()=>fT,makeZerosTypedArray:()=>Rh,nearestDivisor:()=>uh,nearestLargerEven:()=>nT,now:()=>Wd,parseAxisParam:()=>sp,randUniform:()=>sT,repeatedTry:()=>pT,rightPad:()=>Pd,shuffle:()=>mA,shuffleCombo:()=>aT,sizeFromShape:()=>vt,sizeToSquarishShape:()=>uT,squeezeShape:()=>gA,sum:()=>rT,swap:()=>oh,tanh:()=>lT,toNestedArray:()=>zl,toTypedArray:()=>$h});function TA(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var Hx=tu(LC()),Ws=Hx.default||Hx;function Rp(e){return Ws.fromString(e,!0,16)}var NA=Rp("c3a5c85c97cb3127"),zs=Rp("b492b66fbe98f273"),va=Rp("9ae16a3b2f90404f");function t1(e){return e.xor(e.shru(47))}function RA(e,t,a){let n=e.slice(t,t+a);return Ws.fromBytes(Array.from(n),!0,!0)}function xt(e,t){return RA(e,t,8)}function jx(e,t){return RA(e,t,4)}function Zt(e,t){return t===0?e:e.shru(t).or(e.shl(64-t))}function qr(e,t,a=Rp("9ddfea08eb382d69")){let n=e.xor(t).mul(a);n=n.xor(n.shru(47));let r=t.xor(n).mul(a);return r=r.xor(r.shru(47)),r=r.mul(a),r}function $T(e,t,a,n,r,s){r=r.add(e),s=Zt(s.add(r).add(n),21);let i=r;return r=r.add(t),r=r.add(a),s=s.add(Zt(r,44)),[r.add(n),s.add(i)]}function Hc(e,t,a,n){return $T(xt(e,t),xt(e,t+8),xt(e,t+16),xt(e,t+24),a,n)}function FT(e,t=e.length){if(t>=8){let a=va.add(t*2),n=xt(e,0).add(va),r=xt(e,t-8),s=Zt(r,37).mul(a).add(n),i=Zt(n,25).add(r).mul(a);return qr(s,i,a)}if(t>=4){let a=va.add(t*2),n=jx(e,0);return qr(n.shl(3).add(t),jx(e,t-4),a)}if(t>0){let a=e[0],n=e[t>>1],r=e[t-1],s=a+(n<<8),i=t+(r<<2);return t1(va.mul(s).xor(NA.mul(i))).mul(va)}return va}function DT(e,t=e.length){let a=va.add(t*2),n=xt(e,0).mul(zs),r=xt(e,8),s=xt(e,t-8).mul(a),i=xt(e,t-16).mul(va);return qr(Zt(n.add(r),43).add(Zt(s,30)).add(i),n.add(Zt(r.add(va),18)).add(s),a)}function OT(e,t=e.length){let a=va.add(t*2),n=xt(e,0).mul(va),r=xt(e,8),s=xt(e,t-8).mul(a),i=xt(e,t-16).mul(va),o=Zt(n.add(r),43).add(Zt(s,30)).add(i),l=qr(o,n.add(Zt(r.add(va),18)).add(s),a),u=xt(e,16).mul(a),p=xt(e,24),c=o.add(xt(e,t-32)).mul(a),d=l.add(xt(e,t-24)).mul(a);return qr(Zt(u.add(p),43).add(Zt(c,30)).add(d),u.add(Zt(p.add(n),18)).add(c),a)}function zT(e,t=e.length){let a=Ws.fromNumber(81,!0);if(t<=32)return t<=16?FT(e,t):DT(e,t);if(t<=64)return OT(e,t);let n=a,r=a.mul(zs).add(113),s=t1(r.mul(va).add(113)).mul(va),i=[Ws.UZERO,Ws.UZERO],o=[Ws.UZERO,Ws.UZERO];n=n.mul(va).add(xt(e,0));let l=0,u=(t-1>>6)*64,p=u+(t-1&63)-63;do n=Zt(n.add(r).add(i[0]).add(xt(e,l+8)),37).mul(zs),r=Zt(r.add(i[1]).add(xt(e,l+48)),42).mul(zs),n=n.xor(o[1]),r=r.add(i[0]).add(xt(e,l+40)),s=Zt(s.add(o[0]),33).mul(zs),i=Hc(e,l,i[1].mul(zs),n.add(o[0])),o=Hc(e,l+32,s.add(o[1]),r.add(xt(e,l+16))),[s,n]=[n,s],l+=64;while(l!==u);let c=zs.add(s.and(255).shl(1));return l=p,o[0]=o[0].add(t-1&63),i[0]=i[0].add(o[0]),o[0]=o[0].add(i[0]),n=Zt(n.add(r).add(i[0]).add(xt(e,l+8)),37).mul(c),r=Zt(r.add(i[1]).add(xt(e,l+48)),42).mul(c),n=n.xor(o[1].mul(9)),r=r.add(i[0].mul(9).add(xt(e,l+40))),s=Zt(s.add(o[0]),33).mul(c),i=Hc(e,l,i[1].mul(c),n.add(o[0])),o=Hc(e,l+32,s.add(o[1]),r.add(xt(e,l+16))),[s,n]=[n,s],qr(qr(i[0],o[0],c).add(t1(r).mul(NA)).add(s),qr(i[1],o[1],c).add(n),c)}function LT(e,t){return t==="string"?Ep(e):$h([e],t)}function WT(e,t){return e instanceof Float32Array&&t==="float32"||e instanceof Int32Array&&t==="int32"||e instanceof Uint8Array&&t==="bool"}function $h(e,t){if(t==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=Qr(e)),B().getBool("DEBUG")&&xA(e,t),WT(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 a=new Uint8Array(e.length);for(let n=0;n{n=a()},s,i=Wd();if(this.backendTimer.timerAvailable())s=this.backendTimer.time(r);else{r();for(let o of n)o.dataSync();s=Promise.resolve({kernelMs:Wd()-i})}if(B().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let o=0;o{UT(u,l.dtype,e)})}return{kernelName:e,outputs:n,inputs:t,timeMs:s.then(o=>o.kernelMs),extraInfo:s.then(o=>o.getExtraProfileInfo!=null?o.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:a,timeMs:n,inputs:r,extraInfo:s}=e;a.forEach(i=>{Promise.all([i.data(),n,s]).then(o=>{this.logger.logKernelProfile(t,i,o[0],o[1],r,o[2])})})}};function UT(e,t,a){if(t!=="float32")return!1;for(let n=0;n0?m:""} `}}console.log(`%c${o} %c${i} %c${l}D ${p} %c${u} %c${c} %c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function HT(e,t,a){let n={},r={};for(let l=0;ln[f.id]=!0),h=!0,r[u.id]=!0;break}if(h)break}}let s={};s[a.id]=!0;let i={};for(let l=e.length-1;l>=0;l--){let u=e[l],p=u.inputs;for(let c=0;c=0;r--){let s=t[r],i=[];if(s.outputs.forEach(l=>{let u=e[l.id];u!=null?i.push(u):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 u=a(()=>o[l]());if(u.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${l} must have 'float32' dtype, but has '${u.dtype}'`);let p=s.inputs[l];if(!Cr(u.shape,p.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${l}' has shape '${u.shape}', which does not match the shape of the input '${p.shape}'`);if(e[p.id]==null)e[p.id]=u;else{let c=e[p.id];e[p.id]=n(c,u),c.dispose()}}}}var qx=20,bd=3,H2=7;function qT(e,t,a,n){let r=nu(t),s=XT(e,t,a,r),i=t.length,o=Jc(e,t,a,r,s),l=["Tensor"];return n&&(l.push(` dtype: ${a}`),l.push(` rank: ${i}`),l.push(` shape: [${t}]`),l.push(" values:")),l.push(o.map(u=>" "+u).join(` +"use strict";var Human=(()=>{var Jc=Object.defineProperty;var xC=Object.getOwnPropertyDescriptor;var AC=Object.getOwnPropertyNames;var bC=Object.prototype.hasOwnProperty;var vC=(e,t,a)=>t in e?Jc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a;var vr=(e,t)=>{for(var a in t)Jc(e,a,{get:t[a],enumerable:!0})},wC=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of AC(t))!bC.call(e,r)&&r!==a&&Jc(e,r,{get:()=>t[r],enumerable:!(n=xC(t,r))||n.enumerable});return e};var kC=e=>wC(Jc({},"__esModule",{value:!0}),e);var he=(e,t,a)=>(vC(e,typeof t!="symbol"?t+"":t,a),a),a5=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)};var Xa=(e,t,a)=>(a5(e,t,"read from private field"),a?a.call(e):t.get(e)),Yn=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},wr=(e,t,a,n)=>(a5(e,t,"write to private field"),n?n.call(e,a):t.set(e,a),a);var zxe={};vr(zxe,{Env:()=>uc,Human:()=>Ux,default:()=>Ux,defaults:()=>yl,draw:()=>F0,empty:()=>fr,env:()=>ne,match:()=>im,models:()=>Vx});var Ye={};vr(Ye,{Abs:()=>cu,Acos:()=>$i,Acosh:()=>Di,AdadeltaOptimizer:()=>s3,AdagradOptimizer:()=>i3,AdamOptimizer:()=>o3,AdamaxOptimizer:()=>l3,Add:()=>Mr,AddN:()=>Pi,All:()=>_i,Any:()=>Oi,ArgMax:()=>hu,ArgMin:()=>mu,Asin:()=>zi,Asinh:()=>Li,Atan:()=>Wi,Atan2:()=>Vi,Atanh:()=>Bi,AvgPool:()=>Ui,AvgPool3D:()=>fu,AvgPool3DGrad:()=>yp,AvgPoolGrad:()=>gp,BackendWasm:()=>Wk,BatchMatMul:()=>Gi,BatchToSpaceND:()=>gu,Bincount:()=>Hi,BitwiseAnd:()=>ji,BroadcastArgs:()=>yu,BroadcastTo:()=>mN,Cast:()=>qi,Ceil:()=>cs,ClipByValue:()=>hs,Complex:()=>xp,ComplexAbs:()=>Ap,Concat:()=>xu,Conv2D:()=>Xi,Conv2DBackpropFilter:()=>bp,Conv2DBackpropInput:()=>Ki,Conv3D:()=>Yi,Conv3DBackpropFilterV2:()=>Au,Conv3DBackpropInputV2:()=>Zi,Cos:()=>Ji,Cosh:()=>Qi,CropAndResize:()=>ao,Cumprod:()=>eo,Cumsum:()=>to,DataStorage:()=>hp,DenseBincount:()=>bu,DepthToSpace:()=>no,DepthwiseConv2dNative:()=>ro,DepthwiseConv2dNativeBackpropFilter:()=>vp,DepthwiseConv2dNativeBackpropInput:()=>wp,Diag:()=>vu,Dilation2D:()=>so,Dilation2DBackpropFilter:()=>Ql,Dilation2DBackpropInput:()=>Jl,Draw:()=>kp,ENV:()=>lg,Einsum:()=>Ip,Elu:()=>oo,EluGrad:()=>wu,Environment:()=>UA,Equal:()=>ms,Erf:()=>lo,Exp:()=>fs,ExpandDims:()=>ku,Expm1:()=>gs,FFT:()=>Sp,Fill:()=>Iu,FlipLeftRight:()=>uo,Floor:()=>ys,FloorDiv:()=>xs,FromPixels:()=>jd,FusedBatchNorm:()=>po,FusedConv2D:()=>as,FusedDepthwiseConv2D:()=>ns,GPGPUContext:()=>Yl,GatherNd:()=>co,GatherV2:()=>Su,GraphModel:()=>ec,Greater:()=>As,GreaterEqual:()=>bs,IFFT:()=>Tp,Identity:()=>ho,Imag:()=>Cp,IsFinite:()=>mo,IsInf:()=>fo,IsNan:()=>go,KernelBackend:()=>du,LRN:()=>ko,LRNGrad:()=>Tu,LeakyRelu:()=>yo,Less:()=>vs,LessEqual:()=>ws,LinSpace:()=>xo,Log:()=>ks,Log1p:()=>Ao,LogSoftmax:()=>fN,LogicalAnd:()=>bo,LogicalNot:()=>vo,LogicalOr:()=>wo,LogicalXor:()=>HA,LowerBound:()=>gN,MathBackendCPU:()=>A3,MathBackendWebGL:()=>rc,MatrixBandPart:()=>yN,Max:()=>Io,MaxPool:()=>So,MaxPool3D:()=>Cu,MaxPool3DGrad:()=>Rp,MaxPoolGrad:()=>Np,MaxPoolWithArgmax:()=>Nu,Maximum:()=>Is,Mean:()=>To,Min:()=>Co,Minimum:()=>Ss,MirrorPad:()=>No,Mod:()=>Ro,MomentumOptimizer:()=>u3,Multinomial:()=>Eo,Multiply:()=>Ts,Neg:()=>Ru,NonMaxSuppressionV3:()=>Mo,NonMaxSuppressionV4:()=>Eu,NonMaxSuppressionV5:()=>Fo,NotEqual:()=>Cs,OP_SCOPE_SUFFIX:()=>hg,OneHot:()=>$o,OnesLike:()=>Mu,Optimizer:()=>_s,OptimizerConstructors:()=>s6,Pack:()=>Fu,PadV2:()=>Do,Pool:()=>xN,Pow:()=>Po,Prelu:()=>_o,Prod:()=>Oo,RMSPropOptimizer:()=>d3,RaggedGather:()=>Lh,RaggedRange:()=>Wh,RaggedTensorToTensor:()=>Bh,Range:()=>$u,Rank:()=>u1,Real:()=>Ep,RealDiv:()=>io,Reciprocal:()=>zo,Reduction:()=>wa,Relu:()=>Lo,Relu6:()=>Vo,Reshape:()=>Du,ResizeBilinear:()=>Bo,ResizeBilinearGrad:()=>_u,ResizeNearestNeighbor:()=>Wo,ResizeNearestNeighborGrad:()=>Pu,Reverse:()=>Uo,RotateWithOffset:()=>ol,Round:()=>Go,Rsqrt:()=>Ns,SGDOptimizer:()=>i0,ScatterNd:()=>Ho,SearchSorted:()=>qo,Select:()=>Ou,Selu:()=>Xo,Sigmoid:()=>Rs,Sign:()=>Zo,Sin:()=>Ko,Sinh:()=>Yo,Slice:()=>zu,Softmax:()=>el,Softplus:()=>Jo,SpaceToBatchND:()=>Lu,SparseFillEmptyRows:()=>Mp,SparseReshape:()=>Bu,SparseSegmentMean:()=>Vu,SparseSegmentSum:()=>Uu,SparseToDense:()=>tl,SplitV:()=>Wu,Sqrt:()=>Es,Square:()=>Fp,SquaredDifference:()=>Ms,StaticRegexReplace:()=>Gu,Step:()=>Ds,StridedSlice:()=>al,StringNGrams:()=>Hu,StringSplit:()=>$p,StringToHashBucketFast:()=>Dp,Sub:()=>Fs,Sum:()=>Qo,Tan:()=>nl,Tanh:()=>rl,Tensor:()=>yt,TensorBuffer:()=>Rt,TensorScatterUpdate:()=>jo,Tile:()=>$s,TopK:()=>sl,Transform:()=>il,Transpose:()=>Tr,Unique:()=>Pp,Unpack:()=>ju,UnsortedSegmentSum:()=>_p,UpperBound:()=>AN,Variable:()=>Yd,WebGPUBackend:()=>ny,ZerosLike:()=>qu,_FusedMatMul:()=>ts,abs:()=>Ja,acos:()=>xb,acosh:()=>Ab,add:()=>we,addN:()=>Uh,all:()=>bb,any:()=>vb,argMax:()=>or,argMin:()=>wb,asin:()=>kb,asinh:()=>Ib,atan:()=>Sb,atan2:()=>Tb,atanh:()=>Cb,avgPool:()=>vg,avgPool3d:()=>Mb,backend:()=>Gn,backend_util:()=>I,basicLSTMCell:()=>Fb,batchNorm:()=>jp,batchNorm2d:()=>$b,batchNorm3d:()=>Db,batchNorm4d:()=>Pb,batchToSpaceND:()=>wg,bincount:()=>kg,bitwiseAnd:()=>_b,booleanMaskAsync:()=>b7,broadcastArgs:()=>Ob,broadcastTo:()=>Ai,broadcast_util:()=>ul,browser:()=>Pr,buffer:()=>Te,cast:()=>Ue,ceil:()=>zb,clipByValue:()=>Lb,clone:()=>Ia,complex:()=>Rr,concat:()=>lt,concat1d:()=>Wb,concat2d:()=>Xu,concat3d:()=>Bb,concat4d:()=>Vb,conv1d:()=>Ub,conv2d:()=>qp,conv2dTranspose:()=>Hb,conv3d:()=>jb,conv3dTranspose:()=>qb,copyRegisteredKernels:()=>IN,cos:()=>Xb,cosh:()=>Kb,cosineWindow:()=>t0,cumprod:()=>Yb,cumsum:()=>Zb,customGrad:()=>rr,denseBincount:()=>Jb,deprecationWarn:()=>fg,depthToSpace:()=>Qb,depthwiseConv2d:()=>Gh,deregisterOp:()=>TO,device_util:()=>Wp,diag:()=>e4,dilation2d:()=>t4,disableDeprecationWarnings:()=>tR,dispose:()=>J,disposeVariables:()=>aR,div:()=>ve,divNoNan:()=>n4,dot:()=>r4,dropout:()=>S7,einsum:()=>hi,elu:()=>Tg,enableDebugMode:()=>eR,enableProdMode:()=>mg,enclosingPowerOfTwo:()=>a3,engine:()=>St,ensureShape:()=>s4,env:()=>B,equal:()=>Sg,erf:()=>i4,euclideanNorm:()=>u4,exp:()=>ls,expandDims:()=>Bt,expm1:()=>d4,eye:()=>Ng,fft:()=>Zh,fill:()=>lr,findBackend:()=>gg,findBackendFactory:()=>oR,floor:()=>Rg,floorDiv:()=>Gp,forceHalfFloat:()=>Dw,fused:()=>n3,gather:()=>Eg,gatherND:()=>I7,gather_util:()=>h3,getBackend:()=>ea,getGradient:()=>o1,getKernel:()=>Xd,getKernelsForBackend:()=>tr,getThreadsCount:()=>Zle,gpgpu_util:()=>pw,grad:()=>UM,grads:()=>GM,greater:()=>Yp,greaterEqual:()=>Mg,ifft:()=>rp,imag:()=>Zp,image:()=>fe,inTopKAsync:()=>T7,io:()=>Jn,irfft:()=>Yg,isFinite:()=>p4,isInf:()=>c4,isNaN:()=>h4,keep:()=>Bn,kernel_impls:()=>Fn,leakyRelu:()=>Fg,less:()=>bh,lessEqual:()=>Hh,linalg:()=>D7,linspace:()=>m4,loadGraphModel:()=>x3,loadGraphModelSync:()=>Fz,localResponseNormalization:()=>f4,log:()=>au,log1p:()=>$g,logSigmoid:()=>y4,logSoftmax:()=>x4,logSumExp:()=>Pg,logicalAnd:()=>tp,logicalNot:()=>_g,logicalOr:()=>Og,logicalXor:()=>A4,losses:()=>P7,lowerBound:()=>b4,matMul:()=>pt,math:()=>q7,max:()=>fa,maxPool:()=>zg,maxPool3d:()=>v4,maxPoolWithArgmax:()=>w4,maximum:()=>Lg,mean:()=>ap,memory:()=>nR,meshgrid:()=>k4,min:()=>os,minimum:()=>np,mirrorPad:()=>I4,mod:()=>Ku,moments:()=>S4,movingAverage:()=>v7,mul:()=>te,multiRNNCell:()=>T4,multinomial:()=>C4,neg:()=>Vn,nextFrame:()=>i6,node:()=>py,norm:()=>Kp,notEqual:()=>Wg,oneHot:()=>vh,ones:()=>Yr,onesLike:()=>N4,op:()=>z,outerProduct:()=>R4,pad:()=>ur,pad1d:()=>E4,pad2d:()=>M4,pad3d:()=>F4,pad4d:()=>$4,pool:()=>D4,pow:()=>tu,prelu:()=>Vg,print:()=>Ag,prod:()=>P4,profile:()=>rR,raggedGather:()=>_4,raggedRange:()=>O4,raggedTensorToTensor:()=>z4,rand:()=>L4,randomGamma:()=>U4,randomNormal:()=>qg,randomStandardNormal:()=>G4,randomUniform:()=>Xh,randomUniformInt:()=>H4,range:()=>nu,ready:()=>Vp,real:()=>ru,reciprocal:()=>j4,registerBackend:()=>ll,registerGradient:()=>vN,registerKernel:()=>bn,registerOp:()=>SO,relu:()=>Jp,relu6:()=>Xg,removeBackend:()=>iR,reshape:()=>Q,reverse:()=>us,reverse1d:()=>q4,reverse2d:()=>X4,reverse3d:()=>K4,reverse4d:()=>Y4,rfft:()=>Jh,round:()=>Kg,rsqrt:()=>Z4,scalar:()=>Ge,scatterND:()=>w7,scatter_util:()=>Qh,searchSorted:()=>qh,selu:()=>J4,separableConv2d:()=>Q4,serialization:()=>z7,setBackend:()=>Bp,setPlatform:()=>lR,setThreadsCount:()=>Yle,setWasmPath:()=>Kle,setWasmPaths:()=>f0,setWebGLContext:()=>u0,setdiff1dAsync:()=>e7,shared:()=>b3,sigmoid:()=>za,sign:()=>t7,signal:()=>$7,sin:()=>a7,sinh:()=>n7,slice:()=>_e,slice1d:()=>r7,slice2d:()=>s7,slice3d:()=>Qp,slice4d:()=>Kh,slice_util:()=>wt,softmax:()=>Yh,softplus:()=>Dg,spaceToBatchND:()=>Bg,sparse:()=>_7,sparseToDense:()=>k7,spectral:()=>F7,split:()=>Sa,sqrt:()=>nr,square:()=>En,squaredDifference:()=>Zg,squeeze:()=>Oe,stack:()=>ca,step:()=>Jg,stridedSlice:()=>i7,string:()=>O7,sub:()=>xe,sum:()=>ot,sumOutType:()=>Lp,tan:()=>o7,tanh:()=>Ah,tensor:()=>Ve,tensor1d:()=>Vt,tensor2d:()=>er,tensor3d:()=>Qg,tensor4d:()=>l7,tensor5d:()=>u7,tensor6d:()=>d7,tensorScatterUpdate:()=>c7,tensor_util:()=>ZA,test_util:()=>W4,tidy:()=>Pe,tile:()=>Qr,time:()=>sR,topk:()=>h7,train:()=>w_,transpose:()=>Si,truncatedNormal:()=>m7,unique:()=>f7,unregisterGradient:()=>kN,unregisterKernel:()=>wN,unsortedSegmentSum:()=>g7,unstack:()=>Na,upcastType:()=>Qt,upperBound:()=>y7,util:()=>v,valueAndGrad:()=>HM,valueAndGrads:()=>jM,variable:()=>x7,variableGrads:()=>g4,version:()=>lc,version_converter:()=>Dz,version_core:()=>m3,version_cpu:()=>XL,version_wasm:()=>Jle,version_webgl:()=>Oq,webgl:()=>zq,webgl_util:()=>Pv,webgpu_util:()=>Uk,where:()=>Cr,whereAsync:()=>t3,zeros:()=>An,zerosLike:()=>en});var IC=Object.create,sg=Object.defineProperty,SC=Object.getOwnPropertyDescriptor,TC=Object.getOwnPropertyNames,CC=Object.getPrototypeOf,NC=Object.prototype.hasOwnProperty,Xt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ke=(e,t)=>{for(var a in t)sg(e,a,{get:t[a],enumerable:!0})},RC=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of TC(t))!NC.call(e,r)&&r!==a&&sg(e,r,{get:()=>t[r],enumerable:!(n=SC(t,r))||n.enumerable});return e},uu=(e,t,a)=>(a=e!=null?IC(CC(e)):{},RC(t||!e||!e.__esModule?sg(a,"default",{value:e,enumerable:!0}):a,e)),EC=Xt((e,t)=>{t.exports=n;var a=null;try{a=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(T){}function n(T,D,O){this.low=T|0,this.high=D|0,this.unsigned=!!O}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0});function r(T){return(T&&T.__isLong__)===!0}n.isLong=r;var s={},i={};function o(T,D){var O,W,$;return D?(T>>>=0,($=0<=T&&T<256)&&(W=i[T],W)?W:(O=u(T,(T|0)<0?-1:0,!0),$&&(i[T]=O),O)):(T|=0,($=-128<=T&&T<128)&&(W=s[T],W)?W:(O=u(T,T<0?-1:0,!1),$&&(s[T]=O),O))}n.fromInt=o;function l(T,D){if(isNaN(T))return D?b:A;if(D){if(T<0)return b;if(T>=g)return M}else{if(T<=-y)return F;if(T+1>=y)return N}return T<0?l(-T,D).neg():u(T%f|0,T/f|0,D)}n.fromNumber=l;function u(T,D,O){return new n(T,D,O)}n.fromBits=u;var d=Math.pow;function c(T,D,O){if(T.length===0)throw Error("empty string");if(T==="NaN"||T==="Infinity"||T==="+Infinity"||T==="-Infinity")return A;if(typeof D=="number"?(O=D,D=!1):D=!!D,O=O||10,O<2||360)throw Error("interior hyphen");if(W===0)return c(T.substring(1),D,O).neg();for(var $=l(d(O,8)),U=A,G=0;G>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},E.toString=function(T){if(T=T||10,T<2||36>>0,V=H.toString(T);if(U=q,U.isZero())return V+G;for(;V.length<6;)V="0"+V;G=""+V+G}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(F)?64:this.neg().getNumBitsAbs();for(var T=this.high!=0?this.high:this.low,D=31;D>0&&!(T&1<=0},E.isOdd=function(){return(this.low&1)===1},E.isEven=function(){return(this.low&1)===0},E.equals=function(T){return r(T)||(T=p(T)),this.unsigned!==T.unsigned&&this.high>>>31===1&&T.high>>>31===1?!1:this.high===T.high&&this.low===T.low},E.eq=E.equals,E.notEquals=function(T){return!this.eq(T)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(T){return this.comp(T)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(T){return this.comp(T)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(T){return this.comp(T)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(T){return this.comp(T)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(T){if(r(T)||(T=p(T)),this.eq(T))return 0;var D=this.isNegative(),O=T.isNegative();return D&&!O?-1:!D&&O?1:this.unsigned?T.high>>>0>this.high>>>0||T.high===this.high&&T.low>>>0>this.low>>>0?-1:1:this.sub(T).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(F)?F:this.not().add(w)},E.neg=E.negate,E.add=function(T){r(T)||(T=p(T));var D=this.high>>>16,O=this.high&65535,W=this.low>>>16,$=this.low&65535,U=T.high>>>16,G=T.high&65535,q=T.low>>>16,H=T.low&65535,V=0,Z=0,X=0,re=0;return re+=$+H,X+=re>>>16,re&=65535,X+=W+q,Z+=X>>>16,X&=65535,Z+=O+G,V+=Z>>>16,Z&=65535,V+=D+U,V&=65535,u(X<<16|re,V<<16|Z,this.unsigned)},E.subtract=function(T){return r(T)||(T=p(T)),this.add(T.neg())},E.sub=E.subtract,E.multiply=function(T){if(this.isZero())return A;if(r(T)||(T=p(T)),a){var D=a.mul(this.low,this.high,T.low,T.high);return u(D,a.get_high(),this.unsigned)}if(T.isZero())return A;if(this.eq(F))return T.isOdd()?F:A;if(T.eq(F))return this.isOdd()?F:A;if(this.isNegative())return T.isNegative()?this.neg().mul(T.neg()):this.neg().mul(T).neg();if(T.isNegative())return this.mul(T.neg()).neg();if(this.lt(x)&&T.lt(x))return l(this.toNumber()*T.toNumber(),this.unsigned);var O=this.high>>>16,W=this.high&65535,$=this.low>>>16,U=this.low&65535,G=T.high>>>16,q=T.high&65535,H=T.low>>>16,V=T.low&65535,Z=0,X=0,re=0,ee=0;return ee+=U*V,re+=ee>>>16,ee&=65535,re+=$*V,X+=re>>>16,re&=65535,re+=U*H,X+=re>>>16,re&=65535,X+=W*V,Z+=X>>>16,X&=65535,X+=$*H,Z+=X>>>16,X&=65535,X+=U*q,Z+=X>>>16,X&=65535,Z+=O*V+W*H+$*q+U*G,Z&=65535,u(re<<16|ee,Z<<16|X,this.unsigned)},E.mul=E.multiply,E.divide=function(T){if(r(T)||(T=p(T)),T.isZero())throw Error("division by zero");if(a){if(!this.unsigned&&this.high===-2147483648&&T.low===-1&&T.high===-1)return this;var D=(this.unsigned?a.div_u:a.div_s)(this.low,this.high,T.low,T.high);return u(D,a.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?b:A;var O,W,$;if(this.unsigned){if(T.unsigned||(T=T.toUnsigned()),T.gt(this))return b;if(T.gt(this.shru(1)))return S;$=b}else{if(this.eq(F)){if(T.eq(w)||T.eq(C))return F;if(T.eq(F))return w;var U=this.shr(1);return O=U.div(T).shl(1),O.eq(A)?T.isNegative()?w:C:(W=this.sub(T.mul(O)),$=O.add(W.div(T)),$)}else if(T.eq(F))return this.unsigned?b:A;if(this.isNegative())return T.isNegative()?this.neg().div(T.neg()):this.neg().div(T).neg();if(T.isNegative())return this.div(T.neg()).neg();$=A}for(W=this;W.gte(T);){O=Math.max(1,Math.floor(W.toNumber()/T.toNumber()));for(var G=Math.ceil(Math.log(O)/Math.LN2),q=G<=48?1:d(2,G-48),H=l(O),V=H.mul(T);V.isNegative()||V.gt(W);)O-=q,H=l(O,this.unsigned),V=H.mul(T);H.isZero()&&(H=w),$=$.add(H),W=W.sub(V)}return $},E.div=E.divide,E.modulo=function(T){if(r(T)||(T=p(T)),a){var D=(this.unsigned?a.rem_u:a.rem_s)(this.low,this.high,T.low,T.high);return u(D,a.get_high(),this.unsigned)}return this.sub(this.div(T).mul(T))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return u(~this.low,~this.high,this.unsigned)},E.and=function(T){return r(T)||(T=p(T)),u(this.low&T.low,this.high&T.high,this.unsigned)},E.or=function(T){return r(T)||(T=p(T)),u(this.low|T.low,this.high|T.high,this.unsigned)},E.xor=function(T){return r(T)||(T=p(T)),u(this.low^T.low,this.high^T.high,this.unsigned)},E.shiftLeft=function(T){return r(T)&&(T=T.toInt()),(T&=63)===0?this:T<32?u(this.low<>>32-T,this.unsigned):u(0,this.low<>>T|this.high<<32-T,this.high>>T,this.unsigned):u(this.high>>T-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(T){if(r(T)&&(T=T.toInt()),T&=63,T===0)return this;var D=this.high;if(T<32){var O=this.low;return u(O>>>T|D<<32-T,D>>>T,this.unsigned)}else return T===32?u(D,0,this.unsigned):u(D>>>T-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},E.toBytes=function(T){return T?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var T=this.high,D=this.low;return[D&255,D>>>8&255,D>>>16&255,D>>>24,T&255,T>>>8&255,T>>>16&255,T>>>24]},E.toBytesBE=function(){var T=this.high,D=this.low;return[T>>>24,T>>>16&255,T>>>8&255,T&255,D>>>24,D>>>16&255,D>>>8&255,D&255]},n.fromBytes=function(T,D,O){return O?n.fromBytesLE(T,D):n.fromBytesBE(T,D)},n.fromBytesLE=function(T,D){return new n(T[0]|T[1]<<8|T[2]<<16|T[3]<<24,T[4]|T[5]<<8|T[6]<<16|T[7]<<24,D)},n.fromBytesBE=function(T,D){return new n(T[4]<<24|T[5]<<16|T[6]<<8|T[7],T[0]<<24|T[1]<<16|T[2]<<8|T[3],D)}}),MC=Xt(()=>{}),FC=Xt(()=>{}),$C=Xt((e,t)=>{(function(a,n,r){function s(u){var d=this,c=l();d.next=function(){var p=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=p-(d.c=p|0)},d.c=1,d.s0=c(" "),d.s1=c(" "),d.s2=c(" "),d.s0-=c(u),d.s0<0&&(d.s0+=1),d.s1-=c(u),d.s1<0&&(d.s1+=1),d.s2-=c(u),d.s2<0&&(d.s2+=1),c=null}function i(u,d){return d.c=u.c,d.s0=u.s0,d.s1=u.s1,d.s2=u.s2,d}function o(u,d){var c=new s(u),p=d&&d.state,h=c.next;return h.int32=function(){return c.next()*4294967296|0},h.double=function(){return h()+(h()*2097152|0)*11102230246251565e-32},h.quick=h,p&&(typeof p=="object"&&i(p,c),h.state=function(){return i(c,{})}),h}function l(){var u=4022871197,d=function(c){c=String(c);for(var p=0;p>>0,h-=u,h*=u,u=h>>>0,h-=u,u+=h*4294967296}return(u>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),DC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this,d="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var p=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^p^p>>>8},l===(l|0)?u.x=l:d+=l;for(var c=0;c>>0)/4294967296};return p.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},p.int32=d.next,p.quick=p,c&&(typeof c=="object"&&i(c,d),p.state=function(){return i(d,{})}),p}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),PC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this,d="";u.next=function(){var p=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(p^p<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:d+=l;for(var c=0;c>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var d=new s(l),c=u&&u.state,p=function(){return(d.next()>>>0)/4294967296};return p.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},p.int32=d.next,p.quick=p,c&&(typeof c=="object"&&i(c,d),p.state=function(){return i(d,{})}),p}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),_C=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this;u.next=function(){var c=u.x,p=u.i,h,m,f;return h=c[p],h^=h>>>7,m=h^h<<24,h=c[p+1&7],m^=h^h>>>10,h=c[p+3&7],m^=h^h>>>3,h=c[p+4&7],m^=h^h<<7,h=c[p+7&7],h=h^h<<13,m^=h^h<<9,c[p]=m,u.i=p+1&7,m};function d(c,p){var h,m,f=[];if(p===(p|0))m=f[0]=p;else for(p=""+p,h=0;h0;--h)c.next()}d(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var d=new s(l),c=u&&u.state,p=function(){return(d.next()>>>0)/4294967296};return p.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},p.int32=d.next,p.quick=p,c&&(c.x&&i(c,d),p.state=function(){return i(d,{})}),p}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),OC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this;u.next=function(){var c=u.w,p=u.X,h=u.i,m,f;return u.w=c=c+1640531527|0,f=p[h+34&127],m=p[h=h+1&127],f^=f<<13,m^=m<<17,f^=f>>>15,m^=m>>>12,f=p[h]=f^m,u.i=h,f+(c^c>>>16)|0};function d(c,p){var h,m,f,g,y,x=[],A=128;for(p===(p|0)?(m=p,p=null):(p=p+"\0",m=0,A=Math.max(A,p.length)),f=0,g=-32;g>>15,m^=m<<4,m^=m>>>13,g>=0&&(y=y+1640531527|0,h=x[g&127]^=m+y,f=h==0?f+1:0);for(f>=128&&(x[(p&&p.length||0)&127]=-1),f=127,g=4*128;g>0;--g)m=x[f+34&127],h=x[f=f+1&127],m^=m<<13,h^=h<<17,m^=m>>>15,h^=h>>>12,x[f]=m^h;c.w=y,c.X=x,c.i=f}d(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var d=new s(l),c=u&&u.state,p=function(){return(d.next()>>>0)/4294967296};return p.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},p.int32=d.next,p.quick=p,c&&(c.X&&i(c,d),p.state=function(){return i(d,{})}),p}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),zC=Xt((e,t)=>{(function(a,n,r){function s(l){var u=this,d="";u.next=function(){var p=u.b,h=u.c,m=u.d,f=u.a;return p=p<<25^p>>>7^h,h=h-m|0,m=m<<24^m>>>8^f,f=f-p|0,u.b=p=p<<20^p>>>12^h,u.c=h=h-m|0,u.d=m<<16^h>>>16^f,u.a=f-p|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):d+=l;for(var c=0;c>>0)/4294967296};return p.double=function(){do var h=d.next()>>>11,m=(d.next()>>>0)/4294967296,f=(h+m)/(1<<21);while(f===0);return f},p.int32=d.next,p.quick=p,c&&(typeof c=="object"&&i(c,d),p.state=function(){return i(d,{})}),p}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(e,typeof t=="object"&&t,typeof define=="function"&&define)}),LC=Xt(()=>{}),WC=Xt((e,t)=>{(function(a,n,r){var s=256,i=6,o=52,l="random",u=r.pow(s,i),d=r.pow(2,o),c=d*2,p=s-1,h;function m(w,S,C){var N=[];S=S==!0?{entropy:!0}:S||{};var M=x(y(S.entropy?[w,b(n)]:w==null?A():w,3),N),F=new f(N),E=function(){for(var T=F.g(i),D=u,O=0;T=c;)T/=2,D/=2,O>>>=1;return(T+O)/D};return E.int32=function(){return F.g(4)|0},E.quick=function(){return F.g(4)/4294967296},E.double=E,x(b(F.S),n),(S.pass||C||function(T,D,O,W){return W&&(W.S&&g(W,F),T.state=function(){return g(F,{})}),O?(r[l]=T,D):T})(E,M,"global"in S?S.global:this==r,S.state)}function f(w){var S,C=w.length,N=this,M=0,F=N.i=N.j=0,E=N.S=[];for(C||(w=[C++]);M{var a=$C(),n=DC(),r=PC(),s=_C(),i=OC(),o=zC(),l=WC();l.alea=a,l.xor128=n,l.xorwow=r,l.xorshift7=s,l.xor4096=i,l.tychei=o,t.exports=l}),MA=Xt(()=>{}),FA=Xt(()=>{}),BC=Xt(()=>{}),VC=Xt(()=>{}),UC=Xt(()=>{}),GC=Xt((e,t)=>{var a=(()=>{var n=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(n=n||__filename),function(r){r=r||{};function s(){return ie.buffer!=He&&ht(ie.buffer),xt}function i(){return ie.buffer!=He&&ht(ie.buffer),ja}function o(){return ie.buffer!=He&&ht(ie.buffer),Lt}function l(){return ie.buffer!=He&&ht(ie.buffer),ua}function u(){return ie.buffer!=He&&ht(ie.buffer),Da}function d(){return ie.buffer!=He&&ht(ie.buffer),cn}function c(){return ie.buffer!=He&&ht(ie.buffer),Pa}var p=typeof r!="undefined"?r:{},h,m;p.ready=new Promise(function(_,j){h=_,m=j});var f;typeof process!="undefined"&&process.listeners&&(f={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var g=Object.assign({},p),y=[],x="./this.program",A=(_,j)=>{throw j},b=typeof window=="object",w=typeof importScripts=="function",S=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",C=p.ENVIRONMENT_IS_PTHREAD||!1,N="";function M(_){return p.locateFile?p.locateFile(_,N):N+_}var F,E,T,D;function O(_){_ instanceof ii||H("exiting due to exception: "+_)}if(S){var W=MA(),$=FA();w?N=$.dirname(N)+"/":N=__dirname+"/",F=(j,oe)=>(j=Pl(j)?new URL(j):$.normalize(j),W.readFileSync(j,oe?void 0:"utf8")),T=j=>{var oe=F(j,!0);return oe.buffer||(oe=new Uint8Array(oe)),oe},E=(j,oe,Fe)=>{j=Pl(j)?new URL(j):$.normalize(j),W.readFile(j,function(je,Be){je?Fe(je):oe(Be.buffer)})},process.argv.length>1&&(x=process.argv[1].replace(/\\/g,"/")),y=process.argv.slice(2),process.on("uncaughtException",function(j){if(!(j instanceof ii))throw j}),process.on("unhandledRejection",function(j){throw j}),A=(j,oe)=>{if(Tn())throw process.exitCode=j,oe;O(oe),process.exit(j)},p.inspect=function(){return"[Emscripten Module object]"};let _;try{_=BC()}catch(j){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),j}global.Worker=_.Worker}else(b||w)&&(w?N=self.location.href:typeof document!="undefined"&&document.currentScript&&(N=document.currentScript.src),typeof n!="undefined"&&n&&(N=n),N.indexOf("blob:")!==0?N=N.substr(0,N.replace(/[?#].*/,"").lastIndexOf("/")+1):N="",S||(F=_=>{var j=new XMLHttpRequest;return j.open("GET",_,!1),j.send(null),j.responseText},w&&(T=_=>{var j=new XMLHttpRequest;return j.open("GET",_,!1),j.responseType="arraybuffer",j.send(null),new Uint8Array(j.response)}),E=(_,j,oe)=>{var Fe=new XMLHttpRequest;Fe.open("GET",_,!0),Fe.responseType="arraybuffer",Fe.onload=()=>{if(Fe.status==200||Fe.status==0&&Fe.response){j(Fe.response);return}oe()},Fe.onerror=oe,Fe.send(null)}),D=_=>document.title=_);S&&typeof performance=="undefined"&&(global.performance=VC().performance);var U=console.log.bind(console),G=console.warn.bind(console);S&&(U=_=>W.writeSync(1,_+` +`),G=_=>W.writeSync(2,_+` +`));var q=p.print||U,H=p.printErr||G;Object.assign(p,g),g=null,p.arguments&&(y=p.arguments),p.thisProgram&&(x=p.thisProgram),p.quit&&(A=p.quit);var V=4,Z=Atomics.load,X=Atomics.store,re=Atomics.compareExchange,ee;p.wasmBinary&&(ee=p.wasmBinary);var ge=p.noExitRuntime||!0;typeof WebAssembly!="object"&&si("no native wasm support detected");var ie,be,Ce=!1,Ee;function Le(_,j){_||si(j)}var qe=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function gt(_,j,oe){j>>>=0;for(var Fe=j+oe,je=j;_[je]&&!(je>=Fe);)++je;if(je-j>16&&_.buffer&&qe)return qe.decode(_.buffer instanceof SharedArrayBuffer?_.slice(j,je):_.subarray(j,je));for(var Be="";j>10,56320|mn&1023)}}return Be}function dt(_,j){return _>>>=0,_?gt(i(),_,j):""}function st(_,j,oe,Fe){if(oe>>>=0,!(Fe>0))return 0;for(var je=oe,Be=oe+Fe-1,ye=0;ye<_.length;++ye){var Re=_.charCodeAt(ye);if(Re>=55296&&Re<=57343){var Nt=_.charCodeAt(++ye);Re=65536+((Re&1023)<<10)|Nt&1023}if(Re<=127){if(oe>=Be)break;j[oe++>>>0]=Re}else if(Re<=2047){if(oe+1>=Be)break;j[oe++>>>0]=192|Re>>6,j[oe++>>>0]=128|Re&63}else if(Re<=65535){if(oe+2>=Be)break;j[oe++>>>0]=224|Re>>12,j[oe++>>>0]=128|Re>>6&63,j[oe++>>>0]=128|Re&63}else{if(oe+3>=Be)break;j[oe++>>>0]=240|Re>>18,j[oe++>>>0]=128|Re>>12&63,j[oe++>>>0]=128|Re>>6&63,j[oe++>>>0]=128|Re&63}}return j[oe>>>0]=0,oe-je}function it(_,j,oe){return st(_,i(),j,oe)}var He,xt,ja,Lt,pn,ua,Da,cn,Pa;C&&(He=p.buffer);function ht(_){He=_,p.HEAP8=xt=new Int8Array(_),p.HEAP16=Lt=new Int16Array(_),p.HEAP32=ua=new Int32Array(_),p.HEAPU8=ja=new Uint8Array(_),p.HEAPU16=pn=new Uint16Array(_),p.HEAPU32=Da=new Uint32Array(_),p.HEAPF32=cn=new Float32Array(_),p.HEAPF64=Pa=new Float64Array(_)}var _a=p.INITIAL_MEMORY||16777216;if(C)ie=p.wasmMemory,He=p.buffer;else if(p.wasmMemory)ie=p.wasmMemory;else if(ie=new WebAssembly.Memory({initial:_a/65536,maximum:65536,shared:!0}),!(ie.buffer instanceof SharedArrayBuffer))throw H("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"),S&&H("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");ie&&(He=ie.buffer),_a=He.byteLength,ht(He);var qa,yr=[],$l=[],Kn=[],bd=!1;function Tn(){return ge}function Br(){if(p.preRun)for(typeof p.preRun=="function"&&(p.preRun=[p.preRun]);p.preRun.length;)ym(p.preRun.shift());wd(yr)}function Yt(){bd=!0,!C&&wd($l)}function Ic(){if(!C){if(p.postRun)for(typeof p.postRun=="function"&&(p.postRun=[p.postRun]);p.postRun.length;)Gx(p.postRun.shift());wd(Kn)}}function ym(_){yr.unshift(_)}function xm(_){$l.unshift(_)}function Gx(_){Kn.unshift(_)}var Vr=0,Dl=null,xr=null;function Am(_){Vr++,p.monitorRunDependencies&&p.monitorRunDependencies(Vr)}function Sc(_){if(Vr--,p.monitorRunDependencies&&p.monitorRunDependencies(Vr),Vr==0&&(Dl!==null&&(clearInterval(Dl),Dl=null),xr)){var j=xr;xr=null,j()}}function si(_){p.onAbort&&p.onAbort(_),_="Aborted("+_+")",H(_),Ce=!0,Ee=1,_+=". Build with -sASSERTIONS for more info.";var j=new WebAssembly.RuntimeError(_);throw m(j),j}var bm="data:application/octet-stream;base64,";function Tc(_){return _.startsWith(bm)}function Pl(_){return _.startsWith("file://")}var ma;ma="tfjs-backend-wasm-threaded-simd.wasm",Tc(ma)||(ma=M(ma));function Cc(_){try{if(_==ma&&ee)return new Uint8Array(ee);if(T)return T(_);throw"both async and sync fetching of the wasm failed"}catch(j){si(j)}}function vm(){if(!ee&&(b||w)){if(typeof fetch=="function"&&!Pl(ma))return fetch(ma,{credentials:"same-origin"}).then(function(_){if(!_.ok)throw"failed to load wasm binary file at '"+ma+"'";return _.arrayBuffer()}).catch(function(){return Cc(ma)});if(E)return new Promise(function(_,j){E(ma,function(oe){_(new Uint8Array(oe))},j)})}return Promise.resolve().then(function(){return Cc(ma)})}function wm(){var _={env:Wc,wasi_snapshot_preview1:Wc};function j(ye,Re){var Nt=ye.exports;if(p.asm=Nt,Mm(p.asm._emscripten_tls_init),qa=p.asm.__indirect_function_table,xm(p.asm.__wasm_call_ctors),be=Re,!C){var mn=We.unusedWorkers.length;We.unusedWorkers.forEach(function(br){We.loadWasmModuleToWorker(br,function(){--mn||Sc("wasm-instantiate")})})}}C||Am("wasm-instantiate");function oe(ye){j(ye.instance,ye.module)}function Fe(ye){return vm().then(function(Re){return WebAssembly.instantiate(Re,_)}).then(function(Re){return Re}).then(ye,function(Re){H("failed to asynchronously prepare wasm: "+Re),si(Re)})}function je(){return!ee&&typeof WebAssembly.instantiateStreaming=="function"&&!Tc(ma)&&!Pl(ma)&&!S&&typeof fetch=="function"?fetch(ma,{credentials:"same-origin"}).then(function(ye){var Re=WebAssembly.instantiateStreaming(ye,_);return Re.then(oe,function(Nt){return H("wasm streaming compile failed: "+Nt),H("falling back to ArrayBuffer instantiation"),Fe(oe)})}):Fe(oe)}if(p.instantiateWasm)try{var Be=p.instantiateWasm(_,j);return Be}catch(ye){H("Module.instantiateWasm callback failed with error: "+ye),m(ye)}return je().catch(m),{}}var Hx,jx,Nc={};function ii(_){this.name="ExitStatus",this.message="Program terminated with exit("+_+")",this.status=_}function km(_){var j=We.pthreads[_];delete We.pthreads[_],j.terminate(),X2(_),We.runningWorkers.splice(We.runningWorkers.indexOf(j),1),j.pthread_ptr=0}function Im(_){var j=We.pthreads[_];j.postMessage({cmd:"cancel"})}function vd(_){var j=We.pthreads[_];Le(j),We.returnWorkerToPool(j)}function Sm(_){var j=We.getNewWorker();if(!j)return 6;We.runningWorkers.push(j),We.pthreads[_.pthread_ptr]=j,j.pthread_ptr=_.pthread_ptr;var oe={cmd:"run",start_routine:_.startRoutine,arg:_.arg,pthread_ptr:_.pthread_ptr};return j.runPthread=()=>{S&&j.ref(),j.postMessage(oe,_.transferList),delete j.runPthread},j.loaded&&j.runPthread(),0}var Rc={varargs:void 0,get:function(){Rc.varargs+=4;var _=l()[Rc.varargs-4>>>2];return _},getStr:function(_){var j=dt(_);return j}};function Ec(_){if(C)return Ur(1,1,_);Ee=_,Tn()||(We.terminateAllThreads(),p.onExit&&p.onExit(_),Ce=!0),A(_,new ii(_))}function Tm(_,j){if(Ee=_,!j&&C)throw Fc(_),"unwind";Ec(_)}var Mc=Tm;function Cm(_){if(_ instanceof ii||_=="unwind")return Ee;A(1,_)}var We={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){C?We.initWorker():We.initMainThread()},initMainThread:function(){for(var _=8;_--;)We.allocateUnusedWorker()},initWorker:function(){ge=!1},setExitStatus:function(_){Ee=_},terminateAllThreads:function(){for(var _ of Object.values(We.pthreads))We.returnWorkerToPool(_);for(var _ of We.unusedWorkers)_.terminate();We.unusedWorkers=[]},returnWorkerToPool:function(_){var j=_.pthread_ptr;delete We.pthreads[j],We.unusedWorkers.push(_),We.runningWorkers.splice(We.runningWorkers.indexOf(_),1),_.pthread_ptr=0,S&&_.unref(),X2(j)},receiveObjectTransfer:function(_){},threadInitTLS:function(){We.tlsInitFunctions.forEach(_=>_())},loadWasmModuleToWorker:function(_,j){_.onmessage=Be=>{var ye=Be.data,Re=ye.cmd;if(_.pthread_ptr&&(We.currentProxiedOperationCallerThread=_.pthread_ptr),ye.targetThread&&ye.targetThread!=jc()){var Nt=We.pthreads[ye.targetThread];Nt?Nt.postMessage(ye,ye.transferList):H('Internal error! Worker sent a message "'+Re+'" to target pthread '+ye.targetThread+", but that thread no longer exists!"),We.currentProxiedOperationCallerThread=void 0;return}Re==="processProxyingQueue"?kd(ye.queue):Re==="spawnThread"?Sm(ye):Re==="cleanupThread"?vd(ye.thread):Re==="killThread"?km(ye.thread):Re==="cancelThread"?Im(ye.thread):Re==="loaded"?(_.loaded=!0,S&&_.unref(),j&&j(_),_.runPthread&&_.runPthread()):Re==="print"?q("Thread "+ye.threadId+": "+ye.text):Re==="printErr"?H("Thread "+ye.threadId+": "+ye.text):Re==="alert"?alert("Thread "+ye.threadId+": "+ye.text):ye.target==="setimmediate"?_.postMessage(ye):Re==="callHandler"?p[ye.handler](...ye.args):Re&&H("worker sent an unknown command "+Re),We.currentProxiedOperationCallerThread=void 0},_.onerror=Be=>{var ye="worker sent an error!";throw H(ye+" "+Be.filename+":"+Be.lineno+": "+Be.message),Be},S&&(_.on("message",function(Be){_.onmessage({data:Be})}),_.on("error",function(Be){_.onerror(Be)}),_.on("detachedExit",function(){}));var oe=[],Fe=["onExit","onAbort","print","printErr"];for(var je of Fe)p.hasOwnProperty(je)&&oe.push(je);_.postMessage({cmd:"load",handlers:oe,urlOrBlob:p.mainScriptUrlOrBlob||n,wasmMemory:ie,wasmModule:be})},allocateUnusedWorker:function(){var _,j=M("tfjs-backend-wasm-threaded-simd.worker.js");_=new Worker(j),We.unusedWorkers.push(_)},getNewWorker:function(){return We.unusedWorkers.length==0&&(We.allocateUnusedWorker(),We.loadWasmModuleToWorker(We.unusedWorkers[0])),We.unusedWorkers.pop()}};p.PThread=We;function wd(_){for(;_.length>0;)_.shift()(p)}function Nm(){var _=jc(),j=l()[_+52>>>2],oe=l()[_+56>>>2],Fe=j-oe;Jx(j,Fe),qc(j)}p.establishStackSpace=Nm;function Fc(_){if(C)return Ur(2,0,_);try{Mc(_)}catch(j){Cm(j)}}var _l=[];function Rm(_){var j=_l[_];return j||(_>=_l.length&&(_l.length=_+1),_l[_]=j=qa.get(_)),j}function Em(_,j){var oe=Rm(_)(j);Tn()?We.setExitStatus(oe):Zx(oe)}p.invokeEntryPoint=Em;function Mm(_){We.tlsInitFunctions.push(_)}function Fm(_){Xx(_,!w,1,!b),We.threadInitTLS()}function $m(_){C?postMessage({cmd:"cleanupThread",thread:_}):vd(_)}function $c(_,j,oe,Fe){return C?Ur(3,1,_,j,oe,Fe):Dc(_,j,oe,Fe)}function Dc(_,j,oe,Fe){if(typeof SharedArrayBuffer=="undefined")return H("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var je=[],Be=0;if(C&&(je.length===0||Be))return $c(_,j,oe,Fe);if(Be)return Be;var ye={startRoutine:oe,pthread_ptr:_,arg:Fe,transferList:je};return C?(ye.cmd="spawnThread",postMessage(ye,je),0):Sm(ye)}function Dm(){return 65536}var Pm=!0;function _m(){return Pm}function kd(_){Atomics.store(l(),_>>2,1),jc()&&Yx(_),Atomics.compareExchange(l(),_>>2,1,0)}p.executeNotifiedProxyingQueue=kd;function Om(_,j,oe,Fe){if(_==j)setTimeout(()=>kd(Fe));else if(C)postMessage({targetThread:_,cmd:"processProxyingQueue",queue:Fe});else{var je=We.pthreads[_];if(!je)return;je.postMessage({cmd:"processProxyingQueue",queue:Fe})}return 1}function zm(_,j,oe){return-1}function Lm(){si("")}function oi(_){oi.shown||(oi.shown={}),oi.shown[_]||(oi.shown[_]=1,S&&(_="warning: "+_),H(_))}function Wm(){S||w||oi("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function Bm(){return Date.now()}function Pc(){return 4294901760}function Vm(){return Pc()}var Id;S?Id=()=>{var _=process.hrtime();return _[0]*1e3+_[1]/1e6}:Id=()=>performance.timeOrigin+performance.now();function Um(_,j,oe){i().copyWithin(_>>>0,j>>>0,j+oe>>>0)}function Gm(){return S?UC().cpus().length:navigator.hardwareConcurrency}function Hm(_){var j=K2(),oe=_();return qc(j),oe}function Ur(_,j){var oe=arguments.length-2,Fe=arguments;return Hm(()=>{for(var je=oe,Be=Xc(je*8),ye=Be>>3,Re=0;Re>>0]=Nt}return Kx(_,je,Be,j)})}var Sd=[];function jm(_,j,oe){Sd.length=j;for(var Fe=oe>>3,je=0;je>>0];var Be=_<0,ye=Be?Nc[-_-1]:tf[_];return ye.apply(null,Sd)}function qm(_){try{return ie.grow(_-He.byteLength+65535>>>16),ht(ie.buffer),1}catch(j){}}function Xm(_){var j=i().length;if(_=_>>>0,_<=j)return!1;var oe=Pc();if(_>oe)return!1;let Fe=(Nt,mn)=>Nt+(mn-Nt%mn)%mn;for(var je=1;je<=4;je*=2){var Be=j*(1+.2/je);Be=Math.min(Be,_+100663296);var ye=Math.min(oe,Fe(Math.max(_,Be),65536)),Re=qm(ye);if(Re)return!0}return!1}function Km(){throw"unwind"}function _c(_){return C?Ur(4,1,_):52}function Oc(_,j,oe,Fe,je){return C?Ur(5,1,_,j,oe,Fe,je):70}var Ym=[null,[],[]];function Zm(_,j){var oe=Ym[_];j===0||j===10?((_===1?q:H)(gt(oe,0)),oe.length=0):oe.push(j)}function zc(_,j,oe,Fe){if(C)return Ur(6,1,_,j,oe,Fe);for(var je=0,Be=0;Be>>2],Re=u()[j+4>>>2];j+=8;for(var Nt=0;Nt>>0]);je+=Re}return u()[Fe>>>2]=je,0}function Lc(_){var j=p["_"+_];return j}function Jm(_,j){s().set(_,j>>>0)}function Qm(_,j,oe,Fe,je){var Be={string:fn=>{var Wl=0;if(fn!=null&&fn!==0){var t5=(fn.length<<2)+1;Wl=Xc(t5),it(fn,Wl,t5)}return Wl},array:fn=>{var Wl=Xc(fn.length);return Jm(fn,Wl),Wl}};function ye(fn){return j==="string"?dt(fn):j==="boolean"?!!fn:fn}var Re=Lc(_),Nt=[],mn=0;if(Fe)for(var br=0;brye==="number"||ye==="boolean"),Be=j!=="string";return Be&&je&&!Fe?Lc(_):function(){return Qm(_,j,oe,arguments,Fe)}}We.init();var tf=[null,Ec,Fc,$c,_c,Oc,zc],Wc={__emscripten_init_main_thread_js:Fm,__emscripten_thread_cleanup:$m,__pthread_create_js:Dc,_emscripten_default_pthread_stack_size:Dm,_emscripten_get_now_is_monotonic:_m,_emscripten_notify_task_queue:Om,_emscripten_set_offscreencanvas_size:zm,abort:Lm,emscripten_check_blocking_allowed:Wm,emscripten_date_now:Bm,emscripten_get_heap_max:Vm,emscripten_get_now:Id,emscripten_memcpy_big:Um,emscripten_num_logical_cores:Gm,emscripten_receive_on_main_thread_js:jm,emscripten_resize_heap:Xm,emscripten_unwind_to_js_event_loop:Km,exit:Mc,fd_close:_c,fd_seek:Oc,fd_write:zc,memory:ie||p.wasmMemory},qx=wm(),af=p.___wasm_call_ctors=function(){return(af=p.___wasm_call_ctors=p.asm.__wasm_call_ctors).apply(null,arguments)},nf=p._init=function(){return(nf=p._init=p.asm.init).apply(null,arguments)},rf=p._init_with_threads_count=function(){return(rf=p._init_with_threads_count=p.asm.init_with_threads_count).apply(null,arguments)},sf=p._get_threads_count=function(){return(sf=p._get_threads_count=p.asm.get_threads_count).apply(null,arguments)},of=p._register_tensor=function(){return(of=p._register_tensor=p.asm.register_tensor).apply(null,arguments)},lf=p._dispose_data=function(){return(lf=p._dispose_data=p.asm.dispose_data).apply(null,arguments)},uf=p._dispose=function(){return(uf=p._dispose=p.asm.dispose).apply(null,arguments)},df=p._Abs=function(){return(df=p._Abs=p.asm.Abs).apply(null,arguments)},pf=p._Acos=function(){return(pf=p._Acos=p.asm.Acos).apply(null,arguments)},cf=p._Acosh=function(){return(cf=p._Acosh=p.asm.Acosh).apply(null,arguments)},hf=p._Add=function(){return(hf=p._Add=p.asm.Add).apply(null,arguments)},mf=p._AddN=function(){return(mf=p._AddN=p.asm.AddN).apply(null,arguments)},ff=p._All=function(){return(ff=p._All=p.asm.All).apply(null,arguments)},gf=p._Any=function(){return(gf=p._Any=p.asm.Any).apply(null,arguments)},yf=p._ArgMax=function(){return(yf=p._ArgMax=p.asm.ArgMax).apply(null,arguments)},xf=p._ArgMin=function(){return(xf=p._ArgMin=p.asm.ArgMin).apply(null,arguments)},Af=p._Asin=function(){return(Af=p._Asin=p.asm.Asin).apply(null,arguments)},bf=p._Asinh=function(){return(bf=p._Asinh=p.asm.Asinh).apply(null,arguments)},vf=p._Atan=function(){return(vf=p._Atan=p.asm.Atan).apply(null,arguments)},wf=p._Atan2=function(){return(wf=p._Atan2=p.asm.Atan2).apply(null,arguments)},kf=p._Atanh=function(){return(kf=p._Atanh=p.asm.Atanh).apply(null,arguments)},If=p._AvgPool=function(){return(If=p._AvgPool=p.asm.AvgPool).apply(null,arguments)},Sf=p._AvgPool3D=function(){return(Sf=p._AvgPool3D=p.asm.AvgPool3D).apply(null,arguments)},Tf=p._AvgPool3DGrad=function(){return(Tf=p._AvgPool3DGrad=p.asm.AvgPool3DGrad).apply(null,arguments)},Cf=p._AvgPoolGrad=function(){return(Cf=p._AvgPoolGrad=p.asm.AvgPoolGrad).apply(null,arguments)},Nf=p._BatchMatMul=function(){return(Nf=p._BatchMatMul=p.asm.BatchMatMul).apply(null,arguments)},Rf=p._Bincount=function(){return(Rf=p._Bincount=p.asm.Bincount).apply(null,arguments)},Ef=p._BitwiseAnd=function(){return(Ef=p._BitwiseAnd=p.asm.BitwiseAnd).apply(null,arguments)},Mf=p._Ceil=function(){return(Mf=p._Ceil=p.asm.Ceil).apply(null,arguments)},Ff=p._ClipByValue=function(){return(Ff=p._ClipByValue=p.asm.ClipByValue).apply(null,arguments)},$f=p._Conv2D=function(){return($f=p._Conv2D=p.asm.Conv2D).apply(null,arguments)},Df=p._Conv2DBackpropInput=function(){return(Df=p._Conv2DBackpropInput=p.asm.Conv2DBackpropInput).apply(null,arguments)},Pf=p._Conv3D=function(){return(Pf=p._Conv3D=p.asm.Conv3D).apply(null,arguments)},_f=p._Conv3DBackpropFilterV2=function(){return(_f=p._Conv3DBackpropFilterV2=p.asm.Conv3DBackpropFilterV2).apply(null,arguments)},Of=p._Conv3DBackpropInputV2=function(){return(Of=p._Conv3DBackpropInputV2=p.asm.Conv3DBackpropInputV2).apply(null,arguments)},zf=p._Cos=function(){return(zf=p._Cos=p.asm.Cos).apply(null,arguments)},Lf=p._Cosh=function(){return(Lf=p._Cosh=p.asm.Cosh).apply(null,arguments)},Wf=p._CropAndResize=function(){return(Wf=p._CropAndResize=p.asm.CropAndResize).apply(null,arguments)},Bf=p._Cumprod=function(){return(Bf=p._Cumprod=p.asm.Cumprod).apply(null,arguments)},Vf=p._Cumsum=function(){return(Vf=p._Cumsum=p.asm.Cumsum).apply(null,arguments)},Uf=p._DenseBincount=function(){return(Uf=p._DenseBincount=p.asm.DenseBincount).apply(null,arguments)},Gf=p._DepthToSpace=function(){return(Gf=p._DepthToSpace=p.asm.DepthToSpace).apply(null,arguments)},Hf=p._DepthwiseConv2dNative=function(){return(Hf=p._DepthwiseConv2dNative=p.asm.DepthwiseConv2dNative).apply(null,arguments)},jf=p._Diag=function(){return(jf=p._Diag=p.asm.Diag).apply(null,arguments)},qf=p._Dilation2D=function(){return(qf=p._Dilation2D=p.asm.Dilation2D).apply(null,arguments)},Xf=p._Dilation2DBackpropFilter=function(){return(Xf=p._Dilation2DBackpropFilter=p.asm.Dilation2DBackpropFilter).apply(null,arguments)},Kf=p._Dilation2DBackpropInput=function(){return(Kf=p._Dilation2DBackpropInput=p.asm.Dilation2DBackpropInput).apply(null,arguments)},Yf=p._Elu=function(){return(Yf=p._Elu=p.asm.Elu).apply(null,arguments)},Zf=p._EluGrad=function(){return(Zf=p._EluGrad=p.asm.EluGrad).apply(null,arguments)},Jf=p._Equal=function(){return(Jf=p._Equal=p.asm.Equal).apply(null,arguments)},Qf=p._Erf=function(){return(Qf=p._Erf=p.asm.Erf).apply(null,arguments)},e2=p._Exp=function(){return(e2=p._Exp=p.asm.Exp).apply(null,arguments)},t2=p._Expm1=function(){return(t2=p._Expm1=p.asm.Expm1).apply(null,arguments)},a2=p._FlipLeftRight=function(){return(a2=p._FlipLeftRight=p.asm.FlipLeftRight).apply(null,arguments)},n2=p._Floor=function(){return(n2=p._Floor=p.asm.Floor).apply(null,arguments)},r2=p._FloorDiv=function(){return(r2=p._FloorDiv=p.asm.FloorDiv).apply(null,arguments)},s2=p._FusedBatchNorm=function(){return(s2=p._FusedBatchNorm=p.asm.FusedBatchNorm).apply(null,arguments)},i2=p._FusedConv2D=function(){return(i2=p._FusedConv2D=p.asm.FusedConv2D).apply(null,arguments)},o2=p._FusedDepthwiseConv2D=function(){return(o2=p._FusedDepthwiseConv2D=p.asm.FusedDepthwiseConv2D).apply(null,arguments)},l2=p._Gather=function(){return(l2=p._Gather=p.asm.Gather).apply(null,arguments)},u2=p._GatherNd=function(){return(u2=p._GatherNd=p.asm.GatherNd).apply(null,arguments)},d2=p._Greater=function(){return(d2=p._Greater=p.asm.Greater).apply(null,arguments)},p2=p._GreaterEqual=function(){return(p2=p._GreaterEqual=p.asm.GreaterEqual).apply(null,arguments)},c2=p._IsFinite=function(){return(c2=p._IsFinite=p.asm.IsFinite).apply(null,arguments)},h2=p._IsInf=function(){return(h2=p._IsInf=p.asm.IsInf).apply(null,arguments)},m2=p._IsNan=function(){return(m2=p._IsNan=p.asm.IsNan).apply(null,arguments)},f2=p._LRN=function(){return(f2=p._LRN=p.asm.LRN).apply(null,arguments)},g2=p._LRNGrad=function(){return(g2=p._LRNGrad=p.asm.LRNGrad).apply(null,arguments)},y2=p._LeakyRelu=function(){return(y2=p._LeakyRelu=p.asm.LeakyRelu).apply(null,arguments)},x2=p._Less=function(){return(x2=p._Less=p.asm.Less).apply(null,arguments)},A2=p._LessEqual=function(){return(A2=p._LessEqual=p.asm.LessEqual).apply(null,arguments)},b2=p._LinSpace=function(){return(b2=p._LinSpace=p.asm.LinSpace).apply(null,arguments)},v2=p._Log=function(){return(v2=p._Log=p.asm.Log).apply(null,arguments)},w2=p._Log1p=function(){return(w2=p._Log1p=p.asm.Log1p).apply(null,arguments)},k2=p._LogicalAnd=function(){return(k2=p._LogicalAnd=p.asm.LogicalAnd).apply(null,arguments)},I2=p._LogicalNot=function(){return(I2=p._LogicalNot=p.asm.LogicalNot).apply(null,arguments)},S2=p._LogicalOr=function(){return(S2=p._LogicalOr=p.asm.LogicalOr).apply(null,arguments)},T2=p._LogicalXor=function(){return(T2=p._LogicalXor=p.asm.LogicalXor).apply(null,arguments)},C2=p._Max=function(){return(C2=p._Max=p.asm.Max).apply(null,arguments)},N2=p._MaxPool=function(){return(N2=p._MaxPool=p.asm.MaxPool).apply(null,arguments)},R2=p._MaxPool3D=function(){return(R2=p._MaxPool3D=p.asm.MaxPool3D).apply(null,arguments)},E2=p._MaxPool3DGrad=function(){return(E2=p._MaxPool3DGrad=p.asm.MaxPool3DGrad).apply(null,arguments)},M2=p._MaxPoolGrad=function(){return(M2=p._MaxPoolGrad=p.asm.MaxPoolGrad).apply(null,arguments)},F2=p._MaxPoolWithArgmax=function(){return(F2=p._MaxPoolWithArgmax=p.asm.MaxPoolWithArgmax).apply(null,arguments)},$2=p._Maximum=function(){return($2=p._Maximum=p.asm.Maximum).apply(null,arguments)},D2=p._Mean=function(){return(D2=p._Mean=p.asm.Mean).apply(null,arguments)},P2=p._Min=function(){return(P2=p._Min=p.asm.Min).apply(null,arguments)},_2=p._Minimum=function(){return(_2=p._Minimum=p.asm.Minimum).apply(null,arguments)},O2=p._MirrorPad=function(){return(O2=p._MirrorPad=p.asm.MirrorPad).apply(null,arguments)},z2=p._Mod=function(){return(z2=p._Mod=p.asm.Mod).apply(null,arguments)},L2=p._Multinomial=function(){return(L2=p._Multinomial=p.asm.Multinomial).apply(null,arguments)},W2=p._Multiply=function(){return(W2=p._Multiply=p.asm.Multiply).apply(null,arguments)},B2=p._Neg=function(){return(B2=p._Neg=p.asm.Neg).apply(null,arguments)},V2=p._NonMaxSuppressionV3=function(){return(V2=p._NonMaxSuppressionV3=p.asm.NonMaxSuppressionV3).apply(null,arguments)},U2=p._NonMaxSuppressionV4=function(){return(U2=p._NonMaxSuppressionV4=p.asm.NonMaxSuppressionV4).apply(null,arguments)},Bc=p._NonMaxSuppressionV5=function(){return(Bc=p._NonMaxSuppressionV5=p.asm.NonMaxSuppressionV5).apply(null,arguments)},Vc=p._NotEqual=function(){return(Vc=p._NotEqual=p.asm.NotEqual).apply(null,arguments)},Td=p._OneHot=function(){return(Td=p._OneHot=p.asm.OneHot).apply(null,arguments)},G2=p._PadV2=function(){return(G2=p._PadV2=p.asm.PadV2).apply(null,arguments)},H2=p._Pow=function(){return(H2=p._Pow=p.asm.Pow).apply(null,arguments)},Ol=p._Prelu=function(){return(Ol=p._Prelu=p.asm.Prelu).apply(null,arguments)},Uc=p._Prod=function(){return(Uc=p._Prod=p.asm.Prod).apply(null,arguments)},zl=p._RealDiv=function(){return(zl=p._RealDiv=p.asm.RealDiv).apply(null,arguments)},Ll=p._Reciprocal=function(){return(Ll=p._Reciprocal=p.asm.Reciprocal).apply(null,arguments)},j2=p._Relu=function(){return(j2=p._Relu=p.asm.Relu).apply(null,arguments)},Y=p._Relu6=function(){return(Y=p._Relu6=p.asm.Relu6).apply(null,arguments)},se=p._ResizeBilinear=function(){return(se=p._ResizeBilinear=p.asm.ResizeBilinear).apply(null,arguments)},Me=p._ResizeBilinearGrad=function(){return(Me=p._ResizeBilinearGrad=p.asm.ResizeBilinearGrad).apply(null,arguments)},et=p._ResizeNearestNeighbor=function(){return(et=p._ResizeNearestNeighbor=p.asm.ResizeNearestNeighbor).apply(null,arguments)},kt=p._ResizeNearestNeighborGrad=function(){return(kt=p._ResizeNearestNeighborGrad=p.asm.ResizeNearestNeighborGrad).apply(null,arguments)},It=p._Reverse=function(){return(It=p._Reverse=p.asm.Reverse).apply(null,arguments)},Je=p._RotateWithOffset=function(){return(Je=p._RotateWithOffset=p.asm.RotateWithOffset).apply(null,arguments)},Ze=p._Round=function(){return(Ze=p._Round=p.asm.Round).apply(null,arguments)},Wt=p._Rsqrt=function(){return(Wt=p._Rsqrt=p.asm.Rsqrt).apply(null,arguments)},hn=p._ScatterNd=function(){return(hn=p._ScatterNd=p.asm.ScatterNd).apply(null,arguments)},Ar=p._SearchSorted=function(){return(Ar=p._SearchSorted=p.asm.SearchSorted).apply(null,arguments)},Gc=p._SelectV2=function(){return(Gc=p._SelectV2=p.asm.SelectV2).apply(null,arguments)},Cd=p._Selu=function(){return(Cd=p._Selu=p.asm.Selu).apply(null,arguments)},q2=p._Sigmoid=function(){return(q2=p._Sigmoid=p.asm.Sigmoid).apply(null,arguments)},Oa=p._Sign=function(){return(Oa=p._Sign=p.asm.Sign).apply(null,arguments)},Gr=p._Sin=function(){return(Gr=p._Sin=p.asm.Sin).apply(null,arguments)},Hc=p._Sinh=function(){return(Hc=p._Sinh=p.asm.Sinh).apply(null,arguments)},LT=p._Softmax=function(){return(LT=p._Softmax=p.asm.Softmax).apply(null,arguments)},WT=p._Softplus=function(){return(WT=p._Softplus=p.asm.Softplus).apply(null,arguments)},BT=p._SparseFillEmptyRows=function(){return(BT=p._SparseFillEmptyRows=p.asm.SparseFillEmptyRows).apply(null,arguments)},VT=p._SparseReshape=function(){return(VT=p._SparseReshape=p.asm.SparseReshape).apply(null,arguments)},UT=p._SparseSegmentReduction=function(){return(UT=p._SparseSegmentReduction=p.asm.SparseSegmentReduction).apply(null,arguments)},GT=p._SparseToDense=function(){return(GT=p._SparseToDense=p.asm.SparseToDense).apply(null,arguments)},HT=p._Sqrt=function(){return(HT=p._Sqrt=p.asm.Sqrt).apply(null,arguments)},jT=p._Square=function(){return(jT=p._Square=p.asm.Square).apply(null,arguments)},qT=p._SquaredDifference=function(){return(qT=p._SquaredDifference=p.asm.SquaredDifference).apply(null,arguments)},XT=p._Step=function(){return(XT=p._Step=p.asm.Step).apply(null,arguments)},KT=p._StridedSlice=function(){return(KT=p._StridedSlice=p.asm.StridedSlice).apply(null,arguments)},YT=p._Sub=function(){return(YT=p._Sub=p.asm.Sub).apply(null,arguments)},ZT=p._Sum=function(){return(ZT=p._Sum=p.asm.Sum).apply(null,arguments)},JT=p._Tan=function(){return(JT=p._Tan=p.asm.Tan).apply(null,arguments)},QT=p._Tanh=function(){return(QT=p._Tanh=p.asm.Tanh).apply(null,arguments)},eC=p._TensorScatterUpdate=function(){return(eC=p._TensorScatterUpdate=p.asm.TensorScatterUpdate).apply(null,arguments)},tC=p._Tile=function(){return(tC=p._Tile=p.asm.Tile).apply(null,arguments)},aC=p._TopK=function(){return(aC=p._TopK=p.asm.TopK).apply(null,arguments)},nC=p._Transform=function(){return(nC=p._Transform=p.asm.Transform).apply(null,arguments)},rC=p._Transpose=function(){return(rC=p._Transpose=p.asm.Transpose).apply(null,arguments)},sC=p.__FusedMatMul=function(){return(sC=p.__FusedMatMul=p.asm._FusedMatMul).apply(null,arguments)},iC=p._malloc=function(){return(iC=p._malloc=p.asm.malloc).apply(null,arguments)},oC=p._free=function(){return(oC=p._free=p.asm.free).apply(null,arguments)},lC=p.__emscripten_tls_init=function(){return(lC=p.__emscripten_tls_init=p.asm._emscripten_tls_init).apply(null,arguments)},jc=p._pthread_self=function(){return(jc=p._pthread_self=p.asm.pthread_self).apply(null,arguments)},uC=p.___errno_location=function(){return(uC=p.___errno_location=p.asm.__errno_location).apply(null,arguments)},Xx=p.__emscripten_thread_init=function(){return(Xx=p.__emscripten_thread_init=p.asm._emscripten_thread_init).apply(null,arguments)},dC=p.__emscripten_thread_crashed=function(){return(dC=p.__emscripten_thread_crashed=p.asm._emscripten_thread_crashed).apply(null,arguments)},pC=p._emscripten_main_thread_process_queued_calls=function(){return(pC=p._emscripten_main_thread_process_queued_calls=p.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},cC=p._emscripten_main_browser_thread_id=function(){return(cC=p._emscripten_main_browser_thread_id=p.asm.emscripten_main_browser_thread_id).apply(null,arguments)},Kx=p._emscripten_run_in_main_runtime_thread_js=function(){return(Kx=p._emscripten_run_in_main_runtime_thread_js=p.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)},hC=p._emscripten_dispatch_to_thread_=function(){return(hC=p._emscripten_dispatch_to_thread_=p.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},Yx=p.__emscripten_proxy_execute_task_queue=function(){return(Yx=p.__emscripten_proxy_execute_task_queue=p.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)},X2=p.__emscripten_thread_free_data=function(){return(X2=p.__emscripten_thread_free_data=p.asm._emscripten_thread_free_data).apply(null,arguments)},Zx=p.__emscripten_thread_exit=function(){return(Zx=p.__emscripten_thread_exit=p.asm._emscripten_thread_exit).apply(null,arguments)},Jx=p._emscripten_stack_set_limits=function(){return(Jx=p._emscripten_stack_set_limits=p.asm.emscripten_stack_set_limits).apply(null,arguments)},K2=p.stackSave=function(){return(K2=p.stackSave=p.asm.stackSave).apply(null,arguments)},qc=p.stackRestore=function(){return(qc=p.stackRestore=p.asm.stackRestore).apply(null,arguments)},Xc=p.stackAlloc=function(){return(Xc=p.stackAlloc=p.asm.stackAlloc).apply(null,arguments)},mC=p.dynCall_iijjiiii=function(){return(mC=p.dynCall_iijjiiii=p.asm.dynCall_iijjiiii).apply(null,arguments)},fC=p.dynCall_jiji=function(){return(fC=p.dynCall_jiji=p.asm.dynCall_jiji).apply(null,arguments)};p.keepRuntimeAlive=Tn,p.wasmMemory=ie,p.cwrap=ef,p.ExitStatus=ii,p.PThread=We;var Kc;xr=function _(){Kc||Qx(),Kc||(xr=_)};function Qx(_){if(_=_||y,Vr>0)return;if(C){h(p),Yt(),startWorker(p);return}if(Br(),Vr>0)return;function j(){Kc||(Kc=!0,p.calledRun=!0,!Ce&&(Yt(),h(p),p.onRuntimeInitialized&&p.onRuntimeInitialized(),Ic()))}p.setStatus?(p.setStatus("Running..."),setTimeout(function(){setTimeout(function(){p.setStatus("")},1),j()},1)):j()}if(p.preInit)for(typeof p.preInit=="function"&&(p.preInit=[p.preInit]);p.preInit.length>0;)p.preInit.pop()();Qx();var Yc;f&&(Yc={uncaughtException:process.listeners("uncaughtException").filter(function(_){return!f.uncaughtException.indexOf(_)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(_){return!f.unhandledRejection.indexOf(_)>-1})});var Zc;if(typeof WasmBackendModule!="undefined")Zc=WasmBackendModule;else if(typeof r!="undefined")Zc=r;else throw new Error("Could not find wasm module in post.js");if(Yc){var gC=Zc._dispose;Zc._dispose=function(){gC(),Yc.uncaughtException.forEach(function(_){process.removeListener("uncaughtException",_)}),Yc.unhandledRejection.forEach(function(_){process.removeListener("unhandledRejection",_)})}}return r.ready}})();typeof e=="object"&&typeof t=="object"?t.exports=a:typeof define=="function"&&define.amd?define([],function(){return a}):typeof e=="object"&&(e.WasmBackendModuleThreadedSimd=a)}),HC=Xt((e,t)=>{t.exports.wasmWorkerContents=`"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+" +");return}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;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"})};self.onmessage=e=>{try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}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)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}};`}),jC=Xt((e,t)=>{var a=(()=>{var n=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(n=n||__filename),function(r){r=r||{};var s=typeof r!="undefined"?r:{},i,o;s.ready=new Promise(function(Y,se){i=Y,o=se});var l;typeof process!="undefined"&&process.listeners&&(l={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var u=Object.assign({},s),d=[],c="./this.program",p=(Y,se)=>{throw se},h=typeof window=="object",m=typeof importScripts=="function",f=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",g="";function y(Y){return s.locateFile?s.locateFile(Y,g):g+Y}var x,A,b,w;function S(Y){Y instanceof Dl||F("exiting due to exception: "+Y)}if(f){var C=MA(),N=FA();m?g=N.dirname(g)+"/":g=__dirname+"/",x=(Y,se)=>(Y=Br(Y)?new URL(Y):N.normalize(Y),C.readFileSync(Y,se?void 0:"utf8")),b=Y=>{var se=x(Y,!0);return se.buffer||(se=new Uint8Array(se)),se},A=(Y,se,Me)=>{Y=Br(Y)?new URL(Y):N.normalize(Y),C.readFile(Y,function(et,kt){et?Me(et):se(kt.buffer)})},process.argv.length>1&&(c=process.argv[1].replace(/\\/g,"/")),d=process.argv.slice(2),process.on("uncaughtException",function(Y){if(!(Y instanceof Dl))throw Y}),process.on("unhandledRejection",function(Y){throw Y}),p=(Y,se)=>{if(ja())throw process.exitCode=Y,se;S(se),process.exit(Y)},s.inspect=function(){return"[Emscripten Module object]"}}else(h||m)&&(m?g=self.location.href:typeof document!="undefined"&&document.currentScript&&(g=document.currentScript.src),n&&(g=n),g.indexOf("blob:")!==0?g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):g="",x=Y=>{var se=new XMLHttpRequest;return se.open("GET",Y,!1),se.send(null),se.responseText},m&&(b=Y=>{var se=new XMLHttpRequest;return se.open("GET",Y,!1),se.responseType="arraybuffer",se.send(null),new Uint8Array(se.response)}),A=(Y,se,Me)=>{var et=new XMLHttpRequest;et.open("GET",Y,!0),et.responseType="arraybuffer",et.onload=()=>{if(et.status==200||et.status==0&&et.response){se(et.response);return}Me()},et.onerror=Me,et.send(null)},w=Y=>document.title=Y);var M=s.print||console.log.bind(console),F=s.printErr||console.warn.bind(console);Object.assign(s,u),u=null,s.arguments&&(d=s.arguments),s.thisProgram&&(c=s.thisProgram),s.quit&&(p=s.quit);var E=4,T;s.wasmBinary&&(T=s.wasmBinary);var D=s.noExitRuntime||!0;typeof WebAssembly!="object"&&Kn("no native wasm support detected");var O,W=!1,$;function U(Y,se){Y||Kn(se)}var G=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function q(Y,se,Me){se>>>=0;for(var et=se+Me,kt=se;Y[kt]&&!(kt>=et);)++kt;if(kt-se>16&&Y.buffer&&G)return G.decode(Y.subarray(se,kt));for(var It="";se>10,56320|hn&1023)}}return It}function H(Y,se){return Y>>>=0,Y?q(ee,Y,se):""}function V(Y,se,Me,et){if(Me>>>=0,!(et>0))return 0;for(var kt=Me,It=Me+et-1,Je=0;Je=55296&&Ze<=57343){var Wt=Y.charCodeAt(++Je);Ze=65536+((Ze&1023)<<10)|Wt&1023}if(Ze<=127){if(Me>=It)break;se[Me++>>>0]=Ze}else if(Ze<=2047){if(Me+1>=It)break;se[Me++>>>0]=192|Ze>>6,se[Me++>>>0]=128|Ze&63}else if(Ze<=65535){if(Me+2>=It)break;se[Me++>>>0]=224|Ze>>12,se[Me++>>>0]=128|Ze>>6&63,se[Me++>>>0]=128|Ze&63}else{if(Me+3>=It)break;se[Me++>>>0]=240|Ze>>18,se[Me++>>>0]=128|Ze>>12&63,se[Me++>>>0]=128|Ze>>6&63,se[Me++>>>0]=128|Ze&63}}return se[Me>>>0]=0,Me-kt}function Z(Y,se,Me){return V(Y,ee,se,Me)}var X,re,ee,ge,ie,be,Ce,Ee,Le;function qe(Y){X=Y,s.HEAP8=re=new Int8Array(Y),s.HEAP16=ge=new Int16Array(Y),s.HEAP32=be=new Int32Array(Y),s.HEAPU8=ee=new Uint8Array(Y),s.HEAPU16=ie=new Uint16Array(Y),s.HEAPU32=Ce=new Uint32Array(Y),s.HEAPF32=Ee=new Float32Array(Y),s.HEAPF64=Le=new Float64Array(Y)}var gt=s.INITIAL_MEMORY||16777216,dt,st=[],it=[],He=[],xt=!1;function ja(){return D}function Lt(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Da(s.preRun.shift());xr(st)}function pn(){xt=!0,xr(it)}function ua(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)Pa(s.postRun.shift());xr(He)}function Da(Y){st.unshift(Y)}function cn(Y){it.unshift(Y)}function Pa(Y){He.unshift(Y)}var ht=0,_a=null,qa=null;function yr(Y){ht++,s.monitorRunDependencies&&s.monitorRunDependencies(ht)}function $l(Y){if(ht--,s.monitorRunDependencies&&s.monitorRunDependencies(ht),ht==0&&(_a!==null&&(clearInterval(_a),_a=null),qa)){var se=qa;qa=null,se()}}function Kn(Y){s.onAbort&&s.onAbort(Y),Y="Aborted("+Y+")",F(Y),W=!0,$=1,Y+=". Build with -sASSERTIONS for more info.";var se=new WebAssembly.RuntimeError(Y);throw o(se),se}var bd="data:application/octet-stream;base64,";function Tn(Y){return Y.startsWith(bd)}function Br(Y){return Y.startsWith("file://")}var Yt;Yt="tfjs-backend-wasm.wasm",Tn(Yt)||(Yt=y(Yt));function Ic(Y){try{if(Y==Yt&&T)return new Uint8Array(T);if(b)return b(Y);throw"both async and sync fetching of the wasm failed"}catch(se){Kn(se)}}function ym(){if(!T&&(h||m)){if(typeof fetch=="function"&&!Br(Yt))return fetch(Yt,{credentials:"same-origin"}).then(function(Y){if(!Y.ok)throw"failed to load wasm binary file at '"+Yt+"'";return Y.arrayBuffer()}).catch(function(){return Ic(Yt)});if(A)return new Promise(function(Y,se){A(Yt,function(Me){Y(new Uint8Array(Me))},se)})}return Promise.resolve().then(function(){return Ic(Yt)})}function xm(){var Y={env:vd,wasi_snapshot_preview1:vd};function se(Je,Ze){var Wt=Je.exports;s.asm=Wt,O=s.asm.memory,qe(O.buffer),dt=s.asm.__indirect_function_table,cn(s.asm.__wasm_call_ctors),$l("wasm-instantiate")}yr("wasm-instantiate");function Me(Je){se(Je.instance)}function et(Je){return ym().then(function(Ze){return WebAssembly.instantiate(Ze,Y)}).then(function(Ze){return Ze}).then(Je,function(Ze){F("failed to asynchronously prepare wasm: "+Ze),Kn(Ze)})}function kt(){return!T&&typeof WebAssembly.instantiateStreaming=="function"&&!Tn(Yt)&&!Br(Yt)&&!f&&typeof fetch=="function"?fetch(Yt,{credentials:"same-origin"}).then(function(Je){var Ze=WebAssembly.instantiateStreaming(Je,Y);return Ze.then(Me,function(Wt){return F("wasm streaming compile failed: "+Wt),F("falling back to ArrayBuffer instantiation"),et(Me)})}):et(Me)}if(s.instantiateWasm)try{var It=s.instantiateWasm(Y,se);return It}catch(Je){F("Module.instantiateWasm callback failed with error: "+Je),o(Je)}return kt().catch(o),{}}var Gx,Vr;function Dl(Y){this.name="ExitStatus",this.message="Program terminated with exit("+Y+")",this.status=Y}function xr(Y){for(;Y.length>0;)Y.shift()(s)}function Am(){Kn("")}function Sc(){return 4294901760}function si(){return Sc()}function bm(Y,se,Me){ee.copyWithin(Y>>>0,se>>>0,se+Me>>>0)}function Tc(Y){try{return O.grow(Y-X.byteLength+65535>>>16),qe(O.buffer),1}catch(se){}}function Pl(Y){var se=ee.length;Y=Y>>>0;var Me=Sc();if(Y>Me)return!1;let et=(Wt,hn)=>Wt+(hn-Wt%hn)%hn;for(var kt=1;kt<=4;kt*=2){var It=se*(1+.2/kt);It=Math.min(It,Y+100663296);var Je=Math.min(Me,et(Math.max(Y,It),65536)),Ze=Tc(Je);if(Ze)return!0}return!1}var ma={varargs:void 0,get:function(){ma.varargs+=4;var Y=be[ma.varargs-4>>>2];return Y},getStr:function(Y){var se=H(Y);return se}};function Cc(Y){return 52}function vm(Y,se,Me,et,kt){return 70}var wm=[null,[],[]];function Hx(Y,se){var Me=wm[Y];se===0||se===10?((Y===1?M:F)(q(Me,0)),Me.length=0):Me.push(se)}function jx(Y,se,Me,et){for(var kt=0,It=0;It>>2],Ze=Ce[se+4>>>2];se+=8;for(var Wt=0;Wt>>0]);kt+=Ze}return Ce[et>>>2]=kt,0}function Nc(Y){var se=s["_"+Y];return se}function ii(Y,se){re.set(Y,se>>>0)}function km(Y,se,Me,et,kt){var It={string:Oa=>{var Gr=0;if(Oa!=null&&Oa!==0){var Hc=(Oa.length<<2)+1;Gr=Td(Hc),Z(Oa,Gr,Hc)}return Gr},array:Oa=>{var Gr=Td(Oa.length);return ii(Oa,Gr),Gr}};function Je(Oa){return se==="string"?H(Oa):se==="boolean"?!!Oa:Oa}var Ze=Nc(Y),Wt=[],hn=0;if(et)for(var Ar=0;ArJe==="number"||Je==="boolean"),It=se!=="string";return It&&kt&&!et?Nc(Y):function(){return km(Y,se,Me,arguments,et)}}var vd={abort:Am,emscripten_get_heap_max:si,emscripten_memcpy_big:bm,emscripten_resize_heap:Pl,fd_close:Cc,fd_seek:vm,fd_write:jx},Sm=xm(),Rc=s.___wasm_call_ctors=function(){return(Rc=s.___wasm_call_ctors=s.asm.__wasm_call_ctors).apply(null,arguments)},Ec=s._init=function(){return(Ec=s._init=s.asm.init).apply(null,arguments)},Tm=s._init_with_threads_count=function(){return(Tm=s._init_with_threads_count=s.asm.init_with_threads_count).apply(null,arguments)},Mc=s._get_threads_count=function(){return(Mc=s._get_threads_count=s.asm.get_threads_count).apply(null,arguments)},Cm=s._register_tensor=function(){return(Cm=s._register_tensor=s.asm.register_tensor).apply(null,arguments)},We=s._dispose_data=function(){return(We=s._dispose_data=s.asm.dispose_data).apply(null,arguments)},wd=s._dispose=function(){return(wd=s._dispose=s.asm.dispose).apply(null,arguments)},Nm=s._Abs=function(){return(Nm=s._Abs=s.asm.Abs).apply(null,arguments)},Fc=s._Acos=function(){return(Fc=s._Acos=s.asm.Acos).apply(null,arguments)},_l=s._Acosh=function(){return(_l=s._Acosh=s.asm.Acosh).apply(null,arguments)},Rm=s._Add=function(){return(Rm=s._Add=s.asm.Add).apply(null,arguments)},Em=s._AddN=function(){return(Em=s._AddN=s.asm.AddN).apply(null,arguments)},Mm=s._All=function(){return(Mm=s._All=s.asm.All).apply(null,arguments)},Fm=s._Any=function(){return(Fm=s._Any=s.asm.Any).apply(null,arguments)},$m=s._ArgMax=function(){return($m=s._ArgMax=s.asm.ArgMax).apply(null,arguments)},$c=s._ArgMin=function(){return($c=s._ArgMin=s.asm.ArgMin).apply(null,arguments)},Dc=s._Asin=function(){return(Dc=s._Asin=s.asm.Asin).apply(null,arguments)},Dm=s._Asinh=function(){return(Dm=s._Asinh=s.asm.Asinh).apply(null,arguments)},Pm=s._Atan=function(){return(Pm=s._Atan=s.asm.Atan).apply(null,arguments)},_m=s._Atan2=function(){return(_m=s._Atan2=s.asm.Atan2).apply(null,arguments)},kd=s._Atanh=function(){return(kd=s._Atanh=s.asm.Atanh).apply(null,arguments)},Om=s._AvgPool=function(){return(Om=s._AvgPool=s.asm.AvgPool).apply(null,arguments)},zm=s._AvgPool3D=function(){return(zm=s._AvgPool3D=s.asm.AvgPool3D).apply(null,arguments)},Lm=s._AvgPool3DGrad=function(){return(Lm=s._AvgPool3DGrad=s.asm.AvgPool3DGrad).apply(null,arguments)},oi=s._AvgPoolGrad=function(){return(oi=s._AvgPoolGrad=s.asm.AvgPoolGrad).apply(null,arguments)},Wm=s._BatchMatMul=function(){return(Wm=s._BatchMatMul=s.asm.BatchMatMul).apply(null,arguments)},Bm=s._Bincount=function(){return(Bm=s._Bincount=s.asm.Bincount).apply(null,arguments)},Pc=s._BitwiseAnd=function(){return(Pc=s._BitwiseAnd=s.asm.BitwiseAnd).apply(null,arguments)},Vm=s._Ceil=function(){return(Vm=s._Ceil=s.asm.Ceil).apply(null,arguments)},Id=s._ClipByValue=function(){return(Id=s._ClipByValue=s.asm.ClipByValue).apply(null,arguments)},Um=s._Conv2D=function(){return(Um=s._Conv2D=s.asm.Conv2D).apply(null,arguments)},Gm=s._Conv2DBackpropInput=function(){return(Gm=s._Conv2DBackpropInput=s.asm.Conv2DBackpropInput).apply(null,arguments)},Hm=s._Conv3D=function(){return(Hm=s._Conv3D=s.asm.Conv3D).apply(null,arguments)},Ur=s._Conv3DBackpropFilterV2=function(){return(Ur=s._Conv3DBackpropFilterV2=s.asm.Conv3DBackpropFilterV2).apply(null,arguments)},Sd=s._Conv3DBackpropInputV2=function(){return(Sd=s._Conv3DBackpropInputV2=s.asm.Conv3DBackpropInputV2).apply(null,arguments)},jm=s._Cos=function(){return(jm=s._Cos=s.asm.Cos).apply(null,arguments)},qm=s._Cosh=function(){return(qm=s._Cosh=s.asm.Cosh).apply(null,arguments)},Xm=s._CropAndResize=function(){return(Xm=s._CropAndResize=s.asm.CropAndResize).apply(null,arguments)},Km=s._Cumprod=function(){return(Km=s._Cumprod=s.asm.Cumprod).apply(null,arguments)},_c=s._Cumsum=function(){return(_c=s._Cumsum=s.asm.Cumsum).apply(null,arguments)},Oc=s._DenseBincount=function(){return(Oc=s._DenseBincount=s.asm.DenseBincount).apply(null,arguments)},Ym=s._DepthToSpace=function(){return(Ym=s._DepthToSpace=s.asm.DepthToSpace).apply(null,arguments)},Zm=s._DepthwiseConv2dNative=function(){return(Zm=s._DepthwiseConv2dNative=s.asm.DepthwiseConv2dNative).apply(null,arguments)},zc=s._Diag=function(){return(zc=s._Diag=s.asm.Diag).apply(null,arguments)},Lc=s._Dilation2D=function(){return(Lc=s._Dilation2D=s.asm.Dilation2D).apply(null,arguments)},Jm=s._Dilation2DBackpropFilter=function(){return(Jm=s._Dilation2DBackpropFilter=s.asm.Dilation2DBackpropFilter).apply(null,arguments)},Qm=s._Dilation2DBackpropInput=function(){return(Qm=s._Dilation2DBackpropInput=s.asm.Dilation2DBackpropInput).apply(null,arguments)},ef=s._Elu=function(){return(ef=s._Elu=s.asm.Elu).apply(null,arguments)},tf=s._EluGrad=function(){return(tf=s._EluGrad=s.asm.EluGrad).apply(null,arguments)},Wc=s._Equal=function(){return(Wc=s._Equal=s.asm.Equal).apply(null,arguments)},qx=s._Erf=function(){return(qx=s._Erf=s.asm.Erf).apply(null,arguments)},af=s._Exp=function(){return(af=s._Exp=s.asm.Exp).apply(null,arguments)},nf=s._Expm1=function(){return(nf=s._Expm1=s.asm.Expm1).apply(null,arguments)},rf=s._FlipLeftRight=function(){return(rf=s._FlipLeftRight=s.asm.FlipLeftRight).apply(null,arguments)},sf=s._Floor=function(){return(sf=s._Floor=s.asm.Floor).apply(null,arguments)},of=s._FloorDiv=function(){return(of=s._FloorDiv=s.asm.FloorDiv).apply(null,arguments)},lf=s._FusedBatchNorm=function(){return(lf=s._FusedBatchNorm=s.asm.FusedBatchNorm).apply(null,arguments)},uf=s._FusedConv2D=function(){return(uf=s._FusedConv2D=s.asm.FusedConv2D).apply(null,arguments)},df=s._FusedDepthwiseConv2D=function(){return(df=s._FusedDepthwiseConv2D=s.asm.FusedDepthwiseConv2D).apply(null,arguments)},pf=s._Gather=function(){return(pf=s._Gather=s.asm.Gather).apply(null,arguments)},cf=s._GatherNd=function(){return(cf=s._GatherNd=s.asm.GatherNd).apply(null,arguments)},hf=s._Greater=function(){return(hf=s._Greater=s.asm.Greater).apply(null,arguments)},mf=s._GreaterEqual=function(){return(mf=s._GreaterEqual=s.asm.GreaterEqual).apply(null,arguments)},ff=s._IsFinite=function(){return(ff=s._IsFinite=s.asm.IsFinite).apply(null,arguments)},gf=s._IsInf=function(){return(gf=s._IsInf=s.asm.IsInf).apply(null,arguments)},yf=s._IsNan=function(){return(yf=s._IsNan=s.asm.IsNan).apply(null,arguments)},xf=s._LRN=function(){return(xf=s._LRN=s.asm.LRN).apply(null,arguments)},Af=s._LRNGrad=function(){return(Af=s._LRNGrad=s.asm.LRNGrad).apply(null,arguments)},bf=s._LeakyRelu=function(){return(bf=s._LeakyRelu=s.asm.LeakyRelu).apply(null,arguments)},vf=s._Less=function(){return(vf=s._Less=s.asm.Less).apply(null,arguments)},wf=s._LessEqual=function(){return(wf=s._LessEqual=s.asm.LessEqual).apply(null,arguments)},kf=s._LinSpace=function(){return(kf=s._LinSpace=s.asm.LinSpace).apply(null,arguments)},If=s._Log=function(){return(If=s._Log=s.asm.Log).apply(null,arguments)},Sf=s._Log1p=function(){return(Sf=s._Log1p=s.asm.Log1p).apply(null,arguments)},Tf=s._LogicalAnd=function(){return(Tf=s._LogicalAnd=s.asm.LogicalAnd).apply(null,arguments)},Cf=s._LogicalNot=function(){return(Cf=s._LogicalNot=s.asm.LogicalNot).apply(null,arguments)},Nf=s._LogicalOr=function(){return(Nf=s._LogicalOr=s.asm.LogicalOr).apply(null,arguments)},Rf=s._LogicalXor=function(){return(Rf=s._LogicalXor=s.asm.LogicalXor).apply(null,arguments)},Ef=s._Max=function(){return(Ef=s._Max=s.asm.Max).apply(null,arguments)},Mf=s._MaxPool=function(){return(Mf=s._MaxPool=s.asm.MaxPool).apply(null,arguments)},Ff=s._MaxPool3D=function(){return(Ff=s._MaxPool3D=s.asm.MaxPool3D).apply(null,arguments)},$f=s._MaxPool3DGrad=function(){return($f=s._MaxPool3DGrad=s.asm.MaxPool3DGrad).apply(null,arguments)},Df=s._MaxPoolGrad=function(){return(Df=s._MaxPoolGrad=s.asm.MaxPoolGrad).apply(null,arguments)},Pf=s._MaxPoolWithArgmax=function(){return(Pf=s._MaxPoolWithArgmax=s.asm.MaxPoolWithArgmax).apply(null,arguments)},_f=s._Maximum=function(){return(_f=s._Maximum=s.asm.Maximum).apply(null,arguments)},Of=s._Mean=function(){return(Of=s._Mean=s.asm.Mean).apply(null,arguments)},zf=s._Min=function(){return(zf=s._Min=s.asm.Min).apply(null,arguments)},Lf=s._Minimum=function(){return(Lf=s._Minimum=s.asm.Minimum).apply(null,arguments)},Wf=s._MirrorPad=function(){return(Wf=s._MirrorPad=s.asm.MirrorPad).apply(null,arguments)},Bf=s._Mod=function(){return(Bf=s._Mod=s.asm.Mod).apply(null,arguments)},Vf=s._Multinomial=function(){return(Vf=s._Multinomial=s.asm.Multinomial).apply(null,arguments)},Uf=s._Multiply=function(){return(Uf=s._Multiply=s.asm.Multiply).apply(null,arguments)},Gf=s._Neg=function(){return(Gf=s._Neg=s.asm.Neg).apply(null,arguments)},Hf=s._NonMaxSuppressionV3=function(){return(Hf=s._NonMaxSuppressionV3=s.asm.NonMaxSuppressionV3).apply(null,arguments)},jf=s._NonMaxSuppressionV4=function(){return(jf=s._NonMaxSuppressionV4=s.asm.NonMaxSuppressionV4).apply(null,arguments)},qf=s._NonMaxSuppressionV5=function(){return(qf=s._NonMaxSuppressionV5=s.asm.NonMaxSuppressionV5).apply(null,arguments)},Xf=s._NotEqual=function(){return(Xf=s._NotEqual=s.asm.NotEqual).apply(null,arguments)},Kf=s._OneHot=function(){return(Kf=s._OneHot=s.asm.OneHot).apply(null,arguments)},Yf=s._PadV2=function(){return(Yf=s._PadV2=s.asm.PadV2).apply(null,arguments)},Zf=s._Pow=function(){return(Zf=s._Pow=s.asm.Pow).apply(null,arguments)},Jf=s._Prelu=function(){return(Jf=s._Prelu=s.asm.Prelu).apply(null,arguments)},Qf=s._Prod=function(){return(Qf=s._Prod=s.asm.Prod).apply(null,arguments)},e2=s._RealDiv=function(){return(e2=s._RealDiv=s.asm.RealDiv).apply(null,arguments)},t2=s._Reciprocal=function(){return(t2=s._Reciprocal=s.asm.Reciprocal).apply(null,arguments)},a2=s._Relu=function(){return(a2=s._Relu=s.asm.Relu).apply(null,arguments)},n2=s._Relu6=function(){return(n2=s._Relu6=s.asm.Relu6).apply(null,arguments)},r2=s._ResizeBilinear=function(){return(r2=s._ResizeBilinear=s.asm.ResizeBilinear).apply(null,arguments)},s2=s._ResizeBilinearGrad=function(){return(s2=s._ResizeBilinearGrad=s.asm.ResizeBilinearGrad).apply(null,arguments)},i2=s._ResizeNearestNeighbor=function(){return(i2=s._ResizeNearestNeighbor=s.asm.ResizeNearestNeighbor).apply(null,arguments)},o2=s._ResizeNearestNeighborGrad=function(){return(o2=s._ResizeNearestNeighborGrad=s.asm.ResizeNearestNeighborGrad).apply(null,arguments)},l2=s._Reverse=function(){return(l2=s._Reverse=s.asm.Reverse).apply(null,arguments)},u2=s._RotateWithOffset=function(){return(u2=s._RotateWithOffset=s.asm.RotateWithOffset).apply(null,arguments)},d2=s._Round=function(){return(d2=s._Round=s.asm.Round).apply(null,arguments)},p2=s._Rsqrt=function(){return(p2=s._Rsqrt=s.asm.Rsqrt).apply(null,arguments)},c2=s._ScatterNd=function(){return(c2=s._ScatterNd=s.asm.ScatterNd).apply(null,arguments)},h2=s._SearchSorted=function(){return(h2=s._SearchSorted=s.asm.SearchSorted).apply(null,arguments)},m2=s._SelectV2=function(){return(m2=s._SelectV2=s.asm.SelectV2).apply(null,arguments)},f2=s._Selu=function(){return(f2=s._Selu=s.asm.Selu).apply(null,arguments)},g2=s._Sigmoid=function(){return(g2=s._Sigmoid=s.asm.Sigmoid).apply(null,arguments)},y2=s._Sign=function(){return(y2=s._Sign=s.asm.Sign).apply(null,arguments)},x2=s._Sin=function(){return(x2=s._Sin=s.asm.Sin).apply(null,arguments)},A2=s._Sinh=function(){return(A2=s._Sinh=s.asm.Sinh).apply(null,arguments)},b2=s._Softmax=function(){return(b2=s._Softmax=s.asm.Softmax).apply(null,arguments)},v2=s._Softplus=function(){return(v2=s._Softplus=s.asm.Softplus).apply(null,arguments)},w2=s._SparseFillEmptyRows=function(){return(w2=s._SparseFillEmptyRows=s.asm.SparseFillEmptyRows).apply(null,arguments)},k2=s._SparseReshape=function(){return(k2=s._SparseReshape=s.asm.SparseReshape).apply(null,arguments)},I2=s._SparseSegmentReduction=function(){return(I2=s._SparseSegmentReduction=s.asm.SparseSegmentReduction).apply(null,arguments)},S2=s._SparseToDense=function(){return(S2=s._SparseToDense=s.asm.SparseToDense).apply(null,arguments)},T2=s._Sqrt=function(){return(T2=s._Sqrt=s.asm.Sqrt).apply(null,arguments)},C2=s._Square=function(){return(C2=s._Square=s.asm.Square).apply(null,arguments)},N2=s._SquaredDifference=function(){return(N2=s._SquaredDifference=s.asm.SquaredDifference).apply(null,arguments)},R2=s._Step=function(){return(R2=s._Step=s.asm.Step).apply(null,arguments)},E2=s._StridedSlice=function(){return(E2=s._StridedSlice=s.asm.StridedSlice).apply(null,arguments)},M2=s._Sub=function(){return(M2=s._Sub=s.asm.Sub).apply(null,arguments)},F2=s._Sum=function(){return(F2=s._Sum=s.asm.Sum).apply(null,arguments)},$2=s._Tan=function(){return($2=s._Tan=s.asm.Tan).apply(null,arguments)},D2=s._Tanh=function(){return(D2=s._Tanh=s.asm.Tanh).apply(null,arguments)},P2=s._TensorScatterUpdate=function(){return(P2=s._TensorScatterUpdate=s.asm.TensorScatterUpdate).apply(null,arguments)},_2=s._Tile=function(){return(_2=s._Tile=s.asm.Tile).apply(null,arguments)},O2=s._TopK=function(){return(O2=s._TopK=s.asm.TopK).apply(null,arguments)},z2=s._Transform=function(){return(z2=s._Transform=s.asm.Transform).apply(null,arguments)},L2=s._Transpose=function(){return(L2=s._Transpose=s.asm.Transpose).apply(null,arguments)},W2=s.__FusedMatMul=function(){return(W2=s.__FusedMatMul=s.asm._FusedMatMul).apply(null,arguments)},B2=s._malloc=function(){return(B2=s._malloc=s.asm.malloc).apply(null,arguments)},V2=s._free=function(){return(V2=s._free=s.asm.free).apply(null,arguments)},U2=s.___errno_location=function(){return(U2=s.___errno_location=s.asm.__errno_location).apply(null,arguments)},Bc=s.stackSave=function(){return(Bc=s.stackSave=s.asm.stackSave).apply(null,arguments)},Vc=s.stackRestore=function(){return(Vc=s.stackRestore=s.asm.stackRestore).apply(null,arguments)},Td=s.stackAlloc=function(){return(Td=s.stackAlloc=s.asm.stackAlloc).apply(null,arguments)},G2=s.dynCall_iijjiiii=function(){return(G2=s.dynCall_iijjiiii=s.asm.dynCall_iijjiiii).apply(null,arguments)},H2=s.dynCall_jiji=function(){return(H2=s.dynCall_jiji=s.asm.dynCall_jiji).apply(null,arguments)};s.cwrap=Im;var Ol;qa=function Y(){Ol||Uc(),Ol||(qa=Y)};function Uc(Y){if(Y=Y||d,ht>0||(Lt(),ht>0))return;function se(){Ol||(Ol=!0,s.calledRun=!0,!W&&(pn(),i(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),ua()))}s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),se()},1)):se()}if(s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();Uc();var zl;l&&(zl={uncaughtException:process.listeners("uncaughtException").filter(function(Y){return!l.uncaughtException.indexOf(Y)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(Y){return!l.unhandledRejection.indexOf(Y)>-1})});var Ll;if(typeof r!="undefined")Ll=r;else if(typeof WasmBackendModuleThreadedSimd!="undefined")Ll=WasmBackendModuleThreadedSimd;else throw new Error("Could not find wasm module in post.js");if(zl){var j2=Ll._dispose;Ll._dispose=function(){j2(),zl.uncaughtException.forEach(function(Y){process.removeListener("uncaughtException",Y)}),zl.unhandledRejection.forEach(function(Y){process.removeListener("unhandledRejection",Y)})}}return r.ready}})();typeof e=="object"&&typeof t=="object"?t.exports=a:typeof define=="function"&&define.amd?define([],function(){return a}):typeof e=="object"&&(e.WasmBackendModule=a)}),hp=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 Ka("refCount")}incRef(e){return Ka("incRef")}timerAvailable(){return!0}time(e){return Ka("time")}read(e){return Ka("read")}readSync(e){return Ka("readSync")}readToGPU(e,t){return Ka("readToGPU")}numDataIds(){return Ka("numDataIds")}disposeData(e,t){return Ka("disposeData")}write(e,t,a){return Ka("write")}move(e,t,a,n,r){return Ka("move")}createTensorFromGPUData(e,t,a){return Ka("createTensorFromGPUData")}memory(){return Ka("memory")}floatPrecision(){return Ka("floatPrecision")}epsilon(){return this.floatPrecision()===32?1e-7:1e-4}dispose(){return Ka("dispose")}};function Ka(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 $A(e){let t=e.length,a=0;for(;t>0;)a=Math.random()*t|0,t--,fh(e,t,a)}function qC(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 a=e.length,n=0;for(;a>0;)n=Math.random()*a|0,a--,fh(e,a,n),fh(t,a,n)}function Hd(e,t,a){return Math.max(e,Math.min(t,a))}function XC(e){return e%2===0?e:e+1}function fh(e,t,a){let n=e[t];e[t]=e[a],e[a]=n}function KC(e){let t=0;for(let a=0;aa+` Shapes ${e} and ${t} must match`)}function Fi(e){P(e!=null,()=>"The input to the tensor constructor must be a non-null value.")}function mt(e){if(e.length===0)return 1;let t=e[0];for(let a=1;a0,a,n){return new Promise((r,s)=>{let i=0,o=()=>{if(e()){r();return}i++;let l=t(i);if(a!=null&&i>=a){s();return}n!=null?n(o,l):setTimeout(o,l)};o()})}function nN(e,t){let a=1,n=-1;for(let s=0;s=0)a*=e[s];else if(e[s]===-1){if(n!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${n} and dim ${s}`);n=s}else if(e[s]<0)throw Error(`Shapes can not be < 0. Found ${e[s]} at dim ${s}`);if(n===-1){if(t>0&&t!==a)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(a===0)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%a!==0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${a}`);let r=e.slice();return r[n]=t/a,r}function mp(e,t){let a=t.length;return e=e==null?t.map((n,r)=>r):[].concat(e),P(e.every(n=>n>=-a&&n`All values in axis param must be in range [-${a}, ${a}) but got axis ${e}`),P(e.every(n=>Zl(n)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(n=>n<0?a+n:n)}function PA(e,t){let a=[],n=[],r=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||r?null:mp(t,e).sort(),i=0;for(let o=0;oo)&&e[o]===1&&(a.push(e[o]),n.push(o)),s[i]<=o&&i++}e[o]!==1&&(a.push(e[o]),n.push(o))}return{newShape:a,keptDims:n}}function _A(e,t){return ig(e,t)}function ig(e,t){let a=null;if(e==null||e==="float32")a=new Float32Array(t);else if(e==="int32")a=new Int32Array(t);else if(e==="bool")a=new Uint8Array(t);else if(e==="string")a=new Array(t);else throw new Error(`Unknown data type ${e}`);return a}function OA(e,t){for(let a=0;at+=a.length),t}function Xr(e){return typeof e=="string"||e instanceof String}function WA(e){return typeof e=="boolean"}function BA(e){return typeof e=="number"}function fp(e){return Array.isArray(e)?fp(e[0]):e instanceof Float32Array?"float32":e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray?"int32":BA(e)?"float32":Xr(e)?"string":WA(e)?"bool":"float32"}function es(e){return!!(e&&e.constructor&&e.call&&e.apply)}function yh(e,t){for(let a=t;a=0;--n)a[n]=a[n+1]*e[n+1];return a}function VA(e,t,a,n=!1){let r=new Array;if(t.length===1){let s=t[0]*(n?2:1);for(let i=0;il*u)*(n?2:1);for(let l=0;lr*s)*(a?2:1);if(n===0)return[];if(n!==t.length)throw new Error(`[${e}] does not match the input size ${t.length}${a?" for a complex tensor":""}.`);return VA(0,e,t,a)}function sN(e,t){if(Array.isArray(e))return e;if(t==="float32")return e instanceof Float32Array?e:new Float32Array(e);if(t==="int32")return e instanceof Int32Array?e:new Int32Array(e);if(t==="bool"||t==="string")return Uint8Array.from(new Int32Array(e));throw new Error(`Unknown dtype ${t}`)}function og(e,t){let a=Oh(e,t);for(let n=0;nn*r,1);if(t==null||t==="float32")return ql(e,new Float32Array(a));if(t==="int32")return ql(e,new Int32Array(a));if(t==="bool")return ql(e,new Uint8Array(a));throw new Error(`Unknown data type ${t}`)}function nn(e){e.forEach(t=>{P(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function oN(e,t,a){if(t===0)return 0;if(t===1)return e[0];let n=e[e.length-1];for(let r=0;r{let[a,n]=t.split(":");this.urlFlags[a]=pN(a,n)})}};function uN(e){let t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(a,...n)=>(dN(t,n[0],n[1]),n.join("="))),t}function dN(e,t,a){e[decodeURIComponent(t)]=decodeURIComponent(a||"")}function pN(e,t){let a=t.toLowerCase();return a==="true"||a==="false"?a==="true":`${+a}`===a?+a:t}function B(){return lg}var lg=null;function cN(e){lg=e}var Z2;function GA(){if(Z2==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");Z2=e}return Z2}function hN(){let e=GA();return e._tfGlobals==null&&(e._tfGlobals=new Map),e._tfGlobals}function ug(e,t){let a=hN();if(a.has(e))return a.get(e);{let n=t();return a.set(e,n),a.get(e)}}var cu="Abs",$i="Acos",Di="Acosh",Mr="Add",Pi="AddN",_i="All",Oi="Any",hu="ArgMax",mu="ArgMin",zi="Asin",Li="Asinh",Wi="Atan",Bi="Atanh",Vi="Atan2",Ui="AvgPool",gp="AvgPoolGrad",fu="AvgPool3D",yp="AvgPool3DGrad",Gi="BatchMatMul",gu="BatchToSpaceND",Hi="Bincount",ji="BitwiseAnd",mN="BroadcastTo",yu="BroadcastArgs",qi="Cast",cs="Ceil",hs="ClipByValue",xp="Complex",Ap="ComplexAbs",xu="Concat",Xi="Conv2D",bp="Conv2DBackpropFilter",Ki="Conv2DBackpropInput",Yi="Conv3D",Au="Conv3DBackpropFilterV2",Zi="Conv3DBackpropInputV2",Ji="Cos",Qi="Cosh",eo="Cumprod",to="Cumsum",ao="CropAndResize",bu="DenseBincount",no="DepthToSpace",ro="DepthwiseConv2dNative",vp="DepthwiseConv2dNativeBackpropFilter",wp="DepthwiseConv2dNativeBackpropInput",vu="Diag",so="Dilation2D",Jl="Dilation2DBackpropInput",Ql="Dilation2DBackpropFilter",kp="Draw",io="RealDiv",Ip="Einsum",oo="Elu",wu="EluGrad",lo="Erf",ms="Equal",fs="Exp",ku="ExpandDims",gs="Expm1",Sp="FFT",Iu="Fill",uo="FlipLeftRight",ys="Floor",xs="FloorDiv",po="FusedBatchNorm",Su="GatherV2",co="GatherNd",As="Greater",bs="GreaterEqual",ho="Identity",Tp="IFFT",Cp="Imag",mo="IsFinite",fo="IsInf",go="IsNan",yo="LeakyRelu",vs="Less",ws="LessEqual",xo="LinSpace",ks="Log",Ao="Log1p",bo="LogicalAnd",vo="LogicalNot",wo="LogicalOr",HA="LogicalXor",fN="LogSoftmax",gN="LowerBound",ko="LRN",Tu="LRNGrad",yN="MatrixBandPart",Io="Max",Is="Maximum",So="MaxPool",Np="MaxPoolGrad",Cu="MaxPool3D",Rp="MaxPool3DGrad",Nu="MaxPoolWithArgmax",To="Mean",Co="Min",Ss="Minimum",No="MirrorPad",Ro="Mod",Eo="Multinomial",Ts="Multiply",Ru="Neg",Cs="NotEqual",Mo="NonMaxSuppressionV3",Eu="NonMaxSuppressionV4",Fo="NonMaxSuppressionV5",Mu="OnesLike",$o="OneHot",Fu="Pack",Do="PadV2",xN="Pool",Po="Pow",_o="Prelu",Oo="Prod",Lh="RaggedGather",Wh="RaggedRange",Bh="RaggedTensorToTensor",$u="Range",Ep="Real",zo="Reciprocal",Lo="Relu",Du="Reshape",Wo="ResizeNearestNeighbor",Pu="ResizeNearestNeighborGrad",Bo="ResizeBilinear",_u="ResizeBilinearGrad",Vo="Relu6",Uo="Reverse",Go="Round",Ns="Rsqrt",Ho="ScatterNd",jo="TensorScatterUpdate",qo="SearchSorted",Ou="Select",Xo="Selu",zu="Slice",Ko="Sin",Yo="Sinh",Zo="Sign",Rs="Sigmoid",Jo="Softplus",Es="Sqrt",Qo="Sum",Lu="SpaceToBatchND",Wu="SplitV",el="Softmax",Mp="SparseFillEmptyRows",Bu="SparseReshape",Vu="SparseSegmentMean",Uu="SparseSegmentSum",tl="SparseToDense",Ms="SquaredDifference",Fp="Square",Gu="StaticRegexReplace",al="StridedSlice",Hu="StringNGrams",$p="StringSplit",Dp="StringToHashBucketFast",Fs="Sub",nl="Tan",rl="Tanh",$s="Tile",sl="TopK",il="Transform",Tr="Transpose",Pp="Unique",ju="Unpack",_p="UnsortedSegmentSum",AN="UpperBound",qu="ZerosLike",Ds="Step",jd="FromPixels",ol="RotateWithOffset",ts="_FusedMatMul",as="FusedConv2D",ns="FusedDepthwiseConv2D";function qr(...e){B().getBool("IS_TEST")||B().getBool("PROD")||console.warn(...e)}function bN(...e){B().getBool("IS_TEST")||B().getBool("PROD")||console.log(...e)}var eu=ug("kernelRegistry",()=>new Map),qd=ug("gradRegistry",()=>new Map);function Xd(e,t){let a=dg(e,t);return eu.get(a)}function o1(e){return qd.get(e)}function tr(e){let t=eu.entries(),a=[];for(;;){let{done:n,value:r}=t.next();if(n)break;let[s,i]=r,[o]=s.split("_");o===e&&a.push(i)}return a}function bn(e){let{kernelName:t,backendName:a}=e,n=dg(t,a);eu.has(n)&&qr(`The kernel '${t}' for backend '${a}' is already registered`),eu.set(n,e)}function vN(e){let{kernelName:t}=e;qd.has(t)&&B().getBool("DEBUG")&&qr(`Overriding the gradient for '${t}'`),qd.set(t,e)}function wN(e,t){let a=dg(e,t);if(!eu.has(a))throw new Error(`The kernel '${e}' for backend '${t}' is not registered`);eu.delete(a)}function kN(e){if(!qd.has(e))throw new Error(`The gradient '${e}' for backend is not registered`);qd.delete(e)}function IN(e,t){tr(e).forEach(a=>{let n=Object.assign({},a,{backendName:t});bn(n)})}function dg(e,t){return`${t}_${e}`}var v={};Ke(v,{arraysEqual:()=>Er,arraysEqualWithNull:()=>DA,assert:()=>P,assertNonNegativeIntegerDimensions:()=>nn,assertNonNull:()=>Fi,assertShapesMatch:()=>Ca,bytesFromStringArray:()=>LA,bytesPerElement:()=>gh,checkConversionForErrors:()=>OA,clamp:()=>Hd,computeStrides:()=>pu,convertBackendValuesAndArrayBuffer:()=>sN,createScalarValue:()=>EN,createShuffledIndices:()=>tN,decodeString:()=>xh,distSquared:()=>ZC,encodeString:()=>zp,fetch:()=>FN,fingerPrint64:()=>RN,flatten:()=>rs,getArrayFromDType:()=>ig,getTypedArrayFromDType:()=>_A,hasEncodingLoss:()=>rN,hexToLong:()=>Op,indexToLoc:()=>lN,inferDtype:()=>fp,inferFromImplicitShape:()=>nN,isBoolean:()=>WA,isFunction:()=>es,isInt:()=>Zl,isNumber:()=>BA,isPromise:()=>zh,isScalarShape:()=>JC,isString:()=>Xr,isTypedArray:()=>Jt,isValidDtype:()=>zA,locToIndex:()=>oN,makeOnesTypedArray:()=>og,makeZerosNestedTypedArray:()=>iN,makeZerosTypedArray:()=>Oh,nearestDivisor:()=>yh,nearestLargerEven:()=>XC,now:()=>Kd,parseAxisParam:()=>mp,randUniform:()=>YC,repeatedTry:()=>aN,rightPad:()=>Bd,shuffle:()=>$A,shuffleCombo:()=>qC,sizeFromShape:()=>mt,sizeToSquarishShape:()=>eN,squeezeShape:()=>PA,sum:()=>KC,swap:()=>fh,tanh:()=>QC,toNestedArray:()=>ql,toTypedArray:()=>Vh});function jA(e){return e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray}var r5=uu(EC()),ci=r5.default||r5;function Op(e){return ci.fromString(e,!0,16)}var qA=Op("c3a5c85c97cb3127"),di=Op("b492b66fbe98f273"),va=Op("9ae16a3b2f90404f");function l1(e){return e.xor(e.shru(47))}function XA(e,t,a){let n=e.slice(t,t+a);return ci.fromBytes(Array.from(n),!0,!0)}function At(e,t){return XA(e,t,8)}function s5(e,t){return XA(e,t,4)}function Zt(e,t){return t===0?e:e.shru(t).or(e.shl(64-t))}function Jr(e,t,a=Op("9ddfea08eb382d69")){let n=e.xor(t).mul(a);n=n.xor(n.shru(47));let r=t.xor(n).mul(a);return r=r.xor(r.shru(47)),r=r.mul(a),r}function SN(e,t,a,n,r,s){r=r.add(e),s=Zt(s.add(r).add(n),21);let i=r;return r=r.add(t),r=r.add(a),s=s.add(Zt(r,44)),[r.add(n),s.add(i)]}function Qc(e,t,a,n){return SN(At(e,t),At(e,t+8),At(e,t+16),At(e,t+24),a,n)}function TN(e,t=e.length){if(t>=8){let a=va.add(t*2),n=At(e,0).add(va),r=At(e,t-8),s=Zt(r,37).mul(a).add(n),i=Zt(n,25).add(r).mul(a);return Jr(s,i,a)}if(t>=4){let a=va.add(t*2),n=s5(e,0);return Jr(n.shl(3).add(t),s5(e,t-4),a)}if(t>0){let a=e[0],n=e[t>>1],r=e[t-1],s=a+(n<<8),i=t+(r<<2);return l1(va.mul(s).xor(qA.mul(i))).mul(va)}return va}function CN(e,t=e.length){let a=va.add(t*2),n=At(e,0).mul(di),r=At(e,8),s=At(e,t-8).mul(a),i=At(e,t-16).mul(va);return Jr(Zt(n.add(r),43).add(Zt(s,30)).add(i),n.add(Zt(r.add(va),18)).add(s),a)}function NN(e,t=e.length){let a=va.add(t*2),n=At(e,0).mul(va),r=At(e,8),s=At(e,t-8).mul(a),i=At(e,t-16).mul(va),o=Zt(n.add(r),43).add(Zt(s,30)).add(i),l=Jr(o,n.add(Zt(r.add(va),18)).add(s),a),u=At(e,16).mul(a),d=At(e,24),c=o.add(At(e,t-32)).mul(a),p=l.add(At(e,t-24)).mul(a);return Jr(Zt(u.add(d),43).add(Zt(c,30)).add(p),u.add(Zt(d.add(n),18)).add(c),a)}function RN(e,t=e.length){let a=ci.fromNumber(81,!0);if(t<=32)return t<=16?TN(e,t):CN(e,t);if(t<=64)return NN(e,t);let n=a,r=a.mul(di).add(113),s=l1(r.mul(va).add(113)).mul(va),i=[ci.UZERO,ci.UZERO],o=[ci.UZERO,ci.UZERO];n=n.mul(va).add(At(e,0));let l=0,u=(t-1>>6)*64,d=u+(t-1&63)-63;do n=Zt(n.add(r).add(i[0]).add(At(e,l+8)),37).mul(di),r=Zt(r.add(i[1]).add(At(e,l+48)),42).mul(di),n=n.xor(o[1]),r=r.add(i[0]).add(At(e,l+40)),s=Zt(s.add(o[0]),33).mul(di),i=Qc(e,l,i[1].mul(di),n.add(o[0])),o=Qc(e,l+32,s.add(o[1]),r.add(At(e,l+16))),[s,n]=[n,s],l+=64;while(l!==u);let c=di.add(s.and(255).shl(1));return l=d,o[0]=o[0].add(t-1&63),i[0]=i[0].add(o[0]),o[0]=o[0].add(i[0]),n=Zt(n.add(r).add(i[0]).add(At(e,l+8)),37).mul(c),r=Zt(r.add(i[1]).add(At(e,l+48)),42).mul(c),n=n.xor(o[1].mul(9)),r=r.add(i[0].mul(9).add(At(e,l+40))),s=Zt(s.add(o[0]),33).mul(c),i=Qc(e,l,i[1].mul(c),n.add(o[0])),o=Qc(e,l+32,s.add(o[1]),r.add(At(e,l+16))),[s,n]=[n,s],Jr(Jr(i[0],o[0],c).add(l1(r).mul(qA)).add(s),Jr(i[1],o[1],c).add(n),c)}function EN(e,t){return t==="string"?zp(e):Vh([e],t)}function MN(e,t){return e instanceof Float32Array&&t==="float32"||e instanceof Int32Array&&t==="int32"||e instanceof Uint8Array&&t==="bool"}function Vh(e,t){if(t==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=rs(e)),B().getBool("DEBUG")&&OA(e,t),MN(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 a=new Uint8Array(e.length);for(let n=0;n{n=a()},s,i=Kd();if(this.backendTimer.timerAvailable())s=this.backendTimer.time(r);else{r();for(let o of n)o.dataSync();s=Promise.resolve({kernelMs:Kd()-i})}if(B().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let o=0;o{DN(u,l.dtype,e)})}return{kernelName:e,outputs:n,inputs:t,timeMs:s.then(o=>o.kernelMs),extraInfo:s.then(o=>o.getExtraProfileInfo!=null?o.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:a,timeMs:n,inputs:r,extraInfo:s}=e;a.forEach(i=>{Promise.all([i.data(),n,s]).then(o=>{this.logger.logKernelProfile(t,i,o[0],o[1],r,o[2])})})}};function DN(e,t,a){if(t!=="float32")return!1;for(let n=0;n0?m:""} `}}console.log(`%c${o} %c${i} %c${l}D ${d} %c${u} %c${c} %c${s}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function _N(e,t,a){let n={},r={};for(let l=0;ln[f.id]=!0),h=!0,r[u.id]=!0;break}if(h)break}}let s={};s[a.id]=!0;let i={};for(let l=e.length-1;l>=0;l--){let u=e[l],d=u.inputs;for(let c=0;c=0;r--){let s=t[r],i=[];if(s.outputs.forEach(l=>{let u=e[l.id];u!=null?i.push(u):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 u=a(()=>o[l]());if(u.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${l} must have 'float32' dtype, but has '${u.dtype}'`);let d=s.inputs[l];if(!Er(u.shape,d.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${l}' has shape '${u.shape}', which does not match the shape of the input '${d.shape}'`);if(e[d.id]==null)e[d.id]=u;else{let c=e[d.id];e[d.id]=n(c,u),c.dispose()}}}}var i5=20,Nd=3,J2=7;function zN(e,t,a,n){let r=pu(t),s=LN(e,t,a,r),i=t.length,o=ih(e,t,a,r,s),l=["Tensor"];return n&&(l.push(` dtype: ${a}`),l.push(` rank: ${i}`),l.push(` shape: [${t}]`),l.push(" values:")),l.push(o.map(u=>" "+u).join(` `)),l.join(` -`)}function XT(e,t,a,n){let r=vt(t),s=n[n.length-1],i=new Array(s).fill(0),o=t.length,l=a==="complex64"?kd(e):e;if(o>1)for(let u=0;uqx){let f=bd*i,g=Array.from(e.slice(0,f)),y=Array.from(e.slice((o-bd)*i,o*i));return a==="complex64"&&(g=kd(g),y=kd(y)),["["+g.map((x,A)=>wd(x,r[A],a)).join(", ")+", ..., "+y.map((x,A)=>wd(x,r[o-bd+A],a)).join(", ")+"]"]}return["["+(a==="complex64"?kd(e):Array.from(e)).map((f,g)=>wd(f,r[g],a)).join(", ")+"]"]}let u=t.slice(1),p=n.slice(1),c=n[0]*i,d=[];if(o>qx){for(let f=0;f0?d[0]+h:"");for(let f=1;f1)for(let u=0;ui5){let f=Nd*i,g=Array.from(e.slice(0,f)),y=Array.from(e.slice((o-Nd)*i,o*i));return a==="complex64"&&(g=Md(g),y=Md(y)),["["+g.map((x,A)=>Ed(x,r[A],a)).join(", ")+", ..., "+y.map((x,A)=>Ed(x,r[o-Nd+A],a)).join(", ")+"]"]}return["["+(a==="complex64"?Md(e):Array.from(e)).map((f,g)=>Ed(f,r[g],a)).join(", ")+"]"]}let u=t.slice(1),d=n.slice(1),c=n[0]*i,p=[];if(o>i5){for(let f=0;f0?p[0]+h:"");for(let f=1;f`Length of values '${n}' 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=a||Z1(t,this.size),this.strides=nu(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 a=this.locToIndex(t);this.values[a]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let n of e){if(n<0||n>=this.shape[t]){let r=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(r)}t++}let a=e[e.length-1];for(let n=0;ndh(a))}catch(a){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),On().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();let e=On().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>dh(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 On().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),On().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Fl.print(this,e)}clone(){return this.throwIfDisposed(),Fl.clone(this)}toString(e=!1){let t=this.dataSync();return qT(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Fl.cast(this,e)}variable(e=!0,t,a){return this.throwIfDisposed(),On().makeVariable(this,e,t,a)}};Object.defineProperty(gt,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function MA(){return eg("Tensor",()=>gt)}MA();var Bd=class extends gt{constructor(e,t,a,n){super(e.shape,e.dtype,e.dataId,n),this.trainable=t,this.name=a}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(!Cr(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);On().disposeTensor(this),this.dataId=e.dataId,On().incRef(this,null)}dispose(){On().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(Bd,Symbol.hasInstance,{value:e=>e instanceof gt&&e.assign!=null&&e.assign instanceof Function});var PA={};Ze(PA,{assertTypesMatch:()=>FA,getTensorsInContainer:()=>ag,isTensorInList:()=>eN,makeTypesMatch:()=>Rt});var a1;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(a1||(a1={}));var n1;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(n1||(n1={}));var r1;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(r1||(r1={}));var s1;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(s1||(s1={}));var i1;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(i1||(i1={}));var QT={float32:s1,int32:n1,bool:r1,complex64:i1};function da(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return QT[e][t]}function Mp(e){return da(e,"int32")}function _A(e){return e!=null&&typeof e=="object"&&"texture"in e&&e.texture instanceof WebGLTexture}function $A(e){return typeof GPUBuffer!="undefined"&&e!=null&&typeof e=="object"&&"buffer"in e&&e.buffer instanceof GPUBuffer}function Rt(e,t){if(e.dtype===t.dtype)return[e,t];let a=da(e.dtype,t.dtype);return[e.cast(a),t.cast(a)]}function FA(e,t){F(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function eN(e,t){return t.some(a=>a.id===e.id)}function ag(e){let t=[];return DA(e,t,new Set),t}function DA(e,t,a){if(e==null)return;if(e instanceof gt){t.push(e);return}if(!tN(e))return;let n=e;for(let r in n){let s=n[r];a.has(s)||(a.add(s),DA(s,t,a))}}function tN(e){return Array.isArray(e)||typeof e=="object"}function j2(e){return e.kernelName!=null}var Xx=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()}},ng=class o1{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new Xx}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let t=this.getSortedBackends();for(let a=0;a{t.setupFunc!=null&&t.setupFunc(this.backendInstance)})}disposeRegisteredKernels(t){Zn(t).forEach(a=>{a.disposeFunc!=null&&a.disposeFunc(this.registry[t])})}initializeBackend(t){let a=this.registryFactory[t];if(a==null)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{let n=a.factory();if(n&&!(n instanceof au)&&typeof n.then=="function"){let r=++this.pendingBackendInitId,s=n.then(i=>r(rthis.registryFactory[a].priority-this.registryFactory[t].priority)}initializeBackendsAndReturnBest(){let t=this.getSortedBackends();for(let a=0;athis.startScope(n),()=>this.endScope(r),()=>(r=a(),r instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r))}scopedRun(t,a,n){t();try{let r=n();return a(),r}catch(r){throw a(),r}}nextTensorId(){return o1.nextTensorId++}nextVariableId(){return o1.nextVariableId++}clone(t){let a=L.runKernel(Hi,{x:t}),n={x:t},r=i=>({x:()=>{let o="float32",l={x:i},u={dtype:o};return L.runKernel(xi,l,u)}}),s=[];return this.addTapeNode(this.state.activeScope.name,n,[a],r,s,{}),a}runKernel(t,a,n){if(this.backendName==null&&this.backend,Ld(t,this.backendName)==null)throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:a,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,a,n){let r=this.backend.numDataIds(),s=0;n.forEach(l=>{s+=l.dtype==="complex64"?3:1});let i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=r-a-s-i;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${t}'`)}runKernelFunc(t){let a,n=[],r=this.isTapeOn(),s=this.state.numBytes,i=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let o;this.backendName==null&&this.backend;let l,u=j2(t)?t.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(j2(t)){let{kernelName:m,inputs:f,attrs:g}=t;this.backendName==null&&this.backend;let y=Ld(m,this.backendName);F(y!=null,()=>`Cannot find registered kernel '${m}' for backend '${this.backendName}'`),o=()=>{let x=this.backend.numDataIds();l=y.kernelFunc({inputs:f,attrs:g,backend:this.backend});let A=Array.isArray(l)?l:[l];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(m,x,A);let b=A.map(w=>w.rank!=null?w:this.makeTensorFromTensorInfo(w));if(r){let w=this.getTensorsForGradient(m,f,b);n=this.saveTensorsForBackwardMode(w)}return b}}else{let{forwardFunc:m}=t,f=g=>{r&&(n=g.map(y=>this.keep(this.clone(y))))};o=()=>{let g=this.backend.numDataIds();l=this.tidy(()=>m(this.backend,f));let y=Array.isArray(l)?l:[l];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,g,y),y}}let{inputs:p,attrs:c}=t,d=j2(t)?null:t.backwardsFunc,h;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?a=o():(h=this.profiler.profileKernel(u,p,()=>o()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(h),a=h.outputs)}),r&&this.addTapeNode(u,p,a,d,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(p).map(m=>p[m]!=null?p[m].shape:null),outputShapes:a.map(m=>m.shape),kernelTimeMs:h.timeMs,extraInfo:h.extraInfo}),Array.isArray(l)?a:a[0]}saveTensorsForBackwardMode(t){return t.map(a=>this.keep(this.clone(a)))}getTensorsForGradient(t,a,n){let r=e1(t);if(r!=null){let s=r.inputsToSave||[],i=r.outputsToSave||[],o;r.saveAllInputs?(F(Array.isArray(a),()=>"saveAllInputs is true, expected inputs to be an array."),o=Object.keys(a).map(u=>a[u])):o=s.map(u=>a[u]);let l=n.filter((u,p)=>i[p]);return o.concat(l)}return[]}makeTensor(t,a,n,r){if(t==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let s=t;n==="string"&&Ur(t[0])&&(s=t.map(l=>Ep(l)));let i=r.write(s,a,n),o=new gt(a,n,i,this.nextTensorId());if(this.trackTensor(o,r),n==="string"){let l=this.state.tensorInfo.get(i),u=bA(s);this.state.numBytes+=u-l.bytes,l.bytes=u}return o}makeTensorFromDataId(t,a,n,r){n=n||"float32";let s={dataId:t,shape:a,dtype:n};return this.makeTensorFromTensorInfo(s,r)}makeTensorFromTensorInfo(t,a){let{dataId:n,shape:r,dtype:s}=t,i=new gt(r,s,n,this.nextTensorId());return this.trackTensor(i,a),i}makeVariable(t,a=!0,n,r){n=n||this.nextVariableId().toString(),r!=null&&r!==t.dtype&&(t=t.cast(r));let s=new Bd(t,a,n,this.nextTensorId());if(this.state.registeredVariables[s.name]!=null)throw new Error(`Variable with name ${s.name} was already registered`);return this.state.registeredVariables[s.name]=s,this.incRef(s,this.backend),s}trackTensor(t,a){this.state.numTensors++,t.dtype==="string"&&this.state.numStringTensors++;let n=0;t.dtype!=="complex64"&&t.dtype!=="string"&&(n=t.size*lh(t.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:a||this.backend,dtype:t.dtype,shape:t.shape,bytes:n})),t instanceof Bd||this.track(t)}incRef(t,a){this.trackTensor(t,a),this.backend.incRef(t.dataId)}removeDataId(t,a){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===a&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;let a=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,t.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=a.bytes),t.dtype!=="complex64"&&t.dtype!=="string"){let n=t.size*lh(t.dtype);this.state.numBytes-=n}a.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,a.backend)}disposeVariables(){for(let t in this.state.registeredVariables){let a=this.state.registeredVariables[t];this.disposeVariable(a)}}disposeVariable(t){this.disposeTensor(t),this.state.registeredVariables[t.name]!=null&&delete this.state.registeredVariables[t.name]}memory(){let t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,t.reasons==null&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;let a=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),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-a,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(t,a,n,r,s,i){let o={id:this.state.nextTapeNodeId++,kernelName:t,inputs:a,outputs:n,saved:s},l=e1(t);l!=null&&(r=l.gradFunc),r!=null&&(o.gradient=u=>(u=u.map((p,c)=>{if(p==null){let d=n[c],h=Rh(d.size,d.dtype);return this.makeTensor(h,d.shape,d.dtype)}return p}),r(u.length>1?u:u[0],s,i))),this.state.activeTape.push(o)}keep(t){return t.kept=!0,t}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){let a={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(a.name=t),this.state.scopeStack.push(a),this.state.activeScope=a}endScope(t){let a=ag(t),n=new Set(a.map(s=>s.id));for(let s=0;s{!s.kept&&s.scopeId===r.id&&this.track(s)})}gradients(t,a,n,r=!1){if(F(a.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 s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",t));F(s instanceof gt,()=>"The result y returned by f() must be a tensor.");let i=HT(this.state.activeTape,a,s);if(!r&&i.length===0&&a.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 o={};o[s.id]=n==null?aN(s.shape):n,jT(o,i,u=>this.tidy(u),nN);let l=a.map(u=>o[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(let p of u.saved)p.dispose()}),this.state.activeTape=null),{value:s,grads:l}})}customGrad(t){return F(Kr(t),()=>"The f passed in customGrad(f) must be a function."),(...a)=>{F(a.every(o=>o instanceof gt),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,r={};a.forEach((o,l)=>{r[l]=o});let s=(o,l)=>(n=t(...a,l),F(n.value instanceof gt,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),F(Kr(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),i=(o,l)=>{let u=n.gradFunc(o,l),p=Array.isArray(u)?u:[u];F(p.length===a.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(p.every(d=>d instanceof gt),()=>"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 c={};return p.forEach((d,h)=>{c[h]=()=>d}),c};return this.runKernelFunc({forwardFunc:s,backwardsFunc:i,inputs:r})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}readToGPU(t,a){return this.state.tensorInfo.get(t).backend.readToGPU(t,a)}async time(t){let a=Wd(),n=await this.backend.time(t);return n.wallMs=Wd()-a,n}track(t){return this.state.activeScope!=null&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new Xx;for(let t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};ng.nextTensorId=0;ng.nextVariableId=0;function aN(e){let t=J1(vt(e),"float32");return L.makeTensor(t,e,"float32")}function OA(){let e=SA();if(e._tfengine==null){let t=new IA(e);e._tfengine=new ng(t)}return vT(e._tfengine.ENV),YT(()=>e._tfengine),e._tfengine}var L=OA();function nN(e,t){let a={a:e,b:t};return L.runKernel(is,a)}var Pp={};Ze(Pp,{isBrowser:()=>zA,isMobile:()=>iN,mockIsMobile:()=>sN});function rN(){return typeof navigator!="undefined"&&navigator!=null}var l1;function sN(e){l1=e}function iN(e){if(l1!==void 0)return l1;if(e||rN()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||(typeof window!="undefined"?window.opera:"");if(!t){let a=e;return a.userAgentData&&a.userAgentData.mobile}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 zA(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var Ba=B();Ba.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.")});Ba.registerFlag("IS_BROWSER",()=>zA());Ba.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");Ba.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));Ba.registerFlag("IS_SAFARI",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));Ba.registerFlag("PROD",()=>!1);Ba.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>Ba.getBool("DEBUG"));Ba.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);Ba.registerFlag("IS_TEST",()=>!1);Ba.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>Ba.getBool("DEBUG"));Ba.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);Ba.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1);Ba.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1);function Jn(e,t){let a=e;if(Jt(e))return t==="string"?[]:[e.length];if(_A(e)){let r=e.channels||"RGBA";return[e.height,e.width*r.length]}else if($A(e))return[e.buffer.size/(t==null?4:lh(t))];if(!Array.isArray(e))return[];let n=[];for(;Array.isArray(a)||Jt(a)&&t!=="string";)n.push(a.length),a=a[0];return Array.isArray(e)&&B().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&LA(e,n,[]),n}function LA(e,t,a){if(a=a||[],!Array.isArray(e)&&!Jt(e)){F(t.length===0,()=>`Element arr[${a.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}F(t.length>0,()=>`Element arr[${a.join("][")}] should be a primitive, but is an array of ${e.length} elements`),F(e.length===t[0],()=>`Element arr[${a.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let n=t.slice(1);for(let r=0;r=0&&(r=n),Kx(n,r,t,a),e==null||!Jt(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 '${a}' must be a Tensor or TensorLike, but got '${o}'`)}let s=Jn(e,r);!Jt(e)&&!Array.isArray(e)&&(e=[e]);let i=r!=="string"?$h(e,r):Qr(e,[],!0);return L.makeTensor(i,s,r)}function Vd(e,t,a,n="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${a} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((r,s)=>R(r,`${t}[${s}]`,a,n))}var rg="__op";function z(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 a=t[0],n=e[a];a.endsWith("_")&&(a=a.substring(0,a.length-1)),a=a+rg;let r=(...s)=>{L.startScope(a);try{let i=n(...s);return Eh(i)&&console.error("Cannot return a Promise inside of tidy."),L.endScope(i),i}catch(i){throw L.endScope(null),i}};return Object.defineProperty(r,"name",{value:a,configurable:!0}),r}function oN(e,t){let a=R(e,"real","complex"),n=R(t,"imag","complex");Ta(a.shape,n.shape,`real and imag shapes, ${a.shape} and ${n.shape}, must match in call to tf.complex().`);let r={real:a,imag:n};return L.runKernel(up,r)}var Sr=z({complex_:oN});function ds(e,t,a,n){if(n==null)n=ip(e);else if(n==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if($A(e)||_A(e)){if(n!=="float32"&&n!=="int32")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${n}.`);return L.backend.createTensorFromGPUData(e,t||a,n)}if(!Jt(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){tn(t);let r=vt(t),s=vt(a);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 (${a}) does not match the provided shape (${t}). `)}}return!Jt(e)&&!Array.isArray(e)&&(e=[e]),t=t||a,e=n!=="string"?$h(e,n):Qr(e,[],!0),L.makeTensor(e,t,n)}function Ve(e,t,a){let n=Jn(e,a);return ds(e,t,n,a)}var u1={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},Tr=class WA{static join(t){return new WA(t).slice()}constructor(t){if(this.shards=[],this.previousShardIndex=0,t==null||(t instanceof Array||(t=[t]),t=t.map(n=>Jt(n)?n.buffer:n),t.length===0))return;this.bufferUniformSize=t[0].byteLength;let a=0;for(let n=0;n=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(t/this.bufferUniformSize),this.previousShardIndex;function a(r){return t=r.end?1:0}if(a(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;let n=lN(this.shards,a);return n===-1?-1:(this.previousShardIndex=n,this.previousShardIndex)}};function lN(e,t){let a=0,n=e.length;for(;a<=n;){let r=Math.floor((n-a)/2)+a,s=t(e[r]);if(s===0)return r;s<0?n=r:a=r+1}return-1}var ph=4;async function uN(e,t){let a=[],n=[],r=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let d=await l.bytes(),h=d.reduce((g,y)=>g+y.length,0)+ph*d.length,m=new Uint8Array(h),f=0;for(let g=0;g{if(t+=s.byteLength,a.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 n=new Uint8Array(t),r=0;return a.forEach(s=>{n.set(new Uint8Array(s.buffer),r),r+=s.byteLength}),n.buffer}var sg=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function Yx(e){return sg?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function pN(e){if(sg)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),a="";for(let n=0,r=t.length;n{let n=a<<13,r=0;for(;!(n&8388608);)r-=8388608,n<<=1;return n&=-8388609,r+=947912704,n|r},t=new Uint32Array(2048);t[0]=0;for(let a=1;a<1024;a++)t[a]=e(a);for(let a=1024;a<2048;a++)t[a]=939524096+(a-1024<<13);return t}function fN(){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 gN(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function yN(){let e=mN(),t=fN(),a=gN();return n=>{let r=new ArrayBuffer(4*n.length),s=new Uint32Array(r);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=l}return new Float32Array(r)}}var fn=class Fn{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return Fn.instance==null&&(Fn.instance=new Fn),Fn.instance}static registerSaveRouter(t){Fn.getInstance().saveRouters.push(t)}static registerLoadRouter(t){Fn.getInstance().loadRouters.push(t)}static getSaveHandlers(t){return Fn.getHandlers(t,"save")}static getLoadHandlers(t,a){return Fn.getHandlers(t,"load",a)}static getHandlers(t,a,n){let r=[];return(a==="load"?Fn.getInstance().loadRouters:Fn.getInstance().saveRouters).forEach(s=>{let i=s(t,n);i!==null&&r.push(i)}),r}},xN=e=>fn.registerSaveRouter(e),AN=e=>fn.registerLoadRouter(e),bN=e=>fn.getSaveHandlers(e),vN=(e,t)=>fn.getLoadHandlers(e,t),d1="tensorflowjs",p1=1,Hs="models_store",Gr="model_info_store";function HA(){if(!B().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 c1(e){let t=e.result;t.createObjectStore(Hs,{keyPath:"modelPath"}),t.createObjectStore(Gr,{keyPath:"modelPath"})}var Xs=class{constructor(e){if(this.indexedDB=HA(),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((a,n)=>{let r=this.indexedDB.open(d1,p1);r.onupgradeneeded=()=>c1(r),r.onsuccess=()=>{let s=r.result;if(t==null){let i=s.transaction(Hs,"readonly"),o=i.objectStore(Hs).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));a(o.result.modelArtifacts)},o.onerror=l=>(s.close(),n(o.error)),i.oncomplete=()=>s.close()}else{t.weightData=Tr.join(t.weightData);let i=_p(t),o=s.transaction(Gr,"readwrite"),l=o.objectStore(Gr),u;try{u=l.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(c){return n(c)}let p;u.onsuccess=()=>{p=s.transaction(Hs,"readwrite");let c=p.objectStore(Hs),d;try{d=c.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i})}catch(h){return n(h)}d.onsuccess=()=>a({modelArtifactsInfo:i}),d.onerror=h=>{l=o.objectStore(Gr);let m=l.delete(this.modelPath);m.onsuccess=()=>(s.close(),n(d.error)),m.onerror=f=>(s.close(),n(d.error))}},u.onerror=c=>(s.close(),n(u.error)),o.oncomplete=()=>{p==null?s.close():p.oncomplete=()=>s.close()}}},r.onerror=s=>n(r.error)})}};Xs.URL_SCHEME="indexeddb://";var jA=e=>B().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Xs.URL_SCHEME)?wN(e.slice(Xs.URL_SCHEME.length)):null;fn.registerSaveRouter(jA);fn.registerLoadRouter(jA);function wN(e){return new Xs(e)}function kN(e){return e.startsWith(Xs.URL_SCHEME)?e.slice(Xs.URL_SCHEME.length):e}var IN=class{constructor(){this.indexedDB=HA()}async listModels(){return new Promise((e,t)=>{let a=this.indexedDB.open(d1,p1);a.onupgradeneeded=()=>c1(a),a.onsuccess=()=>{let n=a.result,r=n.transaction(Gr,"readonly"),s=r.objectStore(Gr).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(n.close(),t(s.error)),r.oncomplete=()=>n.close()},a.onerror=n=>t(a.error)})}async removeModel(e){return e=kN(e),new Promise((t,a)=>{let n=this.indexedDB.open(d1,p1);n.onupgradeneeded=()=>c1(n),n.onsuccess=()=>{let r=n.result,s=r.transaction(Gr,"readwrite"),i=s.objectStore(Gr),o=i.get(e),l;o.onsuccess=()=>{if(o.result==null)return r.close(),a(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let u=i.delete(e),p=()=>{l=r.transaction(Hs,"readwrite");let c=l.objectStore(Hs).delete(e);c.onsuccess=()=>t(o.result.modelArtifactsInfo),c.onerror=d=>a(o.error)};u.onsuccess=p,u.onerror=c=>(p(),r.close(),a(o.error))}},o.onerror=u=>(r.close(),a(o.error)),s.oncomplete=()=>{l==null?r.close():l.oncomplete=()=>r.close()}},n.onerror=r=>a(n.error)})}},vr="/",Dl="tensorflowjs_models",qA="info",SN="model_topology",CN="weight_specs",TN="weight_data",NN="model_metadata";function XA(e){return{info:[Dl,e,qA].join(vr),topology:[Dl,e,SN].join(vr),weightSpecs:[Dl,e,CN].join(vr),weightData:[Dl,e,TN].join(vr),modelMetadata:[Dl,e,NN].join(vr)}}function KA(e){for(let t of Object.values(e))window.localStorage.removeItem(t)}function RN(e){let t=e.split(vr);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(vr)}function EN(e){return e.startsWith(Ks.URL_SCHEME)?e.slice(Ks.URL_SCHEME.length):e}var Ks=class{constructor(e){if(!B().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=XA(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),a=JSON.stringify(e.weightSpecs),n=_p(e),r=Tr.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(n)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,a),this.LS.setItem(this.keys.weightData,pN(r));let s={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,initializerSignature:e.initializerSignature!=null?e.initializerSignature:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(s)),{modelArtifactsInfo:n}}catch(s){throw KA(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.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={},a=JSON.parse(this.LS.getItem(this.keys.topology));if(a==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=a;let n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(n==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=n;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),i.initializerSignature!=null&&(t.initializerSignature=i.initializerSignature),i.trainingConfig!=null&&(t.trainingConfig=i.trainingConfig)}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=cN(s),t}};Ks.URL_SCHEME="localstorage://";var YA=e=>B().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(Ks.URL_SCHEME)?MN(e.slice(Ks.URL_SCHEME.length)):null;fn.registerSaveRouter(YA);fn.registerLoadRouter(YA);function MN(e){return new Ks(e)}var PN=class{constructor(){F(B().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=Dl+vr,a=vr+qA;for(let n=0;n"scheme must not be undefined or null."),t.endsWith(Ll)&&(t=t.slice(0,t.indexOf(Ll))),F(t.length>0,()=>"scheme must not be an empty string.");let n=Wr.getInstance();F(n.managers[t]==null,()=>`A model store manager is already registered for scheme '${t}'.`),n.managers[t]=a}static getManager(t){let a=Wr.getInstance().managers[t];if(a==null)throw new Error(`Cannot find model manager for scheme '${t}'`);return a}static getSchemes(){return Object.keys(Wr.getInstance().managers)}};function Qc(e){if(e.indexOf(Ll)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${es.getSchemes().join(",")}`);return{scheme:e.split(Ll)[0],path:e.split(Ll)[1]}}async function ZA(e,t,a=!1){F(e!==t,()=>`Old path and new path are the same: '${e}'`);let n=fn.getLoadHandlers(e);F(n.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),F(n.length<2,()=>`Copying failed because more than one (${n.length}) load handlers for source URL ${e}.`);let r=n[0],s=fn.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 (${n.length}) save handlers for destination URL ${t}.`);let i=s[0],o=Qc(e).scheme,l=Qc(e).path,u=o===Qc(e).scheme,p=await r.load();a&&u&&await es.getManager(o).removeModel(l);let c=await i.save(p);return a&&!u&&await es.getManager(o).removeModel(l),c.modelArtifactsInfo}async function _N(){let e=es.getSchemes(),t={};for(let a of e){let n=await es.getManager(a).listModels();for(let r in n){let s=a+Ll+r;t[s]=n[r]}}return t}async function $N(e){let t=Qc(e);return es.getManager(t.scheme).removeModel(t.path)}async function FN(e,t){return ZA(e,t,!1)}async function DN(e,t){return ZA(e,t,!0)}var ON=class{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}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)}setTimeoutCustom(e,t){if(typeof window=="undefined"||!B().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(e,t);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",a=>{if(a.source===window&&a.data.name===this.messageName){a.stopPropagation();let n=this.functionRefs[a.data.index];n(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(e){return TA(e)}};if(B().get("IS_BROWSER")){B().setPlatform("browser",new ON);try{es.registerManager(Ks.URL_SCHEME,new PN)}catch(e){}try{es.registerManager(Xs.URL_SCHEME,new IN)}catch(e){}}var zN={importFetch:()=>WC()},q2,LN=class{constructor(){this.util=BC(),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return B().global.fetch!=null?B().global.fetch(e,t):(q2==null&&(q2=zN.importFetch()),q2(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)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}};B().get("IS_NODE")&&!B().get("IS_BROWSER")&&B().setPlatform("node",new LN);function $e(e,t="float32",a){return t=t||"float32",tn(e),new Vt(e,t,a)}function WN(e,t){let a=R(e,"x","cast");if(!AA(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&a.dtype!=="string"||t!=="string"&&a.dtype==="string")throw new Error("Only strings can be casted to strings");let n={x:a},r={dtype:t};return L.runKernel(xi,n,r)}var Ue=z({cast_:WN});function BN(e){let t={x:R(e,"x","clone","string_or_numeric")};return L.runKernel(Hi,t)}var Ia=z({clone_:BN});function og(e,t=!1){console.log(e.toString(t))}OA();var VN={buffer:$e,cast:Ue,clone:Ia,print:og};ZT(VN);function lg(){B().set("PROD",!0)}function UN(){B().set("DEBUG",!0)}function GN(){B().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function ug(e){B().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}JT(ug);function HN(){L.disposeVariables()}function It(){return L}function jN(){return L.memory()}function qN(e){return L.profile(e)}function De(e,t){return L.tidy(e,t)}function J(e){ag(e).forEach(t=>t.dispose())}function zn(e){return L.keep(e)}function XN(e){return L.time(e)}function $p(e){return L.setBackend(e)}function Fp(){return L.ready()}function ca(){return L.backendName}function KN(e){L.removeBackend(e)}function dg(e){return L.findBackend(e)}function YN(e){return L.findBackendFactory(e)}function Qo(e,t,a=1){return L.registerBackend(e,t,a)}function nr(){return L.backend}function ZN(e,t){B().setPlatform(e,t)}function JN(e,t){let a=R(e,"a","add"),n=R(t,"b","add");[a,n]=Rt(a,n);let r={a,b:n};return L.runKernel(is,r)}var we=z({add_:JN});function QN(e,t){let a=R(e,"a","floorDiv"),n=R(t,"b","floorDiv");[a,n]=Rt(a,n);let r={a,b:n};return L.runKernel(Wi,r)}var Dp=z({floorDiv_:QN});function eR(e,t){let a=R(e,"a","div"),n=R(t,"b","div");if([a,n]=Rt(a,n),a.dtype==="int32"&&n.dtype==="int32")return Dp(a,n);let r={a,b:n},s={};return L.runKernel(Pi,r,s)}var ve=z({div_:eR});function tR(e,t){let a=R(e,"a","mul"),n=R(t,"b","mul");[a,n]=Rt(a,n);let r={a,b:n};return L.runKernel(fo,r)}var te=z({mul_:tR});function aR(e){let t=R(e,"x","abs");if(t.dtype==="complex64"){let a={x:t};return L.runKernel(dp,a)}else{let a={x:t};return L.runKernel(ru,a)}}var Ya=z({abs_:aR});function nR(e){let t={x:R(e,"x","acos")};return L.runKernel(si,t)}var JA=z({acos_:nR});function rR(e){let t={x:R(e,"x","acosh")};return L.runKernel(ii,t)}var QA=z({acosh_:rR});function sR(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)=>R(r,`tensors${s}`,"addN")),a=t[0];t.forEach(r=>{if(r.dtype!==a.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(r=>{if(!Cr(r.shape,a.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let n=t;return L.runKernel(oi,n)}var Fh=z({addN_:sR});function iR(e,t=null,a=!1){let n={x:R(e,"x","all","bool")},r={axis:t,keepDims:a};return L.runKernel(li,n,r)}var eb=z({all_:iR});function oR(e,t=null,a=!1){let n={x:R(e,"x","any","bool")},r={axis:t,keepDims:a};return L.runKernel(ui,n,r)}var tb=z({any_:oR});function lR(e,t=0){let a={x:R(e,"x","argMax")},n={axis:t};return L.runKernel(su,a,n)}var rr=z({argMax_:lR});function uR(e,t=0){let a={x:R(e,"x","argMin")},n={axis:t};return L.runKernel(iu,a,n)}var ab=z({argMin_:uR});function dR(e){let t={x:R(e,"x","asin")};return L.runKernel(di,t)}var nb=z({asin_:dR});function pR(e){let t={x:R(e,"x","asinh")};return L.runKernel(pi,t)}var rb=z({asinh_:pR});function cR(e){let t={x:R(e,"x","atan")};return L.runKernel(ci,t)}var sb=z({atan_:cR});function hR(e,t){let a=R(e,"a","atan2"),n=R(t,"b","atan2");[a,n]=Rt(a,n);let r={a,b:n};return L.runKernel(mi,r)}var ib=z({atan2_:hR});function mR(e){let t={x:R(e,"x","atanh")};return L.runKernel(hi,t)}var ob=z({atanh_:mR});function fR(e,t,a,n,r="NHWC",s){let i=e[3],o=[...t,i],l=db(r);return Op(e,o,a,s,n,null,null,l)}function lb(e,t,a,n,r,s,i="channelsLast"){let[o,l]=Ud(t),u;if(i==="channelsLast")u=[o,l,e[3],e[3]];else if(i==="channelsFirst")u=[o,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return Op(e,u,a,n,r,s,!1,i)}function gR(e,t,a,n,r,s,i="NDHWC"){let[o,l,u]=h1(t),p,c;if(i==="NDHWC")c="channelsLast",p=[o,l,u,e[4],e[4]];else if(i==="NCDHW")c="channelsFirst",p=[o,l,u,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return ub(e,p,a,n,r,!1,c,s)}function Op(e,t,a,n,r,s,i=!1,o="channelsLast"){let[l,u,p,c]=[-1,-1,-1,-1];if(o==="channelsLast")[l,u,p,c]=e;else if(o==="channelsFirst")[l,c,u,p]=e;else throw new Error(`Unknown dataFormat ${o}`);let[d,h,,m]=t,[f,g]=Ud(a),[y,x]=Ud(n),A=Wl(d,y),b=Wl(h,x),{padInfo:w,outHeight:I,outWidth:T}=AR(r,u,p,f,g,A,b,s,o),N=i?m*c:m,M;return o==="channelsFirst"?M=[l,N,I,T]:o==="channelsLast"&&(M=[l,I,T,N]),{batchSize:l,dataFormat:o,inHeight:u,inWidth:p,inChannels:c,outHeight:I,outWidth:T,outChannels:N,padInfo:w,strideHeight:f,strideWidth:g,filterHeight:d,filterWidth:h,effectiveFilterHeight:A,effectiveFilterWidth:b,dilationHeight:y,dilationWidth:x,inShape:e,outShape:M,filterShape:t}}function ub(e,t,a,n,r,s=!1,i="channelsLast",o){let[l,u,p,c,d]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[l,u,p,c,d]=e;else if(i==="channelsFirst")[l,d,u,p,c]=e;else throw new Error(`Unknown dataFormat ${i}`);let[h,m,f,,g]=t,[y,x,A]=h1(a),[b,w,I]=h1(n),T=Wl(h,b),N=Wl(m,w),M=Wl(f,I),{padInfo:P,outDepth:E,outHeight:S,outWidth:_}=bR(r,u,p,c,y,x,A,T,N,M,o),O=s?g*d:g,W;return i==="channelsFirst"?W=[l,O,E,S,_]:i==="channelsLast"&&(W=[l,E,S,_,O]),{batchSize:l,dataFormat:i,inDepth:u,inHeight:p,inWidth:c,inChannels:d,outDepth:E,outHeight:S,outWidth:_,outChannels:O,padInfo:P,strideDepth:y,strideHeight:x,strideWidth:A,filterDepth:h,filterHeight:m,filterWidth:f,effectiveFilterDepth:T,effectiveFilterHeight:N,effectiveFilterWidth:M,dilationDepth:b,dilationHeight:w,dilationWidth:I,inShape:e,outShape:W,filterShape:t}}function yR(e,t,a,n,r){n==null&&(n=pg(e,t,a));let s=e[0],i=e[1],o=Gd((s-t+2*n)/a+1,r),l=Gd((i-t+2*n)/a+1,r);return[o,l]}function xR(e,t,a,n,r,s){r==null&&(r=pg(e,t[0],n[0]));let i=[0,0,0,a];for(let o=0;o<3;o++)e[o]+2*r>=t[o]&&(i[o]=Gd((e[o]-t[o]+2*r)/n[o]+1,s));return i}function pg(e,t,a,n=1){let r=Wl(t,n);return Math.floor((e[0]*(a-1)-a+r)/2)}function Ud(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function h1(e){return typeof e=="number"?[e,e,e]:e}function Wl(e,t){return t<=1?e:e+(e-1)*(t-1)}function AR(e,t,a,n,r,s,i,o,l){let u,p,c;if(typeof e=="number"){u={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let d=yR([t,a],s,n,e,o);p=d[0],c=d[1]}else if(e==="same"){p=Math.ceil(t/n),c=Math.ceil(a/r);let d=Math.max(0,(p-1)*n+s-t),h=Math.max(0,(c-1)*r+i-a),m=Math.floor(d/2),f=d-m,g=Math.floor(h/2),y=h-g;u={top:m,bottom:f,left:g,right:y,type:"SAME"}}else if(e==="valid")u={top:0,bottom:0,left:0,right:0,type:"VALID"},p=Math.ceil((t-s+1)/n),c=Math.ceil((a-i+1)/r);else if(typeof e=="object"){let d=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];u={top:d,bottom:h,left:m,right:f,type:d===0&&h===0&&m===0&&f===0?"VALID":"EXPLICIT"},p=Gd((t-s+d+h)/n+1,o),c=Gd((a-i+m+f)/r+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outHeight:p,outWidth:c}}function bR(e,t,a,n,r,s,i,o,l,u,p){let c,d,h,m;if(e==="valid"&&(e=0),typeof e=="number"){c={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=xR([t,a,n,1],[o,l,u],1,[r,s,i],e,p);d=f[0],h=f[1],m=f[2]}else if(e==="same"){d=Math.ceil(t/r),h=Math.ceil(a/s),m=Math.ceil(n/i);let f=(d-1)*r+o-t,g=(h-1)*s+l-a,y=(m-1)*i+u-n,x=Math.floor(f/2),A=f-x,b=Math.floor(g/2),w=g-b,I=Math.floor(y/2),T=y-I;c={top:b,bottom:w,left:I,right:T,front:x,back:A,type:"SAME"}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:c,outDepth:d,outHeight:h,outWidth:m}}function Gd(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 Hd(e){let[t,a,n]=Ud(e);return t===1&&a===1&&n===1}function Nr(e,t){return Hd(e)||Hd(t)}function Ys(e){return Ud(e).every(t=>t>0)}function db(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function Nn(e,t,a){if(a!=null){if(typeof t=="string")throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${a} but got pad ${t}.`);if(typeof t=="number")F(Ul(t),()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${a} but got pad ${t}.`);else if(typeof t=="object")t.forEach(n=>{n.forEach(r=>{F(Ul(r),()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${a} but got pad ${r}.`)})});else throw Error(`Error in ${e}: Unknown padding parameter: ${t}`)}}function vR(e,t){let a={x:R(e,"x","reshape","string_or_numeric")},n={shape:t};return L.runKernel(Tu,a,n)}var Q=z({reshape_:vR});function wR(e,t,a,n,r){let s=R(e,"x","avgPool","float32"),i=1;F(Nr(a,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${i}'`);let o=s,l=!1;s.rank===3&&(l=!0,o=Q(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}.`),Nn("avgPool",n,r);let u={x:o},p={filterSize:t,strides:a,pad:n,dimRoundingMode:r},c=L.runKernel(fi,u,p);return c=Ue(c,s.dtype),l?Q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var cg=z({avgPool_:wR});function kR(e,t,a,n,r,s="NDHWC"){let i=R(e,"x","avgPool3d","float32"),o=i,l=!1;i.rank===4&&(l=!0,o=Q(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}`),F(typeof a=="number"&&a>0||Array.isArray(a)&&a[0]>0&&a[1]>0&&a[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${a}'`),Nn("avgPool3d",n,r);let u={x:o},p={filterSize:t,strides:a,pad:n,dimRoundingMode:r,dataFormat:s},c=L.runKernel(ou,u,p);return c=Ue(c,o.dtype),l?Q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var pb=z({avgPool3d_:kR});function IR(e,t=0){F(e.length>=1,()=>"Pass at least one tensor to concat");let a=Vd(e,"tensors","concat","string_or_numeric");if(a[0].dtype==="complex64"&&a.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${s.dtype}. `)}),a.length===1)return Ia(a[0]);let n=a,r={axis:t};return L.runKernel(pu,n,r)}var lt=z({concat_:IR});function SR(e,t,a=!1,n=!1){let r=R(e,"a","matMul"),s=R(t,"b","matMul");[r,s]=Rt(r,s);let i={a:r,b:s},o={transposeA:a,transposeB:n};return L.runKernel(gi,i,o)}var pt=z({matMul_:SR});function CR(e){let t={x:R(e,"x","sigmoid","float32")};return L.runKernel(Lo,t)}var za=z({sigmoid_:CR});function TR(e,t,a){let n=R(e,"x","slice","string_or_numeric");if(n.rank===0)throw new Error("Slicing scalar is not possible");let r={x:n},s={begin:t,size:a};return L.runKernel(Mu,r,s)}var Fe=z({slice_:TR});function NR(e){let t={x:R(e,"x","tanh","float32")};return L.runKernel(Ko,t)}var ch=z({tanh_:NR});function RR(e,t,a,n,r,s){let i=R(e,"forgetBias","basicLSTMCell"),o=R(t,"lstmKernel","basicLSTMCell"),l=R(a,"lstmBias","basicLSTMCell"),u=R(n,"data","basicLSTMCell"),p=R(r,"c","basicLSTMCell"),c=R(s,"h","basicLSTMCell"),d=lt([u,c],1),h=pt(d,o),m=we(h,l),f=m.shape[0],g=m.shape[1]/4,y=[f,g],x=Fe(m,[0,0],y),A=Fe(m,[0,g],y),b=Fe(m,[0,g*2],y),w=Fe(m,[0,g*3],y),I=we(te(za(x),ch(A)),te(p,za(we(i,b)))),T=te(ch(I),za(w));return[I,T]}var cb=z({basicLSTMCell_:RR});function ER(e,t,a){let n=R(e,"x","batchToSpaceND"),r=t.reduce((o,l)=>o*l);F(n.rank>=1+t.length,()=>`input rank is ${n.rank} but should be > than blockShape.length ${t.length}`),F(a.length===t.length,()=>`crops.length is ${a.length} but should be equal to blockShape.length ${t.length}`),F(n.shape[0]%r===0,()=>`input tensor batch is ${n.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`);let s={x:n},i={blockShape:t,crops:a};return L.runKernel(lu,s,i)}var hg=z({batchToSpaceND_:ER});function MR(e){let t;return e.rank===0||e.rank===1?t=Q(e,[1,1,1,e.size]):e.rank===2?t=Q(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=Q(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function PR(e,t,a,n,r,s){s==null&&(s=.001);let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let p;n!=null&&(p=R(n,"offset","batchNorm")),F(o.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),F(p==null||o.rank===p.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),F(u==null||o.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let c={x:MR(i),scale:u,offset:p,mean:o,variance:l},d={varianceEpsilon:s},h=L.runKernel(Bi,c,d);return Q(h,i.shape)}var zp=z({batchNorm_:PR});function _R(e,t,a,n,r,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let p;return n!=null&&(p=R(n,"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}.`),u!=null&&F(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),p!=null&&F(p.rank===2||p.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${p.rank}.`),zp(i,o,l,p,u,s)}var hb=z({batchNorm2d_:_R});function $R(e,t,a,n,r,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let p;return n!=null&&(p=R(n,"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}.`),u!=null&&F(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),p!=null&&F(p.rank===3||p.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${p.rank}.`),zp(i,o,l,p,u,s)}var mb=z({batchNorm3d_:$R});function FR(e,t,a,n,r,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let p;return n!=null&&(p=R(n,"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}.`),u!=null&&F(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),p!=null&&F(p.rank===4||p.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${p.rank}.`),zp(i,o,l,p,u,s)}var fb=z({batchNorm4d_:FR});function DR(e,t,a){let n=R(e,"x","bincount"),r=R(t,"weights","bincount");F(n.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${n.dtype}`),F(a>=0,()=>`size must be non-negative, but got ${a}.`),F(r.size===n.size||r.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${n.shape}, weights shape: ${r.shape}.`);let s={x:n,weights:r},i={size:a};return L.runKernel(yi,s,i)}var mg=z({bincount_:DR});function OR(e,t){let a=R(e,"x","bitwiseAnd"),n=R(t,"y","bitwiseAnd");if(!Cr(a.shape,n.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${a.shape}, y: ${n.shape}`);if(a.dtype!=="int32"||n.dtype!=="int32")throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${a.dtype} and type of y: ${n.dtype}`);let r={a,b:n};return L.runKernel(uu,r)}var gb=z({bitwiseAnd_:OR});function zR(e,t){let a=R(e,"s0","broadcastArgs","int32"),n=R(t,"s1","broadcastArgs","int32");if(a.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${a.rank}`);if(n.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${n.rank}`);let r={s0:a,s1:n};return L.runKernel(du,r)}var yb=z({broadcastArgs_:zR});function LR(e,t){let a=R(e,"broadcastTo","x"),n=a.shape;if(tn(t),t.lengtha.rank){let l=a.shape.slice();for(;l.length=0;l--)if(r[l]===t[l])s[l]=1;else if(a.shape[l]!==1)throw new Error(`broadcastTo(): [${n}] cannot be broadcast to [${t}].`);if(s.map((l,u)=>l>1?u:-1).filter(l=>l>=0).length===0)return Ia(a);let i={x:a},o={reps:s};return L.runKernel(ls,i,o)}var Bl=z({broadcastTo_:LR});function WR(e){let t={x:R(e,"x","ceil","float32")};return L.runKernel(Ai,t)}var xb=z({ceil_:WR});function sr(e,t,a){tn(e),a=a||ip(t);let n={shape:e,value:t,dtype:a};return L.runKernel(yu,{},n)}function BR(e,t,a){let n=R(e,"x","clipByValue");if(F(t<=a,()=>`Error in clip: min (${t}) must be less than or equal to max (${a}).`),t===a)return sr(n.shape,t,n.dtype);let r={x:n},s={clipValueMin:t,clipValueMax:a};return L.runKernel(os,r,s)}var Ab=z({clipByValue_:BR});function VR(e){return lt(e,0)}var bb=z({concat1d_:VR});function UR(e,t){return lt(e,t)}var Wu=z({concat2d_:UR});function GR(e,t){return lt(e,t)}var vb=z({concat3d_:GR});function HR(e,t){return lt(e,t)}var wb=z({concat4d_:HR});function jR(e,t,a,n,r="NHWC",s=[1,1],i){let o=R(e,"x","conv2d","float32"),l=R(t,"filter","conv2d","float32"),u=o,p=!1;o.rank===3&&(p=!0,u=Q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),F(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),F(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),Nn("conv2d",n,i);let c=r==="NHWC"?u.shape[3]:u.shape[1];F(c===l.shape[2],()=>`Error in conv2d: depth of input (${c}) must match input depth for filter ${l.shape[2]}.`),F(Nr(a,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`),F(Ys(s),()=>"Error in conv2D: Dilated rates should be larger than 0."),F(Ys(a),()=>"Error in conv2D: Strides should be larger than 0.");let d={x:u,filter:l},h={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i},m=L.runKernel(bi,d,h);return p?Q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var Lp=z({conv2d_:jR});function qR(e,t,a,n,r="NWC",s=1,i){let o=R(e,"x","conv1d"),l=R(t,"filter","conv1d"),u=o,p=!1;o.rank===2&&(p=!0,u=Q(o,[1,o.shape[0],o.shape[1]])),F(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),F(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),Nn("conv1d",n,i),F(u.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`),F(Nr(a,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${a} and dilation '${s}'`),F(Ys(s),()=>"Error in conv1D: Dilated rates should be larger than 0."),F(Ys(a),()=>"Error in conv1D: Stride should be larger than 0."),F(r==="NWC",()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`);let c=Q(l,[1,l.shape[0],l.shape[1],l.shape[2]]),d=Q(u,[u.shape[0],1,u.shape[1],u.shape[2]]),h=Lp(d,c,[1,a],n,"NHWC",[1,s],i);return p?Q(h,[h.shape[2],h.shape[3]]):Q(h,[h.shape[0],h.shape[2],h.shape[3]])}var kb=z({conv1d_:qR});function XR(e,t,a,n,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,u=!1;t.rank===3&&(u=!0,l=Q(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(a.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${a.rank}`);let p=s==="NHWC"?o[3]:o[1],c=s==="NHWC"?l.shape[3]:l.shape[1];F(p===a.shape[2],()=>`Error in conv2dDerInput: depth of input (${p}) must match input depth for filter ${a.shape[2]}.`),F(c===a.shape[3],()=>`Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${a.shape[3]}.`),Nn("conv2dDerInput",r,i);let d={dy:l,filter:a},h={strides:n,pad:r,dataFormat:s,dimRoundingMode:i,inputShape:o},m=L.runKernel(vi,d,h);return u?Q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var Ib=z({conv2DBackpropInput_:XR});function KR(e,t,a,n,r,s){let i=R(e,"x","conv2dTranspose"),o=R(t,"filter","conv2dTranspose");return Ib(a,i,o,n,r,"NHWC",s)}var Sb=z({conv2dTranspose_:KR});function YR(e,t,a,n,r="NDHWC",s=[1,1,1]){let i=R(e,"x","conv3d"),o=R(t,"filter","conv3d"),l=i,u=!1;i.rank===4&&(u=!0,l=Q(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(Nr(a,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`),F(r==="NDHWC",()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`),F(Ys(s),()=>"Error in conv3D: Dilated rates should be larger than 0."),F(Ys(a),()=>"Error in conv3D: Strides should be larger than 0.");let p={x:l,filter:o},c={strides:a,pad:n,dataFormat:r,dilations:s},d=L.runKernel(wi,p,c);return u?Q(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}var Cb=z({conv3d_:YR});function ZR(e,t,a,n,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=Q(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],u=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(a.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${a.rank}`),F(l===a.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${a.shape[3]}.`),F(u===a.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${a.shape[4]}.`);let p={dy:i,filter:a},c={pad:r,strides:n,inputShape:s},d=L.runKernel(ki,p,c);return o?Q(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}var JR=z({conv3DBackpropInput_:ZR});function QR(e,t,a,n,r){let s=R(e,"x","conv3dTranspose"),i=R(t,"filter","conv3dTranspose");return JR(a,s,i,n,r)}var Tb=z({conv3dTranspose_:QR});function eE(e){let t={x:R(e,"x","cos","float32")};return L.runKernel(Ii,t)}var Nb=z({cos_:eE});function tE(e){let t={x:R(e,"x","cosh","float32")};return L.runKernel(Si,t)}var Rb=z({cosh_:tE});function aE(e,t=0,a=!1,n=!1){let r={x:R(e,"x","cumprod")},s={axis:t,exclusive:a,reverse:n};return L.runKernel(Ci,r,s)}var Eb=z({cumprod_:aE});function nE(e,t=0,a=!1,n=!1){let r={x:R(e,"x","cumsum")},s={axis:t,exclusive:a,reverse:n};return L.runKernel(Ti,r,s)}var Mb=z({cumsum_:nE});function rE(e,t,a,n=!1){let r=R(e,"x","denseBincount"),s=R(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(a>=0,()=>`size must be non-negative, but got ${a}.`),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:a,binaryOutput:n};return L.runKernel(hu,i,o)}var Pb=z({denseBincount_:rE});function sE(e,t,a="NHWC"){let n=R(e,"x","depthToSpace","float32"),r=a==="NHWC"?n.shape[1]:n.shape[2],s=a==="NHWC"?n.shape[2]:n.shape[3],i=a==="NHWC"?n.shape[3]:n.shape[1];F(t>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`),F(r*t>=0,()=>`Negative dimension size caused by overflow when multiplying +`;return p[p.length-1]=" "+p[p.length-1]+"]"+(s?"":m),p}function Md(e){let t=[];for(let a=0;a`Length of values '${n}' 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=a||ig(t,this.size),this.strides=pu(e)}set(e,...t){t.length===0&&(t=[0]),P(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let a=this.locToIndex(t);this.values[a]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let n of e){if(n<0||n>=this.shape[t]){let r=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(r)}t++}let a=e[e.length-1];for(let n=0;nxh(a))}catch(a){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),Wn().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();let e=Wn().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>xh(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 Wn().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Wn().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Gl.print(this,e)}clone(){return this.throwIfDisposed(),Gl.clone(this)}toString(e=!1){let t=this.dataSync();return zN(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Gl.cast(this,e)}variable(e=!0,t,a){return this.throwIfDisposed(),Wn().makeVariable(this,e,t,a)}};Object.defineProperty(yt,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});function YA(){return ug("Tensor",()=>yt)}YA();var Yd=class extends yt{constructor(e,t,a,n){super(e.shape,e.dtype,e.dataId,n),this.trainable=t,this.name=a}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`);Wn().disposeTensor(this),this.dataId=e.dataId,Wn().incRef(this,null)}dispose(){Wn().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(Yd,Symbol.hasInstance,{value:e=>e instanceof yt&&e.assign!=null&&e.assign instanceof Function});var ZA={};Ke(ZA,{assertTypesMatch:()=>eb,getTensorsInContainer:()=>pg,isTensorInList:()=>HN,makeTypesMatch:()=>Et});var u1;(function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"})(u1||(u1={}));var d1;(function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"})(d1||(d1={}));var p1;(function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"})(p1||(p1={}));var c1;(function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"})(c1||(c1={}));var h1;(function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"})(h1||(h1={}));var GN={float32:c1,int32:d1,bool:p1,complex64:h1};function Qt(e,t){if(e==="string"||t==="string"){if(e==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return GN[e][t]}function Lp(e){return Qt(e,"int32")}function JA(e){return e!=null&&typeof e=="object"&&"texture"in e&&e.texture instanceof WebGLTexture}function QA(e){return typeof GPUBuffer!="undefined"&&e!=null&&typeof e=="object"&&"buffer"in e&&e.buffer instanceof GPUBuffer}function Et(e,t){if(e.dtype===t.dtype)return[e,t];let a=Qt(e.dtype,t.dtype);return[e.cast(a),t.cast(a)]}function eb(e,t){P(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function HN(e,t){return t.some(a=>a.id===e.id)}function pg(e){let t=[];return tb(e,t,new Set),t}function tb(e,t,a){if(e==null)return;if(e instanceof yt){t.push(e);return}if(!jN(e))return;let n=e;for(let r in n){let s=n[r];a.has(s)||(a.add(s),tb(s,t,a))}}function jN(e){return Array.isArray(e)||typeof e=="object"}function Q2(e){return e.kernelName!=null}var o5=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()}},cg=class m1{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new o5}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let t=this.getSortedBackends();for(let a=0;a{t.setupFunc!=null&&t.setupFunc(this.backendInstance)})}disposeRegisteredKernels(t){tr(t).forEach(a=>{a.disposeFunc!=null&&a.disposeFunc(this.registry[t])})}initializeBackend(t){let a=this.registryFactory[t];if(a==null)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{let n=a.factory();if(n&&!(n instanceof du)&&typeof n.then=="function"){let r=++this.pendingBackendInitId,s=n.then(i=>r(rthis.registryFactory[a].priority-this.registryFactory[t].priority)}initializeBackendsAndReturnBest(){let t=this.getSortedBackends();for(let a=0;athis.startScope(n),()=>this.endScope(r),()=>(r=a(),r instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r))}scopedRun(t,a,n){t();try{let r=n();return a(),r}catch(r){throw a(),r}}nextTensorId(){return m1.nextTensorId++}nextVariableId(){return m1.nextVariableId++}clone(t){let a=L.runKernel(ho,{x:t}),n={x:t},r=i=>({x:()=>{let o="float32",l={x:i},u={dtype:o};return L.runKernel(qi,l,u)}}),s=[];return this.addTapeNode(this.state.activeScope.name,n,[a],r,s,{}),a}runKernel(t,a,n){if(this.backendName==null&&this.backend,Xd(t,this.backendName)==null)throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:a,attrs:n})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,a,n){let r=this.backend.numDataIds(),s=0;n.forEach(l=>{s+=l.dtype==="complex64"?3:1});let i=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=r-a-s-i;if(o>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${t}'`)}runKernelFunc(t){let a,n=[],r=this.isTapeOn(),s=this.state.numBytes,i=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let o;this.backendName==null&&this.backend;let l,u=Q2(t)?t.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(Q2(t)){let{kernelName:m,inputs:f,attrs:g}=t;this.backendName==null&&this.backend;let y=Xd(m,this.backendName);P(y!=null,()=>`Cannot find registered kernel '${m}' for backend '${this.backendName}'`),o=()=>{let x=this.backend.numDataIds();l=y.kernelFunc({inputs:f,attrs:g,backend:this.backend});let A=Array.isArray(l)?l:[l];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(m,x,A);let b=A.map(w=>w.rank!=null?w:this.makeTensorFromTensorInfo(w));if(r){let w=this.getTensorsForGradient(m,f,b);n=this.saveTensorsForBackwardMode(w)}return b}}else{let{forwardFunc:m}=t,f=g=>{r&&(n=g.map(y=>this.keep(this.clone(y))))};o=()=>{let g=this.backend.numDataIds();l=this.tidy(()=>m(this.backend,f));let y=Array.isArray(l)?l:[l];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,g,y),y}}let{inputs:d,attrs:c}=t,p=Q2(t)?null:t.backwardsFunc,h;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?a=o():(h=this.profiler.profileKernel(u,d,()=>o()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(h),a=h.outputs)}),r&&this.addTapeNode(u,d,a,p,n,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-i,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(d).map(m=>d[m]!=null?d[m].shape:null),outputShapes:a.map(m=>m.shape),kernelTimeMs:h.timeMs,extraInfo:h.extraInfo}),Array.isArray(l)?a:a[0]}saveTensorsForBackwardMode(t){return t.map(a=>this.keep(this.clone(a)))}getTensorsForGradient(t,a,n){let r=o1(t);if(r!=null){let s=r.inputsToSave||[],i=r.outputsToSave||[],o;r.saveAllInputs?(P(Array.isArray(a),()=>"saveAllInputs is true, expected inputs to be an array."),o=Object.keys(a).map(u=>a[u])):o=s.map(u=>a[u]);let l=n.filter((u,d)=>i[d]);return o.concat(l)}return[]}makeTensor(t,a,n,r){if(t==null)throw new Error("Values passed to engine.makeTensor() are null");n=n||"float32",r=r||this.backend;let s=t;n==="string"&&Xr(t[0])&&(s=t.map(l=>zp(l)));let i=r.write(s,a,n),o=new yt(a,n,i,this.nextTensorId());if(this.trackTensor(o,r),n==="string"){let l=this.state.tensorInfo.get(i),u=LA(s);this.state.numBytes+=u-l.bytes,l.bytes=u}return o}makeTensorFromDataId(t,a,n,r){n=n||"float32";let s={dataId:t,shape:a,dtype:n};return this.makeTensorFromTensorInfo(s,r)}makeTensorFromTensorInfo(t,a){let{dataId:n,shape:r,dtype:s}=t,i=new yt(r,s,n,this.nextTensorId());return this.trackTensor(i,a),i}makeVariable(t,a=!0,n,r){n=n||this.nextVariableId().toString(),r!=null&&r!==t.dtype&&(t=t.cast(r));let s=new Yd(t,a,n,this.nextTensorId());if(this.state.registeredVariables[s.name]!=null)throw new Error(`Variable with name ${s.name} was already registered`);return this.state.registeredVariables[s.name]=s,this.incRef(s,this.backend),s}trackTensor(t,a){this.state.numTensors++,t.dtype==="string"&&this.state.numStringTensors++;let n=0;t.dtype!=="complex64"&&t.dtype!=="string"&&(n=t.size*gh(t.dtype)),this.state.numBytes+=n,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:a||this.backend,dtype:t.dtype,shape:t.shape,bytes:n})),t instanceof Yd||this.track(t)}incRef(t,a){this.trackTensor(t,a),this.backend.incRef(t.dataId)}removeDataId(t,a){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===a&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;let a=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,t.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=a.bytes),t.dtype!=="complex64"&&t.dtype!=="string"){let n=t.size*gh(t.dtype);this.state.numBytes-=n}a.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,a.backend)}disposeVariables(){for(let t in this.state.registeredVariables){let a=this.state.registeredVariables[t];this.disposeVariable(a)}}disposeVariable(t){this.disposeTensor(t),this.state.registeredVariables[t.name]!=null&&delete this.state.registeredVariables[t.name]}memory(){let t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,t.reasons==null&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;let a=this.state.numBytes,n=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),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-a,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(t,a,n,r,s,i){let o={id:this.state.nextTapeNodeId++,kernelName:t,inputs:a,outputs:n,saved:s},l=o1(t);l!=null&&(r=l.gradFunc),r!=null&&(o.gradient=u=>(u=u.map((d,c)=>{if(d==null){let p=n[c],h=Oh(p.size,p.dtype);return this.makeTensor(h,p.shape,p.dtype)}return d}),r(u.length>1?u:u[0],s,i))),this.state.activeTape.push(o)}keep(t){return t.kept=!0,t}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){let a={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(a.name=t),this.state.scopeStack.push(a),this.state.activeScope=a}endScope(t){let a=pg(t),n=new Set(a.map(s=>s.id));for(let s=0;s{!s.kept&&s.scopeId===r.id&&this.track(s)})}gradients(t,a,n,r=!1){if(P(a.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 s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",t));P(s instanceof yt,()=>"The result y returned by f() must be a tensor.");let i=_N(this.state.activeTape,a,s);if(!r&&i.length===0&&a.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 o={};o[s.id]=n==null?qN(s.shape):n,ON(o,i,u=>this.tidy(u),XN);let l=a.map(u=>o[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(let d of u.saved)d.dispose()}),this.state.activeTape=null),{value:s,grads:l}})}customGrad(t){return P(es(t),()=>"The f passed in customGrad(f) must be a function."),(...a)=>{P(a.every(o=>o instanceof yt),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n,r={};a.forEach((o,l)=>{r[l]=o});let s=(o,l)=>(n=t(...a,l),P(n.value instanceof yt,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),P(es(n.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),n.value),i=(o,l)=>{let u=n.gradFunc(o,l),d=Array.isArray(u)?u:[u];P(d.length===a.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(...)."),P(d.every(p=>p instanceof yt),()=>"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 c={};return d.forEach((p,h)=>{c[h]=()=>p}),c};return this.runKernelFunc({forwardFunc:s,backwardsFunc:i,inputs:r})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}readToGPU(t,a){return this.state.tensorInfo.get(t).backend.readToGPU(t,a)}async time(t){let a=Kd(),n=await this.backend.time(t);return n.wallMs=Kd()-a,n}track(t){return this.state.activeScope!=null&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new o5;for(let t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};cg.nextTensorId=0;cg.nextVariableId=0;function qN(e){let t=og(mt(e),"float32");return L.makeTensor(t,e,"float32")}function ab(){let e=GA();if(e._tfengine==null){let t=new UA(e);e._tfengine=new cg(t)}return cN(e._tfengine.ENV),BN(()=>e._tfengine),e._tfengine}var L=ab();function XN(e,t){let a={a:e,b:t};return L.runKernel(Mr,a)}var Wp={};Ke(Wp,{isBrowser:()=>nb,isMobile:()=>ZN,mockIsMobile:()=>YN});function KN(){return typeof navigator!="undefined"&&navigator!=null}var f1;function YN(e){f1=e}function ZN(e){if(f1!==void 0)return f1;if(e||KN()){if(e||(e=navigator),e.product==="ReactNative")return!0;let t=e.userAgent||e.vendor||(typeof window!="undefined"?window.opera:"");if(!t){let a=e;return a.userAgentData&&a.userAgentData.mobile}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 nb(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var Ba=B();Ba.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.")});Ba.registerFlag("IS_BROWSER",()=>nb());Ba.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");Ba.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));Ba.registerFlag("IS_SAFARI",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));Ba.registerFlag("PROD",()=>!1);Ba.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>Ba.getBool("DEBUG"));Ba.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);Ba.registerFlag("IS_TEST",()=>!1);Ba.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>Ba.getBool("DEBUG"));Ba.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);Ba.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1);Ba.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1);function ar(e,t){let a=e;if(Jt(e))return t==="string"?[]:[e.length];if(JA(e)){let r=e.channels||"RGBA";return[e.height,e.width*r.length]}else if(QA(e))return[e.buffer.size/(t==null?4:gh(t))];if(!Array.isArray(e))return[];let n=[];for(;Array.isArray(a)||Jt(a)&&t!=="string";)n.push(a.length),a=a[0];return Array.isArray(e)&&B().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&rb(e,n,[]),n}function rb(e,t,a){if(a=a||[],!Array.isArray(e)&&!Jt(e)){P(t.length===0,()=>`Element arr[${a.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}P(t.length>0,()=>`Element arr[${a.join("][")}] should be a primitive, but is an array of ${e.length} elements`),P(e.length===t[0],()=>`Element arr[${a.join("][")}] should have ${t[0]} elements, but has ${e.length} elements`);let n=t.slice(1);for(let r=0;r=0&&(r=n),l5(n,r,t,a),e==null||!Jt(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 '${a}' must be a Tensor or TensorLike, but got '${o}'`)}let s=ar(e,r);!Jt(e)&&!Array.isArray(e)&&(e=[e]);let i=r!=="string"?Vh(e,r):rs(e,[],!0);return L.makeTensor(i,s,r)}function Zd(e,t,a,n="numeric"){if(!Array.isArray(e))throw new Error(`Argument ${t} passed to ${a} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((r,s)=>R(r,`${t}[${s}]`,a,n))}var hg="__op";function z(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 a=t[0],n=e[a];a.endsWith("_")&&(a=a.substring(0,a.length-1)),a=a+hg;let r=(...s)=>{L.startScope(a);try{let i=n(...s);return zh(i)&&console.error("Cannot return a Promise inside of tidy."),L.endScope(i),i}catch(i){throw L.endScope(null),i}};return Object.defineProperty(r,"name",{value:a,configurable:!0}),r}function JN(e,t){let a=R(e,"real","complex"),n=R(t,"imag","complex");Ca(a.shape,n.shape,`real and imag shapes, ${a.shape} and ${n.shape}, must match in call to tf.complex().`);let r={real:a,imag:n};return L.runKernel(xp,r)}var Rr=z({complex_:JN});function Ps(e,t,a,n){if(n==null)n=fp(e);else if(n==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(QA(e)||JA(e)){if(n!=="float32"&&n!=="int32")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${n}.`);return L.backend.createTensorFromGPUData(e,t||a,n)}if(!Jt(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){nn(t);let r=mt(t),s=mt(a);P(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 (${a}) does not match the provided shape (${t}). `)}}return!Jt(e)&&!Array.isArray(e)&&(e=[e]),t=t||a,e=n!=="string"?Vh(e,n):rs(e,[],!0),L.makeTensor(e,t,n)}function Ve(e,t,a){let n=ar(e,a);return Ps(e,t,n,a)}var vi={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8},Fr=class sb{static join(t){return new sb(t).slice()}constructor(t){if(this.shards=[],this.previousShardIndex=0,t==null||(t instanceof Array||(t=[t]),t=t.map(n=>Jt(n)?n.buffer:n),t.length===0))return;this.bufferUniformSize=t[0].byteLength;let a=0;for(let n=0;n=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(t/this.bufferUniformSize),this.previousShardIndex;function a(r){return t=r.end?1:0}if(a(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;let n=QN(this.shards,a);return n===-1?-1:(this.previousShardIndex=n,this.previousShardIndex)}};function QN(e,t){let a=0,n=e.length;for(;a<=n;){let r=Math.floor((n-a)/2)+a,s=t(e[r]);if(s===0)return r;s<0?n=r:a=r+1}return-1}function mg(){B().set("PROD",!0)}function eR(){B().set("DEBUG",!0)}function tR(){B().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function fg(e){B().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}UN(fg);function aR(){L.disposeVariables()}function St(){return L}function nR(){return L.memory()}function rR(e){return L.profile(e)}function Pe(e,t){return L.tidy(e,t)}function J(e){pg(e).forEach(t=>t.dispose())}function Bn(e){return L.keep(e)}function sR(e){return L.time(e)}function Bp(e){return L.setBackend(e)}function Vp(){return L.ready()}function ea(){return L.backendName}function iR(e){L.removeBackend(e)}function gg(e){return L.findBackend(e)}function oR(e){return L.findBackendFactory(e)}function ll(e,t,a=1){return L.registerBackend(e,t,a)}function Gn(){return L.backend}function lR(e,t){B().setPlatform(e,t)}var ss=4;async function uR(e,t){let a=[],n=[],r=Array.isArray(e)?e.map(i=>i.name):Object.keys(e);for(let i=0;i{let p=await l.bytes(),h=p.reduce((g,y)=>g+y.length,0)+ss*p.length,m=new Uint8Array(h),f=0;for(let g=0;ga.slice(r+o,r+l));n[s.name]=ob(s,a.slice(r,r+i)),r+=i}return n}function dR(e,t){let a=mt(e.shape),n;if("quantization"in e){let r=e.quantization;n=vi[r.dtype]}else if(e.dtype==="string"){let r=0;for(let s=0;s(r=await u5(n,r,d),r.slice(u,d)));r=await u5(n,r,i);let o=r.slice(0,i);r=r.slice(i);let l=ob(s,o);if(a[s.name]=l,ea()==="webgpu"){let u=Gn();"uploadToGPU"in u&&mt(l.shape)>=B().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&u.uploadToGPU(l.dataId)}}return a}function cR(e){if(e===null)throw new Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0,a=[];e.forEach(s=>{if(t+=s.byteLength,a.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 n=new Uint8Array(t),r=0;return a.forEach(s=>{n.set(new Uint8Array(s.buffer),r),r+=s.byteLength}),n.buffer}var yg=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function d5(e){return yg?Buffer.byteLength(e,"utf8"):new Blob([e]).size}function hR(e){if(yg)return Buffer.from(e).toString("base64");let t=new Uint8Array(e),a="";for(let n=0,r=t.length;n{let n=a<<13,r=0;for(;!(n&8388608);)r-=8388608,n<<=1;return n&=-8388609,r+=947912704,n|r},t=new Uint32Array(2048);t[0]=0;for(let a=1;a<1024;a++)t[a]=e(a);for(let a=1024;a<2048;a++)t[a]=939524096+(a-1024<<13);return t}function yR(){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 xR(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}function AR(){let e=gR(),t=yR(),a=xR();return n=>{let r=new ArrayBuffer(4*n.length),s=new Uint32Array(r);for(let i=0;i>10]+(o&1023)]+t[o>>10];s[i]=l}return new Float32Array(r)}}var xn=class zn{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return zn.instance==null&&(zn.instance=new zn),zn.instance}static registerSaveRouter(t){zn.getInstance().saveRouters.push(t)}static registerLoadRouter(t){zn.getInstance().loadRouters.push(t)}static getSaveHandlers(t){return zn.getHandlers(t,"save")}static getLoadHandlers(t,a){return zn.getHandlers(t,"load",a)}static getHandlers(t,a,n){let r=[];return(a==="load"?zn.getInstance().loadRouters:zn.getInstance().saveRouters).forEach(s=>{let i=s(t,n);i!==null&&r.push(i)}),r}},bR=e=>xn.registerSaveRouter(e),vR=e=>xn.registerLoadRouter(e),wR=e=>xn.getSaveHandlers(e),kR=(e,t)=>xn.getLoadHandlers(e,t),y1="tensorflowjs",x1=1,yi="models_store",Kr="model_info_store";function pb(){if(!B().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 A1(e){let t=e.result;t.createObjectStore(yi,{keyPath:"modelPath"}),t.createObjectStore(Kr,{keyPath:"modelPath"})}var wi=class{constructor(e){if(this.indexedDB=pb(),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((a,n)=>{let r=this.indexedDB.open(y1,x1);r.onupgradeneeded=()=>A1(r),r.onsuccess=()=>{let s=r.result;if(t==null){let i=s.transaction(yi,"readonly"),o=i.objectStore(yi).get(this.modelPath);o.onsuccess=()=>{if(o.result==null)return s.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));a(o.result.modelArtifacts)},o.onerror=l=>(s.close(),n(o.error)),i.oncomplete=()=>s.close()}else{t.weightData=Fr.join(t.weightData);let i=Up(t),o=s.transaction(Kr,"readwrite"),l=o.objectStore(Kr),u;try{u=l.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(c){return n(c)}let d;u.onsuccess=()=>{d=s.transaction(yi,"readwrite");let c=d.objectStore(yi),p;try{p=c.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i})}catch(h){return n(h)}p.onsuccess=()=>a({modelArtifactsInfo:i}),p.onerror=h=>{l=o.objectStore(Kr);let m=l.delete(this.modelPath);m.onsuccess=()=>(s.close(),n(p.error)),m.onerror=f=>(s.close(),n(p.error))}},u.onerror=c=>(s.close(),n(u.error)),o.oncomplete=()=>{d==null?s.close():d.oncomplete=()=>s.close()}}},r.onerror=s=>n(r.error)})}};wi.URL_SCHEME="indexeddb://";var cb=e=>B().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(wi.URL_SCHEME)?IR(e.slice(wi.URL_SCHEME.length)):null;xn.registerSaveRouter(cb);xn.registerLoadRouter(cb);function IR(e){return new wi(e)}function SR(e){return e.startsWith(wi.URL_SCHEME)?e.slice(wi.URL_SCHEME.length):e}var TR=class{constructor(){this.indexedDB=pb()}async listModels(){return new Promise((e,t)=>{let a=this.indexedDB.open(y1,x1);a.onupgradeneeded=()=>A1(a),a.onsuccess=()=>{let n=a.result,r=n.transaction(Kr,"readonly"),s=r.objectStore(Kr).getAll();s.onsuccess=()=>{let i={};for(let o of s.result)i[o.modelPath]=o.modelArtifactsInfo;e(i)},s.onerror=i=>(n.close(),t(s.error)),r.oncomplete=()=>n.close()},a.onerror=n=>t(a.error)})}async removeModel(e){return e=SR(e),new Promise((t,a)=>{let n=this.indexedDB.open(y1,x1);n.onupgradeneeded=()=>A1(n),n.onsuccess=()=>{let r=n.result,s=r.transaction(Kr,"readwrite"),i=s.objectStore(Kr),o=i.get(e),l;o.onsuccess=()=>{if(o.result==null)return r.close(),a(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let u=i.delete(e),d=()=>{l=r.transaction(yi,"readwrite");let c=l.objectStore(yi).delete(e);c.onsuccess=()=>t(o.result.modelArtifactsInfo),c.onerror=p=>a(o.error)};u.onsuccess=d,u.onerror=c=>(d(),r.close(),a(o.error))}},o.onerror=u=>(r.close(),a(o.error)),s.oncomplete=()=>{l==null?r.close():l.oncomplete=()=>r.close()}},n.onerror=r=>a(n.error)})}},Sr="/",Hl="tensorflowjs_models",hb="info",CR="model_topology",NR="weight_specs",RR="weight_data",ER="model_metadata";function mb(e){return{info:[Hl,e,hb].join(Sr),topology:[Hl,e,CR].join(Sr),weightSpecs:[Hl,e,NR].join(Sr),weightData:[Hl,e,RR].join(Sr),modelMetadata:[Hl,e,ER].join(Sr)}}function fb(e){for(let t of Object.values(e))window.localStorage.removeItem(t)}function MR(e){let t=e.split(Sr);if(t.length<3)throw new Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join(Sr)}function FR(e){return e.startsWith(ki.URL_SCHEME)?e.slice(ki.URL_SCHEME.length):e}var ki=class{constructor(e){if(!B().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=mb(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),a=JSON.stringify(e.weightSpecs),n=Up(e),r=Fr.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(n)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,a),this.LS.setItem(this.keys.weightData,hR(r));let s={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,initializerSignature:e.initializerSignature!=null?e.initializerSignature:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(s)),{modelArtifactsInfo:n}}catch(s){throw fb(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.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={},a=JSON.parse(this.LS.getItem(this.keys.topology));if(a==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=a;let n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(n==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=n;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),i.initializerSignature!=null&&(t.initializerSignature=i.initializerSignature),i.trainingConfig!=null&&(t.trainingConfig=i.trainingConfig)}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=mR(s),t}};ki.URL_SCHEME="localstorage://";var gb=e=>B().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(ki.URL_SCHEME)?$R(e.slice(ki.URL_SCHEME.length)):null;xn.registerSaveRouter(gb);xn.registerLoadRouter(gb);function $R(e){return new ki(e)}var DR=class{constructor(){P(B().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),P(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=Hl+Sr,a=Sr+hb;for(let n=0;n"scheme must not be undefined or null."),t.endsWith(Xl)&&(t=t.slice(0,t.indexOf(Xl))),P(t.length>0,()=>"scheme must not be an empty string.");let n=Hr.getInstance();P(n.managers[t]==null,()=>`A model store manager is already registered for scheme '${t}'.`),n.managers[t]=a}static getManager(t){let a=Hr.getInstance().managers[t];if(a==null)throw new Error(`Cannot find model manager for scheme '${t}'`);return a}static getSchemes(){return Object.keys(Hr.getInstance().managers)}};function oh(e){if(e.indexOf(Xl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${is.getSchemes().join(",")}`);return{scheme:e.split(Xl)[0],path:e.split(Xl)[1]}}async function yb(e,t,a=!1){P(e!==t,()=>`Old path and new path are the same: '${e}'`);let n=xn.getLoadHandlers(e);P(n.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),P(n.length<2,()=>`Copying failed because more than one (${n.length}) load handlers for source URL ${e}.`);let r=n[0],s=xn.getSaveHandlers(t);P(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),P(s.length<2,()=>`Copying failed because more than one (${n.length}) save handlers for destination URL ${t}.`);let i=s[0],o=oh(e).scheme,l=oh(e).path,u=o===oh(e).scheme,d=await r.load();a&&u&&await is.getManager(o).removeModel(l);let c=await i.save(d);return a&&!u&&await is.getManager(o).removeModel(l),c.modelArtifactsInfo}async function PR(){let e=is.getSchemes(),t={};for(let a of e){let n=await is.getManager(a).listModels();for(let r in n){let s=a+Xl+r;t[s]=n[r]}}return t}async function _R(e){let t=oh(e);return is.getManager(t.scheme).removeModel(t.path)}async function OR(e,t){return yb(e,t,!1)}async function zR(e,t){return yb(e,t,!0)}var LR=class{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}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)}setTimeoutCustom(e,t){if(typeof window=="undefined"||!B().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(e,t);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",a=>{if(a.source===window&&a.data.name===this.messageName){a.stopPropagation();let n=this.functionRefs[a.data.index];n(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(e){return jA(e)}};if(B().get("IS_BROWSER")){B().setPlatform("browser",new LR);try{is.registerManager(ki.URL_SCHEME,new DR)}catch(e){}try{is.registerManager(wi.URL_SCHEME,new TR)}catch(e){}}var WR={importFetch:()=>MC()},e1,BR=class{constructor(){this.util=FC(),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return B().global.fetch!=null?B().global.fetch(e,t):(e1==null&&(e1=WR.importFetch()),e1(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)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}};B().get("IS_NODE")&&!B().get("IS_BROWSER")&&B().setPlatform("node",new BR);function Te(e,t="float32",a){return t=t||"float32",nn(e),new Rt(e,t,a)}function VR(e,t){let a=R(e,"x","cast");if(!zA(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&a.dtype!=="string"||t!=="string"&&a.dtype==="string")throw new Error("Only strings can be casted to strings");let n={x:a},r={dtype:t};return L.runKernel(qi,n,r)}var Ue=z({cast_:VR});function UR(e){let t={x:R(e,"x","clone","string_or_numeric")};return L.runKernel(ho,t)}var Ia=z({clone_:UR});function Ag(e,t=!1){console.log(e.toString(t))}ab();var GR={buffer:Te,cast:Ue,clone:Ia,print:Ag};VN(GR);function HR(e,t){let a=R(e,"a","add"),n=R(t,"b","add");[a,n]=Et(a,n);let r={a,b:n};return L.runKernel(Mr,r)}var we=z({add_:HR});function jR(e,t){let a=R(e,"a","floorDiv"),n=R(t,"b","floorDiv");[a,n]=Et(a,n);let r={a,b:n};return L.runKernel(xs,r)}var Gp=z({floorDiv_:jR});function qR(e,t){let a=R(e,"a","div"),n=R(t,"b","div");if([a,n]=Et(a,n),a.dtype==="int32"&&n.dtype==="int32")return Gp(a,n);let r={a,b:n},s={};return L.runKernel(io,r,s)}var ve=z({div_:qR});function XR(e,t){let a=R(e,"a","mul"),n=R(t,"b","mul");[a,n]=Et(a,n);let r={a,b:n};return L.runKernel(Ts,r)}var te=z({mul_:XR});function KR(e){let t=R(e,"x","abs");if(t.dtype==="complex64"){let a={x:t};return L.runKernel(Ap,a)}else{let a={x:t};return L.runKernel(cu,a)}}var Ja=z({abs_:KR});function YR(e){let t={x:R(e,"x","acos")};return L.runKernel($i,t)}var xb=z({acos_:YR});function ZR(e){let t={x:R(e,"x","acosh")};return L.runKernel(Di,t)}var Ab=z({acosh_:ZR});function JR(e){P(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),P(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((r,s)=>R(r,`tensors${s}`,"addN")),a=t[0];t.forEach(r=>{if(r.dtype!==a.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(r=>{if(!Er(r.shape,a.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let n=t;return L.runKernel(Pi,n)}var Uh=z({addN_:JR});function QR(e,t=null,a=!1){let n={x:R(e,"x","all","bool")},r={axis:t,keepDims:a};return L.runKernel(_i,n,r)}var bb=z({all_:QR});function eE(e,t=null,a=!1){let n={x:R(e,"x","any","bool")},r={axis:t,keepDims:a};return L.runKernel(Oi,n,r)}var vb=z({any_:eE});function tE(e,t=0){let a={x:R(e,"x","argMax")},n={axis:t};return L.runKernel(hu,a,n)}var or=z({argMax_:tE});function aE(e,t=0){let a={x:R(e,"x","argMin")},n={axis:t};return L.runKernel(mu,a,n)}var wb=z({argMin_:aE});function nE(e){let t={x:R(e,"x","asin")};return L.runKernel(zi,t)}var kb=z({asin_:nE});function rE(e){let t={x:R(e,"x","asinh")};return L.runKernel(Li,t)}var Ib=z({asinh_:rE});function sE(e){let t={x:R(e,"x","atan")};return L.runKernel(Wi,t)}var Sb=z({atan_:sE});function iE(e,t){let a=R(e,"a","atan2"),n=R(t,"b","atan2");[a,n]=Et(a,n);let r={a,b:n};return L.runKernel(Vi,r)}var Tb=z({atan2_:iE});function oE(e){let t={x:R(e,"x","atanh")};return L.runKernel(Bi,t)}var Cb=z({atanh_:oE});function lE(e,t,a,n,r="NHWC",s){let i=e[3],o=[...t,i],l=Eb(r);return Hp(e,o,a,s,n,null,null,l)}function Nb(e,t,a,n,r,s,i="channelsLast"){let[o,l]=Jd(t),u;if(i==="channelsLast")u=[o,l,e[3],e[3]];else if(i==="channelsFirst")u=[o,l,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return Hp(e,u,a,n,r,s,!1,i)}function uE(e,t,a,n,r,s,i="NDHWC"){let[o,l,u]=b1(t),d,c;if(i==="NDHWC")c="channelsLast",d=[o,l,u,e[4],e[4]];else if(i==="NCDHW")c="channelsFirst",d=[o,l,u,e[1],e[1]];else throw new Error(`Unknown dataFormat ${i}`);return Rb(e,d,a,n,r,!1,c,s)}function Hp(e,t,a,n,r,s,i=!1,o="channelsLast"){let[l,u,d,c]=[-1,-1,-1,-1];if(o==="channelsLast")[l,u,d,c]=e;else if(o==="channelsFirst")[l,c,u,d]=e;else throw new Error(`Unknown dataFormat ${o}`);let[p,h,,m]=t,[f,g]=Jd(a),[y,x]=Jd(n),A=Kl(p,y),b=Kl(h,x),{padInfo:w,outHeight:S,outWidth:C}=cE(r,u,d,f,g,A,b,s,o),N=i?m*c:m,M;return o==="channelsFirst"?M=[l,N,S,C]:o==="channelsLast"&&(M=[l,S,C,N]),{batchSize:l,dataFormat:o,inHeight:u,inWidth:d,inChannels:c,outHeight:S,outWidth:C,outChannels:N,padInfo:w,strideHeight:f,strideWidth:g,filterHeight:p,filterWidth:h,effectiveFilterHeight:A,effectiveFilterWidth:b,dilationHeight:y,dilationWidth:x,inShape:e,outShape:M,filterShape:t}}function Rb(e,t,a,n,r,s=!1,i="channelsLast",o){let[l,u,d,c,p]=[-1,-1,-1,-1,-1];if(i==="channelsLast")[l,u,d,c,p]=e;else if(i==="channelsFirst")[l,p,u,d,c]=e;else throw new Error(`Unknown dataFormat ${i}`);let[h,m,f,,g]=t,[y,x,A]=b1(a),[b,w,S]=b1(n),C=Kl(h,b),N=Kl(m,w),M=Kl(f,S),{padInfo:F,outDepth:E,outHeight:T,outWidth:D}=hE(r,u,d,c,y,x,A,C,N,M,o),O=s?g*p:g,W;return i==="channelsFirst"?W=[l,O,E,T,D]:i==="channelsLast"&&(W=[l,E,T,D,O]),{batchSize:l,dataFormat:i,inDepth:u,inHeight:d,inWidth:c,inChannels:p,outDepth:E,outHeight:T,outWidth:D,outChannels:O,padInfo:F,strideDepth:y,strideHeight:x,strideWidth:A,filterDepth:h,filterHeight:m,filterWidth:f,effectiveFilterDepth:C,effectiveFilterHeight:N,effectiveFilterWidth:M,dilationDepth:b,dilationHeight:w,dilationWidth:S,inShape:e,outShape:W,filterShape:t}}function dE(e,t,a,n,r){n==null&&(n=bg(e,t,a));let s=e[0],i=e[1],o=Qd((s-t+2*n)/a+1,r),l=Qd((i-t+2*n)/a+1,r);return[o,l]}function pE(e,t,a,n,r,s){r==null&&(r=bg(e,t[0],n[0]));let i=[0,0,0,a];for(let o=0;o<3;o++)e[o]+2*r>=t[o]&&(i[o]=Qd((e[o]-t[o]+2*r)/n[o]+1,s));return i}function bg(e,t,a,n=1){let r=Kl(t,n);return Math.floor((e[0]*(a-1)-a+r)/2)}function Jd(e){return typeof e=="number"?[e,e,e]:e.length===2?[e[0],e[1],1]:e}function b1(e){return typeof e=="number"?[e,e,e]:e}function Kl(e,t){return t<=1?e:e+(e-1)*(t-1)}function cE(e,t,a,n,r,s,i,o,l){let u,d,c;if(typeof e=="number"){u={top:e,bottom:e,left:e,right:e,type:e===0?"VALID":"NUMBER"};let p=dE([t,a],s,n,e,o);d=p[0],c=p[1]}else if(e==="same"){d=Math.ceil(t/n),c=Math.ceil(a/r);let p=Math.max(0,(d-1)*n+s-t),h=Math.max(0,(c-1)*r+i-a),m=Math.floor(p/2),f=p-m,g=Math.floor(h/2),y=h-g;u={top:m,bottom:f,left:g,right:y,type:"SAME"}}else if(e==="valid")u={top:0,bottom:0,left:0,right:0,type:"VALID"},d=Math.ceil((t-s+1)/n),c=Math.ceil((a-i+1)/r);else if(typeof e=="object"){let p=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];u={top:p,bottom:h,left:m,right:f,type:p===0&&h===0&&m===0&&f===0?"VALID":"EXPLICIT"},d=Qd((t-s+p+h)/n+1,o),c=Qd((a-i+m+f)/r+1,o)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outHeight:d,outWidth:c}}function hE(e,t,a,n,r,s,i,o,l,u,d){let c,p,h,m;if(e==="valid"&&(e=0),typeof e=="number"){c={top:e,bottom:e,left:e,right:e,front:e,back:e,type:e===0?"VALID":"NUMBER"};let f=pE([t,a,n,1],[o,l,u],1,[r,s,i],e,d);p=f[0],h=f[1],m=f[2]}else if(e==="same"){p=Math.ceil(t/r),h=Math.ceil(a/s),m=Math.ceil(n/i);let f=(p-1)*r+o-t,g=(h-1)*s+l-a,y=(m-1)*i+u-n,x=Math.floor(f/2),A=f-x,b=Math.floor(g/2),w=g-b,S=Math.floor(y/2),C=y-S;c={top:b,bottom:w,left:S,right:C,front:x,back:A,type:"SAME"}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:c,outDepth:p,outHeight:h,outWidth:m}}function Qd(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 ep(e){let[t,a,n]=Jd(e);return t===1&&a===1&&n===1}function $r(e,t){return ep(e)||ep(t)}function Ii(e){return Jd(e).every(t=>t>0)}function Eb(e){if(e==="NHWC")return"channelsLast";if(e==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}function Mn(e,t,a){if(a!=null){if(typeof t=="string")throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${a} but got pad ${t}.`);if(typeof t=="number")P(Zl(t),()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${a} but got pad ${t}.`);else if(typeof t=="object")t.forEach(n=>{n.forEach(r=>{P(Zl(r),()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${a} but got pad ${r}.`)})});else throw Error(`Error in ${e}: Unknown padding parameter: ${t}`)}}function mE(e,t){let a={x:R(e,"x","reshape","string_or_numeric")},n={shape:t};return L.runKernel(Du,a,n)}var Q=z({reshape_:mE});function fE(e,t,a,n,r){let s=R(e,"x","avgPool","float32"),i=1;P($r(a,i),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${i}'`);let o=s,l=!1;s.rank===3&&(l=!0,o=Q(s,[1,s.shape[0],s.shape[1],s.shape[2]])),P(o.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${o.rank}.`),Mn("avgPool",n,r);let u={x:o},d={filterSize:t,strides:a,pad:n,dimRoundingMode:r},c=L.runKernel(Ui,u,d);return c=Ue(c,s.dtype),l?Q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var vg=z({avgPool_:fE});function gE(e,t,a,n,r,s="NDHWC"){let i=R(e,"x","avgPool3d","float32"),o=i,l=!1;i.rank===4&&(l=!0,o=Q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),P(o.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${o.rank}.`),P(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),P(typeof a=="number"&&a>0||Array.isArray(a)&&a[0]>0&&a[1]>0&&a[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${a}'`),Mn("avgPool3d",n,r);let u={x:o},d={filterSize:t,strides:a,pad:n,dimRoundingMode:r,dataFormat:s},c=L.runKernel(fu,u,d);return c=Ue(c,o.dtype),l?Q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var Mb=z({avgPool3d_:gE});function yE(e,t=0){P(e.length>=1,()=>"Pass at least one tensor to concat");let a=Zd(e,"tensors","concat","string_or_numeric");if(a[0].dtype==="complex64"&&a.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${s.dtype}. `)}),a.length===1)return Ia(a[0]);let n=a,r={axis:t};return L.runKernel(xu,n,r)}var lt=z({concat_:yE});function xE(e,t,a=!1,n=!1){let r=R(e,"a","matMul"),s=R(t,"b","matMul");[r,s]=Et(r,s);let i={a:r,b:s},o={transposeA:a,transposeB:n};return L.runKernel(Gi,i,o)}var pt=z({matMul_:xE});function AE(e){let t={x:R(e,"x","sigmoid","float32")};return L.runKernel(Rs,t)}var za=z({sigmoid_:AE});function bE(e,t,a){let n=R(e,"x","slice","string_or_numeric");if(n.rank===0)throw new Error("Slicing scalar is not possible");let r={x:n},s={begin:t,size:a};return L.runKernel(zu,r,s)}var _e=z({slice_:bE});function vE(e){let t={x:R(e,"x","tanh","float32")};return L.runKernel(rl,t)}var Ah=z({tanh_:vE});function wE(e,t,a,n,r,s){let i=R(e,"forgetBias","basicLSTMCell"),o=R(t,"lstmKernel","basicLSTMCell"),l=R(a,"lstmBias","basicLSTMCell"),u=R(n,"data","basicLSTMCell"),d=R(r,"c","basicLSTMCell"),c=R(s,"h","basicLSTMCell"),p=lt([u,c],1),h=pt(p,o),m=we(h,l),f=m.shape[0],g=m.shape[1]/4,y=[f,g],x=_e(m,[0,0],y),A=_e(m,[0,g],y),b=_e(m,[0,g*2],y),w=_e(m,[0,g*3],y),S=we(te(za(x),Ah(A)),te(d,za(we(i,b)))),C=te(Ah(S),za(w));return[S,C]}var Fb=z({basicLSTMCell_:wE});function kE(e,t,a){let n=R(e,"x","batchToSpaceND"),r=t.reduce((o,l)=>o*l);P(n.rank>=1+t.length,()=>`input rank is ${n.rank} but should be > than blockShape.length ${t.length}`),P(a.length===t.length,()=>`crops.length is ${a.length} but should be equal to blockShape.length ${t.length}`),P(n.shape[0]%r===0,()=>`input tensor batch is ${n.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${r}`);let s={x:n},i={blockShape:t,crops:a};return L.runKernel(gu,s,i)}var wg=z({batchToSpaceND_:kE});function IE(e){let t;return e.rank===0||e.rank===1?t=Q(e,[1,1,1,e.size]):e.rank===2?t=Q(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=Q(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function SE(e,t,a,n,r,s){s==null&&(s=.001);let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let d;n!=null&&(d=R(n,"offset","batchNorm")),P(o.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),P(d==null||o.rank===d.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),P(u==null||o.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let c={x:IE(i),scale:u,offset:d,mean:o,variance:l},p={varianceEpsilon:s},h=L.runKernel(po,c,p);return Q(h,i.shape)}var jp=z({batchNorm_:SE});function TE(e,t,a,n,r,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let d;return n!=null&&(d=R(n,"offset","batchNorm")),P(i.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${i.rank}.`),P(o.rank===2||o.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${o.rank}.`),P(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),u!=null&&P(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),d!=null&&P(d.rank===2||d.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${d.rank}.`),jp(i,o,l,d,u,s)}var $b=z({batchNorm2d_:TE});function CE(e,t,a,n,r,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let d;return n!=null&&(d=R(n,"offset","batchNorm")),P(i.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${i.rank}.`),P(o.rank===3||o.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${o.rank}.`),P(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),u!=null&&P(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),d!=null&&P(d.rank===3||d.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${d.rank}.`),jp(i,o,l,d,u,s)}var Db=z({batchNorm3d_:CE});function NE(e,t,a,n,r,s){let i=R(e,"x","batchNorm"),o=R(t,"mean","batchNorm"),l=R(a,"variance","batchNorm"),u;r!=null&&(u=R(r,"scale","batchNorm"));let d;return n!=null&&(d=R(n,"offset","batchNorm")),P(i.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${i.rank}.`),P(o.rank===4||o.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${o.rank}.`),P(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),u!=null&&P(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),d!=null&&P(d.rank===4||d.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${d.rank}.`),jp(i,o,l,d,u,s)}var Pb=z({batchNorm4d_:NE});function RE(e,t,a){let n=R(e,"x","bincount"),r=R(t,"weights","bincount");P(n.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${n.dtype}`),P(a>=0,()=>`size must be non-negative, but got ${a}.`),P(r.size===n.size||r.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${n.shape}, weights shape: ${r.shape}.`);let s={x:n,weights:r},i={size:a};return L.runKernel(Hi,s,i)}var kg=z({bincount_:RE});function EE(e,t){let a=R(e,"x","bitwiseAnd"),n=R(t,"y","bitwiseAnd");if(!Er(a.shape,n.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${a.shape}, y: ${n.shape}`);if(a.dtype!=="int32"||n.dtype!=="int32")throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${a.dtype} and type of y: ${n.dtype}`);let r={a,b:n};return L.runKernel(ji,r)}var _b=z({bitwiseAnd_:EE});function ME(e,t){let a=R(e,"s0","broadcastArgs","int32"),n=R(t,"s1","broadcastArgs","int32");if(a.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${a.rank}`);if(n.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${n.rank}`);let r={s0:a,s1:n};return L.runKernel(yu,r)}var Ob=z({broadcastArgs_:ME});function FE(e,t){let a=R(e,"broadcastTo","x"),n=a.shape;if(nn(t),t.lengtha.rank){let l=a.shape.slice();for(;l.length=0;l--)if(r[l]===t[l])s[l]=1;else if(a.shape[l]!==1)throw new Error(`broadcastTo(): [${n}] cannot be broadcast to [${t}].`);if(s.map((l,u)=>l>1?u:-1).filter(l=>l>=0).length===0)return Ia(a);let i={x:a},o={reps:s};return L.runKernel($s,i,o)}var Ai=z({broadcastTo_:FE});function $E(e){let t={x:R(e,"x","ceil","float32")};return L.runKernel(cs,t)}var zb=z({ceil_:$E});function lr(e,t,a){nn(e),a=a||fp(t);let n={shape:e,value:t,dtype:a};return L.runKernel(Iu,{},n)}function DE(e,t,a){let n=R(e,"x","clipByValue");if(P(t<=a,()=>`Error in clip: min (${t}) must be less than or equal to max (${a}).`),t===a)return lr(n.shape,t,n.dtype);let r={x:n},s={clipValueMin:t,clipValueMax:a};return L.runKernel(hs,r,s)}var Lb=z({clipByValue_:DE});function PE(e){return lt(e,0)}var Wb=z({concat1d_:PE});function _E(e,t){return lt(e,t)}var Xu=z({concat2d_:_E});function OE(e,t){return lt(e,t)}var Bb=z({concat3d_:OE});function zE(e,t){return lt(e,t)}var Vb=z({concat4d_:zE});function LE(e,t,a,n,r="NHWC",s=[1,1],i){let o=R(e,"x","conv2d","float32"),l=R(t,"filter","conv2d","float32"),u=o,d=!1;o.rank===3&&(d=!0,u=Q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),P(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),P(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),Mn("conv2d",n,i);let c=r==="NHWC"?u.shape[3]:u.shape[1];P(c===l.shape[2],()=>`Error in conv2d: depth of input (${c}) must match input depth for filter ${l.shape[2]}.`),P($r(a,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`),P(Ii(s),()=>"Error in conv2D: Dilated rates should be larger than 0."),P(Ii(a),()=>"Error in conv2D: Strides should be larger than 0.");let p={x:u,filter:l},h={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i},m=L.runKernel(Xi,p,h);return d?Q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var qp=z({conv2d_:LE});function WE(e,t,a,n,r="NWC",s=1,i){let o=R(e,"x","conv1d"),l=R(t,"filter","conv1d"),u=o,d=!1;o.rank===2&&(d=!0,u=Q(o,[1,o.shape[0],o.shape[1]])),P(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),P(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),Mn("conv1d",n,i),P(u.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`),P($r(a,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${a} and dilation '${s}'`),P(Ii(s),()=>"Error in conv1D: Dilated rates should be larger than 0."),P(Ii(a),()=>"Error in conv1D: Stride should be larger than 0."),P(r==="NWC",()=>`Error in conv1d: got dataFormat of ${r} but only NWC is currently supported.`);let c=Q(l,[1,l.shape[0],l.shape[1],l.shape[2]]),p=Q(u,[u.shape[0],1,u.shape[1],u.shape[2]]),h=qp(p,c,[1,a],n,"NHWC",[1,s],i);return d?Q(h,[h.shape[2],h.shape[3]]):Q(h,[h.shape[0],h.shape[2],h.shape[3]])}var Ub=z({conv1d_:WE});function BE(e,t,a,n,r,s="NHWC",i){P(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let o=e,l=t,u=!1;t.rank===3&&(u=!0,l=Q(t,[1,t.shape[0],t.shape[1],t.shape[2]]),o=[1,e[0],e[1],e[2]]),P(o.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${o.length}.`),P(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),P(a.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${a.rank}`);let d=s==="NHWC"?o[3]:o[1],c=s==="NHWC"?l.shape[3]:l.shape[1];P(d===a.shape[2],()=>`Error in conv2dDerInput: depth of input (${d}) must match input depth for filter ${a.shape[2]}.`),P(c===a.shape[3],()=>`Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${a.shape[3]}.`),Mn("conv2dDerInput",r,i);let p={dy:l,filter:a},h={strides:n,pad:r,dataFormat:s,dimRoundingMode:i,inputShape:o},m=L.runKernel(Ki,p,h);return u?Q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var Gb=z({conv2DBackpropInput_:BE});function VE(e,t,a,n,r,s){let i=R(e,"x","conv2dTranspose"),o=R(t,"filter","conv2dTranspose");return Gb(a,i,o,n,r,"NHWC",s)}var Hb=z({conv2dTranspose_:VE});function UE(e,t,a,n,r="NDHWC",s=[1,1,1]){let i=R(e,"x","conv3d"),o=R(t,"filter","conv3d"),l=i,u=!1;i.rank===4&&(u=!0,l=Q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),P(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),P(o.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${o.rank}.`),P(l.shape[4]===o.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${o.shape[3]}.`),P($r(a,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`),P(r==="NDHWC",()=>`Error in conv3d: got dataFormat of ${r} but only NDHWC is currently supported.`),P(Ii(s),()=>"Error in conv3D: Dilated rates should be larger than 0."),P(Ii(a),()=>"Error in conv3D: Strides should be larger than 0.");let d={x:l,filter:o},c={strides:a,pad:n,dataFormat:r,dilations:s},p=L.runKernel(Yi,d,c);return u?Q(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var jb=z({conv3d_:UE});function GE(e,t,a,n,r){P(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=Q(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],u=i.shape[4];P(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),P(i.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${i.rank}`),P(a.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${a.rank}`),P(l===a.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${a.shape[3]}.`),P(u===a.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${a.shape[4]}.`);let d={dy:i,filter:a},c={pad:r,strides:n,inputShape:s},p=L.runKernel(Zi,d,c);return o?Q(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}var HE=z({conv3DBackpropInput_:GE});function jE(e,t,a,n,r){let s=R(e,"x","conv3dTranspose"),i=R(t,"filter","conv3dTranspose");return HE(a,s,i,n,r)}var qb=z({conv3dTranspose_:jE});function qE(e){let t={x:R(e,"x","cos","float32")};return L.runKernel(Ji,t)}var Xb=z({cos_:qE});function XE(e){let t={x:R(e,"x","cosh","float32")};return L.runKernel(Qi,t)}var Kb=z({cosh_:XE});function KE(e,t=0,a=!1,n=!1){let r={x:R(e,"x","cumprod")},s={axis:t,exclusive:a,reverse:n};return L.runKernel(eo,r,s)}var Yb=z({cumprod_:KE});function YE(e,t=0,a=!1,n=!1){let r={x:R(e,"x","cumsum")},s={axis:t,exclusive:a,reverse:n};return L.runKernel(to,r,s)}var Zb=z({cumsum_:YE});function ZE(e,t,a,n=!1){let r=R(e,"x","denseBincount"),s=R(t,"weights","denseBincount");P(r.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${r.dtype}`),P(r.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${r.rank}.`),P(a>=0,()=>`size must be non-negative, but got ${a}.`),P(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:a,binaryOutput:n};return L.runKernel(bu,i,o)}var Jb=z({denseBincount_:ZE});function JE(e,t,a="NHWC"){let n=R(e,"x","depthToSpace","float32"),r=a==="NHWC"?n.shape[1]:n.shape[2],s=a==="NHWC"?n.shape[2]:n.shape[3],i=a==="NHWC"?n.shape[3]:n.shape[1];P(t>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`),P(r*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${r} and ${t} for depthToSpace with input shape - ${n.shape}`),F(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying + ${n.shape}`),P(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${s} and ${t} for depthToSpace with input shape - ${n.shape}`),F(i%(t*t)===0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${n.shape}`);let o={x:n},l={blockSize:t,dataFormat:a};return L.runKernel(Ri,o,l)}var _b=z({depthToSpace_:sE});function iE(e,t,a,n,r="NHWC",s=[1,1],i){let o=R(e,"x","depthwiseConv2d","float32"),l=R(t,"filter","depthwiseConv2d","float32"),u=o,p=!1;o.rank===3&&(p=!0,u=Q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),F(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),F(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`);let c=r==="NHWC"?u.shape[3]:u.shape[1];F(c===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${c}) must match the inChannels dimension in filter ${l.shape[2]}.`),Nn("depthwiseConv2d",n,i);let d={x:u,filter:l},h={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i},m=L.runKernel(Ei,d,h);return p?Q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var Dh=z({depthwiseConv2d_:iE});function oE(e){let t={x:R(e,"x","diag")};return L.runKernel(mu,t)}var $b=z({diag_:oE});function lE(e,t,a,n,r=[1,1],s="NHWC"){let i=R(e,"x","dilation2d"),o=R(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,u=!1;i.rank===3&&(l=Q(i,[1,i.shape[0],i.shape[1],i.shape[2]]),u=!0),F(l.shape[3]===o.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${l.shape[3]} vs ${o.shape[2]}`);let p={x:l,filter:o},c={strides:a,pad:n,dilations:r},d=L.runKernel(Mi,p,c);return u?Q(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var Fb=z({dilation2d_:lE}),el={};Ze(el,{assertAndGetBroadcastShape:()=>Ut,getBroadcastDims:()=>Db,getReductionAxes:()=>fg});function Db(e,t){let a=e.length,n=[];for(let r=0;r1&&i===1&&n.unshift(s)}return n}function fg(e,t){let a=[];for(let n=0;n1)&&a.unshift(s)}return a}function Ut(e,t){let a=Math.max(e.length,t.length),n=new Array(a);for(let r=0;r`Error in dot: inputs must all be rank 1 or 2, but got ranks ${a.rank} and ${n.rank}.`);let r=a.rank===1?a.size:a.shape[1],s=n.rank===1?n.size:n.shape[0];if(F(r===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${s}.`),a.rank===1&&n.rank===1){let i=Q(a,[1,-1]),o=Q(n,[-1,1]),l=pt(i,o);return Q(l,[])}else if(a.rank===1&&n.rank===2){let i=Q(a,[1,-1]),o=Q(n,[n.shape[0],n.shape[1]]),l=pt(i,o);return Q(l,[l.size])}else if(a.rank===2&&n.rank===1){let i=Q(n,[-1,1]),o=pt(a,i);return Q(o,[o.size])}else{let i=Q(n,[n.shape[0],n.shape[1]]);return pt(a,i)}}var zb=z({dot_:hE});function mE(e,...t){let a=t.map((r,s)=>R(r,`tensors${s}`,"einsum")),n={equation:e};return L.runKernel(fp,a,n)}var Bs=z({einsum_:mE});function fE(e){let t={x:R(e,"x","elu","float32")};return L.runKernel(_i,t)}var yg=z({elu_:fE});function gE(e,t){let a=R(e,"x","ensureShape","string_or_numeric");if(!fA(a.shape,t))throw new Error(`EnsureShape: Shape of tensor ${a.shape} is not compatible with expected shape ${t}`);return e}var Lb=z({ensureShape_:gE});function yE(e){let t=R(e,"x","erf");F(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=Ue(t,"float32"));let a={x:t};return L.runKernel($i,a)}var Wb=z({erf_:yE});function xg(e,t){for(let a=0;ae[s]);return[a,r]}function Wp(e,t){let a=t.map(n=>1);return Bb(e,a,t)}function AE(e,t,a){F(xg(t,a),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${a} input.`)}function bE(e,t){if(xg(e,t))return null;let a=[];for(let n=0;na.push(n)),a}function vE(e){return e.map((t,a)=>[a,t]).sort((t,a)=>t[1]-a[1]).map(t=>t[0])}function wE(e,t){let a=[];for(let n=t-e;n"Axis must be <= rank of the tensor");let n={input:a},r={dim:t};return L.runKernel(gu,n,r)}var Wt=z({expandDims_:PE});function _E(e){let t={x:R(e,"x","expm1")};return L.runKernel(Oi,t)}var Gb=z({expm1_:_E});function $E(e,t){let a=R(e,"x","tile","string_or_numeric");F(a.rank===t.length,()=>`Error in transpose: rank of input ${a.rank} must match length of reps ${t}.`);let n={x:a},r={reps:t};return L.runKernel(ls,n,r)}var Xr=z({tile_:$E});function FE(e,t,a,n="float32"){t==null&&(t=e);let r=$e([e,t],n),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(Ul(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=Q(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let l={x:i},u={depthRadius:t,bias:a,alpha:n,beta:r},p=L.runKernel(ro,l,u);return o?Q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var Kb=z({localResponseNormalization_:qE});function XE(e){let t={x:R(e,"x","log","float32")};return L.runKernel(Qi,t)}var Xl=z({log_:XE});function KE(e){let t={x:R(e,"x","log1p")};return L.runKernel(eo,t)}var Ig=z({log1p_:KE});function YE(e){return F(Kr(e),()=>"The f passed in grad(f) must be a function"),(t,a)=>{let n=R(t,"x","tf.grad","string_or_numeric"),r=a!=null?R(a,"dy","tf.grad"):null;return L.tidy(()=>{let{value:s,grads:i}=L.gradients(()=>e(n),[n],r);return r!=null&&Ta(s.shape,r.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),zh(i),i[0]})}}function ZE(e){return F(Kr(e),()=>"The f passed in grads(f) must be a function"),(t,a)=>{F(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let n=Vd(t,"args","tf.grads","string_or_numeric"),r=a!=null?R(a,"dy","tf.grads"):null;return L.tidy(()=>{let{value:s,grads:i}=L.gradients(()=>e(...n),n,r);return r!=null&&Ta(s.shape,r.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),zh(i),i})}}function JE(e){return F(Kr(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,a)=>{F(t instanceof gt,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),F(a==null||a instanceof gt,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:n,value:r}=L.gradients(()=>e(t),[t],a);return zh(n),{grad:n[0],value:r}}}function QE(e){return F(Kr(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,a)=>{F(Array.isArray(t)&&t.every(r=>r instanceof gt),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),F(a==null||a instanceof gt,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let n=L.gradients(()=>e(...t),t,a);return a!=null&&Ta(n.value.shape,a.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),zh(n.grads),n}}function Yb(e,t){F(Kr(e),()=>"The f passed in variableGrads(f) must be a function"),F(t==null||Array.isArray(t)&&t.every(u=>u instanceof Bd),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let a=t!=null;if(!a){t=[];for(let u in L.registeredVariables)t.push(L.registeredVariables[u])}let n=a?t.filter(u=>!u.trainable):null,r=t.length;t=t.filter(u=>u.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}=L.gradients(e,t,null,s);F(o.some(u=>u!=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((u,p)=>{o[p]!=null&&(l[u.name]=o[p])}),n!=null&&n.forEach(u=>l[u.name]=null),{value:i,grads:l}}function er(e){return L.customGrad(e)}function zh(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 eM(e){let t={x:R(e,"x","neg")};return L.runKernel(wu,t)}var Ln=z({neg_:eM});function tM(e){let t={x:R(e,"x","softplus")};return L.runKernel(Wo,t)}var Sg=z({softplus_:tM});function aM(e){let t=R(e,"x","logSigmoid");return er(a=>({value:Ln(Sg(Ln(a))),gradFunc:n=>te(n,za(Ln(a)))}))(t)}var Zb=z({logSigmoid_:aM});function nM(e,t){let a=R(e,"a","sub"),n=R(t,"b","sub");[a,n]=Rt(a,n);let r={a,b:n};return L.runKernel(qo,r)}var xe=z({sub_:nM});function rM(e,t=-1){let a=R(e,"logits","logSoftmax");if(t===-1&&(t=a.rank-1),t!==a.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${a.rank} and axis was ${t}`);return er((n,r)=>{let s=fa(n,t,!0),i=xe(n,s),o=xe(Ue(i,"float32"),Xl(ot(as(i),t,!0)));return r([o]),{value:o,gradFunc:(l,u)=>{let[p]=u,c=!0,d=as(p);return xe(l,te(ot(l,t,c),d))}}})(a)}var Jb=z({logSoftmax_:rM});function sM(e,t=null,a=!1){let n=R(e,"x","logSumExp"),r=sp(t,n.shape),s=fa(n,r,!0),i=xe(n,s),o=as(i),l=ot(o,r),u=Xl(l),p=we(Q(s,u.shape),u);if(a){let c=Wp(p.shape,r);return Q(p,c)}return p}var Cg=z({logSumExp_:sM});function iM(e,t){let a=R(e,"a","logicalAnd","bool"),n=R(t,"b","logicalAnd","bool");Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(to,r)}var jd=z({logicalAnd_:iM});function oM(e){let t={x:R(e,"x","logicalNot","bool")};return L.runKernel(ao,t)}var Tg=z({logicalNot_:oM});function lM(e,t){let a=R(e,"a","logicalOr","bool"),n=R(t,"b","logicalOr","bool");Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(no,r)}var Ng=z({logicalOr_:lM});function uM(e,t){let a=R(e,"a","logicalXor","bool"),n=R(t,"b","logicalXor","bool");return Ut(a.shape,n.shape),jd(Ng(e,t),Tg(jd(e,t)))}var Qb=z({logicalXor_:uM}),jc=2147483648;function dM(e,t,a="left"){let n=R(e,"sortedSequence","searchSorted"),r=R(t,"values","searchSorted"),s=n.shape[n.shape.length-1],i=r.shape[r.shape.length-1],o=Q(n,[-1,s]),l=Q(r,[-1,i]);if(o.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(o.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(vt(l.shape)>=jc)throw new Error(`values tensor size must less than ${jc}`);if(o.shape[1]>=jc)throw new Error(`trailing dim_size must less than ${jc} for int32 output type, was ${o.shape[1]}`);let u={sortedSequence:o,values:l},p={side:a};return L.runKernel($o,u,p)}var Lh=z({searchSorted_:dM});function e4(e,t){return Lh(e,t,"left")}function pM(e,t,a,n,r){let s=R(e,"x","maxPool"),i=1,o=s,l=!1;s.rank===3&&(l=!0,o=Q(s,[1,s.shape[0],s.shape[1],s.shape[2]])),F(o.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),F(Nr(a,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${i}'`),Nn("maxPool",n,r);let u={x:o},p={filterSize:t,strides:a,pad:n,dimRoundingMode:r},c=L.runKernel(oo,u,p);return l?Q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var Rg=z({maxPool_:pM});function cM(e,t=[1,1,1],a,n,r,s="NDHWC"){let i=R(e,"x","maxPool3d"),o=i,l=!1;i.rank===4&&(l=!0,o=Q(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}`),Nn("maxPool3d",n,r);let u={x:o},p={filterSize:t,strides:a,pad:n,dimRoundingMode:r,dataFormat:s},c=L.runKernel(bu,u,p);return l?Q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var t4=z({maxPool3d_:cM});function hM(e,t,a,n,r=!1){let s={x:R(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:a,pad:n,includeBatchInIndex:r},o=L.runKernel(vu,s,i);return{result:o[0],indexes:o[1]}}var a4=z({maxPoolWithArgmax_:hM});function mM(e,t){let a=R(e,"a","maximum"),n=R(t,"b","maximum");[a,n]=Rt(a,n),a.dtype==="bool"&&(a=Ue(a,"int32"),n=Ue(n,"int32")),Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(io,r)}var Eg=z({maximum_:mM});function fM(e,t=null,a=!1){let n={x:R(e,"x","mean")},r={axis:t,keepDims:a};return L.runKernel(lo,n,r)}var qd=z({mean_:fM});function gn(e,t="float32"){if(tn(e),t==="complex64"){let n=gn(e,"float32"),r=gn(e,"float32");return Sr(n,r)}let a=Rh(vt(e),t);return L.makeTensor(a,e,t)}function Hr(e,t="float32"){if(tn(e),t==="complex64"){let n=Hr(e,"float32"),r=gn(e,"float32");return Sr(n,r)}let a=J1(vt(e),t);return L.makeTensor(a,e,t)}function n4(e,t,{indexing:a="xy"}={}){if(a!=="xy"&&a!=="ij")throw new TypeError(`${a} is not a valid third argument to meshgrid`);if(e===void 0)return[];let n=R(e,"x","meshgrid",e instanceof gt?e.dtype:"float32");if(t===void 0)return[n];let r=R(t,"y","meshgrid",t instanceof gt?t.dtype:"float32"),s=vt(n.shape),i=vt(r.shape);return a==="xy"?(n=Q(n,[1,-1]),r=Q(r,[-1,1]),[pt(Hr([i,1],n.dtype),n),pt(r,Hr([1,s],r.dtype))]):(n=Q(n,[-1,1]),r=Q(r,[1,-1]),[pt(n,Hr([1,i],n.dtype)),pt(Hr([s,1],r.dtype),r)])}function gM(e,t){let a=R(e,"a","minimum"),n=R(t,"b","minimum");[a,n]=Rt(a,n),a.dtype==="bool"&&(a=Ue(a,"int32"),n=Ue(n,"int32")),Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(po,r)}var Xd=z({minimum_:gM});function yM(e,t,a){F(a==="reflect"||a==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${a}.`);let n=R(e,"x","mirrorPad");if(n.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");F(t.length===n.rank,()=>`Padding doesn't match input. Must be ${n.rank}. Got ${t.length}.`);let r=a==="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]<=n.shape[o]-r&&t[o][1]>=0&&t[o][1]<=n.shape[o]-r,()=>`Padding in dimension ${o} cannot be greater than or equal to ${n.shape[o]-r} or less than 0 for input of shape ${n.shape}`);let s={paddings:t,mode:a},i={x:n};return L.runKernel(co,i,s)}var r4=z({mirrorPad_:yM});function xM(e,t){let a=R(e,"a","mod"),n=R(t,"b","mod");[a,n]=Rt(a,n);let r={a,b:n};return L.runKernel(ho,r)}var Bu=z({mod_:xM});function AM(e,t=null,a=!1){e=R(e,"x","moments");let n=sp(t,e.shape),r=qd(e,n,a),s=r.shape;a||(s=Wp(r.shape,n));let i=Tn(xe(Ue(e,"float32"),Q(r,s))),o=qd(i,n,a);return{mean:r,variance:o}}var s4=z({moments_:AM});function bM(e,t,a,n){let r=R(t,"data","multiRNNCell"),s=Vd(a,"c","multiRNNCell"),i=Vd(n,"h","multiRNNCell"),o=r,l=[];for(let c=0;c2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);a=a||Math.random();let o={logits:i===1?Q(r,[1,-1]):r},l={numSamples:t,seed:a,normalized:n},u=L.runKernel(mo,o,l);return i===1?Q(u,[u.size]):u}var o4=z({multinomial_:vM});function wM(e,t){let a=R(e,"a","notEqual","string_or_numeric"),n=R(t,"b","notEqual","string_or_numeric");[a,n]=Rt(a,n),Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(go,r)}var Mg=z({notEqual_:wM});function kM(e,t,a=1,n=0,r="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let s={indices:R(e,"indices","oneHot","int32")},i={dtype:r,depth:t,onValue:a,offValue:n};return L.runKernel(Ao,s,i)}var mh=z({oneHot_:kM});function IM(e){let t={x:R(e,"x","onesLike")};return L.runKernel(Iu,t)}var l4=z({onesLike_:IM});function SM(e,t){let a=R(e,"v1","outerProduct"),n=R(t,"v2","outerProduct");F(a.rank===1&&n.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${a.rank} and ${n.rank}.`);let r=Q(a,[-1,1]),s=Q(n,[1,-1]);return pt(r,s)}var u4=z({outerProduct_:SM});function CM(e,t,a=0){let n=R(e,"x","pad");if(n.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let r={paddings:t,constantValue:a},s={x:n};return L.runKernel(bo,s,r)}var ir=z({pad_:CM});function TM(e,t,a=0){return F(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),ir(e,[t],a)}var d4=z({pad1d_:TM});function NM(e,t,a=0){return F(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ir(e,t,a)}var p4=z({pad2d_:NM});function RM(e,t,a=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."),ir(e,t,a)}var c4=z({pad3d_:RM});function EM(e,t,a=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."),ir(e,t,a)}var h4=z({pad4d_:EM});function MM(e,t,a){let n=R(e,"x","spaceToBatchND");F(n.rank>=1+t.length,()=>`input rank ${n.rank} should be > than [blockShape] ${t.length}`),F(a.length===t.length,()=>`paddings.shape[0] ${a.length} must be equal to [blockShape] ${t.length}`),F(n.shape.reduce((i,o,l)=>l>0&&l<=t.length?i&&(o+a[l-1][0]+a[l-1][1])%t[l-1]===0:i,!0),()=>`input spatial dimensions ${n.shape.slice(1)} with paddings ${a.toString()} must be divisible by blockShapes ${t.toString()}`);let r={x:n},s={blockShape:t,paddings:a};return L.runKernel(Pu,r,s)}var Pg=z({spaceToBatchND_:MM});function PM(e,t,a,n,r,s,i){r==null&&(r=[1,1]),s==null&&(s=1),n===0&&(n="valid");let o=R(e,"x","maxPool"),l=o,u=!1;o.rank===3&&(u=!0,l=Q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),F(Nr(s,r),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${r}'`);let p=lb(l.shape,t,s,r,n),c=[p.dilationHeight,p.dilationWidth],d;n==="same"?d=$M([p.filterHeight,p.filterWidth],c):d=[[0,0],[0,0]];let h=c[0]===1&&c[1]===1,[m,f]=_M([p.inHeight,p.inWidth],c,d),g=h?n:"valid",y=h?l:Pg(l,c,m),x=(a==="avg"?()=>cg(y,t,s,g,i):()=>Rg(y,t,s,g,i))(),A=h?x:hg(x,c,f);return u?Q(A,[A.shape[1],A.shape[2],A.shape[3]]):A}function _M(e,t,a){let n=a.map(p=>p[0]),r=a.map(p=>p[1]),s=e.concat(n,r),i=t.map((p,c)=>(p-s[c]%p)%p),o=r.map((p,c)=>p+i[c]),l=t.map((p,c)=>[n[c],o[c]]),u=t.map((p,c)=>[0,i[c]]);return[l,u]}function $M(e,t){let a=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),n=a.map(s=>Math.floor(s/2)),r=a.map((s,i)=>s-n[i]);return a.map((s,i)=>[n[i],r[i]])}var m4=z({pool_:PM});function FM(e,t){let a=R(e,"x","prelu"),n=R(t,"alpha","prelu"),r={x:a,alpha:n};return L.runKernel(wo,r)}var _g=z({prelu_:FM});function DM(e,t=null,a=!1){let n=R(e,"x","prod");n.dtype==="bool"&&(n=Ue(n,"int32"));let r={x:n},s={axis:t,keepDims:a};return L.runKernel(ko,r,s)}var f4=z({prod_:DM});function OM(e,t,a,n){let r=e.map((p,c)=>R(p,`tensors${c}`,"raggedGather","int32")),s=R(t,"paramsDenseValues","raggedGather"),i=R(a,"indices","raggedGather","int32"),o={paramsNestedSplits:r,paramsDenseValues:s,indices:i},l={outputRaggedRank:n},u=L.runKernel(Mh,o,l);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}var g4=z({raggedGather_:OM});function zM(e,t,a){let n=R(e,"starts","raggedRange"),r=R(t,"limits","raggedRange",n.dtype),s=R(a,"deltas","raggedRange",n.dtype),i={starts:n,limits:r,deltas:s},o=L.runKernel(Ph,i);return{rtNestedSplits:o[0],rtDenseValues:o[1]}}var y4=z({raggedRange_:zM});function LM(e,t,a,n,r){let s=R(e,"shape","raggedTensorToTensor","int32"),i=R(t,"values","raggedTensorToTensor"),o=R(a,"defaultValue","raggedTensorToTensor",i.dtype),l=n.map((c,d)=>R(c,`tensors${d}`,"raggedTensorToTensor","int32")),u={shape:s,values:i,defaultValue:o,rowPartitionTensors:l},p={rowPartitionTypes:r};return L.runKernel(_h,u,p)}var x4=z({raggedTensorToTensor_:LM});function WM(e,t,a){tn(e);let n=vt(e),r=null;if(a==null||a==="float32")r=new Float32Array(n);else if(a==="int32")r=new Int32Array(n);else if(a==="bool")r=new Uint8Array(n);else throw new Error(`Unknown data type ${a}`);for(let s=0;sv4,createVideoElement:()=>XM,encodeStrings:()=>w4,expectArrayBuffersEqual:()=>qM,expectArraysClose:()=>VM,expectArraysEqual:()=>GM,expectNumbersClose:()=>HM,expectPromiseToFail:()=>UM,expectValuesInRange:()=>jM,play:()=>KM,testEpsilon:()=>Fg});var BM=.001,v4=.1;function VM(e,t,a){return a==null&&(a=Fg()),m1(e,t,(n,r)=>Dg(n,r,a))}function Fg(){return L.backend.floatPrecision()===32?BM:v4}function m1(e,t,a){let n=!0;if((Jt(e)||Jt(t))&&(n=!1),Jt(e)&&Jt(t)&&(n=!0),n){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=Jn(e),o=Jn(t);if(!Cr(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let r=Jt(e)?e:Qr(e),s=Jt(t)?t:Qr(t);if(r.length!==s.length)throw new Error(`Arrays have different lengths actual: ${r.length} vs expected: ${s.length}. + ${n.shape}`),P(i%(t*t)===0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${i} for depthToSpace with input shape ${n.shape}`);let o={x:n},l={blockSize:t,dataFormat:a};return L.runKernel(no,o,l)}var Qb=z({depthToSpace_:JE});function QE(e,t,a,n,r="NHWC",s=[1,1],i){let o=R(e,"x","depthwiseConv2d","float32"),l=R(t,"filter","depthwiseConv2d","float32"),u=o,d=!1;o.rank===3&&(d=!0,u=Q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),P(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),P(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`);let c=r==="NHWC"?u.shape[3]:u.shape[1];P(c===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${c}) must match the inChannels dimension in filter ${l.shape[2]}.`),Mn("depthwiseConv2d",n,i);let p={x:u,filter:l},h={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i},m=L.runKernel(ro,p,h);return d?Q(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var Gh=z({depthwiseConv2d_:QE});function eM(e){let t={x:R(e,"x","diag")};return L.runKernel(vu,t)}var e4=z({diag_:eM});function tM(e,t,a,n,r=[1,1],s="NHWC"){let i=R(e,"x","dilation2d"),o=R(t,"filter","dilation2d");P(i.rank===3||i.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${i.rank}.`),P(o.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${o.rank}.`),P(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let l=i,u=!1;i.rank===3&&(l=Q(i,[1,i.shape[0],i.shape[1],i.shape[2]]),u=!0),P(l.shape[3]===o.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${l.shape[3]} vs ${o.shape[2]}`);let d={x:l,filter:o},c={strides:a,pad:n,dilations:r},p=L.runKernel(so,d,c);return u?Q(p,[p.shape[1],p.shape[2],p.shape[3]]):p}var t4=z({dilation2d_:tM}),ul={};Ke(ul,{assertAndGetBroadcastShape:()=>Ut,getBroadcastDims:()=>a4,getReductionAxes:()=>Ig});function a4(e,t){let a=e.length,n=[];for(let r=0;r1&&i===1&&n.unshift(s)}return n}function Ig(e,t){let a=[];for(let n=0;n1)&&a.unshift(s)}return a}function Ut(e,t){let a=Math.max(e.length,t.length),n=new Array(a);for(let r=0;r`Error in dot: inputs must all be rank 1 or 2, but got ranks ${a.rank} and ${n.rank}.`);let r=a.rank===1?a.size:a.shape[1],s=n.rank===1?n.size:n.shape[0];if(P(r===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${r} and ${s}.`),a.rank===1&&n.rank===1){let i=Q(a,[1,-1]),o=Q(n,[-1,1]),l=pt(i,o);return Q(l,[])}else if(a.rank===1&&n.rank===2){let i=Q(a,[1,-1]),o=Q(n,[n.shape[0],n.shape[1]]),l=pt(i,o);return Q(l,[l.size])}else if(a.rank===2&&n.rank===1){let i=Q(n,[-1,1]),o=pt(a,i);return Q(o,[o.size])}else{let i=Q(n,[n.shape[0],n.shape[1]]);return pt(a,i)}}var r4=z({dot_:iM});function oM(e,...t){let a=t.map((r,s)=>R(r,`tensors${s}`,"einsum")),n={equation:e};return L.runKernel(Ip,a,n)}var hi=z({einsum_:oM});function lM(e){let t={x:R(e,"x","elu","float32")};return L.runKernel(oo,t)}var Tg=z({elu_:lM});function uM(e,t){let a=R(e,"x","ensureShape","string_or_numeric");if(!DA(a.shape,t))throw new Error(`EnsureShape: Shape of tensor ${a.shape} is not compatible with expected shape ${t}`);return e}var s4=z({ensureShape_:uM});function dM(e){let t=R(e,"x","erf");P(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=Ue(t,"float32"));let a={x:t};return L.runKernel(lo,a)}var i4=z({erf_:dM});function Cg(e,t){for(let a=0;ae[s]);return[a,r]}function Xp(e,t){let a=t.map(n=>1);return o4(e,a,t)}function cM(e,t,a){P(Cg(t,a),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${a} input.`)}function hM(e,t){if(Cg(e,t))return null;let a=[];for(let n=0;na.push(n)),a}function mM(e){return e.map((t,a)=>[a,t]).sort((t,a)=>t[1]-a[1]).map(t=>t[0])}function fM(e,t){let a=[];for(let n=t-e;n"Axis must be <= rank of the tensor");let n={input:a},r={dim:t};return L.runKernel(ku,n,r)}var Bt=z({expandDims_:SM});function TM(e){let t={x:R(e,"x","expm1")};return L.runKernel(gs,t)}var d4=z({expm1_:TM});function CM(e,t){let a=R(e,"x","tile","string_or_numeric");P(a.rank===t.length,()=>`Error in transpose: rank of input ${a.rank} must match length of reps ${t}.`);let n={x:a},r={reps:t};return L.runKernel($s,n,r)}var Qr=z({tile_:CM});function NM(e,t,a,n="float32"){t==null&&(t=e);let r=Te([e,t],n),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}.`),P(Zl(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let i=s,o=!1;s.rank===3&&(o=!0,i=Q(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let l={x:i},u={depthRadius:t,bias:a,alpha:n,beta:r},d=L.runKernel(ko,l,u);return o?Q(d,[d.shape[1],d.shape[2],d.shape[3]]):d}var f4=z({localResponseNormalization_:WM});function BM(e){let t={x:R(e,"x","log","float32")};return L.runKernel(ks,t)}var au=z({log_:BM});function VM(e){let t={x:R(e,"x","log1p")};return L.runKernel(Ao,t)}var $g=z({log1p_:VM});function UM(e){return P(es(e),()=>"The f passed in grad(f) must be a function"),(t,a)=>{let n=R(t,"x","tf.grad","string_or_numeric"),r=a!=null?R(a,"dy","tf.grad"):null;return L.tidy(()=>{let{value:s,grads:i}=L.gradients(()=>e(n),[n],r);return r!=null&&Ca(s.shape,r.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),jh(i),i[0]})}}function GM(e){return P(es(e),()=>"The f passed in grads(f) must be a function"),(t,a)=>{P(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let n=Zd(t,"args","tf.grads","string_or_numeric"),r=a!=null?R(a,"dy","tf.grads"):null;return L.tidy(()=>{let{value:s,grads:i}=L.gradients(()=>e(...n),n,r);return r!=null&&Ca(s.shape,r.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),jh(i),i})}}function HM(e){return P(es(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,a)=>{P(t instanceof yt,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),P(a==null||a instanceof yt,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:n,value:r}=L.gradients(()=>e(t),[t],a);return jh(n),{grad:n[0],value:r}}}function jM(e){return P(es(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,a)=>{P(Array.isArray(t)&&t.every(r=>r instanceof yt),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),P(a==null||a instanceof yt,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let n=L.gradients(()=>e(...t),t,a);return a!=null&&Ca(n.value.shape,a.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),jh(n.grads),n}}function g4(e,t){P(es(e),()=>"The f passed in variableGrads(f) must be a function"),P(t==null||Array.isArray(t)&&t.every(u=>u instanceof Yd),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let a=t!=null;if(!a){t=[];for(let u in L.registeredVariables)t.push(L.registeredVariables[u])}let n=a?t.filter(u=>!u.trainable):null,r=t.length;t=t.filter(u=>u.trainable),P(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}=L.gradients(e,t,null,s);P(o.some(u=>u!=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()."),P(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((u,d)=>{o[d]!=null&&(l[u.name]=o[d])}),n!=null&&n.forEach(u=>l[u.name]=null),{value:i,grads:l}}function rr(e){return L.customGrad(e)}function jh(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 qM(e){let t={x:R(e,"x","neg")};return L.runKernel(Ru,t)}var Vn=z({neg_:qM});function XM(e){let t={x:R(e,"x","softplus")};return L.runKernel(Jo,t)}var Dg=z({softplus_:XM});function KM(e){let t=R(e,"x","logSigmoid");return rr(a=>({value:Vn(Dg(Vn(a))),gradFunc:n=>te(n,za(Vn(a)))}))(t)}var y4=z({logSigmoid_:KM});function YM(e,t){let a=R(e,"a","sub"),n=R(t,"b","sub");[a,n]=Et(a,n);let r={a,b:n};return L.runKernel(Fs,r)}var xe=z({sub_:YM});function ZM(e,t=-1){let a=R(e,"logits","logSoftmax");if(t===-1&&(t=a.rank-1),t!==a.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${a.rank} and axis was ${t}`);return rr((n,r)=>{let s=fa(n,t,!0),i=xe(n,s),o=xe(Ue(i,"float32"),au(ot(ls(i),t,!0)));return r([o]),{value:o,gradFunc:(l,u)=>{let[d]=u,c=!0,p=ls(d);return xe(l,te(ot(l,t,c),p))}}})(a)}var x4=z({logSoftmax_:ZM});function JM(e,t=null,a=!1){let n=R(e,"x","logSumExp"),r=mp(t,n.shape),s=fa(n,r,!0),i=xe(n,s),o=ls(i),l=ot(o,r),u=au(l),d=we(Q(s,u.shape),u);if(a){let c=Xp(d.shape,r);return Q(d,c)}return d}var Pg=z({logSumExp_:JM});function QM(e,t){let a=R(e,"a","logicalAnd","bool"),n=R(t,"b","logicalAnd","bool");Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(bo,r)}var tp=z({logicalAnd_:QM});function eF(e){let t={x:R(e,"x","logicalNot","bool")};return L.runKernel(vo,t)}var _g=z({logicalNot_:eF});function tF(e,t){let a=R(e,"a","logicalOr","bool"),n=R(t,"b","logicalOr","bool");Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(wo,r)}var Og=z({logicalOr_:tF});function aF(e,t){let a=R(e,"a","logicalXor","bool"),n=R(t,"b","logicalXor","bool");return Ut(a.shape,n.shape),tp(Og(e,t),_g(tp(e,t)))}var A4=z({logicalXor_:aF}),eh=2147483648;function nF(e,t,a="left"){let n=R(e,"sortedSequence","searchSorted"),r=R(t,"values","searchSorted"),s=n.shape[n.shape.length-1],i=r.shape[r.shape.length-1],o=Q(n,[-1,s]),l=Q(r,[-1,i]);if(o.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(o.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(mt(l.shape)>=eh)throw new Error(`values tensor size must less than ${eh}`);if(o.shape[1]>=eh)throw new Error(`trailing dim_size must less than ${eh} for int32 output type, was ${o.shape[1]}`);let u={sortedSequence:o,values:l},d={side:a};return L.runKernel(qo,u,d)}var qh=z({searchSorted_:nF});function b4(e,t){return qh(e,t,"left")}function rF(e,t,a,n,r){let s=R(e,"x","maxPool"),i=1,o=s,l=!1;s.rank===3&&(l=!0,o=Q(s,[1,s.shape[0],s.shape[1],s.shape[2]])),P(o.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${o.rank}.`),P($r(a,i),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${i}'`),Mn("maxPool",n,r);let u={x:o},d={filterSize:t,strides:a,pad:n,dimRoundingMode:r},c=L.runKernel(So,u,d);return l?Q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var zg=z({maxPool_:rF});function sF(e,t=[1,1,1],a,n,r,s="NDHWC"){let i=R(e,"x","maxPool3d"),o=i,l=!1;i.rank===4&&(l=!0,o=Q(i,[1,i.shape[0],i.shape[1],i.shape[2],i.shape[3]])),P(o.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${o.rank}.`),P(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),Mn("maxPool3d",n,r);let u={x:o},d={filterSize:t,strides:a,pad:n,dimRoundingMode:r,dataFormat:s},c=L.runKernel(Cu,u,d);return l?Q(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var v4=z({maxPool3d_:sF});function iF(e,t,a,n,r=!1){let s={x:R(e,"x","maxPoolWithArgmax")},i={filterSize:t,strides:a,pad:n,includeBatchInIndex:r},o=L.runKernel(Nu,s,i);return{result:o[0],indexes:o[1]}}var w4=z({maxPoolWithArgmax_:iF});function oF(e,t){let a=R(e,"a","maximum"),n=R(t,"b","maximum");[a,n]=Et(a,n),a.dtype==="bool"&&(a=Ue(a,"int32"),n=Ue(n,"int32")),Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(Is,r)}var Lg=z({maximum_:oF});function lF(e,t=null,a=!1){let n={x:R(e,"x","mean")},r={axis:t,keepDims:a};return L.runKernel(To,n,r)}var ap=z({mean_:lF});function An(e,t="float32"){if(nn(e),t==="complex64"){let n=An(e,"float32"),r=An(e,"float32");return Rr(n,r)}let a=Oh(mt(e),t);return L.makeTensor(a,e,t)}function Yr(e,t="float32"){if(nn(e),t==="complex64"){let n=Yr(e,"float32"),r=An(e,"float32");return Rr(n,r)}let a=og(mt(e),t);return L.makeTensor(a,e,t)}function k4(e,t,{indexing:a="xy"}={}){if(a!=="xy"&&a!=="ij")throw new TypeError(`${a} is not a valid third argument to meshgrid`);if(e===void 0)return[];let n=R(e,"x","meshgrid",e instanceof yt?e.dtype:"float32");if(t===void 0)return[n];let r=R(t,"y","meshgrid",t instanceof yt?t.dtype:"float32"),s=mt(n.shape),i=mt(r.shape);return a==="xy"?(n=Q(n,[1,-1]),r=Q(r,[-1,1]),[pt(Yr([i,1],n.dtype),n),pt(r,Yr([1,s],r.dtype))]):(n=Q(n,[-1,1]),r=Q(r,[1,-1]),[pt(n,Yr([1,i],n.dtype)),pt(Yr([s,1],r.dtype),r)])}function uF(e,t){let a=R(e,"a","minimum"),n=R(t,"b","minimum");[a,n]=Et(a,n),a.dtype==="bool"&&(a=Ue(a,"int32"),n=Ue(n,"int32")),Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(Ss,r)}var np=z({minimum_:uF});function dF(e,t,a){P(a==="reflect"||a==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${a}.`);let n=R(e,"x","mirrorPad");if(n.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");P(t.length===n.rank,()=>`Padding doesn't match input. Must be ${n.rank}. Got ${t.length}.`);let r=a==="reflect"?1:0;for(let o=0;o"Invalid number of paddings. Must be length of 2 each."),P(t[o][0]>=0&&t[o][0]<=n.shape[o]-r&&t[o][1]>=0&&t[o][1]<=n.shape[o]-r,()=>`Padding in dimension ${o} cannot be greater than or equal to ${n.shape[o]-r} or less than 0 for input of shape ${n.shape}`);let s={paddings:t,mode:a},i={x:n};return L.runKernel(No,i,s)}var I4=z({mirrorPad_:dF});function pF(e,t){let a=R(e,"a","mod"),n=R(t,"b","mod");[a,n]=Et(a,n);let r={a,b:n};return L.runKernel(Ro,r)}var Ku=z({mod_:pF});function cF(e,t=null,a=!1){e=R(e,"x","moments");let n=mp(t,e.shape),r=ap(e,n,a),s=r.shape;a||(s=Xp(r.shape,n));let i=En(xe(Ue(e,"float32"),Q(r,s))),o=ap(i,n,a);return{mean:r,variance:o}}var S4=z({moments_:cF});function hF(e,t,a,n){let r=R(t,"data","multiRNNCell"),s=Zd(a,"c","multiRNNCell"),i=Zd(n,"h","multiRNNCell"),o=r,l=[];for(let c=0;c2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${i}`);a=a||Math.random();let o={logits:i===1?Q(r,[1,-1]):r},l={numSamples:t,seed:a,normalized:n},u=L.runKernel(Eo,o,l);return i===1?Q(u,[u.size]):u}var C4=z({multinomial_:mF});function fF(e,t){let a=R(e,"a","notEqual","string_or_numeric"),n=R(t,"b","notEqual","string_or_numeric");[a,n]=Et(a,n),Ut(a.shape,n.shape);let r={a,b:n};return L.runKernel(Cs,r)}var Wg=z({notEqual_:fF});function gF(e,t,a=1,n=0,r="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let s={indices:R(e,"indices","oneHot","int32")},i={dtype:r,depth:t,onValue:a,offValue:n};return L.runKernel($o,s,i)}var vh=z({oneHot_:gF});function yF(e){let t={x:R(e,"x","onesLike")};return L.runKernel(Mu,t)}var N4=z({onesLike_:yF});function xF(e,t){let a=R(e,"v1","outerProduct"),n=R(t,"v2","outerProduct");P(a.rank===1&&n.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${a.rank} and ${n.rank}.`);let r=Q(a,[-1,1]),s=Q(n,[1,-1]);return pt(r,s)}var R4=z({outerProduct_:xF});function AF(e,t,a=0){let n=R(e,"x","pad");if(n.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let r={paddings:t,constantValue:a},s={x:n};return L.runKernel(Do,s,r)}var ur=z({pad_:AF});function bF(e,t,a=0){return P(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),ur(e,[t],a)}var E4=z({pad1d_:bF});function vF(e,t,a=0){return P(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ur(e,t,a)}var M4=z({pad2d_:vF});function wF(e,t,a=0){return P(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."),ur(e,t,a)}var F4=z({pad3d_:wF});function kF(e,t,a=0){return P(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."),ur(e,t,a)}var $4=z({pad4d_:kF});function IF(e,t,a){let n=R(e,"x","spaceToBatchND");P(n.rank>=1+t.length,()=>`input rank ${n.rank} should be > than [blockShape] ${t.length}`),P(a.length===t.length,()=>`paddings.shape[0] ${a.length} must be equal to [blockShape] ${t.length}`),P(n.shape.reduce((i,o,l)=>l>0&&l<=t.length?i&&(o+a[l-1][0]+a[l-1][1])%t[l-1]===0:i,!0),()=>`input spatial dimensions ${n.shape.slice(1)} with paddings ${a.toString()} must be divisible by blockShapes ${t.toString()}`);let r={x:n},s={blockShape:t,paddings:a};return L.runKernel(Lu,r,s)}var Bg=z({spaceToBatchND_:IF});function SF(e,t,a,n,r,s,i){r==null&&(r=[1,1]),s==null&&(s=1),n===0&&(n="valid");let o=R(e,"x","maxPool"),l=o,u=!1;o.rank===3&&(u=!0,l=Q(o,[1,o.shape[0],o.shape[1],o.shape[2]])),P($r(s,r),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${r}'`);let d=Nb(l.shape,t,s,r,n),c=[d.dilationHeight,d.dilationWidth],p;n==="same"?p=CF([d.filterHeight,d.filterWidth],c):p=[[0,0],[0,0]];let h=c[0]===1&&c[1]===1,[m,f]=TF([d.inHeight,d.inWidth],c,p),g=h?n:"valid",y=h?l:Bg(l,c,m),x=(a==="avg"?()=>vg(y,t,s,g,i):()=>zg(y,t,s,g,i))(),A=h?x:wg(x,c,f);return u?Q(A,[A.shape[1],A.shape[2],A.shape[3]]):A}function TF(e,t,a){let n=a.map(d=>d[0]),r=a.map(d=>d[1]),s=e.concat(n,r),i=t.map((d,c)=>(d-s[c]%d)%d),o=r.map((d,c)=>d+i[c]),l=t.map((d,c)=>[n[c],o[c]]),u=t.map((d,c)=>[0,i[c]]);return[l,u]}function CF(e,t){let a=e.map((s,i)=>s+(s-1)*(t[i]-1)).map(s=>s-1),n=a.map(s=>Math.floor(s/2)),r=a.map((s,i)=>s-n[i]);return a.map((s,i)=>[n[i],r[i]])}var D4=z({pool_:SF});function NF(e,t){let a=R(e,"x","prelu"),n=R(t,"alpha","prelu"),r={x:a,alpha:n};return L.runKernel(_o,r)}var Vg=z({prelu_:NF});function RF(e,t=null,a=!1){let n=R(e,"x","prod");n.dtype==="bool"&&(n=Ue(n,"int32"));let r={x:n},s={axis:t,keepDims:a};return L.runKernel(Oo,r,s)}var P4=z({prod_:RF});function EF(e,t,a,n){let r=e.map((d,c)=>R(d,`tensors${c}`,"raggedGather","int32")),s=R(t,"paramsDenseValues","raggedGather"),i=R(a,"indices","raggedGather","int32"),o={paramsNestedSplits:r,paramsDenseValues:s,indices:i},l={outputRaggedRank:n},u=L.runKernel(Lh,o,l);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}var _4=z({raggedGather_:EF});function MF(e,t,a){let n=R(e,"starts","raggedRange"),r=R(t,"limits","raggedRange",n.dtype),s=R(a,"deltas","raggedRange",n.dtype),i={starts:n,limits:r,deltas:s},o=L.runKernel(Wh,i);return{rtNestedSplits:o[0],rtDenseValues:o[1]}}var O4=z({raggedRange_:MF});function FF(e,t,a,n,r){let s=R(e,"shape","raggedTensorToTensor","int32"),i=R(t,"values","raggedTensorToTensor"),o=R(a,"defaultValue","raggedTensorToTensor",i.dtype),l=n.map((c,p)=>R(c,`tensors${p}`,"raggedTensorToTensor","int32")),u={shape:s,values:i,defaultValue:o,rowPartitionTensors:l},d={rowPartitionTypes:r};return L.runKernel(Bh,u,d)}var z4=z({raggedTensorToTensor_:FF});function $F(e,t,a){nn(e);let n=mt(e),r=null;if(a==null||a==="float32")r=new Float32Array(n);else if(a==="int32")r=new Int32Array(n);else if(a==="bool")r=new Uint8Array(n);else throw new Error(`Unknown data type ${a}`);for(let s=0;sB4,createVideoElement:()=>BF,encodeStrings:()=>V4,expectArrayBuffersEqual:()=>WF,expectArraysClose:()=>PF,expectArraysEqual:()=>OF,expectNumbersClose:()=>zF,expectPromiseToFail:()=>_F,expectValuesInRange:()=>LF,play:()=>VF,testEpsilon:()=>Gg});var DF=.001,B4=.1;function PF(e,t,a){return a==null&&(a=Gg()),v1(e,t,(n,r)=>Hg(n,r,a))}function Gg(){return L.backend.floatPrecision()===32?DF:B4}function v1(e,t,a){let n=!0;if((Jt(e)||Jt(t))&&(n=!1),Jt(e)&&Jt(t)&&(n=!0),n){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=ar(e),o=ar(t);if(!Er(i,o))throw new Error(`Arrays have different shapes. Actual: [${i}]. Expected: [${o}]`)}let r=Jt(e)?e:rs(e),s=Jt(t)?t:rs(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()),typeof expect!="undefined"&&expect().nothing()}function GM(e,t){let a=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return Ur(e)||Ur(e[0])||Ur(t)||Ur(t[0])?m1(e,a,(n,r)=>n==r):m1(e,t,(n,r)=>Dg(n,r,0))}function HM(e,t,a){if(a==null&&(a=Fg()),!Dg(e,t,a))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`);typeof expect!="undefined"&&expect().nothing()}function Dg(e,t,a){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>a)}function jM(e,t,a){for(let n=0;na)throw new Error(`Value out of range:${e[n]} low: ${t}, high: ${a}`)}function qM(e,t){let a=new Float32Array(e),n=new Float32Array(t);if(a.length!==n.length)throw new Error(`Expected ArrayBuffer to be of length ${n.length}, but it was ${a.length}`);for(let r=0;r{t.addEventListener("loadeddata",n=>a(t)),t.load()})}async function KM(e){await e.play(),"requestVideoFrameCallback"in e&&await new Promise(t=>{e.requestVideoFrameCallback(t)})}var Og=class{constructor(e,t,a,n,r){this.mean=e,this.stdDev=t,this.dtype=a,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);let s=r||Math.random();this.random=$g.alea(s.toString())}nextValue(){if(!isNaN(this.nextVal)){let n=this.nextVal;return this.nextVal=NaN,n}let e,t,a=!1;for(;!a;){let n,r,s;do n=2*this.random()-1,r=2*this.random()-1,s=n*n+r*r;while(s>=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*n*i,t=this.mean+this.stdDev*r*i,(!this.truncated||this.isValidTruncated(e))&&(a=!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}},YM=class{constructor(e,t,a,n){this.alpha=e,this.beta=1/t,this.dtype=a;let r=n||Math.random();this.randu=$g.alea(r.toString()),this.randn=new Og(0,1,a,!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,a,n,r,s;for(;;){do n=this.randn.nextValue(),s=1+this.c*n;while(s<=0);if(s*=s*s,e=n*n,t=1-.331*e*e,a=.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=a,n==null&&(n=Math.random()),typeof n=="number"&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=$g.alea(n)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function JM(e,t,a=1,n="float32",r){if(tn(e),a==null&&(a=1),n==null&&(n="float32"),n!=="float32"&&n!=="int32")throw new Error(`Unsupported data type ${n}`);let s=new YM(t,a,n,r),i=$e(e,n);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),ns(t,0)}var T4=z({reverse1d_:lP});function uP(e,t){let a=R(e,"x","reverse");return F(a.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${a.rank}.`),ns(a,t)}var N4=z({reverse2d_:uP});function dP(e,t){let a=R(e,"x","reverse");return F(a.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${a.rank}.`),ns(a,t)}var R4=z({reverse3d_:dP});function pP(e,t){let a=R(e,"x","reverse");return F(a.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${a.rank}.`),ns(a,t)}var E4=z({reverse4d_:pP});function cP(e){let t={x:R(e,"x","round")};return L.runKernel(Eo,t)}var Wg=z({round_:cP});function hP(e){let t={x:R(e,"x","rsqrt","float32")};return L.runKernel(Mo,t)}var M4=z({rsqrt_:hP});function mP(e){let t={x:R(e,"x","selu")};return L.runKernel(Fo,t)}var P4=z({selu_:mP});function fP(e,t,a,n,r,s=[1,1],i="NHWC"){let o=R(e,"x","separableConv2d"),l=R(t,"depthwiseFilter","separableConv2d"),u=R(a,"pointwiseFilter","separableConv2d"),p=o,c=!1;if(o.rank===3&&(c=!0,p=Q(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(p.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${p.rank}.`),F(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),F(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),F(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),F(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);let d=l.shape[2],h=l.shape[3];F(u.shape[2]===d*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${d*h}, but got ${u.shape[2]}.`);let m=Dh(p,l,n,r,i,s),f=Lp(m,u,1,"valid",i);return c?Q(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var _4=z({separableConv2d_:fP});async function gP(e,t){let a=R(e,"x","setdiff1d"),n=R(t,"y","setdiff1d");F(a.dtype===n.dtype,()=>`x and y should have the same dtype, but got x (${a.dtype}) and y (${n.dtype}).`),F(a.rank===1,()=>`x should be 1D tensor, but got x (${a.shape}).`),F(n.rank===1,()=>`y should be 1D tensor, but got y (${n.shape}).`);let r=await a.data(),s=await n.data(),i=new Set(s),o=0;for(let p=0;p`slice1d expects a rank-1 tensor, but got a rank-${n.rank} tensor`),Fe(n,[t],[a])}var z4=z({slice1d_:bP});function vP(e,t,a){let n=R(e,"x","slice2d");return F(n.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${n.rank} tensor`),Fe(n,t,a)}var L4=z({slice2d_:vP});function wP(e,t,a){let n=R(e,"x","slice3d");return F(n.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${n.rank} tensor`),Fe(n,t,a)}var Hp=z({slice3d_:wP});function kP(e,t,a){let n=R(e,"x","slice4d");return F(n.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${n.rank} tensor`),Fe(n,t,a)}var Bh=z({slice4d_:kP});function IP(e,t=-1){let a=R(e,"logits","softmax","float32");if(t===-1&&(t=a.rank-1),t!==a.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a.rank} and dim was ${t}`);let n={logits:a},r={dim:t};return L.runKernel(Uo,n,r)}var Vh=z({softmax_:IP});function SP(e){F(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return L.runKernel(gp,t)}var Uh=z({fft_:SP});function CP(e){F(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return L.runKernel(yp,t)}var Kd=z({ifft_:CP});function TP(e){let t=e.shape[e.shape.length-1],a=e.size/t,n;if(t<=2){let r=Q(e,[a,t]);n=Kd(r)}else{let r=[a,2*(t-1)],s=Q(Yl(e),[a,t]),i=Q(Up(e),[a,t]),o=ns(Fe(s,[0,1],[a,t-2]),1),l=te(ns(Fe(i,[0,1],[a,t-2]),1),Ge(-1)),u=lt([s,o],1),p=lt([i,l],1),c=Q(Sr(u,p),[r[0],r[1]]);n=Kd(c)}if(n=Yl(n),e.rank===3&&e.shape[0]!==0){let r=n,s=e.shape[0];n=Q(n,[s,n.shape[0]/s,n.shape[1]]),r.dispose()}return n}var Bg=z({irfft_:TP});function NP(e,t,a=0){let n={x:R(e,"x","split")},r={numOrSizeSplits:t,axis:a};return L.runKernel(_u,n,r)}var Sa=z({split_:NP});function RP(e,t){F(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let a=e.shape[e.shape.length-1],n=e.size/a,r;if(t!=null&&t0),f=e.shape.map(g=>g);f[e.shape.length-1]=t,r=Fe(e,m,f),a=t}else if(t!=null&&t>a){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-a,r=lt([e,gn(m)],e.shape.length-1),a=t}else r=e;let s=Ja(r),i=Q(Sr(r,s),[n,a]),o=Uh(i),l=Math.floor(a/2)+1,u=Yl(o),p=Up(o),c=Sa(u,[l,a-l],u.shape.length-1),d=Sa(p,[l,a-l],p.shape.length-1),h=r.shape.slice();return h[r.shape.length-1]=l,Q(Sr(c[0],d[0]),h)}var Gh=z({rfft_:RP});function EP(e,t){let a=R(e,"a","squaredDifference"),n=R(t,"b","squaredDifference");[a,n]=Rt(a,n),Ut(a.shape,n.shape);let r={a,b:n},s={};return L.runKernel(Ho,r,s)}var Vg=z({squaredDifference_:EP});function MP(e,t){let a=R(e,"x","squeeze","string_or_numeric");return Q(a,gA(a.shape,t).newShape)}var Oe=z({squeeze_:MP});function PP(e,t=0){let a=Vd(e,"tensors","stack","string_or_numeric");F(a.length>=1,()=>"Pass at least one tensor to tf.stack"),a.length>0&&F(t<=a[0].rank,()=>"Axis must be <= rank of the tensor");let n=a,r={axis:t};return L.runKernel(Su,n,r)}var pa=z({stack_:PP});function _P(e,t=0){let a={x:R(e,"x","step")},n={alpha:t};return L.runKernel(us,a,n)}var Ug=z({step_:_P});function $P(e,t,a,n,r=0,s=0,i=0,o=0,l=0){let u={x:R(e,"x","stridedSlice","string_or_numeric")},p={begin:t,end:a,strides:n,beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return L.runKernel(jo,u,p)}var W4=z({stridedSlice_:$P});function FP(e){let t={x:R(e,"x","tan","float32")};return L.runKernel(Xo,t)}var B4=z({tan_:FP});function Bt(e,t){ri(e);let a=Jn(e,t);if(a.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return ds(e,null,a,t)}function Yn(e,t,a){if(ri(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let n=Jn(e,a);if(n.length!==2&&n.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return ds(e,t,n,a)}function Gg(e,t,a){if(ri(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let n=Jn(e,a);if(n.length!==3&&n.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return ds(e,t,n,a)}function V4(e,t,a){if(ri(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let n=Jn(e,a);if(n.length!==4&&n.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return ds(e,t,n,a)}function U4(e,t,a){if(ri(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let n=Jn(e,a);if(n.length!==5&&n.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return ds(e,t,n,a)}function G4(e,t,a){if(ri(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let n=Jn(e,a);if(n.length!==6&&n.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||n,ds(e,t,n,a)}var Hh={};Ze(Hh,{calculateShapes:()=>H4,validateInput:()=>jh,validateUpdateShape:()=>Hg});function Hg(e,t,a){let n=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: ${a.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${n}, and batchDim: ${r}.`;if(a.rank1?t.shape[n-1]:1,s=a.length,i=1;for(let c=r;c= 0 but got ${t}`);if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);let s={x:n},i={k:t,sorted:a},[o,l]=L.runKernel(Yo,s,i);return{values:o,indices:l}}var q4=z({topk_:OP});function zP(e,t=0,a=1,n,r){if(tn(e),n!=null&&n==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new Og(t,a,n,!0,r),i=$e(e,n);for(let o=0;o0,()=>"The input tensor must be at least 1D");let n={x:a},r={axis:t},[s,i]=L.runKernel(Tp,n,r);return{values:s,indices:i}}var K4=z({unique_:LP});function WP(e,t,a){let n=R(e,"x","unsortedSegmentSum"),r=R(t,"segmentIds","unsortedSegmentSum","int32");F(Ul(a),()=>"numSegments must be of dtype int");let s={x:n,segmentIds:r},i={numSegments:a};return L.runKernel(Np,s,i)}var Y4=z({unsortedSegmentSum_:WP});function BP(e,t=0){let a=R(e,"x","unstack","string_or_numeric");F(t>=-a.shape.length&&t`Axis = ${t} is not in [-${a.shape.length}, ${a.shape.length})`);let n={value:a},r={axis:t};return L.runKernel(zu,n,r)}var Na=z({unstack_:BP});function Z4(e,t){return Lh(e,t,"right")}function J4(e,t=!0,a,n){return L.makeVariable(e,t,a,n)}function Q4(e,t){let a=[];for(let s=0;s0,()=>"mask cannot be scalar"),Ta(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;fo).reverse()),F(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(i=>{F(i>=0&&i`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},s={perm:t};return n.dtype==="complex64"?De(()=>{let i=Yl(n),o=Up(n);return i=L.runKernel(wr,{x:i},s),o=L.runKernel(wr,{x:o},s),a&&(o=Ln(o)),Sr(i,o)}):L.runKernel(wr,r,s)}var Zs=z({transpose_:GP});function HP(e,t,a,n,r=!0){let s=R(e,"v","movingAverage"),i=R(t,"x","movingAverage"),o=R(a,"decay","movingAverage");FA(s,i),F(Cr(s.shape,i.shape),()=>"Shape mismatch in v and x");let l=Ge(1),u=xe(l,o),p=te(xe(i,s),u);if(r){F(n!=null,()=>"When using zeroDebias: true, step is required.");let c=R(n,"step","movingAverage");p=ve(p,xe(l,ql(o,c)))}return we(s,p)}var t7=z({movingAverage_:HP});function jP(e,t,a){tn(a);let n=R(e,"indices","scatterND","int32"),r=R(t,"updates","scatterND");jh(r,n,a);let s={indices:n,updates:r},i={shape:a};return L.runKernel(Po,s,i)}var a7=z({scatterND_:jP});function qP(e,t,a,n){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(a.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${a.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!==n.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function XP(e,t,a,n=0){tn(a);let r=R(e,"sparseIndices","sparseToDense","int32"),s=R(t,"sparseValues","sparseToDense","string_or_numeric"),i=R(n,"defaultValue","sparseToDense",s.dtype);qP(r,s,a,i);let o={sparseIndices:r,sparseValues:s,defaultValue:i},l={outputShape:a};return L.runKernel(Go,o,l)}var n7=z({sparseToDense_:XP});function KP(e,t){let a=R(t,"indices","gatherND","int32"),n={params:R(e,"x","gatherND","string_or_numeric"),indices:a};return L.runKernel(Vi,n)}var r7=z({gatherND_:KP});function YP(e,t){if(t==null)return e.shape.slice();if(Cr(e.shape,t))return t;if(e.shape.length===t.length){let a=[];for(let n=0;n`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 gt?r.clone():r;let s=YP(r,a),i=1-t,o=ve(bg(we(Wh(s,0,1,"float32",n),i)),i);return te(r,o)}var s7=z({dropout_:ZP});function qg(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function qh(e,t,a){let n=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 ${n.rank}`),F(n.rank-1===r.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${n.rank} and targets rank ${r.rank}`),Ta(n.shape.slice(0,n.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=n.shape[n.shape.length-1];F(a>0&&a<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${a}`);let i=await n.data(),o=await r.data(),[l,u]=[i.length/s,s],p=yA("bool",l);for(let c=0;cg.value-f.value),p[c]=0;for(let f=0;fa_,depthwiseConv2d:()=>l_,matMul:()=>d_});function QP(e,t,a,n,r,s="NHWC",i){let o=e;e.rank===3&&(o=Q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=Q(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(a.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${a}.`);let u=s==="NHWC"?o.shape[3]:o.shape[1],p=s==="NHWC"?l.shape[3]:l.shape[1];F(u===a[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${a[2]}.`),F(p===a[3],()=>`Error in conv2dDerFilter: depth of dy (${p}) must match output depth for filter (${a[3]}).`),Nn("conv2dDerFilter",r,i);let c={x:o,dy:l},d={strides:n,pad:r,dataFormat:s,dimRoundingMode:i,filterShape:a};return L.runKernel(pp,c,d)}var e_=z({conv2DBackpropFilter_:QP});function Xh(e,t,a){if(a==null||a==="linear")return e;if(a==="relu")return te(e,Ug(t));throw new Error(`Cannot compute gradient for fused activation ${a}.`)}function Kh(e,t){let a=t,n=fg(e.shape,t.shape);return n.length>0&&(a=ot(a,n)),Q(a,e.shape)}function Yh(e,t,a,n){if(t==="linear")return e;if(t==="relu")return Gp(e);if(t==="elu")return yg(e);if(t==="relu6")return Lg(e);if(t==="prelu")return _g(e,a);if(t==="leakyrelu")return kg(e,n);if(t==="sigmoid")return za(e);throw new Error(`Unknown fused activation ${t}.`)}var Zh=(e,t)=>!(e>0)||t==="linear";function t_({x:e,filter:t,strides:a,pad:n,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:p}){if(l=l||"linear",Zh(L.state.gradientDepth,l)===!1){F(r==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${r} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let I=Lp(e,t,a,n,r,s,i);return o!=null&&(I=we(I,o)),Yh(I,l,u,p)}let c=R(e,"x","conv2d","float32"),d=R(t,"filter","conv2d","float32"),h=c,m=!1;c.rank===3&&(m=!0,h=Q(c,[1,c.shape[0],c.shape[1],c.shape[2]])),F(h.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),F(d.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${d.rank}.`),Nn("fused conv2d",n,i);let f=r==="NHWC"?h.shape[3]:h.shape[1];F(d.shape[2]===f,()=>`Error in conv2d: depth of input (${f}) must match input depth for filter ${d.shape[2]}.`),F(Nr(a,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`);let g=Op(h.shape,d.shape,a,s,n,i),y;o!=null&&(y=R(o,"bias","fused conv2d"),[y]=Rt(y,c),r==="NHWC"?Ut(g.outShape,y.shape):(F(y.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${y.shape.length}.`),F(y.shape.length===0||y.shape[0]===g.outChannels||y.shape[0]===1,()=>`Error in fused conv2d: bias shape (${y.shape}) is not compatible with the number of output channels (${g.outChannels})`)));let x;if(u!=null){let I=u.shape;if(F(I.length<=1||I.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${I.length}.`),I.length===1)F(I[0]===1||I[0]===g.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${I}) is not compatible with the number of output channels (${g.outChannels}).`);else if(I.length===3)try{Ut(I,g.outShape)}catch(T){let N=`Error in fused conv2d: PReLU activation weights (${I}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(N)}x=R(u,"prelu weights","fused conv2d")}let A=(I,T)=>{F(r==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`);let[N,M,P,E]=T,S=Xh(I,P,l);F(Hd(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let _=Ib(M.shape,S,N,a,n),O=e_(M,S,N.shape,a,n),W=[_,O];if(E!=null){let $=Kh(E,S);W.push($)}return W},b={x:h,filter:d,bias:y,preluActivationWeights:x},w={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:p};return o==null?er((I,T,N)=>{let M=L.runKernel(Zr,b,w);return N([T,I,M]),m&&(M=Q(M,[M.shape[1],M.shape[2],M.shape[3]])),{value:M,gradFunc:A}})(h,d):er((I,T,N,M)=>{let P=L.runKernel(Zr,b,w);return M([T,I,P,N]),m&&(P=Q(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:A}})(h,d,y)}var a_=z({fusedConv2d_:t_});function n_(e,t,a,n,r,s=[1,1],i){let o=e;e.rank===3&&(o=Q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=Q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={x:o,dy:l},p={strides:n,pad:r,dimRoundingMode:i,dilations:s,filterShape:a};return L.runKernel(cp,u,p)}var r_=z({depthwiseConv2dNativeBackpropFilter_:n_});function s_(e,t,a,n,r,s=[1,1],i){let o=t,l=!1;t.rank===3&&(l=!0,o=Q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={dy:o,filter:a},p={strides:n,pad:r,dimRoundingMode:i,dilations:s,inputShape:e},c=L.runKernel(hp,u,p);return l?Q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var i_=z({depthwiseConv2dNativeBackpropInput_:s_});function o_({x:e,filter:t,strides:a,pad:n,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:p}){if(Zh(L.state.gradientDepth,l)===!1){let w=Dh(e,t,a,n,r,s,i);return o!=null&&(w=we(w,o)),Yh(w,l,u,p)}let c=R(e,"x","depthwiseConv2d","float32"),d=R(t,"filter","depthwiseConv2d","float32"),h=c,m=!1;c.rank===3&&(m=!0,h=Q(c,[1,c.shape[0],c.shape[1],c.shape[2]])),F(h.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),F(d.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`),F(h.shape[3]===d.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`),s==null&&(s=[1,1]),F(Nr(a,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`),Nn("fused depthwiseConv2d",n,i);let f=Op(h.shape,d.shape,a,s,n,i,!0),g;o!=null&&(g=R(o,"bias","fused conv2d"),[g]=Rt(g,c),Ut(f.outShape,g.shape));let y;u!=null&&(y=R(u,"prelu weights","fused depthwiseConv2d"));let x=(w,I)=>{F(Hd(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[T,N,M,P]=I,E=Xh(w,M,l),S=i_(N.shape,E,T,a,n,s,i),_=r_(N,E,T.shape,a,n,s,i);if(P!=null){let O=Kh(g,E);return[S,_,O]}return[S,_]},A={x:h,filter:d,bias:g,preluActivationWeights:y},b={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:p};return o==null?er((w,I,T)=>{let N=L.runKernel(Jr,A,b);return T([I,w,N]),m&&(N=Q(N,[N.shape[1],N.shape[2],N.shape[3]])),{value:N,gradFunc:x}})(h,d):er((w,I,T,N)=>{let M=L.runKernel(Jr,A,b);return N([I,w,M,T]),m&&(M=Q(M,[M.shape[1],M.shape[2],M.shape[3]])),{value:M,gradFunc:x}})(h,d,g)}var l_=z({fusedDepthwiseConv2d_:o_});function u_({a:e,b:t,transposeA:a=!1,transposeB:n=!1,bias:r,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o=.2}){if(Zh(L.state.gradientDepth,s)===!1){let P=pt(e,t,a,n);return r!=null&&(P=we(P,r)),Yh(P,s,i,o)}let l=R(e,"a","fused matMul"),u=R(t,"b","fused matMul");[l,u]=Rt(l,u);let p=a?l.shape[l.rank-2]:l.shape[l.rank-1],c=n?u.shape[u.rank-1]:u.shape[u.rank-2],d=a?l.shape[l.rank-1]:l.shape[l.rank-2],h=n?u.shape[u.rank-2]:u.shape[u.rank-1],m=l.shape.slice(0,-2),f=u.shape.slice(0,-2),g=vt(m),y=vt(f);F(p===c,()=>`Error in fused matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${a} and transposeB=${n} must match.`);let x=Ut(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([d,h]),A=a?Q(l,[g,p,d]):Q(l,[g,d,p]),b=n?Q(u,[y,h,c]):Q(u,[y,c,h]),w;r!=null&&(w=R(r,"bias","fused matMul"),[w]=Rt(w,l),Ut(x,w.shape));let I;i!=null&&(I=R(i,"prelu weights","fused matMul"));let T=(P,E)=>{let[S,_,O,W]=E,$=Xh(Q(P,O.shape),O,s),U,G;if(!a&&!n?(U=pt($,_,!1,!0),G=pt(S,$,!0,!1)):!a&&n?(U=pt($,_,!1,!1),G=pt($,S,!0,!1)):a&&!n?(U=pt(_,$,!1,!0),G=pt(S,$,!1,!1)):(U=pt(_,$,!0,!0),G=pt($,S,!0,!0)),r!=null){let q=Kh(W,$);return[U,G,q]}else return[U,G]},N={a:A,b,bias:w,preluActivationWeights:I},M={transposeA:a,transposeB:n,activation:s,leakyreluAlpha:o};return r==null?er((P,E,S)=>{let _=L.runKernel(Yr,N,M);return S([P,E,_]),{value:Q(_,x),gradFunc:T}})(A,b):er((P,E,S,_)=>{let O=L.runKernel(Yr,N,M);return _([P,E,O,S]),{value:Q(O,x),gradFunc:T}})(A,b,w)}var d_=z({fusedMatMul_:u_});function p_(e){return qh(e,.54,.46)}var c_=z({hammingWindow_:p_});function h_(e){return qh(e,.5,.5)}var o7=z({hannWindow_:h_});function m_(e,t,a,n=!1,r=0){let s=0,i=[];for(;s+t<=e.size;)i.push(Fe(e,s,t)),s+=a;if(n)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 [${u},4] but had shape ${o.shape}.`),F(l.rank===1&&l.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${o.shape}.`),F(n.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${n.length}.`),F(n[0]>=1&&n[1]>=1,()=>`cropSize must be atleast [1,1], but was ${n}`),F(r==="bilinear"||r==="nearest",()=>`method must be bilinear or nearest, but was ${r}`);let p={image:i,boxes:o,boxInd:l},c={method:r,extrapolationValue:s,cropSize:n};return L.runKernel(Ni,p,c)}var x_=z({cropAndResize_:y_});function A_(e){let t=R(e,"image","flipLeftRight","float32");F(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let a={image:t};return L.runKernel(zi,a,{})}var b_=z({flipLeftRight_:A_});function v_(e){let t=R(e,"image","grayscaleToRGB"),a=t.rank-1,n=t.shape[a];F(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),F(n===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${n}.`);let r=new Array(t.rank);return r.fill(1,0,a),r[a]=3,Xr(t,r)}var w_=z({grayscaleToRGB_:v_});function k_(e){let t=R(e,"image","RGBToGrayscale"),a=t.rank-1,n=t.shape[a];F(t.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`),F(n===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${n}.`);let r=t.dtype,s=Ue(t,"float32"),i=Bt([.2989,.587,.114]),o;switch(t.rank){case 2:o=Bs("ij,j->i",s,i);break;case 3:o=Bs("ijk,k->ij",s,i);break;case 4:o=Bs("ijkl,l->ijk",s,i);break;case 5:o=Bs("ijklm,m->ijkl",s,i);break;case 6:o=Bs("ijklmn,n->ijklm",s,i);break;default:throw new Error("Not a valid tensor rank.")}return o=Wt(o,-1),Ue(o,r)}var I_=z({rgbToGrayscale_:k_});function S_(e,t,a=0,n=.5){let r=R(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:a,center:n};return L.runKernel(Jo,s,i)}var C_=z({rotateWithOffset_:S_});function Vu(e,t,a,n,r,s){n==null&&(n=.5),r==null&&(r=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return a=Math.min(a,i),F(0<=n&&n<=1,()=>`iouThreshold must be in [0, 1], but was '${n}'`),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:a,iouThreshold:n,scoreThreshold:r,softNmsSigma:s}}function T_(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppression","float32"),i=R(t,"scores","nonMaxSuppression","float32"),o=Vu(s,i,a,n,r);a=o.maxOutputSize,n=o.iouThreshold,r=o.scoreThreshold;let l={maxOutputSize:a,iouThreshold:n,scoreThreshold:r};return L.runKernel(yo,{boxes:s,scores:i},l)}var N_=z({nonMaxSuppression_:T_});function R_(e,t,a){let n=E_(e,t,a),r=n<0?-(n+1):n;e.splice(r,0,t)}function E_(e,t,a){return P_(e,t,a||M_)}function M_(e,t){return e>t?1:e>>1);let o=a(t,e[s]);o>0?n=s+1:(r=s,i=!o)}return i?n:-n-1}function u7(e,t,a,n,r){return Kg(e,t,a,n,r,0)}function d7(e,t,a,n,r,s){return Kg(e,t,a,n,r,0,!1,s,!0)}function p7(e,t,a,n,r,s){return Kg(e,t,a,n,r,s,!0)}function Kg(e,t,a,n,r,s,i=!1,o=!1,l=!1){let u=[];for(let g=0;gr&&u.push({score:t[g],boxIndex:g,suppressBeginIndex:0});u.sort(Jx);let p=s>0?-.5/s:0,c=[],d=[];for(;c.length0;){let g=u.pop(),{score:y,boxIndex:x,suppressBeginIndex:A}=g;if(y=A;--w){let I=__(e,x,c[w]);if(I>=n){b=!0;break}if(g.score=g.score*$_(n,p,I),g.score<=r)break}g.suppressBeginIndex=c.length,b||(g.score===y?(c.push(x),d.push(g.score)):g.score>r&&R_(u,g,Jx))}let h=c.length,m=a-h;o&&m>0&&(c.push(...new Array(m).fill(0)),d.push(...new Array(m).fill(0)));let f={selectedIndices:c};return i&&(f.selectedScores=d),l&&(f.validOutputs=h),f}function __(e,t,a){let n=e.subarray(t*4,t*4+4),r=e.subarray(a*4,a*4+4),s=Math.min(n[0],n[2]),i=Math.min(n[1],n[3]),o=Math.max(n[0],n[2]),l=Math.max(n[1],n[3]),u=Math.min(r[0],r[2]),p=Math.min(r[1],r[3]),c=Math.max(r[0],r[2]),d=Math.max(r[1],r[3]),h=(o-s)*(l-i),m=(c-u)*(d-p);if(h<=0||m<=0)return 0;let f=Math.max(s,u),g=Math.max(i,p),y=Math.min(o,c),x=Math.min(l,d),A=Math.max(y-f,0)*Math.max(x-g,0);return A/(h+m-A)}function $_(e,t,a){let n=Math.exp(t*a*a);return a<=e?n:0}function Jx(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function F_(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppressionAsync"),i=R(t,"scores","nonMaxSuppressionAsync"),o=Vu(s,i,a,n,r);a=o.maxOutputSize,n=o.iouThreshold,r=o.scoreThreshold;let l=await Promise.all([s.data(),i.data()]),u=l[0],p=l[1],{selectedIndices:c}=u7(u,p,a,n,r);return s!==e&&s.dispose(),i!==t&&i.dispose(),Bt(c,"int32")}var D_=F_;function O_(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=Vu(i,o,a,n,r,s);a=l.maxOutputSize,n=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let u={boxes:i,scores:o},p={maxOutputSize:a,iouThreshold:n,scoreThreshold:r,softNmsSigma:s},c=L.runKernel(xo,u,p);return{selectedIndices:c[0],selectedScores:c[1]}}var z_=z({nonMaxSuppressionWithScore_:O_});async function L_(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=Vu(i,o,a,n,r,s);a=l.maxOutputSize,n=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let u=await Promise.all([i.data(),o.data()]),p=u[0],c=u[1],{selectedIndices:d,selectedScores:h}=p7(p,c,a,n,r,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Bt(d,"int32"),selectedScores:Bt(h)}}var W_=L_;function B_(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=Vu(i,o,a,n,r,null),u=l.maxOutputSize,p=l.iouThreshold,c=l.scoreThreshold,d={boxes:i,scores:o},h={maxOutputSize:u,iouThreshold:p,scoreThreshold:c,padToMaxOutputSize:s},m=L.runKernel(ku,d,h);return{selectedIndices:m[0],validOutputs:m[1]}}var V_=z({nonMaxSuppressionPadded_:B_});async function U_(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=Vu(i,o,a,n,r,null),u=l.maxOutputSize,p=l.iouThreshold,c=l.scoreThreshold,[d,h]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=d7(d,h,u,p,c,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Bt(m,"int32"),validOutputs:Ge(f,"int32")}}var G_=U_;function H_(e,t,a=!1,n=!1){let r=R(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(n===!1||a===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=Q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:a,halfPixelCenters:n,size:t},u=L.runKernel(To,o,l);return i?Q(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var j_=z({resizeBilinear_:H_});function q_(e,t,a=!1,n=!1){let r=R(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(n===!1||a===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=Q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:a,halfPixelCenters:n,size:t},u=L.runKernel(Co,o,l);return i?Q(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var X_=z({resizeNearestNeighbor_:q_});function K_(e,t="binary",a=!1,n=.5){let r=R(e,"image","threshold"),s=.2989,i=.587,o=.114,l=r.shape[0]*r.shape[1],u=te(Bt([n]),255),p,c,d,h;if(F(r.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`),F(r.shape[2]===3||r.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`),F(r.dtype==="int32"||r.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`),F(t==="otsu"||t==="binary",()=>`Method must be binary or otsu, but was ${t}`),r.shape[2]===3){[p,c,d]=Sa(r,[1,1,1],-1);let f=te(p,s),g=te(c,i),y=te(d,o);h=we(we(f,g),y)}else h=e;if(t==="otsu"){let f=mg(Ue(Wg(h),"int32"),Ve([]),256);u=Y_(f,l)}let m=a?Oh(h,u):Vp(h,u);return Ue(te(m,255),"int32")}function Y_(e,t){let a=Bt([-1]),n=Bt([0]),r=Bt([0]),s,i,o,l,u,p;for(let c=0;c`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},u={interpolation:a,fillMode:n,fillValue:r,outputShape:s};return L.runKernel(Zo,l,u)}var Q_=z({transform_:J_});function e$(e,t,a){let n=R(e,"a","bandPart");F(n.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${n.rank}.`);let r=n.shape,[s,i]=n.shape.slice(-2),o,l;typeof t=="number"?(F(t%1===0,()=>`bandPart(): numLower must be an integer, got ${t}.`),F(t<=s,()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`),o=R(t<0?s:t,"numLower","bandPart")):(F(t.dtype==="int32",()=>"bandPart(): numLower's dtype must be an int32."),o=kr(hh(t,0),s,Xd(t,s))),typeof a=="number"?(F(a%1===0,()=>`bandPart(): numUpper must be an integer, got ${a}.`),F(a<=i,()=>`bandPart(): numUpper (${a}) must not be greater than the number of columns (${i}).`),l=R(a<0?i:a,"numUpper","bandPart")):(F(a.dtype==="int32",()=>"bandPart(): numUpper's dtype must be an int32."),l=kr(hh(a,0),i,Xd(a,i)));let u=Q(Kl(0,s,1,"int32"),[-1,1]),p=Kl(0,i,1,"int32"),c=xe(u,p),d=jd(Oh(c,o),wg(c,Ln(l))),h=gn([s,i],n.dtype);return Q(pa(Na(Q(n,[-1,s,i])).map(m=>kr(d,m,h))),r)}var t$=z({bandPart_:e$});function a$(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=Sa(e,e.shape[0],0).map(r=>Oe(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 a=[],n=e;for(let r=0;r{let s=n[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 Qx(e,t);{let a=e.shape.slice(0,e.shape.length-2).reduce((l,u)=>l*u),n=Na(Q(e,[a,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],s=[];n.forEach(l=>{let[u,p]=Qx(l,t);r.push(u),s.push(p)});let i=Q(pa(r,0),e.shape),o=Q(pa(s,0),e.shape);return[i,o]}}function Qx(e,t=!1){return L.tidy(()=>{F(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let a=e.shape[0],n=e.shape[1],r=Ag(a),s=Ia(e),i=Yn([[1]],[1,1]),o=Ia(i),l=a>=n?n:a;for(let u=0;u{let h=Fe(s,[u,u],[a-u,1]),m=Bp(h),f=Fe(s,[u,u],[1,1]),g=kr(Vp(f,0),Yn([[-1]]),Yn([[1]])),y=xe(f,te(g,m)),x=ve(h,y);x.shape[0]===1?o=Ia(i):o=lt([i,Fe(x,[1,0],[x.shape[0]-1,x.shape[1]])],0);let A=Ln(ve(pt(g,y),m)),b=Fe(s,[u,0],[a-u,n]),w=te(A,o),I=Zs(o);if(u===0)s=xe(b,pt(w,pt(I,b)));else{let M=xe(b,pt(w,pt(I,b)));s=lt([Fe(s,[0,0],[u,n]),M],0)}let T=Zs(w),N=Fe(r,[0,u],[a,r.shape[1]-u]);if(u===0)r=xe(N,pt(pt(N,o),T));else{let M=xe(N,pt(pt(N,o),T));r=lt([Fe(r,[0,0],[a,u]),M],1)}return[o,s,r]}),J([p,c,d])}return!t&&a>n&&(r=Fe(r,[0,0],[a,n]),s=Fe(s,[0,0],[n,n])),[r,s]})}var s$=z({qr_:r$}),wa;(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"})(wa||(wa={}));function i$(e,t,a=wa.SUM_BY_NONZERO_WEIGHTS){let n=R(e,"losses","computeWeightedLoss"),r=null;t!=null&&(r=R(t,"weights","computeWeightedLoss"));let s=r==null?n:te(n,r);if(a===wa.NONE)return s;if(a===wa.SUM)return ot(s);if(a===wa.MEAN){if(r==null)return qd(s);{let i=n.size/r.size,o=ve(ot(s),ot(r));return i>1?ve(o,Ge(i)):o}}if(a===wa.SUM_BY_NONZERO_WEIGHTS){if(r==null)return ve(ot(s),Ge(n.size));{let i=te(r,Hr(n.shape)),o=Ue(ot(Mg(i,Ge(0))),"float32");return ve(ot(s),o)}}throw Error(`Unknown reduction: ${a}`)}var Rr=z({computeWeightedLoss_:i$});function o$(e,t,a,n=wa.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"labels","absoluteDifference"),s=R(t,"predictions","absoluteDifference"),i=null;a!=null&&(i=R(a,"weights","absoluteDifference")),Ta(r.shape,s.shape,"Error in absoluteDifference: ");let o=Ya(xe(r,s));return Rr(o,i,n)}var l$=z({absoluteDifference_:o$});function u$(e,t,a,n,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","cosineDistance"),i=R(t,"predictions","cosineDistance"),o=null;n!=null&&(o=R(n,"weights","cosineDistance")),Ta(s.shape,i.shape,"Error in cosineDistance: ");let l=Ge(1),u=xe(l,ot(te(s,i),a,!0));return Rr(u,o,r)}var d$=z({cosineDistance_:u$});function p$(e,t,a,n=wa.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"labels","hingeLoss"),s=R(t,"predictions","hingeLoss"),i=null;a!=null&&(i=R(a,"weights","hingeLoss")),Ta(r.shape,s.shape,"Error in hingeLoss: ");let o=Ge(1);r=xe(te(Ge(2),r),o);let l=Gp(xe(o,te(r,s)));return Rr(l,i,n)}var c$=z({hingeLoss_:p$});function h$(e,t,a,n=1,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","huberLoss"),i=R(t,"predictions","huberLoss"),o=null;a!=null&&(o=R(a,"weights","huberLoss")),Ta(s.shape,i.shape,"Error in huberLoss: ");let l=Ge(n),u=Ya(xe(i,s)),p=Xd(u,l),c=xe(u,p),d=we(te(Ge(.5),Tn(p)),te(l,c));return Rr(d,o,r)}var m$=z({huberLoss_:h$});function f$(e,t,a,n=1e-7,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","logLoss"),i=R(t,"predictions","logLoss"),o=null;a!=null&&(o=R(a,"weights","logLoss")),Ta(s.shape,i.shape,"Error in logLoss: ");let l=Ge(1),u=Ge(n),p=Ln(te(s,Xl(we(i,u)))),c=te(xe(l,s),Xl(we(xe(l,i),u))),d=xe(p,c);return Rr(d,o,r)}var g$=z({logLoss_:f$});function y$(e,t,a,n=wa.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"labels","meanSquaredError"),s=R(t,"predictions","meanSquaredError"),i=null;a!=null&&(i=R(a,"weights","meanSquaredError")),Ta(r.shape,s.shape,"Error in meanSquaredError: ");let o=Vg(r,s);return Rr(o,i,n)}var x$=z({meanSquaredError_:y$});function A$(e,t){let a=R(e,"labels","sigmoidCrossEntropyWithLogits"),n=R(t,"logits","sigmoidCrossEntropyWithLogits");Ta(a.shape,n.shape,"Error in sigmoidCrossEntropyWithLogits: ");let r=Gp(n),s=te(n,a),i=Ig(as(Ln(Ya(n))));return we(xe(r,s),i)}function b$(e,t,a,n=0,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"multiClassLabels","sigmoidCrossEntropy"),i=R(t,"logits","sigmoidCrossEntropy"),o=null;if(a!=null&&(o=R(a,"weights","sigmoidCrossEntropy")),Ta(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),n>0){let u=Ge(n),p=Ge(1),c=Ge(.5);s=we(te(s,xe(p,u)),te(c,u))}let l=A$(s,i);return Rr(l,o,r)}var v$=z({sigmoidCrossEntropy_:b$});function w$(e,t,a=-1){if(a===-1&&(a=t.rank-1),a!==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 ${a}`);return er((n,r,s)=>{let i=Cg(r,[a],!0),o=xe(Ue(r,"float32"),i);s([n,o]);let l=Ln(te(o,n));return{value:ot(l,[a]),gradFunc:(u,p)=>{let[c,d]=p,h=Wp(u.shape,[a]);return[te(Q(u,h),xe(Ue(c,"float32"),as(d))),te(Q(u,h),xe(as(d),Ue(c,"float32")))]}}})(e,t)}function k$(e,t,a,n=0,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"onehotLabels","softmaxCrossEntropy"),i=R(t,"logits","softmaxCrossEntropy"),o=null;if(a!=null&&(o=R(a,"weights","softmaxCrossEntropy")),Ta(s.shape,i.shape,"Error in softmaxCrossEntropy: "),n>0){let u=Ge(n),p=Ge(1),c=Ge(s.shape[1]);s=we(te(s,xe(p,u)),ve(u,c))}let l=w$(s,i);return Rr(l,o,r)}var I$=z({softmaxCrossEntropy_:k$});function S$(e,t,a,n){let r=R(e,"indices","sparseFillEmptyRows","int32"),s=R(t,"values","sparseFillEmptyRows"),i=R(a,"denseShape","sparseFillEmptyRows","int32"),o=R(n,"defaultValue","sparseFillEmptyRows",s.dtype);if(r.rank!==2)throw new Error(`Indices should be Tensor2D but received shape - ${r.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(i.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${i.shape}`);if(o.rank!==0)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);let l={indices:r,values:s,denseShape:i,defaultValue:o},u=L.runKernel(wp,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}var C$=z({sparseFillEmptyRows_:S$});function T$(e,t,a){let n=R(e,"inputIndices","sparseReshape","int32"),r=R(t,"inputShape","sparseReshape","int32"),s=R(a,"newShape","sparseReshape","int32");if(n.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape - ${n.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:n,inputShape:r,newShape:s},o=L.runKernel($u,i);return{outputIndices:o[0],outputShape:o[1]}}var N$=z({sparseReshape_:T$});function R$(e,t,a){let n=R(e,"data","sparseSegmentMean"),r=R(t,"indices","sparseSegmentMean","int32"),s=R(a,"segmentIds","sparseSegmentMean","int32");if(n.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape +Expected: ${s}.`)}typeof expect!="undefined"&&expect().nothing()}function _F(e,t){e().then(()=>t.fail(),()=>t()),typeof expect!="undefined"&&expect().nothing()}function OF(e,t){let a=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return Xr(e)||Xr(e[0])||Xr(t)||Xr(t[0])?v1(e,a,(n,r)=>n==r):v1(e,t,(n,r)=>Hg(n,r,0))}function zF(e,t,a){if(a==null&&(a=Gg()),!Hg(e,t,a))throw new Error(`Numbers differ: actual === ${e}, expected === ${t}`);typeof expect!="undefined"&&expect().nothing()}function Hg(e,t,a){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>a)}function LF(e,t,a){for(let n=0;na)throw new Error(`Value out of range:${e[n]} low: ${t}, high: ${a}`)}function WF(e,t){let a=new Float32Array(e),n=new Float32Array(t);if(a.length!==n.length)throw new Error(`Expected ArrayBuffer to be of length ${n.length}, but it was ${a.length}`);for(let r=0;r{t.addEventListener("loadeddata",n=>a(t)),t.load()})}async function VF(e){await e.play(),"requestVideoFrameCallback"in e&&await new Promise(t=>{e.requestVideoFrameCallback(t)})}var jg=class{constructor(e,t,a,n,r){this.mean=e,this.stdDev=t,this.dtype=a,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);let s=r||Math.random();this.random=Ug.alea(s.toString())}nextValue(){if(!isNaN(this.nextVal)){let n=this.nextVal;return this.nextVal=NaN,n}let e,t,a=!1;for(;!a;){let n,r,s;do n=2*this.random()-1,r=2*this.random()-1,s=n*n+r*r;while(s>=1||s===0);let i=Math.sqrt(-2*Math.log(s)/s);e=this.mean+this.stdDev*n*i,t=this.mean+this.stdDev*r*i,(!this.truncated||this.isValidTruncated(e))&&(a=!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}},UF=class{constructor(e,t,a,n){this.alpha=e,this.beta=1/t,this.dtype=a;let r=n||Math.random();this.randu=Ug.alea(r.toString()),this.randn=new jg(0,1,a,!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,a,n,r,s;for(;;){do n=this.randn.nextValue(),s=1+this.c*n;while(s<=0);if(s*=s*s,e=n*n,t=1-.331*e*e,a=.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=a,n==null&&(n=Math.random()),typeof n=="number"&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=Ug.alea(n)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function HF(e,t,a=1,n="float32",r){if(nn(e),a==null&&(a=1),n==null&&(n="float32"),n!=="float32"&&n!=="int32")throw new Error(`Unsupported data type ${n}`);let s=new UF(t,a,n,r),i=Te(e,n);for(let o=0;o`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),us(t,0)}var q4=z({reverse1d_:t$});function a$(e,t){let a=R(e,"x","reverse");return P(a.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${a.rank}.`),us(a,t)}var X4=z({reverse2d_:a$});function n$(e,t){let a=R(e,"x","reverse");return P(a.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${a.rank}.`),us(a,t)}var K4=z({reverse3d_:n$});function r$(e,t){let a=R(e,"x","reverse");return P(a.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${a.rank}.`),us(a,t)}var Y4=z({reverse4d_:r$});function s$(e){let t={x:R(e,"x","round")};return L.runKernel(Go,t)}var Kg=z({round_:s$});function i$(e){let t={x:R(e,"x","rsqrt","float32")};return L.runKernel(Ns,t)}var Z4=z({rsqrt_:i$});function o$(e){let t={x:R(e,"x","selu")};return L.runKernel(Xo,t)}var J4=z({selu_:o$});function l$(e,t,a,n,r,s=[1,1],i="NHWC"){let o=R(e,"x","separableConv2d"),l=R(t,"depthwiseFilter","separableConv2d"),u=R(a,"pointwiseFilter","separableConv2d"),d=o,c=!1;if(o.rank===3&&(c=!0,d=Q(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");P(d.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${d.rank}.`),P(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),P(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),P(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),P(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);let p=l.shape[2],h=l.shape[3];P(u.shape[2]===p*h,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${p*h}, but got ${u.shape[2]}.`);let m=Gh(d,l,n,r,i,s),f=qp(m,u,1,"valid",i);return c?Q(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var Q4=z({separableConv2d_:l$});async function u$(e,t){let a=R(e,"x","setdiff1d"),n=R(t,"y","setdiff1d");P(a.dtype===n.dtype,()=>`x and y should have the same dtype, but got x (${a.dtype}) and y (${n.dtype}).`),P(a.rank===1,()=>`x should be 1D tensor, but got x (${a.shape}).`),P(n.rank===1,()=>`y should be 1D tensor, but got y (${n.shape}).`);let r=await a.data(),s=await n.data(),i=new Set(s),o=0;for(let d=0;d`slice1d expects a rank-1 tensor, but got a rank-${n.rank} tensor`),_e(n,[t],[a])}var r7=z({slice1d_:h$});function m$(e,t,a){let n=R(e,"x","slice2d");return P(n.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${n.rank} tensor`),_e(n,t,a)}var s7=z({slice2d_:m$});function f$(e,t,a){let n=R(e,"x","slice3d");return P(n.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${n.rank} tensor`),_e(n,t,a)}var Qp=z({slice3d_:f$});function g$(e,t,a){let n=R(e,"x","slice4d");return P(n.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${n.rank} tensor`),_e(n,t,a)}var Kh=z({slice4d_:g$});function y$(e,t=-1){let a=R(e,"logits","softmax","float32");if(t===-1&&(t=a.rank-1),t!==a.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a.rank} and dim was ${t}`);let n={logits:a},r={dim:t};return L.runKernel(el,n,r)}var Yh=z({softmax_:y$});function x$(e){P(e.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`);let t={input:e};return L.runKernel(Sp,t)}var Zh=z({fft_:x$});function A$(e){P(e.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`);let t={input:e};return L.runKernel(Tp,t)}var rp=z({ifft_:A$});function b$(e){let t=e.shape[e.shape.length-1],a=e.size/t,n;if(t<=2){let r=Q(e,[a,t]);n=rp(r)}else{let r=[a,2*(t-1)],s=Q(ru(e),[a,t]),i=Q(Zp(e),[a,t]),o=us(_e(s,[0,1],[a,t-2]),1),l=te(us(_e(i,[0,1],[a,t-2]),1),Ge(-1)),u=lt([s,o],1),d=lt([i,l],1),c=Q(Rr(u,d),[r[0],r[1]]);n=rp(c)}if(n=ru(n),e.rank===3&&e.shape[0]!==0){let r=n,s=e.shape[0];n=Q(n,[s,n.shape[0]/s,n.shape[1]]),r.dispose()}return n}var Yg=z({irfft_:b$});function v$(e,t,a=0){let n={x:R(e,"x","split")},r={numOrSizeSplits:t,axis:a};return L.runKernel(Wu,n,r)}var Sa=z({split_:v$});function w$(e,t){P(e.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let a=e.shape[e.shape.length-1],n=e.size/a,r;if(t!=null&&t0),f=e.shape.map(g=>g);f[e.shape.length-1]=t,r=_e(e,m,f),a=t}else if(t!=null&&t>a){let m=e.shape.map(f=>f);m[e.shape.length-1]=t-a,r=lt([e,An(m)],e.shape.length-1),a=t}else r=e;let s=en(r),i=Q(Rr(r,s),[n,a]),o=Zh(i),l=Math.floor(a/2)+1,u=ru(o),d=Zp(o),c=Sa(u,[l,a-l],u.shape.length-1),p=Sa(d,[l,a-l],d.shape.length-1),h=r.shape.slice();return h[r.shape.length-1]=l,Q(Rr(c[0],p[0]),h)}var Jh=z({rfft_:w$});function k$(e,t){let a=R(e,"a","squaredDifference"),n=R(t,"b","squaredDifference");[a,n]=Et(a,n),Ut(a.shape,n.shape);let r={a,b:n},s={};return L.runKernel(Ms,r,s)}var Zg=z({squaredDifference_:k$});function I$(e,t){let a=R(e,"x","squeeze","string_or_numeric");return Q(a,PA(a.shape,t).newShape)}var Oe=z({squeeze_:I$});function S$(e,t=0){let a=Zd(e,"tensors","stack","string_or_numeric");P(a.length>=1,()=>"Pass at least one tensor to tf.stack"),a.length>0&&P(t<=a[0].rank,()=>"Axis must be <= rank of the tensor");let n=a,r={axis:t};return L.runKernel(Fu,n,r)}var ca=z({stack_:S$});function T$(e,t=0){let a={x:R(e,"x","step")},n={alpha:t};return L.runKernel(Ds,a,n)}var Jg=z({step_:T$});function C$(e,t,a,n,r=0,s=0,i=0,o=0,l=0){let u={x:R(e,"x","stridedSlice","string_or_numeric")},d={begin:t,end:a,strides:n,beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};return L.runKernel(al,u,d)}var i7=z({stridedSlice_:C$});function N$(e){let t={x:R(e,"x","tan","float32")};return L.runKernel(nl,t)}var o7=z({tan_:N$});function Vt(e,t){Fi(e);let a=ar(e,t);if(a.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Ps(e,null,a,t)}function er(e,t,a){if(Fi(e),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let n=ar(e,a);if(n.length!==2&&n.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Ps(e,t,n,a)}function Qg(e,t,a){if(Fi(e),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let n=ar(e,a);if(n.length!==3&&n.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return Ps(e,t,n,a)}function l7(e,t,a){if(Fi(e),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let n=ar(e,a);if(n.length!==4&&n.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Ps(e,t,n,a)}function u7(e,t,a){if(Fi(e),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let n=ar(e,a);if(n.length!==5&&n.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Ps(e,t,n,a)}function d7(e,t,a){if(Fi(e),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let n=ar(e,a);if(n.length!==6&&n.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(n.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||n,Ps(e,t,n,a)}var Qh={};Ke(Qh,{calculateShapes:()=>p7,validateInput:()=>e0,validateUpdateShape:()=>e3});function e3(e,t,a){let n=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: ${a.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${n}, and batchDim: ${r}.`;if(a.rank1?t.shape[n-1]:1,s=a.length,i=1;for(let c=r;c= 0 but got ${t}`);if(t>r)throw new Error(`'k' passed to topk() must be <= the last dimension (${r}) but got ${t}`);let s={x:n},i={k:t,sorted:a},[o,l]=L.runKernel(sl,s,i);return{values:o,indices:l}}var h7=z({topk_:E$});function M$(e,t=0,a=1,n,r){if(nn(e),n!=null&&n==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new jg(t,a,n,!0,r),i=Te(e,n);for(let o=0;o0,()=>"The input tensor must be at least 1D");let n={x:a},r={axis:t},[s,i]=L.runKernel(Pp,n,r);return{values:s,indices:i}}var f7=z({unique_:F$});function $$(e,t,a){let n=R(e,"x","unsortedSegmentSum"),r=R(t,"segmentIds","unsortedSegmentSum","int32");P(Zl(a),()=>"numSegments must be of dtype int");let s={x:n,segmentIds:r},i={numSegments:a};return L.runKernel(_p,s,i)}var g7=z({unsortedSegmentSum_:$$});function D$(e,t=0){let a=R(e,"x","unstack","string_or_numeric");P(t>=-a.shape.length&&t`Axis = ${t} is not in [-${a.shape.length}, ${a.shape.length})`);let n={value:a},r={axis:t};return L.runKernel(ju,n,r)}var Na=z({unstack_:D$});function y7(e,t){return qh(e,t,"right")}function x7(e,t=!0,a,n){return L.makeVariable(e,t,a,n)}function A7(e,t){let a=[];for(let s=0;s0,()=>"mask cannot be scalar"),Ca(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;fo).reverse()),P(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(i=>{P(i>=0&&i`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},s={perm:t};return n.dtype==="complex64"?Pe(()=>{let i=ru(n),o=Zp(n);return i=L.runKernel(Tr,{x:i},s),o=L.runKernel(Tr,{x:o},s),a&&(o=Vn(o)),Rr(i,o)}):L.runKernel(Tr,r,s)}var Si=z({transpose_:O$});function z$(e,t,a,n,r=!0){let s=R(e,"v","movingAverage"),i=R(t,"x","movingAverage"),o=R(a,"decay","movingAverage");eb(s,i),P(Er(s.shape,i.shape),()=>"Shape mismatch in v and x");let l=Ge(1),u=xe(l,o),d=te(xe(i,s),u);if(r){P(n!=null,()=>"When using zeroDebias: true, step is required.");let c=R(n,"step","movingAverage");d=ve(d,xe(l,tu(o,c)))}return we(s,d)}var v7=z({movingAverage_:z$});function L$(e,t,a){nn(a);let n=R(e,"indices","scatterND","int32"),r=R(t,"updates","scatterND");e0(r,n,a);let s={indices:n,updates:r},i={shape:a};return L.runKernel(Ho,s,i)}var w7=z({scatterND_:L$});function W$(e,t,a,n){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(a.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${a.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!==n.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function B$(e,t,a,n=0){nn(a);let r=R(e,"sparseIndices","sparseToDense","int32"),s=R(t,"sparseValues","sparseToDense","string_or_numeric"),i=R(n,"defaultValue","sparseToDense",s.dtype);W$(r,s,a,i);let o={sparseIndices:r,sparseValues:s,defaultValue:i},l={outputShape:a};return L.runKernel(tl,o,l)}var k7=z({sparseToDense_:B$});function V$(e,t){let a=R(t,"indices","gatherND","int32"),n={params:R(e,"x","gatherND","string_or_numeric"),indices:a};return L.runKernel(co,n)}var I7=z({gatherND_:V$});function U$(e,t){if(t==null)return e.shape.slice();if(Er(e.shape,t))return t;if(e.shape.length===t.length){let a=[];for(let n=0;n`x has to be a floating point tensor since it's going to be scaled, but got a ${r.dtype} tensor instead.`),P(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return e instanceof yt?r.clone():r;let s=U$(r,a),i=1-t,o=ve(Rg(we(Xh(s,0,1,"float32",n),i)),i);return te(r,o)}var S7=z({dropout_:G$});function a3(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function t0(e,t,a){let n=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 ${n.rank}`),P(n.rank-1===r.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${n.rank} and targets rank ${r.rank}`),Ca(n.shape.slice(0,n.shape.length-1),r.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=n.shape[n.shape.length-1];P(a>0&&a<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${a}`);let i=await n.data(),o=await r.data(),[l,u]=[i.length/s,s],d=_A("bool",l);for(let c=0;cg.value-f.value),d[c]=0;for(let f=0;fK$,depthwiseConv2d:()=>tD,matMul:()=>nD});function j$(e,t,a,n,r,s="NHWC",i){let o=e;e.rank===3&&(o=Q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=Q(t,[1,t.shape[0],t.shape[1],t.shape[2]])),P(o.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${o.shape}.`),P(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),P(a.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${a}.`);let u=s==="NHWC"?o.shape[3]:o.shape[1],d=s==="NHWC"?l.shape[3]:l.shape[1];P(u===a[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${a[2]}.`),P(d===a[3],()=>`Error in conv2dDerFilter: depth of dy (${d}) must match output depth for filter (${a[3]}).`),Mn("conv2dDerFilter",r,i);let c={x:o,dy:l},p={strides:n,pad:r,dataFormat:s,dimRoundingMode:i,filterShape:a};return L.runKernel(bp,c,p)}var q$=z({conv2DBackpropFilter_:j$});function a0(e,t,a){if(a==null||a==="linear")return e;if(a==="relu")return te(e,Jg(t));throw new Error(`Cannot compute gradient for fused activation ${a}.`)}function n0(e,t){let a=t,n=Ig(e.shape,t.shape);return n.length>0&&(a=ot(a,n)),Q(a,e.shape)}function r0(e,t,a,n){if(t==="linear")return e;if(t==="relu")return Jp(e);if(t==="elu")return Tg(e);if(t==="relu6")return Xg(e);if(t==="prelu")return Vg(e,a);if(t==="leakyrelu")return Fg(e,n);if(t==="sigmoid")return za(e);throw new Error(`Unknown fused activation ${t}.`)}var s0=(e,t)=>!(e>0)||t==="linear";function X$({x:e,filter:t,strides:a,pad:n,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:d}){if(l=l||"linear",s0(L.state.gradientDepth,l)===!1){P(r==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${r} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let S=qp(e,t,a,n,r,s,i);return o!=null&&(S=we(S,o)),r0(S,l,u,d)}let c=R(e,"x","conv2d","float32"),p=R(t,"filter","conv2d","float32"),h=c,m=!1;c.rank===3&&(m=!0,h=Q(c,[1,c.shape[0],c.shape[1],c.shape[2]])),P(h.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${h.rank}.`),P(p.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${p.rank}.`),Mn("fused conv2d",n,i);let f=r==="NHWC"?h.shape[3]:h.shape[1];P(p.shape[2]===f,()=>`Error in conv2d: depth of input (${f}) must match input depth for filter ${p.shape[2]}.`),P($r(a,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`);let g=Hp(h.shape,p.shape,a,s,n,i),y;o!=null&&(y=R(o,"bias","fused conv2d"),[y]=Et(y,c),r==="NHWC"?Ut(g.outShape,y.shape):(P(y.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${y.shape.length}.`),P(y.shape.length===0||y.shape[0]===g.outChannels||y.shape[0]===1,()=>`Error in fused conv2d: bias shape (${y.shape}) is not compatible with the number of output channels (${g.outChannels})`)));let x;if(u!=null){let S=u.shape;if(P(S.length<=1||S.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${S.length}.`),S.length===1)P(S[0]===1||S[0]===g.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${S}) is not compatible with the number of output channels (${g.outChannels}).`);else if(S.length===3)try{Ut(S,g.outShape)}catch(C){let N=`Error in fused conv2d: PReLU activation weights (${S}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(N)}x=R(u,"prelu weights","fused conv2d")}let A=(S,C)=>{P(r==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${r} but only NHWC is currently supported.`);let[N,M,F,E]=C,T=a0(S,F,l);P(ep(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let D=Gb(M.shape,T,N,a,n),O=q$(M,T,N.shape,a,n),W=[D,O];if(E!=null){let $=n0(E,T);W.push($)}return W},b={x:h,filter:p,bias:y,preluActivationWeights:x},w={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:d};return o==null?rr((S,C,N)=>{let M=L.runKernel(as,b,w);return N([C,S,M]),m&&(M=Q(M,[M.shape[1],M.shape[2],M.shape[3]])),{value:M,gradFunc:A}})(h,p):rr((S,C,N,M)=>{let F=L.runKernel(as,b,w);return M([C,S,F,N]),m&&(F=Q(F,[F.shape[1],F.shape[2],F.shape[3]])),{value:F,gradFunc:A}})(h,p,y)}var K$=z({fusedConv2d_:X$});function Y$(e,t,a,n,r,s=[1,1],i){let o=e;e.rank===3&&(o=Q(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let l=t;l.rank===3&&(l=Q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={x:o,dy:l},d={strides:n,pad:r,dimRoundingMode:i,dilations:s,filterShape:a};return L.runKernel(vp,u,d)}var Z$=z({depthwiseConv2dNativeBackpropFilter_:Y$});function J$(e,t,a,n,r,s=[1,1],i){let o=t,l=!1;t.rank===3&&(l=!0,o=Q(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={dy:o,filter:a},d={strides:n,pad:r,dimRoundingMode:i,dilations:s,inputShape:e},c=L.runKernel(wp,u,d);return l?Q(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var Q$=z({depthwiseConv2dNativeBackpropInput_:J$});function eD({x:e,filter:t,strides:a,pad:n,dataFormat:r="NHWC",dilations:s=[1,1],dimRoundingMode:i,bias:o,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:d}){if(s0(L.state.gradientDepth,l)===!1){let w=Gh(e,t,a,n,r,s,i);return o!=null&&(w=we(w,o)),r0(w,l,u,d)}let c=R(e,"x","depthwiseConv2d","float32"),p=R(t,"filter","depthwiseConv2d","float32"),h=c,m=!1;c.rank===3&&(m=!0,h=Q(c,[1,c.shape[0],c.shape[1],c.shape[2]])),P(h.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${h.rank}.`),P(p.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`),P(h.shape[3]===p.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${h.shape[3]}) must match the inChannels dimension in filter ${p.shape[2]}.`),s==null&&(s=[1,1]),P($r(a,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${s}'`),Mn("fused depthwiseConv2d",n,i);let f=Hp(h.shape,p.shape,a,s,n,i,!0),g;o!=null&&(g=R(o,"bias","fused conv2d"),[g]=Et(g,c),Ut(f.outShape,g.shape));let y;u!=null&&(y=R(u,"prelu weights","fused depthwiseConv2d"));let x=(w,S)=>{P(ep(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[C,N,M,F]=S,E=a0(w,M,l),T=Q$(N.shape,E,C,a,n,s,i),D=Z$(N,E,C.shape,a,n,s,i);if(F!=null){let O=n0(g,E);return[T,D,O]}return[T,D]},A={x:h,filter:p,bias:g,preluActivationWeights:y},b={strides:a,pad:n,dataFormat:r,dilations:s,dimRoundingMode:i,activation:l,leakyreluAlpha:d};return o==null?rr((w,S,C)=>{let N=L.runKernel(ns,A,b);return C([S,w,N]),m&&(N=Q(N,[N.shape[1],N.shape[2],N.shape[3]])),{value:N,gradFunc:x}})(h,p):rr((w,S,C,N)=>{let M=L.runKernel(ns,A,b);return N([S,w,M,C]),m&&(M=Q(M,[M.shape[1],M.shape[2],M.shape[3]])),{value:M,gradFunc:x}})(h,p,g)}var tD=z({fusedDepthwiseConv2d_:eD});function aD({a:e,b:t,transposeA:a=!1,transposeB:n=!1,bias:r,activation:s="linear",preluActivationWeights:i,leakyreluAlpha:o=.2}){if(s0(L.state.gradientDepth,s)===!1){let F=pt(e,t,a,n);return r!=null&&(F=we(F,r)),r0(F,s,i,o)}let l=R(e,"a","fused matMul"),u=R(t,"b","fused matMul");[l,u]=Et(l,u);let d=a?l.shape[l.rank-2]:l.shape[l.rank-1],c=n?u.shape[u.rank-1]:u.shape[u.rank-2],p=a?l.shape[l.rank-1]:l.shape[l.rank-2],h=n?u.shape[u.rank-2]:u.shape[u.rank-1],m=l.shape.slice(0,-2),f=u.shape.slice(0,-2),g=mt(m),y=mt(f);P(d===c,()=>`Error in fused matMul: inner shapes (${d}) and (${c}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${a} and transposeB=${n} must match.`);let x=Ut(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([p,h]),A=a?Q(l,[g,d,p]):Q(l,[g,p,d]),b=n?Q(u,[y,h,c]):Q(u,[y,c,h]),w;r!=null&&(w=R(r,"bias","fused matMul"),[w]=Et(w,l),Ut(x,w.shape));let S;i!=null&&(S=R(i,"prelu weights","fused matMul"));let C=(F,E)=>{let[T,D,O,W]=E,$=a0(Q(F,O.shape),O,s),U,G;if(!a&&!n?(U=pt($,D,!1,!0),G=pt(T,$,!0,!1)):!a&&n?(U=pt($,D,!1,!1),G=pt($,T,!0,!1)):a&&!n?(U=pt(D,$,!1,!0),G=pt(T,$,!1,!1)):(U=pt(D,$,!0,!0),G=pt($,T,!0,!0)),r!=null){let q=n0(W,$);return[U,G,q]}else return[U,G]},N={a:A,b,bias:w,preluActivationWeights:S},M={transposeA:a,transposeB:n,activation:s,leakyreluAlpha:o};return r==null?rr((F,E,T)=>{let D=L.runKernel(ts,N,M);return T([F,E,D]),{value:Q(D,x),gradFunc:C}})(A,b):rr((F,E,T,D)=>{let O=L.runKernel(ts,N,M);return D([F,E,O,T]),{value:Q(O,x),gradFunc:C}})(A,b,w)}var nD=z({fusedMatMul_:aD});function rD(e){return t0(e,.54,.46)}var sD=z({hammingWindow_:rD});function iD(e){return t0(e,.5,.5)}var C7=z({hannWindow_:iD});function oD(e,t,a,n=!1,r=0){let s=0,i=[];for(;s+t<=e.size;)i.push(_e(e,s,t)),s+=a;if(n)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${i.rank}.`),P(o.rank===2&&o.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${o.shape}.`),P(l.rank===1&&l.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${o.shape}.`),P(n.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${n.length}.`),P(n[0]>=1&&n[1]>=1,()=>`cropSize must be atleast [1,1], but was ${n}`),P(r==="bilinear"||r==="nearest",()=>`method must be bilinear or nearest, but was ${r}`);let d={image:i,boxes:o,boxInd:l},c={method:r,extrapolationValue:s,cropSize:n};return L.runKernel(ao,d,c)}var pD=z({cropAndResize_:dD});function cD(e){let t=R(e,"image","flipLeftRight","float32");P(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let a={image:t};return L.runKernel(uo,a,{})}var hD=z({flipLeftRight_:cD});function mD(e){let t=R(e,"image","grayscaleToRGB"),a=t.rank-1,n=t.shape[a];P(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),P(n===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${n}.`);let r=new Array(t.rank);return r.fill(1,0,a),r[a]=3,Qr(t,r)}var fD=z({grayscaleToRGB_:mD});function gD(e){let t=R(e,"image","RGBToGrayscale"),a=t.rank-1,n=t.shape[a];P(t.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`),P(n===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${n}.`);let r=t.dtype,s=Ue(t,"float32"),i=Vt([.2989,.587,.114]),o;switch(t.rank){case 2:o=hi("ij,j->i",s,i);break;case 3:o=hi("ijk,k->ij",s,i);break;case 4:o=hi("ijkl,l->ijk",s,i);break;case 5:o=hi("ijklm,m->ijkl",s,i);break;case 6:o=hi("ijklmn,n->ijklm",s,i);break;default:throw new Error("Not a valid tensor rank.")}return o=Bt(o,-1),Ue(o,r)}var yD=z({rgbToGrayscale_:gD});function xD(e,t,a=0,n=.5){let r=R(e,"image","rotateWithOffset","float32");P(r.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${r.rank}.`);let s={image:r},i={radians:t,fillValue:a,center:n};return L.runKernel(ol,s,i)}var AD=z({rotateWithOffset_:xD});function Yu(e,t,a,n,r,s){n==null&&(n=.5),r==null&&(r=Number.NEGATIVE_INFINITY),s==null&&(s=0);let i=e.shape[0];return a=Math.min(a,i),P(0<=n&&n<=1,()=>`iouThreshold must be in [0, 1], but was '${n}'`),P(e.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),P(e.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),P(t.rank===1,()=>"scores must be a 1D tensor"),P(t.shape[0]===i,()=>`scores has incompatible shape with boxes. Expected ${i}, but was ${t.shape[0]}`),P(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:a,iouThreshold:n,scoreThreshold:r,softNmsSigma:s}}function bD(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppression","float32"),i=R(t,"scores","nonMaxSuppression","float32"),o=Yu(s,i,a,n,r);a=o.maxOutputSize,n=o.iouThreshold,r=o.scoreThreshold;let l={maxOutputSize:a,iouThreshold:n,scoreThreshold:r};return L.runKernel(Mo,{boxes:s,scores:i},l)}var vD=z({nonMaxSuppression_:bD});function wD(e,t,a){let n=kD(e,t,a),r=n<0?-(n+1):n;e.splice(r,0,t)}function kD(e,t,a){return SD(e,t,a||ID)}function ID(e,t){return e>t?1:e>>1);let o=a(t,e[s]);o>0?n=s+1:(r=s,i=!o)}return i?n:-n-1}function R7(e,t,a,n,r){return r3(e,t,a,n,r,0)}function E7(e,t,a,n,r,s){return r3(e,t,a,n,r,0,!1,s,!0)}function M7(e,t,a,n,r,s){return r3(e,t,a,n,r,s,!0)}function r3(e,t,a,n,r,s,i=!1,o=!1,l=!1){let u=[];for(let g=0;gr&&u.push({score:t[g],boxIndex:g,suppressBeginIndex:0});u.sort(c5);let d=s>0?-.5/s:0,c=[],p=[];for(;c.length0;){let g=u.pop(),{score:y,boxIndex:x,suppressBeginIndex:A}=g;if(y=A;--w){let S=TD(e,x,c[w]);if(S>=n){b=!0;break}if(g.score=g.score*CD(n,d,S),g.score<=r)break}g.suppressBeginIndex=c.length,b||(g.score===y?(c.push(x),p.push(g.score)):g.score>r&&wD(u,g,c5))}let h=c.length,m=a-h;o&&m>0&&(c.push(...new Array(m).fill(0)),p.push(...new Array(m).fill(0)));let f={selectedIndices:c};return i&&(f.selectedScores=p),l&&(f.validOutputs=h),f}function TD(e,t,a){let n=e.subarray(t*4,t*4+4),r=e.subarray(a*4,a*4+4),s=Math.min(n[0],n[2]),i=Math.min(n[1],n[3]),o=Math.max(n[0],n[2]),l=Math.max(n[1],n[3]),u=Math.min(r[0],r[2]),d=Math.min(r[1],r[3]),c=Math.max(r[0],r[2]),p=Math.max(r[1],r[3]),h=(o-s)*(l-i),m=(c-u)*(p-d);if(h<=0||m<=0)return 0;let f=Math.max(s,u),g=Math.max(i,d),y=Math.min(o,c),x=Math.min(l,p),A=Math.max(y-f,0)*Math.max(x-g,0);return A/(h+m-A)}function CD(e,t,a){let n=Math.exp(t*a*a);return a<=e?n:0}function c5(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}async function ND(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY){let s=R(e,"boxes","nonMaxSuppressionAsync"),i=R(t,"scores","nonMaxSuppressionAsync"),o=Yu(s,i,a,n,r);a=o.maxOutputSize,n=o.iouThreshold,r=o.scoreThreshold;let l=await Promise.all([s.data(),i.data()]),u=l[0],d=l[1],{selectedIndices:c}=R7(u,d,a,n,r);return s!==e&&s.dispose(),i!==t&&i.dispose(),Vt(c,"int32")}var RD=ND;function ED(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=Yu(i,o,a,n,r,s);a=l.maxOutputSize,n=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let u={boxes:i,scores:o},d={maxOutputSize:a,iouThreshold:n,scoreThreshold:r,softNmsSigma:s},c=L.runKernel(Fo,u,d);return{selectedIndices:c[0],selectedScores:c[1]}}var MD=z({nonMaxSuppressionWithScore_:ED});async function FD(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=0){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=Yu(i,o,a,n,r,s);a=l.maxOutputSize,n=l.iouThreshold,r=l.scoreThreshold,s=l.softNmsSigma;let u=await Promise.all([i.data(),o.data()]),d=u[0],c=u[1],{selectedIndices:p,selectedScores:h}=M7(d,c,a,n,r,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Vt(p,"int32"),selectedScores:Vt(h)}}var $D=FD;function DD(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppression"),o=R(t,"scores","nonMaxSuppression"),l=Yu(i,o,a,n,r,null),u=l.maxOutputSize,d=l.iouThreshold,c=l.scoreThreshold,p={boxes:i,scores:o},h={maxOutputSize:u,iouThreshold:d,scoreThreshold:c,padToMaxOutputSize:s},m=L.runKernel(Eu,p,h);return{selectedIndices:m[0],validOutputs:m[1]}}var PD=z({nonMaxSuppressionPadded_:DD});async function _D(e,t,a,n=.5,r=Number.NEGATIVE_INFINITY,s=!1){let i=R(e,"boxes","nonMaxSuppressionAsync"),o=R(t,"scores","nonMaxSuppressionAsync"),l=Yu(i,o,a,n,r,null),u=l.maxOutputSize,d=l.iouThreshold,c=l.scoreThreshold,[p,h]=await Promise.all([i.data(),o.data()]),{selectedIndices:m,validOutputs:f}=E7(p,h,u,d,c,s);return i!==e&&i.dispose(),o!==t&&o.dispose(),{selectedIndices:Vt(m,"int32"),validOutputs:Ge(f,"int32")}}var OD=_D;function zD(e,t,a=!1,n=!1){let r=R(e,"images","resizeBilinear");P(r.rank===3||r.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${r.rank}.`),P(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),P(n===!1||a===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=Q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:a,halfPixelCenters:n,size:t},u=L.runKernel(Bo,o,l);return i?Q(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var LD=z({resizeBilinear_:zD});function WD(e,t,a=!1,n=!1){let r=R(e,"images","resizeNearestNeighbor");P(r.rank===3||r.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${r.rank}.`),P(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),P(r.dtype==="float32"||r.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),P(n===!1||a===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=r,i=!1;r.rank===3&&(i=!0,s=Q(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let[]=t,o={images:s},l={alignCorners:a,halfPixelCenters:n,size:t},u=L.runKernel(Wo,o,l);return i?Q(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var BD=z({resizeNearestNeighbor_:WD});function VD(e,t="binary",a=!1,n=.5){let r=R(e,"image","threshold"),s=.2989,i=.587,o=.114,l=r.shape[0]*r.shape[1],u=te(Vt([n]),255),d,c,p,h;if(P(r.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${r.rank}.`),P(r.shape[2]===3||r.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${r.shape[2]}.`),P(r.dtype==="int32"||r.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${r.dtype}.`),P(t==="otsu"||t==="binary",()=>`Method must be binary or otsu, but was ${t}`),r.shape[2]===3){[d,c,p]=Sa(r,[1,1,1],-1);let f=te(d,s),g=te(c,i),y=te(p,o);h=we(we(f,g),y)}else h=e;if(t==="otsu"){let f=kg(Ue(Kg(h),"int32"),Ve([]),256);u=UD(f,l)}let m=a?Hh(h,u):Yp(h,u);return Ue(te(m,255),"int32")}function UD(e,t){let a=Vt([-1]),n=Vt([0]),r=Vt([0]),s,i,o,l,u,d;for(let c=0;c`Error in transform: image must be rank 4,but got rank ${i.rank}.`),P(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"),P(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let l={image:i,transforms:o},u={interpolation:a,fillMode:n,fillValue:r,outputShape:s};return L.runKernel(il,l,u)}var jD=z({transform_:HD});function qD(e,t,a){let n=R(e,"a","bandPart");P(n.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${n.rank}.`);let r=n.shape,[s,i]=n.shape.slice(-2),o,l;typeof t=="number"?(P(t%1===0,()=>`bandPart(): numLower must be an integer, got ${t}.`),P(t<=s,()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`),o=R(t<0?s:t,"numLower","bandPart")):(P(t.dtype==="int32",()=>"bandPart(): numLower's dtype must be an int32."),o=Cr(bh(t,0),s,np(t,s))),typeof a=="number"?(P(a%1===0,()=>`bandPart(): numUpper must be an integer, got ${a}.`),P(a<=i,()=>`bandPart(): numUpper (${a}) must not be greater than the number of columns (${i}).`),l=R(a<0?i:a,"numUpper","bandPart")):(P(a.dtype==="int32",()=>"bandPart(): numUpper's dtype must be an int32."),l=Cr(bh(a,0),i,np(a,i)));let u=Q(nu(0,s,1,"int32"),[-1,1]),d=nu(0,i,1,"int32"),c=xe(u,d),p=tp(Hh(c,o),Mg(c,Vn(l))),h=An([s,i],n.dtype);return Q(ca(Na(Q(n,[-1,s,i])).map(m=>Cr(p,m,h))),r)}var XD=z({bandPart_:qD});function KD(e){let t;if(Array.isArray(e)){t=!1,P(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=Sa(e,e.shape[0],0).map(r=>Oe(r,[0]));P(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let a=[],n=e;for(let r=0;r{let s=n[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 h5(e,t);{let a=e.shape.slice(0,e.shape.length-2).reduce((l,u)=>l*u),n=Na(Q(e,[a,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),r=[],s=[];n.forEach(l=>{let[u,d]=h5(l,t);r.push(u),s.push(d)});let i=Q(ca(r,0),e.shape),o=Q(ca(s,0),e.shape);return[i,o]}}function h5(e,t=!1){return L.tidy(()=>{P(e.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let a=e.shape[0],n=e.shape[1],r=Ng(a),s=Ia(e),i=er([[1]],[1,1]),o=Ia(i),l=a>=n?n:a;for(let u=0;u{let h=_e(s,[u,u],[a-u,1]),m=Kp(h),f=_e(s,[u,u],[1,1]),g=Cr(Yp(f,0),er([[-1]]),er([[1]])),y=xe(f,te(g,m)),x=ve(h,y);x.shape[0]===1?o=Ia(i):o=lt([i,_e(x,[1,0],[x.shape[0]-1,x.shape[1]])],0);let A=Vn(ve(pt(g,y),m)),b=_e(s,[u,0],[a-u,n]),w=te(A,o),S=Si(o);if(u===0)s=xe(b,pt(w,pt(S,b)));else{let M=xe(b,pt(w,pt(S,b)));s=lt([_e(s,[0,0],[u,n]),M],0)}let C=Si(w),N=_e(r,[0,u],[a,r.shape[1]-u]);if(u===0)r=xe(N,pt(pt(N,o),C));else{let M=xe(N,pt(pt(N,o),C));r=lt([_e(r,[0,0],[a,u]),M],1)}return[o,s,r]}),J([d,c,p])}return!t&&a>n&&(r=_e(r,[0,0],[a,n]),s=_e(s,[0,0],[n,n])),[r,s]})}var JD=z({qr_:ZD}),wa;(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"})(wa||(wa={}));function QD(e,t,a=wa.SUM_BY_NONZERO_WEIGHTS){let n=R(e,"losses","computeWeightedLoss"),r=null;t!=null&&(r=R(t,"weights","computeWeightedLoss"));let s=r==null?n:te(n,r);if(a===wa.NONE)return s;if(a===wa.SUM)return ot(s);if(a===wa.MEAN){if(r==null)return ap(s);{let i=n.size/r.size,o=ve(ot(s),ot(r));return i>1?ve(o,Ge(i)):o}}if(a===wa.SUM_BY_NONZERO_WEIGHTS){if(r==null)return ve(ot(s),Ge(n.size));{let i=te(r,Yr(n.shape)),o=Ue(ot(Wg(i,Ge(0))),"float32");return ve(ot(s),o)}}throw Error(`Unknown reduction: ${a}`)}var Dr=z({computeWeightedLoss_:QD});function eP(e,t,a,n=wa.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"labels","absoluteDifference"),s=R(t,"predictions","absoluteDifference"),i=null;a!=null&&(i=R(a,"weights","absoluteDifference")),Ca(r.shape,s.shape,"Error in absoluteDifference: ");let o=Ja(xe(r,s));return Dr(o,i,n)}var tP=z({absoluteDifference_:eP});function aP(e,t,a,n,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","cosineDistance"),i=R(t,"predictions","cosineDistance"),o=null;n!=null&&(o=R(n,"weights","cosineDistance")),Ca(s.shape,i.shape,"Error in cosineDistance: ");let l=Ge(1),u=xe(l,ot(te(s,i),a,!0));return Dr(u,o,r)}var nP=z({cosineDistance_:aP});function rP(e,t,a,n=wa.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"labels","hingeLoss"),s=R(t,"predictions","hingeLoss"),i=null;a!=null&&(i=R(a,"weights","hingeLoss")),Ca(r.shape,s.shape,"Error in hingeLoss: ");let o=Ge(1);r=xe(te(Ge(2),r),o);let l=Jp(xe(o,te(r,s)));return Dr(l,i,n)}var sP=z({hingeLoss_:rP});function iP(e,t,a,n=1,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","huberLoss"),i=R(t,"predictions","huberLoss"),o=null;a!=null&&(o=R(a,"weights","huberLoss")),Ca(s.shape,i.shape,"Error in huberLoss: ");let l=Ge(n),u=Ja(xe(i,s)),d=np(u,l),c=xe(u,d),p=we(te(Ge(.5),En(d)),te(l,c));return Dr(p,o,r)}var oP=z({huberLoss_:iP});function lP(e,t,a,n=1e-7,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"labels","logLoss"),i=R(t,"predictions","logLoss"),o=null;a!=null&&(o=R(a,"weights","logLoss")),Ca(s.shape,i.shape,"Error in logLoss: ");let l=Ge(1),u=Ge(n),d=Vn(te(s,au(we(i,u)))),c=te(xe(l,s),au(we(xe(l,i),u))),p=xe(d,c);return Dr(p,o,r)}var uP=z({logLoss_:lP});function dP(e,t,a,n=wa.SUM_BY_NONZERO_WEIGHTS){let r=R(e,"labels","meanSquaredError"),s=R(t,"predictions","meanSquaredError"),i=null;a!=null&&(i=R(a,"weights","meanSquaredError")),Ca(r.shape,s.shape,"Error in meanSquaredError: ");let o=Zg(r,s);return Dr(o,i,n)}var pP=z({meanSquaredError_:dP});function cP(e,t){let a=R(e,"labels","sigmoidCrossEntropyWithLogits"),n=R(t,"logits","sigmoidCrossEntropyWithLogits");Ca(a.shape,n.shape,"Error in sigmoidCrossEntropyWithLogits: ");let r=Jp(n),s=te(n,a),i=$g(ls(Vn(Ja(n))));return we(xe(r,s),i)}function hP(e,t,a,n=0,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"multiClassLabels","sigmoidCrossEntropy"),i=R(t,"logits","sigmoidCrossEntropy"),o=null;if(a!=null&&(o=R(a,"weights","sigmoidCrossEntropy")),Ca(s.shape,i.shape,"Error in sigmoidCrossEntropy: "),n>0){let u=Ge(n),d=Ge(1),c=Ge(.5);s=we(te(s,xe(d,u)),te(c,u))}let l=cP(s,i);return Dr(l,o,r)}var mP=z({sigmoidCrossEntropy_:hP});function fP(e,t,a=-1){if(a===-1&&(a=t.rank-1),a!==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 ${a}`);return rr((n,r,s)=>{let i=Pg(r,[a],!0),o=xe(Ue(r,"float32"),i);s([n,o]);let l=Vn(te(o,n));return{value:ot(l,[a]),gradFunc:(u,d)=>{let[c,p]=d,h=Xp(u.shape,[a]);return[te(Q(u,h),xe(Ue(c,"float32"),ls(p))),te(Q(u,h),xe(ls(p),Ue(c,"float32")))]}}})(e,t)}function gP(e,t,a,n=0,r=wa.SUM_BY_NONZERO_WEIGHTS){let s=R(e,"onehotLabels","softmaxCrossEntropy"),i=R(t,"logits","softmaxCrossEntropy"),o=null;if(a!=null&&(o=R(a,"weights","softmaxCrossEntropy")),Ca(s.shape,i.shape,"Error in softmaxCrossEntropy: "),n>0){let u=Ge(n),d=Ge(1),c=Ge(s.shape[1]);s=we(te(s,xe(d,u)),ve(u,c))}let l=fP(s,i);return Dr(l,o,r)}var yP=z({softmaxCrossEntropy_:gP});function xP(e,t,a,n){let r=R(e,"indices","sparseFillEmptyRows","int32"),s=R(t,"values","sparseFillEmptyRows"),i=R(a,"denseShape","sparseFillEmptyRows","int32"),o=R(n,"defaultValue","sparseFillEmptyRows",s.dtype);if(r.rank!==2)throw new Error(`Indices should be Tensor2D but received shape + ${r.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(i.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${i.shape}`);if(o.rank!==0)throw new Error(`Default value should be a scalar but received shape ${o.shape}`);let l={indices:r,values:s,denseShape:i,defaultValue:o},u=L.runKernel(Mp,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}var AP=z({sparseFillEmptyRows_:xP});function bP(e,t,a){let n=R(e,"inputIndices","sparseReshape","int32"),r=R(t,"inputShape","sparseReshape","int32"),s=R(a,"newShape","sparseReshape","int32");if(n.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape + ${n.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:n,inputShape:r,newShape:s},o=L.runKernel(Bu,i);return{outputIndices:o[0],outputShape:o[1]}}var vP=z({sparseReshape_:bP});function wP(e,t,a){let n=R(e,"data","sparseSegmentMean"),r=R(t,"indices","sparseSegmentMean","int32"),s=R(a,"segmentIds","sparseSegmentMean","int32");if(n.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${s.shape}`);let i={data:n,indices:r,segmentIds:s};return L.runKernel(Fu,i)}var E$=z({sparseSegmentMean_:R$});function M$(e,t,a){let n=R(e,"data","sparseSegmentSum"),r=R(t,"indices","sparseSegmentSum","int32"),s=R(a,"segmentIds","sparseSegmentSum","int32");if(n.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape + ${s.shape}`);let i={data:n,indices:r,segmentIds:s};return L.runKernel(Vu,i)}var kP=z({sparseSegmentMean_:wP});function IP(e,t,a){let n=R(e,"data","sparseSegmentSum"),r=R(t,"indices","sparseSegmentSum","int32"),s=R(a,"segmentIds","sparseSegmentSum","int32");if(n.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${r.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${s.shape}`);let i={data:n,indices:r,segmentIds:s};return L.runKernel(Du,i)}var P$=z({sparseSegmentSum_:M$});function _$(e,t,a,n,r,s,i,o){let l=R(e,"data","stringNGrams","string");if(l.dtype!=="string")throw new Error("Data must be of datatype string");if(l.shape.length!==1)throw new Error(`Data must be a vector, saw: ${l.shape}`);let u=R(t,"dataSplits","stringNGrams");if(u.dtype!=="int32")throw new Error("Data splits must be of datatype int32");let p={separator:a,nGramWidths:n,leftPad:r,rightPad:s,padWidth:i,preserveShortSequences:o},c={data:l,dataSplits:u},d=L.runKernel(Ou,c,p);return{nGrams:d[0],nGramsSplits:d[1]}}var $$=z({stringNGrams_:_$});function F$(e,t,a=!0){let n=R(e,"input","stringSplit","string"),r=R(t,"delimiter","stringSplit","string");if(n.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${n.shape}`);if(r.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);let s={skipEmpty:a},i={input:n,delimiter:r},o=L.runKernel(Sp,i,s);return{indices:o[0],values:o[1],shape:o[2]}}var D$=z({stringSplit_:F$});function O$(e,t){let a=R(e,"input","stringToHashBucketFast","string"),n={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");let r={input:a};return L.runKernel(Cp,r,n)}var z$=z({stringToHashBucketFast_:O$});function L$(e,t,a,n=!0){let r=R(e,"input","staticRegexReplace","string"),s={pattern:t,rewrite:a,replaceGlobal:n};return L.runKernel(Ip,{x:r},s)}var W$=z({staticRegexReplace_:L$}),c7={fft:Uh,ifft:Kd,rfft:Gh,irfft:Bg},h7={hammingWindow:c_,hannWindow:o7,frame:l7,stft:g_},fe={flipLeftRight:b_,grayscaleToRGB:w_,resizeNearestNeighbor:X_,resizeBilinear:j_,rgbToGrayscale:I_,rotateWithOffset:C_,cropAndResize:x_,nonMaxSuppression:N_,nonMaxSuppressionAsync:D_,nonMaxSuppressionWithScore:z_,nonMaxSuppressionWithScoreAsync:W_,nonMaxSuppressionPadded:V_,nonMaxSuppressionPaddedAsync:G_,threshold:Z_,transform:Q_},m7={bandPart:t$,gramSchmidt:n$,qr:s$},f7={absoluteDifference:l$,computeWeightedLoss:Rr,cosineDistance:d$,hingeLoss:c$,huberLoss:m$,logLoss:g$,meanSquaredError:x$,sigmoidCrossEntropy:v$,softmaxCrossEntropy:I$},g7={sparseFillEmptyRows:C$,sparseReshape:N$,sparseSegmentMean:E$,sparseSegmentSum:P$},y7={stringNGrams:$$,stringSplit:D$,stringToHashBucketFast:z$,staticRegexReplace:W$},x7={};Ze(x7,{Serializable:()=>A7,SerializationMap:()=>b7,getRegisteredName:()=>V$,registerClass:()=>v7});var B$=new Map,f1=new Map,A7=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},b7=class Ol{constructor(){this.classNameMap={}}static getMap(){return Ol.instance==null&&(Ol.instance=new Ol),Ol.instance}static register(t){Ol.getMap().classNameMap[t.className]=[t,t.fromConfig]}};function v7(e,t,a){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."),typeof t=="undefined"&&(t="Custom"),typeof a=="undefined"&&(a=e.className);let n=a,r=t+">"+n;return b7.register(e),B$.set(r,e),f1.set(e,r),e}function V$(e){return f1.has(e)?f1.get(e):e.className}var ps=class extends A7{minimize(e,t=!1,a){let{value:n,grads:r}=this.computeGradients(e,a);if(a!=null){let s=a.map(i=>({name:i.name,tensor:r[i.name]}));this.applyGradients(s)}else this.applyGradients(r);return J(r),t?n:(n.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return Yb(e,t)}dispose(){this.iterations_!=null&&J(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:Ge(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(ps,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var Yg=class extends ps{static get className(){return"Adadelta"}constructor(e,t,a=null){super(),this.learningRate=e,this.rho=t,this.epsilon=a,this.accumulatedGrads=[],this.accumulatedUpdates=[],a==null&&(this.epsilon=L.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,a)=>{let n=L.registeredVariables[t],r=!1;this.accumulatedGrads[a]==null&&(this.accumulatedGrads[a]={originalName:`${t}/accum_grad`,variable:De(()=>Ja(n).variable(r))}),this.accumulatedUpdates[a]==null&&(this.accumulatedUpdates[a]={originalName:`${t}/accum_var`,variable:De(()=>Ja(n).variable(r))});let s=Array.isArray(e)?e[a].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[a].variable,o=this.accumulatedUpdates[a].variable;De(()=>{let l=we(te(i,this.rho),te(Tn(s),1-this.rho)),u=te(ve(Qn(we(o,this.epsilon)),Qn(we(i,this.epsilon))),s),p=we(te(o,this.rho),te(Tn(u),1-this.rho));i.assign(l),o.assign(p);let c=we(te(u,-this.learningRate),n);n.assign(c)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(J(this.accumulatedGrads.map(e=>e.variable)),J(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,a=!1;this.accumulatedGrads=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.accumulatedUpdates=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(a)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}},Zg=class extends ps{static get className(){return"Adagrad"}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,a)=>{let n=L.registeredVariables[t];this.accumulatedGrads[a]==null&&(this.accumulatedGrads[a]={originalName:`${t}/accumulator`,variable:De(()=>sr(n.shape,this.initialAccumulatorValue).variable(!1))});let r=Array.isArray(e)?e[a].tensor:e[t];if(r==null)return;let s=this.accumulatedGrads[a].variable;De(()=>{let i=we(s,Tn(r));s.assign(i);let o=we(te(ve(r,Qn(we(i,L.backend.epsilon()))),-this.learningRate),n);n.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&J(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(a=>({originalName:a.name,variable:a.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}},Jg=class extends ps{static get className(){return"Adam"}constructor(e,t,a,n=null){super(),this.learningRate=e,this.beta1=t,this.beta2=a,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],De(()=>{this.accBeta1=Ge(t).variable(),this.accBeta2=Ge(a).variable()}),n==null&&(this.epsilon=L.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(a=>a.name):Object.keys(e);De(()=>{let a=xe(1,this.accBeta1),n=xe(1,this.accBeta2);t.forEach((r,s)=>{let i=L.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:De(()=>Ja(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${r}/v`,variable:De(()=>Ja(i).variable(o))});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let u=this.accumulatedFirstMoment[s].variable,p=this.accumulatedSecondMoment[s].variable,c=we(te(u,this.beta1),te(l,1-this.beta1)),d=we(te(p,this.beta2),te(Tn(l),1-this.beta2)),h=ve(c,a),m=ve(d,n);u.assign(c),p.assign(d);let f=we(te(ve(h,we(Qn(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(te(this.accBeta1,this.beta1)),this.accBeta2.assign(te(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&J(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&J(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),De(()=>{this.accBeta1.assign(ql(this.beta1,this.iterations_+1)),this.accBeta2.assign(ql(this.beta2,this.iterations_+1))});let t=e.length/2,a=!1;this.accumulatedFirstMoment=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(a)}))}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)}},Qg=class extends ps{static get className(){return"Adamax"}constructor(e,t,a,n=null,r=0){super(),this.learningRate=e,this.beta1=t,this.beta2=a,this.epsilon=n,this.decay=r,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],De(()=>{this.iteration=Ge(0).variable(),this.accBeta1=Ge(t).variable()}),n==null&&(this.epsilon=L.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(a=>a.name):Object.keys(e);De(()=>{let a=xe(1,this.accBeta1),n=ve(-this.learningRate,we(te(this.iteration,this.decay),1));t.forEach((r,s)=>{let i=L.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:Ja(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${r}/v`,variable:Ja(i).variable(o)});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let u=this.accumulatedFirstMoment[s].variable,p=this.accumulatedWeightedInfNorm[s].variable,c=we(te(u,this.beta1),te(l,1-this.beta1)),d=te(p,this.beta2),h=Ya(l),m=Eg(d,h);u.assign(c),p.assign(m);let f=we(te(ve(n,a),ve(c,we(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(we(this.iteration,1)),this.accBeta1.assign(te(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&J(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&J(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)}},Jh=class extends ps{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,a)=>{let n=Array.isArray(e)?e[a].tensor:e[t];if(n==null)return;let r=L.registeredVariables[t];De(()=>{let s=we(te(this.c,n),r);r.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=zn(Ge(-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)}},e3=class extends Jh{static get className(){return"Momentum"}constructor(e,t,a=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=a,this.accumulations=[],this.m=Ge(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,a)=>{let n=L.registeredVariables[t];this.accumulations[a]==null&&(this.accumulations[a]={originalName:`${t}/momentum`,variable:De(()=>Ja(n).variable(!1))});let r=this.accumulations[a].variable,s=Array.isArray(e)?e[a].tensor:e[t];s!=null&&De(()=>{let i,o=we(te(this.m,r),s);this.useNesterov?i=we(te(this.c,we(s,te(o,this.m))),n):i=we(te(this.c,o),n),r.assign(o),n.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&J(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(a=>({originalName:a.name,variable:a.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)}},t3=class extends ps{static get className(){return"RMSProp"}constructor(e,t=.9,a=0,n=null,r=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=a,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,n==null&&(this.epsilon=L.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,a)=>{let n=L.registeredVariables[t],r=!1;this.accumulatedMeanSquares[a]==null&&(this.accumulatedMeanSquares[a]={originalName:`${t}/rms`,variable:De(()=>Ja(n).variable(r))}),this.accumulatedMoments[a]==null&&(this.accumulatedMoments[a]={originalName:`${t}/momentum`,variable:De(()=>Ja(n).variable(r))}),this.accumulatedMeanGrads[a]==null&&this.centered&&(this.accumulatedMeanGrads[a]={originalName:`${t}/mg`,variable:De(()=>Ja(n).variable(r))});let s=Array.isArray(e)?e[a].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[a].variable,o=this.accumulatedMoments[a].variable;De(()=>{let l=we(te(i,this.decay),te(Tn(s),1-this.decay));if(this.centered){let u=this.accumulatedMeanGrads[a].variable,p=we(te(u,this.decay),te(s,1-this.decay)),c=ve(te(s,this.learningRate),Qn(xe(l,we(Tn(p),this.epsilon)))),d=we(te(o,this.momentum),c);i.assign(l),u.assign(p),o.assign(d);let h=xe(n,d);n.assign(h)}else{let u=we(te(i,this.decay),te(Tn(s),1-this.decay)),p=we(te(o,this.momentum),ve(te(s,this.learningRate),Qn(we(u,this.epsilon))));i.assign(u),o.assign(p);let c=xe(n,p);n.assign(c)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&J(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&J(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&J(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,a=!1;this.accumulatedMeanSquares=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.accumulatedMoments=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})))}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)}},U$=[Yg,Zg,Jg,Qg,e3,t3,Jh];function G$(){for(let e of U$)v7(e)}var Xn={};Ze(Xn,{CompositeArrayBuffer:()=>Tr,browserFiles:()=>Z$,browserHTTPRequest:()=>aF,concatenateArrayBuffers:()=>hN,copyModel:()=>FN,decodeWeights:()=>BA,encodeWeights:()=>uN,fromMemory:()=>rF,fromMemorySync:()=>C7,getLoadHandlers:()=>vN,getModelArtifactsForJSON:()=>ig,getModelArtifactsForJSONSync:()=>UA,getModelArtifactsInfoForJSON:()=>_p,getSaveHandlers:()=>bN,getWeightSpecs:()=>GA,http:()=>n3,isHTTPScheme:()=>y1,listModels:()=>_N,loadWeights:()=>J$,moveModel:()=>DN,registerLoadRouter:()=>AN,registerSaveRouter:()=>xN,removeModel:()=>$N,weightsLoaderFactory:()=>k7,withSaveHandler:()=>sF,withSaveHandlerSync:()=>iF});var H$="model",j$=".json",q$=".weights.bin";function e5(e){return new Promise(t=>setTimeout(t)).then(e)}var fh=class g1{constructor(t){if(!B().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(g1.URL_SCHEME)&&(t=t.slice(g1.URL_SCHEME.length)),(t==null||t.length===0)&&(t=H$),this.modelJsonFileName=t+j$,this.weightDataFileName=t+q$}async save(t){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let a=Tr.join(t.weightData),n=window.URL.createObjectURL(new Blob([a],{type:"application/octet-stream"}));if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let r=[{paths:["./"+this.weightDataFileName],weights:t.weightSpecs}],s=VA(t,r),i=window.URL.createObjectURL(new Blob([JSON.stringify(s)],{type:"application/json"})),o=this.modelJsonAnchor==null?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=i,await e5(()=>o.dispatchEvent(new MouseEvent("click"))),t.weightData!=null){let l=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;l.download=this.weightDataFileName,l.href=n,await e5(()=>l.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:_p(t)}}}};fh.URL_SCHEME="downloads://";var X$=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.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise((e,t)=>{let a=new FileReader;a.onload=n=>{let r=JSON.parse(n.target.result),s=r.modelTopology;if(s==null){t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(r.weightsManifest==null){t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){e({modelTopology:s});return}let i=ig(r,o=>this.loadWeights(o));e(i)},a.onerror=n=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),a.readAsText(this.jsonFile)})}loadWeights(e){let t=[],a=[];for(let s of e)t.push(...s.weights),a.push(...s.paths);let n=this.checkManifestAndWeightFiles(e),r=a.map(s=>this.loadWeightsFile(s,n[s]));return Promise.all(r).then(s=>[t,s])}loadWeightsFile(e,t){return new Promise((a,n)=>{let r=new FileReader;r.onload=s=>{let i=s.target.result;a(i)},r.onerror=s=>n(`Failed to weights data from file of path '${e}'.`),r.readAsArrayBuffer(t)})}checkManifestAndWeightFiles(e){let t=[],a=this.weightsFiles.map(r=>Zx(r.name)),n={};for(let r of e)r.paths.forEach(s=>{let i=Zx(s);if(t.indexOf(i)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${i}'`);if(t.push(i),a.indexOf(i)===-1)throw new Error(`Weight file with basename '${i}' is not provided.`);n[s]=this.weightsFiles[a.indexOf(i)]});if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}},K$=e=>B().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(fh.URL_SCHEME)?Y$(e.slice(fh.URL_SCHEME.length)):null;fn.registerSaveRouter(K$);function Y$(e="model"){return new fh(e)}function Z$(e){return new X$(e)}function t5(e,t,a,n){i(e),a=a==null?0:a,n=n==null?1:n,o(a,n);let r=0,s=l=>(l.then(u=>{let p=a+ ++r/e.length*(n-a);return t(p),u}),l);function i(l){F(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function o(l,u){F(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),F(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),F(u>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${u}`)}return Promise.all(e.map(s))}async function w7(e,t){t==null&&(t={});let a=t.fetchFunc==null?B().platform.fetch:t.fetchFunc,n=e.map(u=>a(u,t.requestInit,{isBinary:!0})),r=0,s=.5,i=(t.onProgress==null?await Promise.all(n):await t5(n,t.onProgress,r,s)).map(u=>u.arrayBuffer()),o=.5,l=1;return t.onProgress==null?await Promise.all(i):await t5(i,t.onProgress,o,l)}async function J$(e,t="",a,n){return k7(r=>w7(r,{requestInit:n}))(e,t,a)}function k7(e){return async(t,a="",n)=>{let r=t.map(()=>!1),s={},i=n!=null?n.map(()=>!1):[],o=[];if(t.forEach((h,m)=>{let f=0;h.weights.forEach(g=>{let y="quantization"in g?g.quantization.dtype:g.dtype,x=u1[y]*vt(g.shape),A=()=>{r[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:g,groupOffset:f,sizeBytes:x})};n!=null?n.forEach((b,w)=>{b===g.name&&(A(),i[w]=!0)}):A(),o.push(g.name),f+=x})}),!i.every(h=>h)){let h=n.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),[]),u=[];l.forEach(h=>{t[h].paths.forEach(m=>{let f=a+(a.endsWith("/")?"":"/")+m;u.push(f)})});let p=await e(u),c={},d=0;return l.forEach(h=>{let m=t[h].paths.length,f=new Tr(p.slice(d,d+m));s[h].forEach(g=>{let y=f.slice(g.groupOffset,g.groupOffset+g.sizeBytes),x=BA(y,[g.manifestEntry]);for(let A in x)c[A]=x[A]}),d+=m}),c}}var Q$="application/octet-stream",eF="application/json",a3=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=B().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 a=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],n=VA(e,a);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:eF}),"model.json"),e.weightData!=null){let s=Tr.join(e.weightData);t.body.append("model.weights.bin",new Blob([s],{type:Q$}),"model.weights.bin")}let r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:_p(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(r){let s=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?s+=" 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.":s+=" Please make sure the server is serving valid JSON for this request.",new Error(s)}let a=t.modelTopology,n=t.weightsManifest;if(a==null&&n==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return ig(t,r=>this.loadWeights(r))}async loadWeights(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[a,n]=tF(t),r=this.weightPathPrefix||a,s=GA(e),i=[],o=[];for(let u of e)for(let p of u.paths)this.weightUrlConverter!=null?o.push(this.weightUrlConverter(p)):i.push(r+p+n);this.weightUrlConverter&&i.push(...await Promise.all(o));let l=await w7(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[s,l]}};a3.URL_SCHEME_REGEX=/^https?:\/\//;function tF(e){let t=e.lastIndexOf("/"),a=e.lastIndexOf("?"),n=e.substring(0,t),r=a>t?e.substring(a):"";return[n+"/",r]}function y1(e){return e.match(a3.URL_SCHEME_REGEX)!=null}var I7=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let a=!0;if(Array.isArray(e)?a=e.every(n=>y1(n)):a=y1(e),a)return n3(e,t)}return null};fn.registerSaveRouter(I7);fn.registerLoadRouter(I7);function n3(e,t){return new a3(e,t)}function aF(e,t){return n3(e,t)}var X2=class{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}},S7=class{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}},nF=class{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}};function rF(e,t,a,n){let r=arguments;return new nF(C7(...r))}function C7(e,t,a,n){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new X2(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 X2({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 X2({modelTopology:e,weightSpecs:t,weightData:a,trainingConfig:n}))}function sF(e){return new S7(e)}function iF(e){return new S7(e)}var T7={};Ze(T7,{confusionMatrix:()=>lF});function oF(e,t,a){let n=R(e,"labels","confusionMatrix"),r=R(t,"predictions","confusionMatrix");F(a==null||a>0&&Number.isInteger(a),()=>`If provided, numClasses must be a positive integer, but got ${a}`),F(n.rank===1,()=>`Expected the rank of labels to be 1, but got ${n.rank}`),F(r.rank===1,()=>`Expected the rank of predictions to be 1, but got ${r.rank}`),F(n.shape[0]===r.shape[0],()=>`Mismatch in the number of examples: ${n.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`),F(a>0&&Number.isInteger(a),()=>`numClasses is required to be a positive integer, but got ${a}`);let s=mh(Ue(n,"int32"),a),i=mh(Ue(r,"int32"),a),o=Zs(s),l=pt(o,i);return Ue(l,"int32")}var lF=z({confusionMatrix_:oF}),Er={};Ze(Er,{draw:()=>gF,fromPixels:()=>yF,fromPixelsAsync:()=>hF,toPixels:()=>fF});var Ds,a5=!1;function N7(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 a=!1,n=!1,r=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)a=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)n=!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(Ld(Od,L.backendName)!=null){let d={pixels:e},h={numChannels:t};return L.runKernel(Od,d,h)}let[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height],p;if(i)p=e.getContext("2d").getImageData(0,0,l,u).data;else if(n||a)p=e.data;else if(s||r||o){if(Ds==null)if(typeof document=="undefined")if(typeof OffscreenCanvas!="undefined"&&typeof OffscreenCanvasRenderingContext2D!="undefined")Ds=new OffscreenCanvas(1,1).getContext("2d");else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");else Ds=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});Ds.canvas.width=l,Ds.canvas.height=u,Ds.drawImage(e,0,0,l,u),p=Ds.getImageData(0,0,l,u).data}let c;if(t===4)c=new Int32Array(p);else{let d=l*u;c=new Int32Array(d*t);for(let h=0;h4||t===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if(e.dtype!=="float32"&&e.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}function mF(e){let t=(e==null?void 0:e.alpha)||1;if(t>1||t<0)throw new Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}async function fF(e,t){let a=R(e,"img","toPixels");if(!(e instanceof gt)){let u=a;a=Ue(u,"int32"),u.dispose()}R7(a);let[n,r]=a.shape.slice(0,2),s=a.rank===2?1:a.shape[2],i=await a.data(),o=a.dtype==="float32"?255:1,l=new Uint8ClampedArray(r*n*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${h}.`)}else if(a.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?(p[0]=h*o,p[1]=h*o,p[2]=h*o):p[d]=h*o}let c=u*4;l[c+0]=Math.round(p[0]),l[c+1]=Math.round(p[1]),l[c+2]=Math.round(p[2]),l[c+3]=Math.round(p[3])}if(t!=null){a5||Ld(mp,L.backendName)!=null&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),a5=!0),t.width=r,t.height=n;let u=t.getContext("2d"),p=new ImageData(l,r,n);u.putImageData(p,0,0)}return a!==e&&a.dispose(),l}function gF(e,t,a){let n=R(e,"img","draw");if(!(e instanceof gt)){let i=n;n=Ue(i,"int32"),i.dispose()}R7(n),mF(a==null?void 0:a.imageOptions);let r={image:n},s={canvas:t,options:a};L.runKernel(mp,r,s)}var yF=z({fromPixels_:N7}),r3={};Ze(r3,{prepareAndValidate:()=>E7});function E7(e,t){let a=e.shape.length,n=t.shape.length;if(a<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${a}.`);if(n<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${n}.`);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[n-1]>a)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[n-1]} vs. ${a}`);if(vt(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 c=0;cc/u),1].slice(0,s);return[l,i,u,p]}var Nt={};Ze(Nt,{assertParamsValid:()=>AF,computeFlatOffset:()=>IF,computeOutShape:()=>vF,getNormalizedAxes:()=>wF,isSliceContinous:()=>kF,maskToAxes:()=>bF,parseSliceParams:()=>SF,sliceInfo:()=>CF,startForAxis:()=>O7,startIndicesWithElidedDims:()=>$7,stopForAxis:()=>z7,stopIndicesWithElidedDims:()=>F7,stridesForAxis:()=>D7,stridesWithElidedDims:()=>M7});var x1=-2,xF=-1;function AF(e,t,a){let n=e.shape.length;F(n===t.length,()=>`Error in slice${n}D: Length of begin ${t} must match the rank of the array (${n}).`),F(n===a.length,()=>`Error in slice${n}D: Length of size ${a} must match the rank of the array (${n}).`);for(let r=0;r`Error in slice${n}D: begin[${r}] + size[${r}] (${t[r]+a[r]}) would overflow input.shape[${r}] (${e.shape[r]})`)}function bF(e){let t=[],a=0;for(;e>0;)e&1&&t.push(a),e/=2,a++;return t}function vF(e,t,a){let n=[];for(let r=0;r0){let h=t[0],m=a+1;p=$7(i,h,m,n,e),c=F7(o,h,m,r,e),d=M7(s,h,m,e)}else for(let h=0;h-1)s[o]=0;else{let l=P7(t,a,o),u=n[l];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let l=P7(t,a,o),u=n[l];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let l=n[r];return i<0&&(i+=l),i=Dd(0,i,l-1),i}function z7(e,t,a,n,r,s){let i=t[r],o=a[r]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let l=n[r];return i<0&&(i+=l),o>0?i=Dd(0,i,l):i=Dd(-1,i,l-1),i}function kF(e,t,a){let n=a.length;for(let r=0;r1){n=r;break}for(let r=n+1;r0||a[r]!==e[r])return!1;return!0}function IF(e,t){let a=e.length>0?e[e.length-1]:1;for(let n=0;n{F(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return a==null?s=new Array(r).fill(-1):typeof a=="number"?s=[a,...new Array(r-1).fill(-1)]:a.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]-n[o])),[n,s]}function CF(e,t,a,n,r,s,i,o,l){let u;if(n==null?(u=new Array(t.length),u.fill(1)):u=n,i!=null&&i&i-1)throw new Error("Multiple ellipses in slice is not allowed.");let p=!1,c={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:a.slice(),strides:u.slice(),beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};for(let x=0;x0?0:-1,d.strides[x]>0?b:b-1];if(A&&d.strides[x]<=0)throw Error("only stride 1 allowed on non-range indexing.");f=f&&d.strides[x]===1;let T=!!(d.beginMask&1<=b)throw Error(`slice index ${d.begin[x]} of dimension ${x} out of bounds.`)}else d.begin[x]=n5(d.begin[x],0,d.strides[x],b,w,I),d.end[x]=n5(d.end[x],1,d.strides[x],b,w,I);let P=d.strides[x]===1&&d.begin[x]===0&&d.end[x]===b;h=h&&P,m=m&&(x===0&&d.strides[x]===1||P)}else h=h&&d.strides[x]===1&&T,m=m&&(x===0&&d.strides[x]===1||T);let N,M=!1;if(d.beginValid&&d.endValid?(N=d.end[x]-d.begin[x],M=!0):A?(N=1,M=!0):T&&b>=0&&(d.strides[x]<0?N=-b:N=b,M=!0),M){let P;N===0||N<0!=d.strides[x]<0?P=0:P=Math.trunc(N/d.strides[x])+(N%d.strides[x]!==0?1:0),g.push(P)}else g.push(-1)}for(let x=0;x=0?y.push(g[A]):A===x1&&y.push(1)}return{finalShapeSparse:y.filter((x,A)=>d.finalShapeGatherIndices[A]!==x1),finalShape:y,isIdentity:h,sliceDim0:m,isSimpleSlice:f,begin:d.begin,end:d.end,strides:d.strides}}function TF(e,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let a=0;t.beginValid=e.begin!=null,t.endValid=e.end!=null,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let n=0;n0?s[t]:s[t+1&1];{let i=e<0?n+e:e;return is[1]?s[1]:i}}var s3="4.14.0",L7=class{static sgd(e){return new Jh(e)}static momentum(e,t,a=!1){return new e3(e,t,a)}static rmsprop(e,t=.9,a=0,n=null,r=!1){return new t3(e,t,a,n,r)}static adam(e=.001,t=.9,a=.999,n=null){return new Jg(e,t,a,n)}static adadelta(e=.001,t=.95,a=null){return new Yg(e,t,a)}static adamax(e=.002,t=.9,a=.999,n=null,r=0){return new Qg(e,t,a,n,r)}static adagrad(e,t=.1){return new Zg(e,t)}},NF=L7,RF=typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e();function W7(){return new Promise(e=>RF(()=>e()))}var C={};Ze(C,{ERF_A1:()=>jF,ERF_A2:()=>qF,ERF_A3:()=>XF,ERF_A4:()=>KF,ERF_A5:()=>YF,ERF_P:()=>HF,PARALLELIZE_THRESHOLD:()=>i3,RowPartitionType:()=>qn,SELU_SCALE:()=>GF,SELU_SCALEALPHA:()=>UF,applyActivation:()=>Yh,assertAndGetBroadcastShape:()=>Ut,assertAxesAreInnerMostDims:()=>AE,assertParamsConsistent:()=>EF,assignToTypedArray:()=>aD,axesAreInnerMostDims:()=>xg,calculateShapes:()=>H4,checkEinsumDimSizes:()=>lD,checkPadOnDimRoundingMode:()=>Nn,combineLocations:()=>Bb,combineRaggedTensorToTensorShapes:()=>PF,complexWithEvenIndex:()=>QF,complexWithOddIndex:()=>eD,computeConv2DInfo:()=>Op,computeConv3DInfo:()=>ub,computeDefaultPad:()=>pg,computeDilation2DInfo:()=>fR,computeOptimalWindowSize:()=>DF,computeOutAndReduceShapes:()=>xE,computeOutShape:()=>MF,computePool2DInfo:()=>lb,computePool3DInfo:()=>gR,convertConv2DDataFormat:()=>db,decodeEinsumEquation:()=>iD,eitherStridesOrDilationsAreOne:()=>Nr,expandShapeToKeepDim:()=>Wp,exponent:()=>rD,exponents:()=>nD,fromStringArrayToUint8:()=>RD,fromUint8ToStringArray:()=>ND,getAxesPermutation:()=>bE,getBroadcastDims:()=>Db,getComplexWithIndex:()=>tD,getEinsumComputePath:()=>uD,getEinsumPermutation:()=>oD,getFusedBiasGradient:()=>Kh,getFusedDyActivation:()=>Xh,getImageCenter:()=>OF,getInnerMostAxes:()=>wE,getPermuted:()=>LF,getRaggedRank:()=>$F,getReductionAxes:()=>fg,getReshaped:()=>zF,getReshapedPermuted:()=>WF,getRowPartitionTypesHelper:()=>_F,getSliceBeginCoords:()=>BF,getSliceSize:()=>VF,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>hD,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>mD,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>fD,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>xD,getSparseReshapeInputOutputMismatchErrorMessage:()=>bD,getSparseReshapeInputOutputMultipleErrorMessage:()=>AD,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>gD,getSparseReshapeNegativeOutputDimErrorMessage:()=>yD,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>ID,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>vD,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>wD,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>kD,getUndoAxesPermutation:()=>vE,isIdentityPermutation:()=>dD,log:()=>RT,mergeRealAndImagArrays:()=>ZF,prepareAndValidate:()=>E7,prepareSplitSize:()=>cD,segment_util:()=>B7,shouldFuse:()=>Zh,slice_util:()=>Nt,splitRealAndImagArrays:()=>JF,stridesOrDilationsArePositive:()=>Ys,tupleValuesAreOne:()=>Hd,upcastType:()=>da,validateDefaultValueShape:()=>FF,validateInput:()=>jh,validateUpdateShape:()=>Hg,warn:()=>Vr});function EF(e,t){let a=e[0].length;e.forEach((r,s)=>{F(r.length===a,()=>`Error in concat${a}D: rank of tensors[${s}] must be the same as the rank of the rest (${a})`)}),F(t>=0&&t`Error in concat${a}D: axis must be between 0 and ${a-1}.`);let n=e[0];e.forEach((r,s)=>{for(let i=0;i`Error in concat${a}D: Shape of tensors[${s}] (${r}) does not match the shape of the rest (${n}) along the non-concatenated axis ${s}.`)})}function MF(e,t){let a=e[0].slice();for(let n=1;n=0)if(o>=0){if(o!==s)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${s} but shape[${r+e}] = ${o}`)}else n[i]=s}return n}function _F(e){let t={FIRST_DIM_SIZE:qn.FIRST_DIM_SIZE,VALUE_ROWIDS:qn.VALUE_ROWIDS,ROW_LENGTHS:qn.ROW_LENGTHS,ROW_SPLITS:qn.ROW_SPLITS,ROW_LIMITS:qn.ROW_LIMITS,ROW_STARTS:qn.ROW_STARTS},a=[];for(let n of e)if(n in t)a.push(t[n]);else break;return a}function $F(e){return e.length===0?0:e[0]===qn.FIRST_DIM_SIZE?e.length-1:e.length}function FF(e,t){if(e==null||t==null)return;let a=e.length,n=t.length;if(a>=n)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${a} must be less than ragged tensor input flatValues.rank = ${n})`);for(let r=0;r=0&&i>=0&&s!==1&&s!==i)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${r-e.length}] = ${s} but ragged tensor input.flatValues.shape[${r-e.length}] = ${i}`)}}var i3=30;function DF(e){return e<=i3?e:uh(e,Math.floor(Math.sqrt(e)))}function OF(e,t,a){let n=a*(typeof e=="number"?e:e[0]),r=t*(typeof e=="number"?e:e[1]);return[n,r]}function zF(e,t,a,n=!0){let r=[];if(n)r=r.concat(t.slice(0)),r.push(e[0]/a),r=r.concat(e.slice(1));else{r=r.concat(e[0]);let s=t.length;for(let i=0;i=t*2+1||i%2===1?s.push(i):r.push(i);n.push(...r),n.push(0),n.push(...s)}return n}function WF(e,t,a,n=!0){let r=[];n?r.push(e[0]/a):r.push(e[0]*a);for(let s=1;s/g,r5=",",s5="...";function iD(e,t){e=e.replace(/\s/g,"");let a=(e.length-e.replace(sD,"").length)/K2.length;if(a<1)throw new Error("Equations without an arrow are not supported.");if(a>1)throw new Error(`Equation must contain exactly one arrow ("${K2}").`);let[n,r]=e.split(K2);F(n.indexOf(s5)===-1,()=>`The ellipsis notation ("${s5}") is not supported yet.`);let s=n.split(r5),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(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 d=0;dr!==-1),{permutationIndices:a,expandDims:n}}function lD(e,t,a){let n=new Array(e);for(let r=0;r`Expected dimension ${n[t[r][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function uD(e,t){let a=e,n=[],r=0;e.length===0&&a.push(-1),r=e.length+1;for(let i=0;it===a)}function pD(e,t){let a=[];for(let n=0;n"Number of splits must evenly divide the axis."),n=new Array(t).fill(e.shape[a]/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[a]-i}F(e.shape[a]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),n=t}return n}function hD(e){return`Received SparseTensor with denseShape[0] = 0 but - indices.shape[0] = ${e}`}function mD(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function fD(e,t,a){return`indices(${e}, 0) is invalid: ${t} >= ${a}`}function gD(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function yD(e,t){return`size ${e} must be non-negative, not ${t}`}function xD(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function AD(e,t){let a=vt(e),n=vt(t);return`Input to reshape is a SparseTensor with ${a} - dense values, but the requested shape requires a multiple of ${n}. inputShape=${e} outputShape= ${t}`}function bD(e,t){let a=vt(e),n=vt(t);return`Input to reshape is a tensor with ${a} dense values, but the requested shape has ${n}. inputShape=${e} outputShape=${t}`}function vD(){return"segment ids must be >= 0"}function wD(){return"segment ids are not increasing"}function kD(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function ID(e,t,a){return`Bad: indices[${e}] == ${t} out of range [0, ${a})`}var B7={};Ze(B7,{collectGatherOpShapeInfo:()=>TD,computeOutShape:()=>CD,segOpComputeOptimalWindowSize:()=>SD});function SD(e,t){let a=!1,n;for(e<=i3?(n=e,a=!0):n=uh(e,Math.floor(Math.sqrt(e)));!a;)n>t||n===e?a=!0:n=uh(e,n+1);return n}function CD(e,t,a){let n=[],r=e.length;for(let s=0;sr))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${n}`);if(n<0&&(n+=r),n>s)throw new Error(`batchDims (${n}) must be less than rank(x) ( - ${s}).`);if(adh(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function RD(e){return e.map(t=>Ep(t))}var Rn={};Ze(Rn,{nonMaxSuppressionV3Impl:()=>u7,nonMaxSuppressionV4Impl:()=>d7,nonMaxSuppressionV5Impl:()=>p7,whereImpl:()=>Q4});G$();var ED=B();ED.registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")});var Sn;(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_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",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",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"})(Sn||(Sn={}));var i5;(function(e){let t;(function(a){a[a.LEGACY=0]="LEGACY",a[a.V1=1]="V1",a[a.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(i5||(i5={}));var o3={};function MD(e,t){let a={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};o3[e]=a}function V7(e){return o3[e]}function PD(e){delete o3[e]}function k(e,t,a,n,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,u=o<0?t.inputNames.length+o:o;if(s.type==="tensor")return la(t.inputNames[u],a,n,r);if(s.type==="tensors"){let d=t.inputs.slice(o,l);return t.inputNames.slice(o,l).filter((h,m)=>{var f;return((f=d[m])===null||f===void 0?void 0:f.op)!=="NoOp"}).map(h=>la(h,a,n,r))}let p=la(t.inputNames[u],a,n,r),c=p.dataSync();return s.type==="number"?c[0]:v.toNestedArray(p.shape,c)}let i=t.attrParams[e];return i&&i.value}function la(e,t,a,n){let[r,s]=Ka(e,a);if(n!=null){let o=n.getHashTableHandleByName(r);if(o!=null)return o}let i=a.currentContextIds.find(o=>!!t[gh(r,o)]);return i!==void 0?t[gh(r,i)][s]:void 0}function o5(e,t,a){return t[gh(e,a.currentContextId)]}function Ar(e,t){let[a,n,r]=Ka(e,t);return[gh(a,t&&t.currentContextId),n,r]}function gh(e,t){return t?`${e}-${t}`:e}function Ka(e,t){if(e==="")return["",0,void 0];let a=t!=null&&t.parseNodeNameCache!=null;if(a){let s=t.parseNodeNameCache.get(e);if(s!=null)return s}let n=e.split(":"),r;if(n.length===1)r=[e,0,void 0];else{let s=n[0],i=n.length===3?n[1]:void 0,o=Number(n[n.length-1]);r=[s,o,i]}return a&&t.parseNodeNameCache.set(e,r),r}function eh(e,t,a){let n=k("pad",e,t,a);if(n==="explicit"){n=k("explicitPaddings",e,t,a);let r=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)r[s][0]=n[s*2],r[s][1]=n[s*2+1];return r}return n}function br(e){return e.kept?e:Ia(e)}var U7={};Ze(U7,{json:()=>_D});var _D=[{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}]}],G7={};Ze(G7,{json:()=>$D});var $D=[{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:"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}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],H7={};Ze(H7,{json:()=>FD});var FD=[{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:"TensorListConcatV2",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"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],j7={};Ze(j7,{json:()=>DD});var DD=[{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",defaultValue:.2}]},{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"}]}],q7={};Ze(q7,{json:()=>OD});var OD=[{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"}]},{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:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{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:"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:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,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"}]}],X7={};Ze(X7,{json:()=>zD});var zD=[{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}]}],K7={};Ze(K7,{json:()=>LD});var LD=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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"}]}],Y7={};Ze(Y7,{json:()=>WD});var WD=[{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"}]}],Z7={};Ze(Z7,{json:()=>BD});var BD=[{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"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],J7={};Ze(J7,{json:()=>VD});var VD=[{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"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],Q7={};Ze(Q7,{json:()=>UD});var UD=[{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}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],e6={};Ze(e6,{json:()=>GD});var GD=[{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:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{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"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],t6={};Ze(t6,{json:()=>HD});var HD=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{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"}]}],a6={};Ze(a6,{json:()=>jD});var jD=[{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"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",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"}]},{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"}]}],n6={};Ze(n6,{json:()=>qD});var qD=[{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}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],r6={};Ze(r6,{json:()=>XD});var XD=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],s6={};Ze(s6,{json:()=>KD});var KD=[{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}]}],i6={};Ze(i6,{json:()=>YD});var YD=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],o6={};Ze(o6,{json:()=>ZD});var ZD=[{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:"EnsureShape",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:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}],l5=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[U7,G7,H7,j7,q7,X7,K7,Y7,Z7,J7,Q7,e6,t6,a6,n6,r6,s6,i6,o6],t=[].concat(...e.map(a=>a.json));this.opMappers=t.reduce((a,n)=>(a[n.tfOpName]=n,a),{})}transformGraph(e,t={}){let a=e.node,n=[],r=[],s=[],i=a.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?n.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=[],u={},p={};t!=null&&(u=this.mapSignatureEntries(t.inputs),p=this.mapSignatureEntries(t.outputs));let c=Object.keys(i);c.forEach(m=>{let f=i[m];f.inputNames.forEach((g,y)=>{let[x,,A]=Ar(g),b=i[x];if(b.outputs!=null){let w=b.outputs.indexOf(A);if(w!==-1){let I=`${x}:${w}`;f.inputNames[y]=I}}f.inputs.push(b),b.children.push(f)})}),Object.keys(p).length===0?c.forEach(m=>{let f=i[m];f.children.length===0&&l.push(f)}):Object.keys(p).forEach(m=>{let[f]=Ar(m),g=i[f];g!=null&&(g.signatureKey=p[m],l.push(g))}),Object.keys(u).length>0?Object.keys(u).forEach(m=>{let[f]=Ar(m),g=i[f];g&&(g.signatureKey=u[m],o.push(g))}):o=n;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 h={nodes:i,inputs:o,outputs:l,weights:r,placeholders:n,signature:t,functions:d};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,a)=>(t[e[a].name]=a,t),{})}mapNode(e){let t=V7(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let a={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(n=>n.startsWith("^")?n.slice(1):n),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return t.inputs!=null&&(a.inputParams=t.inputs.reduce((n,r)=>(n[r.name]={type:r.type,inputIndexStart:r.start,inputIndexEnd:r.end},n),{})),t.attrs!=null&&(a.attrParams=t.attrs.reduce((n,r)=>{let s=r.type,i;switch(r.type){case"string":i=A1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=A1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"string[]":i=C1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=C1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number":i=v1(e.attr,r.tfName,r.defaultValue||0),i===void 0&&r.tfDeprecatedName&&(i=v1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number[]":i=S1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=S1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool":i=b1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=b1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool[]":i=N1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=N1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape":i=I1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=I1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape[]":i=T1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=T1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype":i=w1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=w1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype[]":i=k1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=k1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"func":i=u5(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=u5(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 n[r.name]={value:i,type:s},n},{})),a}mapFunction(e){let t=e.nodeDef,a=[],n=[],r={};t!=null&&(r=t.reduce((u,p)=>(u[p.name]=this.mapNode(p),p.op==="Const"&&n.push(u[p.name]),u),{}));let s=[],i=[];e.signature.inputArg.forEach(u=>{let[p]=Ar(u.name),c={name:p,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:l3(u.type),type:"dtype"}},children:[]};c.signatureKey=u.name,s.push(c),r[p]=c}),Object.keys(r).forEach(u=>{let p=r[u];p.inputNames.forEach((c,d)=>{let[h,,m]=Ar(c),f=r[h];if(f.outputs!=null){let g=f.outputs.indexOf(m);if(g!==-1){let y=`${h}:${g}`;p.inputNames[d]=y}}p.inputs.push(f),f.children.push(p)})});let o=e.ret;e.signature.outputArg.forEach(u=>{let[p,c]=Ar(o[u.name]),d=r[p];d!=null&&(d.defaultOutput=c,i.push(d))});let l=this.mapArgsToSignature(e);return{nodes:r,inputs:s,outputs:i,weights:n,placeholders:a,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,a)=>(t[a.name]=this.mapArgToTensorInfo(a),t),{}),outputs:e.signature.outputArg.reduce((t,a)=>(t[a.name]=this.mapArgToTensorInfo(a,e.ret),t),{})}}mapArgToTensorInfo(e,t){let a=e.name;return t!=null&&(a=t[a]),{name:a,dtype:e.type}}};function JD(e){let t=B().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 l6(e,t){let a=Array.isArray(e)?String.fromCharCode.apply(null,e):JD(e);return t?a:a.toLowerCase()}function A1(e,t,a,n=!1){let r=e[t];return r!=null?l6(r.s,n):a}function b1(e,t,a){let n=e[t];return n?n.b:a}function v1(e,t,a){let n=e[t]||{},r=n.i!=null?n.i:n.f!=null?n.f:a;return typeof r=="number"?r:parseInt(r,10)}function l3(e){switch(typeof e=="string"&&(e=Sn[e]),e){case Sn.DT_FLOAT:case Sn.DT_HALF:return"float32";case Sn.DT_INT32:case Sn.DT_INT64:case Sn.DT_INT8:case Sn.DT_UINT8:return"int32";case Sn.DT_BOOL:return"bool";case Sn.DT_DOUBLE:return"float32";case Sn.DT_STRING:return"string";default:return null}}function u5(e,t,a){let n=e[t];return n&&n.func?n.func.name:a}function w1(e,t,a){let n=e[t];return n&&n.type?l3(n.type):a}function k1(e,t,a){let n=e[t];return n&&n.list&&n.list.type?n.list.type.map(r=>l3(r)):a}function u6(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function I1(e,t,a){let n=e[t];return n&&n.shape?u6(n.shape):a}function S1(e,t,a){let n=e[t];return n?((n.list.f&&n.list.f.length?n.list.f:n.list.i)||[]).map(r=>typeof r=="number"?r:parseInt(r,10)):a}function C1(e,t,a,n=!1){let r=e[t];return r&&r.list&&r.list.s?r.list.s.map(s=>l6(s,n)):a}function T1(e,t,a){let n=e[t];return n&&n.list&&n.list.shape?n.list.shape.map(r=>u6(r)):a}function N1(e,t,a){let n=e[t];return n&&n.list&&n.list.b?n.list.b:a}var QD=class{constructor(e,t,a){this.node=e,this.tensorMap=t,this.context=a,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(n=>this.getInput(n)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((n,r)=>(n[r]=this.getAttr(r),n),{}))}getInput(e){return la(e,this.tensorMap,this.context)}getAttr(e,t){let a=this.node.rawAttrs[e];if(a.tensor!=null)return la(e,this.tensorMap,this.context);if(a.i!=null||a.f!=null)return v1(this.node.rawAttrs,e,t);if(a.s!=null)return A1(this.node.rawAttrs,e,t);if(a.b!=null)return b1(this.node.rawAttrs,e,t);if(a.shape!=null)return I1(this.node.rawAttrs,e,t);if(a.type!=null)return w1(this.node.rawAttrs,e,t);if(a.list!=null){if(a.list.i!=null||a.list.f!=null)return S1(this.node.rawAttrs,e,t);if(a.list.s!=null)return C1(this.node.rawAttrs,e,t);if(a.list.shape!=null)return T1(this.node.rawAttrs,e,t);if(a.list.b!=null)return N1(this.node.rawAttrs,e,t);if(a.list.type!=null)return k1(this.node.rawAttrs,e,t)}return t}},Qt={};Ze(Qt,{OP_SCOPE_SUFFIX:()=>rg,abs:()=>Ya,acos:()=>JA,acosh:()=>QA,add:()=>we,addN:()=>Fh,all:()=>eb,any:()=>tb,argMax:()=>rr,argMin:()=>ab,asin:()=>nb,asinh:()=>rb,atan:()=>sb,atan2:()=>ib,atanh:()=>ob,avgPool:()=>cg,avgPool3d:()=>pb,basicLSTMCell:()=>cb,batchNorm:()=>zp,batchNorm2d:()=>hb,batchNorm3d:()=>mb,batchNorm4d:()=>fb,batchToSpaceND:()=>hg,bincount:()=>mg,bitwiseAnd:()=>gb,booleanMaskAsync:()=>e7,broadcastArgs:()=>yb,broadcastTo:()=>Bl,buffer:()=>$e,cast:()=>Ue,ceil:()=>xb,clipByValue:()=>Ab,clone:()=>Ia,complex:()=>Sr,concat:()=>lt,concat1d:()=>bb,concat2d:()=>Wu,concat3d:()=>vb,concat4d:()=>wb,conv1d:()=>kb,conv2d:()=>Lp,conv2dTranspose:()=>Sb,conv3d:()=>Cb,conv3dTranspose:()=>Tb,cos:()=>Nb,cosh:()=>Rb,cosineWindow:()=>qh,cumprod:()=>Eb,cumsum:()=>Mb,denseBincount:()=>Pb,depthToSpace:()=>_b,depthwiseConv2d:()=>Dh,diag:()=>$b,dilation2d:()=>Fb,div:()=>ve,divNoNan:()=>Ob,dot:()=>zb,dropout:()=>s7,einsum:()=>Bs,elu:()=>yg,enclosingPowerOfTwo:()=>qg,ensureShape:()=>Lb,equal:()=>gg,erf:()=>Wb,euclideanNorm:()=>Ub,exp:()=>as,expandDims:()=>Wt,expm1:()=>Gb,eye:()=>Ag,fft:()=>Uh,fill:()=>sr,floor:()=>bg,floorDiv:()=>Dp,fused:()=>Xg,gather:()=>vg,gatherND:()=>r7,greater:()=>Vp,greaterEqual:()=>wg,ifft:()=>Kd,imag:()=>Up,image:()=>fe,inTopKAsync:()=>i7,irfft:()=>Bg,isFinite:()=>Hb,isInf:()=>jb,isNaN:()=>qb,leakyRelu:()=>kg,less:()=>hh,lessEqual:()=>Oh,linalg:()=>m7,linspace:()=>Xb,localResponseNormalization:()=>Kb,log:()=>Xl,log1p:()=>Ig,logSigmoid:()=>Zb,logSoftmax:()=>Jb,logSumExp:()=>Cg,logicalAnd:()=>jd,logicalNot:()=>Tg,logicalOr:()=>Ng,logicalXor:()=>Qb,losses:()=>f7,lowerBound:()=>e4,matMul:()=>pt,max:()=>fa,maxPool:()=>Rg,maxPool3d:()=>t4,maxPoolWithArgmax:()=>a4,maximum:()=>Eg,mean:()=>qd,meshgrid:()=>n4,min:()=>ts,minimum:()=>Xd,mirrorPad:()=>r4,mod:()=>Bu,moments:()=>s4,movingAverage:()=>t7,mul:()=>te,multiRNNCell:()=>i4,multinomial:()=>o4,neg:()=>Ln,norm:()=>Bp,notEqual:()=>Mg,oneHot:()=>mh,ones:()=>Hr,onesLike:()=>l4,op:()=>z,outerProduct:()=>u4,pad:()=>ir,pad1d:()=>d4,pad2d:()=>p4,pad3d:()=>c4,pad4d:()=>h4,pool:()=>m4,pow:()=>ql,prelu:()=>_g,print:()=>og,prod:()=>f4,raggedGather:()=>g4,raggedRange:()=>y4,raggedTensorToTensor:()=>x4,rand:()=>A4,randomGamma:()=>k4,randomNormal:()=>zg,randomStandardNormal:()=>I4,randomUniform:()=>Wh,randomUniformInt:()=>S4,range:()=>Kl,real:()=>Yl,reciprocal:()=>C4,relu:()=>Gp,relu6:()=>Lg,reshape:()=>Q,reverse:()=>ns,reverse1d:()=>T4,reverse2d:()=>N4,reverse3d:()=>R4,reverse4d:()=>E4,rfft:()=>Gh,round:()=>Wg,rsqrt:()=>M4,scalar:()=>Ge,scatterND:()=>a7,searchSorted:()=>Lh,selu:()=>P4,separableConv2d:()=>_4,setdiff1dAsync:()=>$4,sigmoid:()=>za,sign:()=>F4,signal:()=>h7,sin:()=>D4,sinh:()=>O4,slice:()=>Fe,slice1d:()=>z4,slice2d:()=>L4,slice3d:()=>Hp,slice4d:()=>Bh,softmax:()=>Vh,softplus:()=>Sg,spaceToBatchND:()=>Pg,sparse:()=>g7,sparseToDense:()=>n7,spectral:()=>c7,split:()=>Sa,sqrt:()=>Qn,square:()=>Tn,squaredDifference:()=>Vg,squeeze:()=>Oe,stack:()=>pa,step:()=>Ug,stridedSlice:()=>W4,string:()=>y7,sub:()=>xe,sum:()=>ot,tan:()=>B4,tanh:()=>ch,tensor:()=>Ve,tensor1d:()=>Bt,tensor2d:()=>Yn,tensor3d:()=>Gg,tensor4d:()=>V4,tensor5d:()=>U4,tensor6d:()=>G4,tensorScatterUpdate:()=>j4,tile:()=>Xr,topk:()=>q4,transpose:()=>Zs,truncatedNormal:()=>X4,unique:()=>K4,unsortedSegmentSum:()=>Y4,unstack:()=>Na,upperBound:()=>Z4,variable:()=>J4,where:()=>kr,whereAsync:()=>jg,zeros:()=>gn,zerosLike:()=>Ja});var eO=(e,t,a,n=Qt)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[n.add(k("a",e,t,a),k("b",e,t,a))];case"AddN":return[n.addN(k("tensors",e,t,a))];case"FloorMod":case"Mod":return[n.mod(k("a",e,t,a),k("b",e,t,a))];case"Mul":return[n.mul(k("a",e,t,a),k("b",e,t,a))];case"RealDiv":case"Div":return[n.div(k("a",e,t,a),k("b",e,t,a))];case"DivNoNan":return[n.divNoNan(k("a",e,t,a),k("b",e,t,a))];case"FloorDiv":return[n.floorDiv(k("a",e,t,a),k("b",e,t,a))];case"Sub":return[n.sub(k("a",e,t,a),k("b",e,t,a))];case"Minimum":return[n.minimum(k("a",e,t,a),k("b",e,t,a))];case"Maximum":return[n.maximum(k("a",e,t,a),k("b",e,t,a))];case"Pow":return[n.pow(k("a",e,t,a),k("b",e,t,a))];case"SquaredDifference":return[n.squaredDifference(k("a",e,t,a),k("b",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},tO=(e,t,a,n=Qt)=>{switch(e.op){case"Abs":case"ComplexAbs":return[n.abs(k("x",e,t,a))];case"Acos":return[n.acos(k("x",e,t,a))];case"Acosh":return[n.acosh(k("x",e,t,a))];case"Asin":return[n.asin(k("x",e,t,a))];case"Asinh":return[n.asinh(k("x",e,t,a))];case"Atan":return[n.atan(k("x",e,t,a))];case"Atan2":return[n.atan2(k("x",e,t,a),k("y",e,t,a))];case"Atanh":return[n.atanh(k("x",e,t,a))];case"Ceil":return[n.ceil(k("x",e,t,a))];case"Complex":return[n.complex(k("real",e,t,a),k("imag",e,t,a))];case"Cos":return[n.cos(k("x",e,t,a))];case"Cosh":return[n.cosh(k("x",e,t,a))];case"Elu":return[n.elu(k("x",e,t,a))];case"Erf":return[n.erf(k("x",e,t,a))];case"Exp":return[n.exp(k("x",e,t,a))];case"Expm1":return[n.expm1(k("x",e,t,a))];case"Floor":return[n.floor(k("x",e,t,a))];case"Log":return[n.log(k("x",e,t,a))];case"Log1p":return[n.log1p(k("x",e,t,a))];case"Imag":return[n.imag(k("x",e,t,a))];case"Neg":return[n.neg(k("x",e,t,a))];case"Reciprocal":return[n.reciprocal(k("x",e,t,a))];case"Real":return[n.real(k("x",e,t,a))];case"Relu":return[n.relu(k("x",e,t,a))];case"Round":return[n.round(k("x",e,t,a))];case"Selu":return[n.selu(k("x",e,t,a))];case"Sigmoid":return[n.sigmoid(k("x",e,t,a))];case"Sin":return[n.sin(k("x",e,t,a))];case"Sign":return[n.sign(k("x",e,t,a))];case"Sinh":return[n.sinh(k("x",e,t,a))];case"Softplus":return[n.softplus(k("x",e,t,a))];case"Sqrt":return[n.sqrt(k("x",e,t,a))];case"Square":return[n.square(k("x",e,t,a))];case"Tanh":return[n.tanh(k("x",e,t,a))];case"Tan":return[n.tan(k("x",e,t,a))];case"ClipByValue":return[n.clipByValue(k("x",e,t,a),k("clipValueMin",e,t,a),k("clipValueMax",e,t,a))];case"Relu6":return[n.relu6(k("x",e,t,a))];case"Rsqrt":return[n.rsqrt(la(e.inputNames[0],t,a))];case"LeakyRelu":return[n.leakyRelu(k("x",e,t,a),k("alpha",e,t,a))];case"Prelu":return[n.prelu(k("x",e,t,a),k("alpha",e,t,a))];case"IsNan":return[n.isNaN(la(e.inputNames[0],t,a))];case"IsInf":return[n.isInf(la(e.inputNames[0],t,a))];case"IsFinite":return[n.isFinite(la(e.inputNames[0],t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function Cn(e,t,a=""){if(!(typeof e=="number"||typeof t=="number")){v.assert(e.length===t.length,()=>a+` Shapes ${e} and ${t} must match`);for(let n=0;na+` Shapes ${e} and ${t} must match`)}}}function d5(e){return!(typeof e=="number"||e.some(t=>t<0))}function vd(e,t,a){let n=R1(e,a),r=!d5(n);if(r&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${n}`);if(r&&t.forEach(s=>{n=R1(s.shape,n)}),!d5(n))throw new Error(`Non-fully-defined elementShape: ${n}`);return n}function R1(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 a=[];for(let n=0;n=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);a[n]=r>=0?r:s}return a}var aO=class{constructor(e,t,a,n,r,s,i){this.name=e,this.dtype=t,this.maxSize=a,this.elementShape=n,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Ge(0),zn(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 a=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),Cn(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),a.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(a.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);a.tensor=t,zn(t),a.written=!0,this.tensors[e]=a}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((a,n)=>this.write(a,t[n]))}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 n=0;n=this.maxSize)throw new Error(`Max index must be < array size (${a} vs. ${this.maxSize})`);this.writeMany(e,Na(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 a=0,n=e.map(o=>(a+=o,a));if(a!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to + ${s.shape}`);let i={data:n,indices:r,segmentIds:s};return L.runKernel(Uu,i)}var SP=z({sparseSegmentSum_:IP});function TP(e,t,a,n,r,s,i,o){let l=R(e,"data","stringNGrams","string");if(l.dtype!=="string")throw new Error("Data must be of datatype string");if(l.shape.length!==1)throw new Error(`Data must be a vector, saw: ${l.shape}`);let u=R(t,"dataSplits","stringNGrams");if(u.dtype!=="int32")throw new Error("Data splits must be of datatype int32");let d={separator:a,nGramWidths:n,leftPad:r,rightPad:s,padWidth:i,preserveShortSequences:o},c={data:l,dataSplits:u},p=L.runKernel(Hu,c,d);return{nGrams:p[0],nGramsSplits:p[1]}}var CP=z({stringNGrams_:TP});function NP(e,t,a=!0){let n=R(e,"input","stringSplit","string"),r=R(t,"delimiter","stringSplit","string");if(n.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${n.shape}`);if(r.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${r.shape}`);let s={skipEmpty:a},i={input:n,delimiter:r},o=L.runKernel($p,i,s);return{indices:o[0],values:o[1],shape:o[2]}}var RP=z({stringSplit_:NP});function EP(e,t){let a=R(e,"input","stringToHashBucketFast","string"),n={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");let r={input:a};return L.runKernel(Dp,r,n)}var MP=z({stringToHashBucketFast_:EP});function FP(e,t,a,n=!0){let r=R(e,"input","staticRegexReplace","string"),s={pattern:t,rewrite:a,replaceGlobal:n};return L.runKernel(Gu,{x:r},s)}var $P=z({staticRegexReplace_:FP}),F7={fft:Zh,ifft:rp,rfft:Jh,irfft:Yg},$7={hammingWindow:sD,hannWindow:C7,frame:N7,stft:uD},fe={flipLeftRight:hD,grayscaleToRGB:fD,resizeNearestNeighbor:BD,resizeBilinear:LD,rgbToGrayscale:yD,rotateWithOffset:AD,cropAndResize:pD,nonMaxSuppression:vD,nonMaxSuppressionAsync:RD,nonMaxSuppressionWithScore:MD,nonMaxSuppressionWithScoreAsync:$D,nonMaxSuppressionPadded:PD,nonMaxSuppressionPaddedAsync:OD,threshold:GD,transform:jD},D7={bandPart:XD,gramSchmidt:YD,qr:JD},P7={absoluteDifference:tP,computeWeightedLoss:Dr,cosineDistance:nP,hingeLoss:sP,huberLoss:oP,logLoss:uP,meanSquaredError:pP,sigmoidCrossEntropy:mP,softmaxCrossEntropy:yP},_7={sparseFillEmptyRows:AP,sparseReshape:vP,sparseSegmentMean:kP,sparseSegmentSum:SP},O7={stringNGrams:CP,stringSplit:RP,stringToHashBucketFast:MP,staticRegexReplace:$P},z7={};Ke(z7,{Serializable:()=>L7,SerializationMap:()=>W7,getRegisteredName:()=>PP,registerClass:()=>B7});var DP=new Map,w1=new Map,L7=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},W7=class jl{constructor(){this.classNameMap={}}static getMap(){return jl.instance==null&&(jl.instance=new jl),jl.instance}static register(t){jl.getMap().classNameMap[t.className]=[t,t.fromConfig]}};function B7(e,t,a){P(e.className!=null,()=>"Class being registered does not have the static className property defined."),P(typeof e.className=="string",()=>"className is required to be a string, but got type "+typeof e.className),P(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),typeof t=="undefined"&&(t="Custom"),typeof a=="undefined"&&(a=e.className);let n=a,r=t+">"+n;return W7.register(e),DP.set(r,e),w1.set(e,r),e}function PP(e){return w1.has(e)?w1.get(e):e.className}var _s=class extends L7{minimize(e,t=!1,a){let{value:n,grads:r}=this.computeGradients(e,a);if(a!=null){let s=a.map(i=>({name:i.name,tensor:r[i.name]}));this.applyGradients(s)}else this.applyGradients(r);return J(r),t?n:(n.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return g4(e,t)}dispose(){this.iterations_!=null&&J(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:Ge(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(_s,Symbol.hasInstance,{value:e=>e.minimize!=null&&e.computeGradients!=null&&e.applyGradients!=null});var s3=class extends _s{static get className(){return"Adadelta"}constructor(e,t,a=null){super(),this.learningRate=e,this.rho=t,this.epsilon=a,this.accumulatedGrads=[],this.accumulatedUpdates=[],a==null&&(this.epsilon=L.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,a)=>{let n=L.registeredVariables[t],r=!1;this.accumulatedGrads[a]==null&&(this.accumulatedGrads[a]={originalName:`${t}/accum_grad`,variable:Pe(()=>en(n).variable(r))}),this.accumulatedUpdates[a]==null&&(this.accumulatedUpdates[a]={originalName:`${t}/accum_var`,variable:Pe(()=>en(n).variable(r))});let s=Array.isArray(e)?e[a].tensor:e[t];if(s==null)return;let i=this.accumulatedGrads[a].variable,o=this.accumulatedUpdates[a].variable;Pe(()=>{let l=we(te(i,this.rho),te(En(s),1-this.rho)),u=te(ve(nr(we(o,this.epsilon)),nr(we(i,this.epsilon))),s),d=we(te(o,this.rho),te(En(u),1-this.rho));i.assign(l),o.assign(d);let c=we(te(u,-this.learningRate),n);n.assign(c)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(J(this.accumulatedGrads.map(e=>e.variable)),J(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,a=!1;this.accumulatedGrads=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.accumulatedUpdates=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(a)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}},i3=class extends _s{static get className(){return"Adagrad"}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,a)=>{let n=L.registeredVariables[t];this.accumulatedGrads[a]==null&&(this.accumulatedGrads[a]={originalName:`${t}/accumulator`,variable:Pe(()=>lr(n.shape,this.initialAccumulatorValue).variable(!1))});let r=Array.isArray(e)?e[a].tensor:e[t];if(r==null)return;let s=this.accumulatedGrads[a].variable;Pe(()=>{let i=we(s,En(r));s.assign(i);let o=we(te(ve(r,nr(we(i,L.backend.epsilon()))),-this.learningRate),n);n.assign(o)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&J(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(a=>({originalName:a.name,variable:a.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}},o3=class extends _s{static get className(){return"Adam"}constructor(e,t,a,n=null){super(),this.learningRate=e,this.beta1=t,this.beta2=a,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Pe(()=>{this.accBeta1=Ge(t).variable(),this.accBeta2=Ge(a).variable()}),n==null&&(this.epsilon=L.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(a=>a.name):Object.keys(e);Pe(()=>{let a=xe(1,this.accBeta1),n=xe(1,this.accBeta2);t.forEach((r,s)=>{let i=L.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:Pe(()=>en(i).variable(o))}),this.accumulatedSecondMoment[s]==null&&(this.accumulatedSecondMoment[s]={originalName:`${r}/v`,variable:Pe(()=>en(i).variable(o))});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let u=this.accumulatedFirstMoment[s].variable,d=this.accumulatedSecondMoment[s].variable,c=we(te(u,this.beta1),te(l,1-this.beta1)),p=we(te(d,this.beta2),te(En(l),1-this.beta2)),h=ve(c,a),m=ve(p,n);u.assign(c),d.assign(p);let f=we(te(ve(h,we(nr(m),this.epsilon)),-this.learningRate),i);i.assign(f)}),this.accBeta1.assign(te(this.accBeta1,this.beta1)),this.accBeta2.assign(te(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&J(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&J(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),Pe(()=>{this.accBeta1.assign(tu(this.beta1,this.iterations_+1)),this.accBeta2.assign(tu(this.beta2,this.iterations_+1))});let t=e.length/2,a=!1;this.accumulatedFirstMoment=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(a)}))}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)}},l3=class extends _s{static get className(){return"Adamax"}constructor(e,t,a,n=null,r=0){super(),this.learningRate=e,this.beta1=t,this.beta2=a,this.epsilon=n,this.decay=r,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Pe(()=>{this.iteration=Ge(0).variable(),this.accBeta1=Ge(t).variable()}),n==null&&(this.epsilon=L.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(a=>a.name):Object.keys(e);Pe(()=>{let a=xe(1,this.accBeta1),n=ve(-this.learningRate,we(te(this.iteration,this.decay),1));t.forEach((r,s)=>{let i=L.registeredVariables[r],o=!1;this.accumulatedFirstMoment[s]==null&&(this.accumulatedFirstMoment[s]={originalName:`${r}/m`,variable:en(i).variable(o)}),this.accumulatedWeightedInfNorm[s]==null&&(this.accumulatedWeightedInfNorm[s]={originalName:`${r}/v`,variable:en(i).variable(o)});let l=Array.isArray(e)?e[s].tensor:e[r];if(l==null)return;let u=this.accumulatedFirstMoment[s].variable,d=this.accumulatedWeightedInfNorm[s].variable,c=we(te(u,this.beta1),te(l,1-this.beta1)),p=te(d,this.beta2),h=Ja(l),m=Lg(p,h);u.assign(c),d.assign(m);let f=we(te(ve(n,a),ve(c,we(m,this.epsilon))),i);i.assign(f)}),this.iteration.assign(we(this.iteration,1)),this.accBeta1.assign(te(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&J(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&J(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)}},i0=class extends _s{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,a)=>{let n=Array.isArray(e)?e[a].tensor:e[t];if(n==null)return;let r=L.registeredVariables[t];Pe(()=>{let s=we(te(this.c,n),r);r.assign(s)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Bn(Ge(-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)}},u3=class extends i0{static get className(){return"Momentum"}constructor(e,t,a=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=a,this.accumulations=[],this.m=Ge(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(t=>t.name):Object.keys(e)).forEach((t,a)=>{let n=L.registeredVariables[t];this.accumulations[a]==null&&(this.accumulations[a]={originalName:`${t}/momentum`,variable:Pe(()=>en(n).variable(!1))});let r=this.accumulations[a].variable,s=Array.isArray(e)?e[a].tensor:e[t];s!=null&&Pe(()=>{let i,o=we(te(this.m,r),s);this.useNesterov?i=we(te(this.c,we(s,te(o,this.m))),n):i=we(te(this.c,o),n),r.assign(o),n.assign(i)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&J(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(a=>({originalName:a.name,variable:a.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)}},d3=class extends _s{static get className(){return"RMSProp"}constructor(e,t=.9,a=0,n=null,r=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=a,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=r,n==null&&(this.epsilon=L.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,a)=>{let n=L.registeredVariables[t],r=!1;this.accumulatedMeanSquares[a]==null&&(this.accumulatedMeanSquares[a]={originalName:`${t}/rms`,variable:Pe(()=>en(n).variable(r))}),this.accumulatedMoments[a]==null&&(this.accumulatedMoments[a]={originalName:`${t}/momentum`,variable:Pe(()=>en(n).variable(r))}),this.accumulatedMeanGrads[a]==null&&this.centered&&(this.accumulatedMeanGrads[a]={originalName:`${t}/mg`,variable:Pe(()=>en(n).variable(r))});let s=Array.isArray(e)?e[a].tensor:e[t];if(s==null)return;let i=this.accumulatedMeanSquares[a].variable,o=this.accumulatedMoments[a].variable;Pe(()=>{let l=we(te(i,this.decay),te(En(s),1-this.decay));if(this.centered){let u=this.accumulatedMeanGrads[a].variable,d=we(te(u,this.decay),te(s,1-this.decay)),c=ve(te(s,this.learningRate),nr(xe(l,we(En(d),this.epsilon)))),p=we(te(o,this.momentum),c);i.assign(l),u.assign(d),o.assign(p);let h=xe(n,p);n.assign(h)}else{let u=we(te(i,this.decay),te(En(s),1-this.decay)),d=we(te(o,this.momentum),ve(te(s,this.learningRate),nr(we(u,this.epsilon))));i.assign(u),o.assign(d);let c=xe(n,d);n.assign(c)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&J(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&J(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&J(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,a=!1;this.accumulatedMeanSquares=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.accumulatedMoments=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(n=>({originalName:n.name,variable:n.tensor.variable(a)})))}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)}},_P=[s3,i3,o3,l3,u3,d3,i0];function OP(){for(let e of _P)B7(e)}var Jn={};Ke(Jn,{CompositeArrayBuffer:()=>Fr,browserFiles:()=>GP,browserHTTPRequest:()=>YP,concatenateArrayBuffers:()=>fR,copyModel:()=>OR,decodeWeights:()=>ib,decodeWeightsStream:()=>lb,encodeWeights:()=>uR,fromMemory:()=>JP,fromMemorySync:()=>j7,getLoadHandlers:()=>kR,getModelArtifactsForJSON:()=>xg,getModelArtifactsForJSONSync:()=>db,getModelArtifactsInfoForJSON:()=>Up,getSaveHandlers:()=>wR,getWeightSpecs:()=>g1,http:()=>c3,isHTTPScheme:()=>I1,listModels:()=>PR,loadWeights:()=>jP,moveModel:()=>zR,registerLoadRouter:()=>vR,registerSaveRouter:()=>bR,removeModel:()=>_R,weightsLoaderFactory:()=>U7,withSaveHandler:()=>QP,withSaveHandlerSync:()=>e_});var zP="model",LP=".json",WP=".weights.bin";function m5(e){return new Promise(t=>setTimeout(t)).then(e)}var wh=class k1{constructor(t){if(!B().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(k1.URL_SCHEME)&&(t=t.slice(k1.URL_SCHEME.length)),(t==null||t.length===0)&&(t=zP),this.modelJsonFileName=t+LP,this.weightDataFileName=t+WP}async save(t){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let a=Fr.join(t.weightData),n=window.URL.createObjectURL(new Blob([a],{type:"application/octet-stream"}));if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let r=[{paths:["./"+this.weightDataFileName],weights:t.weightSpecs}],s=ub(t,r),i=window.URL.createObjectURL(new Blob([JSON.stringify(s)],{type:"application/json"})),o=this.modelJsonAnchor==null?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=i,await m5(()=>o.dispatchEvent(new MouseEvent("click"))),t.weightData!=null){let l=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;l.download=this.weightDataFileName,l.href=n,await m5(()=>l.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Up(t)}}}};wh.URL_SCHEME="downloads://";var BP=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.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise((e,t)=>{let a=new FileReader;a.onload=n=>{let r=JSON.parse(n.target.result),s=r.modelTopology;if(s==null){t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(r.weightsManifest==null){t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){e({modelTopology:s});return}let i=xg(r,o=>this.loadWeights(o));e(i)},a.onerror=n=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),a.readAsText(this.jsonFile)})}loadWeights(e){let t=[],a=[];for(let s of e)t.push(...s.weights),a.push(...s.paths);let n=this.checkManifestAndWeightFiles(e),r=a.map(s=>this.loadWeightsFile(s,n[s]));return Promise.all(r).then(s=>[t,s])}loadWeightsFile(e,t){return new Promise((a,n)=>{let r=new FileReader;r.onload=s=>{let i=s.target.result;a(i)},r.onerror=s=>n(`Failed to weights data from file of path '${e}'.`),r.readAsArrayBuffer(t)})}checkManifestAndWeightFiles(e){let t=[],a=this.weightsFiles.map(r=>p5(r.name)),n={};for(let r of e)r.paths.forEach(s=>{let i=p5(s);if(t.indexOf(i)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${i}'`);if(t.push(i),a.indexOf(i)===-1)throw new Error(`Weight file with basename '${i}' is not provided.`);n[s]=this.weightsFiles[a.indexOf(i)]});if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}},VP=e=>B().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(wh.URL_SCHEME)?UP(e.slice(wh.URL_SCHEME.length)):null;xn.registerSaveRouter(VP);function UP(e="model"){return new wh(e)}function GP(e){return new BP(e)}function f5(e,t,a,n){i(e),a=a==null?0:a,n=n==null?1:n,o(a,n);let r=0,s=l=>(l.then(u=>{let d=a+ ++r/e.length*(n-a);return t(d),u}),l);function i(l){P(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function o(l,u){P(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),P(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),P(u>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${u}`)}return Promise.all(e.map(s))}async function V7(e,t){t==null&&(t={});let a=t.fetchFunc==null?B().platform.fetch:t.fetchFunc,n=e.map(s=>a(s,t.requestInit,{isBinary:!0})),r=(t.onProgress==null?await Promise.all(n):await f5(n,t.onProgress,0,.5)).map(s=>s.arrayBuffer());return t.onProgress==null?await Promise.all(r):await f5(r,t.onProgress,.5,1)}function HP(e,t){var a;let n=t.fetchFunc==null?B().platform.fetch:t.fetchFunc,r=0,s;return(a=t.onProgress)===null||a===void 0||a.call(t,0),new ReadableStream({pull:async i=>{for(var o;rV7(r,{requestInit:n}))(e,t,a)}function U7(e){return async(t,a="",n)=>{let r=t.map(()=>!1),s={},i=n!=null?n.map(()=>!1):[],o=[];if(t.forEach((h,m)=>{let f=0;h.weights.forEach(g=>{let y="quantization"in g?g.quantization.dtype:g.dtype,x=vi[y]*mt(g.shape),A=()=>{r[m]=!0,s[m]==null&&(s[m]=[]),s[m].push({manifestEntry:g,groupOffset:f,sizeBytes:x})};n!=null?n.forEach((b,w)=>{b===g.name&&(A(),i[w]=!0)}):A(),o.push(g.name),f+=x})}),!i.every(h=>h)){let h=n.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),[]),u=[];l.forEach(h=>{t[h].paths.forEach(m=>{let f=a+(a.endsWith("/")?"":"/")+m;u.push(f)})});let d=await e(u),c={},p=0;return l.forEach(h=>{let m=t[h].paths.length,f=new Fr(d.slice(p,p+m));s[h].forEach(g=>{let y=f.slice(g.groupOffset,g.groupOffset+g.sizeBytes),x=ib(y,[g.manifestEntry]);for(let A in x)c[A]=x[A]}),p+=m}),c}}var qP="application/octet-stream",XP="application/json",p3=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?(P(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=B().platform.fetch,P(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&P(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||{},this.loadOptions=t}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 a=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],n=ub(e,a);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:XP}),"model.json"),e.weightData!=null){let s=Fr.join(e.weightData);t.body.append("model.weights.bin",new Blob([s],{type:qP}),"model.weights.bin")}let r=await this.fetch(this.path,t);if(r.ok)return{modelArtifactsInfo:Up(e),responses:[r]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${r.status}.`)}async loadModelJSON(){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(r){let s=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?s+=" 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.":s+=" Please make sure the server is serving valid JSON for this request.",new Error(s)}let a=t.modelTopology,n=t.weightsManifest;if(a==null&&n==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();let e=await this.loadModelJSON();return xg(e,t=>this.loadWeights(t))}async loadStream(){let e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),a=g1(e.weightsManifest),n=()=>HP(t,this.loadOptions);return Object.assign(Object.assign({},e),{weightSpecs:a,getWeightStream:n})}async getWeightUrls(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[a,n]=KP(t),r=this.weightPathPrefix||a,s=[],i=[];for(let o of e)for(let l of o.paths)this.weightUrlConverter!=null?i.push(this.weightUrlConverter(l)):s.push(r+l+n);return this.weightUrlConverter&&s.push(...await Promise.all(i)),s}async loadWeights(e){let t=await this.getWeightUrls(e),a=g1(e),n=await V7(t,this.loadOptions);return[a,n]}};p3.URL_SCHEME_REGEX=/^https?:\/\//;function KP(e){let t=e.lastIndexOf("/"),a=e.lastIndexOf("?"),n=e.substring(0,t),r=a>t?e.substring(a):"";return[n+"/",r]}function I1(e){return e.match(p3.URL_SCHEME_REGEX)!=null}var G7=(e,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let a=!0;if(Array.isArray(e)?a=e.every(n=>I1(n)):a=I1(e),a)return c3(e,t)}return null};xn.registerSaveRouter(G7);xn.registerLoadRouter(G7);function c3(e,t){return new p3(e,t)}function YP(e,t){return c3(e,t)}var t1=class{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}},H7=class{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}},ZP=class{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}};function JP(e,t,a,n){let r=arguments;return new ZP(j7(...r))}function j7(e,t,a,n){return arguments.length===1?e.modelTopology!=null||e.weightSpecs!=null?new t1(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 t1({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 t1({modelTopology:e,weightSpecs:t,weightData:a,trainingConfig:n}))}function QP(e){return new H7(e)}function e_(e){return new H7(e)}var q7={};Ke(q7,{confusionMatrix:()=>a_});function t_(e,t,a){let n=R(e,"labels","confusionMatrix"),r=R(t,"predictions","confusionMatrix");P(a==null||a>0&&Number.isInteger(a),()=>`If provided, numClasses must be a positive integer, but got ${a}`),P(n.rank===1,()=>`Expected the rank of labels to be 1, but got ${n.rank}`),P(r.rank===1,()=>`Expected the rank of predictions to be 1, but got ${r.rank}`),P(n.shape[0]===r.shape[0],()=>`Mismatch in the number of examples: ${n.shape[0]} vs. ${r.shape[0]}. Labels and predictions should have the same number of elements.`),P(a>0&&Number.isInteger(a),()=>`numClasses is required to be a positive integer, but got ${a}`);let s=vh(Ue(n,"int32"),a),i=vh(Ue(r,"int32"),a),o=Si(s),l=pt(o,i);return Ue(l,"int32")}var a_=z({confusionMatrix_:t_}),Pr={};Ke(Pr,{draw:()=>d_,fromPixels:()=>p_,fromPixelsAsync:()=>o_,toPixels:()=>u_});var li,g5=!1;function X7(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 a=!1,n=!1,r=!1,s=!1,i=!1,o=!1;if(e.data instanceof Uint8Array)a=!0;else if(typeof ImageData!="undefined"&&e instanceof ImageData)n=!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(Xd(jd,L.backendName)!=null){let p={pixels:e},h={numChannels:t};return L.runKernel(jd,p,h)}let[l,u]=r?[e.videoWidth,e.videoHeight]:[e.width,e.height],d;if(i)d=e.getContext("2d").getImageData(0,0,l,u).data;else if(n||a)d=e.data;else if(s||r||o){if(li==null)if(typeof document=="undefined")if(typeof OffscreenCanvas!="undefined"&&typeof OffscreenCanvasRenderingContext2D!="undefined")li=new OffscreenCanvas(1,1).getContext("2d");else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");else li=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});li.canvas.width=l,li.canvas.height=u,li.drawImage(e,0,0,l,u),d=li.getImageData(0,0,l,u).data}let c;if(t===4)c=new Int32Array(d);else{let p=l*u;c=new Int32Array(p*t);for(let h=0;h4||t===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if(e.dtype!=="float32"&&e.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}function l_(e){let t=(e==null?void 0:e.alpha)||1;if(t>1||t<0)throw new Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}async function u_(e,t){let a=R(e,"img","toPixels");if(!(e instanceof yt)){let u=a;a=Ue(u,"int32"),u.dispose()}K7(a);let[n,r]=a.shape.slice(0,2),s=a.rank===2?1:a.shape[2],i=await a.data(),o=a.dtype==="float32"?255:1,l=new Uint8ClampedArray(r*n*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${h}.`)}else if(a.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?(d[0]=h*o,d[1]=h*o,d[2]=h*o):d[p]=h*o}let c=u*4;l[c+0]=Math.round(d[0]),l[c+1]=Math.round(d[1]),l[c+2]=Math.round(d[2]),l[c+3]=Math.round(d[3])}if(t!=null){g5||Xd(kp,L.backendName)!=null&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),g5=!0),t.width=r,t.height=n;let u=t.getContext("2d"),d=new ImageData(l,r,n);u.putImageData(d,0,0)}return a!==e&&a.dispose(),l}function d_(e,t,a){let n=R(e,"img","draw");if(!(e instanceof yt)){let i=n;n=Ue(i,"int32"),i.dispose()}K7(n),l_(a==null?void 0:a.imageOptions);let r={image:n},s={canvas:t,options:a};L.runKernel(kp,r,s)}var p_=z({fromPixels_:X7}),h3={};Ke(h3,{prepareAndValidate:()=>Y7});function Y7(e,t){let a=e.shape.length,n=t.shape.length;if(a<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${a}.`);if(n<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${n}.`);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[n-1]>a)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[n-1]} vs. ${a}`);if(mt(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 c=0;cc/u),1].slice(0,s);return[l,i,u,d]}var wt={};Ke(wt,{assertParamsValid:()=>h_,computeFlatOffset:()=>x_,computeOutShape:()=>f_,getNormalizedAxes:()=>g_,isSliceContinous:()=>y_,maskToAxes:()=>m_,parseSliceParams:()=>A_,sliceInfo:()=>b_,startForAxis:()=>n6,startIndicesWithElidedDims:()=>e6,stopForAxis:()=>r6,stopIndicesWithElidedDims:()=>t6,stridesForAxis:()=>a6,stridesWithElidedDims:()=>Z7});var S1=-2,c_=-1;function h_(e,t,a){let n=e.shape.length;P(n===t.length,()=>`Error in slice${n}D: Length of begin ${t} must match the rank of the array (${n}).`),P(n===a.length,()=>`Error in slice${n}D: Length of size ${a} must match the rank of the array (${n}).`);for(let r=0;r`Error in slice${n}D: begin[${r}] + size[${r}] (${t[r]+a[r]}) would overflow input.shape[${r}] (${e.shape[r]})`)}function m_(e){let t=[],a=0;for(;e>0;)e&1&&t.push(a),e/=2,a++;return t}function f_(e,t,a){let n=[];for(let r=0;r0){let h=t[0],m=a+1;d=e6(i,h,m,n,e),c=t6(o,h,m,r,e),p=Z7(s,h,m,e)}else for(let h=0;h-1)s[o]=0;else{let l=J7(t,a,o),u=n[l];e&1<-1)s[o]=Number.MAX_SAFE_INTEGER;else{let l=J7(t,a,o),u=n[l];e&1<0?i=Number.MIN_SAFE_INTEGER:i=Number.MAX_SAFE_INTEGER);let l=n[r];return i<0&&(i+=l),i=Hd(0,i,l-1),i}function r6(e,t,a,n,r,s){let i=t[r],o=a[r]||1;(e&1<0?i=Number.MAX_SAFE_INTEGER:i=Number.MIN_SAFE_INTEGER);let l=n[r];return i<0&&(i+=l),o>0?i=Hd(0,i,l):i=Hd(-1,i,l-1),i}function y_(e,t,a){let n=a.length;for(let r=0;r1){n=r;break}for(let r=n+1;r0||a[r]!==e[r])return!1;return!0}function x_(e,t){let a=e.length>0?e[e.length-1]:1;for(let n=0;n{P(i!==-1,()=>"slice() does not support negative begin indexing.")});let s;return a==null?s=new Array(r).fill(-1):typeof a=="number"?s=[a,...new Array(r-1).fill(-1)]:a.lengthi>=0?i:(P(i===-1,()=>`Negative size values should be exactly -1 but got ${i} for the slice() size at index ${o}.`),e.shape[o]-n[o])),[n,s]}function b_(e,t,a,n,r,s,i,o,l){let u;if(n==null?(u=new Array(t.length),u.fill(1)):u=n,i!=null&&i&i-1)throw new Error("Multiple ellipses in slice is not allowed.");let d=!1,c={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:a.slice(),strides:u.slice(),beginMask:r,endMask:s,ellipsisMask:i,newAxisMask:o,shrinkAxisMask:l};for(let x=0;x0?0:-1,p.strides[x]>0?b:b-1];if(A&&p.strides[x]<=0)throw Error("only stride 1 allowed on non-range indexing.");f=f&&p.strides[x]===1;let C=!!(p.beginMask&1<=b)throw Error(`slice index ${p.begin[x]} of dimension ${x} out of bounds.`)}else p.begin[x]=y5(p.begin[x],0,p.strides[x],b,w,S),p.end[x]=y5(p.end[x],1,p.strides[x],b,w,S);let F=p.strides[x]===1&&p.begin[x]===0&&p.end[x]===b;h=h&&F,m=m&&(x===0&&p.strides[x]===1||F)}else h=h&&p.strides[x]===1&&C,m=m&&(x===0&&p.strides[x]===1||C);let N,M=!1;if(p.beginValid&&p.endValid?(N=p.end[x]-p.begin[x],M=!0):A?(N=1,M=!0):C&&b>=0&&(p.strides[x]<0?N=-b:N=b,M=!0),M){let F;N===0||N<0!=p.strides[x]<0?F=0:F=Math.trunc(N/p.strides[x])+(N%p.strides[x]!==0?1:0),g.push(F)}else g.push(-1)}for(let x=0;x=0?y.push(g[A]):A===S1&&y.push(1)}return{finalShapeSparse:y.filter((x,A)=>p.finalShapeGatherIndices[A]!==S1),finalShape:y,isIdentity:h,sliceDim0:m,isSimpleSlice:f,begin:p.begin,end:p.end,strides:p.strides}}function v_(e,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let a=0;t.beginValid=e.begin!=null,t.endValid=e.end!=null,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let n=0;n0?s[t]:s[t+1&1];{let i=e<0?n+e:e;return is[1]?s[1]:i}}var m3="4.17.0",s6=class{static sgd(e){return new i0(e)}static momentum(e,t,a=!1){return new u3(e,t,a)}static rmsprop(e,t=.9,a=0,n=null,r=!1){return new d3(e,t,a,n,r)}static adam(e=.001,t=.9,a=.999,n=null){return new o3(e,t,a,n)}static adadelta(e=.001,t=.95,a=null){return new s3(e,t,a)}static adamax(e=.002,t=.9,a=.999,n=null,r=0){return new l3(e,t,a,n,r)}static adagrad(e,t=.1){return new i3(e,t)}},w_=s6,k_=typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:e=>e();function i6(){return new Promise(e=>k_(()=>e()))}var I={};Ke(I,{ERF_A1:()=>W_,ERF_A2:()=>B_,ERF_A3:()=>V_,ERF_A4:()=>U_,ERF_A5:()=>G_,ERF_P:()=>L_,PARALLELIZE_THRESHOLD:()=>f3,RowPartitionType:()=>Zn,SELU_SCALE:()=>z_,SELU_SCALEALPHA:()=>O_,applyActivation:()=>r0,assertAndGetBroadcastShape:()=>Ut,assertAxesAreInnerMostDims:()=>cM,assertParamsConsistent:()=>I_,assignToTypedArray:()=>Y_,axesAreInnerMostDims:()=>Cg,calculateShapes:()=>p7,checkEinsumDimSizes:()=>aO,checkPadOnDimRoundingMode:()=>Mn,combineLocations:()=>o4,combineRaggedTensorToTensorShapes:()=>T_,complexWithEvenIndex:()=>q_,complexWithOddIndex:()=>X_,computeConv2DInfo:()=>Hp,computeConv3DInfo:()=>Rb,computeDefaultPad:()=>bg,computeDilation2DInfo:()=>lE,computeOptimalWindowSize:()=>E_,computeOutAndReduceShapes:()=>pM,computeOutShape:()=>S_,computePool2DInfo:()=>Nb,computePool3DInfo:()=>uE,convertConv2DDataFormat:()=>Eb,decodeEinsumEquation:()=>eO,eitherStridesOrDilationsAreOne:()=>$r,expandShapeToKeepDim:()=>Xp,exponent:()=>J_,exponents:()=>Z_,fromStringArrayToUint8:()=>kO,fromUint8ToStringArray:()=>wO,getAxesPermutation:()=>hM,getBroadcastDims:()=>a4,getComplexWithIndex:()=>K_,getEinsumComputePath:()=>nO,getEinsumPermutation:()=>tO,getFusedBiasGradient:()=>n0,getFusedDyActivation:()=>a0,getImageCenter:()=>M_,getInnerMostAxes:()=>fM,getPermuted:()=>$_,getRaggedRank:()=>N_,getReductionAxes:()=>Ig,getReshaped:()=>F_,getReshapedPermuted:()=>D_,getRowPartitionTypesHelper:()=>C_,getSliceBeginCoords:()=>P_,getSliceSize:()=>__,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>oO,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>lO,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>uO,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>cO,getSparseReshapeInputOutputMismatchErrorMessage:()=>mO,getSparseReshapeInputOutputMultipleErrorMessage:()=>hO,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>dO,getSparseReshapeNegativeOutputDimErrorMessage:()=>pO,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>xO,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>fO,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>gO,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>yO,getUndoAxesPermutation:()=>mM,isIdentityPermutation:()=>rO,log:()=>bN,mergeRealAndImagArrays:()=>H_,prepareAndValidate:()=>Y7,prepareSplitSize:()=>iO,segment_util:()=>o6,shouldFuse:()=>s0,slice_util:()=>wt,splitRealAndImagArrays:()=>j_,stridesOrDilationsArePositive:()=>Ii,tupleValuesAreOne:()=>ep,upcastType:()=>Qt,validateDefaultValueShape:()=>R_,validateInput:()=>e0,validateUpdateShape:()=>e3,warn:()=>qr});function I_(e,t){let a=e[0].length;e.forEach((r,s)=>{P(r.length===a,()=>`Error in concat${a}D: rank of tensors[${s}] must be the same as the rank of the rest (${a})`)}),P(t>=0&&t`Error in concat${a}D: axis must be between 0 and ${a-1}.`);let n=e[0];e.forEach((r,s)=>{for(let i=0;i`Error in concat${a}D: Shape of tensors[${s}] (${r}) does not match the shape of the rest (${n}) along the non-concatenated axis ${s}.`)})}function S_(e,t){let a=e[0].slice();for(let n=1;n=0)if(o>=0){if(o!==s)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${r+e}] = ${s} but shape[${r+e}] = ${o}`)}else n[i]=s}return n}function C_(e){let t={FIRST_DIM_SIZE:Zn.FIRST_DIM_SIZE,VALUE_ROWIDS:Zn.VALUE_ROWIDS,ROW_LENGTHS:Zn.ROW_LENGTHS,ROW_SPLITS:Zn.ROW_SPLITS,ROW_LIMITS:Zn.ROW_LIMITS,ROW_STARTS:Zn.ROW_STARTS},a=[];for(let n of e)if(n in t)a.push(t[n]);else break;return a}function N_(e){return e.length===0?0:e[0]===Zn.FIRST_DIM_SIZE?e.length-1:e.length}function R_(e,t){if(e==null||t==null)return;let a=e.length,n=t.length;if(a>=n)throw new Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${a} must be less than ragged tensor input flatValues.rank = ${n})`);for(let r=0;r=0&&i>=0&&s!==1&&s!==i)throw new Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${r-e.length}] = ${s} but ragged tensor input.flatValues.shape[${r-e.length}] = ${i}`)}}var f3=30;function E_(e){return e<=f3?e:yh(e,Math.floor(Math.sqrt(e)))}function M_(e,t,a){let n=a*(typeof e=="number"?e:e[0]),r=t*(typeof e=="number"?e:e[1]);return[n,r]}function F_(e,t,a,n=!0){let r=[];if(n)r=r.concat(t.slice(0)),r.push(e[0]/a),r=r.concat(e.slice(1));else{r=r.concat(e[0]);let s=t.length;for(let i=0;i=t*2+1||i%2===1?s.push(i):r.push(i);n.push(...r),n.push(0),n.push(...s)}return n}function D_(e,t,a,n=!0){let r=[];n?r.push(e[0]/a):r.push(e[0]*a);for(let s=1;s/g,x5=",",A5="...";function eO(e,t){e=e.replace(/\s/g,"");let a=(e.length-e.replace(Q_,"").length)/a1.length;if(a<1)throw new Error("Equations without an arrow are not supported.");if(a>1)throw new Error(`Equation must contain exactly one arrow ("${a1}").`);let[n,r]=e.split(a1);P(n.indexOf(A5)===-1,()=>`The ellipsis notation ("${A5}") is not supported yet.`);let s=n.split(x5),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 p=0;pm.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 p=0;pr!==-1),{permutationIndices:a,expandDims:n}}function aO(e,t,a){let n=new Array(e);for(let r=0;r`Expected dimension ${n[t[r][i]]} at axis ${i} of input shaped ${JSON.stringify(s)}, but got dimension ${s[i]}`)}}function nO(e,t){let a=e,n=[],r=0;e.length===0&&a.push(-1),r=e.length+1;for(let i=0;it===a)}function sO(e,t){let a=[];for(let n=0;n"Number of splits must evenly divide the axis."),n=new Array(t).fill(e.shape[a]/t);else{let r=t.reduce((i,o)=>(o===-1&&(i+=1),i),0);P(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[a]-i}P(e.shape[a]===t.reduce((i,o)=>i+o),()=>"The sum of sizes must match the size of the axis dimension."),n=t}return n}function oO(e){return`Received SparseTensor with denseShape[0] = 0 but + indices.shape[0] = ${e}`}function lO(e,t){return`indices(${e}, 0) is invalid: ${t} < 0`}function uO(e,t,a){return`indices(${e}, 0) is invalid: ${t} >= ${a}`}function dO(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function pO(e,t){return`size ${e} must be non-negative, not ${t}`}function cO(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function hO(e,t){let a=mt(e),n=mt(t);return`Input to reshape is a SparseTensor with ${a} + dense values, but the requested shape requires a multiple of ${n}. inputShape=${e} outputShape= ${t}`}function mO(e,t){let a=mt(e),n=mt(t);return`Input to reshape is a tensor with ${a} dense values, but the requested shape has ${n}. inputShape=${e} outputShape=${t}`}function fO(){return"segment ids must be >= 0"}function gO(){return"segment ids are not increasing"}function yO(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function xO(e,t,a){return`Bad: indices[${e}] == ${t} out of range [0, ${a})`}var o6={};Ke(o6,{collectGatherOpShapeInfo:()=>vO,computeOutShape:()=>bO,segOpComputeOptimalWindowSize:()=>AO});function AO(e,t){let a=!1,n;for(e<=f3?(n=e,a=!0):n=yh(e,Math.floor(Math.sqrt(e)));!a;)n>t||n===e?a=!0:n=yh(e,n+1);return n}function bO(e,t,a){let n=[],r=e.length;for(let s=0;sr))throw new Error(`Expect batchDims in the range of [-${r}, ${r}], but got ${n}`);if(n<0&&(n+=r),n>s)throw new Error(`batchDims (${n}) must be less than rank(x) ( + ${s}).`);if(axh(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function kO(e){return e.map(t=>zp(t))}var Fn={};Ke(Fn,{nonMaxSuppressionV3Impl:()=>R7,nonMaxSuppressionV4Impl:()=>E7,nonMaxSuppressionV5Impl:()=>M7,whereImpl:()=>A7});OP();var IO=B();IO.registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,e=>{e&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")});var Ya;(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_QINT16=15]="DT_QINT16",e[e.DT_QUINT16=16]="DT_QUINT16",e[e.DT_UINT16=17]="DT_UINT16",e[e.DT_COMPLEX128=18]="DT_COMPLEX128",e[e.DT_HALF=19]="DT_HALF",e[e.DT_RESOURCE=20]="DT_RESOURCE",e[e.DT_VARIANT=21]="DT_VARIANT",e[e.DT_UINT32=22]="DT_UINT32",e[e.DT_UINT64=23]="DT_UINT64",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",e[e.DT_QINT16_REF=115]="DT_QINT16_REF",e[e.DT_QUINT16_REF=116]="DT_QUINT16_REF",e[e.DT_UINT16_REF=117]="DT_UINT16_REF",e[e.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",e[e.DT_HALF_REF=119]="DT_HALF_REF",e[e.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",e[e.DT_VARIANT_REF=121]="DT_VARIANT_REF",e[e.DT_UINT32_REF=122]="DT_UINT32_REF",e[e.DT_UINT64_REF=123]="DT_UINT64_REF"})(Ya||(Ya={}));var b5;(function(e){let t;(function(a){a[a.LEGACY=0]="LEGACY",a[a.V1=1]="V1",a[a.V2=2]="V2"})(t=e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))})(b5||(b5={}));var g3={};function SO(e,t){let a={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};g3[e]=a}function l6(e){return g3[e]}function TO(e){delete g3[e]}function k(e,t,a,n,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,u=o<0?t.inputNames.length+o:o;if(s.type==="tensor")return da(t.inputNames[u],a,n,r);if(s.type==="tensors"){let p=t.inputs.slice(o,l);return t.inputNames.slice(o,l).filter((h,m)=>{var f;return((f=p[m])===null||f===void 0?void 0:f.op)!=="NoOp"}).map(h=>da(h,a,n,r))}let d=da(t.inputNames[u],a,n,r),c=d.dataSync();return s.type==="number"?c[0]:v.toNestedArray(d.shape,c)}let i=t.attrParams[e];return i&&i.value}function da(e,t,a,n){let[r,s]=Za(e,a);if(n!=null){let o=n.getHashTableHandleByName(r);if(o!=null)return o}let i=a.currentContextIds.find(o=>!!t[kh(r,o)]);return i!==void 0?t[kh(r,i)][s]:void 0}function v5(e,t,a){return t[kh(e,a.currentContextId)]}function kr(e,t){let[a,n,r]=Za(e,t);return[kh(a,t&&t.currentContextId),n,r]}function kh(e,t){return t?`${e}-${t}`:e}function Za(e,t){if(e==="")return["",0,void 0];let a=t!=null&&t.parseNodeNameCache!=null;if(a){let s=t.parseNodeNameCache.get(e);if(s!=null)return s}let n=e.split(":"),r;if(n.length===1)r=[e,0,void 0];else{let s=n[0],i=n.length===3?n[1]:void 0,o=Number(n[n.length-1]);r=[s,o,i]}return a&&t.parseNodeNameCache.set(e,r),r}function lh(e,t,a){let n=k("pad",e,t,a);if(n==="explicit"){n=k("explicitPaddings",e,t,a);let r=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)r[s][0]=n[s*2],r[s][1]=n[s*2+1];return r}return n}function Ir(e){return e.kept?e:Ia(e)}var u6={};Ke(u6,{json:()=>CO});var CO=[{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}]}],d6={};Ke(d6,{json:()=>NO});var NO=[{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:"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}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}],p6={};Ke(p6,{json:()=>RO});var RO=[{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:"TensorListConcatV2",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"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}],c6={};Ke(c6,{json:()=>EO});var EO=[{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",defaultValue:.2}]},{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"}]}],h6={};Ke(h6,{json:()=>MO});var MO=[{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"}]},{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:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{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:"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:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,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"}]}],m6={};Ke(m6,{json:()=>FO});var FO=[{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}]}],f6={};Ke(f6,{json:()=>$O});var $O=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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"}]}],g6={};Ke(g6,{json:()=>DO});var DO=[{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"}]}],y6={};Ke(y6,{json:()=>PO});var PO=[{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"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],x6={};Ke(x6,{json:()=>_O});var _O=[{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"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}],A6={};Ke(A6,{json:()=>OO});var OO=[{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}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}],b6={};Ke(b6,{json:()=>zO});var zO=[{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:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{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"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}],v6={};Ke(v6,{json:()=>LO});var LO=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{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"}]}],w6={};Ke(w6,{json:()=>WO});var WO=[{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"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",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"}]},{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"}]}],k6={};Ke(k6,{json:()=>BO});var BO=[{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}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}],I6={};Ke(I6,{json:()=>VO});var VO=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}],S6={};Ke(S6,{json:()=>UO});var UO=[{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}]}],T6={};Ke(T6,{json:()=>GO});var GO=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}],C6={};Ke(C6,{json:()=>HO});var HO=[{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:"EnsureShape",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:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}],w5=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[u6,d6,p6,c6,h6,m6,f6,g6,y6,x6,A6,b6,v6,w6,k6,I6,S6,T6,C6],t=[].concat(...e.map(a=>a.json));this.opMappers=t.reduce((a,n)=>(a[n.tfOpName]=n,a),{})}transformGraph(e,t={}){let a=e.node,n=[],r=[],s=[],i=a.reduce((m,f)=>(m[f.name]=this.mapNode(f),f.op.startsWith("Placeholder")?n.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=[],u={},d={};t!=null&&(u=this.mapSignatureEntries(t.inputs),d=this.mapSignatureEntries(t.outputs));let c=Object.keys(i);c.forEach(m=>{let f=i[m];f.inputNames.forEach((g,y)=>{let[x,,A]=kr(g),b=i[x];if(b.outputs!=null){let w=b.outputs.indexOf(A);if(w!==-1){let S=`${x}:${w}`;f.inputNames[y]=S}}f.inputs.push(b),b.children.push(f)})}),Object.keys(d).length===0?c.forEach(m=>{let f=i[m];f.children.length===0&&l.push(f)}):Object.keys(d).forEach(m=>{let[f]=kr(m),g=i[f];g!=null&&(g.signatureKey=d[m],l.push(g))}),Object.keys(u).length>0?Object.keys(u).forEach(m=>{let[f]=kr(m),g=i[f];g&&(g.signatureKey=u[m],o.push(g))}):o=n;let p={};e.library!=null&&e.library.function!=null&&(p=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:n,signature:t,functions:p};return s.length>0&&(h.initNodes=s),h}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,a)=>(t[e[a].name]=a,t),{})}mapNode(e){let t=l6(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let a={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(n=>n.startsWith("^")?n.slice(1):n),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return t.inputs!=null&&(a.inputParams=t.inputs.reduce((n,r)=>(n[r.name]={type:r.type,inputIndexStart:r.start,inputIndexEnd:r.end},n),{})),t.attrs!=null&&(a.attrParams=t.attrs.reduce((n,r)=>{let s=r.type,i;switch(r.type){case"string":i=T1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=T1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"string[]":i=$1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=$1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number":i=N1(e.attr,r.tfName,r.defaultValue||0),i===void 0&&r.tfDeprecatedName&&(i=N1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"number[]":i=F1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=F1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool":i=C1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=C1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"bool[]":i=P1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=P1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape":i=M1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=M1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"shape[]":i=D1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=D1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype":i=R1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=R1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"dtype[]":i=E1(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=E1(e.attr,r.tfDeprecatedName,r.defaultValue));break;case"func":i=k5(e.attr,r.tfName,r.defaultValue),i===void 0&&r.tfDeprecatedName&&(i=k5(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 n[r.name]={value:i,type:s},n},{})),a}mapFunction(e){let t=e.nodeDef,a=[],n=[],r={};t!=null&&(r=t.reduce((u,d)=>(u[d.name]=this.mapNode(d),d.op==="Const"&&n.push(u[d.name]),u),{}));let s=[],i=[];e.signature.inputArg.forEach(u=>{let[d]=kr(u.name),c={name:d,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:y3(u.type),type:"dtype"}},children:[]};c.signatureKey=u.name,s.push(c),r[d]=c}),Object.keys(r).forEach(u=>{let d=r[u];d.inputNames.forEach((c,p)=>{let[h,,m]=kr(c),f=r[h];if(f.outputs!=null){let g=f.outputs.indexOf(m);if(g!==-1){let y=`${h}:${g}`;d.inputNames[p]=y}}d.inputs.push(f),f.children.push(d)})});let o=e.ret;e.signature.outputArg.forEach(u=>{let[d,c]=kr(o[u.name]),p=r[d];p!=null&&(p.defaultOutput=c,i.push(p))});let l=this.mapArgsToSignature(e);return{nodes:r,inputs:s,outputs:i,weights:n,placeholders:a,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,a)=>(t[a.name]=this.mapArgToTensorInfo(a),t),{}),outputs:e.signature.outputArg.reduce((t,a)=>(t[a.name]=this.mapArgToTensorInfo(a,e.ret),t),{})}}mapArgToTensorInfo(e,t){let a=e.name;return t!=null&&(a=t[a]),{name:a,dtype:e.type}}};function jO(e){let t=B().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 N6(e,t){let a=Array.isArray(e)?String.fromCharCode.apply(null,e):jO(e);return t?a:a.toLowerCase()}function T1(e,t,a,n=!1){let r=e[t];return r!=null?N6(r.s,n):a}function C1(e,t,a){let n=e[t];return n?n.b:a}function N1(e,t,a){let n=e[t]||{},r=n.i!=null?n.i:n.f!=null?n.f:a;return typeof r=="number"?r:parseInt(r,10)}function y3(e){switch(typeof e=="string"&&(e=Ya[e]),e){case Ya.DT_FLOAT:case Ya.DT_HALF:return"float32";case Ya.DT_INT32:case Ya.DT_INT64:case Ya.DT_INT8:case Ya.DT_UINT8:return"int32";case Ya.DT_BOOL:return"bool";case Ya.DT_DOUBLE:return"float32";case Ya.DT_STRING:return"string";case Ya.DT_COMPLEX64:case Ya.DT_COMPLEX128:return"complex64";default:return null}}function k5(e,t,a){let n=e[t];return n&&n.func?n.func.name:a}function R1(e,t,a){let n=e[t];return n&&n.type?y3(n.type):a}function E1(e,t,a){let n=e[t];return n&&n.list&&n.list.type?n.list.type.map(r=>y3(r)):a}function R6(e){if(!e.unknownRank)return e.dim!=null?e.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function M1(e,t,a){let n=e[t];return n&&n.shape?R6(n.shape):a}function F1(e,t,a){let n=e[t];return n?((n.list.f&&n.list.f.length?n.list.f:n.list.i)||[]).map(r=>typeof r=="number"?r:parseInt(r,10)):a}function $1(e,t,a,n=!1){let r=e[t];return r&&r.list&&r.list.s?r.list.s.map(s=>N6(s,n)):a}function D1(e,t,a){let n=e[t];return n&&n.list&&n.list.shape?n.list.shape.map(r=>R6(r)):a}function P1(e,t,a){let n=e[t];return n&&n.list&&n.list.b?n.list.b:a}var qO=class{constructor(e,t,a){this.node=e,this.tensorMap=t,this.context=a,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(n=>this.getInput(n)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((n,r)=>(n[r]=this.getAttr(r),n),{}))}getInput(e){return da(e,this.tensorMap,this.context)}getAttr(e,t){let a=this.node.rawAttrs[e];if(a.tensor!=null)return da(e,this.tensorMap,this.context);if(a.i!=null||a.f!=null)return N1(this.node.rawAttrs,e,t);if(a.s!=null)return T1(this.node.rawAttrs,e,t);if(a.b!=null)return C1(this.node.rawAttrs,e,t);if(a.shape!=null)return M1(this.node.rawAttrs,e,t);if(a.type!=null)return R1(this.node.rawAttrs,e,t);if(a.list!=null){if(a.list.i!=null||a.list.f!=null)return F1(this.node.rawAttrs,e,t);if(a.list.s!=null)return $1(this.node.rawAttrs,e,t);if(a.list.shape!=null)return D1(this.node.rawAttrs,e,t);if(a.list.b!=null)return P1(this.node.rawAttrs,e,t);if(a.list.type!=null)return E1(this.node.rawAttrs,e,t)}return t}},ta={};Ke(ta,{OP_SCOPE_SUFFIX:()=>hg,abs:()=>Ja,acos:()=>xb,acosh:()=>Ab,add:()=>we,addN:()=>Uh,all:()=>bb,any:()=>vb,argMax:()=>or,argMin:()=>wb,asin:()=>kb,asinh:()=>Ib,atan:()=>Sb,atan2:()=>Tb,atanh:()=>Cb,avgPool:()=>vg,avgPool3d:()=>Mb,basicLSTMCell:()=>Fb,batchNorm:()=>jp,batchNorm2d:()=>$b,batchNorm3d:()=>Db,batchNorm4d:()=>Pb,batchToSpaceND:()=>wg,bincount:()=>kg,bitwiseAnd:()=>_b,booleanMaskAsync:()=>b7,broadcastArgs:()=>Ob,broadcastTo:()=>Ai,buffer:()=>Te,cast:()=>Ue,ceil:()=>zb,clipByValue:()=>Lb,clone:()=>Ia,complex:()=>Rr,concat:()=>lt,concat1d:()=>Wb,concat2d:()=>Xu,concat3d:()=>Bb,concat4d:()=>Vb,conv1d:()=>Ub,conv2d:()=>qp,conv2dTranspose:()=>Hb,conv3d:()=>jb,conv3dTranspose:()=>qb,cos:()=>Xb,cosh:()=>Kb,cosineWindow:()=>t0,cumprod:()=>Yb,cumsum:()=>Zb,denseBincount:()=>Jb,depthToSpace:()=>Qb,depthwiseConv2d:()=>Gh,diag:()=>e4,dilation2d:()=>t4,div:()=>ve,divNoNan:()=>n4,dot:()=>r4,dropout:()=>S7,einsum:()=>hi,elu:()=>Tg,enclosingPowerOfTwo:()=>a3,ensureShape:()=>s4,equal:()=>Sg,erf:()=>i4,euclideanNorm:()=>u4,exp:()=>ls,expandDims:()=>Bt,expm1:()=>d4,eye:()=>Ng,fft:()=>Zh,fill:()=>lr,floor:()=>Rg,floorDiv:()=>Gp,fused:()=>n3,gather:()=>Eg,gatherND:()=>I7,greater:()=>Yp,greaterEqual:()=>Mg,ifft:()=>rp,imag:()=>Zp,image:()=>fe,inTopKAsync:()=>T7,irfft:()=>Yg,isFinite:()=>p4,isInf:()=>c4,isNaN:()=>h4,leakyRelu:()=>Fg,less:()=>bh,lessEqual:()=>Hh,linalg:()=>D7,linspace:()=>m4,localResponseNormalization:()=>f4,log:()=>au,log1p:()=>$g,logSigmoid:()=>y4,logSoftmax:()=>x4,logSumExp:()=>Pg,logicalAnd:()=>tp,logicalNot:()=>_g,logicalOr:()=>Og,logicalXor:()=>A4,losses:()=>P7,lowerBound:()=>b4,matMul:()=>pt,max:()=>fa,maxPool:()=>zg,maxPool3d:()=>v4,maxPoolWithArgmax:()=>w4,maximum:()=>Lg,mean:()=>ap,meshgrid:()=>k4,min:()=>os,minimum:()=>np,mirrorPad:()=>I4,mod:()=>Ku,moments:()=>S4,movingAverage:()=>v7,mul:()=>te,multiRNNCell:()=>T4,multinomial:()=>C4,neg:()=>Vn,norm:()=>Kp,notEqual:()=>Wg,oneHot:()=>vh,ones:()=>Yr,onesLike:()=>N4,op:()=>z,outerProduct:()=>R4,pad:()=>ur,pad1d:()=>E4,pad2d:()=>M4,pad3d:()=>F4,pad4d:()=>$4,pool:()=>D4,pow:()=>tu,prelu:()=>Vg,print:()=>Ag,prod:()=>P4,raggedGather:()=>_4,raggedRange:()=>O4,raggedTensorToTensor:()=>z4,rand:()=>L4,randomGamma:()=>U4,randomNormal:()=>qg,randomStandardNormal:()=>G4,randomUniform:()=>Xh,randomUniformInt:()=>H4,range:()=>nu,real:()=>ru,reciprocal:()=>j4,relu:()=>Jp,relu6:()=>Xg,reshape:()=>Q,reverse:()=>us,reverse1d:()=>q4,reverse2d:()=>X4,reverse3d:()=>K4,reverse4d:()=>Y4,rfft:()=>Jh,round:()=>Kg,rsqrt:()=>Z4,scalar:()=>Ge,scatterND:()=>w7,searchSorted:()=>qh,selu:()=>J4,separableConv2d:()=>Q4,setdiff1dAsync:()=>e7,sigmoid:()=>za,sign:()=>t7,signal:()=>$7,sin:()=>a7,sinh:()=>n7,slice:()=>_e,slice1d:()=>r7,slice2d:()=>s7,slice3d:()=>Qp,slice4d:()=>Kh,softmax:()=>Yh,softplus:()=>Dg,spaceToBatchND:()=>Bg,sparse:()=>_7,sparseToDense:()=>k7,spectral:()=>F7,split:()=>Sa,sqrt:()=>nr,square:()=>En,squaredDifference:()=>Zg,squeeze:()=>Oe,stack:()=>ca,step:()=>Jg,stridedSlice:()=>i7,string:()=>O7,sub:()=>xe,sum:()=>ot,tan:()=>o7,tanh:()=>Ah,tensor:()=>Ve,tensor1d:()=>Vt,tensor2d:()=>er,tensor3d:()=>Qg,tensor4d:()=>l7,tensor5d:()=>u7,tensor6d:()=>d7,tensorScatterUpdate:()=>c7,tile:()=>Qr,topk:()=>h7,transpose:()=>Si,truncatedNormal:()=>m7,unique:()=>f7,unsortedSegmentSum:()=>g7,unstack:()=>Na,upperBound:()=>y7,variable:()=>x7,where:()=>Cr,whereAsync:()=>t3,zeros:()=>An,zerosLike:()=>en});var XO=(e,t,a,n=ta)=>{switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[n.add(k("a",e,t,a),k("b",e,t,a))];case"AddN":return[n.addN(k("tensors",e,t,a))];case"FloorMod":case"Mod":return[n.mod(k("a",e,t,a),k("b",e,t,a))];case"Mul":return[n.mul(k("a",e,t,a),k("b",e,t,a))];case"RealDiv":case"Div":return[n.div(k("a",e,t,a),k("b",e,t,a))];case"DivNoNan":return[n.divNoNan(k("a",e,t,a),k("b",e,t,a))];case"FloorDiv":return[n.floorDiv(k("a",e,t,a),k("b",e,t,a))];case"Sub":return[n.sub(k("a",e,t,a),k("b",e,t,a))];case"Minimum":return[n.minimum(k("a",e,t,a),k("b",e,t,a))];case"Maximum":return[n.maximum(k("a",e,t,a),k("b",e,t,a))];case"Pow":return[n.pow(k("a",e,t,a),k("b",e,t,a))];case"SquaredDifference":return[n.squaredDifference(k("a",e,t,a),k("b",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},KO=(e,t,a,n=ta)=>{switch(e.op){case"Abs":case"ComplexAbs":return[n.abs(k("x",e,t,a))];case"Acos":return[n.acos(k("x",e,t,a))];case"Acosh":return[n.acosh(k("x",e,t,a))];case"Asin":return[n.asin(k("x",e,t,a))];case"Asinh":return[n.asinh(k("x",e,t,a))];case"Atan":return[n.atan(k("x",e,t,a))];case"Atan2":return[n.atan2(k("x",e,t,a),k("y",e,t,a))];case"Atanh":return[n.atanh(k("x",e,t,a))];case"Ceil":return[n.ceil(k("x",e,t,a))];case"Complex":return[n.complex(k("real",e,t,a),k("imag",e,t,a))];case"Cos":return[n.cos(k("x",e,t,a))];case"Cosh":return[n.cosh(k("x",e,t,a))];case"Elu":return[n.elu(k("x",e,t,a))];case"Erf":return[n.erf(k("x",e,t,a))];case"Exp":return[n.exp(k("x",e,t,a))];case"Expm1":return[n.expm1(k("x",e,t,a))];case"Floor":return[n.floor(k("x",e,t,a))];case"Log":return[n.log(k("x",e,t,a))];case"Log1p":return[n.log1p(k("x",e,t,a))];case"Imag":return[n.imag(k("x",e,t,a))];case"Neg":return[n.neg(k("x",e,t,a))];case"Reciprocal":return[n.reciprocal(k("x",e,t,a))];case"Real":return[n.real(k("x",e,t,a))];case"Relu":return[n.relu(k("x",e,t,a))];case"Round":return[n.round(k("x",e,t,a))];case"Selu":return[n.selu(k("x",e,t,a))];case"Sigmoid":return[n.sigmoid(k("x",e,t,a))];case"Sin":return[n.sin(k("x",e,t,a))];case"Sign":return[n.sign(k("x",e,t,a))];case"Sinh":return[n.sinh(k("x",e,t,a))];case"Softplus":return[n.softplus(k("x",e,t,a))];case"Sqrt":return[n.sqrt(k("x",e,t,a))];case"Square":return[n.square(k("x",e,t,a))];case"Tanh":return[n.tanh(k("x",e,t,a))];case"Tan":return[n.tan(k("x",e,t,a))];case"ClipByValue":return[n.clipByValue(k("x",e,t,a),k("clipValueMin",e,t,a),k("clipValueMax",e,t,a))];case"Relu6":return[n.relu6(k("x",e,t,a))];case"Rsqrt":return[n.rsqrt(da(e.inputNames[0],t,a))];case"LeakyRelu":return[n.leakyRelu(k("x",e,t,a),k("alpha",e,t,a))];case"Prelu":return[n.prelu(k("x",e,t,a),k("alpha",e,t,a))];case"IsNan":return[n.isNaN(da(e.inputNames[0],t,a))];case"IsInf":return[n.isInf(da(e.inputNames[0],t,a))];case"IsFinite":return[n.isFinite(da(e.inputNames[0],t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function Rn(e,t,a=""){if(!(typeof e=="number"||typeof t=="number")){v.assert(e.length===t.length,()=>a+` Shapes ${e} and ${t} must match`);for(let n=0;na+` Shapes ${e} and ${t} must match`)}}}function I5(e){return!(typeof e=="number"||e.some(t=>t<0))}function Rd(e,t,a){let n=_1(e,a),r=!I5(n);if(r&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${n}`);if(r&&t.forEach(s=>{n=_1(s.shape,n)}),!I5(n))throw new Error(`Non-fully-defined elementShape: ${n}`);return n}function _1(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 a=[];for(let n=0;n=0&&s>=0&&r!==s)throw new Error(`Incompatible shape during merge: ${e} vs. ${t}`);a[n]=r>=0?r:s}return a}var YO=class{constructor(e,t,a,n,r,s,i){this.name=e,this.dtype=t,this.maxSize=a,this.elementShape=n,this.identicalElementShapes=r,this.dynamicSize=s,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=Ge(0),Bn(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 a=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),Rn(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),a.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(a.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);a.tensor=t,Bn(t),a.written=!0,this.tensors[e]=a}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((a,n)=>this.write(a,t[n]))}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 n=0;n=this.maxSize)throw new Error(`Max index must be < array size (${a} vs. ${this.maxSize})`);this.writeMany(e,Na(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 a=0,n=e.map(o=>(a+=o,a));if(a!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${a}, 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=a===0?0:t.size/a,s=[];De(()=>{t=Q(t,[1,a,r]);for(let o=0;o{if(n!==s.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${s.dtype}`);Cn(a,s.shape,"TensorList shape mismatch: "),zn(s)}),this.idTensor=Ge(0),this.maxNumElements=r,zn(this.idTensor)}copy(){return new E1([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(t){this.tensors.forEach(a=>{(t==null||!t.has(a.id))&&a.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(t,a,n=-1){if(a!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a}, 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.`);Cn(t,this.elementShape,"TensorList shape mismatch: ");let r=vd(this.elementShape,this.tensors,t);return De(()=>{let s=this.tensors.map(i=>Q(i,r));return pa(s,0)})}popBack(t,a){if(a!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");let n=vd(this.elementShape,this.tensors,t),r=this.tensors.pop();return r.kept=!1,Cn(r.shape,t,"TensorList shape mismatch: "),Q(r,n)}pushBack(t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(Cn(t.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");zn(t),this.tensors.push(t)}resize(t){if(t<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${t}`);if(this.maxNumElements!==-1&&t>this.maxNumElements)throw new Error(`TensorListResize input size ${t} is greater maxNumElement ${this.maxNumElements}.`);let a=new E1([],this.elementShape,this.elementDtype,this.maxNumElements);a.tensors.length=t;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${t} in a list with ${this.tensors.length} elements.`);if(this.tensors[t]==null)throw new Error(`element at index ${t} is null.`);Cn(this.tensors[t].shape,a,"TensorList shape mismatch: ");let r=vd(this.elementShape,this.tensors,a);return Q(this.tensors[t],r)}setItem(t,a){if(a.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a.dtype}, but list elements ${this.elementDtype}`);if(t<0||this.maxNumElements!==-1&&t>=this.maxNumElements)throw new Error(`Trying to set element ${t} in a list with max ${this.maxNumElements} elements.`);Cn(this.elementShape,a.shape,"TensorList shape mismatch: "),zn(a),this.tensors[t]!=null&&(this.tensors[t].kept=!1),this.tensors[t]=a}gather(t,a,n){if(a!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a}, but list elements ${this.elementDtype}`);Cn(this.elementShape,n,"TensorList shape mismatch: "),t=t.slice(0,this.size());let r=vd(this.elementShape,this.tensors,n);return t.length===0?Ve([],[0].concat(r)):De(()=>{let s=t.map(i=>Q(this.tensors[i],r));return pa(s,0)})}concat(t,a){if(t&&t!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t}`);Cn(this.elementShape,a,"TensorList shape mismatch: ");let n=vd(this.elementShape,this.tensors,a);return this.size()===0?Ve([],[0].concat(n)):De(()=>{let r=this.tensors.map(s=>Q(s,n));return lt(r,0)})}};function nO(e,t,a){let n=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!==a)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${a}`);let r=e.shape.slice(1);Cn(r,t,"TensorList shape mismatch: ");let s=Na(e);return new Qh(s,t,n)}function rO(e,t,a,n){return new Qh([],e,t,n)}function sO(e,t,a,n){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(n!=null&&n!==-1&&r>=n)throw new Error(`Max index must be < array size (${r} vs. ${n})`);let s=new Qh([],a,e.dtype,n),i=Na(e,0);return t.forEach((o,l)=>{s.setItem(o,i[l])}),s}function iO(e,t,a){let n=0,r=t.map(p=>(n+=p,n));if(n!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to + ${a}, 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=a===0?0:t.size/a,s=[];Pe(()=>{t=Q(t,[1,a,r]);for(let o=0;o{if(n!==s.dtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${s.dtype}`);Rn(a,s.shape,"TensorList shape mismatch: "),Bn(s)}),this.idTensor=Ge(0),this.maxNumElements=r,Bn(this.idTensor)}copy(){return new O1([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(t){this.tensors.forEach(a=>{(t==null||!t.has(a.id))&&a.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(t,a,n=-1){if(a!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a}, 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.`);Rn(t,this.elementShape,"TensorList shape mismatch: ");let r=Rd(this.elementShape,this.tensors,t);return Pe(()=>{let s=this.tensors.map(i=>Q(i,r));return ca(s,0)})}popBack(t,a){if(a!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");let n=Rd(this.elementShape,this.tensors,t),r=this.tensors.pop();return r.kept=!1,Rn(r.shape,t,"TensorList shape mismatch: "),Q(r,n)}pushBack(t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(Rn(t.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Bn(t),this.tensors.push(t)}resize(t){if(t<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${t}`);if(this.maxNumElements!==-1&&t>this.maxNumElements)throw new Error(`TensorListResize input size ${t} is greater maxNumElement ${this.maxNumElements}.`);let a=new O1([],this.elementShape,this.elementDtype,this.maxNumElements);a.tensors.length=t;for(let n=0;nthis.tensors.length)throw new Error(`Trying to access element ${t} in a list with ${this.tensors.length} elements.`);if(this.tensors[t]==null)throw new Error(`element at index ${t} is null.`);Rn(this.tensors[t].shape,a,"TensorList shape mismatch: ");let r=Rd(this.elementShape,this.tensors,a);return Q(this.tensors[t],r)}setItem(t,a){if(a.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a.dtype}, but list elements ${this.elementDtype}`);if(t<0||this.maxNumElements!==-1&&t>=this.maxNumElements)throw new Error(`Trying to set element ${t} in a list with max ${this.maxNumElements} elements.`);Rn(this.elementShape,a.shape,"TensorList shape mismatch: "),Bn(a),this.tensors[t]!=null&&(this.tensors[t].kept=!1),this.tensors[t]=a}gather(t,a,n){if(a!==this.elementDtype)throw new Error(`Invalid data types; op elements ${a}, but list elements ${this.elementDtype}`);Rn(this.elementShape,n,"TensorList shape mismatch: "),t=t.slice(0,this.size());let r=Rd(this.elementShape,this.tensors,n);return t.length===0?Ve([],[0].concat(r)):Pe(()=>{let s=t.map(i=>Q(this.tensors[i],r));return ca(s,0)})}concat(t,a){if(t&&t!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t}`);Rn(this.elementShape,a,"TensorList shape mismatch: ");let n=Rd(this.elementShape,this.tensors,a);return this.size()===0?Ve([],[0].concat(n)):Pe(()=>{let r=this.tensors.map(s=>Q(s,n));return lt(r,0)})}};function ZO(e,t,a){let n=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!==a)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${a}`);let r=e.shape.slice(1);Rn(r,t,"TensorList shape mismatch: ");let s=Na(e);return new o0(s,t,n)}function JO(e,t,a,n){return new o0([],e,t,n)}function QO(e,t,a,n){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(n!=null&&n!==-1&&r>=n)throw new Error(`Max index must be < array size (${r} vs. ${n})`);let s=new o0([],a,e.dtype,n),i=Na(e,0);return t.forEach((o,l)=>{s.setItem(o,i[l])}),s}function ez(e,t,a){let n=0,r=t.map(d=>(n+=d,n));if(n!==e.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: ${e.shape}`);let s=e.shape.slice(1),i=R1(s,a),o=n===0?0:e.size/n,l=De(()=>{let p=[];e=Q(e,[1,n,o]);for(let c=0;c{switch(e.op){case"If":case"StatelessIf":{let n=k("thenBranch",e,t,a),r=k("elseBranch",e,t,a),s=k("cond",e,t,a),i=k("args",e,t,a);return(await s.data())[0]?a.functionMap[n].executeFunctionAsync(i,a.tensorArrayMap,a.tensorListMap):a.functionMap[r].executeFunctionAsync(i,a.tensorArrayMap,a.tensorListMap)}case"While":case"StatelessWhile":{let n=k("body",e,t,a),r=k("cond",e,t,a),s=k("args",e,t,a),i=await a.functionMap[r].executeFunctionAsync(s,a.tensorArrayMap,a.tensorListMap),o=s.map(p=>p.id),l=await i[0].data();i.forEach(p=>{!p.kept&&o.indexOf(p.id)===-1&&p.dispose()});let u=s;for(;l[0];){let p=u;u=await a.functionMap[n].executeFunctionAsync(u,a.tensorArrayMap,a.tensorListMap);let c=u.map(h=>h.id);p.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&c.indexOf(h.id)===-1&&h.dispose()});let d=await a.functionMap[r].executeFunctionAsync(u,a.tensorArrayMap,a.tensorListMap);l=await d[0].data(),d.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&c.indexOf(h.id)===-1&&h.dispose()})}return u}case"LoopCond":{let n=k("pred",e,t,a);return[br(n)]}case"Switch":{let n=k("pred",e,t,a),r=k("data",e,t,a);return r.kept||(r=br(r)),(await n.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{let n=e.inputNames.find(r=>la(r,t,a)!==void 0);if(n){let r=la(n,t,a);return[br(r)]}return}case"Enter":{let n=k("frameName",e,t,a),r=k("tensor",e,t,a);return a.enterFrame(n),[br(r)]}case"Exit":{let n=k("tensor",e,t,a);return a.exitFrame(),[br(n)]}case"NextIteration":{let n=k("tensor",e,t,a);return a.nextIteration(),[br(n)]}case"TensorArrayV3":{let n=k("size",e,t,a),r=k("dtype",e,t,a),s=k("elementShape",e,t,a),i=k("dynamicSize",e,t,a),o=k("clearAfterRead",e,t,a),l=k("identicalElementShapes",e,t,a),u=k("name",e,t,a),p=new aO(u,r,n,s,l,i,o);return a.addTensorArray(p),[p.idTensor,Ge(1)]}case"TensorArrayWriteV3":{let n=k("tensorArrayId",e,t,a),r=k("index",e,t,a),s=k("tensor",e,t,a),i=a.getTensorArray(n.id);return i.write(r,s),[i.idTensor]}case"TensorArrayReadV3":{let n=k("tensorArrayId",e,t,a),r=k("index",e,t,a);return[a.getTensorArray(n.id).read(r)]}case"TensorArrayGatherV3":{let n=k("tensorArrayId",e,t,a),r=k("indices",e,t,a),s=k("dtype",e,t,a);return[a.getTensorArray(n.id).gather(r,s)]}case"TensorArrayScatterV3":{let n=k("tensorArrayId",e,t,a),r=k("indices",e,t,a),s=k("tensor",e,t,a),i=a.getTensorArray(n.id);return i.scatter(r,s),[i.idTensor]}case"TensorArrayConcatV3":{let n=k("tensorArrayId",e,t,a),r=a.getTensorArray(n.id),s=k("dtype",e,t,a);return[r.concat(s)]}case"TensorArraySplitV3":{let n=k("tensorArrayId",e,t,a),r=k("tensor",e,t,a),s=k("lengths",e,t,a),i=a.getTensorArray(n.id);return i.split(s,r),[i.idTensor]}case"TensorArraySizeV3":{let n=k("tensorArrayId",e,t,a),r=a.getTensorArray(n.id);return[Ge(r.size(),"int32")]}case"TensorArrayCloseV3":{let n=k("tensorArrayId",e,t,a),r=a.getTensorArray(n.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{let n=k("tensorListId",e,t,a),r=k("index",e,t,a),s=k("tensor",e,t,a),i=a.getTensorList(n.id);return i.setItem(r,s),[i.idTensor]}case"TensorListGetItem":{let n=k("tensorListId",e,t,a),r=k("index",e,t,a),s=k("elementShape",e,t,a),i=k("elementDType",e,t,a);return[a.getTensorList(n.id).getItem(r,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let n=k("indices",e,t,a),r=k("tensor",e,t,a),s=k("elementShape",e,t,a),i=k("numElements",e,t,a),o=sO(r,n,s,i);return a.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let n=k("elementShape",e,t,a),r=k("elementDType",e,t,a),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=k(s,e,t,a),o=e.op==="TensorListReserve"?-1:i,l=rO(n,r,i,o);return a.addTensorList(l),[l.idTensor]}case"TensorListGather":{let n=k("tensorListId",e,t,a),r=k("indices",e,t,a),s=k("elementShape",e,t,a),i=k("elementDType",e,t,a);return[a.getTensorList(n.id).gather(r,i,s)]}case"TensorListStack":{let n=k("tensorListId",e,t,a),r=k("elementShape",e,t,a),s=k("elementDType",e,t,a),i=k("numElements",e,t,a);return[a.getTensorList(n.id).stack(r,s,i)]}case"TensorListFromTensor":{let n=k("tensor",e,t,a),r=k("elementShape",e,t,a),s=k("elementDType",e,t,a),i=nO(n,r,s);return a.addTensorList(i),[i.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{let n=k("tensorListId",e,t,a),r=a.getTensorList(n.id),s=k("dtype",e,t,a),i=k("elementShape",e,t,a);return[r.concat(s,i)]}case"TensorListPushBack":{let n=k("tensorListId",e,t,a),r=k("tensor",e,t,a),s=a.getTensorList(n.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{let n=k("tensorListId",e,t,a),r=k("elementShape",e,t,a),s=k("elementDType",e,t,a);return[a.getTensorList(n.id).popBack(r,s)]}case"TensorListSplit":{let n=k("tensor",e,t,a),r=k("elementShape",e,t,a),s=k("lengths",e,t,a),i=iO(n,s,r);return a.addTensorList(i),[i.idTensor]}case"TensorListLength":{let n=k("tensorListId",e,t,a),r=a.getTensorList(n.id);return[Ge(r.size(),"int32")]}case"TensorListResize":{let n=k("tensorListId",e,t,a),r=k("size",e,t,a),s=a.getTensorList(n.id).resize(r);return a.addTensorList(s),[s.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function p5(e,t,a){let[n,r]=k("fusedOps",e,t,a),s=n==="biasadd",i=!s,o=r==="prelu",l=n==="fusedbatchnorm",u=k("numArgs",e,t,a);if(s){if(o&&u!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&s&&u!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let p=k("strides",e,t,a),c=eh(e,t,a),d=k("dataFormat",e,t,a).toUpperCase(),h=k("dilations",e,t,a),[m,f]=k("args",e,t,a);i&&(f=m,m=void 0);let g=k("leakyreluAlpha",e,t,a);return{stride:p,pad:c,dataFormat:d,dilations:h,biasArg:m,preluArg:f,activationFunc:r,leakyreluAlpha:g}}var lO=(e,t,a,n=Qt)=>{switch(e.op){case"Conv1D":{let r=k("stride",e,t,a),s=k("pad",e,t,a),i=k("dataFormat",e,t,a).toUpperCase(),o=k("dilation",e,t,a);return[n.conv1d(k("x",e,t,a),k("filter",e,t,a),r,s,i,o)]}case"Conv2D":{let r=k("strides",e,t,a),s=eh(e,t,a),i=k("dataFormat",e,t,a).toUpperCase(),o=k("dilations",e,t,a);return[n.conv2d(k("x",e,t,a),k("filter",e,t,a),[r[1],r[2]],s,i,[o[1],o[2]])]}case"_FusedConv2D":{let{stride:r,pad:s,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:p,leakyreluAlpha:c}=p5(e,t,a);return[n.fused.conv2d({x:k("x",e,t,a),filter:k("filter",e,t,a),strides:[r[1],r[2]],pad:s,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:p,preluActivationWeights:u,leakyreluAlpha:c})]}case"FusedDepthwiseConv2dNative":{let{stride:r,pad:s,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:p,leakyreluAlpha:c}=p5(e,t,a);return[n.fused.depthwiseConv2d({x:k("x",e,t,a),filter:k("filter",e,t,a),strides:[r[1],r[2]],pad:s,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:p,preluActivationWeights:u,leakyreluAlpha:c})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let r=k("outputShape",e,t,a),s=k("strides",e,t,a),i=eh(e,t,a);return[n.conv2dTranspose(k("x",e,t,a),k("filter",e,t,a),r,[s[1],s[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let r=k("strides",e,t,a),s=eh(e,t,a),i=k("dilations",e,t,a),o=k("dataFormat",e,t,a).toUpperCase();return[n.depthwiseConv2d(k("input",e,t,a),k("filter",e,t,a),[r[1],r[2]],s,o,[i[1],i[2]])]}case"Conv3D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("dataFormat",e,t,a).toUpperCase(),o=k("dilations",e,t,a);return[n.conv3d(k("x",e,t,a),k("filter",e,t,a),[r[1],r[2],r[3]],s,i,[o[1],o[2],o[3]])]}case"AvgPool":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.avgPool(k("x",e,t,a),[i[1],i[2]],[r[1],r[2]],s)]}case"MaxPool":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.maxPool(k("x",e,t,a),[i[1],i[2]],[r[1],r[2]],s)]}case"MaxPoolWithArgmax":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a),o=k("includeBatchInIndex",e,t,a),{result:l,indexes:u}=n.maxPoolWithArgmax(k("x",e,t,a),[i[1],i[2]],[r[1],r[2]],s,o);return[l,u]}case"AvgPool3D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.avgPool3d(k("x",e,t,a),[i[1],i[2],i[3]],[r[1],r[2],r[3]],s)]}case"MaxPool3D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.maxPool3d(k("x",e,t,a),[i[1],i[2],i[3]],[r[1],r[2],r[3]],s)]}case"Dilation2D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("dilations",e,t,a),o=r[1],l=r[2],u=i[1],p=i[2];return[n.dilation2d(k("x",e,t,a),k("filter",e,t,a),[o,l],s,[u,p],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},uO=(e,t,a,n=Qt)=>{switch(e.op){case"Fill":{let r=k("shape",e,t,a),s=k("dtype",e,t,a),i=k("value",e,t,a);return[n.fill(r,i,s)]}case"LinSpace":{let r=k("start",e,t,a),s=k("stop",e,t,a),i=k("num",e,t,a);return[n.linspace(r,s,i)]}case"Multinomial":{let r=k("logits",e,t,a),s=k("numSamples",e,t,a),i=k("seed",e,t,a);return[n.multinomial(r,s,i)]}case"OneHot":{let r=k("indices",e,t,a),s=k("depth",e,t,a),i=k("onValue",e,t,a),o=k("offValue",e,t,a),l=k("dtype",e,t,a);return[n.oneHot(r,s,i,o,l)]}case"Ones":return[n.ones(k("shape",e,t,a),k("dtype",e,t,a))];case"OnesLike":return[n.onesLike(k("x",e,t,a))];case"RandomStandardNormal":return[n.randomStandardNormal(k("shape",e,t,a),k("dtype",e,t,a),k("seed",e,t,a))];case"RandomUniform":return[n.randomUniform(k("shape",e,t,a),k("minval",e,t,a),k("maxval",e,t,a),k("dtype",e,t,a))];case"RandomUniformInt":return[n.randomUniformInt(k("shape",e,t,a),k("minval",e,t,a),k("maxval",e,t,a),k("seed",e,t,a))];case"Range":{let r=k("start",e,t,a),s=k("stop",e,t,a),i=k("step",e,t,a);return[n.range(r,s,i,k("dtype",e,t,a))]}case"TruncatedNormal":{let r=k("shape",e,t,a),s=k("mean",e,t,a),i=k("stdDev",e,t,a),o=k("seed",e,t,a);return[n.truncatedNormal(r,s,i,k("dtype",e,t,a),o)]}case"Zeros":return[n.zeros(k("shape",e,t,a),k("dtype",e,t,a))];case"ZerosLike":return[n.zerosLike(k("x",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function Y2(e,t,a){let n=k("boxes",e,t,a),r=k("scores",e,t,a),s=k("maxOutputSize",e,t,a),i=k("iouThreshold",e,t,a),o=k("scoreThreshold",e,t,a),l=k("softNmsSigma",e,t,a);return{boxes:n,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}}var dO=async(e,t,a,n,r=Qt)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:s,scores:i,maxOutputSize:o,iouThreshold:l,scoreThreshold:u,softNmsSigma:p}=Y2(e,t,a),c=await r.image.nonMaxSuppressionWithScoreAsync(s,i,o,l,u,p);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:s,scores:i,maxOutputSize:o,iouThreshold:l,scoreThreshold:u}=Y2(e,t,a),p=k("padToMaxOutputSize",e,t,a),c=await r.image.nonMaxSuppressionPaddedAsync(s,i,o,l,u,p);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:s,scores:i,maxOutputSize:o,iouThreshold:l,scoreThreshold:u}=Y2(e,t,a);return[await r.image.nonMaxSuppressionAsync(s,i,o,l,u)]}case"Where":{let s=r.cast(k("condition",e,t,a),"bool"),i=[await r.whereAsync(s)];return s.dispose(),i}case"ListDiff":return r.setdiff1dAsync(k("x",e,t,a),k("y",e,t,a));default:throw TypeError(`Node type ${e.op} is not implemented`)}},pO=(e,t,a,n=Qt)=>{switch(e.op){case"LowerBound":{let r=k("sortedSequence",e,t,a),s=k("values",e,t,a);return[n.lowerBound(r,s)]}case"TopKV2":{let r=k("x",e,t,a),s=k("k",e,t,a),i=k("sorted",e,t,a),o=n.topk(r,s,i);return[o.values,o.indices]}case"UpperBound":{let r=k("sortedSequence",e,t,a),s=k("values",e,t,a);return[n.upperBound(r,s)]}case"Unique":{let r=k("x",e,t,a),s=n.unique(r);return[s.values,s.indices]}case"UniqueV2":{let r=k("x",e,t,a),s=k("axis",e,t,a),i=n.unique(r,s);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},cO=(e,t,a,n=Qt)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let r=k("default",e,t,a);return[la(e.name,t,a)||r];case"Placeholder":return[la(e.name,t,a)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let p=k("x",e,t,a);return[br(p)]}case"IdentityN":return k("x",e,t,a).map(p=>br(p));case"Snapshot":let s=k("x",e,t,a);return[br(s)];case"Shape":return[n.tensor1d(k("x",e,t,a).shape,"int32")];case"ShapeN":return k("x",e,t,a).map(p=>n.tensor1d(p.shape));case"Size":return[n.scalar(k("x",e,t,a).size,"int32")];case"Rank":return[n.scalar(k("x",e,t,a).rank,"int32")];case"NoOp":return[n.scalar(1)];case"Print":let i=k("x",e,t,a),o=k("data",e,t,a),l=k("message",e,t,a),u=k("summarize",e,t,a);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(l);for(let p=0;pe.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Ge(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let a=await e.data();return this.tensorMap.forEach(n=>n.dispose()),this.tensorMap.clear(),De(()=>{let n=Na(t),r=a.length,s=n.length;v.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 n=[];for(let r=0;r{switch(e.op){case"HashTable":case"HashTableV2":{let r=n.getHashTableHandleByName(e.name);if(r!=null)return[r];{let s=k("keyDType",e,t,a),i=k("valueDType",e,t,a),o=new hO(s,i);return n.addHashTable(e.name,o),[o.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{let r=k("tableHandle",e,t,a,n),s=k("keys",e,t,a),i=k("values",e,t,a);return[await n.getHashTableById(r.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let r=k("tableHandle",e,t,a,n),s=k("keys",e,t,a),i=k("defaultValue",e,t,a);return[await n.getHashTableById(r.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let r=k("tableHandle",e,t,a,n);return[n.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},fO=(e,t,a,n=Qt)=>{switch(e.op){case"ResizeBilinear":{let r=k("images",e,t,a),s=k("size",e,t,a),i=k("alignCorners",e,t,a),o=k("halfPixelCenters",e,t,a);return[n.image.resizeBilinear(r,[s[0],s[1]],i,o)]}case"ResizeNearestNeighbor":{let r=k("images",e,t,a),s=k("size",e,t,a),i=k("alignCorners",e,t,a),o=k("halfPixelCenters",e,t,a);return[n.image.resizeNearestNeighbor(r,[s[0],s[1]],i,o)]}case"CropAndResize":{let r=k("image",e,t,a),s=k("boxes",e,t,a),i=k("boxInd",e,t,a),o=k("cropSize",e,t,a),l=k("method",e,t,a),u=k("extrapolationValue",e,t,a);return[n.image.cropAndResize(r,s,i,o,l,u)]}case"ImageProjectiveTransformV3":{let r=k("images",e,t,a),s=k("transforms",e,t,a),i=k("outputShape",e,t,a),o=k("fillValue",e,t,a),l=k("interpolation",e,t,a),u=k("fillMode",e,t,a);return[n.image.transform(r,s,l.toLowerCase(),u.toLowerCase(),o,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},gO=(e,t,a,n=Qt)=>{switch(e.op){case"Equal":return[n.equal(k("a",e,t,a),k("b",e,t,a))];case"NotEqual":return[n.notEqual(k("a",e,t,a),k("b",e,t,a))];case"Greater":return[n.greater(k("a",e,t,a),k("b",e,t,a))];case"GreaterEqual":return[n.greaterEqual(k("a",e,t,a),k("b",e,t,a))];case"Less":return[n.less(k("a",e,t,a),k("b",e,t,a))];case"LessEqual":return[n.lessEqual(k("a",e,t,a),k("b",e,t,a))];case"LogicalAnd":return[n.logicalAnd(k("a",e,t,a),k("b",e,t,a))];case"LogicalNot":return[n.logicalNot(k("a",e,t,a))];case"LogicalOr":return[n.logicalOr(k("a",e,t,a),k("b",e,t,a))];case"Select":case"SelectV2":return[n.where(k("condition",e,t,a),k("a",e,t,a),k("b",e,t,a))];case"BitwiseAnd":return[n.bitwiseAnd(k("a",e,t,a),k("b",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},yO=(e,t,a,n=Qt)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[n.matMul(k("a",e,t,a),k("b",e,t,a),k("transposeA",e,t,a),k("transposeB",e,t,a))];case"Einsum":return[n.einsum(k("equation",e,t,a),...k("tensors",e,t,a))];case"Transpose":return[n.transpose(k("x",e,t,a),k("perm",e,t,a))];case"_FusedMatMul":let[r,s]=k("fusedOps",e,t,a),i=r==="biasadd",o=s==="prelu",l=k("numArgs",e,t,a),u=k("leakyreluAlpha",e,t,a);if(i){if(o&&l!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&l!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[p,c]=k("args",e,t,a);return[n.fused.matMul({a:k("a",e,t,a),b:k("b",e,t,a),transposeA:k("transposeA",e,t,a),transposeB:k("transposeB",e,t,a),bias:p,activation:s,preluActivationWeights:c,leakyreluAlpha:u})];case"MatrixBandPart":return[n.linalg.bandPart(k("a",e,t,a),k("numLower",e,t,a),k("numUpper",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},xO=(e,t,a,n=Qt)=>{switch(e.op){case"EuclideanNorm":return[n.euclideanNorm(k("x",e,t,a),k("axis",e,t,a),k("keepDims",e,t,a))];case"FusedBatchNorm":case"FusedBatchNormV2":return[n.batchNorm(k("x",e,t,a),k("mean",e,t,a),k("variance",e,t,a),k("offset",e,t,a),k("scale",e,t,a),k("epsilon",e,t,a))];case"FusedBatchNormV3":return[n.batchNorm(k("x",e,t,a),k("mean",e,t,a),k("variance",e,t,a),k("offset",e,t,a),k("scale",e,t,a),k("epsilon",e,t,a))];case"LRN":return[n.localResponseNormalization(k("x",e,t,a),k("radius",e,t,a),k("bias",e,t,a),k("alpha",e,t,a),k("beta",e,t,a))];case"Softmax":return[n.softmax(k("x",e,t,a))];case"LogSoftmax":return[n.logSoftmax(k("x",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},AO=(e,t,a,n=Qt)=>{switch(e.op){case"RaggedGather":{let{outputNestedSplits:r,outputDenseValues:s}=n.raggedGather(k("paramsNestedSplits",e,t,a),k("paramsDenseValues",e,t,a),k("indices",e,t,a),k("outputRaggedRank",e,t,a));return r.concat(s)}case"RaggedRange":{let{rtNestedSplits:r,rtDenseValues:s}=n.raggedRange(k("starts",e,t,a),k("limits",e,t,a),k("splits",e,t,a));return[r,s]}case"RaggedTensorToTensor":return[n.raggedTensorToTensor(k("shape",e,t,a),k("values",e,t,a),k("defaultValue",e,t,a),k("rowPartitionTensors",e,t,a),k("rowPartitionTypes",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},bO=(e,t,a,n=Qt)=>{switch(e.op){case"Max":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.max(k("x",e,t,a),o,l)]}case"Mean":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.mean(k("x",e,t,a),o,l)]}case"Min":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.min(k("x",e,t,a),o,l)]}case"Sum":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.sum(k("x",e,t,a),o,l)]}case"All":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.all(k("x",e,t,a),o,l)]}case"Any":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.any(k("x",e,t,a),o,l)]}case"ArgMax":{let o=k("axis",e,t,a);return[n.argMax(k("x",e,t,a),o)]}case"ArgMin":{let o=k("axis",e,t,a);return[n.argMin(k("x",e,t,a),o)]}case"Prod":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.prod(k("x",e,t,a),o,l)]}case"Cumprod":{let o=k("axis",e,t,a),l=k("exclusive",e,t,a),u=k("reverse",e,t,a);return[n.cumprod(k("x",e,t,a),o,l,u)]}case"Cumsum":{let o=k("axis",e,t,a),l=k("exclusive",e,t,a),u=k("reverse",e,t,a);return[n.cumsum(k("x",e,t,a),o,l,u)]}case"Bincount":let r=k("x",e,t,a),s=k("weights",e,t,a),i=k("size",e,t,a);return[n.bincount(r,s,i)];case"DenseBincount":{let o=k("x",e,t,a),l=k("weights",e,t,a),u=k("size",e,t,a),p=k("binaryOutput",e,t,a);return[n.denseBincount(o,l,u,p)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},vO=(e,t,a,n=Qt)=>{switch(e.op){case"ConcatV2":case"Concat":{let r=k("n",e,t,a),s=k("axis",e,t,a),i=k("tensors",e,t,a);return i=i.slice(0,r),[n.concat(i,s)]}case"Gather":{let r=k("x",e,t,a),s=k("indices",e,t,a);return[n.gather(r,n.cast(s,"int32"),0)]}case"GatherV2":{let r=k("axis",e,t,a),s=k("batchDims",e,t,a),i=k("x",e,t,a),o=k("indices",e,t,a);return[n.gather(i,n.cast(o,"int32"),r,s)]}case"Reverse":{let r=k("dims",e,t,a),s=[];for(let o=0;o{let r=k("axis",e,t,a),s=k("tensors",e,t,a),i=s[0].shape,o=n.squeeze(s[0]).shape,l=s.map(u=>{let p=v.arraysEqual(u.shape,i);if(!p&&!v.arraysEqual(n.squeeze(u).shape,o))throw new Error("the input tensors shape does not match");return p?u:n.reshape(u,i)});return[n.stack(l,r)]});case"Unpack":{let r=k("axis",e,t,a),s=k("tensor",e,t,a);return n.unstack(s,r)}case"Tile":{let r=k("reps",e,t,a);return[n.tile(k("x",e,t,a),r)]}case"Split":case"SplitV":{let r=k("axis",e,t,a),s=k("numOrSizeSplits",e,t,a),i=k("x",e,t,a);return n.split(i,s,r)}case"ScatterNd":{let r=k("indices",e,t,a),s=k("values",e,t,a),i=k("shape",e,t,a);return[n.scatterND(r,s,i)]}case"GatherNd":{let r=k("x",e,t,a),s=k("indices",e,t,a);return[n.gatherND(r,s)]}case"SparseToDense":{let r=k("sparseIndices",e,t,a),s=k("outputShape",e,t,a),i=k("sparseValues",e,t,a),o=k("defaultValue",e,t,a);return[n.sparseToDense(r,i,s,i.dtype===o.dtype?o:n.cast(o,i.dtype))]}case"TensorScatterUpdate":{let r=k("indices",e,t,a),s=k("values",e,t,a),i=k("tensor",e,t,a);return[n.tensorScatterUpdate(i,r,s)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},wO=(e,t,a,n=Qt)=>{switch(e.op){case"SparseFillEmptyRows":{let{outputIndices:r,outputValues:s,emptyRowIndicator:i,reverseIndexMap:o}=n.sparse.sparseFillEmptyRows(k("indices",e,t,a),k("values",e,t,a),k("denseShape",e,t,a),k("defaultValue",e,t,a));return[r,s,i,o]}case"SparseReshape":{let{outputIndices:r,outputShape:s}=n.sparse.sparseReshape(k("inputIndices",e,t,a),k("inputShape",e,t,a),k("newShape",e,t,a));return[r,s]}case"SparseSegmentMean":return[n.sparse.sparseSegmentMean(k("data",e,t,a),k("indices",e,t,a),k("segmentIds",e,t,a))];case"SparseSegmentSum":return[n.sparse.sparseSegmentSum(k("data",e,t,a),k("indices",e,t,a),k("segmentIds",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},kO=(e,t,a,n=Qt)=>{switch(e.op){case"FFT":return[n.fft(k("x",e,t,a))];case"IFFT":return[n.ifft(k("x",e,t,a))];case"RFFT":return[n.rfft(k("x",e,t,a))];case"IRFFT":return[n.irfft(k("x",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},IO=(e,t,a,n=Qt)=>{switch(e.op){case"StaticRegexReplace":return[n.string.staticRegexReplace(k("input",e,t,a),k("pattern",e,t,a),k("rewrite",e,t,a),k("replaceGlobal",e,t,a))];case"StringNGrams":{let{nGrams:r,nGramsSplits:s}=n.string.stringNGrams(k("data",e,t,a),k("dataSplits",e,t,a),k("separator",e,t,a),k("nGramWidths",e,t,a),k("leftPad",e,t,a),k("rightPad",e,t,a),k("padWidth",e,t,a),k("preserveShortSequences",e,t,a));return[r,s]}case"StringSplit":{let{indices:r,values:s,shape:i}=n.string.stringSplit(k("input",e,t,a),k("delimiter",e,t,a),k("skipEmpty",e,t,a));return[r,s,i]}case"StringToHashBucketFast":return[n.string.stringToHashBucketFast(k("input",e,t,a),k("numBuckets",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},SO=(e,t,a,n=Qt)=>{switch(e.op){case"Cast":return[n.cast(k("x",e,t,a),k("dtype",e,t,a))];case"ExpandDims":{let r=k("axis",e,t,a);return[n.expandDims(k("x",e,t,a),r)]}case"Squeeze":{let r=k("axis",e,t,a);return[n.squeeze(k("x",e,t,a),r)]}case"Reshape":return[n.reshape(k("x",e,t,a),k("shape",e,t,a))];case"EnsureShape":return[n.ensureShape(k("x",e,t,a),k("shape",e,t,a))];case"MirrorPad":return[n.mirrorPad(k("x",e,t,a),k("padding",e,t,a),k("mode",e,t,a))];case"PadV2":case"Pad":return[n.pad(k("x",e,t,a),k("padding",e,t,a),k("constantValue",e,t,a))];case"SpaceToBatchND":{let r=k("blockShape",e,t,a),s=k("paddings",e,t,a);return[n.spaceToBatchND(k("x",e,t,a),r,s)]}case"BatchToSpaceND":{let r=k("blockShape",e,t,a),s=k("crops",e,t,a);return[n.batchToSpaceND(k("x",e,t,a),r,s)]}case"DepthToSpace":{let r=k("blockSize",e,t,a),s=k("dataFormat",e,t,a).toUpperCase();return[n.depthToSpace(k("x",e,t,a),r,s)]}case"BroadcastTo":return[n.broadcastTo(k("x",e,t,a),k("shape",e,t,a))];case"BroadcastArgs":return[n.broadcastArgs(k("s0",e,t,a),k("s1",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function c5(e,t,a,n,r=De){let s=((i,o,l)=>{switch(i.category){case"arithmetic":return r(()=>eO(i,o,l));case"basic_math":return r(()=>tO(i,o,l));case"control":return oO(i,o,l);case"convolution":return r(()=>lO(i,o,l));case"creation":return r(()=>uO(i,o,l));case"dynamic":return dO(i,o,l);case"evaluation":return r(()=>pO(i,o,l));case"image":return r(()=>fO(i,o,l));case"graph":return r(()=>cO(i,o,l));case"logical":return r(()=>gO(i,o,l));case"matrices":return r(()=>yO(i,o,l));case"normalization":return r(()=>xO(i,o,l));case"ragged":return r(()=>AO(i,o,l));case"reduction":return r(()=>bO(i,o,l));case"slice_join":return r(()=>vO(i,o,l));case"sparse":return r(()=>wO(i,o,l));case"spectral":return r(()=>kO(i,o,l));case"string":return r(()=>IO(i,o,l));case"transformation":return r(()=>SO(i,o,l));case"hash_table":return mO(i,o,l,n);case"custom":let u=V7(i.op);if(u&&u.customExecutor)return u.customExecutor(new QD(i,o,l));throw TypeError(`Custom op ${i.op} is not registered.`);default:throw TypeError(`Unknown op '${i.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,a);return v.isPromise(s)?s.then(i=>[].concat(i)):[].concat(s)}var h5=class{constructor(e={},t={},a={},n={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=a,this.functionMap=n,this.parseNodeNameCache=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 m5(e,t,a,n){let r=new Set,s=[],i=null,o=null,l=new Set,u=new Set(Object.keys(e).map(d=>Ka(d)[0]));n=n||[];let p=new Set(n.map(d=>Ka(d.name)[0])),c=[...t];for(;c.length>0;){let d=c.pop();if((Vs(d)||_O(d)||$O(d))&&i==null&&(i=d,o=i.children.map(h=>h.name).filter(h=>r.has(h))),r.add(d.name),a[d.name]==null&&!u.has(d.name)&&!p.has(d.name)){if(d.inputs.length===0){s.push(d.name);continue}d.inputs.forEach(h=>{l.has(h.name)||(l.add(h.name),c.push(h))})}}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:i,syncInputs:o}}function CO(e,t){let{usedNodes:a,inputs:n}=t,r=Object.keys(n).map(g=>Ka(g)[0]).map(g=>e.nodes[g]),s=e.initNodes||[],i=g=>a.has(typeof g=="string"?g:g.name);function o(g){return[...new Map(g.map(y=>[y.name,y])).values()]}let l=o([...r,...e.weights,...s]).filter(i),u=o([...l,...Object.values(e.nodes)]).filter(i),p=new Map(u.map(g=>[g.name,g])),c={};for(let g of u){c[g.name]=c[g.name]||0;for(let y of g.children)i(y)||(c[y.name]=Number.POSITIVE_INFINITY),c[y.name]=(c[y.name]||0)+1}let d=Object.entries(c).filter(([,g])=>g===0).map(([g])=>g),h=[...d];for(;d.length>0;){let g=d.pop(),y=p.get(g);for(let x of y.children.filter(i))--c[x.name]===0&&(h.push(x.name),d.push(x.name))}let m=h.map(g=>p.get(g)),f=TO(m,l);return NO(f,l),f}function TO(e,t){let a=new Map(e.map(s=>[s.name,s])),n=t.map(s=>s.name),r=new Set(n);for(;n.length>0;){let s=n.pop(),i=a.get(s);for(let o of i.children)!a.has(o.name)||r.has(o.name)||(r.add(o.name),n.push(o.name))}return e.filter(s=>r.has(s.name))}var qc=class extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}};function NO(e,t){let a=new Map(e.map((o,l)=>[o.name,l])),n=new Set(t.map(o=>o.name)),r=o=>n.has(typeof o=="string"?o:o.name),s=new Set(e.map(o=>o.name)),i=o=>s.has(typeof o=="string"?o:o.name);for(let o of e){for(let l of o.children.filter(i)){if(!a.has(l.name))throw new qc(`Child ${l.name} of node ${o.name} is unreachable.`);if(a.get(o.name)>a.get(l.name))throw new qc(`Node ${o.name} is scheduled to run after its child ${l.name}.`)}if(!r(o))for(let l of o.inputs){if(!a.has(l.name))throw new qc(`Input ${l.name} of node ${o.name} is unreachable.`);if(a.get(l.name)>a.get(o.name))throw new qc(`Node ${o.name} is scheduled to run before its input ${l.name}.`)}}}function RO(e){let t=new Map(e.map((o,l)=>[o.name,l])),a=Number.MAX_SAFE_INTEGER,n=e.map((o,l)=>Vs(o)?a:l),r=o=>{let l=n[t.get(o.name)];return l==null?-1:l},s=e.map((o,l)=>o.children.map(r).reduce((u,p)=>Math.max(u,p),n[l])),i=new Map;for(let o=0;ot[n].map(r=>r.id));this._weightIds=[].concat(...a),this._weightMap=t}set resourceManager(t){this._resourceManager=t}get inputs(){return this._inputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(t=>t.signatureKey||t.name)}get outputNodes(){return this._outputs.map(t=>{let a=t.signatureKey||t.name;return t.defaultOutput?`${a}:${t.defaultOutput}`:a})}get functions(){return Object.keys(this._functions).reduce((t,a)=>(t[a]=this._functions[a].signature,t),{})}constructor(t,a){this.graph=t,this.parent=a,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,t.functions!=null&&Object.keys(t.functions).forEach(n=>{this._functionExecutorMap[n]=new d6(t.functions[n],this)})}getCompilationKey(t,a){let n=t.map(s=>s.name).sort(),r=a.map(s=>s.name).sort();return n.join(this.SEPARATOR)+"--"+r.join(this.SEPARATOR)}compile(t,a){let n=m5(t,a,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:s,syncInputs:i}=n;if(s!=null)throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${i}]`);if(r.length>0){let u=a.map(c=>c.name),p=Object.keys(t);throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${p}]. Missing the following inputs: [${r}]`)}let o=CO(this.graph,n),l=RO(o);return{orderedNodes:o,nodeLiveUntilMap:l}}cloneAndKeepTensor(t){if(t==null)return null;let a=t.clone();return zn(a),a}cloneTensorList(t){return t?t.map(a=>this.cloneAndKeepTensor(a)):null}cloneTensorMap(t){return Object.fromEntries(Object.entries(t).map(([a,n])=>[a,this.cloneTensorList(n)]))}execute(t,a){this.disposeIntermediateTensors(),t=this.mapInputs(t);let n=Object.keys(t).sort();this.checkInputs(t),this.checkInputShapeAndType(t),a=this.mapOutputs(a),this.checkOutputs(a);let r=n.map(d=>this.graph.nodes[Ka(d)[0]]),s=a.map(d=>Ka(d)[0]),i=new Set(s),o=s.map(d=>this.graph.nodes[d]);o.length===0&&(o=this._outputs);let l=this.getCompilationKey(r,o),u=this.compiledMap.get(l);u==null&&(u=this.compile(t,o),this.compiledMap.set(l,u));try{this.keepIntermediateTensors=B().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(d){this.keepIntermediateTensors=!1,console.warn(d.message)}let p={},c={};return De(()=>{let d=new h5(this.weightMap,p,c,this.functionExecutorMap,this.parseNodeNameCache),h=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(t).forEach(y=>{let[x,A]=Ka(y,d),b=[];b[A]=t[y],h[x]=b,this.keepIntermediateTensors&&(this.clonedTensorsMap[x]=this.cloneTensorList(b))});let m=this.getFrozenTensorIds(h),{orderedNodes:f,nodeLiveUntilMap:g}=u;for(let y of f){if(h[y.name])continue;let x=c5(y,h,d,this._resourceManager);if(v.isPromise(x))throw new Error(`The execution of the op '${y.op}' returned a promise. Please use model.executeAsync() instead.`);h[y.name]=x,this.keepIntermediateTensors&&(this.clonedTensorsMap[y.name]=this.cloneTensorList(x)),this.checkTensorForDisposalWithNodeLiveUntilInfo(y,h,d,m,i,g.get(y.name))}return this.parent==null&&d.dispose(m),a.map(y=>la(y,h,d))})}getFrozenTensorIds(t){let a=[].concat.apply([],Object.keys(t).map(n=>t[n]).map(n=>n.map(r=>r.id)));return new Set(a)}checkTensorForDisposal(t,a,n,r,s,i,o){if(!(Vs(a)||i.has(t))){for(let l of n[t])l!=null&&(o[l.id]=(o[l.id]||0)+a.children.length);for(let l of a.inputs){if(Vs(l))continue;let u=o5(l.name,n,r);if(u!=null)for(let p of u){if(!p||p.kept||s.has(p.id))continue;let c=o[p.id];c===1?(p.dispose(),delete o[p.id]):c!=null&&o[p.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(t,a,n,r,s,i){function o(l){return Vs(l)||s.has(l.name)}if(!(Vs(t)||i==null))for(let l of i){if(o(l))continue;let u=o5(l.name,a,n);for(let p of u)!p||p.kept||r.has(p.id)||p.dispose()}}async executeAsync(t,a){return this._executeAsync(t,a)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(t=>{for(let a of t)a&&!a.isDisposed&&a.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(t,a,n=!1,r={},s={}){this.disposeIntermediateTensors(),n||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),a=this.mapOutputs(a),this.checkOutputs(a));try{this.keepIntermediateTensors=B().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(d){this.keepIntermediateTensors=!1,console.warn(d.message)}let i=new h5(this.weightMap,r,s,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));let o=await this.executeWithControlFlow(t,i,a,n),l=a.map(d=>la(d,o,i)),u=l.map(d=>d.id),p=Object.keys(t).map(d=>t[d].id),c=new Set([...u,...p,...this.weightIds]);return Object.values(o).forEach(d=>{d.forEach(h=>{h&&!h.isDisposed&&!c.has(h.id)&&h.dispose()})}),this.parent==null&&i.dispose(c),l}async executeFunctionAsync(t,a,n){let r=t.reduce((s,i,o)=>(s[this.inputs[o].name]=i,s),{});return this._executeAsync(r,this.outputNodes,!0,a,n)}async executeWithControlFlow(t,a,n,r){let s=Object.keys(t),i=s.map(b=>this.graph.nodes[Ka(b)[0]]),o=n.map(b=>Ka(b)[0]),l=new Set(o),u=o.map(b=>this.graph.nodes[b]);u.length===0&&(u=this._outputs);let{usedNodes:p,missingInputs:c,dynamicNode:d,syncInputs:h}=m5(t,u,this.weightMap,this._initNodes),m=[...i,...this.graph.weights,...this._initNodes||[]].map(b=>({node:b,contexts:a.currentContext})),f=Object.assign({},this.weightMap);Object.keys(t).forEach(b=>{let[w,I]=Ka(b),T=[];T[I]=t[b],f[w]=T});let g={},y=this.getFrozenTensorIds(f),x={};for(;m.length>0;){let b=this.processStack(i,m,a,f,x,y,l,g,p);await Promise.all(b)}d==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 A=u.filter(b=>!Vs(b)&&!la(b.name,f,a)).map(b=>b.name);if(A.length>0){let b="";throw d!=null&&(b=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${A}] from the provided inputs [${s}]. Consider providing the following inputs: [${c}]. ${b}`)}return f}processStack(t,a,n,r,s,i,o,l,u){let p=[];for(;a.length>0;){let c=a.pop();n.currentContext=c.contexts;let d="";if(c.node.op==="Enter"&&k("isConstant",c.node,r,n)&&([d]=Ar(c.node.name,n)),r[c.node.name]==null){let h=c5(c.node,r,n,this._resourceManager);d||([d]=Ar(c.node.name,n));let m=n.currentContext;v.isPromise(h)?p.push(h.then(f=>(r[d]=f,this.keepIntermediateTensors&&(this.clonedTensorsMap[d]=this.cloneTensorList(f)),n.currentContext=m,this.checkTensorForDisposal(d,c.node,r,n,i,o,l),this.processChildNodes(c.node,a,n,r,s,u),f))):(r[d]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[d]=this.cloneTensorList(h)),this.checkTensorForDisposal(d,c.node,r,n,i,o,l),this.processChildNodes(c.node,a,n,r,s,u))}else this.processChildNodes(c.node,a,n,r,s,u)}return p}processChildNodes(t,a,n,r,s,i){t.children.forEach(o=>{let[l]=Ar(o.name,n);s[l]||!i.has(o.name)||(o.op==="Merge"?o.inputNames.some(u=>!!la(u,r,n))&&(s[l]=!0,a.push({contexts:n.currentContext,node:o})):o.inputNames.every(u=>!!la(u,r,n))&&(s[l]=!0,a.push({contexts:n.currentContext,node:o})))})}dispose(){Object.keys(this.weightMap).forEach(t=>this.weightMap[t].forEach(a=>a.dispose()))}checkInputShapeAndType(t){Object.keys(t).forEach(a=>{let n=t[a],[r]=Ka(a),s=this.graph.nodes[r];if(s.attrParams.shape&&s.attrParams.shape.value){let i=s.attrParams.shape.value,o=i.length===n.shape.length&&n.shape.every((l,u)=>i[u]===-1||i[u]===l);v.assert(o,()=>`The shape of dict['${s.name}'] provided in model.execute(dict) must be [${i}], but was [${n.shape}]`)}s.attrParams.dtype&&s.attrParams.dtype.value&&v.assert(n.dtype===s.attrParams.dtype.value,()=>`The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(t){var a,n;let r={};for(let s in t){let i=(n=(a=this._signature)===null||a===void 0?void 0:a.inputs)===null||n===void 0?void 0:n[s];i!=null?r[i.name]=t[s]:r[s]=t[s]}return r}checkInputs(t){let a=Object.keys(t).filter(n=>{let[r]=Ka(n);return this.graph.nodes[r]==null});if(a.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${a}] that are not part of graph`)}mapOutputs(t){return t.map(a=>{var n,r;let s=(r=(n=this._signature)===null||n===void 0?void 0:n.outputs)===null||r===void 0?void 0:r[a];return s!=null?s.name:a},{})}checkOutputs(t){t.forEach(a=>{let[n]=Ka(a);if(!this.graph.nodes[n])throw new Error(`The output '${a}' is not found in the graph`)})}},FO=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]}},DO="?tfjs-format=file",OO="model.json",jp=class{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}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},a=Xn){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=a,t==null&&(this.loadOptions={}),this.resourceManager=new FO}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{let t=this.io.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(this.io.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]}}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=this.handler.load();return v.isPromise(e)?e.then(t=>this.loadSync(t)):this.loadSync(e)}loadSync(e){this.artifacts=e;let t=this.artifacts.modelTopology,a=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){let r=this.artifacts.userDefinedMetadata;r.signature!=null&&(a=r.signature),r.structuredOutputKeys!=null&&(this.structuredOutputKeys=r.structuredOutputKeys)}this.signature=a,this.version=`${t.versions.producer}.${t.versions.minConsumer}`;let n=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new f5(l5.Instance.transformGraph(t,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(n),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let r=l5.Instance.transformGraph(e.modelInitializer);this.initializer=new f5(r),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if(typeof e=="string"){let a=this.io.getSaveHandlers(e);if(a.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(a.length>1)throw new Error(`Found more than one (${a.length}) save handlers for URL '${e}'`);e=a[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)}addStructuredOutputNames(e){if(this.structuredOutputKeys){let t=e instanceof gt?[e]:e,a={};return t.forEach((n,r)=>a[this.structuredOutputKeys[r]]=n),a}return e}predict(e,t){let a=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(a)}async predictAsync(e,t){let a=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(a)}normalizeInputs(e){var t;if(!(e instanceof gt)&&!Array.isArray(e)){let r=(t=this.signature)===null||t===void 0?void 0:t.inputs;if(r!=null)for(let s in r){let i=r[s];i.resourceId!=null&&(e[s]=this.resourceIdToCapturedInput[i.resourceId])}return e}e=Array.isArray(e)?e:[e];let a=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+a!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-a} non-resource placeholders, while there are ${e.length} input tensors provided.`);let n=0;return this.inputNodes.reduce((r,s)=>{var i,o,l;let u=(l=(o=(i=this.signature)===null||i===void 0?void 0:i.inputs)===null||o===void 0?void 0:o[s])===null||l===void 0?void 0:l.resourceId;return u!=null?r[s]=this.resourceIdToCapturedInput[u]:r[s]=e[n++],r},{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){let t=this.initializerSignature.outputs,a=Object.keys(t);for(let n=0;n1?a:a[0]}async executeAsync(e,t){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let a=await this.executor.executeAsync(e,t);return a.length>1?a:a[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,a)=>(t[a]=[e[a]],t),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&J(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}};async function u3(e,t={},a=Xn){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&&typeof e=="string"&&(e=LO(e));let n=new jp(e,t,a);return await n.load(),n}function zO(e){if(e==null)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(e instanceof Array){let[n,r]=e;if(!n)throw new Error("modelJSON must be the first element of the array");if(!r||!(r instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in n))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in n))throw new Error("Model JSON is missing 'weightsManifest'");let s=Xn.getWeightSpecs(n.weightsManifest),i=Xn.getModelArtifactsForJSONSync(n,s,r);t=Xn.fromMemorySync(i)}else if("load"in e)t=e;else if("modelTopology"in e&&"weightSpecs"in e&&"weightData"in e)t=Xn.fromMemorySync(e);else throw new Error("Unknown model format");let a=new jp(t);return a.load(),a}function LO(e){return e.endsWith("/")||(e=e+"/"),`${e}${OO}${DO}`}var WO="4.14.0";function Ie(e,t){Array.isArray(e)||(e=[e]),e.forEach(a=>{a!=null&&v.assert(a.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var BO=Rn.whereImpl,d3=class p6 extends au{nextDataId(){return p6.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new rp(this,It())}write(t,a,n){this.firstUse&&(this.firstUse=!1,B().get("IS_NODE")&&C.warn(` + ${n}, and tensor's shape is: ${e.shape}`);let s=e.shape.slice(1),i=_1(s,a),o=n===0?0:e.size/n,l=Pe(()=>{let d=[];e=Q(e,[1,n,o]);for(let c=0;c{switch(e.op){case"If":case"StatelessIf":{let n=k("thenBranch",e,t,a),r=k("elseBranch",e,t,a),s=k("cond",e,t,a),i=k("args",e,t,a);return(await s.data())[0]?a.functionMap[n].executeFunctionAsync(i,a.tensorArrayMap,a.tensorListMap):a.functionMap[r].executeFunctionAsync(i,a.tensorArrayMap,a.tensorListMap)}case"While":case"StatelessWhile":{let n=k("body",e,t,a),r=k("cond",e,t,a),s=k("args",e,t,a),i=await a.functionMap[r].executeFunctionAsync(s,a.tensorArrayMap,a.tensorListMap),o=s.map(d=>d.id),l=await i[0].data();i.forEach(d=>{!d.kept&&o.indexOf(d.id)===-1&&d.dispose()});let u=s;for(;l[0];){let d=u;u=await a.functionMap[n].executeFunctionAsync(u,a.tensorArrayMap,a.tensorListMap);let c=u.map(h=>h.id);d.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&c.indexOf(h.id)===-1&&h.dispose()});let p=await a.functionMap[r].executeFunctionAsync(u,a.tensorArrayMap,a.tensorListMap);l=await p[0].data(),p.forEach(h=>{!h.kept&&o.indexOf(h.id)===-1&&c.indexOf(h.id)===-1&&h.dispose()})}return u}case"LoopCond":{let n=k("pred",e,t,a);return[Ir(n)]}case"Switch":{let n=k("pred",e,t,a),r=k("data",e,t,a);return r.kept||(r=Ir(r)),(await n.data())[0]?[void 0,r]:[r,void 0]}case"Merge":{let n=e.inputNames.find(r=>da(r,t,a)!==void 0);if(n){let r=da(n,t,a);return[Ir(r)]}return}case"Enter":{let n=k("frameName",e,t,a),r=k("tensor",e,t,a);return a.enterFrame(n),[Ir(r)]}case"Exit":{let n=k("tensor",e,t,a);return a.exitFrame(),[Ir(n)]}case"NextIteration":{let n=k("tensor",e,t,a);return a.nextIteration(),[Ir(n)]}case"TensorArrayV3":{let n=k("size",e,t,a),r=k("dtype",e,t,a),s=k("elementShape",e,t,a),i=k("dynamicSize",e,t,a),o=k("clearAfterRead",e,t,a),l=k("identicalElementShapes",e,t,a),u=k("name",e,t,a),d=new YO(u,r,n,s,l,i,o);return a.addTensorArray(d),[d.idTensor,Ge(1)]}case"TensorArrayWriteV3":{let n=k("tensorArrayId",e,t,a),r=k("index",e,t,a),s=k("tensor",e,t,a),i=a.getTensorArray(n.id);return i.write(r,s),[i.idTensor]}case"TensorArrayReadV3":{let n=k("tensorArrayId",e,t,a),r=k("index",e,t,a);return[a.getTensorArray(n.id).read(r)]}case"TensorArrayGatherV3":{let n=k("tensorArrayId",e,t,a),r=k("indices",e,t,a),s=k("dtype",e,t,a);return[a.getTensorArray(n.id).gather(r,s)]}case"TensorArrayScatterV3":{let n=k("tensorArrayId",e,t,a),r=k("indices",e,t,a),s=k("tensor",e,t,a),i=a.getTensorArray(n.id);return i.scatter(r,s),[i.idTensor]}case"TensorArrayConcatV3":{let n=k("tensorArrayId",e,t,a),r=a.getTensorArray(n.id),s=k("dtype",e,t,a);return[r.concat(s)]}case"TensorArraySplitV3":{let n=k("tensorArrayId",e,t,a),r=k("tensor",e,t,a),s=k("lengths",e,t,a),i=a.getTensorArray(n.id);return i.split(s,r),[i.idTensor]}case"TensorArraySizeV3":{let n=k("tensorArrayId",e,t,a),r=a.getTensorArray(n.id);return[Ge(r.size(),"int32")]}case"TensorArrayCloseV3":{let n=k("tensorArrayId",e,t,a),r=a.getTensorArray(n.id);return r.clearAndClose(),[r.idTensor]}case"TensorListSetItem":{let n=k("tensorListId",e,t,a),r=k("index",e,t,a),s=k("tensor",e,t,a),i=a.getTensorList(n.id);return i.setItem(r,s),[i.idTensor]}case"TensorListGetItem":{let n=k("tensorListId",e,t,a),r=k("index",e,t,a),s=k("elementShape",e,t,a),i=k("elementDType",e,t,a);return[a.getTensorList(n.id).getItem(r,s,i)]}case"TensorListScatterV2":case"TensorListScatter":{let n=k("indices",e,t,a),r=k("tensor",e,t,a),s=k("elementShape",e,t,a),i=k("numElements",e,t,a),o=QO(r,n,s,i);return a.addTensorList(o),[o.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let n=k("elementShape",e,t,a),r=k("elementDType",e,t,a),s;e.op==="TensorListReserve"?s="numElements":s="maxNumElements";let i=k(s,e,t,a),o=e.op==="TensorListReserve"?-1:i,l=JO(n,r,i,o);return a.addTensorList(l),[l.idTensor]}case"TensorListGather":{let n=k("tensorListId",e,t,a),r=k("indices",e,t,a),s=k("elementShape",e,t,a),i=k("elementDType",e,t,a);return[a.getTensorList(n.id).gather(r,i,s)]}case"TensorListStack":{let n=k("tensorListId",e,t,a),r=k("elementShape",e,t,a),s=k("elementDType",e,t,a),i=k("numElements",e,t,a);return[a.getTensorList(n.id).stack(r,s,i)]}case"TensorListFromTensor":{let n=k("tensor",e,t,a),r=k("elementShape",e,t,a),s=k("elementDType",e,t,a),i=ZO(n,r,s);return a.addTensorList(i),[i.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{let n=k("tensorListId",e,t,a),r=a.getTensorList(n.id),s=k("dtype",e,t,a),i=k("elementShape",e,t,a);return[r.concat(s,i)]}case"TensorListPushBack":{let n=k("tensorListId",e,t,a),r=k("tensor",e,t,a),s=a.getTensorList(n.id);return s.pushBack(r),[s.idTensor]}case"TensorListPopBack":{let n=k("tensorListId",e,t,a),r=k("elementShape",e,t,a),s=k("elementDType",e,t,a);return[a.getTensorList(n.id).popBack(r,s)]}case"TensorListSplit":{let n=k("tensor",e,t,a),r=k("elementShape",e,t,a),s=k("lengths",e,t,a),i=ez(n,s,r);return a.addTensorList(i),[i.idTensor]}case"TensorListLength":{let n=k("tensorListId",e,t,a),r=a.getTensorList(n.id);return[Ge(r.size(),"int32")]}case"TensorListResize":{let n=k("tensorListId",e,t,a),r=k("size",e,t,a),s=a.getTensorList(n.id).resize(r);return a.addTensorList(s),[s.idTensor]}default:throw TypeError(`Node type ${e.op} is not implemented`)}};function S5(e,t,a){let[n,r]=k("fusedOps",e,t,a),s=n==="biasadd",i=!s,o=r==="prelu",l=n==="fusedbatchnorm",u=k("numArgs",e,t,a);if(s){if(o&&u!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&s&&u!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let d=k("strides",e,t,a),c=lh(e,t,a),p=k("dataFormat",e,t,a).toUpperCase(),h=k("dilations",e,t,a),[m,f]=k("args",e,t,a);i&&(f=m,m=void 0);let g=k("leakyreluAlpha",e,t,a);return{stride:d,pad:c,dataFormat:p,dilations:h,biasArg:m,preluArg:f,activationFunc:r,leakyreluAlpha:g}}var az=(e,t,a,n=ta)=>{switch(e.op){case"Conv1D":{let r=k("stride",e,t,a),s=k("pad",e,t,a),i=k("dataFormat",e,t,a).toUpperCase(),o=k("dilation",e,t,a);return[n.conv1d(k("x",e,t,a),k("filter",e,t,a),r,s,i,o)]}case"Conv2D":{let r=k("strides",e,t,a),s=lh(e,t,a),i=k("dataFormat",e,t,a).toUpperCase(),o=k("dilations",e,t,a);return[n.conv2d(k("x",e,t,a),k("filter",e,t,a),[r[1],r[2]],s,i,[o[1],o[2]])]}case"_FusedConv2D":{let{stride:r,pad:s,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:d,leakyreluAlpha:c}=S5(e,t,a);return[n.fused.conv2d({x:k("x",e,t,a),filter:k("filter",e,t,a),strides:[r[1],r[2]],pad:s,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:d,preluActivationWeights:u,leakyreluAlpha:c})]}case"FusedDepthwiseConv2dNative":{let{stride:r,pad:s,dataFormat:i,dilations:o,biasArg:l,preluArg:u,activationFunc:d,leakyreluAlpha:c}=S5(e,t,a);return[n.fused.depthwiseConv2d({x:k("x",e,t,a),filter:k("filter",e,t,a),strides:[r[1],r[2]],pad:s,dataFormat:i,dilations:[o[1],o[2]],bias:l,activation:d,preluActivationWeights:u,leakyreluAlpha:c})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let r=k("outputShape",e,t,a),s=k("strides",e,t,a),i=lh(e,t,a);return[n.conv2dTranspose(k("x",e,t,a),k("filter",e,t,a),r,[s[1],s[2]],i)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let r=k("strides",e,t,a),s=lh(e,t,a),i=k("dilations",e,t,a),o=k("dataFormat",e,t,a).toUpperCase();return[n.depthwiseConv2d(k("input",e,t,a),k("filter",e,t,a),[r[1],r[2]],s,o,[i[1],i[2]])]}case"Conv3D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("dataFormat",e,t,a).toUpperCase(),o=k("dilations",e,t,a);return[n.conv3d(k("x",e,t,a),k("filter",e,t,a),[r[1],r[2],r[3]],s,i,[o[1],o[2],o[3]])]}case"AvgPool":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.avgPool(k("x",e,t,a),[i[1],i[2]],[r[1],r[2]],s)]}case"MaxPool":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.maxPool(k("x",e,t,a),[i[1],i[2]],[r[1],r[2]],s)]}case"MaxPoolWithArgmax":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a),o=k("includeBatchInIndex",e,t,a),{result:l,indexes:u}=n.maxPoolWithArgmax(k("x",e,t,a),[i[1],i[2]],[r[1],r[2]],s,o);return[l,u]}case"AvgPool3D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.avgPool3d(k("x",e,t,a),[i[1],i[2],i[3]],[r[1],r[2],r[3]],s)]}case"MaxPool3D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("kernelSize",e,t,a);return[n.maxPool3d(k("x",e,t,a),[i[1],i[2],i[3]],[r[1],r[2],r[3]],s)]}case"Dilation2D":{let r=k("strides",e,t,a),s=k("pad",e,t,a),i=k("dilations",e,t,a),o=r[1],l=r[2],u=i[1],d=i[2];return[n.dilation2d(k("x",e,t,a),k("filter",e,t,a),[o,l],s,[u,d],"NHWC")]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},nz=(e,t,a,n=ta)=>{switch(e.op){case"Fill":{let r=k("shape",e,t,a),s=k("dtype",e,t,a),i=k("value",e,t,a);return[n.fill(r,i,s)]}case"LinSpace":{let r=k("start",e,t,a),s=k("stop",e,t,a),i=k("num",e,t,a);return[n.linspace(r,s,i)]}case"Multinomial":{let r=k("logits",e,t,a),s=k("numSamples",e,t,a),i=k("seed",e,t,a);return[n.multinomial(r,s,i)]}case"OneHot":{let r=k("indices",e,t,a),s=k("depth",e,t,a),i=k("onValue",e,t,a),o=k("offValue",e,t,a),l=k("dtype",e,t,a);return[n.oneHot(r,s,i,o,l)]}case"Ones":return[n.ones(k("shape",e,t,a),k("dtype",e,t,a))];case"OnesLike":return[n.onesLike(k("x",e,t,a))];case"RandomStandardNormal":return[n.randomStandardNormal(k("shape",e,t,a),k("dtype",e,t,a),k("seed",e,t,a))];case"RandomUniform":return[n.randomUniform(k("shape",e,t,a),k("minval",e,t,a),k("maxval",e,t,a),k("dtype",e,t,a))];case"RandomUniformInt":return[n.randomUniformInt(k("shape",e,t,a),k("minval",e,t,a),k("maxval",e,t,a),k("seed",e,t,a))];case"Range":{let r=k("start",e,t,a),s=k("stop",e,t,a),i=k("step",e,t,a);return[n.range(r,s,i,k("dtype",e,t,a))]}case"TruncatedNormal":{let r=k("shape",e,t,a),s=k("mean",e,t,a),i=k("stdDev",e,t,a),o=k("seed",e,t,a);return[n.truncatedNormal(r,s,i,k("dtype",e,t,a),o)]}case"Zeros":return[n.zeros(k("shape",e,t,a),k("dtype",e,t,a))];case"ZerosLike":return[n.zerosLike(k("x",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function n1(e,t,a){let n=k("boxes",e,t,a),r=k("scores",e,t,a),s=k("maxOutputSize",e,t,a),i=k("iouThreshold",e,t,a),o=k("scoreThreshold",e,t,a),l=k("softNmsSigma",e,t,a);return{boxes:n,scores:r,maxOutputSize:s,iouThreshold:i,scoreThreshold:o,softNmsSigma:l}}var rz=async(e,t,a,n,r=ta)=>{switch(e.op){case"NonMaxSuppressionV5":{let{boxes:s,scores:i,maxOutputSize:o,iouThreshold:l,scoreThreshold:u,softNmsSigma:d}=n1(e,t,a),c=await r.image.nonMaxSuppressionWithScoreAsync(s,i,o,l,u,d);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:s,scores:i,maxOutputSize:o,iouThreshold:l,scoreThreshold:u}=n1(e,t,a),d=k("padToMaxOutputSize",e,t,a),c=await r.image.nonMaxSuppressionPaddedAsync(s,i,o,l,u,d);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:s,scores:i,maxOutputSize:o,iouThreshold:l,scoreThreshold:u}=n1(e,t,a);return[await r.image.nonMaxSuppressionAsync(s,i,o,l,u)]}case"Where":{let s=r.cast(k("condition",e,t,a),"bool"),i=[await r.whereAsync(s)];return s.dispose(),i}case"ListDiff":return r.setdiff1dAsync(k("x",e,t,a),k("y",e,t,a));default:throw TypeError(`Node type ${e.op} is not implemented`)}},sz=(e,t,a,n=ta)=>{switch(e.op){case"LowerBound":{let r=k("sortedSequence",e,t,a),s=k("values",e,t,a);return[n.lowerBound(r,s)]}case"TopKV2":{let r=k("x",e,t,a),s=k("k",e,t,a),i=k("sorted",e,t,a),o=n.topk(r,s,i);return[o.values,o.indices]}case"UpperBound":{let r=k("sortedSequence",e,t,a),s=k("values",e,t,a);return[n.upperBound(r,s)]}case"Unique":{let r=k("x",e,t,a),s=n.unique(r);return[s.values,s.indices]}case"UniqueV2":{let r=k("x",e,t,a),s=k("axis",e,t,a),i=n.unique(r,s);return[i.values,i.indices]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},iz=(e,t,a,n=ta)=>{switch(e.op){case"Const":return t[e.name];case"PlaceholderWithDefault":let r=k("default",e,t,a);return[da(e.name,t,a)||r];case"Placeholder":return[da(e.name,t,a)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let d=k("x",e,t,a);return[Ir(d)]}case"IdentityN":return k("x",e,t,a).map(d=>Ir(d));case"Snapshot":let s=k("x",e,t,a);return[Ir(s)];case"Shape":return[n.tensor1d(k("x",e,t,a).shape,"int32")];case"ShapeN":return k("x",e,t,a).map(d=>n.tensor1d(d.shape));case"Size":return[n.scalar(k("x",e,t,a).size,"int32")];case"Rank":return[n.scalar(k("x",e,t,a).rank,"int32")];case"NoOp":return[n.scalar(1)];case"Print":let i=k("x",e,t,a),o=k("data",e,t,a),l=k("message",e,t,a),u=k("summarize",e,t,a);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(l);for(let d=0;de.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return Ge(this.size(),"int32")}async import(e,t){this.checkKeyAndValueTensor(e,t);let a=await e.data();return this.tensorMap.forEach(n=>n.dispose()),this.tensorMap.clear(),Pe(()=>{let n=Na(t),r=a.length,s=n.length;v.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 n=[];for(let r=0;r{switch(e.op){case"HashTable":case"HashTableV2":{let r=n.getHashTableHandleByName(e.name);if(r!=null)return[r];{let s=k("keyDType",e,t,a),i=k("valueDType",e,t,a),o=new oz(s,i);return n.addHashTable(e.name,o),[o.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{let r=k("tableHandle",e,t,a,n),s=k("keys",e,t,a),i=k("values",e,t,a);return[await n.getHashTableById(r.id).import(s,i)]}case"LookupTableFind":case"LookupTableFindV2":{let r=k("tableHandle",e,t,a,n),s=k("keys",e,t,a),i=k("defaultValue",e,t,a);return[await n.getHashTableById(r.id).find(s,i)]}case"LookupTableSize":case"LookupTableSizeV2":{let r=k("tableHandle",e,t,a,n);return[n.getHashTableById(r.id).tensorSize()]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},uz=(e,t,a,n=ta)=>{switch(e.op){case"ResizeBilinear":{let r=k("images",e,t,a),s=k("size",e,t,a),i=k("alignCorners",e,t,a),o=k("halfPixelCenters",e,t,a);return[n.image.resizeBilinear(r,[s[0],s[1]],i,o)]}case"ResizeNearestNeighbor":{let r=k("images",e,t,a),s=k("size",e,t,a),i=k("alignCorners",e,t,a),o=k("halfPixelCenters",e,t,a);return[n.image.resizeNearestNeighbor(r,[s[0],s[1]],i,o)]}case"CropAndResize":{let r=k("image",e,t,a),s=k("boxes",e,t,a),i=k("boxInd",e,t,a),o=k("cropSize",e,t,a),l=k("method",e,t,a),u=k("extrapolationValue",e,t,a);return[n.image.cropAndResize(r,s,i,o,l,u)]}case"ImageProjectiveTransformV3":{let r=k("images",e,t,a),s=k("transforms",e,t,a),i=k("outputShape",e,t,a),o=k("fillValue",e,t,a),l=k("interpolation",e,t,a),u=k("fillMode",e,t,a);return[n.image.transform(r,s,l.toLowerCase(),u.toLowerCase(),o,i)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},dz=(e,t,a,n=ta)=>{switch(e.op){case"Equal":return[n.equal(k("a",e,t,a),k("b",e,t,a))];case"NotEqual":return[n.notEqual(k("a",e,t,a),k("b",e,t,a))];case"Greater":return[n.greater(k("a",e,t,a),k("b",e,t,a))];case"GreaterEqual":return[n.greaterEqual(k("a",e,t,a),k("b",e,t,a))];case"Less":return[n.less(k("a",e,t,a),k("b",e,t,a))];case"LessEqual":return[n.lessEqual(k("a",e,t,a),k("b",e,t,a))];case"LogicalAnd":return[n.logicalAnd(k("a",e,t,a),k("b",e,t,a))];case"LogicalNot":return[n.logicalNot(k("a",e,t,a))];case"LogicalOr":return[n.logicalOr(k("a",e,t,a),k("b",e,t,a))];case"Select":case"SelectV2":return[n.where(k("condition",e,t,a),k("a",e,t,a),k("b",e,t,a))];case"BitwiseAnd":return[n.bitwiseAnd(k("a",e,t,a),k("b",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},pz=(e,t,a,n=ta)=>{switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[n.matMul(k("a",e,t,a),k("b",e,t,a),k("transposeA",e,t,a),k("transposeB",e,t,a))];case"Einsum":return[n.einsum(k("equation",e,t,a),...k("tensors",e,t,a))];case"Transpose":return[n.transpose(k("x",e,t,a),k("perm",e,t,a))];case"_FusedMatMul":let[r,s]=k("fusedOps",e,t,a),i=r==="biasadd",o=s==="prelu",l=k("numArgs",e,t,a),u=k("leakyreluAlpha",e,t,a);if(i){if(o&&l!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!o&&l!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[d,c]=k("args",e,t,a);return[n.fused.matMul({a:k("a",e,t,a),b:k("b",e,t,a),transposeA:k("transposeA",e,t,a),transposeB:k("transposeB",e,t,a),bias:d,activation:s,preluActivationWeights:c,leakyreluAlpha:u})];case"MatrixBandPart":return[n.linalg.bandPart(k("a",e,t,a),k("numLower",e,t,a),k("numUpper",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},cz=(e,t,a,n=ta)=>{switch(e.op){case"EuclideanNorm":return[n.euclideanNorm(k("x",e,t,a),k("axis",e,t,a),k("keepDims",e,t,a))];case"FusedBatchNorm":case"FusedBatchNormV2":return[n.batchNorm(k("x",e,t,a),k("mean",e,t,a),k("variance",e,t,a),k("offset",e,t,a),k("scale",e,t,a),k("epsilon",e,t,a))];case"FusedBatchNormV3":return[n.batchNorm(k("x",e,t,a),k("mean",e,t,a),k("variance",e,t,a),k("offset",e,t,a),k("scale",e,t,a),k("epsilon",e,t,a))];case"LRN":return[n.localResponseNormalization(k("x",e,t,a),k("radius",e,t,a),k("bias",e,t,a),k("alpha",e,t,a),k("beta",e,t,a))];case"Softmax":return[n.softmax(k("x",e,t,a))];case"LogSoftmax":return[n.logSoftmax(k("x",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},hz=(e,t,a,n=ta)=>{switch(e.op){case"RaggedGather":{let{outputNestedSplits:r,outputDenseValues:s}=n.raggedGather(k("paramsNestedSplits",e,t,a),k("paramsDenseValues",e,t,a),k("indices",e,t,a),k("outputRaggedRank",e,t,a));return r.concat(s)}case"RaggedRange":{let{rtNestedSplits:r,rtDenseValues:s}=n.raggedRange(k("starts",e,t,a),k("limits",e,t,a),k("splits",e,t,a));return[r,s]}case"RaggedTensorToTensor":return[n.raggedTensorToTensor(k("shape",e,t,a),k("values",e,t,a),k("defaultValue",e,t,a),k("rowPartitionTensors",e,t,a),k("rowPartitionTypes",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},mz=(e,t,a,n=ta)=>{switch(e.op){case"Max":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.max(k("x",e,t,a),o,l)]}case"Mean":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.mean(k("x",e,t,a),o,l)]}case"Min":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.min(k("x",e,t,a),o,l)]}case"Sum":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.sum(k("x",e,t,a),o,l)]}case"All":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.all(k("x",e,t,a),o,l)]}case"Any":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.any(k("x",e,t,a),o,l)]}case"ArgMax":{let o=k("axis",e,t,a);return[n.argMax(k("x",e,t,a),o)]}case"ArgMin":{let o=k("axis",e,t,a);return[n.argMin(k("x",e,t,a),o)]}case"Prod":{let o=k("axis",e,t,a),l=k("keepDims",e,t,a);return[n.prod(k("x",e,t,a),o,l)]}case"Cumprod":{let o=k("axis",e,t,a),l=k("exclusive",e,t,a),u=k("reverse",e,t,a);return[n.cumprod(k("x",e,t,a),o,l,u)]}case"Cumsum":{let o=k("axis",e,t,a),l=k("exclusive",e,t,a),u=k("reverse",e,t,a);return[n.cumsum(k("x",e,t,a),o,l,u)]}case"Bincount":let r=k("x",e,t,a),s=k("weights",e,t,a),i=k("size",e,t,a);return[n.bincount(r,s,i)];case"DenseBincount":{let o=k("x",e,t,a),l=k("weights",e,t,a),u=k("size",e,t,a),d=k("binaryOutput",e,t,a);return[n.denseBincount(o,l,u,d)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},fz=(e,t,a,n=ta)=>{switch(e.op){case"ConcatV2":case"Concat":{let r=k("n",e,t,a),s=k("axis",e,t,a),i=k("tensors",e,t,a);return i=i.slice(0,r),[n.concat(i,s)]}case"Gather":{let r=k("x",e,t,a),s=k("indices",e,t,a);return[n.gather(r,n.cast(s,"int32"),0)]}case"GatherV2":{let r=k("axis",e,t,a),s=k("batchDims",e,t,a),i=k("x",e,t,a),o=k("indices",e,t,a);return[n.gather(i,n.cast(o,"int32"),r,s)]}case"Reverse":{let r=k("dims",e,t,a),s=[];for(let o=0;o{let r=k("axis",e,t,a),s=k("tensors",e,t,a),i=s[0].shape,o=n.squeeze(s[0]).shape,l=s.map(u=>{let d=v.arraysEqual(u.shape,i);if(!d&&!v.arraysEqual(n.squeeze(u).shape,o))throw new Error("the input tensors shape does not match");return d?u:n.reshape(u,i)});return[n.stack(l,r)]});case"Unpack":{let r=k("axis",e,t,a),s=k("tensor",e,t,a);return n.unstack(s,r)}case"Tile":{let r=k("reps",e,t,a);return[n.tile(k("x",e,t,a),r)]}case"Split":case"SplitV":{let r=k("axis",e,t,a),s=k("numOrSizeSplits",e,t,a),i=k("x",e,t,a);return n.split(i,s,r)}case"ScatterNd":{let r=k("indices",e,t,a),s=k("values",e,t,a),i=k("shape",e,t,a);return[n.scatterND(r,s,i)]}case"GatherNd":{let r=k("x",e,t,a),s=k("indices",e,t,a);return[n.gatherND(r,s)]}case"SparseToDense":{let r=k("sparseIndices",e,t,a),s=k("outputShape",e,t,a),i=k("sparseValues",e,t,a),o=k("defaultValue",e,t,a);return[n.sparseToDense(r,i,s,i.dtype===o.dtype?o:n.cast(o,i.dtype))]}case"TensorScatterUpdate":{let r=k("indices",e,t,a),s=k("values",e,t,a),i=k("tensor",e,t,a);return[n.tensorScatterUpdate(i,r,s)]}default:throw TypeError(`Node type ${e.op} is not implemented`)}},gz=(e,t,a,n=ta)=>{switch(e.op){case"SparseFillEmptyRows":{let{outputIndices:r,outputValues:s,emptyRowIndicator:i,reverseIndexMap:o}=n.sparse.sparseFillEmptyRows(k("indices",e,t,a),k("values",e,t,a),k("denseShape",e,t,a),k("defaultValue",e,t,a));return[r,s,i,o]}case"SparseReshape":{let{outputIndices:r,outputShape:s}=n.sparse.sparseReshape(k("inputIndices",e,t,a),k("inputShape",e,t,a),k("newShape",e,t,a));return[r,s]}case"SparseSegmentMean":return[n.sparse.sparseSegmentMean(k("data",e,t,a),k("indices",e,t,a),k("segmentIds",e,t,a))];case"SparseSegmentSum":return[n.sparse.sparseSegmentSum(k("data",e,t,a),k("indices",e,t,a),k("segmentIds",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},yz=(e,t,a,n=ta)=>{switch(e.op){case"FFT":return[n.fft(k("x",e,t,a))];case"IFFT":return[n.ifft(k("x",e,t,a))];case"RFFT":return[n.rfft(k("x",e,t,a))];case"IRFFT":return[n.irfft(k("x",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},xz=(e,t,a,n=ta)=>{switch(e.op){case"StaticRegexReplace":return[n.string.staticRegexReplace(k("input",e,t,a),k("pattern",e,t,a),k("rewrite",e,t,a),k("replaceGlobal",e,t,a))];case"StringNGrams":{let{nGrams:r,nGramsSplits:s}=n.string.stringNGrams(k("data",e,t,a),k("dataSplits",e,t,a),k("separator",e,t,a),k("nGramWidths",e,t,a),k("leftPad",e,t,a),k("rightPad",e,t,a),k("padWidth",e,t,a),k("preserveShortSequences",e,t,a));return[r,s]}case"StringSplit":{let{indices:r,values:s,shape:i}=n.string.stringSplit(k("input",e,t,a),k("delimiter",e,t,a),k("skipEmpty",e,t,a));return[r,s,i]}case"StringToHashBucketFast":return[n.string.stringToHashBucketFast(k("input",e,t,a),k("numBuckets",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}},Az=(e,t,a,n=ta)=>{switch(e.op){case"Cast":return[n.cast(k("x",e,t,a),k("dtype",e,t,a))];case"ExpandDims":{let r=k("axis",e,t,a);return[n.expandDims(k("x",e,t,a),r)]}case"Squeeze":{let r=k("axis",e,t,a);return[n.squeeze(k("x",e,t,a),r)]}case"Reshape":return[n.reshape(k("x",e,t,a),k("shape",e,t,a))];case"EnsureShape":return[n.ensureShape(k("x",e,t,a),k("shape",e,t,a))];case"MirrorPad":return[n.mirrorPad(k("x",e,t,a),k("padding",e,t,a),k("mode",e,t,a))];case"PadV2":case"Pad":return[n.pad(k("x",e,t,a),k("padding",e,t,a),k("constantValue",e,t,a))];case"SpaceToBatchND":{let r=k("blockShape",e,t,a),s=k("paddings",e,t,a);return[n.spaceToBatchND(k("x",e,t,a),r,s)]}case"BatchToSpaceND":{let r=k("blockShape",e,t,a),s=k("crops",e,t,a);return[n.batchToSpaceND(k("x",e,t,a),r,s)]}case"DepthToSpace":{let r=k("blockSize",e,t,a),s=k("dataFormat",e,t,a).toUpperCase();return[n.depthToSpace(k("x",e,t,a),r,s)]}case"BroadcastTo":return[n.broadcastTo(k("x",e,t,a),k("shape",e,t,a))];case"BroadcastArgs":return[n.broadcastArgs(k("s0",e,t,a),k("s1",e,t,a))];default:throw TypeError(`Node type ${e.op} is not implemented`)}};function T5(e,t,a,n,r=Pe){let s=((i,o,l)=>{switch(i.category){case"arithmetic":return r(()=>XO(i,o,l));case"basic_math":return r(()=>KO(i,o,l));case"control":return tz(i,o,l);case"convolution":return r(()=>az(i,o,l));case"creation":return r(()=>nz(i,o,l));case"dynamic":return rz(i,o,l);case"evaluation":return r(()=>sz(i,o,l));case"image":return r(()=>uz(i,o,l));case"graph":return r(()=>iz(i,o,l));case"logical":return r(()=>dz(i,o,l));case"matrices":return r(()=>pz(i,o,l));case"normalization":return r(()=>cz(i,o,l));case"ragged":return r(()=>hz(i,o,l));case"reduction":return r(()=>mz(i,o,l));case"slice_join":return r(()=>fz(i,o,l));case"sparse":return r(()=>gz(i,o,l));case"spectral":return r(()=>yz(i,o,l));case"string":return r(()=>xz(i,o,l));case"transformation":return r(()=>Az(i,o,l));case"hash_table":return lz(i,o,l,n);case"custom":let u=l6(i.op);if(u&&u.customExecutor)return u.customExecutor(new qO(i,o,l));throw TypeError(`Custom op ${i.op} is not registered.`);default:throw TypeError(`Unknown op '${i.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,a);return v.isPromise(s)?s.then(i=>[].concat(i)):[].concat(s)}var C5=class{constructor(e={},t={},a={},n={},r){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=a,this.functionMap=n,this.parseNodeNameCache=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 N5(e,t,a,n){let r=new Set,s=[],i=null,o=null,l=new Set,u=new Set(Object.keys(e).map(p=>Za(p)[0]));n=n||[];let d=new Set(n.map(p=>Za(p.name)[0])),c=[...t];for(;c.length>0;){let p=c.pop();if((mi(p)||Cz(p)||Nz(p))&&i==null&&(i=p,o=i.children.map(h=>h.name).filter(h=>r.has(h))),r.add(p.name),a[p.name]==null&&!u.has(p.name)&&!d.has(p.name)){if(p.inputs.length===0){s.push(p.name);continue}p.inputs.forEach(h=>{l.has(h.name)||(l.add(h.name),c.push(h))})}}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:i,syncInputs:o}}function bz(e,t){let{usedNodes:a,inputs:n}=t,r=Object.keys(n).map(g=>Za(g)[0]).map(g=>e.nodes[g]),s=e.initNodes||[],i=g=>a.has(typeof g=="string"?g:g.name);function o(g){return[...new Map(g.map(y=>[y.name,y])).values()]}let l=o([...r,...e.weights,...s]).filter(i),u=o([...l,...Object.values(e.nodes)]).filter(i),d=new Map(u.map(g=>[g.name,g])),c={};for(let g of u){c[g.name]=c[g.name]||0;for(let y of g.children)i(y)||(c[y.name]=Number.POSITIVE_INFINITY),c[y.name]=(c[y.name]||0)+1}let p=Object.entries(c).filter(([,g])=>g===0).map(([g])=>g),h=[...p];for(;p.length>0;){let g=p.pop(),y=d.get(g);for(let x of y.children.filter(i))--c[x.name]===0&&(h.push(x.name),p.push(x.name))}let m=h.map(g=>d.get(g)),f=vz(m,l);return wz(f,l),f}function vz(e,t){let a=new Map(e.map(s=>[s.name,s])),n=t.map(s=>s.name),r=new Set(n);for(;n.length>0;){let s=n.pop(),i=a.get(s);for(let o of i.children)!a.has(o.name)||r.has(o.name)||(r.add(o.name),n.push(o.name))}return e.filter(s=>r.has(s.name))}var th=class extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}};function wz(e,t){let a=new Map(e.map((o,l)=>[o.name,l])),n=new Set(t.map(o=>o.name)),r=o=>n.has(typeof o=="string"?o:o.name),s=new Set(e.map(o=>o.name)),i=o=>s.has(typeof o=="string"?o:o.name);for(let o of e){for(let l of o.children.filter(i)){if(!a.has(l.name))throw new th(`Child ${l.name} of node ${o.name} is unreachable.`);if(a.get(o.name)>a.get(l.name))throw new th(`Node ${o.name} is scheduled to run after its child ${l.name}.`)}if(!r(o))for(let l of o.inputs){if(!a.has(l.name))throw new th(`Input ${l.name} of node ${o.name} is unreachable.`);if(a.get(l.name)>a.get(o.name))throw new th(`Node ${o.name} is scheduled to run before its input ${l.name}.`)}}}function kz(e){let t=new Map(e.map((o,l)=>[o.name,l])),a=Number.MAX_SAFE_INTEGER,n=e.map((o,l)=>mi(o)?a:l),r=o=>{let l=n[t.get(o.name)];return l==null?-1:l},s=e.map((o,l)=>o.children.map(r).reduce((u,d)=>Math.max(u,d),n[l])),i=new Map;for(let o=0;ot[n].map(r=>r.id));this._weightIds=[].concat(...a),this._weightMap=t}set resourceManager(t){this._resourceManager=t}get inputs(){return this._inputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(t=>t.signatureKey||t.name)}get outputNodes(){return this._outputs.map(t=>{let a=t.signatureKey||t.name;return t.defaultOutput?`${a}:${t.defaultOutput}`:a})}get functions(){return Object.keys(this._functions).reduce((t,a)=>(t[a]=this._functions[a].signature,t),{})}constructor(t,a){this.graph=t,this.parent=a,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,t.functions!=null&&Object.keys(t.functions).forEach(n=>{this._functionExecutorMap[n]=new E6(t.functions[n],this)})}getCompilationKey(t,a){let n=t.map(s=>s.name).sort(),r=a.map(s=>s.name).sort();return n.join(this.SEPARATOR)+"--"+r.join(this.SEPARATOR)}compile(t,a){let n=N5(t,a,this.weightMap,this._initNodes),{missingInputs:r,dynamicNode:s,syncInputs:i}=n;if(s!=null)throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${i}]`);if(r.length>0){let u=a.map(c=>c.name),d=Object.keys(t);throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${d}]. Missing the following inputs: [${r}]`)}let o=bz(this.graph,n),l=kz(o);return{orderedNodes:o,nodeLiveUntilMap:l}}cloneAndKeepTensor(t){if(t==null)return null;let a=t.clone();return Bn(a),a}cloneTensorList(t){return t?t.map(a=>this.cloneAndKeepTensor(a)):null}cloneTensorMap(t){return Object.fromEntries(Object.entries(t).map(([a,n])=>[a,this.cloneTensorList(n)]))}execute(t,a){this.disposeIntermediateTensors(),t=this.mapInputs(t);let n=Object.keys(t).sort();this.checkInputs(t),this.checkInputShapeAndType(t),a=this.mapOutputs(a),this.checkOutputs(a);let r=n.map(p=>this.graph.nodes[Za(p)[0]]),s=a.map(p=>Za(p)[0]),i=new Set(s),o=s.map(p=>this.graph.nodes[p]);o.length===0&&(o=this._outputs);let l=this.getCompilationKey(r,o),u=this.compiledMap.get(l);u==null&&(u=this.compile(t,o),this.compiledMap.set(l,u));try{this.keepIntermediateTensors=B().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(p){this.keepIntermediateTensors=!1,console.warn(p.message)}let d={},c={};return Pe(()=>{let p=new C5(this.weightMap,d,c,this.functionExecutorMap,this.parseNodeNameCache),h=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(t).forEach(y=>{let[x,A]=Za(y,p),b=[];b[A]=t[y],h[x]=b,this.keepIntermediateTensors&&(this.clonedTensorsMap[x]=this.cloneTensorList(b))});let m=this.getFrozenTensorIds(h),{orderedNodes:f,nodeLiveUntilMap:g}=u;for(let y of f){if(h[y.name])continue;let x=T5(y,h,p,this._resourceManager);if(v.isPromise(x))throw new Error(`The execution of the op '${y.op}' returned a promise. Please use model.executeAsync() instead.`);h[y.name]=x,this.keepIntermediateTensors&&(this.clonedTensorsMap[y.name]=this.cloneTensorList(x)),this.checkTensorForDisposalWithNodeLiveUntilInfo(y,h,p,m,i,g.get(y.name))}return this.parent==null&&p.dispose(m),a.map(y=>da(y,h,p))})}getFrozenTensorIds(t){let a=[].concat.apply([],Object.keys(t).map(n=>t[n]).map(n=>n.map(r=>r.id)));return new Set(a)}checkTensorForDisposal(t,a,n,r,s,i,o){if(!(mi(a)||i.has(t))){for(let l of n[t])l!=null&&(o[l.id]=(o[l.id]||0)+a.children.length);for(let l of a.inputs){if(mi(l))continue;let u=v5(l.name,n,r);if(u!=null)for(let d of u){if(!d||d.kept||s.has(d.id))continue;let c=o[d.id];c===1?(d.dispose(),delete o[d.id]):c!=null&&o[d.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(t,a,n,r,s,i){function o(l){return mi(l)||s.has(l.name)}if(!(mi(t)||i==null))for(let l of i){if(o(l))continue;let u=v5(l.name,a,n);for(let d of u)!d||d.kept||r.has(d.id)||d.dispose()}}async executeAsync(t,a){return this._executeAsync(t,a)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(t=>{for(let a of t)a&&!a.isDisposed&&a.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(t,a,n=!1,r={},s={}){this.disposeIntermediateTensors(),n||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),a=this.mapOutputs(a),this.checkOutputs(a));try{this.keepIntermediateTensors=B().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(p){this.keepIntermediateTensors=!1,console.warn(p.message)}let i=new C5(this.weightMap,r,s,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));let o=await this.executeWithControlFlow(t,i,a,n),l=a.map(p=>da(p,o,i)),u=l.map(p=>p.id),d=Object.keys(t).map(p=>t[p].id),c=new Set([...u,...d,...this.weightIds]);return Object.values(o).forEach(p=>{p.forEach(h=>{h&&!h.isDisposed&&!c.has(h.id)&&h.dispose()})}),this.parent==null&&i.dispose(c),l}async executeFunctionAsync(t,a,n){let r=t.reduce((s,i,o)=>(s[this.inputs[o].name]=i,s),{});return this._executeAsync(r,this.outputNodes,!0,a,n)}async executeWithControlFlow(t,a,n,r){let s=Object.keys(t),i=s.map(b=>this.graph.nodes[Za(b)[0]]),o=n.map(b=>Za(b)[0]),l=new Set(o),u=o.map(b=>this.graph.nodes[b]);u.length===0&&(u=this._outputs);let{usedNodes:d,missingInputs:c,dynamicNode:p,syncInputs:h}=N5(t,u,this.weightMap,this._initNodes),m=[...i,...this.graph.weights,...this._initNodes||[]].map(b=>({node:b,contexts:a.currentContext})),f=Object.assign({},this.weightMap);Object.keys(t).forEach(b=>{let[w,S]=Za(b),C=[];C[S]=t[b],f[w]=C});let g={},y=this.getFrozenTensorIds(f),x={};for(;m.length>0;){let b=this.processStack(i,m,a,f,x,y,l,g,d);await Promise.all(b)}p==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 A=u.filter(b=>!mi(b)&&!da(b.name,f,a)).map(b=>b.name);if(A.length>0){let b="";throw p!=null&&(b=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${h}]`),new Error(`Cannot compute the outputs [${A}] from the provided inputs [${s}]. Consider providing the following inputs: [${c}]. ${b}`)}return f}processStack(t,a,n,r,s,i,o,l,u){let d=[];for(;a.length>0;){let c=a.pop();n.currentContext=c.contexts;let p="";if(c.node.op==="Enter"&&k("isConstant",c.node,r,n)&&([p]=kr(c.node.name,n)),r[c.node.name]==null){let h=T5(c.node,r,n,this._resourceManager);p||([p]=kr(c.node.name,n));let m=n.currentContext;v.isPromise(h)?d.push(h.then(f=>(r[p]=f,this.keepIntermediateTensors&&(this.clonedTensorsMap[p]=this.cloneTensorList(f)),n.currentContext=m,this.checkTensorForDisposal(p,c.node,r,n,i,o,l),this.processChildNodes(c.node,a,n,r,s,u),f))):(r[p]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[p]=this.cloneTensorList(h)),this.checkTensorForDisposal(p,c.node,r,n,i,o,l),this.processChildNodes(c.node,a,n,r,s,u))}else this.processChildNodes(c.node,a,n,r,s,u)}return d}processChildNodes(t,a,n,r,s,i){t.children.forEach(o=>{let[l]=kr(o.name,n);s[l]||!i.has(o.name)||(o.op==="Merge"?o.inputNames.some(u=>!!da(u,r,n))&&(s[l]=!0,a.push({contexts:n.currentContext,node:o})):o.inputNames.every(u=>!!da(u,r,n))&&(s[l]=!0,a.push({contexts:n.currentContext,node:o})))})}dispose(){Object.keys(this.weightMap).forEach(t=>this.weightMap[t].forEach(a=>a.dispose()))}checkInputShapeAndType(t){Object.keys(t).forEach(a=>{let n=t[a],[r]=Za(a),s=this.graph.nodes[r];if(s.attrParams.shape&&s.attrParams.shape.value){let i=s.attrParams.shape.value,o=i.length===n.shape.length&&n.shape.every((l,u)=>i[u]===-1||i[u]===l);v.assert(o,()=>`The shape of dict['${s.name}'] provided in model.execute(dict) must be [${i}], but was [${n.shape}]`)}s.attrParams.dtype&&s.attrParams.dtype.value&&v.assert(n.dtype===s.attrParams.dtype.value,()=>`The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${n.dtype}`)})}mapInputs(t){var a,n;let r={};for(let s in t){let i=(n=(a=this._signature)===null||a===void 0?void 0:a.inputs)===null||n===void 0?void 0:n[s];i!=null?r[i.name]=t[s]:r[s]=t[s]}return r}checkInputs(t){let a=Object.keys(t).filter(n=>{let[r]=Za(n);return this.graph.nodes[r]==null});if(a.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${a}] that are not part of graph`)}mapOutputs(t){return t.map(a=>{var n,r;let s=(r=(n=this._signature)===null||n===void 0?void 0:n.outputs)===null||r===void 0?void 0:r[a];return s!=null?s.name:a},{})}checkOutputs(t){t.forEach(a=>{let[n]=Za(a);if(!this.graph.nodes[n])throw new Error(`The output '${a}' is not found in the graph`)})}},Rz=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]}},Ez="?tfjs-format=file",Mz="model.json",ec=class{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}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},a=Jn){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=a,t==null&&(this.loadOptions={}),this.resourceManager=new Rz}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{let t=this.io.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(this.io.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]}}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=this.handler.load();return v.isPromise(e)?e.then(t=>t.getWeightStream==null?this.loadSync(t):this.loadStreaming(t)):this.loadSync(e)}loadSync(e){let t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(e.getWeightStream==null)throw new Error("Model artifacts missing streamWeights function");let t=await lb(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;let a=this.artifacts.modelTopology,n=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){let r=this.artifacts.userDefinedMetadata;r.signature!=null&&(n=r.signature),r.structuredOutputKeys!=null&&(this.structuredOutputKeys=r.structuredOutputKeys)}if(this.signature=n,this.version=`${a.versions.producer}.${a.versions.minConsumer}`,this.executor=new R5(w5.Instance.transformGraph(a,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let r=w5.Instance.transformGraph(e.modelInitializer);this.initializer=new R5(r),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if(typeof e=="string"){let a=this.io.getSaveHandlers(e);if(a.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(a.length>1)throw new Error(`Found more than one (${a.length}) save handlers for URL '${e}'`);e=a[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)}addStructuredOutputNames(e){if(this.structuredOutputKeys){let t=e instanceof yt?[e]:e,a={};return t.forEach((n,r)=>a[this.structuredOutputKeys[r]]=n),a}return e}predict(e,t){let a=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(a)}async predictAsync(e,t){let a=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(a)}normalizeInputs(e){var t;if(!(e instanceof yt)&&!Array.isArray(e)){let r=(t=this.signature)===null||t===void 0?void 0:t.inputs;if(r!=null)for(let s in r){let i=r[s];i.resourceId!=null&&(e[s]=this.resourceIdToCapturedInput[i.resourceId])}return e}e=Array.isArray(e)?e:[e];let a=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+a!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-a} non-resource placeholders, while there are ${e.length} input tensors provided.`);let n=0;return this.inputNodes.reduce((r,s)=>{var i,o,l;let u=(l=(o=(i=this.signature)===null||i===void 0?void 0:i.inputs)===null||o===void 0?void 0:o[s])===null||l===void 0?void 0:l.resourceId;return u!=null?r[s]=this.resourceIdToCapturedInput[u]:r[s]=e[n++],r},{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){let t=this.initializerSignature.outputs,a=Object.keys(t);for(let n=0;n1?a:a[0]}async executeAsync(e,t){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let a=await this.executor.executeAsync(e,t);return a.length>1?a:a[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,a)=>(t[a]=[e[a]],t),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&J(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}};async function x3(e,t={},a=Jn){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&&typeof e=="string"&&(e=$z(e));let n=new ec(e,t,a);return await n.load(),n}function Fz(e){if(e==null)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(e instanceof Array){let[n,r]=e;if(!n)throw new Error("modelJSON must be the first element of the array");if(!r||!(r instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in n))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in n))throw new Error("Model JSON is missing 'weightsManifest'");let s=Jn.getWeightSpecs(n.weightsManifest),i=Jn.getModelArtifactsForJSONSync(n,s,r);t=Jn.fromMemorySync(i)}else if("load"in e)t=e;else if("modelTopology"in e&&"weightSpecs"in e&&"weightData"in e)t=Jn.fromMemorySync(e);else throw new Error("Unknown model format");let a=new ec(t);return a.load(),a}function $z(e){return e.endsWith("/")||(e=e+"/"),`${e}${Mz}${Ez}`}var Dz="4.17.0";function Ie(e,t){Array.isArray(e)||(e=[e]),e.forEach(a=>{a!=null&&v.assert(a.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var Pz=Fn.whereImpl,A3=class M6 extends du{nextDataId(){return M6.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new hp(this,St())}write(t,a,n){this.firstUse&&(this.firstUse=!1,B().get("IS_NODE")&&I.warn(` ============================ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. -============================`));let r={id:this.nextDataId()};return this.data.set(r,{values:t,dtype:n,refCount:1}),r}makeTensorInfo(t,a,n){let r;if(a==="string"&&n!=null&&n.length>0&&v.isString(n[0])){let s=n.map(i=>v.encodeString(i));r=this.write(s,t,a)}else r=this.write(n,t,a);return{dataId:r,shape:t,dtype:a}}refCount(t){return this.data.has(t)?this.data.get(t).refCount:0}incRef(t){let a=this.data.get(t);a.refCount++}decRef(t){if(this.data.has(t)){let a=this.data.get(t);a.refCount--}}move(t,a,n,r,s){this.data.set(t,{values:a,dtype:r,refCount:s})}numDataIds(){return this.data.numDataIds()}async read(t){return this.readSync(t)}readSync(t){let{dtype:a,complexTensorInfos:n}=this.data.get(t);if(a==="complex64"){let r=this.readSync(n.real.dataId),s=this.readSync(n.imag.dataId);return C.mergeRealAndImagArrays(r,s)}return v.convertBackendValuesAndArrayBuffer(this.data.get(t).values,a)}bufferSync(t){let a=this.readSync(t.dataId);if(t.dtype==="string")try{let n=a.map(r=>v.decodeString(r));return $e(t.shape,t.dtype,n)}catch(n){throw new Error("Failed to decode encoded string bytes into utf-8")}return $e(t.shape,t.dtype,a)}makeOutput(t,a,n){return It().makeTensorFromTensorInfo(this.makeTensorInfo(a,n,t),this)}disposeData(t,a=!1){if(this.data.has(t)){if(this.data.get(t).refCount--,!a&&this.data.get(t).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(t);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(t)}return!0}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}async time(t){let a=v.now();return t(),{kernelMs:v.now()-a}}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(t){Ie([t],"where");let a=this.readSync(t.dataId);return BO(t.shape,a)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};d3.nextDataId=0;var e0={};Ze(e0,{addImpl:()=>m6,bincountImpl:()=>c3,bincountReduceImpl:()=>f6,bitwiseAndImpl:()=>g6,castImpl:()=>h6,ceilImpl:()=>y6,concatImpl:()=>h3,equalImpl:()=>x6,expImpl:()=>b6,expm1Impl:()=>w6,floorDivImpl:()=>I6,floorImpl:()=>k6,gatherNdImpl:()=>S6,gatherV2Impl:()=>C6,greaterEqualImpl:()=>N6,greaterImpl:()=>T6,lessEqualImpl:()=>E6,lessImpl:()=>R6,linSpaceImpl:()=>M6,logImpl:()=>P6,maxImpl:()=>_6,maximumImpl:()=>$6,minimumImpl:()=>F6,multiplyImpl:()=>m3,negImpl:()=>D6,notEqualImpl:()=>O6,prodImpl:()=>z6,raggedGatherImpl:()=>L6,raggedRangeImpl:()=>W6,raggedTensorToTensorImpl:()=>B6,rangeImpl:()=>g3,rsqrtImpl:()=>V6,scatterImpl:()=>js,sigmoidImpl:()=>Wz,simpleAbsImpl:()=>c6,sliceImpl:()=>xh,sparseFillEmptyRowsImpl:()=>G6,sparseReshapeImpl:()=>H6,sparseSegmentReductionImpl:()=>y3,sqrtImpl:()=>Uz,squaredDifferenceImpl:()=>j6,staticRegexReplaceImpl:()=>q6,stridedSliceImpl:()=>X6,stringNGramsImpl:()=>x3,stringSplitImpl:()=>A3,stringToHashBucketFastImpl:()=>b3,subImpl:()=>K6,tileImpl:()=>Y6,topKImpl:()=>J6,transposeImpl:()=>f3,uniqueImpl:()=>w3});function c6(e){let t=new Float32Array(e.length);for(let a=0;a{let{x:t}=e.inputs,a=e.backend;Ie(t,"abs");let n=new Float32Array(v.sizeFromShape(t.shape)),r=a.data.get(t.dataId).values;return n=c6(r),a.makeOutput(n,t.shape,t.dtype)},UO={kernelName:ru,backendName:"cpu",kernelFunc:VO};function $t(e){return(t,a,n,r,s)=>{let i=C.assertAndGetBroadcastShape(t,a),o=i.length,l=v.computeStrides(i),u=v.sizeFromShape(i),p=v.getTypedArrayFromDType(s,u),c=t.length,d=a.length,h=v.computeStrides(t),m=v.computeStrides(a),f=C.getBroadcastDims(t,i),g=C.getBroadcastDims(a,i);if(f.length+g.length===0)for(let y=0;yA[T]=0);let b=v.locToIndex(A,c,h),w=x.slice(-d);g.forEach(T=>w[T]=0);let I=v.locToIndex(w,d,m);p[y]=e(n[b],r[I])}return[p,i]}}function Za(e){let{inputs:t,backend:a}=e,{real:n,imag:r}=t,s=a.data.get(n.dataId).values,i=a.data.get(r.dataId).values,o=a.makeTensorInfo(n.shape,"complex64"),l=a.data.get(o.dataId);return l.complexTensorInfos={real:a.makeTensorInfo(n.shape,"float32",s),imag:a.makeTensorInfo(r.shape,"float32",i)},o}var GO={kernelName:up,backendName:"cpu",kernelFunc:Za};function yh(e,t,a="float32"){if(a==="complex64"){let r=yh(e,t,"float32"),s=yh(e,t,"float32");return Za({inputs:{real:r,imag:s},backend:e})}let n=v.makeZerosTypedArray(v.sizeFromShape(t),a);return e.makeTensorInfo(t,a,n)}function tr(e){let{inputs:t,backend:a}=e,{x:n}=t;return a.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}var HO={kernelName:Hi,backendName:"cpu",kernelFunc:tr};function Js(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.data.get(n.dataId).complexTensorInfos.real,s=a.data.get(r.dataId).values;return a.makeTensorInfo(r.shape,r.dtype,s)}var jO={kernelName:vp,backendName:"cpu",kernelFunc:Js};function h6(e,t,a,n){if(n==="int32"){let r=Int32Array.from(e);return[t,"int32",r]}if(n==="bool"){let r=v.toTypedArray([0],a),[s,i]=$t((o,l)=>o!==l?1:0)(t,[],e,r,"bool");return[i,"bool",s]}throw new Error(`Error in Cast: failed to cast ${a} to ${n}`)}function rs(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dtype:s}=n;if(s==="complex64"){if(r.dtype==="complex64")return tr({inputs:{x:r},backend:a});let p=yh(a,r.shape,r.dtype),c=rs({inputs:{x:r},backend:a,attrs:{dtype:"float32"}}),d=Za({inputs:{real:c,imag:p},backend:a});return a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(c),d}if(r.dtype==="complex64"){let p=Js({inputs:{input:r},backend:a}),c=rs({inputs:{x:p},backend:a,attrs:{dtype:s}});return a.disposeIntermediateTensorInfo(p),c}if(!v.hasEncodingLoss(r.dtype,s)){let p=tr({inputs:{x:r},backend:a});return{dataId:p.dataId,shape:p.shape,dtype:s}}let i=a.data.get(r.dataId).values,[o,l,u]=h6(i,r.shape,r.dtype,s);return a.makeTensorInfo(o,l,u)}var qO={kernelName:xi,backendName:"cpu",kernelFunc:rs};function Kt(e,t,a,n){return a==null?({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;Ie([i,o],e);let u=l.data.get(i.dataId).values,p=l.data.get(o.dataId).values,c=i.dtype==="string"?C.fromUint8ToStringArray(u):u,d=i.dtype==="string"?C.fromUint8ToStringArray(p):p,h=n||i.dtype,[m,f]=t(i.shape,o.shape,c,d,h);return l.makeTensorInfo(f,h,m)}:({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let u=rs({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),p=l.data.get(u.dataId),c=p.complexTensorInfos.real,d=p.complexTensorInfos.imag,h=l.data.get(c.dataId).values,m=l.data.get(d.dataId).values,f=rs({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),g=l.data.get(f.dataId),y=g.complexTensorInfos.real,x=g.complexTensorInfos.imag,A=l.data.get(y.dataId).values,b=l.data.get(x.dataId).values,[w,I,T]=a(i.shape,o.shape,h,m,A,b),N=l.makeTensorInfo(T,"float32",w),M=l.makeTensorInfo(T,"float32",I),P=Za({inputs:{real:N,imag:M},backend:l});return l.disposeIntermediateTensorInfo(u),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(N),l.disposeIntermediateTensorInfo(M),P}else{let u=l.data.get(i.dataId).values,p=l.data.get(o.dataId).values,c=n||i.dtype,[d,h]=t(i.shape,o.shape,u,p,c);return l.makeTensorInfo(h,c,d)}}}function p3(e){return(t,a,n,r,s,i)=>{let o=C.assertAndGetBroadcastShape(t,a),l=v.sizeFromShape(o),u=o.length,p=v.computeStrides(o),c=v.getTypedArrayFromDType("float32",l),d=v.getTypedArrayFromDType("float32",l),h=C.getBroadcastDims(t,o),m=C.getBroadcastDims(a,o),f=C.mergeRealAndImagArrays(n,r),g=C.mergeRealAndImagArrays(s,i),y=t.length,x=v.computeStrides(t),A=a.length,b=v.computeStrides(a);if(h.length+m.length===0)for(let w=0;wT[S]=0);let N=v.locToIndex(T,y,x),M=I.slice(-A);m.forEach(S=>M[S]=0);let P=v.locToIndex(M,A,b),E=e(f[N*2],f[N*2+1],g[P*2],g[P*2+1]);c[w]=E.real,d[w]=E.imag}return[c,d,o]}}var m6=$t((e,t)=>e+t),XO=p3((e,t,a,n)=>({real:e+a,imag:t+n})),Zl=Kt(is,m6,XO),KO={kernelName:is,backendName:"cpu",kernelFunc:Zl};function c3(e,t,a,n,r){let s=v.sizeFromShape(n),i=v.makeZerosTypedArray(r,a);for(let o=0;o=r||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function f6(e,t,a,n=!1){let r=e.shape[0],s=e.shape[1],i=$e([r,a],t.dtype);for(let o=0;o=a||(n?i.set(1,o,u):t.size>0?i.set(i.get(o,u)+t.get(o,l),o,u):i.set(i.get(o,u)+1,o,u))}return i}var g6=$t((e,t)=>e&t),YO=Kt(uu,g6),ZO={kernelName:uu,backendName:"cpu",kernelFunc:YO};function or(e){return(t,a,n)=>{let r=v.getArrayFromDType(a,t.length);for(let s=0;s{let{x:i}=n;Ie(i,e);let o=s,l=o.data.get(i.dataId).values,u;if(i.dtype==="string"){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=C.fromUint8ToStringArray(l)}else u=l;let p=a||i.dtype,c=t(u,p,r);return o.makeTensorInfo(i.shape,p,c)}}var y6=or(e=>Math.ceil(e)),JO=cs(Ai,y6),QO={kernelName:Ai,backendName:"cpu",kernelFunc:JO};function h3(e,t,a,n){let r=v.getArrayFromDType(a,v.sizeFromShape(t));if(n&&a!=="string"){let s=0;e.forEach(i=>{let o=v.sizeFromShape(i.shape);r.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=a==="string"?C.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let u=0;ue===t?1:0),A6=Kt(Fi,x6,null,"bool"),ez={kernelName:Fi,backendName:"cpu",kernelFunc:A6},b6=or(e=>Math.exp(e)),v6=cs(Di,b6,"float32"),tz={kernelName:Di,backendName:"cpu",kernelFunc:v6},w6=or(e=>Math.expm1(e)),az=cs(Oi,w6),nz={kernelName:Oi,backendName:"cpu",kernelFunc:az},k6=or(e=>Math.floor(e)),rz=cs(Li,k6),sz={kernelName:Li,backendName:"cpu",kernelFunc:rz},I6=$t((e,t)=>Math.floor(e/t)),iz=Kt(Wi,I6,null,"int32"),oz={kernelName:Wi,backendName:"cpu",kernelFunc:iz};function S6(e,t,a,n,r,s,i,o,l){let u=$e([n,s],a);for(let p=0;p=l/s)throw new Error(`Invalid indices: ${c} does not index into ${o}`);for(let h=0;he>t?1:0),lz=Kt(Ui,T6,null,"bool"),uz={kernelName:Ui,backendName:"cpu",kernelFunc:lz},N6=$t((e,t)=>e>=t?1:0),dz=Kt(Gi,N6,null,"bool"),pz={kernelName:Gi,backendName:"cpu",kernelFunc:dz},R6=$t((e,t)=>ee<=t?1:0),mz=Kt(Zi,E6,null,"bool"),fz={kernelName:Zi,backendName:"cpu",kernelFunc:mz};function M6(e,t,a){let n=(t-e)/(a-1),r=v.makeZerosTypedArray(a,"float32");r[0]=e;for(let s=1;sMath.log(e)),gz=cs(Qi,P6),yz={kernelName:Qi,backendName:"cpu",kernelFunc:gz};function _6(e,t,a,n){let r=v.getTypedArrayFromDType(n,v.sizeFromShape(a));for(let s=0;so)&&(o=u)}r[s]=o}return r}var $6=$t((e,t)=>Math.max(e,t)),xz=Kt(io,$6),Az={kernelName:io,backendName:"cpu",kernelFunc:xz},F6=$t((e,t)=>Math.min(e,t)),bz=Kt(po,F6),vz={kernelName:po,backendName:"cpu",kernelFunc:bz},m3=$t((e,t)=>e*t),wz=p3((e,t,a,n)=>({real:e*a-t*n,imag:e*n+t*a})),t0=Kt(fo,m3,wz),kz={kernelName:fo,backendName:"cpu",kernelFunc:t0};function D6(e,t,a){let n=v.createScalarValue(-1,a);return m3([],t,n,e,a)}function Iz(e){let{inputs:t,backend:a}=e,{x:n}=t;Ie(n,"neg");let r=a.data.get(n.dataId).values,[s,i]=D6(r,n.shape,n.dtype);return a.makeTensorInfo(i,n.dtype,s)}var Sz={kernelName:wu,backendName:"cpu",kernelFunc:Iz},O6=$t((e,t)=>e!==t?1:0),Cz=Kt(go,O6,null,"bool"),Tz={kernelName:go,backendName:"cpu",kernelFunc:Cz};function f3(e,t,a,n,r){let s=t.length,i=v.sizeFromShape(t),o=v.computeStrides(t),l=v.computeStrides(r),u=v.getTypedArrayFromDType(a,v.sizeFromShape(r));for(let p=0;pa.disposeIntermediateTensorInfo(x)),a.makeTensorInfo(y,g,m)}var Ez={kernelName:ko,backendName:"cpu",kernelFunc:Rz};function Mz(e,t,a){e.forEach((n,r)=>{if(n<0||n>=a){let s=v.indexToLoc(r,t.length,v.computeStrides(t)).join(",");throw new Error(`indices[${s}] = ${n} is not in [0, ${a})`)}})}function Pz(e,t){for(let a=0;ar)throw new Error("Ragged splits must not point past values");for(let s=1;sn[s])throw new Error("Ragged splits must be sorted in ascending order")}}function _z(e,t,a,n){let r=[],s=0,i=t.length-1+a.length,o=new Array(i).fill(null).map(()=>[0]);Pz(a,n);let l=1;for(let u=0;u=0){let f=o[m],g=f[f.length-1]-h[p];for(let y=p;yr[i]=s)}return t}function g5(e,t){let a=e.slice(0,t);for(;a.length1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(i.length>1)throw new Error("deltas must be a scalar or vector");let o=t.length===0,l=r.length===0,u=i.length===0,p=[];o||p.push(t[0]),l||p.push(r[0]),u||p.push(i[0]);for(let g=1;g0&&xy)b=0;else if(b=Math.ceil(Math.abs((x-y)/A)),b>y5)throw new Error(`Requires ((limit - start) / delta) <= ${y5}`);d[g+1]=d[g]+b}let h=d[c],m=v.getArrayFromDType(a,h),f=0;for(let g=0;gn&&(n=s)}return n}static getMaxWidthValueRowID(t){let a=t.length;if(a===0)return 0;let n=0,r=t[0],s=0;for(let i=1;i"Final length of result must be equal to firstDimension."),s}calculateOutputIndexRowSplit(t,a,n,r){let s=t.length,i=[];for(let o=0;o0&&i.length!==t[s-1])throw new Error("Invalid row split size.");return i}calculateOutputIndexValueRowID(t,a,n,r){let s=t.length,i=[];if(s===0)return[];let o=0,l=t[0];if(l>=a.length)throw new Error(`Got currentValueRowId=${l}, which is not less than ${a.length}`);let u=a[l];i.push(u);for(let p=1;p=0&&(++o,o=a.length)throw new Error(`Got nextValueRowId=${c} which is not less than ${a.length}`);u=a[c]}i.push(u)}if(i.length!==t.length)throw new Error("Invalid row ids.");return i}calculateOutputIndex(t,a,n,r){let s=this.getRowPartitionTensor(t),i=this.getRowPartitionTypeByDimension(t);switch(i){case In.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,a,n,r);case In.ROW_SPLITS:if(s.length-1>a.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${a.length}`);return this.calculateOutputIndexRowSplit(s,a,n,r);default:throw new Error(`Unsupported partition type: ${In[i]}`)}}getFirstDimensionSize(){let t=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");let a=this.rowPartitionTypes[0];switch(a){case In.FIRST_DIM_SIZE:return t[0];case In.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case In.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${In[a]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");let t=this.getFirstDimensionSize(),a=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let i=n.length-2;i>=0;--i)n[i]=n[i+1]*a[i+1];let r=A5(a,!1),s=v.getArrayFromDType(this.valuesDType,v.sizeFromShape(r));if(n[0]*a[0]>0){let i=this.calculateFirstParentOutputIndex(t,n[0],a[0]);for(let o=1;o<=this.raggedRank;++o)i=this.calculateOutputIndex(o-1,i,n[o],a[o]);this.setOutput(this.raggedRank,i,s,r)}return[r,s]}setOutput(t,a,n,r){if(n.length===0)return;let s=this.values,i=n,o=r.slice();o=o.slice(t+1);let l=v.sizeFromShape(o),u=a.length,p=this.defaultValue;if(p.length!==l&&p.length!==1){let m=this.defaultValueShape;De(()=>{let f=Q(p,m);p=Bl(f,o).dataSync()})}let c=0,d=0,h=0;for(let m=0;m<=u;++m){let f=m=u){let g=n.length;f=Math.floor(g/l)}if(f>h)if(this.defaultValue.length===1)i.subarray(h*l,f*l).fill(this.defaultValue[0]),h=f;else for(;f>h;){let g=i.slice(h*l);x5(g,p,l),++h}f<0?(c=m+1,d=h):(c=m,d=h,h=d+1)}}};function x5(e,t,a){for(let n=0;n= 0`);if(n<-1)throw new Error(`Dimension ${n} must be >= -1`);n=-1}a.push(n)}return a}function B6(e,t,a,n,r,s,i,o,l,u){return new Oz(e,t,a,n,r,s,i,o,l,u).compute()}function g3(e,t,a,n){let r=e===t,s=e1;if(r||s||i)return v.makeZerosTypedArray(0,n);let o=Math.abs(Math.ceil((t-e)/a)),l=v.makeZerosTypedArray(o,n);t1/Math.sqrt(e)),zz=cs(Mo,V6),Lz={kernelName:Mo,backendName:"cpu",kernelFunc:zz};function js(e,t,a,n,r,s,i,o,l,u){let p=[n/r,r],c=e.values,d=t.values;if(n===0)return $e(a,t.dtype);let h=l instanceof Vt?l:$e(p,t.dtype);typeof l=="string"||typeof l=="number"?h.values.fill(l):typeof l=="boolean"&&h.values.fill(+l);for(let m=0;m=n/r)throw new Error(`Invalid indices: ${f} does not index into ${a}`);for(let y=0;y1/(1+Math.exp(-e))),U6=ct(Lo,e=>1/(1+Math.exp(-e))),Bz={kernelName:Lo,backendName:"cpu",kernelFunc:U6};function xh(e,t,a,n,r){let s=Nt.isSliceContinous(n,t,a),i=v.sizeFromShape(a),o=v.computeStrides(n);if(s){let c=Nt.computeFlatOffset(t,o);return r==="string"?e.slice(c,c+i):e.subarray(c,c+i)}let l=r==="string"?C.fromUint8ToStringArray(e):e,u=$e(n,r,l),p=$e(a,r);for(let c=0;cm+t[f]);p.set(u.get(...h),...d)}return r==="string"?C.fromStringArrayToUint8(p.values):p.values}function Qs(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,size:i}=n;Ie(r,"slice");let[o,l]=Nt.parseSliceParams(r,s,i);Nt.assertParamsValid(r,o,l);let u=a.data.get(r.dataId).values,p=xh(u,o,l,r.shape,r.dtype);return a.makeTensorInfo(l,r.dtype,p)}var Vz={kernelName:Mu,backendName:"cpu",kernelFunc:Qs};function G6(e,t,a,n,r,s,i){let o=t[0],l=s[0],u=new Array(l),p=new Array(o),c=t[1];if(l===0){if(o!==0)throw new Error(C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(o));let g=v.getArrayFromDType(a,0),y=v.getArrayFromDType(r,0);return[g,[0,c],y,u,p]}let d=!0,h=0,m=new Array(l).fill(0);for(let g=0;g=l)throw new Error(C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,y,l));++m[y],d=d&&y>=h,h=y}let f=!0;for(let g=0;g0&&(m[g]+=m[g-1])}if(f&&d){let g=e,y=n;for(let x=0;x0){d[c-1]=1;for(let f=c-2;f>=0;--f)d[f]=d[f+1]*n[f+1]}let h=[];if(o>0){h[o-1]=1;for(let f=o-2;f>=0;--f)h[f]=h[f+1]*l[f+1]}let m=v.getArrayFromDType(a,i*o);for(let f=0;f0?r[o-1]+1:0;if(p<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let c=t.slice();c[0]=p;let d=c.reduce((x,A)=>x*A,1),h=v.getArrayFromDType(a,d);if(o===0)return p>0&&h.fill(i),[h,c];if(p<=0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=0,f=1,g=0,y=r[m];for(;;){let x=0;if(f=x)throw new Error(C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(y<0||y>=p)throw new Error(C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(y,p));y>g&&h.fill(i,g*u,y*u);for(let A=m;A=l[0])throw new Error(C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(A,n[A],l[0]));for(let w=0;wo)break}return gMath.sqrt(e)),Gz=ct(Bo,e=>Math.sqrt(e)),Hz={kernelName:Bo,backendName:"cpu",kernelFunc:Gz},j6=$t((e,t)=>{let a=e-t;return a*a}),jz=Kt(Ho,j6),qz={kernelName:Ho,backendName:"cpu",kernelFunc:jz},q6=or((e,t)=>{let{pattern:a,replaceGlobal:n,rewrite:r}=t;return e.replace(new RegExp(a,n?"g":""),r)}),Xz=cs(Ip,q6),Kz={kernelName:Ip,backendName:"cpu",kernelFunc:Xz};function X6(e,t,a,n){let r=$e(e,t.dtype);for(let s=0;s0?0:i-o),d=0;d+=l*this.leftPad.length;for(let y=0;yy.forEach(x=>m[f++]=x);for(let y=0;y0){g(e[c+p-1]);for(let y=0;y0){let o=t[0];if(o!==0)throw new Error(`First split value must be 0, got ${o}`);for(let l=1;l=o;if(u=u&&t[l]<=a,!u)throw new Error(`Invalid split value ${t[l]}, must be in [${o}, ${a}]`);o=t[l]}if(o!==a)throw new Error(`Last split value must be data size. Expected ${a}, got ${o}`)}let r=n-1,s=v.getArrayFromDType("int32",n);if(a===0||n===0){let o=new Array(a);for(let l=0;l<=r;++l)s[l]=0;return[o,s]}s[0]=0;for(let o=1;o<=r;++o){let l=t[o]-t[o-1],u=0;this.nGramWidths.forEach(p=>{u+=this.getNumNGrams(l,p)}),this.preserveShort&&l>0&&u===0&&(u=1),s[o]=s[o-1]+u}let i=new Array(s[r]);for(let o=0;o{let c=t[o+1]-t[o],d=this.getNumNGrams(c,p);this.createNGrams(e,l,i,u,d,p),u+=d}),this.preserveShort&&u===s[o]){let p=t[o+1]-t[o];if(p===0)continue;let c=p+2*this.padWidth,d=1;this.createNGrams(e,l,i,u,d,c)}}return[i,s]}};function x3(e,t,a,n,r,s,i,o){return new Yz(a,n,r,s,i,o).compute(e,t)}function Zz(e,t,a,n){if(!e.length)return;if(t.length===0){for(let s=0;se-t),Jz=p3((e,t,a,n)=>({real:e-a,imag:t-n})),v3=Kt(qo,K6,Jz),Qz={kernelName:qo,backendName:"cpu",kernelFunc:v3};function Y6(e,t){let a=new Array(e.rank);for(let r=0;r{let a=t.value-e.value;return a===0?e.index-t.index:a};function Z6(e,t,a=0,n=e.length-1){for(;n>a;){if(n-a>600){let o=n-a+1,l=t-a+1,u=Math.log(o),p=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*p*(o-p)/o)*Math.sign(l-o/2),d=Math.max(a,Math.floor(t-l*p/o+c)),h=Math.min(n,Math.floor(t+(o-l)*p/o+c));Z6(e,t,d,h)}let r=e[t],s=a,i=n;for(v.swap(e,a,t),Id(e[n],r)>0&&v.swap(e,a,n);s0;)i=i-1}Id(e[a],r)===0?v.swap(e,a,i):(i=i+1,v.swap(e,i,n)),i<=t&&(a=i+1),t<=i&&(n=i-1)}}function J6(e,t,a,n,r){let s=t[t.length-1],[i,o]=[e.length/s,s],l=v.getTypedArrayFromDType(a,i*n),u=v.getTypedArrayFromDType("int32",i*n);for(let c=0;cm[A]={value:x,index:A}),n{for(let g=0;gnew d3,1);var Q6=ct(_i,e=>e>=0?e:Math.exp(e)-1),tL={kernelName:_i,backendName:"cpu",kernelFunc:Q6};function ev(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{alpha:s}=n;Ie([r],"leakyRelu");let i=v.sizeFromShape(r.shape),o=a.data.get(r.dataId).values,l=v.getTypedArrayFromDType("float32",i);for(let u=0;ue<0?t*e:e);function tv(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t;Ie([n,r],"prelu");let s=a.data.get(n.dataId).values,i=a.data.get(r.dataId).values,[o,l]=nL(n.shape,r.shape,s,i,"float32");return a.makeTensorInfo(l,"float32",o)}var rL={kernelName:wo,backendName:"cpu",kernelFunc:tv},av=ct(So,e=>Math.max(0,e)),sL={kernelName:So,backendName:"cpu",kernelFunc:av},nv=ct(No,e=>Math.min(Math.max(0,e),6)),iL={kernelName:No,backendName:"cpu",kernelFunc:nv};function Ah(e,t,a,n,r){if(a==="linear")return tr({inputs:{x:t},backend:e});if(a==="relu")return av({inputs:{x:t},backend:e});if(a==="elu")return Q6({inputs:{x:t},backend:e});if(a==="relu6")return nv({inputs:{x:t},backend:e});if(a==="prelu")return tv({inputs:{x:t,alpha:n},backend:e});if(a==="leakyrelu")return ev({inputs:{x:t},backend:e,attrs:{alpha:r}});if(a==="sigmoid")return U6({inputs:{x:t},backend:e});throw new Error(`Activation ${a} has not been implemented for the CPU backend.`)}function At(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{shape:s}=n,i=v.sizeFromShape(r.shape),o=v.inferFromImplicitShape(s,i),l=v.sizeFromShape(o);v.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.`),a.incRef(r.dataId);let u=a.data.get(r.dataId);if(u.complexTensorInfos!=null){let p=u.complexTensorInfos.real,c=u.complexTensorInfos.imag;p.shape=o,c.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}var oL={kernelName:Tu,backendName:"cpu",kernelFunc:At};function rv(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;Ie([r,s],"matMul");let l=r.shape.length,u=s.shape.length,p=i?r.shape[l-2]:r.shape[l-1],c=o?s.shape[u-1]:s.shape[u-2],d=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[u-2]:s.shape[u-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=v.sizeFromShape(m),y=v.sizeFromShape(f),x=el.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)).concat([d,h]);v.assert(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let A=i?[g,p,d]:[g,d,p],b=o?[y,h,c]:[y,c,h],w=At({inputs:{x:r},backend:a,attrs:{shape:A}}),I=At({inputs:{x:s},backend:a,attrs:{shape:b}}),T=i?w.shape[1]:w.shape[2],N=i?w.shape[2]:w.shape[1],M=o?I.shape[1]:I.shape[2],P=Math.max(g,y),E=a.data.get(w.dataId).values,S=a.data.get(I.dataId).values,_=v.computeStrides(w.shape),O=v.computeStrides(I.shape),[W,$,U]=i?[_[0],1,_[1]]:[_[0],_[1],1],[G,q,H]=o?[1,O[1],O[0]]:[O[1],1,O[0]],V=N*M,Z=$e([P,N,M],w.dtype),X=Z.values,re=a.blockSize;for(let ee=0;eeMath.acos(e)),cL={kernelName:si,backendName:"cpu",kernelFunc:pL},hL=ct(ii,e=>Math.acosh(e)),mL={kernelName:ii,backendName:"cpu",kernelFunc:hL};function fL(e){let{inputs:t,backend:a}=e,n=t;Ie(t,"addN");let r=n.map(o=>a.data.get(o.dataId).values),s=$e(n[0].shape,n[0].dtype),i=s.values;for(let o=0;ox&&(x=w,A=b)}h[g]=A}return u.forEach(g=>a.disposeIntermediateTensorInfo(g)),a.makeTensorInfo(p,"int32",h)}var wL={kernelName:su,backendName:"cpu",kernelFunc:vL};function kL(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n;Ie(r,"argMin");let i=v.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=Va({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),i=[i[0]],C.assertAxesAreInnerMostDims("argMin",i,l.shape.length);let[p,c]=C.computeOutAndReduceShapes(l.shape,i),d=v.sizeFromShape(p),h=v.makeZerosTypedArray(d,"int32"),m=v.sizeFromShape(c),f=a.data.get(l.dataId).values;for(let g=0;ga.disposeIntermediateTensorInfo(g)),a.makeTensorInfo(p,"int32",h)}var IL={kernelName:iu,backendName:"cpu",kernelFunc:kL},SL=ct(di,e=>Math.asin(e)),CL={kernelName:di,backendName:"cpu",kernelFunc:SL},TL=ct(pi,e=>Math.asinh(e)),NL={kernelName:pi,backendName:"cpu",kernelFunc:TL},RL=ct(ci,e=>Math.atan(e)),EL={kernelName:ci,backendName:"cpu",kernelFunc:RL},ML=$t((e,t)=>Math.atan2(e,t)),PL=Kt(mi,ML),_L={kernelName:mi,backendName:"cpu",kernelFunc:PL},$L=ct(hi,e=>Math.atanh(e)),FL={kernelName:hi,backendName:"cpu",kernelFunc:$L};function k3(e,t,a,n,r,s){let i=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,p=r.effectiveFilterHeight,c=r.effectiveFilterWidth,d=r.padInfo.top,h=r.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=$e(r.outShape,a),g=f.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],x=r.outShape[2]*r.outShape[3],A=r.outShape[3];for(let b=0;bU?U=ee:s==="avg"&&(G+=ee,q++)}if(isNaN(U))break}let H=S+_*A+T;g[H]=s==="avg"?G/q:U}}}return f}function sv(e,t,a,n,r=!1,s=!1){let i=$e(n.outShape,"int32"),o=n.strideHeight,l=n.strideWidth,u=n.dilationHeight,p=n.dilationWidth,c=n.effectiveFilterHeight,d=n.effectiveFilterWidth,h=n.padInfo.top,m=n.padInfo.left,f=$e(t,a,e);for(let g=0;gP&&(P=$,r?E=s?((g*n.inHeight+S)*n.inWidth+O)*n.inChannels+y:(S*n.inWidth+O)*n.inChannels+y:E=_*d+W)}}i.set(E,g,x,I,y)}}return i}function iv(e,t,a,n,r,s){let i=r.strideDepth,o=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,p=r.dilationHeight,c=r.dilationWidth,d=r.effectiveFilterDepth,h=r.effectiveFilterHeight,m=r.effectiveFilterWidth,f=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,x=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,A=$e(r.outShape,a),b=A.values,w=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],I=r.outShape[2]*r.outShape[3]*r.outShape[4],T=r.outShape[3]*r.outShape[4],N=r.outShape[4];for(let M=0;Mbe?be=yt:s==="avg"&&(Ce+=yt,Re++),isNaN(be))break}if(isNaN(be))break}if(isNaN(be))break}let Le=ie+S;b[Le]=s==="avg"?Ce/Math.max(Re,1):be}}}}return A}function DL(e,t){let a=$e(t.outShape,"int32"),n=t.strideDepth,r=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,p=t.effectiveFilterHeight,c=t.effectiveFilterWidth,d=t.padInfo.front,h=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=_&&(_=V,O=$*p*c+G*p+H)}}}a.set(O,f,y,w,M,g)}}}return a}function OL(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t;Ie(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=1;v.assert(C.eitherStridesOrDilationsAreOne(i,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let p=C.computePool2DInfo(r.shape,s,i,u,o,l),c;if(p.filterWidth===1&&p.filterHeight===1&&v.arraysEqual(p.inShape,p.outShape))c=tr({inputs:{x:r},backend:a});else{let d=a.data.get(r.dataId).values,h=v.computeStrides(r.shape),m=k3(d,r.shape,r.dtype,h,p,"avg");c=a.makeTensorInfo(p.outShape,r.dtype,m.values)}return c}var zL={kernelName:fi,backendName:"cpu",kernelFunc:OL};function LL(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n;Ie(r,"avgPool3d");let p=C.computePool3DInfo(r.shape,s,i,1,o,l,u),c=a.data.get(r.dataId).values,d=iv(c,r.shape,r.dtype,v.computeStrides(r.shape),p,"avg");return a.makeTensorInfo(d.shape,"float32",d.values)}var WL={kernelName:ou,backendName:"cpu",kernelFunc:LL};function BL(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n;Ie([r,s],"avgPool3DGrad");let p=C.computePool3DInfo(s.shape,i,o,1,l,u),c=p.strideDepth,d=p.strideHeight,h=p.strideWidth,m=p.filterDepth,f=p.filterHeight,g=p.filterWidth,y=p.dilationDepth,x=p.dilationHeight,A=p.dilationWidth,b=p.effectiveFilterDepth,w=p.effectiveFilterHeight,I=p.effectiveFilterWidth,T=b-1-p.padInfo.front,N=I-1-p.padInfo.left,M=w-1-p.padInfo.top,P=$e(s.shape,"float32"),E=1/(m*f*g),S=a.bufferSync(r);for(let _=0;_=p.outDepth||Math.floor(X)!==X))for(let re=0;re=p.outHeight||Math.floor(ee)!==ee))for(let ge=0;ge=p.outWidth||Math.floor(ie)!==ie)continue;let be=S.get(_,X,ee,ie,O);V+=be}}}P.set(V*E,_,W,$,U,O)}return a.makeTensorInfo(P.shape,P.dtype,P.values)}var VL={kernelName:lp,backendName:"cpu",kernelFunc:BL};function UL(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s;Ie([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=n,p=C.computePool2DInfo(i.shape,o,l,1,u),c=p.strideHeight,d=p.strideWidth,h=p.filterHeight,m=p.filterWidth,f=p.dilationHeight,g=p.dilationWidth,y=p.effectiveFilterHeight,x=p.effectiveFilterWidth,A=x-1-p.padInfo.left,b=y-1-p.padInfo.top,w=$e(i.shape,"float32"),I=1/(h*m),T=a.data.get(r.dataId).values,N=$e(r.shape,"float32",T);for(let M=0;M=p.outHeight||Math.floor(U)!==U))for(let G=0;G=p.outWidth||Math.floor(q)!==q)continue;let H=N.get(M,U,q,P);W+=H}}w.set(W*I,M,E,S,P)}return a.makeTensorInfo(w.shape,w.dtype,w.values)}var GL={kernelName:op,backendName:"cpu",kernelFunc:UL};function HL(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,scale:s,offset:i,mean:o,variance:l}=t;v.assert(o.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),v.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),v.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),Ie([r,o,l,s,i],"batchNorm");let{varianceEpsilon:u}=n;u==null&&(u=.001);let p=a.data.get(r.dataId).values,c=a.data.get(o.dataId).values,d=a.data.get(l.dataId).values,h=s?a.data.get(s.dataId).values:new Float32Array([1]),m=i?a.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(p.length),g=m.length,y=h.length,x=d.length,A=c.length,b=0,w=0,I=0,T=0;for(let N=0;N=g&&(b=0),w>=A&&(w=0),I>=y&&(I=0),T>=x&&(T=0);return a.makeTensorInfo(r.shape,r.dtype,f)}var jL={kernelName:Bi,backendName:"cpu",kernelFunc:HL};function qL(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,crops:i}=n;Ie([r],"batchToSpaceND");let o=s.reduce((y,x)=>y*x),l=C.getReshaped(r.shape,s,o),u=C.getPermuted(l.length,s.length),p=C.getReshapedPermuted(r.shape,s,o),c=C.getSliceBeginCoords(i,s.length),d=C.getSliceSize(p,i,s.length),h=At({inputs:{x:r},backend:a,attrs:{shape:l}}),m=Va({inputs:{x:h},backend:a,attrs:{perm:u}}),f=At({inputs:{x:m},backend:a,attrs:{shape:p}}),g=Qs({inputs:{x:f},backend:a,attrs:{begin:c,size:d}});return a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(f),g}var XL={kernelName:lu,backendName:"cpu",kernelFunc:qL};function KL(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i}=n,o=a.data.get(r.dataId).values,l=a.data.get(s.dataId).values,u=c3(o,l,s.dtype,s.shape,i);return a.makeTensorInfo([i],s.dtype,u)}var YL={kernelName:yi,backendName:"cpu",kernelFunc:KL};function ZL(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t,s=a.data.get(n.dataId).values,i=a.data.get(r.dataId).values,o=C.assertAndGetBroadcastShape(Array.from(s),Array.from(i));return a.makeTensorInfo([o.length],"int32",Int32Array.from(o))}var JL={kernelName:du,backendName:"cpu",kernelFunc:ZL},QL=ct(os,(e,t)=>{let a=t;return e>a.clipValueMax?a.clipValueMax:e{let{x:t}=e.inputs,a=e.backend,n=new Float32Array(v.sizeFromShape(t.shape)),r=a.data.get(t.dataId),s=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=a.data.get(s.dataId).values,l=a.data.get(i.dataId).values;for(let u=0;uf.shape);C.assertParamsConsistent(i,s);let o=C.computeOutShape(t.map(f=>f.shape),s);if(v.sizeFromShape(o)===0)return a.makeTensorInfo(o,t[0].dtype,[]);let l=t.filter(f=>v.sizeFromShape(f.shape)>0);if(l.length===1)return tr({inputs:{x:l[0]},backend:a});if(l[0].dtype==="complex64"){let f=l.map(b=>Js({inputs:{input:b},backend:a})),g=l.map(b=>Jl({inputs:{input:b},backend:a})),y=Ql({inputs:f,backend:a,attrs:{axis:s}}),x=Ql({inputs:g,backend:a,attrs:{axis:s}}),A=Za({inputs:{real:y,imag:x},backend:a});return f.forEach(b=>a.disposeIntermediateTensorInfo(b)),g.forEach(b=>a.disposeIntermediateTensorInfo(b)),a.disposeIntermediateTensorInfo(y),a.disposeIntermediateTensorInfo(x),A}let u=l.map(f=>{let g=[-1,v.sizeFromShape(f.shape.slice(s))];return At({inputs:{x:f},backend:a,attrs:{shape:g}})}),p=u.map(f=>({vals:a.data.get(f.dataId).values,shape:f.shape}));o=C.computeOutShape(u.map(f=>f.shape),1);let c=u[0].shape[0]===1,d=h3(p,o,t[0].dtype,c),h=C.computeOutShape(l.map(f=>f.shape),s),m=a.makeTensorInfo(h,t[0].dtype,d);return u.forEach(f=>a.disposeIntermediateTensorInfo(f)),m}var rW={kernelName:pu,backendName:"cpu",kernelFunc:Ql};function ov(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:p}=n;Ie([r,s],"conv2d");let c=C.convertConv2DDataFormat(l),d=C.computeConv2DInfo(r.shape,s.shape,i,u,o,p,!1,c),h=d.filterHeight,m=d.filterWidth,f=d.dilationHeight,g=d.dilationWidth,y=d.padInfo.left,x=d.padInfo.top,A=d.dataFormat==="channelsLast",b=new Vt(d.outShape,r.dtype),w=v.computeStrides(r.shape),I=v.computeStrides(s.shape),T=w[0],N=A?w[1]:w[2],M=A?w[2]:1,P=A?1:w[1],E=b.strides[0],S=A?b.strides[1]:b.strides[2],_=A?b.strides[2]:1,O=A?1:b.strides[1],W=a.data.get(r.dataId).values,$=a.data.get(s.dataId).values,U=b.values;for(let G=0;G=d.inHeight)continue;let ge=re*I[0],ie=q+ee*N;for(let be=0;be=d.inWidth)continue;let ft=ge+Le*I[1],dt=ie+qe*M,st=ft;for(let it=0;it=u.inDepth)continue;let G=$*M[0],q=E+U*N[1];for(let H=0;H=u.inHeight)continue;let ee=G+X*M[1],ge=q+re*N[2];for(let ie=0;ie=u.inWidth)continue;let qe=ee+Re*M[2],ft=ge+Le*u.inChannels,dt=qe;for(let st=0;stMath.cos(e)),yW={kernelName:Ii,backendName:"cpu",kernelFunc:gW},xW=ct(Si,e=>Math.cosh(e)),AW={kernelName:Si,backendName:"cpu",kernelFunc:xW};function bW(e){let{inputs:t,backend:a,attrs:n}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=n,[p,c,d,h]=r.shape,m=s.shape[0],[f,g]=o,y=$e([m,f,g,h],"float32"),x=a.data.get(s.dataId).values,A=a.data.get(i.dataId).values,b=a.data.get(r.dataId).values,w=v.computeStrides(r.shape),I=v.computeStrides(y.shape);for(let T=0;T=p)continue;let O=f>1?(E-M)*(c-1)/(f-1):0,W=g>1?(S-P)*(d-1)/(g-1):0;for(let $=0;$1?M*(c-1)+$*O:.5*(M+E)*(c-1);if(U<0||U>c-1){for(let G=0;G1?P*(d-1)+V*W:.5*(P+S)*(d-1);if(Z<0||Z>d-1){for(let ge=0;ge1?P*(d-1)+G*W:.5*(P+S)*(d-1);if(q<0||q>d-1){for(let Z=0;Zy+m-x-1:(y,x)=>y+x;for(let y=0;yy+m-x-1:(y,x)=>y+x;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`);let o=r.shape[0],l=r.shape[1],u=r.shape[2],p=r.shape[3],c=l*s,d=u*s,h=p/(s*s),m=a.data.get(r.dataId).values,f=new Float32Array(o*c*d*h),g=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let h=C.computeConv2DInfo(r.shape,s.shape,i,d,o,u,!0),{filterHeight:m,filterWidth:f,dilationHeight:g,dilationWidth:y,padInfo:x}=h,A=x.left,b=x.top,w=h.outChannels/h.inChannels,I=new Vt(h.outShape,r.dtype),T=a.data.get(r.dataId).values,N=a.data.get(s.dataId).values,M=I.values;for(let P=0;P=h.inHeight)continue;let G=$*c[0],q=E+U*p[1];for(let H=0;H=h.inWidth)continue;let ee=G+X*c[1],ge=q+re*h.inChannels,ie=V,be=ee;for(let Ce=0;Ce{let{x:n,filter:r}=e,{strides:s,pad:i,dilations:o}=a,l=t,u=l.data.get(n.dataId).values,p=n.shape.length,c=l.data.get(r.dataId).values,d=r.shape.length,{batchSize:h,inHeight:m,inWidth:f,inChannels:g,outHeight:y,outWidth:x,padInfo:A,strideHeight:b,strideWidth:w,filterHeight:I,filterWidth:T,dilationHeight:N,dilationWidth:M,outShape:P}=C.computeDilation2DInfo(n.shape,r.shape,s,i,"NHWC",o),E=v.sizeFromShape(P),S=P.length,_=v.getArrayFromDType(n.dtype,E);for(let O=0;O=0&&X=0&&eeH&&(H=be)}}}let V=v.locToIndex([O,W,U,q],S,v.computeStrides(P));_[V]=H}}}return{dataId:l.write(v.toTypedArray(_,n.dtype),P,n.dtype),shape:P,dtype:n.dtype}}},zW={kernelName:Hl,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:a})=>{let{x:n,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=a,u=t,p=v.toNestedArray(n.shape,u.data.get(n.dataId).values),c=v.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:x,strideHeight:A,strideWidth:b,filterHeight:w,filterWidth:I,dilationHeight:T,dilationWidth:N,outShape:M}=C.computeDilation2DInfo(n.shape,r.shape,i,o,"NHWC",l);v.assert(s.rank===M.length,()=>`Error in ${Hl}, dy must have the same rank as output ${M.length}, but got ${s.rank}`);let P=v.toNestedArray(M,u.data.get(s.dataId).values),E=v.makeZerosNestedTypedArray(r.shape,r.dtype);for(let S=0;S=0&&Z=0&&reG&&(G=ee,q=V,H=X)}}}E[q][H][U]+=P[S][_][W][U]}}}return{dataId:u.write(v.toTypedArray(E,n.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},LW={kernelName:Gl,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:a})=>{let{x:n,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=a,u=t,p=v.toNestedArray(n.shape,u.data.get(n.dataId).values),c=v.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:d,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:x,strideHeight:A,strideWidth:b,filterHeight:w,filterWidth:I,dilationHeight:T,dilationWidth:N,outShape:M}=C.computeDilation2DInfo(n.shape,r.shape,i,o,"NHWC",l);v.assert(s.rank===M.length,()=>`Error in ${Gl}, dy must have the same rank as output ${M.length}, but got ${s.rank}`);let P=v.toNestedArray(M,u.data.get(s.dataId).values),E=v.makeZerosNestedTypedArray(n.shape,n.dtype);for(let S=0;S=0&&Z=0&&reG&&(G=ee,q=Z,H=re)}}}E[S][q][H][U]+=P[S][_][W][U]}}}return{dataId:u.write(v.toTypedArray(E,n.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}};function WW(e){let{inputs:t,backend:a,attrs:n}=e,{image:r}=t,{canvas:s,options:i}=n,{contextOptions:o,imageOptions:l}=i||{},u=(l==null?void 0:l.alpha)||1,p=(o==null?void 0:o.contextType)||"2d";if(p!=="2d")throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);let c=s.getContext(p,(o==null?void 0:o.contextAttributes)||{});if(c==null)throw new Error(`Could not get the context with ${p} type.`);let[d,h]=r.shape.slice(0,2),m=r.shape.length===2?1:r.shape[2],f=a.data.get(r.dataId).values,g=r.dtype==="float32"?255:1,y=new Uint8ClampedArray(h*d*4);for(let A=0;A1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${T}.`)}else if(r.dtype==="int32"&&(T<0||T>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${T}.`);m===1?(b[0]=T*g,b[1]=T*g,b[2]=T*g):b[I]=T*g}let w=A*4;y[w+0]=Math.round(b[0]),y[w+1]=Math.round(b[1]),y[w+2]=Math.round(b[2]),y[w+3]=Math.round(b[3])}s.width=h,s.height=d;let x=new ImageData(y,h,d);return c.putImageData(x,0,0),r}var BW={kernelName:mp,backendName:"cpu",kernelFunc:WW};function qp(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;Ie(r,"sum");let o;r.dtype==="bool"?o=rs({inputs:{x:r},backend:a,attrs:{dtype:"int32"}}):o=tr({inputs:{x:r},backend:a});let l=o.shape.length,u=v.parseAxisParam(s,o.shape),p=C.getAxesPermutation(u,l),c=u,d=o;p!=null&&(d=Va({inputs:{x:o},backend:a,attrs:{perm:p}}),c=C.getInnerMostAxes(c.length,l)),C.assertAxesAreInnerMostDims("sum",c,d.shape.length);let[h,m]=C.computeOutAndReduceShapes(d.shape,c),f=C.upcastType(d.dtype,"int32"),g=yh(a,h,f),y=v.sizeFromShape(m),x=a.data.get(g.dataId).values,A=a.data.get(d.dataId).values;for(let b=0;b=0&&(d=qp({inputs:{x:d},backend:a,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(d)),h--)}for(let f of m)f!==d&&a.disposeIntermediateTensorInfo(f);return d}var GW={kernelName:fp,backendName:"cpu",kernelFunc:UW};function HW(e){let{inputs:t,backend:a}=e,{dy:n,y:r}=t;Ie([n,r],"eluGrad");let s=new Float32Array(v.sizeFromShape(r.shape)),i=a.data.get(r.dataId).values,o=a.data.get(n.dataId).values;for(let l=0;l=0?s[l]=o[l]:s[l]=o[l]*(u+1)}return a.makeTensorInfo(r.shape,"float32",s)}var jW={kernelName:fu,backendName:"cpu",kernelFunc:HW},qW=C.ERF_P,XW=C.ERF_A1,KW=C.ERF_A2,YW=C.ERF_A3,ZW=C.ERF_A4,JW=C.ERF_A5,QW=ct($i,e=>{let t=Math.sign(e),a=Math.abs(e),n=1/(1+qW*a);return t*(1-((((JW*n+ZW)*n+YW)*n+KW)*n+XW)*n*Math.exp(-a*a))}),eB={kernelName:$i,backendName:"cpu",kernelFunc:QW};function bh(e){let{inputs:t,backend:a,attrs:n}=e,{input:r}=t,{dim:s}=n,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(v.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),At({inputs:{x:r},backend:a,attrs:{shape:o}})}var tB={kernelName:gu,backendName:"cpu",kernelFunc:bh},aB=$t((e,t)=>e/t),I3=Kt(Pi,aB),P1={kernelName:Pi,backendName:"cpu",kernelFunc:I3};function uv(e,t,a){let n=e.shape,r=n[0],s=n[1],i=a.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,u=[r,s],p=v.sizeFromShape(u),c=v.getTypedArrayFromDType("float32",p),d=v.getTypedArrayFromDType("float32",p);for(let g=0;g{let{image:n}=e,r=a,s=v.getTypedArrayFromDType(n.dtype,v.sizeFromShape(n.shape)),[i,o,l,u]=n.shape,p=r.data.get(n.dataId).values;for(let c=0;c=0&&x=0,()=>`GatherV2: the index value ${w} is not in [0, ${p-1}]`)}let c=o;o==null&&(c=0);let d=v.sizeFromShape(s.shape),h=C.segment_util.collectGatherOpShapeInfo(r,s,l,c),m=At({inputs:{x:r},backend:a,attrs:{shape:[h.batchSize,h.outerSize,h.dimSize,h.sliceSize]}}),f=At({inputs:{x:s},backend:a,attrs:{shape:[h.batchSize,d/h.batchSize]}}),g=[h.batchSize,h.outerSize,d/h.batchSize,h.sliceSize],y=a.bufferSync(f),x=a.bufferSync(m),A=C6(x,y,g);return a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(f),a.makeTensorInfo(h.outputShape,A.dtype,A.values)}var xB={kernelName:xu,backendName:"cpu",kernelFunc:yB};function AB(e){let{inputs:t,backend:a}=e,{input:n}=t,r=v.sizeFromShape(n.shape),s=n.shape[n.shape.length-1],i=r/s,o=At({inputs:{x:n},backend:a,attrs:{shape:[i,s]}}),l=uv(o,!0,a),u=At({inputs:{x:l},backend:a,attrs:{shape:n.shape}});return a.disposeIntermediateTensorInfo(o),a.disposeIntermediateTensorInfo(l),u}var bB={kernelName:yp,backendName:"cpu",kernelFunc:AB},vB=ct(ji,e=>Number.isFinite(e)?1:0,"bool"),wB={kernelName:ji,backendName:"cpu",kernelFunc:vB},kB=ct(qi,e=>Math.abs(e)===1/0?1:0,"bool"),IB={kernelName:qi,backendName:"cpu",kernelFunc:kB},SB=ct(Xi,e=>Number.isNaN(e)?1:0,"bool"),CB={kernelName:Xi,backendName:"cpu",kernelFunc:SB};function TB(e){let{backend:t,attrs:a}=e,{start:n,stop:r,num:s}=a,i=M6(n,r,s);return t.makeTensorInfo([i.length],"float32",i)}var NB={kernelName:Ji,backendName:"cpu",kernelFunc:TB},RB=ct(eo,e=>Math.log1p(e)),EB={kernelName:eo,backendName:"cpu",kernelFunc:RB},MB=$t((e,t)=>e&&t),PB=Kt(to,MB,null,"bool"),_B={kernelName:to,backendName:"cpu",kernelFunc:PB},$B=ct(ao,e=>e?0:1,"bool"),FB={kernelName:ao,backendName:"cpu",kernelFunc:$B},DB=$t((e,t)=>e||t),OB=Kt(no,DB,null,"bool"),zB={kernelName:no,backendName:"cpu",kernelFunc:OB};function LB(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;Ie(r,"LRN");let u=r.shape[3],p=u-1,c=a.data.get(r.dataId).values,d=v.sizeFromShape(r.shape),h=new Float32Array(d);function m(f){let g=f%u,y=f-g+Math.max(0,g-s),x=f-g+Math.min(g+s,p),A=0;for(;y<=x;y++){let b=c[y];A+=b*b}return A}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let p=C.computePool2DInfo(r.shape,s,i,u,o,l),c;if(p.filterWidth===1&&p.filterHeight===1&&v.arraysEqual(p.inShape,p.outShape))c=tr({inputs:{x:r},backend:a});else{let d=a.data.get(r.dataId).values,h=v.computeStrides(r.shape),m=k3(d,r.shape,r.dtype,h,p,"max");c=a.makeTensorInfo(p.outShape,r.dtype,m.values)}return c}var HB={kernelName:oo,backendName:"cpu",kernelFunc:GB};function jB(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n;Ie(r,"maxPool3d");let p=C.computePool3DInfo(r.shape,s,i,1,o,l,u),c=a.data.get(r.dataId).values,d=iv(c,r.shape,r.dtype,v.computeStrides(r.shape),p,"max");return a.makeTensorInfo(d.shape,"float32",d.values)}var qB={kernelName:bu,backendName:"cpu",kernelFunc:jB};function XB(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n;Ie([r,s],"maxPool3DGrad");let p=C.computePool3DInfo(s.shape,i,o,1,l,u),c=a.bufferSync(s),d=DL(c,p),h=p.strideDepth,m=p.strideHeight,f=p.strideWidth,g=p.dilationDepth,y=p.dilationHeight,x=p.dilationWidth,A=p.effectiveFilterDepth,b=p.effectiveFilterHeight,w=p.effectiveFilterWidth,I=A-1-p.padInfo.front,T=w-1-p.padInfo.left,N=b-1-p.padInfo.top,M=$e(s.shape,"float32"),P=a.bufferSync(r);for(let E=0;E=p.outDepth||Math.floor(V)!==V))for(let Z=0;Z=p.outHeight||Math.floor(X)!==X))for(let re=0;re=p.outWidth||Math.floor(ee)!==ee)continue;let ge=A*b*w-1-d.get(E,V,X,ee,S),ie=H*b*w+Z*w+re,be=ge===ie?1:0;if(be===0)continue;let Ce=P.get(E,V,X,ee,S);q+=Ce*be}}}M.set(q,E,_,O,W,S)}return a.makeTensorInfo(M.shape,M.dtype,M.values)}var KB={kernelName:bp,backendName:"cpu",kernelFunc:XB};function YB(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s,output:i}=t,o=s;Ie([s,i],"maxPoolGrad");let{filterSize:l,strides:u,pad:p,dimRoundingMode:c}=n,d=C.computePool2DInfo(o.shape,l,u,1,p,c),h=a.data.get(o.dataId).values,m=$e(d.outShape,o.dtype,sv(h,o.shape,o.dtype,d).values),f=d.strideHeight,g=d.strideWidth,y=d.dilationHeight,x=d.dilationWidth,A=d.effectiveFilterHeight,b=d.effectiveFilterWidth,w=b-1-d.padInfo.left,I=A-1-d.padInfo.top,T=$e(o.shape,"float32"),N=a.data.get(r.dataId).values,M=$e(r.shape,"float32",N);for(let P=0;P=d.outHeight||Math.floor(G)!==G))for(let q=0;q=d.outWidth||Math.floor(H)!==H)continue;let V=A*b-1-m.get(P,G,H,E),Z=U*b+q,X=V===Z?1:0;if(X===0)continue;let re=M.get(P,G,H,E);$+=re*X}}T.set($,P,S,_,E)}return a.makeTensorInfo(T.shape,T.dtype,T.values)}var ZB={kernelName:Ap,backendName:"cpu",kernelFunc:YB};function JB(e,t,a,n,r){let s=v.computeStrides(t),i=k3(e,t,a,s,r,"max"),o=sv(e,t,a,r,!0,n);return[i.values,o.values]}var QB={kernelName:vu,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=a;Ie(n,"MaxPoolWithArgmax");let u=l.data.get(n.dataId).values,p=C.computePool2DInfo(n.shape,r,s,[1,1],i),[c,d]=JB(u,n.shape,n.dtype,o,p),h=l.write(c,p.outShape,n.dtype),m=l.write(d,p.outShape,n.dtype);return[{dataId:h,shape:p.outShape,dtype:n.dtype},{dataId:m,shape:p.outShape,dtype:"int32"}]}};function eV(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=v.parseAxisParam(s,r.shape),l=C.computeOutAndReduceShapes(r.shape,o)[1],u=v.sizeFromShape(l),p=[],c=a.makeTensorInfo([],"float32",new Float32Array([u]));p.push(c);let d=rs({inputs:{x:r},backend:a,attrs:{dtype:"float32"}});p.push(d);let h=I3({inputs:{a:d,b:c},backend:a});p.push(h);let m=qp({inputs:{x:h},backend:a,attrs:{axis:s,keepDims:i}});return p.forEach(f=>a.disposeIntermediateTensorInfo(f)),m}var tV={kernelName:lo,backendName:"cpu",kernelFunc:eV};function aV(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;Ie(r,"min");let o=v.parseAxisParam(s,r.shape),l=o,u=C.getAxesPermutation(l,r.shape.length),p=r;u!=null&&(p=Va({inputs:{x:r},backend:a,attrs:{perm:u}}),l=C.getInnerMostAxes(l.length,r.shape.length)),C.assertAxesAreInnerMostDims("min",l,p.shape.length);let[c,d]=C.computeOutAndReduceShapes(p.shape,l),h=v.sizeFromShape(d),m=v.makeZerosTypedArray(v.sizeFromShape(c),p.dtype),f=a.data.get(p.dataId).values;for(let y=0;yx[0]+r.shape[A]+x[1]),l=s.map(x=>x[0]),u=s.map((x,A)=>x[0]+r.shape[A]),p=i==="reflect"?0:1,c=a.data.get(r.dataId).values,d=r.shape.length,h=v.computeStrides(r.shape),m=v.sizeFromShape(o),f=o.length,g=v.computeStrides(o),y=v.getTypedArrayFromDType(r.dtype,m);for(let x=0;x=u[w]&&(A[w]=(u[w]-1)*2-A[w]+p);A=A.map((w,I)=>w-l[I]);let b=v.locToIndex(A,d,h);y[x]=c[b]}return{dataId:a.write(y,o,r.dtype),shape:o,dtype:r.dtype}}var sV={kernelName:co,backendName:"cpu",kernelFunc:rV},iV=$t((e,t)=>{let a=e%t;return e<0&&t<0||e>=0&&t>=0?a:(a+t)%t}),oV=Kt(ho,iV),lV={kernelName:ho,backendName:"cpu",kernelFunc:oV},uV=tu(pA());function pv(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{dim:s}=n,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=v.parseAxisParam([o],r.shape),u=dv({inputs:{x:r},backend:a,attrs:{reductionIndices:l,keepDims:!1}}),p=C.expandShapeToKeepDim(u.shape,l),c=At({inputs:{x:u},backend:a,attrs:{shape:p}}),d=v3({inputs:{a:r,b:c},backend:a}),h=v6({inputs:{x:d},backend:a}),m=qp({inputs:{x:h},backend:a,attrs:{axis:l,keepDims:!1}}),f=At({inputs:{x:m},backend:a,attrs:{shape:p}}),g=I3({inputs:{a:h,b:f},backend:a});return a.disposeIntermediateTensorInfo(u),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(d),a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(f),g}var dV={kernelName:Uo,backendName:"cpu",kernelFunc:pv};function pV(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n;Ie(r,"multinomial");let l=o?r:pv({inputs:{logits:r},backend:a,attrs:{dim:-1}}),u=l.shape[0],p=l.shape[1],c=a.data.get(l.dataId).values,d=[u,s],h=v.makeZerosTypedArray(v.sizeFromShape(d),"int32");for(let m=0;m=0&&c[d]{v.assertShapesMatch(s,p.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===p.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(p=>{let c=bh({inputs:{input:p},backend:a,attrs:{dim:r}});return o.push(c),c}),u=Ql({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(p=>a.disposeIntermediateTensorInfo(p)),u}var CV={kernelName:Su,backendName:"cpu",kernelFunc:hv};function TV(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{paddings:s,constantValue:i}=n;Ie(r,"pad");let o=s.map((y,x)=>y[0]+r.shape[x]+y[1]),l=s.map(y=>y[0]),u=a.data.get(r.dataId).values,p=v.sizeFromShape(r.shape),c=r.shape.length,d=v.computeStrides(r.shape),h=v.sizeFromShape(o),m=o.length,f=v.computeStrides(o),g=v.getTypedArrayFromDType(r.dtype,h);i!==0&&g.fill(i);for(let y=0;yb+l[w]),A=v.locToIndex(x,m,f);g[A]=u[y]}return{dataId:a.write(g,o,r.dtype),shape:o,dtype:r.dtype}}var mv={kernelName:bo,backendName:"cpu",kernelFunc:TV},NV=$t((e,t)=>Math.pow(e,t)),RV=Kt(vo,NV),EV={kernelName:vo,backendName:"cpu",kernelFunc:RV};function MV(e){let{inputs:t,backend:a,attrs:n}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:i}=t,{outputRaggedRank:o}=n,l=r.map(y=>a.data.get(y.dataId).values),u=r.map(y=>y.shape),p=a.data.get(s.dataId).values,c=a.data.get(i.dataId).values,[d,h,m]=L6(l,u,p,s.shape,s.dtype,c,i.shape,o),f=d.map(y=>a.makeTensorInfo([y.length],"int32",y)),g=a.makeTensorInfo(m,s.dtype,h);return f.concat([g])}var PV={kernelName:Mh,backendName:"cpu",kernelFunc:MV};function _V(e){let{inputs:t,backend:a}=e,{starts:n,limits:r,deltas:s}=t,i=a.data.get(n.dataId).values,o=a.data.get(r.dataId).values,l=a.data.get(s.dataId).values,[u,p]=W6(i,n.shape,n.dtype,o,r.shape,l,s.shape),c=a.makeTensorInfo([u.length],"int32",u),d=a.makeTensorInfo([p.length],n.dtype,p);return[c,d]}var $V={kernelName:Ph,backendName:"cpu",kernelFunc:_V};function FV(e){let{inputs:t,backend:a,attrs:n}=e,{shape:r,values:s,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=n,u=a.data.get(r.dataId).values,p=a.data.get(s.dataId).values,c=a.data.get(i.dataId).values,d=o.map(g=>a.data.get(g.dataId).values),h=o.map(g=>g.shape),[m,f]=B6(u,r.shape,p,s.shape,s.dtype,c,i.shape,d,h,l);return a.makeTensorInfo(m,s.dtype,f)}var DV={kernelName:_h,backendName:"cpu",kernelFunc:FV};function OV(e){let{backend:t,attrs:a}=e,{start:n,stop:r,dtype:s,step:i}=a,o=g3(n,r,i,s);return t.makeTensorInfo([o.length],s,o)}var zV={kernelName:Cu,backendName:"cpu",kernelFunc:OV},LV=ct(Io,e=>1/e),WV={kernelName:Io,backendName:"cpu",kernelFunc:LV};function BV(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n;Ie(r,"resizeBilinear");let l=v.computeStrides(r.shape),[u,p]=o,[c,d,h,m]=r.shape,f=a.data.get(r.dataId).values,g=new Float32Array(v.sizeFromShape([c,u,p,m])),y=[s&&u>1?d-1:d,s&&p>1?h-1:h],x=[s&&u>1?u-1:u,s&&p>1?p-1:p],A=0,b=y[0]/x[0],w=y[1]/x[1];for(let I=0;I1?u-1:u,i&&h>1?p-1:p],g=[i&&d>1?d-1:d,i&&h>1?h-1:h],y=f[0]/g[0],x=f[1]/g[1],A=a.data.get(s.dataId).values,b=0;for(let w=0;w1?d-1:d,s&&p>1?h-1:h],x=[s&&u>1?u-1:u,s&&p>1?p-1:p],A=y[0]/x[0],b=y[1]/x[1],w=0;for(let I=0;I1?p-1:p,i&&m>1?c-1:c],x=[i&&h>1?h-1:h,i&&m>1?m-1:m],A=y[0]/x[0],b=y[1]/x[1],w=1/A,I=1/b,T=Math.ceil(w)*2+2,N=Math.ceil(I)*2+2;for(let M=0;M=h)continue;let X=P+Z*l[1],re=Z*A,ee=Math.min(p-1,i?Math.round(re):Math.floor(re));if(E===ee)for(let ge=0;ge=m)continue;let be=X+ie*l[2],Ce=ie*b,Re=Math.min(c-1,i?Math.round(Ce):Math.floor(Ce));W===Re&&(H+=g[be+q])}}f[$+q]=H}}}}return a.makeTensorInfo(r.shape,r.dtype,f)}var XV={kernelName:Nu,backendName:"cpu",kernelFunc:qV};function KV(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n;Ie(r,"reverse");let i=r.shape.length,o=v.parseAxisParam(s,r.shape);if(i===0)return tr({inputs:{x:r},backend:a});let l=new Vt(r.shape,r.dtype),u=a.bufferSync(r);for(let p=0;pd[h]=r.shape[h]-1-d[h]),l.set(u.get(...d),...c)}return a.makeTensorInfo(l.shape,l.dtype,l.values)}var YV={kernelName:Ro,backendName:"cpu",kernelFunc:KV},ZV={kernelName:Jo,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{image:n}=e,{radians:r,fillValue:s,center:i}=t,o=a,l=v.getTypedArrayFromDType(n.dtype,v.sizeFromShape(n.shape)),[u,p,c,d]=n.shape,[h,m]=C.getImageCenter(i,p,c),f=255,g=Math.sin(r),y=Math.cos(r),x=o.data.get(n.dataId).values;for(let A=0;A=0&&_=0&&O{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2===0?t:t+1}),QV={kernelName:Eo,backendName:"cpu",kernelFunc:JV};function eU(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r,updates:s}=t,{shape:i}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:p,outputSize:c}=C.calculateShapes(s,r,i),d=!0,h=a.bufferSync(r),m=a.bufferSync(s),f=js(h,m,i,c,u,l,o,p,0,d);return a.makeTensorInfo(i,f.dtype,f.values)}var tU={kernelName:Po,backendName:"cpu",kernelFunc:eU};function aU(e,t){let a=0,n=e.length,r=0;for(;a1||r.shape.length===1?1:v.sizeFromShape(r.shape.slice(1));for(let m=0;me>=0?dU*e:uU*(Math.exp(e)-1)),cU={kernelName:Fo,backendName:"cpu",kernelFunc:pU},hU=ct(zo,e=>e<0?-1:e>0?1:0),mU={kernelName:zo,backendName:"cpu",kernelFunc:hU},fU=ct(Do,e=>Math.sin(e)),gU={kernelName:Do,backendName:"cpu",kernelFunc:fU},yU=ct(Oo,e=>Math.sinh(e)),xU={kernelName:Oo,backendName:"cpu",kernelFunc:yU},AU=11920928955078125e-23,b5=Math.log(AU)+2,bU=ct(Wo,e=>{let t=e>-b5,a=e0&&v.isString(n[0])){let s=n.map(i=>v.encodeString(i));r=this.write(s,t,a)}else r=this.write(n,t,a);return{dataId:r,shape:t,dtype:a}}refCount(t){return this.data.has(t)?this.data.get(t).refCount:0}incRef(t){let a=this.data.get(t);a.refCount++}decRef(t){if(this.data.has(t)){let a=this.data.get(t);a.refCount--}}move(t,a,n,r,s){this.data.set(t,{values:a,dtype:r,refCount:s})}numDataIds(){return this.data.numDataIds()}async read(t){return this.readSync(t)}readSync(t){let{dtype:a,complexTensorInfos:n}=this.data.get(t);if(a==="complex64"){let r=this.readSync(n.real.dataId),s=this.readSync(n.imag.dataId);return I.mergeRealAndImagArrays(r,s)}return v.convertBackendValuesAndArrayBuffer(this.data.get(t).values,a)}bufferSync(t){let a=this.readSync(t.dataId);if(t.dtype==="string")try{let n=a.map(r=>v.decodeString(r));return Te(t.shape,t.dtype,n)}catch(n){throw new Error("Failed to decode encoded string bytes into utf-8")}return Te(t.shape,t.dtype,a)}makeOutput(t,a,n){return St().makeTensorFromTensorInfo(this.makeTensorInfo(a,n,t),this)}disposeData(t,a=!1){if(this.data.has(t)){if(this.data.get(t).refCount--,!a&&this.data.get(t).refCount>0)return!1;let{complexTensorInfos:n}=this.data.get(t);n!=null&&(this.disposeData(n.real.dataId,!0),this.disposeData(n.imag.dataId,!0)),this.data.delete(t)}return!0}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}async time(t){let a=v.now();return t(),{kernelMs:v.now()-a}}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(t){Ie([t],"where");let a=this.readSync(t.dataId);return Pz(t.shape,a)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};A3.nextDataId=0;var b3={};Ke(b3,{addImpl:()=>D6,bincountImpl:()=>w3,bincountReduceImpl:()=>P6,bitwiseAndImpl:()=>_6,castImpl:()=>$6,ceilImpl:()=>O6,concatImpl:()=>k3,equalImpl:()=>z6,expImpl:()=>W6,expm1Impl:()=>V6,floorDivImpl:()=>G6,floorImpl:()=>U6,gatherNdImpl:()=>H6,gatherV2Impl:()=>j6,greaterEqualImpl:()=>X6,greaterImpl:()=>q6,lessEqualImpl:()=>Y6,lessImpl:()=>K6,linSpaceImpl:()=>Z6,logImpl:()=>J6,maxImpl:()=>Q6,maximumImpl:()=>ev,minimumImpl:()=>tv,multiplyImpl:()=>I3,negImpl:()=>av,notEqualImpl:()=>nv,prodImpl:()=>rv,raggedGatherImpl:()=>sv,raggedRangeImpl:()=>iv,raggedTensorToTensorImpl:()=>ov,rangeImpl:()=>T3,rsqrtImpl:()=>lv,scatterImpl:()=>xi,sigmoidImpl:()=>DL,simpleAbsImpl:()=>F6,sliceImpl:()=>Sh,sparseFillEmptyRowsImpl:()=>dv,sparseReshapeImpl:()=>pv,sparseSegmentReductionImpl:()=>C3,sqrtImpl:()=>OL,squaredDifferenceImpl:()=>cv,staticRegexReplaceImpl:()=>hv,stridedSliceImpl:()=>mv,stringNGramsImpl:()=>N3,stringSplitImpl:()=>R3,stringToHashBucketFastImpl:()=>E3,subImpl:()=>fv,tileImpl:()=>gv,topKImpl:()=>xv,transposeImpl:()=>S3,uniqueImpl:()=>F3});function F6(e){let t=new Float32Array(e.length);for(let a=0;a{let{x:t}=e.inputs,a=e.backend;Ie(t,"abs");let n=new Float32Array(v.sizeFromShape(t.shape)),r=a.data.get(t.dataId).values;return n=F6(r),a.makeOutput(n,t.shape,t.dtype)},Oz={kernelName:cu,backendName:"cpu",kernelFunc:_z};function Pt(e){return(t,a,n,r,s)=>{let i=I.assertAndGetBroadcastShape(t,a),o=i.length,l=v.computeStrides(i),u=v.sizeFromShape(i),d=v.getTypedArrayFromDType(s,u),c=t.length,p=a.length,h=v.computeStrides(t),m=v.computeStrides(a),f=I.getBroadcastDims(t,i),g=I.getBroadcastDims(a,i);if(f.length+g.length===0)for(let y=0;yA[C]=0);let b=v.locToIndex(A,c,h),w=x.slice(-p);g.forEach(C=>w[C]=0);let S=v.locToIndex(w,p,m);d[y]=e(n[b],r[S])}return[d,i]}}function Qa(e){let{inputs:t,backend:a}=e,{real:n,imag:r}=t,s=a.data.get(n.dataId).values,i=a.data.get(r.dataId).values,o=a.makeTensorInfo(n.shape,"complex64"),l=a.data.get(o.dataId);return l.complexTensorInfos={real:a.makeTensorInfo(n.shape,"float32",s),imag:a.makeTensorInfo(r.shape,"float32",i)},o}var zz={kernelName:xp,backendName:"cpu",kernelFunc:Qa};function Ih(e,t,a="float32"){if(a==="complex64"){let r=Ih(e,t,"float32"),s=Ih(e,t,"float32");return Qa({inputs:{real:r,imag:s},backend:e})}let n=v.makeZerosTypedArray(v.sizeFromShape(t),a);return e.makeTensorInfo(t,a,n)}function sr(e){let{inputs:t,backend:a}=e,{x:n}=t;return a.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}var Lz={kernelName:ho,backendName:"cpu",kernelFunc:sr};function Ti(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.data.get(n.dataId).complexTensorInfos.real,s=a.data.get(r.dataId).values;return a.makeTensorInfo(r.shape,r.dtype,s)}var Wz={kernelName:Ep,backendName:"cpu",kernelFunc:Ti};function $6(e,t,a,n){if(n==="int32"){let r=Int32Array.from(e);return[t,"int32",r]}if(n==="bool"){let r=v.toTypedArray([0],a),[s,i]=Pt((o,l)=>o!==l?1:0)(t,[],e,r,"bool");return[i,"bool",s]}throw new Error(`Error in Cast: failed to cast ${a} to ${n}`)}function ds(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dtype:s}=n;if(s==="complex64"){if(r.dtype==="complex64")return sr({inputs:{x:r},backend:a});let d=Ih(a,r.shape,r.dtype),c=ds({inputs:{x:r},backend:a,attrs:{dtype:"float32"}}),p=Qa({inputs:{real:c,imag:d},backend:a});return a.disposeIntermediateTensorInfo(d),a.disposeIntermediateTensorInfo(c),p}if(r.dtype==="complex64"){let d=Ti({inputs:{input:r},backend:a}),c=ds({inputs:{x:d},backend:a,attrs:{dtype:s}});return a.disposeIntermediateTensorInfo(d),c}if(!v.hasEncodingLoss(r.dtype,s)){let d=sr({inputs:{x:r},backend:a});return{dataId:d.dataId,shape:d.shape,dtype:s}}let i=a.data.get(r.dataId).values,[o,l,u]=$6(i,r.shape,r.dtype,s);return a.makeTensorInfo(o,l,u)}var Bz={kernelName:qi,backendName:"cpu",kernelFunc:ds};function Kt(e,t,a,n){return a==null?({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;Ie([i,o],e);let u=l.data.get(i.dataId).values,d=l.data.get(o.dataId).values,c=i.dtype==="string"?I.fromUint8ToStringArray(u):u,p=i.dtype==="string"?I.fromUint8ToStringArray(d):d,h=n||i.dtype,[m,f]=t(i.shape,o.shape,c,p,h);return l.makeTensorInfo(f,h,m)}:({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let u=ds({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),d=l.data.get(u.dataId),c=d.complexTensorInfos.real,p=d.complexTensorInfos.imag,h=l.data.get(c.dataId).values,m=l.data.get(p.dataId).values,f=ds({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),g=l.data.get(f.dataId),y=g.complexTensorInfos.real,x=g.complexTensorInfos.imag,A=l.data.get(y.dataId).values,b=l.data.get(x.dataId).values,[w,S,C]=a(i.shape,o.shape,h,m,A,b),N=l.makeTensorInfo(C,"float32",w),M=l.makeTensorInfo(C,"float32",S),F=Qa({inputs:{real:N,imag:M},backend:l});return l.disposeIntermediateTensorInfo(u),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(N),l.disposeIntermediateTensorInfo(M),F}else{let u=l.data.get(i.dataId).values,d=l.data.get(o.dataId).values,c=n||i.dtype,[p,h]=t(i.shape,o.shape,u,d,c);return l.makeTensorInfo(h,c,p)}}}function v3(e){return(t,a,n,r,s,i)=>{let o=I.assertAndGetBroadcastShape(t,a),l=v.sizeFromShape(o),u=o.length,d=v.computeStrides(o),c=v.getTypedArrayFromDType("float32",l),p=v.getTypedArrayFromDType("float32",l),h=I.getBroadcastDims(t,o),m=I.getBroadcastDims(a,o),f=I.mergeRealAndImagArrays(n,r),g=I.mergeRealAndImagArrays(s,i),y=t.length,x=v.computeStrides(t),A=a.length,b=v.computeStrides(a);if(h.length+m.length===0)for(let w=0;wC[T]=0);let N=v.locToIndex(C,y,x),M=S.slice(-A);m.forEach(T=>M[T]=0);let F=v.locToIndex(M,A,b),E=e(f[N*2],f[N*2+1],g[F*2],g[F*2+1]);c[w]=E.real,p[w]=E.imag}return[c,p,o]}}var D6=Pt((e,t)=>e+t),Vz=v3((e,t,a,n)=>({real:e+a,imag:t+n})),su=Kt(Mr,D6,Vz),Uz={kernelName:Mr,backendName:"cpu",kernelFunc:su};function w3(e,t,a,n,r){let s=v.sizeFromShape(n),i=v.makeZerosTypedArray(r,a);for(let o=0;o=r||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function P6(e,t,a,n=!1){let r=e.shape[0],s=e.shape[1],i=Te([r,a],t.dtype);for(let o=0;o=a||(n?i.set(1,o,u):t.size>0?i.set(i.get(o,u)+t.get(o,l),o,u):i.set(i.get(o,u)+1,o,u))}return i}var _6=Pt((e,t)=>e&t),Gz=Kt(ji,_6),Hz={kernelName:ji,backendName:"cpu",kernelFunc:Gz};function dr(e){return(t,a,n)=>{let r=v.getArrayFromDType(a,t.length);for(let s=0;s{let{x:i}=n;Ie(i,e);let o=s,l=o.data.get(i.dataId).values,u;if(i.dtype==="string"){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=I.fromUint8ToStringArray(l)}else u=l;let d=a||i.dtype,c=t(u,d,r);return o.makeTensorInfo(i.shape,d,c)}}var O6=dr(e=>Math.ceil(e)),jz=Os(cs,O6),qz={kernelName:cs,backendName:"cpu",kernelFunc:jz};function k3(e,t,a,n){let r=v.getArrayFromDType(a,v.sizeFromShape(t));if(n&&a!=="string"){let s=0;e.forEach(i=>{let o=v.sizeFromShape(i.shape);r.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=a==="string"?I.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let u=0;ue===t?1:0),L6=Kt(ms,z6,null,"bool"),Xz={kernelName:ms,backendName:"cpu",kernelFunc:L6},W6=dr(e=>Math.exp(e)),B6=Os(fs,W6,"float32"),Kz={kernelName:fs,backendName:"cpu",kernelFunc:B6},V6=dr(e=>Math.expm1(e)),Yz=Os(gs,V6),Zz={kernelName:gs,backendName:"cpu",kernelFunc:Yz},U6=dr(e=>Math.floor(e)),Jz=Os(ys,U6),Qz={kernelName:ys,backendName:"cpu",kernelFunc:Jz},G6=Pt((e,t)=>Math.floor(e/t)),eL=Kt(xs,G6,null,"int32"),tL={kernelName:xs,backendName:"cpu",kernelFunc:eL};function H6(e,t,a,n,r,s,i,o,l){let u=Te([n,s],a);for(let d=0;d=l/s)throw new Error(`Invalid indices: ${c} does not index into ${o}`);for(let h=0;he>t?1:0),aL=Kt(As,q6,null,"bool"),nL={kernelName:As,backendName:"cpu",kernelFunc:aL},X6=Pt((e,t)=>e>=t?1:0),rL=Kt(bs,X6,null,"bool"),sL={kernelName:bs,backendName:"cpu",kernelFunc:rL},K6=Pt((e,t)=>ee<=t?1:0),lL=Kt(ws,Y6,null,"bool"),uL={kernelName:ws,backendName:"cpu",kernelFunc:lL};function Z6(e,t,a){let n=(t-e)/(a-1),r=v.makeZerosTypedArray(a,"float32");r[0]=e;for(let s=1;sMath.log(e)),dL=Os(ks,J6),pL={kernelName:ks,backendName:"cpu",kernelFunc:dL};function Q6(e,t,a,n){let r=v.getTypedArrayFromDType(n,v.sizeFromShape(a));for(let s=0;so)&&(o=u)}r[s]=o}return r}var ev=Pt((e,t)=>Math.max(e,t)),cL=Kt(Is,ev),hL={kernelName:Is,backendName:"cpu",kernelFunc:cL},tv=Pt((e,t)=>Math.min(e,t)),mL=Kt(Ss,tv),fL={kernelName:Ss,backendName:"cpu",kernelFunc:mL},I3=Pt((e,t)=>e*t),gL=v3((e,t,a,n)=>({real:e*a-t*n,imag:e*n+t*a})),l0=Kt(Ts,I3,gL),yL={kernelName:Ts,backendName:"cpu",kernelFunc:l0};function av(e,t,a){let n=v.createScalarValue(-1,a);return I3([],t,n,e,a)}function xL(e){let{inputs:t,backend:a}=e,{x:n}=t;Ie(n,"neg");let r=a.data.get(n.dataId).values,[s,i]=av(r,n.shape,n.dtype);return a.makeTensorInfo(i,n.dtype,s)}var AL={kernelName:Ru,backendName:"cpu",kernelFunc:xL},nv=Pt((e,t)=>e!==t?1:0),bL=Kt(Cs,nv,null,"bool"),vL={kernelName:Cs,backendName:"cpu",kernelFunc:bL};function S3(e,t,a,n,r){let s=t.length,i=v.sizeFromShape(t),o=v.computeStrides(t),l=v.computeStrides(r),u=v.getTypedArrayFromDType(a,v.sizeFromShape(r));for(let d=0;da.disposeIntermediateTensorInfo(x)),a.makeTensorInfo(y,g,m)}var IL={kernelName:Oo,backendName:"cpu",kernelFunc:kL};function SL(e,t,a){e.forEach((n,r)=>{if(n<0||n>=a){let s=v.indexToLoc(r,t.length,v.computeStrides(t)).join(",");throw new Error(`indices[${s}] = ${n} is not in [0, ${a})`)}})}function TL(e,t){for(let a=0;ar)throw new Error("Ragged splits must not point past values");for(let s=1;sn[s])throw new Error("Ragged splits must be sorted in ascending order")}}function CL(e,t,a,n){let r=[],s=0,i=t.length-1+a.length,o=new Array(i).fill(null).map(()=>[0]);TL(a,n);let l=1;for(let u=0;u=0){let f=o[m],g=f[f.length-1]-h[d];for(let y=d;yr[i]=s)}return t}function E5(e,t){let a=e.slice(0,t);for(;a.length1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(i.length>1)throw new Error("deltas must be a scalar or vector");let o=t.length===0,l=r.length===0,u=i.length===0,d=[];o||d.push(t[0]),l||d.push(r[0]),u||d.push(i[0]);for(let g=1;g0&&xy)b=0;else if(b=Math.ceil(Math.abs((x-y)/A)),b>M5)throw new Error(`Requires ((limit - start) / delta) <= ${M5}`);p[g+1]=p[g]+b}let h=p[c],m=v.getArrayFromDType(a,h),f=0;for(let g=0;gn&&(n=s)}return n}static getMaxWidthValueRowID(t){let a=t.length;if(a===0)return 0;let n=0,r=t[0],s=0;for(let i=1;i"Final length of result must be equal to firstDimension."),s}calculateOutputIndexRowSplit(t,a,n,r){let s=t.length,i=[];for(let o=0;o0&&i.length!==t[s-1])throw new Error("Invalid row split size.");return i}calculateOutputIndexValueRowID(t,a,n,r){let s=t.length,i=[];if(s===0)return[];let o=0,l=t[0];if(l>=a.length)throw new Error(`Got currentValueRowId=${l}, which is not less than ${a.length}`);let u=a[l];i.push(u);for(let d=1;d=0&&(++o,o=a.length)throw new Error(`Got nextValueRowId=${c} which is not less than ${a.length}`);u=a[c]}i.push(u)}if(i.length!==t.length)throw new Error("Invalid row ids.");return i}calculateOutputIndex(t,a,n,r){let s=this.getRowPartitionTensor(t),i=this.getRowPartitionTypeByDimension(t);switch(i){case Cn.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,a,n,r);case Cn.ROW_SPLITS:if(s.length-1>a.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${a.length}`);return this.calculateOutputIndexRowSplit(s,a,n,r);default:throw new Error(`Unsupported partition type: ${Cn[i]}`)}}getFirstDimensionSize(){let t=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");let a=this.rowPartitionTypes[0];switch(a){case Cn.FIRST_DIM_SIZE:return t[0];case Cn.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case Cn.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${Cn[a]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");let t=this.getFirstDimensionSize(),a=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let i=n.length-2;i>=0;--i)n[i]=n[i+1]*a[i+1];let r=$5(a,!1),s=v.getArrayFromDType(this.valuesDType,v.sizeFromShape(r));if(n[0]*a[0]>0){let i=this.calculateFirstParentOutputIndex(t,n[0],a[0]);for(let o=1;o<=this.raggedRank;++o)i=this.calculateOutputIndex(o-1,i,n[o],a[o]);this.setOutput(this.raggedRank,i,s,r)}return[r,s]}setOutput(t,a,n,r){if(n.length===0)return;let s=this.values,i=n,o=r.slice();o=o.slice(t+1);let l=v.sizeFromShape(o),u=a.length,d=this.defaultValue;if(d.length!==l&&d.length!==1){let m=this.defaultValueShape;Pe(()=>{let f=Q(d,m);d=Ai(f,o).dataSync()})}let c=0,p=0,h=0;for(let m=0;m<=u;++m){let f=m=u){let g=n.length;f=Math.floor(g/l)}if(f>h)if(this.defaultValue.length===1)i.subarray(h*l,f*l).fill(this.defaultValue[0]),h=f;else for(;f>h;){let g=i.slice(h*l);F5(g,d,l),++h}f<0?(c=m+1,p=h):(c=m,p=h,h=p+1)}}};function F5(e,t,a){for(let n=0;n= 0`);if(n<-1)throw new Error(`Dimension ${n} must be >= -1`);n=-1}a.push(n)}return a}function ov(e,t,a,n,r,s,i,o,l,u){return new ML(e,t,a,n,r,s,i,o,l,u).compute()}function T3(e,t,a,n){let r=e===t,s=e1;if(r||s||i)return v.makeZerosTypedArray(0,n);let o=Math.abs(Math.ceil((t-e)/a)),l=v.makeZerosTypedArray(o,n);t1/Math.sqrt(e)),FL=Os(Ns,lv),$L={kernelName:Ns,backendName:"cpu",kernelFunc:FL};function xi(e,t,a,n,r,s,i,o,l,u){let d=[n/r,r],c=e.values,p=t.values;if(n===0)return Te(a,t.dtype);let h=l instanceof Rt?l:Te(d,t.dtype);typeof l=="string"||typeof l=="number"?h.values.fill(l):typeof l=="boolean"&&h.values.fill(+l);for(let m=0;m=n/r)throw new Error(`Invalid indices: ${f} does not index into ${a}`);for(let y=0;y1/(1+Math.exp(-e))),uv=ct(Rs,e=>1/(1+Math.exp(-e))),PL={kernelName:Rs,backendName:"cpu",kernelFunc:uv};function Sh(e,t,a,n,r){let s=wt.isSliceContinous(n,t,a),i=v.sizeFromShape(a),o=v.computeStrides(n);if(s){let c=wt.computeFlatOffset(t,o);return r==="string"?e.slice(c,c+i):e.subarray(c,c+i)}let l=r==="string"?I.fromUint8ToStringArray(e):e,u=Te(n,r,l),d=Te(a,r);for(let c=0;cm+t[f]);d.set(u.get(...h),...p)}return r==="string"?I.fromStringArrayToUint8(d.values):d.values}function Ci(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,size:i}=n;Ie(r,"slice");let[o,l]=wt.parseSliceParams(r,s,i);wt.assertParamsValid(r,o,l);let u=a.data.get(r.dataId).values,d=Sh(u,o,l,r.shape,r.dtype);return a.makeTensorInfo(l,r.dtype,d)}var _L={kernelName:zu,backendName:"cpu",kernelFunc:Ci};function dv(e,t,a,n,r,s,i){let o=t[0],l=s[0],u=new Array(l),d=new Array(o),c=t[1];if(l===0){if(o!==0)throw new Error(I.getSparseFillEmptyRowsIndicesDenseShapeMismatch(o));let g=v.getArrayFromDType(a,0),y=v.getArrayFromDType(r,0);return[g,[0,c],y,u,d]}let p=!0,h=0,m=new Array(l).fill(0);for(let g=0;g=l)throw new Error(I.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,y,l));++m[y],p=p&&y>=h,h=y}let f=!0;for(let g=0;g0&&(m[g]+=m[g-1])}if(f&&p){let g=e,y=n;for(let x=0;x0){p[c-1]=1;for(let f=c-2;f>=0;--f)p[f]=p[f+1]*n[f+1]}let h=[];if(o>0){h[o-1]=1;for(let f=o-2;f>=0;--f)h[f]=h[f+1]*l[f+1]}let m=v.getArrayFromDType(a,i*o);for(let f=0;f0?r[o-1]+1:0;if(d<0)throw new Error(I.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let c=t.slice();c[0]=d;let p=c.reduce((x,A)=>x*A,1),h=v.getArrayFromDType(a,p);if(o===0)return d>0&&h.fill(i),[h,c];if(d<=0)throw new Error(I.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=0,f=1,g=0,y=r[m];for(;;){let x=0;if(f=x)throw new Error(I.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(y<0||y>=d)throw new Error(I.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(y,d));y>g&&h.fill(i,g*u,y*u);for(let A=m;A=l[0])throw new Error(I.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(A,n[A],l[0]));for(let w=0;wo)break}return gMath.sqrt(e)),zL=ct(Es,e=>Math.sqrt(e)),LL={kernelName:Es,backendName:"cpu",kernelFunc:zL},cv=Pt((e,t)=>{let a=e-t;return a*a}),WL=Kt(Ms,cv),BL={kernelName:Ms,backendName:"cpu",kernelFunc:WL},hv=dr((e,t)=>{let{pattern:a,replaceGlobal:n,rewrite:r}=t;return e.replace(new RegExp(a,n?"g":""),r)}),VL=Os(Gu,hv),UL={kernelName:Gu,backendName:"cpu",kernelFunc:VL};function mv(e,t,a,n){let r=Te(e,t.dtype);for(let s=0;s0?0:i-o),p=0;p+=l*this.leftPad.length;for(let y=0;yy.forEach(x=>m[f++]=x);for(let y=0;y0){g(e[c+d-1]);for(let y=0;y0){let o=t[0];if(o!==0)throw new Error(`First split value must be 0, got ${o}`);for(let l=1;l=o;if(u=u&&t[l]<=a,!u)throw new Error(`Invalid split value ${t[l]}, must be in [${o}, ${a}]`);o=t[l]}if(o!==a)throw new Error(`Last split value must be data size. Expected ${a}, got ${o}`)}let r=n-1,s=v.getArrayFromDType("int32",n);if(a===0||n===0){let o=new Array(a);for(let l=0;l<=r;++l)s[l]=0;return[o,s]}s[0]=0;for(let o=1;o<=r;++o){let l=t[o]-t[o-1],u=0;this.nGramWidths.forEach(d=>{u+=this.getNumNGrams(l,d)}),this.preserveShort&&l>0&&u===0&&(u=1),s[o]=s[o-1]+u}let i=new Array(s[r]);for(let o=0;o{let c=t[o+1]-t[o],p=this.getNumNGrams(c,d);this.createNGrams(e,l,i,u,p,d),u+=p}),this.preserveShort&&u===s[o]){let d=t[o+1]-t[o];if(d===0)continue;let c=d+2*this.padWidth;this.createNGrams(e,l,i,u,1,c)}}return[i,s]}};function N3(e,t,a,n,r,s,i,o){return new GL(a,n,r,s,i,o).compute(e,t)}function HL(e,t,a,n){if(!e.length)return;if(t.length===0){for(let s=0;se-t),jL=v3((e,t,a,n)=>({real:e-a,imag:t-n})),M3=Kt(Fs,fv,jL),qL={kernelName:Fs,backendName:"cpu",kernelFunc:M3};function gv(e,t){let a=new Array(e.rank);for(let r=0;r{let a=t.value-e.value;return a===0?e.index-t.index:a};function yv(e,t,a=0,n=e.length-1){for(;n>a;){if(n-a>600){let o=n-a+1,l=t-a+1,u=Math.log(o),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(o-d)/o)*Math.sign(l-o/2),p=Math.max(a,Math.floor(t-l*d/o+c)),h=Math.min(n,Math.floor(t+(o-l)*d/o+c));yv(e,t,p,h)}let r=e[t],s=a,i=n;for(v.swap(e,a,t),Fd(e[n],r)>0&&v.swap(e,a,n);s0;)i=i-1}Fd(e[a],r)===0?v.swap(e,a,i):(i=i+1,v.swap(e,i,n)),i<=t&&(a=i+1),t<=i&&(n=i-1)}}function xv(e,t,a,n,r){let s=t[t.length-1],[i,o]=[e.length/s,s],l=v.getTypedArrayFromDType(a,i*n),u=v.getTypedArrayFromDType("int32",i*n);for(let c=0;cm[A]={value:x,index:A}),n{for(let g=0;gnew A3,1);var Av=ct(oo,e=>e>=0?e:Math.exp(e)-1),KL={kernelName:oo,backendName:"cpu",kernelFunc:Av};function bv(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{alpha:s}=n;Ie([r],"leakyRelu");let i=v.sizeFromShape(r.shape),o=a.data.get(r.dataId).values,l=v.getTypedArrayFromDType("float32",i);for(let u=0;ue<0?t*e:e);function vv(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t;Ie([n,r],"prelu");let s=a.data.get(n.dataId).values,i=a.data.get(r.dataId).values,[o,l]=ZL(n.shape,r.shape,s,i,"float32");return a.makeTensorInfo(l,"float32",o)}var JL={kernelName:_o,backendName:"cpu",kernelFunc:vv},wv=ct(Lo,e=>Math.max(0,e)),QL={kernelName:Lo,backendName:"cpu",kernelFunc:wv},kv=ct(Vo,e=>Math.min(Math.max(0,e),6)),eW={kernelName:Vo,backendName:"cpu",kernelFunc:kv};function Th(e,t,a,n,r){if(a==="linear")return sr({inputs:{x:t},backend:e});if(a==="relu")return wv({inputs:{x:t},backend:e});if(a==="elu")return Av({inputs:{x:t},backend:e});if(a==="relu6")return kv({inputs:{x:t},backend:e});if(a==="prelu")return vv({inputs:{x:t,alpha:n},backend:e});if(a==="leakyrelu")return bv({inputs:{x:t},backend:e,attrs:{alpha:r}});if(a==="sigmoid")return uv({inputs:{x:t},backend:e});throw new Error(`Activation ${a} has not been implemented for the CPU backend.`)}function bt(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{shape:s}=n,i=v.sizeFromShape(r.shape),o=v.inferFromImplicitShape(s,i),l=v.sizeFromShape(o);v.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.`),a.incRef(r.dataId);let u=a.data.get(r.dataId);if(u.complexTensorInfos!=null){let d=u.complexTensorInfos.real,c=u.complexTensorInfos.imag;d.shape=o,c.shape=o}return{dataId:r.dataId,shape:o,dtype:r.dtype}}var tW={kernelName:Du,backendName:"cpu",kernelFunc:bt};function Iv(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;Ie([r,s],"matMul");let l=r.shape.length,u=s.shape.length,d=i?r.shape[l-2]:r.shape[l-1],c=o?s.shape[u-1]:s.shape[u-2],p=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[u-2]:s.shape[u-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=v.sizeFromShape(m),y=v.sizeFromShape(f),x=ul.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)).concat([p,h]);v.assert(d===c,()=>`Error in matMul: inner shapes (${d}) and (${c}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let A=i?[g,d,p]:[g,p,d],b=o?[y,h,c]:[y,c,h],w=bt({inputs:{x:r},backend:a,attrs:{shape:A}}),S=bt({inputs:{x:s},backend:a,attrs:{shape:b}}),C=i?w.shape[1]:w.shape[2],N=i?w.shape[2]:w.shape[1],M=o?S.shape[1]:S.shape[2],F=Math.max(g,y),E=a.data.get(w.dataId).values,T=a.data.get(S.dataId).values,D=v.computeStrides(w.shape),O=v.computeStrides(S.shape),[W,$,U]=i?[D[0],1,D[1]]:[D[0],D[1],1],[G,q,H]=o?[1,O[1],O[0]]:[O[1],1,O[0]],V=N*M,Z=Te([F,N,M],w.dtype),X=Z.values,re=a.blockSize;for(let ee=0;eeMath.acos(e)),iW={kernelName:$i,backendName:"cpu",kernelFunc:sW},oW=ct(Di,e=>Math.acosh(e)),lW={kernelName:Di,backendName:"cpu",kernelFunc:oW};function uW(e){let{inputs:t,backend:a}=e,n=t;Ie(t,"addN");let r=n.map(o=>a.data.get(o.dataId).values),s=Te(n[0].shape,n[0].dtype),i=s.values;for(let o=0;ox&&(x=w,A=b)}h[g]=A}return u.forEach(g=>a.disposeIntermediateTensorInfo(g)),a.makeTensorInfo(d,"int32",h)}var gW={kernelName:hu,backendName:"cpu",kernelFunc:fW};function yW(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n;Ie(r,"argMin");let i=v.parseAxisParam(s,r.shape),o=I.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=Va({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=I.getInnerMostAxes(i.length,l.shape.length)),i=[i[0]],I.assertAxesAreInnerMostDims("argMin",i,l.shape.length);let[d,c]=I.computeOutAndReduceShapes(l.shape,i),p=v.sizeFromShape(d),h=v.makeZerosTypedArray(p,"int32"),m=v.sizeFromShape(c),f=a.data.get(l.dataId).values;for(let g=0;ga.disposeIntermediateTensorInfo(g)),a.makeTensorInfo(d,"int32",h)}var xW={kernelName:mu,backendName:"cpu",kernelFunc:yW},AW=ct(zi,e=>Math.asin(e)),bW={kernelName:zi,backendName:"cpu",kernelFunc:AW},vW=ct(Li,e=>Math.asinh(e)),wW={kernelName:Li,backendName:"cpu",kernelFunc:vW},kW=ct(Wi,e=>Math.atan(e)),IW={kernelName:Wi,backendName:"cpu",kernelFunc:kW},SW=Pt((e,t)=>Math.atan2(e,t)),TW=Kt(Vi,SW),CW={kernelName:Vi,backendName:"cpu",kernelFunc:TW},NW=ct(Bi,e=>Math.atanh(e)),RW={kernelName:Bi,backendName:"cpu",kernelFunc:NW};function $3(e,t,a,n,r,s){let i=r.strideHeight,o=r.strideWidth,l=r.dilationHeight,u=r.dilationWidth,d=r.effectiveFilterHeight,c=r.effectiveFilterWidth,p=r.padInfo.top,h=r.padInfo.left,m=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,f=Te(r.outShape,a),g=f.values,y=r.outShape[1]*r.outShape[2]*r.outShape[3],x=r.outShape[2]*r.outShape[3],A=r.outShape[3];for(let b=0;bU?U=ee:s==="avg"&&(G+=ee,q++)}if(isNaN(U))break}let H=T+D*A+C;g[H]=s==="avg"?G/q:U}}}return f}function Sv(e,t,a,n,r=!1,s=!1){let i=Te(n.outShape,"int32"),o=n.strideHeight,l=n.strideWidth,u=n.dilationHeight,d=n.dilationWidth,c=n.effectiveFilterHeight,p=n.effectiveFilterWidth,h=n.padInfo.top,m=n.padInfo.left,f=Te(t,a,e);for(let g=0;gF&&(F=$,r?E=s?((g*n.inHeight+T)*n.inWidth+O)*n.inChannels+y:(T*n.inWidth+O)*n.inChannels+y:E=D*p+W)}}i.set(E,g,x,S,y)}}return i}function Tv(e,t,a,n,r,s){let i=r.strideDepth,o=r.strideHeight,l=r.strideWidth,u=r.dilationDepth,d=r.dilationHeight,c=r.dilationWidth,p=r.effectiveFilterDepth,h=r.effectiveFilterHeight,m=r.effectiveFilterWidth,f=r.padInfo.front,g=r.padInfo.top,y=r.padInfo.left,x=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,A=Te(r.outShape,a),b=A.values,w=r.outShape[1]*r.outShape[2]*r.outShape[3]*r.outShape[4],S=r.outShape[2]*r.outShape[3]*r.outShape[4],C=r.outShape[3]*r.outShape[4],N=r.outShape[4];for(let M=0;Mbe?be=xt:s==="avg"&&(Ce+=xt,Ee++),isNaN(be))break}if(isNaN(be))break}if(isNaN(be))break}let Le=ie+T;b[Le]=s==="avg"?Ce/Math.max(Ee,1):be}}}}return A}function EW(e,t){let a=Te(t.outShape,"int32"),n=t.strideDepth,r=t.strideHeight,s=t.strideWidth,i=t.dilationDepth,o=t.dilationHeight,l=t.dilationWidth,u=t.effectiveFilterDepth,d=t.effectiveFilterHeight,c=t.effectiveFilterWidth,p=t.padInfo.front,h=t.padInfo.top,m=t.padInfo.left;for(let f=0;f=D&&(D=V,O=$*d*c+G*d+H)}}}a.set(O,f,y,w,M,g)}}}return a}function MW(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t;Ie(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=1;v.assert(I.eitherStridesOrDilationsAreOne(i,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=I.computePool2DInfo(r.shape,s,i,u,o,l),c;if(d.filterWidth===1&&d.filterHeight===1&&v.arraysEqual(d.inShape,d.outShape))c=sr({inputs:{x:r},backend:a});else{let p=a.data.get(r.dataId).values,h=v.computeStrides(r.shape),m=$3(p,r.shape,r.dtype,h,d,"avg");c=a.makeTensorInfo(d.outShape,r.dtype,m.values)}return c}var FW={kernelName:Ui,backendName:"cpu",kernelFunc:MW};function $W(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n;Ie(r,"avgPool3d");let d=I.computePool3DInfo(r.shape,s,i,1,o,l,u),c=a.data.get(r.dataId).values,p=Tv(c,r.shape,r.dtype,v.computeStrides(r.shape),d,"avg");return a.makeTensorInfo(p.shape,"float32",p.values)}var DW={kernelName:fu,backendName:"cpu",kernelFunc:$W};function PW(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n;Ie([r,s],"avgPool3DGrad");let d=I.computePool3DInfo(s.shape,i,o,1,l,u),c=d.strideDepth,p=d.strideHeight,h=d.strideWidth,m=d.filterDepth,f=d.filterHeight,g=d.filterWidth,y=d.dilationDepth,x=d.dilationHeight,A=d.dilationWidth,b=d.effectiveFilterDepth,w=d.effectiveFilterHeight,S=d.effectiveFilterWidth,C=b-1-d.padInfo.front,N=S-1-d.padInfo.left,M=w-1-d.padInfo.top,F=Te(s.shape,"float32"),E=1/(m*f*g),T=a.bufferSync(r);for(let D=0;D=d.outDepth||Math.floor(X)!==X))for(let re=0;re=d.outHeight||Math.floor(ee)!==ee))for(let ge=0;ge=d.outWidth||Math.floor(ie)!==ie)continue;let be=T.get(D,X,ee,ie,O);V+=be}}}F.set(V*E,D,W,$,U,O)}return a.makeTensorInfo(F.shape,F.dtype,F.values)}var _W={kernelName:yp,backendName:"cpu",kernelFunc:PW};function OW(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s;Ie([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=n,d=I.computePool2DInfo(i.shape,o,l,1,u),c=d.strideHeight,p=d.strideWidth,h=d.filterHeight,m=d.filterWidth,f=d.dilationHeight,g=d.dilationWidth,y=d.effectiveFilterHeight,x=d.effectiveFilterWidth,A=x-1-d.padInfo.left,b=y-1-d.padInfo.top,w=Te(i.shape,"float32"),S=1/(h*m),C=a.data.get(r.dataId).values,N=Te(r.shape,"float32",C);for(let M=0;M=d.outHeight||Math.floor(U)!==U))for(let G=0;G=d.outWidth||Math.floor(q)!==q)continue;let H=N.get(M,U,q,F);W+=H}}w.set(W*S,M,E,T,F)}return a.makeTensorInfo(w.shape,w.dtype,w.values)}var zW={kernelName:gp,backendName:"cpu",kernelFunc:OW};function LW(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,scale:s,offset:i,mean:o,variance:l}=t;v.assert(o.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),v.assert(i==null||o.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),v.assert(s==null||o.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),Ie([r,o,l,s,i],"batchNorm");let{varianceEpsilon:u}=n;u==null&&(u=.001);let d=a.data.get(r.dataId).values,c=a.data.get(o.dataId).values,p=a.data.get(l.dataId).values,h=s?a.data.get(s.dataId).values:new Float32Array([1]),m=i?a.data.get(i.dataId).values:new Float32Array([0]),f=new Float32Array(d.length),g=m.length,y=h.length,x=p.length,A=c.length,b=0,w=0,S=0,C=0;for(let N=0;N=g&&(b=0),w>=A&&(w=0),S>=y&&(S=0),C>=x&&(C=0);return a.makeTensorInfo(r.shape,r.dtype,f)}var WW={kernelName:po,backendName:"cpu",kernelFunc:LW};function BW(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,crops:i}=n;Ie([r],"batchToSpaceND");let o=s.reduce((y,x)=>y*x),l=I.getReshaped(r.shape,s,o),u=I.getPermuted(l.length,s.length),d=I.getReshapedPermuted(r.shape,s,o),c=I.getSliceBeginCoords(i,s.length),p=I.getSliceSize(d,i,s.length),h=bt({inputs:{x:r},backend:a,attrs:{shape:l}}),m=Va({inputs:{x:h},backend:a,attrs:{perm:u}}),f=bt({inputs:{x:m},backend:a,attrs:{shape:d}}),g=Ci({inputs:{x:f},backend:a,attrs:{begin:c,size:p}});return a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(f),g}var VW={kernelName:gu,backendName:"cpu",kernelFunc:BW};function UW(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i}=n,o=a.data.get(r.dataId).values,l=a.data.get(s.dataId).values,u=w3(o,l,s.dtype,s.shape,i);return a.makeTensorInfo([i],s.dtype,u)}var GW={kernelName:Hi,backendName:"cpu",kernelFunc:UW};function HW(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t,s=a.data.get(n.dataId).values,i=a.data.get(r.dataId).values,o=I.assertAndGetBroadcastShape(Array.from(s),Array.from(i));return a.makeTensorInfo([o.length],"int32",Int32Array.from(o))}var jW={kernelName:yu,backendName:"cpu",kernelFunc:HW},qW=ct(hs,(e,t)=>{let a=t;return e>a.clipValueMax?a.clipValueMax:e{let{x:t}=e.inputs,a=e.backend,n=new Float32Array(v.sizeFromShape(t.shape)),r=a.data.get(t.dataId),s=r.complexTensorInfos.real,i=r.complexTensorInfos.imag,o=a.data.get(s.dataId).values,l=a.data.get(i.dataId).values;for(let u=0;uf.shape);I.assertParamsConsistent(i,s);let o=I.computeOutShape(t.map(f=>f.shape),s);if(v.sizeFromShape(o)===0)return a.makeTensorInfo(o,t[0].dtype,[]);let l=t.filter(f=>v.sizeFromShape(f.shape)>0);if(l.length===1)return sr({inputs:{x:l[0]},backend:a});if(l[0].dtype==="complex64"){let f=l.map(b=>Ti({inputs:{input:b},backend:a})),g=l.map(b=>iu({inputs:{input:b},backend:a})),y=ou({inputs:f,backend:a,attrs:{axis:s}}),x=ou({inputs:g,backend:a,attrs:{axis:s}}),A=Qa({inputs:{real:y,imag:x},backend:a});return f.forEach(b=>a.disposeIntermediateTensorInfo(b)),g.forEach(b=>a.disposeIntermediateTensorInfo(b)),a.disposeIntermediateTensorInfo(y),a.disposeIntermediateTensorInfo(x),A}let u=l.map(f=>{let g=[-1,v.sizeFromShape(f.shape.slice(s))];return bt({inputs:{x:f},backend:a,attrs:{shape:g}})}),d=u.map(f=>({vals:a.data.get(f.dataId).values,shape:f.shape}));o=I.computeOutShape(u.map(f=>f.shape),1);let c=u[0].shape[0]===1,p=k3(d,o,t[0].dtype,c),h=I.computeOutShape(l.map(f=>f.shape),s),m=a.makeTensorInfo(h,t[0].dtype,p);return u.forEach(f=>a.disposeIntermediateTensorInfo(f)),m}var JW={kernelName:xu,backendName:"cpu",kernelFunc:ou};function Cv(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:d}=n;Ie([r,s],"conv2d");let c=I.convertConv2DDataFormat(l),p=I.computeConv2DInfo(r.shape,s.shape,i,u,o,d,!1,c),h=p.filterHeight,m=p.filterWidth,f=p.dilationHeight,g=p.dilationWidth,y=p.padInfo.left,x=p.padInfo.top,A=p.dataFormat==="channelsLast",b=new Rt(p.outShape,r.dtype),w=v.computeStrides(r.shape),S=v.computeStrides(s.shape),C=w[0],N=A?w[1]:w[2],M=A?w[2]:1,F=A?1:w[1],E=b.strides[0],T=A?b.strides[1]:b.strides[2],D=A?b.strides[2]:1,O=A?1:b.strides[1],W=a.data.get(r.dataId).values,$=a.data.get(s.dataId).values,U=b.values;for(let G=0;G=p.inHeight)continue;let ge=re*S[0],ie=q+ee*N;for(let be=0;be=p.inWidth)continue;let gt=ge+Le*S[1],dt=ie+qe*M,st=gt;for(let it=0;it=u.inDepth)continue;let G=$*M[0],q=E+U*N[1];for(let H=0;H=u.inHeight)continue;let ee=G+X*M[1],ge=q+re*N[2];for(let ie=0;ie=u.inWidth)continue;let qe=ee+Ee*M[2],gt=ge+Le*u.inChannels,dt=qe;for(let st=0;stMath.cos(e)),pB={kernelName:Ji,backendName:"cpu",kernelFunc:dB},cB=ct(Qi,e=>Math.cosh(e)),hB={kernelName:Qi,backendName:"cpu",kernelFunc:cB};function mB(e){let{inputs:t,backend:a,attrs:n}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=n,[d,c,p,h]=r.shape,m=s.shape[0],[f,g]=o,y=Te([m,f,g,h],"float32"),x=a.data.get(s.dataId).values,A=a.data.get(i.dataId).values,b=a.data.get(r.dataId).values,w=v.computeStrides(r.shape),S=v.computeStrides(y.shape);for(let C=0;C=d)continue;let O=f>1?(E-M)*(c-1)/(f-1):0,W=g>1?(T-F)*(p-1)/(g-1):0;for(let $=0;$1?M*(c-1)+$*O:.5*(M+E)*(c-1);if(U<0||U>c-1){for(let G=0;G1?F*(p-1)+V*W:.5*(F+T)*(p-1);if(Z<0||Z>p-1){for(let ge=0;ge1?F*(p-1)+G*W:.5*(F+T)*(p-1);if(q<0||q>p-1){for(let Z=0;Zy+m-x-1:(y,x)=>y+x;for(let y=0;yy+m-x-1:(y,x)=>y+x;for(let y=0;y`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`);let o=r.shape[0],l=r.shape[1],u=r.shape[2],d=r.shape[3],c=l*s,p=u*s,h=d/(s*s),m=a.data.get(r.dataId).values,f=new Float32Array(o*c*p*h),g=0;for(let y=0;y`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${p}'`);let h=I.computeConv2DInfo(r.shape,s.shape,i,p,o,u,!0),{filterHeight:m,filterWidth:f,dilationHeight:g,dilationWidth:y,padInfo:x}=h,A=x.left,b=x.top,w=h.outChannels/h.inChannels,S=new Rt(h.outShape,r.dtype),C=a.data.get(r.dataId).values,N=a.data.get(s.dataId).values,M=S.values;for(let F=0;F=h.inHeight)continue;let G=$*c[0],q=E+U*d[1];for(let H=0;H=h.inWidth)continue;let ee=G+X*c[1],ge=q+re*h.inChannels,ie=V,be=ee;for(let Ce=0;Ce{let{x:n,filter:r}=e,{strides:s,pad:i,dilations:o}=a,l=t,u=l.data.get(n.dataId).values,d=n.shape.length,c=l.data.get(r.dataId).values,p=r.shape.length,{batchSize:h,inHeight:m,inWidth:f,inChannels:g,outHeight:y,outWidth:x,padInfo:A,strideHeight:b,strideWidth:w,filterHeight:S,filterWidth:C,dilationHeight:N,dilationWidth:M,outShape:F}=I.computeDilation2DInfo(n.shape,r.shape,s,i,"NHWC",o),E=v.sizeFromShape(F),T=F.length,D=v.getArrayFromDType(n.dtype,E);for(let O=0;O=0&&X=0&&eeH&&(H=be)}}}let V=v.locToIndex([O,W,U,q],T,v.computeStrides(F));D[V]=H}}}return{dataId:l.write(v.toTypedArray(D,n.dtype),F,n.dtype),shape:F,dtype:n.dtype}}},FB={kernelName:Ql,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:a})=>{let{x:n,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=a,u=t,d=v.toNestedArray(n.shape,u.data.get(n.dataId).values),c=v.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:p,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:x,strideHeight:A,strideWidth:b,filterHeight:w,filterWidth:S,dilationHeight:C,dilationWidth:N,outShape:M}=I.computeDilation2DInfo(n.shape,r.shape,i,o,"NHWC",l);v.assert(s.rank===M.length,()=>`Error in ${Ql}, dy must have the same rank as output ${M.length}, but got ${s.rank}`);let F=v.toNestedArray(M,u.data.get(s.dataId).values),E=v.makeZerosNestedTypedArray(r.shape,r.dtype);for(let T=0;T=0&&Z=0&&reG&&(G=ee,q=V,H=X)}}}E[q][H][U]+=F[T][D][W][U]}}}return{dataId:u.write(v.toTypedArray(E,n.dtype),r.shape,r.dtype),shape:r.shape,dtype:r.dtype}}},$B={kernelName:Jl,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:a})=>{let{x:n,filter:r,dy:s}=e,{strides:i,pad:o,dilations:l}=a,u=t,d=v.toNestedArray(n.shape,u.data.get(n.dataId).values),c=v.toNestedArray(r.shape,u.data.get(r.dataId).values),{batchSize:p,inHeight:h,inWidth:m,inChannels:f,outHeight:g,outWidth:y,padInfo:x,strideHeight:A,strideWidth:b,filterHeight:w,filterWidth:S,dilationHeight:C,dilationWidth:N,outShape:M}=I.computeDilation2DInfo(n.shape,r.shape,i,o,"NHWC",l);v.assert(s.rank===M.length,()=>`Error in ${Jl}, dy must have the same rank as output ${M.length}, but got ${s.rank}`);let F=v.toNestedArray(M,u.data.get(s.dataId).values),E=v.makeZerosNestedTypedArray(n.shape,n.dtype);for(let T=0;T=0&&Z=0&&reG&&(G=ee,q=Z,H=re)}}}E[T][q][H][U]+=F[T][D][W][U]}}}return{dataId:u.write(v.toTypedArray(E,n.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}};function DB(e){let{inputs:t,backend:a,attrs:n}=e,{image:r}=t,{canvas:s,options:i}=n,{contextOptions:o,imageOptions:l}=i||{},u=(l==null?void 0:l.alpha)||1,d=(o==null?void 0:o.contextType)||"2d";if(d!=="2d")throw new Error(`Context type ${o.contextType} is not supported by the CPU backend.`);let c=s.getContext(d,(o==null?void 0:o.contextAttributes)||{});if(c==null)throw new Error(`Could not get the context with ${d} type.`);let[p,h]=r.shape.slice(0,2),m=r.shape.length===2?1:r.shape[2],f=a.data.get(r.dataId).values,g=r.dtype==="float32"?255:1,y=new Uint8ClampedArray(h*p*4);for(let A=0;A1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${C}.`)}else if(r.dtype==="int32"&&(C<0||C>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${C}.`);m===1?(b[0]=C*g,b[1]=C*g,b[2]=C*g):b[S]=C*g}let w=A*4;y[w+0]=Math.round(b[0]),y[w+1]=Math.round(b[1]),y[w+2]=Math.round(b[2]),y[w+3]=Math.round(b[3])}s.width=h,s.height=p;let x=new ImageData(y,h,p);return c.putImageData(x,0,0),r}var PB={kernelName:kp,backendName:"cpu",kernelFunc:DB};function tc(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;Ie(r,"sum");let o;r.dtype==="bool"?o=ds({inputs:{x:r},backend:a,attrs:{dtype:"int32"}}):o=sr({inputs:{x:r},backend:a});let l=o.shape.length,u=v.parseAxisParam(s,o.shape),d=I.getAxesPermutation(u,l),c=u,p=o;d!=null&&(p=Va({inputs:{x:o},backend:a,attrs:{perm:d}}),c=I.getInnerMostAxes(c.length,l)),I.assertAxesAreInnerMostDims("sum",c,p.shape.length);let[h,m]=I.computeOutAndReduceShapes(p.shape,c),f=I.upcastType(p.dtype,"int32"),g=Ih(a,h,f),y=v.sizeFromShape(m),x=a.data.get(g.dataId).values,A=a.data.get(p.dataId).values;for(let b=0;b=0&&(p=tc({inputs:{x:p},backend:a,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(p)),h--)}for(let f of m)f!==p&&a.disposeIntermediateTensorInfo(f);return p}var zB={kernelName:Ip,backendName:"cpu",kernelFunc:OB};function LB(e){let{inputs:t,backend:a}=e,{dy:n,y:r}=t;Ie([n,r],"eluGrad");let s=new Float32Array(v.sizeFromShape(r.shape)),i=a.data.get(r.dataId).values,o=a.data.get(n.dataId).values;for(let l=0;l=0?s[l]=o[l]:s[l]=o[l]*(u+1)}return a.makeTensorInfo(r.shape,"float32",s)}var WB={kernelName:wu,backendName:"cpu",kernelFunc:LB},BB=I.ERF_P,VB=I.ERF_A1,UB=I.ERF_A2,GB=I.ERF_A3,HB=I.ERF_A4,jB=I.ERF_A5,qB=ct(lo,e=>{let t=Math.sign(e),a=Math.abs(e),n=1/(1+BB*a);return t*(1-((((jB*n+HB)*n+GB)*n+UB)*n+VB)*n*Math.exp(-a*a))}),XB={kernelName:lo,backendName:"cpu",kernelFunc:qB};function Ch(e){let{inputs:t,backend:a,attrs:n}=e,{input:r}=t,{dim:s}=n,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(v.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),bt({inputs:{x:r},backend:a,attrs:{shape:o}})}var KB={kernelName:ku,backendName:"cpu",kernelFunc:Ch},YB=Pt((e,t)=>e/t),D3=Kt(io,YB),L1={kernelName:io,backendName:"cpu",kernelFunc:D3};function Rv(e,t,a){let n=e.shape,r=n[0],s=n[1],i=a.data.get(e.dataId),o=i.complexTensorInfos.real,l=i.complexTensorInfos.imag,u=[r,s],d=v.sizeFromShape(u),c=v.getTypedArrayFromDType("float32",d),p=v.getTypedArrayFromDType("float32",d);for(let g=0;g{let{image:n}=e,r=a,s=v.getTypedArrayFromDType(n.dtype,v.sizeFromShape(n.shape)),[i,o,l,u]=n.shape,d=r.data.get(n.dataId).values;for(let c=0;c=0&&x=0,()=>`GatherV2: the index value ${w} is not in [0, ${d-1}]`)}let c=o;o==null&&(c=0);let p=v.sizeFromShape(s.shape),h=I.segment_util.collectGatherOpShapeInfo(r,s,l,c),m=bt({inputs:{x:r},backend:a,attrs:{shape:[h.batchSize,h.outerSize,h.dimSize,h.sliceSize]}}),f=bt({inputs:{x:s},backend:a,attrs:{shape:[h.batchSize,p/h.batchSize]}}),g=[h.batchSize,h.outerSize,p/h.batchSize,h.sliceSize],y=a.bufferSync(f),x=a.bufferSync(m),A=j6(x,y,g);return a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(f),a.makeTensorInfo(h.outputShape,A.dtype,A.values)}var cV={kernelName:Su,backendName:"cpu",kernelFunc:pV};function hV(e){let{inputs:t,backend:a}=e,{input:n}=t,r=v.sizeFromShape(n.shape),s=n.shape[n.shape.length-1],i=r/s,o=bt({inputs:{x:n},backend:a,attrs:{shape:[i,s]}}),l=Rv(o,!0,a),u=bt({inputs:{x:l},backend:a,attrs:{shape:n.shape}});return a.disposeIntermediateTensorInfo(o),a.disposeIntermediateTensorInfo(l),u}var mV={kernelName:Tp,backendName:"cpu",kernelFunc:hV},fV=ct(mo,e=>Number.isFinite(e)?1:0,"bool"),gV={kernelName:mo,backendName:"cpu",kernelFunc:fV},yV=ct(fo,e=>Math.abs(e)===1/0?1:0,"bool"),xV={kernelName:fo,backendName:"cpu",kernelFunc:yV},AV=ct(go,e=>Number.isNaN(e)?1:0,"bool"),bV={kernelName:go,backendName:"cpu",kernelFunc:AV};function vV(e){let{backend:t,attrs:a}=e,{start:n,stop:r,num:s}=a,i=Z6(n,r,s);return t.makeTensorInfo([i.length],"float32",i)}var wV={kernelName:xo,backendName:"cpu",kernelFunc:vV},kV=ct(Ao,e=>Math.log1p(e)),IV={kernelName:Ao,backendName:"cpu",kernelFunc:kV},SV=Pt((e,t)=>e&&t),TV=Kt(bo,SV,null,"bool"),CV={kernelName:bo,backendName:"cpu",kernelFunc:TV},NV=ct(vo,e=>e?0:1,"bool"),RV={kernelName:vo,backendName:"cpu",kernelFunc:NV},EV=Pt((e,t)=>e||t),MV=Kt(wo,EV,null,"bool"),FV={kernelName:wo,backendName:"cpu",kernelFunc:MV};function $V(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;Ie(r,"LRN");let u=r.shape[3],d=u-1,c=a.data.get(r.dataId).values,p=v.sizeFromShape(r.shape),h=new Float32Array(p);function m(f){let g=f%u,y=f-g+Math.max(0,g-s),x=f-g+Math.min(g+s,d),A=0;for(;y<=x;y++){let b=c[y];A+=b*b}return A}for(let f=0;f`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=I.computePool2DInfo(r.shape,s,i,u,o,l),c;if(d.filterWidth===1&&d.filterHeight===1&&v.arraysEqual(d.inShape,d.outShape))c=sr({inputs:{x:r},backend:a});else{let p=a.data.get(r.dataId).values,h=v.computeStrides(r.shape),m=$3(p,r.shape,r.dtype,h,d,"max");c=a.makeTensorInfo(d.outShape,r.dtype,m.values)}return c}var LV={kernelName:So,backendName:"cpu",kernelFunc:zV};function WV(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n;Ie(r,"maxPool3d");let d=I.computePool3DInfo(r.shape,s,i,1,o,l,u),c=a.data.get(r.dataId).values,p=Tv(c,r.shape,r.dtype,v.computeStrides(r.shape),d,"max");return a.makeTensorInfo(p.shape,"float32",p.values)}var BV={kernelName:Cu,backendName:"cpu",kernelFunc:WV};function VV(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n;Ie([r,s],"maxPool3DGrad");let d=I.computePool3DInfo(s.shape,i,o,1,l,u),c=a.bufferSync(s),p=EW(c,d),h=d.strideDepth,m=d.strideHeight,f=d.strideWidth,g=d.dilationDepth,y=d.dilationHeight,x=d.dilationWidth,A=d.effectiveFilterDepth,b=d.effectiveFilterHeight,w=d.effectiveFilterWidth,S=A-1-d.padInfo.front,C=w-1-d.padInfo.left,N=b-1-d.padInfo.top,M=Te(s.shape,"float32"),F=a.bufferSync(r);for(let E=0;E=d.outDepth||Math.floor(V)!==V))for(let Z=0;Z=d.outHeight||Math.floor(X)!==X))for(let re=0;re=d.outWidth||Math.floor(ee)!==ee)continue;let ge=A*b*w-1-p.get(E,V,X,ee,T),ie=H*b*w+Z*w+re,be=ge===ie?1:0;if(be===0)continue;let Ce=F.get(E,V,X,ee,T);q+=Ce*be}}}M.set(q,E,D,O,W,T)}return a.makeTensorInfo(M.shape,M.dtype,M.values)}var UV={kernelName:Rp,backendName:"cpu",kernelFunc:VV};function GV(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s,output:i}=t,o=s;Ie([s,i],"maxPoolGrad");let{filterSize:l,strides:u,pad:d,dimRoundingMode:c}=n,p=I.computePool2DInfo(o.shape,l,u,1,d,c),h=a.data.get(o.dataId).values,m=Te(p.outShape,o.dtype,Sv(h,o.shape,o.dtype,p).values),f=p.strideHeight,g=p.strideWidth,y=p.dilationHeight,x=p.dilationWidth,A=p.effectiveFilterHeight,b=p.effectiveFilterWidth,w=b-1-p.padInfo.left,S=A-1-p.padInfo.top,C=Te(o.shape,"float32"),N=a.data.get(r.dataId).values,M=Te(r.shape,"float32",N);for(let F=0;F=p.outHeight||Math.floor(G)!==G))for(let q=0;q=p.outWidth||Math.floor(H)!==H)continue;let V=A*b-1-m.get(F,G,H,E),Z=U*b+q,X=V===Z?1:0;if(X===0)continue;let re=M.get(F,G,H,E);$+=re*X}}C.set($,F,T,D,E)}return a.makeTensorInfo(C.shape,C.dtype,C.values)}var HV={kernelName:Np,backendName:"cpu",kernelFunc:GV};function jV(e,t,a,n,r){let s=v.computeStrides(t),i=$3(e,t,a,s,r,"max"),o=Sv(e,t,a,r,!0,n);return[i.values,o.values]}var qV={kernelName:Nu,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=a;Ie(n,"MaxPoolWithArgmax");let u=l.data.get(n.dataId).values,d=I.computePool2DInfo(n.shape,r,s,[1,1],i),[c,p]=jV(u,n.shape,n.dtype,o,d),h=l.write(c,d.outShape,n.dtype),m=l.write(p,d.outShape,n.dtype);return[{dataId:h,shape:d.outShape,dtype:n.dtype},{dataId:m,shape:d.outShape,dtype:"int32"}]}};function XV(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=v.parseAxisParam(s,r.shape),l=I.computeOutAndReduceShapes(r.shape,o)[1],u=v.sizeFromShape(l),d=[],c=a.makeTensorInfo([],"float32",new Float32Array([u]));d.push(c);let p=ds({inputs:{x:r},backend:a,attrs:{dtype:"float32"}});d.push(p);let h=D3({inputs:{a:p,b:c},backend:a});d.push(h);let m=tc({inputs:{x:h},backend:a,attrs:{axis:s,keepDims:i}});return d.forEach(f=>a.disposeIntermediateTensorInfo(f)),m}var KV={kernelName:To,backendName:"cpu",kernelFunc:XV};function YV(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;Ie(r,"min");let o=v.parseAxisParam(s,r.shape),l=o,u=I.getAxesPermutation(l,r.shape.length),d=r;u!=null&&(d=Va({inputs:{x:r},backend:a,attrs:{perm:u}}),l=I.getInnerMostAxes(l.length,r.shape.length)),I.assertAxesAreInnerMostDims("min",l,d.shape.length);let[c,p]=I.computeOutAndReduceShapes(d.shape,l),h=v.sizeFromShape(p),m=v.makeZerosTypedArray(v.sizeFromShape(c),d.dtype),f=a.data.get(d.dataId).values;for(let y=0;yx[0]+r.shape[A]+x[1]),l=s.map(x=>x[0]),u=s.map((x,A)=>x[0]+r.shape[A]),d=i==="reflect"?0:1,c=a.data.get(r.dataId).values,p=r.shape.length,h=v.computeStrides(r.shape),m=v.sizeFromShape(o),f=o.length,g=v.computeStrides(o),y=v.getTypedArrayFromDType(r.dtype,m);for(let x=0;x=u[w]&&(A[w]=(u[w]-1)*2-A[w]+d);A=A.map((w,S)=>w-l[S]);let b=v.locToIndex(A,p,h);y[x]=c[b]}return{dataId:a.write(y,o,r.dtype),shape:o,dtype:r.dtype}}var QV={kernelName:No,backendName:"cpu",kernelFunc:JV},eU=Pt((e,t)=>{let a=e%t;return e<0&&t<0||e>=0&&t>=0?a:(a+t)%t}),tU=Kt(Ro,eU),aU={kernelName:Ro,backendName:"cpu",kernelFunc:tU},nU=uu(EA());function Mv(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{dim:s}=n,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=v.parseAxisParam([o],r.shape),u=Ev({inputs:{x:r},backend:a,attrs:{reductionIndices:l,keepDims:!1}}),d=I.expandShapeToKeepDim(u.shape,l),c=bt({inputs:{x:u},backend:a,attrs:{shape:d}}),p=M3({inputs:{a:r,b:c},backend:a}),h=B6({inputs:{x:p},backend:a}),m=tc({inputs:{x:h},backend:a,attrs:{axis:l,keepDims:!1}}),f=bt({inputs:{x:m},backend:a,attrs:{shape:d}}),g=D3({inputs:{a:h,b:f},backend:a});return a.disposeIntermediateTensorInfo(u),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(f),g}var rU={kernelName:el,backendName:"cpu",kernelFunc:Mv};function sU(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n;Ie(r,"multinomial");let l=o?r:Mv({inputs:{logits:r},backend:a,attrs:{dim:-1}}),u=l.shape[0],d=l.shape[1],c=a.data.get(l.dataId).values,p=[u,s],h=v.makeZerosTypedArray(v.sizeFromShape(p),"int32");for(let m=0;m=0&&c[p]{v.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(d=>{let c=Ch({inputs:{input:d},backend:a,attrs:{dim:r}});return o.push(c),c}),u=ou({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(d=>a.disposeIntermediateTensorInfo(d)),u}var bU={kernelName:Fu,backendName:"cpu",kernelFunc:$v};function vU(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{paddings:s,constantValue:i}=n;Ie(r,"pad");let o=s.map((y,x)=>y[0]+r.shape[x]+y[1]),l=s.map(y=>y[0]),u=a.data.get(r.dataId).values,d=v.sizeFromShape(r.shape),c=r.shape.length,p=v.computeStrides(r.shape),h=v.sizeFromShape(o),m=o.length,f=v.computeStrides(o),g=v.getTypedArrayFromDType(r.dtype,h);i!==0&&g.fill(i);for(let y=0;yb+l[w]),A=v.locToIndex(x,m,f);g[A]=u[y]}return{dataId:a.write(g,o,r.dtype),shape:o,dtype:r.dtype}}var Dv={kernelName:Do,backendName:"cpu",kernelFunc:vU},wU=Pt((e,t)=>Math.pow(e,t)),kU=Kt(Po,wU),IU={kernelName:Po,backendName:"cpu",kernelFunc:kU};function SU(e){let{inputs:t,backend:a,attrs:n}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:i}=t,{outputRaggedRank:o}=n,l=r.map(y=>a.data.get(y.dataId).values),u=r.map(y=>y.shape),d=a.data.get(s.dataId).values,c=a.data.get(i.dataId).values,[p,h,m]=sv(l,u,d,s.shape,s.dtype,c,i.shape,o),f=p.map(y=>a.makeTensorInfo([y.length],"int32",y)),g=a.makeTensorInfo(m,s.dtype,h);return f.concat([g])}var TU={kernelName:Lh,backendName:"cpu",kernelFunc:SU};function CU(e){let{inputs:t,backend:a}=e,{starts:n,limits:r,deltas:s}=t,i=a.data.get(n.dataId).values,o=a.data.get(r.dataId).values,l=a.data.get(s.dataId).values,[u,d]=iv(i,n.shape,n.dtype,o,r.shape,l,s.shape),c=a.makeTensorInfo([u.length],"int32",u),p=a.makeTensorInfo([d.length],n.dtype,d);return[c,p]}var NU={kernelName:Wh,backendName:"cpu",kernelFunc:CU};function RU(e){let{inputs:t,backend:a,attrs:n}=e,{shape:r,values:s,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=n,u=a.data.get(r.dataId).values,d=a.data.get(s.dataId).values,c=a.data.get(i.dataId).values,p=o.map(g=>a.data.get(g.dataId).values),h=o.map(g=>g.shape),[m,f]=ov(u,r.shape,d,s.shape,s.dtype,c,i.shape,p,h,l);return a.makeTensorInfo(m,s.dtype,f)}var EU={kernelName:Bh,backendName:"cpu",kernelFunc:RU};function MU(e){let{backend:t,attrs:a}=e,{start:n,stop:r,dtype:s,step:i}=a,o=T3(n,r,i,s);return t.makeTensorInfo([o.length],s,o)}var FU={kernelName:$u,backendName:"cpu",kernelFunc:MU},$U=ct(zo,e=>1/e),DU={kernelName:zo,backendName:"cpu",kernelFunc:$U};function PU(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n;Ie(r,"resizeBilinear");let l=v.computeStrides(r.shape),[u,d]=o,[c,p,h,m]=r.shape,f=a.data.get(r.dataId).values,g=new Float32Array(v.sizeFromShape([c,u,d,m])),y=[s&&u>1?p-1:p,s&&d>1?h-1:h],x=[s&&u>1?u-1:u,s&&d>1?d-1:d],A=0,b=y[0]/x[0],w=y[1]/x[1];for(let S=0;S1?u-1:u,i&&h>1?d-1:d],g=[i&&p>1?p-1:p,i&&h>1?h-1:h],y=f[0]/g[0],x=f[1]/g[1],A=a.data.get(s.dataId).values,b=0;for(let w=0;w1?p-1:p,s&&d>1?h-1:h],x=[s&&u>1?u-1:u,s&&d>1?d-1:d],A=y[0]/x[0],b=y[1]/x[1],w=0;for(let S=0;S1?d-1:d,i&&m>1?c-1:c],x=[i&&h>1?h-1:h,i&&m>1?m-1:m],A=y[0]/x[0],b=y[1]/x[1],w=1/A,S=1/b,C=Math.ceil(w)*2+2,N=Math.ceil(S)*2+2;for(let M=0;M=h)continue;let X=F+Z*l[1],re=Z*A,ee=Math.min(d-1,i?Math.round(re):Math.floor(re));if(E===ee)for(let ge=0;ge=m)continue;let be=X+ie*l[2],Ce=ie*b,Ee=Math.min(c-1,i?Math.round(Ce):Math.floor(Ce));W===Ee&&(H+=g[be+q])}}f[$+q]=H}}}}return a.makeTensorInfo(r.shape,r.dtype,f)}var VU={kernelName:Pu,backendName:"cpu",kernelFunc:BU};function UU(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n;Ie(r,"reverse");let i=r.shape.length,o=v.parseAxisParam(s,r.shape);if(i===0)return sr({inputs:{x:r},backend:a});let l=new Rt(r.shape,r.dtype),u=a.bufferSync(r);for(let d=0;dp[h]=r.shape[h]-1-p[h]),l.set(u.get(...p),...c)}return a.makeTensorInfo(l.shape,l.dtype,l.values)}var GU={kernelName:Uo,backendName:"cpu",kernelFunc:UU},HU={kernelName:ol,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{image:n}=e,{radians:r,fillValue:s,center:i}=t,o=a,l=v.getTypedArrayFromDType(n.dtype,v.sizeFromShape(n.shape)),[u,d,c,p]=n.shape,[h,m]=I.getImageCenter(i,d,c),f=255,g=Math.sin(r),y=Math.cos(r),x=o.data.get(n.dataId).values;for(let A=0;A=0&&D=0&&O{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2===0?t:t+1}),qU={kernelName:Go,backendName:"cpu",kernelFunc:jU};function XU(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r,updates:s}=t,{shape:i}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:d,outputSize:c}=I.calculateShapes(s,r,i),p=!0,h=a.bufferSync(r),m=a.bufferSync(s),f=xi(h,m,i,c,u,l,o,d,0,p);return a.makeTensorInfo(i,f.dtype,f.values)}var KU={kernelName:Ho,backendName:"cpu",kernelFunc:XU};function YU(e,t){let a=0,n=e.length,r=0;for(;a1||r.shape.length===1?1:v.sizeFromShape(r.shape.slice(1));for(let m=0;me>=0?rG*e:nG*(Math.exp(e)-1)),iG={kernelName:Xo,backendName:"cpu",kernelFunc:sG},oG=ct(Zo,e=>e<0?-1:e>0?1:0),lG={kernelName:Zo,backendName:"cpu",kernelFunc:oG},uG=ct(Ko,e=>Math.sin(e)),dG={kernelName:Ko,backendName:"cpu",kernelFunc:uG},pG=ct(Yo,e=>Math.sinh(e)),cG={kernelName:Yo,backendName:"cpu",kernelFunc:pG},hG=11920928955078125e-23,D5=Math.log(hG)+2,mG=ct(Jo,e=>{let t=e>-D5,a=eNumber(g)))),a.makeTensorInfo([f.length],n.dtype,new Int32Array(f))]}var SU={kernelName:wp,backendName:"cpu",kernelFunc:IU};function CU(e){let{inputs:t,backend:a}=e,{inputIndices:n,inputShape:r,newShape:s}=t;if(n.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape + ${i.shape}`);let o=a.data.get(n.dataId).values,l=a.data.get(r.dataId).values,u=a.data.get(s.dataId).values,d=a.data.get(i.dataId).values[0],[c,p,h,m,f]=dv(o,n.shape,n.dtype,l,r.dtype,u,d);return[a.makeTensorInfo(p,n.dtype,c),a.makeTensorInfo([p[0]],r.dtype,h),a.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(g=>Number(g)))),a.makeTensorInfo([f.length],n.dtype,new Int32Array(f))]}var AG={kernelName:Mp,backendName:"cpu",kernelFunc:xG};function bG(e){let{inputs:t,backend:a}=e,{inputIndices:n,inputShape:r,newShape:s}=t;if(n.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${n.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(a.data.get(r.dataId).values),o=a.data.get(n.dataId).values,l=Array.from(a.data.get(s.dataId).values),[u,p,c]=H6(o,n.shape,n.dtype,i,l);return[a.makeTensorInfo(p,n.dtype,u),a.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var TU={kernelName:$u,backendName:"cpu",kernelFunc:CU};function NU(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices 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(a.data.get(r.dataId).values),o=a.data.get(n.dataId).values,l=Array.from(a.data.get(s.dataId).values),[u,d,c]=pv(o,n.shape,n.dtype,i,l);return[a.makeTensorInfo(d,n.dtype,u),a.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var vG={kernelName:Bu,backendName:"cpu",kernelFunc:bG};function wG(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");let i=a.data.get(n.dataId).values,o=a.data.get(r.dataId).values,l=a.data.get(s.dataId).values,[u,p]=y3(i,n.shape,n.dtype,o,l,!0);return a.makeTensorInfo(p,n.dtype,u)}var RU={kernelName:Fu,backendName:"cpu",kernelFunc:NU};function EU(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");let i=a.data.get(n.dataId).values,o=a.data.get(r.dataId).values,l=a.data.get(s.dataId).values,[u,d]=C3(i,n.shape,n.dtype,o,l,!0);return a.makeTensorInfo(d,n.dtype,u)}var kG={kernelName:Vu,backendName:"cpu",kernelFunc:wG};function IG(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);if(r.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");let i=a.data.get(n.dataId).values,o=a.data.get(r.dataId).values,l=a.data.get(s.dataId).values,[u,p]=y3(i,n.shape,n.dtype,o,l);return a.makeTensorInfo(p,n.dtype,u)}var MU={kernelName:Du,backendName:"cpu",kernelFunc:EU};function PU(e){let{inputs:t,backend:a,attrs:n}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=n,{sliceRank:l,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=C.calculateShapes(s,r,o),h=!1,m=a.bufferSync(r),f;switch(s.dtype){case"bool":{let g=a.bufferSync(s),y=!!a.data.get(i.dataId).values[0];f=js(m,g,o,d,p,u,l,c,y,h);break}case"float32":{let g=a.bufferSync(s),y=a.data.get(i.dataId).values[0];f=js(m,g,o,d,p,u,l,c,y,h);break}case"int32":{let g=a.bufferSync(s),y=a.data.get(i.dataId).values[0];f=js(m,g,o,d,p,u,l,c,y,h);break}case"string":{let g=a.bufferSync(s),y=v.decodeString(a.data.get(i.dataId).values[0]);f=js(m,g,o,d,p,u,l,c,y,h);break}default:throw new Error(`Unsupported type ${s.dtype}`)}return a.makeTensorInfo(o,f.dtype,f.values)}var _U={kernelName:Go,backendName:"cpu",kernelFunc:PU};function $U(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=n,o=v.parseAxisParam(i,r.shape)[0],l=C.prepareSplitSize(r,s,o),u=new Array(r.shape.length).fill(0),p=r.shape.slice();return l.map(c=>{let d=[...p];d[o]=c;let h=Qs({inputs:{x:r},backend:a,attrs:{begin:u,size:d}});return u[o]+=c,h})}var FU={kernelName:_u,backendName:"cpu",kernelFunc:$U},DU={kernelName:kp,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:a}=e,n=t;Ie(a,"square");let r=n.data.get(a.dataId).values,s=new Float32Array(r.length);for(let i=0;i{let a=t;return isNaN(e)?NaN:e>0?1:a.alpha}),zU={kernelName:us,backendName:"cpu",kernelFunc:OU};function LU(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:p,newAxisMask:c,shrinkAxisMask:d}=n;Ie(r,"stridedSlice");let{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=Nt.sliceInfo(r.shape,s,i,o,l,u,p,c,d),w;if(f)w=At({inputs:{x:r},backend:a,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let I=Nt.computeOutShape(x,A,b),T=Qs({inputs:{x:r},backend:a,attrs:{begin:x,size:I}});w=At({inputs:{x:T},backend:a,attrs:{shape:m}}),a.disposeIntermediateTensorInfo(T)}else{let I=a.bufferSync(r),T=X6(h,I,b,x);w=a.makeTensorInfo(m,T.dtype,T.values)}return w}var WU={kernelName:jo,backendName:"cpu",kernelFunc:LU};function BU(e){let{inputs:t,backend:a,attrs:n}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=n,{data:p,dataSplits:c}=t,d=a.data.get(p.dataId).values,h=a.data.get(c.dataId).values,[m,f]=x3(d,h,r,s,i,o,l,u);return[a.makeTensorInfo([m.length],"string",m),a.makeTensorInfo(c.shape,"int32",f)]}var VU={kernelName:Ou,backendName:"cpu",kernelFunc:BU};function UU(e){let{inputs:t,backend:a,attrs:n}=e,{skipEmpty:r}=n,{input:s,delimiter:i}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=a.data.get(s.dataId).values,l=a.data.get(i.dataId).values[0],[u,p,c]=A3(o,l,r),d=p.length;return[a.makeTensorInfo([d,2],"int32",u),a.makeTensorInfo([d],"string",p),a.makeTensorInfo([2],"int32",new Int32Array(c))]}var GU={kernelName:Sp,backendName:"cpu",kernelFunc:UU};function HU(e){let{inputs:t,backend:a,attrs:n}=e,{numBuckets:r}=n,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=a.data.get(s.dataId).values,o=b3(i,r);return a.makeTensorInfo(s.shape,"int32",o)}var jU={kernelName:Cp,backendName:"cpu",kernelFunc:HU},qU=ct(Xo,e=>Math.tan(e)),XU={kernelName:Xo,backendName:"cpu",kernelFunc:qU},KU=ct(Ko,e=>Math.tanh(e)),YU={kernelName:Ko,backendName:"cpu",kernelFunc:KU};function ZU(e){let{inputs:t,backend:a}=e,{tensor:n,indices:r,updates:s}=t,{sliceRank:i,numUpdates:o,sliceSize:l,strides:u,outputSize:p}=C.calculateShapes(s,r,n.shape),c=!1,d=a.bufferSync(r),h=a.bufferSync(s),m=a.bufferSync(n),f=js(d,h,n.shape,p,l,o,i,u,m,c);return a.makeTensorInfo(n.shape,f.dtype,f.values)}var JU={kernelName:_o,backendName:"cpu",kernelFunc:ZU};function QU(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{reps:s}=n;Ie(r,"tile");let i=Y6(a.bufferSync(r),s);return a.makeTensorInfo(i.shape,i.dtype,i.values)}var eG={kernelName:ls,backendName:"cpu",kernelFunc:QU};function tG(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{k:s,sorted:i}=n;Ie(r,"topk");let o=a.data.get(r.dataId).values,[l,u]=J6(o,r.shape,r.dtype,s,i);return[a.makeTensorInfo(l.shape,l.dtype,l.values),a.makeTensorInfo(u.shape,u.dtype,u.values)]}var aG={kernelName:Yo,backendName:"cpu",kernelFunc:tG};function nG(e){let{inputs:t,attrs:a,backend:n}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=a,[p,c,d,h]=r.shape,[m,f]=u!=null?u:[c,d],g=[p,m,f,h],y=v.computeStrides(r.shape),x=y[0],A=y[1],b=y[2],w=v.computeStrides(g),I=w[0],T=w[1],N=w[2],M=v.getTypedArrayFromDType(r.dtype,v.sizeFromShape(g));M.fill(l);let P=n.data.get(r.dataId).values,E=n.data.get(s.dataId).values;for(let S=0;St-1)if(t<=1)a=0;else{let n=2*t;a-=n*Math.trunc(a/n),a>=t&&(a=n-a-1)}return v.clamp(0,a,t-1)}function iG(e,t){let a=e;if(a<0)if(t<=1)a=0;else{let n=t-1;a+=t*(Math.trunc(-a/n)+1)}else if(a>t-1)if(t<=1)a=0;else{let n=t-1;a-=t*Math.trunc(a/n)}return v.clamp(0,a,t-1)}function oG(e,t){return e}function lG(e,t){return v.clamp(0,e,t-1)}function Sd(e,t,a,n,r,s,i,o,l,u,p){let c=i*n+o*r+l*s+u;return 0<=o&&oa.disposeIntermediateTensorInfo(m)),h}var gG={kernelName:Np,backendName:"cpu",kernelFunc:fG},yG=[dL,UO,cL,mL,KO,gL,xL,bL,wL,IL,CL,NL,EL,_L,FL,zL,WL,VL,GL,lL,jL,XL,YL,ZO,JL,qO,QO,eW,GO,aW,rW,sW,oW,uW,pW,hW,fW,yW,AW,vW,kW,SW,TW,RW,EW,PW,$W,DW,OW,zW,LW,BW,GW,tL,jW,ez,eB,tz,tB,nz,oB,lB,dB,sz,oz,cB,mB,gB,xB,uz,pz,HO,bB,nW,wB,IB,CB,aL,hz,fz,NB,yz,EB,_B,FB,zB,WB,VB,UB,Az,HB,qB,KB,ZB,QB,tV,nV,vz,sV,lV,cV,kz,Sz,fV,xV,vV,Tz,kV,SV,CV,mv,EV,rL,Ez,PV,$V,DV,zV,jO,P1,WV,sL,iL,oL,VV,GV,jV,XV,YV,ZV,QV,Lz,tU,iU,lU,cU,Bz,mU,gU,xU,Vz,dV,vU,kU,SU,TU,RU,MU,_U,FU,Hz,DU,qz,Kz,zU,WU,VU,GU,jU,Qz,VW,XU,YU,JU,eG,aG,rG,Nz,cG,mG,gG,IV];for(let e of yG)yn(e);var fv={};Ze(fv,{assertNotComplex:()=>Gu,bindCanvasToFramebuffer:()=>NG,bindColorTextureToFramebuffer:()=>ah,bindTextureToProgramUniformSampler:()=>Ev,bindTextureUnit:()=>Tv,bindVertexBufferToProgramAttribute:()=>$1,callAndCheck:()=>ce,canBeRepresented:()=>gv,createFragmentShader:()=>Av,createFramebuffer:()=>Cv,createProgram:()=>bv,createStaticIndexBuffer:()=>kv,createStaticVertexBuffer:()=>wv,createTexture:()=>Iv,createVertexShader:()=>xv,getBatchDim:()=>ei,getExtensionOrThrow:()=>Cd,getFramebufferErrorMessage:()=>Mv,getMaxTexturesInShader:()=>Fv,getNumChannels:()=>CG,getProgramUniformLocation:()=>Rv,getProgramUniformLocationOrThrow:()=>Nv,getRowsCols:()=>ti,getShapeAs3D:()=>Nd,getTextureShapeFromLogicalShape:()=>_v,getWebGLDisjointQueryTimerVersion:()=>Dv,getWebGLErrorMessage:()=>yv,getWebGLMaxTextureSize:()=>$v,hasExtension:()=>mn,isCapableOfRenderingToFloatTexture:()=>Ov,isDownloadFloatTextureEnabled:()=>zv,isReshapeFree:()=>Zd,isWebGLFenceEnabled:()=>Lv,isWebGLVersionEnabled:()=>D1,linkProgram:()=>vv,logShaderSourceAndInfoLog:()=>T3,resetMaxTextureSize:()=>RG,resetMaxTexturesInShader:()=>EG,unbindColorTextureFromFramebuffer:()=>F1,unbindTextureUnit:()=>TG,validateFramebuffer:()=>Td,validateProgram:()=>th,validateTextureSize:()=>Sv});var Us={},Xc={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function a0(e,t){Us[e]=t}function Wn(e,t){if(!(e in Us)||t!=null){let n=AG(e,t);if(n!==null)Us[e]=n;else return console.log("Could not get context for WebGL version",e),null}let a=Us[e];return a==null||a.isContextLost()?(delete Us[e],Wn(e)):(a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.disable(a.BLEND),a.disable(a.DITHER),a.disable(a.POLYGON_OFFSET_FILL),a.disable(a.SAMPLE_COVERAGE),a.enable(a.SCISSOR_TEST),a.enable(a.CULL_FACE),a.cullFace(a.BACK),Us[e])}function xG(e){if(!B().getBool("IS_SAFARI")&&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 AG(e,t){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let a=t==null?xG(e):t;return a.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete Us[e]},!1),B().getBool("SOFTWARE_WEBGL_ENABLED")&&(Xc.failIfMajorPerformanceCaveat=!1),e===1?a.getContext("webgl",Xc)||a.getContext("experimental-webgl",Xc):a.getContext("webgl2",Xc)}var Yd;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(Yd||(Yd={}));var hn;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(hn||(hn={}));var ua;(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"})(ua||(ua={}));function Xp(e,t){return[t,e]}function bG(e,t){return e*t}function Kc(e){let t=v.sizeFromShape(e),a=Math.ceil(t/4);return v.sizeToSquarishShape(a)}function Uu(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function vG(e,t){let[a,n]=Uu(e,t);return a*n*4}function C3(e,t){let a=e,n,r,s,i,o,l,u,p,c,d;return B().getNumber("WEBGL_VERSION")===2?(n=a.R32F,r=a.R16F,s=a.RGBA16F,i=a.RGBA32F,o=a.RED,u=4,p=1,c=a.HALF_FLOAT,d=a.FLOAT,l=a.RGBA8):(n=e.RGBA,r=e.RGBA,s=e.RGBA,i=a.RGBA,o=e.RGBA,u=4,p=4,c=t!=null?t.HALF_FLOAT_OES:null,d=e.FLOAT,l=e.RGBA),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:p,textureTypeHalfFloat:c,textureTypeFloat:d}}function ce(e,t){let a=t();return B().getBool("DEBUG")&&wG(e),a}function wG(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+yv(e,t))}var kG=596e-10,IG=65504;function gv(e){return!!(B().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||kGe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function xv(e,t){let a=Mr(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(ce(e,()=>e.shaderSource(a,t)),ce(e,()=>e.compileShader(a)),e.getShaderParameter(a,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(a)),new Error("Failed to compile vertex shader.");return a}function Av(e,t){let a=Mr(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(ce(e,()=>e.shaderSource(a,t)),ce(e,()=>e.compileShader(a)),B().get("ENGINE_COMPILE_ONLY"))return a;if(e.getShaderParameter(a,e.COMPILE_STATUS)===!1)throw T3(t,e.getShaderInfoLog(a)),new Error("Failed to compile fragment shader.");return a}var SG=/ERROR: [0-9]+:([0-9]+):/g;function T3(e,t){let a=SG.exec(t);if(a==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let n=+a[1],r=e.split(` -`),s=r.length.toString().length+2,i=r.map((c,d)=>v.rightPad((d+1).toString(),s)+c),o=0;for(let c=0;c{let p=[...d];p[o]=c;let h=Ci({inputs:{x:r},backend:a,attrs:{begin:u,size:p}});return u[o]+=c,h})}var RG={kernelName:Wu,backendName:"cpu",kernelFunc:NG},EG={kernelName:Fp,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:a}=e,n=t;Ie(a,"square");let r=n.data.get(a.dataId).values,s=new Float32Array(r.length);for(let i=0;i{let a=t;return isNaN(e)?NaN:e>0?1:a.alpha}),FG={kernelName:Ds,backendName:"cpu",kernelFunc:MG};function $G(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:d,newAxisMask:c,shrinkAxisMask:p}=n;Ie(r,"stridedSlice");let{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=wt.sliceInfo(r.shape,s,i,o,l,u,d,c,p),w;if(f)w=bt({inputs:{x:r},backend:a,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let S=wt.computeOutShape(x,A,b),C=Ci({inputs:{x:r},backend:a,attrs:{begin:x,size:S}});w=bt({inputs:{x:C},backend:a,attrs:{shape:m}}),a.disposeIntermediateTensorInfo(C)}else{let S=a.bufferSync(r),C=mv(h,S,b,x);w=a.makeTensorInfo(m,C.dtype,C.values)}return w}var DG={kernelName:al,backendName:"cpu",kernelFunc:$G};function PG(e){let{inputs:t,backend:a,attrs:n}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=n,{data:d,dataSplits:c}=t,p=a.data.get(d.dataId).values,h=a.data.get(c.dataId).values,[m,f]=N3(p,h,r,s,i,o,l,u);return[a.makeTensorInfo([m.length],"string",m),a.makeTensorInfo(c.shape,"int32",f)]}var _G={kernelName:Hu,backendName:"cpu",kernelFunc:PG};function OG(e){let{inputs:t,backend:a,attrs:n}=e,{skipEmpty:r}=n,{input:s,delimiter:i}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=a.data.get(s.dataId).values,l=a.data.get(i.dataId).values[0],[u,d,c]=R3(o,l,r),p=d.length;return[a.makeTensorInfo([p,2],"int32",u),a.makeTensorInfo([p],"string",d),a.makeTensorInfo([2],"int32",new Int32Array(c))]}var zG={kernelName:$p,backendName:"cpu",kernelFunc:OG};function LG(e){let{inputs:t,backend:a,attrs:n}=e,{numBuckets:r}=n,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=a.data.get(s.dataId).values,o=E3(i,r);return a.makeTensorInfo(s.shape,"int32",o)}var WG={kernelName:Dp,backendName:"cpu",kernelFunc:LG},BG=ct(nl,e=>Math.tan(e)),VG={kernelName:nl,backendName:"cpu",kernelFunc:BG},UG=ct(rl,e=>Math.tanh(e)),GG={kernelName:rl,backendName:"cpu",kernelFunc:UG};function HG(e){let{inputs:t,backend:a}=e,{tensor:n,indices:r,updates:s}=t,{sliceRank:i,numUpdates:o,sliceSize:l,strides:u,outputSize:d}=I.calculateShapes(s,r,n.shape),c=!1,p=a.bufferSync(r),h=a.bufferSync(s),m=a.bufferSync(n),f=xi(p,h,n.shape,d,l,o,i,u,m,c);return a.makeTensorInfo(n.shape,f.dtype,f.values)}var jG={kernelName:jo,backendName:"cpu",kernelFunc:HG};function qG(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{reps:s}=n;Ie(r,"tile");let i=gv(a.bufferSync(r),s);return a.makeTensorInfo(i.shape,i.dtype,i.values)}var XG={kernelName:$s,backendName:"cpu",kernelFunc:qG};function KG(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{k:s,sorted:i}=n;Ie(r,"topk");let o=a.data.get(r.dataId).values,[l,u]=xv(o,r.shape,r.dtype,s,i);return[a.makeTensorInfo(l.shape,l.dtype,l.values),a.makeTensorInfo(u.shape,u.dtype,u.values)]}var YG={kernelName:sl,backendName:"cpu",kernelFunc:KG};function ZG(e){let{inputs:t,attrs:a,backend:n}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=a,[d,c,p,h]=r.shape,[m,f]=u!=null?u:[c,p],g=[d,m,f,h],y=v.computeStrides(r.shape),x=y[0],A=y[1],b=y[2],w=v.computeStrides(g),S=w[0],C=w[1],N=w[2],M=v.getTypedArrayFromDType(r.dtype,v.sizeFromShape(g));M.fill(l);let F=n.data.get(r.dataId).values,E=n.data.get(s.dataId).values;for(let T=0;Tt-1)if(t<=1)a=0;else{let n=2*t;a-=n*Math.trunc(a/n),a>=t&&(a=n-a-1)}return v.clamp(0,a,t-1)}function eH(e,t){let a=e;if(a<0)if(t<=1)a=0;else{let n=t-1;a+=t*(Math.trunc(-a/n)+1)}else if(a>t-1)if(t<=1)a=0;else{let n=t-1;a-=t*Math.trunc(a/n)}return v.clamp(0,a,t-1)}function tH(e,t){return e}function aH(e,t){return v.clamp(0,e,t-1)}function $d(e,t,a,n,r,s,i,o,l,u,d){let c=i*n+o*r+l*s+u;return 0<=o&&oa.disposeIntermediateTensorInfo(m)),h}var dH={kernelName:_p,backendName:"cpu",kernelFunc:uH},pH=[rW,Oz,iW,lW,Uz,dW,cW,mW,gW,xW,bW,wW,IW,CW,RW,FW,DW,_W,zW,aW,WW,VW,GW,Hz,jW,Bz,qz,XW,zz,YW,JW,QW,tB,nB,sB,oB,uB,pB,hB,fB,yB,AB,vB,kB,IB,TB,NB,EB,MB,FB,$B,PB,zB,KL,WB,Xz,XB,Kz,KB,Zz,tV,aV,rV,Qz,tL,iV,lV,dV,cV,nL,sL,Lz,mV,ZW,gV,xV,bV,YL,oL,uL,wV,pL,IV,CV,RV,FV,DV,_V,OV,hL,LV,BV,UV,HV,qV,KV,ZV,fL,QV,aU,iU,yL,AL,uU,cU,fU,vL,yU,AU,bU,Dv,IU,JL,IL,TU,NU,EU,FU,Wz,L1,DU,QL,eW,tW,_U,zU,WU,VU,GU,HU,qU,$L,KU,eG,aG,iG,PL,lG,dG,cG,_L,rU,fG,yG,AG,vG,kG,SG,CG,RG,LL,EG,BL,UL,FG,DG,_G,zG,WG,qL,_B,VG,GG,jG,XG,YG,JG,wL,iH,lH,dH,xU];for(let e of pH)bn(e);var Pv={};Ke(Pv,{assertNotComplex:()=>Ju,bindCanvasToFramebuffer:()=>wH,bindColorTextureToFramebuffer:()=>dh,bindTextureToProgramUniformSampler:()=>Yv,bindTextureUnit:()=>qv,bindVertexBufferToProgramAttribute:()=>B1,callAndCheck:()=>ce,canBeRepresented:()=>_v,createFragmentShader:()=>Lv,createFramebuffer:()=>jv,createProgram:()=>Wv,createStaticIndexBuffer:()=>Uv,createStaticVertexBuffer:()=>Vv,createTexture:()=>Gv,createVertexShader:()=>zv,getBatchDim:()=>Ni,getExtensionOrThrow:()=>Dd,getFramebufferErrorMessage:()=>Zv,getMaxTexturesInShader:()=>tw,getNumChannels:()=>bH,getProgramUniformLocation:()=>Kv,getProgramUniformLocationOrThrow:()=>Xv,getRowsCols:()=>Ri,getShapeAs3D:()=>_d,getTextureShapeFromLogicalShape:()=>Qv,getWebGLDisjointQueryTimerVersion:()=>aw,getWebGLErrorMessage:()=>Ov,getWebGLMaxTextureSize:()=>ew,hasExtension:()=>yn,isCapableOfRenderingToFloatTexture:()=>nw,isDownloadFloatTextureEnabled:()=>rw,isReshapeFree:()=>ip,isWebGLFenceEnabled:()=>sw,isWebGLVersionEnabled:()=>U1,linkProgram:()=>Bv,logShaderSourceAndInfoLog:()=>O3,resetMaxTextureSize:()=>kH,resetMaxTexturesInShader:()=>IH,unbindColorTextureFromFramebuffer:()=>V1,unbindTextureUnit:()=>vH,validateFramebuffer:()=>Pd,validateProgram:()=>uh,validateTextureSize:()=>Hv});var fi={},ah={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function u0(e,t){fi[e]=t}function Un(e,t){if(!(e in fi)||t!=null){let n=hH(e,t);if(n!==null)fi[e]=n;else return console.log("Could not get context for WebGL version",e),null}let a=fi[e];return a==null||a.isContextLost()?(delete fi[e],Un(e)):(a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.disable(a.BLEND),a.disable(a.DITHER),a.disable(a.POLYGON_OFFSET_FILL),a.disable(a.SAMPLE_COVERAGE),a.enable(a.SCISSOR_TEST),a.enable(a.CULL_FACE),a.cullFace(a.BACK),fi[e])}function cH(e){if(!B().getBool("IS_SAFARI")&&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 hH(e,t){if(e!==1&&e!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let a=t==null?cH(e):t;return a.addEventListener("webglcontextlost",n=>{n.preventDefault(),delete fi[e]},!1),B().getBool("SOFTWARE_WEBGL_ENABLED")&&(ah.failIfMajorPerformanceCaveat=!1),e===1?a.getContext("webgl",ah)||a.getContext("experimental-webgl",ah):a.getContext("webgl2",ah)}var sp;(function(e){e[e.DENSE=0]="DENSE",e[e.SHARED_BATCH=1]="SHARED_BATCH"})(sp||(sp={}));var gn;(function(e){e[e.RENDER=0]="RENDER",e[e.UPLOAD=1]="UPLOAD",e[e.PIXELS=2]="PIXELS",e[e.DOWNLOAD=3]="DOWNLOAD"})(gn||(gn={}));var pa;(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"})(pa||(pa={}));function ac(e,t){return[t,e]}function mH(e,t){return e*t}function nh(e){let t=v.sizeFromShape(e),a=Math.ceil(t/4);return v.sizeToSquarishShape(a)}function Zu(e,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(e/2))]}function fH(e,t){let[a,n]=Zu(e,t);return a*n*4}function _3(e,t){let a=e,n,r,s,i,o,l,u,d,c,p;return B().getNumber("WEBGL_VERSION")===2?(n=a.R32F,r=a.R16F,s=a.RGBA16F,i=a.RGBA32F,o=a.RED,u=4,d=1,c=a.HALF_FLOAT,p=a.FLOAT,l=a.RGBA8):(n=e.RGBA,r=e.RGBA,s=e.RGBA,i=a.RGBA,o=e.RGBA,u=4,d=4,c=t!=null?t.HALF_FLOAT_OES:null,p=e.FLOAT,l=e.RGBA),{internalFormatFloat:n,internalFormatHalfFloat:r,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:i,textureFormatFloat:o,downloadTextureFormat:l,downloadUnpackNumChannels:u,defaultNumChannels:d,textureTypeHalfFloat:c,textureTypeFloat:p}}function ce(e,t){let a=t();return B().getBool("DEBUG")&&gH(e),a}function gH(e){let t=e.getError();if(t!==e.NO_ERROR)throw new Error("WebGL Error: "+Ov(e,t))}var yH=596e-10,xH=65504;function _v(e){return!!(B().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||e===0||yHe.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function zv(e,t){let a=_r(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(ce(e,()=>e.shaderSource(a,t)),ce(e,()=>e.compileShader(a)),e.getShaderParameter(a,e.COMPILE_STATUS)===!1)throw console.log(e.getShaderInfoLog(a)),new Error("Failed to compile vertex shader.");return a}function Lv(e,t){let a=_r(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(ce(e,()=>e.shaderSource(a,t)),ce(e,()=>e.compileShader(a)),B().get("ENGINE_COMPILE_ONLY"))return a;if(e.getShaderParameter(a,e.COMPILE_STATUS)===!1)throw O3(t,e.getShaderInfoLog(a)),new Error("Failed to compile fragment shader.");return a}var AH=/ERROR: [0-9]+:([0-9]+):/g;function O3(e,t){let a=AH.exec(t);if(a==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let n=+a[1],r=e.split(` +`),s=r.length.toString().length+2,i=r.map((c,p)=>v.rightPad((p+1).toString(),s)+c),o=0;for(let c=0;ce.createProgram(),"Unable to create WebGLProgram.")}function vv(e,t){if(ce(e,()=>e.linkProgram(t)),!B().get("ENGINE_COMPILE_ONLY")&&e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function th(e,t){if(ce(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function wv(e,t){let a=Mr(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),ce(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),a}function kv(e,t){let a=Mr(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,a)),ce(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),a}function CG(){return B().getNumber("WEBGL_VERSION")===2?1:4}function Iv(e){return Mr(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function Sv(e,t){let a=B().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let n=`[${e}x${t}]`;throw new Error("Requested texture size "+n+" is invalid.")}if(e>a||t>a){let n=`[${e}x${t}]`,r=`[${a}x${a}]`;throw new Error("Requested texture size "+n+" greater than WebGL maximum on this browser / GPU "+r+".")}}function Cv(e){return Mr(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function $1(e,t,a,n,r,s,i){let o=e.getAttribLocation(t,a);return o===-1?!1:(ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),ce(e,()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,s,i)),ce(e,()=>e.enableVertexAttribArray(o)),!0)}function Tv(e,t,a){Pv(e,a),ce(e,()=>e.activeTexture(e.TEXTURE0+a)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function TG(e,t){Pv(e,t),ce(e,()=>e.activeTexture(e.TEXTURE0+t)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Nv(e,t,a){return Mr(e,()=>e.getUniformLocation(t,a),'uniform "'+a+'" not present in program.')}function Rv(e,t,a){return e.getUniformLocation(t,a)}function Ev(e,t,a,n){ce(e,()=>Tv(e,t,n)),ce(e,()=>e.uniform1i(a,n))}function NG(e){ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),ce(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),ce(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function ah(e,t,a){ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,a)),ce(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function F1(e,t){ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),ce(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function Td(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Mv(e,t))}function Mv(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 Mr(e,t,a){let n=ce(e,()=>t());if(n==null)throw new Error(a);return n}function Pv(e,t){let a=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,n=t+e.TEXTURE0;if(na){let r=`[gl.TEXTURE0, gl.TEXTURE${a}]`;throw new Error(`textureUnit must be in ${r}.`)}}function ei(e,t=2){return v.sizeFromShape(e.slice(0,e.length-t))}function ti(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 Nd(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[ei(e),...ti(e)]),t}function _v(e,t=!1){let a=B().getNumber("WEBGL_MAX_TEXTURE_SIZE"),n=B().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");n===1/0&&B().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(n=a/2),t&&(a=a*2,n=n*2,e=e.map((o,l)=>l>=e.length-2?v.nearestLargerEven(e[l]):e[l]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=v.squeezeShape(e).newShape);let r=v.sizeFromShape(e),s=null;e.length<=1&&r<=a?s=[1,r]:e.length===2&&e[0]<=a&&e[1]<=a?s=e:e.length===3&&e[0]*e[1]<=a&&e[2]<=a?s=[e[0]*e[1],e[2]]:e.length===3&&e[0]<=a&&e[1]*e[2]<=a?s=[e[0],e[1]*e[2]]:e.length===4&&e[0]*e[1]*e[2]<=a&&e[3]<=a?s=[e[0]*e[1]*e[2],e[3]]:e.length===4&&e[0]<=a&&e[1]*e[2]*e[3]<=a&&(s=[e[0],e[1]*e[2]*e[3]]);let i=s!=null&&Math.max(...s)>n&&Math.min(...s)<=(t?2:1)&&Math.min(...s)>0;if(s==null||i)if(t){let o=ei(e),l=2,u=2;e.length&&([l,u]=ti(e)),r=o*(l/2)*(u/2),s=v.sizeToSquarishShape(r).map(p=>p*2)}else s=v.sizeToSquarishShape(r);return s}function Yc(e){return e%2===0}function Zd(e,t){if(e=e.slice(-2),t=t.slice(-2),v.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 a=e[e.length-1],n=t[t.length-1];if(a===n||Yc(a)&&Yc(n)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&Yc(e[0])&&Yc(t[0])}var nh,rh;function $v(e){if(nh==null){let t=Wn(e);nh=t.getParameter(t.MAX_TEXTURE_SIZE)}return nh}function RG(){nh=null}function EG(){rh=null}function Fv(e){if(rh==null){let t=Wn(e);rh=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,rh)}function Dv(e){if(e===0)return 0;let t,a=Wn(e);return mn(a,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:mn(a,"EXT_disjoint_timer_query")?t=1:t=0,t}function mn(e,t){return e.getExtension(t)!=null}function D1(e){try{if(Wn(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function Ov(e){if(e===0)return!1;let t=Wn(e);if(e===1){if(!mn(t,"OES_texture_float"))return!1}else if(!mn(t,"EXT_color_buffer_float"))return!1;return O1(t)}function zv(e){if(e===0)return!1;let t=Wn(e);if(e===1){if(!mn(t,"OES_texture_float")||!mn(t,"WEBGL_color_buffer_float"))return!1}else{if(mn(t,"EXT_color_buffer_float"))return O1(t);let a="EXT_color_buffer_half_float";if(mn(t,a)){let n=t.getExtension(a);return MG(t,n)}return!1}return O1(t)}function O1(e){let t=C3(e),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a);let n=1,r=1;e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,n,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,a,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(a),e.deleteFramebuffer(s),i}function MG(e,t){let a=C3(e,t),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=1,s=1;e.texImage2D(e.TEXTURE_2D,0,a.internalFormatHalfFloat,r,s,0,a.textureFormatFloat,a.textureTypeHalfFloat,null);let i=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(i),o}function Lv(e){return e!==2?!1:Wn(e).fenceSync!=null}function Gu(e,t){Array.isArray(e)||(e=[e]),e.forEach(a=>{a!=null&&v.assert(a.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Se=B();Se.registerFlag("HAS_WEBGL",()=>Se.getNumber("WEBGL_VERSION")>0);Se.registerFlag("WEBGL_VERSION",()=>D1(2)?2:D1(1)?1:0);Se.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Se.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Se.get("WEBGL_VERSION")===2);Se.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Se.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Se.registerFlag("WEBGL_PACK",()=>Se.getBool("HAS_WEBGL"));Se.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CLIP",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_REDUCE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_LAZILY_UNPACK",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_CONV_IM2COL",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>$v(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>Fv(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Se.getNumber("WEBGL_VERSION");return e===0?0:Dv(e)});Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Se.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!Pp.isMobile());Se.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>Ov(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Se.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Se.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Se.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>zv(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_FENCE_API_ENABLED",()=>Lv(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Se.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Se.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(typeof e!="number")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${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}.`)});Se.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>Pp.isMobile()?1:-1,e=>{if(typeof e!="number")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${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}.`)});Se.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);Se.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1);Se.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5);Se.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);Se.registerFlag("WEBGL_EXP_CONV",()=>!1);Se.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>Se.getBool("IS_TEST"));Se.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0);Se.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1);Se.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1);Se.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);function Ra(){let e,t,a,n,r,s,i,o,l,u;return B().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",a="out",n="in",r="texture",s="outputColor",i="out vec4 outputColor;",o=B().getBool("WEBGL2_ISNAN_CUSTOM")?` +`)[0]),console.log(`%c ${v.rightPad(u[0],o)}`,"border:1px solid red; background-color:#e3d2d2; color:#a61717"),console.log(d.join(` +`))}function Wv(e){return _r(e,()=>e.createProgram(),"Unable to create WebGLProgram.")}function Bv(e,t){if(ce(e,()=>e.linkProgram(t)),!B().get("ENGINE_COMPILE_ONLY")&&e.getProgramParameter(t,e.LINK_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function uh(e,t){if(ce(e,()=>e.validateProgram(t)),e.getProgramParameter(t,e.VALIDATE_STATUS)===!1)throw console.log(e.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function Vv(e,t){let a=_r(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),ce(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),a}function Uv(e,t){let a=_r(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,a)),ce(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),a}function bH(){return B().getNumber("WEBGL_VERSION")===2?1:4}function Gv(e){return _r(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function Hv(e,t){let a=B().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0){let n=`[${e}x${t}]`;throw new Error("Requested texture size "+n+" is invalid.")}if(e>a||t>a){let n=`[${e}x${t}]`,r=`[${a}x${a}]`;throw new Error("Requested texture size "+n+" greater than WebGL maximum on this browser / GPU "+r+".")}}function jv(e){return _r(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function B1(e,t,a,n,r,s,i){let o=e.getAttribLocation(t,a);return o===-1?!1:(ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),ce(e,()=>e.vertexAttribPointer(o,r,e.FLOAT,!1,s,i)),ce(e,()=>e.enableVertexAttribArray(o)),!0)}function qv(e,t,a){Jv(e,a),ce(e,()=>e.activeTexture(e.TEXTURE0+a)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function vH(e,t){Jv(e,t),ce(e,()=>e.activeTexture(e.TEXTURE0+t)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function Xv(e,t,a){return _r(e,()=>e.getUniformLocation(t,a),'uniform "'+a+'" not present in program.')}function Kv(e,t,a){return e.getUniformLocation(t,a)}function Yv(e,t,a,n){ce(e,()=>qv(e,t,n)),ce(e,()=>e.uniform1i(a,n))}function wH(e){ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),ce(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),ce(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function dh(e,t,a){ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,a)),ce(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function V1(e,t){ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),ce(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function Pd(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+Zv(e,t))}function Zv(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 _r(e,t,a){let n=ce(e,()=>t());if(n==null)throw new Error(a);return n}function Jv(e,t){let a=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,n=t+e.TEXTURE0;if(na){let r=`[gl.TEXTURE0, gl.TEXTURE${a}]`;throw new Error(`textureUnit must be in ${r}.`)}}function Ni(e,t=2){return v.sizeFromShape(e.slice(0,e.length-t))}function Ri(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 _d(e){let t=[1,1,1];return e.length===0||e.length===1&&e[0]===1||(t=[Ni(e),...Ri(e)]),t}function Qv(e,t=!1){let a=B().getNumber("WEBGL_MAX_TEXTURE_SIZE"),n=B().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");n===1/0&&B().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(n=a/2),t&&(a=a*2,n=n*2,e=e.map((o,l)=>l>=e.length-2?v.nearestLargerEven(e[l]):e[l]),e.length===1&&(e=[2,e[0]])),e.length!==2&&(e=v.squeezeShape(e).newShape);let r=v.sizeFromShape(e),s=null;e.length<=1&&r<=a?s=[1,r]:e.length===2&&e[0]<=a&&e[1]<=a?s=e:e.length===3&&e[0]*e[1]<=a&&e[2]<=a?s=[e[0]*e[1],e[2]]:e.length===3&&e[0]<=a&&e[1]*e[2]<=a?s=[e[0],e[1]*e[2]]:e.length===4&&e[0]*e[1]*e[2]<=a&&e[3]<=a?s=[e[0]*e[1]*e[2],e[3]]:e.length===4&&e[0]<=a&&e[1]*e[2]*e[3]<=a&&(s=[e[0],e[1]*e[2]*e[3]]);let i=s!=null&&Math.max(...s)>n&&Math.min(...s)<=(t?2:1)&&Math.min(...s)>0;if(s==null||i)if(t){let o=Ni(e),l=2,u=2;e.length&&([l,u]=Ri(e)),r=o*(l/2)*(u/2),s=v.sizeToSquarishShape(r).map(d=>d*2)}else s=v.sizeToSquarishShape(r);return s}function rh(e){return e%2===0}function ip(e,t){if(e=e.slice(-2),t=t.slice(-2),v.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 a=e[e.length-1],n=t[t.length-1];if(a===n||rh(a)&&rh(n)&&(e[0]===1||t[0]===1))return!0}return e[1]===t[1]&&rh(e[0])&&rh(t[0])}var ph,ch;function ew(e){if(ph==null){let t=Un(e);ph=t.getParameter(t.MAX_TEXTURE_SIZE)}return ph}function kH(){ph=null}function IH(){ch=null}function tw(e){if(ch==null){let t=Un(e);ch=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,ch)}function aw(e){if(e===0)return 0;let t,a=Un(e);return yn(a,"EXT_disjoint_timer_query_webgl2")&&e===2?t=2:yn(a,"EXT_disjoint_timer_query")?t=1:t=0,t}function yn(e,t){return e.getExtension(t)!=null}function U1(e){try{if(Un(e)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function nw(e){if(e===0)return!1;let t=Un(e);if(e===1){if(!yn(t,"OES_texture_float"))return!1}else if(!yn(t,"EXT_color_buffer_float"))return!1;return G1(t)}function rw(e){if(e===0)return!1;let t=Un(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 G1(t);let a="EXT_color_buffer_half_float";if(yn(t,a)){let n=t.getExtension(a);return SH(t,n)}return!1}return G1(t)}function G1(e){let t=_3(e),a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a),e.texImage2D(e.TEXTURE_2D,0,t.internalFormatFloat,1,1,0,t.textureFormatFloat,t.textureTypeFloat,null);let n=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,n),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0);let r=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(a),e.deleteFramebuffer(n),r}function SH(e,t){let a=_3(e,t),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,a.internalFormatHalfFloat,1,1,0,a.textureFormatFloat,a.textureTypeHalfFloat,null);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let s=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(r),s}function sw(e){return e!==2?!1:Un(e).fenceSync!=null}function Ju(e,t){Array.isArray(e)||(e=[e]),e.forEach(a=>{a!=null&&v.assert(a.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Se=B();Se.registerFlag("HAS_WEBGL",()=>Se.getNumber("WEBGL_VERSION")>0);Se.registerFlag("WEBGL_VERSION",()=>U1(2)?2:U1(1)?1:0);Se.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Se.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Se.get("WEBGL_VERSION")===2);Se.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Se.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Se.registerFlag("WEBGL_PACK",()=>Se.getBool("HAS_WEBGL"));Se.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CLIP",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_REDUCE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_LAZILY_UNPACK",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_CONV_IM2COL",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>ew(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>tw(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=Se.getNumber("WEBGL_VERSION");return e===0?0:aw(e)});Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Se.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!Wp.isMobile());Se.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>nw(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Se.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Se.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Se.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>rw(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_FENCE_API_ENABLED",()=>sw(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Se.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Se.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if(typeof e!="number")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${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}.`)});Se.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>Wp.isMobile()?1:-1,e=>{if(typeof e!="number")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${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}.`)});Se.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);Se.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1);Se.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5);Se.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);Se.registerFlag("WEBGL_EXP_CONV",()=>!1);Se.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>Se.getBool("IS_TEST"));Se.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0);Se.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1);Se.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1);Se.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);function Ra(){let e,t,a,n,r,s,i,o,l,u;return B().getNumber("WEBGL_VERSION")===2?(e="#version 300 es",t="in",a="out",n="in",r="texture",s="outputColor",i="out vec4 outputColor;",o=B().getBool("WEBGL2_ISNAN_CUSTOM")?` bool isnan_custom(float val) { uint floatToUint = floatBitsToUint(val); return (floatToUint & 0x7fffffffu) > 0x7f800000u; @@ -100,15 +100,15 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram ivec4 round(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `),{version:e,attribute:t,varyingVs:a,varyingFs:n,texture2D:r,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:u}}function tl(e,t,a="index"){let n=v.computeStrides(t);return n.map((r,s)=>{let i=`int ${e[s]} = ${a} / ${r}`,o=s===n.length-1?`int ${e[s+1]} = ${a} - ${e[s]} * ${r}`:`index -= ${e[s]} * ${r}`;return`${i}; ${o};`}).join("")}function n0(e,t,a="index"){let n=v.computeStrides(t);return n.map((r,s)=>{let i=`int ${e[s]} = ${a} / outShapeStrides[${s}]`,o=s===n.length-1?`int ${e[s+1]} = ${a} - ${e[s]} * outShapeStrides[${s}]`:`index -= ${e[s]} * outShapeStrides[${s}]`;return`${i}; ${o};`}).join("")}function PG(e,t){let a=e.length,n=e.map(s=>`${t}[${s}]`),r=new Array(a-1);r[a-2]=n[a-1];for(let s=a-3;s>=0;--s)r[s]=`(${r[s+1]} * ${n[s+1]})`;return r}function _G(e,t,a="index"){let n=e.map((s,i)=>i),r=PG(n,t);return r.map((s,i)=>{let o=`int ${e[i]} = ${a} / ${r[i]}`,l=i===r.length-1?`int ${e[i+1]} = ${a} - ${e[i]} * ${r[i]}`:`index -= ${e[i]} * ${r[i]}`;return`${o}; ${l};`}).join("")}function N3(e){let t=v.computeStrides(e).map(a=>a.toString());return` + `),{version:e,attribute:t,varyingVs:a,varyingFs:n,texture2D:r,output:s,defineOutput:i,defineSpecialNaN:o,defineSpecialInf:l,defineRound:u}}function dl(e,t,a="index"){let n=v.computeStrides(t);return n.map((r,s)=>{let i=`int ${e[s]} = ${a} / ${r}`,o=s===n.length-1?`int ${e[s+1]} = ${a} - ${e[s]} * ${r}`:`index -= ${e[s]} * ${r}`;return`${i}; ${o};`}).join("")}function d0(e,t,a="index"){let n=v.computeStrides(t);return n.map((r,s)=>{let i=`int ${e[s]} = ${a} / outShapeStrides[${s}]`,o=s===n.length-1?`int ${e[s+1]} = ${a} - ${e[s]} * outShapeStrides[${s}]`:`index -= ${e[s]} * outShapeStrides[${s}]`;return`${i}; ${o};`}).join("")}function TH(e,t){let a=e.length,n=e.map(s=>`${t}[${s}]`),r=new Array(a-1);r[a-2]=n[a-1];for(let s=a-3;s>=0;--s)r[s]=`(${r[s+1]} * ${n[s+1]})`;return r}function CH(e,t,a="index"){let n=e.map((s,i)=>i),r=TH(n,t);return r.map((s,i)=>{let o=`int ${e[i]} = ${a} / ${r[i]}`,l=i===r.length-1?`int ${e[i+1]} = ${a} - ${e[i]} * ${r[i]}`:`index -= ${e[i]} * ${r[i]}`;return`${o}; ${l};`}).join("")}function z3(e){let t=v.computeStrides(e).map(a=>a.toString());return` int getFlatIndex(ivec3 coords) { return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z; } -`}function R3(){return` +`}function L3(){return` int getFlatIndex(ivec3 coords) { return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z; } -`}var Wv=` +`}var iw=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; @@ -147,22 +147,22 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram return c / 255.0; } -`,{getBroadcastDims:Bv}=C;function $G(e,t,a){let n=[];if(e.forEach(d=>{let h=v.sizeFromShape(d.shapeInfo.logicalShape);if(d.shapeInfo.isUniform?n.push(`uniform float ${d.name}${h>1?`[${h}]`:""};`):(n.push(`uniform sampler2D ${d.name};`),n.push(`uniform int offset${d.name};`)),a.enableShapeUniforms){let{uniformShape:m}=E3(a.packedInputs,d.shapeInfo.logicalShape,d.shapeInfo.texShape);switch(m.length){case 1:n.push(`uniform int ${d.name}Shape;`);break;case 2:n.push(`uniform ivec2 ${d.name}Shape;`);break;case 3:n.push(`uniform ivec3 ${d.name}Shape;`);break;case 4:n.push(`uniform ivec4 ${d.name}Shape;`);break;default:break}n.push(`uniform ivec2 ${d.name}TexShape;`)}}),a.enableShapeUniforms){switch(t.logicalShape.length){case 1:n.push("uniform int outShape;");break;case 2:n.push("uniform ivec2 outShape;"),n.push("uniform int outShapeStrides;");break;case 3:n.push("uniform ivec3 outShape;"),n.push("uniform ivec2 outShapeStrides;");break;case 4:n.push("uniform ivec4 outShape;"),n.push("uniform ivec3 outShapeStrides;");break;default:break}n.push("uniform ivec2 outTexShape;")}a.customUniforms&&a.customUniforms.forEach(d=>{n.push(`uniform ${d.type} ${d.name}${d.arrayIndex?`[${d.arrayIndex}]`:""};`)});let r=n.join(` -`),s=e.map(d=>FG(d,t,a.packedInputs,a.enableShapeUniforms)).join(` -`),i=t.texShape,o=Ra(),l=zG(o),u,p,c=BG(o);return t.isPacked?(u=DG(t.logicalShape,i,a.enableShapeUniforms),p=WG(o)):(u=OG(t.logicalShape,i,a.enableShapeUniforms),p=LG(o)),a.packedInputs&&(c+=HG),[c,l,p,r,u,s,a.userCode].join(` -`)}function Hu(e,t=!1){let a=e.shapeInfo.logicalShape;switch(a.length){case 0:return nH(e,t);case 1:return sH(e,t);case 2:return oH(e,t);case 3:return uH(e,t);case 4:return pH(e,t);case 5:return cH(e);case 6:return hH(e);default:throw new Error(`${a.length}-D input sampling is not yet supported`)}}function Vv(e,t){switch(e.shapeInfo.logicalShape.length){case 0:return aH(e);case 1:return rH(e,t);case 2:return iH(e,t);case 3:return lH(e,t);default:return dH(e,t)}}function FG(e,t,a=!1,n){let r="";a?r+=Vv(e,n):r+=Hu(e,n);let s=e.shapeInfo.logicalShape,i=t.logicalShape;return s.length<=i.length&&(a?r+=mH(e,t):r+=fH(e,t)),r}function DG(e,t,a){switch(e.length){case 0:return Uv();case 1:return jG(e,t,a);case 2:return eH(e,t,a);case 3:return XG(e,t,a);default:return YG(e,t,a)}}function OG(e,t,a){switch(e.length){case 0:return Uv();case 1:return qG(e,t,a);case 2:return tH(e,t,a);case 3:return KG(e,t,a);case 4:return ZG(e,t,a);case 5:return JG(e,t);case 6:return QG(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function zG(e){return` +`,{getBroadcastDims:ow}=I;function NH(e,t,a){let n=[];if(e.forEach(p=>{let h=v.sizeFromShape(p.shapeInfo.logicalShape);if(p.shapeInfo.isUniform?n.push(`uniform float ${p.name}${h>1?`[${h}]`:""};`):(n.push(`uniform sampler2D ${p.name};`),n.push(`uniform int offset${p.name};`)),a.enableShapeUniforms){let{uniformShape:m}=W3(a.packedInputs,p.shapeInfo.logicalShape,p.shapeInfo.texShape);switch(m.length){case 1:n.push(`uniform int ${p.name}Shape;`);break;case 2:n.push(`uniform ivec2 ${p.name}Shape;`);break;case 3:n.push(`uniform ivec3 ${p.name}Shape;`);break;case 4:n.push(`uniform ivec4 ${p.name}Shape;`);break;default:break}n.push(`uniform ivec2 ${p.name}TexShape;`)}}),a.enableShapeUniforms){switch(t.logicalShape.length){case 1:n.push("uniform int outShape;");break;case 2:n.push("uniform ivec2 outShape;"),n.push("uniform int outShapeStrides;");break;case 3:n.push("uniform ivec3 outShape;"),n.push("uniform ivec2 outShapeStrides;");break;case 4:n.push("uniform ivec4 outShape;"),n.push("uniform ivec3 outShapeStrides;");break;default:break}n.push("uniform ivec2 outTexShape;")}a.customUniforms&&a.customUniforms.forEach(p=>{n.push(`uniform ${p.type} ${p.name}${p.arrayIndex?`[${p.arrayIndex}]`:""};`)});let r=n.join(` +`),s=e.map(p=>RH(p,t,a.packedInputs,a.enableShapeUniforms)).join(` +`),i=t.texShape,o=Ra(),l=FH(o),u,d,c=PH(o);return t.isPacked?(u=EH(t.logicalShape,i,a.enableShapeUniforms),d=DH(o)):(u=MH(t.logicalShape,i,a.enableShapeUniforms),d=$H(o)),a.packedInputs&&(c+=LH),[c,l,d,r,u,s,a.userCode].join(` +`)}function Qu(e,t=!1){let a=e.shapeInfo.logicalShape;switch(a.length){case 0:return ZH(e,t);case 1:return QH(e,t);case 2:return tj(e,t);case 3:return nj(e,t);case 4:return sj(e,t);case 5:return ij(e);case 6:return oj(e);default:throw new Error(`${a.length}-D input sampling is not yet supported`)}}function lw(e,t){switch(e.shapeInfo.logicalShape.length){case 0:return YH(e);case 1:return JH(e,t);case 2:return ej(e,t);case 3:return aj(e,t);default:return rj(e,t)}}function RH(e,t,a=!1,n){let r="";a?r+=lw(e,n):r+=Qu(e,n);let s=e.shapeInfo.logicalShape,i=t.logicalShape;return s.length<=i.length&&(a?r+=lj(e,t):r+=uj(e,t)),r}function EH(e,t,a){switch(e.length){case 0:return uw();case 1:return WH(e,t,a);case 2:return XH(e,t,a);case 3:return VH(e,t,a);default:return GH(e,t,a)}}function MH(e,t,a){switch(e.length){case 0:return uw();case 1:return BH(e,t,a);case 2:return KH(e,t,a);case 3:return UH(e,t,a);case 4:return HH(e,t,a);case 5:return jH(e,t);case 6:return qH(e,t);default:throw new Error(`${e.length}-D output sampling is not yet supported`)}}function FH(e){return` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${e.texture2D}(textureSampler, uv).r; } - `}function LG(e){return` + `}function $H(e){return` void setOutput(float val) { ${e.output} = vec4(val, 0, 0, 0); } - `}function WG(e){return` + `}function DH(e){return` void setOutput(vec4 val) { ${e.output} = val; } - `}function BG(e){return`${e.version} + `}function PH(e){return`${e.version} precision highp float; precision highp int; precision highp sampler2D; @@ -217,10 +217,10 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram return fract((p3.x + p3.y) * p3.z); } - ${VG} - ${UG} - ${GG} - `}var VG=` + ${_H} + ${OH} + ${zH} + `}var _H=` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texR = index / texNumC; int texC = index - texR * texNumC; @@ -232,7 +232,7 @@ vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,UG=` +`,OH=` vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texNumC, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); @@ -240,7 +240,7 @@ vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,GG=` +`,zH=` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { @@ -249,7 +249,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int texC = index - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,HG=` +`,LH=` float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? @@ -260,11 +260,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float modCoord = mod(float(dim), 2.); return modCoord == 0. ? frag.r : frag.g; } -`;function Uv(){return` +`;function uw(){return` int getOutputCoords() { return 0; } - `}function jG(e,t,a){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?a?` + `}function WH(e,t,a){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return n[0]===1?a?` int getOutputCoords() { return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0)); } @@ -293,7 +293,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${n[0]}, ${n[1]})); return 2 * (resTexRC.x * ${n[1]} + resTexRC.y); } - `}function qG(e,t,a){return t[0]===1?a?` + `}function BH(e,t,a){return t[0]===1?a?` int getOutputCoords() { return int(resultUV.x * float(outTexShape[1])); } @@ -321,7 +321,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${t[0]}, ${t[1]})); return resTexRC.x * ${t[1]} + resTexRC.y; } - `}function XG(e,t,a){if(a)return` + `}function VH(e,t,a){if(a)return` ivec3 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0)); @@ -352,15 +352,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return ivec3(b, r, c); } - `}function KG(e,t,a){if(a)return` + `}function UH(e,t,a){if(a)return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); int index = resTexRC.x * outTexShape[1] + resTexRC.y; - ${n0(["r","c","d"],e)} + ${d0(["r","c","d"],e)} return ivec3(r, c, d); } -`;let n=tl(["r","c","d"],e);return` +`;let n=dl(["r","c","d"],e);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]})); @@ -368,7 +368,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${n} return ivec3(r, c, d); } - `}function YG(e,t,a){if(a)return` + `}function GH(e,t,a){if(a)return` ivec4 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); ivec2 resTexRC = ivec2(resultUV.yx * @@ -409,15 +409,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return ivec${e.length}(${l}); } - `}function ZG(e,t,a){if(a)return` + `}function HH(e,t,a){if(a)return` ivec4 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); int index = resTexRC.x * outTexShape[1] + resTexRC.y; - ${n0(["r","c","d","d2"],e)} + ${d0(["r","c","d","d2"],e)} return ivec4(r, c, d, d2); } - `;let n=tl(["r","c","d","d2"],e);return` + `;let n=dl(["r","c","d","d2"],e);return` ivec4 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]})); @@ -425,7 +425,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${n} return ivec4(r, c, d, d2); } - `}function JG(e,t){let a=tl(["r","c","d","d2","d3"],e);return` + `}function jH(e,t){let a=dl(["r","c","d","d2","d3"],e);return` ivec5 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]})); @@ -437,7 +437,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ivec5 outShape = ivec5(r, c, d, d2, d3); return outShape; } - `}function QG(e,t){let a=tl(["r","c","d","d2","d3","d4"],e);return` + `}function qH(e,t){let a=dl(["r","c","d","d2","d3","d4"],e);return` ivec6 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${t[0]}, ${t[1]})); @@ -448,7 +448,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ivec6 result = ivec6(r, c, d, d2, d3, d4); return result; } - `}function eH(e,t,a){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(v.arraysEqual(e,t))return a?` + `}function XH(e,t,a){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if(v.arraysEqual(e,t))return a?` ivec2 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); return 2 * ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); @@ -481,7 +481,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return ivec2(r, c); } - `}function tH(e,t,a){return v.arraysEqual(e,t)?a?` + `}function KH(e,t,a){return v.arraysEqual(e,t)?a?` ivec2 getOutputCoords() { return ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); } @@ -535,15 +535,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int c = index - r * ${e[1]}; return ivec2(r, c); } - `}function al(e){return`offset${e}`}function aH(e){let t=e.name,a="get"+t.charAt(0).toUpperCase()+t.slice(1),n=Ra();return` + `}function pl(e){return`offset${e}`}function YH(e){let t=e.name,a="get"+t.charAt(0).toUpperCase()+t.slice(1),n=Ra();return` vec4 ${a}() { return ${n.texture2D}(${t}, halfCR); } - `}function nH(e,t){let a=e.name,n="get"+a.charAt(0).toUpperCase()+a.slice(1);if(e.shapeInfo.isUniform)return`float ${n}() {return ${a};}`;let[r,s]=e.shapeInfo.texShape;if(r===1&&s===1)return` + `}function ZH(e,t){let a=e.name,n="get"+a.charAt(0).toUpperCase()+a.slice(1);if(e.shapeInfo.isUniform)return`float ${n}() {return ${a};}`;let[r,s]=e.shapeInfo.texShape;if(r===1&&s===1)return` float ${n}() { return sampleTexture(${a}, halfCR); } - `;let i=al(a);if(t)return` + `;let i=pl(a);if(t)return` float ${n}() { vec2 uv = uvFromFlat(${a}TexShape[0], ${a}TexShape[1], ${i}); return sampleTexture(${a}, uv); @@ -553,7 +553,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2 uv = uvFromFlat(${o}, ${l}, ${i}); return sampleTexture(${a}, uv); } - `}function rH(e,t){let a=e.name,n="get"+a.charAt(0).toUpperCase()+a.slice(1),r=e.shapeInfo.texShape,s=Ra();if(t)return` + `}function JH(e,t){let a=e.name,n="get"+a.charAt(0).toUpperCase()+a.slice(1),r=e.shapeInfo.texShape,s=Ra();if(t)return` vec4 ${n}(int index) { ivec2 packedTexShape = ivec2(ceil(float(${a}TexShape[0]) / 2.0), ceil(float(${a}TexShape[1]) / 2.0)); vec2 uv = packedUVfrom1D( @@ -566,15 +566,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${i[0]}, ${i[1]}, index); return ${s.texture2D}(${a}, uv); } - `}function sH(e,t){let a=e.name,n="get"+a.charAt(0).toUpperCase()+a.slice(1);if(e.shapeInfo.isUniform)return` + `}function QH(e,t){let a=e.name,n="get"+a.charAt(0).toUpperCase()+a.slice(1);if(e.shapeInfo.isUniform)return` float ${n}(int index) { - ${ju(e)} + ${ed(e)} } `;let r=e.shapeInfo.texShape,s=r[0],i=r[1];if(i===1&&s===1)return` float ${n}(int index) { return sampleTexture(${a}, halfCR); } - `;let o=al(a);return i===1?t?` + `;let o=pl(a);return i===1?t?` float ${n}(int index) { vec2 uv = vec2(0.5, (float(index + ${o}) + 0.5) / float(${a}TexShape[0])); return sampleTexture(${a}, uv); @@ -604,7 +604,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2 uv = uvFromFlat(${s}, ${i}, index + ${o}); return sampleTexture(${a}, uv); } - `}function iH(e,t){let a=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),s=e.shapeInfo.texShape,i=s[0],o=s[1],l=Ra();if(s!=null&&v.arraysEqual(a,s))return t?` + `}function ej(e,t){let a=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),s=e.shapeInfo.texShape,i=s[0],o=s[1],l=Ra();if(s!=null&&v.arraysEqual(a,s))return t?` vec4 ${r}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${n}TexShape[1], ${n}TexShape[0]); @@ -623,32 +623,32 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col); return ${l.texture2D}(${n}, uv); } - `;let u=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)],p=Math.ceil(a[1]/2);return` + `;let u=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)],d=Math.ceil(a[1]/2);return` vec4 ${r}(int row, int col) { - vec2 uv = packedUVfrom2D(${p}, ${u[0]}, ${u[1]}, row, col); + vec2 uv = packedUVfrom2D(${d}, ${u[0]}, ${u[1]}, row, col); return ${l.texture2D}(${n}, uv); } - `}function oH(e,t){let a=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),s=e.shapeInfo.texShape;if(s!=null&&v.arraysEqual(a,s)){if(t)return` + `}function tj(e,t){let a=e.shapeInfo.logicalShape,n=e.name,r="get"+n.charAt(0).toUpperCase()+n.slice(1),s=e.shapeInfo.texShape;if(s!=null&&v.arraysEqual(a,s)){if(t)return` float ${r}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${n}TexShape[1], ${n}TexShape[0]); return sampleTexture(${n}, uv); } - `;let d=s[0],h=s[1];return` + `;let p=s[0],h=s[1];return` float ${r}(int row, int col) { - vec2 uv = (vec2(col, row) + halfCR) / vec2(${h}.0, ${d}.0); + vec2 uv = (vec2(col, row) + halfCR) / vec2(${h}.0, ${p}.0); return sampleTexture(${n}, uv); } - `}let{newShape:i,keptDims:o}=v.squeezeShape(a),l=i;if(l.length=1?p="coords = 0;":p=o.map(g=>`coords.${c[g+u]} = 0;`).join(` -`);let d="";i<2&&s>0?d="coords":d=e.shapeInfo.logicalShape.map((g,y)=>`coords.${c[y+u]}`).join(", ");let h="return outputValue;",m=v.sizeFromShape(e.shapeInfo.logicalShape)===1,f=v.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)h=` + `}function lj(e,t){let a=e.name,n=a.charAt(0).toUpperCase()+a.slice(1),r="get"+n+"AtOutCoords",s=e.shapeInfo.logicalShape.length,i=t.logicalShape.length,o=ow(e.shapeInfo.logicalShape,t.logicalShape),l=ft(i),u=i-s,d,c=["x","y","z","w","u","v"];s===0?d="":i<2&&o.length>=1?d="coords = 0;":d=o.map(g=>`coords.${c[g+u]} = 0;`).join(` +`);let p="";i<2&&s>0?p="coords":p=e.shapeInfo.logicalShape.map((g,y)=>`coords.${c[y+u]}`).join(", ");let h="return outputValue;",m=v.sizeFromShape(e.shapeInfo.logicalShape)===1,f=v.sizeFromShape(t.logicalShape)===1;if(s===1&&!m&&!f)h=` return vec4(outputValue.xy, outputValue.xy); `;else if(m&&!f)i===1?h=` return vec4(outputValue.x, outputValue.x, 0., 0.); @@ -961,24 +961,24 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, `;else if(o.length){let g=s-2,y=s-1;o.indexOf(g)>-1&&o.indexOf(y)>-1?h="return vec4(outputValue.x);":o.indexOf(g)>-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(); - ${p} - vec4 outputValue = get${n}(${d}); + ${d} + vec4 outputValue = get${n}(${p}); ${h} } - `}function fH(e,t){let a=e.name,n=a.charAt(0).toUpperCase()+a.slice(1),r="get"+n+"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&&v.arraysEqual(i,s))return` + `}function uj(e,t){let a=e.name,n=a.charAt(0).toUpperCase()+a.slice(1),r="get"+n+"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&&v.arraysEqual(i,s))return` float ${r}() { return sampleTexture(${a}, resultUV); } - `;let u=mt(l),p=Bv(e.shapeInfo.logicalShape,t.logicalShape),c=l-o,d,h=["x","y","z","w","u","v"];o===0?d="":l<2&&p.length>=1?d="coords = 0;":d=p.map(f=>`coords.${h[f+c]} = 0;`).join(` + `;let u=ft(l),d=ow(e.shapeInfo.logicalShape,t.logicalShape),c=l-o,p,h=["x","y","z","w","u","v"];o===0?p="":l<2&&d.length>=1?p="coords = 0;":p=d.map(f=>`coords.${h[f+c]} = 0;`).join(` `);let m="";return l<2&&o>0?m="coords":m=e.shapeInfo.logicalShape.map((f,g)=>`coords.${h[g+c]}`).join(", "),` float ${r}() { ${u} coords = getOutputCoords(); - ${d} + ${p} return get${n}(${m}); } - `}function mt(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 E3(e,t,a){let{newShape:n,keptDims:r}=v.squeezeShape(t),s=t.length,i=e&&s===3&&t[0]===1,o=i?t.slice(1):n,l=!e&&s>1&&!v.arraysEqual(t,a)&&n.lengthe[a]).join(", ")}function gH(e,t,a,n){let r=a.map((p,c)=>{let d={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&&(d.flatOffset=p.texData.slice.flatOffset),{name:t.variableNames[c],shapeInfo:d}}),s=r.map(p=>p.shapeInfo),i={logicalShape:n.shape,texShape:n.texData.texShape,isUniform:!1,isPacked:n.texData.isPacked,flatOffset:null},o=$G(r,i,t),l=Av(e.gl,o),u=e.createProgram(l);return B().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:s,outShapeInfo:i,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:s,outShapeInfo:i},Gv(e,t,u)))}function Gv(e,t,a){let n=[],r=[],s,i,o,l=null,u=null;u=e.getUniformLocation(a,"NAN",!1),B().getNumber("WEBGL_VERSION")===1&&(l=e.getUniformLocation(a,"INFINITY",!1));let p=!1;for(let c of t.variableNames){let d={name:c,uniform:e.getUniformLocation(a,c,p),offset:e.getUniformLocation(a,`offset${c}`,p)};t.enableShapeUniforms&&(d.shape=e.getUniformLocation(a,`${c}Shape`,p),d.texShape=e.getUniformLocation(a,`${c}TexShape`,p)),n.push(d)}if(t.enableShapeUniforms&&(s=e.getUniformLocation(a,"outShape",p),o=e.getUniformLocation(a,"outShapeStrides",p),i=e.getUniformLocation(a,"outTexShape",p)),t.customUniforms)for(let c of t.customUniforms)r.push(e.getUniformLocation(a,c.name,p));return{variablesLocations:n,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:o,outTexShapeLocation:i}}function w5(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach((a,n)=>{let r=a.logicalShape,s=t[n],i=s.shape;if(!v.arraysEqual(r,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${r} and ${i} must match`);if(a.isUniform&&s.isUniform)return;let o=a.texShape,l=s.isUniform?null:s.texData.texShape;if(!v.arraysEqual(o,l))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${l} must match`)})}function yH(e,t,a,n,r){t.program.enableShapeUniforms||(w5(t.inShapeInfos,a),w5([t.outShapeInfo],[n]));let s=n.texData.texture,i=n.texData.texShape;n.texData.isPacked?e.setOutputPackedMatrixTexture(s.texture,i[0],i[1]):e.setOutputMatrixTexture(s.texture,i[0],i[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),B().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,1/0),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN);for(let l=0;l{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!i.isUniform){let l=i.texData.texShape,{useSqueezeShape:u,uniformShape:p,keptDims:c}=E3(e.packedInputs,i.shape,l),d="",h="",m="";if(p.length===1&&e.packedInputs){let w=[Math.ceil(l[0]/2),Math.ceil(l[1]/2)];d=`${w[0]>1}_${w[1]>1}`}else if(p.length===2&&!e.packedInputs)h=`${p[0]>1}_${p[1]>1}`;else if(p.length>2&&!e.packedInputs){let w=v.computeStrides(p);m=`${w[0]===l[1]}_${w[w.length-1]===l[1]}`}let f=i.shape.length,g=p.length===2&&v.arraysEqual(i.shape,l),y=v.sizeFromShape(i.shape)===1,x=C.getBroadcastDims(i.shape,a.shape),A=!e.packedInputs&&f===a.shape.length&&v.arraysEqual(l,a.texData.texShape),b=e.packedInputs||p.length>2?"":`${l[0]>1}_${l[1]>1}`;n+=`${f}_${A}_${u?c:""}_${p.length}_${y}_${x}_${g}_${d}_${h}_${m}_${b}_${o}`}else{let l=i.isUniform?"uniform":i.texData.texShape;n+=`${i.shape}_${l}_${o}`}});let r=e.userCode,s=e.constructor.name;return s+="_"+n+"_"+r+`${B().getNumber("WEBGL_VERSION")}`,s}function ga(e){return B().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}var AH=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=Yd.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=Ra();this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` + `}function ft(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 W3(e,t,a){let{newShape:n,keptDims:r}=v.squeezeShape(t),s=t.length,i=e&&s===3&&t[0]===1,o=i?t.slice(1):n,l=!e&&s>1&&!v.arraysEqual(t,a)&&n.lengthe[a]).join(", ")}function dj(e,t,a,n){let r=a.map((d,c)=>{let p={logicalShape:d.shape,texShape:d.isUniform?null:d.texData.texShape,isUniform:d.isUniform,isPacked:d.isUniform?!1:d.texData.isPacked,flatOffset:null};return d.texData!=null&&d.texData.slice!=null&&d.texData.slice.flatOffset>0&&(p.flatOffset=d.texData.slice.flatOffset),{name:t.variableNames[c],shapeInfo:p}}),s=r.map(d=>d.shapeInfo),i={logicalShape:n.shape,texShape:n.texData.texShape,isUniform:!1,isPacked:n.texData.isPacked,flatOffset:null},o=NH(r,i,t),l=Lv(e.gl,o),u=e.createProgram(l);return B().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:s,outShapeInfo:i,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(u),Object.assign({program:t,fragmentShader:l,source:o,webGLProgram:u,inShapeInfos:s,outShapeInfo:i},dw(e,t,u)))}function dw(e,t,a){let n=[],r=[],s,i,o,l=null,u=null;u=e.getUniformLocation(a,"NAN",!1),B().getNumber("WEBGL_VERSION")===1&&(l=e.getUniformLocation(a,"INFINITY",!1));let d=!1;for(let c of t.variableNames){let p={name:c,uniform:e.getUniformLocation(a,c,d),offset:e.getUniformLocation(a,`offset${c}`,d)};t.enableShapeUniforms&&(p.shape=e.getUniformLocation(a,`${c}Shape`,d),p.texShape=e.getUniformLocation(a,`${c}TexShape`,d)),n.push(p)}if(t.enableShapeUniforms&&(s=e.getUniformLocation(a,"outShape",d),o=e.getUniformLocation(a,"outShapeStrides",d),i=e.getUniformLocation(a,"outTexShape",d)),t.customUniforms)for(let c of t.customUniforms)r.push(e.getUniformLocation(a,c.name,d));return{variablesLocations:n,customUniformLocations:r,infLoc:l,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:o,outTexShapeLocation:i}}function _5(e,t){if(e.length!==t.length)throw Error(`Binary was compiled with ${e.length} inputs, but was executed with ${t.length} inputs`);e.forEach((a,n)=>{let r=a.logicalShape,s=t[n],i=s.shape;if(!v.arraysEqual(r,i))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${r} and ${i} must match`);if(a.isUniform&&s.isUniform)return;let o=a.texShape,l=s.isUniform?null:s.texData.texShape;if(!v.arraysEqual(o,l))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${o} and ${l} must match`)})}function pj(e,t,a,n,r){t.program.enableShapeUniforms||(_5(t.inShapeInfos,a),_5([t.outShapeInfo],[n]));let s=n.texData.texture,i=n.texData.texShape;n.texData.isPacked?e.setOutputPackedMatrixTexture(s.texture,i[0],i[1]):e.setOutputMatrixTexture(s.texture,i[0],i[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),B().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&e.gl.uniform1f(t.infLoc,1/0),t.nanLoc!==null&&e.gl.uniform1f(t.nanLoc,NaN);for(let l=0;l{let o=i.texData!=null&&i.texData.slice!=null&&i.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!i.isUniform){let l=i.texData.texShape,{useSqueezeShape:u,uniformShape:d,keptDims:c}=W3(e.packedInputs,i.shape,l),p="",h="",m="";if(d.length===1&&e.packedInputs){let w=[Math.ceil(l[0]/2),Math.ceil(l[1]/2)];p=`${w[0]>1}_${w[1]>1}`}else if(d.length===2&&!e.packedInputs)h=`${d[0]>1}_${d[1]>1}`;else if(d.length>2&&!e.packedInputs){let w=v.computeStrides(d);m=`${w[0]===l[1]}_${w[w.length-1]===l[1]}`}let f=i.shape.length,g=d.length===2&&v.arraysEqual(i.shape,l),y=v.sizeFromShape(i.shape)===1,x=I.getBroadcastDims(i.shape,a.shape),A=!e.packedInputs&&f===a.shape.length&&v.arraysEqual(l,a.texData.texShape),b=e.packedInputs||d.length>2?"":`${l[0]>1}_${l[1]>1}`;n+=`${f}_${A}_${u?c:""}_${d.length}_${y}_${x}_${g}_${p}_${h}_${m}_${b}_${o}`}else{let l=i.isUniform?"uniform":i.texData.texShape;n+=`${i.shape}_${l}_${o}`}});let r=e.userCode,s=e.constructor.name;return s+="_"+n+"_"+r+`${B().getNumber("WEBGL_VERSION")}`,s}function ga(e){return B().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}var hj=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=sp.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=Ra();this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${this.enableShapeUniforms?n0(["r","c","d"],e):tl(["r","c","d"],e)} + ${this.enableShapeUniforms?d0(["r","c","d"],e):dl(["r","c","d"],e)} return ivec3(r, c, d); } @@ -996,9 +996,9 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${t.output} = result; } - `}},bH=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=Yd.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=Ra();this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` + `}},mj=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=sp.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=Ra();this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${this.enableShapeUniforms?n0(["r","c","d"],e):tl(["r","c","d"],e)} + ${this.enableShapeUniforms?d0(["r","c","d"],e):dl(["r","c","d"],e)} return ivec3(r, c, d); } @@ -1016,26 +1016,26 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${t.output} = result; } - `}},vH=class{constructor(e){this.variableNames=["A"],this.outTexUsage=hn.DOWNLOAD;let t=Ra();this.outputShape=e,this.userCode=` - ${Wv} + `}},fj=class{constructor(e){this.variableNames=["A"],this.outTexUsage=gn.DOWNLOAD;let t=Ra();this.outputShape=e,this.userCode=` + ${iw} void main() { float x = getAAtOutCoords(); ${t.output} = encode_float(x); } - `}},wH=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=hn.DOWNLOAD;let t=Ra();this.outputShape=e,this.userCode=` - ${Wv} + `}},gj=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=gn.DOWNLOAD;let t=Ra();this.outputShape=e,this.userCode=` + ${iw} void main() { ivec3 coords = getOutputCoords(); float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); ${t.output} = encode_float(x); } - `}},kH={R:0,G:1,B:2,A:3},k5=class{constructor(e,t=!1,a="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];let n=Ra();this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length);let r="result";t&&(r="floor(result * 255. + 0.5)");let s="";for(let i=0;ie8,createBufferFromOutputTexture:()=>n8,createFloat16MatrixTexture:()=>Yv,createFloat16PackedMatrixTexture:()=>Qv,createFloat32MatrixTexture:()=>Kv,createIndexBuffer:()=>Xv,createPackedMatrixTexture:()=>Jv,createUnsignedBytesMatrixTexture:()=>Zv,createVertexBuffer:()=>qv,createVertexShader:()=>jv,downloadByteEncodedFloatMatrixFromOutputTexture:()=>s8,downloadFloat32MatrixFromBuffer:()=>r8,downloadMatrixFromPackedOutputTexture:()=>o8,downloadPackedMatrixFromBuffer:()=>i8,getInternalFormatForFloat16MatrixTexture:()=>P3,getInternalFormatForFloat16PackedMatrixTexture:()=>F3,getInternalFormatForFloat32MatrixTexture:()=>M3,getInternalFormatForPackedMatrixTexture:()=>$3,getInternalFormatForUnsignedBytesMatrixTexture:()=>_3,uploadDenseMatrixToTexture:()=>t8,uploadPixelDataToTexture:()=>a8});function jv(e){let t=Ra(),a=`${t.version} + `}},pw={};Ke(pw,{bindVertexProgramAttributeStreams:()=>bw,createBufferFromOutputTexture:()=>kw,createFloat16MatrixTexture:()=>gw,createFloat16PackedMatrixTexture:()=>Aw,createFloat32MatrixTexture:()=>fw,createIndexBuffer:()=>mw,createPackedMatrixTexture:()=>xw,createUnsignedBytesMatrixTexture:()=>yw,createVertexBuffer:()=>hw,createVertexShader:()=>cw,downloadByteEncodedFloatMatrixFromOutputTexture:()=>Sw,downloadFloat32MatrixFromBuffer:()=>Iw,downloadMatrixFromPackedOutputTexture:()=>Cw,downloadPackedMatrixFromBuffer:()=>Tw,getInternalFormatForFloat16MatrixTexture:()=>V3,getInternalFormatForFloat16PackedMatrixTexture:()=>H3,getInternalFormatForFloat32MatrixTexture:()=>B3,getInternalFormatForPackedMatrixTexture:()=>G3,getInternalFormatForUnsignedBytesMatrixTexture:()=>U3,uploadDenseMatrixToTexture:()=>vw,uploadPixelDataToTexture:()=>ww});function cw(e){let t=Ra(),a=`${t.version} precision highp float; ${t.attribute} vec3 clipSpacePos; ${t.attribute} vec2 uv; @@ -1107,11 +1107,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, void main() { gl_Position = vec4(clipSpacePos, 1); resultUV = uv; - }`;return xv(e,a)}function qv(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 wv(e,t)}function Xv(e){let t=new Uint16Array([0,1,2,2,1,3]);return kv(e,t)}function Kp(e,t,a,n,r,s){Sv(t,a);let i=Iv(e),o=e.TEXTURE_2D;return ce(e,()=>e.bindTexture(o,i)),ce(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),ce(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),ce(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),ce(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),B().getNumber("WEBGL_VERSION")===1?ce(e,()=>e.texImage2D(o,0,n,t,a,0,r,s,null)):ce(e,()=>e.texStorage2D(o,1,n,t,a)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null)),{texture:i,texShape:[a,t]}}function M3(e){return e.internalFormatFloat}function Kv(e,t,a,n){let[r,s]=Xp(t,a);return Kp(e,r,s,M3(n),n.textureFormatFloat,e.FLOAT)}function P3(e){return e.internalFormatHalfFloat}function Yv(e,t,a,n){let[r,s]=Xp(t,a);return Kp(e,r,s,P3(n),n.textureFormatFloat,n.textureTypeHalfFloat)}function _3(e){return e.downloadTextureFormat}function Zv(e,t,a,n){let[r,s]=Xp(t,a);return Kp(e,r,s,_3(n),e.RGBA,e.UNSIGNED_BYTE)}function $3(e){return e.internalFormatPackedFloat}function Jv(e,t,a,n){let[r,s]=Uu(t,a);return Kp(e,r,s,$3(n),e.RGBA,e.FLOAT)}function F3(e){return e.internalFormatPackedHalfFloat}function Qv(e,t,a,n){let[r,s]=Uu(t,a);return Kp(e,r,s,F3(n),e.RGBA,n.textureTypeHalfFloat)}function e8(e,t,a){return ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),$1(e,t,"clipSpacePos",a,3,20,0)&&$1(e,t,"uv",a,2,20,12)}function t8(e,t,a,n,r,s){ce(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,l;r instanceof Uint8Array?(i=new Uint8Array(a*n*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(a*n*4),o=e.FLOAT,l=s.internalFormatPackedFloat),i.set(r),B().getNumber("WEBGL_VERSION")===2?ce(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,a,n,e.RGBA,o,i)):ce(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,a,n,0,e.RGBA,o,i)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function a8(e,t,a){ce(e,()=>e.bindTexture(e.TEXTURE_2D,t)),a.data instanceof Uint8Array?B().getNumber("WEBGL_VERSION")===2?ce(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,a.width,a.height,e.RGBA,e.UNSIGNED_BYTE,a.data)):ce(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,a.width,a.height,0,e.RGBA,e.UNSIGNED_BYTE,a.data)):B().getNumber("WEBGL_VERSION")===2?ce(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,a)):ce(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function n8(e,t,a,n){let r=e.createBuffer();ce(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));let s=4*4*t*a;return ce(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),ce(e,()=>e.readPixels(0,0,a,t,e.RGBA,e.FLOAT,0)),ce(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function r8(e,t,a){let n=e,r=new Float32Array(a);return n.bindBuffer(n.PIXEL_PACK_BUFFER,t),n.getBufferSubData(n.PIXEL_PACK_BUFFER,0,r),n.bindBuffer(n.PIXEL_PACK_BUFFER,null),r}function s8(e,t,a,n){let[r,s]=Xp(t,a),i=4,o=new Uint8Array(bG(t*a,i));return ce(e,()=>e.readPixels(0,0,r,s,n.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function i8(e,t,a,n,r,s,i,o){let l=e,u=new Float32Array(vG(s,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function o8(e,t,a){let n=new Float32Array(t*a*4);return ce(e,()=>e.readPixels(0,0,a,t,e.RGBA,e.FLOAT,n)),n}var Vl=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];let t=B().getNumber("WEBGL_VERSION");if(e!=null?(this.gl=e,a0(t,e)):this.gl=Wn(t),e=this.gl,B().getNumber("WEBGL_VERSION")===2){let r=e;this.createVertexArray=()=>ce(r,()=>r.createVertexArray()),this.bindVertexArray=s=>ce(r,()=>r.bindVertexArray(s)),this.deleteVertexArray=s=>ce(r,()=>r.deleteVertexArray(s)),this.getVertexArray=()=>ce(r,()=>r.getParameter(r.VERTEX_ARRAY_BINDING))}else if(e!=null){let r=e.getExtension("OES_vertex_array_object");if(r==null)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>ce(e,()=>r.createVertexArrayOES()),this.bindVertexArray=s=>ce(e,()=>r.bindVertexArrayOES(s)),this.deleteVertexArray=s=>ce(e,()=>r.deleteVertexArrayOES(s)),this.getVertexArray=()=>ce(e,()=>e.getParameter(r.VERTEX_ARRAY_BINDING_OES))}let a="WEBGL_color_buffer_float",n="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),B().getNumber("WEBGL_VERSION")===1){let r="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=Cd(this.gl,r),mn(this.gl,s))this.textureHalfFloatExtension=Cd(this.gl,s);else if(B().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(a),mn(this.gl,n))this.colorBufferHalfFloatExtension=Cd(this.gl,n);else if(B().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(a="EXT_color_buffer_float",mn(this.gl,a))this.colorBufferFloatExtension=this.gl.getExtension(a);else if(mn(this.gl,n))this.colorBufferHalfFloatExtension=this.gl.getExtension(n);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=qv(this.gl),this.indexBuffer=Xv(this.gl),this.framebuffer=Cv(this.gl),this.textureConfig=C3(this.gl,this.textureHalfFloatExtension)}get debug(){return B().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;ce(e,()=>e.finish()),ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),ce(e,()=>e.deleteFramebuffer(this.framebuffer)),ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),ce(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),Kv(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),Yv(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),Zv(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),a8(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,a,n){this.throwIfDisposed(),t8(this.gl,e,t,a,n,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),Qv(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),Jv(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(F1(this.gl,this.framebuffer),this.outputTexture=null),ce(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,a){return this.downloadMatrixDriver(e,()=>s8(this.gl,t,a,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,a,n,r,s){return i8(this.gl,e,t,a,n,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return r8(this.gl,e,t)}createBufferFromTexture(e,t,a){this.bindTextureToFrameBuffer(e);let n=n8(this.gl,t,a,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,a;if(B().getBool("WEBGL_FENCE_API_ENABLED")){let n=e,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),a=()=>{let s=n.clientWaitSync(r,0,0);return s===n.ALREADY_SIGNALED||s===n.CONDITION_SATISFIED},t=r}else B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),a=()=>this.isQueryAvailable(t,B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):a=()=>!0;return{query:t,isFencePassed:a}}downloadMatrixFromPackedTexture(e,t,a){return this.downloadMatrixDriver(e,()=>o8(this.gl,t,a))}createProgram(e){this.throwIfDisposed();let t=this.gl;this.vertexShader==null&&(this.vertexShader=jv(t));let a=bv(t);ce(t,()=>t.attachShader(a,this.vertexShader)),ce(t,()=>t.attachShader(a,e)),vv(t,a);let n=Object.assign(a,{vao:this.createVertexArray()});return this.debug&&th(t,n),n}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);let t=this.gl;ce(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),e8(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&(ce(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&th(this.gl,this.program),ce(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,a=!0){return this.throwIfDisposed(),a?Nv(this.gl,e,t):Rv(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),ce(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,a){this.throwIfDisposed(),this.throwIfNoProgram(),Ev(this.gl,e,t,a)}setOutputMatrixTexture(e,t,a){this.setOutputMatrixTextureDriver(e,a,t)}setOutputPackedMatrixTexture(e,t,a){this.throwIfDisposed();let[n,r]=Uu(t,a);this.setOutputMatrixTextureDriver(e,n,r)}setOutputMatrixWriteRegion(e,t,a,n){this.setOutputMatrixWriteRegionDriver(a,e,n,t)}setOutputPackedMatrixWriteRegion(e,t,a,n){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&th(this.gl,this.program),Td(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;if(this.debug){let t=this.getVertexArray();console.assert(t===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}ce(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),ce(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=Cd(this.gl,B().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(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let a=this.gl,n=this.getQueryTimerExtensionWebGL2(),r=a.createQuery();return a.beginQuery(n.TIME_ELAPSED_EXT,r),r}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,a=this.getQueryTimerExtensionWebGL2();t.endQuery(a.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await v.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let a=this.gl;return a.getQueryParameter(e,a.QUERY_RESULT)/1e6}else{let a=this.getQueryTimerExtensionWebGL1();return a.getQueryObjectEXT(e,a.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let a=this.gl,n=this.getQueryTimerExtensionWebGL2(),r=a.getQueryParameter(e,a.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),r&&!this.disjoint}else{let a=this.getQueryTimerExtensionWebGL1(),n=a.getQueryObjectEXT(e,a.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(a.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=SH(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:a}=this.itemsToPoll[t];a()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let a;"setTimeoutCustom"in B().platform&&(a=B().platform.setTimeoutCustom.bind(B().platform)),v.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,a)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),ah(this.gl,e,this.framebuffer),this.debug&&Td(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(ah(this.gl,this.outputTexture,this.framebuffer),this.debug&&Td(this.gl)):F1(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let a=t();return this.unbindTextureToFrameBuffer(),a}setOutputMatrixTextureDriver(e,t,a){this.throwIfDisposed();let n=this.gl;ah(n,e,this.framebuffer),this.debug&&Td(n),this.outputTexture=e,ce(n,()=>n.viewport(0,0,t,a)),ce(n,()=>n.scissor(0,0,t,a))}setOutputMatrixWriteRegionDriver(e,t,a,n){this.throwIfDisposed(),ce(this.gl,()=>this.gl.scissor(e,t,a,n))}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 SH(e){let t=0;for(;t`${e}.${a}`)}function ka(e,t){return t===1?[e]:p8(e,t)}function yj(e,t){if(e===1)return"rc";let a="";for(let n=0;ne.bindTexture(o,i)),ce(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),ce(e,()=>e.texParameteri(o,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),ce(e,()=>e.texParameteri(o,e.TEXTURE_MIN_FILTER,e.NEAREST)),ce(e,()=>e.texParameteri(o,e.TEXTURE_MAG_FILTER,e.NEAREST)),B().getNumber("WEBGL_VERSION")===1?ce(e,()=>e.texImage2D(o,0,n,t,a,0,r,s,null)):ce(e,()=>e.texStorage2D(o,1,n,t,a)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null)),{texture:i,texShape:[a,t]}}function B3(e){return e.internalFormatFloat}function fw(e,t,a,n){let[r,s]=ac(t,a);return nc(e,r,s,B3(n),n.textureFormatFloat,e.FLOAT)}function V3(e){return e.internalFormatHalfFloat}function gw(e,t,a,n){let[r,s]=ac(t,a);return nc(e,r,s,V3(n),n.textureFormatFloat,n.textureTypeHalfFloat)}function U3(e){return e.downloadTextureFormat}function yw(e,t,a,n){let[r,s]=ac(t,a);return nc(e,r,s,U3(n),e.RGBA,e.UNSIGNED_BYTE)}function G3(e){return e.internalFormatPackedFloat}function xw(e,t,a,n){let[r,s]=Zu(t,a);return nc(e,r,s,G3(n),e.RGBA,e.FLOAT)}function H3(e){return e.internalFormatPackedHalfFloat}function Aw(e,t,a,n){let[r,s]=Zu(t,a);return nc(e,r,s,H3(n),e.RGBA,n.textureTypeHalfFloat)}function bw(e,t,a){return ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,a)),B1(e,t,"clipSpacePos",a,3,20,0)&&B1(e,t,"uv",a,2,20,12)}function vw(e,t,a,n,r,s){ce(e,()=>e.bindTexture(e.TEXTURE_2D,t));let i,o,l;r instanceof Uint8Array?(i=new Uint8Array(a*n*4),o=e.UNSIGNED_BYTE,l=e.RGBA):(i=new Float32Array(a*n*4),o=e.FLOAT,l=s.internalFormatPackedFloat),i.set(r),B().getNumber("WEBGL_VERSION")===2?ce(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,a,n,e.RGBA,o,i)):ce(e,()=>e.texImage2D(e.TEXTURE_2D,0,l,a,n,0,e.RGBA,o,i)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function ww(e,t,a){ce(e,()=>e.bindTexture(e.TEXTURE_2D,t)),a.data instanceof Uint8Array?B().getNumber("WEBGL_VERSION")===2?ce(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,a.width,a.height,e.RGBA,e.UNSIGNED_BYTE,a.data)):ce(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,a.width,a.height,0,e.RGBA,e.UNSIGNED_BYTE,a.data)):B().getNumber("WEBGL_VERSION")===2?ce(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,a)):ce(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a)),ce(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function kw(e,t,a,n){let r=e.createBuffer();ce(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,r));let s=4*4*t*a;return ce(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,s,e.STREAM_READ)),ce(e,()=>e.readPixels(0,0,a,t,e.RGBA,e.FLOAT,0)),ce(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),r}function Iw(e,t,a){let n=e,r=new Float32Array(a);return n.bindBuffer(n.PIXEL_PACK_BUFFER,t),n.getBufferSubData(n.PIXEL_PACK_BUFFER,0,r),n.bindBuffer(n.PIXEL_PACK_BUFFER,null),r}function Sw(e,t,a,n){let[r,s]=ac(t,a),i=4,o=new Uint8Array(mH(t*a,i));return ce(e,()=>e.readPixels(0,0,r,s,n.downloadTextureFormat,e.UNSIGNED_BYTE,o)),new Float32Array(o.buffer)}function Tw(e,t,a,n,r,s,i,o){let l=e,u=new Float32Array(fH(s,i));return l.bindBuffer(l.PIXEL_PACK_BUFFER,t),l.getBufferSubData(l.PIXEL_PACK_BUFFER,0,u),l.bindBuffer(l.PIXEL_PACK_BUFFER,null),u}function Cw(e,t,a){let n=new Float32Array(t*a*4);return ce(e,()=>e.readPixels(0,0,a,t,e.RGBA,e.FLOAT,n)),n}var Yl=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];let t=B().getNumber("WEBGL_VERSION");if(e!=null?(this.gl=e,u0(t,e)):this.gl=Un(t),e=this.gl,B().getNumber("WEBGL_VERSION")===2){let r=e;this.createVertexArray=()=>ce(r,()=>r.createVertexArray()),this.bindVertexArray=s=>ce(r,()=>r.bindVertexArray(s)),this.deleteVertexArray=s=>ce(r,()=>r.deleteVertexArray(s)),this.getVertexArray=()=>ce(r,()=>r.getParameter(r.VERTEX_ARRAY_BINDING))}else if(e!=null){let r=e.getExtension("OES_vertex_array_object");if(r==null)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>ce(e,()=>r.createVertexArrayOES()),this.bindVertexArray=s=>ce(e,()=>r.bindVertexArrayOES(s)),this.deleteVertexArray=s=>ce(e,()=>r.deleteVertexArrayOES(s)),this.getVertexArray=()=>ce(e,()=>e.getParameter(r.VERTEX_ARRAY_BINDING_OES))}let a="WEBGL_color_buffer_float",n="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),B().getNumber("WEBGL_VERSION")===1){let r="OES_texture_float",s="OES_texture_half_float";if(this.textureFloatExtension=Dd(this.gl,r),yn(this.gl,s))this.textureHalfFloatExtension=Dd(this.gl,s);else if(B().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(a),yn(this.gl,n))this.colorBufferHalfFloatExtension=Dd(this.gl,n);else if(B().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(a="EXT_color_buffer_float",yn(this.gl,a))this.colorBufferFloatExtension=this.gl.getExtension(a);else if(yn(this.gl,n))this.colorBufferHalfFloatExtension=this.gl.getExtension(n);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=hw(this.gl),this.indexBuffer=mw(this.gl),this.framebuffer=jv(this.gl),this.textureConfig=_3(this.gl,this.textureHalfFloatExtension)}get debug(){return B().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;ce(e,()=>e.finish()),ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),ce(e,()=>e.deleteFramebuffer(this.framebuffer)),ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),ce(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),fw(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),gw(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),yw(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),ww(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,a,n){this.throwIfDisposed(),vw(this.gl,e,t,a,n,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),Aw(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),xw(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(V1(this.gl,this.framebuffer),this.outputTexture=null),ce(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,a){return this.downloadMatrixDriver(e,()=>Sw(this.gl,t,a,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,a,n,r,s){return Tw(this.gl,e,t,a,n,r,s,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return Iw(this.gl,e,t)}createBufferFromTexture(e,t,a){this.bindTextureToFrameBuffer(e);let n=kw(this.gl,t,a,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,a;if(B().getBool("WEBGL_FENCE_API_ENABLED")){let n=e,r=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),a=()=>{let s=n.clientWaitSync(r,0,0);return s===n.ALREADY_SIGNALED||s===n.CONDITION_SATISFIED},t=r}else B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),a=()=>this.isQueryAvailable(t,B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):a=()=>!0;return{query:t,isFencePassed:a}}downloadMatrixFromPackedTexture(e,t,a){return this.downloadMatrixDriver(e,()=>Cw(this.gl,t,a))}createProgram(e){this.throwIfDisposed();let t=this.gl;this.vertexShader==null&&(this.vertexShader=cw(t));let a=Wv(t);ce(t,()=>t.attachShader(a,this.vertexShader)),ce(t,()=>t.attachShader(a,e)),Bv(t,a);let n=Object.assign(a,{vao:this.createVertexArray()});return this.debug&&uh(t,n),n}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);let t=this.gl;ce(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),bw(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&(ce(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&uh(this.gl,this.program),ce(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,a=!0){return this.throwIfDisposed(),a?Xv(this.gl,e,t):Kv(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),ce(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,a){this.throwIfDisposed(),this.throwIfNoProgram(),Yv(this.gl,e,t,a)}setOutputMatrixTexture(e,t,a){this.setOutputMatrixTextureDriver(e,a,t)}setOutputPackedMatrixTexture(e,t,a){this.throwIfDisposed();let[n,r]=Zu(t,a);this.setOutputMatrixTextureDriver(e,n,r)}setOutputMatrixWriteRegion(e,t,a,n){this.setOutputMatrixWriteRegionDriver(a,e,n,t)}setOutputPackedMatrixWriteRegion(e,t,a,n){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&uh(this.gl,this.program),Pd(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;if(this.debug){let t=this.getVertexArray();console.assert(t===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}ce(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),ce(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=Dd(this.gl,B().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(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let a=this.gl,n=this.getQueryTimerExtensionWebGL2(),r=a.createQuery();return a.beginQuery(n.TIME_ELAPSED_EXT,r),r}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,a=this.getQueryTimerExtensionWebGL2();t.endQuery(a.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await v.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let a=this.gl;return a.getQueryParameter(e,a.QUERY_RESULT)/1e6}else{let a=this.getQueryTimerExtensionWebGL1();return a.getQueryObjectEXT(e,a.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let a=this.gl,n=this.getQueryTimerExtensionWebGL2(),r=a.getQueryParameter(e,a.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),r&&!this.disjoint}else{let a=this.getQueryTimerExtensionWebGL1(),n=a.getQueryObjectEXT(e,a.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(a.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=Aj(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:a}=this.itemsToPoll[t];a()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let a;"setTimeoutCustom"in B().platform&&(a=B().platform.setTimeoutCustom.bind(B().platform)),v.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,a)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),dh(this.gl,e,this.framebuffer),this.debug&&Pd(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(dh(this.gl,this.outputTexture,this.framebuffer),this.debug&&Pd(this.gl)):V1(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let a=t();return this.unbindTextureToFrameBuffer(),a}setOutputMatrixTextureDriver(e,t,a){this.throwIfDisposed();let n=this.gl;dh(n,e,this.framebuffer),this.debug&&Pd(n),this.outputTexture=e,ce(n,()=>n.viewport(0,0,t,a)),ce(n,()=>n.scissor(0,0,t,a))}setOutputMatrixWriteRegionDriver(e,t,a,n){this.throwIfDisposed(),ce(this.gl,()=>this.gl.scissor(e,t,a,n))}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 Aj(e){let t=0;for(;t`${e}.${a}`)}function ka(e,t){return t===1?[e]:Mw(e,t)}function pq(e,t){if(e===1)return"rc";let a="";for(let n=0;n= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${t[0]}), cEdge ? 0. : getA(${t[1]}), rEdge ? 0. : getA(${t[2]}), - rEdge || cEdge ? 0. : getA(${t[3]})`}},c8=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length);let a="";for(let n=0;n<4;n++){let r="thisRC = rc;";n%2===1&&(r+="thisRC.z += 1;"),n>1&&(r+="thisRC.y += 1;"),a+=` + rEdge || cEdge ? 0. : getA(${t[3]})`}},Fw=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length);let a="";for(let n=0;n<4;n++){let r="thisRC = rc;";n%2===1&&(r+="thisRC.z += 1;"),n>1&&(r+="thisRC.y += 1;"),a+=` ${r} ${n>0?"if(thisRC.y < rows && thisRC.z < cols){":""} int flatIndex = getFlatIndex(thisRC); @@ -1146,8 +1146,8 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); ${n>0?"}":""} `}this.userCode=` - ${Aj(t,this.enableShapeUniforms)} - ${this.enableShapeUniforms?R3():N3(e)} + ${hq(t,this.enableShapeUniforms)} + ${this.enableShapeUniforms?L3():z3(e)} void main() { ivec3 rc = getOutputCoords(); @@ -1162,12 +1162,12 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function Aj(e,t){return` + `}};function hq(e,t){return` ivec3 inputCoordsFromReshapedOutCoords(int index) { - ${t?_G(["r","c","d"],"inputShape"):tl(["r","c","d"],e)} + ${t?CH(["r","c","d"],"inputShape"):dl(["r","c","d"],e)} return ivec3(r, c, d); } - `}var bj=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,a){let n=S5(t,a),r=C5(e,n,a);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);let s=I5(e,n,this.gpgpu.gl,this.gpgpu.textureConfig,a);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[r].pop();return this.usedTextures[r].push(o),o}let i;return n===ua.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):n===ua.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):n===ua.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):n===ua.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):n===ua.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,a,n){if(this.freeTextures==null)return;let r=S5(a,n),s=C5(t,r,n);s in this.freeTextures||(this.freeTextures[s]=[]);let i=I5(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,n),o=B().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let l=this.usedTextures[s],u=l&&l.indexOf(e);if(u==null||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),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.texture)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function vj(e,t){let a=e;if(t===a.R32F)return 4;if(t===a.R16F)return 2;if(t===a.RGBA32F||t===e.RGBA)return 16;if(t===a.RGBA16F)return 8;if(t===a.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}function I5(e,t,a,n,r){let s=wj(t,n),i;if(r){let[l,u]=Uu(e[0],e[1]);i=l*u}else{let[l,u]=Xp(e[0],e[1]);i=l*u}let o=vj(a,s);return i*o}function wj(e,t){switch(e){case ua.PACKED_2X2_FLOAT32:return $3(t);case ua.PACKED_2X2_FLOAT16:return F3(t);case ua.UNPACKED_FLOAT32:return M3(t);case ua.UNPACKED_FLOAT16:return P3(t);case ua.PACKED_4X1_UNSIGNED_BYTE:return _3(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function kj(e){return B().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?ua.PACKED_2X2_FLOAT32:ua.UNPACKED_FLOAT32:e?ua.PACKED_2X2_FLOAT16:ua.UNPACKED_FLOAT16}function S5(e,t){if(e===hn.UPLOAD)return ua.PACKED_2X2_FLOAT32;if(e===hn.RENDER||e==null)return kj(t);if(e===hn.DOWNLOAD||e===hn.PIXELS)return ua.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function C5(e,t,a){return`${e[0]}_${e[1]}_${t}_${a}`}var Kn=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` + `}var mq=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,a){let n=L5(t,a),r=W5(e,n,a);r in this.freeTextures||(this.freeTextures[r]=[]),r in this.usedTextures||(this.usedTextures[r]=[]);let s=z5(e,n,this.gpgpu.gl,this.gpgpu.textureConfig,a);if(this.freeTextures[r].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=s,this.log();let o=this.freeTextures[r].pop();return this.usedTextures[r].push(o),o}let i;return n===pa.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):n===pa.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):n===pa.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):n===pa.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):n===pa.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,a,n){if(this.freeTextures==null)return;let r=L5(a,n),s=W5(t,r,n);s in this.freeTextures||(this.freeTextures[s]=[]);let i=z5(t,r,this.gpgpu.gl,this.gpgpu.textureConfig,n),o=B().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");o!==-1&&this._numBytesAllocated>o?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=i):(this.freeTextures[s].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let l=this.usedTextures[s],u=l&&l.indexOf(e);if(u==null||u<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l[u]=l[l.length-1],l.pop(),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.texture)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function fq(e,t){let a=e;if(t===a.R32F)return 4;if(t===a.R16F)return 2;if(t===a.RGBA32F||t===e.RGBA)return 16;if(t===a.RGBA16F)return 8;if(t===a.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}function z5(e,t,a,n,r){let s=gq(t,n),i;if(r){let[l,u]=Zu(e[0],e[1]);i=l*u}else{let[l,u]=ac(e[0],e[1]);i=l*u}let o=fq(a,s);return i*o}function gq(e,t){switch(e){case pa.PACKED_2X2_FLOAT32:return G3(t);case pa.PACKED_2X2_FLOAT16:return H3(t);case pa.UNPACKED_FLOAT32:return B3(t);case pa.UNPACKED_FLOAT16:return V3(t);case pa.PACKED_4X1_UNSIGNED_BYTE:return U3(t);default:throw new Error(`Unknown physical texture type ${e}`)}}function yq(e){return B().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?pa.PACKED_2X2_FLOAT32:pa.UNPACKED_FLOAT32:e?pa.PACKED_2X2_FLOAT16:pa.UNPACKED_FLOAT16}function L5(e,t){if(e===gn.UPLOAD)return pa.PACKED_2X2_FLOAT32;if(e===gn.RENDER||e==null)return yq(t);if(e===gn.DOWNLOAD||e===gn.PIXELS)return pa.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${e}`)}function W5(e,t,a){return`${e[0]}_${e[1]}_${t}_${a}`}var Qn=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` float unaryOperation(float x) { ${t} } @@ -1178,11 +1178,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},En="if (isnan(x)) return x;",Ij="return x;",T5="return abs(x);",Sj="return (x >= 0.0) ? x : (exp(x) - 1.0);",Cj=En+` + `}},$n="if (isnan(x)) return x;",xq="return x;",B5="return abs(x);",Aq="return (x >= 0.0) ? x : (exp(x) - 1.0);",bq=$n+` return (x < 0.0) ? 0.0 : x; -`,Tj=En+` +`,vq=$n+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,Br="return x;",Nj="return 1.0 / (1.0 + exp(-1.0 * x));",Rj="return x;",Ej=` +`,jr="return x;",wq="return 1.0 / (1.0 + exp(-1.0 * x));",kq="return x;",Iq=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -1191,7 +1191,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,Mj=` +`,Sq=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -1201,7 +1201,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,Pj=` +`,Tq=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -1211,7 +1211,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,_j="return 1.0 / (1.0 + exp(-1.0 * x));",jr=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` +`,Cq="return 1.0 / (1.0 + exp(-1.0 * x));",Zr=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` vec4 unaryOperation(vec4 x) { ${t} } @@ -1222,17 +1222,17 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},$j=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length);let t=e.length,a=ka("rc",t),n=mt(t),r=yj(t,a),s=a.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` + `}},Nq=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=ga(this.outputShape.length);let t=e.length,a=ka("rc",t),n=ft(t),r=pq(t,a),s=a.slice(-2),i=t<=1?"rc":`vec2(${s.join(",")})`;this.userCode=` void main() { ${n} rc = getOutputCoords(); vec4 packedInput = getA(${r}); setOutput(getChannel(packedInput, ${i})); } - `}},Fj=Rn.whereImpl,Dj=1e-7,Oj=1e-4,Z2={};function zj(e){return e in Z2||(Z2[e]={}),Z2[e]}var Lj=B().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),Wj=600;function Bj(){return B().global.screen==null?1024:B().global.screen.height*B().global.screen.width*window.devicePixelRatio*Wj/1024/1024}var Yp=class h8 extends au{nextDataId(){return h8.nextDataId++}constructor(t){if(super(),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,!B().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let a;if(t!=null){if(t instanceof Vl)a=t;else{let n=Wn(B().getNumber("WEBGL_VERSION"),t);a=new Vl(n)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{let n=Wn(B().getNumber("WEBGL_VERSION"));a=new Vl(n),this.binaryCache=zj(B().getNumber("WEBGL_VERSION")),this.gpgpuCreatedLocally=!0}this.gpgpu=a,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new bj(this.gpgpu),this.numMBBeforeWarning=Bj(),this.texData=new rp(this,It())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(t,a,n,r,s,i){let o=this.makeTensorInfo(a,n),l=this.texData.get(o.dataId);l.isPacked=!1,l.texture={texture:t,texShape:[r,s]},l.texShape=[r,s];let u=Nd(a),p=new k5(u,!1,i),c=this.runWebGLProgram(p,[o],n,[[r,s]]);return c.shape=a,l.texture=null,this.disposeIntermediateTensorInfo(o),c.dataId}write(t,a,n){if((B().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||B().getBool("DEBUG"))&&this.checkNumericalProblems(t),n==="complex64"&&t!=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:a,dtype:n,values:t,usage:hn.UPLOAD,refCount:1}),r}refCount(t){return this.texData.has(t)?this.texData.get(t).refCount:0}incRef(t){let a=this.texData.get(t);a.refCount++}decRef(t){if(this.texData.has(t)){let a=this.texData.get(t);a.refCount--}}move(t,a,n,r,s){if(B().getBool("DEBUG")&&this.checkNumericalProblems(a),r==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(t,{shape:n,dtype:r,values:a,usage:hn.UPLOAD,refCount:s})}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}readSync(t){let a=this.texData.get(t),{values:n,dtype:r,complexTensorInfos:s,slice:i,shape:o,isPacked:l}=a;if(i!=null){let d;l?d=new jr(o,Br):d=new Kn(o,Br);let h=this.runWebGLProgram(d,[{dataId:t,shape:o,dtype:r}],r),m=this.readSync(h.dataId);return this.disposeIntermediateTensorInfo(h),m}if(n!=null)return this.convertAndCacheOnCPU(t);if(r==="string")return n;let u=this.activeTimers!=null,p;u&&(p=v.now());let c;if(r==="complex64"){let d=this.readSync(s.real.dataId),h=this.readSync(s.imag.dataId);c=C.mergeRealAndImagArrays(d,h)}else c=this.getValuesFromTexture(t);return u&&(this.downloadWaitMs+=v.now()-p),this.convertAndCacheOnCPU(t,c)}async read(t){if(this.pendingRead.has(t)){let m=this.pendingRead.get(t);return new Promise(f=>m.push(f))}let a=this.texData.get(t),{values:n,shape:r,slice:s,dtype:i,complexTensorInfos:o,isPacked:l}=a;if(s!=null){let m;l?m=new jr(r,Br):m=new Kn(r,Br);let f=this.runWebGLProgram(m,[{dataId:t,shape:r,dtype:i}],i),g=this.read(f.dataId);return this.disposeIntermediateTensorInfo(f),g}if(n!=null)return this.convertAndCacheOnCPU(t);if(B().getBool("DEBUG")&&!B().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&B().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let u=null,p;if(i!=="complex64"&&B().get("WEBGL_BUFFER_SUPPORTED")){p=this.decode(t);let m=this.texData.get(p.dataId);u=this.gpgpu.createBufferFromTexture(m.texture.texture,...Kc(r))}this.pendingRead.set(t,[]),i!=="complex64"&&await this.gpgpu.createAndWaitForFence();let c;if(i==="complex64"){let m=await Promise.all([this.read(o.real.dataId),this.read(o.imag.dataId)]),f=m[0],g=m[1];c=C.mergeRealAndImagArrays(f,g)}else if(u==null)c=this.getValuesFromTexture(t);else{let m=v.sizeFromShape(r);c=this.gpgpu.downloadFloat32MatrixFromBuffer(u,m)}if(p!=null&&this.disposeIntermediateTensorInfo(p),u!=null){let m=this.gpgpu.gl;ce(m,()=>m.deleteBuffer(u))}let d=this.convertAndCacheOnCPU(t,c),h=this.pendingRead.get(t);return this.pendingRead.delete(t),h.forEach(m=>m(d)),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t)&&It().removeDataId(t,this),this.pendingDeletes--),d}readToGPU(t,a={}){let n=this.texData.get(t),{values:r,shape:s,slice:i,dtype:o,isPacked:l,texture:u}=n;if(o==="complex64")throw new Error("Does not support reading texture for complex64 dtype.");if(i!=null){let h;l?h=new jr(s,Br):h=new Kn(s,Br);let m=this.runWebGLProgram(h,[{dataId:t,shape:s,dtype:o}],o),f=this.readToGPU(m,a);return this.disposeIntermediateTensorInfo(m),f}if(u==null)throw r!=null?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");let p=this.decode(t,a.customTexShape),c=It().makeTensorFromTensorInfo(p),d=this.texData.get(p.dataId);return Object.assign({tensorRef:c},d.texture)}bufferSync(t){let a=this.readSync(t.dataId);if(t.dtype==="string")try{let n=a.map(r=>v.decodeString(r));return $e(t.shape,t.dtype,n)}catch(n){throw new Error("Failed to decode encoded string bytes into utf-8")}return $e(t.shape,t.dtype,a)}checkNumericalProblems(t){if(t!=null)for(let a=0;a0}time(t){let a=this.activeTimers,n=[],r=!1;this.programTimersStack==null?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,t();let s=v.flatten(this.activeTimers.map(l=>l.query)).filter(l=>l!=null),i=v.flatten(this.activeTimers.map(l=>l.name)).filter(l=>l!=null);this.activeTimers=a,r&&(this.programTimersStack=null);let o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let l=await Promise.all(s);o.kernelMs=v.sum(l),o.getExtraProfileInfo=()=>l.map((u,p)=>({name:i[p],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(", ")}else o.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,o})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:v.now(),endMs:null}}endTimer(t){return B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),t):(t.endMs=v.now(),t)}async getQueryTime(t){if(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(t);let a=t;return a.endMs-a.startMs}disposeData(t,a=!1){if(this.pendingDisposal.has(t))return!1;if(!this.texData.has(t))return!0;if(a?this.texData.get(t).refCount=0:this.texData.get(t).refCount--,!a&&this.texData.get(t).refCount>0)return!1;if(this.pendingRead.has(t))return this.pendingDisposal.add(t),this.pendingDeletes++,!1;this.releaseGPUData(t);let{complexTensorInfos:n}=this.texData.get(t);return n!=null&&(this.disposeData(n.real.dataId,a),this.disposeData(n.imag.dataId,a)),this.texData.delete(t),!0}releaseGPUData(t){let{texture:a,dtype:n,texShape:r,usage:s,isPacked:i,slice:o}=this.texData.get(t),l=o&&o.origDataId||t,u=this.dataRefCount.get(l);u>1?this.dataRefCount.set(l,u-1):(this.dataRefCount.delete(l),a!=null&&(this.numBytesInGPU-=this.computeBytes(r,n),this.textureManager.releaseTexture(a,r,s,i)));let p=this.texData.get(t);p.texture=null,p.texShape=null,p.isPacked=!1,p.slice=null}getTexture(t){return this.uploadToGPU(t),this.texData.get(t).texture.texture}getDataInfo(t){return this.texData.get(t)}shouldExecuteOnCPU(t,a=Lj){return B().getBool("WEBGL_CPU_FORWARD")&&t.every(n=>this.texData.get(n.dataId).texture==null&&v.sizeFromShape(n.shape)0&&v.isString(n[0])){let s=n.map(i=>v.encodeString(i));r=this.write(s,t,a)}else r=this.write(n,t,a);return this.texData.get(r).usage=null,{dataId:r,shape:t,dtype:a}}makeOutput(t,a,n){return It().makeTensorFromTensorInfo(this.makeTensorInfo(t,a,n),this)}unpackTensor(t){let a=new $j(t.shape);return this.runWebGLProgram(a,[t],t.dtype)}packTensor(t){let a=new xj(t.shape),n=!0;return this.runWebGLProgram(a,[t],t.dtype,null,n)}packedReshape(t,a){let n=[ei(t.shape),...ti(t.shape)],r={dtype:t.dtype,shape:n,dataId:t.dataId},s=[ei(a),...ti(a)],i=new c8(s,n),o=!0,l=[n],u=this.runWebGLProgram(i,[r],t.dtype,l,o);return{dataId:u.dataId,shape:a,dtype:u.dtype}}decode(t,a){let n=this.texData.get(t),{isPacked:r,shape:s,dtype:i}=n;if(a!=null){let d=v.sizeFromShape(s),h=a[0]*a[1]*4;v.assert(d<=h,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}let o=Nd(s),l;r?l=new bH(o):l=new AH(o);let u=!0,p=[a!=null?a:Kc(o)],c=this.runWebGLProgram(l,[{shape:o,dtype:i,dataId:t}],i,p,u,a);return{dtype:i,shape:s,dataId:c.dataId}}runWebGLProgram(t,a,n,r,s=!1,i){let o=this.makeTensorInfo(t.outputShape,n),l=this.texData.get(o.dataId);if(t.packedOutput&&(l.isPacked=!0),t.outPackingScheme===Yd.DENSE){let y=i!=null?i:Kc(t.outputShape);l.texShape=y.map(x=>x*2)}if(t.outTexUsage!=null&&(l.usage=t.outTexUsage),v.sizeFromShape(o.shape)===0)return l.values=v.getTypedArrayFromDType(o.dtype,0),o;let u=[],p=a.map(y=>{if(y.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let x=this.texData.get(y.dataId);if(x.texture==null){if(!t.packedInputs&&v.sizeFromShape(y.shape)<=B().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:y.shape,texData:null,isUniform:!0,uniformValues:x.values};t.packedInputs&&(x.isPacked=!0,x.shape=y.shape)}if(this.uploadToGPU(y.dataId),!!x.isPacked!=!!t.packedInputs)y=x.isPacked?this.unpackTensor(y):this.packTensor(y),u.push(y),x=this.texData.get(y.dataId);else if(x.isPacked&&!Zd(x.shape,y.shape)){let A=y,b=y.shape;y.shape=x.shape,y=this.packedReshape(y,b),u.push(y),x=this.texData.get(y.dataId),A.shape=b}return{shape:y.shape,texData:x,isUniform:!1}});this.uploadToGPU(o.dataId);let c={shape:o.shape,texData:l,isUniform:!1},d=xH(t,p,c),h=this.getAndSaveBinary(d,()=>gH(this.gpgpu,t,p,c)),m=this.activeTimers!=null,f;m&&(f=this.startTimer()),B().get("ENGINE_COMPILE_ONLY")||yH(this.gpgpu,h,p,c,r),u.forEach(y=>this.disposeIntermediateTensorInfo(y)),m&&(f=this.endTimer(f),this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime(f)}));let g=B().getNumber("WEBGL_FLUSH_THRESHOLD");if(g>0){let y=v.now();y-this.lastGlFlushTime>g&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=y)}if(!B().getBool("WEBGL_LAZILY_UNPACK")&&l.isPacked&&s===!1){let y=this.unpackTensor(o);return this.disposeIntermediateTensorInfo(o),y}return o}compileAndRun(t,a,n,r,s=!1){return n=n||a[0].dtype,this.runWebGLProgram(t,a,n,r,s)}getAndSaveBinary(t,a){return t in this.binaryCache||(this.binaryCache[t]=a()),this.binaryCache[t]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(B().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(t=>{this.gpgpu.deleteProgram(this.binaryCache[t].webGLProgram),delete this.binaryCache[t]}),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=De(()=>{if(!B().get("WEBGL_RENDER_FLOAT32_ENABLED")){let t=B().getBool("DEBUG");B().set("DEBUG",!1);let a=this.abs(Ge(1e-8)).dataSync()[0];if(B().set("DEBUG",t),a>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?Dj:Oj}uploadToGPU(t){let a=this.texData.get(t),{shape:n,dtype:r,values:s,texture:i,usage:o,isPacked:l}=a;if(i!=null)return;let u=this.activeTimers!=null,p;u&&(p=v.now());let c=a.texShape;if(c==null&&(c=_v(n,l),a.texShape=c),s!=null){let d=Nd(n),h,m=c[1],f=c[0],g=s instanceof Uint8Array||s instanceof Uint8ClampedArray;(l||!g)&&([m,f]=Uu(c[0],c[1])),l?h=new IH(d,g):h=new k5(d,g);let y=g?[f,m]:c,x=this.makeTensorInfo(y,r),A=this.texData.get(x.dataId);g?A.usage=hn.PIXELS:A.usage=hn.UPLOAD,A.texShape=y,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(x.dataId),m,f,s);let b=[[f,m]],w=!0,I=this.runWebGLProgram(h,[x],r,b,w),T=this.texData.get(I.dataId);a.texShape=T.texShape,a.isPacked=T.isPacked,a.usage=T.usage,B().get("ENGINE_COMPILE_ONLY")?this.disposeData(I.dataId):(a.texture=T.texture,a.values=null,this.texData.delete(I.dataId)),this.disposeIntermediateTensorInfo(x),u&&(this.uploadWaitMs+=v.now()-p)}else{let d=this.acquireTexture(c,o,r,l);a.texture=d}}convertAndCacheOnCPU(t,a){let n=this.texData.get(t),{dtype:r}=n;return a!=null&&(n.values=Vj(a,r)),n.values}acquireTexture(t,a,n,r){if(this.numBytesInGPU+=this.computeBytes(t,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(t,a,r)}computeBytes(t,a){return t[0]*t[1]*v.bytesPerElement(a)}checkCompileCompletion(){for(let[,t]of Object.entries(this.binaryCache))this.checkCompletion_(t)}async checkCompileCompletionAsync(){let t=[];if(this.gpgpu.parallelCompilationExtension){for(let[,a]of Object.entries(this.binaryCache))t.push(this.checkCompletionAsync_(a));return Promise.all(t)}else{for(let[,a]of Object.entries(this.binaryCache)){let n=new Promise(r=>{try{this.checkCompletion_(a),r(!0)}catch(s){throw s}});t.push(n)}return Promise.all(t)}}async checkCompletionAsync_(t){return this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(t):(await W7(),this.checkCompletionAsync_(t))}checkCompletion_(t){if(this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(t.webGLProgram)),this.gpgpu.gl.getShaderParameter(t.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(T3(t.source,this.gpgpu.gl.getShaderInfoLog(t.fragmentShader)),new Error("Failed to compile fragment shader.")):new Error("Failed to link vertex and fragment shaders.");return!0}getUniformLocations(){for(let t of Object.values(this.binaryCache)){this.gpgpu.buildVao(t.webGLProgram);let{variablesLocations:a,customUniformLocations:n,infLoc:r,nanLoc:s,outShapeLocation:i,outShapeStridesLocation:o,outTexShapeLocation:l}=Gv(this.gpgpu,t.program,t.webGLProgram);t.variablesLocations=a,t.customUniformLocations=n,t.infLoc=r,t.nanLoc=s,t.outShapeLocation=i,t.outShapeStridesLocation=o,t.outTexShapeLocation=l}}createTensorFromGPUData(t,a,n){t.channels=t.channels||"RGBA";let{texture:r,height:s,width:i,channels:o}=t,l=It().backend;if(!l.gpgpu.gl.isTexture(r))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");let u=l.writeTexture(r,a,n,s,i,o);return It().makeTensorFromDataId(u,a,n,l)}};Yp.nextDataId=0;function Vj(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let a=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let n=0;nnew Yp,2);var Gj={forceHalfFloat:m8},O3=` + `}},Rq=Fn.whereImpl,Eq=1e-7,Mq=1e-4,r1={};function Fq(e){return e in r1||(r1[e]={}),r1[e]}var $q=B().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),Dq=600;function Pq(){return B().global.screen==null?1024:B().global.screen.height*B().global.screen.width*window.devicePixelRatio*Dq/1024/1024}var rc=class $w extends du{nextDataId(){return $w.nextDataId++}constructor(t){if(super(),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,!B().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let a;if(t!=null){if(t instanceof Yl)a=t;else{let n=Un(B().getNumber("WEBGL_VERSION"),t);a=new Yl(n)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{let n=Un(B().getNumber("WEBGL_VERSION"));a=new Yl(n),this.binaryCache=Fq(B().getNumber("WEBGL_VERSION")),this.gpgpuCreatedLocally=!0}this.gpgpu=a,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new mq(this.gpgpu),this.numMBBeforeWarning=Pq(),this.texData=new hp(this,St())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(t,a,n,r,s,i){let o=this.makeTensorInfo(a,n),l=this.texData.get(o.dataId);l.isPacked=!1,l.texture={texture:t,texShape:[r,s]},l.texShape=[r,s];let u=_d(a),d=new O5(u,!1,i),c=this.runWebGLProgram(d,[o],n,[[r,s]]);return c.shape=a,l.texture=null,this.disposeIntermediateTensorInfo(o),c.dataId}write(t,a,n){if((B().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||B().getBool("DEBUG"))&&this.checkNumericalProblems(t),n==="complex64"&&t!=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:a,dtype:n,values:t,usage:gn.UPLOAD,refCount:1}),r}refCount(t){return this.texData.has(t)?this.texData.get(t).refCount:0}incRef(t){let a=this.texData.get(t);a.refCount++}decRef(t){if(this.texData.has(t)){let a=this.texData.get(t);a.refCount--}}move(t,a,n,r,s){if(B().getBool("DEBUG")&&this.checkNumericalProblems(a),r==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(t,{shape:n,dtype:r,values:a,usage:gn.UPLOAD,refCount:s})}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}readSync(t){let a=this.texData.get(t),{values:n,dtype:r,complexTensorInfos:s,slice:i,shape:o,isPacked:l}=a;if(i!=null){let p;l?p=new Zr(o,jr):p=new Qn(o,jr);let h=this.runWebGLProgram(p,[{dataId:t,shape:o,dtype:r}],r),m=this.readSync(h.dataId);return this.disposeIntermediateTensorInfo(h),m}if(n!=null)return this.convertAndCacheOnCPU(t);if(r==="string")return n;let u=this.activeTimers!=null,d;u&&(d=v.now());let c;if(r==="complex64"){let p=this.readSync(s.real.dataId),h=this.readSync(s.imag.dataId);c=I.mergeRealAndImagArrays(p,h)}else c=this.getValuesFromTexture(t);return u&&(this.downloadWaitMs+=v.now()-d),this.convertAndCacheOnCPU(t,c)}async read(t){if(this.pendingRead.has(t)){let m=this.pendingRead.get(t);return new Promise(f=>m.push(f))}let a=this.texData.get(t),{values:n,shape:r,slice:s,dtype:i,complexTensorInfos:o,isPacked:l}=a;if(s!=null){let m;l?m=new Zr(r,jr):m=new Qn(r,jr);let f=this.runWebGLProgram(m,[{dataId:t,shape:r,dtype:i}],i),g=this.read(f.dataId);return this.disposeIntermediateTensorInfo(f),g}if(n!=null)return this.convertAndCacheOnCPU(t);if(B().getBool("DEBUG")&&!B().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&B().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let u=null,d;if(i!=="complex64"&&B().get("WEBGL_BUFFER_SUPPORTED")){d=this.decode(t);let m=this.texData.get(d.dataId);u=this.gpgpu.createBufferFromTexture(m.texture.texture,...nh(r))}this.pendingRead.set(t,[]),i!=="complex64"&&await this.gpgpu.createAndWaitForFence();let c;if(i==="complex64"){let m=await Promise.all([this.read(o.real.dataId),this.read(o.imag.dataId)]),f=m[0],g=m[1];c=I.mergeRealAndImagArrays(f,g)}else if(u==null)c=this.getValuesFromTexture(t);else{let m=v.sizeFromShape(r);c=this.gpgpu.downloadFloat32MatrixFromBuffer(u,m)}if(d!=null&&this.disposeIntermediateTensorInfo(d),u!=null){let m=this.gpgpu.gl;ce(m,()=>m.deleteBuffer(u))}let p=this.convertAndCacheOnCPU(t,c),h=this.pendingRead.get(t);return this.pendingRead.delete(t),h.forEach(m=>m(p)),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t)&&St().removeDataId(t,this),this.pendingDeletes--),p}readToGPU(t,a={}){let n=this.texData.get(t),{values:r,shape:s,slice:i,dtype:o,isPacked:l,texture:u}=n;if(o==="complex64")throw new Error("Does not support reading texture for complex64 dtype.");if(i!=null){let h;l?h=new Zr(s,jr):h=new Qn(s,jr);let m=this.runWebGLProgram(h,[{dataId:t,shape:s,dtype:o}],o),f=this.readToGPU(m,a);return this.disposeIntermediateTensorInfo(m),f}if(u==null)throw r!=null?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");let d=this.decode(t,a.customTexShape),c=St().makeTensorFromTensorInfo(d),p=this.texData.get(d.dataId);return Object.assign({tensorRef:c},p.texture)}bufferSync(t){let a=this.readSync(t.dataId);if(t.dtype==="string")try{let n=a.map(r=>v.decodeString(r));return Te(t.shape,t.dtype,n)}catch(n){throw new Error("Failed to decode encoded string bytes into utf-8")}return Te(t.shape,t.dtype,a)}checkNumericalProblems(t){if(t!=null)for(let a=0;a0}time(t){let a=this.activeTimers,n=[],r=!1;this.programTimersStack==null?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,t();let s=v.flatten(this.activeTimers.map(l=>l.query)).filter(l=>l!=null),i=v.flatten(this.activeTimers.map(l=>l.name)).filter(l=>l!=null);this.activeTimers=a,r&&(this.programTimersStack=null);let o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let l=await Promise.all(s);o.kernelMs=v.sum(l),o.getExtraProfileInfo=()=>l.map((u,d)=>({name:i[d],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(", ")}else o.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,o})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:v.now(),endMs:null}}endTimer(t){return B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),t):(t.endMs=v.now(),t)}async getQueryTime(t){if(B().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(t);let a=t;return a.endMs-a.startMs}disposeData(t,a=!1){if(this.pendingDisposal.has(t))return!1;if(!this.texData.has(t))return!0;if(a?this.texData.get(t).refCount=0:this.texData.get(t).refCount--,!a&&this.texData.get(t).refCount>0)return!1;if(this.pendingRead.has(t))return this.pendingDisposal.add(t),this.pendingDeletes++,!1;this.releaseGPUData(t);let{complexTensorInfos:n}=this.texData.get(t);return n!=null&&(this.disposeData(n.real.dataId,a),this.disposeData(n.imag.dataId,a)),this.texData.delete(t),!0}releaseGPUData(t){let{texture:a,dtype:n,texShape:r,usage:s,isPacked:i,slice:o}=this.texData.get(t),l=o&&o.origDataId||t,u=this.dataRefCount.get(l);u>1?this.dataRefCount.set(l,u-1):(this.dataRefCount.delete(l),a!=null&&(this.numBytesInGPU-=this.computeBytes(r,n),this.textureManager.releaseTexture(a,r,s,i)));let d=this.texData.get(t);d.texture=null,d.texShape=null,d.isPacked=!1,d.slice=null}getTexture(t){return this.uploadToGPU(t),this.texData.get(t).texture.texture}getDataInfo(t){return this.texData.get(t)}shouldExecuteOnCPU(t,a=$q){return B().getBool("WEBGL_CPU_FORWARD")&&t.every(n=>this.texData.get(n.dataId).texture==null&&v.sizeFromShape(n.shape)0&&v.isString(n[0])){let s=n.map(i=>v.encodeString(i));r=this.write(s,t,a)}else r=this.write(n,t,a);return this.texData.get(r).usage=null,{dataId:r,shape:t,dtype:a}}makeOutput(t,a,n){return St().makeTensorFromTensorInfo(this.makeTensorInfo(t,a,n),this)}unpackTensor(t){let a=new Nq(t.shape);return this.runWebGLProgram(a,[t],t.dtype)}packTensor(t){let a=new cq(t.shape);return this.runWebGLProgram(a,[t],t.dtype,null,!0)}packedReshape(t,a){let n=[Ni(t.shape),...Ri(t.shape)],r={dtype:t.dtype,shape:n,dataId:t.dataId},s=[Ni(a),...Ri(a)],i=new Fw(s,n),o=!0,l=[n],u=this.runWebGLProgram(i,[r],t.dtype,l,o);return{dataId:u.dataId,shape:a,dtype:u.dtype}}decode(t,a){let n=this.texData.get(t),{isPacked:r,shape:s,dtype:i}=n;if(a!=null){let p=v.sizeFromShape(s),h=a[0]*a[1]*4;v.assert(p<=h,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}let o=_d(s),l;r?l=new mj(o):l=new hj(o);let u=!0,d=[a!=null?a:nh(o)],c=this.runWebGLProgram(l,[{shape:o,dtype:i,dataId:t}],i,d,u,a);return{dtype:i,shape:s,dataId:c.dataId}}runWebGLProgram(t,a,n,r,s=!1,i){let o=this.makeTensorInfo(t.outputShape,n),l=this.texData.get(o.dataId);if(t.packedOutput&&(l.isPacked=!0),t.outPackingScheme===sp.DENSE){let y=i!=null?i:nh(t.outputShape);l.texShape=y.map(x=>x*2)}if(t.outTexUsage!=null&&(l.usage=t.outTexUsage),v.sizeFromShape(o.shape)===0)return l.values=v.getTypedArrayFromDType(o.dtype,0),o;let u=[],d=a.map(y=>{if(y.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let x=this.texData.get(y.dataId);if(x.texture==null){if(!t.packedInputs&&v.sizeFromShape(y.shape)<=B().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:y.shape,texData:null,isUniform:!0,uniformValues:x.values};t.packedInputs&&(x.isPacked=!0,x.shape=y.shape)}if(this.uploadToGPU(y.dataId),!!x.isPacked!=!!t.packedInputs)y=x.isPacked?this.unpackTensor(y):this.packTensor(y),u.push(y),x=this.texData.get(y.dataId);else if(x.isPacked&&!ip(x.shape,y.shape)){let A=y,b=y.shape;y.shape=x.shape,y=this.packedReshape(y,b),u.push(y),x=this.texData.get(y.dataId),A.shape=b}return{shape:y.shape,texData:x,isUniform:!1}});this.uploadToGPU(o.dataId);let c={shape:o.shape,texData:l,isUniform:!1},p=cj(t,d,c),h=this.getAndSaveBinary(p,()=>dj(this.gpgpu,t,d,c)),m=this.activeTimers!=null,f;m&&(f=this.startTimer()),B().get("ENGINE_COMPILE_ONLY")||pj(this.gpgpu,h,d,c,r),u.forEach(y=>this.disposeIntermediateTensorInfo(y)),m&&(f=this.endTimer(f),this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime(f)}));let g=B().getNumber("WEBGL_FLUSH_THRESHOLD");if(g>0){let y=v.now();y-this.lastGlFlushTime>g&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=y)}if(!B().getBool("WEBGL_LAZILY_UNPACK")&&l.isPacked&&s===!1){let y=this.unpackTensor(o);return this.disposeIntermediateTensorInfo(o),y}return o}compileAndRun(t,a,n,r,s=!1){return n=n||a[0].dtype,this.runWebGLProgram(t,a,n,r,s)}getAndSaveBinary(t,a){return t in this.binaryCache||(this.binaryCache[t]=a()),this.binaryCache[t]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(B().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(t=>{this.gpgpu.deleteProgram(this.binaryCache[t].webGLProgram),delete this.binaryCache[t]}),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=Pe(()=>{if(!B().get("WEBGL_RENDER_FLOAT32_ENABLED")){let t=B().getBool("DEBUG");B().set("DEBUG",!1);let a=this.abs(Ge(1e-8)).dataSync()[0];if(B().set("DEBUG",t),a>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?Eq:Mq}uploadToGPU(t){let a=this.texData.get(t),{shape:n,dtype:r,values:s,texture:i,usage:o,isPacked:l}=a;if(i!=null)return;let u=this.activeTimers!=null,d;u&&(d=v.now());let c=a.texShape;if(c==null&&(c=Qv(n,l),a.texShape=c),s!=null){let p=_d(n),h,m=c[1],f=c[0],g=s instanceof Uint8Array||s instanceof Uint8ClampedArray;(l||!g)&&([m,f]=Zu(c[0],c[1])),l?h=new xj(p,g):h=new O5(p,g);let y=g?[f,m]:c,x=this.makeTensorInfo(y,r),A=this.texData.get(x.dataId);g?A.usage=gn.PIXELS:A.usage=gn.UPLOAD,A.texShape=y,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(x.dataId),m,f,s);let b=[[f,m]],w=this.runWebGLProgram(h,[x],r,b,!0),S=this.texData.get(w.dataId);a.texShape=S.texShape,a.isPacked=S.isPacked,a.usage=S.usage,B().get("ENGINE_COMPILE_ONLY")?this.disposeData(w.dataId):(a.texture=S.texture,a.values=null,this.texData.delete(w.dataId)),this.disposeIntermediateTensorInfo(x),u&&(this.uploadWaitMs+=v.now()-d)}else{let p=this.acquireTexture(c,o,r,l);a.texture=p}}convertAndCacheOnCPU(t,a){let n=this.texData.get(t),{dtype:r}=n;return a!=null&&(n.values=_q(a,r)),n.values}acquireTexture(t,a,n,r){if(this.numBytesInGPU+=this.computeBytes(t,n),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(t,a,r)}computeBytes(t,a){return t[0]*t[1]*v.bytesPerElement(a)}checkCompileCompletion(){for(let[,t]of Object.entries(this.binaryCache))this.checkCompletion_(t)}async checkCompileCompletionAsync(){let t=[];if(this.gpgpu.parallelCompilationExtension){for(let[,a]of Object.entries(this.binaryCache))t.push(this.checkCompletionAsync_(a));return Promise.all(t)}else{for(let[,a]of Object.entries(this.binaryCache)){let n=new Promise(r=>{try{this.checkCompletion_(a),r(!0)}catch(s){throw s}});t.push(n)}return Promise.all(t)}}async checkCompletionAsync_(t){return this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(t):(await i6(),this.checkCompletionAsync_(t))}checkCompletion_(t){if(this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(t.webGLProgram)),this.gpgpu.gl.getShaderParameter(t.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(O3(t.source,this.gpgpu.gl.getShaderInfoLog(t.fragmentShader)),new Error("Failed to compile fragment shader.")):new Error("Failed to link vertex and fragment shaders.");return!0}getUniformLocations(){for(let t of Object.values(this.binaryCache)){this.gpgpu.buildVao(t.webGLProgram);let{variablesLocations:a,customUniformLocations:n,infLoc:r,nanLoc:s,outShapeLocation:i,outShapeStridesLocation:o,outTexShapeLocation:l}=dw(this.gpgpu,t.program,t.webGLProgram);t.variablesLocations=a,t.customUniformLocations=n,t.infLoc=r,t.nanLoc=s,t.outShapeLocation=i,t.outShapeStridesLocation=o,t.outTexShapeLocation=l}}createTensorFromGPUData(t,a,n){t.channels=t.channels||"RGBA";let{texture:r,height:s,width:i,channels:o}=t,l=St().backend;if(!l.gpgpu.gl.isTexture(r))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");let u=l.writeTexture(r,a,n,s,i,o);return St().makeTensorFromDataId(u,a,n,l)}};rc.nextDataId=0;function _q(e,t){if(t==="float32"||t==="complex64")return e;if(t==="int32"||t==="bool"){let a=t==="int32"?new Int32Array(e.length):new Uint8Array(e.length);for(let n=0;nnew rc,2);var zq={forceHalfFloat:Dw},q3=` if (isnan(a)) return a; if (isnan(b)) return b; -`,ai=class{constructor(e,t,a){this.variableNames=["A","B"],this.outputShape=C.assertAndGetBroadcastShape(t,a),this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` +`,Ei=class{constructor(e,t,a){this.variableNames=["A","B"],this.outputShape=I.assertAndGetBroadcastShape(t,a),this.enableShapeUniforms=ga(this.outputShape.length),this.userCode=` float binaryOperation(float a, float b) { ${e} } @@ -1242,17 +1242,17 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float b = getBAtOutCoords(); setOutput(binaryOperation(a, b)); } - `}},nl=` + `}},cl=` result.r = isNaN.r ? NAN : result.r; result.g = isNaN.g ? NAN : result.g; result.b = isNaN.b ? NAN : result.b; result.a = isNaN.a ? NAN : result.a; -`,Ku=class{constructor(e,t,a,n=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=C.assertAndGetBroadcastShape(t,a);let r=this.outputShape.length;this.enableShapeUniforms=ga(r);let s="";if(n)if(r===0||v.sizeFromShape(this.outputShape)===1)s=` +`,nd=class{constructor(e,t,a,n=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=I.assertAndGetBroadcastShape(t,a);let r=this.outputShape.length;this.enableShapeUniforms=ga(r);let s="";if(n)if(r===0||v.sizeFromShape(this.outputShape)===1)s=` result.y = 0.; result.z = 0.; result.w = 0.; `;else if(s=` - ${mt(r)} coords = getOutputCoords(); + ${ft(r)} coords = getOutputCoords(); `,r===1)this.enableShapeUniforms?s+=` result.y = (coords + 1) >= outShape ? 0. : result.y; result.z = 0.; @@ -1291,13 +1291,13 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function Qa(e){let{inputs:t,backend:a}=e,{x:n}=t;return a.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}var Hj={kernelName:Hi,backendName:"webgl",kernelFunc:Qa};function hs(e){let{inputs:t,backend:a}=e,{real:n,imag:r}=t,s=a.makeTensorInfo(n.shape,"complex64"),i=a.texData.get(s.dataId),o=Qa({inputs:{x:n},backend:a}),l=Qa({inputs:{x:r},backend:a});return i.complexTensorInfos={real:o,imag:l},s}var jj={kernelName:up,backendName:"webgl",kernelFunc:hs},f8="return (a < 0.) ? b * a : a;",g8=` + `}};function tn(e){let{inputs:t,backend:a}=e,{x:n}=t;return a.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}var Lq={kernelName:ho,backendName:"webgl",kernelFunc:tn};function zs(e){let{inputs:t,backend:a}=e,{real:n,imag:r}=t,s=a.makeTensorInfo(n.shape,"complex64"),i=a.texData.get(s.dataId),o=tn({inputs:{x:n},backend:a}),l=tn({inputs:{x:r},backend:a});return i.complexTensorInfos={real:o,imag:l},s}var Wq={kernelName:xp,backendName:"webgl",kernelFunc:zs},Pw="return (a < 0.) ? b * a : a;",_w=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function qj(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{alpha:s}=n,i=a.makeTensorInfo([],"float32",v.createScalarValue(s,"float32")),o=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Ku(g8,r.shape,i.shape):new ai(f8,r.shape,i.shape),l=a.runWebGLProgram(o,[r,i],"float32");return a.disposeIntermediateTensorInfo(i),l}var Xj={kernelName:Ki,backendName:"webgl",kernelFunc:qj},y8="return (a < 0.) ? b * a : a;",x8=` +`;function Bq(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{alpha:s}=n,i=a.makeTensorInfo([],"float32",v.createScalarValue(s,"float32")),o=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new nd(_w,r.shape,i.shape):new Ei(Pw,r.shape,i.shape),l=a.runWebGLProgram(o,[r,i],"float32");return a.disposeIntermediateTensorInfo(i),l}var Vq={kernelName:yo,backendName:"webgl",kernelFunc:Bq},Ow="return (a < 0.) ? b * a : a;",zw=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function Kj(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t,s=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Ku(x8,n.shape,r.shape):new ai(y8,n.shape,r.shape);return a.runWebGLProgram(s,[n,r],"float32")}var Yj={kernelName:wo,backendName:"webgl",kernelFunc:Kj},Yu="if (isnan(x)) return x;";function tt({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:a,dtype:n}){return({inputs:r,backend:s})=>{let{x:i}=r,o=s,l=n||i.dtype;if(o.shouldExecuteOnCPU([i])&&a!=null){let c=o.texData.get(i.dataId),d=a(c.values,l);return o.makeTensorInfo(i.shape,l,d)}let u=B().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,p;return u?p=new jr(i.shape,t):p=new Kn(i.shape,e),o.runWebGLProgram(p,[i],l)}}function ha({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:a=!1,supportsComplex:n=!1,cpuKernelImpl:r,dtype:s}){return({inputs:i,backend:o})=>{let{a:l,b:u}=i,p=o;if(n&&l.dtype==="complex64"){let m=p.texData.get(l.dataId),f=p.texData.get(u.dataId),[g,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(A=>{let[b,w]=A,I={dataId:b.dataId,dtype:b.dtype,shape:l.shape},T={dataId:w.dataId,dtype:w.dtype,shape:u.shape},N=new ai(e,l.shape,u.shape);return p.runWebGLProgram(N,[I,T],da(b.dtype,w.dtype))}),x=hs({inputs:{real:g,imag:y},backend:p});return p.disposeIntermediateTensorInfo(g),p.disposeIntermediateTensorInfo(y),x}let c=s||da(l.dtype,u.dtype);if((l.dtype==="string"||u.dtype==="string"||p.shouldExecuteOnCPU([l,u]))&&r!=null){let m=p.texData.get(l.dataId).values,f=p.texData.get(u.dataId).values,g=l.dtype==="string"?C.fromUint8ToStringArray(m):m,y=l.dtype==="string"?C.fromUint8ToStringArray(f):f,[x,A]=r(l.shape,u.shape,g,y,c),b=p.makeTensorInfo(A,c),w=p.texData.get(b.dataId);return w.values=x,b}let d=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,h;return d?h=new Ku(t,l.shape,u.shape,a):h=new ai(e,l.shape,u.shape),p.runWebGLProgram(h,[l,u],c)}}function Jd(e,t=!1){if(e==="linear")return t?Rj:Ij;if(e==="relu")return t?Mj:Cj;if(e==="elu")return t?Ej:Sj;if(e==="relu6")return t?Pj:Tj;if(e==="prelu")return t?x8:y8;if(e==="leakyrelu")return t?g8:f8;if(e==="sigmoid")return t?_j:Nj;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var A8=class{constructor(e,t,a,n=!1,r=!1,s=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a,this.enableShapeUniforms=ga(this.outputShape.length);let u=n?e[1]:e[2],p=Math.ceil(u/2),c=n?"i * 2, rc.y":"rc.y, i * 2",d=r?"rc.z, i * 2":"i * 2, rc.z",h=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",g="";i&&(o?f=`vec4 activation(vec4 a) { +`;function Uq(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t,s=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new nd(zw,n.shape,r.shape):new Ei(Ow,n.shape,r.shape);return a.runWebGLProgram(s,[n,r],"float32")}var Gq={kernelName:_o,backendName:"webgl",kernelFunc:Uq},rd="if (isnan(x)) return x;";function tt({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:a,dtype:n}){return({inputs:r,backend:s})=>{let{x:i}=r,o=s,l=n||i.dtype;if(o.shouldExecuteOnCPU([i])&&a!=null){let c=o.texData.get(i.dataId),p=a(c.values,l);return o.makeTensorInfo(i.shape,l,p)}let u=B().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,d;return u?d=new Zr(i.shape,t):d=new Qn(i.shape,e),o.runWebGLProgram(d,[i],l)}}function ha({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:a=!1,supportsComplex:n=!1,cpuKernelImpl:r,dtype:s}){return({inputs:i,backend:o})=>{let{a:l,b:u}=i,d=o;if(n&&l.dtype==="complex64"){let m=d.texData.get(l.dataId),f=d.texData.get(u.dataId),[g,y]=[[m.complexTensorInfos.real,f.complexTensorInfos.real],[m.complexTensorInfos.imag,f.complexTensorInfos.imag]].map(A=>{let[b,w]=A,S={dataId:b.dataId,dtype:b.dtype,shape:l.shape},C={dataId:w.dataId,dtype:w.dtype,shape:u.shape},N=new Ei(e,l.shape,u.shape);return d.runWebGLProgram(N,[S,C],Qt(b.dtype,w.dtype))}),x=zs({inputs:{real:g,imag:y},backend:d});return d.disposeIntermediateTensorInfo(g),d.disposeIntermediateTensorInfo(y),x}let c=s||Qt(l.dtype,u.dtype);if((l.dtype==="string"||u.dtype==="string"||d.shouldExecuteOnCPU([l,u]))&&r!=null){let m=d.texData.get(l.dataId).values,f=d.texData.get(u.dataId).values,g=l.dtype==="string"?I.fromUint8ToStringArray(m):m,y=l.dtype==="string"?I.fromUint8ToStringArray(f):f,[x,A]=r(l.shape,u.shape,g,y,c),b=d.makeTensorInfo(A,c),w=d.texData.get(b.dataId);return w.values=x,b}let p=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,h;return p?h=new nd(t,l.shape,u.shape,a):h=new Ei(e,l.shape,u.shape),d.runWebGLProgram(h,[l,u],c)}}function op(e,t=!1){if(e==="linear")return t?kq:xq;if(e==="relu")return t?Sq:bq;if(e==="elu")return t?Iq:Aq;if(e==="relu6")return t?Tq:vq;if(e==="prelu")return t?zw:Ow;if(e==="leakyrelu")return t?_w:Pw;if(e==="sigmoid")return t?Cq:wq;throw new Error(`Activation ${e} has not been implemented for the WebGL backend.`)}var Lw=class{constructor(e,t,a,n=!1,r=!1,s=!1,i=null,o=!1,l=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a,this.enableShapeUniforms=ga(this.outputShape.length);let u=n?e[1]:e[2],d=Math.ceil(u/2),c=n?"i * 2, rc.y":"rc.y, i * 2",p=r?"rc.z, i * 2":"i * 2, rc.z",h=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],m=r?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",g="";i&&(o?f=`vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${i} }`:l?f=`vec4 activation(vec4 a) { @@ -1308,15 +1308,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, }`,g="result = activation(result);");let y=s?"result += getBiasAtOutCoords();":"";s&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),l&&this.variableNames.push("leakyreluAlpha");let x="rc.x",A="rc.x";e[0]`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let p=i.texData.get(r.dataId);return p.isPacked&&!Zd(r.shape,l)&&!(p.texture!==null&&Zd(p.shape,l))?Jj(r,l,i):(i.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype})}var Qj={kernelName:Tu,backendName:"webgl",kernelFunc:pe},M5=class{constructor(e,t){this.variableNames=["x"];let{windowSize:a,batchSize:n,inSize:r,outSize:s}=e;this.outputShape=[n,s];let i=Math.floor(a/4)*4,o=a%4,l="sumValue += dot(values, ones);";if(t!=null){let p=1/t;l=`sumValue += dot(values * ${v.isInt(p)?p.toPrecision(2):p}, ones);`}let u="";r%a>0&&(u=` + `}},G5="return a * b;";function X3(e){let{inputs:t,backend:a}=e,{a:n,b:r}=t,s=I.upcastType(n.dtype,r.dtype);if(n.dtype==="complex64"){let o=a.texData.get(n.dataId),l=a.texData.get(r.dataId),u=new U5(V5.REAL,n.shape,r.shape),d=new U5(V5.IMAG,n.shape,r.shape),c=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:n.shape},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:n.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}],p=a.runWebGLProgram(u,c,"float32"),h=a.runWebGLProgram(d,c,"float32"),m=zs({inputs:{real:p,imag:h},backend:a});return a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(h),m}if(a.shouldExecuteOnCPU([n,r])){let o=a.texData.get(n.dataId),l=a.texData.get(r.dataId),[u,d]=Bj(n.shape,r.shape,o.values,l.values,s),c=a.makeTensorInfo(d,s),p=a.texData.get(c.dataId);return p.values=u,c}let i;return B().getBool("WEBGL_PACK_BINARY_OPERATIONS")?i=new nd(G5,n.shape,r.shape):i=new Ei(G5,n.shape,r.shape),a.runWebGLProgram(i,[n,r],s)}var Hq={kernelName:Ts,backendName:"webgl",kernelFunc:X3};function jq(e,t,a){let n=[Ni(e.shape),...Ri(e.shape)],r={dtype:e.dtype,shape:n,dataId:e.dataId},s=[Ni(t),...Ri(t)],i=new Fw(s,n),o=!0,l=[n],u=a.runWebGLProgram(i,[r],e.dtype,l,o);return{dataId:u.dataId,shape:t,dtype:u.dtype}}function pe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{shape:s}=n,i=a,o=v.sizeFromShape(r.shape),l=v.inferFromImplicitShape(s,o),u=v.sizeFromShape(l);v.assert(o===u,()=>`The new shape (${l}) has ${u} elements and the old shape (${r.shape}) has ${o} elements. The new shape and old shape must have the same number of elements.`);let d=i.texData.get(r.dataId);return d.isPacked&&!ip(r.shape,l)&&!(d.texture!==null&&ip(d.shape,l))?jq(r,l,i):(i.incRef(r.dataId),{dataId:r.dataId,shape:l,dtype:r.dtype})}var qq={kernelName:Du,backendName:"webgl",kernelFunc:pe},H5=class{constructor(e,t){this.variableNames=["x"];let{windowSize:a,batchSize:n,inSize:r,outSize:s}=e;this.outputShape=[n,s];let i=Math.floor(a/4)*4,o=a%4,l="sumValue += dot(values, ones);";if(t!=null){let d=1/t;l=`sumValue += dot(values * ${v.isInt(d)?d.toPrecision(2):d}, ones);`}let u="";r%a>0&&(u=` if (inIdx < 0 || inIdx >= ${r}) { return 0.0; } @@ -1402,7 +1402,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } setOutput(sumValue); } - `}},eq=class{constructor(e,t){this.variableNames=["x"];let{windowSize:a,batchSize:n,inSize:r,outSize:s}=e;this.outputShape=[n,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 u=Math.floor(a/4)*4,p=a%4,c=` + `}},Xq=class{constructor(e,t){this.variableNames=["x"];let{windowSize:a,batchSize:n,inSize:r,outSize:s}=e;this.outputShape=[n,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 u=Math.floor(a/4)*4,d=a%4,c=` if (${t==="sum"}) { sumValue += dot(values, ones); } else if (${t==="prod"}) { @@ -1418,15 +1418,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } } } - `,d="vec4";t==="all"?(i="1.0",c=` + `,p="vec4";t==="all"?(i="1.0",c=` bool reducedAllValue = all(values); float floatedReducedAllValue = float(reducedAllValue); allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); - `,d="bvec4"):t==="any"&&(i="0.0",c=` + `,p="bvec4"):t==="any"&&(i="0.0",c=` bool reducedAnyValue = any(values); float floatedReducedAnyValue = float(reducedAnyValue); anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); - `,d="bvec4");let h="";r%a>0&&(h=` + `,p="bvec4");let h="";r%a>0&&(h=` if (inIdx < 0 || inIdx >= ${r}) { return initializationValue; } @@ -1453,7 +1453,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, for (int i = 0; i < ${u}; i += 4) { int inIdx = inOffset + i; - ${d} values = ${d}( + ${p} values = ${p}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), @@ -1464,8 +1464,8 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } int inIdx = inOffset + ${u}; - if (${p===1}) { - ${d} values = ${d}( + if (${d===1}) { + ${p} values = ${p}( getValue(batch, inIdx), initializationValue, initializationValue, @@ -1473,8 +1473,8 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ); ${c} - } else if (${p===2}) { - ${d} values = ${d}( + } else if (${d===2}) { + ${p} values = ${p}( getValue(batch, inIdx), getValue(batch, inIdx + 1), initializationValue, @@ -1482,8 +1482,8 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ); ${c} - } else if (${p===3}) { - ${d} values = ${d}( + } else if (${d===3}) { + ${p} values = ${p}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), @@ -1494,12 +1494,12 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } setOutput(${l}); } - `}};function tq(e){let t=[];for(;t.length===0||t[t.length-1].outSize!==1;){let a=t.length?t[t.length-1].outSize:e[1],n=C.computeOptimalWindowSize(a);t.push({inSize:a,windowSize:n,outSize:Math.ceil(a/n)})}return t}function rl(e,t,a,n){let r=tq(e.shape),s=e;for(let i=0;i6)throw Error(`Transpose for rank ${t} is not yet supported`);let a=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],n=new Array(t);for(let r=0;r6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let n=mt(this.rank),r=p8("rc",this.rank),s=new Array(this.rank);for(let u=0;u6)throw Error(`Transpose for rank ${t} is not yet supported`);let a=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],n=new Array(t);for(let r=0;r6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let n=ft(this.rank),r=Mw("rc",this.rank),s=new Array(this.rank);for(let u=0;u`Error in matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${a} and transposeB=${n} must match.`);let b=a?[y,c,h]:[y,h,c],w=n?[x,m,d]:[x,d,m],I=pe({inputs:{x:e},backend:r,attrs:{shape:b}}),T=pe({inputs:{x:t},backend:r,attrs:{shape:w}}),N=[I,T],M=Math.max(y,x),P=a?I.shape[1]:I.shape[2],E=s!=null,S=i!=null,_=l==="leakyrelu",O=l!=null?Jd(l,!0):null,W=E||S||_||O!=null,$;if((h===1||m===1)&&P>b8&&W===!1){let G=I,q=T;a&&(G=Ca({inputs:{x:I},backend:r,attrs:{perm:[0,2,1]}}),N.push(G)),n&&(q=Ca({inputs:{x:T},backend:r,attrs:{perm:[0,2,1]}}),N.push(q));let H=m!==1,V=m===1,Z=G;H&&(Z=pe({inputs:{x:G},backend:r,attrs:{shape:[M,P,1]}}),N.push(Z));let X=m===1?2:1,re=q;V&&(re=pe({inputs:{x:q},backend:r,attrs:{shape:[M,1,P]}}),N.push(re));let ee=z3({inputs:{a:Z,b:re},backend:r});$=s0({inputs:{x:ee},backend:r,attrs:{axis:X,keepDims:!0}}),N.push(ee)}else{let G=da(e.dtype,t.dtype),q=new A8(b,w,[M,h,m],a,n,E,O,S,_),H=[I,T];if(s!=null&&H.push(s),S&&H.push(i),_){let V=r.makeTensorInfo([],"float32",v.createScalarValue(o,"float32"));H.push(V),N.push(V)}$=r.runWebGLProgram(q,H,G)}let U=pe({inputs:{x:$},backend:r,attrs:{shape:A}});N.push($);for(let G of N)r.disposeIntermediateTensorInfo(G);return U}function lq(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:p,leakyreluAlpha:c}=n;return wh({a:r,b:s,transposeA:l,transposeB:u,backend:a,bias:i,preluActivationWeights:o,leakyreluAlpha:c,activation:p})}var uq={kernelName:Yr,backendName:"webgl",kernelFunc:lq},P5="return abs(x);";function dq(e){let{inputs:t,backend:a}=e,{x:n}=t;if(a.shouldExecuteOnCPU([n])&&n.dtype!=="complex64"){let s=a.texData.get(n.dataId),i=u8(s.values);return a.makeTensorInfo(n.shape,n.dtype,i)}let r;return B().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new jr(n.shape,P5):r=new Kn(n.shape,P5),a.runWebGLProgram(r,[n],n.dtype)}var pq={kernelName:ru,backendName:"webgl",kernelFunc:dq},cq=En+` + `}};function p0(e,t,a){let n=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Jq(e.shape,t):new Yq(e.shape,t);return a.runWebGLProgram(n,[e],e.dtype)}function Qq(e,t,a,n){let r=t,s=e.shape.length,i=v.parseAxisParam(r,e.shape),o=i,l=I.getAxesPermutation(o,s),u=l!=null,d=e;u&&(d=p0(e,l,n),o=I.getInnerMostAxes(o.length,s)),I.assertAxesAreInnerMostDims("sum",o,s);let[c,p]=I.computeOutAndReduceShapes(d.shape,o),h=c;a&&(h=I.expandShapeToKeepDim(c,i));let m=v.sizeFromShape(p),f=v.sizeFromShape(e.shape)/m,g=pe({inputs:{x:d},attrs:{shape:[f,m]},backend:n}),y=Lp(e.dtype),x=hl(g,y,"sum",n),A=pe({inputs:{x},attrs:{shape:h},backend:n});return n.disposeIntermediateTensorInfo(g),n.disposeIntermediateTensorInfo(x),u&&n.disposeIntermediateTensorInfo(d),A}function c0(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;return Qq(r,s,i,a)}var eX={kernelName:Qo,backendName:"webgl",kernelFunc:c0};function Ta(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{perm:s}=n,i=a,o=r.shape.length,l=new Array(o);for(let d=0;d`Error in matMul: inner shapes (${c}) and (${p}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${a} and transposeB=${n} must match.`);let b=a?[y,c,h]:[y,h,c],w=n?[x,m,p]:[x,p,m],S=pe({inputs:{x:e},backend:r,attrs:{shape:b}}),C=pe({inputs:{x:t},backend:r,attrs:{shape:w}}),N=[S,C],M=Math.max(y,x),F=a?S.shape[1]:S.shape[2],E=s!=null,T=i!=null,D=l==="leakyrelu",O=l!=null?op(l,!0):null,W=E||T||D||O!=null,$;if((h===1||m===1)&&F>Ww&&W===!1){let G=S,q=C;a&&(G=Ta({inputs:{x:S},backend:r,attrs:{perm:[0,2,1]}}),N.push(G)),n&&(q=Ta({inputs:{x:C},backend:r,attrs:{perm:[0,2,1]}}),N.push(q));let H=m!==1,V=m===1,Z=G;H&&(Z=pe({inputs:{x:G},backend:r,attrs:{shape:[M,F,1]}}),N.push(Z));let X=m===1?2:1,re=q;V&&(re=pe({inputs:{x:q},backend:r,attrs:{shape:[M,1,F]}}),N.push(re));let ee=X3({inputs:{a:Z,b:re},backend:r});$=c0({inputs:{x:ee},backend:r,attrs:{axis:X,keepDims:!0}}),N.push(ee)}else{let G=Qt(e.dtype,t.dtype),q=new Lw(b,w,[M,h,m],a,n,E,O,T,D),H=[S,C];if(s!=null&&H.push(s),T&&H.push(i),D){let V=r.makeTensorInfo([],"float32",v.createScalarValue(o,"float32"));H.push(V),N.push(V)}$=r.runWebGLProgram(q,H,G)}let U=pe({inputs:{x:$},backend:r,attrs:{shape:A}});N.push($);for(let G of N)r.disposeIntermediateTensorInfo(G);return U}function aX(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:d,leakyreluAlpha:c}=n;return Rh({a:r,b:s,transposeA:l,transposeB:u,backend:a,bias:i,preluActivationWeights:o,leakyreluAlpha:c,activation:d})}var nX={kernelName:ts,backendName:"webgl",kernelFunc:aX},j5="return abs(x);";function rX(e){let{inputs:t,backend:a}=e,{x:n}=t;if(a.shouldExecuteOnCPU([n])&&n.dtype!=="complex64"){let s=a.texData.get(n.dataId),i=Rw(s.values);return a.makeTensorInfo(n.shape,n.dtype,i)}let r;return B().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Zr(n.shape,j5):r=new Qn(n.shape,j5),a.runWebGLProgram(r,[n],n.dtype)}var sX={kernelName:cu,backendName:"webgl",kernelFunc:rX},iX=$n+` if (abs(x) > 1.) { return NAN; } return acos(x); -`,hq=tt({opSnippet:cq}),mq={kernelName:si,backendName:"webgl",kernelFunc:hq},fq=En+` +`,oX=tt({opSnippet:iX}),lX={kernelName:$i,backendName:"webgl",kernelFunc:oX},uX=$n+` if (x < 1.0) return NAN; -return log(x + sqrt(x * x - 1.0));`,gq=tt({opSnippet:fq}),yq={kernelName:ii,backendName:"webgl",kernelFunc:gq},_5="return a + b;",xq=ha({opSnippet:_5,packedOpSnippet:_5,supportsComplex:!0,cpuKernelImpl:CH}),Aq={kernelName:is,backendName:"webgl",kernelFunc:xq},bq=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let a=[];this.variableNames.forEach(r=>{a.push(`float v${r} = get${r}AtOutCoords();`)});let n=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` +return log(x + sqrt(x * x - 1.0));`,dX=tt({opSnippet:uX}),pX={kernelName:Di,backendName:"webgl",kernelFunc:dX},q5="return a + b;",cX=ha({opSnippet:q5,packedOpSnippet:q5,supportsComplex:!0,cpuKernelImpl:bj}),hX={kernelName:Mr,backendName:"webgl",kernelFunc:cX},mX=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let a=[];this.variableNames.forEach(r=>{a.push(`float v${r} = get${r}AtOutCoords();`)});let n=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${a.join(` `)} @@ -1531,7 +1531,7 @@ return log(x + sqrt(x * x - 1.0));`,gq=tt({opSnippet:fq}),yq={kernelName:ii,back float result = ${n}; setOutput(result); } - `}},vq=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let a=[];this.variableNames.forEach(r=>{a.push(`vec4 v${r} = get${r}AtOutCoords();`)});let n=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` + `}},fX=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((r,s)=>`T${s}`);let a=[];this.variableNames.forEach(r=>{a.push(`vec4 v${r} = get${r}AtOutCoords();`)});let n=this.variableNames.map(r=>`v${r}`).join(" + ");this.userCode=` void main() { ${a.join(` `)} @@ -1539,7 +1539,7 @@ return log(x + sqrt(x * x - 1.0));`,gq=tt({opSnippet:fq}),yq={kernelName:ii,back vec4 result = ${n}; setOutput(result); } - `}};function sh(e){let{inputs:t,backend:a}=e,n=t;if(n.length===1)return Qa({inputs:{x:n[0]},backend:a});if(n.length>B().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(n.length/2),l=sh({inputs:n.slice(0,o),backend:a}),u=sh({inputs:n.slice(o),backend:a});return sh({inputs:[l,u],backend:a})}let r=n.map(o=>o.dtype).reduce((o,l)=>da(o,l)),s=n.map(o=>o.shape),i=B().getBool("WEBGL_PACK")?new vq(n[0].shape,s):new bq(n[0].shape,s);return a.runWebGLProgram(i,n,r)}var wq={kernelName:oi,backendName:"webgl",kernelFunc:sh};function kq(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=r.shape.length,l=v.parseAxisParam(s,r.shape),u=l,p=C.getAxesPermutation(u,o),c=r;p!=null&&(c=Ca({inputs:{x:r},backend:a,attrs:{perm:p}}),u=C.getInnerMostAxes(u.length,o)),C.assertAxesAreInnerMostDims("all",u,o);let[d,h]=C.computeOutAndReduceShapes(c.shape,u),m=v.sizeFromShape(h),f=pe({inputs:{x:c},backend:a,attrs:{shape:[-1,m]}}),g=rl(f,f.dtype,"all",a),y;if(i){let x=C.expandShapeToKeepDim(d,l);y=pe({inputs:{x:g},backend:a,attrs:{shape:x}})}else y=pe({inputs:{x:g},backend:a,attrs:{shape:d}});return a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(g),p!=null&&a.disposeIntermediateTensorInfo(c),y}var Iq={kernelName:li,backendName:"webgl",kernelFunc:kq};function Sq(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=r.shape.length,l=v.parseAxisParam(s,r.shape),u=l,p=C.getAxesPermutation(u,o),c=r;p!=null&&(c=Ca({inputs:{x:r},backend:a,attrs:{perm:p}}),u=C.getInnerMostAxes(u.length,o)),C.assertAxesAreInnerMostDims("any",u,o);let[d,h]=C.computeOutAndReduceShapes(c.shape,u),m=v.sizeFromShape(h),f=pe({inputs:{x:c},backend:a,attrs:{shape:[-1,m]}}),g=rl(f,f.dtype,"any",a),y;if(i){let x=C.expandShapeToKeepDim(d,l);y=pe({inputs:{x:g},backend:a,attrs:{shape:x}})}else y=pe({inputs:{x:g},backend:a,attrs:{shape:d}});return a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(g),p!=null&&a.disposeIntermediateTensorInfo(c),y}var Cq={kernelName:ui,backendName:"webgl",kernelFunc:Sq},Tq=class{constructor(e,t,a){this.variableNames=["A"];let{windowSize:n,batchSize:r,outSize:s}=e;a||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];let i=t==="max"?">":"<",o=a?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` + `}};function hh(e){let{inputs:t,backend:a}=e,n=t;if(n.length===1)return tn({inputs:{x:n[0]},backend:a});if(n.length>B().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let o=Math.floor(n.length/2),l=hh({inputs:n.slice(0,o),backend:a}),u=hh({inputs:n.slice(o),backend:a});return hh({inputs:[l,u],backend:a})}let r=n.map(o=>o.dtype).reduce((o,l)=>Qt(o,l)),s=n.map(o=>o.shape),i=B().getBool("WEBGL_PACK")?new fX(n[0].shape,s):new mX(n[0].shape,s);return a.runWebGLProgram(i,n,r)}var gX={kernelName:Pi,backendName:"webgl",kernelFunc:hh};function yX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=r.shape.length,l=v.parseAxisParam(s,r.shape),u=l,d=I.getAxesPermutation(u,o),c=r;d!=null&&(c=Ta({inputs:{x:r},backend:a,attrs:{perm:d}}),u=I.getInnerMostAxes(u.length,o)),I.assertAxesAreInnerMostDims("all",u,o);let[p,h]=I.computeOutAndReduceShapes(c.shape,u),m=v.sizeFromShape(h),f=pe({inputs:{x:c},backend:a,attrs:{shape:[-1,m]}}),g=hl(f,f.dtype,"all",a),y;if(i){let x=I.expandShapeToKeepDim(p,l);y=pe({inputs:{x:g},backend:a,attrs:{shape:x}})}else y=pe({inputs:{x:g},backend:a,attrs:{shape:p}});return a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(g),d!=null&&a.disposeIntermediateTensorInfo(c),y}var xX={kernelName:_i,backendName:"webgl",kernelFunc:yX};function AX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=r.shape.length,l=v.parseAxisParam(s,r.shape),u=l,d=I.getAxesPermutation(u,o),c=r;d!=null&&(c=Ta({inputs:{x:r},backend:a,attrs:{perm:d}}),u=I.getInnerMostAxes(u.length,o)),I.assertAxesAreInnerMostDims("any",u,o);let[p,h]=I.computeOutAndReduceShapes(c.shape,u),m=v.sizeFromShape(h),f=pe({inputs:{x:c},backend:a,attrs:{shape:[-1,m]}}),g=hl(f,f.dtype,"any",a),y;if(i){let x=I.expandShapeToKeepDim(p,l);y=pe({inputs:{x:g},backend:a,attrs:{shape:x}})}else y=pe({inputs:{x:g},backend:a,attrs:{shape:p}});return a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(g),d!=null&&a.disposeIntermediateTensorInfo(c),y}var bX={kernelName:Oi,backendName:"webgl",kernelFunc:AX},vX=class{constructor(e,t,a){this.variableNames=["A"];let{windowSize:n,batchSize:r,outSize:s}=e;a||this.variableNames.push("bestIndicesA"),this.outputShape=[r,s];let i=t==="max"?">":"<",o=a?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -1559,15 +1559,15 @@ return log(x + sqrt(x * x - 1.0));`,gq=tt({opSnippet:fq}),yq={kernelName:ii,back } setOutput(float(bestIndex)); } - `}},Nq=class{constructor(e,t,a,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,v.assert(e.length>2,()=>`Packed arg${a.charAt(0).toUpperCase()+a.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),n||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,l=mt(o),u=ka("coords",o),p,c;if(s===1){c=o+1;let T=mt(c);p=` - ${T} sourceLocR = ${T}(${u.join()}, 0); + `}},wX=class{constructor(e,t,a,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,v.assert(e.length>2,()=>`Packed arg${a.charAt(0).toUpperCase()+a.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),n||this.variableNames.push("bestIndicesA");let i=this.outputShape,o=i.length,l=ft(o),u=ka("coords",o),d,c;if(s===1){c=o+1;let C=ft(c);d=` + ${C} sourceLocR = ${C}(${u.join()}, 0); ++${u[o-1]}; - ${T} sourceLocG = ${T}(${u.join()}, 0); + ${C} sourceLocG = ${C}(${u.join()}, 0); ++${u[o-2]}; - ${T} sourceLocA = ${T}(${u.join()}, 0); + ${C} sourceLocA = ${C}(${u.join()}, 0); --${u[o-1]}; - ${T} sourceLocB = ${T}(${u.join()}, 0); - --${u[o-2]};`}else c=o,p=` + ${C} sourceLocB = ${C}(${u.join()}, 0); + --${u[o-2]};`}else c=o,d=` ${l} sourceLocR = coords; ++${u[o-1]}; ${l} sourceLocG = coords; @@ -1575,7 +1575,7 @@ return log(x + sqrt(x * x - 1.0));`,gq=tt({opSnippet:fq}),yq={kernelName:ii,back ${l} sourceLocA = coords; --${u[o-1]}; ${l} sourceLocB = coords; - --${u[o-2]};`;let d=["x","y","z","w","u","v"].slice(0,c),h="."+d[c-1],m=d.map(T=>"int "+T),f=ka("sourceLocR",c-1).concat("inIdx.r"),g=ka("sourceLocG",c-1).concat("inIdx.g"),y=ka("sourceLocB",c-1).concat("inIdx.b"),x=ka("sourceLocA",c-1).concat("inIdx.a"),A=a==="max"?"greaterThan":"lessThan",b=n?"":` + --${u[o-2]};`;let p=["x","y","z","w","u","v"].slice(0,c),h="."+p[c-1],m=p.map(C=>"int "+C),f=ka("sourceLocR",c-1).concat("inIdx.r"),g=ka("sourceLocG",c-1).concat("inIdx.g"),y=ka("sourceLocB",c-1).concat("inIdx.b"),x=ka("sourceLocA",c-1).concat("inIdx.a"),A=a==="max"?"greaterThan":"lessThan",b=n?"":` inIdx = round(vec4(getBestIndicesAChannel(${f.join()}), getBestIndicesAChannel(${g.join()}), getBestIndicesAChannel(${y.join()}), @@ -1583,21 +1583,21 @@ return log(x + sqrt(x * x - 1.0));`,gq=tt({opSnippet:fq}),yq={kernelName:ii,back getAChannel(${f.join()}), hasNextCol ? getAChannel(${g.join()}) : 0., hasNextRow ? getAChannel(${y.join()}) : 0., - hasNextRow && hasNextCol ? getAChannel(${x.join()}) : 0.)`,I=n?"":` + hasNextRow && hasNextCol ? getAChannel(${x.join()}) : 0.)`,S=n?"":` float getBestIndicesAChannel(${m.join()}) { - return getChannel(getBestIndicesA(${d.join()}), - vec2(${d.slice(-2).join()})); + return getChannel(getBestIndicesA(${p.join()}), + vec2(${p.slice(-2).join()})); }`;this.userCode=` float getAChannel(${m.join()}) { - return getChannel(getA(${d.join()}), - vec2(${d.slice(-2).join()})); + return getChannel(getA(${p.join()}), + vec2(${p.slice(-2).join()})); } - ${I} + ${S} void main() { ${l} coords = getOutputCoords(); bool hasNextCol = ${u[o-1]} < ${i[o-1]-1}; bool hasNextRow = ${u[o-2]} < ${i[o-2]-1}; - ${p} + ${d} ivec4 srcIdx = ivec4(sourceLocR${h}, sourceLocG${h}, sourceLocB${h}, sourceLocA${h}) * ${t}; ivec4 inIdx = srcIdx; @@ -1621,27 +1621,27 @@ return log(x + sqrt(x * x - 1.0));`,gq=tt({opSnippet:fq}),yq={kernelName:ii,back } setOutput(bestIndex); } - `}};function v8(e,t,a,n=null){let r=t.shape[0],s=t.shape[1];n!=null&&(r=n.shape[0],s=n.shape[1]);let i=C.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:r,outSize:Math.ceil(s/i)},l=new Tq(o,a,n==null),u=[t];n!=null&&u.push(n);let p=e.runWebGLProgram(l,u,"int32");if(p.shape[1]===1)return p;let c=v8(e,t,a,p);return e.disposeIntermediateTensorInfo(p),c}function w8(e,t,a,n=null){let r=n!=null?n.shape:t.shape,s=r[r.length-1],i=C.computeOptimalWindowSize(s),o=new Nq(r,i,a,n==null),l=n==null?[t]:[t,n],u=e.runWebGLProgram(o,l,"int32");if(u.shape.length===t.shape.length){let p=w8(e,t,a,u);return e.disposeIntermediateTensorInfo(u),p}return u}function k8(e,t,a,n){let r=[a];if(C.assertAxesAreInnerMostDims("arg"+n.charAt(0).toUpperCase()+n.slice(1),r,t.shape.length),!B().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],i=e.texData.get(t.dataId),o=i!==null&&i.isPacked,l=t;o&&(l=e.unpackTensor(t),s.push(l));let[u,p]=C.computeOutAndReduceShapes(l.shape,r),c=v.sizeFromShape(p),d=pe({inputs:{x:l},backend:e,attrs:{shape:[-1,c]}});s.push(d);let h=v8(e,d,n);s.push(h);let m=pe({inputs:{x:h},backend:e,attrs:{shape:u}});return s.forEach(f=>e.disposeIntermediateTensorInfo(f)),m}return w8(e,t,n)}function Rq(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=Ca({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let p=k8(a,l,i[0],"max");return u.forEach(c=>a.disposeIntermediateTensorInfo(c)),p}var Eq={kernelName:su,backendName:"webgl",kernelFunc:Rq};function Mq(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=Ca({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let p=k8(a,l,i[0],"min");return u.forEach(c=>a.disposeIntermediateTensorInfo(c)),p}var Pq={kernelName:iu,backendName:"webgl",kernelFunc:Mq},_q=En+` + `}};function Bw(e,t,a,n=null){let r=t.shape[0],s=t.shape[1];n!=null&&(r=n.shape[0],s=n.shape[1]);let i=I.computeOptimalWindowSize(s),o={windowSize:i,inSize:s,batchSize:r,outSize:Math.ceil(s/i)},l=new vX(o,a,n==null),u=[t];n!=null&&u.push(n);let d=e.runWebGLProgram(l,u,"int32");if(d.shape[1]===1)return d;let c=Bw(e,t,a,d);return e.disposeIntermediateTensorInfo(d),c}function Vw(e,t,a,n=null){let r=n!=null?n.shape:t.shape,s=r[r.length-1],i=I.computeOptimalWindowSize(s),o=new wX(r,i,a,n==null),l=n==null?[t]:[t,n],u=e.runWebGLProgram(o,l,"int32");if(u.shape.length===t.shape.length){let d=Vw(e,t,a,u);return e.disposeIntermediateTensorInfo(u),d}return u}function Uw(e,t,a,n){let r=[a];if(I.assertAxesAreInnerMostDims("arg"+n.charAt(0).toUpperCase()+n.slice(1),r,t.shape.length),!B().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],i=e.texData.get(t.dataId),o=i!==null&&i.isPacked,l=t;o&&(l=e.unpackTensor(t),s.push(l));let[u,d]=I.computeOutAndReduceShapes(l.shape,r),c=v.sizeFromShape(d),p=pe({inputs:{x:l},backend:e,attrs:{shape:[-1,c]}});s.push(p);let h=Bw(e,p,n);s.push(h);let m=pe({inputs:{x:h},backend:e,attrs:{shape:u}});return s.forEach(f=>e.disposeIntermediateTensorInfo(f)),m}return Vw(e,t,n)}function kX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=I.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=Ta({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=I.getInnerMostAxes(i.length,l.shape.length)),I.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let d=Uw(a,l,i[0],"max");return u.forEach(c=>a.disposeIntermediateTensorInfo(c)),d}var IX={kernelName:hu,backendName:"webgl",kernelFunc:kX};function SX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=I.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=Ta({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=I.getInnerMostAxes(i.length,l.shape.length)),I.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let d=Uw(a,l,i[0],"min");return u.forEach(c=>a.disposeIntermediateTensorInfo(c)),d}var TX={kernelName:mu,backendName:"webgl",kernelFunc:SX},CX=$n+` if (abs(x) > 1.) { return NAN; } return asin(x); -`,$q=tt({opSnippet:_q}),Fq={kernelName:di,backendName:"webgl",kernelFunc:$q},Dq=En+"return log(x + sqrt(x * x + 1.0));",Oq=tt({opSnippet:Dq}),zq={kernelName:pi,backendName:"webgl",kernelFunc:Oq},Lq=En+` +`,NX=tt({opSnippet:CX}),RX={kernelName:zi,backendName:"webgl",kernelFunc:NX},EX=$n+"return log(x + sqrt(x * x + 1.0));",MX=tt({opSnippet:EX}),FX={kernelName:Li,backendName:"webgl",kernelFunc:MX},$X=$n+` return atan(x); -`,Wq=tt({opSnippet:Lq}),Bq={kernelName:ci,backendName:"webgl",kernelFunc:Wq},Vq=O3+` +`,DX=tt({opSnippet:$X}),PX={kernelName:Wi,backendName:"webgl",kernelFunc:DX},_X=q3+` return atan(a, b); -`,Uq=` +`,OX=` vec4 result = atan(a, b); bvec4 isNaNA = isnan(a); bvec4 isNaNB = isnan(b); bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); - `+nl+` + `+cl+` return result; -`,Gq=ha({opSnippet:Vq,packedOpSnippet:Uq}),Hq={kernelName:mi,backendName:"webgl",kernelFunc:Gq},jq=En+` +`,zX=ha({opSnippet:_X,packedOpSnippet:OX}),LX={kernelName:Vi,backendName:"webgl",kernelFunc:zX},WX=$n+` if ((x < -1.0) || (x > 1.0)) return NAN; -return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelName:hi,backendName:"webgl",kernelFunc:qq},Qd=class{constructor(e,t,a,n=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,p=e.effectiveFilterHeight,c=e.effectiveFilterWidth,d=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`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),a){let T=">=";this.userCode=` +return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,BX=tt({opSnippet:WX}),VX={kernelName:Bi,backendName:"webgl",kernelFunc:BX},lp=class{constructor(e,t,a,n=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideHeight,o=e.strideWidth,l=e.dilationHeight,u=e.dilationWidth,d=e.effectiveFilterHeight,c=e.effectiveFilterWidth,p=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`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,y="0.0";if(m||(y="-1.0 / 1e-20"),a){let C=">=";this.userCode=` const ivec2 strides = ivec2(${i}, ${o}); - const ivec2 pads = ivec2(${d}, ${h}); + const ivec2 pads = ivec2(${p}, ${h}); void main() { ivec4 coords = getOutputCoords(); @@ -1659,7 +1659,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam int minMaxPosition = 0; float avgValue = 0.0; - for (int wR = 0; wR < ${p}; + for (int wR = 0; wR < ${d}; wR += ${l}) { int xR = xRCorner + wR; @@ -1681,7 +1681,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); - if (value ${T} currMinMaxValue) { + if (value ${C} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; minMaxPosition = ${n?r?f:g:`wR * ${c} + wC`}; @@ -1690,7 +1690,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(float(minMaxPosition)); } - `;return}let x="max",A=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(A="avgValue / max(count, 1.0)");let b=Math.floor(s/4)*4,w=s%4,I=` + `;return}let x="max",A=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(A="avgValue / max(count, 1.0)");let b=Math.floor(s/4)*4,w=s%4,S=` if (${m}) { avgValue += dot(values, ones); } else { @@ -1698,7 +1698,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } `;this.userCode=` const ivec2 strides = ivec2(${i}, ${o}); - const ivec2 pads = ivec2(${d}, ${h}); + const ivec2 pads = ivec2(${p}, ${h}); const float initializationValue = ${y}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); @@ -1727,7 +1727,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam float avgValue = 0.0; count = 0.0; - for (int wR = 0; wR < ${p}; + for (int wR = 0; wR < ${d}; wR += ${l}) { int xR = xRCorner + wR; @@ -1745,7 +1745,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam getValue(batch, xR, xC + 3 * ${u}, d) ); - ${I} + ${S} } int xC = xCCorner + ${b}; @@ -1757,7 +1757,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam initializationValue ); - ${I} + ${S} } else if (${w===2}) { vec4 values = vec4( getValue(batch, xR, xC, d), @@ -1766,7 +1766,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam initializationValue ); - ${I} + ${S} } else if (${w===3}) { vec4 values = vec4( getValue(batch, xR, xC, d), @@ -1775,12 +1775,12 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam initializationValue ); - ${I} + ${S} } } setOutput(${A}); } - `}},L3=class{constructor(e,t,a,n=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,p=e.dilationHeight,c=e.dilationWidth,d=e.effectiveFilterDepth,h=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let x=t==="avg",A="0.0";if(x||(A="-1.0 / 1e-20"),a){let M=">=";this.userCode=` + `}},K3=class{constructor(e,t,a,n=!1,r=!1){if(this.variableNames=["x"],t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");let s=e.filterWidth,i=e.strideDepth,o=e.strideHeight,l=e.strideWidth,u=e.dilationDepth,d=e.dilationHeight,c=e.dilationWidth,p=e.effectiveFilterDepth,h=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;let x=t==="avg",A="0.0";if(x||(A="-1.0 / 1e-20"),a){let M=">=";this.userCode=` const ivec3 strides = ivec3(${i}, ${o}, ${l}); const ivec3 pads = ivec3(${f}, ${g}, ${y}); @@ -1801,7 +1801,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam float minMaxValueFound = 0.0; int minMaxPosition = 0; - for (int wD = 0; wD < ${d}; + for (int wD = 0; wD < ${p}; wD += ${u}) { int xD = xDCorner + wD; @@ -1810,7 +1810,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } for (int wR = 0; wR < ${h}; - wR += ${p}) { + wR += ${d}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { @@ -1842,7 +1842,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(float(minMaxPosition)); } - `;return}let b="max",w=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(w="avgValue / max(count, 1.0)");let I=Math.floor(s/4)*4,T=s%4,N=` + `;return}let b="max",w=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(w="avgValue / max(count, 1.0)");let S=Math.floor(s/4)*4,C=s%4,N=` if (${x}) { avgValue += dot(values, ones); } else { @@ -1881,7 +1881,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam float avgValue = 0.0; count = 0.0; - for (int wD = 0; wD < ${d}; + for (int wD = 0; wD < ${p}; wD += ${u}) { int xD = xDCorner + wD; @@ -1890,14 +1890,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } for (int wR = 0; wR < ${h}; - wR += ${p}) { + wR += ${d}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int wC = 0; wC < ${I}; wC += 4) { + for (int wC = 0; wC < ${S}; wC += 4) { int xC = xCCorner + wC * ${c}; vec4 values = vec4( @@ -1910,8 +1910,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ${N} } - int xC = xCCorner + ${I}; - if (${T===1}) { + int xC = xCCorner + ${S}; + if (${C===1}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), initializationValue, @@ -1920,7 +1920,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ); ${N} - } else if (${T===2}) { + } else if (${C===2}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), getValue(batch, xD, xR, xC + ${c}, ch), @@ -1929,7 +1929,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ); ${N} - } else if (${T===3}) { + } else if (${C===3}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), getValue(batch, xD, xR, xC + ${c}, ch), @@ -1943,8 +1943,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(${w}); } - `}};function Kq(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t;Gu(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=1;v.assert(C.eitherStridesOrDilationsAreOne(i,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let p=C.computePool2DInfo(r.shape,s,i,u,o,l);if(p.filterWidth===1&&p.filterHeight===1&&v.arraysEqual(p.inShape,p.outShape))return Qa({inputs:{x:r},backend:a});let c=new Qd(p,"avg",!1);return a.runWebGLProgram(c,[r],"float32")}var Yq={kernelName:fi,backendName:"webgl",kernelFunc:Kq};function Zq(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n,p=[1,1,1],c=C.computePool3DInfo(r.shape,s,i,p,o,l,u),d=new L3(c,"avg",!1);return a.runWebGLProgram(d,[r],"float32")}var Jq={kernelName:ou,backendName:"webgl",kernelFunc:Zq},Qq=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,a=e.filterWidth,n=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=o-1-e.padInfo.top,p=l-1-e.padInfo.left,c=1/(t*a);this.userCode=` - const ivec2 pads = ivec2(${u}, ${p}); + `}};function UX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t;Ju(r,"avgPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=1;v.assert(I.eitherStridesOrDilationsAreOne(i,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=I.computePool2DInfo(r.shape,s,i,u,o,l);if(d.filterWidth===1&&d.filterHeight===1&&v.arraysEqual(d.inShape,d.outShape))return tn({inputs:{x:r},backend:a});let c=new lp(d,"avg",!1);return a.runWebGLProgram(c,[r],"float32")}var GX={kernelName:Ui,backendName:"webgl",kernelFunc:UX};function HX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n,d=[1,1,1],c=I.computePool3DInfo(r.shape,s,i,d,o,l,u),p=new K3(c,"avg",!1);return a.runWebGLProgram(p,[r],"float32")}var jX={kernelName:fu,backendName:"webgl",kernelFunc:HX},qX=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,a=e.filterWidth,n=e.strideHeight,r=e.strideWidth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterHeight,l=e.effectiveFilterWidth,u=o-1-e.padInfo.top,d=l-1-e.padInfo.left,c=1/(t*a);this.userCode=` + const ivec2 pads = ivec2(${u}, ${d}); const float avgMultiplier = float(${c}); void main() { @@ -1985,7 +1985,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}},eX=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,a=e.filterHeight,n=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,p=e.effectiveFilterDepth,c=e.effectiveFilterHeight,d=e.effectiveFilterWidth,h=p-1-e.padInfo.front,m=c-1-e.padInfo.top,f=d-1-e.padInfo.left,g=1/(t*a*n);this.userCode=` + `}},XX=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,a=e.filterHeight,n=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,d=e.effectiveFilterDepth,c=e.effectiveFilterHeight,p=e.effectiveFilterWidth,h=d-1-e.padInfo.front,m=c-1-e.padInfo.top,f=p-1-e.padInfo.left,g=1/(t*a*n);this.userCode=` const ivec3 pads = ivec3(${h}, ${m}, ${f}); const float avgMultiplier = float(${g}); @@ -2004,7 +2004,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wD = 0; wD < ${p}; + for (int wD = 0; wD < ${d}; wD += ${o}) { float dyD = float(dyDCorner + wD) / ${r}.0; @@ -2023,7 +2023,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } int idyR = int(dyR); - for (int wC = 0; wC < ${d}; + for (int wC = 0; wC < ${p}; wC += ${u}) { float dyC = float(dyCCorner + wC) / ${i}.0; @@ -2041,7 +2041,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}};function tX(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:p}=n,c=[1,1,1],d=C.computePool3DInfo(i.shape,o,l,c,u,p),h=new eX(d);return a.runWebGLProgram(h,[r],i.dtype)}var aX={kernelName:lp,backendName:"webgl",kernelFunc:tX};function nX(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s;Gu([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=n,p=C.computePool2DInfo(i.shape,o,l,1,u),c=new Qq(p);return a.runWebGLProgram(c,[r],i.dtype)}var rX={kernelName:op,backendName:"webgl",kernelFunc:nX};function sX(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;return wh({a:r,b:s,transposeA:i,transposeB:o,backend:a})}var iX={kernelName:gi,backendName:"webgl",kernelFunc:sX},oX=class{constructor(e,t,a,n,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,a);let i="0.0";n!=null&&(C.assertAndGetBroadcastShape(e,n),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=` + `}};function KX(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:d}=n,c=[1,1,1],p=I.computePool3DInfo(i.shape,o,l,c,u,d),h=new XX(p);return a.runWebGLProgram(h,[r],i.dtype)}var YX={kernelName:yp,backendName:"webgl",kernelFunc:KX};function ZX(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s;Ju([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=n,d=I.computePool2DInfo(i.shape,o,l,1,u),c=new qX(d);return a.runWebGLProgram(c,[r],i.dtype)}var JX={kernelName:gp,backendName:"webgl",kernelFunc:ZX};function QX(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;return Rh({a:r,b:s,transposeA:i,transposeB:o,backend:a})}var eK={kernelName:Gi,backendName:"webgl",kernelFunc:QX},tK=class{constructor(e,t,a,n,r,s){this.outputShape=[],this.variableNames=["x","mean","variance"],I.assertAndGetBroadcastShape(e,t),I.assertAndGetBroadcastShape(e,a);let i="0.0";n!=null&&(I.assertAndGetBroadcastShape(e,n),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="1.0";r!=null&&(I.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { float x = getXAtOutCoords(); float mean = getMeanAtOutCoords(); @@ -2051,7 +2051,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam float inv = scale * inversesqrt(variance + float(${s})); setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); } - `}},lX=class{constructor(e,t,a,n,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,a);let i="vec4(0.0)";n!=null&&(C.assertAndGetBroadcastShape(e,n),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=` + `}},aK=class{constructor(e,t,a,n,r,s){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],I.assertAndGetBroadcastShape(e,t),I.assertAndGetBroadcastShape(e,a);let i="vec4(0.0)";n!=null&&(I.assertAndGetBroadcastShape(e,n),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let o="vec4(1.0)";r!=null&&(I.assertAndGetBroadcastShape(e,r),this.variableNames.push("scale"),o="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { vec4 offset = ${i}; vec4 scale = ${o}; @@ -2064,7 +2064,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam setOutput((x - mean) * inv + offset); } - `}},uX=({inputs:e,backend:t,attrs:a})=>{let{x:n,mean:r,variance:s,offset:i,scale:o}=e;v.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),v.assert(i==null||r.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),v.assert(o==null||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=a;l==null&&(l=.001);let u=[n,r,s],p=null;i!=null&&(p=i.shape,u.push(i));let c=null;o!=null&&(c=o.shape,u.push(o));let d=B().getBool("WEBGL_PACK_NORMALIZATION")?new lX(n.shape,r.shape,s.shape,p,c,l):new oX(n.shape,r.shape,s.shape,p,c,l);return t.runWebGLProgram(d,u,u[0].dtype)},dX={kernelName:Bi,backendName:"webgl",kernelFunc:uX},pX=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=mt(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let a=cX(this.rank),n,r=e.map((s,i)=>`sourceLoc.${z1[i]} = start[${i}] + coords.${z1[i]};`);n=` + `}},nK=({inputs:e,backend:t,attrs:a})=>{let{x:n,mean:r,variance:s,offset:i,scale:o}=e;v.assert(r.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),v.assert(i==null||r.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),v.assert(o==null||r.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=a;l==null&&(l=.001);let u=[n,r,s],d=null;i!=null&&(d=i.shape,u.push(i));let c=null;o!=null&&(c=o.shape,u.push(o));let p=B().getBool("WEBGL_PACK_NORMALIZATION")?new aK(n.shape,r.shape,s.shape,d,c,l):new tK(n.shape,r.shape,s.shape,d,c,l);return t.runWebGLProgram(p,u,u[0].dtype)},rK={kernelName:po,backendName:"webgl",kernelFunc:nK},sK=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=ft(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let a=iK(this.rank),n,r=e.map((s,i)=>`sourceLoc.${H1[i]} = start[${i}] + coords.${H1[i]};`);n=` ${t} sourceLoc; ${t} coords = getOutputCoords(); ${r.join(` @@ -2074,7 +2074,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ${n} setOutput(getSource(${a})); } - `}},z1=["x","y","z","w","u","v"];function cX(e){if(e===1)return"sourceLoc";if(e<=6)return z1.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var hX=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let t=mt(this.rank),a=ka("coords",this.rank),n=ka("sourceLoc",this.rank),r=this.rank===1?"sourceLoc":`vec2(${n.slice(-2).join()})`,s=`getChannel(getSource(${n.join()}), ${r})`,i=` + `}},H1=["x","y","z","w","u","v"];function iK(e){if(e===1)return"sourceLoc";if(e<=6)return H1.slice(0,e).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}var oK=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let t=ft(this.rank),a=ka("coords",this.rank),n=ka("sourceLoc",this.rank),r=this.rank===1?"sourceLoc":`vec2(${n.slice(-2).join()})`,s=`getChannel(getSource(${n.join()}), ${r})`,i=` result.x = ${s}; if (++${a[this.rank-1]} < ${e[this.rank-1]}) { ++${n[this.rank-1]}; @@ -2092,7 +2092,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } } `,l=this.rank<=4?`sourceLoc = coords + - ${t}(${e.map((u,p)=>`start[${p}]`).join()});`:e.map((u,p)=>`${n[p]} = ${a[p]} + start[${p}];`).join(` + ${t}(${e.map((u,d)=>`start[${d}]`).join()});`:e.map((u,d)=>`${n[d]} = ${a[d]} + start[${d}];`).join(` `);this.userCode=` void main() { ${t} coords = getOutputCoords(); @@ -2103,15 +2103,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ${o} setOutput(result); } - `}};function mX(e,t,a,n){let r=n.texData.get(e.dataId),s=n.makeTensorInfo(a,e.dtype),i=n.texData.get(s.dataId);Object.assign(i,r),i.refCount=1,i.shape=a,i.dtype=e.dtype;let o=Nt.computeFlatOffset(t,v.computeStrides(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};let l=n.dataRefCount.get(i.slice.origDataId)||1;return n.dataRefCount.set(i.slice.origDataId,l+1),s}function Zu(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,size:i}=n,[o,l]=Nt.parseSliceParams(r,s,i);if(Nt.assertParamsValid(r,o,l),v.sizeFromShape(l)===0)return a.makeTensorInfo(l,r.dtype,[]);if(a.shouldExecuteOnCPU([r])||r.dtype==="string"){let c=a.texData.get(r.dataId),d=rj(c.values,o,l,r.shape,r.dtype);return a.makeTensorInfo(l,r.dtype,d)}let{isPacked:u}=a.texData.get(r.dataId),p=Nt.isSliceContinous(r.shape,o,l);if(u||!p){let c=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new hX(l):new pX(l),d=[o];return a.runWebGLProgram(c,[r],r.dtype,d)}return a.uploadToGPU(r.dataId),mX(r,o,l,a)}var fX={kernelName:Mu,backendName:"webgl",kernelFunc:Zu},gX=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,crops:i}=n;v.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((x,A)=>x*A),l=C.getReshaped(r.shape,s,o),u=C.getPermuted(l.length,s.length),p=C.getReshapedPermuted(r.shape,s,o),c=C.getSliceBeginCoords(i,s.length),d=C.getSliceSize(p,i,s.length),h=[],m=pe({inputs:{x:r},backend:a,attrs:{shape:l}}),f=Ca({inputs:{x:m},backend:a,attrs:{perm:u}}),g=pe({inputs:{x:f},backend:a,attrs:{shape:p}}),y=Zu({inputs:{x:g},backend:a,attrs:{begin:c,size:d}});return h.push(m),h.push(f),h.push(g),h.forEach(x=>a.disposeIntermediateTensorInfo(x)),y},yX={kernelName:lu,backendName:"webgl",kernelFunc:gX};function xX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i}=n,o=a.readSync(r.dataId),l=a.readSync(s.dataId),u=l8(o,l,s.dtype,s.shape,i);return a.makeTensorInfo([i],s.dtype,u)}var AX={kernelName:yi,backendName:"webgl",kernelFunc:xX},bX=` + `}};function lK(e,t,a,n){let r=n.texData.get(e.dataId),s=n.makeTensorInfo(a,e.dtype),i=n.texData.get(s.dataId);Object.assign(i,r),i.refCount=1,i.shape=a,i.dtype=e.dtype;let o=wt.computeFlatOffset(t,v.computeStrides(e.shape));r.slice&&(o+=r.slice.flatOffset),i.slice={flatOffset:o,origDataId:r.slice&&r.slice.origDataId||e.dataId};let l=n.dataRefCount.get(i.slice.origDataId)||1;return n.dataRefCount.set(i.slice.origDataId,l+1),s}function sd(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,size:i}=n,[o,l]=wt.parseSliceParams(r,s,i);if(wt.assertParamsValid(r,o,l),v.sizeFromShape(l)===0)return a.makeTensorInfo(l,r.dtype,[]);if(a.shouldExecuteOnCPU([r])||r.dtype==="string"){let c=a.texData.get(r.dataId),p=Jj(c.values,o,l,r.shape,r.dtype);return a.makeTensorInfo(l,r.dtype,p)}let{isPacked:u}=a.texData.get(r.dataId),d=wt.isSliceContinous(r.shape,o,l);if(u||!d){let c=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new oK(l):new sK(l),p=[o];return a.runWebGLProgram(c,[r],r.dtype,p)}return a.uploadToGPU(r.dataId),lK(r,o,l,a)}var uK={kernelName:zu,backendName:"webgl",kernelFunc:sd},dK=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,crops:i}=n;v.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((x,A)=>x*A),l=I.getReshaped(r.shape,s,o),u=I.getPermuted(l.length,s.length),d=I.getReshapedPermuted(r.shape,s,o),c=I.getSliceBeginCoords(i,s.length),p=I.getSliceSize(d,i,s.length),h=[],m=pe({inputs:{x:r},backend:a,attrs:{shape:l}}),f=Ta({inputs:{x:m},backend:a,attrs:{perm:u}}),g=pe({inputs:{x:f},backend:a,attrs:{shape:d}}),y=sd({inputs:{x:g},backend:a,attrs:{begin:c,size:p}});return h.push(m),h.push(f),h.push(g),h.forEach(x=>a.disposeIntermediateTensorInfo(x)),y},pK={kernelName:gu,backendName:"webgl",kernelFunc:dK};function cK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i}=n,o=a.readSync(r.dataId),l=a.readSync(s.dataId),u=Nw(o,l,s.dtype,s.shape,i);return a.makeTensorInfo([i],s.dtype,u)}var hK={kernelName:Hi,backendName:"webgl",kernelFunc:cK},mK=` int r = int(a.r) & int(b.r); int g = int(a.g) & int(b.g); int rb = int(a.b) & int(b.b); int ra = int(a.a) & int(b.a); return vec4(r, g, rb, ra); -`,vX=` +`,fK=` return float(int(a.r) & int(b.r)); -`;function wX(e){let{inputs:t,backend:a}=e,{a:n,b:r}=t,s=B().getBool("WEBGL_PACK_BINARY_OPERATIONS"),i=B().getNumber("WEBGL_VERSION");if(a.shouldExecuteOnCPU([n,r])||i===1){let l=a.texData.get(n.dataId).values,u=a.texData.get(r.dataId).values,[p,c]=NH(n.shape,r.shape,l,u,n.dtype),d=a.makeTensorInfo(c,n.dtype),h=a.texData.get(d.dataId);return h.values=p,d}let o;return s?o=new Ku(bX,n.shape,r.shape,!1):o=new ai(vX,n.shape,r.shape),a.runWebGLProgram(o,[n,r],n.dtype)}var kX={kernelName:uu,backendName:"webgl",kernelFunc:wX};function IX(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t,s=a.readSync(n.dataId),i=a.readSync(r.dataId),o=C.assertAndGetBroadcastShape(Array.from(s),Array.from(i));return a.makeTensorInfo([o.length],"int32",Int32Array.from(o))}var SX={kernelName:du,backendName:"webgl",kernelFunc:IX},CX="return float(a != b);",I8=ha({opSnippet:CX,cpuKernelImpl:KH,dtype:"bool"}),TX={kernelName:go,backendName:"webgl",kernelFunc:I8};function Zp(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.texData.get(n.dataId);return Qa({inputs:{x:r.complexTensorInfos.real},backend:a})}var NX={kernelName:vp,backendName:"webgl",kernelFunc:Zp},RX="return float(int(x));";function EX(e,t){let a=new Kn(e.shape,RX),n=t.runWebGLProgram(a,[e],"int32");return{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}function L1(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dtype:s}=n;if(s==="complex64"){if(r.dtype==="complex64")return Qa({inputs:{x:r},backend:a});let i=gn(r.shape),o=L1({inputs:{x:r},backend:a,attrs:{dtype:"float32"}}),l=hs({inputs:{real:o,imag:i},backend:a});return i.dispose(),a.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=Zp({inputs:{input:r},backend:a}),o=L1({inputs:{x:i},backend:a,attrs:{dtype:s}});return a.disposeIntermediateTensorInfo(i),o}if(!v.hasEncodingLoss(r.dtype,s)){let i=Qa({inputs:{x:r},backend:a});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(a.shouldExecuteOnCPU([r])){let i=a.texData.get(r.dataId).values,[o,l,u]=RH(i,r.shape,r.dtype,s);return a.makeTensorInfo(o,l,u)}if(s==="int32")return EX(r,a);if(s==="bool"){let i=a.makeTensorInfo([],"bool",v.getTypedArrayFromDType("bool",1)),o=I8({inputs:{a:r,b:i},backend:a});return a.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var MX={kernelName:xi,backendName:"webgl",kernelFunc:L1},$5="return ceil(x);",PX=tt({opSnippet:$5,packedOpSnippet:$5,cpuKernelImpl:EH}),_X={kernelName:Ai,backendName:"webgl",kernelFunc:PX},$X=class{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` +`;function gK(e){let{inputs:t,backend:a}=e,{a:n,b:r}=t,s=B().getBool("WEBGL_PACK_BINARY_OPERATIONS"),i=B().getNumber("WEBGL_VERSION");if(a.shouldExecuteOnCPU([n,r])||i===1){let l=a.texData.get(n.dataId).values,u=a.texData.get(r.dataId).values,[d,c]=wj(n.shape,r.shape,l,u,n.dtype),p=a.makeTensorInfo(c,n.dtype),h=a.texData.get(p.dataId);return h.values=d,p}let o;return s?o=new nd(mK,n.shape,r.shape,!1):o=new Ei(fK,n.shape,r.shape),a.runWebGLProgram(o,[n,r],n.dtype)}var yK={kernelName:ji,backendName:"webgl",kernelFunc:gK};function xK(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t,s=a.readSync(n.dataId),i=a.readSync(r.dataId),o=I.assertAndGetBroadcastShape(Array.from(s),Array.from(i));return a.makeTensorInfo([o.length],"int32",Int32Array.from(o))}var AK={kernelName:yu,backendName:"webgl",kernelFunc:xK},bK="return float(a != b);",Gw=ha({opSnippet:bK,cpuKernelImpl:Uj,dtype:"bool"}),vK={kernelName:Cs,backendName:"webgl",kernelFunc:Gw};function sc(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.texData.get(n.dataId);return tn({inputs:{x:r.complexTensorInfos.real},backend:a})}var wK={kernelName:Ep,backendName:"webgl",kernelFunc:sc},kK="return float(int(x));";function IK(e,t){let a=new Qn(e.shape,kK),n=t.runWebGLProgram(a,[e],"int32");return{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}function j1(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dtype:s}=n;if(s==="complex64"){if(r.dtype==="complex64")return tn({inputs:{x:r},backend:a});let i=An(r.shape),o=j1({inputs:{x:r},backend:a,attrs:{dtype:"float32"}}),l=zs({inputs:{real:o,imag:i},backend:a});return i.dispose(),a.disposeIntermediateTensorInfo(o),l}if(r.dtype==="complex64"){let i=sc({inputs:{input:r},backend:a}),o=j1({inputs:{x:i},backend:a,attrs:{dtype:s}});return a.disposeIntermediateTensorInfo(i),o}if(!v.hasEncodingLoss(r.dtype,s)){let i=tn({inputs:{x:r},backend:a});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(a.shouldExecuteOnCPU([r])){let i=a.texData.get(r.dataId).values,[o,l,u]=kj(i,r.shape,r.dtype,s);return a.makeTensorInfo(o,l,u)}if(s==="int32")return IK(r,a);if(s==="bool"){let i=a.makeTensorInfo([],"bool",v.getTypedArrayFromDType("bool",1)),o=Gw({inputs:{a:r,b:i},backend:a});return a.disposeIntermediateTensorInfo(i),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var SK={kernelName:qi,backendName:"webgl",kernelFunc:j1},X5="return ceil(x);",TK=tt({opSnippet:X5,packedOpSnippet:X5,cpuKernelImpl:Ij}),CK={kernelName:cs,backendName:"webgl",kernelFunc:TK},NK=class{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` void main() { float value = getAAtOutCoords(); @@ -2122,7 +2122,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam setOutput(clamp(value, minVal, maxVal)); } - `}},FX=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` + `}},RK=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` void main() { vec4 value = getAAtOutCoords(); @@ -2133,7 +2133,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam setOutput(clamp(value, vec4(minVal), vec4(maxVal))); } - `}};function DX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=n,o;B().getBool("WEBGL_PACK_CLIP")?o=new FX(r.shape):o=new $X(r.shape);let l=[[s],[i]];return a.runWebGLProgram(o,[r],r.dtype,l)}var OX={kernelName:os,backendName:"webgl",kernelFunc:DX},zX=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` + `}};function EK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=n,o;B().getBool("WEBGL_PACK_CLIP")?o=new RK(r.shape):o=new NK(r.shape);let l=[[s],[i]];return a.runWebGLProgram(o,[r],r.dtype,l)}var MK={kernelName:hs,backendName:"webgl",kernelFunc:EK},FK=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` void main() { float re = abs(getRealAtOutCoords()); float im = abs(getImagAtOutCoords()); @@ -2146,7 +2146,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) ); } - `}};function F5(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}function LX(e){let{inputs:t,backend:a}=e,{x:n}=t,r=a.texData.get(n.dataId),s=new zX(n.shape),i=[F5(n,r.complexTensorInfos.real),F5(n,r.complexTensorInfos.imag)];return a.runWebGLProgram(s,i,i[0].dtype)}var WX={kernelName:dp,backendName:"webgl",kernelFunc:LX},BX=class{constructor(e){this.outputShape=[],this.outputShape=C.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}(${Zc(i,l,f)}), - vec2(${Zc(u,l,f)})); - }`}let d=o.length,h=o[o.length-1];c+=` + getT${m}(${sh(i,l,f)}), + vec2(${sh(u,l,f)})); + }`}let p=o.length,h=o[o.length-1];c+=` return getChannel( - getT${d}(${Zc(i,l,h)}), - vec2(${Zc(u,l,h)}));`,this.userCode=` + getT${p}(${sh(i,l,h)}), + vec2(${sh(u,l,h)}));`,this.userCode=` float getValue(${i.map(m=>"int "+m)}) { ${c} } @@ -2192,7 +2192,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(result); } - `}};function Zc(e,t,a){let n=e.indexOf(t);return e.map((r,s)=>s===n?`${r} - ${a}`:r).join()}function i0(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.texData.get(n.dataId);return Qa({inputs:{x:r.complexTensorInfos.imag},backend:a})}var UX={kernelName:xp,backendName:"webgl",kernelFunc:i0};function Rd(e,t,a){let n=e[0].dtype;if(n==="complex64"){let h=e.map(x=>Zp({inputs:{input:x},backend:a})),m=e.map(x=>i0({inputs:{input:x},backend:a})),f=Rd(h,t,a),g=Rd(m,t,a),y=hs({inputs:{real:f,imag:g},backend:a});return h.forEach(x=>a.disposeIntermediateTensorInfo(x)),m.forEach(x=>a.disposeIntermediateTensorInfo(x)),a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(g),y}let r=a.shouldExecuteOnCPU(e);if(n==="string"&&(r=!0),r){let h=e.map(b=>{let w=[-1,v.sizeFromShape(b.shape.slice(t))];return pe({inputs:{x:b},backend:a,attrs:{shape:w}})}),m=h.map(b=>({vals:a.readSync(b.dataId),shape:b.shape})),f=C.computeOutShape(h.map(b=>b.shape),1),g=h[0].shape[0]===1,y=MH(m,f,n,g),x=C.computeOutShape(e.map(b=>b.shape),t),A=a.makeTensorInfo(x,n,y);return h.forEach(b=>a.disposeIntermediateTensorInfo(b)),A}let s=e.filter(h=>v.sizeFromShape(h.shape)>0),i=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(s.length===1){let h=i?new Kn(e[0].shape,Br):new jr(e[0].shape,Br);return a.runWebGLProgram(h,e,n)}let o=B().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>o){let h=[];for(let f=0;fm.shape),t);return a.runWebGLProgram(h,s,n)}let{tensors2D:l,outShape:u}=GX(s,t,a),p=new BX(l.map(h=>h.shape)),c=a.runWebGLProgram(p,l,n);l.forEach(h=>a.disposeIntermediateTensorInfo(h));let d=pe({inputs:{x:c},attrs:{shape:u},backend:a});return a.disposeIntermediateTensorInfo(c),d}function GX(e,t,a){let n=C.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>pe({inputs:{x:r},attrs:{shape:[-1,v.sizeFromShape(r.shape.slice(t))]},backend:a})),outShape:n}}function S8(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n,s=v.parseAxisParam(r,t[0].shape)[0],i=t.map(u=>u.shape);C.assertParamsConsistent(i,s);let o=C.computeOutShape(t.map(u=>u.shape),s);if(v.sizeFromShape(o)===0)return a.makeTensorInfo(o,t[0].dtype,[]);let l=t.filter(u=>v.sizeFromShape(u.shape)>0);return l.length===1?Qa({inputs:{x:l[0]},backend:a}):Rd(l,s,a)}var HX={kernelName:pu,backendName:"webgl",kernelFunc:S8},C8=class{constructor(e,t=!1,a=null,n=!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,u=e.dilationHeight,p=e.dilationWidth,c=e.filterHeight,d=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",g=f?1:2,y=f?2:3,x=f?3:1,A="",b="";a&&(n?A=`float activation(float a) { + `}};function sh(e,t,a){let n=e.indexOf(t);return e.map((r,s)=>s===n?`${r} - ${a}`:r).join()}function h0(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.texData.get(n.dataId);return tn({inputs:{x:r.complexTensorInfos.imag},backend:a})}var OK={kernelName:Cp,backendName:"webgl",kernelFunc:h0};function Od(e,t,a){let n=e[0].dtype;if(n==="complex64"){let h=e.map(x=>sc({inputs:{input:x},backend:a})),m=e.map(x=>h0({inputs:{input:x},backend:a})),f=Od(h,t,a),g=Od(m,t,a),y=zs({inputs:{real:f,imag:g},backend:a});return h.forEach(x=>a.disposeIntermediateTensorInfo(x)),m.forEach(x=>a.disposeIntermediateTensorInfo(x)),a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(g),y}let r=a.shouldExecuteOnCPU(e);if(n==="string"&&(r=!0),r){let h=e.map(b=>{let w=[-1,v.sizeFromShape(b.shape.slice(t))];return pe({inputs:{x:b},backend:a,attrs:{shape:w}})}),m=h.map(b=>({vals:a.readSync(b.dataId),shape:b.shape})),f=I.computeOutShape(h.map(b=>b.shape),1),g=h[0].shape[0]===1,y=Sj(m,f,n,g),x=I.computeOutShape(e.map(b=>b.shape),t),A=a.makeTensorInfo(x,n,y);return h.forEach(b=>a.disposeIntermediateTensorInfo(b)),A}let s=e.filter(h=>v.sizeFromShape(h.shape)>0),i=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(s.length===1){let h=i?new Qn(e[0].shape,jr):new Zr(e[0].shape,jr);return a.runWebGLProgram(h,e,n)}let o=B().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>o){let h=[];for(let f=0;fm.shape),t);return a.runWebGLProgram(h,s,n)}let{tensors2D:l,outShape:u}=zK(s,t,a),d=new PK(l.map(h=>h.shape)),c=a.runWebGLProgram(d,l,n);l.forEach(h=>a.disposeIntermediateTensorInfo(h));let p=pe({inputs:{x:c},attrs:{shape:u},backend:a});return a.disposeIntermediateTensorInfo(c),p}function zK(e,t,a){let n=I.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>pe({inputs:{x:r},attrs:{shape:[-1,v.sizeFromShape(r.shape.slice(t))]},backend:a})),outShape:n}}function Hw(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n,s=v.parseAxisParam(r,t[0].shape)[0],i=t.map(u=>u.shape);I.assertParamsConsistent(i,s);let o=I.computeOutShape(t.map(u=>u.shape),s);if(v.sizeFromShape(o)===0)return a.makeTensorInfo(o,t[0].dtype,[]);let l=t.filter(u=>v.sizeFromShape(u.shape)>0);return l.length===1?tn({inputs:{x:l[0]},backend:a}):Od(l,s,a)}var LK={kernelName:xu,backendName:"webgl",kernelFunc:Hw},jw=class{constructor(e,t=!1,a=null,n=!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,u=e.dilationHeight,d=e.dilationWidth,c=e.filterHeight,p=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4,f=e.dataFormat==="channelsLast",g=f?1:2,y=f?2:3,x=f?3:1,A="",b="";a&&(n?A=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${a} }`:r?A=`float activation(float a) { @@ -2228,8 +2228,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam continue; } - for (int wC = 0; wC < ${d}; wC++) { - int xC = xCCorner + wC * ${p}; + for (int wC = 0; wC < ${p}; wC++) { + int xC = xCCorner + wC * ${d}; if (xC < 0 || xC >= ${e.inWidth}) { continue; @@ -2326,7 +2326,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ${b} setOutput(result); } - `}},jX=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,a=e.padInfo.top,n=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,p=e.filterDepth,c=e.filterHeight,d=e.filterWidth,h=Math.floor(e.inChannels/4)*4,m=e.inChannels%4;this.userCode=` + `}},WK=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,a=e.padInfo.top,n=e.padInfo.left,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=e.dilationDepth,l=e.dilationHeight,u=e.dilationWidth,d=e.filterDepth,c=e.filterHeight,p=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}, ${a}, ${n}); @@ -2344,7 +2344,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam // y(yF, yR, yC, d2). ? = to be determined. : = across all // values in that axis. float dotProd = 0.0; - for (int wF = 0; wF < ${p}; wF++) { + for (int wF = 0; wF < ${d}; wF++) { int xF = xFCorner + wF * ${o}; if (xF < 0 || xF >= ${e.inDepth}) { @@ -2358,7 +2358,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam continue; } - for (int wC = 0; wC < ${d}; wC++) { + for (int wC = 0; wC < ${p}; wC++) { int xC = xCCorner + wC * ${u}; if (xC < 0 || xC >= ${e.inWidth}) { @@ -2414,7 +2414,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}},T8=class{constructor(e,t=!1,a=null,n=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=ga(this.outputShape.length);let s=e.padInfo.left,i=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,p=u,c=` + `}},qw=class{constructor(e,t=!1,a=null,n=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=ga(this.outputShape.length);let s=e.padInfo.left,i=e.strideWidth,o=e.dilationWidth,l=e.filterHeight,u=e.filterWidth,d=u,c=` int xR; int xC; int xCOffset; vec4 wTexel; vec4 previous; vec4 final;`;for(let f=0;f=0 && xR < inDims[0]) { - `;for(let f=0;f<(p+1)/2;f++){let g=f*2;if(c+=` + `;for(let f=0;f<(d+1)/2;f++){let g=f*2;if(c+=` xC = xCCorner + ${g*o}; `,i===1){if(g=3?t?[...e.slice(0,-3),e[a-3]*e[a-2],e[a-1]]:[...e.slice(0,-3),e[a-3],e[a-2]*e[a-1]]:!t&&a===1&&e[0]>1?[e[0],1]:null}function N8({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=e.shape,u=n.texData.get(e.dataId),p=a.inChannels,c=l[0]*l[1]*l[2],d=a.outChannels,h=a.dataFormat==="channelsLast",m=!1,f=!1,g,y=[];if(s!=null){let x=kh(s.shape,h);x!=null&&(s=pe({inputs:{x:s},backend:n,attrs:{shape:x}}),y.push(s))}if(r!=null){let x=kh(r.shape,h);x!=null&&(r=pe({inputs:{x:r},backend:n,attrs:{shape:x}}),y.push(r))}if(!((c===1||d===1)&&p>b8)&&u.isPacked&&h&&u.texture!=null&&l[2]%2!==0&&v.arraysEqual(u.shape.slice(-3),l.slice(-3))){let x=l[0]*l[1]*(l[2]+1),A={dataId:e.dataId,shape:[1,x,a.inChannels],dtype:e.dtype},b=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,v.assert(Zd(u.shape,A.shape),()=>`packed reshape ${u.shape} to ${A.shape} isn't free`);let w=pe({inputs:{x:t},backend:n,attrs:{shape:[1,a.inChannels,a.outChannels]}});y.push(w);let I=wh({a:A,b:w,backend:n,transposeA:m,transposeB:f,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),T=n.texData.get(I.dataId);v.assert(T.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=b,T.shape=a.outShape,g=Qa({inputs:{x:I},backend:n}),g.shape=a.outShape,y.push(I)}else{let x=a.outHeight*a.outWidth,A=pe({inputs:{x:e},backend:n,attrs:{shape:h?[a.batchSize,x,a.inChannels]:[a.batchSize,a.inChannels,x]}}),b=pe({inputs:{x:t},backend:n,attrs:{shape:[1,a.inChannels,a.outChannels]}}),w=wh({a:h?A:b,b:h?b:A,transposeA:!h,transposeB:f,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});g=pe({inputs:{x:w},backend:n,attrs:{shape:a.outShape}}),y.push(A),y.push(b),y.push(w)}for(let x of y)n.disposeIntermediateTensorInfo(x);return g}function R8({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:u,inChannels:p,outWidth:c,outHeight:d,dataFormat:h}=a,m=h==="channelsLast",f=l*u*p,g=d*c,y=[a.batchSize,f,g],x=!0,A=!1,b=[];if(s!=null){let G=kh(s.shape,m);G!=null&&(s=pe({inputs:{x:s},backend:n,attrs:{shape:G}}),b.push(s))}if(r!=null){let G=kh(r.shape,m);G!=null&&(r=pe({inputs:{x:r},backend:n,attrs:{shape:G}}),b.push(r))}let w=pe({inputs:{x:t},backend:n,attrs:{shape:[1,f,v.sizeFromShape(t.shape)/f]}});b.push(w);let I=new qX(y,a),T=[e.shape,[a.padInfo.top,a.padInfo.left],[a.strideHeight,a.strideWidth],[a.dilationHeight,a.dilationWidth],[a.inChannels],[a.filterWidth*a.inChannels],[a.outWidth]],N=n.runWebGLProgram(I,[e],"float32",T),M=pe({inputs:{x:N},backend:n,attrs:{shape:y}});b.push(N),b.push(M);let P=r!=null,E=s!=null,S=o==="leakyrelu",_=o?Jd(o,!0):null,O=new A8(m?M.shape:w.shape,m?w.shape:M.shape,m?[a.batchSize,g,a.outChannels]:[a.batchSize,a.outChannels,g],x,A,P,_,E,S),W=m?[M,w]:[w,M];if(r&&W.push(r),E&&W.push(s),S){let G=n.makeTensorInfo([],"float32",v.createScalarValue(i,"float32"));W.push(G),b.push(G)}let $=n.runWebGLProgram(O,W,"float32"),U=pe({inputs:{x:$},backend:n,attrs:{shape:a.outShape}});b.push($);for(let G of b)n.disposeIntermediateTensorInfo(G);return U}function XX(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:p}=n,c=C.convertConv2DDataFormat(l),d=C.computeConv2DInfo(r.shape,s.shape,i,u,o,p,!1,c),h;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"))h=N8({x:r,filter:s,convInfo:d,backend:a});else if(d.strideWidth<=2&&c==="channelsLast"&&B().getBool("WEBGL_EXP_CONV")){let f=new T8(d),g=[[d.padInfo.top,d.padInfo.left],[d.strideHeight,d.strideWidth],[d.dilationHeight,d.dilationWidth],[d.inHeight,d.inWidth]];h=a.runWebGLProgram(f,[r,s],"float32",g)}else if(B().getBool("WEBGL_CONV_IM2COL"))h=R8({x:r,filter:s,convInfo:d,backend:a});else{let f=new C8(d);h=a.runWebGLProgram(f,[r,s],"float32")}let m=pe({inputs:{x:h},backend:a,attrs:{shape:d.outShape}});return a.disposeIntermediateTensorInfo(h),m}var KX={kernelName:bi,backendName:"webgl",kernelFunc:XX},YX=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,a=e.strideWidth,n=e.padInfo.top,r=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` + `}};function Eh(e,t){let a=e.length;return a>=3?t?[...e.slice(0,-3),e[a-3]*e[a-2],e[a-1]]:[...e.slice(0,-3),e[a-3],e[a-2]*e[a-1]]:!t&&a===1&&e[0]>1?[e[0],1]:null}function Xw({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=e.shape,u=n.texData.get(e.dataId),d=a.inChannels,c=l[0]*l[1]*l[2],p=a.outChannels,h=a.dataFormat==="channelsLast",m=!1,f=!1,g,y=[];if(s!=null){let x=Eh(s.shape,h);x!=null&&(s=pe({inputs:{x:s},backend:n,attrs:{shape:x}}),y.push(s))}if(r!=null){let x=Eh(r.shape,h);x!=null&&(r=pe({inputs:{x:r},backend:n,attrs:{shape:x}}),y.push(r))}if(!((c===1||p===1)&&d>Ww)&&u.isPacked&&h&&u.texture!=null&&l[2]%2!==0&&v.arraysEqual(u.shape.slice(-3),l.slice(-3))){let x=l[0]*l[1]*(l[2]+1),A={dataId:e.dataId,shape:[1,x,a.inChannels],dtype:e.dtype},b=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,v.assert(ip(u.shape,A.shape),()=>`packed reshape ${u.shape} to ${A.shape} isn't free`);let w=pe({inputs:{x:t},backend:n,attrs:{shape:[1,a.inChannels,a.outChannels]}});y.push(w);let S=Rh({a:A,b:w,backend:n,transposeA:m,transposeB:f,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),C=n.texData.get(S.dataId);v.assert(C.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=b,C.shape=a.outShape,g=tn({inputs:{x:S},backend:n}),g.shape=a.outShape,y.push(S)}else{let x=a.outHeight*a.outWidth,A=pe({inputs:{x:e},backend:n,attrs:{shape:h?[a.batchSize,x,a.inChannels]:[a.batchSize,a.inChannels,x]}}),b=pe({inputs:{x:t},backend:n,attrs:{shape:[1,a.inChannels,a.outChannels]}}),w=Rh({a:h?A:b,b:h?b:A,transposeA:!h,transposeB:f,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});g=pe({inputs:{x:w},backend:n,attrs:{shape:a.outShape}}),y.push(A),y.push(b),y.push(w)}for(let x of y)n.disposeIntermediateTensorInfo(x);return g}function Kw({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:u,inChannels:d,outWidth:c,outHeight:p,dataFormat:h}=a,m=h==="channelsLast",f=l*u*d,g=p*c,y=[a.batchSize,f,g],x=!0,A=!1,b=[];if(s!=null){let G=Eh(s.shape,m);G!=null&&(s=pe({inputs:{x:s},backend:n,attrs:{shape:G}}),b.push(s))}if(r!=null){let G=Eh(r.shape,m);G!=null&&(r=pe({inputs:{x:r},backend:n,attrs:{shape:G}}),b.push(r))}let w=pe({inputs:{x:t},backend:n,attrs:{shape:[1,f,v.sizeFromShape(t.shape)/f]}});b.push(w);let S=new BK(y,a),C=[e.shape,[a.padInfo.top,a.padInfo.left],[a.strideHeight,a.strideWidth],[a.dilationHeight,a.dilationWidth],[a.inChannels],[a.filterWidth*a.inChannels],[a.outWidth]],N=n.runWebGLProgram(S,[e],"float32",C),M=pe({inputs:{x:N},backend:n,attrs:{shape:y}});b.push(N),b.push(M);let F=r!=null,E=s!=null,T=o==="leakyrelu",D=o?op(o,!0):null,O=new Lw(m?M.shape:w.shape,m?w.shape:M.shape,m?[a.batchSize,g,a.outChannels]:[a.batchSize,a.outChannels,g],x,A,F,D,E,T),W=m?[M,w]:[w,M];if(r&&W.push(r),E&&W.push(s),T){let G=n.makeTensorInfo([],"float32",v.createScalarValue(i,"float32"));W.push(G),b.push(G)}let $=n.runWebGLProgram(O,W,"float32"),U=pe({inputs:{x:$},backend:n,attrs:{shape:a.outShape}});b.push($);for(let G of b)n.disposeIntermediateTensorInfo(G);return U}function VK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:d}=n,c=I.convertConv2DDataFormat(l),p=I.computeConv2DInfo(r.shape,s.shape,i,u,o,d,!1,c),h;if(p.filterHeight===1&&p.filterWidth===1&&p.dilationHeight===1&&p.dilationWidth===1&&p.strideHeight===1&&p.strideWidth===1&&(p.padInfo.type==="SAME"||p.padInfo.type==="VALID"))h=Xw({x:r,filter:s,convInfo:p,backend:a});else if(p.strideWidth<=2&&c==="channelsLast"&&B().getBool("WEBGL_EXP_CONV")){let f=new qw(p),g=[[p.padInfo.top,p.padInfo.left],[p.strideHeight,p.strideWidth],[p.dilationHeight,p.dilationWidth],[p.inHeight,p.inWidth]];h=a.runWebGLProgram(f,[r,s],"float32",g)}else if(B().getBool("WEBGL_CONV_IM2COL"))h=Kw({x:r,filter:s,convInfo:p,backend:a});else{let f=new jw(p);h=a.runWebGLProgram(f,[r,s],"float32")}let m=pe({inputs:{x:h},backend:a,attrs:{shape:p.outShape}});return a.disposeIntermediateTensorInfo(h),m}var UK={kernelName:Xi,backendName:"webgl",kernelFunc:VK},GK=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,a=e.strideWidth,n=e.padInfo.top,r=e.padInfo.left,s=e.dataFormat==="channelsLast";this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2694,13 +2694,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}},ZX=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,a=e.filterWidth,n=e.strideHeight,r=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=a-1-e.padInfo.left,l=s?1:2,u=s?2:3,p=s?3:1;this.userCode=` + `}},HK=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,a=e.filterWidth,n=e.strideHeight,r=e.strideWidth,s=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,o=a-1-e.padInfo.left,l=s?1:2,u=s?2:3,d=s?3:1;this.userCode=` const ivec2 pads = ivec2(${i}, ${o}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; - int d1 = coords[${p}]; + int d1 = coords[${d}]; ivec2 dyCorner = ivec2(coords[${l}], coords[${u}]) - pads; int dyRCorner = dyCorner.x; @@ -2747,7 +2747,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}},JX=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,a=e.strideHeight,n=e.strideWidth,r=e.padInfo.front,s=e.padInfo.top,i=e.padInfo.left;this.userCode=` + `}},jK=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,a=e.strideHeight,n=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; @@ -2789,7 +2789,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}},QX=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,a=e.filterHeight,n=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=a-1-e.padInfo.top,u=n-1-e.padInfo.left;this.userCode=` + `}},qK=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,a=e.filterHeight,n=e.filterWidth,r=e.strideDepth,s=e.strideHeight,i=e.strideWidth,o=t-1-e.padInfo.front,l=a-1-e.padInfo.top,u=n-1-e.padInfo.left;this.userCode=` const ivec3 pads = ivec3(${o}, ${l}, ${u}); void main() { @@ -2846,7 +2846,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}};function eK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:p}=n,c=C.convertConv2DDataFormat(l),d=C.computeConv2DInfo(r.shape,p,i,1,o,u,!1,c),h=new YX(d);return a.runWebGLProgram(h,[r,s],"float32")}var tK={kernelName:pp,backendName:"webgl",kernelFunc:eK},aK=class{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=ga(this.outputShape.length);let t=e.filterHeight,a=e.filterWidth,n=t-1-e.padInfo.top,r=a-1-e.padInfo.left;this.userCode=` + `}};function XK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:d}=n,c=I.convertConv2DDataFormat(l),p=I.computeConv2DInfo(r.shape,d,i,1,o,u,!1,c),h=new GK(p);return a.runWebGLProgram(h,[r,s],"float32")}var KK={kernelName:bp,backendName:"webgl",kernelFunc:XK},YK=class{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=ga(this.outputShape.length);let t=e.filterHeight,a=e.filterWidth,n=t-1-e.padInfo.top,r=a-1-e.padInfo.left;this.userCode=` const ivec2 pads = ivec2(${n}, ${r}); void main() { @@ -2920,17 +2920,17 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(result); } - `}};function nK(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:u,dimRoundingMode:p}=n,c=C.convertConv2DDataFormat(u),d=C.computeConv2DInfo(i,s.shape,o,1,l,p,!1,c);if(B().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&c==="channelsLast"){let h=[[d.strideHeight,d.strideWidth]],m=new aK(d);return a.runWebGLProgram(m,[r,s],"float32",h)}else{let h=new ZX(d);return a.runWebGLProgram(h,[r,s],"float32")}}var rK={kernelName:vi,backendName:"webgl",kernelFunc:nK};function sK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=C.computeConv3DInfo(r.shape,s.shape,i,l,o),p=new jX(u);return a.runWebGLProgram(p,[r,s],"float32")}var iK={kernelName:wi,backendName:"webgl",kernelFunc:sK};function oK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:l}=n,u=C.computeConv3DInfo(r.shape,l,i,1,o),p=new JX(u);return a.runWebGLProgram(p,[r,s],"float32")}var lK={kernelName:cu,backendName:"webgl",kernelFunc:oK};function uK(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{pad:i,strides:o,inputShape:l}=n,u=C.computeConv3DInfo(l,s.shape,o,1,i),p=new QX(u);return a.runWebGLProgram(p,[r,s],"float32")}var dK={kernelName:ki,backendName:"webgl",kernelFunc:uK},pK=Yu+` + `}};function ZK(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:u,dimRoundingMode:d}=n,c=I.convertConv2DDataFormat(u),p=I.computeConv2DInfo(i,s.shape,o,1,l,d,!1,c);if(B().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&c==="channelsLast"){let h=[[p.strideHeight,p.strideWidth]],m=new YK(p);return a.runWebGLProgram(m,[r,s],"float32",h)}else{let h=new HK(p);return a.runWebGLProgram(h,[r,s],"float32")}}var JK={kernelName:Ki,backendName:"webgl",kernelFunc:ZK};function QK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=I.computeConv3DInfo(r.shape,s.shape,i,l,o),d=new WK(u);return a.runWebGLProgram(d,[r,s],"float32")}var eY={kernelName:Yi,backendName:"webgl",kernelFunc:QK};function tY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:l}=n,u=I.computeConv3DInfo(r.shape,l,i,1,o),d=new jK(u);return a.runWebGLProgram(d,[r,s],"float32")}var aY={kernelName:Au,backendName:"webgl",kernelFunc:tY};function nY(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{pad:i,strides:o,inputShape:l}=n,u=I.computeConv3DInfo(l,s.shape,o,1,i),d=new qK(u);return a.runWebGLProgram(d,[r,s],"float32")}var rY={kernelName:Zi,backendName:"webgl",kernelFunc:nY},sY=rd+` return cos(x); -`,cK=` +`,iY=` vec4 result = cos(x); bvec4 isNaN = isnan(x); - ${nl} + ${cl} return result; -`,hK=tt({opSnippet:pK,packedOpSnippet:cK}),mK={kernelName:Ii,backendName:"webgl",kernelFunc:hK},fK=` +`,oY=tt({opSnippet:sY,packedOpSnippet:iY}),lY={kernelName:Ji,backendName:"webgl",kernelFunc:oY},uY=` float e2x = exp(-x); return (e2x + 1.0 / e2x) / 2.0; -`,gK=tt({opSnippet:fK}),yK={kernelName:Si,backendName:"webgl",kernelFunc:gK},xK=class{constructor(e,t,a,n,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,l]=e,[u]=t,[p,c]=a;this.outputShape=[u,p,c,l];let d=n==="bilinear"?1:0,[h,m]=[`${i-1}.0`,`${o-1}.0`],[f,g,y]=p>1?[`${(i-1)/(p-1)}`,"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[x,A,b]=c>1?[`${(o-1)/(c-1)}`,"(x2-x1) * width_ratio",`x1*${m} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${m}`];this.userCode=` +`,dY=tt({opSnippet:uY}),pY={kernelName:Qi,backendName:"webgl",kernelFunc:dY},cY=class{constructor(e,t,a,n,r){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[s,i,o,l]=e,[u]=t,[d,c]=a;this.outputShape=[u,d,c,l];let p=n==="bilinear"?1:0,[h,m]=[`${i-1}.0`,`${o-1}.0`],[f,g,y]=d>1?[`${(i-1)/(d-1)}`,"(y2-y1) * height_ratio",`y1*${h} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${h}`],[x,A,b]=c>1?[`${(o-1)/(c-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(${x}); void main() { @@ -2967,7 +2967,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } vec2 sourceFracIndexCR = vec2(in_x,in_y); - if(${d} == 1) { + if(${p} == 1) { // Compute the four integer indices. ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); @@ -2991,20 +2991,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam setOutput(newValue); } } - `}},AK=e=>{let{inputs:t,backend:a,attrs:n}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=n,p=new xK(r.shape,s.shape,o,l,u);return a.runWebGLProgram(p,[r,s,i],"float32")},bK={kernelName:Ni,backendName:"webgl",kernelFunc:AK},ep;(function(e){e.Prod="*",e.Sum="+"})(ep||(ep={}));var D5=class{constructor(e,t,a,n){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];let r=this.outputShape.length,s=this.op===ep.Prod?"1.0":"0.0",i=a?s:`getX(${O5(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1],l="",u="";a?(l=n?`end != ${o-1}`:"end != 0",u=n?"end + 1":"end - 1"):(l=n?`end + pow2 < ${o}`:"end >= pow2",u=n?"end + pow2":"end - pow2"),this.userCode=` + `}},hY=e=>{let{inputs:t,backend:a,attrs:n}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=n,d=new cY(r.shape,s.shape,o,l,u);return a.runWebGLProgram(d,[r,s,i],"float32")},mY={kernelName:ao,backendName:"webgl",kernelFunc:hY},up;(function(e){e.Prod="*",e.Sum="+"})(up||(up={}));var Y5=class{constructor(e,t,a,n){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];let r=this.outputShape.length,s=this.op===up.Prod?"1.0":"0.0",i=a?s:`getX(${Z5(r,"coords",this.op)})`,o=this.outputShape[this.outputShape.length-1],l="",u="";a?(l=n?`end != ${o-1}`:"end != 0",u=n?"end + 1":"end - 1"):(l=n?`end + pow2 < ${o}`:"end >= pow2",u=n?"end + pow2":"end - pow2"),this.userCode=` void main() { - ${mt(r)} coords = getOutputCoords(); - int end = ${z5(r,"coords",this.op)}; + ${ft(r)} coords = getOutputCoords(); + int end = ${J5(r,"coords",this.op)}; float val = ${i}; int pow2 = int(pow(2.0, index)); if (${l}) { int idx = ${u}; - ${z5(r,"coords",this.op)} = idx; - val ${this.op}= getX(${O5(r,"coords",this.op)}); + ${J5(r,"coords",this.op)} = idx; + val ${this.op}= getX(${Z5(r,"coords",this.op)}); } setOutput(val); } - `}};function O5(e,t,a){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 new Error(`Cumulative ${a} for rank ${e} is not yet supported`)}function z5(e,t,a){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw new Error(`Cumulative ${a} for rank ${e} is not yet supported`)}function E8(e,t,a,n,r,s){let i=t.shape.length,o=C.getAxesPermutation([n],i),l=t;o!=null&&(l=Ca({inputs:{x:t},backend:a,attrs:{perm:o}}));let u=C.getInnerMostAxes(1,i)[0];if(u!==i-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${n}`);let p=l.shape[u],c=Qa({inputs:{x:l},backend:a});for(let d=0;d<=Math.ceil(Math.log2(p))-1;d++){let h=new D5(e,l.shape,!1,s),m=[[d]],f=c;c=a.runWebGLProgram(h,[c],c.dtype,m),a.disposeIntermediateTensorInfo(f)}if(r){let d=new D5(e,l.shape,r,s),h=c;c=a.runWebGLProgram(d,[c],c.dtype),a.disposeIntermediateTensorInfo(h)}if(o!=null){let d=C.getUndoAxesPermutation(o),h=Ca({inputs:{x:c},backend:a,attrs:{perm:d}});return a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(l),h}return c}function vK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return E8(ep.Prod,r,a,s,i,o)}var wK={kernelName:Ci,backendName:"webgl",kernelFunc:vK};function kK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return E8(ep.Sum,r,a,s,i,o)}var IK={kernelName:Ti,backendName:"webgl",kernelFunc:kK};function SK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=n;if(r.shape.length===1){let l=a.readSync(r.dataId),u=a.readSync(s.dataId),p=l8(l,u,s.dtype,s.shape,i);return a.makeTensorInfo([i],s.dtype,p)}else if(r.shape.length===2){let l=a.bufferSync(r),u=a.bufferSync(s),p=TH(l,u,i,o);return a.makeTensorInfo(p.shape,s.dtype,p.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}var CK={kernelName:hu,backendName:"webgl",kernelFunc:SK},TK=class{constructor(e,t,a){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=a,this.userCode=` + `}};function Z5(e,t,a){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 new Error(`Cumulative ${a} for rank ${e} is not yet supported`)}function J5(e,t,a){if(e===1)return`${t}`;if(e===2)return`${t}.y`;if(e===3)return`${t}.z`;if(e===4)return`${t}.w`;throw new Error(`Cumulative ${a} for rank ${e} is not yet supported`)}function Yw(e,t,a,n,r,s){let i=t.shape.length,o=I.getAxesPermutation([n],i),l=t;o!=null&&(l=Ta({inputs:{x:t},backend:a,attrs:{perm:o}}));let u=I.getInnerMostAxes(1,i)[0];if(u!==i-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${n}`);let d=l.shape[u],c=tn({inputs:{x:l},backend:a});for(let p=0;p<=Math.ceil(Math.log2(d))-1;p++){let h=new Y5(e,l.shape,!1,s),m=[[p]],f=c;c=a.runWebGLProgram(h,[c],c.dtype,m),a.disposeIntermediateTensorInfo(f)}if(r){let p=new Y5(e,l.shape,r,s),h=c;c=a.runWebGLProgram(p,[c],c.dtype),a.disposeIntermediateTensorInfo(h)}if(o!=null){let p=I.getUndoAxesPermutation(o),h=Ta({inputs:{x:c},backend:a,attrs:{perm:p}});return a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(l),h}return c}function fY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return Yw(up.Prod,r,a,s,i,o)}var gY={kernelName:eo,backendName:"webgl",kernelFunc:fY};function yY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return Yw(up.Sum,r,a,s,i,o)}var xY={kernelName:to,backendName:"webgl",kernelFunc:yY};function AY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=n;if(r.shape.length===1){let l=a.readSync(r.dataId),u=a.readSync(s.dataId),d=Nw(l,u,s.dtype,s.shape,i);return a.makeTensorInfo([i],s.dtype,d)}else if(r.shape.length===2){let l=a.bufferSync(r),u=a.bufferSync(s),d=vj(l,u,i,o);return a.makeTensorInfo(d.shape,s.dtype,d.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${r.shape.length}.`)}var bY={kernelName:bu,backendName:"webgl",kernelFunc:AY},vY=class{constructor(e,t,a){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=a,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3023,7 +3023,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={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 NK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockSize:s,dataFormat:i}=n,o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],p=i==="NHWC"?r.shape[3]:r.shape[1],c=l*s,d=u*s,h=p/(s*s),m=i==="NHWC"?[o,c,d,h]:[o,h,c,d],f=new TK(m,s,i);return a.runWebGLProgram(f,[r],r.dtype)}var RK={kernelName:Ri,backendName:"webgl",kernelFunc:NK},M8=class{constructor(e,t=!1,a=null,n=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=ga(this.outputShape.length);let s=e.filterHeight,i=e.filterWidth,o=e.outChannels/e.inChannels,l="",u="";a&&(n?l=`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 wY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockSize:s,dataFormat:i}=n,o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],d=i==="NHWC"?r.shape[3]:r.shape[1],c=l*s,p=u*s,h=d/(s*s),m=i==="NHWC"?[o,c,p,h]:[o,h,c,p],f=new vY(m,s,i);return a.runWebGLProgram(f,[r],r.dtype)}var kY={kernelName:no,backendName:"webgl",kernelFunc:wY},Zw=class{constructor(e,t=!1,a=null,n=!1,r=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=ga(this.outputShape.length);let s=e.filterHeight,i=e.filterWidth,o=e.outChannels/e.inChannels,l="",u="";a&&(n?l=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${a} }`:r?l=`float activation(float a) { @@ -3033,7 +3033,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam float activation(float x) { ${a} } - `,u="result = activation(result);");let p=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + `,u="result = activation(result);");let d=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),r&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${l} void main() { @@ -3072,30 +3072,30 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } float result = dotProd; - ${p} + ${d} ${u} setOutput(result); } - `}},P8=class{constructor(e,t=!1,a=null,n=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=ga(this.outputShape.length);let s=e.outChannels/e.inChannels,i=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,p=e.filterWidth,c=p,d=` + `}},Jw=class{constructor(e,t=!1,a=null,n=!1,r=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=ga(this.outputShape.length);let s=e.outChannels/e.inChannels,i=e.padInfo.left,o=e.strideWidth,l=e.dilationWidth,u=e.filterHeight,d=e.filterWidth,c=d,p=` int xR; int xC; int xCOffset; - vec4 wTexel; vec4 previous; vec4 final;`;for(let g=0;g=0 && xR < inDims[0]) { - `;for(let g=0;g<(c+1)/2;g++){let y=g*2;if(d+=` + `;for(let g=0;g<(c+1)/2;g++){let y=g*2;if(p+=` xC = xCCorner + ${y*l}; - `,o===1){if(y= 0 && xCOffset < inDims[1] && xTexelC${y}Ready == 0) { xTexelC${y} = getX(batch, xR, xCOffset, d1); @@ -3107,9 +3107,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } xTexelC${y}Ready = 1; } - `,l===1&&y>0?d+=` + `,l===1&&y>0?p+=` xC${y} = vec4(xTexelC${y-2}.zw, xTexelC${y}.xy); - `:d+=` + `:p+=` xCOffset = xC + 1 - 2; if (xCOffset >= 0 && xCOffset < inDims[1]) { @@ -3125,7 +3125,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } else { xC${y} = vec4(0.0, 0.0, xTexelC${y}.xy); } - `):d+=` + `):p+=` if (xC >= 0 && xC < inDims[1] && xTexelC${y}Ready == 0) { xTexelC${y} = getX(batch, xR, xC, d1); if (xC + 1 >= inDims[1]) { @@ -3135,7 +3135,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } xC${y} = xTexelC${y}; - `,y+1= 0 && xCOffset < inDims[1] && xTexelC${y+1}Ready == 0) { @@ -3148,7 +3148,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } xTexelC${y+1}Ready = 1; } - `,l>1?d+=` + `,l>1?p+=` xCOffset -= 2; if (xCOffset >= 0 && xCOffset < inDims[1]) { previous = getX(batch, xR, xCOffset, d1); @@ -3156,11 +3156,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } else { xC${y+1} = vec4(0.0, 0.0, xTexelC${y+1}.xy); } - `:d+=` + `:p+=` xC${y+1} = vec4(xTexelC${y}.zw, xTexelC${y+1}.xy); - `):x===1?d+=` + `):x===1?p+=` xC${y+1} = xTexelC${y}; - `:d+=` + `:p+=` xCOffset = xC + ${x}; if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${y+1}Ready == 0) { @@ -3172,7 +3172,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } xC${y+1} = xTexelC${y+1}; - `}}else y= 0 && xCOffset < inDims[1] && xTexelC${y}Ready == 0) { xTexelC${y} = getX(batch, xR, xCOffset, d1); @@ -3195,14 +3195,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } xC${y} = vec4(xTexelC${y}.zw, xTexelC${y+1}.zw); - `,y+1= 0 && xCOffset < inDims[1]) { final = getX(batch, xR, xCOffset, d1); } xC${y+1} = vec4(xTexelC${y+1}.xy, final.xy); - `)):(d+=` + `)):(p+=` if(xC >= 0 && xC < inDims[1] && xTexelC${y}Ready == 0) { xTexelC${y} = getX(batch, xR, xC, d1); if (xC + 1 >= inDims[1]) { @@ -3222,17 +3222,17 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam xC${y} = vec4( xTexelC${y}.xy, xTexelC${y+1}.xy); - `,y+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${p}'`);let c=C.computeConv2DInfo(r.shape,s.shape,i,p,o,u,!0),d;B().getBool("WEBGL_PACK_DEPTHWISECONV")&&c.strideWidth<=2&&c.outChannels/c.inChannels===1?d=new P8(c):d=new M8(c);let h=[[c.padInfo.top,c.padInfo.left],[c.strideHeight,c.strideWidth],[c.dilationHeight,c.dilationWidth],[c.inHeight,c.inWidth]];return a.runWebGLProgram(d,[r,s],"float32",h)}var MK={kernelName:Ei,backendName:"webgl",kernelFunc:EK},PK=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,a=e.strideWidth,n=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` + `}};function IY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l,dimRoundingMode:u}=n,d=l;d==null&&(d=[1,1]),v.assert(I.eitherStridesOrDilationsAreOne(i,d),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${d}'`);let c=I.computeConv2DInfo(r.shape,s.shape,i,d,o,u,!0),p;B().getBool("WEBGL_PACK_DEPTHWISECONV")&&c.strideWidth<=2&&c.outChannels/c.inChannels===1?p=new Jw(c):p=new Zw(c);let h=[[c.padInfo.top,c.padInfo.left],[c.strideHeight,c.strideWidth],[c.dilationHeight,c.dilationWidth],[c.inHeight,c.inWidth]];return a.runWebGLProgram(p,[r,s],"float32",h)}var SY={kernelName:ro,backendName:"webgl",kernelFunc:IY},TY=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,a=e.strideWidth,n=e.padInfo.top,r=e.padInfo.left,s=e.outChannels/e.inChannels;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -3300,7 +3300,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}},_K=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,a=e.filterWidth,n=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,i=a-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` + `}},CY=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,a=e.filterWidth,n=e.strideHeight,r=e.strideWidth,s=t-1-e.padInfo.top,i=a-1-e.padInfo.left,o=e.outChannels/e.inChannels;this.userCode=` const ivec2 pads = ivec2(${s}, ${i}); void main() { @@ -3345,15 +3345,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}};function $K(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,filterShape:p}=n,c=C.computeConv2DInfo(r.shape,p,i,o,l,u,!0),d=new PK(c);return a.runWebGLProgram(d,[r,s],"float32")}var FK={kernelName:cp,backendName:"webgl",kernelFunc:$K};function DK(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,inputShape:p}=n,c=C.computeConv2DInfo(p,s.shape,i,o,l,u,!0),d=new _K(c);return a.runWebGLProgram(d,[r,s],"float32")}var OK={kernelName:hp,backendName:"webgl",kernelFunc:DK},zK=class{constructor(e){this.variableNames=["X"],this.outputShape=[e,e],this.userCode=` + `}};function NY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,filterShape:d}=n,c=I.computeConv2DInfo(r.shape,d,i,o,l,u,!0),p=new TY(c);return a.runWebGLProgram(p,[r,s],"float32")}var RY={kernelName:vp,backendName:"webgl",kernelFunc:NY};function EY(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,inputShape:d}=n,c=I.computeConv2DInfo(d,s.shape,i,o,l,u,!0),p=new CY(c);return a.runWebGLProgram(p,[r,s],"float32")}var MY={kernelName:wp,backendName:"webgl",kernelFunc:EY},FY=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 LK(e){let{inputs:t,backend:a}=e,{x:n}=t,r=[...n.shape,...n.shape],s=v.sizeFromShape(n.shape),i=pe({inputs:{x:n},backend:a,attrs:{shape:[s]}}),o=new zK(s),l=a.runWebGLProgram(o,[i],i.dtype),u=pe({inputs:{x:l},backend:a,attrs:{shape:r}});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(l),u}var WK={kernelName:mu,backendName:"webgl",kernelFunc:LK},BK=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:a,padInfo:n,strideHeight:r,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:u}=e,{top:p,left:c}=n;this.userCode=` + `}};function $Y(e){let{inputs:t,backend:a}=e,{x:n}=t,r=[...n.shape,...n.shape],s=v.sizeFromShape(n.shape),i=pe({inputs:{x:n},backend:a,attrs:{shape:[s]}}),o=new FY(s),l=a.runWebGLProgram(o,[i],i.dtype),u=pe({inputs:{x:l},backend:a,attrs:{shape:r}});return a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(l),u}var DY={kernelName:vu,backendName:"webgl",kernelFunc:$Y},PY=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:a,padInfo:n,strideHeight:r,strideWidth:s,filterHeight:i,filterWidth:o,dilationHeight:l,dilationWidth:u}=e,{top:d,left:c}=n;this.userCode=` const ivec2 strides = ivec2(${r}, ${s}); - const ivec2 pads = ivec2(${p}, ${c}); + const ivec2 pads = ivec2(${d}, ${c}); const float neg_infinity = -3.4e38; void main() { @@ -3389,7 +3389,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam float result = curVal; setOutput(result); } - `}};function VK(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=C.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),p,c=new BK(u);p=a.runWebGLProgram(c,[r,s],"float32");let d=pe({inputs:{x:p},backend:a,attrs:{shape:u.outShape}});return a.disposeIntermediateTensorInfo(p),d}var UK={kernelName:Mi,backendName:"webgl",kernelFunc:VK};function GK(e){let{inputs:t,backend:a,attrs:n}=e,{equation:r}=n,s=t,{allDims:i,summedDims:o,idDims:l}=C.decodeEinsumEquation(r,s.length);C.checkEinsumDimSizes(i.length,l,s);let{path:u,steps:p}=C.getEinsumComputePath(o,l),c=p.length,d=null,h=i.length,m=[];for(let f=0;f=0&&(d=s0({inputs:{x:d},backend:a,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(d)),h--)}for(let f of m)f!==d&&a.disposeIntermediateTensorInfo(f);return d}var HK={kernelName:fp,backendName:"webgl",kernelFunc:GK},jK="return (x >= 0.0) ? x : (exp(x) - 1.0);",qK=` + `}};function _Y(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=I.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),d,c=new PY(u);d=a.runWebGLProgram(c,[r,s],"float32");let p=pe({inputs:{x:d},backend:a,attrs:{shape:u.outShape}});return a.disposeIntermediateTensorInfo(d),p}var OY={kernelName:so,backendName:"webgl",kernelFunc:_Y};function zY(e){let{inputs:t,backend:a,attrs:n}=e,{equation:r}=n,s=t,{allDims:i,summedDims:o,idDims:l}=I.decodeEinsumEquation(r,s.length);I.checkEinsumDimSizes(i.length,l,s);let{path:u,steps:d}=I.getEinsumComputePath(o,l),c=d.length,p=null,h=i.length,m=[];for(let f=0;f=0&&(p=c0({inputs:{x:p},backend:a,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(p)),h--)}for(let f of m)f!==p&&a.disposeIntermediateTensorInfo(f);return p}var LY={kernelName:Ip,backendName:"webgl",kernelFunc:zY},WY="return (x >= 0.0) ? x : (exp(x) - 1.0);",BY=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -3398,29 +3398,29 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,XK=tt({opSnippet:jK,packedOpSnippet:qK}),KK={kernelName:_i,backendName:"webgl",kernelFunc:XK},YK="return (b >= 0.0) ? a : a * (b + 1.0);",ZK=` +`,VY=tt({opSnippet:WY,packedOpSnippet:BY}),UY={kernelName:oo,backendName:"webgl",kernelFunc:VY},GY="return (b >= 0.0) ? a : a * (b + 1.0);",HY=` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); -`,JK=e=>{let{inputs:t,backend:a}=e,{dy:n,y:r}=t,s=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new Ku(ZK,n.shape,r.shape):new ai(YK,n.shape,r.shape);return a.runWebGLProgram(s,[n,r],n.dtype)},QK={kernelName:fu,backendName:"webgl",kernelFunc:JK},eY=` +`,jY=e=>{let{inputs:t,backend:a}=e,{dy:n,y:r}=t,s=B().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new nd(HY,n.shape,r.shape):new Ei(GY,n.shape,r.shape);return a.runWebGLProgram(s,[n,r],n.dtype)},qY={kernelName:wu,backendName:"webgl",kernelFunc:jY},XY=` return vec4(equal(a, b)); -`,tY="return float(a == b);",aY=ha({opSnippet:tY,packedOpSnippet:eY,dtype:"bool",cpuKernelImpl:PH}),nY={kernelName:Fi,backendName:"webgl",kernelFunc:aY},rY=` +`,KY="return float(a == b);",YY=ha({opSnippet:KY,packedOpSnippet:XY,dtype:"bool",cpuKernelImpl:Tj}),ZY={kernelName:ms,backendName:"webgl",kernelFunc:YY},JY=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - 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 p = ${I.ERF_P}; + float a1 = ${I.ERF_A1}; + float a2 = ${I.ERF_A2}; + float a3 = ${I.ERF_A3}; + float a4 = ${I.ERF_A4}; + float a5 = ${I.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)); -`,sY=tt({opSnippet:rY}),iY={kernelName:$i,backendName:"webgl",kernelFunc:sY},oY=Yu+` +`,QY=tt({opSnippet:JY}),eZ={kernelName:lo,backendName:"webgl",kernelFunc:QY},tZ=rd+` return exp(x); -`,lY=` +`,aZ=` vec4 result = exp(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; @@ -3429,7 +3429,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam result.a = isNaN.a ? x.a : result.a; return result; -`,_8=tt({opSnippet:oY,packedOpSnippet:lY,cpuKernelImpl:_H,dtype:"float32"}),uY={kernelName:Di,backendName:"webgl",kernelFunc:_8};function W1(e){let{inputs:t,attrs:a,backend:n}=e,{dim:r}=a,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=r;return r<0&&(v.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+r+1),o.splice(l,0,1),pe({inputs:{x:s},backend:n,attrs:{shape:o}})}var dY={kernelName:gu,backendName:"webgl",kernelFunc:W1},L5="return exp(x) - 1.0;",pY=tt({opSnippet:L5,packedOpSnippet:L5,cpuKernelImpl:$H}),cY={kernelName:Oi,backendName:"webgl",kernelFunc:pY},W5=class{constructor(e,t,a){this.variableNames=["real","imag"];let n=t[1];this.outputShape=t;let r=a?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=a?`${n}.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=` +`,Qw=tt({opSnippet:tZ,packedOpSnippet:aZ,cpuKernelImpl:Cj,dtype:"float32"}),nZ={kernelName:fs,backendName:"webgl",kernelFunc:Qw};function q1(e){let{inputs:t,attrs:a,backend:n}=e,{dim:r}=a,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=r;return r<0&&(v.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+r+1),o.splice(l,0,1),pe({inputs:{x:s},backend:n,attrs:{shape:o}})}var rZ={kernelName:ku,backendName:"webgl",kernelFunc:q1},Q5="return exp(x) - 1.0;",sZ=tt({opSnippet:Q5,packedOpSnippet:Q5,cpuKernelImpl:Nj}),iZ={kernelName:gs,backendName:"webgl",kernelFunc:sZ},eA=class{constructor(e,t,a){this.variableNames=["real","imag"];let n=t[1];this.outputShape=t;let r=a?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,s=a?`${n}.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) { @@ -3462,12 +3462,12 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ivec2 coords = getOutputCoords(); setOutput(mulMatDFT(coords[0], coords[1])); } - `}};function $8(e,t,a){let n=a.texData.get(e.dataId),r=v.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=pe({inputs:{x:e},backend:a,attrs:{shape:[i,s]}}),l=o.shape,u=new W5("real",l,t),p=new W5("imag",l,t),c=[{dataId:n.complexTensorInfos.real.dataId,dtype:n.complexTensorInfos.real.dtype,shape:l},{dataId:n.complexTensorInfos.imag.dataId,dtype:n.complexTensorInfos.imag.dtype,shape:l}],d=a.runWebGLProgram(u,c,"float32"),h=a.runWebGLProgram(p,c,"float32"),m=hs({inputs:{real:d,imag:h},backend:a});a.disposeIntermediateTensorInfo(d),a.disposeIntermediateTensorInfo(h);let f=pe({inputs:{x:m},backend:a,attrs:{shape:e.shape}});return a.disposeIntermediateTensorInfo(o),a.disposeIntermediateTensorInfo(m),f}function hY(e){let{inputs:t,backend:a}=e,{input:n}=t;return $8(n,!1,a)}var mY={kernelName:gp,backendName:"webgl",kernelFunc:hY},fY=class{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode=` + `}};function e8(e,t,a){let n=a.texData.get(e.dataId),r=v.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=pe({inputs:{x:e},backend:a,attrs:{shape:[i,s]}}),l=o.shape,u=new eA("real",l,t),d=new eA("imag",l,t),c=[{dataId:n.complexTensorInfos.real.dataId,dtype:n.complexTensorInfos.real.dtype,shape:l},{dataId:n.complexTensorInfos.imag.dataId,dtype:n.complexTensorInfos.imag.dtype,shape:l}],p=a.runWebGLProgram(u,c,"float32"),h=a.runWebGLProgram(d,c,"float32"),m=zs({inputs:{real:p,imag:h},backend:a});a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(h);let f=pe({inputs:{x:m},backend:a,attrs:{shape:e.shape}});return a.disposeIntermediateTensorInfo(o),a.disposeIntermediateTensorInfo(m),f}function oZ(e){let{inputs:t,backend:a}=e,{input:n}=t;return e8(n,!1,a)}var lZ={kernelName:Sp,backendName:"webgl",kernelFunc:oZ},uZ=class{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode=` void main() { // Input can be obtained from uniform value. setOutput(value); } - `}};function Jp(e){let{backend:t,attrs:a}=e,{shape:n,value:r}=a,{dtype:s}=a;if(s=s||v.inferDtype(r),s==="string"){let i=v.getArrayFromDType(s,v.sizeFromShape(n));return i.fill(r),t.makeTensorInfo(n,s,i)}else{let i=new fY(n,r),o=[[r]];return t.runWebGLProgram(i,[],s,o)}}var gY={kernelName:yu,backendName:"webgl",kernelFunc:Jp},yY=class{constructor(e){this.variableNames=["Image"],this.outputShape=[];let t=e[2];this.outputShape=e,this.userCode=` + `}};function ic(e){let{backend:t,attrs:a}=e,{shape:n,value:r}=a,{dtype:s}=a;if(s=s||v.inferDtype(r),s==="string"){let i=v.getArrayFromDType(s,v.sizeFromShape(n));return i.fill(r),t.makeTensorInfo(n,s,i)}else{let i=new uZ(n,r),o=[[r]];return t.runWebGLProgram(i,[],s,o)}}var dZ={kernelName:Iu,backendName:"webgl",kernelFunc:ic},pZ=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]; @@ -3481,7 +3481,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(outputValue); } - `}},xY={kernelName:zi,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:a}=e,n=t,r=new yY(a.shape);return n.runWebGLProgram(r,[a],a.dtype)}},B5="return floor(x);",AY=tt({opSnippet:B5,packedOpSnippet:B5,cpuKernelImpl:FH}),bY={kernelName:Li,backendName:"webgl",kernelFunc:AY},vY=` + `}},cZ={kernelName:uo,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:a}=e,n=t,r=new pZ(a.shape);return n.runWebGLProgram(r,[a],a.dtype)}},tA="return floor(x);",hZ=tt({opSnippet:tA,packedOpSnippet:tA,cpuKernelImpl:Rj}),mZ={kernelName:ys,backendName:"webgl",kernelFunc:hZ},fZ=` float s = sign(a) * sign(b); int ia = round(a); int ib = round(b); @@ -3491,7 +3491,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } else { return NAN; } -`,wY=` +`,gZ=` ivec4 ia = round(a); ivec4 ib = round(b); bvec4 cond = notEqual(ib, ivec4(0)); @@ -3512,7 +3512,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam result[3] = idiv(ia[3], ib[3], s[3]); } return vec4(result); -`,kY=ha({opSnippet:vY,packedOpSnippet:wY,dtype:"int32"}),IY={kernelName:Wi,backendName:"webgl",kernelFunc:kY},SY=class{constructor(e){this.variableNames=["A"];let t=Ra(),[a,n]=e;this.outputShape=e,this.userCode=` +`,yZ=ha({opSnippet:fZ,packedOpSnippet:gZ,dtype:"int32"}),xZ={kernelName:xs,backendName:"webgl",kernelFunc:yZ},AZ=class{constructor(e){this.variableNames=["A"];let t=Ra(),[a,n]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -3534,7 +3534,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam setOutput(floor(value * 255.0 + 0.5)); } - `}},CY=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=Ra(),[a,n]=e;this.outputShape=e,this.userCode=` + `}},bZ=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=Ra(),[a,n]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -3568,7 +3568,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ${t.output} = result; } - `}},TY={kernelName:Od,backendName:"webgl",kernelFunc:NY},Pl,J2=B().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function NY(e){let{inputs:t,backend:a,attrs:n}=e,{pixels:r}=t,{numChannels:s}=n,i=typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement,[l,u]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],p=[u,l],c=[u,l,s];if(o||i){let f=B().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(Pl==null||f!==J2)&&(J2=f,Pl=document.createElement("canvas").getContext("2d",{willReadFrequently:J2})),Pl.canvas.width=l,Pl.canvas.height=u,Pl.drawImage(r,0,0,l,u),r=Pl.canvas}let d=a.makeTensorInfo(p,"int32");a.texData.get(d.dataId).usage=hn.PIXELS,a.gpgpu.uploadPixelDataToTexture(a.getTexture(d.dataId),r);let h=B().getBool("WEBGL_PACK")?new CY(c):new SY(c),m=a.runWebGLProgram(h,[d],"int32");return a.disposeData(d.dataId),m}function RY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:m}=n,f=C.convertConv2DDataFormat(p),g=C.computeConv2DInfo(r.shape,s.shape,l,c,u,d,!1,f),y,x=[],A=i!=null,b=o!=null,w=h==="leakyrelu",I=()=>{let N=[r,s],M=(P,E)=>{if(E==="NCHW"&&P.shape.length===1&&P.shape[0]!==1){let S=pe({inputs:{x:P},backend:a,attrs:{shape:[P.shape[0],1,1]}});return x.push(S),S}return P};if(A&&N.push(M(i,p)),b&&N.push(M(o,p)),w){let P=a.makeTensorInfo([],"float32",v.createScalarValue(m,"float32"));N.push(P),x.push(P)}return N};if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type==="SAME"||g.padInfo.type==="VALID"))y=N8({x:r,filter:s,convInfo:g,backend:a,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else if(g.strideWidth<=2&&f==="channelsLast"&&B().getBool("WEBGL_EXP_CONV")){let N=h?Jd(h,!0):null,M=new T8(g,A,N,b,w),P=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],E=I();y=a.runWebGLProgram(M,E,"float32",P)}else if(B().getBool("WEBGL_CONV_IM2COL"))y=R8({x:r,filter:s,convInfo:g,backend:a,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else{let N=h?Jd(h,!1):null,M=new C8(g,A,N,b,w),P=I();y=a.runWebGLProgram(M,P,"float32")}let T=pe({inputs:{x:y},backend:a,attrs:{shape:g.outShape}});return x.push(y),x.forEach(N=>a.disposeIntermediateTensorInfo(N)),T}var EY={kernelName:Zr,backendName:"webgl",kernelFunc:RY};function MY(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:p,dimRoundingMode:c,activation:d,leakyreluAlpha:h}=n,m=[],f=p;f==null&&(f=[1,1]),v.assert(C.eitherStridesOrDilationsAreOne(l,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${f}'`);let g=C.computeConv2DInfo(r.shape,s.shape,l,f,u,c,!0),y=B().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,x=d?Jd(d,y):null,A=[r,s],b=i!=null,w=o!=null,I=d==="leakyrelu";if(b&&A.push(i),w&&A.push(o),I){let P=a.makeTensorInfo([],"float32",v.createScalarValue(h,"float32"));A.push(P),m.push(P)}let T;y?T=new P8(g,b,x,w,I):T=new M8(g,b,x,w,I);let N=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],M=a.runWebGLProgram(T,A,"float32",N);return m.forEach(P=>a.disposeIntermediateTensorInfo(P)),M}var PY={kernelName:Jr,backendName:"webgl",kernelFunc:MY},_Y=class{constructor(e,t,a,n){this.sliceDim=e,this.strides=t,this.paramsShape=n,this.variableNames=["x","indices"],this.outputShape=a;let r=mt(a.length),s=` + `}},vZ={kernelName:jd,backendName:"webgl",kernelFunc:wZ},Bl,s1=B().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function wZ(e){let{inputs:t,backend:a,attrs:n}=e,{pixels:r}=t,{numChannels:s}=n,i=typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement,[l,u]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],d=[u,l],c=[u,l,s];if(o||i){let f=B().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(Bl==null||f!==s1)&&(s1=f,Bl=document.createElement("canvas").getContext("2d",{willReadFrequently:s1})),Bl.canvas.width=l,Bl.canvas.height=u,Bl.drawImage(r,0,0,l,u),r=Bl.canvas}let p=a.makeTensorInfo(d,"int32");a.texData.get(p.dataId).usage=gn.PIXELS,a.gpgpu.uploadPixelDataToTexture(a.getTexture(p.dataId),r);let h=B().getBool("WEBGL_PACK")?new bZ(c):new AZ(c),m=a.runWebGLProgram(h,[p],"int32");return a.disposeData(p.dataId),m}function kZ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:d,dilations:c,dimRoundingMode:p,activation:h,leakyreluAlpha:m}=n,f=I.convertConv2DDataFormat(d),g=I.computeConv2DInfo(r.shape,s.shape,l,c,u,p,!1,f),y,x=[],A=i!=null,b=o!=null,w=h==="leakyrelu",S=()=>{let N=[r,s],M=(F,E)=>{if(E==="NCHW"&&F.shape.length===1&&F.shape[0]!==1){let T=pe({inputs:{x:F},backend:a,attrs:{shape:[F.shape[0],1,1]}});return x.push(T),T}return F};if(A&&N.push(M(i,d)),b&&N.push(M(o,d)),w){let F=a.makeTensorInfo([],"float32",v.createScalarValue(m,"float32"));N.push(F),x.push(F)}return N};if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type==="SAME"||g.padInfo.type==="VALID"))y=Xw({x:r,filter:s,convInfo:g,backend:a,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else if(g.strideWidth<=2&&f==="channelsLast"&&B().getBool("WEBGL_EXP_CONV")){let N=h?op(h,!0):null,M=new qw(g,A,N,b,w),F=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],E=S();y=a.runWebGLProgram(M,E,"float32",F)}else if(B().getBool("WEBGL_CONV_IM2COL"))y=Kw({x:r,filter:s,convInfo:g,backend:a,bias:i,activation:h,preluActivationWeights:o,leakyreluAlpha:m});else{let N=h?op(h,!1):null,M=new jw(g,A,N,b,w),F=S();y=a.runWebGLProgram(M,F,"float32")}let C=pe({inputs:{x:y},backend:a,attrs:{shape:g.outShape}});return x.push(y),x.forEach(N=>a.disposeIntermediateTensorInfo(N)),C}var IZ={kernelName:as,backendName:"webgl",kernelFunc:kZ};function SZ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:d,dimRoundingMode:c,activation:p,leakyreluAlpha:h}=n,m=[],f=d;f==null&&(f=[1,1]),v.assert(I.eitherStridesOrDilationsAreOne(l,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${f}'`);let g=I.computeConv2DInfo(r.shape,s.shape,l,f,u,c,!0),y=B().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,x=p?op(p,y):null,A=[r,s],b=i!=null,w=o!=null,S=p==="leakyrelu";if(b&&A.push(i),w&&A.push(o),S){let F=a.makeTensorInfo([],"float32",v.createScalarValue(h,"float32"));A.push(F),m.push(F)}let C;y?C=new Jw(g,b,x,w,S):C=new Zw(g,b,x,w,S);let N=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],M=a.runWebGLProgram(C,A,"float32",N);return m.forEach(F=>a.disposeIntermediateTensorInfo(F)),M}var TZ={kernelName:ns,backendName:"webgl",kernelFunc:SZ},CZ=class{constructor(e,t,a,n){this.sliceDim=e,this.strides=t,this.paramsShape=n,this.variableNames=["x","indices"],this.outputShape=a;let r=ft(a.length),s=` int index;`;for(let i=0;i= 0) && (index < ${e[2]}) ? 1.0 : 0.0; setOutput(inBounds * getA(${n})); } - `}};function OY(e,t){let a=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let r=0;r=0,()=>`GatherV2: the index value ${w} is not in [0, ${A-1}]`)}}let u=C.segment_util.collectGatherOpShapeInfo(r,s,l,o),p=v.sizeFromShape(s.shape),c=[],d=pe({inputs:{x:r},backend:a,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),h=pe({inputs:{x:s},backend:a,attrs:{shape:[u.batchSize,p/u.batchSize]}});c.push(d),c.push(h);let m=[u.batchSize,u.outerSize,p/u.batchSize,u.sliceSize];if(a.shouldExecuteOnCPU([r,s])||r.dtype==="string"){let x=a.bufferSync(h),A=a.bufferSync(d),b=OH(A,x,m);return c.forEach(w=>a.disposeIntermediateTensorInfo(w)),a.makeTensorInfo(u.outputShape,b.dtype,b.values)}let f=new DY(d.shape,m),g=a.runWebGLProgram(f,[d,h],d.dtype);c.push(g);let y=pe({inputs:{x:g},backend:a,attrs:{shape:u.outputShape}});return c.forEach(x=>a.disposeIntermediateTensorInfo(x)),y}var zY={kernelName:xu,backendName:"webgl",kernelFunc:F8},LY="return float(a > b);",WY=` + `}};function MZ(e,t){let a=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let r=0;r=0,()=>`GatherV2: the index value ${w} is not in [0, ${A-1}]`)}}let u=I.segment_util.collectGatherOpShapeInfo(r,s,l,o),d=v.sizeFromShape(s.shape),c=[],p=pe({inputs:{x:r},backend:a,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),h=pe({inputs:{x:s},backend:a,attrs:{shape:[u.batchSize,d/u.batchSize]}});c.push(p),c.push(h);let m=[u.batchSize,u.outerSize,d/u.batchSize,u.sliceSize];if(a.shouldExecuteOnCPU([r,s])||r.dtype==="string"){let x=a.bufferSync(h),A=a.bufferSync(p),b=Mj(A,x,m);return c.forEach(w=>a.disposeIntermediateTensorInfo(w)),a.makeTensorInfo(u.outputShape,b.dtype,b.values)}let f=new EZ(p.shape,m),g=a.runWebGLProgram(f,[p,h],p.dtype);c.push(g);let y=pe({inputs:{x:g},backend:a,attrs:{shape:u.outputShape}});return c.forEach(x=>a.disposeIntermediateTensorInfo(x)),y}var FZ={kernelName:Su,backendName:"webgl",kernelFunc:t8},$Z="return float(a > b);",DZ=` return vec4(greaterThan(a, b)); -`,BY=ha({opSnippet:LY,packedOpSnippet:WY,cpuKernelImpl:zH,dtype:"bool"}),VY={kernelName:Ui,backendName:"webgl",kernelFunc:BY},UY="return float(a >= b);",GY=` +`,PZ=ha({opSnippet:$Z,packedOpSnippet:DZ,cpuKernelImpl:Fj,dtype:"bool"}),_Z={kernelName:As,backendName:"webgl",kernelFunc:PZ},OZ="return float(a >= b);",zZ=` return vec4(greaterThanEqual(a, b)); -`,HY=ha({opSnippet:UY,packedOpSnippet:GY,dtype:"bool",cpuKernelImpl:LH}),jY={kernelName:Gi,backendName:"webgl",kernelFunc:HY};function qY(e){let{inputs:t,backend:a}=e,{input:n}=t;return $8(n,!0,a)}var XY={kernelName:yp,backendName:"webgl",kernelFunc:qY},KY="return float(!isnan(x) && !isinf(x));",YY=tt({opSnippet:KY,dtype:"bool"}),ZY={kernelName:ji,backendName:"webgl",kernelFunc:YY},JY="return float(isinf(x));",QY=tt({opSnippet:JY,dtype:"bool"}),eZ={kernelName:qi,backendName:"webgl",kernelFunc:QY},tZ="return float(isnan(x));",aZ=tt({opSnippet:tZ,dtype:"bool"}),nZ={kernelName:Xi,backendName:"webgl",kernelFunc:aZ},rZ="return float(a < b);",sZ=` +`,LZ=ha({opSnippet:OZ,packedOpSnippet:zZ,dtype:"bool",cpuKernelImpl:$j}),WZ={kernelName:bs,backendName:"webgl",kernelFunc:LZ};function BZ(e){let{inputs:t,backend:a}=e,{input:n}=t;return e8(n,!0,a)}var VZ={kernelName:Tp,backendName:"webgl",kernelFunc:BZ},UZ="return float(!isnan(x) && !isinf(x));",GZ=tt({opSnippet:UZ,dtype:"bool"}),HZ={kernelName:mo,backendName:"webgl",kernelFunc:GZ},jZ="return float(isinf(x));",qZ=tt({opSnippet:jZ,dtype:"bool"}),XZ={kernelName:fo,backendName:"webgl",kernelFunc:qZ},KZ="return float(isnan(x));",YZ=tt({opSnippet:KZ,dtype:"bool"}),ZZ={kernelName:go,backendName:"webgl",kernelFunc:YZ},JZ="return float(a < b);",QZ=` return vec4(lessThan(a, b)); -`,iZ=ha({opSnippet:rZ,packedOpSnippet:sZ,cpuKernelImpl:WH,dtype:"bool"}),oZ={kernelName:Yi,backendName:"webgl",kernelFunc:iZ},lZ="return float(a <= b);",uZ=` +`,eJ=ha({opSnippet:JZ,packedOpSnippet:QZ,cpuKernelImpl:Dj,dtype:"bool"}),tJ={kernelName:vs,backendName:"webgl",kernelFunc:eJ},aJ="return float(a <= b);",nJ=` return vec4(lessThanEqual(a, b)); -`,dZ=ha({opSnippet:lZ,packedOpSnippet:uZ,cpuKernelImpl:BH,dtype:"bool"}),pZ={kernelName:Zi,backendName:"webgl",kernelFunc:dZ};function cZ(e){let{backend:t,attrs:a}=e,{start:n,stop:r,num:s}=a,i=VH(n,r,s);return t.makeTensorInfo([i.length],"float32",i)}var hZ={kernelName:Ji,backendName:"webgl",kernelFunc:cZ},mZ=Yu+` +`,rJ=ha({opSnippet:aJ,packedOpSnippet:nJ,cpuKernelImpl:Pj,dtype:"bool"}),sJ={kernelName:ws,backendName:"webgl",kernelFunc:rJ};function iJ(e){let{backend:t,attrs:a}=e,{start:n,stop:r,num:s}=a,i=_j(n,r,s);return t.makeTensorInfo([i.length],"float32",i)}var oJ={kernelName:xo,backendName:"webgl",kernelFunc:iJ},lJ=rd+` return x < 0.0 ? 0./0. : log(x); -`,fZ=` +`,uJ=` vec4 result = log(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r); @@ -3608,18 +3608,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b); result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a); return result; -`,gZ=tt({opSnippet:mZ,packedOpSnippet:fZ,cpuKernelImpl:UH}),yZ={kernelName:Qi,backendName:"webgl",kernelFunc:gZ},xZ=Yu+` +`,dJ=tt({opSnippet:lJ,packedOpSnippet:uJ,cpuKernelImpl:Oj}),pJ={kernelName:ks,backendName:"webgl",kernelFunc:dJ},cJ=rd+` return log(1.0 + x); -`,AZ=tt({opSnippet:xZ}),bZ={kernelName:eo,backendName:"webgl",kernelFunc:AZ},vZ="return float(a >= 1.0 && b >= 1.0);",wZ=` +`,hJ=tt({opSnippet:cJ}),mJ={kernelName:Ao,backendName:"webgl",kernelFunc:hJ},fJ="return float(a >= 1.0 && b >= 1.0);",gJ=` return vec4( vec4(greaterThanEqual(a, vec4(1.0))) * vec4(greaterThanEqual(b, vec4(1.0)))); -`,kZ=ha({opSnippet:vZ,packedOpSnippet:wZ,dtype:"bool"}),IZ={kernelName:to,backendName:"webgl",kernelFunc:kZ},SZ="return float(!(x >= 1.0));",CZ=tt({opSnippet:SZ}),TZ={kernelName:ao,backendName:"webgl",kernelFunc:CZ},NZ="return float(a >= 1.0 || b >= 1.0);",RZ=` +`,yJ=ha({opSnippet:fJ,packedOpSnippet:gJ,dtype:"bool"}),xJ={kernelName:bo,backendName:"webgl",kernelFunc:yJ},AJ="return float(!(x >= 1.0));",bJ=tt({opSnippet:AJ}),vJ={kernelName:vo,backendName:"webgl",kernelFunc:bJ},wJ="return float(a >= 1.0 || b >= 1.0);",kJ=` return min( vec4(greaterThanEqual(a, vec4(1.0))) + vec4(greaterThanEqual(b, vec4(1.0))), vec4(1.0)); -`,EZ=ha({opSnippet:NZ,packedOpSnippet:RZ,dtype:"bool"}),MZ={kernelName:no,backendName:"webgl",kernelFunc:EZ},PZ=class{constructor(e,t,a,n,r){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${a}) + float(${n}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` +`,IJ=ha({opSnippet:wJ,packedOpSnippet:kJ,dtype:"bool"}),SJ={kernelName:wo,backendName:"webgl",kernelFunc:IJ},TJ=class{constructor(e,t,a,n,r){this.variableNames=["x"],this.outputShape=[];let s=t,i=e[3]-1;this.outputShape=e;let o,l=`float(${a}) + float(${n}) * 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]; @@ -3638,7 +3638,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam float val = x * ${o}; setOutput(val); } - `}},_Z=class{constructor(e,t,a,n,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(${a}) + float(${n}) * sum`;r===.5?o=`inversesqrt(${l})`:r===1?o=`1.0/(${l})`:o=`exp(log(${l}) * float(-${r}));`,this.userCode=` + `}},CJ=class{constructor(e,t,a,n,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(${a}) + float(${n}) * 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; @@ -3700,7 +3700,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam vec4 result = xAtOutputCoords * ${o}; setOutput(result); } - `}},$Z=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n,u=B().getBool("WEBGL_PACK_NORMALIZATION")?new _Z(r.shape,s,i,o,l):new PZ(r.shape,s,i,o,l);return a.runWebGLProgram(u,[r],r.dtype)},FZ={kernelName:ro,backendName:"webgl",kernelFunc:$Z},DZ=class{constructor(e,t,a,n,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=a,this.alpha=n,this.beta=r,this.userCode=` + `}},NJ=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n,u=B().getBool("WEBGL_PACK_NORMALIZATION")?new CJ(r.shape,s,i,o,l):new TJ(r.shape,s,i,o,l);return a.runWebGLProgram(u,[r],r.dtype)},RJ={kernelName:ko,backendName:"webgl",kernelFunc:NJ},EJ=class{constructor(e,t,a,n,r){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=a,this.alpha=n,this.beta=r,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3755,16 +3755,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(result); } - `}},OZ=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:p}=n,c=new DZ(r.shape,o,l,u,p);return a.runWebGLProgram(c,[r,s,i],r.dtype)},zZ={kernelName:Au,backendName:"webgl",kernelFunc:OZ};function LZ(e,t,a,n){let r=v.sizeFromShape(t),s=v.sizeFromShape(e.shape)/r,i=pe({inputs:{x:e},attrs:{shape:[s,r]},backend:n}),o=rl(i,e.dtype,"max",n),l=pe({inputs:{x:o},attrs:{shape:a},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}function D8(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=n,o=r.shape.length,l=v.parseAxisParam(s,r.shape),u=l,p=C.getAxesPermutation(u,o),c=p!=null,d=a.shouldExecuteOnCPU([r]),h=r;if(c){if(d){let x=a.texData.get(h.dataId).values,A=new Array(o);for(let I=0;I{let{inputs:t,backend:a,attrs:n}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:d}=n,c=new EJ(r.shape,o,l,u,d);return a.runWebGLProgram(c,[r,s,i],r.dtype)},FJ={kernelName:Tu,backendName:"webgl",kernelFunc:MJ};function $J(e,t,a,n){let r=v.sizeFromShape(t),s=v.sizeFromShape(e.shape)/r,i=pe({inputs:{x:e},attrs:{shape:[s,r]},backend:n}),o=hl(i,e.dtype,"max",n),l=pe({inputs:{x:o},attrs:{shape:a},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}function a8(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=n,o=r.shape.length,l=v.parseAxisParam(s,r.shape),u=l,d=I.getAxesPermutation(u,o),c=d!=null,p=a.shouldExecuteOnCPU([r]),h=r;if(c){if(p){let x=a.texData.get(h.dataId).values,A=new Array(o);for(let S=0;S`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let p=C.computePool2DInfo(r.shape,s,i,u,o,l);if(p.filterWidth===1&&p.filterHeight===1&&v.arraysEqual(p.inShape,p.outShape))return Qa({inputs:{x:r},backend:a});let c=new Qd(p,"max",!1);return a.runWebGLProgram(c,[r],r.dtype)}var jZ={kernelName:oo,backendName:"webgl",kernelFunc:HZ};function qZ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=n,p=[1,1,1],c=C.computePool3DInfo(r.shape,s,i,p,o,u,l),d=new L3(c,"max",!1);return a.runWebGLProgram(d,[r],r.dtype)}var XZ={kernelName:bu,backendName:"webgl",kernelFunc:qZ},KZ=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,a=e.strideWidth,n=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=` +`,OJ=ha({opSnippet:PJ,packedOpSnippet:_J,cpuKernelImpl:Lj}),zJ={kernelName:Is,backendName:"webgl",kernelFunc:OJ};function LJ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t;Ju(r,"maxPool");let{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=1;v.assert(I.eitherStridesOrDilationsAreOne(i,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=I.computePool2DInfo(r.shape,s,i,u,o,l);if(d.filterWidth===1&&d.filterHeight===1&&v.arraysEqual(d.inShape,d.outShape))return tn({inputs:{x:r},backend:a});let c=new lp(d,"max",!1);return a.runWebGLProgram(c,[r],r.dtype)}var WJ={kernelName:So,backendName:"webgl",kernelFunc:LJ};function BJ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=n,d=[1,1,1],c=I.computePool3DInfo(r.shape,s,i,d,o,u,l),p=new K3(c,"max",!1);return a.runWebGLProgram(p,[r],r.dtype)}var VJ={kernelName:Cu,backendName:"webgl",kernelFunc:BJ},UJ=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,a=e.strideWidth,n=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() { @@ -3810,8 +3810,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}},YZ=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,a=e.strideHeight,n=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,p=o-1-e.padInfo.front,c=l-1-e.padInfo.top,d=u-1-e.padInfo.left,h=o*l*u-1;this.userCode=` - const ivec3 pads = ivec3(${p}, ${c}, ${d}); + `}},GJ=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,a=e.strideHeight,n=e.strideWidth,r=e.dilationDepth,s=e.dilationHeight,i=e.dilationWidth,o=e.effectiveFilterDepth,l=e.effectiveFilterHeight,u=e.effectiveFilterWidth,d=o-1-e.padInfo.front,c=l-1-e.padInfo.top,p=u-1-e.padInfo.left,h=o*l*u-1;this.userCode=` + const ivec3 pads = ivec3(${d}, ${c}, ${p}); void main() { ivec5 coords = getOutputCoords(); @@ -3874,16 +3874,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam } setOutput(dotProd); } - `}};function ZZ(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:p}=n,c=[1,1,1],d=C.computePool3DInfo(i.shape,o,l,c,u,p),h=new L3(d,"max",!0),m=a.runWebGLProgram(h,[i],i.dtype),f=new YZ(d),g=a.runWebGLProgram(f,[r,m],i.dtype);return a.disposeIntermediateTensorInfo(m),g}var JZ={kernelName:bp,backendName:"webgl",kernelFunc:ZZ};function QZ(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s,output:i}=t,o=s;Gu([s,i],"maxPoolGrad");let{filterSize:l,strides:u,pad:p,dimRoundingMode:c}=n,d=C.computePool2DInfo(o.shape,l,u,1,p,c),h=!0,m=new Qd(d,"max",h),f=a.runWebGLProgram(m,[o],o.dtype),g=new KZ(d),y=a.runWebGLProgram(g,[r,f],o.dtype);return a.disposeIntermediateTensorInfo(f),y}var eJ={kernelName:Ap,backendName:"webgl",kernelFunc:QZ};function tJ(e,t,a,n){let r=new Qd(a,"max",!1),s=n.runWebGLProgram(r,[e],"float32");r=new Qd(a,"max",!0,!0,t);let i=n.runWebGLProgram(r,[e],"float32");return[s,i]}var aJ={kernelName:vu,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=a;v.assert(n.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`);let u=[1,1];v.assert(C.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let p=C.computePool2DInfo(n.shape,r,s,u,i),[c,d]=tJ(n,o,p,l);return[c,d]}};function nJ(e,t,a,n){let r=v.sizeFromShape(t),s=v.sizeFromShape(e.shape)/r,i=pe({inputs:{x:e},attrs:{shape:[s,r]},backend:n}),o=rl(i,"float32","mean",n),l=pe({inputs:{x:o},attrs:{shape:a},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}var rJ={kernelName:lo,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n}=e,{keepDims:r,axis:s}=t,i=a,o=n.shape.length,l=v.parseAxisParam(s,n.shape),u=l,p=C.getAxesPermutation(u,o),c=p!=null,d=i.shouldExecuteOnCPU([n]),h=[],m=n;if(c){if(d){let A=i.texData.get(m.dataId).values,b=new Array(o);for(let T=0;T{let{x:n}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=t,l=a;v.assert(n.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`);let u=[1,1];v.assert(I.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let d=I.computePool2DInfo(n.shape,r,s,u,i),[c,p]=KJ(n,o,d,l);return[c,p]}};function ZJ(e,t,a,n){let r=v.sizeFromShape(t),s=v.sizeFromShape(e.shape)/r,i=pe({inputs:{x:e},attrs:{shape:[s,r]},backend:n}),o=hl(i,"float32","mean",n),l=pe({inputs:{x:o},attrs:{shape:a},backend:n});return n.disposeIntermediateTensorInfo(i),n.disposeIntermediateTensorInfo(o),l}var JJ={kernelName:To,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n}=e,{keepDims:r,axis:s}=t,i=a,o=n.shape.length,l=v.parseAxisParam(s,n.shape),u=l,d=I.getAxesPermutation(u,o),c=d!=null,p=i.shouldExecuteOnCPU([n]),h=[],m=n;if(c){if(p){let A=i.texData.get(m.dataId).values,b=new Array(o);for(let C=0;Cu[0]+e[p]+u[1]);let n=e.length,r=mt(n),s=t.map(u=>u[0]).join(","),i=t.map((u,p)=>u[0]+e[p]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n),l=a==="reflect"?0:1;if(n===1){this.userCode=` +`,nQ=ha({opSnippet:tQ,packedOpSnippet:aQ,cpuKernelImpl:Wj}),rQ={kernelName:Ss,backendName:"webgl",kernelFunc:nQ},sQ=class{constructor(e,t,a){this.variableNames=["x"],this.outputShape=t.map((u,d)=>u[0]+e[d]+u[1]);let n=e.length,r=ft(n),s=t.map(u=>u[0]).join(","),i=t.map((u,d)=>u[0]+e[d]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n),l=a==="reflect"?0:1;if(n===1){this.userCode=` int start = ${s}; int end = ${i}; @@ -3912,7 +3912,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam ${r} coords = outC - start; setOutput(getX(${o})); } - `}},cJ=class{constructor(e,t,a){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((h,m)=>h[0]+e[m]+h[1]);let n=e.length,r=mt(n),s=t.map(h=>h[0]).join(","),i=t.map((h,m)=>h[0]+e[m]).join(","),o=ka("rc",n),l=ka("source",n),u=`${o[n-1]} < ${this.outputShape[n-1]}`,p=n===1?"source":`vec2(${l.slice(-2).join()})`,c=a==="reflect"?0:1,d="";if(n===1){let h=` + `}},iQ=class{constructor(e,t,a){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((h,m)=>h[0]+e[m]+h[1]);let n=e.length,r=ft(n),s=t.map(h=>h[0]).join(","),i=t.map((h,m)=>h[0]+e[m]).join(","),o=ka("rc",n),l=ka("source",n),u=`${o[n-1]} < ${this.outputShape[n-1]}`,d=n===1?"source":`vec2(${l.slice(-2).join()})`,c=a==="reflect"?0:1,p="";if(n===1){let h=` ${r} source = rc; if (source < start) { source = start * 2 - source - ${c}; @@ -3920,14 +3920,14 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam source = (end - 1) * 2 - source + ${c}; } source -= start; - `;d=` + `;p=` ${r} rc = outputLoc; ${h} - result[0] = getChannel(getX(${l.join()}), ${p}); + result[0] = getChannel(getX(${l.join()}), ${d}); ${o[n-1]} += 1; if(${u}) { ${h} - result[1] = getChannel(getX(${l.join()}), ${p}); + result[1] = getChannel(getX(${l.join()}), ${d}); } `}else{let h=` ${r} source = rc; @@ -3938,24 +3938,24 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam lt * (start * 2 - source - ${c}) + gte * ((end - 1) * 2 - source + ${c}); source -= start; - `;d=` + `;p=` ${r} rc = outputLoc; ${h} - result[0] = getChannel(getX(${l.join()}), ${p}); + result[0] = getChannel(getX(${l.join()}), ${d}); ${o[n-1]} += 1; if(${u}) { ${h} - result[1] = getChannel(getX(${l.join()}), ${p}); + result[1] = getChannel(getX(${l.join()}), ${d}); } rc = outputLoc; ${o[n-2]} += 1; if(${o[n-2]} < ${this.outputShape[n-2]}) { ${h} - result[2] = getChannel(getX(${l.join()}), ${p}); + result[2] = getChannel(getX(${l.join()}), ${d}); ${o[n-1]} += 1; if(${u}) { ${h} - result[3] = getChannel(getX(${l.join()}), ${p}); + result[3] = getChannel(getX(${l.join()}), ${d}); } } `}this.userCode=` @@ -3965,16 +3965,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam void main() { ${r} outputLoc = getOutputCoords(); vec4 result = vec4(0.); - ${d} + ${p} setOutput(result); } - `}},hJ=({inputs:e,backend:t,attrs:a})=>{let{x:n}=e,{paddings:r,mode:s}=a,i=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new cJ(n.shape,r,s):new pJ(n.shape,r,s);return t.runWebGLProgram(i,[n],n.dtype)},mJ={kernelName:co,backendName:"webgl",kernelFunc:hJ},fJ=`if (b == 0.0) return NAN; - return mod(a, b);`,gJ=` + `}},oQ=({inputs:e,backend:t,attrs:a})=>{let{x:n}=e,{paddings:r,mode:s}=a,i=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new iQ(n.shape,r,s):new sQ(n.shape,r,s);return t.runWebGLProgram(i,[n],n.dtype)},lQ={kernelName:No,backendName:"webgl",kernelFunc:oQ},uQ=`if (b == 0.0) return NAN; + return mod(a, b);`,dQ=` vec4 result = mod(a, b); bvec4 isNaN = equal(b, vec4(0.0)); - `+nl+` + `+cl+` return result; -`,yJ=ha({opSnippet:fJ,packedOpSnippet:gJ}),xJ={kernelName:ho,backendName:"webgl",kernelFunc:yJ},AJ=class{constructor(e,t,a){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,a],this.userCode=` +`,pQ=ha({opSnippet:uQ,packedOpSnippet:dQ}),cQ={kernelName:Ro,backendName:"webgl",kernelFunc:pQ},hQ=class{constructor(e,t,a){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,a],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -3994,11 +3994,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,qq=tt({opSnippet:jq}),Xq={kernelNam // If no other event happened, last event happened. setOutput(float(${t-1})); } - `}},bJ=` + `}},mQ=` if (a == b) { return 1.0; }; -return a / b;`,vJ=` +return a / b;`,fQ=` // vec4 one = vec4(equal(a, b)); // return one + (vec4(1.0) - one) * a / b; vec4 result = a / b; @@ -4016,9 +4016,9 @@ return a / b;`,vJ=` } return result; -`,O8=ha({opSnippet:bJ,packedOpSnippet:vJ,checkOutOfBounds:!0}),wJ={kernelName:Pi,backendName:"webgl",kernelFunc:O8},V5="return a - b;",z8=ha({opSnippet:V5,packedOpSnippet:V5,supportsComplex:!0,cpuKernelImpl:hj}),kJ={kernelName:qo,backendName:"webgl",kernelFunc:z8};function L8(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{dim:s}=n,i=v.parseAxisParam([s],r.shape),o=D8({inputs:{x:r},backend:a,attrs:{reductionIndices:i,keepDims:!1}}),l=C.expandShapeToKeepDim(o.shape,i),u=pe({inputs:{x:o},backend:a,attrs:{shape:l}}),p=z8({inputs:{a:r,b:u},backend:a}),c=_8({inputs:{x:p},backend:a}),d=s0({inputs:{x:c},backend:a,attrs:{axis:i,keepDims:!1}}),h=pe({inputs:{x:d},backend:a,attrs:{shape:l}}),m=O8({inputs:{a:c,b:h},backend:a});return a.disposeIntermediateTensorInfo(o),a.disposeIntermediateTensorInfo(u),a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(d),a.disposeIntermediateTensorInfo(h),m}var IJ={kernelName:Uo,backendName:"webgl",kernelFunc:L8};function SJ(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n,l=o?r:L8({inputs:{logits:r},backend:a,attrs:{dim:r.shape.length-1}}),u=l.shape[0],p=l.shape[1],c=new AJ(u,p,s),d=[[i]],h=a.runWebGLProgram(c,[l],"int32",d);return o||a.disposeIntermediateTensorInfo(l),h}var CJ={kernelName:mo,backendName:"webgl",kernelFunc:SJ},TJ=En+` +`,n8=ha({opSnippet:mQ,packedOpSnippet:fQ,checkOutOfBounds:!0}),gQ={kernelName:io,backendName:"webgl",kernelFunc:n8},aA="return a - b;",r8=ha({opSnippet:aA,packedOpSnippet:aA,supportsComplex:!0,cpuKernelImpl:oq}),yQ={kernelName:Fs,backendName:"webgl",kernelFunc:r8};function s8(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{dim:s}=n,i=v.parseAxisParam([s],r.shape),o=a8({inputs:{x:r},backend:a,attrs:{reductionIndices:i,keepDims:!1}}),l=I.expandShapeToKeepDim(o.shape,i),u=pe({inputs:{x:o},backend:a,attrs:{shape:l}}),d=r8({inputs:{a:r,b:u},backend:a}),c=Qw({inputs:{x:d},backend:a}),p=c0({inputs:{x:c},backend:a,attrs:{axis:i,keepDims:!1}}),h=pe({inputs:{x:p},backend:a,attrs:{shape:l}}),m=n8({inputs:{a:c,b:h},backend:a});return a.disposeIntermediateTensorInfo(o),a.disposeIntermediateTensorInfo(u),a.disposeIntermediateTensorInfo(d),a.disposeIntermediateTensorInfo(c),a.disposeIntermediateTensorInfo(p),a.disposeIntermediateTensorInfo(h),m}var xQ={kernelName:el,backendName:"webgl",kernelFunc:s8};function AQ(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n,l=o?r:s8({inputs:{logits:r},backend:a,attrs:{dim:r.shape.length-1}}),u=l.shape[0],d=l.shape[1],c=new hQ(u,d,s),p=[[i]],h=a.runWebGLProgram(c,[l],"int32",p);return o||a.disposeIntermediateTensorInfo(l),h}var bQ={kernelName:Eo,backendName:"webgl",kernelFunc:AQ},vQ=$n+` return -x; -`,NJ=` +`,wQ=` vec4 result = -x; bvec4 isNaN = isnan(x); @@ -4028,14 +4028,14 @@ return a / b;`,vJ=` result.a = isNaN.a ? x.a : result.a; return result; -`;function RJ(e){let{inputs:t,backend:a}=e,{x:n}=t;if(a.shouldExecuteOnCPU([n])){let s=a.texData.get(n.dataId),[i,o]=XH(s.values,n.shape,n.dtype);return a.makeTensorInfo(o,n.dtype,i)}let r;return B().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new jr(n.shape,NJ):r=new Kn(n.shape,TJ),a.runWebGLProgram(r,[n],n.dtype)}var EJ={kernelName:wu,backendName:"webgl",kernelFunc:RJ},MJ=Rn.nonMaxSuppressionV3Impl;function PJ(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=n,u=a.readSync(r.dataId),p=a.readSync(s.dataId),{selectedIndices:c}=MJ(u,p,i,o,l);return a.makeTensorInfo([c.length],"int32",new Int32Array(c))}var _J={kernelName:yo,backendName:"webgl",kernelFunc:PJ},$J=Rn.nonMaxSuppressionV4Impl;function FJ(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:u}=n,p=a.readSync(r.dataId),c=a.readSync(s.dataId),{selectedIndices:d,validOutputs:h}=$J(p,c,i,o,l,u);return[a.makeTensorInfo([d.length],"int32",new Int32Array(d)),a.makeTensorInfo([],"int32",new Int32Array([h]))]}var DJ={kernelName:ku,backendName:"webgl",kernelFunc:FJ},OJ=Rn.nonMaxSuppressionV5Impl;function zJ(e){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=n,p=a.readSync(r.dataId),c=a.readSync(s.dataId),d=i,h=o,m=l,f=u,{selectedIndices:g,selectedScores:y}=OJ(p,c,d,h,m,f);return[a.makeTensorInfo([g.length],"int32",new Int32Array(g)),a.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var LJ={kernelName:xo,backendName:"webgl",kernelFunc:zJ},WJ=class{constructor(e,t,a,n){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` +`;function kQ(e){let{inputs:t,backend:a}=e,{x:n}=t;if(a.shouldExecuteOnCPU([n])){let s=a.texData.get(n.dataId),[i,o]=Vj(s.values,n.shape,n.dtype);return a.makeTensorInfo(o,n.dtype,i)}let r;return B().getBool("WEBGL_PACK_UNARY_OPERATIONS")?r=new Zr(n.shape,wQ):r=new Qn(n.shape,vQ),a.runWebGLProgram(r,[n],n.dtype)}var IQ={kernelName:Ru,backendName:"webgl",kernelFunc:kQ},SQ=Fn.nonMaxSuppressionV3Impl;function TQ(e){I.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=n,u=a.readSync(r.dataId),d=a.readSync(s.dataId),{selectedIndices:c}=SQ(u,d,i,o,l);return a.makeTensorInfo([c.length],"int32",new Int32Array(c))}var CQ={kernelName:Mo,backendName:"webgl",kernelFunc:TQ},NQ=Fn.nonMaxSuppressionV4Impl;function RQ(e){I.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,padToMaxOutputSize:u}=n,d=a.readSync(r.dataId),c=a.readSync(s.dataId),{selectedIndices:p,validOutputs:h}=NQ(d,c,i,o,l,u);return[a.makeTensorInfo([p.length],"int32",new Int32Array(p)),a.makeTensorInfo([],"int32",new Int32Array([h]))]}var EQ={kernelName:Eu,backendName:"webgl",kernelFunc:RQ},MQ=Fn.nonMaxSuppressionV5Impl;function FQ(e){I.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=n,d=a.readSync(r.dataId),c=a.readSync(s.dataId),p=i,h=o,m=l,f=u,{selectedIndices:g,selectedScores:y}=MQ(d,c,p,h,m,f);return[a.makeTensorInfo([g.length],"int32",new Int32Array(g)),a.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var $Q={kernelName:Fo,backendName:"webgl",kernelFunc:FQ},DQ=class{constructor(e,t,a,n){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int index = round(getIndices(coords.x)); setOutput(mix(float(${n}), float(${a}), float(index == coords.y))); } - `}},BJ=e=>{let{inputs:t,backend:a,attrs:n}=e,{indices:r}=t,{dtype:s,depth:i,onValue:o,offValue:l}=n,u=v.sizeFromShape(r.shape),p=new WJ(u,i,o,l),c=pe({inputs:{x:r},backend:a,attrs:{shape:[u]}}),d=a.runWebGLProgram(p,[c],s);a.disposeIntermediateTensorInfo(c);let h=[...r.shape,i],m=pe({inputs:{x:d},backend:a,attrs:{shape:h}});return a.disposeIntermediateTensorInfo(d),m},VJ={kernelName:Ao,backendName:"webgl",kernelFunc:BJ};function Ih(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="complex64"){let r=Zp({inputs:{input:n},backend:a}),s=Ih({inputs:{x:r},backend:a}),i=i0({inputs:{input:n},backend:a}),o=Ih({inputs:{x:i},backend:a}),l=hs({inputs:{real:s,imag:o},backend:a});return a.disposeIntermediateTensorInfo(r),a.disposeIntermediateTensorInfo(s),a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}else return Jp({attrs:{shape:n.shape,dtype:n.dtype,value:n.dtype==="string"?"":0},backend:a})}var UJ={kernelName:Lu,backendName:"webgl",kernelFunc:Ih};function W8(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(n.dtype==="complex64"){let r=Zp({inputs:{input:n},backend:a}),s=W8({inputs:{x:r},backend:a}),i=i0({inputs:{input:n},backend:a}),o=Ih({inputs:{x:i},backend:a}),l=hs({inputs:{real:s,imag:o},backend:a});return a.disposeIntermediateTensorInfo(r),a.disposeIntermediateTensorInfo(s),a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}else return Jp({attrs:{shape:n.shape,dtype:n.dtype,value:1},backend:a})}var GJ={kernelName:Iu,backendName:"webgl",kernelFunc:W8};function HJ(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n;if(t.length===1)return W1({inputs:{input:t[0]},backend:a,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(p=>{v.assertShapesMatch(s,p.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===p.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(p=>{let c=W1({inputs:{input:p},backend:a,attrs:{dim:r}});return o.push(c),c}),u=S8({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(p=>a.disposeIntermediateTensorInfo(p)),u}var jJ={kernelName:Su,backendName:"webgl",kernelFunc:HJ},qJ=class{constructor(e,t,a){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((l,u)=>l[0]+e[u]+l[1]);let n=e.length,r=mt(n),s=t.map(l=>l[0]).join(","),i=t.map((l,u)=>l[0]+e[u]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n);if(n===1){this.userCode=` + `}},PQ=e=>{let{inputs:t,backend:a,attrs:n}=e,{indices:r}=t,{dtype:s,depth:i,onValue:o,offValue:l}=n,u=v.sizeFromShape(r.shape),d=new DQ(u,i,o,l),c=pe({inputs:{x:r},backend:a,attrs:{shape:[u]}}),p=a.runWebGLProgram(d,[c],s);a.disposeIntermediateTensorInfo(c);let h=[...r.shape,i],m=pe({inputs:{x:p},backend:a,attrs:{shape:h}});return a.disposeIntermediateTensorInfo(p),m},_Q={kernelName:$o,backendName:"webgl",kernelFunc:PQ};function Mh(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="complex64"){let r=sc({inputs:{input:n},backend:a}),s=Mh({inputs:{x:r},backend:a}),i=h0({inputs:{input:n},backend:a}),o=Mh({inputs:{x:i},backend:a}),l=zs({inputs:{real:s,imag:o},backend:a});return a.disposeIntermediateTensorInfo(r),a.disposeIntermediateTensorInfo(s),a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}else return ic({attrs:{shape:n.shape,dtype:n.dtype,value:n.dtype==="string"?"":0},backend:a})}var OQ={kernelName:qu,backendName:"webgl",kernelFunc:Mh};function i8(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(n.dtype==="complex64"){let r=sc({inputs:{input:n},backend:a}),s=i8({inputs:{x:r},backend:a}),i=h0({inputs:{input:n},backend:a}),o=Mh({inputs:{x:i},backend:a}),l=zs({inputs:{real:s,imag:o},backend:a});return a.disposeIntermediateTensorInfo(r),a.disposeIntermediateTensorInfo(s),a.disposeIntermediateTensorInfo(i),a.disposeIntermediateTensorInfo(o),l}else return ic({attrs:{shape:n.shape,dtype:n.dtype,value:1},backend:a})}var zQ={kernelName:Mu,backendName:"webgl",kernelFunc:i8};function LQ(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n;if(t.length===1)return q1({inputs:{input:t[0]},backend:a,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(d=>{v.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(d=>{let c=q1({inputs:{input:d},backend:a,attrs:{dim:r}});return o.push(c),c}),u=Hw({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(d=>a.disposeIntermediateTensorInfo(d)),u}var WQ={kernelName:Fu,backendName:"webgl",kernelFunc:LQ},BQ=class{constructor(e,t,a){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((l,u)=>l[0]+e[u]+l[1]);let n=e.length,r=ft(n),s=t.map(l=>l[0]).join(","),i=t.map((l,u)=>l[0]+e[u]).join(","),o=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n);if(n===1){this.userCode=` int start = ${s}; int end = ${i}; @@ -4060,19 +4060,19 @@ return a / b;`,vJ=` setOutput(getX(${o})); } } - `}},XJ=class{constructor(e,t,a){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let n=e.length,r=mt(n),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=ka("rc",n),l=ka("source",n),u=`${o[n-1]} < ${this.outputShape[n-1]}`,p=n===1?"source":`vec2(${l.slice(-2).join()})`,c=[`${r} rc = outputLoc;`,`${o[n-1]} += 1; + `}},VQ=class{constructor(e,t,a){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((m,f)=>m[0]+e[f]+m[1]);let n=e.length,r=ft(n),s=t.map(m=>m[0]).join(","),i=t.map((m,f)=>m[0]+e[f]).join(","),o=ka("rc",n),l=ka("source",n),u=`${o[n-1]} < ${this.outputShape[n-1]}`,d=n===1?"source":`vec2(${l.slice(-2).join()})`,c=[`${r} rc = outputLoc;`,`${o[n-1]} += 1; if(${u}) { `,n===1?"":`} rc = outputLoc; ${o[n-2]} += 1; if(${o[n-2]} < ${this.outputShape[n-2]}) {`,n===1?"":` ${o[n-1]} += 1; - if(${u}) {`],d=n===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="";for(let m=0,f=n===1?2:4;m= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",h="";for(let m=0,f=n===1?2:4;m{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{paddings:s,constantValue:i}=n;if(v.sizeFromShape(r.shape)===0){let u=s.map((p,c)=>p[0]+r.shape[c]+p[1]);return Jp({backend:a,attrs:{shape:u,value:i,dtype:r.dtype}})}let o=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new XJ(r.shape,s,i):new qJ(r.shape,s,i),l=[[i]];return a.runWebGLProgram(o,[r],r.dtype,l)},KJ={kernelName:bo,backendName:"webgl",kernelFunc:B8},YJ=` + `}},o8=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{paddings:s,constantValue:i}=n;if(v.sizeFromShape(r.shape)===0){let u=s.map((d,c)=>d[0]+r.shape[c]+d[1]);return ic({backend:a,attrs:{shape:u,value:i,dtype:r.dtype}})}let o=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new VQ(r.shape,s,i):new BQ(r.shape,s,i),l=[[i]];return a.runWebGLProgram(o,[r],r.dtype,l)},UQ={kernelName:Do,backendName:"webgl",kernelFunc:o8},GQ=` if(a < 0.0 && floor(b) < b){ return NAN; } @@ -4093,7 +4093,7 @@ return a / b;`,vJ=` } return (round(mod(b, 2.0)) != 1) ? pow(abs(a), b) : sign(a) * pow(abs(a), b); -`,ZJ=` +`,HQ=` // 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); @@ -4109,11 +4109,11 @@ return a / b;`,vJ=` bvec4 isNaN1 = lessThan(a, vec4(0.0)); bvec4 isNaN2 = lessThan(floor(b), b); bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w); - `+nl+` + `+cl+` return result; -`,JJ=ha({opSnippet:YJ,packedOpSnippet:ZJ}),QJ={kernelName:vo,backendName:"webgl",kernelFunc:JJ};function eQ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=r.shape.length,l=[],u=v.parseAxisParam(s,r.shape),p=u,c=C.getAxesPermutation(p,o),d=r;c!=null&&(d=Ca({inputs:{x:r},backend:a,attrs:{perm:c}}),p=C.getInnerMostAxes(p.length,o),l.push(d)),C.assertAxesAreInnerMostDims("prod",p,o);let h;if(a.shouldExecuteOnCPU([d])){let m=a.texData.get(d.dataId).values,{outVals:f,outShape:g,outDtype:y}=YH(d.shape,d.dtype,m,p);h=a.makeTensorInfo(g,y,f)}else{let[m,f]=C.computeOutAndReduceShapes(d.shape,p),g=v.sizeFromShape(f),y=pe({inputs:{x:d},backend:a,attrs:{shape:[-1,g]}}),x=Mp(r.dtype),A=rl(y,x,"prod",a);h=pe({inputs:{x:A},backend:a,attrs:{shape:m}}),l.push(y),l.push(A)}if(i){l.push(h);let m=C.expandShapeToKeepDim(h.shape,u);h=pe({inputs:{x:h},backend:a,attrs:{shape:m}})}return l.forEach(m=>a.disposeIntermediateTensorInfo(m)),h}var tQ={kernelName:ko,backendName:"webgl",kernelFunc:eQ};function aQ(e){let{inputs:t,backend:a,attrs:n}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:i}=t,{outputRaggedRank:o}=n,l=r.map(y=>a.readSync(y.dataId)),u=r.map(y=>y.shape),p=a.readSync(s.dataId),c=a.readSync(i.dataId),[d,h,m]=ZH(l,u,p,s.shape,s.dtype,c,i.shape,o),f=d.map(y=>a.makeTensorInfo([y.length],"int32",y)),g=a.makeTensorInfo(m,s.dtype,h);return f.concat([g])}var nQ={kernelName:Mh,backendName:"webgl",kernelFunc:aQ};function rQ(e){let{inputs:t,backend:a}=e,{starts:n,limits:r,deltas:s}=t,i=a.readSync(n.dataId),o=a.readSync(r.dataId),l=a.readSync(s.dataId),[u,p]=JH(i,n.shape,n.dtype,o,r.shape,l,s.shape),c=a.makeTensorInfo([u.length],"int32",u),d=a.makeTensorInfo([p.length],n.dtype,p);return[c,d]}var sQ={kernelName:Ph,backendName:"webgl",kernelFunc:rQ};function iQ(e){let{inputs:t,backend:a,attrs:n}=e,{shape:r,values:s,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=n,u=a.readSync(r.dataId),p=a.readSync(s.dataId),c=a.readSync(i.dataId),d=o.map(g=>a.readSync(g.dataId)),h=o.map(g=>g.shape),[m,f]=QH(u,r.shape,p,s.shape,s.dtype,c,i.shape,d,h,l);return a.makeTensorInfo(m,s.dtype,f)}var oQ={kernelName:_h,backendName:"webgl",kernelFunc:iQ},V8=e=>{let{backend:t,attrs:a}=e,{start:n,stop:r,step:s,dtype:i}=a,o=ej(n,r,s,i);return t.makeTensorInfo([o.length],i,o)},lQ={kernelName:Cu,backendName:"webgl",kernelFunc:V8},uQ="return 1.0 / x;",dQ=tt({opSnippet:uQ}),pQ={kernelName:Io,backendName:"webgl",kernelFunc:dQ},cQ=En+` +`,jQ=ha({opSnippet:GQ,packedOpSnippet:HQ}),qQ={kernelName:Po,backendName:"webgl",kernelFunc:jQ};function XQ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n,o=r.shape.length,l=[],u=v.parseAxisParam(s,r.shape),d=u,c=I.getAxesPermutation(d,o),p=r;c!=null&&(p=Ta({inputs:{x:r},backend:a,attrs:{perm:c}}),d=I.getInnerMostAxes(d.length,o),l.push(p)),I.assertAxesAreInnerMostDims("prod",d,o);let h;if(a.shouldExecuteOnCPU([p])){let m=a.texData.get(p.dataId).values,{outVals:f,outShape:g,outDtype:y}=Gj(p.shape,p.dtype,m,d);h=a.makeTensorInfo(g,y,f)}else{let[m,f]=I.computeOutAndReduceShapes(p.shape,d),g=v.sizeFromShape(f),y=pe({inputs:{x:p},backend:a,attrs:{shape:[-1,g]}}),x=Lp(r.dtype),A=hl(y,x,"prod",a);h=pe({inputs:{x:A},backend:a,attrs:{shape:m}}),l.push(y),l.push(A)}if(i){l.push(h);let m=I.expandShapeToKeepDim(h.shape,u);h=pe({inputs:{x:h},backend:a,attrs:{shape:m}})}return l.forEach(m=>a.disposeIntermediateTensorInfo(m)),h}var KQ={kernelName:Oo,backendName:"webgl",kernelFunc:XQ};function YQ(e){let{inputs:t,backend:a,attrs:n}=e,{paramsNestedSplits:r,paramsDenseValues:s,indices:i}=t,{outputRaggedRank:o}=n,l=r.map(y=>a.readSync(y.dataId)),u=r.map(y=>y.shape),d=a.readSync(s.dataId),c=a.readSync(i.dataId),[p,h,m]=Hj(l,u,d,s.shape,s.dtype,c,i.shape,o),f=p.map(y=>a.makeTensorInfo([y.length],"int32",y)),g=a.makeTensorInfo(m,s.dtype,h);return f.concat([g])}var ZQ={kernelName:Lh,backendName:"webgl",kernelFunc:YQ};function JQ(e){let{inputs:t,backend:a}=e,{starts:n,limits:r,deltas:s}=t,i=a.readSync(n.dataId),o=a.readSync(r.dataId),l=a.readSync(s.dataId),[u,d]=jj(i,n.shape,n.dtype,o,r.shape,l,s.shape),c=a.makeTensorInfo([u.length],"int32",u),p=a.makeTensorInfo([d.length],n.dtype,d);return[c,p]}var QQ={kernelName:Wh,backendName:"webgl",kernelFunc:JQ};function eee(e){let{inputs:t,backend:a,attrs:n}=e,{shape:r,values:s,defaultValue:i,rowPartitionTensors:o}=t,{rowPartitionTypes:l}=n,u=a.readSync(r.dataId),d=a.readSync(s.dataId),c=a.readSync(i.dataId),p=o.map(g=>a.readSync(g.dataId)),h=o.map(g=>g.shape),[m,f]=qj(u,r.shape,d,s.shape,s.dtype,c,i.shape,p,h,l);return a.makeTensorInfo(m,s.dtype,f)}var tee={kernelName:Bh,backendName:"webgl",kernelFunc:eee},l8=e=>{let{backend:t,attrs:a}=e,{start:n,stop:r,step:s,dtype:i}=a,o=Xj(n,r,s,i);return t.makeTensorInfo([o.length],i,o)},aee={kernelName:$u,backendName:"webgl",kernelFunc:l8},nee="return 1.0 / x;",ree=tt({opSnippet:nee}),see={kernelName:zo,backendName:"webgl",kernelFunc:ree},iee=$n+` return (x < 0.0) ? 0.0 : x; -`,hQ=` +`,oee=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -4123,9 +4123,9 @@ return a / b;`,vJ=` result.a = isNaN.a ? x.a : result.a; return result; -`,mQ=tt({opSnippet:cQ,packedOpSnippet:hQ}),fQ={kernelName:So,backendName:"webgl",kernelFunc:mQ},gQ=En+` +`,lee=tt({opSnippet:iee,packedOpSnippet:oee}),uee={kernelName:Lo,backendName:"webgl",kernelFunc:lee},dee=$n+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,yQ=` +`,pee=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -4135,10 +4135,10 @@ return a / b;`,vJ=` result.a = isNaN.a ? x.a : result.a; return result; -`,xQ=tt({opSnippet:gQ,packedOpSnippet:yQ}),AQ={kernelName:No,backendName:"webgl",kernelFunc:xQ},bQ=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],p=[n&&t>1?t-1:t,n&&a>1?a-1:a],c;r?c="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":c="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` +`,cee=tt({opSnippet:dee,packedOpSnippet:pee}),hee={kernelName:Vo,backendName:"webgl",kernelFunc:cee},mee=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],d=[n&&t>1?t-1:t,n&&a>1?a-1:a],c;r?c="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":c="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${u[0]/p[0]}, - ${u[1]/p[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -4168,11 +4168,11 @@ return a / b;`,vJ=` setOutput(newValue); } - `}},vQ=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],p=[n&&t>1?t-1:t,n&&a>1?a-1:a],c;r?c="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":c="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}},fee=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],d=[n&&t>1?t-1:t,n&&a>1?a-1:a],c;r?c="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":c="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${u[0]/p[0]}, - ${u[1]/p[1]}, - ${u[1]/p[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}, + ${u[1]/d[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${o}.0, ${o}.0); @@ -4245,7 +4245,7 @@ return a / b;`,vJ=` setOutput(newValue); } - `}};function wQ(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,p=B().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new vQ(r.shape,l,u,s,i):new bQ(r.shape,l,u,s,i);return a.runWebGLProgram(p,[r],"float32")}var kQ={kernelName:To,backendName:"webgl",kernelFunc:wQ},IQ=class{constructor(e,t,a){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,r]=t,[,s,i]=e,o=[a&&s>1?n-1:n,a&&i>1?r-1:r],l=[a&&s>1?s-1:s,a&&i>1?i-1:i],u=o[0]/l[0],p=o[1]/l[1],c=1/u,d=1/p,h=Math.ceil(c)*2+2,m=Math.ceil(d)*2+2;this.userCode=` + `}};function gee(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,d=B().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new fee(r.shape,l,u,s,i):new mee(r.shape,l,u,s,i);return a.runWebGLProgram(d,[r],"float32")}var yee={kernelName:Bo,backendName:"webgl",kernelFunc:gee},xee=class{constructor(e,t,a){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,r]=t,[,s,i]=e,o=[a&&s>1?n-1:n,a&&i>1?r-1:r],l=[a&&s>1?s-1:s,a&&i>1?i-1:i],u=o[0]/l[0],d=o[1]/l[1],c=1/u,p=1/d,h=Math.ceil(c)*2+2,m=Math.ceil(p)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -4256,10 +4256,10 @@ return a / b;`,vJ=` float accumulator = 0.0; const float heightScale = float(${u}); - const float widthScale = float(${p}); + const float widthScale = float(${d}); const float invHeightScale = float(${c}); - const float invWidthScale = float(${d}); + const float invWidthScale = float(${p}); const int winHeight = int(${h}); const int winWidth = int(${m}); @@ -4326,10 +4326,10 @@ return a / b;`,vJ=` setOutput(accumulator); } - `}};function SQ(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=new IQ(s.shape,r.shape,i);return a.runWebGLProgram(o,[s],s.dtype)}var CQ={kernelName:Ru,backendName:"webgl",kernelFunc:SQ},TQ=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],p=[n&&t>1?t-1:t,n&&a>1?a-1:a],c=n?"0.5":"0.0",d;r?d="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":d="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}};function Aee(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=new xee(s.shape,r.shape,i);return a.runWebGLProgram(o,[s],s.dtype)}var bee={kernelName:_u,backendName:"webgl",kernelFunc:Aee},vee=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],d=[n&&t>1?t-1:t,n&&a>1?a-1:a],c=n?"0.5":"0.0",p;r?p="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":p="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${u[0]/p[0]}, - ${u[1]/p[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${o}.0); void main() { @@ -4339,7 +4339,7 @@ return a / b;`,vJ=` ivec2 yRC = coords.yz; // Fractional source index. - vec2 sourceFracIndexRC = ${d}; + vec2 sourceFracIndexRC = ${p}; // Compute the coordinators of nearest neighbor point. ivec2 sourceNearestRC = ivec2( @@ -4348,11 +4348,11 @@ return a / b;`,vJ=` setOutput(newValue); } - `}},NQ=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],p=[n&&t>1?t-1:t,n&&a>1?a-1:a],c=n?"0.5":"0.0",d;r?d="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":d="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}},wee=class{constructor(e,t,a,n,r){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[s,i,o,l]=e;this.outputShape=[s,t,a,l];let u=[n&&t>1?i-1:i,n&&a>1?o-1:o],d=[n&&t>1?t-1:t,n&&a>1?a-1:a],c=n?"0.5":"0.0",p;r?p="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":p="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${u[0]/p[0]}, - ${u[1]/p[1]}, - ${u[1]/p[1]}); + ${u[0]/d[0]}, + ${u[1]/d[1]}, + ${u[1]/d[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${o}.0, ${o}.0); @@ -4368,7 +4368,7 @@ return a / b;`,vJ=` ivec3 yRC = coords.yzz + ivec3(0, 0, 1); // Fractional source index. - vec3 sourceFracIndexRC = ${d}; + vec3 sourceFracIndexRC = ${p}; // Compute the coordinators of nearest neighbor point. ivec3 sourceNearestRC = ivec3( @@ -4389,7 +4389,7 @@ return a / b;`,vJ=` setOutput(newValue); } - `}};function RQ(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,p=B().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new NQ(r.shape,l,u,s,i):new TQ(r.shape,l,u,s,i);return a.runWebGLProgram(p,[r],r.dtype)}var EQ={kernelName:Co,backendName:"webgl",kernelFunc:RQ},MQ=class{constructor(e,t,a){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,r]=t,[,s,i]=e,o=[a&&s>1?n-1:n,a&&i>1?r-1:r],l=[a&&s>1?s-1:s,a&&i>1?i-1:i],u=o[0]/l[0],p=o[1]/l[1],c=1/u,d=1/p,h=Math.ceil(c)*2+2,m=Math.ceil(d)*2+2;this.userCode=` + `}};function kee(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,d=B().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new wee(r.shape,l,u,s,i):new vee(r.shape,l,u,s,i);return a.runWebGLProgram(d,[r],r.dtype)}var Iee={kernelName:Wo,backendName:"webgl",kernelFunc:kee},See=class{constructor(e,t,a){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,r]=t,[,s,i]=e,o=[a&&s>1?n-1:n,a&&i>1?r-1:r],l=[a&&s>1?s-1:s,a&&i>1?i-1:i],u=o[0]/l[0],d=o[1]/l[1],c=1/u,p=1/d,h=Math.ceil(c)*2+2,m=Math.ceil(p)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -4400,10 +4400,10 @@ return a / b;`,vJ=` float accumulator = 0.0; const float heightScale = float(${u}); - const float widthScale = float(${p}); + const float widthScale = float(${d}); const float invHeightScale = float(${c}); - const float invWidthScale = float(${d}); + const float invWidthScale = float(${p}); const int winHeight = int(${h}); const int winWidth = int(${m}); @@ -4459,17 +4459,17 @@ return a / b;`,vJ=` setOutput(accumulator); } - `}};function PQ(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=new MQ(s.shape,r.shape,i);return a.runWebGLProgram(o,[s],s.dtype)}var _Q={kernelName:Nu,backendName:"webgl",kernelFunc:PQ},$Q=class{constructor(e,t){this.variableNames=["x"];let a=e.length;if(a>4)throw new Error(`WebGL backend: Reverse of rank-${a} tensor is not yet supported`);if(this.outputShape=e,a===1){this.userCode=` + `}};function Tee(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=new See(s.shape,r.shape,i);return a.runWebGLProgram(o,[s],s.dtype)}var Cee={kernelName:Pu,backendName:"webgl",kernelFunc:Tee},Nee=class{constructor(e,t){this.variableNames=["x"];let a=e.length;if(a>4)throw new Error(`WebGL backend: Reverse of rank-${a} tensor is not yet supported`);if(this.outputShape=e,a===1){this.userCode=` void main() { int coord = getOutputCoords(); setOutput(getX(${e[0]} - coord - 1)); } - `;return}let n=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,r=e.map((i,o)=>n(o)).join(","),s=mt(a);this.userCode=` + `;return}let n=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,r=e.map((i,o)=>n(o)).join(","),s=ft(a);this.userCode=` void main() { ${s} coords = getOutputCoords(); setOutput(getX(${r})); } - `}},FQ=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let a=e.length;if(a>4)throw new Error(`WebGL backend: Reverse of rank-${a} tensor is not yet supported`);this.outputShape=e;let n=ka("rc",a),r=`${n[a-1]} + 1 < ${this.outputShape[a-1]}`,s=`${n[a-2]} + 1 < ${this.outputShape[a-2]}`,i=mt(a);a===1?this.userCode=` + `}},Ree=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let a=e.length;if(a>4)throw new Error(`WebGL backend: Reverse of rank-${a} tensor is not yet supported`);this.outputShape=e;let n=ka("rc",a),r=`${n[a-1]} + 1 < ${this.outputShape[a-1]}`,s=`${n[a-2]} + 1 < ${this.outputShape[a-2]}`,i=ft(a);a===1?this.userCode=` void main(){ int rc = getOutputCoords(); vec4 result = vec4(0.); @@ -4492,12 +4492,12 @@ return a / b;`,vJ=` if(${s}) { result.b = ${u(n.slice())}; if(${r}) { - result.a = ${p(n.slice())}; + result.a = ${d(n.slice())}; } } setOutput(result); } - `;function o(h){return c(h)}function l(h){return h[a-1]="("+h[a-1]+" + 1)",c(h)}function u(h){return h[a-2]="("+h[a-2]+" + 1)",c(h)}function p(h){return h[a-1]="("+h[a-1]+" + 1)",h[a-2]="("+h[a-2]+" + 1)",c(h)}function c(h){let m=e.map((y,x)=>d(x,h)),f=m.join(","),g=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${g}))`}function d(h,m){return t.indexOf(h)!==-1&&e[h]!==1?`${e[h]} - ${m[h]} - 1`:`${m[h]}`}}};function DQ(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n,i=r.shape.length,o=v.parseAxisParam(s,r.shape);if(i===0)return Qa({inputs:{x:r},backend:a});let l=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new FQ(r.shape,o):new $Q(r.shape,o);return a.runWebGLProgram(l,[r],r.dtype)}var OQ={kernelName:Ro,backendName:"webgl",kernelFunc:DQ},zQ=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];let a=e[1],n=e[2];this.outputShape=e;let r="";typeof t=="number"?r=`float outputValue = ${t.toFixed(2)};`:r=` + `;function o(h){return c(h)}function l(h){return h[a-1]="("+h[a-1]+" + 1)",c(h)}function u(h){return h[a-2]="("+h[a-2]+" + 1)",c(h)}function d(h){return h[a-1]="("+h[a-1]+" + 1)",h[a-2]="("+h[a-2]+" + 1)",c(h)}function c(h){let m=e.map((y,x)=>p(x,h)),f=m.join(","),g=m.slice(-2).join(",");return`getChannel(getX(${f}), vec2(${g}))`}function p(h,m){return t.indexOf(h)!==-1&&e[h]!==1?`${e[h]} - ${m[h]} - 1`:`${m[h]}`}}};function Eee(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n,i=r.shape.length,o=v.parseAxisParam(s,r.shape);if(i===0)return tn({inputs:{x:r},backend:a});let l=B().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Ree(r.shape,o):new Nee(r.shape,o);return a.runWebGLProgram(l,[r],r.dtype)}var Mee={kernelName:Uo,backendName:"webgl",kernelFunc:Eee},Fee=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];let a=e[1],n=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=` void main() { @@ -4516,7 +4516,7 @@ return a / b;`,vJ=` } setOutput(outputValue); } - `}},LQ={kernelName:Jo,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{image:n}=e,{radians:r,fillValue:s,center:i}=t,o=a,l=new zQ(n.shape,s),[u,p]=C.getImageCenter(i,n.shape[1],n.shape[2]),c=[[u,p,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[n],n.dtype,c)}},WQ=` + `}},$ee={kernelName:ol,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{image:n}=e,{radians:r,fillValue:s,center:i}=t,o=a,l=new Fee(n.shape,s),[u,d]=I.getImageCenter(i,n.shape[1],n.shape[2]),c=[[u,d,Math.sin(r),Math.cos(r)]];return o.runWebGLProgram(l,[n],n.dtype,c)}},Dee=` // OpenGL ES does not support round function. // The algorithm is based on banker's rounding. float base = floor(x); @@ -4531,7 +4531,7 @@ return a / b;`,vJ=` return base + 1.0; } } -`,BQ=tt({opSnippet:WQ}),VQ={kernelName:Eo,backendName:"webgl",kernelFunc:BQ},UQ="return inversesqrt(x);",GQ=tt({opSnippet:UQ,cpuKernelImpl:tj}),HQ={kernelName:Mo,backendName:"webgl",kernelFunc:GQ},W3=class{constructor(e,t,a,n,r,s,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let l=mt(r.length),u=mt(s.length),p="";a===1?p="i":a===2&&(p="i, j");let c=`getIndices(${p})`,d="";n===1?d="i":n===2&&(d="i, coords[1]");let h=`getUpdates(${d})`,m="";o&&(m="coords[0], coords[1]");let f=`getDefaultValue(${m})`,g=t>1?"strides[j]":"strides";this.userCode=` +`,Pee=tt({opSnippet:Dee}),_ee={kernelName:Go,backendName:"webgl",kernelFunc:Pee},Oee="return inversesqrt(x);",zee=tt({opSnippet:Oee,cpuKernelImpl:Kj}),Lee={kernelName:Ns,backendName:"webgl",kernelFunc:zee},Y3=class{constructor(e,t,a,n,r,s,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=s;let l=ft(r.length),u=ft(s.length),d="";a===1?d="i":a===2&&(d="i, j");let c=`getIndices(${d})`,p="";n===1?p="i":n===2&&(p="i, coords[1]");let h=`getUpdates(${p})`,m="";o&&(m="coords[0], coords[1]");let f=`getDefaultValue(${m})`,g=t>1?"strides[j]":"strides";this.userCode=` ${l} strides = ${l}(${r}); void main() { @@ -4551,7 +4551,7 @@ return a / b;`,vJ=` } setOutput(mix(${f}, sum, float(found))); } - `}},jQ=class{constructor(e,t,a,n,r,s,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=s;let l=mt(r.length),u=mt(s.length),p="";a===1?p="i":a===2&&(p="i, j");let c=`getIndices(${p})`,d="";n===1?d="i":n===2&&(d="i, coords[1]");let h=`getUpdates(${d})`,m="";o&&(m="coords[0], coords[1]");let f=`getDefaultValue(${m})`,g=t>1?"strides[j]":"strides",y=t>1?"strides[j + 1]":"strides";this.userCode=` + `}},Wee=class{constructor(e,t,a,n,r,s,i=!0,o=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=s;let l=ft(r.length),u=ft(s.length),d="";a===1?d="i":a===2&&(d="i, j");let c=`getIndices(${d})`,p="";n===1?p="i":n===2&&(p="i, coords[1]");let h=`getUpdates(${p})`,m="";o&&(m="coords[0], coords[1]");let f=`getDefaultValue(${m})`,g=t>1?"strides[j]":"strides",y=t>1?"strides[j + 1]":"strides";this.userCode=` ${l} strides = ${l}(${r}); void main() { @@ -4588,7 +4588,7 @@ return a / b;`,vJ=` } setOutput(mix(${f}, sum, found)); } - `}};function qQ(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r,updates:s}=t,{shape:i}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:p,outputSize:c}=C.calculateShapes(s,r,i),d=[c/u,u];if(c===0)return a.makeTensorInfo(i,r.dtype);let h=pe({inputs:{x:r},backend:a,attrs:{shape:[l,o]}}),m=pe({inputs:{x:s},backend:a,attrs:{shape:[l,u]}}),f=a.makeTensorInfo([],"float32",new Float32Array([0])),g;B().getBool("WEBGL_PACK")?g=new jQ(l,o,h.shape.length,m.shape.length,p,d):g=new W3(l,o,h.shape.length,m.shape.length,p,d);let y=a.runWebGLProgram(g,[m,h,f],m.dtype),x=pe({inputs:{x:y},backend:a,attrs:{shape:i}});return a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(y),a.disposeIntermediateTensorInfo(f),x}var XQ={kernelName:Po,backendName:"webgl",kernelFunc:qQ},KQ=class{constructor(e,t,a,n){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,a];let r="while (left < right) {",s=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,i=B().getNumber("WEBGL_VERSION")===2?r:s,o=n==="left"?"<":"<=";this.userCode=` + `}};function Bee(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r,updates:s}=t,{shape:i}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:d,outputSize:c}=I.calculateShapes(s,r,i),p=[c/u,u];if(c===0)return a.makeTensorInfo(i,r.dtype);let h=pe({inputs:{x:r},backend:a,attrs:{shape:[l,o]}}),m=pe({inputs:{x:s},backend:a,attrs:{shape:[l,u]}}),f=a.makeTensorInfo([],"float32",new Float32Array([0])),g;B().getBool("WEBGL_PACK")?g=new Wee(l,o,h.shape.length,m.shape.length,d,p):g=new Y3(l,o,h.shape.length,m.shape.length,d,p);let y=a.runWebGLProgram(g,[m,h,f],m.dtype),x=pe({inputs:{x:y},backend:a,attrs:{shape:i}});return a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(y),a.disposeIntermediateTensorInfo(f),x}var Vee={kernelName:Ho,backendName:"webgl",kernelFunc:Bee},Uee=class{constructor(e,t,a,n){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,a];let r="while (left < right) {",s=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,i=B().getNumber("WEBGL_VERSION")===2?r:s,o=n==="left"?"<":"<=";this.userCode=` int findBound(int batch, float value) { int left = 0; int right = numInputs; @@ -4613,7 +4613,7 @@ return a / b;`,vJ=` setOutput(float(findBound(batch, value))); } - `}};function YQ(e){let{inputs:t,backend:a,attrs:n}=e,{sortedSequence:r,values:s}=t,{side:i}=n,o=new KQ(r.shape[0],r.shape[1],s.shape[1],i),l=[[r.shape[1]]];return a.runWebGLProgram(o,[r,s],"int32",l)}var ZQ={kernelName:$o,backendName:"webgl",kernelFunc:YQ},JQ=class{constructor(e,t,a){this.variableNames=["c","a","b"],this.outputShape=t;let n,r;if(a>4)throw Error(`Where for rank ${a} is not yet supported`);if(a===1)r="resRC",n="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],l=[];for(let u=0;u4)throw Error(`Where for rank ${a} is not yet supported`);if(a===1)r="resRC",n="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[],l=[];for(let u=0;u= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); -`,aee=tt({opSnippet:tee}),nee={kernelName:Fo,backendName:"webgl",kernelFunc:aee},ree=Yu+` +`,Yee=tt({opSnippet:Kee}),Zee={kernelName:Xo,backendName:"webgl",kernelFunc:Yee},Jee=rd+` return 1.0 / (1.0 + exp(-1.0 * x)); -`,see=` +`,Qee=` vec4 result = 1.0 / (1.0 + exp(-1.0 * x)); bvec4 isNaN = isnan(x); @@ -4641,20 +4641,20 @@ return a / b;`,vJ=` result.a = isNaN.a ? x.a : result.a; return result; -`,iee=tt({opSnippet:ree,packedOpSnippet:see,cpuKernelImpl:nj}),oee={kernelName:Lo,backendName:"webgl",kernelFunc:iee},lee=` +`,ete=tt({opSnippet:Jee,packedOpSnippet:Qee,cpuKernelImpl:Zj}),tte={kernelName:Rs,backendName:"webgl",kernelFunc:ete},ate=` if (isnan(x)) { return 0.0; } return sign(x); -`,uee=tt({opSnippet:lee}),dee={kernelName:zo,backendName:"webgl",kernelFunc:uee},pee=Yu+` +`,nte=tt({opSnippet:ate}),rte={kernelName:Zo,backendName:"webgl",kernelFunc:nte},ste=rd+` return sin(x); -`,cee=` +`,ite=` vec4 result = sin(x); bvec4 isNaN = isnan(x); - ${nl} + ${cl} return result; -`,hee=tt({opSnippet:pee,packedOpSnippet:cee}),mee={kernelName:Do,backendName:"webgl",kernelFunc:hee},fee=` +`,ote=tt({opSnippet:ste,packedOpSnippet:ite}),lte={kernelName:Ko,backendName:"webgl",kernelFunc:ote},ute=` float e2x = exp(x); return (e2x - 1.0 / e2x) / 2.0; -`,gee=tt({opSnippet:fee}),yee={kernelName:Oo,backendName:"webgl",kernelFunc:gee},xee=` +`,dte=tt({opSnippet:ute}),pte={kernelName:Yo,backendName:"webgl",kernelFunc:dte},cte=` float epsilon = 1.1920928955078125e-7; float threshold = log(epsilon) + 2.0; @@ -4674,17 +4674,17 @@ return a / b;`,vJ=` result = log(exp_x + 1.0); } return result; -`,Aee=tt({opSnippet:xee}),bee={kernelName:Wo,backendName:"webgl",kernelFunc:Aee},vee=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,paddings:i}=n;v.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,x)=>y*x),l=[[0,0]];l.push(...i);for(let y=1+s.length;ya.disposeIntermediateTensorInfo(y)),g},wee={kernelName:Pu,backendName:"webgl",kernelFunc:vee};function kee(e){let{inputs:t,backend:a}=e,{indices:n,values:r,denseShape:s,defaultValue:i}=t;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: +`,hte=tt({opSnippet:cte}),mte={kernelName:Jo,backendName:"webgl",kernelFunc:hte},fte=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,paddings:i}=n;v.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let o=s.reduce((y,x)=>y*x),l=[[0,0]];l.push(...i);for(let y=1+s.length;ya.disposeIntermediateTensorInfo(y)),g},gte={kernelName:Lu,backendName:"webgl",kernelFunc:fte};function yte(e){let{inputs:t,backend:a}=e,{indices:n,values:r,denseShape:s,defaultValue:i}=t;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: ${s.shape}`);if(n.shape.length!==2)throw new Error(`Indices must be a matrix, saw: ${n.shape}`);if(r.shape.length!==1)throw new Error(`Values must be a vector, saw: ${r.shape}`);if(i.shape.length!==0)throw new Error(`Default value must be a scalar, saw: - ${i.shape}`);let o=a.readSync(n.dataId),l=a.readSync(r.dataId),u=a.readSync(s.dataId),p=a.readSync(i.dataId)[0],[c,d,h,m,f]=sj(o,n.shape,n.dtype,l,r.dtype,u,p);return[a.makeTensorInfo(d,n.dtype,c),a.makeTensorInfo([d[0]],r.dtype,h),a.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(g=>Number(g)))),a.makeTensorInfo([f.length],n.dtype,new Int32Array(f))]}var Iee={kernelName:wp,backendName:"webgl",kernelFunc:kee};function See(e){let{inputs:t,backend:a}=e,{inputIndices:n,inputShape:r,newShape:s}=t;if(n.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${n.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(a.readSync(r.dataId)),o=a.readSync(n.dataId),l=Array.from(a.readSync(s.dataId)),[u,p,c]=ij(o,n.shape,n.dtype,i,l);return[a.makeTensorInfo(p,n.dtype,u),a.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var Cee={kernelName:$u,backendName:"webgl",kernelFunc:See};function Tee(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${i.shape}`);let o=a.readSync(n.dataId),l=a.readSync(r.dataId),u=a.readSync(s.dataId),d=a.readSync(i.dataId)[0],[c,p,h,m,f]=Qj(o,n.shape,n.dtype,l,r.dtype,u,d);return[a.makeTensorInfo(p,n.dtype,c),a.makeTensorInfo([p[0]],r.dtype,h),a.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(g=>Number(g)))),a.makeTensorInfo([f.length],n.dtype,new Int32Array(f))]}var xte={kernelName:Mp,backendName:"webgl",kernelFunc:yte};function Ate(e){let{inputs:t,backend:a}=e,{inputIndices:n,inputShape:r,newShape:s}=t;if(n.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${n.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(a.readSync(r.dataId)),o=a.readSync(n.dataId),l=Array.from(a.readSync(s.dataId)),[u,d,c]=eq(o,n.shape,n.dtype,i,l);return[a.makeTensorInfo(d,n.dtype,u),a.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var bte={kernelName:Bu,backendName:"webgl",kernelFunc:Ate};function vte(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let i=a.readSync(n.dataId),o=a.readSync(r.dataId),l=a.readSync(s.dataId),[u,p]=d8(i,n.shape,n.dtype,o,l,!0);return a.makeTensorInfo(p,n.dtype,u)}var Nee={kernelName:Fu,backendName:"webgl",kernelFunc:Tee};function Ree(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${s.shape}`);let i=a.readSync(n.dataId),o=a.readSync(r.dataId),l=a.readSync(s.dataId),[u,d]=Ew(i,n.shape,n.dtype,o,l,!0);return a.makeTensorInfo(d,n.dtype,u)}var wte={kernelName:Vu,backendName:"webgl",kernelFunc:vte};function kte(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;if(n.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(r.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${r.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let i=a.readSync(n.dataId),o=a.readSync(r.dataId),l=a.readSync(s.dataId),[u,p]=d8(i,n.shape,n.dtype,o,l);return a.makeTensorInfo(p,n.dtype,u)}var Eee={kernelName:Du,backendName:"webgl",kernelFunc:Ree};function Mee(e){let{inputs:t,backend:a,attrs:n}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=n,{sliceRank:l,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=C.calculateShapes(s,r,o),h=!1;if(s.dtype==="string"){let y=a.bufferSync(r),x=a.bufferSync(s),A=v.decodeString(a.readSync(i.dataId)[0]),b=aj(y,x,o,d,p,u,l,c,A,h);return a.makeTensorInfo(o,b.dtype,b.values)}let m=new W3(u,l,r.shape.length,s.shape.length,c,[d,1],h),f=a.runWebGLProgram(m,[s,r,i],s.dtype),g=pe({inputs:{x:f},backend:a,attrs:{shape:o}});return a.disposeIntermediateTensorInfo(f),g}var Pee={kernelName:Go,backendName:"webgl",kernelFunc:Mee};function _ee(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=n,o=v.parseAxisParam(i,r.shape)[0],l=C.prepareSplitSize(r,s,o),u=r.shape.length,p=new Array(u).fill(0),c=r.shape.slice();return l.map(d=>{let h=[...c];h[o]=d;let m=Zu({inputs:{x:r},backend:a,attrs:{begin:p,size:h}});return p[o]+=d,m})}var $ee={kernelName:_u,backendName:"webgl",kernelFunc:_ee},U5="return sqrt(x);",Fee=tt({opSnippet:U5,packedOpSnippet:U5,cpuKernelImpl:oj}),Dee={kernelName:Bo,backendName:"webgl",kernelFunc:Fee},Oee="return x * x;",zee=tt({opSnippet:Oee}),Lee={kernelName:kp,backendName:"webgl",kernelFunc:zee},G5="return (a - b) * (a - b);",Wee=ha({opSnippet:G5,packedOpSnippet:G5}),Bee={kernelName:Ho,backendName:"webgl",kernelFunc:Wee};function Vee(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t;if(r.dtype!=="string")throw new Error("Input must be of datatype string");let s=a.readSync(r.dataId),i=C.fromUint8ToStringArray(s),o=lj(i,"string",n);return a.makeTensorInfo(r.shape,"string",o)}var Uee={kernelName:Ip,backendName:"webgl",kernelFunc:Vee};function Gee({inputs:e,attrs:t,backend:a}){let{x:n}=e,r=En+` + ${s.shape}`);let i=a.readSync(n.dataId),o=a.readSync(r.dataId),l=a.readSync(s.dataId),[u,d]=Ew(i,n.shape,n.dtype,o,l);return a.makeTensorInfo(d,n.dtype,u)}var Ite={kernelName:Uu,backendName:"webgl",kernelFunc:kte};function Ste(e){let{inputs:t,backend:a,attrs:n}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=n,{sliceRank:l,numUpdates:u,sliceSize:d,strides:c,outputSize:p}=I.calculateShapes(s,r,o),h=!1;if(s.dtype==="string"){let y=a.bufferSync(r),x=a.bufferSync(s),A=v.decodeString(a.readSync(i.dataId)[0]),b=Yj(y,x,o,p,d,u,l,c,A,h);return a.makeTensorInfo(o,b.dtype,b.values)}let m=new Y3(u,l,r.shape.length,s.shape.length,c,[p,1],h),f=a.runWebGLProgram(m,[s,r,i],s.dtype),g=pe({inputs:{x:f},backend:a,attrs:{shape:o}});return a.disposeIntermediateTensorInfo(f),g}var Tte={kernelName:tl,backendName:"webgl",kernelFunc:Ste};function Cte(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=n,o=v.parseAxisParam(i,r.shape)[0],l=I.prepareSplitSize(r,s,o),u=r.shape.length,d=new Array(u).fill(0),c=r.shape.slice();return l.map(p=>{let h=[...c];h[o]=p;let m=sd({inputs:{x:r},backend:a,attrs:{begin:d,size:h}});return d[o]+=p,m})}var Nte={kernelName:Wu,backendName:"webgl",kernelFunc:Cte},nA="return sqrt(x);",Rte=tt({opSnippet:nA,packedOpSnippet:nA,cpuKernelImpl:tq}),Ete={kernelName:Es,backendName:"webgl",kernelFunc:Rte},Mte="return x * x;",Fte=tt({opSnippet:Mte}),$te={kernelName:Fp,backendName:"webgl",kernelFunc:Fte},rA="return (a - b) * (a - b);",Dte=ha({opSnippet:rA,packedOpSnippet:rA}),Pte={kernelName:Ms,backendName:"webgl",kernelFunc:Dte};function _te(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t;if(r.dtype!=="string")throw new Error("Input must be of datatype string");let s=a.readSync(r.dataId),i=I.fromUint8ToStringArray(s),o=aq(i,"string",n);return a.makeTensorInfo(r.shape,"string",o)}var Ote={kernelName:Gu,backendName:"webgl",kernelFunc:_te};function zte({inputs:e,attrs:t,backend:a}){let{x:n}=e,r=$n+` return x > 0.0 ? 1.0 : float(${t.alpha}); - `,s=new Kn(n.shape,r);return a.runWebGLProgram(s,[n],n.dtype)}var Hee={kernelName:us,backendName:"webgl",kernelFunc:Gee},jee=class{constructor(e,t,a){this.variableNames=["x"],this.outputShape=a;let n=a.length,r=mt(a.length),s=mt(a.length),i="";if(n===1)i="coords * strides + begin";else{let o=0;i=a.map((l,u)=>(o++,a.length===1?`coords * strides[${u}] + begin[${u}]`:`coords[${o-1}] * strides[${u}] + begin[${u}]`)).join(",")}this.userCode=` + `,s=new Qn(n.shape,r);return a.runWebGLProgram(s,[n],n.dtype)}var Lte={kernelName:Ds,backendName:"webgl",kernelFunc:zte},Wte=class{constructor(e,t,a){this.variableNames=["x"],this.outputShape=a;let n=a.length,r=ft(a.length),s=ft(a.length),i="";if(n===1)i="coords * strides + begin";else{let o=0;i=a.map((l,u)=>(o++,a.length===1?`coords * strides[${u}] + begin[${u}]`:`coords[${o-1}] * strides[${u}] + begin[${u}]`)).join(",")}this.userCode=` ${r} begin = ${r}(${e}); ${r} strides = ${r}(${t}); @@ -4692,15 +4692,15 @@ return a / b;`,vJ=` ${s} coords = getOutputCoords(); setOutput(getX(${i})); } - `}};function qee(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:p,newAxisMask:c,shrinkAxisMask:d}=n,{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=Nt.sliceInfo(r.shape,s,i,o,l,u,p,c,d),w;if(f)w=pe({inputs:{x:r},backend:a,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let T=Nt.computeOutShape(x,A,b),N=Zu({inputs:{x:r},backend:a,attrs:{begin:x,size:T}});w=pe({inputs:{x:N},backend:a,attrs:{shape:m}}),a.disposeIntermediateTensorInfo(N)}else if(a.shouldExecuteOnCPU([r])){let T=a.readSync(r.dataId),N=$e(r.shape,r.dtype,T),M=uj(h,N,b,x);w=a.makeTensorInfo(m,r.dtype,M.values)}else{let T=new jee(x,b,h);w=a.runWebGLProgram(T,[r],r.dtype)}let I=pe({inputs:{x:w},backend:a,attrs:{shape:m}});return a.disposeIntermediateTensorInfo(w),I}var Xee={kernelName:jo,backendName:"webgl",kernelFunc:qee};function Kee(e){let{inputs:t,backend:a,attrs:n}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=n,{data:p,dataSplits:c}=t,d=a.readSync(p.dataId),h=a.readSync(c.dataId),[m,f]=dj(d,h,r,s,i,o,l,u);return[a.makeTensorInfo([m.length],"string",m),a.makeTensorInfo(c.shape,"int32",f)]}var Yee={kernelName:Ou,backendName:"webgl",kernelFunc:Kee};function Zee(e){let{inputs:t,backend:a,attrs:n}=e,{skipEmpty:r}=n,{input:s,delimiter:i}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=a.readSync(s.dataId),l=a.readSync(i.dataId)[0],[u,p,c]=pj(o,l,r),d=p.length;return[a.makeTensorInfo([d,2],"int32",u),a.makeTensorInfo([d],"string",p),a.makeTensorInfo([2],"int32",new Int32Array(c))]}var Jee={kernelName:Sp,backendName:"webgl",kernelFunc:Zee};function Qee(e){let{inputs:t,backend:a,attrs:n}=e,{numBuckets:r}=n,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=a.readSync(s.dataId),o=cj(i,r);return a.makeTensorInfo(s.shape,"int32",o)}var ete={kernelName:Cp,backendName:"webgl",kernelFunc:Qee},tte="return tan(x);",ate=tt({opSnippet:tte}),nte={kernelName:Xo,backendName:"webgl",kernelFunc:ate},rte=` + `}};function Bte(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:d,newAxisMask:c,shrinkAxisMask:p}=n,{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=wt.sliceInfo(r.shape,s,i,o,l,u,d,c,p),w;if(f)w=pe({inputs:{x:r},backend:a,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let C=wt.computeOutShape(x,A,b),N=sd({inputs:{x:r},backend:a,attrs:{begin:x,size:C}});w=pe({inputs:{x:N},backend:a,attrs:{shape:m}}),a.disposeIntermediateTensorInfo(N)}else if(a.shouldExecuteOnCPU([r])){let C=a.readSync(r.dataId),N=Te(r.shape,r.dtype,C),M=nq(h,N,b,x);w=a.makeTensorInfo(m,r.dtype,M.values)}else{let C=new Wte(x,b,h);w=a.runWebGLProgram(C,[r],r.dtype)}let S=pe({inputs:{x:w},backend:a,attrs:{shape:m}});return a.disposeIntermediateTensorInfo(w),S}var Vte={kernelName:al,backendName:"webgl",kernelFunc:Bte};function Ute(e){let{inputs:t,backend:a,attrs:n}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=n,{data:d,dataSplits:c}=t,p=a.readSync(d.dataId),h=a.readSync(c.dataId),[m,f]=rq(p,h,r,s,i,o,l,u);return[a.makeTensorInfo([m.length],"string",m),a.makeTensorInfo(c.shape,"int32",f)]}var Gte={kernelName:Hu,backendName:"webgl",kernelFunc:Ute};function Hte(e){let{inputs:t,backend:a,attrs:n}=e,{skipEmpty:r}=n,{input:s,delimiter:i}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(i.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${i.shape}`);let o=a.readSync(s.dataId),l=a.readSync(i.dataId)[0],[u,d,c]=sq(o,l,r),p=d.length;return[a.makeTensorInfo([p,2],"int32",u),a.makeTensorInfo([p],"string",d),a.makeTensorInfo([2],"int32",new Int32Array(c))]}var jte={kernelName:$p,backendName:"webgl",kernelFunc:Hte};function qte(e){let{inputs:t,backend:a,attrs:n}=e,{numBuckets:r}=n,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(r<=0)throw new Error("Number of buckets must be at least 1");let i=a.readSync(s.dataId),o=iq(i,r);return a.makeTensorInfo(s.shape,"int32",o)}var Xte={kernelName:Dp,backendName:"webgl",kernelFunc:qte},Kte="return tan(x);",Yte=tt({opSnippet:Kte}),Zte={kernelName:nl,backendName:"webgl",kernelFunc:Yte},Jte=` float e2x = exp(-2.0 * abs(x)); return sign(x) * (1.0 - e2x) / (1.0 + e2x); -`,ste=tt({opSnippet:rte}),ite={kernelName:Ko,backendName:"webgl",kernelFunc:ste};function ote(e){let{inputs:t,backend:a,attrs:n}=e,{tensor:r,indices:s,updates:i}=t,{}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:p,outputSize:c}=C.calculateShapes(i,s,r.shape),d=[c/u,u];if(c===0)return a.makeTensorInfo(r.shape,s.dtype);let h=pe({inputs:{x:s},backend:a,attrs:{shape:[l,o]}}),m=pe({inputs:{x:i},backend:a,attrs:{shape:[l,u]}}),f=pe({inputs:{x:r},backend:a,attrs:{shape:d}}),g=new W3(l,o,h.shape.length,m.shape.length,p,d,!1,!0),y=a.runWebGLProgram(g,[m,h,f],f.dtype),x=pe({inputs:{x:y},backend:a,attrs:{shape:r.shape}});return a.disposeIntermediateTensorInfo(h),a.disposeIntermediateTensorInfo(m),a.disposeIntermediateTensorInfo(f),a.disposeIntermediateTensorInfo(y),x}var lte={kernelName:_o,backendName:"webgl",kernelFunc:ote},ute=class{constructor(e,t){this.variableNames=["A"];let a=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 a=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],n=[];for(let r=0;r5){let o=a.readSync(r.dataId),l=r.dtype==="string"?o.map(c=>v.decodeString(c)):o,u=$e(r.shape,r.dtype,l),p=mj(u,s);return a.makeTensorInfo(p.shape,p.dtype,p.values)}let i=new ute(r.shape,s);return a.runWebGLProgram(i,[r],r.dtype)}var pte={kernelName:ls,backendName:"webgl",kernelFunc:U8},cte=class{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode=` + `}};function rae(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 a=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],n=[];for(let r=0;r5){let o=a.readSync(r.dataId),l=r.dtype==="string"?o.map(c=>v.decodeString(c)):o,u=Te(r.shape,r.dtype,l),d=lq(u,s);return a.makeTensorInfo(d.shape,d.dtype,d.values)}let i=new nae(r.shape,s);return a.runWebGLProgram(i,[r],r.dtype)}var sae={kernelName:$s,backendName:"webgl",kernelFunc:u8},iae=class{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -4740,7 +4740,7 @@ return a / b;`,vJ=` setOutput(float(i1)); } } - `}},hte=class{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode=` + `}},oae=class{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode=` void main() { // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ... ivec2 coords = getOutputCoords(); @@ -4774,7 +4774,7 @@ return a / b;`,vJ=` setOutput(x0 >= x1 ? float(i0) : float(i1)); } - `}};function Os(e,t){t!==null&&e.disposeIntermediateTensorInfo(t)}function H5(e){let t=1;for(;tl){let M=a.readSync(r.dataId),[P,E]=fj(M,u,r.dtype,s,i);return[a.makeTensorInfo(P.shape,P.dtype,P.values),a.makeTensorInfo(E.shape,E.dtype,E.values)]}if(s===0)return u[u.length-1]=0,[a.makeTensorInfo(u,r.dtype,[]),a.makeTensorInfo(u,"int32",[])];if(p===1)return[r,Jp({attrs:{shape:u,dtype:"int32",value:0},backend:a})];let c=a.texData.get(r.dataId),d=c!==null&&c.isPacked,h=d?a.unpackTensor(r):r,m=v.sizeFromShape(u)/p,f=pe({inputs:{x:h},attrs:{shape:[m,p]},backend:a});d&&Os(a,h);let g=H5(s),y=H5(p),x=null,A=()=>x===null?[f,f]:[f,x],b=(M,P,E)=>{let S=A(),_=new cte(E),O=[[p],[x===null?1:0],[Number.NEGATIVE_INFINITY],[M],[P]],W=x;x=a.runWebGLProgram(_,S,"int32",O),Os(a,W)};for(let M=1;M=1;E/=2)b(P,E,[m,y])}for(let M=y;M>g;M/=2){let P=A(),E=new hte([m,M/2]),S=[[p],[x===null?1:0],[g]],_=x;x=a.runWebGLProgram(E,P,"int32",S),Os(a,_);let O=g/2,W=O*2;for(let $=O;$>=1;$/=2)b(W,$,x.shape)}let w=x;x=Zu({inputs:{x},backend:a,attrs:{begin:0,size:[m,s]}}),Os(a,w);let I=F8({inputs:{x:f,indices:x},backend:a,attrs:{axis:1,batchDims:1}});Os(a,f);let T=u.slice(0,-1);T.push(s),w=x,x=pe({inputs:{x},attrs:{shape:T},backend:a}),Os(a,w);let N=I;return I=pe({inputs:{x:I},attrs:{shape:T},backend:a}),Os(a,N),[I,x]}var fte={kernelName:Yo,backendName:"webgl",kernelFunc:mte},gte=class{constructor(e,t,a,n,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=a==="nearest"?1:2,o;switch(n){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 ui(e,t){t!==null&&e.disposeIntermediateTensorInfo(t)}function sA(e){let t=1;for(;tl){let M=a.readSync(r.dataId),[F,E]=uq(M,u,r.dtype,s,i);return[a.makeTensorInfo(F.shape,F.dtype,F.values),a.makeTensorInfo(E.shape,E.dtype,E.values)]}if(s===0)return u[u.length-1]=0,[a.makeTensorInfo(u,r.dtype,[]),a.makeTensorInfo(u,"int32",[])];if(d===1)return[r,ic({attrs:{shape:u,dtype:"int32",value:0},backend:a})];let c=a.texData.get(r.dataId),p=c!==null&&c.isPacked,h=p?a.unpackTensor(r):r,m=v.sizeFromShape(u)/d,f=pe({inputs:{x:h},attrs:{shape:[m,d]},backend:a});p&&ui(a,h);let g=sA(s),y=sA(d),x=null,A=()=>x===null?[f,f]:[f,x],b=(M,F,E)=>{let T=A(),D=new iae(E),O=[[d],[x===null?1:0],[Number.NEGATIVE_INFINITY],[M],[F]],W=x;x=a.runWebGLProgram(D,T,"int32",O),ui(a,W)};for(let M=1;M=1;E/=2)b(F,E,[m,y])}for(let M=y;M>g;M/=2){let F=A(),E=new oae([m,M/2]),T=[[d],[x===null?1:0],[g]],D=x;x=a.runWebGLProgram(E,F,"int32",T),ui(a,D);let O=g/2,W=O*2;for(let $=O;$>=1;$/=2)b(W,$,x.shape)}let w=x;x=sd({inputs:{x},backend:a,attrs:{begin:0,size:[m,s]}}),ui(a,w);let S=t8({inputs:{x:f,indices:x},backend:a,attrs:{axis:1,batchDims:1}});ui(a,f);let C=u.slice(0,-1);C.push(s),w=x,x=pe({inputs:{x},attrs:{shape:C},backend:a}),ui(a,w);let N=S;return S=pe({inputs:{x:S},attrs:{shape:C},backend:a}),ui(a,N),[S,x]}var uae={kernelName:sl,backendName:"webgl",kernelFunc:lae},dae=class{constructor(e,t,a,n,r,s){this.variableNames=["Image","Transforms"],this.outputShape=s;let i=a==="nearest"?1:2,o;switch(n){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) { @@ -4886,9 +4886,9 @@ return a / b;`,vJ=` } setOutput(outputValue); } - `}};function yte(e){let{inputs:t,backend:a,attrs:n}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=n,[p,c,d,h]=r.shape,[m,f]=u!=null?u:[c,d],g=[p,m,f,h],y=new gte(c,d,i,o,l,g);return a.runWebGLProgram(y,[r,s],"float32")}var xte={kernelName:Zo,backendName:"webgl",kernelFunc:yte};function Ate(e){let{inputs:t,attrs:a,backend:n}=e,{axis:r}=a,{x:s}=t;Gu(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=n.readSync(s.dataId),{outputValues:o,outputShape:l,indices:u}=gj(i,r,s.shape,s.dtype);return[n.makeTensorInfo(l,s.dtype,o),n.makeTensorInfo([u.length],"int32",u)]}var bte={kernelName:Tp,backendName:"webgl",kernelFunc:Ate};function vte(e){let{inputs:t,backend:a,attrs:n}=e,{value:r}=t,{axis:s}=n;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,l=r.shape[s],u=new Array(o-1),p=0;for(let f=0;fa.disposeIntermediateTensorInfo(f)),m}var wte={kernelName:zu,backendName:"webgl",kernelFunc:vte},kte=class{constructor(e,t){this.variableNames=["x","segmentIds"];let a=e.windowSize,n=e.batchSize,r=e.inSize,s=e.numSegments,i=s*Math.ceil(r/a);this.outputShape=[n,i];let o="0.0",l="sumValue",u=Math.floor(a/4)*4,p=a%4,c=` + `}};function pae(e){let{inputs:t,backend:a,attrs:n}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=n,[d,c,p,h]=r.shape,[m,f]=u!=null?u:[c,p],g=[d,m,f,h],y=new dae(c,p,i,o,l,g);return a.runWebGLProgram(y,[r,s],"float32")}var cae={kernelName:il,backendName:"webgl",kernelFunc:pae};function hae(e){let{inputs:t,attrs:a,backend:n}=e,{axis:r}=a,{x:s}=t;Ju(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=n.readSync(s.dataId),{outputValues:o,outputShape:l,indices:u}=dq(i,r,s.shape,s.dtype);return[n.makeTensorInfo(l,s.dtype,o),n.makeTensorInfo([u.length],"int32",u)]}var mae={kernelName:Pp,backendName:"webgl",kernelFunc:hae};function fae(e){let{inputs:t,backend:a,attrs:n}=e,{value:r}=t,{axis:s}=n;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,l=r.shape[s],u=new Array(o-1),d=0;for(let f=0;fa.disposeIntermediateTensorInfo(f)),m}var gae={kernelName:ju,backendName:"webgl",kernelFunc:fae},yae=class{constructor(e,t){this.variableNames=["x","segmentIds"];let a=e.windowSize,n=e.batchSize,r=e.inSize,s=e.numSegments,i=s*Math.ceil(r/a);this.outputShape=[n,i];let o="0.0",l="sumValue",u=Math.floor(a/4)*4,d=a%4,c=` sumValue += dot(values, segFilter); - `,d="";r%a>0&&(d=` + `,p="";r%a>0&&(p=` if (inIdx < 0 || inIdx >= ${r}) { return initializationValue; } @@ -4900,7 +4900,7 @@ return a / b;`,vJ=` const float initializationValue = ${o}; float getValue(int batch, int inIdx) { - ${d} + ${p} return getX(batch, inIdx); } @@ -4939,7 +4939,7 @@ return a / b;`,vJ=` } int inIdx = inOffset + ${u}; - if (${p===1}) { + if (${d===1}) { vec4 values = vec4( getValue(batch, inIdx), initializationValue, @@ -4957,7 +4957,7 @@ return a / b;`,vJ=` ); ${c} - } else if (${p===2}) { + } else if (${d===2}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -4973,7 +4973,7 @@ return a / b;`,vJ=` ); ${c} - } else if (${p===3}) { + } else if (${d===3}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -4992,9 +4992,9 @@ return a / b;`,vJ=` } setOutput(${l}); } - `}};function Ite(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,segmentIds:s}=t,{numSegments:i}=n,o=r.shape.length,l=[],u=0,p=C.getAxesPermutation([u],o),c=r;p!=null&&(c=Ca({inputs:{x:r},backend:a,attrs:{perm:p}}),l.push(c),u=C.getInnerMostAxes(1,o)[0]);let d=C.segment_util.computeOutShape(c.shape,u,i),h=v.sizeFromShape([c.shape[u]]),m=pe({inputs:{x:c},backend:a,attrs:{shape:[-1,h]}});l.push(m);let f=Mp(r.dtype),g=(b,w,I,T,N)=>{let M=b.shape[0],P=b.shape[1],E=C.segment_util.segOpComputeOptimalWindowSize(P,N),S={windowSize:E,inSize:P,batchSize:M,numSegments:N},_=new kte(S,w),O=a.compileAndRun(_,[b,I],T);if(l.push(O),O.shape[1]===N)return O;let W=V8({backend:a,attrs:{start:0,stop:N,step:1,dtype:"float32"}}),$=U8({inputs:{x:W},backend:a,attrs:{reps:[P/E]}});return l.push(W),l.push($),g(O,w,$,T,N)},y=g(m,"unsortedSegmentSum",s,f,i),x=pe({inputs:{x:y},backend:a,attrs:{shape:d}}),A=x;if(p!=null){l.push(x);let b=C.getUndoAxesPermutation(p);A=Ca({inputs:{x:A},backend:a,attrs:{perm:b}})}return l.forEach(b=>a.disposeIntermediateTensorInfo(b)),A}var Ste={kernelName:Np,backendName:"webgl",kernelFunc:Ite},Cte=[uq,pq,mq,yq,Aq,wq,Iq,Cq,Eq,Pq,Fq,zq,Bq,Hq,Xq,Yq,Jq,aX,rX,iX,dX,yX,AX,kX,SX,MX,_X,OX,jj,WX,HX,KX,tK,rK,iK,lK,dK,mK,yK,bK,wK,IK,CK,RK,MK,FK,OK,WK,UK,HK,KK,QK,nY,iY,uY,dY,cY,mY,gY,xY,bY,IY,TY,EY,PY,FY,zY,VY,jY,Hj,XY,UX,ZY,eZ,nZ,Xj,oZ,pZ,hZ,yZ,bZ,IZ,TZ,MZ,FZ,zZ,WZ,GZ,jZ,XZ,JZ,eJ,aJ,rJ,iJ,dJ,mJ,xJ,CJ,Zj,EJ,_J,DJ,LJ,TX,VJ,GJ,jJ,KJ,QJ,Yj,tQ,nQ,sQ,oQ,lQ,NX,wJ,pQ,fQ,AQ,Qj,kQ,CQ,EQ,_Q,OQ,LQ,VQ,HQ,XQ,ZQ,eee,nee,oee,dee,mee,yee,fX,IJ,bee,wee,Iee,Cee,Nee,Eee,Pee,$ee,Dee,Lee,Bee,Uee,Hee,Xee,Yee,Jee,ete,kJ,iq,nte,ite,lte,pte,fte,xte,oq,bte,wte,Ste,UJ];for(let e of Cte)yn(e);var nt;(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"})(nt||(nt={}));var tp;(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",e[e.elu=6]="elu"})(tp||(tp={}));var G8;function Tte(e){G8=e.wasm.cwrap(Yr,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function Nte(e){let{inputs:t,backend:a,attrs:n}=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:u,activation:p,leakyreluAlpha:c}=n,d=a.dataIdMap.get(r.dataId).id,h=a.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let N=a.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:a.dataIdMap.get(o.dataId).id,g=tp[p];if(g==null)throw new Error(`${p} activation not yet supported for FusedConv2D in the wasm backend.`);let y=l?r.shape[2]:r.shape[1],x=u?s.shape[1]:s.shape[2],A=el.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)),b=a.makeOutput([...A,y,x],r.dtype),w=a.dataIdMap.get(b.dataId).id,I=new Uint8Array(new Int32Array(r.shape).buffer),T=new Uint8Array(new Int32Array(s.shape).buffer);return G8(d,I,r.shape.length,h,T,s.shape.length,l,u,g,m,f,c||0,w),b}var Rte={kernelName:Yr,backendName:"wasm",setupFunc:Tte,kernelFunc:Nte};function Qe(e,t){let a;function n(s){a=s.wasm.cwrap(e,null,["number","number","number"])}function r(s){let{backend:i,inputs:{x:o}}=s,l=i.dataIdMap.get(o.dataId).id,u=i.makeOutput(o.shape,t||o.dtype),p=i.dataIdMap.get(u.dataId).id;return v.sizeFromShape(u.shape)===0||a(l,nt[o.dtype],p),u}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:r}}var Ete=Qe(ru),Mte=Qe(si),Pte=Qe(ii);function Gt(e,t,a){let n;function r(i){n=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:l}=i,{a:u,b:p}=l,c=o.dataIdMap.get(u.dataId).id,d=o.dataIdMap.get(p.dataId).id,h=a!=null?a:u.dtype,m=C.assertAndGetBroadcastShape(u.shape,p.shape),f=o.makeOutput(m,h);if(v.sizeFromShape(m)===0)return f;let g=new Uint8Array(new Int32Array(u.shape).buffer),y=new Uint8Array(new Int32Array(p.shape).buffer),x=o.dataIdMap.get(f.dataId).id;return n(c,g,u.shape.length,d,y,p.shape.length,nt[u.dtype],x),f}return{kernelName:e,backendName:"wasm",setupFunc:r,kernelFunc:s}}var _te=!0,$te=Gt(is,_te),H8;function Fte(e){H8=e.wasm.cwrap(oi,null,["array","number","number","number"])}function Dte(e){let{inputs:t,backend:a}=e,n=a.makeOutput(t[0].shape,t[0].dtype);if(v.sizeFromShape(n.shape)===0)return n;let r=t.map(o=>a.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(r).buffer),i=a.dataIdMap.get(n.dataId).id;return H8(s,r.length,nt[n.dtype],i),n}var Ote={kernelName:oi,backendName:"wasm",setupFunc:Fte,kernelFunc:Dte};function o0(e){let{inputs:{x:t},backend:a}=e;if(t.dtype==="string")return Ve(a.readSync(t.dataId),t.shape,t.dtype);let n=a.makeOutput(t.shape,t.dtype),r=a.typedArrayFromHeap(t);return a.typedArrayFromHeap(n).set(r),n}var zte={kernelName:Hi,backendName:"wasm",kernelFunc:o0},j8;function Lte(e){j8=e.wasm.cwrap(wr,null,["number","array","number","number","number","array","number"])}function ss(e){let{inputs:t,backend:a,attrs:n}=e,[r,s]=Bte(t.x.shape,n.perm),i=!0;for(let m=0;m=r&&(s===-1||n[s]>n[i])&&(s=i);n[s]=r}return[a,n]}var Vte={kernelName:wr,backendName:"wasm",kernelFunc:ss,setupFunc:Lte};function ms(e,t,a){let n=e.shape,r=e.shape.length,s=v.parseAxisParam(t,n),i=s,o=C.getAxesPermutation(i,r),l=null,u=!1;if(o!=null){let p=new Array(r);for(let d=0;d`new shape: ${i}, old shape: ${n.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(n.dataId),{dataId:n.dataId,shape:i,dtype:n.dtype}}var mae={kernelName:Tu,backendName:"wasm",kernelFunc:La},ew;function fae(e){ew=e.wasm.cwrap(gi,null,["number","array","number","number","array","number","number","number","number"])}function gae(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let l=r.shape.length,u=s.shape.length,p=i?r.shape[l-2]:r.shape[l-1],c=o?s.shape[u-1]:s.shape[u-2],d=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[u-2]:s.shape[u-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=v.sizeFromShape(m),y=v.sizeFromShape(f),x=el.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)).concat([d,h]);v.assert(p===c,()=>`Error in matMul: inner shapes (${p}) and (${c}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let A=i?[g,p,d]:[g,d,p],b=o?[y,h,c]:[y,c,h],w=La({inputs:{x:r},backend:a,attrs:{shape:A}}),I=La({inputs:{x:s},backend:a,attrs:{shape:b}}),T=a.dataIdMap.get(w.dataId).id,N=a.dataIdMap.get(I.dataId).id,M=i?w.shape[2]:w.shape[1],P=o?I.shape[1]:I.shape[2],E=Math.max(g,y),S=a.makeOutput([E,M,P],w.dtype),_=a.dataIdMap.get(S.dataId).id,O=new Uint8Array(new Int32Array(w.shape).buffer),W=new Uint8Array(new Int32Array(I.shape).buffer);return ew(T,O,w.shape.length,N,W,I.shape.length,i,o,_),a.disposeData(w.dataId),a.disposeData(I.dataId),S.shape=x,S}var yae={kernelName:gi,backendName:"wasm",setupFunc:fae,kernelFunc:gae};function ni(e){let{inputs:{x:t},attrs:{begin:a,size:n},backend:r}=e,[s,i]=Nt.parseSliceParams(t,a,n),o=Nt.isSliceContinous(t.shape,s,i),l=r.readSync(t.dataId),u=r.makeOutput(i,t.dtype),p=v.computeStrides(t.shape),c=r.dataIdMap.get(u.dataId);if(o){let m=Nt.computeFlatOffset(s,p);return t.dtype==="string"?c.stringBytes=l.slice(m,m+v.sizeFromShape(i)):r.typedArrayFromHeap(u).set(l.subarray(m,m+v.sizeFromShape(i))),u}if(t.dtype==="string"){let m=xh(l,s,i,t.shape,t.dtype);return c.stringBytes=m,u}let d=r.typedArrayFromHeap(u),h=t.shape.length;if(h===2)xae(l,p[0],d,s,i);else if(h===3)Aae(l,p[0],p[1],d,s,i);else if(h===4)bae(l,p[0],p[1],p[2],d,s,i);else{let m=xh(l,s,i,t.shape,t.dtype);d.set(m)}return u}function xae(e,t,a,n,r){let s=0,i=n[0],o=n[1],l=i+r[0];for(let u=i;uy*x),l=C.getReshaped(r.shape,s,o),u=C.getPermuted(l.length,s.length),p=C.getReshapedPermuted(r.shape,s,o),c=C.getSliceBeginCoords(i,s.length),d=C.getSliceSize(p,i,s.length),h=La({inputs:{x:r},backend:a,attrs:{shape:l}}),m=ss({inputs:{x:h},backend:a,attrs:{perm:u}}),f=La({inputs:{x:m},backend:a,attrs:{shape:p}}),g=ni({inputs:{x:f},backend:a,attrs:{begin:c,size:d}});return a.disposeData(h.dataId),a.disposeData(m.dataId),a.disposeData(f.dataId),g}var kae={kernelName:lu,backendName:"wasm",kernelFunc:wae},tw;function Iae(e){tw=e.wasm.cwrap(yi,null,["number","number","boolean","number","number","number"])}function Sae(e){let{backend:t,inputs:a,attrs:n}=e,{x:r,weights:s}=a,{size:i}=n,o=s.shape.reduce((c,d)=>c*d,1)!==0,l=r.shape.length===1?[i]:[r.shape[0],i],u=t.makeOutput(l,s.dtype);function p(c){return t.dataIdMap.get(c.dataId).id}return tw(p(r),i,o,p(s),nt[s.dtype],p(u)),u}var Cae={kernelName:yi,backendName:"wasm",setupFunc:Iae,kernelFunc:Sae},Tae=!0,Nae=Gt(uu,Tae);function Rae(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t,s=a.typedArrayFromHeap(n),i=a.typedArrayFromHeap(r),o=C.assertAndGetBroadcastShape(Array.from(s),Array.from(i));return a.makeOutput([o.length],"int32",void 0,new Int32Array(o))}var Eae={kernelName:du,backendName:"wasm",kernelFunc:Rae};function fs(e){let{inputs:{x:t},attrs:{dtype:a},backend:n}=e,r=n.makeOutput(t.shape,a),s=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(r).set(s),r}var Mae={kernelName:xi,backendName:"wasm",kernelFunc:fs},Pae=Qe(Ai),aw;function _ae(e){aw=e.wasm.cwrap(os,null,["number","number","number","number"])}function $ae(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=n,o=a.dataIdMap.get(r.dataId).id,l=a.makeOutput(r.shape,r.dtype),u=a.dataIdMap.get(l.dataId).id;return aw(o,s,i,u),l}var Fae={kernelName:os,backendName:"wasm",setupFunc:_ae,kernelFunc:$ae};function nw(e){let{inputs:t,backend:a}=e,n=v.parseAxisParam(e.attrs.axis,t[0].shape)[0],r=t.map(h=>h.shape);C.assertParamsConsistent(r,n);let s=C.computeOutShape(t.map(h=>h.shape),n),i=t.filter(h=>v.sizeFromShape(h.shape)>0);if(i.length===1)return o0({inputs:{x:i[0]},backend:a});let o=a.makeOutput(s,t[0].dtype);if(v.sizeFromShape(s)===0)return o;if(i[0].dtype==="string"){let h=i.map(A=>{let b=[-1,v.sizeFromShape(A.shape.slice(n))];return La({inputs:{x:A},backend:a,attrs:{shape:b}})}),m=h.map(A=>({vals:a.readSync(A.dataId),shape:A.shape}));s=C.computeOutShape(h.map(A=>A.shape),1);let f=h[0].shape[0]===1,g=h3(m,s,t[0].dtype,f),y=C.computeOutShape(i.map(A=>A.shape),n);o.shape=y;let x=a.dataIdMap.get(o.dataId);return x.stringBytes=C.fromStringArrayToUint8(g),h.forEach(A=>a.disposeData(A.dataId)),o}let l=v.sizeFromShape(i[0].shape.slice(0,n)),u=0,p=i.map(h=>{let m=v.sizeFromShape(h.shape.slice(n));return u+=m,m}),c=i.map(h=>a.typedArrayFromHeap(h)),d=a.typedArrayFromHeap(o);for(let h=0;h`cumprod does not support ${r.dtype} tensors in the WASM backend`);let u=C.getAxesPermutation([s],l),p=r;u!==null&&(p=ss({inputs:{x:r},attrs:{perm:u},backend:a}));let c=C.getInnerMostAxes(1,l)[0];C.assertAxesAreInnerMostDims("cumprod",[c],l);let d=a.makeOutput(p.shape,p.dtype),h=p.shape[c],m=a.dataIdMap.get(p.dataId).id,f=a.dataIdMap.get(d.dataId).id;dw(m,i?1:0,o?1:0,h,f,nt[r.dtype]);let g=d;if(u!==null){let y=C.getUndoAxesPermutation(u);g=ss({inputs:{x:d},attrs:{perm:y},backend:a}),a.disposeData(p.dataId),a.disposeData(d.dataId)}return g}var sne={kernelName:Ci,backendName:"wasm",setupFunc:nne,kernelFunc:rne},pw;function ine(e){pw=e.wasm.cwrap(Ti,null,["number","number","number","number","number","number"])}function one(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n,l=r.shape.length;v.assert(r.dtype==="float32"||r.dtype==="int32",()=>`cumsum does not support ${r.dtype} tensors in the WASM backend`);let u=C.getAxesPermutation([s],l),p=r;u!==null&&(p=ss({inputs:{x:r},attrs:{perm:u},backend:a}));let c=C.getInnerMostAxes(1,l)[0];C.assertAxesAreInnerMostDims("cumsum",[c],l);let d=a.makeOutput(p.shape,p.dtype),h=p.shape[c],m=a.dataIdMap.get(p.dataId).id,f=a.dataIdMap.get(d.dataId).id;pw(m,i?1:0,o?1:0,h,f,nt[r.dtype]);let g=d;if(u!==null){let y=C.getUndoAxesPermutation(u);g=ss({inputs:{x:d},attrs:{perm:y},backend:a}),a.disposeData(p.dataId),a.disposeData(d.dataId)}return g}var lne={kernelName:Ti,backendName:"wasm",setupFunc:ine,kernelFunc:one},cw;function une(e){cw=e.wasm.cwrap("DenseBincount",null,["number","array","number","number","boolean","number","number","boolean","number"])}function dne(e){let{backend:t,inputs:a,attrs:n}=e,{x:r,weights:s}=a,{size:i,binaryOutput:o}=n,l=s.shape.reduce((d,h)=>d*h,1)!==0,u=r.shape.length===1?[i]:[r.shape[0],i],p=t.makeOutput(u,s.dtype);function c(d){return t.dataIdMap.get(d.dataId).id}return cw(c(r),new Uint8Array(new Int32Array(r.shape).buffer),r.shape.length,i,l,c(s),nt[s.dtype],o,c(p)),p}var pne={kernelName:hu,backendName:"wasm",setupFunc:une,kernelFunc:dne},hw;function cne(e){hw=e.wasm.cwrap(Ri,null,["number","number","number","array","number","array","array","number","number"])}function hne(e){let{backend:t,inputs:a,attrs:n}=e,{x:r}=a,{blockSize:s,dataFormat:i}=n,o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],p=i==="NHWC"?r.shape[3]:r.shape[1],c=l*s,d=u*s,h=p/(s*s),m=i==="NHWC"?[o,c,d,h]:[o,h,c,d],f=t.makeOutput(m,"float32"),g=t.dataIdMap.get(r.dataId).id,y=new Uint8Array(new Int32Array(v.computeStrides(r.shape)).buffer),x=new Uint8Array(new Int32Array(m).buffer),A=new Uint8Array(new Int32Array(v.computeStrides(m)).buffer),b=t.dataIdMap.get(f.dataId).id;return hw(g,s,i==="NHWC"?1:0,y,r.shape.length-1,x,A,m.length,b),f}var mne={kernelName:Ri,backendName:"wasm",setupFunc:cne,kernelFunc:hne},mw;function fne(e){mw=e.wasm.cwrap(Ei,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function gne(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s}=t,i=n.dataIdMap.get(r.dataId).id,o=n.dataIdMap.get(s.dataId).id,{strides:l,dilations:u,pad:p,dimRoundingMode:c}=a,d=u==null?[1,1]:u,h=C.computeConv2DInfo(r.shape,s.shape,l,d,p,c,!0),m=h.filterHeight,f=h.filterWidth,g=h.padInfo.top,y=h.padInfo.right,x=h.padInfo.bottom,A=h.padInfo.left,b=h.dilationHeight,w=h.dilationWidth,I=h.strideHeight,T=h.strideWidth,N=h.inChannels,M=h.outChannels,P=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 E=n.makeOutput(h.outShape,"float32"),S=n.dataIdMap.get(E.dataId).id;return mw(i,r.shape[0],r.shape[1],r.shape[2],o,m,f,g,y,x,A,P,b,w,I,T,N,M,S),E}var yne={kernelName:Ei,backendName:"wasm",setupFunc:fne,kernelFunc:gne},fw;function xne(e){fw=e.wasm.cwrap("Diag",null,["number","number","number","number"])}function Ane(e){let{inputs:t,backend:a}=e,{x:n}=t,r=v.sizeFromShape(n.shape),s=a.makeOutput([...n.shape,...n.shape],n.dtype);return fw(a.dataIdMap.get(n.dataId).id,nt[n.dtype],r,a.dataIdMap.get(s.dataId).id),s}var bne={kernelName:mu,backendName:"wasm",setupFunc:xne,kernelFunc:Ane},gw;function vne(e){gw=e.wasm.cwrap(Mi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function wne(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n;if(r.dtype!==s.dtype)throw new Error(`Dilation2D error: x must have the same dtype as filter. Got ${r.dtype} and ${s.dtype}`);let u=C.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),p=a.makeOutput(u.outShape,r.dtype);return gw(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(p.dataId).id,nt[r.dtype],u.batchSize,u.inChannels,u.inHeight,u.inWidth,u.outHeight,u.outWidth,u.strideHeight,u.strideWidth,u.dilationHeight,u.dilationWidth,u.filterHeight,u.filterWidth,u.padInfo.top,u.padInfo.left),p}var kne={kernelName:Mi,backendName:"wasm",setupFunc:vne,kernelFunc:wne},yw;function Ine(e){yw=e.wasm.cwrap(Hl,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Sne(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n;if(r.dtype!==s.dtype||r.dtype!==i.dtype)throw new Error(`Dilation2DBackpropFilter error: x must have the same dtype as filter and dy. Got ${r.dtype}, ${s.dtype}, and ${i.dtype}`);let p=C.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=a.makeOutput(s.shape,s.dtype);return yw(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(i.dataId).id,a.dataIdMap.get(c.dataId).id,nt[r.dtype],p.batchSize,p.inChannels,p.inHeight,p.inWidth,p.outHeight,p.outWidth,p.strideHeight,p.strideWidth,p.dilationHeight,p.dilationWidth,p.filterHeight,p.filterWidth,p.padInfo.top,p.padInfo.left),c}var Cne={kernelName:Hl,backendName:"wasm",setupFunc:Ine,kernelFunc:Sne},xw;function Tne(e){xw=e.wasm.cwrap(Gl,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Nne(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n;if(r.dtype!==s.dtype||r.dtype!==i.dtype)throw new Error(`Dilation2DBackpropInput error: x must have the same dtype as filter and dy. Got ${r.dtype}, ${s.dtype}, and ${i.dtype}`);let p=C.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=a.makeOutput(r.shape,r.dtype);return xw(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(i.dataId).id,a.dataIdMap.get(c.dataId).id,nt[r.dtype],p.batchSize,p.inChannels,p.inHeight,p.inWidth,p.outHeight,p.outWidth,p.strideHeight,p.strideWidth,p.dilationHeight,p.dilationWidth,p.filterHeight,p.filterWidth,p.padInfo.top,p.padInfo.left),c}var Rne={kernelName:Gl,backendName:"wasm",setupFunc:Tne,kernelFunc:Nne},Ene=Qe(_i),Aw;function Mne(e){Aw=e.wasm.cwrap(fu,null,["number","number","number"])}function Pne(e){let{inputs:t,backend:a}=e,{dy:n,y:r}=t,s=a.makeOutput(r.shape,"float32"),i=o=>a.dataIdMap.get(o.dataId).id;return Aw(i(r),i(n),i(s)),s}var _ne={kernelName:fu,backendName:"wasm",setupFunc:Mne,kernelFunc:Pne},$ne=!1,Fne=Gt(Fi,$ne,"bool"),Dne=Qe($i),One=Qe(Di,"float32");function V1(e){let{inputs:t,attrs:a,backend:n}=e,{input:r}=t,{dim:s}=a,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(v.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),La({inputs:{x:r},backend:n,attrs:{shape:o}})}var zne={kernelName:gu,backendName:"wasm",kernelFunc:V1},Lne=Qe(Oi,"float32");function bw(e){let{attrs:{shape:t,value:a},backend:n}=e,{attrs:{dtype:r}}=e;r=r||v.inferDtype(a);let s=n.makeOutput(t,r);return n.typedArrayFromHeap(s).fill(a),s}var Wne={kernelName:yu,backendName:"wasm",kernelFunc:bw},vw;function Bne(e){vw=e.wasm.cwrap(zi,null,["number","number","number","number","number","number"])}function Vne(e){let{inputs:t,backend:a}=e,{image:n}=t,r=a.makeOutput(n.shape,n.dtype),s=a.dataIdMap.get(n.dataId).id,i=a.dataIdMap.get(r.dataId).id,[o,l,u,p]=n.shape;return vw(s,o,l,u,p,i),r}var Une={kernelName:zi,backendName:"wasm",kernelFunc:Vne,setupFunc:Bne},Gne=Qe(Li),Hne=!1,jne=Gt(Wi,Hne),ww;function qne(e){ww=e.wasm.cwrap(Bi,null,["number","number","number","number","number","number","number"])}function Xne(e){let{backend:t,inputs:a,attrs:n}=e,{varianceEpsilon:r}=n,{x:s,mean:i,variance:o,offset:l,scale:u}=a,p=t.dataIdMap.get(s.dataId).id,c=t.dataIdMap.get(i.dataId).id,d=t.dataIdMap.get(o.dataId).id,h=l!=null?t.dataIdMap.get(l.dataId).id:0,m=u!=null?t.dataIdMap.get(u.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(v.sizeFromShape(s.shape)===0)return f;let g=t.dataIdMap.get(f.dataId).id;return ww(p,c,d,h,m,r,g),f}var Kne={kernelName:Bi,backendName:"wasm",setupFunc:qne,kernelFunc:Xne},kw;function Yne(e){kw=e.wasm.cwrap(Zr,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 Zne(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:p,dataFormat:c,dimRoundingMode:d,activation:h,leakyreluAlpha:m}=a,f=C.computeConv2DInfo(r.shape,s.shape,l,p,u,d),g=tp[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedConv2D in the wasm backend.`);let y=n.dataIdMap.get(r.dataId).id,x=n.dataIdMap.get(s.dataId).id,A=f.outChannels,b=0;if(i!=null){let X=n.dataIdMap.get(i.dataId);if(X.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${X.shape.length}.`);if(X.shape[0]!==A)throw new Error(`FusedConv2D bias shape (${X.shape}) does not match the number of output channels (${A})`);b=X.id}let w=f.filterHeight,I=f.filterWidth,T=f.padInfo.top,N=f.padInfo.right,M=f.padInfo.bottom,P=f.padInfo.left,E=f.dilationHeight,S=f.dilationWidth,_=f.strideHeight,O=f.strideWidth,W=f.inChannels,$=f.padInfo.type==="SAME"?1:0,U=f.batchSize,G=f.inHeight,q=f.inWidth;if(c!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let H=n.makeOutput(f.outShape,"float32"),V=n.dataIdMap.get(H.dataId).id,Z=o==null?0:n.dataIdMap.get(o.dataId).id;return kw(y,U,G,q,x,w,I,b,T,N,M,P,$,E,S,_,O,W,A,g,Z,m||0,V),H}var Jne={kernelName:Zr,backendName:"wasm",setupFunc:Yne,kernelFunc:Zne},Iw;function Qne(e){Iw=e.wasm.cwrap(Jr,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 ere(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:p,dataFormat:c,dimRoundingMode:d,activation:h,leakyreluAlpha:m}=a,f=C.computeConv2DInfo(r.shape,s.shape,l,p,u,d,!0),g=tp[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=n.dataIdMap.get(r.dataId).id,x=n.dataIdMap.get(s.dataId).id,A=f.outChannels,b=0;if(i!=null){let X=n.dataIdMap.get(i.dataId);if(X.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${X.shape.length}.`);if(X.shape[0]!==A)throw new Error(`FusedDepthwiseConv2D bias shape (${X.shape}) does not match the number of output channels (${A})`);b=X.id}let w=f.filterHeight,I=f.filterWidth,T=f.padInfo.top,N=f.padInfo.right,M=f.padInfo.bottom,P=f.padInfo.left,E=f.dilationHeight,S=f.dilationWidth,_=f.strideHeight,O=f.strideWidth,W=f.inChannels,$=f.padInfo.type==="SAME"?1:0,U=f.batchSize,G=f.inHeight,q=f.inWidth;if(c!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let H=n.makeOutput(f.outShape,"float32"),V=n.dataIdMap.get(H.dataId).id,Z=o==null?0:n.dataIdMap.get(o.dataId).id;return Iw(y,U,G,q,x,w,I,b,T,N,M,P,$,E,S,_,O,W,A,g,Z,m||0,V),H}var tre={kernelName:Jr,backendName:"wasm",setupFunc:Qne,kernelFunc:ere},Sw;function are(e){Sw=e.wasm.cwrap(Vi,null,["number","number","number","number","number","number","array","number"])}function nre(e){let{backend:t,inputs:a}=e,{params:n,indices:r}=a,[s,i,o,l]=r3.prepareAndValidate(n,r),u=t.makeOutput(s,n.dtype);if(i===0)return u;let p=r.shape,c=p[p.length-1],d=t.dataIdMap.get(n.dataId).id,h=t.dataIdMap.get(r.dataId).id,m=new Uint8Array(new Int32Array(l).buffer),f=t.dataIdMap.get(u.dataId).id;return Sw(d,nt[n.dtype],h,i,c,o,m,f),u}var rre={kernelName:Vi,backendName:"wasm",setupFunc:are,kernelFunc:nre},Cw;function sre(e){Cw=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function ire(e){let{backend:t,inputs:a,attrs:n}=e,{x:r,indices:s}=a,{axis:i,batchDims:o}=n,l=v.parseAxisParam(i,r.shape)[0],u=t.readSync(s.dataId),p=r.shape[l];for(let T=0;T=0,()=>`GatherV2: the index value ${N} is not in [0, ${p-1}]`)}let c=C.segment_util.collectGatherOpShapeInfo(r,s,l,o),d=La({inputs:{x:r},attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]},backend:t}),h=v.sizeFromShape(s.shape),m=La({inputs:{x:s},attrs:{shape:[c.batchSize,h/c.batchSize]},backend:t}),f=[c.batchSize,c.outerSize,h/c.batchSize,c.sliceSize],g=t.makeOutput(f,r.dtype);if(v.sizeFromShape(r.shape)===0)return g;let y=d.shape.length-1,x=t.dataIdMap.get(d.dataId).id,A=t.dataIdMap.get(m.dataId).id,b=t.dataIdMap.get(g.dataId).id,w=new Uint8Array(new Int32Array(v.computeStrides(d.shape)).buffer),I=new Uint8Array(new Int32Array(v.computeStrides(f)).buffer);return Cw(x,nt[r.dtype],w,y,A,c.batchSize,I,b),t.disposeData(d.dataId),t.disposeData(m.dataId),g.shape=c.outputShape,g}var ore={kernelName:xu,backendName:"wasm",setupFunc:sre,kernelFunc:ire},lre=!1,ure=Gt(Ui,lre,"bool"),dre=!1,pre=Gt(Gi,dre,"bool"),cre=Qe(ji,"bool"),hre=Qe(qi,"bool"),mre=Qe(Xi,"bool"),Tw;function fre(e){Tw=e.wasm.cwrap(Ki,null,["number","number","number","number"])}function gre(e){let{inputs:{x:t},attrs:{alpha:a},backend:n}=e,r=n.dataIdMap.get(t.dataId).id,s=n.makeOutput(t.shape,"float32");if(v.sizeFromShape(t.shape)!==0){let i=n.dataIdMap.get(s.dataId).id;Tw(r,nt[t.dtype],a,i)}return s}var yre={kernelName:Ki,backendName:"wasm",setupFunc:fre,kernelFunc:gre},xre=!1,Are=Gt(Yi,xre,"bool"),bre=!1,vre=Gt(Zi,bre,"bool"),Nw;function wre(e){Nw=e.wasm.cwrap(Ji,null,["number","number","number","number"])}function kre(e){let{attrs:t,backend:a}=e,{start:n,stop:r,num:s}=t,i=Math.floor(s),o=a.makeOutput([i],"float32");return Nw(a.dataIdMap.get(o.dataId).id,n,r,i),o}var Ire={kernelName:Ji,backendName:"wasm",setupFunc:wre,kernelFunc:kre},Sre=Qe(Qi),Cre=Qe(eo),Tre=!1,Nre=Gt(to,Tre,"bool"),Rre=Qe(ao),Ere=!1,Mre=Gt(no,Ere,"bool"),Pre=!1,_re=Gt(CA,Pre,"bool"),Rw;function $re(e){Rw=e.wasm.cwrap(ro,null,["number","number","number","number","number","number","number"])}function Fre(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;if(r.dtype!=="float32")throw new Error("LRN error: x must have dtype float32");let u=a.makeOutput(r.shape,r.dtype);return Rw(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(u.dataId).id,r.shape[3],s,i,o,l),u}var Dre={kernelName:ro,backendName:"wasm",setupFunc:$re,kernelFunc:Fre},Ew;function Ore(e){Ew=e.wasm.cwrap(Au,null,["number","number","number","number","number","number","number","number","number"])}function zre(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:p}=n;if(r.dtype!=="float32"||s.dtype!=="float32"||i.dtype!=="float32")throw new Error("LRNGrad error: x, y, and dy must have dtype float32");let c=a.makeOutput(r.shape,r.dtype);return Ew(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(i.dataId).id,a.dataIdMap.get(c.dataId).id,i.shape[3],o,l,u,p),c}var Lre={kernelName:Au,backendName:"wasm",setupFunc:Ore,kernelFunc:zre},Mw;function Wre(e){Mw=e.wasm.cwrap(so,null,["number","number","number","number"])}function Bre(e){let{backend:t,inputs:a,attrs:n}=e,{reductionIndices:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=i,{transposed:u,axes:p,originalAxes:c,inputWasTransposed:d}=ms(i,r,t);if(d){let x=t.dataIdMap.get(u.dataId).id;l=u,o=x}let h=l.shape.length;C.assertAxesAreInnerMostDims("max",p,h);let[m,f]=C.computeOutAndReduceShapes(l.shape,p),g=v.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(v.sizeFromShape(l.shape)!==0){let x=t.dataIdMap.get(y.dataId).id;Mw(o,nt[i.dtype],g,x)}if(d&&t.disposeData(u.dataId),s){let x=C.expandShapeToKeepDim(y.shape,c);y.shape=x}return y}var Vre={kernelName:so,backendName:"wasm",setupFunc:Wre,kernelFunc:Bre},Ure=!1,Gre=Gt(io,Ure),Pw;function Hre(e){Pw=e.wasm.cwrap(oo,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function jre(e){let{inputs:t,attrs:a,backend:n}=e,r=t.x,s=n.dataIdMap.get(r.dataId).id;v.assert(r.dtype==="float32",()=>`Error in MaxPool: only float32 input is supported. Got ${r.dtype}.`);let{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=a,p=C.computePool2DInfo(r.shape,i,o,1,l,u),c=p.filterHeight,d=p.filterWidth,h=p.padInfo.top,m=p.padInfo.right,f=p.padInfo.bottom,g=p.padInfo.left,y=p.dilationHeight,x=p.dilationWidth,A=p.strideHeight,b=p.strideWidth,w=p.inChannels,I=p.outChannels;if(p.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${p.dataFormat}'. Please use 'channelsLast'.`);let T=n.makeOutput(p.outShape,"float32"),N=n.dataIdMap.get(T.dataId).id;return Pw(s,r.shape[0],r.shape[1],r.shape[2],c,d,h,m,f,g,y,x,A,b,w,I,N),T}var qre={kernelName:oo,backendName:"wasm",setupFunc:Hre,kernelFunc:jre},_w;function Xre(e){_w=e.wasm.cwrap("MaxPool3D",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Kre(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n,p=C.computePool3DInfo(r.shape,s,i,1,o,l,u),c=a.makeOutput(p.outShape,r.dtype);return _w(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,p.batchSize,p.inChannels,p.inDepth,p.inHeight,p.inWidth,p.outDepth,p.outHeight,p.outWidth,p.strideDepth,p.strideHeight,p.strideWidth,p.dilationDepth,p.dilationHeight,p.dilationWidth,p.effectiveFilterDepth,p.effectiveFilterHeight,p.effectiveFilterWidth,p.padInfo.front,p.padInfo.top,p.padInfo.left),c}var Yre={kernelName:bu,backendName:"wasm",setupFunc:Xre,kernelFunc:Kre},$w;function Zre(e){$w=e.wasm.cwrap("MaxPool3DGrad",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 Jre(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n,p=C.computePool3DInfo(s.shape,i,o,1,l,u),c=a.makeOutput(s.shape,s.dtype);return $w(a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,p.batchSize,p.inChannels,p.inDepth,p.inHeight,p.inWidth,p.outDepth,p.outHeight,p.outWidth,p.strideDepth,p.strideHeight,p.strideWidth,p.dilationDepth,p.dilationHeight,p.dilationWidth,p.effectiveFilterDepth,p.effectiveFilterHeight,p.effectiveFilterWidth,p.padInfo.front,p.padInfo.top,p.padInfo.left),c}var Qre={kernelName:bp,backendName:"wasm",setupFunc:Zre,kernelFunc:Jre},Fw;function ese(e){Fw=e.wasm.cwrap("MaxPoolGrad",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function tse(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n,p=C.computePool2DInfo(s.shape,i,o,1,l,u),c=a.makeOutput(s.shape,s.dtype);return Fw(a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,p.batchSize,p.inChannels,p.inHeight,p.inWidth,p.outHeight,p.outWidth,p.strideHeight,p.strideWidth,p.dilationHeight,p.dilationWidth,p.effectiveFilterHeight,p.effectiveFilterWidth,p.padInfo.top,p.padInfo.left),c}var ase={kernelName:Ap,backendName:"wasm",setupFunc:ese,kernelFunc:tse},Dw;function nse(e){Dw=e.wasm.cwrap("MaxPoolWithArgmax",null,["number","number","number","number","boolean","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function rse(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,includeBatchInIndex:l}=n;v.assert(r.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${r.shape.length}.`);let u=[1,1];v.assert(C.eitherStridesOrDilationsAreOne(i,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let p=C.computePool2DInfo(r.shape,s,i,[1,1],o),c=a.makeOutput(p.outShape,r.dtype),d=a.makeOutput(p.outShape,"int32");return Dw(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,a.dataIdMap.get(d.dataId).id,nt[r.dtype],l,p.batchSize,p.inChannels,p.inHeight,p.inWidth,p.outHeight,p.outWidth,p.strideHeight,p.strideWidth,p.dilationHeight,p.dilationWidth,p.effectiveFilterHeight,p.effectiveFilterWidth,p.padInfo.top,p.padInfo.left),[c,d]}var sse={kernelName:vu,backendName:"wasm",setupFunc:nse,kernelFunc:rse},Ow;function ise(e){Ow=e.wasm.cwrap(lo,null,["number, number, number"])}function ose(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=ms(i,r,t),m=c;if(h){let b=t.dataIdMap.get(p.dataId).id;b!==o&&(u=p,l=b,m=C.getInnerMostAxes(m.length,u.shape.length))}C.assertAxesAreInnerMostDims("mean",m,u.shape.length);let[f,g]=C.computeOutAndReduceShapes(u.shape,m),y=v.sizeFromShape(g),x=u;u.dtype!=="float32"&&(x=fs({backend:t,inputs:{x:u},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(x.dataId).id);let A=t.makeOutput(f,"float32");if(v.sizeFromShape(u.shape)!==0){let b=t.dataIdMap.get(A.dataId).id;Ow(l,y,b)}if(h&&t.disposeData(p.dataId),s){let b=C.expandShapeToKeepDim(A.shape,d);A.shape=b}return u.dtype!=="float32"&&t.disposeData(x.dataId),A}var lse={kernelName:lo,backendName:"wasm",setupFunc:ise,kernelFunc:ose},zw;function use(e){zw=e.wasm.cwrap(uo,null,["number","number","number","number"])}function dse(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=ms(i,r,t);if(h){let A=t.dataIdMap.get(p.dataId).id;A!==o&&(u=p,l=A)}let m=u.shape.length;C.assertAxesAreInnerMostDims("min",c,m);let[f,g]=C.computeOutAndReduceShapes(u.shape,c),y=v.sizeFromShape(g),x=t.makeOutput(f,u.dtype);if(v.sizeFromShape(u.shape)!==0){let A=t.dataIdMap.get(x.dataId).id;zw(l,nt[i.dtype],y,A)}if(h&&t.disposeData(p.dataId),s){let A=C.expandShapeToKeepDim(x.shape,d);x.shape=A}return x}var pse={kernelName:uo,backendName:"wasm",setupFunc:use,kernelFunc:dse},cse=!1,hse=Gt(po,cse),U1;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(U1||(U1={}));var Lw;function mse(e){Lw=e.wasm.cwrap(co,null,["number","array","number","number","array","array","number","number"])}function fse(e){let{inputs:{x:t},backend:a,attrs:{paddings:n,mode:r}}=e,s=n.map((m,f)=>m[0]+t.shape[f]+m[1]),i=a.dataIdMap.get(t.dataId).id,o=a.makeOutput(s,t.dtype),l=a.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),p=n.map(m=>m[0]),c=n.map(m=>m[1]),d=new Uint8Array(new Int32Array(p).buffer),h=new Uint8Array(new Int32Array(c).buffer);return Lw(i,u,t.shape.length,nt[t.dtype],d,h,U1[r],l),o}var gse={kernelName:co,backendName:"wasm",kernelFunc:fse,setupFunc:mse},Ww;function yse(e){Ww=e.wasm.cwrap(Uo,null,["number","number","number","number"])}function Bw(e){let{backend:t,inputs:{logits:a},attrs:{dim:n}}=e,r=t.dataIdMap.get(a.dataId).id,s=t.makeOutput(a.shape,a.dtype),i=t.dataIdMap.get(s.dataId).id,o=a.shape[n],l=v.sizeFromShape(a.shape)/o;return v.sizeFromShape(s.shape)===0||Ww(r,i,o,l),s}var xse={kernelName:Uo,backendName:"wasm",setupFunc:yse,kernelFunc:Bw},Vw;function Ase(e){Vw=e.wasm.cwrap(mo,null,["number","number","number","number","number","number"])}function bse(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n;if(r.dtype!=="float32")throw new Error(`Tensor logits must have dtype float32, got ${r.dtype}`);let l=o?r:Bw({inputs:{logits:r},backend:a,attrs:{dim:r.shape.length-1}}),[u,p]=l.shape,c=a.makeOutput([u,s],"int32");return Vw(a.dataIdMap.get(l.dataId).id,u,p,s,i,a.dataIdMap.get(c.dataId).id),o||a.disposeData(l.dataId),c}var vse={kernelName:mo,backendName:"wasm",setupFunc:Ase,kernelFunc:bse},wse=Gt(ho,!0),kse=!0,Ise=Gt(fo,kse),Sse=Qe(wu);function B3(e,t){let a=new Int32Array(e.wasm.HEAPU8.buffer,t,4),n=a[0],r=a[1],s=a[2],i=a[3];return e.wasm._free(t),{pSelectedIndices:n,selectedSize:r,pSelectedScores:s,pValidOutputs:i}}var Uw;function Cse(e){Uw=e.wasm.cwrap(yo,"number",["number","number","number","number","number"])}function Tse(e){let{backend:t,inputs:a,attrs:n}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i}=n,{boxes:o,scores:l}=a,u=t.dataIdMap.get(o.dataId).id,p=t.dataIdMap.get(l.dataId).id,c=Uw(u,p,s,r,i),{pSelectedIndices:d,selectedSize:h,pSelectedScores:m,pValidOutputs:f}=B3(t,c);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([h],"int32",d)}var Nse={kernelName:yo,backendName:"wasm",setupFunc:Cse,kernelFunc:Tse},Gw;function Rse(e){Gw=e.wasm.cwrap(ku,"number",["number","number","number","number","number","bool"])}function Ese(e){let{backend:t,inputs:a,attrs:n}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=n,{boxes:l,scores:u}=a,p=t.dataIdMap.get(l.dataId).id,c=t.dataIdMap.get(u.dataId).id,d=Gw(p,c,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=B3(t,d);t.wasm._free(f);let y=t.makeOutput([m],"int32",h),x=t.makeOutput([],"int32",g);return[y,x]}var Mse={kernelName:ku,backendName:"wasm",setupFunc:Rse,kernelFunc:Ese},Hw;function Pse(e){Hw=e.wasm.cwrap(xo,"number",["number","number","number","number","number","number"])}function _se(e){let{backend:t,inputs:a,attrs:n}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=n,{boxes:l,scores:u}=a,p=t.dataIdMap.get(l.dataId).id,c=t.dataIdMap.get(u.dataId).id,d=Hw(p,c,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=B3(t,d);t.wasm._free(g);let y=t.makeOutput([m],"int32",h),x=t.makeOutput([m],"float32",f);return[y,x]}var $se={kernelName:xo,backendName:"wasm",setupFunc:Pse,kernelFunc:_se},Fse=!1,Dse=Gt(go,Fse,"bool"),jw;function Ose(e){jw=e.wasm.cwrap(Ao,null,["number","number","number","number","number"])}function zse(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r}=t,{dtype:s,depth:i,onValue:o,offValue:l}=n,u=a.makeOutput([...r.shape,i],s),p=a.dataIdMap.get(u.dataId).id,c=a.dataIdMap.get(r.dataId).id;return jw(c,i,o,l,p),u}var Lse={kernelName:Ao,backendName:"wasm",setupFunc:Ose,kernelFunc:zse};function Wse(e){let{inputs:{x:t},backend:a}=e,n=a.makeOutput(t.shape,t.dtype);return a.typedArrayFromHeap(n).fill(1),n}var Bse={kernelName:Iu,backendName:"wasm",kernelFunc:Wse};function Vse(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n;if(t.length===1)return V1({inputs:{input:t[0]},backend:a,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(p=>{v.assertShapesMatch(s,p.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===p.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(p=>{let c=V1({inputs:{input:p},backend:a,attrs:{dim:r}});return o.push(c),c}),u=nw({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(p=>a.disposeData(p.dataId)),u}var Use={kernelName:Su,backendName:"wasm",kernelFunc:Vse},qw;function Gse(e){qw=e.wasm.cwrap(bo,null,["number","array","number","number","array","array","number","number"])}function Hse(e){let{inputs:{x:t},backend:a,attrs:{paddings:n,constantValue:r}}=e,s=n.map((m,f)=>m[0]+t.shape[f]+m[1]);if(v.sizeFromShape(t.shape)===0)return bw({backend:a,attrs:{shape:s,value:r,dtype:t.dtype}});let i=a.dataIdMap.get(t.dataId).id,o=a.makeOutput(s,t.dtype),l=a.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),p=n.map(m=>m[0]),c=n.map(m=>m[1]),d=new Uint8Array(new Int32Array(p).buffer),h=new Uint8Array(new Int32Array(c).buffer);return qw(i,u,t.shape.length,nt[t.dtype],d,h,r,l),o}var Xw={kernelName:bo,backendName:"wasm",kernelFunc:Hse,setupFunc:Gse},jse=!1,qse=Gt(vo,jse),Kw;function Xse(e){Kw=e.wasm.cwrap(wo,null,["number","number","number"])}function Kse(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t,s=a.dataIdMap.get(n.dataId).id,i=a.dataIdMap.get(r.dataId).id,o=s,l=n,u=l;l.dtype!=="float32"&&(u=fs({backend:a,inputs:{x:n},attrs:{dtype:"float32"}}),o=a.dataIdMap.get(u.dataId).id);let p=a.makeOutput(n.shape,"float32"),c=a.dataIdMap.get(p.dataId).id;return Kw(o,i,c),l.dtype!=="float32"&&a.disposeData(u.dataId),p}var Yse={kernelName:wo,backendName:"wasm",setupFunc:Xse,kernelFunc:Kse},Yw;function Zse(e){Yw=e.wasm.cwrap(ko,null,["number","number","number","number"])}function Jse(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=ms(i,r,t),m=c;if(h){let A=t.dataIdMap.get(p.dataId).id;A!==o&&(u=p,l=A,m=C.getInnerMostAxes(m.length,u.shape.length))}C.assertAxesAreInnerMostDims("prod",m,u.shape.length);let[f,g]=C.computeOutAndReduceShapes(u.shape,m),y=v.sizeFromShape(g),x=t.makeOutput(f,u.dtype);if(v.sizeFromShape(u.shape)!==0){let A=t.dataIdMap.get(x.dataId).id;Yw(l,y,nt[x.dtype],A)}if(h&&t.disposeData(p.dataId),s){let A=C.expandShapeToKeepDim(x.shape,d);x.shape=A}return x}var Qse={kernelName:ko,backendName:"wasm",setupFunc:Zse,kernelFunc:Jse},eie=e=>{let{backend:t,attrs:a}=e,{start:n,stop:r,step:s,dtype:i}=a,o=g3(n,r,s,i),l=t.makeOutput([o.length],i);return t.typedArrayFromHeap(l).set(o),l},tie={kernelName:Cu,backendName:"wasm",kernelFunc:eie},aie=!0,nie=Gt(Pi,aie),rie=Qe(Io),sie=Qe(So),iie=Qe(No),Zw;function oie(e){Zw=e.wasm.cwrap(To,null,["number","number","number","number","number","number","number","number","number","number"])}function lie(e){let{backend:t,inputs:a,attrs:n}=e,{images:r}=a,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,[p,c,d,h]=r.shape,m=[p,l,u,h],f=t.dataIdMap.get(r.dataId),g;f.dtype!=="float32"&&(g=fs({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(g.dataId));let y=f.id,x=t.makeOutput(m,"float32");if(v.sizeFromShape(r.shape)===0)return x;let A=t.dataIdMap.get(x.dataId).id;return Zw(y,p,c,d,h,l,u,s?1:0,i?1:0,A),g!=null&&t.disposeData(g.dataId),x}var uie={kernelName:To,backendName:"wasm",setupFunc:oie,kernelFunc:lie},Jw;function die(e){Jw=e.wasm.cwrap(Ru,null,["number","number","number","array","array","boolean"])}function pie(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=a.makeOutput(r.shape,"float32"),l=a.dataIdMap.get(r.dataId),u;return l.dtype!=="float32"&&(u=fs({backend:a,inputs:{x:r},attrs:{dtype:"float32"}}),l=a.dataIdMap.get(u.dataId)),Jw(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(o.dataId).id,new Uint8Array(new Int32Array(r.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),i),u!=null&&a.disposeData(u.dataId),o}var cie={kernelName:Ru,backendName:"wasm",setupFunc:die,kernelFunc:pie},Qw;function hie(e){Qw=e.wasm.cwrap(Co,null,["number","number","number","number","number","number","number","number","number","number"])}function mie(e){let{backend:t,inputs:a,attrs:n}=e,{images:r}=a,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,[p,c,d,h]=r.shape,m=[p,l,u,h],f=t.makeOutput(m,"float32");if(v.sizeFromShape(r.shape)===0)return f;let g=t.dataIdMap.get(r.dataId),y;g.dtype!=="float32"&&(y=fs({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),g=t.dataIdMap.get(y.dataId));let x=g.id,A=t.dataIdMap.get(f.dataId).id;return Qw(x,p,c,d,h,l,u,s?1:0,i?1:0,A),y!=null&&t.disposeData(y.dataId),f}var fie={kernelName:Co,backendName:"wasm",setupFunc:hie,kernelFunc:mie},ek;function gie(e){ek=e.wasm.cwrap(Nu,null,["number","number","number","array","array","boolean"])}function yie(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=a.makeOutput(r.shape,"float32"),l=a.dataIdMap.get(r.dataId),u;return l.dtype!=="float32"&&(u=fs({backend:a,inputs:{x:r},attrs:{dtype:"float32"}}),l=a.dataIdMap.get(u.dataId)),ek(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(o.dataId).id,new Uint8Array(new Int32Array(r.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),i),u!=null&&a.disposeData(u.dataId),o}var xie={kernelName:Nu,backendName:"wasm",setupFunc:gie,kernelFunc:yie},tk;function Aie(e){tk=e.wasm.cwrap(Ro,null,["number","array","number","array","number","number"])}function bie(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n,i=v.parseAxisParam(s,r.shape);if(r.shape.length===0)return o0({inputs:{x:r},backend:a});let o=a.makeOutput(r.shape,r.dtype),l=a.dataIdMap.get(r.dataId).id,u=a.dataIdMap.get(o.dataId).id,p=new Uint8Array(new Int32Array(i).buffer),c=new Uint8Array(new Int32Array(r.shape).buffer);tk(l,p,i.length,c,r.shape.length,u);let d=La({inputs:{x:o},attrs:{shape:r.shape},backend:a});return a.disposeData(o.dataId),d}var vie={kernelName:Ro,backendName:"wasm",kernelFunc:bie,setupFunc:Aie},ak;function wie(e){ak=e.wasm.cwrap(Jo,null,["number","number","number","number","number","number","number","number","array","number","number"])}function kie(e){let{inputs:t,backend:a,attrs:n}=e,{image:r}=t,{radians:s,fillValue:i,center:o}=n,l=a.makeOutput(r.shape,r.dtype),u=a.dataIdMap.get(r.dataId).id,p=a.dataIdMap.get(l.dataId).id,[c,d,h,m]=r.shape,[f,g]=C.getImageCenter(o,d,h),y=i===0,x=255,A=typeof i=="number"?[i,i,i,y?0:x]:[...i,x],b=new Uint8Array(new Int32Array(A).buffer);return ak(u,c,d,h,m,s,f,g,b,A.length,p),l}var Iie={kernelName:Jo,backendName:"wasm",kernelFunc:kie,setupFunc:wie},Sie=Qe(Eo),Cie=Qe(Mo),nk;function Tie(e){nk=e.wasm.cwrap(Po,null,["number","number","number","number","number","number","array","number","number"])}function Nie(e){let{backend:t,inputs:a,attrs:n}=e,{indices:r,updates:s}=a,{shape:i}=n,o=t.makeOutput(i,s.dtype);if(v.sizeFromShape(i)===0)return o;let{sliceRank:l,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=Hh.calculateShapes(s,r,i),h=t.dataIdMap.get(r.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(c).buffer),g=t.dataIdMap.get(o.dataId).id;return nk(h,m,nt[s.dtype],l,u,p,f,d,g),o}var Rie={kernelName:Po,backendName:"wasm",setupFunc:Tie,kernelFunc:Nie},rk;function Eie(e){rk=e.wasm.cwrap($o,null,["number","number","number","number","number","number","bool","number"])}function Mie(e){let{inputs:t,backend:a,attrs:n}=e,{sortedSequence:r,values:s}=t,{side:i}=n;if(r.dtype!==s.dtype)throw new Error(`SearchSorted error: sorted_sequence must have the same dtype as values. Got ${r.dtype} and ${s.dtype}`);let o=a.makeOutput(s.shape,"int32");function l(u){return a.dataIdMap.get(u.dataId).id}return rk(l(r),l(s),r.shape[0],r.shape[1],s.shape[1],nt[r.dtype],i==="left",l(o)),o}var Pie={kernelName:$o,backendName:"wasm",setupFunc:Eie,kernelFunc:Mie},sk;function _ie(e){sk=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function $ie(e){let{inputs:t,backend:a}=e,{condition:n,t:r,e:s}=t,i=a.dataIdMap.get(n.dataId).id,o=a.dataIdMap.get(r.dataId).id,l=a.dataIdMap.get(s.dataId).id,u=a.makeOutput(r.shape,r.dtype),p=a.dataIdMap.get(u.dataId).id,c=n.shape.length,d=r.shape.length,h=c===0||c>1||d===1?1:v.sizeFromShape(r.shape.slice(1));return sk(i,o,l,h,p),u}var Fie={kernelName:Eu,backendName:"wasm",kernelFunc:$ie,setupFunc:_ie},Die=Qe(Fo),ik;function Oie(e){ik=e.wasm.cwrap(Lo,null,["number","number"])}function zie(e){let{backend:t,inputs:{x:a}}=e,n=t.dataIdMap.get(a.dataId).id,r=t.makeOutput(a.shape,a.dtype),s=t.dataIdMap.get(r.dataId).id;return v.sizeFromShape(r.shape)===0||ik(n,s),r}var Lie={kernelName:"Sigmoid",backendName:"wasm",setupFunc:Oie,kernelFunc:zie},Wie=Qe(zo),Bie=Qe(Do),Vie=Qe(Oo),Uie=Qe(Wo);function Gie(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,paddings:i}=n,o=v.sizeFromShape(s),l=[[0,0]];l.push(...i);for(let g=1+s.length;g{let M=b.shape[0],F=b.shape[1],E=I.segment_util.segOpComputeOptimalWindowSize(F,N),T={windowSize:E,inSize:F,batchSize:M,numSegments:N},D=new yae(T,w),O=a.compileAndRun(D,[b,S],C);if(l.push(O),O.shape[1]===N)return O;let W=l8({backend:a,attrs:{start:0,stop:N,step:1,dtype:"float32"}}),$=u8({inputs:{x:W},backend:a,attrs:{reps:[F/E]}});return l.push(W),l.push($),g(O,w,$,C,N)},y=g(m,"unsortedSegmentSum",s,f,i),x=pe({inputs:{x:y},backend:a,attrs:{shape:p}}),A=x;if(d!=null){l.push(x);let b=I.getUndoAxesPermutation(d);A=Ta({inputs:{x:A},backend:a,attrs:{perm:b}})}return l.forEach(b=>a.disposeIntermediateTensorInfo(b)),A}var Aae={kernelName:_p,backendName:"webgl",kernelFunc:xae},bae=[nX,sX,lX,pX,hX,gX,xX,bX,IX,TX,RX,FX,PX,LX,VX,GX,jX,YX,JX,eK,rK,pK,hK,yK,AK,SK,CK,MK,Wq,DK,LK,UK,KK,JK,eY,aY,rY,lY,pY,mY,gY,xY,bY,kY,SY,RY,MY,DY,OY,LY,UY,qY,ZY,eZ,nZ,rZ,iZ,lZ,dZ,cZ,mZ,xZ,vZ,IZ,TZ,RZ,FZ,_Z,WZ,Lq,VZ,OK,HZ,XZ,ZZ,Vq,tJ,sJ,oJ,pJ,mJ,xJ,vJ,SJ,RJ,FJ,DJ,zJ,WJ,VJ,jJ,XJ,YJ,JJ,eQ,rQ,lQ,cQ,bQ,Hq,IQ,CQ,EQ,$Q,vK,_Q,zQ,WQ,UQ,qQ,Gq,KQ,ZQ,QQ,tee,aee,wK,gQ,see,uee,hee,qq,yee,bee,Iee,Cee,Mee,$ee,_ee,Lee,Vee,Hee,Xee,Zee,tte,rte,lte,pte,uK,xQ,mte,gte,xte,bte,wte,Ite,Tte,Nte,Ete,$te,Pte,Ote,Lte,Vte,Gte,jte,Xte,yQ,eX,Zte,eae,aae,sae,uae,cae,tX,mae,gae,Aae,OQ];for(let e of bae)bn(e);var nt;(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"})(nt||(nt={}));var dp;(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",e[e.elu=6]="elu"})(dp||(dp={}));var d8;function vae(e){d8=e.wasm.cwrap(ts,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function wae(e){let{inputs:t,backend:a,attrs:n}=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:u,activation:d,leakyreluAlpha:c}=n,p=a.dataIdMap.get(r.dataId).id,h=a.dataIdMap.get(s.dataId).id,m=0;if(i!=null){let N=a.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:a.dataIdMap.get(o.dataId).id,g=dp[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`);let y=l?r.shape[2]:r.shape[1],x=u?s.shape[1]:s.shape[2],A=ul.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)),b=a.makeOutput([...A,y,x],r.dtype),w=a.dataIdMap.get(b.dataId).id,S=new Uint8Array(new Int32Array(r.shape).buffer),C=new Uint8Array(new Int32Array(s.shape).buffer);return d8(p,S,r.shape.length,h,C,s.shape.length,l,u,g,m,f,c||0,w),b}var kae={kernelName:ts,backendName:"wasm",setupFunc:vae,kernelFunc:wae};function Qe(e,t){let a;function n(s){a=s.wasm.cwrap(e,null,["number","number","number"])}function r(s){let{backend:i,inputs:{x:o}}=s,l=i.dataIdMap.get(o.dataId).id,u=i.makeOutput(o.shape,t||o.dtype),d=i.dataIdMap.get(u.dataId).id;return v.sizeFromShape(u.shape)===0||a(l,nt[o.dtype],d),u}return{kernelName:e,backendName:"wasm",setupFunc:n,kernelFunc:r}}var Iae=Qe(cu),Sae=Qe($i),Tae=Qe(Di);function Gt(e,t,a){let n;function r(i){n=i.wasm.cwrap(e,null,["number","array","number","number","array","number","number","number"])}function s(i){let{backend:o,inputs:l}=i,{a:u,b:d}=l,c=o.dataIdMap.get(u.dataId).id,p=o.dataIdMap.get(d.dataId).id,h=a!=null?a:u.dtype,m=I.assertAndGetBroadcastShape(u.shape,d.shape),f=o.makeOutput(m,h);if(v.sizeFromShape(m)===0)return f;let g=new Uint8Array(new Int32Array(u.shape).buffer),y=new Uint8Array(new Int32Array(d.shape).buffer),x=o.dataIdMap.get(f.dataId).id;return n(c,g,u.shape.length,p,y,d.shape.length,nt[u.dtype],x),f}return{kernelName:e,backendName:"wasm",setupFunc:r,kernelFunc:s}}var Cae=!0,Nae=Gt(Mr,Cae),p8;function Rae(e){p8=e.wasm.cwrap(Pi,null,["array","number","number","number"])}function Eae(e){let{inputs:t,backend:a}=e,n=a.makeOutput(t[0].shape,t[0].dtype);if(v.sizeFromShape(n.shape)===0)return n;let r=t.map(o=>a.dataIdMap.get(o.dataId).id),s=new Uint8Array(new Int32Array(r).buffer),i=a.dataIdMap.get(n.dataId).id;return p8(s,r.length,nt[n.dtype],i),n}var Mae={kernelName:Pi,backendName:"wasm",setupFunc:Rae,kernelFunc:Eae};function m0(e){let{inputs:{x:t},backend:a}=e;if(t.dtype==="string")return Ve(a.readSync(t.dataId),t.shape,t.dtype);let n=a.makeOutput(t.shape,t.dtype),r=a.typedArrayFromHeap(t);return a.typedArrayFromHeap(n).set(r),n}var Fae={kernelName:ho,backendName:"wasm",kernelFunc:m0},c8;function $ae(e){c8=e.wasm.cwrap(Tr,null,["number","array","number","number","number","array","number"])}function ps(e){let{inputs:t,backend:a,attrs:n}=e,[r,s]=Pae(t.x.shape,n.perm),i=!0;for(let m=0;m=r&&(s===-1||n[s]>n[i])&&(s=i);n[s]=r}return[a,n]}var _ae={kernelName:Tr,backendName:"wasm",kernelFunc:ps,setupFunc:$ae};function Ls(e,t,a){let n=e.shape,r=e.shape.length,s=v.parseAxisParam(t,n),i=s,o=I.getAxesPermutation(i,r),l=null,u=!1;if(o!=null){let d=new Array(r);for(let p=0;p`new shape: ${i}, old shape: ${n.shape}. New shape and old shape must have the same number of elements.`),e.backend.incRef(n.dataId),{dataId:n.dataId,shape:i,dtype:n.dtype}}var lne={kernelName:Du,backendName:"wasm",kernelFunc:La},b8;function une(e){b8=e.wasm.cwrap(Gi,null,["number","array","number","number","array","number","number","number","number"])}function dne(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;if(r.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let l=r.shape.length,u=s.shape.length,d=i?r.shape[l-2]:r.shape[l-1],c=o?s.shape[u-1]:s.shape[u-2],p=i?r.shape[l-1]:r.shape[l-2],h=o?s.shape[u-2]:s.shape[u-1],m=r.shape.slice(0,-2),f=s.shape.slice(0,-2),g=v.sizeFromShape(m),y=v.sizeFromShape(f),x=ul.assertAndGetBroadcastShape(r.shape.slice(0,-2),s.shape.slice(0,-2)).concat([p,h]);v.assert(d===c,()=>`Error in matMul: inner shapes (${d}) and (${c}) of Tensors with shapes ${r.shape} and ${s.shape} and transposeA=${i} and transposeB=${o} must match.`);let A=i?[g,d,p]:[g,p,d],b=o?[y,h,c]:[y,c,h],w=La({inputs:{x:r},backend:a,attrs:{shape:A}}),S=La({inputs:{x:s},backend:a,attrs:{shape:b}}),C=a.dataIdMap.get(w.dataId).id,N=a.dataIdMap.get(S.dataId).id,M=i?w.shape[2]:w.shape[1],F=o?S.shape[1]:S.shape[2],E=Math.max(g,y),T=a.makeOutput([E,M,F],w.dtype),D=a.dataIdMap.get(T.dataId).id,O=new Uint8Array(new Int32Array(w.shape).buffer),W=new Uint8Array(new Int32Array(S.shape).buffer);return b8(C,O,w.shape.length,N,W,S.shape.length,i,o,D),a.disposeData(w.dataId),a.disposeData(S.dataId),T.shape=x,T}var pne={kernelName:Gi,backendName:"wasm",setupFunc:une,kernelFunc:dne};function Mi(e){let{inputs:{x:t},attrs:{begin:a,size:n},backend:r}=e,[s,i]=wt.parseSliceParams(t,a,n),o=wt.isSliceContinous(t.shape,s,i),l=r.readSync(t.dataId),u=r.makeOutput(i,t.dtype),d=v.computeStrides(t.shape),c=r.dataIdMap.get(u.dataId);if(o){let m=wt.computeFlatOffset(s,d);return t.dtype==="string"?c.stringBytes=l.slice(m,m+v.sizeFromShape(i)):r.typedArrayFromHeap(u).set(l.subarray(m,m+v.sizeFromShape(i))),u}if(t.dtype==="string"){let m=Sh(l,s,i,t.shape,t.dtype);return c.stringBytes=m,u}let p=r.typedArrayFromHeap(u),h=t.shape.length;if(h===2)cne(l,d[0],p,s,i);else if(h===3)hne(l,d[0],d[1],p,s,i);else if(h===4)mne(l,d[0],d[1],d[2],p,s,i);else{let m=Sh(l,s,i,t.shape,t.dtype);p.set(m)}return u}function cne(e,t,a,n,r){let s=0,i=n[0],o=n[1],l=i+r[0];for(let u=i;uy*x),l=I.getReshaped(r.shape,s,o),u=I.getPermuted(l.length,s.length),d=I.getReshapedPermuted(r.shape,s,o),c=I.getSliceBeginCoords(i,s.length),p=I.getSliceSize(d,i,s.length),h=La({inputs:{x:r},backend:a,attrs:{shape:l}}),m=ps({inputs:{x:h},backend:a,attrs:{perm:u}}),f=La({inputs:{x:m},backend:a,attrs:{shape:d}}),g=Mi({inputs:{x:f},backend:a,attrs:{begin:c,size:p}});return a.disposeData(h.dataId),a.disposeData(m.dataId),a.disposeData(f.dataId),g}var yne={kernelName:gu,backendName:"wasm",kernelFunc:gne},v8;function xne(e){v8=e.wasm.cwrap(Hi,null,["number","number","boolean","number","number","number"])}function Ane(e){let{backend:t,inputs:a,attrs:n}=e,{x:r,weights:s}=a,{size:i}=n,o=s.shape.reduce((c,p)=>c*p,1)!==0,l=r.shape.length===1?[i]:[r.shape[0],i],u=t.makeOutput(l,s.dtype);function d(c){return t.dataIdMap.get(c.dataId).id}return v8(d(r),i,o,d(s),nt[s.dtype],d(u)),u}var bne={kernelName:Hi,backendName:"wasm",setupFunc:xne,kernelFunc:Ane},vne=!0,wne=Gt(ji,vne);function kne(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t,s=a.typedArrayFromHeap(n),i=a.typedArrayFromHeap(r),o=I.assertAndGetBroadcastShape(Array.from(s),Array.from(i));return a.makeOutput([o.length],"int32",void 0,new Int32Array(o))}var Ine={kernelName:yu,backendName:"wasm",kernelFunc:kne};function Ws(e){let{inputs:{x:t},attrs:{dtype:a},backend:n}=e,r=n.makeOutput(t.shape,a),s=n.typedArrayFromHeap(t);return n.typedArrayFromHeap(r).set(s),r}var Sne={kernelName:qi,backendName:"wasm",kernelFunc:Ws},Tne=Qe(cs),w8;function Cne(e){w8=e.wasm.cwrap(hs,null,["number","number","number","number"])}function Nne(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=n,o=a.dataIdMap.get(r.dataId).id,l=a.makeOutput(r.shape,r.dtype),u=a.dataIdMap.get(l.dataId).id;return w8(o,s,i,u),l}var Rne={kernelName:hs,backendName:"wasm",setupFunc:Cne,kernelFunc:Nne};function k8(e){let{inputs:t,backend:a}=e,n=v.parseAxisParam(e.attrs.axis,t[0].shape)[0],r=t.map(h=>h.shape);I.assertParamsConsistent(r,n);let s=I.computeOutShape(t.map(h=>h.shape),n),i=t.filter(h=>v.sizeFromShape(h.shape)>0);if(i.length===1)return m0({inputs:{x:i[0]},backend:a});let o=a.makeOutput(s,t[0].dtype);if(v.sizeFromShape(s)===0)return o;if(i[0].dtype==="string"){let h=i.map(A=>{let b=[-1,v.sizeFromShape(A.shape.slice(n))];return La({inputs:{x:A},backend:a,attrs:{shape:b}})}),m=h.map(A=>({vals:a.readSync(A.dataId),shape:A.shape}));s=I.computeOutShape(h.map(A=>A.shape),1);let f=h[0].shape[0]===1,g=k3(m,s,t[0].dtype,f),y=I.computeOutShape(i.map(A=>A.shape),n);o.shape=y;let x=a.dataIdMap.get(o.dataId);return x.stringBytes=I.fromStringArrayToUint8(g),h.forEach(A=>a.disposeData(A.dataId)),o}let l=v.sizeFromShape(i[0].shape.slice(0,n)),u=0,d=i.map(h=>{let m=v.sizeFromShape(h.shape.slice(n));return u+=m,m}),c=i.map(h=>a.typedArrayFromHeap(h)),p=a.typedArrayFromHeap(o);for(let h=0;h`cumprod does not support ${r.dtype} tensors in the WASM backend`);let u=I.getAxesPermutation([s],l),d=r;u!==null&&(d=ps({inputs:{x:r},attrs:{perm:u},backend:a}));let c=I.getInnerMostAxes(1,l)[0];I.assertAxesAreInnerMostDims("cumprod",[c],l);let p=a.makeOutput(d.shape,d.dtype),h=d.shape[c],m=a.dataIdMap.get(d.dataId).id,f=a.dataIdMap.get(p.dataId).id;E8(m,i?1:0,o?1:0,h,f,nt[r.dtype]);let g=p;if(u!==null){let y=I.getUndoAxesPermutation(u);g=ps({inputs:{x:p},attrs:{perm:y},backend:a}),a.disposeData(d.dataId),a.disposeData(p.dataId)}return g}var Qne={kernelName:eo,backendName:"wasm",setupFunc:Zne,kernelFunc:Jne},M8;function ere(e){M8=e.wasm.cwrap(to,null,["number","number","number","number","number","number"])}function tre(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n,l=r.shape.length;v.assert(r.dtype==="float32"||r.dtype==="int32",()=>`cumsum does not support ${r.dtype} tensors in the WASM backend`);let u=I.getAxesPermutation([s],l),d=r;u!==null&&(d=ps({inputs:{x:r},attrs:{perm:u},backend:a}));let c=I.getInnerMostAxes(1,l)[0];I.assertAxesAreInnerMostDims("cumsum",[c],l);let p=a.makeOutput(d.shape,d.dtype),h=d.shape[c],m=a.dataIdMap.get(d.dataId).id,f=a.dataIdMap.get(p.dataId).id;M8(m,i?1:0,o?1:0,h,f,nt[r.dtype]);let g=p;if(u!==null){let y=I.getUndoAxesPermutation(u);g=ps({inputs:{x:p},attrs:{perm:y},backend:a}),a.disposeData(d.dataId),a.disposeData(p.dataId)}return g}var are={kernelName:to,backendName:"wasm",setupFunc:ere,kernelFunc:tre},F8;function nre(e){F8=e.wasm.cwrap("DenseBincount",null,["number","array","number","number","boolean","number","number","boolean","number"])}function rre(e){let{backend:t,inputs:a,attrs:n}=e,{x:r,weights:s}=a,{size:i,binaryOutput:o}=n,l=s.shape.reduce((p,h)=>p*h,1)!==0,u=r.shape.length===1?[i]:[r.shape[0],i],d=t.makeOutput(u,s.dtype);function c(p){return t.dataIdMap.get(p.dataId).id}return F8(c(r),new Uint8Array(new Int32Array(r.shape).buffer),r.shape.length,i,l,c(s),nt[s.dtype],o,c(d)),d}var sre={kernelName:bu,backendName:"wasm",setupFunc:nre,kernelFunc:rre},$8;function ire(e){$8=e.wasm.cwrap(no,null,["number","number","number","array","number","array","array","number","number"])}function ore(e){let{backend:t,inputs:a,attrs:n}=e,{x:r}=a,{blockSize:s,dataFormat:i}=n,o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],d=i==="NHWC"?r.shape[3]:r.shape[1],c=l*s,p=u*s,h=d/(s*s),m=i==="NHWC"?[o,c,p,h]:[o,h,c,p],f=t.makeOutput(m,"float32"),g=t.dataIdMap.get(r.dataId).id,y=new Uint8Array(new Int32Array(v.computeStrides(r.shape)).buffer),x=new Uint8Array(new Int32Array(m).buffer),A=new Uint8Array(new Int32Array(v.computeStrides(m)).buffer),b=t.dataIdMap.get(f.dataId).id;return $8(g,s,i==="NHWC"?1:0,y,r.shape.length-1,x,A,m.length,b),f}var lre={kernelName:no,backendName:"wasm",setupFunc:ire,kernelFunc:ore},D8;function ure(e){D8=e.wasm.cwrap(ro,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function dre(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s}=t,i=n.dataIdMap.get(r.dataId).id,o=n.dataIdMap.get(s.dataId).id,{strides:l,dilations:u,pad:d,dimRoundingMode:c}=a,p=u==null?[1,1]:u,h=I.computeConv2DInfo(r.shape,s.shape,l,p,d,c,!0),m=h.filterHeight,f=h.filterWidth,g=h.padInfo.top,y=h.padInfo.right,x=h.padInfo.bottom,A=h.padInfo.left,b=h.dilationHeight,w=h.dilationWidth,S=h.strideHeight,C=h.strideWidth,N=h.inChannels,M=h.outChannels,F=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 E=n.makeOutput(h.outShape,"float32"),T=n.dataIdMap.get(E.dataId).id;return D8(i,r.shape[0],r.shape[1],r.shape[2],o,m,f,g,y,x,A,F,b,w,S,C,N,M,T),E}var pre={kernelName:ro,backendName:"wasm",setupFunc:ure,kernelFunc:dre},P8;function cre(e){P8=e.wasm.cwrap("Diag",null,["number","number","number","number"])}function hre(e){let{inputs:t,backend:a}=e,{x:n}=t,r=v.sizeFromShape(n.shape),s=a.makeOutput([...n.shape,...n.shape],n.dtype);return P8(a.dataIdMap.get(n.dataId).id,nt[n.dtype],r,a.dataIdMap.get(s.dataId).id),s}var mre={kernelName:vu,backendName:"wasm",setupFunc:cre,kernelFunc:hre},_8;function fre(e){_8=e.wasm.cwrap(so,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function gre(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n;if(r.dtype!==s.dtype)throw new Error(`Dilation2D error: x must have the same dtype as filter. Got ${r.dtype} and ${s.dtype}`);let u=I.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),d=a.makeOutput(u.outShape,r.dtype);return _8(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(d.dataId).id,nt[r.dtype],u.batchSize,u.inChannels,u.inHeight,u.inWidth,u.outHeight,u.outWidth,u.strideHeight,u.strideWidth,u.dilationHeight,u.dilationWidth,u.filterHeight,u.filterWidth,u.padInfo.top,u.padInfo.left),d}var yre={kernelName:so,backendName:"wasm",setupFunc:fre,kernelFunc:gre},O8;function xre(e){O8=e.wasm.cwrap(Ql,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Are(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n;if(r.dtype!==s.dtype||r.dtype!==i.dtype)throw new Error(`Dilation2DBackpropFilter error: x must have the same dtype as filter and dy. Got ${r.dtype}, ${s.dtype}, and ${i.dtype}`);let d=I.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=a.makeOutput(s.shape,s.dtype);return O8(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(i.dataId).id,a.dataIdMap.get(c.dataId).id,nt[r.dtype],d.batchSize,d.inChannels,d.inHeight,d.inWidth,d.outHeight,d.outWidth,d.strideHeight,d.strideWidth,d.dilationHeight,d.dilationWidth,d.filterHeight,d.filterWidth,d.padInfo.top,d.padInfo.left),c}var bre={kernelName:Ql,backendName:"wasm",setupFunc:xre,kernelFunc:Are},z8;function vre(e){z8=e.wasm.cwrap(Jl,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function wre(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n;if(r.dtype!==s.dtype||r.dtype!==i.dtype)throw new Error(`Dilation2DBackpropInput error: x must have the same dtype as filter and dy. Got ${r.dtype}, ${s.dtype}, and ${i.dtype}`);let d=I.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=a.makeOutput(r.shape,r.dtype);return z8(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(i.dataId).id,a.dataIdMap.get(c.dataId).id,nt[r.dtype],d.batchSize,d.inChannels,d.inHeight,d.inWidth,d.outHeight,d.outWidth,d.strideHeight,d.strideWidth,d.dilationHeight,d.dilationWidth,d.filterHeight,d.filterWidth,d.padInfo.top,d.padInfo.left),c}var kre={kernelName:Jl,backendName:"wasm",setupFunc:vre,kernelFunc:wre},Ire=Qe(oo),L8;function Sre(e){L8=e.wasm.cwrap(wu,null,["number","number","number"])}function Tre(e){let{inputs:t,backend:a}=e,{dy:n,y:r}=t,s=a.makeOutput(r.shape,"float32"),i=o=>a.dataIdMap.get(o.dataId).id;return L8(i(r),i(n),i(s)),s}var Cre={kernelName:wu,backendName:"wasm",setupFunc:Sre,kernelFunc:Tre},Nre=!1,Rre=Gt(ms,Nre,"bool"),Ere=Qe(lo),Mre=Qe(fs,"float32");function K1(e){let{inputs:t,attrs:a,backend:n}=e,{input:r}=t,{dim:s}=a,i=r.shape.length,o=r.shape.slice(),l=s;return s<0&&(v.assert(-(i+1)<=s,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+s+1),o.splice(l,0,1),La({inputs:{x:r},backend:n,attrs:{shape:o}})}var Fre={kernelName:ku,backendName:"wasm",kernelFunc:K1},$re=Qe(gs,"float32");function W8(e){let{attrs:{shape:t,value:a},backend:n}=e,{attrs:{dtype:r}}=e;r=r||v.inferDtype(a);let s=n.makeOutput(t,r);return n.typedArrayFromHeap(s).fill(a),s}var Dre={kernelName:Iu,backendName:"wasm",kernelFunc:W8},B8;function Pre(e){B8=e.wasm.cwrap(uo,null,["number","number","number","number","number","number"])}function _re(e){let{inputs:t,backend:a}=e,{image:n}=t,r=a.makeOutput(n.shape,n.dtype),s=a.dataIdMap.get(n.dataId).id,i=a.dataIdMap.get(r.dataId).id,[o,l,u,d]=n.shape;return B8(s,o,l,u,d,i),r}var Ore={kernelName:uo,backendName:"wasm",kernelFunc:_re,setupFunc:Pre},zre=Qe(ys),Lre=!1,Wre=Gt(xs,Lre),V8;function Bre(e){V8=e.wasm.cwrap(po,null,["number","number","number","number","number","number","number"])}function Vre(e){let{backend:t,inputs:a,attrs:n}=e,{varianceEpsilon:r}=n,{x:s,mean:i,variance:o,offset:l,scale:u}=a,d=t.dataIdMap.get(s.dataId).id,c=t.dataIdMap.get(i.dataId).id,p=t.dataIdMap.get(o.dataId).id,h=l!=null?t.dataIdMap.get(l.dataId).id:0,m=u!=null?t.dataIdMap.get(u.dataId).id:0,f=t.makeOutput(s.shape,s.dtype);if(v.sizeFromShape(s.shape)===0)return f;let g=t.dataIdMap.get(f.dataId).id;return V8(d,c,p,h,m,r,g),f}var Ure={kernelName:po,backendName:"wasm",setupFunc:Bre,kernelFunc:Vre},U8;function Gre(e){U8=e.wasm.cwrap(as,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 Hre(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:d,dataFormat:c,dimRoundingMode:p,activation:h,leakyreluAlpha:m}=a,f=I.computeConv2DInfo(r.shape,s.shape,l,d,u,p),g=dp[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedConv2D in the wasm backend.`);let y=n.dataIdMap.get(r.dataId).id,x=n.dataIdMap.get(s.dataId).id,A=f.outChannels,b=0;if(i!=null){let X=n.dataIdMap.get(i.dataId);if(X.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${X.shape.length}.`);if(X.shape[0]!==A)throw new Error(`FusedConv2D bias shape (${X.shape}) does not match the number of output channels (${A})`);b=X.id}let w=f.filterHeight,S=f.filterWidth,C=f.padInfo.top,N=f.padInfo.right,M=f.padInfo.bottom,F=f.padInfo.left,E=f.dilationHeight,T=f.dilationWidth,D=f.strideHeight,O=f.strideWidth,W=f.inChannels,$=f.padInfo.type==="SAME"?1:0,U=f.batchSize,G=f.inHeight,q=f.inWidth;if(c!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let H=n.makeOutput(f.outShape,"float32"),V=n.dataIdMap.get(H.dataId).id,Z=o==null?0:n.dataIdMap.get(o.dataId).id;return U8(y,U,G,q,x,w,S,b,C,N,M,F,$,E,T,D,O,W,A,g,Z,m||0,V),H}var jre={kernelName:as,backendName:"wasm",setupFunc:Gre,kernelFunc:Hre},G8;function qre(e){G8=e.wasm.cwrap(ns,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 Xre(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:d,dataFormat:c,dimRoundingMode:p,activation:h,leakyreluAlpha:m}=a,f=I.computeConv2DInfo(r.shape,s.shape,l,d,u,p,!0),g=dp[h];if(g==null)throw new Error(`${h} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let y=n.dataIdMap.get(r.dataId).id,x=n.dataIdMap.get(s.dataId).id,A=f.outChannels,b=0;if(i!=null){let X=n.dataIdMap.get(i.dataId);if(X.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${X.shape.length}.`);if(X.shape[0]!==A)throw new Error(`FusedDepthwiseConv2D bias shape (${X.shape}) does not match the number of output channels (${A})`);b=X.id}let w=f.filterHeight,S=f.filterWidth,C=f.padInfo.top,N=f.padInfo.right,M=f.padInfo.bottom,F=f.padInfo.left,E=f.dilationHeight,T=f.dilationWidth,D=f.strideHeight,O=f.strideWidth,W=f.inChannels,$=f.padInfo.type==="SAME"?1:0,U=f.batchSize,G=f.inHeight,q=f.inWidth;if(c!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let H=n.makeOutput(f.outShape,"float32"),V=n.dataIdMap.get(H.dataId).id,Z=o==null?0:n.dataIdMap.get(o.dataId).id;return G8(y,U,G,q,x,w,S,b,C,N,M,F,$,E,T,D,O,W,A,g,Z,m||0,V),H}var Kre={kernelName:ns,backendName:"wasm",setupFunc:qre,kernelFunc:Xre},H8;function Yre(e){H8=e.wasm.cwrap(co,null,["number","number","number","number","number","number","array","number"])}function Zre(e){let{backend:t,inputs:a}=e,{params:n,indices:r}=a,[s,i,o,l]=h3.prepareAndValidate(n,r),u=t.makeOutput(s,n.dtype);if(i===0)return u;let d=r.shape,c=d[d.length-1],p=t.dataIdMap.get(n.dataId).id,h=t.dataIdMap.get(r.dataId).id,m=new Uint8Array(new Int32Array(l).buffer),f=t.dataIdMap.get(u.dataId).id;return H8(p,nt[n.dtype],h,i,c,o,m,f),u}var Jre={kernelName:co,backendName:"wasm",setupFunc:Yre,kernelFunc:Zre},j8;function Qre(e){j8=e.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function ese(e){let{backend:t,inputs:a,attrs:n}=e,{x:r,indices:s}=a,{axis:i,batchDims:o}=n,l=v.parseAxisParam(i,r.shape)[0],u=t.readSync(s.dataId),d=r.shape[l];for(let C=0;C=0,()=>`GatherV2: the index value ${N} is not in [0, ${d-1}]`)}let c=I.segment_util.collectGatherOpShapeInfo(r,s,l,o),p=La({inputs:{x:r},attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]},backend:t}),h=v.sizeFromShape(s.shape),m=La({inputs:{x:s},attrs:{shape:[c.batchSize,h/c.batchSize]},backend:t}),f=[c.batchSize,c.outerSize,h/c.batchSize,c.sliceSize],g=t.makeOutput(f,r.dtype);if(v.sizeFromShape(r.shape)===0)return g;let y=p.shape.length-1,x=t.dataIdMap.get(p.dataId).id,A=t.dataIdMap.get(m.dataId).id,b=t.dataIdMap.get(g.dataId).id,w=new Uint8Array(new Int32Array(v.computeStrides(p.shape)).buffer),S=new Uint8Array(new Int32Array(v.computeStrides(f)).buffer);return j8(x,nt[r.dtype],w,y,A,c.batchSize,S,b),t.disposeData(p.dataId),t.disposeData(m.dataId),g.shape=c.outputShape,g}var tse={kernelName:Su,backendName:"wasm",setupFunc:Qre,kernelFunc:ese},ase=!1,nse=Gt(As,ase,"bool"),rse=!1,sse=Gt(bs,rse,"bool"),ise=Qe(mo,"bool"),ose=Qe(fo,"bool"),lse=Qe(go,"bool"),q8;function use(e){q8=e.wasm.cwrap(yo,null,["number","number","number","number"])}function dse(e){let{inputs:{x:t},attrs:{alpha:a},backend:n}=e,r=n.dataIdMap.get(t.dataId).id,s=n.makeOutput(t.shape,"float32");if(v.sizeFromShape(t.shape)!==0){let i=n.dataIdMap.get(s.dataId).id;q8(r,nt[t.dtype],a,i)}return s}var pse={kernelName:yo,backendName:"wasm",setupFunc:use,kernelFunc:dse},cse=!1,hse=Gt(vs,cse,"bool"),mse=!1,fse=Gt(ws,mse,"bool"),X8;function gse(e){X8=e.wasm.cwrap(xo,null,["number","number","number","number"])}function yse(e){let{attrs:t,backend:a}=e,{start:n,stop:r,num:s}=t,i=Math.floor(s),o=a.makeOutput([i],"float32");return X8(a.dataIdMap.get(o.dataId).id,n,r,i),o}var xse={kernelName:xo,backendName:"wasm",setupFunc:gse,kernelFunc:yse},Ase=Qe(ks),bse=Qe(Ao),vse=!1,wse=Gt(bo,vse,"bool"),kse=Qe(vo),Ise=!1,Sse=Gt(wo,Ise,"bool"),Tse=!1,Cse=Gt(HA,Tse,"bool"),K8;function Nse(e){K8=e.wasm.cwrap(ko,null,["number","number","number","number","number","number","number"])}function Rse(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n;if(r.dtype!=="float32")throw new Error("LRN error: x must have dtype float32");let u=a.makeOutput(r.shape,r.dtype);return K8(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(u.dataId).id,r.shape[3],s,i,o,l),u}var Ese={kernelName:ko,backendName:"wasm",setupFunc:Nse,kernelFunc:Rse},Y8;function Mse(e){Y8=e.wasm.cwrap(Tu,null,["number","number","number","number","number","number","number","number","number"])}function Fse(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:d}=n;if(r.dtype!=="float32"||s.dtype!=="float32"||i.dtype!=="float32")throw new Error("LRNGrad error: x, y, and dy must have dtype float32");let c=a.makeOutput(r.shape,r.dtype);return Y8(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(i.dataId).id,a.dataIdMap.get(c.dataId).id,i.shape[3],o,l,u,d),c}var $se={kernelName:Tu,backendName:"wasm",setupFunc:Mse,kernelFunc:Fse},Z8;function Dse(e){Z8=e.wasm.cwrap(Io,null,["number","number","number","number"])}function Pse(e){let{backend:t,inputs:a,attrs:n}=e,{reductionIndices:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=i,{transposed:u,axes:d,originalAxes:c,inputWasTransposed:p}=Ls(i,r,t);if(p){let x=t.dataIdMap.get(u.dataId).id;l=u,o=x}let h=l.shape.length;I.assertAxesAreInnerMostDims("max",d,h);let[m,f]=I.computeOutAndReduceShapes(l.shape,d),g=v.sizeFromShape(f),y=t.makeOutput(m,i.dtype);if(v.sizeFromShape(l.shape)!==0){let x=t.dataIdMap.get(y.dataId).id;Z8(o,nt[i.dtype],g,x)}if(p&&t.disposeData(u.dataId),s){let x=I.expandShapeToKeepDim(y.shape,c);y.shape=x}return y}var _se={kernelName:Io,backendName:"wasm",setupFunc:Dse,kernelFunc:Pse},Ose=!1,zse=Gt(Is,Ose),J8;function Lse(e){J8=e.wasm.cwrap(So,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Wse(e){let{inputs:t,attrs:a,backend:n}=e,r=t.x,s=n.dataIdMap.get(r.dataId).id;v.assert(r.dtype==="float32",()=>`Error in MaxPool: only float32 input is supported. Got ${r.dtype}.`);let{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=a,d=I.computePool2DInfo(r.shape,i,o,1,l,u),c=d.filterHeight,p=d.filterWidth,h=d.padInfo.top,m=d.padInfo.right,f=d.padInfo.bottom,g=d.padInfo.left,y=d.dilationHeight,x=d.dilationWidth,A=d.strideHeight,b=d.strideWidth,w=d.inChannels,S=d.outChannels;if(d.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`);let C=n.makeOutput(d.outShape,"float32"),N=n.dataIdMap.get(C.dataId).id;return J8(s,r.shape[0],r.shape[1],r.shape[2],c,p,h,m,f,g,y,x,A,b,w,S,N),C}var Bse={kernelName:So,backendName:"wasm",setupFunc:Lse,kernelFunc:Wse},Q8;function Vse(e){Q8=e.wasm.cwrap("MaxPool3D",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Use(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l,dataFormat:u}=n,d=I.computePool3DInfo(r.shape,s,i,1,o,l,u),c=a.makeOutput(d.outShape,r.dtype);return Q8(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,d.batchSize,d.inChannels,d.inDepth,d.inHeight,d.inWidth,d.outDepth,d.outHeight,d.outWidth,d.strideDepth,d.strideHeight,d.strideWidth,d.dilationDepth,d.dilationHeight,d.dilationWidth,d.effectiveFilterDepth,d.effectiveFilterHeight,d.effectiveFilterWidth,d.padInfo.front,d.padInfo.top,d.padInfo.left),c}var Gse={kernelName:Cu,backendName:"wasm",setupFunc:Vse,kernelFunc:Use},ek;function Hse(e){ek=e.wasm.cwrap("MaxPool3DGrad",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 jse(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n,d=I.computePool3DInfo(s.shape,i,o,1,l,u),c=a.makeOutput(s.shape,s.dtype);return ek(a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,d.batchSize,d.inChannels,d.inDepth,d.inHeight,d.inWidth,d.outDepth,d.outHeight,d.outWidth,d.strideDepth,d.strideHeight,d.strideWidth,d.dilationDepth,d.dilationHeight,d.dilationWidth,d.effectiveFilterDepth,d.effectiveFilterHeight,d.effectiveFilterWidth,d.padInfo.front,d.padInfo.top,d.padInfo.left),c}var qse={kernelName:Rp,backendName:"wasm",setupFunc:Hse,kernelFunc:jse},tk;function Xse(e){tk=e.wasm.cwrap("MaxPoolGrad",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Kse(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,{filterSize:i,strides:o,pad:l,dimRoundingMode:u}=n,d=I.computePool2DInfo(s.shape,i,o,1,l,u),c=a.makeOutput(s.shape,s.dtype);return tk(a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,d.batchSize,d.inChannels,d.inHeight,d.inWidth,d.outHeight,d.outWidth,d.strideHeight,d.strideWidth,d.dilationHeight,d.dilationWidth,d.effectiveFilterHeight,d.effectiveFilterWidth,d.padInfo.top,d.padInfo.left),c}var Yse={kernelName:Np,backendName:"wasm",setupFunc:Xse,kernelFunc:Kse},ak;function Zse(e){ak=e.wasm.cwrap("MaxPoolWithArgmax",null,["number","number","number","number","boolean","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Jse(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,includeBatchInIndex:l}=n;v.assert(r.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${r.shape.length}.`);let u=[1,1];v.assert(I.eitherStridesOrDilationsAreOne(i,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${i} and dilations '${u}'`);let d=I.computePool2DInfo(r.shape,s,i,[1,1],o),c=a.makeOutput(d.outShape,r.dtype),p=a.makeOutput(d.outShape,"int32");return ak(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(c.dataId).id,a.dataIdMap.get(p.dataId).id,nt[r.dtype],l,d.batchSize,d.inChannels,d.inHeight,d.inWidth,d.outHeight,d.outWidth,d.strideHeight,d.strideWidth,d.dilationHeight,d.dilationWidth,d.effectiveFilterHeight,d.effectiveFilterWidth,d.padInfo.top,d.padInfo.left),[c,p]}var Qse={kernelName:Nu,backendName:"wasm",setupFunc:Zse,kernelFunc:Jse},nk;function eie(e){nk=e.wasm.cwrap(To,null,["number, number, number"])}function tie(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:c,originalAxes:p,inputWasTransposed:h}=Ls(i,r,t),m=c;if(h){let b=t.dataIdMap.get(d.dataId).id;b!==o&&(u=d,l=b,m=I.getInnerMostAxes(m.length,u.shape.length))}I.assertAxesAreInnerMostDims("mean",m,u.shape.length);let[f,g]=I.computeOutAndReduceShapes(u.shape,m),y=v.sizeFromShape(g),x=u;u.dtype!=="float32"&&(x=Ws({backend:t,inputs:{x:u},attrs:{dtype:"float32"}}),l=t.dataIdMap.get(x.dataId).id);let A=t.makeOutput(f,"float32");if(v.sizeFromShape(u.shape)!==0){let b=t.dataIdMap.get(A.dataId).id;nk(l,y,b)}if(h&&t.disposeData(d.dataId),s){let b=I.expandShapeToKeepDim(A.shape,p);A.shape=b}return u.dtype!=="float32"&&t.disposeData(x.dataId),A}var aie={kernelName:To,backendName:"wasm",setupFunc:eie,kernelFunc:tie},rk;function nie(e){rk=e.wasm.cwrap(Co,null,["number","number","number","number"])}function rie(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:c,originalAxes:p,inputWasTransposed:h}=Ls(i,r,t);if(h){let A=t.dataIdMap.get(d.dataId).id;A!==o&&(u=d,l=A)}let m=u.shape.length;I.assertAxesAreInnerMostDims("min",c,m);let[f,g]=I.computeOutAndReduceShapes(u.shape,c),y=v.sizeFromShape(g),x=t.makeOutput(f,u.dtype);if(v.sizeFromShape(u.shape)!==0){let A=t.dataIdMap.get(x.dataId).id;rk(l,nt[i.dtype],y,A)}if(h&&t.disposeData(d.dataId),s){let A=I.expandShapeToKeepDim(x.shape,p);x.shape=A}return x}var sie={kernelName:Co,backendName:"wasm",setupFunc:nie,kernelFunc:rie},iie=!1,oie=Gt(Ss,iie),Y1;(function(e){e[e.reflect=0]="reflect",e[e.symmetric=1]="symmetric"})(Y1||(Y1={}));var sk;function lie(e){sk=e.wasm.cwrap(No,null,["number","array","number","number","array","array","number","number"])}function uie(e){let{inputs:{x:t},backend:a,attrs:{paddings:n,mode:r}}=e,s=n.map((m,f)=>m[0]+t.shape[f]+m[1]),i=a.dataIdMap.get(t.dataId).id,o=a.makeOutput(s,t.dtype),l=a.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),d=n.map(m=>m[0]),c=n.map(m=>m[1]),p=new Uint8Array(new Int32Array(d).buffer),h=new Uint8Array(new Int32Array(c).buffer);return sk(i,u,t.shape.length,nt[t.dtype],p,h,Y1[r],l),o}var die={kernelName:No,backendName:"wasm",kernelFunc:uie,setupFunc:lie},ik;function pie(e){ik=e.wasm.cwrap(el,null,["number","number","number","number"])}function ok(e){let{backend:t,inputs:{logits:a},attrs:{dim:n}}=e,r=t.dataIdMap.get(a.dataId).id,s=t.makeOutput(a.shape,a.dtype),i=t.dataIdMap.get(s.dataId).id,o=a.shape[n],l=v.sizeFromShape(a.shape)/o;return v.sizeFromShape(s.shape)===0||ik(r,i,o,l),s}var cie={kernelName:el,backendName:"wasm",setupFunc:pie,kernelFunc:ok},lk;function hie(e){lk=e.wasm.cwrap(Eo,null,["number","number","number","number","number","number"])}function mie(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n;if(r.dtype!=="float32")throw new Error(`Tensor logits must have dtype float32, got ${r.dtype}`);let l=o?r:ok({inputs:{logits:r},backend:a,attrs:{dim:r.shape.length-1}}),[u,d]=l.shape,c=a.makeOutput([u,s],"int32");return lk(a.dataIdMap.get(l.dataId).id,u,d,s,i,a.dataIdMap.get(c.dataId).id),o||a.disposeData(l.dataId),c}var fie={kernelName:Eo,backendName:"wasm",setupFunc:hie,kernelFunc:mie},gie=Gt(Ro,!0),yie=!0,xie=Gt(Ts,yie),Aie=Qe(Ru);function Z3(e,t){let a=new Int32Array(e.wasm.HEAPU8.buffer,t,4),n=a[0],r=a[1],s=a[2],i=a[3];return e.wasm._free(t),{pSelectedIndices:n,selectedSize:r,pSelectedScores:s,pValidOutputs:i}}var uk;function bie(e){uk=e.wasm.cwrap(Mo,"number",["number","number","number","number","number"])}function vie(e){let{backend:t,inputs:a,attrs:n}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i}=n,{boxes:o,scores:l}=a,u=t.dataIdMap.get(o.dataId).id,d=t.dataIdMap.get(l.dataId).id,c=uk(u,d,s,r,i),{pSelectedIndices:p,selectedSize:h,pSelectedScores:m,pValidOutputs:f}=Z3(t,c);return t.wasm._free(m),t.wasm._free(f),t.makeOutput([h],"int32",p)}var wie={kernelName:Mo,backendName:"wasm",setupFunc:bie,kernelFunc:vie},dk;function kie(e){dk=e.wasm.cwrap(Eu,"number",["number","number","number","number","number","bool"])}function Iie(e){let{backend:t,inputs:a,attrs:n}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,padToMaxOutputSize:o}=n,{boxes:l,scores:u}=a,d=t.dataIdMap.get(l.dataId).id,c=t.dataIdMap.get(u.dataId).id,p=dk(d,c,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=Z3(t,p);t.wasm._free(f);let y=t.makeOutput([m],"int32",h),x=t.makeOutput([],"int32",g);return[y,x]}var Sie={kernelName:Eu,backendName:"wasm",setupFunc:kie,kernelFunc:Iie},pk;function Tie(e){pk=e.wasm.cwrap(Fo,"number",["number","number","number","number","number","number"])}function Cie(e){let{backend:t,inputs:a,attrs:n}=e,{iouThreshold:r,maxOutputSize:s,scoreThreshold:i,softNmsSigma:o}=n,{boxes:l,scores:u}=a,d=t.dataIdMap.get(l.dataId).id,c=t.dataIdMap.get(u.dataId).id,p=pk(d,c,s,r,i,o),{pSelectedIndices:h,selectedSize:m,pSelectedScores:f,pValidOutputs:g}=Z3(t,p);t.wasm._free(g);let y=t.makeOutput([m],"int32",h),x=t.makeOutput([m],"float32",f);return[y,x]}var Nie={kernelName:Fo,backendName:"wasm",setupFunc:Tie,kernelFunc:Cie},Rie=!1,Eie=Gt(Cs,Rie,"bool"),ck;function Mie(e){ck=e.wasm.cwrap($o,null,["number","number","number","number","number"])}function Fie(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r}=t,{dtype:s,depth:i,onValue:o,offValue:l}=n,u=a.makeOutput([...r.shape,i],s),d=a.dataIdMap.get(u.dataId).id,c=a.dataIdMap.get(r.dataId).id;return ck(c,i,o,l,d),u}var $ie={kernelName:$o,backendName:"wasm",setupFunc:Mie,kernelFunc:Fie};function Die(e){let{inputs:{x:t},backend:a}=e,n=a.makeOutput(t.shape,t.dtype);return a.typedArrayFromHeap(n).fill(1),n}var Pie={kernelName:Mu,backendName:"wasm",kernelFunc:Die};function _ie(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n;if(t.length===1)return K1({inputs:{input:t[0]},backend:a,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(d=>{v.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(d=>{let c=K1({inputs:{input:d},backend:a,attrs:{dim:r}});return o.push(c),c}),u=k8({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(d=>a.disposeData(d.dataId)),u}var Oie={kernelName:Fu,backendName:"wasm",kernelFunc:_ie},hk;function zie(e){hk=e.wasm.cwrap(Do,null,["number","array","number","number","array","array","number","number"])}function Lie(e){let{inputs:{x:t},backend:a,attrs:{paddings:n,constantValue:r}}=e,s=n.map((m,f)=>m[0]+t.shape[f]+m[1]);if(v.sizeFromShape(t.shape)===0)return W8({backend:a,attrs:{shape:s,value:r,dtype:t.dtype}});let i=a.dataIdMap.get(t.dataId).id,o=a.makeOutput(s,t.dtype),l=a.dataIdMap.get(o.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),d=n.map(m=>m[0]),c=n.map(m=>m[1]),p=new Uint8Array(new Int32Array(d).buffer),h=new Uint8Array(new Int32Array(c).buffer);return hk(i,u,t.shape.length,nt[t.dtype],p,h,r,l),o}var mk={kernelName:Do,backendName:"wasm",kernelFunc:Lie,setupFunc:zie},Wie=!1,Bie=Gt(Po,Wie),fk;function Vie(e){fk=e.wasm.cwrap(_o,null,["number","number","number"])}function Uie(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t,s=a.dataIdMap.get(n.dataId).id,i=a.dataIdMap.get(r.dataId).id,o=s,l=n,u=l;l.dtype!=="float32"&&(u=Ws({backend:a,inputs:{x:n},attrs:{dtype:"float32"}}),o=a.dataIdMap.get(u.dataId).id);let d=a.makeOutput(n.shape,"float32"),c=a.dataIdMap.get(d.dataId).id;return fk(o,i,c),l.dtype!=="float32"&&a.disposeData(u.dataId),d}var Gie={kernelName:_o,backendName:"wasm",setupFunc:Vie,kernelFunc:Uie},gk;function Hie(e){gk=e.wasm.cwrap(Oo,null,["number","number","number","number"])}function jie(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:c,originalAxes:p,inputWasTransposed:h}=Ls(i,r,t),m=c;if(h){let A=t.dataIdMap.get(d.dataId).id;A!==o&&(u=d,l=A,m=I.getInnerMostAxes(m.length,u.shape.length))}I.assertAxesAreInnerMostDims("prod",m,u.shape.length);let[f,g]=I.computeOutAndReduceShapes(u.shape,m),y=v.sizeFromShape(g),x=t.makeOutput(f,u.dtype);if(v.sizeFromShape(u.shape)!==0){let A=t.dataIdMap.get(x.dataId).id;gk(l,y,nt[x.dtype],A)}if(h&&t.disposeData(d.dataId),s){let A=I.expandShapeToKeepDim(x.shape,p);x.shape=A}return x}var qie={kernelName:Oo,backendName:"wasm",setupFunc:Hie,kernelFunc:jie},Xie=e=>{let{backend:t,attrs:a}=e,{start:n,stop:r,step:s,dtype:i}=a,o=T3(n,r,s,i),l=t.makeOutput([o.length],i);return t.typedArrayFromHeap(l).set(o),l},Kie={kernelName:$u,backendName:"wasm",kernelFunc:Xie},Yie=!0,Zie=Gt(io,Yie),Jie=Qe(zo),Qie=Qe(Lo),eoe=Qe(Vo),yk;function toe(e){yk=e.wasm.cwrap(Bo,null,["number","number","number","number","number","number","number","number","number","number"])}function aoe(e){let{backend:t,inputs:a,attrs:n}=e,{images:r}=a,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,[d,c,p,h]=r.shape,m=[d,l,u,h],f=t.dataIdMap.get(r.dataId),g;f.dtype!=="float32"&&(g=Ws({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),f=t.dataIdMap.get(g.dataId));let y=f.id,x=t.makeOutput(m,"float32");if(v.sizeFromShape(r.shape)===0)return x;let A=t.dataIdMap.get(x.dataId).id;return yk(y,d,c,p,h,l,u,s?1:0,i?1:0,A),g!=null&&t.disposeData(g.dataId),x}var noe={kernelName:Bo,backendName:"wasm",setupFunc:toe,kernelFunc:aoe},xk;function roe(e){xk=e.wasm.cwrap(_u,null,["number","number","number","array","array","boolean"])}function soe(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=a.makeOutput(r.shape,"float32"),l=a.dataIdMap.get(r.dataId),u;return l.dtype!=="float32"&&(u=Ws({backend:a,inputs:{x:r},attrs:{dtype:"float32"}}),l=a.dataIdMap.get(u.dataId)),xk(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(o.dataId).id,new Uint8Array(new Int32Array(r.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),i),u!=null&&a.disposeData(u.dataId),o}var ioe={kernelName:_u,backendName:"wasm",setupFunc:roe,kernelFunc:soe},Ak;function ooe(e){Ak=e.wasm.cwrap(Wo,null,["number","number","number","number","number","number","number","number","number","number"])}function loe(e){let{backend:t,inputs:a,attrs:n}=e,{images:r}=a,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,[d,c,p,h]=r.shape,m=[d,l,u,h],f=t.makeOutput(m,"float32");if(v.sizeFromShape(r.shape)===0)return f;let g=t.dataIdMap.get(r.dataId),y;g.dtype!=="float32"&&(y=Ws({backend:t,inputs:{x:r},attrs:{dtype:"float32"}}),g=t.dataIdMap.get(y.dataId));let x=g.id,A=t.dataIdMap.get(f.dataId).id;return Ak(x,d,c,p,h,l,u,s?1:0,i?1:0,A),y!=null&&t.disposeData(y.dataId),f}var uoe={kernelName:Wo,backendName:"wasm",setupFunc:ooe,kernelFunc:loe},bk;function doe(e){bk=e.wasm.cwrap(Pu,null,["number","number","number","array","array","boolean"])}function poe(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,o=a.makeOutput(r.shape,"float32"),l=a.dataIdMap.get(r.dataId),u;return l.dtype!=="float32"&&(u=Ws({backend:a,inputs:{x:r},attrs:{dtype:"float32"}}),l=a.dataIdMap.get(u.dataId)),bk(a.dataIdMap.get(r.dataId).id,a.dataIdMap.get(s.dataId).id,a.dataIdMap.get(o.dataId).id,new Uint8Array(new Int32Array(r.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),i),u!=null&&a.disposeData(u.dataId),o}var coe={kernelName:Pu,backendName:"wasm",setupFunc:doe,kernelFunc:poe},vk;function hoe(e){vk=e.wasm.cwrap(Uo,null,["number","array","number","array","number","number"])}function moe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n,i=v.parseAxisParam(s,r.shape);if(r.shape.length===0)return m0({inputs:{x:r},backend:a});let o=a.makeOutput(r.shape,r.dtype),l=a.dataIdMap.get(r.dataId).id,u=a.dataIdMap.get(o.dataId).id,d=new Uint8Array(new Int32Array(i).buffer),c=new Uint8Array(new Int32Array(r.shape).buffer);vk(l,d,i.length,c,r.shape.length,u);let p=La({inputs:{x:o},attrs:{shape:r.shape},backend:a});return a.disposeData(o.dataId),p}var foe={kernelName:Uo,backendName:"wasm",kernelFunc:moe,setupFunc:hoe},wk;function goe(e){wk=e.wasm.cwrap(ol,null,["number","number","number","number","number","number","number","number","array","number","number"])}function yoe(e){let{inputs:t,backend:a,attrs:n}=e,{image:r}=t,{radians:s,fillValue:i,center:o}=n,l=a.makeOutput(r.shape,r.dtype),u=a.dataIdMap.get(r.dataId).id,d=a.dataIdMap.get(l.dataId).id,[c,p,h,m]=r.shape,[f,g]=I.getImageCenter(o,p,h),y=i===0,x=255,A=typeof i=="number"?[i,i,i,y?0:x]:[...i,x],b=new Uint8Array(new Int32Array(A).buffer);return wk(u,c,p,h,m,s,f,g,b,A.length,d),l}var xoe={kernelName:ol,backendName:"wasm",kernelFunc:yoe,setupFunc:goe},Aoe=Qe(Go),boe=Qe(Ns),kk;function voe(e){kk=e.wasm.cwrap(Ho,null,["number","number","number","number","number","number","array","number","number"])}function woe(e){let{backend:t,inputs:a,attrs:n}=e,{indices:r,updates:s}=a,{shape:i}=n,o=t.makeOutput(i,s.dtype);if(v.sizeFromShape(i)===0)return o;let{sliceRank:l,numUpdates:u,sliceSize:d,strides:c,outputSize:p}=Qh.calculateShapes(s,r,i),h=t.dataIdMap.get(r.dataId).id,m=t.dataIdMap.get(s.dataId).id,f=new Uint8Array(new Int32Array(c).buffer),g=t.dataIdMap.get(o.dataId).id;return kk(h,m,nt[s.dtype],l,u,d,f,p,g),o}var koe={kernelName:Ho,backendName:"wasm",setupFunc:voe,kernelFunc:woe},Ik;function Ioe(e){Ik=e.wasm.cwrap(qo,null,["number","number","number","number","number","number","bool","number"])}function Soe(e){let{inputs:t,backend:a,attrs:n}=e,{sortedSequence:r,values:s}=t,{side:i}=n;if(r.dtype!==s.dtype)throw new Error(`SearchSorted error: sorted_sequence must have the same dtype as values. Got ${r.dtype} and ${s.dtype}`);let o=a.makeOutput(s.shape,"int32");function l(u){return a.dataIdMap.get(u.dataId).id}return Ik(l(r),l(s),r.shape[0],r.shape[1],s.shape[1],nt[r.dtype],i==="left",l(o)),o}var Toe={kernelName:qo,backendName:"wasm",setupFunc:Ioe,kernelFunc:Soe},Sk;function Coe(e){Sk=e.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function Noe(e){let{inputs:t,backend:a}=e,{condition:n,t:r,e:s}=t,i=a.dataIdMap.get(n.dataId).id,o=a.dataIdMap.get(r.dataId).id,l=a.dataIdMap.get(s.dataId).id,u=a.makeOutput(r.shape,r.dtype),d=a.dataIdMap.get(u.dataId).id,c=n.shape.length,p=r.shape.length,h=c===0||c>1||p===1?1:v.sizeFromShape(r.shape.slice(1));return Sk(i,o,l,h,d),u}var Roe={kernelName:Ou,backendName:"wasm",kernelFunc:Noe,setupFunc:Coe},Eoe=Qe(Xo),Tk;function Moe(e){Tk=e.wasm.cwrap(Rs,null,["number","number"])}function Foe(e){let{backend:t,inputs:{x:a}}=e,n=t.dataIdMap.get(a.dataId).id,r=t.makeOutput(a.shape,a.dtype),s=t.dataIdMap.get(r.dataId).id;return v.sizeFromShape(r.shape)===0||Tk(n,s),r}var $oe={kernelName:"Sigmoid",backendName:"wasm",setupFunc:Moe,kernelFunc:Foe},Doe=Qe(Zo),Poe=Qe(Ko),_oe=Qe(Yo),Ooe=Qe(Jo);function zoe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,paddings:i}=n,o=v.sizeFromShape(s),l=[[0,0]];l.push(...i);for(let g=1+s.length;g0?l+1:0;if(u<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let p=r.shape.slice();p[0]=u;let c=a.dataIdMap.get(r.dataId).id,d=a.dataIdMap.get(s.dataId).id,h=a.dataIdMap.get(i.dataId).id,m=a.makeOutput(p,r.dtype),f=a.dataIdMap.get(m.dataId).id,g=a.makeOutput([4],"int32"),y=a.dataIdMap.get(g.dataId).id;uk(c,nt[r.dtype],r.shape[0],d,h,f,y,t,0);let x=a.readSync(g.dataId),A;switch(x[0]){case 0:{A=C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage();break}case 1:{A=C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage();break}case 2:A=C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(x[1],x[2]);break;case 3:A=C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(x[1],x[2],x[3]);break;default:A=""}if(a.disposeData(g.dataId),A)throw a.disposeData(m.dataId),new Error(A);return m}function Jie(e){return pk(e,!0)}var Qie={kernelName:Fu,backendName:"wasm",setupFunc:dk,kernelFunc:Jie};function eoe(e){return pk(e,!1)}var toe={kernelName:Du,backendName:"wasm",setupFunc:dk,kernelFunc:eoe},ck;function aoe(e){ck=e.wasm.cwrap(Go,null,["number","number","number","number","number","number","number","number","array","number","number"])}function noe(e){let{backend:t,inputs:a,attrs:n}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=a,{outputShape:o}=n,l=t.makeOutput(o,i.dtype);if(v.sizeFromShape(o)===0)return l;let{sliceRank:u,numUpdates:p,sliceSize:c,strides:d,outputSize:h}=C.calculateShapes(s,r,o),m=t.dataIdMap.get(r.dataId).id,f=t.dataIdMap.get(s.dataId).id,g=t.dataIdMap.get(i.dataId).id,y=new Uint8Array(new Int32Array(d).buffer),x=t.dataIdMap.get(l.dataId).id;return ck(m,f,s.shape.length,g,nt[i.dtype],u,p,c,y,h,x),l}var roe={kernelName:Go,backendName:"wasm",setupFunc:aoe,kernelFunc:noe};function soe(e){let{inputs:t,attrs:a,backend:n}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=a,o=v.parseAxisParam(i,r.shape)[0],l=C.prepareSplitSize(r,s,o),u=new Array(r.shape.length).fill(0),p=r.shape.slice();return l.map(c=>{let d=[...p];d[o]=c;let h=ni({inputs:{x:r},attrs:{begin:u,size:d},backend:n});return u[o]+=c,h})}var ioe={kernelName:_u,backendName:"wasm",kernelFunc:soe},ooe=Qe(Bo),loe=Qe(kp),uoe=!0,doe=Gt(Ho,uoe),hk;function poe(e){hk=e.wasm.cwrap(us,null,["number","number","number","number"])}function coe(e){let{backend:t,inputs:a,attrs:n}=e,{alpha:r}=n,{x:s}=a,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),l=t.dataIdMap.get(o.dataId).id;return hk(i,r,nt[s.dtype],l),o}var hoe={kernelName:us,backendName:"wasm",setupFunc:poe,kernelFunc:coe},mk;function moe(e){mk=e.wasm.cwrap(jo,null,["number","array","number","array","array","array","array","array","number","number"])}function foe(e){let{backend:t,inputs:a,attrs:n}=e,{x:r}=a,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:p,newAxisMask:c,shrinkAxisMask:d}=n,{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=Nt.sliceInfo(r.shape,s,i,o,l,u,p,c,d),w;if(f)w=La({inputs:{x:r},backend:t,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let I=Nt.computeOutShape(x,A,b),T=ni({inputs:{x:r},backend:t,attrs:{begin:x,size:I}});w=La({inputs:{x:T},backend:t,attrs:{shape:m}}),t.disposeData(T.dataId)}else{let I=t.makeOutput(h,"float32"),T=t.dataIdMap.get(r.dataId).id,N=new Uint8Array(new Int32Array(v.computeStrides(r.shape)).buffer),M=new Uint8Array(new Int32Array(x).buffer),P=new Uint8Array(new Int32Array(A).buffer),E=new Uint8Array(new Int32Array(b).buffer),S=new Uint8Array(new Int32Array(h).buffer),_=new Uint8Array(new Int32Array(v.computeStrides(h)).buffer),O=t.dataIdMap.get(I.dataId).id;mk(T,N,r.shape.length,M,P,E,S,_,h.length,O),w=La({inputs:{x:I},backend:t,attrs:{shape:m}}),t.disposeData(I.dataId)}return w}var goe={kernelName:jo,backendName:"wasm",setupFunc:moe,kernelFunc:foe};function yoe(e){let{backend:t,inputs:a,attrs:n}=e,{data:r,dataSplits:s}=a,{separator:i,nGramWidths:o,leftPad:l,rightPad:u,padWidth:p,preserveShortSequences:c}=n,d=t.readSync(r.dataId),h=t.readSync(s.dataId),[m,f]=x3(d,h,i,o,l,u,p,c),g=t.makeOutput([m.length],"string"),y=t.dataIdMap.get(g.dataId);y.stringBytes=m;let x=t.makeOutput(s.shape,"int32");return t.typedArrayFromHeap(x).set(f),[g,x]}var xoe={kernelName:Ou,backendName:"wasm",kernelFunc:yoe};function Aoe(e){let{backend:t,inputs:a,attrs:n}=e,{input:r,delimiter:s}=a,{skipEmpty:i}=n,o=t.readSync(r.dataId),l=t.readSync(s.dataId),[u,p,c]=A3(o,l[0],i),d=p.length,h=t.makeOutput([d,2],"int32");t.typedArrayFromHeap(h).set(u);let m=t.makeOutput([d],"string"),f=t.dataIdMap.get(m.dataId);f.stringBytes=p;let g=t.makeOutput([2],"int32");return t.typedArrayFromHeap(g).set(c),[h,m,g]}var boe={kernelName:Sp,backendName:"wasm",kernelFunc:Aoe};function voe(e){let{backend:t,inputs:a,attrs:n}=e,{input:r}=a,{numBuckets:s}=n,i=t.readSync(r.dataId),o=b3(i,s),l=t.makeOutput(r.shape,"int32");return t.typedArrayFromHeap(l).set(o),l}var woe={kernelName:Cp,backendName:"wasm",kernelFunc:voe},koe=!0,Ioe=Gt(qo,koe),fk;function Soe(e){fk=e.wasm.cwrap(Vo,null,["number","number","number","number"])}function Coe(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:p,axes:c,originalAxes:d,inputWasTransposed:h}=ms(i,r,t),m=c;if(h){let A=t.dataIdMap.get(p.dataId).id;A!==o&&(u=p,l=A,m=C.getInnerMostAxes(m.length,u.shape.length))}C.assertAxesAreInnerMostDims("sum",m,u.shape.length);let[f,g]=C.computeOutAndReduceShapes(u.shape,m),y=v.sizeFromShape(g),x=t.makeOutput(f,u.dtype);if(v.sizeFromShape(u.shape)!==0){let A=t.dataIdMap.get(x.dataId).id;fk(l,y,nt[x.dtype],A)}if(h&&t.disposeData(p.dataId),s){let A=C.expandShapeToKeepDim(x.shape,d);x.shape=A}return x}var Toe={kernelName:Vo,backendName:"wasm",setupFunc:Soe,kernelFunc:Coe},Noe=Qe(Xo),Roe=Qe(Ko),gk;function Eoe(e){gk=e.wasm.cwrap(_o,null,["number","number","number","number","number","number","array","number","number","number"])}function Moe(e){let{backend:t,inputs:a,attrs:n}=e,{tensor:r,indices:s,updates:i}=a,{}=n,o=t.makeOutput(r.shape,r.dtype);if(v.sizeFromShape(r.shape)===0)return o;let{sliceRank:l,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=Hh.calculateShapes(i,s,r.shape),h=t.dataIdMap.get(s.dataId).id,m=t.dataIdMap.get(i.dataId).id,f=t.dataIdMap.get(r.dataId).id,g=new Uint8Array(new Int32Array(c).buffer),y=t.dataIdMap.get(o.dataId).id;return gk(h,m,nt[i.dtype],l,u,p,g,d,y,f),o}var Poe={kernelName:_o,backendName:"wasm",setupFunc:Eoe,kernelFunc:Moe},yk;function _oe(e){yk=e.wasm.cwrap(ls,null,["number","array","number","array","number","number"])}function $oe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,s=a.dataIdMap.get(r.dataId).id,{reps:i}=n,o=new Array(r.shape.length);for(let d=0;d{let{x:n}=e,{k:r,sorted:s}=a,i=t.dataIdMap.get(n.dataId).id,o=new Uint8Array(new Int32Array(n.shape).buffer),l=n.shape.slice();l[l.length-1]=r;let u=t.makeOutput(l,n.dtype),p=t.dataIdMap.get(u.dataId).id,c=t.makeOutput(l,"int32"),d=t.dataIdMap.get(c.dataId).id;return xk(i,o,n.shape.length,nt[n.dtype],r,s,p,d),[u,c]},zoe={kernelName:Yo,backendName:"wasm",setupFunc:Doe,kernelFunc:Ooe},Ak;function Loe(e){Ak=e.wasm.cwrap(Zo,null,["number","number","bool","number","number","number","number","number","number","array","number","array","number","number","number","number","number"])}function Woe(e){let{backend:t,inputs:a,attrs:n}=e,{image:r,transforms:s}=a,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=n,[p,c,d,h]=r.shape,[m,f]=u!=null?u:[c,d],g=[p,m,f,h],y=new Uint8Array(new Int32Array(v.computeStrides(r.shape)).buffer),x=new Uint8Array(new Int32Array(v.computeStrides(g)).buffer),A=t.makeOutput(g,r.dtype),b=t.dataIdMap.get(A.dataId).id,w=t.dataIdMap.get(r.dataId).id,I=t.dataIdMap.get(s.dataId).id,T=i==="nearest"?1:2,N;switch(o){case"constant":N=1;break;case"reflect":N=2;break;case"wrap":N=3;break;case"nearest":N=4;break;default:N=1;break}return Ak(w,I,s.shape[0]>1,p,m,f,h,d,c,y,r.shape.length-1,x,g.length-1,T,N,l,b),A}var Boe={kernelName:Zo,backendName:"wasm",setupFunc:Loe,kernelFunc:Woe};function Voe(e){let{inputs:t,attrs:a,backend:n}=e,{axis:r}=a,{x:s}=t,{outputValues:i,outputShape:o,indices:l}=w3(n.readSync(s.dataId),r,s.shape,s.dtype);return[n.makeOutput(o,s.dtype,void 0,i),n.makeOutput([l.length],"int32",void 0,l)]}var Uoe={kernelName:Tp,backendName:"wasm",kernelFunc:Voe};function Goe(e){let{inputs:t,backend:a,attrs:n}=e,{value:r}=t,{axis:s}=n;s<0&&(s+=r.shape.length);let i=r.shape[s],o=r.shape.length,l=new Array(o-1),u=0;for(let h=0;h({dataId:h,dtype:m,shape:l}))}var Hoe={kernelName:zu,backendName:"wasm",kernelFunc:Goe};function joe(e){let{inputs:{x:t},backend:a}=e,n=a.makeOutput(t.shape,t.dtype);return a.typedArrayFromHeap(n).fill(0),n}var qoe={kernelName:Lu,backendName:"wasm",kernelFunc:joe},Xoe=[Rte,Ete,Mte,Pte,$te,Ote,Hte,Xte,Kte,Yte,Zte,Jte,Qte,eae,tae,rae,hae,oae,dae,yae,kae,Cae,Nae,Eae,Mae,Pae,Fae,Dae,Lae,Vae,Hae,Xae,Zae,Jae,Qae,ane,sne,lne,pne,mne,yne,bne,kne,Cne,Rne,Ene,_ne,Fne,Dne,One,zne,Lne,Wne,Une,Gne,jne,Kne,Jne,tre,rre,ore,ure,pre,zte,cre,hre,mre,yre,Are,vre,Ire,Cre,Sre,Nre,Rre,Mre,_re,Dre,Lre,Vre,Gre,qre,Yre,Qre,ase,sse,lse,pse,hse,gse,vse,wse,Ise,Sse,Nse,Mse,$se,Dse,Lse,Bse,Use,Xw,qse,Yse,Qse,tie,nie,rie,sie,iie,mae,uie,cie,fie,xie,vie,Iie,Sie,Cie,Rie,Pie,Fie,Die,Lie,Wie,Bie,Vie,vae,xse,Uie,Hie,Xie,Zie,Qie,toe,roe,ioe,ooe,loe,doe,hoe,goe,xoe,boe,woe,Ioe,Toe,Noe,Roe,Poe,Foe,zoe,Boe,Vte,Uoe,Hoe,qoe];for(let e of Xoe)yn(e);var G1=B();G1.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>{try{return 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]))}catch(e){return!1}});G1.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(G1.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 j5=tu(QC()),Koe=tu(eT()),q5=tu(tT()),X5=j5.default||j5,Yoe=q5.default||q5,bk=class extends au{constructor(e){super(),this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(vk),H1=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new rp(this,It())}write(e,t,a){let n={id:this.dataIdNextNumber++};return this.move(n,e,t,a,1),n}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=v.now();return e(),{kernelMs:v.now()-t}}move(e,t,a,n,r){let s=this.dataIdNextNumber++;if(n==="string"){let u=t;this.dataIdMap.set(e,{id:s,stringBytes:u,shape:a,dtype:n,memoryOffset:null,refCount:r});return}let i=v.sizeFromShape(a),o=i*v.bytesPerElement(n),l=this.wasm._malloc(o)>>>0;this.dataIdMap.set(e,{id:s,memoryOffset:l,shape:a,dtype:n,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,t,a){let{memoryOffset:n,dtype:r,shape:s,stringBytes:i}=this.dataIdMap.get(e);if(r==="string")return(t==null||t===0)&&(a==null||a>=i.length)?i:i.slice(t,a);t=t||0,a=a||v.sizeFromShape(s);let o=v.bytesPerElement(r),l=this.wasm.HEAPU8.slice(n+t*o,n+a*o);return Qoe(l.buffer,r)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let a=this.dataIdMap.get(e);if(a.refCount--,!t&&a.refCount>0)return!1;this.wasm._free(a.memoryOffset),this.wasm.tfjs.disposeData(a.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,a,n){let r;if(a==null)r=this.write(n!=null?n:null,e,t);else{let s=this.dataIdNextNumber++;r={id:s},this.dataIdMap.set(r,{id:s,memoryOffset:a,shape:e,dtype:t,refCount:1});let i=v.sizeFromShape(e);this.wasm.tfjs.registerTensor(s,i,a)}return{dataId:r,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:a}){let n=this.wasm.HEAPU8.buffer,{memoryOffset:r}=this.dataIdMap.get(a),s=v.sizeFromShape(e);switch(t){case"float32":return new Float32Array(n,r,s);case"int32":return new Int32Array(n,r,s);case"bool":return new Uint8Array(n,r,s);default:throw new Error(`Unknown dtype ${t}`)}}};function Zoe(e){return(t,a)=>(v.fetch(e,{credentials:"same-origin"}).then(n=>{n.ok||t.env.a(`failed to load wasm binary file at '${e}'`),n.arrayBuffer().then(r=>{WebAssembly.instantiate(r,t).then(s=>{a(s.instance,s.module)})})}),{})}function K5(e,t,a){if(Sh!=null)return Sh;let n="tfjs-backend-wasm.wasm";return e&&t?n="tfjs-backend-wasm-threaded-simd.wasm":e&&(n="tfjs-backend-wasm-simd.wasm"),_d!=null&&_d[n]!=null?_d[n]:a+n}async function Joe(){let[e,t]=await Promise.all([B().getAsync("WASM_HAS_SIMD_SUPPORT"),B().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((a,n)=>{let r={};r.locateFile=(o,l)=>{if(o.endsWith(".worker.js")){let u=Koe.wasmWorkerContents.replace(/\n/g,"\\n"),p=new Blob([u],{type:"application/javascript"});return URL.createObjectURL(p)}return o.endsWith(".wasm")?K5(e,t,Ed!=null?Ed:l):l+o},V3&&(r.instantiateWasm=Zoe(K5(e,t,Ed!=null?Ed:"")));let s=!1;r.onAbort=()=>{s||$d||($d=!0,n({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&&Sh==null?(r.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+X5.toString()],{type:"text/javascript"}),i=X5(r)):i=Yoe(r),i.then(o=>{s=!0,$d=!1;let l=null;o.tfjs={init:o.cwrap("init",null,[]),initWithThreadsCount:o.cwrap("init_with_threads_count",null,["number"]),getThreadsCount:o.cwrap("get_threads_count","number",[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",l,["number"]),dispose:o.cwrap("dispose",l,[])},a({wasm:o})}).catch(n)})}function Qoe(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 ele=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],Sh=null,Ed=null,_d={},$d=!1,V3=!1;function tle(e,t=!1){if(ug("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),$d)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");Sh=e,V3=t}function l0(e,t=!1){if($d)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")Ed=e;else{_d=e;let a=ele.filter(n=>_d[n]==null);if(a.length>0)throw new Error(`There were no entries found for the following binaries: ${a.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.`)}V3=t}var vk=-1,H1=-1;function ale(e){vk=e}function nle(){if(H1===-1)throw new Error("WASM backend not initialized.");return H1}var rle="4.14.0",sle=2;Qo("wasm",async()=>{let{wasm:e}=await Joe();return new bk(e)},sle);var xn=B();xn.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE",()=>15);xn.registerFlag("WEBGPU_CPU_FORWARD",()=>!0);xn.registerFlag("WEBGPU_MATMUL_PROGRAM_TYPE",()=>-1);xn.registerFlag("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE",()=>!0);xn.registerFlag("WEBGPU_USE_LOW_POWER_GPU",()=>!1);xn.registerFlag("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e3);xn.registerFlag("WEBGPU_USE_PROFILE_TOOL",()=>!1);xn.registerFlag("WEBGPU_IMPORT_EXTERNAL_TEXTURE",()=>!0);xn.registerFlag("WEBGPU_USE_NAIVE_CONV2D_DEBUG",()=>!1);xn.registerFlag("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL",()=>-1);xn.registerFlag("WEBGPU_CONV_SEPARATE_IM2COL_SHADER",()=>!1);xn.registerFlag("WEBGPU_PRINT_SHADER",()=>"");xn.registerFlag("WEBGPU_ENGINE_COMPILE_ONLY",()=>!1);var ile=class{constructor(e){e&&(this.vendor=e.vendor,this.architecture=e.architecture,this.intelGPUGeneration=this.getIntelGPUGeneration())}getIntelGPUGeneration(){if(this.isIntel()){if(this.architecture.startsWith("gen"))return Number(this.architecture.match(/\d+/));if(this.architecture.startsWith("xe"))return 12}return 0}isIntel(){return this.vendor==="intel"}},ole=class{constructor(e){this.device=e,this.numUsedBuffers=0,this.numFreeBuffers=0,this.freeBuffers=new Map,this.usedBuffers=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireBuffer(e,t,a=!1,n=!0){let r,s=Y5(e,t);return n?(this.freeBuffers.has(s)||this.freeBuffers.set(s,[]),this.freeBuffers.get(s).length>0?(r=this.freeBuffers.get(s).pop(),this.numFreeBuffers--):(r=this.device.createBuffer({size:e,usage:t,mappedAtCreation:a}),this.numBytesAllocated+=e)):(r=this.device.createBuffer({size:e,usage:t,mappedAtCreation:a}),this.numBytesAllocated+=e),this.usedBuffers.has(s)||this.usedBuffers.set(s,[]),this.usedBuffers.get(s).push(r),this.numUsedBuffers++,this.numBytesUsed+=e,r}releaseBuffer(e,t=!0){if(this.freeBuffers.size===0)return;let a=e.size,n=e.usage,r=Y5(a,n),s=this.usedBuffers.get(r),i=s.indexOf(e);if(i<0)throw new Error("Cannot find the buffer in buffer manager");s[i]=s[s.length-1],s.pop(),this.numUsedBuffers--,this.numBytesUsed-=a,t?(this.freeBuffers.get(r).push(e),this.numFreeBuffers++):(e.destroy(),this.numBytesAllocated-=a)}getNumUsedBuffers(){return this.numUsedBuffers}getNumFreeBuffers(){return this.numFreeBuffers}dispose(){this.freeBuffers.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.usedBuffers.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.freeBuffers=new Map,this.usedBuffers=new Map,this.numUsedBuffers=0,this.numFreeBuffers=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function Y5(e,t){return`${e}_${t}`}var lle=class{constructor(e){this.device=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures=new Map,this.usedTextures=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireTexture(e,t,a,n){let r=J5(a),s=e*t*r,i=Z5(e,t,a,n);if(this.freeTextures.has(i)||this.freeTextures.set(i,[]),this.usedTextures.has(i)||this.usedTextures.set(i,[]),this.numBytesUsed+=s,this.numUsedTextures++,this.freeTextures.get(i).length>0){this.numFreeTextures--;let l=this.freeTextures.get(i).shift();return this.usedTextures.get(i).push(l),l}this.numBytesAllocated+=s;let o=this.device.createTexture({size:[e,t],format:a,usage:n});return this.usedTextures.get(i).push(o),o}releaseTexture(e){if(this.freeTextures.size===0)return;let t=e.width,a=e.height,n=e.format,r=e.usage,s=Z5(t,a,n,r);this.freeTextures.has(s)||this.freeTextures.set(s,[]),this.freeTextures.get(s).push(e),this.numFreeTextures++,this.numUsedTextures--;let i=this.usedTextures.get(s),o=i.indexOf(e);if(o<0)throw new Error("Cannot release a texture that was never provided by this texture manager");i.splice(o,1);let l=J5(n),u=t*a*l;this.numBytesUsed-=u}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){this.freeTextures.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.usedTextures.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.freeTextures=new Map,this.usedTextures=new Map,this.numUsedTextures=0,this.numFreeTextures=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function Z5(e,t,a,n){return`${e}_${t}_${a}_${n}`}function J5(e){if(e==="rgba8unorm")return 16;throw new Error(`${e} is not supported!`)}function ule(e,t){if(Math.max(...e)>5)throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");let a=e.length,n="xyzwuv",r=e.map(i=>`${t}.${n[i]}`),s=new Array(a-1);s[a-2]=r[a-1];for(let i=a-3;i>=0;--i)s[i]=`(${s[i+1]} * ${r[i+1]})`;return s}var gs=(e,t,a)=>a==="int32"?`atomicAdd(${e}, bitcast(${t}));`:` + ${r.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let i=t.dataIdMap.get(n.dataId).id,o=t.dataIdMap.get(r.dataId).id,l=t.dataIdMap.get(s.dataId).id,u=n.shape[0],d=v.sizeFromShape(s.shape),c=t.makeOutput([u,d],n.dtype),p=t.dataIdMap.get(c.dataId).id,h=t.makeOutput([d],s.dtype),m=t.dataIdMap.get(h.dataId).id,f=t.makeOutput([3],"int32"),g=t.dataIdMap.get(f.dataId).id;Nk(i,o,l,u,p,m,g);let y=t.readSync(f.dataId),x;switch(y[0]){case 0:{x=I.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(y[1],y[2]);break}case 1:{x=I.getSparseReshapeNegativeOutputDimErrorMessage(y[1],y[2]);break}case 2:x=I.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage();break;case 3:{let A=Array.from(t.readSync(r.dataId)),b=Array.from(t.readSync(h.dataId));x=I.getSparseReshapeInputOutputMultipleErrorMessage(A,b);break}case 4:{let A=Array.from(t.readSync(r.dataId)),b=Array.from(t.readSync(h.dataId));x=I.getSparseReshapeInputOutputMismatchErrorMessage(A,b);break}default:x=""}if(t.disposeData(f.dataId),x)throw t.disposeData(c.dataId),t.disposeData(h.dataId),new Error(x);return[c,h]}var Hoe={kernelName:Bu,backendName:"wasm",setupFunc:Uoe,kernelFunc:Goe},Rk;function Ek(e){Rk=e.wasm.cwrap("SparseSegmentReduction",null,["number","number","number","number","number","number","number","number","number"])}function Mk(e,t){let{backend:a,inputs:n}=e,{data:r,indices:s,segmentIds:i}=n,o=s.shape[0],l=a.readSync(i.dataId,o-1,o)[0],u=o>0?l+1:0;if(u<0)throw new Error(I.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let d=r.shape.slice();d[0]=u;let c=a.dataIdMap.get(r.dataId).id,p=a.dataIdMap.get(s.dataId).id,h=a.dataIdMap.get(i.dataId).id,m=a.makeOutput(d,r.dtype),f=a.dataIdMap.get(m.dataId).id,g=a.makeOutput([4],"int32"),y=a.dataIdMap.get(g.dataId).id;Rk(c,nt[r.dtype],r.shape[0],p,h,f,y,t,0);let x=a.readSync(g.dataId),A;switch(x[0]){case 0:{A=I.getSparseSegmentReductionNegativeSegmentIdsErrorMessage();break}case 1:{A=I.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage();break}case 2:A=I.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(x[1],x[2]);break;case 3:A=I.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(x[1],x[2],x[3]);break;default:A=""}if(a.disposeData(g.dataId),A)throw a.disposeData(m.dataId),new Error(A);return m}function joe(e){return Mk(e,!0)}var qoe={kernelName:Vu,backendName:"wasm",setupFunc:Ek,kernelFunc:joe};function Xoe(e){return Mk(e,!1)}var Koe={kernelName:Uu,backendName:"wasm",setupFunc:Ek,kernelFunc:Xoe},Fk;function Yoe(e){Fk=e.wasm.cwrap(tl,null,["number","number","number","number","number","number","number","number","array","number","number"])}function Zoe(e){let{backend:t,inputs:a,attrs:n}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=a,{outputShape:o}=n,l=t.makeOutput(o,i.dtype);if(v.sizeFromShape(o)===0)return l;let{sliceRank:u,numUpdates:d,sliceSize:c,strides:p,outputSize:h}=I.calculateShapes(s,r,o),m=t.dataIdMap.get(r.dataId).id,f=t.dataIdMap.get(s.dataId).id,g=t.dataIdMap.get(i.dataId).id,y=new Uint8Array(new Int32Array(p).buffer),x=t.dataIdMap.get(l.dataId).id;return Fk(m,f,s.shape.length,g,nt[i.dtype],u,d,c,y,h,x),l}var Joe={kernelName:tl,backendName:"wasm",setupFunc:Yoe,kernelFunc:Zoe};function Qoe(e){let{inputs:t,attrs:a,backend:n}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=a,o=v.parseAxisParam(i,r.shape)[0],l=I.prepareSplitSize(r,s,o),u=new Array(r.shape.length).fill(0),d=r.shape.slice();return l.map(c=>{let p=[...d];p[o]=c;let h=Mi({inputs:{x:r},attrs:{begin:u,size:p},backend:n});return u[o]+=c,h})}var ele={kernelName:Wu,backendName:"wasm",kernelFunc:Qoe},tle=Qe(Es),ale=Qe(Fp),nle=!0,rle=Gt(Ms,nle),$k;function sle(e){$k=e.wasm.cwrap(Ds,null,["number","number","number","number"])}function ile(e){let{backend:t,inputs:a,attrs:n}=e,{alpha:r}=n,{x:s}=a,i=t.dataIdMap.get(s.dataId).id,o=t.makeOutput(s.shape,s.dtype),l=t.dataIdMap.get(o.dataId).id;return $k(i,r,nt[s.dtype],l),o}var ole={kernelName:Ds,backendName:"wasm",setupFunc:sle,kernelFunc:ile},Dk;function lle(e){Dk=e.wasm.cwrap(al,null,["number","array","number","array","array","array","array","array","number","number"])}function ule(e){let{backend:t,inputs:a,attrs:n}=e,{x:r}=a,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:d,newAxisMask:c,shrinkAxisMask:p}=n,{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=wt.sliceInfo(r.shape,s,i,o,l,u,d,c,p),w;if(f)w=La({inputs:{x:r},backend:t,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let S=wt.computeOutShape(x,A,b),C=Mi({inputs:{x:r},backend:t,attrs:{begin:x,size:S}});w=La({inputs:{x:C},backend:t,attrs:{shape:m}}),t.disposeData(C.dataId)}else{let S=t.makeOutput(h,"float32"),C=t.dataIdMap.get(r.dataId).id,N=new Uint8Array(new Int32Array(v.computeStrides(r.shape)).buffer),M=new Uint8Array(new Int32Array(x).buffer),F=new Uint8Array(new Int32Array(A).buffer),E=new Uint8Array(new Int32Array(b).buffer),T=new Uint8Array(new Int32Array(h).buffer),D=new Uint8Array(new Int32Array(v.computeStrides(h)).buffer),O=t.dataIdMap.get(S.dataId).id;Dk(C,N,r.shape.length,M,F,E,T,D,h.length,O),w=La({inputs:{x:S},backend:t,attrs:{shape:m}}),t.disposeData(S.dataId)}return w}var dle={kernelName:al,backendName:"wasm",setupFunc:lle,kernelFunc:ule};function ple(e){let{backend:t,inputs:a,attrs:n}=e,{data:r,dataSplits:s}=a,{separator:i,nGramWidths:o,leftPad:l,rightPad:u,padWidth:d,preserveShortSequences:c}=n,p=t.readSync(r.dataId),h=t.readSync(s.dataId),[m,f]=N3(p,h,i,o,l,u,d,c),g=t.makeOutput([m.length],"string"),y=t.dataIdMap.get(g.dataId);y.stringBytes=m;let x=t.makeOutput(s.shape,"int32");return t.typedArrayFromHeap(x).set(f),[g,x]}var cle={kernelName:Hu,backendName:"wasm",kernelFunc:ple};function hle(e){let{backend:t,inputs:a,attrs:n}=e,{input:r,delimiter:s}=a,{skipEmpty:i}=n,o=t.readSync(r.dataId),l=t.readSync(s.dataId),[u,d,c]=R3(o,l[0],i),p=d.length,h=t.makeOutput([p,2],"int32");t.typedArrayFromHeap(h).set(u);let m=t.makeOutput([p],"string"),f=t.dataIdMap.get(m.dataId);f.stringBytes=d;let g=t.makeOutput([2],"int32");return t.typedArrayFromHeap(g).set(c),[h,m,g]}var mle={kernelName:$p,backendName:"wasm",kernelFunc:hle};function fle(e){let{backend:t,inputs:a,attrs:n}=e,{input:r}=a,{numBuckets:s}=n,i=t.readSync(r.dataId),o=E3(i,s),l=t.makeOutput(r.shape,"int32");return t.typedArrayFromHeap(l).set(o),l}var gle={kernelName:Dp,backendName:"wasm",kernelFunc:fle},yle=!0,xle=Gt(Fs,yle),Pk;function Ale(e){Pk=e.wasm.cwrap(Qo,null,["number","number","number","number"])}function ble(e){let{backend:t,inputs:a,attrs:n}=e,{axis:r,keepDims:s}=n,{x:i}=a,o=t.dataIdMap.get(i.dataId).id,l=o,u=i,{transposed:d,axes:c,originalAxes:p,inputWasTransposed:h}=Ls(i,r,t),m=c;if(h){let A=t.dataIdMap.get(d.dataId).id;A!==o&&(u=d,l=A,m=I.getInnerMostAxes(m.length,u.shape.length))}I.assertAxesAreInnerMostDims("sum",m,u.shape.length);let[f,g]=I.computeOutAndReduceShapes(u.shape,m),y=v.sizeFromShape(g),x=t.makeOutput(f,u.dtype);if(v.sizeFromShape(u.shape)!==0){let A=t.dataIdMap.get(x.dataId).id;Pk(l,y,nt[x.dtype],A)}if(h&&t.disposeData(d.dataId),s){let A=I.expandShapeToKeepDim(x.shape,p);x.shape=A}return x}var vle={kernelName:Qo,backendName:"wasm",setupFunc:Ale,kernelFunc:ble},wle=Qe(nl),kle=Qe(rl),_k;function Ile(e){_k=e.wasm.cwrap(jo,null,["number","number","number","number","number","number","array","number","number","number"])}function Sle(e){let{backend:t,inputs:a,attrs:n}=e,{tensor:r,indices:s,updates:i}=a,{}=n,o=t.makeOutput(r.shape,r.dtype);if(v.sizeFromShape(r.shape)===0)return o;let{sliceRank:l,numUpdates:u,sliceSize:d,strides:c,outputSize:p}=Qh.calculateShapes(i,s,r.shape),h=t.dataIdMap.get(s.dataId).id,m=t.dataIdMap.get(i.dataId).id,f=t.dataIdMap.get(r.dataId).id,g=new Uint8Array(new Int32Array(c).buffer),y=t.dataIdMap.get(o.dataId).id;return _k(h,m,nt[i.dtype],l,u,d,g,p,y,f),o}var Tle={kernelName:jo,backendName:"wasm",setupFunc:Ile,kernelFunc:Sle},Ok;function Cle(e){Ok=e.wasm.cwrap($s,null,["number","array","number","array","number","number"])}function Nle(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,s=a.dataIdMap.get(r.dataId).id,{reps:i}=n,o=new Array(r.shape.length);for(let p=0;p{let{x:n}=e,{k:r,sorted:s}=a,i=t.dataIdMap.get(n.dataId).id,o=new Uint8Array(new Int32Array(n.shape).buffer),l=n.shape.slice();l[l.length-1]=r;let u=t.makeOutput(l,n.dtype),d=t.dataIdMap.get(u.dataId).id,c=t.makeOutput(l,"int32"),p=t.dataIdMap.get(c.dataId).id;return zk(i,o,n.shape.length,nt[n.dtype],r,s,d,p),[u,c]},Fle={kernelName:sl,backendName:"wasm",setupFunc:Ele,kernelFunc:Mle},Lk;function $le(e){Lk=e.wasm.cwrap(il,null,["number","number","bool","number","number","number","number","number","number","array","number","array","number","number","number","number","number"])}function Dle(e){let{backend:t,inputs:a,attrs:n}=e,{image:r,transforms:s}=a,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=n,[d,c,p,h]=r.shape,[m,f]=u!=null?u:[c,p],g=[d,m,f,h],y=new Uint8Array(new Int32Array(v.computeStrides(r.shape)).buffer),x=new Uint8Array(new Int32Array(v.computeStrides(g)).buffer),A=t.makeOutput(g,r.dtype),b=t.dataIdMap.get(A.dataId).id,w=t.dataIdMap.get(r.dataId).id,S=t.dataIdMap.get(s.dataId).id,C=i==="nearest"?1:2,N;switch(o){case"constant":N=1;break;case"reflect":N=2;break;case"wrap":N=3;break;case"nearest":N=4;break;default:N=1;break}return Lk(w,S,s.shape[0]>1,d,m,f,h,p,c,y,r.shape.length-1,x,g.length-1,C,N,l,b),A}var Ple={kernelName:il,backendName:"wasm",setupFunc:$le,kernelFunc:Dle};function _le(e){let{inputs:t,attrs:a,backend:n}=e,{axis:r}=a,{x:s}=t,{outputValues:i,outputShape:o,indices:l}=F3(n.readSync(s.dataId),r,s.shape,s.dtype);return[n.makeOutput(o,s.dtype,void 0,i),n.makeOutput([l.length],"int32",void 0,l)]}var Ole={kernelName:Pp,backendName:"wasm",kernelFunc:_le};function zle(e){let{inputs:t,backend:a,attrs:n}=e,{value:r}=t,{axis:s}=n;s<0&&(s+=r.shape.length);let i=r.shape[s],o=r.shape.length,l=new Array(o-1),u=0;for(let h=0;h({dataId:h,dtype:m,shape:l}))}var Lle={kernelName:ju,backendName:"wasm",kernelFunc:zle};function Wle(e){let{inputs:{x:t},backend:a}=e,n=a.makeOutput(t.shape,t.dtype);return a.typedArrayFromHeap(n).fill(0),n}var Ble={kernelName:qu,backendName:"wasm",kernelFunc:Wle},Vle=[kae,Iae,Sae,Tae,Nae,Mae,Lae,Vae,Uae,Gae,Hae,jae,qae,Xae,Kae,Jae,one,tne,rne,pne,yne,bne,wne,Ine,Sne,Tne,Rne,Ene,$ne,_ne,Lne,Vne,Hne,jne,qne,Yne,Qne,are,sre,lre,pre,mre,yre,bre,kre,Ire,Cre,Rre,Ere,Mre,Fre,$re,Dre,Ore,zre,Wre,Ure,jre,Kre,Jre,tse,nse,sse,Fae,ise,ose,lse,pse,hse,fse,xse,bse,Ase,wse,kse,Sse,Cse,Ese,$se,_se,zse,Bse,Gse,qse,Yse,Qse,aie,sie,oie,die,fie,gie,xie,Aie,wie,Sie,Nie,Eie,$ie,Pie,Oie,mk,Bie,Gie,qie,Kie,Zie,Jie,Qie,eoe,lne,noe,ioe,uoe,coe,foe,xoe,Aoe,boe,koe,Toe,Roe,Eoe,$oe,Doe,Poe,_oe,fne,cie,Ooe,Loe,Voe,Hoe,qoe,Koe,Joe,ele,tle,ale,rle,ole,dle,cle,mle,gle,xle,vle,wle,kle,Tle,Rle,Fle,Ple,_ae,Ole,Lle,Ble];for(let e of Vle)bn(e);var Z1=B();Z1.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>{try{return 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]))}catch(e){return!1}});Z1.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(Z1.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 iA=uu(GC()),Ule=uu(HC()),oA=uu(jC()),lA=iA.default||iA,Gle=oA.default||oA,Wk=class extends du{constructor(e){super(),this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(Bk),J1=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new hp(this,St())}write(e,t,a){let n={id:this.dataIdNextNumber++};return this.move(n,e,t,a,1),n}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=v.now();return e(),{kernelMs:v.now()-t}}move(e,t,a,n,r){let s=this.dataIdNextNumber++;if(n==="string"){let u=t;this.dataIdMap.set(e,{id:s,stringBytes:u,shape:a,dtype:n,memoryOffset:null,refCount:r});return}let i=v.sizeFromShape(a),o=i*v.bytesPerElement(n),l=this.wasm._malloc(o)>>>0;this.dataIdMap.set(e,{id:s,memoryOffset:l,shape:a,dtype:n,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,t,a){let{memoryOffset:n,dtype:r,shape:s,stringBytes:i}=this.dataIdMap.get(e);if(r==="string")return(t==null||t===0)&&(a==null||a>=i.length)?i:i.slice(t,a);t=t||0,a=a||v.sizeFromShape(s);let o=v.bytesPerElement(r),l=this.wasm.HEAPU8.slice(n+t*o,n+a*o);return qle(l.buffer,r)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let a=this.dataIdMap.get(e);if(a.refCount--,!t&&a.refCount>0)return!1;this.wasm._free(a.memoryOffset),this.wasm.tfjs.disposeData(a.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,a,n){let r;if(a==null)r=this.write(n!=null?n:null,e,t);else{let s=this.dataIdNextNumber++;r={id:s},this.dataIdMap.set(r,{id:s,memoryOffset:a,shape:e,dtype:t,refCount:1});let i=v.sizeFromShape(e);this.wasm.tfjs.registerTensor(s,i,a)}return{dataId:r,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:a}){let n=this.wasm.HEAPU8.buffer,{memoryOffset:r}=this.dataIdMap.get(a),s=v.sizeFromShape(e);switch(t){case"float32":return new Float32Array(n,r,s);case"int32":return new Int32Array(n,r,s);case"bool":return new Uint8Array(n,r,s);default:throw new Error(`Unknown dtype ${t}`)}}};function Hle(e){return(t,a)=>(v.fetch(e,{credentials:"same-origin"}).then(n=>{n.ok||t.env.a(`failed to load wasm binary file at '${e}'`),n.arrayBuffer().then(r=>{WebAssembly.instantiate(r,t).then(s=>{a(s.instance,s.module)})})}),{})}function uA(e,t,a){if(Fh!=null)return Fh;let n="tfjs-backend-wasm.wasm";return e&&t?n="tfjs-backend-wasm-threaded-simd.wasm":e&&(n="tfjs-backend-wasm-simd.wasm"),Vd!=null&&Vd[n]!=null?Vd[n]:a+n}async function jle(){let[e,t]=await Promise.all([B().getAsync("WASM_HAS_SIMD_SUPPORT"),B().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((a,n)=>{let r={};r.locateFile=(o,l)=>{if(o.endsWith(".worker.js")){let u=Ule.wasmWorkerContents.replace(/\n/g,"\\n"),d=new Blob([u],{type:"application/javascript"});return URL.createObjectURL(d)}return o.endsWith(".wasm")?uA(e,t,zd!=null?zd:l):l+o},J3&&(r.instantiateWasm=Hle(uA(e,t,zd!=null?zd:"")));let s=!1;r.onAbort=()=>{s||Ud||(Ud=!0,n({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&&Fh==null?(r.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+lA.toString()],{type:"text/javascript"}),i=lA(r)):i=Gle(r),i.then(o=>{s=!0,Ud=!1;let l=null;o.tfjs={init:o.cwrap("init",null,[]),initWithThreadsCount:o.cwrap("init_with_threads_count",null,["number"]),getThreadsCount:o.cwrap("get_threads_count","number",[]),registerTensor:o.cwrap("register_tensor",null,["number","number","number"]),disposeData:o.cwrap("dispose_data",l,["number"]),dispose:o.cwrap("dispose",l,[])},a({wasm:o})}).catch(n)})}function qle(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 Xle=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],Fh=null,zd=null,Vd={},Ud=!1,J3=!1;function Kle(e,t=!1){if(fg("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),Ud)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");Fh=e,J3=t}function f0(e,t=!1){if(Ud)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")zd=e;else{Vd=e;let a=Xle.filter(n=>Vd[n]==null);if(a.length>0)throw new Error(`There were no entries found for the following binaries: ${a.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.`)}J3=t}var Bk=-1,J1=-1;function Yle(e){Bk=e}function Zle(){if(J1===-1)throw new Error("WASM backend not initialized.");return J1}var Jle="4.17.0",Qle=2;ll("wasm",async()=>{let{wasm:e}=await jle();return new Wk(e)},Qle);var vn=B();vn.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE",()=>15);vn.registerFlag("WEBGPU_CPU_FORWARD",()=>!0);vn.registerFlag("WEBGPU_MATMUL_PROGRAM_TYPE",()=>-1);vn.registerFlag("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE",()=>!0);vn.registerFlag("WEBGPU_USE_LOW_POWER_GPU",()=>!1);vn.registerFlag("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e3);vn.registerFlag("WEBGPU_USE_PROFILE_TOOL",()=>!1);vn.registerFlag("WEBGPU_IMPORT_EXTERNAL_TEXTURE",()=>!0);vn.registerFlag("WEBGPU_USE_NAIVE_CONV2D_DEBUG",()=>!1);vn.registerFlag("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL",()=>-1);vn.registerFlag("WEBGPU_CONV_SEPARATE_IM2COL_SHADER",()=>!1);vn.registerFlag("WEBGPU_PRINT_SHADER",()=>"");vn.registerFlag("WEBGPU_ENGINE_COMPILE_ONLY",()=>!1);var eue=class{constructor(e){e&&(this.vendor=e.vendor,this.architecture=e.architecture,this.intelGPUGeneration=this.getIntelGPUGeneration())}getIntelGPUGeneration(){if(this.isIntel()){if(this.architecture.startsWith("gen"))return Number(this.architecture.match(/\d+/));if(this.architecture.startsWith("xe"))return 12}return 0}isIntel(){return this.vendor==="intel"}},tue=class{constructor(e){this.device=e,this.numUsedBuffers=0,this.numFreeBuffers=0,this.freeBuffers=new Map,this.usedBuffers=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireBuffer(e,t,a=!1,n=!0){let r,s=dA(e,t);return n?(this.freeBuffers.has(s)||this.freeBuffers.set(s,[]),this.freeBuffers.get(s).length>0?(r=this.freeBuffers.get(s).pop(),this.numFreeBuffers--):(r=this.device.createBuffer({size:e,usage:t,mappedAtCreation:a}),this.numBytesAllocated+=e)):(r=this.device.createBuffer({size:e,usage:t,mappedAtCreation:a}),this.numBytesAllocated+=e),this.usedBuffers.has(s)||this.usedBuffers.set(s,[]),this.usedBuffers.get(s).push(r),this.numUsedBuffers++,this.numBytesUsed+=e,r}releaseBuffer(e,t=!0){if(this.freeBuffers.size===0)return;let a=e.size,n=e.usage,r=dA(a,n),s=this.usedBuffers.get(r),i=s.indexOf(e);if(i<0)throw new Error("Cannot find the buffer in buffer manager");s[i]=s[s.length-1],s.pop(),this.numUsedBuffers--,this.numBytesUsed-=a,t?(this.freeBuffers.get(r).push(e),this.numFreeBuffers++):(e.destroy(),this.numBytesAllocated-=a)}getNumUsedBuffers(){return this.numUsedBuffers}getNumFreeBuffers(){return this.numFreeBuffers}dispose(){this.freeBuffers.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.usedBuffers.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.freeBuffers=new Map,this.usedBuffers=new Map,this.numUsedBuffers=0,this.numFreeBuffers=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function dA(e,t){return`${e}_${t}`}var aue=class{constructor(e){this.device=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures=new Map,this.usedTextures=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireTexture(e,t,a,n){let r=cA(a),s=e*t*r,i=pA(e,t,a,n);if(this.freeTextures.has(i)||this.freeTextures.set(i,[]),this.usedTextures.has(i)||this.usedTextures.set(i,[]),this.numBytesUsed+=s,this.numUsedTextures++,this.freeTextures.get(i).length>0){this.numFreeTextures--;let l=this.freeTextures.get(i).shift();return this.usedTextures.get(i).push(l),l}this.numBytesAllocated+=s;let o=this.device.createTexture({size:[e,t],format:a,usage:n});return this.usedTextures.get(i).push(o),o}releaseTexture(e){if(this.freeTextures.size===0)return;let t=e.width,a=e.height,n=e.format,r=e.usage,s=pA(t,a,n,r);this.freeTextures.has(s)||this.freeTextures.set(s,[]),this.freeTextures.get(s).push(e),this.numFreeTextures++,this.numUsedTextures--;let i=this.usedTextures.get(s),o=i.indexOf(e);if(o<0)throw new Error("Cannot release a texture that was never provided by this texture manager");i.splice(o,1);let l=cA(n),u=t*a*l;this.numBytesUsed-=u}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){this.freeTextures.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.usedTextures.forEach((e,t)=>{e.forEach(a=>{a.destroy()})}),this.freeTextures=new Map,this.usedTextures=new Map,this.numUsedTextures=0,this.numFreeTextures=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function pA(e,t,a,n){return`${e}_${t}_${a}_${n}`}function cA(e){if(e==="rgba8unorm")return 16;throw new Error(`${e} is not supported!`)}function nue(e,t){if(Math.max(...e)>5)throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");let a=e.length,n="xyzwuv",r=e.map(i=>`${t}.${n[i]}`),s=new Array(a-1);s[a-2]=r[a-1];for(let i=a-3;i>=0;--i)s[i]=`(${s[i+1]} * ${r[i+1]})`;return s}var Bs=(e,t,a)=>a==="int32"?`atomicAdd(${e}, bitcast(${t}));`:` { var oldValue = 0; loop { @@ -5006,12 +5006,12 @@ return a / b;`,vJ=` } oldValue = res.old_value; } - }`,eu;(function(e){e[e.FROM_PIXELS=0]="FROM_PIXELS",e[e.DRAW=1]="DRAW"})(eu||(eu={}));var dle=(e,t,a,n,r)=>{let s={dtype:n.dtype,shape:n.shape},i=cle(a,s,t),o=e.createShaderModule({code:i,label:t.constructor.name}),l=B().get("WEBGPU_PRINT_SHADER");if(l!==""){l=l.toLowerCase();let u=l.split(",");(l==="all"||u.some(p=>t.shaderKey.toLowerCase().includes(p)))&&(console.group(t.shaderKey),console.debug(i),console.groupEnd())}return r?e.createComputePipelineAsync({compute:{module:o,entryPoint:"_start"},label:t.constructor.name,layout:"auto"}):e.createComputePipeline({compute:{module:o,entryPoint:"_start"},label:t.constructor.name,layout:"auto"})},Xe=(e,t="f32")=>{switch(e){case 1:return`${t}`;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw new Error(`${e}-component ${t} is not supported.`)}};function _t(e){if(e<=1)return"i32";if(e===2)return"vec2";if(e===3)return"vec3";if(e===4)return"vec4";if(e===5)return"vec5";if(e===6)return"vec6";throw Error(`GPU for rank ${e} is not yet supported`)}function Ir(e){if(e===0)return"x";if(e===1)return"y";if(e===2)return"z";if(e===3)return"w";if(e===4)return"u";if(e===5)return"v";throw Error(`Index ${e} is not yet supported`)}function ue(...e){let t;switch(e.length){case 0:t=` + }`,lu;(function(e){e[e.FROM_PIXELS=0]="FROM_PIXELS",e[e.DRAW=1]="DRAW"})(lu||(lu={}));var rue=(e,t,a,n,r)=>{let s={dtype:n.dtype,shape:n.shape},i=iue(a,s,t),o=e.createShaderModule({code:i,label:t.constructor.name}),l=B().get("WEBGPU_PRINT_SHADER");if(l!==""){l=l.toLowerCase();let u=l.split(",");(l==="all"||u.some(d=>t.shaderKey.toLowerCase().includes(d)))&&(console.group(t.shaderKey),console.debug(i),console.groupEnd())}return r?e.createComputePipelineAsync({compute:{module:o,entryPoint:"_start"},label:t.constructor.name,layout:"auto"}):e.createComputePipeline({compute:{module:o,entryPoint:"_start"},label:t.constructor.name,layout:"auto"})},Xe=(e,t="f32")=>{switch(e){case 1:return`${t}`;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw new Error(`${e}-component ${t} is not supported.`)}};function Dt(e){if(e<=1)return"i32";if(e===2)return"vec2";if(e===3)return"vec3";if(e===4)return"vec4";if(e===5)return"vec5";if(e===6)return"vec6";throw Error(`GPU for rank ${e} is not yet supported`)}function Nr(e){if(e===0)return"x";if(e===1)return"y";if(e===2)return"z";if(e===3)return"w";if(e===4)return"u";if(e===5)return"v";throw Error(`Index ${e} is not yet supported`)}function ue(...e){let t;switch(e.length){case 0:t=` fn main() `;break;case 1:t=` fn main(${e[0]} : i32) - `;break;default:throw Error("Unreachable")}return t}function Q5(e,t){let a;return a=` - ${ple(t)} + `;break;default:throw Error("Unreachable")}return t}function hA(e,t){let a;return a=` + ${sue(t)} fn _start(@builtin(local_invocation_id) LocalId : vec3, @builtin(global_invocation_id) GlobalId : vec3, @builtin(local_invocation_index) LocalIndex: u32, @@ -5024,9 +5024,9 @@ return a / b;`,vJ=` workgroupId = WorkgroupId; ${e?"main(getGlobalIndex());":"main();"}; } - `,a}function ple(e){return` + `,a}function sue(e){return` @compute @workgroup_size(${e.workgroupSize[0]}, ${e.workgroupSize[1]}, ${e.workgroupSize[2]}) -`}function cle(e,t,a){let n=[],r=a.workgroupSize[0]*a.workgroupSize[1]*a.workgroupSize[2];if(a.outputComponent=a.outputComponent?a.outputComponent:1,n.push(` +`}function iue(e,t,a){let n=[],r=a.workgroupSize[0]*a.workgroupSize[1]*a.workgroupSize[2];if(a.outputComponent=a.outputComponent?a.outputComponent:1,n.push(` var localId: vec3; var localIndex: u32; @@ -5036,12 +5036,12 @@ return a / b;`,vJ=` // Only used when the y/z dimension of workgroup size is 1. fn getGlobalIndex() -> i32 { - ${wk(a)?" return i32(globalId.x);":` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y + + ${Vk(a)?" return i32(globalId.x);":` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y + workgroupId.y * numWorkgroups.x + workgroupId.x) * ${r}u + localIndex); `} } - `),a.pixelsOpType!=null){let h=a.pixelsOpType===eu.FROM_PIXELS?`@group(0) @binding(0) var result: array<${Gs(t.dtype,a.outputComponent)}>;`:`@group(0) @binding(1) var inBuf : array<${Gs(e[0].dtype,a.outputComponent)}>;`,m=t.shape.length===3?"vec2":"i32";n.push(` + `),a.pixelsOpType!=null){let h=a.pixelsOpType===lu.FROM_PIXELS?`@group(0) @binding(0) var result: array<${gi(t.dtype,a.outputComponent)}>;`:`@group(0) @binding(1) var inBuf : array<${gi(e[0].dtype,a.outputComponent)}>;`,m=t.shape.length===3?"vec2":"i32";n.push(` struct Uniform { outShapeStrides : ${m}, size : i32, @@ -5051,21 +5051,21 @@ return a / b;`,vJ=` ${h} @group(0) @binding(2) var uniforms: Uniform; - `);let f=tA(a);return[eA,n.join(` -`),ih(t.shape),a.getUserCode(),Q5(f,a)].join(` -`)}let s,i,o="struct Uniforms { NAN : f32, INFINITY : f32, ";a.variableNames.forEach((h,m)=>{let f=_t(e[m].shape.length);o+=`${h.charAt(0).toLowerCase()+h.slice(1)}Shape : ${f}, `,s=e[m].shape.length-1,i=_t(s),o+=`${h.charAt(0).toLowerCase()+h.slice(1)}ShapeStrides: ${i}, `});let l=_t(t.shape.length);o+=`outShape : ${l}, `,s=t.shape.length-1,i=_t(s),o+=` - outShapeStrides: ${i}, `,a.size&&(o+="size : i32, "),a.uniforms&&(o+=a.uniforms),o+="};",o=vle(o),n.push(o),a.atomic?n.push(` + `);let f=fA(a);return[mA,n.join(` +`),mh(t.shape),a.getUserCode(),hA(f,a)].join(` +`)}let s,i,o="struct Uniforms { NAN : f32, INFINITY : f32, ";a.variableNames.forEach((h,m)=>{let f=Dt(e[m].shape.length);o+=`${h.charAt(0).toLowerCase()+h.slice(1)}Shape : ${f}, `,s=e[m].shape.length-1,i=Dt(s),o+=`${h.charAt(0).toLowerCase()+h.slice(1)}ShapeStrides: ${i}, `});let l=Dt(t.shape.length);o+=`outShape : ${l}, `,s=t.shape.length-1,i=Dt(s),o+=` + outShapeStrides: ${i}, `,a.size&&(o+="size : i32, "),a.uniforms&&(o+=a.uniforms),o+="};",o=fue(o),n.push(o),a.atomic?n.push(` @group(0) @binding(0) var result: array>; `):n.push(` - @group(0) @binding(0) var result: array<${Gs(t.dtype,a.outputComponent)}>; + @group(0) @binding(0) var result: array<${gi(t.dtype,a.outputComponent)}>; `),a.variableNames.forEach((h,m)=>{n.push(` - @group(0) @binding(${1+m}) var ${h}: array<${a.variableComponents?Gs(e[m].dtype,a.variableComponents[m]):Gs(e[m].dtype,a.outputComponent)}>; + @group(0) @binding(${1+m}) var ${h}: array<${a.variableComponents?gi(e[m].dtype,a.variableComponents[m]):gi(e[m].dtype,a.outputComponent)}>; `)}),o!==""&&n.push(` @group(0) @binding(${1+a.variableNames.length}) var uniforms: Uniforms; - `);let u=xle(t.shape,a.dispatchLayout),p=[eA,n.join(` -`)+mle,ih(t.shape),u,Ale(t.shape.length)];a.atomic||p.push(ble(t.shape,t.dtype,a.outputComponent)),a.variableNames.forEach((h,m)=>{p.push(`${ih(e[m].shape,h)}`)});let c=e.map((h,m)=>yle(h,t.shape,a.variableComponents?a.variableComponents[m]:a.outputComponent,a.dispatchLayout.x.length===t.shape.length)).join(` -`);p.push(c),p.push(a.getUserCode());let d=tA(a);return p.push(Q5(d,a)),p.join(` -`)}function hle(e,t,a){let n=e.shaderKey;if(e.pixelsOpType!=null)return n;let r=[],s=[];t.forEach(p=>{r.push(p.shape),s.push(p.dtype)}),r.push(a.shape),s.push(a.dtype);let i=t.map(p=>C.getBroadcastDims(p.shape,a.shape)),o=t.map(p=>v.arraysEqual(p.shape,a.shape)).join("_"),l=i.map(p=>p.join("_")).join(";"),u=wk(e)?"flatDispatch":"";return n+="_"+(e.workgroupSize?e.workgroupSize.join(","):"")+r.map(p=>p.length).join(",")+s.join(",")+e.variableNames.join(",")+l+o+u,n}var eA=` + `);let u=cue(t.shape,a.dispatchLayout),d=[mA,n.join(` +`)+lue,mh(t.shape),u,hue(t.shape.length)];a.atomic||d.push(mue(t.shape,t.dtype,a.outputComponent)),a.variableNames.forEach((h,m)=>{d.push(`${mh(e[m].shape,h)}`)});let c=e.map((h,m)=>pue(h,t.shape,a.variableComponents?a.variableComponents[m]:a.outputComponent,a.dispatchLayout.x.length===t.shape.length)).join(` +`);d.push(c),d.push(a.getUserCode());let p=fA(a);return d.push(hA(p,a)),d.join(` +`)}function oue(e,t,a){let n=e.shaderKey;if(e.pixelsOpType!=null)return n;let r=[],s=[];t.forEach(d=>{r.push(d.shape),s.push(d.dtype)}),r.push(a.shape),s.push(a.dtype);let i=t.map(d=>I.getBroadcastDims(d.shape,a.shape)),o=t.map(d=>v.arraysEqual(d.shape,a.shape)).join("_"),l=i.map(d=>d.join("_")).join(";"),u=Vk(e)?"flatDispatch":"";return n+="_"+(e.workgroupSize?e.workgroupSize.join(","):"")+r.map(d=>d.length).join(",")+s.join(",")+e.variableNames.join(",")+l+o+u,n}var mA=` struct vec5 {x: i32, y: i32, z: i32, w: i32, u: i32}; struct vec6 {x: i32, y: i32, z: i32, w: i32, u: i32, v: i32}; @@ -5115,19 +5115,19 @@ return a / b;`,vJ=` let floatToUint: vec4 = bitcast>(val); return (floatToUint & vec4(0x7fffffffu)) > vec4(0x7f800000u); } -`,mle=` +`,lue=` fn isinf(val: f32) -> bool { return abs(val) == uniforms.INFINITY; } -`;function ih(e,t=""){let a=e.length,n=t!==""?`get${t.charAt(0).toUpperCase()+t.slice(1)}CoordsFromIndex`:"getCoordsFromIndex",r=t!==""?`${t.charAt(0).toLowerCase()+t.slice(1)}ShapeStrides`:"outShapeStrides";if(a<=1)return`fn ${n}(index : i32) -> i32 { return index; }`;let s=v.computeStrides(e),i=_t(a),o=[];for(let u=0;u vec2 { +`;function mh(e,t=""){let a=e.length,n=t!==""?`get${t.charAt(0).toUpperCase()+t.slice(1)}CoordsFromIndex`:"getCoordsFromIndex",r=t!==""?`${t.charAt(0).toLowerCase()+t.slice(1)}ShapeStrides`:"outShapeStrides";if(a<=1)return`fn ${n}(index : i32) -> i32 { return index; }`;let s=v.computeStrides(e),i=Dt(a),o=[];for(let u=0;u vec2 { let d0 = index / uniforms.${r}; let d1 = index - d0 * uniforms.${r}; return vec2(d0, d1); - }`;let l;return l="var index2 = index;"+s.map((u,p)=>{let c=`let ${o[p]} = index2 / uniforms.${r}.${Ir(p)}`,d=p===s.length-1?`let ${o[p+1]} = index2 - ${o[p]} * uniforms.${r}.${Ir(p)}`:`index2 = index2 - ${o[p]} * uniforms.${r}.${Ir(p)}`;return`${c}; ${d};`}).join(""),` + }`;let l;return l="var index2 = index;"+s.map((u,d)=>{let c=`let ${o[d]} = index2 / uniforms.${r}.${Nr(d)}`,p=d===s.length-1?`let ${o[d+1]} = index2 - ${o[d]} * uniforms.${r}.${Nr(d)}`:`index2 = index2 - ${o[d]} * uniforms.${r}.${Nr(d)}`;return`${c}; ${p};`}).join(""),` fn ${n}(index : i32) -> ${i} { ${l} return ${i}(${o.join(",")}); } - `}function fle(e,t){let a=e.name,n=e.shape.length,r=_t(n),s="get"+a.charAt(0).toUpperCase()+a.slice(1),i=["d0","d1","d2","d3","d4","d5"].slice(0,n),o=i.map(p=>`${p} : i32`).join(", ");if(n<1)return` + `}function uue(e,t){let a=e.name,n=e.shape.length,r=Dt(n),s="get"+a.charAt(0).toUpperCase()+a.slice(1),i=["d0","d1","d2","d3","d4","d5"].slice(0,n),o=i.map(d=>`${d} : i32`).join(", ");if(n<1)return` fn ${s}() -> ${Xe(t)} { return ${Xe(t)}(${a}[0]); } @@ -5136,7 +5136,7 @@ return a / b;`,vJ=` return ${Xe(t)}(${a}[getIndexFromCoords${u}(${r}(${i.join(",")}), ${l})${t===1?"":` / ${t}`}]); } - `}function gle(e,t,a,n){let r=e.name,s=r.charAt(0).toUpperCase()+r.slice(1),i="get"+s+"ByOutput",o=e.shape.length,l=t.length,u=_t(l);if(v.arraysEqual(e.shape,t)&&n)return` + `}function due(e,t,a,n){let r=e.name,s=r.charAt(0).toUpperCase()+r.slice(1),i="get"+s+"ByOutput",o=e.shape.length,l=t.length,u=Dt(l);if(v.arraysEqual(e.shape,t)&&n)return` fn ${i}Index(globalIndex : i32) -> ${Xe(a)} { return ${Xe(a)}(${r}[globalIndex]); } @@ -5144,7 +5144,7 @@ return a / b;`,vJ=` fn ${i}Coords(coords : ${u}) -> ${Xe(a)} { return ${Xe(a)}(${r}[${l>1?"getOutputIndexFromCoords(coords)":"coords"}${a===1?"":` / ${a}`}]); } - `;let p=C.getBroadcastDims(e.shape,t),c=l-o,d="";if(o===0)return` + `;let d=I.getBroadcastDims(e.shape,t),c=l-o,p="";if(o===0)return` fn ${i}Index(globalIndex : i32) -> ${Xe(a)}{ return get${s}(); } @@ -5152,26 +5152,26 @@ return a / b;`,vJ=` fn ${i}Coords(coords : ${u}) -> ${Xe(a)}{ return get${s}(); } - `;l<2&&p.length>=1?d="coords = 0;":d=p.map(g=>`coords.${Ir(g+c)} = 0;`).join(` -`);let h="";if(l<2&&o>0)h="coords";else if(l>1){let g=_t(o),y=e.shape.map((x,A)=>`coords.${Ir(A+c)}`).join(", ");h=`${g}(${y})`}else h="coords";let m=`uniforms.${r.charAt(0).toLowerCase()+r.slice(1)}Shape`,f=`${o}D`;return` + `;l<2&&d.length>=1?p="coords = 0;":p=d.map(g=>`coords.${Nr(g+c)} = 0;`).join(` +`);let h="";if(l<2&&o>0)h="coords";else if(l>1){let g=Dt(o),y=e.shape.map((x,A)=>`coords.${Nr(A+c)}`).join(", ");h=`${g}(${y})`}else h="coords";let m=`uniforms.${r.charAt(0).toLowerCase()+r.slice(1)}Shape`,f=`${o}D`;return` fn ${i}Index(globalIndex : i32) -> ${Xe(a)} { var coords = getCoordsFromIndex(globalIndex); - ${d} + ${p} return ${Xe(a)}(${r}[getIndexFromCoords${f}(${h}, ${m})${a===1?"":` / ${a}`}]); } fn ${i}Coords(coordsIn : ${u}) -> ${Xe(a)} { var coords = coordsIn; - ${d} + ${p} return ${Xe(a)}(${r}[getIndexFromCoords${f}(${h}, ${m})${a===1?"":` / ${a}`}]); } -`}function yle(e,t,a,n){let r=fle(e,a);return e.shape.length<=t.length&&(r+=gle(e,t,a,n)),r}function xle(e,t){let{x:a,y:n=[],z:r=[]}=t,s=e.length,i=a.length+n.length+r.length;if(i!==s)return"";if(a.length===s)return`fn getOutputCoords() -> ${_t(s)}{ +`}function pue(e,t,a,n){let r=uue(e,a);return e.shape.length<=t.length&&(r+=due(e,t,a,n)),r}function cue(e,t){let{x:a,y:n=[],z:r=[]}=t,s=e.length,i=a.length+n.length+r.length;if(i!==s)return"";if(a.length===s)return`fn getOutputCoords() -> ${Dt(s)}{ let globalIndex = getGlobalIndex(); return getCoordsFromIndex(globalIndex); } - `;let o="",l=[a,n,r];for(let d=0;d ${p} { + `;let o="",l=[a,n,r];for(let p=0;p ${d} { ${o} -`;return u.length===0?c+=`return ${p}(0); }`:c+=`return ${p}(${u.join(",")}); }`,c}function Ale(e){let t="";switch(e){case 0:case 1:t+=` +`;return u.length===0?c+=`return ${d}(0); }`:c+=`return ${d}(${u.join(",")}); }`,c}function hue(e){let t="";switch(e){case 0:case 1:t+=` fn getOutputIndexFromCoords(coords : i32) -> i32 { return coords; } @@ -5205,14 +5205,14 @@ return a / b;`,vJ=` coords.u * uniforms.outShapeStrides.u + coords.v; } - `;break;default:v.assert(!1,()=>`Unsupported ${e}D shape`);break}return t}function wk(e){return e.dispatch[1]===1&&e.dispatch[2]===1}function Gs(e,t=1){if(e==="float32")return Xe(t,"f32");if(e==="int32"||e==="bool")return Xe(t,"i32");throw new Error(`type ${e} is not supported.`)}function ble(e,t,a){let n=e.length,r=Gs(t,a),s=`fn setOutputAtIndex(flatIndex : i32, value : ${Xe(a)}) { + `;break;default:v.assert(!1,()=>`Unsupported ${e}D shape`);break}return t}function Vk(e){return e.dispatch[1]===1&&e.dispatch[2]===1}function gi(e,t=1){if(e==="float32")return Xe(t,"f32");if(e==="int32"||e==="bool")return Xe(t,"i32");throw new Error(`type ${e} is not supported.`)}function mue(e,t,a){let n=e.length,r=gi(t,a),s=`fn setOutputAtIndex(flatIndex : i32, value : ${Xe(a)}) { result[flatIndex] = ${r}(value); } fn setOutputAtIndexI32(flatIndex : i32, value : ${Xe(a,"i32")}) { result[flatIndex] = ${r}(value); } - `;if(n>=2){let i=["d0","d1","d2","d3","d4","d5"].slice(0,n),o=_t(n);s+=` + `;if(n>=2){let i=["d0","d1","d2","d3","d4","d5"].slice(0,n),o=Dt(n);s+=` fn setOutputAtCoords(${i.map(l=>`${l} : i32`).join(", ")}, value : ${Xe(a)}) { let flatIndex = getOutputIndexFromCoords(${o}(${i.join(", ")})); setOutputAtIndex(flatIndex${a===1?"":` / ${a}`}, value); @@ -5221,40 +5221,40 @@ return a / b;`,vJ=` let flatIndex = getOutputIndexFromCoords(${o}(${i.join(", ")})); setOutputAtIndexI32(flatIndex${a===1?"":` / ${a}`}, value); } - `}return s}function vle(e){let t=/(\w+)\s*:\s*vec(5|6)/g;e=e.replace(t,n=>"@align(16) "+n);let a=/vec(5|6)\s*,\s*(\w+)/g;return e=e.replace(a,(n,r,s)=>`vec${r}, @align(16) ${s}`),e}function tA(e){return!(e.dispatchLayout.hasOwnProperty("y")&&e.dispatchLayout.y.length!==0||e.dispatchLayout.hasOwnProperty("z")&&e.dispatchLayout.z.length!==0)}var kk={};Ze(kk,{GPUBytesPerElement:()=>j1,MatMulProgramType:()=>Dn,assertNotComplex:()=>j3,computeDispatch:()=>de,computeWorkPerThreadForConv2d:()=>G3,computeWorkgroupInfoForMatMul:()=>Ik,computeWorkgroupSizeForConv2d:()=>U3,flatDispatchLayout:()=>me,isWebGPUSupported:()=>H3,tilesFitEvenlyIntoShape:()=>wle});var qs=e=>{let t=1;for(let a=0;aa%e[n]===0)}function de(e,t,a=[1,1,1],n=[1,1,1]){let[r,s,i]=[Math.ceil(qs(e.x.map(o=>t[o]))/(a[0]*n[0])),e.y?Math.ceil(qs(e.y.map(o=>t[o]))/(a[1]*n[1])):1,e.z?Math.ceil(qs(e.z.map(o=>t[o]))/(a[2]*n[2])):1];return[r,s,i]}function Ik(e,t,a,n=!1){let r=[8,8,1],s=[4,4,1];return n||(e<=8&&(s[1]=1),t<=16&&a<=16&&(r[0]=4)),{workgroupSize:r,elementsPerThread:s}}function U3(e,t,a=!1){if(a)return[8,8,1];let n=qs(e.x.map(s=>t[s])),r=qs(e.y.map(s=>t[s]));return n<=4?[4,16,1]:r<=4?[16,4,1]:[16,16,1]}function G3(e,t,a=!1){if(a)return[4,4,1];let n=qs(e.x.map(s=>t[s])),r=qs(e.y.map(s=>t[s]));return n<=4?[1,2,1]:r<=4?[2,1,1]:[2,2,1]}function me(e){return{x:e.map((t,a)=>a)}}function j1(e){if(e==="float32"||e==="int32"||e==="bool"||e==="string")return 4;if(e==="complex64")return 8;throw new Error(`Unknown dtype ${e}`)}function H3(){return!!(globalThis&&globalThis.navigator&&globalThis.navigator.gpu)}function j3(e,t){Array.isArray(e)||(e=[e]),e.forEach(a=>{a!=null&&v.assert(a.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGPU backend.`)})}var Dn;(function(e){e[e.MatMulReduceProgram=0]="MatMulReduceProgram",e[e.MatMulSplitKProgram=1]="MatMulSplitKProgram",e[e.MatMulSmallOutputSizeProgram=2]="MatMulSmallOutputSizeProgram",e[e.MatMulPackedProgram=3]="MatMulPackedProgram",e[e.MatMulMax=4]="MatMulMax"})(Dn||(Dn={}));var kle=B().getNumber("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD"),Ile=(e,t)=>{let a=e.limits.maxComputeWorkgroupsPerDimension,n=t.dispatchLayout,r=t.dispatch;if(r.every(i=>i<=a))return r;v.assert(r[0]>a&&n.y===void 0&&n.z===void 0,()=>"Dispatch size exceeds WebGPU limits in Y or Z dimension.");let s=Math.ceil(Math.sqrt(r[0]));return s>a?(s=Math.ceil(Math.cbrt(r[0])),v.assert(s<=a,()=>"Total dispatch size exceeds WebGPU maximum."),[s,s,s]):[s,s,1]},q3=class Sk extends au{nextDataId(){return Sk.nextDataId++}constructor(t,a){if(super(),this.commandQueueOwnedIds=new WeakSet,this.dispatchCountInPass=0,this.disposed=!1,this.downloadWaitMs=0,this.tensorDataPendingDisposal=[],this.queryResolveBuffer=null,this.querySet=null,this.querySetCount=2,this.stagingPendingDisposal=[],this.uniformPendingDisposal=[],this.uploadWaitMs=0,this.hasReadSyncWarned=!1,this.hasTimestampQueryWarned=!1,!H3())throw new Error("WebGPU is not supported on this device");this.pipelineCache={},this.device=t,this.queue=t.queue,this.commandEncoder=null,this.computePassEncoder=null,this.adapterInfo=new ile(a),this.supportTimestampQuery=this.device.features.has("timestamp-query"),this.thresholdToIncreaseWorkgroups=this.adapterInfo.intelGPUGeneration>=12?16:8,this.bufferManager=new ole(this.device),this.textureManager=new lle(this.device),this.tensorMap=new rp(this,It()),B().getBool("WEBGPU_USE_PROFILE_TOOL")&&(this.dummyCanvas=document.createElement("canvas"),this.dummyCanvas.width=1,this.dummyCanvas.height=1,this.dummyContext=this.dummyCanvas.getContext("webgpu"),this.dummyContext.configure({device:t,format:"bgra8unorm"}),document.body.appendChild(this.dummyCanvas))}floatPrecision(){return 32}disposeData(t,a=!1){if(!this.tensorMap.has(t))return!0;let n=this.tensorMap.get(t);return a?n.refCount=0:n.refCount--,n.refCount>0?!1:(n.complexTensorInfos!=null&&(this.disposeData(n.complexTensorInfos.real.dataId),this.disposeData(n.complexTensorInfos.imag.dataId)),this.commandQueueOwnedIds.has(t)?(this.tensorDataPendingDisposal.push(t),!0):(this.releaseResource(t),this.tensorMap.delete(t),!0))}memory(){return{numBytesInGPU:this.bufferManager.numBytesUsed,numBytesAllocatedInGPU:this.bufferManager.numBytesAllocated,unreliable:!1}}releaseResource(t){let a=this.tensorMap.get(t);if(!(!a||!a.resource)){if(a.external){a.resource=null;return}a.resource instanceof GPUBuffer?this.bufferManager.releaseBuffer(a.resource):a.resource instanceof GPUTexture&&this.textureManager.releaseTexture(a.resource),a.resource=null}}refCount(t){return this.tensorMap.has(t)?this.tensorMap.get(t).refCount:0}incRef(t){let a=this.tensorMap.get(t);a.refCount++}decRef(t){if(this.tensorMap.has(t)){let a=this.tensorMap.get(t);a.refCount--}}write(t,a,n){if(n==="complex64"&&t!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let r={id:this.nextDataId()};return this.tensorMap.set(r,{dtype:n,shape:a,values:t,refCount:1}),r}move(t,a,n,r,s){if(r==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.tensorMap.set(t,{dtype:r,shape:n,values:a,refCount:s})}submitQueue(){this.queue.submit([this.commandEncoder.finish()]),this.commandEncoder=null,this.dispatchCountInPass=0,this.commandQueueOwnedIds=new WeakSet,this.tensorDataPendingDisposal.forEach(t=>{this.releaseResource(t),this.tensorMap.delete(t)}),this.uniformPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t)),this.stagingPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t,!1)),this.tensorDataPendingDisposal=[],this.uniformPendingDisposal=[],this.stagingPendingDisposal=[]}ensureCommandEncoderReady(){this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder())}endComputePassEncoder(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}async checkCompileCompletionAsync(){let t;try{t=await Promise.all(Object.values(this.pipelineCache))}catch(a){throw new Error(a.message)}Object.keys(this.pipelineCache).map((a,n)=>{this.pipelineCache[a]=t[n]})}async getBufferData(t){if(B().getBool("WEBGPU_ENGINE_COMPILE_ONLY"))return console.warn("The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false"),null;let a=t.size,n=this.bufferManager.acquireBuffer(a,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,n,0,a),this.submitQueue(),await n.mapAsync(GPUMapMode.READ);let r=n.getMappedRange().slice(0);return n.unmap(),n!=null&&this.bufferManager.releaseBuffer(n),B().getBool("WEBGPU_USE_PROFILE_TOOL")&&(v.assert(this.dummyContext!==void 0,()=>"Fail to get context for profiling tool"),this.dummyContext.getCurrentTexture()),r}convertAndCacheOnCPU(t,a){let n=this.tensorMap.get(t);return n.values=a,n.values}readSync(t){let a=this.tensorMap.get(t),{values:n,complexTensorInfos:r}=a;if(n!=null||a.dtype==="string")return n;if(a.dtype==="complex64"){let f=this.readSync(r.real.dataId),g=this.readSync(r.imag.dataId),y=v.convertBackendValuesAndArrayBuffer(C.mergeRealAndImagArrays(f,g).buffer,"float32");return this.convertAndCacheOnCPU(t,y),y}this.hasReadSyncWarned||(this.hasReadSyncWarned=!0,console.warn("The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead."));let s=["opaque","premultiplied"],i=a.resource,o=i.size;v.assert(o%4===0,()=>"Because there is 4 bytes for one pixel, buffer size must be multiple of 4.");let l=o/4,u=new ArrayBuffer(o),p=256,c=256,d=s.map(f=>new OffscreenCanvas(p,c)),h=new OffscreenCanvas(p,c);this.endComputePassEncoder(),d.map((f,g)=>{let y=f.getContext("webgpu");return y.configure({device:this.device,format:"bgra8unorm",usage:GPUTextureUsage.COPY_DST,alphaMode:s[g]}),y.getCurrentTexture()}).map((f,g)=>{let y=p*4,x=(N,M,P)=>{this.ensureCommandEncoderReady(),this.commandEncoder.copyBufferToTexture({buffer:i,bytesPerRow:y,offset:P},{texture:f},{width:N,height:M}),this.submitQueue();let E=h.getContext("2d",{willReadFrequently:!0});E.clearRect(0,0,N,M),E.drawImage(d[g],0,0);let S=E.getImageData(0,0,N,M).data,_=s[g],O=new Uint8ClampedArray(u,P,N*M*4);for(let W=0;W0&&(x(b,w,I),I+=w*(p*4)),b=T%p,b>0&&x(b,1,I)});let m=v.convertBackendValuesAndArrayBuffer(u,a.dtype);return this.convertAndCacheOnCPU(t,m),m}async read(t){if(!this.tensorMap.has(t))throw new Error(`Tensor ${t} was not registered!`);let a=this.tensorMap.get(t),{values:n}=a;if(n!=null)return n;let r;if(a.dtype==="complex64"){let s=await Promise.all([this.read(a.complexTensorInfos.real.dataId),this.read(a.complexTensorInfos.imag.dataId)]),i=s[0],o=s[1];r=C.mergeRealAndImagArrays(i,o)}else{let s=await this.getBufferData(a.resource);r=v.convertBackendValuesAndArrayBuffer(s,a.dtype)}return this.convertAndCacheOnCPU(t,r),r}copyBuffer(t){let a=t.size,n=t.usage,r=this.bufferManager.acquireBuffer(a,n);return this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,r,0,a),this.submitQueue(),r}createTensorFromGPUData(t,a,n){let r=t.buffer;if(n==="complex64")throw new Error("Cannot write to a complex64 dtype. ");let s={id:this.nextDataId()};this.tensorMap.set(s,{dtype:n,shape:a,values:null,refCount:1,external:t.zeroCopy});let i=this.tensorMap.get(s),o=j1(i.dtype)*v.sizeFromShape(i.shape);if(t.buffer.sizev.decodeString(r));return $e(t.shape,t.dtype,n)}catch(n){throw new Error("Failed to decode encoded string bytes into utf-8")}return $e(t.shape,t.dtype,a)}async time(t){!this.supportTimestampQuery&&!this.hasTimestampQueryWarned&&(console.warn("This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled."),this.hasTimestampQueryWarned=!0);let a=this.activeTimers,n=[],r=!1;this.programTimersStack==null?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,t();let s=v.flatten(this.activeTimers.map(u=>u.query)).filter(u=>u!=null),i=v.flatten(this.activeTimers.map(u=>u.name)).filter(u=>u!=null);this.activeTimers=a,r&&(this.programTimersStack=null);let o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},l=await Promise.all(s);return o.kernelMs=v.sum(l),o.getExtraProfileInfo=()=>l.map((u,p)=>({name:i[p],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(", "),this.uploadWaitMs=0,this.downloadWaitMs=0,o}makeTensorInfo(t,a,n){return a==="string"&&n!=null&&n.length>0&&v.isString(n[0])&&(n=n.map(r=>v.encodeString(r))),{dataId:this.write(n,t,a),shape:t,dtype:a}}tensorToBinding(t){if(!t)return null;let a=this.tensorMap.get(t.dataId).resource;return a instanceof GPUBuffer?{buffer:a}:a instanceof GPUTexture?a.createView():a}uploadToGPU(t){let a=this.tensorMap.get(t);if(a.resource!=null)return;let n=j1(a.dtype)*v.sizeFromShape(a.shape),r,s=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;if(a.values){if(r=this.bufferManager.acquireBuffer(n,s,!0),r.mapState==="unmapped"){let i=this.bufferManager.acquireBuffer(n,GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC,!0,!1),o=i.getMappedRange();a.dtype==="int32"||a.dtype==="bool"?new Int32Array(o).set(a.values):new Float32Array(o).set(a.values),i.unmap(),this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(i,0,r,0,n),this.stagingPendingDisposal.push(i)}else{let i=r.getMappedRange();a.dtype==="int32"||a.dtype==="bool"?new Int32Array(i).set(a.values):new Float32Array(i).set(a.values),r.unmap()}a.values=null}else r=this.bufferManager.acquireBuffer(n,s);a.resource=r}makeUniforms(t){let a=0,n=0,r=[],s=1;t.forEach(l=>{l.data.length===0&&(l.data=[1]);let u;switch(l.data.length){case 1:u=4;break;case 2:u=8;break;case 3:u=16;break;case 4:u=16;break;case 5:u=16;break;case 6:u=16;break;default:v.assert(!1,()=>`Unsupported ${l.data.length}D shape`)}(n===5||n===6)&&(u=16),u>s&&(s=u),a=Math.ceil(a/u)*u,n=l.data.length,r.push(a),a+=l.data.length*4}),a=Math.ceil(a/s)*s;let i=new ArrayBuffer(a);t.forEach((l,u)=>{let p=r[u];l.type==="int32"?new Int32Array(i,p,l.data.length).set(l.data):l.type==="uint32"?new Uint32Array(i,p,l.data.length).set(l.data):new Float32Array(i,p,l.data.length).set(l.data)});let o=this.bufferManager.acquireBuffer(a,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);return this.queue.writeBuffer(o,0,i,0,a),this.uniformPendingDisposal.push(o),{offset:0,size:a,buffer:o}}runWebGPUProgram(t,a,n,r,s){if(s||(s=this.makeTensorInfo(t.outputShape,n)),v.sizeFromShape(s.shape)===0)return this.tensorMap.get(s.dataId).values=v.getTypedArrayFromDType(s.dtype,0),s;this.uploadToGPU(s.dataId),t.dispatch=Ile(this.device,t);let i=a.map((l,u)=>{if(l.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");return this.uploadToGPU(l.dataId),{dtype:this.tensorMap.get(l.dataId).dtype,shape:l.shape,name:t.variableNames[u]}});t.shaderKey=hle(t,i,s);let o=B().getBool("WEBGPU_ENGINE_COMPILE_ONLY");return t.shaderKey in this.pipelineCache||(this.pipelineCache[t.shaderKey]=dle(this.device,t,i,s,o)),t.pipeline=this.pipelineCache[t.shaderKey],o||this.recordAndSubmit(t,s,a,r),s}recordAndSubmit(t,a,n,r){if(t.pipeline instanceof Promise)throw new Error("Please call checkCompileCompletionAsync to ensure parallel compilation is done!");let s=[],i=[],o="int32";if(t.pixelsOpType==null){s.push({type:"float32",data:[NaN]},{type:"float32",data:[1/0]}),i=n.concat(a).map(h=>h.shape);let d="int32";i.map(h=>{s.push({type:d,data:h});let m=v.computeStrides(h);s.push({type:d,data:m})})}else{let d=v.computeStrides(a.shape);s.push({type:o,data:d})}if(t.size){let d=v.sizeFromShape(t.outputShape);s.push({type:o,data:[t.outputComponent?d/t.outputComponent:d]})}r&&(s=[...s,...r]);let l=[this.tensorToBinding(a),...n.map(d=>this.tensorToBinding(d)),this.makeUniforms(s)];n.forEach(d=>{this.commandQueueOwnedIds.add(d.dataId)}),this.commandQueueOwnedIds.add(a.dataId);let u=this.device.createBindGroup({layout:t.pipeline.getBindGroupLayout(0),entries:l.map((d,h)=>({binding:h,resource:d}))}),p=this.activeTimers!=null;this.ensureCommandEncoderReady();let c={};p&&this.supportTimestampQuery?(this.endComputePassEncoder(),this.querySet==null&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.querySetCount})),c.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1},this.computePassEncoder=this.commandEncoder.beginComputePass(c)):this.computePassEncoder||(this.computePassEncoder=this.commandEncoder.beginComputePass(c)),this.computePassEncoder.setPipeline(t.pipeline),this.computePassEncoder.setBindGroup(0,u),this.computePassEncoder.dispatchWorkgroups(t.dispatch[0],t.dispatch[1],t.dispatch[2]),this.dispatchCountInPass++,(p||B().get("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE")<=this.dispatchCountInPass||t.pixelsOpType===eu.DRAW)&&(this.endComputePassEncoder(),p?this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime()}):this.submitQueue())}async getQueryTime(){if(!this.supportTimestampQuery)return 0;this.queryResolveBuffer==null&&(this.queryResolveBuffer=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST|GPUBufferUsage.QUERY_RESOLVE)),this.commandEncoder.resolveQuerySet(this.querySet,0,this.querySetCount,this.queryResolveBuffer,0);let t=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,t,0,this.querySetCount*8),this.submitQueue(),await t.mapAsync(GPUMapMode.READ);let a=new BigUint64Array(t.getMappedRange()),n=Number(a[1]-a[0])/1e6;return t.unmap(),this.bufferManager.releaseBuffer(t),n}shouldExecuteOnCPU(t,a=kle){return B().getBool("WEBGPU_CPU_FORWARD")&&t.every(n=>this.tensorMap.get(n.dataId).resource==null&&v.sizeFromShape(n.shape){let e={powerPreference:B().get("WEBGPU_USE_LOW_POWER_GPU")?"low-power":"high-performance"},t=await navigator.gpu.requestAdapter(e),a={},n=[];t.features.has("timestamp-query")&&n.push("timestamp-query"),t.features.has("bgra8unorm-storage")&&n.push(["bgra8unorm-storage"]),a.requiredFeatures=n;let r=t.limits;a.requiredLimits={maxComputeWorkgroupStorageSize:r.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.maxStorageBufferBindingSize,maxBufferSize:r.maxBufferSize,maxComputeWorkgroupSizeX:r.maxComputeWorkgroupSizeX,maxComputeInvocationsPerWorkgroup:r.maxComputeInvocationsPerWorkgroup};let s=await t.requestDevice(a),i=await t.requestAdapterInfo();return new q3(s,i)},3);var _e;(function(e){e[e.ADD=0]="ADD",e[e.ATAN2=1]="ATAN2",e[e.COMPLEX_MULTIPLY_IMAG=2]="COMPLEX_MULTIPLY_IMAG",e[e.COMPLEX_MULTIPLY_REAL=3]="COMPLEX_MULTIPLY_REAL",e[e.DIV=4]="DIV",e[e.ELU_DER=5]="ELU_DER",e[e.EQUAL=6]="EQUAL",e[e.FLOOR_DIV=7]="FLOOR_DIV",e[e.GREATER=8]="GREATER",e[e.GREATER_EQUAL=9]="GREATER_EQUAL",e[e.LESS=10]="LESS",e[e.LESS_EQUAL=11]="LESS_EQUAL",e[e.LOGICAL_AND=12]="LOGICAL_AND",e[e.LOGICAL_OR=13]="LOGICAL_OR",e[e.MAX=14]="MAX",e[e.MIN=15]="MIN",e[e.MOD=16]="MOD",e[e.MUL=17]="MUL",e[e.NOT_EQUAL=18]="NOT_EQUAL",e[e.POW=19]="POW",e[e.PRELU=20]="PRELU",e[e.SQUARED_DIFFERENCE=21]="SQUARED_DIFFERENCE",e[e.SUB=22]="SUB"})(_e||(_e={}));var Sle="let resultTemp = a + b;",Cle="let resultTemp = atan2(a, b);",Tle="let resultTemp = areal * breal - aimag * bimag;",Nle="let resultTemp = areal * bimag + aimag * breal;",Rle="let resultTemp = a / b;",Ele="let resultTemp = select(a * (b + 1.0), a, b >= b - b);",Mle=` + `}return s}function fue(e){let t=/(\w+)\s*:\s*vec(5|6)/g;e=e.replace(t,n=>"@align(16) "+n);let a=/vec(5|6)\s*,\s*(\w+)/g;return e=e.replace(a,(n,r,s)=>`vec${r}, @align(16) ${s}`),e}function fA(e){return!(e.dispatchLayout.hasOwnProperty("y")&&e.dispatchLayout.y.length!==0||e.dispatchLayout.hasOwnProperty("z")&&e.dispatchLayout.z.length!==0)}var Uk={};Ke(Uk,{GPUBytesPerElement:()=>Q1,MatMulProgramType:()=>Ln,assertNotComplex:()=>ay,computeDispatch:()=>de,computeWorkPerThreadForConv2d:()=>ey,computeWorkgroupInfoForMatMul:()=>Gk,computeWorkgroupSizeForConv2d:()=>Q3,flatDispatchLayout:()=>me,isWebGPUSupported:()=>ty,tilesFitEvenlyIntoShape:()=>gue});var bi=e=>{let t=1;for(let a=0;aa%e[n]===0)}function de(e,t,a=[1,1,1],n=[1,1,1]){let[r,s,i]=[Math.ceil(bi(e.x.map(o=>t[o]))/(a[0]*n[0])),e.y?Math.ceil(bi(e.y.map(o=>t[o]))/(a[1]*n[1])):1,e.z?Math.ceil(bi(e.z.map(o=>t[o]))/(a[2]*n[2])):1];return[r,s,i]}function Gk(e,t,a,n=!1){let r=[8,8,1],s=[4,4,1];return n||(e<=8&&(s[1]=1),t<=16&&a<=16&&(r[0]=4)),{workgroupSize:r,elementsPerThread:s}}function Q3(e,t,a=!1){if(a)return[8,8,1];let n=bi(e.x.map(s=>t[s])),r=bi(e.y.map(s=>t[s]));return n<=4?[4,16,1]:r<=4?[16,4,1]:[16,16,1]}function ey(e,t,a=!1){if(a)return[4,4,1];let n=bi(e.x.map(s=>t[s])),r=bi(e.y.map(s=>t[s]));return n<=4?[1,2,1]:r<=4?[2,1,1]:[2,2,1]}function me(e){return{x:e.map((t,a)=>a)}}function Q1(e){if(e==="float32"||e==="int32"||e==="bool"||e==="string")return 4;if(e==="complex64")return 8;throw new Error(`Unknown dtype ${e}`)}function ty(){return!!(globalThis&&globalThis.navigator&&globalThis.navigator.gpu)}function ay(e,t){Array.isArray(e)||(e=[e]),e.forEach(a=>{a!=null&&v.assert(a.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGPU backend.`)})}var Ln;(function(e){e[e.MatMulReduceProgram=0]="MatMulReduceProgram",e[e.MatMulSplitKProgram=1]="MatMulSplitKProgram",e[e.MatMulSmallOutputSizeProgram=2]="MatMulSmallOutputSizeProgram",e[e.MatMulPackedProgram=3]="MatMulPackedProgram",e[e.MatMulMax=4]="MatMulMax"})(Ln||(Ln={}));var yue=B().getNumber("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD"),xue=(e,t)=>{let a=e.limits.maxComputeWorkgroupsPerDimension,n=t.dispatchLayout,r=t.dispatch;if(r.every(i=>i<=a))return r;v.assert(r[0]>a&&n.y===void 0&&n.z===void 0,()=>"Dispatch size exceeds WebGPU limits in Y or Z dimension.");let s=Math.ceil(Math.sqrt(r[0]));return s>a?(s=Math.ceil(Math.cbrt(r[0])),v.assert(s<=a,()=>"Total dispatch size exceeds WebGPU maximum."),[s,s,s]):[s,s,1]},ny=class Hk extends du{nextDataId(){return Hk.nextDataId++}constructor(t,a){if(super(),this.commandQueueOwnedIds=new WeakSet,this.dispatchCountInPass=0,this.disposed=!1,this.downloadWaitMs=0,this.tensorDataPendingDisposal=[],this.queryResolveBuffer=null,this.querySet=null,this.querySetCount=2,this.stagingPendingDisposal=[],this.uniformPendingDisposal=[],this.uploadWaitMs=0,this.hasReadSyncWarned=!1,this.hasTimestampQueryWarned=!1,!ty())throw new Error("WebGPU is not supported on this device");this.pipelineCache={},this.device=t,this.queue=t.queue,this.commandEncoder=null,this.computePassEncoder=null,this.adapterInfo=new eue(a),this.supportTimestampQuery=this.device.features.has("timestamp-query"),this.thresholdToIncreaseWorkgroups=this.adapterInfo.intelGPUGeneration>=12?16:8,this.bufferManager=new tue(this.device),this.textureManager=new aue(this.device),this.tensorMap=new hp(this,St()),B().getBool("WEBGPU_USE_PROFILE_TOOL")&&(this.dummyCanvas=document.createElement("canvas"),this.dummyCanvas.width=1,this.dummyCanvas.height=1,this.dummyContext=this.dummyCanvas.getContext("webgpu"),this.dummyContext.configure({device:t,format:"bgra8unorm"}),document.body.appendChild(this.dummyCanvas))}floatPrecision(){return 32}disposeData(t,a=!1){if(!this.tensorMap.has(t))return!0;let n=this.tensorMap.get(t);return a?n.refCount=0:n.refCount--,n.refCount>0?!1:(n.complexTensorInfos!=null&&(this.disposeData(n.complexTensorInfos.real.dataId),this.disposeData(n.complexTensorInfos.imag.dataId)),this.commandQueueOwnedIds.has(t)?(this.tensorDataPendingDisposal.push(t),!0):(this.releaseResource(t),this.tensorMap.delete(t),!0))}memory(){return{numBytesInGPU:this.bufferManager.numBytesUsed,numBytesAllocatedInGPU:this.bufferManager.numBytesAllocated,unreliable:!1}}releaseResource(t){let a=this.tensorMap.get(t);if(!(!a||!a.resource)){if(a.external){a.resource=null;return}a.resource instanceof GPUBuffer?this.bufferManager.releaseBuffer(a.resource):a.resource instanceof GPUTexture&&this.textureManager.releaseTexture(a.resource),a.resource=null}}refCount(t){return this.tensorMap.has(t)?this.tensorMap.get(t).refCount:0}incRef(t){let a=this.tensorMap.get(t);a.refCount++}decRef(t){if(this.tensorMap.has(t)){let a=this.tensorMap.get(t);a.refCount--}}write(t,a,n){if(n==="complex64"&&t!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let r={id:this.nextDataId()};return this.tensorMap.set(r,{dtype:n,shape:a,values:t,refCount:1}),r}move(t,a,n,r,s){if(r==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.tensorMap.set(t,{dtype:r,shape:n,values:a,refCount:s})}submitQueue(){this.queue.submit([this.commandEncoder.finish()]),this.commandEncoder=null,this.dispatchCountInPass=0,this.commandQueueOwnedIds=new WeakSet,this.tensorDataPendingDisposal.forEach(t=>{this.releaseResource(t),this.tensorMap.delete(t)}),this.uniformPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t)),this.stagingPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t,!1)),this.tensorDataPendingDisposal=[],this.uniformPendingDisposal=[],this.stagingPendingDisposal=[]}ensureCommandEncoderReady(){this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder())}endComputePassEncoder(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}async checkCompileCompletionAsync(){let t;try{t=await Promise.all(Object.values(this.pipelineCache))}catch(a){throw new Error(a.message)}Object.keys(this.pipelineCache).map((a,n)=>{this.pipelineCache[a]=t[n]})}async getBufferData(t){if(B().getBool("WEBGPU_ENGINE_COMPILE_ONLY"))return console.warn("The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false"),null;let a=t.size,n=this.bufferManager.acquireBuffer(a,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,n,0,a),this.submitQueue(),await n.mapAsync(GPUMapMode.READ);let r=n.getMappedRange().slice(0);return n.unmap(),n!=null&&this.bufferManager.releaseBuffer(n),B().getBool("WEBGPU_USE_PROFILE_TOOL")&&(v.assert(this.dummyContext!==void 0,()=>"Fail to get context for profiling tool"),this.dummyContext.getCurrentTexture()),r}convertAndCacheOnCPU(t,a){let n=this.tensorMap.get(t);return n.values=a,n.values}readSync(t){let a=this.tensorMap.get(t),{values:n,complexTensorInfos:r}=a;if(n!=null||a.dtype==="string")return n;if(a.dtype==="complex64"){let f=this.readSync(r.real.dataId),g=this.readSync(r.imag.dataId),y=v.convertBackendValuesAndArrayBuffer(I.mergeRealAndImagArrays(f,g).buffer,"float32");return this.convertAndCacheOnCPU(t,y),y}this.hasReadSyncWarned||(this.hasReadSyncWarned=!0,console.warn("The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead."));let s=["opaque","premultiplied"],i=a.resource,o=i.size;v.assert(o%4===0,()=>"Because there is 4 bytes for one pixel, buffer size must be multiple of 4.");let l=o/4,u=new ArrayBuffer(o),d=256,c=256,p=s.map(f=>new OffscreenCanvas(d,c)),h=new OffscreenCanvas(d,c);this.endComputePassEncoder(),p.map((f,g)=>{let y=f.getContext("webgpu");return y.configure({device:this.device,format:"bgra8unorm",usage:GPUTextureUsage.COPY_DST,alphaMode:s[g]}),y.getCurrentTexture()}).map((f,g)=>{let y=d*4,x=(N,M,F)=>{this.ensureCommandEncoderReady(),this.commandEncoder.copyBufferToTexture({buffer:i,bytesPerRow:y,offset:F},{texture:f},{width:N,height:M}),this.submitQueue();let E=h.getContext("2d",{willReadFrequently:!0});E.clearRect(0,0,N,M),E.drawImage(p[g],0,0);let T=E.getImageData(0,0,N,M).data,D=s[g],O=new Uint8ClampedArray(u,F,N*M*4);for(let W=0;W0&&(x(b,w,S),S+=w*(d*4)),b=C%d,b>0&&x(b,1,S)});let m=v.convertBackendValuesAndArrayBuffer(u,a.dtype);return this.convertAndCacheOnCPU(t,m),m}async read(t){if(!this.tensorMap.has(t))throw new Error(`Tensor ${t} was not registered!`);let a=this.tensorMap.get(t),{values:n}=a;if(n!=null)return n;let r;if(a.dtype==="complex64"){let s=await Promise.all([this.read(a.complexTensorInfos.real.dataId),this.read(a.complexTensorInfos.imag.dataId)]),i=s[0],o=s[1];r=I.mergeRealAndImagArrays(i,o)}else{let s=await this.getBufferData(a.resource);r=v.convertBackendValuesAndArrayBuffer(s,a.dtype)}return this.convertAndCacheOnCPU(t,r),r}copyBuffer(t){let a=t.size,n=t.usage,r=this.bufferManager.acquireBuffer(a,n);return this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,r,0,a),this.submitQueue(),r}createTensorFromGPUData(t,a,n){let r=t.buffer;if(n==="complex64")throw new Error("Cannot write to a complex64 dtype. ");let s={id:this.nextDataId()};this.tensorMap.set(s,{dtype:n,shape:a,values:null,refCount:1,external:t.zeroCopy});let i=this.tensorMap.get(s),o=Q1(i.dtype)*v.sizeFromShape(i.shape);if(t.buffer.sizev.decodeString(r));return Te(t.shape,t.dtype,n)}catch(n){throw new Error("Failed to decode encoded string bytes into utf-8")}return Te(t.shape,t.dtype,a)}async time(t){!this.supportTimestampQuery&&!this.hasTimestampQueryWarned&&(console.warn("This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled."),this.hasTimestampQueryWarned=!0);let a=this.activeTimers,n=[],r=!1;this.programTimersStack==null?(this.programTimersStack=n,r=!0):this.activeTimers.push(n),this.activeTimers=n,t();let s=v.flatten(this.activeTimers.map(u=>u.query)).filter(u=>u!=null),i=v.flatten(this.activeTimers.map(u=>u.name)).filter(u=>u!=null);this.activeTimers=a,r&&(this.programTimersStack=null);let o={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},l=await Promise.all(s);return o.kernelMs=v.sum(l),o.getExtraProfileInfo=()=>l.map((u,d)=>({name:i[d],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(", "),this.uploadWaitMs=0,this.downloadWaitMs=0,o}makeTensorInfo(t,a,n){return a==="string"&&n!=null&&n.length>0&&v.isString(n[0])&&(n=n.map(r=>v.encodeString(r))),{dataId:this.write(n,t,a),shape:t,dtype:a}}tensorToBinding(t){if(!t)return null;let a=this.tensorMap.get(t.dataId).resource;return a instanceof GPUBuffer?{buffer:a}:a instanceof GPUTexture?a.createView():a}uploadToGPU(t){let a=this.tensorMap.get(t);if(a.resource!=null)return;let n=Q1(a.dtype)*v.sizeFromShape(a.shape),r,s=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;if(a.values){if(r=this.bufferManager.acquireBuffer(n,s,!0),r.mapState==="unmapped"){let i=this.bufferManager.acquireBuffer(n,GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC,!0,!1),o=i.getMappedRange();a.dtype==="int32"||a.dtype==="bool"?new Int32Array(o).set(a.values):new Float32Array(o).set(a.values),i.unmap(),this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(i,0,r,0,n),this.stagingPendingDisposal.push(i)}else{let i=r.getMappedRange();a.dtype==="int32"||a.dtype==="bool"?new Int32Array(i).set(a.values):new Float32Array(i).set(a.values),r.unmap()}a.values=null}else r=this.bufferManager.acquireBuffer(n,s);a.resource=r}makeUniforms(t){let a=0,n=0,r=[],s=1;t.forEach(l=>{l.data.length===0&&(l.data=[1]);let u;switch(l.data.length){case 1:u=4;break;case 2:u=8;break;case 3:u=16;break;case 4:u=16;break;case 5:u=16;break;case 6:u=16;break;default:v.assert(!1,()=>`Unsupported ${l.data.length}D shape`)}(n===5||n===6)&&(u=16),u>s&&(s=u),a=Math.ceil(a/u)*u,n=l.data.length,r.push(a),a+=l.data.length*4}),a=Math.ceil(a/s)*s;let i=new ArrayBuffer(a);t.forEach((l,u)=>{let d=r[u];l.type==="int32"?new Int32Array(i,d,l.data.length).set(l.data):l.type==="uint32"?new Uint32Array(i,d,l.data.length).set(l.data):new Float32Array(i,d,l.data.length).set(l.data)});let o=this.bufferManager.acquireBuffer(a,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);return this.queue.writeBuffer(o,0,i,0,a),this.uniformPendingDisposal.push(o),{offset:0,size:a,buffer:o}}runWebGPUProgram(t,a,n,r,s){if(s||(s=this.makeTensorInfo(t.outputShape,n)),v.sizeFromShape(s.shape)===0)return this.tensorMap.get(s.dataId).values=v.getTypedArrayFromDType(s.dtype,0),s;this.uploadToGPU(s.dataId),t.dispatch=xue(this.device,t);let i=a.map((l,u)=>{if(l.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");return this.uploadToGPU(l.dataId),{dtype:this.tensorMap.get(l.dataId).dtype,shape:l.shape,name:t.variableNames[u]}});t.shaderKey=oue(t,i,s);let o=B().getBool("WEBGPU_ENGINE_COMPILE_ONLY");return t.shaderKey in this.pipelineCache||(this.pipelineCache[t.shaderKey]=rue(this.device,t,i,s,o)),t.pipeline=this.pipelineCache[t.shaderKey],o||this.recordAndSubmit(t,s,a,r),s}recordAndSubmit(t,a,n,r){if(t.pipeline instanceof Promise)throw new Error("Please call checkCompileCompletionAsync to ensure parallel compilation is done!");let s=[],i=[],o="int32";if(t.pixelsOpType==null){s.push({type:"float32",data:[NaN]},{type:"float32",data:[1/0]}),i=n.concat(a).map(h=>h.shape);let p="int32";i.map(h=>{s.push({type:p,data:h});let m=v.computeStrides(h);s.push({type:p,data:m})})}else{let p=v.computeStrides(a.shape);s.push({type:o,data:p})}if(t.size){let p=v.sizeFromShape(t.outputShape);s.push({type:o,data:[t.outputComponent?p/t.outputComponent:p]})}r&&(s=[...s,...r]);let l=[this.tensorToBinding(a),...n.map(p=>this.tensorToBinding(p)),this.makeUniforms(s)];n.forEach(p=>{this.commandQueueOwnedIds.add(p.dataId)}),this.commandQueueOwnedIds.add(a.dataId);let u=this.device.createBindGroup({layout:t.pipeline.getBindGroupLayout(0),entries:l.map((p,h)=>({binding:h,resource:p}))}),d=this.activeTimers!=null;this.ensureCommandEncoderReady();let c={};d&&this.supportTimestampQuery?(this.endComputePassEncoder(),this.querySet==null&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.querySetCount})),c.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1},this.computePassEncoder=this.commandEncoder.beginComputePass(c)):this.computePassEncoder||(this.computePassEncoder=this.commandEncoder.beginComputePass(c)),this.computePassEncoder.setPipeline(t.pipeline),this.computePassEncoder.setBindGroup(0,u),this.computePassEncoder.dispatchWorkgroups(t.dispatch[0],t.dispatch[1],t.dispatch[2]),this.dispatchCountInPass++,(d||B().get("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE")<=this.dispatchCountInPass||t.pixelsOpType===lu.DRAW)&&(this.endComputePassEncoder(),d?this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime()}):this.submitQueue())}async getQueryTime(){if(!this.supportTimestampQuery)return 0;this.queryResolveBuffer==null&&(this.queryResolveBuffer=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST|GPUBufferUsage.QUERY_RESOLVE)),this.commandEncoder.resolveQuerySet(this.querySet,0,this.querySetCount,this.queryResolveBuffer,0);let t=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,t,0,this.querySetCount*8),this.submitQueue(),await t.mapAsync(GPUMapMode.READ);let a=new BigUint64Array(t.getMappedRange()),n=Number(a[1]-a[0])/1e6;return t.unmap(),this.bufferManager.releaseBuffer(t),n}shouldExecuteOnCPU(t,a=yue){return B().getBool("WEBGPU_CPU_FORWARD")&&t.every(n=>this.tensorMap.get(n.dataId).resource==null&&v.sizeFromShape(n.shape){let e={powerPreference:B().get("WEBGPU_USE_LOW_POWER_GPU")?"low-power":"high-performance"},t=await navigator.gpu.requestAdapter(e),a={},n=[];t.features.has("timestamp-query")&&n.push("timestamp-query"),t.features.has("bgra8unorm-storage")&&n.push(["bgra8unorm-storage"]),a.requiredFeatures=n;let r=t.limits;a.requiredLimits={maxComputeWorkgroupStorageSize:r.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:r.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:r.maxStorageBufferBindingSize,maxBufferSize:r.maxBufferSize,maxComputeWorkgroupSizeX:r.maxComputeWorkgroupSizeX,maxComputeInvocationsPerWorkgroup:r.maxComputeInvocationsPerWorkgroup};let s=await t.requestDevice(a),i=await t.requestAdapterInfo();return new ny(s,i)},3);var De;(function(e){e[e.ADD=0]="ADD",e[e.ATAN2=1]="ATAN2",e[e.COMPLEX_MULTIPLY_IMAG=2]="COMPLEX_MULTIPLY_IMAG",e[e.COMPLEX_MULTIPLY_REAL=3]="COMPLEX_MULTIPLY_REAL",e[e.DIV=4]="DIV",e[e.ELU_DER=5]="ELU_DER",e[e.EQUAL=6]="EQUAL",e[e.FLOOR_DIV=7]="FLOOR_DIV",e[e.GREATER=8]="GREATER",e[e.GREATER_EQUAL=9]="GREATER_EQUAL",e[e.LESS=10]="LESS",e[e.LESS_EQUAL=11]="LESS_EQUAL",e[e.LOGICAL_AND=12]="LOGICAL_AND",e[e.LOGICAL_OR=13]="LOGICAL_OR",e[e.MAX=14]="MAX",e[e.MIN=15]="MIN",e[e.MOD=16]="MOD",e[e.MUL=17]="MUL",e[e.NOT_EQUAL=18]="NOT_EQUAL",e[e.POW=19]="POW",e[e.PRELU=20]="PRELU",e[e.SQUARED_DIFFERENCE=21]="SQUARED_DIFFERENCE",e[e.SUB=22]="SUB"})(De||(De={}));var Aue="let resultTemp = a + b;",bue="let resultTemp = atan2(a, b);",vue="let resultTemp = areal * breal - aimag * bimag;",wue="let resultTemp = areal * bimag + aimag * breal;",kue="let resultTemp = a / b;",Iue="let resultTemp = select(a * (b + 1.0), a, b >= b - b);",Sue=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a == b); -`,Ple=` +`,Tue=` let remainder = select(a % b, round(a % b), (round(a) == a) & (round(b) == b)); let quotient = (a - remainder) / b; let resultTemp = round(select(quotient, quotient - 1, sign(remainder) == -sign(b))); -`,_le=` +`,Cue=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a > b); -`,$le=` +`,Nue=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a >= b); -`,Fle=` +`,Rue=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a < b); -`,Dle=` +`,Eue=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a <= b); -`,Ole="return f32(a >= 1.0 && b >= 1.0);",zle=`return (vec4(a >= vec4(1.0)) * - vec4(b >= vec4(1.0)));`,Lle="return f32(a >= 1.0 || b >= 1.0);",Wle=`return min(vec4(a >= vec4(1.0)) + - vec4(b >= vec4(1.0)), vec4(1.0));`,Ble="let resultTemp = max(a, b);",Vle="let resultTemp = min(a, b);",Ule=` +`,Mue="return f32(a >= 1.0 && b >= 1.0);",Fue=`return (vec4(a >= vec4(1.0)) * + vec4(b >= vec4(1.0)));`,$ue="return f32(a >= 1.0 || b >= 1.0);",Due=`return min(vec4(a >= vec4(1.0)) + + vec4(b >= vec4(1.0)), vec4(1.0));`,Pue="let resultTemp = max(a, b);",_ue="let resultTemp = min(a, b);",Oue=` let isNaN = b == 0.; var resultTemp = a % b; resultTemp = select((resultTemp + b) % b, resultTemp, (a < 0. && b < 0.) || (a >= 0. && b > 0.)); -`,Gle=` +`,zue=` let isNaN = !vec4(b); var resultTemp = vec4(a % b); if (!((a[0] < 0. && b[0] < 0.) || (a[0] >= 0. && b[0] > 0.))) { @@ -5269,20 +5269,20 @@ return a / b;`,vJ=` if (!((a[3] < 0. && b[3] < 0.) || (a[3] >= 0. && b[3] > 0.))) { resultTemp[3] = (resultTemp[3] + b[3]) % b[3]; } -`,Hle="let resultTemp = a * b;",jle=` +`,Lue="let resultTemp = a * b;",Wue=` var resultTemp = f32(a != b); let valueForNaN = 1.0; -`,qle=` +`,Bue=` var resultTemp = vec4(a != b); let valueForNaN = 1.0; -`,Xle=` +`,Vue=` let isNaN = a < 0.0 && floor(b) < b; if (b == 0.0) { return 1.0; } var resultTemp = select(sign(a) * pow(abs(a), b), pow(abs(a), b), round(abs(b) % 2.0) != 1.0); -`,Kle=` +`,Uue=` let isModRound1Bool = vec4(round(abs(b) % vec4(2.0))) == vec4(1); let isModRound1 = vec4(isModRound1Bool); let multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); @@ -5303,10 +5303,10 @@ return a / b;`,vJ=` resultTemp.a = 1.0; } let isNaN = (a < vec4(0.0)) & (floor(b) < b); -`,Yle="if (a < 0.0) { return b * a; } return a;",Zle=` +`,Gue="if (a < 0.0) { return b * a; } return a;",Hue=` let aLessThanZero = vec4(a < vec4(0.0)); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`,Jle="let resultTemp = (a - b) * (a - b);",Qle="let resultTemp = a - b;";function X3(e,t){let a;do{switch(e){case _e.ATAN2:a=Cle;break;case _e.MAX:a=Ble;break;case _e.MIN:a=Vle;break;case _e.MOD:a=t?Gle:Ule;break;case _e.NOT_EQUAL:a=t?qle:jle;break;case _e.POW:a=t?Kle:Xle;break;default:continue}let n,r,s;return t?(n="isnanVec4",r="vec4",s="vec4"):(n="isnan",r="f32",s="bool"),` +`,jue="let resultTemp = (a - b) * (a - b);",que="let resultTemp = a - b;";function ry(e,t){let a;do{switch(e){case De.ATAN2:a=bue;break;case De.MAX:a=Pue;break;case De.MIN:a=_ue;break;case De.MOD:a=t?zue:Oue;break;case De.NOT_EQUAL:a=t?Bue:Wue;break;case De.POW:a=t?Uue:Vue;break;default:continue}let n,r,s;return t?(n="isnanVec4",r="vec4",s="vec4"):(n="isnan",r="f32",s="bool"),` let aIsNaN = ${n}(a); let aPostLegalization = select(a, ${r}(42), aIsNaN); let bIsNaN = ${n}(b); @@ -5321,30 +5321,30 @@ return a / b;`,vJ=` resultTemp, ${r}(valueForNaN), ${s}(isNaN) | aIsNaN | bIsNaN); } - `}while(!1);switch(e){case _e.ADD:a=Sle;break;case _e.COMPLEX_MULTIPLY_IMAG:a=Nle;break;case _e.COMPLEX_MULTIPLY_REAL:a=Tle;break;case _e.DIV:a=Rle;break;case _e.ELU_DER:a=Ele;break;case _e.EQUAL:a=Mle;break;case _e.FLOOR_DIV:a=Ple;break;case _e.GREATER:a=_le;break;case _e.GREATER_EQUAL:a=$le;break;case _e.LESS:a=Fle;break;case _e.LESS_EQUAL:a=Dle;break;case _e.LOGICAL_AND:return t?zle:Ole;case _e.LOGICAL_OR:return t?Wle:Lle;case _e.MUL:a=Hle;break;case _e.PRELU:return t?Zle:Yle;case _e.SQUARED_DIFFERENCE:a=Jle;break;case _e.SUB:a=Qle;break;default:}return` + `}while(!1);switch(e){case De.ADD:a=Aue;break;case De.COMPLEX_MULTIPLY_IMAG:a=wue;break;case De.COMPLEX_MULTIPLY_REAL:a=vue;break;case De.DIV:a=kue;break;case De.ELU_DER:a=Iue;break;case De.EQUAL:a=Sue;break;case De.FLOOR_DIV:a=Tue;break;case De.GREATER:a=Cue;break;case De.GREATER_EQUAL:a=Nue;break;case De.LESS:a=Rue;break;case De.LESS_EQUAL:a=Eue;break;case De.LOGICAL_AND:return t?Fue:Mue;case De.LOGICAL_OR:return t?Due:$ue;case De.MUL:a=Lue;break;case De.PRELU:return t?Hue:Gue;case De.SQUARED_DIFFERENCE:a=jue;break;case De.SUB:a=que;break;default:}return` ${a} return resultTemp; - `}var le;(function(e){e[e.ABS=0]="ABS",e[e.ACOS=1]="ACOS",e[e.ACOSH=2]="ACOSH",e[e.ASIN=3]="ASIN",e[e.ASINH=4]="ASINH",e[e.ATAN=5]="ATAN",e[e.ATANH=6]="ATANH",e[e.CEIL=7]="CEIL",e[e.COS=8]="COS",e[e.COSH=9]="COSH",e[e.ELU=10]="ELU",e[e.ERF=11]="ERF",e[e.EXP=12]="EXP",e[e.EXPM1=13]="EXPM1",e[e.FLOOR=14]="FLOOR",e[e.IS_FINITE=15]="IS_FINITE",e[e.IS_INF=16]="IS_INF",e[e.IS_NAN=17]="IS_NAN",e[e.LINEAR=18]="LINEAR",e[e.LOG=19]="LOG",e[e.LOG1P=20]="LOG1P",e[e.LOGICAL_NOT=21]="LOGICAL_NOT",e[e.NEG=22]="NEG",e[e.RELU=23]="RELU",e[e.RELU6=24]="RELU6",e[e.LEAKYRELU=25]="LEAKYRELU",e[e.RECIPROCAL=26]="RECIPROCAL",e[e.ROUND=27]="ROUND",e[e.RSQRT=28]="RSQRT",e[e.SELU=29]="SELU",e[e.SIGMOID=30]="SIGMOID",e[e.SIGN=31]="SIGN",e[e.SIN=32]="SIN",e[e.SINH=33]="SINH",e[e.SOFTPLUS=34]="SOFTPLUS",e[e.SQRT=35]="SQRT",e[e.SQUARE=36]="SQUARE",e[e.STEP=37]="STEP",e[e.TAN=38]="TAN",e[e.TANH=39]="TANH",e[e.TO_INT=40]="TO_INT"})(le||(le={}));var eue="return abs(a);",tue=` + `}var le;(function(e){e[e.ABS=0]="ABS",e[e.ACOS=1]="ACOS",e[e.ACOSH=2]="ACOSH",e[e.ASIN=3]="ASIN",e[e.ASINH=4]="ASINH",e[e.ATAN=5]="ATAN",e[e.ATANH=6]="ATANH",e[e.CEIL=7]="CEIL",e[e.COS=8]="COS",e[e.COSH=9]="COSH",e[e.ELU=10]="ELU",e[e.ERF=11]="ERF",e[e.EXP=12]="EXP",e[e.EXPM1=13]="EXPM1",e[e.FLOOR=14]="FLOOR",e[e.IS_FINITE=15]="IS_FINITE",e[e.IS_INF=16]="IS_INF",e[e.IS_NAN=17]="IS_NAN",e[e.LINEAR=18]="LINEAR",e[e.LOG=19]="LOG",e[e.LOG1P=20]="LOG1P",e[e.LOGICAL_NOT=21]="LOGICAL_NOT",e[e.NEG=22]="NEG",e[e.RELU=23]="RELU",e[e.RELU6=24]="RELU6",e[e.LEAKYRELU=25]="LEAKYRELU",e[e.RECIPROCAL=26]="RECIPROCAL",e[e.ROUND=27]="ROUND",e[e.RSQRT=28]="RSQRT",e[e.SELU=29]="SELU",e[e.SIGMOID=30]="SIGMOID",e[e.SIGN=31]="SIGN",e[e.SIN=32]="SIN",e[e.SINH=33]="SINH",e[e.SOFTPLUS=34]="SOFTPLUS",e[e.SQRT=35]="SQRT",e[e.SQUARE=36]="SQUARE",e[e.STEP=37]="STEP",e[e.TAN=38]="TAN",e[e.TANH=39]="TANH",e[e.TO_INT=40]="TO_INT"})(le||(le={}));var Xue="return abs(a);",Kue=` if (abs(a) > 1.) { return uniforms.NAN; } return acos(a); -`,aue=` +`,Yue=` if (a < 1.) { return uniforms.NAN; } return acosh(a); -`,nue=` +`,Zue=` if (abs(a) > 1.) { return uniforms.NAN; } return asin(a); -`,rue="return asinh(a);",sue=` +`,Jue="return asinh(a);",Que=` if (isnan(a)) { return uniforms.NAN; } return atan(a); -`,iue=` +`,ede=` if (abs(a) > 1.) { return uniforms.NAN; } @@ -5355,10 +5355,10 @@ return a / b;`,vJ=` return -uniforms.INFINITY; } return atanh(a); -`,oue="return ceil(a);",lue="return cos(a);",uue=` +`,tde="return ceil(a);",ade="return cos(a);",nde=` let e2x = exp(-a); return (e2x + 1.0 / e2x) / 2.0; -`,due="return exp(a) - 1.0;",pue="if (a >= 0.0) { return a; } return (exp(a) - 1.0);",cue=` +`,rde="return exp(a) - 1.0;",sde="if (a >= 0.0) { return a; } return (exp(a) - 1.0);",ide=` var resFloat = exp(a) - vec4(1.0); if (a.r >= 0.0) { resFloat.r = a.r; @@ -5373,40 +5373,40 @@ return a / b;`,vJ=` resFloat.a = a.a; } return resFloat; -`,hue=` +`,ode=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - let p = ${C.ERF_P}; - let a1 = ${C.ERF_A1}; - let a2 = ${C.ERF_A2}; - let a3 = ${C.ERF_A3}; - let a4 = ${C.ERF_A4}; - let a5 = ${C.ERF_A5}; + let p = ${I.ERF_P}; + let a1 = ${I.ERF_A1}; + let a2 = ${I.ERF_A2}; + let a3 = ${I.ERF_A3}; + let a4 = ${I.ERF_A4}; + let a5 = ${I.ERF_A5}; let sign = sign(a); let absA = abs(a); let t = 1.0 / (1.0 + p * absA); return sign * (1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * exp(-absA * absA)); -`,mue="return exp(a);",fue="return floor(a);",gue="return f32(!isnan(a) && !isinf(a));",yue="return f32(isinf(a));",xue="return f32(isnan(a));",Aue="return a;",bue=`if (a < 0.0) { return uniforms.NAN; } - return log(a);`,vue=` +`,lde="return exp(a);",ude="return floor(a);",dde="return f32(!isnan(a) && !isinf(a));",pde="return f32(isinf(a));",cde="return f32(isnan(a));",hde="return a;",mde=`if (a < 0.0) { return uniforms.NAN; } + return log(a);`,fde=` if (isnan(a)) { return a; } return log(1.0 + a); -`,wue="return f32(!(a >= 1.0));",kue="return -a;",Iue="if (a < 0.0) { return uniforms.alpha * a; } return a;",Sue=` +`,gde="return f32(!(a >= 1.0));",yde="return -a;",xde="if (a < 0.0) { return uniforms.alpha * a; } return a;",Ade=` let aLessThanZero = vec4(a < vec4(0.0)); return (aLessThanZero * (uniforms.alpha * a)) + ((vec4(1.0) - aLessThanZero) * a); -`,Cue="return 1.0 / a;",Tue="return select(a, 0.0, a < 0.0);",Nue="return clamp(a, 0.0, 6.0);",Rue="return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));",Eue=` +`,bde="return 1.0 / a;",vde="return select(a, 0.0, a < 0.0);",wde="return clamp(a, 0.0, 6.0);",kde="return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));",Ide=` return select(a, vec4(0.0), a < vec4(0.0)); -`,Mue="return round(a);",Pue="return inverseSqrt(a);",_ue=` +`,Sde="return round(a);",Tde="return inverseSqrt(a);",Cde=` if (a >= 0.0) { - return ${C.SELU_SCALE} * a; + return ${I.SELU_SCALE} * a; } else { - return ${C.SELU_SCALEALPHA} * (exp(a) - 1.0); + return ${I.SELU_SCALEALPHA} * (exp(a) - 1.0); } -`,$ue="return 1.0 / (1.0 + exp(-1.0 * a));",Fue="return sign(a);",Due="return sin(a);",Oue=` +`,Nde="return 1.0 / (1.0 + exp(-1.0 * a));",Rde="return sign(a);",Ede="return sin(a);",Mde=` let e2x = exp(a); return (e2x - 1.0 / e2x) / 2.0; -`,zue=` +`,Fde=` let epsilon = 1.1920928955078125e-7; let threshold = log(epsilon) + 2.0; @@ -5421,26 +5421,26 @@ return a / b;`,vJ=` } else { return log(exp_a + 1.0); } -`,Lue="return sqrt(a);",Wue="return a * a;",Bue=` +`,$de="return sqrt(a);",Dde="return a * a;",Pde=` if (isnan(a)) { return a; } return select(uniforms.stepAlpha, 1.0, a > 0.0); -`,Vue="return tan(a);",Uue=` +`,_de="return tan(a);",Ode=` let e2x = exp(-2.0 * abs(a)); return sign(a) * (1.0 - e2x) / (1.0 + e2x); -`,Gue="return f32(i32((a)));";function Ls(e,t){switch(e){case le.ABS:return eue;case le.ACOS:return tue;case le.ACOSH:return aue;case le.ASIN:return nue;case le.ASINH:return rue;case le.ATAN:return sue;case le.ATANH:return iue;case le.COS:return lue;case le.COSH:return uue;case le.CEIL:return oue;case le.ELU:return t?cue:pue;case le.ERF:return hue;case le.EXP:return mue;case le.EXPM1:return due;case le.FLOOR:return fue;case le.IS_FINITE:return gue;case le.IS_INF:return yue;case le.IS_NAN:return xue;case le.LINEAR:return Aue;case le.LOG:return bue;case le.LOG1P:return vue;case le.LOGICAL_NOT:return wue;case le.NEG:return kue;case le.LEAKYRELU:return t?Sue:Iue;case le.RECIPROCAL:return Cue;case le.RELU:return t?Eue:Tue;case le.RELU6:return t?Rue:Nue;case le.ROUND:return Mue;case le.RSQRT:return Pue;case le.SELU:return _ue;case le.SIGMOID:return $ue;case le.SIGN:return Fue;case le.SIN:return Due;case le.SINH:return Oue;case le.SOFTPLUS:return zue;case le.SQRT:return Lue;case le.SQUARE:return Wue;case le.STEP:return Bue;case le.TAN:return Vue;case le.TANH:return Uue;case le.TO_INT:return Gue;default:throw new Error(`BinaryType ${e} is not implemented!`)}}function Pr(e,t=!1,a=!1,n=3){if(e===null)return"";let r="";if(e==="linear")r=Ls(le.LINEAR);else if(e==="relu")r=Ls(le.RELU,a);else if(e==="elu")r=Ls(le.ELU,a);else if(e==="relu6")r=Ls(le.RELU6,a);else if(e==="prelu")r=X3(_e.PRELU,a);else if(e==="sigmoid")r=Ls(le.SIGMOID,a);else if(e==="leakyrelu")r=Ls(le.LEAKYRELU,a);else throw new Error(`Activation ${e} has not been implemented for the WebGPU backend.`);let s=Xe(a?4:1),i="";return t?i=` +`,zde="return f32(i32((a)));";function pi(e,t){switch(e){case le.ABS:return Xue;case le.ACOS:return Kue;case le.ACOSH:return Yue;case le.ASIN:return Zue;case le.ASINH:return Jue;case le.ATAN:return Que;case le.ATANH:return ede;case le.COS:return ade;case le.COSH:return nde;case le.CEIL:return tde;case le.ELU:return t?ide:sde;case le.ERF:return ode;case le.EXP:return lde;case le.EXPM1:return rde;case le.FLOOR:return ude;case le.IS_FINITE:return dde;case le.IS_INF:return pde;case le.IS_NAN:return cde;case le.LINEAR:return hde;case le.LOG:return mde;case le.LOG1P:return fde;case le.LOGICAL_NOT:return gde;case le.NEG:return yde;case le.LEAKYRELU:return t?Ade:xde;case le.RECIPROCAL:return bde;case le.RELU:return t?Ide:vde;case le.RELU6:return t?kde:wde;case le.ROUND:return Sde;case le.RSQRT:return Tde;case le.SELU:return Cde;case le.SIGMOID:return Nde;case le.SIGN:return Rde;case le.SIN:return Ede;case le.SINH:return Mde;case le.SOFTPLUS:return Fde;case le.SQRT:return $de;case le.SQUARE:return Dde;case le.STEP:return Pde;case le.TAN:return _de;case le.TANH:return Ode;case le.TO_INT:return zde;default:throw new Error(`BinaryType ${e} is not implemented!`)}}function Or(e,t=!1,a=!1,n=3){if(e===null)return"";let r="";if(e==="linear")r=pi(le.LINEAR);else if(e==="relu")r=pi(le.RELU,a);else if(e==="elu")r=pi(le.ELU,a);else if(e==="relu6")r=pi(le.RELU6,a);else if(e==="prelu")r=ry(De.PRELU,a);else if(e==="sigmoid")r=pi(le.SIGMOID,a);else if(e==="leakyrelu")r=pi(le.LEAKYRELU,a);else throw new Error(`Activation ${e} has not been implemented for the WebGPU backend.`);let s=Xe(a?4:1),i="";return t?i=` fn activation(a : ${s}, coords : vec${n}) -> ${s} { let b = getPreluActivationWeightsByOutputCoords(coords); ${r} }`:i=` fn activation(a : ${s}, coords : vec${n}) -> ${s} { ${r} - }`,i}function sl(e,t){return` + }`,i}function ml(e,t){return` ${e?"value = value + getBiasByOutputCoords(coords);":""} ${t?"value = activation(value, coords);":""} - `}function Ck(e,t,a=!1,n=!1,r=!1,s=1){v.assert(e&&s===1||!e,()=>`transposeA ${e} is not compatible with component size ${s}`);let i=` + `}function jk(e,t,a=!1,n=!1,r=!1,s=1){v.assert(e&&s===1||!e,()=>`transposeA ${e} is not compatible with component size ${s}`);let i=` ${e?"value = getA(batch, col, row);":"value = getA(batch, row, col);"} `,o=t?"value = getB(batch, col, row);":"value = getB(batch, row, col);";return` @@ -5460,18 +5460,18 @@ return a / b;`,vJ=` ${o} return value; } - `}function K3(e,t,a,n,r=!1,s=!1,i=!1,o=1){return` - ${Ck(a,n,r,s,i,o)} + `}function sy(e,t,a,n,r=!1,s=!1,i=!1,o=1){return` + ${jk(a,n,r,s,i,o)} fn mm_write(batch: i32, row: i32, col: i32, valueIn: ${Xe(o)}) { ${r&&s?"":"if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)"} { var value = valueIn; let coords = vec3(batch, row, col); - ${sl(e,t)} + ${ml(e,t)} setOutputAtCoords(coords[0], coords[1], coords[2], value); } } - `}var Hue=(e,t)=>e?` + `}var Lde=(e,t)=>e?` mm_Asub[inputRow][inputCol] = mm_readA(batchA, kStart + inputRow, globalRowStart + inputCol * ${t}); @@ -5479,7 +5479,7 @@ return a / b;`,vJ=` mm_Asub[inputRow][inputCol] = mm_readA(batchA, globalRow + innerRow, kStart + inputCol * ${t}); - `,jue=(e,t,a,n)=>{if(e)return` + `,Wde=(e,t,a,n)=>{if(e)return` for (var k = 0; k < ${n}; k++) { let BCached0 = mm_Bsub[k][tileCol]; let ACached0 = mm_Asub[k][localRow]; @@ -5493,10 +5493,10 @@ return a / b;`,vJ=` let ACached = mm_Asub[tileRow + i][k]; ${s} } - }`}};function u0(e,t,a=!1,n=32,r=!1,s=32,i=!1){let o=t[1]*e[1],l=t[0]*e[0],u=a?o:n,p=a?n:o,c=u/t[0],d=n/t[1],h=e[1],m=e[0];return v.assert((a&&c===4&&e[1]===4||!a&&(c===3||c===4))&&u%t[0]===0&&n%t[1]===0&&e[0]===4,()=>`If transposeA ${a} is true, innerElementSize ${c} and workPerThread[1] ${e[1]} must be 4. + }`}};function g0(e,t,a=!1,n=32,r=!1,s=32,i=!1){let o=t[1]*e[1],l=t[0]*e[0],u=a?o:n,d=a?n:o,c=u/t[0],p=n/t[1],h=e[1],m=e[0];return v.assert((a&&c===4&&e[1]===4||!a&&(c===3||c===4))&&u%t[0]===0&&n%t[1]===0&&e[0]===4,()=>`If transposeA ${a} is true, innerElementSize ${c} and workPerThread[1] ${e[1]} must be 4. Otherwise, innerElementSize ${c} must be 3 or 4. tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${n} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${e[0]} must be 4.`),` - var mm_Asub : array, ${u/c}>, ${p}>; + var mm_Asub : array, ${u/c}>, ${d}>; var mm_Bsub : array, ${l/e[0]}>, ${n}>; ${ue()} { @@ -5517,17 +5517,17 @@ return a / b;`,vJ=` var acc: array, ${h}>; // Loop over shared dimension. - let tileRowB = localRow * ${d}; + let tileRowB = localRow * ${p}; for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. for (var innerRow = 0; innerRow < ${h}; innerRow++) { let inputRow = tileRow + innerRow; let inputCol = tileCol; - ${Hue(a,c)} + ${Lde(a,c)} } // Load one tile of B into local memory. - for (var innerRow = 0; innerRow < ${d}; innerRow++) { + for (var innerRow = 0; innerRow < ${p}; innerRow++) { let inputRow = tileRowB + innerRow; let inputCol = tileCol; mm_Bsub[inputRow][inputCol] = mm_readB(batchB, kStart + inputRow, globalCol); @@ -5536,14 +5536,14 @@ return a / b;`,vJ=` workgroupBarrier(); // Compute acc values for a single thread. - ${jue(a,c,h,n)} + ${Wde(a,c,h,n)} workgroupBarrier(); } for (var innerRow = 0; innerRow < ${h}; innerRow++) { mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); } - }`}var aA=e=>e?` + }`}var gA=e=>e?` mm_Asub[inputRow][inputCol] = mm_readA(batchA, kStart + inputRow, globalRowStart + inputCol); @@ -5551,7 +5551,7 @@ return a / b;`,vJ=` mm_Asub[inputRow][inputCol] = mm_readA(batchA, globalRowStart + inputRow, kStart + inputCol); - `,que=e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];";function d0(e,t,a=!1,n=32,r=!1,s=32,i=!1,o=!1){let l=e[1]*t[1],u=e[0]*t[0],p=a?l:n,c=a?n:l;v.assert(c%t[1]===0&&p%t[0]===0&&n%t[1]===0,()=>`tileAHight ${c} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${p} must be divisible by workgroupSize[0]${t[0]}, tileInner ${n} must be divisible by workgroupSize[1]${t[1]}`);let d=c/t[1],h=p/t[0],m=n/t[1],f=e[1],g=e[0],y=i?` + `,Bde=e=>e?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];";function y0(e,t,a=!1,n=32,r=!1,s=32,i=!1,o=!1){let l=e[1]*t[1],u=e[0]*t[0],d=a?l:n,c=a?n:l;v.assert(c%t[1]===0&&d%t[0]===0&&n%t[1]===0,()=>`tileAHight ${c} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${d} must be divisible by workgroupSize[0]${t[0]}, tileInner ${n} must be divisible by workgroupSize[1]${t[1]}`);let p=c/t[1],h=d/t[0],m=n/t[1],f=e[1],g=e[0],y=i?` let localRow = i32(localId.y); let localCol = i32(localId.x); let globalRowStart = i32(workgroupId.y) * ${l}; @@ -5561,8 +5561,8 @@ return a / b;`,vJ=` for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. for (var inputRow = localRow; inputRow < ${c}; inputRow = inputRow + ${t[1]}) { - for (var inputCol = localCol; inputCol < ${p}; inputCol = inputCol + ${t[0]}) { - ${aA(a)} + for (var inputCol = localCol; inputCol < ${d}; inputCol = inputCol + ${t[0]}) { + ${gA(a)} } } // Load one tile of B into local memory. @@ -5607,17 +5607,17 @@ return a / b;`,vJ=` let globalCol = i32(globalId.x) * ${g}; let globalRowStart = i32(workgroupId.y) * ${l}; - let tileRowA = i32(localId.y) * ${d}; + let tileRowA = i32(localId.y) * ${p}; let tileColA = i32(localId.x) * ${h}; let tileRowB = i32(localId.y) * ${m}; // Loop over shared dimension. for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. - for (var innerRow = 0; innerRow < ${d}; innerRow++) { + for (var innerRow = 0; innerRow < ${p}; innerRow++) { for (var innerCol = 0; innerCol < ${h}; innerCol++) { let inputRow = tileRowA + innerRow; let inputCol = tileColA + innerCol; - ${aA(a)} + ${gA(a)} } } @@ -5642,7 +5642,7 @@ return a / b;`,vJ=` } for (var innerRow = 0; innerRow < ${f}; innerRow++) { - ${que(a)} + ${Bde(a)} for (var innerCol = 0; innerCol < ${g}; innerCol++) { acc[innerRow][innerCol] = fma(ACached, BCached[innerCol], acc[innerRow][innerCol]); @@ -5660,7 +5660,7 @@ return a / b;`,vJ=` } } `;return` - var mm_Asub : array, ${c}>; + var mm_Asub : array, ${c}>; var mm_Bsub : array, ${n}>; ${ue()} { @@ -5680,7 +5680,7 @@ return a / b;`,vJ=` } ${y} } - `}var Xue=e=>e?` + `}var Vde=e=>e?` mm_readA(batchA, colA, globalRow), mm_readA(batchA, colA + 1, globalRow), mm_readA(batchA, colA + 2, globalRow), @@ -5690,7 +5690,7 @@ return a / b;`,vJ=` mm_readA(batchA, globalRow, colA + 1), mm_readA(batchA, globalRow, colA + 2), mm_readA(batchA, globalRow, colA + 3) - `;function Kue(e,t=!1){v.assert(e[1]===1&&e[2]===1,()=>`A linear work group size is required. But got ${e}.`);let a=e[0]*4;return` + `;function Ude(e,t=!1){v.assert(e[1]===1&&e[2]===1,()=>`A linear work group size is required. But got ${e}.`);let a=e[0]*4;return` var mm_Asub : array, ${e[0]}>; ${ue()} { @@ -5709,7 +5709,7 @@ return a / b;`,vJ=` for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. let colA = t * ${a} + tileCol * 4; - mm_Asub[tileCol] = vec4(${Xue(t)}); + mm_Asub[tileCol] = vec4(${Vde(t)}); workgroupBarrier(); // Compute acc values for a single thread. @@ -5729,11 +5729,11 @@ return a / b;`,vJ=` mm_write(batch, globalRow, globalCol, acc); } - `}var Yue=class{constructor(e,t,a=!1,n=!1,r=null,s=null,i=null,o=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=t,this.dispatchLayout={x:[2],y:[1],z:[0]};let l=a?e[1]:e[2];if(this.isVec4=(l%4===0&&!a||t[1]%4===0&&a)&&t[2]%4===0&&!n,this.outputComponent=this.isVec4?4:1,this.isVectorA=t[1]===1&&!a,!this.isVec4&&this.isVectorA)this.elementsPerThread=[1,1,1],this.workgroupSize=[32,1,1];else{let c=Ik(t[1],l,t[2],a);this.workgroupSize=c.workgroupSize,this.elementsPerThread=c.elementsPerThread}this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread);let u=r!=null,p=i!=null;u&&this.variableNames.push("bias"),p&&this.variableNames.push("preluActivationWeights"),this.sequentialAccessByThreads=o,this.transposeA=a,this.transposeB=n,this.addBias=u,this.activation=s,this.hasPreluActivationWeights=p,[this.fitAOuter,this.fitBOuter,this.fitInner]=this.getShapeFit(t[1],t[2],l),this.shaderKey=`matMulPacked_${this.elementsPerThread}_${a}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`}getShapeFit(e,t,a){let n=this.workgroupSize[1]*this.elementsPerThread[1],r=this.workgroupSize[0]*this.elementsPerThread[0];!this.isVec4&&this.isVectorA?this.tileInner=this.workgroupSize[0]*4:this.tileInner=r;let s=e%n===0,i=t%r===0,o=a%this.tileInner===0;return[s,i,o]}getUserCode(){return` - ${Pr(this.activation,this.hasPreluActivationWeights,this.isVec4)} - ${K3(this.addBias,this.activation,!1,this.transposeB,this.fitAOuter,this.fitBOuter,this.fitInner,this.isVec4?4:1)} - ${this.isVec4?u0(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,!0):this.isVectorA?Kue(this.workgroupSize,this.transposeA):d0(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,this.sequentialAccessByThreads,!0)} - `}};function Zue(e){return` + `}var Gde=class{constructor(e,t,a=!1,n=!1,r=null,s=null,i=null,o=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=t,this.dispatchLayout={x:[2],y:[1],z:[0]};let l=a?e[1]:e[2];if(this.isVec4=(l%4===0&&!a||t[1]%4===0&&a)&&t[2]%4===0&&!n,this.outputComponent=this.isVec4?4:1,this.isVectorA=t[1]===1&&!a,!this.isVec4&&this.isVectorA)this.elementsPerThread=[1,1,1],this.workgroupSize=[32,1,1];else{let c=Gk(t[1],l,t[2],a);this.workgroupSize=c.workgroupSize,this.elementsPerThread=c.elementsPerThread}this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread);let u=r!=null,d=i!=null;u&&this.variableNames.push("bias"),d&&this.variableNames.push("preluActivationWeights"),this.sequentialAccessByThreads=o,this.transposeA=a,this.transposeB=n,this.addBias=u,this.activation=s,this.hasPreluActivationWeights=d,[this.fitAOuter,this.fitBOuter,this.fitInner]=this.getShapeFit(t[1],t[2],l),this.shaderKey=`matMulPacked_${this.elementsPerThread}_${a}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`}getShapeFit(e,t,a){let n=this.workgroupSize[1]*this.elementsPerThread[1],r=this.workgroupSize[0]*this.elementsPerThread[0];!this.isVec4&&this.isVectorA?this.tileInner=this.workgroupSize[0]*4:this.tileInner=r;let s=e%n===0,i=t%r===0,o=a%this.tileInner===0;return[s,i,o]}getUserCode(){return` + ${Or(this.activation,this.hasPreluActivationWeights,this.isVec4)} + ${sy(this.addBias,this.activation,!1,this.transposeB,this.fitAOuter,this.fitBOuter,this.fitInner,this.isVec4?4:1)} + ${this.isVec4?g0(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,!0):this.isVectorA?Ude(this.workgroupSize,this.transposeA):y0(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,this.sequentialAccessByThreads,!0)} + `}};function Hde(e){return` var sumValues : array; ${ue()} { let coords = getOutputCoords(); @@ -5766,11 +5766,11 @@ return a / b;`,vJ=` mm_write(batch, row, col, sum); } } - `}var Jue=class{constructor(e,t=!1,a=!1,n=null,r=null,s=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout={x:[],y:[1,2],z:[0]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize);let i=n!=null,o=s!=null;i&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),this.transposeA=t,this.transposeB=a,this.addBias=i,this.activation=r,this.hasPreluActivationWeights=o,this.shaderKey=`matMulReduce_${this.activation}_${t}_${a}`}getUserCode(){return` - ${Pr(this.activation,this.hasPreluActivationWeights)} - ${K3(this.addBias,this.activation,this.transposeA,this.transposeB)} - ${Zue(this.workgroupSize[0])} - `}};function Que(e){let t=e[1],a=e[0],n=t>a?t:a;return` + `}var jde=class{constructor(e,t=!1,a=!1,n=null,r=null,s=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout={x:[],y:[1,2],z:[0]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize);let i=n!=null,o=s!=null;i&&this.variableNames.push("bias"),o&&this.variableNames.push("preluActivationWeights"),this.transposeA=t,this.transposeB=a,this.addBias=i,this.activation=r,this.hasPreluActivationWeights=o,this.shaderKey=`matMulReduce_${this.activation}_${t}_${a}`}getUserCode(){return` + ${Or(this.activation,this.hasPreluActivationWeights)} + ${sy(this.addBias,this.activation,this.transposeA,this.transposeB)} + ${Hde(this.workgroupSize[0])} + `}};function qde(e){let t=e[1],a=e[0],n=t>a?t:a;return` var mm_Asub : array, ${t}>; var mm_Bsub : array, ${n}>; @@ -5822,12 +5822,12 @@ return a / b;`,vJ=` mm_write(batch, globalRow, globalCol, acc); } - `}var ede=class{constructor(e,t,a,n=!1,r=!1,s=null,i=null,o=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[16,8,1],this.outputShape=a,this.dispatchLayout={x:[2],y:[1],z:[0]},this.dispatch=[Math.ceil(a[2]/this.workgroupSize[0]),Math.ceil(a[1]/this.workgroupSize[1]),a[0]];let l=s!=null;l&&this.variableNames.push("bias");let u=o!=null;u&&this.variableNames.push("preluActivationWeights"),this.transposeA=n,this.transposeB=r,this.addBias=l,this.activation=i,this.hasPreluActivationWeights=u,this.shaderKey=`matMulSmallOutputSize_${this.activation}_${n}_${r}`}getUserCode(){return` - ${Pr(this.activation,this.hasPreluActivationWeights)} - ${K3(this.addBias,this.activation,this.transposeA,this.transposeB)} - ${Que(this.workgroupSize)} - `}},tde=class{constructor(e,t,a=!1,n=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[8,8,1],this.atomic=!0,this.splitedDimInner=128,v.assert(e[0]===1,()=>"MatMulSplitKProgram only supports batch = 1."),this.outputShape=e,this.dispatchLayout={x:[2],y:[1],z:[0,3]};let r=(a&&this.outputShape[1]%4===0||!a&&t%4===0)&&this.outputShape[2]%4===0;this.elementsPerThread=[4,4,this.splitedDimInner],this.outputComponent=r?4:1,r||(this.outputShape[1]<16&&(this.elementsPerThread[1]=1),this.outputShape[2]<16&&(this.elementsPerThread[0]=1)),this.dispatch=de(this.dispatchLayout,[this.outputShape[0],this.outputShape[1],this.outputShape[2],t],this.workgroupSize,this.elementsPerThread),this.transposeA=a,this.transposeB=n,this.shaderKey=`matMulSplitK_${a}_${n}_${this.elementsPerThread}_${this.outputComponent}`}getUserCode(){let e=this.outputComponent;return` - ${Ck(!1,this.transposeB,!1,!1,!1,e)} + `}var Xde=class{constructor(e,t,a,n=!1,r=!1,s=null,i=null,o=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[16,8,1],this.outputShape=a,this.dispatchLayout={x:[2],y:[1],z:[0]},this.dispatch=[Math.ceil(a[2]/this.workgroupSize[0]),Math.ceil(a[1]/this.workgroupSize[1]),a[0]];let l=s!=null;l&&this.variableNames.push("bias");let u=o!=null;u&&this.variableNames.push("preluActivationWeights"),this.transposeA=n,this.transposeB=r,this.addBias=l,this.activation=i,this.hasPreluActivationWeights=u,this.shaderKey=`matMulSmallOutputSize_${this.activation}_${n}_${r}`}getUserCode(){return` + ${Or(this.activation,this.hasPreluActivationWeights)} + ${sy(this.addBias,this.activation,this.transposeA,this.transposeB)} + ${qde(this.workgroupSize)} + `}},Kde=class{constructor(e,t,a=!1,n=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[8,8,1],this.atomic=!0,this.splitedDimInner=128,v.assert(e[0]===1,()=>"MatMulSplitKProgram only supports batch = 1."),this.outputShape=e,this.dispatchLayout={x:[2],y:[1],z:[0,3]};let r=(a&&this.outputShape[1]%4===0||!a&&t%4===0)&&this.outputShape[2]%4===0;this.elementsPerThread=[4,4,this.splitedDimInner],this.outputComponent=r?4:1,r||(this.outputShape[1]<16&&(this.elementsPerThread[1]=1),this.outputShape[2]<16&&(this.elementsPerThread[0]=1)),this.dispatch=de(this.dispatchLayout,[this.outputShape[0],this.outputShape[1],this.outputShape[2],t],this.workgroupSize,this.elementsPerThread),this.transposeA=a,this.transposeB=n,this.shaderKey=`matMulSplitK_${a}_${n}_${this.elementsPerThread}_${this.outputComponent}`}getUserCode(){let e=this.outputComponent;return` + ${jk(!1,this.transposeB,!1,!1,!1,e)} fn mm_write(batch: i32, row : i32, col : i32, value : ${Xe(e)}) { if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) { let coords = vec3(batch, row, col); @@ -5835,31 +5835,31 @@ return a / b;`,vJ=` // The problem is that we should initialize output to zero before using. // Otherwise, the original value will be added to the result. for (var i = 0; i < ${e}; i = i + 1) { - ${gs("&result[flatIndex + i]",`${e>1?"value[i]":"value"}`,"float32")} + ${Bs("&result[flatIndex + i]",`${e>1?"value[i]":"value"}`,"float32")} } } } - ${e===4?u0(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner):d0(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner)} - `}},ade=class{constructor(e,t=null,a=null,n=null){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t!=null,this.hasPreluActivationWeights=n!=null,this.activation=a,this.addBias&&this.variableNames.push("bias"),this.hasPreluActivationWeights&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`biasActivation_${a}`}getUserCode(){return` - ${Pr(this.activation,this.hasPreluActivationWeights)} + ${e===4?g0(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner):y0(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner)} + `}},Yde=class{constructor(e,t=null,a=null,n=null){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t!=null,this.hasPreluActivationWeights=n!=null,this.activation=a,this.addBias&&this.variableNames.push("bias"),this.hasPreluActivationWeights&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`biasActivation_${a}`}getUserCode(){return` + ${Or(this.activation,this.hasPreluActivationWeights)} ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); var value = getXByOutputIndex(index); - ${sl(this.addBias,this.activation)} + ${ml(this.addBias,this.activation)} setOutputAtIndex(index, value); } } - `}},nde=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms="value : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="fill"}getUserCode(){return` + `}},Zde=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms="value : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="fill"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { setOutputAtIndex(index, uniforms.value); } } - `}};function Wa(e){let{backend:t,attrs:a}=e,{shape:n,value:r}=a,{dtype:s}=a;if(s=s||v.inferDtype(r),s==="string"){let i=v.getArrayFromDType(s,v.sizeFromShape(n));return i.fill(r),t.makeTensorInfo(n,s,i)}else{let i=new nde(n),o=[{type:"float32",data:[r]}];return t.runWebGPUProgram(i,[],s,o)}}var rde={kernelName:yu,backendName:"webgpu",kernelFunc:Wa};function ke(e){let{inputs:t,attrs:a}=e,{x:n}=t,{shape:r}=a,s=v.sizeFromShape(n.shape),i=v.inferFromImplicitShape(r,s),o=v.sizeFromShape(i);return v.assert(s===o,()=>`The new shape (${i}) has ${o} elements and the old shape (${n.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`),e.backend.incRef(n.dataId),{dataId:n.dataId,shape:i,dtype:n.dtype}}var sde={kernelName:Tu,backendName:"webgpu",kernelFunc:ke};function p0({a:e,b:t,transposeA:a,transposeB:n,backend:r,bias:s=null,preluActivationWeights:i=null,leakyreluAlpha:o=0,activation:l=null}){let u=e.shape.length,p=t.shape.length,c=a?e.shape[u-2]:e.shape[u-1],d=n?t.shape[p-1]:t.shape[p-2],h=a?e.shape[u-1]:e.shape[u-2],m=n?t.shape[p-2]:t.shape[p-1],f=e.shape.slice(0,-2),g=t.shape.slice(0,-2),y=v.sizeFromShape(f),x=v.sizeFromShape(g),A=el.assertAndGetBroadcastShape(e.shape.slice(0,-2),t.shape.slice(0,-2)).concat([h,m]);v.assert(c===d,()=>`Error in matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${a} and transposeB=${n} must match.`);let b=a?[y,c,h]:[y,h,c],w=n?[x,m,d]:[x,d,m],I=ke({inputs:{x:e},backend:r,attrs:{shape:b}}),T=ke({inputs:{x:t},backend:r,attrs:{shape:w}}),N=[I,T],M=Math.max(y,x),P=[I,T],E=[{type:"int32",data:[h]},{type:"int32",data:[m]},{type:"int32",data:[c]}],S,_,O=[M,h,m],W=B().get("WEBGPU_MATMUL_PROGRAM_TYPE");if(W<0){let U=B().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),G=U>0?U:r.thresholdToIncreaseWorkgroups,q=M*Math.ceil(h/32)*Math.ceil(m/32);q<=G||h<=8&&q<=G*2?M*h*m<=128?W=Dn.MatMulReduceProgram:M===1&&d>=2e3?W=Dn.MatMulSplitKProgram:W=Dn.MatMulSmallOutputSizeProgram:W=Dn.MatMulPackedProgram}switch(W){case Dn.MatMulReduceProgram:S=new Jue(O,a,n,s,l,i);break;case Dn.MatMulSplitKProgram:{if(_=Wa({backend:r,attrs:{shape:O,value:0,dtype:e.dtype}}),S=new tde(O,d,a,n),s||l){_=r.runWebGPUProgram(S,P,e.dtype,E,_);let G=new ade(_.shape,s,l,i),q=null,H=[_];s&&H.push(s),i&&H.push(i),l==="leakyrelu"&&(q=[{type:"float32",data:[o]}],G.uniforms+=" alpha : f32,");let V=r.runWebGPUProgram(G,H,_.dtype,q);N.push(_);let Z=ke({inputs:{x:V},backend:r,attrs:{shape:A}});N.push(V);for(let X of N)r.disposeData(X.dataId);return Z}break}case Dn.MatMulSmallOutputSizeProgram:S=new ede(b,w,O,a,n,s,l,i);break;case Dn.MatMulPackedProgram:let U=r.adapterInfo.isIntel();S=new Yue(b,O,a,n,s,l,i,U);break;default:throw new Error(`Unsupported MatMulProgramType ${W}.`)}s&&P.push(s),i&&P.push(i),l==="leakyrelu"&&(E.push({type:"float32",data:[o]}),S.uniforms+=" alpha : f32,"),_=r.runWebGPUProgram(S,P,e.dtype,E,_);let $=ke({inputs:{x:_},backend:r,attrs:{shape:A}});N.push(_);for(let U of N)r.disposeData(U.dataId);return $}function ide(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:p,leakyreluAlpha:c}=n;return p0({a:r,b:s,transposeA:l,transposeB:u,backend:a,bias:i,preluActivationWeights:o,leakyreluAlpha:c,activation:p})}var ode={kernelName:Yr,backendName:"webgpu",kernelFunc:ide},nA=class{constructor(e,t,a){this.variableNames=["AReal","AImag","BReal","BImag"],this.workgroupSize=[128,1,1],this.size=!0,this.outputShape=C.assertAndGetBroadcastShape(t,a),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`binaryOpComplex_${e}`,this.op=e}getUserCode(){return` + `}};function Wa(e){let{backend:t,attrs:a}=e,{shape:n,value:r}=a,{dtype:s}=a;if(s=s||v.inferDtype(r),s==="string"){let i=v.getArrayFromDType(s,v.sizeFromShape(n));return i.fill(r),t.makeTensorInfo(n,s,i)}else{let i=new Zde(n),o=[{type:"float32",data:[r]}];return t.runWebGPUProgram(i,[],s,o)}}var Jde={kernelName:Iu,backendName:"webgpu",kernelFunc:Wa};function ke(e){let{inputs:t,attrs:a}=e,{x:n}=t,{shape:r}=a,s=v.sizeFromShape(n.shape),i=v.inferFromImplicitShape(r,s),o=v.sizeFromShape(i);return v.assert(s===o,()=>`The new shape (${i}) has ${o} elements and the old shape (${n.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`),e.backend.incRef(n.dataId),{dataId:n.dataId,shape:i,dtype:n.dtype}}var Qde={kernelName:Du,backendName:"webgpu",kernelFunc:ke};function x0({a:e,b:t,transposeA:a,transposeB:n,backend:r,bias:s=null,preluActivationWeights:i=null,leakyreluAlpha:o=0,activation:l=null}){let u=e.shape.length,d=t.shape.length,c=a?e.shape[u-2]:e.shape[u-1],p=n?t.shape[d-1]:t.shape[d-2],h=a?e.shape[u-1]:e.shape[u-2],m=n?t.shape[d-2]:t.shape[d-1],f=e.shape.slice(0,-2),g=t.shape.slice(0,-2),y=v.sizeFromShape(f),x=v.sizeFromShape(g),A=ul.assertAndGetBroadcastShape(e.shape.slice(0,-2),t.shape.slice(0,-2)).concat([h,m]);v.assert(c===p,()=>`Error in matMul: inner shapes (${c}) and (${p}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${a} and transposeB=${n} must match.`);let b=a?[y,c,h]:[y,h,c],w=n?[x,m,p]:[x,p,m],S=ke({inputs:{x:e},backend:r,attrs:{shape:b}}),C=ke({inputs:{x:t},backend:r,attrs:{shape:w}}),N=[S,C],M=Math.max(y,x),F=[S,C],E=[{type:"int32",data:[h]},{type:"int32",data:[m]},{type:"int32",data:[c]}],T,D,O=[M,h,m],W=B().get("WEBGPU_MATMUL_PROGRAM_TYPE");if(W<0){let U=B().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),G=U>0?U:r.thresholdToIncreaseWorkgroups,q=M*Math.ceil(h/32)*Math.ceil(m/32);q<=G||h<=8&&q<=G*2?M*h*m<=128?W=Ln.MatMulReduceProgram:M===1&&p>=2e3?W=Ln.MatMulSplitKProgram:W=Ln.MatMulSmallOutputSizeProgram:W=Ln.MatMulPackedProgram}switch(W){case Ln.MatMulReduceProgram:T=new jde(O,a,n,s,l,i);break;case Ln.MatMulSplitKProgram:{if(D=Wa({backend:r,attrs:{shape:O,value:0,dtype:e.dtype}}),T=new Kde(O,p,a,n),s||l){D=r.runWebGPUProgram(T,F,e.dtype,E,D);let G=new Yde(D.shape,s,l,i),q=null,H=[D];s&&H.push(s),i&&H.push(i),l==="leakyrelu"&&(q=[{type:"float32",data:[o]}],G.uniforms+=" alpha : f32,");let V=r.runWebGPUProgram(G,H,D.dtype,q);N.push(D);let Z=ke({inputs:{x:V},backend:r,attrs:{shape:A}});N.push(V);for(let X of N)r.disposeData(X.dataId);return Z}break}case Ln.MatMulSmallOutputSizeProgram:T=new Xde(b,w,O,a,n,s,l,i);break;case Ln.MatMulPackedProgram:let U=r.adapterInfo.isIntel();T=new Gde(b,O,a,n,s,l,i,U);break;default:throw new Error(`Unsupported MatMulProgramType ${W}.`)}s&&F.push(s),i&&F.push(i),l==="leakyrelu"&&(E.push({type:"float32",data:[o]}),T.uniforms+=" alpha : f32,"),D=r.runWebGPUProgram(T,F,e.dtype,E,D);let $=ke({inputs:{x:D},backend:r,attrs:{shape:A}});N.push(D);for(let U of N)r.disposeData(U.dataId);return $}function epe(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s,bias:i,preluActivationWeights:o}=t,{transposeA:l,transposeB:u,activation:d,leakyreluAlpha:c}=n;return x0({a:r,b:s,transposeA:l,transposeB:u,backend:a,bias:i,preluActivationWeights:o,leakyreluAlpha:c,activation:d})}var tpe={kernelName:ts,backendName:"webgpu",kernelFunc:epe},yA=class{constructor(e,t,a){this.variableNames=["AReal","AImag","BReal","BImag"],this.workgroupSize=[128,1,1],this.size=!0,this.outputShape=I.assertAndGetBroadcastShape(t,a),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`binaryOpComplex_${e}`,this.op=e}getUserCode(){return` fn binaryOpComplex( areal : f32, aimag : f32, breal : f32, bimag : f32) -> f32 { - ${X3(this.op,!1)} + ${ry(this.op,!1)} } ${ue("index")} { @@ -5871,9 +5871,9 @@ return a / b;`,vJ=` setOutputAtIndex(index, binaryOpComplex(areal, aimag, breal, bimag)); } } - `}},Ch=class{constructor(e,t,a){if(this.size=!0,this.variableNames=["A","B"],this.outputShape=C.assertAndGetBroadcastShape(t,a),this.dispatchLayout=me(this.outputShape),this.op=e,this.useSharedMemoryWithA=t.length<=1&&a.length>1&&t[0]<128,this.useSharedMemoryWithB=a.length<=1&&t.length>1&&a[0]<128,this.useSharedMemoryWithA||this.useSharedMemoryWithB)this.outputComponent=1,this.variableComponents=[1,1],this.lastDimensionSize=this.useSharedMemoryWithB?a[0]:t[0],this.shaderKey=`binary_${e}_${this.lastDimensionSize}`,this.type="shared",this.workgroupSize=[256,1,1];else{let n=t.length>0&&t[t.length-1]%4===0,r=a.length>0&&a[a.length-1]%4===0;n&&r?(this.outputComponent=4,this.variableComponents=[4,4]):n&&(v.isScalarShape(a)||a[a.length-1]===1)||r&&(v.isScalarShape(t)||t[t.length-1]===1)?(this.outputComponent=4,this.variableComponents=n?[4,1]:[1,4]):(this.outputComponent=1,this.variableComponents=[1,1]),this.type="nonshared",this.shaderKey=`binary_${e}_${this.variableComponents}`,this.workgroupSize=[128,1,1]}this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.outputComponent,1,1])}getUserCode(){let e,t=this.outputComponent===4?"vec4":"f32",a=` + `}},$h=class{constructor(e,t,a){if(this.size=!0,this.variableNames=["A","B"],this.outputShape=I.assertAndGetBroadcastShape(t,a),this.dispatchLayout=me(this.outputShape),this.op=e,this.useSharedMemoryWithA=t.length<=1&&a.length>1&&t[0]<128,this.useSharedMemoryWithB=a.length<=1&&t.length>1&&a[0]<128,this.useSharedMemoryWithA||this.useSharedMemoryWithB)this.outputComponent=1,this.variableComponents=[1,1],this.lastDimensionSize=this.useSharedMemoryWithB?a[0]:t[0],this.shaderKey=`binary_${e}_${this.lastDimensionSize}`,this.type="shared",this.workgroupSize=[256,1,1];else{let n=t.length>0&&t[t.length-1]%4===0,r=a.length>0&&a[a.length-1]%4===0;n&&r?(this.outputComponent=4,this.variableComponents=[4,4]):n&&(v.isScalarShape(a)||a[a.length-1]===1)||r&&(v.isScalarShape(t)||t[t.length-1]===1)?(this.outputComponent=4,this.variableComponents=n?[4,1]:[1,4]):(this.outputComponent=1,this.variableComponents=[1,1]),this.type="nonshared",this.shaderKey=`binary_${e}_${this.variableComponents}`,this.workgroupSize=[128,1,1]}this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.outputComponent,1,1])}getUserCode(){let e,t=this.outputComponent===4?"vec4":"f32",a=` fn binaryOperation(a : ${t}, b : ${t}) -> ${t} { - ${X3(this.op,this.outputComponent===4)} + ${ry(this.op,this.outputComponent===4)} }; `;if(this.type==="shared"){let n=this.lastDimensionSize>1?`coords[${this.outputShape.length-1}]`:"0",r=this.useSharedMemoryWithB?`let a = getAByOutputIndex(index); let b = sharedBuf[${n}];`:`let a = sharedBuf[${n}]; @@ -5904,9 +5904,9 @@ return a / b;`,vJ=` setOutputAtIndex(index, binaryOperation(a, b)); } } - `;return e}};function en(e){let{inputs:t}=e,{x:a}=t;return e.backend.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var lde={kernelName:Hi,backendName:"webgpu",kernelFunc:en};function il(e){let{inputs:t,backend:a}=e,{real:n,imag:r}=t,s=a.makeTensorInfo(n.shape,"complex64"),i=a.tensorMap.get(s.dataId),o=en({inputs:{x:n},backend:a}),l=en({inputs:{x:r},backend:a});return i.complexTensorInfos={real:o,imag:l},s}var ude={kernelName:up,backendName:"webgpu",kernelFunc:il},Ju=class{constructor(e,t,a=""){this.variableNames=["A"],this.size=!0;let n=128;this.workgroupSize=[n,1,1],this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.op=t,a!==""&&(this.uniforms=a),this.shaderKey=`unary_${t}`}getUserCode(){return` + `;return e}};function an(e){let{inputs:t}=e,{x:a}=t;return e.backend.incRef(a.dataId),{dataId:a.dataId,shape:a.shape,dtype:a.dtype}}var ape={kernelName:ho,backendName:"webgpu",kernelFunc:an};function fl(e){let{inputs:t,backend:a}=e,{real:n,imag:r}=t,s=a.makeTensorInfo(n.shape,"complex64"),i=a.tensorMap.get(s.dataId),o=an({inputs:{x:n},backend:a}),l=an({inputs:{x:r},backend:a});return i.complexTensorInfos={real:o,imag:l},s}var npe={kernelName:xp,backendName:"webgpu",kernelFunc:fl},id=class{constructor(e,t,a=""){this.variableNames=["A"],this.size=!0;let n=128;this.workgroupSize=[n,1,1],this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.op=t,a!==""&&(this.uniforms=a),this.shaderKey=`unary_${t}`}getUserCode(){return` fn unaryOperation(a : f32) -> f32 { - ${Ls(this.op,!1)} + ${pi(this.op,!1)} } ${ue("index")} { if (index < uniforms.size) { @@ -5914,7 +5914,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, unaryOperation(a)); } } - `}};function at({opType:e,cpuKernelImpl:t,dtype:a}){return({inputs:n,backend:r})=>{let{x:s}=n,i=r,o=a||s.dtype;if(i.shouldExecuteOnCPU([s])&&t!=null){let u=i.tensorMap.get(s.dataId),p=t(u.values,o);return i.makeTensorInfo(s.shape,o,p)}let l=new Ju(s.shape,e);return i.runWebGPUProgram(l,[s],o)}}function ea({opType:e,cpuKernelImpl:t,supportsComplex:a=!1,dtype:n}){return({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(a&&i.dtype==="complex64"){let c=l.tensorMap.get(i.dataId),d=l.tensorMap.get(o.dataId),h,m;if(e!==_e.MUL)[h,m]=[[c.complexTensorInfos.real,d.complexTensorInfos.real],[c.complexTensorInfos.imag,d.complexTensorInfos.imag]].map(g=>{let[y,x]=g,A={dataId:y.dataId,dtype:y.dtype,shape:i.shape},b={dataId:x.dataId,dtype:x.dtype,shape:o.shape},w=new Ch(e,i.shape,o.shape);return l.runWebGPUProgram(w,[A,b],da(y.dtype,x.dtype))});else{let g=new nA(_e.COMPLEX_MULTIPLY_REAL,i.shape,o.shape),y=new nA(_e.COMPLEX_MULTIPLY_IMAG,i.shape,o.shape),x=[{dataId:c.complexTensorInfos.real.dataId,dtype:c.complexTensorInfos.real.dtype,shape:i.shape},{dataId:c.complexTensorInfos.imag.dataId,dtype:c.complexTensorInfos.imag.dtype,shape:i.shape},{dataId:d.complexTensorInfos.real.dataId,dtype:d.complexTensorInfos.real.dtype,shape:o.shape},{dataId:d.complexTensorInfos.imag.dataId,dtype:d.complexTensorInfos.imag.dtype,shape:o.shape}];h=l.runWebGPUProgram(g,x,"float32"),m=l.runWebGPUProgram(y,x,"float32")}let f=il({inputs:{real:h,imag:m},backend:l});return l.disposeData(h.dataId),l.disposeData(m.dataId),f}let u=n||da(i.dtype,o.dtype);if((i.dtype==="string"||o.dtype==="string"||l.shouldExecuteOnCPU([i,o]))&&t!=null){let c=l.tensorMap.get(i.dataId).values,d=l.tensorMap.get(o.dataId).values,h=i.dtype==="string"?C.fromUint8ToStringArray(c):c,m=i.dtype==="string"?C.fromUint8ToStringArray(d):d,[f,g]=t(i.shape,o.shape,h,m,u);return l.makeTensorInfo(g,u,f)}let p=new Ch(e,i.shape,o.shape);return l.runWebGPUProgram(p,[i,o],u)}}var{addImpl:dde,castImpl:pde,ceilImpl:cde,concatImpl:hde,equalImpl:mde,expImpl:fde,expm1Impl:gde,floorImpl:yde,floorDivImpl:xde,gatherNdImpl:Ade,gatherV2Impl:bde,greaterEqualImpl:vde,greaterImpl:wde,lessEqualImpl:kde,lessImpl:Ide,logImpl:Sde,maxImpl:Cde,maximumImpl:Tde,minimumImpl:Nde,multiplyImpl:Rde,negImpl:Ede,notEqualImpl:Mde,prodImpl:Pde,rangeImpl:_de,rsqrtImpl:$de,scatterImpl:Fde,simpleAbsImpl:Dde,sliceImpl:Ode,stridedSliceImpl:zde,stringNGramsImpl:Lde,subImpl:Wde,tileImpl:Bde,topKImpl:Vde,transposeImpl:Ude,uniqueImpl:iye}=e0,Gde=at({opType:le.ABS,cpuKernelImpl:Dde}),Hde={kernelName:ru,backendName:"webgpu",kernelFunc:Gde},jde=at({opType:le.ACOS}),qde={kernelName:si,backendName:"webgpu",kernelFunc:jde},Xde=at({opType:le.ACOSH}),Kde={kernelName:ii,backendName:"webgpu",kernelFunc:Xde},Yde=ea({opType:_e.ADD,cpuKernelImpl:dde,supportsComplex:!0}),Zde={kernelName:is,backendName:"webgpu",kernelFunc:Yde},Jde=class{constructor(e){this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e[0],this.variableNames=e.map((t,a)=>`T${a}`),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="addN"}getUserCode(){let e=[];this.variableNames.forEach(a=>{e.push(`let v${a} = get${a}ByOutputCoords(coords);`)});let t=this.variableNames.map(a=>`v${a}`).join(" + ");return` + `}};function at({opType:e,cpuKernelImpl:t,dtype:a}){return({inputs:n,backend:r})=>{let{x:s}=n,i=r,o=a||s.dtype;if(i.shouldExecuteOnCPU([s])&&t!=null){let u=i.tensorMap.get(s.dataId),d=t(u.values,o);return i.makeTensorInfo(s.shape,o,d)}let l=new id(s.shape,e);return i.runWebGPUProgram(l,[s],o)}}function aa({opType:e,cpuKernelImpl:t,supportsComplex:a=!1,dtype:n}){return({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(a&&i.dtype==="complex64"){let c=l.tensorMap.get(i.dataId),p=l.tensorMap.get(o.dataId),h,m;if(e!==De.MUL)[h,m]=[[c.complexTensorInfos.real,p.complexTensorInfos.real],[c.complexTensorInfos.imag,p.complexTensorInfos.imag]].map(g=>{let[y,x]=g,A={dataId:y.dataId,dtype:y.dtype,shape:i.shape},b={dataId:x.dataId,dtype:x.dtype,shape:o.shape},w=new $h(e,i.shape,o.shape);return l.runWebGPUProgram(w,[A,b],Qt(y.dtype,x.dtype))});else{let g=new yA(De.COMPLEX_MULTIPLY_REAL,i.shape,o.shape),y=new yA(De.COMPLEX_MULTIPLY_IMAG,i.shape,o.shape),x=[{dataId:c.complexTensorInfos.real.dataId,dtype:c.complexTensorInfos.real.dtype,shape:i.shape},{dataId:c.complexTensorInfos.imag.dataId,dtype:c.complexTensorInfos.imag.dtype,shape:i.shape},{dataId:p.complexTensorInfos.real.dataId,dtype:p.complexTensorInfos.real.dtype,shape:o.shape},{dataId:p.complexTensorInfos.imag.dataId,dtype:p.complexTensorInfos.imag.dtype,shape:o.shape}];h=l.runWebGPUProgram(g,x,"float32"),m=l.runWebGPUProgram(y,x,"float32")}let f=fl({inputs:{real:h,imag:m},backend:l});return l.disposeData(h.dataId),l.disposeData(m.dataId),f}let u=n||Qt(i.dtype,o.dtype);if((i.dtype==="string"||o.dtype==="string"||l.shouldExecuteOnCPU([i,o]))&&t!=null){let c=l.tensorMap.get(i.dataId).values,p=l.tensorMap.get(o.dataId).values,h=i.dtype==="string"?I.fromUint8ToStringArray(c):c,m=i.dtype==="string"?I.fromUint8ToStringArray(p):p,[f,g]=t(i.shape,o.shape,h,m,u);return l.makeTensorInfo(g,u,f)}let d=new $h(e,i.shape,o.shape);return l.runWebGPUProgram(d,[i,o],u)}}var qk={};Ke(qk,{addImpl:()=>Yk,bincountImpl:()=>ope,bincountReduceImpl:()=>lpe,bitwiseAndImpl:()=>Zk,castImpl:()=>Kk,ceilImpl:()=>Qk,concatImpl:()=>upe,equalImpl:()=>e9,expImpl:()=>t9,expm1Impl:()=>a9,floorDivImpl:()=>r9,floorImpl:()=>n9,gatherNdImpl:()=>dpe,gatherV2Impl:()=>ppe,greaterEqualImpl:()=>i9,greaterImpl:()=>s9,lessEqualImpl:()=>l9,lessImpl:()=>o9,linSpaceImpl:()=>cpe,logImpl:()=>u9,maxImpl:()=>hpe,maximumImpl:()=>d9,minimumImpl:()=>p9,multiplyImpl:()=>ly,negImpl:()=>fpe,notEqualImpl:()=>c9,prodImpl:()=>ype,raggedGatherImpl:()=>Ipe,raggedRangeImpl:()=>Spe,raggedTensorToTensorImpl:()=>Cpe,rangeImpl:()=>Npe,rsqrtImpl:()=>h9,scatterImpl:()=>Rpe,sigmoidImpl:()=>Epe,simpleAbsImpl:()=>rpe,sliceImpl:()=>Mpe,sparseFillEmptyRowsImpl:()=>Fpe,sparseReshapeImpl:()=>$pe,sparseSegmentReductionImpl:()=>Dpe,sqrtImpl:()=>Ppe,squaredDifferenceImpl:()=>m9,staticRegexReplaceImpl:()=>f9,stridedSliceImpl:()=>_pe,stringNGramsImpl:()=>zpe,stringSplitImpl:()=>Wpe,stringToHashBucketFastImpl:()=>Bpe,subImpl:()=>g9,tileImpl:()=>Upe,topKImpl:()=>Gpe,transposeImpl:()=>gpe,uniqueImpl:()=>Hpe});function Xk(e,t){Array.isArray(e)||(e=[e]),e.forEach(a=>{a!=null&&v.assert(a.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}function rpe(e){let t=new Float32Array(e.length);for(let a=0;a{let i=I.assertAndGetBroadcastShape(t,a),o=i.length,l=v.computeStrides(i),u=v.sizeFromShape(i),d=v.getTypedArrayFromDType(s,u),c=t.length,p=a.length,h=v.computeStrides(t),m=v.computeStrides(a),f=I.getBroadcastDims(t,i),g=I.getBroadcastDims(a,i);if(f.length+g.length===0)for(let y=0;yA[C]=0);let b=v.locToIndex(A,c,h),w=x.slice(-p);g.forEach(C=>w[C]=0);let S=v.locToIndex(w,p,m);d[y]=e(n[b],r[S])}return[d,i]}}function iy(e){let{inputs:t,backend:a}=e,{real:n,imag:r}=t,s=a.data.get(n.dataId).values,i=a.data.get(r.dataId).values,o=a.makeTensorInfo(n.shape,"complex64"),l=a.data.get(o.dataId);return l.complexTensorInfos={real:a.makeTensorInfo(n.shape,"float32",s),imag:a.makeTensorInfo(r.shape,"float32",i)},o}function eg(e,t,a="float32"){if(a==="complex64"){let r=eg(e,t,"float32"),s=eg(e,t,"float32");return iy({inputs:{real:r,imag:s},backend:e})}let n=v.makeZerosTypedArray(v.sizeFromShape(t),a);return e.makeTensorInfo(t,a,n)}function xA(e){let{inputs:t,backend:a}=e,{x:n}=t;return a.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}function spe(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.data.get(n.dataId).complexTensorInfos.real,s=a.data.get(r.dataId).values;return a.makeTensorInfo(r.shape,r.dtype,s)}function Kk(e,t,a,n){if(n==="int32"){let r=Int32Array.from(e);return[t,"int32",r]}if(n==="bool"){let r=v.toTypedArray([0],a),[s,i]=Ua((o,l)=>o!==l?1:0)(t,[],e,r,"bool");return[i,"bool",s]}throw new Error(`Error in Cast: failed to cast ${a} to ${n}`)}function Dh(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dtype:s}=n;if(s==="complex64"){if(r.dtype==="complex64")return xA({inputs:{x:r},backend:a});let d=eg(a,r.shape,r.dtype),c=Dh({inputs:{x:r},backend:a,attrs:{dtype:"float32"}}),p=iy({inputs:{real:c,imag:d},backend:a});return a.disposeIntermediateTensorInfo(d),a.disposeIntermediateTensorInfo(c),p}if(r.dtype==="complex64"){let d=spe({inputs:{input:r},backend:a}),c=Dh({inputs:{x:d},backend:a,attrs:{dtype:s}});return a.disposeIntermediateTensorInfo(d),c}if(!v.hasEncodingLoss(r.dtype,s)){let d=xA({inputs:{x:r},backend:a});return{dataId:d.dataId,shape:d.shape,dtype:s}}let i=a.data.get(r.dataId).values,[o,l,u]=Kk(i,r.shape,r.dtype,s);return a.makeTensorInfo(o,l,u)}function rn(e,t,a,n){return a==null?({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;Xk([i,o],e);let u=l.data.get(i.dataId).values,d=l.data.get(o.dataId).values,c=i.dtype==="string"?I.fromUint8ToStringArray(u):u,p=i.dtype==="string"?I.fromUint8ToStringArray(d):d,h=n||i.dtype,[m,f]=t(i.shape,o.shape,c,p,h);return l.makeTensorInfo(f,h,m)}:({inputs:r,backend:s})=>{let{a:i,b:o}=r,l=s;if(i.dtype==="complex64"||o.dtype==="complex64"){let u=Dh({inputs:{x:i},backend:l,attrs:{dtype:"complex64"}}),d=l.data.get(u.dataId),c=d.complexTensorInfos.real,p=d.complexTensorInfos.imag,h=l.data.get(c.dataId).values,m=l.data.get(p.dataId).values,f=Dh({inputs:{x:o},backend:l,attrs:{dtype:"complex64"}}),g=l.data.get(f.dataId),y=g.complexTensorInfos.real,x=g.complexTensorInfos.imag,A=l.data.get(y.dataId).values,b=l.data.get(x.dataId).values,[w,S,C]=a(i.shape,o.shape,h,m,A,b),N=l.makeTensorInfo(C,"float32",w),M=l.makeTensorInfo(C,"float32",S),F=iy({inputs:{real:N,imag:M},backend:l});return l.disposeIntermediateTensorInfo(u),l.disposeIntermediateTensorInfo(f),l.disposeIntermediateTensorInfo(N),l.disposeIntermediateTensorInfo(M),F}else{let u=l.data.get(i.dataId).values,d=l.data.get(o.dataId).values,c=n||i.dtype,[p,h]=t(i.shape,o.shape,u,d,c);return l.makeTensorInfo(h,c,p)}}}function oy(e){return(t,a,n,r,s,i)=>{let o=I.assertAndGetBroadcastShape(t,a),l=v.sizeFromShape(o),u=o.length,d=v.computeStrides(o),c=v.getTypedArrayFromDType("float32",l),p=v.getTypedArrayFromDType("float32",l),h=I.getBroadcastDims(t,o),m=I.getBroadcastDims(a,o),f=I.mergeRealAndImagArrays(n,r),g=I.mergeRealAndImagArrays(s,i),y=t.length,x=v.computeStrides(t),A=a.length,b=v.computeStrides(a);if(h.length+m.length===0)for(let w=0;wC[T]=0);let N=v.locToIndex(C,y,x),M=S.slice(-A);m.forEach(T=>M[T]=0);let F=v.locToIndex(M,A,b),E=e(f[N*2],f[N*2+1],g[F*2],g[F*2+1]);c[w]=E.real,p[w]=E.imag}return[c,p,o]}}var Yk=Ua((e,t)=>e+t),ipe=oy((e,t,a,n)=>({real:e+a,imag:t+n})),Wxe=rn(Mr,Yk,ipe);function ope(e,t,a,n,r){let s=v.sizeFromShape(n),i=v.makeZerosTypedArray(r,a);for(let o=0;o=r||(s>0?i[l]+=t[o]:i[l]+=1)}return i}function lpe(e,t,a,n=!1){let r=e.shape[0],s=e.shape[1],i=Te([r,a],t.dtype);for(let o=0;o=a||(n?i.set(1,o,u):t.size>0?i.set(i.get(o,u)+t.get(o,l),o,u):i.set(i.get(o,u)+1,o,u))}return i}var Zk=Ua((e,t)=>e&t),Bxe=rn(ji,Zk);function pr(e){return(t,a,n)=>{let r=v.getArrayFromDType(a,t.length);for(let s=0;s{let{x:i}=n;Xk(i,e);let o=s,l=o.data.get(i.dataId).values,u;if(i.dtype==="string"){if(!Array.isArray(l))throw new Error("String tensor's value was not an instance of Array");u=I.fromUint8ToStringArray(l)}else u=l;let d=a||i.dtype,c=t(u,d,r);return o.makeTensorInfo(i.shape,d,c)}}var Qk=pr(e=>Math.ceil(e)),Vxe=Vs(cs,Qk);function upe(e,t,a,n){let r=v.getArrayFromDType(a,v.sizeFromShape(t));if(n&&a!=="string"){let s=0;e.forEach(i=>{let o=v.sizeFromShape(i.shape);r.set(i.vals,s),s+=o})}else{let s=0;e.forEach(i=>{let o=a==="string"?I.fromUint8ToStringArray(i.vals):i.vals,l=0;for(let u=0;ue===t?1:0),Uxe=rn(ms,e9,null,"bool"),t9=pr(e=>Math.exp(e)),Gxe=Vs(fs,t9,"float32"),a9=pr(e=>Math.expm1(e)),Hxe=Vs(gs,a9),n9=pr(e=>Math.floor(e)),jxe=Vs(ys,n9),r9=Ua((e,t)=>Math.floor(e/t)),qxe=rn(xs,r9,null,"int32");function dpe(e,t,a,n,r,s,i,o,l){let u=Te([n,s],a);for(let d=0;d=l/s)throw new Error(`Invalid indices: ${c} does not index into ${o}`);for(let h=0;he>t?1:0),Xxe=rn(As,s9,null,"bool"),i9=Ua((e,t)=>e>=t?1:0),Kxe=rn(bs,i9,null,"bool"),o9=Ua((e,t)=>ee<=t?1:0),Zxe=rn(ws,l9,null,"bool");function cpe(e,t,a){let n=(t-e)/(a-1),r=v.makeZerosTypedArray(a,"float32");r[0]=e;for(let s=1;sMath.log(e)),Jxe=Vs(ks,u9);function hpe(e,t,a,n){let r=v.getTypedArrayFromDType(n,v.sizeFromShape(a));for(let s=0;so)&&(o=u)}r[s]=o}return r}var d9=Ua((e,t)=>Math.max(e,t)),Qxe=rn(Is,d9),p9=Ua((e,t)=>Math.min(e,t)),e5e=rn(Ss,p9),ly=Ua((e,t)=>e*t),mpe=oy((e,t,a,n)=>({real:e*a-t*n,imag:e*n+t*a})),t5e=rn(Ts,ly,mpe);function fpe(e,t,a){let n=v.createScalarValue(-1,a);return ly([],t,n,e,a)}var c9=Ua((e,t)=>e!==t?1:0),a5e=rn(Cs,c9,null,"bool");function gpe(e,t,a,n,r){let s=t.length,i=v.sizeFromShape(t),o=v.computeStrides(t),l=v.computeStrides(r),u=v.getTypedArrayFromDType(a,v.sizeFromShape(r));for(let d=0;d{if(n<0||n>=a){let s=v.indexToLoc(r,t.length,v.computeStrides(t)).join(",");throw new Error(`indices[${s}] = ${n} is not in [0, ${a})`)}})}function Ape(e,t){for(let a=0;ar)throw new Error("Ragged splits must not point past values");for(let s=1;sn[s])throw new Error("Ragged splits must be sorted in ascending order")}}function bpe(e,t,a,n){let r=[],s=0,i=t.length-1+a.length,o=new Array(i).fill(null).map(()=>[0]);Ape(a,n);let l=1;for(let u=0;u=0){let f=o[m],g=f[f.length-1]-h[d];for(let y=d;yr[i]=s)}return t}function AA(e,t){let a=e.slice(0,t);for(;a.length1)throw new Error("starts must be a scalar or vector");if(r.length>1)throw new Error("limits must be a scalar or vector");if(i.length>1)throw new Error("deltas must be a scalar or vector");let o=t.length===0,l=r.length===0,u=i.length===0,d=[];o||d.push(t[0]),l||d.push(r[0]),u||d.push(i[0]);for(let g=1;g0&&xy)b=0;else if(b=Math.ceil(Math.abs((x-y)/A)),b>bA)throw new Error(`Requires ((limit - start) / delta) <= ${bA}`);p[g+1]=p[g]+b}let h=p[c],m=v.getArrayFromDType(a,h),f=0;for(let g=0;gn&&(n=s)}return n}static getMaxWidthValueRowID(t){let a=t.length;if(a===0)return 0;let n=0,r=t[0],s=0;for(let i=1;i"Final length of result must be equal to firstDimension."),s}calculateOutputIndexRowSplit(t,a,n,r){let s=t.length,i=[];for(let o=0;o0&&i.length!==t[s-1])throw new Error("Invalid row split size.");return i}calculateOutputIndexValueRowID(t,a,n,r){let s=t.length,i=[];if(s===0)return[];let o=0,l=t[0];if(l>=a.length)throw new Error(`Got currentValueRowId=${l}, which is not less than ${a.length}`);let u=a[l];i.push(u);for(let d=1;d=0&&(++o,o=a.length)throw new Error(`Got nextValueRowId=${c} which is not less than ${a.length}`);u=a[c]}i.push(u)}if(i.length!==t.length)throw new Error("Invalid row ids.");return i}calculateOutputIndex(t,a,n,r){let s=this.getRowPartitionTensor(t),i=this.getRowPartitionTypeByDimension(t);switch(i){case Nn.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,a,n,r);case Nn.ROW_SPLITS:if(s.length-1>a.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${a.length}`);return this.calculateOutputIndexRowSplit(s,a,n,r);default:throw new Error(`Unsupported partition type: ${Nn[i]}`)}}getFirstDimensionSize(){let t=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");let a=this.rowPartitionTypes[0];switch(a){case Nn.FIRST_DIM_SIZE:return t[0];case Nn.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case Nn.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${Nn[a]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");let t=this.getFirstDimensionSize(),a=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let i=n.length-2;i>=0;--i)n[i]=n[i+1]*a[i+1];let r=wA(a,!1),s=v.getArrayFromDType(this.valuesDType,v.sizeFromShape(r));if(n[0]*a[0]>0){let i=this.calculateFirstParentOutputIndex(t,n[0],a[0]);for(let o=1;o<=this.raggedRank;++o)i=this.calculateOutputIndex(o-1,i,n[o],a[o]);this.setOutput(this.raggedRank,i,s,r)}return[r,s]}setOutput(t,a,n,r){if(n.length===0)return;let s=this.values,i=n,o=r.slice();o=o.slice(t+1);let l=v.sizeFromShape(o),u=a.length,d=this.defaultValue;if(d.length!==l&&d.length!==1){let m=this.defaultValueShape;Pe(()=>{let f=Q(d,m);d=Ai(f,o).dataSync()})}let c=0,p=0,h=0;for(let m=0;m<=u;++m){let f=m=u){let g=n.length;f=Math.floor(g/l)}if(f>h)if(this.defaultValue.length===1)i.subarray(h*l,f*l).fill(this.defaultValue[0]),h=f;else for(;f>h;){let g=i.slice(h*l);vA(g,d,l),++h}f<0?(c=m+1,p=h):(c=m,p=h,h=p+1)}}};function vA(e,t,a){for(let n=0;n= 0`);if(n<-1)throw new Error(`Dimension ${n} must be >= -1`);n=-1}a.push(n)}return a}function Cpe(e,t,a,n,r,s,i,o,l,u){return new Tpe(e,t,a,n,r,s,i,o,l,u).compute()}function Npe(e,t,a,n){let r=e===t,s=e1;if(r||s||i)return v.makeZerosTypedArray(0,n);let o=Math.abs(Math.ceil((t-e)/a)),l=v.makeZerosTypedArray(o,n);t1/Math.sqrt(e)),n5e=Vs(Ns,h9);function Rpe(e,t,a,n,r,s,i,o,l,u){let d=[n/r,r],c=e.values,p=t.values;if(n===0)return Te(a,t.dtype);let h=l instanceof Rt?l:Te(d,t.dtype);typeof l=="string"||typeof l=="number"?h.values.fill(l):typeof l=="boolean"&&h.values.fill(+l);for(let m=0;m=n/r)throw new Error(`Invalid indices: ${f} does not index into ${a}`);for(let y=0;y1/(1+Math.exp(-e))),r5e=Jk(Rs,e=>1/(1+Math.exp(-e)));function Mpe(e,t,a,n,r){let s=wt.isSliceContinous(n,t,a),i=v.sizeFromShape(a),o=v.computeStrides(n);if(s){let c=wt.computeFlatOffset(t,o);return r==="string"?e.slice(c,c+i):e.subarray(c,c+i)}let l=r==="string"?I.fromUint8ToStringArray(e):e,u=Te(n,r,l),d=Te(a,r);for(let c=0;cm+t[f]);d.set(u.get(...h),...p)}return r==="string"?I.fromStringArrayToUint8(d.values):d.values}function Fpe(e,t,a,n,r,s,i){let o=t[0],l=s[0],u=new Array(l),d=new Array(o),c=t[1];if(l===0){if(o!==0)throw new Error(I.getSparseFillEmptyRowsIndicesDenseShapeMismatch(o));let g=v.getArrayFromDType(a,0),y=v.getArrayFromDType(r,0);return[g,[0,c],y,u,d]}let p=!0,h=0,m=new Array(l).fill(0);for(let g=0;g=l)throw new Error(I.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,y,l));++m[y],p=p&&y>=h,h=y}let f=!0;for(let g=0;g0&&(m[g]+=m[g-1])}if(f&&p){let g=e,y=n;for(let x=0;x0){p[c-1]=1;for(let f=c-2;f>=0;--f)p[f]=p[f+1]*n[f+1]}let h=[];if(o>0){h[o-1]=1;for(let f=o-2;f>=0;--f)h[f]=h[f+1]*l[f+1]}let m=v.getArrayFromDType(a,i*o);for(let f=0;f0?r[o-1]+1:0;if(d<0)throw new Error(I.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let c=t.slice();c[0]=d;let p=c.reduce((x,A)=>x*A,1),h=v.getArrayFromDType(a,p);if(o===0)return d>0&&h.fill(i),[h,c];if(d<=0)throw new Error(I.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=0,f=1,g=0,y=r[m];for(;;){let x=0;if(f=x)throw new Error(I.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(y<0||y>=d)throw new Error(I.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(y,d));y>g&&h.fill(i,g*u,y*u);for(let A=m;A=l[0])throw new Error(I.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(A,n[A],l[0]));for(let w=0;wo)break}return gMath.sqrt(e)),s5e=Jk(Es,e=>Math.sqrt(e)),m9=Ua((e,t)=>{let a=e-t;return a*a}),i5e=rn(Ms,m9),f9=pr((e,t)=>{let{pattern:a,replaceGlobal:n,rewrite:r}=t;return e.replace(new RegExp(a,n?"g":""),r)}),o5e=Vs(Gu,f9);function _pe(e,t,a,n){let r=Te(e,t.dtype);for(let s=0;s0?0:i-o),p=0;p+=l*this.leftPad.length;for(let y=0;yy.forEach(x=>m[f++]=x);for(let y=0;y0){g(e[c+d-1]);for(let y=0;y0){let o=t[0];if(o!==0)throw new Error(`First split value must be 0, got ${o}`);for(let l=1;l=o;if(u=u&&t[l]<=a,!u)throw new Error(`Invalid split value ${t[l]}, must be in [${o}, ${a}]`);o=t[l]}if(o!==a)throw new Error(`Last split value must be data size. Expected ${a}, got ${o}`)}let r=n-1,s=v.getArrayFromDType("int32",n);if(a===0||n===0){let o=new Array(a);for(let l=0;l<=r;++l)s[l]=0;return[o,s]}s[0]=0;for(let o=1;o<=r;++o){let l=t[o]-t[o-1],u=0;this.nGramWidths.forEach(d=>{u+=this.getNumNGrams(l,d)}),this.preserveShort&&l>0&&u===0&&(u=1),s[o]=s[o-1]+u}let i=new Array(s[r]);for(let o=0;o{let c=t[o+1]-t[o],p=this.getNumNGrams(c,d);this.createNGrams(e,l,i,u,p,d),u+=p}),this.preserveShort&&u===s[o]){let d=t[o+1]-t[o];if(d===0)continue;let c=d+2*this.padWidth;this.createNGrams(e,l,i,u,1,c)}}return[i,s]}};function zpe(e,t,a,n,r,s,i,o){return new Ope(a,n,r,s,i,o).compute(e,t)}function Lpe(e,t,a,n){if(!e.length)return;if(t.length===0){for(let s=0;se-t),Vpe=oy((e,t,a,n)=>({real:e-a,imag:t-n})),l5e=rn(Fs,g9,Vpe);function Upe(e,t){let a=new Array(e.rank);for(let r=0;r{let a=t.value-e.value;return a===0?e.index-t.index:a};function y9(e,t,a=0,n=e.length-1){for(;n>a;){if(n-a>600){let o=n-a+1,l=t-a+1,u=Math.log(o),d=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*d*(o-d)/o)*Math.sign(l-o/2),p=Math.max(a,Math.floor(t-l*d/o+c)),h=Math.min(n,Math.floor(t+(o-l)*d/o+c));y9(e,t,p,h)}let r=e[t],s=a,i=n;for(v.swap(e,a,t),Ld(e[n],r)>0&&v.swap(e,a,n);s0;)i=i-1}Ld(e[a],r)===0?v.swap(e,a,i):(i=i+1,v.swap(e,i,n)),i<=t&&(a=i+1),t<=i&&(n=i-1)}}function Gpe(e,t,a,n,r){let s=t[t.length-1],[i,o]=[e.length/s,s],l=v.getTypedArrayFromDType(a,i*n),u=v.getTypedArrayFromDType("int32",i*n);for(let c=0;cm[A]={value:x,index:A}),n{for(let g=0;g`T${a}`),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="addN"}getUserCode(){let e=[];this.variableNames.forEach(a=>{e.push(`let v${a} = get${a}ByOutputCoords(coords);`)});let t=this.variableNames.map(a=>`v${a}`).join(" + ");return` ${ue("index")} { for (var i = 0; i < ${this.workPerThread}; i = i + 1) { let flatIndex = index * ${this.workPerThread} + i; @@ -5926,7 +5926,7 @@ return a / b;`,vJ=` } } } - `}};function Qde(e){let{inputs:t,backend:a}=e,n=t;if(n.length===1)return en({inputs:{x:n[0]},backend:a});let r=n.map(o=>o.dtype).reduce((o,l)=>da(o,l)),s=n.map(o=>o.shape),i=new Jde(s);return a.runWebGPUProgram(i,n,r)}var epe={kernelName:oi,backendName:"webgpu",kernelFunc:Qde},tpe=class{constructor(e,t){this.variableNames=["A"],this.workgroupSize=[16,16,1];let a=new Array(e.length);for(let n=0;n`Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`);let e=this.workgroupSize[0];return` + `}};function Pce(e){let{inputs:t,backend:a}=e,n=t;if(n.length===1)return an({inputs:{x:n[0]},backend:a});let r=n.map(o=>o.dtype).reduce((o,l)=>Qt(o,l)),s=n.map(o=>o.shape),i=new Dce(s);return a.runWebGPUProgram(i,n,r)}var _ce={kernelName:Pi,backendName:"webgpu",kernelFunc:Pce},Oce=class{constructor(e,t){this.variableNames=["A"],this.workgroupSize=[16,16,1];let a=new Array(e.length);for(let n=0;n`Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`);let e=this.workgroupSize[0];return` var tile : array, ${this.workgroupSize[0]}>; ${ue()} { var x = i32(workgroupId.x) * ${e} + i32(localId.x); @@ -5945,7 +5945,7 @@ return a / b;`,vJ=` [localId.y]); } } - `}},ape=class{constructor(e,t){this.variableNames=["A"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0;let a=new Array(e.length);for(let n=0;n6)throw Error(`Transpose for rank ${t} is not yet supported`);let a=new Array(t);for(let n=0;n=32768&&a>=512?this.workgroupSize=[512,1,1]:e.inSize>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,[1,1,1]),this.reduceType=t,this.shaderKey=`reduce_${t}`}getUserCode(){let e="",t="0.0",a=this.workgroupSize[0];this.reduceType==="min"||this.reduceType==="max"?(e=` + `}};function x9(e){let t=e.length;if(t>6)throw Error(`Transpose for rank ${t} is not yet supported`);let a=new Array(t);for(let n=0;n=32768&&a>=512?this.workgroupSize=[512,1,1]:e.inSize>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,[1,1,1]),this.reduceType=t,this.shaderKey=`reduce_${t}`}getUserCode(){let e="",t="0.0",a=this.workgroupSize[0];this.reduceType==="min"||this.reduceType==="max"?(e=` if (isnan(candidate)) { bestValue = uniforms.NAN; } else if (!isnan(bestValue) && candidate ${this.reduceType==="min"?"<":">"} bestValue) @@ -6004,7 +6004,7 @@ return a / b;`,vJ=` ${n} } } - `}},spe={mean:"float32",all:"bool",any:"bool"};function ol(e,t,a,n,r){let s=e.shape.length,i=[],o=v.parseAxisParam(t,e.shape),l=o,u=C.getAxesPermutation(l,s),p=e;u!=null&&(p=ar({inputs:{x:e},attrs:{perm:u},backend:r}),l=C.getInnerMostAxes(l.length,s),i.push(p)),C.assertAxesAreInnerMostDims(n,l,s);let[c,d]=C.computeOutAndReduceShapes(p.shape,l),h=c;a&&(h=C.expandShapeToKeepDim(c,o));let m;if((n==="max"||n==="prod")&&r.shouldExecuteOnCPU([p])){let f=r.tensorMap.get(p.dataId).values;switch(n){case"max":let g=Cde(f,v.sizeFromShape(d),h,e.dtype);m=r.makeTensorInfo(h,e.dtype,g);break;case"prod":let{outVals:y,outShape:x,outDtype:A}=Pde(p.shape,p.dtype,f,l);m=r.makeTensorInfo(x,A,y);break;default:throw new Error(`${n} CPU implementation is not yet supported.`)}}else{let f=v.sizeFromShape(d),g=v.sizeFromShape(p.shape)/f,y={windowSize:f,inSize:f,batchSize:g,outSize:1},x=spe[n]||Mp(e.dtype),A=[{type:"int32",data:[f]}],b=new rpe(y,n,r.device.limits.maxComputeWorkgroupSizeX),w=r.runWebGPUProgram(b,[p],x,A);i.push(w),m=ke({inputs:{x:w},attrs:{shape:h},backend:r})}return i.forEach(f=>r.disposeData(f.dataId)),m}function ipe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{keepDims:s,axis:i}=n;return ol(r,i,s,"all",a)}var ope={kernelName:li,backendName:"webgpu",kernelFunc:ipe};function lpe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{keepDims:s,axis:i}=n;return ol(r,i,s,"any",a)}var upe={kernelName:ui,backendName:"webgpu",kernelFunc:lpe},Nk=class{constructor(e,t,a){this.workgroupSize=[64,1,1],this.variableNames=["x"],this.uniforms="infinityValue : f32,",this.size=!0;let n=[t];this.op=a==="min"?"<":">";let[r,s]=C.computeOutAndReduceShapes(e,n);this.outputShape=r.length===0?[1]:r,this.dispatchLayout=me(this.outputShape),v.sizeFromShape(s)<32?(this.type="plain",this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize)):(this.type="shared",this.dispatch=de(this.dispatchLayout,this.outputShape,[1,1,1])),this.inputShape=e,this.shaderKey=`argMinMax_${this.op}_${this.type}`}getUserCode(){let e=this.workgroupSize[0],t=()=>this.inputShape.length===1?"uniforms.xShape":`uniforms.xShape.${Ir(this.inputShape.length-1)}`,a=()=>{let n="";if(this.outputShape.length===1)this.inputShape.length!==1&&(n+="outputCoords,");else for(let r=0;rr.disposeData(f.dataId)),m}function Vce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{keepDims:s,axis:i}=n;return gl(r,i,s,"all",a)}var Uce={kernelName:_i,backendName:"webgpu",kernelFunc:Vce};function Gce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{keepDims:s,axis:i}=n;return gl(r,i,s,"any",a)}var Hce={kernelName:Oi,backendName:"webgpu",kernelFunc:Gce},A9=class{constructor(e,t,a){this.workgroupSize=[64,1,1],this.variableNames=["x"],this.uniforms="infinityValue : f32,",this.size=!0;let n=[t];this.op=a==="min"?"<":">";let[r,s]=I.computeOutAndReduceShapes(e,n);this.outputShape=r.length===0?[1]:r,this.dispatchLayout=me(this.outputShape),v.sizeFromShape(s)<32?(this.type="plain",this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize)):(this.type="shared",this.dispatch=de(this.dispatchLayout,this.outputShape,[1,1,1])),this.inputShape=e,this.shaderKey=`argMinMax_${this.op}_${this.type}`}getUserCode(){let e=this.workgroupSize[0],t=()=>this.inputShape.length===1?"uniforms.xShape":`uniforms.xShape.${Nr(this.inputShape.length-1)}`,a=()=>{let n="";if(this.outputShape.length===1)this.inputShape.length!==1&&(n+="outputCoords,");else for(let r=0;r u32 { return ((a - 1u) / b + 1u); } @@ -6070,7 +6070,7 @@ return a / b;`,vJ=` setOutputAtIndexI32(index, bestIndex); } } - `}};function dpe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=ar({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let p=new Nk(l.shape,i[0],"max"),c=[{type:"float32",data:[Number.NEGATIVE_INFINITY]}],d=a.runWebGPUProgram(p,[l],"int32",c);return u.forEach(h=>a.disposeData(h.dataId)),d}var ppe={kernelName:su,backendName:"webgpu",kernelFunc:dpe};function cpe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=C.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=ar({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=C.getInnerMostAxes(i.length,l.shape.length)),C.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let p=new Nk(l.shape,i[0],"min"),c=[{type:"float32",data:[Number.POSITIVE_INFINITY]}],d=a.runWebGPUProgram(p,[l],"int32",c);return u.forEach(h=>a.disposeData(h.dataId)),d}var hpe={kernelName:iu,backendName:"webgpu",kernelFunc:cpe},mpe=at({opType:le.ASIN}),fpe={kernelName:di,backendName:"webgpu",kernelFunc:mpe},gpe=at({opType:le.ASINH}),ype={kernelName:pi,backendName:"webgpu",kernelFunc:gpe},xpe=at({opType:le.ATAN}),Ape={kernelName:ci,backendName:"webgpu",kernelFunc:xpe},bpe=ea({opType:_e.ATAN2}),vpe={kernelName:mi,backendName:"webgpu",kernelFunc:bpe},wpe=at({opType:le.ATANH}),kpe={kernelName:hi,backendName:"webgpu",kernelFunc:wpe},Ipe=class{constructor(e){this.variableNames=["x"],this.uniforms="strides : vec2,",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="poolWithFilterSizeEqualsOne"}getUserCode(){return` + `}};function jce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=I.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=ir({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=I.getInnerMostAxes(i.length,l.shape.length)),I.assertAxesAreInnerMostDims("argMax",[i[0]],l.shape.length);let d=new A9(l.shape,i[0],"max"),c=[{type:"float32",data:[Number.NEGATIVE_INFINITY]}],p=a.runWebGPUProgram(d,[l],"int32",c);return u.forEach(h=>a.disposeData(h.dataId)),p}var qce={kernelName:hu,backendName:"webgpu",kernelFunc:jce};function Xce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s}=n,i=v.parseAxisParam(s,r.shape),o=I.getAxesPermutation(i,r.shape.length),l=r,u=[];o!=null&&(l=ir({inputs:{x:r},backend:a,attrs:{perm:o}}),u.push(l),i=I.getInnerMostAxes(i.length,l.shape.length)),I.assertAxesAreInnerMostDims("argMin",[i[0]],l.shape.length);let d=new A9(l.shape,i[0],"min"),c=[{type:"float32",data:[Number.POSITIVE_INFINITY]}],p=a.runWebGPUProgram(d,[l],"int32",c);return u.forEach(h=>a.disposeData(h.dataId)),p}var Kce={kernelName:mu,backendName:"webgpu",kernelFunc:Xce},Yce=at({opType:le.ASIN}),Zce={kernelName:zi,backendName:"webgpu",kernelFunc:Yce},Jce=at({opType:le.ASINH}),Qce={kernelName:Li,backendName:"webgpu",kernelFunc:Jce},ehe=at({opType:le.ATAN}),the={kernelName:Wi,backendName:"webgpu",kernelFunc:ehe},ahe=aa({opType:De.ATAN2}),nhe={kernelName:Vi,backendName:"webgpu",kernelFunc:ahe},rhe=at({opType:le.ATANH}),she={kernelName:Bi,backendName:"webgpu",kernelFunc:rhe},ihe=class{constructor(e){this.variableNames=["x"],this.uniforms="strides : vec2,",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="poolWithFilterSizeEqualsOne"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6085,7 +6085,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, value); } } - `}},ap=class{constructor(e,t,a=!1,n=!1,r=!1){if(this.variableNames=["x"],this.uniforms="strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,",this.workgroupSize=[128,1,1],this.size=!0,t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=a,this.flattenPositions=n,this.includeBatchIndex=r,this.shaderKey=`pool2D_${t}_${a}_${n}_${r}`}getUserCode(){let e;this.poolType==="avg"?e="resultValue = resultValue + value; count = count + 1.0;":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound); + `}},pp=class{constructor(e,t,a=!1,n=!1,r=!1){if(this.variableNames=["x"],this.uniforms="strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,",this.workgroupSize=[128,1,1],this.size=!0,t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=a,this.flattenPositions=n,this.includeBatchIndex=r,this.shaderKey=`pool2D_${t}_${a}_${n}_${r}`}getUserCode(){let e;this.poolType==="avg"?e="resultValue = resultValue + value; count = count + 1.0;":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound); if (value >= currMaxValue) { maxValue = value; maxValueFound = 1.0; @@ -6126,7 +6126,7 @@ return a / b;`,vJ=` ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${t});`} } } - `}},Y3=class{constructor(e,t,a=!1,n=!1,r=!1){if(this.variableNames=["x"],this.uniforms="strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,",this.workgroupSize=[128,1,1],this.size=!0,t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=a,this.flattenPositions=n,this.includeBatchIndex=r,this.shaderKey=`pool3D_${t}_${a}_${n}_${r}`}getUserCode(){let e;this.poolType==="avg"?e="resultValue += value; count += 1.0;":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound); + `}},uy=class{constructor(e,t,a=!1,n=!1,r=!1){if(this.variableNames=["x"],this.uniforms="strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,",this.workgroupSize=[128,1,1],this.size=!0,t==="avg"&&a)throw new Error("Cannot compute positions for average pool.");this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=a,this.flattenPositions=n,this.includeBatchIndex=r,this.shaderKey=`pool3D_${t}_${a}_${n}_${r}`}getUserCode(){let e;this.poolType==="avg"?e="resultValue += value; count += 1.0;":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound); if (value >= currMaxValue) { maxValue = value; maxValueFound = 1.0; @@ -6175,7 +6175,7 @@ return a / b;`,vJ=` ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${t});`} } } - `}};function Rk(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=n;return ol(r,s,i,"max",a)}var Spe={kernelName:so,backendName:"webgpu",kernelFunc:Rk};function Ek(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{keepDims:s,axis:i}=n;return ol(r,i,s,"mean",a)}var Cpe={kernelName:lo,backendName:"webgpu",kernelFunc:Ek};function Mk(e,t,a,n){if(t.filterWidth===1&&t.filterHeight===1&&v.arraysEqual(t.inShape,t.outShape))return en({inputs:{x:e},backend:n});if(t.filterWidth===t.inWidth&&t.filterHeight===t.inHeight&&t.batchSize===1&&t.padInfo.type==="VALID"){let i=e.shape.length,o=ke({inputs:{x:e},backend:n,attrs:{shape:[e.shape[i-3]*e.shape[i-2],e.shape[i-1]]}}),l;a==="avg"?l=Ek({inputs:{x:o},backend:n,attrs:{axis:0,keepDims:!1}}):(v.assert(a==="max",()=>`Invalid pool type ${a}`),l=Rk({inputs:{x:o},backend:n,attrs:{reductionIndices:0,keepDims:!1}}));let u=ke({inputs:{x:l},backend:n,attrs:{shape:t.outShape}});return n.disposeData(o.dataId),n.disposeData(l.dataId),u}let r,s=[{type:"int32",data:[t.strideHeight,t.strideWidth]}];return t.filterHeight===1&&t.filterWidth===1?r=new Ipe(t):(a==="avg"?r=new ap(t,"avg"):(v.assert(a==="max",()=>`Invalid pool type ${a}`),r=new ap(t,"max")),s.push({type:"int32",data:[t.padInfo.top,t.padInfo.left]},{type:"int32",data:[t.dilationHeight,t.dilationWidth]},{type:"int32",data:[t.inHeight,t.inWidth]},{type:"int32",data:[t.effectiveFilterHeight,t.effectiveFilterWidth]})),n.runWebGPUProgram(r,[e],e.dtype,s)}function Tpe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=1,p=C.computePool2DInfo(r.shape,s,i,u,o,l);return Mk(r,p,"avg",a)}var Npe={kernelName:fi,backendName:"webgpu",kernelFunc:Tpe};function Rpe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=n,p=[1,1,1],c=C.computePool3DInfo(r.shape,s,i,p,o,u,l),d=new Y3(c,"avg"),h=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.inDepth,c.inHeight,c.inWidth]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return a.runWebGPUProgram(d,[r],r.dtype,h)}var Epe={kernelName:ou,backendName:"webgpu",kernelFunc:Rpe},Mpe=class{constructor(e){this.variableNames=["dy"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, + `}};function b9(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{reductionIndices:s,keepDims:i}=n;return gl(r,s,i,"max",a)}var ohe={kernelName:Io,backendName:"webgpu",kernelFunc:b9};function v9(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{keepDims:s,axis:i}=n;return gl(r,i,s,"mean",a)}var lhe={kernelName:To,backendName:"webgpu",kernelFunc:v9};function w9(e,t,a,n){if(t.filterWidth===1&&t.filterHeight===1&&v.arraysEqual(t.inShape,t.outShape))return an({inputs:{x:e},backend:n});if(t.filterWidth===t.inWidth&&t.filterHeight===t.inHeight&&t.batchSize===1&&t.padInfo.type==="VALID"){let i=e.shape.length,o=ke({inputs:{x:e},backend:n,attrs:{shape:[e.shape[i-3]*e.shape[i-2],e.shape[i-1]]}}),l;a==="avg"?l=v9({inputs:{x:o},backend:n,attrs:{axis:0,keepDims:!1}}):(v.assert(a==="max",()=>`Invalid pool type ${a}`),l=b9({inputs:{x:o},backend:n,attrs:{reductionIndices:0,keepDims:!1}}));let u=ke({inputs:{x:l},backend:n,attrs:{shape:t.outShape}});return n.disposeData(o.dataId),n.disposeData(l.dataId),u}let r,s=[{type:"int32",data:[t.strideHeight,t.strideWidth]}];return t.filterHeight===1&&t.filterWidth===1?r=new ihe(t):(a==="avg"?r=new pp(t,"avg"):(v.assert(a==="max",()=>`Invalid pool type ${a}`),r=new pp(t,"max")),s.push({type:"int32",data:[t.padInfo.top,t.padInfo.left]},{type:"int32",data:[t.dilationHeight,t.dilationWidth]},{type:"int32",data:[t.inHeight,t.inWidth]},{type:"int32",data:[t.effectiveFilterHeight,t.effectiveFilterWidth]})),n.runWebGPUProgram(r,[e],e.dtype,s)}function uhe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=I.computePool2DInfo(r.shape,s,i,1,o,l);return w9(r,u,"avg",a)}var dhe={kernelName:Ui,backendName:"webgpu",kernelFunc:uhe};function phe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=n,d=[1,1,1],c=I.computePool3DInfo(r.shape,s,i,d,o,u,l),p=new uy(c,"avg"),h=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.inDepth,c.inHeight,c.inWidth]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return a.runWebGPUProgram(p,[r],r.dtype,h)}var che={kernelName:fu,backendName:"webgpu",kernelFunc:phe},hhe=class{constructor(e){this.variableNames=["dy"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool2DBackprop"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -6214,7 +6214,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}},Ppe=class{constructor(e){this.variableNames=["dy"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, + `}},mhe=class{constructor(e){this.variableNames=["dy"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool3DBackprop"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -6263,7 +6263,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}};function _pe(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:p}=n,c=C.computePool3DInfo(i.shape,o,l,1,u,p),d=new Ppe(c),h=1/(c.filterDepth*c.filterHeight*c.filterWidth),m=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.effectiveFilterDepth-1-c.padInfo.front,c.effectiveFilterHeight-1-c.padInfo.top,c.effectiveFilterWidth-1-c.padInfo.left]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]},{type:"int32",data:[c.outDepth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"float32",data:[h]}];return a.runWebGPUProgram(d,[r],i.dtype,m)}var $pe={kernelName:lp,backendName:"webgpu",kernelFunc:_pe};function Fpe(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s;j3([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=n,p=C.computePool2DInfo(i.shape,o,l,1,u),c=new Mpe(p),d=1/(p.filterHeight*p.filterWidth),h=[{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.effectiveFilterHeight-1-p.padInfo.top,p.effectiveFilterWidth-1-p.padInfo.left]},{type:"int32",data:[p.dilationHeight,p.dilationWidth]},{type:"int32",data:[p.effectiveFilterHeight,p.effectiveFilterWidth]},{type:"int32",data:[p.outHeight]},{type:"int32",data:[p.outWidth]},{type:"float32",data:[d]}];return a.runWebGPUProgram(c,[r],i.dtype,h)}var Dpe={kernelName:op,backendName:"webgpu",kernelFunc:Fpe};function Ope(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;return p0({a:r,b:s,transposeA:i,transposeB:o,backend:a})}var zpe={kernelName:gi,backendName:"webgpu",kernelFunc:Ope},Lpe=class{constructor(e,t){this.variableNames=["source"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.rank=t.length,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.start=e,this.uniforms=`start : ${_t(e.length)}, `,this.shaderKey="slice"}getUserCode(){let e=_t(this.rank),t=Wpe(this.rank),a;return this.start.length===1?a=this.outputShape.map((n,r)=>"sourceLoc = uniforms.start + coords;"):a=this.outputShape.map((n,r)=>`sourceLoc.${q1[r]} = uniforms.start.${Ir(r)} + coords.${q1[r]};`),` + `}};function fhe(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:d}=n,c=I.computePool3DInfo(i.shape,o,l,1,u,d),p=new mhe(c),h=1/(c.filterDepth*c.filterHeight*c.filterWidth),m=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.effectiveFilterDepth-1-c.padInfo.front,c.effectiveFilterHeight-1-c.padInfo.top,c.effectiveFilterWidth-1-c.padInfo.left]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]},{type:"int32",data:[c.outDepth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"float32",data:[h]}];return a.runWebGPUProgram(p,[r],i.dtype,m)}var ghe={kernelName:yp,backendName:"webgpu",kernelFunc:fhe};function yhe(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s;ay([r,s],"avgPoolGrad");let{filterSize:o,strides:l,pad:u}=n,d=I.computePool2DInfo(i.shape,o,l,1,u),c=new hhe(d),p=1/(d.filterHeight*d.filterWidth),h=[{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.effectiveFilterHeight-1-d.padInfo.top,d.effectiveFilterWidth-1-d.padInfo.left]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]},{type:"int32",data:[d.effectiveFilterHeight,d.effectiveFilterWidth]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]},{type:"float32",data:[p]}];return a.runWebGPUProgram(c,[r],i.dtype,h)}var xhe={kernelName:gp,backendName:"webgpu",kernelFunc:yhe};function Ahe(e){let{inputs:t,backend:a,attrs:n}=e,{a:r,b:s}=t,{transposeA:i,transposeB:o}=n;return x0({a:r,b:s,transposeA:i,transposeB:o,backend:a})}var bhe={kernelName:Gi,backendName:"webgpu",kernelFunc:Ahe},vhe=class{constructor(e,t){this.variableNames=["source"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.rank=t.length,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.start=e,this.uniforms=`start : ${Dt(e.length)}, `,this.shaderKey="slice"}getUserCode(){let e=Dt(this.rank),t=whe(this.rank),a;return this.start.length===1?a=this.outputShape.map((n,r)=>"sourceLoc = uniforms.start + coords;"):a=this.outputShape.map((n,r)=>`sourceLoc.${ag[r]} = uniforms.start.${Nr(r)} + coords.${ag[r]};`),` ${ue("index")} { if (index < uniforms.size) { var sourceLoc : ${e}; @@ -6273,16 +6273,16 @@ return a / b;`,vJ=` setOutputAtIndex(index, getSource(${t})); } } - `}},q1=["x","y","z","w","u","v"];function Wpe(e){if(e===1)return"sourceLoc";if(e<=6)return q1.slice(0,e).map(t=>`sourceLoc.${t}`).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}function Qu(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,size:i}=n,[o,l]=Nt.parseSliceParams(r,s,i);if(Nt.assertParamsValid(r,o,l),a.shouldExecuteOnCPU([r])||r.dtype==="string"){let c=a.tensorMap.get(r.dataId),d=Ode(c.values,o,l,r.shape,r.dtype);return a.makeTensorInfo(l,r.dtype,d)}if(v.sizeFromShape(l)===0)return a.makeTensorInfo(l,r.dtype,[]);let u=new Lpe(o,l),p=[{type:"int32",data:o}];return a.runWebGPUProgram(u,[r],r.dtype,p)}var Bpe={kernelName:Mu,backendName:"webgpu",kernelFunc:Qu},Vpe=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,crops:i}=n;v.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet");let o=s.reduce((x,A)=>x*A),l=C.getReshaped(r.shape,s,o),u=C.getPermuted(l.length,s.length),p=C.getReshapedPermuted(r.shape,s,o),c=C.getSliceBeginCoords(i,s.length),d=C.getSliceSize(p,i,s.length),h=[],m=ke({inputs:{x:r},backend:a,attrs:{shape:l}}),f=ar({inputs:{x:m},backend:a,attrs:{perm:u}}),g=ke({inputs:{x:f},backend:a,attrs:{shape:p}}),y=Qu({inputs:{x:g},backend:a,attrs:{begin:c,size:d}});return h.push(m),h.push(f),h.push(g),h.forEach(x=>a.disposeData(x.dataId)),y},Upe={kernelName:lu,backendName:"webgpu",kernelFunc:Vpe},Gpe=` + `}},ag=["x","y","z","w","u","v"];function whe(e){if(e===1)return"sourceLoc";if(e<=6)return ag.slice(0,e).map(t=>`sourceLoc.${t}`).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}function od(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,size:i}=n,[o,l]=wt.parseSliceParams(r,s,i);if(wt.assertParamsValid(r,o,l),a.shouldExecuteOnCPU([r])||r.dtype==="string"){let c=a.tensorMap.get(r.dataId),p=Ace(c.values,o,l,r.shape,r.dtype);return a.makeTensorInfo(l,r.dtype,p)}if(v.sizeFromShape(l)===0)return a.makeTensorInfo(l,r.dtype,[]);let u=new vhe(o,l),d=[{type:"int32",data:o}];return a.runWebGPUProgram(u,[r],r.dtype,d)}var khe={kernelName:zu,backendName:"webgpu",kernelFunc:od},Ihe=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,crops:i}=n;v.assert(r.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet");let o=s.reduce((x,A)=>x*A),l=I.getReshaped(r.shape,s,o),u=I.getPermuted(l.length,s.length),d=I.getReshapedPermuted(r.shape,s,o),c=I.getSliceBeginCoords(i,s.length),p=I.getSliceSize(d,i,s.length),h=[],m=ke({inputs:{x:r},backend:a,attrs:{shape:l}}),f=ir({inputs:{x:m},backend:a,attrs:{perm:u}}),g=ke({inputs:{x:f},backend:a,attrs:{shape:d}}),y=od({inputs:{x:g},backend:a,attrs:{begin:c,size:p}});return h.push(m),h.push(f),h.push(g),h.forEach(x=>a.disposeData(x.dataId)),y},She={kernelName:gu,backendName:"webgpu",kernelFunc:Ihe},The=` fn bincount_write(index: i32, value: f32) { - ${gs("&result[index]","value","float32")} + ${Bs("&result[index]","value","float32")} } -`,Hpe=` +`,Che=` fn bincount_write(index: i32, value: f32) { atomicStore(&result[index], bitcast(value)); } -`,Pk=class{constructor(e,t,a=!1){this.outputShape=[],this.variableNames=["x"],this.uniforms="binCountSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.hasWeights=!0,this.binaryOutput=!1,this.outputShape=e,this.rank=e.length,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.binaryOutput=a,a&&(this.atomic=!1),this.hasWeights=t,this.hasWeights&&this.variableNames.push("w"),this.shaderKey=`bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`}getUserCode(){return` - ${this.binaryOutput?Hpe:Gpe} +`,k9=class{constructor(e,t,a=!1){this.outputShape=[],this.variableNames=["x"],this.uniforms="binCountSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.hasWeights=!0,this.binaryOutput=!1,this.outputShape=e,this.rank=e.length,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.binaryOutput=a,a&&(this.atomic=!1),this.hasWeights=t,this.hasWeights&&this.variableNames.push("w"),this.shaderKey=`bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`}getUserCode(){return` + ${this.binaryOutput?Che:The} ${ue("index")} { ${this.rank===1?`if (index < uniforms.xShape) { let indexVal = i32(getX(index)); @@ -6299,7 +6299,7 @@ return a / b;`,vJ=` } }`} } - `}};function jpe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i}=n,o=v.sizeFromShape(r.shape),l=v.sizeFromShape(s.shape)>0,u=[i],p=s.dtype,c=Wa({backend:a,attrs:{shape:u,value:0,dtype:p}}),d=new Pk([o],l),h=[{type:"int32",data:[i]}],m=l?[r,s]:[r];return a.runWebGPUProgram(d,m,p,h,c)}var qpe={kernelName:yi,backendName:"webgpu",kernelFunc:jpe},Xpe=class{constructor(e){this.outputShape=[],this.variableNames=["s0","s1"],this.uniforms="s0Size : i32, s1Size : i32, ",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="broadcastArgs"}getUserCode(){return` + `}};function Nhe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i}=n,o=v.sizeFromShape(r.shape),l=v.sizeFromShape(s.shape)>0,u=[i],d=s.dtype,c=Wa({backend:a,attrs:{shape:u,value:0,dtype:d}}),p=new k9([o],l),h=[{type:"int32",data:[i]}],m=l?[r,s]:[r];return a.runWebGPUProgram(p,m,d,h,c)}var Rhe={kernelName:Hi,backendName:"webgpu",kernelFunc:Nhe},Ehe=class{constructor(e){this.outputShape=[],this.variableNames=["s0","s1"],this.uniforms="s0Size : i32, s1Size : i32, ",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="broadcastArgs"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { var s0 = 1.0; @@ -6324,7 +6324,7 @@ return a / b;`,vJ=` } } } - `}};function Kpe(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t;if(a.shouldExecuteOnCPU([n,r])){let p=a.tensorMap.get(n.dataId),c=a.tensorMap.get(r.dataId),d=p.values,h=c.values,m=C.assertAndGetBroadcastShape(Array.from(d),Array.from(h));return a.makeTensorInfo([m.length],"int32",Int32Array.from(m))}let s=v.sizeFromShape(n.shape),i=v.sizeFromShape(r.shape),o=Math.max(s,i),l=new Xpe(o),u=[{type:"int32",data:[s]},{type:"int32",data:[i]}];return a.runWebGPUProgram(l,[n,r],"int32",u)}var Ype={kernelName:du,backendName:"webgpu",kernelFunc:Kpe},_k=ea({opType:_e.NOT_EQUAL,dtype:"bool",cpuKernelImpl:Mde}),Zpe={kernelName:go,backendName:"webgpu",kernelFunc:_k};function Qp(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.tensorMap.get(n.dataId);return en({inputs:{x:r.complexTensorInfos.real},backend:a})}var Jpe={kernelName:vp,backendName:"webgpu",kernelFunc:Qp};function Qpe(e,t){let a=new Ju(e.shape,le.TO_INT),n=t.runWebGPUProgram(a,[e],"int32");return{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}function X1(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dtype:s}=n;if(s==="complex64"){if(r.dtype==="complex64")return en({inputs:{x:r},backend:a});let i=gn(r.shape),o=X1({inputs:{x:r},backend:a,attrs:{dtype:"float32"}}),l=il({inputs:{real:o,imag:i},backend:a});return i.dispose(),a.disposeData(o.dataId),l}if(r.dtype==="complex64"){let i=Qp({inputs:{input:r},backend:a}),o=X1({inputs:{x:i},backend:a,attrs:{dtype:s}});return a.disposeData(i.dataId),o}if(!v.hasEncodingLoss(r.dtype,s)){let i=en({inputs:{x:r},backend:a});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(a.shouldExecuteOnCPU([r])){let i=a.tensorMap.get(r.dataId).values,[o,l,u]=pde(i,r.shape,r.dtype,s);return a.makeTensorInfo(o,l,u)}if(s==="int32")return Qpe(r,a);if(s==="bool"){let i=a.makeTensorInfo([],"bool",v.getTypedArrayFromDType("bool",1)),o=_k({inputs:{a:r,b:i},backend:a});return a.disposeData(i.dataId),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var ece={kernelName:xi,backendName:"webgpu",kernelFunc:X1},tce=at({opType:le.CEIL,cpuKernelImpl:cde}),ace={kernelName:Ai,backendName:"webgpu",kernelFunc:tce},nce=class{constructor(e){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workPerThread=4,this.workgroupSize=[64,1,1],this.outputComponent=4,this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="clipVec4"}getUserCode(){return` + `}};function Mhe(e){let{inputs:t,backend:a}=e,{s0:n,s1:r}=t;if(a.shouldExecuteOnCPU([n,r])){let d=a.tensorMap.get(n.dataId),c=a.tensorMap.get(r.dataId),p=d.values,h=c.values,m=I.assertAndGetBroadcastShape(Array.from(p),Array.from(h));return a.makeTensorInfo([m.length],"int32",Int32Array.from(m))}let s=v.sizeFromShape(n.shape),i=v.sizeFromShape(r.shape),o=Math.max(s,i),l=new Ehe(o),u=[{type:"int32",data:[s]},{type:"int32",data:[i]}];return a.runWebGPUProgram(l,[n,r],"int32",u)}var Fhe={kernelName:yu,backendName:"webgpu",kernelFunc:Mhe},I9=aa({opType:De.NOT_EQUAL,dtype:"bool",cpuKernelImpl:hce}),$he={kernelName:Cs,backendName:"webgpu",kernelFunc:I9};function oc(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.tensorMap.get(n.dataId);return an({inputs:{x:r.complexTensorInfos.real},backend:a})}var Dhe={kernelName:Ep,backendName:"webgpu",kernelFunc:oc};function Phe(e,t){let a=new id(e.shape,le.TO_INT),n=t.runWebGPUProgram(a,[e],"int32");return{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}function ng(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dtype:s}=n;if(s==="complex64"){if(r.dtype==="complex64")return an({inputs:{x:r},backend:a});let i=An(r.shape),o=ng({inputs:{x:r},backend:a,attrs:{dtype:"float32"}}),l=fl({inputs:{real:o,imag:i},backend:a});return i.dispose(),a.disposeData(o.dataId),l}if(r.dtype==="complex64"){let i=oc({inputs:{input:r},backend:a}),o=ng({inputs:{x:i},backend:a,attrs:{dtype:s}});return a.disposeData(i.dataId),o}if(!v.hasEncodingLoss(r.dtype,s)){let i=an({inputs:{x:r},backend:a});return{dataId:i.dataId,shape:i.shape,dtype:s}}if(a.shouldExecuteOnCPU([r])){let i=a.tensorMap.get(r.dataId).values,[o,l,u]=qpe(i,r.shape,r.dtype,s);return a.makeTensorInfo(o,l,u)}if(s==="int32")return Phe(r,a);if(s==="bool"){let i=a.makeTensorInfo([],"bool",v.getTypedArrayFromDType("bool",1)),o=I9({inputs:{a:r,b:i},backend:a});return a.disposeData(i.dataId),o}throw new Error(`Error in Cast: failed to cast ${r.dtype} to ${s}`)}var _he={kernelName:qi,backendName:"webgpu",kernelFunc:ng},Ohe=at({opType:le.CEIL,cpuKernelImpl:Xpe}),zhe={kernelName:cs,backendName:"webgpu",kernelFunc:Ohe},Lhe=class{constructor(e){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workPerThread=4,this.workgroupSize=[64,1,1],this.outputComponent=4,this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="clipVec4"}getUserCode(){return` ${ue("index")} { if(index < uniforms.size) { let value = getAByOutputIndex(index); @@ -6334,7 +6334,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, clampedValue); } } - `}},rce=class{constructor(e){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="clip"}getUserCode(){return` + `}},Whe=class{constructor(e){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="clip"}getUserCode(){return` ${ue("index")} { if(index < uniforms.size) { let value = getAByOutputIndex(index); @@ -6345,7 +6345,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, clamp(value, uniforms.minVal, uniforms.maxVal)); } } - `}};function sce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=n,o,l=[{type:"float32",data:[s]},{type:"float32",data:[i]}];return v.sizeFromShape(r.shape)%4===0?o=new nce(r.shape):o=new rce(r.shape),a.runWebGPUProgram(o,[r],r.dtype,l)}var ice={kernelName:os,backendName:"webgpu",kernelFunc:sce},oce=class{constructor(e){this.outputShape=[],this.variableNames=["real","imag"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="complexAbs"}getUserCode(){return` + `}};function Bhe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{clipValueMin:s,clipValueMax:i}=n,o,l=[{type:"float32",data:[s]},{type:"float32",data:[i]}];return v.sizeFromShape(r.shape)%4===0?o=new Lhe(r.shape):o=new Whe(r.shape),a.runWebGPUProgram(o,[r],r.dtype,l)}var Vhe={kernelName:hs,backendName:"webgpu",kernelFunc:Bhe},Uhe=class{constructor(e){this.outputShape=[],this.variableNames=["real","imag"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="complexAbs"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let re = abs(getRealByOutputIndex(index)); @@ -6357,7 +6357,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, select(mx * length(vec2(1, min(re, im)/mx)), 0.0, mx == 0.0)); } } - `}};function rA(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}function lce(e){let{inputs:t,backend:a}=e,{x:n}=t,r=a.tensorMap.get(n.dataId),s=new oce(n.shape),i=[rA(n,r.complexTensorInfos.real),rA(n,r.complexTensorInfos.imag)];return a.runWebGPUProgram(s,i,i[0].dtype)}var uce={kernelName:dp,backendName:"webgpu",kernelFunc:lce},dce=class{constructor(e){this.uniforms="",this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=C.computeOutShape(e,1),this.variableNames=e.map((t,a)=>`T${a}`),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.offsetLength=e.length-1;for(let t=0;t0){e.push("if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }");for(let n=1;n`T${a}`),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.offsetLength=e.length-1;for(let t=0;t0){e.push("if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }");for(let n=1;nQp({inputs:{input:A},backend:a})),f=e.map(A=>c0({inputs:{input:A},backend:a})),g=Md(m,t,a),y=Md(f,t,a),x=il({inputs:{real:g,imag:y},backend:a});return m.forEach(A=>a.disposeData(A.dataId)),f.forEach(A=>a.disposeData(A.dataId)),a.disposeData(g.dataId),a.disposeData(y.dataId),x}let r=a.shouldExecuteOnCPU(e);if(n==="string"&&(r=!0),r){let m=e.map(w=>{let I=[-1,v.sizeFromShape(w.shape.slice(t))];return ke({inputs:{x:w},backend:a,attrs:{shape:I}})}),f=m.map(w=>({vals:a.readSync(w.dataId),shape:w.shape})),g=C.computeOutShape(m.map(w=>w.shape),1),y=m[0].shape[0]===1,x=hde(f,g,n,y),A=C.computeOutShape(e.map(w=>w.shape),t),b=a.makeTensorInfo(A,n,x);return m.forEach(w=>a.disposeData(w.dataId)),b}let s=a.device.limits.maxStorageBuffersPerShaderStage-1;if(e.length>s){let m=[];for(let g=0;gm.shape),u=new dce(l),p=[],c=new Array(l.length-1);if(c.length>0){c[0]=l[0][1],p.push({type:"int32",data:[c[0]]});for(let m=1;ma.disposeData(m.dataId));let h=ke({inputs:{x:d},backend:a,attrs:{shape:o}});return a.disposeData(d.dataId),h}function cce(e,t,a){let n=C.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>ke({inputs:{x:r},backend:a,attrs:{shape:[v.sizeFromShape(r.shape.slice(0,t)),v.sizeFromShape(r.shape.slice(t))]}})),outShape:n}}function $k(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n,s=v.parseAxisParam(r,t[0].shape)[0],i=t.map(u=>u.shape);C.assertParamsConsistent(i,s);let o=C.computeOutShape(t.map(u=>u.shape),s);if(v.sizeFromShape(o)===0)return a.makeTensorInfo(o,t[0].dtype,[]);let l=t.filter(u=>v.sizeFromShape(u.shape)>0);return l.length===1?en({inputs:{x:l[0]},backend:a}):Md(l,s,a)}var hce={kernelName:pu,backendName:"webgpu",kernelFunc:$k};function mce(e,t,a,n,r=!1,s=null,i=!1,o=4,l=4,u=4){let p=N=>{switch(N){case 1:return"resData = f32(x[xIndex]);";case 3:return"resData = vec3(x[xIndex], x[xIndex + 1], x[xIndex + 2]);";case 4:return"resData = vec4(x[xIndex / 4]);";default:throw new Error(`innerElementSize ${N} is not supported.`)}},c=N=>{switch(N){case 1:return"return f32(W[row * uniforms.wShape[3] + col]);";case 4:return"return vec4(W[(row * uniforms.wShape[3] + col) / 4]);";default:throw new Error(`innerElementSize ${N} is not supported.`)}},d=e?` + `}};function A0(e){let{inputs:t,backend:a}=e,{input:n}=t,r=a.tensorMap.get(n.dataId);return an({inputs:{x:r.complexTensorInfos.imag},backend:a})}var qhe={kernelName:Cp,backendName:"webgpu",kernelFunc:A0};function Wd(e,t,a){let n=e[0].dtype;if(n==="complex64"){let m=e.map(A=>oc({inputs:{input:A},backend:a})),f=e.map(A=>A0({inputs:{input:A},backend:a})),g=Wd(m,t,a),y=Wd(f,t,a),x=fl({inputs:{real:g,imag:y},backend:a});return m.forEach(A=>a.disposeData(A.dataId)),f.forEach(A=>a.disposeData(A.dataId)),a.disposeData(g.dataId),a.disposeData(y.dataId),x}let r=a.shouldExecuteOnCPU(e);if(n==="string"&&(r=!0),r){let m=e.map(w=>{let S=[-1,v.sizeFromShape(w.shape.slice(t))];return ke({inputs:{x:w},backend:a,attrs:{shape:S}})}),f=m.map(w=>({vals:a.readSync(w.dataId),shape:w.shape})),g=I.computeOutShape(m.map(w=>w.shape),1),y=m[0].shape[0]===1,x=Kpe(f,g,n,y),A=I.computeOutShape(e.map(w=>w.shape),t),b=a.makeTensorInfo(A,n,x);return m.forEach(w=>a.disposeData(w.dataId)),b}let s=a.device.limits.maxStorageBuffersPerShaderStage-1;if(e.length>s){let m=[];for(let g=0;gm.shape),u=new jhe(l),d=[],c=new Array(l.length-1);if(c.length>0){c[0]=l[0][1],d.push({type:"int32",data:[c[0]]});for(let m=1;ma.disposeData(m.dataId));let h=ke({inputs:{x:p},backend:a,attrs:{shape:o}});return a.disposeData(p.dataId),h}function Xhe(e,t,a){let n=I.computeOutShape(e.map(r=>r.shape),t);return{tensors2D:e.map(r=>ke({inputs:{x:r},backend:a,attrs:{shape:[v.sizeFromShape(r.shape.slice(0,t)),v.sizeFromShape(r.shape.slice(t))]}})),outShape:n}}function S9(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n,s=v.parseAxisParam(r,t[0].shape)[0],i=t.map(u=>u.shape);I.assertParamsConsistent(i,s);let o=I.computeOutShape(t.map(u=>u.shape),s);if(v.sizeFromShape(o)===0)return a.makeTensorInfo(o,t[0].dtype,[]);let l=t.filter(u=>v.sizeFromShape(u.shape)>0);return l.length===1?an({inputs:{x:l[0]},backend:a}):Wd(l,s,a)}var Khe={kernelName:xu,backendName:"webgpu",kernelFunc:S9};function Yhe(e,t,a,n,r=!1,s=null,i=!1,o=4,l=4,u=4){let d=N=>{switch(N){case 1:return"resData = f32(x[xIndex]);";case 3:return"resData = vec3(x[xIndex], x[xIndex + 1], x[xIndex + 2]);";case 4:return"resData = vec4(x[xIndex / 4]);";default:throw new Error(`innerElementSize ${N} is not supported.`)}},c=N=>{switch(N){case 1:return"return f32(W[row * uniforms.wShape[3] + col]);";case 4:return"return vec4(W[(row * uniforms.wShape[3] + col) / 4]);";default:throw new Error(`innerElementSize ${N} is not supported.`)}},p=e?` let coord = vec4(batch, xRow, xCol, xCh); `:` let coord = vec4(batch, xCh, xRow, xCol); @@ -6402,9 +6402,9 @@ return a / b;`,vJ=` // The bounds checking is always needed since we use it to pad zero for // the 'same' padding type. if (xRow >= 0 && xRow < ${m} && xCol >= 0 && xCol < ${f}) { - ${d} + ${p} let xIndex = getIndexFromCoords4D(coord, uniforms.xShape); - ${p(o)} + ${d(o)} } return resData;`,A=e?t&&n?` ${x}`:` @@ -6416,13 +6416,13 @@ return a / b;`,vJ=` if (row < uniforms.dimInner && col < uniforms.dimBOuter) { ${x} } - return ${Xe(o)}(0.0);`,b=`${c(l)}`,w=Xe(u),I=Xe(e?o:l),T=Xe(e?l:o);return` - ${Pr(s,i,u===4,4)} - fn mm_readA(batch: i32, row : i32, col : i32) -> ${I} { + return ${Xe(o)}(0.0);`,b=`${c(l)}`,w=Xe(u),S=Xe(e?o:l),C=Xe(e?l:o);return` + ${Or(s,i,u===4,4)} + fn mm_readA(batch: i32, row : i32, col : i32) -> ${S} { ${e?A:b} } - fn mm_readB(batch: i32, row : i32, col : i32) -> ${T} { + fn mm_readB(batch: i32, row : i32, col : i32) -> ${C} { ${e?b:A} } @@ -6432,14 +6432,14 @@ return a / b;`,vJ=` var value = valueIn; let outWidth = ${e?"uniforms.outShape[2]":"uniforms.outShape[3]"}; ${h} - ${sl(r,s)} + ${ml(r,s)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } - }`}var fce=class{constructor(e,t,a,n,r=!1,s=null,i=!1,o=!1){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.isVec4=((e.inChannels%4===0||e.inChannels%3===0)&&this.isChannelsLast||e.outWidth%4===0&&!this.isChannelsLast)&&e.outChannels%4===0,this.dispatchLayout=this.isChannelsLast?{x:[3],y:[1,2],z:[0]}:{x:[2,3],y:[1],z:[0]},this.workgroupSize=U3(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=G3(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4?(this.outputComponent=4,this.isChannelsLast&&e.inChannels%4!==0?(this.innerElementSize=3,this.variableComponents=[1,4]):(this.innerElementSize=4,this.variableComponents=[4,4]),r&&(this.variableNames.push("bias"),this.variableComponents.push(4)),i&&(this.variableNames.push("preluActivationWeights"),this.variableComponents.push(4))):(this.innerElementSize=this.elementsPerThread[0],r&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights")),this.sequentialAccessByThreads=o,this.addBias=r,this.activation=s,this.hasPreluActivationWeights=i,this.tileAOuter=this.workgroupSize[1]*this.elementsPerThread[1],this.tileBOuter=this.workgroupSize[0]*this.elementsPerThread[0],this.tileInner=Math.max(this.workgroupSize[0]*this.innerElementSize,this.workgroupSize[1]),this.fitAOuter=t%this.tileAOuter===0,this.fitBOuter=a%this.tileBOuter===0,this.fitInner=n%this.tileInner===0,this.shaderKey=`conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`}getUserCode(){let e=this.isVec4?u0(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner):d0(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner,!1,null,this.sequentialAccessByThreads),t=this.isVec4?[this.innerElementSize,4,4]:[1,1,1];return` - ${mce(this.isChannelsLast,this.fitAOuter,this.fitBOuter,this.fitInner,this.addBias,this.activation,this.hasPreluActivationWeights,t[0],t[1],t[2])} + }`}var Zhe=class{constructor(e,t,a,n,r=!1,s=null,i=!1,o=!1){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.isVec4=((e.inChannels%4===0||e.inChannels%3===0)&&this.isChannelsLast||e.outWidth%4===0&&!this.isChannelsLast)&&e.outChannels%4===0,this.dispatchLayout=this.isChannelsLast?{x:[3],y:[1,2],z:[0]}:{x:[2,3],y:[1],z:[0]},this.workgroupSize=Q3(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=ey(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4?(this.outputComponent=4,this.isChannelsLast&&e.inChannels%4!==0?(this.innerElementSize=3,this.variableComponents=[1,4]):(this.innerElementSize=4,this.variableComponents=[4,4]),r&&(this.variableNames.push("bias"),this.variableComponents.push(4)),i&&(this.variableNames.push("preluActivationWeights"),this.variableComponents.push(4))):(this.innerElementSize=this.elementsPerThread[0],r&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights")),this.sequentialAccessByThreads=o,this.addBias=r,this.activation=s,this.hasPreluActivationWeights=i,this.tileAOuter=this.workgroupSize[1]*this.elementsPerThread[1],this.tileBOuter=this.workgroupSize[0]*this.elementsPerThread[0],this.tileInner=Math.max(this.workgroupSize[0]*this.innerElementSize,this.workgroupSize[1]),this.fitAOuter=t%this.tileAOuter===0,this.fitBOuter=a%this.tileBOuter===0,this.fitInner=n%this.tileInner===0,this.shaderKey=`conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`}getUserCode(){let e=this.isVec4?g0(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner):y0(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner,!1,null,this.sequentialAccessByThreads),t=this.isVec4?[this.innerElementSize,4,4]:[1,1,1];return` + ${Yhe(this.isChannelsLast,this.fitAOuter,this.fitBOuter,this.fitInner,this.addBias,this.activation,this.hasPreluActivationWeights,t[0],t[1],t[2])} ${e} - `}},gce=class{constructor(e,t=!1,a=null,n=!1){this.variableNames=["x","W"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,",this.workgroupSize=[4,4,8],this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.dispatchLayout=this.isChannelsLast?{x:[2],y:[1],z:[0,3]}:{x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t,this.activation=a,this.hasPreluActivationWeights=n,t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`conv2dnaive_${this.activation}_${this.isChannelsLast}`}getUserCode(){return` - ${Pr(this.activation,this.hasPreluActivationWeights,!1,4)} + `}},Jhe=class{constructor(e,t=!1,a=null,n=!1){this.variableNames=["x","W"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,",this.workgroupSize=[4,4,8],this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.dispatchLayout=this.isChannelsLast?{x:[2],y:[1],z:[0,3]}:{x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t,this.activation=a,this.hasPreluActivationWeights=n,t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`conv2dnaive_${this.activation}_${this.isChannelsLast}`}getUserCode(){return` + ${Or(this.activation,this.hasPreluActivationWeights,!1,4)} fn readInp(batch : i32, row : i32, col : i32, chan : i32) -> f32{ let coords = vec4(batch, row, col, chan); if (coordsInBounds4D(coords, uniforms.xShape)) { @@ -6460,7 +6460,7 @@ return a / b;`,vJ=` let coords = ${this.isChannelsLast?"vec4(batch, row, col, chan);":"vec4(batch, chan, row, col);"} if (coordsInBounds4D(coords, uniforms.outShape)) { var value = valueIn; - ${sl(this.addBias,this.activation)} + ${ml(this.addBias,this.activation)} setOutputAtCoords(coords.x, coords.y, coords.z, coords.w, value); } } @@ -6484,7 +6484,7 @@ return a / b;`,vJ=` } writeResult(batch, outRow, outCol, outChannel, acc); } - `}},yce=class{constructor(e,t){this.variableNames=["x"],this.uniforms=`pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32, + `}},Qhe=class{constructor(e,t){this.variableNames=["x"],this.uniforms=`pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32, inChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=t,this.shaderKey=`im2col_${this.isChannelsLast}`}getUserCode(){let e=this.isChannelsLast?1:2,t=this.isChannelsLast?2:3,a=this.isChannelsLast?"coords[1]":"coords[2]",n=this.isChannelsLast?"coords[2]":"coords[1]",r=this.isChannelsLast?"getX(batch, xRow, xCol, ch)":"getX(batch, ch, xRow, xCol)";return` ${ue("index")} { let coords = getCoordsFromIndex(index); @@ -6508,7 +6508,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, value); } } - `}};function Th(e,t){let a=e.length;return a>=3?t?[...e.slice(0,-3),e[a-3]*e[a-2],e[a-1]]:[...e.slice(0,-3),e[a-3],e[a-2]*e[a-1]]:!t&&a===1&&e[0]>1?[e[0],1]:null}function xce({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=a.dataFormat==="channelsLast",u=!l,p=!1,c=l&&a.filterHeight===a.inHeight&&a.filterWidth===a.inWidth&&a.padInfo.type==="VALID",d=[],h,m;if(c){let y=a.inHeight*a.inWidth*a.inChannels;h=ke({inputs:{x:e},backend:n,attrs:{shape:[1,a.batchSize,y]}}),m=ke({inputs:{x:t},backend:n,attrs:{shape:[1,y,a.outChannels]}})}else h=ke({inputs:{x:e},backend:n,attrs:{shape:l?[a.batchSize,a.inHeight*a.inWidth,a.inChannels]:[a.batchSize,a.inChannels,a.inHeight*a.inWidth]}}),m=ke({inputs:{x:t},backend:n,attrs:{shape:[1,a.inChannels,a.outChannels]}});if(d.push(h),d.push(m),s!=null){let y=Th(s.shape,l);y!=null&&(s=ke({inputs:{x:s},backend:n,attrs:{shape:y}}),d.push(s))}if(r!=null){let y=Th(r.shape,l);y!=null&&(r=ke({inputs:{x:r},backend:n,attrs:{shape:y}}),d.push(r))}let f=p0({a:l?h:m,b:l?m:h,transposeA:u,transposeB:p,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),g=ke({inputs:{x:f},backend:n,attrs:{shape:a.outShape}});d.push(f);for(let y of d)n.disposeData(y.dataId);return g}function Ace({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:u,inChannels:p,strideWidth:c,strideHeight:d,padInfo:h,outWidth:m,outHeight:f,dilationWidth:g,dilationHeight:y,dataFormat:x}=a,A=x==="channelsLast",b=l*u*p,w=f*m,I=A?[a.batchSize,w,b]:[a.batchSize,b,w],T=new yce(I,A),N=[{type:"int32",data:[h.top,h.left]},{type:"int32",data:[d,c]},{type:"int32",data:[y,g]},{type:"int32",data:[m]},{type:"int32",data:[p*l]},{type:"int32",data:[p]}],M=n.runWebGPUProgram(T,[e],e.dtype,N),P=[];P.push(M);let E=ke({inputs:{x:t},backend:n,attrs:{shape:[1,b,-1]}});if(P.push(E),s!=null){let O=Th(s.shape,A);O!=null&&(s=ke({inputs:{x:s},backend:n,attrs:{shape:O}}),P.push(s))}if(r!=null){let O=Th(r.shape,A);O!=null&&(r=ke({inputs:{x:r},backend:n,attrs:{shape:O}}),P.push(r))}let S=p0({a:A?M:E,b:A?E:M,transposeA:!A,transposeB:!1,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),_=ke({inputs:{x:S},backend:n,attrs:{shape:a.outShape}});P.push(S);for(let O of P)n.disposeData(O.dataId);return _}function Fk({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=r!=null,u=s!=null,p=a.dataFormat==="channelsLast",c=p&&a.filterHeight===a.inHeight&&a.filterWidth===a.inWidth&&a.padInfo.type==="VALID",d=B().getBool("WEBGPU_USE_NAIVE_CONV2D_DEBUG");if(!d&&(c||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")))return xce({x:e,filter:t,convInfo:a,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});let h=B().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),m=h>-1?h:n.thresholdToIncreaseWorkgroups,f=a.batchSize*Math.ceil(a.outHeight*a.outWidth/32)*Math.ceil(a.outChannels/32);if(B().getBool("WEBGPU_CONV_SEPARATE_IM2COL_SHADER")||f<=m)return Ace({x:e,filter:t,convInfo:a,backend:n,bias:r,preluActivationWeights:s,leakyreluAlpha:i,activation:o});let g,y=[a.padInfo.top,a.padInfo.left],x=[{type:"int32",data:[a.filterHeight,a.filterWidth]},{type:"int32",data:[...y]},{type:"int32",data:[a.strideHeight,a.strideWidth]},{type:"int32",data:[a.dilationHeight,a.dilationWidth]}];if(d)g=new gce(a,l,o,u);else{let I=p?a.outHeight*a.outWidth:a.outChannels,T=p?a.outChannels:a.outHeight*a.outWidth,N=a.filterHeight*a.filterWidth*a.inChannels;x.push({type:"int32",data:[I]},{type:"int32",data:[T]},{type:"int32",data:[N]});let M=n.adapterInfo.isIntel();g=new fce(a,I,T,N,l,o,u,M)}let A=[],b=[e,t];l&&(!p&&r.shape.length===1&&(r=ke({inputs:{x:r},backend:n,attrs:{shape:[r.shape[0],1,1]}}),A.push(r)),b.push(r)),u&&(!p&&s.shape.length===1&&(s=ke({inputs:{x:s},backend:n,attrs:{shape:[s.shape[0],1,1]}}),A.push(s)),b.push(s)),o==="leakyrelu"&&(x.push({type:"float32",data:[i]}),g.uniforms+=" alpha : f32,");let w=n.runWebGPUProgram(g,b,e.dtype,x);for(let I of A)n.disposeData(I.dataId);return w}function bce(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:p}=a,c=C.convertConv2DDataFormat(l),d=C.computeConv2DInfo(r.shape,s.shape,i,u,o,p,!1,c);return Fk({x:r,filter:s,convInfo:d,backend:n})}var vce={kernelName:bi,backendName:"webgpu",kernelFunc:bce},wce=class{constructor(e){this.variableNames=["dy","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,",this.workgroupSize=[64,1,1],this.size=!1,this.isVec4=!1,this.workPerThread=1,this.outputShape=e.inShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.isVec4=this.isChannelsLast&&e.outChannels%4===0&&e.inChannels%4===0,this.isVec4?(this.workPerThread=2,this.outputComponent=4,this.workgroupSize=[4,4,4],this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[4,this.workPerThread,1])):(this.size=!0,this.workPerThread=1,this.workgroupSize=[64,1,1],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize)),this.shaderKey=`conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`}getUserCode(){let e=this.isChannelsLast?1:2,t=this.isChannelsLast?2:3,a=this.isChannelsLast?3:1,n=` + `}};function Ph(e,t){let a=e.length;return a>=3?t?[...e.slice(0,-3),e[a-3]*e[a-2],e[a-1]]:[...e.slice(0,-3),e[a-3],e[a-2]*e[a-1]]:!t&&a===1&&e[0]>1?[e[0],1]:null}function e0e({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=a.dataFormat==="channelsLast",u=!l,d=!1,c=l&&a.filterHeight===a.inHeight&&a.filterWidth===a.inWidth&&a.padInfo.type==="VALID",p=[],h,m;if(c){let y=a.inHeight*a.inWidth*a.inChannels;h=ke({inputs:{x:e},backend:n,attrs:{shape:[1,a.batchSize,y]}}),m=ke({inputs:{x:t},backend:n,attrs:{shape:[1,y,a.outChannels]}})}else h=ke({inputs:{x:e},backend:n,attrs:{shape:l?[a.batchSize,a.inHeight*a.inWidth,a.inChannels]:[a.batchSize,a.inChannels,a.inHeight*a.inWidth]}}),m=ke({inputs:{x:t},backend:n,attrs:{shape:[1,a.inChannels,a.outChannels]}});if(p.push(h),p.push(m),s!=null){let y=Ph(s.shape,l);y!=null&&(s=ke({inputs:{x:s},backend:n,attrs:{shape:y}}),p.push(s))}if(r!=null){let y=Ph(r.shape,l);y!=null&&(r=ke({inputs:{x:r},backend:n,attrs:{shape:y}}),p.push(r))}let f=x0({a:l?h:m,b:l?m:h,transposeA:u,transposeB:d,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),g=ke({inputs:{x:f},backend:n,attrs:{shape:a.outShape}});p.push(f);for(let y of p)n.disposeData(y.dataId);return g}function t0e({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let{filterWidth:l,filterHeight:u,inChannels:d,strideWidth:c,strideHeight:p,padInfo:h,outWidth:m,outHeight:f,dilationWidth:g,dilationHeight:y,dataFormat:x}=a,A=x==="channelsLast",b=l*u*d,w=f*m,S=A?[a.batchSize,w,b]:[a.batchSize,b,w],C=new Qhe(S,A),N=[{type:"int32",data:[h.top,h.left]},{type:"int32",data:[p,c]},{type:"int32",data:[y,g]},{type:"int32",data:[m]},{type:"int32",data:[d*l]},{type:"int32",data:[d]}],M=n.runWebGPUProgram(C,[e],e.dtype,N),F=[];F.push(M);let E=ke({inputs:{x:t},backend:n,attrs:{shape:[1,b,-1]}});if(F.push(E),s!=null){let O=Ph(s.shape,A);O!=null&&(s=ke({inputs:{x:s},backend:n,attrs:{shape:O}}),F.push(s))}if(r!=null){let O=Ph(r.shape,A);O!=null&&(r=ke({inputs:{x:r},backend:n,attrs:{shape:O}}),F.push(r))}let T=x0({a:A?M:E,b:A?E:M,transposeA:!A,transposeB:!1,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i}),D=ke({inputs:{x:T},backend:n,attrs:{shape:a.outShape}});F.push(T);for(let O of F)n.disposeData(O.dataId);return D}function T9({x:e,filter:t,convInfo:a,backend:n,bias:r=null,preluActivationWeights:s=null,leakyreluAlpha:i=0,activation:o=null}){let l=r!=null,u=s!=null,d=a.dataFormat==="channelsLast",c=d&&a.filterHeight===a.inHeight&&a.filterWidth===a.inWidth&&a.padInfo.type==="VALID",p=B().getBool("WEBGPU_USE_NAIVE_CONV2D_DEBUG");if(!p&&(c||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")))return e0e({x:e,filter:t,convInfo:a,backend:n,bias:r,activation:o,preluActivationWeights:s,leakyreluAlpha:i});let h=B().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),m=h>-1?h:n.thresholdToIncreaseWorkgroups,f=a.batchSize*Math.ceil(a.outHeight*a.outWidth/32)*Math.ceil(a.outChannels/32);if(B().getBool("WEBGPU_CONV_SEPARATE_IM2COL_SHADER")||f<=m)return t0e({x:e,filter:t,convInfo:a,backend:n,bias:r,preluActivationWeights:s,leakyreluAlpha:i,activation:o});let g,y=[a.padInfo.top,a.padInfo.left],x=[{type:"int32",data:[a.filterHeight,a.filterWidth]},{type:"int32",data:[...y]},{type:"int32",data:[a.strideHeight,a.strideWidth]},{type:"int32",data:[a.dilationHeight,a.dilationWidth]}];if(p)g=new Jhe(a,l,o,u);else{let S=d?a.outHeight*a.outWidth:a.outChannels,C=d?a.outChannels:a.outHeight*a.outWidth,N=a.filterHeight*a.filterWidth*a.inChannels;x.push({type:"int32",data:[S]},{type:"int32",data:[C]},{type:"int32",data:[N]});let M=n.adapterInfo.isIntel();g=new Zhe(a,S,C,N,l,o,u,M)}let A=[],b=[e,t];l&&(!d&&r.shape.length===1&&(r=ke({inputs:{x:r},backend:n,attrs:{shape:[r.shape[0],1,1]}}),A.push(r)),b.push(r)),u&&(!d&&s.shape.length===1&&(s=ke({inputs:{x:s},backend:n,attrs:{shape:[s.shape[0],1,1]}}),A.push(s)),b.push(s)),o==="leakyrelu"&&(x.push({type:"float32",data:[i]}),g.uniforms+=" alpha : f32,");let w=n.runWebGPUProgram(g,b,e.dtype,x);for(let S of A)n.disposeData(S.dataId);return w}function a0e(e){let{inputs:t,attrs:a,backend:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:d}=a,c=I.convertConv2DDataFormat(l),p=I.computeConv2DInfo(r.shape,s.shape,i,u,o,d,!1,c);return T9({x:r,filter:s,convInfo:p,backend:n})}var n0e={kernelName:Xi,backendName:"webgpu",kernelFunc:a0e},r0e=class{constructor(e){this.variableNames=["dy","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,",this.workgroupSize=[64,1,1],this.size=!1,this.isVec4=!1,this.workPerThread=1,this.outputShape=e.inShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.isVec4=this.isChannelsLast&&e.outChannels%4===0&&e.inChannels%4===0,this.isVec4?(this.workPerThread=2,this.outputComponent=4,this.workgroupSize=[4,4,4],this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[4,this.workPerThread,1])):(this.size=!0,this.workPerThread=1,this.workgroupSize=[64,1,1],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize)),this.shaderKey=`conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`}getUserCode(){let e=this.isChannelsLast?1:2,t=this.isChannelsLast?2:3,a=this.isChannelsLast?3:1,n=` ${ue()} { let batch = i32(globalId.z) / uniforms.outShape[1]; let r = i32(globalId.z) % uniforms.outShape[1]; @@ -6651,7 +6651,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}},kce=class{constructor(e){this.variableNames=["x","dy"],this.uniforms="pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e.dataFormat==="channelsLast",this.shaderKey=`conv2DDerFilter_${this.isChannelsLast}`}getUserCode(){return` + `}},s0e=class{constructor(e){this.variableNames=["x","dy"],this.uniforms="pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e.dataFormat==="channelsLast",this.shaderKey=`conv2DDerFilter_${this.isChannelsLast}`}getUserCode(){return` ${ue("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6692,7 +6692,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}},Ice=class{constructor(e){this.variableNames=["x","dy"],this.uniforms=`pads : vec3, strides : vec3, batchSize : i32, outDepth : i32, + `}},i0e=class{constructor(e){this.variableNames=["x","dy"],this.uniforms=`pads : vec3, strides : vec3, batchSize : i32, outDepth : i32, outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerFilter"}getUserCode(){return` ${ue("index")} { if(index < uniforms.size) { @@ -6733,7 +6733,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}},Sce=class{constructor(e){this.variableNames=["dy","W"],this.uniforms=`filterDims : vec3, pads : vec3, strides : vec3, + `}},o0e=class{constructor(e){this.variableNames=["dy","W"],this.uniforms=`filterDims : vec3, pads : vec3, strides : vec3, outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerInput"}getUserCode(){return` ${ue("index")} { if(index < uniforms.size) { @@ -6787,7 +6787,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}};function Cce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:p}=n,c=C.convertConv2DDataFormat(l),d=C.computeConv2DInfo(r.shape,p,i,1,o,u,!1,c),h=new kce(d),m=[{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.batchSize]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]},{type:"int32",data:[d.inHeight]},{type:"int32",data:[d.inWidth]}];return a.runWebGPUProgram(h,[r,s],r.dtype,m)}var Tce={kernelName:pp,backendName:"webgpu",kernelFunc:Cce};function Nce(e=4){let t=n=>{switch(n){case 1:return"return W[getIndexFromCoords4D(coord, uniforms.wShape)];";case 4:return` + `}};function l0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,dataFormat:l,dimRoundingMode:u,filterShape:d}=n,c=I.convertConv2DDataFormat(l),p=I.computeConv2DInfo(r.shape,d,i,1,o,u,!1,c),h=new s0e(p),m=[{type:"int32",data:[p.padInfo.top,p.padInfo.left]},{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.batchSize]},{type:"int32",data:[p.outHeight]},{type:"int32",data:[p.outWidth]},{type:"int32",data:[p.inHeight]},{type:"int32",data:[p.inWidth]}];return a.runWebGPUProgram(h,[r,s],r.dtype,m)}var u0e={kernelName:bp,backendName:"webgpu",kernelFunc:l0e};function d0e(e=4){let t=n=>{switch(n){case 1:return"return W[getIndexFromCoords4D(coord, uniforms.wShape)];";case 4:return` let coord1 = vec4(coordX, coordY, col + 1, rowInner); let coord2 = vec4(coordX, coordY, col + 2, rowInner); let coord3 = vec4(coordX, coordY, col + 3, rowInner); @@ -6847,10 +6847,10 @@ return a / b;`,vJ=` col); result[getIndexFromCoords4D(outCoord, uniforms.outShape)/${e}] = value; } - }`}var Rce=class{constructor(e){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e.inShape,v.assert(e.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),this.isVec4=e.inChannels%4===0&&e.outChannels%4===0,this.dispatchLayout={x:[3],y:[1,2],z:[0]},this.workgroupSize=U3(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=G3(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4&&(this.outputComponent=4,this.variableComponents=[4,1]),this.shaderKey=`conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`}getUserCode(){let e=this.isVec4?u0(this.elementsPerThread,this.workgroupSize):d0(this.elementsPerThread,this.workgroupSize);return` - ${Nce(this.isVec4?4:1)} + }`}var p0e=class{constructor(e){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e.inShape,v.assert(e.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),this.isVec4=e.inChannels%4===0&&e.outChannels%4===0,this.dispatchLayout={x:[3],y:[1,2],z:[0]},this.workgroupSize=Q3(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=ey(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4&&(this.outputComponent=4,this.variableComponents=[4,1]),this.shaderKey=`conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`}getUserCode(){let e=this.isVec4?g0(this.elementsPerThread,this.workgroupSize):y0(this.elementsPerThread,this.workgroupSize);return` + ${d0e(this.isVec4?4:1)} ${e} - `}};function Ece(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:u,dimRoundingMode:p}=n,c=C.convertConv2DDataFormat(u),d=C.computeConv2DInfo(i,s.shape,o,1,l,p,!1,c),h=[{type:"int32",data:[d.filterHeight,d.filterWidth]},{type:"int32",data:[d.filterHeight-1-d.padInfo.top,d.filterWidth-1-d.padInfo.left]},{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.batchSize,d.outHeight,d.outWidth,d.outChannels]}],m;if(B().getBool("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE")||d.dataFormat!=="channelsLast")m=new wce(d);else{m=new Rce(d);let f=d.inHeight*d.inWidth,g=d.inChannels,y=d.filterHeight*d.filterWidth*d.outChannels;h.push({type:"uint32",data:[f]},{type:"uint32",data:[g]},{type:"uint32",data:[y]})}return a.runWebGPUProgram(m,[r,s],"float32",h)}var Mce={kernelName:vi,backendName:"webgpu",kernelFunc:Ece},Pce=class{constructor(e){this.variableNames=["x","W"],this.uniforms="filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3dnaive"}getUserCode(){return` + `}};function c0e(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{inputShape:i,strides:o,pad:l,dataFormat:u,dimRoundingMode:d}=n,c=I.convertConv2DDataFormat(u),p=I.computeConv2DInfo(i,s.shape,o,1,l,d,!1,c),h=[{type:"int32",data:[p.filterHeight,p.filterWidth]},{type:"int32",data:[p.filterHeight-1-p.padInfo.top,p.filterWidth-1-p.padInfo.left]},{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.batchSize,p.outHeight,p.outWidth,p.outChannels]}],m;if(B().getBool("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE")||p.dataFormat!=="channelsLast")m=new r0e(p);else{m=new p0e(p);let f=p.inHeight*p.inWidth,g=p.inChannels,y=p.filterHeight*p.filterWidth*p.outChannels;h.push({type:"uint32",data:[f]},{type:"uint32",data:[g]},{type:"uint32",data:[y]})}return a.runWebGPUProgram(m,[r,s],"float32",h)}var h0e={kernelName:Ki,backendName:"webgpu",kernelFunc:c0e},m0e=class{constructor(e){this.variableNames=["x","W"],this.uniforms="filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3dnaive"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -6932,7 +6932,7 @@ return a / b;`,vJ=` } setOutputAtIndex(index, dotProd); } - }`}};function _ce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=C.computeConv3DInfo(r.shape,s.shape,i,l,o),p=[u.padInfo.front,u.padInfo.top,u.padInfo.left],c=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[...p]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationDepth,u.dilationHeight,u.dilationWidth]}],d=new Pce(u),h=da(r.dtype,s.dtype);return a.runWebGPUProgram(d,[r,s],h,c)}var $ce={kernelName:wi,backendName:"webgpu",kernelFunc:_ce};function Fce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:l}=n,u=C.computeConv3DInfo(r.shape,l,i,1,o),p=new Ice(u),c=[{type:"int32",data:[u.padInfo.front,u.padInfo.top,u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.batchSize]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.inDepth]},{type:"int32",data:[u.inHeight]},{type:"int32",data:[u.inWidth]}];return a.runWebGPUProgram(p,[r,s],s.dtype,c)}var Dce={kernelName:cu,backendName:"webgpu",kernelFunc:Fce};function Oce(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{strides:i,pad:o,inputShape:l}=n,u=C.computeConv3DInfo(l,s.shape,i,1,o),p=new Sce(u),c=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[u.filterDepth-1-u.padInfo.front,u.filterHeight-1-u.padInfo.top,u.filterWidth-1-u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.outChannels]}];return a.runWebGPUProgram(p,[r,s],r.dtype,c)}var zce={kernelName:ki,backendName:"webgpu",kernelFunc:Oce},Lce=at({opType:le.COS}),Wce={kernelName:Ii,backendName:"webgpu",kernelFunc:Lce},Bce=at({opType:le.COSH}),Vce={kernelName:Si,backendName:"webgpu",kernelFunc:Bce},Uce=class{constructor(e,t,a,n){this.variableNames=["Image","Boxes","BoxInd"],this.uniforms="extrapolationValue : f32,",this.workgroupSize=[64,1,1],this.size=!0;let[r]=t;this.outputShape=[r,a[0],a[1],e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.methodId=n==="bilinear"?1:0,this.cropHeightBiggerThan1=this.outputShape[1]>1,this.cropWidthBiggerThan1=this.outputShape[2]>1,this.shaderKey=`cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`}getUserCode(){let[e,t]=["f32(uniforms.imageShape[1] - 1)","f32(uniforms.imageShape[2] - 1)"],[a,n,r]=this.cropHeightBiggerThan1?[`(${e} / f32(uniforms.outShape[1] - 1))`,"(y2-y1) * height_ratio",`y1*${e} + f32(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${e}`],[s,i,o]=this.cropWidthBiggerThan1?[`(${t} / f32(uniforms.outShape[2] - 1))`,"(x2-x1) * width_ratio",`x1*${t} + f32(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${t}`];return` + }`}};function f0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=I.computeConv3DInfo(r.shape,s.shape,i,l,o),d=[u.padInfo.front,u.padInfo.top,u.padInfo.left],c=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[...d]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationDepth,u.dilationHeight,u.dilationWidth]}],p=new m0e(u),h=Qt(r.dtype,s.dtype);return a.runWebGPUProgram(p,[r,s],h,c)}var g0e={kernelName:Yi,backendName:"webgpu",kernelFunc:f0e};function y0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,pad:o,filterShape:l}=n,u=I.computeConv3DInfo(r.shape,l,i,1,o),d=new i0e(u),c=[{type:"int32",data:[u.padInfo.front,u.padInfo.top,u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.batchSize]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.inDepth]},{type:"int32",data:[u.inHeight]},{type:"int32",data:[u.inWidth]}];return a.runWebGPUProgram(d,[r,s],s.dtype,c)}var x0e={kernelName:Au,backendName:"webgpu",kernelFunc:y0e};function A0e(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{strides:i,pad:o,inputShape:l}=n,u=I.computeConv3DInfo(l,s.shape,i,1,o),d=new o0e(u),c=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[u.filterDepth-1-u.padInfo.front,u.filterHeight-1-u.padInfo.top,u.filterWidth-1-u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.outChannels]}];return a.runWebGPUProgram(d,[r,s],r.dtype,c)}var b0e={kernelName:Zi,backendName:"webgpu",kernelFunc:A0e},v0e=at({opType:le.COS}),w0e={kernelName:Ji,backendName:"webgpu",kernelFunc:v0e},k0e=at({opType:le.COSH}),I0e={kernelName:Qi,backendName:"webgpu",kernelFunc:k0e},S0e=class{constructor(e,t,a,n){this.variableNames=["Image","Boxes","BoxInd"],this.uniforms="extrapolationValue : f32,",this.workgroupSize=[64,1,1],this.size=!0;let[r]=t;this.outputShape=[r,a[0],a[1],e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.methodId=n==="bilinear"?1:0,this.cropHeightBiggerThan1=this.outputShape[1]>1,this.cropWidthBiggerThan1=this.outputShape[2]>1,this.shaderKey=`cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`}getUserCode(){let[e,t]=["f32(uniforms.imageShape[1] - 1)","f32(uniforms.imageShape[2] - 1)"],[a,n,r]=this.cropHeightBiggerThan1?[`(${e} / f32(uniforms.outShape[1] - 1))`,"(y2-y1) * height_ratio",`y1*${e} + f32(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${e}`],[s,i,o]=this.cropWidthBiggerThan1?[`(${t} / f32(uniforms.outShape[2] - 1))`,"(x2-x1) * width_ratio",`x1*${t} + f32(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${t}`];return` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6988,23 +6988,23 @@ return a / b;`,vJ=` } } } - `}},Gce=e=>{let{inputs:t,backend:a,attrs:n}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=n,p=new Uce(r.shape[3],s.shape,o,l),c=[{type:"float32",data:[u]}];return a.runWebGPUProgram(p,[r,s,i],"float32",c)},Hce={kernelName:Ni,backendName:"webgpu",kernelFunc:Gce},np;(function(e){e.Prod="*",e.Sum="+"})(np||(np={}));var sA=class{constructor(e,t,a,n){this.variableNames=["x"],this.uniforms="index : f32,",this.size=!0,this.workgroupSize=[128,1,1],this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.exclusive=a,this.reverse=n,this.op=e,this.shaderKey=`cum_${this.op}_${this.exclusive}_${this.reverse}`}getUserCode(){let e=this.outputShape.length,t=this.op===np.Prod?"1.0":"0.0",a=this.exclusive?t:`getX(${iA(e,"coords",this.op)})`,n=this.outputShape[this.outputShape.length-1],r="",s="";return this.exclusive?(r=this.reverse?`end != ${n-1}`:"end != 0",s=this.reverse?"end + 1":"end - 1"):(r=this.reverse?`end + pow2 < ${n}`:"end >= pow2",s=this.reverse?"end + pow2":"end - pow2"),` + `}},T0e=e=>{let{inputs:t,backend:a,attrs:n}=e,{image:r,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=n,d=new S0e(r.shape[3],s.shape,o,l),c=[{type:"float32",data:[u]}];return a.runWebGPUProgram(d,[r,s,i],"float32",c)},C0e={kernelName:ao,backendName:"webgpu",kernelFunc:T0e},cp;(function(e){e.Prod="*",e.Sum="+"})(cp||(cp={}));var IA=class{constructor(e,t,a,n){this.variableNames=["x"],this.uniforms="index : f32,",this.size=!0,this.workgroupSize=[128,1,1],this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.exclusive=a,this.reverse=n,this.op=e,this.shaderKey=`cum_${this.op}_${this.exclusive}_${this.reverse}`}getUserCode(){let e=this.outputShape.length,t=this.op===cp.Prod?"1.0":"0.0",a=this.exclusive?t:`getX(${SA(e,"coords",this.op)})`,n=this.outputShape[this.outputShape.length-1],r="",s="";return this.exclusive?(r=this.reverse?`end != ${n-1}`:"end != 0",s=this.reverse?"end + 1":"end - 1"):(r=this.reverse?`end + pow2 < ${n}`:"end >= pow2",s=this.reverse?"end + pow2":"end - pow2"),` ${ue("index")} { if (index < uniforms.size) { var coords = getCoordsFromIndex(index); - let end = ${oA(e,"coords",this.op)}; + let end = ${TA(e,"coords",this.op)}; var val = ${a}; let pow2 = i32(pow(2.0, uniforms.index)); if (${r}) { let idx = ${s}; - ${oA(e,"coords",this.op)} = idx; - val ${this.op}= getX(${iA(e,"coords",this.op)}); + ${TA(e,"coords",this.op)} = idx; + val ${this.op}= getX(${SA(e,"coords",this.op)}); } setOutputAtIndex(index, val); } } - `}};function iA(e,t,a){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 ${a} for rank ${e} is not yet supported`)}function oA(e,t,a){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 ${a} for rank ${e} is not yet supported`)}function Dk(e,t,a,n,r,s){let i=t.shape.length,o=C.getAxesPermutation([n],i),l=t;o!=null&&(l=ar({inputs:{x:t},backend:a,attrs:{perm:o}}));let u=C.getInnerMostAxes(1,i)[0];if(u!==i-1)throw new Error(`WebGPU cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${n}`);let p=l.shape[u],c=en({inputs:{x:l},backend:a});for(let d=0;d<=Math.ceil(Math.log2(p))-1;d++){let h=new sA(e,l.shape,!1,s),m=c,f=[{type:"float32",data:[d]}];c=a.runWebGPUProgram(h,[c],c.dtype,f),a.disposeData(m.dataId)}if(r){let d=new sA(e,l.shape,r,s),h=c,m=[{type:"float32",data:[0]}];c=a.runWebGPUProgram(d,[c],c.dtype,m),a.disposeData(h.dataId)}if(o!=null){let d=C.getUndoAxesPermutation(o),h=ar({inputs:{x:c},backend:a,attrs:{perm:d}});return a.disposeData(c.dataId),a.disposeData(l.dataId),h}return c}function jce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return Dk(np.Prod,r,a,s,i,o)}var qce={kernelName:Ci,backendName:"webgpu",kernelFunc:jce};function Xce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return Dk(np.Sum,r,a,s,i,o)}var Kce={kernelName:Ti,backendName:"webgpu",kernelFunc:Xce};function Yce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=n,l=r.shape.length===1,u=v.sizeFromShape(s.shape)>0,p=s.dtype,c=l?[r.shape[0]]:[r.shape[0],r.shape[1]],d=l?[i]:[r.shape[0],i],h=Wa({backend:a,attrs:{shape:d,value:0,dtype:p}}),m=new Pk(c,u,o),f=[{type:"int32",data:[i]}],g=u?[r,s]:[r];return a.runWebGPUProgram(m,g,p,f,h)}var Zce={kernelName:hu,backendName:"webgpu",kernelFunc:Yce},Jce=class{constructor(e,t){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.uniforms="blockSize : i32,",this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`depthToSpace_${t}`,this.dataFormat=t}getUserCode(){return` + `}};function SA(e,t,a){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 ${a} for rank ${e} is not yet supported`)}function TA(e,t,a){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 ${a} for rank ${e} is not yet supported`)}function C9(e,t,a,n,r,s){let i=t.shape.length,o=I.getAxesPermutation([n],i),l=t;o!=null&&(l=ir({inputs:{x:t},backend:a,attrs:{perm:o}}));let u=I.getInnerMostAxes(1,i)[0];if(u!==i-1)throw new Error(`WebGPU cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${n}`);let d=l.shape[u],c=an({inputs:{x:l},backend:a});for(let p=0;p<=Math.ceil(Math.log2(d))-1;p++){let h=new IA(e,l.shape,!1,s),m=c,f=[{type:"float32",data:[p]}];c=a.runWebGPUProgram(h,[c],c.dtype,f),a.disposeData(m.dataId)}if(r){let p=new IA(e,l.shape,r,s),h=c,m=[{type:"float32",data:[0]}];c=a.runWebGPUProgram(p,[c],c.dtype,m),a.disposeData(h.dataId)}if(o!=null){let p=I.getUndoAxesPermutation(o),h=ir({inputs:{x:c},backend:a,attrs:{perm:p}});return a.disposeData(c.dataId),a.disposeData(l.dataId),h}return c}function N0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return C9(cp.Prod,r,a,s,i,o)}var R0e={kernelName:eo,backendName:"webgpu",kernelFunc:N0e};function E0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,exclusive:i,reverse:o}=n;return C9(cp.Sum,r,a,s,i,o)}var M0e={kernelName:to,backendName:"webgpu",kernelFunc:E0e};function F0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,weights:s}=t,{size:i,binaryOutput:o}=n,l=r.shape.length===1,u=v.sizeFromShape(s.shape)>0,d=s.dtype,c=l?[r.shape[0]]:[r.shape[0],r.shape[1]],p=l?[i]:[r.shape[0],i],h=Wa({backend:a,attrs:{shape:p,value:0,dtype:d}}),m=new k9(c,u,o),f=[{type:"int32",data:[i]}],g=u?[r,s]:[r];return a.runWebGPUProgram(m,g,d,f,h)}var $0e={kernelName:bu,backendName:"webgpu",kernelFunc:F0e},D0e=class{constructor(e,t){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.uniforms="blockSize : i32,",this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`depthToSpace_${t}`,this.dataFormat=t}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7024,8 +7024,8 @@ return a / b;`,vJ=` let rlt = ${this.getInputSamplingString()}; setOutputAtIndex(index, rlt); } - }`}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"?"uniforms.outShape[3]":"uniforms.outShape[1]"}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function Qce(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockSize:s,dataFormat:i}=n,o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],p=i==="NHWC"?r.shape[3]:r.shape[1],c=l*s,d=u*s,h=p/(s*s),m=i==="NHWC"?[o,c,d,h]:[o,h,c,d],f=[{type:"int32",data:[s]}],g=new Jce(m,i);return a.runWebGPUProgram(g,[r],r.dtype,f)}var ehe={kernelName:Ri,backendName:"webgpu",kernelFunc:Qce},the=class{constructor(e,t,a,n=!1,r=null,s=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2,",this.workgroupSize=[16,16,1],this.outputShape=e,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),n&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),this.addBias=n,this.activation=r,this.hasPreluActivation=s,this.filterHeight=t,this.filterWidth=a,this.shaderKey=`depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`}getUserCode(){let e=this.filterWidth*this.filterHeight,t=this.workgroupSize[0]*this.workgroupSize[1]*this.workgroupSize[2],a=this.workgroupSize[1]+this.filterHeight-1,n=this.workgroupSize[0]+this.filterWidth-1;return` - ${Pr(this.activation,this.hasPreluActivation,!1,4)} + }`}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"?"uniforms.outShape[3]":"uniforms.outShape[1]"}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function P0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockSize:s,dataFormat:i}=n,o=r.shape[0],l=i==="NHWC"?r.shape[1]:r.shape[2],u=i==="NHWC"?r.shape[2]:r.shape[3],d=i==="NHWC"?r.shape[3]:r.shape[1],c=l*s,p=u*s,h=d/(s*s),m=i==="NHWC"?[o,c,p,h]:[o,h,c,p],f=[{type:"int32",data:[s]}],g=new D0e(m,i);return a.runWebGPUProgram(g,[r],r.dtype,f)}var _0e={kernelName:no,backendName:"webgpu",kernelFunc:P0e},O0e=class{constructor(e,t,a,n=!1,r=null,s=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2,",this.workgroupSize=[16,16,1],this.outputShape=e,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),n&&this.variableNames.push("bias"),s&&this.variableNames.push("preluActivationWeights"),this.addBias=n,this.activation=r,this.hasPreluActivation=s,this.filterHeight=t,this.filterWidth=a,this.shaderKey=`depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`}getUserCode(){let e=this.filterWidth*this.filterHeight,t=this.workgroupSize[0]*this.workgroupSize[1]*this.workgroupSize[2],a=this.workgroupSize[1]+this.filterHeight-1,n=this.workgroupSize[0]+this.filterWidth-1;return` + ${Or(this.activation,this.hasPreluActivation,!1,4)} var mm_Asub : array, ${a}>; var mm_Bsub : array, ${this.filterHeight}>; @@ -7081,13 +7081,13 @@ return a / b;`,vJ=` value = fma(xVal, wVal, value); } } - ${sl(this.addBias,this.activation)} + ${ml(this.addBias,this.activation)} if (coordsInBounds4D(coords, uniforms.outShape)) { setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } } - `}},Ok=class{constructor(e,t=!1,a=null,n=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2, virtualWidth : i32,",this.workgroupSize=[64,1,1],this.workPerThread=4,this.outputComponent=4,this.outputShape=e.outShape,this.virtualWidth=Math.ceil(this.outputShape[2]/this.workPerThread)*this.workPerThread;let r=[this.outputShape[0],this.outputShape[1],this.virtualWidth,this.outputShape[3]];this.dispatchLayout=me(r),this.dispatch=de(this.dispatchLayout,r,this.workgroupSize,[this.outputComponent*this.workPerThread,1,1]),v.assert(e.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.convInfo=e,this.addBias=t,this.activation=a,this.hasPreluActivation=n,this.shaderKey=`depthwiseVec4_${a}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`}getUserCode(){let e=(this.workPerThread-1)*this.convInfo.strideWidth+this.convInfo.filterWidth,t=this.convInfo.strideHeight,a=this.convInfo.strideWidth;return` - ${Pr(this.activation,this.hasPreluActivation,!0,4)} + `}},N9=class{constructor(e,t=!1,a=null,n=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2, virtualWidth : i32,",this.workgroupSize=[64,1,1],this.workPerThread=4,this.outputComponent=4,this.outputShape=e.outShape,this.virtualWidth=Math.ceil(this.outputShape[2]/this.workPerThread)*this.workPerThread;let r=[this.outputShape[0],this.outputShape[1],this.virtualWidth,this.outputShape[3]];this.dispatchLayout=me(r),this.dispatch=de(this.dispatchLayout,r,this.workgroupSize,[this.outputComponent*this.workPerThread,1,1]),v.assert(e.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.convInfo=e,this.addBias=t,this.activation=a,this.hasPreluActivation=n,this.shaderKey=`depthwiseVec4_${a}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`}getUserCode(){let e=(this.workPerThread-1)*this.convInfo.strideWidth+this.convInfo.filterWidth,t=this.convInfo.strideHeight,a=this.convInfo.strideWidth;return` + ${Or(this.activation,this.hasPreluActivation,!0,4)} fn readX(batch : i32, row : i32, col : i32, channel : i32) -> vec4 { var value = vec4(0.0); if (col >=0 && col < uniforms.inDims[1]) { @@ -7136,14 +7136,14 @@ return a / b;`,vJ=` let coords = vec4(batch, r, c + i, d1); if (coordsInBounds4D(coords, uniforms.outShape)) { var value = dotProd[i]; - ${sl(this.addBias,this.activation)} + ${ml(this.addBias,this.activation)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } } } - `}},zk=class{constructor(e,t=!1,a=null,n=!1){this.variableNames=["x","W"],this.uniforms=`pads : vec2, inDims : vec2, filterHeight : i32, + `}},R9=class{constructor(e,t=!1,a=null,n=!1){this.variableNames=["x","W"],this.uniforms=`pads : vec2, inDims : vec2, filterHeight : i32, filterWidth : i32, strides : vec2, dilations : vec2,`,this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e.dataFormat==="channelsLast",t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.convInfo=e,this.addBias=t,this.activation=a,this.hasPreluActivation=n,this.shaderKey=`depthwise_${this.activation}_${this.isChannelsLast}`}getUserCode(){let e=this.isChannelsLast?"getX(batch, xR, xC, d1);":"getX(batch, d1, xR, xC);";return` - ${Pr(this.activation,this.hasPreluActivation,!1,4)} + ${Or(this.activation,this.hasPreluActivation,!1,4)} ${ue("index")} { if (index < uniforms.size) { @@ -7204,11 +7204,11 @@ return a / b;`,vJ=` } } } - ${sl(this.addBias,this.activation)} + ${ml(this.addBias,this.activation)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } } - `}};function ahe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:p}=n,c=C.convertConv2DDataFormat(l),d=u;d==null&&(d=[1,1]);let h=C.computeConv2DInfo(r.shape,s.shape,i,d,o,p,!0,c),m=[{type:"int32",data:[h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.inHeight,h.inWidth]}],f=h.dataFormat==="channelsLast",g;return!f&&h.inHeight>16&&h.inWidth>16&&h.strideHeight===1&&h.strideWidth===1&&h.dilationWidth===1&&h.dilationHeight===1&&h.inChannels===h.outChannels?g=new the(h.outShape,h.filterHeight,h.filterWidth):f&&h.outHeight>4&&h.outWidth>4&&h.strideWidth<=2&&h.inChannels===h.outChannels&&h.dilationHeight===1&&h.dilationWidth===1&&h.inChannels%4===0?(g=new Ok(h),m.push({type:"int32",data:[g.virtualWidth]})):(g=new zk(h),m.push({type:"int32",data:[h.filterHeight]},{type:"int32",data:[h.filterWidth]},{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]})),a.runWebGPUProgram(g,[r,s],r.dtype,m)}var nhe={kernelName:Ei,backendName:"webgpu",kernelFunc:ahe},rhe=class{constructor(e){this.variableNames=["x","dy"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32, + `}};function z0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dataFormat:l,dilations:u,dimRoundingMode:d}=n,c=I.convertConv2DDataFormat(l),p=u;p==null&&(p=[1,1]);let h=I.computeConv2DInfo(r.shape,s.shape,i,p,o,d,!0,c),m=[{type:"int32",data:[h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.inHeight,h.inWidth]}],f=h.dataFormat==="channelsLast",g;return!f&&h.inHeight>16&&h.inWidth>16&&h.strideHeight===1&&h.strideWidth===1&&h.dilationWidth===1&&h.dilationHeight===1&&h.inChannels===h.outChannels?g=new O0e(h.outShape,h.filterHeight,h.filterWidth):f&&h.outHeight>4&&h.outWidth>4&&h.strideWidth<=2&&h.inChannels===h.outChannels&&h.dilationHeight===1&&h.dilationWidth===1&&h.inChannels%4===0?(g=new N9(h),m.push({type:"int32",data:[g.virtualWidth]})):(g=new R9(h),m.push({type:"int32",data:[h.filterHeight]},{type:"int32",data:[h.filterWidth]},{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]})),a.runWebGPUProgram(g,[r,s],r.dtype,m)}var L0e={kernelName:ro,backendName:"webgpu",kernelFunc:z0e},W0e=class{constructor(e){this.variableNames=["x","dy"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_filter"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -7244,7 +7244,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}},she=class{constructor(e){this.variableNames=["dy","W"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, + `}},B0e=class{constructor(e){this.variableNames=["dy","W"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32, outWidth : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_input"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -7287,7 +7287,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}};function ihe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,filterShape:p}=n,c=C.computeConv2DInfo(r.shape,p,i,o,l,u,!0),d=new rhe(c),h=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.inHeight]},{type:"int32",data:[c.inWidth]},{type:"int32",data:[c.batchSize]},{type:"int32",data:[c.outChannels/c.inChannels]}];return a.runWebGPUProgram(d,[r,s],"float32",h)}var ohe={kernelName:cp,backendName:"webgpu",kernelFunc:ihe};function lhe(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,inputShape:p}=n,c=C.computeConv2DInfo(p,s.shape,i,o,l,u,!0),d=new she(c),h=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.filterHeight-1-c.padInfo.top,c.filterWidth-1-c.padInfo.left]},{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.outChannels/c.inChannels]}];return a.runWebGPUProgram(d,[r,s],r.dtype,h)}var uhe={kernelName:hp,backendName:"webgpu",kernelFunc:lhe},dhe=class{constructor(e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="diag"}getUserCode(){return` + `}};function V0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,dy:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,filterShape:d}=n,c=I.computeConv2DInfo(r.shape,d,i,o,l,u,!0),p=new W0e(c),h=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.inHeight]},{type:"int32",data:[c.inWidth]},{type:"int32",data:[c.batchSize]},{type:"int32",data:[c.outChannels/c.inChannels]}];return a.runWebGPUProgram(p,[r,s],"float32",h)}var U0e={kernelName:vp,backendName:"webgpu",kernelFunc:V0e};function G0e(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,filter:s}=t,{strides:i,dilations:o,pad:l,dimRoundingMode:u,inputShape:d}=n,c=I.computeConv2DInfo(d,s.shape,i,o,l,u,!0),p=new B0e(c),h=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.filterHeight-1-c.padInfo.top,c.filterWidth-1-c.padInfo.left]},{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.outChannels/c.inChannels]}];return a.runWebGPUProgram(p,[r,s],r.dtype,h)}var H0e={kernelName:wp,backendName:"webgpu",kernelFunc:G0e},j0e=class{constructor(e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="diag"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -7295,7 +7295,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, value); } } - `}};function phe(e){let{inputs:t,backend:a}=e,{x:n}=t,r=[...n.shape,...n.shape],s=v.sizeFromShape(n.shape),i=ke({inputs:{x:n},backend:a,attrs:{shape:[s]}}),o=new dhe(s),l=a.runWebGPUProgram(o,[i],i.dtype),u=ke({inputs:{x:l},backend:a,attrs:{shape:r}});return a.disposeData(i.dataId),a.disposeData(l.dataId),u}var che={kernelName:mu,backendName:"webgpu",kernelFunc:phe},hhe=class{constructor(e){this.variableNames=["x","w"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="dilation2d"}getUserCode(){return` + `}};function q0e(e){let{inputs:t,backend:a}=e,{x:n}=t,r=[...n.shape,...n.shape],s=v.sizeFromShape(n.shape),i=ke({inputs:{x:n},backend:a,attrs:{shape:[s]}}),o=new j0e(s),l=a.runWebGPUProgram(o,[i],i.dtype),u=ke({inputs:{x:l},backend:a,attrs:{shape:r}});return a.disposeData(i.dataId),a.disposeData(l.dataId),u}var X0e={kernelName:vu,backendName:"webgpu",kernelFunc:q0e},K0e=class{constructor(e){this.variableNames=["x","w"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="dilation2d"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let neg_infinity = -3.4e38; @@ -7327,7 +7327,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, curVal); } } - `}};function mhe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=C.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),p=[u.padInfo.top,u.padInfo.left],c=[{type:"int32",data:[u.filterHeight,u.filterWidth]},{type:"int32",data:[...p]},{type:"int32",data:[u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationHeight,u.dilationWidth]}],d=new hhe(u);return a.runWebGPUProgram(d,[r,s],r.dtype,c)}var fhe={kernelName:Mi,backendName:"webgpu",kernelFunc:mhe},ghe=class{constructor(e,t){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.inShape,this.dispatchLayout=me(e.outShape),this.dispatch=de(this.dispatchLayout,e.outShape,this.workgroupSize),t!=="float32"&&t!=="int32")throw new Error(`Dilation2DBackpropInput only supports float32 and int32 + `}};function Y0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s}=t,{strides:i,pad:o,dilations:l}=n,u=I.computeDilation2DInfo(r.shape,s.shape,i,o,"NHWC",l),d=[u.padInfo.top,u.padInfo.left],c=[{type:"int32",data:[u.filterHeight,u.filterWidth]},{type:"int32",data:[...d]},{type:"int32",data:[u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationHeight,u.dilationWidth]}],p=new K0e(u);return a.runWebGPUProgram(p,[r,s],r.dtype,c)}var Z0e={kernelName:so,backendName:"webgpu",kernelFunc:Y0e},J0e=class{constructor(e,t){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.inShape,this.dispatchLayout=me(e.outShape),this.dispatch=de(this.dispatchLayout,e.outShape,this.workgroupSize),t!=="float32"&&t!=="int32")throw new Error(`Dilation2DBackpropInput only supports float32 and int32 types, does not support ${t} type.`);this.type=t,this.shaderKey="dilation2DBackpropInput"}getUserCode(){return` ${ue("index")} { if (index < uniforms.dySize) { @@ -7368,10 +7368,10 @@ return a / b;`,vJ=` let flatIndexIn = d + uniforms.xShape[3] * (xCMax + uniforms.xShape[2] * (xRMax + uniforms.xShape[1] * b)); let value = getDy(b, r, c, d); - ${gs("&result[flatIndexIn]","value",this.type)} + ${Bs("&result[flatIndexIn]","value",this.type)} } } - `}},yhe=class{constructor(e,t,a){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.filterShape,this.dispatchLayout=me(e.outShape),this.dispatch=de(this.dispatchLayout,e.outShape,this.workgroupSize),a!=="float32"&&a!=="int32")throw new Error(`Dilation2DBackpropFilter only supports float32 and int32 + `}},Q0e=class{constructor(e,t,a){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.filterShape,this.dispatchLayout=me(e.outShape),this.dispatch=de(this.dispatchLayout,e.outShape,this.workgroupSize),a!=="float32"&&a!=="int32")throw new Error(`Dilation2DBackpropFilter only supports float32 and int32 types, does not support ${a} type.`);this.type=a,this.shaderKey="dilation2DBackpropFilter"}getUserCode(){return` ${ue("index")} { if (index < uniforms.dySize) { @@ -7411,10 +7411,10 @@ return a / b;`,vJ=` let flatIndexIn = d + uniforms.wShape[2] * (wCMax + wRMax * uniforms.wShape[1]); let value = getDy(b, r, c, d); - ${gs("&result[flatIndexIn]","value",this.type)} + ${Bs("&result[flatIndexIn]","value",this.type)} } } - `}};function xhe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n,p=C.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=s.dtype,d=new yhe(p,s.shape,c),h=[{type:"int32",data:[p.filterHeight,p.filterWidth]},{type:"int32",data:[p.padInfo.top,p.padInfo.left]},{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.dilationHeight,p.dilationWidth]},{type:"int32",data:[v.sizeFromShape(p.outShape)]}],m=Wa({backend:a,attrs:{shape:s.shape,value:0,dtype:c}});return a.runWebGPUProgram(d,[r,s,i],c,h,m)}var Ahe={kernelName:Hl,backendName:"webgpu",kernelFunc:xhe};function bhe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n,p=C.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=r.dtype,d=new ghe(p,c),h=[{type:"int32",data:[p.filterHeight,p.filterWidth]},{type:"int32",data:[p.padInfo.top,p.padInfo.left]},{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.dilationHeight,p.dilationWidth]},{type:"int32",data:[v.sizeFromShape(p.outShape)]}],m=Wa({backend:a,attrs:{shape:p.inShape,value:0,dtype:c}});return a.runWebGPUProgram(d,[r,s,i],c,h,m)}var vhe={kernelName:Gl,backendName:"webgpu",kernelFunc:bhe},whe=class{constructor(e,t,a){this.variableNames=["Image"],this.uniforms="alpha: f32,",this.workgroupSize=[64,1,1],this.pixelsOpType=eu.DRAW,this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.type=t,this.textureFormat=a,this.shaderKey=`draw_${t}_${a}`}getUserCode(){let e,t=this.type==="float32"?"value":"value / 255.0";return e=` + `}};function eme(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n,d=I.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=s.dtype,p=new Q0e(d,s.shape,c),h=[{type:"int32",data:[d.filterHeight,d.filterWidth]},{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]},{type:"int32",data:[v.sizeFromShape(d.outShape)]}],m=Wa({backend:a,attrs:{shape:s.shape,value:0,dtype:c}});return a.runWebGPUProgram(p,[r,s,i],c,h,m)}var tme={kernelName:Ql,backendName:"webgpu",kernelFunc:eme};function ame(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,dy:i}=t,{strides:o,pad:l,dilations:u}=n,d=I.computeDilation2DInfo(r.shape,s.shape,o,l,"NHWC",u),c=r.dtype,p=new J0e(d,c),h=[{type:"int32",data:[d.filterHeight,d.filterWidth]},{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]},{type:"int32",data:[v.sizeFromShape(d.outShape)]}],m=Wa({backend:a,attrs:{shape:d.inShape,value:0,dtype:c}});return a.runWebGPUProgram(p,[r,s,i],c,h,m)}var nme={kernelName:Jl,backendName:"webgpu",kernelFunc:ame},rme=class{constructor(e,t,a){this.variableNames=["Image"],this.uniforms="alpha: f32,",this.workgroupSize=[64,1,1],this.pixelsOpType=lu.DRAW,this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.type=t,this.textureFormat=a,this.shaderKey=`draw_${t}_${a}`}getUserCode(){let e,t=this.type==="float32"?"value":"value / 255.0";return e=` if (uniforms.numChannels == 1) { rgba[0] = ${t}; rgba[1] = ${t}; @@ -7437,7 +7437,7 @@ return a / b;`,vJ=` textureStore(outImage, vec2(coords.yx), rgba); } } - `}};function khe(e){let{inputs:t,backend:a,attrs:n}=e,{image:r}=t,{canvas:s,options:i}=n,[o,l]=r.shape.slice(0,2),{imageOptions:u}=i||{},p=(u==null?void 0:u.alpha)||1,c=a.device.features.has("bgra8unorm-storage")?"bgra8unorm":"rgba8unorm",d=[o,l],h=new whe(d,r.dtype,c);s.width=l,s.height=o;let m="webgpu",f=s.getContext(m),g;f||(g=new OffscreenCanvas(l,o),f=g.getContext(m));let y=r.shape.length===3?r.shape[2]:1;f.configure({device:a.device,format:c,usage:GPUTextureUsage.STORAGE_BINDING,alphaMode:"premultiplied"});let x="int32",A=a.makeTensorInfo(d,x),b=a.tensorMap.get(A.dataId);b.resource=f.getCurrentTexture(),b.external=!0;let w=[{type:"uint32",data:[y]},{type:"float32",data:[p]}];if(a.runWebGPUProgram(h,[r],x,w,A),g){let I=s.getContext("2d");if(!I)throw new Error("Please make sure this canvas has only been used for 2d or webgpu context!");I.drawImage(g,0,0)}return a.disposeData(A.dataId),r}var Ihe={kernelName:mp,backendName:"webgpu",kernelFunc:khe},Lk=ea({opType:_e.MUL,cpuKernelImpl:Rde,supportsComplex:!0}),She={kernelName:fo,backendName:"webgpu",kernelFunc:Lk};function Wk(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;return ol(r,s,i,"sum",a)}var Che={kernelName:Vo,backendName:"webgpu",kernelFunc:Wk};function The(e){let{inputs:t,backend:a,attrs:n}=e,{equation:r}=n,s=t,{allDims:i,summedDims:o,idDims:l}=C.decodeEinsumEquation(r,s.length);C.checkEinsumDimSizes(i.length,l,s);let{path:u,steps:p}=C.getEinsumComputePath(o,l),c=p.length,d=null,h=i.length,m=[];for(let f=0;f=0&&(d=Wk({inputs:{x:d},backend:a,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(d)),h--)}for(let f of m)f!==d&&a.disposeData(f.dataId);return d}var Nhe={kernelName:fp,backendName:"webgpu",kernelFunc:The},Rhe=at({opType:le.ELU}),Ehe={kernelName:_i,backendName:"webgpu",kernelFunc:Rhe},Mhe=e=>{let{inputs:t,backend:a}=e,{dy:n,y:r}=t,s=new Ch(_e.ELU_DER,n.shape,r.shape);return a.runWebGPUProgram(s,[n,r],n.dtype)},Phe={kernelName:fu,backendName:"webgpu",kernelFunc:Mhe},_he=ea({opType:_e.EQUAL,dtype:"bool",cpuKernelImpl:mde}),$he={kernelName:Fi,backendName:"webgpu",kernelFunc:_he},Fhe=at({opType:le.ERF}),Dhe={kernelName:$i,backendName:"webgpu",kernelFunc:Fhe},Ohe=at({opType:le.EXP,cpuKernelImpl:fde,dtype:"float32"}),zhe={kernelName:Di,backendName:"webgpu",kernelFunc:Ohe};function K1(e){let{inputs:t,attrs:a,backend:n}=e,{dim:r}=a,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=r;return r<0&&(v.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+r+1),o.splice(l,0,1),ke({inputs:{x:s},backend:n,attrs:{shape:o}})}var Lhe={kernelName:gu,backendName:"webgpu",kernelFunc:K1},Whe=at({opType:le.EXPM1,cpuKernelImpl:gde}),Bhe={kernelName:Oi,backendName:"webgpu",kernelFunc:Whe},lA=class{constructor(e,t){this.variableNames=["real","imag"],this.outputShape=[],this.uniforms="exponentMultiplier : f32, denominator: f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.component=e,this.shaderKey=`fft_${e}`}getUserCode(){return` + `}};function sme(e){let{inputs:t,backend:a,attrs:n}=e,{image:r}=t,{canvas:s,options:i}=n,[o,l]=r.shape.slice(0,2),{imageOptions:u}=i||{},d=(u==null?void 0:u.alpha)||1,c=a.device.features.has("bgra8unorm-storage")?"bgra8unorm":"rgba8unorm",p=[o,l],h=new rme(p,r.dtype,c);s.width=l,s.height=o;let m="webgpu",f=s.getContext(m),g;f||(g=new OffscreenCanvas(l,o),f=g.getContext(m));let y=r.shape.length===3?r.shape[2]:1;f.configure({device:a.device,format:c,usage:GPUTextureUsage.STORAGE_BINDING,alphaMode:"premultiplied"});let x="int32",A=a.makeTensorInfo(p,x),b=a.tensorMap.get(A.dataId);b.resource=f.getCurrentTexture(),b.external=!0;let w=[{type:"uint32",data:[y]},{type:"float32",data:[d]}];if(a.runWebGPUProgram(h,[r],x,w,A),g){let S=s.getContext("2d");if(!S)throw new Error("Please make sure this canvas has only been used for 2d or webgpu context!");S.drawImage(g,0,0)}return a.disposeData(A.dataId),r}var ime={kernelName:kp,backendName:"webgpu",kernelFunc:sme},E9=aa({opType:De.MUL,cpuKernelImpl:pce,supportsComplex:!0}),ome={kernelName:Ts,backendName:"webgpu",kernelFunc:E9};function M9(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;return gl(r,s,i,"sum",a)}var lme={kernelName:Qo,backendName:"webgpu",kernelFunc:M9};function ume(e){let{inputs:t,backend:a,attrs:n}=e,{equation:r}=n,s=t,{allDims:i,summedDims:o,idDims:l}=I.decodeEinsumEquation(r,s.length);I.checkEinsumDimSizes(i.length,l,s);let{path:u,steps:d}=I.getEinsumComputePath(o,l),c=d.length,p=null,h=i.length,m=[];for(let f=0;f=0&&(p=M9({inputs:{x:p},backend:a,attrs:{axis:u[f]-(i.length-h),keepDims:!1}}),m.push(p)),h--)}for(let f of m)f!==p&&a.disposeData(f.dataId);return p}var dme={kernelName:Ip,backendName:"webgpu",kernelFunc:ume},pme=at({opType:le.ELU}),cme={kernelName:oo,backendName:"webgpu",kernelFunc:pme},hme=e=>{let{inputs:t,backend:a}=e,{dy:n,y:r}=t,s=new $h(De.ELU_DER,n.shape,r.shape);return a.runWebGPUProgram(s,[n,r],n.dtype)},mme={kernelName:wu,backendName:"webgpu",kernelFunc:hme},fme=aa({opType:De.EQUAL,dtype:"bool",cpuKernelImpl:Ype}),gme={kernelName:ms,backendName:"webgpu",kernelFunc:fme},yme=at({opType:le.ERF}),xme={kernelName:lo,backendName:"webgpu",kernelFunc:yme},Ame=at({opType:le.EXP,cpuKernelImpl:Zpe,dtype:"float32"}),bme={kernelName:fs,backendName:"webgpu",kernelFunc:Ame};function rg(e){let{inputs:t,attrs:a,backend:n}=e,{dim:r}=a,{input:s}=t,i=s.shape.length,o=s.shape.slice(),l=r;return r<0&&(v.assert(-(i+1)<=r,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),l=i+r+1),o.splice(l,0,1),ke({inputs:{x:s},backend:n,attrs:{shape:o}})}var vme={kernelName:ku,backendName:"webgpu",kernelFunc:rg},wme=at({opType:le.EXPM1,cpuKernelImpl:Jpe}),kme={kernelName:gs,backendName:"webgpu",kernelFunc:wme},CA=class{constructor(e,t){this.variableNames=["real","imag"],this.outputShape=[],this.uniforms="exponentMultiplier : f32, denominator: f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.component=e,this.shaderKey=`fft_${e}`}getUserCode(){return` fn unaryOpComplex(real: f32, expR: f32, imag: f32, expI: f32) -> f32 { ${this.component==="real"?"return real * expR - imag * expI;":"return real * expI + imag * expR;"} } @@ -7470,7 +7470,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, mulMatDFT(coords[0], coords[1])); } } - `}};function Bk(e,t,a){let n=a.tensorMap.get(e.dataId),r=v.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=[],l=ke({inputs:{x:e},backend:a,attrs:{shape:[i,s]}});o.push(l);let u=l.shape,p=new lA("real",u),c=new lA("imag",u),d=[{dataId:n.complexTensorInfos.real.dataId,dtype:n.complexTensorInfos.real.dtype,shape:u},{dataId:n.complexTensorInfos.imag.dataId,dtype:n.complexTensorInfos.imag.dtype,shape:u}],h=t?2*Math.PI:-2*Math.PI,m=t?u[1]:1,f=[{type:"float32",data:[h]},{type:"float32",data:[m]}],g=a.runWebGPUProgram(p,d,"float32",f);o.push(g);let y=a.runWebGPUProgram(c,d,"float32",f);o.push(y);let x=il({inputs:{real:g,imag:y},backend:a});o.push(x);let A=ke({inputs:{x},backend:a,attrs:{shape:e.shape}});return o.forEach(b=>a.disposeData(b.dataId)),A}function Vhe(e){let{inputs:t,backend:a}=e,{input:n}=t;return Bk(n,!1,a)}var Uhe={kernelName:gp,backendName:"webgpu",kernelFunc:Vhe},Ghe=class{constructor(e){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="flipLeftRight"}getUserCode(){return` + `}};function F9(e,t,a){let n=a.tensorMap.get(e.dataId),r=v.sizeFromShape(e.shape),s=e.shape[e.shape.length-1],i=r/s,o=[],l=ke({inputs:{x:e},backend:a,attrs:{shape:[i,s]}});o.push(l);let u=l.shape,d=new CA("real",u),c=new CA("imag",u),p=[{dataId:n.complexTensorInfos.real.dataId,dtype:n.complexTensorInfos.real.dtype,shape:u},{dataId:n.complexTensorInfos.imag.dataId,dtype:n.complexTensorInfos.imag.dtype,shape:u}],h=t?2*Math.PI:-2*Math.PI,m=t?u[1]:1,f=[{type:"float32",data:[h]},{type:"float32",data:[m]}],g=a.runWebGPUProgram(d,p,"float32",f);o.push(g);let y=a.runWebGPUProgram(c,p,"float32",f);o.push(y);let x=fl({inputs:{real:g,imag:y},backend:a});o.push(x);let A=ke({inputs:{x},backend:a,attrs:{shape:e.shape}});return o.forEach(b=>a.disposeData(b.dataId)),A}function Ime(e){let{inputs:t,backend:a}=e,{input:n}=t;return F9(n,!1,a)}var Sme={kernelName:Sp,backendName:"webgpu",kernelFunc:Ime},Tme=class{constructor(e){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="flipLeftRight"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7479,7 +7479,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, outputValue); } } - `}},Hhe={kernelName:zi,backendName:"webgpu",kernelFunc:({inputs:e,backend:t})=>{let{image:a}=e,n=t,r=new Ghe(a.shape);return n.runWebGPUProgram(r,[a],a.dtype)}},jhe=at({opType:le.FLOOR,cpuKernelImpl:yde}),qhe={kernelName:Li,backendName:"webgpu",kernelFunc:jhe},Xhe=ea({opType:_e.FLOOR_DIV,cpuKernelImpl:xde,dtype:"int32"}),Khe={kernelName:Wi,backendName:"webgpu",kernelFunc:Xhe},Yhe=class{constructor(e,t,a=!1){this.pixelsOpType=eu.FROM_PIXELS,this.outputShape=[0],this.variableNames=[],this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[t,1,1]),this.importVideo=a,this.shaderKey=`fromPixels_${this.importVideo}`}getUserCode(){let e=this.importVideo?"textureLoad(src, vec2(coords.yx));":"textureLoad(src, vec2(coords.yx), 0)";return` + `}},Cme={kernelName:uo,backendName:"webgpu",kernelFunc:({inputs:e,backend:t})=>{let{image:a}=e,n=t,r=new Tme(a.shape);return n.runWebGPUProgram(r,[a],a.dtype)}},Nme=at({opType:le.FLOOR,cpuKernelImpl:Qpe}),Rme={kernelName:ys,backendName:"webgpu",kernelFunc:Nme},Eme=aa({opType:De.FLOOR_DIV,cpuKernelImpl:ece,dtype:"int32"}),Mme={kernelName:xs,backendName:"webgpu",kernelFunc:Eme},Fme=class{constructor(e,t,a=!1){this.pixelsOpType=lu.FROM_PIXELS,this.outputShape=[0],this.variableNames=[],this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[t,1,1]),this.importVideo=a,this.shaderKey=`fromPixels_${this.importVideo}`}getUserCode(){let e=this.importVideo?"textureLoad(src, vec2(coords.yx));":"textureLoad(src, vec2(coords.yx), 0)";return` @binding(1) @group(0) var src: ${this.importVideo?"texture_external":"texture_2d"}; ${ue("index")} { let flatIndex = index * uniforms.numChannels; @@ -7491,7 +7491,7 @@ return a / b;`,vJ=` } } } - `}},Zhe={kernelName:Od,backendName:"webgpu",kernelFunc:Jhe},_l,Q2=B().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function Jhe(e){let{inputs:t,backend:a,attrs:n}=e,{pixels:r}=t,{numChannels:s}=n;if(r==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let i=typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement,o=typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement,l=typeof HTMLCanvasElement!="undefined"&&r instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&r instanceof OffscreenCanvas,u=typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap,[p,c]=i?[r.videoWidth,r.videoHeight]:[r.width,r.height],d=[c,p,s],h=B().getBool("WEBGPU_IMPORT_EXTERNAL_TEXTURE")&&i,m=i||o;if(u||l||m){let x;if(h)x=a.device.importExternalTexture({source:r});else{if(m){let _=B().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(_l==null||_!==Q2)&&(Q2=_,_l=document.createElement("canvas").getContext("2d",{willReadFrequently:Q2})),_l.canvas.width=p,_l.canvas.height=c,_l.drawImage(r,0,0,p,c),r=_l.canvas}let P=GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING,E="rgba8unorm",S=a.textureManager.acquireTexture(d[1],d[0],E,P);a.queue.copyExternalImageToTexture({source:r},{texture:S},[d[1],d[0]]),x=S}let A=v.sizeFromShape(d),b=v.computeStrides(d),w=new Yhe(d,s,h),I=[{type:"uint32",data:[A]},{type:"uint32",data:[s]},{type:"uint32",data:[...b]}],T=a.makeTensorInfo([c,p],"int32"),N=a.tensorMap.get(T.dataId);N.resource=x;let M=a.runWebGPUProgram(w,[T],"int32",I);return a.disposeData(T.dataId),M}let f=r.data,g=f;if(s!=null&&s!==4){g=new Uint8Array(r.width*r.height*s);let x=f.length,A=0;for(let b=0;b(xValue, -meanValue, offsetValue), vec3(inv, inv, 1.0))); } } - `}},e0e={kernelName:Bi,backendName:"webgpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n,scale:r,offset:s,mean:i,variance:o}=e,{varianceEpsilon:l}=t,u=a,p=[n,i,o],c=null;s!=null&&(c=s.shape,p.push(s));let d=null;r!=null&&(d=r.shape,p.push(r));let h=new Qhe(n.shape,i.shape,o.shape,c,d),m=[{type:"float32",data:[l]}];return u.runWebGPUProgram(h,p,n.dtype,m)}};function t0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d,activation:h,leakyreluAlpha:m}=n,f=C.convertConv2DDataFormat(p),g=C.computeConv2DInfo(r.shape,s.shape,l,c,u,d,!1,f);return Fk({x:r,filter:s,convInfo:g,backend:a,bias:i,preluActivationWeights:o,leakyreluAlpha:m,activation:h})}var a0e={kernelName:Zr,backendName:"webgpu",kernelFunc:t0e};function n0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:p,dimRoundingMode:c,activation:d,leakyreluAlpha:h}=n,m=p;m==null&&(m=[1,1]),v.assert(C.eitherStridesOrDilationsAreOne(l,m),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`);let f=C.computeConv2DInfo(r.shape,s.shape,l,m,u,c,!0),g=[r,s],y=i!=null,x=o!=null;y&&g.push(i),x&&g.push(o);let A=[{type:"int32",data:[f.padInfo.top,f.padInfo.left]},{type:"int32",data:[f.inHeight,f.inWidth]}],b;return f.outHeight>4&&f.outWidth>4&&f.strideWidth<=2&&f.inChannels===f.outChannels&&f.dilationHeight===1&&f.dilationWidth===1&&f.inChannels%4===0?(b=new Ok(f,y,d,x),A.push({type:"int32",data:[b.virtualWidth]})):(b=new zk(f,y,d,x),A.push({type:"int32",data:[f.filterHeight]},{type:"int32",data:[f.filterWidth]},{type:"int32",data:[f.strideHeight,f.strideWidth]},{type:"int32",data:[f.dilationHeight,f.dilationWidth]})),d==="leakyrelu"&&(A.push({type:"float32",data:[h]}),b.uniforms+=" alpha : f32,"),a.runWebGPUProgram(b,g,"float32",A)}var r0e={kernelName:Jr,backendName:"webgpu",kernelFunc:n0e},s0e=class{constructor(e,t){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`gathernd_${e}`,this.sliceDim=e,this.uniforms=`sliceDim : i32, strides : ${_t(e)},`}getUserCode(){let e;return this.sliceDim>1?e="uniforms.strides[j]":e="uniforms.strides",` + `}},_me={kernelName:po,backendName:"webgpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n,scale:r,offset:s,mean:i,variance:o}=e,{varianceEpsilon:l}=t,u=a,d=[n,i,o],c=null;s!=null&&(c=s.shape,d.push(s));let p=null;r!=null&&(p=r.shape,d.push(r));let h=new Pme(n.shape,i.shape,o.shape,c,p),m=[{type:"float32",data:[l]}];return u.runWebGPUProgram(h,d,n.dtype,m)}};function Ome(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dataFormat:d,dilations:c,dimRoundingMode:p,activation:h,leakyreluAlpha:m}=n,f=I.convertConv2DDataFormat(d),g=I.computeConv2DInfo(r.shape,s.shape,l,c,u,p,!1,f);return T9({x:r,filter:s,convInfo:g,backend:a,bias:i,preluActivationWeights:o,leakyreluAlpha:m,activation:h})}var zme={kernelName:as,backendName:"webgpu",kernelFunc:Ome};function Lme(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,filter:s,bias:i,preluActivationWeights:o}=t,{strides:l,pad:u,dilations:d,dimRoundingMode:c,activation:p,leakyreluAlpha:h}=n,m=d;m==null&&(m=[1,1]),v.assert(I.eitherStridesOrDilationsAreOne(l,m),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${l} and dilations '${m}'`);let f=I.computeConv2DInfo(r.shape,s.shape,l,m,u,c,!0),g=[r,s],y=i!=null,x=o!=null;y&&g.push(i),x&&g.push(o);let A=[{type:"int32",data:[f.padInfo.top,f.padInfo.left]},{type:"int32",data:[f.inHeight,f.inWidth]}],b;return f.outHeight>4&&f.outWidth>4&&f.strideWidth<=2&&f.inChannels===f.outChannels&&f.dilationHeight===1&&f.dilationWidth===1&&f.inChannels%4===0?(b=new N9(f,y,p,x),A.push({type:"int32",data:[b.virtualWidth]})):(b=new R9(f,y,p,x),A.push({type:"int32",data:[f.filterHeight]},{type:"int32",data:[f.filterWidth]},{type:"int32",data:[f.strideHeight,f.strideWidth]},{type:"int32",data:[f.dilationHeight,f.dilationWidth]})),p==="leakyrelu"&&(A.push({type:"float32",data:[h]}),b.uniforms+=" alpha : f32,"),a.runWebGPUProgram(b,g,"float32",A)}var Wme={kernelName:ns,backendName:"webgpu",kernelFunc:Lme},Bme=class{constructor(e,t){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`gathernd_${e}`,this.sliceDim=e,this.uniforms=`sliceDim : i32, strides : ${Dt(e)},`}getUserCode(){let e;return this.sliceDim>1?e="uniforms.strides[j]":e="uniforms.strides",` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7518,7 +7518,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, getA(flattenIndex, coords[1])); } } - `}};function i0e(e){let{inputs:t,backend:a}=e,{params:n,indices:r}=t,s=r.shape,i=s[s.length-1],o=v.sizeFromShape(n.shape),[l,u,p,c]=C.prepareAndValidate(n,r),d=ke({inputs:{x:r},backend:a,attrs:{shape:[u,i]}}),h=ke({inputs:{x:n},backend:a,attrs:{shape:[v.sizeFromShape(n.shape)/p,p]}});if(a.shouldExecuteOnCPU([n,r])||n.dtype==="string"){let x=a.readSync(r.dataId),A=a.bufferSync(n),b=Ade(x,A,n.dtype,u,i,p,c,n.shape,o);return a.makeTensorInfo(l,n.dtype,b.values)}let m=new s0e(i,[u,p]),f=[{type:"int32",data:[i]},{type:"int32",data:c}],g=a.runWebGPUProgram(m,[h,d],h.dtype,f),y=ke({inputs:{x:g},backend:a,attrs:{shape:l}});return a.disposeData(d.dataId),a.disposeData(h.dataId),a.disposeData(g.dataId),y}var o0e={kernelName:Vi,backendName:"webgpu",kernelFunc:i0e},l0e=class{constructor(e,t){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.slice(),this.aShape=e,this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="gather"}getUserCode(){let e=u0e(this.aShape);return` + `}};function Vme(e){let{inputs:t,backend:a}=e,{params:n,indices:r}=t,s=r.shape,i=s[s.length-1],o=v.sizeFromShape(n.shape),[l,u,d,c]=I.prepareAndValidate(n,r),p=ke({inputs:{x:r},backend:a,attrs:{shape:[u,i]}}),h=ke({inputs:{x:n},backend:a,attrs:{shape:[v.sizeFromShape(n.shape)/d,d]}});if(a.shouldExecuteOnCPU([n,r])||n.dtype==="string"){let x=a.readSync(r.dataId),A=a.bufferSync(n),b=tce(x,A,n.dtype,u,i,d,c,n.shape,o);return a.makeTensorInfo(l,n.dtype,b.values)}let m=new Bme(i,[u,d]),f=[{type:"int32",data:[i]},{type:"int32",data:c}],g=a.runWebGPUProgram(m,[h,p],h.dtype,f),y=ke({inputs:{x:g},backend:a,attrs:{shape:l}});return a.disposeData(p.dataId),a.disposeData(h.dataId),a.disposeData(g.dataId),y}var Ume={kernelName:co,backendName:"webgpu",kernelFunc:Vme},Gme=class{constructor(e,t){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.slice(),this.aShape=e,this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="gather"}getUserCode(){let e=Hme(this.aShape);return` ${ue("index")} { if (index < uniforms.size) { let resRC = getCoordsFromIndex(index); @@ -7527,13 +7527,13 @@ return a / b;`,vJ=` setOutputAtIndex(index, inBounds * getA(${e})); } } - `}};function u0e(e){let t=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[];for(let n=0;na.disposeData(T.dataId)),a.makeTensorInfo(u.outputShape,I.dtype,I.values)}let f=new l0e(d.shape,m),g=a.runWebGPUProgram(f,[d,h],d.dtype);c.push(g);let y=ke({inputs:{x:g},backend:a,attrs:{shape:u.outputShape}});return c.forEach(x=>a.disposeData(x.dataId)),y}var d0e={kernelName:xu,backendName:"webgpu",kernelFunc:Vk},p0e=ea({opType:_e.GREATER,cpuKernelImpl:wde,dtype:"bool"}),c0e={kernelName:Ui,backendName:"webgpu",kernelFunc:p0e},h0e=ea({opType:_e.GREATER_EQUAL,dtype:"bool",cpuKernelImpl:vde}),m0e={kernelName:Gi,backendName:"webgpu",kernelFunc:h0e};function f0e(e){let{inputs:t,backend:a}=e,{input:n}=t;return Bk(n,!0,a)}var g0e={kernelName:yp,backendName:"webgpu",kernelFunc:f0e},y0e=at({opType:le.IS_FINITE,dtype:"bool"}),x0e={kernelName:ji,backendName:"webgpu",kernelFunc:y0e},A0e=at({opType:le.IS_INF,dtype:"bool"}),b0e={kernelName:qi,backendName:"webgpu",kernelFunc:A0e},v0e=at({opType:le.IS_NAN,dtype:"bool"}),w0e={kernelName:Xi,backendName:"webgpu",kernelFunc:v0e};function k0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{alpha:s}=n,i=[{type:"float32",data:[s]}],o=new Ju(r.shape,le.LEAKYRELU,"alpha : f32,");return a.runWebGPUProgram(o,[r],"float32",i)}var I0e={kernelName:Ki,backendName:"webgpu",kernelFunc:k0e},S0e=ea({opType:_e.LESS,dtype:"bool",cpuKernelImpl:Ide}),C0e={kernelName:Yi,backendName:"webgpu",kernelFunc:S0e},T0e=ea({opType:_e.LESS_EQUAL,dtype:"bool",cpuKernelImpl:kde}),N0e={kernelName:Zi,backendName:"webgpu",kernelFunc:T0e},R0e=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms="start : f32, step : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="linSpace"}getUserCode(){return` + `}};function Hme(e){let t=["resRC.x","resRC.y","resRC.z","resRC.w"],a=[];for(let n=0;na.disposeData(C.dataId)),a.makeTensorInfo(u.outputShape,S.dtype,S.values)}let f=new Gme(p.shape,m),g=a.runWebGPUProgram(f,[p,h],p.dtype);c.push(g);let y=ke({inputs:{x:g},backend:a,attrs:{shape:u.outputShape}});return c.forEach(x=>a.disposeData(x.dataId)),y}var jme={kernelName:Su,backendName:"webgpu",kernelFunc:$9},qme=aa({opType:De.GREATER,cpuKernelImpl:rce,dtype:"bool"}),Xme={kernelName:As,backendName:"webgpu",kernelFunc:qme},Kme=aa({opType:De.GREATER_EQUAL,dtype:"bool",cpuKernelImpl:nce}),Yme={kernelName:bs,backendName:"webgpu",kernelFunc:Kme};function Zme(e){let{inputs:t,backend:a}=e,{input:n}=t;return F9(n,!0,a)}var Jme={kernelName:Tp,backendName:"webgpu",kernelFunc:Zme},Qme=at({opType:le.IS_FINITE,dtype:"bool"}),efe={kernelName:mo,backendName:"webgpu",kernelFunc:Qme},tfe=at({opType:le.IS_INF,dtype:"bool"}),afe={kernelName:fo,backendName:"webgpu",kernelFunc:tfe},nfe=at({opType:le.IS_NAN,dtype:"bool"}),rfe={kernelName:go,backendName:"webgpu",kernelFunc:nfe};function sfe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{alpha:s}=n,i=[{type:"float32",data:[s]}],o=new id(r.shape,le.LEAKYRELU,"alpha : f32,");return a.runWebGPUProgram(o,[r],"float32",i)}var ife={kernelName:yo,backendName:"webgpu",kernelFunc:sfe},ofe=aa({opType:De.LESS,dtype:"bool",cpuKernelImpl:ice}),lfe={kernelName:vs,backendName:"webgpu",kernelFunc:ofe},ufe=aa({opType:De.LESS_EQUAL,dtype:"bool",cpuKernelImpl:sce}),dfe={kernelName:ws,backendName:"webgpu",kernelFunc:ufe},pfe=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms="start : f32, step : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="linSpace"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { setOutputAtIndex(index, uniforms.start + f32(index) * uniforms.step); } } - `}};function E0e(e){let{backend:t,attrs:a}=e,{start:n,stop:r,num:s}=a,i=(r-n)/(s-1),o=new R0e(s),l=[{type:"float32",data:[n]},{type:"float32",data:[i]}];return t.runWebGPUProgram(o,[],"float32",l)}var M0e={kernelName:Ji,backendName:"webgpu",kernelFunc:E0e},P0e=at({opType:le.LOG,cpuKernelImpl:Sde}),_0e={kernelName:Qi,backendName:"webgpu",kernelFunc:P0e},$0e=at({opType:le.LOG1P}),F0e={kernelName:eo,backendName:"webgpu",kernelFunc:$0e},D0e=ea({opType:_e.LOGICAL_AND,dtype:"bool"}),O0e={kernelName:to,backendName:"webgpu",kernelFunc:D0e},z0e=at({opType:le.LOGICAL_NOT}),L0e={kernelName:ao,backendName:"webgpu",kernelFunc:z0e},W0e=ea({opType:_e.LOGICAL_OR}),B0e={kernelName:no,backendName:"webgpu",kernelFunc:W0e},Uk=` + `}};function cfe(e){let{backend:t,attrs:a}=e,{start:n,stop:r,num:s}=a,i=(r-n)/(s-1),o=new pfe(s),l=[{type:"float32",data:[n]},{type:"float32",data:[i]}];return t.runWebGPUProgram(o,[],"float32",l)}var hfe={kernelName:xo,backendName:"webgpu",kernelFunc:cfe},mfe=at({opType:le.LOG,cpuKernelImpl:oce}),ffe={kernelName:ks,backendName:"webgpu",kernelFunc:mfe},gfe=at({opType:le.LOG1P}),yfe={kernelName:Ao,backendName:"webgpu",kernelFunc:gfe},xfe=aa({opType:De.LOGICAL_AND,dtype:"bool"}),Afe={kernelName:bo,backendName:"webgpu",kernelFunc:xfe},bfe=at({opType:le.LOGICAL_NOT}),vfe={kernelName:vo,backendName:"webgpu",kernelFunc:bfe},wfe=aa({opType:De.LOGICAL_OR}),kfe={kernelName:wo,backendName:"webgpu",kernelFunc:wfe},D9=` var powValue = 0.0; let basis = uniforms.bias + uniforms.alpha * sum; if (uniforms.beta == 0.5) { @@ -7543,7 +7543,7 @@ return a / b;`,vJ=` } else { powValue = exp(log(basis) * (-uniforms.beta)); } -`,V0e=class{constructor(e){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn"}getUserCode(){return` +`,Ife=class{constructor(e){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -7561,12 +7561,12 @@ return a / b;`,vJ=` sum = sum + z * z; } } - ${Uk} + ${D9} setOutputAtIndex(index, x * powValue); } } - `}},U0e=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[256,1,1],this.maxAllowRadius=16,v.assert(t<=this.maxAllowRadius,()=>`Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${t}`),this.outputShape=e,this.elementsPerWorkgroup=this.workgroupSize[0]-2*this.maxAllowRadius,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,[this.elementsPerWorkgroup,this.workgroupSize[1],this.workgroupSize[2]]),this.shaderKey="lrn_shared"}getUserCode(){return` + `}},Sfe=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[256,1,1],this.maxAllowRadius=16,v.assert(t<=this.maxAllowRadius,()=>`Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${t}`),this.outputShape=e,this.elementsPerWorkgroup=this.workgroupSize[0]-2*this.maxAllowRadius,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=de(this.dispatchLayout,this.outputShape,[this.elementsPerWorkgroup,this.workgroupSize[1],this.workgroupSize[2]]),this.shaderKey="lrn_shared"}getUserCode(){return` var lrnSub: array; const elementsPerWorkgroup = ${this.elementsPerWorkgroup}; const maxAllowRadius = ${this.maxAllowRadius}; @@ -7594,11 +7594,11 @@ return a / b;`,vJ=` let z = lrnSub[index + i]; sum = sum + z * z; } - ${Uk} + ${D9} setOutputAtCoords(b, r, c, d, lrnSub[index] * powValue); } - } `}};function G0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n,u;s>16?u=new V0e(r.shape):u=new U0e(r.shape,s);let p=[{type:"int32",data:[s]},{type:"float32",data:[i]},{type:"float32",data:[o]},{type:"float32",data:[l]}];return a.runWebGPUProgram(u,[r],r.dtype,p)}var H0e={kernelName:ro,backendName:"webgpu",kernelFunc:G0e},j0e=class{constructor(e){this.outputShape=[],this.variableNames=["inputImage","outputImage","dy"],this.uniforms="depthRadius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn_grad"}getUserCode(){return` + } `}};function Tfe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{depthRadius:s,bias:i,alpha:o,beta:l}=n,u;s>16?u=new Ife(r.shape):u=new Sfe(r.shape,s);let d=[{type:"int32",data:[s]},{type:"float32",data:[i]},{type:"float32",data:[o]},{type:"float32",data:[l]}];return a.runWebGPUProgram(u,[r],r.dtype,d)}var Cfe={kernelName:ko,backendName:"webgpu",kernelFunc:Tfe},Nfe=class{constructor(e){this.outputShape=[],this.variableNames=["inputImage","outputImage","dy"],this.uniforms="depthRadius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn_grad"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -7648,7 +7648,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, result); } } - `}};function q0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:p}=n,c=new j0e(r.shape),d=[{type:"int32",data:[o]},{type:"float32",data:[l]},{type:"float32",data:[u]},{type:"float32",data:[p]}];return a.runWebGPUProgram(c,[r,s,i],r.dtype,d)}var X0e={kernelName:Au,backendName:"webgpu",kernelFunc:q0e},K0e=ea({opType:_e.MAX,cpuKernelImpl:Tde}),Y0e={kernelName:io,backendName:"webgpu",kernelFunc:K0e};function Z0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=1,p=C.computePool2DInfo(r.shape,s,i,u,o,l);return Mk(r,p,"max",a)}var J0e={kernelName:oo,backendName:"webgpu",kernelFunc:Z0e};function Q0e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=n,p=[1,1,1],c=C.computePool3DInfo(r.shape,s,i,p,o,u,l),d=new Y3(c,"max"),h=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.inDepth,c.inHeight,c.inWidth]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return a.runWebGPUProgram(d,[r],r.dtype,h)}var eme={kernelName:bu,backendName:"webgpu",kernelFunc:Q0e},tme=class{constructor(e){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, + `}};function Rfe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,y:s,dy:i}=t,{depthRadius:o,bias:l,alpha:u,beta:d}=n,c=new Nfe(r.shape),p=[{type:"int32",data:[o]},{type:"float32",data:[l]},{type:"float32",data:[u]},{type:"float32",data:[d]}];return a.runWebGPUProgram(c,[r,s,i],r.dtype,p)}var Efe={kernelName:Tu,backendName:"webgpu",kernelFunc:Rfe},Mfe=aa({opType:De.MAX,cpuKernelImpl:uce}),Ffe={kernelName:Is,backendName:"webgpu",kernelFunc:Mfe};function $fe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dimRoundingMode:l}=n,u=I.computePool2DInfo(r.shape,s,i,1,o,l);return w9(r,u,"max",a)}var Dfe={kernelName:So,backendName:"webgpu",kernelFunc:$fe};function Pfe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{filterSize:s,strides:i,pad:o,dataFormat:l,dimRoundingMode:u}=n,d=[1,1,1],c=I.computePool3DInfo(r.shape,s,i,d,o,u,l),p=new uy(c,"max"),h=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.inDepth,c.inHeight,c.inWidth]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return a.runWebGPUProgram(p,[r],r.dtype,h)}var _fe={kernelName:Cu,backendName:"webgpu",kernelFunc:Pfe},Ofe=class{constructor(e){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool2DBackprop"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -7693,7 +7693,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}},ame=class{constructor(e){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, + `}},zfe=class{constructor(e){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, outDepth : i32, outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool3DBackprop"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -7751,7 +7751,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, dotProd); } } - `}};function nme(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:p}=n,c=[1,1,1],d=C.computePool3DInfo(i.shape,o,l,c,u,p),h=new Y3(d,"max",!0),m=[{type:"int32",data:[d.strideDepth,d.strideHeight,d.strideWidth]},{type:"int32",data:[d.padInfo.front,d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.inDepth,d.inHeight,d.inWidth]},{type:"int32",data:[d.effectiveFilterDepth,d.effectiveFilterHeight,d.effectiveFilterWidth]}],f=a.runWebGPUProgram(h,[i],"int32",m),g=new ame(d);m=[{type:"int32",data:[d.strideDepth,d.strideHeight,d.strideWidth]},{type:"int32",data:[d.effectiveFilterDepth-1-d.padInfo.front,d.effectiveFilterHeight-1-d.padInfo.top,d.effectiveFilterWidth-1-d.padInfo.left]},{type:"int32",data:[d.effectiveFilterDepth,d.effectiveFilterHeight,d.effectiveFilterWidth]},{type:"int32",data:[d.outDepth]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]}];let y=a.runWebGPUProgram(g,[r,f],i.dtype,m);return a.disposeData(f.dataId),y}var rme={kernelName:bp,backendName:"webgpu",kernelFunc:nme};function sme(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s,output:i}=t,o=s;j3([s,i],"maxPoolGrad");let{filterSize:l,strides:u,pad:p,dimRoundingMode:c}=n,d=C.computePool2DInfo(o.shape,l,u,1,p,c),h=new ap(d,"max",!0),m=[{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]},{type:"int32",data:[d.inHeight,d.inWidth]},{type:"int32",data:[d.effectiveFilterHeight,d.effectiveFilterWidth]}],f=a.runWebGPUProgram(h,[o],"int32",m),g=new tme(d);m=[{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.effectiveFilterHeight-1-d.padInfo.top,d.effectiveFilterWidth-1-d.padInfo.left]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]},{type:"int32",data:[d.effectiveFilterHeight,d.effectiveFilterWidth]},{type:"int32",data:[d.outHeight]},{type:"int32",data:[d.outWidth]}];let y=a.runWebGPUProgram(g,[r,f],o.dtype,m);return a.disposeData(f.dataId),y}var ime={kernelName:Ap,backendName:"webgpu",kernelFunc:sme};function ome(e){let{inputs:t,backend:a,attrs:n}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=n,{x:l}=t;v.assert(l.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${l.shape.length}.`);let u=[1,1];v.assert(C.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let p=C.computePool2DInfo(l.shape,r,s,u,i),c=[{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.padInfo.top,p.padInfo.left]},{type:"int32",data:[p.dilationHeight,p.dilationWidth]},{type:"int32",data:[p.inHeight,p.inWidth]},{type:"int32",data:[p.effectiveFilterHeight,p.effectiveFilterWidth]}],d=new ap(p,"max",!1),h=a.runWebGPUProgram(d,[l],l.dtype,c);d=new ap(p,"max",!0,!0,o);let m=a.runWebGPUProgram(d,[l],"int32",c);return[h,m]}var lme={kernelName:vu,backendName:"webgpu",kernelFunc:ome};function ume(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;return ol(r,s,i,"min",a)}var dme={kernelName:uo,backendName:"webgpu",kernelFunc:ume},pme=ea({opType:_e.MIN,cpuKernelImpl:Nde}),cme={kernelName:po,backendName:"webgpu",kernelFunc:pme},hme=class{constructor(e,t,a){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((n,r)=>n[0]+e[r]+n[1]),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.xShape=e,t.map((n,r)=>{this.uniforms+=` pad${r} : vec2,`}),this.offset=a==="reflect"?0:1,this.shaderKey=`mirrorPad_${a}`}getUserCode(){let e=this.xShape.length,t=this.xShape.map((l,u)=>`uniforms.pad${u}[0]`).join(","),a=this.xShape.map((l,u)=>`uniforms.pad${u}[0] + uniforms.xShape${e>1?`[${u}]`:""}`).join(","),n=e===1?"start":"start[i]",r=e===1?"end":"end[i]",s=e===1?"outC":"outC[i]",i=_t(e),o=e>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,e):"coords";return` + `}};function Lfe(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s}=t,i=s,{filterSize:o,strides:l,pad:u,dimRoundingMode:d}=n,c=[1,1,1],p=I.computePool3DInfo(i.shape,o,l,c,u,d),h=new uy(p,"max",!0),m=[{type:"int32",data:[p.strideDepth,p.strideHeight,p.strideWidth]},{type:"int32",data:[p.padInfo.front,p.padInfo.top,p.padInfo.left]},{type:"int32",data:[p.inDepth,p.inHeight,p.inWidth]},{type:"int32",data:[p.effectiveFilterDepth,p.effectiveFilterHeight,p.effectiveFilterWidth]}],f=a.runWebGPUProgram(h,[i],"int32",m),g=new zfe(p);m=[{type:"int32",data:[p.strideDepth,p.strideHeight,p.strideWidth]},{type:"int32",data:[p.effectiveFilterDepth-1-p.padInfo.front,p.effectiveFilterHeight-1-p.padInfo.top,p.effectiveFilterWidth-1-p.padInfo.left]},{type:"int32",data:[p.effectiveFilterDepth,p.effectiveFilterHeight,p.effectiveFilterWidth]},{type:"int32",data:[p.outDepth]},{type:"int32",data:[p.outHeight]},{type:"int32",data:[p.outWidth]}];let y=a.runWebGPUProgram(g,[r,f],i.dtype,m);return a.disposeData(f.dataId),y}var Wfe={kernelName:Rp,backendName:"webgpu",kernelFunc:Lfe};function Bfe(e){let{inputs:t,backend:a,attrs:n}=e,{dy:r,input:s,output:i}=t,o=s;ay([s,i],"maxPoolGrad");let{filterSize:l,strides:u,pad:d,dimRoundingMode:c}=n,p=I.computePool2DInfo(o.shape,l,u,1,d,c),h=new pp(p,"max",!0),m=[{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.padInfo.top,p.padInfo.left]},{type:"int32",data:[p.dilationHeight,p.dilationWidth]},{type:"int32",data:[p.inHeight,p.inWidth]},{type:"int32",data:[p.effectiveFilterHeight,p.effectiveFilterWidth]}],f=a.runWebGPUProgram(h,[o],"int32",m),g=new Ofe(p);m=[{type:"int32",data:[p.strideHeight,p.strideWidth]},{type:"int32",data:[p.effectiveFilterHeight-1-p.padInfo.top,p.effectiveFilterWidth-1-p.padInfo.left]},{type:"int32",data:[p.dilationHeight,p.dilationWidth]},{type:"int32",data:[p.effectiveFilterHeight,p.effectiveFilterWidth]},{type:"int32",data:[p.outHeight]},{type:"int32",data:[p.outWidth]}];let y=a.runWebGPUProgram(g,[r,f],o.dtype,m);return a.disposeData(f.dataId),y}var Vfe={kernelName:Np,backendName:"webgpu",kernelFunc:Bfe};function Ufe(e){let{inputs:t,backend:a,attrs:n}=e,{filterSize:r,strides:s,pad:i,includeBatchInIndex:o}=n,{x:l}=t;v.assert(l.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${l.shape.length}.`);let u=[1,1];v.assert(I.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let d=I.computePool2DInfo(l.shape,r,s,u,i),c=[{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]},{type:"int32",data:[d.inHeight,d.inWidth]},{type:"int32",data:[d.effectiveFilterHeight,d.effectiveFilterWidth]}],p=new pp(d,"max",!1),h=a.runWebGPUProgram(p,[l],l.dtype,c);p=new pp(d,"max",!0,!0,o);let m=a.runWebGPUProgram(p,[l],"int32",c);return[h,m]}var Gfe={kernelName:Nu,backendName:"webgpu",kernelFunc:Ufe};function Hfe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;return gl(r,s,i,"min",a)}var jfe={kernelName:Co,backendName:"webgpu",kernelFunc:Hfe},qfe=aa({opType:De.MIN,cpuKernelImpl:dce}),Xfe={kernelName:Ss,backendName:"webgpu",kernelFunc:qfe},Kfe=class{constructor(e,t,a){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((n,r)=>n[0]+e[r]+n[1]),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.xShape=e,t.map((n,r)=>{this.uniforms+=` pad${r} : vec2,`}),this.offset=a==="reflect"?0:1,this.shaderKey=`mirrorPad_${a}`}getUserCode(){let e=this.xShape.length,t=this.xShape.map((l,u)=>`uniforms.pad${u}[0]`).join(","),a=this.xShape.map((l,u)=>`uniforms.pad${u}[0] + uniforms.xShape${e>1?`[${u}]`:""}`).join(","),n=e===1?"start":"start[i]",r=e===1?"end":"end[i]",s=e===1?"outC":"outC[i]",i=Dt(e),o=e>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,e):"coords";return` ${ue("index")} { if (index < uniforms.size) { let start = ${i}(${t}); @@ -7768,7 +7768,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, getX(${o})); } } - `}},mme={kernelName:co,backendName:"webgpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n}=e,{paddings:r,mode:s}=t,i=a,o=r.map(u=>({type:"int32",data:[u[0],u[1]]})),l=new hme(n.shape,r,s);return i.runWebGPUProgram(l,[n],n.dtype,o)}},fme=ea({opType:_e.MOD}),gme={kernelName:ho,backendName:"webgpu",kernelFunc:fme},yme=class{constructor(e,t){this.variableNames=["probs"],this.outputShape=[],this.uniforms="seed : f32, numOutcomes: i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="multinomial"}getUserCode(){return` + `}},Yfe={kernelName:No,backendName:"webgpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{x:n}=e,{paddings:r,mode:s}=t,i=a,o=r.map(u=>({type:"int32",data:[u[0],u[1]]})),l=new Kfe(n.shape,r,s);return i.runWebGPUProgram(l,[n],n.dtype,o)}},Zfe=aa({opType:De.MOD}),Jfe={kernelName:Ro,backendName:"webgpu",kernelFunc:Zfe},Qfe=class{constructor(e,t){this.variableNames=["probs"],this.outputShape=[],this.uniforms="seed : f32, numOutcomes: i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="multinomial"}getUserCode(){return` //Based on the work of Dave Hoskins //https://www.shadertoy.com/view/4djSRW fn random (seed : f32, resultUV : vec2) -> f32 { @@ -7801,7 +7801,7 @@ return a / b;`,vJ=` setOutputAtIndexI32(index, uniforms.numOutcomes - 1); } } - `}},xme=class{constructor(e){this.variableNames=["logits"],this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=[this.outputShape[0],1,1],this.outputShape[1]>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.shaderKey="softmax"}getUserCode(){return` + `}},e2e=class{constructor(e){this.variableNames=["logits"],this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=[this.outputShape[0],1,1],this.outputShape[1]>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.shaderKey="softmax"}getUserCode(){return` var buf : array; var rowMaxShared : f32; var rowSumShared : f32; @@ -7860,7 +7860,7 @@ return a / b;`,vJ=` setOutputAtCoords(row, col, value); } } - `}};function Gk(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{dim:s}=n,i=ke({inputs:{x:r},backend:a,attrs:{shape:[v.sizeFromShape(r.shape)/r.shape[s],r.shape[s]]}}),o=new xme(i.shape),l=a.runWebGPUProgram(o,[i],r.dtype),u=ke({inputs:{x:l},backend:a,attrs:{shape:r.shape}});return a.disposeData(i.dataId),a.disposeData(l.dataId),u}var Ame={kernelName:Uo,backendName:"webgpu",kernelFunc:Gk};function bme(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n,l=o?r:Gk({inputs:{logits:r},backend:a,attrs:{dim:r.shape.length-1}}),u=l.shape[0],p=l.shape[1],c=new yme(u,s),d=[{type:"float32",data:[i]},{type:"int32",data:[p]}],h=a.runWebGPUProgram(c,[l],"int32",d);return o||a.disposeData(l.dataId),h}var vme={kernelName:mo,backendName:"webgpu",kernelFunc:bme};function wme(e){let{inputs:t,backend:a}=e,{x:n}=t;if(a.shouldExecuteOnCPU([n])){let s=a.tensorMap.get(n.dataId),[i,o]=Ede(s.values,n.shape,n.dtype);return a.makeTensorInfo(o,n.dtype,i)}let r=new Ju(n.shape,le.NEG);return a.runWebGPUProgram(r,[n],n.dtype)}var kme={kernelName:wu,backendName:"webgpu",kernelFunc:wme};function Ime(e){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=n,u=a.readSync(r.dataId),p=a.readSync(s.dataId),{selectedIndices:c}=Rn.nonMaxSuppressionV3Impl(u,p,i,o,l);return a.makeTensorInfo([c.length],"int32",new Int32Array(c))}var Sme={kernelName:yo,backendName:"webgpu",kernelFunc:Ime};function Cme(e){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=n,p=a.readSync(r.dataId),c=a.readSync(s.dataId),d=i,h=o,m=l,f=u,{selectedIndices:g,selectedScores:y}=Rn.nonMaxSuppressionV5Impl(p,c,d,h,m,f);return[a.makeTensorInfo([g.length],"int32",new Int32Array(g)),a.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var Tme={kernelName:xo,backendName:"webgpu",kernelFunc:Cme},Nme=class{constructor(e,t){this.variableNames=["x"],this.uniforms="onValue : f32, offValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="onehot"}getUserCode(){return` + `}};function P9(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{dim:s}=n,i=ke({inputs:{x:r},backend:a,attrs:{shape:[v.sizeFromShape(r.shape)/r.shape[s],r.shape[s]]}}),o=new e2e(i.shape),l=a.runWebGPUProgram(o,[i],r.dtype),u=ke({inputs:{x:l},backend:a,attrs:{shape:r.shape}});return a.disposeData(i.dataId),a.disposeData(l.dataId),u}var t2e={kernelName:el,backendName:"webgpu",kernelFunc:P9};function a2e(e){let{inputs:t,backend:a,attrs:n}=e,{logits:r}=t,{numSamples:s,seed:i,normalized:o}=n,l=o?r:P9({inputs:{logits:r},backend:a,attrs:{dim:r.shape.length-1}}),u=l.shape[0],d=l.shape[1],c=new Qfe(u,s),p=[{type:"float32",data:[i]},{type:"int32",data:[d]}],h=a.runWebGPUProgram(c,[l],"int32",p);return o||a.disposeData(l.dataId),h}var n2e={kernelName:Eo,backendName:"webgpu",kernelFunc:a2e};function r2e(e){let{inputs:t,backend:a}=e,{x:n}=t;if(a.shouldExecuteOnCPU([n])){let s=a.tensorMap.get(n.dataId),[i,o]=cce(s.values,n.shape,n.dtype);return a.makeTensorInfo(o,n.dtype,i)}let r=new id(n.shape,le.NEG);return a.runWebGPUProgram(r,[n],n.dtype)}var s2e={kernelName:Ru,backendName:"webgpu",kernelFunc:r2e};function i2e(e){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l}=n,u=a.readSync(r.dataId),d=a.readSync(s.dataId),{selectedIndices:c}=Fn.nonMaxSuppressionV3Impl(u,d,i,o,l);return a.makeTensorInfo([c.length],"int32",new Int32Array(c))}var o2e={kernelName:Mo,backendName:"webgpu",kernelFunc:i2e};function l2e(e){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:a,attrs:n}=e,{boxes:r,scores:s}=t,{maxOutputSize:i,iouThreshold:o,scoreThreshold:l,softNmsSigma:u}=n,d=a.readSync(r.dataId),c=a.readSync(s.dataId),p=i,h=o,m=l,f=u,{selectedIndices:g,selectedScores:y}=Fn.nonMaxSuppressionV5Impl(d,c,p,h,m,f);return[a.makeTensorInfo([g.length],"int32",new Int32Array(g)),a.makeTensorInfo([y.length],"float32",new Float32Array(y))]}var u2e={kernelName:Fo,backendName:"webgpu",kernelFunc:l2e},d2e=class{constructor(e,t){this.variableNames=["x"],this.uniforms="onValue : f32, offValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="onehot"}getUserCode(){return` ${ue("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7868,23 +7868,23 @@ return a / b;`,vJ=` f32(i32(round(getX(coords.x))) == coords.y))); } } - `}};function Rme(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r}=t,{dtype:s,depth:i,onValue:o,offValue:l}=n,u=v.sizeFromShape(r.shape),p=new Nme(u,i),c=ke({inputs:{x:r},backend:a,attrs:{shape:[u]}}),d=[{type:"float32",data:[o]},{type:"float32",data:[l]}],h=a.runWebGPUProgram(p,[c],s,d);a.disposeData(c.dataId);let m=[...r.shape,i],f=ke({inputs:{x:h},backend:a,attrs:{shape:m}});return a.disposeData(h.dataId),f}var Eme={kernelName:Ao,backendName:"webgpu",kernelFunc:Rme};function Nh(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="complex64"){let r=Qp({inputs:{input:n},backend:a}),s=Nh({inputs:{x:r},backend:a}),i=c0({inputs:{input:n},backend:a}),o=Nh({inputs:{x:i},backend:a}),l=il({inputs:{real:s,imag:o},backend:a});return a.disposeData(r.dataId),a.disposeData(s.dataId),a.disposeData(i.dataId),a.disposeData(o.dataId),l}else return Wa({attrs:{shape:n.shape,dtype:n.dtype,value:n.dtype==="string"?"":0},backend:a})}var Mme={kernelName:Lu,backendName:"webgpu",kernelFunc:Nh};function Hk(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(n.dtype==="complex64"){let r=Qp({inputs:{input:n},backend:a}),s=Hk({inputs:{x:r},backend:a}),i=c0({inputs:{input:n},backend:a}),o=Nh({inputs:{x:i},backend:a}),l=il({inputs:{real:s,imag:o},backend:a});return a.disposeData(r.dataId),a.disposeData(s.dataId),a.disposeData(i.dataId),a.disposeData(o.dataId),l}else return Wa({attrs:{shape:n.shape,dtype:n.dtype,value:1},backend:a})}var Pme={kernelName:Iu,backendName:"webgpu",kernelFunc:Hk};function _me(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n;if(t.length===1)return K1({inputs:{input:t[0]},backend:a,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(p=>{v.assertShapesMatch(s,p.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===p.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(p=>{let c=K1({inputs:{input:p},backend:a,attrs:{dim:r}});return o.push(c),c}),u=$k({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(p=>a.disposeData(p.dataId)),u}var $me={kernelName:Su,backendName:"webgpu",kernelFunc:_me};function jk(e,t=!1){let a=e.length,n=_t(a),r=e.map((c,d)=>`uniforms.pad${d}[0]`).join(","),s=e.map((c,d)=>`uniforms.pad${d}[0] + uniforms.xShape${a>1?`[${d}]`:""}`).join(","),i=a>1?`${n}(${r})`:`${r}`,o=a>1?`${n}(${s})`:`${s}`,l=a>1?"any(paddedCoords < start)":"paddedCoords < start",u=a>1?"any(paddedCoords >= end)":"paddedCoords >= end",p=a>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a):"coords";return` + `}};function p2e(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r}=t,{dtype:s,depth:i,onValue:o,offValue:l}=n,u=v.sizeFromShape(r.shape),d=new d2e(u,i),c=ke({inputs:{x:r},backend:a,attrs:{shape:[u]}}),p=[{type:"float32",data:[o]},{type:"float32",data:[l]}],h=a.runWebGPUProgram(d,[c],s,p);a.disposeData(c.dataId);let m=[...r.shape,i],f=ke({inputs:{x:h},backend:a,attrs:{shape:m}});return a.disposeData(h.dataId),f}var c2e={kernelName:$o,backendName:"webgpu",kernelFunc:p2e};function _h(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="complex64"){let r=oc({inputs:{input:n},backend:a}),s=_h({inputs:{x:r},backend:a}),i=A0({inputs:{input:n},backend:a}),o=_h({inputs:{x:i},backend:a}),l=fl({inputs:{real:s,imag:o},backend:a});return a.disposeData(r.dataId),a.disposeData(s.dataId),a.disposeData(i.dataId),a.disposeData(o.dataId),l}else return Wa({attrs:{shape:n.shape,dtype:n.dtype,value:n.dtype==="string"?"":0},backend:a})}var h2e={kernelName:qu,backendName:"webgpu",kernelFunc:_h};function _9(e){let{inputs:t,backend:a}=e,{x:n}=t;if(n.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(n.dtype==="complex64"){let r=oc({inputs:{input:n},backend:a}),s=_9({inputs:{x:r},backend:a}),i=A0({inputs:{input:n},backend:a}),o=_h({inputs:{x:i},backend:a}),l=fl({inputs:{real:s,imag:o},backend:a});return a.disposeData(r.dataId),a.disposeData(s.dataId),a.disposeData(i.dataId),a.disposeData(o.dataId),l}else return Wa({attrs:{shape:n.shape,dtype:n.dtype,value:1},backend:a})}var m2e={kernelName:Mu,backendName:"webgpu",kernelFunc:_9};function f2e(e){let{inputs:t,backend:a,attrs:n}=e,{axis:r}=n;if(t.length===1)return rg({inputs:{input:t[0]},backend:a,attrs:{dim:r}});let s=t[0].shape,i=t[0].dtype;t.forEach(d=>{v.assertShapesMatch(s,d.shape,"All tensors passed to stack must have matching shapes"),v.assert(i===d.dtype,()=>"All tensors passed to stack must have matching dtypes")});let o=[],l=t.map(d=>{let c=rg({inputs:{input:d},backend:a,attrs:{dim:r}});return o.push(c),c}),u=S9({inputs:l,backend:a,attrs:{axis:r}});return o.forEach(d=>a.disposeData(d.dataId)),u}var g2e={kernelName:Fu,backendName:"webgpu",kernelFunc:f2e};function O9(e,t=!1){let a=e.length,n=Dt(a),r=e.map((c,p)=>`uniforms.pad${p}[0]`).join(","),s=e.map((c,p)=>`uniforms.pad${p}[0] + uniforms.xShape${a>1?`[${p}]`:""}`).join(","),i=a>1?`${n}(${r})`:`${r}`,o=a>1?`${n}(${s})`:`${s}`,l=a>1?"any(paddedCoords < start)":"paddedCoords < start",u=a>1?"any(paddedCoords >= end)":"paddedCoords >= end",d=a>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,a):"coords";return` let start = ${i}; let end = ${o}; if (${l} || ${u}) { setOutputAtIndex(index, ${t?0:"uniforms.constantValue"}); } else { let coords = paddedCoords - start; - setOutputAtIndex(index, getX(${p})); + setOutputAtIndex(index, getX(${d})); } - `}var Fme=class{constructor(e,t){this.variableNames=["x"],this.uniforms="constantValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((a,n)=>a[0]+e[n]+a[1]),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),t.map((a,n)=>{this.uniforms+=` pad${n} : vec2,`}),this.xShape=e,this.shaderKey="pad"}getUserCode(){return` + `}var y2e=class{constructor(e,t){this.variableNames=["x"],this.uniforms="constantValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((a,n)=>a[0]+e[n]+a[1]),this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),t.map((a,n)=>{this.uniforms+=` pad${n} : vec2,`}),this.xShape=e,this.shaderKey="pad"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let paddedCoords = getCoordsFromIndex(index); - ${jk(this.xShape)} + ${O9(this.xShape)} } } - `}},Dme=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{paddings:s,constantValue:i}=n;if(s.every(u=>v.arraysEqual(u,[0,0])))return en({inputs:{x:r},backend:a});if(v.sizeFromShape(r.shape)===0){let u=s.map((p,c)=>p[0]+r.shape[c]+p[1]);return Wa({backend:a,attrs:{shape:u,value:i,dtype:r.dtype}})}let o=[{type:"float32",data:[i]}];s.map(u=>o.push({type:"int32",data:[u[0],u[1]]}));let l=new Fme(r.shape,s);return a.runWebGPUProgram(l,[r],r.dtype,o)},Ome={kernelName:bo,backendName:"webgpu",kernelFunc:Dme},zme=ea({opType:_e.POW}),Lme={kernelName:vo,backendName:"webgpu",kernelFunc:zme};function Wme(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t,s=new Ch(_e.PRELU,n.shape,r.shape);return a.runWebGPUProgram(s,[n,r],"float32")}var Bme={kernelName:wo,backendName:"webgpu",kernelFunc:Wme};function Vme(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;return ol(r,s,i,"prod",a)}var Ume={kernelName:ko,backendName:"webgpu",kernelFunc:Vme},Gme=e=>{let{backend:t,attrs:a}=e,{start:n,stop:r,step:s,dtype:i}=a,o=_de(n,r,s,i);return t.makeTensorInfo([o.length],i,o)},Hme={kernelName:Cu,backendName:"webgpu",kernelFunc:Gme},jme=ea({opType:_e.DIV}),qme={kernelName:Pi,backendName:"webgpu",kernelFunc:jme},Xme=at({opType:le.RECIPROCAL}),Kme={kernelName:Io,backendName:"webgpu",kernelFunc:Xme},Yme=at({opType:le.RELU}),Zme={kernelName:So,backendName:"webgpu",kernelFunc:Yme},Jme=at({opType:le.RELU6}),Qme={kernelName:No,backendName:"webgpu",kernelFunc:Jme},efe=class{constructor(e,t,a){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, halfPixelCenters : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,a,e[3]],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="resizeBilinear"}getUserCode(){return` + `}},x2e=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{paddings:s,constantValue:i}=n;if(s.every(u=>v.arraysEqual(u,[0,0])))return an({inputs:{x:r},backend:a});if(v.sizeFromShape(r.shape)===0){let u=s.map((d,c)=>d[0]+r.shape[c]+d[1]);return Wa({backend:a,attrs:{shape:u,value:i,dtype:r.dtype}})}let o=[{type:"float32",data:[i]}];s.map(u=>o.push({type:"int32",data:[u[0],u[1]]}));let l=new y2e(r.shape,s);return a.runWebGPUProgram(l,[r],r.dtype,o)},A2e={kernelName:Do,backendName:"webgpu",kernelFunc:x2e},b2e=aa({opType:De.POW}),v2e={kernelName:Po,backendName:"webgpu",kernelFunc:b2e};function w2e(e){let{inputs:t,backend:a}=e,{x:n,alpha:r}=t,s=new $h(De.PRELU,n.shape,r.shape);return a.runWebGPUProgram(s,[n,r],"float32")}var k2e={kernelName:_o,backendName:"webgpu",kernelFunc:w2e};function I2e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{axis:s,keepDims:i}=n;return gl(r,s,i,"prod",a)}var S2e={kernelName:Oo,backendName:"webgpu",kernelFunc:I2e},T2e=e=>{let{backend:t,attrs:a}=e,{start:n,stop:r,step:s,dtype:i}=a,o=fce(n,r,s,i);return t.makeTensorInfo([o.length],i,o)},C2e={kernelName:$u,backendName:"webgpu",kernelFunc:T2e},N2e=aa({opType:De.DIV}),R2e={kernelName:io,backendName:"webgpu",kernelFunc:N2e},E2e=at({opType:le.RECIPROCAL}),M2e={kernelName:zo,backendName:"webgpu",kernelFunc:E2e},F2e=at({opType:le.RELU}),$2e={kernelName:Lo,backendName:"webgpu",kernelFunc:F2e},D2e=at({opType:le.RELU6}),P2e={kernelName:Vo,backendName:"webgpu",kernelFunc:D2e},_2e=class{constructor(e,t,a){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, halfPixelCenters : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,a,e[3]],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="resizeBilinear"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7927,7 +7927,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, newValue); } } - `}};function tfe(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,size:i,halfPixelCenters:o}=n,[l,u]=i,p=s&&l>1?1:0,c=s&&u>1?1:0,d=[{type:"float32",data:[p,c]},{type:"float32",data:[o?.5:0]}],h=new efe(r.shape,l,u);return a.runWebGPUProgram(h,[r],"float32",d)}var afe={kernelName:To,backendName:"webgpu",kernelFunc:tfe},nfe=class{constructor(e,t){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32, + `}};function O2e(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,size:i,halfPixelCenters:o}=n,[l,u]=i,d=s&&l>1?1:0,c=s&&u>1?1:0,p=[{type:"float32",data:[d,c]},{type:"float32",data:[o?.5:0]}],h=new _2e(r.shape,l,u);return a.runWebGPUProgram(h,[r],"float32",p)}var z2e={kernelName:Bo,backendName:"webgpu",kernelFunc:O2e},L2e=class{constructor(e,t){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32, invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=t,this.shaderKey=`resizeBilinearBackprop_${t}`}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -8002,7 +8002,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, accumulator); } } - `}};function rfe(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,[,o,l]=r.shape,[,u,p]=s.shape,c=[i&&u>1?o-1:o,i&&p>1?l-1:l],d=[i&&u>1?u-1:u,i&&p>1?p-1:p],h=c[0]/d[0],m=c[1]/d[1],f=1/h,g=1/m,y=Math.ceil(f)*2+2,x=Math.ceil(g)*2+2,A=new nfe(r.shape,i),b=[{type:"int32",data:c},{type:"int32",data:d},{type:"float32",data:[h]},{type:"float32",data:[m]},{type:"float32",data:[f]},{type:"float32",data:[g]},{type:"int32",data:[y]},{type:"int32",data:[x]}];return a.runWebGPUProgram(A,[s],s.dtype,b)}var sfe={kernelName:Ru,backendName:"webgpu",kernelFunc:rfe},ife=class{constructor(e,t,a,n){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, roundBase : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,a,e[3]],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.halfPixelCenters=n,this.shaderKey=`resizeNearest_${n}`}getUserCode(){let e;return this.halfPixelCenters?e="max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":e="vec2(rc) * effectiveInputOverOutputRatioRC",` + `}};function W2e(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,[,o,l]=r.shape,[,u,d]=s.shape,c=[i&&u>1?o-1:o,i&&d>1?l-1:l],p=[i&&u>1?u-1:u,i&&d>1?d-1:d],h=c[0]/p[0],m=c[1]/p[1],f=1/h,g=1/m,y=Math.ceil(f)*2+2,x=Math.ceil(g)*2+2,A=new L2e(r.shape,i),b=[{type:"int32",data:c},{type:"int32",data:p},{type:"float32",data:[h]},{type:"float32",data:[m]},{type:"float32",data:[f]},{type:"float32",data:[g]},{type:"int32",data:[y]},{type:"int32",data:[x]}];return a.runWebGPUProgram(A,[s],s.dtype,b)}var B2e={kernelName:_u,backendName:"webgpu",kernelFunc:W2e},V2e=class{constructor(e,t,a,n){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, roundBase : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,a,e[3]],this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.halfPixelCenters=n,this.shaderKey=`resizeNearest_${n}`}getUserCode(){let e;return this.halfPixelCenters?e="max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":e="vec2(rc) * effectiveInputOverOutputRatioRC",` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -8033,7 +8033,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, newValue); } } - `}};function ofe(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,p=s&&l>1?1:0,c=s&&u>1?1:0,d=[{type:"float32",data:[p,c]},{type:"float32",data:[s?.5:0]}],h=new ife(r.shape,l,u,i);return a.runWebGPUProgram(h,[r],r.dtype,d)}var lfe={kernelName:Co,backendName:"webgpu",kernelFunc:ofe},ufe=class{constructor(e,t){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32, + `}};function U2e(e){let{inputs:t,backend:a,attrs:n}=e,{images:r}=t,{alignCorners:s,halfPixelCenters:i,size:o}=n,[l,u]=o,d=s&&l>1?1:0,c=s&&u>1?1:0,p=[{type:"float32",data:[d,c]},{type:"float32",data:[s?.5:0]}],h=new V2e(r.shape,l,u,i);return a.runWebGPUProgram(h,[r],r.dtype,p)}var G2e={kernelName:Wo,backendName:"webgpu",kernelFunc:U2e},H2e=class{constructor(e,t){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=t,this.shaderKey=`resizeNearestNeigborBackprop_${t}`}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -8093,7 +8093,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, accumulator); } } - `}};function dfe(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,[,o,l]=r.shape,[,u,p]=s.shape,c=[i&&u>1?o-1:o,i&&p>1?l-1:l],d=[i&&u>1?u-1:u,i&&p>1?p-1:p],h=c[0]/d[0],m=c[1]/d[1],f=1/h,g=1/m,y=Math.ceil(f)*2+2,x=Math.ceil(g)*2+2,A=new ufe(r.shape,i),b=[{type:"int32",data:c},{type:"int32",data:d},{type:"float32",data:[f]},{type:"float32",data:[g]},{type:"int32",data:[y]},{type:"int32",data:[x]}];return a.runWebGPUProgram(A,[s],s.dtype,b)}var pfe={kernelName:Nu,backendName:"webgpu",kernelFunc:dfe},cfe=class{constructor(e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=" axis : vec4,",this.shaderKey="reverse"}getUserCode(){return` + `}};function j2e(e){let{inputs:t,backend:a,attrs:n}=e,{images:r,dy:s}=t,{alignCorners:i}=n,[,o,l]=r.shape,[,u,d]=s.shape,c=[i&&u>1?o-1:o,i&&d>1?l-1:l],p=[i&&u>1?u-1:u,i&&d>1?d-1:d],h=c[0]/p[0],m=c[1]/p[1],f=1/h,g=1/m,y=Math.ceil(f)*2+2,x=Math.ceil(g)*2+2,A=new H2e(r.shape,i),b=[{type:"int32",data:c},{type:"int32",data:p},{type:"float32",data:[f]},{type:"float32",data:[g]},{type:"int32",data:[y]},{type:"int32",data:[x]}];return a.runWebGPUProgram(A,[s],s.dtype,b)}var q2e={kernelName:Pu,backendName:"webgpu",kernelFunc:j2e},X2e=class{constructor(e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=" axis : vec4,",this.shaderKey="reverse"}getUserCode(){return` // Using uniform variables as judging conditions, so the function has // coherent execution within all threads. @@ -8123,7 +8123,7 @@ return a / b;`,vJ=` reverseCoords[1], reverseCoords[2], reverseCoords[3])); } } - `}};function hfe(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n,i=r.shape.length;if(i===0)return en({inputs:{x:r},backend:a});let o=r.shape,l=[1,1,1,1];o.forEach((g,y)=>{let x=y+4-i;l[x]=g});let u=v.parseAxisParam(s,r.shape),p=[0,0,0,0];u.forEach(g=>{let y=g+4-i;p[y]=1});let c=[{type:"int32",data:p}],d=ke({inputs:{x:r},backend:a,attrs:{shape:l}}),h=new cfe(l),m=a.runWebGPUProgram(h,[d],d.dtype,c);a.disposeData(d.dataId);let f=ke({inputs:{x:m},backend:a,attrs:{shape:o}});return a.disposeData(m.dataId),f}var mfe={kernelName:Ro,backendName:"webgpu",kernelFunc:hfe},ffe=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`centerX : f32, centerY : f32, sinRadians : f32, + `}};function K2e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{dims:s}=n,i=r.shape.length;if(i===0)return an({inputs:{x:r},backend:a});let o=r.shape,l=[1,1,1,1];o.forEach((g,y)=>{let x=y+4-i;l[x]=g});let u=v.parseAxisParam(s,r.shape),d=[0,0,0,0];u.forEach(g=>{let y=g+4-i;d[y]=1});let c=[{type:"int32",data:d}],p=ke({inputs:{x:r},backend:a,attrs:{shape:l}}),h=new X2e(l),m=a.runWebGPUProgram(h,[p],p.dtype,c);a.disposeData(p.dataId);let f=ke({inputs:{x:m},backend:a,attrs:{shape:o}});return a.disposeData(m.dataId),f}var Y2e={kernelName:Uo,backendName:"webgpu",kernelFunc:K2e},Z2e=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`centerX : f32, centerY : f32, sinRadians : f32, cosRadians : f32,`,this.shaderKey="rotate",this.outputShape=e,typeof t=="number"?(this.uniforms+=" fillValue : f32,",this.fillSnippet="var outputValue = uniforms.fillValue;",this.shaderKey+="_float"):(this.uniforms+=" fillValue : vec3,",this.fillSnippet="var outputValue = uniforms.fillValue[coords[3]];",this.shaderKey+="_vec3")}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -8144,7 +8144,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, outputValue); } } - `}},gfe={kernelName:Jo,backendName:"webgpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{image:n}=e,{radians:r,fillValue:s,center:i}=t,o=a,l=new ffe(n.shape,s),[u,p]=C.getImageCenter(i,n.shape[1],n.shape[2]),c=[{type:"float32",data:[u]},{type:"float32",data:[p]},{type:"float32",data:[Math.sin(r)]},{type:"float32",data:[Math.cos(r)]}];return typeof s=="number"?c.push({type:"float32",data:[Number.parseFloat(s.toFixed(2))]}):c.push({type:"float32",data:s}),o.runWebGPUProgram(l,[n],n.dtype,c)}},yfe=at({opType:le.ROUND}),xfe={kernelName:Eo,backendName:"webgpu",kernelFunc:yfe},Afe=at({opType:le.RSQRT,cpuKernelImpl:$de}),bfe={kernelName:Mo,backendName:"webgpu",kernelFunc:Afe},Fd=class{constructor(e,t,a,n,r,s,i,o=!0){this.variableNames=["updates","indices"],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=s,this.type=i,this.sumDupeIndices=o,this.dispatchLayout=me(e),this.dispatch=de(this.dispatchLayout,e,this.workgroupSize),this.sliceDimGreaterThanOne=t>1,this.shaderKey=`scatter_${a}_${n}_${this.sliceDimGreaterThanOne}_${i}_${o}_${r.length}`;let l=_t(r.length);this.uniforms=`sliceDim : i32, strides: ${l}, updatesSize: i32,`,this.updatesRank=n,this.indicesRank=a}getUserCode(){let e="";this.indicesRank===1?e="coords[0]":this.indicesRank===2&&(e="coords[0], j");let t=`getIndices(${e})`,a=this.sliceDimGreaterThanOne?"uniforms.strides[j]":"uniforms.strides",n="",r="";this.dispatchLayout.x.length===1?(n="flattenedIndex",r=` + `}},J2e={kernelName:ol,backendName:"webgpu",kernelFunc:({inputs:e,attrs:t,backend:a})=>{let{image:n}=e,{radians:r,fillValue:s,center:i}=t,o=a,l=new Z2e(n.shape,s),[u,d]=I.getImageCenter(i,n.shape[1],n.shape[2]),c=[{type:"float32",data:[u]},{type:"float32",data:[d]},{type:"float32",data:[Math.sin(r)]},{type:"float32",data:[Math.cos(r)]}];return typeof s=="number"?c.push({type:"float32",data:[Number.parseFloat(s.toFixed(2))]}):c.push({type:"float32",data:s}),o.runWebGPUProgram(l,[n],n.dtype,c)}},Q2e=at({opType:le.ROUND}),e1e={kernelName:Go,backendName:"webgpu",kernelFunc:Q2e},t1e=at({opType:le.RSQRT,cpuKernelImpl:gce}),a1e={kernelName:Ns,backendName:"webgpu",kernelFunc:t1e},Gd=class{constructor(e,t,a,n,r,s,i,o=!0){this.variableNames=["updates","indices"],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=s,this.type=i,this.sumDupeIndices=o,this.dispatchLayout=me(e),this.dispatch=de(this.dispatchLayout,e,this.workgroupSize),this.sliceDimGreaterThanOne=t>1,this.shaderKey=`scatter_${a}_${n}_${this.sliceDimGreaterThanOne}_${i}_${o}_${r.length}`;let l=Dt(r.length);this.uniforms=`sliceDim : i32, strides: ${l}, updatesSize: i32,`,this.updatesRank=n,this.indicesRank=a}getUserCode(){let e="";this.indicesRank===1?e="coords[0]":this.indicesRank===2&&(e="coords[0], j");let t=`getIndices(${e})`,a=this.sliceDimGreaterThanOne?"uniforms.strides[j]":"uniforms.strides",n="",r="";this.dispatchLayout.x.length===1?(n="flattenedIndex",r=` fn getUpdatesCoordsFromFlatIndex(index : i32) -> i32 { return index; } @@ -8170,12 +8170,12 @@ return a / b;`,vJ=` flattenedIndex = flattenedIndex + indexInside * ${a}; } let updateValue = - ${Gs(this.type)}(${s}); + ${gi(this.type)}(${s}); let flatIndex = getOutputIndexFromCoords(${n}); - ${this.sumDupeIndices?gs("&result[flatIndex]","updateValue",this.type):"atomicStore(&result[flatIndex], bitcast(updateValue));"} + ${this.sumDupeIndices?Bs("&result[flatIndex]","updateValue",this.type):"atomicStore(&result[flatIndex], bitcast(updateValue));"} } - }`}};function vfe(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r,updates:s}=t,{shape:i}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:p,outputSize:c}=C.calculateShapes(s,r,i),d=[c/u,u];if(c===0)return a.makeTensorInfo(i,r.dtype);let h=ke({inputs:{x:r},backend:a,attrs:{shape:[l,o]}}),m=ke({inputs:{x:s},backend:a,attrs:{shape:[l,u]}}),f=m.dtype,g=Wa({backend:a,attrs:{shape:d,value:0,dtype:f}}),y=v.sizeFromShape(m.shape),x=[{type:"int32",data:[o]},{type:"int32",data:p},{type:"int32",data:[y]}],A=new Fd(m.shape,o,h.shape.length,m.shape.length,p,d,f),b=a.runWebGPUProgram(A,[m,h],f,x,g),w=ke({inputs:{x:b},backend:a,attrs:{shape:i}});return a.disposeData(h.dataId),a.disposeData(m.dataId),a.disposeData(b.dataId),w}var wfe={kernelName:Po,backendName:"webgpu",kernelFunc:vfe},kfe=class{constructor(e,t){this.outputShape=[],this.variableNames=["sortedSequence","values"],this.uniforms="numInputs : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.side=t,this.shaderKey=`search_sorted_${t}`}getUserCode(){return` + }`}};function n1e(e){let{inputs:t,backend:a,attrs:n}=e,{indices:r,updates:s}=t,{shape:i}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:d,outputSize:c}=I.calculateShapes(s,r,i),p=[c/u,u];if(c===0)return a.makeTensorInfo(i,r.dtype);let h=ke({inputs:{x:r},backend:a,attrs:{shape:[l,o]}}),m=ke({inputs:{x:s},backend:a,attrs:{shape:[l,u]}}),f=m.dtype,g=Wa({backend:a,attrs:{shape:p,value:0,dtype:f}}),y=v.sizeFromShape(m.shape),x=[{type:"int32",data:[o]},{type:"int32",data:d},{type:"int32",data:[y]}],A=new Gd(m.shape,o,h.shape.length,m.shape.length,d,p,f),b=a.runWebGPUProgram(A,[m,h],f,x,g),w=ke({inputs:{x:b},backend:a,attrs:{shape:i}});return a.disposeData(h.dataId),a.disposeData(m.dataId),a.disposeData(b.dataId),w}var r1e={kernelName:Ho,backendName:"webgpu",kernelFunc:n1e},s1e=class{constructor(e,t){this.outputShape=[],this.variableNames=["sortedSequence","values"],this.uniforms="numInputs : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.side=t,this.shaderKey=`search_sorted_${t}`}getUserCode(){return` fn findBound(batch: i32, value: f32) -> i32 { var left = i32(0); var right = uniforms.numInputs; @@ -8197,7 +8197,7 @@ return a / b;`,vJ=` setOutputAtIndexI32(index, findBound(coords[0], value)); } } - `}};function Ife(e){let{inputs:t,backend:a,attrs:n}=e,{sortedSequence:r,values:s}=t,{side:i}=n,o=new kfe([s.shape[0],s.shape[1]],i),l=[{type:"int32",data:[r.shape[1]]}];return a.runWebGPUProgram(o,[r,s],"int32",l)}var Sfe={kernelName:$o,backendName:"webgpu",kernelFunc:Ife},Cfe=class{constructor(e,t,a){this.variableNames=["c","a","b"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.cRank=e,this.rank=a,this.shaderKey="select"}getUserCode(){let e,t;if(this.rank>4)throw Error(`Where for rank ${this.rank} is not yet supported`);if(this.rank===1)t="resRC",e="resRC";else{let a=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[],r=[];for(let s=0;s4)throw Error(`Where for rank ${this.rank} is not yet supported`);if(this.rank===1)t="resRC",e="resRC";else{let a=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[],r=[];for(let s=0;s{this.uniforms+=` pad${l} : vec2,`}),this.shaderKey=`spaceToBatchND_${r}`}getUserCode(){let e=_t(this.outputShape.length),t=Tk(this.newDim);return` - ${ih(this.paddedXShape,"PaddedX")} + `}};function u1e(e){let{inputs:t,backend:a}=e,{condition:n,t:r,e:s}=t,i=new l1e(n.shape.length,r.shape,r.shape.length);return a.runWebGPUProgram(i,[n,r,s],Qt(r.dtype,s.dtype))}var d1e={kernelName:Ou,backendName:"webgpu",kernelFunc:u1e},p1e=at({opType:le.SELU}),c1e={kernelName:Xo,backendName:"webgpu",kernelFunc:p1e},h1e=at({opType:le.SIGMOID}),m1e={kernelName:Rs,backendName:"webgpu",kernelFunc:h1e},f1e=at({opType:le.SIGN}),g1e={kernelName:Zo,backendName:"webgpu",kernelFunc:f1e},y1e=at({opType:le.SIN}),x1e={kernelName:Ko,backendName:"webgpu",kernelFunc:y1e},A1e=at({opType:le.SINH}),b1e={kernelName:Yo,backendName:"webgpu",kernelFunc:A1e},v1e=at({opType:le.SOFTPLUS}),w1e={kernelName:Jo,backendName:"webgpu",kernelFunc:v1e},k1e=class{constructor(e,t,a,n,r,s){this.variableNames=["x"],this.outputShape=[],this.uniforms="",this.workgroupSize=[64,1,1],this.size=!0;let i=new Array(n.length);for(let o=0;o{this.uniforms+=` pad${l} : vec2,`}),this.shaderKey=`spaceToBatchND_${r}`}getUserCode(){let e=Dt(this.outputShape.length),t=x9(this.newDim);return` + ${mh(this.paddedXShape,"PaddedX")} ${ue("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${e}(${t}), uniforms.reshapedPaddedXShape); let paddedCoords = getPaddedXCoordsFromIndex(switchedIndex); - ${jk(this.xShape,!0)} + ${O9(this.xShape,!0)} } } - `}},Vfe=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,paddings:i}=n;v.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet");let o=s.reduce((x,A)=>x*A),l=[[0,0]];l.push(...i);for(let x=1+s.length;xx[0]+r.shape[A]+x[1]),p=C.getReshaped(u,s,o,!1),c=C.getPermuted(p.length,s.length,!1),d=C.getReshapedPermuted(u,s,o,!1),h=v.computeStrides(u),m=new Bfe(r.shape,u,l,p,c,h.length),f=[{type:"int32",data:p},{type:"int32",data:h}];l.map(x=>f.push({type:"int32",data:[x[0],x[1]]}));let g=a.runWebGPUProgram(m,[r],r.dtype,f),y=ke({inputs:{x:g},backend:a,attrs:{shape:d}});return a.disposeData(g.dataId),y},Ufe={kernelName:Pu,backendName:"webgpu",kernelFunc:Vfe},Gfe=class{constructor(e,t,a){this.variableNames=["input","indices","segmentIds"],this.outputShape=[],this.uniforms="segmentSize : i32, sparseSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e,this.type=a,this.dispatchLayout=me([t]),this.dispatch=de(this.dispatchLayout,[t],this.workgroupSize),this.shaderKey="sparseSegmentSum"}getUserCode(){return` + `}},I1e=e=>{let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{blockShape:s,paddings:i}=n;v.assert(r.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet");let o=s.reduce((x,A)=>x*A),l=[[0,0]];l.push(...i);for(let x=1+s.length;xx[0]+r.shape[A]+x[1]),d=I.getReshaped(u,s,o,!1),c=I.getPermuted(d.length,s.length,!1),p=I.getReshapedPermuted(u,s,o,!1),h=v.computeStrides(u),m=new k1e(r.shape,u,l,d,c,h.length),f=[{type:"int32",data:d},{type:"int32",data:h}];l.map(x=>f.push({type:"int32",data:[x[0],x[1]]}));let g=a.runWebGPUProgram(m,[r],r.dtype,f),y=ke({inputs:{x:g},backend:a,attrs:{shape:p}});return a.disposeData(g.dataId),y},S1e={kernelName:Lu,backendName:"webgpu",kernelFunc:I1e},T1e=class{constructor(e,t,a){this.variableNames=["input","indices","segmentIds"],this.outputShape=[],this.uniforms="segmentSize : i32, sparseSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e,this.type=a,this.dispatchLayout=me([t]),this.dispatch=de(this.dispatchLayout,[t],this.workgroupSize),this.shaderKey="sparseSegmentSum"}getUserCode(){return` ${ue("index")} { if (index < uniforms.sparseSize) { let indexInSegmentIds = index / uniforms.segmentSize; @@ -8229,17 +8229,17 @@ return a / b;`,vJ=` let value = input[indexInInput * uniforms.segmentSize + indexInSegment]; let outIndex = segmentId * uniforms.segmentSize + indexInSegment; - ${gs("&result[outIndex]","value",this.type)} + ${Bs("&result[outIndex]","value",this.type)} } } - `}},Hfe=class{constructor(e,t){this.variableNames=["segmentIds"],this.outputShape=[],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=[e],this.dispatchLayout=me(t),this.dispatch=de(this.dispatchLayout,t,this.workgroupSize),this.shaderKey="sparseSegmentIdCountProgram"}getUserCode(){return` + `}},C1e=class{constructor(e,t){this.variableNames=["segmentIds"],this.outputShape=[],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=[e],this.dispatchLayout=me(t),this.dispatch=de(this.dispatchLayout,t,this.workgroupSize),this.shaderKey="sparseSegmentIdCountProgram"}getUserCode(){return` ${ue("index")} { if (index < uniforms.segmentIdsShape) { let segmentId = segmentIds[index]; - ${gs("&result[segmentId]","1","int32")} + ${Bs("&result[segmentId]","1","int32")} } } - `}},jfe=class{constructor(e,t){this.variableNames=["segmentSum","sameSegmentIdCount"],this.outputShape=[],this.uniforms="segmentSize : i32",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.type=t,this.dispatchLayout=me(e),this.dispatch=de(this.dispatchLayout,e,this.workgroupSize),this.shaderKey="sparseSegmentMean"}getUserCode(){return` + `}},N1e=class{constructor(e,t){this.variableNames=["segmentSum","sameSegmentIdCount"],this.outputShape=[],this.uniforms="segmentSize : i32",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.type=t,this.dispatchLayout=me(e),this.dispatch=de(this.dispatchLayout,e,this.workgroupSize),this.shaderKey="sparseSegmentMean"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let segmentId = index / uniforms.segmentSize; @@ -8249,21 +8249,21 @@ return a / b;`,vJ=` } } } - `}};function qk(e,t,a,n=!1,r){let s=v.sizeFromShape(e.shape)/e.shape[0],i=e.dtype,o=v.sizeFromShape(t.shape),l=r.readSync(a.dataId),u=o>0?l[o-1]+1:0,p,c=e.shape.slice();c[0]=u;let d=o*s,h=Wa({backend:r,attrs:{shape:c,value:0,dtype:i}});p=new Gfe(c,d,i);let m=[{type:"int32",data:[s]},{type:"int32",data:[d]}],f=r.runWebGPUProgram(p,[e,t,a],i,m,h);if(n)return f;let g=Wa({backend:r,attrs:{shape:[u],value:0,dtype:"int32"}});p=new Hfe(u,a.shape);let y=r.runWebGPUProgram(p,[a],"int32",null,g),x=Wa({backend:r,attrs:{shape:c,value:0,dtype:i}});p=new jfe(c,i),m=[{type:"int32",data:[s]}];let A=r.runWebGPUProgram(p,[f,y],i,m,x);return r.disposeData(f.dataId),r.disposeData(y.dataId),A}function qfe(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;return qk(n,r,s,!1,a)}var Xfe={kernelName:Fu,backendName:"webgpu",kernelFunc:qfe};function Kfe(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;return qk(n,r,s,!0,a)}var Yfe={kernelName:Du,backendName:"webgpu",kernelFunc:Kfe},Zfe=class{constructor(e,t){this.variableNames=["A"],this.workgroupSize=[64,1,1],this.size=!0;let a=new Array(e.length);for(let n=0;n0?l[o-1]+1:0,d,c=e.shape.slice();c[0]=u;let p=o*s,h=Wa({backend:r,attrs:{shape:c,value:0,dtype:i}});d=new T1e(c,p,i);let m=[{type:"int32",data:[s]},{type:"int32",data:[p]}],f=r.runWebGPUProgram(d,[e,t,a],i,m,h);if(n)return f;let g=Wa({backend:r,attrs:{shape:[u],value:0,dtype:"int32"}});d=new C1e(u,a.shape);let y=r.runWebGPUProgram(d,[a],"int32",null,g),x=Wa({backend:r,attrs:{shape:c,value:0,dtype:i}});d=new N1e(c,i),m=[{type:"int32",data:[s]}];let A=r.runWebGPUProgram(d,[f,y],i,m,x);return r.disposeData(f.dataId),r.disposeData(y.dataId),A}function R1e(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;return z9(n,r,s,!1,a)}var E1e={kernelName:Vu,backendName:"webgpu",kernelFunc:R1e};function M1e(e){let{inputs:t,backend:a}=e,{data:n,indices:r,segmentIds:s}=t;return z9(n,r,s,!0,a)}var F1e={kernelName:Uu,backendName:"webgpu",kernelFunc:M1e},$1e=class{constructor(e,t){this.variableNames=["A"],this.workgroupSize=[64,1,1],this.size=!0;let a=new Array(e.length);for(let n=0;n=5)throw Error(`Tile for rank ${e} is not yet supported`);if(e===1)return`(resRC % ${t}aShape)`;let a=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let r=0;r=5){let o=a.readSync(r.dataId),l=r.dtype==="string"?o.map(c=>v.decodeString(c)):o,u=$e(r.shape,r.dtype,l),p=Bde(u,s);return a.makeTensorInfo(p.shape,p.dtype,p.values)}let i=new Zfe(r.shape,s);return a.runWebGPUProgram(i,[r],r.dtype)}var Qfe={kernelName:ls,backendName:"webgpu",kernelFunc:Z3};function e2e(e){let{inputs:t,backend:a,attrs:n}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=n,{sliceRank:l,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=C.calculateShapes(s,r,o),h=!1;if(s.dtype==="string"){let N=a.bufferSync(r),M=a.bufferSync(s),P=v.decodeString(a.readSync(i.dataId)[0]),E=Fde(N,M,o,d,p,u,l,c,P,h);return a.makeTensorInfo(o,E.dtype,E.values)}let m=[d/p,p],f=ke({inputs:{x:r},backend:a,attrs:{shape:[u,l]}}),g=s.shape.length?ke({inputs:{x:s},backend:a,attrs:{shape:[u,p]}}):en({inputs:{x:s},backend:a}),y=g.dtype,x=a.makeTensorInfo([],y,v.makeZerosTypedArray(1,y)),A=ke({inputs:{x:i},backend:a,attrs:{shape:Array(m.length).fill(1)}}),b=Z3({inputs:{x:A},backend:a,attrs:{reps:m}}),w=v.sizeFromShape([u,p]),I=[{type:"int32",data:[l]},{type:"int32",data:c},{type:"int32",data:[w]}];switch(u){case 0:break;case 1:{let N=new Fd([u,p],l,f.shape.length,g.shape.length,c,m,y,h);a.runWebGPUProgram(N,[g,f],y,I,b)}break;default:{let N=new Fd([u,p],l,f.shape.length,x.shape.length,c,m,y,h);a.runWebGPUProgram(N,[x,f],y,I,b)}{let N=new Fd([u,p],l,f.shape.length,g.shape.length,c,m,y);a.runWebGPUProgram(N,[g,f],y,I,b)}}let T=ke({inputs:{x:b},backend:a,attrs:{shape:o}});return a.disposeData(f.dataId),a.disposeData(g.dataId),a.disposeData(A.dataId),a.disposeData(x.dataId),a.disposeData(b.dataId),T}var t2e={kernelName:Go,backendName:"webgpu",kernelFunc:e2e};function a2e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=n,o=v.parseAxisParam(i,r.shape)[0],l=C.prepareSplitSize(r,s,o),u=r.shape.length,p=new Array(u).fill(0),c=r.shape.slice();return l.map(d=>{let h=[...c];h[o]=d;let m=Qu({inputs:{x:r},backend:a,attrs:{begin:p,size:h}});return p[o]+=d,m})}var n2e={kernelName:_u,backendName:"webgpu",kernelFunc:a2e},r2e=at({opType:le.SQRT}),s2e={kernelName:Bo,backendName:"webgpu",kernelFunc:r2e},i2e={kernelName:kp,backendName:"webgpu",kernelFunc:({inputs:e,backend:t})=>{let{x:a}=e,n=t,r=new Ju(a.shape,le.SQUARE);return n.runWebGPUProgram(r,[a],a.dtype)}},o2e=ea({opType:_e.SQUARED_DIFFERENCE}),l2e={kernelName:Ho,backendName:"webgpu",kernelFunc:o2e};function u2e({inputs:e,attrs:t,backend:a}){let{x:n}=e,r=new Ju(n.shape,le.STEP,"stepAlpha : f32,"),s=[{type:"float32",data:[t.alpha]}];return a.runWebGPUProgram(r,[n],n.dtype,s)}var d2e={kernelName:us,backendName:"webgpu",kernelFunc:u2e},p2e=class{constructor(e){this.variableNames=["x"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]);let t=_t(this.outputShape.length);this.uniforms=`begin : ${t}, strides : ${t}, `,this.shaderKey="stridedSlice"}getUserCode(){let e=this.outputShape.length,t="";if(e===1)t="coords * uniforms.strides + uniforms.begin";else{let a=0;t=this.outputShape.map((n,r)=>(a++,this.outputShape.length===1?`coords * uniforms.strides[${r}] + uniforms.begin[${r}]`:`coords[${a-1}] * uniforms.strides[${r}] + uniforms.begin[${r}]`)).join(",")}return` + `}};function D1e(e,t=""){if(e>=5)throw Error(`Tile for rank ${e} is not yet supported`);if(e===1)return`(resRC % ${t}aShape)`;let a=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let r=0;r=5){let o=a.readSync(r.dataId),l=r.dtype==="string"?o.map(c=>v.decodeString(c)):o,u=Te(r.shape,r.dtype,l),d=kce(u,s);return a.makeTensorInfo(d.shape,d.dtype,d.values)}let i=new $1e(r.shape,s);return a.runWebGPUProgram(i,[r],r.dtype)}var P1e={kernelName:$s,backendName:"webgpu",kernelFunc:dy};function _1e(e){let{inputs:t,backend:a,attrs:n}=e,{sparseIndices:r,sparseValues:s,defaultValue:i}=t,{outputShape:o}=n,{sliceRank:l,numUpdates:u,sliceSize:d,strides:c,outputSize:p}=I.calculateShapes(s,r,o),h=!1;if(s.dtype==="string"){let N=a.bufferSync(r),M=a.bufferSync(s),F=v.decodeString(a.readSync(i.dataId)[0]),E=yce(N,M,o,p,d,u,l,c,F,h);return a.makeTensorInfo(o,E.dtype,E.values)}let m=[p/d,d],f=ke({inputs:{x:r},backend:a,attrs:{shape:[u,l]}}),g=s.shape.length?ke({inputs:{x:s},backend:a,attrs:{shape:[u,d]}}):an({inputs:{x:s},backend:a}),y=g.dtype,x=a.makeTensorInfo([],y,v.makeZerosTypedArray(1,y)),A=ke({inputs:{x:i},backend:a,attrs:{shape:Array(m.length).fill(1)}}),b=dy({inputs:{x:A},backend:a,attrs:{reps:m}}),w=v.sizeFromShape([u,d]),S=[{type:"int32",data:[l]},{type:"int32",data:c},{type:"int32",data:[w]}];switch(u){case 0:break;case 1:{let N=new Gd([u,d],l,f.shape.length,g.shape.length,c,m,y,h);a.runWebGPUProgram(N,[g,f],y,S,b)}break;default:{let N=new Gd([u,d],l,f.shape.length,x.shape.length,c,m,y,h);a.runWebGPUProgram(N,[x,f],y,S,b)}{let N=new Gd([u,d],l,f.shape.length,g.shape.length,c,m,y);a.runWebGPUProgram(N,[g,f],y,S,b)}}let C=ke({inputs:{x:b},backend:a,attrs:{shape:o}});return a.disposeData(f.dataId),a.disposeData(g.dataId),a.disposeData(A.dataId),a.disposeData(x.dataId),a.disposeData(b.dataId),C}var O1e={kernelName:tl,backendName:"webgpu",kernelFunc:_1e};function z1e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{numOrSizeSplits:s,axis:i}=n,o=v.parseAxisParam(i,r.shape)[0],l=I.prepareSplitSize(r,s,o),u=r.shape.length,d=new Array(u).fill(0),c=r.shape.slice();return l.map(p=>{let h=[...c];h[o]=p;let m=od({inputs:{x:r},backend:a,attrs:{begin:d,size:h}});return d[o]+=p,m})}var L1e={kernelName:Wu,backendName:"webgpu",kernelFunc:z1e},W1e=at({opType:le.SQRT}),B1e={kernelName:Es,backendName:"webgpu",kernelFunc:W1e},V1e={kernelName:Fp,backendName:"webgpu",kernelFunc:({inputs:e,backend:t})=>{let{x:a}=e,n=t,r=new id(a.shape,le.SQUARE);return n.runWebGPUProgram(r,[a],a.dtype)}},U1e=aa({opType:De.SQUARED_DIFFERENCE}),G1e={kernelName:Ms,backendName:"webgpu",kernelFunc:U1e};function H1e({inputs:e,attrs:t,backend:a}){let{x:n}=e,r=new id(n.shape,le.STEP,"stepAlpha : f32,"),s=[{type:"float32",data:[t.alpha]}];return a.runWebGPUProgram(r,[n],n.dtype,s)}var j1e={kernelName:Ds,backendName:"webgpu",kernelFunc:H1e},q1e=class{constructor(e){this.variableNames=["x"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]);let t=Dt(this.outputShape.length);this.uniforms=`begin : ${t}, strides : ${t}, `,this.shaderKey="stridedSlice"}getUserCode(){let e=this.outputShape.length,t="";if(e===1)t="coords * uniforms.strides + uniforms.begin";else{let a=0;t=this.outputShape.map((n,r)=>(a++,this.outputShape.length===1?`coords * uniforms.strides[${r}] + uniforms.begin[${r}]`:`coords[${a-1}] * uniforms.strides[${r}] + uniforms.begin[${r}]`)).join(",")}return` ${ue("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); setOutputAtIndex(index, getX(${t})); } } - `}};function c2e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:p,newAxisMask:c,shrinkAxisMask:d}=n,{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=Nt.sliceInfo(r.shape,s,i,o,l,u,p,c,d),w;if(f)w=ke({inputs:{x:r},backend:a,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let I=Nt.computeOutShape(x,A,b),T=Qu({inputs:{x:r},backend:a,attrs:{begin:x,size:I}});w=ke({inputs:{x:T},backend:a,attrs:{shape:m}}),a.disposeData(T.dataId)}else if(a.shouldExecuteOnCPU([r])){let I=a.readSync(r.dataId),T=$e(r.shape,r.dtype,I),N=zde(h,T,b,x);w=a.makeTensorInfo(m,r.dtype,N.values)}else{let I=new p2e(h),T=[{type:"int32",data:x},{type:"int32",data:b}],N=a.runWebGPUProgram(I,[r],r.dtype,T);w=ke({inputs:{x:N},backend:a,attrs:{shape:m}}),a.disposeData(N.dataId)}return w}var h2e={kernelName:jo,backendName:"webgpu",kernelFunc:c2e};function m2e(e){let{inputs:t,backend:a,attrs:n}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=n,{data:p,dataSplits:c}=t,d=a.readSync(p.dataId),h=a.readSync(c.dataId),[m,f]=Lde(d,h,r,s,i,o,l,u);return[a.makeTensorInfo([m.length],"string",m),a.makeTensorInfo(c.shape,"int32",f)]}var f2e={kernelName:Ou,backendName:"webgpu",kernelFunc:m2e},g2e=ea({opType:_e.SUB,cpuKernelImpl:Wde,supportsComplex:!0}),y2e={kernelName:qo,backendName:"webgpu",kernelFunc:g2e},x2e=at({opType:le.TAN}),A2e={kernelName:Xo,backendName:"webgpu",kernelFunc:x2e},b2e=at({opType:le.TANH}),v2e={kernelName:Ko,backendName:"webgpu",kernelFunc:b2e};function w2e(e){let{inputs:t,backend:a,attrs:n}=e,{tensor:r,indices:s,updates:i}=t,{}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:p,outputSize:c}=C.calculateShapes(i,s,r.shape),d=[c/u,u];if(c===0)return a.makeTensorInfo(r.shape,s.dtype);let h=[],m=ke({inputs:{x:s},backend:a,attrs:{shape:[l,o]}});h.push(m);let f=ke({inputs:{x:i},backend:a,attrs:{shape:[l,u]}});h.push(f);let g=ke({inputs:{x:r},backend:a,attrs:{shape:d}});h.push(g);let y=Z3({inputs:{x:g},backend:a,attrs:{reps:Array(d.length).fill(1)}}),x=new Fd([l,u],o,m.shape.length,f.shape.length,p,d,r.dtype,!1),A=v.sizeFromShape([l,u]),b=[{type:"int32",data:[o]},{type:"int32",data:p},{type:"int32",data:[A]}],w=a.runWebGPUProgram(x,[f,m],g.dtype,b,y);h.push(w);let I=ke({inputs:{x:w},backend:a,attrs:{shape:r.shape}});return h.forEach(T=>a.disposeData(T.dataId)),I}var k2e={kernelName:_o,backendName:"webgpu",kernelFunc:w2e},I2e=class{constructor(e){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`inputSize : i32, firstPass : i32, negativeInf : f32, + `}};function X1e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r}=t,{begin:s,end:i,strides:o,beginMask:l,endMask:u,ellipsisMask:d,newAxisMask:c,shrinkAxisMask:p}=n,{finalShapeSparse:h,finalShape:m,isIdentity:f,sliceDim0:g,isSimpleSlice:y,begin:x,end:A,strides:b}=wt.sliceInfo(r.shape,s,i,o,l,u,d,c,p),w;if(f)w=ke({inputs:{x:r},backend:a,attrs:{shape:m}});else if(g||y){v.assert(r.shape.length>=1,()=>`Input must have rank at least 1, got: ${r.shape.length}`);let S=wt.computeOutShape(x,A,b),C=od({inputs:{x:r},backend:a,attrs:{begin:x,size:S}});w=ke({inputs:{x:C},backend:a,attrs:{shape:m}}),a.disposeData(C.dataId)}else if(a.shouldExecuteOnCPU([r])){let S=a.readSync(r.dataId),C=Te(r.shape,r.dtype,S),N=bce(h,C,b,x);w=a.makeTensorInfo(m,r.dtype,N.values)}else{let S=new q1e(h),C=[{type:"int32",data:x},{type:"int32",data:b}],N=a.runWebGPUProgram(S,[r],r.dtype,C);w=ke({inputs:{x:N},backend:a,attrs:{shape:m}}),a.disposeData(N.dataId)}return w}var K1e={kernelName:al,backendName:"webgpu",kernelFunc:X1e};function Y1e(e){let{inputs:t,backend:a,attrs:n}=e,{separator:r,nGramWidths:s,leftPad:i,rightPad:o,padWidth:l,preserveShortSequences:u}=n,{data:d,dataSplits:c}=t,p=a.readSync(d.dataId),h=a.readSync(c.dataId),[m,f]=vce(p,h,r,s,i,o,l,u);return[a.makeTensorInfo([m.length],"string",m),a.makeTensorInfo(c.shape,"int32",f)]}var Z1e={kernelName:Hu,backendName:"webgpu",kernelFunc:Y1e},J1e=aa({opType:De.SUB,cpuKernelImpl:wce,supportsComplex:!0}),Q1e={kernelName:Fs,backendName:"webgpu",kernelFunc:J1e},ege=at({opType:le.TAN}),tge={kernelName:nl,backendName:"webgpu",kernelFunc:ege},age=at({opType:le.TANH}),nge={kernelName:rl,backendName:"webgpu",kernelFunc:age};function rge(e){let{inputs:t,backend:a,attrs:n}=e,{tensor:r,indices:s,updates:i}=t,{}=n,{sliceRank:o,numUpdates:l,sliceSize:u,strides:d,outputSize:c}=I.calculateShapes(i,s,r.shape),p=[c/u,u];if(c===0)return a.makeTensorInfo(r.shape,s.dtype);let h=[],m=ke({inputs:{x:s},backend:a,attrs:{shape:[l,o]}});h.push(m);let f=ke({inputs:{x:i},backend:a,attrs:{shape:[l,u]}});h.push(f);let g=ke({inputs:{x:r},backend:a,attrs:{shape:p}});h.push(g);let y=dy({inputs:{x:g},backend:a,attrs:{reps:Array(p.length).fill(1)}}),x=new Gd([l,u],o,m.shape.length,f.shape.length,d,p,r.dtype,!1),A=v.sizeFromShape([l,u]),b=[{type:"int32",data:[o]},{type:"int32",data:d},{type:"int32",data:[A]}],w=a.runWebGPUProgram(x,[f,m],g.dtype,b,y);h.push(w);let S=ke({inputs:{x:w},backend:a,attrs:{shape:r.shape}});return h.forEach(C=>a.disposeData(C.dataId)),S}var sge={kernelName:jo,backendName:"webgpu",kernelFunc:rge},ige=class{constructor(e){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`inputSize : i32, firstPass : i32, negativeInf : f32, dir : i32, inc : i32,`,this.shaderKey="swap"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { @@ -8331,7 +8331,7 @@ return a / b;`,vJ=` } } } - `}},S2e=class{constructor(e){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms="inputSize : i32, firstPass : i32, k : i32,",this.shaderKey="merge"}getUserCode(){return` + `}},oge=class{constructor(e){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms="inputSize : i32, firstPass : i32, k : i32,",this.shaderKey="merge"}getUserCode(){return` ${ue("index")} { if (index < uniforms.size) { let outC = getCoordsFromIndex(index); @@ -8390,7 +8390,7 @@ return a / b;`,vJ=` } } } - `}};function $l(e,t){t!==null&&e.disposeData(t.dataId)}function uA(e){let t=1;for(;th===null?[p,p]:[p,h],f=(b,w,I)=>{let T=m(),N=new I2e(I),M=[{type:"int32",data:[l]},{type:"int32",data:[h===null?1:0]},{type:"float32",data:[Number.NEGATIVE_INFINITY]},{type:"int32",data:[b]},{type:"int32",data:[w]}],P=h;h=a.runWebGPUProgram(N,T,"int32",M),$l(a,P)};for(let b=1;b=1;I/=2)f(w,I,[u,d])}for(let b=d;b>c;b/=2){let w=m(),I=new S2e([u,b/2]),T=[{type:"int32",data:[l]},{type:"int32",data:[h===null?1:0]},{type:"int32",data:[c]}],N=h;h=a.runWebGPUProgram(I,w,"int32",T),$l(a,N);let M=c/2,P=M*2;for(let E=M;E>=1;E/=2)f(P,E,h.shape)}let g=h;h=Qu({inputs:{x:h},backend:a,attrs:{begin:0,size:[u,s]}}),$l(a,g);let y=Vk({inputs:{x:p,indices:h},backend:a,attrs:{axis:1,batchDims:1}});$l(a,p);let x=o.slice(0,-1);x.push(s),g=h,h=ke({inputs:{x:h},attrs:{shape:x},backend:a}),$l(a,g);let A=y;return y=ke({inputs:{x:y},attrs:{shape:x},backend:a}),$l(a,A),[y,h]}var T2e={kernelName:Yo,backendName:"webgpu",kernelFunc:C2e},N2e=class{constructor(e){this.variableNames=["Image","Transforms"],this.uniforms="interpolationModeId : i32, fillModeId : i32, fillValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="transform"}getUserCode(){return` + `}};function Ul(e,t){t!==null&&e.disposeData(t.dataId)}function NA(e){let t=1;for(;th===null?[d,d]:[d,h],f=(b,w,S)=>{let C=m(),N=new ige(S),M=[{type:"int32",data:[l]},{type:"int32",data:[h===null?1:0]},{type:"float32",data:[Number.NEGATIVE_INFINITY]},{type:"int32",data:[b]},{type:"int32",data:[w]}],F=h;h=a.runWebGPUProgram(N,C,"int32",M),Ul(a,F)};for(let b=1;b=1;S/=2)f(w,S,[u,p])}for(let b=p;b>c;b/=2){let w=m(),S=new oge([u,b/2]),C=[{type:"int32",data:[l]},{type:"int32",data:[h===null?1:0]},{type:"int32",data:[c]}],N=h;h=a.runWebGPUProgram(S,w,"int32",C),Ul(a,N);let M=c/2,F=M*2;for(let E=M;E>=1;E/=2)f(F,E,h.shape)}let g=h;h=od({inputs:{x:h},backend:a,attrs:{begin:0,size:[u,s]}}),Ul(a,g);let y=$9({inputs:{x:d,indices:h},backend:a,attrs:{axis:1,batchDims:1}});Ul(a,d);let x=o.slice(0,-1);x.push(s),g=h,h=ke({inputs:{x:h},attrs:{shape:x},backend:a}),Ul(a,g);let A=y;return y=ke({inputs:{x:y},attrs:{shape:x},backend:a}),Ul(a,A),[y,h]}var uge={kernelName:sl,backendName:"webgpu",kernelFunc:lge},dge=class{constructor(e){this.variableNames=["Image","Transforms"],this.uniforms="interpolationModeId : i32, fillModeId : i32, fillValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=me(this.outputShape),this.dispatch=de(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="transform"}getUserCode(){return` fn mapCoord(outCoord : f32, len : f32) -> f32{ var inCoord = outCoord; if(uniforms.fillModeId == 2) { @@ -8506,7 +8506,7 @@ return a / b;`,vJ=` setOutputAtIndex(index, outputValue); } } - `}};function R2e(e){let{inputs:t,backend:a,attrs:n}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=n,[p,c,d,h]=r.shape,[m,f]=u!=null?u:[c,d],g=[p,m,f,h],y=new N2e(g),x=i==="nearest"?1:2,A;switch(o){case"constant":A=1;break;case"reflect":A=2;break;case"wrap":A=3;break;case"nearest":A=4;break;default:A=1;break}let b=[{type:"int32",data:[x]},{type:"int32",data:[A]},{type:"float32",data:[l]}];return a.runWebGPUProgram(y,[r,s],"float32",b)}var E2e={kernelName:Zo,backendName:"webgpu",kernelFunc:R2e};function M2e(e){let{inputs:t,backend:a,attrs:n}=e,{value:r}=t,{axis:s}=n;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,l=r.shape[s],u=new Array(o-1),p=0;for(let f=0;fa.disposeData(f.dataId)),m}var P2e={kernelName:zu,backendName:"webgpu",kernelFunc:M2e},_2e=class{constructor(e,t,a){if(this.outputShape=[],this.variableNames=["x","segmentIds"],this.uniforms="numSegments : i32, xSize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t,this.dispatchLayout=me(e),this.dispatch=de(this.dispatchLayout,e,this.workgroupSize),a!=="float32"&&a!=="int32")throw new Error(`UnsortedSegmentSum only supports float32 and int32 + `}};function pge(e){let{inputs:t,backend:a,attrs:n}=e,{image:r,transforms:s}=t,{interpolation:i,fillMode:o,fillValue:l,outputShape:u}=n,[d,c,p,h]=r.shape,[m,f]=u!=null?u:[c,p],g=[d,m,f,h],y=new dge(g),x=i==="nearest"?1:2,A;switch(o){case"constant":A=1;break;case"reflect":A=2;break;case"wrap":A=3;break;case"nearest":A=4;break;default:A=1;break}let b=[{type:"int32",data:[x]},{type:"int32",data:[A]},{type:"float32",data:[l]}];return a.runWebGPUProgram(y,[r,s],"float32",b)}var cge={kernelName:il,backendName:"webgpu",kernelFunc:pge};function hge(e){let{inputs:t,backend:a,attrs:n}=e,{value:r}=t,{axis:s}=n;s<0&&(s+=r.shape.length);let i=r,o=i.shape.length,l=r.shape[s],u=new Array(o-1),d=0;for(let f=0;fa.disposeData(f.dataId)),m}var mge={kernelName:ju,backendName:"webgpu",kernelFunc:hge},fge=class{constructor(e,t,a){if(this.outputShape=[],this.variableNames=["x","segmentIds"],this.uniforms="numSegments : i32, xSize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t,this.dispatchLayout=me(e),this.dispatch=de(this.dispatchLayout,e,this.workgroupSize),a!=="float32"&&a!=="int32")throw new Error(`UnsortedSegmentSum only supports float32 and int32 types, does not support ${a} type.`);this.type=a,this.shaderKey="unsortedSegmentSum"}getUserCode(){return` ${ue("index")} { if (index < uniforms.xSize) { @@ -8519,11 +8519,11 @@ return a / b;`,vJ=` let flatIndex = b * uniforms.numSegments + segmentId % uniforms.numSegments; let value = getX(b, inCol); - ${gs("&result[flatIndex]","value",this.type)} + ${Bs("&result[flatIndex]","value",this.type)} } } } - `}};function $2e(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,segmentIds:s}=t,{numSegments:i}=n,o=r.shape.length,l=[],u=0,p=C.getAxesPermutation([u],o),c=r;p!=null&&(c=ar({inputs:{x:r},backend:a,attrs:{perm:p}}),l.push(c),u=C.getInnerMostAxes(1,o)[0]);let d=C.segment_util.computeOutShape(c.shape,u,i),h=v.sizeFromShape([c.shape[u]]),m=ke({inputs:{x:c},backend:a,attrs:{shape:[-1,h]}});l.push(m);let f=r.dtype,g=[m.shape[0],i],y=Wa({backend:a,attrs:{shape:g,value:0,dtype:f}}),x=new _2e(m.shape,g,f),A=[{type:"int32",data:[i]},{type:"int32",data:[v.sizeFromShape(m.shape)]}],b=a.runWebGPUProgram(x,[m,s],f,A,y),w=ke({inputs:{x:b},backend:a,attrs:{shape:d}});l.push(b);let I=w;if(p!=null){l.push(w);let T=C.getUndoAxesPermutation(p);I=ar({inputs:{x:I},backend:a,attrs:{perm:T}})}return l.forEach(T=>a.disposeData(T.dataId)),I}var F2e={kernelName:Np,backendName:"webgpu",kernelFunc:$2e},D2e=[ode,Hde,qde,Kde,Zde,epe,ope,upe,ppe,hpe,fpe,ype,Ape,vpe,kpe,Npe,Epe,$pe,Dpe,zpe,Upe,qpe,Ype,ece,ace,ice,ude,uce,hce,vce,Tce,Mce,$ce,Dce,zce,Wce,Vce,Hce,qce,Kce,Zce,ehe,ohe,uhe,nhe,che,fhe,Ahe,vhe,Ihe,Nhe,Ehe,Phe,$he,Dhe,zhe,Lhe,Bhe,Uhe,rde,Hhe,Zhe,qhe,Khe,e0e,a0e,r0e,o0e,d0e,c0e,m0e,lde,g0e,pce,x0e,b0e,w0e,I0e,C0e,N0e,M0e,F0e,_0e,O0e,L0e,B0e,H0e,X0e,Spe,Y0e,J0e,ime,eme,rme,lme,Cpe,dme,cme,mme,gme,vme,She,kme,Sme,Tme,Zpe,Eme,Pme,$me,Ome,Lme,Bme,Ume,Hme,Jpe,qme,Kme,Zme,Qme,sde,afe,sfe,lfe,pfe,mfe,gfe,xfe,bfe,wfe,Sfe,Nfe,Efe,Pfe,$fe,Dfe,zfe,Bpe,d2e,h2e,f2e,Ame,Wfe,Ufe,Xfe,Yfe,t2e,n2e,s2e,i2e,l2e,y2e,Che,A2e,v2e,k2e,Qfe,T2e,E2e,npe,P2e,F2e,Mme];for(let e of D2e)yn(e);var dA="4.14.0",O2e="4.14.0",z2e="4.14.0",L2e="4.14.0",W2e="4.14.0",B2e="4.14.0",ec={tfjs:dA,"tfjs-core":dA,"tfjs-converter":O2e,"tfjs-backend-cpu":z2e,"tfjs-backend-webgl":L2e,"tfjs-backend-wasm":W2e,"tfjs-backend-webgpu":B2e},J3=void 0;function K(...e){let t=new Date,a=`${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(a,"Human:",...e)}function Xk(e,t){let a=e.endsWith("/")?"":"/",r=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${a}${t}`;if(!r.toLocaleLowerCase().includes(".json"))throw new Error(`modelpath error: expecting json file: ${r}`);return r}var ae=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Q3(e,t,a="config",n=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")Q3(e[r],t[r],r,n);else{let s=e&&typeof e[r]!="undefined";s||n.push({reason:"unknown property",where:`${a}.${r} = ${t[r]}`});let i=e&&typeof e[r]==typeof t[r];s&&!i&&n.push({reason:"property type mismatch",where:`${a}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&a==="config"&&n.length>0&&K("invalid configuration",n),n}function Et(...e){let t=a=>a&&typeof a=="object";return e.reduce((a,n)=>(Object.keys(n||{}).forEach(r=>{let s=a[r],i=n[r];Array.isArray(s)&&Array.isArray(i)?a[r]=s.concat(...i):t(s)&&t(i)?a[r]=Et(s,i):a[r]=i}),a),{})}var ll={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var Kk=` + `}};function gge(e){let{inputs:t,backend:a,attrs:n}=e,{x:r,segmentIds:s}=t,{numSegments:i}=n,o=r.shape.length,l=[],u=0,d=I.getAxesPermutation([u],o),c=r;d!=null&&(c=ir({inputs:{x:r},backend:a,attrs:{perm:d}}),l.push(c),u=I.getInnerMostAxes(1,o)[0]);let p=I.segment_util.computeOutShape(c.shape,u,i),h=v.sizeFromShape([c.shape[u]]),m=ke({inputs:{x:c},backend:a,attrs:{shape:[-1,h]}});l.push(m);let f=r.dtype,g=[m.shape[0],i],y=Wa({backend:a,attrs:{shape:g,value:0,dtype:f}}),x=new fge(m.shape,g,f),A=[{type:"int32",data:[i]},{type:"int32",data:[v.sizeFromShape(m.shape)]}],b=a.runWebGPUProgram(x,[m,s],f,A,y),w=ke({inputs:{x:b},backend:a,attrs:{shape:p}});l.push(b);let S=w;if(d!=null){l.push(w);let C=I.getUndoAxesPermutation(d);S=ir({inputs:{x:S},backend:a,attrs:{perm:C}})}return l.forEach(C=>a.disposeData(C.dataId)),S}var yge={kernelName:_p,backendName:"webgpu",kernelFunc:gge},xge=[tpe,Cce,Rce,Mce,$ce,_ce,Uce,Hce,qce,Kce,Zce,Qce,the,nhe,she,dhe,che,ghe,xhe,bhe,She,Rhe,Fhe,_he,zhe,Vhe,npe,Hhe,Khe,n0e,u0e,h0e,g0e,x0e,b0e,w0e,I0e,C0e,R0e,M0e,$0e,_0e,U0e,H0e,L0e,X0e,Z0e,tme,nme,ime,dme,cme,mme,gme,xme,bme,vme,kme,Sme,Jde,Cme,$me,Rme,Mme,_me,zme,Wme,Ume,jme,Xme,Yme,ape,Jme,qhe,efe,afe,rfe,ife,lfe,dfe,hfe,yfe,ffe,Afe,vfe,kfe,Cfe,Efe,ohe,Ffe,Dfe,Vfe,_fe,Wfe,Gfe,lhe,jfe,Xfe,Yfe,Jfe,n2e,ome,s2e,o2e,u2e,$he,c2e,m2e,g2e,A2e,v2e,k2e,S2e,C2e,Dhe,R2e,M2e,$2e,P2e,Qde,z2e,B2e,G2e,q2e,Y2e,J2e,e1e,a1e,r1e,o1e,d1e,c1e,m1e,g1e,x1e,b1e,khe,j1e,K1e,Z1e,t2e,w1e,S1e,E1e,F1e,O1e,L1e,B1e,V1e,G1e,Q1e,lme,tge,nge,sge,P1e,uge,cge,Lce,mge,yge,h2e];for(let e of xge)bn(e);var RA="4.17.0",Age="4.17.0",bge="4.17.0",vge="4.17.0",wge="4.17.0",kge="4.14.0",lc={tfjs:RA,"tfjs-core":RA,"tfjs-converter":Age,"tfjs-backend-cpu":bge,"tfjs-backend-webgl":vge,"tfjs-backend-wasm":wge,"tfjs-backend-webgpu":kge},py=void 0;function K(...e){let t=new Date,a=`${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(a,"Human:",...e)}function L9(e,t){let a=e.endsWith("/")?"":"/",r=t.startsWith(".")||t.startsWith("/")||t.startsWith("http:")||t.startsWith("https:")||t.startsWith("file:")?`${t}`:`${e}${a}${t}`;if(!r.toLocaleLowerCase().includes(".json"))throw new Error(`modelpath error: expecting json file: ${r}`);return r}var ae=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function cy(e,t,a="config",n=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")cy(e[r],t[r],r,n);else{let s=e&&typeof e[r]!="undefined";s||n.push({reason:"unknown property",where:`${a}.${r} = ${t[r]}`});let i=e&&typeof e[r]==typeof t[r];s&&!i&&n.push({reason:"property type mismatch",where:`${a}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&a==="config"&&n.length>0&&K("invalid configuration",n),n}function Mt(...e){let t=a=>a&&typeof a=="object";return e.reduce((a,n)=>(Object.keys(n||{}).forEach(r=>{let s=a[r],i=n[r];Array.isArray(s)&&Array.isArray(i)?a[r]=s.concat(...i):t(s)&&t(i)?a[r]=Mt(s,i):a[r]=i}),a),{})}var yl={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,scale:1.4,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,scale:2.3,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var W9=` precision highp float; attribute vec2 pos; attribute vec2 uv; @@ -8533,7 +8533,7 @@ return a / b;`,vJ=` vUv = uv; gl_Position = vec4(pos.x, pos.y*flipY, 0.0, 1.); } -`;var Yk=` +`;var B9=` precision highp float; varying vec2 vUv; uniform sampler2D texture; @@ -8545,7 +8545,7 @@ return a / b;`,vJ=` gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[13] * c.a + m[14]; gl_FragColor.a = m[15] * c.r + m[16] * c.g + m[17] * c.b + m[18] * c.a + m[19]; } -`,Zk=` +`,V9=` precision highp float; varying vec2 vUv; uniform sampler2D texture; @@ -8557,7 +8557,7 @@ return a / b;`,vJ=` gl_FragColor.b = m[10] * c.r + m[11] * c.g + m[12] * c.b + m[14]; gl_FragColor.a = c.a; } -`,Jk=` +`,U9=` precision highp float; varying vec2 vUv; uniform vec2 size; @@ -8570,7 +8570,7 @@ return a / b;`,vJ=` vec2 coord = pixelate(vUv, size); gl_FragColor += texture2D(texture, coord); } -`,Qk=` +`,G9=` precision highp float; varying vec2 vUv; uniform sampler2D texture; @@ -8593,7 +8593,7 @@ return a / b;`,vJ=` gl_FragColor += texture2D(texture, vUv + vec2( 6.0*px.x, 6.0*px.y))*0.00895781211794; gl_FragColor += texture2D(texture, vUv + vec2( 7.0*px.x, 7.0*px.y))*0.0044299121055113265; } -`,e9=` +`,H9=` precision highp float; varying vec2 vUv; uniform sampler2D texture; @@ -8615,8 +8615,8 @@ return a / b;`,vJ=` c31 * m[6] + c32 * m[7] + c33 * m[8]; gl_FragColor.a = c22.a; } -`;var ey=(e,t,a)=>{let n=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(n,(r,s)=>(a[s]=0,r))},ty=class{constructor(t,a,n){he(this,"uniform",{});he(this,"attribute",{});he(this,"gl");he(this,"id");he(this,"compile",(t,a)=>{let n=this.gl.createShader(a);return n?(this.gl.shaderSource(n,t),this.gl.compileShader(n),this.gl.getShaderParameter(n,this.gl.COMPILE_STATUS)?n:(K(`filter: gl compile failed: ${this.gl.getShaderInfoLog(n)||"unknown"}`),null)):(K("filter: could not create shader"),null)});this.gl=t;let r=this.compile(a,this.gl.VERTEX_SHADER),s=this.compile(n,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){K("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){K(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),ey(a,"attribute",this.attribute);for(let i in this.attribute)this.attribute[i]=this.gl.getAttribLocation(this.id,i);ey(a,"uniform",this.uniform),ey(n,"uniform",this.uniform);for(let i in this.uniform)this.uniform[i]=this.gl.getUniformLocation(this.id,i)}}};function t9(){let e=0,t=null,a=!1,n=-1,r=[null,null],s=[],i=null,o=null,l=Mn(100,100),u={},p={INTERMEDIATE:1},c=l.getContext("webgl");if(!c){K("filter: cannot get webgl context");return}this.gl=c;function d(x,A){if(!(x===l.width&&A===l.height)){if(l.width=x,l.height=A,!i){let b=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]);i=c.createBuffer(),c.bindBuffer(c.ARRAY_BUFFER,i),c.bufferData(c.ARRAY_BUFFER,b,c.STATIC_DRAW),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}c.viewport(0,0,l.width,l.height),r=[null,null]}}function h(x,A){let b=c.createFramebuffer();c.bindFramebuffer(c.FRAMEBUFFER,b);let w=c.createRenderbuffer();c.bindRenderbuffer(c.RENDERBUFFER,w);let I=c.createTexture();return c.bindTexture(c.TEXTURE_2D,I),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,x,A,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,I,0),c.bindTexture(c.TEXTURE_2D,null),c.bindFramebuffer(c.FRAMEBUFFER,null),{fbo:b,texture:I}}function m(x){return r[x]=r[x]||h(l.width,l.height),r[x]}function f(x=0){if(!o)return;let A=null,b=null,w=!1;e===0?A=t:A=m(n).texture||null,e++,a&&!(x&p.INTERMEDIATE)?(b=null,w=e%2===0):(n=(n+1)%2,b=m(n).fbo||null),c.bindTexture(c.TEXTURE_2D,A),c.bindFramebuffer(c.FRAMEBUFFER,b),c.uniform1f(o.uniform.flipY,w?-1:1),c.drawArrays(c.TRIANGLES,0,6)}function g(x){if(u[x])return o=u[x],c.useProgram((o?o.id:null)||null),o;if(o=new ty(c,Kk,x),!o)return K("filter: could not get webgl program"),null;let A=Float32Array.BYTES_PER_ELEMENT,b=4*A;return c.enableVertexAttribArray(o.attribute.pos),c.vertexAttribPointer(o.attribute.pos,2,c.FLOAT,!1,b,0*A),c.enableVertexAttribArray(o.attribute.uv),c.vertexAttribPointer(o.attribute.uv,2,c.FLOAT,!1,b,2*A),u[x]=o,o}let y={colorMatrix:x=>{let A=new Float32Array(x);A[4]/=255,A[9]/=255,A[14]/=255,A[19]/=255;let b=A[18]===1&&A[3]===0&&A[8]===0&&A[13]===0&&A[15]===0&&A[16]===0&&A[17]===0&&A[19]===0?Zk:Yk,w=g(b);w&&(c.uniform1fv(w.uniform.m,A),f())},brightness:x=>{let A=(x||0)+1;y.colorMatrix([A,0,0,0,0,0,A,0,0,0,0,0,A,0,0,0,0,0,1,0])},saturation:x=>{let A=(x||0)*2/3+1,b=(A-1)*-.5;y.colorMatrix([A,b,b,0,0,b,A,b,0,0,b,b,A,0,0,0,0,0,1,0])},desaturate:()=>{y.saturation(-1)},contrast:x=>{let A=(x||0)+1,b=-128*(A-1);y.colorMatrix([A,0,0,0,b,0,A,0,0,b,0,0,A,0,b,0,0,0,1,0])},negative:()=>{y.contrast(-2)},hue:x=>{x=(x||0)/180*Math.PI;let A=Math.cos(x),b=Math.sin(x),w=.213,I=.715,T=.072;y.colorMatrix([w+A*(1-w)+b*-w,I+A*-I+b*-I,T+A*-T+b*(1-T),0,0,w+A*-w+b*.143,I+A*(1-I)+b*.14,T+A*-T+b*-.283,0,0,w+A*-w+b*-(1-w),I+A*-I+b*I,T+A*(1-T)+b*T,0,0,0,0,0,1,0])},desaturateLuminance:()=>{y.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{y.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{y.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{y.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{y.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{y.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{y.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{y.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:x=>{let A=new Float32Array(x),b=1/l.width,w=1/l.height,I=g(e9);I&&(c.uniform1fv(I.uniform.m,A),c.uniform2f(I.uniform.px,b,w),f())},detectEdges:()=>{y.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{y.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{y.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:x=>{let A=x||1;y.convolution.call(this,[0,-1*A,0,-1*A,1+4*A,-1*A,0,-1*A,0])},emboss:x=>{let A=x||1;y.convolution.call(this,[-2*A,-1*A,0,-1*A,1,1*A,0,1*A,2*A])},blur:x=>{let A=x/7/l.width,b=x/7/l.height,w=g(Qk);w&&(c.uniform2f(w.uniform.px,0,b),f(p.INTERMEDIATE),c.uniform2f(w.uniform.px,A,0),f())},pixelate:x=>{let A=x/l.width,b=x/l.height,w=g(Jk);w&&(c.uniform2f(w.uniform.size,A,b),f())}};this.add=function(x){let A=Array.prototype.slice.call(arguments,1),b=y[x];s.push({func:b,args:A})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(x){d(x.width,x.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,x);for(let A=0;Ap.data())),i=Math.max(s[0][0],s[1][0],s[2][0]),l=(i>1?255:1)/i,u;if(l>1){let p=[xe(a[0],n[0]),xe(a[1],n[1]),xe(a[2],n[2])],c=[xe(r[0],n[0]),xe(r[1],n[1]),xe(r[2],n[2])],d=[te(p[0],l),te(p[1],l),te(p[2],l)],h=pa([d[0],d[1],d[2]],2);u=Q(h,[1,t.shape[0]||0,t.shape[1]||0,3]),J([...p,...c,...d,h])}else u=Wt(t,0);return J([...a,...n,...r,a,t,e]),u}var m0=3840,ta=null,aa=null,ed=null,bt,An={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function ay(){An.inputSum=0,An.cacheDiff=1,An.sumMethod=0,An.inputTensor=void 0}function Mn(e,t){let a;if(ne.browser)if(ne.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");a=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")a=document.createElement("canvas"),a.width=e,a.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof ne.Canvas!="undefined")a=new ne.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")a=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof ne.Canvas!="undefined"?a=new ne.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(a=new globalThis.Canvas(e,t));return a}function f0(e,t){let a=t||Mn(e.width,e.height);return a.getContext("2d").drawImage(e,0,0),a}async function g0(e,t,a=!0){var d,h,m;if(!e)return t.debug&&K("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof gt)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof gt){let f=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)f=Wt(e,0);else if(e.shape[2]===4){let g=Hp(e,[0,0,0],[-1,-1,3]);f=Wt(g,0),J(g)}}else e.shape.length===4&&(e.shape[3]===3?f=Ia(e):e.shape[3]===4&&(f=Bh(e,[0,0,0,0],[-1,-1,-1,3])));if(f==null||f.shape.length!==4||f.shape[0]!==1||f.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(f.dtype==="int32"){let g=Ue(f,"float32");J(f),f=g}return{tensor:f,canvas:t.filter.return?aa:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&K("input stream is not ready"),{tensor:null,canvas:ta};let n=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!n||!r)return t.debug&&K("cannot determine input dimensions"),{tensor:null,canvas:ta};let s=n,i=r;if(s>m0&&(s=m0,i=Math.trunc(s*r/n)),i>m0&&(i=m0,s=Math.trunc(i*n/r)),(((d=t.filter)==null?void 0:d.width)||0)>0?s=t.filter.width:(((h=t.filter)==null?void 0:h.height)||0)>0&&(s=n*((t.filter.height||0)/r)),(t.filter.height||0)>0?i=t.filter.height:(t.filter.width||0)>0&&(i=r*((t.filter.width||0)/n)),!s||!i)throw new Error("input error: cannot determine dimension");(!ta||ta.width!==s||ta.height!==i)&&(ta=Mn(s,i));let o=ta.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?o.putImageData(e,0,0):t.filter.flip&&typeof o.translate!="undefined"?(o.translate(n,0),o.scale(-1,1),o.drawImage(e,0,0,n,r,0,0,ta.width,ta.height),o.setTransform(1,0,0,1,0,0)):o.drawImage(e,0,0,n,r,0,0,ta.width,ta.height),(!aa||ta.width!==aa.width||ta.height!==aa.height)&&(aa=Mn(ta.width,ta.height)),t.filter.enabled&&ne.webgl.supported?(bt||(bt=ne.browser?new t9:null),ne.filter=!!bt,bt!=null&&bt.add?(bt.reset(),t.filter.brightness!==0&&bt.add("brightness",t.filter.brightness),t.filter.contrast!==0&&bt.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&bt.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&bt.add("blur",t.filter.blur),t.filter.saturation!==0&&bt.add("saturation",t.filter.saturation),t.filter.hue!==0&&bt.add("hue",t.filter.hue),t.filter.negative&&bt.add("negative"),t.filter.sepia&&bt.add("sepia"),t.filter.vintage&&bt.add("brownie"),t.filter.sepia&&bt.add("sepia"),t.filter.kodachrome&&bt.add("kodachrome"),t.filter.technicolor&&bt.add("technicolor"),t.filter.polaroid&&bt.add("polaroid"),t.filter.pixelate!==0&&bt.add("pixelate",t.filter.pixelate),((m=bt.get())==null?void 0:m.length)>1?aa=bt.apply(ta):aa=bt.draw(ta)):(t.debug&&K("input process error: cannot initialize filters"),ne.webgl.supported=!1,t.filter.enabled=!1,f0(ta,aa))):(f0(ta,aa),bt&&(bt=null),ne.filter=!!bt),!a)return{tensor:null,canvas:aa};if(!aa)throw new Error("canvas error: cannot create output");let l,u=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(ne.browser&&Er)l=Er?Er.fromPixels(e):null;else{u=e.data.length/e.height/e.width;let f=new Uint8Array(e.data.buffer);l=Ve(f,[e.height,e.width,u],"int32")}else if((!ed||aa.width!==ed.width||aa.height!==ed.height)&&(ed=Mn(aa.width,aa.height)),Er&&ne.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=Er.fromPixels(aa):(ed=f0(aa),l=Er.fromPixels(ed));else{let y=f0(aa).getContext("2d").getImageData(0,0,s,i);u=y.data.length/s/i;let x=new Uint8Array(y.data.buffer);l=Ve(x,[s,i,u])}if(u===4){let f=Hp(l,[0,0,0],[-1,-1,3]);J(l),l=f}if(!l)throw new Error("input error: cannot create tensor");let p=Ue(l,"float32"),c=t.filter.equalization?await h0(p):Wt(p,0);if(J([l,p]),t.filter.autoBrightness){let f=fa(c),g=await f.data();t.filter.brightness=g[0]>1?1-g[0]/255:1-g[0],J(f)}return{tensor:c,canvas:t.filter.return?aa:null}}async function a9(e,t){let a=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return a;if(!An.inputTensor)An.inputTensor=Ia(t);else if(An.inputTensor.shape[1]!==t.shape[1]||An.inputTensor.shape[2]!==t.shape[2])J(An.inputTensor),An.inputTensor=Ia(t);else{let n={};n.diff=xe(t,An.inputTensor),n.squared=te(n.diff,n.diff),n.sum=ot(n.squared);let s=(await n.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;J([An.inputTensor,n.diff,n.squared,n.sum]),An.inputTensor=Ia(t),a=s<=(e.cacheSensitivity||0)}return a}async function n9(e,t,a){let n={};if(!t||!a||t.shape.length!==4||t.shape.length!==a.shape.length)return e.debug||K("invalid input tensor or tensor shapes do not match:",t.shape,a.shape),0;if(t.shape[0]!==1||a.shape[0]!==1||t.shape[3]!==3||a.shape[3]!==3)return e.debug||K("input tensors must be of shape [1, height, width, 3]:",t.shape,a.shape),0;n.input1=Ia(t),n.input2=t.shape[1]!==a.shape[1]||t.shape[2]!==a.shape[2]?fe.resizeBilinear(a,[t.shape[1],t.shape[2]]):Ia(a),n.diff=xe(n.input1,n.input2),n.squared=te(n.diff,n.diff),n.sum=ot(n.squared);let s=(await n.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return J([n.input1,n.input2,n.diff,n.squared,n.sum]),s}var ac,nc,rc,tc=class{constructor(){he(this,"browser");he(this,"node");he(this,"worker");he(this,"platform","");he(this,"agent","");he(this,"backends",[]);he(this,"initial");he(this,"filter");he(this,"tfjs");he(this,"offscreen");he(this,"perfadd",!1);he(this,"tensorflow",{version:void 0,gpu:void 0});he(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});he(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});he(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});he(this,"cpu",{model:void 0,flags:[]});he(this,"kernels",[]);jn(this,ac,void 0);jn(this,nc,void 0);jn(this,rc,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:ec["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",a=t.match(/\(([^()]+)\)/g);if(a!=null&&a[0]){let n=a[0].match(/\(([^()]+)\)/g);this.platform=n!=null&&n[0]?n[0].replace(/\(|\)/g,""):"",this.agent=t.replace(a[0],""),this.platform[1]&&(this.agent=this.agent.replace(a[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return qa(this,ac)}set Canvas(t){xr(this,ac,t),globalThis.Canvas=t}get Image(){return qa(this,nc)}set Image(t){xr(this,nc,t),globalThis.Image=t}get ImageData(){return qa(this,rc)}set ImageData(t){xr(this,rc,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(It().registryFactory);try{this.tensorflow={version:nr().binding?nr().binding.TF_Version:void 0,gpu:nr().binding?nr().binding.isUsingGpuDevice():void 0}}catch(n){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await B().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await B().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Mn(100,100),a=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof a!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&a&&(this.webgl.version=a.getParameter(a.VERSION),this.webgl.vendor=a.getParameter(a.VENDOR),this.webgl.renderer=a.getParameter(a.RENDERER),this.webgl.shader=a.getParameter(a.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let n=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(n==null?void 0:n.requestAdapterInfo())}}catch(n){this.webgpu.supported=!1}try{this.kernels=Zn(ca()).map(n=>n.kernelName.toLowerCase())}catch(n){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};ac=new WeakMap,nc=new WeakMap,rc=new WeakMap;var ne=new tc;var x0=class{constructor(){he(this,"config");he(this,"element");he(this,"stream");he(this,"devices",[]);he(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(a=>a.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});he(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let i=document.getElementById(t.element);if(i&&i instanceof HTMLVideoElement)this.element=i;else return this.config.debug&&K("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&K("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let a={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(a.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(a.video.height={ideal:this.config.height}),this.config.id&&(a.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&K("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&K("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&K("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(a)}catch(i){return K("webcam",i),`webcam error: ${i}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(i=>{this.element?this.element.onloadeddata=()=>i(!0):i(!1)}),await this.element.play(),this.config.debug&&K("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&K("webcam error","no stream"),"webcam error no stream")});he(this,"pause",()=>{this.element&&this.element.pause()});he(this,"play",async()=>{this.element&&await this.element.play()});he(this,"stop",()=>{this.config.debug&&K("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var ny={};yr(ny,{"affectnet-mobilenet":()=>n1e,age:()=>r1e,"anti-spoofing":()=>D1e,antispoof:()=>H2e,blazeface:()=>j2e,"blazeface-back":()=>s1e,"blazeface-front":()=>i1e,"blazepose-detector":()=>o1e,"blazepose-full":()=>l1e,"blazepose-heavy":()=>u1e,"blazepose-lite":()=>d1e,centernet:()=>q2e,default:()=>K1e,efficientpose:()=>p1e,"efficientpose-i-lite":()=>O1e,"efficientpose-ii-lite":()=>z1e,"efficientpose-iv":()=>L1e,emotion:()=>X2e,faceboxes:()=>c1e,facemesh:()=>K2e,"facemesh-attention":()=>m1e,"facemesh-attention-pinto":()=>h1e,"facemesh-detection-full":()=>f1e,"facemesh-detection-short":()=>g1e,faceres:()=>Y2e,"faceres-deep":()=>y1e,gear:()=>b1e,"gear-e1":()=>x1e,"gear-e2":()=>A1e,gender:()=>w1e,"gender-ssrnet-imdb":()=>v1e,handdetect:()=>k1e,"handlandmark-full":()=>I1e,"handlandmark-lite":()=>Z2e,"handlandmark-sparse":()=>S1e,handskeleton:()=>C1e,handtrack:()=>J2e,"insightface-efficientnet-b0":()=>W1e,"insightface-ghostnet-strides1":()=>B1e,"insightface-ghostnet-strides2":()=>V1e,"insightface-mobilenet-emore":()=>U1e,"insightface-mobilenet-swish":()=>G1e,iris:()=>Q2e,liveness:()=>e1e,meet:()=>T1e,mobileface:()=>N1e,mobilefacenet:()=>R1e,models:()=>t1e,"movenet-lightning":()=>a1e,"movenet-multipose":()=>E1e,"movenet-thunder":()=>M1e,nanodet:()=>P1e,"nanodet-e":()=>H1e,"nanodet-g":()=>j1e,"nanodet-m":()=>q1e,"nanodet-t":()=>X1e,posenet:()=>_1e,rvm:()=>$1e,selfie:()=>F1e});var H2e=853098,j2e=538928,q2e=4030290,X2e=820516,K2e=1477958,Y2e=6978814,Z2e=2023432,J2e=2964837,Q2e=2599092,e1e=592976,t1e=0,a1e=4650216,n1e=6920630,r1e=161240,s1e=538928,i1e=402048,o1e=5928856,l1e=6339202,u1e=27502466,d1e=2726402,p1e=5651240,c1e=2013002,h1e=2387598,m1e=2382414,f1e=1026192,g1e=201268,y1e=13957620,x1e=112438,A1e=112438,b1e=1498916,v1e=161236,w1e=201808,k1e=3515612,I1e=5431368,S1e=5286322,C1e=5502280,T1e=372228,N1e=2183192,R1e=5171976,E1e=9448838,M1e=12477112,P1e=7574558,_1e=5032780,$1e=3739355,F1e=212886,D1e=853098,O1e=2269064,z1e=5651240,L1e=25643252,W1e=13013224,B1e=8093408,V1e=8049584,U1e=6938536,G1e=12168584,H1e=12319156,j1e=7574558,q1e=1887474,X1e=5294216,K1e={antispoof:H2e,blazeface:j2e,centernet:q2e,emotion:X2e,facemesh:K2e,faceres:Y2e,"handlandmark-lite":Z2e,handtrack:J2e,iris:Q2e,liveness:e1e,models:t1e,"movenet-lightning":a1e,"affectnet-mobilenet":n1e,age:r1e,"blazeface-back":s1e,"blazeface-front":i1e,"blazepose-detector":o1e,"blazepose-full":l1e,"blazepose-heavy":u1e,"blazepose-lite":d1e,efficientpose:p1e,faceboxes:c1e,"facemesh-attention-pinto":h1e,"facemesh-attention":m1e,"facemesh-detection-full":f1e,"facemesh-detection-short":g1e,"faceres-deep":y1e,"gear-e1":x1e,"gear-e2":A1e,gear:b1e,"gender-ssrnet-imdb":v1e,gender:w1e,handdetect:k1e,"handlandmark-full":I1e,"handlandmark-sparse":S1e,handskeleton:C1e,meet:T1e,mobileface:N1e,mobilefacenet:R1e,"movenet-multipose":E1e,"movenet-thunder":M1e,nanodet:P1e,posenet:_1e,rvm:$1e,selfie:F1e,"anti-spoofing":D1e,"efficientpose-i-lite":O1e,"efficientpose-ii-lite":z1e,"efficientpose-iv":L1e,"insightface-efficientnet-b0":W1e,"insightface-ghostnet-strides1":B1e,"insightface-ghostnet-strides2":V1e,"insightface-mobilenet-emore":U1e,"insightface-mobilenet-swish":G1e,"nanodet-e":H1e,"nanodet-g":j1e,"nanodet-m":q1e,"nanodet-t":X1e};var Ea={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},ya={};async function Y1e(e,t){return Ea.debug&&K("load model fetch:",e,t),fetch(e,t)}function r9(e){Ea.cacheModels=e.cacheModels,Ea.verbose=e.debug,Ea.modelBasePath=e.modelBasePath}async function Pe(e){var u,p,c,d;let t=Xk(Ea.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let a=t.includes("/")?t.split("/"):t.split("\\"),n=a[a.length-1].replace(".json",""),r="indexeddb://"+n;ya[n]={name:n,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:ny[n],inCache:!1,url:""},Ea.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=Ea.cacheSupported&&Ea.cacheModels?await Xn.listModels():{}}catch(h){Ea.cacheSupported=!1}ya[n].inCache=Ea.cacheSupported&&Ea.cacheModels&&Object.keys(s).includes(r),ya[n].url=ya[n].inCache?r:t;let i=typeof fetch=="undefined"?{}:{fetchFunc:(h,m)=>Y1e(h,m)},o=new jp(ya[n].url,i),l=!1;try{o.findIOHandler(),Ea.debug&&K("model load handler:",o.handler)}catch(h){K("error finding model i/o handler:",t,h)}try{let h=await((u=o.handler)==null?void 0:u.load())||null;ya[n].sizeFromManifest=((p=h==null?void 0:h.weightData)==null?void 0:p.byteLength)||0,h?o.loadSync(h):o=await u3(ya[n].inCache?r:t,i),ya[n].sizeLoadedWeights=((d=(c=o.artifacts)==null?void 0:c.weightData)==null?void 0:d.byteLength)||0,Ea.verbose&&K("load:",{model:n,url:o.modelUrl,bytes:ya[n].sizeLoadedWeights}),l=!0}catch(h){K("error loading model:",t,h)}if(l&&Ea.cacheModels&&Ea.cacheSupported&&!ya[n].inCache)try{let h=await o.save(r);Ea.debug&&K("model saved:",r,h)}catch(h){K("error saving model:",t,h)}return o}var ry="3.2.0";var St={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function Q1e(){let e=St.gl;e&&(St.extensions=e.getSupportedExtensions())}function s9(e){var t;if(e.config.backend==="humangl"&&(St.name in It().registry&&!((t=St==null?void 0:St.gl)!=null&&t.getParameter(St.gl.VERSION))&&(K("humangl error: backend invalid context"),e.models.reset()),!dg(St.name))){try{St.canvas=Mn(100,100)}catch(r){K("humangl error: cannot create canvas:",r);return}try{if(St.gl=St.canvas.getContext("webgl2",St.webGLattr),!St.gl){K("humangl error: cannot get webgl context");return}if(!St.gl.getParameter(St.gl.VERSION).includes("2.0")){K("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}St.canvas&&(St.canvas.addEventListener("webglcontextlost",s=>{throw K("humangl error:",s.type),K("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),St.canvas.addEventListener("webglcontextrestored",s=>{K("humangl error: context restored:",s)}),St.canvas.addEventListener("webglcontextcreationerror",s=>{K("humangl error: context create:",s)}))}catch(r){K("humangl error: cannot get webgl context:",r);return}try{a0(2,St.gl)}catch(r){K("humangl error: cannot set webgl context:",r);return}try{let r=new Vl(St.gl);Qo(St.name,()=>new Yp(r),St.priority)}catch(r){K("humangl error: cannot register webgl backend:",r);return}try{Zn("webgl").forEach(s=>{let i={...s,backendName:St.name};yn(i)})}catch(r){K("humangl error: cannot update webgl backend registration:",r);return}try{B().flagRegistry.WEBGL_VERSION&&B().set("WEBGL_VERSION",2)}catch(r){K("humangl error: cannot set WebGL backend flags:",r);return}Q1e();let a=nr(),n=typeof a.gpgpu!="undefined"?a.getGPGPUContext().gl:null;n?e.config.debug&&K("humangl backend registered:",{webgl:n.getParameter(n.VERSION),renderer:n.getParameter(n.RENDERER)}):K("humangl error: no current gl context:",n,St.gl)}}var ze={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function i9(){ze.tf255=Ge(255,"float32"),ze.tf1=Ge(1,"float32"),ze.tf2=Ge(2,"float32"),ze.tf05=Ge(.5,"float32"),ze.tf127=Ge(127.5,"float32"),ze.rgb=Bt([.2989,.587,.114],"float32")}async function age(){var e;return await ne.updateBackend(),(e=ne.tensorflow)!=null&&e.version?"tensorflow":ne.webgpu.supported&&ne.webgpu.backend?"webgpu":ne.webgl.supported&&ne.webgl.backend?"webgl":ne.wasm.supported&&ne.wasm.backend?"wasm":"cpu"}function nge(e){let t=[];if(!ne.kernels.includes("mod")){let a={kernelName:"Mod",backendName:ca(),kernelFunc:n=>De(()=>xe(n.inputs.a,te(ve(n.inputs.a,n.inputs.b),n.inputs.b)))};yn(a),ne.kernels.push("mod"),t.push("mod")}if(!ne.kernels.includes("floormod")){let a={kernelName:"FloorMod",backendName:ca(),kernelFunc:n=>De(()=>we(te(Dp(n.inputs.a,n.inputs.b),n.inputs.b),Bu(n.inputs.a,n.inputs.b)))};yn(a),ne.kernels.push("floormod"),t.push("floormod")}if(!ne.kernels.includes("rotatewithoffset")&&e.softwareKernels){let a={kernelName:"RotateWithOffset",backendName:ca(),kernelFunc:n=>De(()=>{let r=ca();$p("cpu");let s=fe.rotateWithOffset(n.inputs.image,n.attrs.radians,n.attrs.fillValue,n.attrs.center);return $p(r),s})};yn(a),ne.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&K("registered kernels:",t)}var o9={};async function sc(e,t=!1){var a,n;if(e.state="backend",((a=e.config.backend)==null?void 0:a.length)===0&&(e.config.backend=await age()),t||ne.initial||e.config.backend&&e.config.backend.length>0&&ca()!==e.config.backend){let r=ae();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&K("running inside web worker"),typeof navigator!="undefined"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.toLowerCase().includes("electron"))&&e.config.debug&&K("running inside electron");let s=Object.keys(It().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(s9(e),s=Object.keys(It().registryFactory)),e.config.debug&&K("available backends:",s),ne.browser&&!ne.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&K("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),ne.node&&!ne.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&K(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),ne.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")K("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let i=await navigator.gpu.requestAdapter();if(e.config.debug&&K("enumerated webgpu adapter:",i),!i)K("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let o="requestAdapterInfo"in i?await i.requestAdapterInfo():void 0;K("webgpu adapter info:",o)}}if(s.includes(e.config.backend)||(K(`error: backend ${e.config.backend} not found in registry`),e.config.backend=ne.node?"tensorflow":"webgl",e.config.debug&&K(`override: setting backend ${e.config.backend}`)),e.config.debug&&K("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(B().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&B().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&K("wasm path:",e.config.wasmPath),typeof l0!="undefined")l0(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let i=!1,o=!1;try{i=await B().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),o=await B().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&K(`wasm execution: ${o?"simd":"no simd"} ${i?"multithreaded":"singlethreaded"}`),e.config.debug&&!o&&K("warning: wasm simd support is not enabled")}catch(l){K("wasm detection failed")}}try{await $p(e.config.backend),await Fp()}catch(i){return K("error: cannot set backend:",e.config.backend,i),!1}e.config.debug&&(o9=JSON.parse(JSON.stringify(B().flags)))}if((ca()==="humangl"||ca()==="webgl")&&(B().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&B().set("WEBGL_USE_SHAPES_UNIFORMS",!0),B().flagRegistry.WEBGL_EXP_CONV&&B().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(K("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),B().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),ca(),e.config.debug){let s=B().flags,i={};for(let o of Object.keys(s))o9[o]!==s[o]&&(i[o]=s[o]);e.config.debug&&Object.keys(i).length>0&&K("backend:",ca(),"flags:",i)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&K("flags:",e.config.flags);for(let[s,i]of Object.entries(e.config.flags))B().set(s,i)}lg(),i9(),e.performance.initBackend=Math.trunc(ae()-r),e.config.backend=ca(),await ne.updateBackend(),nge(e.config)}return!0}function A0(e,t){for(let a of e){let n={kernelName:a,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&K("kernelFunc",a,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};yn(n)}ne.kernels=Zn(ca()).map(a=>a.kernelName.toLowerCase())}var S0={};yr(S0,{all:()=>$ge,body:()=>v0,canvas:()=>_ge,face:()=>b0,gesture:()=>I0,hand:()=>w0,init:()=>py,object:()=>k0,options:()=>Ft,person:()=>Pge});var bn=e=>{if(!e)K("draw error: invalid canvas");else if(!e.getContext)K("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)K("draw error: cannot get canvas context");else return t}return null},ul=e=>Math.round(e*180/Math.PI),ut=(e,t,a)=>e.replace(t,typeof a=="number"?a.toFixed(1):a),dl=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let a=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${a[0]}, ${a[1]}, ${a[2]}, ${t.alpha})`};function vn(e,t,a,n,r){let s=t.replace(/\[.*\]/g,"").split(` -`).map(o=>o.trim()),i=Math.max(0,a);for(let o=s.length-1;o>=0;o--){let l=o*r.lineHeight+n;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[o],i+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[o],i+4,l+15)}}function lr(e,t,a,n,r){e.fillStyle=dl(n,r),e.beginPath(),e.arc(t,a,r.pointSize,0,2*Math.PI),e.fill()}function ur(e,t,a,n,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let i=(t+t+n)/2,o=(a+a+r)/2;e.ellipse(i,o,n/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,a),e.lineTo(t+n-s.roundRect,a),e.quadraticCurveTo(t+n,a,t+n,a+s.roundRect),e.lineTo(t+n,a+r-s.roundRect),e.quadraticCurveTo(t+n,a+r,t+n-s.roundRect,a+r),e.lineTo(t+s.roundRect,a+r),e.quadraticCurveTo(t,a+r,t,a+r-s.roundRect),e.lineTo(t,a+s.roundRect),e.quadraticCurveTo(t,a,t+s.roundRect,a),e.closePath();e.stroke()}function sy(e,t,a){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let n of t)e.strokeStyle=dl(n[2]||0,a),e.lineTo(Math.trunc(n[0]),Math.trunc(n[1]));e.stroke(),a.fillPolygons&&(e.closePath(),e.fill())}}function u9(e,t,a){if(!(t.length<2)){if(e.lineWidth=a.lineWidth,!a.useCurves||t.length<=2){sy(e,t,a);return}e.moveTo(t[0][0],t[0][1]);for(let n=0;nic[e]),Fbe=sge.map(e=>ic[e]),Dbe=ige.map(e=>ic[e]);function ys(e){let t=e.map(a=>a[0]);return t.push(e[e.length-1][1]),t}var oge=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],lge=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],uge=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],dge=[[474,475],[475,476],[476,477],[477,474]],pge=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],cge=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],hge=[[469,470],[470,471],[471,472],[472,469]],mge=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Obe={lips:ys(oge),leftEye:ys(lge),leftEyebrow:ys(uge),leftIris:ys(dge),rightEye:ys(pge),rightEyebrow:ys(cge),rightIris:ys(hge),faceOval:ys(mge)};var fge=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],gge=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],yge=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],xge=[[474,475],[475,476],[476,477],[477,474]],Age=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],bge=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],vge=[[469,470],[470,471],[471,472],[472,469]],wge=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function xs(e){let t=e.map(a=>a[0]);return t.push(e[e.length-1][1]),t}var kge={lips:xs(fge),leftEye:xs(gge),leftEyebrow:xs(yge),leftIris:xs(xge),rightEye:xs(Age),rightEyebrow:xs(bge),rightIris:xs(vge),faceOval:xs(wge)},Ige=Object.entries(kge).map(([e,t])=>t.map(a=>[a,e])).flat(),zbe=new Map(Ige),oc=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],hl=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],ml=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var rt;function Sge(e,t){var n,r,s,i,o,l,u,p,c;if(!rt.drawLabels||((n=rt.faceLabels)==null?void 0:n.length)===0)return;let a=rt.faceLabels.slice();if(a=ut(a,"[id]",e.id.toFixed(0)),e.score&&(a=ut(a,"[score]",100*e.score)),e.gender&&(a=ut(a,"[gender]",e.gender)),e.genderScore&&(a=ut(a,"[genderScore]",100*e.genderScore)),e.age&&(a=ut(a,"[age]",e.age)),e.distance&&(a=ut(a,"[distance]",100*e.distance)),e.real&&(a=ut(a,"[real]",100*e.real)),e.live&&(a=ut(a,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let d=e.emotion.map(h=>`${Math.trunc(100*h.score)}% ${h.emotion}`);d.length>3&&(d.length=3),a=ut(a,"[emotions]",d.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(a=ut(a,"[roll]",ul(e.rotation.angle.roll))),(o=(i=e.rotation)==null?void 0:i.angle)!=null&&o.yaw&&(a=ut(a,"[yaw]",ul(e.rotation.angle.yaw))),(u=(l=e.rotation)==null?void 0:l.angle)!=null&&u.pitch&&(a=ut(a,"[pitch]",ul(e.rotation.angle.pitch))),(c=(p=e.rotation)==null?void 0:p.gaze)!=null&&c.bearing&&(a=ut(a,"[gaze]",ul(e.rotation.gaze.bearing))),vn(t,a,e.box[0],e.box[1],rt)}function Cge(e,t){var a,n,r,s;if((a=e.annotations)!=null&&a.leftEyeIris&&((n=e.annotations)!=null&&n.leftEyeIris[0])){t.strokeStyle=rt.useDepth?"rgba(255, 200, 255, 0.3)":rt.color,t.beginPath();let i=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,o=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],i,o,0,0,2*Math.PI),t.stroke(),rt.fillPolygons&&(t.fillStyle=rt.useDepth?"rgba(255, 255, 200, 0.3)":rt.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=rt.useDepth?"rgba(255, 200, 255, 0.3)":rt.color,t.beginPath();let i=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,o=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],i,o,0,0,2*Math.PI),t.stroke(),rt.fillPolygons&&(t.fillStyle=rt.useDepth?"rgba(255, 255, 200, 0.3)":rt.color,t.fill())}}function Tge(e,t){var a;if(rt.drawGaze&&((a=e.rotation)!=null&&a.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let n=e.box[0]+e.box[2]/2-e.box[3]*ul(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*ul(e.rotation.angle.pitch)/90,s=new Path2D(` +`;var hy=(e,t,a)=>{let n=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(n,(r,s)=>(a[s]=0,r))},my=class{constructor(t,a,n){he(this,"uniform",{});he(this,"attribute",{});he(this,"gl");he(this,"id");he(this,"compile",(t,a)=>{let n=this.gl.createShader(a);return n?(this.gl.shaderSource(n,t),this.gl.compileShader(n),this.gl.getShaderParameter(n,this.gl.COMPILE_STATUS)?n:(K(`filter: gl compile failed: ${this.gl.getShaderInfoLog(n)||"unknown"}`),null)):(K("filter: could not create shader"),null)});this.gl=t;let r=this.compile(a,this.gl.VERTEX_SHADER),s=this.compile(n,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){K("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){K(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),hy(a,"attribute",this.attribute);for(let i in this.attribute)this.attribute[i]=this.gl.getAttribLocation(this.id,i);hy(a,"uniform",this.uniform),hy(n,"uniform",this.uniform);for(let i in this.uniform)this.uniform[i]=this.gl.getUniformLocation(this.id,i)}}};function j9(){let e=0,t=null,a=!1,n=-1,r=[null,null],s=[],i=null,o=null,l=Dn(100,100),u={},d={INTERMEDIATE:1},c=l.getContext("webgl");if(!c){K("filter: cannot get webgl context");return}this.gl=c;function p(x,A){if(!(x===l.width&&A===l.height)){if(l.width=x,l.height=A,!i){let b=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]);i=c.createBuffer(),c.bindBuffer(c.ARRAY_BUFFER,i),c.bufferData(c.ARRAY_BUFFER,b,c.STATIC_DRAW),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}c.viewport(0,0,l.width,l.height),r=[null,null]}}function h(x,A){let b=c.createFramebuffer();c.bindFramebuffer(c.FRAMEBUFFER,b);let w=c.createRenderbuffer();c.bindRenderbuffer(c.RENDERBUFFER,w);let S=c.createTexture();return c.bindTexture(c.TEXTURE_2D,S),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,x,A,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,S,0),c.bindTexture(c.TEXTURE_2D,null),c.bindFramebuffer(c.FRAMEBUFFER,null),{fbo:b,texture:S}}function m(x){return r[x]=r[x]||h(l.width,l.height),r[x]}function f(x=0){if(!o)return;let A=null,b=null,w=!1;e===0?A=t:A=m(n).texture||null,e++,a&&!(x&d.INTERMEDIATE)?(b=null,w=e%2===0):(n=(n+1)%2,b=m(n).fbo||null),c.bindTexture(c.TEXTURE_2D,A),c.bindFramebuffer(c.FRAMEBUFFER,b),c.uniform1f(o.uniform.flipY,w?-1:1),c.drawArrays(c.TRIANGLES,0,6)}function g(x){if(u[x])return o=u[x],c.useProgram((o?o.id:null)||null),o;if(o=new my(c,W9,x),!o)return K("filter: could not get webgl program"),null;let A=Float32Array.BYTES_PER_ELEMENT,b=4*A;return c.enableVertexAttribArray(o.attribute.pos),c.vertexAttribPointer(o.attribute.pos,2,c.FLOAT,!1,b,0*A),c.enableVertexAttribArray(o.attribute.uv),c.vertexAttribPointer(o.attribute.uv,2,c.FLOAT,!1,b,2*A),u[x]=o,o}let y={colorMatrix:x=>{let A=new Float32Array(x);A[4]/=255,A[9]/=255,A[14]/=255,A[19]/=255;let b=A[18]===1&&A[3]===0&&A[8]===0&&A[13]===0&&A[15]===0&&A[16]===0&&A[17]===0&&A[19]===0?V9:B9,w=g(b);w&&(c.uniform1fv(w.uniform.m,A),f())},brightness:x=>{let A=(x||0)+1;y.colorMatrix([A,0,0,0,0,0,A,0,0,0,0,0,A,0,0,0,0,0,1,0])},saturation:x=>{let A=(x||0)*2/3+1,b=(A-1)*-.5;y.colorMatrix([A,b,b,0,0,b,A,b,0,0,b,b,A,0,0,0,0,0,1,0])},desaturate:()=>{y.saturation(-1)},contrast:x=>{let A=(x||0)+1,b=-128*(A-1);y.colorMatrix([A,0,0,0,b,0,A,0,0,b,0,0,A,0,b,0,0,0,1,0])},negative:()=>{y.contrast(-2)},hue:x=>{x=(x||0)/180*Math.PI;let A=Math.cos(x),b=Math.sin(x),w=.213,S=.715,C=.072;y.colorMatrix([w+A*(1-w)+b*-w,S+A*-S+b*-S,C+A*-C+b*(1-C),0,0,w+A*-w+b*.143,S+A*(1-S)+b*.14,C+A*-C+b*-.283,0,0,w+A*-w+b*-(1-w),S+A*-S+b*S,C+A*(1-C)+b*C,0,0,0,0,0,1,0])},desaturateLuminance:()=>{y.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{y.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{y.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{y.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{y.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{y.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{y.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{y.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:x=>{let A=new Float32Array(x),b=1/l.width,w=1/l.height,S=g(H9);S&&(c.uniform1fv(S.uniform.m,A),c.uniform2f(S.uniform.px,b,w),f())},detectEdges:()=>{y.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{y.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{y.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:x=>{let A=x||1;y.convolution.call(this,[0,-1*A,0,-1*A,1+4*A,-1*A,0,-1*A,0])},emboss:x=>{let A=x||1;y.convolution.call(this,[-2*A,-1*A,0,-1*A,1,1*A,0,1*A,2*A])},blur:x=>{let A=x/7/l.width,b=x/7/l.height,w=g(G9);w&&(c.uniform2f(w.uniform.px,0,b),f(d.INTERMEDIATE),c.uniform2f(w.uniform.px,A,0),f())},pixelate:x=>{let A=x/l.width,b=x/l.height,w=g(U9);w&&(c.uniform2f(w.uniform.size,A,b),f())}};this.add=function(x){let A=Array.prototype.slice.call(arguments,1),b=y[x];s.push({func:b,args:A})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(x){p(x.width,x.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,x);for(let A=0;Ad.data())),i=Math.max(s[0][0],s[1][0],s[2][0]),l=(i>1?255:1)/i,u;if(l>1){let d=[xe(a[0],n[0]),xe(a[1],n[1]),xe(a[2],n[2])],c=[xe(r[0],n[0]),xe(r[1],n[1]),xe(r[2],n[2])],p=[te(d[0],l),te(d[1],l),te(d[2],l)],h=ca([p[0],p[1],p[2]],2);u=Q(h,[1,t.shape[0]||0,t.shape[1]||0,3]),J([...d,...c,...p,h])}else u=Bt(t,0);return J([...a,...n,...r,a,t,e]),u}var v0=3840,na=null,ra=null,ld=null,vt,wn={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function fy(){wn.inputSum=0,wn.cacheDiff=1,wn.sumMethod=0,wn.inputTensor=void 0}function Dn(e,t){let a;if(ne.browser)if(ne.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");a=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")a=document.createElement("canvas"),a.width=e,a.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof ne.Canvas!="undefined")a=new ne.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")a=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof ne.Canvas!="undefined"?a=new ne.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(a=new globalThis.Canvas(e,t));return a}function w0(e,t){let a=t||Dn(e.width,e.height);return a.getContext("2d").drawImage(e,0,0),a}async function k0(e,t,a=!0){var p,h,m;if(!e)return t.debug&&K("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof yt)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof yt){let f=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)f=Bt(e,0);else if(e.shape[2]===4){let g=Qp(e,[0,0,0],[-1,-1,3]);f=Bt(g,0),J(g)}}else e.shape.length===4&&(e.shape[3]===3?f=Ia(e):e.shape[3]===4&&(f=Kh(e,[0,0,0,0],[-1,-1,-1,3])));if(f==null||f.shape.length!==4||f.shape[0]!==1||f.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(f.dtype==="int32"){let g=Ue(f,"float32");J(f),f=g}return{tensor:f,canvas:t.filter.return?ra:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&K("input stream is not ready"),{tensor:null,canvas:na};let n=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!n||!r)return t.debug&&K("cannot determine input dimensions"),{tensor:null,canvas:na};let s=n,i=r;if(s>v0&&(s=v0,i=Math.trunc(s*r/n)),i>v0&&(i=v0,s=Math.trunc(i*n/r)),(((p=t.filter)==null?void 0:p.width)||0)>0?s=t.filter.width:(((h=t.filter)==null?void 0:h.height)||0)>0&&(s=n*((t.filter.height||0)/r)),(t.filter.height||0)>0?i=t.filter.height:(t.filter.width||0)>0&&(i=r*((t.filter.width||0)/n)),!s||!i)throw new Error("input error: cannot determine dimension");(!na||na.width!==s||na.height!==i)&&(na=Dn(s,i));let o=na.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?o.putImageData(e,0,0):t.filter.flip&&typeof o.translate!="undefined"?(o.translate(n,0),o.scale(-1,1),o.drawImage(e,0,0,n,r,0,0,na.width,na.height),o.setTransform(1,0,0,1,0,0)):o.drawImage(e,0,0,n,r,0,0,na.width,na.height),(!ra||na.width!==ra.width||na.height!==ra.height)&&(ra=Dn(na.width,na.height)),t.filter.enabled&&ne.webgl.supported?(vt||(vt=ne.browser?new j9:null),ne.filter=!!vt,vt!=null&&vt.add?(vt.reset(),t.filter.brightness!==0&&vt.add("brightness",t.filter.brightness),t.filter.contrast!==0&&vt.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&vt.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&vt.add("blur",t.filter.blur),t.filter.saturation!==0&&vt.add("saturation",t.filter.saturation),t.filter.hue!==0&&vt.add("hue",t.filter.hue),t.filter.negative&&vt.add("negative"),t.filter.sepia&&vt.add("sepia"),t.filter.vintage&&vt.add("brownie"),t.filter.sepia&&vt.add("sepia"),t.filter.kodachrome&&vt.add("kodachrome"),t.filter.technicolor&&vt.add("technicolor"),t.filter.polaroid&&vt.add("polaroid"),t.filter.pixelate!==0&&vt.add("pixelate",t.filter.pixelate),((m=vt.get())==null?void 0:m.length)>1?ra=vt.apply(na):ra=vt.draw(na)):(t.debug&&K("input process error: cannot initialize filters"),ne.webgl.supported=!1,t.filter.enabled=!1,w0(na,ra))):(w0(na,ra),vt&&(vt=null),ne.filter=!!vt),!a)return{tensor:null,canvas:ra};if(!ra)throw new Error("canvas error: cannot create output");let l,u=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(ne.browser&&Pr)l=Pr?Pr.fromPixels(e):null;else{u=e.data.length/e.height/e.width;let f=new Uint8Array(e.data.buffer);l=Ve(f,[e.height,e.width,u],"int32")}else if((!ld||ra.width!==ld.width||ra.height!==ld.height)&&(ld=Dn(ra.width,ra.height)),Pr&&ne.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=Pr.fromPixels(ra):(ld=w0(ra),l=Pr.fromPixels(ld));else{let y=w0(ra).getContext("2d").getImageData(0,0,s,i);u=y.data.length/s/i;let x=new Uint8Array(y.data.buffer);l=Ve(x,[s,i,u])}if(u===4){let f=Qp(l,[0,0,0],[-1,-1,3]);J(l),l=f}if(!l)throw new Error("input error: cannot create tensor");let d=Ue(l,"float32"),c=t.filter.equalization?await b0(d):Bt(d,0);if(J([l,d]),t.filter.autoBrightness){let f=fa(c),g=await f.data();t.filter.brightness=g[0]>1?1-g[0]/255:1-g[0],J(f)}return{tensor:c,canvas:t.filter.return?ra:null}}async function q9(e,t){let a=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return a;if(!wn.inputTensor)wn.inputTensor=Ia(t);else if(wn.inputTensor.shape[1]!==t.shape[1]||wn.inputTensor.shape[2]!==t.shape[2])J(wn.inputTensor),wn.inputTensor=Ia(t);else{let n={};n.diff=xe(t,wn.inputTensor),n.squared=te(n.diff,n.diff),n.sum=ot(n.squared);let s=(await n.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;J([wn.inputTensor,n.diff,n.squared,n.sum]),wn.inputTensor=Ia(t),a=s<=(e.cacheSensitivity||0)}return a}async function X9(e,t,a){let n={};if(!t||!a||t.shape.length!==4||t.shape.length!==a.shape.length)return e.debug||K("invalid input tensor or tensor shapes do not match:",t.shape,a.shape),0;if(t.shape[0]!==1||a.shape[0]!==1||t.shape[3]!==3||a.shape[3]!==3)return e.debug||K("input tensors must be of shape [1, height, width, 3]:",t.shape,a.shape),0;n.input1=Ia(t),n.input2=t.shape[1]!==a.shape[1]||t.shape[2]!==a.shape[2]?fe.resizeBilinear(a,[t.shape[1],t.shape[2]]):Ia(a),n.diff=xe(n.input1,n.input2),n.squared=te(n.diff,n.diff),n.sum=ot(n.squared);let s=(await n.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return J([n.input1,n.input2,n.diff,n.squared,n.sum]),s}var dc,pc,cc,uc=class{constructor(){he(this,"browser");he(this,"node");he(this,"worker");he(this,"platform","");he(this,"agent","");he(this,"backends",[]);he(this,"initial");he(this,"filter");he(this,"tfjs");he(this,"offscreen");he(this,"perfadd",!1);he(this,"tensorflow",{version:void 0,gpu:void 0});he(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});he(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});he(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});he(this,"cpu",{model:void 0,flags:[]});he(this,"kernels",[]);Yn(this,dc,void 0);Yn(this,pc,void 0);Yn(this,cc,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:lc["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",a=t.match(/\(([^()]+)\)/g);if(a!=null&&a[0]){let n=a[0].match(/\(([^()]+)\)/g);this.platform=n!=null&&n[0]?n[0].replace(/\(|\)/g,""):"",this.agent=t.replace(a[0],""),this.platform[1]&&(this.agent=this.agent.replace(a[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return Xa(this,dc)}set Canvas(t){wr(this,dc,t),globalThis.Canvas=t}get Image(){return Xa(this,pc)}set Image(t){wr(this,pc,t),globalThis.Image=t}get ImageData(){return Xa(this,cc)}set ImageData(t){wr(this,cc,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(St().registryFactory);try{this.tensorflow={version:Gn().binding?Gn().binding.TF_Version:void 0,gpu:Gn().binding?Gn().binding.isUsingGpuDevice():void 0}}catch(n){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await B().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await B().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Dn(100,100),a=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof a!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&a&&(this.webgl.version=a.getParameter(a.VERSION),this.webgl.vendor=a.getParameter(a.VENDOR),this.webgl.renderer=a.getParameter(a.RENDERER),this.webgl.shader=a.getParameter(a.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let n=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(n==null?void 0:n.requestAdapterInfo())}}catch(n){this.webgpu.supported=!1}try{this.kernels=tr(ea()).map(n=>n.kernelName.toLowerCase())}catch(n){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};dc=new WeakMap,pc=new WeakMap,cc=new WeakMap;var ne=new uc;var S0=class{constructor(){he(this,"config");he(this,"element");he(this,"stream");he(this,"devices",[]);he(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(a=>a.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});he(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let i=document.getElementById(t.element);if(i&&i instanceof HTMLVideoElement)this.element=i;else return this.config.debug&&K("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&K("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let a={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(a.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(a.video.height={ideal:this.config.height}),this.config.id&&(a.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&K("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&K("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&K("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(a)}catch(i){return K("webcam",i),`webcam error: ${i}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(i=>{this.element?this.element.onloadeddata=()=>i(!0):i(!1)}),await this.element.play(),this.config.debug&&K("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&K("webcam error","no stream"),"webcam error no stream")});he(this,"pause",()=>{this.element&&this.element.pause()});he(this,"play",async()=>{this.element&&await this.element.play()});he(this,"stop",()=>{this.config.debug&&K("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var gy={};vr(gy,{"affectnet-mobilenet":()=>Lge,age:()=>Wge,"anti-spoofing":()=>x3e,antispoof:()=>Cge,blazeface:()=>Nge,"blazeface-back":()=>Bge,"blazeface-front":()=>Vge,"blazepose-detector":()=>Uge,"blazepose-full":()=>Gge,"blazepose-heavy":()=>Hge,"blazepose-lite":()=>jge,centernet:()=>Rge,default:()=>M3e,efficientpose:()=>qge,"efficientpose-i-lite":()=>A3e,"efficientpose-ii-lite":()=>b3e,"efficientpose-iv":()=>v3e,emotion:()=>Ege,faceboxes:()=>Xge,facemesh:()=>Mge,"facemesh-attention":()=>Yge,"facemesh-attention-pinto":()=>Kge,"facemesh-detection-full":()=>Zge,"facemesh-detection-short":()=>Jge,faceres:()=>Fge,"faceres-deep":()=>Qge,gear:()=>a3e,"gear-e1":()=>e3e,"gear-e2":()=>t3e,gender:()=>r3e,"gender-ssrnet-imdb":()=>n3e,handdetect:()=>s3e,"handlandmark-full":()=>i3e,"handlandmark-lite":()=>$ge,"handlandmark-sparse":()=>o3e,handskeleton:()=>l3e,handtrack:()=>Dge,"insightface-efficientnet-b0":()=>w3e,"insightface-ghostnet-strides1":()=>k3e,"insightface-ghostnet-strides2":()=>I3e,"insightface-mobilenet-emore":()=>S3e,"insightface-mobilenet-swish":()=>T3e,iris:()=>Pge,liveness:()=>_ge,meet:()=>u3e,mobileface:()=>d3e,mobilefacenet:()=>p3e,models:()=>Oge,"movenet-lightning":()=>zge,"movenet-multipose":()=>c3e,"movenet-thunder":()=>h3e,nanodet:()=>m3e,"nanodet-e":()=>C3e,"nanodet-g":()=>N3e,"nanodet-m":()=>R3e,"nanodet-t":()=>E3e,posenet:()=>f3e,rvm:()=>g3e,selfie:()=>y3e});var Cge=853098,Nge=538928,Rge=4030290,Ege=820516,Mge=1477958,Fge=6978814,$ge=2023432,Dge=2964837,Pge=2599092,_ge=592976,Oge=0,zge=4650216,Lge=6920630,Wge=161240,Bge=538928,Vge=402048,Uge=5928856,Gge=6339202,Hge=27502466,jge=2726402,qge=5651240,Xge=2013002,Kge=2387598,Yge=2382414,Zge=1026192,Jge=201268,Qge=13957620,e3e=112438,t3e=112438,a3e=1498916,n3e=161236,r3e=201808,s3e=3515612,i3e=5431368,o3e=5286322,l3e=5502280,u3e=372228,d3e=2183192,p3e=5171976,c3e=9448838,h3e=12477112,m3e=7574558,f3e=5032780,g3e=3739355,y3e=212886,x3e=853098,A3e=2269064,b3e=5651240,v3e=25643252,w3e=13013224,k3e=8093408,I3e=8049584,S3e=6938536,T3e=12168584,C3e=12319156,N3e=7574558,R3e=1887474,E3e=5294216,M3e={antispoof:Cge,blazeface:Nge,centernet:Rge,emotion:Ege,facemesh:Mge,faceres:Fge,"handlandmark-lite":$ge,handtrack:Dge,iris:Pge,liveness:_ge,models:Oge,"movenet-lightning":zge,"affectnet-mobilenet":Lge,age:Wge,"blazeface-back":Bge,"blazeface-front":Vge,"blazepose-detector":Uge,"blazepose-full":Gge,"blazepose-heavy":Hge,"blazepose-lite":jge,efficientpose:qge,faceboxes:Xge,"facemesh-attention-pinto":Kge,"facemesh-attention":Yge,"facemesh-detection-full":Zge,"facemesh-detection-short":Jge,"faceres-deep":Qge,"gear-e1":e3e,"gear-e2":t3e,gear:a3e,"gender-ssrnet-imdb":n3e,gender:r3e,handdetect:s3e,"handlandmark-full":i3e,"handlandmark-sparse":o3e,handskeleton:l3e,meet:u3e,mobileface:d3e,mobilefacenet:p3e,"movenet-multipose":c3e,"movenet-thunder":h3e,nanodet:m3e,posenet:f3e,rvm:g3e,selfie:y3e,"anti-spoofing":x3e,"efficientpose-i-lite":A3e,"efficientpose-ii-lite":b3e,"efficientpose-iv":v3e,"insightface-efficientnet-b0":w3e,"insightface-ghostnet-strides1":k3e,"insightface-ghostnet-strides2":I3e,"insightface-mobilenet-emore":S3e,"insightface-mobilenet-swish":T3e,"nanodet-e":C3e,"nanodet-g":N3e,"nanodet-m":R3e,"nanodet-t":E3e};var Ea={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},ya={};async function F3e(e,t){return Ea.debug&&K("load model fetch:",e,t),fetch(e,t)}function K9(e){Ea.cacheModels=e.cacheModels,Ea.verbose=e.debug,Ea.modelBasePath=e.modelBasePath}async function $e(e){var u,d,c,p;let t=L9(Ea.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let a=t.includes("/")?t.split("/"):t.split("\\"),n=a[a.length-1].replace(".json",""),r="indexeddb://"+n;ya[n]={name:n,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:gy[n],inCache:!1,url:""},Ea.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=Ea.cacheSupported&&Ea.cacheModels?await Jn.listModels():{}}catch(h){Ea.cacheSupported=!1}ya[n].inCache=Ea.cacheSupported&&Ea.cacheModels&&Object.keys(s).includes(r),ya[n].url=ya[n].inCache?r:t;let i=typeof fetch=="undefined"?{}:{fetchFunc:(h,m)=>F3e(h,m)},o=new ec(ya[n].url,i),l=!1;try{o.findIOHandler(),Ea.debug&&K("model load handler:",o.handler)}catch(h){K("error finding model i/o handler:",t,h)}try{let h=await((u=o.handler)==null?void 0:u.load())||null;ya[n].sizeFromManifest=((d=h==null?void 0:h.weightData)==null?void 0:d.byteLength)||0,h?o.loadSync(h):o=await x3(ya[n].inCache?r:t,i),ya[n].sizeLoadedWeights=((p=(c=o.artifacts)==null?void 0:c.weightData)==null?void 0:p.byteLength)||0,Ea.verbose&&K("load:",{model:n,url:o.modelUrl,bytes:ya[n].sizeLoadedWeights}),l=!0}catch(h){K("error loading model:",t,h)}if(l&&Ea.cacheModels&&Ea.cacheSupported&&!ya[n].inCache)try{let h=await o.save(r);Ea.debug&&K("model saved:",r,h)}catch(h){K("error saving model:",t,h)}return o}var yy="3.2.1";var Tt={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function P3e(){let e=Tt.gl;e&&(Tt.extensions=e.getSupportedExtensions())}function Y9(e){var t;if(e.config.backend==="humangl"&&(Tt.name in St().registry&&!((t=Tt==null?void 0:Tt.gl)!=null&&t.getParameter(Tt.gl.VERSION))&&(K("humangl error: backend invalid context"),e.models.reset()),!gg(Tt.name))){try{Tt.canvas=Dn(100,100)}catch(r){K("humangl error: cannot create canvas:",r);return}try{if(Tt.gl=Tt.canvas.getContext("webgl2",Tt.webGLattr),!Tt.gl){K("humangl error: cannot get webgl context");return}if(!Tt.gl.getParameter(Tt.gl.VERSION).includes("2.0")){K("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}Tt.canvas&&(Tt.canvas.addEventListener("webglcontextlost",s=>{throw K("humangl error:",s.type),K("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),Tt.canvas.addEventListener("webglcontextrestored",s=>{K("humangl error: context restored:",s)}),Tt.canvas.addEventListener("webglcontextcreationerror",s=>{K("humangl error: context create:",s)}))}catch(r){K("humangl error: cannot get webgl context:",r);return}try{u0(2,Tt.gl)}catch(r){K("humangl error: cannot set webgl context:",r);return}try{let r=new Yl(Tt.gl);ll(Tt.name,()=>new rc(r),Tt.priority)}catch(r){K("humangl error: cannot register webgl backend:",r);return}try{tr("webgl").forEach(s=>{let i={...s,backendName:Tt.name};bn(i)})}catch(r){K("humangl error: cannot update webgl backend registration:",r);return}try{B().flagRegistry.WEBGL_VERSION&&B().set("WEBGL_VERSION",2)}catch(r){K("humangl error: cannot set WebGL backend flags:",r);return}P3e();let a=Gn(),n=typeof a.gpgpu!="undefined"?a.getGPGPUContext().gl:null;n?e.config.debug&&K("humangl backend registered:",{webgl:n.getParameter(n.VERSION),renderer:n.getParameter(n.RENDERER)}):K("humangl error: no current gl context:",n,Tt.gl)}}var ze={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function Z9(){ze.tf255=Ge(255,"float32"),ze.tf1=Ge(1,"float32"),ze.tf2=Ge(2,"float32"),ze.tf05=Ge(.5,"float32"),ze.tf127=Ge(127.5,"float32"),ze.rgb=Vt([.2989,.587,.114],"float32")}async function z3e(){var e;return await ne.updateBackend(),(e=ne.tensorflow)!=null&&e.version?"tensorflow":ne.webgpu.supported&&ne.webgpu.backend?"webgpu":ne.webgl.supported&&ne.webgl.backend?"webgl":ne.wasm.supported&&ne.wasm.backend?"wasm":"cpu"}function L3e(e){let t=[];if(!ne.kernels.includes("mod")){let a={kernelName:"Mod",backendName:ea(),kernelFunc:n=>Pe(()=>xe(n.inputs.a,te(ve(n.inputs.a,n.inputs.b),n.inputs.b)))};bn(a),ne.kernels.push("mod"),t.push("mod")}if(!ne.kernels.includes("floormod")){let a={kernelName:"FloorMod",backendName:ea(),kernelFunc:n=>Pe(()=>we(te(Gp(n.inputs.a,n.inputs.b),n.inputs.b),Ku(n.inputs.a,n.inputs.b)))};bn(a),ne.kernels.push("floormod"),t.push("floormod")}if(!ne.kernels.includes("rotatewithoffset")&&e.softwareKernels){let a={kernelName:"RotateWithOffset",backendName:ea(),kernelFunc:n=>Pe(()=>{let r=ea();Bp("cpu");let s=fe.rotateWithOffset(n.inputs.image,n.attrs.radians,n.attrs.fillValue,n.attrs.center);return Bp(r),s})};bn(a),ne.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&K("registered kernels:",t)}var J9={};async function hc(e,t=!1){var a,n;if(e.state="backend",((a=e.config.backend)==null?void 0:a.length)===0&&(e.config.backend=await z3e()),t||ne.initial||e.config.backend&&e.config.backend.length>0&&ea()!==e.config.backend){let r=ae();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&K("running inside web worker"),typeof navigator!="undefined"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.toLowerCase().includes("electron"))&&e.config.debug&&K("running inside electron");let s=Object.keys(St().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(Y9(e),s=Object.keys(St().registryFactory)),e.config.debug&&K("available backends:",s),ne.browser&&!ne.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&K("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),ne.node&&!ne.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&K(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),ne.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")K("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let i=await navigator.gpu.requestAdapter();if(e.config.debug&&K("enumerated webgpu adapter:",i),!i)K("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let o="requestAdapterInfo"in i?await i.requestAdapterInfo():void 0;K("webgpu adapter info:",o)}}if(s.includes(e.config.backend)||(K(`error: backend ${e.config.backend} not found in registry`),e.config.backend=ne.node?"tensorflow":"webgl",e.config.debug&&K(`override: setting backend ${e.config.backend}`)),e.config.debug&&K("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(B().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&B().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&K("wasm path:",e.config.wasmPath),typeof f0!="undefined")f0(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let i=!1,o=!1;try{i=await B().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),o=await B().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&K(`wasm execution: ${o?"simd":"no simd"} ${i?"multithreaded":"singlethreaded"}`),e.config.debug&&!o&&K("warning: wasm simd support is not enabled")}catch(l){K("wasm detection failed")}}try{await Bp(e.config.backend),await Vp()}catch(i){return K("error: cannot set backend:",e.config.backend,i),!1}e.config.debug&&(J9=JSON.parse(JSON.stringify(B().flags)))}if((ea()==="humangl"||ea()==="webgl")&&(B().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&B().set("WEBGL_USE_SHAPES_UNIFORMS",!0),B().flagRegistry.WEBGL_EXP_CONV&&B().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(K("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),B().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),ea(),e.config.debug){let s=B().flags,i={};for(let o of Object.keys(s))J9[o]!==s[o]&&(i[o]=s[o]);e.config.debug&&Object.keys(i).length>0&&K("backend:",ea(),"flags:",i)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&K("flags:",e.config.flags);for(let[s,i]of Object.entries(e.config.flags))B().set(s,i)}mg(),Z9(),e.performance.initBackend=Math.trunc(ae()-r),e.config.backend=ea(),await ne.updateBackend(),L3e(e.config)}return!0}function T0(e,t){for(let a of e){let n={kernelName:a,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&K("kernelFunc",a,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};bn(n)}ne.kernels=tr(ea()).map(a=>a.kernelName.toLowerCase())}var F0={};vr(F0,{all:()=>gye,body:()=>N0,canvas:()=>fye,face:()=>C0,gesture:()=>M0,hand:()=>R0,init:()=>Iy,object:()=>E0,options:()=>_t,person:()=>mye});var kn=e=>{if(!e)K("draw error: invalid canvas");else if(!e.getContext)K("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)K("draw error: cannot get canvas context");else return t}return null},xl=e=>Math.round(e*180/Math.PI),ut=(e,t,a)=>e.replace(t,typeof a=="number"?a.toFixed(1):a),Al=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let a=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${a[0]}, ${a[1]}, ${a[2]}, ${t.alpha})`};function In(e,t,a,n,r){let s=t.replace(/\[.*\]/g,"").split(` +`).map(o=>o.trim()),i=Math.max(0,a);for(let o=s.length-1;o>=0;o--){let l=o*r.lineHeight+n;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[o],i+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[o],i+4,l+15)}}function cr(e,t,a,n,r){e.fillStyle=Al(n,r),e.beginPath(),e.arc(t,a,r.pointSize,0,2*Math.PI),e.fill()}function hr(e,t,a,n,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let i=(t+t+n)/2,o=(a+a+r)/2;e.ellipse(i,o,n/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,a),e.lineTo(t+n-s.roundRect,a),e.quadraticCurveTo(t+n,a,t+n,a+s.roundRect),e.lineTo(t+n,a+r-s.roundRect),e.quadraticCurveTo(t+n,a+r,t+n-s.roundRect,a+r),e.lineTo(t+s.roundRect,a+r),e.quadraticCurveTo(t,a+r,t,a+r-s.roundRect),e.lineTo(t,a+s.roundRect),e.quadraticCurveTo(t,a,t+s.roundRect,a),e.closePath();e.stroke()}function xy(e,t,a){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let n of t)e.strokeStyle=Al(n[2]||0,a),e.lineTo(Math.trunc(n[0]),Math.trunc(n[1]));e.stroke(),a.fillPolygons&&(e.closePath(),e.fill())}}function eI(e,t,a){if(!(t.length<2)){if(e.lineWidth=a.lineWidth,!a.useCurves||t.length<=2){xy(e,t,a);return}e.moveTo(t[0][0],t[0][1]);for(let n=0;nmc[e]),L7e=B3e.map(e=>mc[e]),W7e=V3e.map(e=>mc[e]);function Us(e){let t=e.map(a=>a[0]);return t.push(e[e.length-1][1]),t}var U3e=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],G3e=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],H3e=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],j3e=[[474,475],[475,476],[476,477],[477,474]],q3e=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],X3e=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],K3e=[[469,470],[470,471],[471,472],[472,469]],Y3e=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],B7e={lips:Us(U3e),leftEye:Us(G3e),leftEyebrow:Us(H3e),leftIris:Us(j3e),rightEye:Us(q3e),rightEyebrow:Us(X3e),rightIris:Us(K3e),faceOval:Us(Y3e)};var Z3e=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],J3e=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Q3e=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],eye=[[474,475],[475,476],[476,477],[477,474]],tye=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],aye=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],nye=[[469,470],[470,471],[471,472],[472,469]],rye=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function Gs(e){let t=e.map(a=>a[0]);return t.push(e[e.length-1][1]),t}var sye={lips:Gs(Z3e),leftEye:Gs(J3e),leftEyebrow:Gs(Q3e),leftIris:Gs(eye),rightEye:Gs(tye),rightEyebrow:Gs(aye),rightIris:Gs(nye),faceOval:Gs(rye)},iye=Object.entries(sye).map(([e,t])=>t.map(a=>[a,e])).flat(),V7e=new Map(iye),fc=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],wl=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],kl=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var rt;function oye(e,t){var n,r,s,i,o,l,u,d,c;if(!rt.drawLabels||((n=rt.faceLabels)==null?void 0:n.length)===0)return;let a=rt.faceLabels.slice();if(a=ut(a,"[id]",e.id.toFixed(0)),e.score&&(a=ut(a,"[score]",100*e.score)),e.gender&&(a=ut(a,"[gender]",e.gender)),e.genderScore&&(a=ut(a,"[genderScore]",100*e.genderScore)),e.age&&(a=ut(a,"[age]",e.age)),e.distance&&(a=ut(a,"[distance]",100*e.distance)),e.real&&(a=ut(a,"[real]",100*e.real)),e.live&&(a=ut(a,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let p=e.emotion.map(h=>`${Math.trunc(100*h.score)}% ${h.emotion}`);p.length>3&&(p.length=3),a=ut(a,"[emotions]",p.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(a=ut(a,"[roll]",xl(e.rotation.angle.roll))),(o=(i=e.rotation)==null?void 0:i.angle)!=null&&o.yaw&&(a=ut(a,"[yaw]",xl(e.rotation.angle.yaw))),(u=(l=e.rotation)==null?void 0:l.angle)!=null&&u.pitch&&(a=ut(a,"[pitch]",xl(e.rotation.angle.pitch))),(c=(d=e.rotation)==null?void 0:d.gaze)!=null&&c.bearing&&(a=ut(a,"[gaze]",xl(e.rotation.gaze.bearing))),In(t,a,e.box[0],e.box[1],rt)}function lye(e,t){var a,n,r,s;if((a=e.annotations)!=null&&a.leftEyeIris&&((n=e.annotations)!=null&&n.leftEyeIris[0])){t.strokeStyle=rt.useDepth?"rgba(255, 200, 255, 0.3)":rt.color,t.beginPath();let i=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,o=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],i,o,0,0,2*Math.PI),t.stroke(),rt.fillPolygons&&(t.fillStyle=rt.useDepth?"rgba(255, 255, 200, 0.3)":rt.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=rt.useDepth?"rgba(255, 200, 255, 0.3)":rt.color,t.beginPath();let i=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,o=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],i,o,0,0,2*Math.PI),t.stroke(),rt.fillPolygons&&(t.fillStyle=rt.useDepth?"rgba(255, 255, 200, 0.3)":rt.color,t.fill())}}function uye(e,t){var a;if(rt.drawGaze&&((a=e.rotation)!=null&&a.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let n=e.box[0]+e.box[2]/2-e.box[3]*xl(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*xl(e.rotation.angle.pitch)/90,s=new Path2D(` M ${e.box[0]+e.box[2]/2} ${e.box[1]} C ${n} ${e.box[1]}, @@ -8628,7 +8628,7 @@ return a / b;`,vJ=` ${e.box[0]} ${r}, ${e.box[0]+e.box[2]} ${r}, ${e.box[0]+e.box[2]} ${e.box[1]+e.box[3]/2} - `);t.stroke(i),t.stroke(s)}}function Nge(e,t){var a;if(rt.drawGaze&&((a=e.rotation)!=null&&a.gaze.strength)&&e.rotation.gaze.bearing&&e.annotations.leftEyeIris&&e.annotations.rightEyeIris&&e.annotations.leftEyeIris[0]&&e.annotations.rightEyeIris[0]){t.strokeStyle="pink",t.fillStyle="pink";let n=[e.annotations.leftEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.leftEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];iy(t,[e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1]],[n[0],n[1]],4);let r=[e.annotations.rightEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.rightEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];iy(t,[e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1]],[r[0],r[1]],4)}}function Rge(e,t){if(rt.drawPolygons&&e.mesh.length>=468){t.lineWidth=1;for(let a=0;ae.mesh[r]);sy(t,n,rt)}Cge(e,t)}}function Ege(e,t){if(rt.drawPoints)if((e==null?void 0:e.mesh.length)>=468)for(let a=0;a0&&(Ege(r,n),Rge(r,n),Tge(r,n),Nge(r,n))}}function v0(e,t,a){var s,i;let n=Et(Ft,a);if(!t||!e)return;let r=bn(e);if(r){r.lineJoin="round";for(let o=0;o0)){let l=n.bodyLabels.slice();l=ut(l,"[id]",t[o].id.toFixed(0)),l=ut(l,"[score]",100*t[o].score),vn(r,l,t[o].box[0],t[o].box[1],n)}if(n.drawPoints&&t[o].keypoints)for(let l=0;l0&&t[o].keypoints){r.font=n.font;for(let l of t[o].keypoints){if(!l.score||l.score===0)continue;let u=n.bodyPartLabels.slice();u=ut(u,"[label]",l.part),u=ut(u,"[score]",100*l.score),vn(r,u,l.position[0],l.position[1],n)}}if(n.drawPolygons&&t[o].keypoints&&t[o].annotations)for(let l of Object.values(t[o].annotations))for(let u of l)u9(r,u,n)}}}function w0(e,t,a){var s,i;let n=Et(Ft,a);if(!t||!e)return;let r=bn(e);if(r){r.lineJoin="round",r.font=n.font;for(let o of t){if(n.drawBoxes){if(r.strokeStyle=n.color,r.fillStyle=n.color,ur(r,o.box[0],o.box[1],o.box[2],o.box[3],n),n.drawLabels&&((s=n.handLabels)==null?void 0:s.length)>0){let l=n.handLabels.slice();l=ut(l,"[id]",o.id.toFixed(0)),l=ut(l,"[label]",o.label),l=ut(l,"[score]",100*o.score),vn(r,l,o.box[0],o.box[1],n)}r.stroke()}if(n.drawPoints&&o.keypoints&&o.keypoints.length>0)for(let l of o.keypoints)r.fillStyle=dl(l[2],n),lr(r,l[0],l[1],0,n);if(n.drawLabels&&o.annotations&&((i=n.fingerLabels)==null?void 0:i.length)>0)for(let[l,u]of Object.entries(o.annotations)){let p=n.fingerLabels.slice();p=ut(p,"[label]",l),vn(r,p,u[u.length-1][0],u[u.length-1][1],n)}if(n.drawPolygons&&o.annotations){let l=u=>{if(!(!u||u.length===0||!u[0]))for(let p=0;p0?p-1:0][0],u[p>0?p-1:0][1]),r.lineTo(u[p][0],u[p][1]),r.stroke()}};r.lineWidth=n.lineWidth,l(o.annotations.index),l(o.annotations.middle),l(o.annotations.ring),l(o.annotations.pinky),l(o.annotations.thumb)}}}}function k0(e,t,a){var s;let n=Et(Ft,a);if(!t||!e)return;let r=bn(e);if(r){r.lineJoin="round",r.font=n.font;for(let i of t)if(n.drawBoxes){if(r.strokeStyle=n.color,r.fillStyle=n.color,ur(r,i.box[0],i.box[1],i.box[2],i.box[3],n),n.drawLabels&&((s=n.objectLabels)==null?void 0:s.length)>0){let o=n.objectLabels.slice();o=ut(o,"[id]",i.id.toFixed(0)),o=ut(o,"[label]",i.label),o=ut(o,"[score]",100*i.score),vn(r,o,i.box[0],i.box[1],n)}r.stroke()}}}function I0(e,t,a){var r;let n=Et(Ft,a);if(!(!t||!e)&&n.drawGestures&&((r=n.gestureLabels)==null?void 0:r.length)>0){let s=bn(e);if(!s)return;s.font=n.font,s.fillStyle=n.color;let i=1;for(let o=0;o1&&u[1].length>0){let p=l[1]>0?`#${l[1]}`:"",c=n.gestureLabels.slice();c=ut(c,"[where]",l[0]),c=ut(c,"[who]",p),c=ut(c,"[what]",u[1]),vn(s,c,8,2+i*n.lineHeight,n),i+=1}}}}var As={face:`face + `);t.stroke(i),t.stroke(s)}}function dye(e,t){var a;if(rt.drawGaze&&((a=e.rotation)!=null&&a.gaze.strength)&&e.rotation.gaze.bearing&&e.annotations.leftEyeIris&&e.annotations.rightEyeIris&&e.annotations.leftEyeIris[0]&&e.annotations.rightEyeIris[0]){t.strokeStyle="pink",t.fillStyle="pink";let n=[e.annotations.leftEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.leftEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];Ay(t,[e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1]],[n[0],n[1]],4);let r=[e.annotations.rightEyeIris[0][0]+Math.sin(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[3],e.annotations.rightEyeIris[0][1]+Math.cos(e.rotation.gaze.bearing)*e.rotation.gaze.strength*e.box[2]];Ay(t,[e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1]],[r[0],r[1]],4)}}function pye(e,t){if(rt.drawPolygons&&e.mesh.length>=468){t.lineWidth=1;for(let a=0;ae.mesh[r]);xy(t,n,rt)}lye(e,t)}}function cye(e,t){if(rt.drawPoints)if((e==null?void 0:e.mesh.length)>=468)for(let a=0;a0&&(cye(r,n),pye(r,n),uye(r,n),dye(r,n))}}function N0(e,t,a){var s,i;let n=Mt(_t,a);if(!t||!e)return;let r=kn(e);if(r){r.lineJoin="round";for(let o=0;o0)){let l=n.bodyLabels.slice();l=ut(l,"[id]",t[o].id.toFixed(0)),l=ut(l,"[score]",100*t[o].score),In(r,l,t[o].box[0],t[o].box[1],n)}if(n.drawPoints&&t[o].keypoints)for(let l=0;l0&&t[o].keypoints){r.font=n.font;for(let l of t[o].keypoints){if(!l.score||l.score===0)continue;let u=n.bodyPartLabels.slice();u=ut(u,"[label]",l.part),u=ut(u,"[score]",100*l.score),In(r,u,l.position[0],l.position[1],n)}}if(n.drawPolygons&&t[o].keypoints&&t[o].annotations)for(let l of Object.values(t[o].annotations))for(let u of l)eI(r,u,n)}}}function R0(e,t,a){var s,i;let n=Mt(_t,a);if(!t||!e)return;let r=kn(e);if(r){r.lineJoin="round",r.font=n.font;for(let o of t){if(n.drawBoxes){if(r.strokeStyle=n.color,r.fillStyle=n.color,hr(r,o.box[0],o.box[1],o.box[2],o.box[3],n),n.drawLabels&&((s=n.handLabels)==null?void 0:s.length)>0){let l=n.handLabels.slice();l=ut(l,"[id]",o.id.toFixed(0)),l=ut(l,"[label]",o.label),l=ut(l,"[score]",100*o.score),In(r,l,o.box[0],o.box[1],n)}r.stroke()}if(n.drawPoints&&o.keypoints&&o.keypoints.length>0)for(let l of o.keypoints)r.fillStyle=Al(l[2],n),cr(r,l[0],l[1],0,n);if(n.drawLabels&&o.annotations&&((i=n.fingerLabels)==null?void 0:i.length)>0)for(let[l,u]of Object.entries(o.annotations)){let d=n.fingerLabels.slice();d=ut(d,"[label]",l),In(r,d,u[u.length-1][0],u[u.length-1][1],n)}if(n.drawPolygons&&o.annotations){let l=u=>{if(!(!u||u.length===0||!u[0]))for(let d=0;d0?d-1:0][0],u[d>0?d-1:0][1]),r.lineTo(u[d][0],u[d][1]),r.stroke()}};r.lineWidth=n.lineWidth,l(o.annotations.index),l(o.annotations.middle),l(o.annotations.ring),l(o.annotations.pinky),l(o.annotations.thumb)}}}}function E0(e,t,a){var s;let n=Mt(_t,a);if(!t||!e)return;let r=kn(e);if(r){r.lineJoin="round",r.font=n.font;for(let i of t)if(n.drawBoxes){if(r.strokeStyle=n.color,r.fillStyle=n.color,hr(r,i.box[0],i.box[1],i.box[2],i.box[3],n),n.drawLabels&&((s=n.objectLabels)==null?void 0:s.length)>0){let o=n.objectLabels.slice();o=ut(o,"[id]",i.id.toFixed(0)),o=ut(o,"[label]",i.label),o=ut(o,"[score]",100*i.score),In(r,o,i.box[0],i.box[1],n)}r.stroke()}}}function M0(e,t,a){var r;let n=Mt(_t,a);if(!(!t||!e)&&n.drawGestures&&((r=n.gestureLabels)==null?void 0:r.length)>0){let s=kn(e);if(!s)return;s.font=n.font,s.fillStyle=n.color;let i=1;for(let o=0;o1&&u[1].length>0){let d=l[1]>0?`#${l[1]}`:"",c=n.gestureLabels.slice();c=ut(c,"[where]",l[0]),c=ut(c,"[who]",d),c=ut(c,"[what]",u[1]),In(s,c,8,2+i*n.lineHeight,n),i+=1}}}}var Hs={face:`face confidence: [score]% [gender] [genderScore]% age: [age] years @@ -8637,7 +8637,7 @@ return a / b;`,vJ=` live: [live]% [emotions] roll: [roll]\xB0 yaw:[yaw]\xB0 pitch:[pitch]\xB0 - gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var dy=0;function Pge(e,t,a){let n=Et(Ft,a);if(!t||!e)return;let r=bn(e);if(r){r.lineJoin="round",r.font=n.font;for(let s=0;shy,kpt:()=>cy});var cy=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],hy={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var wn,fl=224,c9,Fge=5,T0=[8,16,32,32,32];function Dge(){let e=[],t=0;for(;ta.x)),y:Bt(e.map(a=>a.y))}}async function h9(e){if(ne.initial&&(wn=null),!wn&&e.body.detector&&e.body.detector.modelPath){wn=await Pe(e.body.detector.modelPath);let t=wn!=null&&wn.executor?Object.values(wn.modelSignature.inputs):void 0;fl=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&wn&&K("cached model:",wn.modelUrl);return Dge(),wn}var p9=[5,5];function Oge(e,t){return De(()=>{let a=Sa(e,12,1),n=Oe(a[0]),r=Oe(a[1]),s=Oe(a[2]),i=Oe(a[3]);n=we(ve(n,fl),t.x),r=we(ve(r,fl),t.y),s=te(ve(s,fl),p9[0]),i=te(ve(i,fl),p9[1]);let o=xe(n,ve(s,2)),l=xe(r,ve(i,2)),u=we(o,s),p=we(l,i);return pa([o,l,u,p],1)})}async function zge(e,t,a,n){var u,p;let r=[],s={};s.boxes=Oge(e,c9),s.scores=za(t),s.nms=await fe.nonMaxSuppressionAsync(s.boxes,s.scores,1,((u=a.body.detector)==null?void 0:u.minConfidence)||.1,((p=a.body.detector)==null?void 0:p.iouThreshold)||.1);let i=await s.nms.data(),o=await s.scores.data(),l=await s.boxes.array();for(let c of Array.from(i)){let d=o[c],h=l[c],m=[Math.round(h[0]*n[0]),Math.round(h[1]*n[1]),Math.round(h[2]*n[0]),Math.round(h[3]*n[1])],f={score:d,boxRaw:h,box:m};r.push(f)}return Object.keys(s).forEach(c=>J(s[c])),r}async function m9(e,t,a){let n={};n.res=wn==null?void 0:wn.execute(e,["Identity"]),n.logitsRaw=Fe(n.res,[0,0,0],[1,-1,1]),n.boxesRaw=Fe(n.res,[0,0,1],[1,-1,-1]),n.logits=Oe(n.logitsRaw),n.boxes=Oe(n.boxesRaw);let r=await zge(n.boxes,n.logits,t,a);return Object.keys(n).forEach(s=>J(n[s])),r}function bs(e,t=[1,1]){let a=[e.map(o=>o[0]),e.map(o=>o[1])],n=[Math.min(...a[0]),Math.min(...a[1])],r=[Math.max(...a[0]),Math.max(...a[1])],s=[n[0],n[1],r[0]-n[0],r[1]-n[1]],i=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:i}}function f9(e,t=[1,1]){let a=[e.map(u=>u[0]),e.map(u=>u[1])],n=[Math.min(...a[0]),Math.min(...a[1])],r=[Math.max(...a[0]),Math.max(...a[1])],s=[(n[0]+r[0])/2,(n[1]+r[1])/2],i=Math.max(s[0]-n[0],s[1]-n[1],-s[0]+r[0],-s[1]+r[1]),o=[Math.trunc(s[0]-i),Math.trunc(s[1]-i),Math.trunc(2*i),Math.trunc(2*i)],l=[o[0]/t[0],o[1]/t[1],o[2]/t[0],o[3]/t[1]];return{box:o,boxRaw:l}}function N0(e,t){let a=[e[2]*t,e[3]*t];return[e[0]-(a[0]-e[2])/2,e[1]-(a[1]-e[3])/2,a[0],a[1]]}var Ua,fy=256,my=Number.MAX_SAFE_INTEGER,Lge={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},E0=[],vs=[[0,0],[0,0],[0,0],[0,0]],g9=0,y9=e=>1-1/(1+Math.exp(e)),A9=e=>h9(e);async function b9(e){if(ne.initial&&(Ua=null),Ua)e.debug&&K("cached model:",Ua.modelUrl);else{Ua=await Pe(e.body.modelPath);let t=Ua!=null&&Ua.executor?Object.values(Ua.modelSignature.inputs):void 0;fy=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Ua}function x9(e,t,a){var s,i;let n={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((i=e==null?void 0:e.shape)!=null&&i[2]))return e;let r;if(a&&(n.cropped=fe.cropAndResize(e,[a],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let o=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];vs=[[0,0],o,l,[0,0]],n.pad=ir(n.cropped||e,vs),n.resize=fe.resizeBilinear(n.pad,[t,t]),r=ve(n.resize,ze.tf255)}else e.shape[1]!==t?(n.resize=fe.resizeBilinear(n.cropped||e,[t,t]),r=ve(n.resize,ze.tf255)):r=ve(n.cropped||e,ze.tf255);return Object.keys(n).forEach(o=>J(n[o])),r}function Wge(e,t,a){for(let n of e)n.position=[Math.trunc(n.position[0]*(t[0]+vs[2][0]+vs[2][1])/t[0]-vs[2][0]),Math.trunc(n.position[1]*(t[1]+vs[1][0]+vs[1][1])/t[1]-vs[1][0]),n.position[2]],n.positionRaw=[n.position[0]/t[0],n.position[1]/t[1],2*n.position[2]/(t[0]+t[1])];if(a){let n=a[2]-a[0],r=a[3]-a[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+a[1],s.positionRaw[1]/n+a[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function Bge(e){let t=e.find(o=>o.part==="leftPalm"),a=e.find(o=>o.part==="leftWrist"),n=e.find(o=>o.part==="leftIndex");t.position[2]=((a.position[2]||0)+(n.position[2]||0))/2;let r=e.find(o=>o.part==="rightPalm"),s=e.find(o=>o.part==="rightWrist"),i=e.find(o=>o.part==="rightIndex");r.position[2]=((s.position[2]||0)+(i.position[2]||0))/2}async function Vge(e,t,a){if(!(Ua!=null&&Ua.executor))return null;let n={};[n.ld,n.segmentation,n.heatmap,n.world,n.poseflag]=Ua==null?void 0:Ua.execute(e,Lge.landmarks);let r=(await n.poseflag.data())[0],s=await n.ld.data(),i=await n.world.data();Object.keys(n).forEach(m=>J(n[m]));let o=[],l=5;for(let m=0;mm.position),c=bs(p,[a[0],a[1]]),d={};for(let[m,f]of Object.entries(hy)){let g=[];for(let y=0;yb.part===f[y]),A=u.find(b=>b.part===f[y+1]);x&&A&&g.push([x.position,A.position])}d[m]=g}return{id:0,score:Math.trunc(100*r)/100,box:c.box,boxRaw:c.boxRaw,keypoints:u,annotations:d}}async function gy(e,t){var s,i,o;let a=[e.shape[2]||0,e.shape[1]||0],n=(t.body.skipTime||0)>ae()-g9,r=my<(t.body.skipFrames||0);if(t.skipAllowed&&n&&r&&E0!==null)my++;else{let l=[];if((i=(s=t.body)==null?void 0:s.detector)!=null&&i.enabled){let u=x9(e,224);l=await m9(u,t,a),J(u)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let u=0;uJ(n[u])),r}async function Ay(e,t){if(!(Ga!=null&&Ga.executor))return[];let a=(t.object.skipTime||0)>ae()-w9,n=xy<(t.object.skipFrames||0);return t.skipAllowed&&a&&n&&yy.length>0?(xy++,yy):(xy=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],i=fe.resizeBilinear(e,[gl,gl]),o=t.object.enabled?Ga==null?void 0:Ga.execute(i,["tower_0/detections"]):null;w9=ae(),J(i);let l=await Uge(o,s,t);yy=l,r(l)}))}var M0={};yr(M0,{connected:()=>vy,kpt:()=>by});var by=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],vy={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var Mt,S9=0,Ma={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},wy=Number.MAX_SAFE_INTEGER;async function C9(e){return ne.initial&&(Mt=null),Mt?e.debug&&K("cached model:",Mt.modelUrl):Mt=await Pe(e.body.modelPath),Mt}async function Gge(e,t){let[a,n]=e.shape,r=Q(e,[n*a]),s=fa(r,0),i=(await s.data())[0];if(i>t){let o=rr(r,0),l=Bu(o,a),u=(await l.data())[0],p=ve(o,a),c=(await p.data())[0];return J([r,s,o,l,p]),[u,c,i]}return J([r,s]),[0,0,i]}async function ky(e,t){if(!(Mt!=null&&Mt.executor)||!(Mt!=null&&Mt.inputs[0].shape))return[];let a=(t.body.skipTime||0)>ae()-S9,n=wy<(t.body.skipFrames||0);return t.skipAllowed&&a&&n&&Object.keys(Ma.keypoints).length>0?(wy++,[Ma]):(wy=0,new Promise(async r=>{let s=De(()=>{var m,f;let c=fe.resizeBilinear(e,[((m=Mt==null?void 0:Mt.inputs[0].shape)==null?void 0:m[2])||0,((f=Mt==null?void 0:Mt.inputs[0].shape)==null?void 0:f[1])||0],!1),d=te(c,ze.tf2);return xe(d,ze.tf1)}),i;if(t.body.enabled&&(i=Mt==null?void 0:Mt.execute(s)),S9=ae(),J(s),i){Ma.keypoints.length=0;let c=Oe(i);J(i);let d=Na(c,2);J(c);for(let h=0;h(t.body.minConfidence||0)&&Ma.keypoints.push({score:Math.round(100*g)/100,part:by[h],positionRaw:[m/Mt.inputs[0].shape[2],f/Mt.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/Mt.inputs[0].shape[2]),Math.round(e.shape[1]*f/Mt.inputs[0].shape[1])]})}d.forEach(h=>J(h))}Ma.score=Ma.keypoints.reduce((c,d)=>d.score>c?d.score:c,0);let o=Ma.keypoints.map(c=>c.position[0]),l=Ma.keypoints.map(c=>c.position[1]);Ma.box=[Math.min(...o),Math.min(...l),Math.max(...o)-Math.min(...o),Math.max(...l)-Math.min(...l)];let u=Ma.keypoints.map(c=>c.positionRaw[0]),p=Ma.keypoints.map(c=>c.positionRaw[1]);Ma.boxRaw=[Math.min(...u),Math.min(...p),Math.max(...u)-Math.min(...u),Math.max(...p)-Math.min(...p)];for(let[c,d]of Object.entries(vy)){let h=[];for(let m=0;my.part===d[m]),g=Ma.keypoints.find(y=>y.part===d[m+1]);f&&g&&f.score>(t.body.minConfidence||0)&&g.score>(t.body.minConfidence||0)&&h.push([f.position,g.position])}Ma.annotations[c]=h}r([Ma])}))}var ad=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],P0=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],_0=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],$0=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],E9=(e,t,a)=>{let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(i=>[(i[0]+a[0])*t[0],(i[1]+a[1])*t[1]]);return{startPoint:n,endPoint:r,landmarks:s,confidence:e.confidence}},Iy=(e,t,a)=>{let n=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/n,e.startPoint[0]/r,e.endPoint[1]/n,e.endPoint[0]/r],i=fe.cropAndResize(t,[s],[0],a),o=ve(i,ze.tf255);return J(i),o},F0=(e,t)=>{let a=P0(e),n=ad(e),r=[t*n[0]/2,t*n[1]/2];return{startPoint:[a[0]-r[0],a[1]-r[1]],endPoint:[a[0]+r[0],a[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:n}},D0=e=>{let t=P0(e),a=ad(e),n=Math.max(...a)/2;return{startPoint:[Math.round(t[0]-n),Math.round(t[1]-n)],endPoint:[Math.round(t[0]+n),Math.round(t[1]+n)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(a[0]),Math.round(a[1])]}},M9=e=>{let t=e.map(n=>n[0]),a=e.map(n=>n[1]);return{startPoint:[Math.min(...t),Math.min(...a)],endPoint:[Math.max(...t),Math.max(...a)],landmarks:e}},Sy=[[1,0,0],[0,1,0],[0,0,1]],Hge=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),jge=(e,t)=>Hge(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var N9=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],yl=(e,t)=>{let a=0;for(let n=0;n{let a=[];for(let n=0;n{let a=[],n=e.length;for(let r=0;r{let a=Math.cos(e),n=Math.sin(e),r=[[a,-n,0],[n,a,0],[0,0,1]],s=N9(t[0],t[1]),i=R9(s,r),o=N9(-t[0],-t[1]);return R9(i,o)},Xge=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],a=[e[0][2],e[1][2]],n=[-yl(t[0],a),-yl(t[1],a)];return[t[0].concat(n[0]),t[1].concat(n[1]),[0,0,1]]},Kge=(e,t)=>[yl(e,t[0]),yl(e,t[1])];function _9(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},a=[];for(let n=0;n[s[0]/r*(h[0]-r/2),s[1]/r*(h[1]-r/2),h[2]||0]),o=a&&a!==0&&Math.abs(a)>.2,l=o?P9(a,[0,0]):Sy,u=o?i.map(h=>[...Kge(h,l),h[2]]):i,p=o?Xge(n):Sy,c=P0(t),d=[yl(c,p[0]),yl(c,p[1])];return u.map(h=>[Math.trunc(h[0]+d[0]),Math.trunc(h[1]+d[1]),Math.trunc(h[2]||0)])}function F9(e,t,a,n){let r=t.landmarks.length>=oy.count?oy.symmetryLine:pl.symmetryLine,s=0,i=Sy,o;if(e&&ne.kernels.includes("rotatewithoffset"))if(s=jge(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let u=P0(t),p=[u[0]/a.shape[2],u[1]/a.shape[1]],c=fe.rotateWithOffset(a,s,0,[p[0],p[1]]);i=P9(-s,u),o=Iy(t,c,[n,n]),J(c)}else o=Iy(t,a,[n,n]);else o=Iy(t,a,[n,n]);return[s,i,o]}var Yge=e=>{let t=e.map(n=>n[0]),a=e.map(n=>n[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...a)+(Math.max(...a)-Math.min(...a))/2]},D9=(e,t)=>{let a=Yge(e),n=ad(t);return{startPoint:[a[0]-n[0]/2,a[1]-n[1]/2],endPoint:[a[0]+n[0]/2,a[1]+n[1]/2]}};var O9=6,Zge=1.4,Bn,O0=null,ws=0,nd=null,z9=()=>ws;async function L9(e){var t;return ne.initial&&(Bn=null),Bn?e.debug&&K("cached model:",Bn.modelUrl):Bn=await Pe((t=e.face.detector)==null?void 0:t.modelPath),ws=Bn.executor&&Bn.inputs[0].shape?Bn.inputs[0].shape[2]:256,nd=Ge(ws,"int32"),O0=Yn(_9(ws)),Bn}function Jge(e){if(!O0||!nd)return gn([0,0]);let t={};t.boxStarts=Fe(e,[0,1],[-1,2]),t.centers=we(t.boxStarts,O0),t.boxSizes=Fe(e,[0,3],[-1,2]),t.boxSizesNormalized=ve(t.boxSizes,nd),t.centersNormalized=ve(t.centers,nd),t.halfBoxSize=ve(t.boxSizesNormalized,ze.tf2),t.starts=xe(t.centersNormalized,t.halfBoxSize),t.ends=we(t.centersNormalized,t.halfBoxSize),t.startNormalized=te(t.starts,nd),t.endNormalized=te(t.ends,nd);let a=Wu([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(n=>J(t[n])),a}async function W9(e,t){var o,l,u,p,c,d;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let a={};a.resized=fe.resizeBilinear(e,[ws,ws]),a.div=ve(a.resized,ze.tf127),a.normalized=xe(a.div,ze.tf05);let n=Bn==null?void 0:Bn.execute(a.normalized);if(Array.isArray(n)&&n.length>2){let h=n.sort((m,f)=>m.size-f.size);a.concat384=lt([h[0],h[2]],2),a.concat512=lt([h[1],h[3]],2),a.concat=lt([a.concat512,a.concat384],1),a.batch=Oe(a.concat,[0])}else Array.isArray(n)?a.batch=Oe(n[0]):a.batch=Oe(n);J(n),a.boxes=Jge(a.batch),a.logits=Fe(a.batch,[0,0],[-1,1]),a.sigmoid=za(a.logits),a.scores=Oe(a.sigmoid),a.nms=await fe.nonMaxSuppressionAsync(a.boxes,a.scores,((o=t.face.detector)==null?void 0:o.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((u=t.face.detector)==null?void 0:u.minConfidence)||0);let r=await a.nms.array(),s=[],i=await a.scores.data();for(let h=0;h(((p=t.face.detector)==null?void 0:p.minConfidence)||0)){let f={};f.bbox=Fe(a.boxes,[r[h],0],[1,-1]),f.slice=Fe(a.batch,[r[h],O9-1],[1,-1]),f.squeeze=Oe(f.slice),f.landmarks=Q(f.squeeze,[O9,-1]);let g=await f.bbox.data(),y={startPoint:[g[0],g[1]],endPoint:[g[2],g[3]],landmarks:await f.landmarks.array(),confidence:m};f.anchor=Fe(O0,[r[h],0],[1,2]);let x=await f.anchor.data(),A=E9(y,[(e.shape[2]||0)/ws,(e.shape[1]||0)/ws],x),b=F0(A,t.face.scale||Zge),w=D0(b);w.size[0]>(((c=t.face.detector)==null?void 0:c.minSize)||0)&&w.size[1]>(((d=t.face.detector)==null?void 0:d.minSize)||0)&&s.push(w),Object.keys(f).forEach(I=>J(f[I]))}}return Object.keys(a).forEach(h=>J(a[h])),s}var an,ks=0,Qge=2.3,Ty=Pn.leftEyeLower0,Ny=Pn.rightEyeLower0,rd={leftBounds:[Ty[0],Ty[Ty.length-1]],rightBounds:[Ny[0],Ny[Ny.length-1]]},sd={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function H9(e){var t,a;return ne.initial&&(an=null),an?e.debug&&K("cached model:",an.modelUrl):an=await Pe((t=e.face.iris)==null?void 0:t.modelPath),ks=an!=null&&an.executor&&((a=an.inputs)!=null&&a[0].shape)?an.inputs[0].shape[2]:0,ks===-1&&(ks=64),an}function z0(e,t,a,n){for(let r=0;r{let t=e[rd.leftBounds[0]][2],a=e[rd.rightBounds[0]][2];return t-a},V9=(e,t,a,n,r,s=!1)=>{let i=D0(F0(M9([e[a],e[n]]),Qge)),o=ad(i),l=fe.cropAndResize(t,[[i.startPoint[1]/r,i.startPoint[0]/r,i.endPoint[1]/r,i.endPoint[0]/r]],[0],[ks,ks]);if(s&&ne.kernels.includes("flipleftright")){let u=fe.flipLeftRight(l);J(l),l=u}return{box:i,boxSize:o,crop:l}},U9=(e,t,a,n=!1)=>{let r=[];for(let s=0;s{let n=e[Pn[`${a}EyeUpper0`][sd.upperCenter]][2],r=e[Pn[`${a}EyeLower0`][sd.lowerCenter]][2],s=(n+r)/2;return t.map((i,o)=>{let l=s;return o===2?l=n:o===4&&(l=r),[i[0],i[1],l]})};async function j9(e,t,a){if(!(an!=null&&an.executor))return e;let{box:n,boxSize:r,crop:s}=V9(e,t,rd.leftBounds[0],rd.leftBounds[1],a,!0),{box:i,boxSize:o,crop:l}=V9(e,t,rd.rightBounds[0],rd.rightBounds[1],a,!0),u=lt([s,l]);J(s),J(l);let p=an.execute(u);J(u);let c=await p.data();J(p);let d=c.slice(0,sd.numCoordinates*3),{rawCoords:h,iris:m}=U9(d,n,r,!0),f=c.slice(sd.numCoordinates*3),{rawCoords:g,iris:y}=U9(f,i,o,!1),x=e3e(e);Math.abs(x)<30?(z0(e,h,"left",null),z0(e,g,"right",null)):x<1?z0(e,h,"left",["EyeUpper0","EyeLower0"]):z0(e,g,"right",["EyeUpper0","EyeLower0"]);let A=G9(e,m,"left"),b=G9(e,y,"right");return e.concat(A).concat(b)}async function X9(e,t){var s,i,o,l,u,p,c,d,h,m;let a={lips:await((i=(s=t.filter(f=>f.size===160))==null?void 0:s[0])==null?void 0:i.data()),irisL:await((l=(o=t.filter(f=>f.size===10))==null?void 0:o[0])==null?void 0:l.data()),eyeL:await((p=(u=t.filter(f=>f.size===142))==null?void 0:u[0])==null?void 0:p.data()),irisR:await((d=(c=t.filter(f=>f.size===10))==null?void 0:c[1])==null?void 0:d.data()),eyeR:await((m=(h=t.filter(f=>f.size===142))==null?void 0:h[1])==null?void 0:m.data())};for(let f of Object.values(a))if(!f)return e;let n=hl.reduce((f,g)=>f+=e[g][2],0)/hl.length;for(let f=0;ff+=e[g][2],0)/ml.length;for(let f=0;fae()-dr.timestamp,n=dr.skipped<(((u=t.face.detector)==null?void 0:u.skipFrames)||0);!t.skipAllowed||!a||!n||dr.boxes.length===0?(dr.boxes=await W9(e,t),dr.timestamp=ae(),dr.skipped=0):dr.skipped++;let r=[],s=[],i=0,o=lc;for(let x=0;x[T[0]/(e.shape[2]||0),T[1]/(e.shape[1]||0),(T[2]||0)/o]);for(let T of Object.keys(pl))I.annotations[T]=[I.mesh[pl[T]]]}else if(!Ct)t.debug&&K("face mesh detection requested, but model is not loaded");else{if((h=t.face.attention)!=null&&h.enabled&&!ne.kernels.includes("atan2"))return t.face.attention.enabled=!1,J(I.tensor),r;let T=Ct.execute(I.tensor),M=await T.find(P=>P.shape[P.shape.length-1]===1).data();if(I.faceScore=Math.round(100*M[0])/100,I.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(A.confidence=I.faceScore,t.face.mesh.keepInvalid){I.box=_0(A,e),I.boxRaw=$0(A,e),I.size=A.size,I.score=I.boxScore,I.mesh=A.landmarks,I.meshRaw=I.mesh.map(P=>[P[0]/(e.shape[2]||1),P[1]/(e.shape[1]||1),(P[2]||0)/o]);for(let P of Object.keys(pl))I.annotations[P]=[I.mesh[pl[P]]]}}else{let P=T.find(O=>O.shape[O.shape.length-1]===1404),E=Q(P,[-1,3]),S=await E.array();J(E),(f=t.face.attention)!=null&&f.enabled?S=await X9(S,T):(g=t.face.iris)!=null&&g.enabled&&(S=await j9(S,I.tensor,lc)),I.mesh=$9(S,A,b,w,lc),I.meshRaw=I.mesh.map(O=>[O[0]/(e.shape[2]||0),O[1]/(e.shape[1]||0),(O[2]||0)/o]);for(let O of Object.keys(Pn))I.annotations[O]=Pn[O].map(W=>I.mesh[W]);I.score=I.faceScore;let _={...D9(I.mesh,A),confidence:A.confidence,landmarks:A.landmarks,size:A.size};I.box=_0(_,e),I.boxRaw=$0(_,e),I.size=_.size,s.push(_)}J(T)}I.score>(((y=t.face.detector)==null?void 0:y.minConfidence)||1)?r.push(I):J(I.tensor)}return dr.boxes=s,r}async function Y9(e){var t,a,n,r,s,i;return ne.initial&&(Ct=null),(t=e.face.attention)!=null&&t.enabled&&(Ct!=null&&Ct.signature)&&Object.keys(((a=Ct==null?void 0:Ct.signature)==null?void 0:a.outputs)||{}).length<6&&(Ct=null),Ct?e.debug&&K("cached model:",Ct.modelUrl):(n=e.face.attention)!=null&&n.enabled?Ct=await Pe(e.face.attention.modelPath):Ct=await Pe((r=e.face.mesh)==null?void 0:r.modelPath),lc=Ct.executor&&((s=Ct==null?void 0:Ct.inputs)!=null&&s[0].shape)?(i=Ct==null?void 0:Ct.inputs)==null?void 0:i[0].shape[2]:256,Ct}var Z9=cl,J9=ic;var My=[],na,L0=[],Q9=0,eI=0,Ey=Number.MAX_SAFE_INTEGER,Py=!1;async function tI(e){var t,a,n;return ne.initial&&(na=null),na?e.debug&&K("cached model:",na.modelUrl):(na=await Pe((t=e.face.emotion)==null?void 0:t.modelPath),Py=((n=(a=na==null?void 0:na.inputs)==null?void 0:a[0].shape)==null?void 0:n[3])===3,Py?My=["angry","disgust","fear","happy","neutral","sad","surprise"]:My=["angry","disgust","fear","happy","sad","surprise","neutral"]),na}async function _y(e,t,a,n){var i,o;if(!na)return[];let r=Ey<(((i=t.face.emotion)==null?void 0:i.skipFrames)||0),s=(((o=t.face.emotion)==null?void 0:o.skipTime)||0)>ae()-eI;return t.skipAllowed&&s&&r&&Q9===n&&L0[a]&&L0[a].length>0?(Ey++,L0[a]):(Ey=0,new Promise(async l=>{var p,c,d;let u=[];if((p=t.face.emotion)!=null&&p.enabled){let h={},m=na!=null&&na.inputs[0].shape?na.inputs[0].shape[2]:0;if(((c=t.face.emotion)==null?void 0:c.crop)>0){let g=(d=t.face.emotion)==null?void 0:d.crop,y=[[g,g,1-g,1-g]];h.resize=fe.cropAndResize(e,y,[0],[m,m])}else h.resize=fe.resizeBilinear(e,[m,m],!1);Py?(h.mul=te(h.resize,255),h.normalize=xe(h.mul,[103.939,116.779,123.68]),h.emotion=na==null?void 0:na.execute(h.normalize)):(h.channels=te(h.resize,ze.rgb),h.grayscale=ot(h.channels,3,!0),h.grayscaleSub=xe(h.grayscale,ze.tf05),h.grayscaleMul=te(h.grayscaleSub,ze.tf2),h.emotion=na==null?void 0:na.execute(h.grayscaleMul)),eI=ae();let f=await h.emotion.data();for(let g=0;g(t.face.emotion.minConfidence||0)&&u.push({score:Math.min(.99,Math.trunc(100*f[g])/100),emotion:My[g]});u.sort((g,y)=>y.score-g.score),Object.keys(h).forEach(g=>J(h[g]))}L0[a]=u,Q9=n,l(u)}))}var ra,Is=[],nI=0,rI=0,$y=Number.MAX_SAFE_INTEGER;async function sI(e){var t;return ne.initial&&(ra=null),ra?e.debug&&K("cached model:",ra.modelUrl):ra=await Pe((t=e.face.description)==null?void 0:t.modelPath),ra}function a3e(e,t){var s,i;let a=e.image||e.tensor||e;if(!(ra!=null&&ra.inputs[0].shape))return a;let n;if(((s=t.face.description)==null?void 0:s.crop)>0){let o=(i=t.face.description)==null?void 0:i.crop,l=[[o,o,1-o,1-o]];n=fe.cropAndResize(a,l,[0],[ra.inputs[0].shape[2],ra.inputs[0].shape[1]])}else n=fe.resizeBilinear(a,[ra.inputs[0].shape[2],ra.inputs[0].shape[1]],!1);let r=te(n,ze.tf255);return J(n),r}async function Fy(e,t,a,n){var o,l,u,p;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(ra!=null&&ra.executor))return r;let s=$y<(((o=t.face.description)==null?void 0:o.skipFrames)||0),i=(((l=t.face.description)==null?void 0:l.skipTime)||0)>ae()-nI;return t.skipAllowed&&s&&i&&rI===n&&((u=Is==null?void 0:Is[a])==null?void 0:u.age)>0&&((p=Is==null?void 0:Is[a])==null?void 0:p.genderScore)>0?($y++,Is[a]):($y=0,new Promise(async c=>{var d;if((d=t.face.description)!=null&&d.enabled){let h=a3e(e,t),m=ra==null?void 0:ra.execute(h);nI=ae(),J(h);let g=await m.find(N=>N.shape[1]===1).data(),y=Math.trunc(200*Math.abs(g[0]-.5))/100;y>(t.face.description.minConfidence||0)&&(r.gender=g[0]<=.5?"female":"male",r.genderScore=Math.min(.99,y));let x=rr(m.find(N=>N.shape[1]===100),1),A=(await x.data())[0];J(x);let w=await m.find(N=>N.shape[1]===100).data();r.age=Math.round(w[A-1]>w[A+1]?10*A-100*w[A-1]:10*A+100*w[A+1])/10,(Number.isNaN(g[0])||Number.isNaN(w[0]))&&K("faceres error:",{model:ra,result:m});let I=m.find(N=>N.shape[1]===1024),T=I?await I.data():[];r.descriptor=Array.from(T),m.forEach(N=>J(N))}Is[a]=r,rI=n,c(r)}))}var id=.1,Dy=.5;function n3e(e,t,a){let n=!1,r=a.length-1;for(let s=0;st!=a[r].y>t&&e<(a[r].x-a[s].x)*(t-a[s].y)/(a[r].y-a[s].y)+a[s].x&&(n=!n);return n}async function oI(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,a=e.tensor.shape[1]||0,n=await e.tensor.buffer(),r=[];for(let i of Pn.silhouette)r.push({x:(e.mesh[i][0]-e.box[0])/e.box[2],y:(e.mesh[i][1]-e.box[1])/e.box[3]});id&&id>0&&(r=r.map(i=>({x:i.x>.5?i.x+id:i.x-id,y:i.y>.5?i.y+id:i.y-id})));for(let i=0;iae()-uI,s=Oy<(((o=t.face.antispoof)==null?void 0:o.skipFrames)||0);return t.skipAllowed&&r&&s&&lI===n&&W0[a]?(Oy++,W0[a]):(Oy=0,new Promise(async l=>{let u=fe.resizeBilinear(e,[sa!=null&&sa.inputs[0].shape?sa.inputs[0].shape[2]:0,sa!=null&&sa.inputs[0].shape?sa.inputs[0].shape[1]:0],!1),p=sa==null?void 0:sa.execute(u),c=(await p.data())[0];W0[a]=Math.round(100*c)/100,lI=n,uI=ae(),J([u,p]),l(W0[a])}))}var ia,B0=[],Ly=Number.MAX_SAFE_INTEGER,cI=0,hI=0;async function mI(e){var t;return ne.initial&&(ia=null),ia?e.debug&&K("cached model:",ia.modelUrl):ia=await Pe((t=e.face.liveness)==null?void 0:t.modelPath),ia}async function Wy(e,t,a,n){var i,o;if(!(ia!=null&&ia.executor))return 0;let r=(((i=t.face.liveness)==null?void 0:i.skipTime)||0)>ae()-hI,s=Ly<(((o=t.face.liveness)==null?void 0:o.skipFrames)||0);return t.skipAllowed&&r&&s&&cI===n&&B0[a]?(Ly++,B0[a]):(Ly=0,new Promise(async l=>{let u=fe.resizeBilinear(e,[ia!=null&&ia.inputs[0].shape?ia.inputs[0].shape[2]:0,ia!=null&&ia.inputs[0].shape?ia.inputs[0].shape[1]:0],!1),p=ia==null?void 0:ia.execute(u),c=(await p.data())[0];B0[a]=Math.round(100*c)/100,cI=n,hI=ae(),J([u,p]),l(B0[a])}))}var _n,By=[],s3e=["white","black","asian","indian","other"],i3e=[15,23,28,35.5,45.5,55.5,65],gI=0,yI=0,Vy=Number.MAX_SAFE_INTEGER;async function xI(e){var t;return ne.initial&&(_n=null),_n?e.debug&&K("cached model:",_n.modelUrl):_n=await Pe((t=e.face.gear)==null?void 0:t.modelPath),_n}async function Uy(e,t,a,n){var i,o;if(!_n)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=Vy<(((i=t.face.gear)==null?void 0:i.skipFrames)||0),s=(((o=t.face.gear)==null?void 0:o.skipTime)||0)>ae()-yI;return t.skipAllowed&&s&&r&&gI===n&&By[a]?(Vy++,By[a]):(Vy=0,new Promise(async l=>{var y,x,A,b;if(!(_n!=null&&_n.inputs[0].shape))return;let u={},p=[[0,.1,.9,.9]];if(((y=t.face.gear)==null?void 0:y.crop)>0){let w=(x=t.face.gear)==null?void 0:x.crop;p=[[w,w,1-w,1-w]]}u.resize=fe.cropAndResize(e,p,[0],[_n.inputs[0].shape[2],_n.inputs[0].shape[1]]);let c={age:0,gender:"unknown",genderScore:0,race:[]};(A=t.face.gear)!=null&&A.enabled&&([u.age,u.gender,u.race]=_n.execute(u.resize,["age_output","gender_output","race_output"]));let d=await u.gender.data();c.gender=d[0]>d[1]?"male":"female",c.genderScore=Math.round(100*(d[0]>d[1]?d[0]:d[1]))/100;let h=await u.race.data();for(let w=0;w(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&c.race.push({score:Math.round(100*h[w])/100,race:s3e[w]});c.race.sort((w,I)=>I.score-w.score);let f=Array.from(await u.age.data()).map((w,I)=>[i3e[I],w]).sort((w,I)=>I[1]-w[1]),g=f[0][0];for(let w=1;wJ(u[w])),By[a]=c,gI=n,yI=ae(),l(c)}))}var Pa,V0=[],bI=0,vI=0,Gy=Number.MAX_SAFE_INTEGER;async function wI(e){return ne.initial&&(Pa=null),Pa?e.debug&&K("cached model:",Pa.modelUrl):Pa=await Pe(e.face.ssrnet.modelPathAge),Pa}async function Hy(e,t,a,n){var i,o,l,u;if(!Pa)return{age:0};let r=Gy<(((i=t.face.ssrnet)==null?void 0:i.skipFrames)||0),s=(((o=t.face.ssrnet)==null?void 0:o.skipTime)||0)>ae()-vI;return t.skipAllowed&&r&&s&&bI===n&&((l=V0[a])!=null&&l.age)&&((u=V0[a])==null?void 0:u.age)>0?(Gy++,V0[a]):(Gy=0,new Promise(async p=>{var h,m,f;if(!(Pa!=null&&Pa.inputs)||!Pa.inputs[0]||!Pa.inputs[0].shape)return;let c={};if(((h=t.face.ssrnet)==null?void 0:h.crop)>0){let g=(m=t.face.ssrnet)==null?void 0:m.crop,y=[[g,g,1-g,1-g]];c.resize=fe.cropAndResize(e,y,[0],[Pa.inputs[0].shape[2],Pa.inputs[0].shape[1]])}else c.resize=fe.resizeBilinear(e,[Pa.inputs[0].shape[2],Pa.inputs[0].shape[1]],!1);c.enhance=te(c.resize,ze.tf255);let d={age:0};if((f=t.face.ssrnet)!=null&&f.enabled&&(c.age=Pa.execute(c.enhance)),c.age){let g=await c.age.data();d.age=Math.trunc(10*g[0])/10}Object.keys(c).forEach(g=>J(c[g])),V0[a]=d,bI=n,vI=ae(),p(d)}))}var xa,U0=[],II=0,SI=0,jy=Number.MAX_SAFE_INTEGER,qy=[.2989,.587,.114];async function CI(e){var t;return ne.initial&&(xa=null),xa?e.debug&&K("cached model:",xa.modelUrl):xa=await Pe((t=e.face.ssrnet)==null?void 0:t.modelPathGender),xa}async function Xy(e,t,a,n){var i,o,l,u;if(!xa)return{gender:"unknown",genderScore:0};let r=jy<(((i=t.face.ssrnet)==null?void 0:i.skipFrames)||0),s=(((o=t.face.ssrnet)==null?void 0:o.skipTime)||0)>ae()-SI;return t.skipAllowed&&r&&s&&II===n&&((l=U0[a])!=null&&l.gender)&&((u=U0[a])==null?void 0:u.genderScore)>0?(jy++,U0[a]):(jy=0,new Promise(async p=>{var m,f,g;if(!(xa!=null&&xa.inputs[0].shape))return;let c={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let y=(f=t.face.ssrnet)==null?void 0:f.crop,x=[[y,y,1-y,1-y]];c.resize=fe.cropAndResize(e,x,[0],[xa.inputs[0].shape[2],xa.inputs[0].shape[1]])}else c.resize=fe.resizeBilinear(e,[xa.inputs[0].shape[2],xa.inputs[0].shape[1]],!1);c.enhance=De(()=>{var x,A;let y;if(((A=(x=xa==null?void 0:xa.inputs)==null?void 0:x[0].shape)==null?void 0:A[3])===1){let[b,w,I]=Sa(c.resize,3,3),T=te(b,qy[0]),N=te(w,qy[1]),M=te(I,qy[2]),P=Fh([T,N,M]);y=te(xe(P,ze.tf05),2)}else y=te(xe(c.resize,ze.tf05),2);return y});let d={gender:"unknown",genderScore:0};(g=t.face.ssrnet)!=null&&g.enabled&&(c.gender=xa.execute(c.enhance));let h=await c.gender.data();d.gender=h[0]>h[1]?"female":"male",d.genderScore=h[0]>h[1]?Math.trunc(100*h[0])/100:Math.trunc(100*h[1])/100,Object.keys(c).forEach(y=>J(c[y])),U0[a]=d,II=n,SI=ae(),p(d)}))}var nn,Ky=[],NI=0,RI=0,EI=Number.MAX_SAFE_INTEGER;async function MI(e){var t;return ne.initial&&(nn=null),nn?e.debug&&K("cached model:",nn.modelUrl):nn=await Pe((t=e.face.mobilefacenet)==null?void 0:t.modelPath),nn}async function Yy(e,t,a,n){var i,o;if(!(nn!=null&&nn.executor))return[];let r=EI<(((i=t.face.mobilefacenet)==null?void 0:i.skipFrames)||0),s=(((o=t.face.mobilefacenet)==null?void 0:o.skipTime)||0)>ae()-RI;return t.skipAllowed&&s&&r&&NI===n&&Ky[a]?(EI++,Ky[a]):new Promise(async l=>{var p;let u=[];if((p=t.face.mobilefacenet)!=null&&p.enabled&&(nn!=null&&nn.inputs[0].shape)){let c={};c.crop=fe.resizeBilinear(e,[nn.inputs[0].shape[2],nn.inputs[0].shape[1]],!1),c.data=nn.execute(c.crop);let d=await c.data.data();u=Array.from(d),Object.keys(c).forEach(h=>J(c[h]))}Ky[a]=u,NI=n,RI=ae(),l(u)})}var rn,Zy=[],_I=0,$I=0,FI=Number.MAX_SAFE_INTEGER;async function DI(e){return ne.initial&&(rn=null),rn?e.debug&&K("cached model:",rn.modelUrl):rn=await Pe(e.face.insightface.modelPath),rn}async function Jy(e,t,a,n){var i,o;if(!(rn!=null&&rn.executor))return[];let r=FI<(((i=t.face.insightface)==null?void 0:i.skipFrames)||0),s=(((o=t.face.insightface)==null?void 0:o.skipTime)||0)>ae()-$I;return t.skipAllowed&&s&&r&&_I===n&&Zy[a]?(FI++,Zy[a]):new Promise(async l=>{var p;let u=[];if((p=t.face.insightface)!=null&&p.enabled&&(rn!=null&&rn.inputs[0].shape)){let c={};c.crop=fe.resizeBilinear(e,[rn.inputs[0].shape[2],rn.inputs[0].shape[1]],!1),c.data=rn.execute(c.crop);let d=await c.data.data();u=Array.from(d),Object.keys(c).forEach(h=>J(c[h]))}Zy[a]=u,_I=n,$I=ae(),l(u)})}var o3e=e=>{let t=(c,d)=>Math.atan2(c[1]-d[1],c[0]-d[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let a=[0,-.1],n=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],i=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],o=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(i[0]-s[0])/o[0]-a[0],n*(s[1]-i[1])/o[1]-a[1]],u=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return u=Math.min(u,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:u}},zI=(e,t)=>{let a=f=>{let g=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=g,f[1]/=g,f[2]/=g,f},n=(f,g)=>{let y=f[0]-g[0],x=f[1]-g[1],A=f[2]-g[2];return[y,x,A]},r=(f,g)=>{let y=f[1]*g[2]-f[2]*g[1],x=f[2]*g[0]-f[0]*g[2],A=f[0]*g[1]-f[1]*g[0];return[y,x,A]},s=f=>{let[g,y,x,A,b,w,I,T,N]=f,M,P,E;return A<1?A>-1?(E=Math.asin(A),P=Math.atan2(-I,g),M=Math.atan2(-w,b)):(E=-Math.PI/2,P=-Math.atan2(T,N),M=0):(E=Math.PI/2,P=Math.atan2(T,N),M=0),Number.isNaN(M)&&(M=0),Number.isNaN(P)&&(P=0),Number.isNaN(E)&&(E=0),{pitch:2*-M,yaw:2*-P,roll:2*-E}},i=e.meshRaw;if(!i||i.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let o=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[i[10],i[152],i[234],i[454]].map(f=>[f[0]*t[0]/o,f[1]*t[1]/o,f[2]]),u=a(n(l[1],l[0])),p=a(n(l[3],l[2])),c=a(r(p,u));p=r(u,c);let d=[p[0],p[1],p[2],u[0],u[1],u[2],c[0],c[1],c[2]],h=s(d),m=i.length===478?o3e(e):{bearing:0,strength:0};return{angle:h,matrix:d,gaze:m}};function LI(e,t){let a=e==null?void 0:e.annotations;if(!(a!=null&&a.leftEyeIris)||!(a!=null&&a.rightEyeIris))return 0;let n=Math.max(Math.abs(a.leftEyeIris[3][0]-a.leftEyeIris[1][0]),Math.abs(a.rightEyeIris[3][0]-a.rightEyeIris[1][0]))/t;return Math.round(1.17/n)/100}var Qy=async(e,t)=>{var m,f,g,y,x,A,b,w,I,T,N,M,P,E,S,_,O,W,$,U,G,q,H;let a=ae(),n,r,s,i,o,l,u,p,c,d=[];e.state="run:face";let h=await K9(t,e.config);if(e.performance.face=ne.perfadd?(e.performance.face||0)+Math.trunc(ae()-a):Math.trunc(ae()-a),!t.shape||t.shape.length!==4)return[];if(!h)return[];for(let V=0;V200?zI(h[V],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?i=(f=e.config.face.emotion)!=null&&f.enabled?_y(h[V].tensor||Ve([]),e.config,V,h.length):[]:(e.state="run:emotion",a=ae(),i=(g=e.config.face.emotion)!=null&&g.enabled?await _y(h[V].tensor||Ve([]),e.config,V,h.length):[],e.performance.emotion=ne.perfadd?(e.performance.emotion||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?u=(y=e.config.face.antispoof)!=null&&y.enabled?zy(h[V].tensor||Ve([]),e.config,V,h.length):0:(e.state="run:antispoof",a=ae(),u=(x=e.config.face.antispoof)!=null&&x.enabled?await zy(h[V].tensor||Ve([]),e.config,V,h.length):0,e.performance.antispoof=ne.perfadd?(e.performance.antispoof||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?p=(A=e.config.face.liveness)!=null&&A.enabled?Wy(h[V].tensor||Ve([]),e.config,V,h.length):0:(e.state="run:liveness",a=ae(),p=(b=e.config.face.liveness)!=null&&b.enabled?await Wy(h[V].tensor||Ve([]),e.config,V,h.length):0,e.performance.liveness=ne.perfadd?(e.performance.antispoof||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(w=e.config.face.gear)!=null&&w.enabled?Uy(h[V].tensor||Ve([]),e.config,V,h.length):null:(e.state="run:gear",a=ae(),r=(I=e.config.face.gear)!=null&&I.enabled?await Uy(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.gear=Math.trunc(ae()-a)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(n=(T=e.config.face.ssrnet)!=null&&T.enabled?Hy(h[V].tensor||Ve([]),e.config,V,h.length):null,s=(N=e.config.face.ssrnet)!=null&&N.enabled?Xy(h[V].tensor||Ve([]),e.config,V,h.length):null):(e.state="run:ssrnet",a=ae(),n=(M=e.config.face.ssrnet)!=null&&M.enabled?await Hy(h[V].tensor||Ve([]),e.config,V,h.length):null,s=(P=e.config.face.ssrnet)!=null&&P.enabled?await Xy(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.ssrnet=Math.trunc(ae()-a)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?o=(E=e.config.face.mobilefacenet)!=null&&E.enabled?Yy(h[V].tensor||Ve([]),e.config,V,h.length):null:(e.state="run:mobilefacenet",a=ae(),o=(S=e.config.face.mobilefacenet)!=null&&S.enabled?await Yy(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.mobilefacenet=Math.trunc(ae()-a)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(_=e.config.face.insightface)!=null&&_.enabled?Jy(h[V].tensor||Ve([]),e.config,V,h.length):null:(e.state="run:mobilefacenet",a=ae(),l=(O=e.config.face.insightface)!=null&&O.enabled?await Jy(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.mobilefacenet=Math.trunc(ae()-a)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?c=Fy(h[V].tensor||Ve([]),e.config,V,h.length):(e.state="run:description",a=ae(),c=await Fy(h[V].tensor||Ve([]),e.config,V,h.length),e.performance.description=ne.perfadd?(e.performance.description||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End Description:"),e.config.async&&([n,s,i,o,l,c,r,u,p]=await Promise.all([n,s,i,o,l,c,r,u,p])),e.analyze("Finish Face:"),(W=e.config.face.ssrnet)!=null&&W.enabled&&n&&s&&(c={...c,age:n.age,gender:s.gender,genderScore:s.genderScore}),($=e.config.face.gear)!=null&&$.enabled&&r&&(c={...c,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(U=e.config.face.mobilefacenet)!=null&&U.enabled&&o&&(c.descriptor=o),(G=e.config.face.insightface)!=null&&G.enabled&&l&&(c.descriptor=l);let X=(q=e.config.face.iris)!=null&&q.enabled?LI(h[V],t.shape[2]):0,re=(H=e.config.face.detector)!=null&&H.return?Oe(h[V].tensor):null;J(h[V].tensor),h[V].tensor&&delete h[V].tensor;let ee={...h[V],id:V};c.age&&(ee.age=c.age),c.gender&&(ee.gender=c.gender),c.genderScore&&(ee.genderScore=c.genderScore),c.descriptor&&(ee.embedding=c.descriptor),c.race&&(ee.race=c.race),i&&(ee.emotion=i),u&&(ee.real=u),p&&(ee.live=p),X>0&&(ee.distance=X),Z&&(ee.rotation=Z),re&&(ee.tensor=re),d.push(ee),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),d};var _a={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>_a.nameMapping[e],getPoints:e=>_a.pointsMapping[e]},Cs={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>Cs.nameMapping[e]},Pt={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>Pt.nameMapping[e]},Ss=class{constructor(t){he(this,"name");he(this,"curls");he(this,"directions");he(this,"weights");he(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,a,n){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([a,n])}direction(t,a,n){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([a,n])}weight(t,a){this.weights[t]=a;let n=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/n)}matchAgainst(t,a){let n=0;for(let r in t){let s=t[r],i=this.curls[r];if(typeof i=="undefined"){n+=this.weightsRelative[r];continue}for(let[o,l]of i)if(s===o){n+=l*this.weightsRelative[r];break}}for(let r in a){let s=a[r],i=this.directions[r];if(typeof i=="undefined"){n+=this.weightsRelative[r];continue}for(let[o,l]of i)if(s===o){n+=l*this.weightsRelative[r];break}}return n/10}};var{thumb:Vn,index:_r,middle:$r,ring:xl,pinky:Al}=_a,{none:Un,half:u3e,full:Gn}=Cs,{verticalUp:od,verticalDown:V7e,horizontalLeft:ex,horizontalRight:d3e,diagonalUpRight:p3e,diagonalUpLeft:ld,diagonalDownRight:U7e,diagonalDownLeft:G7e}=Pt,Ts=new Ss("thumbs up");Ts.curl(Vn,Un,1);Ts.direction(Vn,od,1);Ts.direction(Vn,ld,.25);Ts.direction(Vn,p3e,.25);for(let e of[_a.index,_a.middle,_a.ring,_a.pinky])Ts.curl(e,Gn,1),Ts.direction(e,ex,1),Ts.direction(e,d3e,1);var Ht=new Ss("victory");Ht.curl(Vn,u3e,.5);Ht.curl(Vn,Un,.5);Ht.direction(Vn,od,1);Ht.direction(Vn,ld,1);Ht.curl(_r,Un,1);Ht.direction(_r,od,.75);Ht.direction(_r,ld,1);Ht.curl($r,Un,1);Ht.direction($r,od,1);Ht.direction($r,ld,.75);Ht.curl(xl,Gn,1);Ht.direction(xl,od,.2);Ht.direction(xl,ld,1);Ht.direction(xl,ex,.2);Ht.curl(Al,Gn,1);Ht.direction(Al,od,.2);Ht.direction(Al,ld,1);Ht.direction(Al,ex,.2);Ht.weight(_r,2);Ht.weight($r,2);var Ns=new Ss("point");Ns.curl(Vn,Gn,1);Ns.curl(_r,Un,.5);Ns.curl($r,Gn,.5);Ns.curl(xl,Gn,.5);Ns.curl(Al,Gn,.5);Ns.weight(_r,2);Ns.weight($r,2);var Rs=new Ss("middle finger");Rs.curl(Vn,Un,1);Rs.curl(_r,Gn,.5);Rs.curl($r,Gn,.5);Rs.curl(xl,Gn,.5);Rs.curl(Al,Gn,.5);Rs.weight(_r,2);Rs.weight($r,2);var ud=new Ss("open palm");ud.curl(Vn,Un,.75);ud.curl(_r,Un,.75);ud.curl($r,Un,.75);ud.curl(xl,Un,.75);ud.curl(Al,Un,.75);var WI=[Ts,Ht,Ns,Rs,ud];var c3e=.7,bl={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function BI(e,t,a,n){let r=(t-n)/(e-a),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function UI(e,t){if(!e||!t)return[0,0];let a=BI(e[0],e[1],t[0],t[1]);if(e.length===2)return a;let n=BI(e[1],e[2],t[1],t[2]);return[a,n]}function VI(e,t=1){let a=0,n=0,r=0;return e>=75&&e<=105?a=1*t:e>=25&&e<=155?n=1*t:r=1*t,[a,n,r]}function h3e(e,t,a){let n=e[0]-t[0],r=e[0]-a[0],s=t[0]-a[0],i=e[1]-t[1],o=e[1]-a[1],l=t[1]-a[1],u=e[2]-t[2],p=e[2]-a[2],c=t[2]-a[2],d=Math.sqrt(n*n+i*i+u*u),h=Math.sqrt(r*r+o*o+p*p),m=Math.sqrt(s*s+l*l+c*c),f=(m*m+d*d-h*h)/(2*m*d);f>1?f=1:f<-1&&(f=-1);let g=Math.acos(f);g=57.2958*g%180;let y;return g>bl.NO_CURL_START_LIMIT?y=Cs.none:g>bl.HALF_CURL_START_LIMIT?y=Cs.half:y=Cs.full,y}function GI(e,t,a,n){let r;return n===Math.abs(e)?e>0?r=Pt.horizontalLeft:r=Pt.horizontalRight:n===Math.abs(t)?t>0?r=Pt.horizontalLeft:r=Pt.horizontalRight:a>0?r=Pt.horizontalLeft:r=Pt.horizontalRight,r}function HI(e,t,a,n){let r;return n===Math.abs(e)?e<0?r=Pt.verticalDown:r=Pt.verticalUp:n===Math.abs(t)?t<0?r=Pt.verticalDown:r=Pt.verticalUp:a<0?r=Pt.verticalDown:r=Pt.verticalUp,r}function m3e(e,t,a,n,r,s,i,o){let l,u=HI(e,t,a,n),p=GI(r,s,i,o);return u===Pt.verticalUp?p===Pt.horizontalLeft?l=Pt.diagonalUpLeft:l=Pt.diagonalUpRight:p===Pt.horizontalLeft?l=Pt.diagonalDownLeft:l=Pt.diagonalDownRight,l}function f3e(e,t,a,n){let r=e[0]-t[0],s=e[0]-a[0],i=t[0]-a[0],o=e[1]-t[1],l=e[1]-a[1],u=t[1]-a[1],p=Math.max(Math.abs(r),Math.abs(s),Math.abs(i)),c=Math.max(Math.abs(o),Math.abs(l),Math.abs(u)),d=0,h=0,m=0,f=c/(p+1e-5);f>1.5?d+=bl.DISTANCE_VOTE_POWER:f>.66?h+=bl.DISTANCE_VOTE_POWER:m+=bl.DISTANCE_VOTE_POWER;let g=Math.sqrt(r*r+o*o),y=Math.sqrt(s*s+l*l),x=Math.sqrt(i*i+u*u),A=Math.max(g,y,x),b=e[0],w=e[1],I=a[0],T=a[1];A===g?(I=a[0],T=a[1]):A===x&&(b=t[0],w=t[1]);let P=UI([b,w],[I,T]),E=VI(P,bl.TOTAL_ANGLE_VOTE_POWER);d+=E[0],h+=E[1],m+=E[2];for(let _ of n){let O=VI(_,bl.SINGLE_ANGLE_VOTE_POWER);d+=O[0],h+=O[1],m+=O[2]}let S;return d===Math.max(d,h,m)?S=HI(l,o,u,c):m===Math.max(h,m)?S=GI(s,r,i,p):S=m3e(l,o,u,c,s,r,i,p),S}function jI(e){let t=[],a=[],n=[],r=[];if(!e)return{curls:n,directions:r};for(let s of _a.all){let i=_a.getPoints(s),o=[],l=[];for(let u of i){let p=e[u[0]],c=e[u[1]],d=UI(p,c),h=d[0],m=d[1];o.push(h),l.push(m)}t.push(o),a.push(l)}for(let s of _a.all){let i=s===_a.thumb?1:0,o=_a.getPoints(s),l=e[o[i][0]],u=e[o[i+1][1]],p=e[o[3][1]],c=h3e(l,u,p),d=f3e(l,u,p,t[s].slice(i));n[s]=c,r[s]=d}return{curls:n,directions:r}}function G0(e){if(!e||e.length===0)return null;let t=jI(e),a={};for(let n of _a.all)a[_a.getName(n)]={curl:Cs.getName(t.curls[n]),direction:Pt.getName(t.directions[n])};return a}function qI(e){let t=[];if(!e||e.length===0)return t;let a=jI(e);for(let n of WI){let r=n.matchAgainst(a.curls,a.directions);r>=c3e&&t.push({name:n.name,confidence:r})}return t}var XI=e=>{if(!e)return[];let t=[];for(let a=0;al.part==="leftWrist"),r=e[a].keypoints.find(l=>l.part==="rightWrist"),s=e[a].keypoints.find(l=>l.part==="nose");s&&n&&r&&n.position[1]l.part==="leftShoulder"),o=e[a].keypoints.find(l=>l.part==="rightShoulder");i&&o&&Math.abs(i.positionRaw[1]-o.positionRaw[1])>.1&&t.push({body:a,gesture:`leaning ${i.position[1]>o.position[1]?"left":"right"}`})}return t},KI=e=>{if(!e)return[];let t=[];for(let a=0;a450){let n=(e[a].mesh[33][2]||0)-(e[a].mesh[263][2]||0),r=e[a].mesh[33][0]-e[a].mesh[263][0];Math.abs(n/r)<=.15?t.push({face:a,gesture:"facing center"}):t.push({face:a,gesture:`facing ${n<0?"left":"right"}`}),Math.abs(e[a].mesh[374][1]-e[a].mesh[386][1])/Math.abs(e[a].mesh[443][1]-e[a].mesh[450][1])<.2&&t.push({face:a,gesture:"blink left eye"}),Math.abs(e[a].mesh[145][1]-e[a].mesh[159][1])/Math.abs(e[a].mesh[223][1]-e[a].mesh[230][1])<.2&&t.push({face:a,gesture:"blink right eye"});let o=Math.min(100,500*Math.abs(e[a].mesh[13][1]-e[a].mesh[14][1])/Math.abs(e[a].mesh[10][1]-e[a].mesh[152][1]));o>10&&t.push({face:a,gesture:`mouth ${Math.trunc(o)}% open`});let l=e[a].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:a,gesture:`head ${l<0?"up":"down"}`})}return t},YI=e=>{var a,n,r,s;if(!e)return[];let t=[];for(let i=0;i.06||g>.06)&&(h=!1),f>g?g>.04&&t.push({iris:i,gesture:"looking right"}):f>.04&&t.push({iris:i,gesture:"looking left"});let y=Math.abs(e[i].mesh[145][1]-e[i].annotations.rightEyeIris[0][1])/e[i].box[3],x=Math.abs(e[i].mesh[374][1]-e[i].annotations.leftEyeIris[0][1])/e[i].box[3];(x<.01||y<.01||x>.022||y>.022)&&(h=!1),(x<.01||y<.01)&&t.push({iris:i,gesture:"looking down"}),(x>.022||y>.022)&&t.push({iris:i,gesture:"looking up"}),h&&t.push({iris:i,gesture:"looking center"})}return t},ZI=e=>{if(!e)return[];let t=[];for(let a=0;a0){let r=n.reduce((i,o)=>(i.position[2]||0)<(o.position[2]||0)?i:o);t.push({hand:a,gesture:`${r.name} forward`});let s=n.reduce((i,o)=>i.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:a,endPoint:n,palmLandmarks:r,confidence:e.confidence}}function j0(e,t=1.5){let a=uc(e),n=H0(e),r=[t*n[0]/2,t*n[1]/2],s=[a[0]-r[0],a[1]-r[1]],i=[a[0]+r[0],a[1]+r[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function q0(e){let t=uc(e),a=H0(e),r=Math.max(...a)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function y3e(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function aS(e,t){let a=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return y3e(a)}var JI=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Es(e,t){let a=0;for(let n=0;n[i.x,i.y]),this.anchorsTensor=Yn(this.anchors),this.inputSize=((s=(r=(n=(a=this==null?void 0:this.model)==null?void 0:a.inputs)==null?void 0:n[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=Bt([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=Bt([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let a={};a.boxOffsets=Fe(t,[0,0],[-1,2]),a.boxSizes=Fe(t,[0,2],[-1,2]),a.div=ve(a.boxOffsets,this.inputSizeTensor),a.boxCenterPoints=we(a.div,this.anchorsTensor),a.halfBoxSizes=ve(a.boxSizes,this.doubleInputSizeTensor),a.sub=xe(a.boxCenterPoints,a.halfBoxSizes),a.startPoints=te(a.sub,this.inputSizeTensor),a.add=we(a.boxCenterPoints,a.halfBoxSizes),a.endPoints=te(a.add,this.inputSizeTensor);let n=Wu([a.startPoints,a.endPoints],1);return Object.keys(a).forEach(r=>J(a[r])),n}normalizeLandmarks(t,a){let n={};n.reshape=Q(t,[-1,7,2]),n.div=ve(n.reshape,this.inputSizeTensor),n.landmarks=we(n.div,this.anchors[a]?this.anchors[a]:0);let r=te(n.landmarks,this.inputSizeTensor);return Object.keys(n).forEach(s=>J(n[s])),r}async predict(t,a){var o;let n={};n.resize=fe.resizeBilinear(t,[this.inputSize,this.inputSize]),n.div=ve(n.resize,ze.tf127),n.image=xe(n.div,ze.tf1),n.batched=this.model.execute(n.image),n.predictions=Oe(n.batched),n.slice=Fe(n.predictions,[0,0],[-1,1]),n.sigmoid=za(n.slice),n.scores=Oe(n.sigmoid);let r=await n.scores.data();n.boxes=Fe(n.predictions,[0,1],[-1,4]),n.norm=this.normalizeBoxes(n.boxes),n.nms=await fe.nonMaxSuppressionAsync(n.norm,n.scores,3*(((o=a.hand)==null?void 0:o.maxDetected)||1),a.hand.iouThreshold,a.hand.minConfidence);let s=await n.nms.array(),i=[];for(let l of s){let u={};u.box=Fe(n.norm,[l,0],[1,-1]),u.slice=Fe(n.predictions,[l,5],[1,14]),u.norm=this.normalizeLandmarks(u.slice,l),u.palmLandmarks=Q(u.norm,[-1,2]);let p=await u.box.data(),c=p.slice(0,2),d=p.slice(2,4),h=await u.palmLandmarks.array(),m={startPoint:c,endPoint:d,palmLandmarks:h,confidence:r[l]},f=tS(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);i.push(f),Object.keys(u).forEach(g=>J(u[g]))}return Object.keys(n).forEach(l=>J(n[l])),i}};var v3e=5,iS=1.65,oS=[0,5,9,13,17,1,2],w3e=0,k3e=2,lS=0,K0=class{constructor(t,a){he(this,"handDetector");he(this,"handPoseModel");he(this,"inputSize");he(this,"storedBoxes");he(this,"skipped");he(this,"detectedHands");var n,r,s;this.handDetector=t,this.handPoseModel=a,this.inputSize=((s=(r=(n=this.handPoseModel)==null?void 0:n.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let a=t.map(i=>i[0]),n=t.map(i=>i[1]),r=[Math.min(...a),Math.min(...n)],s=[Math.max(...a),Math.max(...n)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,a){let n=t.map(s=>nx([...s,1],a)),r=this.calculateLandmarksBoundingBox(n);return j0(q0(r),v3e)}getBoxForHandLandmarks(t){let a=this.calculateLandmarksBoundingBox(t),n=j0(q0(a),iS);n.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=ax(n,[0,0]),u=o.map(h=>[...nx(h,l),h[2]]),p=nS(r),c=[...uc(a),1],d=[Es(c,p[0]),Es(c,p[1])];return u.map(h=>[Math.trunc(h[0]+d[0]),Math.trunc(h[1]+d[1]),Math.trunc(h[2])])}async estimateHands(t,a){let n=!1,r,s=(a.hand.skipTime||0)>ae()-lS,i=this.skipped<(a.hand.skipFrames||0);a.skipAllowed&&s&&i?this.skipped++:(r=await this.handDetector.predict(t,a),this.skipped=0),r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==a.hand.maxDetected||!a.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(n=!0));let o=[];for(let l=0;l=a.hand.minConfidence/4){let w=Q(A,[-1,3]),I=await w.array();J(A),J(w);let T=this.transformRawCoords(I,f,p,m),N=this.getBoxForHandLandmarks(T);this.storedBoxes[l]={...N,confidence:b};let M={landmarks:T,confidence:b,boxConfidence:u.confidence,fingerConfidence:b,box:{topLeft:N.startPoint,bottomRight:N.endPoint}};o.push(M)}else this.storedBoxes[l]=null;J(A)}else{let p=j0(q0(u),iS),c={confidence:u.confidence,boxConfidence:u.confidence,fingerConfidence:0,box:{topLeft:p.startPoint,bottomRight:p.endPoint},landmarks:[]};o.push(c)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=o.length,o.length>a.hand.maxDetected&&(o.length=a.hand.maxDetected),o}};var uS={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},vl,wl,rx;function S3e(){let e=vl?new X0(vl):void 0;e&&wl&&(rx=new K0(e,wl))}async function sx(e,t){rx||S3e();let a=await rx.estimateHands(e,t);if(!a)return[];let n=[];for(let r=0;ra[r].landmarks[c]);let i=a[r].landmarks,o=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(i&&i.length>0){for(let p of i)p[0]o[2]&&(o[2]=p[0]),p[1]>o[3]&&(o[3]=p[1]);o[2]-=o[0],o[3]-=o[1],l=[o[0]/(e.shape[2]||0),o[1]/(e.shape[1]||0),o[2]/(e.shape[2]||0),o[3]/(e.shape[1]||0)]}else o=a[r].box?[Math.trunc(Math.max(0,a[r].box.topLeft[0])),Math.trunc(Math.max(0,a[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,a[r].box.bottomRight[0])-Math.max(0,a[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,a[r].box.bottomRight[1])-Math.max(0,a[r].box.topLeft[1]))]:[0,0,0,0],l=[a[r].box.topLeft[0]/(e.shape[2]||0),a[r].box.topLeft[1]/(e.shape[1]||0),(a[r].box.bottomRight[0]-a[r].box.topLeft[0])/(e.shape[2]||0),(a[r].box.bottomRight[1]-a[r].box.topLeft[1])/(e.shape[1]||0)];let u=G0(i);n.push({id:r,score:Math.round(100*a[r].confidence)/100,boxScore:Math.round(100*a[r].boxConfidence)/100,fingerScore:Math.round(100*a[r].fingerConfidence)/100,label:"hand",box:o,boxRaw:l,keypoints:i,annotations:s,landmarks:u})}return n}async function dS(e){var t;return ne.initial&&(vl=null),vl?e.debug&&K("cached model:",vl.modelUrl):vl=await Pe((t=e.hand.detector)==null?void 0:t.modelPath),vl}async function pS(e){var t;return ne.initial&&(wl=null),wl?e.debug&&K("cached model:",wl.modelUrl):wl=await Pe((t=e.hand.skeleton)==null?void 0:t.modelPath),wl}var Ot=[null,null],C3e=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],Ms=[[0,0],[0,0]],T3e=["hand","fist","pinch","point","face","tip","pinchtip"],hS=4,mS=1.6,N3e=512,R3e=1.4,Y0=Number.MAX_SAFE_INTEGER,ix=0,Fr=[0,0],Dt={boxes:[],hands:[]},fS={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function gS(e){var t;if(ne.initial&&(Ot[0]=null),Ot[0])e.debug&&K("cached model:",Ot[0].modelUrl);else{A0(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),Ot[0]=await Pe((t=e.hand.detector)==null?void 0:t.modelPath);let a=Ot[0].executor?Object.values(Ot[0].modelSignature.inputs):void 0;Ms[0][0]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[1].size):0,Ms[0][1]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[2].size):0}return Ot[0]}async function yS(e){var t;if(ne.initial&&(Ot[1]=null),Ot[1])e.debug&&K("cached model:",Ot[1].modelUrl);else{Ot[1]=await Pe((t=e.hand.skeleton)==null?void 0:t.modelPath);let a=Ot[1].executor?Object.values(Ot[1].modelSignature.inputs):void 0;Ms[1][0]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[1].size):0,Ms[1][1]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[2].size):0}return Ot[1]}async function E3e(e,t){let a=[];if(!e||!Ot[0])return a;let n={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,N3e),i=Math.round(s*r/8)*8;n.resize=fe.resizeBilinear(e,[s,i]),n.cast=Ue(n.resize,"int32"),[n.rawScores,n.rawBoxes]=await Ot[0].executeAsync(n.cast,C3e),n.boxes=Oe(n.rawBoxes,[0,2]),n.scores=Oe(n.rawScores,[0]);let o=Na(n.scores,1);J(o[hS]),o.splice(hS,1),n.filtered=pa(o,1),J(o),n.max=fa(n.filtered,1),n.argmax=rr(n.filtered,1);let l=0;n.nms=await fe.nonMaxSuppressionAsync(n.boxes,n.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let u=await n.nms.data(),p=await n.max.data(),c=await n.argmax.data();for(let d of Array.from(u)){let h=Fe(n.boxes,d,1),m=await h.data();J(h);let f=[m[1],m[0],m[3]-m[1],m[2]-m[0]],g=N0(f,R3e),y=[Math.trunc(f[0]*Fr[0]),Math.trunc(f[1]*Fr[1]),Math.trunc(f[2]*Fr[0]),Math.trunc(f[3]*Fr[1])],x=p[d],A=T3e[c[d]],b={id:l++,score:x,box:y,boxRaw:g,label:A};a.push(b)}return Object.keys(n).forEach(d=>J(n[d])),a.sort((d,h)=>h.score-d.score),a.length>(t.hand.maxDetected||1)&&(a.length=t.hand.maxDetected||1),a}async function ox(e,t,a){let n={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&Ot[1]&&a.hand.landmarks&&t.score>(a.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=fe.cropAndResize(e,[s],[0],[Ms[1][0],Ms[1][1]],"bilinear"),r.div=ve(r.crop,ze.tf255),[r.score,r.keypoints]=Ot[1].execute(r.div,["Identity_1","Identity"]);let i=(await r.score.data())[0],o=(100-Math.trunc(100/(1+Math.exp(i))))/100;if(o>=(a.hand.minConfidence||0)){n.fingerScore=o,r.reshaped=Q(r.keypoints,[-1,3]);let p=(await r.reshaped.array()).map(c=>[c[0]/Ms[1][1],c[1]/Ms[1][0],c[2]||0]).map(c=>[c[0]*t.boxRaw[2],c[1]*t.boxRaw[3],c[2]||0]);n.keypoints=p.map(c=>[Fr[0]*(c[0]+t.boxRaw[0]),Fr[1]*(c[1]+t.boxRaw[1]),c[2]||0]),n.landmarks=G0(n.keypoints);for(let c of Object.keys(fS))n.annotations[c]=fS[c].map(d=>n.landmarks&&n.keypoints[d]?n.keypoints[d]:null)}Object.keys(r).forEach(l=>J(r[l]))}return n}async function lx(e,t){var r,s;if(!((r=Ot[0])!=null&&r.executor)||!((s=Ot[1])!=null&&s.executor)||!Ot[0].inputs[0].shape||!Ot[1].inputs[0].shape)return[];Fr=[e.shape[2]||0,e.shape[1]||0],Y0++;let a=(t.hand.skipTime||0)>ae()-ix,n=Y0<(t.hand.skipFrames||0);return t.skipAllowed&&a&&n?Dt.hands:new Promise(async i=>{let o=3*(t.hand.skipTime||0)>ae()-ix,l=Y0<3*(t.hand.skipFrames||0);t.skipAllowed&&Dt.hands.length===t.hand.maxDetected?Dt.hands=await Promise.all(Dt.boxes.map(p=>ox(e,p,t))):t.skipAllowed&&o&&l&&Dt.hands.length>0?Dt.hands=await Promise.all(Dt.boxes.map(p=>ox(e,p,t))):(Dt.boxes=await E3e(e,t),ix=ae(),Dt.hands=await Promise.all(Dt.boxes.map(p=>ox(e,p,t))),Y0=0);let u=[...Dt.boxes];if(Dt.boxes.length=0,t.cacheSensitivity>0)for(let p=0;p.05&&c.box[3]/(e.shape[1]||1)>.05&&Dt.hands[p].fingerScore&&Dt.hands[p].fingerScore>(t.hand.minConfidence||0)){let d=N0(c.box,mS),h=N0(c.boxRaw,mS);Dt.boxes.push({...u[p],box:d,boxRaw:h})}}for(let p=0;p({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var dc={};yr(dc,{connected:()=>J0,horizontal:()=>ux,kpt:()=>Z0,relative:()=>px,vertical:()=>dx});var Z0=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],ux=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],dx=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],px=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],J0={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var Ae=pr(),cx=0;function AS(e,t){var i,o,l,u,p,c,d,h,m,f,g,y,x,A,b,w,I,T,N,M,P,E,S,_,O,W;let a=ae();if(!e)return pr();let n=Date.now()-e.timestamp,r=n<1e3?8-Math.log(n+1):1;if(e.canvas&&(Ae.canvas=e.canvas),e.error&&(Ae.error=e.error),!Ae.body||e.body.length!==Ae.body.length)Ae.body=JSON.parse(JSON.stringify(e.body));else for(let $=0;$((r-1)*Ae.body[$].box[X]+Z)/r),G=e.body[$].boxRaw.map((Z,X)=>((r-1)*Ae.body[$].boxRaw[X]+Z)/r),q=e.body[$].keypoints.map((Z,X)=>{var re,ee,ge,ie,be,Ce,Re,Le,qe;return{score:Z.score,part:Z.part,position:[Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].position[0]||0)+(Z.position[0]||0))/r:Z.position[0],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].position[1]||0)+(Z.position[1]||0))/r:Z.position[1],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].position[2]||0)+(Z.position[2]||0))/r:Z.position[2]],positionRaw:[Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].positionRaw[0]||0)+(Z.positionRaw[0]||0))/r:Z.positionRaw[0],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].positionRaw[1]||0)+(Z.positionRaw[1]||0))/r:Z.positionRaw[1],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].positionRaw[2]||0)+(Z.positionRaw[2]||0))/r:Z.positionRaw[2]],distance:[Ae.body[$].keypoints[X]?((r-1)*(((re=Ae.body[$].keypoints[X].distance)==null?void 0:re[0])||0)+(((ee=Z.distance)==null?void 0:ee[0])||0))/r:(ge=Z.distance)==null?void 0:ge[0],Ae.body[$].keypoints[X]?((r-1)*(((ie=Ae.body[$].keypoints[X].distance)==null?void 0:ie[1])||0)+(((be=Z.distance)==null?void 0:be[1])||0))/r:(Ce=Z.distance)==null?void 0:Ce[1],Ae.body[$].keypoints[X]?((r-1)*(((Re=Ae.body[$].keypoints[X].distance)==null?void 0:Re[2])||0)+(((Le=Z.distance)==null?void 0:Le[2])||0))/r:(qe=Z.distance)==null?void 0:qe[2]]}}),H={},V={connected:{}};(i=t.body.modelPath)!=null&&i.includes("efficientpose")?V=M0:(o=t.body.modelPath)!=null&&o.includes("blazepose")?V=C0:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(V=dc);for(let[Z,X]of Object.entries(V.connected)){let re=[];for(let ee=0;eebe.part===X[ee]),ie=q.find(be=>be.part===X[ee+1]);ge&&ie&&re.push([ge.position,ie.position])}H[Z]=re}Ae.body[$]={...e.body[$],box:U,boxRaw:G,keypoints:q,annotations:H}}if(!Ae.hand||e.hand.length!==Ae.hand.length)Ae.hand=JSON.parse(JSON.stringify(e.hand));else for(let $=0;$((r-1)*Ae.hand[$].box[Z]+V)/r),G=e.hand[$].boxRaw.map((V,Z)=>((r-1)*Ae.hand[$].boxRaw[Z]+V)/r);Ae.hand[$].keypoints.length!==e.hand[$].keypoints.length&&(Ae.hand[$].keypoints=e.hand[$].keypoints);let q=e.hand[$].keypoints&&e.hand[$].keypoints.length>0?e.hand[$].keypoints.map((V,Z)=>V.map((X,re)=>((r-1)*(Ae.hand[$].keypoints[Z][re]||1)+(X||0))/r)):[],H={};if(Object.keys(Ae.hand[$].annotations).length!==Object.keys(e.hand[$].annotations).length)Ae.hand[$].annotations=e.hand[$].annotations,H=Ae.hand[$].annotations;else if(e.hand[$].annotations)for(let V of Object.keys(e.hand[$].annotations))H[V]=(c=(p=(u=e.hand[$])==null?void 0:u.annotations)==null?void 0:p[V])!=null&&c[0]?e.hand[$].annotations[V].map((Z,X)=>Z.map((re,ee)=>((r-1)*Ae.hand[$].annotations[V][X][ee]+re)/r)):null;Ae.hand[$]={...e.hand[$],box:U,boxRaw:G,keypoints:q,annotations:H}}if(!Ae.face||e.face.length!==Ae.face.length)Ae.face=JSON.parse(JSON.stringify(e.face));else for(let $=0;$((r-1)*Ae.face[$].box[V]+H)/r),G=e.face[$].boxRaw.map((H,V)=>((r-1)*Ae.face[$].boxRaw[V]+H)/r),q=e.face[$].annotations;if(Object.keys(Ae.face[$].annotations).length!==Object.keys(e.face[$].annotations).length)Ae.face[$].annotations=e.face[$].annotations,q=Ae.face[$].annotations;else if(e.face[$].annotations)for(let H of Object.keys(e.face[$].annotations))q[H]=(m=(h=(d=e.face[$])==null?void 0:d.annotations)==null?void 0:h[H])!=null&&m[0]?e.face[$].annotations[H].map((V,Z)=>V.map((X,re)=>((r-1)*Ae.face[$].annotations[H][Z][re]+X)/r)):null;if(e.face[$].rotation){let H={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};H.matrix=(f=e.face[$].rotation)==null?void 0:f.matrix,H.angle={roll:((r-1)*(((y=(g=Ae.face[$].rotation)==null?void 0:g.angle)==null?void 0:y.roll)||0)+(((A=(x=e.face[$].rotation)==null?void 0:x.angle)==null?void 0:A.roll)||0))/r,yaw:((r-1)*(((w=(b=Ae.face[$].rotation)==null?void 0:b.angle)==null?void 0:w.yaw)||0)+(((T=(I=e.face[$].rotation)==null?void 0:I.angle)==null?void 0:T.yaw)||0))/r,pitch:((r-1)*(((M=(N=Ae.face[$].rotation)==null?void 0:N.angle)==null?void 0:M.pitch)||0)+(((E=(P=e.face[$].rotation)==null?void 0:P.angle)==null?void 0:E.pitch)||0))/r},H.gaze={bearing:((r-1)*(((S=Ae.face[$].rotation)==null?void 0:S.gaze.bearing)||0)+(((_=e.face[$].rotation)==null?void 0:_.gaze.bearing)||0))/r,strength:((r-1)*(((O=Ae.face[$].rotation)==null?void 0:O.gaze.strength)||0)+(((W=e.face[$].rotation)==null?void 0:W.gaze.strength)||0))/r},Ae.face[$]={...e.face[$],rotation:H,box:U,boxRaw:G,annotations:q}}else Ae.face[$]={...e.face[$],box:U,boxRaw:G,annotations:q}}if(!Ae.object||e.object.length!==Ae.object.length)Ae.object=JSON.parse(JSON.stringify(e.object));else for(let $=0;$((r-1)*Ae.object[$].box[H]+q)/r),G=e.object[$].boxRaw.map((q,H)=>((r-1)*Ae.object[$].boxRaw[H]+q)/r);Ae.object[$]={...e.object[$],box:U,boxRaw:G}}if(e.persons){let $=e.persons;if(!Ae.persons||$.length!==Ae.persons.length)Ae.persons=JSON.parse(JSON.stringify($));else for(let U=0;U<$.length;U++)Ae.persons[U].box=$[U].box.map((G,q)=>((r-1)*Ae.persons[U].box[q]+G)/r)}e.gesture&&(Ae.gesture=e.gesture),Ae.width=e.width,Ae.height=e.height;let s=ae();return cx=ne.perfadd?cx+Math.round(s-a):Math.round(s-a),e.performance&&(Ae.performance={...e.performance,interpolate:cx}),Ae}var Aa;async function hx(e){return!Aa||ne.initial?Aa=await Pe(e.segmentation.modelPath):e.debug&&K("cached model:",Aa.modelUrl),Aa}async function bS(e,t){var r;if(Aa||(Aa=await hx(t)),!(Aa!=null&&Aa.executor)||!((r=Aa==null?void 0:Aa.inputs)!=null&&r[0].shape))return null;let a={};a.resize=fe.resizeBilinear(e,[Aa.inputs[0].shape?Aa.inputs[0].shape[1]:0,Aa.inputs[0].shape?Aa.inputs[0].shape[2]:0],!1),a.norm=ve(a.resize,ze.tf255),a.res=Aa.execute(a.norm),a.squeeze=Oe(a.res,[0]),[a.bgRaw,a.fgRaw]=Na(a.squeeze,2),a.fg=Vh(a.fgRaw),a.mul=te(a.fg,ze.tf255),a.expand=Wt(a.mul,2),a.output=fe.resizeBilinear(a.expand,[e.shape[1]||0,e.shape[2]||0]);let n;switch(t.segmentation.mode||"default"){case"default":a.input=Oe(e),a.concat=lt([a.input,a.output],-1),n=Ue(a.concat,"int32");break;case"alpha":n=Ue(a.output,"int32");break;default:n=Ve(0)}return Object.keys(a).forEach(s=>J(a[s])),n}var Q0={};yr(Q0,{distance:()=>mx,find:()=>_3e,similarity:()=>P3e});function mx(e,t,a={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let n=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-a)/(n-a);return Math.max(Math.min(s,1),0)};function P3e(e,t,a={order:2,multiplier:25,min:.2,max:.8}){let n=mx(e,t,a);return wS(n,a.order||2,a.min||0,a.max||1)}function _3e(e,t,a={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let n=Number.MAX_SAFE_INTEGER,r=-1;for(let i=0;ihc,validateModel:()=>im});var kS=.005,sn={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function fx(e){for(let t of ux){let a=e.keypoints.findIndex(r=>r.part===t[0]),n=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[a]&&e.keypoints[n]&&e.keypoints[a].position[0]r&&r.part===t[0]),n=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[a]&&e.keypoints[n]&&e.keypoints[a].position[1]u&&u.part===t[0]),r=e.keypoints.findIndex(u=>u&&u.part===t[1]),s=e.keypoints.findIndex(u=>u&&u.part===a[0]),i=e.keypoints.findIndex(u=>u&&u.part===a[1]);if(!e.keypoints[s]||!e.keypoints[i])continue;let o=e.keypoints[n]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[n].position[0]),Math.abs(e.keypoints[i].position[0]-e.keypoints[n].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[i].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(o[0]>o[1]||l[0]>l[1]){let u=e.keypoints[n];e.keypoints[n]=e.keypoints[r],e.keypoints[r]=u}}}function IS(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],a.pad=ir(e,sn.padding),a.resize=fe.resizeBilinear(a.pad,[t,t]);let n=Ue(a.resize,"int32");return Object.keys(a).forEach(i=>J(a[i])),n}function CS(e,t){e.keypoints=e.keypoints.filter(n=>n==null?void 0:n.position);for(let n of e.keypoints)n.position=[n.position[0]*(t[0]+sn.padding[2][0]+sn.padding[2][1])/t[0]-sn.padding[2][0],n.position[1]*(t[1]+sn.padding[1][0]+sn.padding[1][1])/t[1]-sn.padding[1][0]],n.positionRaw=[n.position[0]/t[0],n.position[1]/t[1]];let a=bs(e.keypoints.map(n=>n.position),t);return e.box=a.box,e.boxRaw=a.boxRaw,e}var jt,em=0,gx=Number.MAX_SAFE_INTEGER,kl={boxes:[],bodies:[],last:0};async function TS(e){var t;return ne.initial&&(jt=null),jt?e.debug&&K("cached model:",jt.modelUrl):(A0(["size"],e),jt=await Pe(e.body.modelPath)),em=jt!=null&&jt.executor&&((t=jt==null?void 0:jt.inputs)!=null&&t[0].shape)?jt.inputs[0].shape[2]:0,em<64&&(em=256),B().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&B().set("WEBGL_USE_SHAPES_UNIFORMS",!1),jt}function F3e(e,t,a){let n=e[0][0],r=[],s=0;for(let p=0;pt.body.minConfidence){let c=[n[p][1],n[p][0]];r.push({score:Math.round(100*s)/100,part:Z0[p],positionRaw:c,position:[Math.round((a.shape[2]||0)*c[0]),Math.round((a.shape[1]||0)*c[1])]})}s=r.reduce((p,c)=>c.score>p?c.score:p,0);let i=[],o=bs(r.map(p=>p.position),[a.shape[2],a.shape[1]]),l={};for(let[p,c]of Object.entries(J0)){let d=[];for(let h=0;hg.part===c[h]),f=r.find(g=>g.part===c[h+1]);m&&f&&m.score>(t.body.minConfidence||0)&&f.score>(t.body.minConfidence||0)&&d.push([m.position,f.position])}l[p]=d}let u={id:0,score:s,box:o.box,boxRaw:o.boxRaw,keypoints:r,annotations:l};return fx(u),i.push(u),i}function D3e(e,t,a){let n=[];for(let r=0;rt.body.minConfidence){let o=[];for(let d=0;d<17;d++){let h=s[3*d+2];if(h>t.body.minConfidence){let m=[s[3*d+1],s[3*d+0]];o.push({part:Z0[d],score:Math.round(100*h)/100,positionRaw:m,position:[Math.round((a.shape[2]||0)*m[0]),Math.round((a.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],u=[Math.trunc(l[0]*(a.shape[2]||0)),Math.trunc(l[1]*(a.shape[1]||0)),Math.trunc(l[2]*(a.shape[2]||0)),Math.trunc(l[3]*(a.shape[1]||0))],p={};for(let[d,h]of Object.entries(J0)){let m=[];for(let f=0;fx.part===h[f]),y=o.find(x=>x.part===h[f+1]);g&&y&&g.score>(t.body.minConfidence||0)&&y.score>(t.body.minConfidence||0)&&m.push([g.position,y.position])}p[d]=m}let c={id:r,score:i,box:u,boxRaw:l,keypoints:[...o],annotations:p};fx(c),n.push(c)}}return n.sort((r,s)=>s.score-r.score),n.length>t.body.maxDetected&&(n.length=t.body.maxDetected),n}async function yx(e,t){var r;if(!(jt!=null&&jt.executor)||!((r=jt==null?void 0:jt.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(kl.boxes.length=0),gx++;let a=(t.body.skipTime||0)>ae()-kl.last,n=gx<(t.body.skipFrames||0);return t.skipAllowed&&a&&n?kl.bodies:new Promise(async s=>{let i={};gx=0,i.input=SS(e,em),i.res=jt==null?void 0:jt.execute(i.input),kl.last=ae();let o=await i.res.array();kl.bodies=i.res.shape[2]===17?F3e(o,t,e):D3e(o,t,e);for(let l of kl.bodies)CS(l,[e.shape[2]||1,e.shape[1]||1]),IS(l.keypoints);Object.keys(i).forEach(l=>J(i[l])),s(kl.bodies)})}var $n,tm=[],RS=0,xx=Number.MAX_SAFE_INTEGER,nm=0,am=2.5;async function ES(e){if(!$n||ne.initial){$n=await Pe(e.object.modelPath);let t=$n!=null&&$n.executor?Object.values($n.modelSignature.inputs):void 0;nm=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&K("cached model:",$n.modelUrl);return $n}async function O3e(e,t,a){var u,p;let n=0,r=[],s=nm;for(let c of[1,2,4]){let d=c*13,h=Oe(e.find(A=>A.shape[1]===d**2&&(A.shape[2]||0)===td.length)),m=await h.array(),f=Oe(e.find(A=>A.shape[1]===d**2&&(A.shape[2]||0)(a.object.minConfidence||0)&&b!==61){let I=(.5+Math.trunc(A%d))/d,T=(.5+Math.trunc(A/d))/d,N=x[A].map($=>$*(d/c/s)),[M,P]=[I-am/c*N[0],T-am/c*N[1]],[E,S]=[I+am/c*N[2]-M,T+am/c*N[3]-P],_=[M,P,E,S];_=_.map($=>Math.max(0,Math.min($,1)));let O=[_[0]*t[0],_[1]*t[1],_[2]*t[0],_[3]*t[1]],W={id:n++,score:Math.round(100*w)/100,class:b+1,label:td[b].label,box:O.map($=>Math.trunc($)),boxRaw:_};r.push(W)}}J([h,f,g,y])}let i=r.map(c=>[c.boxRaw[1],c.boxRaw[0],c.boxRaw[3],c.boxRaw[2]]),o=r.map(c=>c.score),l=[];if(i&&i.length>0){let c=await fe.nonMaxSuppressionAsync(i,o,a.object.maxDetected||0,a.object.iouThreshold,a.object.minConfidence);l=Array.from(await c.data()),J(c)}return r=r.filter((c,d)=>l.includes(d)).sort((c,d)=>d.score-c.score),r}async function Ax(e,t){if(!($n!=null&&$n.executor))return[];let a=(t.object.skipTime||0)>ae()-RS,n=xx<(t.object.skipFrames||0);return t.skipAllowed&&a&&n&&tm.length>0?(xx++,tm):(xx=0,!ne.kernels.includes("mod")||!ne.kernels.includes("sparsetodense")?tm:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],i=fe.resizeBilinear(e,[nm,nm],!1),o=ve(i,ze.tf255),l=Zs(o,[0,3,1,2]),u;t.object.enabled&&(u=$n.execute(l)),RS=ae();let p=await O3e(u,s,t);tm=p,J([i,o,l,...u]),r(p)}))}var cc=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],z3e=cc.length,pc=cc.reduce((e,t,a)=>(e[t]=a,e),{}),L3e=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],D6e=L3e.map(([e,t])=>[pc[e],pc[t]]),PS=[["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 _S(e){let t=e.reduce(({maxX:a,maxY:n,minX:r,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(a,i),maxY:Math.max(n,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 $S(e,[t,a],[n,r]){let s=t/n,i=a/r,o=(u,p)=>({id:p,score:u.score,boxRaw:[u.box[0]/r,u.box[1]/n,u.box[2]/r,u.box[3]/n],box:[Math.trunc(u.box[0]*i),Math.trunc(u.box[1]*s),Math.trunc(u.box[2]*i),Math.trunc(u.box[3]*s)],keypoints:u.keypoints.map(({score:c,part:d,position:h})=>({score:c,part:d,position:[Math.trunc(h.x*i),Math.trunc(h.y*s)],positionRaw:[h.x/n,h.y/n]})),annotations:{}});return e.map((u,p)=>o(u,p))}var rm=class{constructor(t,a){he(this,"priorityQueue");he(this,"numberOfElements");he(this,"getElementValue");this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=a}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 a=2*t;if(aa?a:e}function FS(e,t,a,n){let r=a-e,s=n-t;return r*r+s*s}function kx(e,t){return{x:e.x+t.x,y:e.y+t.y}}var on,B3e=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],sm=1,dd=16,V3e=50**2;function DS(e,t,a,n,r,s,i=2){let o=y=>({y:s.get(y.y,y.x,e),x:s.get(y.y,y.x,s.shape[2]/2+e)}),l=(y,x,A)=>({y:wx(Math.round(y.y/dd),0,x-1),x:wx(Math.round(y.x/dd),0,A-1)}),[u,p]=n.shape,c=l(t.position,u,p),d=o(c),m=kx(t.position,d);for(let y=0;y[pc[d],pc[h]]),i=s.map(([,d])=>d),o=s.map(([d])=>d),l=t.shape[2],u=i.length,p=new Array(l),c=vx(e.part,dd,a);p[e.part.id]={score:e.score,part:cc[e.part.id],position:c};for(let d=u-1;d>=0;--d){let h=i[d],m=o[d];p[h]&&!p[m]&&(p[m]=DS(d,p[h],m,t,a,r))}for(let d=0;dt){o=!1;break}if(!o)break}return o}function H3e(e,t){let[a,n,r]=t.shape,s=new rm(a*n*r,({score:i})=>i);for(let i=0;i{var i;let s=(i=r[n])==null?void 0:i.position;return s?FS(a,t,s.y,s.x)<=V3e:!1})}function j3e(e,t){return t.reduce((n,{position:r,score:s},i)=>(OS(e,r,i)||(n+=s),n),0)/t.length}function q3e(e,t,a,n,r,s){let i=[],o=H3e(s,t);for(;i.lengthh.score>s);let c=j3e(i,p),d=_S(p);c>s&&i.push({keypoints:p,box:d,score:Math.round(100*c)/100})}return i}async function Ix(e,t){if(!(on!=null&&on.executor))return[];let a=De(()=>{if(!on.inputs[0].shape)return[];let i=fe.resizeBilinear(e,[on.inputs[0].shape[2],on.inputs[0].shape[1]]),o=xe(ve(Ue(i,"float32"),127.5),1),u=on.execute(o,B3e).map(p=>Oe(p,[0]));return u[1]=za(u[1]),u}),n=await Promise.all(a.map(i=>i.buffer()));for(let i of a)J(i);let r=q3e(n[0],n[1],n[2],n[3],t.body.maxDetected,t.body.minConfidence);return on.inputs[0].shape?$S(r,[e.shape[1],e.shape[2]],[on.inputs[0].shape[2],on.inputs[0].shape[1]]):[]}async function zS(e){return!on||ne.initial?on=await Pe(e.body.modelPath):e.debug&&K("cached model:",on.modelUrl),on}var cr,X3e=["fgr","pha","r1o","r2o","r3o","r4o"],qt={},Cx=0;function BS(e){J([qt.r1i,qt.r2i,qt.r3i,qt.r4i,qt.downsample_ratio]),qt.r1i=Ve(0),qt.r2i=Ve(0),qt.r3i=Ve(0),qt.r4i=Ve(0),Cx=e.segmentation.ratio||.5,qt.downsample_ratio=Ve(Cx)}async function Tx(e){return!cr||ne.initial?cr=await Pe(e.segmentation.modelPath):e.debug&&K("cached model:",cr.modelUrl),BS(e),cr}var WS=e=>De(()=>{let t=Oe(e,[0]),a=te(t,ze.tf255);return Ue(a,"int32")});function Sx(e,t){let a=e?WS(e):sr([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),n=t?WS(t):sr([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=lt([a,n],-1);return J([a,n]),r}function K3e(e){return De(()=>{let t={};return t.unstack=Na(e,-1),t.concat=lt(t.unstack,1),t.split=Sa(t.concat,4,1),t.stack=lt(t.split,2),t.squeeze=Oe(t.stack,[0]),t.expand=Wt(t.squeeze,-1),t.add=we(t.expand,1),t.mul=te(t.add,127.5),t.cast=Ue(t.mul,"int32"),t.tile=Xr(t.cast,[1,1,3]),t.alpha=sr([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),lt([t.tile,t.alpha],-1)})}async function VS(e,t){if(cr||(cr=await Tx(t)),!(cr!=null&&cr.executor))return null;qt.src=ve(e,255),Cx!==t.segmentation.ratio&&BS(t);let[a,n,r,s,i,o]=await cr.executeAsync(qt,X3e),l;switch(t.segmentation.mode||"default"){case"default":l=Sx(a,n);break;case"alpha":l=Sx(null,n);break;case"foreground":l=Sx(a,null);break;case"state":l=K3e(r);break;default:l=Ve(0)}return J([qt.src,a,n,qt.r1i,qt.r2i,qt.r3i,qt.r4i]),[qt.r1i,qt.r2i,qt.r3i,qt.r4i]=[r,s,i,o],l}var ba;async function Nx(e){return!ba||ne.initial?ba=await Pe(e.segmentation.modelPath):e.debug&&K("cached model:",ba.modelUrl),ba}async function GS(e,t){var r;if(ba||(ba=await Nx(t)),!(ba!=null&&ba.executor)||!((r=ba==null?void 0:ba.inputs)!=null&&r[0].shape))return null;let a={};a.resize=fe.resizeBilinear(e,[ba.inputs[0].shape?ba.inputs[0].shape[1]:0,ba.inputs[0].shape?ba.inputs[0].shape[2]:0],!1),a.norm=ve(a.resize,ze.tf255),a.res=ba.execute(a.norm),a.squeeze=Oe(a.res,[0]),a.alpha=fe.resizeBilinear(a.squeeze,[e.shape[1]||0,e.shape[2]||0]),a.mul=te(a.alpha,ze.tf255);let n;switch(t.segmentation.mode||"default"){case"default":a.input=Oe(e),a.concat=lt([a.input,a.mul],-1),n=Ue(a.concat,"int32");break;case"alpha":n=Ue(a.mul,"int32");break;default:n=Ve(0)}return Object.keys(a).forEach(s=>J(a[s])),n}function im(e,t,a){var u,p;if(!t||!((u=e==null?void 0:e.config)!=null&&u.validateModels))return null;let n=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],i=[],o=t.modelUrl,l=t.executor;if((p=l==null?void 0:l.graph)!=null&&p.nodes)for(let c of Object.values(l.graph.nodes)){let d=c.op.toLowerCase();s.includes(d)||s.push(d)}else!l&&e.config.debug&&K("model not loaded",a);for(let c of s)!n.includes(c)&&!r.includes(c)&&!e.env.kernels.includes(c)&&!e.env.kernels.includes(c.replace("_",""))&&!e.env.kernels.includes(c.replace("native",""))&&!e.env.kernels.includes(c.replace("v2",""))&&i.push(c);return e.config.debug&&i.length>0&&K("model validation failed:",a,i),i.length>0?{name:a,missing:i,ops:s,url:o}:null}var hc=class{constructor(t){he(this,"instance");he(this,"models",{});this.models={},this.instance=t}stats(){let t=0,a=0,n=0;for(let s of Object.values(ya))t+=s.sizeFromManifest,a+=s.sizeLoadedWeights,n+=s.sizeDesired;let r=n>0?a/n:0;return{numLoadedModels:Object.values(ya).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:a,totalSizeLoading:n,modelStats:Object.values(ya)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var n,r,s,i,o,l,u,p,c,d,h,m,f,g,y,x,A,b,w,I,T,N,M,P,E,S,_;ne.initial&&this.reset(),t&&(this.instance=t);let a={};a.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?L9(this.instance.config):null,a.antispoof=this.instance.config.face.enabled&&((n=this.instance.config.face.antispoof)!=null&&n.enabled)&&!this.models.antispoof?dI(this.instance.config):null,a.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?mI(this.instance.config):null,a.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?sI(this.instance.config):null,a.emotion=this.instance.config.face.enabled&&((i=this.instance.config.face.emotion)!=null&&i.enabled)&&!this.models.emotion?tI(this.instance.config):null,a.iris=this.instance.config.face.enabled&&((o=this.instance.config.face.iris)!=null&&o.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?H9(this.instance.config):null,a.facemesh=this.instance.config.face.enabled&&((u=this.instance.config.face.mesh)!=null&&u.enabled)&&!this.models.facemesh?Y9(this.instance.config):null,a.gear=this.instance.config.face.enabled&&((p=this.instance.config.face.gear)!=null&&p.enabled)&&!this.models.gear?xI(this.instance.config):null,a.ssrnetage=this.instance.config.face.enabled&&((c=this.instance.config.face.ssrnet)!=null&&c.enabled)&&!this.models.ssrnetage?wI(this.instance.config):null,a.ssrnetgender=this.instance.config.face.enabled&&((d=this.instance.config.face.ssrnet)!=null&&d.enabled)&&!this.models.ssrnetgender?CI(this.instance.config):null,a.mobilefacenet=this.instance.config.face.enabled&&((h=this.instance.config.face.mobilefacenet)!=null&&h.enabled)&&!this.models.mobilefacenet?MI(this.instance.config):null,a.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?DI(this.instance.config):null,a.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((f=this.instance.config.body.modelPath)!=null&&f.includes("blazepose"))?b9(this.instance.config):null,a.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?A9(this.instance.config):null,a.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((g=this.instance.config.body.modelPath)!=null&&g.includes("efficientpose"))?C9(this.instance.config):null,a.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((y=this.instance.config.body.modelPath)!=null&&y.includes("movenet"))?TS(this.instance.config):null,a.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((x=this.instance.config.body.modelPath)!=null&&x.includes("posenet"))?zS(this.instance.config):null,a.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(A=this.instance.config.hand.detector)==null?void 0:A.modelPath)!=null&&b.includes("handtrack"))?gS(this.instance.config):null,a.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((I=(w=this.instance.config.hand.detector)==null?void 0:w.modelPath)!=null&&I.includes("handtrack"))?yS(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((N=(T=this.instance.config.hand.detector)==null?void 0:T.modelPath)!=null&&N.includes("handdetect"))&&(a.handdetect=dS(this.instance.config),a.handskeleton=pS(this.instance.config)),a.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((M=this.instance.config.object.modelPath)!=null&&M.includes("centernet"))?k9(this.instance.config):null,a.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((P=this.instance.config.object.modelPath)!=null&&P.includes("nanodet"))?ES(this.instance.config):null,a.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&((E=this.instance.config.segmentation.modelPath)!=null&&E.includes("selfie"))?Nx(this.instance.config):null,a.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((S=this.instance.config.segmentation.modelPath)!=null&&S.includes("meet"))?hx(this.instance.config):null,a.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((_=this.instance.config.segmentation.modelPath)!=null&&_.includes("rvm"))?Tx(this.instance.config):null;for(let[O,W]of Object.entries(a))W!=null&&W.then&&W.then($=>this.models[O]=$);await Promise.all(Object.values(a))}list(){let t=Object.keys(this.models).map(a=>{var n;return{name:a,loaded:this.models[a]!==null,size:0,url:this.models[a]?(n=this.models[a])==null?void 0:n.modelUrl:null}});for(let a of t){let n=Object.keys(ya).find(r=>r.startsWith(a.name));n&&(a.size=ya[n].sizeLoadedWeights,a.url=ya[n].url)}return t}loaded(){return this.list().filter(n=>n.loaded).map(n=>n.name)}validate(){let t=[];for(let a of Object.keys(this.models)){let n=this.models[a];if(!n)continue;let r=im(this.instance,n,a);r&&t.push(r)}return t}};function jS(e,t,a,n,r){var o,l,u,p,c,d;let s=0,i=[];for(let h of e){let m={id:s++,face:h,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)h.box[0]>b.box[0]&&h.box[0]b.box[1]&&h.box[1]+h.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(f.push(b[0],b[0]+b[2]),g.push(b[1],b[1]+b[3]))};y(m.face.box),y((p=m.body)==null?void 0:p.box),y((c=m.hands.left)==null?void 0:c.box),y((d=m.hands.right)==null?void 0:d.box);let x=Math.min(...f),A=Math.min(...g);m.box=[x,A,Math.max(...f)-x,Math.max(...g)-A],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),i.push(m)}return i}var om=` + gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var ky=0;function mye(e,t,a){let n=Mt(_t,a);if(!t||!e)return;let r=kn(e);if(r){r.lineJoin="round",r.font=n.font;for(let s=0;sTy,kpt:()=>Sy});var Sy=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],Ty={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var Sn,Il=224,nI,yye=5,D0=[8,16,32,32,32];function xye(){let e=[],t=0;for(;ta.x)),y:Vt(e.map(a=>a.y))}}async function rI(e){if(ne.initial&&(Sn=null),!Sn&&e.body.detector&&e.body.detector.modelPath){Sn=await $e(e.body.detector.modelPath);let t=Sn!=null&&Sn.executor?Object.values(Sn.modelSignature.inputs):void 0;Il=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&Sn&&K("cached model:",Sn.modelUrl);return xye(),Sn}var aI=[5,5];function Aye(e,t){return Pe(()=>{let a=Sa(e,12,1),n=Oe(a[0]),r=Oe(a[1]),s=Oe(a[2]),i=Oe(a[3]);n=we(ve(n,Il),t.x),r=we(ve(r,Il),t.y),s=te(ve(s,Il),aI[0]),i=te(ve(i,Il),aI[1]);let o=xe(n,ve(s,2)),l=xe(r,ve(i,2)),u=we(o,s),d=we(l,i);return ca([o,l,u,d],1)})}async function bye(e,t,a,n){var u,d;let r=[],s={};s.boxes=Aye(e,nI),s.scores=za(t),s.nms=await fe.nonMaxSuppressionAsync(s.boxes,s.scores,1,((u=a.body.detector)==null?void 0:u.minConfidence)||.1,((d=a.body.detector)==null?void 0:d.iouThreshold)||.1);let i=await s.nms.data(),o=await s.scores.data(),l=await s.boxes.array();for(let c of Array.from(i)){let p=o[c],h=l[c],m=[Math.round(h[0]*n[0]),Math.round(h[1]*n[1]),Math.round(h[2]*n[0]),Math.round(h[3]*n[1])],f={score:p,boxRaw:h,box:m};r.push(f)}return Object.keys(s).forEach(c=>J(s[c])),r}async function sI(e,t,a){let n={};n.res=Sn==null?void 0:Sn.execute(e,["Identity"]),n.logitsRaw=_e(n.res,[0,0,0],[1,-1,1]),n.boxesRaw=_e(n.res,[0,0,1],[1,-1,-1]),n.logits=Oe(n.logitsRaw),n.boxes=Oe(n.boxesRaw);let r=await bye(n.boxes,n.logits,t,a);return Object.keys(n).forEach(s=>J(n[s])),r}function js(e,t=[1,1]){let a=[e.map(o=>o[0]),e.map(o=>o[1])],n=[Math.min(...a[0]),Math.min(...a[1])],r=[Math.max(...a[0]),Math.max(...a[1])],s=[n[0],n[1],r[0]-n[0],r[1]-n[1]],i=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:i}}function iI(e,t=[1,1]){let a=[e.map(u=>u[0]),e.map(u=>u[1])],n=[Math.min(...a[0]),Math.min(...a[1])],r=[Math.max(...a[0]),Math.max(...a[1])],s=[(n[0]+r[0])/2,(n[1]+r[1])/2],i=Math.max(s[0]-n[0],s[1]-n[1],-s[0]+r[0],-s[1]+r[1]),o=[Math.trunc(s[0]-i),Math.trunc(s[1]-i),Math.trunc(2*i),Math.trunc(2*i)],l=[o[0]/t[0],o[1]/t[1],o[2]/t[0],o[3]/t[1]];return{box:o,boxRaw:l}}function P0(e,t){let a=[e[2]*t,e[3]*t];return[e[0]-(a[0]-e[2])/2,e[1]-(a[1]-e[3])/2,a[0],a[1]]}var Ga,Ny=256,Cy=Number.MAX_SAFE_INTEGER,vye={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},O0=[],qs=[[0,0],[0,0],[0,0],[0,0]],oI=0,lI=e=>1-1/(1+Math.exp(e)),dI=e=>rI(e);async function pI(e){if(ne.initial&&(Ga=null),Ga)e.debug&&K("cached model:",Ga.modelUrl);else{Ga=await $e(e.body.modelPath);let t=Ga!=null&&Ga.executor?Object.values(Ga.modelSignature.inputs):void 0;Ny=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Ga}function uI(e,t,a){var s,i;let n={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((i=e==null?void 0:e.shape)!=null&&i[2]))return e;let r;if(a&&(n.cropped=fe.cropAndResize(e,[a],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let o=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];qs=[[0,0],o,l,[0,0]],n.pad=ur(n.cropped||e,qs),n.resize=fe.resizeBilinear(n.pad,[t,t]),r=ve(n.resize,ze.tf255)}else e.shape[1]!==t?(n.resize=fe.resizeBilinear(n.cropped||e,[t,t]),r=ve(n.resize,ze.tf255)):r=ve(n.cropped||e,ze.tf255);return Object.keys(n).forEach(o=>J(n[o])),r}function wye(e,t,a){for(let n of e)n.position=[Math.trunc(n.position[0]*(t[0]+qs[2][0]+qs[2][1])/t[0]-qs[2][0]),Math.trunc(n.position[1]*(t[1]+qs[1][0]+qs[1][1])/t[1]-qs[1][0]),n.position[2]],n.positionRaw=[n.position[0]/t[0],n.position[1]/t[1],2*n.position[2]/(t[0]+t[1])];if(a){let n=a[2]-a[0],r=a[3]-a[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+a[1],s.positionRaw[1]/n+a[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function kye(e){let t=e.find(o=>o.part==="leftPalm"),a=e.find(o=>o.part==="leftWrist"),n=e.find(o=>o.part==="leftIndex");t.position[2]=((a.position[2]||0)+(n.position[2]||0))/2;let r=e.find(o=>o.part==="rightPalm"),s=e.find(o=>o.part==="rightWrist"),i=e.find(o=>o.part==="rightIndex");r.position[2]=((s.position[2]||0)+(i.position[2]||0))/2}async function Iye(e,t,a){if(!(Ga!=null&&Ga.executor))return null;let n={};[n.ld,n.segmentation,n.heatmap,n.world,n.poseflag]=Ga==null?void 0:Ga.execute(e,vye.landmarks);let r=(await n.poseflag.data())[0],s=await n.ld.data(),i=await n.world.data();Object.keys(n).forEach(m=>J(n[m]));let o=[],l=5;for(let m=0;mm.position),c=js(d,[a[0],a[1]]),p={};for(let[m,f]of Object.entries(Ty)){let g=[];for(let y=0;yb.part===f[y]),A=u.find(b=>b.part===f[y+1]);x&&A&&g.push([x.position,A.position])}p[m]=g}return{id:0,score:Math.trunc(100*r)/100,box:c.box,boxRaw:c.boxRaw,keypoints:u,annotations:p}}async function Ry(e,t){var s,i,o;let a=[e.shape[2]||0,e.shape[1]||0],n=(t.body.skipTime||0)>ae()-oI,r=Cy<(t.body.skipFrames||0);if(t.skipAllowed&&n&&r&&O0!==null)Cy++;else{let l=[];if((i=(s=t.body)==null?void 0:s.detector)!=null&&i.enabled){let u=uI(e,224);l=await sI(u,t,a),J(u)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let u=0;uJ(n[u])),r}async function Fy(e,t){if(!(Ha!=null&&Ha.executor))return[];let a=(t.object.skipTime||0)>ae()-hI,n=My<(t.object.skipFrames||0);return t.skipAllowed&&a&&n&&Ey.length>0?(My++,Ey):(My=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],i=fe.resizeBilinear(e,[Sl,Sl]),o=t.object.enabled?Ha==null?void 0:Ha.execute(i,["tower_0/detections"]):null;hI=ae(),J(i);let l=await Sye(o,s,t);Ey=l,r(l)}))}var z0={};vr(z0,{connected:()=>Dy,kpt:()=>$y});var $y=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],Dy={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var Ft,gI=0,Ma={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},Py=Number.MAX_SAFE_INTEGER;async function yI(e){return ne.initial&&(Ft=null),Ft?e.debug&&K("cached model:",Ft.modelUrl):Ft=await $e(e.body.modelPath),Ft}async function Tye(e,t){let[a,n]=e.shape,r=Q(e,[n*a]),s=fa(r,0),i=(await s.data())[0];if(i>t){let o=or(r,0),l=Ku(o,a),u=(await l.data())[0],d=ve(o,a),c=(await d.data())[0];return J([r,s,o,l,d]),[u,c,i]}return J([r,s]),[0,0,i]}async function _y(e,t){if(!(Ft!=null&&Ft.executor)||!(Ft!=null&&Ft.inputs[0].shape))return[];let a=(t.body.skipTime||0)>ae()-gI,n=Py<(t.body.skipFrames||0);return t.skipAllowed&&a&&n&&Object.keys(Ma.keypoints).length>0?(Py++,[Ma]):(Py=0,new Promise(async r=>{let s=Pe(()=>{var m,f;let c=fe.resizeBilinear(e,[((m=Ft==null?void 0:Ft.inputs[0].shape)==null?void 0:m[2])||0,((f=Ft==null?void 0:Ft.inputs[0].shape)==null?void 0:f[1])||0],!1),p=te(c,ze.tf2);return xe(p,ze.tf1)}),i;if(t.body.enabled&&(i=Ft==null?void 0:Ft.execute(s)),gI=ae(),J(s),i){Ma.keypoints.length=0;let c=Oe(i);J(i);let p=Na(c,2);J(c);for(let h=0;h(t.body.minConfidence||0)&&Ma.keypoints.push({score:Math.round(100*g)/100,part:$y[h],positionRaw:[m/Ft.inputs[0].shape[2],f/Ft.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/Ft.inputs[0].shape[2]),Math.round(e.shape[1]*f/Ft.inputs[0].shape[1])]})}p.forEach(h=>J(h))}Ma.score=Ma.keypoints.reduce((c,p)=>p.score>c?p.score:c,0);let o=Ma.keypoints.map(c=>c.position[0]),l=Ma.keypoints.map(c=>c.position[1]);Ma.box=[Math.min(...o),Math.min(...l),Math.max(...o)-Math.min(...o),Math.max(...l)-Math.min(...l)];let u=Ma.keypoints.map(c=>c.positionRaw[0]),d=Ma.keypoints.map(c=>c.positionRaw[1]);Ma.boxRaw=[Math.min(...u),Math.min(...d),Math.max(...u)-Math.min(...u),Math.max(...d)-Math.min(...d)];for(let[c,p]of Object.entries(Dy)){let h=[];for(let m=0;my.part===p[m]),g=Ma.keypoints.find(y=>y.part===p[m+1]);f&&g&&f.score>(t.body.minConfidence||0)&&g.score>(t.body.minConfidence||0)&&h.push([f.position,g.position])}Ma.annotations[c]=h}r([Ma])}))}var dd=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],L0=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],W0=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],B0=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],vI=(e,t,a)=>{let n=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(i=>[(i[0]+a[0])*t[0],(i[1]+a[1])*t[1]]);return{startPoint:n,endPoint:r,landmarks:s,confidence:e.confidence}},Oy=(e,t,a)=>{let n=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/n,e.startPoint[0]/r,e.endPoint[1]/n,e.endPoint[0]/r],i=fe.cropAndResize(t,[s],[0],a),o=ve(i,ze.tf255);return J(i),o},V0=(e,t)=>{let a=L0(e),n=dd(e),r=[t*n[0]/2,t*n[1]/2];return{startPoint:[a[0]-r[0],a[1]-r[1]],endPoint:[a[0]+r[0],a[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:n}},U0=e=>{let t=L0(e),a=dd(e),n=Math.max(...a)/2;return{startPoint:[Math.round(t[0]-n),Math.round(t[1]-n)],endPoint:[Math.round(t[0]+n),Math.round(t[1]+n)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(a[0]),Math.round(a[1])]}},wI=e=>{let t=e.map(n=>n[0]),a=e.map(n=>n[1]);return{startPoint:[Math.min(...t),Math.min(...a)],endPoint:[Math.max(...t),Math.max(...a)],landmarks:e}},zy=[[1,0,0],[0,1,0],[0,0,1]],Cye=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),Nye=(e,t)=>Cye(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var AI=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],Tl=(e,t)=>{let a=0;for(let n=0;n{let a=[];for(let n=0;n{let a=[],n=e.length;for(let r=0;r{let a=Math.cos(e),n=Math.sin(e),r=[[a,-n,0],[n,a,0],[0,0,1]],s=AI(t[0],t[1]),i=bI(s,r),o=AI(-t[0],-t[1]);return bI(i,o)},Eye=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],a=[e[0][2],e[1][2]],n=[-Tl(t[0],a),-Tl(t[1],a)];return[t[0].concat(n[0]),t[1].concat(n[1]),[0,0,1]]},Mye=(e,t)=>[Tl(e,t[0]),Tl(e,t[1])];function II(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},a=[];for(let n=0;n[s[0]/r*(h[0]-r/2),s[1]/r*(h[1]-r/2),h[2]||0]),o=a&&a!==0&&Math.abs(a)>.2,l=o?kI(a,[0,0]):zy,u=o?i.map(h=>[...Mye(h,l),h[2]]):i,d=o?Eye(n):zy,c=L0(t),p=[Tl(c,d[0]),Tl(c,d[1])];return u.map(h=>[Math.trunc(h[0]+p[0]),Math.trunc(h[1]+p[1]),Math.trunc(h[2]||0)])}function TI(e,t,a,n){let r=t.landmarks.length>=by.count?by.symmetryLine:bl.symmetryLine,s=0,i=zy,o;if(e&&ne.kernels.includes("rotatewithoffset"))if(s=Nye(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let u=L0(t),d=[u[0]/a.shape[2],u[1]/a.shape[1]],c=fe.rotateWithOffset(a,s,0,[d[0],d[1]]);i=kI(-s,u),o=Oy(t,c,[n,n]),J(c)}else o=Oy(t,a,[n,n]);else o=Oy(t,a,[n,n]);return[s,i,o]}var Fye=e=>{let t=e.map(n=>n[0]),a=e.map(n=>n[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...a)+(Math.max(...a)-Math.min(...a))/2]},CI=(e,t)=>{let a=Fye(e),n=dd(t);return{startPoint:[a[0]-n[0]/2,a[1]-n[1]/2],endPoint:[a[0]+n[0]/2,a[1]+n[1]/2]}};var NI=6,Hn,G0=null,Xs=0,pd=null,RI=()=>Xs;async function EI(e){var t;return ne.initial&&(Hn=null),Hn?e.debug&&K("cached model:",Hn.modelUrl):Hn=await $e((t=e.face.detector)==null?void 0:t.modelPath),Xs=Hn.executor&&Hn.inputs[0].shape?Hn.inputs[0].shape[2]:256,pd=Ge(Xs,"int32"),G0=er(II(Xs)),Hn}function $ye(e){if(!G0||!pd)return An([0,0]);let t={};t.boxStarts=_e(e,[0,1],[-1,2]),t.centers=we(t.boxStarts,G0),t.boxSizes=_e(e,[0,3],[-1,2]),t.boxSizesNormalized=ve(t.boxSizes,pd),t.centersNormalized=ve(t.centers,pd),t.halfBoxSize=ve(t.boxSizesNormalized,ze.tf2),t.starts=xe(t.centersNormalized,t.halfBoxSize),t.ends=we(t.centersNormalized,t.halfBoxSize),t.startNormalized=te(t.starts,pd),t.endNormalized=te(t.ends,pd);let a=Xu([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(n=>J(t[n])),a}async function MI(e,t){var o,l,u,d,c,p,h;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let a={};a.resized=fe.resizeBilinear(e,[Xs,Xs]),a.div=ve(a.resized,ze.tf127),a.normalized=xe(a.div,ze.tf05);let n=Hn==null?void 0:Hn.execute(a.normalized);if(Array.isArray(n)&&n.length>2){let m=n.sort((f,g)=>f.size-g.size);a.concat384=lt([m[0],m[2]],2),a.concat512=lt([m[1],m[3]],2),a.concat=lt([a.concat512,a.concat384],1),a.batch=Oe(a.concat,[0])}else Array.isArray(n)?a.batch=Oe(n[0]):a.batch=Oe(n);J(n),a.boxes=$ye(a.batch),a.logits=_e(a.batch,[0,0],[-1,1]),a.sigmoid=za(a.logits),a.scores=Oe(a.sigmoid),a.nms=await fe.nonMaxSuppressionAsync(a.boxes,a.scores,((o=t.face.detector)==null?void 0:o.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((u=t.face.detector)==null?void 0:u.minConfidence)||0);let r=await a.nms.array(),s=[],i=await a.scores.data();for(let m=0;m(((d=t.face.detector)==null?void 0:d.minConfidence)||0)){let g={};g.bbox=_e(a.boxes,[r[m],0],[1,-1]),g.slice=_e(a.batch,[r[m],NI-1],[1,-1]),g.squeeze=Oe(g.slice),g.landmarks=Q(g.squeeze,[NI,-1]);let y=await g.bbox.data(),x={startPoint:[y[0],y[1]],endPoint:[y[2],y[3]],landmarks:await g.landmarks.array(),confidence:f};g.anchor=_e(G0,[r[m],0],[1,2]);let A=await g.anchor.data(),b=vI(x,[(e.shape[2]||0)/Xs,(e.shape[1]||0)/Xs],A),w=V0(b,((c=t.face.detector)==null?void 0:c.scale)||1.4),S=U0(w);S.size[0]>(((p=t.face.detector)==null?void 0:p.minSize)||0)&&S.size[1]>(((h=t.face.detector)==null?void 0:h.minSize)||0)&&s.push(S),Object.keys(g).forEach(C=>J(g[C]))}}return Object.keys(a).forEach(m=>J(a[m])),s}var sn,Ks=0,Wy=Pn.leftEyeLower0,By=Pn.rightEyeLower0,cd={leftBounds:[Wy[0],Wy[Wy.length-1]],rightBounds:[By[0],By[By.length-1]]},hd={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function _I(e){var t,a;return ne.initial&&(sn=null),sn?e.debug&&K("cached model:",sn.modelUrl):sn=await $e((t=e.face.iris)==null?void 0:t.modelPath),Ks=sn!=null&&sn.executor&&((a=sn.inputs)!=null&&a[0].shape)?sn.inputs[0].shape[2]:0,Ks===-1&&(Ks=64),sn}function H0(e,t,a,n){for(let r=0;r{let t=e[cd.leftBounds[0]][2],a=e[cd.rightBounds[0]][2];return t-a},$I=(e,t,a,n,r,s=!1,i=2.3)=>{let o=U0(V0(wI([e[a],e[n]]),i)),l=dd(o),u=fe.cropAndResize(t,[[o.startPoint[1]/r,o.startPoint[0]/r,o.endPoint[1]/r,o.endPoint[0]/r]],[0],[Ks,Ks]);if(s&&ne.kernels.includes("flipleftright")){let d=fe.flipLeftRight(u);J(u),u=d}return{box:o,boxSize:l,crop:u}},DI=(e,t,a,n=!1)=>{let r=[];for(let s=0;s{let n=e[Pn[`${a}EyeUpper0`][hd.upperCenter]][2],r=e[Pn[`${a}EyeLower0`][hd.lowerCenter]][2],s=(n+r)/2;return t.map((i,o)=>{let l=s;return o===2?l=n:o===4&&(l=r),[i[0],i[1],l]})};async function OI(e,t,a,n){var C,N;if(!(sn!=null&&sn.executor))return e;let{box:r,boxSize:s,crop:i}=$I(e,t,cd.leftBounds[0],cd.leftBounds[1],a,!0,((C=n.face.iris)==null?void 0:C.scale)||2.3),{box:o,boxSize:l,crop:u}=$I(e,t,cd.rightBounds[0],cd.rightBounds[1],a,!0,((N=n.face.iris)==null?void 0:N.scale)||2.3),d=lt([i,u]);J(i),J(u);let c=sn.execute(d);J(d);let p=await c.data();J(c);let h=p.slice(0,hd.numCoordinates*3),{rawCoords:m,iris:f}=DI(h,r,s,!0),g=p.slice(hd.numCoordinates*3),{rawCoords:y,iris:x}=DI(g,o,l,!1),A=Dye(e);Math.abs(A)<30?(H0(e,m,"left",null),H0(e,y,"right",null)):A<1?H0(e,m,"left",["EyeUpper0","EyeLower0"]):H0(e,y,"right",["EyeUpper0","EyeLower0"]);let b=PI(e,f,"left"),w=PI(e,x,"right");return e.concat(b).concat(w)}async function LI(e,t){var s,i,o,l,u,d,c,p,h,m;let a={lips:await((i=(s=t.filter(f=>f.size===160))==null?void 0:s[0])==null?void 0:i.data()),irisL:await((l=(o=t.filter(f=>f.size===10))==null?void 0:o[0])==null?void 0:l.data()),eyeL:await((d=(u=t.filter(f=>f.size===142))==null?void 0:u[0])==null?void 0:d.data()),irisR:await((p=(c=t.filter(f=>f.size===10))==null?void 0:c[1])==null?void 0:p.data()),eyeR:await((m=(h=t.filter(f=>f.size===142))==null?void 0:h[1])==null?void 0:m.data())};for(let f of Object.values(a))if(!f)return e;let n=wl.reduce((f,g)=>f+=e[g][2],0)/wl.length;for(let f=0;ff+=e[g][2],0)/kl.length;for(let f=0;fae()-mr.timestamp,n=mr.skipped<(((u=t.face.detector)==null?void 0:u.skipFrames)||0);!t.skipAllowed||!a||!n||mr.boxes.length===0?(mr.boxes=await MI(e,t),mr.timestamp=ae(),mr.skipped=0):mr.skipped++;let r=[],s=[],i=0,o=gc;for(let x=0;x[C[0]/(e.shape[2]||0),C[1]/(e.shape[1]||0),(C[2]||0)/o]);for(let C of Object.keys(bl))S.annotations[C]=[S.mesh[bl[C]]]}else if(!Ct)t.debug&&K("face mesh detection requested, but model is not loaded");else{if((h=t.face.attention)!=null&&h.enabled&&!ne.kernels.includes("atan2"))return t.face.attention.enabled=!1,J(S.tensor),r;let C=Ct.execute(S.tensor),M=await C.find(F=>F.shape[F.shape.length-1]===1).data();if(S.faceScore=Math.round(100*M[0])/100,S.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(A.confidence=S.faceScore,t.face.mesh.keepInvalid){S.box=W0(A,e),S.boxRaw=B0(A,e),S.size=A.size,S.score=S.boxScore,S.mesh=A.landmarks,S.meshRaw=S.mesh.map(F=>[F[0]/(e.shape[2]||1),F[1]/(e.shape[1]||1),(F[2]||0)/o]);for(let F of Object.keys(bl))S.annotations[F]=[S.mesh[bl[F]]]}}else{let F=C.find(O=>O.shape[O.shape.length-1]===1404),E=Q(F,[-1,3]),T=await E.array();J(E),(f=t.face.attention)!=null&&f.enabled?T=await LI(T,C):(g=t.face.iris)!=null&&g.enabled&&(T=await OI(T,S.tensor,gc,t)),S.mesh=SI(T,A,b,w,gc),S.meshRaw=S.mesh.map(O=>[O[0]/(e.shape[2]||0),O[1]/(e.shape[1]||0),(O[2]||0)/o]);for(let O of Object.keys(Pn))S.annotations[O]=Pn[O].map(W=>S.mesh[W]);S.score=S.faceScore;let D={...CI(S.mesh,A),confidence:A.confidence,landmarks:A.landmarks,size:A.size};S.box=W0(D,e),S.boxRaw=B0(D,e),S.size=D.size,s.push(D)}J(C)}S.score>(((y=t.face.detector)==null?void 0:y.minConfidence)||1)?r.push(S):J(S.tensor)}return mr.boxes=s,r}async function BI(e){var t,a,n,r,s,i;return ne.initial&&(Ct=null),(t=e.face.attention)!=null&&t.enabled&&(Ct!=null&&Ct.signature)&&Object.keys(((a=Ct==null?void 0:Ct.signature)==null?void 0:a.outputs)||{}).length<6&&(Ct=null),Ct?e.debug&&K("cached model:",Ct.modelUrl):(n=e.face.attention)!=null&&n.enabled?Ct=await $e(e.face.attention.modelPath):Ct=await $e((r=e.face.mesh)==null?void 0:r.modelPath),gc=Ct.executor&&((s=Ct==null?void 0:Ct.inputs)!=null&&s[0].shape)?(i=Ct==null?void 0:Ct.inputs)==null?void 0:i[0].shape[2]:256,Ct}var VI=vl,UI=mc;var Gy=[],sa,j0=[],GI=0,HI=0,Uy=Number.MAX_SAFE_INTEGER,Hy=!1;async function jI(e){var t,a,n;return ne.initial&&(sa=null),sa?e.debug&&K("cached model:",sa.modelUrl):(sa=await $e((t=e.face.emotion)==null?void 0:t.modelPath),Hy=((n=(a=sa==null?void 0:sa.inputs)==null?void 0:a[0].shape)==null?void 0:n[3])===3,Hy?Gy=["angry","disgust","fear","happy","neutral","sad","surprise"]:Gy=["angry","disgust","fear","happy","sad","surprise","neutral"]),sa}async function jy(e,t,a,n){var i,o;if(!sa)return[];let r=Uy<(((i=t.face.emotion)==null?void 0:i.skipFrames)||0),s=(((o=t.face.emotion)==null?void 0:o.skipTime)||0)>ae()-HI;return t.skipAllowed&&s&&r&&GI===n&&j0[a]&&j0[a].length>0?(Uy++,j0[a]):(Uy=0,new Promise(async l=>{var d,c,p;let u=[];if((d=t.face.emotion)!=null&&d.enabled){let h={},m=sa!=null&&sa.inputs[0].shape?sa.inputs[0].shape[2]:0;if(((c=t.face.emotion)==null?void 0:c.crop)>0){let g=(p=t.face.emotion)==null?void 0:p.crop,y=[[g,g,1-g,1-g]];h.resize=fe.cropAndResize(e,y,[0],[m,m])}else h.resize=fe.resizeBilinear(e,[m,m],!1);Hy?(h.mul=te(h.resize,255),h.normalize=xe(h.mul,[103.939,116.779,123.68]),h.emotion=sa==null?void 0:sa.execute(h.normalize)):(h.channels=te(h.resize,ze.rgb),h.grayscale=ot(h.channels,3,!0),h.grayscaleSub=xe(h.grayscale,ze.tf05),h.grayscaleMul=te(h.grayscaleSub,ze.tf2),h.emotion=sa==null?void 0:sa.execute(h.grayscaleMul)),HI=ae();let f=await h.emotion.data();for(let g=0;g(t.face.emotion.minConfidence||0)&&u.push({score:Math.min(.99,Math.trunc(100*f[g])/100),emotion:Gy[g]});u.sort((g,y)=>y.score-g.score),Object.keys(h).forEach(g=>J(h[g]))}j0[a]=u,GI=n,l(u)}))}var ia,Ys=[],XI=0,KI=0,qy=Number.MAX_SAFE_INTEGER;async function YI(e){var t;return ne.initial&&(ia=null),ia?e.debug&&K("cached model:",ia.modelUrl):ia=await $e((t=e.face.description)==null?void 0:t.modelPath),ia}function _ye(e,t){var s,i;let a=e.image||e.tensor||e;if(!(ia!=null&&ia.inputs[0].shape))return a;let n;if(((s=t.face.description)==null?void 0:s.crop)>0){let o=(i=t.face.description)==null?void 0:i.crop,l=[[o,o,1-o,1-o]];n=fe.cropAndResize(a,l,[0],[ia.inputs[0].shape[2],ia.inputs[0].shape[1]])}else n=fe.resizeBilinear(a,[ia.inputs[0].shape[2],ia.inputs[0].shape[1]],!1);let r=te(n,ze.tf255);return J(n),r}async function Xy(e,t,a,n){var o,l,u,d;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(ia!=null&&ia.executor))return r;let s=qy<(((o=t.face.description)==null?void 0:o.skipFrames)||0),i=(((l=t.face.description)==null?void 0:l.skipTime)||0)>ae()-XI;return t.skipAllowed&&s&&i&&KI===n&&((u=Ys==null?void 0:Ys[a])==null?void 0:u.age)>0&&((d=Ys==null?void 0:Ys[a])==null?void 0:d.genderScore)>0?(qy++,Ys[a]):(qy=0,new Promise(async c=>{var p;if((p=t.face.description)!=null&&p.enabled){let h=_ye(e,t),m=ia==null?void 0:ia.execute(h);XI=ae(),J(h);let g=await m.find(N=>N.shape[1]===1).data(),y=Math.trunc(200*Math.abs(g[0]-.5))/100;y>(t.face.description.minConfidence||0)&&(r.gender=g[0]<=.5?"female":"male",r.genderScore=Math.min(.99,y));let x=or(m.find(N=>N.shape[1]===100),1),A=(await x.data())[0];J(x);let w=await m.find(N=>N.shape[1]===100).data();r.age=Math.round(w[A-1]>w[A+1]?10*A-100*w[A-1]:10*A+100*w[A+1])/10,(Number.isNaN(g[0])||Number.isNaN(w[0]))&&K("faceres error:",{model:ia,result:m});let S=m.find(N=>N.shape[1]===1024),C=S?await S.data():[];r.descriptor=Array.from(C),m.forEach(N=>J(N))}Ys[a]=r,KI=n,c(r)}))}var md=.1,Ky=.5;function Oye(e,t,a){let n=!1,r=a.length-1;for(let s=0;st!=a[r].y>t&&e<(a[r].x-a[s].x)*(t-a[s].y)/(a[r].y-a[s].y)+a[s].x&&(n=!n);return n}async function JI(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,a=e.tensor.shape[1]||0,n=await e.tensor.buffer(),r=[];for(let i of Pn.silhouette)r.push({x:(e.mesh[i][0]-e.box[0])/e.box[2],y:(e.mesh[i][1]-e.box[1])/e.box[3]});md&&md>0&&(r=r.map(i=>({x:i.x>.5?i.x+md:i.x-md,y:i.y>.5?i.y+md:i.y-md})));for(let i=0;iae()-eS,s=Yy<(((o=t.face.antispoof)==null?void 0:o.skipFrames)||0);return t.skipAllowed&&r&&s&&QI===n&&q0[a]?(Yy++,q0[a]):(Yy=0,new Promise(async l=>{let u=fe.resizeBilinear(e,[oa!=null&&oa.inputs[0].shape?oa.inputs[0].shape[2]:0,oa!=null&&oa.inputs[0].shape?oa.inputs[0].shape[1]:0],!1),d=oa==null?void 0:oa.execute(u),c=(await d.data())[0];q0[a]=Math.round(100*c)/100,QI=n,eS=ae(),J([u,d]),l(q0[a])}))}var la,X0=[],Jy=Number.MAX_SAFE_INTEGER,nS=0,rS=0;async function sS(e){var t;return ne.initial&&(la=null),la?e.debug&&K("cached model:",la.modelUrl):la=await $e((t=e.face.liveness)==null?void 0:t.modelPath),la}async function Qy(e,t,a,n){var i,o;if(!(la!=null&&la.executor))return 0;let r=(((i=t.face.liveness)==null?void 0:i.skipTime)||0)>ae()-rS,s=Jy<(((o=t.face.liveness)==null?void 0:o.skipFrames)||0);return t.skipAllowed&&r&&s&&nS===n&&X0[a]?(Jy++,X0[a]):(Jy=0,new Promise(async l=>{let u=fe.resizeBilinear(e,[la!=null&&la.inputs[0].shape?la.inputs[0].shape[2]:0,la!=null&&la.inputs[0].shape?la.inputs[0].shape[1]:0],!1),d=la==null?void 0:la.execute(u),c=(await d.data())[0];X0[a]=Math.round(100*c)/100,nS=n,rS=ae(),J([u,d]),l(X0[a])}))}var _n,ex=[],Lye=["white","black","asian","indian","other"],Wye=[15,23,28,35.5,45.5,55.5,65],oS=0,lS=0,tx=Number.MAX_SAFE_INTEGER;async function uS(e){var t;return ne.initial&&(_n=null),_n?e.debug&&K("cached model:",_n.modelUrl):_n=await $e((t=e.face.gear)==null?void 0:t.modelPath),_n}async function ax(e,t,a,n){var i,o;if(!_n)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=tx<(((i=t.face.gear)==null?void 0:i.skipFrames)||0),s=(((o=t.face.gear)==null?void 0:o.skipTime)||0)>ae()-lS;return t.skipAllowed&&s&&r&&oS===n&&ex[a]?(tx++,ex[a]):(tx=0,new Promise(async l=>{var y,x,A,b;if(!(_n!=null&&_n.inputs[0].shape))return;let u={},d=[[0,.1,.9,.9]];if(((y=t.face.gear)==null?void 0:y.crop)>0){let w=(x=t.face.gear)==null?void 0:x.crop;d=[[w,w,1-w,1-w]]}u.resize=fe.cropAndResize(e,d,[0],[_n.inputs[0].shape[2],_n.inputs[0].shape[1]]);let c={age:0,gender:"unknown",genderScore:0,race:[]};(A=t.face.gear)!=null&&A.enabled&&([u.age,u.gender,u.race]=_n.execute(u.resize,["age_output","gender_output","race_output"]));let p=await u.gender.data();c.gender=p[0]>p[1]?"male":"female",c.genderScore=Math.round(100*(p[0]>p[1]?p[0]:p[1]))/100;let h=await u.race.data();for(let w=0;w(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&c.race.push({score:Math.round(100*h[w])/100,race:Lye[w]});c.race.sort((w,S)=>S.score-w.score);let f=Array.from(await u.age.data()).map((w,S)=>[Wye[S],w]).sort((w,S)=>S[1]-w[1]),g=f[0][0];for(let w=1;wJ(u[w])),ex[a]=c,oS=n,lS=ae(),l(c)}))}var Fa,K0=[],pS=0,cS=0,nx=Number.MAX_SAFE_INTEGER;async function hS(e){return ne.initial&&(Fa=null),Fa?e.debug&&K("cached model:",Fa.modelUrl):Fa=await $e(e.face.ssrnet.modelPathAge),Fa}async function rx(e,t,a,n){var i,o,l,u;if(!Fa)return{age:0};let r=nx<(((i=t.face.ssrnet)==null?void 0:i.skipFrames)||0),s=(((o=t.face.ssrnet)==null?void 0:o.skipTime)||0)>ae()-cS;return t.skipAllowed&&r&&s&&pS===n&&((l=K0[a])!=null&&l.age)&&((u=K0[a])==null?void 0:u.age)>0?(nx++,K0[a]):(nx=0,new Promise(async d=>{var h,m,f;if(!(Fa!=null&&Fa.inputs)||!Fa.inputs[0]||!Fa.inputs[0].shape)return;let c={};if(((h=t.face.ssrnet)==null?void 0:h.crop)>0){let g=(m=t.face.ssrnet)==null?void 0:m.crop,y=[[g,g,1-g,1-g]];c.resize=fe.cropAndResize(e,y,[0],[Fa.inputs[0].shape[2],Fa.inputs[0].shape[1]])}else c.resize=fe.resizeBilinear(e,[Fa.inputs[0].shape[2],Fa.inputs[0].shape[1]],!1);c.enhance=te(c.resize,ze.tf255);let p={age:0};if((f=t.face.ssrnet)!=null&&f.enabled&&(c.age=Fa.execute(c.enhance)),c.age){let g=await c.age.data();p.age=Math.trunc(10*g[0])/10}Object.keys(c).forEach(g=>J(c[g])),K0[a]=p,pS=n,cS=ae(),d(p)}))}var xa,Y0=[],fS=0,gS=0,sx=Number.MAX_SAFE_INTEGER,ix=[.2989,.587,.114];async function yS(e){var t;return ne.initial&&(xa=null),xa?e.debug&&K("cached model:",xa.modelUrl):xa=await $e((t=e.face.ssrnet)==null?void 0:t.modelPathGender),xa}async function ox(e,t,a,n){var i,o,l,u;if(!xa)return{gender:"unknown",genderScore:0};let r=sx<(((i=t.face.ssrnet)==null?void 0:i.skipFrames)||0),s=(((o=t.face.ssrnet)==null?void 0:o.skipTime)||0)>ae()-gS;return t.skipAllowed&&r&&s&&fS===n&&((l=Y0[a])!=null&&l.gender)&&((u=Y0[a])==null?void 0:u.genderScore)>0?(sx++,Y0[a]):(sx=0,new Promise(async d=>{var m,f,g;if(!(xa!=null&&xa.inputs[0].shape))return;let c={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let y=(f=t.face.ssrnet)==null?void 0:f.crop,x=[[y,y,1-y,1-y]];c.resize=fe.cropAndResize(e,x,[0],[xa.inputs[0].shape[2],xa.inputs[0].shape[1]])}else c.resize=fe.resizeBilinear(e,[xa.inputs[0].shape[2],xa.inputs[0].shape[1]],!1);c.enhance=Pe(()=>{var x,A;let y;if(((A=(x=xa==null?void 0:xa.inputs)==null?void 0:x[0].shape)==null?void 0:A[3])===1){let[b,w,S]=Sa(c.resize,3,3),C=te(b,ix[0]),N=te(w,ix[1]),M=te(S,ix[2]),F=Uh([C,N,M]);y=te(xe(F,ze.tf05),2)}else y=te(xe(c.resize,ze.tf05),2);return y});let p={gender:"unknown",genderScore:0};(g=t.face.ssrnet)!=null&&g.enabled&&(c.gender=xa.execute(c.enhance));let h=await c.gender.data();p.gender=h[0]>h[1]?"female":"male",p.genderScore=h[0]>h[1]?Math.trunc(100*h[0])/100:Math.trunc(100*h[1])/100,Object.keys(c).forEach(y=>J(c[y])),Y0[a]=p,fS=n,gS=ae(),d(p)}))}var on,lx=[],AS=0,bS=0,vS=Number.MAX_SAFE_INTEGER;async function wS(e){var t;return ne.initial&&(on=null),on?e.debug&&K("cached model:",on.modelUrl):on=await $e((t=e.face.mobilefacenet)==null?void 0:t.modelPath),on}async function ux(e,t,a,n){var i,o;if(!(on!=null&&on.executor))return[];let r=vS<(((i=t.face.mobilefacenet)==null?void 0:i.skipFrames)||0),s=(((o=t.face.mobilefacenet)==null?void 0:o.skipTime)||0)>ae()-bS;return t.skipAllowed&&s&&r&&AS===n&&lx[a]?(vS++,lx[a]):new Promise(async l=>{var d;let u=[];if((d=t.face.mobilefacenet)!=null&&d.enabled&&(on!=null&&on.inputs[0].shape)){let c={};c.crop=fe.resizeBilinear(e,[on.inputs[0].shape[2],on.inputs[0].shape[1]],!1),c.data=on.execute(c.crop);let p=await c.data.data();u=Array.from(p),Object.keys(c).forEach(h=>J(c[h]))}lx[a]=u,AS=n,bS=ae(),l(u)})}var ln,dx=[],IS=0,SS=0,TS=Number.MAX_SAFE_INTEGER;async function CS(e){return ne.initial&&(ln=null),ln?e.debug&&K("cached model:",ln.modelUrl):ln=await $e(e.face.insightface.modelPath),ln}async function px(e,t,a,n){var i,o;if(!(ln!=null&&ln.executor))return[];let r=TS<(((i=t.face.insightface)==null?void 0:i.skipFrames)||0),s=(((o=t.face.insightface)==null?void 0:o.skipTime)||0)>ae()-SS;return t.skipAllowed&&s&&r&&IS===n&&dx[a]?(TS++,dx[a]):new Promise(async l=>{var d;let u=[];if((d=t.face.insightface)!=null&&d.enabled&&(ln!=null&&ln.inputs[0].shape)){let c={};c.crop=fe.resizeBilinear(e,[ln.inputs[0].shape[2],ln.inputs[0].shape[1]],!1),c.data=ln.execute(c.crop);let p=await c.data.data();u=Array.from(p),Object.keys(c).forEach(h=>J(c[h]))}dx[a]=u,IS=n,SS=ae(),l(u)})}var Bye=e=>{let t=(c,p)=>Math.atan2(c[1]-p[1],c[0]-p[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let a=[0,-.1],n=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],i=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],o=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(i[0]-s[0])/o[0]-a[0],n*(s[1]-i[1])/o[1]-a[1]],u=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return u=Math.min(u,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:u}},RS=(e,t)=>{let a=f=>{let g=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=g,f[1]/=g,f[2]/=g,f},n=(f,g)=>{let y=f[0]-g[0],x=f[1]-g[1],A=f[2]-g[2];return[y,x,A]},r=(f,g)=>{let y=f[1]*g[2]-f[2]*g[1],x=f[2]*g[0]-f[0]*g[2],A=f[0]*g[1]-f[1]*g[0];return[y,x,A]},s=f=>{let[g,y,x,A,b,w,S,C,N]=f,M,F,E;return A<1?A>-1?(E=Math.asin(A),F=Math.atan2(-S,g),M=Math.atan2(-w,b)):(E=-Math.PI/2,F=-Math.atan2(C,N),M=0):(E=Math.PI/2,F=Math.atan2(C,N),M=0),Number.isNaN(M)&&(M=0),Number.isNaN(F)&&(F=0),Number.isNaN(E)&&(E=0),{pitch:2*-M,yaw:2*-F,roll:2*-E}},i=e.meshRaw;if(!i||i.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let o=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[i[10],i[152],i[234],i[454]].map(f=>[f[0]*t[0]/o,f[1]*t[1]/o,f[2]]),u=a(n(l[1],l[0])),d=a(n(l[3],l[2])),c=a(r(d,u));d=r(u,c);let p=[d[0],d[1],d[2],u[0],u[1],u[2],c[0],c[1],c[2]],h=s(p),m=i.length===478?Bye(e):{bearing:0,strength:0};return{angle:h,matrix:p,gaze:m}};function ES(e,t){let a=e==null?void 0:e.annotations;if(!(a!=null&&a.leftEyeIris)||!(a!=null&&a.rightEyeIris))return 0;let n=Math.max(Math.abs(a.leftEyeIris[3][0]-a.leftEyeIris[1][0]),Math.abs(a.rightEyeIris[3][0]-a.rightEyeIris[1][0]))/t;return Math.round(1.17/n)/100}var cx=async(e,t)=>{var m,f,g,y,x,A,b,w,S,C,N,M,F,E,T,D,O,W,$,U,G,q,H;let a=ae(),n,r,s,i,o,l,u,d,c,p=[];e.state="run:face";let h=await WI(t,e.config);if(e.performance.face=ne.perfadd?(e.performance.face||0)+Math.trunc(ae()-a):Math.trunc(ae()-a),!t.shape||t.shape.length!==4)return[];if(!h)return[];for(let V=0;V200?RS(h[V],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?i=(f=e.config.face.emotion)!=null&&f.enabled?jy(h[V].tensor||Ve([]),e.config,V,h.length):[]:(e.state="run:emotion",a=ae(),i=(g=e.config.face.emotion)!=null&&g.enabled?await jy(h[V].tensor||Ve([]),e.config,V,h.length):[],e.performance.emotion=ne.perfadd?(e.performance.emotion||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?u=(y=e.config.face.antispoof)!=null&&y.enabled?Zy(h[V].tensor||Ve([]),e.config,V,h.length):0:(e.state="run:antispoof",a=ae(),u=(x=e.config.face.antispoof)!=null&&x.enabled?await Zy(h[V].tensor||Ve([]),e.config,V,h.length):0,e.performance.antispoof=ne.perfadd?(e.performance.antispoof||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?d=(A=e.config.face.liveness)!=null&&A.enabled?Qy(h[V].tensor||Ve([]),e.config,V,h.length):0:(e.state="run:liveness",a=ae(),d=(b=e.config.face.liveness)!=null&&b.enabled?await Qy(h[V].tensor||Ve([]),e.config,V,h.length):0,e.performance.liveness=ne.perfadd?(e.performance.antispoof||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(w=e.config.face.gear)!=null&&w.enabled?ax(h[V].tensor||Ve([]),e.config,V,h.length):null:(e.state="run:gear",a=ae(),r=(S=e.config.face.gear)!=null&&S.enabled?await ax(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.gear=Math.trunc(ae()-a)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(n=(C=e.config.face.ssrnet)!=null&&C.enabled?rx(h[V].tensor||Ve([]),e.config,V,h.length):null,s=(N=e.config.face.ssrnet)!=null&&N.enabled?ox(h[V].tensor||Ve([]),e.config,V,h.length):null):(e.state="run:ssrnet",a=ae(),n=(M=e.config.face.ssrnet)!=null&&M.enabled?await rx(h[V].tensor||Ve([]),e.config,V,h.length):null,s=(F=e.config.face.ssrnet)!=null&&F.enabled?await ox(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.ssrnet=Math.trunc(ae()-a)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?o=(E=e.config.face.mobilefacenet)!=null&&E.enabled?ux(h[V].tensor||Ve([]),e.config,V,h.length):null:(e.state="run:mobilefacenet",a=ae(),o=(T=e.config.face.mobilefacenet)!=null&&T.enabled?await ux(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.mobilefacenet=Math.trunc(ae()-a)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(D=e.config.face.insightface)!=null&&D.enabled?px(h[V].tensor||Ve([]),e.config,V,h.length):null:(e.state="run:mobilefacenet",a=ae(),l=(O=e.config.face.insightface)!=null&&O.enabled?await px(h[V].tensor||Ve([]),e.config,V,h.length):null,e.performance.mobilefacenet=Math.trunc(ae()-a)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?c=Xy(h[V].tensor||Ve([]),e.config,V,h.length):(e.state="run:description",a=ae(),c=await Xy(h[V].tensor||Ve([]),e.config,V,h.length),e.performance.description=ne.perfadd?(e.performance.description||0)+Math.trunc(ae()-a):Math.trunc(ae()-a)),e.analyze("End Description:"),e.config.async&&([n,s,i,o,l,c,r,u,d]=await Promise.all([n,s,i,o,l,c,r,u,d])),e.analyze("Finish Face:"),(W=e.config.face.ssrnet)!=null&&W.enabled&&n&&s&&(c={...c,age:n.age,gender:s.gender,genderScore:s.genderScore}),($=e.config.face.gear)!=null&&$.enabled&&r&&(c={...c,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(U=e.config.face.mobilefacenet)!=null&&U.enabled&&o&&(c.descriptor=o),(G=e.config.face.insightface)!=null&&G.enabled&&l&&(c.descriptor=l);let X=(q=e.config.face.iris)!=null&&q.enabled?ES(h[V],t.shape[2]):0,re=(H=e.config.face.detector)!=null&&H.return?Oe(h[V].tensor):null;J(h[V].tensor),h[V].tensor&&delete h[V].tensor;let ee={...h[V],id:V};c.age&&(ee.age=c.age),c.gender&&(ee.gender=c.gender),c.genderScore&&(ee.genderScore=c.genderScore),c.descriptor&&(ee.embedding=c.descriptor),c.race&&(ee.race=c.race),i&&(ee.emotion=i),u&&(ee.real=u),d&&(ee.live=d),X>0&&(ee.distance=X),Z&&(ee.rotation=Z),re&&(ee.tensor=re),p.push(ee),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),p};var $a={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>$a.nameMapping[e],getPoints:e=>$a.pointsMapping[e]},Js={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>Js.nameMapping[e]},$t={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>$t.nameMapping[e]},Zs=class{constructor(t){he(this,"name");he(this,"curls");he(this,"directions");he(this,"weights");he(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,a,n){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([a,n])}direction(t,a,n){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([a,n])}weight(t,a){this.weights[t]=a;let n=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/n)}matchAgainst(t,a){let n=0;for(let r in t){let s=t[r],i=this.curls[r];if(typeof i=="undefined"){n+=this.weightsRelative[r];continue}for(let[o,l]of i)if(s===o){n+=l*this.weightsRelative[r];break}}for(let r in a){let s=a[r],i=this.directions[r];if(typeof i=="undefined"){n+=this.weightsRelative[r];continue}for(let[o,l]of i)if(s===o){n+=l*this.weightsRelative[r];break}}return n/10}};var{thumb:jn,index:zr,middle:Lr,ring:Cl,pinky:Nl}=$a,{none:qn,half:Uye,full:Xn}=Js,{verticalUp:fd,verticalDown:jve,horizontalLeft:hx,horizontalRight:Gye,diagonalUpRight:Hye,diagonalUpLeft:gd,diagonalDownRight:qve,diagonalDownLeft:Xve}=$t,Qs=new Zs("thumbs up");Qs.curl(jn,qn,1);Qs.direction(jn,fd,1);Qs.direction(jn,gd,.25);Qs.direction(jn,Hye,.25);for(let e of[$a.index,$a.middle,$a.ring,$a.pinky])Qs.curl(e,Xn,1),Qs.direction(e,hx,1),Qs.direction(e,Gye,1);var Ht=new Zs("victory");Ht.curl(jn,Uye,.5);Ht.curl(jn,qn,.5);Ht.direction(jn,fd,1);Ht.direction(jn,gd,1);Ht.curl(zr,qn,1);Ht.direction(zr,fd,.75);Ht.direction(zr,gd,1);Ht.curl(Lr,qn,1);Ht.direction(Lr,fd,1);Ht.direction(Lr,gd,.75);Ht.curl(Cl,Xn,1);Ht.direction(Cl,fd,.2);Ht.direction(Cl,gd,1);Ht.direction(Cl,hx,.2);Ht.curl(Nl,Xn,1);Ht.direction(Nl,fd,.2);Ht.direction(Nl,gd,1);Ht.direction(Nl,hx,.2);Ht.weight(zr,2);Ht.weight(Lr,2);var ei=new Zs("point");ei.curl(jn,Xn,1);ei.curl(zr,qn,.5);ei.curl(Lr,Xn,.5);ei.curl(Cl,Xn,.5);ei.curl(Nl,Xn,.5);ei.weight(zr,2);ei.weight(Lr,2);var ti=new Zs("middle finger");ti.curl(jn,qn,1);ti.curl(zr,Xn,.5);ti.curl(Lr,Xn,.5);ti.curl(Cl,Xn,.5);ti.curl(Nl,Xn,.5);ti.weight(zr,2);ti.weight(Lr,2);var yd=new Zs("open palm");yd.curl(jn,qn,.75);yd.curl(zr,qn,.75);yd.curl(Lr,qn,.75);yd.curl(Cl,qn,.75);yd.curl(Nl,qn,.75);var MS=[Qs,Ht,ei,ti,yd];var jye=.7,Rl={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function FS(e,t,a,n){let r=(t-n)/(e-a),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function DS(e,t){if(!e||!t)return[0,0];let a=FS(e[0],e[1],t[0],t[1]);if(e.length===2)return a;let n=FS(e[1],e[2],t[1],t[2]);return[a,n]}function $S(e,t=1){let a=0,n=0,r=0;return e>=75&&e<=105?a=1*t:e>=25&&e<=155?n=1*t:r=1*t,[a,n,r]}function qye(e,t,a){let n=e[0]-t[0],r=e[0]-a[0],s=t[0]-a[0],i=e[1]-t[1],o=e[1]-a[1],l=t[1]-a[1],u=e[2]-t[2],d=e[2]-a[2],c=t[2]-a[2],p=Math.sqrt(n*n+i*i+u*u),h=Math.sqrt(r*r+o*o+d*d),m=Math.sqrt(s*s+l*l+c*c),f=(m*m+p*p-h*h)/(2*m*p);f>1?f=1:f<-1&&(f=-1);let g=Math.acos(f);g=57.2958*g%180;let y;return g>Rl.NO_CURL_START_LIMIT?y=Js.none:g>Rl.HALF_CURL_START_LIMIT?y=Js.half:y=Js.full,y}function PS(e,t,a,n){let r;return n===Math.abs(e)?e>0?r=$t.horizontalLeft:r=$t.horizontalRight:n===Math.abs(t)?t>0?r=$t.horizontalLeft:r=$t.horizontalRight:a>0?r=$t.horizontalLeft:r=$t.horizontalRight,r}function _S(e,t,a,n){let r;return n===Math.abs(e)?e<0?r=$t.verticalDown:r=$t.verticalUp:n===Math.abs(t)?t<0?r=$t.verticalDown:r=$t.verticalUp:a<0?r=$t.verticalDown:r=$t.verticalUp,r}function Xye(e,t,a,n,r,s,i,o){let l,u=_S(e,t,a,n),d=PS(r,s,i,o);return u===$t.verticalUp?d===$t.horizontalLeft?l=$t.diagonalUpLeft:l=$t.diagonalUpRight:d===$t.horizontalLeft?l=$t.diagonalDownLeft:l=$t.diagonalDownRight,l}function Kye(e,t,a,n){let r=e[0]-t[0],s=e[0]-a[0],i=t[0]-a[0],o=e[1]-t[1],l=e[1]-a[1],u=t[1]-a[1],d=Math.max(Math.abs(r),Math.abs(s),Math.abs(i)),c=Math.max(Math.abs(o),Math.abs(l),Math.abs(u)),p=0,h=0,m=0,f=c/(d+1e-5);f>1.5?p+=Rl.DISTANCE_VOTE_POWER:f>.66?h+=Rl.DISTANCE_VOTE_POWER:m+=Rl.DISTANCE_VOTE_POWER;let g=Math.sqrt(r*r+o*o),y=Math.sqrt(s*s+l*l),x=Math.sqrt(i*i+u*u),A=Math.max(g,y,x),b=e[0],w=e[1],S=a[0],C=a[1];A===g?(S=a[0],C=a[1]):A===x&&(b=t[0],w=t[1]);let F=DS([b,w],[S,C]),E=$S(F,Rl.TOTAL_ANGLE_VOTE_POWER);p+=E[0],h+=E[1],m+=E[2];for(let D of n){let O=$S(D,Rl.SINGLE_ANGLE_VOTE_POWER);p+=O[0],h+=O[1],m+=O[2]}let T;return p===Math.max(p,h,m)?T=_S(l,o,u,c):m===Math.max(h,m)?T=PS(s,r,i,d):T=Xye(l,o,u,c,s,r,i,d),T}function OS(e){let t=[],a=[],n=[],r=[];if(!e)return{curls:n,directions:r};for(let s of $a.all){let i=$a.getPoints(s),o=[],l=[];for(let u of i){let d=e[u[0]],c=e[u[1]],p=DS(d,c),h=p[0],m=p[1];o.push(h),l.push(m)}t.push(o),a.push(l)}for(let s of $a.all){let i=s===$a.thumb?1:0,o=$a.getPoints(s),l=e[o[i][0]],u=e[o[i+1][1]],d=e[o[3][1]],c=qye(l,u,d),p=Kye(l,u,d,t[s].slice(i));n[s]=c,r[s]=p}return{curls:n,directions:r}}function Z0(e){if(!e||e.length===0)return null;let t=OS(e),a={};for(let n of $a.all)a[$a.getName(n)]={curl:Js.getName(t.curls[n]),direction:$t.getName(t.directions[n])};return a}function zS(e){let t=[];if(!e||e.length===0)return t;let a=OS(e);for(let n of MS){let r=n.matchAgainst(a.curls,a.directions);r>=jye&&t.push({name:n.name,confidence:r})}return t}var LS=e=>{if(!e)return[];let t=[];for(let a=0;al.part==="leftWrist"),r=e[a].keypoints.find(l=>l.part==="rightWrist"),s=e[a].keypoints.find(l=>l.part==="nose");s&&n&&r&&n.position[1]l.part==="leftShoulder"),o=e[a].keypoints.find(l=>l.part==="rightShoulder");i&&o&&Math.abs(i.positionRaw[1]-o.positionRaw[1])>.1&&t.push({body:a,gesture:`leaning ${i.position[1]>o.position[1]?"left":"right"}`})}return t},WS=e=>{if(!e)return[];let t=[];for(let a=0;a450){let n=(e[a].mesh[33][2]||0)-(e[a].mesh[263][2]||0),r=e[a].mesh[33][0]-e[a].mesh[263][0];Math.abs(n/r)<=.15?t.push({face:a,gesture:"facing center"}):t.push({face:a,gesture:`facing ${n<0?"left":"right"}`}),Math.abs(e[a].mesh[374][1]-e[a].mesh[386][1])/Math.abs(e[a].mesh[443][1]-e[a].mesh[450][1])<.2&&t.push({face:a,gesture:"blink left eye"}),Math.abs(e[a].mesh[145][1]-e[a].mesh[159][1])/Math.abs(e[a].mesh[223][1]-e[a].mesh[230][1])<.2&&t.push({face:a,gesture:"blink right eye"});let o=Math.min(100,500*Math.abs(e[a].mesh[13][1]-e[a].mesh[14][1])/Math.abs(e[a].mesh[10][1]-e[a].mesh[152][1]));o>10&&t.push({face:a,gesture:`mouth ${Math.trunc(o)}% open`});let l=e[a].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:a,gesture:`head ${l<0?"up":"down"}`})}return t},BS=e=>{var a,n,r,s;if(!e)return[];let t=[];for(let i=0;i.06||g>.06)&&(h=!1),f>g?g>.04&&t.push({iris:i,gesture:"looking right"}):f>.04&&t.push({iris:i,gesture:"looking left"});let y=Math.abs(e[i].mesh[145][1]-e[i].annotations.rightEyeIris[0][1])/e[i].box[3],x=Math.abs(e[i].mesh[374][1]-e[i].annotations.leftEyeIris[0][1])/e[i].box[3];(x<.01||y<.01||x>.022||y>.022)&&(h=!1),(x<.01||y<.01)&&t.push({iris:i,gesture:"looking down"}),(x>.022||y>.022)&&t.push({iris:i,gesture:"looking up"}),h&&t.push({iris:i,gesture:"looking center"})}return t},VS=e=>{if(!e)return[];let t=[];for(let a=0;a0){let r=n.reduce((i,o)=>(i.position[2]||0)<(o.position[2]||0)?i:o);t.push({hand:a,gesture:`${r.name} forward`});let s=n.reduce((i,o)=>i.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:a,endPoint:n,palmLandmarks:r,confidence:e.confidence}}function Q0(e,t=1.5){let a=yc(e),n=J0(e),r=[t*n[0]/2,t*n[1]/2],s=[a[0]-r[0],a[1]-r[1]],i=[a[0]+r[0],a[1]+r[1]];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function em(e){let t=yc(e),a=J0(e),r=Math.max(...a)/2,s=[t[0]-r,t[1]-r],i=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:i,palmLandmarks:e.palmLandmarks}}function Zye(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function qS(e,t){let a=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return Zye(a)}var US=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function ai(e,t){let a=0;for(let n=0;n[i.x,i.y]),this.anchorsTensor=er(this.anchors),this.inputSize=((s=(r=(n=(a=this==null?void 0:this.model)==null?void 0:a.inputs)==null?void 0:n[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=Vt([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=Vt([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let a={};a.boxOffsets=_e(t,[0,0],[-1,2]),a.boxSizes=_e(t,[0,2],[-1,2]),a.div=ve(a.boxOffsets,this.inputSizeTensor),a.boxCenterPoints=we(a.div,this.anchorsTensor),a.halfBoxSizes=ve(a.boxSizes,this.doubleInputSizeTensor),a.sub=xe(a.boxCenterPoints,a.halfBoxSizes),a.startPoints=te(a.sub,this.inputSizeTensor),a.add=we(a.boxCenterPoints,a.halfBoxSizes),a.endPoints=te(a.add,this.inputSizeTensor);let n=Xu([a.startPoints,a.endPoints],1);return Object.keys(a).forEach(r=>J(a[r])),n}normalizeLandmarks(t,a){let n={};n.reshape=Q(t,[-1,7,2]),n.div=ve(n.reshape,this.inputSizeTensor),n.landmarks=we(n.div,this.anchors[a]?this.anchors[a]:0);let r=te(n.landmarks,this.inputSizeTensor);return Object.keys(n).forEach(s=>J(n[s])),r}async predict(t,a){var o;let n={};n.resize=fe.resizeBilinear(t,[this.inputSize,this.inputSize]),n.div=ve(n.resize,ze.tf127),n.image=xe(n.div,ze.tf1),n.batched=this.model.execute(n.image),n.predictions=Oe(n.batched),n.slice=_e(n.predictions,[0,0],[-1,1]),n.sigmoid=za(n.slice),n.scores=Oe(n.sigmoid);let r=await n.scores.data();n.boxes=_e(n.predictions,[0,1],[-1,4]),n.norm=this.normalizeBoxes(n.boxes),n.nms=await fe.nonMaxSuppressionAsync(n.norm,n.scores,3*(((o=a.hand)==null?void 0:o.maxDetected)||1),a.hand.iouThreshold,a.hand.minConfidence);let s=await n.nms.array(),i=[];for(let l of s){let u={};u.box=_e(n.norm,[l,0],[1,-1]),u.slice=_e(n.predictions,[l,5],[1,14]),u.norm=this.normalizeLandmarks(u.slice,l),u.palmLandmarks=Q(u.norm,[-1,2]);let d=await u.box.data(),c=d.slice(0,2),p=d.slice(2,4),h=await u.palmLandmarks.array(),m={startPoint:c,endPoint:p,palmLandmarks:h,confidence:r[l]},f=jS(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);i.push(f),Object.keys(u).forEach(g=>J(u[g]))}return Object.keys(n).forEach(l=>J(n[l])),i}};var txe=5,ZS=1.65,JS=[0,5,9,13,17,1,2],axe=0,nxe=2,QS=0,am=class{constructor(t,a){he(this,"handDetector");he(this,"handPoseModel");he(this,"inputSize");he(this,"storedBoxes");he(this,"skipped");he(this,"detectedHands");var n,r,s;this.handDetector=t,this.handPoseModel=a,this.inputSize=((s=(r=(n=this.handPoseModel)==null?void 0:n.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let a=t.map(i=>i[0]),n=t.map(i=>i[1]),r=[Math.min(...a),Math.min(...n)],s=[Math.max(...a),Math.max(...n)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,a){let n=t.map(s=>gx([...s,1],a)),r=this.calculateLandmarksBoundingBox(n);return Q0(em(r),txe)}getBoxForHandLandmarks(t){let a=this.calculateLandmarksBoundingBox(t),n=Q0(em(a),ZS);n.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=fx(n,[0,0]),u=o.map(h=>[...gx(h,l),h[2]]),d=XS(r),c=[...yc(a),1],p=[ai(c,d[0]),ai(c,d[1])];return u.map(h=>[Math.trunc(h[0]+p[0]),Math.trunc(h[1]+p[1]),Math.trunc(h[2])])}async estimateHands(t,a){let n=!1,r,s=(a.hand.skipTime||0)>ae()-QS,i=this.skipped<(a.hand.skipFrames||0);a.skipAllowed&&s&&i?this.skipped++:(r=await this.handDetector.predict(t,a),this.skipped=0),r&&r.length>0&&(r.length!==this.detectedHands&&this.detectedHands!==a.hand.maxDetected||!a.hand.landmarks)&&(this.detectedHands=0,this.storedBoxes=[...r],this.storedBoxes.length>0&&(n=!0));let o=[];for(let l=0;l=a.hand.minConfidence/4){let w=Q(A,[-1,3]),S=await w.array();J(A),J(w);let C=this.transformRawCoords(S,f,d,m),N=this.getBoxForHandLandmarks(C);this.storedBoxes[l]={...N,confidence:b};let M={landmarks:C,confidence:b,boxConfidence:u.confidence,fingerConfidence:b,box:{topLeft:N.startPoint,bottomRight:N.endPoint}};o.push(M)}else this.storedBoxes[l]=null;J(A)}else{let d=Q0(em(u),ZS),c={confidence:u.confidence,boxConfidence:u.confidence,fingerConfidence:0,box:{topLeft:d.startPoint,bottomRight:d.endPoint},landmarks:[]};o.push(c)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=o.length,o.length>a.hand.maxDetected&&(o.length=a.hand.maxDetected),o}};var eT={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},El,Ml,yx;function sxe(){let e=El?new tm(El):void 0;e&&Ml&&(yx=new am(e,Ml))}async function xx(e,t){yx||sxe();let a=await yx.estimateHands(e,t);if(!a)return[];let n=[];for(let r=0;ra[r].landmarks[c]);let i=a[r].landmarks,o=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(i&&i.length>0){for(let d of i)d[0]o[2]&&(o[2]=d[0]),d[1]>o[3]&&(o[3]=d[1]);o[2]-=o[0],o[3]-=o[1],l=[o[0]/(e.shape[2]||0),o[1]/(e.shape[1]||0),o[2]/(e.shape[2]||0),o[3]/(e.shape[1]||0)]}else o=a[r].box?[Math.trunc(Math.max(0,a[r].box.topLeft[0])),Math.trunc(Math.max(0,a[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,a[r].box.bottomRight[0])-Math.max(0,a[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,a[r].box.bottomRight[1])-Math.max(0,a[r].box.topLeft[1]))]:[0,0,0,0],l=[a[r].box.topLeft[0]/(e.shape[2]||0),a[r].box.topLeft[1]/(e.shape[1]||0),(a[r].box.bottomRight[0]-a[r].box.topLeft[0])/(e.shape[2]||0),(a[r].box.bottomRight[1]-a[r].box.topLeft[1])/(e.shape[1]||0)];let u=Z0(i);n.push({id:r,score:Math.round(100*a[r].confidence)/100,boxScore:Math.round(100*a[r].boxConfidence)/100,fingerScore:Math.round(100*a[r].fingerConfidence)/100,label:"hand",box:o,boxRaw:l,keypoints:i,annotations:s,landmarks:u})}return n}async function tT(e){var t;return ne.initial&&(El=null),El?e.debug&&K("cached model:",El.modelUrl):El=await $e((t=e.hand.detector)==null?void 0:t.modelPath),El}async function aT(e){var t;return ne.initial&&(Ml=null),Ml?e.debug&&K("cached model:",Ml.modelUrl):Ml=await $e((t=e.hand.skeleton)==null?void 0:t.modelPath),Ml}var zt=[null,null],ixe=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],ni=[[0,0],[0,0]],oxe=["hand","fist","pinch","point","face","tip","pinchtip"],rT=4,sT=1.6,lxe=512,uxe=1.4,nm=Number.MAX_SAFE_INTEGER,Ax=0,Wr=[0,0],Ot={boxes:[],hands:[]},iT={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function oT(e){var t;if(ne.initial&&(zt[0]=null),zt[0])e.debug&&K("cached model:",zt[0].modelUrl);else{T0(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),zt[0]=await $e((t=e.hand.detector)==null?void 0:t.modelPath);let a=zt[0].executor?Object.values(zt[0].modelSignature.inputs):void 0;ni[0][0]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[1].size):0,ni[0][1]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[2].size):0}return zt[0]}async function lT(e){var t;if(ne.initial&&(zt[1]=null),zt[1])e.debug&&K("cached model:",zt[1].modelUrl);else{zt[1]=await $e((t=e.hand.skeleton)==null?void 0:t.modelPath);let a=zt[1].executor?Object.values(zt[1].modelSignature.inputs):void 0;ni[1][0]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[1].size):0,ni[1][1]=Array.isArray(a)?parseInt(a[0].tensorShape.dim[2].size):0}return zt[1]}async function dxe(e,t){let a=[];if(!e||!zt[0])return a;let n={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,lxe),i=Math.round(s*r/8)*8;n.resize=fe.resizeBilinear(e,[s,i]),n.cast=Ue(n.resize,"int32"),[n.rawScores,n.rawBoxes]=await zt[0].executeAsync(n.cast,ixe),n.boxes=Oe(n.rawBoxes,[0,2]),n.scores=Oe(n.rawScores,[0]);let o=Na(n.scores,1);J(o[rT]),o.splice(rT,1),n.filtered=ca(o,1),J(o),n.max=fa(n.filtered,1),n.argmax=or(n.filtered,1);let l=0;n.nms=await fe.nonMaxSuppressionAsync(n.boxes,n.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let u=await n.nms.data(),d=await n.max.data(),c=await n.argmax.data();for(let p of Array.from(u)){let h=_e(n.boxes,p,1),m=await h.data();J(h);let f=[m[1],m[0],m[3]-m[1],m[2]-m[0]],g=P0(f,uxe),y=[Math.trunc(f[0]*Wr[0]),Math.trunc(f[1]*Wr[1]),Math.trunc(f[2]*Wr[0]),Math.trunc(f[3]*Wr[1])],x=d[p],A=oxe[c[p]],b={id:l++,score:x,box:y,boxRaw:g,label:A};a.push(b)}return Object.keys(n).forEach(p=>J(n[p])),a.sort((p,h)=>h.score-p.score),a.length>(t.hand.maxDetected||1)&&(a.length=t.hand.maxDetected||1),a}async function bx(e,t,a){let n={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&zt[1]&&a.hand.landmarks&&t.score>(a.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=fe.cropAndResize(e,[s],[0],[ni[1][0],ni[1][1]],"bilinear"),r.div=ve(r.crop,ze.tf255),[r.score,r.keypoints]=zt[1].execute(r.div,["Identity_1","Identity"]);let i=(await r.score.data())[0],o=(100-Math.trunc(100/(1+Math.exp(i))))/100;if(o>=(a.hand.minConfidence||0)){n.fingerScore=o,r.reshaped=Q(r.keypoints,[-1,3]);let d=(await r.reshaped.array()).map(c=>[c[0]/ni[1][1],c[1]/ni[1][0],c[2]||0]).map(c=>[c[0]*t.boxRaw[2],c[1]*t.boxRaw[3],c[2]||0]);n.keypoints=d.map(c=>[Wr[0]*(c[0]+t.boxRaw[0]),Wr[1]*(c[1]+t.boxRaw[1]),c[2]||0]),n.landmarks=Z0(n.keypoints);for(let c of Object.keys(iT))n.annotations[c]=iT[c].map(p=>n.landmarks&&n.keypoints[p]?n.keypoints[p]:null)}Object.keys(r).forEach(l=>J(r[l]))}return n}async function vx(e,t){var r,s;if(!((r=zt[0])!=null&&r.executor)||!((s=zt[1])!=null&&s.executor)||!zt[0].inputs[0].shape||!zt[1].inputs[0].shape)return[];Wr=[e.shape[2]||0,e.shape[1]||0],nm++;let a=(t.hand.skipTime||0)>ae()-Ax,n=nm<(t.hand.skipFrames||0);return t.skipAllowed&&a&&n?Ot.hands:new Promise(async i=>{let o=3*(t.hand.skipTime||0)>ae()-Ax,l=nm<3*(t.hand.skipFrames||0);t.skipAllowed&&Ot.hands.length===t.hand.maxDetected?Ot.hands=await Promise.all(Ot.boxes.map(d=>bx(e,d,t))):t.skipAllowed&&o&&l&&Ot.hands.length>0?Ot.hands=await Promise.all(Ot.boxes.map(d=>bx(e,d,t))):(Ot.boxes=await dxe(e,t),Ax=ae(),Ot.hands=await Promise.all(Ot.boxes.map(d=>bx(e,d,t))),nm=0);let u=[...Ot.boxes];if(Ot.boxes.length=0,t.cacheSensitivity>0)for(let d=0;d.05&&c.box[3]/(e.shape[1]||1)>.05&&Ot.hands[d].fingerScore&&Ot.hands[d].fingerScore>(t.hand.minConfidence||0)){let p=P0(c.box,sT),h=P0(c.boxRaw,sT);Ot.boxes.push({...u[d],box:p,boxRaw:h})}}for(let d=0;d({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var xc={};vr(xc,{connected:()=>sm,horizontal:()=>wx,kpt:()=>rm,relative:()=>Ix,vertical:()=>kx});var rm=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],wx=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],kx=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],Ix=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],sm={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var Ae=fr(),Sx=0;function dT(e,t){var i,o,l,u,d,c,p,h,m,f,g,y,x,A,b,w,S,C,N,M,F,E,T,D,O,W;let a=ae();if(!e)return fr();let n=Date.now()-e.timestamp,r=n<1e3?8-Math.log(n+1):1;if(e.canvas&&(Ae.canvas=e.canvas),e.error&&(Ae.error=e.error),!Ae.body||e.body.length!==Ae.body.length)Ae.body=JSON.parse(JSON.stringify(e.body));else for(let $=0;$((r-1)*Ae.body[$].box[X]+Z)/r),G=e.body[$].boxRaw.map((Z,X)=>((r-1)*Ae.body[$].boxRaw[X]+Z)/r),q=e.body[$].keypoints.map((Z,X)=>{var re,ee,ge,ie,be,Ce,Ee,Le,qe;return{score:Z.score,part:Z.part,position:[Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].position[0]||0)+(Z.position[0]||0))/r:Z.position[0],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].position[1]||0)+(Z.position[1]||0))/r:Z.position[1],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].position[2]||0)+(Z.position[2]||0))/r:Z.position[2]],positionRaw:[Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].positionRaw[0]||0)+(Z.positionRaw[0]||0))/r:Z.positionRaw[0],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].positionRaw[1]||0)+(Z.positionRaw[1]||0))/r:Z.positionRaw[1],Ae.body[$].keypoints[X]?((r-1)*(Ae.body[$].keypoints[X].positionRaw[2]||0)+(Z.positionRaw[2]||0))/r:Z.positionRaw[2]],distance:[Ae.body[$].keypoints[X]?((r-1)*(((re=Ae.body[$].keypoints[X].distance)==null?void 0:re[0])||0)+(((ee=Z.distance)==null?void 0:ee[0])||0))/r:(ge=Z.distance)==null?void 0:ge[0],Ae.body[$].keypoints[X]?((r-1)*(((ie=Ae.body[$].keypoints[X].distance)==null?void 0:ie[1])||0)+(((be=Z.distance)==null?void 0:be[1])||0))/r:(Ce=Z.distance)==null?void 0:Ce[1],Ae.body[$].keypoints[X]?((r-1)*(((Ee=Ae.body[$].keypoints[X].distance)==null?void 0:Ee[2])||0)+(((Le=Z.distance)==null?void 0:Le[2])||0))/r:(qe=Z.distance)==null?void 0:qe[2]]}}),H={},V={connected:{}};(i=t.body.modelPath)!=null&&i.includes("efficientpose")?V=z0:(o=t.body.modelPath)!=null&&o.includes("blazepose")?V=$0:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(V=xc);for(let[Z,X]of Object.entries(V.connected)){let re=[];for(let ee=0;eebe.part===X[ee]),ie=q.find(be=>be.part===X[ee+1]);ge&&ie&&re.push([ge.position,ie.position])}H[Z]=re}Ae.body[$]={...e.body[$],box:U,boxRaw:G,keypoints:q,annotations:H}}if(!Ae.hand||e.hand.length!==Ae.hand.length)Ae.hand=JSON.parse(JSON.stringify(e.hand));else for(let $=0;$((r-1)*Ae.hand[$].box[Z]+V)/r),G=e.hand[$].boxRaw.map((V,Z)=>((r-1)*Ae.hand[$].boxRaw[Z]+V)/r);Ae.hand[$].keypoints.length!==e.hand[$].keypoints.length&&(Ae.hand[$].keypoints=e.hand[$].keypoints);let q=e.hand[$].keypoints&&e.hand[$].keypoints.length>0?e.hand[$].keypoints.map((V,Z)=>V.map((X,re)=>((r-1)*(Ae.hand[$].keypoints[Z][re]||1)+(X||0))/r)):[],H={};if(Object.keys(Ae.hand[$].annotations).length!==Object.keys(e.hand[$].annotations).length)Ae.hand[$].annotations=e.hand[$].annotations,H=Ae.hand[$].annotations;else if(e.hand[$].annotations)for(let V of Object.keys(e.hand[$].annotations))H[V]=(c=(d=(u=e.hand[$])==null?void 0:u.annotations)==null?void 0:d[V])!=null&&c[0]?e.hand[$].annotations[V].map((Z,X)=>Z.map((re,ee)=>((r-1)*Ae.hand[$].annotations[V][X][ee]+re)/r)):null;Ae.hand[$]={...e.hand[$],box:U,boxRaw:G,keypoints:q,annotations:H}}if(!Ae.face||e.face.length!==Ae.face.length)Ae.face=JSON.parse(JSON.stringify(e.face));else for(let $=0;$((r-1)*Ae.face[$].box[V]+H)/r),G=e.face[$].boxRaw.map((H,V)=>((r-1)*Ae.face[$].boxRaw[V]+H)/r),q=e.face[$].annotations;if(Object.keys(Ae.face[$].annotations).length!==Object.keys(e.face[$].annotations).length)Ae.face[$].annotations=e.face[$].annotations,q=Ae.face[$].annotations;else if(e.face[$].annotations)for(let H of Object.keys(e.face[$].annotations))q[H]=(m=(h=(p=e.face[$])==null?void 0:p.annotations)==null?void 0:h[H])!=null&&m[0]?e.face[$].annotations[H].map((V,Z)=>V.map((X,re)=>((r-1)*Ae.face[$].annotations[H][Z][re]+X)/r)):null;if(e.face[$].rotation){let H={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};H.matrix=(f=e.face[$].rotation)==null?void 0:f.matrix,H.angle={roll:((r-1)*(((y=(g=Ae.face[$].rotation)==null?void 0:g.angle)==null?void 0:y.roll)||0)+(((A=(x=e.face[$].rotation)==null?void 0:x.angle)==null?void 0:A.roll)||0))/r,yaw:((r-1)*(((w=(b=Ae.face[$].rotation)==null?void 0:b.angle)==null?void 0:w.yaw)||0)+(((C=(S=e.face[$].rotation)==null?void 0:S.angle)==null?void 0:C.yaw)||0))/r,pitch:((r-1)*(((M=(N=Ae.face[$].rotation)==null?void 0:N.angle)==null?void 0:M.pitch)||0)+(((E=(F=e.face[$].rotation)==null?void 0:F.angle)==null?void 0:E.pitch)||0))/r},H.gaze={bearing:((r-1)*(((T=Ae.face[$].rotation)==null?void 0:T.gaze.bearing)||0)+(((D=e.face[$].rotation)==null?void 0:D.gaze.bearing)||0))/r,strength:((r-1)*(((O=Ae.face[$].rotation)==null?void 0:O.gaze.strength)||0)+(((W=e.face[$].rotation)==null?void 0:W.gaze.strength)||0))/r},Ae.face[$]={...e.face[$],rotation:H,box:U,boxRaw:G,annotations:q}}else Ae.face[$]={...e.face[$],box:U,boxRaw:G,annotations:q}}if(!Ae.object||e.object.length!==Ae.object.length)Ae.object=JSON.parse(JSON.stringify(e.object));else for(let $=0;$((r-1)*Ae.object[$].box[H]+q)/r),G=e.object[$].boxRaw.map((q,H)=>((r-1)*Ae.object[$].boxRaw[H]+q)/r);Ae.object[$]={...e.object[$],box:U,boxRaw:G}}if(e.persons){let $=e.persons;if(!Ae.persons||$.length!==Ae.persons.length)Ae.persons=JSON.parse(JSON.stringify($));else for(let U=0;U<$.length;U++)Ae.persons[U].box=$[U].box.map((G,q)=>((r-1)*Ae.persons[U].box[q]+G)/r)}e.gesture&&(Ae.gesture=e.gesture),Ae.width=e.width,Ae.height=e.height;let s=ae();return Sx=ne.perfadd?Sx+Math.round(s-a):Math.round(s-a),e.performance&&(Ae.performance={...e.performance,interpolate:Sx}),Ae}var Aa;async function Tx(e){return!Aa||ne.initial?Aa=await $e(e.segmentation.modelPath):e.debug&&K("cached model:",Aa.modelUrl),Aa}async function pT(e,t){var r;if(Aa||(Aa=await Tx(t)),!(Aa!=null&&Aa.executor)||!((r=Aa==null?void 0:Aa.inputs)!=null&&r[0].shape))return null;let a={};a.resize=fe.resizeBilinear(e,[Aa.inputs[0].shape?Aa.inputs[0].shape[1]:0,Aa.inputs[0].shape?Aa.inputs[0].shape[2]:0],!1),a.norm=ve(a.resize,ze.tf255),a.res=Aa.execute(a.norm),a.squeeze=Oe(a.res,[0]),[a.bgRaw,a.fgRaw]=Na(a.squeeze,2),a.fg=Yh(a.fgRaw),a.mul=te(a.fg,ze.tf255),a.expand=Bt(a.mul,2),a.output=fe.resizeBilinear(a.expand,[e.shape[1]||0,e.shape[2]||0]);let n;switch(t.segmentation.mode||"default"){case"default":a.input=Oe(e),a.concat=lt([a.input,a.output],-1),n=Ue(a.concat,"int32");break;case"alpha":n=Ue(a.output,"int32");break;default:n=Ve(0)}return Object.keys(a).forEach(s=>J(a[s])),n}var im={};vr(im,{distance:()=>Cx,find:()=>hxe,similarity:()=>cxe});function Cx(e,t,a={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let n=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-a)/(n-a);return Math.max(Math.min(s,1),0)};function cxe(e,t,a={order:2,multiplier:25,min:.2,max:.8}){let n=Cx(e,t,a);return hT(n,a.order||2,a.min||0,a.max||1)}function hxe(e,t,a={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let n=Number.MAX_SAFE_INTEGER,r=-1;for(let i=0;ivc,validateModel:()=>hm});var mT=.005,un={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function Nx(e){for(let t of wx){let a=e.keypoints.findIndex(r=>r.part===t[0]),n=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[a]&&e.keypoints[n]&&e.keypoints[a].position[0]r&&r.part===t[0]),n=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[a]&&e.keypoints[n]&&e.keypoints[a].position[1]u&&u.part===t[0]),r=e.keypoints.findIndex(u=>u&&u.part===t[1]),s=e.keypoints.findIndex(u=>u&&u.part===a[0]),i=e.keypoints.findIndex(u=>u&&u.part===a[1]);if(!e.keypoints[s]||!e.keypoints[i])continue;let o=e.keypoints[n]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[n].position[0]),Math.abs(e.keypoints[i].position[0]-e.keypoints[n].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[i].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(o[0]>o[1]||l[0]>l[1]){let u=e.keypoints[n];e.keypoints[n]=e.keypoints[r],e.keypoints[r]=u}}}function fT(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],a.pad=ur(e,un.padding),a.resize=fe.resizeBilinear(a.pad,[t,t]);let n=Ue(a.resize,"int32");return Object.keys(a).forEach(i=>J(a[i])),n}function yT(e,t){e.keypoints=e.keypoints.filter(n=>n==null?void 0:n.position);for(let n of e.keypoints)n.position=[n.position[0]*(t[0]+un.padding[2][0]+un.padding[2][1])/t[0]-un.padding[2][0],n.position[1]*(t[1]+un.padding[1][0]+un.padding[1][1])/t[1]-un.padding[1][0]],n.positionRaw=[n.position[0]/t[0],n.position[1]/t[1]];let a=js(e.keypoints.map(n=>n.position),t);return e.box=a.box,e.boxRaw=a.boxRaw,e}var jt,om=0,Rx=Number.MAX_SAFE_INTEGER,Fl={boxes:[],bodies:[],last:0};async function xT(e){var t;return ne.initial&&(jt=null),jt?e.debug&&K("cached model:",jt.modelUrl):(T0(["size"],e),jt=await $e(e.body.modelPath)),om=jt!=null&&jt.executor&&((t=jt==null?void 0:jt.inputs)!=null&&t[0].shape)?jt.inputs[0].shape[2]:0,om<64&&(om=256),B().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&B().set("WEBGL_USE_SHAPES_UNIFORMS",!1),jt}function fxe(e,t,a){let n=e[0][0],r=[],s=0;for(let d=0;dt.body.minConfidence){let c=[n[d][1],n[d][0]];r.push({score:Math.round(100*s)/100,part:rm[d],positionRaw:c,position:[Math.round((a.shape[2]||0)*c[0]),Math.round((a.shape[1]||0)*c[1])]})}s=r.reduce((d,c)=>c.score>d?c.score:d,0);let i=[],o=js(r.map(d=>d.position),[a.shape[2],a.shape[1]]),l={};for(let[d,c]of Object.entries(sm)){let p=[];for(let h=0;hg.part===c[h]),f=r.find(g=>g.part===c[h+1]);m&&f&&m.score>(t.body.minConfidence||0)&&f.score>(t.body.minConfidence||0)&&p.push([m.position,f.position])}l[d]=p}let u={id:0,score:s,box:o.box,boxRaw:o.boxRaw,keypoints:r,annotations:l};return Nx(u),i.push(u),i}function gxe(e,t,a){let n=[];for(let r=0;rt.body.minConfidence){let o=[];for(let p=0;p<17;p++){let h=s[3*p+2];if(h>t.body.minConfidence){let m=[s[3*p+1],s[3*p+0]];o.push({part:rm[p],score:Math.round(100*h)/100,positionRaw:m,position:[Math.round((a.shape[2]||0)*m[0]),Math.round((a.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],u=[Math.trunc(l[0]*(a.shape[2]||0)),Math.trunc(l[1]*(a.shape[1]||0)),Math.trunc(l[2]*(a.shape[2]||0)),Math.trunc(l[3]*(a.shape[1]||0))],d={};for(let[p,h]of Object.entries(sm)){let m=[];for(let f=0;fx.part===h[f]),y=o.find(x=>x.part===h[f+1]);g&&y&&g.score>(t.body.minConfidence||0)&&y.score>(t.body.minConfidence||0)&&m.push([g.position,y.position])}d[p]=m}let c={id:r,score:i,box:u,boxRaw:l,keypoints:[...o],annotations:d};Nx(c),n.push(c)}}return n.sort((r,s)=>s.score-r.score),n.length>t.body.maxDetected&&(n.length=t.body.maxDetected),n}async function Ex(e,t){var r;if(!(jt!=null&&jt.executor)||!((r=jt==null?void 0:jt.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(Fl.boxes.length=0),Rx++;let a=(t.body.skipTime||0)>ae()-Fl.last,n=Rx<(t.body.skipFrames||0);return t.skipAllowed&&a&&n?Fl.bodies:new Promise(async s=>{let i={};Rx=0,i.input=gT(e,om),i.res=jt==null?void 0:jt.execute(i.input),Fl.last=ae();let o=await i.res.array();Fl.bodies=i.res.shape[2]===17?fxe(o,t,e):gxe(o,t,e);for(let l of Fl.bodies)yT(l,[e.shape[2]||1,e.shape[1]||1]),fT(l.keypoints);Object.keys(i).forEach(l=>J(i[l])),s(Fl.bodies)})}var On,lm=[],bT=0,Mx=Number.MAX_SAFE_INTEGER,dm=0,um=2.5;async function vT(e){if(!On||ne.initial){On=await $e(e.object.modelPath);let t=On!=null&&On.executor?Object.values(On.modelSignature.inputs):void 0;dm=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&K("cached model:",On.modelUrl);return On}async function yxe(e,t,a){var u,d;let n=0,r=[],s=dm;for(let c of[1,2,4]){let p=c*13,h=Oe(e.find(A=>A.shape[1]===p**2&&(A.shape[2]||0)===ud.length)),m=await h.array(),f=Oe(e.find(A=>A.shape[1]===p**2&&(A.shape[2]||0)(a.object.minConfidence||0)&&b!==61){let S=(.5+Math.trunc(A%p))/p,C=(.5+Math.trunc(A/p))/p,N=x[A].map($=>$*(p/c/s)),[M,F]=[S-um/c*N[0],C-um/c*N[1]],[E,T]=[S+um/c*N[2]-M,C+um/c*N[3]-F],D=[M,F,E,T];D=D.map($=>Math.max(0,Math.min($,1)));let O=[D[0]*t[0],D[1]*t[1],D[2]*t[0],D[3]*t[1]],W={id:n++,score:Math.round(100*w)/100,class:b+1,label:ud[b].label,box:O.map($=>Math.trunc($)),boxRaw:D};r.push(W)}}J([h,f,g,y])}let i=r.map(c=>[c.boxRaw[1],c.boxRaw[0],c.boxRaw[3],c.boxRaw[2]]),o=r.map(c=>c.score),l=[];if(i&&i.length>0){let c=await fe.nonMaxSuppressionAsync(i,o,a.object.maxDetected||0,a.object.iouThreshold,a.object.minConfidence);l=Array.from(await c.data()),J(c)}return r=r.filter((c,p)=>l.includes(p)).sort((c,p)=>p.score-c.score),r}async function Fx(e,t){if(!(On!=null&&On.executor))return[];let a=(t.object.skipTime||0)>ae()-bT,n=Mx<(t.object.skipFrames||0);return t.skipAllowed&&a&&n&&lm.length>0?(Mx++,lm):(Mx=0,!ne.kernels.includes("mod")||!ne.kernels.includes("sparsetodense")?lm:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],i=fe.resizeBilinear(e,[dm,dm],!1),o=ve(i,ze.tf255),l=Si(o,[0,3,1,2]),u;t.object.enabled&&(u=On.execute(l)),bT=ae();let d=await yxe(u,s,t);lm=d,J([i,o,l,...u]),r(d)}))}var bc=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],xxe=bc.length,Ac=bc.reduce((e,t,a)=>(e[t]=a,e),{}),Axe=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],Wwe=Axe.map(([e,t])=>[Ac[e],Ac[t]]),kT=[["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 IT(e){let t=e.reduce(({maxX:a,maxY:n,minX:r,minY:s},{position:{x:i,y:o}})=>({maxX:Math.max(a,i),maxY:Math.max(n,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 ST(e,[t,a],[n,r]){let s=t/n,i=a/r,o=(u,d)=>({id:d,score:u.score,boxRaw:[u.box[0]/r,u.box[1]/n,u.box[2]/r,u.box[3]/n],box:[Math.trunc(u.box[0]*i),Math.trunc(u.box[1]*s),Math.trunc(u.box[2]*i),Math.trunc(u.box[3]*s)],keypoints:u.keypoints.map(({score:c,part:p,position:h})=>({score:c,part:p,position:[Math.trunc(h.x*i),Math.trunc(h.y*s)],positionRaw:[h.x/n,h.y/n]})),annotations:{}});return e.map((u,d)=>o(u,d))}var pm=class{constructor(t,a){he(this,"priorityQueue");he(this,"numberOfElements");he(this,"getElementValue");this.priorityQueue=new Array(t),this.numberOfElements=-1,this.getElementValue=a}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 a=2*t;if(aa?a:e}function TT(e,t,a,n){let r=a-e,s=n-t;return r*r+s*s}function _x(e,t){return{x:e.x+t.x,y:e.y+t.y}}var dn,vxe=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],cm=1,xd=16,wxe=50**2;function CT(e,t,a,n,r,s,i=2){let o=y=>({y:s.get(y.y,y.x,e),x:s.get(y.y,y.x,s.shape[2]/2+e)}),l=(y,x,A)=>({y:Px(Math.round(y.y/xd),0,x-1),x:Px(Math.round(y.x/xd),0,A-1)}),[u,d]=n.shape,c=l(t.position,u,d),p=o(c),m=_x(t.position,p);for(let y=0;y[Ac[p],Ac[h]]),i=s.map(([,p])=>p),o=s.map(([p])=>p),l=t.shape[2],u=i.length,d=new Array(l),c=Dx(e.part,xd,a);d[e.part.id]={score:e.score,part:bc[e.part.id],position:c};for(let p=u-1;p>=0;--p){let h=i[p],m=o[p];d[h]&&!d[m]&&(d[m]=CT(p,d[h],m,t,a,r))}for(let p=0;pt){o=!1;break}if(!o)break}return o}function Sxe(e,t){let[a,n,r]=t.shape,s=new pm(a*n*r,({score:i})=>i);for(let i=0;i{var i;let s=(i=r[n])==null?void 0:i.position;return s?TT(a,t,s.y,s.x)<=wxe:!1})}function Txe(e,t){return t.reduce((n,{position:r,score:s},i)=>(NT(e,r,i)||(n+=s),n),0)/t.length}function Cxe(e,t,a,n,r,s){let i=[],o=Sxe(s,t);for(;i.lengthh.score>s);let c=Txe(i,d),p=IT(d);c>s&&i.push({keypoints:d,box:p,score:Math.round(100*c)/100})}return i}async function Ox(e,t){if(!(dn!=null&&dn.executor))return[];let a=Pe(()=>{if(!dn.inputs[0].shape)return[];let i=fe.resizeBilinear(e,[dn.inputs[0].shape[2],dn.inputs[0].shape[1]]),o=xe(ve(Ue(i,"float32"),127.5),1),u=dn.execute(o,vxe).map(d=>Oe(d,[0]));return u[1]=za(u[1]),u}),n=await Promise.all(a.map(i=>i.buffer()));for(let i of a)J(i);let r=Cxe(n[0],n[1],n[2],n[3],t.body.maxDetected,t.body.minConfidence);return dn.inputs[0].shape?ST(r,[e.shape[1],e.shape[2]],[dn.inputs[0].shape[2],dn.inputs[0].shape[1]]):[]}async function RT(e){return!dn||ne.initial?dn=await $e(e.body.modelPath):e.debug&&K("cached model:",dn.modelUrl),dn}var gr,Nxe=["fgr","pha","r1o","r2o","r3o","r4o"],qt={},Lx=0;function FT(e){J([qt.r1i,qt.r2i,qt.r3i,qt.r4i,qt.downsample_ratio]),qt.r1i=Ve(0),qt.r2i=Ve(0),qt.r3i=Ve(0),qt.r4i=Ve(0),Lx=e.segmentation.ratio||.5,qt.downsample_ratio=Ve(Lx)}async function Wx(e){return!gr||ne.initial?gr=await $e(e.segmentation.modelPath):e.debug&&K("cached model:",gr.modelUrl),FT(e),gr}var MT=e=>Pe(()=>{let t=Oe(e,[0]),a=te(t,ze.tf255);return Ue(a,"int32")});function zx(e,t){let a=e?MT(e):lr([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),n=t?MT(t):lr([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=lt([a,n],-1);return J([a,n]),r}function Rxe(e){return Pe(()=>{let t={};return t.unstack=Na(e,-1),t.concat=lt(t.unstack,1),t.split=Sa(t.concat,4,1),t.stack=lt(t.split,2),t.squeeze=Oe(t.stack,[0]),t.expand=Bt(t.squeeze,-1),t.add=we(t.expand,1),t.mul=te(t.add,127.5),t.cast=Ue(t.mul,"int32"),t.tile=Qr(t.cast,[1,1,3]),t.alpha=lr([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),lt([t.tile,t.alpha],-1)})}async function $T(e,t){if(gr||(gr=await Wx(t)),!(gr!=null&&gr.executor))return null;qt.src=ve(e,255),Lx!==t.segmentation.ratio&&FT(t);let[a,n,r,s,i,o]=await gr.executeAsync(qt,Nxe),l;switch(t.segmentation.mode||"default"){case"default":l=zx(a,n);break;case"alpha":l=zx(null,n);break;case"foreground":l=zx(a,null);break;case"state":l=Rxe(r);break;default:l=Ve(0)}return J([qt.src,a,n,qt.r1i,qt.r2i,qt.r3i,qt.r4i]),[qt.r1i,qt.r2i,qt.r3i,qt.r4i]=[r,s,i,o],l}var ba;async function Bx(e){return!ba||ne.initial?ba=await $e(e.segmentation.modelPath):e.debug&&K("cached model:",ba.modelUrl),ba}async function PT(e,t){var r;if(ba||(ba=await Bx(t)),!(ba!=null&&ba.executor)||!((r=ba==null?void 0:ba.inputs)!=null&&r[0].shape))return null;let a={};a.resize=fe.resizeBilinear(e,[ba.inputs[0].shape?ba.inputs[0].shape[1]:0,ba.inputs[0].shape?ba.inputs[0].shape[2]:0],!1),a.norm=ve(a.resize,ze.tf255),a.res=ba.execute(a.norm),a.squeeze=Oe(a.res,[0]),a.alpha=fe.resizeBilinear(a.squeeze,[e.shape[1]||0,e.shape[2]||0]),a.mul=te(a.alpha,ze.tf255);let n;switch(t.segmentation.mode||"default"){case"default":a.input=Oe(e),a.concat=lt([a.input,a.mul],-1),n=Ue(a.concat,"int32");break;case"alpha":n=Ue(a.mul,"int32");break;default:n=Ve(0)}return Object.keys(a).forEach(s=>J(a[s])),n}function hm(e,t,a){var u,d;if(!t||!((u=e==null?void 0:e.config)!=null&&u.validateModels))return null;let n=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],i=[],o=t.modelUrl,l=t.executor;if((d=l==null?void 0:l.graph)!=null&&d.nodes)for(let c of Object.values(l.graph.nodes)){let p=c.op.toLowerCase();s.includes(p)||s.push(p)}else!l&&e.config.debug&&K("model not loaded",a);for(let c of s)!n.includes(c)&&!r.includes(c)&&!e.env.kernels.includes(c)&&!e.env.kernels.includes(c.replace("_",""))&&!e.env.kernels.includes(c.replace("native",""))&&!e.env.kernels.includes(c.replace("v2",""))&&i.push(c);return e.config.debug&&i.length>0&&K("model validation failed:",a,i),i.length>0?{name:a,missing:i,ops:s,url:o}:null}var vc=class{constructor(t){he(this,"instance");he(this,"models",{});this.models={},this.instance=t}stats(){let t=0,a=0,n=0;for(let s of Object.values(ya))t+=s.sizeFromManifest,a+=s.sizeLoadedWeights,n+=s.sizeDesired;let r=n>0?a/n:0;return{numLoadedModels:Object.values(ya).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:a,totalSizeLoading:n,modelStats:Object.values(ya)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var n,r,s,i,o,l,u,d,c,p,h,m,f,g,y,x,A,b,w,S,C,N,M,F,E,T,D;ne.initial&&this.reset(),t&&(this.instance=t);let a={};a.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?EI(this.instance.config):null,a.antispoof=this.instance.config.face.enabled&&((n=this.instance.config.face.antispoof)!=null&&n.enabled)&&!this.models.antispoof?tS(this.instance.config):null,a.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?sS(this.instance.config):null,a.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?YI(this.instance.config):null,a.emotion=this.instance.config.face.enabled&&((i=this.instance.config.face.emotion)!=null&&i.enabled)&&!this.models.emotion?jI(this.instance.config):null,a.iris=this.instance.config.face.enabled&&((o=this.instance.config.face.iris)!=null&&o.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?_I(this.instance.config):null,a.facemesh=this.instance.config.face.enabled&&((u=this.instance.config.face.mesh)!=null&&u.enabled)&&!this.models.facemesh?BI(this.instance.config):null,a.gear=this.instance.config.face.enabled&&((d=this.instance.config.face.gear)!=null&&d.enabled)&&!this.models.gear?uS(this.instance.config):null,a.ssrnetage=this.instance.config.face.enabled&&((c=this.instance.config.face.ssrnet)!=null&&c.enabled)&&!this.models.ssrnetage?hS(this.instance.config):null,a.ssrnetgender=this.instance.config.face.enabled&&((p=this.instance.config.face.ssrnet)!=null&&p.enabled)&&!this.models.ssrnetgender?yS(this.instance.config):null,a.mobilefacenet=this.instance.config.face.enabled&&((h=this.instance.config.face.mobilefacenet)!=null&&h.enabled)&&!this.models.mobilefacenet?wS(this.instance.config):null,a.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?CS(this.instance.config):null,a.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((f=this.instance.config.body.modelPath)!=null&&f.includes("blazepose"))?pI(this.instance.config):null,a.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?dI(this.instance.config):null,a.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((g=this.instance.config.body.modelPath)!=null&&g.includes("efficientpose"))?yI(this.instance.config):null,a.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((y=this.instance.config.body.modelPath)!=null&&y.includes("movenet"))?xT(this.instance.config):null,a.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((x=this.instance.config.body.modelPath)!=null&&x.includes("posenet"))?RT(this.instance.config):null,a.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(A=this.instance.config.hand.detector)==null?void 0:A.modelPath)!=null&&b.includes("handtrack"))?oT(this.instance.config):null,a.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((S=(w=this.instance.config.hand.detector)==null?void 0:w.modelPath)!=null&&S.includes("handtrack"))?lT(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((N=(C=this.instance.config.hand.detector)==null?void 0:C.modelPath)!=null&&N.includes("handdetect"))&&(a.handdetect=tT(this.instance.config),a.handskeleton=aT(this.instance.config)),a.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((M=this.instance.config.object.modelPath)!=null&&M.includes("centernet"))?mI(this.instance.config):null,a.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((F=this.instance.config.object.modelPath)!=null&&F.includes("nanodet"))?vT(this.instance.config):null,a.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&((E=this.instance.config.segmentation.modelPath)!=null&&E.includes("selfie"))?Bx(this.instance.config):null,a.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((T=this.instance.config.segmentation.modelPath)!=null&&T.includes("meet"))?Tx(this.instance.config):null,a.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((D=this.instance.config.segmentation.modelPath)!=null&&D.includes("rvm"))?Wx(this.instance.config):null;for(let[O,W]of Object.entries(a))W!=null&&W.then&&W.then($=>this.models[O]=$);await Promise.all(Object.values(a))}list(){let t=Object.keys(this.models).map(a=>{var n;return{name:a,loaded:this.models[a]!==null,size:0,url:this.models[a]?(n=this.models[a])==null?void 0:n.modelUrl:null}});for(let a of t){let n=Object.keys(ya).find(r=>r.startsWith(a.name));n&&(a.size=ya[n].sizeLoadedWeights,a.url=ya[n].url)}return t}loaded(){return this.list().filter(n=>n.loaded).map(n=>n.name)}validate(){let t=[];for(let a of Object.keys(this.models)){let n=this.models[a];if(!n)continue;let r=hm(this.instance,n,a);r&&t.push(r)}return t}};function OT(e,t,a,n,r){var o,l,u,d,c,p;let s=0,i=[];for(let h of e){let m={id:s++,face:h,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)h.box[0]>b.box[0]&&h.box[0]b.box[1]&&h.box[1]+h.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(f.push(b[0],b[0]+b[2]),g.push(b[1],b[1]+b[3]))};y(m.face.box),y((d=m.body)==null?void 0:d.box),y((c=m.hands.left)==null?void 0:c.box),y((p=m.hands.right)==null?void 0:p.box);let x=Math.min(...f),A=Math.min(...g);m.box=[x,A,Math.max(...f)-x,Math.max(...g)-A],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),i.push(m)}return i}var mm=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -8788,7 +8788,7 @@ PQ4GJ+ashuK0MhWaoWcA0AaOmASMK7jRNPWYBmHyiuepO2x10qfcv6vYxCzYqoGK4HVYVTJrmb5l c6oaM5TUJ8EgGsG4kLNUHT0M64OaqMMikSRsuKbnFMRLG3zVehOaGNE445NNlnVFpDMu6uie9Vo1 8z5mOAOST2pDK91cNN+5tsrH3PrW54a06KxT7fdrlh/q1Pc+tJ6IUdZGvHPLezMcnBOWbsPap5r3 ylFtbdT1xUWNWzU0/Zbwlgfmx8zGsHWtRHmMqE59aAMyNifvHPc1f0gtPdqkY5JosJHeNci2tktY -euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,lm=` +euPnNY+oXWZEVJNrZ9aun8SIq/CzodHuriIokhDIR1ronbKZr0o6o8ipoz//2Q==`,fm=` /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAsICAoIBwsKCQoNDAsNERwSEQ8PESIZGhQcKSQrKigk JyctMkA3LTA9MCcnOEw5PUNFSElIKzZPVU5GVEBHSEX/2wBDAQwNDREPESESEiFFLicuRUVFRUVF RUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUVFRUX/wAARCASwBLADASIA @@ -9356,4 +9356,4 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;async function J3e(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),a,n;switch(e.config.warmup){case"face":a=await t(om);break;case"body":case"full":a=await t(lm);break;default:a=null}if(a){let r=await createImageBitmap(a);n=await e.detect(r,e.config),r.close()}return n}async function Q3e(e){return new Promise(t=>{let a;switch(e.config.warmup){case"face":a="data:image/jpeg;base64,"+om;break;case"full":case"body":a="data:image/jpeg;base64,"+lm;break;default:a=""}let n;if(typeof Image!="undefined")n=new Image;else if(ne.Image)n=new ne.Image;else{t(void 0);return}n.onload=async()=>{let r=Mn(n.naturalWidth,n.naturalHeight);if(!r)K("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(n,0,0);let i=await e.image(r,!0),o=i.tensor?await e.detect(i.tensor,e.config):void 0;t(o)}},a?n.src=a:t(void 0)})}async function eye(e){let t=r=>Buffer.from(r,"base64"),a;e.config.warmup==="face"?a=t(om):a=t(lm);let n;if("node"in Ke&&ca()==="tensorflow"){let r=J3.decodeJpeg(a),s=Wt(r,0);e.tf.dispose(r),n=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&K("Warmup tfjs-node not loaded");return n}async function tye(e){let t;return typeof createImageBitmap=="function"?t=await J3e(e):typeof Image!="undefined"||ne.Canvas!==void 0?t=await Q3e(e):t=await eye(e),t}async function aye(e){var o,l,u,p;if(!B().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=ca(),a=nr();if(t!=="webgl"&&t!=="humangl"||!(a!=null&&a.checkCompileCompletion))return;B().set("ENGINE_COMPILE_ONLY",!0);let n=It().state.numTensors,r=[];for(let[c,d]of Object.entries(e.models.models)){if(!d)continue;let h=d!=null&&d.modelSignature&&((l=(o=d==null?void 0:d.inputs)==null?void 0:o[0])!=null&&l.shape)?[...d.inputs[0].shape]:[1,64,64,3],m=d!=null&&d.modelSignature&&((p=(u=d==null?void 0:d.inputs)==null?void 0:u[0])!=null&&p.dtype)?d.inputs[0].dtype:"float32";for(let g=0;gJ(y)):J(g)}catch(g){e.config.debug&&K("compile fail model:",c)}J(f)}let s=await a.checkCompileCompletionAsync();a.getUniformLocations(),e.config.debug&&K("compile pass:",{models:r,kernels:s.length}),B().set("ENGINE_COMPILE_ONLY",!1);let i=It().state.numTensors;i-n>0&&K("tensor leak:",i-n)}async function qS(e,t){await sc(e,!1);let a=ae();return e.state="warmup",t&&(e.config=Et(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?pr():new Promise(async n=>{await e.models.load(),await aye(e);let r=await tye(e),s=ae();e.config.debug&&K("warmup",e.config.warmup,Math.round(s-a),"ms"),e.emit("warmup"),n(r)})}var pd,mc,fc,um,Ps,Ex=class{constructor(t){he(this,"version");he(this,"config");he(this,"result");he(this,"state");he(this,"process");he(this,"tf");he(this,"env",ne);he(this,"draw",S0);he(this,"match",Q0);he(this,"models");he(this,"events");he(this,"faceTriangulation");he(this,"faceUVMap");he(this,"performance");jn(this,pd,void 0);jn(this,mc,void 0);jn(this,fc,void 0);he(this,"analyze",(...t)=>{if(!qa(this,mc))return;let a=this.tf.engine().state.numTensors,n=qa(this,pd);xr(this,pd,a);let r=a-n;r!==0&&K(...t,r)});jn(this,um,t=>{if(!qa(this,fc))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof gt))return"input must be a tensor";try{this.tf.getBackend()}catch(a){return"backend not loaded"}return null});he(this,"webcam",new x0);he(this,"emit",t=>{var a;(a=this.events)!=null&&a.dispatchEvent&&this.events.dispatchEvent(new Event(t))});jn(this,Ps,{});let a=(ec.tfjs||s3).replace(/-(.*)/,"");ll.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${a}/dist/`,ll.modelBasePath=ne.browser?"../models/":"file://models/",this.version=ry,Object.defineProperty(this,"version",{value:ry}),this.config=JSON.parse(JSON.stringify(ll)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=Et(this.config,t)),r9(this.config),this.tf=Ke,this.state="idle",xr(this,pd,0),xr(this,mc,!1),xr(this,fc,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new hc(this),py(),this.result=pr(),this.process={tensor:null,canvas:null},this.faceTriangulation=Z9,this.faceUVMap=J9,im(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&K(`version: ${this.version}`),this.config.debug&&K(`tfjs version: ${this.tf.version["tfjs-core"]}`);let n=JSON.parse(JSON.stringify(this.env));delete n.kernels,delete n.initial,delete n.perfadd,this.config.debug&&K("environment:",n)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(ll)),this.config.backend=t,ay(),ne.initial=!0}validate(t){let a=Q3(ll,t||this.config);return a.length===0&&(this.config=Et(this.config,t)),a}now(){return ae()}image(t,a=!1){return g0(t,this.config,a)}async segmentation(t,a){var s,i,o;if(a&&(this.config=Et(this.config,a)),!this.config.segmentation.enabled)return null;let n=await g0(t,this.config);if(!n.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await VS(n.tensor,this.config)),(i=this.config.segmentation.modelPath)!=null&&i.includes("meet")&&(r=await bS(n.tensor,this.config)),(o=this.config.segmentation.modelPath)!=null&&o.includes("selfie")&&(r=await GS(n.tensor,this.config)),J(n.tensor),r}compare(t,a){return n9(this.config,t,a)}async init(){await sc(this,!0),await this.tf.ready(),ay()}async load(t){this.state="load";let a=ae(),n=Object.values(this.models.models).filter(i=>i).length;t&&(this.config=Et(this.config,t)),this.env.initial&&(await sc(this,!1)||K("error: backend check failed"),await Fp(),this.env.browser&&(this.config.debug&&K("configuration:",this.config),this.config.debug&&K("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&K("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(i=>i).length!==n&&(this.models.validate(),this.emit("load"));let s=Math.trunc(ae()-a);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return AS(t,this.config)}async warmup(t){let a=ae(),n=await qS(this,t),r=ae();return this.performance.warmup=Math.trunc(r-a),n}async profile(t,a){let n=await this.tf.profile(()=>this.detect(t,a)),r={},s=0;for(let o of n.kernels){let l=Number(o.kernelTimeMs)||0;r[o.name]?r[o.name]+=l:r[o.name]=l,s+=l}let i=[];Object.entries(r).forEach(o=>i.push({kernel:o[0],time:o[1],perc:0}));for(let o of i)o.perc=Math.round(1e3*o.time/s)/1e3,o.time=Math.round(1e3*o.time)/1e3;return i.sort((o,l)=>l.time-o.time),i.length=20,i}async detect(t,a){return this.state="detect",new Promise(async n=>{var g,y,x,A,b,w,I,T,N,M,P,E,S,_,O,W,$,U,G,q,H;this.state="config";let r;this.config=Et(this.config,a),this.state="check";let s=qa(this,um).call(this,t);s&&(K(s,t),this.emit("error"),n(pr(s)));let i=ae();await this.load(),r=ae(),this.state="image";let o=await g0(t,this.config);if(this.process=o,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(ae()-r):Math.trunc(ae()-r),this.analyze("Get Image:"),!o.tensor){this.config.debug&&K("could not convert input to tensor"),this.emit("error"),n(pr("could not convert input to tensor"));return}this.emit("image"),r=ae(),this.config.skipAllowed=await a9(this.config,o.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(ae()-r):Math.trunc(ae()-r),this.analyze("Check Changed:");let l=[],u=[],p=[],c=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?Qy(this,o.tensor):[],this.performance.face&&delete this.performance.face):(r=ae(),l=this.config.face.enabled?await Qy(this,o.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let d=this.config.body.maxDetected===-1?Et(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((g=this.config.body.modelPath)!=null&&g.includes("posenet")?u=this.config.body.enabled?Ix(o.tensor,d):[]:(y=this.config.body.modelPath)!=null&&y.includes("blazepose")?u=this.config.body.enabled?gy(o.tensor,d):[]:(x=this.config.body.modelPath)!=null&&x.includes("efficientpose")?u=this.config.body.enabled?ky(o.tensor,d):[]:(A=this.config.body.modelPath)!=null&&A.includes("movenet")&&(u=this.config.body.enabled?yx(o.tensor,d):[]),this.performance.body&&delete this.performance.body):(r=ae(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?u=this.config.body.enabled?await Ix(o.tensor,d):[]:(w=this.config.body.modelPath)!=null&&w.includes("blazepose")?u=this.config.body.enabled?await gy(o.tensor,d):[]:(I=this.config.body.modelPath)!=null&&I.includes("efficientpose")?u=this.config.body.enabled?await ky(o.tensor,d):[]:(T=this.config.body.modelPath)!=null&&T.includes("movenet")&&(u=this.config.body.enabled?await yx(o.tensor,d):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let h=this.config.hand.maxDetected===-1?Et(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((M=(N=this.config.hand.detector)==null?void 0:N.modelPath)!=null&&M.includes("handdetect")?p=this.config.hand.enabled?sx(o.tensor,h):[]:(E=(P=this.config.hand.detector)==null?void 0:P.modelPath)!=null&&E.includes("handtrack")&&(p=this.config.hand.enabled?lx(o.tensor,h):[]),this.performance.hand&&delete this.performance.hand):(r=ae(),(_=(S=this.config.hand.detector)==null?void 0:S.modelPath)!=null&&_.includes("handdetect")?p=this.config.hand.enabled?await sx(o.tensor,h):[]:(W=(O=this.config.hand.detector)==null?void 0:O.modelPath)!=null&&W.includes("handtrack")&&(p=this.config.hand.enabled?await lx(o.tensor,h):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?(($=this.config.object.modelPath)!=null&&$.includes("nanodet")?c=this.config.object.enabled?Ax(o.tensor,this.config):[]:(U=this.config.object.modelPath)!=null&&U.includes("centernet")&&(c=this.config.object.enabled?Ay(o.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=ae(),(G=this.config.object.modelPath)!=null&&G.includes("nanodet")?c=this.config.object.enabled?await Ax(o.tensor,this.config):[]:(q=this.config.object.modelPath)!=null&&q.includes("centernet")&&(c=this.config.object.enabled?await Ay(o.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,u,p,c]=await Promise.all([l,u,p,c])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=ae(),m=[...KI(l),...XI(u),...ZI(p),...YI(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(ae()-i):Math.trunc(ae()-i);let f=((H=this.process.tensor)==null?void 0:H.shape)||[0,0,0,0];this.result={face:l,body:u,hand:p,gesture:m,object:c,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:f[2],height:f[1],get persons(){return jS(l,u,p,m,f)}},J(o.tensor),this.emit("detect"),this.state="idle",n(this.result)})}async sleep(t){return new Promise(a=>{setTimeout(a,t)})}async video(t,a=!0,n=0){a?(qa(this,Ps)[t.id]||(this.config.debug&&K("video start",t.id),qa(this,Ps)[t.id]=!0),!t.paused&&qa(this,Ps)[t.id]&&t.readyState>=2&&await this.detect(t),n>0&&await this.sleep(n),qa(this,Ps)[t.id]&&requestAnimationFrame(()=>this.video(t,a,n))):(this.config.debug&&K("video stop",t.id),qa(this,Ps)[t.id]=!1)}};pd=new WeakMap,mc=new WeakMap,fc=new WeakMap,um=new WeakMap,Ps=new WeakMap;return PC(rye);})(); +2Q==`;async function Fxe(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(i=>i.blob()),a,n;switch(e.config.warmup){case"face":a=await t(mm);break;case"body":case"full":a=await t(fm);break;default:a=null}if(a){let r=await createImageBitmap(a);n=await e.detect(r,e.config),r.close()}return n}async function $xe(e){return new Promise(t=>{let a;switch(e.config.warmup){case"face":a="data:image/jpeg;base64,"+mm;break;case"full":case"body":a="data:image/jpeg;base64,"+fm;break;default:a=""}let n;if(typeof Image!="undefined")n=new Image;else if(ne.Image)n=new ne.Image;else{t(void 0);return}n.onload=async()=>{let r=Dn(n.naturalWidth,n.naturalHeight);if(!r)K("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(n,0,0);let i=await e.image(r,!0),o=i.tensor?await e.detect(i.tensor,e.config):void 0;t(o)}},a?n.src=a:t(void 0)})}async function Dxe(e){let t=r=>Buffer.from(r,"base64"),a;e.config.warmup==="face"?a=t(mm):a=t(fm);let n;if("node"in Ye&&ea()==="tensorflow"){let r=py.decodeJpeg(a),s=Bt(r,0);e.tf.dispose(r),n=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&K("Warmup tfjs-node not loaded");return n}async function Pxe(e){let t;return typeof createImageBitmap=="function"?t=await Fxe(e):typeof Image!="undefined"||ne.Canvas!==void 0?t=await $xe(e):t=await Dxe(e),t}async function _xe(e){var o,l,u,d;if(!B().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=ea(),a=Gn();if(t!=="webgl"&&t!=="humangl"||!(a!=null&&a.checkCompileCompletion))return;B().set("ENGINE_COMPILE_ONLY",!0);let n=St().state.numTensors,r=[];for(let[c,p]of Object.entries(e.models.models)){if(!p)continue;let h=p!=null&&p.modelSignature&&((l=(o=p==null?void 0:p.inputs)==null?void 0:o[0])!=null&&l.shape)?[...p.inputs[0].shape]:[1,64,64,3],m=p!=null&&p.modelSignature&&((d=(u=p==null?void 0:p.inputs)==null?void 0:u[0])!=null&&d.dtype)?p.inputs[0].dtype:"float32";for(let g=0;gJ(y)):J(g)}catch(g){e.config.debug&&K("compile fail model:",c)}J(f)}let s=await a.checkCompileCompletionAsync();a.getUniformLocations(),e.config.debug&&K("compile pass:",{models:r,kernels:s.length}),B().set("ENGINE_COMPILE_ONLY",!1);let i=St().state.numTensors;i-n>0&&K("tensor leak:",i-n)}async function zT(e,t){await hc(e,!1);let a=ae();return e.state="warmup",t&&(e.config=Mt(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?fr():new Promise(async n=>{await e.models.load(),await _xe(e);let r=await Pxe(e),s=ae();e.config.debug&&K("warmup",e.config.warmup,Math.round(s-a),"ms"),e.emit("warmup"),n(r)})}var Ad,wc,kc,gm,ri,Ux=class{constructor(t){he(this,"version");he(this,"config");he(this,"result");he(this,"state");he(this,"process");he(this,"tf");he(this,"env",ne);he(this,"draw",F0);he(this,"match",im);he(this,"models");he(this,"events");he(this,"faceTriangulation");he(this,"faceUVMap");he(this,"performance");Yn(this,Ad,void 0);Yn(this,wc,void 0);Yn(this,kc,void 0);he(this,"analyze",(...t)=>{if(!Xa(this,wc))return;let a=this.tf.engine().state.numTensors,n=Xa(this,Ad);wr(this,Ad,a);let r=a-n;r!==0&&K(...t,r)});Yn(this,gm,t=>{if(!Xa(this,kc))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof yt))return"input must be a tensor";try{this.tf.getBackend()}catch(a){return"backend not loaded"}return null});he(this,"webcam",new S0);he(this,"emit",t=>{var a;(a=this.events)!=null&&a.dispatchEvent&&this.events.dispatchEvent(new Event(t))});Yn(this,ri,{});let a=(lc.tfjs||m3).replace(/-(.*)/,"");yl.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${a}/dist/`,yl.modelBasePath=ne.browser?"../models/":"file://models/",this.version=yy,Object.defineProperty(this,"version",{value:yy}),this.config=JSON.parse(JSON.stringify(yl)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=Mt(this.config,t)),K9(this.config),this.tf=Ye,this.state="idle",wr(this,Ad,0),wr(this,wc,!1),wr(this,kc,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new vc(this),Iy(),this.result=fr(),this.process={tensor:null,canvas:null},this.faceTriangulation=VI,this.faceUVMap=UI,hm(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&K(`version: ${this.version}`),this.config.debug&&K(`tfjs version: ${this.tf.version["tfjs-core"]}`);let n=JSON.parse(JSON.stringify(this.env));delete n.kernels,delete n.initial,delete n.perfadd,this.config.debug&&K("environment:",n)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(yl)),this.config.backend=t,fy(),ne.initial=!0}validate(t){let a=cy(yl,t||this.config);return a.length===0&&(this.config=Mt(this.config,t)),a}now(){return ae()}image(t,a=!1){return k0(t,this.config,a)}async segmentation(t,a){var s,i,o;if(a&&(this.config=Mt(this.config,a)),!this.config.segmentation.enabled)return null;let n=await k0(t,this.config);if(!n.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await $T(n.tensor,this.config)),(i=this.config.segmentation.modelPath)!=null&&i.includes("meet")&&(r=await pT(n.tensor,this.config)),(o=this.config.segmentation.modelPath)!=null&&o.includes("selfie")&&(r=await PT(n.tensor,this.config)),J(n.tensor),r}compare(t,a){return X9(this.config,t,a)}async init(){await hc(this,!0),await this.tf.ready(),fy()}async load(t){this.state="load";let a=ae(),n=Object.values(this.models.models).filter(i=>i).length;t&&(this.config=Mt(this.config,t)),this.env.initial&&(await hc(this,!1)||K("error: backend check failed"),await Vp(),this.env.browser&&(this.config.debug&&K("configuration:",this.config),this.config.debug&&K("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&K("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(i=>i).length!==n&&(this.models.validate(),this.emit("load"));let s=Math.trunc(ae()-a);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return dT(t,this.config)}async warmup(t){let a=ae(),n=await zT(this,t),r=ae();return this.performance.warmup=Math.trunc(r-a),n}async profile(t,a){let n=await this.tf.profile(()=>this.detect(t,a)),r={},s=0;for(let o of n.kernels){let l=Number(o.kernelTimeMs)||0;r[o.name]?r[o.name]+=l:r[o.name]=l,s+=l}let i=[];Object.entries(r).forEach(o=>i.push({kernel:o[0],time:o[1],perc:0}));for(let o of i)o.perc=Math.round(1e3*o.time/s)/1e3,o.time=Math.round(1e3*o.time)/1e3;return i.sort((o,l)=>l.time-o.time),i.length=20,i}async detect(t,a){return this.state="detect",new Promise(async n=>{var g,y,x,A,b,w,S,C,N,M,F,E,T,D,O,W,$,U,G,q,H;this.state="config";let r;this.config=Mt(this.config,a),this.state="check";let s=Xa(this,gm).call(this,t);s&&(K(s,t),this.emit("error"),n(fr(s)));let i=ae();await this.load(),r=ae(),this.state="image";let o=await k0(t,this.config);if(this.process=o,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(ae()-r):Math.trunc(ae()-r),this.analyze("Get Image:"),!o.tensor){this.config.debug&&K("could not convert input to tensor"),this.emit("error"),n(fr("could not convert input to tensor"));return}this.emit("image"),r=ae(),this.config.skipAllowed=await q9(this.config,o.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(ae()-r):Math.trunc(ae()-r),this.analyze("Check Changed:");let l=[],u=[],d=[],c=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?cx(this,o.tensor):[],this.performance.face&&delete this.performance.face):(r=ae(),l=this.config.face.enabled?await cx(this,o.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let p=this.config.body.maxDetected===-1?Mt(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((g=this.config.body.modelPath)!=null&&g.includes("posenet")?u=this.config.body.enabled?Ox(o.tensor,p):[]:(y=this.config.body.modelPath)!=null&&y.includes("blazepose")?u=this.config.body.enabled?Ry(o.tensor,p):[]:(x=this.config.body.modelPath)!=null&&x.includes("efficientpose")?u=this.config.body.enabled?_y(o.tensor,p):[]:(A=this.config.body.modelPath)!=null&&A.includes("movenet")&&(u=this.config.body.enabled?Ex(o.tensor,p):[]),this.performance.body&&delete this.performance.body):(r=ae(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?u=this.config.body.enabled?await Ox(o.tensor,p):[]:(w=this.config.body.modelPath)!=null&&w.includes("blazepose")?u=this.config.body.enabled?await Ry(o.tensor,p):[]:(S=this.config.body.modelPath)!=null&&S.includes("efficientpose")?u=this.config.body.enabled?await _y(o.tensor,p):[]:(C=this.config.body.modelPath)!=null&&C.includes("movenet")&&(u=this.config.body.enabled?await Ex(o.tensor,p):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let h=this.config.hand.maxDetected===-1?Mt(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((M=(N=this.config.hand.detector)==null?void 0:N.modelPath)!=null&&M.includes("handdetect")?d=this.config.hand.enabled?xx(o.tensor,h):[]:(E=(F=this.config.hand.detector)==null?void 0:F.modelPath)!=null&&E.includes("handtrack")&&(d=this.config.hand.enabled?vx(o.tensor,h):[]),this.performance.hand&&delete this.performance.hand):(r=ae(),(D=(T=this.config.hand.detector)==null?void 0:T.modelPath)!=null&&D.includes("handdetect")?d=this.config.hand.enabled?await xx(o.tensor,h):[]:(W=(O=this.config.hand.detector)==null?void 0:O.modelPath)!=null&&W.includes("handtrack")&&(d=this.config.hand.enabled?await vx(o.tensor,h):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?(($=this.config.object.modelPath)!=null&&$.includes("nanodet")?c=this.config.object.enabled?Fx(o.tensor,this.config):[]:(U=this.config.object.modelPath)!=null&&U.includes("centernet")&&(c=this.config.object.enabled?Fy(o.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=ae(),(G=this.config.object.modelPath)!=null&&G.includes("nanodet")?c=this.config.object.enabled?await Fx(o.tensor,this.config):[]:(q=this.config.object.modelPath)!=null&&q.includes("centernet")&&(c=this.config.object.enabled?await Fy(o.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,u,d,c]=await Promise.all([l,u,d,c])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=ae(),m=[...WS(l),...LS(u),...VS(d),...BS(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(ae()-r):Math.trunc(ae()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(ae()-i):Math.trunc(ae()-i);let f=((H=this.process.tensor)==null?void 0:H.shape)||[0,0,0,0];this.result={face:l,body:u,hand:d,gesture:m,object:c,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:f[2],height:f[1],get persons(){return OT(l,u,d,m,f)}},J(o.tensor),this.emit("detect"),this.state="idle",n(this.result)})}async sleep(t){return new Promise(a=>{setTimeout(a,t)})}async video(t,a=!0,n=0){a?(Xa(this,ri)[t.id]||(this.config.debug&&K("video start",t.id),Xa(this,ri)[t.id]=!0),!t.paused&&Xa(this,ri)[t.id]&&t.readyState>=2&&await this.detect(t),n>0&&await this.sleep(n),Xa(this,ri)[t.id]&&requestAnimationFrame(()=>this.video(t,a,n))):(this.config.debug&&K("video stop",t.id),Xa(this,ri)[t.id]=!1)}};Ad=new WeakMap,wc=new WeakMap,kc=new WeakMap,gm=new WeakMap,ri=new WeakMap;return kC(zxe);})(); diff --git a/dist/human.node-gpu.js b/dist/human.node-gpu.js index 890e56da..3fba301a 100644 --- a/dist/human.node-gpu.js +++ b/dist/human.node-gpu.js @@ -4,7 +4,7 @@ author: ' */ -"use strict";var Do=Object.create;var w2=Object.defineProperty;var Fo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty;var Vo=(e,t,n)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var n in t)w2(e,n,{get:t[n],enumerable:!0})},I1=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bo(t))!Go.call(e,r)&&r!==n&&w2(e,r,{get:()=>t[r],enumerable:!(o=Fo(t,r))||o.enumerable});return e};var G=(e,t,n)=>(n=e!=null?Do(Ho(e)):{},I1(t||!e||!e.__esModule?w2(n,"default",{value:e,enumerable:!0}):n,e)),Xo=e=>I1(w2({},"__esModule",{value:!0}),e);var w=(e,t,n)=>(Vo(e,typeof t!="symbol"?t+"":t,n),n),N1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y0=(e,t,n)=>(N1(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Re=(e,t,n,o)=>(N1(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);var H=Zo((va,Kt)=>{"use strict";var Ut=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,Uo=Object.getOwnPropertyNames,Yo=Object.prototype.hasOwnProperty,Ko=(e,t)=>{for(var n in t)Ut(e,n,{get:t[n],enumerable:!0})},qt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Uo(t))!Yo.call(e,r)&&r!==n&&Ut(e,r,{get:()=>t[r],enumerable:!(o=qo(t,r))||o.enumerable});return e},Jo=(e,t,n)=>(qt(e,t,"default"),n&&qt(n,t,"default")),Qo=e=>qt(Ut({},"__esModule",{value:!0}),e),Yt={};Ko(Yt,{version:()=>or});Kt.exports=Qo(Yt);Jo(Yt,require("@tensorflow/tfjs-node-gpu"),Kt.exports);var L1="4.14.0",_o="4.14.0",$o="4.14.0",er="4.14.0",tr="4.14.0",nr="4.14.0",or={tfjs:L1,"tfjs-core":L1,"tfjs-converter":_o,"tfjs-backend-cpu":$o,"tfjs-backend-webgl":er,"tfjs-backend-wasm":tr,"tfjs-backend-webgpu":nr}});var ga={};ze(ga,{Env:()=>E2,Human:()=>w1,default:()=>w1,defaults:()=>Ke,draw:()=>nt,empty:()=>Te,env:()=>R,match:()=>Ot,models:()=>k1});module.exports=Xo(ga);var de=G(H());function h(...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)}function O1(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(`modelpath error: expecting json file: ${r}`);return r}var v=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Jt(e,t,n="config",o=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")Jt(e[r],t[r],r,o);else{let s=e&&typeof e[r]!="undefined";s||o.push({reason:"unknown property",where:`${n}.${r} = ${t[r]}`});let A=e&&typeof e[r]==typeof t[r];s&&!A&&o.push({reason:"property type mismatch",where:`${n}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&n==="config"&&o.length>0&&h("invalid configuration",o),o}function a0(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,o)=>(Object.keys(o||{}).forEach(r=>{let s=n[r],A=o[r];Array.isArray(s)&&Array.isArray(A)?n[r]=s.concat(...A):t(s)&&t(A)?n[r]=a0(s,A):n[r]=A}),n),{})}var Ke={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var W0=G(H());var I=G(H());var C1=` +"use strict";var Do=Object.create;var w2=Object.defineProperty;var Fo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty;var Vo=(e,t,n)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var n in t)w2(e,n,{get:t[n],enumerable:!0})},I1=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bo(t))!Go.call(e,r)&&r!==n&&w2(e,r,{get:()=>t[r],enumerable:!(o=Fo(t,r))||o.enumerable});return e};var V=(e,t,n)=>(n=e!=null?Do(Ho(e)):{},I1(t||!e||!e.__esModule?w2(n,"default",{value:e,enumerable:!0}):n,e)),Xo=e=>I1(w2({},"__esModule",{value:!0}),e);var w=(e,t,n)=>(Vo(e,typeof t!="symbol"?t+"":t,n),n),N1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y0=(e,t,n)=>(N1(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Re=(e,t,n,o)=>(N1(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);var G=Zo((ga,Kt)=>{"use strict";var Ut=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,Uo=Object.getOwnPropertyNames,Yo=Object.prototype.hasOwnProperty,Ko=(e,t)=>{for(var n in t)Ut(e,n,{get:t[n],enumerable:!0})},qt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Uo(t))!Yo.call(e,r)&&r!==n&&Ut(e,r,{get:()=>t[r],enumerable:!(o=qo(t,r))||o.enumerable});return e},Jo=(e,t,n)=>(qt(e,t,"default"),n&&qt(n,t,"default")),Qo=e=>qt(Ut({},"__esModule",{value:!0}),e),Yt={};Ko(Yt,{version:()=>or});Kt.exports=Qo(Yt);Jo(Yt,require("@tensorflow/tfjs-node-gpu"),Kt.exports);var L1="4.17.0",_o="4.17.0",$o="4.17.0",er="4.17.0",tr="4.17.0",nr="4.14.0",or={tfjs:L1,"tfjs-core":L1,"tfjs-converter":_o,"tfjs-backend-cpu":$o,"tfjs-backend-webgl":er,"tfjs-backend-wasm":tr,"tfjs-backend-webgpu":nr}});var ha={};ze(ha,{Env:()=>E2,Human:()=>w1,default:()=>w1,defaults:()=>Ke,draw:()=>nt,empty:()=>Te,env:()=>R,match:()=>Ot,models:()=>k1});module.exports=Xo(ha);var de=V(G());function h(...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)}function O1(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(`modelpath error: expecting json file: ${r}`);return r}var v=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Jt(e,t,n="config",o=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")Jt(e[r],t[r],r,o);else{let s=e&&typeof e[r]!="undefined";s||o.push({reason:"unknown property",where:`${n}.${r} = ${t[r]}`});let A=e&&typeof e[r]==typeof t[r];s&&!A&&o.push({reason:"property type mismatch",where:`${n}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&n==="config"&&o.length>0&&h("invalid configuration",o),o}function a0(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,o)=>(Object.keys(o||{}).forEach(r=>{let s=n[r],A=o[r];Array.isArray(s)&&Array.isArray(A)?n[r]=s.concat(...A):t(s)&&t(A)?n[r]=a0(s,A):n[r]=A}),n),{})}var Ke={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,scale:1.4,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,scale:2.3,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var W0=V(G());var N=V(G());var C1=` precision highp float; attribute vec2 pos; attribute vec2 uv; @@ -96,8 +96,8 @@ c31 * m[6] + c32 * m[7] + c33 * m[8]; gl_FragColor.a = c22.a; } -`;var Qt=(e,t,n)=>{let o=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(o,(r,s)=>(n[s]=0,r))},_t=class{constructor(t,n,o){w(this,"uniform",{});w(this,"attribute",{});w(this,"gl");w(this,"id");w(this,"compile",(t,n)=>{let o=this.gl.createShader(n);return o?(this.gl.shaderSource(o,t),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS)?o:(h(`filter: gl compile failed: ${this.gl.getShaderInfoLog(o)||"unknown"}`),null)):(h("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),s=this.compile(o,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){h("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){h(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),Qt(n,"attribute",this.attribute);for(let A in this.attribute)this.attribute[A]=this.gl.getAttribLocation(this.id,A);Qt(n,"uniform",this.uniform),Qt(o,"uniform",this.uniform);for(let A in this.uniform)this.uniform[A]=this.gl.getUniformLocation(this.id,A)}}};function G1(){let e=0,t=null,n=!1,o=-1,r=[null,null],s=[],A=null,a=null,l=Ae(100,100),c={},x={INTERMEDIATE:1},i=l.getContext("webgl");if(!i){h("filter: cannot get webgl context");return}this.gl=i;function f(g,p){if(!(g===l.width&&p===l.height)){if(l.width=g,l.height=p,!A){let b=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=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,A),i.bufferData(i.ARRAY_BUFFER,b,i.STATIC_DRAW),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}i.viewport(0,0,l.width,l.height),r=[null,null]}}function d(g,p){let b=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,b);let k=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,k);let P=i.createTexture();return i.bindTexture(i.TEXTURE_2D,P),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,g,p,0,i.RGBA,i.UNSIGNED_BYTE,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,P,0),i.bindTexture(i.TEXTURE_2D,null),i.bindFramebuffer(i.FRAMEBUFFER,null),{fbo:b,texture:P}}function m(g){return r[g]=r[g]||d(l.width,l.height),r[g]}function y(g=0){if(!a)return;let p=null,b=null,k=!1;e===0?p=t:p=m(o).texture||null,e++,n&&!(g&x.INTERMEDIATE)?(b=null,k=e%2===0):(o=(o+1)%2,b=m(o).fbo||null),i.bindTexture(i.TEXTURE_2D,p),i.bindFramebuffer(i.FRAMEBUFFER,b),i.uniform1f(a.uniform.flipY,k?-1:1),i.drawArrays(i.TRIANGLES,0,6)}function u(g){if(c[g])return a=c[g],i.useProgram((a?a.id:null)||null),a;if(a=new _t(i,C1,g),!a)return h("filter: could not get webgl program"),null;let p=Float32Array.BYTES_PER_ELEMENT,b=4*p;return i.enableVertexAttribArray(a.attribute.pos),i.vertexAttribPointer(a.attribute.pos,2,i.FLOAT,!1,b,0*p),i.enableVertexAttribArray(a.attribute.uv),i.vertexAttribPointer(a.attribute.uv,2,i.FLOAT,!1,b,2*p),c[g]=a,a}let T={colorMatrix:g=>{let p=new Float32Array(g);p[4]/=255,p[9]/=255,p[14]/=255,p[19]/=255;let b=p[18]===1&&p[3]===0&&p[8]===0&&p[13]===0&&p[15]===0&&p[16]===0&&p[17]===0&&p[19]===0?D1:W1,k=u(b);k&&(i.uniform1fv(k.uniform.m,p),y())},brightness:g=>{let p=(g||0)+1;T.colorMatrix([p,0,0,0,0,0,p,0,0,0,0,0,p,0,0,0,0,0,1,0])},saturation:g=>{let p=(g||0)*2/3+1,b=(p-1)*-.5;T.colorMatrix([p,b,b,0,0,b,p,b,0,0,b,b,p,0,0,0,0,0,1,0])},desaturate:()=>{T.saturation(-1)},contrast:g=>{let p=(g||0)+1,b=-128*(p-1);T.colorMatrix([p,0,0,0,b,0,p,0,0,b,0,0,p,0,b,0,0,0,1,0])},negative:()=>{T.contrast(-2)},hue:g=>{g=(g||0)/180*Math.PI;let p=Math.cos(g),b=Math.sin(g),k=.213,P=.715,N=.072;T.colorMatrix([k+p*(1-k)+b*-k,P+p*-P+b*-P,N+p*-N+b*(1-N),0,0,k+p*-k+b*.143,P+p*(1-P)+b*.14,N+p*-N+b*-.283,0,0,k+p*-k+b*-(1-k),P+p*-P+b*P,N+p*(1-N)+b*N,0,0,0,0,0,1,0])},desaturateLuminance:()=>{T.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{T.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{T.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{T.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{T.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{T.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{T.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{T.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:g=>{let p=new Float32Array(g),b=1/l.width,k=1/l.height,P=u(H1);P&&(i.uniform1fv(P.uniform.m,p),i.uniform2f(P.uniform.px,b,k),y())},detectEdges:()=>{T.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{T.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{T.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:g=>{let p=g||1;T.convolution.call(this,[0,-1*p,0,-1*p,1+4*p,-1*p,0,-1*p,0])},emboss:g=>{let p=g||1;T.convolution.call(this,[-2*p,-1*p,0,-1*p,1,1*p,0,1*p,2*p])},blur:g=>{let p=g/7/l.width,b=g/7/l.height,k=u(B1);k&&(i.uniform2f(k.uniform.px,0,b),y(x.INTERMEDIATE),i.uniform2f(k.uniform.px,p,0),y())},pixelate:g=>{let p=g/l.width,b=g/l.height,k=u(F1);k&&(i.uniform2f(k.uniform.size,p,b),y())}};this.add=function(g){let p=Array.prototype.slice.call(arguments,1),b=T[g];s.push({func:b,args:p})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(g){f(g.width,g.height),e=0,t||(t=i.createTexture()),i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,g);for(let p=0;px.data())),A=Math.max(s[0][0],s[1][0],s[2][0]),l=(A>1?255:1)/A,c;if(l>1){let x=[U.sub(n[0],o[0]),U.sub(n[1],o[1]),U.sub(n[2],o[2])],i=[U.sub(r[0],o[0]),U.sub(r[1],o[1]),U.sub(r[2],o[2])],f=[U.mul(x[0],l),U.mul(x[1],l),U.mul(x[2],l)],d=U.stack([f[0],f[1],f[2]],2);c=U.reshape(d,[1,t.shape[0]||0,t.shape[1]||0,3]),U.dispose([...x,...i,...f,d])}else c=U.expandDims(t,0);return U.dispose([...n,...o,...r,n,t,e]),c}var X2=3840,R0=null,M0=null,y2=null,e0,ne={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function $t(){ne.inputSum=0,ne.cacheDiff=1,ne.sumMethod=0,ne.inputTensor=void 0}function Ae(e,t){let n;if(R.browser)if(R.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof R.Canvas!="undefined")n=new R.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof R.Canvas!="undefined"?n=new R.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function q2(e,t){let n=t||Ae(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function U2(e,t,n=!0){var f,d,m;if(!e)return t.debug&&h("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof I.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof I.Tensor){let y=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)y=I.expandDims(e,0);else if(e.shape[2]===4){let u=I.slice3d(e,[0,0,0],[-1,-1,3]);y=I.expandDims(u,0),I.dispose(u)}}else e.shape.length===4&&(e.shape[3]===3?y=I.clone(e):e.shape[3]===4&&(y=I.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(y==null||y.shape.length!==4||y.shape[0]!==1||y.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(y.dtype==="int32"){let u=I.cast(y,"float32");I.dispose(y),y=u}return{tensor:y,canvas:t.filter.return?M0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&h("input stream is not ready"),{tensor:null,canvas:R0};let o=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!o||!r)return t.debug&&h("cannot determine input dimensions"),{tensor:null,canvas:R0};let s=o,A=r;if(s>X2&&(s=X2,A=Math.trunc(s*r/o)),A>X2&&(A=X2,s=Math.trunc(A*o/r)),(((f=t.filter)==null?void 0:f.width)||0)>0?s=t.filter.width:(((d=t.filter)==null?void 0:d.height)||0)>0&&(s=o*((t.filter.height||0)/r)),(t.filter.height||0)>0?A=t.filter.height:(t.filter.width||0)>0&&(A=r*((t.filter.width||0)/o)),!s||!A)throw new Error("input error: cannot determine dimension");(!R0||R0.width!==s||R0.height!==A)&&(R0=Ae(s,A));let a=R0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?a.putImageData(e,0,0):t.filter.flip&&typeof a.translate!="undefined"?(a.translate(o,0),a.scale(-1,1),a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),a.setTransform(1,0,0,1,0,0)):a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),(!M0||R0.width!==M0.width||R0.height!==M0.height)&&(M0=Ae(R0.width,R0.height)),t.filter.enabled&&R.webgl.supported?(e0||(e0=R.browser?new G1:null),R.filter=!!e0,e0!=null&&e0.add?(e0.reset(),t.filter.brightness!==0&&e0.add("brightness",t.filter.brightness),t.filter.contrast!==0&&e0.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&e0.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&e0.add("blur",t.filter.blur),t.filter.saturation!==0&&e0.add("saturation",t.filter.saturation),t.filter.hue!==0&&e0.add("hue",t.filter.hue),t.filter.negative&&e0.add("negative"),t.filter.sepia&&e0.add("sepia"),t.filter.vintage&&e0.add("brownie"),t.filter.sepia&&e0.add("sepia"),t.filter.kodachrome&&e0.add("kodachrome"),t.filter.technicolor&&e0.add("technicolor"),t.filter.polaroid&&e0.add("polaroid"),t.filter.pixelate!==0&&e0.add("pixelate",t.filter.pixelate),((m=e0.get())==null?void 0:m.length)>1?M0=e0.apply(R0):M0=e0.draw(R0)):(t.debug&&h("input process error: cannot initialize filters"),R.webgl.supported=!1,t.filter.enabled=!1,q2(R0,M0))):(q2(R0,M0),e0&&(e0=null),R.filter=!!e0),!n)return{tensor:null,canvas:M0};if(!M0)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(R.browser&&I.browser)l=I.browser?I.browser.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let y=new Uint8Array(e.data.buffer);l=I.tensor(y,[e.height,e.width,c],"int32")}else if((!y2||M0.width!==y2.width||M0.height!==y2.height)&&(y2=Ae(M0.width,M0.height)),I.browser&&R.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=I.browser.fromPixels(M0):(y2=q2(M0),l=I.browser.fromPixels(y2));else{let T=q2(M0).getContext("2d").getImageData(0,0,s,A);c=T.data.length/s/A;let g=new Uint8Array(T.data.buffer);l=I.tensor(g,[s,A,c])}if(c===4){let y=I.slice3d(l,[0,0,0],[-1,-1,3]);I.dispose(l),l=y}if(!l)throw new Error("input error: cannot create tensor");let x=I.cast(l,"float32"),i=t.filter.equalization?await Z2(x):I.expandDims(x,0);if(I.dispose([l,x]),t.filter.autoBrightness){let y=I.max(i),u=await y.data();t.filter.brightness=u[0]>1?1-u[0]/255:1-u[0],I.dispose(y)}return{tensor:i,canvas:t.filter.return?M0:null}}async function V1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!ne.inputTensor)ne.inputTensor=I.clone(t);else if(ne.inputTensor.shape[1]!==t.shape[1]||ne.inputTensor.shape[2]!==t.shape[2])I.dispose(ne.inputTensor),ne.inputTensor=I.clone(t);else{let o={};o.diff=I.sub(t,ne.inputTensor),o.squared=I.mul(o.diff,o.diff),o.sum=I.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;I.dispose([ne.inputTensor,o.diff,o.squared,o.sum]),ne.inputTensor=I.clone(t),n=s<=(e.cacheSensitivity||0)}return n}async function Z1(e,t,n){let o={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||h("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||h("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;o.input1=I.clone(t),o.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?I.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):I.clone(n),o.diff=I.sub(o.input1,o.input2),o.squared=I.mul(o.diff,o.diff),o.sum=I.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return I.dispose([o.input1,o.input2,o.diff,o.squared,o.sum]),s}var z2,S2,j2,E2=class{constructor(){w(this,"browser");w(this,"node");w(this,"worker");w(this,"platform","");w(this,"agent","");w(this,"backends",[]);w(this,"initial");w(this,"filter");w(this,"tfjs");w(this,"offscreen");w(this,"perfadd",!1);w(this,"tensorflow",{version:void 0,gpu:void 0});w(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});w(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});w(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});w(this,"cpu",{model:void 0,flags:[]});w(this,"kernels",[]);ue(this,z2,void 0);ue(this,S2,void 0);ue(this,j2,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:W0.version["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let o=n[0].match(/\(([^()]+)\)/g);this.platform=o!=null&&o[0]?o[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return Y0(this,z2)}set Canvas(t){Re(this,z2,t),globalThis.Canvas=t}get Image(){return Y0(this,S2)}set Image(t){Re(this,S2,t),globalThis.Image=t}get ImageData(){return Y0(this,j2)}set ImageData(t){Re(this,j2,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(W0.engine().registryFactory);try{this.tensorflow={version:W0.backend().binding?W0.backend().binding.TF_Version:void 0,gpu:W0.backend().binding?W0.backend().binding.isUsingGpuDevice():void 0}}catch(o){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await W0.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await W0.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Ae(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let o=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(o==null?void 0:o.requestAdapterInfo())}}catch(o){this.webgpu.supported=!1}try{this.kernels=W0.getKernelsForBackend(W0.getBackend()).map(o=>o.kernelName.toLowerCase())}catch(o){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};z2=new WeakMap,S2=new WeakMap,j2=new WeakMap;var R=new E2;var K2=class{constructor(){w(this,"config");w(this,"element");w(this,"stream");w(this,"devices",[]);w(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});w(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let A=document.getElementById(t.element);if(A&&A instanceof HTMLVideoElement)this.element=A;else return this.config.debug&&h("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&h("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(n.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&h("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&h("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&h("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(A){return h("webcam",A),`webcam error: ${A}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(A=>{this.element?this.element.onloadeddata=()=>A(!0):A(!1)}),await this.element.play(),this.config.debug&&h("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&h("webcam error","no stream"),"webcam error no stream")});w(this,"pause",()=>{this.element&&this.element.pause()});w(this,"play",async()=>{this.element&&await this.element.play()});w(this,"stop",()=>{this.config.debug&&h("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var f2=G(H());var e5={};ze(e5,{"affectnet-mobilenet":()=>br,age:()=>gr,"anti-spoofing":()=>_r,antispoof:()=>ar,blazeface:()=>ir,"blazeface-back":()=>Tr,"blazeface-front":()=>vr,"blazepose-detector":()=>Rr,"blazepose-full":()=>Mr,"blazepose-heavy":()=>Pr,"blazepose-lite":()=>kr,centernet:()=>lr,default:()=>ds,efficientpose:()=>wr,"efficientpose-i-lite":()=>$r,"efficientpose-ii-lite":()=>es,"efficientpose-iv":()=>ts,emotion:()=>cr,faceboxes:()=>Er,facemesh:()=>dr,"facemesh-attention":()=>Sr,"facemesh-attention-pinto":()=>zr,"facemesh-detection-full":()=>jr,"facemesh-detection-short":()=>Ir,faceres:()=>xr,"faceres-deep":()=>Nr,gear:()=>Cr,"gear-e1":()=>Lr,"gear-e2":()=>Or,gender:()=>Dr,"gender-ssrnet-imdb":()=>Wr,handdetect:()=>Fr,"handlandmark-full":()=>Br,"handlandmark-lite":()=>yr,"handlandmark-sparse":()=>Hr,handskeleton:()=>Gr,handtrack:()=>fr,"insightface-efficientnet-b0":()=>ns,"insightface-ghostnet-strides1":()=>os,"insightface-ghostnet-strides2":()=>rs,"insightface-mobilenet-emore":()=>ss,"insightface-mobilenet-swish":()=>As,iris:()=>mr,liveness:()=>pr,meet:()=>Vr,mobileface:()=>Zr,mobilefacenet:()=>Xr,models:()=>ur,"movenet-lightning":()=>hr,"movenet-multipose":()=>qr,"movenet-thunder":()=>Ur,nanodet:()=>Yr,"nanodet-e":()=>as,"nanodet-g":()=>is,"nanodet-m":()=>ls,"nanodet-t":()=>cs,posenet:()=>Kr,rvm:()=>Jr,selfie:()=>Qr});var ar=853098,ir=538928,lr=4030290,cr=820516,dr=1477958,xr=6978814,yr=2023432,fr=2964837,mr=2599092,pr=592976,ur=0,hr=4650216,br=6920630,gr=161240,Tr=538928,vr=402048,Rr=5928856,Mr=6339202,Pr=27502466,kr=2726402,wr=5651240,Er=2013002,zr=2387598,Sr=2382414,jr=1026192,Ir=201268,Nr=13957620,Lr=112438,Or=112438,Cr=1498916,Wr=161236,Dr=201808,Fr=3515612,Br=5431368,Hr=5286322,Gr=5502280,Vr=372228,Zr=2183192,Xr=5171976,qr=9448838,Ur=12477112,Yr=7574558,Kr=5032780,Jr=3739355,Qr=212886,_r=853098,$r=2269064,es=5651240,ts=25643252,ns=13013224,os=8093408,rs=8049584,ss=6938536,As=12168584,as=12319156,is=7574558,ls=1887474,cs=5294216,ds={antispoof:ar,blazeface:ir,centernet:lr,emotion:cr,facemesh:dr,faceres:xr,"handlandmark-lite":yr,handtrack:fr,iris:mr,liveness:pr,models:ur,"movenet-lightning":hr,"affectnet-mobilenet":br,age:gr,"blazeface-back":Tr,"blazeface-front":vr,"blazepose-detector":Rr,"blazepose-full":Mr,"blazepose-heavy":Pr,"blazepose-lite":kr,efficientpose:wr,faceboxes:Er,"facemesh-attention-pinto":zr,"facemesh-attention":Sr,"facemesh-detection-full":jr,"facemesh-detection-short":Ir,"faceres-deep":Nr,"gear-e1":Lr,"gear-e2":Or,gear:Cr,"gender-ssrnet-imdb":Wr,gender:Dr,handdetect:Fr,"handlandmark-full":Br,"handlandmark-sparse":Hr,handskeleton:Gr,meet:Vr,mobileface:Zr,mobilefacenet:Xr,"movenet-multipose":qr,"movenet-thunder":Ur,nanodet:Yr,posenet:Kr,rvm:Jr,selfie:Qr,"anti-spoofing":_r,"efficientpose-i-lite":$r,"efficientpose-ii-lite":es,"efficientpose-iv":ts,"insightface-efficientnet-b0":ns,"insightface-ghostnet-strides1":os,"insightface-ghostnet-strides2":rs,"insightface-mobilenet-emore":ss,"insightface-mobilenet-swish":As,"nanodet-e":as,"nanodet-g":is,"nanodet-m":ls,"nanodet-t":cs};var D0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},I0={};async function xs(e,t){return D0.debug&&h("load model fetch:",e,t),fetch(e,t)}function X1(e){D0.cacheModels=e.cacheModels,D0.verbose=e.debug,D0.modelBasePath=e.modelBasePath}async function L(e){var c,x,i,f;let t=O1(D0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),o=n[n.length-1].replace(".json",""),r="indexeddb://"+o;I0[o]={name:o,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:e5[o],inCache:!1,url:""},D0.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=D0.cacheSupported&&D0.cacheModels?await f2.io.listModels():{}}catch(d){D0.cacheSupported=!1}I0[o].inCache=D0.cacheSupported&&D0.cacheModels&&Object.keys(s).includes(r),I0[o].url=I0[o].inCache?r:t;let A=typeof fetch=="undefined"?{}:{fetchFunc:(d,m)=>xs(d,m)},a=new f2.GraphModel(I0[o].url,A),l=!1;try{a.findIOHandler(),D0.debug&&h("model load handler:",a.handler)}catch(d){h("error finding model i/o handler:",t,d)}try{let d=await((c=a.handler)==null?void 0:c.load())||null;I0[o].sizeFromManifest=((x=d==null?void 0:d.weightData)==null?void 0:x.byteLength)||0,d?a.loadSync(d):a=await f2.loadGraphModel(I0[o].inCache?r:t,A),I0[o].sizeLoadedWeights=((f=(i=a.artifacts)==null?void 0:i.weightData)==null?void 0:f.byteLength)||0,D0.verbose&&h("load:",{model:o,url:a.modelUrl,bytes:I0[o].sizeLoadedWeights}),l=!0}catch(d){h("error loading model:",t,d)}if(l&&D0.cacheModels&&D0.cacheSupported&&!I0[o].inCache)try{let d=await a.save(r);D0.debug&&h("model saved:",r,d)}catch(d){h("error saving model:",t,d)}return a}var t5="3.2.0";var S=G(H());var u0=G(H());var o0={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function ms(){let e=o0.gl;e&&(o0.extensions=e.getSupportedExtensions())}function q1(e){var t;if(e.config.backend==="humangl"&&(o0.name in u0.engine().registry&&!((t=o0==null?void 0:o0.gl)!=null&&t.getParameter(o0.gl.VERSION))&&(h("humangl error: backend invalid context"),e.models.reset()),!u0.findBackend(o0.name))){try{o0.canvas=Ae(100,100)}catch(r){h("humangl error: cannot create canvas:",r);return}try{if(o0.gl=o0.canvas.getContext("webgl2",o0.webGLattr),!o0.gl){h("humangl error: cannot get webgl context");return}if(!o0.gl.getParameter(o0.gl.VERSION).includes("2.0")){h("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}o0.canvas&&(o0.canvas.addEventListener("webglcontextlost",s=>{throw h("humangl error:",s.type),h("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),o0.canvas.addEventListener("webglcontextrestored",s=>{h("humangl error: context restored:",s)}),o0.canvas.addEventListener("webglcontextcreationerror",s=>{h("humangl error: context create:",s)}))}catch(r){h("humangl error: cannot get webgl context:",r);return}try{u0.setWebGLContext(2,o0.gl)}catch(r){h("humangl error: cannot set webgl context:",r);return}try{let r=new u0.GPGPUContext(o0.gl);u0.registerBackend(o0.name,()=>new u0.MathBackendWebGL(r),o0.priority)}catch(r){h("humangl error: cannot register webgl backend:",r);return}try{u0.getKernelsForBackend("webgl").forEach(s=>{let A={...s,backendName:o0.name};u0.registerKernel(A)})}catch(r){h("humangl error: cannot update webgl backend registration:",r);return}try{u0.env().flagRegistry.WEBGL_VERSION&&u0.env().set("WEBGL_VERSION",2)}catch(r){h("humangl error: cannot set WebGL backend flags:",r);return}ms();let n=u0.backend(),o=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;o?e.config.debug&&h("humangl backend registered:",{webgl:o.getParameter(o.VERSION),renderer:o.getParameter(o.RENDERER)}):h("humangl error: no current gl context:",o,o0.gl)}}var Se=G(H()),C={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function U1(){C.tf255=Se.scalar(255,"float32"),C.tf1=Se.scalar(1,"float32"),C.tf2=Se.scalar(2,"float32"),C.tf05=Se.scalar(.5,"float32"),C.tf127=Se.scalar(127.5,"float32"),C.rgb=Se.tensor1d([.2989,.587,.114],"float32")}async function hs(){var e;return await R.updateBackend(),(e=R.tensorflow)!=null&&e.version?"tensorflow":R.webgpu.supported&&R.webgpu.backend?"webgpu":R.webgl.supported&&R.webgl.backend?"webgl":R.wasm.supported&&R.wasm.backend?"wasm":"cpu"}function bs(e){let t=[];if(!R.kernels.includes("mod")){let n={kernelName:"Mod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.sub(o.inputs.a,S.mul(S.div(o.inputs.a,o.inputs.b),o.inputs.b)))};S.registerKernel(n),R.kernels.push("mod"),t.push("mod")}if(!R.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.add(S.mul(S.floorDiv(o.inputs.a,o.inputs.b),o.inputs.b),S.mod(o.inputs.a,o.inputs.b)))};S.registerKernel(n),R.kernels.push("floormod"),t.push("floormod")}if(!R.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>{let r=S.getBackend();S.setBackend("cpu");let s=S.image.rotateWithOffset(o.inputs.image,o.attrs.radians,o.attrs.fillValue,o.attrs.center);return S.setBackend(r),s})};S.registerKernel(n),R.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&h("registered kernels:",t)}var Y1={};async function I2(e,t=!1){var n,o;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await hs()),t||R.initial||e.config.backend&&e.config.backend.length>0&&S.getBackend()!==e.config.backend){let r=v();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&h("running inside web worker"),typeof navigator!="undefined"&&((o=navigator==null?void 0:navigator.userAgent)!=null&&o.toLowerCase().includes("electron"))&&e.config.debug&&h("running inside electron");let s=Object.keys(S.engine().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(q1(e),s=Object.keys(S.engine().registryFactory)),e.config.debug&&h("available backends:",s),R.browser&&!R.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&h("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),R.node&&!R.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&h(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),R.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")h("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let A=await navigator.gpu.requestAdapter();if(e.config.debug&&h("enumerated webgpu adapter:",A),!A)h("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let a="requestAdapterInfo"in A?await A.requestAdapterInfo():void 0;h("webgpu adapter info:",a)}}if(s.includes(e.config.backend)||(h(`error: backend ${e.config.backend} not found in registry`),e.config.backend=R.node?"tensorflow":"webgl",e.config.debug&&h(`override: setting backend ${e.config.backend}`)),e.config.debug&&h("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(S.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&S.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&h("wasm path:",e.config.wasmPath),typeof S.setWasmPaths!="undefined")S.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let A=!1,a=!1;try{A=await S.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),a=await S.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&h(`wasm execution: ${a?"simd":"no simd"} ${A?"multithreaded":"singlethreaded"}`),e.config.debug&&!a&&h("warning: wasm simd support is not enabled")}catch(l){h("wasm detection failed")}}try{await S.setBackend(e.config.backend),await S.ready()}catch(A){return h("error: cannot set backend:",e.config.backend,A),!1}e.config.debug&&(Y1=JSON.parse(JSON.stringify(S.env().flags)))}if((S.getBackend()==="humangl"||S.getBackend()==="webgl")&&(S.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&S.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),S.env().flagRegistry.WEBGL_EXP_CONV&&S.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(h("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),S.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),S.getBackend(),e.config.debug){let s=S.env().flags,A={};for(let a of Object.keys(s))Y1[a]!==s[a]&&(A[a]=s[a]);e.config.debug&&Object.keys(A).length>0&&h("backend:",S.getBackend(),"flags:",A)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&h("flags:",e.config.flags);for(let[s,A]of Object.entries(e.config.flags))S.env().set(s,A)}S.enableProdMode(),U1(),e.performance.initBackend=Math.trunc(v()-r),e.config.backend=S.getBackend(),await R.updateBackend(),bs(e.config)}return!0}function J2(e,t){for(let n of e){let o={kernelName:n,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&h("kernelFunc",n,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};S.registerKernel(o)}R.kernels=S.getKernelsForBackend(S.getBackend()).map(n=>n.kernelName.toLowerCase())}var nt={};ze(nt,{all:()=>Js,body:()=>_2,canvas:()=>Ks,face:()=>Q2,gesture:()=>tt,hand:()=>$2,init:()=>i5,object:()=>et,options:()=>f0,person:()=>Ys});var oe=e=>{if(!e)h("draw error: invalid canvas");else if(!e.getContext)h("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)h("draw error: cannot get canvas context");else return t}return null},Je=e=>Math.round(e*180/Math.PI),Y=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Qe=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function re(e,t,n,o,r){let s=t.replace(/\[.*\]/g,"").split(` -`).map(a=>a.trim()),A=Math.max(0,n);for(let a=s.length-1;a>=0;a--){let l=a*r.lineHeight+o;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[a],A+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[a],A+4,l+15)}}function he(e,t,n,o,r){e.fillStyle=Qe(o,r),e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function be(e,t,n,o,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let A=(t+t+o)/2,a=(n+n+r)/2;e.ellipse(A,a,o/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,n),e.lineTo(t+o-s.roundRect,n),e.quadraticCurveTo(t+o,n,t+o,n+s.roundRect),e.lineTo(t+o,n+r-s.roundRect),e.quadraticCurveTo(t+o,n+r,t+o-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 n5(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let o of t)e.strokeStyle=Qe(o[2]||0,n),e.lineTo(Math.trunc(o[0]),Math.trunc(o[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function J1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){n5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let o=0;oN2[e]),Za=Ts.map(e=>N2[e]),Xa=vs.map(e=>N2[e]);function je(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Rs=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ms=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ps=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ks=[[474,475],[475,476],[476,477],[477,474]],ws=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Es=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],zs=[[469,470],[470,471],[471,472],[472,469]],Ss=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],qa={lips:je(Rs),leftEye:je(Ms),leftEyebrow:je(Ps),leftIris:je(ks),rightEye:je(ws),rightEyebrow:je(Es),rightIris:je(zs),faceOval:je(Ss)};var js=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Is=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ns=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Ls=[[474,475],[475,476],[476,477],[477,474]],Os=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Cs=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ws=[[469,470],[470,471],[471,472],[472,469]],Ds=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function Ie(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Fs={lips:Ie(js),leftEye:Ie(Is),leftEyebrow:Ie(Ns),leftIris:Ie(Ls),rightEye:Ie(Os),rightEyebrow:Ie(Cs),rightIris:Ie(Ws),faceOval:Ie(Ds)},Bs=Object.entries(Fs).map(([e,t])=>t.map(n=>[n,e])).flat(),Ua=new Map(Bs),L2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],e2=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],t2=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var q;function Hs(e,t){var o,r,s,A,a,l,c,x,i;if(!q.drawLabels||((o=q.faceLabels)==null?void 0:o.length)===0)return;let n=q.faceLabels.slice();if(n=Y(n,"[id]",e.id.toFixed(0)),e.score&&(n=Y(n,"[score]",100*e.score)),e.gender&&(n=Y(n,"[gender]",e.gender)),e.genderScore&&(n=Y(n,"[genderScore]",100*e.genderScore)),e.age&&(n=Y(n,"[age]",e.age)),e.distance&&(n=Y(n,"[distance]",100*e.distance)),e.real&&(n=Y(n,"[real]",100*e.real)),e.live&&(n=Y(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let f=e.emotion.map(d=>`${Math.trunc(100*d.score)}% ${d.emotion}`);f.length>3&&(f.length=3),n=Y(n,"[emotions]",f.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(n=Y(n,"[roll]",Je(e.rotation.angle.roll))),(a=(A=e.rotation)==null?void 0:A.angle)!=null&&a.yaw&&(n=Y(n,"[yaw]",Je(e.rotation.angle.yaw))),(c=(l=e.rotation)==null?void 0:l.angle)!=null&&c.pitch&&(n=Y(n,"[pitch]",Je(e.rotation.angle.pitch))),(i=(x=e.rotation)==null?void 0:x.gaze)!=null&&i.bearing&&(n=Y(n,"[gaze]",Je(e.rotation.gaze.bearing))),re(t,n,e.box[0],e.box[1],q)}function Gs(e,t){var n,o,r,s;if((n=e.annotations)!=null&&n.leftEyeIris&&((o=e.annotations)!=null&&o.leftEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,a=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,a=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}}function Vs(e,t){var n;if(q.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let o=e.box[0]+e.box[2]/2-e.box[3]*Je(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*Je(e.rotation.angle.pitch)/90,s=new Path2D(` +`;var Qt=(e,t,n)=>{let o=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(o,(r,s)=>(n[s]=0,r))},_t=class{constructor(t,n,o){w(this,"uniform",{});w(this,"attribute",{});w(this,"gl");w(this,"id");w(this,"compile",(t,n)=>{let o=this.gl.createShader(n);return o?(this.gl.shaderSource(o,t),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS)?o:(h(`filter: gl compile failed: ${this.gl.getShaderInfoLog(o)||"unknown"}`),null)):(h("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),s=this.compile(o,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){h("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){h(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),Qt(n,"attribute",this.attribute);for(let A in this.attribute)this.attribute[A]=this.gl.getAttribLocation(this.id,A);Qt(n,"uniform",this.uniform),Qt(o,"uniform",this.uniform);for(let A in this.uniform)this.uniform[A]=this.gl.getUniformLocation(this.id,A)}}};function G1(){let e=0,t=null,n=!1,o=-1,r=[null,null],s=[],A=null,a=null,l=Ae(100,100),c={},x={INTERMEDIATE:1},i=l.getContext("webgl");if(!i){h("filter: cannot get webgl context");return}this.gl=i;function y(T,p){if(!(T===l.width&&p===l.height)){if(l.width=T,l.height=p,!A){let b=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=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,A),i.bufferData(i.ARRAY_BUFFER,b,i.STATIC_DRAW),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}i.viewport(0,0,l.width,l.height),r=[null,null]}}function d(T,p){let b=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,b);let k=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,k);let P=i.createTexture();return i.bindTexture(i.TEXTURE_2D,P),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,T,p,0,i.RGBA,i.UNSIGNED_BYTE,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,P,0),i.bindTexture(i.TEXTURE_2D,null),i.bindFramebuffer(i.FRAMEBUFFER,null),{fbo:b,texture:P}}function m(T){return r[T]=r[T]||d(l.width,l.height),r[T]}function f(T=0){if(!a)return;let p=null,b=null,k=!1;e===0?p=t:p=m(o).texture||null,e++,n&&!(T&x.INTERMEDIATE)?(b=null,k=e%2===0):(o=(o+1)%2,b=m(o).fbo||null),i.bindTexture(i.TEXTURE_2D,p),i.bindFramebuffer(i.FRAMEBUFFER,b),i.uniform1f(a.uniform.flipY,k?-1:1),i.drawArrays(i.TRIANGLES,0,6)}function u(T){if(c[T])return a=c[T],i.useProgram((a?a.id:null)||null),a;if(a=new _t(i,C1,T),!a)return h("filter: could not get webgl program"),null;let p=Float32Array.BYTES_PER_ELEMENT,b=4*p;return i.enableVertexAttribArray(a.attribute.pos),i.vertexAttribPointer(a.attribute.pos,2,i.FLOAT,!1,b,0*p),i.enableVertexAttribArray(a.attribute.uv),i.vertexAttribPointer(a.attribute.uv,2,i.FLOAT,!1,b,2*p),c[T]=a,a}let g={colorMatrix:T=>{let p=new Float32Array(T);p[4]/=255,p[9]/=255,p[14]/=255,p[19]/=255;let b=p[18]===1&&p[3]===0&&p[8]===0&&p[13]===0&&p[15]===0&&p[16]===0&&p[17]===0&&p[19]===0?D1:W1,k=u(b);k&&(i.uniform1fv(k.uniform.m,p),f())},brightness:T=>{let p=(T||0)+1;g.colorMatrix([p,0,0,0,0,0,p,0,0,0,0,0,p,0,0,0,0,0,1,0])},saturation:T=>{let p=(T||0)*2/3+1,b=(p-1)*-.5;g.colorMatrix([p,b,b,0,0,b,p,b,0,0,b,b,p,0,0,0,0,0,1,0])},desaturate:()=>{g.saturation(-1)},contrast:T=>{let p=(T||0)+1,b=-128*(p-1);g.colorMatrix([p,0,0,0,b,0,p,0,0,b,0,0,p,0,b,0,0,0,1,0])},negative:()=>{g.contrast(-2)},hue:T=>{T=(T||0)/180*Math.PI;let p=Math.cos(T),b=Math.sin(T),k=.213,P=.715,I=.072;g.colorMatrix([k+p*(1-k)+b*-k,P+p*-P+b*-P,I+p*-I+b*(1-I),0,0,k+p*-k+b*.143,P+p*(1-P)+b*.14,I+p*-I+b*-.283,0,0,k+p*-k+b*-(1-k),P+p*-P+b*P,I+p*(1-I)+b*I,0,0,0,0,0,1,0])},desaturateLuminance:()=>{g.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{g.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{g.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{g.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{g.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{g.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{g.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{g.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:T=>{let p=new Float32Array(T),b=1/l.width,k=1/l.height,P=u(H1);P&&(i.uniform1fv(P.uniform.m,p),i.uniform2f(P.uniform.px,b,k),f())},detectEdges:()=>{g.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{g.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{g.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:T=>{let p=T||1;g.convolution.call(this,[0,-1*p,0,-1*p,1+4*p,-1*p,0,-1*p,0])},emboss:T=>{let p=T||1;g.convolution.call(this,[-2*p,-1*p,0,-1*p,1,1*p,0,1*p,2*p])},blur:T=>{let p=T/7/l.width,b=T/7/l.height,k=u(B1);k&&(i.uniform2f(k.uniform.px,0,b),f(x.INTERMEDIATE),i.uniform2f(k.uniform.px,p,0),f())},pixelate:T=>{let p=T/l.width,b=T/l.height,k=u(F1);k&&(i.uniform2f(k.uniform.size,p,b),f())}};this.add=function(T){let p=Array.prototype.slice.call(arguments,1),b=g[T];s.push({func:b,args:p})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(T){y(T.width,T.height),e=0,t||(t=i.createTexture()),i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,T);for(let p=0;px.data())),A=Math.max(s[0][0],s[1][0],s[2][0]),l=(A>1?255:1)/A,c;if(l>1){let x=[U.sub(n[0],o[0]),U.sub(n[1],o[1]),U.sub(n[2],o[2])],i=[U.sub(r[0],o[0]),U.sub(r[1],o[1]),U.sub(r[2],o[2])],y=[U.mul(x[0],l),U.mul(x[1],l),U.mul(x[2],l)],d=U.stack([y[0],y[1],y[2]],2);c=U.reshape(d,[1,t.shape[0]||0,t.shape[1]||0,3]),U.dispose([...x,...i,...y,d])}else c=U.expandDims(t,0);return U.dispose([...n,...o,...r,n,t,e]),c}var X2=3840,R0=null,M0=null,y2=null,e0,ne={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function $t(){ne.inputSum=0,ne.cacheDiff=1,ne.sumMethod=0,ne.inputTensor=void 0}function Ae(e,t){let n;if(R.browser)if(R.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof R.Canvas!="undefined")n=new R.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof R.Canvas!="undefined"?n=new R.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function q2(e,t){let n=t||Ae(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function U2(e,t,n=!0){var y,d,m;if(!e)return t.debug&&h("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof N.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof N.Tensor){let f=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)f=N.expandDims(e,0);else if(e.shape[2]===4){let u=N.slice3d(e,[0,0,0],[-1,-1,3]);f=N.expandDims(u,0),N.dispose(u)}}else e.shape.length===4&&(e.shape[3]===3?f=N.clone(e):e.shape[3]===4&&(f=N.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(f==null||f.shape.length!==4||f.shape[0]!==1||f.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(f.dtype==="int32"){let u=N.cast(f,"float32");N.dispose(f),f=u}return{tensor:f,canvas:t.filter.return?M0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&h("input stream is not ready"),{tensor:null,canvas:R0};let o=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!o||!r)return t.debug&&h("cannot determine input dimensions"),{tensor:null,canvas:R0};let s=o,A=r;if(s>X2&&(s=X2,A=Math.trunc(s*r/o)),A>X2&&(A=X2,s=Math.trunc(A*o/r)),(((y=t.filter)==null?void 0:y.width)||0)>0?s=t.filter.width:(((d=t.filter)==null?void 0:d.height)||0)>0&&(s=o*((t.filter.height||0)/r)),(t.filter.height||0)>0?A=t.filter.height:(t.filter.width||0)>0&&(A=r*((t.filter.width||0)/o)),!s||!A)throw new Error("input error: cannot determine dimension");(!R0||R0.width!==s||R0.height!==A)&&(R0=Ae(s,A));let a=R0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?a.putImageData(e,0,0):t.filter.flip&&typeof a.translate!="undefined"?(a.translate(o,0),a.scale(-1,1),a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),a.setTransform(1,0,0,1,0,0)):a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),(!M0||R0.width!==M0.width||R0.height!==M0.height)&&(M0=Ae(R0.width,R0.height)),t.filter.enabled&&R.webgl.supported?(e0||(e0=R.browser?new G1:null),R.filter=!!e0,e0!=null&&e0.add?(e0.reset(),t.filter.brightness!==0&&e0.add("brightness",t.filter.brightness),t.filter.contrast!==0&&e0.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&e0.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&e0.add("blur",t.filter.blur),t.filter.saturation!==0&&e0.add("saturation",t.filter.saturation),t.filter.hue!==0&&e0.add("hue",t.filter.hue),t.filter.negative&&e0.add("negative"),t.filter.sepia&&e0.add("sepia"),t.filter.vintage&&e0.add("brownie"),t.filter.sepia&&e0.add("sepia"),t.filter.kodachrome&&e0.add("kodachrome"),t.filter.technicolor&&e0.add("technicolor"),t.filter.polaroid&&e0.add("polaroid"),t.filter.pixelate!==0&&e0.add("pixelate",t.filter.pixelate),((m=e0.get())==null?void 0:m.length)>1?M0=e0.apply(R0):M0=e0.draw(R0)):(t.debug&&h("input process error: cannot initialize filters"),R.webgl.supported=!1,t.filter.enabled=!1,q2(R0,M0))):(q2(R0,M0),e0&&(e0=null),R.filter=!!e0),!n)return{tensor:null,canvas:M0};if(!M0)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(R.browser&&N.browser)l=N.browser?N.browser.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let f=new Uint8Array(e.data.buffer);l=N.tensor(f,[e.height,e.width,c],"int32")}else if((!y2||M0.width!==y2.width||M0.height!==y2.height)&&(y2=Ae(M0.width,M0.height)),N.browser&&R.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=N.browser.fromPixels(M0):(y2=q2(M0),l=N.browser.fromPixels(y2));else{let g=q2(M0).getContext("2d").getImageData(0,0,s,A);c=g.data.length/s/A;let T=new Uint8Array(g.data.buffer);l=N.tensor(T,[s,A,c])}if(c===4){let f=N.slice3d(l,[0,0,0],[-1,-1,3]);N.dispose(l),l=f}if(!l)throw new Error("input error: cannot create tensor");let x=N.cast(l,"float32"),i=t.filter.equalization?await Z2(x):N.expandDims(x,0);if(N.dispose([l,x]),t.filter.autoBrightness){let f=N.max(i),u=await f.data();t.filter.brightness=u[0]>1?1-u[0]/255:1-u[0],N.dispose(f)}return{tensor:i,canvas:t.filter.return?M0:null}}async function V1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!ne.inputTensor)ne.inputTensor=N.clone(t);else if(ne.inputTensor.shape[1]!==t.shape[1]||ne.inputTensor.shape[2]!==t.shape[2])N.dispose(ne.inputTensor),ne.inputTensor=N.clone(t);else{let o={};o.diff=N.sub(t,ne.inputTensor),o.squared=N.mul(o.diff,o.diff),o.sum=N.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;N.dispose([ne.inputTensor,o.diff,o.squared,o.sum]),ne.inputTensor=N.clone(t),n=s<=(e.cacheSensitivity||0)}return n}async function Z1(e,t,n){let o={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||h("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||h("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;o.input1=N.clone(t),o.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?N.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):N.clone(n),o.diff=N.sub(o.input1,o.input2),o.squared=N.mul(o.diff,o.diff),o.sum=N.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return N.dispose([o.input1,o.input2,o.diff,o.squared,o.sum]),s}var z2,S2,j2,E2=class{constructor(){w(this,"browser");w(this,"node");w(this,"worker");w(this,"platform","");w(this,"agent","");w(this,"backends",[]);w(this,"initial");w(this,"filter");w(this,"tfjs");w(this,"offscreen");w(this,"perfadd",!1);w(this,"tensorflow",{version:void 0,gpu:void 0});w(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});w(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});w(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});w(this,"cpu",{model:void 0,flags:[]});w(this,"kernels",[]);ue(this,z2,void 0);ue(this,S2,void 0);ue(this,j2,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:W0.version["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let o=n[0].match(/\(([^()]+)\)/g);this.platform=o!=null&&o[0]?o[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return Y0(this,z2)}set Canvas(t){Re(this,z2,t),globalThis.Canvas=t}get Image(){return Y0(this,S2)}set Image(t){Re(this,S2,t),globalThis.Image=t}get ImageData(){return Y0(this,j2)}set ImageData(t){Re(this,j2,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(W0.engine().registryFactory);try{this.tensorflow={version:W0.backend().binding?W0.backend().binding.TF_Version:void 0,gpu:W0.backend().binding?W0.backend().binding.isUsingGpuDevice():void 0}}catch(o){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await W0.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await W0.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Ae(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let o=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(o==null?void 0:o.requestAdapterInfo())}}catch(o){this.webgpu.supported=!1}try{this.kernels=W0.getKernelsForBackend(W0.getBackend()).map(o=>o.kernelName.toLowerCase())}catch(o){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};z2=new WeakMap,S2=new WeakMap,j2=new WeakMap;var R=new E2;var K2=class{constructor(){w(this,"config");w(this,"element");w(this,"stream");w(this,"devices",[]);w(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});w(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let A=document.getElementById(t.element);if(A&&A instanceof HTMLVideoElement)this.element=A;else return this.config.debug&&h("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&h("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(n.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&h("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&h("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&h("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(A){return h("webcam",A),`webcam error: ${A}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(A=>{this.element?this.element.onloadeddata=()=>A(!0):A(!1)}),await this.element.play(),this.config.debug&&h("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&h("webcam error","no stream"),"webcam error no stream")});w(this,"pause",()=>{this.element&&this.element.pause()});w(this,"play",async()=>{this.element&&await this.element.play()});w(this,"stop",()=>{this.config.debug&&h("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var f2=V(G());var e5={};ze(e5,{"affectnet-mobilenet":()=>br,age:()=>gr,"anti-spoofing":()=>_r,antispoof:()=>ar,blazeface:()=>ir,"blazeface-back":()=>Tr,"blazeface-front":()=>vr,"blazepose-detector":()=>Rr,"blazepose-full":()=>Mr,"blazepose-heavy":()=>Pr,"blazepose-lite":()=>kr,centernet:()=>lr,default:()=>ds,efficientpose:()=>wr,"efficientpose-i-lite":()=>$r,"efficientpose-ii-lite":()=>es,"efficientpose-iv":()=>ts,emotion:()=>cr,faceboxes:()=>Er,facemesh:()=>dr,"facemesh-attention":()=>Sr,"facemesh-attention-pinto":()=>zr,"facemesh-detection-full":()=>jr,"facemesh-detection-short":()=>Ir,faceres:()=>xr,"faceres-deep":()=>Nr,gear:()=>Cr,"gear-e1":()=>Lr,"gear-e2":()=>Or,gender:()=>Dr,"gender-ssrnet-imdb":()=>Wr,handdetect:()=>Fr,"handlandmark-full":()=>Br,"handlandmark-lite":()=>yr,"handlandmark-sparse":()=>Hr,handskeleton:()=>Gr,handtrack:()=>fr,"insightface-efficientnet-b0":()=>ns,"insightface-ghostnet-strides1":()=>os,"insightface-ghostnet-strides2":()=>rs,"insightface-mobilenet-emore":()=>ss,"insightface-mobilenet-swish":()=>As,iris:()=>mr,liveness:()=>pr,meet:()=>Vr,mobileface:()=>Zr,mobilefacenet:()=>Xr,models:()=>ur,"movenet-lightning":()=>hr,"movenet-multipose":()=>qr,"movenet-thunder":()=>Ur,nanodet:()=>Yr,"nanodet-e":()=>as,"nanodet-g":()=>is,"nanodet-m":()=>ls,"nanodet-t":()=>cs,posenet:()=>Kr,rvm:()=>Jr,selfie:()=>Qr});var ar=853098,ir=538928,lr=4030290,cr=820516,dr=1477958,xr=6978814,yr=2023432,fr=2964837,mr=2599092,pr=592976,ur=0,hr=4650216,br=6920630,gr=161240,Tr=538928,vr=402048,Rr=5928856,Mr=6339202,Pr=27502466,kr=2726402,wr=5651240,Er=2013002,zr=2387598,Sr=2382414,jr=1026192,Ir=201268,Nr=13957620,Lr=112438,Or=112438,Cr=1498916,Wr=161236,Dr=201808,Fr=3515612,Br=5431368,Hr=5286322,Gr=5502280,Vr=372228,Zr=2183192,Xr=5171976,qr=9448838,Ur=12477112,Yr=7574558,Kr=5032780,Jr=3739355,Qr=212886,_r=853098,$r=2269064,es=5651240,ts=25643252,ns=13013224,os=8093408,rs=8049584,ss=6938536,As=12168584,as=12319156,is=7574558,ls=1887474,cs=5294216,ds={antispoof:ar,blazeface:ir,centernet:lr,emotion:cr,facemesh:dr,faceres:xr,"handlandmark-lite":yr,handtrack:fr,iris:mr,liveness:pr,models:ur,"movenet-lightning":hr,"affectnet-mobilenet":br,age:gr,"blazeface-back":Tr,"blazeface-front":vr,"blazepose-detector":Rr,"blazepose-full":Mr,"blazepose-heavy":Pr,"blazepose-lite":kr,efficientpose:wr,faceboxes:Er,"facemesh-attention-pinto":zr,"facemesh-attention":Sr,"facemesh-detection-full":jr,"facemesh-detection-short":Ir,"faceres-deep":Nr,"gear-e1":Lr,"gear-e2":Or,gear:Cr,"gender-ssrnet-imdb":Wr,gender:Dr,handdetect:Fr,"handlandmark-full":Br,"handlandmark-sparse":Hr,handskeleton:Gr,meet:Vr,mobileface:Zr,mobilefacenet:Xr,"movenet-multipose":qr,"movenet-thunder":Ur,nanodet:Yr,posenet:Kr,rvm:Jr,selfie:Qr,"anti-spoofing":_r,"efficientpose-i-lite":$r,"efficientpose-ii-lite":es,"efficientpose-iv":ts,"insightface-efficientnet-b0":ns,"insightface-ghostnet-strides1":os,"insightface-ghostnet-strides2":rs,"insightface-mobilenet-emore":ss,"insightface-mobilenet-swish":As,"nanodet-e":as,"nanodet-g":is,"nanodet-m":ls,"nanodet-t":cs};var D0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},I0={};async function xs(e,t){return D0.debug&&h("load model fetch:",e,t),fetch(e,t)}function X1(e){D0.cacheModels=e.cacheModels,D0.verbose=e.debug,D0.modelBasePath=e.modelBasePath}async function L(e){var c,x,i,y;let t=O1(D0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),o=n[n.length-1].replace(".json",""),r="indexeddb://"+o;I0[o]={name:o,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:e5[o],inCache:!1,url:""},D0.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=D0.cacheSupported&&D0.cacheModels?await f2.io.listModels():{}}catch(d){D0.cacheSupported=!1}I0[o].inCache=D0.cacheSupported&&D0.cacheModels&&Object.keys(s).includes(r),I0[o].url=I0[o].inCache?r:t;let A=typeof fetch=="undefined"?{}:{fetchFunc:(d,m)=>xs(d,m)},a=new f2.GraphModel(I0[o].url,A),l=!1;try{a.findIOHandler(),D0.debug&&h("model load handler:",a.handler)}catch(d){h("error finding model i/o handler:",t,d)}try{let d=await((c=a.handler)==null?void 0:c.load())||null;I0[o].sizeFromManifest=((x=d==null?void 0:d.weightData)==null?void 0:x.byteLength)||0,d?a.loadSync(d):a=await f2.loadGraphModel(I0[o].inCache?r:t,A),I0[o].sizeLoadedWeights=((y=(i=a.artifacts)==null?void 0:i.weightData)==null?void 0:y.byteLength)||0,D0.verbose&&h("load:",{model:o,url:a.modelUrl,bytes:I0[o].sizeLoadedWeights}),l=!0}catch(d){h("error loading model:",t,d)}if(l&&D0.cacheModels&&D0.cacheSupported&&!I0[o].inCache)try{let d=await a.save(r);D0.debug&&h("model saved:",r,d)}catch(d){h("error saving model:",t,d)}return a}var t5="3.2.1";var S=V(G());var u0=V(G());var o0={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function ms(){let e=o0.gl;e&&(o0.extensions=e.getSupportedExtensions())}function q1(e){var t;if(e.config.backend==="humangl"&&(o0.name in u0.engine().registry&&!((t=o0==null?void 0:o0.gl)!=null&&t.getParameter(o0.gl.VERSION))&&(h("humangl error: backend invalid context"),e.models.reset()),!u0.findBackend(o0.name))){try{o0.canvas=Ae(100,100)}catch(r){h("humangl error: cannot create canvas:",r);return}try{if(o0.gl=o0.canvas.getContext("webgl2",o0.webGLattr),!o0.gl){h("humangl error: cannot get webgl context");return}if(!o0.gl.getParameter(o0.gl.VERSION).includes("2.0")){h("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}o0.canvas&&(o0.canvas.addEventListener("webglcontextlost",s=>{throw h("humangl error:",s.type),h("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),o0.canvas.addEventListener("webglcontextrestored",s=>{h("humangl error: context restored:",s)}),o0.canvas.addEventListener("webglcontextcreationerror",s=>{h("humangl error: context create:",s)}))}catch(r){h("humangl error: cannot get webgl context:",r);return}try{u0.setWebGLContext(2,o0.gl)}catch(r){h("humangl error: cannot set webgl context:",r);return}try{let r=new u0.GPGPUContext(o0.gl);u0.registerBackend(o0.name,()=>new u0.MathBackendWebGL(r),o0.priority)}catch(r){h("humangl error: cannot register webgl backend:",r);return}try{u0.getKernelsForBackend("webgl").forEach(s=>{let A={...s,backendName:o0.name};u0.registerKernel(A)})}catch(r){h("humangl error: cannot update webgl backend registration:",r);return}try{u0.env().flagRegistry.WEBGL_VERSION&&u0.env().set("WEBGL_VERSION",2)}catch(r){h("humangl error: cannot set WebGL backend flags:",r);return}ms();let n=u0.backend(),o=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;o?e.config.debug&&h("humangl backend registered:",{webgl:o.getParameter(o.VERSION),renderer:o.getParameter(o.RENDERER)}):h("humangl error: no current gl context:",o,o0.gl)}}var Se=V(G()),C={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function U1(){C.tf255=Se.scalar(255,"float32"),C.tf1=Se.scalar(1,"float32"),C.tf2=Se.scalar(2,"float32"),C.tf05=Se.scalar(.5,"float32"),C.tf127=Se.scalar(127.5,"float32"),C.rgb=Se.tensor1d([.2989,.587,.114],"float32")}async function hs(){var e;return await R.updateBackend(),(e=R.tensorflow)!=null&&e.version?"tensorflow":R.webgpu.supported&&R.webgpu.backend?"webgpu":R.webgl.supported&&R.webgl.backend?"webgl":R.wasm.supported&&R.wasm.backend?"wasm":"cpu"}function bs(e){let t=[];if(!R.kernels.includes("mod")){let n={kernelName:"Mod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.sub(o.inputs.a,S.mul(S.div(o.inputs.a,o.inputs.b),o.inputs.b)))};S.registerKernel(n),R.kernels.push("mod"),t.push("mod")}if(!R.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.add(S.mul(S.floorDiv(o.inputs.a,o.inputs.b),o.inputs.b),S.mod(o.inputs.a,o.inputs.b)))};S.registerKernel(n),R.kernels.push("floormod"),t.push("floormod")}if(!R.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>{let r=S.getBackend();S.setBackend("cpu");let s=S.image.rotateWithOffset(o.inputs.image,o.attrs.radians,o.attrs.fillValue,o.attrs.center);return S.setBackend(r),s})};S.registerKernel(n),R.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&h("registered kernels:",t)}var Y1={};async function I2(e,t=!1){var n,o;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await hs()),t||R.initial||e.config.backend&&e.config.backend.length>0&&S.getBackend()!==e.config.backend){let r=v();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&h("running inside web worker"),typeof navigator!="undefined"&&((o=navigator==null?void 0:navigator.userAgent)!=null&&o.toLowerCase().includes("electron"))&&e.config.debug&&h("running inside electron");let s=Object.keys(S.engine().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(q1(e),s=Object.keys(S.engine().registryFactory)),e.config.debug&&h("available backends:",s),R.browser&&!R.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&h("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),R.node&&!R.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&h(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),R.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")h("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let A=await navigator.gpu.requestAdapter();if(e.config.debug&&h("enumerated webgpu adapter:",A),!A)h("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let a="requestAdapterInfo"in A?await A.requestAdapterInfo():void 0;h("webgpu adapter info:",a)}}if(s.includes(e.config.backend)||(h(`error: backend ${e.config.backend} not found in registry`),e.config.backend=R.node?"tensorflow":"webgl",e.config.debug&&h(`override: setting backend ${e.config.backend}`)),e.config.debug&&h("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(S.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&S.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&h("wasm path:",e.config.wasmPath),typeof S.setWasmPaths!="undefined")S.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let A=!1,a=!1;try{A=await S.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),a=await S.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&h(`wasm execution: ${a?"simd":"no simd"} ${A?"multithreaded":"singlethreaded"}`),e.config.debug&&!a&&h("warning: wasm simd support is not enabled")}catch(l){h("wasm detection failed")}}try{await S.setBackend(e.config.backend),await S.ready()}catch(A){return h("error: cannot set backend:",e.config.backend,A),!1}e.config.debug&&(Y1=JSON.parse(JSON.stringify(S.env().flags)))}if((S.getBackend()==="humangl"||S.getBackend()==="webgl")&&(S.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&S.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),S.env().flagRegistry.WEBGL_EXP_CONV&&S.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(h("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),S.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),S.getBackend(),e.config.debug){let s=S.env().flags,A={};for(let a of Object.keys(s))Y1[a]!==s[a]&&(A[a]=s[a]);e.config.debug&&Object.keys(A).length>0&&h("backend:",S.getBackend(),"flags:",A)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&h("flags:",e.config.flags);for(let[s,A]of Object.entries(e.config.flags))S.env().set(s,A)}S.enableProdMode(),U1(),e.performance.initBackend=Math.trunc(v()-r),e.config.backend=S.getBackend(),await R.updateBackend(),bs(e.config)}return!0}function J2(e,t){for(let n of e){let o={kernelName:n,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&h("kernelFunc",n,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};S.registerKernel(o)}R.kernels=S.getKernelsForBackend(S.getBackend()).map(n=>n.kernelName.toLowerCase())}var nt={};ze(nt,{all:()=>Js,body:()=>_2,canvas:()=>Ks,face:()=>Q2,gesture:()=>tt,hand:()=>$2,init:()=>i5,object:()=>et,options:()=>f0,person:()=>Ys});var oe=e=>{if(!e)h("draw error: invalid canvas");else if(!e.getContext)h("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)h("draw error: cannot get canvas context");else return t}return null},Je=e=>Math.round(e*180/Math.PI),Y=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Qe=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function re(e,t,n,o,r){let s=t.replace(/\[.*\]/g,"").split(` +`).map(a=>a.trim()),A=Math.max(0,n);for(let a=s.length-1;a>=0;a--){let l=a*r.lineHeight+o;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[a],A+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[a],A+4,l+15)}}function he(e,t,n,o,r){e.fillStyle=Qe(o,r),e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function be(e,t,n,o,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let A=(t+t+o)/2,a=(n+n+r)/2;e.ellipse(A,a,o/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,n),e.lineTo(t+o-s.roundRect,n),e.quadraticCurveTo(t+o,n,t+o,n+s.roundRect),e.lineTo(t+o,n+r-s.roundRect),e.quadraticCurveTo(t+o,n+r,t+o-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 n5(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let o of t)e.strokeStyle=Qe(o[2]||0,n),e.lineTo(Math.trunc(o[0]),Math.trunc(o[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function J1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){n5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let o=0;oN2[e]),Ga=Ts.map(e=>N2[e]),Va=vs.map(e=>N2[e]);function je(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Rs=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ms=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ps=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ks=[[474,475],[475,476],[476,477],[477,474]],ws=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Es=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],zs=[[469,470],[470,471],[471,472],[472,469]],Ss=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Za={lips:je(Rs),leftEye:je(Ms),leftEyebrow:je(Ps),leftIris:je(ks),rightEye:je(ws),rightEyebrow:je(Es),rightIris:je(zs),faceOval:je(Ss)};var js=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Is=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ns=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Ls=[[474,475],[475,476],[476,477],[477,474]],Os=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Cs=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ws=[[469,470],[470,471],[471,472],[472,469]],Ds=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function Ie(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Fs={lips:Ie(js),leftEye:Ie(Is),leftEyebrow:Ie(Ns),leftIris:Ie(Ls),rightEye:Ie(Os),rightEyebrow:Ie(Cs),rightIris:Ie(Ws),faceOval:Ie(Ds)},Bs=Object.entries(Fs).map(([e,t])=>t.map(n=>[n,e])).flat(),Xa=new Map(Bs),L2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],e2=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],t2=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var q;function Hs(e,t){var o,r,s,A,a,l,c,x,i;if(!q.drawLabels||((o=q.faceLabels)==null?void 0:o.length)===0)return;let n=q.faceLabels.slice();if(n=Y(n,"[id]",e.id.toFixed(0)),e.score&&(n=Y(n,"[score]",100*e.score)),e.gender&&(n=Y(n,"[gender]",e.gender)),e.genderScore&&(n=Y(n,"[genderScore]",100*e.genderScore)),e.age&&(n=Y(n,"[age]",e.age)),e.distance&&(n=Y(n,"[distance]",100*e.distance)),e.real&&(n=Y(n,"[real]",100*e.real)),e.live&&(n=Y(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let y=e.emotion.map(d=>`${Math.trunc(100*d.score)}% ${d.emotion}`);y.length>3&&(y.length=3),n=Y(n,"[emotions]",y.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(n=Y(n,"[roll]",Je(e.rotation.angle.roll))),(a=(A=e.rotation)==null?void 0:A.angle)!=null&&a.yaw&&(n=Y(n,"[yaw]",Je(e.rotation.angle.yaw))),(c=(l=e.rotation)==null?void 0:l.angle)!=null&&c.pitch&&(n=Y(n,"[pitch]",Je(e.rotation.angle.pitch))),(i=(x=e.rotation)==null?void 0:x.gaze)!=null&&i.bearing&&(n=Y(n,"[gaze]",Je(e.rotation.gaze.bearing))),re(t,n,e.box[0],e.box[1],q)}function Gs(e,t){var n,o,r,s;if((n=e.annotations)!=null&&n.leftEyeIris&&((o=e.annotations)!=null&&o.leftEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,a=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,a=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}}function Vs(e,t){var n;if(q.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let o=e.box[0]+e.box[2]/2-e.box[3]*Je(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*Je(e.rotation.angle.pitch)/90,s=new Path2D(` M ${e.box[0]+e.box[2]/2} ${e.box[1]} C ${o} ${e.box[1]}, @@ -118,7 +118,7 @@ live: [live]% [emotions] roll: [roll]\xB0 yaw:[yaw]\xB0 pitch:[pitch]\xB0 - gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var a5=0;function Ys(e,t,n){let o=a0(f0,n);if(!t||!e)return;let r=oe(e);if(r){r.lineJoin="round",r.font=o.font;for(let s=0;sc5,kpt:()=>l5});var l5=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],c5={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var D=G(H());var se,n2=224,$1,Qs=5,rt=[8,16,32,32,32];function _s(){let e=[],t=0;for(;tn.x)),y:D.tensor1d(e.map(n=>n.y))}}async function e3(e){if(R.initial&&(se=null),!se&&e.body.detector&&e.body.detector.modelPath){se=await L(e.body.detector.modelPath);let t=se!=null&&se.executor?Object.values(se.modelSignature.inputs):void 0;n2=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&se&&h("cached model:",se.modelUrl);return _s(),se}var _1=[5,5];function $s(e,t){return D.tidy(()=>{let n=D.split(e,12,1),o=D.squeeze(n[0]),r=D.squeeze(n[1]),s=D.squeeze(n[2]),A=D.squeeze(n[3]);o=D.add(D.div(o,n2),t.x),r=D.add(D.div(r,n2),t.y),s=D.mul(D.div(s,n2),_1[0]),A=D.mul(D.div(A,n2),_1[1]);let a=D.sub(o,D.div(s,2)),l=D.sub(r,D.div(A,2)),c=D.add(a,s),x=D.add(l,A);return D.stack([a,l,c,x],1)})}async function eA(e,t,n,o){var c,x;let r=[],s={};s.boxes=$s(e,$1),s.scores=D.sigmoid(t),s.nms=await D.image.nonMaxSuppressionAsync(s.boxes,s.scores,1,((c=n.body.detector)==null?void 0:c.minConfidence)||.1,((x=n.body.detector)==null?void 0:x.iouThreshold)||.1);let A=await s.nms.data(),a=await s.scores.data(),l=await s.boxes.array();for(let i of Array.from(A)){let f=a[i],d=l[i],m=[Math.round(d[0]*o[0]),Math.round(d[1]*o[1]),Math.round(d[2]*o[0]),Math.round(d[3]*o[1])],y={score:f,boxRaw:d,box:m};r.push(y)}return Object.keys(s).forEach(i=>D.dispose(s[i])),r}async function t3(e,t,n){let o={};o.res=se==null?void 0:se.execute(e,["Identity"]),o.logitsRaw=D.slice(o.res,[0,0,0],[1,-1,1]),o.boxesRaw=D.slice(o.res,[0,0,1],[1,-1,-1]),o.logits=D.squeeze(o.logitsRaw),o.boxes=D.squeeze(o.boxesRaw);let r=await eA(o.boxes,o.logits,t,n);return Object.keys(o).forEach(s=>D.dispose(o[s])),r}function Le(e,t=[1,1]){let n=[e.map(a=>a[0]),e.map(a=>a[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[o[0],o[1],r[0]-o[0],r[1]-o[1]],A=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:A}}function n3(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[(o[0]+r[0])/2,(o[1]+r[1])/2],A=Math.max(s[0]-o[0],s[1]-o[1],-s[0]+r[0],-s[1]+r[1]),a=[Math.trunc(s[0]-A),Math.trunc(s[1]-A),Math.trunc(2*A),Math.trunc(2*A)],l=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:l}}function st(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var Z0,x5=256,d5=Number.MAX_SAFE_INTEGER,tA={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},at=[],Oe=[[0,0],[0,0],[0,0],[0,0]],o3=0,r3=e=>1-1/(1+Math.exp(e)),A3=e=>e3(e);async function a3(e){if(R.initial&&(Z0=null),Z0)e.debug&&h("cached model:",Z0.modelUrl);else{Z0=await L(e.body.modelPath);let t=Z0!=null&&Z0.executor?Object.values(Z0.modelSignature.inputs):void 0;x5=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Z0}function s3(e,t,n){var s,A;let o={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((A=e==null?void 0:e.shape)!=null&&A[2]))return e;let r;if(n&&(o.cropped=X0.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let a=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Oe=[[0,0],a,l,[0,0]],o.pad=X0.pad(o.cropped||e,Oe),o.resize=X0.image.resizeBilinear(o.pad,[t,t]),r=X0.div(o.resize,C.tf255)}else e.shape[1]!==t?(o.resize=X0.image.resizeBilinear(o.cropped||e,[t,t]),r=X0.div(o.resize,C.tf255)):r=X0.div(o.cropped||e,C.tf255);return Object.keys(o).forEach(a=>X0.dispose(o[a])),r}function nA(e,t,n){for(let o of e)o.position=[Math.trunc(o.position[0]*(t[0]+Oe[2][0]+Oe[2][1])/t[0]-Oe[2][0]),Math.trunc(o.position[1]*(t[1]+Oe[1][0]+Oe[1][1])/t[1]-Oe[1][0]),o.position[2]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1],2*o.position[2]/(t[0]+t[1])];if(n){let o=n[2]-n[0],r=n[3]-n[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+n[1],s.positionRaw[1]/o+n[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function oA(e){let t=e.find(a=>a.part==="leftPalm"),n=e.find(a=>a.part==="leftWrist"),o=e.find(a=>a.part==="leftIndex");t.position[2]=((n.position[2]||0)+(o.position[2]||0))/2;let r=e.find(a=>a.part==="rightPalm"),s=e.find(a=>a.part==="rightWrist"),A=e.find(a=>a.part==="rightIndex");r.position[2]=((s.position[2]||0)+(A.position[2]||0))/2}async function rA(e,t,n){if(!(Z0!=null&&Z0.executor))return null;let o={};[o.ld,o.segmentation,o.heatmap,o.world,o.poseflag]=Z0==null?void 0:Z0.execute(e,tA.landmarks);let r=(await o.poseflag.data())[0],s=await o.ld.data(),A=await o.world.data();Object.keys(o).forEach(m=>X0.dispose(o[m]));let a=[],l=5;for(let m=0;mm.position),i=Le(x,[n[0],n[1]]),f={};for(let[m,y]of Object.entries(c5)){let u=[];for(let T=0;Tb.part===y[T]),p=c.find(b=>b.part===y[T+1]);g&&p&&u.push([g.position,p.position])}f[m]=u}return{id:0,score:Math.trunc(100*r)/100,box:i.box,boxRaw:i.boxRaw,keypoints:c,annotations:f}}async function y5(e,t){var s,A,a;let n=[e.shape[2]||0,e.shape[1]||0],o=(t.body.skipTime||0)>v()-o3,r=d5<(t.body.skipFrames||0);if(t.skipAllowed&&o&&r&&at!==null)d5++;else{let l=[];if((A=(s=t.body)==null?void 0:s.detector)!=null&&A.enabled){let c=s3(e,224);l=await t3(c,t,n),X0.dispose(c)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let c=0;cF0.dispose(o[c])),r}async function p5(e,t){if(!(q0!=null&&q0.executor))return[];let n=(t.object.skipTime||0)>v()-l3,o=m5<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&f5.length>0?(m5++,f5):(m5=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=F0.image.resizeBilinear(e,[o2,o2]),a=t.object.enabled?q0==null?void 0:q0.execute(A,["tower_0/detections"]):null;l3=v(),F0.dispose(A);let l=await sA(a,s,t);f5=l,r(l)}))}var J=G(H());var it={};ze(it,{connected:()=>h5,kpt:()=>u5});var u5=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],h5={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var i0,x3=0,B0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},b5=Number.MAX_SAFE_INTEGER;async function y3(e){return R.initial&&(i0=null),i0?e.debug&&h("cached model:",i0.modelUrl):i0=await L(e.body.modelPath),i0}async function AA(e,t){let[n,o]=e.shape,r=J.reshape(e,[o*n]),s=J.max(r,0),A=(await s.data())[0];if(A>t){let a=J.argMax(r,0),l=J.mod(a,n),c=(await l.data())[0],x=J.div(a,n),i=(await x.data())[0];return J.dispose([r,s,a,l,x]),[c,i,A]}return J.dispose([r,s]),[0,0,A]}async function g5(e,t){if(!(i0!=null&&i0.executor)||!(i0!=null&&i0.inputs[0].shape))return[];let n=(t.body.skipTime||0)>v()-x3,o=b5<(t.body.skipFrames||0);return t.skipAllowed&&n&&o&&Object.keys(B0.keypoints).length>0?(b5++,[B0]):(b5=0,new Promise(async r=>{let s=J.tidy(()=>{var m,y;let i=J.image.resizeBilinear(e,[((m=i0==null?void 0:i0.inputs[0].shape)==null?void 0:m[2])||0,((y=i0==null?void 0:i0.inputs[0].shape)==null?void 0:y[1])||0],!1),f=J.mul(i,C.tf2);return J.sub(f,C.tf1)}),A;if(t.body.enabled&&(A=i0==null?void 0:i0.execute(s)),x3=v(),J.dispose(s),A){B0.keypoints.length=0;let i=J.squeeze(A);J.dispose(A);let f=J.unstack(i,2);J.dispose(i);for(let d=0;d(t.body.minConfidence||0)&&B0.keypoints.push({score:Math.round(100*u)/100,part:u5[d],positionRaw:[m/i0.inputs[0].shape[2],y/i0.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/i0.inputs[0].shape[2]),Math.round(e.shape[1]*y/i0.inputs[0].shape[1])]})}f.forEach(d=>J.dispose(d))}B0.score=B0.keypoints.reduce((i,f)=>f.score>i?f.score:i,0);let a=B0.keypoints.map(i=>i.position[0]),l=B0.keypoints.map(i=>i.position[1]);B0.box=[Math.min(...a),Math.min(...l),Math.max(...a)-Math.min(...a),Math.max(...l)-Math.min(...l)];let c=B0.keypoints.map(i=>i.positionRaw[0]),x=B0.keypoints.map(i=>i.positionRaw[1]);B0.boxRaw=[Math.min(...c),Math.min(...x),Math.max(...c)-Math.min(...c),Math.max(...x)-Math.min(...x)];for(let[i,f]of Object.entries(h5)){let d=[];for(let m=0;mT.part===f[m]),u=B0.keypoints.find(T=>T.part===f[m+1]);y&&u&&y.score>(t.body.minConfidence||0)&&u.score>(t.body.minConfidence||0)&&d.push([y.position,u.position])}B0.annotations[i]=d}r([B0])}))}var l0=G(H());var De=G(H());var O=G(H());var Me=G(H());var p2=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],lt=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],ct=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],dt=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],u3=(e,t,n)=>{let o=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(A=>[(A[0]+n[0])*t[0],(A[1]+n[1])*t[1]]);return{startPoint:o,endPoint:r,landmarks:s,confidence:e.confidence}},T5=(e,t,n)=>{let o=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/o,e.startPoint[0]/r,e.endPoint[1]/o,e.endPoint[0]/r],A=Me.image.cropAndResize(t,[s],[0],n),a=Me.div(A,C.tf255);return Me.dispose(A),a},xt=(e,t)=>{let n=lt(e),o=p2(e),r=[t*o[0]/2,t*o[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:o}},yt=e=>{let t=lt(e),n=p2(e),o=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-o),Math.round(t[1]-o)],endPoint:[Math.round(t[0]+o),Math.round(t[1]+o)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},h3=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},v5=[[1,0,0],[0,1,0],[0,0,1]],aA=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),iA=(e,t)=>aA(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var m3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],r2=(e,t)=>{let n=0;for(let o=0;o{let n=[];for(let o=0;o{let n=[],o=e.length;for(let r=0;r{let n=Math.cos(e),o=Math.sin(e),r=[[n,-o,0],[o,n,0],[0,0,1]],s=m3(t[0],t[1]),A=p3(s,r),a=m3(-t[0],-t[1]);return p3(A,a)},cA=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],o=[-r2(t[0],n),-r2(t[1],n)];return[t[0].concat(o[0]),t[1].concat(o[1]),[0,0,1]]},dA=(e,t)=>[r2(e,t[0]),r2(e,t[1])];function g3(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let o=0;o[s[0]/r*(d[0]-r/2),s[1]/r*(d[1]-r/2),d[2]||0]),a=n&&n!==0&&Math.abs(n)>.2,l=a?b3(n,[0,0]):v5,c=a?A.map(d=>[...dA(d,l),d[2]]):A,x=a?cA(o):v5,i=lt(t),f=[r2(i,x[0]),r2(i,x[1])];return c.map(d=>[Math.trunc(d[0]+f[0]),Math.trunc(d[1]+f[1]),Math.trunc(d[2]||0)])}function v3(e,t,n,o){let r=t.landmarks.length>=r5.count?r5.symmetryLine:_e.symmetryLine,s=0,A=v5,a;if(e&&R.kernels.includes("rotatewithoffset"))if(s=iA(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let c=lt(t),x=[c[0]/n.shape[2],c[1]/n.shape[1]],i=Me.image.rotateWithOffset(n,s,0,[x[0],x[1]]);A=b3(-s,c),a=T5(t,i,[o,o]),Me.dispose(i)}else a=T5(t,n,[o,o]);else a=T5(t,n,[o,o]);return[s,A,a]}var xA=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},R3=(e,t)=>{let n=xA(e),o=p2(t);return{startPoint:[n[0]-o[0]/2,n[1]-o[1]/2],endPoint:[n[0]+o[0]/2,n[1]+o[1]/2]}};var M3=6,yA=1.4,xe,ft=null,Ce=0,u2=null,P3=()=>Ce;async function k3(e){var t;return R.initial&&(xe=null),xe?e.debug&&h("cached model:",xe.modelUrl):xe=await L((t=e.face.detector)==null?void 0:t.modelPath),Ce=xe.executor&&xe.inputs[0].shape?xe.inputs[0].shape[2]:256,u2=O.scalar(Ce,"int32"),ft=O.tensor2d(g3(Ce)),xe}function fA(e){if(!ft||!u2)return O.zeros([0,0]);let t={};t.boxStarts=O.slice(e,[0,1],[-1,2]),t.centers=O.add(t.boxStarts,ft),t.boxSizes=O.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=O.div(t.boxSizes,u2),t.centersNormalized=O.div(t.centers,u2),t.halfBoxSize=O.div(t.boxSizesNormalized,C.tf2),t.starts=O.sub(t.centersNormalized,t.halfBoxSize),t.ends=O.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=O.mul(t.starts,u2),t.endNormalized=O.mul(t.ends,u2);let n=O.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(o=>O.dispose(t[o])),n}async function w3(e,t){var a,l,c,x,i,f;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=O.image.resizeBilinear(e,[Ce,Ce]),n.div=O.div(n.resized,C.tf127),n.normalized=O.sub(n.div,C.tf05);let o=xe==null?void 0:xe.execute(n.normalized);if(Array.isArray(o)&&o.length>2){let d=o.sort((m,y)=>m.size-y.size);n.concat384=O.concat([d[0],d[2]],2),n.concat512=O.concat([d[1],d[3]],2),n.concat=O.concat([n.concat512,n.concat384],1),n.batch=O.squeeze(n.concat,[0])}else Array.isArray(o)?n.batch=O.squeeze(o[0]):n.batch=O.squeeze(o);O.dispose(o),n.boxes=fA(n.batch),n.logits=O.slice(n.batch,[0,0],[-1,1]),n.sigmoid=O.sigmoid(n.logits),n.scores=O.squeeze(n.sigmoid),n.nms=await O.image.nonMaxSuppressionAsync(n.boxes,n.scores,((a=t.face.detector)==null?void 0:a.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),s=[],A=await n.scores.data();for(let d=0;d(((x=t.face.detector)==null?void 0:x.minConfidence)||0)){let y={};y.bbox=O.slice(n.boxes,[r[d],0],[1,-1]),y.slice=O.slice(n.batch,[r[d],M3-1],[1,-1]),y.squeeze=O.squeeze(y.slice),y.landmarks=O.reshape(y.squeeze,[M3,-1]);let u=await y.bbox.data(),T={startPoint:[u[0],u[1]],endPoint:[u[2],u[3]],landmarks:await y.landmarks.array(),confidence:m};y.anchor=O.slice(ft,[r[d],0],[1,2]);let g=await y.anchor.data(),p=u3(T,[(e.shape[2]||0)/Ce,(e.shape[1]||0)/Ce],g),b=xt(p,t.face.scale||yA),k=yt(b);k.size[0]>(((i=t.face.detector)==null?void 0:i.minSize)||0)&&k.size[1]>(((f=t.face.detector)==null?void 0:f.minSize)||0)&&s.push(k),Object.keys(y).forEach(P=>O.dispose(y[P]))}}return Object.keys(n).forEach(d=>O.dispose(n[d])),s}var ye=G(H());var K0,We=0,mA=2.3,M5=ae.leftEyeLower0,P5=ae.rightEyeLower0,h2={leftBounds:[M5[0],M5[M5.length-1]],rightBounds:[P5[0],P5[P5.length-1]]},b2={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function I3(e){var t,n;return R.initial&&(K0=null),K0?e.debug&&h("cached model:",K0.modelUrl):K0=await L((t=e.face.iris)==null?void 0:t.modelPath),We=K0!=null&&K0.executor&&((n=K0.inputs)!=null&&n[0].shape)?K0.inputs[0].shape[2]:0,We===-1&&(We=64),K0}function mt(e,t,n,o){for(let r=0;r{let t=e[h2.leftBounds[0]][2],n=e[h2.rightBounds[0]][2];return t-n},z3=(e,t,n,o,r,s=!1)=>{let A=yt(xt(h3([e[n],e[o]]),mA)),a=p2(A),l=ye.image.cropAndResize(t,[[A.startPoint[1]/r,A.startPoint[0]/r,A.endPoint[1]/r,A.endPoint[0]/r]],[0],[We,We]);if(s&&R.kernels.includes("flipleftright")){let c=ye.image.flipLeftRight(l);ye.dispose(l),l=c}return{box:A,boxSize:a,crop:l}},S3=(e,t,n,o=!1)=>{let r=[];for(let s=0;s{let o=e[ae[`${n}EyeUpper0`][b2.upperCenter]][2],r=e[ae[`${n}EyeLower0`][b2.lowerCenter]][2],s=(o+r)/2;return t.map((A,a)=>{let l=s;return a===2?l=o:a===4&&(l=r),[A[0],A[1],l]})};async function N3(e,t,n){if(!(K0!=null&&K0.executor))return e;let{box:o,boxSize:r,crop:s}=z3(e,t,h2.leftBounds[0],h2.leftBounds[1],n,!0),{box:A,boxSize:a,crop:l}=z3(e,t,h2.rightBounds[0],h2.rightBounds[1],n,!0),c=ye.concat([s,l]);ye.dispose(s),ye.dispose(l);let x=K0.execute(c);ye.dispose(c);let i=await x.data();ye.dispose(x);let f=i.slice(0,b2.numCoordinates*3),{rawCoords:d,iris:m}=S3(f,o,r,!0),y=i.slice(b2.numCoordinates*3),{rawCoords:u,iris:T}=S3(y,A,a,!1),g=pA(e);Math.abs(g)<30?(mt(e,d,"left",null),mt(e,u,"right",null)):g<1?mt(e,d,"left",["EyeUpper0","EyeLower0"]):mt(e,u,"right",["EyeUpper0","EyeLower0"]);let p=j3(e,m,"left"),b=j3(e,T,"right");return e.concat(p).concat(b)}async function O3(e,t){var s,A,a,l,c,x,i,f,d,m;let n={lips:await((A=(s=t.filter(y=>y.size===160))==null?void 0:s[0])==null?void 0:A.data()),irisL:await((l=(a=t.filter(y=>y.size===10))==null?void 0:a[0])==null?void 0:l.data()),eyeL:await((x=(c=t.filter(y=>y.size===142))==null?void 0:c[0])==null?void 0:x.data()),irisR:await((f=(i=t.filter(y=>y.size===10))==null?void 0:i[1])==null?void 0:f.data()),eyeR:await((m=(d=t.filter(y=>y.size===142))==null?void 0:d[1])==null?void 0:m.data())};for(let y of Object.values(n))if(!y)return e;let o=e2.reduce((y,u)=>y+=e[u][2],0)/e2.length;for(let y=0;yy+=e[u][2],0)/t2.length;for(let y=0;yv()-ge.timestamp,o=ge.skipped<(((c=t.face.detector)==null?void 0:c.skipFrames)||0);!t.skipAllowed||!n||!o||ge.boxes.length===0?(ge.boxes=await w3(e,t),ge.timestamp=v(),ge.skipped=0):ge.skipped++;let r=[],s=[],A=0,a=O2;for(let g=0;g[N[0]/(e.shape[2]||0),N[1]/(e.shape[1]||0),(N[2]||0)/a]);for(let N of Object.keys(_e))P.annotations[N]=[P.mesh[_e[N]]]}else if(!r0)t.debug&&h("face mesh detection requested, but model is not loaded");else{if((d=t.face.attention)!=null&&d.enabled&&!R.kernels.includes("atan2"))return t.face.attention.enabled=!1,De.dispose(P.tensor),r;let N=r0.execute(P.tensor),_=await N.find(Z=>Z.shape[Z.shape.length-1]===1).data();if(P.faceScore=Math.round(100*_[0])/100,P.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(p.confidence=P.faceScore,t.face.mesh.keepInvalid){P.box=ct(p,e),P.boxRaw=dt(p,e),P.size=p.size,P.score=P.boxScore,P.mesh=p.landmarks,P.meshRaw=P.mesh.map(Z=>[Z[0]/(e.shape[2]||1),Z[1]/(e.shape[1]||1),(Z[2]||0)/a]);for(let Z of Object.keys(_e))P.annotations[Z]=[P.mesh[_e[Z]]]}}else{let Z=N.find(n0=>n0.shape[n0.shape.length-1]===1404),$=De.reshape(Z,[-1,3]),A0=await $.array();De.dispose($),(y=t.face.attention)!=null&&y.enabled?A0=await O3(A0,N):(u=t.face.iris)!=null&&u.enabled&&(A0=await N3(A0,P.tensor,O2)),P.mesh=T3(A0,p,b,k,O2),P.meshRaw=P.mesh.map(n0=>[n0[0]/(e.shape[2]||0),n0[1]/(e.shape[1]||0),(n0[2]||0)/a]);for(let n0 of Object.keys(ae))P.annotations[n0]=ae[n0].map(j0=>P.mesh[j0]);P.score=P.faceScore;let t0={...R3(P.mesh,p),confidence:p.confidence,landmarks:p.landmarks,size:p.size};P.box=ct(t0,e),P.boxRaw=dt(t0,e),P.size=t0.size,s.push(t0)}De.dispose(N)}P.score>(((T=t.face.detector)==null?void 0:T.minConfidence)||1)?r.push(P):De.dispose(P.tensor)}return ge.boxes=s,r}async function W3(e){var t,n,o,r,s,A;return R.initial&&(r0=null),(t=e.face.attention)!=null&&t.enabled&&(r0!=null&&r0.signature)&&Object.keys(((n=r0==null?void 0:r0.signature)==null?void 0:n.outputs)||{}).length<6&&(r0=null),r0?e.debug&&h("cached model:",r0.modelUrl):(o=e.face.attention)!=null&&o.enabled?r0=await L(e.face.attention.modelPath):r0=await L((r=e.face.mesh)==null?void 0:r.modelPath),O2=r0.executor&&((s=r0==null?void 0:r0.inputs)!=null&&s[0].shape)?(A=r0==null?void 0:r0.inputs)==null?void 0:A[0].shape[2]:256,r0}var D3=$e,F3=N2;var J0=G(H());var E5=[],P0,pt=[],B3=0,H3=0,w5=Number.MAX_SAFE_INTEGER,z5=!1;async function G3(e){var t,n,o;return R.initial&&(P0=null),P0?e.debug&&h("cached model:",P0.modelUrl):(P0=await L((t=e.face.emotion)==null?void 0:t.modelPath),z5=((o=(n=P0==null?void 0:P0.inputs)==null?void 0:n[0].shape)==null?void 0:o[3])===3,z5?E5=["angry","disgust","fear","happy","neutral","sad","surprise"]:E5=["angry","disgust","fear","happy","sad","surprise","neutral"]),P0}async function S5(e,t,n,o){var A,a;if(!P0)return[];let r=w5<(((A=t.face.emotion)==null?void 0:A.skipFrames)||0),s=(((a=t.face.emotion)==null?void 0:a.skipTime)||0)>v()-H3;return t.skipAllowed&&s&&r&&B3===o&&pt[n]&&pt[n].length>0?(w5++,pt[n]):(w5=0,new Promise(async l=>{var x,i,f;let c=[];if((x=t.face.emotion)!=null&&x.enabled){let d={},m=P0!=null&&P0.inputs[0].shape?P0.inputs[0].shape[2]:0;if(((i=t.face.emotion)==null?void 0:i.crop)>0){let u=(f=t.face.emotion)==null?void 0:f.crop,T=[[u,u,1-u,1-u]];d.resize=J0.image.cropAndResize(e,T,[0],[m,m])}else d.resize=J0.image.resizeBilinear(e,[m,m],!1);z5?(d.mul=J0.mul(d.resize,255),d.normalize=J0.sub(d.mul,[103.939,116.779,123.68]),d.emotion=P0==null?void 0:P0.execute(d.normalize)):(d.channels=J0.mul(d.resize,C.rgb),d.grayscale=J0.sum(d.channels,3,!0),d.grayscaleSub=J0.sub(d.grayscale,C.tf05),d.grayscaleMul=J0.mul(d.grayscaleSub,C.tf2),d.emotion=P0==null?void 0:P0.execute(d.grayscaleMul)),H3=v();let y=await d.emotion.data();for(let u=0;u(t.face.emotion.minConfidence||0)&&c.push({score:Math.min(.99,Math.trunc(100*y[u])/100),emotion:E5[u]});c.sort((u,T)=>T.score-u.score),Object.keys(d).forEach(u=>J0.dispose(d[u]))}pt[n]=c,B3=o,l(c)}))}var ie=G(H());var k0,Fe=[],Z3=0,X3=0,j5=Number.MAX_SAFE_INTEGER;async function q3(e){var t;return R.initial&&(k0=null),k0?e.debug&&h("cached model:",k0.modelUrl):k0=await L((t=e.face.description)==null?void 0:t.modelPath),k0}function hA(e,t){var s,A;let n=e.image||e.tensor||e;if(!(k0!=null&&k0.inputs[0].shape))return n;let o;if(((s=t.face.description)==null?void 0:s.crop)>0){let a=(A=t.face.description)==null?void 0:A.crop,l=[[a,a,1-a,1-a]];o=ie.image.cropAndResize(n,l,[0],[k0.inputs[0].shape[2],k0.inputs[0].shape[1]])}else o=ie.image.resizeBilinear(n,[k0.inputs[0].shape[2],k0.inputs[0].shape[1]],!1);let r=ie.mul(o,C.tf255);return ie.dispose(o),r}async function I5(e,t,n,o){var a,l,c,x;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(k0!=null&&k0.executor))return r;let s=j5<(((a=t.face.description)==null?void 0:a.skipFrames)||0),A=(((l=t.face.description)==null?void 0:l.skipTime)||0)>v()-Z3;return t.skipAllowed&&s&&A&&X3===o&&((c=Fe==null?void 0:Fe[n])==null?void 0:c.age)>0&&((x=Fe==null?void 0:Fe[n])==null?void 0:x.genderScore)>0?(j5++,Fe[n]):(j5=0,new Promise(async i=>{var f;if((f=t.face.description)!=null&&f.enabled){let d=hA(e,t),m=k0==null?void 0:k0.execute(d);Z3=v(),ie.dispose(d);let u=await m.find(V=>V.shape[1]===1).data(),T=Math.trunc(200*Math.abs(u[0]-.5))/100;T>(t.face.description.minConfidence||0)&&(r.gender=u[0]<=.5?"female":"male",r.genderScore=Math.min(.99,T));let g=ie.argMax(m.find(V=>V.shape[1]===100),1),p=(await g.data())[0];ie.dispose(g);let k=await m.find(V=>V.shape[1]===100).data();r.age=Math.round(k[p-1]>k[p+1]?10*p-100*k[p-1]:10*p+100*k[p+1])/10,(Number.isNaN(u[0])||Number.isNaN(k[0]))&&h("faceres error:",{model:k0,result:m});let P=m.find(V=>V.shape[1]===1024),N=P?await P.data():[];r.descriptor=Array.from(N),m.forEach(V=>ie.dispose(V))}Fe[n]=r,X3=o,i(r)}))}var g2=.1,N5=.5;function bA(e,t,n){let o=!1,r=n.length-1;for(let s=0;st!=n[r].y>t&&e<(n[r].x-n[s].x)*(t-n[s].y)/(n[r].y-n[s].y)+n[s].x&&(o=!o);return o}async function Y3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,o=await e.tensor.buffer(),r=[];for(let A of ae.silhouette)r.push({x:(e.mesh[A][0]-e.box[0])/e.box[2],y:(e.mesh[A][1]-e.box[1])/e.box[3]});g2&&g2>0&&(r=r.map(A=>({x:A.x>.5?A.x+g2:A.x-g2,y:A.y>.5?A.y+g2:A.y-g2})));for(let A=0;Av()-J3,s=L5<(((a=t.face.antispoof)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&K3===o&&ut[n]?(L5++,ut[n]):(L5=0,new Promise(async l=>{let c=ht.image.resizeBilinear(e,[w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[2]:0,w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[1]:0],!1),x=w0==null?void 0:w0.execute(c),i=(await x.data())[0];ut[n]=Math.round(100*i)/100,K3=o,J3=v(),ht.dispose([c,x]),l(ut[n])}))}var gt=G(H());var E0,bt=[],C5=Number.MAX_SAFE_INTEGER,$3=0,en=0;async function tn(e){var t;return R.initial&&(E0=null),E0?e.debug&&h("cached model:",E0.modelUrl):E0=await L((t=e.face.liveness)==null?void 0:t.modelPath),E0}async function W5(e,t,n,o){var A,a;if(!(E0!=null&&E0.executor))return 0;let r=(((A=t.face.liveness)==null?void 0:A.skipTime)||0)>v()-en,s=C5<(((a=t.face.liveness)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&$3===o&&bt[n]?(C5++,bt[n]):(C5=0,new Promise(async l=>{let c=gt.image.resizeBilinear(e,[E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[2]:0,E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[1]:0],!1),x=E0==null?void 0:E0.execute(c),i=(await x.data())[0];bt[n]=Math.round(100*i)/100,$3=o,en=v(),gt.dispose([c,x]),l(bt[n])}))}var Tt=G(H());var le,D5=[],TA=["white","black","asian","indian","other"],vA=[15,23,28,35.5,45.5,55.5,65],on=0,rn=0,F5=Number.MAX_SAFE_INTEGER;async function sn(e){var t;return R.initial&&(le=null),le?e.debug&&h("cached model:",le.modelUrl):le=await L((t=e.face.gear)==null?void 0:t.modelPath),le}async function B5(e,t,n,o){var A,a;if(!le)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=F5<(((A=t.face.gear)==null?void 0:A.skipFrames)||0),s=(((a=t.face.gear)==null?void 0:a.skipTime)||0)>v()-rn;return t.skipAllowed&&s&&r&&on===o&&D5[n]?(F5++,D5[n]):(F5=0,new Promise(async l=>{var T,g,p,b;if(!(le!=null&&le.inputs[0].shape))return;let c={},x=[[0,.1,.9,.9]];if(((T=t.face.gear)==null?void 0:T.crop)>0){let k=(g=t.face.gear)==null?void 0:g.crop;x=[[k,k,1-k,1-k]]}c.resize=Tt.image.cropAndResize(e,x,[0],[le.inputs[0].shape[2],le.inputs[0].shape[1]]);let i={age:0,gender:"unknown",genderScore:0,race:[]};(p=t.face.gear)!=null&&p.enabled&&([c.age,c.gender,c.race]=le.execute(c.resize,["age_output","gender_output","race_output"]));let f=await c.gender.data();i.gender=f[0]>f[1]?"male":"female",i.genderScore=Math.round(100*(f[0]>f[1]?f[0]:f[1]))/100;let d=await c.race.data();for(let k=0;k(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&i.race.push({score:Math.round(100*d[k])/100,race:TA[k]});i.race.sort((k,P)=>P.score-k.score);let y=Array.from(await c.age.data()).map((k,P)=>[vA[P],k]).sort((k,P)=>P[1]-k[1]),u=y[0][0];for(let k=1;kTt.dispose(c[k])),D5[n]=i,on=o,rn=v(),l(i)}))}var s2=G(H());var H0,vt=[],an=0,ln=0,H5=Number.MAX_SAFE_INTEGER;async function cn(e){return R.initial&&(H0=null),H0?e.debug&&h("cached model:",H0.modelUrl):H0=await L(e.face.ssrnet.modelPathAge),H0}async function G5(e,t,n,o){var A,a,l,c;if(!H0)return{age:0};let r=H5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-ln;return t.skipAllowed&&r&&s&&an===o&&((l=vt[n])!=null&&l.age)&&((c=vt[n])==null?void 0:c.age)>0?(H5++,vt[n]):(H5=0,new Promise(async x=>{var d,m,y;if(!(H0!=null&&H0.inputs)||!H0.inputs[0]||!H0.inputs[0].shape)return;let i={};if(((d=t.face.ssrnet)==null?void 0:d.crop)>0){let u=(m=t.face.ssrnet)==null?void 0:m.crop,T=[[u,u,1-u,1-u]];i.resize=s2.image.cropAndResize(e,T,[0],[H0.inputs[0].shape[2],H0.inputs[0].shape[1]])}else i.resize=s2.image.resizeBilinear(e,[H0.inputs[0].shape[2],H0.inputs[0].shape[1]],!1);i.enhance=s2.mul(i.resize,C.tf255);let f={age:0};if((y=t.face.ssrnet)!=null&&y.enabled&&(i.age=H0.execute(i.enhance)),i.age){let u=await i.age.data();f.age=Math.trunc(10*u[0])/10}Object.keys(i).forEach(u=>s2.dispose(i[u])),vt[n]=f,an=o,ln=v(),x(f)}))}var v0=G(H());var N0,Rt=[],xn=0,yn=0,V5=Number.MAX_SAFE_INTEGER,Z5=[.2989,.587,.114];async function fn(e){var t;return R.initial&&(N0=null),N0?e.debug&&h("cached model:",N0.modelUrl):N0=await L((t=e.face.ssrnet)==null?void 0:t.modelPathGender),N0}async function X5(e,t,n,o){var A,a,l,c;if(!N0)return{gender:"unknown",genderScore:0};let r=V5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-yn;return t.skipAllowed&&r&&s&&xn===o&&((l=Rt[n])!=null&&l.gender)&&((c=Rt[n])==null?void 0:c.genderScore)>0?(V5++,Rt[n]):(V5=0,new Promise(async x=>{var m,y,u;if(!(N0!=null&&N0.inputs[0].shape))return;let i={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let T=(y=t.face.ssrnet)==null?void 0:y.crop,g=[[T,T,1-T,1-T]];i.resize=v0.image.cropAndResize(e,g,[0],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]])}else i.resize=v0.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]],!1);i.enhance=v0.tidy(()=>{var g,p;let T;if(((p=(g=N0==null?void 0:N0.inputs)==null?void 0:g[0].shape)==null?void 0:p[3])===1){let[b,k,P]=v0.split(i.resize,3,3),N=v0.mul(b,Z5[0]),V=v0.mul(k,Z5[1]),_=v0.mul(P,Z5[2]),Z=v0.addN([N,V,_]);T=v0.mul(v0.sub(Z,C.tf05),2)}else T=v0.mul(v0.sub(i.resize,C.tf05),2);return T});let f={gender:"unknown",genderScore:0};(u=t.face.ssrnet)!=null&&u.enabled&&(i.gender=N0.execute(i.enhance));let d=await i.gender.data();f.gender=d[0]>d[1]?"female":"male",f.genderScore=d[0]>d[1]?Math.trunc(100*d[0])/100:Math.trunc(100*d[1])/100,Object.keys(i).forEach(T=>v0.dispose(i[T])),Rt[n]=f,xn=o,yn=v(),x(f)}))}var Mt=G(H());var Q0,q5=[],pn=0,un=0,hn=Number.MAX_SAFE_INTEGER;async function bn(e){var t;return R.initial&&(Q0=null),Q0?e.debug&&h("cached model:",Q0.modelUrl):Q0=await L((t=e.face.mobilefacenet)==null?void 0:t.modelPath),Q0}async function U5(e,t,n,o){var A,a;if(!(Q0!=null&&Q0.executor))return[];let r=hn<(((A=t.face.mobilefacenet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.mobilefacenet)==null?void 0:a.skipTime)||0)>v()-un;return t.skipAllowed&&s&&r&&pn===o&&q5[n]?(hn++,q5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.mobilefacenet)!=null&&x.enabled&&(Q0!=null&&Q0.inputs[0].shape)){let i={};i.crop=Mt.image.resizeBilinear(e,[Q0.inputs[0].shape[2],Q0.inputs[0].shape[1]],!1),i.data=Q0.execute(i.crop);let f=await i.data.data();c=Array.from(f),Object.keys(i).forEach(d=>Mt.dispose(i[d]))}q5[n]=c,pn=o,un=v(),l(c)})}var Pt=G(H());var _0,Y5=[],Tn=0,vn=0,Rn=Number.MAX_SAFE_INTEGER;async function Mn(e){return R.initial&&(_0=null),_0?e.debug&&h("cached model:",_0.modelUrl):_0=await L(e.face.insightface.modelPath),_0}async function K5(e,t,n,o){var A,a;if(!(_0!=null&&_0.executor))return[];let r=Rn<(((A=t.face.insightface)==null?void 0:A.skipFrames)||0),s=(((a=t.face.insightface)==null?void 0:a.skipTime)||0)>v()-vn;return t.skipAllowed&&s&&r&&Tn===o&&Y5[n]?(Rn++,Y5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.insightface)!=null&&x.enabled&&(_0!=null&&_0.inputs[0].shape)){let i={};i.crop=Pt.image.resizeBilinear(e,[_0.inputs[0].shape[2],_0.inputs[0].shape[1]],!1),i.data=_0.execute(i.crop);let f=await i.data.data();c=Array.from(f),Object.keys(i).forEach(d=>Pt.dispose(i[d]))}Y5[n]=c,Tn=o,vn=v(),l(c)})}var RA=e=>{let t=(i,f)=>Math.atan2(i[1]-f[1],i[0]-f[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],o=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],A=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],a=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(A[0]-s[0])/a[0]-n[0],o*(s[1]-A[1])/a[1]-n[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return c=Math.min(c,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:c}},kn=(e,t)=>{let n=y=>{let u=Math.sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);return y[0]/=u,y[1]/=u,y[2]/=u,y},o=(y,u)=>{let T=y[0]-u[0],g=y[1]-u[1],p=y[2]-u[2];return[T,g,p]},r=(y,u)=>{let T=y[1]*u[2]-y[2]*u[1],g=y[2]*u[0]-y[0]*u[2],p=y[0]*u[1]-y[1]*u[0];return[T,g,p]},s=y=>{let[u,T,g,p,b,k,P,N,V]=y,_,Z,$;return p<1?p>-1?($=Math.asin(p),Z=Math.atan2(-P,u),_=Math.atan2(-k,b)):($=-Math.PI/2,Z=-Math.atan2(N,V),_=0):($=Math.PI/2,Z=Math.atan2(N,V),_=0),Number.isNaN(_)&&(_=0),Number.isNaN(Z)&&(Z=0),Number.isNaN($)&&($=0),{pitch:2*-_,yaw:2*-Z,roll:2*-$}},A=e.meshRaw;if(!A||A.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let a=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[A[10],A[152],A[234],A[454]].map(y=>[y[0]*t[0]/a,y[1]*t[1]/a,y[2]]),c=n(o(l[1],l[0])),x=n(o(l[3],l[2])),i=n(r(x,c));x=r(c,i);let f=[x[0],x[1],x[2],c[0],c[1],c[2],i[0],i[1],i[2]],d=s(f),m=A.length===478?RA(e):{bearing:0,strength:0};return{angle:d,matrix:f,gaze:m}};function wn(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let o=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/o)/100}var J5=async(e,t)=>{var m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;let n=v(),o,r,s,A,a,l,c,x,i,f=[];e.state="run:face";let d=await C3(t,e.config);if(e.performance.face=R.perfadd?(e.performance.face||0)+Math.trunc(v()-n):Math.trunc(v()-n),!t.shape||t.shape.length!==4)return[];if(!d)return[];for(let E=0;E200?kn(d[E],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?A=(y=e.config.face.emotion)!=null&&y.enabled?S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[]:(e.state="run:emotion",n=v(),A=(u=e.config.face.emotion)!=null&&u.enabled?await S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[],e.performance.emotion=R.perfadd?(e.performance.emotion||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?c=(T=e.config.face.antispoof)!=null&&T.enabled?O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:antispoof",n=v(),c=(g=e.config.face.antispoof)!=null&&g.enabled?await O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.antispoof=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?x=(p=e.config.face.liveness)!=null&&p.enabled?W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:liveness",n=v(),x=(b=e.config.face.liveness)!=null&&b.enabled?await W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.liveness=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(k=e.config.face.gear)!=null&&k.enabled?B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:gear",n=v(),r=(P=e.config.face.gear)!=null&&P.enabled?await B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.gear=Math.trunc(v()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(o=(N=e.config.face.ssrnet)!=null&&N.enabled?G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(V=e.config.face.ssrnet)!=null&&V.enabled?X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null):(e.state="run:ssrnet",n=v(),o=(_=e.config.face.ssrnet)!=null&&_.enabled?await G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(Z=e.config.face.ssrnet)!=null&&Z.enabled?await X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.ssrnet=Math.trunc(v()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?a=($=e.config.face.mobilefacenet)!=null&&$.enabled?U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),a=(A0=e.config.face.mobilefacenet)!=null&&A0.enabled?await U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(t0=e.config.face.insightface)!=null&&t0.enabled?K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),l=(n0=e.config.face.insightface)!=null&&n0.enabled?await K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?i=I5(d[E].tensor||l0.tensor([]),e.config,E,d.length):(e.state="run:description",n=v(),i=await I5(d[E].tensor||l0.tensor([]),e.config,E,d.length),e.performance.description=R.perfadd?(e.performance.description||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Description:"),e.config.async&&([o,s,A,a,l,i,r,c,x]=await Promise.all([o,s,A,a,l,i,r,c,x])),e.analyze("Finish Face:"),(j0=e.config.face.ssrnet)!=null&&j0.enabled&&o&&s&&(i={...i,age:o.age,gender:s.gender,genderScore:s.genderScore}),(M=e.config.face.gear)!=null&&M.enabled&&r&&(i={...i,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(T0=e.config.face.mobilefacenet)!=null&&T0.enabled&&a&&(i.descriptor=a),(C0=e.config.face.insightface)!=null&&C0.enabled&&l&&(i.descriptor=l);let X=(x0=e.config.face.iris)!=null&&x0.enabled?wn(d[E],t.shape[2]):0,U0=(K=e.config.face.detector)!=null&&K.return?l0.squeeze(d[E].tensor):null;l0.dispose(d[E].tensor),d[E].tensor&&delete d[E].tensor;let y0={...d[E],id:E};i.age&&(y0.age=i.age),i.gender&&(y0.gender=i.gender),i.genderScore&&(y0.genderScore=i.genderScore),i.descriptor&&(y0.embedding=i.descriptor),i.race&&(y0.race=i.race),A&&(y0.emotion=A),c&&(y0.real=c),x&&(y0.live=x),X>0&&(y0.distance=X),B&&(y0.rotation=B),U0&&(y0.tensor=U0),f.push(y0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),f};var G0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>G0.nameMapping[e],getPoints:e=>G0.pointsMapping[e]},He={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>He.nameMapping[e]},c0={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>c0.nameMapping[e]},Be=class{constructor(t){w(this,"name");w(this,"curls");w(this,"directions");w(this,"weights");w(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,o){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,o])}direction(t,n,o){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,o])}weight(t,n){this.weights[t]=n;let o=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/o)}matchAgainst(t,n){let o=0;for(let r in t){let s=t[r],A=this.curls[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}for(let r in n){let s=n[r],A=this.directions[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}return o/10}};var{thumb:fe,index:Pe,middle:ke,ring:A2,pinky:a2}=G0,{none:me,half:PA,full:pe}=He,{verticalUp:T2,verticalDown:Qi,horizontalLeft:Q5,horizontalRight:kA,diagonalUpRight:wA,diagonalUpLeft:v2,diagonalDownRight:_i,diagonalDownLeft:$i}=c0,Ge=new Be("thumbs up");Ge.curl(fe,me,1);Ge.direction(fe,T2,1);Ge.direction(fe,v2,.25);Ge.direction(fe,wA,.25);for(let e of[G0.index,G0.middle,G0.ring,G0.pinky])Ge.curl(e,pe,1),Ge.direction(e,Q5,1),Ge.direction(e,kA,1);var h0=new Be("victory");h0.curl(fe,PA,.5);h0.curl(fe,me,.5);h0.direction(fe,T2,1);h0.direction(fe,v2,1);h0.curl(Pe,me,1);h0.direction(Pe,T2,.75);h0.direction(Pe,v2,1);h0.curl(ke,me,1);h0.direction(ke,T2,1);h0.direction(ke,v2,.75);h0.curl(A2,pe,1);h0.direction(A2,T2,.2);h0.direction(A2,v2,1);h0.direction(A2,Q5,.2);h0.curl(a2,pe,1);h0.direction(a2,T2,.2);h0.direction(a2,v2,1);h0.direction(a2,Q5,.2);h0.weight(Pe,2);h0.weight(ke,2);var Ve=new Be("point");Ve.curl(fe,pe,1);Ve.curl(Pe,me,.5);Ve.curl(ke,pe,.5);Ve.curl(A2,pe,.5);Ve.curl(a2,pe,.5);Ve.weight(Pe,2);Ve.weight(ke,2);var Ze=new Be("middle finger");Ze.curl(fe,me,1);Ze.curl(Pe,pe,.5);Ze.curl(ke,pe,.5);Ze.curl(A2,pe,.5);Ze.curl(a2,pe,.5);Ze.weight(Pe,2);Ze.weight(ke,2);var R2=new Be("open palm");R2.curl(fe,me,.75);R2.curl(Pe,me,.75);R2.curl(ke,me,.75);R2.curl(A2,me,.75);R2.curl(a2,me,.75);var En=[Ge,h0,Ve,Ze,R2];var EA=.7,i2={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function zn(e,t,n,o){let r=(t-o)/(e-n),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function jn(e,t){if(!e||!t)return[0,0];let n=zn(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let o=zn(e[1],e[2],t[1],t[2]);return[n,o]}function Sn(e,t=1){let n=0,o=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?o=1*t:r=1*t,[n,o,r]}function zA(e,t,n){let o=e[0]-t[0],r=e[0]-n[0],s=t[0]-n[0],A=e[1]-t[1],a=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],x=e[2]-n[2],i=t[2]-n[2],f=Math.sqrt(o*o+A*A+c*c),d=Math.sqrt(r*r+a*a+x*x),m=Math.sqrt(s*s+l*l+i*i),y=(m*m+f*f-d*d)/(2*m*f);y>1?y=1:y<-1&&(y=-1);let u=Math.acos(y);u=57.2958*u%180;let T;return u>i2.NO_CURL_START_LIMIT?T=He.none:u>i2.HALF_CURL_START_LIMIT?T=He.half:T=He.full,T}function In(e,t,n,o){let r;return o===Math.abs(e)?e>0?r=c0.horizontalLeft:r=c0.horizontalRight:o===Math.abs(t)?t>0?r=c0.horizontalLeft:r=c0.horizontalRight:n>0?r=c0.horizontalLeft:r=c0.horizontalRight,r}function Nn(e,t,n,o){let r;return o===Math.abs(e)?e<0?r=c0.verticalDown:r=c0.verticalUp:o===Math.abs(t)?t<0?r=c0.verticalDown:r=c0.verticalUp:n<0?r=c0.verticalDown:r=c0.verticalUp,r}function SA(e,t,n,o,r,s,A,a){let l,c=Nn(e,t,n,o),x=In(r,s,A,a);return c===c0.verticalUp?x===c0.horizontalLeft?l=c0.diagonalUpLeft:l=c0.diagonalUpRight:x===c0.horizontalLeft?l=c0.diagonalDownLeft:l=c0.diagonalDownRight,l}function jA(e,t,n,o){let r=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],x=Math.max(Math.abs(r),Math.abs(s),Math.abs(A)),i=Math.max(Math.abs(a),Math.abs(l),Math.abs(c)),f=0,d=0,m=0,y=i/(x+1e-5);y>1.5?f+=i2.DISTANCE_VOTE_POWER:y>.66?d+=i2.DISTANCE_VOTE_POWER:m+=i2.DISTANCE_VOTE_POWER;let u=Math.sqrt(r*r+a*a),T=Math.sqrt(s*s+l*l),g=Math.sqrt(A*A+c*c),p=Math.max(u,T,g),b=e[0],k=e[1],P=n[0],N=n[1];p===u?(P=n[0],N=n[1]):p===g&&(b=t[0],k=t[1]);let Z=jn([b,k],[P,N]),$=Sn(Z,i2.TOTAL_ANGLE_VOTE_POWER);f+=$[0],d+=$[1],m+=$[2];for(let t0 of o){let n0=Sn(t0,i2.SINGLE_ANGLE_VOTE_POWER);f+=n0[0],d+=n0[1],m+=n0[2]}let A0;return f===Math.max(f,d,m)?A0=Nn(l,a,c,i):m===Math.max(d,m)?A0=In(s,r,A,x):A0=SA(l,a,c,i,s,r,A,x),A0}function Ln(e){let t=[],n=[],o=[],r=[];if(!e)return{curls:o,directions:r};for(let s of G0.all){let A=G0.getPoints(s),a=[],l=[];for(let c of A){let x=e[c[0]],i=e[c[1]],f=jn(x,i),d=f[0],m=f[1];a.push(d),l.push(m)}t.push(a),n.push(l)}for(let s of G0.all){let A=s===G0.thumb?1:0,a=G0.getPoints(s),l=e[a[A][0]],c=e[a[A+1][1]],x=e[a[3][1]],i=zA(l,c,x),f=jA(l,c,x,t[s].slice(A));o[s]=i,r[s]=f}return{curls:o,directions:r}}function kt(e){if(!e||e.length===0)return null;let t=Ln(e),n={};for(let o of G0.all)n[G0.getName(o)]={curl:He.getName(t.curls[o]),direction:c0.getName(t.directions[o])};return n}function On(e){let t=[];if(!e||e.length===0)return t;let n=Ln(e);for(let o of En){let r=o.matchAgainst(n.curls,n.directions);r>=EA&&t.push({name:o.name,confidence:r})}return t}var Cn=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&&o&&r&&o.position[1]l.part==="leftShoulder"),a=e[n].keypoints.find(l=>l.part==="rightShoulder");A&&a&&Math.abs(A.positionRaw[1]-a.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${A.position[1]>a.position[1]?"left":"right"}`})}return t},Wn=e=>{if(!e)return[];let t=[];for(let n=0;n450){let o=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),r=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(o/r)<=.15?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${o<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 a=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]));a>10&&t.push({face:n,gesture:`mouth ${Math.trunc(a)}% open`});let l=e[n].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:n,gesture:`head ${l<0?"up":"down"}`})}return t},Dn=e=>{var n,o,r,s;if(!e)return[];let t=[];for(let A=0;A.06||u>.06)&&(d=!1),y>u?u>.04&&t.push({iris:A,gesture:"looking right"}):y>.04&&t.push({iris:A,gesture:"looking left"});let T=Math.abs(e[A].mesh[145][1]-e[A].annotations.rightEyeIris[0][1])/e[A].box[3],g=Math.abs(e[A].mesh[374][1]-e[A].annotations.leftEyeIris[0][1])/e[A].box[3];(g<.01||T<.01||g>.022||T>.022)&&(d=!1),(g<.01||T<.01)&&t.push({iris:A,gesture:"looking down"}),(g>.022||T>.022)&&t.push({iris:A,gesture:"looking up"}),d&&t.push({iris:A,gesture:"looking center"})}return t},Fn=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=o.reduce((A,a)=>(A.position[2]||0)<(a.position[2]||0)?A:a);t.push({hand:n,gesture:`${r.name} forward`});let s=o.reduce((A,a)=>A.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:o,palmLandmarks:r,confidence:e.confidence}}function Et(e,t=1.5){let n=C2(e),o=wt(e),r=[t*o[0]/2,t*o[1]/2],s=[n[0]-r[0],n[1]-r[1]],A=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function zt(e){let t=C2(e),n=wt(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],A=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function NA(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Xn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return NA(n)}var Bn=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Xe(e,t){let n=0;for(let o=0;o[A.x,A.y]),this.anchorsTensor=W.tensor2d(this.anchors),this.inputSize=((s=(r=(o=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:o[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=W.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=W.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=W.slice(t,[0,0],[-1,2]),n.boxSizes=W.slice(t,[0,2],[-1,2]),n.div=W.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=W.add(n.div,this.anchorsTensor),n.halfBoxSizes=W.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=W.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=W.mul(n.sub,this.inputSizeTensor),n.add=W.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=W.mul(n.add,this.inputSizeTensor);let o=W.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>W.dispose(n[r])),o}normalizeLandmarks(t,n){let o={};o.reshape=W.reshape(t,[-1,7,2]),o.div=W.div(o.reshape,this.inputSizeTensor),o.landmarks=W.add(o.div,this.anchors[n]?this.anchors[n]:0);let r=W.mul(o.landmarks,this.inputSizeTensor);return Object.keys(o).forEach(s=>W.dispose(o[s])),r}async predict(t,n){var a;let o={};o.resize=W.image.resizeBilinear(t,[this.inputSize,this.inputSize]),o.div=W.div(o.resize,C.tf127),o.image=W.sub(o.div,C.tf1),o.batched=this.model.execute(o.image),o.predictions=W.squeeze(o.batched),o.slice=W.slice(o.predictions,[0,0],[-1,1]),o.sigmoid=W.sigmoid(o.slice),o.scores=W.squeeze(o.sigmoid);let r=await o.scores.data();o.boxes=W.slice(o.predictions,[0,1],[-1,4]),o.norm=this.normalizeBoxes(o.boxes),o.nms=await W.image.nonMaxSuppressionAsync(o.norm,o.scores,3*(((a=n.hand)==null?void 0:a.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let s=await o.nms.array(),A=[];for(let l of s){let c={};c.box=W.slice(o.norm,[l,0],[1,-1]),c.slice=W.slice(o.predictions,[l,5],[1,14]),c.norm=this.normalizeLandmarks(c.slice,l),c.palmLandmarks=W.reshape(c.norm,[-1,2]);let x=await c.box.data(),i=x.slice(0,2),f=x.slice(2,4),d=await c.palmLandmarks.array(),m={startPoint:i,endPoint:f,palmLandmarks:d,confidence:r[l]},y=Zn(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);A.push(y),Object.keys(c).forEach(u=>W.dispose(c[u]))}return Object.keys(o).forEach(l=>W.dispose(o[l])),A}};var $0=G(H());var WA=5,Kn=1.65,Jn=[0,5,9,13,17,1,2],DA=0,FA=2,Qn=0,jt=class{constructor(t,n){w(this,"handDetector");w(this,"handPoseModel");w(this,"inputSize");w(this,"storedBoxes");w(this,"skipped");w(this,"detectedHands");var o,r,s;this.handDetector=t,this.handPoseModel=n,this.inputSize=((s=(r=(o=this.handPoseModel)==null?void 0:o.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(A=>A[0]),o=t.map(A=>A[1]),r=[Math.min(...n),Math.min(...o)],s=[Math.max(...n),Math.max(...o)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let o=t.map(s=>e1([...s,1],n)),r=this.calculateLandmarksBoundingBox(o);return Et(zt(r),WA)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),o=Et(zt(n),Kn);o.palmLandmarks=[];for(let r=0;r[A[0]*(d[0]-this.inputSize/2),A[1]*(d[1]-this.inputSize/2),A[2]*d[2]]),l=$5(o,[0,0]),c=a.map(d=>[...e1(d,l),d[2]]),x=qn(r),i=[...C2(n),1],f=[Xe(i,x[0]),Xe(i,x[1])];return c.map(d=>[Math.trunc(d[0]+f[0]),Math.trunc(d[1]+f[1]),Math.trunc(d[2])])}async estimateHands(t,n){let o=!1,r,s=(n.hand.skipTime||0)>v()-Qn,A=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&s&&A?this.skipped++:(r=await this.handDetector.predict(t,n),this.skipped=0),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&&(o=!0));let a=[];for(let l=0;l=n.hand.minConfidence/4){let k=$0.reshape(p,[-1,3]),P=await k.array();$0.dispose(p),$0.dispose(k);let N=this.transformRawCoords(P,y,x,m),V=this.getBoxForHandLandmarks(N);this.storedBoxes[l]={...V,confidence:b};let _={landmarks:N,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:V.startPoint,bottomRight:V.endPoint}};a.push(_)}else this.storedBoxes[l]=null;$0.dispose(p)}else{let x=Et(zt(c),Kn),i={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:x.startPoint,bottomRight:x.endPoint},landmarks:[]};a.push(i)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=a.length,a.length>n.hand.maxDetected&&(a.length=n.hand.maxDetected),a}};var _n={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},l2,c2,t1;function HA(){let e=l2?new St(l2):void 0;e&&c2&&(t1=new jt(e,c2))}async function n1(e,t){t1||HA();let n=await t1.estimateHands(e,t);if(!n)return[];let o=[];for(let r=0;rn[r].landmarks[i]);let A=n[r].landmarks,a=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(A&&A.length>0){for(let x of A)x[0]a[2]&&(a[2]=x[0]),x[1]>a[3]&&(a[3]=x[1]);a[2]-=a[0],a[3]-=a[1],l=[a[0]/(e.shape[2]||0),a[1]/(e.shape[1]||0),a[2]/(e.shape[2]||0),a[3]/(e.shape[1]||0)]}else a=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=kt(A);o.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:a,boxRaw:l,keypoints:A,annotations:s,landmarks:c})}return o}async function $n(e){var t;return R.initial&&(l2=null),l2?e.debug&&h("cached model:",l2.modelUrl):l2=await L((t=e.hand.detector)==null?void 0:t.modelPath),l2}async function eo(e){var t;return R.initial&&(c2=null),c2?e.debug&&h("cached model:",c2.modelUrl):c2=await L((t=e.hand.skeleton)==null?void 0:t.modelPath),c2}var Q=G(H());var p0=[null,null],GA=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],qe=[[0,0],[0,0]],VA=["hand","fist","pinch","point","face","tip","pinchtip"],no=4,oo=1.6,ZA=512,XA=1.4,It=Number.MAX_SAFE_INTEGER,o1=0,we=[0,0],m0={boxes:[],hands:[]},ro={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function so(e){var t;if(R.initial&&(p0[0]=null),p0[0])e.debug&&h("cached model:",p0[0].modelUrl);else{J2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),p0[0]=await L((t=e.hand.detector)==null?void 0:t.modelPath);let n=p0[0].executor?Object.values(p0[0].modelSignature.inputs):void 0;qe[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[0]}async function Ao(e){var t;if(R.initial&&(p0[1]=null),p0[1])e.debug&&h("cached model:",p0[1].modelUrl);else{p0[1]=await L((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=p0[1].executor?Object.values(p0[1].modelSignature.inputs):void 0;qe[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[1]}async function qA(e,t){let n=[];if(!e||!p0[0])return n;let o={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,ZA),A=Math.round(s*r/8)*8;o.resize=Q.image.resizeBilinear(e,[s,A]),o.cast=Q.cast(o.resize,"int32"),[o.rawScores,o.rawBoxes]=await p0[0].executeAsync(o.cast,GA),o.boxes=Q.squeeze(o.rawBoxes,[0,2]),o.scores=Q.squeeze(o.rawScores,[0]);let a=Q.unstack(o.scores,1);Q.dispose(a[no]),a.splice(no,1),o.filtered=Q.stack(a,1),Q.dispose(a),o.max=Q.max(o.filtered,1),o.argmax=Q.argMax(o.filtered,1);let l=0;o.nms=await Q.image.nonMaxSuppressionAsync(o.boxes,o.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let c=await o.nms.data(),x=await o.max.data(),i=await o.argmax.data();for(let f of Array.from(c)){let d=Q.slice(o.boxes,f,1),m=await d.data();Q.dispose(d);let y=[m[1],m[0],m[3]-m[1],m[2]-m[0]],u=st(y,XA),T=[Math.trunc(y[0]*we[0]),Math.trunc(y[1]*we[1]),Math.trunc(y[2]*we[0]),Math.trunc(y[3]*we[1])],g=x[f],p=VA[i[f]],b={id:l++,score:g,box:T,boxRaw:u,label:p};n.push(b)}return Object.keys(o).forEach(f=>Q.dispose(o[f])),n.sort((f,d)=>d.score-f.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function r1(e,t,n){let o={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&p0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=Q.image.cropAndResize(e,[s],[0],[qe[1][0],qe[1][1]],"bilinear"),r.div=Q.div(r.crop,C.tf255),[r.score,r.keypoints]=p0[1].execute(r.div,["Identity_1","Identity"]);let A=(await r.score.data())[0],a=(100-Math.trunc(100/(1+Math.exp(A))))/100;if(a>=(n.hand.minConfidence||0)){o.fingerScore=a,r.reshaped=Q.reshape(r.keypoints,[-1,3]);let x=(await r.reshaped.array()).map(i=>[i[0]/qe[1][1],i[1]/qe[1][0],i[2]||0]).map(i=>[i[0]*t.boxRaw[2],i[1]*t.boxRaw[3],i[2]||0]);o.keypoints=x.map(i=>[we[0]*(i[0]+t.boxRaw[0]),we[1]*(i[1]+t.boxRaw[1]),i[2]||0]),o.landmarks=kt(o.keypoints);for(let i of Object.keys(ro))o.annotations[i]=ro[i].map(f=>o.landmarks&&o.keypoints[f]?o.keypoints[f]:null)}Object.keys(r).forEach(l=>Q.dispose(r[l]))}return o}async function s1(e,t){var r,s;if(!((r=p0[0])!=null&&r.executor)||!((s=p0[1])!=null&&s.executor)||!p0[0].inputs[0].shape||!p0[1].inputs[0].shape)return[];we=[e.shape[2]||0,e.shape[1]||0],It++;let n=(t.hand.skipTime||0)>v()-o1,o=It<(t.hand.skipFrames||0);return t.skipAllowed&&n&&o?m0.hands:new Promise(async A=>{let a=3*(t.hand.skipTime||0)>v()-o1,l=It<3*(t.hand.skipFrames||0);t.skipAllowed&&m0.hands.length===t.hand.maxDetected?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):t.skipAllowed&&a&&l&&m0.hands.length>0?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):(m0.boxes=await qA(e,t),o1=v(),m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))),It=0);let c=[...m0.boxes];if(m0.boxes.length=0,t.cacheSensitivity>0)for(let x=0;x.05&&i.box[3]/(e.shape[1]||1)>.05&&m0.hands[x].fingerScore&&m0.hands[x].fingerScore>(t.hand.minConfidence||0)){let f=st(i.box,oo),d=st(i.boxRaw,oo);m0.boxes.push({...c[x],box:f,boxRaw:d})}}for(let x=0;x({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var W2={};ze(W2,{connected:()=>Lt,horizontal:()=>A1,kpt:()=>Nt,relative:()=>i1,vertical:()=>a1});var Nt=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],A1=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],a1=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],i1=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],Lt={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var z=Te(),l1=0;function io(e,t){var A,a,l,c,x,i,f,d,m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0;let n=v();if(!e)return Te();let o=Date.now()-e.timestamp,r=o<1e3?8-Math.log(o+1):1;if(e.canvas&&(z.canvas=e.canvas),e.error&&(z.error=e.error),!z.body||e.body.length!==z.body.length)z.body=JSON.parse(JSON.stringify(e.body));else for(let M=0;M((r-1)*z.body[M].box[X]+B)/r),C0=e.body[M].boxRaw.map((B,X)=>((r-1)*z.body[M].boxRaw[X]+B)/r),x0=e.body[M].keypoints.map((B,X)=>{var U0,y0,Ee,k2,x2,E1,z1,S1,j1;return{score:B.score,part:B.part,position:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[0]||0)+(B.position[0]||0))/r:B.position[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[1]||0)+(B.position[1]||0))/r:B.position[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[2]||0)+(B.position[2]||0))/r:B.position[2]],positionRaw:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[0]||0)+(B.positionRaw[0]||0))/r:B.positionRaw[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[1]||0)+(B.positionRaw[1]||0))/r:B.positionRaw[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[2]||0)+(B.positionRaw[2]||0))/r:B.positionRaw[2]],distance:[z.body[M].keypoints[X]?((r-1)*(((U0=z.body[M].keypoints[X].distance)==null?void 0:U0[0])||0)+(((y0=B.distance)==null?void 0:y0[0])||0))/r:(Ee=B.distance)==null?void 0:Ee[0],z.body[M].keypoints[X]?((r-1)*(((k2=z.body[M].keypoints[X].distance)==null?void 0:k2[1])||0)+(((x2=B.distance)==null?void 0:x2[1])||0))/r:(E1=B.distance)==null?void 0:E1[1],z.body[M].keypoints[X]?((r-1)*(((z1=z.body[M].keypoints[X].distance)==null?void 0:z1[2])||0)+(((S1=B.distance)==null?void 0:S1[2])||0))/r:(j1=B.distance)==null?void 0:j1[2]]}}),K={},E={connected:{}};(A=t.body.modelPath)!=null&&A.includes("efficientpose")?E=it:(a=t.body.modelPath)!=null&&a.includes("blazepose")?E=ot:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(E=W2);for(let[B,X]of Object.entries(E.connected)){let U0=[];for(let y0=0;y0x2.part===X[y0]),k2=x0.find(x2=>x2.part===X[y0+1]);Ee&&k2&&U0.push([Ee.position,k2.position])}K[B]=U0}z.body[M]={...e.body[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.hand||e.hand.length!==z.hand.length)z.hand=JSON.parse(JSON.stringify(e.hand));else for(let M=0;M((r-1)*z.hand[M].box[B]+E)/r),C0=e.hand[M].boxRaw.map((E,B)=>((r-1)*z.hand[M].boxRaw[B]+E)/r);z.hand[M].keypoints.length!==e.hand[M].keypoints.length&&(z.hand[M].keypoints=e.hand[M].keypoints);let x0=e.hand[M].keypoints&&e.hand[M].keypoints.length>0?e.hand[M].keypoints.map((E,B)=>E.map((X,U0)=>((r-1)*(z.hand[M].keypoints[B][U0]||1)+(X||0))/r)):[],K={};if(Object.keys(z.hand[M].annotations).length!==Object.keys(e.hand[M].annotations).length)z.hand[M].annotations=e.hand[M].annotations,K=z.hand[M].annotations;else if(e.hand[M].annotations)for(let E of Object.keys(e.hand[M].annotations))K[E]=(i=(x=(c=e.hand[M])==null?void 0:c.annotations)==null?void 0:x[E])!=null&&i[0]?e.hand[M].annotations[E].map((B,X)=>B.map((U0,y0)=>((r-1)*z.hand[M].annotations[E][X][y0]+U0)/r)):null;z.hand[M]={...e.hand[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.face||e.face.length!==z.face.length)z.face=JSON.parse(JSON.stringify(e.face));else for(let M=0;M((r-1)*z.face[M].box[E]+K)/r),C0=e.face[M].boxRaw.map((K,E)=>((r-1)*z.face[M].boxRaw[E]+K)/r),x0=e.face[M].annotations;if(Object.keys(z.face[M].annotations).length!==Object.keys(e.face[M].annotations).length)z.face[M].annotations=e.face[M].annotations,x0=z.face[M].annotations;else if(e.face[M].annotations)for(let K of Object.keys(e.face[M].annotations))x0[K]=(m=(d=(f=e.face[M])==null?void 0:f.annotations)==null?void 0:d[K])!=null&&m[0]?e.face[M].annotations[K].map((E,B)=>E.map((X,U0)=>((r-1)*z.face[M].annotations[K][B][U0]+X)/r)):null;if(e.face[M].rotation){let K={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};K.matrix=(y=e.face[M].rotation)==null?void 0:y.matrix,K.angle={roll:((r-1)*(((T=(u=z.face[M].rotation)==null?void 0:u.angle)==null?void 0:T.roll)||0)+(((p=(g=e.face[M].rotation)==null?void 0:g.angle)==null?void 0:p.roll)||0))/r,yaw:((r-1)*(((k=(b=z.face[M].rotation)==null?void 0:b.angle)==null?void 0:k.yaw)||0)+(((N=(P=e.face[M].rotation)==null?void 0:P.angle)==null?void 0:N.yaw)||0))/r,pitch:((r-1)*(((_=(V=z.face[M].rotation)==null?void 0:V.angle)==null?void 0:_.pitch)||0)+((($=(Z=e.face[M].rotation)==null?void 0:Z.angle)==null?void 0:$.pitch)||0))/r},K.gaze={bearing:((r-1)*(((A0=z.face[M].rotation)==null?void 0:A0.gaze.bearing)||0)+(((t0=e.face[M].rotation)==null?void 0:t0.gaze.bearing)||0))/r,strength:((r-1)*(((n0=z.face[M].rotation)==null?void 0:n0.gaze.strength)||0)+(((j0=e.face[M].rotation)==null?void 0:j0.gaze.strength)||0))/r},z.face[M]={...e.face[M],rotation:K,box:T0,boxRaw:C0,annotations:x0}}else z.face[M]={...e.face[M],box:T0,boxRaw:C0,annotations:x0}}if(!z.object||e.object.length!==z.object.length)z.object=JSON.parse(JSON.stringify(e.object));else for(let M=0;M((r-1)*z.object[M].box[K]+x0)/r),C0=e.object[M].boxRaw.map((x0,K)=>((r-1)*z.object[M].boxRaw[K]+x0)/r);z.object[M]={...e.object[M],box:T0,boxRaw:C0}}if(e.persons){let M=e.persons;if(!z.persons||M.length!==z.persons.length)z.persons=JSON.parse(JSON.stringify(M));else for(let T0=0;T0((r-1)*z.persons[T0].box[x0]+C0)/r)}e.gesture&&(z.gesture=e.gesture),z.width=e.width,z.height=e.height;let s=v();return l1=R.perfadd?l1+Math.round(s-n):Math.round(s-n),e.performance&&(z.performance={...e.performance,interpolate:l1}),z}var s0=G(H());var L0;async function c1(e){return!L0||R.initial?L0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",L0.modelUrl),L0}async function lo(e,t){var r;if(L0||(L0=await c1(t)),!(L0!=null&&L0.executor)||!((r=L0==null?void 0:L0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=s0.image.resizeBilinear(e,[L0.inputs[0].shape?L0.inputs[0].shape[1]:0,L0.inputs[0].shape?L0.inputs[0].shape[2]:0],!1),n.norm=s0.div(n.resize,C.tf255),n.res=L0.execute(n.norm),n.squeeze=s0.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=s0.unstack(n.squeeze,2),n.fg=s0.softmax(n.fgRaw),n.mul=s0.mul(n.fg,C.tf255),n.expand=s0.expandDims(n.mul,2),n.output=s0.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let o;switch(t.segmentation.mode||"default"){case"default":n.input=s0.squeeze(e),n.concat=s0.concat([n.input,n.output],-1),o=s0.cast(n.concat,"int32");break;case"alpha":o=s0.cast(n.output,"int32");break;default:o=s0.tensor(0)}return Object.keys(n).forEach(s=>s0.dispose(n[s])),o}var Ot={};ze(Ot,{distance:()=>d1,find:()=>KA,similarity:()=>YA});function d1(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let o=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(o-n);return Math.max(Math.min(s,1),0)};function YA(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let o=d1(e,t,n);return xo(o,n.order||2,n.min||0,n.max||1)}function KA(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let o=Number.MAX_SAFE_INTEGER,r=-1;for(let A=0;AH2,validateModel:()=>Gt});var D2=G(H());var Ue=G(H());var yo=.005,ee={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function x1(e){for(let t of A1){let n=e.keypoints.findIndex(r=>r.part===t[0]),o=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[0]r&&r.part===t[0]),o=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),s=e.keypoints.findIndex(c=>c&&c.part===n[0]),A=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[s]||!e.keypoints[A])continue;let a=e.keypoints[o]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[o].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[o].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(a[0]>a[1]||l[0]>l[1]){let c=e.keypoints[o];e.keypoints[o]=e.keypoints[r],e.keypoints[r]=c}}}function fo(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Ue.pad(e,ee.padding),n.resize=Ue.image.resizeBilinear(n.pad,[t,t]);let o=Ue.cast(n.resize,"int32");return Object.keys(n).forEach(A=>Ue.dispose(n[A])),o}function po(e,t){e.keypoints=e.keypoints.filter(o=>o==null?void 0:o.position);for(let o of e.keypoints)o.position=[o.position[0]*(t[0]+ee.padding[2][0]+ee.padding[2][1])/t[0]-ee.padding[2][0],o.position[1]*(t[1]+ee.padding[1][0]+ee.padding[1][1])/t[1]-ee.padding[1][0]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1]];let n=Le(e.keypoints.map(o=>o.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var b0,Ct=0,y1=Number.MAX_SAFE_INTEGER,d2={boxes:[],bodies:[],last:0};async function uo(e){var t;return R.initial&&(b0=null),b0?e.debug&&h("cached model:",b0.modelUrl):(J2(["size"],e),b0=await L(e.body.modelPath)),Ct=b0!=null&&b0.executor&&((t=b0==null?void 0:b0.inputs)!=null&&t[0].shape)?b0.inputs[0].shape[2]:0,Ct<64&&(Ct=256),D2.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&D2.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),b0}function QA(e,t,n){let o=e[0][0],r=[],s=0;for(let x=0;xt.body.minConfidence){let i=[o[x][1],o[x][0]];r.push({score:Math.round(100*s)/100,part:Nt[x],positionRaw:i,position:[Math.round((n.shape[2]||0)*i[0]),Math.round((n.shape[1]||0)*i[1])]})}s=r.reduce((x,i)=>i.score>x?i.score:x,0);let A=[],a=Le(r.map(x=>x.position),[n.shape[2],n.shape[1]]),l={};for(let[x,i]of Object.entries(Lt)){let f=[];for(let d=0;du.part===i[d]),y=r.find(u=>u.part===i[d+1]);m&&y&&m.score>(t.body.minConfidence||0)&&y.score>(t.body.minConfidence||0)&&f.push([m.position,y.position])}l[x]=f}let c={id:0,score:s,box:a.box,boxRaw:a.boxRaw,keypoints:r,annotations:l};return x1(c),A.push(c),A}function _A(e,t,n){let o=[];for(let r=0;rt.body.minConfidence){let a=[];for(let f=0;f<17;f++){let d=s[3*f+2];if(d>t.body.minConfidence){let m=[s[3*f+1],s[3*f+0]];a.push({part:Nt[f],score:Math.round(100*d)/100,positionRaw:m,position:[Math.round((n.shape[2]||0)*m[0]),Math.round((n.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],c=[Math.trunc(l[0]*(n.shape[2]||0)),Math.trunc(l[1]*(n.shape[1]||0)),Math.trunc(l[2]*(n.shape[2]||0)),Math.trunc(l[3]*(n.shape[1]||0))],x={};for(let[f,d]of Object.entries(Lt)){let m=[];for(let y=0;yg.part===d[y]),T=a.find(g=>g.part===d[y+1]);u&&T&&u.score>(t.body.minConfidence||0)&&T.score>(t.body.minConfidence||0)&&m.push([u.position,T.position])}x[f]=m}let i={id:r,score:A,box:c,boxRaw:l,keypoints:[...a],annotations:x};x1(i),o.push(i)}}return o.sort((r,s)=>s.score-r.score),o.length>t.body.maxDetected&&(o.length=t.body.maxDetected),o}async function f1(e,t){var r;if(!(b0!=null&&b0.executor)||!((r=b0==null?void 0:b0.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(d2.boxes.length=0),y1++;let n=(t.body.skipTime||0)>v()-d2.last,o=y1<(t.body.skipFrames||0);return t.skipAllowed&&n&&o?d2.bodies:new Promise(async s=>{let A={};y1=0,A.input=mo(e,Ct),A.res=b0==null?void 0:b0.execute(A.input),d2.last=v();let a=await A.res.array();d2.bodies=A.res.shape[2]===17?QA(a,t,e):_A(a,t,e);for(let l of d2.bodies)po(l,[e.shape[2]||1,e.shape[1]||1]),fo(l.keypoints);Object.keys(A).forEach(l=>D2.dispose(A[l])),s(d2.bodies)})}var S0=G(H());var ce,Wt=[],bo=0,m1=Number.MAX_SAFE_INTEGER,Ft=0,Dt=2.5;async function go(e){if(!ce||R.initial){ce=await L(e.object.modelPath);let t=ce!=null&&ce.executor?Object.values(ce.modelSignature.inputs):void 0;Ft=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&h("cached model:",ce.modelUrl);return ce}async function $A(e,t,n){var c,x;let o=0,r=[],s=Ft;for(let i of[1,2,4]){let f=i*13,d=S0.squeeze(e.find(p=>p.shape[1]===f**2&&(p.shape[2]||0)===m2.length)),m=await d.array(),y=S0.squeeze(e.find(p=>p.shape[1]===f**2&&(p.shape[2]||0)(n.object.minConfidence||0)&&b!==61){let P=(.5+Math.trunc(p%f))/f,N=(.5+Math.trunc(p/f))/f,V=g[p].map(M=>M*(f/i/s)),[_,Z]=[P-Dt/i*V[0],N-Dt/i*V[1]],[$,A0]=[P+Dt/i*V[2]-_,N+Dt/i*V[3]-Z],t0=[_,Z,$,A0];t0=t0.map(M=>Math.max(0,Math.min(M,1)));let n0=[t0[0]*t[0],t0[1]*t[1],t0[2]*t[0],t0[3]*t[1]],j0={id:o++,score:Math.round(100*k)/100,class:b+1,label:m2[b].label,box:n0.map(M=>Math.trunc(M)),boxRaw:t0};r.push(j0)}}S0.dispose([d,y,u,T])}let A=r.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),a=r.map(i=>i.score),l=[];if(A&&A.length>0){let i=await S0.image.nonMaxSuppressionAsync(A,a,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);l=Array.from(await i.data()),S0.dispose(i)}return r=r.filter((i,f)=>l.includes(f)).sort((i,f)=>f.score-i.score),r}async function p1(e,t){if(!(ce!=null&&ce.executor))return[];let n=(t.object.skipTime||0)>v()-bo,o=m1<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&Wt.length>0?(m1++,Wt):(m1=0,!R.kernels.includes("mod")||!R.kernels.includes("sparsetodense")?Wt:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=S0.image.resizeBilinear(e,[Ft,Ft],!1),a=S0.div(A,C.tf255),l=S0.transpose(a,[0,3,1,2]),c;t.object.enabled&&(c=ce.execute(l)),bo=v();let x=await $A(c,s,t);Wt=x,S0.dispose([A,a,l,...c]),r(x)}))}var V0=G(H());var B2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],ea=B2.length,F2=B2.reduce((e,t,n)=>(e[t]=n,e),{}),ta=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],X7=ta.map(([e,t])=>[F2[e],F2[t]]),vo=[["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 Ro(e){let t=e.reduce(({maxX:n,maxY:o,minX:r,minY:s},{position:{x:A,y:a}})=>({maxX:Math.max(n,A),maxY:Math.max(o,a),minX:Math.min(r,A),minY:Math.min(s,a)}),{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 Mo(e,[t,n],[o,r]){let s=t/o,A=n/r,a=(c,x)=>({id:x,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/o,c.box[2]/r,c.box[3]/o],box:[Math.trunc(c.box[0]*A),Math.trunc(c.box[1]*s),Math.trunc(c.box[2]*A),Math.trunc(c.box[3]*s)],keypoints:c.keypoints.map(({score:i,part:f,position:d})=>({score:i,part:f,position:[Math.trunc(d.x*A),Math.trunc(d.y*s)],positionRaw:[d.x/o,d.y/o]})),annotations:{}});return e.map((c,x)=>a(c,x))}var Bt=class{constructor(t,n){w(this,"priorityQueue");w(this,"numberOfElements");w(this,"getElementValue");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 Po(e,t,n,o){let r=n-e,s=o-t;return r*r+s*s}function g1(e,t){return{x:e.x+t.x,y:e.y+t.y}}var te,oa=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],Ht=1,M2=16,ra=50**2;function ko(e,t,n,o,r,s,A=2){let a=T=>({y:s.get(T.y,T.x,e),x:s.get(T.y,T.x,s.shape[2]/2+e)}),l=(T,g,p)=>({y:b1(Math.round(T.y/M2),0,g-1),x:b1(Math.round(T.x/M2),0,p-1)}),[c,x]=o.shape,i=l(t.position,c,x),f=a(i),m=g1(t.position,f);for(let T=0;T[F2[f],F2[d]]),A=s.map(([,f])=>f),a=s.map(([f])=>f),l=t.shape[2],c=A.length,x=new Array(l),i=h1(e.part,M2,n);x[e.part.id]={score:e.score,part:B2[e.part.id],position:i};for(let f=c-1;f>=0;--f){let d=A[f],m=a[f];x[d]&&!x[m]&&(x[m]=ko(f,x[d],m,t,n,r))}for(let f=0;ft){a=!1;break}if(!a)break}return a}function aa(e,t){let[n,o,r]=t.shape,s=new Bt(n*o*r,({score:A})=>A);for(let A=0;A{var A;let s=(A=r[o])==null?void 0:A.position;return s?Po(n,t,s.y,s.x)<=ra:!1})}function ia(e,t){return t.reduce((o,{position:r,score:s},A)=>(wo(e,r,A)||(o+=s),o),0)/t.length}function la(e,t,n,o,r,s){let A=[],a=aa(s,t);for(;A.lengthd.score>s);let i=ia(A,x),f=Ro(x);i>s&&A.push({keypoints:x,box:f,score:Math.round(100*i)/100})}return A}async function T1(e,t){if(!(te!=null&&te.executor))return[];let n=V0.tidy(()=>{if(!te.inputs[0].shape)return[];let A=V0.image.resizeBilinear(e,[te.inputs[0].shape[2],te.inputs[0].shape[1]]),a=V0.sub(V0.div(V0.cast(A,"float32"),127.5),1),c=te.execute(a,oa).map(x=>V0.squeeze(x,[0]));return c[1]=V0.sigmoid(c[1]),c}),o=await Promise.all(n.map(A=>A.buffer()));for(let A of n)V0.dispose(A);let r=la(o[0],o[1],o[2],o[3],t.body.maxDetected,t.body.minConfidence);return te.inputs[0].shape?Mo(r,[e.shape[1],e.shape[2]],[te.inputs[0].shape[2],te.inputs[0].shape[1]]):[]}async function Eo(e){return!te||R.initial?te=await L(e.body.modelPath):e.debug&&h("cached model:",te.modelUrl),te}var F=G(H());var ve,ca=["fgr","pha","r1o","r2o","r3o","r4o"],g0={},R1=0;function jo(e){F.dispose([g0.r1i,g0.r2i,g0.r3i,g0.r4i,g0.downsample_ratio]),g0.r1i=F.tensor(0),g0.r2i=F.tensor(0),g0.r3i=F.tensor(0),g0.r4i=F.tensor(0),R1=e.segmentation.ratio||.5,g0.downsample_ratio=F.tensor(R1)}async function M1(e){return!ve||R.initial?ve=await L(e.segmentation.modelPath):e.debug&&h("cached model:",ve.modelUrl),jo(e),ve}var So=e=>F.tidy(()=>{let t=F.squeeze(e,[0]),n=F.mul(t,C.tf255);return F.cast(n,"int32")});function v1(e,t){let n=e?So(e):F.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),o=t?So(t):F.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=F.concat([n,o],-1);return F.dispose([n,o]),r}function da(e){return F.tidy(()=>{let t={};return t.unstack=F.unstack(e,-1),t.concat=F.concat(t.unstack,1),t.split=F.split(t.concat,4,1),t.stack=F.concat(t.split,2),t.squeeze=F.squeeze(t.stack,[0]),t.expand=F.expandDims(t.squeeze,-1),t.add=F.add(t.expand,1),t.mul=F.mul(t.add,127.5),t.cast=F.cast(t.mul,"int32"),t.tile=F.tile(t.cast,[1,1,3]),t.alpha=F.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),F.concat([t.tile,t.alpha],-1)})}async function Io(e,t){if(ve||(ve=await M1(t)),!(ve!=null&&ve.executor))return null;g0.src=F.div(e,255),R1!==t.segmentation.ratio&&jo(t);let[n,o,r,s,A,a]=await ve.executeAsync(g0,ca),l;switch(t.segmentation.mode||"default"){case"default":l=v1(n,o);break;case"alpha":l=v1(null,o);break;case"foreground":l=v1(n,null);break;case"state":l=da(r);break;default:l=F.tensor(0)}return F.dispose([g0.src,n,o,g0.r1i,g0.r2i,g0.r3i,g0.r4i]),[g0.r1i,g0.r2i,g0.r3i,g0.r4i]=[r,s,A,a],l}var z0=G(H());var O0;async function P1(e){return!O0||R.initial?O0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",O0.modelUrl),O0}async function Lo(e,t){var r;if(O0||(O0=await P1(t)),!(O0!=null&&O0.executor)||!((r=O0==null?void 0:O0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=z0.image.resizeBilinear(e,[O0.inputs[0].shape?O0.inputs[0].shape[1]:0,O0.inputs[0].shape?O0.inputs[0].shape[2]:0],!1),n.norm=z0.div(n.resize,C.tf255),n.res=O0.execute(n.norm),n.squeeze=z0.squeeze(n.res,[0]),n.alpha=z0.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=z0.mul(n.alpha,C.tf255);let o;switch(t.segmentation.mode||"default"){case"default":n.input=z0.squeeze(e),n.concat=z0.concat([n.input,n.mul],-1),o=z0.cast(n.concat,"int32");break;case"alpha":o=z0.cast(n.mul,"int32");break;default:o=z0.tensor(0)}return Object.keys(n).forEach(s=>z0.dispose(n[s])),o}function Gt(e,t,n){var c,x;if(!t||!((c=e==null?void 0:e.config)!=null&&c.validateModels))return null;let o=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],A=[],a=t.modelUrl,l=t.executor;if((x=l==null?void 0:l.graph)!=null&&x.nodes)for(let i of Object.values(l.graph.nodes)){let f=i.op.toLowerCase();s.includes(f)||s.push(f)}else!l&&e.config.debug&&h("model not loaded",n);for(let i of s)!o.includes(i)&&!r.includes(i)&&!e.env.kernels.includes(i)&&!e.env.kernels.includes(i.replace("_",""))&&!e.env.kernels.includes(i.replace("native",""))&&!e.env.kernels.includes(i.replace("v2",""))&&A.push(i);return e.config.debug&&A.length>0&&h("model validation failed:",n,A),A.length>0?{name:n,missing:A,ops:s,url:a}:null}var H2=class{constructor(t){w(this,"instance");w(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,o=0;for(let s of Object.values(I0))t+=s.sizeFromManifest,n+=s.sizeLoadedWeights,o+=s.sizeDesired;let r=o>0?n/o:0;return{numLoadedModels:Object.values(I0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:o,modelStats:Object.values(I0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var o,r,s,A,a,l,c,x,i,f,d,m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0;R.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?k3(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((o=this.instance.config.face.antispoof)!=null&&o.enabled)&&!this.models.antispoof?Q3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?tn(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?q3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((A=this.instance.config.face.emotion)!=null&&A.enabled)&&!this.models.emotion?G3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((a=this.instance.config.face.iris)!=null&&a.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?I3(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((c=this.instance.config.face.mesh)!=null&&c.enabled)&&!this.models.facemesh?W3(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((x=this.instance.config.face.gear)!=null&&x.enabled)&&!this.models.gear?sn(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((i=this.instance.config.face.ssrnet)!=null&&i.enabled)&&!this.models.ssrnetage?cn(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((f=this.instance.config.face.ssrnet)!=null&&f.enabled)&&!this.models.ssrnetgender?fn(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((d=this.instance.config.face.mobilefacenet)!=null&&d.enabled)&&!this.models.mobilefacenet?bn(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?Mn(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((y=this.instance.config.body.modelPath)!=null&&y.includes("blazepose"))?a3(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?A3(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((u=this.instance.config.body.modelPath)!=null&&u.includes("efficientpose"))?y3(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("movenet"))?uo(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((g=this.instance.config.body.modelPath)!=null&&g.includes("posenet"))?Eo(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(p=this.instance.config.hand.detector)==null?void 0:p.modelPath)!=null&&b.includes("handtrack"))?so(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((P=(k=this.instance.config.hand.detector)==null?void 0:k.modelPath)!=null&&P.includes("handtrack"))?Ao(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((V=(N=this.instance.config.hand.detector)==null?void 0:N.modelPath)!=null&&V.includes("handdetect"))&&(n.handdetect=$n(this.instance.config),n.handskeleton=eo(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((_=this.instance.config.object.modelPath)!=null&&_.includes("centernet"))?c3(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((Z=this.instance.config.object.modelPath)!=null&&Z.includes("nanodet"))?go(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&(($=this.instance.config.segmentation.modelPath)!=null&&$.includes("selfie"))?P1(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((A0=this.instance.config.segmentation.modelPath)!=null&&A0.includes("meet"))?c1(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((t0=this.instance.config.segmentation.modelPath)!=null&&t0.includes("rvm"))?M1(this.instance.config):null;for(let[n0,j0]of Object.entries(n))j0!=null&&j0.then&&j0.then(M=>this.models[n0]=M);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var o;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(o=this.models[n])==null?void 0:o.modelUrl:null}});for(let n of t){let o=Object.keys(I0).find(r=>r.startsWith(n.name));o&&(n.size=I0[o].sizeLoadedWeights,n.url=I0[o].url)}return t}loaded(){return this.list().filter(o=>o.loaded).map(o=>o.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let o=this.models[n];if(!o)continue;let r=Gt(this.instance,o,n);r&&t.push(r)}return t}};function Co(e,t,n,o,r){var a,l,c,x,i,f;let s=0,A=[];for(let d of e){let m={id:s++,face:d,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)d.box[0]>b.box[0]&&d.box[0]b.box[1]&&d.box[1]+d.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(y.push(b[0],b[0]+b[2]),u.push(b[1],b[1]+b[3]))};T(m.face.box),T((x=m.body)==null?void 0:x.box),T((i=m.hands.left)==null?void 0:i.box),T((f=m.hands.right)==null?void 0:f.box);let g=Math.min(...y),p=Math.min(...u);m.box=[g,p,Math.max(...y)-g,Math.max(...u)-p],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),A.push(m)}return A}var d0=G(H());var Vt=` + gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var a5=0;function Ys(e,t,n){let o=a0(f0,n);if(!t||!e)return;let r=oe(e);if(r){r.lineJoin="round",r.font=o.font;for(let s=0;sc5,kpt:()=>l5});var l5=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],c5={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var D=V(G());var se,n2=224,$1,Qs=5,rt=[8,16,32,32,32];function _s(){let e=[],t=0;for(;tn.x)),y:D.tensor1d(e.map(n=>n.y))}}async function e3(e){if(R.initial&&(se=null),!se&&e.body.detector&&e.body.detector.modelPath){se=await L(e.body.detector.modelPath);let t=se!=null&&se.executor?Object.values(se.modelSignature.inputs):void 0;n2=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&se&&h("cached model:",se.modelUrl);return _s(),se}var _1=[5,5];function $s(e,t){return D.tidy(()=>{let n=D.split(e,12,1),o=D.squeeze(n[0]),r=D.squeeze(n[1]),s=D.squeeze(n[2]),A=D.squeeze(n[3]);o=D.add(D.div(o,n2),t.x),r=D.add(D.div(r,n2),t.y),s=D.mul(D.div(s,n2),_1[0]),A=D.mul(D.div(A,n2),_1[1]);let a=D.sub(o,D.div(s,2)),l=D.sub(r,D.div(A,2)),c=D.add(a,s),x=D.add(l,A);return D.stack([a,l,c,x],1)})}async function eA(e,t,n,o){var c,x;let r=[],s={};s.boxes=$s(e,$1),s.scores=D.sigmoid(t),s.nms=await D.image.nonMaxSuppressionAsync(s.boxes,s.scores,1,((c=n.body.detector)==null?void 0:c.minConfidence)||.1,((x=n.body.detector)==null?void 0:x.iouThreshold)||.1);let A=await s.nms.data(),a=await s.scores.data(),l=await s.boxes.array();for(let i of Array.from(A)){let y=a[i],d=l[i],m=[Math.round(d[0]*o[0]),Math.round(d[1]*o[1]),Math.round(d[2]*o[0]),Math.round(d[3]*o[1])],f={score:y,boxRaw:d,box:m};r.push(f)}return Object.keys(s).forEach(i=>D.dispose(s[i])),r}async function t3(e,t,n){let o={};o.res=se==null?void 0:se.execute(e,["Identity"]),o.logitsRaw=D.slice(o.res,[0,0,0],[1,-1,1]),o.boxesRaw=D.slice(o.res,[0,0,1],[1,-1,-1]),o.logits=D.squeeze(o.logitsRaw),o.boxes=D.squeeze(o.boxesRaw);let r=await eA(o.boxes,o.logits,t,n);return Object.keys(o).forEach(s=>D.dispose(o[s])),r}function Le(e,t=[1,1]){let n=[e.map(a=>a[0]),e.map(a=>a[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[o[0],o[1],r[0]-o[0],r[1]-o[1]],A=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:A}}function n3(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[(o[0]+r[0])/2,(o[1]+r[1])/2],A=Math.max(s[0]-o[0],s[1]-o[1],-s[0]+r[0],-s[1]+r[1]),a=[Math.trunc(s[0]-A),Math.trunc(s[1]-A),Math.trunc(2*A),Math.trunc(2*A)],l=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:l}}function st(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var Z0,x5=256,d5=Number.MAX_SAFE_INTEGER,tA={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},at=[],Oe=[[0,0],[0,0],[0,0],[0,0]],o3=0,r3=e=>1-1/(1+Math.exp(e)),A3=e=>e3(e);async function a3(e){if(R.initial&&(Z0=null),Z0)e.debug&&h("cached model:",Z0.modelUrl);else{Z0=await L(e.body.modelPath);let t=Z0!=null&&Z0.executor?Object.values(Z0.modelSignature.inputs):void 0;x5=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Z0}function s3(e,t,n){var s,A;let o={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((A=e==null?void 0:e.shape)!=null&&A[2]))return e;let r;if(n&&(o.cropped=X0.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let a=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Oe=[[0,0],a,l,[0,0]],o.pad=X0.pad(o.cropped||e,Oe),o.resize=X0.image.resizeBilinear(o.pad,[t,t]),r=X0.div(o.resize,C.tf255)}else e.shape[1]!==t?(o.resize=X0.image.resizeBilinear(o.cropped||e,[t,t]),r=X0.div(o.resize,C.tf255)):r=X0.div(o.cropped||e,C.tf255);return Object.keys(o).forEach(a=>X0.dispose(o[a])),r}function nA(e,t,n){for(let o of e)o.position=[Math.trunc(o.position[0]*(t[0]+Oe[2][0]+Oe[2][1])/t[0]-Oe[2][0]),Math.trunc(o.position[1]*(t[1]+Oe[1][0]+Oe[1][1])/t[1]-Oe[1][0]),o.position[2]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1],2*o.position[2]/(t[0]+t[1])];if(n){let o=n[2]-n[0],r=n[3]-n[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+n[1],s.positionRaw[1]/o+n[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function oA(e){let t=e.find(a=>a.part==="leftPalm"),n=e.find(a=>a.part==="leftWrist"),o=e.find(a=>a.part==="leftIndex");t.position[2]=((n.position[2]||0)+(o.position[2]||0))/2;let r=e.find(a=>a.part==="rightPalm"),s=e.find(a=>a.part==="rightWrist"),A=e.find(a=>a.part==="rightIndex");r.position[2]=((s.position[2]||0)+(A.position[2]||0))/2}async function rA(e,t,n){if(!(Z0!=null&&Z0.executor))return null;let o={};[o.ld,o.segmentation,o.heatmap,o.world,o.poseflag]=Z0==null?void 0:Z0.execute(e,tA.landmarks);let r=(await o.poseflag.data())[0],s=await o.ld.data(),A=await o.world.data();Object.keys(o).forEach(m=>X0.dispose(o[m]));let a=[],l=5;for(let m=0;mm.position),i=Le(x,[n[0],n[1]]),y={};for(let[m,f]of Object.entries(c5)){let u=[];for(let g=0;gb.part===f[g]),p=c.find(b=>b.part===f[g+1]);T&&p&&u.push([T.position,p.position])}y[m]=u}return{id:0,score:Math.trunc(100*r)/100,box:i.box,boxRaw:i.boxRaw,keypoints:c,annotations:y}}async function y5(e,t){var s,A,a;let n=[e.shape[2]||0,e.shape[1]||0],o=(t.body.skipTime||0)>v()-o3,r=d5<(t.body.skipFrames||0);if(t.skipAllowed&&o&&r&&at!==null)d5++;else{let l=[];if((A=(s=t.body)==null?void 0:s.detector)!=null&&A.enabled){let c=s3(e,224);l=await t3(c,t,n),X0.dispose(c)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let c=0;cF0.dispose(o[c])),r}async function p5(e,t){if(!(q0!=null&&q0.executor))return[];let n=(t.object.skipTime||0)>v()-l3,o=m5<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&f5.length>0?(m5++,f5):(m5=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=F0.image.resizeBilinear(e,[o2,o2]),a=t.object.enabled?q0==null?void 0:q0.execute(A,["tower_0/detections"]):null;l3=v(),F0.dispose(A);let l=await sA(a,s,t);f5=l,r(l)}))}var J=V(G());var it={};ze(it,{connected:()=>h5,kpt:()=>u5});var u5=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],h5={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var i0,x3=0,B0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},b5=Number.MAX_SAFE_INTEGER;async function y3(e){return R.initial&&(i0=null),i0?e.debug&&h("cached model:",i0.modelUrl):i0=await L(e.body.modelPath),i0}async function AA(e,t){let[n,o]=e.shape,r=J.reshape(e,[o*n]),s=J.max(r,0),A=(await s.data())[0];if(A>t){let a=J.argMax(r,0),l=J.mod(a,n),c=(await l.data())[0],x=J.div(a,n),i=(await x.data())[0];return J.dispose([r,s,a,l,x]),[c,i,A]}return J.dispose([r,s]),[0,0,A]}async function g5(e,t){if(!(i0!=null&&i0.executor)||!(i0!=null&&i0.inputs[0].shape))return[];let n=(t.body.skipTime||0)>v()-x3,o=b5<(t.body.skipFrames||0);return t.skipAllowed&&n&&o&&Object.keys(B0.keypoints).length>0?(b5++,[B0]):(b5=0,new Promise(async r=>{let s=J.tidy(()=>{var m,f;let i=J.image.resizeBilinear(e,[((m=i0==null?void 0:i0.inputs[0].shape)==null?void 0:m[2])||0,((f=i0==null?void 0:i0.inputs[0].shape)==null?void 0:f[1])||0],!1),y=J.mul(i,C.tf2);return J.sub(y,C.tf1)}),A;if(t.body.enabled&&(A=i0==null?void 0:i0.execute(s)),x3=v(),J.dispose(s),A){B0.keypoints.length=0;let i=J.squeeze(A);J.dispose(A);let y=J.unstack(i,2);J.dispose(i);for(let d=0;d(t.body.minConfidence||0)&&B0.keypoints.push({score:Math.round(100*u)/100,part:u5[d],positionRaw:[m/i0.inputs[0].shape[2],f/i0.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/i0.inputs[0].shape[2]),Math.round(e.shape[1]*f/i0.inputs[0].shape[1])]})}y.forEach(d=>J.dispose(d))}B0.score=B0.keypoints.reduce((i,y)=>y.score>i?y.score:i,0);let a=B0.keypoints.map(i=>i.position[0]),l=B0.keypoints.map(i=>i.position[1]);B0.box=[Math.min(...a),Math.min(...l),Math.max(...a)-Math.min(...a),Math.max(...l)-Math.min(...l)];let c=B0.keypoints.map(i=>i.positionRaw[0]),x=B0.keypoints.map(i=>i.positionRaw[1]);B0.boxRaw=[Math.min(...c),Math.min(...x),Math.max(...c)-Math.min(...c),Math.max(...x)-Math.min(...x)];for(let[i,y]of Object.entries(h5)){let d=[];for(let m=0;mg.part===y[m]),u=B0.keypoints.find(g=>g.part===y[m+1]);f&&u&&f.score>(t.body.minConfidence||0)&&u.score>(t.body.minConfidence||0)&&d.push([f.position,u.position])}B0.annotations[i]=d}r([B0])}))}var l0=V(G());var De=V(G());var O=V(G());var Me=V(G());var p2=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],lt=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],ct=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],dt=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],u3=(e,t,n)=>{let o=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(A=>[(A[0]+n[0])*t[0],(A[1]+n[1])*t[1]]);return{startPoint:o,endPoint:r,landmarks:s,confidence:e.confidence}},T5=(e,t,n)=>{let o=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/o,e.startPoint[0]/r,e.endPoint[1]/o,e.endPoint[0]/r],A=Me.image.cropAndResize(t,[s],[0],n),a=Me.div(A,C.tf255);return Me.dispose(A),a},xt=(e,t)=>{let n=lt(e),o=p2(e),r=[t*o[0]/2,t*o[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:o}},yt=e=>{let t=lt(e),n=p2(e),o=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-o),Math.round(t[1]-o)],endPoint:[Math.round(t[0]+o),Math.round(t[1]+o)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},h3=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},v5=[[1,0,0],[0,1,0],[0,0,1]],aA=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),iA=(e,t)=>aA(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var m3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],r2=(e,t)=>{let n=0;for(let o=0;o{let n=[];for(let o=0;o{let n=[],o=e.length;for(let r=0;r{let n=Math.cos(e),o=Math.sin(e),r=[[n,-o,0],[o,n,0],[0,0,1]],s=m3(t[0],t[1]),A=p3(s,r),a=m3(-t[0],-t[1]);return p3(A,a)},cA=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],o=[-r2(t[0],n),-r2(t[1],n)];return[t[0].concat(o[0]),t[1].concat(o[1]),[0,0,1]]},dA=(e,t)=>[r2(e,t[0]),r2(e,t[1])];function g3(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let o=0;o[s[0]/r*(d[0]-r/2),s[1]/r*(d[1]-r/2),d[2]||0]),a=n&&n!==0&&Math.abs(n)>.2,l=a?b3(n,[0,0]):v5,c=a?A.map(d=>[...dA(d,l),d[2]]):A,x=a?cA(o):v5,i=lt(t),y=[r2(i,x[0]),r2(i,x[1])];return c.map(d=>[Math.trunc(d[0]+y[0]),Math.trunc(d[1]+y[1]),Math.trunc(d[2]||0)])}function v3(e,t,n,o){let r=t.landmarks.length>=r5.count?r5.symmetryLine:_e.symmetryLine,s=0,A=v5,a;if(e&&R.kernels.includes("rotatewithoffset"))if(s=iA(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let c=lt(t),x=[c[0]/n.shape[2],c[1]/n.shape[1]],i=Me.image.rotateWithOffset(n,s,0,[x[0],x[1]]);A=b3(-s,c),a=T5(t,i,[o,o]),Me.dispose(i)}else a=T5(t,n,[o,o]);else a=T5(t,n,[o,o]);return[s,A,a]}var xA=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},R3=(e,t)=>{let n=xA(e),o=p2(t);return{startPoint:[n[0]-o[0]/2,n[1]-o[1]/2],endPoint:[n[0]+o[0]/2,n[1]+o[1]/2]}};var M3=6,xe,ft=null,Ce=0,u2=null,P3=()=>Ce;async function k3(e){var t;return R.initial&&(xe=null),xe?e.debug&&h("cached model:",xe.modelUrl):xe=await L((t=e.face.detector)==null?void 0:t.modelPath),Ce=xe.executor&&xe.inputs[0].shape?xe.inputs[0].shape[2]:256,u2=O.scalar(Ce,"int32"),ft=O.tensor2d(g3(Ce)),xe}function yA(e){if(!ft||!u2)return O.zeros([0,0]);let t={};t.boxStarts=O.slice(e,[0,1],[-1,2]),t.centers=O.add(t.boxStarts,ft),t.boxSizes=O.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=O.div(t.boxSizes,u2),t.centersNormalized=O.div(t.centers,u2),t.halfBoxSize=O.div(t.boxSizesNormalized,C.tf2),t.starts=O.sub(t.centersNormalized,t.halfBoxSize),t.ends=O.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=O.mul(t.starts,u2),t.endNormalized=O.mul(t.ends,u2);let n=O.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(o=>O.dispose(t[o])),n}async function w3(e,t){var a,l,c,x,i,y,d;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=O.image.resizeBilinear(e,[Ce,Ce]),n.div=O.div(n.resized,C.tf127),n.normalized=O.sub(n.div,C.tf05);let o=xe==null?void 0:xe.execute(n.normalized);if(Array.isArray(o)&&o.length>2){let m=o.sort((f,u)=>f.size-u.size);n.concat384=O.concat([m[0],m[2]],2),n.concat512=O.concat([m[1],m[3]],2),n.concat=O.concat([n.concat512,n.concat384],1),n.batch=O.squeeze(n.concat,[0])}else Array.isArray(o)?n.batch=O.squeeze(o[0]):n.batch=O.squeeze(o);O.dispose(o),n.boxes=yA(n.batch),n.logits=O.slice(n.batch,[0,0],[-1,1]),n.sigmoid=O.sigmoid(n.logits),n.scores=O.squeeze(n.sigmoid),n.nms=await O.image.nonMaxSuppressionAsync(n.boxes,n.scores,((a=t.face.detector)==null?void 0:a.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),s=[],A=await n.scores.data();for(let m=0;m(((x=t.face.detector)==null?void 0:x.minConfidence)||0)){let u={};u.bbox=O.slice(n.boxes,[r[m],0],[1,-1]),u.slice=O.slice(n.batch,[r[m],M3-1],[1,-1]),u.squeeze=O.squeeze(u.slice),u.landmarks=O.reshape(u.squeeze,[M3,-1]);let g=await u.bbox.data(),T={startPoint:[g[0],g[1]],endPoint:[g[2],g[3]],landmarks:await u.landmarks.array(),confidence:f};u.anchor=O.slice(ft,[r[m],0],[1,2]);let p=await u.anchor.data(),b=u3(T,[(e.shape[2]||0)/Ce,(e.shape[1]||0)/Ce],p),k=xt(b,((i=t.face.detector)==null?void 0:i.scale)||1.4),P=yt(k);P.size[0]>(((y=t.face.detector)==null?void 0:y.minSize)||0)&&P.size[1]>(((d=t.face.detector)==null?void 0:d.minSize)||0)&&s.push(P),Object.keys(u).forEach(I=>O.dispose(u[I]))}}return Object.keys(n).forEach(m=>O.dispose(n[m])),s}var ye=V(G());var K0,We=0,M5=ae.leftEyeLower0,P5=ae.rightEyeLower0,h2={leftBounds:[M5[0],M5[M5.length-1]],rightBounds:[P5[0],P5[P5.length-1]]},b2={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function I3(e){var t,n;return R.initial&&(K0=null),K0?e.debug&&h("cached model:",K0.modelUrl):K0=await L((t=e.face.iris)==null?void 0:t.modelPath),We=K0!=null&&K0.executor&&((n=K0.inputs)!=null&&n[0].shape)?K0.inputs[0].shape[2]:0,We===-1&&(We=64),K0}function mt(e,t,n,o){for(let r=0;r{let t=e[h2.leftBounds[0]][2],n=e[h2.rightBounds[0]][2];return t-n},z3=(e,t,n,o,r,s=!1,A=2.3)=>{let a=yt(xt(h3([e[n],e[o]]),A)),l=p2(a),c=ye.image.cropAndResize(t,[[a.startPoint[1]/r,a.startPoint[0]/r,a.endPoint[1]/r,a.endPoint[0]/r]],[0],[We,We]);if(s&&R.kernels.includes("flipleftright")){let x=ye.image.flipLeftRight(c);ye.dispose(c),c=x}return{box:a,boxSize:l,crop:c}},S3=(e,t,n,o=!1)=>{let r=[];for(let s=0;s{let o=e[ae[`${n}EyeUpper0`][b2.upperCenter]][2],r=e[ae[`${n}EyeLower0`][b2.lowerCenter]][2],s=(o+r)/2;return t.map((A,a)=>{let l=s;return a===2?l=o:a===4&&(l=r),[A[0],A[1],l]})};async function N3(e,t,n,o){var I,B;if(!(K0!=null&&K0.executor))return e;let{box:r,boxSize:s,crop:A}=z3(e,t,h2.leftBounds[0],h2.leftBounds[1],n,!0,((I=o.face.iris)==null?void 0:I.scale)||2.3),{box:a,boxSize:l,crop:c}=z3(e,t,h2.rightBounds[0],h2.rightBounds[1],n,!0,((B=o.face.iris)==null?void 0:B.scale)||2.3),x=ye.concat([A,c]);ye.dispose(A),ye.dispose(c);let i=K0.execute(x);ye.dispose(x);let y=await i.data();ye.dispose(i);let d=y.slice(0,b2.numCoordinates*3),{rawCoords:m,iris:f}=S3(d,r,s,!0),u=y.slice(b2.numCoordinates*3),{rawCoords:g,iris:T}=S3(u,a,l,!1),p=fA(e);Math.abs(p)<30?(mt(e,m,"left",null),mt(e,g,"right",null)):p<1?mt(e,m,"left",["EyeUpper0","EyeLower0"]):mt(e,g,"right",["EyeUpper0","EyeLower0"]);let b=j3(e,f,"left"),k=j3(e,T,"right");return e.concat(b).concat(k)}async function O3(e,t){var s,A,a,l,c,x,i,y,d,m;let n={lips:await((A=(s=t.filter(f=>f.size===160))==null?void 0:s[0])==null?void 0:A.data()),irisL:await((l=(a=t.filter(f=>f.size===10))==null?void 0:a[0])==null?void 0:l.data()),eyeL:await((x=(c=t.filter(f=>f.size===142))==null?void 0:c[0])==null?void 0:x.data()),irisR:await((y=(i=t.filter(f=>f.size===10))==null?void 0:i[1])==null?void 0:y.data()),eyeR:await((m=(d=t.filter(f=>f.size===142))==null?void 0:d[1])==null?void 0:m.data())};for(let f of Object.values(n))if(!f)return e;let o=e2.reduce((f,u)=>f+=e[u][2],0)/e2.length;for(let f=0;ff+=e[u][2],0)/t2.length;for(let f=0;fv()-ge.timestamp,o=ge.skipped<(((c=t.face.detector)==null?void 0:c.skipFrames)||0);!t.skipAllowed||!n||!o||ge.boxes.length===0?(ge.boxes=await w3(e,t),ge.timestamp=v(),ge.skipped=0):ge.skipped++;let r=[],s=[],A=0,a=O2;for(let T=0;T[I[0]/(e.shape[2]||0),I[1]/(e.shape[1]||0),(I[2]||0)/a]);for(let I of Object.keys(_e))P.annotations[I]=[P.mesh[_e[I]]]}else if(!r0)t.debug&&h("face mesh detection requested, but model is not loaded");else{if((d=t.face.attention)!=null&&d.enabled&&!R.kernels.includes("atan2"))return t.face.attention.enabled=!1,De.dispose(P.tensor),r;let I=r0.execute(P.tensor),_=await I.find(Z=>Z.shape[Z.shape.length-1]===1).data();if(P.faceScore=Math.round(100*_[0])/100,P.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(p.confidence=P.faceScore,t.face.mesh.keepInvalid){P.box=ct(p,e),P.boxRaw=dt(p,e),P.size=p.size,P.score=P.boxScore,P.mesh=p.landmarks,P.meshRaw=P.mesh.map(Z=>[Z[0]/(e.shape[2]||1),Z[1]/(e.shape[1]||1),(Z[2]||0)/a]);for(let Z of Object.keys(_e))P.annotations[Z]=[P.mesh[_e[Z]]]}}else{let Z=I.find(n0=>n0.shape[n0.shape.length-1]===1404),$=De.reshape(Z,[-1,3]),A0=await $.array();De.dispose($),(f=t.face.attention)!=null&&f.enabled?A0=await O3(A0,I):(u=t.face.iris)!=null&&u.enabled&&(A0=await N3(A0,P.tensor,O2,t)),P.mesh=T3(A0,p,b,k,O2),P.meshRaw=P.mesh.map(n0=>[n0[0]/(e.shape[2]||0),n0[1]/(e.shape[1]||0),(n0[2]||0)/a]);for(let n0 of Object.keys(ae))P.annotations[n0]=ae[n0].map(j0=>P.mesh[j0]);P.score=P.faceScore;let t0={...R3(P.mesh,p),confidence:p.confidence,landmarks:p.landmarks,size:p.size};P.box=ct(t0,e),P.boxRaw=dt(t0,e),P.size=t0.size,s.push(t0)}De.dispose(I)}P.score>(((g=t.face.detector)==null?void 0:g.minConfidence)||1)?r.push(P):De.dispose(P.tensor)}return ge.boxes=s,r}async function W3(e){var t,n,o,r,s,A;return R.initial&&(r0=null),(t=e.face.attention)!=null&&t.enabled&&(r0!=null&&r0.signature)&&Object.keys(((n=r0==null?void 0:r0.signature)==null?void 0:n.outputs)||{}).length<6&&(r0=null),r0?e.debug&&h("cached model:",r0.modelUrl):(o=e.face.attention)!=null&&o.enabled?r0=await L(e.face.attention.modelPath):r0=await L((r=e.face.mesh)==null?void 0:r.modelPath),O2=r0.executor&&((s=r0==null?void 0:r0.inputs)!=null&&s[0].shape)?(A=r0==null?void 0:r0.inputs)==null?void 0:A[0].shape[2]:256,r0}var D3=$e,F3=N2;var J0=V(G());var E5=[],P0,pt=[],B3=0,H3=0,w5=Number.MAX_SAFE_INTEGER,z5=!1;async function G3(e){var t,n,o;return R.initial&&(P0=null),P0?e.debug&&h("cached model:",P0.modelUrl):(P0=await L((t=e.face.emotion)==null?void 0:t.modelPath),z5=((o=(n=P0==null?void 0:P0.inputs)==null?void 0:n[0].shape)==null?void 0:o[3])===3,z5?E5=["angry","disgust","fear","happy","neutral","sad","surprise"]:E5=["angry","disgust","fear","happy","sad","surprise","neutral"]),P0}async function S5(e,t,n,o){var A,a;if(!P0)return[];let r=w5<(((A=t.face.emotion)==null?void 0:A.skipFrames)||0),s=(((a=t.face.emotion)==null?void 0:a.skipTime)||0)>v()-H3;return t.skipAllowed&&s&&r&&B3===o&&pt[n]&&pt[n].length>0?(w5++,pt[n]):(w5=0,new Promise(async l=>{var x,i,y;let c=[];if((x=t.face.emotion)!=null&&x.enabled){let d={},m=P0!=null&&P0.inputs[0].shape?P0.inputs[0].shape[2]:0;if(((i=t.face.emotion)==null?void 0:i.crop)>0){let u=(y=t.face.emotion)==null?void 0:y.crop,g=[[u,u,1-u,1-u]];d.resize=J0.image.cropAndResize(e,g,[0],[m,m])}else d.resize=J0.image.resizeBilinear(e,[m,m],!1);z5?(d.mul=J0.mul(d.resize,255),d.normalize=J0.sub(d.mul,[103.939,116.779,123.68]),d.emotion=P0==null?void 0:P0.execute(d.normalize)):(d.channels=J0.mul(d.resize,C.rgb),d.grayscale=J0.sum(d.channels,3,!0),d.grayscaleSub=J0.sub(d.grayscale,C.tf05),d.grayscaleMul=J0.mul(d.grayscaleSub,C.tf2),d.emotion=P0==null?void 0:P0.execute(d.grayscaleMul)),H3=v();let f=await d.emotion.data();for(let u=0;u(t.face.emotion.minConfidence||0)&&c.push({score:Math.min(.99,Math.trunc(100*f[u])/100),emotion:E5[u]});c.sort((u,g)=>g.score-u.score),Object.keys(d).forEach(u=>J0.dispose(d[u]))}pt[n]=c,B3=o,l(c)}))}var ie=V(G());var k0,Fe=[],Z3=0,X3=0,j5=Number.MAX_SAFE_INTEGER;async function q3(e){var t;return R.initial&&(k0=null),k0?e.debug&&h("cached model:",k0.modelUrl):k0=await L((t=e.face.description)==null?void 0:t.modelPath),k0}function pA(e,t){var s,A;let n=e.image||e.tensor||e;if(!(k0!=null&&k0.inputs[0].shape))return n;let o;if(((s=t.face.description)==null?void 0:s.crop)>0){let a=(A=t.face.description)==null?void 0:A.crop,l=[[a,a,1-a,1-a]];o=ie.image.cropAndResize(n,l,[0],[k0.inputs[0].shape[2],k0.inputs[0].shape[1]])}else o=ie.image.resizeBilinear(n,[k0.inputs[0].shape[2],k0.inputs[0].shape[1]],!1);let r=ie.mul(o,C.tf255);return ie.dispose(o),r}async function I5(e,t,n,o){var a,l,c,x;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(k0!=null&&k0.executor))return r;let s=j5<(((a=t.face.description)==null?void 0:a.skipFrames)||0),A=(((l=t.face.description)==null?void 0:l.skipTime)||0)>v()-Z3;return t.skipAllowed&&s&&A&&X3===o&&((c=Fe==null?void 0:Fe[n])==null?void 0:c.age)>0&&((x=Fe==null?void 0:Fe[n])==null?void 0:x.genderScore)>0?(j5++,Fe[n]):(j5=0,new Promise(async i=>{var y;if((y=t.face.description)!=null&&y.enabled){let d=pA(e,t),m=k0==null?void 0:k0.execute(d);Z3=v(),ie.dispose(d);let u=await m.find(B=>B.shape[1]===1).data(),g=Math.trunc(200*Math.abs(u[0]-.5))/100;g>(t.face.description.minConfidence||0)&&(r.gender=u[0]<=.5?"female":"male",r.genderScore=Math.min(.99,g));let T=ie.argMax(m.find(B=>B.shape[1]===100),1),p=(await T.data())[0];ie.dispose(T);let k=await m.find(B=>B.shape[1]===100).data();r.age=Math.round(k[p-1]>k[p+1]?10*p-100*k[p-1]:10*p+100*k[p+1])/10,(Number.isNaN(u[0])||Number.isNaN(k[0]))&&h("faceres error:",{model:k0,result:m});let P=m.find(B=>B.shape[1]===1024),I=P?await P.data():[];r.descriptor=Array.from(I),m.forEach(B=>ie.dispose(B))}Fe[n]=r,X3=o,i(r)}))}var g2=.1,N5=.5;function uA(e,t,n){let o=!1,r=n.length-1;for(let s=0;st!=n[r].y>t&&e<(n[r].x-n[s].x)*(t-n[s].y)/(n[r].y-n[s].y)+n[s].x&&(o=!o);return o}async function Y3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,o=await e.tensor.buffer(),r=[];for(let A of ae.silhouette)r.push({x:(e.mesh[A][0]-e.box[0])/e.box[2],y:(e.mesh[A][1]-e.box[1])/e.box[3]});g2&&g2>0&&(r=r.map(A=>({x:A.x>.5?A.x+g2:A.x-g2,y:A.y>.5?A.y+g2:A.y-g2})));for(let A=0;Av()-J3,s=L5<(((a=t.face.antispoof)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&K3===o&&ut[n]?(L5++,ut[n]):(L5=0,new Promise(async l=>{let c=ht.image.resizeBilinear(e,[w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[2]:0,w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[1]:0],!1),x=w0==null?void 0:w0.execute(c),i=(await x.data())[0];ut[n]=Math.round(100*i)/100,K3=o,J3=v(),ht.dispose([c,x]),l(ut[n])}))}var gt=V(G());var E0,bt=[],C5=Number.MAX_SAFE_INTEGER,$3=0,en=0;async function tn(e){var t;return R.initial&&(E0=null),E0?e.debug&&h("cached model:",E0.modelUrl):E0=await L((t=e.face.liveness)==null?void 0:t.modelPath),E0}async function W5(e,t,n,o){var A,a;if(!(E0!=null&&E0.executor))return 0;let r=(((A=t.face.liveness)==null?void 0:A.skipTime)||0)>v()-en,s=C5<(((a=t.face.liveness)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&$3===o&&bt[n]?(C5++,bt[n]):(C5=0,new Promise(async l=>{let c=gt.image.resizeBilinear(e,[E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[2]:0,E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[1]:0],!1),x=E0==null?void 0:E0.execute(c),i=(await x.data())[0];bt[n]=Math.round(100*i)/100,$3=o,en=v(),gt.dispose([c,x]),l(bt[n])}))}var Tt=V(G());var le,D5=[],bA=["white","black","asian","indian","other"],gA=[15,23,28,35.5,45.5,55.5,65],on=0,rn=0,F5=Number.MAX_SAFE_INTEGER;async function sn(e){var t;return R.initial&&(le=null),le?e.debug&&h("cached model:",le.modelUrl):le=await L((t=e.face.gear)==null?void 0:t.modelPath),le}async function B5(e,t,n,o){var A,a;if(!le)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=F5<(((A=t.face.gear)==null?void 0:A.skipFrames)||0),s=(((a=t.face.gear)==null?void 0:a.skipTime)||0)>v()-rn;return t.skipAllowed&&s&&r&&on===o&&D5[n]?(F5++,D5[n]):(F5=0,new Promise(async l=>{var g,T,p,b;if(!(le!=null&&le.inputs[0].shape))return;let c={},x=[[0,.1,.9,.9]];if(((g=t.face.gear)==null?void 0:g.crop)>0){let k=(T=t.face.gear)==null?void 0:T.crop;x=[[k,k,1-k,1-k]]}c.resize=Tt.image.cropAndResize(e,x,[0],[le.inputs[0].shape[2],le.inputs[0].shape[1]]);let i={age:0,gender:"unknown",genderScore:0,race:[]};(p=t.face.gear)!=null&&p.enabled&&([c.age,c.gender,c.race]=le.execute(c.resize,["age_output","gender_output","race_output"]));let y=await c.gender.data();i.gender=y[0]>y[1]?"male":"female",i.genderScore=Math.round(100*(y[0]>y[1]?y[0]:y[1]))/100;let d=await c.race.data();for(let k=0;k(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&i.race.push({score:Math.round(100*d[k])/100,race:bA[k]});i.race.sort((k,P)=>P.score-k.score);let f=Array.from(await c.age.data()).map((k,P)=>[gA[P],k]).sort((k,P)=>P[1]-k[1]),u=f[0][0];for(let k=1;kTt.dispose(c[k])),D5[n]=i,on=o,rn=v(),l(i)}))}var s2=V(G());var H0,vt=[],an=0,ln=0,H5=Number.MAX_SAFE_INTEGER;async function cn(e){return R.initial&&(H0=null),H0?e.debug&&h("cached model:",H0.modelUrl):H0=await L(e.face.ssrnet.modelPathAge),H0}async function G5(e,t,n,o){var A,a,l,c;if(!H0)return{age:0};let r=H5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-ln;return t.skipAllowed&&r&&s&&an===o&&((l=vt[n])!=null&&l.age)&&((c=vt[n])==null?void 0:c.age)>0?(H5++,vt[n]):(H5=0,new Promise(async x=>{var d,m,f;if(!(H0!=null&&H0.inputs)||!H0.inputs[0]||!H0.inputs[0].shape)return;let i={};if(((d=t.face.ssrnet)==null?void 0:d.crop)>0){let u=(m=t.face.ssrnet)==null?void 0:m.crop,g=[[u,u,1-u,1-u]];i.resize=s2.image.cropAndResize(e,g,[0],[H0.inputs[0].shape[2],H0.inputs[0].shape[1]])}else i.resize=s2.image.resizeBilinear(e,[H0.inputs[0].shape[2],H0.inputs[0].shape[1]],!1);i.enhance=s2.mul(i.resize,C.tf255);let y={age:0};if((f=t.face.ssrnet)!=null&&f.enabled&&(i.age=H0.execute(i.enhance)),i.age){let u=await i.age.data();y.age=Math.trunc(10*u[0])/10}Object.keys(i).forEach(u=>s2.dispose(i[u])),vt[n]=y,an=o,ln=v(),x(y)}))}var v0=V(G());var N0,Rt=[],xn=0,yn=0,V5=Number.MAX_SAFE_INTEGER,Z5=[.2989,.587,.114];async function fn(e){var t;return R.initial&&(N0=null),N0?e.debug&&h("cached model:",N0.modelUrl):N0=await L((t=e.face.ssrnet)==null?void 0:t.modelPathGender),N0}async function X5(e,t,n,o){var A,a,l,c;if(!N0)return{gender:"unknown",genderScore:0};let r=V5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-yn;return t.skipAllowed&&r&&s&&xn===o&&((l=Rt[n])!=null&&l.gender)&&((c=Rt[n])==null?void 0:c.genderScore)>0?(V5++,Rt[n]):(V5=0,new Promise(async x=>{var m,f,u;if(!(N0!=null&&N0.inputs[0].shape))return;let i={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let g=(f=t.face.ssrnet)==null?void 0:f.crop,T=[[g,g,1-g,1-g]];i.resize=v0.image.cropAndResize(e,T,[0],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]])}else i.resize=v0.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]],!1);i.enhance=v0.tidy(()=>{var T,p;let g;if(((p=(T=N0==null?void 0:N0.inputs)==null?void 0:T[0].shape)==null?void 0:p[3])===1){let[b,k,P]=v0.split(i.resize,3,3),I=v0.mul(b,Z5[0]),B=v0.mul(k,Z5[1]),_=v0.mul(P,Z5[2]),Z=v0.addN([I,B,_]);g=v0.mul(v0.sub(Z,C.tf05),2)}else g=v0.mul(v0.sub(i.resize,C.tf05),2);return g});let y={gender:"unknown",genderScore:0};(u=t.face.ssrnet)!=null&&u.enabled&&(i.gender=N0.execute(i.enhance));let d=await i.gender.data();y.gender=d[0]>d[1]?"female":"male",y.genderScore=d[0]>d[1]?Math.trunc(100*d[0])/100:Math.trunc(100*d[1])/100,Object.keys(i).forEach(g=>v0.dispose(i[g])),Rt[n]=y,xn=o,yn=v(),x(y)}))}var Mt=V(G());var Q0,q5=[],pn=0,un=0,hn=Number.MAX_SAFE_INTEGER;async function bn(e){var t;return R.initial&&(Q0=null),Q0?e.debug&&h("cached model:",Q0.modelUrl):Q0=await L((t=e.face.mobilefacenet)==null?void 0:t.modelPath),Q0}async function U5(e,t,n,o){var A,a;if(!(Q0!=null&&Q0.executor))return[];let r=hn<(((A=t.face.mobilefacenet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.mobilefacenet)==null?void 0:a.skipTime)||0)>v()-un;return t.skipAllowed&&s&&r&&pn===o&&q5[n]?(hn++,q5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.mobilefacenet)!=null&&x.enabled&&(Q0!=null&&Q0.inputs[0].shape)){let i={};i.crop=Mt.image.resizeBilinear(e,[Q0.inputs[0].shape[2],Q0.inputs[0].shape[1]],!1),i.data=Q0.execute(i.crop);let y=await i.data.data();c=Array.from(y),Object.keys(i).forEach(d=>Mt.dispose(i[d]))}q5[n]=c,pn=o,un=v(),l(c)})}var Pt=V(G());var _0,Y5=[],Tn=0,vn=0,Rn=Number.MAX_SAFE_INTEGER;async function Mn(e){return R.initial&&(_0=null),_0?e.debug&&h("cached model:",_0.modelUrl):_0=await L(e.face.insightface.modelPath),_0}async function K5(e,t,n,o){var A,a;if(!(_0!=null&&_0.executor))return[];let r=Rn<(((A=t.face.insightface)==null?void 0:A.skipFrames)||0),s=(((a=t.face.insightface)==null?void 0:a.skipTime)||0)>v()-vn;return t.skipAllowed&&s&&r&&Tn===o&&Y5[n]?(Rn++,Y5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.insightface)!=null&&x.enabled&&(_0!=null&&_0.inputs[0].shape)){let i={};i.crop=Pt.image.resizeBilinear(e,[_0.inputs[0].shape[2],_0.inputs[0].shape[1]],!1),i.data=_0.execute(i.crop);let y=await i.data.data();c=Array.from(y),Object.keys(i).forEach(d=>Pt.dispose(i[d]))}Y5[n]=c,Tn=o,vn=v(),l(c)})}var TA=e=>{let t=(i,y)=>Math.atan2(i[1]-y[1],i[0]-y[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],o=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],A=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],a=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(A[0]-s[0])/a[0]-n[0],o*(s[1]-A[1])/a[1]-n[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return c=Math.min(c,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:c}},kn=(e,t)=>{let n=f=>{let u=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=u,f[1]/=u,f[2]/=u,f},o=(f,u)=>{let g=f[0]-u[0],T=f[1]-u[1],p=f[2]-u[2];return[g,T,p]},r=(f,u)=>{let g=f[1]*u[2]-f[2]*u[1],T=f[2]*u[0]-f[0]*u[2],p=f[0]*u[1]-f[1]*u[0];return[g,T,p]},s=f=>{let[u,g,T,p,b,k,P,I,B]=f,_,Z,$;return p<1?p>-1?($=Math.asin(p),Z=Math.atan2(-P,u),_=Math.atan2(-k,b)):($=-Math.PI/2,Z=-Math.atan2(I,B),_=0):($=Math.PI/2,Z=Math.atan2(I,B),_=0),Number.isNaN(_)&&(_=0),Number.isNaN(Z)&&(Z=0),Number.isNaN($)&&($=0),{pitch:2*-_,yaw:2*-Z,roll:2*-$}},A=e.meshRaw;if(!A||A.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let a=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[A[10],A[152],A[234],A[454]].map(f=>[f[0]*t[0]/a,f[1]*t[1]/a,f[2]]),c=n(o(l[1],l[0])),x=n(o(l[3],l[2])),i=n(r(x,c));x=r(c,i);let y=[x[0],x[1],x[2],c[0],c[1],c[2],i[0],i[1],i[2]],d=s(y),m=A.length===478?TA(e):{bearing:0,strength:0};return{angle:d,matrix:y,gaze:m}};function wn(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let o=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/o)/100}var J5=async(e,t)=>{var m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;let n=v(),o,r,s,A,a,l,c,x,i,y=[];e.state="run:face";let d=await C3(t,e.config);if(e.performance.face=R.perfadd?(e.performance.face||0)+Math.trunc(v()-n):Math.trunc(v()-n),!t.shape||t.shape.length!==4)return[];if(!d)return[];for(let E=0;E200?kn(d[E],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?A=(f=e.config.face.emotion)!=null&&f.enabled?S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[]:(e.state="run:emotion",n=v(),A=(u=e.config.face.emotion)!=null&&u.enabled?await S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[],e.performance.emotion=R.perfadd?(e.performance.emotion||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?c=(g=e.config.face.antispoof)!=null&&g.enabled?O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:antispoof",n=v(),c=(T=e.config.face.antispoof)!=null&&T.enabled?await O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.antispoof=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?x=(p=e.config.face.liveness)!=null&&p.enabled?W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:liveness",n=v(),x=(b=e.config.face.liveness)!=null&&b.enabled?await W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.liveness=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(k=e.config.face.gear)!=null&&k.enabled?B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:gear",n=v(),r=(P=e.config.face.gear)!=null&&P.enabled?await B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.gear=Math.trunc(v()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(o=(I=e.config.face.ssrnet)!=null&&I.enabled?G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(B=e.config.face.ssrnet)!=null&&B.enabled?X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null):(e.state="run:ssrnet",n=v(),o=(_=e.config.face.ssrnet)!=null&&_.enabled?await G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(Z=e.config.face.ssrnet)!=null&&Z.enabled?await X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.ssrnet=Math.trunc(v()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?a=($=e.config.face.mobilefacenet)!=null&&$.enabled?U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),a=(A0=e.config.face.mobilefacenet)!=null&&A0.enabled?await U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(t0=e.config.face.insightface)!=null&&t0.enabled?K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),l=(n0=e.config.face.insightface)!=null&&n0.enabled?await K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?i=I5(d[E].tensor||l0.tensor([]),e.config,E,d.length):(e.state="run:description",n=v(),i=await I5(d[E].tensor||l0.tensor([]),e.config,E,d.length),e.performance.description=R.perfadd?(e.performance.description||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Description:"),e.config.async&&([o,s,A,a,l,i,r,c,x]=await Promise.all([o,s,A,a,l,i,r,c,x])),e.analyze("Finish Face:"),(j0=e.config.face.ssrnet)!=null&&j0.enabled&&o&&s&&(i={...i,age:o.age,gender:s.gender,genderScore:s.genderScore}),(M=e.config.face.gear)!=null&&M.enabled&&r&&(i={...i,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(T0=e.config.face.mobilefacenet)!=null&&T0.enabled&&a&&(i.descriptor=a),(C0=e.config.face.insightface)!=null&&C0.enabled&&l&&(i.descriptor=l);let X=(x0=e.config.face.iris)!=null&&x0.enabled?wn(d[E],t.shape[2]):0,U0=(K=e.config.face.detector)!=null&&K.return?l0.squeeze(d[E].tensor):null;l0.dispose(d[E].tensor),d[E].tensor&&delete d[E].tensor;let y0={...d[E],id:E};i.age&&(y0.age=i.age),i.gender&&(y0.gender=i.gender),i.genderScore&&(y0.genderScore=i.genderScore),i.descriptor&&(y0.embedding=i.descriptor),i.race&&(y0.race=i.race),A&&(y0.emotion=A),c&&(y0.real=c),x&&(y0.live=x),X>0&&(y0.distance=X),H&&(y0.rotation=H),U0&&(y0.tensor=U0),y.push(y0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),y};var G0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>G0.nameMapping[e],getPoints:e=>G0.pointsMapping[e]},He={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>He.nameMapping[e]},c0={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>c0.nameMapping[e]},Be=class{constructor(t){w(this,"name");w(this,"curls");w(this,"directions");w(this,"weights");w(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,o){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,o])}direction(t,n,o){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,o])}weight(t,n){this.weights[t]=n;let o=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/o)}matchAgainst(t,n){let o=0;for(let r in t){let s=t[r],A=this.curls[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}for(let r in n){let s=n[r],A=this.directions[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}return o/10}};var{thumb:fe,index:Pe,middle:ke,ring:A2,pinky:a2}=G0,{none:me,half:RA,full:pe}=He,{verticalUp:T2,verticalDown:Ki,horizontalLeft:Q5,horizontalRight:MA,diagonalUpRight:PA,diagonalUpLeft:v2,diagonalDownRight:Ji,diagonalDownLeft:Qi}=c0,Ge=new Be("thumbs up");Ge.curl(fe,me,1);Ge.direction(fe,T2,1);Ge.direction(fe,v2,.25);Ge.direction(fe,PA,.25);for(let e of[G0.index,G0.middle,G0.ring,G0.pinky])Ge.curl(e,pe,1),Ge.direction(e,Q5,1),Ge.direction(e,MA,1);var h0=new Be("victory");h0.curl(fe,RA,.5);h0.curl(fe,me,.5);h0.direction(fe,T2,1);h0.direction(fe,v2,1);h0.curl(Pe,me,1);h0.direction(Pe,T2,.75);h0.direction(Pe,v2,1);h0.curl(ke,me,1);h0.direction(ke,T2,1);h0.direction(ke,v2,.75);h0.curl(A2,pe,1);h0.direction(A2,T2,.2);h0.direction(A2,v2,1);h0.direction(A2,Q5,.2);h0.curl(a2,pe,1);h0.direction(a2,T2,.2);h0.direction(a2,v2,1);h0.direction(a2,Q5,.2);h0.weight(Pe,2);h0.weight(ke,2);var Ve=new Be("point");Ve.curl(fe,pe,1);Ve.curl(Pe,me,.5);Ve.curl(ke,pe,.5);Ve.curl(A2,pe,.5);Ve.curl(a2,pe,.5);Ve.weight(Pe,2);Ve.weight(ke,2);var Ze=new Be("middle finger");Ze.curl(fe,me,1);Ze.curl(Pe,pe,.5);Ze.curl(ke,pe,.5);Ze.curl(A2,pe,.5);Ze.curl(a2,pe,.5);Ze.weight(Pe,2);Ze.weight(ke,2);var R2=new Be("open palm");R2.curl(fe,me,.75);R2.curl(Pe,me,.75);R2.curl(ke,me,.75);R2.curl(A2,me,.75);R2.curl(a2,me,.75);var En=[Ge,h0,Ve,Ze,R2];var kA=.7,i2={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function zn(e,t,n,o){let r=(t-o)/(e-n),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function jn(e,t){if(!e||!t)return[0,0];let n=zn(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let o=zn(e[1],e[2],t[1],t[2]);return[n,o]}function Sn(e,t=1){let n=0,o=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?o=1*t:r=1*t,[n,o,r]}function wA(e,t,n){let o=e[0]-t[0],r=e[0]-n[0],s=t[0]-n[0],A=e[1]-t[1],a=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],x=e[2]-n[2],i=t[2]-n[2],y=Math.sqrt(o*o+A*A+c*c),d=Math.sqrt(r*r+a*a+x*x),m=Math.sqrt(s*s+l*l+i*i),f=(m*m+y*y-d*d)/(2*m*y);f>1?f=1:f<-1&&(f=-1);let u=Math.acos(f);u=57.2958*u%180;let g;return u>i2.NO_CURL_START_LIMIT?g=He.none:u>i2.HALF_CURL_START_LIMIT?g=He.half:g=He.full,g}function In(e,t,n,o){let r;return o===Math.abs(e)?e>0?r=c0.horizontalLeft:r=c0.horizontalRight:o===Math.abs(t)?t>0?r=c0.horizontalLeft:r=c0.horizontalRight:n>0?r=c0.horizontalLeft:r=c0.horizontalRight,r}function Nn(e,t,n,o){let r;return o===Math.abs(e)?e<0?r=c0.verticalDown:r=c0.verticalUp:o===Math.abs(t)?t<0?r=c0.verticalDown:r=c0.verticalUp:n<0?r=c0.verticalDown:r=c0.verticalUp,r}function EA(e,t,n,o,r,s,A,a){let l,c=Nn(e,t,n,o),x=In(r,s,A,a);return c===c0.verticalUp?x===c0.horizontalLeft?l=c0.diagonalUpLeft:l=c0.diagonalUpRight:x===c0.horizontalLeft?l=c0.diagonalDownLeft:l=c0.diagonalDownRight,l}function zA(e,t,n,o){let r=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],x=Math.max(Math.abs(r),Math.abs(s),Math.abs(A)),i=Math.max(Math.abs(a),Math.abs(l),Math.abs(c)),y=0,d=0,m=0,f=i/(x+1e-5);f>1.5?y+=i2.DISTANCE_VOTE_POWER:f>.66?d+=i2.DISTANCE_VOTE_POWER:m+=i2.DISTANCE_VOTE_POWER;let u=Math.sqrt(r*r+a*a),g=Math.sqrt(s*s+l*l),T=Math.sqrt(A*A+c*c),p=Math.max(u,g,T),b=e[0],k=e[1],P=n[0],I=n[1];p===u?(P=n[0],I=n[1]):p===T&&(b=t[0],k=t[1]);let Z=jn([b,k],[P,I]),$=Sn(Z,i2.TOTAL_ANGLE_VOTE_POWER);y+=$[0],d+=$[1],m+=$[2];for(let t0 of o){let n0=Sn(t0,i2.SINGLE_ANGLE_VOTE_POWER);y+=n0[0],d+=n0[1],m+=n0[2]}let A0;return y===Math.max(y,d,m)?A0=Nn(l,a,c,i):m===Math.max(d,m)?A0=In(s,r,A,x):A0=EA(l,a,c,i,s,r,A,x),A0}function Ln(e){let t=[],n=[],o=[],r=[];if(!e)return{curls:o,directions:r};for(let s of G0.all){let A=G0.getPoints(s),a=[],l=[];for(let c of A){let x=e[c[0]],i=e[c[1]],y=jn(x,i),d=y[0],m=y[1];a.push(d),l.push(m)}t.push(a),n.push(l)}for(let s of G0.all){let A=s===G0.thumb?1:0,a=G0.getPoints(s),l=e[a[A][0]],c=e[a[A+1][1]],x=e[a[3][1]],i=wA(l,c,x),y=zA(l,c,x,t[s].slice(A));o[s]=i,r[s]=y}return{curls:o,directions:r}}function kt(e){if(!e||e.length===0)return null;let t=Ln(e),n={};for(let o of G0.all)n[G0.getName(o)]={curl:He.getName(t.curls[o]),direction:c0.getName(t.directions[o])};return n}function On(e){let t=[];if(!e||e.length===0)return t;let n=Ln(e);for(let o of En){let r=o.matchAgainst(n.curls,n.directions);r>=kA&&t.push({name:o.name,confidence:r})}return t}var Cn=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&&o&&r&&o.position[1]l.part==="leftShoulder"),a=e[n].keypoints.find(l=>l.part==="rightShoulder");A&&a&&Math.abs(A.positionRaw[1]-a.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${A.position[1]>a.position[1]?"left":"right"}`})}return t},Wn=e=>{if(!e)return[];let t=[];for(let n=0;n450){let o=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),r=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(o/r)<=.15?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${o<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 a=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]));a>10&&t.push({face:n,gesture:`mouth ${Math.trunc(a)}% open`});let l=e[n].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:n,gesture:`head ${l<0?"up":"down"}`})}return t},Dn=e=>{var n,o,r,s;if(!e)return[];let t=[];for(let A=0;A.06||u>.06)&&(d=!1),f>u?u>.04&&t.push({iris:A,gesture:"looking right"}):f>.04&&t.push({iris:A,gesture:"looking left"});let g=Math.abs(e[A].mesh[145][1]-e[A].annotations.rightEyeIris[0][1])/e[A].box[3],T=Math.abs(e[A].mesh[374][1]-e[A].annotations.leftEyeIris[0][1])/e[A].box[3];(T<.01||g<.01||T>.022||g>.022)&&(d=!1),(T<.01||g<.01)&&t.push({iris:A,gesture:"looking down"}),(T>.022||g>.022)&&t.push({iris:A,gesture:"looking up"}),d&&t.push({iris:A,gesture:"looking center"})}return t},Fn=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=o.reduce((A,a)=>(A.position[2]||0)<(a.position[2]||0)?A:a);t.push({hand:n,gesture:`${r.name} forward`});let s=o.reduce((A,a)=>A.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:o,palmLandmarks:r,confidence:e.confidence}}function Et(e,t=1.5){let n=C2(e),o=wt(e),r=[t*o[0]/2,t*o[1]/2],s=[n[0]-r[0],n[1]-r[1]],A=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function zt(e){let t=C2(e),n=wt(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],A=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function jA(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Xn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return jA(n)}var Bn=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Xe(e,t){let n=0;for(let o=0;o[A.x,A.y]),this.anchorsTensor=W.tensor2d(this.anchors),this.inputSize=((s=(r=(o=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:o[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=W.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=W.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=W.slice(t,[0,0],[-1,2]),n.boxSizes=W.slice(t,[0,2],[-1,2]),n.div=W.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=W.add(n.div,this.anchorsTensor),n.halfBoxSizes=W.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=W.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=W.mul(n.sub,this.inputSizeTensor),n.add=W.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=W.mul(n.add,this.inputSizeTensor);let o=W.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>W.dispose(n[r])),o}normalizeLandmarks(t,n){let o={};o.reshape=W.reshape(t,[-1,7,2]),o.div=W.div(o.reshape,this.inputSizeTensor),o.landmarks=W.add(o.div,this.anchors[n]?this.anchors[n]:0);let r=W.mul(o.landmarks,this.inputSizeTensor);return Object.keys(o).forEach(s=>W.dispose(o[s])),r}async predict(t,n){var a;let o={};o.resize=W.image.resizeBilinear(t,[this.inputSize,this.inputSize]),o.div=W.div(o.resize,C.tf127),o.image=W.sub(o.div,C.tf1),o.batched=this.model.execute(o.image),o.predictions=W.squeeze(o.batched),o.slice=W.slice(o.predictions,[0,0],[-1,1]),o.sigmoid=W.sigmoid(o.slice),o.scores=W.squeeze(o.sigmoid);let r=await o.scores.data();o.boxes=W.slice(o.predictions,[0,1],[-1,4]),o.norm=this.normalizeBoxes(o.boxes),o.nms=await W.image.nonMaxSuppressionAsync(o.norm,o.scores,3*(((a=n.hand)==null?void 0:a.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let s=await o.nms.array(),A=[];for(let l of s){let c={};c.box=W.slice(o.norm,[l,0],[1,-1]),c.slice=W.slice(o.predictions,[l,5],[1,14]),c.norm=this.normalizeLandmarks(c.slice,l),c.palmLandmarks=W.reshape(c.norm,[-1,2]);let x=await c.box.data(),i=x.slice(0,2),y=x.slice(2,4),d=await c.palmLandmarks.array(),m={startPoint:i,endPoint:y,palmLandmarks:d,confidence:r[l]},f=Zn(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);A.push(f),Object.keys(c).forEach(u=>W.dispose(c[u]))}return Object.keys(o).forEach(l=>W.dispose(o[l])),A}};var $0=V(G());var OA=5,Kn=1.65,Jn=[0,5,9,13,17,1,2],CA=0,WA=2,Qn=0,jt=class{constructor(t,n){w(this,"handDetector");w(this,"handPoseModel");w(this,"inputSize");w(this,"storedBoxes");w(this,"skipped");w(this,"detectedHands");var o,r,s;this.handDetector=t,this.handPoseModel=n,this.inputSize=((s=(r=(o=this.handPoseModel)==null?void 0:o.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(A=>A[0]),o=t.map(A=>A[1]),r=[Math.min(...n),Math.min(...o)],s=[Math.max(...n),Math.max(...o)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let o=t.map(s=>e1([...s,1],n)),r=this.calculateLandmarksBoundingBox(o);return Et(zt(r),OA)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),o=Et(zt(n),Kn);o.palmLandmarks=[];for(let r=0;r[A[0]*(d[0]-this.inputSize/2),A[1]*(d[1]-this.inputSize/2),A[2]*d[2]]),l=$5(o,[0,0]),c=a.map(d=>[...e1(d,l),d[2]]),x=qn(r),i=[...C2(n),1],y=[Xe(i,x[0]),Xe(i,x[1])];return c.map(d=>[Math.trunc(d[0]+y[0]),Math.trunc(d[1]+y[1]),Math.trunc(d[2])])}async estimateHands(t,n){let o=!1,r,s=(n.hand.skipTime||0)>v()-Qn,A=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&s&&A?this.skipped++:(r=await this.handDetector.predict(t,n),this.skipped=0),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&&(o=!0));let a=[];for(let l=0;l=n.hand.minConfidence/4){let k=$0.reshape(p,[-1,3]),P=await k.array();$0.dispose(p),$0.dispose(k);let I=this.transformRawCoords(P,f,x,m),B=this.getBoxForHandLandmarks(I);this.storedBoxes[l]={...B,confidence:b};let _={landmarks:I,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:B.startPoint,bottomRight:B.endPoint}};a.push(_)}else this.storedBoxes[l]=null;$0.dispose(p)}else{let x=Et(zt(c),Kn),i={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:x.startPoint,bottomRight:x.endPoint},landmarks:[]};a.push(i)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=a.length,a.length>n.hand.maxDetected&&(a.length=n.hand.maxDetected),a}};var _n={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},l2,c2,t1;function FA(){let e=l2?new St(l2):void 0;e&&c2&&(t1=new jt(e,c2))}async function n1(e,t){t1||FA();let n=await t1.estimateHands(e,t);if(!n)return[];let o=[];for(let r=0;rn[r].landmarks[i]);let A=n[r].landmarks,a=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(A&&A.length>0){for(let x of A)x[0]a[2]&&(a[2]=x[0]),x[1]>a[3]&&(a[3]=x[1]);a[2]-=a[0],a[3]-=a[1],l=[a[0]/(e.shape[2]||0),a[1]/(e.shape[1]||0),a[2]/(e.shape[2]||0),a[3]/(e.shape[1]||0)]}else a=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=kt(A);o.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:a,boxRaw:l,keypoints:A,annotations:s,landmarks:c})}return o}async function $n(e){var t;return R.initial&&(l2=null),l2?e.debug&&h("cached model:",l2.modelUrl):l2=await L((t=e.hand.detector)==null?void 0:t.modelPath),l2}async function eo(e){var t;return R.initial&&(c2=null),c2?e.debug&&h("cached model:",c2.modelUrl):c2=await L((t=e.hand.skeleton)==null?void 0:t.modelPath),c2}var Q=V(G());var p0=[null,null],BA=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],qe=[[0,0],[0,0]],HA=["hand","fist","pinch","point","face","tip","pinchtip"],no=4,oo=1.6,GA=512,VA=1.4,It=Number.MAX_SAFE_INTEGER,o1=0,we=[0,0],m0={boxes:[],hands:[]},ro={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function so(e){var t;if(R.initial&&(p0[0]=null),p0[0])e.debug&&h("cached model:",p0[0].modelUrl);else{J2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),p0[0]=await L((t=e.hand.detector)==null?void 0:t.modelPath);let n=p0[0].executor?Object.values(p0[0].modelSignature.inputs):void 0;qe[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[0]}async function Ao(e){var t;if(R.initial&&(p0[1]=null),p0[1])e.debug&&h("cached model:",p0[1].modelUrl);else{p0[1]=await L((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=p0[1].executor?Object.values(p0[1].modelSignature.inputs):void 0;qe[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[1]}async function ZA(e,t){let n=[];if(!e||!p0[0])return n;let o={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,GA),A=Math.round(s*r/8)*8;o.resize=Q.image.resizeBilinear(e,[s,A]),o.cast=Q.cast(o.resize,"int32"),[o.rawScores,o.rawBoxes]=await p0[0].executeAsync(o.cast,BA),o.boxes=Q.squeeze(o.rawBoxes,[0,2]),o.scores=Q.squeeze(o.rawScores,[0]);let a=Q.unstack(o.scores,1);Q.dispose(a[no]),a.splice(no,1),o.filtered=Q.stack(a,1),Q.dispose(a),o.max=Q.max(o.filtered,1),o.argmax=Q.argMax(o.filtered,1);let l=0;o.nms=await Q.image.nonMaxSuppressionAsync(o.boxes,o.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let c=await o.nms.data(),x=await o.max.data(),i=await o.argmax.data();for(let y of Array.from(c)){let d=Q.slice(o.boxes,y,1),m=await d.data();Q.dispose(d);let f=[m[1],m[0],m[3]-m[1],m[2]-m[0]],u=st(f,VA),g=[Math.trunc(f[0]*we[0]),Math.trunc(f[1]*we[1]),Math.trunc(f[2]*we[0]),Math.trunc(f[3]*we[1])],T=x[y],p=HA[i[y]],b={id:l++,score:T,box:g,boxRaw:u,label:p};n.push(b)}return Object.keys(o).forEach(y=>Q.dispose(o[y])),n.sort((y,d)=>d.score-y.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function r1(e,t,n){let o={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&p0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=Q.image.cropAndResize(e,[s],[0],[qe[1][0],qe[1][1]],"bilinear"),r.div=Q.div(r.crop,C.tf255),[r.score,r.keypoints]=p0[1].execute(r.div,["Identity_1","Identity"]);let A=(await r.score.data())[0],a=(100-Math.trunc(100/(1+Math.exp(A))))/100;if(a>=(n.hand.minConfidence||0)){o.fingerScore=a,r.reshaped=Q.reshape(r.keypoints,[-1,3]);let x=(await r.reshaped.array()).map(i=>[i[0]/qe[1][1],i[1]/qe[1][0],i[2]||0]).map(i=>[i[0]*t.boxRaw[2],i[1]*t.boxRaw[3],i[2]||0]);o.keypoints=x.map(i=>[we[0]*(i[0]+t.boxRaw[0]),we[1]*(i[1]+t.boxRaw[1]),i[2]||0]),o.landmarks=kt(o.keypoints);for(let i of Object.keys(ro))o.annotations[i]=ro[i].map(y=>o.landmarks&&o.keypoints[y]?o.keypoints[y]:null)}Object.keys(r).forEach(l=>Q.dispose(r[l]))}return o}async function s1(e,t){var r,s;if(!((r=p0[0])!=null&&r.executor)||!((s=p0[1])!=null&&s.executor)||!p0[0].inputs[0].shape||!p0[1].inputs[0].shape)return[];we=[e.shape[2]||0,e.shape[1]||0],It++;let n=(t.hand.skipTime||0)>v()-o1,o=It<(t.hand.skipFrames||0);return t.skipAllowed&&n&&o?m0.hands:new Promise(async A=>{let a=3*(t.hand.skipTime||0)>v()-o1,l=It<3*(t.hand.skipFrames||0);t.skipAllowed&&m0.hands.length===t.hand.maxDetected?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):t.skipAllowed&&a&&l&&m0.hands.length>0?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):(m0.boxes=await ZA(e,t),o1=v(),m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))),It=0);let c=[...m0.boxes];if(m0.boxes.length=0,t.cacheSensitivity>0)for(let x=0;x.05&&i.box[3]/(e.shape[1]||1)>.05&&m0.hands[x].fingerScore&&m0.hands[x].fingerScore>(t.hand.minConfidence||0)){let y=st(i.box,oo),d=st(i.boxRaw,oo);m0.boxes.push({...c[x],box:y,boxRaw:d})}}for(let x=0;x({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var W2={};ze(W2,{connected:()=>Lt,horizontal:()=>A1,kpt:()=>Nt,relative:()=>i1,vertical:()=>a1});var Nt=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],A1=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],a1=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],i1=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],Lt={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var z=Te(),l1=0;function io(e,t){var A,a,l,c,x,i,y,d,m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0;let n=v();if(!e)return Te();let o=Date.now()-e.timestamp,r=o<1e3?8-Math.log(o+1):1;if(e.canvas&&(z.canvas=e.canvas),e.error&&(z.error=e.error),!z.body||e.body.length!==z.body.length)z.body=JSON.parse(JSON.stringify(e.body));else for(let M=0;M((r-1)*z.body[M].box[X]+H)/r),C0=e.body[M].boxRaw.map((H,X)=>((r-1)*z.body[M].boxRaw[X]+H)/r),x0=e.body[M].keypoints.map((H,X)=>{var U0,y0,Ee,k2,x2,E1,z1,S1,j1;return{score:H.score,part:H.part,position:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[0]||0)+(H.position[0]||0))/r:H.position[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[1]||0)+(H.position[1]||0))/r:H.position[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[2]||0)+(H.position[2]||0))/r:H.position[2]],positionRaw:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[0]||0)+(H.positionRaw[0]||0))/r:H.positionRaw[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[1]||0)+(H.positionRaw[1]||0))/r:H.positionRaw[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[2]||0)+(H.positionRaw[2]||0))/r:H.positionRaw[2]],distance:[z.body[M].keypoints[X]?((r-1)*(((U0=z.body[M].keypoints[X].distance)==null?void 0:U0[0])||0)+(((y0=H.distance)==null?void 0:y0[0])||0))/r:(Ee=H.distance)==null?void 0:Ee[0],z.body[M].keypoints[X]?((r-1)*(((k2=z.body[M].keypoints[X].distance)==null?void 0:k2[1])||0)+(((x2=H.distance)==null?void 0:x2[1])||0))/r:(E1=H.distance)==null?void 0:E1[1],z.body[M].keypoints[X]?((r-1)*(((z1=z.body[M].keypoints[X].distance)==null?void 0:z1[2])||0)+(((S1=H.distance)==null?void 0:S1[2])||0))/r:(j1=H.distance)==null?void 0:j1[2]]}}),K={},E={connected:{}};(A=t.body.modelPath)!=null&&A.includes("efficientpose")?E=it:(a=t.body.modelPath)!=null&&a.includes("blazepose")?E=ot:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(E=W2);for(let[H,X]of Object.entries(E.connected)){let U0=[];for(let y0=0;y0x2.part===X[y0]),k2=x0.find(x2=>x2.part===X[y0+1]);Ee&&k2&&U0.push([Ee.position,k2.position])}K[H]=U0}z.body[M]={...e.body[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.hand||e.hand.length!==z.hand.length)z.hand=JSON.parse(JSON.stringify(e.hand));else for(let M=0;M((r-1)*z.hand[M].box[H]+E)/r),C0=e.hand[M].boxRaw.map((E,H)=>((r-1)*z.hand[M].boxRaw[H]+E)/r);z.hand[M].keypoints.length!==e.hand[M].keypoints.length&&(z.hand[M].keypoints=e.hand[M].keypoints);let x0=e.hand[M].keypoints&&e.hand[M].keypoints.length>0?e.hand[M].keypoints.map((E,H)=>E.map((X,U0)=>((r-1)*(z.hand[M].keypoints[H][U0]||1)+(X||0))/r)):[],K={};if(Object.keys(z.hand[M].annotations).length!==Object.keys(e.hand[M].annotations).length)z.hand[M].annotations=e.hand[M].annotations,K=z.hand[M].annotations;else if(e.hand[M].annotations)for(let E of Object.keys(e.hand[M].annotations))K[E]=(i=(x=(c=e.hand[M])==null?void 0:c.annotations)==null?void 0:x[E])!=null&&i[0]?e.hand[M].annotations[E].map((H,X)=>H.map((U0,y0)=>((r-1)*z.hand[M].annotations[E][X][y0]+U0)/r)):null;z.hand[M]={...e.hand[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.face||e.face.length!==z.face.length)z.face=JSON.parse(JSON.stringify(e.face));else for(let M=0;M((r-1)*z.face[M].box[E]+K)/r),C0=e.face[M].boxRaw.map((K,E)=>((r-1)*z.face[M].boxRaw[E]+K)/r),x0=e.face[M].annotations;if(Object.keys(z.face[M].annotations).length!==Object.keys(e.face[M].annotations).length)z.face[M].annotations=e.face[M].annotations,x0=z.face[M].annotations;else if(e.face[M].annotations)for(let K of Object.keys(e.face[M].annotations))x0[K]=(m=(d=(y=e.face[M])==null?void 0:y.annotations)==null?void 0:d[K])!=null&&m[0]?e.face[M].annotations[K].map((E,H)=>E.map((X,U0)=>((r-1)*z.face[M].annotations[K][H][U0]+X)/r)):null;if(e.face[M].rotation){let K={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};K.matrix=(f=e.face[M].rotation)==null?void 0:f.matrix,K.angle={roll:((r-1)*(((g=(u=z.face[M].rotation)==null?void 0:u.angle)==null?void 0:g.roll)||0)+(((p=(T=e.face[M].rotation)==null?void 0:T.angle)==null?void 0:p.roll)||0))/r,yaw:((r-1)*(((k=(b=z.face[M].rotation)==null?void 0:b.angle)==null?void 0:k.yaw)||0)+(((I=(P=e.face[M].rotation)==null?void 0:P.angle)==null?void 0:I.yaw)||0))/r,pitch:((r-1)*(((_=(B=z.face[M].rotation)==null?void 0:B.angle)==null?void 0:_.pitch)||0)+((($=(Z=e.face[M].rotation)==null?void 0:Z.angle)==null?void 0:$.pitch)||0))/r},K.gaze={bearing:((r-1)*(((A0=z.face[M].rotation)==null?void 0:A0.gaze.bearing)||0)+(((t0=e.face[M].rotation)==null?void 0:t0.gaze.bearing)||0))/r,strength:((r-1)*(((n0=z.face[M].rotation)==null?void 0:n0.gaze.strength)||0)+(((j0=e.face[M].rotation)==null?void 0:j0.gaze.strength)||0))/r},z.face[M]={...e.face[M],rotation:K,box:T0,boxRaw:C0,annotations:x0}}else z.face[M]={...e.face[M],box:T0,boxRaw:C0,annotations:x0}}if(!z.object||e.object.length!==z.object.length)z.object=JSON.parse(JSON.stringify(e.object));else for(let M=0;M((r-1)*z.object[M].box[K]+x0)/r),C0=e.object[M].boxRaw.map((x0,K)=>((r-1)*z.object[M].boxRaw[K]+x0)/r);z.object[M]={...e.object[M],box:T0,boxRaw:C0}}if(e.persons){let M=e.persons;if(!z.persons||M.length!==z.persons.length)z.persons=JSON.parse(JSON.stringify(M));else for(let T0=0;T0((r-1)*z.persons[T0].box[x0]+C0)/r)}e.gesture&&(z.gesture=e.gesture),z.width=e.width,z.height=e.height;let s=v();return l1=R.perfadd?l1+Math.round(s-n):Math.round(s-n),e.performance&&(z.performance={...e.performance,interpolate:l1}),z}var s0=V(G());var L0;async function c1(e){return!L0||R.initial?L0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",L0.modelUrl),L0}async function lo(e,t){var r;if(L0||(L0=await c1(t)),!(L0!=null&&L0.executor)||!((r=L0==null?void 0:L0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=s0.image.resizeBilinear(e,[L0.inputs[0].shape?L0.inputs[0].shape[1]:0,L0.inputs[0].shape?L0.inputs[0].shape[2]:0],!1),n.norm=s0.div(n.resize,C.tf255),n.res=L0.execute(n.norm),n.squeeze=s0.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=s0.unstack(n.squeeze,2),n.fg=s0.softmax(n.fgRaw),n.mul=s0.mul(n.fg,C.tf255),n.expand=s0.expandDims(n.mul,2),n.output=s0.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let o;switch(t.segmentation.mode||"default"){case"default":n.input=s0.squeeze(e),n.concat=s0.concat([n.input,n.output],-1),o=s0.cast(n.concat,"int32");break;case"alpha":o=s0.cast(n.output,"int32");break;default:o=s0.tensor(0)}return Object.keys(n).forEach(s=>s0.dispose(n[s])),o}var Ot={};ze(Ot,{distance:()=>d1,find:()=>UA,similarity:()=>qA});function d1(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let o=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(o-n);return Math.max(Math.min(s,1),0)};function qA(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let o=d1(e,t,n);return xo(o,n.order||2,n.min||0,n.max||1)}function UA(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let o=Number.MAX_SAFE_INTEGER,r=-1;for(let A=0;AH2,validateModel:()=>Gt});var D2=V(G());var Ue=V(G());var yo=.005,ee={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function x1(e){for(let t of A1){let n=e.keypoints.findIndex(r=>r.part===t[0]),o=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[0]r&&r.part===t[0]),o=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),s=e.keypoints.findIndex(c=>c&&c.part===n[0]),A=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[s]||!e.keypoints[A])continue;let a=e.keypoints[o]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[o].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[o].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(a[0]>a[1]||l[0]>l[1]){let c=e.keypoints[o];e.keypoints[o]=e.keypoints[r],e.keypoints[r]=c}}}function fo(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Ue.pad(e,ee.padding),n.resize=Ue.image.resizeBilinear(n.pad,[t,t]);let o=Ue.cast(n.resize,"int32");return Object.keys(n).forEach(A=>Ue.dispose(n[A])),o}function po(e,t){e.keypoints=e.keypoints.filter(o=>o==null?void 0:o.position);for(let o of e.keypoints)o.position=[o.position[0]*(t[0]+ee.padding[2][0]+ee.padding[2][1])/t[0]-ee.padding[2][0],o.position[1]*(t[1]+ee.padding[1][0]+ee.padding[1][1])/t[1]-ee.padding[1][0]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1]];let n=Le(e.keypoints.map(o=>o.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var b0,Ct=0,y1=Number.MAX_SAFE_INTEGER,d2={boxes:[],bodies:[],last:0};async function uo(e){var t;return R.initial&&(b0=null),b0?e.debug&&h("cached model:",b0.modelUrl):(J2(["size"],e),b0=await L(e.body.modelPath)),Ct=b0!=null&&b0.executor&&((t=b0==null?void 0:b0.inputs)!=null&&t[0].shape)?b0.inputs[0].shape[2]:0,Ct<64&&(Ct=256),D2.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&D2.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),b0}function KA(e,t,n){let o=e[0][0],r=[],s=0;for(let x=0;xt.body.minConfidence){let i=[o[x][1],o[x][0]];r.push({score:Math.round(100*s)/100,part:Nt[x],positionRaw:i,position:[Math.round((n.shape[2]||0)*i[0]),Math.round((n.shape[1]||0)*i[1])]})}s=r.reduce((x,i)=>i.score>x?i.score:x,0);let A=[],a=Le(r.map(x=>x.position),[n.shape[2],n.shape[1]]),l={};for(let[x,i]of Object.entries(Lt)){let y=[];for(let d=0;du.part===i[d]),f=r.find(u=>u.part===i[d+1]);m&&f&&m.score>(t.body.minConfidence||0)&&f.score>(t.body.minConfidence||0)&&y.push([m.position,f.position])}l[x]=y}let c={id:0,score:s,box:a.box,boxRaw:a.boxRaw,keypoints:r,annotations:l};return x1(c),A.push(c),A}function JA(e,t,n){let o=[];for(let r=0;rt.body.minConfidence){let a=[];for(let y=0;y<17;y++){let d=s[3*y+2];if(d>t.body.minConfidence){let m=[s[3*y+1],s[3*y+0]];a.push({part:Nt[y],score:Math.round(100*d)/100,positionRaw:m,position:[Math.round((n.shape[2]||0)*m[0]),Math.round((n.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],c=[Math.trunc(l[0]*(n.shape[2]||0)),Math.trunc(l[1]*(n.shape[1]||0)),Math.trunc(l[2]*(n.shape[2]||0)),Math.trunc(l[3]*(n.shape[1]||0))],x={};for(let[y,d]of Object.entries(Lt)){let m=[];for(let f=0;fT.part===d[f]),g=a.find(T=>T.part===d[f+1]);u&&g&&u.score>(t.body.minConfidence||0)&&g.score>(t.body.minConfidence||0)&&m.push([u.position,g.position])}x[y]=m}let i={id:r,score:A,box:c,boxRaw:l,keypoints:[...a],annotations:x};x1(i),o.push(i)}}return o.sort((r,s)=>s.score-r.score),o.length>t.body.maxDetected&&(o.length=t.body.maxDetected),o}async function f1(e,t){var r;if(!(b0!=null&&b0.executor)||!((r=b0==null?void 0:b0.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(d2.boxes.length=0),y1++;let n=(t.body.skipTime||0)>v()-d2.last,o=y1<(t.body.skipFrames||0);return t.skipAllowed&&n&&o?d2.bodies:new Promise(async s=>{let A={};y1=0,A.input=mo(e,Ct),A.res=b0==null?void 0:b0.execute(A.input),d2.last=v();let a=await A.res.array();d2.bodies=A.res.shape[2]===17?KA(a,t,e):JA(a,t,e);for(let l of d2.bodies)po(l,[e.shape[2]||1,e.shape[1]||1]),fo(l.keypoints);Object.keys(A).forEach(l=>D2.dispose(A[l])),s(d2.bodies)})}var S0=V(G());var ce,Wt=[],bo=0,m1=Number.MAX_SAFE_INTEGER,Ft=0,Dt=2.5;async function go(e){if(!ce||R.initial){ce=await L(e.object.modelPath);let t=ce!=null&&ce.executor?Object.values(ce.modelSignature.inputs):void 0;Ft=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&h("cached model:",ce.modelUrl);return ce}async function QA(e,t,n){var c,x;let o=0,r=[],s=Ft;for(let i of[1,2,4]){let y=i*13,d=S0.squeeze(e.find(p=>p.shape[1]===y**2&&(p.shape[2]||0)===m2.length)),m=await d.array(),f=S0.squeeze(e.find(p=>p.shape[1]===y**2&&(p.shape[2]||0)(n.object.minConfidence||0)&&b!==61){let P=(.5+Math.trunc(p%y))/y,I=(.5+Math.trunc(p/y))/y,B=T[p].map(M=>M*(y/i/s)),[_,Z]=[P-Dt/i*B[0],I-Dt/i*B[1]],[$,A0]=[P+Dt/i*B[2]-_,I+Dt/i*B[3]-Z],t0=[_,Z,$,A0];t0=t0.map(M=>Math.max(0,Math.min(M,1)));let n0=[t0[0]*t[0],t0[1]*t[1],t0[2]*t[0],t0[3]*t[1]],j0={id:o++,score:Math.round(100*k)/100,class:b+1,label:m2[b].label,box:n0.map(M=>Math.trunc(M)),boxRaw:t0};r.push(j0)}}S0.dispose([d,f,u,g])}let A=r.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),a=r.map(i=>i.score),l=[];if(A&&A.length>0){let i=await S0.image.nonMaxSuppressionAsync(A,a,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);l=Array.from(await i.data()),S0.dispose(i)}return r=r.filter((i,y)=>l.includes(y)).sort((i,y)=>y.score-i.score),r}async function p1(e,t){if(!(ce!=null&&ce.executor))return[];let n=(t.object.skipTime||0)>v()-bo,o=m1<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&Wt.length>0?(m1++,Wt):(m1=0,!R.kernels.includes("mod")||!R.kernels.includes("sparsetodense")?Wt:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=S0.image.resizeBilinear(e,[Ft,Ft],!1),a=S0.div(A,C.tf255),l=S0.transpose(a,[0,3,1,2]),c;t.object.enabled&&(c=ce.execute(l)),bo=v();let x=await QA(c,s,t);Wt=x,S0.dispose([A,a,l,...c]),r(x)}))}var V0=V(G());var B2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],_A=B2.length,F2=B2.reduce((e,t,n)=>(e[t]=n,e),{}),$A=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],V7=$A.map(([e,t])=>[F2[e],F2[t]]),vo=[["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 Ro(e){let t=e.reduce(({maxX:n,maxY:o,minX:r,minY:s},{position:{x:A,y:a}})=>({maxX:Math.max(n,A),maxY:Math.max(o,a),minX:Math.min(r,A),minY:Math.min(s,a)}),{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 Mo(e,[t,n],[o,r]){let s=t/o,A=n/r,a=(c,x)=>({id:x,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/o,c.box[2]/r,c.box[3]/o],box:[Math.trunc(c.box[0]*A),Math.trunc(c.box[1]*s),Math.trunc(c.box[2]*A),Math.trunc(c.box[3]*s)],keypoints:c.keypoints.map(({score:i,part:y,position:d})=>({score:i,part:y,position:[Math.trunc(d.x*A),Math.trunc(d.y*s)],positionRaw:[d.x/o,d.y/o]})),annotations:{}});return e.map((c,x)=>a(c,x))}var Bt=class{constructor(t,n){w(this,"priorityQueue");w(this,"numberOfElements");w(this,"getElementValue");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 Po(e,t,n,o){let r=n-e,s=o-t;return r*r+s*s}function g1(e,t){return{x:e.x+t.x,y:e.y+t.y}}var te,ta=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],Ht=1,M2=16,na=50**2;function ko(e,t,n,o,r,s,A=2){let a=g=>({y:s.get(g.y,g.x,e),x:s.get(g.y,g.x,s.shape[2]/2+e)}),l=(g,T,p)=>({y:b1(Math.round(g.y/M2),0,T-1),x:b1(Math.round(g.x/M2),0,p-1)}),[c,x]=o.shape,i=l(t.position,c,x),y=a(i),m=g1(t.position,y);for(let g=0;g[F2[y],F2[d]]),A=s.map(([,y])=>y),a=s.map(([y])=>y),l=t.shape[2],c=A.length,x=new Array(l),i=h1(e.part,M2,n);x[e.part.id]={score:e.score,part:B2[e.part.id],position:i};for(let y=c-1;y>=0;--y){let d=A[y],m=a[y];x[d]&&!x[m]&&(x[m]=ko(y,x[d],m,t,n,r))}for(let y=0;yt){a=!1;break}if(!a)break}return a}function sa(e,t){let[n,o,r]=t.shape,s=new Bt(n*o*r,({score:A})=>A);for(let A=0;A{var A;let s=(A=r[o])==null?void 0:A.position;return s?Po(n,t,s.y,s.x)<=na:!1})}function Aa(e,t){return t.reduce((o,{position:r,score:s},A)=>(wo(e,r,A)||(o+=s),o),0)/t.length}function aa(e,t,n,o,r,s){let A=[],a=sa(s,t);for(;A.lengthd.score>s);let i=Aa(A,x),y=Ro(x);i>s&&A.push({keypoints:x,box:y,score:Math.round(100*i)/100})}return A}async function T1(e,t){if(!(te!=null&&te.executor))return[];let n=V0.tidy(()=>{if(!te.inputs[0].shape)return[];let A=V0.image.resizeBilinear(e,[te.inputs[0].shape[2],te.inputs[0].shape[1]]),a=V0.sub(V0.div(V0.cast(A,"float32"),127.5),1),c=te.execute(a,ta).map(x=>V0.squeeze(x,[0]));return c[1]=V0.sigmoid(c[1]),c}),o=await Promise.all(n.map(A=>A.buffer()));for(let A of n)V0.dispose(A);let r=aa(o[0],o[1],o[2],o[3],t.body.maxDetected,t.body.minConfidence);return te.inputs[0].shape?Mo(r,[e.shape[1],e.shape[2]],[te.inputs[0].shape[2],te.inputs[0].shape[1]]):[]}async function Eo(e){return!te||R.initial?te=await L(e.body.modelPath):e.debug&&h("cached model:",te.modelUrl),te}var F=V(G());var ve,ia=["fgr","pha","r1o","r2o","r3o","r4o"],g0={},R1=0;function jo(e){F.dispose([g0.r1i,g0.r2i,g0.r3i,g0.r4i,g0.downsample_ratio]),g0.r1i=F.tensor(0),g0.r2i=F.tensor(0),g0.r3i=F.tensor(0),g0.r4i=F.tensor(0),R1=e.segmentation.ratio||.5,g0.downsample_ratio=F.tensor(R1)}async function M1(e){return!ve||R.initial?ve=await L(e.segmentation.modelPath):e.debug&&h("cached model:",ve.modelUrl),jo(e),ve}var So=e=>F.tidy(()=>{let t=F.squeeze(e,[0]),n=F.mul(t,C.tf255);return F.cast(n,"int32")});function v1(e,t){let n=e?So(e):F.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),o=t?So(t):F.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=F.concat([n,o],-1);return F.dispose([n,o]),r}function la(e){return F.tidy(()=>{let t={};return t.unstack=F.unstack(e,-1),t.concat=F.concat(t.unstack,1),t.split=F.split(t.concat,4,1),t.stack=F.concat(t.split,2),t.squeeze=F.squeeze(t.stack,[0]),t.expand=F.expandDims(t.squeeze,-1),t.add=F.add(t.expand,1),t.mul=F.mul(t.add,127.5),t.cast=F.cast(t.mul,"int32"),t.tile=F.tile(t.cast,[1,1,3]),t.alpha=F.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),F.concat([t.tile,t.alpha],-1)})}async function Io(e,t){if(ve||(ve=await M1(t)),!(ve!=null&&ve.executor))return null;g0.src=F.div(e,255),R1!==t.segmentation.ratio&&jo(t);let[n,o,r,s,A,a]=await ve.executeAsync(g0,ia),l;switch(t.segmentation.mode||"default"){case"default":l=v1(n,o);break;case"alpha":l=v1(null,o);break;case"foreground":l=v1(n,null);break;case"state":l=la(r);break;default:l=F.tensor(0)}return F.dispose([g0.src,n,o,g0.r1i,g0.r2i,g0.r3i,g0.r4i]),[g0.r1i,g0.r2i,g0.r3i,g0.r4i]=[r,s,A,a],l}var z0=V(G());var O0;async function P1(e){return!O0||R.initial?O0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",O0.modelUrl),O0}async function Lo(e,t){var r;if(O0||(O0=await P1(t)),!(O0!=null&&O0.executor)||!((r=O0==null?void 0:O0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=z0.image.resizeBilinear(e,[O0.inputs[0].shape?O0.inputs[0].shape[1]:0,O0.inputs[0].shape?O0.inputs[0].shape[2]:0],!1),n.norm=z0.div(n.resize,C.tf255),n.res=O0.execute(n.norm),n.squeeze=z0.squeeze(n.res,[0]),n.alpha=z0.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=z0.mul(n.alpha,C.tf255);let o;switch(t.segmentation.mode||"default"){case"default":n.input=z0.squeeze(e),n.concat=z0.concat([n.input,n.mul],-1),o=z0.cast(n.concat,"int32");break;case"alpha":o=z0.cast(n.mul,"int32");break;default:o=z0.tensor(0)}return Object.keys(n).forEach(s=>z0.dispose(n[s])),o}function Gt(e,t,n){var c,x;if(!t||!((c=e==null?void 0:e.config)!=null&&c.validateModels))return null;let o=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],A=[],a=t.modelUrl,l=t.executor;if((x=l==null?void 0:l.graph)!=null&&x.nodes)for(let i of Object.values(l.graph.nodes)){let y=i.op.toLowerCase();s.includes(y)||s.push(y)}else!l&&e.config.debug&&h("model not loaded",n);for(let i of s)!o.includes(i)&&!r.includes(i)&&!e.env.kernels.includes(i)&&!e.env.kernels.includes(i.replace("_",""))&&!e.env.kernels.includes(i.replace("native",""))&&!e.env.kernels.includes(i.replace("v2",""))&&A.push(i);return e.config.debug&&A.length>0&&h("model validation failed:",n,A),A.length>0?{name:n,missing:A,ops:s,url:a}:null}var H2=class{constructor(t){w(this,"instance");w(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,o=0;for(let s of Object.values(I0))t+=s.sizeFromManifest,n+=s.sizeLoadedWeights,o+=s.sizeDesired;let r=o>0?n/o:0;return{numLoadedModels:Object.values(I0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:o,modelStats:Object.values(I0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var o,r,s,A,a,l,c,x,i,y,d,m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0;R.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?k3(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((o=this.instance.config.face.antispoof)!=null&&o.enabled)&&!this.models.antispoof?Q3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?tn(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?q3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((A=this.instance.config.face.emotion)!=null&&A.enabled)&&!this.models.emotion?G3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((a=this.instance.config.face.iris)!=null&&a.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?I3(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((c=this.instance.config.face.mesh)!=null&&c.enabled)&&!this.models.facemesh?W3(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((x=this.instance.config.face.gear)!=null&&x.enabled)&&!this.models.gear?sn(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((i=this.instance.config.face.ssrnet)!=null&&i.enabled)&&!this.models.ssrnetage?cn(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((y=this.instance.config.face.ssrnet)!=null&&y.enabled)&&!this.models.ssrnetgender?fn(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((d=this.instance.config.face.mobilefacenet)!=null&&d.enabled)&&!this.models.mobilefacenet?bn(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?Mn(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((f=this.instance.config.body.modelPath)!=null&&f.includes("blazepose"))?a3(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?A3(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((u=this.instance.config.body.modelPath)!=null&&u.includes("efficientpose"))?y3(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((g=this.instance.config.body.modelPath)!=null&&g.includes("movenet"))?uo(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("posenet"))?Eo(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(p=this.instance.config.hand.detector)==null?void 0:p.modelPath)!=null&&b.includes("handtrack"))?so(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((P=(k=this.instance.config.hand.detector)==null?void 0:k.modelPath)!=null&&P.includes("handtrack"))?Ao(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((B=(I=this.instance.config.hand.detector)==null?void 0:I.modelPath)!=null&&B.includes("handdetect"))&&(n.handdetect=$n(this.instance.config),n.handskeleton=eo(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((_=this.instance.config.object.modelPath)!=null&&_.includes("centernet"))?c3(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((Z=this.instance.config.object.modelPath)!=null&&Z.includes("nanodet"))?go(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&(($=this.instance.config.segmentation.modelPath)!=null&&$.includes("selfie"))?P1(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((A0=this.instance.config.segmentation.modelPath)!=null&&A0.includes("meet"))?c1(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((t0=this.instance.config.segmentation.modelPath)!=null&&t0.includes("rvm"))?M1(this.instance.config):null;for(let[n0,j0]of Object.entries(n))j0!=null&&j0.then&&j0.then(M=>this.models[n0]=M);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var o;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(o=this.models[n])==null?void 0:o.modelUrl:null}});for(let n of t){let o=Object.keys(I0).find(r=>r.startsWith(n.name));o&&(n.size=I0[o].sizeLoadedWeights,n.url=I0[o].url)}return t}loaded(){return this.list().filter(o=>o.loaded).map(o=>o.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let o=this.models[n];if(!o)continue;let r=Gt(this.instance,o,n);r&&t.push(r)}return t}};function Co(e,t,n,o,r){var a,l,c,x,i,y;let s=0,A=[];for(let d of e){let m={id:s++,face:d,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)d.box[0]>b.box[0]&&d.box[0]b.box[1]&&d.box[1]+d.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(f.push(b[0],b[0]+b[2]),u.push(b[1],b[1]+b[3]))};g(m.face.box),g((x=m.body)==null?void 0:x.box),g((i=m.hands.left)==null?void 0:i.box),g((y=m.hands.right)==null?void 0:y.box);let T=Math.min(...f),p=Math.min(...u);m.box=[T,p,Math.max(...f)-T,Math.max(...u)-p],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),A.push(m)}return A}var d0=V(G());var Vt=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -837,4 +837,4 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;async function fa(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(A=>A.blob()),n,o;switch(e.config.warmup){case"face":n=await t(Vt);break;case"body":case"full":n=await t(Zt);break;default:n=null}if(n){let r=await createImageBitmap(n);o=await e.detect(r,e.config),r.close()}return o}async function ma(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+Vt;break;case"full":case"body":n="data:image/jpeg;base64,"+Zt;break;default:n=""}let o;if(typeof Image!="undefined")o=new Image;else if(R.Image)o=new R.Image;else{t(void 0);return}o.onload=async()=>{let r=Ae(o.naturalWidth,o.naturalHeight);if(!r)h("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(o,0,0);let A=await e.image(r,!0),a=A.tensor?await e.detect(A.tensor,e.config):void 0;t(a)}},n?o.src=n:t(void 0)})}async function pa(e){let t=r=>Buffer.from(r,"base64"),n;e.config.warmup==="face"?n=t(Vt):n=t(Zt);let o;if("node"in d0&&d0.getBackend()==="tensorflow"){let r=d0.node.decodeJpeg(n),s=d0.expandDims(r,0);e.tf.dispose(r),o=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&h("Warmup tfjs-node not loaded");return o}async function ua(e){let t;return typeof createImageBitmap=="function"?t=await fa(e):typeof Image!="undefined"||R.Canvas!==void 0?t=await ma(e):t=await pa(e),t}async function ha(e){var a,l,c,x;if(!d0.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=d0.getBackend(),n=d0.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;d0.env().set("ENGINE_COMPILE_ONLY",!0);let o=d0.engine().state.numTensors,r=[];for(let[i,f]of Object.entries(e.models.models)){if(!f)continue;let d=f!=null&&f.modelSignature&&((l=(a=f==null?void 0:f.inputs)==null?void 0:a[0])!=null&&l.shape)?[...f.inputs[0].shape]:[1,64,64,3],m=f!=null&&f.modelSignature&&((x=(c=f==null?void 0:f.inputs)==null?void 0:c[0])!=null&&x.dtype)?f.inputs[0].dtype:"float32";for(let u=0;ud0.dispose(T)):d0.dispose(u)}catch(u){e.config.debug&&h("compile fail model:",i)}d0.dispose(y)}let s=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&h("compile pass:",{models:r,kernels:s.length}),d0.env().set("ENGINE_COMPILE_ONLY",!1);let A=d0.engine().state.numTensors;A-o>0&&h("tensor leak:",A-o)}async function Wo(e,t){await I2(e,!1);let n=v();return e.state="warmup",t&&(e.config=a0(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?Te():new Promise(async o=>{await e.models.load(),await ha(e);let r=await ua(e),s=v();e.config.debug&&h("warmup",e.config.warmup,Math.round(s-n),"ms"),e.emit("warmup"),o(r)})}var P2,G2,V2,Xt,Ye,w1=class{constructor(t){w(this,"version");w(this,"config");w(this,"result");w(this,"state");w(this,"process");w(this,"tf");w(this,"env",R);w(this,"draw",nt);w(this,"match",Ot);w(this,"models");w(this,"events");w(this,"faceTriangulation");w(this,"faceUVMap");w(this,"performance");ue(this,P2,void 0);ue(this,G2,void 0);ue(this,V2,void 0);w(this,"analyze",(...t)=>{if(!Y0(this,G2))return;let n=this.tf.engine().state.numTensors,o=Y0(this,P2);Re(this,P2,n);let r=n-o;r!==0&&h(...t,r)});ue(this,Xt,t=>{if(!Y0(this,V2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof de.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});w(this,"webcam",new K2);w(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});ue(this,Ye,{});let n=(de.version.tfjs||de.version_core).replace(/-(.*)/,"");Ke.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ke.modelBasePath=R.browser?"../models/":"file://models/",this.version=t5,Object.defineProperty(this,"version",{value:t5}),this.config=JSON.parse(JSON.stringify(Ke)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=a0(this.config,t)),X1(this.config),this.tf=de,this.state="idle",Re(this,P2,0),Re(this,G2,!1),Re(this,V2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new H2(this),i5(),this.result=Te(),this.process={tensor:null,canvas:null},this.faceTriangulation=D3,this.faceUVMap=F3,Gt(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&h(`version: ${this.version}`),this.config.debug&&h(`tfjs version: ${this.tf.version["tfjs-core"]}`);let o=JSON.parse(JSON.stringify(this.env));delete o.kernels,delete o.initial,delete o.perfadd,this.config.debug&&h("environment:",o)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ke)),this.config.backend=t,$t(),R.initial=!0}validate(t){let n=Jt(Ke,t||this.config);return n.length===0&&(this.config=a0(this.config,t)),n}now(){return v()}image(t,n=!1){return U2(t,this.config,n)}async segmentation(t,n){var s,A,a;if(n&&(this.config=a0(this.config,n)),!this.config.segmentation.enabled)return null;let o=await U2(t,this.config);if(!o.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await Io(o.tensor,this.config)),(A=this.config.segmentation.modelPath)!=null&&A.includes("meet")&&(r=await lo(o.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("selfie")&&(r=await Lo(o.tensor,this.config)),de.dispose(o.tensor),r}compare(t,n){return Z1(this.config,t,n)}async init(){await I2(this,!0),await this.tf.ready(),$t()}async load(t){this.state="load";let n=v(),o=Object.values(this.models.models).filter(A=>A).length;t&&(this.config=a0(this.config,t)),this.env.initial&&(await I2(this,!1)||h("error: backend check failed"),await de.ready(),this.env.browser&&(this.config.debug&&h("configuration:",this.config),this.config.debug&&h("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&h("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(A=>A).length!==o&&(this.models.validate(),this.emit("load"));let s=Math.trunc(v()-n);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return io(t,this.config)}async warmup(t){let n=v(),o=await Wo(this,t),r=v();return this.performance.warmup=Math.trunc(r-n),o}async profile(t,n){let o=await this.tf.profile(()=>this.detect(t,n)),r={},s=0;for(let a of o.kernels){let l=Number(a.kernelTimeMs)||0;r[a.name]?r[a.name]+=l:r[a.name]=l,s+=l}let A=[];Object.entries(r).forEach(a=>A.push({kernel:a[0],time:a[1],perc:0}));for(let a of A)a.perc=Math.round(1e3*a.time/s)/1e3,a.time=Math.round(1e3*a.time)/1e3;return A.sort((a,l)=>l.time-a.time),A.length=20,A}async detect(t,n){return this.state="detect",new Promise(async o=>{var u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;this.state="config";let r;this.config=a0(this.config,n),this.state="check";let s=Y0(this,Xt).call(this,t);s&&(h(s,t),this.emit("error"),o(Te(s)));let A=v();await this.load(),r=v(),this.state="image";let a=await U2(t,this.config);if(this.process=a,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Get Image:"),!a.tensor){this.config.debug&&h("could not convert input to tensor"),this.emit("error"),o(Te("could not convert input to tensor"));return}this.emit("image"),r=v(),this.config.skipAllowed=await V1(this.config,a.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Check Changed:");let l=[],c=[],x=[],i=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?J5(this,a.tensor):[],this.performance.face&&delete this.performance.face):(r=v(),l=this.config.face.enabled?await J5(this,a.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let f=this.config.body.maxDetected===-1?a0(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((u=this.config.body.modelPath)!=null&&u.includes("posenet")?c=this.config.body.enabled?T1(a.tensor,f):[]:(T=this.config.body.modelPath)!=null&&T.includes("blazepose")?c=this.config.body.enabled?y5(a.tensor,f):[]:(g=this.config.body.modelPath)!=null&&g.includes("efficientpose")?c=this.config.body.enabled?g5(a.tensor,f):[]:(p=this.config.body.modelPath)!=null&&p.includes("movenet")&&(c=this.config.body.enabled?f1(a.tensor,f):[]),this.performance.body&&delete this.performance.body):(r=v(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?c=this.config.body.enabled?await T1(a.tensor,f):[]:(k=this.config.body.modelPath)!=null&&k.includes("blazepose")?c=this.config.body.enabled?await y5(a.tensor,f):[]:(P=this.config.body.modelPath)!=null&&P.includes("efficientpose")?c=this.config.body.enabled?await g5(a.tensor,f):[]:(N=this.config.body.modelPath)!=null&&N.includes("movenet")&&(c=this.config.body.enabled?await f1(a.tensor,f):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let d=this.config.hand.maxDetected===-1?a0(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((_=(V=this.config.hand.detector)==null?void 0:V.modelPath)!=null&&_.includes("handdetect")?x=this.config.hand.enabled?n1(a.tensor,d):[]:($=(Z=this.config.hand.detector)==null?void 0:Z.modelPath)!=null&&$.includes("handtrack")&&(x=this.config.hand.enabled?s1(a.tensor,d):[]),this.performance.hand&&delete this.performance.hand):(r=v(),(t0=(A0=this.config.hand.detector)==null?void 0:A0.modelPath)!=null&&t0.includes("handdetect")?x=this.config.hand.enabled?await n1(a.tensor,d):[]:(j0=(n0=this.config.hand.detector)==null?void 0:n0.modelPath)!=null&&j0.includes("handtrack")&&(x=this.config.hand.enabled?await s1(a.tensor,d):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((M=this.config.object.modelPath)!=null&&M.includes("nanodet")?i=this.config.object.enabled?p1(a.tensor,this.config):[]:(T0=this.config.object.modelPath)!=null&&T0.includes("centernet")&&(i=this.config.object.enabled?p5(a.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=v(),(C0=this.config.object.modelPath)!=null&&C0.includes("nanodet")?i=this.config.object.enabled?await p1(a.tensor,this.config):[]:(x0=this.config.object.modelPath)!=null&&x0.includes("centernet")&&(i=this.config.object.enabled?await p5(a.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,c,x,i]=await Promise.all([l,c,x,i])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=v(),m=[...Wn(l),...Cn(c),...Fn(x),...Dn(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(v()-A):Math.trunc(v()-A);let y=((K=this.process.tensor)==null?void 0:K.shape)||[0,0,0,0];this.result={face:l,body:c,hand:x,gesture:m,object:i,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:y[2],height:y[1],get persons(){return Co(l,c,x,m,y)}},de.dispose(a.tensor),this.emit("detect"),this.state="idle",o(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,o=0){n?(Y0(this,Ye)[t.id]||(this.config.debug&&h("video start",t.id),Y0(this,Ye)[t.id]=!0),!t.paused&&Y0(this,Ye)[t.id]&&t.readyState>=2&&await this.detect(t),o>0&&await this.sleep(o),Y0(this,Ye)[t.id]&&requestAnimationFrame(()=>this.video(t,n,o))):(this.config.debug&&h("video stop",t.id),Y0(this,Ye)[t.id]=!1)}};P2=new WeakMap,G2=new WeakMap,V2=new WeakMap,Xt=new WeakMap,Ye=new WeakMap;0&&(module.exports={Env,Human,defaults,draw,empty,env,match,models}); +2Q==`;async function xa(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(A=>A.blob()),n,o;switch(e.config.warmup){case"face":n=await t(Vt);break;case"body":case"full":n=await t(Zt);break;default:n=null}if(n){let r=await createImageBitmap(n);o=await e.detect(r,e.config),r.close()}return o}async function ya(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+Vt;break;case"full":case"body":n="data:image/jpeg;base64,"+Zt;break;default:n=""}let o;if(typeof Image!="undefined")o=new Image;else if(R.Image)o=new R.Image;else{t(void 0);return}o.onload=async()=>{let r=Ae(o.naturalWidth,o.naturalHeight);if(!r)h("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(o,0,0);let A=await e.image(r,!0),a=A.tensor?await e.detect(A.tensor,e.config):void 0;t(a)}},n?o.src=n:t(void 0)})}async function fa(e){let t=r=>Buffer.from(r,"base64"),n;e.config.warmup==="face"?n=t(Vt):n=t(Zt);let o;if("node"in d0&&d0.getBackend()==="tensorflow"){let r=d0.node.decodeJpeg(n),s=d0.expandDims(r,0);e.tf.dispose(r),o=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&h("Warmup tfjs-node not loaded");return o}async function ma(e){let t;return typeof createImageBitmap=="function"?t=await xa(e):typeof Image!="undefined"||R.Canvas!==void 0?t=await ya(e):t=await fa(e),t}async function pa(e){var a,l,c,x;if(!d0.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=d0.getBackend(),n=d0.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;d0.env().set("ENGINE_COMPILE_ONLY",!0);let o=d0.engine().state.numTensors,r=[];for(let[i,y]of Object.entries(e.models.models)){if(!y)continue;let d=y!=null&&y.modelSignature&&((l=(a=y==null?void 0:y.inputs)==null?void 0:a[0])!=null&&l.shape)?[...y.inputs[0].shape]:[1,64,64,3],m=y!=null&&y.modelSignature&&((x=(c=y==null?void 0:y.inputs)==null?void 0:c[0])!=null&&x.dtype)?y.inputs[0].dtype:"float32";for(let u=0;ud0.dispose(g)):d0.dispose(u)}catch(u){e.config.debug&&h("compile fail model:",i)}d0.dispose(f)}let s=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&h("compile pass:",{models:r,kernels:s.length}),d0.env().set("ENGINE_COMPILE_ONLY",!1);let A=d0.engine().state.numTensors;A-o>0&&h("tensor leak:",A-o)}async function Wo(e,t){await I2(e,!1);let n=v();return e.state="warmup",t&&(e.config=a0(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?Te():new Promise(async o=>{await e.models.load(),await pa(e);let r=await ma(e),s=v();e.config.debug&&h("warmup",e.config.warmup,Math.round(s-n),"ms"),e.emit("warmup"),o(r)})}var P2,G2,V2,Xt,Ye,w1=class{constructor(t){w(this,"version");w(this,"config");w(this,"result");w(this,"state");w(this,"process");w(this,"tf");w(this,"env",R);w(this,"draw",nt);w(this,"match",Ot);w(this,"models");w(this,"events");w(this,"faceTriangulation");w(this,"faceUVMap");w(this,"performance");ue(this,P2,void 0);ue(this,G2,void 0);ue(this,V2,void 0);w(this,"analyze",(...t)=>{if(!Y0(this,G2))return;let n=this.tf.engine().state.numTensors,o=Y0(this,P2);Re(this,P2,n);let r=n-o;r!==0&&h(...t,r)});ue(this,Xt,t=>{if(!Y0(this,V2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof de.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});w(this,"webcam",new K2);w(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});ue(this,Ye,{});let n=(de.version.tfjs||de.version_core).replace(/-(.*)/,"");Ke.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ke.modelBasePath=R.browser?"../models/":"file://models/",this.version=t5,Object.defineProperty(this,"version",{value:t5}),this.config=JSON.parse(JSON.stringify(Ke)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=a0(this.config,t)),X1(this.config),this.tf=de,this.state="idle",Re(this,P2,0),Re(this,G2,!1),Re(this,V2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new H2(this),i5(),this.result=Te(),this.process={tensor:null,canvas:null},this.faceTriangulation=D3,this.faceUVMap=F3,Gt(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&h(`version: ${this.version}`),this.config.debug&&h(`tfjs version: ${this.tf.version["tfjs-core"]}`);let o=JSON.parse(JSON.stringify(this.env));delete o.kernels,delete o.initial,delete o.perfadd,this.config.debug&&h("environment:",o)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ke)),this.config.backend=t,$t(),R.initial=!0}validate(t){let n=Jt(Ke,t||this.config);return n.length===0&&(this.config=a0(this.config,t)),n}now(){return v()}image(t,n=!1){return U2(t,this.config,n)}async segmentation(t,n){var s,A,a;if(n&&(this.config=a0(this.config,n)),!this.config.segmentation.enabled)return null;let o=await U2(t,this.config);if(!o.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await Io(o.tensor,this.config)),(A=this.config.segmentation.modelPath)!=null&&A.includes("meet")&&(r=await lo(o.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("selfie")&&(r=await Lo(o.tensor,this.config)),de.dispose(o.tensor),r}compare(t,n){return Z1(this.config,t,n)}async init(){await I2(this,!0),await this.tf.ready(),$t()}async load(t){this.state="load";let n=v(),o=Object.values(this.models.models).filter(A=>A).length;t&&(this.config=a0(this.config,t)),this.env.initial&&(await I2(this,!1)||h("error: backend check failed"),await de.ready(),this.env.browser&&(this.config.debug&&h("configuration:",this.config),this.config.debug&&h("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&h("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(A=>A).length!==o&&(this.models.validate(),this.emit("load"));let s=Math.trunc(v()-n);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return io(t,this.config)}async warmup(t){let n=v(),o=await Wo(this,t),r=v();return this.performance.warmup=Math.trunc(r-n),o}async profile(t,n){let o=await this.tf.profile(()=>this.detect(t,n)),r={},s=0;for(let a of o.kernels){let l=Number(a.kernelTimeMs)||0;r[a.name]?r[a.name]+=l:r[a.name]=l,s+=l}let A=[];Object.entries(r).forEach(a=>A.push({kernel:a[0],time:a[1],perc:0}));for(let a of A)a.perc=Math.round(1e3*a.time/s)/1e3,a.time=Math.round(1e3*a.time)/1e3;return A.sort((a,l)=>l.time-a.time),A.length=20,A}async detect(t,n){return this.state="detect",new Promise(async o=>{var u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;this.state="config";let r;this.config=a0(this.config,n),this.state="check";let s=Y0(this,Xt).call(this,t);s&&(h(s,t),this.emit("error"),o(Te(s)));let A=v();await this.load(),r=v(),this.state="image";let a=await U2(t,this.config);if(this.process=a,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Get Image:"),!a.tensor){this.config.debug&&h("could not convert input to tensor"),this.emit("error"),o(Te("could not convert input to tensor"));return}this.emit("image"),r=v(),this.config.skipAllowed=await V1(this.config,a.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Check Changed:");let l=[],c=[],x=[],i=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?J5(this,a.tensor):[],this.performance.face&&delete this.performance.face):(r=v(),l=this.config.face.enabled?await J5(this,a.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let y=this.config.body.maxDetected===-1?a0(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((u=this.config.body.modelPath)!=null&&u.includes("posenet")?c=this.config.body.enabled?T1(a.tensor,y):[]:(g=this.config.body.modelPath)!=null&&g.includes("blazepose")?c=this.config.body.enabled?y5(a.tensor,y):[]:(T=this.config.body.modelPath)!=null&&T.includes("efficientpose")?c=this.config.body.enabled?g5(a.tensor,y):[]:(p=this.config.body.modelPath)!=null&&p.includes("movenet")&&(c=this.config.body.enabled?f1(a.tensor,y):[]),this.performance.body&&delete this.performance.body):(r=v(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?c=this.config.body.enabled?await T1(a.tensor,y):[]:(k=this.config.body.modelPath)!=null&&k.includes("blazepose")?c=this.config.body.enabled?await y5(a.tensor,y):[]:(P=this.config.body.modelPath)!=null&&P.includes("efficientpose")?c=this.config.body.enabled?await g5(a.tensor,y):[]:(I=this.config.body.modelPath)!=null&&I.includes("movenet")&&(c=this.config.body.enabled?await f1(a.tensor,y):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let d=this.config.hand.maxDetected===-1?a0(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((_=(B=this.config.hand.detector)==null?void 0:B.modelPath)!=null&&_.includes("handdetect")?x=this.config.hand.enabled?n1(a.tensor,d):[]:($=(Z=this.config.hand.detector)==null?void 0:Z.modelPath)!=null&&$.includes("handtrack")&&(x=this.config.hand.enabled?s1(a.tensor,d):[]),this.performance.hand&&delete this.performance.hand):(r=v(),(t0=(A0=this.config.hand.detector)==null?void 0:A0.modelPath)!=null&&t0.includes("handdetect")?x=this.config.hand.enabled?await n1(a.tensor,d):[]:(j0=(n0=this.config.hand.detector)==null?void 0:n0.modelPath)!=null&&j0.includes("handtrack")&&(x=this.config.hand.enabled?await s1(a.tensor,d):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((M=this.config.object.modelPath)!=null&&M.includes("nanodet")?i=this.config.object.enabled?p1(a.tensor,this.config):[]:(T0=this.config.object.modelPath)!=null&&T0.includes("centernet")&&(i=this.config.object.enabled?p5(a.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=v(),(C0=this.config.object.modelPath)!=null&&C0.includes("nanodet")?i=this.config.object.enabled?await p1(a.tensor,this.config):[]:(x0=this.config.object.modelPath)!=null&&x0.includes("centernet")&&(i=this.config.object.enabled?await p5(a.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,c,x,i]=await Promise.all([l,c,x,i])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=v(),m=[...Wn(l),...Cn(c),...Fn(x),...Dn(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(v()-A):Math.trunc(v()-A);let f=((K=this.process.tensor)==null?void 0:K.shape)||[0,0,0,0];this.result={face:l,body:c,hand:x,gesture:m,object:i,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:f[2],height:f[1],get persons(){return Co(l,c,x,m,f)}},de.dispose(a.tensor),this.emit("detect"),this.state="idle",o(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,o=0){n?(Y0(this,Ye)[t.id]||(this.config.debug&&h("video start",t.id),Y0(this,Ye)[t.id]=!0),!t.paused&&Y0(this,Ye)[t.id]&&t.readyState>=2&&await this.detect(t),o>0&&await this.sleep(o),Y0(this,Ye)[t.id]&&requestAnimationFrame(()=>this.video(t,n,o))):(this.config.debug&&h("video stop",t.id),Y0(this,Ye)[t.id]=!1)}};P2=new WeakMap,G2=new WeakMap,V2=new WeakMap,Xt=new WeakMap,Ye=new WeakMap;0&&(module.exports={Env,Human,defaults,draw,empty,env,match,models}); diff --git a/dist/human.node-wasm.js b/dist/human.node-wasm.js index 11c37f1d..faaddd78 100644 --- a/dist/human.node-wasm.js +++ b/dist/human.node-wasm.js @@ -4,7 +4,7 @@ author: ' */ -"use strict";var Fo=Object.create;var w2=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Ho=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,Vo=Object.prototype.hasOwnProperty;var Zo=(e,t,n)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var n in t)w2(e,n,{get:t[n],enumerable:!0})},N1=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ho(t))!Vo.call(e,r)&&r!==n&&w2(e,r,{get:()=>t[r],enumerable:!(o=Bo(t,r))||o.enumerable});return e};var G=(e,t,n)=>(n=e!=null?Fo(Go(e)):{},N1(t||!e||!e.__esModule?w2(n,"default",{value:e,enumerable:!0}):n,e)),Xo=e=>N1(w2({},"__esModule",{value:!0}),e);var w=(e,t,n)=>(Zo(e,typeof t!="symbol"?t+"":t,n),n),O1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y0=(e,t,n)=>(O1(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Re=(e,t,n,o)=>(O1(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);var H=qo((va,z2)=>{"use strict";var Kt=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,Yo=Object.getOwnPropertyNames,Ko=Object.prototype.hasOwnProperty,Jo=(e,t)=>{for(var n in t)Kt(e,n,{get:t[n],enumerable:!0})},Yt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Yo(t))!Ko.call(e,r)&&r!==n&&Kt(e,r,{get:()=>t[r],enumerable:!(o=Uo(t,r))||o.enumerable});return e},Jt=(e,t,n)=>(Yt(e,t,"default"),n&&Yt(n,t,"default")),Qo=e=>Yt(Kt({},"__esModule",{value:!0}),e),E2={};Jo(E2,{version:()=>or});z2.exports=Qo(E2);Jt(E2,require("@tensorflow/tfjs-core"),z2.exports);Jt(E2,require("@tensorflow/tfjs-converter"),z2.exports);Jt(E2,require("@tensorflow/tfjs-backend-wasm"),z2.exports);var L1="4.14.0",_o="4.14.0",$o="4.14.0",er="4.14.0",tr="4.14.0",nr="4.14.0",or={tfjs:L1,"tfjs-core":L1,"tfjs-converter":_o,"tfjs-backend-cpu":$o,"tfjs-backend-webgl":er,"tfjs-backend-wasm":tr,"tfjs-backend-webgpu":nr}});var ga={};ze(ga,{Env:()=>S2,Human:()=>E1,default:()=>E1,defaults:()=>Ke,draw:()=>rt,empty:()=>Te,env:()=>R,match:()=>Wt,models:()=>w1});module.exports=Xo(ga);var de=G(H());function h(...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)}function C1(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(`modelpath error: expecting json file: ${r}`);return r}var v=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Qt(e,t,n="config",o=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")Qt(e[r],t[r],r,o);else{let s=e&&typeof e[r]!="undefined";s||o.push({reason:"unknown property",where:`${n}.${r} = ${t[r]}`});let A=e&&typeof e[r]==typeof t[r];s&&!A&&o.push({reason:"property type mismatch",where:`${n}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&n==="config"&&o.length>0&&h("invalid configuration",o),o}function a0(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,o)=>(Object.keys(o||{}).forEach(r=>{let s=n[r],A=o[r];Array.isArray(s)&&Array.isArray(A)?n[r]=s.concat(...A):t(s)&&t(A)?n[r]=a0(s,A):n[r]=A}),n),{})}var Ke={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var W0=G(H());var I=G(H());var W1=` +"use strict";var Fo=Object.create;var w2=Object.defineProperty;var Bo=Object.getOwnPropertyDescriptor;var Ho=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,Vo=Object.prototype.hasOwnProperty;var Zo=(e,t,n)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var n in t)w2(e,n,{get:t[n],enumerable:!0})},N1=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ho(t))!Vo.call(e,r)&&r!==n&&w2(e,r,{get:()=>t[r],enumerable:!(o=Bo(t,r))||o.enumerable});return e};var V=(e,t,n)=>(n=e!=null?Fo(Go(e)):{},N1(t||!e||!e.__esModule?w2(n,"default",{value:e,enumerable:!0}):n,e)),Xo=e=>N1(w2({},"__esModule",{value:!0}),e);var w=(e,t,n)=>(Zo(e,typeof t!="symbol"?t+"":t,n),n),O1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y0=(e,t,n)=>(O1(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Re=(e,t,n,o)=>(O1(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);var G=qo((ga,z2)=>{"use strict";var Kt=Object.defineProperty,Uo=Object.getOwnPropertyDescriptor,Yo=Object.getOwnPropertyNames,Ko=Object.prototype.hasOwnProperty,Jo=(e,t)=>{for(var n in t)Kt(e,n,{get:t[n],enumerable:!0})},Yt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Yo(t))!Ko.call(e,r)&&r!==n&&Kt(e,r,{get:()=>t[r],enumerable:!(o=Uo(t,r))||o.enumerable});return e},Jt=(e,t,n)=>(Yt(e,t,"default"),n&&Yt(n,t,"default")),Qo=e=>Yt(Kt({},"__esModule",{value:!0}),e),E2={};Jo(E2,{version:()=>or});z2.exports=Qo(E2);Jt(E2,require("@tensorflow/tfjs-core"),z2.exports);Jt(E2,require("@tensorflow/tfjs-converter"),z2.exports);Jt(E2,require("@tensorflow/tfjs-backend-wasm"),z2.exports);var L1="4.17.0",_o="4.17.0",$o="4.17.0",er="4.17.0",tr="4.17.0",nr="4.14.0",or={tfjs:L1,"tfjs-core":L1,"tfjs-converter":_o,"tfjs-backend-cpu":$o,"tfjs-backend-webgl":er,"tfjs-backend-wasm":tr,"tfjs-backend-webgpu":nr}});var ha={};ze(ha,{Env:()=>S2,Human:()=>E1,default:()=>E1,defaults:()=>Ke,draw:()=>rt,empty:()=>Te,env:()=>R,match:()=>Wt,models:()=>w1});module.exports=Xo(ha);var de=V(G());function h(...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)}function C1(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(`modelpath error: expecting json file: ${r}`);return r}var v=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Qt(e,t,n="config",o=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")Qt(e[r],t[r],r,o);else{let s=e&&typeof e[r]!="undefined";s||o.push({reason:"unknown property",where:`${n}.${r} = ${t[r]}`});let A=e&&typeof e[r]==typeof t[r];s&&!A&&o.push({reason:"property type mismatch",where:`${n}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&n==="config"&&o.length>0&&h("invalid configuration",o),o}function a0(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,o)=>(Object.keys(o||{}).forEach(r=>{let s=n[r],A=o[r];Array.isArray(s)&&Array.isArray(A)?n[r]=s.concat(...A):t(s)&&t(A)?n[r]=a0(s,A):n[r]=A}),n),{})}var Ke={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,scale:1.4,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,scale:2.3,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var W0=V(G());var N=V(G());var W1=` precision highp float; attribute vec2 pos; attribute vec2 uv; @@ -96,8 +96,8 @@ c31 * m[6] + c32 * m[7] + c33 * m[8]; gl_FragColor.a = c22.a; } -`;var _t=(e,t,n)=>{let o=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(o,(r,s)=>(n[s]=0,r))},$t=class{constructor(t,n,o){w(this,"uniform",{});w(this,"attribute",{});w(this,"gl");w(this,"id");w(this,"compile",(t,n)=>{let o=this.gl.createShader(n);return o?(this.gl.shaderSource(o,t),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS)?o:(h(`filter: gl compile failed: ${this.gl.getShaderInfoLog(o)||"unknown"}`),null)):(h("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),s=this.compile(o,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){h("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){h(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),_t(n,"attribute",this.attribute);for(let A in this.attribute)this.attribute[A]=this.gl.getAttribLocation(this.id,A);_t(n,"uniform",this.uniform),_t(o,"uniform",this.uniform);for(let A in this.uniform)this.uniform[A]=this.gl.getUniformLocation(this.id,A)}}};function V1(){let e=0,t=null,n=!1,o=-1,r=[null,null],s=[],A=null,a=null,l=Ae(100,100),c={},x={INTERMEDIATE:1},i=l.getContext("webgl");if(!i){h("filter: cannot get webgl context");return}this.gl=i;function f(g,p){if(!(g===l.width&&p===l.height)){if(l.width=g,l.height=p,!A){let b=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=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,A),i.bufferData(i.ARRAY_BUFFER,b,i.STATIC_DRAW),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}i.viewport(0,0,l.width,l.height),r=[null,null]}}function d(g,p){let b=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,b);let k=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,k);let P=i.createTexture();return i.bindTexture(i.TEXTURE_2D,P),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,g,p,0,i.RGBA,i.UNSIGNED_BYTE,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,P,0),i.bindTexture(i.TEXTURE_2D,null),i.bindFramebuffer(i.FRAMEBUFFER,null),{fbo:b,texture:P}}function m(g){return r[g]=r[g]||d(l.width,l.height),r[g]}function y(g=0){if(!a)return;let p=null,b=null,k=!1;e===0?p=t:p=m(o).texture||null,e++,n&&!(g&x.INTERMEDIATE)?(b=null,k=e%2===0):(o=(o+1)%2,b=m(o).fbo||null),i.bindTexture(i.TEXTURE_2D,p),i.bindFramebuffer(i.FRAMEBUFFER,b),i.uniform1f(a.uniform.flipY,k?-1:1),i.drawArrays(i.TRIANGLES,0,6)}function u(g){if(c[g])return a=c[g],i.useProgram((a?a.id:null)||null),a;if(a=new $t(i,W1,g),!a)return h("filter: could not get webgl program"),null;let p=Float32Array.BYTES_PER_ELEMENT,b=4*p;return i.enableVertexAttribArray(a.attribute.pos),i.vertexAttribPointer(a.attribute.pos,2,i.FLOAT,!1,b,0*p),i.enableVertexAttribArray(a.attribute.uv),i.vertexAttribPointer(a.attribute.uv,2,i.FLOAT,!1,b,2*p),c[g]=a,a}let T={colorMatrix:g=>{let p=new Float32Array(g);p[4]/=255,p[9]/=255,p[14]/=255,p[19]/=255;let b=p[18]===1&&p[3]===0&&p[8]===0&&p[13]===0&&p[15]===0&&p[16]===0&&p[17]===0&&p[19]===0?F1:D1,k=u(b);k&&(i.uniform1fv(k.uniform.m,p),y())},brightness:g=>{let p=(g||0)+1;T.colorMatrix([p,0,0,0,0,0,p,0,0,0,0,0,p,0,0,0,0,0,1,0])},saturation:g=>{let p=(g||0)*2/3+1,b=(p-1)*-.5;T.colorMatrix([p,b,b,0,0,b,p,b,0,0,b,b,p,0,0,0,0,0,1,0])},desaturate:()=>{T.saturation(-1)},contrast:g=>{let p=(g||0)+1,b=-128*(p-1);T.colorMatrix([p,0,0,0,b,0,p,0,0,b,0,0,p,0,b,0,0,0,1,0])},negative:()=>{T.contrast(-2)},hue:g=>{g=(g||0)/180*Math.PI;let p=Math.cos(g),b=Math.sin(g),k=.213,P=.715,N=.072;T.colorMatrix([k+p*(1-k)+b*-k,P+p*-P+b*-P,N+p*-N+b*(1-N),0,0,k+p*-k+b*.143,P+p*(1-P)+b*.14,N+p*-N+b*-.283,0,0,k+p*-k+b*-(1-k),P+p*-P+b*P,N+p*(1-N)+b*N,0,0,0,0,0,1,0])},desaturateLuminance:()=>{T.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{T.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{T.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{T.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{T.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{T.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{T.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{T.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:g=>{let p=new Float32Array(g),b=1/l.width,k=1/l.height,P=u(G1);P&&(i.uniform1fv(P.uniform.m,p),i.uniform2f(P.uniform.px,b,k),y())},detectEdges:()=>{T.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{T.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{T.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:g=>{let p=g||1;T.convolution.call(this,[0,-1*p,0,-1*p,1+4*p,-1*p,0,-1*p,0])},emboss:g=>{let p=g||1;T.convolution.call(this,[-2*p,-1*p,0,-1*p,1,1*p,0,1*p,2*p])},blur:g=>{let p=g/7/l.width,b=g/7/l.height,k=u(H1);k&&(i.uniform2f(k.uniform.px,0,b),y(x.INTERMEDIATE),i.uniform2f(k.uniform.px,p,0),y())},pixelate:g=>{let p=g/l.width,b=g/l.height,k=u(B1);k&&(i.uniform2f(k.uniform.size,p,b),y())}};this.add=function(g){let p=Array.prototype.slice.call(arguments,1),b=T[g];s.push({func:b,args:p})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(g){f(g.width,g.height),e=0,t||(t=i.createTexture()),i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,g);for(let p=0;px.data())),A=Math.max(s[0][0],s[1][0],s[2][0]),l=(A>1?255:1)/A,c;if(l>1){let x=[U.sub(n[0],o[0]),U.sub(n[1],o[1]),U.sub(n[2],o[2])],i=[U.sub(r[0],o[0]),U.sub(r[1],o[1]),U.sub(r[2],o[2])],f=[U.mul(x[0],l),U.mul(x[1],l),U.mul(x[2],l)],d=U.stack([f[0],f[1],f[2]],2);c=U.reshape(d,[1,t.shape[0]||0,t.shape[1]||0,3]),U.dispose([...x,...i,...f,d])}else c=U.expandDims(t,0);return U.dispose([...n,...o,...r,n,t,e]),c}var U2=3840,R0=null,M0=null,y2=null,e0,ne={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function e5(){ne.inputSum=0,ne.cacheDiff=1,ne.sumMethod=0,ne.inputTensor=void 0}function Ae(e,t){let n;if(R.browser)if(R.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof R.Canvas!="undefined")n=new R.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof R.Canvas!="undefined"?n=new R.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function Y2(e,t){let n=t||Ae(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function K2(e,t,n=!0){var f,d,m;if(!e)return t.debug&&h("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof I.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof I.Tensor){let y=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)y=I.expandDims(e,0);else if(e.shape[2]===4){let u=I.slice3d(e,[0,0,0],[-1,-1,3]);y=I.expandDims(u,0),I.dispose(u)}}else e.shape.length===4&&(e.shape[3]===3?y=I.clone(e):e.shape[3]===4&&(y=I.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(y==null||y.shape.length!==4||y.shape[0]!==1||y.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(y.dtype==="int32"){let u=I.cast(y,"float32");I.dispose(y),y=u}return{tensor:y,canvas:t.filter.return?M0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&h("input stream is not ready"),{tensor:null,canvas:R0};let o=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!o||!r)return t.debug&&h("cannot determine input dimensions"),{tensor:null,canvas:R0};let s=o,A=r;if(s>U2&&(s=U2,A=Math.trunc(s*r/o)),A>U2&&(A=U2,s=Math.trunc(A*o/r)),(((f=t.filter)==null?void 0:f.width)||0)>0?s=t.filter.width:(((d=t.filter)==null?void 0:d.height)||0)>0&&(s=o*((t.filter.height||0)/r)),(t.filter.height||0)>0?A=t.filter.height:(t.filter.width||0)>0&&(A=r*((t.filter.width||0)/o)),!s||!A)throw new Error("input error: cannot determine dimension");(!R0||R0.width!==s||R0.height!==A)&&(R0=Ae(s,A));let a=R0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?a.putImageData(e,0,0):t.filter.flip&&typeof a.translate!="undefined"?(a.translate(o,0),a.scale(-1,1),a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),a.setTransform(1,0,0,1,0,0)):a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),(!M0||R0.width!==M0.width||R0.height!==M0.height)&&(M0=Ae(R0.width,R0.height)),t.filter.enabled&&R.webgl.supported?(e0||(e0=R.browser?new V1:null),R.filter=!!e0,e0!=null&&e0.add?(e0.reset(),t.filter.brightness!==0&&e0.add("brightness",t.filter.brightness),t.filter.contrast!==0&&e0.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&e0.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&e0.add("blur",t.filter.blur),t.filter.saturation!==0&&e0.add("saturation",t.filter.saturation),t.filter.hue!==0&&e0.add("hue",t.filter.hue),t.filter.negative&&e0.add("negative"),t.filter.sepia&&e0.add("sepia"),t.filter.vintage&&e0.add("brownie"),t.filter.sepia&&e0.add("sepia"),t.filter.kodachrome&&e0.add("kodachrome"),t.filter.technicolor&&e0.add("technicolor"),t.filter.polaroid&&e0.add("polaroid"),t.filter.pixelate!==0&&e0.add("pixelate",t.filter.pixelate),((m=e0.get())==null?void 0:m.length)>1?M0=e0.apply(R0):M0=e0.draw(R0)):(t.debug&&h("input process error: cannot initialize filters"),R.webgl.supported=!1,t.filter.enabled=!1,Y2(R0,M0))):(Y2(R0,M0),e0&&(e0=null),R.filter=!!e0),!n)return{tensor:null,canvas:M0};if(!M0)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(R.browser&&I.browser)l=I.browser?I.browser.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let y=new Uint8Array(e.data.buffer);l=I.tensor(y,[e.height,e.width,c],"int32")}else if((!y2||M0.width!==y2.width||M0.height!==y2.height)&&(y2=Ae(M0.width,M0.height)),I.browser&&R.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=I.browser.fromPixels(M0):(y2=Y2(M0),l=I.browser.fromPixels(y2));else{let T=Y2(M0).getContext("2d").getImageData(0,0,s,A);c=T.data.length/s/A;let g=new Uint8Array(T.data.buffer);l=I.tensor(g,[s,A,c])}if(c===4){let y=I.slice3d(l,[0,0,0],[-1,-1,3]);I.dispose(l),l=y}if(!l)throw new Error("input error: cannot create tensor");let x=I.cast(l,"float32"),i=t.filter.equalization?await X2(x):I.expandDims(x,0);if(I.dispose([l,x]),t.filter.autoBrightness){let y=I.max(i),u=await y.data();t.filter.brightness=u[0]>1?1-u[0]/255:1-u[0],I.dispose(y)}return{tensor:i,canvas:t.filter.return?M0:null}}async function Z1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!ne.inputTensor)ne.inputTensor=I.clone(t);else if(ne.inputTensor.shape[1]!==t.shape[1]||ne.inputTensor.shape[2]!==t.shape[2])I.dispose(ne.inputTensor),ne.inputTensor=I.clone(t);else{let o={};o.diff=I.sub(t,ne.inputTensor),o.squared=I.mul(o.diff,o.diff),o.sum=I.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;I.dispose([ne.inputTensor,o.diff,o.squared,o.sum]),ne.inputTensor=I.clone(t),n=s<=(e.cacheSensitivity||0)}return n}async function q1(e,t,n){let o={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||h("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||h("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;o.input1=I.clone(t),o.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?I.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):I.clone(n),o.diff=I.sub(o.input1,o.input2),o.squared=I.mul(o.diff,o.diff),o.sum=I.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return I.dispose([o.input1,o.input2,o.diff,o.squared,o.sum]),s}var j2,I2,N2,S2=class{constructor(){w(this,"browser");w(this,"node");w(this,"worker");w(this,"platform","");w(this,"agent","");w(this,"backends",[]);w(this,"initial");w(this,"filter");w(this,"tfjs");w(this,"offscreen");w(this,"perfadd",!1);w(this,"tensorflow",{version:void 0,gpu:void 0});w(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});w(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});w(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});w(this,"cpu",{model:void 0,flags:[]});w(this,"kernels",[]);ue(this,j2,void 0);ue(this,I2,void 0);ue(this,N2,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:W0.version["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let o=n[0].match(/\(([^()]+)\)/g);this.platform=o!=null&&o[0]?o[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return Y0(this,j2)}set Canvas(t){Re(this,j2,t),globalThis.Canvas=t}get Image(){return Y0(this,I2)}set Image(t){Re(this,I2,t),globalThis.Image=t}get ImageData(){return Y0(this,N2)}set ImageData(t){Re(this,N2,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(W0.engine().registryFactory);try{this.tensorflow={version:W0.backend().binding?W0.backend().binding.TF_Version:void 0,gpu:W0.backend().binding?W0.backend().binding.isUsingGpuDevice():void 0}}catch(o){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await W0.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await W0.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Ae(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let o=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(o==null?void 0:o.requestAdapterInfo())}}catch(o){this.webgpu.supported=!1}try{this.kernels=W0.getKernelsForBackend(W0.getBackend()).map(o=>o.kernelName.toLowerCase())}catch(o){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};j2=new WeakMap,I2=new WeakMap,N2=new WeakMap;var R=new S2;var Q2=class{constructor(){w(this,"config");w(this,"element");w(this,"stream");w(this,"devices",[]);w(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});w(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let A=document.getElementById(t.element);if(A&&A instanceof HTMLVideoElement)this.element=A;else return this.config.debug&&h("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&h("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(n.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&h("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&h("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&h("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(A){return h("webcam",A),`webcam error: ${A}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(A=>{this.element?this.element.onloadeddata=()=>A(!0):A(!1)}),await this.element.play(),this.config.debug&&h("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&h("webcam error","no stream"),"webcam error no stream")});w(this,"pause",()=>{this.element&&this.element.pause()});w(this,"play",async()=>{this.element&&await this.element.play()});w(this,"stop",()=>{this.config.debug&&h("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var f2=G(H());var t5={};ze(t5,{"affectnet-mobilenet":()=>br,age:()=>gr,"anti-spoofing":()=>_r,antispoof:()=>ar,blazeface:()=>ir,"blazeface-back":()=>Tr,"blazeface-front":()=>vr,"blazepose-detector":()=>Rr,"blazepose-full":()=>Mr,"blazepose-heavy":()=>Pr,"blazepose-lite":()=>kr,centernet:()=>lr,default:()=>ds,efficientpose:()=>wr,"efficientpose-i-lite":()=>$r,"efficientpose-ii-lite":()=>es,"efficientpose-iv":()=>ts,emotion:()=>cr,faceboxes:()=>Er,facemesh:()=>dr,"facemesh-attention":()=>Sr,"facemesh-attention-pinto":()=>zr,"facemesh-detection-full":()=>jr,"facemesh-detection-short":()=>Ir,faceres:()=>xr,"faceres-deep":()=>Nr,gear:()=>Cr,"gear-e1":()=>Or,"gear-e2":()=>Lr,gender:()=>Dr,"gender-ssrnet-imdb":()=>Wr,handdetect:()=>Fr,"handlandmark-full":()=>Br,"handlandmark-lite":()=>yr,"handlandmark-sparse":()=>Hr,handskeleton:()=>Gr,handtrack:()=>fr,"insightface-efficientnet-b0":()=>ns,"insightface-ghostnet-strides1":()=>os,"insightface-ghostnet-strides2":()=>rs,"insightface-mobilenet-emore":()=>ss,"insightface-mobilenet-swish":()=>As,iris:()=>mr,liveness:()=>pr,meet:()=>Vr,mobileface:()=>Zr,mobilefacenet:()=>qr,models:()=>ur,"movenet-lightning":()=>hr,"movenet-multipose":()=>Xr,"movenet-thunder":()=>Ur,nanodet:()=>Yr,"nanodet-e":()=>as,"nanodet-g":()=>is,"nanodet-m":()=>ls,"nanodet-t":()=>cs,posenet:()=>Kr,rvm:()=>Jr,selfie:()=>Qr});var ar=853098,ir=538928,lr=4030290,cr=820516,dr=1477958,xr=6978814,yr=2023432,fr=2964837,mr=2599092,pr=592976,ur=0,hr=4650216,br=6920630,gr=161240,Tr=538928,vr=402048,Rr=5928856,Mr=6339202,Pr=27502466,kr=2726402,wr=5651240,Er=2013002,zr=2387598,Sr=2382414,jr=1026192,Ir=201268,Nr=13957620,Or=112438,Lr=112438,Cr=1498916,Wr=161236,Dr=201808,Fr=3515612,Br=5431368,Hr=5286322,Gr=5502280,Vr=372228,Zr=2183192,qr=5171976,Xr=9448838,Ur=12477112,Yr=7574558,Kr=5032780,Jr=3739355,Qr=212886,_r=853098,$r=2269064,es=5651240,ts=25643252,ns=13013224,os=8093408,rs=8049584,ss=6938536,As=12168584,as=12319156,is=7574558,ls=1887474,cs=5294216,ds={antispoof:ar,blazeface:ir,centernet:lr,emotion:cr,facemesh:dr,faceres:xr,"handlandmark-lite":yr,handtrack:fr,iris:mr,liveness:pr,models:ur,"movenet-lightning":hr,"affectnet-mobilenet":br,age:gr,"blazeface-back":Tr,"blazeface-front":vr,"blazepose-detector":Rr,"blazepose-full":Mr,"blazepose-heavy":Pr,"blazepose-lite":kr,efficientpose:wr,faceboxes:Er,"facemesh-attention-pinto":zr,"facemesh-attention":Sr,"facemesh-detection-full":jr,"facemesh-detection-short":Ir,"faceres-deep":Nr,"gear-e1":Or,"gear-e2":Lr,gear:Cr,"gender-ssrnet-imdb":Wr,gender:Dr,handdetect:Fr,"handlandmark-full":Br,"handlandmark-sparse":Hr,handskeleton:Gr,meet:Vr,mobileface:Zr,mobilefacenet:qr,"movenet-multipose":Xr,"movenet-thunder":Ur,nanodet:Yr,posenet:Kr,rvm:Jr,selfie:Qr,"anti-spoofing":_r,"efficientpose-i-lite":$r,"efficientpose-ii-lite":es,"efficientpose-iv":ts,"insightface-efficientnet-b0":ns,"insightface-ghostnet-strides1":os,"insightface-ghostnet-strides2":rs,"insightface-mobilenet-emore":ss,"insightface-mobilenet-swish":As,"nanodet-e":as,"nanodet-g":is,"nanodet-m":ls,"nanodet-t":cs};var D0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},I0={};async function xs(e,t){return D0.debug&&h("load model fetch:",e,t),fetch(e,t)}function X1(e){D0.cacheModels=e.cacheModels,D0.verbose=e.debug,D0.modelBasePath=e.modelBasePath}async function O(e){var c,x,i,f;let t=C1(D0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),o=n[n.length-1].replace(".json",""),r="indexeddb://"+o;I0[o]={name:o,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:t5[o],inCache:!1,url:""},D0.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=D0.cacheSupported&&D0.cacheModels?await f2.io.listModels():{}}catch(d){D0.cacheSupported=!1}I0[o].inCache=D0.cacheSupported&&D0.cacheModels&&Object.keys(s).includes(r),I0[o].url=I0[o].inCache?r:t;let A=typeof fetch=="undefined"?{}:{fetchFunc:(d,m)=>xs(d,m)},a=new f2.GraphModel(I0[o].url,A),l=!1;try{a.findIOHandler(),D0.debug&&h("model load handler:",a.handler)}catch(d){h("error finding model i/o handler:",t,d)}try{let d=await((c=a.handler)==null?void 0:c.load())||null;I0[o].sizeFromManifest=((x=d==null?void 0:d.weightData)==null?void 0:x.byteLength)||0,d?a.loadSync(d):a=await f2.loadGraphModel(I0[o].inCache?r:t,A),I0[o].sizeLoadedWeights=((f=(i=a.artifacts)==null?void 0:i.weightData)==null?void 0:f.byteLength)||0,D0.verbose&&h("load:",{model:o,url:a.modelUrl,bytes:I0[o].sizeLoadedWeights}),l=!0}catch(d){h("error loading model:",t,d)}if(l&&D0.cacheModels&&D0.cacheSupported&&!I0[o].inCache)try{let d=await a.save(r);D0.debug&&h("model saved:",r,d)}catch(d){h("error saving model:",t,d)}return a}var n5="3.2.0";var S=G(H());var u0=G(H());var o0={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function ms(){let e=o0.gl;e&&(o0.extensions=e.getSupportedExtensions())}function U1(e){var t;if(e.config.backend==="humangl"&&(o0.name in u0.engine().registry&&!((t=o0==null?void 0:o0.gl)!=null&&t.getParameter(o0.gl.VERSION))&&(h("humangl error: backend invalid context"),e.models.reset()),!u0.findBackend(o0.name))){try{o0.canvas=Ae(100,100)}catch(r){h("humangl error: cannot create canvas:",r);return}try{if(o0.gl=o0.canvas.getContext("webgl2",o0.webGLattr),!o0.gl){h("humangl error: cannot get webgl context");return}if(!o0.gl.getParameter(o0.gl.VERSION).includes("2.0")){h("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}o0.canvas&&(o0.canvas.addEventListener("webglcontextlost",s=>{throw h("humangl error:",s.type),h("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),o0.canvas.addEventListener("webglcontextrestored",s=>{h("humangl error: context restored:",s)}),o0.canvas.addEventListener("webglcontextcreationerror",s=>{h("humangl error: context create:",s)}))}catch(r){h("humangl error: cannot get webgl context:",r);return}try{u0.setWebGLContext(2,o0.gl)}catch(r){h("humangl error: cannot set webgl context:",r);return}try{let r=new u0.GPGPUContext(o0.gl);u0.registerBackend(o0.name,()=>new u0.MathBackendWebGL(r),o0.priority)}catch(r){h("humangl error: cannot register webgl backend:",r);return}try{u0.getKernelsForBackend("webgl").forEach(s=>{let A={...s,backendName:o0.name};u0.registerKernel(A)})}catch(r){h("humangl error: cannot update webgl backend registration:",r);return}try{u0.env().flagRegistry.WEBGL_VERSION&&u0.env().set("WEBGL_VERSION",2)}catch(r){h("humangl error: cannot set WebGL backend flags:",r);return}ms();let n=u0.backend(),o=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;o?e.config.debug&&h("humangl backend registered:",{webgl:o.getParameter(o.VERSION),renderer:o.getParameter(o.RENDERER)}):h("humangl error: no current gl context:",o,o0.gl)}}var Se=G(H()),C={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function Y1(){C.tf255=Se.scalar(255,"float32"),C.tf1=Se.scalar(1,"float32"),C.tf2=Se.scalar(2,"float32"),C.tf05=Se.scalar(.5,"float32"),C.tf127=Se.scalar(127.5,"float32"),C.rgb=Se.tensor1d([.2989,.587,.114],"float32")}async function hs(){var e;return await R.updateBackend(),(e=R.tensorflow)!=null&&e.version?"tensorflow":R.webgpu.supported&&R.webgpu.backend?"webgpu":R.webgl.supported&&R.webgl.backend?"webgl":R.wasm.supported&&R.wasm.backend?"wasm":"cpu"}function bs(e){let t=[];if(!R.kernels.includes("mod")){let n={kernelName:"Mod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.sub(o.inputs.a,S.mul(S.div(o.inputs.a,o.inputs.b),o.inputs.b)))};S.registerKernel(n),R.kernels.push("mod"),t.push("mod")}if(!R.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.add(S.mul(S.floorDiv(o.inputs.a,o.inputs.b),o.inputs.b),S.mod(o.inputs.a,o.inputs.b)))};S.registerKernel(n),R.kernels.push("floormod"),t.push("floormod")}if(!R.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>{let r=S.getBackend();S.setBackend("cpu");let s=S.image.rotateWithOffset(o.inputs.image,o.attrs.radians,o.attrs.fillValue,o.attrs.center);return S.setBackend(r),s})};S.registerKernel(n),R.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&h("registered kernels:",t)}var K1={};async function O2(e,t=!1){var n,o;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await hs()),t||R.initial||e.config.backend&&e.config.backend.length>0&&S.getBackend()!==e.config.backend){let r=v();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&h("running inside web worker"),typeof navigator!="undefined"&&((o=navigator==null?void 0:navigator.userAgent)!=null&&o.toLowerCase().includes("electron"))&&e.config.debug&&h("running inside electron");let s=Object.keys(S.engine().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(U1(e),s=Object.keys(S.engine().registryFactory)),e.config.debug&&h("available backends:",s),R.browser&&!R.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&h("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),R.node&&!R.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&h(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),R.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")h("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let A=await navigator.gpu.requestAdapter();if(e.config.debug&&h("enumerated webgpu adapter:",A),!A)h("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let a="requestAdapterInfo"in A?await A.requestAdapterInfo():void 0;h("webgpu adapter info:",a)}}if(s.includes(e.config.backend)||(h(`error: backend ${e.config.backend} not found in registry`),e.config.backend=R.node?"tensorflow":"webgl",e.config.debug&&h(`override: setting backend ${e.config.backend}`)),e.config.debug&&h("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(S.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&S.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&h("wasm path:",e.config.wasmPath),typeof S.setWasmPaths!="undefined")S.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let A=!1,a=!1;try{A=await S.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),a=await S.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&h(`wasm execution: ${a?"simd":"no simd"} ${A?"multithreaded":"singlethreaded"}`),e.config.debug&&!a&&h("warning: wasm simd support is not enabled")}catch(l){h("wasm detection failed")}}try{await S.setBackend(e.config.backend),await S.ready()}catch(A){return h("error: cannot set backend:",e.config.backend,A),!1}e.config.debug&&(K1=JSON.parse(JSON.stringify(S.env().flags)))}if((S.getBackend()==="humangl"||S.getBackend()==="webgl")&&(S.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&S.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),S.env().flagRegistry.WEBGL_EXP_CONV&&S.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(h("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),S.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),S.getBackend(),e.config.debug){let s=S.env().flags,A={};for(let a of Object.keys(s))K1[a]!==s[a]&&(A[a]=s[a]);e.config.debug&&Object.keys(A).length>0&&h("backend:",S.getBackend(),"flags:",A)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&h("flags:",e.config.flags);for(let[s,A]of Object.entries(e.config.flags))S.env().set(s,A)}S.enableProdMode(),Y1(),e.performance.initBackend=Math.trunc(v()-r),e.config.backend=S.getBackend(),await R.updateBackend(),bs(e.config)}return!0}function _2(e,t){for(let n of e){let o={kernelName:n,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&h("kernelFunc",n,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};S.registerKernel(o)}R.kernels=S.getKernelsForBackend(S.getBackend()).map(n=>n.kernelName.toLowerCase())}var rt={};ze(rt,{all:()=>Js,body:()=>et,canvas:()=>Ks,face:()=>$2,gesture:()=>ot,hand:()=>tt,init:()=>l5,object:()=>nt,options:()=>f0,person:()=>Ys});var oe=e=>{if(!e)h("draw error: invalid canvas");else if(!e.getContext)h("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)h("draw error: cannot get canvas context");else return t}return null},Je=e=>Math.round(e*180/Math.PI),Y=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Qe=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function re(e,t,n,o,r){let s=t.replace(/\[.*\]/g,"").split(` -`).map(a=>a.trim()),A=Math.max(0,n);for(let a=s.length-1;a>=0;a--){let l=a*r.lineHeight+o;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[a],A+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[a],A+4,l+15)}}function he(e,t,n,o,r){e.fillStyle=Qe(o,r),e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function be(e,t,n,o,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let A=(t+t+o)/2,a=(n+n+r)/2;e.ellipse(A,a,o/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,n),e.lineTo(t+o-s.roundRect,n),e.quadraticCurveTo(t+o,n,t+o,n+s.roundRect),e.lineTo(t+o,n+r-s.roundRect),e.quadraticCurveTo(t+o,n+r,t+o-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 o5(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let o of t)e.strokeStyle=Qe(o[2]||0,n),e.lineTo(Math.trunc(o[0]),Math.trunc(o[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Q1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){o5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let o=0;oL2[e]),Za=Ts.map(e=>L2[e]),qa=vs.map(e=>L2[e]);function je(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Rs=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ms=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ps=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ks=[[474,475],[475,476],[476,477],[477,474]],ws=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Es=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],zs=[[469,470],[470,471],[471,472],[472,469]],Ss=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Xa={lips:je(Rs),leftEye:je(Ms),leftEyebrow:je(Ps),leftIris:je(ks),rightEye:je(ws),rightEyebrow:je(Es),rightIris:je(zs),faceOval:je(Ss)};var js=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Is=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ns=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Os=[[474,475],[475,476],[476,477],[477,474]],Ls=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Cs=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ws=[[469,470],[470,471],[471,472],[472,469]],Ds=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function Ie(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Fs={lips:Ie(js),leftEye:Ie(Is),leftEyebrow:Ie(Ns),leftIris:Ie(Os),rightEye:Ie(Ls),rightEyebrow:Ie(Cs),rightIris:Ie(Ws),faceOval:Ie(Ds)},Bs=Object.entries(Fs).map(([e,t])=>t.map(n=>[n,e])).flat(),Ua=new Map(Bs),C2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],e2=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],t2=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var X;function Hs(e,t){var o,r,s,A,a,l,c,x,i;if(!X.drawLabels||((o=X.faceLabels)==null?void 0:o.length)===0)return;let n=X.faceLabels.slice();if(n=Y(n,"[id]",e.id.toFixed(0)),e.score&&(n=Y(n,"[score]",100*e.score)),e.gender&&(n=Y(n,"[gender]",e.gender)),e.genderScore&&(n=Y(n,"[genderScore]",100*e.genderScore)),e.age&&(n=Y(n,"[age]",e.age)),e.distance&&(n=Y(n,"[distance]",100*e.distance)),e.real&&(n=Y(n,"[real]",100*e.real)),e.live&&(n=Y(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let f=e.emotion.map(d=>`${Math.trunc(100*d.score)}% ${d.emotion}`);f.length>3&&(f.length=3),n=Y(n,"[emotions]",f.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(n=Y(n,"[roll]",Je(e.rotation.angle.roll))),(a=(A=e.rotation)==null?void 0:A.angle)!=null&&a.yaw&&(n=Y(n,"[yaw]",Je(e.rotation.angle.yaw))),(c=(l=e.rotation)==null?void 0:l.angle)!=null&&c.pitch&&(n=Y(n,"[pitch]",Je(e.rotation.angle.pitch))),(i=(x=e.rotation)==null?void 0:x.gaze)!=null&&i.bearing&&(n=Y(n,"[gaze]",Je(e.rotation.gaze.bearing))),re(t,n,e.box[0],e.box[1],X)}function Gs(e,t){var n,o,r,s;if((n=e.annotations)!=null&&n.leftEyeIris&&((o=e.annotations)!=null&&o.leftEyeIris[0])){t.strokeStyle=X.useDepth?"rgba(255, 200, 255, 0.3)":X.color,t.beginPath();let A=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,a=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),X.fillPolygons&&(t.fillStyle=X.useDepth?"rgba(255, 255, 200, 0.3)":X.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=X.useDepth?"rgba(255, 200, 255, 0.3)":X.color,t.beginPath();let A=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,a=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),X.fillPolygons&&(t.fillStyle=X.useDepth?"rgba(255, 255, 200, 0.3)":X.color,t.fill())}}function Vs(e,t){var n;if(X.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let o=e.box[0]+e.box[2]/2-e.box[3]*Je(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*Je(e.rotation.angle.pitch)/90,s=new Path2D(` +`;var _t=(e,t,n)=>{let o=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(o,(r,s)=>(n[s]=0,r))},$t=class{constructor(t,n,o){w(this,"uniform",{});w(this,"attribute",{});w(this,"gl");w(this,"id");w(this,"compile",(t,n)=>{let o=this.gl.createShader(n);return o?(this.gl.shaderSource(o,t),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS)?o:(h(`filter: gl compile failed: ${this.gl.getShaderInfoLog(o)||"unknown"}`),null)):(h("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),s=this.compile(o,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){h("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){h(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),_t(n,"attribute",this.attribute);for(let A in this.attribute)this.attribute[A]=this.gl.getAttribLocation(this.id,A);_t(n,"uniform",this.uniform),_t(o,"uniform",this.uniform);for(let A in this.uniform)this.uniform[A]=this.gl.getUniformLocation(this.id,A)}}};function V1(){let e=0,t=null,n=!1,o=-1,r=[null,null],s=[],A=null,a=null,l=Ae(100,100),c={},x={INTERMEDIATE:1},i=l.getContext("webgl");if(!i){h("filter: cannot get webgl context");return}this.gl=i;function y(T,p){if(!(T===l.width&&p===l.height)){if(l.width=T,l.height=p,!A){let b=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=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,A),i.bufferData(i.ARRAY_BUFFER,b,i.STATIC_DRAW),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}i.viewport(0,0,l.width,l.height),r=[null,null]}}function d(T,p){let b=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,b);let k=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,k);let P=i.createTexture();return i.bindTexture(i.TEXTURE_2D,P),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,T,p,0,i.RGBA,i.UNSIGNED_BYTE,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,P,0),i.bindTexture(i.TEXTURE_2D,null),i.bindFramebuffer(i.FRAMEBUFFER,null),{fbo:b,texture:P}}function m(T){return r[T]=r[T]||d(l.width,l.height),r[T]}function f(T=0){if(!a)return;let p=null,b=null,k=!1;e===0?p=t:p=m(o).texture||null,e++,n&&!(T&x.INTERMEDIATE)?(b=null,k=e%2===0):(o=(o+1)%2,b=m(o).fbo||null),i.bindTexture(i.TEXTURE_2D,p),i.bindFramebuffer(i.FRAMEBUFFER,b),i.uniform1f(a.uniform.flipY,k?-1:1),i.drawArrays(i.TRIANGLES,0,6)}function u(T){if(c[T])return a=c[T],i.useProgram((a?a.id:null)||null),a;if(a=new $t(i,W1,T),!a)return h("filter: could not get webgl program"),null;let p=Float32Array.BYTES_PER_ELEMENT,b=4*p;return i.enableVertexAttribArray(a.attribute.pos),i.vertexAttribPointer(a.attribute.pos,2,i.FLOAT,!1,b,0*p),i.enableVertexAttribArray(a.attribute.uv),i.vertexAttribPointer(a.attribute.uv,2,i.FLOAT,!1,b,2*p),c[T]=a,a}let g={colorMatrix:T=>{let p=new Float32Array(T);p[4]/=255,p[9]/=255,p[14]/=255,p[19]/=255;let b=p[18]===1&&p[3]===0&&p[8]===0&&p[13]===0&&p[15]===0&&p[16]===0&&p[17]===0&&p[19]===0?F1:D1,k=u(b);k&&(i.uniform1fv(k.uniform.m,p),f())},brightness:T=>{let p=(T||0)+1;g.colorMatrix([p,0,0,0,0,0,p,0,0,0,0,0,p,0,0,0,0,0,1,0])},saturation:T=>{let p=(T||0)*2/3+1,b=(p-1)*-.5;g.colorMatrix([p,b,b,0,0,b,p,b,0,0,b,b,p,0,0,0,0,0,1,0])},desaturate:()=>{g.saturation(-1)},contrast:T=>{let p=(T||0)+1,b=-128*(p-1);g.colorMatrix([p,0,0,0,b,0,p,0,0,b,0,0,p,0,b,0,0,0,1,0])},negative:()=>{g.contrast(-2)},hue:T=>{T=(T||0)/180*Math.PI;let p=Math.cos(T),b=Math.sin(T),k=.213,P=.715,I=.072;g.colorMatrix([k+p*(1-k)+b*-k,P+p*-P+b*-P,I+p*-I+b*(1-I),0,0,k+p*-k+b*.143,P+p*(1-P)+b*.14,I+p*-I+b*-.283,0,0,k+p*-k+b*-(1-k),P+p*-P+b*P,I+p*(1-I)+b*I,0,0,0,0,0,1,0])},desaturateLuminance:()=>{g.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{g.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{g.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{g.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{g.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{g.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{g.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{g.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:T=>{let p=new Float32Array(T),b=1/l.width,k=1/l.height,P=u(G1);P&&(i.uniform1fv(P.uniform.m,p),i.uniform2f(P.uniform.px,b,k),f())},detectEdges:()=>{g.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{g.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{g.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:T=>{let p=T||1;g.convolution.call(this,[0,-1*p,0,-1*p,1+4*p,-1*p,0,-1*p,0])},emboss:T=>{let p=T||1;g.convolution.call(this,[-2*p,-1*p,0,-1*p,1,1*p,0,1*p,2*p])},blur:T=>{let p=T/7/l.width,b=T/7/l.height,k=u(H1);k&&(i.uniform2f(k.uniform.px,0,b),f(x.INTERMEDIATE),i.uniform2f(k.uniform.px,p,0),f())},pixelate:T=>{let p=T/l.width,b=T/l.height,k=u(B1);k&&(i.uniform2f(k.uniform.size,p,b),f())}};this.add=function(T){let p=Array.prototype.slice.call(arguments,1),b=g[T];s.push({func:b,args:p})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(T){y(T.width,T.height),e=0,t||(t=i.createTexture()),i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,T);for(let p=0;px.data())),A=Math.max(s[0][0],s[1][0],s[2][0]),l=(A>1?255:1)/A,c;if(l>1){let x=[U.sub(n[0],o[0]),U.sub(n[1],o[1]),U.sub(n[2],o[2])],i=[U.sub(r[0],o[0]),U.sub(r[1],o[1]),U.sub(r[2],o[2])],y=[U.mul(x[0],l),U.mul(x[1],l),U.mul(x[2],l)],d=U.stack([y[0],y[1],y[2]],2);c=U.reshape(d,[1,t.shape[0]||0,t.shape[1]||0,3]),U.dispose([...x,...i,...y,d])}else c=U.expandDims(t,0);return U.dispose([...n,...o,...r,n,t,e]),c}var U2=3840,R0=null,M0=null,y2=null,e0,ne={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function e5(){ne.inputSum=0,ne.cacheDiff=1,ne.sumMethod=0,ne.inputTensor=void 0}function Ae(e,t){let n;if(R.browser)if(R.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof R.Canvas!="undefined")n=new R.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof R.Canvas!="undefined"?n=new R.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function Y2(e,t){let n=t||Ae(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function K2(e,t,n=!0){var y,d,m;if(!e)return t.debug&&h("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof N.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof N.Tensor){let f=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)f=N.expandDims(e,0);else if(e.shape[2]===4){let u=N.slice3d(e,[0,0,0],[-1,-1,3]);f=N.expandDims(u,0),N.dispose(u)}}else e.shape.length===4&&(e.shape[3]===3?f=N.clone(e):e.shape[3]===4&&(f=N.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(f==null||f.shape.length!==4||f.shape[0]!==1||f.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(f.dtype==="int32"){let u=N.cast(f,"float32");N.dispose(f),f=u}return{tensor:f,canvas:t.filter.return?M0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&h("input stream is not ready"),{tensor:null,canvas:R0};let o=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!o||!r)return t.debug&&h("cannot determine input dimensions"),{tensor:null,canvas:R0};let s=o,A=r;if(s>U2&&(s=U2,A=Math.trunc(s*r/o)),A>U2&&(A=U2,s=Math.trunc(A*o/r)),(((y=t.filter)==null?void 0:y.width)||0)>0?s=t.filter.width:(((d=t.filter)==null?void 0:d.height)||0)>0&&(s=o*((t.filter.height||0)/r)),(t.filter.height||0)>0?A=t.filter.height:(t.filter.width||0)>0&&(A=r*((t.filter.width||0)/o)),!s||!A)throw new Error("input error: cannot determine dimension");(!R0||R0.width!==s||R0.height!==A)&&(R0=Ae(s,A));let a=R0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?a.putImageData(e,0,0):t.filter.flip&&typeof a.translate!="undefined"?(a.translate(o,0),a.scale(-1,1),a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),a.setTransform(1,0,0,1,0,0)):a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),(!M0||R0.width!==M0.width||R0.height!==M0.height)&&(M0=Ae(R0.width,R0.height)),t.filter.enabled&&R.webgl.supported?(e0||(e0=R.browser?new V1:null),R.filter=!!e0,e0!=null&&e0.add?(e0.reset(),t.filter.brightness!==0&&e0.add("brightness",t.filter.brightness),t.filter.contrast!==0&&e0.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&e0.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&e0.add("blur",t.filter.blur),t.filter.saturation!==0&&e0.add("saturation",t.filter.saturation),t.filter.hue!==0&&e0.add("hue",t.filter.hue),t.filter.negative&&e0.add("negative"),t.filter.sepia&&e0.add("sepia"),t.filter.vintage&&e0.add("brownie"),t.filter.sepia&&e0.add("sepia"),t.filter.kodachrome&&e0.add("kodachrome"),t.filter.technicolor&&e0.add("technicolor"),t.filter.polaroid&&e0.add("polaroid"),t.filter.pixelate!==0&&e0.add("pixelate",t.filter.pixelate),((m=e0.get())==null?void 0:m.length)>1?M0=e0.apply(R0):M0=e0.draw(R0)):(t.debug&&h("input process error: cannot initialize filters"),R.webgl.supported=!1,t.filter.enabled=!1,Y2(R0,M0))):(Y2(R0,M0),e0&&(e0=null),R.filter=!!e0),!n)return{tensor:null,canvas:M0};if(!M0)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(R.browser&&N.browser)l=N.browser?N.browser.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let f=new Uint8Array(e.data.buffer);l=N.tensor(f,[e.height,e.width,c],"int32")}else if((!y2||M0.width!==y2.width||M0.height!==y2.height)&&(y2=Ae(M0.width,M0.height)),N.browser&&R.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=N.browser.fromPixels(M0):(y2=Y2(M0),l=N.browser.fromPixels(y2));else{let g=Y2(M0).getContext("2d").getImageData(0,0,s,A);c=g.data.length/s/A;let T=new Uint8Array(g.data.buffer);l=N.tensor(T,[s,A,c])}if(c===4){let f=N.slice3d(l,[0,0,0],[-1,-1,3]);N.dispose(l),l=f}if(!l)throw new Error("input error: cannot create tensor");let x=N.cast(l,"float32"),i=t.filter.equalization?await X2(x):N.expandDims(x,0);if(N.dispose([l,x]),t.filter.autoBrightness){let f=N.max(i),u=await f.data();t.filter.brightness=u[0]>1?1-u[0]/255:1-u[0],N.dispose(f)}return{tensor:i,canvas:t.filter.return?M0:null}}async function Z1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!ne.inputTensor)ne.inputTensor=N.clone(t);else if(ne.inputTensor.shape[1]!==t.shape[1]||ne.inputTensor.shape[2]!==t.shape[2])N.dispose(ne.inputTensor),ne.inputTensor=N.clone(t);else{let o={};o.diff=N.sub(t,ne.inputTensor),o.squared=N.mul(o.diff,o.diff),o.sum=N.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;N.dispose([ne.inputTensor,o.diff,o.squared,o.sum]),ne.inputTensor=N.clone(t),n=s<=(e.cacheSensitivity||0)}return n}async function q1(e,t,n){let o={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||h("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||h("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;o.input1=N.clone(t),o.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?N.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):N.clone(n),o.diff=N.sub(o.input1,o.input2),o.squared=N.mul(o.diff,o.diff),o.sum=N.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return N.dispose([o.input1,o.input2,o.diff,o.squared,o.sum]),s}var j2,I2,N2,S2=class{constructor(){w(this,"browser");w(this,"node");w(this,"worker");w(this,"platform","");w(this,"agent","");w(this,"backends",[]);w(this,"initial");w(this,"filter");w(this,"tfjs");w(this,"offscreen");w(this,"perfadd",!1);w(this,"tensorflow",{version:void 0,gpu:void 0});w(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});w(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});w(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});w(this,"cpu",{model:void 0,flags:[]});w(this,"kernels",[]);ue(this,j2,void 0);ue(this,I2,void 0);ue(this,N2,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:W0.version["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let o=n[0].match(/\(([^()]+)\)/g);this.platform=o!=null&&o[0]?o[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return Y0(this,j2)}set Canvas(t){Re(this,j2,t),globalThis.Canvas=t}get Image(){return Y0(this,I2)}set Image(t){Re(this,I2,t),globalThis.Image=t}get ImageData(){return Y0(this,N2)}set ImageData(t){Re(this,N2,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(W0.engine().registryFactory);try{this.tensorflow={version:W0.backend().binding?W0.backend().binding.TF_Version:void 0,gpu:W0.backend().binding?W0.backend().binding.isUsingGpuDevice():void 0}}catch(o){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await W0.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await W0.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Ae(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let o=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(o==null?void 0:o.requestAdapterInfo())}}catch(o){this.webgpu.supported=!1}try{this.kernels=W0.getKernelsForBackend(W0.getBackend()).map(o=>o.kernelName.toLowerCase())}catch(o){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};j2=new WeakMap,I2=new WeakMap,N2=new WeakMap;var R=new S2;var Q2=class{constructor(){w(this,"config");w(this,"element");w(this,"stream");w(this,"devices",[]);w(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});w(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let A=document.getElementById(t.element);if(A&&A instanceof HTMLVideoElement)this.element=A;else return this.config.debug&&h("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&h("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(n.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&h("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&h("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&h("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(A){return h("webcam",A),`webcam error: ${A}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(A=>{this.element?this.element.onloadeddata=()=>A(!0):A(!1)}),await this.element.play(),this.config.debug&&h("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&h("webcam error","no stream"),"webcam error no stream")});w(this,"pause",()=>{this.element&&this.element.pause()});w(this,"play",async()=>{this.element&&await this.element.play()});w(this,"stop",()=>{this.config.debug&&h("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var f2=V(G());var t5={};ze(t5,{"affectnet-mobilenet":()=>br,age:()=>gr,"anti-spoofing":()=>_r,antispoof:()=>ar,blazeface:()=>ir,"blazeface-back":()=>Tr,"blazeface-front":()=>vr,"blazepose-detector":()=>Rr,"blazepose-full":()=>Mr,"blazepose-heavy":()=>Pr,"blazepose-lite":()=>kr,centernet:()=>lr,default:()=>ds,efficientpose:()=>wr,"efficientpose-i-lite":()=>$r,"efficientpose-ii-lite":()=>es,"efficientpose-iv":()=>ts,emotion:()=>cr,faceboxes:()=>Er,facemesh:()=>dr,"facemesh-attention":()=>Sr,"facemesh-attention-pinto":()=>zr,"facemesh-detection-full":()=>jr,"facemesh-detection-short":()=>Ir,faceres:()=>xr,"faceres-deep":()=>Nr,gear:()=>Cr,"gear-e1":()=>Or,"gear-e2":()=>Lr,gender:()=>Dr,"gender-ssrnet-imdb":()=>Wr,handdetect:()=>Fr,"handlandmark-full":()=>Br,"handlandmark-lite":()=>yr,"handlandmark-sparse":()=>Hr,handskeleton:()=>Gr,handtrack:()=>fr,"insightface-efficientnet-b0":()=>ns,"insightface-ghostnet-strides1":()=>os,"insightface-ghostnet-strides2":()=>rs,"insightface-mobilenet-emore":()=>ss,"insightface-mobilenet-swish":()=>As,iris:()=>mr,liveness:()=>pr,meet:()=>Vr,mobileface:()=>Zr,mobilefacenet:()=>qr,models:()=>ur,"movenet-lightning":()=>hr,"movenet-multipose":()=>Xr,"movenet-thunder":()=>Ur,nanodet:()=>Yr,"nanodet-e":()=>as,"nanodet-g":()=>is,"nanodet-m":()=>ls,"nanodet-t":()=>cs,posenet:()=>Kr,rvm:()=>Jr,selfie:()=>Qr});var ar=853098,ir=538928,lr=4030290,cr=820516,dr=1477958,xr=6978814,yr=2023432,fr=2964837,mr=2599092,pr=592976,ur=0,hr=4650216,br=6920630,gr=161240,Tr=538928,vr=402048,Rr=5928856,Mr=6339202,Pr=27502466,kr=2726402,wr=5651240,Er=2013002,zr=2387598,Sr=2382414,jr=1026192,Ir=201268,Nr=13957620,Or=112438,Lr=112438,Cr=1498916,Wr=161236,Dr=201808,Fr=3515612,Br=5431368,Hr=5286322,Gr=5502280,Vr=372228,Zr=2183192,qr=5171976,Xr=9448838,Ur=12477112,Yr=7574558,Kr=5032780,Jr=3739355,Qr=212886,_r=853098,$r=2269064,es=5651240,ts=25643252,ns=13013224,os=8093408,rs=8049584,ss=6938536,As=12168584,as=12319156,is=7574558,ls=1887474,cs=5294216,ds={antispoof:ar,blazeface:ir,centernet:lr,emotion:cr,facemesh:dr,faceres:xr,"handlandmark-lite":yr,handtrack:fr,iris:mr,liveness:pr,models:ur,"movenet-lightning":hr,"affectnet-mobilenet":br,age:gr,"blazeface-back":Tr,"blazeface-front":vr,"blazepose-detector":Rr,"blazepose-full":Mr,"blazepose-heavy":Pr,"blazepose-lite":kr,efficientpose:wr,faceboxes:Er,"facemesh-attention-pinto":zr,"facemesh-attention":Sr,"facemesh-detection-full":jr,"facemesh-detection-short":Ir,"faceres-deep":Nr,"gear-e1":Or,"gear-e2":Lr,gear:Cr,"gender-ssrnet-imdb":Wr,gender:Dr,handdetect:Fr,"handlandmark-full":Br,"handlandmark-sparse":Hr,handskeleton:Gr,meet:Vr,mobileface:Zr,mobilefacenet:qr,"movenet-multipose":Xr,"movenet-thunder":Ur,nanodet:Yr,posenet:Kr,rvm:Jr,selfie:Qr,"anti-spoofing":_r,"efficientpose-i-lite":$r,"efficientpose-ii-lite":es,"efficientpose-iv":ts,"insightface-efficientnet-b0":ns,"insightface-ghostnet-strides1":os,"insightface-ghostnet-strides2":rs,"insightface-mobilenet-emore":ss,"insightface-mobilenet-swish":As,"nanodet-e":as,"nanodet-g":is,"nanodet-m":ls,"nanodet-t":cs};var D0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},I0={};async function xs(e,t){return D0.debug&&h("load model fetch:",e,t),fetch(e,t)}function X1(e){D0.cacheModels=e.cacheModels,D0.verbose=e.debug,D0.modelBasePath=e.modelBasePath}async function O(e){var c,x,i,y;let t=C1(D0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),o=n[n.length-1].replace(".json",""),r="indexeddb://"+o;I0[o]={name:o,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:t5[o],inCache:!1,url:""},D0.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=D0.cacheSupported&&D0.cacheModels?await f2.io.listModels():{}}catch(d){D0.cacheSupported=!1}I0[o].inCache=D0.cacheSupported&&D0.cacheModels&&Object.keys(s).includes(r),I0[o].url=I0[o].inCache?r:t;let A=typeof fetch=="undefined"?{}:{fetchFunc:(d,m)=>xs(d,m)},a=new f2.GraphModel(I0[o].url,A),l=!1;try{a.findIOHandler(),D0.debug&&h("model load handler:",a.handler)}catch(d){h("error finding model i/o handler:",t,d)}try{let d=await((c=a.handler)==null?void 0:c.load())||null;I0[o].sizeFromManifest=((x=d==null?void 0:d.weightData)==null?void 0:x.byteLength)||0,d?a.loadSync(d):a=await f2.loadGraphModel(I0[o].inCache?r:t,A),I0[o].sizeLoadedWeights=((y=(i=a.artifacts)==null?void 0:i.weightData)==null?void 0:y.byteLength)||0,D0.verbose&&h("load:",{model:o,url:a.modelUrl,bytes:I0[o].sizeLoadedWeights}),l=!0}catch(d){h("error loading model:",t,d)}if(l&&D0.cacheModels&&D0.cacheSupported&&!I0[o].inCache)try{let d=await a.save(r);D0.debug&&h("model saved:",r,d)}catch(d){h("error saving model:",t,d)}return a}var n5="3.2.1";var S=V(G());var u0=V(G());var o0={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function ms(){let e=o0.gl;e&&(o0.extensions=e.getSupportedExtensions())}function U1(e){var t;if(e.config.backend==="humangl"&&(o0.name in u0.engine().registry&&!((t=o0==null?void 0:o0.gl)!=null&&t.getParameter(o0.gl.VERSION))&&(h("humangl error: backend invalid context"),e.models.reset()),!u0.findBackend(o0.name))){try{o0.canvas=Ae(100,100)}catch(r){h("humangl error: cannot create canvas:",r);return}try{if(o0.gl=o0.canvas.getContext("webgl2",o0.webGLattr),!o0.gl){h("humangl error: cannot get webgl context");return}if(!o0.gl.getParameter(o0.gl.VERSION).includes("2.0")){h("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}o0.canvas&&(o0.canvas.addEventListener("webglcontextlost",s=>{throw h("humangl error:",s.type),h("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),o0.canvas.addEventListener("webglcontextrestored",s=>{h("humangl error: context restored:",s)}),o0.canvas.addEventListener("webglcontextcreationerror",s=>{h("humangl error: context create:",s)}))}catch(r){h("humangl error: cannot get webgl context:",r);return}try{u0.setWebGLContext(2,o0.gl)}catch(r){h("humangl error: cannot set webgl context:",r);return}try{let r=new u0.GPGPUContext(o0.gl);u0.registerBackend(o0.name,()=>new u0.MathBackendWebGL(r),o0.priority)}catch(r){h("humangl error: cannot register webgl backend:",r);return}try{u0.getKernelsForBackend("webgl").forEach(s=>{let A={...s,backendName:o0.name};u0.registerKernel(A)})}catch(r){h("humangl error: cannot update webgl backend registration:",r);return}try{u0.env().flagRegistry.WEBGL_VERSION&&u0.env().set("WEBGL_VERSION",2)}catch(r){h("humangl error: cannot set WebGL backend flags:",r);return}ms();let n=u0.backend(),o=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;o?e.config.debug&&h("humangl backend registered:",{webgl:o.getParameter(o.VERSION),renderer:o.getParameter(o.RENDERER)}):h("humangl error: no current gl context:",o,o0.gl)}}var Se=V(G()),C={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function Y1(){C.tf255=Se.scalar(255,"float32"),C.tf1=Se.scalar(1,"float32"),C.tf2=Se.scalar(2,"float32"),C.tf05=Se.scalar(.5,"float32"),C.tf127=Se.scalar(127.5,"float32"),C.rgb=Se.tensor1d([.2989,.587,.114],"float32")}async function hs(){var e;return await R.updateBackend(),(e=R.tensorflow)!=null&&e.version?"tensorflow":R.webgpu.supported&&R.webgpu.backend?"webgpu":R.webgl.supported&&R.webgl.backend?"webgl":R.wasm.supported&&R.wasm.backend?"wasm":"cpu"}function bs(e){let t=[];if(!R.kernels.includes("mod")){let n={kernelName:"Mod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.sub(o.inputs.a,S.mul(S.div(o.inputs.a,o.inputs.b),o.inputs.b)))};S.registerKernel(n),R.kernels.push("mod"),t.push("mod")}if(!R.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.add(S.mul(S.floorDiv(o.inputs.a,o.inputs.b),o.inputs.b),S.mod(o.inputs.a,o.inputs.b)))};S.registerKernel(n),R.kernels.push("floormod"),t.push("floormod")}if(!R.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>{let r=S.getBackend();S.setBackend("cpu");let s=S.image.rotateWithOffset(o.inputs.image,o.attrs.radians,o.attrs.fillValue,o.attrs.center);return S.setBackend(r),s})};S.registerKernel(n),R.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&h("registered kernels:",t)}var K1={};async function O2(e,t=!1){var n,o;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await hs()),t||R.initial||e.config.backend&&e.config.backend.length>0&&S.getBackend()!==e.config.backend){let r=v();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&h("running inside web worker"),typeof navigator!="undefined"&&((o=navigator==null?void 0:navigator.userAgent)!=null&&o.toLowerCase().includes("electron"))&&e.config.debug&&h("running inside electron");let s=Object.keys(S.engine().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(U1(e),s=Object.keys(S.engine().registryFactory)),e.config.debug&&h("available backends:",s),R.browser&&!R.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&h("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),R.node&&!R.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&h(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),R.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")h("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let A=await navigator.gpu.requestAdapter();if(e.config.debug&&h("enumerated webgpu adapter:",A),!A)h("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let a="requestAdapterInfo"in A?await A.requestAdapterInfo():void 0;h("webgpu adapter info:",a)}}if(s.includes(e.config.backend)||(h(`error: backend ${e.config.backend} not found in registry`),e.config.backend=R.node?"tensorflow":"webgl",e.config.debug&&h(`override: setting backend ${e.config.backend}`)),e.config.debug&&h("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(S.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&S.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&h("wasm path:",e.config.wasmPath),typeof S.setWasmPaths!="undefined")S.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let A=!1,a=!1;try{A=await S.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),a=await S.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&h(`wasm execution: ${a?"simd":"no simd"} ${A?"multithreaded":"singlethreaded"}`),e.config.debug&&!a&&h("warning: wasm simd support is not enabled")}catch(l){h("wasm detection failed")}}try{await S.setBackend(e.config.backend),await S.ready()}catch(A){return h("error: cannot set backend:",e.config.backend,A),!1}e.config.debug&&(K1=JSON.parse(JSON.stringify(S.env().flags)))}if((S.getBackend()==="humangl"||S.getBackend()==="webgl")&&(S.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&S.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),S.env().flagRegistry.WEBGL_EXP_CONV&&S.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(h("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),S.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),S.getBackend(),e.config.debug){let s=S.env().flags,A={};for(let a of Object.keys(s))K1[a]!==s[a]&&(A[a]=s[a]);e.config.debug&&Object.keys(A).length>0&&h("backend:",S.getBackend(),"flags:",A)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&h("flags:",e.config.flags);for(let[s,A]of Object.entries(e.config.flags))S.env().set(s,A)}S.enableProdMode(),Y1(),e.performance.initBackend=Math.trunc(v()-r),e.config.backend=S.getBackend(),await R.updateBackend(),bs(e.config)}return!0}function _2(e,t){for(let n of e){let o={kernelName:n,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&h("kernelFunc",n,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};S.registerKernel(o)}R.kernels=S.getKernelsForBackend(S.getBackend()).map(n=>n.kernelName.toLowerCase())}var rt={};ze(rt,{all:()=>Js,body:()=>et,canvas:()=>Ks,face:()=>$2,gesture:()=>ot,hand:()=>tt,init:()=>l5,object:()=>nt,options:()=>f0,person:()=>Ys});var oe=e=>{if(!e)h("draw error: invalid canvas");else if(!e.getContext)h("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)h("draw error: cannot get canvas context");else return t}return null},Je=e=>Math.round(e*180/Math.PI),Y=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Qe=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function re(e,t,n,o,r){let s=t.replace(/\[.*\]/g,"").split(` +`).map(a=>a.trim()),A=Math.max(0,n);for(let a=s.length-1;a>=0;a--){let l=a*r.lineHeight+o;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[a],A+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[a],A+4,l+15)}}function he(e,t,n,o,r){e.fillStyle=Qe(o,r),e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function be(e,t,n,o,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let A=(t+t+o)/2,a=(n+n+r)/2;e.ellipse(A,a,o/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,n),e.lineTo(t+o-s.roundRect,n),e.quadraticCurveTo(t+o,n,t+o,n+s.roundRect),e.lineTo(t+o,n+r-s.roundRect),e.quadraticCurveTo(t+o,n+r,t+o-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 o5(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let o of t)e.strokeStyle=Qe(o[2]||0,n),e.lineTo(Math.trunc(o[0]),Math.trunc(o[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function Q1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){o5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let o=0;oL2[e]),Ga=Ts.map(e=>L2[e]),Va=vs.map(e=>L2[e]);function je(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Rs=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ms=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ps=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ks=[[474,475],[475,476],[476,477],[477,474]],ws=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Es=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],zs=[[469,470],[470,471],[471,472],[472,469]],Ss=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Za={lips:je(Rs),leftEye:je(Ms),leftEyebrow:je(Ps),leftIris:je(ks),rightEye:je(ws),rightEyebrow:je(Es),rightIris:je(zs),faceOval:je(Ss)};var js=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Is=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ns=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Os=[[474,475],[475,476],[476,477],[477,474]],Ls=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Cs=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ws=[[469,470],[470,471],[471,472],[472,469]],Ds=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function Ie(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Fs={lips:Ie(js),leftEye:Ie(Is),leftEyebrow:Ie(Ns),leftIris:Ie(Os),rightEye:Ie(Ls),rightEyebrow:Ie(Cs),rightIris:Ie(Ws),faceOval:Ie(Ds)},Bs=Object.entries(Fs).map(([e,t])=>t.map(n=>[n,e])).flat(),qa=new Map(Bs),C2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],e2=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],t2=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var X;function Hs(e,t){var o,r,s,A,a,l,c,x,i;if(!X.drawLabels||((o=X.faceLabels)==null?void 0:o.length)===0)return;let n=X.faceLabels.slice();if(n=Y(n,"[id]",e.id.toFixed(0)),e.score&&(n=Y(n,"[score]",100*e.score)),e.gender&&(n=Y(n,"[gender]",e.gender)),e.genderScore&&(n=Y(n,"[genderScore]",100*e.genderScore)),e.age&&(n=Y(n,"[age]",e.age)),e.distance&&(n=Y(n,"[distance]",100*e.distance)),e.real&&(n=Y(n,"[real]",100*e.real)),e.live&&(n=Y(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let y=e.emotion.map(d=>`${Math.trunc(100*d.score)}% ${d.emotion}`);y.length>3&&(y.length=3),n=Y(n,"[emotions]",y.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(n=Y(n,"[roll]",Je(e.rotation.angle.roll))),(a=(A=e.rotation)==null?void 0:A.angle)!=null&&a.yaw&&(n=Y(n,"[yaw]",Je(e.rotation.angle.yaw))),(c=(l=e.rotation)==null?void 0:l.angle)!=null&&c.pitch&&(n=Y(n,"[pitch]",Je(e.rotation.angle.pitch))),(i=(x=e.rotation)==null?void 0:x.gaze)!=null&&i.bearing&&(n=Y(n,"[gaze]",Je(e.rotation.gaze.bearing))),re(t,n,e.box[0],e.box[1],X)}function Gs(e,t){var n,o,r,s;if((n=e.annotations)!=null&&n.leftEyeIris&&((o=e.annotations)!=null&&o.leftEyeIris[0])){t.strokeStyle=X.useDepth?"rgba(255, 200, 255, 0.3)":X.color,t.beginPath();let A=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,a=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),X.fillPolygons&&(t.fillStyle=X.useDepth?"rgba(255, 255, 200, 0.3)":X.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=X.useDepth?"rgba(255, 200, 255, 0.3)":X.color,t.beginPath();let A=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,a=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),X.fillPolygons&&(t.fillStyle=X.useDepth?"rgba(255, 255, 200, 0.3)":X.color,t.fill())}}function Vs(e,t){var n;if(X.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let o=e.box[0]+e.box[2]/2-e.box[3]*Je(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*Je(e.rotation.angle.pitch)/90,s=new Path2D(` M ${e.box[0]+e.box[2]/2} ${e.box[1]} C ${o} ${e.box[1]}, @@ -118,7 +118,7 @@ live: [live]% [emotions] roll: [roll]\xB0 yaw:[yaw]\xB0 pitch:[pitch]\xB0 - gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var i5=0;function Ys(e,t,n){let o=a0(f0,n);if(!t||!e)return;let r=oe(e);if(r){r.lineJoin="round",r.font=o.font;for(let s=0;sd5,kpt:()=>c5});var c5=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],d5={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var D=G(H());var se,n2=224,e3,Qs=5,At=[8,16,32,32,32];function _s(){let e=[],t=0;for(;tn.x)),y:D.tensor1d(e.map(n=>n.y))}}async function t3(e){if(R.initial&&(se=null),!se&&e.body.detector&&e.body.detector.modelPath){se=await O(e.body.detector.modelPath);let t=se!=null&&se.executor?Object.values(se.modelSignature.inputs):void 0;n2=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&se&&h("cached model:",se.modelUrl);return _s(),se}var $1=[5,5];function $s(e,t){return D.tidy(()=>{let n=D.split(e,12,1),o=D.squeeze(n[0]),r=D.squeeze(n[1]),s=D.squeeze(n[2]),A=D.squeeze(n[3]);o=D.add(D.div(o,n2),t.x),r=D.add(D.div(r,n2),t.y),s=D.mul(D.div(s,n2),$1[0]),A=D.mul(D.div(A,n2),$1[1]);let a=D.sub(o,D.div(s,2)),l=D.sub(r,D.div(A,2)),c=D.add(a,s),x=D.add(l,A);return D.stack([a,l,c,x],1)})}async function eA(e,t,n,o){var c,x;let r=[],s={};s.boxes=$s(e,e3),s.scores=D.sigmoid(t),s.nms=await D.image.nonMaxSuppressionAsync(s.boxes,s.scores,1,((c=n.body.detector)==null?void 0:c.minConfidence)||.1,((x=n.body.detector)==null?void 0:x.iouThreshold)||.1);let A=await s.nms.data(),a=await s.scores.data(),l=await s.boxes.array();for(let i of Array.from(A)){let f=a[i],d=l[i],m=[Math.round(d[0]*o[0]),Math.round(d[1]*o[1]),Math.round(d[2]*o[0]),Math.round(d[3]*o[1])],y={score:f,boxRaw:d,box:m};r.push(y)}return Object.keys(s).forEach(i=>D.dispose(s[i])),r}async function n3(e,t,n){let o={};o.res=se==null?void 0:se.execute(e,["Identity"]),o.logitsRaw=D.slice(o.res,[0,0,0],[1,-1,1]),o.boxesRaw=D.slice(o.res,[0,0,1],[1,-1,-1]),o.logits=D.squeeze(o.logitsRaw),o.boxes=D.squeeze(o.boxesRaw);let r=await eA(o.boxes,o.logits,t,n);return Object.keys(o).forEach(s=>D.dispose(o[s])),r}function Oe(e,t=[1,1]){let n=[e.map(a=>a[0]),e.map(a=>a[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[o[0],o[1],r[0]-o[0],r[1]-o[1]],A=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:A}}function o3(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[(o[0]+r[0])/2,(o[1]+r[1])/2],A=Math.max(s[0]-o[0],s[1]-o[1],-s[0]+r[0],-s[1]+r[1]),a=[Math.trunc(s[0]-A),Math.trunc(s[1]-A),Math.trunc(2*A),Math.trunc(2*A)],l=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:l}}function at(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var Z0,y5=256,x5=Number.MAX_SAFE_INTEGER,tA={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},lt=[],Le=[[0,0],[0,0],[0,0],[0,0]],r3=0,s3=e=>1-1/(1+Math.exp(e)),a3=e=>t3(e);async function i3(e){if(R.initial&&(Z0=null),Z0)e.debug&&h("cached model:",Z0.modelUrl);else{Z0=await O(e.body.modelPath);let t=Z0!=null&&Z0.executor?Object.values(Z0.modelSignature.inputs):void 0;y5=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Z0}function A3(e,t,n){var s,A;let o={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((A=e==null?void 0:e.shape)!=null&&A[2]))return e;let r;if(n&&(o.cropped=q0.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let a=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Le=[[0,0],a,l,[0,0]],o.pad=q0.pad(o.cropped||e,Le),o.resize=q0.image.resizeBilinear(o.pad,[t,t]),r=q0.div(o.resize,C.tf255)}else e.shape[1]!==t?(o.resize=q0.image.resizeBilinear(o.cropped||e,[t,t]),r=q0.div(o.resize,C.tf255)):r=q0.div(o.cropped||e,C.tf255);return Object.keys(o).forEach(a=>q0.dispose(o[a])),r}function nA(e,t,n){for(let o of e)o.position=[Math.trunc(o.position[0]*(t[0]+Le[2][0]+Le[2][1])/t[0]-Le[2][0]),Math.trunc(o.position[1]*(t[1]+Le[1][0]+Le[1][1])/t[1]-Le[1][0]),o.position[2]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1],2*o.position[2]/(t[0]+t[1])];if(n){let o=n[2]-n[0],r=n[3]-n[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+n[1],s.positionRaw[1]/o+n[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function oA(e){let t=e.find(a=>a.part==="leftPalm"),n=e.find(a=>a.part==="leftWrist"),o=e.find(a=>a.part==="leftIndex");t.position[2]=((n.position[2]||0)+(o.position[2]||0))/2;let r=e.find(a=>a.part==="rightPalm"),s=e.find(a=>a.part==="rightWrist"),A=e.find(a=>a.part==="rightIndex");r.position[2]=((s.position[2]||0)+(A.position[2]||0))/2}async function rA(e,t,n){if(!(Z0!=null&&Z0.executor))return null;let o={};[o.ld,o.segmentation,o.heatmap,o.world,o.poseflag]=Z0==null?void 0:Z0.execute(e,tA.landmarks);let r=(await o.poseflag.data())[0],s=await o.ld.data(),A=await o.world.data();Object.keys(o).forEach(m=>q0.dispose(o[m]));let a=[],l=5;for(let m=0;mm.position),i=Oe(x,[n[0],n[1]]),f={};for(let[m,y]of Object.entries(d5)){let u=[];for(let T=0;Tb.part===y[T]),p=c.find(b=>b.part===y[T+1]);g&&p&&u.push([g.position,p.position])}f[m]=u}return{id:0,score:Math.trunc(100*r)/100,box:i.box,boxRaw:i.boxRaw,keypoints:c,annotations:f}}async function f5(e,t){var s,A,a;let n=[e.shape[2]||0,e.shape[1]||0],o=(t.body.skipTime||0)>v()-r3,r=x5<(t.body.skipFrames||0);if(t.skipAllowed&&o&&r&<!==null)x5++;else{let l=[];if((A=(s=t.body)==null?void 0:s.detector)!=null&&A.enabled){let c=A3(e,224);l=await n3(c,t,n),q0.dispose(c)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let c=0;cF0.dispose(o[c])),r}async function u5(e,t){if(!(X0!=null&&X0.executor))return[];let n=(t.object.skipTime||0)>v()-c3,o=p5<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&m5.length>0?(p5++,m5):(p5=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=F0.image.resizeBilinear(e,[o2,o2]),a=t.object.enabled?X0==null?void 0:X0.execute(A,["tower_0/detections"]):null;c3=v(),F0.dispose(A);let l=await sA(a,s,t);m5=l,r(l)}))}var J=G(H());var ct={};ze(ct,{connected:()=>b5,kpt:()=>h5});var h5=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],b5={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var i0,y3=0,B0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},g5=Number.MAX_SAFE_INTEGER;async function f3(e){return R.initial&&(i0=null),i0?e.debug&&h("cached model:",i0.modelUrl):i0=await O(e.body.modelPath),i0}async function AA(e,t){let[n,o]=e.shape,r=J.reshape(e,[o*n]),s=J.max(r,0),A=(await s.data())[0];if(A>t){let a=J.argMax(r,0),l=J.mod(a,n),c=(await l.data())[0],x=J.div(a,n),i=(await x.data())[0];return J.dispose([r,s,a,l,x]),[c,i,A]}return J.dispose([r,s]),[0,0,A]}async function T5(e,t){if(!(i0!=null&&i0.executor)||!(i0!=null&&i0.inputs[0].shape))return[];let n=(t.body.skipTime||0)>v()-y3,o=g5<(t.body.skipFrames||0);return t.skipAllowed&&n&&o&&Object.keys(B0.keypoints).length>0?(g5++,[B0]):(g5=0,new Promise(async r=>{let s=J.tidy(()=>{var m,y;let i=J.image.resizeBilinear(e,[((m=i0==null?void 0:i0.inputs[0].shape)==null?void 0:m[2])||0,((y=i0==null?void 0:i0.inputs[0].shape)==null?void 0:y[1])||0],!1),f=J.mul(i,C.tf2);return J.sub(f,C.tf1)}),A;if(t.body.enabled&&(A=i0==null?void 0:i0.execute(s)),y3=v(),J.dispose(s),A){B0.keypoints.length=0;let i=J.squeeze(A);J.dispose(A);let f=J.unstack(i,2);J.dispose(i);for(let d=0;d(t.body.minConfidence||0)&&B0.keypoints.push({score:Math.round(100*u)/100,part:h5[d],positionRaw:[m/i0.inputs[0].shape[2],y/i0.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/i0.inputs[0].shape[2]),Math.round(e.shape[1]*y/i0.inputs[0].shape[1])]})}f.forEach(d=>J.dispose(d))}B0.score=B0.keypoints.reduce((i,f)=>f.score>i?f.score:i,0);let a=B0.keypoints.map(i=>i.position[0]),l=B0.keypoints.map(i=>i.position[1]);B0.box=[Math.min(...a),Math.min(...l),Math.max(...a)-Math.min(...a),Math.max(...l)-Math.min(...l)];let c=B0.keypoints.map(i=>i.positionRaw[0]),x=B0.keypoints.map(i=>i.positionRaw[1]);B0.boxRaw=[Math.min(...c),Math.min(...x),Math.max(...c)-Math.min(...c),Math.max(...x)-Math.min(...x)];for(let[i,f]of Object.entries(b5)){let d=[];for(let m=0;mT.part===f[m]),u=B0.keypoints.find(T=>T.part===f[m+1]);y&&u&&y.score>(t.body.minConfidence||0)&&u.score>(t.body.minConfidence||0)&&d.push([y.position,u.position])}B0.annotations[i]=d}r([B0])}))}var l0=G(H());var De=G(H());var L=G(H());var Me=G(H());var p2=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],dt=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],xt=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],yt=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],h3=(e,t,n)=>{let o=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(A=>[(A[0]+n[0])*t[0],(A[1]+n[1])*t[1]]);return{startPoint:o,endPoint:r,landmarks:s,confidence:e.confidence}},v5=(e,t,n)=>{let o=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/o,e.startPoint[0]/r,e.endPoint[1]/o,e.endPoint[0]/r],A=Me.image.cropAndResize(t,[s],[0],n),a=Me.div(A,C.tf255);return Me.dispose(A),a},ft=(e,t)=>{let n=dt(e),o=p2(e),r=[t*o[0]/2,t*o[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:o}},mt=e=>{let t=dt(e),n=p2(e),o=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-o),Math.round(t[1]-o)],endPoint:[Math.round(t[0]+o),Math.round(t[1]+o)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},b3=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},R5=[[1,0,0],[0,1,0],[0,0,1]],aA=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),iA=(e,t)=>aA(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var p3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],r2=(e,t)=>{let n=0;for(let o=0;o{let n=[];for(let o=0;o{let n=[],o=e.length;for(let r=0;r{let n=Math.cos(e),o=Math.sin(e),r=[[n,-o,0],[o,n,0],[0,0,1]],s=p3(t[0],t[1]),A=u3(s,r),a=p3(-t[0],-t[1]);return u3(A,a)},cA=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],o=[-r2(t[0],n),-r2(t[1],n)];return[t[0].concat(o[0]),t[1].concat(o[1]),[0,0,1]]},dA=(e,t)=>[r2(e,t[0]),r2(e,t[1])];function T3(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let o=0;o[s[0]/r*(d[0]-r/2),s[1]/r*(d[1]-r/2),d[2]||0]),a=n&&n!==0&&Math.abs(n)>.2,l=a?g3(n,[0,0]):R5,c=a?A.map(d=>[...dA(d,l),d[2]]):A,x=a?cA(o):R5,i=dt(t),f=[r2(i,x[0]),r2(i,x[1])];return c.map(d=>[Math.trunc(d[0]+f[0]),Math.trunc(d[1]+f[1]),Math.trunc(d[2]||0)])}function R3(e,t,n,o){let r=t.landmarks.length>=s5.count?s5.symmetryLine:_e.symmetryLine,s=0,A=R5,a;if(e&&R.kernels.includes("rotatewithoffset"))if(s=iA(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let c=dt(t),x=[c[0]/n.shape[2],c[1]/n.shape[1]],i=Me.image.rotateWithOffset(n,s,0,[x[0],x[1]]);A=g3(-s,c),a=v5(t,i,[o,o]),Me.dispose(i)}else a=v5(t,n,[o,o]);else a=v5(t,n,[o,o]);return[s,A,a]}var xA=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},M3=(e,t)=>{let n=xA(e),o=p2(t);return{startPoint:[n[0]-o[0]/2,n[1]-o[1]/2],endPoint:[n[0]+o[0]/2,n[1]+o[1]/2]}};var P3=6,yA=1.4,xe,pt=null,Ce=0,u2=null,k3=()=>Ce;async function w3(e){var t;return R.initial&&(xe=null),xe?e.debug&&h("cached model:",xe.modelUrl):xe=await O((t=e.face.detector)==null?void 0:t.modelPath),Ce=xe.executor&&xe.inputs[0].shape?xe.inputs[0].shape[2]:256,u2=L.scalar(Ce,"int32"),pt=L.tensor2d(T3(Ce)),xe}function fA(e){if(!pt||!u2)return L.zeros([0,0]);let t={};t.boxStarts=L.slice(e,[0,1],[-1,2]),t.centers=L.add(t.boxStarts,pt),t.boxSizes=L.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=L.div(t.boxSizes,u2),t.centersNormalized=L.div(t.centers,u2),t.halfBoxSize=L.div(t.boxSizesNormalized,C.tf2),t.starts=L.sub(t.centersNormalized,t.halfBoxSize),t.ends=L.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=L.mul(t.starts,u2),t.endNormalized=L.mul(t.ends,u2);let n=L.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(o=>L.dispose(t[o])),n}async function E3(e,t){var a,l,c,x,i,f;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=L.image.resizeBilinear(e,[Ce,Ce]),n.div=L.div(n.resized,C.tf127),n.normalized=L.sub(n.div,C.tf05);let o=xe==null?void 0:xe.execute(n.normalized);if(Array.isArray(o)&&o.length>2){let d=o.sort((m,y)=>m.size-y.size);n.concat384=L.concat([d[0],d[2]],2),n.concat512=L.concat([d[1],d[3]],2),n.concat=L.concat([n.concat512,n.concat384],1),n.batch=L.squeeze(n.concat,[0])}else Array.isArray(o)?n.batch=L.squeeze(o[0]):n.batch=L.squeeze(o);L.dispose(o),n.boxes=fA(n.batch),n.logits=L.slice(n.batch,[0,0],[-1,1]),n.sigmoid=L.sigmoid(n.logits),n.scores=L.squeeze(n.sigmoid),n.nms=await L.image.nonMaxSuppressionAsync(n.boxes,n.scores,((a=t.face.detector)==null?void 0:a.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),s=[],A=await n.scores.data();for(let d=0;d(((x=t.face.detector)==null?void 0:x.minConfidence)||0)){let y={};y.bbox=L.slice(n.boxes,[r[d],0],[1,-1]),y.slice=L.slice(n.batch,[r[d],P3-1],[1,-1]),y.squeeze=L.squeeze(y.slice),y.landmarks=L.reshape(y.squeeze,[P3,-1]);let u=await y.bbox.data(),T={startPoint:[u[0],u[1]],endPoint:[u[2],u[3]],landmarks:await y.landmarks.array(),confidence:m};y.anchor=L.slice(pt,[r[d],0],[1,2]);let g=await y.anchor.data(),p=h3(T,[(e.shape[2]||0)/Ce,(e.shape[1]||0)/Ce],g),b=ft(p,t.face.scale||yA),k=mt(b);k.size[0]>(((i=t.face.detector)==null?void 0:i.minSize)||0)&&k.size[1]>(((f=t.face.detector)==null?void 0:f.minSize)||0)&&s.push(k),Object.keys(y).forEach(P=>L.dispose(y[P]))}}return Object.keys(n).forEach(d=>L.dispose(n[d])),s}var ye=G(H());var K0,We=0,mA=2.3,P5=ae.leftEyeLower0,k5=ae.rightEyeLower0,h2={leftBounds:[P5[0],P5[P5.length-1]],rightBounds:[k5[0],k5[k5.length-1]]},b2={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function N3(e){var t,n;return R.initial&&(K0=null),K0?e.debug&&h("cached model:",K0.modelUrl):K0=await O((t=e.face.iris)==null?void 0:t.modelPath),We=K0!=null&&K0.executor&&((n=K0.inputs)!=null&&n[0].shape)?K0.inputs[0].shape[2]:0,We===-1&&(We=64),K0}function ut(e,t,n,o){for(let r=0;r{let t=e[h2.leftBounds[0]][2],n=e[h2.rightBounds[0]][2];return t-n},S3=(e,t,n,o,r,s=!1)=>{let A=mt(ft(b3([e[n],e[o]]),mA)),a=p2(A),l=ye.image.cropAndResize(t,[[A.startPoint[1]/r,A.startPoint[0]/r,A.endPoint[1]/r,A.endPoint[0]/r]],[0],[We,We]);if(s&&R.kernels.includes("flipleftright")){let c=ye.image.flipLeftRight(l);ye.dispose(l),l=c}return{box:A,boxSize:a,crop:l}},j3=(e,t,n,o=!1)=>{let r=[];for(let s=0;s{let o=e[ae[`${n}EyeUpper0`][b2.upperCenter]][2],r=e[ae[`${n}EyeLower0`][b2.lowerCenter]][2],s=(o+r)/2;return t.map((A,a)=>{let l=s;return a===2?l=o:a===4&&(l=r),[A[0],A[1],l]})};async function O3(e,t,n){if(!(K0!=null&&K0.executor))return e;let{box:o,boxSize:r,crop:s}=S3(e,t,h2.leftBounds[0],h2.leftBounds[1],n,!0),{box:A,boxSize:a,crop:l}=S3(e,t,h2.rightBounds[0],h2.rightBounds[1],n,!0),c=ye.concat([s,l]);ye.dispose(s),ye.dispose(l);let x=K0.execute(c);ye.dispose(c);let i=await x.data();ye.dispose(x);let f=i.slice(0,b2.numCoordinates*3),{rawCoords:d,iris:m}=j3(f,o,r,!0),y=i.slice(b2.numCoordinates*3),{rawCoords:u,iris:T}=j3(y,A,a,!1),g=pA(e);Math.abs(g)<30?(ut(e,d,"left",null),ut(e,u,"right",null)):g<1?ut(e,d,"left",["EyeUpper0","EyeLower0"]):ut(e,u,"right",["EyeUpper0","EyeLower0"]);let p=I3(e,m,"left"),b=I3(e,T,"right");return e.concat(p).concat(b)}async function C3(e,t){var s,A,a,l,c,x,i,f,d,m;let n={lips:await((A=(s=t.filter(y=>y.size===160))==null?void 0:s[0])==null?void 0:A.data()),irisL:await((l=(a=t.filter(y=>y.size===10))==null?void 0:a[0])==null?void 0:l.data()),eyeL:await((x=(c=t.filter(y=>y.size===142))==null?void 0:c[0])==null?void 0:x.data()),irisR:await((f=(i=t.filter(y=>y.size===10))==null?void 0:i[1])==null?void 0:f.data()),eyeR:await((m=(d=t.filter(y=>y.size===142))==null?void 0:d[1])==null?void 0:m.data())};for(let y of Object.values(n))if(!y)return e;let o=e2.reduce((y,u)=>y+=e[u][2],0)/e2.length;for(let y=0;yy+=e[u][2],0)/t2.length;for(let y=0;yv()-ge.timestamp,o=ge.skipped<(((c=t.face.detector)==null?void 0:c.skipFrames)||0);!t.skipAllowed||!n||!o||ge.boxes.length===0?(ge.boxes=await E3(e,t),ge.timestamp=v(),ge.skipped=0):ge.skipped++;let r=[],s=[],A=0,a=W2;for(let g=0;g[N[0]/(e.shape[2]||0),N[1]/(e.shape[1]||0),(N[2]||0)/a]);for(let N of Object.keys(_e))P.annotations[N]=[P.mesh[_e[N]]]}else if(!r0)t.debug&&h("face mesh detection requested, but model is not loaded");else{if((d=t.face.attention)!=null&&d.enabled&&!R.kernels.includes("atan2"))return t.face.attention.enabled=!1,De.dispose(P.tensor),r;let N=r0.execute(P.tensor),_=await N.find(Z=>Z.shape[Z.shape.length-1]===1).data();if(P.faceScore=Math.round(100*_[0])/100,P.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(p.confidence=P.faceScore,t.face.mesh.keepInvalid){P.box=xt(p,e),P.boxRaw=yt(p,e),P.size=p.size,P.score=P.boxScore,P.mesh=p.landmarks,P.meshRaw=P.mesh.map(Z=>[Z[0]/(e.shape[2]||1),Z[1]/(e.shape[1]||1),(Z[2]||0)/a]);for(let Z of Object.keys(_e))P.annotations[Z]=[P.mesh[_e[Z]]]}}else{let Z=N.find(n0=>n0.shape[n0.shape.length-1]===1404),$=De.reshape(Z,[-1,3]),A0=await $.array();De.dispose($),(y=t.face.attention)!=null&&y.enabled?A0=await C3(A0,N):(u=t.face.iris)!=null&&u.enabled&&(A0=await O3(A0,P.tensor,W2)),P.mesh=v3(A0,p,b,k,W2),P.meshRaw=P.mesh.map(n0=>[n0[0]/(e.shape[2]||0),n0[1]/(e.shape[1]||0),(n0[2]||0)/a]);for(let n0 of Object.keys(ae))P.annotations[n0]=ae[n0].map(j0=>P.mesh[j0]);P.score=P.faceScore;let t0={...M3(P.mesh,p),confidence:p.confidence,landmarks:p.landmarks,size:p.size};P.box=xt(t0,e),P.boxRaw=yt(t0,e),P.size=t0.size,s.push(t0)}De.dispose(N)}P.score>(((T=t.face.detector)==null?void 0:T.minConfidence)||1)?r.push(P):De.dispose(P.tensor)}return ge.boxes=s,r}async function D3(e){var t,n,o,r,s,A;return R.initial&&(r0=null),(t=e.face.attention)!=null&&t.enabled&&(r0!=null&&r0.signature)&&Object.keys(((n=r0==null?void 0:r0.signature)==null?void 0:n.outputs)||{}).length<6&&(r0=null),r0?e.debug&&h("cached model:",r0.modelUrl):(o=e.face.attention)!=null&&o.enabled?r0=await O(e.face.attention.modelPath):r0=await O((r=e.face.mesh)==null?void 0:r.modelPath),W2=r0.executor&&((s=r0==null?void 0:r0.inputs)!=null&&s[0].shape)?(A=r0==null?void 0:r0.inputs)==null?void 0:A[0].shape[2]:256,r0}var F3=$e,B3=L2;var J0=G(H());var z5=[],P0,ht=[],H3=0,G3=0,E5=Number.MAX_SAFE_INTEGER,S5=!1;async function V3(e){var t,n,o;return R.initial&&(P0=null),P0?e.debug&&h("cached model:",P0.modelUrl):(P0=await O((t=e.face.emotion)==null?void 0:t.modelPath),S5=((o=(n=P0==null?void 0:P0.inputs)==null?void 0:n[0].shape)==null?void 0:o[3])===3,S5?z5=["angry","disgust","fear","happy","neutral","sad","surprise"]:z5=["angry","disgust","fear","happy","sad","surprise","neutral"]),P0}async function j5(e,t,n,o){var A,a;if(!P0)return[];let r=E5<(((A=t.face.emotion)==null?void 0:A.skipFrames)||0),s=(((a=t.face.emotion)==null?void 0:a.skipTime)||0)>v()-G3;return t.skipAllowed&&s&&r&&H3===o&&ht[n]&&ht[n].length>0?(E5++,ht[n]):(E5=0,new Promise(async l=>{var x,i,f;let c=[];if((x=t.face.emotion)!=null&&x.enabled){let d={},m=P0!=null&&P0.inputs[0].shape?P0.inputs[0].shape[2]:0;if(((i=t.face.emotion)==null?void 0:i.crop)>0){let u=(f=t.face.emotion)==null?void 0:f.crop,T=[[u,u,1-u,1-u]];d.resize=J0.image.cropAndResize(e,T,[0],[m,m])}else d.resize=J0.image.resizeBilinear(e,[m,m],!1);S5?(d.mul=J0.mul(d.resize,255),d.normalize=J0.sub(d.mul,[103.939,116.779,123.68]),d.emotion=P0==null?void 0:P0.execute(d.normalize)):(d.channels=J0.mul(d.resize,C.rgb),d.grayscale=J0.sum(d.channels,3,!0),d.grayscaleSub=J0.sub(d.grayscale,C.tf05),d.grayscaleMul=J0.mul(d.grayscaleSub,C.tf2),d.emotion=P0==null?void 0:P0.execute(d.grayscaleMul)),G3=v();let y=await d.emotion.data();for(let u=0;u(t.face.emotion.minConfidence||0)&&c.push({score:Math.min(.99,Math.trunc(100*y[u])/100),emotion:z5[u]});c.sort((u,T)=>T.score-u.score),Object.keys(d).forEach(u=>J0.dispose(d[u]))}ht[n]=c,H3=o,l(c)}))}var ie=G(H());var k0,Fe=[],q3=0,X3=0,I5=Number.MAX_SAFE_INTEGER;async function U3(e){var t;return R.initial&&(k0=null),k0?e.debug&&h("cached model:",k0.modelUrl):k0=await O((t=e.face.description)==null?void 0:t.modelPath),k0}function hA(e,t){var s,A;let n=e.image||e.tensor||e;if(!(k0!=null&&k0.inputs[0].shape))return n;let o;if(((s=t.face.description)==null?void 0:s.crop)>0){let a=(A=t.face.description)==null?void 0:A.crop,l=[[a,a,1-a,1-a]];o=ie.image.cropAndResize(n,l,[0],[k0.inputs[0].shape[2],k0.inputs[0].shape[1]])}else o=ie.image.resizeBilinear(n,[k0.inputs[0].shape[2],k0.inputs[0].shape[1]],!1);let r=ie.mul(o,C.tf255);return ie.dispose(o),r}async function N5(e,t,n,o){var a,l,c,x;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(k0!=null&&k0.executor))return r;let s=I5<(((a=t.face.description)==null?void 0:a.skipFrames)||0),A=(((l=t.face.description)==null?void 0:l.skipTime)||0)>v()-q3;return t.skipAllowed&&s&&A&&X3===o&&((c=Fe==null?void 0:Fe[n])==null?void 0:c.age)>0&&((x=Fe==null?void 0:Fe[n])==null?void 0:x.genderScore)>0?(I5++,Fe[n]):(I5=0,new Promise(async i=>{var f;if((f=t.face.description)!=null&&f.enabled){let d=hA(e,t),m=k0==null?void 0:k0.execute(d);q3=v(),ie.dispose(d);let u=await m.find(V=>V.shape[1]===1).data(),T=Math.trunc(200*Math.abs(u[0]-.5))/100;T>(t.face.description.minConfidence||0)&&(r.gender=u[0]<=.5?"female":"male",r.genderScore=Math.min(.99,T));let g=ie.argMax(m.find(V=>V.shape[1]===100),1),p=(await g.data())[0];ie.dispose(g);let k=await m.find(V=>V.shape[1]===100).data();r.age=Math.round(k[p-1]>k[p+1]?10*p-100*k[p-1]:10*p+100*k[p+1])/10,(Number.isNaN(u[0])||Number.isNaN(k[0]))&&h("faceres error:",{model:k0,result:m});let P=m.find(V=>V.shape[1]===1024),N=P?await P.data():[];r.descriptor=Array.from(N),m.forEach(V=>ie.dispose(V))}Fe[n]=r,X3=o,i(r)}))}var g2=.1,O5=.5;function bA(e,t,n){let o=!1,r=n.length-1;for(let s=0;st!=n[r].y>t&&e<(n[r].x-n[s].x)*(t-n[s].y)/(n[r].y-n[s].y)+n[s].x&&(o=!o);return o}async function K3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,o=await e.tensor.buffer(),r=[];for(let A of ae.silhouette)r.push({x:(e.mesh[A][0]-e.box[0])/e.box[2],y:(e.mesh[A][1]-e.box[1])/e.box[3]});g2&&g2>0&&(r=r.map(A=>({x:A.x>.5?A.x+g2:A.x-g2,y:A.y>.5?A.y+g2:A.y-g2})));for(let A=0;Av()-Q3,s=L5<(((a=t.face.antispoof)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&J3===o&&bt[n]?(L5++,bt[n]):(L5=0,new Promise(async l=>{let c=gt.image.resizeBilinear(e,[w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[2]:0,w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[1]:0],!1),x=w0==null?void 0:w0.execute(c),i=(await x.data())[0];bt[n]=Math.round(100*i)/100,J3=o,Q3=v(),gt.dispose([c,x]),l(bt[n])}))}var vt=G(H());var E0,Tt=[],W5=Number.MAX_SAFE_INTEGER,en=0,tn=0;async function nn(e){var t;return R.initial&&(E0=null),E0?e.debug&&h("cached model:",E0.modelUrl):E0=await O((t=e.face.liveness)==null?void 0:t.modelPath),E0}async function D5(e,t,n,o){var A,a;if(!(E0!=null&&E0.executor))return 0;let r=(((A=t.face.liveness)==null?void 0:A.skipTime)||0)>v()-tn,s=W5<(((a=t.face.liveness)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&en===o&&Tt[n]?(W5++,Tt[n]):(W5=0,new Promise(async l=>{let c=vt.image.resizeBilinear(e,[E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[2]:0,E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[1]:0],!1),x=E0==null?void 0:E0.execute(c),i=(await x.data())[0];Tt[n]=Math.round(100*i)/100,en=o,tn=v(),vt.dispose([c,x]),l(Tt[n])}))}var Rt=G(H());var le,F5=[],TA=["white","black","asian","indian","other"],vA=[15,23,28,35.5,45.5,55.5,65],rn=0,sn=0,B5=Number.MAX_SAFE_INTEGER;async function An(e){var t;return R.initial&&(le=null),le?e.debug&&h("cached model:",le.modelUrl):le=await O((t=e.face.gear)==null?void 0:t.modelPath),le}async function H5(e,t,n,o){var A,a;if(!le)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=B5<(((A=t.face.gear)==null?void 0:A.skipFrames)||0),s=(((a=t.face.gear)==null?void 0:a.skipTime)||0)>v()-sn;return t.skipAllowed&&s&&r&&rn===o&&F5[n]?(B5++,F5[n]):(B5=0,new Promise(async l=>{var T,g,p,b;if(!(le!=null&&le.inputs[0].shape))return;let c={},x=[[0,.1,.9,.9]];if(((T=t.face.gear)==null?void 0:T.crop)>0){let k=(g=t.face.gear)==null?void 0:g.crop;x=[[k,k,1-k,1-k]]}c.resize=Rt.image.cropAndResize(e,x,[0],[le.inputs[0].shape[2],le.inputs[0].shape[1]]);let i={age:0,gender:"unknown",genderScore:0,race:[]};(p=t.face.gear)!=null&&p.enabled&&([c.age,c.gender,c.race]=le.execute(c.resize,["age_output","gender_output","race_output"]));let f=await c.gender.data();i.gender=f[0]>f[1]?"male":"female",i.genderScore=Math.round(100*(f[0]>f[1]?f[0]:f[1]))/100;let d=await c.race.data();for(let k=0;k(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&i.race.push({score:Math.round(100*d[k])/100,race:TA[k]});i.race.sort((k,P)=>P.score-k.score);let y=Array.from(await c.age.data()).map((k,P)=>[vA[P],k]).sort((k,P)=>P[1]-k[1]),u=y[0][0];for(let k=1;kRt.dispose(c[k])),F5[n]=i,rn=o,sn=v(),l(i)}))}var s2=G(H());var H0,Mt=[],ln=0,cn=0,G5=Number.MAX_SAFE_INTEGER;async function dn(e){return R.initial&&(H0=null),H0?e.debug&&h("cached model:",H0.modelUrl):H0=await O(e.face.ssrnet.modelPathAge),H0}async function V5(e,t,n,o){var A,a,l,c;if(!H0)return{age:0};let r=G5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-cn;return t.skipAllowed&&r&&s&&ln===o&&((l=Mt[n])!=null&&l.age)&&((c=Mt[n])==null?void 0:c.age)>0?(G5++,Mt[n]):(G5=0,new Promise(async x=>{var d,m,y;if(!(H0!=null&&H0.inputs)||!H0.inputs[0]||!H0.inputs[0].shape)return;let i={};if(((d=t.face.ssrnet)==null?void 0:d.crop)>0){let u=(m=t.face.ssrnet)==null?void 0:m.crop,T=[[u,u,1-u,1-u]];i.resize=s2.image.cropAndResize(e,T,[0],[H0.inputs[0].shape[2],H0.inputs[0].shape[1]])}else i.resize=s2.image.resizeBilinear(e,[H0.inputs[0].shape[2],H0.inputs[0].shape[1]],!1);i.enhance=s2.mul(i.resize,C.tf255);let f={age:0};if((y=t.face.ssrnet)!=null&&y.enabled&&(i.age=H0.execute(i.enhance)),i.age){let u=await i.age.data();f.age=Math.trunc(10*u[0])/10}Object.keys(i).forEach(u=>s2.dispose(i[u])),Mt[n]=f,ln=o,cn=v(),x(f)}))}var v0=G(H());var N0,Pt=[],yn=0,fn=0,Z5=Number.MAX_SAFE_INTEGER,q5=[.2989,.587,.114];async function mn(e){var t;return R.initial&&(N0=null),N0?e.debug&&h("cached model:",N0.modelUrl):N0=await O((t=e.face.ssrnet)==null?void 0:t.modelPathGender),N0}async function X5(e,t,n,o){var A,a,l,c;if(!N0)return{gender:"unknown",genderScore:0};let r=Z5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-fn;return t.skipAllowed&&r&&s&&yn===o&&((l=Pt[n])!=null&&l.gender)&&((c=Pt[n])==null?void 0:c.genderScore)>0?(Z5++,Pt[n]):(Z5=0,new Promise(async x=>{var m,y,u;if(!(N0!=null&&N0.inputs[0].shape))return;let i={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let T=(y=t.face.ssrnet)==null?void 0:y.crop,g=[[T,T,1-T,1-T]];i.resize=v0.image.cropAndResize(e,g,[0],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]])}else i.resize=v0.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]],!1);i.enhance=v0.tidy(()=>{var g,p;let T;if(((p=(g=N0==null?void 0:N0.inputs)==null?void 0:g[0].shape)==null?void 0:p[3])===1){let[b,k,P]=v0.split(i.resize,3,3),N=v0.mul(b,q5[0]),V=v0.mul(k,q5[1]),_=v0.mul(P,q5[2]),Z=v0.addN([N,V,_]);T=v0.mul(v0.sub(Z,C.tf05),2)}else T=v0.mul(v0.sub(i.resize,C.tf05),2);return T});let f={gender:"unknown",genderScore:0};(u=t.face.ssrnet)!=null&&u.enabled&&(i.gender=N0.execute(i.enhance));let d=await i.gender.data();f.gender=d[0]>d[1]?"female":"male",f.genderScore=d[0]>d[1]?Math.trunc(100*d[0])/100:Math.trunc(100*d[1])/100,Object.keys(i).forEach(T=>v0.dispose(i[T])),Pt[n]=f,yn=o,fn=v(),x(f)}))}var kt=G(H());var Q0,U5=[],un=0,hn=0,bn=Number.MAX_SAFE_INTEGER;async function gn(e){var t;return R.initial&&(Q0=null),Q0?e.debug&&h("cached model:",Q0.modelUrl):Q0=await O((t=e.face.mobilefacenet)==null?void 0:t.modelPath),Q0}async function Y5(e,t,n,o){var A,a;if(!(Q0!=null&&Q0.executor))return[];let r=bn<(((A=t.face.mobilefacenet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.mobilefacenet)==null?void 0:a.skipTime)||0)>v()-hn;return t.skipAllowed&&s&&r&&un===o&&U5[n]?(bn++,U5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.mobilefacenet)!=null&&x.enabled&&(Q0!=null&&Q0.inputs[0].shape)){let i={};i.crop=kt.image.resizeBilinear(e,[Q0.inputs[0].shape[2],Q0.inputs[0].shape[1]],!1),i.data=Q0.execute(i.crop);let f=await i.data.data();c=Array.from(f),Object.keys(i).forEach(d=>kt.dispose(i[d]))}U5[n]=c,un=o,hn=v(),l(c)})}var wt=G(H());var _0,K5=[],vn=0,Rn=0,Mn=Number.MAX_SAFE_INTEGER;async function Pn(e){return R.initial&&(_0=null),_0?e.debug&&h("cached model:",_0.modelUrl):_0=await O(e.face.insightface.modelPath),_0}async function J5(e,t,n,o){var A,a;if(!(_0!=null&&_0.executor))return[];let r=Mn<(((A=t.face.insightface)==null?void 0:A.skipFrames)||0),s=(((a=t.face.insightface)==null?void 0:a.skipTime)||0)>v()-Rn;return t.skipAllowed&&s&&r&&vn===o&&K5[n]?(Mn++,K5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.insightface)!=null&&x.enabled&&(_0!=null&&_0.inputs[0].shape)){let i={};i.crop=wt.image.resizeBilinear(e,[_0.inputs[0].shape[2],_0.inputs[0].shape[1]],!1),i.data=_0.execute(i.crop);let f=await i.data.data();c=Array.from(f),Object.keys(i).forEach(d=>wt.dispose(i[d]))}K5[n]=c,vn=o,Rn=v(),l(c)})}var RA=e=>{let t=(i,f)=>Math.atan2(i[1]-f[1],i[0]-f[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],o=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],A=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],a=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(A[0]-s[0])/a[0]-n[0],o*(s[1]-A[1])/a[1]-n[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return c=Math.min(c,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:c}},wn=(e,t)=>{let n=y=>{let u=Math.sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);return y[0]/=u,y[1]/=u,y[2]/=u,y},o=(y,u)=>{let T=y[0]-u[0],g=y[1]-u[1],p=y[2]-u[2];return[T,g,p]},r=(y,u)=>{let T=y[1]*u[2]-y[2]*u[1],g=y[2]*u[0]-y[0]*u[2],p=y[0]*u[1]-y[1]*u[0];return[T,g,p]},s=y=>{let[u,T,g,p,b,k,P,N,V]=y,_,Z,$;return p<1?p>-1?($=Math.asin(p),Z=Math.atan2(-P,u),_=Math.atan2(-k,b)):($=-Math.PI/2,Z=-Math.atan2(N,V),_=0):($=Math.PI/2,Z=Math.atan2(N,V),_=0),Number.isNaN(_)&&(_=0),Number.isNaN(Z)&&(Z=0),Number.isNaN($)&&($=0),{pitch:2*-_,yaw:2*-Z,roll:2*-$}},A=e.meshRaw;if(!A||A.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let a=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[A[10],A[152],A[234],A[454]].map(y=>[y[0]*t[0]/a,y[1]*t[1]/a,y[2]]),c=n(o(l[1],l[0])),x=n(o(l[3],l[2])),i=n(r(x,c));x=r(c,i);let f=[x[0],x[1],x[2],c[0],c[1],c[2],i[0],i[1],i[2]],d=s(f),m=A.length===478?RA(e):{bearing:0,strength:0};return{angle:d,matrix:f,gaze:m}};function En(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let o=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/o)/100}var Q5=async(e,t)=>{var m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;let n=v(),o,r,s,A,a,l,c,x,i,f=[];e.state="run:face";let d=await W3(t,e.config);if(e.performance.face=R.perfadd?(e.performance.face||0)+Math.trunc(v()-n):Math.trunc(v()-n),!t.shape||t.shape.length!==4)return[];if(!d)return[];for(let E=0;E200?wn(d[E],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?A=(y=e.config.face.emotion)!=null&&y.enabled?j5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[]:(e.state="run:emotion",n=v(),A=(u=e.config.face.emotion)!=null&&u.enabled?await j5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[],e.performance.emotion=R.perfadd?(e.performance.emotion||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?c=(T=e.config.face.antispoof)!=null&&T.enabled?C5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:antispoof",n=v(),c=(g=e.config.face.antispoof)!=null&&g.enabled?await C5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.antispoof=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?x=(p=e.config.face.liveness)!=null&&p.enabled?D5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:liveness",n=v(),x=(b=e.config.face.liveness)!=null&&b.enabled?await D5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.liveness=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(k=e.config.face.gear)!=null&&k.enabled?H5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:gear",n=v(),r=(P=e.config.face.gear)!=null&&P.enabled?await H5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.gear=Math.trunc(v()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(o=(N=e.config.face.ssrnet)!=null&&N.enabled?V5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(V=e.config.face.ssrnet)!=null&&V.enabled?X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null):(e.state="run:ssrnet",n=v(),o=(_=e.config.face.ssrnet)!=null&&_.enabled?await V5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(Z=e.config.face.ssrnet)!=null&&Z.enabled?await X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.ssrnet=Math.trunc(v()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?a=($=e.config.face.mobilefacenet)!=null&&$.enabled?Y5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),a=(A0=e.config.face.mobilefacenet)!=null&&A0.enabled?await Y5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(t0=e.config.face.insightface)!=null&&t0.enabled?J5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),l=(n0=e.config.face.insightface)!=null&&n0.enabled?await J5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?i=N5(d[E].tensor||l0.tensor([]),e.config,E,d.length):(e.state="run:description",n=v(),i=await N5(d[E].tensor||l0.tensor([]),e.config,E,d.length),e.performance.description=R.perfadd?(e.performance.description||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Description:"),e.config.async&&([o,s,A,a,l,i,r,c,x]=await Promise.all([o,s,A,a,l,i,r,c,x])),e.analyze("Finish Face:"),(j0=e.config.face.ssrnet)!=null&&j0.enabled&&o&&s&&(i={...i,age:o.age,gender:s.gender,genderScore:s.genderScore}),(M=e.config.face.gear)!=null&&M.enabled&&r&&(i={...i,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(T0=e.config.face.mobilefacenet)!=null&&T0.enabled&&a&&(i.descriptor=a),(C0=e.config.face.insightface)!=null&&C0.enabled&&l&&(i.descriptor=l);let q=(x0=e.config.face.iris)!=null&&x0.enabled?En(d[E],t.shape[2]):0,U0=(K=e.config.face.detector)!=null&&K.return?l0.squeeze(d[E].tensor):null;l0.dispose(d[E].tensor),d[E].tensor&&delete d[E].tensor;let y0={...d[E],id:E};i.age&&(y0.age=i.age),i.gender&&(y0.gender=i.gender),i.genderScore&&(y0.genderScore=i.genderScore),i.descriptor&&(y0.embedding=i.descriptor),i.race&&(y0.race=i.race),A&&(y0.emotion=A),c&&(y0.real=c),x&&(y0.live=x),q>0&&(y0.distance=q),B&&(y0.rotation=B),U0&&(y0.tensor=U0),f.push(y0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),f};var G0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>G0.nameMapping[e],getPoints:e=>G0.pointsMapping[e]},He={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>He.nameMapping[e]},c0={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>c0.nameMapping[e]},Be=class{constructor(t){w(this,"name");w(this,"curls");w(this,"directions");w(this,"weights");w(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,o){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,o])}direction(t,n,o){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,o])}weight(t,n){this.weights[t]=n;let o=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/o)}matchAgainst(t,n){let o=0;for(let r in t){let s=t[r],A=this.curls[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}for(let r in n){let s=n[r],A=this.directions[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}return o/10}};var{thumb:fe,index:Pe,middle:ke,ring:A2,pinky:a2}=G0,{none:me,half:PA,full:pe}=He,{verticalUp:T2,verticalDown:Qi,horizontalLeft:_5,horizontalRight:kA,diagonalUpRight:wA,diagonalUpLeft:v2,diagonalDownRight:_i,diagonalDownLeft:$i}=c0,Ge=new Be("thumbs up");Ge.curl(fe,me,1);Ge.direction(fe,T2,1);Ge.direction(fe,v2,.25);Ge.direction(fe,wA,.25);for(let e of[G0.index,G0.middle,G0.ring,G0.pinky])Ge.curl(e,pe,1),Ge.direction(e,_5,1),Ge.direction(e,kA,1);var h0=new Be("victory");h0.curl(fe,PA,.5);h0.curl(fe,me,.5);h0.direction(fe,T2,1);h0.direction(fe,v2,1);h0.curl(Pe,me,1);h0.direction(Pe,T2,.75);h0.direction(Pe,v2,1);h0.curl(ke,me,1);h0.direction(ke,T2,1);h0.direction(ke,v2,.75);h0.curl(A2,pe,1);h0.direction(A2,T2,.2);h0.direction(A2,v2,1);h0.direction(A2,_5,.2);h0.curl(a2,pe,1);h0.direction(a2,T2,.2);h0.direction(a2,v2,1);h0.direction(a2,_5,.2);h0.weight(Pe,2);h0.weight(ke,2);var Ve=new Be("point");Ve.curl(fe,pe,1);Ve.curl(Pe,me,.5);Ve.curl(ke,pe,.5);Ve.curl(A2,pe,.5);Ve.curl(a2,pe,.5);Ve.weight(Pe,2);Ve.weight(ke,2);var Ze=new Be("middle finger");Ze.curl(fe,me,1);Ze.curl(Pe,pe,.5);Ze.curl(ke,pe,.5);Ze.curl(A2,pe,.5);Ze.curl(a2,pe,.5);Ze.weight(Pe,2);Ze.weight(ke,2);var R2=new Be("open palm");R2.curl(fe,me,.75);R2.curl(Pe,me,.75);R2.curl(ke,me,.75);R2.curl(A2,me,.75);R2.curl(a2,me,.75);var zn=[Ge,h0,Ve,Ze,R2];var EA=.7,i2={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function Sn(e,t,n,o){let r=(t-o)/(e-n),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function In(e,t){if(!e||!t)return[0,0];let n=Sn(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let o=Sn(e[1],e[2],t[1],t[2]);return[n,o]}function jn(e,t=1){let n=0,o=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?o=1*t:r=1*t,[n,o,r]}function zA(e,t,n){let o=e[0]-t[0],r=e[0]-n[0],s=t[0]-n[0],A=e[1]-t[1],a=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],x=e[2]-n[2],i=t[2]-n[2],f=Math.sqrt(o*o+A*A+c*c),d=Math.sqrt(r*r+a*a+x*x),m=Math.sqrt(s*s+l*l+i*i),y=(m*m+f*f-d*d)/(2*m*f);y>1?y=1:y<-1&&(y=-1);let u=Math.acos(y);u=57.2958*u%180;let T;return u>i2.NO_CURL_START_LIMIT?T=He.none:u>i2.HALF_CURL_START_LIMIT?T=He.half:T=He.full,T}function Nn(e,t,n,o){let r;return o===Math.abs(e)?e>0?r=c0.horizontalLeft:r=c0.horizontalRight:o===Math.abs(t)?t>0?r=c0.horizontalLeft:r=c0.horizontalRight:n>0?r=c0.horizontalLeft:r=c0.horizontalRight,r}function On(e,t,n,o){let r;return o===Math.abs(e)?e<0?r=c0.verticalDown:r=c0.verticalUp:o===Math.abs(t)?t<0?r=c0.verticalDown:r=c0.verticalUp:n<0?r=c0.verticalDown:r=c0.verticalUp,r}function SA(e,t,n,o,r,s,A,a){let l,c=On(e,t,n,o),x=Nn(r,s,A,a);return c===c0.verticalUp?x===c0.horizontalLeft?l=c0.diagonalUpLeft:l=c0.diagonalUpRight:x===c0.horizontalLeft?l=c0.diagonalDownLeft:l=c0.diagonalDownRight,l}function jA(e,t,n,o){let r=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],x=Math.max(Math.abs(r),Math.abs(s),Math.abs(A)),i=Math.max(Math.abs(a),Math.abs(l),Math.abs(c)),f=0,d=0,m=0,y=i/(x+1e-5);y>1.5?f+=i2.DISTANCE_VOTE_POWER:y>.66?d+=i2.DISTANCE_VOTE_POWER:m+=i2.DISTANCE_VOTE_POWER;let u=Math.sqrt(r*r+a*a),T=Math.sqrt(s*s+l*l),g=Math.sqrt(A*A+c*c),p=Math.max(u,T,g),b=e[0],k=e[1],P=n[0],N=n[1];p===u?(P=n[0],N=n[1]):p===g&&(b=t[0],k=t[1]);let Z=In([b,k],[P,N]),$=jn(Z,i2.TOTAL_ANGLE_VOTE_POWER);f+=$[0],d+=$[1],m+=$[2];for(let t0 of o){let n0=jn(t0,i2.SINGLE_ANGLE_VOTE_POWER);f+=n0[0],d+=n0[1],m+=n0[2]}let A0;return f===Math.max(f,d,m)?A0=On(l,a,c,i):m===Math.max(d,m)?A0=Nn(s,r,A,x):A0=SA(l,a,c,i,s,r,A,x),A0}function Ln(e){let t=[],n=[],o=[],r=[];if(!e)return{curls:o,directions:r};for(let s of G0.all){let A=G0.getPoints(s),a=[],l=[];for(let c of A){let x=e[c[0]],i=e[c[1]],f=In(x,i),d=f[0],m=f[1];a.push(d),l.push(m)}t.push(a),n.push(l)}for(let s of G0.all){let A=s===G0.thumb?1:0,a=G0.getPoints(s),l=e[a[A][0]],c=e[a[A+1][1]],x=e[a[3][1]],i=zA(l,c,x),f=jA(l,c,x,t[s].slice(A));o[s]=i,r[s]=f}return{curls:o,directions:r}}function Et(e){if(!e||e.length===0)return null;let t=Ln(e),n={};for(let o of G0.all)n[G0.getName(o)]={curl:He.getName(t.curls[o]),direction:c0.getName(t.directions[o])};return n}function Cn(e){let t=[];if(!e||e.length===0)return t;let n=Ln(e);for(let o of zn){let r=o.matchAgainst(n.curls,n.directions);r>=EA&&t.push({name:o.name,confidence:r})}return t}var Wn=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&&o&&r&&o.position[1]l.part==="leftShoulder"),a=e[n].keypoints.find(l=>l.part==="rightShoulder");A&&a&&Math.abs(A.positionRaw[1]-a.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${A.position[1]>a.position[1]?"left":"right"}`})}return t},Dn=e=>{if(!e)return[];let t=[];for(let n=0;n450){let o=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),r=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(o/r)<=.15?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${o<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 a=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]));a>10&&t.push({face:n,gesture:`mouth ${Math.trunc(a)}% open`});let l=e[n].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:n,gesture:`head ${l<0?"up":"down"}`})}return t},Fn=e=>{var n,o,r,s;if(!e)return[];let t=[];for(let A=0;A.06||u>.06)&&(d=!1),y>u?u>.04&&t.push({iris:A,gesture:"looking right"}):y>.04&&t.push({iris:A,gesture:"looking left"});let T=Math.abs(e[A].mesh[145][1]-e[A].annotations.rightEyeIris[0][1])/e[A].box[3],g=Math.abs(e[A].mesh[374][1]-e[A].annotations.leftEyeIris[0][1])/e[A].box[3];(g<.01||T<.01||g>.022||T>.022)&&(d=!1),(g<.01||T<.01)&&t.push({iris:A,gesture:"looking down"}),(g>.022||T>.022)&&t.push({iris:A,gesture:"looking up"}),d&&t.push({iris:A,gesture:"looking center"})}return t},Bn=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=o.reduce((A,a)=>(A.position[2]||0)<(a.position[2]||0)?A:a);t.push({hand:n,gesture:`${r.name} forward`});let s=o.reduce((A,a)=>A.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:o,palmLandmarks:r,confidence:e.confidence}}function St(e,t=1.5){let n=D2(e),o=zt(e),r=[t*o[0]/2,t*o[1]/2],s=[n[0]-r[0],n[1]-r[1]],A=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function jt(e){let t=D2(e),n=zt(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],A=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function NA(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Xn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return NA(n)}var Hn=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function qe(e,t){let n=0;for(let o=0;o[A.x,A.y]),this.anchorsTensor=W.tensor2d(this.anchors),this.inputSize=((s=(r=(o=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:o[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=W.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=W.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=W.slice(t,[0,0],[-1,2]),n.boxSizes=W.slice(t,[0,2],[-1,2]),n.div=W.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=W.add(n.div,this.anchorsTensor),n.halfBoxSizes=W.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=W.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=W.mul(n.sub,this.inputSizeTensor),n.add=W.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=W.mul(n.add,this.inputSizeTensor);let o=W.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>W.dispose(n[r])),o}normalizeLandmarks(t,n){let o={};o.reshape=W.reshape(t,[-1,7,2]),o.div=W.div(o.reshape,this.inputSizeTensor),o.landmarks=W.add(o.div,this.anchors[n]?this.anchors[n]:0);let r=W.mul(o.landmarks,this.inputSizeTensor);return Object.keys(o).forEach(s=>W.dispose(o[s])),r}async predict(t,n){var a;let o={};o.resize=W.image.resizeBilinear(t,[this.inputSize,this.inputSize]),o.div=W.div(o.resize,C.tf127),o.image=W.sub(o.div,C.tf1),o.batched=this.model.execute(o.image),o.predictions=W.squeeze(o.batched),o.slice=W.slice(o.predictions,[0,0],[-1,1]),o.sigmoid=W.sigmoid(o.slice),o.scores=W.squeeze(o.sigmoid);let r=await o.scores.data();o.boxes=W.slice(o.predictions,[0,1],[-1,4]),o.norm=this.normalizeBoxes(o.boxes),o.nms=await W.image.nonMaxSuppressionAsync(o.norm,o.scores,3*(((a=n.hand)==null?void 0:a.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let s=await o.nms.array(),A=[];for(let l of s){let c={};c.box=W.slice(o.norm,[l,0],[1,-1]),c.slice=W.slice(o.predictions,[l,5],[1,14]),c.norm=this.normalizeLandmarks(c.slice,l),c.palmLandmarks=W.reshape(c.norm,[-1,2]);let x=await c.box.data(),i=x.slice(0,2),f=x.slice(2,4),d=await c.palmLandmarks.array(),m={startPoint:i,endPoint:f,palmLandmarks:d,confidence:r[l]},y=qn(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);A.push(y),Object.keys(c).forEach(u=>W.dispose(c[u]))}return Object.keys(o).forEach(l=>W.dispose(o[l])),A}};var $0=G(H());var WA=5,Jn=1.65,Qn=[0,5,9,13,17,1,2],DA=0,FA=2,_n=0,Nt=class{constructor(t,n){w(this,"handDetector");w(this,"handPoseModel");w(this,"inputSize");w(this,"storedBoxes");w(this,"skipped");w(this,"detectedHands");var o,r,s;this.handDetector=t,this.handPoseModel=n,this.inputSize=((s=(r=(o=this.handPoseModel)==null?void 0:o.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(A=>A[0]),o=t.map(A=>A[1]),r=[Math.min(...n),Math.min(...o)],s=[Math.max(...n),Math.max(...o)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let o=t.map(s=>t1([...s,1],n)),r=this.calculateLandmarksBoundingBox(o);return St(jt(r),WA)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),o=St(jt(n),Jn);o.palmLandmarks=[];for(let r=0;r[A[0]*(d[0]-this.inputSize/2),A[1]*(d[1]-this.inputSize/2),A[2]*d[2]]),l=e1(o,[0,0]),c=a.map(d=>[...t1(d,l),d[2]]),x=Un(r),i=[...D2(n),1],f=[qe(i,x[0]),qe(i,x[1])];return c.map(d=>[Math.trunc(d[0]+f[0]),Math.trunc(d[1]+f[1]),Math.trunc(d[2])])}async estimateHands(t,n){let o=!1,r,s=(n.hand.skipTime||0)>v()-_n,A=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&s&&A?this.skipped++:(r=await this.handDetector.predict(t,n),this.skipped=0),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&&(o=!0));let a=[];for(let l=0;l=n.hand.minConfidence/4){let k=$0.reshape(p,[-1,3]),P=await k.array();$0.dispose(p),$0.dispose(k);let N=this.transformRawCoords(P,y,x,m),V=this.getBoxForHandLandmarks(N);this.storedBoxes[l]={...V,confidence:b};let _={landmarks:N,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:V.startPoint,bottomRight:V.endPoint}};a.push(_)}else this.storedBoxes[l]=null;$0.dispose(p)}else{let x=St(jt(c),Jn),i={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:x.startPoint,bottomRight:x.endPoint},landmarks:[]};a.push(i)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=a.length,a.length>n.hand.maxDetected&&(a.length=n.hand.maxDetected),a}};var $n={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},l2,c2,n1;function HA(){let e=l2?new It(l2):void 0;e&&c2&&(n1=new Nt(e,c2))}async function o1(e,t){n1||HA();let n=await n1.estimateHands(e,t);if(!n)return[];let o=[];for(let r=0;rn[r].landmarks[i]);let A=n[r].landmarks,a=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(A&&A.length>0){for(let x of A)x[0]a[2]&&(a[2]=x[0]),x[1]>a[3]&&(a[3]=x[1]);a[2]-=a[0],a[3]-=a[1],l=[a[0]/(e.shape[2]||0),a[1]/(e.shape[1]||0),a[2]/(e.shape[2]||0),a[3]/(e.shape[1]||0)]}else a=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=Et(A);o.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:a,boxRaw:l,keypoints:A,annotations:s,landmarks:c})}return o}async function eo(e){var t;return R.initial&&(l2=null),l2?e.debug&&h("cached model:",l2.modelUrl):l2=await O((t=e.hand.detector)==null?void 0:t.modelPath),l2}async function to(e){var t;return R.initial&&(c2=null),c2?e.debug&&h("cached model:",c2.modelUrl):c2=await O((t=e.hand.skeleton)==null?void 0:t.modelPath),c2}var Q=G(H());var p0=[null,null],GA=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],Xe=[[0,0],[0,0]],VA=["hand","fist","pinch","point","face","tip","pinchtip"],oo=4,ro=1.6,ZA=512,qA=1.4,Ot=Number.MAX_SAFE_INTEGER,r1=0,we=[0,0],m0={boxes:[],hands:[]},so={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function Ao(e){var t;if(R.initial&&(p0[0]=null),p0[0])e.debug&&h("cached model:",p0[0].modelUrl);else{_2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),p0[0]=await O((t=e.hand.detector)==null?void 0:t.modelPath);let n=p0[0].executor?Object.values(p0[0].modelSignature.inputs):void 0;Xe[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,Xe[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[0]}async function ao(e){var t;if(R.initial&&(p0[1]=null),p0[1])e.debug&&h("cached model:",p0[1].modelUrl);else{p0[1]=await O((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=p0[1].executor?Object.values(p0[1].modelSignature.inputs):void 0;Xe[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,Xe[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[1]}async function XA(e,t){let n=[];if(!e||!p0[0])return n;let o={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,ZA),A=Math.round(s*r/8)*8;o.resize=Q.image.resizeBilinear(e,[s,A]),o.cast=Q.cast(o.resize,"int32"),[o.rawScores,o.rawBoxes]=await p0[0].executeAsync(o.cast,GA),o.boxes=Q.squeeze(o.rawBoxes,[0,2]),o.scores=Q.squeeze(o.rawScores,[0]);let a=Q.unstack(o.scores,1);Q.dispose(a[oo]),a.splice(oo,1),o.filtered=Q.stack(a,1),Q.dispose(a),o.max=Q.max(o.filtered,1),o.argmax=Q.argMax(o.filtered,1);let l=0;o.nms=await Q.image.nonMaxSuppressionAsync(o.boxes,o.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let c=await o.nms.data(),x=await o.max.data(),i=await o.argmax.data();for(let f of Array.from(c)){let d=Q.slice(o.boxes,f,1),m=await d.data();Q.dispose(d);let y=[m[1],m[0],m[3]-m[1],m[2]-m[0]],u=at(y,qA),T=[Math.trunc(y[0]*we[0]),Math.trunc(y[1]*we[1]),Math.trunc(y[2]*we[0]),Math.trunc(y[3]*we[1])],g=x[f],p=VA[i[f]],b={id:l++,score:g,box:T,boxRaw:u,label:p};n.push(b)}return Object.keys(o).forEach(f=>Q.dispose(o[f])),n.sort((f,d)=>d.score-f.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function s1(e,t,n){let o={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&p0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=Q.image.cropAndResize(e,[s],[0],[Xe[1][0],Xe[1][1]],"bilinear"),r.div=Q.div(r.crop,C.tf255),[r.score,r.keypoints]=p0[1].execute(r.div,["Identity_1","Identity"]);let A=(await r.score.data())[0],a=(100-Math.trunc(100/(1+Math.exp(A))))/100;if(a>=(n.hand.minConfidence||0)){o.fingerScore=a,r.reshaped=Q.reshape(r.keypoints,[-1,3]);let x=(await r.reshaped.array()).map(i=>[i[0]/Xe[1][1],i[1]/Xe[1][0],i[2]||0]).map(i=>[i[0]*t.boxRaw[2],i[1]*t.boxRaw[3],i[2]||0]);o.keypoints=x.map(i=>[we[0]*(i[0]+t.boxRaw[0]),we[1]*(i[1]+t.boxRaw[1]),i[2]||0]),o.landmarks=Et(o.keypoints);for(let i of Object.keys(so))o.annotations[i]=so[i].map(f=>o.landmarks&&o.keypoints[f]?o.keypoints[f]:null)}Object.keys(r).forEach(l=>Q.dispose(r[l]))}return o}async function A1(e,t){var r,s;if(!((r=p0[0])!=null&&r.executor)||!((s=p0[1])!=null&&s.executor)||!p0[0].inputs[0].shape||!p0[1].inputs[0].shape)return[];we=[e.shape[2]||0,e.shape[1]||0],Ot++;let n=(t.hand.skipTime||0)>v()-r1,o=Ot<(t.hand.skipFrames||0);return t.skipAllowed&&n&&o?m0.hands:new Promise(async A=>{let a=3*(t.hand.skipTime||0)>v()-r1,l=Ot<3*(t.hand.skipFrames||0);t.skipAllowed&&m0.hands.length===t.hand.maxDetected?m0.hands=await Promise.all(m0.boxes.map(x=>s1(e,x,t))):t.skipAllowed&&a&&l&&m0.hands.length>0?m0.hands=await Promise.all(m0.boxes.map(x=>s1(e,x,t))):(m0.boxes=await XA(e,t),r1=v(),m0.hands=await Promise.all(m0.boxes.map(x=>s1(e,x,t))),Ot=0);let c=[...m0.boxes];if(m0.boxes.length=0,t.cacheSensitivity>0)for(let x=0;x.05&&i.box[3]/(e.shape[1]||1)>.05&&m0.hands[x].fingerScore&&m0.hands[x].fingerScore>(t.hand.minConfidence||0)){let f=at(i.box,ro),d=at(i.boxRaw,ro);m0.boxes.push({...c[x],box:f,boxRaw:d})}}for(let x=0;x({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var F2={};ze(F2,{connected:()=>Ct,horizontal:()=>a1,kpt:()=>Lt,relative:()=>l1,vertical:()=>i1});var Lt=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],a1=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],i1=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],l1=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],Ct={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var z=Te(),c1=0;function lo(e,t){var A,a,l,c,x,i,f,d,m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0;let n=v();if(!e)return Te();let o=Date.now()-e.timestamp,r=o<1e3?8-Math.log(o+1):1;if(e.canvas&&(z.canvas=e.canvas),e.error&&(z.error=e.error),!z.body||e.body.length!==z.body.length)z.body=JSON.parse(JSON.stringify(e.body));else for(let M=0;M((r-1)*z.body[M].box[q]+B)/r),C0=e.body[M].boxRaw.map((B,q)=>((r-1)*z.body[M].boxRaw[q]+B)/r),x0=e.body[M].keypoints.map((B,q)=>{var U0,y0,Ee,k2,x2,z1,S1,j1,I1;return{score:B.score,part:B.part,position:[z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].position[0]||0)+(B.position[0]||0))/r:B.position[0],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].position[1]||0)+(B.position[1]||0))/r:B.position[1],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].position[2]||0)+(B.position[2]||0))/r:B.position[2]],positionRaw:[z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].positionRaw[0]||0)+(B.positionRaw[0]||0))/r:B.positionRaw[0],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].positionRaw[1]||0)+(B.positionRaw[1]||0))/r:B.positionRaw[1],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].positionRaw[2]||0)+(B.positionRaw[2]||0))/r:B.positionRaw[2]],distance:[z.body[M].keypoints[q]?((r-1)*(((U0=z.body[M].keypoints[q].distance)==null?void 0:U0[0])||0)+(((y0=B.distance)==null?void 0:y0[0])||0))/r:(Ee=B.distance)==null?void 0:Ee[0],z.body[M].keypoints[q]?((r-1)*(((k2=z.body[M].keypoints[q].distance)==null?void 0:k2[1])||0)+(((x2=B.distance)==null?void 0:x2[1])||0))/r:(z1=B.distance)==null?void 0:z1[1],z.body[M].keypoints[q]?((r-1)*(((S1=z.body[M].keypoints[q].distance)==null?void 0:S1[2])||0)+(((j1=B.distance)==null?void 0:j1[2])||0))/r:(I1=B.distance)==null?void 0:I1[2]]}}),K={},E={connected:{}};(A=t.body.modelPath)!=null&&A.includes("efficientpose")?E=ct:(a=t.body.modelPath)!=null&&a.includes("blazepose")?E=st:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(E=F2);for(let[B,q]of Object.entries(E.connected)){let U0=[];for(let y0=0;y0x2.part===q[y0]),k2=x0.find(x2=>x2.part===q[y0+1]);Ee&&k2&&U0.push([Ee.position,k2.position])}K[B]=U0}z.body[M]={...e.body[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.hand||e.hand.length!==z.hand.length)z.hand=JSON.parse(JSON.stringify(e.hand));else for(let M=0;M((r-1)*z.hand[M].box[B]+E)/r),C0=e.hand[M].boxRaw.map((E,B)=>((r-1)*z.hand[M].boxRaw[B]+E)/r);z.hand[M].keypoints.length!==e.hand[M].keypoints.length&&(z.hand[M].keypoints=e.hand[M].keypoints);let x0=e.hand[M].keypoints&&e.hand[M].keypoints.length>0?e.hand[M].keypoints.map((E,B)=>E.map((q,U0)=>((r-1)*(z.hand[M].keypoints[B][U0]||1)+(q||0))/r)):[],K={};if(Object.keys(z.hand[M].annotations).length!==Object.keys(e.hand[M].annotations).length)z.hand[M].annotations=e.hand[M].annotations,K=z.hand[M].annotations;else if(e.hand[M].annotations)for(let E of Object.keys(e.hand[M].annotations))K[E]=(i=(x=(c=e.hand[M])==null?void 0:c.annotations)==null?void 0:x[E])!=null&&i[0]?e.hand[M].annotations[E].map((B,q)=>B.map((U0,y0)=>((r-1)*z.hand[M].annotations[E][q][y0]+U0)/r)):null;z.hand[M]={...e.hand[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.face||e.face.length!==z.face.length)z.face=JSON.parse(JSON.stringify(e.face));else for(let M=0;M((r-1)*z.face[M].box[E]+K)/r),C0=e.face[M].boxRaw.map((K,E)=>((r-1)*z.face[M].boxRaw[E]+K)/r),x0=e.face[M].annotations;if(Object.keys(z.face[M].annotations).length!==Object.keys(e.face[M].annotations).length)z.face[M].annotations=e.face[M].annotations,x0=z.face[M].annotations;else if(e.face[M].annotations)for(let K of Object.keys(e.face[M].annotations))x0[K]=(m=(d=(f=e.face[M])==null?void 0:f.annotations)==null?void 0:d[K])!=null&&m[0]?e.face[M].annotations[K].map((E,B)=>E.map((q,U0)=>((r-1)*z.face[M].annotations[K][B][U0]+q)/r)):null;if(e.face[M].rotation){let K={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};K.matrix=(y=e.face[M].rotation)==null?void 0:y.matrix,K.angle={roll:((r-1)*(((T=(u=z.face[M].rotation)==null?void 0:u.angle)==null?void 0:T.roll)||0)+(((p=(g=e.face[M].rotation)==null?void 0:g.angle)==null?void 0:p.roll)||0))/r,yaw:((r-1)*(((k=(b=z.face[M].rotation)==null?void 0:b.angle)==null?void 0:k.yaw)||0)+(((N=(P=e.face[M].rotation)==null?void 0:P.angle)==null?void 0:N.yaw)||0))/r,pitch:((r-1)*(((_=(V=z.face[M].rotation)==null?void 0:V.angle)==null?void 0:_.pitch)||0)+((($=(Z=e.face[M].rotation)==null?void 0:Z.angle)==null?void 0:$.pitch)||0))/r},K.gaze={bearing:((r-1)*(((A0=z.face[M].rotation)==null?void 0:A0.gaze.bearing)||0)+(((t0=e.face[M].rotation)==null?void 0:t0.gaze.bearing)||0))/r,strength:((r-1)*(((n0=z.face[M].rotation)==null?void 0:n0.gaze.strength)||0)+(((j0=e.face[M].rotation)==null?void 0:j0.gaze.strength)||0))/r},z.face[M]={...e.face[M],rotation:K,box:T0,boxRaw:C0,annotations:x0}}else z.face[M]={...e.face[M],box:T0,boxRaw:C0,annotations:x0}}if(!z.object||e.object.length!==z.object.length)z.object=JSON.parse(JSON.stringify(e.object));else for(let M=0;M((r-1)*z.object[M].box[K]+x0)/r),C0=e.object[M].boxRaw.map((x0,K)=>((r-1)*z.object[M].boxRaw[K]+x0)/r);z.object[M]={...e.object[M],box:T0,boxRaw:C0}}if(e.persons){let M=e.persons;if(!z.persons||M.length!==z.persons.length)z.persons=JSON.parse(JSON.stringify(M));else for(let T0=0;T0((r-1)*z.persons[T0].box[x0]+C0)/r)}e.gesture&&(z.gesture=e.gesture),z.width=e.width,z.height=e.height;let s=v();return c1=R.perfadd?c1+Math.round(s-n):Math.round(s-n),e.performance&&(z.performance={...e.performance,interpolate:c1}),z}var s0=G(H());var O0;async function d1(e){return!O0||R.initial?O0=await O(e.segmentation.modelPath):e.debug&&h("cached model:",O0.modelUrl),O0}async function co(e,t){var r;if(O0||(O0=await d1(t)),!(O0!=null&&O0.executor)||!((r=O0==null?void 0:O0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=s0.image.resizeBilinear(e,[O0.inputs[0].shape?O0.inputs[0].shape[1]:0,O0.inputs[0].shape?O0.inputs[0].shape[2]:0],!1),n.norm=s0.div(n.resize,C.tf255),n.res=O0.execute(n.norm),n.squeeze=s0.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=s0.unstack(n.squeeze,2),n.fg=s0.softmax(n.fgRaw),n.mul=s0.mul(n.fg,C.tf255),n.expand=s0.expandDims(n.mul,2),n.output=s0.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let o;switch(t.segmentation.mode||"default"){case"default":n.input=s0.squeeze(e),n.concat=s0.concat([n.input,n.output],-1),o=s0.cast(n.concat,"int32");break;case"alpha":o=s0.cast(n.output,"int32");break;default:o=s0.tensor(0)}return Object.keys(n).forEach(s=>s0.dispose(n[s])),o}var Wt={};ze(Wt,{distance:()=>x1,find:()=>KA,similarity:()=>YA});function x1(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let o=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(o-n);return Math.max(Math.min(s,1),0)};function YA(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let o=x1(e,t,n);return yo(o,n.order||2,n.min||0,n.max||1)}function KA(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let o=Number.MAX_SAFE_INTEGER,r=-1;for(let A=0;AV2,validateModel:()=>Zt});var B2=G(H());var Ue=G(H());var fo=.005,ee={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function y1(e){for(let t of a1){let n=e.keypoints.findIndex(r=>r.part===t[0]),o=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[0]r&&r.part===t[0]),o=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),s=e.keypoints.findIndex(c=>c&&c.part===n[0]),A=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[s]||!e.keypoints[A])continue;let a=e.keypoints[o]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[o].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[o].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(a[0]>a[1]||l[0]>l[1]){let c=e.keypoints[o];e.keypoints[o]=e.keypoints[r],e.keypoints[r]=c}}}function mo(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Ue.pad(e,ee.padding),n.resize=Ue.image.resizeBilinear(n.pad,[t,t]);let o=Ue.cast(n.resize,"int32");return Object.keys(n).forEach(A=>Ue.dispose(n[A])),o}function uo(e,t){e.keypoints=e.keypoints.filter(o=>o==null?void 0:o.position);for(let o of e.keypoints)o.position=[o.position[0]*(t[0]+ee.padding[2][0]+ee.padding[2][1])/t[0]-ee.padding[2][0],o.position[1]*(t[1]+ee.padding[1][0]+ee.padding[1][1])/t[1]-ee.padding[1][0]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1]];let n=Oe(e.keypoints.map(o=>o.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var b0,Dt=0,f1=Number.MAX_SAFE_INTEGER,d2={boxes:[],bodies:[],last:0};async function ho(e){var t;return R.initial&&(b0=null),b0?e.debug&&h("cached model:",b0.modelUrl):(_2(["size"],e),b0=await O(e.body.modelPath)),Dt=b0!=null&&b0.executor&&((t=b0==null?void 0:b0.inputs)!=null&&t[0].shape)?b0.inputs[0].shape[2]:0,Dt<64&&(Dt=256),B2.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&B2.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),b0}function QA(e,t,n){let o=e[0][0],r=[],s=0;for(let x=0;xt.body.minConfidence){let i=[o[x][1],o[x][0]];r.push({score:Math.round(100*s)/100,part:Lt[x],positionRaw:i,position:[Math.round((n.shape[2]||0)*i[0]),Math.round((n.shape[1]||0)*i[1])]})}s=r.reduce((x,i)=>i.score>x?i.score:x,0);let A=[],a=Oe(r.map(x=>x.position),[n.shape[2],n.shape[1]]),l={};for(let[x,i]of Object.entries(Ct)){let f=[];for(let d=0;du.part===i[d]),y=r.find(u=>u.part===i[d+1]);m&&y&&m.score>(t.body.minConfidence||0)&&y.score>(t.body.minConfidence||0)&&f.push([m.position,y.position])}l[x]=f}let c={id:0,score:s,box:a.box,boxRaw:a.boxRaw,keypoints:r,annotations:l};return y1(c),A.push(c),A}function _A(e,t,n){let o=[];for(let r=0;rt.body.minConfidence){let a=[];for(let f=0;f<17;f++){let d=s[3*f+2];if(d>t.body.minConfidence){let m=[s[3*f+1],s[3*f+0]];a.push({part:Lt[f],score:Math.round(100*d)/100,positionRaw:m,position:[Math.round((n.shape[2]||0)*m[0]),Math.round((n.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],c=[Math.trunc(l[0]*(n.shape[2]||0)),Math.trunc(l[1]*(n.shape[1]||0)),Math.trunc(l[2]*(n.shape[2]||0)),Math.trunc(l[3]*(n.shape[1]||0))],x={};for(let[f,d]of Object.entries(Ct)){let m=[];for(let y=0;yg.part===d[y]),T=a.find(g=>g.part===d[y+1]);u&&T&&u.score>(t.body.minConfidence||0)&&T.score>(t.body.minConfidence||0)&&m.push([u.position,T.position])}x[f]=m}let i={id:r,score:A,box:c,boxRaw:l,keypoints:[...a],annotations:x};y1(i),o.push(i)}}return o.sort((r,s)=>s.score-r.score),o.length>t.body.maxDetected&&(o.length=t.body.maxDetected),o}async function m1(e,t){var r;if(!(b0!=null&&b0.executor)||!((r=b0==null?void 0:b0.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(d2.boxes.length=0),f1++;let n=(t.body.skipTime||0)>v()-d2.last,o=f1<(t.body.skipFrames||0);return t.skipAllowed&&n&&o?d2.bodies:new Promise(async s=>{let A={};f1=0,A.input=po(e,Dt),A.res=b0==null?void 0:b0.execute(A.input),d2.last=v();let a=await A.res.array();d2.bodies=A.res.shape[2]===17?QA(a,t,e):_A(a,t,e);for(let l of d2.bodies)uo(l,[e.shape[2]||1,e.shape[1]||1]),mo(l.keypoints);Object.keys(A).forEach(l=>B2.dispose(A[l])),s(d2.bodies)})}var S0=G(H());var ce,Ft=[],go=0,p1=Number.MAX_SAFE_INTEGER,Ht=0,Bt=2.5;async function To(e){if(!ce||R.initial){ce=await O(e.object.modelPath);let t=ce!=null&&ce.executor?Object.values(ce.modelSignature.inputs):void 0;Ht=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&h("cached model:",ce.modelUrl);return ce}async function $A(e,t,n){var c,x;let o=0,r=[],s=Ht;for(let i of[1,2,4]){let f=i*13,d=S0.squeeze(e.find(p=>p.shape[1]===f**2&&(p.shape[2]||0)===m2.length)),m=await d.array(),y=S0.squeeze(e.find(p=>p.shape[1]===f**2&&(p.shape[2]||0)(n.object.minConfidence||0)&&b!==61){let P=(.5+Math.trunc(p%f))/f,N=(.5+Math.trunc(p/f))/f,V=g[p].map(M=>M*(f/i/s)),[_,Z]=[P-Bt/i*V[0],N-Bt/i*V[1]],[$,A0]=[P+Bt/i*V[2]-_,N+Bt/i*V[3]-Z],t0=[_,Z,$,A0];t0=t0.map(M=>Math.max(0,Math.min(M,1)));let n0=[t0[0]*t[0],t0[1]*t[1],t0[2]*t[0],t0[3]*t[1]],j0={id:o++,score:Math.round(100*k)/100,class:b+1,label:m2[b].label,box:n0.map(M=>Math.trunc(M)),boxRaw:t0};r.push(j0)}}S0.dispose([d,y,u,T])}let A=r.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),a=r.map(i=>i.score),l=[];if(A&&A.length>0){let i=await S0.image.nonMaxSuppressionAsync(A,a,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);l=Array.from(await i.data()),S0.dispose(i)}return r=r.filter((i,f)=>l.includes(f)).sort((i,f)=>f.score-i.score),r}async function u1(e,t){if(!(ce!=null&&ce.executor))return[];let n=(t.object.skipTime||0)>v()-go,o=p1<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&Ft.length>0?(p1++,Ft):(p1=0,!R.kernels.includes("mod")||!R.kernels.includes("sparsetodense")?Ft:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=S0.image.resizeBilinear(e,[Ht,Ht],!1),a=S0.div(A,C.tf255),l=S0.transpose(a,[0,3,1,2]),c;t.object.enabled&&(c=ce.execute(l)),go=v();let x=await $A(c,s,t);Ft=x,S0.dispose([A,a,l,...c]),r(x)}))}var V0=G(H());var G2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],ea=G2.length,H2=G2.reduce((e,t,n)=>(e[t]=n,e),{}),ta=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],q7=ta.map(([e,t])=>[H2[e],H2[t]]),Ro=[["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 Mo(e){let t=e.reduce(({maxX:n,maxY:o,minX:r,minY:s},{position:{x:A,y:a}})=>({maxX:Math.max(n,A),maxY:Math.max(o,a),minX:Math.min(r,A),minY:Math.min(s,a)}),{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 Po(e,[t,n],[o,r]){let s=t/o,A=n/r,a=(c,x)=>({id:x,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/o,c.box[2]/r,c.box[3]/o],box:[Math.trunc(c.box[0]*A),Math.trunc(c.box[1]*s),Math.trunc(c.box[2]*A),Math.trunc(c.box[3]*s)],keypoints:c.keypoints.map(({score:i,part:f,position:d})=>({score:i,part:f,position:[Math.trunc(d.x*A),Math.trunc(d.y*s)],positionRaw:[d.x/o,d.y/o]})),annotations:{}});return e.map((c,x)=>a(c,x))}var Gt=class{constructor(t,n){w(this,"priorityQueue");w(this,"numberOfElements");w(this,"getElementValue");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 ko(e,t,n,o){let r=n-e,s=o-t;return r*r+s*s}function T1(e,t){return{x:e.x+t.x,y:e.y+t.y}}var te,oa=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],Vt=1,M2=16,ra=50**2;function wo(e,t,n,o,r,s,A=2){let a=T=>({y:s.get(T.y,T.x,e),x:s.get(T.y,T.x,s.shape[2]/2+e)}),l=(T,g,p)=>({y:g1(Math.round(T.y/M2),0,g-1),x:g1(Math.round(T.x/M2),0,p-1)}),[c,x]=o.shape,i=l(t.position,c,x),f=a(i),m=T1(t.position,f);for(let T=0;T[H2[f],H2[d]]),A=s.map(([,f])=>f),a=s.map(([f])=>f),l=t.shape[2],c=A.length,x=new Array(l),i=b1(e.part,M2,n);x[e.part.id]={score:e.score,part:G2[e.part.id],position:i};for(let f=c-1;f>=0;--f){let d=A[f],m=a[f];x[d]&&!x[m]&&(x[m]=wo(f,x[d],m,t,n,r))}for(let f=0;ft){a=!1;break}if(!a)break}return a}function aa(e,t){let[n,o,r]=t.shape,s=new Gt(n*o*r,({score:A})=>A);for(let A=0;A{var A;let s=(A=r[o])==null?void 0:A.position;return s?ko(n,t,s.y,s.x)<=ra:!1})}function ia(e,t){return t.reduce((o,{position:r,score:s},A)=>(Eo(e,r,A)||(o+=s),o),0)/t.length}function la(e,t,n,o,r,s){let A=[],a=aa(s,t);for(;A.lengthd.score>s);let i=ia(A,x),f=Mo(x);i>s&&A.push({keypoints:x,box:f,score:Math.round(100*i)/100})}return A}async function v1(e,t){if(!(te!=null&&te.executor))return[];let n=V0.tidy(()=>{if(!te.inputs[0].shape)return[];let A=V0.image.resizeBilinear(e,[te.inputs[0].shape[2],te.inputs[0].shape[1]]),a=V0.sub(V0.div(V0.cast(A,"float32"),127.5),1),c=te.execute(a,oa).map(x=>V0.squeeze(x,[0]));return c[1]=V0.sigmoid(c[1]),c}),o=await Promise.all(n.map(A=>A.buffer()));for(let A of n)V0.dispose(A);let r=la(o[0],o[1],o[2],o[3],t.body.maxDetected,t.body.minConfidence);return te.inputs[0].shape?Po(r,[e.shape[1],e.shape[2]],[te.inputs[0].shape[2],te.inputs[0].shape[1]]):[]}async function zo(e){return!te||R.initial?te=await O(e.body.modelPath):e.debug&&h("cached model:",te.modelUrl),te}var F=G(H());var ve,ca=["fgr","pha","r1o","r2o","r3o","r4o"],g0={},M1=0;function Io(e){F.dispose([g0.r1i,g0.r2i,g0.r3i,g0.r4i,g0.downsample_ratio]),g0.r1i=F.tensor(0),g0.r2i=F.tensor(0),g0.r3i=F.tensor(0),g0.r4i=F.tensor(0),M1=e.segmentation.ratio||.5,g0.downsample_ratio=F.tensor(M1)}async function P1(e){return!ve||R.initial?ve=await O(e.segmentation.modelPath):e.debug&&h("cached model:",ve.modelUrl),Io(e),ve}var jo=e=>F.tidy(()=>{let t=F.squeeze(e,[0]),n=F.mul(t,C.tf255);return F.cast(n,"int32")});function R1(e,t){let n=e?jo(e):F.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),o=t?jo(t):F.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=F.concat([n,o],-1);return F.dispose([n,o]),r}function da(e){return F.tidy(()=>{let t={};return t.unstack=F.unstack(e,-1),t.concat=F.concat(t.unstack,1),t.split=F.split(t.concat,4,1),t.stack=F.concat(t.split,2),t.squeeze=F.squeeze(t.stack,[0]),t.expand=F.expandDims(t.squeeze,-1),t.add=F.add(t.expand,1),t.mul=F.mul(t.add,127.5),t.cast=F.cast(t.mul,"int32"),t.tile=F.tile(t.cast,[1,1,3]),t.alpha=F.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),F.concat([t.tile,t.alpha],-1)})}async function No(e,t){if(ve||(ve=await P1(t)),!(ve!=null&&ve.executor))return null;g0.src=F.div(e,255),M1!==t.segmentation.ratio&&Io(t);let[n,o,r,s,A,a]=await ve.executeAsync(g0,ca),l;switch(t.segmentation.mode||"default"){case"default":l=R1(n,o);break;case"alpha":l=R1(null,o);break;case"foreground":l=R1(n,null);break;case"state":l=da(r);break;default:l=F.tensor(0)}return F.dispose([g0.src,n,o,g0.r1i,g0.r2i,g0.r3i,g0.r4i]),[g0.r1i,g0.r2i,g0.r3i,g0.r4i]=[r,s,A,a],l}var z0=G(H());var L0;async function k1(e){return!L0||R.initial?L0=await O(e.segmentation.modelPath):e.debug&&h("cached model:",L0.modelUrl),L0}async function Lo(e,t){var r;if(L0||(L0=await k1(t)),!(L0!=null&&L0.executor)||!((r=L0==null?void 0:L0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=z0.image.resizeBilinear(e,[L0.inputs[0].shape?L0.inputs[0].shape[1]:0,L0.inputs[0].shape?L0.inputs[0].shape[2]:0],!1),n.norm=z0.div(n.resize,C.tf255),n.res=L0.execute(n.norm),n.squeeze=z0.squeeze(n.res,[0]),n.alpha=z0.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=z0.mul(n.alpha,C.tf255);let o;switch(t.segmentation.mode||"default"){case"default":n.input=z0.squeeze(e),n.concat=z0.concat([n.input,n.mul],-1),o=z0.cast(n.concat,"int32");break;case"alpha":o=z0.cast(n.mul,"int32");break;default:o=z0.tensor(0)}return Object.keys(n).forEach(s=>z0.dispose(n[s])),o}function Zt(e,t,n){var c,x;if(!t||!((c=e==null?void 0:e.config)!=null&&c.validateModels))return null;let o=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],A=[],a=t.modelUrl,l=t.executor;if((x=l==null?void 0:l.graph)!=null&&x.nodes)for(let i of Object.values(l.graph.nodes)){let f=i.op.toLowerCase();s.includes(f)||s.push(f)}else!l&&e.config.debug&&h("model not loaded",n);for(let i of s)!o.includes(i)&&!r.includes(i)&&!e.env.kernels.includes(i)&&!e.env.kernels.includes(i.replace("_",""))&&!e.env.kernels.includes(i.replace("native",""))&&!e.env.kernels.includes(i.replace("v2",""))&&A.push(i);return e.config.debug&&A.length>0&&h("model validation failed:",n,A),A.length>0?{name:n,missing:A,ops:s,url:a}:null}var V2=class{constructor(t){w(this,"instance");w(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,o=0;for(let s of Object.values(I0))t+=s.sizeFromManifest,n+=s.sizeLoadedWeights,o+=s.sizeDesired;let r=o>0?n/o:0;return{numLoadedModels:Object.values(I0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:o,modelStats:Object.values(I0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var o,r,s,A,a,l,c,x,i,f,d,m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0;R.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?w3(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((o=this.instance.config.face.antispoof)!=null&&o.enabled)&&!this.models.antispoof?_3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?nn(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?U3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((A=this.instance.config.face.emotion)!=null&&A.enabled)&&!this.models.emotion?V3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((a=this.instance.config.face.iris)!=null&&a.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?N3(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((c=this.instance.config.face.mesh)!=null&&c.enabled)&&!this.models.facemesh?D3(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((x=this.instance.config.face.gear)!=null&&x.enabled)&&!this.models.gear?An(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((i=this.instance.config.face.ssrnet)!=null&&i.enabled)&&!this.models.ssrnetage?dn(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((f=this.instance.config.face.ssrnet)!=null&&f.enabled)&&!this.models.ssrnetgender?mn(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((d=this.instance.config.face.mobilefacenet)!=null&&d.enabled)&&!this.models.mobilefacenet?gn(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?Pn(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((y=this.instance.config.body.modelPath)!=null&&y.includes("blazepose"))?i3(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?a3(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((u=this.instance.config.body.modelPath)!=null&&u.includes("efficientpose"))?f3(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("movenet"))?ho(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((g=this.instance.config.body.modelPath)!=null&&g.includes("posenet"))?zo(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(p=this.instance.config.hand.detector)==null?void 0:p.modelPath)!=null&&b.includes("handtrack"))?Ao(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((P=(k=this.instance.config.hand.detector)==null?void 0:k.modelPath)!=null&&P.includes("handtrack"))?ao(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((V=(N=this.instance.config.hand.detector)==null?void 0:N.modelPath)!=null&&V.includes("handdetect"))&&(n.handdetect=eo(this.instance.config),n.handskeleton=to(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((_=this.instance.config.object.modelPath)!=null&&_.includes("centernet"))?d3(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((Z=this.instance.config.object.modelPath)!=null&&Z.includes("nanodet"))?To(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&(($=this.instance.config.segmentation.modelPath)!=null&&$.includes("selfie"))?k1(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((A0=this.instance.config.segmentation.modelPath)!=null&&A0.includes("meet"))?d1(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((t0=this.instance.config.segmentation.modelPath)!=null&&t0.includes("rvm"))?P1(this.instance.config):null;for(let[n0,j0]of Object.entries(n))j0!=null&&j0.then&&j0.then(M=>this.models[n0]=M);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var o;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(o=this.models[n])==null?void 0:o.modelUrl:null}});for(let n of t){let o=Object.keys(I0).find(r=>r.startsWith(n.name));o&&(n.size=I0[o].sizeLoadedWeights,n.url=I0[o].url)}return t}loaded(){return this.list().filter(o=>o.loaded).map(o=>o.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let o=this.models[n];if(!o)continue;let r=Zt(this.instance,o,n);r&&t.push(r)}return t}};function Wo(e,t,n,o,r){var a,l,c,x,i,f;let s=0,A=[];for(let d of e){let m={id:s++,face:d,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)d.box[0]>b.box[0]&&d.box[0]b.box[1]&&d.box[1]+d.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(y.push(b[0],b[0]+b[2]),u.push(b[1],b[1]+b[3]))};T(m.face.box),T((x=m.body)==null?void 0:x.box),T((i=m.hands.left)==null?void 0:i.box),T((f=m.hands.right)==null?void 0:f.box);let g=Math.min(...y),p=Math.min(...u);m.box=[g,p,Math.max(...y)-g,Math.max(...u)-p],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),A.push(m)}return A}var d0=G(H());var qt=` + gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var i5=0;function Ys(e,t,n){let o=a0(f0,n);if(!t||!e)return;let r=oe(e);if(r){r.lineJoin="round",r.font=o.font;for(let s=0;sd5,kpt:()=>c5});var c5=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],d5={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var D=V(G());var se,n2=224,e3,Qs=5,At=[8,16,32,32,32];function _s(){let e=[],t=0;for(;tn.x)),y:D.tensor1d(e.map(n=>n.y))}}async function t3(e){if(R.initial&&(se=null),!se&&e.body.detector&&e.body.detector.modelPath){se=await O(e.body.detector.modelPath);let t=se!=null&&se.executor?Object.values(se.modelSignature.inputs):void 0;n2=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&se&&h("cached model:",se.modelUrl);return _s(),se}var $1=[5,5];function $s(e,t){return D.tidy(()=>{let n=D.split(e,12,1),o=D.squeeze(n[0]),r=D.squeeze(n[1]),s=D.squeeze(n[2]),A=D.squeeze(n[3]);o=D.add(D.div(o,n2),t.x),r=D.add(D.div(r,n2),t.y),s=D.mul(D.div(s,n2),$1[0]),A=D.mul(D.div(A,n2),$1[1]);let a=D.sub(o,D.div(s,2)),l=D.sub(r,D.div(A,2)),c=D.add(a,s),x=D.add(l,A);return D.stack([a,l,c,x],1)})}async function eA(e,t,n,o){var c,x;let r=[],s={};s.boxes=$s(e,e3),s.scores=D.sigmoid(t),s.nms=await D.image.nonMaxSuppressionAsync(s.boxes,s.scores,1,((c=n.body.detector)==null?void 0:c.minConfidence)||.1,((x=n.body.detector)==null?void 0:x.iouThreshold)||.1);let A=await s.nms.data(),a=await s.scores.data(),l=await s.boxes.array();for(let i of Array.from(A)){let y=a[i],d=l[i],m=[Math.round(d[0]*o[0]),Math.round(d[1]*o[1]),Math.round(d[2]*o[0]),Math.round(d[3]*o[1])],f={score:y,boxRaw:d,box:m};r.push(f)}return Object.keys(s).forEach(i=>D.dispose(s[i])),r}async function n3(e,t,n){let o={};o.res=se==null?void 0:se.execute(e,["Identity"]),o.logitsRaw=D.slice(o.res,[0,0,0],[1,-1,1]),o.boxesRaw=D.slice(o.res,[0,0,1],[1,-1,-1]),o.logits=D.squeeze(o.logitsRaw),o.boxes=D.squeeze(o.boxesRaw);let r=await eA(o.boxes,o.logits,t,n);return Object.keys(o).forEach(s=>D.dispose(o[s])),r}function Oe(e,t=[1,1]){let n=[e.map(a=>a[0]),e.map(a=>a[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[o[0],o[1],r[0]-o[0],r[1]-o[1]],A=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:A}}function o3(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[(o[0]+r[0])/2,(o[1]+r[1])/2],A=Math.max(s[0]-o[0],s[1]-o[1],-s[0]+r[0],-s[1]+r[1]),a=[Math.trunc(s[0]-A),Math.trunc(s[1]-A),Math.trunc(2*A),Math.trunc(2*A)],l=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:l}}function at(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var Z0,y5=256,x5=Number.MAX_SAFE_INTEGER,tA={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},lt=[],Le=[[0,0],[0,0],[0,0],[0,0]],r3=0,s3=e=>1-1/(1+Math.exp(e)),a3=e=>t3(e);async function i3(e){if(R.initial&&(Z0=null),Z0)e.debug&&h("cached model:",Z0.modelUrl);else{Z0=await O(e.body.modelPath);let t=Z0!=null&&Z0.executor?Object.values(Z0.modelSignature.inputs):void 0;y5=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Z0}function A3(e,t,n){var s,A;let o={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((A=e==null?void 0:e.shape)!=null&&A[2]))return e;let r;if(n&&(o.cropped=q0.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let a=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Le=[[0,0],a,l,[0,0]],o.pad=q0.pad(o.cropped||e,Le),o.resize=q0.image.resizeBilinear(o.pad,[t,t]),r=q0.div(o.resize,C.tf255)}else e.shape[1]!==t?(o.resize=q0.image.resizeBilinear(o.cropped||e,[t,t]),r=q0.div(o.resize,C.tf255)):r=q0.div(o.cropped||e,C.tf255);return Object.keys(o).forEach(a=>q0.dispose(o[a])),r}function nA(e,t,n){for(let o of e)o.position=[Math.trunc(o.position[0]*(t[0]+Le[2][0]+Le[2][1])/t[0]-Le[2][0]),Math.trunc(o.position[1]*(t[1]+Le[1][0]+Le[1][1])/t[1]-Le[1][0]),o.position[2]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1],2*o.position[2]/(t[0]+t[1])];if(n){let o=n[2]-n[0],r=n[3]-n[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+n[1],s.positionRaw[1]/o+n[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function oA(e){let t=e.find(a=>a.part==="leftPalm"),n=e.find(a=>a.part==="leftWrist"),o=e.find(a=>a.part==="leftIndex");t.position[2]=((n.position[2]||0)+(o.position[2]||0))/2;let r=e.find(a=>a.part==="rightPalm"),s=e.find(a=>a.part==="rightWrist"),A=e.find(a=>a.part==="rightIndex");r.position[2]=((s.position[2]||0)+(A.position[2]||0))/2}async function rA(e,t,n){if(!(Z0!=null&&Z0.executor))return null;let o={};[o.ld,o.segmentation,o.heatmap,o.world,o.poseflag]=Z0==null?void 0:Z0.execute(e,tA.landmarks);let r=(await o.poseflag.data())[0],s=await o.ld.data(),A=await o.world.data();Object.keys(o).forEach(m=>q0.dispose(o[m]));let a=[],l=5;for(let m=0;mm.position),i=Oe(x,[n[0],n[1]]),y={};for(let[m,f]of Object.entries(d5)){let u=[];for(let g=0;gb.part===f[g]),p=c.find(b=>b.part===f[g+1]);T&&p&&u.push([T.position,p.position])}y[m]=u}return{id:0,score:Math.trunc(100*r)/100,box:i.box,boxRaw:i.boxRaw,keypoints:c,annotations:y}}async function f5(e,t){var s,A,a;let n=[e.shape[2]||0,e.shape[1]||0],o=(t.body.skipTime||0)>v()-r3,r=x5<(t.body.skipFrames||0);if(t.skipAllowed&&o&&r&<!==null)x5++;else{let l=[];if((A=(s=t.body)==null?void 0:s.detector)!=null&&A.enabled){let c=A3(e,224);l=await n3(c,t,n),q0.dispose(c)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let c=0;cF0.dispose(o[c])),r}async function u5(e,t){if(!(X0!=null&&X0.executor))return[];let n=(t.object.skipTime||0)>v()-c3,o=p5<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&m5.length>0?(p5++,m5):(p5=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=F0.image.resizeBilinear(e,[o2,o2]),a=t.object.enabled?X0==null?void 0:X0.execute(A,["tower_0/detections"]):null;c3=v(),F0.dispose(A);let l=await sA(a,s,t);m5=l,r(l)}))}var J=V(G());var ct={};ze(ct,{connected:()=>b5,kpt:()=>h5});var h5=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],b5={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var i0,y3=0,B0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},g5=Number.MAX_SAFE_INTEGER;async function f3(e){return R.initial&&(i0=null),i0?e.debug&&h("cached model:",i0.modelUrl):i0=await O(e.body.modelPath),i0}async function AA(e,t){let[n,o]=e.shape,r=J.reshape(e,[o*n]),s=J.max(r,0),A=(await s.data())[0];if(A>t){let a=J.argMax(r,0),l=J.mod(a,n),c=(await l.data())[0],x=J.div(a,n),i=(await x.data())[0];return J.dispose([r,s,a,l,x]),[c,i,A]}return J.dispose([r,s]),[0,0,A]}async function T5(e,t){if(!(i0!=null&&i0.executor)||!(i0!=null&&i0.inputs[0].shape))return[];let n=(t.body.skipTime||0)>v()-y3,o=g5<(t.body.skipFrames||0);return t.skipAllowed&&n&&o&&Object.keys(B0.keypoints).length>0?(g5++,[B0]):(g5=0,new Promise(async r=>{let s=J.tidy(()=>{var m,f;let i=J.image.resizeBilinear(e,[((m=i0==null?void 0:i0.inputs[0].shape)==null?void 0:m[2])||0,((f=i0==null?void 0:i0.inputs[0].shape)==null?void 0:f[1])||0],!1),y=J.mul(i,C.tf2);return J.sub(y,C.tf1)}),A;if(t.body.enabled&&(A=i0==null?void 0:i0.execute(s)),y3=v(),J.dispose(s),A){B0.keypoints.length=0;let i=J.squeeze(A);J.dispose(A);let y=J.unstack(i,2);J.dispose(i);for(let d=0;d(t.body.minConfidence||0)&&B0.keypoints.push({score:Math.round(100*u)/100,part:h5[d],positionRaw:[m/i0.inputs[0].shape[2],f/i0.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/i0.inputs[0].shape[2]),Math.round(e.shape[1]*f/i0.inputs[0].shape[1])]})}y.forEach(d=>J.dispose(d))}B0.score=B0.keypoints.reduce((i,y)=>y.score>i?y.score:i,0);let a=B0.keypoints.map(i=>i.position[0]),l=B0.keypoints.map(i=>i.position[1]);B0.box=[Math.min(...a),Math.min(...l),Math.max(...a)-Math.min(...a),Math.max(...l)-Math.min(...l)];let c=B0.keypoints.map(i=>i.positionRaw[0]),x=B0.keypoints.map(i=>i.positionRaw[1]);B0.boxRaw=[Math.min(...c),Math.min(...x),Math.max(...c)-Math.min(...c),Math.max(...x)-Math.min(...x)];for(let[i,y]of Object.entries(b5)){let d=[];for(let m=0;mg.part===y[m]),u=B0.keypoints.find(g=>g.part===y[m+1]);f&&u&&f.score>(t.body.minConfidence||0)&&u.score>(t.body.minConfidence||0)&&d.push([f.position,u.position])}B0.annotations[i]=d}r([B0])}))}var l0=V(G());var De=V(G());var L=V(G());var Me=V(G());var p2=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],dt=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],xt=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],yt=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],h3=(e,t,n)=>{let o=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(A=>[(A[0]+n[0])*t[0],(A[1]+n[1])*t[1]]);return{startPoint:o,endPoint:r,landmarks:s,confidence:e.confidence}},v5=(e,t,n)=>{let o=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/o,e.startPoint[0]/r,e.endPoint[1]/o,e.endPoint[0]/r],A=Me.image.cropAndResize(t,[s],[0],n),a=Me.div(A,C.tf255);return Me.dispose(A),a},ft=(e,t)=>{let n=dt(e),o=p2(e),r=[t*o[0]/2,t*o[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:o}},mt=e=>{let t=dt(e),n=p2(e),o=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-o),Math.round(t[1]-o)],endPoint:[Math.round(t[0]+o),Math.round(t[1]+o)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},b3=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},R5=[[1,0,0],[0,1,0],[0,0,1]],aA=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),iA=(e,t)=>aA(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var p3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],r2=(e,t)=>{let n=0;for(let o=0;o{let n=[];for(let o=0;o{let n=[],o=e.length;for(let r=0;r{let n=Math.cos(e),o=Math.sin(e),r=[[n,-o,0],[o,n,0],[0,0,1]],s=p3(t[0],t[1]),A=u3(s,r),a=p3(-t[0],-t[1]);return u3(A,a)},cA=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],o=[-r2(t[0],n),-r2(t[1],n)];return[t[0].concat(o[0]),t[1].concat(o[1]),[0,0,1]]},dA=(e,t)=>[r2(e,t[0]),r2(e,t[1])];function T3(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let o=0;o[s[0]/r*(d[0]-r/2),s[1]/r*(d[1]-r/2),d[2]||0]),a=n&&n!==0&&Math.abs(n)>.2,l=a?g3(n,[0,0]):R5,c=a?A.map(d=>[...dA(d,l),d[2]]):A,x=a?cA(o):R5,i=dt(t),y=[r2(i,x[0]),r2(i,x[1])];return c.map(d=>[Math.trunc(d[0]+y[0]),Math.trunc(d[1]+y[1]),Math.trunc(d[2]||0)])}function R3(e,t,n,o){let r=t.landmarks.length>=s5.count?s5.symmetryLine:_e.symmetryLine,s=0,A=R5,a;if(e&&R.kernels.includes("rotatewithoffset"))if(s=iA(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let c=dt(t),x=[c[0]/n.shape[2],c[1]/n.shape[1]],i=Me.image.rotateWithOffset(n,s,0,[x[0],x[1]]);A=g3(-s,c),a=v5(t,i,[o,o]),Me.dispose(i)}else a=v5(t,n,[o,o]);else a=v5(t,n,[o,o]);return[s,A,a]}var xA=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},M3=(e,t)=>{let n=xA(e),o=p2(t);return{startPoint:[n[0]-o[0]/2,n[1]-o[1]/2],endPoint:[n[0]+o[0]/2,n[1]+o[1]/2]}};var P3=6,xe,pt=null,Ce=0,u2=null,k3=()=>Ce;async function w3(e){var t;return R.initial&&(xe=null),xe?e.debug&&h("cached model:",xe.modelUrl):xe=await O((t=e.face.detector)==null?void 0:t.modelPath),Ce=xe.executor&&xe.inputs[0].shape?xe.inputs[0].shape[2]:256,u2=L.scalar(Ce,"int32"),pt=L.tensor2d(T3(Ce)),xe}function yA(e){if(!pt||!u2)return L.zeros([0,0]);let t={};t.boxStarts=L.slice(e,[0,1],[-1,2]),t.centers=L.add(t.boxStarts,pt),t.boxSizes=L.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=L.div(t.boxSizes,u2),t.centersNormalized=L.div(t.centers,u2),t.halfBoxSize=L.div(t.boxSizesNormalized,C.tf2),t.starts=L.sub(t.centersNormalized,t.halfBoxSize),t.ends=L.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=L.mul(t.starts,u2),t.endNormalized=L.mul(t.ends,u2);let n=L.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(o=>L.dispose(t[o])),n}async function E3(e,t){var a,l,c,x,i,y,d;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=L.image.resizeBilinear(e,[Ce,Ce]),n.div=L.div(n.resized,C.tf127),n.normalized=L.sub(n.div,C.tf05);let o=xe==null?void 0:xe.execute(n.normalized);if(Array.isArray(o)&&o.length>2){let m=o.sort((f,u)=>f.size-u.size);n.concat384=L.concat([m[0],m[2]],2),n.concat512=L.concat([m[1],m[3]],2),n.concat=L.concat([n.concat512,n.concat384],1),n.batch=L.squeeze(n.concat,[0])}else Array.isArray(o)?n.batch=L.squeeze(o[0]):n.batch=L.squeeze(o);L.dispose(o),n.boxes=yA(n.batch),n.logits=L.slice(n.batch,[0,0],[-1,1]),n.sigmoid=L.sigmoid(n.logits),n.scores=L.squeeze(n.sigmoid),n.nms=await L.image.nonMaxSuppressionAsync(n.boxes,n.scores,((a=t.face.detector)==null?void 0:a.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),s=[],A=await n.scores.data();for(let m=0;m(((x=t.face.detector)==null?void 0:x.minConfidence)||0)){let u={};u.bbox=L.slice(n.boxes,[r[m],0],[1,-1]),u.slice=L.slice(n.batch,[r[m],P3-1],[1,-1]),u.squeeze=L.squeeze(u.slice),u.landmarks=L.reshape(u.squeeze,[P3,-1]);let g=await u.bbox.data(),T={startPoint:[g[0],g[1]],endPoint:[g[2],g[3]],landmarks:await u.landmarks.array(),confidence:f};u.anchor=L.slice(pt,[r[m],0],[1,2]);let p=await u.anchor.data(),b=h3(T,[(e.shape[2]||0)/Ce,(e.shape[1]||0)/Ce],p),k=ft(b,((i=t.face.detector)==null?void 0:i.scale)||1.4),P=mt(k);P.size[0]>(((y=t.face.detector)==null?void 0:y.minSize)||0)&&P.size[1]>(((d=t.face.detector)==null?void 0:d.minSize)||0)&&s.push(P),Object.keys(u).forEach(I=>L.dispose(u[I]))}}return Object.keys(n).forEach(m=>L.dispose(n[m])),s}var ye=V(G());var K0,We=0,P5=ae.leftEyeLower0,k5=ae.rightEyeLower0,h2={leftBounds:[P5[0],P5[P5.length-1]],rightBounds:[k5[0],k5[k5.length-1]]},b2={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function N3(e){var t,n;return R.initial&&(K0=null),K0?e.debug&&h("cached model:",K0.modelUrl):K0=await O((t=e.face.iris)==null?void 0:t.modelPath),We=K0!=null&&K0.executor&&((n=K0.inputs)!=null&&n[0].shape)?K0.inputs[0].shape[2]:0,We===-1&&(We=64),K0}function ut(e,t,n,o){for(let r=0;r{let t=e[h2.leftBounds[0]][2],n=e[h2.rightBounds[0]][2];return t-n},S3=(e,t,n,o,r,s=!1,A=2.3)=>{let a=mt(ft(b3([e[n],e[o]]),A)),l=p2(a),c=ye.image.cropAndResize(t,[[a.startPoint[1]/r,a.startPoint[0]/r,a.endPoint[1]/r,a.endPoint[0]/r]],[0],[We,We]);if(s&&R.kernels.includes("flipleftright")){let x=ye.image.flipLeftRight(c);ye.dispose(c),c=x}return{box:a,boxSize:l,crop:c}},j3=(e,t,n,o=!1)=>{let r=[];for(let s=0;s{let o=e[ae[`${n}EyeUpper0`][b2.upperCenter]][2],r=e[ae[`${n}EyeLower0`][b2.lowerCenter]][2],s=(o+r)/2;return t.map((A,a)=>{let l=s;return a===2?l=o:a===4&&(l=r),[A[0],A[1],l]})};async function O3(e,t,n,o){var I,B;if(!(K0!=null&&K0.executor))return e;let{box:r,boxSize:s,crop:A}=S3(e,t,h2.leftBounds[0],h2.leftBounds[1],n,!0,((I=o.face.iris)==null?void 0:I.scale)||2.3),{box:a,boxSize:l,crop:c}=S3(e,t,h2.rightBounds[0],h2.rightBounds[1],n,!0,((B=o.face.iris)==null?void 0:B.scale)||2.3),x=ye.concat([A,c]);ye.dispose(A),ye.dispose(c);let i=K0.execute(x);ye.dispose(x);let y=await i.data();ye.dispose(i);let d=y.slice(0,b2.numCoordinates*3),{rawCoords:m,iris:f}=j3(d,r,s,!0),u=y.slice(b2.numCoordinates*3),{rawCoords:g,iris:T}=j3(u,a,l,!1),p=fA(e);Math.abs(p)<30?(ut(e,m,"left",null),ut(e,g,"right",null)):p<1?ut(e,m,"left",["EyeUpper0","EyeLower0"]):ut(e,g,"right",["EyeUpper0","EyeLower0"]);let b=I3(e,f,"left"),k=I3(e,T,"right");return e.concat(b).concat(k)}async function C3(e,t){var s,A,a,l,c,x,i,y,d,m;let n={lips:await((A=(s=t.filter(f=>f.size===160))==null?void 0:s[0])==null?void 0:A.data()),irisL:await((l=(a=t.filter(f=>f.size===10))==null?void 0:a[0])==null?void 0:l.data()),eyeL:await((x=(c=t.filter(f=>f.size===142))==null?void 0:c[0])==null?void 0:x.data()),irisR:await((y=(i=t.filter(f=>f.size===10))==null?void 0:i[1])==null?void 0:y.data()),eyeR:await((m=(d=t.filter(f=>f.size===142))==null?void 0:d[1])==null?void 0:m.data())};for(let f of Object.values(n))if(!f)return e;let o=e2.reduce((f,u)=>f+=e[u][2],0)/e2.length;for(let f=0;ff+=e[u][2],0)/t2.length;for(let f=0;fv()-ge.timestamp,o=ge.skipped<(((c=t.face.detector)==null?void 0:c.skipFrames)||0);!t.skipAllowed||!n||!o||ge.boxes.length===0?(ge.boxes=await E3(e,t),ge.timestamp=v(),ge.skipped=0):ge.skipped++;let r=[],s=[],A=0,a=W2;for(let T=0;T[I[0]/(e.shape[2]||0),I[1]/(e.shape[1]||0),(I[2]||0)/a]);for(let I of Object.keys(_e))P.annotations[I]=[P.mesh[_e[I]]]}else if(!r0)t.debug&&h("face mesh detection requested, but model is not loaded");else{if((d=t.face.attention)!=null&&d.enabled&&!R.kernels.includes("atan2"))return t.face.attention.enabled=!1,De.dispose(P.tensor),r;let I=r0.execute(P.tensor),_=await I.find(Z=>Z.shape[Z.shape.length-1]===1).data();if(P.faceScore=Math.round(100*_[0])/100,P.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(p.confidence=P.faceScore,t.face.mesh.keepInvalid){P.box=xt(p,e),P.boxRaw=yt(p,e),P.size=p.size,P.score=P.boxScore,P.mesh=p.landmarks,P.meshRaw=P.mesh.map(Z=>[Z[0]/(e.shape[2]||1),Z[1]/(e.shape[1]||1),(Z[2]||0)/a]);for(let Z of Object.keys(_e))P.annotations[Z]=[P.mesh[_e[Z]]]}}else{let Z=I.find(n0=>n0.shape[n0.shape.length-1]===1404),$=De.reshape(Z,[-1,3]),A0=await $.array();De.dispose($),(f=t.face.attention)!=null&&f.enabled?A0=await C3(A0,I):(u=t.face.iris)!=null&&u.enabled&&(A0=await O3(A0,P.tensor,W2,t)),P.mesh=v3(A0,p,b,k,W2),P.meshRaw=P.mesh.map(n0=>[n0[0]/(e.shape[2]||0),n0[1]/(e.shape[1]||0),(n0[2]||0)/a]);for(let n0 of Object.keys(ae))P.annotations[n0]=ae[n0].map(j0=>P.mesh[j0]);P.score=P.faceScore;let t0={...M3(P.mesh,p),confidence:p.confidence,landmarks:p.landmarks,size:p.size};P.box=xt(t0,e),P.boxRaw=yt(t0,e),P.size=t0.size,s.push(t0)}De.dispose(I)}P.score>(((g=t.face.detector)==null?void 0:g.minConfidence)||1)?r.push(P):De.dispose(P.tensor)}return ge.boxes=s,r}async function D3(e){var t,n,o,r,s,A;return R.initial&&(r0=null),(t=e.face.attention)!=null&&t.enabled&&(r0!=null&&r0.signature)&&Object.keys(((n=r0==null?void 0:r0.signature)==null?void 0:n.outputs)||{}).length<6&&(r0=null),r0?e.debug&&h("cached model:",r0.modelUrl):(o=e.face.attention)!=null&&o.enabled?r0=await O(e.face.attention.modelPath):r0=await O((r=e.face.mesh)==null?void 0:r.modelPath),W2=r0.executor&&((s=r0==null?void 0:r0.inputs)!=null&&s[0].shape)?(A=r0==null?void 0:r0.inputs)==null?void 0:A[0].shape[2]:256,r0}var F3=$e,B3=L2;var J0=V(G());var z5=[],P0,ht=[],H3=0,G3=0,E5=Number.MAX_SAFE_INTEGER,S5=!1;async function V3(e){var t,n,o;return R.initial&&(P0=null),P0?e.debug&&h("cached model:",P0.modelUrl):(P0=await O((t=e.face.emotion)==null?void 0:t.modelPath),S5=((o=(n=P0==null?void 0:P0.inputs)==null?void 0:n[0].shape)==null?void 0:o[3])===3,S5?z5=["angry","disgust","fear","happy","neutral","sad","surprise"]:z5=["angry","disgust","fear","happy","sad","surprise","neutral"]),P0}async function j5(e,t,n,o){var A,a;if(!P0)return[];let r=E5<(((A=t.face.emotion)==null?void 0:A.skipFrames)||0),s=(((a=t.face.emotion)==null?void 0:a.skipTime)||0)>v()-G3;return t.skipAllowed&&s&&r&&H3===o&&ht[n]&&ht[n].length>0?(E5++,ht[n]):(E5=0,new Promise(async l=>{var x,i,y;let c=[];if((x=t.face.emotion)!=null&&x.enabled){let d={},m=P0!=null&&P0.inputs[0].shape?P0.inputs[0].shape[2]:0;if(((i=t.face.emotion)==null?void 0:i.crop)>0){let u=(y=t.face.emotion)==null?void 0:y.crop,g=[[u,u,1-u,1-u]];d.resize=J0.image.cropAndResize(e,g,[0],[m,m])}else d.resize=J0.image.resizeBilinear(e,[m,m],!1);S5?(d.mul=J0.mul(d.resize,255),d.normalize=J0.sub(d.mul,[103.939,116.779,123.68]),d.emotion=P0==null?void 0:P0.execute(d.normalize)):(d.channels=J0.mul(d.resize,C.rgb),d.grayscale=J0.sum(d.channels,3,!0),d.grayscaleSub=J0.sub(d.grayscale,C.tf05),d.grayscaleMul=J0.mul(d.grayscaleSub,C.tf2),d.emotion=P0==null?void 0:P0.execute(d.grayscaleMul)),G3=v();let f=await d.emotion.data();for(let u=0;u(t.face.emotion.minConfidence||0)&&c.push({score:Math.min(.99,Math.trunc(100*f[u])/100),emotion:z5[u]});c.sort((u,g)=>g.score-u.score),Object.keys(d).forEach(u=>J0.dispose(d[u]))}ht[n]=c,H3=o,l(c)}))}var ie=V(G());var k0,Fe=[],q3=0,X3=0,I5=Number.MAX_SAFE_INTEGER;async function U3(e){var t;return R.initial&&(k0=null),k0?e.debug&&h("cached model:",k0.modelUrl):k0=await O((t=e.face.description)==null?void 0:t.modelPath),k0}function pA(e,t){var s,A;let n=e.image||e.tensor||e;if(!(k0!=null&&k0.inputs[0].shape))return n;let o;if(((s=t.face.description)==null?void 0:s.crop)>0){let a=(A=t.face.description)==null?void 0:A.crop,l=[[a,a,1-a,1-a]];o=ie.image.cropAndResize(n,l,[0],[k0.inputs[0].shape[2],k0.inputs[0].shape[1]])}else o=ie.image.resizeBilinear(n,[k0.inputs[0].shape[2],k0.inputs[0].shape[1]],!1);let r=ie.mul(o,C.tf255);return ie.dispose(o),r}async function N5(e,t,n,o){var a,l,c,x;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(k0!=null&&k0.executor))return r;let s=I5<(((a=t.face.description)==null?void 0:a.skipFrames)||0),A=(((l=t.face.description)==null?void 0:l.skipTime)||0)>v()-q3;return t.skipAllowed&&s&&A&&X3===o&&((c=Fe==null?void 0:Fe[n])==null?void 0:c.age)>0&&((x=Fe==null?void 0:Fe[n])==null?void 0:x.genderScore)>0?(I5++,Fe[n]):(I5=0,new Promise(async i=>{var y;if((y=t.face.description)!=null&&y.enabled){let d=pA(e,t),m=k0==null?void 0:k0.execute(d);q3=v(),ie.dispose(d);let u=await m.find(B=>B.shape[1]===1).data(),g=Math.trunc(200*Math.abs(u[0]-.5))/100;g>(t.face.description.minConfidence||0)&&(r.gender=u[0]<=.5?"female":"male",r.genderScore=Math.min(.99,g));let T=ie.argMax(m.find(B=>B.shape[1]===100),1),p=(await T.data())[0];ie.dispose(T);let k=await m.find(B=>B.shape[1]===100).data();r.age=Math.round(k[p-1]>k[p+1]?10*p-100*k[p-1]:10*p+100*k[p+1])/10,(Number.isNaN(u[0])||Number.isNaN(k[0]))&&h("faceres error:",{model:k0,result:m});let P=m.find(B=>B.shape[1]===1024),I=P?await P.data():[];r.descriptor=Array.from(I),m.forEach(B=>ie.dispose(B))}Fe[n]=r,X3=o,i(r)}))}var g2=.1,O5=.5;function uA(e,t,n){let o=!1,r=n.length-1;for(let s=0;st!=n[r].y>t&&e<(n[r].x-n[s].x)*(t-n[s].y)/(n[r].y-n[s].y)+n[s].x&&(o=!o);return o}async function K3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,o=await e.tensor.buffer(),r=[];for(let A of ae.silhouette)r.push({x:(e.mesh[A][0]-e.box[0])/e.box[2],y:(e.mesh[A][1]-e.box[1])/e.box[3]});g2&&g2>0&&(r=r.map(A=>({x:A.x>.5?A.x+g2:A.x-g2,y:A.y>.5?A.y+g2:A.y-g2})));for(let A=0;Av()-Q3,s=L5<(((a=t.face.antispoof)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&J3===o&&bt[n]?(L5++,bt[n]):(L5=0,new Promise(async l=>{let c=gt.image.resizeBilinear(e,[w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[2]:0,w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[1]:0],!1),x=w0==null?void 0:w0.execute(c),i=(await x.data())[0];bt[n]=Math.round(100*i)/100,J3=o,Q3=v(),gt.dispose([c,x]),l(bt[n])}))}var vt=V(G());var E0,Tt=[],W5=Number.MAX_SAFE_INTEGER,en=0,tn=0;async function nn(e){var t;return R.initial&&(E0=null),E0?e.debug&&h("cached model:",E0.modelUrl):E0=await O((t=e.face.liveness)==null?void 0:t.modelPath),E0}async function D5(e,t,n,o){var A,a;if(!(E0!=null&&E0.executor))return 0;let r=(((A=t.face.liveness)==null?void 0:A.skipTime)||0)>v()-tn,s=W5<(((a=t.face.liveness)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&en===o&&Tt[n]?(W5++,Tt[n]):(W5=0,new Promise(async l=>{let c=vt.image.resizeBilinear(e,[E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[2]:0,E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[1]:0],!1),x=E0==null?void 0:E0.execute(c),i=(await x.data())[0];Tt[n]=Math.round(100*i)/100,en=o,tn=v(),vt.dispose([c,x]),l(Tt[n])}))}var Rt=V(G());var le,F5=[],bA=["white","black","asian","indian","other"],gA=[15,23,28,35.5,45.5,55.5,65],rn=0,sn=0,B5=Number.MAX_SAFE_INTEGER;async function An(e){var t;return R.initial&&(le=null),le?e.debug&&h("cached model:",le.modelUrl):le=await O((t=e.face.gear)==null?void 0:t.modelPath),le}async function H5(e,t,n,o){var A,a;if(!le)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=B5<(((A=t.face.gear)==null?void 0:A.skipFrames)||0),s=(((a=t.face.gear)==null?void 0:a.skipTime)||0)>v()-sn;return t.skipAllowed&&s&&r&&rn===o&&F5[n]?(B5++,F5[n]):(B5=0,new Promise(async l=>{var g,T,p,b;if(!(le!=null&&le.inputs[0].shape))return;let c={},x=[[0,.1,.9,.9]];if(((g=t.face.gear)==null?void 0:g.crop)>0){let k=(T=t.face.gear)==null?void 0:T.crop;x=[[k,k,1-k,1-k]]}c.resize=Rt.image.cropAndResize(e,x,[0],[le.inputs[0].shape[2],le.inputs[0].shape[1]]);let i={age:0,gender:"unknown",genderScore:0,race:[]};(p=t.face.gear)!=null&&p.enabled&&([c.age,c.gender,c.race]=le.execute(c.resize,["age_output","gender_output","race_output"]));let y=await c.gender.data();i.gender=y[0]>y[1]?"male":"female",i.genderScore=Math.round(100*(y[0]>y[1]?y[0]:y[1]))/100;let d=await c.race.data();for(let k=0;k(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&i.race.push({score:Math.round(100*d[k])/100,race:bA[k]});i.race.sort((k,P)=>P.score-k.score);let f=Array.from(await c.age.data()).map((k,P)=>[gA[P],k]).sort((k,P)=>P[1]-k[1]),u=f[0][0];for(let k=1;kRt.dispose(c[k])),F5[n]=i,rn=o,sn=v(),l(i)}))}var s2=V(G());var H0,Mt=[],ln=0,cn=0,G5=Number.MAX_SAFE_INTEGER;async function dn(e){return R.initial&&(H0=null),H0?e.debug&&h("cached model:",H0.modelUrl):H0=await O(e.face.ssrnet.modelPathAge),H0}async function V5(e,t,n,o){var A,a,l,c;if(!H0)return{age:0};let r=G5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-cn;return t.skipAllowed&&r&&s&&ln===o&&((l=Mt[n])!=null&&l.age)&&((c=Mt[n])==null?void 0:c.age)>0?(G5++,Mt[n]):(G5=0,new Promise(async x=>{var d,m,f;if(!(H0!=null&&H0.inputs)||!H0.inputs[0]||!H0.inputs[0].shape)return;let i={};if(((d=t.face.ssrnet)==null?void 0:d.crop)>0){let u=(m=t.face.ssrnet)==null?void 0:m.crop,g=[[u,u,1-u,1-u]];i.resize=s2.image.cropAndResize(e,g,[0],[H0.inputs[0].shape[2],H0.inputs[0].shape[1]])}else i.resize=s2.image.resizeBilinear(e,[H0.inputs[0].shape[2],H0.inputs[0].shape[1]],!1);i.enhance=s2.mul(i.resize,C.tf255);let y={age:0};if((f=t.face.ssrnet)!=null&&f.enabled&&(i.age=H0.execute(i.enhance)),i.age){let u=await i.age.data();y.age=Math.trunc(10*u[0])/10}Object.keys(i).forEach(u=>s2.dispose(i[u])),Mt[n]=y,ln=o,cn=v(),x(y)}))}var v0=V(G());var N0,Pt=[],yn=0,fn=0,Z5=Number.MAX_SAFE_INTEGER,q5=[.2989,.587,.114];async function mn(e){var t;return R.initial&&(N0=null),N0?e.debug&&h("cached model:",N0.modelUrl):N0=await O((t=e.face.ssrnet)==null?void 0:t.modelPathGender),N0}async function X5(e,t,n,o){var A,a,l,c;if(!N0)return{gender:"unknown",genderScore:0};let r=Z5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-fn;return t.skipAllowed&&r&&s&&yn===o&&((l=Pt[n])!=null&&l.gender)&&((c=Pt[n])==null?void 0:c.genderScore)>0?(Z5++,Pt[n]):(Z5=0,new Promise(async x=>{var m,f,u;if(!(N0!=null&&N0.inputs[0].shape))return;let i={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let g=(f=t.face.ssrnet)==null?void 0:f.crop,T=[[g,g,1-g,1-g]];i.resize=v0.image.cropAndResize(e,T,[0],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]])}else i.resize=v0.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]],!1);i.enhance=v0.tidy(()=>{var T,p;let g;if(((p=(T=N0==null?void 0:N0.inputs)==null?void 0:T[0].shape)==null?void 0:p[3])===1){let[b,k,P]=v0.split(i.resize,3,3),I=v0.mul(b,q5[0]),B=v0.mul(k,q5[1]),_=v0.mul(P,q5[2]),Z=v0.addN([I,B,_]);g=v0.mul(v0.sub(Z,C.tf05),2)}else g=v0.mul(v0.sub(i.resize,C.tf05),2);return g});let y={gender:"unknown",genderScore:0};(u=t.face.ssrnet)!=null&&u.enabled&&(i.gender=N0.execute(i.enhance));let d=await i.gender.data();y.gender=d[0]>d[1]?"female":"male",y.genderScore=d[0]>d[1]?Math.trunc(100*d[0])/100:Math.trunc(100*d[1])/100,Object.keys(i).forEach(g=>v0.dispose(i[g])),Pt[n]=y,yn=o,fn=v(),x(y)}))}var kt=V(G());var Q0,U5=[],un=0,hn=0,bn=Number.MAX_SAFE_INTEGER;async function gn(e){var t;return R.initial&&(Q0=null),Q0?e.debug&&h("cached model:",Q0.modelUrl):Q0=await O((t=e.face.mobilefacenet)==null?void 0:t.modelPath),Q0}async function Y5(e,t,n,o){var A,a;if(!(Q0!=null&&Q0.executor))return[];let r=bn<(((A=t.face.mobilefacenet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.mobilefacenet)==null?void 0:a.skipTime)||0)>v()-hn;return t.skipAllowed&&s&&r&&un===o&&U5[n]?(bn++,U5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.mobilefacenet)!=null&&x.enabled&&(Q0!=null&&Q0.inputs[0].shape)){let i={};i.crop=kt.image.resizeBilinear(e,[Q0.inputs[0].shape[2],Q0.inputs[0].shape[1]],!1),i.data=Q0.execute(i.crop);let y=await i.data.data();c=Array.from(y),Object.keys(i).forEach(d=>kt.dispose(i[d]))}U5[n]=c,un=o,hn=v(),l(c)})}var wt=V(G());var _0,K5=[],vn=0,Rn=0,Mn=Number.MAX_SAFE_INTEGER;async function Pn(e){return R.initial&&(_0=null),_0?e.debug&&h("cached model:",_0.modelUrl):_0=await O(e.face.insightface.modelPath),_0}async function J5(e,t,n,o){var A,a;if(!(_0!=null&&_0.executor))return[];let r=Mn<(((A=t.face.insightface)==null?void 0:A.skipFrames)||0),s=(((a=t.face.insightface)==null?void 0:a.skipTime)||0)>v()-Rn;return t.skipAllowed&&s&&r&&vn===o&&K5[n]?(Mn++,K5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.insightface)!=null&&x.enabled&&(_0!=null&&_0.inputs[0].shape)){let i={};i.crop=wt.image.resizeBilinear(e,[_0.inputs[0].shape[2],_0.inputs[0].shape[1]],!1),i.data=_0.execute(i.crop);let y=await i.data.data();c=Array.from(y),Object.keys(i).forEach(d=>wt.dispose(i[d]))}K5[n]=c,vn=o,Rn=v(),l(c)})}var TA=e=>{let t=(i,y)=>Math.atan2(i[1]-y[1],i[0]-y[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],o=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],A=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],a=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(A[0]-s[0])/a[0]-n[0],o*(s[1]-A[1])/a[1]-n[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return c=Math.min(c,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:c}},wn=(e,t)=>{let n=f=>{let u=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=u,f[1]/=u,f[2]/=u,f},o=(f,u)=>{let g=f[0]-u[0],T=f[1]-u[1],p=f[2]-u[2];return[g,T,p]},r=(f,u)=>{let g=f[1]*u[2]-f[2]*u[1],T=f[2]*u[0]-f[0]*u[2],p=f[0]*u[1]-f[1]*u[0];return[g,T,p]},s=f=>{let[u,g,T,p,b,k,P,I,B]=f,_,Z,$;return p<1?p>-1?($=Math.asin(p),Z=Math.atan2(-P,u),_=Math.atan2(-k,b)):($=-Math.PI/2,Z=-Math.atan2(I,B),_=0):($=Math.PI/2,Z=Math.atan2(I,B),_=0),Number.isNaN(_)&&(_=0),Number.isNaN(Z)&&(Z=0),Number.isNaN($)&&($=0),{pitch:2*-_,yaw:2*-Z,roll:2*-$}},A=e.meshRaw;if(!A||A.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let a=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[A[10],A[152],A[234],A[454]].map(f=>[f[0]*t[0]/a,f[1]*t[1]/a,f[2]]),c=n(o(l[1],l[0])),x=n(o(l[3],l[2])),i=n(r(x,c));x=r(c,i);let y=[x[0],x[1],x[2],c[0],c[1],c[2],i[0],i[1],i[2]],d=s(y),m=A.length===478?TA(e):{bearing:0,strength:0};return{angle:d,matrix:y,gaze:m}};function En(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let o=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/o)/100}var Q5=async(e,t)=>{var m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;let n=v(),o,r,s,A,a,l,c,x,i,y=[];e.state="run:face";let d=await W3(t,e.config);if(e.performance.face=R.perfadd?(e.performance.face||0)+Math.trunc(v()-n):Math.trunc(v()-n),!t.shape||t.shape.length!==4)return[];if(!d)return[];for(let E=0;E200?wn(d[E],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?A=(f=e.config.face.emotion)!=null&&f.enabled?j5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[]:(e.state="run:emotion",n=v(),A=(u=e.config.face.emotion)!=null&&u.enabled?await j5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[],e.performance.emotion=R.perfadd?(e.performance.emotion||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?c=(g=e.config.face.antispoof)!=null&&g.enabled?C5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:antispoof",n=v(),c=(T=e.config.face.antispoof)!=null&&T.enabled?await C5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.antispoof=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?x=(p=e.config.face.liveness)!=null&&p.enabled?D5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:liveness",n=v(),x=(b=e.config.face.liveness)!=null&&b.enabled?await D5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.liveness=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(k=e.config.face.gear)!=null&&k.enabled?H5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:gear",n=v(),r=(P=e.config.face.gear)!=null&&P.enabled?await H5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.gear=Math.trunc(v()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(o=(I=e.config.face.ssrnet)!=null&&I.enabled?V5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(B=e.config.face.ssrnet)!=null&&B.enabled?X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null):(e.state="run:ssrnet",n=v(),o=(_=e.config.face.ssrnet)!=null&&_.enabled?await V5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(Z=e.config.face.ssrnet)!=null&&Z.enabled?await X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.ssrnet=Math.trunc(v()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?a=($=e.config.face.mobilefacenet)!=null&&$.enabled?Y5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),a=(A0=e.config.face.mobilefacenet)!=null&&A0.enabled?await Y5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(t0=e.config.face.insightface)!=null&&t0.enabled?J5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),l=(n0=e.config.face.insightface)!=null&&n0.enabled?await J5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?i=N5(d[E].tensor||l0.tensor([]),e.config,E,d.length):(e.state="run:description",n=v(),i=await N5(d[E].tensor||l0.tensor([]),e.config,E,d.length),e.performance.description=R.perfadd?(e.performance.description||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Description:"),e.config.async&&([o,s,A,a,l,i,r,c,x]=await Promise.all([o,s,A,a,l,i,r,c,x])),e.analyze("Finish Face:"),(j0=e.config.face.ssrnet)!=null&&j0.enabled&&o&&s&&(i={...i,age:o.age,gender:s.gender,genderScore:s.genderScore}),(M=e.config.face.gear)!=null&&M.enabled&&r&&(i={...i,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(T0=e.config.face.mobilefacenet)!=null&&T0.enabled&&a&&(i.descriptor=a),(C0=e.config.face.insightface)!=null&&C0.enabled&&l&&(i.descriptor=l);let q=(x0=e.config.face.iris)!=null&&x0.enabled?En(d[E],t.shape[2]):0,U0=(K=e.config.face.detector)!=null&&K.return?l0.squeeze(d[E].tensor):null;l0.dispose(d[E].tensor),d[E].tensor&&delete d[E].tensor;let y0={...d[E],id:E};i.age&&(y0.age=i.age),i.gender&&(y0.gender=i.gender),i.genderScore&&(y0.genderScore=i.genderScore),i.descriptor&&(y0.embedding=i.descriptor),i.race&&(y0.race=i.race),A&&(y0.emotion=A),c&&(y0.real=c),x&&(y0.live=x),q>0&&(y0.distance=q),H&&(y0.rotation=H),U0&&(y0.tensor=U0),y.push(y0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),y};var G0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>G0.nameMapping[e],getPoints:e=>G0.pointsMapping[e]},He={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>He.nameMapping[e]},c0={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>c0.nameMapping[e]},Be=class{constructor(t){w(this,"name");w(this,"curls");w(this,"directions");w(this,"weights");w(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,o){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,o])}direction(t,n,o){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,o])}weight(t,n){this.weights[t]=n;let o=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/o)}matchAgainst(t,n){let o=0;for(let r in t){let s=t[r],A=this.curls[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}for(let r in n){let s=n[r],A=this.directions[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}return o/10}};var{thumb:fe,index:Pe,middle:ke,ring:A2,pinky:a2}=G0,{none:me,half:RA,full:pe}=He,{verticalUp:T2,verticalDown:Ki,horizontalLeft:_5,horizontalRight:MA,diagonalUpRight:PA,diagonalUpLeft:v2,diagonalDownRight:Ji,diagonalDownLeft:Qi}=c0,Ge=new Be("thumbs up");Ge.curl(fe,me,1);Ge.direction(fe,T2,1);Ge.direction(fe,v2,.25);Ge.direction(fe,PA,.25);for(let e of[G0.index,G0.middle,G0.ring,G0.pinky])Ge.curl(e,pe,1),Ge.direction(e,_5,1),Ge.direction(e,MA,1);var h0=new Be("victory");h0.curl(fe,RA,.5);h0.curl(fe,me,.5);h0.direction(fe,T2,1);h0.direction(fe,v2,1);h0.curl(Pe,me,1);h0.direction(Pe,T2,.75);h0.direction(Pe,v2,1);h0.curl(ke,me,1);h0.direction(ke,T2,1);h0.direction(ke,v2,.75);h0.curl(A2,pe,1);h0.direction(A2,T2,.2);h0.direction(A2,v2,1);h0.direction(A2,_5,.2);h0.curl(a2,pe,1);h0.direction(a2,T2,.2);h0.direction(a2,v2,1);h0.direction(a2,_5,.2);h0.weight(Pe,2);h0.weight(ke,2);var Ve=new Be("point");Ve.curl(fe,pe,1);Ve.curl(Pe,me,.5);Ve.curl(ke,pe,.5);Ve.curl(A2,pe,.5);Ve.curl(a2,pe,.5);Ve.weight(Pe,2);Ve.weight(ke,2);var Ze=new Be("middle finger");Ze.curl(fe,me,1);Ze.curl(Pe,pe,.5);Ze.curl(ke,pe,.5);Ze.curl(A2,pe,.5);Ze.curl(a2,pe,.5);Ze.weight(Pe,2);Ze.weight(ke,2);var R2=new Be("open palm");R2.curl(fe,me,.75);R2.curl(Pe,me,.75);R2.curl(ke,me,.75);R2.curl(A2,me,.75);R2.curl(a2,me,.75);var zn=[Ge,h0,Ve,Ze,R2];var kA=.7,i2={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function Sn(e,t,n,o){let r=(t-o)/(e-n),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function In(e,t){if(!e||!t)return[0,0];let n=Sn(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let o=Sn(e[1],e[2],t[1],t[2]);return[n,o]}function jn(e,t=1){let n=0,o=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?o=1*t:r=1*t,[n,o,r]}function wA(e,t,n){let o=e[0]-t[0],r=e[0]-n[0],s=t[0]-n[0],A=e[1]-t[1],a=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],x=e[2]-n[2],i=t[2]-n[2],y=Math.sqrt(o*o+A*A+c*c),d=Math.sqrt(r*r+a*a+x*x),m=Math.sqrt(s*s+l*l+i*i),f=(m*m+y*y-d*d)/(2*m*y);f>1?f=1:f<-1&&(f=-1);let u=Math.acos(f);u=57.2958*u%180;let g;return u>i2.NO_CURL_START_LIMIT?g=He.none:u>i2.HALF_CURL_START_LIMIT?g=He.half:g=He.full,g}function Nn(e,t,n,o){let r;return o===Math.abs(e)?e>0?r=c0.horizontalLeft:r=c0.horizontalRight:o===Math.abs(t)?t>0?r=c0.horizontalLeft:r=c0.horizontalRight:n>0?r=c0.horizontalLeft:r=c0.horizontalRight,r}function On(e,t,n,o){let r;return o===Math.abs(e)?e<0?r=c0.verticalDown:r=c0.verticalUp:o===Math.abs(t)?t<0?r=c0.verticalDown:r=c0.verticalUp:n<0?r=c0.verticalDown:r=c0.verticalUp,r}function EA(e,t,n,o,r,s,A,a){let l,c=On(e,t,n,o),x=Nn(r,s,A,a);return c===c0.verticalUp?x===c0.horizontalLeft?l=c0.diagonalUpLeft:l=c0.diagonalUpRight:x===c0.horizontalLeft?l=c0.diagonalDownLeft:l=c0.diagonalDownRight,l}function zA(e,t,n,o){let r=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],x=Math.max(Math.abs(r),Math.abs(s),Math.abs(A)),i=Math.max(Math.abs(a),Math.abs(l),Math.abs(c)),y=0,d=0,m=0,f=i/(x+1e-5);f>1.5?y+=i2.DISTANCE_VOTE_POWER:f>.66?d+=i2.DISTANCE_VOTE_POWER:m+=i2.DISTANCE_VOTE_POWER;let u=Math.sqrt(r*r+a*a),g=Math.sqrt(s*s+l*l),T=Math.sqrt(A*A+c*c),p=Math.max(u,g,T),b=e[0],k=e[1],P=n[0],I=n[1];p===u?(P=n[0],I=n[1]):p===T&&(b=t[0],k=t[1]);let Z=In([b,k],[P,I]),$=jn(Z,i2.TOTAL_ANGLE_VOTE_POWER);y+=$[0],d+=$[1],m+=$[2];for(let t0 of o){let n0=jn(t0,i2.SINGLE_ANGLE_VOTE_POWER);y+=n0[0],d+=n0[1],m+=n0[2]}let A0;return y===Math.max(y,d,m)?A0=On(l,a,c,i):m===Math.max(d,m)?A0=Nn(s,r,A,x):A0=EA(l,a,c,i,s,r,A,x),A0}function Ln(e){let t=[],n=[],o=[],r=[];if(!e)return{curls:o,directions:r};for(let s of G0.all){let A=G0.getPoints(s),a=[],l=[];for(let c of A){let x=e[c[0]],i=e[c[1]],y=In(x,i),d=y[0],m=y[1];a.push(d),l.push(m)}t.push(a),n.push(l)}for(let s of G0.all){let A=s===G0.thumb?1:0,a=G0.getPoints(s),l=e[a[A][0]],c=e[a[A+1][1]],x=e[a[3][1]],i=wA(l,c,x),y=zA(l,c,x,t[s].slice(A));o[s]=i,r[s]=y}return{curls:o,directions:r}}function Et(e){if(!e||e.length===0)return null;let t=Ln(e),n={};for(let o of G0.all)n[G0.getName(o)]={curl:He.getName(t.curls[o]),direction:c0.getName(t.directions[o])};return n}function Cn(e){let t=[];if(!e||e.length===0)return t;let n=Ln(e);for(let o of zn){let r=o.matchAgainst(n.curls,n.directions);r>=kA&&t.push({name:o.name,confidence:r})}return t}var Wn=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&&o&&r&&o.position[1]l.part==="leftShoulder"),a=e[n].keypoints.find(l=>l.part==="rightShoulder");A&&a&&Math.abs(A.positionRaw[1]-a.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${A.position[1]>a.position[1]?"left":"right"}`})}return t},Dn=e=>{if(!e)return[];let t=[];for(let n=0;n450){let o=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),r=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(o/r)<=.15?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${o<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 a=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]));a>10&&t.push({face:n,gesture:`mouth ${Math.trunc(a)}% open`});let l=e[n].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:n,gesture:`head ${l<0?"up":"down"}`})}return t},Fn=e=>{var n,o,r,s;if(!e)return[];let t=[];for(let A=0;A.06||u>.06)&&(d=!1),f>u?u>.04&&t.push({iris:A,gesture:"looking right"}):f>.04&&t.push({iris:A,gesture:"looking left"});let g=Math.abs(e[A].mesh[145][1]-e[A].annotations.rightEyeIris[0][1])/e[A].box[3],T=Math.abs(e[A].mesh[374][1]-e[A].annotations.leftEyeIris[0][1])/e[A].box[3];(T<.01||g<.01||T>.022||g>.022)&&(d=!1),(T<.01||g<.01)&&t.push({iris:A,gesture:"looking down"}),(T>.022||g>.022)&&t.push({iris:A,gesture:"looking up"}),d&&t.push({iris:A,gesture:"looking center"})}return t},Bn=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=o.reduce((A,a)=>(A.position[2]||0)<(a.position[2]||0)?A:a);t.push({hand:n,gesture:`${r.name} forward`});let s=o.reduce((A,a)=>A.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:o,palmLandmarks:r,confidence:e.confidence}}function St(e,t=1.5){let n=D2(e),o=zt(e),r=[t*o[0]/2,t*o[1]/2],s=[n[0]-r[0],n[1]-r[1]],A=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function jt(e){let t=D2(e),n=zt(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],A=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function jA(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Xn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return jA(n)}var Hn=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function qe(e,t){let n=0;for(let o=0;o[A.x,A.y]),this.anchorsTensor=W.tensor2d(this.anchors),this.inputSize=((s=(r=(o=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:o[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=W.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=W.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=W.slice(t,[0,0],[-1,2]),n.boxSizes=W.slice(t,[0,2],[-1,2]),n.div=W.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=W.add(n.div,this.anchorsTensor),n.halfBoxSizes=W.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=W.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=W.mul(n.sub,this.inputSizeTensor),n.add=W.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=W.mul(n.add,this.inputSizeTensor);let o=W.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>W.dispose(n[r])),o}normalizeLandmarks(t,n){let o={};o.reshape=W.reshape(t,[-1,7,2]),o.div=W.div(o.reshape,this.inputSizeTensor),o.landmarks=W.add(o.div,this.anchors[n]?this.anchors[n]:0);let r=W.mul(o.landmarks,this.inputSizeTensor);return Object.keys(o).forEach(s=>W.dispose(o[s])),r}async predict(t,n){var a;let o={};o.resize=W.image.resizeBilinear(t,[this.inputSize,this.inputSize]),o.div=W.div(o.resize,C.tf127),o.image=W.sub(o.div,C.tf1),o.batched=this.model.execute(o.image),o.predictions=W.squeeze(o.batched),o.slice=W.slice(o.predictions,[0,0],[-1,1]),o.sigmoid=W.sigmoid(o.slice),o.scores=W.squeeze(o.sigmoid);let r=await o.scores.data();o.boxes=W.slice(o.predictions,[0,1],[-1,4]),o.norm=this.normalizeBoxes(o.boxes),o.nms=await W.image.nonMaxSuppressionAsync(o.norm,o.scores,3*(((a=n.hand)==null?void 0:a.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let s=await o.nms.array(),A=[];for(let l of s){let c={};c.box=W.slice(o.norm,[l,0],[1,-1]),c.slice=W.slice(o.predictions,[l,5],[1,14]),c.norm=this.normalizeLandmarks(c.slice,l),c.palmLandmarks=W.reshape(c.norm,[-1,2]);let x=await c.box.data(),i=x.slice(0,2),y=x.slice(2,4),d=await c.palmLandmarks.array(),m={startPoint:i,endPoint:y,palmLandmarks:d,confidence:r[l]},f=qn(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);A.push(f),Object.keys(c).forEach(u=>W.dispose(c[u]))}return Object.keys(o).forEach(l=>W.dispose(o[l])),A}};var $0=V(G());var LA=5,Jn=1.65,Qn=[0,5,9,13,17,1,2],CA=0,WA=2,_n=0,Nt=class{constructor(t,n){w(this,"handDetector");w(this,"handPoseModel");w(this,"inputSize");w(this,"storedBoxes");w(this,"skipped");w(this,"detectedHands");var o,r,s;this.handDetector=t,this.handPoseModel=n,this.inputSize=((s=(r=(o=this.handPoseModel)==null?void 0:o.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(A=>A[0]),o=t.map(A=>A[1]),r=[Math.min(...n),Math.min(...o)],s=[Math.max(...n),Math.max(...o)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let o=t.map(s=>t1([...s,1],n)),r=this.calculateLandmarksBoundingBox(o);return St(jt(r),LA)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),o=St(jt(n),Jn);o.palmLandmarks=[];for(let r=0;r[A[0]*(d[0]-this.inputSize/2),A[1]*(d[1]-this.inputSize/2),A[2]*d[2]]),l=e1(o,[0,0]),c=a.map(d=>[...t1(d,l),d[2]]),x=Un(r),i=[...D2(n),1],y=[qe(i,x[0]),qe(i,x[1])];return c.map(d=>[Math.trunc(d[0]+y[0]),Math.trunc(d[1]+y[1]),Math.trunc(d[2])])}async estimateHands(t,n){let o=!1,r,s=(n.hand.skipTime||0)>v()-_n,A=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&s&&A?this.skipped++:(r=await this.handDetector.predict(t,n),this.skipped=0),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&&(o=!0));let a=[];for(let l=0;l=n.hand.minConfidence/4){let k=$0.reshape(p,[-1,3]),P=await k.array();$0.dispose(p),$0.dispose(k);let I=this.transformRawCoords(P,f,x,m),B=this.getBoxForHandLandmarks(I);this.storedBoxes[l]={...B,confidence:b};let _={landmarks:I,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:B.startPoint,bottomRight:B.endPoint}};a.push(_)}else this.storedBoxes[l]=null;$0.dispose(p)}else{let x=St(jt(c),Jn),i={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:x.startPoint,bottomRight:x.endPoint},landmarks:[]};a.push(i)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=a.length,a.length>n.hand.maxDetected&&(a.length=n.hand.maxDetected),a}};var $n={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},l2,c2,n1;function FA(){let e=l2?new It(l2):void 0;e&&c2&&(n1=new Nt(e,c2))}async function o1(e,t){n1||FA();let n=await n1.estimateHands(e,t);if(!n)return[];let o=[];for(let r=0;rn[r].landmarks[i]);let A=n[r].landmarks,a=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(A&&A.length>0){for(let x of A)x[0]a[2]&&(a[2]=x[0]),x[1]>a[3]&&(a[3]=x[1]);a[2]-=a[0],a[3]-=a[1],l=[a[0]/(e.shape[2]||0),a[1]/(e.shape[1]||0),a[2]/(e.shape[2]||0),a[3]/(e.shape[1]||0)]}else a=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=Et(A);o.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:a,boxRaw:l,keypoints:A,annotations:s,landmarks:c})}return o}async function eo(e){var t;return R.initial&&(l2=null),l2?e.debug&&h("cached model:",l2.modelUrl):l2=await O((t=e.hand.detector)==null?void 0:t.modelPath),l2}async function to(e){var t;return R.initial&&(c2=null),c2?e.debug&&h("cached model:",c2.modelUrl):c2=await O((t=e.hand.skeleton)==null?void 0:t.modelPath),c2}var Q=V(G());var p0=[null,null],BA=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],Xe=[[0,0],[0,0]],HA=["hand","fist","pinch","point","face","tip","pinchtip"],oo=4,ro=1.6,GA=512,VA=1.4,Ot=Number.MAX_SAFE_INTEGER,r1=0,we=[0,0],m0={boxes:[],hands:[]},so={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function Ao(e){var t;if(R.initial&&(p0[0]=null),p0[0])e.debug&&h("cached model:",p0[0].modelUrl);else{_2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),p0[0]=await O((t=e.hand.detector)==null?void 0:t.modelPath);let n=p0[0].executor?Object.values(p0[0].modelSignature.inputs):void 0;Xe[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,Xe[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[0]}async function ao(e){var t;if(R.initial&&(p0[1]=null),p0[1])e.debug&&h("cached model:",p0[1].modelUrl);else{p0[1]=await O((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=p0[1].executor?Object.values(p0[1].modelSignature.inputs):void 0;Xe[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,Xe[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[1]}async function ZA(e,t){let n=[];if(!e||!p0[0])return n;let o={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,GA),A=Math.round(s*r/8)*8;o.resize=Q.image.resizeBilinear(e,[s,A]),o.cast=Q.cast(o.resize,"int32"),[o.rawScores,o.rawBoxes]=await p0[0].executeAsync(o.cast,BA),o.boxes=Q.squeeze(o.rawBoxes,[0,2]),o.scores=Q.squeeze(o.rawScores,[0]);let a=Q.unstack(o.scores,1);Q.dispose(a[oo]),a.splice(oo,1),o.filtered=Q.stack(a,1),Q.dispose(a),o.max=Q.max(o.filtered,1),o.argmax=Q.argMax(o.filtered,1);let l=0;o.nms=await Q.image.nonMaxSuppressionAsync(o.boxes,o.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let c=await o.nms.data(),x=await o.max.data(),i=await o.argmax.data();for(let y of Array.from(c)){let d=Q.slice(o.boxes,y,1),m=await d.data();Q.dispose(d);let f=[m[1],m[0],m[3]-m[1],m[2]-m[0]],u=at(f,VA),g=[Math.trunc(f[0]*we[0]),Math.trunc(f[1]*we[1]),Math.trunc(f[2]*we[0]),Math.trunc(f[3]*we[1])],T=x[y],p=HA[i[y]],b={id:l++,score:T,box:g,boxRaw:u,label:p};n.push(b)}return Object.keys(o).forEach(y=>Q.dispose(o[y])),n.sort((y,d)=>d.score-y.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function s1(e,t,n){let o={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&p0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=Q.image.cropAndResize(e,[s],[0],[Xe[1][0],Xe[1][1]],"bilinear"),r.div=Q.div(r.crop,C.tf255),[r.score,r.keypoints]=p0[1].execute(r.div,["Identity_1","Identity"]);let A=(await r.score.data())[0],a=(100-Math.trunc(100/(1+Math.exp(A))))/100;if(a>=(n.hand.minConfidence||0)){o.fingerScore=a,r.reshaped=Q.reshape(r.keypoints,[-1,3]);let x=(await r.reshaped.array()).map(i=>[i[0]/Xe[1][1],i[1]/Xe[1][0],i[2]||0]).map(i=>[i[0]*t.boxRaw[2],i[1]*t.boxRaw[3],i[2]||0]);o.keypoints=x.map(i=>[we[0]*(i[0]+t.boxRaw[0]),we[1]*(i[1]+t.boxRaw[1]),i[2]||0]),o.landmarks=Et(o.keypoints);for(let i of Object.keys(so))o.annotations[i]=so[i].map(y=>o.landmarks&&o.keypoints[y]?o.keypoints[y]:null)}Object.keys(r).forEach(l=>Q.dispose(r[l]))}return o}async function A1(e,t){var r,s;if(!((r=p0[0])!=null&&r.executor)||!((s=p0[1])!=null&&s.executor)||!p0[0].inputs[0].shape||!p0[1].inputs[0].shape)return[];we=[e.shape[2]||0,e.shape[1]||0],Ot++;let n=(t.hand.skipTime||0)>v()-r1,o=Ot<(t.hand.skipFrames||0);return t.skipAllowed&&n&&o?m0.hands:new Promise(async A=>{let a=3*(t.hand.skipTime||0)>v()-r1,l=Ot<3*(t.hand.skipFrames||0);t.skipAllowed&&m0.hands.length===t.hand.maxDetected?m0.hands=await Promise.all(m0.boxes.map(x=>s1(e,x,t))):t.skipAllowed&&a&&l&&m0.hands.length>0?m0.hands=await Promise.all(m0.boxes.map(x=>s1(e,x,t))):(m0.boxes=await ZA(e,t),r1=v(),m0.hands=await Promise.all(m0.boxes.map(x=>s1(e,x,t))),Ot=0);let c=[...m0.boxes];if(m0.boxes.length=0,t.cacheSensitivity>0)for(let x=0;x.05&&i.box[3]/(e.shape[1]||1)>.05&&m0.hands[x].fingerScore&&m0.hands[x].fingerScore>(t.hand.minConfidence||0)){let y=at(i.box,ro),d=at(i.boxRaw,ro);m0.boxes.push({...c[x],box:y,boxRaw:d})}}for(let x=0;x({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var F2={};ze(F2,{connected:()=>Ct,horizontal:()=>a1,kpt:()=>Lt,relative:()=>l1,vertical:()=>i1});var Lt=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],a1=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],i1=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],l1=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],Ct={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var z=Te(),c1=0;function lo(e,t){var A,a,l,c,x,i,y,d,m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0;let n=v();if(!e)return Te();let o=Date.now()-e.timestamp,r=o<1e3?8-Math.log(o+1):1;if(e.canvas&&(z.canvas=e.canvas),e.error&&(z.error=e.error),!z.body||e.body.length!==z.body.length)z.body=JSON.parse(JSON.stringify(e.body));else for(let M=0;M((r-1)*z.body[M].box[q]+H)/r),C0=e.body[M].boxRaw.map((H,q)=>((r-1)*z.body[M].boxRaw[q]+H)/r),x0=e.body[M].keypoints.map((H,q)=>{var U0,y0,Ee,k2,x2,z1,S1,j1,I1;return{score:H.score,part:H.part,position:[z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].position[0]||0)+(H.position[0]||0))/r:H.position[0],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].position[1]||0)+(H.position[1]||0))/r:H.position[1],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].position[2]||0)+(H.position[2]||0))/r:H.position[2]],positionRaw:[z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].positionRaw[0]||0)+(H.positionRaw[0]||0))/r:H.positionRaw[0],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].positionRaw[1]||0)+(H.positionRaw[1]||0))/r:H.positionRaw[1],z.body[M].keypoints[q]?((r-1)*(z.body[M].keypoints[q].positionRaw[2]||0)+(H.positionRaw[2]||0))/r:H.positionRaw[2]],distance:[z.body[M].keypoints[q]?((r-1)*(((U0=z.body[M].keypoints[q].distance)==null?void 0:U0[0])||0)+(((y0=H.distance)==null?void 0:y0[0])||0))/r:(Ee=H.distance)==null?void 0:Ee[0],z.body[M].keypoints[q]?((r-1)*(((k2=z.body[M].keypoints[q].distance)==null?void 0:k2[1])||0)+(((x2=H.distance)==null?void 0:x2[1])||0))/r:(z1=H.distance)==null?void 0:z1[1],z.body[M].keypoints[q]?((r-1)*(((S1=z.body[M].keypoints[q].distance)==null?void 0:S1[2])||0)+(((j1=H.distance)==null?void 0:j1[2])||0))/r:(I1=H.distance)==null?void 0:I1[2]]}}),K={},E={connected:{}};(A=t.body.modelPath)!=null&&A.includes("efficientpose")?E=ct:(a=t.body.modelPath)!=null&&a.includes("blazepose")?E=st:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(E=F2);for(let[H,q]of Object.entries(E.connected)){let U0=[];for(let y0=0;y0x2.part===q[y0]),k2=x0.find(x2=>x2.part===q[y0+1]);Ee&&k2&&U0.push([Ee.position,k2.position])}K[H]=U0}z.body[M]={...e.body[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.hand||e.hand.length!==z.hand.length)z.hand=JSON.parse(JSON.stringify(e.hand));else for(let M=0;M((r-1)*z.hand[M].box[H]+E)/r),C0=e.hand[M].boxRaw.map((E,H)=>((r-1)*z.hand[M].boxRaw[H]+E)/r);z.hand[M].keypoints.length!==e.hand[M].keypoints.length&&(z.hand[M].keypoints=e.hand[M].keypoints);let x0=e.hand[M].keypoints&&e.hand[M].keypoints.length>0?e.hand[M].keypoints.map((E,H)=>E.map((q,U0)=>((r-1)*(z.hand[M].keypoints[H][U0]||1)+(q||0))/r)):[],K={};if(Object.keys(z.hand[M].annotations).length!==Object.keys(e.hand[M].annotations).length)z.hand[M].annotations=e.hand[M].annotations,K=z.hand[M].annotations;else if(e.hand[M].annotations)for(let E of Object.keys(e.hand[M].annotations))K[E]=(i=(x=(c=e.hand[M])==null?void 0:c.annotations)==null?void 0:x[E])!=null&&i[0]?e.hand[M].annotations[E].map((H,q)=>H.map((U0,y0)=>((r-1)*z.hand[M].annotations[E][q][y0]+U0)/r)):null;z.hand[M]={...e.hand[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.face||e.face.length!==z.face.length)z.face=JSON.parse(JSON.stringify(e.face));else for(let M=0;M((r-1)*z.face[M].box[E]+K)/r),C0=e.face[M].boxRaw.map((K,E)=>((r-1)*z.face[M].boxRaw[E]+K)/r),x0=e.face[M].annotations;if(Object.keys(z.face[M].annotations).length!==Object.keys(e.face[M].annotations).length)z.face[M].annotations=e.face[M].annotations,x0=z.face[M].annotations;else if(e.face[M].annotations)for(let K of Object.keys(e.face[M].annotations))x0[K]=(m=(d=(y=e.face[M])==null?void 0:y.annotations)==null?void 0:d[K])!=null&&m[0]?e.face[M].annotations[K].map((E,H)=>E.map((q,U0)=>((r-1)*z.face[M].annotations[K][H][U0]+q)/r)):null;if(e.face[M].rotation){let K={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};K.matrix=(f=e.face[M].rotation)==null?void 0:f.matrix,K.angle={roll:((r-1)*(((g=(u=z.face[M].rotation)==null?void 0:u.angle)==null?void 0:g.roll)||0)+(((p=(T=e.face[M].rotation)==null?void 0:T.angle)==null?void 0:p.roll)||0))/r,yaw:((r-1)*(((k=(b=z.face[M].rotation)==null?void 0:b.angle)==null?void 0:k.yaw)||0)+(((I=(P=e.face[M].rotation)==null?void 0:P.angle)==null?void 0:I.yaw)||0))/r,pitch:((r-1)*(((_=(B=z.face[M].rotation)==null?void 0:B.angle)==null?void 0:_.pitch)||0)+((($=(Z=e.face[M].rotation)==null?void 0:Z.angle)==null?void 0:$.pitch)||0))/r},K.gaze={bearing:((r-1)*(((A0=z.face[M].rotation)==null?void 0:A0.gaze.bearing)||0)+(((t0=e.face[M].rotation)==null?void 0:t0.gaze.bearing)||0))/r,strength:((r-1)*(((n0=z.face[M].rotation)==null?void 0:n0.gaze.strength)||0)+(((j0=e.face[M].rotation)==null?void 0:j0.gaze.strength)||0))/r},z.face[M]={...e.face[M],rotation:K,box:T0,boxRaw:C0,annotations:x0}}else z.face[M]={...e.face[M],box:T0,boxRaw:C0,annotations:x0}}if(!z.object||e.object.length!==z.object.length)z.object=JSON.parse(JSON.stringify(e.object));else for(let M=0;M((r-1)*z.object[M].box[K]+x0)/r),C0=e.object[M].boxRaw.map((x0,K)=>((r-1)*z.object[M].boxRaw[K]+x0)/r);z.object[M]={...e.object[M],box:T0,boxRaw:C0}}if(e.persons){let M=e.persons;if(!z.persons||M.length!==z.persons.length)z.persons=JSON.parse(JSON.stringify(M));else for(let T0=0;T0((r-1)*z.persons[T0].box[x0]+C0)/r)}e.gesture&&(z.gesture=e.gesture),z.width=e.width,z.height=e.height;let s=v();return c1=R.perfadd?c1+Math.round(s-n):Math.round(s-n),e.performance&&(z.performance={...e.performance,interpolate:c1}),z}var s0=V(G());var O0;async function d1(e){return!O0||R.initial?O0=await O(e.segmentation.modelPath):e.debug&&h("cached model:",O0.modelUrl),O0}async function co(e,t){var r;if(O0||(O0=await d1(t)),!(O0!=null&&O0.executor)||!((r=O0==null?void 0:O0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=s0.image.resizeBilinear(e,[O0.inputs[0].shape?O0.inputs[0].shape[1]:0,O0.inputs[0].shape?O0.inputs[0].shape[2]:0],!1),n.norm=s0.div(n.resize,C.tf255),n.res=O0.execute(n.norm),n.squeeze=s0.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=s0.unstack(n.squeeze,2),n.fg=s0.softmax(n.fgRaw),n.mul=s0.mul(n.fg,C.tf255),n.expand=s0.expandDims(n.mul,2),n.output=s0.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let o;switch(t.segmentation.mode||"default"){case"default":n.input=s0.squeeze(e),n.concat=s0.concat([n.input,n.output],-1),o=s0.cast(n.concat,"int32");break;case"alpha":o=s0.cast(n.output,"int32");break;default:o=s0.tensor(0)}return Object.keys(n).forEach(s=>s0.dispose(n[s])),o}var Wt={};ze(Wt,{distance:()=>x1,find:()=>UA,similarity:()=>XA});function x1(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let o=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(o-n);return Math.max(Math.min(s,1),0)};function XA(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let o=x1(e,t,n);return yo(o,n.order||2,n.min||0,n.max||1)}function UA(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let o=Number.MAX_SAFE_INTEGER,r=-1;for(let A=0;AV2,validateModel:()=>Zt});var B2=V(G());var Ue=V(G());var fo=.005,ee={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function y1(e){for(let t of a1){let n=e.keypoints.findIndex(r=>r.part===t[0]),o=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[0]r&&r.part===t[0]),o=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),s=e.keypoints.findIndex(c=>c&&c.part===n[0]),A=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[s]||!e.keypoints[A])continue;let a=e.keypoints[o]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[o].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[o].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(a[0]>a[1]||l[0]>l[1]){let c=e.keypoints[o];e.keypoints[o]=e.keypoints[r],e.keypoints[r]=c}}}function mo(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Ue.pad(e,ee.padding),n.resize=Ue.image.resizeBilinear(n.pad,[t,t]);let o=Ue.cast(n.resize,"int32");return Object.keys(n).forEach(A=>Ue.dispose(n[A])),o}function uo(e,t){e.keypoints=e.keypoints.filter(o=>o==null?void 0:o.position);for(let o of e.keypoints)o.position=[o.position[0]*(t[0]+ee.padding[2][0]+ee.padding[2][1])/t[0]-ee.padding[2][0],o.position[1]*(t[1]+ee.padding[1][0]+ee.padding[1][1])/t[1]-ee.padding[1][0]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1]];let n=Oe(e.keypoints.map(o=>o.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var b0,Dt=0,f1=Number.MAX_SAFE_INTEGER,d2={boxes:[],bodies:[],last:0};async function ho(e){var t;return R.initial&&(b0=null),b0?e.debug&&h("cached model:",b0.modelUrl):(_2(["size"],e),b0=await O(e.body.modelPath)),Dt=b0!=null&&b0.executor&&((t=b0==null?void 0:b0.inputs)!=null&&t[0].shape)?b0.inputs[0].shape[2]:0,Dt<64&&(Dt=256),B2.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&B2.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),b0}function KA(e,t,n){let o=e[0][0],r=[],s=0;for(let x=0;xt.body.minConfidence){let i=[o[x][1],o[x][0]];r.push({score:Math.round(100*s)/100,part:Lt[x],positionRaw:i,position:[Math.round((n.shape[2]||0)*i[0]),Math.round((n.shape[1]||0)*i[1])]})}s=r.reduce((x,i)=>i.score>x?i.score:x,0);let A=[],a=Oe(r.map(x=>x.position),[n.shape[2],n.shape[1]]),l={};for(let[x,i]of Object.entries(Ct)){let y=[];for(let d=0;du.part===i[d]),f=r.find(u=>u.part===i[d+1]);m&&f&&m.score>(t.body.minConfidence||0)&&f.score>(t.body.minConfidence||0)&&y.push([m.position,f.position])}l[x]=y}let c={id:0,score:s,box:a.box,boxRaw:a.boxRaw,keypoints:r,annotations:l};return y1(c),A.push(c),A}function JA(e,t,n){let o=[];for(let r=0;rt.body.minConfidence){let a=[];for(let y=0;y<17;y++){let d=s[3*y+2];if(d>t.body.minConfidence){let m=[s[3*y+1],s[3*y+0]];a.push({part:Lt[y],score:Math.round(100*d)/100,positionRaw:m,position:[Math.round((n.shape[2]||0)*m[0]),Math.round((n.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],c=[Math.trunc(l[0]*(n.shape[2]||0)),Math.trunc(l[1]*(n.shape[1]||0)),Math.trunc(l[2]*(n.shape[2]||0)),Math.trunc(l[3]*(n.shape[1]||0))],x={};for(let[y,d]of Object.entries(Ct)){let m=[];for(let f=0;fT.part===d[f]),g=a.find(T=>T.part===d[f+1]);u&&g&&u.score>(t.body.minConfidence||0)&&g.score>(t.body.minConfidence||0)&&m.push([u.position,g.position])}x[y]=m}let i={id:r,score:A,box:c,boxRaw:l,keypoints:[...a],annotations:x};y1(i),o.push(i)}}return o.sort((r,s)=>s.score-r.score),o.length>t.body.maxDetected&&(o.length=t.body.maxDetected),o}async function m1(e,t){var r;if(!(b0!=null&&b0.executor)||!((r=b0==null?void 0:b0.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(d2.boxes.length=0),f1++;let n=(t.body.skipTime||0)>v()-d2.last,o=f1<(t.body.skipFrames||0);return t.skipAllowed&&n&&o?d2.bodies:new Promise(async s=>{let A={};f1=0,A.input=po(e,Dt),A.res=b0==null?void 0:b0.execute(A.input),d2.last=v();let a=await A.res.array();d2.bodies=A.res.shape[2]===17?KA(a,t,e):JA(a,t,e);for(let l of d2.bodies)uo(l,[e.shape[2]||1,e.shape[1]||1]),mo(l.keypoints);Object.keys(A).forEach(l=>B2.dispose(A[l])),s(d2.bodies)})}var S0=V(G());var ce,Ft=[],go=0,p1=Number.MAX_SAFE_INTEGER,Ht=0,Bt=2.5;async function To(e){if(!ce||R.initial){ce=await O(e.object.modelPath);let t=ce!=null&&ce.executor?Object.values(ce.modelSignature.inputs):void 0;Ht=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&h("cached model:",ce.modelUrl);return ce}async function QA(e,t,n){var c,x;let o=0,r=[],s=Ht;for(let i of[1,2,4]){let y=i*13,d=S0.squeeze(e.find(p=>p.shape[1]===y**2&&(p.shape[2]||0)===m2.length)),m=await d.array(),f=S0.squeeze(e.find(p=>p.shape[1]===y**2&&(p.shape[2]||0)(n.object.minConfidence||0)&&b!==61){let P=(.5+Math.trunc(p%y))/y,I=(.5+Math.trunc(p/y))/y,B=T[p].map(M=>M*(y/i/s)),[_,Z]=[P-Bt/i*B[0],I-Bt/i*B[1]],[$,A0]=[P+Bt/i*B[2]-_,I+Bt/i*B[3]-Z],t0=[_,Z,$,A0];t0=t0.map(M=>Math.max(0,Math.min(M,1)));let n0=[t0[0]*t[0],t0[1]*t[1],t0[2]*t[0],t0[3]*t[1]],j0={id:o++,score:Math.round(100*k)/100,class:b+1,label:m2[b].label,box:n0.map(M=>Math.trunc(M)),boxRaw:t0};r.push(j0)}}S0.dispose([d,f,u,g])}let A=r.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),a=r.map(i=>i.score),l=[];if(A&&A.length>0){let i=await S0.image.nonMaxSuppressionAsync(A,a,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);l=Array.from(await i.data()),S0.dispose(i)}return r=r.filter((i,y)=>l.includes(y)).sort((i,y)=>y.score-i.score),r}async function u1(e,t){if(!(ce!=null&&ce.executor))return[];let n=(t.object.skipTime||0)>v()-go,o=p1<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&Ft.length>0?(p1++,Ft):(p1=0,!R.kernels.includes("mod")||!R.kernels.includes("sparsetodense")?Ft:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=S0.image.resizeBilinear(e,[Ht,Ht],!1),a=S0.div(A,C.tf255),l=S0.transpose(a,[0,3,1,2]),c;t.object.enabled&&(c=ce.execute(l)),go=v();let x=await QA(c,s,t);Ft=x,S0.dispose([A,a,l,...c]),r(x)}))}var V0=V(G());var G2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],_A=G2.length,H2=G2.reduce((e,t,n)=>(e[t]=n,e),{}),$A=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],V7=$A.map(([e,t])=>[H2[e],H2[t]]),Ro=[["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 Mo(e){let t=e.reduce(({maxX:n,maxY:o,minX:r,minY:s},{position:{x:A,y:a}})=>({maxX:Math.max(n,A),maxY:Math.max(o,a),minX:Math.min(r,A),minY:Math.min(s,a)}),{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 Po(e,[t,n],[o,r]){let s=t/o,A=n/r,a=(c,x)=>({id:x,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/o,c.box[2]/r,c.box[3]/o],box:[Math.trunc(c.box[0]*A),Math.trunc(c.box[1]*s),Math.trunc(c.box[2]*A),Math.trunc(c.box[3]*s)],keypoints:c.keypoints.map(({score:i,part:y,position:d})=>({score:i,part:y,position:[Math.trunc(d.x*A),Math.trunc(d.y*s)],positionRaw:[d.x/o,d.y/o]})),annotations:{}});return e.map((c,x)=>a(c,x))}var Gt=class{constructor(t,n){w(this,"priorityQueue");w(this,"numberOfElements");w(this,"getElementValue");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 ko(e,t,n,o){let r=n-e,s=o-t;return r*r+s*s}function T1(e,t){return{x:e.x+t.x,y:e.y+t.y}}var te,ta=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],Vt=1,M2=16,na=50**2;function wo(e,t,n,o,r,s,A=2){let a=g=>({y:s.get(g.y,g.x,e),x:s.get(g.y,g.x,s.shape[2]/2+e)}),l=(g,T,p)=>({y:g1(Math.round(g.y/M2),0,T-1),x:g1(Math.round(g.x/M2),0,p-1)}),[c,x]=o.shape,i=l(t.position,c,x),y=a(i),m=T1(t.position,y);for(let g=0;g[H2[y],H2[d]]),A=s.map(([,y])=>y),a=s.map(([y])=>y),l=t.shape[2],c=A.length,x=new Array(l),i=b1(e.part,M2,n);x[e.part.id]={score:e.score,part:G2[e.part.id],position:i};for(let y=c-1;y>=0;--y){let d=A[y],m=a[y];x[d]&&!x[m]&&(x[m]=wo(y,x[d],m,t,n,r))}for(let y=0;yt){a=!1;break}if(!a)break}return a}function sa(e,t){let[n,o,r]=t.shape,s=new Gt(n*o*r,({score:A})=>A);for(let A=0;A{var A;let s=(A=r[o])==null?void 0:A.position;return s?ko(n,t,s.y,s.x)<=na:!1})}function Aa(e,t){return t.reduce((o,{position:r,score:s},A)=>(Eo(e,r,A)||(o+=s),o),0)/t.length}function aa(e,t,n,o,r,s){let A=[],a=sa(s,t);for(;A.lengthd.score>s);let i=Aa(A,x),y=Mo(x);i>s&&A.push({keypoints:x,box:y,score:Math.round(100*i)/100})}return A}async function v1(e,t){if(!(te!=null&&te.executor))return[];let n=V0.tidy(()=>{if(!te.inputs[0].shape)return[];let A=V0.image.resizeBilinear(e,[te.inputs[0].shape[2],te.inputs[0].shape[1]]),a=V0.sub(V0.div(V0.cast(A,"float32"),127.5),1),c=te.execute(a,ta).map(x=>V0.squeeze(x,[0]));return c[1]=V0.sigmoid(c[1]),c}),o=await Promise.all(n.map(A=>A.buffer()));for(let A of n)V0.dispose(A);let r=aa(o[0],o[1],o[2],o[3],t.body.maxDetected,t.body.minConfidence);return te.inputs[0].shape?Po(r,[e.shape[1],e.shape[2]],[te.inputs[0].shape[2],te.inputs[0].shape[1]]):[]}async function zo(e){return!te||R.initial?te=await O(e.body.modelPath):e.debug&&h("cached model:",te.modelUrl),te}var F=V(G());var ve,ia=["fgr","pha","r1o","r2o","r3o","r4o"],g0={},M1=0;function Io(e){F.dispose([g0.r1i,g0.r2i,g0.r3i,g0.r4i,g0.downsample_ratio]),g0.r1i=F.tensor(0),g0.r2i=F.tensor(0),g0.r3i=F.tensor(0),g0.r4i=F.tensor(0),M1=e.segmentation.ratio||.5,g0.downsample_ratio=F.tensor(M1)}async function P1(e){return!ve||R.initial?ve=await O(e.segmentation.modelPath):e.debug&&h("cached model:",ve.modelUrl),Io(e),ve}var jo=e=>F.tidy(()=>{let t=F.squeeze(e,[0]),n=F.mul(t,C.tf255);return F.cast(n,"int32")});function R1(e,t){let n=e?jo(e):F.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),o=t?jo(t):F.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=F.concat([n,o],-1);return F.dispose([n,o]),r}function la(e){return F.tidy(()=>{let t={};return t.unstack=F.unstack(e,-1),t.concat=F.concat(t.unstack,1),t.split=F.split(t.concat,4,1),t.stack=F.concat(t.split,2),t.squeeze=F.squeeze(t.stack,[0]),t.expand=F.expandDims(t.squeeze,-1),t.add=F.add(t.expand,1),t.mul=F.mul(t.add,127.5),t.cast=F.cast(t.mul,"int32"),t.tile=F.tile(t.cast,[1,1,3]),t.alpha=F.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),F.concat([t.tile,t.alpha],-1)})}async function No(e,t){if(ve||(ve=await P1(t)),!(ve!=null&&ve.executor))return null;g0.src=F.div(e,255),M1!==t.segmentation.ratio&&Io(t);let[n,o,r,s,A,a]=await ve.executeAsync(g0,ia),l;switch(t.segmentation.mode||"default"){case"default":l=R1(n,o);break;case"alpha":l=R1(null,o);break;case"foreground":l=R1(n,null);break;case"state":l=la(r);break;default:l=F.tensor(0)}return F.dispose([g0.src,n,o,g0.r1i,g0.r2i,g0.r3i,g0.r4i]),[g0.r1i,g0.r2i,g0.r3i,g0.r4i]=[r,s,A,a],l}var z0=V(G());var L0;async function k1(e){return!L0||R.initial?L0=await O(e.segmentation.modelPath):e.debug&&h("cached model:",L0.modelUrl),L0}async function Lo(e,t){var r;if(L0||(L0=await k1(t)),!(L0!=null&&L0.executor)||!((r=L0==null?void 0:L0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=z0.image.resizeBilinear(e,[L0.inputs[0].shape?L0.inputs[0].shape[1]:0,L0.inputs[0].shape?L0.inputs[0].shape[2]:0],!1),n.norm=z0.div(n.resize,C.tf255),n.res=L0.execute(n.norm),n.squeeze=z0.squeeze(n.res,[0]),n.alpha=z0.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=z0.mul(n.alpha,C.tf255);let o;switch(t.segmentation.mode||"default"){case"default":n.input=z0.squeeze(e),n.concat=z0.concat([n.input,n.mul],-1),o=z0.cast(n.concat,"int32");break;case"alpha":o=z0.cast(n.mul,"int32");break;default:o=z0.tensor(0)}return Object.keys(n).forEach(s=>z0.dispose(n[s])),o}function Zt(e,t,n){var c,x;if(!t||!((c=e==null?void 0:e.config)!=null&&c.validateModels))return null;let o=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],A=[],a=t.modelUrl,l=t.executor;if((x=l==null?void 0:l.graph)!=null&&x.nodes)for(let i of Object.values(l.graph.nodes)){let y=i.op.toLowerCase();s.includes(y)||s.push(y)}else!l&&e.config.debug&&h("model not loaded",n);for(let i of s)!o.includes(i)&&!r.includes(i)&&!e.env.kernels.includes(i)&&!e.env.kernels.includes(i.replace("_",""))&&!e.env.kernels.includes(i.replace("native",""))&&!e.env.kernels.includes(i.replace("v2",""))&&A.push(i);return e.config.debug&&A.length>0&&h("model validation failed:",n,A),A.length>0?{name:n,missing:A,ops:s,url:a}:null}var V2=class{constructor(t){w(this,"instance");w(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,o=0;for(let s of Object.values(I0))t+=s.sizeFromManifest,n+=s.sizeLoadedWeights,o+=s.sizeDesired;let r=o>0?n/o:0;return{numLoadedModels:Object.values(I0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:o,modelStats:Object.values(I0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var o,r,s,A,a,l,c,x,i,y,d,m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0;R.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?w3(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((o=this.instance.config.face.antispoof)!=null&&o.enabled)&&!this.models.antispoof?_3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?nn(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?U3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((A=this.instance.config.face.emotion)!=null&&A.enabled)&&!this.models.emotion?V3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((a=this.instance.config.face.iris)!=null&&a.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?N3(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((c=this.instance.config.face.mesh)!=null&&c.enabled)&&!this.models.facemesh?D3(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((x=this.instance.config.face.gear)!=null&&x.enabled)&&!this.models.gear?An(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((i=this.instance.config.face.ssrnet)!=null&&i.enabled)&&!this.models.ssrnetage?dn(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((y=this.instance.config.face.ssrnet)!=null&&y.enabled)&&!this.models.ssrnetgender?mn(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((d=this.instance.config.face.mobilefacenet)!=null&&d.enabled)&&!this.models.mobilefacenet?gn(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?Pn(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((f=this.instance.config.body.modelPath)!=null&&f.includes("blazepose"))?i3(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?a3(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((u=this.instance.config.body.modelPath)!=null&&u.includes("efficientpose"))?f3(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((g=this.instance.config.body.modelPath)!=null&&g.includes("movenet"))?ho(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("posenet"))?zo(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(p=this.instance.config.hand.detector)==null?void 0:p.modelPath)!=null&&b.includes("handtrack"))?Ao(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((P=(k=this.instance.config.hand.detector)==null?void 0:k.modelPath)!=null&&P.includes("handtrack"))?ao(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((B=(I=this.instance.config.hand.detector)==null?void 0:I.modelPath)!=null&&B.includes("handdetect"))&&(n.handdetect=eo(this.instance.config),n.handskeleton=to(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((_=this.instance.config.object.modelPath)!=null&&_.includes("centernet"))?d3(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((Z=this.instance.config.object.modelPath)!=null&&Z.includes("nanodet"))?To(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&(($=this.instance.config.segmentation.modelPath)!=null&&$.includes("selfie"))?k1(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((A0=this.instance.config.segmentation.modelPath)!=null&&A0.includes("meet"))?d1(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((t0=this.instance.config.segmentation.modelPath)!=null&&t0.includes("rvm"))?P1(this.instance.config):null;for(let[n0,j0]of Object.entries(n))j0!=null&&j0.then&&j0.then(M=>this.models[n0]=M);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var o;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(o=this.models[n])==null?void 0:o.modelUrl:null}});for(let n of t){let o=Object.keys(I0).find(r=>r.startsWith(n.name));o&&(n.size=I0[o].sizeLoadedWeights,n.url=I0[o].url)}return t}loaded(){return this.list().filter(o=>o.loaded).map(o=>o.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let o=this.models[n];if(!o)continue;let r=Zt(this.instance,o,n);r&&t.push(r)}return t}};function Wo(e,t,n,o,r){var a,l,c,x,i,y;let s=0,A=[];for(let d of e){let m={id:s++,face:d,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)d.box[0]>b.box[0]&&d.box[0]b.box[1]&&d.box[1]+d.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(f.push(b[0],b[0]+b[2]),u.push(b[1],b[1]+b[3]))};g(m.face.box),g((x=m.body)==null?void 0:x.box),g((i=m.hands.left)==null?void 0:i.box),g((y=m.hands.right)==null?void 0:y.box);let T=Math.min(...f),p=Math.min(...u);m.box=[T,p,Math.max(...f)-T,Math.max(...u)-p],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),A.push(m)}return A}var d0=V(G());var qt=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -837,4 +837,4 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;async function fa(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(A=>A.blob()),n,o;switch(e.config.warmup){case"face":n=await t(qt);break;case"body":case"full":n=await t(Xt);break;default:n=null}if(n){let r=await createImageBitmap(n);o=await e.detect(r,e.config),r.close()}return o}async function ma(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+qt;break;case"full":case"body":n="data:image/jpeg;base64,"+Xt;break;default:n=""}let o;if(typeof Image!="undefined")o=new Image;else if(R.Image)o=new R.Image;else{t(void 0);return}o.onload=async()=>{let r=Ae(o.naturalWidth,o.naturalHeight);if(!r)h("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(o,0,0);let A=await e.image(r,!0),a=A.tensor?await e.detect(A.tensor,e.config):void 0;t(a)}},n?o.src=n:t(void 0)})}async function pa(e){let t=r=>Buffer.from(r,"base64"),n;e.config.warmup==="face"?n=t(qt):n=t(Xt);let o;if("node"in d0&&d0.getBackend()==="tensorflow"){let r=d0.node.decodeJpeg(n),s=d0.expandDims(r,0);e.tf.dispose(r),o=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&h("Warmup tfjs-node not loaded");return o}async function ua(e){let t;return typeof createImageBitmap=="function"?t=await fa(e):typeof Image!="undefined"||R.Canvas!==void 0?t=await ma(e):t=await pa(e),t}async function ha(e){var a,l,c,x;if(!d0.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=d0.getBackend(),n=d0.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;d0.env().set("ENGINE_COMPILE_ONLY",!0);let o=d0.engine().state.numTensors,r=[];for(let[i,f]of Object.entries(e.models.models)){if(!f)continue;let d=f!=null&&f.modelSignature&&((l=(a=f==null?void 0:f.inputs)==null?void 0:a[0])!=null&&l.shape)?[...f.inputs[0].shape]:[1,64,64,3],m=f!=null&&f.modelSignature&&((x=(c=f==null?void 0:f.inputs)==null?void 0:c[0])!=null&&x.dtype)?f.inputs[0].dtype:"float32";for(let u=0;ud0.dispose(T)):d0.dispose(u)}catch(u){e.config.debug&&h("compile fail model:",i)}d0.dispose(y)}let s=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&h("compile pass:",{models:r,kernels:s.length}),d0.env().set("ENGINE_COMPILE_ONLY",!1);let A=d0.engine().state.numTensors;A-o>0&&h("tensor leak:",A-o)}async function Do(e,t){await O2(e,!1);let n=v();return e.state="warmup",t&&(e.config=a0(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?Te():new Promise(async o=>{await e.models.load(),await ha(e);let r=await ua(e),s=v();e.config.debug&&h("warmup",e.config.warmup,Math.round(s-n),"ms"),e.emit("warmup"),o(r)})}var P2,Z2,q2,Ut,Ye,E1=class{constructor(t){w(this,"version");w(this,"config");w(this,"result");w(this,"state");w(this,"process");w(this,"tf");w(this,"env",R);w(this,"draw",rt);w(this,"match",Wt);w(this,"models");w(this,"events");w(this,"faceTriangulation");w(this,"faceUVMap");w(this,"performance");ue(this,P2,void 0);ue(this,Z2,void 0);ue(this,q2,void 0);w(this,"analyze",(...t)=>{if(!Y0(this,Z2))return;let n=this.tf.engine().state.numTensors,o=Y0(this,P2);Re(this,P2,n);let r=n-o;r!==0&&h(...t,r)});ue(this,Ut,t=>{if(!Y0(this,q2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof de.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});w(this,"webcam",new Q2);w(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});ue(this,Ye,{});let n=(de.version.tfjs||de.version_core).replace(/-(.*)/,"");Ke.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ke.modelBasePath=R.browser?"../models/":"file://models/",this.version=n5,Object.defineProperty(this,"version",{value:n5}),this.config=JSON.parse(JSON.stringify(Ke)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=a0(this.config,t)),X1(this.config),this.tf=de,this.state="idle",Re(this,P2,0),Re(this,Z2,!1),Re(this,q2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new V2(this),l5(),this.result=Te(),this.process={tensor:null,canvas:null},this.faceTriangulation=F3,this.faceUVMap=B3,Zt(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&h(`version: ${this.version}`),this.config.debug&&h(`tfjs version: ${this.tf.version["tfjs-core"]}`);let o=JSON.parse(JSON.stringify(this.env));delete o.kernels,delete o.initial,delete o.perfadd,this.config.debug&&h("environment:",o)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ke)),this.config.backend=t,e5(),R.initial=!0}validate(t){let n=Qt(Ke,t||this.config);return n.length===0&&(this.config=a0(this.config,t)),n}now(){return v()}image(t,n=!1){return K2(t,this.config,n)}async segmentation(t,n){var s,A,a;if(n&&(this.config=a0(this.config,n)),!this.config.segmentation.enabled)return null;let o=await K2(t,this.config);if(!o.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await No(o.tensor,this.config)),(A=this.config.segmentation.modelPath)!=null&&A.includes("meet")&&(r=await co(o.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("selfie")&&(r=await Lo(o.tensor,this.config)),de.dispose(o.tensor),r}compare(t,n){return q1(this.config,t,n)}async init(){await O2(this,!0),await this.tf.ready(),e5()}async load(t){this.state="load";let n=v(),o=Object.values(this.models.models).filter(A=>A).length;t&&(this.config=a0(this.config,t)),this.env.initial&&(await O2(this,!1)||h("error: backend check failed"),await de.ready(),this.env.browser&&(this.config.debug&&h("configuration:",this.config),this.config.debug&&h("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&h("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(A=>A).length!==o&&(this.models.validate(),this.emit("load"));let s=Math.trunc(v()-n);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return lo(t,this.config)}async warmup(t){let n=v(),o=await Do(this,t),r=v();return this.performance.warmup=Math.trunc(r-n),o}async profile(t,n){let o=await this.tf.profile(()=>this.detect(t,n)),r={},s=0;for(let a of o.kernels){let l=Number(a.kernelTimeMs)||0;r[a.name]?r[a.name]+=l:r[a.name]=l,s+=l}let A=[];Object.entries(r).forEach(a=>A.push({kernel:a[0],time:a[1],perc:0}));for(let a of A)a.perc=Math.round(1e3*a.time/s)/1e3,a.time=Math.round(1e3*a.time)/1e3;return A.sort((a,l)=>l.time-a.time),A.length=20,A}async detect(t,n){return this.state="detect",new Promise(async o=>{var u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;this.state="config";let r;this.config=a0(this.config,n),this.state="check";let s=Y0(this,Ut).call(this,t);s&&(h(s,t),this.emit("error"),o(Te(s)));let A=v();await this.load(),r=v(),this.state="image";let a=await K2(t,this.config);if(this.process=a,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Get Image:"),!a.tensor){this.config.debug&&h("could not convert input to tensor"),this.emit("error"),o(Te("could not convert input to tensor"));return}this.emit("image"),r=v(),this.config.skipAllowed=await Z1(this.config,a.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Check Changed:");let l=[],c=[],x=[],i=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?Q5(this,a.tensor):[],this.performance.face&&delete this.performance.face):(r=v(),l=this.config.face.enabled?await Q5(this,a.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let f=this.config.body.maxDetected===-1?a0(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((u=this.config.body.modelPath)!=null&&u.includes("posenet")?c=this.config.body.enabled?v1(a.tensor,f):[]:(T=this.config.body.modelPath)!=null&&T.includes("blazepose")?c=this.config.body.enabled?f5(a.tensor,f):[]:(g=this.config.body.modelPath)!=null&&g.includes("efficientpose")?c=this.config.body.enabled?T5(a.tensor,f):[]:(p=this.config.body.modelPath)!=null&&p.includes("movenet")&&(c=this.config.body.enabled?m1(a.tensor,f):[]),this.performance.body&&delete this.performance.body):(r=v(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?c=this.config.body.enabled?await v1(a.tensor,f):[]:(k=this.config.body.modelPath)!=null&&k.includes("blazepose")?c=this.config.body.enabled?await f5(a.tensor,f):[]:(P=this.config.body.modelPath)!=null&&P.includes("efficientpose")?c=this.config.body.enabled?await T5(a.tensor,f):[]:(N=this.config.body.modelPath)!=null&&N.includes("movenet")&&(c=this.config.body.enabled?await m1(a.tensor,f):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let d=this.config.hand.maxDetected===-1?a0(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((_=(V=this.config.hand.detector)==null?void 0:V.modelPath)!=null&&_.includes("handdetect")?x=this.config.hand.enabled?o1(a.tensor,d):[]:($=(Z=this.config.hand.detector)==null?void 0:Z.modelPath)!=null&&$.includes("handtrack")&&(x=this.config.hand.enabled?A1(a.tensor,d):[]),this.performance.hand&&delete this.performance.hand):(r=v(),(t0=(A0=this.config.hand.detector)==null?void 0:A0.modelPath)!=null&&t0.includes("handdetect")?x=this.config.hand.enabled?await o1(a.tensor,d):[]:(j0=(n0=this.config.hand.detector)==null?void 0:n0.modelPath)!=null&&j0.includes("handtrack")&&(x=this.config.hand.enabled?await A1(a.tensor,d):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((M=this.config.object.modelPath)!=null&&M.includes("nanodet")?i=this.config.object.enabled?u1(a.tensor,this.config):[]:(T0=this.config.object.modelPath)!=null&&T0.includes("centernet")&&(i=this.config.object.enabled?u5(a.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=v(),(C0=this.config.object.modelPath)!=null&&C0.includes("nanodet")?i=this.config.object.enabled?await u1(a.tensor,this.config):[]:(x0=this.config.object.modelPath)!=null&&x0.includes("centernet")&&(i=this.config.object.enabled?await u5(a.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,c,x,i]=await Promise.all([l,c,x,i])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=v(),m=[...Dn(l),...Wn(c),...Bn(x),...Fn(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(v()-A):Math.trunc(v()-A);let y=((K=this.process.tensor)==null?void 0:K.shape)||[0,0,0,0];this.result={face:l,body:c,hand:x,gesture:m,object:i,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:y[2],height:y[1],get persons(){return Wo(l,c,x,m,y)}},de.dispose(a.tensor),this.emit("detect"),this.state="idle",o(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,o=0){n?(Y0(this,Ye)[t.id]||(this.config.debug&&h("video start",t.id),Y0(this,Ye)[t.id]=!0),!t.paused&&Y0(this,Ye)[t.id]&&t.readyState>=2&&await this.detect(t),o>0&&await this.sleep(o),Y0(this,Ye)[t.id]&&requestAnimationFrame(()=>this.video(t,n,o))):(this.config.debug&&h("video stop",t.id),Y0(this,Ye)[t.id]=!1)}};P2=new WeakMap,Z2=new WeakMap,q2=new WeakMap,Ut=new WeakMap,Ye=new WeakMap;0&&(module.exports={Env,Human,defaults,draw,empty,env,match,models}); +2Q==`;async function xa(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(A=>A.blob()),n,o;switch(e.config.warmup){case"face":n=await t(qt);break;case"body":case"full":n=await t(Xt);break;default:n=null}if(n){let r=await createImageBitmap(n);o=await e.detect(r,e.config),r.close()}return o}async function ya(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+qt;break;case"full":case"body":n="data:image/jpeg;base64,"+Xt;break;default:n=""}let o;if(typeof Image!="undefined")o=new Image;else if(R.Image)o=new R.Image;else{t(void 0);return}o.onload=async()=>{let r=Ae(o.naturalWidth,o.naturalHeight);if(!r)h("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(o,0,0);let A=await e.image(r,!0),a=A.tensor?await e.detect(A.tensor,e.config):void 0;t(a)}},n?o.src=n:t(void 0)})}async function fa(e){let t=r=>Buffer.from(r,"base64"),n;e.config.warmup==="face"?n=t(qt):n=t(Xt);let o;if("node"in d0&&d0.getBackend()==="tensorflow"){let r=d0.node.decodeJpeg(n),s=d0.expandDims(r,0);e.tf.dispose(r),o=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&h("Warmup tfjs-node not loaded");return o}async function ma(e){let t;return typeof createImageBitmap=="function"?t=await xa(e):typeof Image!="undefined"||R.Canvas!==void 0?t=await ya(e):t=await fa(e),t}async function pa(e){var a,l,c,x;if(!d0.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=d0.getBackend(),n=d0.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;d0.env().set("ENGINE_COMPILE_ONLY",!0);let o=d0.engine().state.numTensors,r=[];for(let[i,y]of Object.entries(e.models.models)){if(!y)continue;let d=y!=null&&y.modelSignature&&((l=(a=y==null?void 0:y.inputs)==null?void 0:a[0])!=null&&l.shape)?[...y.inputs[0].shape]:[1,64,64,3],m=y!=null&&y.modelSignature&&((x=(c=y==null?void 0:y.inputs)==null?void 0:c[0])!=null&&x.dtype)?y.inputs[0].dtype:"float32";for(let u=0;ud0.dispose(g)):d0.dispose(u)}catch(u){e.config.debug&&h("compile fail model:",i)}d0.dispose(f)}let s=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&h("compile pass:",{models:r,kernels:s.length}),d0.env().set("ENGINE_COMPILE_ONLY",!1);let A=d0.engine().state.numTensors;A-o>0&&h("tensor leak:",A-o)}async function Do(e,t){await O2(e,!1);let n=v();return e.state="warmup",t&&(e.config=a0(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?Te():new Promise(async o=>{await e.models.load(),await pa(e);let r=await ma(e),s=v();e.config.debug&&h("warmup",e.config.warmup,Math.round(s-n),"ms"),e.emit("warmup"),o(r)})}var P2,Z2,q2,Ut,Ye,E1=class{constructor(t){w(this,"version");w(this,"config");w(this,"result");w(this,"state");w(this,"process");w(this,"tf");w(this,"env",R);w(this,"draw",rt);w(this,"match",Wt);w(this,"models");w(this,"events");w(this,"faceTriangulation");w(this,"faceUVMap");w(this,"performance");ue(this,P2,void 0);ue(this,Z2,void 0);ue(this,q2,void 0);w(this,"analyze",(...t)=>{if(!Y0(this,Z2))return;let n=this.tf.engine().state.numTensors,o=Y0(this,P2);Re(this,P2,n);let r=n-o;r!==0&&h(...t,r)});ue(this,Ut,t=>{if(!Y0(this,q2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof de.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});w(this,"webcam",new Q2);w(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});ue(this,Ye,{});let n=(de.version.tfjs||de.version_core).replace(/-(.*)/,"");Ke.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ke.modelBasePath=R.browser?"../models/":"file://models/",this.version=n5,Object.defineProperty(this,"version",{value:n5}),this.config=JSON.parse(JSON.stringify(Ke)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=a0(this.config,t)),X1(this.config),this.tf=de,this.state="idle",Re(this,P2,0),Re(this,Z2,!1),Re(this,q2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new V2(this),l5(),this.result=Te(),this.process={tensor:null,canvas:null},this.faceTriangulation=F3,this.faceUVMap=B3,Zt(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&h(`version: ${this.version}`),this.config.debug&&h(`tfjs version: ${this.tf.version["tfjs-core"]}`);let o=JSON.parse(JSON.stringify(this.env));delete o.kernels,delete o.initial,delete o.perfadd,this.config.debug&&h("environment:",o)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ke)),this.config.backend=t,e5(),R.initial=!0}validate(t){let n=Qt(Ke,t||this.config);return n.length===0&&(this.config=a0(this.config,t)),n}now(){return v()}image(t,n=!1){return K2(t,this.config,n)}async segmentation(t,n){var s,A,a;if(n&&(this.config=a0(this.config,n)),!this.config.segmentation.enabled)return null;let o=await K2(t,this.config);if(!o.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await No(o.tensor,this.config)),(A=this.config.segmentation.modelPath)!=null&&A.includes("meet")&&(r=await co(o.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("selfie")&&(r=await Lo(o.tensor,this.config)),de.dispose(o.tensor),r}compare(t,n){return q1(this.config,t,n)}async init(){await O2(this,!0),await this.tf.ready(),e5()}async load(t){this.state="load";let n=v(),o=Object.values(this.models.models).filter(A=>A).length;t&&(this.config=a0(this.config,t)),this.env.initial&&(await O2(this,!1)||h("error: backend check failed"),await de.ready(),this.env.browser&&(this.config.debug&&h("configuration:",this.config),this.config.debug&&h("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&h("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(A=>A).length!==o&&(this.models.validate(),this.emit("load"));let s=Math.trunc(v()-n);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return lo(t,this.config)}async warmup(t){let n=v(),o=await Do(this,t),r=v();return this.performance.warmup=Math.trunc(r-n),o}async profile(t,n){let o=await this.tf.profile(()=>this.detect(t,n)),r={},s=0;for(let a of o.kernels){let l=Number(a.kernelTimeMs)||0;r[a.name]?r[a.name]+=l:r[a.name]=l,s+=l}let A=[];Object.entries(r).forEach(a=>A.push({kernel:a[0],time:a[1],perc:0}));for(let a of A)a.perc=Math.round(1e3*a.time/s)/1e3,a.time=Math.round(1e3*a.time)/1e3;return A.sort((a,l)=>l.time-a.time),A.length=20,A}async detect(t,n){return this.state="detect",new Promise(async o=>{var u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;this.state="config";let r;this.config=a0(this.config,n),this.state="check";let s=Y0(this,Ut).call(this,t);s&&(h(s,t),this.emit("error"),o(Te(s)));let A=v();await this.load(),r=v(),this.state="image";let a=await K2(t,this.config);if(this.process=a,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Get Image:"),!a.tensor){this.config.debug&&h("could not convert input to tensor"),this.emit("error"),o(Te("could not convert input to tensor"));return}this.emit("image"),r=v(),this.config.skipAllowed=await Z1(this.config,a.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Check Changed:");let l=[],c=[],x=[],i=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?Q5(this,a.tensor):[],this.performance.face&&delete this.performance.face):(r=v(),l=this.config.face.enabled?await Q5(this,a.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let y=this.config.body.maxDetected===-1?a0(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((u=this.config.body.modelPath)!=null&&u.includes("posenet")?c=this.config.body.enabled?v1(a.tensor,y):[]:(g=this.config.body.modelPath)!=null&&g.includes("blazepose")?c=this.config.body.enabled?f5(a.tensor,y):[]:(T=this.config.body.modelPath)!=null&&T.includes("efficientpose")?c=this.config.body.enabled?T5(a.tensor,y):[]:(p=this.config.body.modelPath)!=null&&p.includes("movenet")&&(c=this.config.body.enabled?m1(a.tensor,y):[]),this.performance.body&&delete this.performance.body):(r=v(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?c=this.config.body.enabled?await v1(a.tensor,y):[]:(k=this.config.body.modelPath)!=null&&k.includes("blazepose")?c=this.config.body.enabled?await f5(a.tensor,y):[]:(P=this.config.body.modelPath)!=null&&P.includes("efficientpose")?c=this.config.body.enabled?await T5(a.tensor,y):[]:(I=this.config.body.modelPath)!=null&&I.includes("movenet")&&(c=this.config.body.enabled?await m1(a.tensor,y):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let d=this.config.hand.maxDetected===-1?a0(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((_=(B=this.config.hand.detector)==null?void 0:B.modelPath)!=null&&_.includes("handdetect")?x=this.config.hand.enabled?o1(a.tensor,d):[]:($=(Z=this.config.hand.detector)==null?void 0:Z.modelPath)!=null&&$.includes("handtrack")&&(x=this.config.hand.enabled?A1(a.tensor,d):[]),this.performance.hand&&delete this.performance.hand):(r=v(),(t0=(A0=this.config.hand.detector)==null?void 0:A0.modelPath)!=null&&t0.includes("handdetect")?x=this.config.hand.enabled?await o1(a.tensor,d):[]:(j0=(n0=this.config.hand.detector)==null?void 0:n0.modelPath)!=null&&j0.includes("handtrack")&&(x=this.config.hand.enabled?await A1(a.tensor,d):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((M=this.config.object.modelPath)!=null&&M.includes("nanodet")?i=this.config.object.enabled?u1(a.tensor,this.config):[]:(T0=this.config.object.modelPath)!=null&&T0.includes("centernet")&&(i=this.config.object.enabled?u5(a.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=v(),(C0=this.config.object.modelPath)!=null&&C0.includes("nanodet")?i=this.config.object.enabled?await u1(a.tensor,this.config):[]:(x0=this.config.object.modelPath)!=null&&x0.includes("centernet")&&(i=this.config.object.enabled?await u5(a.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,c,x,i]=await Promise.all([l,c,x,i])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=v(),m=[...Dn(l),...Wn(c),...Bn(x),...Fn(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(v()-A):Math.trunc(v()-A);let f=((K=this.process.tensor)==null?void 0:K.shape)||[0,0,0,0];this.result={face:l,body:c,hand:x,gesture:m,object:i,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:f[2],height:f[1],get persons(){return Wo(l,c,x,m,f)}},de.dispose(a.tensor),this.emit("detect"),this.state="idle",o(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,o=0){n?(Y0(this,Ye)[t.id]||(this.config.debug&&h("video start",t.id),Y0(this,Ye)[t.id]=!0),!t.paused&&Y0(this,Ye)[t.id]&&t.readyState>=2&&await this.detect(t),o>0&&await this.sleep(o),Y0(this,Ye)[t.id]&&requestAnimationFrame(()=>this.video(t,n,o))):(this.config.debug&&h("video stop",t.id),Y0(this,Ye)[t.id]=!1)}};P2=new WeakMap,Z2=new WeakMap,q2=new WeakMap,Ut=new WeakMap,Ye=new WeakMap;0&&(module.exports={Env,Human,defaults,draw,empty,env,match,models}); diff --git a/dist/human.node.js b/dist/human.node.js index a82d25b8..730657f8 100644 --- a/dist/human.node.js +++ b/dist/human.node.js @@ -4,7 +4,7 @@ author: ' */ -"use strict";var Do=Object.create;var w2=Object.defineProperty;var Fo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty;var Vo=(e,t,n)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var n in t)w2(e,n,{get:t[n],enumerable:!0})},I1=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bo(t))!Go.call(e,r)&&r!==n&&w2(e,r,{get:()=>t[r],enumerable:!(o=Fo(t,r))||o.enumerable});return e};var G=(e,t,n)=>(n=e!=null?Do(Ho(e)):{},I1(t||!e||!e.__esModule?w2(n,"default",{value:e,enumerable:!0}):n,e)),Xo=e=>I1(w2({},"__esModule",{value:!0}),e);var w=(e,t,n)=>(Vo(e,typeof t!="symbol"?t+"":t,n),n),N1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y0=(e,t,n)=>(N1(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Re=(e,t,n,o)=>(N1(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);var H=Zo((va,Kt)=>{"use strict";var Ut=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,Uo=Object.getOwnPropertyNames,Yo=Object.prototype.hasOwnProperty,Ko=(e,t)=>{for(var n in t)Ut(e,n,{get:t[n],enumerable:!0})},qt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Uo(t))!Yo.call(e,r)&&r!==n&&Ut(e,r,{get:()=>t[r],enumerable:!(o=qo(t,r))||o.enumerable});return e},Jo=(e,t,n)=>(qt(e,t,"default"),n&&qt(n,t,"default")),Qo=e=>qt(Ut({},"__esModule",{value:!0}),e),Yt={};Ko(Yt,{version:()=>or});Kt.exports=Qo(Yt);Jo(Yt,require("@tensorflow/tfjs-node"),Kt.exports);var L1="4.14.0",_o="4.14.0",$o="4.14.0",er="4.14.0",tr="4.14.0",nr="4.14.0",or={tfjs:L1,"tfjs-core":L1,"tfjs-converter":_o,"tfjs-backend-cpu":$o,"tfjs-backend-webgl":er,"tfjs-backend-wasm":tr,"tfjs-backend-webgpu":nr}});var ga={};ze(ga,{Env:()=>E2,Human:()=>w1,default:()=>w1,defaults:()=>Ke,draw:()=>nt,empty:()=>Te,env:()=>R,match:()=>Ot,models:()=>k1});module.exports=Xo(ga);var de=G(H());function h(...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)}function O1(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(`modelpath error: expecting json file: ${r}`);return r}var v=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Jt(e,t,n="config",o=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")Jt(e[r],t[r],r,o);else{let s=e&&typeof e[r]!="undefined";s||o.push({reason:"unknown property",where:`${n}.${r} = ${t[r]}`});let A=e&&typeof e[r]==typeof t[r];s&&!A&&o.push({reason:"property type mismatch",where:`${n}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&n==="config"&&o.length>0&&h("invalid configuration",o),o}function a0(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,o)=>(Object.keys(o||{}).forEach(r=>{let s=n[r],A=o[r];Array.isArray(s)&&Array.isArray(A)?n[r]=s.concat(...A):t(s)&&t(A)?n[r]=a0(s,A):n[r]=A}),n),{})}var Ke={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var W0=G(H());var I=G(H());var C1=` +"use strict";var Do=Object.create;var w2=Object.defineProperty;var Fo=Object.getOwnPropertyDescriptor;var Bo=Object.getOwnPropertyNames;var Ho=Object.getPrototypeOf,Go=Object.prototype.hasOwnProperty;var Vo=(e,t,n)=>t in e?w2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Zo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var n in t)w2(e,n,{get:t[n],enumerable:!0})},I1=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Bo(t))!Go.call(e,r)&&r!==n&&w2(e,r,{get:()=>t[r],enumerable:!(o=Fo(t,r))||o.enumerable});return e};var V=(e,t,n)=>(n=e!=null?Do(Ho(e)):{},I1(t||!e||!e.__esModule?w2(n,"default",{value:e,enumerable:!0}):n,e)),Xo=e=>I1(w2({},"__esModule",{value:!0}),e);var w=(e,t,n)=>(Vo(e,typeof t!="symbol"?t+"":t,n),n),N1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Y0=(e,t,n)=>(N1(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Re=(e,t,n,o)=>(N1(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);var G=Zo((ga,Kt)=>{"use strict";var Ut=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,Uo=Object.getOwnPropertyNames,Yo=Object.prototype.hasOwnProperty,Ko=(e,t)=>{for(var n in t)Ut(e,n,{get:t[n],enumerable:!0})},qt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Uo(t))!Yo.call(e,r)&&r!==n&&Ut(e,r,{get:()=>t[r],enumerable:!(o=qo(t,r))||o.enumerable});return e},Jo=(e,t,n)=>(qt(e,t,"default"),n&&qt(n,t,"default")),Qo=e=>qt(Ut({},"__esModule",{value:!0}),e),Yt={};Ko(Yt,{version:()=>or});Kt.exports=Qo(Yt);Jo(Yt,require("@tensorflow/tfjs-node"),Kt.exports);var L1="4.17.0",_o="4.17.0",$o="4.17.0",er="4.17.0",tr="4.17.0",nr="4.14.0",or={tfjs:L1,"tfjs-core":L1,"tfjs-converter":_o,"tfjs-backend-cpu":$o,"tfjs-backend-webgl":er,"tfjs-backend-wasm":tr,"tfjs-backend-webgpu":nr}});var ha={};ze(ha,{Env:()=>E2,Human:()=>w1,default:()=>w1,defaults:()=>Ke,draw:()=>nt,empty:()=>Te,env:()=>R,match:()=>Ot,models:()=>k1});module.exports=Xo(ha);var de=V(G());function h(...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)}function O1(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(`modelpath error: expecting json file: ${r}`);return r}var v=()=>typeof performance!="undefined"?performance.now():parseInt((Number(process.hrtime.bigint())/1e3/1e3).toString());function Jt(e,t,n="config",o=[]){for(let r of Object.keys(t))if(typeof t[r]=="object")Jt(e[r],t[r],r,o);else{let s=e&&typeof e[r]!="undefined";s||o.push({reason:"unknown property",where:`${n}.${r} = ${t[r]}`});let A=e&&typeof e[r]==typeof t[r];s&&!A&&o.push({reason:"property type mismatch",where:`${n}.${r} = ${t[r]}`,expected:typeof e[r]})}return t.debug&&n==="config"&&o.length>0&&h("invalid configuration",o),o}function a0(...e){let t=n=>n&&typeof n=="object";return e.reduce((n,o)=>(Object.keys(o||{}).forEach(r=>{let s=n[r],A=o[r];Array.isArray(s)&&Array.isArray(A)?n[r]=s.concat(...A):t(s)&&t(A)?n[r]=a0(s,A):n[r]=A}),n),{})}var Ke={backend:"",modelBasePath:"",cacheModels:!0,validateModels:!0,wasmPath:"",wasmPlatformFetch:!1,debug:!1,async:!0,warmup:"full",cacheSensitivity:.7,skipAllowed:!1,deallocate:!1,flags:{},softwareKernels:!1,filter:{enabled:!0,equalization:!1,width:0,height:0,flip:!1,return:!0,autoBrightness:!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:1,skipFrames:99,skipTime:2500,minConfidence:.2,minSize:0,iouThreshold:.1,scale:1.4,mask:!1,return:!1},mesh:{enabled:!0,modelPath:"facemesh.json",keepInvalid:!1},attention:{enabled:!1,modelPath:"facemesh-attention.json"},iris:{enabled:!0,scale:2.3,modelPath:"iris.json"},emotion:{enabled:!0,minConfidence:.1,skipFrames:99,skipTime:1500,modelPath:"emotion.json"},description:{enabled:!0,modelPath:"faceres.json",skipFrames:99,skipTime:3e3,minConfidence:.1},antispoof:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"antispoof.json"},liveness:{enabled:!1,skipFrames:99,skipTime:4e3,modelPath:"liveness.json"}},body:{enabled:!0,modelPath:"movenet-lightning.json",maxDetected:-1,minConfidence:.3,skipFrames:1,skipTime:200},hand:{enabled:!0,rotation:!0,skipFrames:99,skipTime:1e3,minConfidence:.5,iouThreshold:.2,maxDetected:-1,landmarks:!0,detector:{modelPath:"handtrack.json"},skeleton:{modelPath:"handlandmark-lite.json"}},object:{enabled:!1,modelPath:"centernet.json",minConfidence:.2,iouThreshold:.4,maxDetected:10,skipFrames:99,skipTime:2e3},segmentation:{enabled:!1,modelPath:"rvm.json",ratio:.5,mode:"default"}};var W0=V(G());var N=V(G());var C1=` precision highp float; attribute vec2 pos; attribute vec2 uv; @@ -96,8 +96,8 @@ c31 * m[6] + c32 * m[7] + c33 * m[8]; gl_FragColor.a = c22.a; } -`;var Qt=(e,t,n)=>{let o=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(o,(r,s)=>(n[s]=0,r))},_t=class{constructor(t,n,o){w(this,"uniform",{});w(this,"attribute",{});w(this,"gl");w(this,"id");w(this,"compile",(t,n)=>{let o=this.gl.createShader(n);return o?(this.gl.shaderSource(o,t),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS)?o:(h(`filter: gl compile failed: ${this.gl.getShaderInfoLog(o)||"unknown"}`),null)):(h("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),s=this.compile(o,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){h("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){h(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),Qt(n,"attribute",this.attribute);for(let A in this.attribute)this.attribute[A]=this.gl.getAttribLocation(this.id,A);Qt(n,"uniform",this.uniform),Qt(o,"uniform",this.uniform);for(let A in this.uniform)this.uniform[A]=this.gl.getUniformLocation(this.id,A)}}};function G1(){let e=0,t=null,n=!1,o=-1,r=[null,null],s=[],A=null,a=null,l=Ae(100,100),c={},x={INTERMEDIATE:1},i=l.getContext("webgl");if(!i){h("filter: cannot get webgl context");return}this.gl=i;function f(g,p){if(!(g===l.width&&p===l.height)){if(l.width=g,l.height=p,!A){let b=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=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,A),i.bufferData(i.ARRAY_BUFFER,b,i.STATIC_DRAW),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}i.viewport(0,0,l.width,l.height),r=[null,null]}}function d(g,p){let b=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,b);let k=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,k);let P=i.createTexture();return i.bindTexture(i.TEXTURE_2D,P),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,g,p,0,i.RGBA,i.UNSIGNED_BYTE,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,P,0),i.bindTexture(i.TEXTURE_2D,null),i.bindFramebuffer(i.FRAMEBUFFER,null),{fbo:b,texture:P}}function m(g){return r[g]=r[g]||d(l.width,l.height),r[g]}function y(g=0){if(!a)return;let p=null,b=null,k=!1;e===0?p=t:p=m(o).texture||null,e++,n&&!(g&x.INTERMEDIATE)?(b=null,k=e%2===0):(o=(o+1)%2,b=m(o).fbo||null),i.bindTexture(i.TEXTURE_2D,p),i.bindFramebuffer(i.FRAMEBUFFER,b),i.uniform1f(a.uniform.flipY,k?-1:1),i.drawArrays(i.TRIANGLES,0,6)}function u(g){if(c[g])return a=c[g],i.useProgram((a?a.id:null)||null),a;if(a=new _t(i,C1,g),!a)return h("filter: could not get webgl program"),null;let p=Float32Array.BYTES_PER_ELEMENT,b=4*p;return i.enableVertexAttribArray(a.attribute.pos),i.vertexAttribPointer(a.attribute.pos,2,i.FLOAT,!1,b,0*p),i.enableVertexAttribArray(a.attribute.uv),i.vertexAttribPointer(a.attribute.uv,2,i.FLOAT,!1,b,2*p),c[g]=a,a}let T={colorMatrix:g=>{let p=new Float32Array(g);p[4]/=255,p[9]/=255,p[14]/=255,p[19]/=255;let b=p[18]===1&&p[3]===0&&p[8]===0&&p[13]===0&&p[15]===0&&p[16]===0&&p[17]===0&&p[19]===0?D1:W1,k=u(b);k&&(i.uniform1fv(k.uniform.m,p),y())},brightness:g=>{let p=(g||0)+1;T.colorMatrix([p,0,0,0,0,0,p,0,0,0,0,0,p,0,0,0,0,0,1,0])},saturation:g=>{let p=(g||0)*2/3+1,b=(p-1)*-.5;T.colorMatrix([p,b,b,0,0,b,p,b,0,0,b,b,p,0,0,0,0,0,1,0])},desaturate:()=>{T.saturation(-1)},contrast:g=>{let p=(g||0)+1,b=-128*(p-1);T.colorMatrix([p,0,0,0,b,0,p,0,0,b,0,0,p,0,b,0,0,0,1,0])},negative:()=>{T.contrast(-2)},hue:g=>{g=(g||0)/180*Math.PI;let p=Math.cos(g),b=Math.sin(g),k=.213,P=.715,N=.072;T.colorMatrix([k+p*(1-k)+b*-k,P+p*-P+b*-P,N+p*-N+b*(1-N),0,0,k+p*-k+b*.143,P+p*(1-P)+b*.14,N+p*-N+b*-.283,0,0,k+p*-k+b*-(1-k),P+p*-P+b*P,N+p*(1-N)+b*N,0,0,0,0,0,1,0])},desaturateLuminance:()=>{T.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{T.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{T.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{T.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{T.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{T.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{T.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{T.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:g=>{let p=new Float32Array(g),b=1/l.width,k=1/l.height,P=u(H1);P&&(i.uniform1fv(P.uniform.m,p),i.uniform2f(P.uniform.px,b,k),y())},detectEdges:()=>{T.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{T.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{T.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:g=>{let p=g||1;T.convolution.call(this,[0,-1*p,0,-1*p,1+4*p,-1*p,0,-1*p,0])},emboss:g=>{let p=g||1;T.convolution.call(this,[-2*p,-1*p,0,-1*p,1,1*p,0,1*p,2*p])},blur:g=>{let p=g/7/l.width,b=g/7/l.height,k=u(B1);k&&(i.uniform2f(k.uniform.px,0,b),y(x.INTERMEDIATE),i.uniform2f(k.uniform.px,p,0),y())},pixelate:g=>{let p=g/l.width,b=g/l.height,k=u(F1);k&&(i.uniform2f(k.uniform.size,p,b),y())}};this.add=function(g){let p=Array.prototype.slice.call(arguments,1),b=T[g];s.push({func:b,args:p})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(g){f(g.width,g.height),e=0,t||(t=i.createTexture()),i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,g);for(let p=0;px.data())),A=Math.max(s[0][0],s[1][0],s[2][0]),l=(A>1?255:1)/A,c;if(l>1){let x=[U.sub(n[0],o[0]),U.sub(n[1],o[1]),U.sub(n[2],o[2])],i=[U.sub(r[0],o[0]),U.sub(r[1],o[1]),U.sub(r[2],o[2])],f=[U.mul(x[0],l),U.mul(x[1],l),U.mul(x[2],l)],d=U.stack([f[0],f[1],f[2]],2);c=U.reshape(d,[1,t.shape[0]||0,t.shape[1]||0,3]),U.dispose([...x,...i,...f,d])}else c=U.expandDims(t,0);return U.dispose([...n,...o,...r,n,t,e]),c}var X2=3840,R0=null,M0=null,y2=null,e0,ne={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function $t(){ne.inputSum=0,ne.cacheDiff=1,ne.sumMethod=0,ne.inputTensor=void 0}function Ae(e,t){let n;if(R.browser)if(R.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof R.Canvas!="undefined")n=new R.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof R.Canvas!="undefined"?n=new R.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function q2(e,t){let n=t||Ae(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function U2(e,t,n=!0){var f,d,m;if(!e)return t.debug&&h("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof I.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof I.Tensor){let y=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)y=I.expandDims(e,0);else if(e.shape[2]===4){let u=I.slice3d(e,[0,0,0],[-1,-1,3]);y=I.expandDims(u,0),I.dispose(u)}}else e.shape.length===4&&(e.shape[3]===3?y=I.clone(e):e.shape[3]===4&&(y=I.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(y==null||y.shape.length!==4||y.shape[0]!==1||y.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(y.dtype==="int32"){let u=I.cast(y,"float32");I.dispose(y),y=u}return{tensor:y,canvas:t.filter.return?M0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&h("input stream is not ready"),{tensor:null,canvas:R0};let o=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!o||!r)return t.debug&&h("cannot determine input dimensions"),{tensor:null,canvas:R0};let s=o,A=r;if(s>X2&&(s=X2,A=Math.trunc(s*r/o)),A>X2&&(A=X2,s=Math.trunc(A*o/r)),(((f=t.filter)==null?void 0:f.width)||0)>0?s=t.filter.width:(((d=t.filter)==null?void 0:d.height)||0)>0&&(s=o*((t.filter.height||0)/r)),(t.filter.height||0)>0?A=t.filter.height:(t.filter.width||0)>0&&(A=r*((t.filter.width||0)/o)),!s||!A)throw new Error("input error: cannot determine dimension");(!R0||R0.width!==s||R0.height!==A)&&(R0=Ae(s,A));let a=R0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?a.putImageData(e,0,0):t.filter.flip&&typeof a.translate!="undefined"?(a.translate(o,0),a.scale(-1,1),a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),a.setTransform(1,0,0,1,0,0)):a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),(!M0||R0.width!==M0.width||R0.height!==M0.height)&&(M0=Ae(R0.width,R0.height)),t.filter.enabled&&R.webgl.supported?(e0||(e0=R.browser?new G1:null),R.filter=!!e0,e0!=null&&e0.add?(e0.reset(),t.filter.brightness!==0&&e0.add("brightness",t.filter.brightness),t.filter.contrast!==0&&e0.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&e0.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&e0.add("blur",t.filter.blur),t.filter.saturation!==0&&e0.add("saturation",t.filter.saturation),t.filter.hue!==0&&e0.add("hue",t.filter.hue),t.filter.negative&&e0.add("negative"),t.filter.sepia&&e0.add("sepia"),t.filter.vintage&&e0.add("brownie"),t.filter.sepia&&e0.add("sepia"),t.filter.kodachrome&&e0.add("kodachrome"),t.filter.technicolor&&e0.add("technicolor"),t.filter.polaroid&&e0.add("polaroid"),t.filter.pixelate!==0&&e0.add("pixelate",t.filter.pixelate),((m=e0.get())==null?void 0:m.length)>1?M0=e0.apply(R0):M0=e0.draw(R0)):(t.debug&&h("input process error: cannot initialize filters"),R.webgl.supported=!1,t.filter.enabled=!1,q2(R0,M0))):(q2(R0,M0),e0&&(e0=null),R.filter=!!e0),!n)return{tensor:null,canvas:M0};if(!M0)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(R.browser&&I.browser)l=I.browser?I.browser.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let y=new Uint8Array(e.data.buffer);l=I.tensor(y,[e.height,e.width,c],"int32")}else if((!y2||M0.width!==y2.width||M0.height!==y2.height)&&(y2=Ae(M0.width,M0.height)),I.browser&&R.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=I.browser.fromPixels(M0):(y2=q2(M0),l=I.browser.fromPixels(y2));else{let T=q2(M0).getContext("2d").getImageData(0,0,s,A);c=T.data.length/s/A;let g=new Uint8Array(T.data.buffer);l=I.tensor(g,[s,A,c])}if(c===4){let y=I.slice3d(l,[0,0,0],[-1,-1,3]);I.dispose(l),l=y}if(!l)throw new Error("input error: cannot create tensor");let x=I.cast(l,"float32"),i=t.filter.equalization?await Z2(x):I.expandDims(x,0);if(I.dispose([l,x]),t.filter.autoBrightness){let y=I.max(i),u=await y.data();t.filter.brightness=u[0]>1?1-u[0]/255:1-u[0],I.dispose(y)}return{tensor:i,canvas:t.filter.return?M0:null}}async function V1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!ne.inputTensor)ne.inputTensor=I.clone(t);else if(ne.inputTensor.shape[1]!==t.shape[1]||ne.inputTensor.shape[2]!==t.shape[2])I.dispose(ne.inputTensor),ne.inputTensor=I.clone(t);else{let o={};o.diff=I.sub(t,ne.inputTensor),o.squared=I.mul(o.diff,o.diff),o.sum=I.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;I.dispose([ne.inputTensor,o.diff,o.squared,o.sum]),ne.inputTensor=I.clone(t),n=s<=(e.cacheSensitivity||0)}return n}async function Z1(e,t,n){let o={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||h("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||h("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;o.input1=I.clone(t),o.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?I.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):I.clone(n),o.diff=I.sub(o.input1,o.input2),o.squared=I.mul(o.diff,o.diff),o.sum=I.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return I.dispose([o.input1,o.input2,o.diff,o.squared,o.sum]),s}var z2,S2,j2,E2=class{constructor(){w(this,"browser");w(this,"node");w(this,"worker");w(this,"platform","");w(this,"agent","");w(this,"backends",[]);w(this,"initial");w(this,"filter");w(this,"tfjs");w(this,"offscreen");w(this,"perfadd",!1);w(this,"tensorflow",{version:void 0,gpu:void 0});w(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});w(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});w(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});w(this,"cpu",{model:void 0,flags:[]});w(this,"kernels",[]);ue(this,z2,void 0);ue(this,S2,void 0);ue(this,j2,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:W0.version["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let o=n[0].match(/\(([^()]+)\)/g);this.platform=o!=null&&o[0]?o[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return Y0(this,z2)}set Canvas(t){Re(this,z2,t),globalThis.Canvas=t}get Image(){return Y0(this,S2)}set Image(t){Re(this,S2,t),globalThis.Image=t}get ImageData(){return Y0(this,j2)}set ImageData(t){Re(this,j2,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(W0.engine().registryFactory);try{this.tensorflow={version:W0.backend().binding?W0.backend().binding.TF_Version:void 0,gpu:W0.backend().binding?W0.backend().binding.isUsingGpuDevice():void 0}}catch(o){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await W0.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await W0.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Ae(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let o=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(o==null?void 0:o.requestAdapterInfo())}}catch(o){this.webgpu.supported=!1}try{this.kernels=W0.getKernelsForBackend(W0.getBackend()).map(o=>o.kernelName.toLowerCase())}catch(o){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};z2=new WeakMap,S2=new WeakMap,j2=new WeakMap;var R=new E2;var K2=class{constructor(){w(this,"config");w(this,"element");w(this,"stream");w(this,"devices",[]);w(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});w(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let A=document.getElementById(t.element);if(A&&A instanceof HTMLVideoElement)this.element=A;else return this.config.debug&&h("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&h("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(n.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&h("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&h("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&h("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(A){return h("webcam",A),`webcam error: ${A}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(A=>{this.element?this.element.onloadeddata=()=>A(!0):A(!1)}),await this.element.play(),this.config.debug&&h("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&h("webcam error","no stream"),"webcam error no stream")});w(this,"pause",()=>{this.element&&this.element.pause()});w(this,"play",async()=>{this.element&&await this.element.play()});w(this,"stop",()=>{this.config.debug&&h("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var f2=G(H());var e5={};ze(e5,{"affectnet-mobilenet":()=>br,age:()=>gr,"anti-spoofing":()=>_r,antispoof:()=>ar,blazeface:()=>ir,"blazeface-back":()=>Tr,"blazeface-front":()=>vr,"blazepose-detector":()=>Rr,"blazepose-full":()=>Mr,"blazepose-heavy":()=>Pr,"blazepose-lite":()=>kr,centernet:()=>lr,default:()=>ds,efficientpose:()=>wr,"efficientpose-i-lite":()=>$r,"efficientpose-ii-lite":()=>es,"efficientpose-iv":()=>ts,emotion:()=>cr,faceboxes:()=>Er,facemesh:()=>dr,"facemesh-attention":()=>Sr,"facemesh-attention-pinto":()=>zr,"facemesh-detection-full":()=>jr,"facemesh-detection-short":()=>Ir,faceres:()=>xr,"faceres-deep":()=>Nr,gear:()=>Cr,"gear-e1":()=>Lr,"gear-e2":()=>Or,gender:()=>Dr,"gender-ssrnet-imdb":()=>Wr,handdetect:()=>Fr,"handlandmark-full":()=>Br,"handlandmark-lite":()=>yr,"handlandmark-sparse":()=>Hr,handskeleton:()=>Gr,handtrack:()=>fr,"insightface-efficientnet-b0":()=>ns,"insightface-ghostnet-strides1":()=>os,"insightface-ghostnet-strides2":()=>rs,"insightface-mobilenet-emore":()=>ss,"insightface-mobilenet-swish":()=>As,iris:()=>mr,liveness:()=>pr,meet:()=>Vr,mobileface:()=>Zr,mobilefacenet:()=>Xr,models:()=>ur,"movenet-lightning":()=>hr,"movenet-multipose":()=>qr,"movenet-thunder":()=>Ur,nanodet:()=>Yr,"nanodet-e":()=>as,"nanodet-g":()=>is,"nanodet-m":()=>ls,"nanodet-t":()=>cs,posenet:()=>Kr,rvm:()=>Jr,selfie:()=>Qr});var ar=853098,ir=538928,lr=4030290,cr=820516,dr=1477958,xr=6978814,yr=2023432,fr=2964837,mr=2599092,pr=592976,ur=0,hr=4650216,br=6920630,gr=161240,Tr=538928,vr=402048,Rr=5928856,Mr=6339202,Pr=27502466,kr=2726402,wr=5651240,Er=2013002,zr=2387598,Sr=2382414,jr=1026192,Ir=201268,Nr=13957620,Lr=112438,Or=112438,Cr=1498916,Wr=161236,Dr=201808,Fr=3515612,Br=5431368,Hr=5286322,Gr=5502280,Vr=372228,Zr=2183192,Xr=5171976,qr=9448838,Ur=12477112,Yr=7574558,Kr=5032780,Jr=3739355,Qr=212886,_r=853098,$r=2269064,es=5651240,ts=25643252,ns=13013224,os=8093408,rs=8049584,ss=6938536,As=12168584,as=12319156,is=7574558,ls=1887474,cs=5294216,ds={antispoof:ar,blazeface:ir,centernet:lr,emotion:cr,facemesh:dr,faceres:xr,"handlandmark-lite":yr,handtrack:fr,iris:mr,liveness:pr,models:ur,"movenet-lightning":hr,"affectnet-mobilenet":br,age:gr,"blazeface-back":Tr,"blazeface-front":vr,"blazepose-detector":Rr,"blazepose-full":Mr,"blazepose-heavy":Pr,"blazepose-lite":kr,efficientpose:wr,faceboxes:Er,"facemesh-attention-pinto":zr,"facemesh-attention":Sr,"facemesh-detection-full":jr,"facemesh-detection-short":Ir,"faceres-deep":Nr,"gear-e1":Lr,"gear-e2":Or,gear:Cr,"gender-ssrnet-imdb":Wr,gender:Dr,handdetect:Fr,"handlandmark-full":Br,"handlandmark-sparse":Hr,handskeleton:Gr,meet:Vr,mobileface:Zr,mobilefacenet:Xr,"movenet-multipose":qr,"movenet-thunder":Ur,nanodet:Yr,posenet:Kr,rvm:Jr,selfie:Qr,"anti-spoofing":_r,"efficientpose-i-lite":$r,"efficientpose-ii-lite":es,"efficientpose-iv":ts,"insightface-efficientnet-b0":ns,"insightface-ghostnet-strides1":os,"insightface-ghostnet-strides2":rs,"insightface-mobilenet-emore":ss,"insightface-mobilenet-swish":As,"nanodet-e":as,"nanodet-g":is,"nanodet-m":ls,"nanodet-t":cs};var D0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},I0={};async function xs(e,t){return D0.debug&&h("load model fetch:",e,t),fetch(e,t)}function X1(e){D0.cacheModels=e.cacheModels,D0.verbose=e.debug,D0.modelBasePath=e.modelBasePath}async function L(e){var c,x,i,f;let t=O1(D0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),o=n[n.length-1].replace(".json",""),r="indexeddb://"+o;I0[o]={name:o,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:e5[o],inCache:!1,url:""},D0.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=D0.cacheSupported&&D0.cacheModels?await f2.io.listModels():{}}catch(d){D0.cacheSupported=!1}I0[o].inCache=D0.cacheSupported&&D0.cacheModels&&Object.keys(s).includes(r),I0[o].url=I0[o].inCache?r:t;let A=typeof fetch=="undefined"?{}:{fetchFunc:(d,m)=>xs(d,m)},a=new f2.GraphModel(I0[o].url,A),l=!1;try{a.findIOHandler(),D0.debug&&h("model load handler:",a.handler)}catch(d){h("error finding model i/o handler:",t,d)}try{let d=await((c=a.handler)==null?void 0:c.load())||null;I0[o].sizeFromManifest=((x=d==null?void 0:d.weightData)==null?void 0:x.byteLength)||0,d?a.loadSync(d):a=await f2.loadGraphModel(I0[o].inCache?r:t,A),I0[o].sizeLoadedWeights=((f=(i=a.artifacts)==null?void 0:i.weightData)==null?void 0:f.byteLength)||0,D0.verbose&&h("load:",{model:o,url:a.modelUrl,bytes:I0[o].sizeLoadedWeights}),l=!0}catch(d){h("error loading model:",t,d)}if(l&&D0.cacheModels&&D0.cacheSupported&&!I0[o].inCache)try{let d=await a.save(r);D0.debug&&h("model saved:",r,d)}catch(d){h("error saving model:",t,d)}return a}var t5="3.2.0";var S=G(H());var u0=G(H());var o0={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function ms(){let e=o0.gl;e&&(o0.extensions=e.getSupportedExtensions())}function q1(e){var t;if(e.config.backend==="humangl"&&(o0.name in u0.engine().registry&&!((t=o0==null?void 0:o0.gl)!=null&&t.getParameter(o0.gl.VERSION))&&(h("humangl error: backend invalid context"),e.models.reset()),!u0.findBackend(o0.name))){try{o0.canvas=Ae(100,100)}catch(r){h("humangl error: cannot create canvas:",r);return}try{if(o0.gl=o0.canvas.getContext("webgl2",o0.webGLattr),!o0.gl){h("humangl error: cannot get webgl context");return}if(!o0.gl.getParameter(o0.gl.VERSION).includes("2.0")){h("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}o0.canvas&&(o0.canvas.addEventListener("webglcontextlost",s=>{throw h("humangl error:",s.type),h("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),o0.canvas.addEventListener("webglcontextrestored",s=>{h("humangl error: context restored:",s)}),o0.canvas.addEventListener("webglcontextcreationerror",s=>{h("humangl error: context create:",s)}))}catch(r){h("humangl error: cannot get webgl context:",r);return}try{u0.setWebGLContext(2,o0.gl)}catch(r){h("humangl error: cannot set webgl context:",r);return}try{let r=new u0.GPGPUContext(o0.gl);u0.registerBackend(o0.name,()=>new u0.MathBackendWebGL(r),o0.priority)}catch(r){h("humangl error: cannot register webgl backend:",r);return}try{u0.getKernelsForBackend("webgl").forEach(s=>{let A={...s,backendName:o0.name};u0.registerKernel(A)})}catch(r){h("humangl error: cannot update webgl backend registration:",r);return}try{u0.env().flagRegistry.WEBGL_VERSION&&u0.env().set("WEBGL_VERSION",2)}catch(r){h("humangl error: cannot set WebGL backend flags:",r);return}ms();let n=u0.backend(),o=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;o?e.config.debug&&h("humangl backend registered:",{webgl:o.getParameter(o.VERSION),renderer:o.getParameter(o.RENDERER)}):h("humangl error: no current gl context:",o,o0.gl)}}var Se=G(H()),C={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function U1(){C.tf255=Se.scalar(255,"float32"),C.tf1=Se.scalar(1,"float32"),C.tf2=Se.scalar(2,"float32"),C.tf05=Se.scalar(.5,"float32"),C.tf127=Se.scalar(127.5,"float32"),C.rgb=Se.tensor1d([.2989,.587,.114],"float32")}async function hs(){var e;return await R.updateBackend(),(e=R.tensorflow)!=null&&e.version?"tensorflow":R.webgpu.supported&&R.webgpu.backend?"webgpu":R.webgl.supported&&R.webgl.backend?"webgl":R.wasm.supported&&R.wasm.backend?"wasm":"cpu"}function bs(e){let t=[];if(!R.kernels.includes("mod")){let n={kernelName:"Mod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.sub(o.inputs.a,S.mul(S.div(o.inputs.a,o.inputs.b),o.inputs.b)))};S.registerKernel(n),R.kernels.push("mod"),t.push("mod")}if(!R.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.add(S.mul(S.floorDiv(o.inputs.a,o.inputs.b),o.inputs.b),S.mod(o.inputs.a,o.inputs.b)))};S.registerKernel(n),R.kernels.push("floormod"),t.push("floormod")}if(!R.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>{let r=S.getBackend();S.setBackend("cpu");let s=S.image.rotateWithOffset(o.inputs.image,o.attrs.radians,o.attrs.fillValue,o.attrs.center);return S.setBackend(r),s})};S.registerKernel(n),R.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&h("registered kernels:",t)}var Y1={};async function I2(e,t=!1){var n,o;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await hs()),t||R.initial||e.config.backend&&e.config.backend.length>0&&S.getBackend()!==e.config.backend){let r=v();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&h("running inside web worker"),typeof navigator!="undefined"&&((o=navigator==null?void 0:navigator.userAgent)!=null&&o.toLowerCase().includes("electron"))&&e.config.debug&&h("running inside electron");let s=Object.keys(S.engine().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(q1(e),s=Object.keys(S.engine().registryFactory)),e.config.debug&&h("available backends:",s),R.browser&&!R.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&h("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),R.node&&!R.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&h(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),R.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")h("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let A=await navigator.gpu.requestAdapter();if(e.config.debug&&h("enumerated webgpu adapter:",A),!A)h("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let a="requestAdapterInfo"in A?await A.requestAdapterInfo():void 0;h("webgpu adapter info:",a)}}if(s.includes(e.config.backend)||(h(`error: backend ${e.config.backend} not found in registry`),e.config.backend=R.node?"tensorflow":"webgl",e.config.debug&&h(`override: setting backend ${e.config.backend}`)),e.config.debug&&h("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(S.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&S.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&h("wasm path:",e.config.wasmPath),typeof S.setWasmPaths!="undefined")S.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let A=!1,a=!1;try{A=await S.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),a=await S.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&h(`wasm execution: ${a?"simd":"no simd"} ${A?"multithreaded":"singlethreaded"}`),e.config.debug&&!a&&h("warning: wasm simd support is not enabled")}catch(l){h("wasm detection failed")}}try{await S.setBackend(e.config.backend),await S.ready()}catch(A){return h("error: cannot set backend:",e.config.backend,A),!1}e.config.debug&&(Y1=JSON.parse(JSON.stringify(S.env().flags)))}if((S.getBackend()==="humangl"||S.getBackend()==="webgl")&&(S.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&S.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),S.env().flagRegistry.WEBGL_EXP_CONV&&S.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(h("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),S.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),S.getBackend(),e.config.debug){let s=S.env().flags,A={};for(let a of Object.keys(s))Y1[a]!==s[a]&&(A[a]=s[a]);e.config.debug&&Object.keys(A).length>0&&h("backend:",S.getBackend(),"flags:",A)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&h("flags:",e.config.flags);for(let[s,A]of Object.entries(e.config.flags))S.env().set(s,A)}S.enableProdMode(),U1(),e.performance.initBackend=Math.trunc(v()-r),e.config.backend=S.getBackend(),await R.updateBackend(),bs(e.config)}return!0}function J2(e,t){for(let n of e){let o={kernelName:n,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&h("kernelFunc",n,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};S.registerKernel(o)}R.kernels=S.getKernelsForBackend(S.getBackend()).map(n=>n.kernelName.toLowerCase())}var nt={};ze(nt,{all:()=>Js,body:()=>_2,canvas:()=>Ks,face:()=>Q2,gesture:()=>tt,hand:()=>$2,init:()=>i5,object:()=>et,options:()=>f0,person:()=>Ys});var oe=e=>{if(!e)h("draw error: invalid canvas");else if(!e.getContext)h("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)h("draw error: cannot get canvas context");else return t}return null},Je=e=>Math.round(e*180/Math.PI),Y=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Qe=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function re(e,t,n,o,r){let s=t.replace(/\[.*\]/g,"").split(` -`).map(a=>a.trim()),A=Math.max(0,n);for(let a=s.length-1;a>=0;a--){let l=a*r.lineHeight+o;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[a],A+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[a],A+4,l+15)}}function he(e,t,n,o,r){e.fillStyle=Qe(o,r),e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function be(e,t,n,o,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let A=(t+t+o)/2,a=(n+n+r)/2;e.ellipse(A,a,o/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,n),e.lineTo(t+o-s.roundRect,n),e.quadraticCurveTo(t+o,n,t+o,n+s.roundRect),e.lineTo(t+o,n+r-s.roundRect),e.quadraticCurveTo(t+o,n+r,t+o-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 n5(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let o of t)e.strokeStyle=Qe(o[2]||0,n),e.lineTo(Math.trunc(o[0]),Math.trunc(o[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function J1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){n5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let o=0;oN2[e]),Za=Ts.map(e=>N2[e]),Xa=vs.map(e=>N2[e]);function je(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Rs=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ms=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ps=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ks=[[474,475],[475,476],[476,477],[477,474]],ws=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Es=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],zs=[[469,470],[470,471],[471,472],[472,469]],Ss=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],qa={lips:je(Rs),leftEye:je(Ms),leftEyebrow:je(Ps),leftIris:je(ks),rightEye:je(ws),rightEyebrow:je(Es),rightIris:je(zs),faceOval:je(Ss)};var js=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Is=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ns=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Ls=[[474,475],[475,476],[476,477],[477,474]],Os=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Cs=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ws=[[469,470],[470,471],[471,472],[472,469]],Ds=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function Ie(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Fs={lips:Ie(js),leftEye:Ie(Is),leftEyebrow:Ie(Ns),leftIris:Ie(Ls),rightEye:Ie(Os),rightEyebrow:Ie(Cs),rightIris:Ie(Ws),faceOval:Ie(Ds)},Bs=Object.entries(Fs).map(([e,t])=>t.map(n=>[n,e])).flat(),Ua=new Map(Bs),L2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],e2=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],t2=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var q;function Hs(e,t){var o,r,s,A,a,l,c,x,i;if(!q.drawLabels||((o=q.faceLabels)==null?void 0:o.length)===0)return;let n=q.faceLabels.slice();if(n=Y(n,"[id]",e.id.toFixed(0)),e.score&&(n=Y(n,"[score]",100*e.score)),e.gender&&(n=Y(n,"[gender]",e.gender)),e.genderScore&&(n=Y(n,"[genderScore]",100*e.genderScore)),e.age&&(n=Y(n,"[age]",e.age)),e.distance&&(n=Y(n,"[distance]",100*e.distance)),e.real&&(n=Y(n,"[real]",100*e.real)),e.live&&(n=Y(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let f=e.emotion.map(d=>`${Math.trunc(100*d.score)}% ${d.emotion}`);f.length>3&&(f.length=3),n=Y(n,"[emotions]",f.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(n=Y(n,"[roll]",Je(e.rotation.angle.roll))),(a=(A=e.rotation)==null?void 0:A.angle)!=null&&a.yaw&&(n=Y(n,"[yaw]",Je(e.rotation.angle.yaw))),(c=(l=e.rotation)==null?void 0:l.angle)!=null&&c.pitch&&(n=Y(n,"[pitch]",Je(e.rotation.angle.pitch))),(i=(x=e.rotation)==null?void 0:x.gaze)!=null&&i.bearing&&(n=Y(n,"[gaze]",Je(e.rotation.gaze.bearing))),re(t,n,e.box[0],e.box[1],q)}function Gs(e,t){var n,o,r,s;if((n=e.annotations)!=null&&n.leftEyeIris&&((o=e.annotations)!=null&&o.leftEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,a=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,a=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}}function Vs(e,t){var n;if(q.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let o=e.box[0]+e.box[2]/2-e.box[3]*Je(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*Je(e.rotation.angle.pitch)/90,s=new Path2D(` +`;var Qt=(e,t,n)=>{let o=new RegExp("\\b"+t+" \\w+ (\\w+)","ig");e.replace(o,(r,s)=>(n[s]=0,r))},_t=class{constructor(t,n,o){w(this,"uniform",{});w(this,"attribute",{});w(this,"gl");w(this,"id");w(this,"compile",(t,n)=>{let o=this.gl.createShader(n);return o?(this.gl.shaderSource(o,t),this.gl.compileShader(o),this.gl.getShaderParameter(o,this.gl.COMPILE_STATUS)?o:(h(`filter: gl compile failed: ${this.gl.getShaderInfoLog(o)||"unknown"}`),null)):(h("filter: could not create shader"),null)});this.gl=t;let r=this.compile(n,this.gl.VERTEX_SHADER),s=this.compile(o,this.gl.FRAGMENT_SHADER);if(this.id=this.gl.createProgram(),!(!r||!s)){if(!this.id){h("filter: could not create webgl program");return}if(this.gl.attachShader(this.id,r),this.gl.attachShader(this.id,s),this.gl.linkProgram(this.id),!this.gl.getProgramParameter(this.id,this.gl.LINK_STATUS)){h(`filter: gl link failed: ${this.gl.getProgramInfoLog(this.id)||"unknown"}`);return}this.gl.useProgram(this.id),Qt(n,"attribute",this.attribute);for(let A in this.attribute)this.attribute[A]=this.gl.getAttribLocation(this.id,A);Qt(n,"uniform",this.uniform),Qt(o,"uniform",this.uniform);for(let A in this.uniform)this.uniform[A]=this.gl.getUniformLocation(this.id,A)}}};function G1(){let e=0,t=null,n=!1,o=-1,r=[null,null],s=[],A=null,a=null,l=Ae(100,100),c={},x={INTERMEDIATE:1},i=l.getContext("webgl");if(!i){h("filter: cannot get webgl context");return}this.gl=i;function y(T,p){if(!(T===l.width&&p===l.height)){if(l.width=T,l.height=p,!A){let b=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=i.createBuffer(),i.bindBuffer(i.ARRAY_BUFFER,A),i.bufferData(i.ARRAY_BUFFER,b,i.STATIC_DRAW),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0)}i.viewport(0,0,l.width,l.height),r=[null,null]}}function d(T,p){let b=i.createFramebuffer();i.bindFramebuffer(i.FRAMEBUFFER,b);let k=i.createRenderbuffer();i.bindRenderbuffer(i.RENDERBUFFER,k);let P=i.createTexture();return i.bindTexture(i.TEXTURE_2D,P),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,T,p,0,i.RGBA,i.UNSIGNED_BYTE,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,P,0),i.bindTexture(i.TEXTURE_2D,null),i.bindFramebuffer(i.FRAMEBUFFER,null),{fbo:b,texture:P}}function m(T){return r[T]=r[T]||d(l.width,l.height),r[T]}function f(T=0){if(!a)return;let p=null,b=null,k=!1;e===0?p=t:p=m(o).texture||null,e++,n&&!(T&x.INTERMEDIATE)?(b=null,k=e%2===0):(o=(o+1)%2,b=m(o).fbo||null),i.bindTexture(i.TEXTURE_2D,p),i.bindFramebuffer(i.FRAMEBUFFER,b),i.uniform1f(a.uniform.flipY,k?-1:1),i.drawArrays(i.TRIANGLES,0,6)}function u(T){if(c[T])return a=c[T],i.useProgram((a?a.id:null)||null),a;if(a=new _t(i,C1,T),!a)return h("filter: could not get webgl program"),null;let p=Float32Array.BYTES_PER_ELEMENT,b=4*p;return i.enableVertexAttribArray(a.attribute.pos),i.vertexAttribPointer(a.attribute.pos,2,i.FLOAT,!1,b,0*p),i.enableVertexAttribArray(a.attribute.uv),i.vertexAttribPointer(a.attribute.uv,2,i.FLOAT,!1,b,2*p),c[T]=a,a}let g={colorMatrix:T=>{let p=new Float32Array(T);p[4]/=255,p[9]/=255,p[14]/=255,p[19]/=255;let b=p[18]===1&&p[3]===0&&p[8]===0&&p[13]===0&&p[15]===0&&p[16]===0&&p[17]===0&&p[19]===0?D1:W1,k=u(b);k&&(i.uniform1fv(k.uniform.m,p),f())},brightness:T=>{let p=(T||0)+1;g.colorMatrix([p,0,0,0,0,0,p,0,0,0,0,0,p,0,0,0,0,0,1,0])},saturation:T=>{let p=(T||0)*2/3+1,b=(p-1)*-.5;g.colorMatrix([p,b,b,0,0,b,p,b,0,0,b,b,p,0,0,0,0,0,1,0])},desaturate:()=>{g.saturation(-1)},contrast:T=>{let p=(T||0)+1,b=-128*(p-1);g.colorMatrix([p,0,0,0,b,0,p,0,0,b,0,0,p,0,b,0,0,0,1,0])},negative:()=>{g.contrast(-2)},hue:T=>{T=(T||0)/180*Math.PI;let p=Math.cos(T),b=Math.sin(T),k=.213,P=.715,I=.072;g.colorMatrix([k+p*(1-k)+b*-k,P+p*-P+b*-P,I+p*-I+b*(1-I),0,0,k+p*-k+b*.143,P+p*(1-P)+b*.14,I+p*-I+b*-.283,0,0,k+p*-k+b*-(1-k),P+p*-P+b*P,I+p*(1-I)+b*I,0,0,0,0,0,1,0])},desaturateLuminance:()=>{g.colorMatrix([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0])},sepia:()=>{g.colorMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0])},brownie:()=>{g.colorMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0])},vintagePinhole:()=>{g.colorMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0])},kodachrome:()=>{g.colorMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0])},technicolor:()=>{g.colorMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0])},polaroid:()=>{g.colorMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0])},shiftToBGR:()=>{g.colorMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0])},convolution:T=>{let p=new Float32Array(T),b=1/l.width,k=1/l.height,P=u(H1);P&&(i.uniform1fv(P.uniform.m,p),i.uniform2f(P.uniform.px,b,k),f())},detectEdges:()=>{g.convolution.call(this,[0,1,0,1,-4,1,0,1,0])},sobelX:()=>{g.convolution.call(this,[-1,0,1,-2,0,2,-1,0,1])},sobelY:()=>{g.convolution.call(this,[-1,-2,-1,0,0,0,1,2,1])},sharpen:T=>{let p=T||1;g.convolution.call(this,[0,-1*p,0,-1*p,1+4*p,-1*p,0,-1*p,0])},emboss:T=>{let p=T||1;g.convolution.call(this,[-2*p,-1*p,0,-1*p,1,1*p,0,1*p,2*p])},blur:T=>{let p=T/7/l.width,b=T/7/l.height,k=u(B1);k&&(i.uniform2f(k.uniform.px,0,b),f(x.INTERMEDIATE),i.uniform2f(k.uniform.px,p,0),f())},pixelate:T=>{let p=T/l.width,b=T/l.height,k=u(F1);k&&(i.uniform2f(k.uniform.size,p,b),f())}};this.add=function(T){let p=Array.prototype.slice.call(arguments,1),b=g[T];s.push({func:b,args:p})},this.reset=function(){s=[]},this.get=function(){return s},this.apply=function(T){y(T.width,T.height),e=0,t||(t=i.createTexture()),i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,T);for(let p=0;px.data())),A=Math.max(s[0][0],s[1][0],s[2][0]),l=(A>1?255:1)/A,c;if(l>1){let x=[U.sub(n[0],o[0]),U.sub(n[1],o[1]),U.sub(n[2],o[2])],i=[U.sub(r[0],o[0]),U.sub(r[1],o[1]),U.sub(r[2],o[2])],y=[U.mul(x[0],l),U.mul(x[1],l),U.mul(x[2],l)],d=U.stack([y[0],y[1],y[2]],2);c=U.reshape(d,[1,t.shape[0]||0,t.shape[1]||0,3]),U.dispose([...x,...i,...y,d])}else c=U.expandDims(t,0);return U.dispose([...n,...o,...r,n,t,e]),c}var X2=3840,R0=null,M0=null,y2=null,e0,ne={inputSum:0,cacheDiff:1,sumMethod:0,inputTensor:void 0};function $t(){ne.inputSum=0,ne.cacheDiff=1,ne.sumMethod=0,ne.inputTensor=void 0}function Ae(e,t){let n;if(R.browser)if(R.worker){if(typeof OffscreenCanvas=="undefined")throw new Error("canvas error: attempted to run in web worker but OffscreenCanvas is not supported");n=new OffscreenCanvas(e,t)}else if(typeof document!="undefined")n=document.createElement("canvas"),n.width=e,n.height=t;else if(typeof navigator!="undefined"&&navigator.product==="ReactNative")if(typeof R.Canvas!="undefined")n=new R.Canvas(e,t);else if(typeof globalThis.Canvas!="undefined")n=new globalThis.Canvas(e,t);else throw new Error("canvas error: attempted to use canvas in react-native without canvas support installed");else throw new Error("canvas error: attempted to run in browser but DOM is not defined");else typeof R.Canvas!="undefined"?n=new R.Canvas(e,t):typeof globalThis.Canvas!="undefined"&&(n=new globalThis.Canvas(e,t));return n}function q2(e,t){let n=t||Ae(e.width,e.height);return n.getContext("2d").drawImage(e,0,0),n}async function U2(e,t,n=!0){var y,d,m;if(!e)return t.debug&&h("input error: input is missing"),{tensor:null,canvas:null};if(!(e instanceof N.Tensor)&&!(typeof Image!="undefined"&&e instanceof Image)&&!(typeof globalThis.Canvas!="undefined"&&e instanceof globalThis.Canvas)&&!(typeof ImageData!="undefined"&&e instanceof ImageData)&&!(typeof ImageBitmap!="undefined"&&e instanceof ImageBitmap)&&!(typeof HTMLImageElement!="undefined"&&e instanceof HTMLImageElement)&&!(typeof HTMLMediaElement!="undefined"&&e instanceof HTMLMediaElement)&&!(typeof HTMLVideoElement!="undefined"&&e instanceof HTMLVideoElement)&&!(typeof HTMLCanvasElement!="undefined"&&e instanceof HTMLCanvasElement)&&!(typeof OffscreenCanvas!="undefined"&&e instanceof OffscreenCanvas))throw new Error("input error: type not recognized");if(e instanceof N.Tensor){let f=null;if(e.isDisposedInternal)throw new Error("input error: attempted to use tensor but it is disposed");if(!e.shape)throw new Error("input error: attempted to use tensor without a shape");if(e.shape.length===3){if(e.shape[2]===3)f=N.expandDims(e,0);else if(e.shape[2]===4){let u=N.slice3d(e,[0,0,0],[-1,-1,3]);f=N.expandDims(u,0),N.dispose(u)}}else e.shape.length===4&&(e.shape[3]===3?f=N.clone(e):e.shape[3]===4&&(f=N.slice4d(e,[0,0,0,0],[-1,-1,-1,3])));if(f==null||f.shape.length!==4||f.shape[0]!==1||f.shape[3]!==3)throw new Error(`input error: attempted to use tensor with unrecognized shape: ${e.shape.toString()}`);if(f.dtype==="int32"){let u=N.cast(f,"float32");N.dispose(f),f=u}return{tensor:f,canvas:t.filter.return?M0:null}}if(typeof e.readyState!="undefined"&&e.readyState<=2)return t.debug&&h("input stream is not ready"),{tensor:null,canvas:R0};let o=e.naturalWidth||e.videoWidth||e.width||e.shape&&e.shape[1]>0,r=e.naturalHeight||e.videoHeight||e.height||e.shape&&e.shape[2]>0;if(!o||!r)return t.debug&&h("cannot determine input dimensions"),{tensor:null,canvas:R0};let s=o,A=r;if(s>X2&&(s=X2,A=Math.trunc(s*r/o)),A>X2&&(A=X2,s=Math.trunc(A*o/r)),(((y=t.filter)==null?void 0:y.width)||0)>0?s=t.filter.width:(((d=t.filter)==null?void 0:d.height)||0)>0&&(s=o*((t.filter.height||0)/r)),(t.filter.height||0)>0?A=t.filter.height:(t.filter.width||0)>0&&(A=r*((t.filter.width||0)/o)),!s||!A)throw new Error("input error: cannot determine dimension");(!R0||R0.width!==s||R0.height!==A)&&(R0=Ae(s,A));let a=R0.getContext("2d");if(typeof ImageData!="undefined"&&e instanceof ImageData?a.putImageData(e,0,0):t.filter.flip&&typeof a.translate!="undefined"?(a.translate(o,0),a.scale(-1,1),a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),a.setTransform(1,0,0,1,0,0)):a.drawImage(e,0,0,o,r,0,0,R0.width,R0.height),(!M0||R0.width!==M0.width||R0.height!==M0.height)&&(M0=Ae(R0.width,R0.height)),t.filter.enabled&&R.webgl.supported?(e0||(e0=R.browser?new G1:null),R.filter=!!e0,e0!=null&&e0.add?(e0.reset(),t.filter.brightness!==0&&e0.add("brightness",t.filter.brightness),t.filter.contrast!==0&&e0.add("contrast",t.filter.contrast),t.filter.sharpness!==0&&e0.add("sharpen",t.filter.sharpness),t.filter.blur!==0&&e0.add("blur",t.filter.blur),t.filter.saturation!==0&&e0.add("saturation",t.filter.saturation),t.filter.hue!==0&&e0.add("hue",t.filter.hue),t.filter.negative&&e0.add("negative"),t.filter.sepia&&e0.add("sepia"),t.filter.vintage&&e0.add("brownie"),t.filter.sepia&&e0.add("sepia"),t.filter.kodachrome&&e0.add("kodachrome"),t.filter.technicolor&&e0.add("technicolor"),t.filter.polaroid&&e0.add("polaroid"),t.filter.pixelate!==0&&e0.add("pixelate",t.filter.pixelate),((m=e0.get())==null?void 0:m.length)>1?M0=e0.apply(R0):M0=e0.draw(R0)):(t.debug&&h("input process error: cannot initialize filters"),R.webgl.supported=!1,t.filter.enabled=!1,q2(R0,M0))):(q2(R0,M0),e0&&(e0=null),R.filter=!!e0),!n)return{tensor:null,canvas:M0};if(!M0)throw new Error("canvas error: cannot create output");let l,c=3;if(typeof ImageData!="undefined"&&e instanceof ImageData||e.data&&e.width&&e.height)if(R.browser&&N.browser)l=N.browser?N.browser.fromPixels(e):null;else{c=e.data.length/e.height/e.width;let f=new Uint8Array(e.data.buffer);l=N.tensor(f,[e.height,e.width,c],"int32")}else if((!y2||M0.width!==y2.width||M0.height!==y2.height)&&(y2=Ae(M0.width,M0.height)),N.browser&&R.browser)t.backend==="webgl"||t.backend==="humangl"||t.backend==="webgpu"?l=N.browser.fromPixels(M0):(y2=q2(M0),l=N.browser.fromPixels(y2));else{let g=q2(M0).getContext("2d").getImageData(0,0,s,A);c=g.data.length/s/A;let T=new Uint8Array(g.data.buffer);l=N.tensor(T,[s,A,c])}if(c===4){let f=N.slice3d(l,[0,0,0],[-1,-1,3]);N.dispose(l),l=f}if(!l)throw new Error("input error: cannot create tensor");let x=N.cast(l,"float32"),i=t.filter.equalization?await Z2(x):N.expandDims(x,0);if(N.dispose([l,x]),t.filter.autoBrightness){let f=N.max(i),u=await f.data();t.filter.brightness=u[0]>1?1-u[0]/255:1-u[0],N.dispose(f)}return{tensor:i,canvas:t.filter.return?M0:null}}async function V1(e,t){let n=!1;if(e.cacheSensitivity===0||!t.shape||t.shape.length!==4||t.shape[1]>3840||t.shape[2]>2160)return n;if(!ne.inputTensor)ne.inputTensor=N.clone(t);else if(ne.inputTensor.shape[1]!==t.shape[1]||ne.inputTensor.shape[2]!==t.shape[2])N.dispose(ne.inputTensor),ne.inputTensor=N.clone(t);else{let o={};o.diff=N.sub(t,ne.inputTensor),o.squared=N.mul(o.diff,o.diff),o.sum=N.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;N.dispose([ne.inputTensor,o.diff,o.squared,o.sum]),ne.inputTensor=N.clone(t),n=s<=(e.cacheSensitivity||0)}return n}async function Z1(e,t,n){let o={};if(!t||!n||t.shape.length!==4||t.shape.length!==n.shape.length)return e.debug||h("invalid input tensor or tensor shapes do not match:",t.shape,n.shape),0;if(t.shape[0]!==1||n.shape[0]!==1||t.shape[3]!==3||n.shape[3]!==3)return e.debug||h("input tensors must be of shape [1, height, width, 3]:",t.shape,n.shape),0;o.input1=N.clone(t),o.input2=t.shape[1]!==n.shape[1]||t.shape[2]!==n.shape[2]?N.image.resizeBilinear(n,[t.shape[1],t.shape[2]]):N.clone(n),o.diff=N.sub(o.input1,o.input2),o.squared=N.mul(o.diff,o.diff),o.sum=N.sum(o.squared);let s=(await o.sum.data())[0]/(t.shape[1]||1)/(t.shape[2]||1)/255/3;return N.dispose([o.input1,o.input2,o.diff,o.squared,o.sum]),s}var z2,S2,j2,E2=class{constructor(){w(this,"browser");w(this,"node");w(this,"worker");w(this,"platform","");w(this,"agent","");w(this,"backends",[]);w(this,"initial");w(this,"filter");w(this,"tfjs");w(this,"offscreen");w(this,"perfadd",!1);w(this,"tensorflow",{version:void 0,gpu:void 0});w(this,"wasm",{supported:void 0,backend:void 0,simd:void 0,multithread:void 0});w(this,"webgl",{supported:void 0,backend:void 0,version:void 0,renderer:void 0,shader:void 0,vendor:void 0});w(this,"webgpu",{supported:void 0,backend:void 0,adapter:void 0});w(this,"cpu",{model:void 0,flags:[]});w(this,"kernels",[]);ue(this,z2,void 0);ue(this,S2,void 0);ue(this,j2,void 0);if(this.browser=typeof navigator!="undefined"&&typeof navigator.appVersion!="undefined",this.node=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined",this.tfjs={version:W0.version["tfjs-core"]},this.offscreen=typeof OffscreenCanvas!="undefined",this.initial=!0,this.worker=this.browser&&this.offscreen?typeof WorkerGlobalScope!="undefined":void 0,typeof navigator!="undefined"&&typeof navigator.userAgent!="undefined"){let t=navigator.userAgent||"",n=t.match(/\(([^()]+)\)/g);if(n!=null&&n[0]){let o=n[0].match(/\(([^()]+)\)/g);this.platform=o!=null&&o[0]?o[0].replace(/\(|\)/g,""):"",this.agent=t.replace(n[0],""),this.platform[1]&&(this.agent=this.agent.replace(n[1],"")),this.agent=this.agent.replace(/ /g," ")}}else typeof process!="undefined"&&(this.platform=`${process.platform} ${process.arch}`,this.agent=`NodeJS ${process.version}`)}get Canvas(){return Y0(this,z2)}set Canvas(t){Re(this,z2,t),globalThis.Canvas=t}get Image(){return Y0(this,S2)}set Image(t){Re(this,S2,t),globalThis.Image=t}get ImageData(){return Y0(this,j2)}set ImageData(t){Re(this,j2,t),globalThis.ImageData=t}async updateBackend(){this.backends=Object.keys(W0.engine().registryFactory);try{this.tensorflow={version:W0.backend().binding?W0.backend().binding.TF_Version:void 0,gpu:W0.backend().binding?W0.backend().binding.isUsingGpuDevice():void 0}}catch(o){}this.wasm.supported=typeof WebAssembly!="undefined",this.wasm.backend=this.backends.includes("wasm"),this.wasm.supported&&this.wasm.backend&&(this.wasm.simd=await W0.env().getAsync("WASM_HAS_SIMD_SUPPORT"),this.wasm.multithread=await W0.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"));let t=Ae(100,100),n=t?t.getContext("webgl2"):void 0;this.webgl.supported=typeof n!="undefined",this.webgl.backend=this.backends.includes("webgl"),this.webgl.supported&&this.webgl.backend&&n&&(this.webgl.version=n.getParameter(n.VERSION),this.webgl.vendor=n.getParameter(n.VENDOR),this.webgl.renderer=n.getParameter(n.RENDERER),this.webgl.shader=n.getParameter(n.SHADING_LANGUAGE_VERSION)),this.webgpu.supported=this.browser&&typeof navigator!="undefined"&&typeof navigator.gpu!="undefined",this.webgpu.backend=this.backends.includes("webgpu");try{if(this.webgpu.supported){let o=await navigator.gpu.requestAdapter();this.webgpu.adapter=await(o==null?void 0:o.requestAdapterInfo())}}catch(o){this.webgpu.supported=!1}try{this.kernels=W0.getKernelsForBackend(W0.getBackend()).map(o=>o.kernelName.toLowerCase())}catch(o){}}updateCPU(){let t={model:"",flags:[]};this.node&&this.platform.startsWith("linux"),this.cpu?this.cpu=t:Object.defineProperty(this,"cpu",{value:t})}};z2=new WeakMap,S2=new WeakMap,j2=new WeakMap;var R=new E2;var K2=class{constructor(){w(this,"config");w(this,"element");w(this,"stream");w(this,"devices",[]);w(this,"enumerate",async()=>{try{let t=await navigator.mediaDevices.enumerateDevices();this.devices=t.filter(n=>n.kind==="videoinput")}catch(t){this.devices=[]}return this.devices});w(this,"start",async t=>{var r,s;if(t!=null&&t.debug&&(this.config.debug=t==null?void 0:t.debug),t!=null&&t.crop&&(this.config.crop=t==null?void 0:t.crop),t!=null&&t.mode&&(this.config.mode=t==null?void 0:t.mode),t!=null&&t.width&&(this.config.width=t==null?void 0:t.width),t!=null&&t.height&&(this.config.height=t==null?void 0:t.height),t!=null&&t.id&&(this.config.id=t==null?void 0:t.id),t!=null&&t.element)if(typeof t.element=="string"){let A=document.getElementById(t.element);if(A&&A instanceof HTMLVideoElement)this.element=A;else return this.config.debug&&h("webcam","cannot get dom element",t.element),`webcam error: cannot get dom element: ${t.element}`}else if(t.element instanceof HTMLVideoElement)this.element=t.element;else return this.config.debug&&h("webcam","unknown dom element",t.element),`webcam error: unknown dom element: ${t.element}`;else this.element=document.createElement("video");let n={audio:!1,video:{facingMode:this.config.mode==="front"?"user":"environment",resizeMode:this.config.crop?"crop-and-scale":"none"}};if(((r=this.config)==null?void 0:r.width)>0&&(n.video.width={ideal:this.config.width}),((s=this.config)==null?void 0:s.height)>0&&(n.video.height={ideal:this.config.height}),this.config.id&&(n.video.deviceId=this.config.id),this.element.addEventListener("play",()=>{this.config.debug&&h("webcam","play")}),this.element.addEventListener("pause",()=>{this.config.debug&&h("webcam","pause")}),this.element.addEventListener("click",async()=>{!this.element||!this.stream||(this.element.paused?await this.element.play():this.element.pause())}),!(navigator!=null&&navigator.mediaDevices))return this.config.debug&&h("webcam error","no devices"),"webcam error: no devices";try{this.stream=await navigator.mediaDevices.getUserMedia(n)}catch(A){return h("webcam",A),`webcam error: ${A}`}return this.stream?(this.element.srcObject=this.stream,await new Promise(A=>{this.element?this.element.onloadeddata=()=>A(!0):A(!1)}),await this.element.play(),this.config.debug&&h("webcam",{width:this.width,height:this.height,label:this.label,stream:this.stream,track:this.track,settings:this.settings,constraints:this.constraints,capabilities:this.capabilities}),`webcam: ${this.label}`):(this.config.debug&&h("webcam error","no stream"),"webcam error no stream")});w(this,"pause",()=>{this.element&&this.element.pause()});w(this,"play",async()=>{this.element&&await this.element.play()});w(this,"stop",()=>{this.config.debug&&h("webcam","stop"),this.track&&this.track.stop()});this.config={element:void 0,debug:!0,mode:"front",crop:!1,width:0,height:0}}get track(){if(this.stream)return this.stream.getVideoTracks()[0]}get capabilities(){if(this.track)return this.track.getCapabilities?this.track.getCapabilities():void 0}get constraints(){if(this.track)return this.track.getConstraints?this.track.getConstraints():void 0}get settings(){if(!this.stream)return;let t=this.stream.getVideoTracks()[0];return t.getSettings?t.getSettings():void 0}get label(){return this.track?this.track.label:""}get paused(){var t;return((t=this.element)==null?void 0:t.paused)||!1}get width(){var t;return((t=this.element)==null?void 0:t.videoWidth)||0}get height(){var t;return((t=this.element)==null?void 0:t.videoHeight)||0}};var f2=V(G());var e5={};ze(e5,{"affectnet-mobilenet":()=>br,age:()=>gr,"anti-spoofing":()=>_r,antispoof:()=>ar,blazeface:()=>ir,"blazeface-back":()=>Tr,"blazeface-front":()=>vr,"blazepose-detector":()=>Rr,"blazepose-full":()=>Mr,"blazepose-heavy":()=>Pr,"blazepose-lite":()=>kr,centernet:()=>lr,default:()=>ds,efficientpose:()=>wr,"efficientpose-i-lite":()=>$r,"efficientpose-ii-lite":()=>es,"efficientpose-iv":()=>ts,emotion:()=>cr,faceboxes:()=>Er,facemesh:()=>dr,"facemesh-attention":()=>Sr,"facemesh-attention-pinto":()=>zr,"facemesh-detection-full":()=>jr,"facemesh-detection-short":()=>Ir,faceres:()=>xr,"faceres-deep":()=>Nr,gear:()=>Cr,"gear-e1":()=>Lr,"gear-e2":()=>Or,gender:()=>Dr,"gender-ssrnet-imdb":()=>Wr,handdetect:()=>Fr,"handlandmark-full":()=>Br,"handlandmark-lite":()=>yr,"handlandmark-sparse":()=>Hr,handskeleton:()=>Gr,handtrack:()=>fr,"insightface-efficientnet-b0":()=>ns,"insightface-ghostnet-strides1":()=>os,"insightface-ghostnet-strides2":()=>rs,"insightface-mobilenet-emore":()=>ss,"insightface-mobilenet-swish":()=>As,iris:()=>mr,liveness:()=>pr,meet:()=>Vr,mobileface:()=>Zr,mobilefacenet:()=>Xr,models:()=>ur,"movenet-lightning":()=>hr,"movenet-multipose":()=>qr,"movenet-thunder":()=>Ur,nanodet:()=>Yr,"nanodet-e":()=>as,"nanodet-g":()=>is,"nanodet-m":()=>ls,"nanodet-t":()=>cs,posenet:()=>Kr,rvm:()=>Jr,selfie:()=>Qr});var ar=853098,ir=538928,lr=4030290,cr=820516,dr=1477958,xr=6978814,yr=2023432,fr=2964837,mr=2599092,pr=592976,ur=0,hr=4650216,br=6920630,gr=161240,Tr=538928,vr=402048,Rr=5928856,Mr=6339202,Pr=27502466,kr=2726402,wr=5651240,Er=2013002,zr=2387598,Sr=2382414,jr=1026192,Ir=201268,Nr=13957620,Lr=112438,Or=112438,Cr=1498916,Wr=161236,Dr=201808,Fr=3515612,Br=5431368,Hr=5286322,Gr=5502280,Vr=372228,Zr=2183192,Xr=5171976,qr=9448838,Ur=12477112,Yr=7574558,Kr=5032780,Jr=3739355,Qr=212886,_r=853098,$r=2269064,es=5651240,ts=25643252,ns=13013224,os=8093408,rs=8049584,ss=6938536,As=12168584,as=12319156,is=7574558,ls=1887474,cs=5294216,ds={antispoof:ar,blazeface:ir,centernet:lr,emotion:cr,facemesh:dr,faceres:xr,"handlandmark-lite":yr,handtrack:fr,iris:mr,liveness:pr,models:ur,"movenet-lightning":hr,"affectnet-mobilenet":br,age:gr,"blazeface-back":Tr,"blazeface-front":vr,"blazepose-detector":Rr,"blazepose-full":Mr,"blazepose-heavy":Pr,"blazepose-lite":kr,efficientpose:wr,faceboxes:Er,"facemesh-attention-pinto":zr,"facemesh-attention":Sr,"facemesh-detection-full":jr,"facemesh-detection-short":Ir,"faceres-deep":Nr,"gear-e1":Lr,"gear-e2":Or,gear:Cr,"gender-ssrnet-imdb":Wr,gender:Dr,handdetect:Fr,"handlandmark-full":Br,"handlandmark-sparse":Hr,handskeleton:Gr,meet:Vr,mobileface:Zr,mobilefacenet:Xr,"movenet-multipose":qr,"movenet-thunder":Ur,nanodet:Yr,posenet:Kr,rvm:Jr,selfie:Qr,"anti-spoofing":_r,"efficientpose-i-lite":$r,"efficientpose-ii-lite":es,"efficientpose-iv":ts,"insightface-efficientnet-b0":ns,"insightface-ghostnet-strides1":os,"insightface-ghostnet-strides2":rs,"insightface-mobilenet-emore":ss,"insightface-mobilenet-swish":As,"nanodet-e":as,"nanodet-g":is,"nanodet-m":ls,"nanodet-t":cs};var D0={cacheModels:!0,cacheSupported:!0,verbose:!0,debug:!1,modelBasePath:""},I0={};async function xs(e,t){return D0.debug&&h("load model fetch:",e,t),fetch(e,t)}function X1(e){D0.cacheModels=e.cacheModels,D0.verbose=e.debug,D0.modelBasePath=e.modelBasePath}async function L(e){var c,x,i,y;let t=O1(D0.modelBasePath,e||"");t.toLowerCase().endsWith(".json")||(t+=".json");let n=t.includes("/")?t.split("/"):t.split("\\"),o=n[n.length-1].replace(".json",""),r="indexeddb://"+o;I0[o]={name:o,sizeFromManifest:0,sizeLoadedWeights:0,sizeDesired:e5[o],inCache:!1,url:""},D0.cacheSupported=typeof indexedDB!="undefined";let s={};try{s=D0.cacheSupported&&D0.cacheModels?await f2.io.listModels():{}}catch(d){D0.cacheSupported=!1}I0[o].inCache=D0.cacheSupported&&D0.cacheModels&&Object.keys(s).includes(r),I0[o].url=I0[o].inCache?r:t;let A=typeof fetch=="undefined"?{}:{fetchFunc:(d,m)=>xs(d,m)},a=new f2.GraphModel(I0[o].url,A),l=!1;try{a.findIOHandler(),D0.debug&&h("model load handler:",a.handler)}catch(d){h("error finding model i/o handler:",t,d)}try{let d=await((c=a.handler)==null?void 0:c.load())||null;I0[o].sizeFromManifest=((x=d==null?void 0:d.weightData)==null?void 0:x.byteLength)||0,d?a.loadSync(d):a=await f2.loadGraphModel(I0[o].inCache?r:t,A),I0[o].sizeLoadedWeights=((y=(i=a.artifacts)==null?void 0:i.weightData)==null?void 0:y.byteLength)||0,D0.verbose&&h("load:",{model:o,url:a.modelUrl,bytes:I0[o].sizeLoadedWeights}),l=!0}catch(d){h("error loading model:",t,d)}if(l&&D0.cacheModels&&D0.cacheSupported&&!I0[o].inCache)try{let d=await a.save(r);D0.debug&&h("model saved:",r,d)}catch(d){h("error saving model:",t,d)}return a}var t5="3.2.1";var S=V(G());var u0=V(G());var o0={name:"humangl",priority:999,canvas:null,gl:null,extensions:[],webGLattr:{alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!1,desynchronized:!0}};function ms(){let e=o0.gl;e&&(o0.extensions=e.getSupportedExtensions())}function q1(e){var t;if(e.config.backend==="humangl"&&(o0.name in u0.engine().registry&&!((t=o0==null?void 0:o0.gl)!=null&&t.getParameter(o0.gl.VERSION))&&(h("humangl error: backend invalid context"),e.models.reset()),!u0.findBackend(o0.name))){try{o0.canvas=Ae(100,100)}catch(r){h("humangl error: cannot create canvas:",r);return}try{if(o0.gl=o0.canvas.getContext("webgl2",o0.webGLattr),!o0.gl){h("humangl error: cannot get webgl context");return}if(!o0.gl.getParameter(o0.gl.VERSION).includes("2.0")){h("backend override: using fallback webgl backend as webgl 2.0 is not detected"),e.config.backend="webgl";return}o0.canvas&&(o0.canvas.addEventListener("webglcontextlost",s=>{throw h("humangl error:",s.type),h("possible browser memory leak using webgl or conflict with multiple backend registrations"),e.emit("error"),new Error("backend error: webgl context lost")}),o0.canvas.addEventListener("webglcontextrestored",s=>{h("humangl error: context restored:",s)}),o0.canvas.addEventListener("webglcontextcreationerror",s=>{h("humangl error: context create:",s)}))}catch(r){h("humangl error: cannot get webgl context:",r);return}try{u0.setWebGLContext(2,o0.gl)}catch(r){h("humangl error: cannot set webgl context:",r);return}try{let r=new u0.GPGPUContext(o0.gl);u0.registerBackend(o0.name,()=>new u0.MathBackendWebGL(r),o0.priority)}catch(r){h("humangl error: cannot register webgl backend:",r);return}try{u0.getKernelsForBackend("webgl").forEach(s=>{let A={...s,backendName:o0.name};u0.registerKernel(A)})}catch(r){h("humangl error: cannot update webgl backend registration:",r);return}try{u0.env().flagRegistry.WEBGL_VERSION&&u0.env().set("WEBGL_VERSION",2)}catch(r){h("humangl error: cannot set WebGL backend flags:",r);return}ms();let n=u0.backend(),o=typeof n.gpgpu!="undefined"?n.getGPGPUContext().gl:null;o?e.config.debug&&h("humangl backend registered:",{webgl:o.getParameter(o.VERSION),renderer:o.getParameter(o.RENDERER)}):h("humangl error: no current gl context:",o,o0.gl)}}var Se=V(G()),C={tf255:255,tf1:1,tf2:2,tf05:.5,tf127:127.5,rgb:[.2989,.587,.114]};function U1(){C.tf255=Se.scalar(255,"float32"),C.tf1=Se.scalar(1,"float32"),C.tf2=Se.scalar(2,"float32"),C.tf05=Se.scalar(.5,"float32"),C.tf127=Se.scalar(127.5,"float32"),C.rgb=Se.tensor1d([.2989,.587,.114],"float32")}async function hs(){var e;return await R.updateBackend(),(e=R.tensorflow)!=null&&e.version?"tensorflow":R.webgpu.supported&&R.webgpu.backend?"webgpu":R.webgl.supported&&R.webgl.backend?"webgl":R.wasm.supported&&R.wasm.backend?"wasm":"cpu"}function bs(e){let t=[];if(!R.kernels.includes("mod")){let n={kernelName:"Mod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.sub(o.inputs.a,S.mul(S.div(o.inputs.a,o.inputs.b),o.inputs.b)))};S.registerKernel(n),R.kernels.push("mod"),t.push("mod")}if(!R.kernels.includes("floormod")){let n={kernelName:"FloorMod",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>S.add(S.mul(S.floorDiv(o.inputs.a,o.inputs.b),o.inputs.b),S.mod(o.inputs.a,o.inputs.b)))};S.registerKernel(n),R.kernels.push("floormod"),t.push("floormod")}if(!R.kernels.includes("rotatewithoffset")&&e.softwareKernels){let n={kernelName:"RotateWithOffset",backendName:S.getBackend(),kernelFunc:o=>S.tidy(()=>{let r=S.getBackend();S.setBackend("cpu");let s=S.image.rotateWithOffset(o.inputs.image,o.attrs.radians,o.attrs.fillValue,o.attrs.center);return S.setBackend(r),s})};S.registerKernel(n),R.kernels.push("rotatewithoffset"),t.push("rotatewithoffset")}t.length>0&&e.debug&&h("registered kernels:",t)}var Y1={};async function I2(e,t=!1){var n,o;if(e.state="backend",((n=e.config.backend)==null?void 0:n.length)===0&&(e.config.backend=await hs()),t||R.initial||e.config.backend&&e.config.backend.length>0&&S.getBackend()!==e.config.backend){let r=v();if(e.config.backend&&e.config.backend.length>0){typeof window=="undefined"&&typeof WorkerGlobalScope!="undefined"&&e.config.debug&&e.config.debug&&h("running inside web worker"),typeof navigator!="undefined"&&((o=navigator==null?void 0:navigator.userAgent)!=null&&o.toLowerCase().includes("electron"))&&e.config.debug&&h("running inside electron");let s=Object.keys(S.engine().registryFactory);if(e.config.backend==="humangl"&&!s.includes("humangl")&&(q1(e),s=Object.keys(S.engine().registryFactory)),e.config.debug&&h("available backends:",s),R.browser&&!R.node&&e.config.backend==="tensorflow"&&s.includes("webgl")&&(e.config.debug&&h("override: backend set to tensorflow while running in browser"),e.config.backend="webgl"),R.node&&!R.browser&&(e.config.backend==="webgl"||e.config.backend==="humangl")&&s.includes("tensorflow")&&(e.config.debug&&h(`override: backend set to ${e.config.backend} while running in nodejs`),e.config.backend="tensorflow"),R.browser&&e.config.backend==="webgpu")if(typeof navigator=="undefined"||typeof navigator.gpu=="undefined")h("override: backend set to webgpu but browser does not support webgpu"),e.config.backend="webgl";else{let A=await navigator.gpu.requestAdapter();if(e.config.debug&&h("enumerated webgpu adapter:",A),!A)h("override: backend set to webgpu but browser reports no available gpu"),e.config.backend="webgl";else{let a="requestAdapterInfo"in A?await A.requestAdapterInfo():void 0;h("webgpu adapter info:",a)}}if(s.includes(e.config.backend)||(h(`error: backend ${e.config.backend} not found in registry`),e.config.backend=R.node?"tensorflow":"webgl",e.config.debug&&h(`override: setting backend ${e.config.backend}`)),e.config.debug&&h("setting backend:",[e.config.backend]),e.config.backend==="wasm"){if(S.env().flagRegistry.CANVAS2D_WILL_READ_FREQUENTLY&&S.env().set("CANVAS2D_WILL_READ_FREQUENTLY",!0),e.config.debug&&h("wasm path:",e.config.wasmPath),typeof S.setWasmPaths!="undefined")S.setWasmPaths(e.config.wasmPath,e.config.wasmPlatformFetch);else throw new Error("backend error: attempting to use wasm backend but wasm path is not set");let A=!1,a=!1;try{A=await S.env().getAsync("WASM_HAS_MULTITHREAD_SUPPORT"),a=await S.env().getAsync("WASM_HAS_SIMD_SUPPORT"),e.config.debug&&h(`wasm execution: ${a?"simd":"no simd"} ${A?"multithreaded":"singlethreaded"}`),e.config.debug&&!a&&h("warning: wasm simd support is not enabled")}catch(l){h("wasm detection failed")}}try{await S.setBackend(e.config.backend),await S.ready()}catch(A){return h("error: cannot set backend:",e.config.backend,A),!1}e.config.debug&&(Y1=JSON.parse(JSON.stringify(S.env().flags)))}if((S.getBackend()==="humangl"||S.getBackend()==="webgl")&&(S.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&S.env().set("WEBGL_USE_SHAPES_UNIFORMS",!0),S.env().flagRegistry.WEBGL_EXP_CONV&&S.env().set("WEBGL_EXP_CONV",!0),e.config.debug&&typeof e.config.deallocate!="undefined"&&e.config.deallocate&&(h("changing webgl: WEBGL_DELETE_TEXTURE_THRESHOLD:",!0),S.env().set("WEBGL_DELETE_TEXTURE_THRESHOLD",0))),S.getBackend(),e.config.debug){let s=S.env().flags,A={};for(let a of Object.keys(s))Y1[a]!==s[a]&&(A[a]=s[a]);e.config.debug&&Object.keys(A).length>0&&h("backend:",S.getBackend(),"flags:",A)}if(e.config.flags&&Object.keys(e.config.flags).length>0){e.config.debug&&h("flags:",e.config.flags);for(let[s,A]of Object.entries(e.config.flags))S.env().set(s,A)}S.enableProdMode(),U1(),e.performance.initBackend=Math.trunc(v()-r),e.config.backend=S.getBackend(),await R.updateBackend(),bs(e.config)}return!0}function J2(e,t){for(let n of e){let o={kernelName:n,backendName:t.backend,kernelFunc:r=>{var s;return t.debug&&h("kernelFunc",n,t.backend,r),(s=r==null?void 0:r.inputs)==null?void 0:s.info}};S.registerKernel(o)}R.kernels=S.getKernelsForBackend(S.getBackend()).map(n=>n.kernelName.toLowerCase())}var nt={};ze(nt,{all:()=>Js,body:()=>_2,canvas:()=>Ks,face:()=>Q2,gesture:()=>tt,hand:()=>$2,init:()=>i5,object:()=>et,options:()=>f0,person:()=>Ys});var oe=e=>{if(!e)h("draw error: invalid canvas");else if(!e.getContext)h("draw error: canvas context not defined");else{let t=e.getContext("2d",{willReadFrequently:!0});if(!t)h("draw error: cannot get canvas context");else return t}return null},Je=e=>Math.round(e*180/Math.PI),Y=(e,t,n)=>e.replace(t,typeof n=="number"?n.toFixed(1):n),Qe=(e,t)=>{if(!t.useDepth||typeof e=="undefined")return t.color;let n=Uint8ClampedArray.from([127+2*e,127-2*e,255]);return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${t.alpha})`};function re(e,t,n,o,r){let s=t.replace(/\[.*\]/g,"").split(` +`).map(a=>a.trim()),A=Math.max(0,n);for(let a=s.length-1;a>=0;a--){let l=a*r.lineHeight+o;r.shadowColor&&r.shadowColor!==""&&(e.fillStyle=r.shadowColor,e.fillText(s[a],A+5,l+16)),e.fillStyle=r.labelColor,e.fillText(s[a],A+4,l+15)}}function he(e,t,n,o,r){e.fillStyle=Qe(o,r),e.beginPath(),e.arc(t,n,r.pointSize,0,2*Math.PI),e.fill()}function be(e,t,n,o,r,s){if(e.beginPath(),e.lineWidth=s.lineWidth,s.useCurves){let A=(t+t+o)/2,a=(n+n+r)/2;e.ellipse(A,a,o/2,r/2,0,0,2*Math.PI)}else e.moveTo(t+s.roundRect,n),e.lineTo(t+o-s.roundRect,n),e.quadraticCurveTo(t+o,n,t+o,n+s.roundRect),e.lineTo(t+o,n+r-s.roundRect),e.quadraticCurveTo(t+o,n+r,t+o-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 n5(e,t,n){if(!(t.length<2)){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(let o of t)e.strokeStyle=Qe(o[2]||0,n),e.lineTo(Math.trunc(o[0]),Math.trunc(o[1]));e.stroke(),n.fillPolygons&&(e.closePath(),e.fill())}}function J1(e,t,n){if(!(t.length<2)){if(e.lineWidth=n.lineWidth,!n.useCurves||t.length<=2){n5(e,t,n);return}e.moveTo(t[0][0],t[0][1]);for(let o=0;oN2[e]),Ga=Ts.map(e=>N2[e]),Va=vs.map(e=>N2[e]);function je(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Rs=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Ms=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ps=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],ks=[[474,475],[475,476],[476,477],[477,474]],ws=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Es=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],zs=[[469,470],[470,471],[471,472],[472,469]],Ss=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],Za={lips:je(Rs),leftEye:je(Ms),leftEyebrow:je(Ps),leftIris:je(ks),rightEye:je(ws),rightEyebrow:je(Es),rightIris:je(zs),faceOval:je(Ss)};var js=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],Is=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],Ns=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],Ls=[[474,475],[475,476],[476,477],[477,474]],Os=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],Cs=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],Ws=[[469,470],[470,471],[471,472],[472,469]],Ds=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]];function Ie(e){let t=e.map(n=>n[0]);return t.push(e[e.length-1][1]),t}var Fs={lips:Ie(js),leftEye:Ie(Is),leftEyebrow:Ie(Ns),leftIris:Ie(Ls),rightEye:Ie(Os),rightEyebrow:Ie(Cs),rightIris:Ie(Ws),faceOval:Ie(Ds)},Bs=Object.entries(Fs).map(([e,t])=>t.map(n=>[n,e])).flat(),Xa=new Map(Bs),L2=[61,146,91,181,84,17,314,405,321,375,291,185,40,39,37,0,267,269,270,409,78,95,88,178,87,14,317,402,318,324,308,191,80,81,82,13,312,311,310,415,76,77,90,180,85,16,315,404,320,307,306,184,74,73,72,11,302,303,304,408,62,96,89,179,86,15,316,403,319,325,292,183,42,41,38,12,268,271,272,407],e2=[33,7,163,144,145,153,154,155,133,246,161,160,159,158,157,173,130,25,110,24,23,22,26,112,243,247,30,29,27,28,56,190,226,31,228,229,230,231,232,233,244,113,225,224,223,222,221,189,35,124,46,53,52,65,143,111,117,118,119,120,121,128,245,156,70,63,105,66,107,55,193],t2=[263,249,390,373,374,380,381,382,362,466,388,387,386,385,384,398,359,255,339,254,253,252,256,341,463,467,260,259,257,258,286,414,446,261,448,449,450,451,452,453,464,342,445,444,443,442,441,413,265,353,276,283,282,295,372,340,346,347,348,349,350,357,465,383,300,293,334,296,336,285,417];var q;function Hs(e,t){var o,r,s,A,a,l,c,x,i;if(!q.drawLabels||((o=q.faceLabels)==null?void 0:o.length)===0)return;let n=q.faceLabels.slice();if(n=Y(n,"[id]",e.id.toFixed(0)),e.score&&(n=Y(n,"[score]",100*e.score)),e.gender&&(n=Y(n,"[gender]",e.gender)),e.genderScore&&(n=Y(n,"[genderScore]",100*e.genderScore)),e.age&&(n=Y(n,"[age]",e.age)),e.distance&&(n=Y(n,"[distance]",100*e.distance)),e.real&&(n=Y(n,"[real]",100*e.real)),e.live&&(n=Y(n,"[live]",100*e.live)),e.emotion&&e.emotion.length>0){let y=e.emotion.map(d=>`${Math.trunc(100*d.score)}% ${d.emotion}`);y.length>3&&(y.length=3),n=Y(n,"[emotions]",y.join(" "))}(s=(r=e.rotation)==null?void 0:r.angle)!=null&&s.roll&&(n=Y(n,"[roll]",Je(e.rotation.angle.roll))),(a=(A=e.rotation)==null?void 0:A.angle)!=null&&a.yaw&&(n=Y(n,"[yaw]",Je(e.rotation.angle.yaw))),(c=(l=e.rotation)==null?void 0:l.angle)!=null&&c.pitch&&(n=Y(n,"[pitch]",Je(e.rotation.angle.pitch))),(i=(x=e.rotation)==null?void 0:x.gaze)!=null&&i.bearing&&(n=Y(n,"[gaze]",Je(e.rotation.gaze.bearing))),re(t,n,e.box[0],e.box[1],q)}function Gs(e,t){var n,o,r,s;if((n=e.annotations)!=null&&n.leftEyeIris&&((o=e.annotations)!=null&&o.leftEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.leftEyeIris[3][0]-e.annotations.leftEyeIris[1][0])/2,a=Math.abs(e.annotations.leftEyeIris[4][1]-e.annotations.leftEyeIris[2][1])/2;t.ellipse(e.annotations.leftEyeIris[0][0],e.annotations.leftEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}if((r=e.annotations)!=null&&r.rightEyeIris&&((s=e.annotations)!=null&&s.rightEyeIris[0])){t.strokeStyle=q.useDepth?"rgba(255, 200, 255, 0.3)":q.color,t.beginPath();let A=Math.abs(e.annotations.rightEyeIris[3][0]-e.annotations.rightEyeIris[1][0])/2,a=Math.abs(e.annotations.rightEyeIris[4][1]-e.annotations.rightEyeIris[2][1])/2;t.ellipse(e.annotations.rightEyeIris[0][0],e.annotations.rightEyeIris[0][1],A,a,0,0,2*Math.PI),t.stroke(),q.fillPolygons&&(t.fillStyle=q.useDepth?"rgba(255, 255, 200, 0.3)":q.color,t.fill())}}function Vs(e,t){var n;if(q.drawGaze&&((n=e.rotation)!=null&&n.angle)&&typeof Path2D!="undefined"){t.strokeStyle="pink";let o=e.box[0]+e.box[2]/2-e.box[3]*Je(e.rotation.angle.yaw)/90,r=e.box[1]+e.box[3]/2+e.box[2]*Je(e.rotation.angle.pitch)/90,s=new Path2D(` M ${e.box[0]+e.box[2]/2} ${e.box[1]} C ${o} ${e.box[1]}, @@ -118,7 +118,7 @@ live: [live]% [emotions] roll: [roll]\xB0 yaw:[yaw]\xB0 pitch:[pitch]\xB0 - gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var a5=0;function Ys(e,t,n){let o=a0(f0,n);if(!t||!e)return;let r=oe(e);if(r){r.lineJoin="round",r.font=o.font;for(let s=0;sc5,kpt:()=>l5});var l5=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],c5={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var D=G(H());var se,n2=224,$1,Qs=5,rt=[8,16,32,32,32];function _s(){let e=[],t=0;for(;tn.x)),y:D.tensor1d(e.map(n=>n.y))}}async function e3(e){if(R.initial&&(se=null),!se&&e.body.detector&&e.body.detector.modelPath){se=await L(e.body.detector.modelPath);let t=se!=null&&se.executor?Object.values(se.modelSignature.inputs):void 0;n2=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&se&&h("cached model:",se.modelUrl);return _s(),se}var _1=[5,5];function $s(e,t){return D.tidy(()=>{let n=D.split(e,12,1),o=D.squeeze(n[0]),r=D.squeeze(n[1]),s=D.squeeze(n[2]),A=D.squeeze(n[3]);o=D.add(D.div(o,n2),t.x),r=D.add(D.div(r,n2),t.y),s=D.mul(D.div(s,n2),_1[0]),A=D.mul(D.div(A,n2),_1[1]);let a=D.sub(o,D.div(s,2)),l=D.sub(r,D.div(A,2)),c=D.add(a,s),x=D.add(l,A);return D.stack([a,l,c,x],1)})}async function eA(e,t,n,o){var c,x;let r=[],s={};s.boxes=$s(e,$1),s.scores=D.sigmoid(t),s.nms=await D.image.nonMaxSuppressionAsync(s.boxes,s.scores,1,((c=n.body.detector)==null?void 0:c.minConfidence)||.1,((x=n.body.detector)==null?void 0:x.iouThreshold)||.1);let A=await s.nms.data(),a=await s.scores.data(),l=await s.boxes.array();for(let i of Array.from(A)){let f=a[i],d=l[i],m=[Math.round(d[0]*o[0]),Math.round(d[1]*o[1]),Math.round(d[2]*o[0]),Math.round(d[3]*o[1])],y={score:f,boxRaw:d,box:m};r.push(y)}return Object.keys(s).forEach(i=>D.dispose(s[i])),r}async function t3(e,t,n){let o={};o.res=se==null?void 0:se.execute(e,["Identity"]),o.logitsRaw=D.slice(o.res,[0,0,0],[1,-1,1]),o.boxesRaw=D.slice(o.res,[0,0,1],[1,-1,-1]),o.logits=D.squeeze(o.logitsRaw),o.boxes=D.squeeze(o.boxesRaw);let r=await eA(o.boxes,o.logits,t,n);return Object.keys(o).forEach(s=>D.dispose(o[s])),r}function Le(e,t=[1,1]){let n=[e.map(a=>a[0]),e.map(a=>a[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[o[0],o[1],r[0]-o[0],r[1]-o[1]],A=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:A}}function n3(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[(o[0]+r[0])/2,(o[1]+r[1])/2],A=Math.max(s[0]-o[0],s[1]-o[1],-s[0]+r[0],-s[1]+r[1]),a=[Math.trunc(s[0]-A),Math.trunc(s[1]-A),Math.trunc(2*A),Math.trunc(2*A)],l=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:l}}function st(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var Z0,x5=256,d5=Number.MAX_SAFE_INTEGER,tA={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},at=[],Oe=[[0,0],[0,0],[0,0],[0,0]],o3=0,r3=e=>1-1/(1+Math.exp(e)),A3=e=>e3(e);async function a3(e){if(R.initial&&(Z0=null),Z0)e.debug&&h("cached model:",Z0.modelUrl);else{Z0=await L(e.body.modelPath);let t=Z0!=null&&Z0.executor?Object.values(Z0.modelSignature.inputs):void 0;x5=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Z0}function s3(e,t,n){var s,A;let o={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((A=e==null?void 0:e.shape)!=null&&A[2]))return e;let r;if(n&&(o.cropped=X0.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let a=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Oe=[[0,0],a,l,[0,0]],o.pad=X0.pad(o.cropped||e,Oe),o.resize=X0.image.resizeBilinear(o.pad,[t,t]),r=X0.div(o.resize,C.tf255)}else e.shape[1]!==t?(o.resize=X0.image.resizeBilinear(o.cropped||e,[t,t]),r=X0.div(o.resize,C.tf255)):r=X0.div(o.cropped||e,C.tf255);return Object.keys(o).forEach(a=>X0.dispose(o[a])),r}function nA(e,t,n){for(let o of e)o.position=[Math.trunc(o.position[0]*(t[0]+Oe[2][0]+Oe[2][1])/t[0]-Oe[2][0]),Math.trunc(o.position[1]*(t[1]+Oe[1][0]+Oe[1][1])/t[1]-Oe[1][0]),o.position[2]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1],2*o.position[2]/(t[0]+t[1])];if(n){let o=n[2]-n[0],r=n[3]-n[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+n[1],s.positionRaw[1]/o+n[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function oA(e){let t=e.find(a=>a.part==="leftPalm"),n=e.find(a=>a.part==="leftWrist"),o=e.find(a=>a.part==="leftIndex");t.position[2]=((n.position[2]||0)+(o.position[2]||0))/2;let r=e.find(a=>a.part==="rightPalm"),s=e.find(a=>a.part==="rightWrist"),A=e.find(a=>a.part==="rightIndex");r.position[2]=((s.position[2]||0)+(A.position[2]||0))/2}async function rA(e,t,n){if(!(Z0!=null&&Z0.executor))return null;let o={};[o.ld,o.segmentation,o.heatmap,o.world,o.poseflag]=Z0==null?void 0:Z0.execute(e,tA.landmarks);let r=(await o.poseflag.data())[0],s=await o.ld.data(),A=await o.world.data();Object.keys(o).forEach(m=>X0.dispose(o[m]));let a=[],l=5;for(let m=0;mm.position),i=Le(x,[n[0],n[1]]),f={};for(let[m,y]of Object.entries(c5)){let u=[];for(let T=0;Tb.part===y[T]),p=c.find(b=>b.part===y[T+1]);g&&p&&u.push([g.position,p.position])}f[m]=u}return{id:0,score:Math.trunc(100*r)/100,box:i.box,boxRaw:i.boxRaw,keypoints:c,annotations:f}}async function y5(e,t){var s,A,a;let n=[e.shape[2]||0,e.shape[1]||0],o=(t.body.skipTime||0)>v()-o3,r=d5<(t.body.skipFrames||0);if(t.skipAllowed&&o&&r&&at!==null)d5++;else{let l=[];if((A=(s=t.body)==null?void 0:s.detector)!=null&&A.enabled){let c=s3(e,224);l=await t3(c,t,n),X0.dispose(c)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let c=0;cF0.dispose(o[c])),r}async function p5(e,t){if(!(q0!=null&&q0.executor))return[];let n=(t.object.skipTime||0)>v()-l3,o=m5<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&f5.length>0?(m5++,f5):(m5=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=F0.image.resizeBilinear(e,[o2,o2]),a=t.object.enabled?q0==null?void 0:q0.execute(A,["tower_0/detections"]):null;l3=v(),F0.dispose(A);let l=await sA(a,s,t);f5=l,r(l)}))}var J=G(H());var it={};ze(it,{connected:()=>h5,kpt:()=>u5});var u5=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],h5={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var i0,x3=0,B0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},b5=Number.MAX_SAFE_INTEGER;async function y3(e){return R.initial&&(i0=null),i0?e.debug&&h("cached model:",i0.modelUrl):i0=await L(e.body.modelPath),i0}async function AA(e,t){let[n,o]=e.shape,r=J.reshape(e,[o*n]),s=J.max(r,0),A=(await s.data())[0];if(A>t){let a=J.argMax(r,0),l=J.mod(a,n),c=(await l.data())[0],x=J.div(a,n),i=(await x.data())[0];return J.dispose([r,s,a,l,x]),[c,i,A]}return J.dispose([r,s]),[0,0,A]}async function g5(e,t){if(!(i0!=null&&i0.executor)||!(i0!=null&&i0.inputs[0].shape))return[];let n=(t.body.skipTime||0)>v()-x3,o=b5<(t.body.skipFrames||0);return t.skipAllowed&&n&&o&&Object.keys(B0.keypoints).length>0?(b5++,[B0]):(b5=0,new Promise(async r=>{let s=J.tidy(()=>{var m,y;let i=J.image.resizeBilinear(e,[((m=i0==null?void 0:i0.inputs[0].shape)==null?void 0:m[2])||0,((y=i0==null?void 0:i0.inputs[0].shape)==null?void 0:y[1])||0],!1),f=J.mul(i,C.tf2);return J.sub(f,C.tf1)}),A;if(t.body.enabled&&(A=i0==null?void 0:i0.execute(s)),x3=v(),J.dispose(s),A){B0.keypoints.length=0;let i=J.squeeze(A);J.dispose(A);let f=J.unstack(i,2);J.dispose(i);for(let d=0;d(t.body.minConfidence||0)&&B0.keypoints.push({score:Math.round(100*u)/100,part:u5[d],positionRaw:[m/i0.inputs[0].shape[2],y/i0.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/i0.inputs[0].shape[2]),Math.round(e.shape[1]*y/i0.inputs[0].shape[1])]})}f.forEach(d=>J.dispose(d))}B0.score=B0.keypoints.reduce((i,f)=>f.score>i?f.score:i,0);let a=B0.keypoints.map(i=>i.position[0]),l=B0.keypoints.map(i=>i.position[1]);B0.box=[Math.min(...a),Math.min(...l),Math.max(...a)-Math.min(...a),Math.max(...l)-Math.min(...l)];let c=B0.keypoints.map(i=>i.positionRaw[0]),x=B0.keypoints.map(i=>i.positionRaw[1]);B0.boxRaw=[Math.min(...c),Math.min(...x),Math.max(...c)-Math.min(...c),Math.max(...x)-Math.min(...x)];for(let[i,f]of Object.entries(h5)){let d=[];for(let m=0;mT.part===f[m]),u=B0.keypoints.find(T=>T.part===f[m+1]);y&&u&&y.score>(t.body.minConfidence||0)&&u.score>(t.body.minConfidence||0)&&d.push([y.position,u.position])}B0.annotations[i]=d}r([B0])}))}var l0=G(H());var De=G(H());var O=G(H());var Me=G(H());var p2=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],lt=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],ct=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],dt=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],u3=(e,t,n)=>{let o=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(A=>[(A[0]+n[0])*t[0],(A[1]+n[1])*t[1]]);return{startPoint:o,endPoint:r,landmarks:s,confidence:e.confidence}},T5=(e,t,n)=>{let o=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/o,e.startPoint[0]/r,e.endPoint[1]/o,e.endPoint[0]/r],A=Me.image.cropAndResize(t,[s],[0],n),a=Me.div(A,C.tf255);return Me.dispose(A),a},xt=(e,t)=>{let n=lt(e),o=p2(e),r=[t*o[0]/2,t*o[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:o}},yt=e=>{let t=lt(e),n=p2(e),o=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-o),Math.round(t[1]-o)],endPoint:[Math.round(t[0]+o),Math.round(t[1]+o)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},h3=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},v5=[[1,0,0],[0,1,0],[0,0,1]],aA=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),iA=(e,t)=>aA(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var m3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],r2=(e,t)=>{let n=0;for(let o=0;o{let n=[];for(let o=0;o{let n=[],o=e.length;for(let r=0;r{let n=Math.cos(e),o=Math.sin(e),r=[[n,-o,0],[o,n,0],[0,0,1]],s=m3(t[0],t[1]),A=p3(s,r),a=m3(-t[0],-t[1]);return p3(A,a)},cA=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],o=[-r2(t[0],n),-r2(t[1],n)];return[t[0].concat(o[0]),t[1].concat(o[1]),[0,0,1]]},dA=(e,t)=>[r2(e,t[0]),r2(e,t[1])];function g3(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let o=0;o[s[0]/r*(d[0]-r/2),s[1]/r*(d[1]-r/2),d[2]||0]),a=n&&n!==0&&Math.abs(n)>.2,l=a?b3(n,[0,0]):v5,c=a?A.map(d=>[...dA(d,l),d[2]]):A,x=a?cA(o):v5,i=lt(t),f=[r2(i,x[0]),r2(i,x[1])];return c.map(d=>[Math.trunc(d[0]+f[0]),Math.trunc(d[1]+f[1]),Math.trunc(d[2]||0)])}function v3(e,t,n,o){let r=t.landmarks.length>=r5.count?r5.symmetryLine:_e.symmetryLine,s=0,A=v5,a;if(e&&R.kernels.includes("rotatewithoffset"))if(s=iA(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let c=lt(t),x=[c[0]/n.shape[2],c[1]/n.shape[1]],i=Me.image.rotateWithOffset(n,s,0,[x[0],x[1]]);A=b3(-s,c),a=T5(t,i,[o,o]),Me.dispose(i)}else a=T5(t,n,[o,o]);else a=T5(t,n,[o,o]);return[s,A,a]}var xA=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},R3=(e,t)=>{let n=xA(e),o=p2(t);return{startPoint:[n[0]-o[0]/2,n[1]-o[1]/2],endPoint:[n[0]+o[0]/2,n[1]+o[1]/2]}};var M3=6,yA=1.4,xe,ft=null,Ce=0,u2=null,P3=()=>Ce;async function k3(e){var t;return R.initial&&(xe=null),xe?e.debug&&h("cached model:",xe.modelUrl):xe=await L((t=e.face.detector)==null?void 0:t.modelPath),Ce=xe.executor&&xe.inputs[0].shape?xe.inputs[0].shape[2]:256,u2=O.scalar(Ce,"int32"),ft=O.tensor2d(g3(Ce)),xe}function fA(e){if(!ft||!u2)return O.zeros([0,0]);let t={};t.boxStarts=O.slice(e,[0,1],[-1,2]),t.centers=O.add(t.boxStarts,ft),t.boxSizes=O.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=O.div(t.boxSizes,u2),t.centersNormalized=O.div(t.centers,u2),t.halfBoxSize=O.div(t.boxSizesNormalized,C.tf2),t.starts=O.sub(t.centersNormalized,t.halfBoxSize),t.ends=O.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=O.mul(t.starts,u2),t.endNormalized=O.mul(t.ends,u2);let n=O.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(o=>O.dispose(t[o])),n}async function w3(e,t){var a,l,c,x,i,f;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=O.image.resizeBilinear(e,[Ce,Ce]),n.div=O.div(n.resized,C.tf127),n.normalized=O.sub(n.div,C.tf05);let o=xe==null?void 0:xe.execute(n.normalized);if(Array.isArray(o)&&o.length>2){let d=o.sort((m,y)=>m.size-y.size);n.concat384=O.concat([d[0],d[2]],2),n.concat512=O.concat([d[1],d[3]],2),n.concat=O.concat([n.concat512,n.concat384],1),n.batch=O.squeeze(n.concat,[0])}else Array.isArray(o)?n.batch=O.squeeze(o[0]):n.batch=O.squeeze(o);O.dispose(o),n.boxes=fA(n.batch),n.logits=O.slice(n.batch,[0,0],[-1,1]),n.sigmoid=O.sigmoid(n.logits),n.scores=O.squeeze(n.sigmoid),n.nms=await O.image.nonMaxSuppressionAsync(n.boxes,n.scores,((a=t.face.detector)==null?void 0:a.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),s=[],A=await n.scores.data();for(let d=0;d(((x=t.face.detector)==null?void 0:x.minConfidence)||0)){let y={};y.bbox=O.slice(n.boxes,[r[d],0],[1,-1]),y.slice=O.slice(n.batch,[r[d],M3-1],[1,-1]),y.squeeze=O.squeeze(y.slice),y.landmarks=O.reshape(y.squeeze,[M3,-1]);let u=await y.bbox.data(),T={startPoint:[u[0],u[1]],endPoint:[u[2],u[3]],landmarks:await y.landmarks.array(),confidence:m};y.anchor=O.slice(ft,[r[d],0],[1,2]);let g=await y.anchor.data(),p=u3(T,[(e.shape[2]||0)/Ce,(e.shape[1]||0)/Ce],g),b=xt(p,t.face.scale||yA),k=yt(b);k.size[0]>(((i=t.face.detector)==null?void 0:i.minSize)||0)&&k.size[1]>(((f=t.face.detector)==null?void 0:f.minSize)||0)&&s.push(k),Object.keys(y).forEach(P=>O.dispose(y[P]))}}return Object.keys(n).forEach(d=>O.dispose(n[d])),s}var ye=G(H());var K0,We=0,mA=2.3,M5=ae.leftEyeLower0,P5=ae.rightEyeLower0,h2={leftBounds:[M5[0],M5[M5.length-1]],rightBounds:[P5[0],P5[P5.length-1]]},b2={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function I3(e){var t,n;return R.initial&&(K0=null),K0?e.debug&&h("cached model:",K0.modelUrl):K0=await L((t=e.face.iris)==null?void 0:t.modelPath),We=K0!=null&&K0.executor&&((n=K0.inputs)!=null&&n[0].shape)?K0.inputs[0].shape[2]:0,We===-1&&(We=64),K0}function mt(e,t,n,o){for(let r=0;r{let t=e[h2.leftBounds[0]][2],n=e[h2.rightBounds[0]][2];return t-n},z3=(e,t,n,o,r,s=!1)=>{let A=yt(xt(h3([e[n],e[o]]),mA)),a=p2(A),l=ye.image.cropAndResize(t,[[A.startPoint[1]/r,A.startPoint[0]/r,A.endPoint[1]/r,A.endPoint[0]/r]],[0],[We,We]);if(s&&R.kernels.includes("flipleftright")){let c=ye.image.flipLeftRight(l);ye.dispose(l),l=c}return{box:A,boxSize:a,crop:l}},S3=(e,t,n,o=!1)=>{let r=[];for(let s=0;s{let o=e[ae[`${n}EyeUpper0`][b2.upperCenter]][2],r=e[ae[`${n}EyeLower0`][b2.lowerCenter]][2],s=(o+r)/2;return t.map((A,a)=>{let l=s;return a===2?l=o:a===4&&(l=r),[A[0],A[1],l]})};async function N3(e,t,n){if(!(K0!=null&&K0.executor))return e;let{box:o,boxSize:r,crop:s}=z3(e,t,h2.leftBounds[0],h2.leftBounds[1],n,!0),{box:A,boxSize:a,crop:l}=z3(e,t,h2.rightBounds[0],h2.rightBounds[1],n,!0),c=ye.concat([s,l]);ye.dispose(s),ye.dispose(l);let x=K0.execute(c);ye.dispose(c);let i=await x.data();ye.dispose(x);let f=i.slice(0,b2.numCoordinates*3),{rawCoords:d,iris:m}=S3(f,o,r,!0),y=i.slice(b2.numCoordinates*3),{rawCoords:u,iris:T}=S3(y,A,a,!1),g=pA(e);Math.abs(g)<30?(mt(e,d,"left",null),mt(e,u,"right",null)):g<1?mt(e,d,"left",["EyeUpper0","EyeLower0"]):mt(e,u,"right",["EyeUpper0","EyeLower0"]);let p=j3(e,m,"left"),b=j3(e,T,"right");return e.concat(p).concat(b)}async function O3(e,t){var s,A,a,l,c,x,i,f,d,m;let n={lips:await((A=(s=t.filter(y=>y.size===160))==null?void 0:s[0])==null?void 0:A.data()),irisL:await((l=(a=t.filter(y=>y.size===10))==null?void 0:a[0])==null?void 0:l.data()),eyeL:await((x=(c=t.filter(y=>y.size===142))==null?void 0:c[0])==null?void 0:x.data()),irisR:await((f=(i=t.filter(y=>y.size===10))==null?void 0:i[1])==null?void 0:f.data()),eyeR:await((m=(d=t.filter(y=>y.size===142))==null?void 0:d[1])==null?void 0:m.data())};for(let y of Object.values(n))if(!y)return e;let o=e2.reduce((y,u)=>y+=e[u][2],0)/e2.length;for(let y=0;yy+=e[u][2],0)/t2.length;for(let y=0;yv()-ge.timestamp,o=ge.skipped<(((c=t.face.detector)==null?void 0:c.skipFrames)||0);!t.skipAllowed||!n||!o||ge.boxes.length===0?(ge.boxes=await w3(e,t),ge.timestamp=v(),ge.skipped=0):ge.skipped++;let r=[],s=[],A=0,a=O2;for(let g=0;g[N[0]/(e.shape[2]||0),N[1]/(e.shape[1]||0),(N[2]||0)/a]);for(let N of Object.keys(_e))P.annotations[N]=[P.mesh[_e[N]]]}else if(!r0)t.debug&&h("face mesh detection requested, but model is not loaded");else{if((d=t.face.attention)!=null&&d.enabled&&!R.kernels.includes("atan2"))return t.face.attention.enabled=!1,De.dispose(P.tensor),r;let N=r0.execute(P.tensor),_=await N.find(Z=>Z.shape[Z.shape.length-1]===1).data();if(P.faceScore=Math.round(100*_[0])/100,P.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(p.confidence=P.faceScore,t.face.mesh.keepInvalid){P.box=ct(p,e),P.boxRaw=dt(p,e),P.size=p.size,P.score=P.boxScore,P.mesh=p.landmarks,P.meshRaw=P.mesh.map(Z=>[Z[0]/(e.shape[2]||1),Z[1]/(e.shape[1]||1),(Z[2]||0)/a]);for(let Z of Object.keys(_e))P.annotations[Z]=[P.mesh[_e[Z]]]}}else{let Z=N.find(n0=>n0.shape[n0.shape.length-1]===1404),$=De.reshape(Z,[-1,3]),A0=await $.array();De.dispose($),(y=t.face.attention)!=null&&y.enabled?A0=await O3(A0,N):(u=t.face.iris)!=null&&u.enabled&&(A0=await N3(A0,P.tensor,O2)),P.mesh=T3(A0,p,b,k,O2),P.meshRaw=P.mesh.map(n0=>[n0[0]/(e.shape[2]||0),n0[1]/(e.shape[1]||0),(n0[2]||0)/a]);for(let n0 of Object.keys(ae))P.annotations[n0]=ae[n0].map(j0=>P.mesh[j0]);P.score=P.faceScore;let t0={...R3(P.mesh,p),confidence:p.confidence,landmarks:p.landmarks,size:p.size};P.box=ct(t0,e),P.boxRaw=dt(t0,e),P.size=t0.size,s.push(t0)}De.dispose(N)}P.score>(((T=t.face.detector)==null?void 0:T.minConfidence)||1)?r.push(P):De.dispose(P.tensor)}return ge.boxes=s,r}async function W3(e){var t,n,o,r,s,A;return R.initial&&(r0=null),(t=e.face.attention)!=null&&t.enabled&&(r0!=null&&r0.signature)&&Object.keys(((n=r0==null?void 0:r0.signature)==null?void 0:n.outputs)||{}).length<6&&(r0=null),r0?e.debug&&h("cached model:",r0.modelUrl):(o=e.face.attention)!=null&&o.enabled?r0=await L(e.face.attention.modelPath):r0=await L((r=e.face.mesh)==null?void 0:r.modelPath),O2=r0.executor&&((s=r0==null?void 0:r0.inputs)!=null&&s[0].shape)?(A=r0==null?void 0:r0.inputs)==null?void 0:A[0].shape[2]:256,r0}var D3=$e,F3=N2;var J0=G(H());var E5=[],P0,pt=[],B3=0,H3=0,w5=Number.MAX_SAFE_INTEGER,z5=!1;async function G3(e){var t,n,o;return R.initial&&(P0=null),P0?e.debug&&h("cached model:",P0.modelUrl):(P0=await L((t=e.face.emotion)==null?void 0:t.modelPath),z5=((o=(n=P0==null?void 0:P0.inputs)==null?void 0:n[0].shape)==null?void 0:o[3])===3,z5?E5=["angry","disgust","fear","happy","neutral","sad","surprise"]:E5=["angry","disgust","fear","happy","sad","surprise","neutral"]),P0}async function S5(e,t,n,o){var A,a;if(!P0)return[];let r=w5<(((A=t.face.emotion)==null?void 0:A.skipFrames)||0),s=(((a=t.face.emotion)==null?void 0:a.skipTime)||0)>v()-H3;return t.skipAllowed&&s&&r&&B3===o&&pt[n]&&pt[n].length>0?(w5++,pt[n]):(w5=0,new Promise(async l=>{var x,i,f;let c=[];if((x=t.face.emotion)!=null&&x.enabled){let d={},m=P0!=null&&P0.inputs[0].shape?P0.inputs[0].shape[2]:0;if(((i=t.face.emotion)==null?void 0:i.crop)>0){let u=(f=t.face.emotion)==null?void 0:f.crop,T=[[u,u,1-u,1-u]];d.resize=J0.image.cropAndResize(e,T,[0],[m,m])}else d.resize=J0.image.resizeBilinear(e,[m,m],!1);z5?(d.mul=J0.mul(d.resize,255),d.normalize=J0.sub(d.mul,[103.939,116.779,123.68]),d.emotion=P0==null?void 0:P0.execute(d.normalize)):(d.channels=J0.mul(d.resize,C.rgb),d.grayscale=J0.sum(d.channels,3,!0),d.grayscaleSub=J0.sub(d.grayscale,C.tf05),d.grayscaleMul=J0.mul(d.grayscaleSub,C.tf2),d.emotion=P0==null?void 0:P0.execute(d.grayscaleMul)),H3=v();let y=await d.emotion.data();for(let u=0;u(t.face.emotion.minConfidence||0)&&c.push({score:Math.min(.99,Math.trunc(100*y[u])/100),emotion:E5[u]});c.sort((u,T)=>T.score-u.score),Object.keys(d).forEach(u=>J0.dispose(d[u]))}pt[n]=c,B3=o,l(c)}))}var ie=G(H());var k0,Fe=[],Z3=0,X3=0,j5=Number.MAX_SAFE_INTEGER;async function q3(e){var t;return R.initial&&(k0=null),k0?e.debug&&h("cached model:",k0.modelUrl):k0=await L((t=e.face.description)==null?void 0:t.modelPath),k0}function hA(e,t){var s,A;let n=e.image||e.tensor||e;if(!(k0!=null&&k0.inputs[0].shape))return n;let o;if(((s=t.face.description)==null?void 0:s.crop)>0){let a=(A=t.face.description)==null?void 0:A.crop,l=[[a,a,1-a,1-a]];o=ie.image.cropAndResize(n,l,[0],[k0.inputs[0].shape[2],k0.inputs[0].shape[1]])}else o=ie.image.resizeBilinear(n,[k0.inputs[0].shape[2],k0.inputs[0].shape[1]],!1);let r=ie.mul(o,C.tf255);return ie.dispose(o),r}async function I5(e,t,n,o){var a,l,c,x;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(k0!=null&&k0.executor))return r;let s=j5<(((a=t.face.description)==null?void 0:a.skipFrames)||0),A=(((l=t.face.description)==null?void 0:l.skipTime)||0)>v()-Z3;return t.skipAllowed&&s&&A&&X3===o&&((c=Fe==null?void 0:Fe[n])==null?void 0:c.age)>0&&((x=Fe==null?void 0:Fe[n])==null?void 0:x.genderScore)>0?(j5++,Fe[n]):(j5=0,new Promise(async i=>{var f;if((f=t.face.description)!=null&&f.enabled){let d=hA(e,t),m=k0==null?void 0:k0.execute(d);Z3=v(),ie.dispose(d);let u=await m.find(V=>V.shape[1]===1).data(),T=Math.trunc(200*Math.abs(u[0]-.5))/100;T>(t.face.description.minConfidence||0)&&(r.gender=u[0]<=.5?"female":"male",r.genderScore=Math.min(.99,T));let g=ie.argMax(m.find(V=>V.shape[1]===100),1),p=(await g.data())[0];ie.dispose(g);let k=await m.find(V=>V.shape[1]===100).data();r.age=Math.round(k[p-1]>k[p+1]?10*p-100*k[p-1]:10*p+100*k[p+1])/10,(Number.isNaN(u[0])||Number.isNaN(k[0]))&&h("faceres error:",{model:k0,result:m});let P=m.find(V=>V.shape[1]===1024),N=P?await P.data():[];r.descriptor=Array.from(N),m.forEach(V=>ie.dispose(V))}Fe[n]=r,X3=o,i(r)}))}var g2=.1,N5=.5;function bA(e,t,n){let o=!1,r=n.length-1;for(let s=0;st!=n[r].y>t&&e<(n[r].x-n[s].x)*(t-n[s].y)/(n[r].y-n[s].y)+n[s].x&&(o=!o);return o}async function Y3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,o=await e.tensor.buffer(),r=[];for(let A of ae.silhouette)r.push({x:(e.mesh[A][0]-e.box[0])/e.box[2],y:(e.mesh[A][1]-e.box[1])/e.box[3]});g2&&g2>0&&(r=r.map(A=>({x:A.x>.5?A.x+g2:A.x-g2,y:A.y>.5?A.y+g2:A.y-g2})));for(let A=0;Av()-J3,s=L5<(((a=t.face.antispoof)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&K3===o&&ut[n]?(L5++,ut[n]):(L5=0,new Promise(async l=>{let c=ht.image.resizeBilinear(e,[w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[2]:0,w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[1]:0],!1),x=w0==null?void 0:w0.execute(c),i=(await x.data())[0];ut[n]=Math.round(100*i)/100,K3=o,J3=v(),ht.dispose([c,x]),l(ut[n])}))}var gt=G(H());var E0,bt=[],C5=Number.MAX_SAFE_INTEGER,$3=0,en=0;async function tn(e){var t;return R.initial&&(E0=null),E0?e.debug&&h("cached model:",E0.modelUrl):E0=await L((t=e.face.liveness)==null?void 0:t.modelPath),E0}async function W5(e,t,n,o){var A,a;if(!(E0!=null&&E0.executor))return 0;let r=(((A=t.face.liveness)==null?void 0:A.skipTime)||0)>v()-en,s=C5<(((a=t.face.liveness)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&$3===o&&bt[n]?(C5++,bt[n]):(C5=0,new Promise(async l=>{let c=gt.image.resizeBilinear(e,[E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[2]:0,E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[1]:0],!1),x=E0==null?void 0:E0.execute(c),i=(await x.data())[0];bt[n]=Math.round(100*i)/100,$3=o,en=v(),gt.dispose([c,x]),l(bt[n])}))}var Tt=G(H());var le,D5=[],TA=["white","black","asian","indian","other"],vA=[15,23,28,35.5,45.5,55.5,65],on=0,rn=0,F5=Number.MAX_SAFE_INTEGER;async function sn(e){var t;return R.initial&&(le=null),le?e.debug&&h("cached model:",le.modelUrl):le=await L((t=e.face.gear)==null?void 0:t.modelPath),le}async function B5(e,t,n,o){var A,a;if(!le)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=F5<(((A=t.face.gear)==null?void 0:A.skipFrames)||0),s=(((a=t.face.gear)==null?void 0:a.skipTime)||0)>v()-rn;return t.skipAllowed&&s&&r&&on===o&&D5[n]?(F5++,D5[n]):(F5=0,new Promise(async l=>{var T,g,p,b;if(!(le!=null&&le.inputs[0].shape))return;let c={},x=[[0,.1,.9,.9]];if(((T=t.face.gear)==null?void 0:T.crop)>0){let k=(g=t.face.gear)==null?void 0:g.crop;x=[[k,k,1-k,1-k]]}c.resize=Tt.image.cropAndResize(e,x,[0],[le.inputs[0].shape[2],le.inputs[0].shape[1]]);let i={age:0,gender:"unknown",genderScore:0,race:[]};(p=t.face.gear)!=null&&p.enabled&&([c.age,c.gender,c.race]=le.execute(c.resize,["age_output","gender_output","race_output"]));let f=await c.gender.data();i.gender=f[0]>f[1]?"male":"female",i.genderScore=Math.round(100*(f[0]>f[1]?f[0]:f[1]))/100;let d=await c.race.data();for(let k=0;k(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&i.race.push({score:Math.round(100*d[k])/100,race:TA[k]});i.race.sort((k,P)=>P.score-k.score);let y=Array.from(await c.age.data()).map((k,P)=>[vA[P],k]).sort((k,P)=>P[1]-k[1]),u=y[0][0];for(let k=1;kTt.dispose(c[k])),D5[n]=i,on=o,rn=v(),l(i)}))}var s2=G(H());var H0,vt=[],an=0,ln=0,H5=Number.MAX_SAFE_INTEGER;async function cn(e){return R.initial&&(H0=null),H0?e.debug&&h("cached model:",H0.modelUrl):H0=await L(e.face.ssrnet.modelPathAge),H0}async function G5(e,t,n,o){var A,a,l,c;if(!H0)return{age:0};let r=H5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-ln;return t.skipAllowed&&r&&s&&an===o&&((l=vt[n])!=null&&l.age)&&((c=vt[n])==null?void 0:c.age)>0?(H5++,vt[n]):(H5=0,new Promise(async x=>{var d,m,y;if(!(H0!=null&&H0.inputs)||!H0.inputs[0]||!H0.inputs[0].shape)return;let i={};if(((d=t.face.ssrnet)==null?void 0:d.crop)>0){let u=(m=t.face.ssrnet)==null?void 0:m.crop,T=[[u,u,1-u,1-u]];i.resize=s2.image.cropAndResize(e,T,[0],[H0.inputs[0].shape[2],H0.inputs[0].shape[1]])}else i.resize=s2.image.resizeBilinear(e,[H0.inputs[0].shape[2],H0.inputs[0].shape[1]],!1);i.enhance=s2.mul(i.resize,C.tf255);let f={age:0};if((y=t.face.ssrnet)!=null&&y.enabled&&(i.age=H0.execute(i.enhance)),i.age){let u=await i.age.data();f.age=Math.trunc(10*u[0])/10}Object.keys(i).forEach(u=>s2.dispose(i[u])),vt[n]=f,an=o,ln=v(),x(f)}))}var v0=G(H());var N0,Rt=[],xn=0,yn=0,V5=Number.MAX_SAFE_INTEGER,Z5=[.2989,.587,.114];async function fn(e){var t;return R.initial&&(N0=null),N0?e.debug&&h("cached model:",N0.modelUrl):N0=await L((t=e.face.ssrnet)==null?void 0:t.modelPathGender),N0}async function X5(e,t,n,o){var A,a,l,c;if(!N0)return{gender:"unknown",genderScore:0};let r=V5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-yn;return t.skipAllowed&&r&&s&&xn===o&&((l=Rt[n])!=null&&l.gender)&&((c=Rt[n])==null?void 0:c.genderScore)>0?(V5++,Rt[n]):(V5=0,new Promise(async x=>{var m,y,u;if(!(N0!=null&&N0.inputs[0].shape))return;let i={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let T=(y=t.face.ssrnet)==null?void 0:y.crop,g=[[T,T,1-T,1-T]];i.resize=v0.image.cropAndResize(e,g,[0],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]])}else i.resize=v0.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]],!1);i.enhance=v0.tidy(()=>{var g,p;let T;if(((p=(g=N0==null?void 0:N0.inputs)==null?void 0:g[0].shape)==null?void 0:p[3])===1){let[b,k,P]=v0.split(i.resize,3,3),N=v0.mul(b,Z5[0]),V=v0.mul(k,Z5[1]),_=v0.mul(P,Z5[2]),Z=v0.addN([N,V,_]);T=v0.mul(v0.sub(Z,C.tf05),2)}else T=v0.mul(v0.sub(i.resize,C.tf05),2);return T});let f={gender:"unknown",genderScore:0};(u=t.face.ssrnet)!=null&&u.enabled&&(i.gender=N0.execute(i.enhance));let d=await i.gender.data();f.gender=d[0]>d[1]?"female":"male",f.genderScore=d[0]>d[1]?Math.trunc(100*d[0])/100:Math.trunc(100*d[1])/100,Object.keys(i).forEach(T=>v0.dispose(i[T])),Rt[n]=f,xn=o,yn=v(),x(f)}))}var Mt=G(H());var Q0,q5=[],pn=0,un=0,hn=Number.MAX_SAFE_INTEGER;async function bn(e){var t;return R.initial&&(Q0=null),Q0?e.debug&&h("cached model:",Q0.modelUrl):Q0=await L((t=e.face.mobilefacenet)==null?void 0:t.modelPath),Q0}async function U5(e,t,n,o){var A,a;if(!(Q0!=null&&Q0.executor))return[];let r=hn<(((A=t.face.mobilefacenet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.mobilefacenet)==null?void 0:a.skipTime)||0)>v()-un;return t.skipAllowed&&s&&r&&pn===o&&q5[n]?(hn++,q5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.mobilefacenet)!=null&&x.enabled&&(Q0!=null&&Q0.inputs[0].shape)){let i={};i.crop=Mt.image.resizeBilinear(e,[Q0.inputs[0].shape[2],Q0.inputs[0].shape[1]],!1),i.data=Q0.execute(i.crop);let f=await i.data.data();c=Array.from(f),Object.keys(i).forEach(d=>Mt.dispose(i[d]))}q5[n]=c,pn=o,un=v(),l(c)})}var Pt=G(H());var _0,Y5=[],Tn=0,vn=0,Rn=Number.MAX_SAFE_INTEGER;async function Mn(e){return R.initial&&(_0=null),_0?e.debug&&h("cached model:",_0.modelUrl):_0=await L(e.face.insightface.modelPath),_0}async function K5(e,t,n,o){var A,a;if(!(_0!=null&&_0.executor))return[];let r=Rn<(((A=t.face.insightface)==null?void 0:A.skipFrames)||0),s=(((a=t.face.insightface)==null?void 0:a.skipTime)||0)>v()-vn;return t.skipAllowed&&s&&r&&Tn===o&&Y5[n]?(Rn++,Y5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.insightface)!=null&&x.enabled&&(_0!=null&&_0.inputs[0].shape)){let i={};i.crop=Pt.image.resizeBilinear(e,[_0.inputs[0].shape[2],_0.inputs[0].shape[1]],!1),i.data=_0.execute(i.crop);let f=await i.data.data();c=Array.from(f),Object.keys(i).forEach(d=>Pt.dispose(i[d]))}Y5[n]=c,Tn=o,vn=v(),l(c)})}var RA=e=>{let t=(i,f)=>Math.atan2(i[1]-f[1],i[0]-f[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],o=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],A=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],a=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(A[0]-s[0])/a[0]-n[0],o*(s[1]-A[1])/a[1]-n[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return c=Math.min(c,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:c}},kn=(e,t)=>{let n=y=>{let u=Math.sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);return y[0]/=u,y[1]/=u,y[2]/=u,y},o=(y,u)=>{let T=y[0]-u[0],g=y[1]-u[1],p=y[2]-u[2];return[T,g,p]},r=(y,u)=>{let T=y[1]*u[2]-y[2]*u[1],g=y[2]*u[0]-y[0]*u[2],p=y[0]*u[1]-y[1]*u[0];return[T,g,p]},s=y=>{let[u,T,g,p,b,k,P,N,V]=y,_,Z,$;return p<1?p>-1?($=Math.asin(p),Z=Math.atan2(-P,u),_=Math.atan2(-k,b)):($=-Math.PI/2,Z=-Math.atan2(N,V),_=0):($=Math.PI/2,Z=Math.atan2(N,V),_=0),Number.isNaN(_)&&(_=0),Number.isNaN(Z)&&(Z=0),Number.isNaN($)&&($=0),{pitch:2*-_,yaw:2*-Z,roll:2*-$}},A=e.meshRaw;if(!A||A.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let a=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[A[10],A[152],A[234],A[454]].map(y=>[y[0]*t[0]/a,y[1]*t[1]/a,y[2]]),c=n(o(l[1],l[0])),x=n(o(l[3],l[2])),i=n(r(x,c));x=r(c,i);let f=[x[0],x[1],x[2],c[0],c[1],c[2],i[0],i[1],i[2]],d=s(f),m=A.length===478?RA(e):{bearing:0,strength:0};return{angle:d,matrix:f,gaze:m}};function wn(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let o=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/o)/100}var J5=async(e,t)=>{var m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;let n=v(),o,r,s,A,a,l,c,x,i,f=[];e.state="run:face";let d=await C3(t,e.config);if(e.performance.face=R.perfadd?(e.performance.face||0)+Math.trunc(v()-n):Math.trunc(v()-n),!t.shape||t.shape.length!==4)return[];if(!d)return[];for(let E=0;E200?kn(d[E],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?A=(y=e.config.face.emotion)!=null&&y.enabled?S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[]:(e.state="run:emotion",n=v(),A=(u=e.config.face.emotion)!=null&&u.enabled?await S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[],e.performance.emotion=R.perfadd?(e.performance.emotion||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?c=(T=e.config.face.antispoof)!=null&&T.enabled?O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:antispoof",n=v(),c=(g=e.config.face.antispoof)!=null&&g.enabled?await O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.antispoof=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?x=(p=e.config.face.liveness)!=null&&p.enabled?W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:liveness",n=v(),x=(b=e.config.face.liveness)!=null&&b.enabled?await W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.liveness=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(k=e.config.face.gear)!=null&&k.enabled?B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:gear",n=v(),r=(P=e.config.face.gear)!=null&&P.enabled?await B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.gear=Math.trunc(v()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(o=(N=e.config.face.ssrnet)!=null&&N.enabled?G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(V=e.config.face.ssrnet)!=null&&V.enabled?X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null):(e.state="run:ssrnet",n=v(),o=(_=e.config.face.ssrnet)!=null&&_.enabled?await G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(Z=e.config.face.ssrnet)!=null&&Z.enabled?await X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.ssrnet=Math.trunc(v()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?a=($=e.config.face.mobilefacenet)!=null&&$.enabled?U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),a=(A0=e.config.face.mobilefacenet)!=null&&A0.enabled?await U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(t0=e.config.face.insightface)!=null&&t0.enabled?K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),l=(n0=e.config.face.insightface)!=null&&n0.enabled?await K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?i=I5(d[E].tensor||l0.tensor([]),e.config,E,d.length):(e.state="run:description",n=v(),i=await I5(d[E].tensor||l0.tensor([]),e.config,E,d.length),e.performance.description=R.perfadd?(e.performance.description||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Description:"),e.config.async&&([o,s,A,a,l,i,r,c,x]=await Promise.all([o,s,A,a,l,i,r,c,x])),e.analyze("Finish Face:"),(j0=e.config.face.ssrnet)!=null&&j0.enabled&&o&&s&&(i={...i,age:o.age,gender:s.gender,genderScore:s.genderScore}),(M=e.config.face.gear)!=null&&M.enabled&&r&&(i={...i,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(T0=e.config.face.mobilefacenet)!=null&&T0.enabled&&a&&(i.descriptor=a),(C0=e.config.face.insightface)!=null&&C0.enabled&&l&&(i.descriptor=l);let X=(x0=e.config.face.iris)!=null&&x0.enabled?wn(d[E],t.shape[2]):0,U0=(K=e.config.face.detector)!=null&&K.return?l0.squeeze(d[E].tensor):null;l0.dispose(d[E].tensor),d[E].tensor&&delete d[E].tensor;let y0={...d[E],id:E};i.age&&(y0.age=i.age),i.gender&&(y0.gender=i.gender),i.genderScore&&(y0.genderScore=i.genderScore),i.descriptor&&(y0.embedding=i.descriptor),i.race&&(y0.race=i.race),A&&(y0.emotion=A),c&&(y0.real=c),x&&(y0.live=x),X>0&&(y0.distance=X),B&&(y0.rotation=B),U0&&(y0.tensor=U0),f.push(y0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),f};var G0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>G0.nameMapping[e],getPoints:e=>G0.pointsMapping[e]},He={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>He.nameMapping[e]},c0={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>c0.nameMapping[e]},Be=class{constructor(t){w(this,"name");w(this,"curls");w(this,"directions");w(this,"weights");w(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,o){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,o])}direction(t,n,o){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,o])}weight(t,n){this.weights[t]=n;let o=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/o)}matchAgainst(t,n){let o=0;for(let r in t){let s=t[r],A=this.curls[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}for(let r in n){let s=n[r],A=this.directions[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}return o/10}};var{thumb:fe,index:Pe,middle:ke,ring:A2,pinky:a2}=G0,{none:me,half:PA,full:pe}=He,{verticalUp:T2,verticalDown:Qi,horizontalLeft:Q5,horizontalRight:kA,diagonalUpRight:wA,diagonalUpLeft:v2,diagonalDownRight:_i,diagonalDownLeft:$i}=c0,Ge=new Be("thumbs up");Ge.curl(fe,me,1);Ge.direction(fe,T2,1);Ge.direction(fe,v2,.25);Ge.direction(fe,wA,.25);for(let e of[G0.index,G0.middle,G0.ring,G0.pinky])Ge.curl(e,pe,1),Ge.direction(e,Q5,1),Ge.direction(e,kA,1);var h0=new Be("victory");h0.curl(fe,PA,.5);h0.curl(fe,me,.5);h0.direction(fe,T2,1);h0.direction(fe,v2,1);h0.curl(Pe,me,1);h0.direction(Pe,T2,.75);h0.direction(Pe,v2,1);h0.curl(ke,me,1);h0.direction(ke,T2,1);h0.direction(ke,v2,.75);h0.curl(A2,pe,1);h0.direction(A2,T2,.2);h0.direction(A2,v2,1);h0.direction(A2,Q5,.2);h0.curl(a2,pe,1);h0.direction(a2,T2,.2);h0.direction(a2,v2,1);h0.direction(a2,Q5,.2);h0.weight(Pe,2);h0.weight(ke,2);var Ve=new Be("point");Ve.curl(fe,pe,1);Ve.curl(Pe,me,.5);Ve.curl(ke,pe,.5);Ve.curl(A2,pe,.5);Ve.curl(a2,pe,.5);Ve.weight(Pe,2);Ve.weight(ke,2);var Ze=new Be("middle finger");Ze.curl(fe,me,1);Ze.curl(Pe,pe,.5);Ze.curl(ke,pe,.5);Ze.curl(A2,pe,.5);Ze.curl(a2,pe,.5);Ze.weight(Pe,2);Ze.weight(ke,2);var R2=new Be("open palm");R2.curl(fe,me,.75);R2.curl(Pe,me,.75);R2.curl(ke,me,.75);R2.curl(A2,me,.75);R2.curl(a2,me,.75);var En=[Ge,h0,Ve,Ze,R2];var EA=.7,i2={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function zn(e,t,n,o){let r=(t-o)/(e-n),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function jn(e,t){if(!e||!t)return[0,0];let n=zn(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let o=zn(e[1],e[2],t[1],t[2]);return[n,o]}function Sn(e,t=1){let n=0,o=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?o=1*t:r=1*t,[n,o,r]}function zA(e,t,n){let o=e[0]-t[0],r=e[0]-n[0],s=t[0]-n[0],A=e[1]-t[1],a=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],x=e[2]-n[2],i=t[2]-n[2],f=Math.sqrt(o*o+A*A+c*c),d=Math.sqrt(r*r+a*a+x*x),m=Math.sqrt(s*s+l*l+i*i),y=(m*m+f*f-d*d)/(2*m*f);y>1?y=1:y<-1&&(y=-1);let u=Math.acos(y);u=57.2958*u%180;let T;return u>i2.NO_CURL_START_LIMIT?T=He.none:u>i2.HALF_CURL_START_LIMIT?T=He.half:T=He.full,T}function In(e,t,n,o){let r;return o===Math.abs(e)?e>0?r=c0.horizontalLeft:r=c0.horizontalRight:o===Math.abs(t)?t>0?r=c0.horizontalLeft:r=c0.horizontalRight:n>0?r=c0.horizontalLeft:r=c0.horizontalRight,r}function Nn(e,t,n,o){let r;return o===Math.abs(e)?e<0?r=c0.verticalDown:r=c0.verticalUp:o===Math.abs(t)?t<0?r=c0.verticalDown:r=c0.verticalUp:n<0?r=c0.verticalDown:r=c0.verticalUp,r}function SA(e,t,n,o,r,s,A,a){let l,c=Nn(e,t,n,o),x=In(r,s,A,a);return c===c0.verticalUp?x===c0.horizontalLeft?l=c0.diagonalUpLeft:l=c0.diagonalUpRight:x===c0.horizontalLeft?l=c0.diagonalDownLeft:l=c0.diagonalDownRight,l}function jA(e,t,n,o){let r=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],x=Math.max(Math.abs(r),Math.abs(s),Math.abs(A)),i=Math.max(Math.abs(a),Math.abs(l),Math.abs(c)),f=0,d=0,m=0,y=i/(x+1e-5);y>1.5?f+=i2.DISTANCE_VOTE_POWER:y>.66?d+=i2.DISTANCE_VOTE_POWER:m+=i2.DISTANCE_VOTE_POWER;let u=Math.sqrt(r*r+a*a),T=Math.sqrt(s*s+l*l),g=Math.sqrt(A*A+c*c),p=Math.max(u,T,g),b=e[0],k=e[1],P=n[0],N=n[1];p===u?(P=n[0],N=n[1]):p===g&&(b=t[0],k=t[1]);let Z=jn([b,k],[P,N]),$=Sn(Z,i2.TOTAL_ANGLE_VOTE_POWER);f+=$[0],d+=$[1],m+=$[2];for(let t0 of o){let n0=Sn(t0,i2.SINGLE_ANGLE_VOTE_POWER);f+=n0[0],d+=n0[1],m+=n0[2]}let A0;return f===Math.max(f,d,m)?A0=Nn(l,a,c,i):m===Math.max(d,m)?A0=In(s,r,A,x):A0=SA(l,a,c,i,s,r,A,x),A0}function Ln(e){let t=[],n=[],o=[],r=[];if(!e)return{curls:o,directions:r};for(let s of G0.all){let A=G0.getPoints(s),a=[],l=[];for(let c of A){let x=e[c[0]],i=e[c[1]],f=jn(x,i),d=f[0],m=f[1];a.push(d),l.push(m)}t.push(a),n.push(l)}for(let s of G0.all){let A=s===G0.thumb?1:0,a=G0.getPoints(s),l=e[a[A][0]],c=e[a[A+1][1]],x=e[a[3][1]],i=zA(l,c,x),f=jA(l,c,x,t[s].slice(A));o[s]=i,r[s]=f}return{curls:o,directions:r}}function kt(e){if(!e||e.length===0)return null;let t=Ln(e),n={};for(let o of G0.all)n[G0.getName(o)]={curl:He.getName(t.curls[o]),direction:c0.getName(t.directions[o])};return n}function On(e){let t=[];if(!e||e.length===0)return t;let n=Ln(e);for(let o of En){let r=o.matchAgainst(n.curls,n.directions);r>=EA&&t.push({name:o.name,confidence:r})}return t}var Cn=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&&o&&r&&o.position[1]l.part==="leftShoulder"),a=e[n].keypoints.find(l=>l.part==="rightShoulder");A&&a&&Math.abs(A.positionRaw[1]-a.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${A.position[1]>a.position[1]?"left":"right"}`})}return t},Wn=e=>{if(!e)return[];let t=[];for(let n=0;n450){let o=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),r=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(o/r)<=.15?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${o<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 a=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]));a>10&&t.push({face:n,gesture:`mouth ${Math.trunc(a)}% open`});let l=e[n].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:n,gesture:`head ${l<0?"up":"down"}`})}return t},Dn=e=>{var n,o,r,s;if(!e)return[];let t=[];for(let A=0;A.06||u>.06)&&(d=!1),y>u?u>.04&&t.push({iris:A,gesture:"looking right"}):y>.04&&t.push({iris:A,gesture:"looking left"});let T=Math.abs(e[A].mesh[145][1]-e[A].annotations.rightEyeIris[0][1])/e[A].box[3],g=Math.abs(e[A].mesh[374][1]-e[A].annotations.leftEyeIris[0][1])/e[A].box[3];(g<.01||T<.01||g>.022||T>.022)&&(d=!1),(g<.01||T<.01)&&t.push({iris:A,gesture:"looking down"}),(g>.022||T>.022)&&t.push({iris:A,gesture:"looking up"}),d&&t.push({iris:A,gesture:"looking center"})}return t},Fn=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=o.reduce((A,a)=>(A.position[2]||0)<(a.position[2]||0)?A:a);t.push({hand:n,gesture:`${r.name} forward`});let s=o.reduce((A,a)=>A.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:o,palmLandmarks:r,confidence:e.confidence}}function Et(e,t=1.5){let n=C2(e),o=wt(e),r=[t*o[0]/2,t*o[1]/2],s=[n[0]-r[0],n[1]-r[1]],A=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function zt(e){let t=C2(e),n=wt(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],A=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function NA(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Xn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return NA(n)}var Bn=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Xe(e,t){let n=0;for(let o=0;o[A.x,A.y]),this.anchorsTensor=W.tensor2d(this.anchors),this.inputSize=((s=(r=(o=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:o[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=W.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=W.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=W.slice(t,[0,0],[-1,2]),n.boxSizes=W.slice(t,[0,2],[-1,2]),n.div=W.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=W.add(n.div,this.anchorsTensor),n.halfBoxSizes=W.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=W.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=W.mul(n.sub,this.inputSizeTensor),n.add=W.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=W.mul(n.add,this.inputSizeTensor);let o=W.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>W.dispose(n[r])),o}normalizeLandmarks(t,n){let o={};o.reshape=W.reshape(t,[-1,7,2]),o.div=W.div(o.reshape,this.inputSizeTensor),o.landmarks=W.add(o.div,this.anchors[n]?this.anchors[n]:0);let r=W.mul(o.landmarks,this.inputSizeTensor);return Object.keys(o).forEach(s=>W.dispose(o[s])),r}async predict(t,n){var a;let o={};o.resize=W.image.resizeBilinear(t,[this.inputSize,this.inputSize]),o.div=W.div(o.resize,C.tf127),o.image=W.sub(o.div,C.tf1),o.batched=this.model.execute(o.image),o.predictions=W.squeeze(o.batched),o.slice=W.slice(o.predictions,[0,0],[-1,1]),o.sigmoid=W.sigmoid(o.slice),o.scores=W.squeeze(o.sigmoid);let r=await o.scores.data();o.boxes=W.slice(o.predictions,[0,1],[-1,4]),o.norm=this.normalizeBoxes(o.boxes),o.nms=await W.image.nonMaxSuppressionAsync(o.norm,o.scores,3*(((a=n.hand)==null?void 0:a.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let s=await o.nms.array(),A=[];for(let l of s){let c={};c.box=W.slice(o.norm,[l,0],[1,-1]),c.slice=W.slice(o.predictions,[l,5],[1,14]),c.norm=this.normalizeLandmarks(c.slice,l),c.palmLandmarks=W.reshape(c.norm,[-1,2]);let x=await c.box.data(),i=x.slice(0,2),f=x.slice(2,4),d=await c.palmLandmarks.array(),m={startPoint:i,endPoint:f,palmLandmarks:d,confidence:r[l]},y=Zn(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);A.push(y),Object.keys(c).forEach(u=>W.dispose(c[u]))}return Object.keys(o).forEach(l=>W.dispose(o[l])),A}};var $0=G(H());var WA=5,Kn=1.65,Jn=[0,5,9,13,17,1,2],DA=0,FA=2,Qn=0,jt=class{constructor(t,n){w(this,"handDetector");w(this,"handPoseModel");w(this,"inputSize");w(this,"storedBoxes");w(this,"skipped");w(this,"detectedHands");var o,r,s;this.handDetector=t,this.handPoseModel=n,this.inputSize=((s=(r=(o=this.handPoseModel)==null?void 0:o.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(A=>A[0]),o=t.map(A=>A[1]),r=[Math.min(...n),Math.min(...o)],s=[Math.max(...n),Math.max(...o)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let o=t.map(s=>e1([...s,1],n)),r=this.calculateLandmarksBoundingBox(o);return Et(zt(r),WA)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),o=Et(zt(n),Kn);o.palmLandmarks=[];for(let r=0;r[A[0]*(d[0]-this.inputSize/2),A[1]*(d[1]-this.inputSize/2),A[2]*d[2]]),l=$5(o,[0,0]),c=a.map(d=>[...e1(d,l),d[2]]),x=qn(r),i=[...C2(n),1],f=[Xe(i,x[0]),Xe(i,x[1])];return c.map(d=>[Math.trunc(d[0]+f[0]),Math.trunc(d[1]+f[1]),Math.trunc(d[2])])}async estimateHands(t,n){let o=!1,r,s=(n.hand.skipTime||0)>v()-Qn,A=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&s&&A?this.skipped++:(r=await this.handDetector.predict(t,n),this.skipped=0),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&&(o=!0));let a=[];for(let l=0;l=n.hand.minConfidence/4){let k=$0.reshape(p,[-1,3]),P=await k.array();$0.dispose(p),$0.dispose(k);let N=this.transformRawCoords(P,y,x,m),V=this.getBoxForHandLandmarks(N);this.storedBoxes[l]={...V,confidence:b};let _={landmarks:N,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:V.startPoint,bottomRight:V.endPoint}};a.push(_)}else this.storedBoxes[l]=null;$0.dispose(p)}else{let x=Et(zt(c),Kn),i={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:x.startPoint,bottomRight:x.endPoint},landmarks:[]};a.push(i)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=a.length,a.length>n.hand.maxDetected&&(a.length=n.hand.maxDetected),a}};var _n={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},l2,c2,t1;function HA(){let e=l2?new St(l2):void 0;e&&c2&&(t1=new jt(e,c2))}async function n1(e,t){t1||HA();let n=await t1.estimateHands(e,t);if(!n)return[];let o=[];for(let r=0;rn[r].landmarks[i]);let A=n[r].landmarks,a=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(A&&A.length>0){for(let x of A)x[0]a[2]&&(a[2]=x[0]),x[1]>a[3]&&(a[3]=x[1]);a[2]-=a[0],a[3]-=a[1],l=[a[0]/(e.shape[2]||0),a[1]/(e.shape[1]||0),a[2]/(e.shape[2]||0),a[3]/(e.shape[1]||0)]}else a=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=kt(A);o.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:a,boxRaw:l,keypoints:A,annotations:s,landmarks:c})}return o}async function $n(e){var t;return R.initial&&(l2=null),l2?e.debug&&h("cached model:",l2.modelUrl):l2=await L((t=e.hand.detector)==null?void 0:t.modelPath),l2}async function eo(e){var t;return R.initial&&(c2=null),c2?e.debug&&h("cached model:",c2.modelUrl):c2=await L((t=e.hand.skeleton)==null?void 0:t.modelPath),c2}var Q=G(H());var p0=[null,null],GA=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],qe=[[0,0],[0,0]],VA=["hand","fist","pinch","point","face","tip","pinchtip"],no=4,oo=1.6,ZA=512,XA=1.4,It=Number.MAX_SAFE_INTEGER,o1=0,we=[0,0],m0={boxes:[],hands:[]},ro={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function so(e){var t;if(R.initial&&(p0[0]=null),p0[0])e.debug&&h("cached model:",p0[0].modelUrl);else{J2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),p0[0]=await L((t=e.hand.detector)==null?void 0:t.modelPath);let n=p0[0].executor?Object.values(p0[0].modelSignature.inputs):void 0;qe[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[0]}async function Ao(e){var t;if(R.initial&&(p0[1]=null),p0[1])e.debug&&h("cached model:",p0[1].modelUrl);else{p0[1]=await L((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=p0[1].executor?Object.values(p0[1].modelSignature.inputs):void 0;qe[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[1]}async function qA(e,t){let n=[];if(!e||!p0[0])return n;let o={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,ZA),A=Math.round(s*r/8)*8;o.resize=Q.image.resizeBilinear(e,[s,A]),o.cast=Q.cast(o.resize,"int32"),[o.rawScores,o.rawBoxes]=await p0[0].executeAsync(o.cast,GA),o.boxes=Q.squeeze(o.rawBoxes,[0,2]),o.scores=Q.squeeze(o.rawScores,[0]);let a=Q.unstack(o.scores,1);Q.dispose(a[no]),a.splice(no,1),o.filtered=Q.stack(a,1),Q.dispose(a),o.max=Q.max(o.filtered,1),o.argmax=Q.argMax(o.filtered,1);let l=0;o.nms=await Q.image.nonMaxSuppressionAsync(o.boxes,o.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let c=await o.nms.data(),x=await o.max.data(),i=await o.argmax.data();for(let f of Array.from(c)){let d=Q.slice(o.boxes,f,1),m=await d.data();Q.dispose(d);let y=[m[1],m[0],m[3]-m[1],m[2]-m[0]],u=st(y,XA),T=[Math.trunc(y[0]*we[0]),Math.trunc(y[1]*we[1]),Math.trunc(y[2]*we[0]),Math.trunc(y[3]*we[1])],g=x[f],p=VA[i[f]],b={id:l++,score:g,box:T,boxRaw:u,label:p};n.push(b)}return Object.keys(o).forEach(f=>Q.dispose(o[f])),n.sort((f,d)=>d.score-f.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function r1(e,t,n){let o={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&p0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=Q.image.cropAndResize(e,[s],[0],[qe[1][0],qe[1][1]],"bilinear"),r.div=Q.div(r.crop,C.tf255),[r.score,r.keypoints]=p0[1].execute(r.div,["Identity_1","Identity"]);let A=(await r.score.data())[0],a=(100-Math.trunc(100/(1+Math.exp(A))))/100;if(a>=(n.hand.minConfidence||0)){o.fingerScore=a,r.reshaped=Q.reshape(r.keypoints,[-1,3]);let x=(await r.reshaped.array()).map(i=>[i[0]/qe[1][1],i[1]/qe[1][0],i[2]||0]).map(i=>[i[0]*t.boxRaw[2],i[1]*t.boxRaw[3],i[2]||0]);o.keypoints=x.map(i=>[we[0]*(i[0]+t.boxRaw[0]),we[1]*(i[1]+t.boxRaw[1]),i[2]||0]),o.landmarks=kt(o.keypoints);for(let i of Object.keys(ro))o.annotations[i]=ro[i].map(f=>o.landmarks&&o.keypoints[f]?o.keypoints[f]:null)}Object.keys(r).forEach(l=>Q.dispose(r[l]))}return o}async function s1(e,t){var r,s;if(!((r=p0[0])!=null&&r.executor)||!((s=p0[1])!=null&&s.executor)||!p0[0].inputs[0].shape||!p0[1].inputs[0].shape)return[];we=[e.shape[2]||0,e.shape[1]||0],It++;let n=(t.hand.skipTime||0)>v()-o1,o=It<(t.hand.skipFrames||0);return t.skipAllowed&&n&&o?m0.hands:new Promise(async A=>{let a=3*(t.hand.skipTime||0)>v()-o1,l=It<3*(t.hand.skipFrames||0);t.skipAllowed&&m0.hands.length===t.hand.maxDetected?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):t.skipAllowed&&a&&l&&m0.hands.length>0?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):(m0.boxes=await qA(e,t),o1=v(),m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))),It=0);let c=[...m0.boxes];if(m0.boxes.length=0,t.cacheSensitivity>0)for(let x=0;x.05&&i.box[3]/(e.shape[1]||1)>.05&&m0.hands[x].fingerScore&&m0.hands[x].fingerScore>(t.hand.minConfidence||0)){let f=st(i.box,oo),d=st(i.boxRaw,oo);m0.boxes.push({...c[x],box:f,boxRaw:d})}}for(let x=0;x({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var W2={};ze(W2,{connected:()=>Lt,horizontal:()=>A1,kpt:()=>Nt,relative:()=>i1,vertical:()=>a1});var Nt=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],A1=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],a1=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],i1=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],Lt={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var z=Te(),l1=0;function io(e,t){var A,a,l,c,x,i,f,d,m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0;let n=v();if(!e)return Te();let o=Date.now()-e.timestamp,r=o<1e3?8-Math.log(o+1):1;if(e.canvas&&(z.canvas=e.canvas),e.error&&(z.error=e.error),!z.body||e.body.length!==z.body.length)z.body=JSON.parse(JSON.stringify(e.body));else for(let M=0;M((r-1)*z.body[M].box[X]+B)/r),C0=e.body[M].boxRaw.map((B,X)=>((r-1)*z.body[M].boxRaw[X]+B)/r),x0=e.body[M].keypoints.map((B,X)=>{var U0,y0,Ee,k2,x2,E1,z1,S1,j1;return{score:B.score,part:B.part,position:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[0]||0)+(B.position[0]||0))/r:B.position[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[1]||0)+(B.position[1]||0))/r:B.position[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[2]||0)+(B.position[2]||0))/r:B.position[2]],positionRaw:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[0]||0)+(B.positionRaw[0]||0))/r:B.positionRaw[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[1]||0)+(B.positionRaw[1]||0))/r:B.positionRaw[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[2]||0)+(B.positionRaw[2]||0))/r:B.positionRaw[2]],distance:[z.body[M].keypoints[X]?((r-1)*(((U0=z.body[M].keypoints[X].distance)==null?void 0:U0[0])||0)+(((y0=B.distance)==null?void 0:y0[0])||0))/r:(Ee=B.distance)==null?void 0:Ee[0],z.body[M].keypoints[X]?((r-1)*(((k2=z.body[M].keypoints[X].distance)==null?void 0:k2[1])||0)+(((x2=B.distance)==null?void 0:x2[1])||0))/r:(E1=B.distance)==null?void 0:E1[1],z.body[M].keypoints[X]?((r-1)*(((z1=z.body[M].keypoints[X].distance)==null?void 0:z1[2])||0)+(((S1=B.distance)==null?void 0:S1[2])||0))/r:(j1=B.distance)==null?void 0:j1[2]]}}),K={},E={connected:{}};(A=t.body.modelPath)!=null&&A.includes("efficientpose")?E=it:(a=t.body.modelPath)!=null&&a.includes("blazepose")?E=ot:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(E=W2);for(let[B,X]of Object.entries(E.connected)){let U0=[];for(let y0=0;y0x2.part===X[y0]),k2=x0.find(x2=>x2.part===X[y0+1]);Ee&&k2&&U0.push([Ee.position,k2.position])}K[B]=U0}z.body[M]={...e.body[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.hand||e.hand.length!==z.hand.length)z.hand=JSON.parse(JSON.stringify(e.hand));else for(let M=0;M((r-1)*z.hand[M].box[B]+E)/r),C0=e.hand[M].boxRaw.map((E,B)=>((r-1)*z.hand[M].boxRaw[B]+E)/r);z.hand[M].keypoints.length!==e.hand[M].keypoints.length&&(z.hand[M].keypoints=e.hand[M].keypoints);let x0=e.hand[M].keypoints&&e.hand[M].keypoints.length>0?e.hand[M].keypoints.map((E,B)=>E.map((X,U0)=>((r-1)*(z.hand[M].keypoints[B][U0]||1)+(X||0))/r)):[],K={};if(Object.keys(z.hand[M].annotations).length!==Object.keys(e.hand[M].annotations).length)z.hand[M].annotations=e.hand[M].annotations,K=z.hand[M].annotations;else if(e.hand[M].annotations)for(let E of Object.keys(e.hand[M].annotations))K[E]=(i=(x=(c=e.hand[M])==null?void 0:c.annotations)==null?void 0:x[E])!=null&&i[0]?e.hand[M].annotations[E].map((B,X)=>B.map((U0,y0)=>((r-1)*z.hand[M].annotations[E][X][y0]+U0)/r)):null;z.hand[M]={...e.hand[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.face||e.face.length!==z.face.length)z.face=JSON.parse(JSON.stringify(e.face));else for(let M=0;M((r-1)*z.face[M].box[E]+K)/r),C0=e.face[M].boxRaw.map((K,E)=>((r-1)*z.face[M].boxRaw[E]+K)/r),x0=e.face[M].annotations;if(Object.keys(z.face[M].annotations).length!==Object.keys(e.face[M].annotations).length)z.face[M].annotations=e.face[M].annotations,x0=z.face[M].annotations;else if(e.face[M].annotations)for(let K of Object.keys(e.face[M].annotations))x0[K]=(m=(d=(f=e.face[M])==null?void 0:f.annotations)==null?void 0:d[K])!=null&&m[0]?e.face[M].annotations[K].map((E,B)=>E.map((X,U0)=>((r-1)*z.face[M].annotations[K][B][U0]+X)/r)):null;if(e.face[M].rotation){let K={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};K.matrix=(y=e.face[M].rotation)==null?void 0:y.matrix,K.angle={roll:((r-1)*(((T=(u=z.face[M].rotation)==null?void 0:u.angle)==null?void 0:T.roll)||0)+(((p=(g=e.face[M].rotation)==null?void 0:g.angle)==null?void 0:p.roll)||0))/r,yaw:((r-1)*(((k=(b=z.face[M].rotation)==null?void 0:b.angle)==null?void 0:k.yaw)||0)+(((N=(P=e.face[M].rotation)==null?void 0:P.angle)==null?void 0:N.yaw)||0))/r,pitch:((r-1)*(((_=(V=z.face[M].rotation)==null?void 0:V.angle)==null?void 0:_.pitch)||0)+((($=(Z=e.face[M].rotation)==null?void 0:Z.angle)==null?void 0:$.pitch)||0))/r},K.gaze={bearing:((r-1)*(((A0=z.face[M].rotation)==null?void 0:A0.gaze.bearing)||0)+(((t0=e.face[M].rotation)==null?void 0:t0.gaze.bearing)||0))/r,strength:((r-1)*(((n0=z.face[M].rotation)==null?void 0:n0.gaze.strength)||0)+(((j0=e.face[M].rotation)==null?void 0:j0.gaze.strength)||0))/r},z.face[M]={...e.face[M],rotation:K,box:T0,boxRaw:C0,annotations:x0}}else z.face[M]={...e.face[M],box:T0,boxRaw:C0,annotations:x0}}if(!z.object||e.object.length!==z.object.length)z.object=JSON.parse(JSON.stringify(e.object));else for(let M=0;M((r-1)*z.object[M].box[K]+x0)/r),C0=e.object[M].boxRaw.map((x0,K)=>((r-1)*z.object[M].boxRaw[K]+x0)/r);z.object[M]={...e.object[M],box:T0,boxRaw:C0}}if(e.persons){let M=e.persons;if(!z.persons||M.length!==z.persons.length)z.persons=JSON.parse(JSON.stringify(M));else for(let T0=0;T0((r-1)*z.persons[T0].box[x0]+C0)/r)}e.gesture&&(z.gesture=e.gesture),z.width=e.width,z.height=e.height;let s=v();return l1=R.perfadd?l1+Math.round(s-n):Math.round(s-n),e.performance&&(z.performance={...e.performance,interpolate:l1}),z}var s0=G(H());var L0;async function c1(e){return!L0||R.initial?L0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",L0.modelUrl),L0}async function lo(e,t){var r;if(L0||(L0=await c1(t)),!(L0!=null&&L0.executor)||!((r=L0==null?void 0:L0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=s0.image.resizeBilinear(e,[L0.inputs[0].shape?L0.inputs[0].shape[1]:0,L0.inputs[0].shape?L0.inputs[0].shape[2]:0],!1),n.norm=s0.div(n.resize,C.tf255),n.res=L0.execute(n.norm),n.squeeze=s0.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=s0.unstack(n.squeeze,2),n.fg=s0.softmax(n.fgRaw),n.mul=s0.mul(n.fg,C.tf255),n.expand=s0.expandDims(n.mul,2),n.output=s0.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let o;switch(t.segmentation.mode||"default"){case"default":n.input=s0.squeeze(e),n.concat=s0.concat([n.input,n.output],-1),o=s0.cast(n.concat,"int32");break;case"alpha":o=s0.cast(n.output,"int32");break;default:o=s0.tensor(0)}return Object.keys(n).forEach(s=>s0.dispose(n[s])),o}var Ot={};ze(Ot,{distance:()=>d1,find:()=>KA,similarity:()=>YA});function d1(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let o=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(o-n);return Math.max(Math.min(s,1),0)};function YA(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let o=d1(e,t,n);return xo(o,n.order||2,n.min||0,n.max||1)}function KA(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let o=Number.MAX_SAFE_INTEGER,r=-1;for(let A=0;AH2,validateModel:()=>Gt});var D2=G(H());var Ue=G(H());var yo=.005,ee={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function x1(e){for(let t of A1){let n=e.keypoints.findIndex(r=>r.part===t[0]),o=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[0]r&&r.part===t[0]),o=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),s=e.keypoints.findIndex(c=>c&&c.part===n[0]),A=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[s]||!e.keypoints[A])continue;let a=e.keypoints[o]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[o].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[o].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(a[0]>a[1]||l[0]>l[1]){let c=e.keypoints[o];e.keypoints[o]=e.keypoints[r],e.keypoints[r]=c}}}function fo(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Ue.pad(e,ee.padding),n.resize=Ue.image.resizeBilinear(n.pad,[t,t]);let o=Ue.cast(n.resize,"int32");return Object.keys(n).forEach(A=>Ue.dispose(n[A])),o}function po(e,t){e.keypoints=e.keypoints.filter(o=>o==null?void 0:o.position);for(let o of e.keypoints)o.position=[o.position[0]*(t[0]+ee.padding[2][0]+ee.padding[2][1])/t[0]-ee.padding[2][0],o.position[1]*(t[1]+ee.padding[1][0]+ee.padding[1][1])/t[1]-ee.padding[1][0]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1]];let n=Le(e.keypoints.map(o=>o.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var b0,Ct=0,y1=Number.MAX_SAFE_INTEGER,d2={boxes:[],bodies:[],last:0};async function uo(e){var t;return R.initial&&(b0=null),b0?e.debug&&h("cached model:",b0.modelUrl):(J2(["size"],e),b0=await L(e.body.modelPath)),Ct=b0!=null&&b0.executor&&((t=b0==null?void 0:b0.inputs)!=null&&t[0].shape)?b0.inputs[0].shape[2]:0,Ct<64&&(Ct=256),D2.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&D2.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),b0}function QA(e,t,n){let o=e[0][0],r=[],s=0;for(let x=0;xt.body.minConfidence){let i=[o[x][1],o[x][0]];r.push({score:Math.round(100*s)/100,part:Nt[x],positionRaw:i,position:[Math.round((n.shape[2]||0)*i[0]),Math.round((n.shape[1]||0)*i[1])]})}s=r.reduce((x,i)=>i.score>x?i.score:x,0);let A=[],a=Le(r.map(x=>x.position),[n.shape[2],n.shape[1]]),l={};for(let[x,i]of Object.entries(Lt)){let f=[];for(let d=0;du.part===i[d]),y=r.find(u=>u.part===i[d+1]);m&&y&&m.score>(t.body.minConfidence||0)&&y.score>(t.body.minConfidence||0)&&f.push([m.position,y.position])}l[x]=f}let c={id:0,score:s,box:a.box,boxRaw:a.boxRaw,keypoints:r,annotations:l};return x1(c),A.push(c),A}function _A(e,t,n){let o=[];for(let r=0;rt.body.minConfidence){let a=[];for(let f=0;f<17;f++){let d=s[3*f+2];if(d>t.body.minConfidence){let m=[s[3*f+1],s[3*f+0]];a.push({part:Nt[f],score:Math.round(100*d)/100,positionRaw:m,position:[Math.round((n.shape[2]||0)*m[0]),Math.round((n.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],c=[Math.trunc(l[0]*(n.shape[2]||0)),Math.trunc(l[1]*(n.shape[1]||0)),Math.trunc(l[2]*(n.shape[2]||0)),Math.trunc(l[3]*(n.shape[1]||0))],x={};for(let[f,d]of Object.entries(Lt)){let m=[];for(let y=0;yg.part===d[y]),T=a.find(g=>g.part===d[y+1]);u&&T&&u.score>(t.body.minConfidence||0)&&T.score>(t.body.minConfidence||0)&&m.push([u.position,T.position])}x[f]=m}let i={id:r,score:A,box:c,boxRaw:l,keypoints:[...a],annotations:x};x1(i),o.push(i)}}return o.sort((r,s)=>s.score-r.score),o.length>t.body.maxDetected&&(o.length=t.body.maxDetected),o}async function f1(e,t){var r;if(!(b0!=null&&b0.executor)||!((r=b0==null?void 0:b0.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(d2.boxes.length=0),y1++;let n=(t.body.skipTime||0)>v()-d2.last,o=y1<(t.body.skipFrames||0);return t.skipAllowed&&n&&o?d2.bodies:new Promise(async s=>{let A={};y1=0,A.input=mo(e,Ct),A.res=b0==null?void 0:b0.execute(A.input),d2.last=v();let a=await A.res.array();d2.bodies=A.res.shape[2]===17?QA(a,t,e):_A(a,t,e);for(let l of d2.bodies)po(l,[e.shape[2]||1,e.shape[1]||1]),fo(l.keypoints);Object.keys(A).forEach(l=>D2.dispose(A[l])),s(d2.bodies)})}var S0=G(H());var ce,Wt=[],bo=0,m1=Number.MAX_SAFE_INTEGER,Ft=0,Dt=2.5;async function go(e){if(!ce||R.initial){ce=await L(e.object.modelPath);let t=ce!=null&&ce.executor?Object.values(ce.modelSignature.inputs):void 0;Ft=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&h("cached model:",ce.modelUrl);return ce}async function $A(e,t,n){var c,x;let o=0,r=[],s=Ft;for(let i of[1,2,4]){let f=i*13,d=S0.squeeze(e.find(p=>p.shape[1]===f**2&&(p.shape[2]||0)===m2.length)),m=await d.array(),y=S0.squeeze(e.find(p=>p.shape[1]===f**2&&(p.shape[2]||0)(n.object.minConfidence||0)&&b!==61){let P=(.5+Math.trunc(p%f))/f,N=(.5+Math.trunc(p/f))/f,V=g[p].map(M=>M*(f/i/s)),[_,Z]=[P-Dt/i*V[0],N-Dt/i*V[1]],[$,A0]=[P+Dt/i*V[2]-_,N+Dt/i*V[3]-Z],t0=[_,Z,$,A0];t0=t0.map(M=>Math.max(0,Math.min(M,1)));let n0=[t0[0]*t[0],t0[1]*t[1],t0[2]*t[0],t0[3]*t[1]],j0={id:o++,score:Math.round(100*k)/100,class:b+1,label:m2[b].label,box:n0.map(M=>Math.trunc(M)),boxRaw:t0};r.push(j0)}}S0.dispose([d,y,u,T])}let A=r.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),a=r.map(i=>i.score),l=[];if(A&&A.length>0){let i=await S0.image.nonMaxSuppressionAsync(A,a,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);l=Array.from(await i.data()),S0.dispose(i)}return r=r.filter((i,f)=>l.includes(f)).sort((i,f)=>f.score-i.score),r}async function p1(e,t){if(!(ce!=null&&ce.executor))return[];let n=(t.object.skipTime||0)>v()-bo,o=m1<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&Wt.length>0?(m1++,Wt):(m1=0,!R.kernels.includes("mod")||!R.kernels.includes("sparsetodense")?Wt:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=S0.image.resizeBilinear(e,[Ft,Ft],!1),a=S0.div(A,C.tf255),l=S0.transpose(a,[0,3,1,2]),c;t.object.enabled&&(c=ce.execute(l)),bo=v();let x=await $A(c,s,t);Wt=x,S0.dispose([A,a,l,...c]),r(x)}))}var V0=G(H());var B2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],ea=B2.length,F2=B2.reduce((e,t,n)=>(e[t]=n,e),{}),ta=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],X7=ta.map(([e,t])=>[F2[e],F2[t]]),vo=[["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 Ro(e){let t=e.reduce(({maxX:n,maxY:o,minX:r,minY:s},{position:{x:A,y:a}})=>({maxX:Math.max(n,A),maxY:Math.max(o,a),minX:Math.min(r,A),minY:Math.min(s,a)}),{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 Mo(e,[t,n],[o,r]){let s=t/o,A=n/r,a=(c,x)=>({id:x,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/o,c.box[2]/r,c.box[3]/o],box:[Math.trunc(c.box[0]*A),Math.trunc(c.box[1]*s),Math.trunc(c.box[2]*A),Math.trunc(c.box[3]*s)],keypoints:c.keypoints.map(({score:i,part:f,position:d})=>({score:i,part:f,position:[Math.trunc(d.x*A),Math.trunc(d.y*s)],positionRaw:[d.x/o,d.y/o]})),annotations:{}});return e.map((c,x)=>a(c,x))}var Bt=class{constructor(t,n){w(this,"priorityQueue");w(this,"numberOfElements");w(this,"getElementValue");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 Po(e,t,n,o){let r=n-e,s=o-t;return r*r+s*s}function g1(e,t){return{x:e.x+t.x,y:e.y+t.y}}var te,oa=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],Ht=1,M2=16,ra=50**2;function ko(e,t,n,o,r,s,A=2){let a=T=>({y:s.get(T.y,T.x,e),x:s.get(T.y,T.x,s.shape[2]/2+e)}),l=(T,g,p)=>({y:b1(Math.round(T.y/M2),0,g-1),x:b1(Math.round(T.x/M2),0,p-1)}),[c,x]=o.shape,i=l(t.position,c,x),f=a(i),m=g1(t.position,f);for(let T=0;T[F2[f],F2[d]]),A=s.map(([,f])=>f),a=s.map(([f])=>f),l=t.shape[2],c=A.length,x=new Array(l),i=h1(e.part,M2,n);x[e.part.id]={score:e.score,part:B2[e.part.id],position:i};for(let f=c-1;f>=0;--f){let d=A[f],m=a[f];x[d]&&!x[m]&&(x[m]=ko(f,x[d],m,t,n,r))}for(let f=0;ft){a=!1;break}if(!a)break}return a}function aa(e,t){let[n,o,r]=t.shape,s=new Bt(n*o*r,({score:A})=>A);for(let A=0;A{var A;let s=(A=r[o])==null?void 0:A.position;return s?Po(n,t,s.y,s.x)<=ra:!1})}function ia(e,t){return t.reduce((o,{position:r,score:s},A)=>(wo(e,r,A)||(o+=s),o),0)/t.length}function la(e,t,n,o,r,s){let A=[],a=aa(s,t);for(;A.lengthd.score>s);let i=ia(A,x),f=Ro(x);i>s&&A.push({keypoints:x,box:f,score:Math.round(100*i)/100})}return A}async function T1(e,t){if(!(te!=null&&te.executor))return[];let n=V0.tidy(()=>{if(!te.inputs[0].shape)return[];let A=V0.image.resizeBilinear(e,[te.inputs[0].shape[2],te.inputs[0].shape[1]]),a=V0.sub(V0.div(V0.cast(A,"float32"),127.5),1),c=te.execute(a,oa).map(x=>V0.squeeze(x,[0]));return c[1]=V0.sigmoid(c[1]),c}),o=await Promise.all(n.map(A=>A.buffer()));for(let A of n)V0.dispose(A);let r=la(o[0],o[1],o[2],o[3],t.body.maxDetected,t.body.minConfidence);return te.inputs[0].shape?Mo(r,[e.shape[1],e.shape[2]],[te.inputs[0].shape[2],te.inputs[0].shape[1]]):[]}async function Eo(e){return!te||R.initial?te=await L(e.body.modelPath):e.debug&&h("cached model:",te.modelUrl),te}var F=G(H());var ve,ca=["fgr","pha","r1o","r2o","r3o","r4o"],g0={},R1=0;function jo(e){F.dispose([g0.r1i,g0.r2i,g0.r3i,g0.r4i,g0.downsample_ratio]),g0.r1i=F.tensor(0),g0.r2i=F.tensor(0),g0.r3i=F.tensor(0),g0.r4i=F.tensor(0),R1=e.segmentation.ratio||.5,g0.downsample_ratio=F.tensor(R1)}async function M1(e){return!ve||R.initial?ve=await L(e.segmentation.modelPath):e.debug&&h("cached model:",ve.modelUrl),jo(e),ve}var So=e=>F.tidy(()=>{let t=F.squeeze(e,[0]),n=F.mul(t,C.tf255);return F.cast(n,"int32")});function v1(e,t){let n=e?So(e):F.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),o=t?So(t):F.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=F.concat([n,o],-1);return F.dispose([n,o]),r}function da(e){return F.tidy(()=>{let t={};return t.unstack=F.unstack(e,-1),t.concat=F.concat(t.unstack,1),t.split=F.split(t.concat,4,1),t.stack=F.concat(t.split,2),t.squeeze=F.squeeze(t.stack,[0]),t.expand=F.expandDims(t.squeeze,-1),t.add=F.add(t.expand,1),t.mul=F.mul(t.add,127.5),t.cast=F.cast(t.mul,"int32"),t.tile=F.tile(t.cast,[1,1,3]),t.alpha=F.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),F.concat([t.tile,t.alpha],-1)})}async function Io(e,t){if(ve||(ve=await M1(t)),!(ve!=null&&ve.executor))return null;g0.src=F.div(e,255),R1!==t.segmentation.ratio&&jo(t);let[n,o,r,s,A,a]=await ve.executeAsync(g0,ca),l;switch(t.segmentation.mode||"default"){case"default":l=v1(n,o);break;case"alpha":l=v1(null,o);break;case"foreground":l=v1(n,null);break;case"state":l=da(r);break;default:l=F.tensor(0)}return F.dispose([g0.src,n,o,g0.r1i,g0.r2i,g0.r3i,g0.r4i]),[g0.r1i,g0.r2i,g0.r3i,g0.r4i]=[r,s,A,a],l}var z0=G(H());var O0;async function P1(e){return!O0||R.initial?O0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",O0.modelUrl),O0}async function Lo(e,t){var r;if(O0||(O0=await P1(t)),!(O0!=null&&O0.executor)||!((r=O0==null?void 0:O0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=z0.image.resizeBilinear(e,[O0.inputs[0].shape?O0.inputs[0].shape[1]:0,O0.inputs[0].shape?O0.inputs[0].shape[2]:0],!1),n.norm=z0.div(n.resize,C.tf255),n.res=O0.execute(n.norm),n.squeeze=z0.squeeze(n.res,[0]),n.alpha=z0.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=z0.mul(n.alpha,C.tf255);let o;switch(t.segmentation.mode||"default"){case"default":n.input=z0.squeeze(e),n.concat=z0.concat([n.input,n.mul],-1),o=z0.cast(n.concat,"int32");break;case"alpha":o=z0.cast(n.mul,"int32");break;default:o=z0.tensor(0)}return Object.keys(n).forEach(s=>z0.dispose(n[s])),o}function Gt(e,t,n){var c,x;if(!t||!((c=e==null?void 0:e.config)!=null&&c.validateModels))return null;let o=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],A=[],a=t.modelUrl,l=t.executor;if((x=l==null?void 0:l.graph)!=null&&x.nodes)for(let i of Object.values(l.graph.nodes)){let f=i.op.toLowerCase();s.includes(f)||s.push(f)}else!l&&e.config.debug&&h("model not loaded",n);for(let i of s)!o.includes(i)&&!r.includes(i)&&!e.env.kernels.includes(i)&&!e.env.kernels.includes(i.replace("_",""))&&!e.env.kernels.includes(i.replace("native",""))&&!e.env.kernels.includes(i.replace("v2",""))&&A.push(i);return e.config.debug&&A.length>0&&h("model validation failed:",n,A),A.length>0?{name:n,missing:A,ops:s,url:a}:null}var H2=class{constructor(t){w(this,"instance");w(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,o=0;for(let s of Object.values(I0))t+=s.sizeFromManifest,n+=s.sizeLoadedWeights,o+=s.sizeDesired;let r=o>0?n/o:0;return{numLoadedModels:Object.values(I0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:o,modelStats:Object.values(I0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var o,r,s,A,a,l,c,x,i,f,d,m,y,u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0;R.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?k3(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((o=this.instance.config.face.antispoof)!=null&&o.enabled)&&!this.models.antispoof?Q3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?tn(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?q3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((A=this.instance.config.face.emotion)!=null&&A.enabled)&&!this.models.emotion?G3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((a=this.instance.config.face.iris)!=null&&a.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?I3(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((c=this.instance.config.face.mesh)!=null&&c.enabled)&&!this.models.facemesh?W3(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((x=this.instance.config.face.gear)!=null&&x.enabled)&&!this.models.gear?sn(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((i=this.instance.config.face.ssrnet)!=null&&i.enabled)&&!this.models.ssrnetage?cn(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((f=this.instance.config.face.ssrnet)!=null&&f.enabled)&&!this.models.ssrnetgender?fn(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((d=this.instance.config.face.mobilefacenet)!=null&&d.enabled)&&!this.models.mobilefacenet?bn(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?Mn(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((y=this.instance.config.body.modelPath)!=null&&y.includes("blazepose"))?a3(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?A3(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((u=this.instance.config.body.modelPath)!=null&&u.includes("efficientpose"))?y3(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("movenet"))?uo(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((g=this.instance.config.body.modelPath)!=null&&g.includes("posenet"))?Eo(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(p=this.instance.config.hand.detector)==null?void 0:p.modelPath)!=null&&b.includes("handtrack"))?so(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((P=(k=this.instance.config.hand.detector)==null?void 0:k.modelPath)!=null&&P.includes("handtrack"))?Ao(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((V=(N=this.instance.config.hand.detector)==null?void 0:N.modelPath)!=null&&V.includes("handdetect"))&&(n.handdetect=$n(this.instance.config),n.handskeleton=eo(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((_=this.instance.config.object.modelPath)!=null&&_.includes("centernet"))?c3(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((Z=this.instance.config.object.modelPath)!=null&&Z.includes("nanodet"))?go(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&(($=this.instance.config.segmentation.modelPath)!=null&&$.includes("selfie"))?P1(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((A0=this.instance.config.segmentation.modelPath)!=null&&A0.includes("meet"))?c1(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((t0=this.instance.config.segmentation.modelPath)!=null&&t0.includes("rvm"))?M1(this.instance.config):null;for(let[n0,j0]of Object.entries(n))j0!=null&&j0.then&&j0.then(M=>this.models[n0]=M);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var o;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(o=this.models[n])==null?void 0:o.modelUrl:null}});for(let n of t){let o=Object.keys(I0).find(r=>r.startsWith(n.name));o&&(n.size=I0[o].sizeLoadedWeights,n.url=I0[o].url)}return t}loaded(){return this.list().filter(o=>o.loaded).map(o=>o.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let o=this.models[n];if(!o)continue;let r=Gt(this.instance,o,n);r&&t.push(r)}return t}};function Co(e,t,n,o,r){var a,l,c,x,i,f;let s=0,A=[];for(let d of e){let m={id:s++,face:d,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)d.box[0]>b.box[0]&&d.box[0]b.box[1]&&d.box[1]+d.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(y.push(b[0],b[0]+b[2]),u.push(b[1],b[1]+b[3]))};T(m.face.box),T((x=m.body)==null?void 0:x.box),T((i=m.hands.left)==null?void 0:i.box),T((f=m.hands.right)==null?void 0:f.box);let g=Math.min(...y),p=Math.min(...u);m.box=[g,p,Math.max(...y)-g,Math.max(...u)-p],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),A.push(m)}return A}var d0=G(H());var Vt=` + gaze: [gaze]\xB0`,body:"body [score]%",bodyPart:"[label] [score]%",object:"[label] [score]%",hand:"[label] [score]%",finger:"[label]",gesture:"[where] [who]: [what]"};var a5=0;function Ys(e,t,n){let o=a0(f0,n);if(!t||!e)return;let r=oe(e);if(r){r.lineJoin="round",r.font=o.font;for(let s=0;sc5,kpt:()=>l5});var l5=["nose","leftEyeInside","leftEye","leftEyeOutside","rightEyeInside","rightEye","rightEyeOutside","leftEar","rightEar","leftMouth","rightMouth","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftPinky","rightPinky","leftIndex","rightIndex","leftThumb","rightThumb","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle","leftHeel","rightHeel","leftFoot","rightFoot","bodyCenter","bodyTop","leftPalm","leftHand","rightPalm","rightHand"],c5={shoulders:["leftShoulder","rightShoulder"],hips:["rightHip","leftHip"],mouth:["leftMouth","rightMouth"],leftLegUpper:["leftHip","leftKnee"],leftLegLower:["leftKnee","leftAnkle"],leftFoot:["leftAnkle","leftHeel","leftFoot"],leftTorso:["leftShoulder","leftHip"],leftArmUpper:["leftShoulder","leftElbow"],leftArmLower:["leftElbow","leftWrist"],leftHand:["leftWrist","leftPalm"],leftHandPinky:["leftPalm","leftPinky"],leftHandIndex:["leftPalm","leftIndex"],leftHandThumb:["leftPalm","leftThumb"],leftEyeOutline:["leftEyeInside","leftEyeOutside"],rightLegUpper:["rightHip","rightKnee"],rightLegLower:["rightKnee","rightAnkle"],rightFoot:["rightAnkle","rightHeel","rightFoot"],rightTorso:["rightShoulder","rightHip"],rightArmUpper:["rightShoulder","rightElbow"],rightArmLower:["rightElbow","rightWrist"],rightHand:["rightWrist","rightPalm"],rightHandPinky:["rightPalm","rightPinky"],rightHandIndex:["rightPalm","rightIndex"],rightHandThumb:["rightPalm","rightThumb"],rightEyeOutline:["rightEyeInside","rightEyeOutside"]};var D=V(G());var se,n2=224,$1,Qs=5,rt=[8,16,32,32,32];function _s(){let e=[],t=0;for(;tn.x)),y:D.tensor1d(e.map(n=>n.y))}}async function e3(e){if(R.initial&&(se=null),!se&&e.body.detector&&e.body.detector.modelPath){se=await L(e.body.detector.modelPath);let t=se!=null&&se.executor?Object.values(se.modelSignature.inputs):void 0;n2=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}else e.debug&&se&&h("cached model:",se.modelUrl);return _s(),se}var _1=[5,5];function $s(e,t){return D.tidy(()=>{let n=D.split(e,12,1),o=D.squeeze(n[0]),r=D.squeeze(n[1]),s=D.squeeze(n[2]),A=D.squeeze(n[3]);o=D.add(D.div(o,n2),t.x),r=D.add(D.div(r,n2),t.y),s=D.mul(D.div(s,n2),_1[0]),A=D.mul(D.div(A,n2),_1[1]);let a=D.sub(o,D.div(s,2)),l=D.sub(r,D.div(A,2)),c=D.add(a,s),x=D.add(l,A);return D.stack([a,l,c,x],1)})}async function eA(e,t,n,o){var c,x;let r=[],s={};s.boxes=$s(e,$1),s.scores=D.sigmoid(t),s.nms=await D.image.nonMaxSuppressionAsync(s.boxes,s.scores,1,((c=n.body.detector)==null?void 0:c.minConfidence)||.1,((x=n.body.detector)==null?void 0:x.iouThreshold)||.1);let A=await s.nms.data(),a=await s.scores.data(),l=await s.boxes.array();for(let i of Array.from(A)){let y=a[i],d=l[i],m=[Math.round(d[0]*o[0]),Math.round(d[1]*o[1]),Math.round(d[2]*o[0]),Math.round(d[3]*o[1])],f={score:y,boxRaw:d,box:m};r.push(f)}return Object.keys(s).forEach(i=>D.dispose(s[i])),r}async function t3(e,t,n){let o={};o.res=se==null?void 0:se.execute(e,["Identity"]),o.logitsRaw=D.slice(o.res,[0,0,0],[1,-1,1]),o.boxesRaw=D.slice(o.res,[0,0,1],[1,-1,-1]),o.logits=D.squeeze(o.logitsRaw),o.boxes=D.squeeze(o.boxesRaw);let r=await eA(o.boxes,o.logits,t,n);return Object.keys(o).forEach(s=>D.dispose(o[s])),r}function Le(e,t=[1,1]){let n=[e.map(a=>a[0]),e.map(a=>a[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[o[0],o[1],r[0]-o[0],r[1]-o[1]],A=[s[0]/t[0],s[1]/t[1],s[2]/t[0],s[3]/t[1]];return{box:s,boxRaw:A}}function n3(e,t=[1,1]){let n=[e.map(c=>c[0]),e.map(c=>c[1])],o=[Math.min(...n[0]),Math.min(...n[1])],r=[Math.max(...n[0]),Math.max(...n[1])],s=[(o[0]+r[0])/2,(o[1]+r[1])/2],A=Math.max(s[0]-o[0],s[1]-o[1],-s[0]+r[0],-s[1]+r[1]),a=[Math.trunc(s[0]-A),Math.trunc(s[1]-A),Math.trunc(2*A),Math.trunc(2*A)],l=[a[0]/t[0],a[1]/t[1],a[2]/t[0],a[3]/t[1]];return{box:a,boxRaw:l}}function st(e,t){let n=[e[2]*t,e[3]*t];return[e[0]-(n[0]-e[2])/2,e[1]-(n[1]-e[3])/2,n[0],n[1]]}var Z0,x5=256,d5=Number.MAX_SAFE_INTEGER,tA={landmarks:["ld_3d","activation_segmentation","activation_heatmap","world_3d","output_poseflag"],detector:[]},at=[],Oe=[[0,0],[0,0],[0,0],[0,0]],o3=0,r3=e=>1-1/(1+Math.exp(e)),A3=e=>e3(e);async function a3(e){if(R.initial&&(Z0=null),Z0)e.debug&&h("cached model:",Z0.modelUrl);else{Z0=await L(e.body.modelPath);let t=Z0!=null&&Z0.executor?Object.values(Z0.modelSignature.inputs):void 0;x5=Array.isArray(t)?parseInt(t[0].tensorShape.dim[1].size):0}return Z0}function s3(e,t,n){var s,A;let o={};if(!((s=e==null?void 0:e.shape)!=null&&s[1])||!((A=e==null?void 0:e.shape)!=null&&A[2]))return e;let r;if(n&&(o.cropped=X0.image.cropAndResize(e,[n],[0],[e.shape[1],e.shape[2]])),e.shape[1]!==e.shape[2]){let a=[e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],l=[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0];Oe=[[0,0],a,l,[0,0]],o.pad=X0.pad(o.cropped||e,Oe),o.resize=X0.image.resizeBilinear(o.pad,[t,t]),r=X0.div(o.resize,C.tf255)}else e.shape[1]!==t?(o.resize=X0.image.resizeBilinear(o.cropped||e,[t,t]),r=X0.div(o.resize,C.tf255)):r=X0.div(o.cropped||e,C.tf255);return Object.keys(o).forEach(a=>X0.dispose(o[a])),r}function nA(e,t,n){for(let o of e)o.position=[Math.trunc(o.position[0]*(t[0]+Oe[2][0]+Oe[2][1])/t[0]-Oe[2][0]),Math.trunc(o.position[1]*(t[1]+Oe[1][0]+Oe[1][1])/t[1]-Oe[1][0]),o.position[2]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1],2*o.position[2]/(t[0]+t[1])];if(n){let o=n[2]-n[0],r=n[3]-n[1];for(let s of e)s.positionRaw=[s.positionRaw[0]/r+n[1],s.positionRaw[1]/o+n[0],s.positionRaw[2]],s.position=[Math.trunc(s.positionRaw[0]*t[0]),Math.trunc(s.positionRaw[1]*t[1]),s.positionRaw[2]]}return e}function oA(e){let t=e.find(a=>a.part==="leftPalm"),n=e.find(a=>a.part==="leftWrist"),o=e.find(a=>a.part==="leftIndex");t.position[2]=((n.position[2]||0)+(o.position[2]||0))/2;let r=e.find(a=>a.part==="rightPalm"),s=e.find(a=>a.part==="rightWrist"),A=e.find(a=>a.part==="rightIndex");r.position[2]=((s.position[2]||0)+(A.position[2]||0))/2}async function rA(e,t,n){if(!(Z0!=null&&Z0.executor))return null;let o={};[o.ld,o.segmentation,o.heatmap,o.world,o.poseflag]=Z0==null?void 0:Z0.execute(e,tA.landmarks);let r=(await o.poseflag.data())[0],s=await o.ld.data(),A=await o.world.data();Object.keys(o).forEach(m=>X0.dispose(o[m]));let a=[],l=5;for(let m=0;mm.position),i=Le(x,[n[0],n[1]]),y={};for(let[m,f]of Object.entries(c5)){let u=[];for(let g=0;gb.part===f[g]),p=c.find(b=>b.part===f[g+1]);T&&p&&u.push([T.position,p.position])}y[m]=u}return{id:0,score:Math.trunc(100*r)/100,box:i.box,boxRaw:i.boxRaw,keypoints:c,annotations:y}}async function y5(e,t){var s,A,a;let n=[e.shape[2]||0,e.shape[1]||0],o=(t.body.skipTime||0)>v()-o3,r=d5<(t.body.skipFrames||0);if(t.skipAllowed&&o&&r&&at!==null)d5++;else{let l=[];if((A=(s=t.body)==null?void 0:s.detector)!=null&&A.enabled){let c=s3(e,224);l=await t3(c,t,n),X0.dispose(c)}else l=[{box:[0,0,0,0],boxRaw:[0,0,1,1],score:0}];for(let c=0;cF0.dispose(o[c])),r}async function p5(e,t){if(!(q0!=null&&q0.executor))return[];let n=(t.object.skipTime||0)>v()-l3,o=m5<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&f5.length>0?(m5++,f5):(m5=0,new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=F0.image.resizeBilinear(e,[o2,o2]),a=t.object.enabled?q0==null?void 0:q0.execute(A,["tower_0/detections"]):null;l3=v(),F0.dispose(A);let l=await sA(a,s,t);f5=l,r(l)}))}var J=V(G());var it={};ze(it,{connected:()=>h5,kpt:()=>u5});var u5=["head","neck","rightShoulder","rightElbow","rightWrist","chest","leftShoulder","leftElbow","leftWrist","bodyCenter","rightHip","rightKnee","rightAnkle","leftHip","leftKnee","leftAnkle"],h5={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var i0,x3=0,B0={id:0,keypoints:[],box:[0,0,0,0],boxRaw:[0,0,0,0],score:0,annotations:{}},b5=Number.MAX_SAFE_INTEGER;async function y3(e){return R.initial&&(i0=null),i0?e.debug&&h("cached model:",i0.modelUrl):i0=await L(e.body.modelPath),i0}async function AA(e,t){let[n,o]=e.shape,r=J.reshape(e,[o*n]),s=J.max(r,0),A=(await s.data())[0];if(A>t){let a=J.argMax(r,0),l=J.mod(a,n),c=(await l.data())[0],x=J.div(a,n),i=(await x.data())[0];return J.dispose([r,s,a,l,x]),[c,i,A]}return J.dispose([r,s]),[0,0,A]}async function g5(e,t){if(!(i0!=null&&i0.executor)||!(i0!=null&&i0.inputs[0].shape))return[];let n=(t.body.skipTime||0)>v()-x3,o=b5<(t.body.skipFrames||0);return t.skipAllowed&&n&&o&&Object.keys(B0.keypoints).length>0?(b5++,[B0]):(b5=0,new Promise(async r=>{let s=J.tidy(()=>{var m,f;let i=J.image.resizeBilinear(e,[((m=i0==null?void 0:i0.inputs[0].shape)==null?void 0:m[2])||0,((f=i0==null?void 0:i0.inputs[0].shape)==null?void 0:f[1])||0],!1),y=J.mul(i,C.tf2);return J.sub(y,C.tf1)}),A;if(t.body.enabled&&(A=i0==null?void 0:i0.execute(s)),x3=v(),J.dispose(s),A){B0.keypoints.length=0;let i=J.squeeze(A);J.dispose(A);let y=J.unstack(i,2);J.dispose(i);for(let d=0;d(t.body.minConfidence||0)&&B0.keypoints.push({score:Math.round(100*u)/100,part:u5[d],positionRaw:[m/i0.inputs[0].shape[2],f/i0.inputs[0].shape[1]],position:[Math.round(e.shape[2]*m/i0.inputs[0].shape[2]),Math.round(e.shape[1]*f/i0.inputs[0].shape[1])]})}y.forEach(d=>J.dispose(d))}B0.score=B0.keypoints.reduce((i,y)=>y.score>i?y.score:i,0);let a=B0.keypoints.map(i=>i.position[0]),l=B0.keypoints.map(i=>i.position[1]);B0.box=[Math.min(...a),Math.min(...l),Math.max(...a)-Math.min(...a),Math.max(...l)-Math.min(...l)];let c=B0.keypoints.map(i=>i.positionRaw[0]),x=B0.keypoints.map(i=>i.positionRaw[1]);B0.boxRaw=[Math.min(...c),Math.min(...x),Math.max(...c)-Math.min(...c),Math.max(...x)-Math.min(...x)];for(let[i,y]of Object.entries(h5)){let d=[];for(let m=0;mg.part===y[m]),u=B0.keypoints.find(g=>g.part===y[m+1]);f&&u&&f.score>(t.body.minConfidence||0)&&u.score>(t.body.minConfidence||0)&&d.push([f.position,u.position])}B0.annotations[i]=d}r([B0])}))}var l0=V(G());var De=V(G());var O=V(G());var Me=V(G());var p2=e=>[Math.abs(e.endPoint[0]-e.startPoint[0]),Math.abs(e.endPoint[1]-e.startPoint[1])],lt=e=>[e.startPoint[0]+(e.endPoint[0]-e.startPoint[0])/2,e.startPoint[1]+(e.endPoint[1]-e.startPoint[1])/2,1],ct=(e,t)=>e?[Math.trunc(Math.max(0,e.startPoint[0])),Math.trunc(Math.max(0,e.startPoint[1])),Math.trunc(Math.min(t.shape[2]||0,e.endPoint[0])-Math.max(0,e.startPoint[0])),Math.trunc(Math.min(t.shape[1]||0,e.endPoint[1])-Math.max(0,e.startPoint[1]))]:[0,0,0,0],dt=(e,t)=>e?[e.startPoint[0]/(t.shape[2]||0),e.startPoint[1]/(t.shape[1]||0),(e.endPoint[0]-e.startPoint[0])/(t.shape[2]||0),(e.endPoint[1]-e.startPoint[1])/(t.shape[1]||0)]:[0,0,0,0],u3=(e,t,n)=>{let o=[e.startPoint[0]*t[0],e.startPoint[1]*t[1]],r=[e.endPoint[0]*t[0],e.endPoint[1]*t[1]],s=e.landmarks.map(A=>[(A[0]+n[0])*t[0],(A[1]+n[1])*t[1]]);return{startPoint:o,endPoint:r,landmarks:s,confidence:e.confidence}},T5=(e,t,n)=>{let o=t.shape[1],r=t.shape[2],s=[e.startPoint[1]/o,e.startPoint[0]/r,e.endPoint[1]/o,e.endPoint[0]/r],A=Me.image.cropAndResize(t,[s],[0],n),a=Me.div(A,C.tf255);return Me.dispose(A),a},xt=(e,t)=>{let n=lt(e),o=p2(e),r=[t*o[0]/2,t*o[1]/2];return{startPoint:[n[0]-r[0],n[1]-r[1]],endPoint:[n[0]+r[0],n[1]+r[1]],landmarks:e.landmarks,confidence:e.confidence,size:o}},yt=e=>{let t=lt(e),n=p2(e),o=Math.max(...n)/2;return{startPoint:[Math.round(t[0]-o),Math.round(t[1]-o)],endPoint:[Math.round(t[0]+o),Math.round(t[1]+o)],landmarks:e.landmarks,confidence:e.confidence,size:[Math.round(n[0]),Math.round(n[1])]}},h3=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{startPoint:[Math.min(...t),Math.min(...n)],endPoint:[Math.max(...t),Math.max(...n)],landmarks:e}},v5=[[1,0,0],[0,1,0],[0,0,1]],aA=e=>e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI)),iA=(e,t)=>aA(Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]));var m3=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]],r2=(e,t)=>{let n=0;for(let o=0;o{let n=[];for(let o=0;o{let n=[],o=e.length;for(let r=0;r{let n=Math.cos(e),o=Math.sin(e),r=[[n,-o,0],[o,n,0],[0,0,1]],s=m3(t[0],t[1]),A=p3(s,r),a=m3(-t[0],-t[1]);return p3(A,a)},cA=e=>{let t=[[e[0][0],e[1][0]],[e[0][1],e[1][1]]],n=[e[0][2],e[1][2]],o=[-r2(t[0],n),-r2(t[1],n)];return[t[0].concat(o[0]),t[1].concat(o[1]),[0,0,1]]},dA=(e,t)=>[r2(e,t[0]),r2(e,t[1])];function g3(e){let t=e===192?{strides:[4],anchors:[1]}:{strides:[e/16,e/8],anchors:[2,6]},n=[];for(let o=0;o[s[0]/r*(d[0]-r/2),s[1]/r*(d[1]-r/2),d[2]||0]),a=n&&n!==0&&Math.abs(n)>.2,l=a?b3(n,[0,0]):v5,c=a?A.map(d=>[...dA(d,l),d[2]]):A,x=a?cA(o):v5,i=lt(t),y=[r2(i,x[0]),r2(i,x[1])];return c.map(d=>[Math.trunc(d[0]+y[0]),Math.trunc(d[1]+y[1]),Math.trunc(d[2]||0)])}function v3(e,t,n,o){let r=t.landmarks.length>=r5.count?r5.symmetryLine:_e.symmetryLine,s=0,A=v5,a;if(e&&R.kernels.includes("rotatewithoffset"))if(s=iA(t.landmarks[r[0]],t.landmarks[r[1]]),s&&s!==0&&Math.abs(s)>.2){let c=lt(t),x=[c[0]/n.shape[2],c[1]/n.shape[1]],i=Me.image.rotateWithOffset(n,s,0,[x[0],x[1]]);A=b3(-s,c),a=T5(t,i,[o,o]),Me.dispose(i)}else a=T5(t,n,[o,o]);else a=T5(t,n,[o,o]);return[s,A,a]}var xA=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return[Math.min(...t)+(Math.max(...t)-Math.min(...t))/2,Math.min(...n)+(Math.max(...n)-Math.min(...n))/2]},R3=(e,t)=>{let n=xA(e),o=p2(t);return{startPoint:[n[0]-o[0]/2,n[1]-o[1]/2],endPoint:[n[0]+o[0]/2,n[1]+o[1]/2]}};var M3=6,xe,ft=null,Ce=0,u2=null,P3=()=>Ce;async function k3(e){var t;return R.initial&&(xe=null),xe?e.debug&&h("cached model:",xe.modelUrl):xe=await L((t=e.face.detector)==null?void 0:t.modelPath),Ce=xe.executor&&xe.inputs[0].shape?xe.inputs[0].shape[2]:256,u2=O.scalar(Ce,"int32"),ft=O.tensor2d(g3(Ce)),xe}function yA(e){if(!ft||!u2)return O.zeros([0,0]);let t={};t.boxStarts=O.slice(e,[0,1],[-1,2]),t.centers=O.add(t.boxStarts,ft),t.boxSizes=O.slice(e,[0,3],[-1,2]),t.boxSizesNormalized=O.div(t.boxSizes,u2),t.centersNormalized=O.div(t.centers,u2),t.halfBoxSize=O.div(t.boxSizesNormalized,C.tf2),t.starts=O.sub(t.centersNormalized,t.halfBoxSize),t.ends=O.add(t.centersNormalized,t.halfBoxSize),t.startNormalized=O.mul(t.starts,u2),t.endNormalized=O.mul(t.ends,u2);let n=O.concat2d([t.startNormalized,t.endNormalized],1);return Object.keys(t).forEach(o=>O.dispose(t[o])),n}async function w3(e,t){var a,l,c,x,i,y,d;if(!e||e.isDisposedInternal||e.shape.length!==4||e.shape[1]<1||e.shape[2]<1)return[];let n={};n.resized=O.image.resizeBilinear(e,[Ce,Ce]),n.div=O.div(n.resized,C.tf127),n.normalized=O.sub(n.div,C.tf05);let o=xe==null?void 0:xe.execute(n.normalized);if(Array.isArray(o)&&o.length>2){let m=o.sort((f,u)=>f.size-u.size);n.concat384=O.concat([m[0],m[2]],2),n.concat512=O.concat([m[1],m[3]],2),n.concat=O.concat([n.concat512,n.concat384],1),n.batch=O.squeeze(n.concat,[0])}else Array.isArray(o)?n.batch=O.squeeze(o[0]):n.batch=O.squeeze(o);O.dispose(o),n.boxes=yA(n.batch),n.logits=O.slice(n.batch,[0,0],[-1,1]),n.sigmoid=O.sigmoid(n.logits),n.scores=O.squeeze(n.sigmoid),n.nms=await O.image.nonMaxSuppressionAsync(n.boxes,n.scores,((a=t.face.detector)==null?void 0:a.maxDetected)||0,((l=t.face.detector)==null?void 0:l.iouThreshold)||0,((c=t.face.detector)==null?void 0:c.minConfidence)||0);let r=await n.nms.array(),s=[],A=await n.scores.data();for(let m=0;m(((x=t.face.detector)==null?void 0:x.minConfidence)||0)){let u={};u.bbox=O.slice(n.boxes,[r[m],0],[1,-1]),u.slice=O.slice(n.batch,[r[m],M3-1],[1,-1]),u.squeeze=O.squeeze(u.slice),u.landmarks=O.reshape(u.squeeze,[M3,-1]);let g=await u.bbox.data(),T={startPoint:[g[0],g[1]],endPoint:[g[2],g[3]],landmarks:await u.landmarks.array(),confidence:f};u.anchor=O.slice(ft,[r[m],0],[1,2]);let p=await u.anchor.data(),b=u3(T,[(e.shape[2]||0)/Ce,(e.shape[1]||0)/Ce],p),k=xt(b,((i=t.face.detector)==null?void 0:i.scale)||1.4),P=yt(k);P.size[0]>(((y=t.face.detector)==null?void 0:y.minSize)||0)&&P.size[1]>(((d=t.face.detector)==null?void 0:d.minSize)||0)&&s.push(P),Object.keys(u).forEach(I=>O.dispose(u[I]))}}return Object.keys(n).forEach(m=>O.dispose(n[m])),s}var ye=V(G());var K0,We=0,M5=ae.leftEyeLower0,P5=ae.rightEyeLower0,h2={leftBounds:[M5[0],M5[M5.length-1]],rightBounds:[P5[0],P5[P5.length-1]]},b2={upperCenter:3,lowerCenter:4,index:71,numCoordinates:76};async function I3(e){var t,n;return R.initial&&(K0=null),K0?e.debug&&h("cached model:",K0.modelUrl):K0=await L((t=e.face.iris)==null?void 0:t.modelPath),We=K0!=null&&K0.executor&&((n=K0.inputs)!=null&&n[0].shape)?K0.inputs[0].shape[2]:0,We===-1&&(We=64),K0}function mt(e,t,n,o){for(let r=0;r{let t=e[h2.leftBounds[0]][2],n=e[h2.rightBounds[0]][2];return t-n},z3=(e,t,n,o,r,s=!1,A=2.3)=>{let a=yt(xt(h3([e[n],e[o]]),A)),l=p2(a),c=ye.image.cropAndResize(t,[[a.startPoint[1]/r,a.startPoint[0]/r,a.endPoint[1]/r,a.endPoint[0]/r]],[0],[We,We]);if(s&&R.kernels.includes("flipleftright")){let x=ye.image.flipLeftRight(c);ye.dispose(c),c=x}return{box:a,boxSize:l,crop:c}},S3=(e,t,n,o=!1)=>{let r=[];for(let s=0;s{let o=e[ae[`${n}EyeUpper0`][b2.upperCenter]][2],r=e[ae[`${n}EyeLower0`][b2.lowerCenter]][2],s=(o+r)/2;return t.map((A,a)=>{let l=s;return a===2?l=o:a===4&&(l=r),[A[0],A[1],l]})};async function N3(e,t,n,o){var I,B;if(!(K0!=null&&K0.executor))return e;let{box:r,boxSize:s,crop:A}=z3(e,t,h2.leftBounds[0],h2.leftBounds[1],n,!0,((I=o.face.iris)==null?void 0:I.scale)||2.3),{box:a,boxSize:l,crop:c}=z3(e,t,h2.rightBounds[0],h2.rightBounds[1],n,!0,((B=o.face.iris)==null?void 0:B.scale)||2.3),x=ye.concat([A,c]);ye.dispose(A),ye.dispose(c);let i=K0.execute(x);ye.dispose(x);let y=await i.data();ye.dispose(i);let d=y.slice(0,b2.numCoordinates*3),{rawCoords:m,iris:f}=S3(d,r,s,!0),u=y.slice(b2.numCoordinates*3),{rawCoords:g,iris:T}=S3(u,a,l,!1),p=fA(e);Math.abs(p)<30?(mt(e,m,"left",null),mt(e,g,"right",null)):p<1?mt(e,m,"left",["EyeUpper0","EyeLower0"]):mt(e,g,"right",["EyeUpper0","EyeLower0"]);let b=j3(e,f,"left"),k=j3(e,T,"right");return e.concat(b).concat(k)}async function O3(e,t){var s,A,a,l,c,x,i,y,d,m;let n={lips:await((A=(s=t.filter(f=>f.size===160))==null?void 0:s[0])==null?void 0:A.data()),irisL:await((l=(a=t.filter(f=>f.size===10))==null?void 0:a[0])==null?void 0:l.data()),eyeL:await((x=(c=t.filter(f=>f.size===142))==null?void 0:c[0])==null?void 0:x.data()),irisR:await((y=(i=t.filter(f=>f.size===10))==null?void 0:i[1])==null?void 0:y.data()),eyeR:await((m=(d=t.filter(f=>f.size===142))==null?void 0:d[1])==null?void 0:m.data())};for(let f of Object.values(n))if(!f)return e;let o=e2.reduce((f,u)=>f+=e[u][2],0)/e2.length;for(let f=0;ff+=e[u][2],0)/t2.length;for(let f=0;fv()-ge.timestamp,o=ge.skipped<(((c=t.face.detector)==null?void 0:c.skipFrames)||0);!t.skipAllowed||!n||!o||ge.boxes.length===0?(ge.boxes=await w3(e,t),ge.timestamp=v(),ge.skipped=0):ge.skipped++;let r=[],s=[],A=0,a=O2;for(let T=0;T[I[0]/(e.shape[2]||0),I[1]/(e.shape[1]||0),(I[2]||0)/a]);for(let I of Object.keys(_e))P.annotations[I]=[P.mesh[_e[I]]]}else if(!r0)t.debug&&h("face mesh detection requested, but model is not loaded");else{if((d=t.face.attention)!=null&&d.enabled&&!R.kernels.includes("atan2"))return t.face.attention.enabled=!1,De.dispose(P.tensor),r;let I=r0.execute(P.tensor),_=await I.find(Z=>Z.shape[Z.shape.length-1]===1).data();if(P.faceScore=Math.round(100*_[0])/100,P.faceScore<(((m=t.face.detector)==null?void 0:m.minConfidence)||1)){if(p.confidence=P.faceScore,t.face.mesh.keepInvalid){P.box=ct(p,e),P.boxRaw=dt(p,e),P.size=p.size,P.score=P.boxScore,P.mesh=p.landmarks,P.meshRaw=P.mesh.map(Z=>[Z[0]/(e.shape[2]||1),Z[1]/(e.shape[1]||1),(Z[2]||0)/a]);for(let Z of Object.keys(_e))P.annotations[Z]=[P.mesh[_e[Z]]]}}else{let Z=I.find(n0=>n0.shape[n0.shape.length-1]===1404),$=De.reshape(Z,[-1,3]),A0=await $.array();De.dispose($),(f=t.face.attention)!=null&&f.enabled?A0=await O3(A0,I):(u=t.face.iris)!=null&&u.enabled&&(A0=await N3(A0,P.tensor,O2,t)),P.mesh=T3(A0,p,b,k,O2),P.meshRaw=P.mesh.map(n0=>[n0[0]/(e.shape[2]||0),n0[1]/(e.shape[1]||0),(n0[2]||0)/a]);for(let n0 of Object.keys(ae))P.annotations[n0]=ae[n0].map(j0=>P.mesh[j0]);P.score=P.faceScore;let t0={...R3(P.mesh,p),confidence:p.confidence,landmarks:p.landmarks,size:p.size};P.box=ct(t0,e),P.boxRaw=dt(t0,e),P.size=t0.size,s.push(t0)}De.dispose(I)}P.score>(((g=t.face.detector)==null?void 0:g.minConfidence)||1)?r.push(P):De.dispose(P.tensor)}return ge.boxes=s,r}async function W3(e){var t,n,o,r,s,A;return R.initial&&(r0=null),(t=e.face.attention)!=null&&t.enabled&&(r0!=null&&r0.signature)&&Object.keys(((n=r0==null?void 0:r0.signature)==null?void 0:n.outputs)||{}).length<6&&(r0=null),r0?e.debug&&h("cached model:",r0.modelUrl):(o=e.face.attention)!=null&&o.enabled?r0=await L(e.face.attention.modelPath):r0=await L((r=e.face.mesh)==null?void 0:r.modelPath),O2=r0.executor&&((s=r0==null?void 0:r0.inputs)!=null&&s[0].shape)?(A=r0==null?void 0:r0.inputs)==null?void 0:A[0].shape[2]:256,r0}var D3=$e,F3=N2;var J0=V(G());var E5=[],P0,pt=[],B3=0,H3=0,w5=Number.MAX_SAFE_INTEGER,z5=!1;async function G3(e){var t,n,o;return R.initial&&(P0=null),P0?e.debug&&h("cached model:",P0.modelUrl):(P0=await L((t=e.face.emotion)==null?void 0:t.modelPath),z5=((o=(n=P0==null?void 0:P0.inputs)==null?void 0:n[0].shape)==null?void 0:o[3])===3,z5?E5=["angry","disgust","fear","happy","neutral","sad","surprise"]:E5=["angry","disgust","fear","happy","sad","surprise","neutral"]),P0}async function S5(e,t,n,o){var A,a;if(!P0)return[];let r=w5<(((A=t.face.emotion)==null?void 0:A.skipFrames)||0),s=(((a=t.face.emotion)==null?void 0:a.skipTime)||0)>v()-H3;return t.skipAllowed&&s&&r&&B3===o&&pt[n]&&pt[n].length>0?(w5++,pt[n]):(w5=0,new Promise(async l=>{var x,i,y;let c=[];if((x=t.face.emotion)!=null&&x.enabled){let d={},m=P0!=null&&P0.inputs[0].shape?P0.inputs[0].shape[2]:0;if(((i=t.face.emotion)==null?void 0:i.crop)>0){let u=(y=t.face.emotion)==null?void 0:y.crop,g=[[u,u,1-u,1-u]];d.resize=J0.image.cropAndResize(e,g,[0],[m,m])}else d.resize=J0.image.resizeBilinear(e,[m,m],!1);z5?(d.mul=J0.mul(d.resize,255),d.normalize=J0.sub(d.mul,[103.939,116.779,123.68]),d.emotion=P0==null?void 0:P0.execute(d.normalize)):(d.channels=J0.mul(d.resize,C.rgb),d.grayscale=J0.sum(d.channels,3,!0),d.grayscaleSub=J0.sub(d.grayscale,C.tf05),d.grayscaleMul=J0.mul(d.grayscaleSub,C.tf2),d.emotion=P0==null?void 0:P0.execute(d.grayscaleMul)),H3=v();let f=await d.emotion.data();for(let u=0;u(t.face.emotion.minConfidence||0)&&c.push({score:Math.min(.99,Math.trunc(100*f[u])/100),emotion:E5[u]});c.sort((u,g)=>g.score-u.score),Object.keys(d).forEach(u=>J0.dispose(d[u]))}pt[n]=c,B3=o,l(c)}))}var ie=V(G());var k0,Fe=[],Z3=0,X3=0,j5=Number.MAX_SAFE_INTEGER;async function q3(e){var t;return R.initial&&(k0=null),k0?e.debug&&h("cached model:",k0.modelUrl):k0=await L((t=e.face.description)==null?void 0:t.modelPath),k0}function pA(e,t){var s,A;let n=e.image||e.tensor||e;if(!(k0!=null&&k0.inputs[0].shape))return n;let o;if(((s=t.face.description)==null?void 0:s.crop)>0){let a=(A=t.face.description)==null?void 0:A.crop,l=[[a,a,1-a,1-a]];o=ie.image.cropAndResize(n,l,[0],[k0.inputs[0].shape[2],k0.inputs[0].shape[1]])}else o=ie.image.resizeBilinear(n,[k0.inputs[0].shape[2],k0.inputs[0].shape[1]],!1);let r=ie.mul(o,C.tf255);return ie.dispose(o),r}async function I5(e,t,n,o){var a,l,c,x;let r={age:0,gender:"unknown",genderScore:0,descriptor:[]};if(!(k0!=null&&k0.executor))return r;let s=j5<(((a=t.face.description)==null?void 0:a.skipFrames)||0),A=(((l=t.face.description)==null?void 0:l.skipTime)||0)>v()-Z3;return t.skipAllowed&&s&&A&&X3===o&&((c=Fe==null?void 0:Fe[n])==null?void 0:c.age)>0&&((x=Fe==null?void 0:Fe[n])==null?void 0:x.genderScore)>0?(j5++,Fe[n]):(j5=0,new Promise(async i=>{var y;if((y=t.face.description)!=null&&y.enabled){let d=pA(e,t),m=k0==null?void 0:k0.execute(d);Z3=v(),ie.dispose(d);let u=await m.find(B=>B.shape[1]===1).data(),g=Math.trunc(200*Math.abs(u[0]-.5))/100;g>(t.face.description.minConfidence||0)&&(r.gender=u[0]<=.5?"female":"male",r.genderScore=Math.min(.99,g));let T=ie.argMax(m.find(B=>B.shape[1]===100),1),p=(await T.data())[0];ie.dispose(T);let k=await m.find(B=>B.shape[1]===100).data();r.age=Math.round(k[p-1]>k[p+1]?10*p-100*k[p-1]:10*p+100*k[p+1])/10,(Number.isNaN(u[0])||Number.isNaN(k[0]))&&h("faceres error:",{model:k0,result:m});let P=m.find(B=>B.shape[1]===1024),I=P?await P.data():[];r.descriptor=Array.from(I),m.forEach(B=>ie.dispose(B))}Fe[n]=r,X3=o,i(r)}))}var g2=.1,N5=.5;function uA(e,t,n){let o=!1,r=n.length-1;for(let s=0;st!=n[r].y>t&&e<(n[r].x-n[s].x)*(t-n[s].y)/(n[r].y-n[s].y)+n[s].x&&(o=!o);return o}async function Y3(e){if(!e.tensor||!e.mesh||e.mesh.length<100)return e.tensor;let t=e.tensor.shape[2]||0,n=e.tensor.shape[1]||0,o=await e.tensor.buffer(),r=[];for(let A of ae.silhouette)r.push({x:(e.mesh[A][0]-e.box[0])/e.box[2],y:(e.mesh[A][1]-e.box[1])/e.box[3]});g2&&g2>0&&(r=r.map(A=>({x:A.x>.5?A.x+g2:A.x-g2,y:A.y>.5?A.y+g2:A.y-g2})));for(let A=0;Av()-J3,s=L5<(((a=t.face.antispoof)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&K3===o&&ut[n]?(L5++,ut[n]):(L5=0,new Promise(async l=>{let c=ht.image.resizeBilinear(e,[w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[2]:0,w0!=null&&w0.inputs[0].shape?w0.inputs[0].shape[1]:0],!1),x=w0==null?void 0:w0.execute(c),i=(await x.data())[0];ut[n]=Math.round(100*i)/100,K3=o,J3=v(),ht.dispose([c,x]),l(ut[n])}))}var gt=V(G());var E0,bt=[],C5=Number.MAX_SAFE_INTEGER,$3=0,en=0;async function tn(e){var t;return R.initial&&(E0=null),E0?e.debug&&h("cached model:",E0.modelUrl):E0=await L((t=e.face.liveness)==null?void 0:t.modelPath),E0}async function W5(e,t,n,o){var A,a;if(!(E0!=null&&E0.executor))return 0;let r=(((A=t.face.liveness)==null?void 0:A.skipTime)||0)>v()-en,s=C5<(((a=t.face.liveness)==null?void 0:a.skipFrames)||0);return t.skipAllowed&&r&&s&&$3===o&&bt[n]?(C5++,bt[n]):(C5=0,new Promise(async l=>{let c=gt.image.resizeBilinear(e,[E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[2]:0,E0!=null&&E0.inputs[0].shape?E0.inputs[0].shape[1]:0],!1),x=E0==null?void 0:E0.execute(c),i=(await x.data())[0];bt[n]=Math.round(100*i)/100,$3=o,en=v(),gt.dispose([c,x]),l(bt[n])}))}var Tt=V(G());var le,D5=[],bA=["white","black","asian","indian","other"],gA=[15,23,28,35.5,45.5,55.5,65],on=0,rn=0,F5=Number.MAX_SAFE_INTEGER;async function sn(e){var t;return R.initial&&(le=null),le?e.debug&&h("cached model:",le.modelUrl):le=await L((t=e.face.gear)==null?void 0:t.modelPath),le}async function B5(e,t,n,o){var A,a;if(!le)return{age:0,gender:"unknown",genderScore:0,race:[]};let r=F5<(((A=t.face.gear)==null?void 0:A.skipFrames)||0),s=(((a=t.face.gear)==null?void 0:a.skipTime)||0)>v()-rn;return t.skipAllowed&&s&&r&&on===o&&D5[n]?(F5++,D5[n]):(F5=0,new Promise(async l=>{var g,T,p,b;if(!(le!=null&&le.inputs[0].shape))return;let c={},x=[[0,.1,.9,.9]];if(((g=t.face.gear)==null?void 0:g.crop)>0){let k=(T=t.face.gear)==null?void 0:T.crop;x=[[k,k,1-k,1-k]]}c.resize=Tt.image.cropAndResize(e,x,[0],[le.inputs[0].shape[2],le.inputs[0].shape[1]]);let i={age:0,gender:"unknown",genderScore:0,race:[]};(p=t.face.gear)!=null&&p.enabled&&([c.age,c.gender,c.race]=le.execute(c.resize,["age_output","gender_output","race_output"]));let y=await c.gender.data();i.gender=y[0]>y[1]?"male":"female",i.genderScore=Math.round(100*(y[0]>y[1]?y[0]:y[1]))/100;let d=await c.race.data();for(let k=0;k(((b=t.face.gear)==null?void 0:b.minConfidence)||.2)&&i.race.push({score:Math.round(100*d[k])/100,race:bA[k]});i.race.sort((k,P)=>P.score-k.score);let f=Array.from(await c.age.data()).map((k,P)=>[gA[P],k]).sort((k,P)=>P[1]-k[1]),u=f[0][0];for(let k=1;kTt.dispose(c[k])),D5[n]=i,on=o,rn=v(),l(i)}))}var s2=V(G());var H0,vt=[],an=0,ln=0,H5=Number.MAX_SAFE_INTEGER;async function cn(e){return R.initial&&(H0=null),H0?e.debug&&h("cached model:",H0.modelUrl):H0=await L(e.face.ssrnet.modelPathAge),H0}async function G5(e,t,n,o){var A,a,l,c;if(!H0)return{age:0};let r=H5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-ln;return t.skipAllowed&&r&&s&&an===o&&((l=vt[n])!=null&&l.age)&&((c=vt[n])==null?void 0:c.age)>0?(H5++,vt[n]):(H5=0,new Promise(async x=>{var d,m,f;if(!(H0!=null&&H0.inputs)||!H0.inputs[0]||!H0.inputs[0].shape)return;let i={};if(((d=t.face.ssrnet)==null?void 0:d.crop)>0){let u=(m=t.face.ssrnet)==null?void 0:m.crop,g=[[u,u,1-u,1-u]];i.resize=s2.image.cropAndResize(e,g,[0],[H0.inputs[0].shape[2],H0.inputs[0].shape[1]])}else i.resize=s2.image.resizeBilinear(e,[H0.inputs[0].shape[2],H0.inputs[0].shape[1]],!1);i.enhance=s2.mul(i.resize,C.tf255);let y={age:0};if((f=t.face.ssrnet)!=null&&f.enabled&&(i.age=H0.execute(i.enhance)),i.age){let u=await i.age.data();y.age=Math.trunc(10*u[0])/10}Object.keys(i).forEach(u=>s2.dispose(i[u])),vt[n]=y,an=o,ln=v(),x(y)}))}var v0=V(G());var N0,Rt=[],xn=0,yn=0,V5=Number.MAX_SAFE_INTEGER,Z5=[.2989,.587,.114];async function fn(e){var t;return R.initial&&(N0=null),N0?e.debug&&h("cached model:",N0.modelUrl):N0=await L((t=e.face.ssrnet)==null?void 0:t.modelPathGender),N0}async function X5(e,t,n,o){var A,a,l,c;if(!N0)return{gender:"unknown",genderScore:0};let r=V5<(((A=t.face.ssrnet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.ssrnet)==null?void 0:a.skipTime)||0)>v()-yn;return t.skipAllowed&&r&&s&&xn===o&&((l=Rt[n])!=null&&l.gender)&&((c=Rt[n])==null?void 0:c.genderScore)>0?(V5++,Rt[n]):(V5=0,new Promise(async x=>{var m,f,u;if(!(N0!=null&&N0.inputs[0].shape))return;let i={};if(((m=t.face.ssrnet)==null?void 0:m.crop)>0){let g=(f=t.face.ssrnet)==null?void 0:f.crop,T=[[g,g,1-g,1-g]];i.resize=v0.image.cropAndResize(e,T,[0],[N0.inputs[0].shape[2],N0.inputs[0].shape[1]])}else i.resize=v0.image.resizeBilinear(e,[N0.inputs[0].shape[2],N0.inputs[0].shape[1]],!1);i.enhance=v0.tidy(()=>{var T,p;let g;if(((p=(T=N0==null?void 0:N0.inputs)==null?void 0:T[0].shape)==null?void 0:p[3])===1){let[b,k,P]=v0.split(i.resize,3,3),I=v0.mul(b,Z5[0]),B=v0.mul(k,Z5[1]),_=v0.mul(P,Z5[2]),Z=v0.addN([I,B,_]);g=v0.mul(v0.sub(Z,C.tf05),2)}else g=v0.mul(v0.sub(i.resize,C.tf05),2);return g});let y={gender:"unknown",genderScore:0};(u=t.face.ssrnet)!=null&&u.enabled&&(i.gender=N0.execute(i.enhance));let d=await i.gender.data();y.gender=d[0]>d[1]?"female":"male",y.genderScore=d[0]>d[1]?Math.trunc(100*d[0])/100:Math.trunc(100*d[1])/100,Object.keys(i).forEach(g=>v0.dispose(i[g])),Rt[n]=y,xn=o,yn=v(),x(y)}))}var Mt=V(G());var Q0,q5=[],pn=0,un=0,hn=Number.MAX_SAFE_INTEGER;async function bn(e){var t;return R.initial&&(Q0=null),Q0?e.debug&&h("cached model:",Q0.modelUrl):Q0=await L((t=e.face.mobilefacenet)==null?void 0:t.modelPath),Q0}async function U5(e,t,n,o){var A,a;if(!(Q0!=null&&Q0.executor))return[];let r=hn<(((A=t.face.mobilefacenet)==null?void 0:A.skipFrames)||0),s=(((a=t.face.mobilefacenet)==null?void 0:a.skipTime)||0)>v()-un;return t.skipAllowed&&s&&r&&pn===o&&q5[n]?(hn++,q5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.mobilefacenet)!=null&&x.enabled&&(Q0!=null&&Q0.inputs[0].shape)){let i={};i.crop=Mt.image.resizeBilinear(e,[Q0.inputs[0].shape[2],Q0.inputs[0].shape[1]],!1),i.data=Q0.execute(i.crop);let y=await i.data.data();c=Array.from(y),Object.keys(i).forEach(d=>Mt.dispose(i[d]))}q5[n]=c,pn=o,un=v(),l(c)})}var Pt=V(G());var _0,Y5=[],Tn=0,vn=0,Rn=Number.MAX_SAFE_INTEGER;async function Mn(e){return R.initial&&(_0=null),_0?e.debug&&h("cached model:",_0.modelUrl):_0=await L(e.face.insightface.modelPath),_0}async function K5(e,t,n,o){var A,a;if(!(_0!=null&&_0.executor))return[];let r=Rn<(((A=t.face.insightface)==null?void 0:A.skipFrames)||0),s=(((a=t.face.insightface)==null?void 0:a.skipTime)||0)>v()-vn;return t.skipAllowed&&s&&r&&Tn===o&&Y5[n]?(Rn++,Y5[n]):new Promise(async l=>{var x;let c=[];if((x=t.face.insightface)!=null&&x.enabled&&(_0!=null&&_0.inputs[0].shape)){let i={};i.crop=Pt.image.resizeBilinear(e,[_0.inputs[0].shape[2],_0.inputs[0].shape[1]],!1),i.data=_0.execute(i.crop);let y=await i.data.data();c=Array.from(y),Object.keys(i).forEach(d=>Pt.dispose(i[d]))}Y5[n]=c,Tn=o,vn=v(),l(c)})}var TA=e=>{let t=(i,y)=>Math.atan2(i[1]-y[1],i[0]-y[0]);if(!e.annotations.rightEyeIris||!e.annotations.leftEyeIris)return{bearing:0,strength:0};let n=[0,-.1],o=1,r=(e.mesh[33][2]||0)>(e.mesh[263][2]||0),s=r?e.mesh[473]:e.mesh[468],A=r?[(e.mesh[133][0]+e.mesh[33][0])/2,(e.mesh[133][1]+e.mesh[33][1])/2]:[(e.mesh[263][0]+e.mesh[362][0])/2,(e.mesh[263][1]+e.mesh[362][1])/2],a=r?[e.mesh[133][0]-e.mesh[33][0],e.mesh[23][1]-e.mesh[27][1]]:[e.mesh[263][0]-e.mesh[362][0],e.mesh[253][1]-e.mesh[257][1]],l=[(A[0]-s[0])/a[0]-n[0],o*(s[1]-A[1])/a[1]-n[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);return c=Math.min(c,e.boxRaw[2]/2,e.boxRaw[3]/2),{bearing:(t([0,0],l)+Math.PI/2)%Math.PI,strength:c}},kn=(e,t)=>{let n=f=>{let u=Math.sqrt(f[0]*f[0]+f[1]*f[1]+f[2]*f[2]);return f[0]/=u,f[1]/=u,f[2]/=u,f},o=(f,u)=>{let g=f[0]-u[0],T=f[1]-u[1],p=f[2]-u[2];return[g,T,p]},r=(f,u)=>{let g=f[1]*u[2]-f[2]*u[1],T=f[2]*u[0]-f[0]*u[2],p=f[0]*u[1]-f[1]*u[0];return[g,T,p]},s=f=>{let[u,g,T,p,b,k,P,I,B]=f,_,Z,$;return p<1?p>-1?($=Math.asin(p),Z=Math.atan2(-P,u),_=Math.atan2(-k,b)):($=-Math.PI/2,Z=-Math.atan2(I,B),_=0):($=Math.PI/2,Z=Math.atan2(I,B),_=0),Number.isNaN(_)&&(_=0),Number.isNaN(Z)&&(Z=0),Number.isNaN($)&&($=0),{pitch:2*-_,yaw:2*-Z,roll:2*-$}},A=e.meshRaw;if(!A||A.length<300)return{angle:{pitch:0,yaw:0,roll:0},matrix:[1,0,0,0,1,0,0,0,1],gaze:{bearing:0,strength:0}};let a=Math.max(e.boxRaw[2]*t[0],e.boxRaw[3]*t[1])/1.5,l=[A[10],A[152],A[234],A[454]].map(f=>[f[0]*t[0]/a,f[1]*t[1]/a,f[2]]),c=n(o(l[1],l[0])),x=n(o(l[3],l[2])),i=n(r(x,c));x=r(c,i);let y=[x[0],x[1],x[2],c[0],c[1],c[2],i[0],i[1],i[2]],d=s(y),m=A.length===478?TA(e):{bearing:0,strength:0};return{angle:d,matrix:y,gaze:m}};function wn(e,t){let n=e==null?void 0:e.annotations;if(!(n!=null&&n.leftEyeIris)||!(n!=null&&n.rightEyeIris))return 0;let o=Math.max(Math.abs(n.leftEyeIris[3][0]-n.leftEyeIris[1][0]),Math.abs(n.rightEyeIris[3][0]-n.rightEyeIris[1][0]))/t;return Math.round(1.17/o)/100}var J5=async(e,t)=>{var m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;let n=v(),o,r,s,A,a,l,c,x,i,y=[];e.state="run:face";let d=await C3(t,e.config);if(e.performance.face=R.perfadd?(e.performance.face||0)+Math.trunc(v()-n):Math.trunc(v()-n),!t.shape||t.shape.length!==4)return[];if(!d)return[];for(let E=0;E200?kn(d[E],[t.shape[2],t.shape[1]]):null;e.analyze("Start Emotion:"),e.config.async?A=(f=e.config.face.emotion)!=null&&f.enabled?S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[]:(e.state="run:emotion",n=v(),A=(u=e.config.face.emotion)!=null&&u.enabled?await S5(d[E].tensor||l0.tensor([]),e.config,E,d.length):[],e.performance.emotion=R.perfadd?(e.performance.emotion||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Emotion:"),e.analyze("Start AntiSpoof:"),e.config.async?c=(g=e.config.face.antispoof)!=null&&g.enabled?O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:antispoof",n=v(),c=(T=e.config.face.antispoof)!=null&&T.enabled?await O5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.antispoof=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End AntiSpoof:"),e.analyze("Start Liveness:"),e.config.async?x=(p=e.config.face.liveness)!=null&&p.enabled?W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0:(e.state="run:liveness",n=v(),x=(b=e.config.face.liveness)!=null&&b.enabled?await W5(d[E].tensor||l0.tensor([]),e.config,E,d.length):0,e.performance.liveness=R.perfadd?(e.performance.antispoof||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Liveness:"),e.analyze("Start GEAR:"),e.config.async?r=(k=e.config.face.gear)!=null&&k.enabled?B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:gear",n=v(),r=(P=e.config.face.gear)!=null&&P.enabled?await B5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.gear=Math.trunc(v()-n)),e.analyze("End GEAR:"),e.analyze("Start SSRNet:"),e.config.async?(o=(I=e.config.face.ssrnet)!=null&&I.enabled?G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(B=e.config.face.ssrnet)!=null&&B.enabled?X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null):(e.state="run:ssrnet",n=v(),o=(_=e.config.face.ssrnet)!=null&&_.enabled?await G5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,s=(Z=e.config.face.ssrnet)!=null&&Z.enabled?await X5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.ssrnet=Math.trunc(v()-n)),e.analyze("End SSRNet:"),e.analyze("Start MobileFaceNet:"),e.config.async?a=($=e.config.face.mobilefacenet)!=null&&$.enabled?U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),a=(A0=e.config.face.mobilefacenet)!=null&&A0.enabled?await U5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End MobileFaceNet:"),e.analyze("Start InsightFace:"),e.config.async?l=(t0=e.config.face.insightface)!=null&&t0.enabled?K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null:(e.state="run:mobilefacenet",n=v(),l=(n0=e.config.face.insightface)!=null&&n0.enabled?await K5(d[E].tensor||l0.tensor([]),e.config,E,d.length):null,e.performance.mobilefacenet=Math.trunc(v()-n)),e.analyze("End InsightFace:"),e.analyze("Start Description:"),e.config.async?i=I5(d[E].tensor||l0.tensor([]),e.config,E,d.length):(e.state="run:description",n=v(),i=await I5(d[E].tensor||l0.tensor([]),e.config,E,d.length),e.performance.description=R.perfadd?(e.performance.description||0)+Math.trunc(v()-n):Math.trunc(v()-n)),e.analyze("End Description:"),e.config.async&&([o,s,A,a,l,i,r,c,x]=await Promise.all([o,s,A,a,l,i,r,c,x])),e.analyze("Finish Face:"),(j0=e.config.face.ssrnet)!=null&&j0.enabled&&o&&s&&(i={...i,age:o.age,gender:s.gender,genderScore:s.genderScore}),(M=e.config.face.gear)!=null&&M.enabled&&r&&(i={...i,age:r.age,gender:r.gender,genderScore:r.genderScore,race:r.race}),(T0=e.config.face.mobilefacenet)!=null&&T0.enabled&&a&&(i.descriptor=a),(C0=e.config.face.insightface)!=null&&C0.enabled&&l&&(i.descriptor=l);let X=(x0=e.config.face.iris)!=null&&x0.enabled?wn(d[E],t.shape[2]):0,U0=(K=e.config.face.detector)!=null&&K.return?l0.squeeze(d[E].tensor):null;l0.dispose(d[E].tensor),d[E].tensor&&delete d[E].tensor;let y0={...d[E],id:E};i.age&&(y0.age=i.age),i.gender&&(y0.gender=i.gender),i.genderScore&&(y0.genderScore=i.genderScore),i.descriptor&&(y0.embedding=i.descriptor),i.race&&(y0.race=i.race),A&&(y0.emotion=A),c&&(y0.real=c),x&&(y0.live=x),X>0&&(y0.distance=X),H&&(y0.rotation=H),U0&&(y0.tensor=U0),y.push(y0),e.analyze("End Face")}return e.analyze("End FaceMesh:"),e.config.async&&(e.performance.face&&delete e.performance.face,e.performance.age&&delete e.performance.age,e.performance.gender&&delete e.performance.gender,e.performance.emotion&&delete e.performance.emotion),y};var G0={thumb:0,index:1,middle:2,ring:3,pinky:4,all:[0,1,2,3,4],nameMapping:{0:"thumb",1:"index",2:"middle",3:"ring",4:"pinky"},pointsMapping:{0:[[0,1],[1,2],[2,3],[3,4]],1:[[0,5],[5,6],[6,7],[7,8]],2:[[0,9],[9,10],[10,11],[11,12]],3:[[0,13],[13,14],[14,15],[15,16]],4:[[0,17],[17,18],[18,19],[19,20]]},getName:e=>G0.nameMapping[e],getPoints:e=>G0.pointsMapping[e]},He={none:0,half:1,full:2,nameMapping:{0:"none",1:"half",2:"full"},getName:e=>He.nameMapping[e]},c0={verticalUp:0,verticalDown:1,horizontalLeft:2,horizontalRight:3,diagonalUpRight:4,diagonalUpLeft:5,diagonalDownRight:6,diagonalDownLeft:7,nameMapping:{0:"verticalUp",1:"verticalDown",2:"horizontalLeft",3:"horizontalRight",4:"diagonalUpRight",5:"diagonalUpLeft",6:"diagonalDownRight",7:"diagonalDownLeft"},getName:e=>c0.nameMapping[e]},Be=class{constructor(t){w(this,"name");w(this,"curls");w(this,"directions");w(this,"weights");w(this,"weightsRelative");this.name=t,this.curls={},this.directions={},this.weights=[1,1,1,1,1],this.weightsRelative=[1,1,1,1,1]}curl(t,n,o){typeof this.curls[t]=="undefined"&&(this.curls[t]=[]),this.curls[t].push([n,o])}direction(t,n,o){this.directions[t]||(this.directions[t]=[]),this.directions[t].push([n,o])}weight(t,n){this.weights[t]=n;let o=this.weights.reduce((r,s)=>r+s,0);this.weightsRelative=this.weights.map(r=>r*5/o)}matchAgainst(t,n){let o=0;for(let r in t){let s=t[r],A=this.curls[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}for(let r in n){let s=n[r],A=this.directions[r];if(typeof A=="undefined"){o+=this.weightsRelative[r];continue}for(let[a,l]of A)if(s===a){o+=l*this.weightsRelative[r];break}}return o/10}};var{thumb:fe,index:Pe,middle:ke,ring:A2,pinky:a2}=G0,{none:me,half:RA,full:pe}=He,{verticalUp:T2,verticalDown:Ki,horizontalLeft:Q5,horizontalRight:MA,diagonalUpRight:PA,diagonalUpLeft:v2,diagonalDownRight:Ji,diagonalDownLeft:Qi}=c0,Ge=new Be("thumbs up");Ge.curl(fe,me,1);Ge.direction(fe,T2,1);Ge.direction(fe,v2,.25);Ge.direction(fe,PA,.25);for(let e of[G0.index,G0.middle,G0.ring,G0.pinky])Ge.curl(e,pe,1),Ge.direction(e,Q5,1),Ge.direction(e,MA,1);var h0=new Be("victory");h0.curl(fe,RA,.5);h0.curl(fe,me,.5);h0.direction(fe,T2,1);h0.direction(fe,v2,1);h0.curl(Pe,me,1);h0.direction(Pe,T2,.75);h0.direction(Pe,v2,1);h0.curl(ke,me,1);h0.direction(ke,T2,1);h0.direction(ke,v2,.75);h0.curl(A2,pe,1);h0.direction(A2,T2,.2);h0.direction(A2,v2,1);h0.direction(A2,Q5,.2);h0.curl(a2,pe,1);h0.direction(a2,T2,.2);h0.direction(a2,v2,1);h0.direction(a2,Q5,.2);h0.weight(Pe,2);h0.weight(ke,2);var Ve=new Be("point");Ve.curl(fe,pe,1);Ve.curl(Pe,me,.5);Ve.curl(ke,pe,.5);Ve.curl(A2,pe,.5);Ve.curl(a2,pe,.5);Ve.weight(Pe,2);Ve.weight(ke,2);var Ze=new Be("middle finger");Ze.curl(fe,me,1);Ze.curl(Pe,pe,.5);Ze.curl(ke,pe,.5);Ze.curl(A2,pe,.5);Ze.curl(a2,pe,.5);Ze.weight(Pe,2);Ze.weight(ke,2);var R2=new Be("open palm");R2.curl(fe,me,.75);R2.curl(Pe,me,.75);R2.curl(ke,me,.75);R2.curl(A2,me,.75);R2.curl(a2,me,.75);var En=[Ge,h0,Ve,Ze,R2];var kA=.7,i2={HALF_CURL_START_LIMIT:60,NO_CURL_START_LIMIT:130,DISTANCE_VOTE_POWER:1.1,SINGLE_ANGLE_VOTE_POWER:.9,TOTAL_ANGLE_VOTE_POWER:1.6};function zn(e,t,n,o){let r=(t-o)/(e-n),s=Math.atan(r)*180/Math.PI;return s<=0?s=-s:s>0&&(s=180-s),s}function jn(e,t){if(!e||!t)return[0,0];let n=zn(e[0],e[1],t[0],t[1]);if(e.length===2)return n;let o=zn(e[1],e[2],t[1],t[2]);return[n,o]}function Sn(e,t=1){let n=0,o=0,r=0;return e>=75&&e<=105?n=1*t:e>=25&&e<=155?o=1*t:r=1*t,[n,o,r]}function wA(e,t,n){let o=e[0]-t[0],r=e[0]-n[0],s=t[0]-n[0],A=e[1]-t[1],a=e[1]-n[1],l=t[1]-n[1],c=e[2]-t[2],x=e[2]-n[2],i=t[2]-n[2],y=Math.sqrt(o*o+A*A+c*c),d=Math.sqrt(r*r+a*a+x*x),m=Math.sqrt(s*s+l*l+i*i),f=(m*m+y*y-d*d)/(2*m*y);f>1?f=1:f<-1&&(f=-1);let u=Math.acos(f);u=57.2958*u%180;let g;return u>i2.NO_CURL_START_LIMIT?g=He.none:u>i2.HALF_CURL_START_LIMIT?g=He.half:g=He.full,g}function In(e,t,n,o){let r;return o===Math.abs(e)?e>0?r=c0.horizontalLeft:r=c0.horizontalRight:o===Math.abs(t)?t>0?r=c0.horizontalLeft:r=c0.horizontalRight:n>0?r=c0.horizontalLeft:r=c0.horizontalRight,r}function Nn(e,t,n,o){let r;return o===Math.abs(e)?e<0?r=c0.verticalDown:r=c0.verticalUp:o===Math.abs(t)?t<0?r=c0.verticalDown:r=c0.verticalUp:n<0?r=c0.verticalDown:r=c0.verticalUp,r}function EA(e,t,n,o,r,s,A,a){let l,c=Nn(e,t,n,o),x=In(r,s,A,a);return c===c0.verticalUp?x===c0.horizontalLeft?l=c0.diagonalUpLeft:l=c0.diagonalUpRight:x===c0.horizontalLeft?l=c0.diagonalDownLeft:l=c0.diagonalDownRight,l}function zA(e,t,n,o){let r=e[0]-t[0],s=e[0]-n[0],A=t[0]-n[0],a=e[1]-t[1],l=e[1]-n[1],c=t[1]-n[1],x=Math.max(Math.abs(r),Math.abs(s),Math.abs(A)),i=Math.max(Math.abs(a),Math.abs(l),Math.abs(c)),y=0,d=0,m=0,f=i/(x+1e-5);f>1.5?y+=i2.DISTANCE_VOTE_POWER:f>.66?d+=i2.DISTANCE_VOTE_POWER:m+=i2.DISTANCE_VOTE_POWER;let u=Math.sqrt(r*r+a*a),g=Math.sqrt(s*s+l*l),T=Math.sqrt(A*A+c*c),p=Math.max(u,g,T),b=e[0],k=e[1],P=n[0],I=n[1];p===u?(P=n[0],I=n[1]):p===T&&(b=t[0],k=t[1]);let Z=jn([b,k],[P,I]),$=Sn(Z,i2.TOTAL_ANGLE_VOTE_POWER);y+=$[0],d+=$[1],m+=$[2];for(let t0 of o){let n0=Sn(t0,i2.SINGLE_ANGLE_VOTE_POWER);y+=n0[0],d+=n0[1],m+=n0[2]}let A0;return y===Math.max(y,d,m)?A0=Nn(l,a,c,i):m===Math.max(d,m)?A0=In(s,r,A,x):A0=EA(l,a,c,i,s,r,A,x),A0}function Ln(e){let t=[],n=[],o=[],r=[];if(!e)return{curls:o,directions:r};for(let s of G0.all){let A=G0.getPoints(s),a=[],l=[];for(let c of A){let x=e[c[0]],i=e[c[1]],y=jn(x,i),d=y[0],m=y[1];a.push(d),l.push(m)}t.push(a),n.push(l)}for(let s of G0.all){let A=s===G0.thumb?1:0,a=G0.getPoints(s),l=e[a[A][0]],c=e[a[A+1][1]],x=e[a[3][1]],i=wA(l,c,x),y=zA(l,c,x,t[s].slice(A));o[s]=i,r[s]=y}return{curls:o,directions:r}}function kt(e){if(!e||e.length===0)return null;let t=Ln(e),n={};for(let o of G0.all)n[G0.getName(o)]={curl:He.getName(t.curls[o]),direction:c0.getName(t.directions[o])};return n}function On(e){let t=[];if(!e||e.length===0)return t;let n=Ln(e);for(let o of En){let r=o.matchAgainst(n.curls,n.directions);r>=kA&&t.push({name:o.name,confidence:r})}return t}var Cn=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&&o&&r&&o.position[1]l.part==="leftShoulder"),a=e[n].keypoints.find(l=>l.part==="rightShoulder");A&&a&&Math.abs(A.positionRaw[1]-a.positionRaw[1])>.1&&t.push({body:n,gesture:`leaning ${A.position[1]>a.position[1]?"left":"right"}`})}return t},Wn=e=>{if(!e)return[];let t=[];for(let n=0;n450){let o=(e[n].mesh[33][2]||0)-(e[n].mesh[263][2]||0),r=e[n].mesh[33][0]-e[n].mesh[263][0];Math.abs(o/r)<=.15?t.push({face:n,gesture:"facing center"}):t.push({face:n,gesture:`facing ${o<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 a=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]));a>10&&t.push({face:n,gesture:`mouth ${Math.trunc(a)}% open`});let l=e[n].mesh[152][2]||0;Math.abs(l)>10&&t.push({face:n,gesture:`head ${l<0?"up":"down"}`})}return t},Dn=e=>{var n,o,r,s;if(!e)return[];let t=[];for(let A=0;A.06||u>.06)&&(d=!1),f>u?u>.04&&t.push({iris:A,gesture:"looking right"}):f>.04&&t.push({iris:A,gesture:"looking left"});let g=Math.abs(e[A].mesh[145][1]-e[A].annotations.rightEyeIris[0][1])/e[A].box[3],T=Math.abs(e[A].mesh[374][1]-e[A].annotations.leftEyeIris[0][1])/e[A].box[3];(T<.01||g<.01||T>.022||g>.022)&&(d=!1),(T<.01||g<.01)&&t.push({iris:A,gesture:"looking down"}),(T>.022||g>.022)&&t.push({iris:A,gesture:"looking up"}),d&&t.push({iris:A,gesture:"looking center"})}return t},Fn=e=>{if(!e)return[];let t=[];for(let n=0;n0){let r=o.reduce((A,a)=>(A.position[2]||0)<(a.position[2]||0)?A:a);t.push({hand:n,gesture:`${r.name} forward`});let s=o.reduce((A,a)=>A.position[1][s[0]*t[0],s[1]*t[1]]);return{startPoint:n,endPoint:o,palmLandmarks:r,confidence:e.confidence}}function Et(e,t=1.5){let n=C2(e),o=wt(e),r=[t*o[0]/2,t*o[1]/2],s=[n[0]-r[0],n[1]-r[1]],A=[n[0]+r[0],n[1]+r[1]];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function zt(e){let t=C2(e),n=wt(e),r=Math.max(...n)/2,s=[t[0]-r,t[1]-r],A=[t[0]+r,t[1]+r];return{startPoint:s,endPoint:A,palmLandmarks:e.palmLandmarks}}function jA(e){return e-2*Math.PI*Math.floor((e+Math.PI)/(2*Math.PI))}function Xn(e,t){let n=Math.PI/2-Math.atan2(-(t[1]-e[1]),t[0]-e[0]);return jA(n)}var Bn=(e,t)=>[[1,0,e],[0,1,t],[0,0,1]];function Xe(e,t){let n=0;for(let o=0;o[A.x,A.y]),this.anchorsTensor=W.tensor2d(this.anchors),this.inputSize=((s=(r=(o=(n=this==null?void 0:this.model)==null?void 0:n.inputs)==null?void 0:o[0])==null?void 0:r.shape)==null?void 0:s[2])||0,this.inputSizeTensor=W.tensor1d([this.inputSize,this.inputSize]),this.doubleInputSizeTensor=W.tensor1d([this.inputSize*2,this.inputSize*2])}normalizeBoxes(t){let n={};n.boxOffsets=W.slice(t,[0,0],[-1,2]),n.boxSizes=W.slice(t,[0,2],[-1,2]),n.div=W.div(n.boxOffsets,this.inputSizeTensor),n.boxCenterPoints=W.add(n.div,this.anchorsTensor),n.halfBoxSizes=W.div(n.boxSizes,this.doubleInputSizeTensor),n.sub=W.sub(n.boxCenterPoints,n.halfBoxSizes),n.startPoints=W.mul(n.sub,this.inputSizeTensor),n.add=W.add(n.boxCenterPoints,n.halfBoxSizes),n.endPoints=W.mul(n.add,this.inputSizeTensor);let o=W.concat2d([n.startPoints,n.endPoints],1);return Object.keys(n).forEach(r=>W.dispose(n[r])),o}normalizeLandmarks(t,n){let o={};o.reshape=W.reshape(t,[-1,7,2]),o.div=W.div(o.reshape,this.inputSizeTensor),o.landmarks=W.add(o.div,this.anchors[n]?this.anchors[n]:0);let r=W.mul(o.landmarks,this.inputSizeTensor);return Object.keys(o).forEach(s=>W.dispose(o[s])),r}async predict(t,n){var a;let o={};o.resize=W.image.resizeBilinear(t,[this.inputSize,this.inputSize]),o.div=W.div(o.resize,C.tf127),o.image=W.sub(o.div,C.tf1),o.batched=this.model.execute(o.image),o.predictions=W.squeeze(o.batched),o.slice=W.slice(o.predictions,[0,0],[-1,1]),o.sigmoid=W.sigmoid(o.slice),o.scores=W.squeeze(o.sigmoid);let r=await o.scores.data();o.boxes=W.slice(o.predictions,[0,1],[-1,4]),o.norm=this.normalizeBoxes(o.boxes),o.nms=await W.image.nonMaxSuppressionAsync(o.norm,o.scores,3*(((a=n.hand)==null?void 0:a.maxDetected)||1),n.hand.iouThreshold,n.hand.minConfidence);let s=await o.nms.array(),A=[];for(let l of s){let c={};c.box=W.slice(o.norm,[l,0],[1,-1]),c.slice=W.slice(o.predictions,[l,5],[1,14]),c.norm=this.normalizeLandmarks(c.slice,l),c.palmLandmarks=W.reshape(c.norm,[-1,2]);let x=await c.box.data(),i=x.slice(0,2),y=x.slice(2,4),d=await c.palmLandmarks.array(),m={startPoint:i,endPoint:y,palmLandmarks:d,confidence:r[l]},f=Zn(m,[(t.shape[2]||1)/this.inputSize,(t.shape[1]||0)/this.inputSize]);A.push(f),Object.keys(c).forEach(u=>W.dispose(c[u]))}return Object.keys(o).forEach(l=>W.dispose(o[l])),A}};var $0=V(G());var OA=5,Kn=1.65,Jn=[0,5,9,13,17,1,2],CA=0,WA=2,Qn=0,jt=class{constructor(t,n){w(this,"handDetector");w(this,"handPoseModel");w(this,"inputSize");w(this,"storedBoxes");w(this,"skipped");w(this,"detectedHands");var o,r,s;this.handDetector=t,this.handPoseModel=n,this.inputSize=((s=(r=(o=this.handPoseModel)==null?void 0:o.inputs)==null?void 0:r[0].shape)==null?void 0:s[2])||0,this.storedBoxes=[],this.skipped=Number.MAX_SAFE_INTEGER,this.detectedHands=0}calculateLandmarksBoundingBox(t){let n=t.map(A=>A[0]),o=t.map(A=>A[1]),r=[Math.min(...n),Math.min(...o)],s=[Math.max(...n),Math.max(...o)];return{startPoint:r,endPoint:s}}getBoxForPalmLandmarks(t,n){let o=t.map(s=>e1([...s,1],n)),r=this.calculateLandmarksBoundingBox(o);return Et(zt(r),OA)}getBoxForHandLandmarks(t){let n=this.calculateLandmarksBoundingBox(t),o=Et(zt(n),Kn);o.palmLandmarks=[];for(let r=0;r[A[0]*(d[0]-this.inputSize/2),A[1]*(d[1]-this.inputSize/2),A[2]*d[2]]),l=$5(o,[0,0]),c=a.map(d=>[...e1(d,l),d[2]]),x=qn(r),i=[...C2(n),1],y=[Xe(i,x[0]),Xe(i,x[1])];return c.map(d=>[Math.trunc(d[0]+y[0]),Math.trunc(d[1]+y[1]),Math.trunc(d[2])])}async estimateHands(t,n){let o=!1,r,s=(n.hand.skipTime||0)>v()-Qn,A=this.skipped<(n.hand.skipFrames||0);n.skipAllowed&&s&&A?this.skipped++:(r=await this.handDetector.predict(t,n),this.skipped=0),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&&(o=!0));let a=[];for(let l=0;l=n.hand.minConfidence/4){let k=$0.reshape(p,[-1,3]),P=await k.array();$0.dispose(p),$0.dispose(k);let I=this.transformRawCoords(P,f,x,m),B=this.getBoxForHandLandmarks(I);this.storedBoxes[l]={...B,confidence:b};let _={landmarks:I,confidence:b,boxConfidence:c.confidence,fingerConfidence:b,box:{topLeft:B.startPoint,bottomRight:B.endPoint}};a.push(_)}else this.storedBoxes[l]=null;$0.dispose(p)}else{let x=Et(zt(c),Kn),i={confidence:c.confidence,boxConfidence:c.confidence,fingerConfidence:0,box:{topLeft:x.startPoint,bottomRight:x.endPoint},landmarks:[]};a.push(i)}}return this.storedBoxes=this.storedBoxes.filter(l=>l!==null),this.detectedHands=a.length,a.length>n.hand.maxDetected&&(a.length=n.hand.maxDetected),a}};var _n={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],palm:[0]},l2,c2,t1;function FA(){let e=l2?new St(l2):void 0;e&&c2&&(t1=new jt(e,c2))}async function n1(e,t){t1||FA();let n=await t1.estimateHands(e,t);if(!n)return[];let o=[];for(let r=0;rn[r].landmarks[i]);let A=n[r].landmarks,a=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,0,0],l=[0,0,0,0];if(A&&A.length>0){for(let x of A)x[0]a[2]&&(a[2]=x[0]),x[1]>a[3]&&(a[3]=x[1]);a[2]-=a[0],a[3]-=a[1],l=[a[0]/(e.shape[2]||0),a[1]/(e.shape[1]||0),a[2]/(e.shape[2]||0),a[3]/(e.shape[1]||0)]}else a=n[r].box?[Math.trunc(Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.max(0,n[r].box.topLeft[1])),Math.trunc(Math.min(e.shape[2]||0,n[r].box.bottomRight[0])-Math.max(0,n[r].box.topLeft[0])),Math.trunc(Math.min(e.shape[1]||0,n[r].box.bottomRight[1])-Math.max(0,n[r].box.topLeft[1]))]:[0,0,0,0],l=[n[r].box.topLeft[0]/(e.shape[2]||0),n[r].box.topLeft[1]/(e.shape[1]||0),(n[r].box.bottomRight[0]-n[r].box.topLeft[0])/(e.shape[2]||0),(n[r].box.bottomRight[1]-n[r].box.topLeft[1])/(e.shape[1]||0)];let c=kt(A);o.push({id:r,score:Math.round(100*n[r].confidence)/100,boxScore:Math.round(100*n[r].boxConfidence)/100,fingerScore:Math.round(100*n[r].fingerConfidence)/100,label:"hand",box:a,boxRaw:l,keypoints:A,annotations:s,landmarks:c})}return o}async function $n(e){var t;return R.initial&&(l2=null),l2?e.debug&&h("cached model:",l2.modelUrl):l2=await L((t=e.hand.detector)==null?void 0:t.modelPath),l2}async function eo(e){var t;return R.initial&&(c2=null),c2?e.debug&&h("cached model:",c2.modelUrl):c2=await L((t=e.hand.skeleton)==null?void 0:t.modelPath),c2}var Q=V(G());var p0=[null,null],BA=["StatefulPartitionedCall/Postprocessor/Slice","StatefulPartitionedCall/Postprocessor/ExpandDims_1"],qe=[[0,0],[0,0]],HA=["hand","fist","pinch","point","face","tip","pinchtip"],no=4,oo=1.6,GA=512,VA=1.4,It=Number.MAX_SAFE_INTEGER,o1=0,we=[0,0],m0={boxes:[],hands:[]},ro={thumb:[1,2,3,4],index:[5,6,7,8],middle:[9,10,11,12],ring:[13,14,15,16],pinky:[17,18,19,20],base:[0],palm:[0,17,13,9,5,1,0]};async function so(e){var t;if(R.initial&&(p0[0]=null),p0[0])e.debug&&h("cached model:",p0[0].modelUrl);else{J2(["tensorlistreserve","enter","tensorlistfromtensor","merge","loopcond","switch","exit","tensorliststack","nextiteration","tensorlistsetitem","tensorlistgetitem","reciprocal","shape","split","where"],e),p0[0]=await L((t=e.hand.detector)==null?void 0:t.modelPath);let n=p0[0].executor?Object.values(p0[0].modelSignature.inputs):void 0;qe[0][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[0][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[0]}async function Ao(e){var t;if(R.initial&&(p0[1]=null),p0[1])e.debug&&h("cached model:",p0[1].modelUrl);else{p0[1]=await L((t=e.hand.skeleton)==null?void 0:t.modelPath);let n=p0[1].executor?Object.values(p0[1].modelSignature.inputs):void 0;qe[1][0]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[1].size):0,qe[1][1]=Array.isArray(n)?parseInt(n[0].tensorShape.dim[2].size):0}return p0[1]}async function ZA(e,t){let n=[];if(!e||!p0[0])return n;let o={},r=(e.shape[2]||1)/(e.shape[1]||1),s=Math.min(Math.round((e.shape[1]||0)/8)*8,GA),A=Math.round(s*r/8)*8;o.resize=Q.image.resizeBilinear(e,[s,A]),o.cast=Q.cast(o.resize,"int32"),[o.rawScores,o.rawBoxes]=await p0[0].executeAsync(o.cast,BA),o.boxes=Q.squeeze(o.rawBoxes,[0,2]),o.scores=Q.squeeze(o.rawScores,[0]);let a=Q.unstack(o.scores,1);Q.dispose(a[no]),a.splice(no,1),o.filtered=Q.stack(a,1),Q.dispose(a),o.max=Q.max(o.filtered,1),o.argmax=Q.argMax(o.filtered,1);let l=0;o.nms=await Q.image.nonMaxSuppressionAsync(o.boxes,o.max,(t.hand.maxDetected||0)+1,t.hand.iouThreshold||0,t.hand.minConfidence||1);let c=await o.nms.data(),x=await o.max.data(),i=await o.argmax.data();for(let y of Array.from(c)){let d=Q.slice(o.boxes,y,1),m=await d.data();Q.dispose(d);let f=[m[1],m[0],m[3]-m[1],m[2]-m[0]],u=st(f,VA),g=[Math.trunc(f[0]*we[0]),Math.trunc(f[1]*we[1]),Math.trunc(f[2]*we[0]),Math.trunc(f[3]*we[1])],T=x[y],p=HA[i[y]],b={id:l++,score:T,box:g,boxRaw:u,label:p};n.push(b)}return Object.keys(o).forEach(y=>Q.dispose(o[y])),n.sort((y,d)=>d.score-y.score),n.length>(t.hand.maxDetected||1)&&(n.length=t.hand.maxDetected||1),n}async function r1(e,t,n){let o={id:t.id,score:Math.round(100*t.score)/100,boxScore:Math.round(100*t.score)/100,fingerScore:0,box:t.box,boxRaw:t.boxRaw,label:t.label,keypoints:[],landmarks:{},annotations:{}};if(e&&p0[1]&&n.hand.landmarks&&t.score>(n.hand.minConfidence||0)){let r={},s=[t.boxRaw[1],t.boxRaw[0],t.boxRaw[3]+t.boxRaw[1],t.boxRaw[2]+t.boxRaw[0]];r.crop=Q.image.cropAndResize(e,[s],[0],[qe[1][0],qe[1][1]],"bilinear"),r.div=Q.div(r.crop,C.tf255),[r.score,r.keypoints]=p0[1].execute(r.div,["Identity_1","Identity"]);let A=(await r.score.data())[0],a=(100-Math.trunc(100/(1+Math.exp(A))))/100;if(a>=(n.hand.minConfidence||0)){o.fingerScore=a,r.reshaped=Q.reshape(r.keypoints,[-1,3]);let x=(await r.reshaped.array()).map(i=>[i[0]/qe[1][1],i[1]/qe[1][0],i[2]||0]).map(i=>[i[0]*t.boxRaw[2],i[1]*t.boxRaw[3],i[2]||0]);o.keypoints=x.map(i=>[we[0]*(i[0]+t.boxRaw[0]),we[1]*(i[1]+t.boxRaw[1]),i[2]||0]),o.landmarks=kt(o.keypoints);for(let i of Object.keys(ro))o.annotations[i]=ro[i].map(y=>o.landmarks&&o.keypoints[y]?o.keypoints[y]:null)}Object.keys(r).forEach(l=>Q.dispose(r[l]))}return o}async function s1(e,t){var r,s;if(!((r=p0[0])!=null&&r.executor)||!((s=p0[1])!=null&&s.executor)||!p0[0].inputs[0].shape||!p0[1].inputs[0].shape)return[];we=[e.shape[2]||0,e.shape[1]||0],It++;let n=(t.hand.skipTime||0)>v()-o1,o=It<(t.hand.skipFrames||0);return t.skipAllowed&&n&&o?m0.hands:new Promise(async A=>{let a=3*(t.hand.skipTime||0)>v()-o1,l=It<3*(t.hand.skipFrames||0);t.skipAllowed&&m0.hands.length===t.hand.maxDetected?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):t.skipAllowed&&a&&l&&m0.hands.length>0?m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))):(m0.boxes=await ZA(e,t),o1=v(),m0.hands=await Promise.all(m0.boxes.map(x=>r1(e,x,t))),It=0);let c=[...m0.boxes];if(m0.boxes.length=0,t.cacheSensitivity>0)for(let x=0;x.05&&i.box[3]/(e.shape[1]||1)>.05&&m0.hands[x].fingerScore&&m0.hands[x].fingerScore>(t.hand.minConfidence||0)){let y=st(i.box,oo),d=st(i.boxRaw,oo);m0.boxes.push({...c[x],box:y,boxRaw:d})}}for(let x=0;x({face:[],body:[],hand:[],gesture:[],object:[],persons:[],performance:{},timestamp:0,width:0,height:0,error:e});var W2={};ze(W2,{connected:()=>Lt,horizontal:()=>A1,kpt:()=>Nt,relative:()=>i1,vertical:()=>a1});var Nt=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],A1=[["leftEye","rightEye"],["leftEar","rightEar"],["leftShoulder","rightShoulder"],["leftElbow","rightElbow"],["leftWrist","rightWrist"],["leftHip","rightHip"],["leftKnee","rightKnee"],["leftAnkle","rightAnkle"]],a1=[["leftKnee","leftShoulder"],["rightKnee","rightShoulder"],["leftAnkle","leftKnee"],["rightAnkle","rightKnee"]],i1=[[["leftHip","rightHip"],["leftShoulder","rightShoulder"]],[["leftElbow","rightElbow"],["leftShoulder","rightShoulder"]]],Lt={leftLeg:["leftHip","leftKnee","leftAnkle"],rightLeg:["rightHip","rightKnee","rightAnkle"],torso:["leftShoulder","rightShoulder","rightHip","leftHip","leftShoulder"],leftArm:["leftShoulder","leftElbow","leftWrist"],rightArm:["rightShoulder","rightElbow","rightWrist"],head:[]};var z=Te(),l1=0;function io(e,t){var A,a,l,c,x,i,y,d,m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0;let n=v();if(!e)return Te();let o=Date.now()-e.timestamp,r=o<1e3?8-Math.log(o+1):1;if(e.canvas&&(z.canvas=e.canvas),e.error&&(z.error=e.error),!z.body||e.body.length!==z.body.length)z.body=JSON.parse(JSON.stringify(e.body));else for(let M=0;M((r-1)*z.body[M].box[X]+H)/r),C0=e.body[M].boxRaw.map((H,X)=>((r-1)*z.body[M].boxRaw[X]+H)/r),x0=e.body[M].keypoints.map((H,X)=>{var U0,y0,Ee,k2,x2,E1,z1,S1,j1;return{score:H.score,part:H.part,position:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[0]||0)+(H.position[0]||0))/r:H.position[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[1]||0)+(H.position[1]||0))/r:H.position[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].position[2]||0)+(H.position[2]||0))/r:H.position[2]],positionRaw:[z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[0]||0)+(H.positionRaw[0]||0))/r:H.positionRaw[0],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[1]||0)+(H.positionRaw[1]||0))/r:H.positionRaw[1],z.body[M].keypoints[X]?((r-1)*(z.body[M].keypoints[X].positionRaw[2]||0)+(H.positionRaw[2]||0))/r:H.positionRaw[2]],distance:[z.body[M].keypoints[X]?((r-1)*(((U0=z.body[M].keypoints[X].distance)==null?void 0:U0[0])||0)+(((y0=H.distance)==null?void 0:y0[0])||0))/r:(Ee=H.distance)==null?void 0:Ee[0],z.body[M].keypoints[X]?((r-1)*(((k2=z.body[M].keypoints[X].distance)==null?void 0:k2[1])||0)+(((x2=H.distance)==null?void 0:x2[1])||0))/r:(E1=H.distance)==null?void 0:E1[1],z.body[M].keypoints[X]?((r-1)*(((z1=z.body[M].keypoints[X].distance)==null?void 0:z1[2])||0)+(((S1=H.distance)==null?void 0:S1[2])||0))/r:(j1=H.distance)==null?void 0:j1[2]]}}),K={},E={connected:{}};(A=t.body.modelPath)!=null&&A.includes("efficientpose")?E=it:(a=t.body.modelPath)!=null&&a.includes("blazepose")?E=ot:(l=t.body.modelPath)!=null&&l.includes("movenet")&&(E=W2);for(let[H,X]of Object.entries(E.connected)){let U0=[];for(let y0=0;y0x2.part===X[y0]),k2=x0.find(x2=>x2.part===X[y0+1]);Ee&&k2&&U0.push([Ee.position,k2.position])}K[H]=U0}z.body[M]={...e.body[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.hand||e.hand.length!==z.hand.length)z.hand=JSON.parse(JSON.stringify(e.hand));else for(let M=0;M((r-1)*z.hand[M].box[H]+E)/r),C0=e.hand[M].boxRaw.map((E,H)=>((r-1)*z.hand[M].boxRaw[H]+E)/r);z.hand[M].keypoints.length!==e.hand[M].keypoints.length&&(z.hand[M].keypoints=e.hand[M].keypoints);let x0=e.hand[M].keypoints&&e.hand[M].keypoints.length>0?e.hand[M].keypoints.map((E,H)=>E.map((X,U0)=>((r-1)*(z.hand[M].keypoints[H][U0]||1)+(X||0))/r)):[],K={};if(Object.keys(z.hand[M].annotations).length!==Object.keys(e.hand[M].annotations).length)z.hand[M].annotations=e.hand[M].annotations,K=z.hand[M].annotations;else if(e.hand[M].annotations)for(let E of Object.keys(e.hand[M].annotations))K[E]=(i=(x=(c=e.hand[M])==null?void 0:c.annotations)==null?void 0:x[E])!=null&&i[0]?e.hand[M].annotations[E].map((H,X)=>H.map((U0,y0)=>((r-1)*z.hand[M].annotations[E][X][y0]+U0)/r)):null;z.hand[M]={...e.hand[M],box:T0,boxRaw:C0,keypoints:x0,annotations:K}}if(!z.face||e.face.length!==z.face.length)z.face=JSON.parse(JSON.stringify(e.face));else for(let M=0;M((r-1)*z.face[M].box[E]+K)/r),C0=e.face[M].boxRaw.map((K,E)=>((r-1)*z.face[M].boxRaw[E]+K)/r),x0=e.face[M].annotations;if(Object.keys(z.face[M].annotations).length!==Object.keys(e.face[M].annotations).length)z.face[M].annotations=e.face[M].annotations,x0=z.face[M].annotations;else if(e.face[M].annotations)for(let K of Object.keys(e.face[M].annotations))x0[K]=(m=(d=(y=e.face[M])==null?void 0:y.annotations)==null?void 0:d[K])!=null&&m[0]?e.face[M].annotations[K].map((E,H)=>E.map((X,U0)=>((r-1)*z.face[M].annotations[K][H][U0]+X)/r)):null;if(e.face[M].rotation){let K={matrix:[0,0,0,0,0,0,0,0,0],angle:{roll:0,yaw:0,pitch:0},gaze:{bearing:0,strength:0}};K.matrix=(f=e.face[M].rotation)==null?void 0:f.matrix,K.angle={roll:((r-1)*(((g=(u=z.face[M].rotation)==null?void 0:u.angle)==null?void 0:g.roll)||0)+(((p=(T=e.face[M].rotation)==null?void 0:T.angle)==null?void 0:p.roll)||0))/r,yaw:((r-1)*(((k=(b=z.face[M].rotation)==null?void 0:b.angle)==null?void 0:k.yaw)||0)+(((I=(P=e.face[M].rotation)==null?void 0:P.angle)==null?void 0:I.yaw)||0))/r,pitch:((r-1)*(((_=(B=z.face[M].rotation)==null?void 0:B.angle)==null?void 0:_.pitch)||0)+((($=(Z=e.face[M].rotation)==null?void 0:Z.angle)==null?void 0:$.pitch)||0))/r},K.gaze={bearing:((r-1)*(((A0=z.face[M].rotation)==null?void 0:A0.gaze.bearing)||0)+(((t0=e.face[M].rotation)==null?void 0:t0.gaze.bearing)||0))/r,strength:((r-1)*(((n0=z.face[M].rotation)==null?void 0:n0.gaze.strength)||0)+(((j0=e.face[M].rotation)==null?void 0:j0.gaze.strength)||0))/r},z.face[M]={...e.face[M],rotation:K,box:T0,boxRaw:C0,annotations:x0}}else z.face[M]={...e.face[M],box:T0,boxRaw:C0,annotations:x0}}if(!z.object||e.object.length!==z.object.length)z.object=JSON.parse(JSON.stringify(e.object));else for(let M=0;M((r-1)*z.object[M].box[K]+x0)/r),C0=e.object[M].boxRaw.map((x0,K)=>((r-1)*z.object[M].boxRaw[K]+x0)/r);z.object[M]={...e.object[M],box:T0,boxRaw:C0}}if(e.persons){let M=e.persons;if(!z.persons||M.length!==z.persons.length)z.persons=JSON.parse(JSON.stringify(M));else for(let T0=0;T0((r-1)*z.persons[T0].box[x0]+C0)/r)}e.gesture&&(z.gesture=e.gesture),z.width=e.width,z.height=e.height;let s=v();return l1=R.perfadd?l1+Math.round(s-n):Math.round(s-n),e.performance&&(z.performance={...e.performance,interpolate:l1}),z}var s0=V(G());var L0;async function c1(e){return!L0||R.initial?L0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",L0.modelUrl),L0}async function lo(e,t){var r;if(L0||(L0=await c1(t)),!(L0!=null&&L0.executor)||!((r=L0==null?void 0:L0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=s0.image.resizeBilinear(e,[L0.inputs[0].shape?L0.inputs[0].shape[1]:0,L0.inputs[0].shape?L0.inputs[0].shape[2]:0],!1),n.norm=s0.div(n.resize,C.tf255),n.res=L0.execute(n.norm),n.squeeze=s0.squeeze(n.res,[0]),[n.bgRaw,n.fgRaw]=s0.unstack(n.squeeze,2),n.fg=s0.softmax(n.fgRaw),n.mul=s0.mul(n.fg,C.tf255),n.expand=s0.expandDims(n.mul,2),n.output=s0.image.resizeBilinear(n.expand,[e.shape[1]||0,e.shape[2]||0]);let o;switch(t.segmentation.mode||"default"){case"default":n.input=s0.squeeze(e),n.concat=s0.concat([n.input,n.output],-1),o=s0.cast(n.concat,"int32");break;case"alpha":o=s0.cast(n.output,"int32");break;default:o=s0.tensor(0)}return Object.keys(n).forEach(s=>s0.dispose(n[s])),o}var Ot={};ze(Ot,{distance:()=>d1,find:()=>UA,similarity:()=>qA});function d1(e,t,n={order:2,multiplier:25}){if(!e||!e)return Number.MAX_SAFE_INTEGER;let o=0;for(let r=0;r{if(e===0)return 1;let s=(1-(t===2?Math.sqrt(e):e**(1/t))/100-n)/(o-n);return Math.max(Math.min(s,1),0)};function qA(e,t,n={order:2,multiplier:25,min:.2,max:.8}){let o=d1(e,t,n);return xo(o,n.order||2,n.min||0,n.max||1)}function UA(e,t,n={order:2,multiplier:25,threshold:0,min:.2,max:.8}){if(!Array.isArray(e)||!Array.isArray(t)||e.length<64||t.length===0)return{index:-1,distance:Number.POSITIVE_INFINITY,similarity:0};let o=Number.MAX_SAFE_INTEGER,r=-1;for(let A=0;AH2,validateModel:()=>Gt});var D2=V(G());var Ue=V(G());var yo=.005,ee={keypoints:[],padding:[[0,0],[0,0],[0,0],[0,0]]};function x1(e){for(let t of A1){let n=e.keypoints.findIndex(r=>r.part===t[0]),o=e.keypoints.findIndex(r=>r.part===t[1]);if(e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[0]r&&r.part===t[0]),o=e.keypoints.findIndex(r=>r&&r.part===t[1]);e.keypoints[n]&&e.keypoints[o]&&e.keypoints[n].position[1]c&&c.part===t[0]),r=e.keypoints.findIndex(c=>c&&c.part===t[1]),s=e.keypoints.findIndex(c=>c&&c.part===n[0]),A=e.keypoints.findIndex(c=>c&&c.part===n[1]);if(!e.keypoints[s]||!e.keypoints[A])continue;let a=e.keypoints[o]?[Math.abs(e.keypoints[s].position[0]-e.keypoints[o].position[0]),Math.abs(e.keypoints[A].position[0]-e.keypoints[o].position[0])]:[0,0],l=e.keypoints[r]?[Math.abs(e.keypoints[A].position[0]-e.keypoints[r].position[0]),Math.abs(e.keypoints[s].position[0]-e.keypoints[r].position[0])]:[0,0];if(a[0]>a[1]||l[0]>l[1]){let c=e.keypoints[o];e.keypoints[o]=e.keypoints[r],e.keypoints[r]=c}}}function fo(e){for(let t=0;te.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0,e.shape[2]>e.shape[1]?Math.trunc((e.shape[2]-e.shape[1])/2):0],[e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0,e.shape[1]>e.shape[2]?Math.trunc((e.shape[1]-e.shape[2])/2):0],[0,0]],n.pad=Ue.pad(e,ee.padding),n.resize=Ue.image.resizeBilinear(n.pad,[t,t]);let o=Ue.cast(n.resize,"int32");return Object.keys(n).forEach(A=>Ue.dispose(n[A])),o}function po(e,t){e.keypoints=e.keypoints.filter(o=>o==null?void 0:o.position);for(let o of e.keypoints)o.position=[o.position[0]*(t[0]+ee.padding[2][0]+ee.padding[2][1])/t[0]-ee.padding[2][0],o.position[1]*(t[1]+ee.padding[1][0]+ee.padding[1][1])/t[1]-ee.padding[1][0]],o.positionRaw=[o.position[0]/t[0],o.position[1]/t[1]];let n=Le(e.keypoints.map(o=>o.position),t);return e.box=n.box,e.boxRaw=n.boxRaw,e}var b0,Ct=0,y1=Number.MAX_SAFE_INTEGER,d2={boxes:[],bodies:[],last:0};async function uo(e){var t;return R.initial&&(b0=null),b0?e.debug&&h("cached model:",b0.modelUrl):(J2(["size"],e),b0=await L(e.body.modelPath)),Ct=b0!=null&&b0.executor&&((t=b0==null?void 0:b0.inputs)!=null&&t[0].shape)?b0.inputs[0].shape[2]:0,Ct<64&&(Ct=256),D2.env().flagRegistry.WEBGL_USE_SHAPES_UNIFORMS&&D2.env().set("WEBGL_USE_SHAPES_UNIFORMS",!1),b0}function KA(e,t,n){let o=e[0][0],r=[],s=0;for(let x=0;xt.body.minConfidence){let i=[o[x][1],o[x][0]];r.push({score:Math.round(100*s)/100,part:Nt[x],positionRaw:i,position:[Math.round((n.shape[2]||0)*i[0]),Math.round((n.shape[1]||0)*i[1])]})}s=r.reduce((x,i)=>i.score>x?i.score:x,0);let A=[],a=Le(r.map(x=>x.position),[n.shape[2],n.shape[1]]),l={};for(let[x,i]of Object.entries(Lt)){let y=[];for(let d=0;du.part===i[d]),f=r.find(u=>u.part===i[d+1]);m&&f&&m.score>(t.body.minConfidence||0)&&f.score>(t.body.minConfidence||0)&&y.push([m.position,f.position])}l[x]=y}let c={id:0,score:s,box:a.box,boxRaw:a.boxRaw,keypoints:r,annotations:l};return x1(c),A.push(c),A}function JA(e,t,n){let o=[];for(let r=0;rt.body.minConfidence){let a=[];for(let y=0;y<17;y++){let d=s[3*y+2];if(d>t.body.minConfidence){let m=[s[3*y+1],s[3*y+0]];a.push({part:Nt[y],score:Math.round(100*d)/100,positionRaw:m,position:[Math.round((n.shape[2]||0)*m[0]),Math.round((n.shape[1]||0)*m[1])]})}}let l=[s[52],s[51],s[54]-s[52],s[53]-s[51]],c=[Math.trunc(l[0]*(n.shape[2]||0)),Math.trunc(l[1]*(n.shape[1]||0)),Math.trunc(l[2]*(n.shape[2]||0)),Math.trunc(l[3]*(n.shape[1]||0))],x={};for(let[y,d]of Object.entries(Lt)){let m=[];for(let f=0;fT.part===d[f]),g=a.find(T=>T.part===d[f+1]);u&&g&&u.score>(t.body.minConfidence||0)&&g.score>(t.body.minConfidence||0)&&m.push([u.position,g.position])}x[y]=m}let i={id:r,score:A,box:c,boxRaw:l,keypoints:[...a],annotations:x};x1(i),o.push(i)}}return o.sort((r,s)=>s.score-r.score),o.length>t.body.maxDetected&&(o.length=t.body.maxDetected),o}async function f1(e,t){var r;if(!(b0!=null&&b0.executor)||!((r=b0==null?void 0:b0.inputs)!=null&&r[0].shape))return[];t.skipAllowed||(d2.boxes.length=0),y1++;let n=(t.body.skipTime||0)>v()-d2.last,o=y1<(t.body.skipFrames||0);return t.skipAllowed&&n&&o?d2.bodies:new Promise(async s=>{let A={};y1=0,A.input=mo(e,Ct),A.res=b0==null?void 0:b0.execute(A.input),d2.last=v();let a=await A.res.array();d2.bodies=A.res.shape[2]===17?KA(a,t,e):JA(a,t,e);for(let l of d2.bodies)po(l,[e.shape[2]||1,e.shape[1]||1]),fo(l.keypoints);Object.keys(A).forEach(l=>D2.dispose(A[l])),s(d2.bodies)})}var S0=V(G());var ce,Wt=[],bo=0,m1=Number.MAX_SAFE_INTEGER,Ft=0,Dt=2.5;async function go(e){if(!ce||R.initial){ce=await L(e.object.modelPath);let t=ce!=null&&ce.executor?Object.values(ce.modelSignature.inputs):void 0;Ft=Array.isArray(t)?parseInt(t[0].tensorShape.dim[2].size):416}else e.debug&&h("cached model:",ce.modelUrl);return ce}async function QA(e,t,n){var c,x;let o=0,r=[],s=Ft;for(let i of[1,2,4]){let y=i*13,d=S0.squeeze(e.find(p=>p.shape[1]===y**2&&(p.shape[2]||0)===m2.length)),m=await d.array(),f=S0.squeeze(e.find(p=>p.shape[1]===y**2&&(p.shape[2]||0)(n.object.minConfidence||0)&&b!==61){let P=(.5+Math.trunc(p%y))/y,I=(.5+Math.trunc(p/y))/y,B=T[p].map(M=>M*(y/i/s)),[_,Z]=[P-Dt/i*B[0],I-Dt/i*B[1]],[$,A0]=[P+Dt/i*B[2]-_,I+Dt/i*B[3]-Z],t0=[_,Z,$,A0];t0=t0.map(M=>Math.max(0,Math.min(M,1)));let n0=[t0[0]*t[0],t0[1]*t[1],t0[2]*t[0],t0[3]*t[1]],j0={id:o++,score:Math.round(100*k)/100,class:b+1,label:m2[b].label,box:n0.map(M=>Math.trunc(M)),boxRaw:t0};r.push(j0)}}S0.dispose([d,f,u,g])}let A=r.map(i=>[i.boxRaw[1],i.boxRaw[0],i.boxRaw[3],i.boxRaw[2]]),a=r.map(i=>i.score),l=[];if(A&&A.length>0){let i=await S0.image.nonMaxSuppressionAsync(A,a,n.object.maxDetected||0,n.object.iouThreshold,n.object.minConfidence);l=Array.from(await i.data()),S0.dispose(i)}return r=r.filter((i,y)=>l.includes(y)).sort((i,y)=>y.score-i.score),r}async function p1(e,t){if(!(ce!=null&&ce.executor))return[];let n=(t.object.skipTime||0)>v()-bo,o=m1<(t.object.skipFrames||0);return t.skipAllowed&&n&&o&&Wt.length>0?(m1++,Wt):(m1=0,!R.kernels.includes("mod")||!R.kernels.includes("sparsetodense")?Wt:new Promise(async r=>{let s=[e.shape[2]||0,e.shape[1]||0],A=S0.image.resizeBilinear(e,[Ft,Ft],!1),a=S0.div(A,C.tf255),l=S0.transpose(a,[0,3,1,2]),c;t.object.enabled&&(c=ce.execute(l)),bo=v();let x=await QA(c,s,t);Wt=x,S0.dispose([A,a,l,...c]),r(x)}))}var V0=V(G());var B2=["nose","leftEye","rightEye","leftEar","rightEar","leftShoulder","rightShoulder","leftElbow","rightElbow","leftWrist","rightWrist","leftHip","rightHip","leftKnee","rightKnee","leftAnkle","rightAnkle"],_A=B2.length,F2=B2.reduce((e,t,n)=>(e[t]=n,e),{}),$A=[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]],V7=$A.map(([e,t])=>[F2[e],F2[t]]),vo=[["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 Ro(e){let t=e.reduce(({maxX:n,maxY:o,minX:r,minY:s},{position:{x:A,y:a}})=>({maxX:Math.max(n,A),maxY:Math.max(o,a),minX:Math.min(r,A),minY:Math.min(s,a)}),{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 Mo(e,[t,n],[o,r]){let s=t/o,A=n/r,a=(c,x)=>({id:x,score:c.score,boxRaw:[c.box[0]/r,c.box[1]/o,c.box[2]/r,c.box[3]/o],box:[Math.trunc(c.box[0]*A),Math.trunc(c.box[1]*s),Math.trunc(c.box[2]*A),Math.trunc(c.box[3]*s)],keypoints:c.keypoints.map(({score:i,part:y,position:d})=>({score:i,part:y,position:[Math.trunc(d.x*A),Math.trunc(d.y*s)],positionRaw:[d.x/o,d.y/o]})),annotations:{}});return e.map((c,x)=>a(c,x))}var Bt=class{constructor(t,n){w(this,"priorityQueue");w(this,"numberOfElements");w(this,"getElementValue");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 Po(e,t,n,o){let r=n-e,s=o-t;return r*r+s*s}function g1(e,t){return{x:e.x+t.x,y:e.y+t.y}}var te,ta=["MobilenetV1/offset_2/BiasAdd","MobilenetV1/heatmap_2/BiasAdd","MobilenetV1/displacement_fwd_2/BiasAdd","MobilenetV1/displacement_bwd_2/BiasAdd"],Ht=1,M2=16,na=50**2;function ko(e,t,n,o,r,s,A=2){let a=g=>({y:s.get(g.y,g.x,e),x:s.get(g.y,g.x,s.shape[2]/2+e)}),l=(g,T,p)=>({y:b1(Math.round(g.y/M2),0,T-1),x:b1(Math.round(g.x/M2),0,p-1)}),[c,x]=o.shape,i=l(t.position,c,x),y=a(i),m=g1(t.position,y);for(let g=0;g[F2[y],F2[d]]),A=s.map(([,y])=>y),a=s.map(([y])=>y),l=t.shape[2],c=A.length,x=new Array(l),i=h1(e.part,M2,n);x[e.part.id]={score:e.score,part:B2[e.part.id],position:i};for(let y=c-1;y>=0;--y){let d=A[y],m=a[y];x[d]&&!x[m]&&(x[m]=ko(y,x[d],m,t,n,r))}for(let y=0;yt){a=!1;break}if(!a)break}return a}function sa(e,t){let[n,o,r]=t.shape,s=new Bt(n*o*r,({score:A})=>A);for(let A=0;A{var A;let s=(A=r[o])==null?void 0:A.position;return s?Po(n,t,s.y,s.x)<=na:!1})}function Aa(e,t){return t.reduce((o,{position:r,score:s},A)=>(wo(e,r,A)||(o+=s),o),0)/t.length}function aa(e,t,n,o,r,s){let A=[],a=sa(s,t);for(;A.lengthd.score>s);let i=Aa(A,x),y=Ro(x);i>s&&A.push({keypoints:x,box:y,score:Math.round(100*i)/100})}return A}async function T1(e,t){if(!(te!=null&&te.executor))return[];let n=V0.tidy(()=>{if(!te.inputs[0].shape)return[];let A=V0.image.resizeBilinear(e,[te.inputs[0].shape[2],te.inputs[0].shape[1]]),a=V0.sub(V0.div(V0.cast(A,"float32"),127.5),1),c=te.execute(a,ta).map(x=>V0.squeeze(x,[0]));return c[1]=V0.sigmoid(c[1]),c}),o=await Promise.all(n.map(A=>A.buffer()));for(let A of n)V0.dispose(A);let r=aa(o[0],o[1],o[2],o[3],t.body.maxDetected,t.body.minConfidence);return te.inputs[0].shape?Mo(r,[e.shape[1],e.shape[2]],[te.inputs[0].shape[2],te.inputs[0].shape[1]]):[]}async function Eo(e){return!te||R.initial?te=await L(e.body.modelPath):e.debug&&h("cached model:",te.modelUrl),te}var F=V(G());var ve,ia=["fgr","pha","r1o","r2o","r3o","r4o"],g0={},R1=0;function jo(e){F.dispose([g0.r1i,g0.r2i,g0.r3i,g0.r4i,g0.downsample_ratio]),g0.r1i=F.tensor(0),g0.r2i=F.tensor(0),g0.r3i=F.tensor(0),g0.r4i=F.tensor(0),R1=e.segmentation.ratio||.5,g0.downsample_ratio=F.tensor(R1)}async function M1(e){return!ve||R.initial?ve=await L(e.segmentation.modelPath):e.debug&&h("cached model:",ve.modelUrl),jo(e),ve}var So=e=>F.tidy(()=>{let t=F.squeeze(e,[0]),n=F.mul(t,C.tf255);return F.cast(n,"int32")});function v1(e,t){let n=e?So(e):F.fill([t.shape[1]||0,t.shape[2]||0,3],255,"int32"),o=t?So(t):F.fill([e.shape[1]||0,e.shape[2]||0,1],255,"int32"),r=F.concat([n,o],-1);return F.dispose([n,o]),r}function la(e){return F.tidy(()=>{let t={};return t.unstack=F.unstack(e,-1),t.concat=F.concat(t.unstack,1),t.split=F.split(t.concat,4,1),t.stack=F.concat(t.split,2),t.squeeze=F.squeeze(t.stack,[0]),t.expand=F.expandDims(t.squeeze,-1),t.add=F.add(t.expand,1),t.mul=F.mul(t.add,127.5),t.cast=F.cast(t.mul,"int32"),t.tile=F.tile(t.cast,[1,1,3]),t.alpha=F.fill([t.tile.shape[0]||0,t.tile.shape[1]||0,1],255,"int32"),F.concat([t.tile,t.alpha],-1)})}async function Io(e,t){if(ve||(ve=await M1(t)),!(ve!=null&&ve.executor))return null;g0.src=F.div(e,255),R1!==t.segmentation.ratio&&jo(t);let[n,o,r,s,A,a]=await ve.executeAsync(g0,ia),l;switch(t.segmentation.mode||"default"){case"default":l=v1(n,o);break;case"alpha":l=v1(null,o);break;case"foreground":l=v1(n,null);break;case"state":l=la(r);break;default:l=F.tensor(0)}return F.dispose([g0.src,n,o,g0.r1i,g0.r2i,g0.r3i,g0.r4i]),[g0.r1i,g0.r2i,g0.r3i,g0.r4i]=[r,s,A,a],l}var z0=V(G());var O0;async function P1(e){return!O0||R.initial?O0=await L(e.segmentation.modelPath):e.debug&&h("cached model:",O0.modelUrl),O0}async function Lo(e,t){var r;if(O0||(O0=await P1(t)),!(O0!=null&&O0.executor)||!((r=O0==null?void 0:O0.inputs)!=null&&r[0].shape))return null;let n={};n.resize=z0.image.resizeBilinear(e,[O0.inputs[0].shape?O0.inputs[0].shape[1]:0,O0.inputs[0].shape?O0.inputs[0].shape[2]:0],!1),n.norm=z0.div(n.resize,C.tf255),n.res=O0.execute(n.norm),n.squeeze=z0.squeeze(n.res,[0]),n.alpha=z0.image.resizeBilinear(n.squeeze,[e.shape[1]||0,e.shape[2]||0]),n.mul=z0.mul(n.alpha,C.tf255);let o;switch(t.segmentation.mode||"default"){case"default":n.input=z0.squeeze(e),n.concat=z0.concat([n.input,n.mul],-1),o=z0.cast(n.concat,"int32");break;case"alpha":o=z0.cast(n.mul,"int32");break;default:o=z0.tensor(0)}return Object.keys(n).forEach(s=>z0.dispose(n[s])),o}function Gt(e,t,n){var c,x;if(!t||!((c=e==null?void 0:e.config)!=null&&c.validateModels))return null;let o=["const","placeholder","noop","pad","squeeze","add","sub","mul","div"],r=["biasadd","fusedbatchnormv3","matmul","switch","shape","merge","split","broadcastto"],s=[],A=[],a=t.modelUrl,l=t.executor;if((x=l==null?void 0:l.graph)!=null&&x.nodes)for(let i of Object.values(l.graph.nodes)){let y=i.op.toLowerCase();s.includes(y)||s.push(y)}else!l&&e.config.debug&&h("model not loaded",n);for(let i of s)!o.includes(i)&&!r.includes(i)&&!e.env.kernels.includes(i)&&!e.env.kernels.includes(i.replace("_",""))&&!e.env.kernels.includes(i.replace("native",""))&&!e.env.kernels.includes(i.replace("v2",""))&&A.push(i);return e.config.debug&&A.length>0&&h("model validation failed:",n,A),A.length>0?{name:n,missing:A,ops:s,url:a}:null}var H2=class{constructor(t){w(this,"instance");w(this,"models",{});this.models={},this.instance=t}stats(){let t=0,n=0,o=0;for(let s of Object.values(I0))t+=s.sizeFromManifest,n+=s.sizeLoadedWeights,o+=s.sizeDesired;let r=o>0?n/o:0;return{numLoadedModels:Object.values(I0).length,numDefinedModels:Object.keys(this.models).length,percentageLoaded:r,totalSizeFromManifest:t,totalSizeWeights:n,totalSizeLoading:o,modelStats:Object.values(I0)}}reset(){for(let t of Object.keys(this.models))this.models[t]=null}async load(t){var o,r,s,A,a,l,c,x,i,y,d,m,f,u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0;R.initial&&this.reset(),t&&(this.instance=t);let n={};n.blazeface=this.instance.config.face.enabled&&!this.models.blazeface?k3(this.instance.config):null,n.antispoof=this.instance.config.face.enabled&&((o=this.instance.config.face.antispoof)!=null&&o.enabled)&&!this.models.antispoof?Q3(this.instance.config):null,n.liveness=this.instance.config.face.enabled&&((r=this.instance.config.face.liveness)!=null&&r.enabled)&&!this.models.liveness?tn(this.instance.config):null,n.faceres=this.instance.config.face.enabled&&((s=this.instance.config.face.description)!=null&&s.enabled)&&!this.models.faceres?q3(this.instance.config):null,n.emotion=this.instance.config.face.enabled&&((A=this.instance.config.face.emotion)!=null&&A.enabled)&&!this.models.emotion?G3(this.instance.config):null,n.iris=this.instance.config.face.enabled&&((a=this.instance.config.face.iris)!=null&&a.enabled)&&!((l=this.instance.config.face.attention)!=null&&l.enabled)&&!this.models.iris?I3(this.instance.config):null,n.facemesh=this.instance.config.face.enabled&&((c=this.instance.config.face.mesh)!=null&&c.enabled)&&!this.models.facemesh?W3(this.instance.config):null,n.gear=this.instance.config.face.enabled&&((x=this.instance.config.face.gear)!=null&&x.enabled)&&!this.models.gear?sn(this.instance.config):null,n.ssrnetage=this.instance.config.face.enabled&&((i=this.instance.config.face.ssrnet)!=null&&i.enabled)&&!this.models.ssrnetage?cn(this.instance.config):null,n.ssrnetgender=this.instance.config.face.enabled&&((y=this.instance.config.face.ssrnet)!=null&&y.enabled)&&!this.models.ssrnetgender?fn(this.instance.config):null,n.mobilefacenet=this.instance.config.face.enabled&&((d=this.instance.config.face.mobilefacenet)!=null&&d.enabled)&&!this.models.mobilefacenet?bn(this.instance.config):null,n.insightface=this.instance.config.face.enabled&&((m=this.instance.config.face.insightface)!=null&&m.enabled)&&!this.models.insightface?Mn(this.instance.config):null,n.blazepose=this.instance.config.body.enabled&&!this.models.blazepose&&((f=this.instance.config.body.modelPath)!=null&&f.includes("blazepose"))?a3(this.instance.config):null,n.blazeposedetect=this.instance.config.body.enabled&&!this.models.blazeposedetect&&this.instance.config.body.detector&&this.instance.config.body.detector.modelPath?A3(this.instance.config):null,n.efficientpose=this.instance.config.body.enabled&&!this.models.efficientpose&&((u=this.instance.config.body.modelPath)!=null&&u.includes("efficientpose"))?y3(this.instance.config):null,n.movenet=this.instance.config.body.enabled&&!this.models.movenet&&((g=this.instance.config.body.modelPath)!=null&&g.includes("movenet"))?uo(this.instance.config):null,n.posenet=this.instance.config.body.enabled&&!this.models.posenet&&((T=this.instance.config.body.modelPath)!=null&&T.includes("posenet"))?Eo(this.instance.config):null,n.handtrack=this.instance.config.hand.enabled&&!this.models.handtrack&&((b=(p=this.instance.config.hand.detector)==null?void 0:p.modelPath)!=null&&b.includes("handtrack"))?so(this.instance.config):null,n.handskeleton=this.instance.config.hand.enabled&&this.instance.config.hand.landmarks&&!this.models.handskeleton&&((P=(k=this.instance.config.hand.detector)==null?void 0:k.modelPath)!=null&&P.includes("handtrack"))?Ao(this.instance.config):null,this.instance.config.hand.enabled&&!this.models.handdetect&&((B=(I=this.instance.config.hand.detector)==null?void 0:I.modelPath)!=null&&B.includes("handdetect"))&&(n.handdetect=$n(this.instance.config),n.handskeleton=eo(this.instance.config)),n.centernet=this.instance.config.object.enabled&&!this.models.centernet&&((_=this.instance.config.object.modelPath)!=null&&_.includes("centernet"))?c3(this.instance.config):null,n.nanodet=this.instance.config.object.enabled&&!this.models.nanodet&&((Z=this.instance.config.object.modelPath)!=null&&Z.includes("nanodet"))?go(this.instance.config):null,n.selfie=this.instance.config.segmentation.enabled&&!this.models.selfie&&(($=this.instance.config.segmentation.modelPath)!=null&&$.includes("selfie"))?P1(this.instance.config):null,n.meet=this.instance.config.segmentation.enabled&&!this.models.meet&&((A0=this.instance.config.segmentation.modelPath)!=null&&A0.includes("meet"))?c1(this.instance.config):null,n.rvm=this.instance.config.segmentation.enabled&&!this.models.rvm&&((t0=this.instance.config.segmentation.modelPath)!=null&&t0.includes("rvm"))?M1(this.instance.config):null;for(let[n0,j0]of Object.entries(n))j0!=null&&j0.then&&j0.then(M=>this.models[n0]=M);await Promise.all(Object.values(n))}list(){let t=Object.keys(this.models).map(n=>{var o;return{name:n,loaded:this.models[n]!==null,size:0,url:this.models[n]?(o=this.models[n])==null?void 0:o.modelUrl:null}});for(let n of t){let o=Object.keys(I0).find(r=>r.startsWith(n.name));o&&(n.size=I0[o].sizeLoadedWeights,n.url=I0[o].url)}return t}loaded(){return this.list().filter(o=>o.loaded).map(o=>o.name)}validate(){let t=[];for(let n of Object.keys(this.models)){let o=this.models[n];if(!o)continue;let r=Gt(this.instance,o,n);r&&t.push(r)}return t}};function Co(e,t,n,o,r){var a,l,c,x,i,y;let s=0,A=[];for(let d of e){let m={id:s++,face:d,body:null,hands:{left:null,right:null},gestures:[],box:[0,0,0,0]};for(let b of t)d.box[0]>b.box[0]&&d.box[0]b.box[1]&&d.box[1]+d.box[3]m.body.box[0]&&b.box[0]+b.box[2]m.body.box[1]&&b.box[1]+b.box[3]m.body.box[0]&&b.box[1]+b.box[3]>m.body.box[1]&&b.box[1]+b.box[3]{b&&b.length===4&&(f.push(b[0],b[0]+b[2]),u.push(b[1],b[1]+b[3]))};g(m.face.box),g((x=m.body)==null?void 0:x.box),g((i=m.hands.left)==null?void 0:i.box),g((y=m.hands.right)==null?void 0:y.box);let T=Math.min(...f),p=Math.min(...u);m.box=[T,p,Math.max(...f)-T,Math.max(...u)-p],r!=null&&r[1]&&(r!=null&&r[2])&&(m.boxRaw=[m.box[0]/r[2],m.box[1]/r[1],m.box[2]/r[2],m.box[3]/r[1]]),A.push(m)}return A}var d0=V(G());var Vt=` /9j/4AAQSkZJRgABAQEAYABgAAD/4QBoRXhpZgAATU0AKgAAAAgABAEaAAUAAAABAAAAPgEbAAUA AAABAAAARgEoAAMAAAABAAIAAAExAAIAAAARAAAATgAAAAAAAABgAAAAAQAAAGAAAAABcGFpbnQu bmV0IDQuMi4xMwAA/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxob @@ -837,4 +837,4 @@ AAAAAAJAAAAAAAAAAAAAABAJEAAAAAAAAAAAAAAAIEoBKAAAAAAAAAAAAAAABAlAAAAAAAIAAAAA BAkBAkBAkBAlACEgMZjdjbFW8bWrEx8YWANb6Fp+bfwab+vLDKMFK9qxH5L0bAr8OPRPKz2AY7J2 SbAjYZAI2E7AIEgIEgIEgMdkSy2NgY7MdlmyNoBXsxmFuyNgVTVjNV3KjlBRNTlXTVHKCrlIqt5T lBhEMohlFerLlBjEMohMVTEARDKCITsAk2AEgAAAkAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAD/ -2Q==`;async function fa(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(A=>A.blob()),n,o;switch(e.config.warmup){case"face":n=await t(Vt);break;case"body":case"full":n=await t(Zt);break;default:n=null}if(n){let r=await createImageBitmap(n);o=await e.detect(r,e.config),r.close()}return o}async function ma(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+Vt;break;case"full":case"body":n="data:image/jpeg;base64,"+Zt;break;default:n=""}let o;if(typeof Image!="undefined")o=new Image;else if(R.Image)o=new R.Image;else{t(void 0);return}o.onload=async()=>{let r=Ae(o.naturalWidth,o.naturalHeight);if(!r)h("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(o,0,0);let A=await e.image(r,!0),a=A.tensor?await e.detect(A.tensor,e.config):void 0;t(a)}},n?o.src=n:t(void 0)})}async function pa(e){let t=r=>Buffer.from(r,"base64"),n;e.config.warmup==="face"?n=t(Vt):n=t(Zt);let o;if("node"in d0&&d0.getBackend()==="tensorflow"){let r=d0.node.decodeJpeg(n),s=d0.expandDims(r,0);e.tf.dispose(r),o=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&h("Warmup tfjs-node not loaded");return o}async function ua(e){let t;return typeof createImageBitmap=="function"?t=await fa(e):typeof Image!="undefined"||R.Canvas!==void 0?t=await ma(e):t=await pa(e),t}async function ha(e){var a,l,c,x;if(!d0.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=d0.getBackend(),n=d0.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;d0.env().set("ENGINE_COMPILE_ONLY",!0);let o=d0.engine().state.numTensors,r=[];for(let[i,f]of Object.entries(e.models.models)){if(!f)continue;let d=f!=null&&f.modelSignature&&((l=(a=f==null?void 0:f.inputs)==null?void 0:a[0])!=null&&l.shape)?[...f.inputs[0].shape]:[1,64,64,3],m=f!=null&&f.modelSignature&&((x=(c=f==null?void 0:f.inputs)==null?void 0:c[0])!=null&&x.dtype)?f.inputs[0].dtype:"float32";for(let u=0;ud0.dispose(T)):d0.dispose(u)}catch(u){e.config.debug&&h("compile fail model:",i)}d0.dispose(y)}let s=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&h("compile pass:",{models:r,kernels:s.length}),d0.env().set("ENGINE_COMPILE_ONLY",!1);let A=d0.engine().state.numTensors;A-o>0&&h("tensor leak:",A-o)}async function Wo(e,t){await I2(e,!1);let n=v();return e.state="warmup",t&&(e.config=a0(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?Te():new Promise(async o=>{await e.models.load(),await ha(e);let r=await ua(e),s=v();e.config.debug&&h("warmup",e.config.warmup,Math.round(s-n),"ms"),e.emit("warmup"),o(r)})}var P2,G2,V2,Xt,Ye,w1=class{constructor(t){w(this,"version");w(this,"config");w(this,"result");w(this,"state");w(this,"process");w(this,"tf");w(this,"env",R);w(this,"draw",nt);w(this,"match",Ot);w(this,"models");w(this,"events");w(this,"faceTriangulation");w(this,"faceUVMap");w(this,"performance");ue(this,P2,void 0);ue(this,G2,void 0);ue(this,V2,void 0);w(this,"analyze",(...t)=>{if(!Y0(this,G2))return;let n=this.tf.engine().state.numTensors,o=Y0(this,P2);Re(this,P2,n);let r=n-o;r!==0&&h(...t,r)});ue(this,Xt,t=>{if(!Y0(this,V2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof de.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});w(this,"webcam",new K2);w(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});ue(this,Ye,{});let n=(de.version.tfjs||de.version_core).replace(/-(.*)/,"");Ke.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ke.modelBasePath=R.browser?"../models/":"file://models/",this.version=t5,Object.defineProperty(this,"version",{value:t5}),this.config=JSON.parse(JSON.stringify(Ke)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=a0(this.config,t)),X1(this.config),this.tf=de,this.state="idle",Re(this,P2,0),Re(this,G2,!1),Re(this,V2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new H2(this),i5(),this.result=Te(),this.process={tensor:null,canvas:null},this.faceTriangulation=D3,this.faceUVMap=F3,Gt(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&h(`version: ${this.version}`),this.config.debug&&h(`tfjs version: ${this.tf.version["tfjs-core"]}`);let o=JSON.parse(JSON.stringify(this.env));delete o.kernels,delete o.initial,delete o.perfadd,this.config.debug&&h("environment:",o)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ke)),this.config.backend=t,$t(),R.initial=!0}validate(t){let n=Jt(Ke,t||this.config);return n.length===0&&(this.config=a0(this.config,t)),n}now(){return v()}image(t,n=!1){return U2(t,this.config,n)}async segmentation(t,n){var s,A,a;if(n&&(this.config=a0(this.config,n)),!this.config.segmentation.enabled)return null;let o=await U2(t,this.config);if(!o.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await Io(o.tensor,this.config)),(A=this.config.segmentation.modelPath)!=null&&A.includes("meet")&&(r=await lo(o.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("selfie")&&(r=await Lo(o.tensor,this.config)),de.dispose(o.tensor),r}compare(t,n){return Z1(this.config,t,n)}async init(){await I2(this,!0),await this.tf.ready(),$t()}async load(t){this.state="load";let n=v(),o=Object.values(this.models.models).filter(A=>A).length;t&&(this.config=a0(this.config,t)),this.env.initial&&(await I2(this,!1)||h("error: backend check failed"),await de.ready(),this.env.browser&&(this.config.debug&&h("configuration:",this.config),this.config.debug&&h("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&h("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(A=>A).length!==o&&(this.models.validate(),this.emit("load"));let s=Math.trunc(v()-n);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return io(t,this.config)}async warmup(t){let n=v(),o=await Wo(this,t),r=v();return this.performance.warmup=Math.trunc(r-n),o}async profile(t,n){let o=await this.tf.profile(()=>this.detect(t,n)),r={},s=0;for(let a of o.kernels){let l=Number(a.kernelTimeMs)||0;r[a.name]?r[a.name]+=l:r[a.name]=l,s+=l}let A=[];Object.entries(r).forEach(a=>A.push({kernel:a[0],time:a[1],perc:0}));for(let a of A)a.perc=Math.round(1e3*a.time/s)/1e3,a.time=Math.round(1e3*a.time)/1e3;return A.sort((a,l)=>l.time-a.time),A.length=20,A}async detect(t,n){return this.state="detect",new Promise(async o=>{var u,T,g,p,b,k,P,N,V,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;this.state="config";let r;this.config=a0(this.config,n),this.state="check";let s=Y0(this,Xt).call(this,t);s&&(h(s,t),this.emit("error"),o(Te(s)));let A=v();await this.load(),r=v(),this.state="image";let a=await U2(t,this.config);if(this.process=a,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Get Image:"),!a.tensor){this.config.debug&&h("could not convert input to tensor"),this.emit("error"),o(Te("could not convert input to tensor"));return}this.emit("image"),r=v(),this.config.skipAllowed=await V1(this.config,a.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Check Changed:");let l=[],c=[],x=[],i=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?J5(this,a.tensor):[],this.performance.face&&delete this.performance.face):(r=v(),l=this.config.face.enabled?await J5(this,a.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let f=this.config.body.maxDetected===-1?a0(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((u=this.config.body.modelPath)!=null&&u.includes("posenet")?c=this.config.body.enabled?T1(a.tensor,f):[]:(T=this.config.body.modelPath)!=null&&T.includes("blazepose")?c=this.config.body.enabled?y5(a.tensor,f):[]:(g=this.config.body.modelPath)!=null&&g.includes("efficientpose")?c=this.config.body.enabled?g5(a.tensor,f):[]:(p=this.config.body.modelPath)!=null&&p.includes("movenet")&&(c=this.config.body.enabled?f1(a.tensor,f):[]),this.performance.body&&delete this.performance.body):(r=v(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?c=this.config.body.enabled?await T1(a.tensor,f):[]:(k=this.config.body.modelPath)!=null&&k.includes("blazepose")?c=this.config.body.enabled?await y5(a.tensor,f):[]:(P=this.config.body.modelPath)!=null&&P.includes("efficientpose")?c=this.config.body.enabled?await g5(a.tensor,f):[]:(N=this.config.body.modelPath)!=null&&N.includes("movenet")&&(c=this.config.body.enabled?await f1(a.tensor,f):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let d=this.config.hand.maxDetected===-1?a0(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((_=(V=this.config.hand.detector)==null?void 0:V.modelPath)!=null&&_.includes("handdetect")?x=this.config.hand.enabled?n1(a.tensor,d):[]:($=(Z=this.config.hand.detector)==null?void 0:Z.modelPath)!=null&&$.includes("handtrack")&&(x=this.config.hand.enabled?s1(a.tensor,d):[]),this.performance.hand&&delete this.performance.hand):(r=v(),(t0=(A0=this.config.hand.detector)==null?void 0:A0.modelPath)!=null&&t0.includes("handdetect")?x=this.config.hand.enabled?await n1(a.tensor,d):[]:(j0=(n0=this.config.hand.detector)==null?void 0:n0.modelPath)!=null&&j0.includes("handtrack")&&(x=this.config.hand.enabled?await s1(a.tensor,d):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((M=this.config.object.modelPath)!=null&&M.includes("nanodet")?i=this.config.object.enabled?p1(a.tensor,this.config):[]:(T0=this.config.object.modelPath)!=null&&T0.includes("centernet")&&(i=this.config.object.enabled?p5(a.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=v(),(C0=this.config.object.modelPath)!=null&&C0.includes("nanodet")?i=this.config.object.enabled?await p1(a.tensor,this.config):[]:(x0=this.config.object.modelPath)!=null&&x0.includes("centernet")&&(i=this.config.object.enabled?await p5(a.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,c,x,i]=await Promise.all([l,c,x,i])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=v(),m=[...Wn(l),...Cn(c),...Fn(x),...Dn(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(v()-A):Math.trunc(v()-A);let y=((K=this.process.tensor)==null?void 0:K.shape)||[0,0,0,0];this.result={face:l,body:c,hand:x,gesture:m,object:i,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:y[2],height:y[1],get persons(){return Co(l,c,x,m,y)}},de.dispose(a.tensor),this.emit("detect"),this.state="idle",o(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,o=0){n?(Y0(this,Ye)[t.id]||(this.config.debug&&h("video start",t.id),Y0(this,Ye)[t.id]=!0),!t.paused&&Y0(this,Ye)[t.id]&&t.readyState>=2&&await this.detect(t),o>0&&await this.sleep(o),Y0(this,Ye)[t.id]&&requestAnimationFrame(()=>this.video(t,n,o))):(this.config.debug&&h("video stop",t.id),Y0(this,Ye)[t.id]=!1)}};P2=new WeakMap,G2=new WeakMap,V2=new WeakMap,Xt=new WeakMap,Ye=new WeakMap;0&&(module.exports={Env,Human,defaults,draw,empty,env,match,models}); +2Q==`;async function xa(e){let t=(r,s="application/octet-stream")=>fetch(`data:${s};base64,${r}`).then(A=>A.blob()),n,o;switch(e.config.warmup){case"face":n=await t(Vt);break;case"body":case"full":n=await t(Zt);break;default:n=null}if(n){let r=await createImageBitmap(n);o=await e.detect(r,e.config),r.close()}return o}async function ya(e){return new Promise(t=>{let n;switch(e.config.warmup){case"face":n="data:image/jpeg;base64,"+Vt;break;case"full":case"body":n="data:image/jpeg;base64,"+Zt;break;default:n=""}let o;if(typeof Image!="undefined")o=new Image;else if(R.Image)o=new R.Image;else{t(void 0);return}o.onload=async()=>{let r=Ae(o.naturalWidth,o.naturalHeight);if(!r)h("Warmup: Canvas not found"),t(void 0);else{let s=r.getContext("2d");s&&s.drawImage(o,0,0);let A=await e.image(r,!0),a=A.tensor?await e.detect(A.tensor,e.config):void 0;t(a)}},n?o.src=n:t(void 0)})}async function fa(e){let t=r=>Buffer.from(r,"base64"),n;e.config.warmup==="face"?n=t(Vt):n=t(Zt);let o;if("node"in d0&&d0.getBackend()==="tensorflow"){let r=d0.node.decodeJpeg(n),s=d0.expandDims(r,0);e.tf.dispose(r),o=await e.detect(s,e.config),e.tf.dispose(s)}else e.config.debug&&h("Warmup tfjs-node not loaded");return o}async function ma(e){let t;return typeof createImageBitmap=="function"?t=await xa(e):typeof Image!="undefined"||R.Canvas!==void 0?t=await ya(e):t=await fa(e),t}async function pa(e){var a,l,c,x;if(!d0.env().flagRegistry.ENGINE_COMPILE_ONLY)return;let t=d0.getBackend(),n=d0.backend();if(t!=="webgl"&&t!=="humangl"||!(n!=null&&n.checkCompileCompletion))return;d0.env().set("ENGINE_COMPILE_ONLY",!0);let o=d0.engine().state.numTensors,r=[];for(let[i,y]of Object.entries(e.models.models)){if(!y)continue;let d=y!=null&&y.modelSignature&&((l=(a=y==null?void 0:y.inputs)==null?void 0:a[0])!=null&&l.shape)?[...y.inputs[0].shape]:[1,64,64,3],m=y!=null&&y.modelSignature&&((x=(c=y==null?void 0:y.inputs)==null?void 0:c[0])!=null&&x.dtype)?y.inputs[0].dtype:"float32";for(let u=0;ud0.dispose(g)):d0.dispose(u)}catch(u){e.config.debug&&h("compile fail model:",i)}d0.dispose(f)}let s=await n.checkCompileCompletionAsync();n.getUniformLocations(),e.config.debug&&h("compile pass:",{models:r,kernels:s.length}),d0.env().set("ENGINE_COMPILE_ONLY",!1);let A=d0.engine().state.numTensors;A-o>0&&h("tensor leak:",A-o)}async function Wo(e,t){await I2(e,!1);let n=v();return e.state="warmup",t&&(e.config=a0(e.config,t)),!e.config.warmup||e.config.warmup.length===0||e.config.warmup==="none"?Te():new Promise(async o=>{await e.models.load(),await pa(e);let r=await ma(e),s=v();e.config.debug&&h("warmup",e.config.warmup,Math.round(s-n),"ms"),e.emit("warmup"),o(r)})}var P2,G2,V2,Xt,Ye,w1=class{constructor(t){w(this,"version");w(this,"config");w(this,"result");w(this,"state");w(this,"process");w(this,"tf");w(this,"env",R);w(this,"draw",nt);w(this,"match",Ot);w(this,"models");w(this,"events");w(this,"faceTriangulation");w(this,"faceUVMap");w(this,"performance");ue(this,P2,void 0);ue(this,G2,void 0);ue(this,V2,void 0);w(this,"analyze",(...t)=>{if(!Y0(this,G2))return;let n=this.tf.engine().state.numTensors,o=Y0(this,P2);Re(this,P2,n);let r=n-o;r!==0&&h(...t,r)});ue(this,Xt,t=>{if(!Y0(this,V2))return null;if(!t)return"input is not defined";if(this.env.node&&!(t instanceof de.Tensor))return"input must be a tensor";try{this.tf.getBackend()}catch(n){return"backend not loaded"}return null});w(this,"webcam",new K2);w(this,"emit",t=>{var n;(n=this.events)!=null&&n.dispatchEvent&&this.events.dispatchEvent(new Event(t))});ue(this,Ye,{});let n=(de.version.tfjs||de.version_core).replace(/-(.*)/,"");Ke.wasmPath=`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${n}/dist/`,Ke.modelBasePath=R.browser?"../models/":"file://models/",this.version=t5,Object.defineProperty(this,"version",{value:t5}),this.config=JSON.parse(JSON.stringify(Ke)),Object.seal(this.config),this.config.cacheModels=typeof indexedDB!="undefined",t&&(this.config=a0(this.config,t)),X1(this.config),this.tf=de,this.state="idle",Re(this,P2,0),Re(this,G2,!1),Re(this,V2,!1),this.performance={},this.events=typeof EventTarget!="undefined"?new EventTarget:void 0,this.models=new H2(this),i5(),this.result=Te(),this.process={tensor:null,canvas:null},this.faceTriangulation=D3,this.faceUVMap=F3,Gt(this,null,""),this.emit("create"),(this.config.debug||this.env.browser)&&h(`version: ${this.version}`),this.config.debug&&h(`tfjs version: ${this.tf.version["tfjs-core"]}`);let o=JSON.parse(JSON.stringify(this.env));delete o.kernels,delete o.initial,delete o.perfadd,this.config.debug&&h("environment:",o)}reset(){let t=this.config.backend;this.config=JSON.parse(JSON.stringify(Ke)),this.config.backend=t,$t(),R.initial=!0}validate(t){let n=Jt(Ke,t||this.config);return n.length===0&&(this.config=a0(this.config,t)),n}now(){return v()}image(t,n=!1){return U2(t,this.config,n)}async segmentation(t,n){var s,A,a;if(n&&(this.config=a0(this.config,n)),!this.config.segmentation.enabled)return null;let o=await U2(t,this.config);if(!o.tensor)return null;let r=null;return(s=this.config.segmentation.modelPath)!=null&&s.includes("rvm")&&(r=await Io(o.tensor,this.config)),(A=this.config.segmentation.modelPath)!=null&&A.includes("meet")&&(r=await lo(o.tensor,this.config)),(a=this.config.segmentation.modelPath)!=null&&a.includes("selfie")&&(r=await Lo(o.tensor,this.config)),de.dispose(o.tensor),r}compare(t,n){return Z1(this.config,t,n)}async init(){await I2(this,!0),await this.tf.ready(),$t()}async load(t){this.state="load";let n=v(),o=Object.values(this.models.models).filter(A=>A).length;t&&(this.config=a0(this.config,t)),this.env.initial&&(await I2(this,!1)||h("error: backend check failed"),await de.ready(),this.env.browser&&(this.config.debug&&h("configuration:",this.config),this.config.debug&&h("tf flags:",this.tf.ENV.flags))),await this.models.load(this),this.env.initial&&this.config.debug&&h("tf engine state:",this.tf.engine().state.numBytes,"bytes",this.tf.engine().state.numTensors,"tensors"),this.env.initial=!1,Object.values(this.models.models).filter(A=>A).length!==o&&(this.models.validate(),this.emit("load"));let s=Math.trunc(v()-n);s>(this.performance.loadModels||0)&&(this.performance.loadModels=this.env.perfadd?(this.performance.loadModels||0)+s:s)}next(t=this.result){return io(t,this.config)}async warmup(t){let n=v(),o=await Wo(this,t),r=v();return this.performance.warmup=Math.trunc(r-n),o}async profile(t,n){let o=await this.tf.profile(()=>this.detect(t,n)),r={},s=0;for(let a of o.kernels){let l=Number(a.kernelTimeMs)||0;r[a.name]?r[a.name]+=l:r[a.name]=l,s+=l}let A=[];Object.entries(r).forEach(a=>A.push({kernel:a[0],time:a[1],perc:0}));for(let a of A)a.perc=Math.round(1e3*a.time/s)/1e3,a.time=Math.round(1e3*a.time)/1e3;return A.sort((a,l)=>l.time-a.time),A.length=20,A}async detect(t,n){return this.state="detect",new Promise(async o=>{var u,g,T,p,b,k,P,I,B,_,Z,$,A0,t0,n0,j0,M,T0,C0,x0,K;this.state="config";let r;this.config=a0(this.config,n),this.state="check";let s=Y0(this,Xt).call(this,t);s&&(h(s,t),this.emit("error"),o(Te(s)));let A=v();await this.load(),r=v(),this.state="image";let a=await U2(t,this.config);if(this.process=a,this.performance.inputProcess=this.env.perfadd?(this.performance.inputProcess||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Get Image:"),!a.tensor){this.config.debug&&h("could not convert input to tensor"),this.emit("error"),o(Te("could not convert input to tensor"));return}this.emit("image"),r=v(),this.config.skipAllowed=await V1(this.config,a.tensor),this.config.filter.autoBrightness=(this.config.filter.autoBrightness||!1)&&this.config.skipAllowed,this.performance.totalFrames||(this.performance.totalFrames=0),this.performance.cachedFrames||(this.performance.cachedFrames=0),this.performance.totalFrames++,this.config.skipAllowed&&this.performance.cachedFrames++,this.performance.cacheCheck=this.env.perfadd?(this.performance.cacheCheck||0)+Math.trunc(v()-r):Math.trunc(v()-r),this.analyze("Check Changed:");let l=[],c=[],x=[],i=[];this.state="detect:face",this.config.async?(l=this.config.face.enabled?J5(this,a.tensor):[],this.performance.face&&delete this.performance.face):(r=v(),l=this.config.face.enabled?await J5(this,a.tensor):[],this.performance.face=this.env.perfadd?(this.performance.face||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.config.async&&(this.config.body.maxDetected===-1||this.config.hand.maxDetected===-1)&&(l=await l),this.analyze("Start Body:"),this.state="detect:body";let y=this.config.body.maxDetected===-1?a0(this.config,{body:{maxDetected:this.config.face.enabled?1*l.length:1}}):this.config;this.config.async?((u=this.config.body.modelPath)!=null&&u.includes("posenet")?c=this.config.body.enabled?T1(a.tensor,y):[]:(g=this.config.body.modelPath)!=null&&g.includes("blazepose")?c=this.config.body.enabled?y5(a.tensor,y):[]:(T=this.config.body.modelPath)!=null&&T.includes("efficientpose")?c=this.config.body.enabled?g5(a.tensor,y):[]:(p=this.config.body.modelPath)!=null&&p.includes("movenet")&&(c=this.config.body.enabled?f1(a.tensor,y):[]),this.performance.body&&delete this.performance.body):(r=v(),(b=this.config.body.modelPath)!=null&&b.includes("posenet")?c=this.config.body.enabled?await T1(a.tensor,y):[]:(k=this.config.body.modelPath)!=null&&k.includes("blazepose")?c=this.config.body.enabled?await y5(a.tensor,y):[]:(P=this.config.body.modelPath)!=null&&P.includes("efficientpose")?c=this.config.body.enabled?await g5(a.tensor,y):[]:(I=this.config.body.modelPath)!=null&&I.includes("movenet")&&(c=this.config.body.enabled?await f1(a.tensor,y):[]),this.performance.body=this.env.perfadd?(this.performance.body||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Body:"),this.analyze("Start Hand:"),this.state="detect:hand";let d=this.config.hand.maxDetected===-1?a0(this.config,{hand:{maxDetected:this.config.face.enabled?2*l.length:1}}):this.config;this.config.async?((_=(B=this.config.hand.detector)==null?void 0:B.modelPath)!=null&&_.includes("handdetect")?x=this.config.hand.enabled?n1(a.tensor,d):[]:($=(Z=this.config.hand.detector)==null?void 0:Z.modelPath)!=null&&$.includes("handtrack")&&(x=this.config.hand.enabled?s1(a.tensor,d):[]),this.performance.hand&&delete this.performance.hand):(r=v(),(t0=(A0=this.config.hand.detector)==null?void 0:A0.modelPath)!=null&&t0.includes("handdetect")?x=this.config.hand.enabled?await n1(a.tensor,d):[]:(j0=(n0=this.config.hand.detector)==null?void 0:n0.modelPath)!=null&&j0.includes("handtrack")&&(x=this.config.hand.enabled?await s1(a.tensor,d):[]),this.performance.hand=this.env.perfadd?(this.performance.hand||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Hand:"),this.analyze("Start Object:"),this.state="detect:object",this.config.async?((M=this.config.object.modelPath)!=null&&M.includes("nanodet")?i=this.config.object.enabled?p1(a.tensor,this.config):[]:(T0=this.config.object.modelPath)!=null&&T0.includes("centernet")&&(i=this.config.object.enabled?p5(a.tensor,this.config):[]),this.performance.object&&delete this.performance.object):(r=v(),(C0=this.config.object.modelPath)!=null&&C0.includes("nanodet")?i=this.config.object.enabled?await p1(a.tensor,this.config):[]:(x0=this.config.object.modelPath)!=null&&x0.includes("centernet")&&(i=this.config.object.enabled?await p5(a.tensor,this.config):[]),this.performance.object=this.env.perfadd?(this.performance.object||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.analyze("End Object:"),this.state="detect:await",this.config.async&&([l,c,x,i]=await Promise.all([l,c,x,i])),this.state="detect:gesture";let m=[];this.config.gesture.enabled&&(r=v(),m=[...Wn(l),...Cn(c),...Fn(x),...Dn(l)],this.config.async?this.performance.gesture&&delete this.performance.gesture:this.performance.gesture=this.env.perfadd?(this.performance.gesture||0)+Math.trunc(v()-r):Math.trunc(v()-r)),this.performance.total=this.env.perfadd?(this.performance.total||0)+Math.trunc(v()-A):Math.trunc(v()-A);let f=((K=this.process.tensor)==null?void 0:K.shape)||[0,0,0,0];this.result={face:l,body:c,hand:x,gesture:m,object:i,performance:this.performance,canvas:this.process.canvas,timestamp:Date.now(),error:null,width:f[2],height:f[1],get persons(){return Co(l,c,x,m,f)}},de.dispose(a.tensor),this.emit("detect"),this.state="idle",o(this.result)})}async sleep(t){return new Promise(n=>{setTimeout(n,t)})}async video(t,n=!0,o=0){n?(Y0(this,Ye)[t.id]||(this.config.debug&&h("video start",t.id),Y0(this,Ye)[t.id]=!0),!t.paused&&Y0(this,Ye)[t.id]&&t.readyState>=2&&await this.detect(t),o>0&&await this.sleep(o),Y0(this,Ye)[t.id]&&requestAnimationFrame(()=>this.video(t,n,o))):(this.config.debug&&h("video stop",t.id),Y0(this,Ye)[t.id]=!1)}};P2=new WeakMap,G2=new WeakMap,V2=new WeakMap,Xt=new WeakMap,Ye=new WeakMap;0&&(module.exports={Env,Human,defaults,draw,empty,env,match,models}); diff --git a/dist/tfjs.esm.js b/dist/tfjs.esm.js index 6c6c2051..422d8701 100644 --- a/dist/tfjs.esm.js +++ b/dist/tfjs.esm.js @@ -4,57 +4,57 @@ author: ' */ -var SG=Object.create;var YC=Object.defineProperty;var IG=Object.getOwnPropertyDescriptor;var vG=Object.getOwnPropertyNames;var kG=Object.getPrototypeOf,NG=Object.prototype.hasOwnProperty;var Kt=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),qe=(r,t)=>{for(var e in t)YC(r,e,{get:t[e],enumerable:!0})},TG=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of vG(t))!NG.call(r,n)&&n!==e&&YC(r,n,{get:()=>t[n],enumerable:!(o=IG(t,n))||o.enumerable});return r};var Lp=(r,t,e)=>(e=r!=null?SG(kG(r)):{},TG(t||!r||!r.__esModule?YC(e,"default",{value:r,enumerable:!0}):e,r));var W0=Kt((tle,V0)=>{V0.exports=kt;var ko=null;try{ko=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(r){}function kt(r,t,e){this.low=r|0,this.high=t|0,this.unsigned=!!e}kt.prototype.__isLong__;Object.defineProperty(kt.prototype,"__isLong__",{value:!0});function Vr(r){return(r&&r.__isLong__)===!0}kt.isLong=Vr;var D0={},A0={};function Du(r,t){var e,o,n;return t?(r>>>=0,(n=0<=r&&r<256)&&(o=A0[r],o)?o:(e=Nt(r,(r|0)<0?-1:0,!0),n&&(A0[r]=e),e)):(r|=0,(n=-128<=r&&r<128)&&(o=D0[r],o)?o:(e=Nt(r,r<0?-1:0,!1),n&&(D0[r]=e),e))}kt.fromInt=Du;function No(r,t){if(isNaN(r))return t?Ru:To;if(t){if(r<0)return Ru;if(r>=M0)return z0}else{if(r<=-P0)return zr;if(r+1>=P0)return B0}return r<0?No(-r,t).neg():Nt(r%Xp|0,r/Xp|0,t)}kt.fromNumber=No;function Nt(r,t,e){return new kt(r,t,e)}kt.fromBits=Nt;var Ym=Math.pow;function pw(r,t,e){if(r.length===0)throw Error("empty string");if(r==="NaN"||r==="Infinity"||r==="+Infinity"||r==="-Infinity")return To;if(typeof t=="number"?(e=t,t=!1):t=!!t,e=e||10,e<2||360)throw Error("interior hyphen");if(o===0)return pw(r.substring(1),t,e).neg();for(var n=No(Ym(e,8)),s=To,a=0;a>>0:this.low};de.toNumber=function(){return this.unsigned?(this.high>>>0)*Xp+(this.low>>>0):this.high*Xp+(this.low>>>0)};de.toString=function(t){if(t=t||10,t<2||36>>0,c=u.toString(t);if(a=p,a.isZero())return c+i;for(;c.length<6;)c="0"+c;i=""+c+i}};de.getHighBits=function(){return this.high};de.getHighBitsUnsigned=function(){return this.high>>>0};de.getLowBits=function(){return this.low};de.getLowBitsUnsigned=function(){return this.low>>>0};de.getNumBitsAbs=function(){if(this.isNegative())return this.eq(zr)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,e=31;e>0&&!(t&1<=0};de.isOdd=function(){return(this.low&1)===1};de.isEven=function(){return(this.low&1)===0};de.equals=function(t){return Vr(t)||(t=As(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};de.eq=de.equals;de.notEquals=function(t){return!this.eq(t)};de.neq=de.notEquals;de.ne=de.notEquals;de.lessThan=function(t){return this.comp(t)<0};de.lt=de.lessThan;de.lessThanOrEqual=function(t){return this.comp(t)<=0};de.lte=de.lessThanOrEqual;de.le=de.lessThanOrEqual;de.greaterThan=function(t){return this.comp(t)>0};de.gt=de.greaterThan;de.greaterThanOrEqual=function(t){return this.comp(t)>=0};de.gte=de.greaterThanOrEqual;de.ge=de.greaterThanOrEqual;de.compare=function(t){if(Vr(t)||(t=As(t)),this.eq(t))return 0;var e=this.isNegative(),o=t.isNegative();return e&&!o?-1:!e&&o?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};de.comp=de.compare;de.negate=function(){return!this.unsigned&&this.eq(zr)?zr:this.not().add(jp)};de.neg=de.negate;de.add=function(t){Vr(t)||(t=As(t));var e=this.high>>>16,o=this.high&65535,n=this.low>>>16,s=this.low&65535,a=t.high>>>16,i=t.high&65535,p=t.low>>>16,u=t.low&65535,c=0,l=0,m=0,d=0;return d+=s+u,m+=d>>>16,d&=65535,m+=n+p,l+=m>>>16,m&=65535,l+=o+i,c+=l>>>16,l&=65535,c+=e+a,c&=65535,Nt(m<<16|d,c<<16|l,this.unsigned)};de.subtract=function(t){return Vr(t)||(t=As(t)),this.add(t.neg())};de.sub=de.subtract;de.multiply=function(t){if(this.isZero())return To;if(Vr(t)||(t=As(t)),ko){var e=ko.mul(this.low,this.high,t.low,t.high);return Nt(e,ko.get_high(),this.unsigned)}if(t.isZero())return To;if(this.eq(zr))return t.isOdd()?zr:To;if(t.eq(zr))return this.isOdd()?zr:To;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(O0)&&t.lt(O0))return No(this.toNumber()*t.toNumber(),this.unsigned);var o=this.high>>>16,n=this.high&65535,s=this.low>>>16,a=this.low&65535,i=t.high>>>16,p=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,m=0,d=0,f=0;return f+=a*c,d+=f>>>16,f&=65535,d+=s*c,m+=d>>>16,d&=65535,d+=a*u,m+=d>>>16,d&=65535,m+=n*c,l+=m>>>16,m&=65535,m+=s*u,l+=m>>>16,m&=65535,m+=a*p,l+=m>>>16,m&=65535,l+=o*c+n*u+s*p+a*i,l&=65535,Nt(d<<16|f,l<<16|m,this.unsigned)};de.mul=de.multiply;de.divide=function(t){if(Vr(t)||(t=As(t)),t.isZero())throw Error("division by zero");if(ko){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var e=(this.unsigned?ko.div_u:ko.div_s)(this.low,this.high,t.low,t.high);return Nt(e,ko.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Ru:To;var o,n,s;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Ru;if(t.gt(this.shru(1)))return L0;s=Ru}else{if(this.eq(zr)){if(t.eq(jp)||t.eq(uw))return zr;if(t.eq(zr))return jp;var a=this.shr(1);return o=a.div(t).shl(1),o.eq(To)?t.isNegative()?jp:uw:(n=this.sub(t.mul(o)),s=o.add(n.div(t)),s)}else if(t.eq(zr))return this.unsigned?Ru:To;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();s=To}for(n=this;n.gte(t);){o=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var i=Math.ceil(Math.log(o)/Math.LN2),p=i<=48?1:Ym(2,i-48),u=No(o),c=u.mul(t);c.isNegative()||c.gt(n);)o-=p,u=No(o,this.unsigned),c=u.mul(t);u.isZero()&&(u=jp),s=s.add(u),n=n.sub(c)}return s};de.div=de.divide;de.modulo=function(t){if(Vr(t)||(t=As(t)),ko){var e=(this.unsigned?ko.rem_u:ko.rem_s)(this.low,this.high,t.low,t.high);return Nt(e,ko.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};de.mod=de.modulo;de.rem=de.modulo;de.not=function(){return Nt(~this.low,~this.high,this.unsigned)};de.and=function(t){return Vr(t)||(t=As(t)),Nt(this.low&t.low,this.high&t.high,this.unsigned)};de.or=function(t){return Vr(t)||(t=As(t)),Nt(this.low|t.low,this.high|t.high,this.unsigned)};de.xor=function(t){return Vr(t)||(t=As(t)),Nt(this.low^t.low,this.high^t.high,this.unsigned)};de.shiftLeft=function(t){return Vr(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Nt(this.low<>>32-t,this.unsigned):Nt(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):Nt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};de.shr=de.shiftRight;de.shiftRightUnsigned=function(t){if(Vr(t)&&(t=t.toInt()),t&=63,t===0)return this;var e=this.high;if(t<32){var o=this.low;return Nt(o>>>t|e<<32-t,e>>>t,this.unsigned)}else return t===32?Nt(e,0,this.unsigned):Nt(e>>>t-32,0,this.unsigned)};de.shru=de.shiftRightUnsigned;de.shr_u=de.shiftRightUnsigned;de.toSigned=function(){return this.unsigned?Nt(this.low,this.high,!1):this};de.toUnsigned=function(){return this.unsigned?this:Nt(this.low,this.high,!0)};de.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};de.toBytesLE=function(){var t=this.high,e=this.low;return[e&255,e>>>8&255,e>>>16&255,e>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};de.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,e>>>24,e>>>16&255,e>>>8&255,e&255]};kt.fromBytes=function(t,e,o){return o?kt.fromBytesLE(t,e):kt.fromBytesBE(t,e)};kt.fromBytesLE=function(t,e){return new kt(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)};kt.fromBytesBE=function(t,e){return new kt(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}});var vk=Kt(()=>{});var kk=Kt(()=>{});var Z2=Kt((Q2,Vw)=>{(function(r,t,e){function o(i){var p=this,u=a();p.next=function(){var c=2091639*p.s0+p.c*23283064365386963e-26;return p.s0=p.s1,p.s1=p.s2,p.s2=c-(p.c=c|0)},p.c=1,p.s0=u(" "),p.s1=u(" "),p.s2=u(" "),p.s0-=u(i),p.s0<0&&(p.s0+=1),p.s1-=u(i),p.s1<0&&(p.s1+=1),p.s2-=u(i),p.s2<0&&(p.s2+=1),u=null}function n(i,p){return p.c=i.c,p.s0=i.s0,p.s1=i.s1,p.s2=i.s2,p}function s(i,p){var u=new o(i),c=p&&p.state,l=u.next;return l.int32=function(){return u.next()*4294967296|0},l.double=function(){return l()+(l()*2097152|0)*11102230246251565e-32},l.quick=l,c&&(typeof c=="object"&&n(c,u),l.state=function(){return n(u,{})}),l}function a(){var i=4022871197,p=function(u){u=String(u);for(var c=0;c>>0,l-=i,l*=i,i=l>>>0,l-=i,i+=l*4294967296}return(i>>>0)*23283064365386963e-26};return p}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.alea=s})(Q2,typeof Vw=="object"&&Vw,typeof define=="function"&&define)});var e1=Kt((J2,Ww)=>{(function(r,t,e){function o(a){var i=this,p="";i.x=0,i.y=0,i.z=0,i.w=0,i.next=function(){var c=i.x^i.x<<11;return i.x=i.y,i.y=i.z,i.z=i.w,i.w^=i.w>>>19^c^c>>>8},a===(a|0)?i.x=a:p+=a;for(var u=0;u>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(typeof u=="object"&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xor128=s})(J2,typeof Ww=="object"&&Ww,typeof define=="function"&&define)});var r1=Kt((t1,Uw)=>{(function(r,t,e){function o(a){var i=this,p="";i.next=function(){var c=i.x^i.x>>>2;return i.x=i.y,i.y=i.z,i.z=i.w,i.w=i.v,(i.d=i.d+362437|0)+(i.v=i.v^i.v<<4^(c^c<<1))|0},i.x=0,i.y=0,i.z=0,i.w=0,i.v=0,a===(a|0)?i.x=a:p+=a;for(var u=0;u>>4),i.next()}function n(a,i){return i.x=a.x,i.y=a.y,i.z=a.z,i.w=a.w,i.v=a.v,i.d=a.d,i}function s(a,i){var p=new o(a),u=i&&i.state,c=function(){return(p.next()>>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(typeof u=="object"&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xorwow=s})(t1,typeof Uw=="object"&&Uw,typeof define=="function"&&define)});var n1=Kt((o1,Gw)=>{(function(r,t,e){function o(a){var i=this;i.next=function(){var u=i.x,c=i.i,l,m,d;return l=u[c],l^=l>>>7,m=l^l<<24,l=u[c+1&7],m^=l^l>>>10,l=u[c+3&7],m^=l^l>>>3,l=u[c+4&7],m^=l^l<<7,l=u[c+7&7],l=l^l<<13,m^=l^l<<9,u[c]=m,i.i=c+1&7,m};function p(u,c){var l,m,d=[];if(c===(c|0))m=d[0]=c;else for(c=""+c,l=0;l0;--l)u.next()}p(i,a)}function n(a,i){return i.x=a.x.slice(),i.i=a.i,i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,c=function(){return(p.next()>>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(u.x&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xorshift7=s})(o1,typeof Gw=="object"&&Gw,typeof define=="function"&&define)});var a1=Kt((s1,Hw)=>{(function(r,t,e){function o(a){var i=this;i.next=function(){var u=i.w,c=i.X,l=i.i,m,d;return i.w=u=u+1640531527|0,d=c[l+34&127],m=c[l=l+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=c[l]=d^m,i.i=l,d+(u^u>>>16)|0};function p(u,c){var l,m,d,f,h,g=[],x=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,x=Math.max(x,c.length)),d=0,f=-32;f>>15,m^=m<<4,m^=m>>>13,f>=0&&(h=h+1640531527|0,l=g[f&127]^=m+h,d=l==0?d+1:0);for(d>=128&&(g[(c&&c.length||0)&127]=-1),d=127,f=4*128;f>0;--f)m=g[d+34&127],l=g[d=d+1&127],m^=m<<13,l^=l<<17,m^=m>>>15,l^=l>>>12,g[d]=m^l;u.w=h,u.X=g,u.i=d}p(i,a)}function n(a,i){return i.i=a.i,i.w=a.w,i.X=a.X.slice(),i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,c=function(){return(p.next()>>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(u.X&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.xor4096=s})(s1,typeof Hw=="object"&&Hw,typeof define=="function"&&define)});var u1=Kt((i1,Kw)=>{(function(r,t,e){function o(a){var i=this,p="";i.next=function(){var c=i.b,l=i.c,m=i.d,d=i.a;return c=c<<25^c>>>7^l,l=l-m|0,m=m<<24^m>>>8^d,d=d-c|0,i.b=c=c<<20^c>>>12^l,i.c=l=l-m|0,i.d=m<<16^l>>>16^d,i.a=d-c|0},i.a=0,i.b=0,i.c=-1640531527,i.d=1367130551,a===Math.floor(a)?(i.a=a/4294967296|0,i.b=a|0):p+=a;for(var u=0;u>>0)/4294967296};return c.double=function(){do var l=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(l+m)/(1<<21);while(d===0);return d},c.int32=p.next,c.quick=c,u&&(typeof u=="object"&&n(u,p),c.state=function(){return n(p,{})}),c}t&&t.exports?t.exports=s:e&&e.amd?e(function(){return s}):this.tychei=s})(i1,typeof Kw=="object"&&Kw,typeof define=="function"&&define)});var p1=Kt(()=>{});var l1=Kt((c1,Od)=>{(function(r,t,e){var o=256,n=6,s=52,a="random",i=e.pow(o,n),p=e.pow(2,s),u=p*2,c=o-1,l;function m(C,S,k){var _=[];S=S==!0?{entropy:!0}:S||{};var E=g(h(S.entropy?[C,b(t)]:C==null?x():C,3),_),R=new d(_),D=function(){for(var P=R.g(n),O=i,M=0;P=u;)P/=2,O/=2,M>>>=1;return(P+M)/O};return D.int32=function(){return R.g(4)|0},D.quick=function(){return R.g(4)/4294967296},D.double=D,g(b(R.S),t),(S.pass||k||function(P,O,M,L){return L&&(L.S&&f(L,R),P.state=function(){return f(R,{})}),M?(e[a]=P,O):P})(D,E,"global"in S?S.global:this==e,S.state)}function d(C){var S,k=C.length,_=this,E=0,R=_.i=_.j=0,D=_.S=[];for(k||(C=[k++]);E{var vq=Z2(),kq=e1(),Nq=r1(),Tq=n1(),_q=a1(),$q=u1(),Gu=l1();Gu.alea=vq;Gu.xor128=kq;Gu.xorwow=Nq;Gu.xorshift7=Tq;Gu.xor4096=_q;Gu.tychei=$q;m1.exports=Gu});var zv=Kt(()=>{});var Vv=Kt(()=>{});var DB=Kt(()=>{});var AB=Kt(()=>{});var FB=Kt(()=>{});var PB=Kt((Vg,Uv)=>{var Wv=(()=>{var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(t){t=t||{};function e(){return oe.buffer!=Ge&&Tt(oe.buffer),lt}function o(){return oe.buffer!=Ge&&Tt(oe.buffer),it}function n(){return oe.buffer!=Ge&&Tt(oe.buffer),ht}function s(){return oe.buffer!=Ge&&Tt(oe.buffer),Mr}function a(){return oe.buffer!=Ge&&Tt(oe.buffer),Mt}function i(){return oe.buffer!=Ge&&Tt(oe.buffer),eo}function p(){return oe.buffer!=Ge&&Tt(oe.buffer),rr}var u=typeof t!="undefined"?t:{},c,l;u.ready=new Promise(function(F,V){c=F,l=V});var m;typeof process!="undefined"&&process.listeners&&(m={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var d=Object.assign({},u),f=[],h="./this.program",g=(F,V)=>{throw V},x=typeof window=="object",b=typeof importScripts=="function",C=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",S=u.ENVIRONMENT_IS_PTHREAD||!1,k="";function _(F){return u.locateFile?u.locateFile(F,k):k+F}var E,R,D,P;function O(F){if(F instanceof Iu)return;j("exiting due to exception: "+F)}if(C){var M=zv(),L=Vv();b?k=L.dirname(k)+"/":k=__dirname+"/",E=(V,ue)=>(V=Dp(V)?new URL(V):L.normalize(V),M.readFileSync(V,ue?void 0:"utf8")),D=V=>{var ue=E(V,!0);return ue.buffer||(ue=new Uint8Array(ue)),ue},R=(V,ue,Ee)=>{V=Dp(V)?new URL(V):L.normalize(V),M.readFile(V,function(Be,Le){Be?Ee(Be):ue(Le.buffer)})},process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",function(V){if(!(V instanceof Iu))throw V}),process.on("unhandledRejection",function(V){throw V}),g=(V,ue)=>{if(Lo())throw process.exitCode=V,ue;O(ue),process.exit(V)},u.inspect=function(){return"[Emscripten Module object]"};let F;try{F=DB()}catch(V){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),V}global.Worker=F.Worker}else(x||b)&&(b?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.replace(/[?#].*/,"").lastIndexOf("/")+1):k="",C||(E=F=>{var V=new XMLHttpRequest;return V.open("GET",F,!1),V.send(null),V.responseText},b&&(D=F=>{var V=new XMLHttpRequest;return V.open("GET",F,!1),V.responseType="arraybuffer",V.send(null),new Uint8Array(V.response)}),R=(F,V,ue)=>{var Ee=new XMLHttpRequest;Ee.open("GET",F,!0),Ee.responseType="arraybuffer",Ee.onload=()=>{if(Ee.status==200||Ee.status==0&&Ee.response){V(Ee.response);return}ue()},Ee.onerror=ue,Ee.send(null)}),P=F=>document.title=F);C&&typeof performance=="undefined"&&(global.performance=AB().performance);var B=console.log.bind(console),z=console.warn.bind(console);C&&(B=F=>M.writeSync(1,F+` -`),z=F=>M.writeSync(2,F+` -`));var U=u.print||B,j=u.printErr||z;Object.assign(u,d),d=null,u.arguments&&(f=u.arguments),u.thisProgram&&(h=u.thisProgram),u.quit&&(g=u.quit);var q=4,Y=Atomics.load,J=Atomics.store,re=Atomics.compareExchange,ne;u.wasmBinary&&(ne=u.wasmBinary);var ee=u.noExitRuntime||!0;typeof WebAssembly!="object"&&Su("no native wasm support detected");var oe,ie,le=!1,be;function _e(F,V){F||Su(V)}var ve=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function Fe(F,V,ue){V>>>=0;for(var Ee=V+ue,Be=V;F[Be]&&!(Be>=Ee);)++Be;if(Be-V>16&&F.buffer&&ve)return ve.decode(F.buffer instanceof SharedArrayBuffer?F.slice(V,Be):F.subarray(V,Be));for(var Le="";V>10,56320|no&1023)}}return Le}function Pe(F,V){return F>>>=0,F?Fe(o(),F,V):""}function st(F,V,ue,Ee){if(ue>>>=0,!(Ee>0))return 0;for(var Be=ue,Le=ue+Ee-1,ge=0;ge=55296&&Ne<=57343){var Ft=F.charCodeAt(++ge);Ne=65536+((Ne&1023)<<10)|Ft&1023}if(Ne<=127){if(ue>=Le)break;V[ue++>>>0]=Ne}else if(Ne<=2047){if(ue+1>=Le)break;V[ue++>>>0]=192|Ne>>6,V[ue++>>>0]=128|Ne&63}else if(Ne<=65535){if(ue+2>=Le)break;V[ue++>>>0]=224|Ne>>12,V[ue++>>>0]=128|Ne>>6&63,V[ue++>>>0]=128|Ne&63}else{if(ue+3>=Le)break;V[ue++>>>0]=240|Ne>>18,V[ue++>>>0]=128|Ne>>12&63,V[ue++>>>0]=128|Ne>>6&63,V[ue++>>>0]=128|Ne&63}}return V[ue>>>0]=0,ue-Be}function ct(F,V,ue){return st(F,o(),V,ue)}var Ge,lt,it,ht,gt,Mr,Mt,eo,rr;S&&(Ge=u.buffer);function Tt(F){Ge=F,u.HEAP8=lt=new Int8Array(F),u.HEAP16=ht=new Int16Array(F),u.HEAP32=Mr=new Int32Array(F),u.HEAPU8=it=new Uint8Array(F),u.HEAPU16=gt=new Uint16Array(F),u.HEAPU32=Mt=new Uint32Array(F),u.HEAPF32=eo=new Float32Array(F),u.HEAPF64=rr=new Float64Array(F)}var or=u.INITIAL_MEMORY||16777216;if(S)oe=u.wasmMemory,Ge=u.buffer;else if(u.wasmMemory)oe=u.wasmMemory;else if(oe=new WebAssembly.Memory({initial:or/65536,maximum:65536,shared:!0}),!(oe.buffer instanceof SharedArrayBuffer))throw j("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"),C&&j("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");oe&&(Ge=oe.buffer),or=Ge.byteLength,Tt(Ge);var nr,to=[],ro=[],fr=[],Va=!1;function Lo(){return ee}function Ks(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)tl(u.preRun.shift());nl(to)}function Xt(){Va=!0,!S&&nl(ro)}function Wa(){if(!S){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)m0(u.postRun.shift());nl(fr)}}function tl(F){to.unshift(F)}function rl(F){ro.unshift(F)}function m0(F){fr.unshift(F)}var vi=0,Rp=null,Ua=null;function by(F){vi++,u.monitorRunDependencies&&u.monitorRunDependencies(vi)}function bm(F){if(vi--,u.monitorRunDependencies&&u.monitorRunDependencies(vi),vi==0&&(Rp!==null&&(clearInterval(Rp),Rp=null),Ua)){var V=Ua;Ua=null,V()}}function Su(F){u.onAbort&&u.onAbort(F),F="Aborted("+F+")",j(F),le=!0,be=1,F+=". Build with -sASSERTIONS for more info.";var V=new WebAssembly.RuntimeError(F);throw l(V),V}var Cy="data:application/octet-stream;base64,";function Cm(F){return F.startsWith(Cy)}function Dp(F){return F.startsWith("file://")}var hr;hr="tfjs-backend-wasm-threaded-simd.wasm",Cm(hr)||(hr=_(hr));function wm(F){try{if(F==hr&&ne)return new Uint8Array(ne);if(D)return D(F);throw"both async and sync fetching of the wasm failed"}catch(V){Su(V)}}function wy(){if(!ne&&(x||b)){if(typeof fetch=="function"&&!Dp(hr))return fetch(hr,{credentials:"same-origin"}).then(function(F){if(!F.ok)throw"failed to load wasm binary file at '"+hr+"'";return F.arrayBuffer()}).catch(function(){return wm(hr)});if(R)return new Promise(function(F,V){R(hr,function(ue){F(new Uint8Array(ue))},V)})}return Promise.resolve().then(function(){return wm(hr)})}function Sy(){var F={env:Fm,wasi_snapshot_preview1:Fm};function V(ge,Ne){var Ft=ge.exports;if(u.asm=Ft,Ry(u.asm._emscripten_tls_init),nr=u.asm.__indirect_function_table,rl(u.asm.__wasm_call_ctors),ie=Ne,!S){var no=Me.unusedWorkers.length;Me.unusedWorkers.forEach(function(Ha){Me.loadWasmModuleToWorker(Ha,function(){--no||bm("wasm-instantiate")})})}}S||by("wasm-instantiate");function ue(ge){V(ge.instance,ge.module)}function Ee(ge){return wy().then(function(Ne){return WebAssembly.instantiate(Ne,F)}).then(function(Ne){return Ne}).then(ge,function(Ne){j("failed to asynchronously prepare wasm: "+Ne),Su(Ne)})}function Be(){return!ne&&typeof WebAssembly.instantiateStreaming=="function"&&!Cm(hr)&&!Dp(hr)&&!C&&typeof fetch=="function"?fetch(hr,{credentials:"same-origin"}).then(function(ge){var Ne=WebAssembly.instantiateStreaming(ge,F);return Ne.then(ue,function(Ft){return j("wasm streaming compile failed: "+Ft),j("falling back to ArrayBuffer instantiation"),Ee(ue)})}):Ee(ue)}if(u.instantiateWasm)try{var Le=u.instantiateWasm(F,V);return Le}catch(ge){j("Module.instantiateWasm callback failed with error: "+ge),l(ge)}return Be().catch(l),{}}var d0,f0,Sm={};function Iu(F){this.name="ExitStatus",this.message="Program terminated with exit("+F+")",this.status=F}function Iy(F){var V=Me.pthreads[F];delete Me.pthreads[F],V.terminate(),qC(F),Me.runningWorkers.splice(Me.runningWorkers.indexOf(V),1),V.pthread_ptr=0}function vy(F){var V=Me.pthreads[F];V.postMessage({cmd:"cancel"})}function ol(F){var V=Me.pthreads[F];_e(V),Me.returnWorkerToPool(V)}function ky(F){var V=Me.getNewWorker();if(!V)return 6;Me.runningWorkers.push(V),Me.pthreads[F.pthread_ptr]=V,V.pthread_ptr=F.pthread_ptr;var ue={cmd:"run",start_routine:F.startRoutine,arg:F.arg,pthread_ptr:F.pthread_ptr};return V.runPthread=()=>{C&&V.ref(),V.postMessage(ue,F.transferList),delete V.runPthread},V.loaded&&V.runPthread(),0}var Im={varargs:void 0,get:function(){Im.varargs+=4;var F=s()[Im.varargs-4>>>2];return F},getStr:function(F){var V=Pe(F);return V}};function vm(F){if(S)return ki(1,1,F);be=F,Lo()||(Me.terminateAllThreads(),u.onExit&&u.onExit(F),le=!0),g(F,new Iu(F))}function Ny(F,V){if(be=F,!V&&S)throw Nm(F),"unwind";vm(F)}var km=Ny;function Ty(F){if(F instanceof Iu||F=="unwind")return be;g(1,F)}var Me={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){S?Me.initWorker():Me.initMainThread()},initMainThread:function(){for(var F=8;F--;)Me.allocateUnusedWorker()},initWorker:function(){ee=!1},setExitStatus:function(F){be=F},terminateAllThreads:function(){for(var F of Object.values(Me.pthreads))Me.returnWorkerToPool(F);for(var F of Me.unusedWorkers)F.terminate();Me.unusedWorkers=[]},returnWorkerToPool:function(F){var V=F.pthread_ptr;delete Me.pthreads[V],Me.unusedWorkers.push(F),Me.runningWorkers.splice(Me.runningWorkers.indexOf(F),1),F.pthread_ptr=0,C&&F.unref(),qC(V)},receiveObjectTransfer:function(F){},threadInitTLS:function(){Me.tlsInitFunctions.forEach(F=>F())},loadWasmModuleToWorker:function(F,V){F.onmessage=Le=>{var ge=Le.data,Ne=ge.cmd;if(F.pthread_ptr&&(Me.currentProxiedOperationCallerThread=F.pthread_ptr),ge.targetThread&&ge.targetThread!=zm()){var Ft=Me.pthreads[ge.targetThread];Ft?Ft.postMessage(ge,ge.transferList):j('Internal error! Worker sent a message "'+Ne+'" to target pthread '+ge.targetThread+", but that thread no longer exists!"),Me.currentProxiedOperationCallerThread=void 0;return}Ne==="processProxyingQueue"?sl(ge.queue):Ne==="spawnThread"?ky(ge):Ne==="cleanupThread"?ol(ge.thread):Ne==="killThread"?Iy(ge.thread):Ne==="cancelThread"?vy(ge.thread):Ne==="loaded"?(F.loaded=!0,C&&F.unref(),V&&V(F),F.runPthread&&F.runPthread()):Ne==="print"?U("Thread "+ge.threadId+": "+ge.text):Ne==="printErr"?j("Thread "+ge.threadId+": "+ge.text):Ne==="alert"?alert("Thread "+ge.threadId+": "+ge.text):ge.target==="setimmediate"?F.postMessage(ge):Ne==="callHandler"?u[ge.handler](...ge.args):Ne&&j("worker sent an unknown command "+Ne),Me.currentProxiedOperationCallerThread=void 0},F.onerror=Le=>{var ge="worker sent an error!";throw j(ge+" "+Le.filename+":"+Le.lineno+": "+Le.message),Le},C&&(F.on("message",function(Le){F.onmessage({data:Le})}),F.on("error",function(Le){F.onerror(Le)}),F.on("detachedExit",function(){}));var ue=[],Ee=["onExit","onAbort","print","printErr"];for(var Be of Ee)u.hasOwnProperty(Be)&&ue.push(Be);F.postMessage({cmd:"load",handlers:ue,urlOrBlob:u.mainScriptUrlOrBlob||r,wasmMemory:oe,wasmModule:ie})},allocateUnusedWorker:function(){var F,V=_("tfjs-backend-wasm-threaded-simd.worker.js");F=new Worker(V),Me.unusedWorkers.push(F)},getNewWorker:function(){return Me.unusedWorkers.length==0&&(Me.allocateUnusedWorker(),Me.loadWasmModuleToWorker(Me.unusedWorkers[0])),Me.unusedWorkers.pop()}};u.PThread=Me;function nl(F){for(;F.length>0;)F.shift()(u)}function _y(){var F=zm(),V=s()[F+52>>>2],ue=s()[F+56>>>2],Ee=V-ue;C0(V,Ee),Vm(V)}u.establishStackSpace=_y;function Nm(F){if(S)return ki(2,0,F);try{km(F)}catch(V){Ty(V)}}var Ap=[];function $y(F){var V=Ap[F];return V||(F>=Ap.length&&(Ap.length=F+1),Ap[F]=V=nr.get(F)),V}function Ey(F,V){var ue=$y(F)(V);Lo()?Me.setExitStatus(ue):b0(ue)}u.invokeEntryPoint=Ey;function Ry(F){Me.tlsInitFunctions.push(F)}function Dy(F){g0(F,!b,1,!x),Me.threadInitTLS()}function Ay(F){S?postMessage({cmd:"cleanupThread",thread:F}):ol(F)}function Tm(F,V,ue,Ee){return S?ki(3,1,F,V,ue,Ee):_m(F,V,ue,Ee)}function _m(F,V,ue,Ee){if(typeof SharedArrayBuffer=="undefined")return j("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var Be=[],Le=0;if(S&&(Be.length===0||Le))return Tm(F,V,ue,Ee);if(Le)return Le;var ge={startRoutine:ue,pthread_ptr:F,arg:Ee,transferList:Be};return S?(ge.cmd="spawnThread",postMessage(ge,Be),0):ky(ge)}function Fy(){return 65536}var Py=!0;function Oy(){return Py}function sl(F){Atomics.store(s(),F>>2,1),zm()&&y0(F),Atomics.compareExchange(s(),F>>2,1,0)}u.executeNotifiedProxyingQueue=sl;function My(F,V,ue,Ee){if(F==V)setTimeout(()=>sl(Ee));else if(S)postMessage({targetThread:F,cmd:"processProxyingQueue",queue:Ee});else{var Be=Me.pthreads[F];if(!Be)return;Be.postMessage({cmd:"processProxyingQueue",queue:Ee})}return 1}function Ly(F,V,ue){return-1}function By(){Su("")}function vu(F){vu.shown||(vu.shown={}),vu.shown[F]||(vu.shown[F]=1,C&&(F="warning: "+F),j(F))}function zy(){C||b||vu("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function Vy(){return Date.now()}function $m(){return 4294901760}function Wy(){return $m()}var al;C?al=()=>{var F=process.hrtime();return F[0]*1e3+F[1]/1e6}:al=()=>performance.timeOrigin+performance.now();function Uy(F,V,ue){o().copyWithin(F>>>0,V>>>0,V+ue>>>0)}function Gy(){return C?FB().cpus().length:navigator.hardwareConcurrency}function Hy(F){var V=jC(),ue=F();return Vm(V),ue}function ki(F,V){var ue=arguments.length-2,Ee=arguments;return Hy(()=>{for(var Be=ue,Le=Wm(Be*8),ge=Le>>3,Ne=0;Ne>>0]=Ft}return x0(F,Be,Le,V)})}var il=[];function Ky(F,V,ue){il.length=V;for(var Ee=ue>>3,Be=0;Be>>0];var Le=F<0,ge=Le?Sm[-F-1]:tb[F];return ge.apply(null,il)}function qy(F){try{return oe.grow(F-Ge.byteLength+65535>>>16),Tt(oe.buffer),1}catch(V){}}function jy(F){var V=o().length;if(F=F>>>0,F<=V)return!1;var ue=$m();if(F>ue)return!1;let Ee=(Ft,no)=>Ft+(no-Ft%no)%no;for(var Be=1;Be<=4;Be*=2){var Le=V*(1+.2/Be);Le=Math.min(Le,F+100663296);var ge=Math.min(ue,Ee(Math.max(F,Le),65536)),Ne=qy(ge);if(Ne)return!0}return!1}function Xy(){throw"unwind"}function Em(F){return S?ki(4,1,F):52}function Rm(F,V,ue,Ee,Be){return S?ki(5,1,F,V,ue,Ee,Be):70}var Yy=[null,[],[]];function Qy(F,V){var ue=Yy[F];V===0||V===10?((F===1?U:j)(Fe(ue,0)),ue.length=0):ue.push(V)}function Dm(F,V,ue,Ee){if(S)return ki(6,1,F,V,ue,Ee);for(var Be=0,Le=0;Le>>2],Ne=a()[V+4>>>2];V+=8;for(var Ft=0;Ft>>0]);Be+=Ne}return a()[Ee>>>2]=Be,0}function Am(F){var V=u["_"+F];return V}function Zy(F,V){e().set(F,V>>>0)}function Jy(F,V,ue,Ee,Be){var Le={string:Lr=>{var Mp=0;if(Lr!=null&&Lr!==0){var I0=(Lr.length<<2)+1;Mp=Wm(I0),ct(Lr,Mp,I0)}return Mp},array:Lr=>{var Mp=Wm(Lr.length);return Zy(Lr,Mp),Mp}};function ge(Lr){return V==="string"?Pe(Lr):V==="boolean"?!!Lr:Lr}var Ne=Am(F),Ft=[],no=0;if(Ee)for(var Ha=0;Hage==="number"||ge==="boolean"),Le=V!=="string";return Le&&Be&&!Ee?Am(F):function(){return Jy(F,V,ue,arguments,Ee)}}Me.init();var tb=[null,vm,Nm,Tm,Em,Rm,Dm],Fm={__emscripten_init_main_thread_js:Dy,__emscripten_thread_cleanup:Ay,__pthread_create_js:_m,_emscripten_default_pthread_stack_size:Fy,_emscripten_get_now_is_monotonic:Oy,_emscripten_notify_task_queue:My,_emscripten_set_offscreencanvas_size:Ly,abort:By,emscripten_check_blocking_allowed:zy,emscripten_date_now:Vy,emscripten_get_heap_max:Wy,emscripten_get_now:al,emscripten_memcpy_big:Uy,emscripten_num_logical_cores:Gy,emscripten_receive_on_main_thread_js:Ky,emscripten_resize_heap:jy,emscripten_unwind_to_js_event_loop:Xy,exit:km,fd_close:Em,fd_seek:Rm,fd_write:Dm,memory:oe||u.wasmMemory},h0=Sy(),rb=u.___wasm_call_ctors=function(){return(rb=u.___wasm_call_ctors=u.asm.__wasm_call_ctors).apply(null,arguments)},ob=u._init=function(){return(ob=u._init=u.asm.init).apply(null,arguments)},nb=u._init_with_threads_count=function(){return(nb=u._init_with_threads_count=u.asm.init_with_threads_count).apply(null,arguments)},sb=u._get_threads_count=function(){return(sb=u._get_threads_count=u.asm.get_threads_count).apply(null,arguments)},ab=u._register_tensor=function(){return(ab=u._register_tensor=u.asm.register_tensor).apply(null,arguments)},ib=u._dispose_data=function(){return(ib=u._dispose_data=u.asm.dispose_data).apply(null,arguments)},ub=u._dispose=function(){return(ub=u._dispose=u.asm.dispose).apply(null,arguments)},pb=u._Abs=function(){return(pb=u._Abs=u.asm.Abs).apply(null,arguments)},cb=u._Acos=function(){return(cb=u._Acos=u.asm.Acos).apply(null,arguments)},lb=u._Acosh=function(){return(lb=u._Acosh=u.asm.Acosh).apply(null,arguments)},mb=u._Add=function(){return(mb=u._Add=u.asm.Add).apply(null,arguments)},db=u._AddN=function(){return(db=u._AddN=u.asm.AddN).apply(null,arguments)},fb=u._All=function(){return(fb=u._All=u.asm.All).apply(null,arguments)},hb=u._Any=function(){return(hb=u._Any=u.asm.Any).apply(null,arguments)},gb=u._ArgMax=function(){return(gb=u._ArgMax=u.asm.ArgMax).apply(null,arguments)},xb=u._ArgMin=function(){return(xb=u._ArgMin=u.asm.ArgMin).apply(null,arguments)},yb=u._Asin=function(){return(yb=u._Asin=u.asm.Asin).apply(null,arguments)},bb=u._Asinh=function(){return(bb=u._Asinh=u.asm.Asinh).apply(null,arguments)},Cb=u._Atan=function(){return(Cb=u._Atan=u.asm.Atan).apply(null,arguments)},wb=u._Atan2=function(){return(wb=u._Atan2=u.asm.Atan2).apply(null,arguments)},Sb=u._Atanh=function(){return(Sb=u._Atanh=u.asm.Atanh).apply(null,arguments)},Ib=u._AvgPool=function(){return(Ib=u._AvgPool=u.asm.AvgPool).apply(null,arguments)},vb=u._AvgPool3D=function(){return(vb=u._AvgPool3D=u.asm.AvgPool3D).apply(null,arguments)},kb=u._AvgPool3DGrad=function(){return(kb=u._AvgPool3DGrad=u.asm.AvgPool3DGrad).apply(null,arguments)},Nb=u._AvgPoolGrad=function(){return(Nb=u._AvgPoolGrad=u.asm.AvgPoolGrad).apply(null,arguments)},Tb=u._BatchMatMul=function(){return(Tb=u._BatchMatMul=u.asm.BatchMatMul).apply(null,arguments)},_b=u._Bincount=function(){return(_b=u._Bincount=u.asm.Bincount).apply(null,arguments)},$b=u._BitwiseAnd=function(){return($b=u._BitwiseAnd=u.asm.BitwiseAnd).apply(null,arguments)},Eb=u._Ceil=function(){return(Eb=u._Ceil=u.asm.Ceil).apply(null,arguments)},Rb=u._ClipByValue=function(){return(Rb=u._ClipByValue=u.asm.ClipByValue).apply(null,arguments)},Db=u._Conv2D=function(){return(Db=u._Conv2D=u.asm.Conv2D).apply(null,arguments)},Ab=u._Conv2DBackpropInput=function(){return(Ab=u._Conv2DBackpropInput=u.asm.Conv2DBackpropInput).apply(null,arguments)},Fb=u._Conv3D=function(){return(Fb=u._Conv3D=u.asm.Conv3D).apply(null,arguments)},Pb=u._Conv3DBackpropFilterV2=function(){return(Pb=u._Conv3DBackpropFilterV2=u.asm.Conv3DBackpropFilterV2).apply(null,arguments)},Ob=u._Conv3DBackpropInputV2=function(){return(Ob=u._Conv3DBackpropInputV2=u.asm.Conv3DBackpropInputV2).apply(null,arguments)},Mb=u._Cos=function(){return(Mb=u._Cos=u.asm.Cos).apply(null,arguments)},Lb=u._Cosh=function(){return(Lb=u._Cosh=u.asm.Cosh).apply(null,arguments)},Bb=u._CropAndResize=function(){return(Bb=u._CropAndResize=u.asm.CropAndResize).apply(null,arguments)},zb=u._Cumprod=function(){return(zb=u._Cumprod=u.asm.Cumprod).apply(null,arguments)},Vb=u._Cumsum=function(){return(Vb=u._Cumsum=u.asm.Cumsum).apply(null,arguments)},Wb=u._DenseBincount=function(){return(Wb=u._DenseBincount=u.asm.DenseBincount).apply(null,arguments)},Ub=u._DepthToSpace=function(){return(Ub=u._DepthToSpace=u.asm.DepthToSpace).apply(null,arguments)},Gb=u._DepthwiseConv2dNative=function(){return(Gb=u._DepthwiseConv2dNative=u.asm.DepthwiseConv2dNative).apply(null,arguments)},Hb=u._Diag=function(){return(Hb=u._Diag=u.asm.Diag).apply(null,arguments)},Kb=u._Dilation2D=function(){return(Kb=u._Dilation2D=u.asm.Dilation2D).apply(null,arguments)},qb=u._Dilation2DBackpropFilter=function(){return(qb=u._Dilation2DBackpropFilter=u.asm.Dilation2DBackpropFilter).apply(null,arguments)},jb=u._Dilation2DBackpropInput=function(){return(jb=u._Dilation2DBackpropInput=u.asm.Dilation2DBackpropInput).apply(null,arguments)},Xb=u._Elu=function(){return(Xb=u._Elu=u.asm.Elu).apply(null,arguments)},Yb=u._EluGrad=function(){return(Yb=u._EluGrad=u.asm.EluGrad).apply(null,arguments)},Qb=u._Equal=function(){return(Qb=u._Equal=u.asm.Equal).apply(null,arguments)},Zb=u._Erf=function(){return(Zb=u._Erf=u.asm.Erf).apply(null,arguments)},Jb=u._Exp=function(){return(Jb=u._Exp=u.asm.Exp).apply(null,arguments)},eC=u._Expm1=function(){return(eC=u._Expm1=u.asm.Expm1).apply(null,arguments)},tC=u._FlipLeftRight=function(){return(tC=u._FlipLeftRight=u.asm.FlipLeftRight).apply(null,arguments)},rC=u._Floor=function(){return(rC=u._Floor=u.asm.Floor).apply(null,arguments)},oC=u._FloorDiv=function(){return(oC=u._FloorDiv=u.asm.FloorDiv).apply(null,arguments)},nC=u._FusedBatchNorm=function(){return(nC=u._FusedBatchNorm=u.asm.FusedBatchNorm).apply(null,arguments)},sC=u._FusedConv2D=function(){return(sC=u._FusedConv2D=u.asm.FusedConv2D).apply(null,arguments)},aC=u._FusedDepthwiseConv2D=function(){return(aC=u._FusedDepthwiseConv2D=u.asm.FusedDepthwiseConv2D).apply(null,arguments)},iC=u._Gather=function(){return(iC=u._Gather=u.asm.Gather).apply(null,arguments)},uC=u._GatherNd=function(){return(uC=u._GatherNd=u.asm.GatherNd).apply(null,arguments)},pC=u._Greater=function(){return(pC=u._Greater=u.asm.Greater).apply(null,arguments)},cC=u._GreaterEqual=function(){return(cC=u._GreaterEqual=u.asm.GreaterEqual).apply(null,arguments)},lC=u._IsFinite=function(){return(lC=u._IsFinite=u.asm.IsFinite).apply(null,arguments)},mC=u._IsInf=function(){return(mC=u._IsInf=u.asm.IsInf).apply(null,arguments)},dC=u._IsNan=function(){return(dC=u._IsNan=u.asm.IsNan).apply(null,arguments)},fC=u._LRN=function(){return(fC=u._LRN=u.asm.LRN).apply(null,arguments)},hC=u._LRNGrad=function(){return(hC=u._LRNGrad=u.asm.LRNGrad).apply(null,arguments)},gC=u._LeakyRelu=function(){return(gC=u._LeakyRelu=u.asm.LeakyRelu).apply(null,arguments)},xC=u._Less=function(){return(xC=u._Less=u.asm.Less).apply(null,arguments)},yC=u._LessEqual=function(){return(yC=u._LessEqual=u.asm.LessEqual).apply(null,arguments)},bC=u._LinSpace=function(){return(bC=u._LinSpace=u.asm.LinSpace).apply(null,arguments)},CC=u._Log=function(){return(CC=u._Log=u.asm.Log).apply(null,arguments)},wC=u._Log1p=function(){return(wC=u._Log1p=u.asm.Log1p).apply(null,arguments)},SC=u._LogicalAnd=function(){return(SC=u._LogicalAnd=u.asm.LogicalAnd).apply(null,arguments)},IC=u._LogicalNot=function(){return(IC=u._LogicalNot=u.asm.LogicalNot).apply(null,arguments)},vC=u._LogicalOr=function(){return(vC=u._LogicalOr=u.asm.LogicalOr).apply(null,arguments)},kC=u._LogicalXor=function(){return(kC=u._LogicalXor=u.asm.LogicalXor).apply(null,arguments)},NC=u._Max=function(){return(NC=u._Max=u.asm.Max).apply(null,arguments)},TC=u._MaxPool=function(){return(TC=u._MaxPool=u.asm.MaxPool).apply(null,arguments)},_C=u._MaxPool3D=function(){return(_C=u._MaxPool3D=u.asm.MaxPool3D).apply(null,arguments)},$C=u._MaxPool3DGrad=function(){return($C=u._MaxPool3DGrad=u.asm.MaxPool3DGrad).apply(null,arguments)},EC=u._MaxPoolGrad=function(){return(EC=u._MaxPoolGrad=u.asm.MaxPoolGrad).apply(null,arguments)},RC=u._MaxPoolWithArgmax=function(){return(RC=u._MaxPoolWithArgmax=u.asm.MaxPoolWithArgmax).apply(null,arguments)},DC=u._Maximum=function(){return(DC=u._Maximum=u.asm.Maximum).apply(null,arguments)},AC=u._Mean=function(){return(AC=u._Mean=u.asm.Mean).apply(null,arguments)},FC=u._Min=function(){return(FC=u._Min=u.asm.Min).apply(null,arguments)},PC=u._Minimum=function(){return(PC=u._Minimum=u.asm.Minimum).apply(null,arguments)},OC=u._MirrorPad=function(){return(OC=u._MirrorPad=u.asm.MirrorPad).apply(null,arguments)},MC=u._Mod=function(){return(MC=u._Mod=u.asm.Mod).apply(null,arguments)},LC=u._Multinomial=function(){return(LC=u._Multinomial=u.asm.Multinomial).apply(null,arguments)},BC=u._Multiply=function(){return(BC=u._Multiply=u.asm.Multiply).apply(null,arguments)},zC=u._Neg=function(){return(zC=u._Neg=u.asm.Neg).apply(null,arguments)},VC=u._NonMaxSuppressionV3=function(){return(VC=u._NonMaxSuppressionV3=u.asm.NonMaxSuppressionV3).apply(null,arguments)},WC=u._NonMaxSuppressionV4=function(){return(WC=u._NonMaxSuppressionV4=u.asm.NonMaxSuppressionV4).apply(null,arguments)},Pm=u._NonMaxSuppressionV5=function(){return(Pm=u._NonMaxSuppressionV5=u.asm.NonMaxSuppressionV5).apply(null,arguments)},Om=u._NotEqual=function(){return(Om=u._NotEqual=u.asm.NotEqual).apply(null,arguments)},ul=u._OneHot=function(){return(ul=u._OneHot=u.asm.OneHot).apply(null,arguments)},UC=u._PadV2=function(){return(UC=u._PadV2=u.asm.PadV2).apply(null,arguments)},GC=u._Pow=function(){return(GC=u._Pow=u.asm.Pow).apply(null,arguments)},Fp=u._Prelu=function(){return(Fp=u._Prelu=u.asm.Prelu).apply(null,arguments)},Mm=u._Prod=function(){return(Mm=u._Prod=u.asm.Prod).apply(null,arguments)},Pp=u._RealDiv=function(){return(Pp=u._RealDiv=u.asm.RealDiv).apply(null,arguments)},Op=u._Reciprocal=function(){return(Op=u._Reciprocal=u.asm.Reciprocal).apply(null,arguments)},HC=u._Relu=function(){return(HC=u._Relu=u.asm.Relu).apply(null,arguments)},K=u._Relu6=function(){return(K=u._Relu6=u.asm.Relu6).apply(null,arguments)},ae=u._ResizeBilinear=function(){return(ae=u._ResizeBilinear=u.asm.ResizeBilinear).apply(null,arguments)},$e=u._ResizeBilinearGrad=function(){return($e=u._ResizeBilinearGrad=u.asm.ResizeBilinearGrad).apply(null,arguments)},at=u._ResizeNearestNeighbor=function(){return(at=u._ResizeNearestNeighbor=u.asm.ResizeNearestNeighbor).apply(null,arguments)},_t=u._ResizeNearestNeighborGrad=function(){return(_t=u._ResizeNearestNeighborGrad=u.asm.ResizeNearestNeighborGrad).apply(null,arguments)},$t=u._Reverse=function(){return($t=u._Reverse=u.asm.Reverse).apply(null,arguments)},Qe=u._RotateWithOffset=function(){return(Qe=u._RotateWithOffset=u.asm.RotateWithOffset).apply(null,arguments)},Ke=u._Round=function(){return(Ke=u._Round=u.asm.Round).apply(null,arguments)},Ut=u._Rsqrt=function(){return(Ut=u._Rsqrt=u.asm.Rsqrt).apply(null,arguments)},oo=u._ScatterNd=function(){return(oo=u._ScatterNd=u.asm.ScatterNd).apply(null,arguments)},Ga=u._SearchSorted=function(){return(Ga=u._SearchSorted=u.asm.SearchSorted).apply(null,arguments)},Lm=u._SelectV2=function(){return(Lm=u._SelectV2=u.asm.SelectV2).apply(null,arguments)},pl=u._Selu=function(){return(pl=u._Selu=u.asm.Selu).apply(null,arguments)},KC=u._Sigmoid=function(){return(KC=u._Sigmoid=u.asm.Sigmoid).apply(null,arguments)},yr=u._Sign=function(){return(yr=u._Sign=u.asm.Sign).apply(null,arguments)},Ni=u._Sin=function(){return(Ni=u._Sin=u.asm.Sin).apply(null,arguments)},Bm=u._Sinh=function(){return(Bm=u._Sinh=u.asm.Sinh).apply(null,arguments)},UU=u._Softmax=function(){return(UU=u._Softmax=u.asm.Softmax).apply(null,arguments)},GU=u._Softplus=function(){return(GU=u._Softplus=u.asm.Softplus).apply(null,arguments)},HU=u._SparseFillEmptyRows=function(){return(HU=u._SparseFillEmptyRows=u.asm.SparseFillEmptyRows).apply(null,arguments)},KU=u._SparseReshape=function(){return(KU=u._SparseReshape=u.asm.SparseReshape).apply(null,arguments)},qU=u._SparseSegmentReduction=function(){return(qU=u._SparseSegmentReduction=u.asm.SparseSegmentReduction).apply(null,arguments)},jU=u._SparseToDense=function(){return(jU=u._SparseToDense=u.asm.SparseToDense).apply(null,arguments)},XU=u._Sqrt=function(){return(XU=u._Sqrt=u.asm.Sqrt).apply(null,arguments)},YU=u._Square=function(){return(YU=u._Square=u.asm.Square).apply(null,arguments)},QU=u._SquaredDifference=function(){return(QU=u._SquaredDifference=u.asm.SquaredDifference).apply(null,arguments)},ZU=u._Step=function(){return(ZU=u._Step=u.asm.Step).apply(null,arguments)},JU=u._StridedSlice=function(){return(JU=u._StridedSlice=u.asm.StridedSlice).apply(null,arguments)},eG=u._Sub=function(){return(eG=u._Sub=u.asm.Sub).apply(null,arguments)},tG=u._Sum=function(){return(tG=u._Sum=u.asm.Sum).apply(null,arguments)},rG=u._Tan=function(){return(rG=u._Tan=u.asm.Tan).apply(null,arguments)},oG=u._Tanh=function(){return(oG=u._Tanh=u.asm.Tanh).apply(null,arguments)},nG=u._TensorScatterUpdate=function(){return(nG=u._TensorScatterUpdate=u.asm.TensorScatterUpdate).apply(null,arguments)},sG=u._Tile=function(){return(sG=u._Tile=u.asm.Tile).apply(null,arguments)},aG=u._TopK=function(){return(aG=u._TopK=u.asm.TopK).apply(null,arguments)},iG=u._Transform=function(){return(iG=u._Transform=u.asm.Transform).apply(null,arguments)},uG=u._Transpose=function(){return(uG=u._Transpose=u.asm.Transpose).apply(null,arguments)},pG=u.__FusedMatMul=function(){return(pG=u.__FusedMatMul=u.asm._FusedMatMul).apply(null,arguments)},cG=u._malloc=function(){return(cG=u._malloc=u.asm.malloc).apply(null,arguments)},lG=u._free=function(){return(lG=u._free=u.asm.free).apply(null,arguments)},mG=u.__emscripten_tls_init=function(){return(mG=u.__emscripten_tls_init=u.asm._emscripten_tls_init).apply(null,arguments)},zm=u._pthread_self=function(){return(zm=u._pthread_self=u.asm.pthread_self).apply(null,arguments)},dG=u.___errno_location=function(){return(dG=u.___errno_location=u.asm.__errno_location).apply(null,arguments)},g0=u.__emscripten_thread_init=function(){return(g0=u.__emscripten_thread_init=u.asm._emscripten_thread_init).apply(null,arguments)},fG=u.__emscripten_thread_crashed=function(){return(fG=u.__emscripten_thread_crashed=u.asm._emscripten_thread_crashed).apply(null,arguments)},hG=u._emscripten_main_thread_process_queued_calls=function(){return(hG=u._emscripten_main_thread_process_queued_calls=u.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},gG=u._emscripten_main_browser_thread_id=function(){return(gG=u._emscripten_main_browser_thread_id=u.asm.emscripten_main_browser_thread_id).apply(null,arguments)},x0=u._emscripten_run_in_main_runtime_thread_js=function(){return(x0=u._emscripten_run_in_main_runtime_thread_js=u.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)},xG=u._emscripten_dispatch_to_thread_=function(){return(xG=u._emscripten_dispatch_to_thread_=u.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},y0=u.__emscripten_proxy_execute_task_queue=function(){return(y0=u.__emscripten_proxy_execute_task_queue=u.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)},qC=u.__emscripten_thread_free_data=function(){return(qC=u.__emscripten_thread_free_data=u.asm._emscripten_thread_free_data).apply(null,arguments)},b0=u.__emscripten_thread_exit=function(){return(b0=u.__emscripten_thread_exit=u.asm._emscripten_thread_exit).apply(null,arguments)},C0=u._emscripten_stack_set_limits=function(){return(C0=u._emscripten_stack_set_limits=u.asm.emscripten_stack_set_limits).apply(null,arguments)},jC=u.stackSave=function(){return(jC=u.stackSave=u.asm.stackSave).apply(null,arguments)},Vm=u.stackRestore=function(){return(Vm=u.stackRestore=u.asm.stackRestore).apply(null,arguments)},Wm=u.stackAlloc=function(){return(Wm=u.stackAlloc=u.asm.stackAlloc).apply(null,arguments)},yG=u.dynCall_iijjiiii=function(){return(yG=u.dynCall_iijjiiii=u.asm.dynCall_iijjiiii).apply(null,arguments)},bG=u.dynCall_jiji=function(){return(bG=u.dynCall_jiji=u.asm.dynCall_jiji).apply(null,arguments)};u.keepRuntimeAlive=Lo,u.wasmMemory=oe,u.cwrap=eb,u.ExitStatus=Iu,u.PThread=Me;var Um;Ua=function F(){Um||w0(),Um||(Ua=F)};function w0(F){if(F=F||f,vi>0)return;if(S){c(u),Xt(),startWorker(u);return}if(Ks(),vi>0)return;function V(){Um||(Um=!0,u.calledRun=!0,!le&&(Xt(),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Wa()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),V()},1)):V()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();w0();var Gm;m&&(Gm={uncaughtException:process.listeners("uncaughtException").filter(function(F){return!m.uncaughtException.indexOf(F)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(F){return!m.unhandledRejection.indexOf(F)>-1})});var Hm;if(typeof WasmBackendModule!="undefined")Hm=WasmBackendModule;else if(typeof t!="undefined")Hm=t;else throw new Error("Could not find wasm module in post.js");if(Gm){var CG=Hm._dispose;Hm._dispose=function(){CG(),Gm.uncaughtException.forEach(function(F){process.removeListener("uncaughtException",F)}),Gm.unhandledRejection.forEach(function(F){process.removeListener("unhandledRejection",F)})}}return t.ready}})();typeof Vg=="object"&&typeof Uv=="object"?Uv.exports=Wv:typeof define=="function"&&define.amd?define([],function(){return Wv}):typeof Vg=="object"&&(Vg.WasmBackendModuleThreadedSimd=Wv)});var MB=Kt((GFt,OB)=>{OB.exports.wasmWorkerContents=`"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+" -");return}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;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"})};self.onmessage=e=>{try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}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)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}};`});var LB=Kt((Wg,Hv)=>{var Gv=(()=>{var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(t){t=t||{};var e=typeof t!="undefined"?t:{},o,n;e.ready=new Promise(function(K,ae){o=K,n=ae});var s;typeof process!="undefined"&&process.listeners&&(s={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var a=Object.assign({},e),i=[],p="./this.program",u=(K,ae)=>{throw ae},c=typeof window=="object",l=typeof importScripts=="function",m=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",d="";function f(K){return e.locateFile?e.locateFile(K,d):d+K}var h,g,x,b;function C(K){if(K instanceof Rp)return;E("exiting due to exception: "+K)}if(m){var S=zv(),k=Vv();l?d=k.dirname(d)+"/":d=__dirname+"/",h=(K,ae)=>(K=Ks(K)?new URL(K):k.normalize(K),S.readFileSync(K,ae?void 0:"utf8")),x=K=>{var ae=h(K,!0);return ae.buffer||(ae=new Uint8Array(ae)),ae},g=(K,ae,$e)=>{K=Ks(K)?new URL(K):k.normalize(K),S.readFile(K,function(at,_t){at?$e(at):ae(_t.buffer)})},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),i=process.argv.slice(2),process.on("uncaughtException",function(K){if(!(K instanceof Rp))throw K}),process.on("unhandledRejection",function(K){throw K}),u=(K,ae)=>{if(it())throw process.exitCode=K,ae;C(ae),process.exit(K)},e.inspect=function(){return"[Emscripten Module object]"}}else(c||l)&&(l?d=self.location.href:typeof document!="undefined"&&document.currentScript&&(d=document.currentScript.src),r&&(d=r),d.indexOf("blob:")!==0?d=d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):d="",h=K=>{var ae=new XMLHttpRequest;return ae.open("GET",K,!1),ae.send(null),ae.responseText},l&&(x=K=>{var ae=new XMLHttpRequest;return ae.open("GET",K,!1),ae.responseType="arraybuffer",ae.send(null),new Uint8Array(ae.response)}),g=(K,ae,$e)=>{var at=new XMLHttpRequest;at.open("GET",K,!0),at.responseType="arraybuffer",at.onload=()=>{if(at.status==200||at.status==0&&at.response){ae(at.response);return}$e()},at.onerror=$e,at.send(null)},b=K=>document.title=K);var _=e.print||console.log.bind(console),E=e.printErr||console.warn.bind(console);Object.assign(e,a),a=null,e.arguments&&(i=e.arguments),e.thisProgram&&(p=e.thisProgram),e.quit&&(u=e.quit);var R=4,D;e.wasmBinary&&(D=e.wasmBinary);var P=e.noExitRuntime||!0;typeof WebAssembly!="object"&&fr("no native wasm support detected");var O,M=!1,L;function B(K,ae){K||fr(ae)}var z=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function U(K,ae,$e){ae>>>=0;for(var at=ae+$e,_t=ae;K[_t]&&!(_t>=at);)++_t;if(_t-ae>16&&K.buffer&&z)return z.decode(K.subarray(ae,_t));for(var $t="";ae<_t;){var Qe=K[ae++];if(!(Qe&128)){$t+=String.fromCharCode(Qe);continue}var Ke=K[ae++]&63;if((Qe&224)==192){$t+=String.fromCharCode((Qe&31)<<6|Ke);continue}var Ut=K[ae++]&63;if((Qe&240)==224?Qe=(Qe&15)<<12|Ke<<6|Ut:Qe=(Qe&7)<<18|Ke<<12|Ut<<6|K[ae++]&63,Qe<65536)$t+=String.fromCharCode(Qe);else{var oo=Qe-65536;$t+=String.fromCharCode(55296|oo>>10,56320|oo&1023)}}return $t}function j(K,ae){return K>>>=0,K?U(ne,K,ae):""}function q(K,ae,$e,at){if($e>>>=0,!(at>0))return 0;for(var _t=$e,$t=$e+at-1,Qe=0;Qe=55296&&Ke<=57343){var Ut=K.charCodeAt(++Qe);Ke=65536+((Ke&1023)<<10)|Ut&1023}if(Ke<=127){if($e>=$t)break;ae[$e++>>>0]=Ke}else if(Ke<=2047){if($e+1>=$t)break;ae[$e++>>>0]=192|Ke>>6,ae[$e++>>>0]=128|Ke&63}else if(Ke<=65535){if($e+2>=$t)break;ae[$e++>>>0]=224|Ke>>12,ae[$e++>>>0]=128|Ke>>6&63,ae[$e++>>>0]=128|Ke&63}else{if($e+3>=$t)break;ae[$e++>>>0]=240|Ke>>18,ae[$e++>>>0]=128|Ke>>12&63,ae[$e++>>>0]=128|Ke>>6&63,ae[$e++>>>0]=128|Ke&63}}return ae[$e>>>0]=0,$e-_t}function Y(K,ae,$e){return q(K,ne,ae,$e)}var J,re,ne,ee,oe,ie,le,be,_e;function ve(K){J=K,e.HEAP8=re=new Int8Array(K),e.HEAP16=ee=new Int16Array(K),e.HEAP32=ie=new Int32Array(K),e.HEAPU8=ne=new Uint8Array(K),e.HEAPU16=oe=new Uint16Array(K),e.HEAPU32=le=new Uint32Array(K),e.HEAPF32=be=new Float32Array(K),e.HEAPF64=_e=new Float64Array(K)}var Fe=e.INITIAL_MEMORY||16777216,Pe,st=[],ct=[],Ge=[],lt=!1;function it(){return P}function ht(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)Mt(e.preRun.shift());Ua(st)}function gt(){lt=!0,Ua(ct)}function Mr(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)rr(e.postRun.shift());Ua(Ge)}function Mt(K){st.unshift(K)}function eo(K){ct.unshift(K)}function rr(K){Ge.unshift(K)}var Tt=0,or=null,nr=null;function to(K){Tt++,e.monitorRunDependencies&&e.monitorRunDependencies(Tt)}function ro(K){if(Tt--,e.monitorRunDependencies&&e.monitorRunDependencies(Tt),Tt==0&&(or!==null&&(clearInterval(or),or=null),nr)){var ae=nr;nr=null,ae()}}function fr(K){e.onAbort&&e.onAbort(K),K="Aborted("+K+")",E(K),M=!0,L=1,K+=". Build with -sASSERTIONS for more info.";var ae=new WebAssembly.RuntimeError(K);throw n(ae),ae}var Va="data:application/octet-stream;base64,";function Lo(K){return K.startsWith(Va)}function Ks(K){return K.startsWith("file://")}var Xt;Xt="tfjs-backend-wasm.wasm",Lo(Xt)||(Xt=f(Xt));function Wa(K){try{if(K==Xt&&D)return new Uint8Array(D);if(x)return x(K);throw"both async and sync fetching of the wasm failed"}catch(ae){fr(ae)}}function tl(){if(!D&&(c||l)){if(typeof fetch=="function"&&!Ks(Xt))return fetch(Xt,{credentials:"same-origin"}).then(function(K){if(!K.ok)throw"failed to load wasm binary file at '"+Xt+"'";return K.arrayBuffer()}).catch(function(){return Wa(Xt)});if(g)return new Promise(function(K,ae){g(Xt,function($e){K(new Uint8Array($e))},ae)})}return Promise.resolve().then(function(){return Wa(Xt)})}function rl(){var K={env:ol,wasi_snapshot_preview1:ol};function ae(Qe,Ke){var Ut=Qe.exports;e.asm=Ut,O=e.asm.memory,ve(O.buffer),Pe=e.asm.__indirect_function_table,eo(e.asm.__wasm_call_ctors),ro("wasm-instantiate")}to("wasm-instantiate");function $e(Qe){ae(Qe.instance)}function at(Qe){return tl().then(function(Ke){return WebAssembly.instantiate(Ke,K)}).then(function(Ke){return Ke}).then(Qe,function(Ke){E("failed to asynchronously prepare wasm: "+Ke),fr(Ke)})}function _t(){return!D&&typeof WebAssembly.instantiateStreaming=="function"&&!Lo(Xt)&&!Ks(Xt)&&!m&&typeof fetch=="function"?fetch(Xt,{credentials:"same-origin"}).then(function(Qe){var Ke=WebAssembly.instantiateStreaming(Qe,K);return Ke.then($e,function(Ut){return E("wasm streaming compile failed: "+Ut),E("falling back to ArrayBuffer instantiation"),at($e)})}):at($e)}if(e.instantiateWasm)try{var $t=e.instantiateWasm(K,ae);return $t}catch(Qe){E("Module.instantiateWasm callback failed with error: "+Qe),n(Qe)}return _t().catch(n),{}}var m0,vi;function Rp(K){this.name="ExitStatus",this.message="Program terminated with exit("+K+")",this.status=K}function Ua(K){for(;K.length>0;)K.shift()(e)}function by(){fr("")}function bm(){return 4294901760}function Su(){return bm()}function Cy(K,ae,$e){ne.copyWithin(K>>>0,ae>>>0,ae+$e>>>0)}function Cm(K){try{return O.grow(K-J.byteLength+65535>>>16),ve(O.buffer),1}catch(ae){}}function Dp(K){var ae=ne.length;K=K>>>0;var $e=bm();if(K>$e)return!1;let at=(Ut,oo)=>Ut+(oo-Ut%oo)%oo;for(var _t=1;_t<=4;_t*=2){var $t=ae*(1+.2/_t);$t=Math.min($t,K+100663296);var Qe=Math.min($e,at(Math.max(K,$t),65536)),Ke=Cm(Qe);if(Ke)return!0}return!1}var hr={varargs:void 0,get:function(){hr.varargs+=4;var K=ie[hr.varargs-4>>>2];return K},getStr:function(K){var ae=j(K);return ae}};function wm(K){return 52}function wy(K,ae,$e,at,_t){return 70}var Sy=[null,[],[]];function d0(K,ae){var $e=Sy[K];ae===0||ae===10?((K===1?_:E)(U($e,0)),$e.length=0):$e.push(ae)}function f0(K,ae,$e,at){for(var _t=0,$t=0;$t<$e;$t++){var Qe=le[ae>>>2],Ke=le[ae+4>>>2];ae+=8;for(var Ut=0;Ut>>0]);_t+=Ke}return le[at>>>2]=_t,0}function Sm(K){var ae=e["_"+K];return ae}function Iu(K,ae){re.set(K,ae>>>0)}function Iy(K,ae,$e,at,_t){var $t={string:yr=>{var Ni=0;if(yr!=null&&yr!==0){var Bm=(yr.length<<2)+1;Ni=ul(Bm),Y(yr,Ni,Bm)}return Ni},array:yr=>{var Ni=ul(yr.length);return Iu(yr,Ni),Ni}};function Qe(yr){return ae==="string"?j(yr):ae==="boolean"?!!yr:yr}var Ke=Sm(K),Ut=[],oo=0;if(at)for(var Ga=0;GaQe==="number"||Qe==="boolean"),$t=ae!=="string";return $t&&_t&&!at?Sm(K):function(){return Iy(K,ae,$e,arguments,at)}}var ol={abort:by,emscripten_get_heap_max:Su,emscripten_memcpy_big:Cy,emscripten_resize_heap:Dp,fd_close:wm,fd_seek:wy,fd_write:f0},ky=rl(),Im=e.___wasm_call_ctors=function(){return(Im=e.___wasm_call_ctors=e.asm.__wasm_call_ctors).apply(null,arguments)},vm=e._init=function(){return(vm=e._init=e.asm.init).apply(null,arguments)},Ny=e._init_with_threads_count=function(){return(Ny=e._init_with_threads_count=e.asm.init_with_threads_count).apply(null,arguments)},km=e._get_threads_count=function(){return(km=e._get_threads_count=e.asm.get_threads_count).apply(null,arguments)},Ty=e._register_tensor=function(){return(Ty=e._register_tensor=e.asm.register_tensor).apply(null,arguments)},Me=e._dispose_data=function(){return(Me=e._dispose_data=e.asm.dispose_data).apply(null,arguments)},nl=e._dispose=function(){return(nl=e._dispose=e.asm.dispose).apply(null,arguments)},_y=e._Abs=function(){return(_y=e._Abs=e.asm.Abs).apply(null,arguments)},Nm=e._Acos=function(){return(Nm=e._Acos=e.asm.Acos).apply(null,arguments)},Ap=e._Acosh=function(){return(Ap=e._Acosh=e.asm.Acosh).apply(null,arguments)},$y=e._Add=function(){return($y=e._Add=e.asm.Add).apply(null,arguments)},Ey=e._AddN=function(){return(Ey=e._AddN=e.asm.AddN).apply(null,arguments)},Ry=e._All=function(){return(Ry=e._All=e.asm.All).apply(null,arguments)},Dy=e._Any=function(){return(Dy=e._Any=e.asm.Any).apply(null,arguments)},Ay=e._ArgMax=function(){return(Ay=e._ArgMax=e.asm.ArgMax).apply(null,arguments)},Tm=e._ArgMin=function(){return(Tm=e._ArgMin=e.asm.ArgMin).apply(null,arguments)},_m=e._Asin=function(){return(_m=e._Asin=e.asm.Asin).apply(null,arguments)},Fy=e._Asinh=function(){return(Fy=e._Asinh=e.asm.Asinh).apply(null,arguments)},Py=e._Atan=function(){return(Py=e._Atan=e.asm.Atan).apply(null,arguments)},Oy=e._Atan2=function(){return(Oy=e._Atan2=e.asm.Atan2).apply(null,arguments)},sl=e._Atanh=function(){return(sl=e._Atanh=e.asm.Atanh).apply(null,arguments)},My=e._AvgPool=function(){return(My=e._AvgPool=e.asm.AvgPool).apply(null,arguments)},Ly=e._AvgPool3D=function(){return(Ly=e._AvgPool3D=e.asm.AvgPool3D).apply(null,arguments)},By=e._AvgPool3DGrad=function(){return(By=e._AvgPool3DGrad=e.asm.AvgPool3DGrad).apply(null,arguments)},vu=e._AvgPoolGrad=function(){return(vu=e._AvgPoolGrad=e.asm.AvgPoolGrad).apply(null,arguments)},zy=e._BatchMatMul=function(){return(zy=e._BatchMatMul=e.asm.BatchMatMul).apply(null,arguments)},Vy=e._Bincount=function(){return(Vy=e._Bincount=e.asm.Bincount).apply(null,arguments)},$m=e._BitwiseAnd=function(){return($m=e._BitwiseAnd=e.asm.BitwiseAnd).apply(null,arguments)},Wy=e._Ceil=function(){return(Wy=e._Ceil=e.asm.Ceil).apply(null,arguments)},al=e._ClipByValue=function(){return(al=e._ClipByValue=e.asm.ClipByValue).apply(null,arguments)},Uy=e._Conv2D=function(){return(Uy=e._Conv2D=e.asm.Conv2D).apply(null,arguments)},Gy=e._Conv2DBackpropInput=function(){return(Gy=e._Conv2DBackpropInput=e.asm.Conv2DBackpropInput).apply(null,arguments)},Hy=e._Conv3D=function(){return(Hy=e._Conv3D=e.asm.Conv3D).apply(null,arguments)},ki=e._Conv3DBackpropFilterV2=function(){return(ki=e._Conv3DBackpropFilterV2=e.asm.Conv3DBackpropFilterV2).apply(null,arguments)},il=e._Conv3DBackpropInputV2=function(){return(il=e._Conv3DBackpropInputV2=e.asm.Conv3DBackpropInputV2).apply(null,arguments)},Ky=e._Cos=function(){return(Ky=e._Cos=e.asm.Cos).apply(null,arguments)},qy=e._Cosh=function(){return(qy=e._Cosh=e.asm.Cosh).apply(null,arguments)},jy=e._CropAndResize=function(){return(jy=e._CropAndResize=e.asm.CropAndResize).apply(null,arguments)},Xy=e._Cumprod=function(){return(Xy=e._Cumprod=e.asm.Cumprod).apply(null,arguments)},Em=e._Cumsum=function(){return(Em=e._Cumsum=e.asm.Cumsum).apply(null,arguments)},Rm=e._DenseBincount=function(){return(Rm=e._DenseBincount=e.asm.DenseBincount).apply(null,arguments)},Yy=e._DepthToSpace=function(){return(Yy=e._DepthToSpace=e.asm.DepthToSpace).apply(null,arguments)},Qy=e._DepthwiseConv2dNative=function(){return(Qy=e._DepthwiseConv2dNative=e.asm.DepthwiseConv2dNative).apply(null,arguments)},Dm=e._Diag=function(){return(Dm=e._Diag=e.asm.Diag).apply(null,arguments)},Am=e._Dilation2D=function(){return(Am=e._Dilation2D=e.asm.Dilation2D).apply(null,arguments)},Zy=e._Dilation2DBackpropFilter=function(){return(Zy=e._Dilation2DBackpropFilter=e.asm.Dilation2DBackpropFilter).apply(null,arguments)},Jy=e._Dilation2DBackpropInput=function(){return(Jy=e._Dilation2DBackpropInput=e.asm.Dilation2DBackpropInput).apply(null,arguments)},eb=e._Elu=function(){return(eb=e._Elu=e.asm.Elu).apply(null,arguments)},tb=e._EluGrad=function(){return(tb=e._EluGrad=e.asm.EluGrad).apply(null,arguments)},Fm=e._Equal=function(){return(Fm=e._Equal=e.asm.Equal).apply(null,arguments)},h0=e._Erf=function(){return(h0=e._Erf=e.asm.Erf).apply(null,arguments)},rb=e._Exp=function(){return(rb=e._Exp=e.asm.Exp).apply(null,arguments)},ob=e._Expm1=function(){return(ob=e._Expm1=e.asm.Expm1).apply(null,arguments)},nb=e._FlipLeftRight=function(){return(nb=e._FlipLeftRight=e.asm.FlipLeftRight).apply(null,arguments)},sb=e._Floor=function(){return(sb=e._Floor=e.asm.Floor).apply(null,arguments)},ab=e._FloorDiv=function(){return(ab=e._FloorDiv=e.asm.FloorDiv).apply(null,arguments)},ib=e._FusedBatchNorm=function(){return(ib=e._FusedBatchNorm=e.asm.FusedBatchNorm).apply(null,arguments)},ub=e._FusedConv2D=function(){return(ub=e._FusedConv2D=e.asm.FusedConv2D).apply(null,arguments)},pb=e._FusedDepthwiseConv2D=function(){return(pb=e._FusedDepthwiseConv2D=e.asm.FusedDepthwiseConv2D).apply(null,arguments)},cb=e._Gather=function(){return(cb=e._Gather=e.asm.Gather).apply(null,arguments)},lb=e._GatherNd=function(){return(lb=e._GatherNd=e.asm.GatherNd).apply(null,arguments)},mb=e._Greater=function(){return(mb=e._Greater=e.asm.Greater).apply(null,arguments)},db=e._GreaterEqual=function(){return(db=e._GreaterEqual=e.asm.GreaterEqual).apply(null,arguments)},fb=e._IsFinite=function(){return(fb=e._IsFinite=e.asm.IsFinite).apply(null,arguments)},hb=e._IsInf=function(){return(hb=e._IsInf=e.asm.IsInf).apply(null,arguments)},gb=e._IsNan=function(){return(gb=e._IsNan=e.asm.IsNan).apply(null,arguments)},xb=e._LRN=function(){return(xb=e._LRN=e.asm.LRN).apply(null,arguments)},yb=e._LRNGrad=function(){return(yb=e._LRNGrad=e.asm.LRNGrad).apply(null,arguments)},bb=e._LeakyRelu=function(){return(bb=e._LeakyRelu=e.asm.LeakyRelu).apply(null,arguments)},Cb=e._Less=function(){return(Cb=e._Less=e.asm.Less).apply(null,arguments)},wb=e._LessEqual=function(){return(wb=e._LessEqual=e.asm.LessEqual).apply(null,arguments)},Sb=e._LinSpace=function(){return(Sb=e._LinSpace=e.asm.LinSpace).apply(null,arguments)},Ib=e._Log=function(){return(Ib=e._Log=e.asm.Log).apply(null,arguments)},vb=e._Log1p=function(){return(vb=e._Log1p=e.asm.Log1p).apply(null,arguments)},kb=e._LogicalAnd=function(){return(kb=e._LogicalAnd=e.asm.LogicalAnd).apply(null,arguments)},Nb=e._LogicalNot=function(){return(Nb=e._LogicalNot=e.asm.LogicalNot).apply(null,arguments)},Tb=e._LogicalOr=function(){return(Tb=e._LogicalOr=e.asm.LogicalOr).apply(null,arguments)},_b=e._LogicalXor=function(){return(_b=e._LogicalXor=e.asm.LogicalXor).apply(null,arguments)},$b=e._Max=function(){return($b=e._Max=e.asm.Max).apply(null,arguments)},Eb=e._MaxPool=function(){return(Eb=e._MaxPool=e.asm.MaxPool).apply(null,arguments)},Rb=e._MaxPool3D=function(){return(Rb=e._MaxPool3D=e.asm.MaxPool3D).apply(null,arguments)},Db=e._MaxPool3DGrad=function(){return(Db=e._MaxPool3DGrad=e.asm.MaxPool3DGrad).apply(null,arguments)},Ab=e._MaxPoolGrad=function(){return(Ab=e._MaxPoolGrad=e.asm.MaxPoolGrad).apply(null,arguments)},Fb=e._MaxPoolWithArgmax=function(){return(Fb=e._MaxPoolWithArgmax=e.asm.MaxPoolWithArgmax).apply(null,arguments)},Pb=e._Maximum=function(){return(Pb=e._Maximum=e.asm.Maximum).apply(null,arguments)},Ob=e._Mean=function(){return(Ob=e._Mean=e.asm.Mean).apply(null,arguments)},Mb=e._Min=function(){return(Mb=e._Min=e.asm.Min).apply(null,arguments)},Lb=e._Minimum=function(){return(Lb=e._Minimum=e.asm.Minimum).apply(null,arguments)},Bb=e._MirrorPad=function(){return(Bb=e._MirrorPad=e.asm.MirrorPad).apply(null,arguments)},zb=e._Mod=function(){return(zb=e._Mod=e.asm.Mod).apply(null,arguments)},Vb=e._Multinomial=function(){return(Vb=e._Multinomial=e.asm.Multinomial).apply(null,arguments)},Wb=e._Multiply=function(){return(Wb=e._Multiply=e.asm.Multiply).apply(null,arguments)},Ub=e._Neg=function(){return(Ub=e._Neg=e.asm.Neg).apply(null,arguments)},Gb=e._NonMaxSuppressionV3=function(){return(Gb=e._NonMaxSuppressionV3=e.asm.NonMaxSuppressionV3).apply(null,arguments)},Hb=e._NonMaxSuppressionV4=function(){return(Hb=e._NonMaxSuppressionV4=e.asm.NonMaxSuppressionV4).apply(null,arguments)},Kb=e._NonMaxSuppressionV5=function(){return(Kb=e._NonMaxSuppressionV5=e.asm.NonMaxSuppressionV5).apply(null,arguments)},qb=e._NotEqual=function(){return(qb=e._NotEqual=e.asm.NotEqual).apply(null,arguments)},jb=e._OneHot=function(){return(jb=e._OneHot=e.asm.OneHot).apply(null,arguments)},Xb=e._PadV2=function(){return(Xb=e._PadV2=e.asm.PadV2).apply(null,arguments)},Yb=e._Pow=function(){return(Yb=e._Pow=e.asm.Pow).apply(null,arguments)},Qb=e._Prelu=function(){return(Qb=e._Prelu=e.asm.Prelu).apply(null,arguments)},Zb=e._Prod=function(){return(Zb=e._Prod=e.asm.Prod).apply(null,arguments)},Jb=e._RealDiv=function(){return(Jb=e._RealDiv=e.asm.RealDiv).apply(null,arguments)},eC=e._Reciprocal=function(){return(eC=e._Reciprocal=e.asm.Reciprocal).apply(null,arguments)},tC=e._Relu=function(){return(tC=e._Relu=e.asm.Relu).apply(null,arguments)},rC=e._Relu6=function(){return(rC=e._Relu6=e.asm.Relu6).apply(null,arguments)},oC=e._ResizeBilinear=function(){return(oC=e._ResizeBilinear=e.asm.ResizeBilinear).apply(null,arguments)},nC=e._ResizeBilinearGrad=function(){return(nC=e._ResizeBilinearGrad=e.asm.ResizeBilinearGrad).apply(null,arguments)},sC=e._ResizeNearestNeighbor=function(){return(sC=e._ResizeNearestNeighbor=e.asm.ResizeNearestNeighbor).apply(null,arguments)},aC=e._ResizeNearestNeighborGrad=function(){return(aC=e._ResizeNearestNeighborGrad=e.asm.ResizeNearestNeighborGrad).apply(null,arguments)},iC=e._Reverse=function(){return(iC=e._Reverse=e.asm.Reverse).apply(null,arguments)},uC=e._RotateWithOffset=function(){return(uC=e._RotateWithOffset=e.asm.RotateWithOffset).apply(null,arguments)},pC=e._Round=function(){return(pC=e._Round=e.asm.Round).apply(null,arguments)},cC=e._Rsqrt=function(){return(cC=e._Rsqrt=e.asm.Rsqrt).apply(null,arguments)},lC=e._ScatterNd=function(){return(lC=e._ScatterNd=e.asm.ScatterNd).apply(null,arguments)},mC=e._SearchSorted=function(){return(mC=e._SearchSorted=e.asm.SearchSorted).apply(null,arguments)},dC=e._SelectV2=function(){return(dC=e._SelectV2=e.asm.SelectV2).apply(null,arguments)},fC=e._Selu=function(){return(fC=e._Selu=e.asm.Selu).apply(null,arguments)},hC=e._Sigmoid=function(){return(hC=e._Sigmoid=e.asm.Sigmoid).apply(null,arguments)},gC=e._Sign=function(){return(gC=e._Sign=e.asm.Sign).apply(null,arguments)},xC=e._Sin=function(){return(xC=e._Sin=e.asm.Sin).apply(null,arguments)},yC=e._Sinh=function(){return(yC=e._Sinh=e.asm.Sinh).apply(null,arguments)},bC=e._Softmax=function(){return(bC=e._Softmax=e.asm.Softmax).apply(null,arguments)},CC=e._Softplus=function(){return(CC=e._Softplus=e.asm.Softplus).apply(null,arguments)},wC=e._SparseFillEmptyRows=function(){return(wC=e._SparseFillEmptyRows=e.asm.SparseFillEmptyRows).apply(null,arguments)},SC=e._SparseReshape=function(){return(SC=e._SparseReshape=e.asm.SparseReshape).apply(null,arguments)},IC=e._SparseSegmentReduction=function(){return(IC=e._SparseSegmentReduction=e.asm.SparseSegmentReduction).apply(null,arguments)},vC=e._SparseToDense=function(){return(vC=e._SparseToDense=e.asm.SparseToDense).apply(null,arguments)},kC=e._Sqrt=function(){return(kC=e._Sqrt=e.asm.Sqrt).apply(null,arguments)},NC=e._Square=function(){return(NC=e._Square=e.asm.Square).apply(null,arguments)},TC=e._SquaredDifference=function(){return(TC=e._SquaredDifference=e.asm.SquaredDifference).apply(null,arguments)},_C=e._Step=function(){return(_C=e._Step=e.asm.Step).apply(null,arguments)},$C=e._StridedSlice=function(){return($C=e._StridedSlice=e.asm.StridedSlice).apply(null,arguments)},EC=e._Sub=function(){return(EC=e._Sub=e.asm.Sub).apply(null,arguments)},RC=e._Sum=function(){return(RC=e._Sum=e.asm.Sum).apply(null,arguments)},DC=e._Tan=function(){return(DC=e._Tan=e.asm.Tan).apply(null,arguments)},AC=e._Tanh=function(){return(AC=e._Tanh=e.asm.Tanh).apply(null,arguments)},FC=e._TensorScatterUpdate=function(){return(FC=e._TensorScatterUpdate=e.asm.TensorScatterUpdate).apply(null,arguments)},PC=e._Tile=function(){return(PC=e._Tile=e.asm.Tile).apply(null,arguments)},OC=e._TopK=function(){return(OC=e._TopK=e.asm.TopK).apply(null,arguments)},MC=e._Transform=function(){return(MC=e._Transform=e.asm.Transform).apply(null,arguments)},LC=e._Transpose=function(){return(LC=e._Transpose=e.asm.Transpose).apply(null,arguments)},BC=e.__FusedMatMul=function(){return(BC=e.__FusedMatMul=e.asm._FusedMatMul).apply(null,arguments)},zC=e._malloc=function(){return(zC=e._malloc=e.asm.malloc).apply(null,arguments)},VC=e._free=function(){return(VC=e._free=e.asm.free).apply(null,arguments)},WC=e.___errno_location=function(){return(WC=e.___errno_location=e.asm.__errno_location).apply(null,arguments)},Pm=e.stackSave=function(){return(Pm=e.stackSave=e.asm.stackSave).apply(null,arguments)},Om=e.stackRestore=function(){return(Om=e.stackRestore=e.asm.stackRestore).apply(null,arguments)},ul=e.stackAlloc=function(){return(ul=e.stackAlloc=e.asm.stackAlloc).apply(null,arguments)},UC=e.dynCall_iijjiiii=function(){return(UC=e.dynCall_iijjiiii=e.asm.dynCall_iijjiiii).apply(null,arguments)},GC=e.dynCall_jiji=function(){return(GC=e.dynCall_jiji=e.asm.dynCall_jiji).apply(null,arguments)};e.cwrap=vy;var Fp;nr=function K(){Fp||Mm(),Fp||(nr=K)};function Mm(K){if(K=K||i,Tt>0||(ht(),Tt>0))return;function ae(){Fp||(Fp=!0,e.calledRun=!0,!M&&(gt(),o(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),Mr()))}e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),ae()},1)):ae()}if(e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();Mm();var Pp;s&&(Pp={uncaughtException:process.listeners("uncaughtException").filter(function(K){return!s.uncaughtException.indexOf(K)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(K){return!s.unhandledRejection.indexOf(K)>-1})});var Op;if(typeof t!="undefined")Op=t;else if(typeof WasmBackendModuleThreadedSimd!="undefined")Op=WasmBackendModuleThreadedSimd;else throw new Error("Could not find wasm module in post.js");if(Pp){var HC=Op._dispose;Op._dispose=function(){HC(),Pp.uncaughtException.forEach(function(K){process.removeListener("uncaughtException",K)}),Pp.unhandledRejection.forEach(function(K){process.removeListener("unhandledRejection",K)})}}return t.ready}})();typeof Wg=="object"&&typeof Hv=="object"?Hv.exports=Gv:typeof define=="function"&&define.amd?define([],function(){return Gv}):typeof Wg=="object"&&(Wg.WasmBackendModule=Gv)});var Bo=class{constructor(t,e){this.backend=t,this.dataMover=e,this.data=new WeakMap,this.dataIdsCount=0}get(t){return this.data.has(t)||this.dataMover.moveData(this.backend,t),this.data.get(t)}set(t,e){this.dataIdsCount++,this.data.set(t,e)}has(t){return this.data.has(t)}delete(t){return this.dataIdsCount--,this.data.delete(t)}numDataIds(){return this.dataIdsCount}},so=class{refCount(t){return Br("refCount")}incRef(t){return Br("incRef")}timerAvailable(){return!0}time(t){return Br("time")}read(t){return Br("read")}readSync(t){return Br("readSync")}readToGPU(t,e){return Br("readToGPU")}numDataIds(){return Br("numDataIds")}disposeData(t,e){return Br("disposeData")}write(t,e,o){return Br("write")}move(t,e,o,n,s){return Br("move")}createTensorFromGPUData(t,e,o){return Br("createTensorFromGPUData")}memory(){return Br("memory")}floatPrecision(){return Br("floatPrecision")}epsilon(){return this.floatPrecision()===32?1e-7:1e-4}dispose(){return Br("dispose")}};function Br(r){throw new Error(`'${r}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function v0(r){let t=r.length,e=0;for(;t>0;)e=Math.random()*t|0,t--,Km(r,t,e)}function _G(r,t){if(r.length!==t.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${r.length}Second array length was ${t.length}`);let e=r.length,o=0;for(;e>0;)o=Math.random()*e|0,e--,Km(r,e,o),Km(t,e,o)}function Bp(r,t,e){return Math.max(r,Math.min(t,e))}function $G(r){return r%2===0?r:r+1}function Km(r,t,e){let o=r[t];r[t]=r[e],r[e]=o}function EG(r){let t=0;for(let e=0;ee+` Shapes ${r} and ${t} must match`)}function ao(r){$(r!=null,()=>"The input to the tensor constructor must be a non-null value.")}function He(r){if(r.length===0)return 1;let t=r[0];for(let e=1;e0,e,o){return new Promise((n,s)=>{let a=0,i=()=>{if(r()){n();return}a++;let p=t(a);if(e!=null&&a>=e){s();return}o!=null?o(i,p):setTimeout(i,p)};i()})}function LG(r,t){let e=1,o=-1;for(let s=0;s=0)e*=r[s];else if(r[s]===-1){if(o!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${o} and dim ${s}`);o=s}else if(r[s]<0)throw Error(`Shapes can not be < 0. Found ${r[s]} at dim ${s}`);if(o===-1){if(t>0&&t!==e)throw Error(`Size(${t}) must match the product of shape ${r}`);return r}if(e===0)throw Error(`Cannot infer the missing size in [${r}] when there are 0 elements`);if(t%e!==0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${e}`);let n=r.slice();return n[o]=t/e,n}function Ti(r,t){let e=t.length;return r=r==null?t.map((o,n)=>n):[].concat(r),$(r.every(o=>o>=-e&&o`All values in axis param must be in range [-${e}, ${e}) but got axis ${r}`),$(r.every(o=>Ka(o)),()=>`All values in axis param must be integers but got axis ${r}`),r.map(o=>o<0?e+o:o)}function ZC(r,t){let e=[],o=[],n=t!=null&&Array.isArray(t)&&t.length===0,s=t==null||n?null:Ti(t,r).sort(),a=0;for(let i=0;ii)&&r[i]===1&&(e.push(r[i]),o.push(i)),s[a]<=i&&a++}r[i]!==1&&(e.push(r[i]),o.push(i))}return{newShape:e,keptDims:o}}function JC(r,t){return qm(r,t)}function qm(r,t){let e=null;if(r==null||r==="float32")e=new Float32Array(t);else if(r==="int32")e=new Int32Array(t);else if(r==="bool")e=new Uint8Array(t);else if(r==="string")e=new Array(t);else throw new Error(`Unknown data type ${r}`);return e}function ew(r,t){for(let e=0;et+=e.length),t}function zo(r){return typeof r=="string"||r instanceof String}function k0(r){return typeof r=="boolean"}function N0(r){return typeof r=="number"}function _i(r){return Array.isArray(r)?_i(r[0]):r instanceof Float32Array?"float32":r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray?"int32":N0(r)?"float32":zo(r)?"string":k0(r)?"bool":"float32"}function qs(r){return!!(r&&r.constructor&&r.call&&r.apply)}function Vp(r,t){for(let e=t;e=0;--o)e[o]=e[o+1]*r[o+1];return e}function T0(r,t,e,o=!1){let n=new Array;if(t.length===1){let s=t[0]*(o?2:1);for(let a=0;ap*u)*(o?2:1);for(let p=0;pn*s)*(e?2:1);if(o===0)return[];if(o!==t.length)throw new Error(`[${r}] does not match the input size ${t.length}${e?" for a complex tensor":""}.`);return T0(0,r,t,e)}function zG(r,t){if(Array.isArray(r))return r;if(t==="float32")return r instanceof Float32Array?r:new Float32Array(r);if(t==="int32")return r instanceof Int32Array?r:new Int32Array(r);if(t==="bool"||t==="string")return Uint8Array.from(new Int32Array(r));throw new Error(`Unknown dtype ${t}`)}function cl(r,t){let e=Wp(r,t);for(let o=0;oo*n,1);if(t==null||t==="float32")return ku(r,new Float32Array(e));if(t==="int32")return ku(r,new Int32Array(e));if(t==="bool")return ku(r,new Uint8Array(e));throw new Error(`Unknown data type ${t}`)}function Ct(r){r.forEach(t=>{$(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${r}].`)})}function WG(r,t,e){if(t===0)return 0;if(t===1)return r[0];let o=r[r.length-1];for(let n=0;n{let[n,s]=o.split(":");this.urlFlags[n]=qG(n,s)})}};function HG(r){let t={};return r.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(e,...o)=>(KG(t,o[0],o[1]),o.join("="))),t}function KG(r,t,e){r[decodeURIComponent(t)]=decodeURIComponent(e||"")}function qG(r,t){let e=t.toLowerCase();return e==="true"||e==="false"?e==="true":`${+e}`===e?+e:t}function A(){return ow}var ow=null;function $0(r){ow=r}var nw;function sw(){if(nw==null){let r;if(typeof window!="undefined")r=window;else if(typeof global!="undefined")r=global;else if(typeof process!="undefined")r=process;else if(typeof self!="undefined")r=self;else throw new Error("Could not find a global object");nw=r}return nw}function jG(){let r=sw();return r._tfGlobals==null&&(r._tfGlobals=new Map),r._tfGlobals}function ml(r,t){let e=jG();if(e.has(r))return e.get(r);{let o=t();return e.set(r,o),e.get(r)}}var Xs="Abs",Vo="Acos",Wo="Acosh",io="Add",Uo="AddN",Go="All",Ho="Any",Ys="ArgMax",Qs="ArgMin",Ko="Asin",qo="Asinh",jo="Atan",Xo="Atanh",Yo="Atan2",Qo="AvgPool",$i="AvgPoolGrad",Zs="AvgPool3D",Ei="AvgPool3DGrad",Zo="BatchMatMul",Js="BatchToSpaceND",Jo="Bincount",qa="BitwiseAnd",Bce="BroadcastTo",ea="BroadcastArgs",yo="Cast",en="Ceil",bo="ClipByValue",Ri="Complex",Di="ComplexAbs",ta="Concat",tn="Conv2D",Ai="Conv2DBackpropFilter",rn="Conv2DBackpropInput",on="Conv3D",ja="Conv3DBackpropFilterV2",nn="Conv3DBackpropInputV2",sn="Cos",an="Cosh",un="Cumprod",pn="Cumsum",cn="CropAndResize",ra="DenseBincount",ln="DepthToSpace",mn="DepthwiseConv2dNative",Fi="DepthwiseConv2dNativeBackpropFilter",Pi="DepthwiseConv2dNativeBackpropInput",oa="Diag",dn="Dilation2D",Oi="Dilation2DBackpropInput",Mi="Dilation2DBackpropFilter",_u="Draw",fn="RealDiv",Li="Einsum",hn="Elu",Xa="EluGrad",gn="Erf",xn="Equal",yn="Exp",na="ExpandDims",bn="Expm1",Bi="FFT",sa="Fill",Cn="FlipLeftRight",wn="Floor",Sn="FloorDiv",In="FusedBatchNorm",aa="GatherV2",vn="GatherNd",kn="Greater",Nn="GreaterEqual",Co="Identity",zi="IFFT",Vi="Imag",Tn="IsFinite",_n="IsInf",$n="IsNan",En="LeakyRelu",Rn="Less",Dn="LessEqual",An="LinSpace",Fn="Log",Pn="Log1p",On="LogicalAnd",Mn="LogicalNot",Ln="LogicalOr",E0="LogicalXor",zce="LogSoftmax",Vce="LowerBound",Bn="LRN",Ya="LRNGrad",Wce="MatrixBandPart",zn="Max",Vn="Maximum",Wn="MaxPool",Wi="MaxPoolGrad",ia="MaxPool3D",Ui="MaxPool3DGrad",ua="MaxPoolWithArgmax",Un="Mean",Gn="Min",Hn="Minimum",Kn="MirrorPad",qn="Mod",jn="Multinomial",Xn="Multiply",pa="Neg",Yn="NotEqual",Qn="NonMaxSuppressionV3",Qa="NonMaxSuppressionV4",Zn="NonMaxSuppressionV5",ca="OnesLike",Jn="OneHot",la="Pack",es="PadV2",Uce="Pool",ts="Pow",rs="Prelu",os="Prod",Up="RaggedGather",Gp="RaggedRange",Hp="RaggedTensorToTensor",ma="Range",Gi="Real",ns="Reciprocal",ss="Relu",da="Reshape",as="ResizeNearestNeighbor",Za="ResizeNearestNeighborGrad",is="ResizeBilinear",Ja="ResizeBilinearGrad",us="Relu6",ps="Reverse",cs="Round",ls="Rsqrt",ms="ScatterNd",ds="TensorScatterUpdate",fs="SearchSorted",fa="Select",hs="Selu",ha="Slice",gs="Sin",xs="Sinh",ys="Sign",bs="Sigmoid",Cs="Softplus",ws="Sqrt",Ss="Sum",ga="SpaceToBatchND",xa="SplitV",Is="Softmax",Hi="SparseFillEmptyRows",ei="SparseReshape",ya="SparseSegmentMean",ba="SparseSegmentSum",vs="SparseToDense",ks="SquaredDifference",Ki="Square",$u="StaticRegexReplace",Ns="StridedSlice",Ca="StringNGrams",qi="StringSplit",ji="StringToHashBucketFast",Ts="Sub",_s="Tan",$s="Tanh",uo="Tile",Es="TopK",Rs="Transform",po="Transpose",Xi="Unique",wa="Unpack",Yi="UnsortedSegmentSum",Gce="UpperBound",Sa="ZerosLike",wo="Step",Eu="FromPixels",Ds="RotateWithOffset",So="_FusedMatMul",Io="FusedConv2D",vo="FusedDepthwiseConv2D";function Ia(...r){A().getBool("IS_TEST")||A().getBool("PROD")||console.warn(...r)}function XG(...r){A().getBool("IS_TEST")||A().getBool("PROD")||console.log(...r)}var Kp=ml("kernelRegistry",()=>new Map),dl=ml("gradRegistry",()=>new Map);function qp(r,t){let e=iw(r,t);return Kp.get(e)}function aw(r){return dl.get(r)}function jm(r){let t=Kp.entries(),e=[];for(;;){let{done:o,value:n}=t.next();if(o)break;let[s,a]=n,[i]=s.split("_");i===r&&e.push(a)}return e}function ti(r){let{kernelName:t,backendName:e}=r,o=iw(t,e);Kp.has(o)&&Ia(`The kernel '${t}' for backend '${e}' is already registered`),Kp.set(o,r)}function Xce(r){let{kernelName:t}=r;dl.has(t)&&A().getBool("DEBUG")&&Ia(`Overriding the gradient for '${t}'`),dl.set(t,r)}function Yce(r,t){let e=iw(r,t);if(!Kp.has(e))throw new Error(`The kernel '${r}' for backend '${t}' is not registered`);Kp.delete(e)}function Qce(r){if(!dl.has(r))throw new Error(`The gradient '${r}' for backend is not registered`);dl.delete(r)}function Zce(r,t){jm(r).forEach(o=>{let n=Object.assign({},o,{backendName:t});ti(n)})}function iw(r,t){return`${t}_${r}`}var y={};qe(y,{arraysEqual:()=>br,arraysEqualWithNull:()=>QC,assert:()=>$,assertNonNegativeIntegerDimensions:()=>Ct,assertNonNull:()=>ao,assertShapesMatch:()=>xt,bytesFromStringArray:()=>rw,bytesPerElement:()=>zp,checkConversionForErrors:()=>ew,clamp:()=>Bp,computeStrides:()=>js,convertBackendValuesAndArrayBuffer:()=>zG,createScalarValue:()=>r4,createShuffledIndices:()=>OG,decodeString:()=>Qp,distSquared:()=>DG,encodeString:()=>Zi,fetch:()=>n4,fingerPrint64:()=>t4,flatten:()=>Fs,getArrayFromDType:()=>qm,getTypedArrayFromDType:()=>JC,hasEncodingLoss:()=>BG,hexToLong:()=>fl,indexToLoc:()=>UG,inferDtype:()=>_i,inferFromImplicitShape:()=>LG,isBoolean:()=>k0,isFunction:()=>qs,isInt:()=>Ka,isNumber:()=>N0,isPromise:()=>Tu,isScalarShape:()=>AG,isString:()=>zo,isTypedArray:()=>Pt,isValidDtype:()=>tw,locToIndex:()=>WG,makeOnesTypedArray:()=>cl,makeZerosNestedTypedArray:()=>VG,makeZerosTypedArray:()=>Wp,nearestDivisor:()=>Vp,nearestLargerEven:()=>$G,now:()=>Pu,parseAxisParam:()=>Ti,randUniform:()=>RG,repeatedTry:()=>MG,rightPad:()=>Nu,shuffle:()=>v0,shuffleCombo:()=>_G,sizeFromShape:()=>He,sizeToSquarishShape:()=>PG,squeezeShape:()=>ZC,sum:()=>EG,swap:()=>Km,tanh:()=>FG,toNestedArray:()=>ku,toTypedArray:()=>Yp});function Xm(r){return r instanceof Float32Array||r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray}var lw=Lp(W0());var Fu=lw.default||lw;function fl(r){return Fu.fromString(r,!0,16)}var G0=fl("c3a5c85c97cb3127"),Au=fl("b492b66fbe98f273"),Cr=fl("9ae16a3b2f90404f");function cw(r){return r.xor(r.shru(47))}function H0(r,t,e){let o=r.slice(t,t+e);return Fu.fromBytes(Array.from(o),!0,!0)}function wt(r,t){return H0(r,t,8)}function U0(r,t){return H0(r,t,4)}function Yt(r,t){return t===0?r:r.shru(t).or(r.shl(64-t))}function Qi(r,t,e=fl("9ddfea08eb382d69")){let o=r.xor(t).mul(e);o=o.xor(o.shru(47));let n=t.xor(o).mul(e);return n=n.xor(n.shru(47)),n=n.mul(e),n}function QG(r,t,e,o,n,s){n=n.add(r),s=Yt(s.add(n).add(o),21);let a=n;return n=n.add(t),n=n.add(e),s=s.add(Yt(n,44)),[n.add(o),s.add(a)]}function Qm(r,t,e,o){return QG(wt(r,t),wt(r,t+8),wt(r,t+16),wt(r,t+24),e,o)}function ZG(r,t=r.length){if(t>=8){let e=Cr.add(t*2),o=wt(r,0).add(Cr),n=wt(r,t-8),s=Yt(n,37).mul(e).add(o),a=Yt(o,25).add(n).mul(e);return Qi(s,a,e)}if(t>=4){let e=Cr.add(t*2),o=U0(r,0);return Qi(o.shl(3).add(t),U0(r,t-4),e)}if(t>0){let e=r[0],o=r[t>>1],n=r[t-1],s=e+(o<<8),a=t+(n<<2);return cw(Cr.mul(s).xor(G0.mul(a))).mul(Cr)}return Cr}function JG(r,t=r.length){let e=Cr.add(t*2),o=wt(r,0).mul(Au),n=wt(r,8),s=wt(r,t-8).mul(e),a=wt(r,t-16).mul(Cr);return Qi(Yt(o.add(n),43).add(Yt(s,30)).add(a),o.add(Yt(n.add(Cr),18)).add(s),e)}function e4(r,t=r.length){let e=Cr.add(t*2),o=wt(r,0).mul(Cr),n=wt(r,8),s=wt(r,t-8).mul(e),a=wt(r,t-16).mul(Cr),i=Yt(o.add(n),43).add(Yt(s,30)).add(a),p=Qi(i,o.add(Yt(n.add(Cr),18)).add(s),e),u=wt(r,16).mul(e),c=wt(r,24),l=i.add(wt(r,t-32)).mul(e),m=p.add(wt(r,t-24)).mul(e);return Qi(Yt(u.add(c),43).add(Yt(l,30)).add(m),u.add(Yt(c.add(o),18)).add(l),e)}function t4(r,t=r.length){let e=Fu.fromNumber(81,!0);if(t<=32)return t<=16?ZG(r,t):JG(r,t);if(t<=64)return e4(r,t);let o=e,n=e.mul(Au).add(113),s=cw(n.mul(Cr).add(113)).mul(Cr),a=[Fu.UZERO,Fu.UZERO],i=[Fu.UZERO,Fu.UZERO];o=o.mul(Cr).add(wt(r,0));let p=0,u=(t-1>>6)*64,c=u+(t-1&63)-63;do o=Yt(o.add(n).add(a[0]).add(wt(r,p+8)),37).mul(Au),n=Yt(n.add(a[1]).add(wt(r,p+48)),42).mul(Au),o=o.xor(i[1]),n=n.add(a[0]).add(wt(r,p+40)),s=Yt(s.add(i[0]),33).mul(Au),a=Qm(r,p,a[1].mul(Au),o.add(i[0])),i=Qm(r,p+32,s.add(i[1]),n.add(wt(r,p+16))),[s,o]=[o,s],p+=64;while(p!==u);let l=Au.add(s.and(255).shl(1));return p=c,i[0]=i[0].add(t-1&63),a[0]=a[0].add(i[0]),i[0]=i[0].add(a[0]),o=Yt(o.add(n).add(a[0]).add(wt(r,p+8)),37).mul(l),n=Yt(n.add(a[1]).add(wt(r,p+48)),42).mul(l),o=o.xor(i[1].mul(9)),n=n.add(a[0].mul(9).add(wt(r,p+40))),s=Yt(s.add(i[0]),33).mul(l),a=Qm(r,p,a[1].mul(l),o.add(i[0])),i=Qm(r,p+32,s.add(i[1]),n.add(wt(r,p+16))),[s,o]=[o,s],Qi(Qi(a[0],i[0],l).add(cw(n).mul(G0)).add(s),Qi(a[1],i[1],l).add(o),l)}function r4(r,t){return t==="string"?Zi(r):Yp([r],t)}function o4(r,t){return r instanceof Float32Array&&t==="float32"||r instanceof Int32Array&&t==="int32"||r instanceof Uint8Array&&t==="bool"}function Yp(r,t){if(t==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(r)&&(r=Fs(r)),A().getBool("DEBUG")&&ew(r,t),o4(r,t))return r;if(t==null||t==="float32"||t==="complex64")return new Float32Array(r);if(t==="int32")return new Int32Array(r);if(t==="bool"){let e=new Uint8Array(r.length);for(let o=0;o{n=o()},a,i=Pu();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(s);else{s();for(let u of n)u.dataSync();a=Promise.resolve({kernelMs:Pu()-i})}if(A().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let u=0;u{s4(l,c.dtype,t)})}return{kernelName:t,outputs:n,inputs:e,timeMs:a.then(u=>u.kernelMs),extraInfo:a.then(u=>u.getExtraProfileInfo!=null?u.getExtraProfileInfo():"")}}logKernelProfile(t){let{kernelName:e,outputs:o,timeMs:n,inputs:s,extraInfo:a}=t;o.forEach(i=>{Promise.all([i.data(),n,a]).then(p=>{this.logger.logKernelProfile(e,i,p[0],p[1],s,p[2])})})}};function s4(r,t,e){if(t!=="float32")return!1;for(let o=0;o0?h:""} `}}console.log(`%c${p} %c${i} %c${u}D ${l} %c${c} %c${m} %c${a}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function K0(r,t,e){let o={},n={};for(let p=0;po[h.id]=!0),d=!0,n[u.id]=!0;break}if(d)break}}let s={};s[e.id]=!0;let a={};for(let p=r.length-1;p>=0;p--){let u=r[p],c=u.inputs;for(let l=0;l=0;n--){let s=t[n],a=[];if(s.outputs.forEach(p=>{let u=r[p.id];u!=null?a.push(u):a.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let i=s.gradient(a);for(let p in s.inputs){if(!(p in i))throw new Error(`Cannot backprop through input ${p}. Available gradients found: ${Object.keys(i)}.`);let u=e(()=>i[p]());if(u.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${p} must have 'float32' dtype, but has '${u.dtype}'`);let c=s.inputs[p];if(!br(u.shape,c.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${p}' has shape '${u.shape}', which does not match the shape of the input '${c.shape}'`);if(r[c.id]==null)r[c.id]=u;else{let l=r[c.id];r[c.id]=o(l,u),l.dispose()}}}}var j0=20,hl=3,dw=7;function X0(r,t,e,o){let n=js(t),s=a4(r,t,e,n),a=t.length,i=Jm(r,t,e,n,s),p=["Tensor"];return o&&(p.push(` dtype: ${e}`),p.push(` rank: ${a}`),p.push(` shape: [${t}]`),p.push(" values:")),p.push(i.map(u=>" "+u).join(` +var q4=Object.create;var lw=Object.defineProperty;var j4=Object.getOwnPropertyDescriptor;var X4=Object.getOwnPropertyNames;var Y4=Object.getPrototypeOf,Q4=Object.prototype.hasOwnProperty;var jt=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),qe=(r,e)=>{for(var t in e)lw(r,t,{get:e[t],enumerable:!0})},Z4=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of X4(e))!Q4.call(r,n)&&n!==t&&lw(r,n,{get:()=>e[n],enumerable:!(o=j4(e,n))||o.enumerable});return r};var Kp=(r,e,t)=>(t=r!=null?q4(Y4(r)):{},Z4(e||!r||!r.__esModule?lw(t,"default",{value:r,enumerable:!0}):t,r));var _k=jt((Lme,Tk)=>{Tk.exports=Tt;var Yo=null;try{Yo=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(r){}function Tt(r,e,t){this.low=r|0,this.high=e|0,this.unsigned=!!t}Tt.prototype.__isLong__;Object.defineProperty(Tt.prototype,"__isLong__",{value:!0});function jr(r){return(r&&r.__isLong__)===!0}Tt.isLong=jr;var yk={},bk={};function zu(r,e){var t,o,n;return e?(r>>>=0,(n=0<=r&&r<256)&&(o=bk[r],o)?o:(t=_t(r,(r|0)<0?-1:0,!0),n&&(bk[r]=t),t)):(r|=0,(n=-128<=r&&r<128)&&(o=yk[r],o)?o:(t=_t(r,r<0?-1:0,!1),n&&(yk[r]=t),t))}Tt.fromInt=zu;function Qo(r,e){if(isNaN(r))return e?Bu:Zo;if(e){if(r<0)return Bu;if(r>=Ik)return Nk}else{if(r<=-wk)return qr;if(r+1>=wk)return kk}return r<0?Qo(-r,e).neg():_t(r%ol|0,r/ol|0,e)}Tt.fromNumber=Qo;function _t(r,e,t){return new Tt(r,e,t)}Tt.fromBits=_t;var ud=Math.pow;function Iw(r,e,t){if(r.length===0)throw Error("empty string");if(r==="NaN"||r==="Infinity"||r==="+Infinity"||r==="-Infinity")return Zo;if(typeof e=="number"?(t=e,e=!1):e=!!e,t=t||10,t<2||360)throw Error("interior hyphen");if(o===0)return Iw(r.substring(1),e,t).neg();for(var n=Qo(ud(t,8)),s=Zo,a=0;a>>0:this.low};de.toNumber=function(){return this.unsigned?(this.high>>>0)*ol+(this.low>>>0):this.high*ol+(this.low>>>0)};de.toString=function(e){if(e=e||10,e<2||36>>0,l=u.toString(e);if(a=p,a.isZero())return l+i;for(;l.length<6;)l="0"+l;i=""+l+i}};de.getHighBits=function(){return this.high};de.getHighBitsUnsigned=function(){return this.high>>>0};de.getLowBits=function(){return this.low};de.getLowBitsUnsigned=function(){return this.low>>>0};de.getNumBitsAbs=function(){if(this.isNegative())return this.eq(qr)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,t=31;t>0&&!(e&1<=0};de.isOdd=function(){return(this.low&1)===1};de.isEven=function(){return(this.low&1)===0};de.equals=function(e){return jr(e)||(e=Ws(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};de.eq=de.equals;de.notEquals=function(e){return!this.eq(e)};de.neq=de.notEquals;de.ne=de.notEquals;de.lessThan=function(e){return this.comp(e)<0};de.lt=de.lessThan;de.lessThanOrEqual=function(e){return this.comp(e)<=0};de.lte=de.lessThanOrEqual;de.le=de.lessThanOrEqual;de.greaterThan=function(e){return this.comp(e)>0};de.gt=de.greaterThan;de.greaterThanOrEqual=function(e){return this.comp(e)>=0};de.gte=de.greaterThanOrEqual;de.ge=de.greaterThanOrEqual;de.compare=function(e){if(jr(e)||(e=Ws(e)),this.eq(e))return 0;var t=this.isNegative(),o=e.isNegative();return t&&!o?-1:!t&&o?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};de.comp=de.compare;de.negate=function(){return!this.unsigned&&this.eq(qr)?qr:this.not().add(rl)};de.neg=de.negate;de.add=function(e){jr(e)||(e=Ws(e));var t=this.high>>>16,o=this.high&65535,n=this.low>>>16,s=this.low&65535,a=e.high>>>16,i=e.high&65535,p=e.low>>>16,u=e.low&65535,l=0,c=0,m=0,d=0;return d+=s+u,m+=d>>>16,d&=65535,m+=n+p,c+=m>>>16,m&=65535,c+=o+i,l+=c>>>16,c&=65535,l+=t+a,l&=65535,_t(m<<16|d,l<<16|c,this.unsigned)};de.subtract=function(e){return jr(e)||(e=Ws(e)),this.add(e.neg())};de.sub=de.subtract;de.multiply=function(e){if(this.isZero())return Zo;if(jr(e)||(e=Ws(e)),Yo){var t=Yo.mul(this.low,this.high,e.low,e.high);return _t(t,Yo.get_high(),this.unsigned)}if(e.isZero())return Zo;if(this.eq(qr))return e.isOdd()?qr:Zo;if(e.eq(qr))return this.isOdd()?qr:Zo;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Sk)&&e.lt(Sk))return Qo(this.toNumber()*e.toNumber(),this.unsigned);var o=this.high>>>16,n=this.high&65535,s=this.low>>>16,a=this.low&65535,i=e.high>>>16,p=e.high&65535,u=e.low>>>16,l=e.low&65535,c=0,m=0,d=0,f=0;return f+=a*l,d+=f>>>16,f&=65535,d+=s*l,m+=d>>>16,d&=65535,d+=a*u,m+=d>>>16,d&=65535,m+=n*l,c+=m>>>16,m&=65535,m+=s*u,c+=m>>>16,m&=65535,m+=a*p,c+=m>>>16,m&=65535,c+=o*l+n*u+s*p+a*i,c&=65535,_t(d<<16|f,c<<16|m,this.unsigned)};de.mul=de.multiply;de.divide=function(e){if(jr(e)||(e=Ws(e)),e.isZero())throw Error("division by zero");if(Yo){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var t=(this.unsigned?Yo.div_u:Yo.div_s)(this.low,this.high,e.low,e.high);return _t(t,Yo.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Bu:Zo;var o,n,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Bu;if(e.gt(this.shru(1)))return vk;s=Bu}else{if(this.eq(qr)){if(e.eq(rl)||e.eq(Sw))return qr;if(e.eq(qr))return rl;var a=this.shr(1);return o=a.div(e).shl(1),o.eq(Zo)?e.isNegative()?rl:Sw:(n=this.sub(e.mul(o)),s=o.add(n.div(e)),s)}else if(e.eq(qr))return this.unsigned?Bu:Zo;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=Zo}for(n=this;n.gte(e);){o=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(o)/Math.LN2),p=i<=48?1:ud(2,i-48),u=Qo(o),l=u.mul(e);l.isNegative()||l.gt(n);)o-=p,u=Qo(o,this.unsigned),l=u.mul(e);u.isZero()&&(u=rl),s=s.add(u),n=n.sub(l)}return s};de.div=de.divide;de.modulo=function(e){if(jr(e)||(e=Ws(e)),Yo){var t=(this.unsigned?Yo.rem_u:Yo.rem_s)(this.low,this.high,e.low,e.high);return _t(t,Yo.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};de.mod=de.modulo;de.rem=de.modulo;de.not=function(){return _t(~this.low,~this.high,this.unsigned)};de.and=function(e){return jr(e)||(e=Ws(e)),_t(this.low&e.low,this.high&e.high,this.unsigned)};de.or=function(e){return jr(e)||(e=Ws(e)),_t(this.low|e.low,this.high|e.high,this.unsigned)};de.xor=function(e){return jr(e)||(e=Ws(e)),_t(this.low^e.low,this.high^e.high,this.unsigned)};de.shiftLeft=function(e){return jr(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?_t(this.low<>>32-e,this.unsigned):_t(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):_t(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};de.shr=de.shiftRight;de.shiftRightUnsigned=function(e){if(jr(e)&&(e=e.toInt()),e&=63,e===0)return this;var t=this.high;if(e<32){var o=this.low;return _t(o>>>e|t<<32-e,t>>>e,this.unsigned)}else return e===32?_t(t,0,this.unsigned):_t(t>>>e-32,0,this.unsigned)};de.shru=de.shiftRightUnsigned;de.shr_u=de.shiftRightUnsigned;de.toSigned=function(){return this.unsigned?_t(this.low,this.high,!1):this};de.toUnsigned=function(){return this.unsigned?this:_t(this.low,this.high,!0)};de.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};de.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};de.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};Tt.fromBytes=function(e,t,o){return o?Tt.fromBytesLE(e,t):Tt.fromBytesBE(e,t)};Tt.fromBytesLE=function(e,t){return new Tt(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)};Tt.fromBytesBE=function(e,t){return new Tt(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}});var f1=jt(()=>{});var h1=jt(()=>{});var W2=jt((V2,tS)=>{(function(r,e,t){function o(i){var p=this,u=a();p.next=function(){var l=2091639*p.s0+p.c*23283064365386963e-26;return p.s0=p.s1,p.s1=p.s2,p.s2=l-(p.c=l|0)},p.c=1,p.s0=u(" "),p.s1=u(" "),p.s2=u(" "),p.s0-=u(i),p.s0<0&&(p.s0+=1),p.s1-=u(i),p.s1<0&&(p.s1+=1),p.s2-=u(i),p.s2<0&&(p.s2+=1),u=null}function n(i,p){return p.c=i.c,p.s0=i.s0,p.s1=i.s1,p.s2=i.s2,p}function s(i,p){var u=new o(i),l=p&&p.state,c=u.next;return c.int32=function(){return u.next()*4294967296|0},c.double=function(){return c()+(c()*2097152|0)*11102230246251565e-32},c.quick=c,l&&(typeof l=="object"&&n(l,u),c.state=function(){return n(u,{})}),c}function a(){var i=4022871197,p=function(u){u=String(u);for(var l=0;l>>0,c-=i,c*=i,i=c>>>0,c-=i,i+=c*4294967296}return(i>>>0)*23283064365386963e-26};return p}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.alea=s})(V2,typeof tS=="object"&&tS,typeof define=="function"&&define)});var G2=jt((U2,rS)=>{(function(r,e,t){function o(a){var i=this,p="";i.x=0,i.y=0,i.z=0,i.w=0,i.next=function(){var l=i.x^i.x<<11;return i.x=i.y,i.y=i.z,i.z=i.w,i.w^=i.w>>>19^l^l>>>8},a===(a|0)?i.x=a:p+=a;for(var u=0;u>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(typeof u=="object"&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xor128=s})(U2,typeof rS=="object"&&rS,typeof define=="function"&&define)});var K2=jt((H2,oS)=>{(function(r,e,t){function o(a){var i=this,p="";i.next=function(){var l=i.x^i.x>>>2;return i.x=i.y,i.y=i.z,i.z=i.w,i.w=i.v,(i.d=i.d+362437|0)+(i.v=i.v^i.v<<4^(l^l<<1))|0},i.x=0,i.y=0,i.z=0,i.w=0,i.v=0,a===(a|0)?i.x=a:p+=a;for(var u=0;u>>4),i.next()}function n(a,i){return i.x=a.x,i.y=a.y,i.z=a.z,i.w=a.w,i.v=a.v,i.d=a.d,i}function s(a,i){var p=new o(a),u=i&&i.state,l=function(){return(p.next()>>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(typeof u=="object"&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xorwow=s})(H2,typeof oS=="object"&&oS,typeof define=="function"&&define)});var j2=jt((q2,nS)=>{(function(r,e,t){function o(a){var i=this;i.next=function(){var u=i.x,l=i.i,c,m,d;return c=u[l],c^=c>>>7,m=c^c<<24,c=u[l+1&7],m^=c^c>>>10,c=u[l+3&7],m^=c^c>>>3,c=u[l+4&7],m^=c^c<<7,c=u[l+7&7],c=c^c<<13,m^=c^c<<9,u[l]=m,i.i=l+1&7,m};function p(u,l){var c,m,d=[];if(l===(l|0))m=d[0]=l;else for(l=""+l,c=0;c0;--c)u.next()}p(i,a)}function n(a,i){return i.x=a.x.slice(),i.i=a.i,i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,l=function(){return(p.next()>>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(u.x&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xorshift7=s})(q2,typeof nS=="object"&&nS,typeof define=="function"&&define)});var Y2=jt((X2,sS)=>{(function(r,e,t){function o(a){var i=this;i.next=function(){var u=i.w,l=i.X,c=i.i,m,d;return i.w=u=u+1640531527|0,d=l[c+34&127],m=l[c=c+1&127],d^=d<<13,m^=m<<17,d^=d>>>15,m^=m>>>12,d=l[c]=d^m,i.i=c,d+(u^u>>>16)|0};function p(u,l){var c,m,d,f,h,g=[],x=128;for(l===(l|0)?(m=l,l=null):(l=l+"\0",m=0,x=Math.max(x,l.length)),d=0,f=-32;f>>15,m^=m<<4,m^=m>>>13,f>=0&&(h=h+1640531527|0,c=g[f&127]^=m+h,d=c==0?d+1:0);for(d>=128&&(g[(l&&l.length||0)&127]=-1),d=127,f=4*128;f>0;--f)m=g[d+34&127],c=g[d=d+1&127],m^=m<<13,c^=c<<17,m^=m>>>15,c^=c>>>12,g[d]=m^c;u.w=h,u.X=g,u.i=d}p(i,a)}function n(a,i){return i.i=a.i,i.w=a.w,i.X=a.X.slice(),i}function s(a,i){a==null&&(a=+new Date);var p=new o(a),u=i&&i.state,l=function(){return(p.next()>>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(u.X&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.xor4096=s})(X2,typeof sS=="object"&&sS,typeof define=="function"&&define)});var Z2=jt((Q2,aS)=>{(function(r,e,t){function o(a){var i=this,p="";i.next=function(){var l=i.b,c=i.c,m=i.d,d=i.a;return l=l<<25^l>>>7^c,c=c-m|0,m=m<<24^m>>>8^d,d=d-l|0,i.b=l=l<<20^l>>>12^c,i.c=c=c-m|0,i.d=m<<16^c>>>16^d,i.a=d-l|0},i.a=0,i.b=0,i.c=-1640531527,i.d=1367130551,a===Math.floor(a)?(i.a=a/4294967296|0,i.b=a|0):p+=a;for(var u=0;u>>0)/4294967296};return l.double=function(){do var c=p.next()>>>11,m=(p.next()>>>0)/4294967296,d=(c+m)/(1<<21);while(d===0);return d},l.int32=p.next,l.quick=l,u&&(typeof u=="object"&&n(u,p),l.state=function(){return n(p,{})}),l}e&&e.exports?e.exports=s:t&&t.amd?t(function(){return s}):this.tychei=s})(Q2,typeof aS=="object"&&aS,typeof define=="function"&&define)});var J2=jt(()=>{});var tN=jt((eN,qd)=>{(function(r,e,t){var o=256,n=6,s=52,a="random",i=t.pow(o,n),p=t.pow(2,s),u=p*2,l=o-1,c;function m(w,S,k){var T=[];S=S==!0?{entropy:!0}:S||{};var E=g(h(S.entropy?[w,b(e)]:w==null?x():w,3),T),R=new d(T),D=function(){for(var F=R.g(n),O=i,M=0;F=u;)F/=2,O/=2,M>>>=1;return(F+M)/O};return D.int32=function(){return R.g(4)|0},D.quick=function(){return R.g(4)/4294967296},D.double=D,g(b(R.S),e),(S.pass||k||function(F,O,M,L){return L&&(L.S&&f(L,R),F.state=function(){return f(R,{})}),M?(t[a]=F,O):F})(D,E,"global"in S?S.global:this==t,S.state)}function d(w){var S,k=w.length,T=this,E=0,R=T.i=T.j=0,D=T.S=[];for(k||(w=[k++]);E{var Q6=W2(),Z6=G2(),J6=K2(),ej=j2(),tj=Y2(),rj=Z2(),Zu=tN();Zu.alea=Q6;Zu.xor128=Z6;Zu.xorwow=J6;Zu.xorshift7=ej;Zu.xor4096=tj;Zu.tychei=rj;rN.exports=Zu});var ev=jt(()=>{});var tv=jt(()=>{});var Iz=jt(()=>{});var vz=jt(()=>{});var kz=jt(()=>{});var Nz=jt((Jg,ov)=>{var rv=(()=>{var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(e){e=e||{};function t(){return oe.buffer!=Ke&&Et(oe.buffer),mt}function o(){return oe.buffer!=Ke&&Et(oe.buffer),ut}function n(){return oe.buffer!=Ke&&Et(oe.buffer),gt}function s(){return oe.buffer!=Ke&&Et(oe.buffer),Ur}function a(){return oe.buffer!=Ke&&Et(oe.buffer),Bt}function i(){return oe.buffer!=Ke&&Et(oe.buffer),io}function p(){return oe.buffer!=Ke&&Et(oe.buffer),sr}var u=typeof e!="undefined"?e:{},l,c;u.ready=new Promise(function(P,V){l=P,c=V});var m;typeof process!="undefined"&&process.listeners&&(m={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var d=Object.assign({},u),f=[],h="./this.program",g=(P,V)=>{throw V},x=typeof window=="object",b=typeof importScripts=="function",w=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",S=u.ENVIRONMENT_IS_PTHREAD||!1,k="";function T(P){return u.locateFile?u.locateFile(P,k):k+P}var E,R,D,F;function O(P){if(P instanceof Du)return;j("exiting due to exception: "+P)}if(w){var M=ev(),L=tv();b?k=L.dirname(k)+"/":k=__dirname+"/",E=(V,pe)=>(V=zp(V)?new URL(V):L.normalize(V),M.readFileSync(V,pe?void 0:"utf8")),D=V=>{var pe=E(V,!0);return pe.buffer||(pe=new Uint8Array(pe)),pe},R=(V,pe,$e)=>{V=zp(V)?new URL(V):L.normalize(V),M.readFile(V,function(Be,Le){Be?$e(Be):pe(Le.buffer)})},process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",function(V){if(!(V instanceof Du))throw V}),process.on("unhandledRejection",function(V){throw V}),g=(V,pe)=>{if(cn())throw process.exitCode=V,pe;O(pe),process.exit(V)},u.inspect=function(){return"[Emscripten Module object]"};let P;try{P=Iz()}catch(V){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),V}global.Worker=P.Worker}else(x||b)&&(b?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.replace(/[?#].*/,"").lastIndexOf("/")+1):k="",w||(E=P=>{var V=new XMLHttpRequest;return V.open("GET",P,!1),V.send(null),V.responseText},b&&(D=P=>{var V=new XMLHttpRequest;return V.open("GET",P,!1),V.responseType="arraybuffer",V.send(null),new Uint8Array(V.response)}),R=(P,V,pe)=>{var $e=new XMLHttpRequest;$e.open("GET",P,!0),$e.responseType="arraybuffer",$e.onload=()=>{if($e.status==200||$e.status==0&&$e.response){V($e.response);return}pe()},$e.onerror=pe,$e.send(null)}),F=P=>document.title=P);w&&typeof performance=="undefined"&&(global.performance=vz().performance);var B=console.log.bind(console),z=console.warn.bind(console);w&&(B=P=>M.writeSync(1,P+` +`),z=P=>M.writeSync(2,P+` +`));var U=u.print||B,j=u.printErr||z;Object.assign(u,d),d=null,u.arguments&&(f=u.arguments),u.thisProgram&&(h=u.thisProgram),u.quit&&(g=u.quit);var q=4,Y=Atomics.load,J=Atomics.store,re=Atomics.compareExchange,ne;u.wasmBinary&&(ne=u.wasmBinary);var ee=u.noExitRuntime||!0;typeof WebAssembly!="object"&&Ru("no native wasm support detected");var oe,ue,me=!1,be;function _e(P,V){P||Ru(V)}var ve=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function Fe(P,V,pe){V>>>=0;for(var $e=V+pe,Be=V;P[Be]&&!(Be>=$e);)++Be;if(Be-V>16&&P.buffer&&ve)return ve.decode(P.buffer instanceof SharedArrayBuffer?P.slice(V,Be):P.subarray(V,Be));for(var Le="";V>10,56320|co&1023)}}return Le}function Pe(P,V){return P>>>=0,P?Fe(o(),P,V):""}function at(P,V,pe,$e){if(pe>>>=0,!($e>0))return 0;for(var Be=pe,Le=pe+$e-1,ge=0;ge=55296&&Ne<=57343){var Ot=P.charCodeAt(++ge);Ne=65536+((Ne&1023)<<10)|Ot&1023}if(Ne<=127){if(pe>=Le)break;V[pe++>>>0]=Ne}else if(Ne<=2047){if(pe+1>=Le)break;V[pe++>>>0]=192|Ne>>6,V[pe++>>>0]=128|Ne&63}else if(Ne<=65535){if(pe+2>=Le)break;V[pe++>>>0]=224|Ne>>12,V[pe++>>>0]=128|Ne>>6&63,V[pe++>>>0]=128|Ne&63}else{if(pe+3>=Le)break;V[pe++>>>0]=240|Ne>>18,V[pe++>>>0]=128|Ne>>12&63,V[pe++>>>0]=128|Ne>>6&63,V[pe++>>>0]=128|Ne&63}}return V[pe>>>0]=0,pe-Be}function ct(P,V,pe){return at(P,o(),V,pe)}var Ke,mt,ut,gt,xt,Ur,Bt,io,sr;S&&(Ke=u.buffer);function Et(P){Ke=P,u.HEAP8=mt=new Int8Array(P),u.HEAP16=gt=new Int16Array(P),u.HEAP32=Ur=new Int32Array(P),u.HEAPU8=ut=new Uint8Array(P),u.HEAPU16=xt=new Uint16Array(P),u.HEAPU32=Bt=new Uint32Array(P),u.HEAPF32=io=new Float32Array(P),u.HEAPF64=sr=new Float64Array(P)}var ar=u.INITIAL_MEMORY||16777216;if(S)oe=u.wasmMemory,Ke=u.buffer;else if(u.wasmMemory)oe=u.wasmMemory;else if(oe=new WebAssembly.Memory({initial:ar/65536,maximum:65536,shared:!0}),!(oe.buffer instanceof SharedArrayBuffer))throw j("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"),w&&j("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)"),Error("bad memory");oe&&(Ke=oe.buffer),ar=Ke.byteLength,Et(Ke);var ir,uo=[],po=[],xr=[],ja=!1;function cn(){return ee}function ta(){if(u.preRun)for(typeof u.preRun=="function"&&(u.preRun=[u.preRun]);u.preRun.length;)lc(u.preRun.shift());dc(uo)}function Zt(){ja=!0,!S&&dc(po)}function Xa(){if(!S){if(u.postRun)for(typeof u.postRun=="function"&&(u.postRun=[u.postRun]);u.postRun.length;)Zv(u.postRun.shift());dc(xr)}}function lc(P){uo.unshift(P)}function cc(P){po.unshift(P)}function Zv(P){xr.unshift(P)}var Pi=0,Bp=null,Ya=null;function Ay(P){Pi++,u.monitorRunDependencies&&u.monitorRunDependencies(Pi)}function Rm(P){if(Pi--,u.monitorRunDependencies&&u.monitorRunDependencies(Pi),Pi==0&&(Bp!==null&&(clearInterval(Bp),Bp=null),Ya)){var V=Ya;Ya=null,V()}}function Ru(P){u.onAbort&&u.onAbort(P),P="Aborted("+P+")",j(P),me=!0,be=1,P+=". Build with -sASSERTIONS for more info.";var V=new WebAssembly.RuntimeError(P);throw c(V),V}var Fy="data:application/octet-stream;base64,";function Dm(P){return P.startsWith(Fy)}function zp(P){return P.startsWith("file://")}var yr;yr="tfjs-backend-wasm-threaded-simd.wasm",Dm(yr)||(yr=T(yr));function Am(P){try{if(P==yr&&ne)return new Uint8Array(ne);if(D)return D(P);throw"both async and sync fetching of the wasm failed"}catch(V){Ru(V)}}function Py(){if(!ne&&(x||b)){if(typeof fetch=="function"&&!zp(yr))return fetch(yr,{credentials:"same-origin"}).then(function(P){if(!P.ok)throw"failed to load wasm binary file at '"+yr+"'";return P.arrayBuffer()}).catch(function(){return Am(yr)});if(R)return new Promise(function(P,V){R(yr,function(pe){P(new Uint8Array(pe))},V)})}return Promise.resolve().then(function(){return Am(yr)})}function Oy(){var P={env:Km,wasi_snapshot_preview1:Km};function V(ge,Ne){var Ot=ge.exports;if(u.asm=Ot,Hy(u.asm._emscripten_tls_init),ir=u.asm.__indirect_function_table,cc(u.asm.__wasm_call_ctors),ue=Ne,!S){var co=Me.unusedWorkers.length;Me.unusedWorkers.forEach(function(Za){Me.loadWasmModuleToWorker(Za,function(){--co||Rm("wasm-instantiate")})})}}S||Ay("wasm-instantiate");function pe(ge){V(ge.instance,ge.module)}function $e(ge){return Py().then(function(Ne){return WebAssembly.instantiate(Ne,P)}).then(function(Ne){return Ne}).then(ge,function(Ne){j("failed to asynchronously prepare wasm: "+Ne),Ru(Ne)})}function Be(){return!ne&&typeof WebAssembly.instantiateStreaming=="function"&&!Dm(yr)&&!zp(yr)&&!w&&typeof fetch=="function"?fetch(yr,{credentials:"same-origin"}).then(function(ge){var Ne=WebAssembly.instantiateStreaming(ge,P);return Ne.then(pe,function(Ot){return j("wasm streaming compile failed: "+Ot),j("falling back to ArrayBuffer instantiation"),$e(pe)})}):$e(pe)}if(u.instantiateWasm)try{var Le=u.instantiateWasm(P,V);return Le}catch(ge){j("Module.instantiateWasm callback failed with error: "+ge),c(ge)}return Be().catch(c),{}}var Jv,ek,Fm={};function Du(P){this.name="ExitStatus",this.message="Program terminated with exit("+P+")",this.status=P}function My(P){var V=Me.pthreads[P];delete Me.pthreads[P],V.terminate(),iw(P),Me.runningWorkers.splice(Me.runningWorkers.indexOf(V),1),V.pthread_ptr=0}function Ly(P){var V=Me.pthreads[P];V.postMessage({cmd:"cancel"})}function mc(P){var V=Me.pthreads[P];_e(V),Me.returnWorkerToPool(V)}function By(P){var V=Me.getNewWorker();if(!V)return 6;Me.runningWorkers.push(V),Me.pthreads[P.pthread_ptr]=V,V.pthread_ptr=P.pthread_ptr;var pe={cmd:"run",start_routine:P.startRoutine,arg:P.arg,pthread_ptr:P.pthread_ptr};return V.runPthread=()=>{w&&V.ref(),V.postMessage(pe,P.transferList),delete V.runPthread},V.loaded&&V.runPthread(),0}var Pm={varargs:void 0,get:function(){Pm.varargs+=4;var P=s()[Pm.varargs-4>>>2];return P},getStr:function(P){var V=Pe(P);return V}};function Om(P){if(S)return Oi(1,1,P);be=P,cn()||(Me.terminateAllThreads(),u.onExit&&u.onExit(P),me=!0),g(P,new Du(P))}function zy(P,V){if(be=P,!V&&S)throw Lm(P),"unwind";Om(P)}var Mm=zy;function Vy(P){if(P instanceof Du||P=="unwind")return be;g(1,P)}var Me={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){S?Me.initWorker():Me.initMainThread()},initMainThread:function(){for(var P=8;P--;)Me.allocateUnusedWorker()},initWorker:function(){ee=!1},setExitStatus:function(P){be=P},terminateAllThreads:function(){for(var P of Object.values(Me.pthreads))Me.returnWorkerToPool(P);for(var P of Me.unusedWorkers)P.terminate();Me.unusedWorkers=[]},returnWorkerToPool:function(P){var V=P.pthread_ptr;delete Me.pthreads[V],Me.unusedWorkers.push(P),Me.runningWorkers.splice(Me.runningWorkers.indexOf(P),1),P.pthread_ptr=0,w&&P.unref(),iw(V)},receiveObjectTransfer:function(P){},threadInitTLS:function(){Me.tlsInitFunctions.forEach(P=>P())},loadWasmModuleToWorker:function(P,V){P.onmessage=Le=>{var ge=Le.data,Ne=ge.cmd;if(P.pthread_ptr&&(Me.currentProxiedOperationCallerThread=P.pthread_ptr),ge.targetThread&&ge.targetThread!=Zm()){var Ot=Me.pthreads[ge.targetThread];Ot?Ot.postMessage(ge,ge.transferList):j('Internal error! Worker sent a message "'+Ne+'" to target pthread '+ge.targetThread+", but that thread no longer exists!"),Me.currentProxiedOperationCallerThread=void 0;return}Ne==="processProxyingQueue"?fc(ge.queue):Ne==="spawnThread"?By(ge):Ne==="cleanupThread"?mc(ge.thread):Ne==="killThread"?My(ge.thread):Ne==="cancelThread"?Ly(ge.thread):Ne==="loaded"?(P.loaded=!0,w&&P.unref(),V&&V(P),P.runPthread&&P.runPthread()):Ne==="print"?U("Thread "+ge.threadId+": "+ge.text):Ne==="printErr"?j("Thread "+ge.threadId+": "+ge.text):Ne==="alert"?alert("Thread "+ge.threadId+": "+ge.text):ge.target==="setimmediate"?P.postMessage(ge):Ne==="callHandler"?u[ge.handler](...ge.args):Ne&&j("worker sent an unknown command "+Ne),Me.currentProxiedOperationCallerThread=void 0},P.onerror=Le=>{var ge="worker sent an error!";throw j(ge+" "+Le.filename+":"+Le.lineno+": "+Le.message),Le},w&&(P.on("message",function(Le){P.onmessage({data:Le})}),P.on("error",function(Le){P.onerror(Le)}),P.on("detachedExit",function(){}));var pe=[],$e=["onExit","onAbort","print","printErr"];for(var Be of $e)u.hasOwnProperty(Be)&&pe.push(Be);P.postMessage({cmd:"load",handlers:pe,urlOrBlob:u.mainScriptUrlOrBlob||r,wasmMemory:oe,wasmModule:ue})},allocateUnusedWorker:function(){var P,V=T("tfjs-backend-wasm-threaded-simd.worker.js");P=new Worker(V),Me.unusedWorkers.push(P)},getNewWorker:function(){return Me.unusedWorkers.length==0&&(Me.allocateUnusedWorker(),Me.loadWasmModuleToWorker(Me.unusedWorkers[0])),Me.unusedWorkers.pop()}};u.PThread=Me;function dc(P){for(;P.length>0;)P.shift()(u)}function Wy(){var P=Zm(),V=s()[P+52>>>2],pe=s()[P+56>>>2],$e=V-pe;ak(V,$e),Jm(V)}u.establishStackSpace=Wy;function Lm(P){if(S)return Oi(2,0,P);try{Mm(P)}catch(V){Vy(V)}}var Vp=[];function Uy(P){var V=Vp[P];return V||(P>=Vp.length&&(Vp.length=P+1),Vp[P]=V=ir.get(P)),V}function Gy(P,V){var pe=Uy(P)(V);cn()?Me.setExitStatus(pe):sk(pe)}u.invokeEntryPoint=Gy;function Hy(P){Me.tlsInitFunctions.push(P)}function Ky(P){rk(P,!b,1,!x),Me.threadInitTLS()}function qy(P){S?postMessage({cmd:"cleanupThread",thread:P}):mc(P)}function Bm(P,V,pe,$e){return S?Oi(3,1,P,V,pe,$e):zm(P,V,pe,$e)}function zm(P,V,pe,$e){if(typeof SharedArrayBuffer=="undefined")return j("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var Be=[],Le=0;if(S&&(Be.length===0||Le))return Bm(P,V,pe,$e);if(Le)return Le;var ge={startRoutine:pe,pthread_ptr:P,arg:$e,transferList:Be};return S?(ge.cmd="spawnThread",postMessage(ge,Be),0):By(ge)}function jy(){return 65536}var Xy=!0;function Yy(){return Xy}function fc(P){Atomics.store(s(),P>>2,1),Zm()&&nk(P),Atomics.compareExchange(s(),P>>2,1,0)}u.executeNotifiedProxyingQueue=fc;function Qy(P,V,pe,$e){if(P==V)setTimeout(()=>fc($e));else if(S)postMessage({targetThread:P,cmd:"processProxyingQueue",queue:$e});else{var Be=Me.pthreads[P];if(!Be)return;Be.postMessage({cmd:"processProxyingQueue",queue:$e})}return 1}function Zy(P,V,pe){return-1}function Jy(){Ru("")}function Au(P){Au.shown||(Au.shown={}),Au.shown[P]||(Au.shown[P]=1,w&&(P="warning: "+P),j(P))}function eb(){w||b||Au("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function tb(){return Date.now()}function Vm(){return 4294901760}function rb(){return Vm()}var hc;w?hc=()=>{var P=process.hrtime();return P[0]*1e3+P[1]/1e6}:hc=()=>performance.timeOrigin+performance.now();function ob(P,V,pe){o().copyWithin(P>>>0,V>>>0,V+pe>>>0)}function nb(){return w?kz().cpus().length:navigator.hardwareConcurrency}function sb(P){var V=uw(),pe=P();return Jm(V),pe}function Oi(P,V){var pe=arguments.length-2,$e=arguments;return sb(()=>{for(var Be=pe,Le=ed(Be*8),ge=Le>>3,Ne=0;Ne>>0]=Ot}return ok(P,Be,Le,V)})}var gc=[];function ab(P,V,pe){gc.length=V;for(var $e=pe>>3,Be=0;Be>>0];var Le=P<0,ge=Le?Fm[-P-1]:hb[P];return ge.apply(null,gc)}function ib(P){try{return oe.grow(P-Ke.byteLength+65535>>>16),Et(oe.buffer),1}catch(V){}}function ub(P){var V=o().length;if(P=P>>>0,P<=V)return!1;var pe=Vm();if(P>pe)return!1;let $e=(Ot,co)=>Ot+(co-Ot%co)%co;for(var Be=1;Be<=4;Be*=2){var Le=V*(1+.2/Be);Le=Math.min(Le,P+100663296);var ge=Math.min(pe,$e(Math.max(P,Le),65536)),Ne=ib(ge);if(Ne)return!0}return!1}function pb(){throw"unwind"}function Wm(P){return S?Oi(4,1,P):52}function Um(P,V,pe,$e,Be){return S?Oi(5,1,P,V,pe,$e,Be):70}var lb=[null,[],[]];function cb(P,V){var pe=lb[P];V===0||V===10?((P===1?U:j)(Fe(pe,0)),pe.length=0):pe.push(V)}function Gm(P,V,pe,$e){if(S)return Oi(6,1,P,V,pe,$e);for(var Be=0,Le=0;Le>>2],Ne=a()[V+4>>>2];V+=8;for(var Ot=0;Ot>>0]);Be+=Ne}return a()[$e>>>2]=Be,0}function Hm(P){var V=u["_"+P];return V}function mb(P,V){t().set(P,V>>>0)}function db(P,V,pe,$e,Be){var Le={string:Gr=>{var Hp=0;if(Gr!=null&&Gr!==0){var pk=(Gr.length<<2)+1;Hp=ed(pk),ct(Gr,Hp,pk)}return Hp},array:Gr=>{var Hp=ed(Gr.length);return mb(Gr,Hp),Hp}};function ge(Gr){return V==="string"?Pe(Gr):V==="boolean"?!!Gr:Gr}var Ne=Hm(P),Ot=[],co=0;if($e)for(var Za=0;Za<$e.length;Za++){var uk=Le[pe[Za]];uk?(co===0&&(co=uw()),Ot[Za]=uk($e[Za])):Ot[Za]=$e[Za]}var pw=Ne.apply(null,Ot);function K4(Gr){return co!==0&&Jm(co),ge(Gr)}return pw=K4(pw),pw}function fb(P,V,pe,$e){pe=pe||[];var Be=pe.every(ge=>ge==="number"||ge==="boolean"),Le=V!=="string";return Le&&Be&&!$e?Hm(P):function(){return db(P,V,pe,arguments,$e)}}Me.init();var hb=[null,Om,Lm,Bm,Wm,Um,Gm],Km={__emscripten_init_main_thread_js:Ky,__emscripten_thread_cleanup:qy,__pthread_create_js:zm,_emscripten_default_pthread_stack_size:jy,_emscripten_get_now_is_monotonic:Yy,_emscripten_notify_task_queue:Qy,_emscripten_set_offscreencanvas_size:Zy,abort:Jy,emscripten_check_blocking_allowed:eb,emscripten_date_now:tb,emscripten_get_heap_max:rb,emscripten_get_now:hc,emscripten_memcpy_big:ob,emscripten_num_logical_cores:nb,emscripten_receive_on_main_thread_js:ab,emscripten_resize_heap:ub,emscripten_unwind_to_js_event_loop:pb,exit:Mm,fd_close:Wm,fd_seek:Um,fd_write:Gm,memory:oe||u.wasmMemory},tk=Oy(),gb=u.___wasm_call_ctors=function(){return(gb=u.___wasm_call_ctors=u.asm.__wasm_call_ctors).apply(null,arguments)},xb=u._init=function(){return(xb=u._init=u.asm.init).apply(null,arguments)},yb=u._init_with_threads_count=function(){return(yb=u._init_with_threads_count=u.asm.init_with_threads_count).apply(null,arguments)},bb=u._get_threads_count=function(){return(bb=u._get_threads_count=u.asm.get_threads_count).apply(null,arguments)},Cb=u._register_tensor=function(){return(Cb=u._register_tensor=u.asm.register_tensor).apply(null,arguments)},wb=u._dispose_data=function(){return(wb=u._dispose_data=u.asm.dispose_data).apply(null,arguments)},Sb=u._dispose=function(){return(Sb=u._dispose=u.asm.dispose).apply(null,arguments)},Ib=u._Abs=function(){return(Ib=u._Abs=u.asm.Abs).apply(null,arguments)},vb=u._Acos=function(){return(vb=u._Acos=u.asm.Acos).apply(null,arguments)},kb=u._Acosh=function(){return(kb=u._Acosh=u.asm.Acosh).apply(null,arguments)},Nb=u._Add=function(){return(Nb=u._Add=u.asm.Add).apply(null,arguments)},Tb=u._AddN=function(){return(Tb=u._AddN=u.asm.AddN).apply(null,arguments)},_b=u._All=function(){return(_b=u._All=u.asm.All).apply(null,arguments)},Eb=u._Any=function(){return(Eb=u._Any=u.asm.Any).apply(null,arguments)},$b=u._ArgMax=function(){return($b=u._ArgMax=u.asm.ArgMax).apply(null,arguments)},Rb=u._ArgMin=function(){return(Rb=u._ArgMin=u.asm.ArgMin).apply(null,arguments)},Db=u._Asin=function(){return(Db=u._Asin=u.asm.Asin).apply(null,arguments)},Ab=u._Asinh=function(){return(Ab=u._Asinh=u.asm.Asinh).apply(null,arguments)},Fb=u._Atan=function(){return(Fb=u._Atan=u.asm.Atan).apply(null,arguments)},Pb=u._Atan2=function(){return(Pb=u._Atan2=u.asm.Atan2).apply(null,arguments)},Ob=u._Atanh=function(){return(Ob=u._Atanh=u.asm.Atanh).apply(null,arguments)},Mb=u._AvgPool=function(){return(Mb=u._AvgPool=u.asm.AvgPool).apply(null,arguments)},Lb=u._AvgPool3D=function(){return(Lb=u._AvgPool3D=u.asm.AvgPool3D).apply(null,arguments)},Bb=u._AvgPool3DGrad=function(){return(Bb=u._AvgPool3DGrad=u.asm.AvgPool3DGrad).apply(null,arguments)},zb=u._AvgPoolGrad=function(){return(zb=u._AvgPoolGrad=u.asm.AvgPoolGrad).apply(null,arguments)},Vb=u._BatchMatMul=function(){return(Vb=u._BatchMatMul=u.asm.BatchMatMul).apply(null,arguments)},Wb=u._Bincount=function(){return(Wb=u._Bincount=u.asm.Bincount).apply(null,arguments)},Ub=u._BitwiseAnd=function(){return(Ub=u._BitwiseAnd=u.asm.BitwiseAnd).apply(null,arguments)},Gb=u._Ceil=function(){return(Gb=u._Ceil=u.asm.Ceil).apply(null,arguments)},Hb=u._ClipByValue=function(){return(Hb=u._ClipByValue=u.asm.ClipByValue).apply(null,arguments)},Kb=u._Conv2D=function(){return(Kb=u._Conv2D=u.asm.Conv2D).apply(null,arguments)},qb=u._Conv2DBackpropInput=function(){return(qb=u._Conv2DBackpropInput=u.asm.Conv2DBackpropInput).apply(null,arguments)},jb=u._Conv3D=function(){return(jb=u._Conv3D=u.asm.Conv3D).apply(null,arguments)},Xb=u._Conv3DBackpropFilterV2=function(){return(Xb=u._Conv3DBackpropFilterV2=u.asm.Conv3DBackpropFilterV2).apply(null,arguments)},Yb=u._Conv3DBackpropInputV2=function(){return(Yb=u._Conv3DBackpropInputV2=u.asm.Conv3DBackpropInputV2).apply(null,arguments)},Qb=u._Cos=function(){return(Qb=u._Cos=u.asm.Cos).apply(null,arguments)},Zb=u._Cosh=function(){return(Zb=u._Cosh=u.asm.Cosh).apply(null,arguments)},Jb=u._CropAndResize=function(){return(Jb=u._CropAndResize=u.asm.CropAndResize).apply(null,arguments)},eC=u._Cumprod=function(){return(eC=u._Cumprod=u.asm.Cumprod).apply(null,arguments)},tC=u._Cumsum=function(){return(tC=u._Cumsum=u.asm.Cumsum).apply(null,arguments)},rC=u._DenseBincount=function(){return(rC=u._DenseBincount=u.asm.DenseBincount).apply(null,arguments)},oC=u._DepthToSpace=function(){return(oC=u._DepthToSpace=u.asm.DepthToSpace).apply(null,arguments)},nC=u._DepthwiseConv2dNative=function(){return(nC=u._DepthwiseConv2dNative=u.asm.DepthwiseConv2dNative).apply(null,arguments)},sC=u._Diag=function(){return(sC=u._Diag=u.asm.Diag).apply(null,arguments)},aC=u._Dilation2D=function(){return(aC=u._Dilation2D=u.asm.Dilation2D).apply(null,arguments)},iC=u._Dilation2DBackpropFilter=function(){return(iC=u._Dilation2DBackpropFilter=u.asm.Dilation2DBackpropFilter).apply(null,arguments)},uC=u._Dilation2DBackpropInput=function(){return(uC=u._Dilation2DBackpropInput=u.asm.Dilation2DBackpropInput).apply(null,arguments)},pC=u._Elu=function(){return(pC=u._Elu=u.asm.Elu).apply(null,arguments)},lC=u._EluGrad=function(){return(lC=u._EluGrad=u.asm.EluGrad).apply(null,arguments)},cC=u._Equal=function(){return(cC=u._Equal=u.asm.Equal).apply(null,arguments)},mC=u._Erf=function(){return(mC=u._Erf=u.asm.Erf).apply(null,arguments)},dC=u._Exp=function(){return(dC=u._Exp=u.asm.Exp).apply(null,arguments)},fC=u._Expm1=function(){return(fC=u._Expm1=u.asm.Expm1).apply(null,arguments)},hC=u._FlipLeftRight=function(){return(hC=u._FlipLeftRight=u.asm.FlipLeftRight).apply(null,arguments)},gC=u._Floor=function(){return(gC=u._Floor=u.asm.Floor).apply(null,arguments)},xC=u._FloorDiv=function(){return(xC=u._FloorDiv=u.asm.FloorDiv).apply(null,arguments)},yC=u._FusedBatchNorm=function(){return(yC=u._FusedBatchNorm=u.asm.FusedBatchNorm).apply(null,arguments)},bC=u._FusedConv2D=function(){return(bC=u._FusedConv2D=u.asm.FusedConv2D).apply(null,arguments)},CC=u._FusedDepthwiseConv2D=function(){return(CC=u._FusedDepthwiseConv2D=u.asm.FusedDepthwiseConv2D).apply(null,arguments)},wC=u._Gather=function(){return(wC=u._Gather=u.asm.Gather).apply(null,arguments)},SC=u._GatherNd=function(){return(SC=u._GatherNd=u.asm.GatherNd).apply(null,arguments)},IC=u._Greater=function(){return(IC=u._Greater=u.asm.Greater).apply(null,arguments)},vC=u._GreaterEqual=function(){return(vC=u._GreaterEqual=u.asm.GreaterEqual).apply(null,arguments)},kC=u._IsFinite=function(){return(kC=u._IsFinite=u.asm.IsFinite).apply(null,arguments)},NC=u._IsInf=function(){return(NC=u._IsInf=u.asm.IsInf).apply(null,arguments)},TC=u._IsNan=function(){return(TC=u._IsNan=u.asm.IsNan).apply(null,arguments)},_C=u._LRN=function(){return(_C=u._LRN=u.asm.LRN).apply(null,arguments)},EC=u._LRNGrad=function(){return(EC=u._LRNGrad=u.asm.LRNGrad).apply(null,arguments)},$C=u._LeakyRelu=function(){return($C=u._LeakyRelu=u.asm.LeakyRelu).apply(null,arguments)},RC=u._Less=function(){return(RC=u._Less=u.asm.Less).apply(null,arguments)},DC=u._LessEqual=function(){return(DC=u._LessEqual=u.asm.LessEqual).apply(null,arguments)},AC=u._LinSpace=function(){return(AC=u._LinSpace=u.asm.LinSpace).apply(null,arguments)},FC=u._Log=function(){return(FC=u._Log=u.asm.Log).apply(null,arguments)},PC=u._Log1p=function(){return(PC=u._Log1p=u.asm.Log1p).apply(null,arguments)},OC=u._LogicalAnd=function(){return(OC=u._LogicalAnd=u.asm.LogicalAnd).apply(null,arguments)},MC=u._LogicalNot=function(){return(MC=u._LogicalNot=u.asm.LogicalNot).apply(null,arguments)},LC=u._LogicalOr=function(){return(LC=u._LogicalOr=u.asm.LogicalOr).apply(null,arguments)},BC=u._LogicalXor=function(){return(BC=u._LogicalXor=u.asm.LogicalXor).apply(null,arguments)},zC=u._Max=function(){return(zC=u._Max=u.asm.Max).apply(null,arguments)},VC=u._MaxPool=function(){return(VC=u._MaxPool=u.asm.MaxPool).apply(null,arguments)},WC=u._MaxPool3D=function(){return(WC=u._MaxPool3D=u.asm.MaxPool3D).apply(null,arguments)},UC=u._MaxPool3DGrad=function(){return(UC=u._MaxPool3DGrad=u.asm.MaxPool3DGrad).apply(null,arguments)},GC=u._MaxPoolGrad=function(){return(GC=u._MaxPoolGrad=u.asm.MaxPoolGrad).apply(null,arguments)},HC=u._MaxPoolWithArgmax=function(){return(HC=u._MaxPoolWithArgmax=u.asm.MaxPoolWithArgmax).apply(null,arguments)},KC=u._Maximum=function(){return(KC=u._Maximum=u.asm.Maximum).apply(null,arguments)},qC=u._Mean=function(){return(qC=u._Mean=u.asm.Mean).apply(null,arguments)},jC=u._Min=function(){return(jC=u._Min=u.asm.Min).apply(null,arguments)},XC=u._Minimum=function(){return(XC=u._Minimum=u.asm.Minimum).apply(null,arguments)},YC=u._MirrorPad=function(){return(YC=u._MirrorPad=u.asm.MirrorPad).apply(null,arguments)},QC=u._Mod=function(){return(QC=u._Mod=u.asm.Mod).apply(null,arguments)},ZC=u._Multinomial=function(){return(ZC=u._Multinomial=u.asm.Multinomial).apply(null,arguments)},JC=u._Multiply=function(){return(JC=u._Multiply=u.asm.Multiply).apply(null,arguments)},ew=u._Neg=function(){return(ew=u._Neg=u.asm.Neg).apply(null,arguments)},tw=u._NonMaxSuppressionV3=function(){return(tw=u._NonMaxSuppressionV3=u.asm.NonMaxSuppressionV3).apply(null,arguments)},rw=u._NonMaxSuppressionV4=function(){return(rw=u._NonMaxSuppressionV4=u.asm.NonMaxSuppressionV4).apply(null,arguments)},qm=u._NonMaxSuppressionV5=function(){return(qm=u._NonMaxSuppressionV5=u.asm.NonMaxSuppressionV5).apply(null,arguments)},jm=u._NotEqual=function(){return(jm=u._NotEqual=u.asm.NotEqual).apply(null,arguments)},xc=u._OneHot=function(){return(xc=u._OneHot=u.asm.OneHot).apply(null,arguments)},ow=u._PadV2=function(){return(ow=u._PadV2=u.asm.PadV2).apply(null,arguments)},nw=u._Pow=function(){return(nw=u._Pow=u.asm.Pow).apply(null,arguments)},Wp=u._Prelu=function(){return(Wp=u._Prelu=u.asm.Prelu).apply(null,arguments)},Xm=u._Prod=function(){return(Xm=u._Prod=u.asm.Prod).apply(null,arguments)},Up=u._RealDiv=function(){return(Up=u._RealDiv=u.asm.RealDiv).apply(null,arguments)},Gp=u._Reciprocal=function(){return(Gp=u._Reciprocal=u.asm.Reciprocal).apply(null,arguments)},sw=u._Relu=function(){return(sw=u._Relu=u.asm.Relu).apply(null,arguments)},K=u._Relu6=function(){return(K=u._Relu6=u.asm.Relu6).apply(null,arguments)},ae=u._ResizeBilinear=function(){return(ae=u._ResizeBilinear=u.asm.ResizeBilinear).apply(null,arguments)},Ee=u._ResizeBilinearGrad=function(){return(Ee=u._ResizeBilinearGrad=u.asm.ResizeBilinearGrad).apply(null,arguments)},it=u._ResizeNearestNeighbor=function(){return(it=u._ResizeNearestNeighbor=u.asm.ResizeNearestNeighbor).apply(null,arguments)},$t=u._ResizeNearestNeighborGrad=function(){return($t=u._ResizeNearestNeighborGrad=u.asm.ResizeNearestNeighborGrad).apply(null,arguments)},Rt=u._Reverse=function(){return(Rt=u._Reverse=u.asm.Reverse).apply(null,arguments)},Ze=u._RotateWithOffset=function(){return(Ze=u._RotateWithOffset=u.asm.RotateWithOffset).apply(null,arguments)},je=u._Round=function(){return(je=u._Round=u.asm.Round).apply(null,arguments)},Ht=u._Rsqrt=function(){return(Ht=u._Rsqrt=u.asm.Rsqrt).apply(null,arguments)},lo=u._ScatterNd=function(){return(lo=u._ScatterNd=u.asm.ScatterNd).apply(null,arguments)},Qa=u._SearchSorted=function(){return(Qa=u._SearchSorted=u.asm.SearchSorted).apply(null,arguments)},Ym=u._SelectV2=function(){return(Ym=u._SelectV2=u.asm.SelectV2).apply(null,arguments)},yc=u._Selu=function(){return(yc=u._Selu=u.asm.Selu).apply(null,arguments)},aw=u._Sigmoid=function(){return(aw=u._Sigmoid=u.asm.Sigmoid).apply(null,arguments)},wr=u._Sign=function(){return(wr=u._Sign=u.asm.Sign).apply(null,arguments)},Mi=u._Sin=function(){return(Mi=u._Sin=u.asm.Sin).apply(null,arguments)},Qm=u._Sinh=function(){return(Qm=u._Sinh=u.asm.Sinh).apply(null,arguments)},f4=u._Softmax=function(){return(f4=u._Softmax=u.asm.Softmax).apply(null,arguments)},h4=u._Softplus=function(){return(h4=u._Softplus=u.asm.Softplus).apply(null,arguments)},g4=u._SparseFillEmptyRows=function(){return(g4=u._SparseFillEmptyRows=u.asm.SparseFillEmptyRows).apply(null,arguments)},x4=u._SparseReshape=function(){return(x4=u._SparseReshape=u.asm.SparseReshape).apply(null,arguments)},y4=u._SparseSegmentReduction=function(){return(y4=u._SparseSegmentReduction=u.asm.SparseSegmentReduction).apply(null,arguments)},b4=u._SparseToDense=function(){return(b4=u._SparseToDense=u.asm.SparseToDense).apply(null,arguments)},C4=u._Sqrt=function(){return(C4=u._Sqrt=u.asm.Sqrt).apply(null,arguments)},w4=u._Square=function(){return(w4=u._Square=u.asm.Square).apply(null,arguments)},S4=u._SquaredDifference=function(){return(S4=u._SquaredDifference=u.asm.SquaredDifference).apply(null,arguments)},I4=u._Step=function(){return(I4=u._Step=u.asm.Step).apply(null,arguments)},v4=u._StridedSlice=function(){return(v4=u._StridedSlice=u.asm.StridedSlice).apply(null,arguments)},k4=u._Sub=function(){return(k4=u._Sub=u.asm.Sub).apply(null,arguments)},N4=u._Sum=function(){return(N4=u._Sum=u.asm.Sum).apply(null,arguments)},T4=u._Tan=function(){return(T4=u._Tan=u.asm.Tan).apply(null,arguments)},_4=u._Tanh=function(){return(_4=u._Tanh=u.asm.Tanh).apply(null,arguments)},E4=u._TensorScatterUpdate=function(){return(E4=u._TensorScatterUpdate=u.asm.TensorScatterUpdate).apply(null,arguments)},$4=u._Tile=function(){return($4=u._Tile=u.asm.Tile).apply(null,arguments)},R4=u._TopK=function(){return(R4=u._TopK=u.asm.TopK).apply(null,arguments)},D4=u._Transform=function(){return(D4=u._Transform=u.asm.Transform).apply(null,arguments)},A4=u._Transpose=function(){return(A4=u._Transpose=u.asm.Transpose).apply(null,arguments)},F4=u.__FusedMatMul=function(){return(F4=u.__FusedMatMul=u.asm._FusedMatMul).apply(null,arguments)},P4=u._malloc=function(){return(P4=u._malloc=u.asm.malloc).apply(null,arguments)},O4=u._free=function(){return(O4=u._free=u.asm.free).apply(null,arguments)},M4=u.__emscripten_tls_init=function(){return(M4=u.__emscripten_tls_init=u.asm._emscripten_tls_init).apply(null,arguments)},Zm=u._pthread_self=function(){return(Zm=u._pthread_self=u.asm.pthread_self).apply(null,arguments)},L4=u.___errno_location=function(){return(L4=u.___errno_location=u.asm.__errno_location).apply(null,arguments)},rk=u.__emscripten_thread_init=function(){return(rk=u.__emscripten_thread_init=u.asm._emscripten_thread_init).apply(null,arguments)},B4=u.__emscripten_thread_crashed=function(){return(B4=u.__emscripten_thread_crashed=u.asm._emscripten_thread_crashed).apply(null,arguments)},z4=u._emscripten_main_thread_process_queued_calls=function(){return(z4=u._emscripten_main_thread_process_queued_calls=u.asm.emscripten_main_thread_process_queued_calls).apply(null,arguments)},V4=u._emscripten_main_browser_thread_id=function(){return(V4=u._emscripten_main_browser_thread_id=u.asm.emscripten_main_browser_thread_id).apply(null,arguments)},ok=u._emscripten_run_in_main_runtime_thread_js=function(){return(ok=u._emscripten_run_in_main_runtime_thread_js=u.asm.emscripten_run_in_main_runtime_thread_js).apply(null,arguments)},W4=u._emscripten_dispatch_to_thread_=function(){return(W4=u._emscripten_dispatch_to_thread_=u.asm.emscripten_dispatch_to_thread_).apply(null,arguments)},nk=u.__emscripten_proxy_execute_task_queue=function(){return(nk=u.__emscripten_proxy_execute_task_queue=u.asm._emscripten_proxy_execute_task_queue).apply(null,arguments)},iw=u.__emscripten_thread_free_data=function(){return(iw=u.__emscripten_thread_free_data=u.asm._emscripten_thread_free_data).apply(null,arguments)},sk=u.__emscripten_thread_exit=function(){return(sk=u.__emscripten_thread_exit=u.asm._emscripten_thread_exit).apply(null,arguments)},ak=u._emscripten_stack_set_limits=function(){return(ak=u._emscripten_stack_set_limits=u.asm.emscripten_stack_set_limits).apply(null,arguments)},uw=u.stackSave=function(){return(uw=u.stackSave=u.asm.stackSave).apply(null,arguments)},Jm=u.stackRestore=function(){return(Jm=u.stackRestore=u.asm.stackRestore).apply(null,arguments)},ed=u.stackAlloc=function(){return(ed=u.stackAlloc=u.asm.stackAlloc).apply(null,arguments)},U4=u.dynCall_iijjiiii=function(){return(U4=u.dynCall_iijjiiii=u.asm.dynCall_iijjiiii).apply(null,arguments)},G4=u.dynCall_jiji=function(){return(G4=u.dynCall_jiji=u.asm.dynCall_jiji).apply(null,arguments)};u.keepRuntimeAlive=cn,u.wasmMemory=oe,u.cwrap=fb,u.ExitStatus=Du,u.PThread=Me;var td;Ya=function P(){td||ik(),td||(Ya=P)};function ik(P){if(P=P||f,Pi>0)return;if(S){l(u),Zt(),startWorker(u);return}if(ta(),Pi>0)return;function V(){td||(td=!0,u.calledRun=!0,!me&&(Zt(),l(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),Xa()))}u.setStatus?(u.setStatus("Running..."),setTimeout(function(){setTimeout(function(){u.setStatus("")},1),V()},1)):V()}if(u.preInit)for(typeof u.preInit=="function"&&(u.preInit=[u.preInit]);u.preInit.length>0;)u.preInit.pop()();ik();var rd;m&&(rd={uncaughtException:process.listeners("uncaughtException").filter(function(P){return!m.uncaughtException.indexOf(P)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(P){return!m.unhandledRejection.indexOf(P)>-1})});var od;if(typeof WasmBackendModule!="undefined")od=WasmBackendModule;else if(typeof e!="undefined")od=e;else throw new Error("Could not find wasm module in post.js");if(rd){var H4=od._dispose;od._dispose=function(){H4(),rd.uncaughtException.forEach(function(P){process.removeListener("uncaughtException",P)}),rd.unhandledRejection.forEach(function(P){process.removeListener("unhandledRejection",P)})}}return e.ready}})();typeof Jg=="object"&&typeof ov=="object"?ov.exports=rv:typeof define=="function"&&define.amd?define([],function(){return rv}):typeof Jg=="object"&&(Jg.WasmBackendModuleThreadedSimd=rv)});var _z=jt((EPt,Tz)=>{Tz.exports.wasmWorkerContents=`"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f)},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}var initializedJS=false;var pendingNotifiedProxyingQueues=[];function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+" +");return}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;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onunhandledrejection=e=>{throw e.reason??e};self.startWorker=instance=>{Module=instance;postMessage({"cmd":"loaded"})};self.onmessage=e=>{try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=function(){postMessage({cmd:"callHandler",handler:handler,args:[...arguments]})}}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)}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){pendingNotifiedProxyingQueues.forEach(queue=>{Module["executeNotifiedProxyingQueue"](queue)});pendingNotifiedProxyingQueues=[];initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processProxyingQueue"){if(initializedJS){Module["executeNotifiedProxyingQueue"](e.data.queue)}else{pendingNotifiedProxyingQueues.push(e.data.queue)}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}};`});var Ez=jt((ex,sv)=>{var nv=(()=>{var r=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(r=r||__filename),function(e){e=e||{};var t=typeof e!="undefined"?e:{},o,n;t.ready=new Promise(function(K,ae){o=K,n=ae});var s;typeof process!="undefined"&&process.listeners&&(s={uncaughtException:process.listeners("uncaughtException"),unhandledRejection:process.listeners("unhandledRejection")});var a=Object.assign({},t),i=[],p="./this.program",u=(K,ae)=>{throw ae},l=typeof window=="object",c=typeof importScripts=="function",m=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",d="";function f(K){return t.locateFile?t.locateFile(K,d):d+K}var h,g,x,b;function w(K){if(K instanceof Bp)return;E("exiting due to exception: "+K)}if(m){var S=ev(),k=tv();c?d=k.dirname(d)+"/":d=__dirname+"/",h=(K,ae)=>(K=ta(K)?new URL(K):k.normalize(K),S.readFileSync(K,ae?void 0:"utf8")),x=K=>{var ae=h(K,!0);return ae.buffer||(ae=new Uint8Array(ae)),ae},g=(K,ae,Ee)=>{K=ta(K)?new URL(K):k.normalize(K),S.readFile(K,function(it,$t){it?Ee(it):ae($t.buffer)})},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),i=process.argv.slice(2),process.on("uncaughtException",function(K){if(!(K instanceof Bp))throw K}),process.on("unhandledRejection",function(K){throw K}),u=(K,ae)=>{if(ut())throw process.exitCode=K,ae;w(ae),process.exit(K)},t.inspect=function(){return"[Emscripten Module object]"}}else(l||c)&&(c?d=self.location.href:typeof document!="undefined"&&document.currentScript&&(d=document.currentScript.src),r&&(d=r),d.indexOf("blob:")!==0?d=d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):d="",h=K=>{var ae=new XMLHttpRequest;return ae.open("GET",K,!1),ae.send(null),ae.responseText},c&&(x=K=>{var ae=new XMLHttpRequest;return ae.open("GET",K,!1),ae.responseType="arraybuffer",ae.send(null),new Uint8Array(ae.response)}),g=(K,ae,Ee)=>{var it=new XMLHttpRequest;it.open("GET",K,!0),it.responseType="arraybuffer",it.onload=()=>{if(it.status==200||it.status==0&&it.response){ae(it.response);return}Ee()},it.onerror=Ee,it.send(null)},b=K=>document.title=K);var T=t.print||console.log.bind(console),E=t.printErr||console.warn.bind(console);Object.assign(t,a),a=null,t.arguments&&(i=t.arguments),t.thisProgram&&(p=t.thisProgram),t.quit&&(u=t.quit);var R=4,D;t.wasmBinary&&(D=t.wasmBinary);var F=t.noExitRuntime||!0;typeof WebAssembly!="object"&&xr("no native wasm support detected");var O,M=!1,L;function B(K,ae){K||xr(ae)}var z=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function U(K,ae,Ee){ae>>>=0;for(var it=ae+Ee,$t=ae;K[$t]&&!($t>=it);)++$t;if($t-ae>16&&K.buffer&&z)return z.decode(K.subarray(ae,$t));for(var Rt="";ae<$t;){var Ze=K[ae++];if(!(Ze&128)){Rt+=String.fromCharCode(Ze);continue}var je=K[ae++]&63;if((Ze&224)==192){Rt+=String.fromCharCode((Ze&31)<<6|je);continue}var Ht=K[ae++]&63;if((Ze&240)==224?Ze=(Ze&15)<<12|je<<6|Ht:Ze=(Ze&7)<<18|je<<12|Ht<<6|K[ae++]&63,Ze<65536)Rt+=String.fromCharCode(Ze);else{var lo=Ze-65536;Rt+=String.fromCharCode(55296|lo>>10,56320|lo&1023)}}return Rt}function j(K,ae){return K>>>=0,K?U(ne,K,ae):""}function q(K,ae,Ee,it){if(Ee>>>=0,!(it>0))return 0;for(var $t=Ee,Rt=Ee+it-1,Ze=0;Ze=55296&&je<=57343){var Ht=K.charCodeAt(++Ze);je=65536+((je&1023)<<10)|Ht&1023}if(je<=127){if(Ee>=Rt)break;ae[Ee++>>>0]=je}else if(je<=2047){if(Ee+1>=Rt)break;ae[Ee++>>>0]=192|je>>6,ae[Ee++>>>0]=128|je&63}else if(je<=65535){if(Ee+2>=Rt)break;ae[Ee++>>>0]=224|je>>12,ae[Ee++>>>0]=128|je>>6&63,ae[Ee++>>>0]=128|je&63}else{if(Ee+3>=Rt)break;ae[Ee++>>>0]=240|je>>18,ae[Ee++>>>0]=128|je>>12&63,ae[Ee++>>>0]=128|je>>6&63,ae[Ee++>>>0]=128|je&63}}return ae[Ee>>>0]=0,Ee-$t}function Y(K,ae,Ee){return q(K,ne,ae,Ee)}var J,re,ne,ee,oe,ue,me,be,_e;function ve(K){J=K,t.HEAP8=re=new Int8Array(K),t.HEAP16=ee=new Int16Array(K),t.HEAP32=ue=new Int32Array(K),t.HEAPU8=ne=new Uint8Array(K),t.HEAPU16=oe=new Uint16Array(K),t.HEAPU32=me=new Uint32Array(K),t.HEAPF32=be=new Float32Array(K),t.HEAPF64=_e=new Float64Array(K)}var Fe=t.INITIAL_MEMORY||16777216,Pe,at=[],ct=[],Ke=[],mt=!1;function ut(){return F}function gt(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Bt(t.preRun.shift());Ya(at)}function xt(){mt=!0,Ya(ct)}function Ur(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)sr(t.postRun.shift());Ya(Ke)}function Bt(K){at.unshift(K)}function io(K){ct.unshift(K)}function sr(K){Ke.unshift(K)}var Et=0,ar=null,ir=null;function uo(K){Et++,t.monitorRunDependencies&&t.monitorRunDependencies(Et)}function po(K){if(Et--,t.monitorRunDependencies&&t.monitorRunDependencies(Et),Et==0&&(ar!==null&&(clearInterval(ar),ar=null),ir)){var ae=ir;ir=null,ae()}}function xr(K){t.onAbort&&t.onAbort(K),K="Aborted("+K+")",E(K),M=!0,L=1,K+=". Build with -sASSERTIONS for more info.";var ae=new WebAssembly.RuntimeError(K);throw n(ae),ae}var ja="data:application/octet-stream;base64,";function cn(K){return K.startsWith(ja)}function ta(K){return K.startsWith("file://")}var Zt;Zt="tfjs-backend-wasm.wasm",cn(Zt)||(Zt=f(Zt));function Xa(K){try{if(K==Zt&&D)return new Uint8Array(D);if(x)return x(K);throw"both async and sync fetching of the wasm failed"}catch(ae){xr(ae)}}function lc(){if(!D&&(l||c)){if(typeof fetch=="function"&&!ta(Zt))return fetch(Zt,{credentials:"same-origin"}).then(function(K){if(!K.ok)throw"failed to load wasm binary file at '"+Zt+"'";return K.arrayBuffer()}).catch(function(){return Xa(Zt)});if(g)return new Promise(function(K,ae){g(Zt,function(Ee){K(new Uint8Array(Ee))},ae)})}return Promise.resolve().then(function(){return Xa(Zt)})}function cc(){var K={env:mc,wasi_snapshot_preview1:mc};function ae(Ze,je){var Ht=Ze.exports;t.asm=Ht,O=t.asm.memory,ve(O.buffer),Pe=t.asm.__indirect_function_table,io(t.asm.__wasm_call_ctors),po("wasm-instantiate")}uo("wasm-instantiate");function Ee(Ze){ae(Ze.instance)}function it(Ze){return lc().then(function(je){return WebAssembly.instantiate(je,K)}).then(function(je){return je}).then(Ze,function(je){E("failed to asynchronously prepare wasm: "+je),xr(je)})}function $t(){return!D&&typeof WebAssembly.instantiateStreaming=="function"&&!cn(Zt)&&!ta(Zt)&&!m&&typeof fetch=="function"?fetch(Zt,{credentials:"same-origin"}).then(function(Ze){var je=WebAssembly.instantiateStreaming(Ze,K);return je.then(Ee,function(Ht){return E("wasm streaming compile failed: "+Ht),E("falling back to ArrayBuffer instantiation"),it(Ee)})}):it(Ee)}if(t.instantiateWasm)try{var Rt=t.instantiateWasm(K,ae);return Rt}catch(Ze){E("Module.instantiateWasm callback failed with error: "+Ze),n(Ze)}return $t().catch(n),{}}var Zv,Pi;function Bp(K){this.name="ExitStatus",this.message="Program terminated with exit("+K+")",this.status=K}function Ya(K){for(;K.length>0;)K.shift()(t)}function Ay(){xr("")}function Rm(){return 4294901760}function Ru(){return Rm()}function Fy(K,ae,Ee){ne.copyWithin(K>>>0,ae>>>0,ae+Ee>>>0)}function Dm(K){try{return O.grow(K-J.byteLength+65535>>>16),ve(O.buffer),1}catch(ae){}}function zp(K){var ae=ne.length;K=K>>>0;var Ee=Rm();if(K>Ee)return!1;let it=(Ht,lo)=>Ht+(lo-Ht%lo)%lo;for(var $t=1;$t<=4;$t*=2){var Rt=ae*(1+.2/$t);Rt=Math.min(Rt,K+100663296);var Ze=Math.min(Ee,it(Math.max(K,Rt),65536)),je=Dm(Ze);if(je)return!0}return!1}var yr={varargs:void 0,get:function(){yr.varargs+=4;var K=ue[yr.varargs-4>>>2];return K},getStr:function(K){var ae=j(K);return ae}};function Am(K){return 52}function Py(K,ae,Ee,it,$t){return 70}var Oy=[null,[],[]];function Jv(K,ae){var Ee=Oy[K];ae===0||ae===10?((K===1?T:E)(U(Ee,0)),Ee.length=0):Ee.push(ae)}function ek(K,ae,Ee,it){for(var $t=0,Rt=0;Rt>>2],je=me[ae+4>>>2];ae+=8;for(var Ht=0;Ht>>0]);$t+=je}return me[it>>>2]=$t,0}function Fm(K){var ae=t["_"+K];return ae}function Du(K,ae){re.set(K,ae>>>0)}function My(K,ae,Ee,it,$t){var Rt={string:wr=>{var Mi=0;if(wr!=null&&wr!==0){var Qm=(wr.length<<2)+1;Mi=xc(Qm),Y(wr,Mi,Qm)}return Mi},array:wr=>{var Mi=xc(wr.length);return Du(wr,Mi),Mi}};function Ze(wr){return ae==="string"?j(wr):ae==="boolean"?!!wr:wr}var je=Fm(K),Ht=[],lo=0;if(it)for(var Qa=0;QaZe==="number"||Ze==="boolean"),Rt=ae!=="string";return Rt&&$t&&!it?Fm(K):function(){return My(K,ae,Ee,arguments,it)}}var mc={abort:Ay,emscripten_get_heap_max:Ru,emscripten_memcpy_big:Fy,emscripten_resize_heap:zp,fd_close:Am,fd_seek:Py,fd_write:ek},By=cc(),Pm=t.___wasm_call_ctors=function(){return(Pm=t.___wasm_call_ctors=t.asm.__wasm_call_ctors).apply(null,arguments)},Om=t._init=function(){return(Om=t._init=t.asm.init).apply(null,arguments)},zy=t._init_with_threads_count=function(){return(zy=t._init_with_threads_count=t.asm.init_with_threads_count).apply(null,arguments)},Mm=t._get_threads_count=function(){return(Mm=t._get_threads_count=t.asm.get_threads_count).apply(null,arguments)},Vy=t._register_tensor=function(){return(Vy=t._register_tensor=t.asm.register_tensor).apply(null,arguments)},Me=t._dispose_data=function(){return(Me=t._dispose_data=t.asm.dispose_data).apply(null,arguments)},dc=t._dispose=function(){return(dc=t._dispose=t.asm.dispose).apply(null,arguments)},Wy=t._Abs=function(){return(Wy=t._Abs=t.asm.Abs).apply(null,arguments)},Lm=t._Acos=function(){return(Lm=t._Acos=t.asm.Acos).apply(null,arguments)},Vp=t._Acosh=function(){return(Vp=t._Acosh=t.asm.Acosh).apply(null,arguments)},Uy=t._Add=function(){return(Uy=t._Add=t.asm.Add).apply(null,arguments)},Gy=t._AddN=function(){return(Gy=t._AddN=t.asm.AddN).apply(null,arguments)},Hy=t._All=function(){return(Hy=t._All=t.asm.All).apply(null,arguments)},Ky=t._Any=function(){return(Ky=t._Any=t.asm.Any).apply(null,arguments)},qy=t._ArgMax=function(){return(qy=t._ArgMax=t.asm.ArgMax).apply(null,arguments)},Bm=t._ArgMin=function(){return(Bm=t._ArgMin=t.asm.ArgMin).apply(null,arguments)},zm=t._Asin=function(){return(zm=t._Asin=t.asm.Asin).apply(null,arguments)},jy=t._Asinh=function(){return(jy=t._Asinh=t.asm.Asinh).apply(null,arguments)},Xy=t._Atan=function(){return(Xy=t._Atan=t.asm.Atan).apply(null,arguments)},Yy=t._Atan2=function(){return(Yy=t._Atan2=t.asm.Atan2).apply(null,arguments)},fc=t._Atanh=function(){return(fc=t._Atanh=t.asm.Atanh).apply(null,arguments)},Qy=t._AvgPool=function(){return(Qy=t._AvgPool=t.asm.AvgPool).apply(null,arguments)},Zy=t._AvgPool3D=function(){return(Zy=t._AvgPool3D=t.asm.AvgPool3D).apply(null,arguments)},Jy=t._AvgPool3DGrad=function(){return(Jy=t._AvgPool3DGrad=t.asm.AvgPool3DGrad).apply(null,arguments)},Au=t._AvgPoolGrad=function(){return(Au=t._AvgPoolGrad=t.asm.AvgPoolGrad).apply(null,arguments)},eb=t._BatchMatMul=function(){return(eb=t._BatchMatMul=t.asm.BatchMatMul).apply(null,arguments)},tb=t._Bincount=function(){return(tb=t._Bincount=t.asm.Bincount).apply(null,arguments)},Vm=t._BitwiseAnd=function(){return(Vm=t._BitwiseAnd=t.asm.BitwiseAnd).apply(null,arguments)},rb=t._Ceil=function(){return(rb=t._Ceil=t.asm.Ceil).apply(null,arguments)},hc=t._ClipByValue=function(){return(hc=t._ClipByValue=t.asm.ClipByValue).apply(null,arguments)},ob=t._Conv2D=function(){return(ob=t._Conv2D=t.asm.Conv2D).apply(null,arguments)},nb=t._Conv2DBackpropInput=function(){return(nb=t._Conv2DBackpropInput=t.asm.Conv2DBackpropInput).apply(null,arguments)},sb=t._Conv3D=function(){return(sb=t._Conv3D=t.asm.Conv3D).apply(null,arguments)},Oi=t._Conv3DBackpropFilterV2=function(){return(Oi=t._Conv3DBackpropFilterV2=t.asm.Conv3DBackpropFilterV2).apply(null,arguments)},gc=t._Conv3DBackpropInputV2=function(){return(gc=t._Conv3DBackpropInputV2=t.asm.Conv3DBackpropInputV2).apply(null,arguments)},ab=t._Cos=function(){return(ab=t._Cos=t.asm.Cos).apply(null,arguments)},ib=t._Cosh=function(){return(ib=t._Cosh=t.asm.Cosh).apply(null,arguments)},ub=t._CropAndResize=function(){return(ub=t._CropAndResize=t.asm.CropAndResize).apply(null,arguments)},pb=t._Cumprod=function(){return(pb=t._Cumprod=t.asm.Cumprod).apply(null,arguments)},Wm=t._Cumsum=function(){return(Wm=t._Cumsum=t.asm.Cumsum).apply(null,arguments)},Um=t._DenseBincount=function(){return(Um=t._DenseBincount=t.asm.DenseBincount).apply(null,arguments)},lb=t._DepthToSpace=function(){return(lb=t._DepthToSpace=t.asm.DepthToSpace).apply(null,arguments)},cb=t._DepthwiseConv2dNative=function(){return(cb=t._DepthwiseConv2dNative=t.asm.DepthwiseConv2dNative).apply(null,arguments)},Gm=t._Diag=function(){return(Gm=t._Diag=t.asm.Diag).apply(null,arguments)},Hm=t._Dilation2D=function(){return(Hm=t._Dilation2D=t.asm.Dilation2D).apply(null,arguments)},mb=t._Dilation2DBackpropFilter=function(){return(mb=t._Dilation2DBackpropFilter=t.asm.Dilation2DBackpropFilter).apply(null,arguments)},db=t._Dilation2DBackpropInput=function(){return(db=t._Dilation2DBackpropInput=t.asm.Dilation2DBackpropInput).apply(null,arguments)},fb=t._Elu=function(){return(fb=t._Elu=t.asm.Elu).apply(null,arguments)},hb=t._EluGrad=function(){return(hb=t._EluGrad=t.asm.EluGrad).apply(null,arguments)},Km=t._Equal=function(){return(Km=t._Equal=t.asm.Equal).apply(null,arguments)},tk=t._Erf=function(){return(tk=t._Erf=t.asm.Erf).apply(null,arguments)},gb=t._Exp=function(){return(gb=t._Exp=t.asm.Exp).apply(null,arguments)},xb=t._Expm1=function(){return(xb=t._Expm1=t.asm.Expm1).apply(null,arguments)},yb=t._FlipLeftRight=function(){return(yb=t._FlipLeftRight=t.asm.FlipLeftRight).apply(null,arguments)},bb=t._Floor=function(){return(bb=t._Floor=t.asm.Floor).apply(null,arguments)},Cb=t._FloorDiv=function(){return(Cb=t._FloorDiv=t.asm.FloorDiv).apply(null,arguments)},wb=t._FusedBatchNorm=function(){return(wb=t._FusedBatchNorm=t.asm.FusedBatchNorm).apply(null,arguments)},Sb=t._FusedConv2D=function(){return(Sb=t._FusedConv2D=t.asm.FusedConv2D).apply(null,arguments)},Ib=t._FusedDepthwiseConv2D=function(){return(Ib=t._FusedDepthwiseConv2D=t.asm.FusedDepthwiseConv2D).apply(null,arguments)},vb=t._Gather=function(){return(vb=t._Gather=t.asm.Gather).apply(null,arguments)},kb=t._GatherNd=function(){return(kb=t._GatherNd=t.asm.GatherNd).apply(null,arguments)},Nb=t._Greater=function(){return(Nb=t._Greater=t.asm.Greater).apply(null,arguments)},Tb=t._GreaterEqual=function(){return(Tb=t._GreaterEqual=t.asm.GreaterEqual).apply(null,arguments)},_b=t._IsFinite=function(){return(_b=t._IsFinite=t.asm.IsFinite).apply(null,arguments)},Eb=t._IsInf=function(){return(Eb=t._IsInf=t.asm.IsInf).apply(null,arguments)},$b=t._IsNan=function(){return($b=t._IsNan=t.asm.IsNan).apply(null,arguments)},Rb=t._LRN=function(){return(Rb=t._LRN=t.asm.LRN).apply(null,arguments)},Db=t._LRNGrad=function(){return(Db=t._LRNGrad=t.asm.LRNGrad).apply(null,arguments)},Ab=t._LeakyRelu=function(){return(Ab=t._LeakyRelu=t.asm.LeakyRelu).apply(null,arguments)},Fb=t._Less=function(){return(Fb=t._Less=t.asm.Less).apply(null,arguments)},Pb=t._LessEqual=function(){return(Pb=t._LessEqual=t.asm.LessEqual).apply(null,arguments)},Ob=t._LinSpace=function(){return(Ob=t._LinSpace=t.asm.LinSpace).apply(null,arguments)},Mb=t._Log=function(){return(Mb=t._Log=t.asm.Log).apply(null,arguments)},Lb=t._Log1p=function(){return(Lb=t._Log1p=t.asm.Log1p).apply(null,arguments)},Bb=t._LogicalAnd=function(){return(Bb=t._LogicalAnd=t.asm.LogicalAnd).apply(null,arguments)},zb=t._LogicalNot=function(){return(zb=t._LogicalNot=t.asm.LogicalNot).apply(null,arguments)},Vb=t._LogicalOr=function(){return(Vb=t._LogicalOr=t.asm.LogicalOr).apply(null,arguments)},Wb=t._LogicalXor=function(){return(Wb=t._LogicalXor=t.asm.LogicalXor).apply(null,arguments)},Ub=t._Max=function(){return(Ub=t._Max=t.asm.Max).apply(null,arguments)},Gb=t._MaxPool=function(){return(Gb=t._MaxPool=t.asm.MaxPool).apply(null,arguments)},Hb=t._MaxPool3D=function(){return(Hb=t._MaxPool3D=t.asm.MaxPool3D).apply(null,arguments)},Kb=t._MaxPool3DGrad=function(){return(Kb=t._MaxPool3DGrad=t.asm.MaxPool3DGrad).apply(null,arguments)},qb=t._MaxPoolGrad=function(){return(qb=t._MaxPoolGrad=t.asm.MaxPoolGrad).apply(null,arguments)},jb=t._MaxPoolWithArgmax=function(){return(jb=t._MaxPoolWithArgmax=t.asm.MaxPoolWithArgmax).apply(null,arguments)},Xb=t._Maximum=function(){return(Xb=t._Maximum=t.asm.Maximum).apply(null,arguments)},Yb=t._Mean=function(){return(Yb=t._Mean=t.asm.Mean).apply(null,arguments)},Qb=t._Min=function(){return(Qb=t._Min=t.asm.Min).apply(null,arguments)},Zb=t._Minimum=function(){return(Zb=t._Minimum=t.asm.Minimum).apply(null,arguments)},Jb=t._MirrorPad=function(){return(Jb=t._MirrorPad=t.asm.MirrorPad).apply(null,arguments)},eC=t._Mod=function(){return(eC=t._Mod=t.asm.Mod).apply(null,arguments)},tC=t._Multinomial=function(){return(tC=t._Multinomial=t.asm.Multinomial).apply(null,arguments)},rC=t._Multiply=function(){return(rC=t._Multiply=t.asm.Multiply).apply(null,arguments)},oC=t._Neg=function(){return(oC=t._Neg=t.asm.Neg).apply(null,arguments)},nC=t._NonMaxSuppressionV3=function(){return(nC=t._NonMaxSuppressionV3=t.asm.NonMaxSuppressionV3).apply(null,arguments)},sC=t._NonMaxSuppressionV4=function(){return(sC=t._NonMaxSuppressionV4=t.asm.NonMaxSuppressionV4).apply(null,arguments)},aC=t._NonMaxSuppressionV5=function(){return(aC=t._NonMaxSuppressionV5=t.asm.NonMaxSuppressionV5).apply(null,arguments)},iC=t._NotEqual=function(){return(iC=t._NotEqual=t.asm.NotEqual).apply(null,arguments)},uC=t._OneHot=function(){return(uC=t._OneHot=t.asm.OneHot).apply(null,arguments)},pC=t._PadV2=function(){return(pC=t._PadV2=t.asm.PadV2).apply(null,arguments)},lC=t._Pow=function(){return(lC=t._Pow=t.asm.Pow).apply(null,arguments)},cC=t._Prelu=function(){return(cC=t._Prelu=t.asm.Prelu).apply(null,arguments)},mC=t._Prod=function(){return(mC=t._Prod=t.asm.Prod).apply(null,arguments)},dC=t._RealDiv=function(){return(dC=t._RealDiv=t.asm.RealDiv).apply(null,arguments)},fC=t._Reciprocal=function(){return(fC=t._Reciprocal=t.asm.Reciprocal).apply(null,arguments)},hC=t._Relu=function(){return(hC=t._Relu=t.asm.Relu).apply(null,arguments)},gC=t._Relu6=function(){return(gC=t._Relu6=t.asm.Relu6).apply(null,arguments)},xC=t._ResizeBilinear=function(){return(xC=t._ResizeBilinear=t.asm.ResizeBilinear).apply(null,arguments)},yC=t._ResizeBilinearGrad=function(){return(yC=t._ResizeBilinearGrad=t.asm.ResizeBilinearGrad).apply(null,arguments)},bC=t._ResizeNearestNeighbor=function(){return(bC=t._ResizeNearestNeighbor=t.asm.ResizeNearestNeighbor).apply(null,arguments)},CC=t._ResizeNearestNeighborGrad=function(){return(CC=t._ResizeNearestNeighborGrad=t.asm.ResizeNearestNeighborGrad).apply(null,arguments)},wC=t._Reverse=function(){return(wC=t._Reverse=t.asm.Reverse).apply(null,arguments)},SC=t._RotateWithOffset=function(){return(SC=t._RotateWithOffset=t.asm.RotateWithOffset).apply(null,arguments)},IC=t._Round=function(){return(IC=t._Round=t.asm.Round).apply(null,arguments)},vC=t._Rsqrt=function(){return(vC=t._Rsqrt=t.asm.Rsqrt).apply(null,arguments)},kC=t._ScatterNd=function(){return(kC=t._ScatterNd=t.asm.ScatterNd).apply(null,arguments)},NC=t._SearchSorted=function(){return(NC=t._SearchSorted=t.asm.SearchSorted).apply(null,arguments)},TC=t._SelectV2=function(){return(TC=t._SelectV2=t.asm.SelectV2).apply(null,arguments)},_C=t._Selu=function(){return(_C=t._Selu=t.asm.Selu).apply(null,arguments)},EC=t._Sigmoid=function(){return(EC=t._Sigmoid=t.asm.Sigmoid).apply(null,arguments)},$C=t._Sign=function(){return($C=t._Sign=t.asm.Sign).apply(null,arguments)},RC=t._Sin=function(){return(RC=t._Sin=t.asm.Sin).apply(null,arguments)},DC=t._Sinh=function(){return(DC=t._Sinh=t.asm.Sinh).apply(null,arguments)},AC=t._Softmax=function(){return(AC=t._Softmax=t.asm.Softmax).apply(null,arguments)},FC=t._Softplus=function(){return(FC=t._Softplus=t.asm.Softplus).apply(null,arguments)},PC=t._SparseFillEmptyRows=function(){return(PC=t._SparseFillEmptyRows=t.asm.SparseFillEmptyRows).apply(null,arguments)},OC=t._SparseReshape=function(){return(OC=t._SparseReshape=t.asm.SparseReshape).apply(null,arguments)},MC=t._SparseSegmentReduction=function(){return(MC=t._SparseSegmentReduction=t.asm.SparseSegmentReduction).apply(null,arguments)},LC=t._SparseToDense=function(){return(LC=t._SparseToDense=t.asm.SparseToDense).apply(null,arguments)},BC=t._Sqrt=function(){return(BC=t._Sqrt=t.asm.Sqrt).apply(null,arguments)},zC=t._Square=function(){return(zC=t._Square=t.asm.Square).apply(null,arguments)},VC=t._SquaredDifference=function(){return(VC=t._SquaredDifference=t.asm.SquaredDifference).apply(null,arguments)},WC=t._Step=function(){return(WC=t._Step=t.asm.Step).apply(null,arguments)},UC=t._StridedSlice=function(){return(UC=t._StridedSlice=t.asm.StridedSlice).apply(null,arguments)},GC=t._Sub=function(){return(GC=t._Sub=t.asm.Sub).apply(null,arguments)},HC=t._Sum=function(){return(HC=t._Sum=t.asm.Sum).apply(null,arguments)},KC=t._Tan=function(){return(KC=t._Tan=t.asm.Tan).apply(null,arguments)},qC=t._Tanh=function(){return(qC=t._Tanh=t.asm.Tanh).apply(null,arguments)},jC=t._TensorScatterUpdate=function(){return(jC=t._TensorScatterUpdate=t.asm.TensorScatterUpdate).apply(null,arguments)},XC=t._Tile=function(){return(XC=t._Tile=t.asm.Tile).apply(null,arguments)},YC=t._TopK=function(){return(YC=t._TopK=t.asm.TopK).apply(null,arguments)},QC=t._Transform=function(){return(QC=t._Transform=t.asm.Transform).apply(null,arguments)},ZC=t._Transpose=function(){return(ZC=t._Transpose=t.asm.Transpose).apply(null,arguments)},JC=t.__FusedMatMul=function(){return(JC=t.__FusedMatMul=t.asm._FusedMatMul).apply(null,arguments)},ew=t._malloc=function(){return(ew=t._malloc=t.asm.malloc).apply(null,arguments)},tw=t._free=function(){return(tw=t._free=t.asm.free).apply(null,arguments)},rw=t.___errno_location=function(){return(rw=t.___errno_location=t.asm.__errno_location).apply(null,arguments)},qm=t.stackSave=function(){return(qm=t.stackSave=t.asm.stackSave).apply(null,arguments)},jm=t.stackRestore=function(){return(jm=t.stackRestore=t.asm.stackRestore).apply(null,arguments)},xc=t.stackAlloc=function(){return(xc=t.stackAlloc=t.asm.stackAlloc).apply(null,arguments)},ow=t.dynCall_iijjiiii=function(){return(ow=t.dynCall_iijjiiii=t.asm.dynCall_iijjiiii).apply(null,arguments)},nw=t.dynCall_jiji=function(){return(nw=t.dynCall_jiji=t.asm.dynCall_jiji).apply(null,arguments)};t.cwrap=Ly;var Wp;ir=function K(){Wp||Xm(),Wp||(ir=K)};function Xm(K){if(K=K||i,Et>0||(gt(),Et>0))return;function ae(){Wp||(Wp=!0,t.calledRun=!0,!M&&(xt(),o(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Ur()))}t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),ae()},1)):ae()}if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();Xm();var Up;s&&(Up={uncaughtException:process.listeners("uncaughtException").filter(function(K){return!s.uncaughtException.indexOf(K)>-1}),unhandledRejection:process.listeners("unhandledRejection").filter(function(K){return!s.unhandledRejection.indexOf(K)>-1})});var Gp;if(typeof e!="undefined")Gp=e;else if(typeof WasmBackendModuleThreadedSimd!="undefined")Gp=WasmBackendModuleThreadedSimd;else throw new Error("Could not find wasm module in post.js");if(Up){var sw=Gp._dispose;Gp._dispose=function(){sw(),Up.uncaughtException.forEach(function(K){process.removeListener("uncaughtException",K)}),Up.unhandledRejection.forEach(function(K){process.removeListener("unhandledRejection",K)})}}return e.ready}})();typeof ex=="object"&&typeof sv=="object"?sv.exports=nv:typeof define=="function"&&define.amd?define([],function(){return nv}):typeof ex=="object"&&(ex.WasmBackendModule=nv)});var mn=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}},mo=class{refCount(e){return Hr("refCount")}incRef(e){return Hr("incRef")}timerAvailable(){return!0}time(e){return Hr("time")}read(e){return Hr("read")}readSync(e){return Hr("readSync")}readToGPU(e,t){return Hr("readToGPU")}numDataIds(){return Hr("numDataIds")}disposeData(e,t){return Hr("disposeData")}write(e,t,o){return Hr("write")}move(e,t,o,n,s){return Hr("move")}createTensorFromGPUData(e,t,o){return Hr("createTensorFromGPUData")}memory(){return Hr("memory")}floatPrecision(){return Hr("floatPrecision")}epsilon(){return this.floatPrecision()===32?1e-7:1e-4}dispose(){return Hr("dispose")}};function Hr(r){throw new Error(`'${r}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}function lk(r){let e=r.length,t=0;for(;e>0;)t=Math.random()*e|0,e--,nd(r,e,t)}function J4(r,e){if(r.length!==e.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${r.length}Second array length was ${e.length}`);let t=r.length,o=0;for(;t>0;)o=Math.random()*t|0,t--,nd(r,t,o),nd(e,t,o)}function qp(r,e,t){return Math.max(r,Math.min(e,t))}function eH(r){return r%2===0?r:r+1}function nd(r,e,t){let o=r[e];r[e]=r[t],r[t]=o}function tH(r){let e=0;for(let t=0;tt+` Shapes ${r} and ${e} must match`)}function fo(r){$(r!=null,()=>"The input to the tensor constructor must be a non-null value.")}function ze(r){if(r.length===0)return 1;let e=r[0];for(let t=1;t0,t,o){return new Promise((n,s)=>{let a=0,i=()=>{if(r()){n();return}a++;let p=e(a);if(t!=null&&a>=t){s();return}o!=null?o(i,p):setTimeout(i,p)};i()})}function pH(r,e){let t=1,o=-1;for(let s=0;s=0)t*=r[s];else if(r[s]===-1){if(o!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${o} and dim ${s}`);o=s}else if(r[s]<0)throw Error(`Shapes can not be < 0. Found ${r[s]} at dim ${s}`);if(o===-1){if(e>0&&e!==t)throw Error(`Size(${e}) must match the product of shape ${r}`);return r}if(t===0)throw Error(`Cannot infer the missing size in [${r}] when there are 0 elements`);if(e%t!==0)throw Error(`The implicit shape can't be a fractional number. Got ${e} / ${t}`);let n=r.slice();return n[o]=e/t,n}function Li(r,e){let t=e.length;return r=r==null?e.map((o,n)=>n):[].concat(r),$(r.every(o=>o>=-t&&o`All values in axis param must be in range [-${t}, ${t}) but got axis ${r}`),$(r.every(o=>Ja(o)),()=>`All values in axis param must be integers but got axis ${r}`),r.map(o=>o<0?t+o:o)}function mw(r,e){let t=[],o=[],n=e!=null&&Array.isArray(e)&&e.length===0,s=e==null||n?null:Li(e,r).sort(),a=0;for(let i=0;ii)&&r[i]===1&&(t.push(r[i]),o.push(i)),s[a]<=i&&a++}r[i]!==1&&(t.push(r[i]),o.push(i))}return{newShape:t,keptDims:o}}function dw(r,e){return sd(r,e)}function sd(r,e){let t=null;if(r==null||r==="float32")t=new Float32Array(e);else if(r==="int32")t=new Int32Array(e);else if(r==="bool")t=new Uint8Array(e);else if(r==="string")t=new Array(e);else throw new Error(`Unknown data type ${r}`);return t}function fw(r,e){for(let t=0;te+=t.length),e}function dn(r){return typeof r=="string"||r instanceof String}function ck(r){return typeof r=="boolean"}function mk(r){return typeof r=="number"}function Bi(r){return Array.isArray(r)?Bi(r[0]):r instanceof Float32Array?"float32":r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray?"int32":mk(r)?"float32":dn(r)?"string":ck(r)?"bool":"float32"}function ra(r){return!!(r&&r.constructor&&r.call&&r.apply)}function Xp(r,e){for(let t=e;t=0;--o)t[o]=t[o+1]*r[o+1];return t}function dk(r,e,t,o=!1){let n=new Array;if(e.length===1){let s=e[0]*(o?2:1);for(let a=0;ap*u)*(o?2:1);for(let p=0;pn*s)*(t?2:1);if(o===0)return[];if(o!==e.length)throw new Error(`[${r}] does not match the input size ${e.length}${t?" for a complex tensor":""}.`);return dk(0,r,e,t)}function cH(r,e){if(Array.isArray(r))return r;if(e==="float32")return r instanceof Float32Array?r:new Float32Array(r);if(e==="int32")return r instanceof Int32Array?r:new Int32Array(r);if(e==="bool"||e==="string")return Uint8Array.from(new Int32Array(r));throw new Error(`Unknown dtype ${e}`)}function bc(r,e){let t=Yp(r,e);for(let o=0;oo*n,1);if(e==null||e==="float32")return Fu(r,new Float32Array(t));if(e==="int32")return Fu(r,new Int32Array(t));if(e==="bool")return Fu(r,new Uint8Array(t));throw new Error(`Unknown data type ${e}`)}function St(r){r.forEach(e=>{$(Number.isInteger(e)&&e>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${r}].`)})}function dH(r,e,t){if(e===0)return 0;if(e===1)return r[0];let o=r[r.length-1];for(let n=0;n{let[n,s]=o.split(":");this.urlFlags[n]=yH(n,s)})}};function gH(r){let e={};return r.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(t,...o)=>(xH(e,o[0],o[1]),o.join("="))),e}function xH(r,e,t){r[decodeURIComponent(e)]=decodeURIComponent(t||"")}function yH(r,e){let t=e.toLowerCase();return t==="true"||t==="false"?t==="true":`${+t}`===t?+t:e}function A(){return xw}var xw=null;function hk(r){xw=r}var yw;function bw(){if(yw==null){let r;if(typeof window!="undefined")r=window;else if(typeof global!="undefined")r=global;else if(typeof process!="undefined")r=process;else if(typeof self!="undefined")r=self;else throw new Error("Could not find a global object");yw=r}return yw}function bH(){let r=bw();return r._tfGlobals==null&&(r._tfGlobals=new Map),r._tfGlobals}function wc(r,e){let t=bH();if(t.has(r))return t.get(r);{let o=e();return t.set(r,o),t.get(r)}}var fn="Abs",hn="Acos",gn="Acosh",Rr="Add",xn="AddN",yn="All",bn="Any",na="ArgMax",sa="ArgMin",Cn="Asin",wn="Asinh",Sn="Atan",In="Atanh",vn="Atan2",kn="AvgPool",zi="AvgPoolGrad",aa="AvgPool3D",Vi="AvgPool3DGrad",Nn="BatchMatMul",ia="BatchToSpaceND",Tn="Bincount",_n="BitwiseAnd",Sme="BroadcastTo",ua="BroadcastArgs",ho="Cast",go="Ceil",Go="ClipByValue",ei="Complex",Wi="ComplexAbs",pa="Concat",En="Conv2D",Ui="Conv2DBackpropFilter",$n="Conv2DBackpropInput",Rn="Conv3D",ti="Conv3DBackpropFilterV2",Dn="Conv3DBackpropInputV2",An="Cos",Fn="Cosh",Pn="Cumprod",On="Cumsum",Mn="CropAndResize",la="DenseBincount",Ln="DepthToSpace",Bn="DepthwiseConv2dNative",Gi="DepthwiseConv2dNativeBackpropFilter",Hi="DepthwiseConv2dNativeBackpropInput",ca="Diag",zn="Dilation2D",Ki="Dilation2DBackpropInput",qi="Dilation2DBackpropFilter",Mu="Draw",Vn="RealDiv",ji="Einsum",Wn="Elu",ri="EluGrad",Un="Erf",xo="Equal",yo="Exp",ma="ExpandDims",bo="Expm1",Xi="FFT",da="Fill",Gn="FlipLeftRight",Co="Floor",wo="FloorDiv",Hn="FusedBatchNorm",fa="GatherV2",Kn="GatherNd",So="Greater",Io="GreaterEqual",vo="Identity",Yi="IFFT",Qi="Imag",qn="IsFinite",jn="IsInf",Xn="IsNan",Yn="LeakyRelu",ko="Less",No="LessEqual",Qn="LinSpace",To="Log",Zn="Log1p",Jn="LogicalAnd",es="LogicalNot",ts="LogicalOr",gk="LogicalXor",Ime="LogSoftmax",vme="LowerBound",rs="LRN",oi="LRNGrad",kme="MatrixBandPart",os="Max",_o="Maximum",ns="MaxPool",Zi="MaxPoolGrad",ha="MaxPool3D",Ji="MaxPool3DGrad",ga="MaxPoolWithArgmax",ss="Mean",as="Min",Eo="Minimum",is="MirrorPad",us="Mod",ps="Multinomial",$o="Multiply",ls="Neg",Ro="NotEqual",cs="NonMaxSuppressionV3",ni="NonMaxSuppressionV4",ms="NonMaxSuppressionV5",xa="OnesLike",ds="OneHot",ya="Pack",fs="PadV2",Nme="Pool",hs="Pow",gs="Prelu",Ho="Prod",Qp="RaggedGather",Zp="RaggedRange",Jp="RaggedTensorToTensor",ba="Range",si="Real",xs="Reciprocal",ys="Relu",Ca="Reshape",bs="ResizeNearestNeighbor",ai="ResizeNearestNeighborGrad",Cs="ResizeBilinear",ii="ResizeBilinearGrad",ws="Relu6",Ss="Reverse",Is="Round",Do="Rsqrt",vs="ScatterNd",ks="TensorScatterUpdate",Ns="SearchSorted",wa="Select",Ts="Selu",_s="Slice",Es="Sin",$s="Sinh",Rs="Sign",Ao="Sigmoid",Ds="Softplus",Fo="Sqrt",As="Sum",Sa="SpaceToBatchND",Ia="SplitV",Fs="Softmax",eu="SparseFillEmptyRows",ui="SparseReshape",va="SparseSegmentMean",ka="SparseSegmentSum",Ps="SparseToDense",Po="SquaredDifference",tu="Square",pi="StaticRegexReplace",Os="StridedSlice",Na="StringNGrams",ru="StringSplit",ou="StringToHashBucketFast",Oo="Sub",Ms="Tan",Ls="Tanh",Mo="Tile",Bs="TopK",zs="Transform",Kr="Transpose",nu="Unique",Ta="Unpack",su="UnsortedSegmentSum",Tme="UpperBound",_a="ZerosLike",Ko="Step",Lu="FromPixels",Vs="RotateWithOffset",qo="_FusedMatMul",jo="FusedConv2D",Xo="FusedDepthwiseConv2D";function Ea(...r){A().getBool("IS_TEST")||A().getBool("PROD")||console.warn(...r)}function CH(...r){A().getBool("IS_TEST")||A().getBool("PROD")||console.log(...r)}var el=wc("kernelRegistry",()=>new Map),Sc=wc("gradRegistry",()=>new Map);function tl(r,e){let t=ww(r,e);return el.get(t)}function Cw(r){return Sc.get(r)}function ad(r){let e=el.entries(),t=[];for(;;){let{done:o,value:n}=e.next();if(o)break;let[s,a]=n,[i]=s.split("_");i===r&&t.push(a)}return t}function li(r){let{kernelName:e,backendName:t}=r,o=ww(e,t);el.has(o)&&Ea(`The kernel '${e}' for backend '${t}' is already registered`),el.set(o,r)}function Dme(r){let{kernelName:e}=r;Sc.has(e)&&A().getBool("DEBUG")&&Ea(`Overriding the gradient for '${e}'`),Sc.set(e,r)}function Ame(r,e){let t=ww(r,e);if(!el.has(t))throw new Error(`The kernel '${r}' for backend '${e}' is not registered`);el.delete(t)}function Fme(r){if(!Sc.has(r))throw new Error(`The gradient '${r}' for backend is not registered`);Sc.delete(r)}function Pme(r,e){ad(r).forEach(o=>{let n=Object.assign({},o,{backendName:e});li(n)})}function ww(r,e){return`${e}_${r}`}var y={};qe(y,{arraysEqual:()=>Sr,arraysEqualWithNull:()=>cw,assert:()=>$,assertNonNegativeIntegerDimensions:()=>St,assertNonNull:()=>fo,assertShapesMatch:()=>yt,bytesFromStringArray:()=>gw,bytesPerElement:()=>jp,checkConversionForErrors:()=>fw,clamp:()=>qp,computeStrides:()=>oa,convertBackendValuesAndArrayBuffer:()=>cH,createScalarValue:()=>TH,createShuffledIndices:()=>iH,decodeString:()=>sl,distSquared:()=>oH,encodeString:()=>iu,fetch:()=>EH,fingerPrint64:()=>NH,flatten:()=>Us,getArrayFromDType:()=>sd,getTypedArrayFromDType:()=>dw,hasEncodingLoss:()=>lH,hexToLong:()=>Ic,indexToLoc:()=>fH,inferDtype:()=>Bi,inferFromImplicitShape:()=>pH,isBoolean:()=>ck,isFunction:()=>ra,isInt:()=>Ja,isNumber:()=>mk,isPromise:()=>Ou,isScalarShape:()=>nH,isString:()=>dn,isTypedArray:()=>Mt,isValidDtype:()=>hw,locToIndex:()=>dH,makeOnesTypedArray:()=>bc,makeZerosNestedTypedArray:()=>mH,makeZerosTypedArray:()=>Yp,nearestDivisor:()=>Xp,nearestLargerEven:()=>eH,now:()=>Uu,parseAxisParam:()=>Li,randUniform:()=>rH,repeatedTry:()=>uH,rightPad:()=>Pu,shuffle:()=>lk,shuffleCombo:()=>J4,sizeFromShape:()=>ze,sizeToSquarishShape:()=>aH,squeezeShape:()=>mw,sum:()=>tH,swap:()=>nd,tanh:()=>sH,toNestedArray:()=>Fu,toTypedArray:()=>nl});function id(r){return r instanceof Float32Array||r instanceof Int32Array||r instanceof Uint8Array||r instanceof Uint8ClampedArray}var kw=Kp(_k());var Wu=kw.default||kw;function Ic(r){return Wu.fromString(r,!0,16)}var $k=Ic("c3a5c85c97cb3127"),Vu=Ic("b492b66fbe98f273"),Ir=Ic("9ae16a3b2f90404f");function vw(r){return r.xor(r.shru(47))}function Rk(r,e,t){let o=r.slice(e,e+t);return Wu.fromBytes(Array.from(o),!0,!0)}function It(r,e){return Rk(r,e,8)}function Ek(r,e){return Rk(r,e,4)}function Jt(r,e){return e===0?r:r.shru(e).or(r.shl(64-e))}function au(r,e,t=Ic("9ddfea08eb382d69")){let o=r.xor(e).mul(t);o=o.xor(o.shru(47));let n=e.xor(o).mul(t);return n=n.xor(n.shru(47)),n=n.mul(t),n}function SH(r,e,t,o,n,s){n=n.add(r),s=Jt(s.add(n).add(o),21);let a=n;return n=n.add(e),n=n.add(t),s=s.add(Jt(n,44)),[n.add(o),s.add(a)]}function pd(r,e,t,o){return SH(It(r,e),It(r,e+8),It(r,e+16),It(r,e+24),t,o)}function IH(r,e=r.length){if(e>=8){let t=Ir.add(e*2),o=It(r,0).add(Ir),n=It(r,e-8),s=Jt(n,37).mul(t).add(o),a=Jt(o,25).add(n).mul(t);return au(s,a,t)}if(e>=4){let t=Ir.add(e*2),o=Ek(r,0);return au(o.shl(3).add(e),Ek(r,e-4),t)}if(e>0){let t=r[0],o=r[e>>1],n=r[e-1],s=t+(o<<8),a=e+(n<<2);return vw(Ir.mul(s).xor($k.mul(a))).mul(Ir)}return Ir}function vH(r,e=r.length){let t=Ir.add(e*2),o=It(r,0).mul(Vu),n=It(r,8),s=It(r,e-8).mul(t),a=It(r,e-16).mul(Ir);return au(Jt(o.add(n),43).add(Jt(s,30)).add(a),o.add(Jt(n.add(Ir),18)).add(s),t)}function kH(r,e=r.length){let t=Ir.add(e*2),o=It(r,0).mul(Ir),n=It(r,8),s=It(r,e-8).mul(t),a=It(r,e-16).mul(Ir),i=Jt(o.add(n),43).add(Jt(s,30)).add(a),p=au(i,o.add(Jt(n.add(Ir),18)).add(s),t),u=It(r,16).mul(t),l=It(r,24),c=i.add(It(r,e-32)).mul(t),m=p.add(It(r,e-24)).mul(t);return au(Jt(u.add(l),43).add(Jt(c,30)).add(m),u.add(Jt(l.add(o),18)).add(c),t)}function NH(r,e=r.length){let t=Wu.fromNumber(81,!0);if(e<=32)return e<=16?IH(r,e):vH(r,e);if(e<=64)return kH(r,e);let o=t,n=t.mul(Vu).add(113),s=vw(n.mul(Ir).add(113)).mul(Ir),a=[Wu.UZERO,Wu.UZERO],i=[Wu.UZERO,Wu.UZERO];o=o.mul(Ir).add(It(r,0));let p=0,u=(e-1>>6)*64,l=u+(e-1&63)-63;do o=Jt(o.add(n).add(a[0]).add(It(r,p+8)),37).mul(Vu),n=Jt(n.add(a[1]).add(It(r,p+48)),42).mul(Vu),o=o.xor(i[1]),n=n.add(a[0]).add(It(r,p+40)),s=Jt(s.add(i[0]),33).mul(Vu),a=pd(r,p,a[1].mul(Vu),o.add(i[0])),i=pd(r,p+32,s.add(i[1]),n.add(It(r,p+16))),[s,o]=[o,s],p+=64;while(p!==u);let c=Vu.add(s.and(255).shl(1));return p=l,i[0]=i[0].add(e-1&63),a[0]=a[0].add(i[0]),i[0]=i[0].add(a[0]),o=Jt(o.add(n).add(a[0]).add(It(r,p+8)),37).mul(c),n=Jt(n.add(a[1]).add(It(r,p+48)),42).mul(c),o=o.xor(i[1].mul(9)),n=n.add(a[0].mul(9).add(It(r,p+40))),s=Jt(s.add(i[0]),33).mul(c),a=pd(r,p,a[1].mul(c),o.add(i[0])),i=pd(r,p+32,s.add(i[1]),n.add(It(r,p+16))),[s,o]=[o,s],au(au(a[0],i[0],c).add(vw(n).mul($k)).add(s),au(a[1],i[1],c).add(o),c)}function TH(r,e){return e==="string"?iu(r):nl([r],e)}function _H(r,e){return r instanceof Float32Array&&e==="float32"||r instanceof Int32Array&&e==="int32"||r instanceof Uint8Array&&e==="bool"}function nl(r,e){if(e==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(r)&&(r=Us(r)),A().getBool("DEBUG")&&fw(r,e),_H(r,e))return r;if(e==null||e==="float32"||e==="complex64")return new Float32Array(r);if(e==="int32")return new Int32Array(r);if(e==="bool"){let t=new Uint8Array(r.length);for(let o=0;o{n=o()},a,i=Uu();if(this.backendTimer.timerAvailable())a=this.backendTimer.time(s);else{s();for(let u of n)u.dataSync();a=Promise.resolve({kernelMs:Uu()-i})}if(A().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let u=0;u{$H(c,l.dtype,e)})}return{kernelName:e,outputs:n,inputs:t,timeMs:a.then(u=>u.kernelMs),extraInfo:a.then(u=>u.getExtraProfileInfo!=null?u.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:o,timeMs:n,inputs:s,extraInfo:a}=e;o.forEach(i=>{Promise.all([i.data(),n,a]).then(p=>{this.logger.logKernelProfile(t,i,p[0],p[1],s,p[2])})})}};function $H(r,e,t){if(e!=="float32")return!1;for(let o=0;o0?h:""} `}}console.log(`%c${p} %c${i} %c${u}D ${c} %c${l} %c${m} %c${a}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}};function Dk(r,e,t){let o={},n={};for(let p=0;po[h.id]=!0),d=!0,n[u.id]=!0;break}if(d)break}}let s={};s[t.id]=!0;let a={};for(let p=r.length-1;p>=0;p--){let u=r[p],l=u.inputs;for(let c=0;c=0;n--){let s=e[n],a=[];if(s.outputs.forEach(p=>{let u=r[p.id];u!=null?a.push(u):a.push(null)}),s.gradient==null)throw new Error(`Cannot compute gradient: gradient function not found for ${s.kernelName}.`);let i=s.gradient(a);for(let p in s.inputs){if(!(p in i))throw new Error(`Cannot backprop through input ${p}. Available gradients found: ${Object.keys(i)}.`);let u=t(()=>i[p]());if(u.dtype!=="float32")throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input ${p} must have 'float32' dtype, but has '${u.dtype}'`);let l=s.inputs[p];if(!Sr(u.shape,l.shape))throw new Error(`Error in gradient for op ${s.kernelName}. The gradient of input '${p}' has shape '${u.shape}', which does not match the shape of the input '${l.shape}'`);if(r[l.id]==null)r[l.id]=u;else{let c=r[l.id];r[l.id]=o(c,u),c.dispose()}}}}var Fk=20,vc=3,Tw=7;function Pk(r,e,t,o){let n=oa(e),s=RH(r,e,t,n),a=e.length,i=cd(r,e,t,n,s),p=["Tensor"];return o&&(p.push(` dtype: ${t}`),p.push(` rank: ${a}`),p.push(` shape: [${e}]`),p.push(" values:")),p.push(i.map(u=>" "+u).join(` `)),p.join(` -`)}function a4(r,t,e,o){let n=He(t),s=o[o.length-1],a=new Array(s).fill(0),i=t.length,p=e==="complex64"?xl(r):r;if(i>1)for(let u=0;uj0){let g=hl*a,x=Array.from(r.slice(0,g)),b=Array.from(r.slice((i-hl)*a,i*a));return e==="complex64"&&(x=xl(x),b=xl(b)),["["+x.map((C,S)=>gl(C,n[S],e)).join(", ")+", ..., "+b.map((C,S)=>gl(C,n[i-hl+S],e)).join(", ")+"]"]}return["["+(e==="complex64"?xl(r):Array.from(r)).map((g,x)=>gl(g,n[x],e)).join(", ")+"]"]}let u=t.slice(1),c=o.slice(1),l=o[0]*a,m=[];if(i>j0){for(let h=0;h0?m[0]+d:"");for(let h=1;h1)for(let u=0;uFk){let g=vc*a,x=Array.from(r.slice(0,g)),b=Array.from(r.slice((i-vc)*a,i*a));return t==="complex64"&&(x=Nc(x),b=Nc(b)),["["+x.map((w,S)=>kc(w,n[S],t)).join(", ")+", ..., "+b.map((w,S)=>kc(w,n[i-vc+S],t)).join(", ")+"]"]}return["["+(t==="complex64"?Nc(r):Array.from(r)).map((g,x)=>kc(g,n[x],t)).join(", ")+"]"]}let u=e.slice(1),l=o.slice(1),c=o[0]*a,m=[];if(i>Fk){for(let h=0;h0?m[0]+d:"");for(let h=1;h`Length of values '${n}' does not match the size inferred by the shape '${this.size}'.`)}if(e==="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=o||qm(e,this.size),this.strides=js(t)}set(t,...e){e.length===0&&(e=[0]),$(e.length===this.rank,()=>`The number of provided coordinates (${e.length}) must match the rank (${this.rank})`);let o=this.locToIndex(e);this.values[o]=t}get(...t){t.length===0&&(t=[0]);let e=0;for(let n of t){if(n<0||n>=this.shape[e]){let s=`Requested out of range element at ${t}. Buffer shape=${this.shape}`;throw new Error(s)}e++}let o=t[t.length-1];for(let n=0;nQp(o))}catch(o){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return t}dataToGPU(t){return this.throwIfDisposed(),Ps().readToGPU(this.dataId,t)}dataSync(){this.throwIfDisposed();let t=Ps().readSync(this.dataId);if(this.dtype==="string")try{return t.map(e=>Qp(e))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return t}async bytes(){this.throwIfDisposed();let t=await Ps().read(this.dataId);return this.dtype==="string"?t:new Uint8Array(t.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Ps().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(t=!1){return Zp.print(this,t)}clone(){return this.throwIfDisposed(),Zp.clone(this)}toString(t=!1){let e=this.dataSync();return X0(e,this.shape,this.dtype,t)}cast(t){return this.throwIfDisposed(),Zp.cast(this,t)}variable(t=!0,e,o){return this.throwIfDisposed(),Ps().makeVariable(this,t,e,o)}};Object.defineProperty(mt,Symbol.hasInstance,{value:r=>!!r&&r.data!=null&&r.dataSync!=null&&r.throwIfDisposed!=null});function fw(){return ml("Tensor",()=>mt)}fw();var ri=class extends mt{constructor(t,e,o,n){super(t.shape,t.dtype,t.dataId,n),this.trainable=e,this.name=o}assign(t){if(t.dtype!==this.dtype)throw new Error(`dtype of the new value (${t.dtype}) and previous value (${this.dtype}) must match`);if(!br(t.shape,this.shape))throw new Error(`shape of the new value (${t.shape}) and previous value (${this.shape}) must match`);Ps().disposeTensor(this),this.dataId=t.dataId,Ps().incRef(this,null)}dispose(){Ps().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(ri,Symbol.hasInstance,{value:r=>r instanceof mt&&r.assign!=null&&r.assign instanceof Function});var tk={};qe(tk,{assertTypesMatch:()=>Cw,getTensorsInContainer:()=>yl,isTensorInList:()=>p4,makeTypesMatch:()=>Oe});var hw;(function(r){r.R0="R0",r.R1="R1",r.R2="R2",r.R3="R3",r.R4="R4",r.R5="R5",r.R6="R6"})(hw||(hw={}));var gw;(function(r){r.float32="float32",r.int32="int32",r.bool="int32",r.complex64="complex64"})(gw||(gw={}));var xw;(function(r){r.float32="float32",r.int32="int32",r.bool="bool",r.complex64="complex64"})(xw||(xw={}));var yw;(function(r){r.float32="float32",r.int32="float32",r.bool="float32",r.complex64="complex64"})(yw||(yw={}));var bw;(function(r){r.float32="complex64",r.int32="complex64",r.bool="complex64",r.complex64="complex64"})(bw||(bw={}));var u4={float32:yw,int32:gw,bool:xw,complex64:bw};function dt(r,t){if(r==="string"||t==="string"){if(r==="string"&&t==="string")return"string";throw new Error(`Can not upcast ${r} with ${t}`)}return u4[r][t]}function oi(r){return dt(r,"int32")}function ed(r){return r!=null&&typeof r=="object"&&"texture"in r&&r.texture instanceof WebGLTexture}function td(r){return typeof GPUBuffer!="undefined"&&r!=null&&typeof r=="object"&&"buffer"in r&&r.buffer instanceof GPUBuffer}function Oe(r,t){if(r.dtype===t.dtype)return[r,t];let e=dt(r.dtype,t.dtype);return[r.cast(e),t.cast(e)]}function Cw(r,t){$(r.dtype===t.dtype,()=>`The dtypes of the first(${r.dtype}) and second(${t.dtype}) input must match`)}function p4(r,t){return t.some(e=>e.id===r.id)}function yl(r){let t=[];return ek(r,t,new Set),t}function ek(r,t,e){if(r==null)return;if(r instanceof mt){t.push(r);return}if(!c4(r))return;let o=r;for(let n in o){let s=o[n];e.has(s)||(e.add(s),ek(s,t,e))}}function c4(r){return Array.isArray(r)||typeof r=="object"}function ww(r){return r.kernelName!=null}var rd=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(t=>t.name)))}}}dispose(){for(let t in this.registeredVariables)this.registeredVariables[t].dispose()}},bl=class r{constructor(t){this.ENV=t,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new rd}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let t=this.getSortedBackends();for(let e=0;e{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(t){jm(t).forEach(o=>{o.disposeFunc!=null&&o.disposeFunc(this.registry[t])})}initializeBackend(t){let e=this.registryFactory[t];if(e==null)throw new Error(`Cannot initialize backend ${t}, no registration found.`);try{let o=e.factory();if(o&&!(o instanceof so)&&typeof o.then=="function"){let n=++this.pendingBackendInitId,s=o.then(a=>n(nthis.registryFactory[e].priority-this.registryFactory[t].priority)}initializeBackendsAndReturnBest(){let t=this.getSortedBackends();for(let e=0;ethis.startScope(o),()=>this.endScope(n),()=>(n=e(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n))}scopedRun(t,e,o){t();try{let n=o();return e(),n}catch(n){throw e(),n}}nextTensorId(){return r.nextTensorId++}nextVariableId(){return r.nextVariableId++}clone(t){let e=T.runKernel(Co,{x:t}),o={x:t},n=a=>({x:()=>{let i="float32",p={x:a},u={dtype:i};return T.runKernel(yo,p,u)}}),s=[];return this.addTapeNode(this.state.activeScope.name,o,[e],n,s,{}),e}runKernel(t,e,o){if(this.backendName==null&&this.backend,!(qp(t,this.backendName)!=null))throw new Error(`Kernel '${t}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:t,inputs:e,attrs:o})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(t,e,o){let n=this.backend.numDataIds(),s=0;o.forEach(p=>{s+=p.dtype==="complex64"?3:1});let a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=n-e-s-a;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${t}'`)}runKernelFunc(t){let e,o=[],n=this.isTapeOn(),s=this.state.numBytes,a=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let p,u=ww(t)?t.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(ww(t)){let{kernelName:f,inputs:h,attrs:g}=t;this.backendName==null&&this.backend;let x=qp(f,this.backendName);$(x!=null,()=>`Cannot find registered kernel '${f}' for backend '${this.backendName}'`),i=()=>{let b=this.backend.numDataIds();p=x.kernelFunc({inputs:h,attrs:g,backend:this.backend});let C=Array.isArray(p)?p:[p];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(f,b,C);let S=C.map(k=>k.rank!=null?k:this.makeTensorFromTensorInfo(k));if(n){let k=this.getTensorsForGradient(f,h,S);o=this.saveTensorsForBackwardMode(k)}return S}}else{let{forwardFunc:f}=t,h=g=>{n&&(o=g.map(x=>this.keep(this.clone(x))))};i=()=>{let g=this.backend.numDataIds();p=this.tidy(()=>f(this.backend,h));let x=Array.isArray(p)?p:[p];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,g,x),x}}let{inputs:c,attrs:l}=t,m=ww(t)?null:t.backwardsFunc,d;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?e=i():(d=this.profiler.profileKernel(u,c,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),e=d.outputs)}),n&&this.addTapeNode(u,c,e,m,o,l),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(f=>c[f]!=null?c[f].shape:null),outputShapes:e.map(f=>f.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(p)?e:e[0]}saveTensorsForBackwardMode(t){return t.map(o=>this.keep(this.clone(o)))}getTensorsForGradient(t,e,o){let n=aw(t);if(n!=null){let s=n.inputsToSave||[],a=n.outputsToSave||[],i;n.saveAllInputs?($(Array.isArray(e),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(e).map(u=>e[u])):i=s.map(u=>e[u]);let p=o.filter((u,c)=>a[c]);return i.concat(p)}return[]}makeTensor(t,e,o,n){if(t==null)throw new Error("Values passed to engine.makeTensor() are null");o=o||"float32",n=n||this.backend;let s=t;o==="string"&&zo(t[0])&&(s=t.map(p=>Zi(p)));let a=n.write(s,e,o),i=new mt(e,o,a,this.nextTensorId());if(this.trackTensor(i,n),o==="string"){let p=this.state.tensorInfo.get(a),u=rw(s);this.state.numBytes+=u-p.bytes,p.bytes=u}return i}makeTensorFromDataId(t,e,o,n){o=o||"float32";let s={dataId:t,shape:e,dtype:o};return this.makeTensorFromTensorInfo(s,n)}makeTensorFromTensorInfo(t,e){let{dataId:o,shape:n,dtype:s}=t,a=new mt(n,s,o,this.nextTensorId());return this.trackTensor(a,e),a}makeVariable(t,e=!0,o,n){o=o||this.nextVariableId().toString(),n!=null&&n!==t.dtype&&(t=t.cast(n));let s=new ri(t,e,o,this.nextTensorId());if(this.state.registeredVariables[s.name]!=null)throw new Error(`Variable with name ${s.name} was already registered`);return this.state.registeredVariables[s.name]=s,this.incRef(s,this.backend),s}trackTensor(t,e){this.state.numTensors++,t.dtype==="string"&&this.state.numStringTensors++;let o=0;t.dtype!=="complex64"&&t.dtype!=="string"&&(o=t.size*zp(t.dtype)),this.state.numBytes+=o,this.state.tensorInfo.has(t.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(t.dataId,{backend:e||this.backend,dtype:t.dtype,shape:t.shape,bytes:o})),t instanceof ri||this.track(t)}incRef(t,e){this.trackTensor(t,e),this.backend.incRef(t.dataId)}removeDataId(t,e){this.state.tensorInfo.has(t)&&this.state.tensorInfo.get(t).backend===e&&(this.state.tensorInfo.delete(t),this.state.numDataBuffers--)}disposeTensor(t){if(!this.state.tensorInfo.has(t.dataId))return;let e=this.state.tensorInfo.get(t.dataId);if(this.state.numTensors--,t.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=e.bytes),t.dtype!=="complex64"&&t.dtype!=="string"){let o=t.size*zp(t.dtype);this.state.numBytes-=o}e.backend.disposeData(t.dataId)&&this.removeDataId(t.dataId,e.backend)}disposeVariables(){for(let t in this.state.registeredVariables){let e=this.state.registeredVariables[t];this.disposeVariable(e)}}disposeVariable(t){this.disposeTensor(t),this.state.registeredVariables[t.name]!=null&&delete this.state.registeredVariables[t.name]}memory(){let t=this.backend.memory();return t.numTensors=this.state.numTensors,t.numDataBuffers=this.state.numDataBuffers,t.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(t.unreliable=!0,t.reasons==null&&(t.reasons=[]),t.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),t}async profile(t){this.state.profiling=!0;let e=this.state.numBytes,o=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await t(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(n=>n.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-e,this.state.activeProfile.newTensors=this.state.numTensors-o;for(let n of this.state.activeProfile.kernels)n.kernelTimeMs=await n.kernelTimeMs,n.extraInfo=await n.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(t,e,o,n,s,a){let i={id:this.state.nextTapeNodeId++,kernelName:t,inputs:e,outputs:o,saved:s},p=aw(t);p!=null&&(n=p.gradFunc),n!=null&&(i.gradient=u=>(u=u.map((c,l)=>{if(c==null){let m=o[l],d=Wp(m.size,m.dtype);return this.makeTensor(d,m.shape,m.dtype)}return c}),n(u.length>1?u:u[0],s,a))),this.state.activeTape.push(i)}keep(t){return t.kept=!0,t}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(t){let e={track:[],name:"unnamed scope",id:this.state.nextScopeId++};t&&(e.name=t),this.state.scopeStack.push(e),this.state.activeScope=e}endScope(t){let e=yl(t),o=new Set(e.map(s=>s.id));for(let s=0;s{!s.kept&&s.scopeId===n.id&&this.track(s)})}gradients(t,e,o,n=!1){if($(e.length>0,()=>"gradients() received an empty list of xs."),o!=null&&o.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${o.dtype}'`);let s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",t));$(s instanceof mt,()=>"The result y returned by f() must be a tensor.");let a=K0(this.state.activeTape,e,s);if(!n&&a.length===0&&e.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[s.id]=o==null?l4(s.shape):o,q0(i,a,u=>this.tidy(u),m4);let p=e.map(u=>i[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(let c of u.saved)c.dispose()}),this.state.activeTape=null),{value:s,grads:p}})}customGrad(t){return $(qs(t),()=>"The f passed in customGrad(f) must be a function."),(...e)=>{$(e.every(i=>i instanceof mt),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let o,n={};e.forEach((i,p)=>{n[p]=i});let s=(i,p)=>(o=t(...e,p),$(o.value instanceof mt,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),$(qs(o.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),o.value),a=(i,p)=>{let u=o.gradFunc(i,p),c=Array.isArray(u)?u:[u];$(c.length===e.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(...)."),$(c.every(m=>m instanceof mt),()=>"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 l={};return c.forEach((m,d)=>{l[d]=()=>m}),l};return this.runKernelFunc({forwardFunc:s,backwardsFunc:a,inputs:n})}}readSync(t){return this.state.tensorInfo.get(t).backend.readSync(t)}read(t){return this.state.tensorInfo.get(t).backend.read(t)}readToGPU(t,e){return this.state.tensorInfo.get(t).backend.readToGPU(t,e)}async time(t){let e=Pu(),o=await this.backend.time(t);return o.wallMs=Pu()-e,o}track(t){return this.state.activeScope!=null&&(t.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(t)),t}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new rd;for(let t in this.registry)this.disposeRegisteredKernels(t),this.registry[t].dispose(),delete this.registry[t];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}};bl.nextTensorId=0;bl.nextVariableId=0;function l4(r){let t=cl(He(r),"float32");return T.makeTensor(t,r,"float32")}function Sw(){let r=sw();if(r._tfengine==null){let t=new ll(r);r._tfengine=new bl(t)}return $0(r._tfengine.ENV),Q0(()=>r._tfengine),r._tfengine}var T=Sw();function m4(r,t){let e={a:r,b:t};return T.runKernel(io,e)}var Ji={};qe(Ji,{isBrowser:()=>vw,isMobile:()=>h4,mockIsMobile:()=>f4});function d4(){return typeof navigator!="undefined"&&navigator!=null}var Iw;function f4(r){Iw=r}function h4(r){if(Iw!==void 0)return Iw;if(r||d4()){if(r||(r=navigator),r.product==="ReactNative")return!0;let t=r.userAgent||r.vendor||(typeof window!="undefined"?window.opera:"");if(!t){let e=r;return e.userAgentData&&e.userAgentData.mobile}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 vw(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var _r=A();_r.registerFlag("DEBUG",()=>!1,r=>{r&&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.")});_r.registerFlag("IS_BROWSER",()=>vw());_r.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");_r.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));_r.registerFlag("IS_SAFARI",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));_r.registerFlag("PROD",()=>!1);_r.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>_r.getBool("DEBUG"));_r.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);_r.registerFlag("IS_TEST",()=>!1);_r.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>_r.getBool("DEBUG"));_r.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);_r.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1);_r.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1);function sr(r,t){let e=r;if(Pt(r))return t==="string"?[]:[r.length];if(ed(r)){let n=r.channels||"RGBA";return[r.height,r.width*n.length]}else if(td(r))return[r.buffer.size/(t==null?4:zp(t))];if(!Array.isArray(r))return[];let o=[];for(;Array.isArray(e)||Pt(e)&&t!=="string";)o.push(e.length),e=e[0];return Array.isArray(r)&&A().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&ok(r,o,[]),o}function ok(r,t,e){if(e=e||[],!Array.isArray(r)&&!Pt(r)){$(t.length===0,()=>`Element arr[${e.join("][")}] is a primitive, but should be an array/TypedArray of ${t[0]} elements`);return}$(t.length>0,()=>`Element arr[${e.join("][")}] should be a primitive, but is an array of ${r.length} elements`),$(r.length===t[0],()=>`Element arr[${e.join("][")}] should have ${t[0]} elements, but has ${r.length} elements`);let o=t.slice(1);for(let n=0;n=0&&(n=o),rk(o,n,t,e),r==null||!Pt(r)&&!Array.isArray(r)&&typeof r!="number"&&typeof r!="boolean"&&typeof r!="string"){let p=r==null?"null":r.constructor.name;throw new Error(`Argument '${t}' passed to '${e}' must be a Tensor or TensorLike, but got '${p}'`)}let s=sr(r,n);!Pt(r)&&!Array.isArray(r)&&(r=[r]);let i=n!=="string"?Yp(r,n):Fs(r,[],!0);return T.makeTensor(i,s,n)}function ni(r,t,e,o="numeric"){if(!Array.isArray(r))throw new Error(`Argument ${t} passed to ${e} must be a \`Tensor[]\` or \`TensorLike[]\``);return r.map((s,a)=>v(s,`${t}[${a}]`,e,o))}var kw="__op";function N(r){let t=Object.keys(r);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 e=t[0],o=r[e];e.endsWith("_")&&(e=e.substring(0,e.length-1)),e=e+kw;let n=(...s)=>{T.startScope(e);try{let a=o(...s);return Tu(a)&&console.error("Cannot return a Promise inside of tidy."),T.endScope(a),a}catch(a){throw T.endScope(null),a}};return Object.defineProperty(n,"name",{value:e,configurable:!0}),n}function g4(r,t){let e=v(r,"real","complex"),o=v(t,"imag","complex");xt(e.shape,o.shape,`real and imag shapes, ${e.shape} and ${o.shape}, must match in call to tf.complex().`);let n={real:e,imag:o};return T.runKernel(Ri,n)}var $r=N({complex_:g4});function wr(r,t,e,o){if(o==null)o=_i(r);else if(o==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(td(r)||ed(r)){if(o!=="float32"&&o!=="int32")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${o}.`);return T.backend.createTensorFromGPUData(r,t||e,o)}if(!Pt(r)&&!Array.isArray(r)&&typeof r!="number"&&typeof r!="boolean"&&typeof r!="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){Ct(t);let n=He(t),s=He(e);$(n===s,()=>`Based on the provided shape, [${t}], the tensor should have ${n} values but has ${s}`);for(let a=0;a`Error creating a new Tensor. Inferred shape (${e}) does not match the provided shape (${t}). `)}}return!Pt(r)&&!Array.isArray(r)&&(r=[r]),t=t||e,r=o!=="string"?Yp(r,o):Fs(r,[],!0),T.makeTensor(r,t,o)}function ar(r,t,e){let o=sr(r,e);return wr(r,t,o,e)}var Cl={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};var ir=class r{static join(t){return new r(t).slice()}constructor(t){if(this.shards=[],this.previousShardIndex=0,t==null||(t instanceof Array||(t=[t]),t=t.map(o=>Pt(o)?o.buffer:o),t.length===0))return;this.bufferUniformSize=t[0].byteLength;let e=0;for(let o=0;o=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(t/this.bufferUniformSize),this.previousShardIndex;function e(n){return t=n.end?1:0}if(e(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;let o=x4(this.shards,e);return o===-1?-1:(this.previousShardIndex=o,this.previousShardIndex)}};function x4(r,t){let e=0,o=r.length;for(;e<=o;){let n=Math.floor((o-e)/2)+e,s=t(r[n]);if(s===0)return n;s<0?o=n:e=n+1}return-1}var od=4;async function sk(r,t){let e=[],o=[],n=Array.isArray(r)?r.map(a=>a.name):Object.keys(r);for(let a=0;a{let m=await p.bytes(),d=m.reduce((g,x)=>g+x.length,0)+od*m.length,f=new Uint8Array(d),h=0;for(let g=0;g{if(t+=s.byteLength,e.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 o=new Uint8Array(t),n=0;return e.forEach(s=>{o.set(new Uint8Array(s.buffer),n),n+=s.byteLength}),o.buffer}var Nw=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function nk(r){return Nw?Buffer.byteLength(r,"utf8"):new Blob([r]).size}function ak(r){if(Nw)return Buffer.from(r).toString("base64");let t=new Uint8Array(r),e="";for(let o=0,n=t.length;o{let o=e<<13,n=0;for(;!(o&8388608);)n-=8388608,o<<=1;return o&=-8388609,n+=947912704,o|n},t=new Uint32Array(2048);t[0]=0;for(let e=1;e<1024;e++)t[e]=r(e);for(let e=1024;e<2048;e++)t[e]=939524096+(e-1024<<13);return t}function C4(){let r=new Uint32Array(64);r[0]=0,r[31]=1199570944,r[32]=2147483648,r[63]=3347054592;for(let t=1;t<31;t++)r[t]=t<<23;for(let t=33;t<63;t++)r[t]=2147483648+(t-32<<23);return r}function w4(){let r=new Uint32Array(64);for(let t=0;t<64;t++)r[t]=1024;return r[0]=r[32]=0,r}function S4(){let r=b4(),t=C4(),e=w4();return o=>{let n=new ArrayBuffer(4*o.length),s=new Uint32Array(n);for(let a=0;a>10]+(i&1023)]+t[i>>10];s[a]=p}return new Float32Array(n)}}var qt=class r{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return r.instance==null&&(r.instance=new r),r.instance}static registerSaveRouter(t){r.getInstance().saveRouters.push(t)}static registerLoadRouter(t){r.getInstance().loadRouters.push(t)}static getSaveHandlers(t){return r.getHandlers(t,"save")}static getLoadHandlers(t,e){return r.getHandlers(t,"load",e)}static getHandlers(t,e,o){let n=[];return(e==="load"?r.getInstance().loadRouters:r.getInstance().saveRouters).forEach(a=>{let i=a(t,o);i!==null&&n.push(i)}),n}},pk=r=>qt.registerSaveRouter(r),ck=r=>qt.registerLoadRouter(r),lk=r=>qt.getSaveHandlers(r),mk=(r,t)=>qt.getLoadHandlers(r,t);var $w="tensorflowjs",Ew=1,Ou="models_store",eu="model_info_store";function dk(){if(!A().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let r=typeof window=="undefined"?self:window,t=r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB||r.shimIndexedDB;if(t==null)throw new Error("The current browser does not appear to support IndexedDB.");return t}function Rw(r){let t=r.result;t.createObjectStore(Ou,{keyPath:"modelPath"}),t.createObjectStore(eu,{keyPath:"modelPath"})}var ka=class{constructor(t){if(this.indexedDB=dk(),t==null||!t)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=t}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,t)}async load(){return this.databaseAction(this.modelPath)}databaseAction(t,e){return new Promise((o,n)=>{let s=this.indexedDB.open($w,Ew);s.onupgradeneeded=()=>Rw(s),s.onsuccess=()=>{let a=s.result;if(e==null){let i=a.transaction(Ou,"readonly"),u=i.objectStore(Ou).get(this.modelPath);u.onsuccess=()=>{if(u.result==null)return a.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));o(u.result.modelArtifacts)},u.onerror=c=>(a.close(),n(u.error)),i.oncomplete=()=>a.close()}else{e.weightData=ir.join(e.weightData);let i=va(e),p=a.transaction(eu,"readwrite"),u=p.objectStore(eu),c;try{c=u.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(m){return n(m)}let l;c.onsuccess=()=>{l=a.transaction(Ou,"readwrite");let m=l.objectStore(Ou),d;try{d=m.put({modelPath:this.modelPath,modelArtifacts:e,modelArtifactsInfo:i})}catch(f){return n(f)}d.onsuccess=()=>o({modelArtifactsInfo:i}),d.onerror=f=>{u=p.objectStore(eu);let h=u.delete(this.modelPath);h.onsuccess=()=>(a.close(),n(d.error)),h.onerror=g=>(a.close(),n(d.error))}},c.onerror=m=>(a.close(),n(c.error)),p.oncomplete=()=>{l==null?a.close():l.oncomplete=()=>a.close()}}},s.onerror=a=>n(s.error)})}};ka.URL_SCHEME="indexeddb://";var fk=r=>A().getBool("IS_BROWSER")&&!Array.isArray(r)&&r.startsWith(ka.URL_SCHEME)?I4(r.slice(ka.URL_SCHEME.length)):null;qt.registerSaveRouter(fk);qt.registerLoadRouter(fk);function I4(r){return new ka(r)}function v4(r){return r.startsWith(ka.URL_SCHEME)?r.slice(ka.URL_SCHEME.length):r}var id=class{constructor(){this.indexedDB=dk()}async listModels(){return new Promise((t,e)=>{let o=this.indexedDB.open($w,Ew);o.onupgradeneeded=()=>Rw(o),o.onsuccess=()=>{let n=o.result,s=n.transaction(eu,"readonly"),i=s.objectStore(eu).getAll();i.onsuccess=()=>{let p={};for(let u of i.result)p[u.modelPath]=u.modelArtifactsInfo;t(p)},i.onerror=p=>(n.close(),e(i.error)),s.oncomplete=()=>n.close()},o.onerror=n=>e(o.error)})}async removeModel(t){return t=v4(t),new Promise((e,o)=>{let n=this.indexedDB.open($w,Ew);n.onupgradeneeded=()=>Rw(n),n.onsuccess=()=>{let s=n.result,a=s.transaction(eu,"readwrite"),i=a.objectStore(eu),p=i.get(t),u;p.onsuccess=()=>{if(p.result==null)return s.close(),o(new Error(`Cannot find model with path '${t}' in IndexedDB.`));{let c=i.delete(t),l=()=>{u=s.transaction(Ou,"readwrite");let d=u.objectStore(Ou).delete(t);d.onsuccess=()=>e(p.result.modelArtifactsInfo),d.onerror=f=>o(p.error)};c.onsuccess=l,c.onerror=m=>(l(),s.close(),o(p.error))}},p.onerror=c=>(s.close(),o(p.error)),a.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}},n.onerror=s=>o(n.error)})}};var si="/",ec="tensorflowjs_models",hk="info",k4="model_topology",N4="weight_specs",T4="weight_data",_4="model_metadata";function gk(r){return{info:[ec,r,hk].join(si),topology:[ec,r,k4].join(si),weightSpecs:[ec,r,N4].join(si),weightData:[ec,r,T4].join(si),modelMetadata:[ec,r,_4].join(si)}}function xk(r){for(let t of Object.values(r))window.localStorage.removeItem(t)}function $4(r){let t=r.split(si);if(t.length<3)throw new Error(`Invalid key format: ${r}`);return t.slice(1,t.length-1).join(si)}function E4(r){return r.startsWith(Na.URL_SCHEME)?r.slice(Na.URL_SCHEME.length):r}var Na=class{constructor(t){if(!A().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,t==null||!t)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=t,this.keys=gk(this.modelPath)}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{let e=JSON.stringify(t.modelTopology),o=JSON.stringify(t.weightSpecs),n=va(t),s=ir.join(t.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(n)),this.LS.setItem(this.keys.topology,e),this.LS.setItem(this.keys.weightSpecs,o),this.LS.setItem(this.keys.weightData,ak(s));let a={format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,signature:t.signature!=null?t.signature:void 0,userDefinedMetadata:t.userDefinedMetadata!=null?t.userDefinedMetadata:void 0,modelInitializer:t.modelInitializer!=null?t.modelInitializer:void 0,initializerSignature:t.initializerSignature!=null?t.initializerSignature:void 0,trainingConfig:t.trainingConfig!=null?t.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:n}}catch(a){throw xk(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.weightDataBytes}.`)}}}async load(){let t=JSON.parse(this.LS.getItem(this.keys.info));if(t==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(t.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");let e={},o=JSON.parse(this.LS.getItem(this.keys.topology));if(o==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);e.modelTopology=o;let n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(n==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);e.weightSpecs=n;let s=this.LS.getItem(this.keys.modelMetadata);if(s!=null){let i=JSON.parse(s);e.format=i.format,e.generatedBy=i.generatedBy,e.convertedBy=i.convertedBy,i.signature!=null&&(e.signature=i.signature),i.userDefinedMetadata!=null&&(e.userDefinedMetadata=i.userDefinedMetadata),i.modelInitializer!=null&&(e.modelInitializer=i.modelInitializer),i.initializerSignature!=null&&(e.initializerSignature=i.initializerSignature),i.trainingConfig!=null&&(e.trainingConfig=i.trainingConfig)}let a=this.LS.getItem(this.keys.weightData);if(a==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return e.weightData=ik(a),e}};Na.URL_SCHEME="localstorage://";var yk=r=>A().getBool("IS_BROWSER")&&!Array.isArray(r)&&r.startsWith(Na.URL_SCHEME)?R4(r.slice(Na.URL_SCHEME.length)):null;qt.registerSaveRouter(yk);qt.registerLoadRouter(yk);function R4(r){return new Na(r)}var ud=class{constructor(){$(A().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),$(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let t={},e=ec+si,o=si+hk;for(let n=0;n"scheme must not be undefined or null."),t.endsWith(tc)&&(t=t.slice(0,t.indexOf(tc))),$(t.length>0,()=>"scheme must not be an empty string.");let o=r.getInstance();$(o.managers[t]==null,()=>`A model store manager is already registered for scheme '${t}'.`),o.managers[t]=e}static getManager(t){let e=r.getInstance().managers[t];if(e==null)throw new Error(`Cannot find model manager for scheme '${t}'`);return e}static getSchemes(){return Object.keys(r.getInstance().managers)}};function pd(r){if(r.indexOf(tc)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Os.getSchemes().join(",")}`);return{scheme:r.split(tc)[0],path:r.split(tc)[1]}}async function bk(r,t,e=!1){$(r!==t,()=>`Old path and new path are the same: '${r}'`);let o=qt.getLoadHandlers(r);$(o.length>0,()=>`Copying failed because no load handler is found for source URL ${r}.`),$(o.length<2,()=>`Copying failed because more than one (${o.length}) load handlers for source URL ${r}.`);let n=o[0],s=qt.getSaveHandlers(t);$(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),$(s.length<2,()=>`Copying failed because more than one (${o.length}) save handlers for destination URL ${t}.`);let a=s[0],i=pd(r).scheme,p=pd(r).path,u=i===pd(r).scheme,c=await n.load();e&&u&&await Os.getManager(i).removeModel(p);let l=await a.save(c);return e&&!u&&await Os.getManager(i).removeModel(p),l.modelArtifactsInfo}async function Ck(){let r=Os.getSchemes(),t={};for(let e of r){let o=await Os.getManager(e).listModels();for(let n in o){let s=e+tc+n;t[s]=o[n]}}return t}async function wk(r){let t=pd(r);return Os.getManager(t.scheme).removeModel(t.path)}async function Sk(r,t){return bk(r,t,!1)}async function Ik(r,t){return bk(r,t,!0)}var Dw=class{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(t,e){return fetch(t,e)}now(){return performance.now()}encode(t,e){if(e!=="utf-8"&&e!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${e}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(t)}decode(t,e){return new TextDecoder(e).decode(t)}setTimeoutCustom(t,e){if(typeof window=="undefined"||!A().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(t,e);return}this.functionRefs.push(t),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},e),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",o=>{if(o.source===window&&o.data.name===this.messageName){o.stopPropagation();let n=this.functionRefs[o.data.index];n(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(t){return Xm(t)}};if(A().get("IS_BROWSER")){A().setPlatform("browser",new Dw);try{Os.registerManager(Na.URL_SCHEME,new ud)}catch(r){}try{Os.registerManager(ka.URL_SCHEME,new id)}catch(r){}}var D4={importFetch:()=>vk()},Aw;var Fw=class{constructor(){this.util=kk(),this.textEncoder=new this.util.TextEncoder}fetch(t,e){return A().global.fetch!=null?A().global.fetch(t,e):(Aw==null&&(Aw=D4.importFetch()),Aw(t,e))}now(){let t=process.hrtime();return t[0]*1e3+t[1]/1e6}encode(t,e){if(e!=="utf-8"&&e!=="utf8")throw new Error(`Node built-in encoder only supports utf-8, but got ${e}`);return this.textEncoder.encode(t)}decode(t,e){return t.length===0?"":new this.util.TextDecoder(e).decode(t)}isTypedArray(t){return this.util.types.isFloat32Array(t)||this.util.types.isInt32Array(t)||this.util.types.isUint8Array(t)||this.util.types.isUint8ClampedArray(t)}};A().get("IS_NODE")&&!A().get("IS_BROWSER")&&A().setPlatform("node",new Fw);function me(r,t="float32",e){return t=t||"float32",Ct(r),new tt(r,t,e)}function A4(r,t){let e=v(r,"x","cast");if(!tw(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if(t==="string"&&e.dtype!=="string"||t!=="string"&&e.dtype==="string")throw new Error("Only strings can be casted to strings");let o={x:e},n={dtype:t};return T.runKernel(yo,o,n)}var We=N({cast_:A4});function F4(r){let e={x:v(r,"x","clone","string_or_numeric")};return T.runKernel(Co,e)}var Wr=N({clone_:F4});function cd(r,t=!1){console.log(r.toString(t))}Sw();var P4={buffer:me,cast:We,clone:Wr,print:cd};Z0(P4);function lde(){A().set("PROD",!0)}function mde(){A().set("DEBUG",!0)}function dde(){A().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function Pw(r){A().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(r+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}J0(Pw);function fde(){T.disposeVariables()}function ur(){return T}function hde(){return T.memory()}function gde(r){return T.profile(r)}function De(r,t){return T.tidy(r,t)}function Ot(r){yl(r).forEach(e=>e.dispose())}function Er(r){return T.keep(r)}function xde(r){return T.time(r)}function yde(r){return T.setBackend(r)}function bde(){return T.ready()}function Cde(){return T.backendName}function wde(r){T.removeBackend(r)}function Sde(r){return T.findBackend(r)}function Ide(r){return T.findBackendFactory(r)}function tu(r,t,e=1){return T.registerBackend(r,t,e)}function vde(){return T.backend}function kde(r,t){A().setPlatform(r,t)}function O4(r,t){let e=v(r,"a","add"),o=v(t,"b","add");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(io,n)}var Ce=N({add_:O4});function M4(r,t){let e=v(r,"a","floorDiv"),o=v(t,"b","floorDiv");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Sn,n)}var ld=N({floorDiv_:M4});function L4(r,t){let e=v(r,"a","div"),o=v(t,"b","div");if([e,o]=Oe(e,o),e.dtype==="int32"&&o.dtype==="int32")return ld(e,o);let n={a:e,b:o},s={};return T.runKernel(fn,n,s)}var je=N({div_:L4});function B4(r,t){let e=v(r,"a","mul"),o=v(t,"b","mul");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Xn,n)}var se=N({mul_:B4});function z4(r){let t=v(r,"x","abs");if(t.dtype==="complex64"){let e={x:t};return T.runKernel(Di,e)}else{let e={x:t};return T.runKernel(Xs,e)}}var Qt=N({abs_:z4});function V4(r){let e={x:v(r,"x","acos")};return T.runKernel(Vo,e)}var Nk=N({acos_:V4});function W4(r){let e={x:v(r,"x","acosh")};return T.runKernel(Wo,e)}var Tk=N({acosh_:W4});function U4(r){$(Array.isArray(r),()=>"The argument passed to tf.addN() must be a list of tensors"),$(r.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${r.length}`);let t=r.map((n,s)=>v(n,`tensors${s}`,"addN")),e=t[0];t.forEach(n=>{if(n.dtype!==e.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(n=>{if(!br(n.shape,e.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let o=t;return T.runKernel(Uo,o)}var _k=N({addN_:U4});function G4(r,t=null,e=!1){let n={x:v(r,"x","all","bool")},s={axis:t,keepDims:e};return T.runKernel(Go,n,s)}var $k=N({all_:G4});function H4(r,t=null,e=!1){let n={x:v(r,"x","any","bool")},s={axis:t,keepDims:e};return T.runKernel(Ho,n,s)}var Ek=N({any_:H4});function K4(r,t=0){let o={x:v(r,"x","argMax")},n={axis:t};return T.runKernel(Ys,o,n)}var Rk=N({argMax_:K4});function q4(r,t=0){let o={x:v(r,"x","argMin")},n={axis:t};return T.runKernel(Qs,o,n)}var Dk=N({argMin_:q4});function j4(r){let e={x:v(r,"x","asin")};return T.runKernel(Ko,e)}var Ak=N({asin_:j4});function X4(r){let e={x:v(r,"x","asinh")};return T.runKernel(qo,e)}var Fk=N({asinh_:X4});function Y4(r){let e={x:v(r,"x","atan")};return T.runKernel(jo,e)}var Pk=N({atan_:Y4});function Q4(r,t){let e=v(r,"a","atan2"),o=v(t,"b","atan2");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Yo,n)}var Ok=N({atan2_:Q4});function Z4(r){let e={x:v(r,"x","atanh")};return T.runKernel(Xo,e)}var Mk=N({atanh_:Z4});function J4(r,t,e,o,n="NHWC",s){let a=r[3],i=[...t,a],p=Bk(n);return Lu(r,i,e,s,o,null,null,p)}function Mw(r,t,e,o,n,s,a="channelsLast"){let[i,p]=wl(t),u;if(a==="channelsLast")u=[i,p,r[3],r[3]];else if(a==="channelsFirst")u=[i,p,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return Lu(r,u,e,o,n,s,!1,a)}function eH(r,t,e,o,n,s,a="NDHWC"){let[i,p,u]=Ow(t),c,l;if(a==="NDHWC")l="channelsLast",c=[i,p,u,r[4],r[4]];else if(a==="NCDHW")l="channelsFirst",c=[i,p,u,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return Lk(r,c,e,o,n,!1,l,s)}function Lu(r,t,e,o,n,s,a=!1,i="channelsLast"){let[p,u,c,l]=[-1,-1,-1,-1];if(i==="channelsLast")[p,u,c,l]=r;else if(i==="channelsFirst")[p,l,u,c]=r;else throw new Error(`Unknown dataFormat ${i}`);let[m,d,,f]=t,[h,g]=wl(e),[x,b]=wl(o),C=rc(m,x),S=rc(d,b),{padInfo:k,outHeight:_,outWidth:E}=oH(n,u,c,h,g,C,S,s,i),R=a?f*l:f,D;return i==="channelsFirst"?D=[p,R,_,E]:i==="channelsLast"&&(D=[p,_,E,R]),{batchSize:p,dataFormat:i,inHeight:u,inWidth:c,inChannels:l,outHeight:_,outWidth:E,outChannels:R,padInfo:k,strideHeight:h,strideWidth:g,filterHeight:m,filterWidth:d,effectiveFilterHeight:C,effectiveFilterWidth:S,dilationHeight:x,dilationWidth:b,inShape:r,outShape:D,filterShape:t}}function Lk(r,t,e,o,n,s=!1,a="channelsLast",i){let[p,u,c,l,m]=[-1,-1,-1,-1,-1];if(a==="channelsLast")[p,u,c,l,m]=r;else if(a==="channelsFirst")[p,m,u,c,l]=r;else throw new Error(`Unknown dataFormat ${a}`);let[d,f,h,,g]=t,[x,b,C]=Ow(e),[S,k,_]=Ow(o),E=rc(d,S),R=rc(f,k),D=rc(h,_),{padInfo:P,outDepth:O,outHeight:M,outWidth:L}=nH(n,u,c,l,x,b,C,E,R,D,i),B=s?g*m:g,z;return a==="channelsFirst"?z=[p,B,O,M,L]:a==="channelsLast"&&(z=[p,O,M,L,B]),{batchSize:p,dataFormat:a,inDepth:u,inHeight:c,inWidth:l,inChannels:m,outDepth:O,outHeight:M,outWidth:L,outChannels:B,padInfo:P,strideDepth:x,strideHeight:b,strideWidth:C,filterDepth:d,filterHeight:f,filterWidth:h,effectiveFilterDepth:E,effectiveFilterHeight:R,effectiveFilterWidth:D,dilationDepth:S,dilationHeight:k,dilationWidth:_,inShape:r,outShape:z,filterShape:t}}function tH(r,t,e,o,n){o==null&&(o=Lw(r,t,e));let s=r[0],a=r[1],i=Sl((s-t+2*o)/e+1,n),p=Sl((a-t+2*o)/e+1,n);return[i,p]}function rH(r,t,e,o,n,s){n==null&&(n=Lw(r,t[0],o[0]));let a=[0,0,0,e];for(let i=0;i<3;i++)r[i]+2*n>=t[i]&&(a[i]=Sl((r[i]-t[i]+2*n)/o[i]+1,s));return a}function Lw(r,t,e,o=1){let n=rc(t,o);return Math.floor((r[0]*(e-1)-e+n)/2)}function wl(r){return typeof r=="number"?[r,r,r]:r.length===2?[r[0],r[1],1]:r}function Ow(r){return typeof r=="number"?[r,r,r]:r}function rc(r,t){return t<=1?r:r+(r-1)*(t-1)}function oH(r,t,e,o,n,s,a,i,p){let u,c,l;if(typeof r=="number"){u={top:r,bottom:r,left:r,right:r,type:r===0?"VALID":"NUMBER"};let d=tH([t,e],s,o,r,i);c=d[0],l=d[1]}else if(r==="same"){c=Math.ceil(t/o),l=Math.ceil(e/n);let m=Math.max(0,(c-1)*o+s-t),d=Math.max(0,(l-1)*n+a-e),f=Math.floor(m/2),h=m-f,g=Math.floor(d/2),x=d-g;u={top:f,bottom:h,left:g,right:x,type:"SAME"}}else if(r==="valid")u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((t-s+1)/o),l=Math.ceil((e-a+1)/n);else if(typeof r=="object"){let m=p==="channelsLast"?r[1][0]:r[2][0],d=p==="channelsLast"?r[1][1]:r[2][1],f=p==="channelsLast"?r[2][0]:r[3][0],h=p==="channelsLast"?r[2][1]:r[3][1];u={top:m,bottom:d,left:f,right:h,type:m===0&&d===0&&f===0&&h===0?"VALID":"EXPLICIT"},c=Sl((t-s+m+d)/o+1,i),l=Sl((e-a+f+h)/n+1,i)}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:u,outHeight:c,outWidth:l}}function nH(r,t,e,o,n,s,a,i,p,u,c){let l,m,d,f;if(r==="valid"&&(r=0),typeof r=="number"){l={top:r,bottom:r,left:r,right:r,front:r,back:r,type:r===0?"VALID":"NUMBER"};let g=rH([t,e,o,1],[i,p,u],1,[n,s,a],r,c);m=g[0],d=g[1],f=g[2]}else if(r==="same"){m=Math.ceil(t/n),d=Math.ceil(e/s),f=Math.ceil(o/a);let h=(m-1)*n+i-t,g=(d-1)*s+p-e,x=(f-1)*a+u-o,b=Math.floor(h/2),C=h-b,S=Math.floor(g/2),k=g-S,_=Math.floor(x/2),E=x-_;l={top:S,bottom:k,left:_,right:E,front:b,back:C,type:"SAME"}}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:l,outDepth:m,outHeight:d,outWidth:f}}function Sl(r,t){if(!t)return Math.trunc(r);switch(t){case"round":return Math.round(r);case"ceil":return Math.ceil(r);case"floor":return Math.floor(r);default:throw new Error(`Unknown roundingMode ${t}`)}}function Mu(r){let[t,e,o]=wl(r);return t===1&&e===1&&o===1}function gr(r,t){return Mu(r)||Mu(t)}function Ta(r){return wl(r).every(t=>t>0)}function Bk(r){if(r==="NHWC")return"channelsLast";if(r==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${r}`)}function Lt(r,t,e){if(e!=null){if(typeof t=="string")throw Error(`Error in ${r}: pad must be an integer when using dimRoundingMode ${e} but got pad ${t}.`);if(typeof t=="number")$(Ka(t),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${e} but got pad ${t}.`);else if(typeof t=="object")t.forEach(o=>{o.forEach(n=>{$(Ka(n),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${e} but got pad ${n}.`)})});else throw Error(`Error in ${r}: Unknown padding parameter: ${t}`)}}function sH(r,t){let o={x:v(r,"x","reshape","string_or_numeric")},n={shape:t};return T.runKernel(da,o,n)}var W=N({reshape_:sH});function aH(r,t,e,o,n){let s=v(r,"x","avgPool","float32"),a=1;$(gr(e,a),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${e} and dilations '${a}'`);let i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${i.rank}.`),Lt("avgPool",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n},l=T.runKernel(Qo,u,c);return l=We(l,s.dtype),p?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var md=N({avgPool_:aH});function iH(r,t,e,o,n,s="NDHWC"){let a=v(r,"x","avgPool3d","float32"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),$(typeof e=="number"&&e>0||Array.isArray(e)&&e[0]>0&&e[1]>0&&e[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${e}'`),Lt("avgPool3d",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n,dataFormat:s},l=T.runKernel(Zs,u,c);return l=We(l,i.dtype),p?W(l,[l.shape[1],l.shape[2],l.shape[3],l.shape[4]]):l}var zk=N({avgPool3d_:iH});function uH(r,t=0){$(r.length>=1,()=>"Pass at least one tensor to concat");let e=ni(r,"tensors","concat","string_or_numeric");if(e[0].dtype==="complex64"&&e.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${s.dtype}. `)}),e.length===1)return Wr(e[0]);let o=e,n={axis:t};return T.runKernel(ta,o,n)}var yt=N({concat_:uH});function pH(r,t,e=!1,o=!1){let n=v(r,"a","matMul"),s=v(t,"b","matMul");[n,s]=Oe(n,s);let a={a:n,b:s},i={transposeA:e,transposeB:o};return T.runKernel(Zo,a,i)}var Ze=N({matMul_:pH});function cH(r){let e={x:v(r,"x","sigmoid","float32")};return T.runKernel(bs,e)}var $a=N({sigmoid_:cH});function lH(r,t,e){let o=v(r,"x","slice","string_or_numeric");if(o.rank===0)throw new Error("Slicing scalar is not possible");let n={x:o},s={begin:t,size:e};return T.runKernel(ha,n,s)}var Xe=N({slice_:lH});function mH(r){let e={x:v(r,"x","tanh","float32")};return T.runKernel($s,e)}var Il=N({tanh_:mH});function dH(r,t,e,o,n,s){let a=v(r,"forgetBias","basicLSTMCell"),i=v(t,"lstmKernel","basicLSTMCell"),p=v(e,"lstmBias","basicLSTMCell"),u=v(o,"data","basicLSTMCell"),c=v(n,"c","basicLSTMCell"),l=v(s,"h","basicLSTMCell"),m=yt([u,l],1),d=Ze(m,i),f=Ce(d,p),h=f.shape[0],g=f.shape[1]/4,x=[h,g],b=Xe(f,[0,0],x),C=Xe(f,[0,g],x),S=Xe(f,[0,g*2],x),k=Xe(f,[0,g*3],x),_=Ce(se($a(b),Il(C)),se(c,$a(Ce(a,S)))),E=se(Il(_),$a(k));return[_,E]}var Vk=N({basicLSTMCell_:dH});function fH(r,t,e){let o=v(r,"x","batchToSpaceND"),n=t.reduce((i,p)=>i*p);$(o.rank>=1+t.length,()=>`input rank is ${o.rank} but should be > than blockShape.length ${t.length}`),$(e.length===t.length,()=>`crops.length is ${e.length} but should be equal to blockShape.length ${t.length}`),$(o.shape[0]%n===0,()=>`input tensor batch is ${o.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${n}`);let s={x:o},a={blockShape:t,crops:e};return T.runKernel(Js,s,a)}var dd=N({batchToSpaceND_:fH});function Wk(r){let t;return r.rank===0||r.rank===1?t=W(r,[1,1,1,r.size]):r.rank===2?t=W(r,[1,1,r.shape[0],r.shape[1]]):r.rank===3?t=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]):t=r,t}function hH(r,t,e,o,n,s){s==null&&(s=.001);let a=v(r,"x","batchNorm"),i=v(t,"mean","batchNorm"),p=v(e,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let c;o!=null&&(c=v(o,"offset","batchNorm")),$(i.rank===p.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),$(c==null||i.rank===c.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),$(u==null||i.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let m={x:Wk(a),scale:u,offset:c,mean:i,variance:p},d={varianceEpsilon:s},f=T.runKernel(In,m,d);return W(f,a.shape)}var ru=N({batchNorm_:hH});function gH(r,t,e,o,n,s){let a=v(r,"x","batchNorm"),i=v(t,"mean","batchNorm"),p=v(e,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let c;return o!=null&&(c=v(o,"offset","batchNorm")),$(a.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`),$(i.rank===2||i.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`),$(p.rank===2||p.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),c!=null&&$(c.rank===2||c.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`),ru(a,i,p,c,u,s)}var Uk=N({batchNorm2d_:gH});function xH(r,t,e,o,n,s){let a=v(r,"x","batchNorm"),i=v(t,"mean","batchNorm"),p=v(e,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let c;return o!=null&&(c=v(o,"offset","batchNorm")),$(a.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`),$(i.rank===3||i.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`),$(p.rank===3||p.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),c!=null&&$(c.rank===3||c.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`),ru(a,i,p,c,u,s)}var Gk=N({batchNorm3d_:xH});function yH(r,t,e,o,n,s){let a=v(r,"x","batchNorm"),i=v(t,"mean","batchNorm"),p=v(e,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let c;return o!=null&&(c=v(o,"offset","batchNorm")),$(a.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`),$(i.rank===4||i.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`),$(p.rank===4||p.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),c!=null&&$(c.rank===4||c.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`),ru(a,i,p,c,u,s)}var Hk=N({batchNorm4d_:yH});function bH(r,t,e){let o=v(r,"x","bincount"),n=v(t,"weights","bincount");$(o.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${o.dtype}`),$(e>=0,()=>`size must be non-negative, but got ${e}.`),$(n.size===o.size||n.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${o.shape}, weights shape: ${n.shape}.`);let s={x:o,weights:n},a={size:e};return T.runKernel(Jo,s,a)}var fd=N({bincount_:bH});function CH(r,t){let e=v(r,"x","bitwiseAnd"),o=v(t,"y","bitwiseAnd");if(!br(e.shape,o.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${e.shape}, y: ${o.shape}`);if(e.dtype!=="int32"||o.dtype!=="int32")throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${e.dtype} and type of y: ${o.dtype}`);let n={a:e,b:o};return T.runKernel(qa,n)}var Kk=N({bitwiseAnd_:CH});function wH(r,t){let e=v(r,"s0","broadcastArgs","int32"),o=v(t,"s1","broadcastArgs","int32");if(e.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${e.rank}`);if(o.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${o.rank}`);let n={s0:e,s1:o};return T.runKernel(ea,n)}var qk=N({broadcastArgs_:wH});function SH(r,t){let e=v(r,"broadcastTo","x"),o=e.shape;if(Ct(t),t.lengthe.rank){let u=e.shape.slice();for(;u.length=0;u--)if(n[u]===t[u])s[u]=1;else if(e.shape[u]!==1)throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${t}].`);if(s.map((u,c)=>u>1?c:-1).filter(u=>u>=0).length===0)return Wr(e);let i={x:e},p={reps:s};return T.runKernel(uo,i,p)}var ou=N({broadcastTo_:SH});function IH(r){let e={x:v(r,"x","ceil","float32")};return T.runKernel(en,e)}var jk=N({ceil_:IH});function Ea(r,t,e){Ct(r),e=e||_i(t);let o={shape:r,value:t,dtype:e};return T.runKernel(sa,{},o)}function vH(r,t,e){let o=v(r,"x","clipByValue");if($(t<=e,()=>`Error in clip: min (${t}) must be less than or equal to max (${e}).`),t===e)return Ea(o.shape,t,o.dtype);let n={x:o},s={clipValueMin:t,clipValueMax:e};return T.runKernel(bo,n,s)}var Xk=N({clipByValue_:vH});function kH(r){return yt(r,0)}var Yk=N({concat1d_:kH});function NH(r,t){return yt(r,t)}var Qk=N({concat2d_:NH});function TH(r,t){return yt(r,t)}var Zk=N({concat3d_:TH});function _H(r,t){return yt(r,t)}var Jk=N({concat4d_:_H});function $H(r,t,e,o,n="NHWC",s=[1,1],a){let i=v(r,"x","conv2d","float32"),p=v(t,"filter","conv2d","float32"),u=i,c=!1;i.rank===3&&(c=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${p.rank}.`),Lt("conv2d",o,a);let l=n==="NHWC"?u.shape[3]:u.shape[1];$(l===p.shape[2],()=>`Error in conv2d: depth of input (${l}) must match input depth for filter ${p.shape[2]}.`),$(gr(e,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`),$(Ta(s),()=>"Error in conv2D: Dilated rates should be larger than 0."),$(Ta(e),()=>"Error in conv2D: Strides should be larger than 0.");let m={x:u,filter:p},d={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=T.runKernel(tn,m,d);return c?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var nu=N({conv2d_:$H});function EH(r,t,e,o,n="NWC",s=1,a){let i=v(r,"x","conv1d"),p=v(t,"filter","conv1d"),u=i,c=!1;i.rank===2&&(c=!0,u=W(i,[1,i.shape[0],i.shape[1]])),$(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),$(p.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${p.rank}.`),Lt("conv1d",o,a),$(u.shape[2]===p.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${p.shape[1]}.`),$(gr(e,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${e} and dilation '${s}'`),$(Ta(s),()=>"Error in conv1D: Dilated rates should be larger than 0."),$(Ta(e),()=>"Error in conv1D: Stride should be larger than 0."),$(n==="NWC",()=>`Error in conv1d: got dataFormat of ${n} but only NWC is currently supported.`);let l=W(p,[1,p.shape[0],p.shape[1],p.shape[2]]),m=W(u,[u.shape[0],1,u.shape[1],u.shape[2]]),g=nu(m,l,[1,e],o,"NHWC",[1,s],a);return c?W(g,[g.shape[2],g.shape[3]]):W(g,[g.shape[0],g.shape[2],g.shape[3]])}var e2=N({conv1d_:EH});function RH(r,t,e,o,n,s="NHWC",a){$(r.length===t.rank,()=>`Length of inShape (${r.length}) and rank of dy (${t.rank}) must match`);let i=r,p=t,u=!1;t.rank===3&&(u=!0,p=W(t,[1,t.shape[0],t.shape[1],t.shape[2]]),i=[1,r[0],r[1],r[2]]),$(i.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${i.length}.`),$(p.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${p.rank}`),$(e.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${e.rank}`);let c=s==="NHWC"?i[3]:i[1],l=s==="NHWC"?p.shape[3]:p.shape[1];$(c===e.shape[2],()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${e.shape[2]}.`),$(l===e.shape[3],()=>`Error in conv2dDerInput: depth of output (${l}) must match output depth for filter ${e.shape[3]}.`),Lt("conv2dDerInput",n,a);let m={dy:p,filter:e},d={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,inputShape:i},f=T.runKernel(rn,m,d);return u?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var hd=N({conv2DBackpropInput_:RH});function DH(r,t,e,o,n,s){let a=v(r,"x","conv2dTranspose"),i=v(t,"filter","conv2dTranspose");return hd(e,a,i,o,n,"NHWC",s)}var t2=N({conv2dTranspose_:DH});function AH(r,t,e,o,n="NDHWC",s=[1,1,1]){let a=v(r,"x","conv3d"),i=v(t,"filter","conv3d"),p=a,u=!1;a.rank===4&&(u=!0,p=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(p.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${p.rank}.`),$(i.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`),$(p.shape[4]===i.shape[3],()=>`Error in conv3d: depth of input (${p.shape[4]}) must match input depth for filter ${i.shape[3]}.`),$(gr(e,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`),$(n==="NDHWC",()=>`Error in conv3d: got dataFormat of ${n} but only NDHWC is currently supported.`),$(Ta(s),()=>"Error in conv3D: Dilated rates should be larger than 0."),$(Ta(e),()=>"Error in conv3D: Strides should be larger than 0.");let c={x:p,filter:i},l={strides:e,pad:o,dataFormat:n,dilations:s},m=T.runKernel(on,c,l);return u?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var r2=N({conv3d_:AH});function FH(r,t,e,o,n){$(r.length===t.rank,()=>`Length of inShape (${r.length}) and rank of dy (${t.rank}) must match`);let s=r,a=t,i=!1;t.rank===4&&(i=!0,a=W(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),s=[1,r[0],r[1],r[2],r[3]]);let p=s[4],u=a.shape[4];$(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),$(a.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`),$(e.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${e.rank}`),$(p===e.shape[3],()=>`Error in conv3dDerInput: depth of input (${p}) must match input depth for filter ${e.shape[3]}.`),$(u===e.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${e.shape[4]}.`);let c={dy:a,filter:e},l={pad:n,strides:o,inputShape:s},m=T.runKernel(nn,c,l);return i?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var o2=N({conv3DBackpropInput_:FH});function PH(r,t,e,o,n){let s=v(r,"x","conv3dTranspose"),a=v(t,"filter","conv3dTranspose");return o2(e,s,a,o,n)}var n2=N({conv3dTranspose_:PH});function OH(r){let e={x:v(r,"x","cos","float32")};return T.runKernel(sn,e)}var s2=N({cos_:OH});function MH(r){let e={x:v(r,"x","cosh","float32")};return T.runKernel(an,e)}var a2=N({cosh_:MH});function LH(r,t=0,e=!1,o=!1){let s={x:v(r,"x","cumprod")},a={axis:t,exclusive:e,reverse:o};return T.runKernel(un,s,a)}var i2=N({cumprod_:LH});function BH(r,t=0,e=!1,o=!1){let s={x:v(r,"x","cumsum")},a={axis:t,exclusive:e,reverse:o};return T.runKernel(pn,s,a)}var u2=N({cumsum_:BH});function zH(r,t,e,o=!1){let n=v(r,"x","denseBincount"),s=v(t,"weights","denseBincount");$(n.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${n.dtype}`),$(n.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${n.rank}.`),$(e>=0,()=>`size must be non-negative, but got ${e}.`),$(s.size===n.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${n.shape}, weights shape: ${s.shape}.`);let a={x:n,weights:s},i={size:e,binaryOutput:o};return T.runKernel(ra,a,i)}var p2=N({denseBincount_:zH});function VH(r,t,e="NHWC"){let o=v(r,"x","depthToSpace","float32"),n=e==="NHWC"?o.shape[1]:o.shape[2],s=e==="NHWC"?o.shape[2]:o.shape[3],a=e==="NHWC"?o.shape[3]:o.shape[1];$(t>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`),$(n*t>=0,()=>`Negative dimension size caused by overflow when multiplying - ${n} and ${t} for depthToSpace with input shape - ${o.shape}`),$(s*t>=0,()=>`Negative dimension size caused by overflow when multiplying - ${s} and ${t} for depthToSpace with input shape - ${o.shape}`),$(a%(t*t)===0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${a} for depthToSpace with input shape ${o.shape}`);let i={x:o},p={blockSize:t,dataFormat:e};return T.runKernel(ln,i,p)}var c2=N({depthToSpace_:VH});function WH(r,t,e,o,n="NHWC",s=[1,1],a){let i=v(r,"x","depthwiseConv2d","float32"),p=v(t,"filter","depthwiseConv2d","float32"),u=i,c=!1;i.rank===3&&(c=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`);let l=n==="NHWC"?u.shape[3]:u.shape[1];$(l===p.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${l}) must match the inChannels dimension in filter ${p.shape[2]}.`),Lt("depthwiseConv2d",o,a);let m={x:u,filter:p},d={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=T.runKernel(mn,m,d);return c?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var oc=N({depthwiseConv2d_:WH});function UH(r){let e={x:v(r,"x","diag")};return T.runKernel(oa,e)}var l2=N({diag_:UH});function GH(r,t,e,o,n=[1,1],s="NHWC"){let a=v(r,"x","dilation2d"),i=v(t,"filter","dilation2d");$(a.rank===3||a.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`),$(i.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${i.rank}.`),$(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let p=a,u=!1;a.rank===3&&(p=W(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0),$(p.shape[3]===i.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${p.shape[3]} vs ${i.shape[2]}`);let c={x:p,filter:i},l={strides:e,pad:o,dilations:n},m=T.runKernel(dn,c,l);return u?W(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var m2=N({dilation2d_:GH});var Sr={};qe(Sr,{assertAndGetBroadcastShape:()=>rt,getBroadcastDims:()=>d2,getReductionAxes:()=>gd});function d2(r,t){let e=r.length,o=[];for(let n=0;n1&&a===1&&o.unshift(s)}return o}function gd(r,t){let e=[];for(let o=0;o1)&&e.unshift(s)}return e}function rt(r,t){let e=Math.max(r.length,t.length),o=new Array(e);for(let n=0;n`Error in dot: inputs must all be rank 1 or 2, but got ranks ${e.rank} and ${o.rank}.`);let n=e.rank===1?e.size:e.shape[1],s=o.rank===1?o.size:o.shape[0];if($(n===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${n} and ${s}.`),e.rank===1&&o.rank===1){let a=W(e,[1,-1]),i=W(o,[-1,1]),p=Ze(a,i);return W(p,[])}else if(e.rank===1&&o.rank===2){let a=W(e,[1,-1]),i=W(o,[o.shape[0],o.shape[1]]),p=Ze(a,i);return W(p,[p.size])}else if(e.rank===2&&o.rank===1){let a=W(o,[-1,1]),i=Ze(e,a);return W(i,[i.size])}else{let a=W(o,[o.shape[0],o.shape[1]]);return Ze(e,a)}}var h2=N({dot_:XH});function YH(r,...t){let e=t.map((n,s)=>v(n,`tensors${s}`,"einsum")),o={equation:r};return T.runKernel(Li,e,o)}var su=N({einsum_:YH});function QH(r){let e={x:v(r,"x","elu","float32")};return T.runKernel(hn,e)}var yd=N({elu_:QH});function ZH(r,t){let e=v(r,"x","ensureShape","string_or_numeric");if(!QC(e.shape,t))throw new Error(`EnsureShape: Shape of tensor ${e.shape} is not compatible with expected shape ${t}`);return r}var g2=N({ensureShape_:ZH});function JH(r){let t=v(r,"x","erf");$(t.dtype==="int32"||t.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),t.dtype==="int32"&&(t=We(t,"float32"));let e={x:t};return T.runKernel(gn,e)}var x2=N({erf_:JH});function Bw(r,t){for(let e=0;er[s]);return[e,n]}function ai(r,t){let e=t.map(o=>1);return y2(r,e,t)}function tK(r,t,e){$(Bw(t,e),()=>`${r} supports only inner-most axes for now. Got axes ${t} and rank-${e} input.`)}function rK(r,t){if(Bw(r,t))return null;let e=[];for(let o=0;oe.push(o)),e}function oK(r){return r.map((t,e)=>[e,t]).sort((t,e)=>t[1]-e[1]).map(t=>t[0])}function nK(r,t){let e=[];for(let o=t-r;o"Axis must be <= rank of the tensor");let o={input:e},n={dim:t};return T.runKernel(na,o,n)}var Ms=N({expandDims_:hK});function gK(r){let e={x:v(r,"x","expm1")};return T.runKernel(bn,e)}var w2=N({expm1_:gK});function xK(r,t){let e=v(r,"x","tile","string_or_numeric");$(e.rank===t.length,()=>`Error in transpose: rank of input ${e.rank} must match length of reps ${t}.`);let o={x:e},n={reps:t};return T.runKernel(uo,o,n)}var au=N({tile_:xK});function yK(r,t,e,o="float32"){t==null&&(t=r);let n=me([r,t],o),s=r<=t?r:t;for(let i=0;i`Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${s.rank}.`),$(Ka(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let a=s,i=!1;s.rank===3&&(i=!0,a=W(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let p={x:a},u={depthRadius:t,bias:e,alpha:o,beta:n},c=T.runKernel(Bn,p,u);return i?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var N2=N({localResponseNormalization_:EK});function RK(r){let e={x:v(r,"x","log","float32")};return T.runKernel(Fn,e)}var ui=N({log_:RK});function DK(r){let e={x:v(r,"x","log1p")};return T.runKernel(Pn,e)}var vd=N({log1p_:DK});function AK(r){return $(qs(r),()=>"The f passed in grad(f) must be a function"),(t,e)=>{let o=v(t,"x","tf.grad","string_or_numeric"),n=e!=null?v(e,"dy","tf.grad"):null;return T.tidy(()=>{let{value:s,grads:a}=T.gradients(()=>r(o),[o],n);return n!=null&&xt(s.shape,n.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),kd(a),a[0]})}}function FK(r){return $(qs(r),()=>"The f passed in grads(f) must be a function"),(t,e)=>{$(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let o=ni(t,"args","tf.grads","string_or_numeric"),n=e!=null?v(e,"dy","tf.grads"):null;return T.tidy(()=>{let{value:s,grads:a}=T.gradients(()=>r(...o),o,n);return n!=null&&xt(s.shape,n.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),kd(a),a})}}function PK(r){return $(qs(r),()=>"The f passed in valueAndGrad(f) must be a function"),(t,e)=>{$(t instanceof mt,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),$(e==null||e instanceof mt,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:o,value:n}=T.gradients(()=>r(t),[t],e);return kd(o),{grad:o[0],value:n}}}function OK(r){return $(qs(r),()=>"The f passed in valueAndGrads(f) must be a function"),(t,e)=>{$(Array.isArray(t)&&t.every(n=>n instanceof mt),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),$(e==null||e instanceof mt,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let o=T.gradients(()=>r(...t),t,e);return e!=null&&xt(o.value.shape,e.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),kd(o.grads),o}}function zw(r,t){$(qs(r),()=>"The f passed in variableGrads(f) must be a function"),$(t==null||Array.isArray(t)&&t.every(u=>u instanceof ri),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let e=t!=null;if(!e){t=[];for(let u in T.registeredVariables)t.push(T.registeredVariables[u])}let o=e?t.filter(u=>!u.trainable):null,n=t.length;t=t.filter(u=>u.trainable),$(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${n} variables is trainable.`);let s=!0,{value:a,grads:i}=T.gradients(r,t,null,s);$(i.some(u=>u!=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()."),$(a.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`);let p={};return t.forEach((u,c)=>{i[c]!=null&&(p[u.name]=i[c])}),o!=null&&o.forEach(u=>p[u.name]=null),{value:a,grads:p}}function Ir(r){return T.customGrad(r)}function kd(r){if(r.filter(e=>e==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 MK(r){let e={x:v(r,"x","neg")};return T.runKernel(pa,e)}var pr=N({neg_:MK});function LK(r){let e={x:v(r,"x","softplus")};return T.runKernel(Cs,e)}var Nd=N({softplus_:LK});function BK(r){let t=v(r,"x","logSigmoid");return Ir(o=>({value:pr(Nd(pr(o))),gradFunc:a=>se(a,$a(pr(o)))}))(t)}var T2=N({logSigmoid_:BK});function zK(r,t){let e=v(r,"a","sub"),o=v(t,"b","sub");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(Ts,n)}var Te=N({sub_:zK});function VK(r,t=-1){let e=v(r,"logits","logSoftmax");if(t===-1&&(t=e.rank-1),t!==e.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${e.rank} and axis was ${t}`);return Ir((n,s)=>{let i=Ra(n,t,!0),p=Te(n,i),u=Te(We(p,"float32"),ui(ot(_o(p),t,!0)));return s([u]),{value:u,gradFunc:(l,m)=>{let[d]=m,f=!0,h=_o(d);return Te(l,se(ot(l,t,f),h))}}})(e)}var _2=N({logSoftmax_:VK});function WK(r,t=null,e=!1){let o=v(r,"x","logSumExp"),n=Ti(t,o.shape),s=Ra(o,n,!0),a=Te(o,s),i=_o(a),p=ot(i,n),u=ui(p),c=Ce(W(s,u.shape),u);if(e){let l=ai(c.shape,n);return W(c,l)}return c}var Td=N({logSumExp_:WK});function UK(r,t){let e=v(r,"a","logicalAnd","bool"),o=v(t,"b","logicalAnd","bool");rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(On,n)}var Vu=N({logicalAnd_:UK});function GK(r){let e={x:v(r,"x","logicalNot","bool")};return T.runKernel(Mn,e)}var _d=N({logicalNot_:GK});function HK(r,t){let e=v(r,"a","logicalOr","bool"),o=v(t,"b","logicalOr","bool");rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Ln,n)}var $d=N({logicalOr_:HK});function KK(r,t){let e=v(r,"a","logicalXor","bool"),o=v(t,"b","logicalXor","bool");return rt(e.shape,o.shape),Vu($d(r,t),_d(Vu(r,t)))}var $2=N({logicalXor_:KK});var Ed=2147483648;function qK(r,t,e="left"){let o=v(r,"sortedSequence","searchSorted"),n=v(t,"values","searchSorted"),s=o.shape[o.shape.length-1],a=n.shape[n.shape.length-1],i=W(o,[-1,s]),p=W(n,[-1,a]);if(i.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(i.shape[0]!==p.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(He(p.shape)>=Ed)throw new Error(`values tensor size must less than ${Ed}`);if(i.shape[1]>=Ed)throw new Error(`trailing dim_size must less than ${Ed} for int32 output type, was ${i.shape[1]}`);let u={sortedSequence:i,values:p},c={side:e};return T.runKernel(fs,u,c)}var Nl=N({searchSorted_:qK});function E2(r,t){return Nl(r,t,"left")}function jK(r,t,e,o,n){let s=v(r,"x","maxPool"),a=1,i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${i.rank}.`),$(gr(e,a),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${e} and dilations '${a}'`),Lt("maxPool",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n},l=T.runKernel(Wn,u,c);return p?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var Rd=N({maxPool_:jK});function XK(r,t=[1,1,1],e,o,n,s="NDHWC"){let a=v(r,"x","maxPool3d"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),Lt("maxPool3d",o,n);let u={x:i},c={filterSize:t,strides:e,pad:o,dimRoundingMode:n,dataFormat:s},l=T.runKernel(ia,u,c);return p?W(l,[l.shape[1],l.shape[2],l.shape[3],l.shape[4]]):l}var R2=N({maxPool3d_:XK});function YK(r,t,e,o,n=!1){let a={x:v(r,"x","maxPoolWithArgmax")},i={filterSize:t,strides:e,pad:o,includeBatchInIndex:n},p=T.runKernel(ua,a,i);return{result:p[0],indexes:p[1]}}var D2=N({maxPoolWithArgmax_:YK});function QK(r,t){let e=v(r,"a","maximum"),o=v(t,"b","maximum");[e,o]=Oe(e,o),e.dtype==="bool"&&(e=We(e,"int32"),o=We(o,"int32")),rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Vn,n)}var Dd=N({maximum_:QK});function ZK(r,t=null,e=!1){let n={x:v(r,"x","mean")},s={axis:t,keepDims:e};return T.runKernel(Un,n,s)}var Wu=N({mean_:ZK});function Ur(r,t="float32"){if(Ct(r),t==="complex64"){let o=Ur(r,"float32"),n=Ur(r,"float32");return $r(o,n)}let e=Wp(He(r),t);return T.makeTensor(e,r,t)}function Da(r,t="float32"){if(Ct(r),t==="complex64"){let o=Da(r,"float32"),n=Ur(r,"float32");return $r(o,n)}let e=cl(He(r),t);return T.makeTensor(e,r,t)}function A2(r,t,{indexing:e="xy"}={}){if(e!=="xy"&&e!=="ij")throw new TypeError(`${e} is not a valid third argument to meshgrid`);if(r===void 0)return[];let o=v(r,"x","meshgrid",r instanceof mt?r.dtype:"float32");if(t===void 0)return[o];let n=v(t,"y","meshgrid",t instanceof mt?t.dtype:"float32"),s=He(o.shape),a=He(n.shape);return e==="xy"?(o=W(o,[1,-1]),n=W(n,[-1,1]),[Ze(Da([a,1],o.dtype),o),Ze(n,Da([1,s],n.dtype))]):(o=W(o,[-1,1]),n=W(n,[1,-1]),[Ze(o,Da([1,a],o.dtype)),Ze(Da([s,1],n.dtype),n)])}function JK(r,t){let e=v(r,"a","minimum"),o=v(t,"b","minimum");[e,o]=Oe(e,o),e.dtype==="bool"&&(e=We(e,"int32"),o=We(o,"int32")),rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Hn,n)}var Uu=N({minimum_:JK});function eq(r,t,e){$(e==="reflect"||e==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${e}.`);let o=v(r,"x","mirrorPad");if(o.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");$(t.length===o.rank,()=>`Padding doesn't match input. Must be ${o.rank}. Got ${t.length}.`);let n=e==="reflect"?1:0;for(let i=0;i"Invalid number of paddings. Must be length of 2 each."),$(t[i][0]>=0&&t[i][0]<=o.shape[i]-n&&t[i][1]>=0&&t[i][1]<=o.shape[i]-n,()=>`Padding in dimension ${i} cannot be greater than or equal to ${o.shape[i]-n} or less than 0 for input of shape ${o.shape}`);let s={paddings:t,mode:e},a={x:o};return T.runKernel(Kn,a,s)}var F2=N({mirrorPad_:eq});function tq(r,t){let e=v(r,"a","mod"),o=v(t,"b","mod");[e,o]=Oe(e,o);let n={a:e,b:o};return T.runKernel(qn,n)}var P2=N({mod_:tq});function rq(r,t=null,e=!1){r=v(r,"x","moments");let o=Ti(t,r.shape),n=Wu(r,o,e),s=n.shape;e||(s=ai(n.shape,o));let a=Zt(Te(We(r,"float32"),W(n,s))),i=Wu(a,o,e);return{mean:n,variance:i}}var O2=N({moments_:rq});function oq(r,t,e,o){let n=v(t,"data","multiRNNCell"),s=ni(e,"c","multiRNNCell"),a=ni(o,"h","multiRNNCell"),i=n,p=[];for(let l=0;l2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);e=e||Math.random();let p={logits:a===1?W(n,[1,-1]):n},u={numSamples:t,seed:e,normalized:o},c=T.runKernel(jn,p,u);return a===1?W(c,[c.size]):c}var L2=N({multinomial_:nq});function sq(r,t){let e=v(r,"a","notEqual","string_or_numeric"),o=v(t,"b","notEqual","string_or_numeric");[e,o]=Oe(e,o),rt(e.shape,o.shape);let n={a:e,b:o};return T.runKernel(Yn,n)}var Ad=N({notEqual_:sq});function aq(r,t,e=1,o=0,n="int32"){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let a={indices:v(r,"indices","oneHot","int32")},i={dtype:n,depth:t,onValue:e,offValue:o};return T.runKernel(Jn,a,i)}var Tl=N({oneHot_:aq});function iq(r){let e={x:v(r,"x","onesLike")};return T.runKernel(ca,e)}var B2=N({onesLike_:iq});function uq(r,t){let e=v(r,"v1","outerProduct"),o=v(t,"v2","outerProduct");$(e.rank===1&&o.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${e.rank} and ${o.rank}.`);let n=W(e,[-1,1]),s=W(o,[1,-1]);return Ze(n,s)}var z2=N({outerProduct_:uq});function pq(r,t,e=0){let o=v(r,"x","pad");if(o.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let n={paddings:t,constantValue:e},s={x:o};return T.runKernel(es,s,n)}var Aa=N({pad_:pq});function cq(r,t,e=0){return $(t.length===2,()=>"Invalid number of paddings. Must be length of 2."),Aa(r,[t],e)}var V2=N({pad1d_:cq});function lq(r,t,e=0){return $(t.length===2&&t[0].length===2&&t[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),Aa(r,t,e)}var W2=N({pad2d_:lq});function mq(r,t,e=0){return $(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."),Aa(r,t,e)}var U2=N({pad3d_:mq});function dq(r,t,e=0){return $(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."),Aa(r,t,e)}var G2=N({pad4d_:dq});function fq(r,t,e){let o=v(r,"x","spaceToBatchND");$(o.rank>=1+t.length,()=>`input rank ${o.rank} should be > than [blockShape] ${t.length}`),$(e.length===t.length,()=>`paddings.shape[0] ${e.length} must be equal to [blockShape] ${t.length}`),$(o.shape.reduce((a,i,p)=>p>0&&p<=t.length?a&&(i+e[p-1][0]+e[p-1][1])%t[p-1]===0:a,!0),()=>`input spatial dimensions ${o.shape.slice(1)} with paddings ${e.toString()} must be divisible by blockShapes ${t.toString()}`);let n={x:o},s={blockShape:t,paddings:e};return T.runKernel(ga,n,s)}var Fd=N({spaceToBatchND_:fq});function hq(r,t,e,o,n,s,a){n==null&&(n=[1,1]),s==null&&(s=1),o===0&&(o="valid");let i=v(r,"x","maxPool"),p=i,u=!1;i.rank===3&&(u=!0,p=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(gr(s,n),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${n}'`);let c=Mw(p.shape,t,s,n,o),l=[c.dilationHeight,c.dilationWidth],m;o==="same"?m=xq([c.filterHeight,c.filterWidth],l):m=[[0,0],[0,0]];let d=l[0]===1&&l[1]===1,[f,h]=gq([c.inHeight,c.inWidth],l,m),g=d?o:"valid",x=d?p:Fd(p,l,f),C=(e==="avg"?()=>md(x,t,s,g,a):()=>Rd(x,t,s,g,a))(),S=d?C:dd(C,l,h);return u?W(S,[S.shape[1],S.shape[2],S.shape[3]]):S}function gq(r,t,e){let o=e.map(c=>c[0]),n=e.map(c=>c[1]),s=r.concat(o,n),a=t.map((c,l)=>(c-s[l]%c)%c),i=n.map((c,l)=>c+a[l]),p=t.map((c,l)=>[o[l],i[l]]),u=t.map((c,l)=>[0,a[l]]);return[p,u]}function xq(r,t){let o=r.map((a,i)=>a+(a-1)*(t[i]-1)).map(a=>a-1),n=o.map(a=>Math.floor(a/2)),s=o.map((a,i)=>a-n[i]);return o.map((a,i)=>[n[i],s[i]])}var H2=N({pool_:hq});function yq(r,t){let e=v(r,"x","prelu"),o=v(t,"alpha","prelu"),n={x:e,alpha:o};return T.runKernel(rs,n)}var Pd=N({prelu_:yq});function bq(r,t=null,e=!1){let o=v(r,"x","prod");o.dtype==="bool"&&(o=We(o,"int32"));let n={x:o},s={axis:t,keepDims:e};return T.runKernel(os,n,s)}var K2=N({prod_:bq});function Cq(r,t,e,o){let n=r.map((c,l)=>v(c,`tensors${l}`,"raggedGather","int32")),s=v(t,"paramsDenseValues","raggedGather"),a=v(e,"indices","raggedGather","int32"),i={paramsNestedSplits:n,paramsDenseValues:s,indices:a},p={outputRaggedRank:o},u=T.runKernel(Up,i,p);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}var q2=N({raggedGather_:Cq});function wq(r,t,e){let o=v(r,"starts","raggedRange"),n=v(t,"limits","raggedRange",o.dtype),s=v(e,"deltas","raggedRange",o.dtype),a={starts:o,limits:n,deltas:s},i=T.runKernel(Gp,a);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}var j2=N({raggedRange_:wq});function Sq(r,t,e,o,n){let s=v(r,"shape","raggedTensorToTensor","int32"),a=v(t,"values","raggedTensorToTensor"),i=v(e,"defaultValue","raggedTensorToTensor",a.dtype),p=o.map((l,m)=>v(l,`tensors${m}`,"raggedTensorToTensor","int32")),u={shape:s,values:a,defaultValue:i,rowPartitionTensors:p},c={rowPartitionTypes:n};return T.runKernel(Hp,u,c)}var X2=N({raggedTensorToTensor_:Sq});function Iq(r,t,e){Ct(r);let o=He(r),n=null;if(e==null||e==="float32")n=new Float32Array(o);else if(e==="int32")n=new Int32Array(o);else if(e==="bool")n=new Uint8Array(o);else throw new Error(`Unknown data type ${e}`);for(let s=0;sd1,createVideoElement:()=>Oq,encodeStrings:()=>h1,expectArrayBuffersEqual:()=>Pq,expectArraysClose:()=>Rq,expectArraysEqual:()=>Aq,expectNumbersClose:()=>f1,expectPromiseToFail:()=>Dq,expectValuesInRange:()=>Fq,play:()=>Mq,testEpsilon:()=>Md});var Eq=.001,d1=.1;function Rq(r,t,e){return e==null&&(e=Md()),jw(r,t,(o,n)=>Xw(o,n,e))}function Md(){return T.backend.floatPrecision()===32?Eq:d1}function jw(r,t,e){let o=!0;if((Pt(r)||Pt(t))&&(o=!1),Pt(r)&&Pt(t)&&(o=!0),o){let a=r.constructor.name,i=t.constructor.name;if(a!==i)throw new Error(`Arrays are of different type. Actual: ${a}. Expected: ${i}`)}if(Array.isArray(r)&&Array.isArray(t)){let a=sr(r),i=sr(t);if(!br(a,i))throw new Error(`Arrays have different shapes. Actual: [${a}]. Expected: [${i}]`)}let n=Pt(r)?r:Fs(r),s=Pt(t)?t:Fs(t);if(n.length!==s.length)throw new Error(`Arrays have different lengths actual: ${n.length} vs expected: ${s.length}. +`;return m[m.length-1]=" "+m[m.length-1]+"]"+(s?"":f),m}function Nc(r){let e=[];for(let t=0;t`Length of values '${n}' 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=o||sd(t,this.size),this.strides=oa(e)}set(e,...t){t.length===0&&(t=[0]),$(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let o=this.locToIndex(t);this.values[o]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(let n of e){if(n<0||n>=this.shape[t]){let s=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(s)}t++}let o=e[e.length-1];for(let n=0;nsl(o))}catch(o){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),Gs().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();let e=Gs().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>sl(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 Gs().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),Gs().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 Pk(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),al.cast(this,e)}variable(e=!0,t,o){return this.throwIfDisposed(),Gs().makeVariable(this,e,t,o)}};Object.defineProperty(dt,Symbol.hasInstance,{value:r=>!!r&&r.data!=null&&r.dataSync!=null&&r.throwIfDisposed!=null});function _w(){return wc("Tensor",()=>dt)}_w();var ci=class extends dt{constructor(e,t,o,n){super(e.shape,e.dtype,e.dataId,n),this.trainable=t,this.name=o}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(!Sr(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);Gs().disposeTensor(this),this.dataId=e.dataId,Gs().incRef(this,null)}dispose(){Gs().disposeVariable(this),this.isDisposedInternal=!0}};Object.defineProperty(ci,Symbol.hasInstance,{value:r=>r instanceof dt&&r.assign!=null&&r.assign instanceof Function});var Vk={};qe(Vk,{assertTypesMatch:()=>Fw,getTensorsInContainer:()=>Tc,isTensorInList:()=>FH,makeTypesMatch:()=>Oe});var Ew;(function(r){r.R0="R0",r.R1="R1",r.R2="R2",r.R3="R3",r.R4="R4",r.R5="R5",r.R6="R6"})(Ew||(Ew={}));var $w;(function(r){r.float32="float32",r.int32="int32",r.bool="int32",r.complex64="complex64"})($w||($w={}));var Rw;(function(r){r.float32="float32",r.int32="int32",r.bool="bool",r.complex64="complex64"})(Rw||(Rw={}));var Dw;(function(r){r.float32="float32",r.int32="float32",r.bool="float32",r.complex64="complex64"})(Dw||(Dw={}));var Aw;(function(r){r.float32="complex64",r.int32="complex64",r.bool="complex64",r.complex64="complex64"})(Aw||(Aw={}));var AH={float32:Dw,int32:$w,bool:Rw,complex64:Aw};function pt(r,e){if(r==="string"||e==="string"){if(r==="string"&&e==="string")return"string";throw new Error(`Can not upcast ${r} with ${e}`)}return AH[r][e]}function mi(r){return pt(r,"int32")}function md(r){return r!=null&&typeof r=="object"&&"texture"in r&&r.texture instanceof WebGLTexture}function dd(r){return typeof GPUBuffer!="undefined"&&r!=null&&typeof r=="object"&&"buffer"in r&&r.buffer instanceof GPUBuffer}function Oe(r,e){if(r.dtype===e.dtype)return[r,e];let t=pt(r.dtype,e.dtype);return[r.cast(t),e.cast(t)]}function Fw(r,e){$(r.dtype===e.dtype,()=>`The dtypes of the first(${r.dtype}) and second(${e.dtype}) input must match`)}function FH(r,e){return e.some(t=>t.id===r.id)}function Tc(r){let e=[];return zk(r,e,new Set),e}function zk(r,e,t){if(r==null)return;if(r instanceof dt){e.push(r);return}if(!PH(r))return;let o=r;for(let n in o){let s=o[n];t.has(s)||(t.add(s),zk(s,e,t))}}function PH(r){return Array.isArray(r)||typeof r=="object"}function Pw(r){return r.kernelName!=null}var fd=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()}},_c=class r{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new fd}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;let e=this.getSortedBackends();for(let t=0;t{t.setupFunc!=null&&t.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){ad(e).forEach(o=>{o.disposeFunc!=null&&o.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 o=t.factory();if(o&&!(o instanceof mo)&&typeof o.then=="function"){let n=++this.pendingBackendInitId,s=o.then(a=>n(nthis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(o),()=>this.endScope(n),()=>(n=t(),n instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),n))}scopedRun(e,t,o){e();try{let n=o();return t(),n}catch(n){throw t(),n}}nextTensorId(){return r.nextTensorId++}nextVariableId(){return r.nextVariableId++}clone(e){let t=_.runKernel(vo,{x:e}),o={x:e},n=a=>({x:()=>{let i="float32",p={x:a},u={dtype:i};return _.runKernel(ho,p,u)}}),s=[];return this.addTapeNode(this.state.activeScope.name,o,[t],n,s,{}),t}runKernel(e,t,o){if(this.backendName==null&&this.backend,!(tl(e,this.backendName)!=null))throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:o})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,o){let n=this.backend.numDataIds(),s=0;o.forEach(p=>{s+=p.dtype==="complex64"?3:1});let a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],i=n-t-s-a;if(i>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${i} data ids) after running '${e}'`)}runKernelFunc(e){let t,o=[],n=this.isTapeOn(),s=this.state.numBytes,a=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let i;this.backendName==null&&this.backend;let p,u=Pw(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(Pw(e)){let{kernelName:f,inputs:h,attrs:g}=e;this.backendName==null&&this.backend;let x=tl(f,this.backendName);$(x!=null,()=>`Cannot find registered kernel '${f}' for backend '${this.backendName}'`),i=()=>{let b=this.backend.numDataIds();p=x.kernelFunc({inputs:h,attrs:g,backend:this.backend});let w=Array.isArray(p)?p:[p];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(f,b,w);let S=w.map(k=>k.rank!=null?k:this.makeTensorFromTensorInfo(k));if(n){let k=this.getTensorsForGradient(f,h,S);o=this.saveTensorsForBackwardMode(k)}return S}}else{let{forwardFunc:f}=e,h=g=>{n&&(o=g.map(x=>this.keep(this.clone(x))))};i=()=>{let g=this.backend.numDataIds();p=this.tidy(()=>f(this.backend,h));let x=Array.isArray(p)?p:[p];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,g,x),x}}let{inputs:l,attrs:c}=e,m=Pw(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(u,l,()=>i()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(d),t=d.outputs)}),n&&this.addTapeNode(u,l,t,m,o,c),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-s,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-a,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(l).map(f=>l[f]!=null?l[f].shape:null),outputShapes:t.map(f=>f.shape),kernelTimeMs:d.timeMs,extraInfo:d.extraInfo}),Array.isArray(p)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(o=>this.keep(this.clone(o)))}getTensorsForGradient(e,t,o){let n=Cw(e);if(n!=null){let s=n.inputsToSave||[],a=n.outputsToSave||[],i;n.saveAllInputs?($(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),i=Object.keys(t).map(u=>t[u])):i=s.map(u=>t[u]);let p=o.filter((u,l)=>a[l]);return i.concat(p)}return[]}makeTensor(e,t,o,n){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");o=o||"float32",n=n||this.backend;let s=e;o==="string"&&dn(e[0])&&(s=e.map(p=>iu(p)));let a=n.write(s,t,o),i=new dt(t,o,a,this.nextTensorId());if(this.trackTensor(i,n),o==="string"){let p=this.state.tensorInfo.get(a),u=gw(s);this.state.numBytes+=u-p.bytes,p.bytes=u}return i}makeTensorFromDataId(e,t,o,n){o=o||"float32";let s={dataId:e,shape:t,dtype:o};return this.makeTensorFromTensorInfo(s,n)}makeTensorFromTensorInfo(e,t){let{dataId:o,shape:n,dtype:s}=e,a=new dt(n,s,o,this.nextTensorId());return this.trackTensor(a,t),a}makeVariable(e,t=!0,o,n){o=o||this.nextVariableId().toString(),n!=null&&n!==e.dtype&&(e=e.cast(n));let s=new ci(e,t,o,this.nextTensorId());if(this.state.registeredVariables[s.name]!=null)throw new Error(`Variable with name ${s.name} was already registered`);return this.state.registeredVariables[s.name]=s,this.incRef(s,this.backend),s}trackTensor(e,t){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let o=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(o=e.size*jp(e.dtype)),this.state.numBytes+=o,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:o})),e instanceof ci||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 o=e.size*jp(e.dtype);this.state.numBytes-=o}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,o=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(n=>n.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-o;for(let n of this.state.activeProfile.kernels)n.kernelTimeMs=await n.kernelTimeMs,n.extraInfo=await n.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,t,o,n,s,a){let i={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:o,saved:s},p=Cw(e);p!=null&&(n=p.gradFunc),n!=null&&(i.gradient=u=>(u=u.map((l,c)=>{if(l==null){let m=o[c],d=Yp(m.size,m.dtype);return this.makeTensor(d,m.shape,m.dtype)}return l}),n(u.length>1?u:u[0],s,a))),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=Tc(e),o=new Set(t.map(s=>s.id));for(let s=0;s{!s.kept&&s.scopeId===n.id&&this.track(s)})}gradients(e,t,o,n=!1){if($(t.length>0,()=>"gradients() received an empty list of xs."),o!=null&&o.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${o.dtype}'`);let s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));$(s instanceof dt,()=>"The result y returned by f() must be a tensor.");let a=Dk(this.state.activeTape,t,s);if(!n&&a.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[s.id]=o==null?OH(s.shape):o,Ak(i,a,u=>this.tidy(u),MH);let p=t.map(u=>i[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(let l of u.saved)l.dispose()}),this.state.activeTape=null),{value:s,grads:p}})}customGrad(e){return $(ra(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{$(t.every(i=>i instanceof dt),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let o,n={};t.forEach((i,p)=>{n[p]=i});let s=(i,p)=>(o=e(...t,p),$(o.value instanceof dt,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),$(ra(o.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),o.value),a=(i,p)=>{let u=o.gradFunc(i,p),l=Array.isArray(u)?u:[u];$(l.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(...)."),$(l.every(m=>m instanceof dt),()=>"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 c={};return l.forEach((m,d)=>{c[d]=()=>m}),c};return this.runKernelFunc({forwardFunc:s,backwardsFunc:a,inputs:n})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,t){return this.state.tensorInfo.get(e).backend.readToGPU(e,t)}async time(e){let t=Uu(),o=await this.backend.time(e);return o.wallMs=Uu()-t,o}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 fd;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}};_c.nextTensorId=0;_c.nextVariableId=0;function OH(r){let e=bc(ze(r),"float32");return _.makeTensor(e,r,"float32")}function Ow(){let r=bw();if(r._tfengine==null){let e=new Cc(r);r._tfengine=new _c(e)}return hk(r._tfengine.ENV),Mk(()=>r._tfengine),r._tfengine}var _=Ow();function MH(r,e){let t={a:r,b:e};return _.runKernel(Rr,t)}var uu={};qe(uu,{isBrowser:()=>Lw,isMobile:()=>zH,mockIsMobile:()=>BH});function LH(){return typeof navigator!="undefined"&&navigator!=null}var Mw;function BH(r){Mw=r}function zH(r){if(Mw!==void 0)return Mw;if(r||LH()){if(r||(r=navigator),r.product==="ReactNative")return!0;let e=r.userAgent||r.vendor||(typeof window!="undefined"?window.opera:"");if(!e){let t=r;return t.userAgentData&&t.userAgentData.mobile}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(e)||/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(e.substr(0,4))}return!1}function Lw(){return typeof window!="undefined"&&window.document!=null||typeof WorkerGlobalScope!="undefined"}var Dr=A();Dr.registerFlag("DEBUG",()=>!1,r=>{r&&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.")});Dr.registerFlag("IS_BROWSER",()=>Lw());Dr.registerFlag("IS_NODE",()=>typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.node!="undefined");Dr.registerFlag("IS_CHROME",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor));Dr.registerFlag("IS_SAFARI",()=>typeof navigator!="undefined"&&navigator!=null&&navigator.userAgent!=null&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor));Dr.registerFlag("PROD",()=>!1);Dr.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>Dr.getBool("DEBUG"));Dr.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0);Dr.registerFlag("IS_TEST",()=>!1);Dr.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>Dr.getBool("DEBUG"));Dr.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1);Dr.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1);Dr.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1);function ur(r,e){let t=r;if(Mt(r))return e==="string"?[]:[r.length];if(md(r)){let n=r.channels||"RGBA";return[r.height,r.width*n.length]}else if(dd(r))return[r.buffer.size/(e==null?4:jp(e))];if(!Array.isArray(r))return[];let o=[];for(;Array.isArray(t)||Mt(t)&&e!=="string";)o.push(t.length),t=t[0];return Array.isArray(r)&&A().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&Uk(r,o,[]),o}function Uk(r,e,t){if(t=t||[],!Array.isArray(r)&&!Mt(r)){$(e.length===0,()=>`Element arr[${t.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`);return}$(e.length>0,()=>`Element arr[${t.join("][")}] should be a primitive, but is an array of ${r.length} elements`),$(r.length===e[0],()=>`Element arr[${t.join("][")}] should have ${e[0]} elements, but has ${r.length} elements`);let o=e.slice(1);for(let n=0;n=0&&(n=o),Wk(o,n,e,t),r==null||!Mt(r)&&!Array.isArray(r)&&typeof r!="number"&&typeof r!="boolean"&&typeof r!="string"){let p=r==null?"null":r.constructor.name;throw new Error(`Argument '${e}' passed to '${t}' must be a Tensor or TensorLike, but got '${p}'`)}let s=ur(r,n);!Mt(r)&&!Array.isArray(r)&&(r=[r]);let i=n!=="string"?nl(r,n):Us(r,[],!0);return _.makeTensor(i,s,n)}function di(r,e,t,o="numeric"){if(!Array.isArray(r))throw new Error(`Argument ${e} passed to ${t} must be a \`Tensor[]\` or \`TensorLike[]\``);return r.map((s,a)=>v(s,`${e}[${a}]`,t,o))}var Bw="__op";function N(r){let e=Object.keys(r);if(e.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let t=e[0],o=r[t];t.endsWith("_")&&(t=t.substring(0,t.length-1)),t=t+Bw;let n=(...s)=>{_.startScope(t);try{let a=o(...s);return Ou(a)&&console.error("Cannot return a Promise inside of tidy."),_.endScope(a),a}catch(a){throw _.endScope(null),a}};return Object.defineProperty(n,"name",{value:t,configurable:!0}),n}function VH(r,e){let t=v(r,"real","complex"),o=v(e,"imag","complex");yt(t.shape,o.shape,`real and imag shapes, ${t.shape} and ${o.shape}, must match in call to tf.complex().`);let n={real:t,imag:o};return _.runKernel(ei,n)}var Ar=N({complex_:VH});function vr(r,e,t,o){if(o==null)o=Bi(r);else if(o==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(dd(r)||md(r)){if(o!=="float32"&&o!=="int32")throw new Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${o}.`);return _.backend.createTensorFromGPUData(r,e||t,o)}if(!Mt(r)&&!Array.isArray(r)&&typeof r!="number"&&typeof r!="boolean"&&typeof r!="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(e!=null){St(e);let n=ze(e),s=ze(t);$(n===s,()=>`Based on the provided shape, [${e}], the tensor should have ${n} values but has ${s}`);for(let a=0;a`Error creating a new Tensor. Inferred shape (${t}) does not match the provided shape (${e}). `)}}return!Mt(r)&&!Array.isArray(r)&&(r=[r]),e=e||t,r=o!=="string"?nl(r,o):Us(r,[],!0),_.makeTensor(r,e,o)}function pr(r,e,t){let o=ur(r,t);return vr(r,e,o,t)}var fi={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8};var lr=class r{static join(e){return new r(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,e==null||(e instanceof Array||(e=[e]),e=e.map(o=>Mt(o)?o.buffer:o),e.length===0))return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let o=0;o=this.byteLength)return-1;if(this.bufferUniformSize!=null)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(n){return e=n.end?1:0}if(t(this.shards[this.previousShardIndex])===0)return this.previousShardIndex;let o=WH(this.shards,t);return o===-1?-1:(this.previousShardIndex=o,this.previousShardIndex)}};function WH(r,e){let t=0,o=r.length;for(;t<=o;){let n=Math.floor((o-t)/2)+t,s=e(r[n]);if(s===0)return n;s<0?o=n:t=n+1}return-1}function Gde(){A().set("PROD",!0)}function Hde(){A().set("DEBUG",!0)}function Kde(){A().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function zw(r){A().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(r+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}Bk(zw);function qde(){_.disposeVariables()}function cr(){return _}function jde(){return _.memory()}function Xde(r){return _.profile(r)}function De(r,e){return _.tidy(r,e)}function Lt(r){Tc(r).forEach(t=>t.dispose())}function Fr(r){return _.keep(r)}function Yde(r){return _.time(r)}function Qde(r){return _.setBackend(r)}function Zde(){return _.ready()}function Gk(){return _.backendName}function Jde(r){_.removeBackend(r)}function efe(r){return _.findBackend(r)}function tfe(r){return _.findBackendFactory(r)}function pu(r,e,t=1){return _.registerBackend(r,e,t)}function Hk(){return _.backend}function rfe(r,e){A().setPlatform(r,e)}var lu=4;async function jk(r,e){let t=[],o=[],n=Array.isArray(r)?r.map(a=>a.name):Object.keys(r);for(let a=0;a{let m=await p.bytes(),d=m.reduce((g,x)=>g+x.length,0)+lu*m.length,f=new Uint8Array(d),h=0;for(let g=0;gt.slice(n+i,n+p));o[s.name]=Xk(s,t.slice(n,n+a)),n+=a}return o}function UH(r,e){let t=ze(r.shape),o;if("quantization"in r){let n=r.quantization;o=fi[n.dtype]}else if(r.dtype==="string"){let n=0;for(let s=0;s(n=await Kk(o,n,l),n.slice(u,l)));n=await Kk(o,n,a);let i=n.slice(0,a);n=n.slice(a);let p=Xk(s,i);if(t[s.name]=p,Gk()==="webgpu"){let u=Hk();"uploadToGPU"in u&&ze(p.shape)>=A().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&u.uploadToGPU(p.dataId)}}return t}function HH(r){if(r===null)throw new Error(`Invalid input value: ${JSON.stringify(r)}`);let e=0,t=[];r.forEach(s=>{if(e+=s.byteLength,t.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 o=new Uint8Array(e),n=0;return t.forEach(s=>{o.set(new Uint8Array(s.buffer),n),n+=s.byteLength}),o.buffer}var Vw=typeof Buffer!="undefined"&&(typeof Blob=="undefined"||typeof atob=="undefined"||typeof btoa=="undefined");function qk(r){return Vw?Buffer.byteLength(r,"utf8"):new Blob([r]).size}function Yk(r){if(Vw)return Buffer.from(r).toString("base64");let e=new Uint8Array(r),t="";for(let o=0,n=e.length;o{let o=t<<13,n=0;for(;!(o&8388608);)n-=8388608,o<<=1;return o&=-8388609,n+=947912704,o|n},e=new Uint32Array(2048);e[0]=0;for(let t=1;t<1024;t++)e[t]=r(t);for(let t=1024;t<2048;t++)e[t]=939524096+(t-1024<<13);return e}function qH(){let r=new Uint32Array(64);r[0]=0,r[31]=1199570944,r[32]=2147483648,r[63]=3347054592;for(let e=1;e<31;e++)r[e]=e<<23;for(let e=33;e<63;e++)r[e]=2147483648+(e-32<<23);return r}function jH(){let r=new Uint32Array(64);for(let e=0;e<64;e++)r[e]=1024;return r[0]=r[32]=0,r}function XH(){let r=KH(),e=qH(),t=jH();return o=>{let n=new ArrayBuffer(4*o.length),s=new Uint32Array(n);for(let a=0;a>10]+(i&1023)]+e[i>>10];s[a]=p}return new Float32Array(n)}}var Xt=class r{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return r.instance==null&&(r.instance=new r),r.instance}static registerSaveRouter(e){r.getInstance().saveRouters.push(e)}static registerLoadRouter(e){r.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return r.getHandlers(e,"save")}static getLoadHandlers(e,t){return r.getHandlers(e,"load",t)}static getHandlers(e,t,o){let n=[];return(t==="load"?r.getInstance().loadRouters:r.getInstance().saveRouters).forEach(a=>{let i=a(e,o);i!==null&&n.push(i)}),n}},Jk=r=>Xt.registerSaveRouter(r),e1=r=>Xt.registerLoadRouter(r),t1=r=>Xt.getSaveHandlers(r),r1=(r,e)=>Xt.getLoadHandlers(r,e);var Gw="tensorflowjs",Hw=1,Gu="models_store",cu="model_info_store";function o1(){if(!A().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let r=typeof window=="undefined"?self:window,e=r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB||r.shimIndexedDB;if(e==null)throw new Error("The current browser does not appear to support IndexedDB.");return e}function Kw(r){let e=r.result;e.createObjectStore(Gu,{keyPath:"modelPath"}),e.createObjectStore(cu,{keyPath:"modelPath"})}var Ra=class{constructor(e){if(this.indexedDB=o1(),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((o,n)=>{let s=this.indexedDB.open(Gw,Hw);s.onupgradeneeded=()=>Kw(s),s.onsuccess=()=>{let a=s.result;if(t==null){let i=a.transaction(Gu,"readonly"),u=i.objectStore(Gu).get(this.modelPath);u.onsuccess=()=>{if(u.result==null)return a.close(),n(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));o(u.result.modelArtifacts)},u.onerror=l=>(a.close(),n(u.error)),i.oncomplete=()=>a.close()}else{t.weightData=lr.join(t.weightData);let i=$a(t),p=a.transaction(cu,"readwrite"),u=p.objectStore(cu),l;try{l=u.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(m){return n(m)}let c;l.onsuccess=()=>{c=a.transaction(Gu,"readwrite");let m=c.objectStore(Gu),d;try{d=m.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i})}catch(f){return n(f)}d.onsuccess=()=>o({modelArtifactsInfo:i}),d.onerror=f=>{u=p.objectStore(cu);let h=u.delete(this.modelPath);h.onsuccess=()=>(a.close(),n(d.error)),h.onerror=g=>(a.close(),n(d.error))}},l.onerror=m=>(a.close(),n(l.error)),p.oncomplete=()=>{c==null?a.close():c.oncomplete=()=>a.close()}}},s.onerror=a=>n(s.error)})}};Ra.URL_SCHEME="indexeddb://";var n1=r=>A().getBool("IS_BROWSER")&&!Array.isArray(r)&&r.startsWith(Ra.URL_SCHEME)?YH(r.slice(Ra.URL_SCHEME.length)):null;Xt.registerSaveRouter(n1);Xt.registerLoadRouter(n1);function YH(r){return new Ra(r)}function QH(r){return r.startsWith(Ra.URL_SCHEME)?r.slice(Ra.URL_SCHEME.length):r}var yd=class{constructor(){this.indexedDB=o1()}async listModels(){return new Promise((e,t)=>{let o=this.indexedDB.open(Gw,Hw);o.onupgradeneeded=()=>Kw(o),o.onsuccess=()=>{let n=o.result,s=n.transaction(cu,"readonly"),i=s.objectStore(cu).getAll();i.onsuccess=()=>{let p={};for(let u of i.result)p[u.modelPath]=u.modelArtifactsInfo;e(p)},i.onerror=p=>(n.close(),t(i.error)),s.oncomplete=()=>n.close()},o.onerror=n=>t(o.error)})}async removeModel(e){return e=QH(e),new Promise((t,o)=>{let n=this.indexedDB.open(Gw,Hw);n.onupgradeneeded=()=>Kw(n),n.onsuccess=()=>{let s=n.result,a=s.transaction(cu,"readwrite"),i=a.objectStore(cu),p=i.get(e),u;p.onsuccess=()=>{if(p.result==null)return s.close(),o(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{let l=i.delete(e),c=()=>{u=s.transaction(Gu,"readwrite");let d=u.objectStore(Gu).delete(e);d.onsuccess=()=>t(p.result.modelArtifactsInfo),d.onerror=f=>o(p.error)};l.onsuccess=c,l.onerror=m=>(c(),s.close(),o(p.error))}},p.onerror=l=>(s.close(),o(p.error)),a.oncomplete=()=>{u==null?s.close():u.oncomplete=()=>s.close()}},n.onerror=s=>o(n.error)})}};var hi="/",ul="tensorflowjs_models",s1="info",ZH="model_topology",JH="weight_specs",eK="weight_data",tK="model_metadata";function a1(r){return{info:[ul,r,s1].join(hi),topology:[ul,r,ZH].join(hi),weightSpecs:[ul,r,JH].join(hi),weightData:[ul,r,eK].join(hi),modelMetadata:[ul,r,tK].join(hi)}}function i1(r){for(let e of Object.values(r))window.localStorage.removeItem(e)}function rK(r){let e=r.split(hi);if(e.length<3)throw new Error(`Invalid key format: ${r}`);return e.slice(1,e.length-1).join(hi)}function oK(r){return r.startsWith(Da.URL_SCHEME)?r.slice(Da.URL_SCHEME.length):r}var Da=class{constructor(e){if(!A().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=a1(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),o=JSON.stringify(e.weightSpecs),n=$a(e),s=lr.join(e.weightData);try{this.LS.setItem(this.keys.info,JSON.stringify(n)),this.LS.setItem(this.keys.topology,t),this.LS.setItem(this.keys.weightSpecs,o),this.LS.setItem(this.keys.weightData,Yk(s));let a={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,initializerSignature:e.initializerSignature!=null?e.initializerSignature:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:n}}catch(a){throw i1(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${n.modelTopologyBytes}, weightSpecsBytes=${n.weightSpecsBytes}, weightDataBytes=${n.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={},o=JSON.parse(this.LS.getItem(this.keys.topology));if(o==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=o;let n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(n==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);t.weightSpecs=n;let s=this.LS.getItem(this.keys.modelMetadata);if(s!=null){let i=JSON.parse(s);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),i.initializerSignature!=null&&(t.initializerSignature=i.initializerSignature),i.trainingConfig!=null&&(t.trainingConfig=i.trainingConfig)}let a=this.LS.getItem(this.keys.weightData);if(a==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=Qk(a),t}};Da.URL_SCHEME="localstorage://";var u1=r=>A().getBool("IS_BROWSER")&&!Array.isArray(r)&&r.startsWith(Da.URL_SCHEME)?nK(r.slice(Da.URL_SCHEME.length)):null;Xt.registerSaveRouter(u1);Xt.registerLoadRouter(u1);function nK(r){return new Da(r)}var bd=class{constructor(){$(A().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),$(typeof window=="undefined"||typeof window.localStorage!="undefined",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=ul+hi,o=hi+s1;for(let n=0;n"scheme must not be undefined or null."),e.endsWith(pl)&&(e=e.slice(0,e.indexOf(pl))),$(e.length>0,()=>"scheme must not be an empty string.");let o=r.getInstance();$(o.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),o.managers[e]=t}static getManager(e){let t=r.getInstance().managers[e];if(t==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(r.getInstance().managers)}};function Cd(r){if(r.indexOf(pl)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${Hs.getSchemes().join(",")}`);return{scheme:r.split(pl)[0],path:r.split(pl)[1]}}async function p1(r,e,t=!1){$(r!==e,()=>`Old path and new path are the same: '${r}'`);let o=Xt.getLoadHandlers(r);$(o.length>0,()=>`Copying failed because no load handler is found for source URL ${r}.`),$(o.length<2,()=>`Copying failed because more than one (${o.length}) load handlers for source URL ${r}.`);let n=o[0],s=Xt.getSaveHandlers(e);$(s.length>0,()=>`Copying failed because no save handler is found for destination URL ${e}.`),$(s.length<2,()=>`Copying failed because more than one (${o.length}) save handlers for destination URL ${e}.`);let a=s[0],i=Cd(r).scheme,p=Cd(r).path,u=i===Cd(r).scheme,l=await n.load();t&&u&&await Hs.getManager(i).removeModel(p);let c=await a.save(l);return t&&!u&&await Hs.getManager(i).removeModel(p),c.modelArtifactsInfo}async function l1(){let r=Hs.getSchemes(),e={};for(let t of r){let o=await Hs.getManager(t).listModels();for(let n in o){let s=t+pl+n;e[s]=o[n]}}return e}async function c1(r){let e=Cd(r);return Hs.getManager(e.scheme).removeModel(e.path)}async function m1(r,e){return p1(r,e,!1)}async function d1(r,e){return p1(r,e,!0)}var qw=class{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}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)}setTimeoutCustom(e,t){if(typeof window=="undefined"||!A().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(e,t);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},t),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",o=>{if(o.source===window&&o.data.name===this.messageName){o.stopPropagation();let n=this.functionRefs[o.data.index];n(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}isTypedArray(e){return id(e)}};if(A().get("IS_BROWSER")){A().setPlatform("browser",new qw);try{Hs.registerManager(Da.URL_SCHEME,new bd)}catch(r){}try{Hs.registerManager(Ra.URL_SCHEME,new yd)}catch(r){}}var sK={importFetch:()=>f1()},jw;var Xw=class{constructor(){this.util=h1(),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return A().global.fetch!=null?A().global.fetch(e,t):(jw==null&&(jw=sK.importFetch()),jw(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)}isTypedArray(e){return this.util.types.isFloat32Array(e)||this.util.types.isInt32Array(e)||this.util.types.isUint8Array(e)||this.util.types.isUint8ClampedArray(e)}};A().get("IS_NODE")&&!A().get("IS_BROWSER")&&A().setPlatform("node",new Xw);function ie(r,e="float32",t){return e=e||"float32",St(r),new Ge(r,e,t)}function aK(r,e){let t=v(r,"x","cast");if(!hw(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if(e==="string"&&t.dtype!=="string"||e!=="string"&&t.dtype==="string")throw new Error("Only strings can be casted to strings");let o={x:t},n={dtype:e};return _.runKernel(ho,o,n)}var Ue=N({cast_:aK});function iK(r){let t={x:v(r,"x","clone","string_or_numeric")};return _.runKernel(vo,t)}var Xr=N({clone_:iK});function wd(r,e=!1){console.log(r.toString(e))}Ow();var uK={buffer:ie,cast:Ue,clone:Xr,print:wd};Lk(uK);function pK(r,e){let t=v(r,"a","add"),o=v(e,"b","add");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(Rr,n)}var Ce=N({add_:pK});function lK(r,e){let t=v(r,"a","floorDiv"),o=v(e,"b","floorDiv");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(wo,n)}var Sd=N({floorDiv_:lK});function cK(r,e){let t=v(r,"a","div"),o=v(e,"b","div");if([t,o]=Oe(t,o),t.dtype==="int32"&&o.dtype==="int32")return Sd(t,o);let n={a:t,b:o},s={};return _.runKernel(Vn,n,s)}var Xe=N({div_:cK});function mK(r,e){let t=v(r,"a","mul"),o=v(e,"b","mul");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel($o,n)}var se=N({mul_:mK});function dK(r){let e=v(r,"x","abs");if(e.dtype==="complex64"){let t={x:e};return _.runKernel(Wi,t)}else{let t={x:e};return _.runKernel(fn,t)}}var er=N({abs_:dK});function fK(r){let t={x:v(r,"x","acos")};return _.runKernel(hn,t)}var g1=N({acos_:fK});function hK(r){let t={x:v(r,"x","acosh")};return _.runKernel(gn,t)}var x1=N({acosh_:hK});function gK(r){$(Array.isArray(r),()=>"The argument passed to tf.addN() must be a list of tensors"),$(r.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${r.length}`);let e=r.map((n,s)=>v(n,`tensors${s}`,"addN")),t=e[0];e.forEach(n=>{if(n.dtype!==t.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(n=>{if(!Sr(n.shape,t.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});let o=e;return _.runKernel(xn,o)}var y1=N({addN_:gK});function xK(r,e=null,t=!1){let n={x:v(r,"x","all","bool")},s={axis:e,keepDims:t};return _.runKernel(yn,n,s)}var b1=N({all_:xK});function yK(r,e=null,t=!1){let n={x:v(r,"x","any","bool")},s={axis:e,keepDims:t};return _.runKernel(bn,n,s)}var C1=N({any_:yK});function bK(r,e=0){let o={x:v(r,"x","argMax")},n={axis:e};return _.runKernel(na,o,n)}var w1=N({argMax_:bK});function CK(r,e=0){let o={x:v(r,"x","argMin")},n={axis:e};return _.runKernel(sa,o,n)}var S1=N({argMin_:CK});function wK(r){let t={x:v(r,"x","asin")};return _.runKernel(Cn,t)}var I1=N({asin_:wK});function SK(r){let t={x:v(r,"x","asinh")};return _.runKernel(wn,t)}var v1=N({asinh_:SK});function IK(r){let t={x:v(r,"x","atan")};return _.runKernel(Sn,t)}var k1=N({atan_:IK});function vK(r,e){let t=v(r,"a","atan2"),o=v(e,"b","atan2");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(vn,n)}var N1=N({atan2_:vK});function kK(r){let t={x:v(r,"x","atanh")};return _.runKernel(In,t)}var T1=N({atanh_:kK});function NK(r,e,t,o,n="NHWC",s){let a=r[3],i=[...e,a],p=E1(n);return Ku(r,i,t,s,o,null,null,p)}function Qw(r,e,t,o,n,s,a="channelsLast"){let[i,p]=$c(e),u;if(a==="channelsLast")u=[i,p,r[3],r[3]];else if(a==="channelsFirst")u=[i,p,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return Ku(r,u,t,o,n,s,!1,a)}function TK(r,e,t,o,n,s,a="NDHWC"){let[i,p,u]=Yw(e),l,c;if(a==="NDHWC")c="channelsLast",l=[i,p,u,r[4],r[4]];else if(a==="NCDHW")c="channelsFirst",l=[i,p,u,r[1],r[1]];else throw new Error(`Unknown dataFormat ${a}`);return _1(r,l,t,o,n,!1,c,s)}function Ku(r,e,t,o,n,s,a=!1,i="channelsLast"){let[p,u,l,c]=[-1,-1,-1,-1];if(i==="channelsLast")[p,u,l,c]=r;else if(i==="channelsFirst")[p,c,u,l]=r;else throw new Error(`Unknown dataFormat ${i}`);let[m,d,,f]=e,[h,g]=$c(t),[x,b]=$c(o),w=ll(m,x),S=ll(d,b),{padInfo:k,outHeight:T,outWidth:E}=$K(n,u,l,h,g,w,S,s,i),R=a?f*c:f,D;return i==="channelsFirst"?D=[p,R,T,E]:i==="channelsLast"&&(D=[p,T,E,R]),{batchSize:p,dataFormat:i,inHeight:u,inWidth:l,inChannels:c,outHeight:T,outWidth:E,outChannels:R,padInfo:k,strideHeight:h,strideWidth:g,filterHeight:m,filterWidth:d,effectiveFilterHeight:w,effectiveFilterWidth:S,dilationHeight:x,dilationWidth:b,inShape:r,outShape:D,filterShape:e}}function _1(r,e,t,o,n,s=!1,a="channelsLast",i){let[p,u,l,c,m]=[-1,-1,-1,-1,-1];if(a==="channelsLast")[p,u,l,c,m]=r;else if(a==="channelsFirst")[p,m,u,l,c]=r;else throw new Error(`Unknown dataFormat ${a}`);let[d,f,h,,g]=e,[x,b,w]=Yw(t),[S,k,T]=Yw(o),E=ll(d,S),R=ll(f,k),D=ll(h,T),{padInfo:F,outDepth:O,outHeight:M,outWidth:L}=RK(n,u,l,c,x,b,w,E,R,D,i),B=s?g*m:g,z;return a==="channelsFirst"?z=[p,B,O,M,L]:a==="channelsLast"&&(z=[p,O,M,L,B]),{batchSize:p,dataFormat:a,inDepth:u,inHeight:l,inWidth:c,inChannels:m,outDepth:O,outHeight:M,outWidth:L,outChannels:B,padInfo:F,strideDepth:x,strideHeight:b,strideWidth:w,filterDepth:d,filterHeight:f,filterWidth:h,effectiveFilterDepth:E,effectiveFilterHeight:R,effectiveFilterWidth:D,dilationDepth:S,dilationHeight:k,dilationWidth:T,inShape:r,outShape:z,filterShape:e}}function _K(r,e,t,o,n){o==null&&(o=Zw(r,e,t));let s=r[0],a=r[1],i=Rc((s-e+2*o)/t+1,n),p=Rc((a-e+2*o)/t+1,n);return[i,p]}function EK(r,e,t,o,n,s){n==null&&(n=Zw(r,e[0],o[0]));let a=[0,0,0,t];for(let i=0;i<3;i++)r[i]+2*n>=e[i]&&(a[i]=Rc((r[i]-e[i]+2*n)/o[i]+1,s));return a}function Zw(r,e,t,o=1){let n=ll(e,o);return Math.floor((r[0]*(t-1)-t+n)/2)}function $c(r){return typeof r=="number"?[r,r,r]:r.length===2?[r[0],r[1],1]:r}function Yw(r){return typeof r=="number"?[r,r,r]:r}function ll(r,e){return e<=1?r:r+(r-1)*(e-1)}function $K(r,e,t,o,n,s,a,i,p){let u,l,c;if(typeof r=="number"){u={top:r,bottom:r,left:r,right:r,type:r===0?"VALID":"NUMBER"};let d=_K([e,t],s,o,r,i);l=d[0],c=d[1]}else if(r==="same"){l=Math.ceil(e/o),c=Math.ceil(t/n);let m=Math.max(0,(l-1)*o+s-e),d=Math.max(0,(c-1)*n+a-t),f=Math.floor(m/2),h=m-f,g=Math.floor(d/2),x=d-g;u={top:f,bottom:h,left:g,right:x,type:"SAME"}}else if(r==="valid")u={top:0,bottom:0,left:0,right:0,type:"VALID"},l=Math.ceil((e-s+1)/o),c=Math.ceil((t-a+1)/n);else if(typeof r=="object"){let m=p==="channelsLast"?r[1][0]:r[2][0],d=p==="channelsLast"?r[1][1]:r[2][1],f=p==="channelsLast"?r[2][0]:r[3][0],h=p==="channelsLast"?r[2][1]:r[3][1];u={top:m,bottom:d,left:f,right:h,type:m===0&&d===0&&f===0&&h===0?"VALID":"EXPLICIT"},l=Rc((e-s+m+d)/o+1,i),c=Rc((t-a+f+h)/n+1,i)}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:u,outHeight:l,outWidth:c}}function RK(r,e,t,o,n,s,a,i,p,u,l){let c,m,d,f;if(r==="valid"&&(r=0),typeof r=="number"){c={top:r,bottom:r,left:r,right:r,front:r,back:r,type:r===0?"VALID":"NUMBER"};let g=EK([e,t,o,1],[i,p,u],1,[n,s,a],r,l);m=g[0],d=g[1],f=g[2]}else if(r==="same"){m=Math.ceil(e/n),d=Math.ceil(t/s),f=Math.ceil(o/a);let h=(m-1)*n+i-e,g=(d-1)*s+p-t,x=(f-1)*a+u-o,b=Math.floor(h/2),w=h-b,S=Math.floor(g/2),k=g-S,T=Math.floor(x/2),E=x-T;c={top:S,bottom:k,left:T,right:E,front:b,back:w,type:"SAME"}}else throw Error(`Unknown padding parameter: ${r}`);return{padInfo:c,outDepth:m,outHeight:d,outWidth:f}}function Rc(r,e){if(!e)return Math.trunc(r);switch(e){case"round":return Math.round(r);case"ceil":return Math.ceil(r);case"floor":return Math.floor(r);default:throw new Error(`Unknown roundingMode ${e}`)}}function Hu(r){let[e,t,o]=$c(r);return e===1&&t===1&&o===1}function br(r,e){return Hu(r)||Hu(e)}function Aa(r){return $c(r).every(e=>e>0)}function E1(r){if(r==="NHWC")return"channelsLast";if(r==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${r}`)}function zt(r,e,t){if(t!=null){if(typeof e=="string")throw Error(`Error in ${r}: pad must be an integer when using dimRoundingMode ${t} but got pad ${e}.`);if(typeof e=="number")$(Ja(e),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${t} but got pad ${e}.`);else if(typeof e=="object")e.forEach(o=>{o.forEach(n=>{$(Ja(n),()=>`Error in ${r}: pad must be an integer when using dimRoundingMode ${t} but got pad ${n}.`)})});else throw Error(`Error in ${r}: Unknown padding parameter: ${e}`)}}function DK(r,e){let o={x:v(r,"x","reshape","string_or_numeric")},n={shape:e};return _.runKernel(Ca,o,n)}var W=N({reshape_:DK});function AK(r,e,t,o,n){let s=v(r,"x","avgPool","float32"),a=1;$(br(t,a),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${a}'`);let i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${i.rank}.`),zt("avgPool",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n},c=_.runKernel(kn,u,l);return c=Ue(c,s.dtype),p?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var Id=N({avgPool_:AK});function FK(r,e,t,o,n,s="NDHWC"){let a=v(r,"x","avgPool3d","float32"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),$(typeof t=="number"&&t>0||Array.isArray(t)&&t[0]>0&&t[1]>0&&t[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${t}'`),zt("avgPool3d",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n,dataFormat:s},c=_.runKernel(aa,u,l);return c=Ue(c,i.dtype),p?W(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var $1=N({avgPool3d_:FK});function PK(r,e=0){$(r.length>=1,()=>"Pass at least one tensor to concat");let t=di(r,"tensors","concat","string_or_numeric");if(t[0].dtype==="complex64"&&t.forEach(s=>{if(s.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${s.dtype}. `)}),t.length===1)return Xr(t[0]);let o=t,n={axis:e};return _.runKernel(pa,o,n)}var bt=N({concat_:PK});function OK(r,e,t=!1,o=!1){let n=v(r,"a","matMul"),s=v(e,"b","matMul");[n,s]=Oe(n,s);let a={a:n,b:s},i={transposeA:t,transposeB:o};return _.runKernel(Nn,a,i)}var Je=N({matMul_:OK});function MK(r){let t={x:v(r,"x","sigmoid","float32")};return _.runKernel(Ao,t)}var Pa=N({sigmoid_:MK});function LK(r,e,t){let o=v(r,"x","slice","string_or_numeric");if(o.rank===0)throw new Error("Slicing scalar is not possible");let n={x:o},s={begin:e,size:t};return _.runKernel(_s,n,s)}var Ye=N({slice_:LK});function BK(r){let t={x:v(r,"x","tanh","float32")};return _.runKernel(Ls,t)}var Dc=N({tanh_:BK});function zK(r,e,t,o,n,s){let a=v(r,"forgetBias","basicLSTMCell"),i=v(e,"lstmKernel","basicLSTMCell"),p=v(t,"lstmBias","basicLSTMCell"),u=v(o,"data","basicLSTMCell"),l=v(n,"c","basicLSTMCell"),c=v(s,"h","basicLSTMCell"),m=bt([u,c],1),d=Je(m,i),f=Ce(d,p),h=f.shape[0],g=f.shape[1]/4,x=[h,g],b=Ye(f,[0,0],x),w=Ye(f,[0,g],x),S=Ye(f,[0,g*2],x),k=Ye(f,[0,g*3],x),T=Ce(se(Pa(b),Dc(w)),se(l,Pa(Ce(a,S)))),E=se(Dc(T),Pa(k));return[T,E]}var R1=N({basicLSTMCell_:zK});function VK(r,e,t){let o=v(r,"x","batchToSpaceND"),n=e.reduce((i,p)=>i*p);$(o.rank>=1+e.length,()=>`input rank is ${o.rank} but should be > than blockShape.length ${e.length}`),$(t.length===e.length,()=>`crops.length is ${t.length} but should be equal to blockShape.length ${e.length}`),$(o.shape[0]%n===0,()=>`input tensor batch is ${o.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${n}`);let s={x:o},a={blockShape:e,crops:t};return _.runKernel(ia,s,a)}var vd=N({batchToSpaceND_:VK});function D1(r){let e;return r.rank===0||r.rank===1?e=W(r,[1,1,1,r.size]):r.rank===2?e=W(r,[1,1,r.shape[0],r.shape[1]]):r.rank===3?e=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]):e=r,e}function WK(r,e,t,o,n,s){s==null&&(s=.001);let a=v(r,"x","batchNorm"),i=v(e,"mean","batchNorm"),p=v(t,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let l;o!=null&&(l=v(o,"offset","batchNorm")),$(i.rank===p.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),$(l==null||i.rank===l.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),$(u==null||i.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let m={x:D1(a),scale:u,offset:l,mean:i,variance:p},d={varianceEpsilon:s},f=_.runKernel(Hn,m,d);return W(f,a.shape)}var mu=N({batchNorm_:WK});function UK(r,e,t,o,n,s){let a=v(r,"x","batchNorm"),i=v(e,"mean","batchNorm"),p=v(t,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let l;return o!=null&&(l=v(o,"offset","batchNorm")),$(a.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${a.rank}.`),$(i.rank===2||i.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${i.rank}.`),$(p.rank===2||p.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),l!=null&&$(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${l.rank}.`),mu(a,i,p,l,u,s)}var A1=N({batchNorm2d_:UK});function GK(r,e,t,o,n,s){let a=v(r,"x","batchNorm"),i=v(e,"mean","batchNorm"),p=v(t,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let l;return o!=null&&(l=v(o,"offset","batchNorm")),$(a.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${a.rank}.`),$(i.rank===3||i.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${i.rank}.`),$(p.rank===3||p.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),l!=null&&$(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${l.rank}.`),mu(a,i,p,l,u,s)}var F1=N({batchNorm3d_:GK});function HK(r,e,t,o,n,s){let a=v(r,"x","batchNorm"),i=v(e,"mean","batchNorm"),p=v(t,"variance","batchNorm"),u;n!=null&&(u=v(n,"scale","batchNorm"));let l;return o!=null&&(l=v(o,"offset","batchNorm")),$(a.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${a.rank}.`),$(i.rank===4||i.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${i.rank}.`),$(p.rank===4||p.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${p.rank}.`),u!=null&&$(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),l!=null&&$(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${l.rank}.`),mu(a,i,p,l,u,s)}var P1=N({batchNorm4d_:HK});function KK(r,e,t){let o=v(r,"x","bincount"),n=v(e,"weights","bincount");$(o.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${o.dtype}`),$(t>=0,()=>`size must be non-negative, but got ${t}.`),$(n.size===o.size||n.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${o.shape}, weights shape: ${n.shape}.`);let s={x:o,weights:n},a={size:t};return _.runKernel(Tn,s,a)}var kd=N({bincount_:KK});function qK(r,e){let t=v(r,"x","bitwiseAnd"),o=v(e,"y","bitwiseAnd");if(!Sr(t.shape,o.shape))throw new Error(`BitwiseAnd: Tensors must have the same shape. x: ${t.shape}, y: ${o.shape}`);if(t.dtype!=="int32"||o.dtype!=="int32")throw new Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${t.dtype} and type of y: ${o.dtype}`);let n={a:t,b:o};return _.runKernel(_n,n)}var O1=N({bitwiseAnd_:qK});function jK(r,e){let t=v(r,"s0","broadcastArgs","int32"),o=v(e,"s1","broadcastArgs","int32");if(t.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${t.rank}`);if(o.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${o.rank}`);let n={s0:t,s1:o};return _.runKernel(ua,n)}var M1=N({broadcastArgs_:jK});function XK(r,e){let t=v(r,"broadcastTo","x"),o=t.shape;if(St(e),e.lengtht.rank){let u=t.shape.slice();for(;u.length=0;u--)if(n[u]===e[u])s[u]=1;else if(t.shape[u]!==1)throw new Error(`broadcastTo(): [${o}] cannot be broadcast to [${e}].`);if(s.map((u,l)=>u>1?l:-1).filter(u=>u>=0).length===0)return Xr(t);let i={x:t},p={reps:s};return _.runKernel(Mo,i,p)}var Oa=N({broadcastTo_:XK});function YK(r){let t={x:v(r,"x","ceil","float32")};return _.runKernel(go,t)}var L1=N({ceil_:YK});function Ma(r,e,t){St(r),t=t||Bi(e);let o={shape:r,value:e,dtype:t};return _.runKernel(da,{},o)}function QK(r,e,t){let o=v(r,"x","clipByValue");if($(e<=t,()=>`Error in clip: min (${e}) must be less than or equal to max (${t}).`),e===t)return Ma(o.shape,e,o.dtype);let n={x:o},s={clipValueMin:e,clipValueMax:t};return _.runKernel(Go,n,s)}var B1=N({clipByValue_:QK});function ZK(r){return bt(r,0)}var z1=N({concat1d_:ZK});function JK(r,e){return bt(r,e)}var V1=N({concat2d_:JK});function eq(r,e){return bt(r,e)}var W1=N({concat3d_:eq});function tq(r,e){return bt(r,e)}var U1=N({concat4d_:tq});function rq(r,e,t,o,n="NHWC",s=[1,1],a){let i=v(r,"x","conv2d","float32"),p=v(e,"filter","conv2d","float32"),u=i,l=!1;i.rank===3&&(l=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${p.rank}.`),zt("conv2d",o,a);let c=n==="NHWC"?u.shape[3]:u.shape[1];$(c===p.shape[2],()=>`Error in conv2d: depth of input (${c}) must match input depth for filter ${p.shape[2]}.`),$(br(t,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),$(Aa(s),()=>"Error in conv2D: Dilated rates should be larger than 0."),$(Aa(t),()=>"Error in conv2D: Strides should be larger than 0.");let m={x:u,filter:p},d={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=_.runKernel(En,m,d);return l?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var du=N({conv2d_:rq});function oq(r,e,t,o,n="NWC",s=1,a){let i=v(r,"x","conv1d"),p=v(e,"filter","conv1d"),u=i,l=!1;i.rank===2&&(l=!0,u=W(i,[1,i.shape[0],i.shape[1]])),$(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),$(p.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${p.rank}.`),zt("conv1d",o,a),$(u.shape[2]===p.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${p.shape[1]}.`),$(br(t,s),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${t} and dilation '${s}'`),$(Aa(s),()=>"Error in conv1D: Dilated rates should be larger than 0."),$(Aa(t),()=>"Error in conv1D: Stride should be larger than 0."),$(n==="NWC",()=>`Error in conv1d: got dataFormat of ${n} but only NWC is currently supported.`);let c=W(p,[1,p.shape[0],p.shape[1],p.shape[2]]),m=W(u,[u.shape[0],1,u.shape[1],u.shape[2]]),g=du(m,c,[1,t],o,"NHWC",[1,s],a);return l?W(g,[g.shape[2],g.shape[3]]):W(g,[g.shape[0],g.shape[2],g.shape[3]])}var G1=N({conv1d_:oq});function nq(r,e,t,o,n,s="NHWC",a){$(r.length===e.rank,()=>`Length of inShape (${r.length}) and rank of dy (${e.rank}) must match`);let i=r,p=e,u=!1;e.rank===3&&(u=!0,p=W(e,[1,e.shape[0],e.shape[1],e.shape[2]]),i=[1,r[0],r[1],r[2]]),$(i.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${i.length}.`),$(p.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${p.rank}`),$(t.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${t.rank}`);let l=s==="NHWC"?i[3]:i[1],c=s==="NHWC"?p.shape[3]:p.shape[1];$(l===t.shape[2],()=>`Error in conv2dDerInput: depth of input (${l}) must match input depth for filter ${t.shape[2]}.`),$(c===t.shape[3],()=>`Error in conv2dDerInput: depth of output (${c}) must match output depth for filter ${t.shape[3]}.`),zt("conv2dDerInput",n,a);let m={dy:p,filter:t},d={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,inputShape:i},f=_.runKernel($n,m,d);return u?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var Nd=N({conv2DBackpropInput_:nq});function sq(r,e,t,o,n,s){let a=v(r,"x","conv2dTranspose"),i=v(e,"filter","conv2dTranspose");return Nd(t,a,i,o,n,"NHWC",s)}var H1=N({conv2dTranspose_:sq});function aq(r,e,t,o,n="NDHWC",s=[1,1,1]){let a=v(r,"x","conv3d"),i=v(e,"filter","conv3d"),p=a,u=!1;a.rank===4&&(u=!0,p=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(p.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${p.rank}.`),$(i.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${i.rank}.`),$(p.shape[4]===i.shape[3],()=>`Error in conv3d: depth of input (${p.shape[4]}) must match input depth for filter ${i.shape[3]}.`),$(br(t,s),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),$(n==="NDHWC",()=>`Error in conv3d: got dataFormat of ${n} but only NDHWC is currently supported.`),$(Aa(s),()=>"Error in conv3D: Dilated rates should be larger than 0."),$(Aa(t),()=>"Error in conv3D: Strides should be larger than 0.");let l={x:p,filter:i},c={strides:t,pad:o,dataFormat:n,dilations:s},m=_.runKernel(Rn,l,c);return u?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var K1=N({conv3d_:aq});function iq(r,e,t,o,n){$(r.length===e.rank,()=>`Length of inShape (${r.length}) and rank of dy (${e.rank}) must match`);let s=r,a=e,i=!1;e.rank===4&&(i=!0,a=W(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),s=[1,r[0],r[1],r[2],r[3]]);let p=s[4],u=a.shape[4];$(s.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${s.length}.`),$(a.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${a.rank}`),$(t.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${t.rank}`),$(p===t.shape[3],()=>`Error in conv3dDerInput: depth of input (${p}) must match input depth for filter ${t.shape[3]}.`),$(u===t.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${t.shape[4]}.`);let l={dy:a,filter:t},c={pad:n,strides:o,inputShape:s},m=_.runKernel(Dn,l,c);return i?W(m,[m.shape[1],m.shape[2],m.shape[3],m.shape[4]]):m}var q1=N({conv3DBackpropInput_:iq});function uq(r,e,t,o,n){let s=v(r,"x","conv3dTranspose"),a=v(e,"filter","conv3dTranspose");return q1(t,s,a,o,n)}var j1=N({conv3dTranspose_:uq});function pq(r){let t={x:v(r,"x","cos","float32")};return _.runKernel(An,t)}var X1=N({cos_:pq});function lq(r){let t={x:v(r,"x","cosh","float32")};return _.runKernel(Fn,t)}var Y1=N({cosh_:lq});function cq(r,e=0,t=!1,o=!1){let s={x:v(r,"x","cumprod")},a={axis:e,exclusive:t,reverse:o};return _.runKernel(Pn,s,a)}var Q1=N({cumprod_:cq});function mq(r,e=0,t=!1,o=!1){let s={x:v(r,"x","cumsum")},a={axis:e,exclusive:t,reverse:o};return _.runKernel(On,s,a)}var Z1=N({cumsum_:mq});function dq(r,e,t,o=!1){let n=v(r,"x","denseBincount"),s=v(e,"weights","denseBincount");$(n.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${n.dtype}`),$(n.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${n.rank}.`),$(t>=0,()=>`size must be non-negative, but got ${t}.`),$(s.size===n.size||s.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${n.shape}, weights shape: ${s.shape}.`);let a={x:n,weights:s},i={size:t,binaryOutput:o};return _.runKernel(la,a,i)}var J1=N({denseBincount_:dq});function fq(r,e,t="NHWC"){let o=v(r,"x","depthToSpace","float32"),n=t==="NHWC"?o.shape[1]:o.shape[2],s=t==="NHWC"?o.shape[2]:o.shape[3],a=t==="NHWC"?o.shape[3]:o.shape[1];$(e>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${e}`),$(n*e>=0,()=>`Negative dimension size caused by overflow when multiplying + ${n} and ${e} for depthToSpace with input shape + ${o.shape}`),$(s*e>=0,()=>`Negative dimension size caused by overflow when multiplying + ${s} and ${e} for depthToSpace with input shape + ${o.shape}`),$(a%(e*e)===0,()=>`Dimension size must be evenly divisible by ${e*e} but is ${a} for depthToSpace with input shape ${o.shape}`);let i={x:o},p={blockSize:e,dataFormat:t};return _.runKernel(Ln,i,p)}var e2=N({depthToSpace_:fq});function hq(r,e,t,o,n="NHWC",s=[1,1],a){let i=v(r,"x","depthwiseConv2d","float32"),p=v(e,"filter","depthwiseConv2d","float32"),u=i,l=!1;i.rank===3&&(l=!0,u=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),$(p.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`);let c=n==="NHWC"?u.shape[3]:u.shape[1];$(c===p.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${c}) must match the inChannels dimension in filter ${p.shape[2]}.`),zt("depthwiseConv2d",o,a);let m={x:u,filter:p},d={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a},f=_.runKernel(Bn,m,d);return l?W(f,[f.shape[1],f.shape[2],f.shape[3]]):f}var cl=N({depthwiseConv2d_:hq});function gq(r){let t={x:v(r,"x","diag")};return _.runKernel(ca,t)}var t2=N({diag_:gq});function xq(r,e,t,o,n=[1,1],s="NHWC"){let a=v(r,"x","dilation2d"),i=v(e,"filter","dilation2d");$(a.rank===3||a.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${a.rank}.`),$(i.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${i.rank}.`),$(s==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${s}`);let p=a,u=!1;a.rank===3&&(p=W(a,[1,a.shape[0],a.shape[1],a.shape[2]]),u=!0),$(p.shape[3]===i.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${p.shape[3]} vs ${i.shape[2]}`);let l={x:p,filter:i},c={strides:t,pad:o,dilations:n},m=_.runKernel(zn,l,c);return u?W(m,[m.shape[1],m.shape[2],m.shape[3]]):m}var r2=N({dilation2d_:xq});var kr={};qe(kr,{assertAndGetBroadcastShape:()=>rt,getBroadcastDims:()=>o2,getReductionAxes:()=>Td});function o2(r,e){let t=r.length,o=[];for(let n=0;n1&&a===1&&o.unshift(s)}return o}function Td(r,e){let t=[];for(let o=0;o1)&&t.unshift(s)}return t}function rt(r,e){let t=Math.max(r.length,e.length),o=new Array(t);for(let n=0;n`Error in dot: inputs must all be rank 1 or 2, but got ranks ${t.rank} and ${o.rank}.`);let n=t.rank===1?t.size:t.shape[1],s=o.rank===1?o.size:o.shape[0];if($(n===s,()=>`Error in dot: inner dimensions of inputs must match, but got ${n} and ${s}.`),t.rank===1&&o.rank===1){let a=W(t,[1,-1]),i=W(o,[-1,1]),p=Je(a,i);return W(p,[])}else if(t.rank===1&&o.rank===2){let a=W(t,[1,-1]),i=W(o,[o.shape[0],o.shape[1]]),p=Je(a,i);return W(p,[p.size])}else if(t.rank===2&&o.rank===1){let a=W(o,[-1,1]),i=Je(t,a);return W(i,[i.size])}else{let a=W(o,[o.shape[0],o.shape[1]]);return Je(t,a)}}var s2=N({dot_:Sq});function Iq(r,...e){let t=e.map((n,s)=>v(n,`tensors${s}`,"einsum")),o={equation:r};return _.runKernel(ji,t,o)}var fu=N({einsum_:Iq});function vq(r){let t={x:v(r,"x","elu","float32")};return _.runKernel(Wn,t)}var Ed=N({elu_:vq});function kq(r,e){let t=v(r,"x","ensureShape","string_or_numeric");if(!cw(t.shape,e))throw new Error(`EnsureShape: Shape of tensor ${t.shape} is not compatible with expected shape ${e}`);return r}var a2=N({ensureShape_:kq});function Nq(r){let e=v(r,"x","erf");$(e.dtype==="int32"||e.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),e.dtype==="int32"&&(e=Ue(e,"float32"));let t={x:e};return _.runKernel(Un,t)}var i2=N({erf_:Nq});function Jw(r,e){for(let t=0;tr[s]);return[t,n]}function gi(r,e){let t=e.map(o=>1);return u2(r,t,e)}function _q(r,e,t){$(Jw(e,t),()=>`${r} supports only inner-most axes for now. Got axes ${e} and rank-${t} input.`)}function Eq(r,e){if(Jw(r,e))return null;let t=[];for(let o=0;ot.push(o)),t}function $q(r){return r.map((e,t)=>[t,e]).sort((e,t)=>e[1]-t[1]).map(e=>e[0])}function Rq(r,e){let t=[];for(let o=e-r;o"Axis must be <= rank of the tensor");let o={input:t},n={dim:e};return _.runKernel(ma,o,n)}var Ks=N({expandDims_:Wq});function Uq(r){let t={x:v(r,"x","expm1")};return _.runKernel(bo,t)}var c2=N({expm1_:Uq});function Gq(r,e){let t=v(r,"x","tile","string_or_numeric");$(t.rank===e.length,()=>`Error in transpose: rank of input ${t.rank} must match length of reps ${e}.`);let o={x:t},n={reps:e};return _.runKernel(Mo,o,n)}var hu=N({tile_:Gq});function Hq(r,e,t,o="float32"){e==null&&(e=r);let n=ie([r,e],o),s=r<=e?r:e;for(let i=0;i`Error in localResponseNormalization: x must be rank 3 or 4 but got + rank ${s.rank}.`),$(Ja(e),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`);let a=s,i=!1;s.rank===3&&(i=!0,a=W(s,[1,s.shape[0],s.shape[1],s.shape[2]]));let p={x:a},u={depthRadius:e,bias:t,alpha:o,beta:n},l=_.runKernel(rs,p,u);return i?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var g2=N({localResponseNormalization_:o6});function n6(r){let t={x:v(r,"x","log","float32")};return _.runKernel(To,t)}var yi=N({log_:n6});function s6(r){let t={x:v(r,"x","log1p")};return _.runKernel(Zn,t)}var Pd=N({log1p_:s6});function a6(r){return $(ra(r),()=>"The f passed in grad(f) must be a function"),(e,t)=>{let o=v(e,"x","tf.grad","string_or_numeric"),n=t!=null?v(t,"dy","tf.grad"):null;return _.tidy(()=>{let{value:s,grads:a}=_.gradients(()=>r(o),[o],n);return n!=null&&yt(s.shape,n.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Od(a),a[0]})}}function i6(r){return $(ra(r),()=>"The f passed in grads(f) must be a function"),(e,t)=>{$(Array.isArray(e),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let o=di(e,"args","tf.grads","string_or_numeric"),n=t!=null?v(t,"dy","tf.grads"):null;return _.tidy(()=>{let{value:s,grads:a}=_.gradients(()=>r(...o),o,n);return n!=null&&yt(s.shape,n.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Od(a),a})}}function u6(r){return $(ra(r),()=>"The f passed in valueAndGrad(f) must be a function"),(e,t)=>{$(e instanceof dt,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),$(t==null||t instanceof dt,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:o,value:n}=_.gradients(()=>r(e),[e],t);return Od(o),{grad:o[0],value:n}}}function p6(r){return $(ra(r),()=>"The f passed in valueAndGrads(f) must be a function"),(e,t)=>{$(Array.isArray(e)&&e.every(n=>n instanceof dt),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),$(t==null||t instanceof dt,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let o=_.gradients(()=>r(...e),e,t);return t!=null&&yt(o.value.shape,t.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Od(o.grads),o}}function eS(r,e){$(ra(r),()=>"The f passed in variableGrads(f) must be a function"),$(e==null||Array.isArray(e)&&e.every(u=>u instanceof ci),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let t=e!=null;if(!t){e=[];for(let u in _.registeredVariables)e.push(_.registeredVariables[u])}let o=t?e.filter(u=>!u.trainable):null,n=e.length;e=e.filter(u=>u.trainable),$(e.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${n} variables is trainable.`);let s=!0,{value:a,grads:i}=_.gradients(r,e,null,s);$(i.some(u=>u!=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()."),$(a.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${a.rank} tensor`);let p={};return e.forEach((u,l)=>{i[l]!=null&&(p[u.name]=i[l])}),o!=null&&o.forEach(u=>p[u.name]=null),{value:a,grads:p}}function Nr(r){return _.customGrad(r)}function Od(r){if(r.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 l6(r){let t={x:v(r,"x","neg")};return _.runKernel(ls,t)}var mr=N({neg_:l6});function c6(r){let t={x:v(r,"x","softplus")};return _.runKernel(Ds,t)}var Md=N({softplus_:c6});function m6(r){let e=v(r,"x","logSigmoid");return Nr(o=>({value:mr(Md(mr(o))),gradFunc:a=>se(a,Pa(mr(o)))}))(e)}var x2=N({logSigmoid_:m6});function d6(r,e){let t=v(r,"a","sub"),o=v(e,"b","sub");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(Oo,n)}var Te=N({sub_:d6});function f6(r,e=-1){let t=v(r,"logits","logSoftmax");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and axis was ${e}`);return Nr((n,s)=>{let i=La(n,e,!0),p=Te(n,i),u=Te(Ue(p,"float32"),yi(ot(Jo(p),e,!0)));return s([u]),{value:u,gradFunc:(c,m)=>{let[d]=m,f=!0,h=Jo(d);return Te(c,se(ot(c,e,f),h))}}})(t)}var y2=N({logSoftmax_:f6});function h6(r,e=null,t=!1){let o=v(r,"x","logSumExp"),n=Li(e,o.shape),s=La(o,n,!0),a=Te(o,s),i=Jo(a),p=ot(i,n),u=yi(p),l=Ce(W(s,u.shape),u);if(t){let c=gi(l.shape,n);return W(l,c)}return l}var Ld=N({logSumExp_:h6});function g6(r,e){let t=v(r,"a","logicalAnd","bool"),o=v(e,"b","logicalAnd","bool");rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(Jn,n)}var Xu=N({logicalAnd_:g6});function x6(r){let t={x:v(r,"x","logicalNot","bool")};return _.runKernel(es,t)}var Bd=N({logicalNot_:x6});function y6(r,e){let t=v(r,"a","logicalOr","bool"),o=v(e,"b","logicalOr","bool");rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(ts,n)}var zd=N({logicalOr_:y6});function b6(r,e){let t=v(r,"a","logicalXor","bool"),o=v(e,"b","logicalXor","bool");return rt(t.shape,o.shape),Xu(zd(r,e),Bd(Xu(r,e)))}var b2=N({logicalXor_:b6});var Vd=2147483648;function C6(r,e,t="left"){let o=v(r,"sortedSequence","searchSorted"),n=v(e,"values","searchSorted"),s=o.shape[o.shape.length-1],a=n.shape[n.shape.length-1],i=W(o,[-1,s]),p=W(n,[-1,a]);if(i.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(i.shape[0]!==p.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(ze(p.shape)>=Vd)throw new Error(`values tensor size must less than ${Vd}`);if(i.shape[1]>=Vd)throw new Error(`trailing dim_size must less than ${Vd} for int32 output type, was ${i.shape[1]}`);let u={sortedSequence:i,values:p},l={side:t};return _.runKernel(Ns,u,l)}var Pc=N({searchSorted_:C6});function C2(r,e){return Pc(r,e,"left")}function w6(r,e,t,o,n){let s=v(r,"x","maxPool"),a=1,i=s,p=!1;s.rank===3&&(p=!0,i=W(s,[1,s.shape[0],s.shape[1],s.shape[2]])),$(i.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${i.rank}.`),$(br(t,a),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${a}'`),zt("maxPool",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n},c=_.runKernel(ns,u,l);return p?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var Wd=N({maxPool_:w6});function S6(r,e=[1,1,1],t,o,n,s="NDHWC"){let a=v(r,"x","maxPool3d"),i=a,p=!1;a.rank===4&&(p=!0,i=W(a,[1,a.shape[0],a.shape[1],a.shape[2],a.shape[3]])),$(i.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${i.rank}.`),$(s==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${s}`),zt("maxPool3d",o,n);let u={x:i},l={filterSize:e,strides:t,pad:o,dimRoundingMode:n,dataFormat:s},c=_.runKernel(ha,u,l);return p?W(c,[c.shape[1],c.shape[2],c.shape[3],c.shape[4]]):c}var w2=N({maxPool3d_:S6});function I6(r,e,t,o,n=!1){let a={x:v(r,"x","maxPoolWithArgmax")},i={filterSize:e,strides:t,pad:o,includeBatchInIndex:n},p=_.runKernel(ga,a,i);return{result:p[0],indexes:p[1]}}var S2=N({maxPoolWithArgmax_:I6});function v6(r,e){let t=v(r,"a","maximum"),o=v(e,"b","maximum");[t,o]=Oe(t,o),t.dtype==="bool"&&(t=Ue(t,"int32"),o=Ue(o,"int32")),rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(_o,n)}var Ud=N({maximum_:v6});function k6(r,e=null,t=!1){let n={x:v(r,"x","mean")},s={axis:e,keepDims:t};return _.runKernel(ss,n,s)}var Yu=N({mean_:k6});function Yr(r,e="float32"){if(St(r),e==="complex64"){let o=Yr(r,"float32"),n=Yr(r,"float32");return Ar(o,n)}let t=Yp(ze(r),e);return _.makeTensor(t,r,e)}function Ba(r,e="float32"){if(St(r),e==="complex64"){let o=Ba(r,"float32"),n=Yr(r,"float32");return Ar(o,n)}let t=bc(ze(r),e);return _.makeTensor(t,r,e)}function I2(r,e,{indexing:t="xy"}={}){if(t!=="xy"&&t!=="ij")throw new TypeError(`${t} is not a valid third argument to meshgrid`);if(r===void 0)return[];let o=v(r,"x","meshgrid",r instanceof dt?r.dtype:"float32");if(e===void 0)return[o];let n=v(e,"y","meshgrid",e instanceof dt?e.dtype:"float32"),s=ze(o.shape),a=ze(n.shape);return t==="xy"?(o=W(o,[1,-1]),n=W(n,[-1,1]),[Je(Ba([a,1],o.dtype),o),Je(n,Ba([1,s],n.dtype))]):(o=W(o,[-1,1]),n=W(n,[1,-1]),[Je(o,Ba([1,a],o.dtype)),Je(Ba([s,1],n.dtype),n)])}function N6(r,e){let t=v(r,"a","minimum"),o=v(e,"b","minimum");[t,o]=Oe(t,o),t.dtype==="bool"&&(t=Ue(t,"int32"),o=Ue(o,"int32")),rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(Eo,n)}var Qu=N({minimum_:N6});function T6(r,e,t){$(t==="reflect"||t==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${t}.`);let o=v(r,"x","mirrorPad");if(o.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");$(e.length===o.rank,()=>`Padding doesn't match input. Must be ${o.rank}. Got ${e.length}.`);let n=t==="reflect"?1:0;for(let i=0;i"Invalid number of paddings. Must be length of 2 each."),$(e[i][0]>=0&&e[i][0]<=o.shape[i]-n&&e[i][1]>=0&&e[i][1]<=o.shape[i]-n,()=>`Padding in dimension ${i} cannot be greater than or equal to ${o.shape[i]-n} or less than 0 for input of shape ${o.shape}`);let s={paddings:e,mode:t},a={x:o};return _.runKernel(is,a,s)}var v2=N({mirrorPad_:T6});function _6(r,e){let t=v(r,"a","mod"),o=v(e,"b","mod");[t,o]=Oe(t,o);let n={a:t,b:o};return _.runKernel(us,n)}var k2=N({mod_:_6});function E6(r,e=null,t=!1){r=v(r,"x","moments");let o=Li(e,r.shape),n=Yu(r,o,t),s=n.shape;t||(s=gi(n.shape,o));let a=tr(Te(Ue(r,"float32"),W(n,s))),i=Yu(a,o,t);return{mean:n,variance:i}}var N2=N({moments_:E6});function $6(r,e,t,o){let n=v(e,"data","multiRNNCell"),s=di(t,"c","multiRNNCell"),a=di(o,"h","multiRNNCell"),i=n,p=[];for(let c=0;c2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${a}`);t=t||Math.random();let p={logits:a===1?W(n,[1,-1]):n},u={numSamples:e,seed:t,normalized:o},l=_.runKernel(ps,p,u);return a===1?W(l,[l.size]):l}var _2=N({multinomial_:R6});function D6(r,e){let t=v(r,"a","notEqual","string_or_numeric"),o=v(e,"b","notEqual","string_or_numeric");[t,o]=Oe(t,o),rt(t.shape,o.shape);let n={a:t,b:o};return _.runKernel(Ro,n)}var Gd=N({notEqual_:D6});function A6(r,e,t=1,o=0,n="int32"){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);let a={indices:v(r,"indices","oneHot","int32")},i={dtype:n,depth:e,onValue:t,offValue:o};return _.runKernel(ds,a,i)}var Oc=N({oneHot_:A6});function F6(r){let t={x:v(r,"x","onesLike")};return _.runKernel(xa,t)}var E2=N({onesLike_:F6});function P6(r,e){let t=v(r,"v1","outerProduct"),o=v(e,"v2","outerProduct");$(t.rank===1&&o.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${t.rank} and ${o.rank}.`);let n=W(t,[-1,1]),s=W(o,[1,-1]);return Je(n,s)}var $2=N({outerProduct_:P6});function O6(r,e,t=0){let o=v(r,"x","pad");if(o.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");let n={paddings:e,constantValue:t},s={x:o};return _.runKernel(fs,s,n)}var za=N({pad_:O6});function M6(r,e,t=0){return $(e.length===2,()=>"Invalid number of paddings. Must be length of 2."),za(r,[e],t)}var R2=N({pad1d_:M6});function L6(r,e,t=0){return $(e.length===2&&e[0].length===2&&e[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),za(r,e,t)}var D2=N({pad2d_:L6});function B6(r,e,t=0){return $(e.length===3&&e[0].length===2&&e[1].length===2&&e[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),za(r,e,t)}var A2=N({pad3d_:B6});function z6(r,e,t=0){return $(e.length===4&&e[0].length===2&&e[1].length===2&&e[2].length===2&&e[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),za(r,e,t)}var F2=N({pad4d_:z6});function V6(r,e,t){let o=v(r,"x","spaceToBatchND");$(o.rank>=1+e.length,()=>`input rank ${o.rank} should be > than [blockShape] ${e.length}`),$(t.length===e.length,()=>`paddings.shape[0] ${t.length} must be equal to [blockShape] ${e.length}`),$(o.shape.reduce((a,i,p)=>p>0&&p<=e.length?a&&(i+t[p-1][0]+t[p-1][1])%e[p-1]===0:a,!0),()=>`input spatial dimensions ${o.shape.slice(1)} with paddings ${t.toString()} must be divisible by blockShapes ${e.toString()}`);let n={x:o},s={blockShape:e,paddings:t};return _.runKernel(Sa,n,s)}var Hd=N({spaceToBatchND_:V6});function W6(r,e,t,o,n,s,a){n==null&&(n=[1,1]),s==null&&(s=1),o===0&&(o="valid");let i=v(r,"x","maxPool"),p=i,u=!1;i.rank===3&&(u=!0,p=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),$(br(s,n),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${s} and dilations '${n}'`);let l=Qw(p.shape,e,s,n,o),c=[l.dilationHeight,l.dilationWidth],m;o==="same"?m=G6([l.filterHeight,l.filterWidth],c):m=[[0,0],[0,0]];let d=c[0]===1&&c[1]===1,[f,h]=U6([l.inHeight,l.inWidth],c,m),g=d?o:"valid",x=d?p:Hd(p,c,f),w=(t==="avg"?()=>Id(x,e,s,g,a):()=>Wd(x,e,s,g,a))(),S=d?w:vd(w,c,h);return u?W(S,[S.shape[1],S.shape[2],S.shape[3]]):S}function U6(r,e,t){let o=t.map(l=>l[0]),n=t.map(l=>l[1]),s=r.concat(o,n),a=e.map((l,c)=>(l-s[c]%l)%l),i=n.map((l,c)=>l+a[c]),p=e.map((l,c)=>[o[c],i[c]]),u=e.map((l,c)=>[0,a[c]]);return[p,u]}function G6(r,e){let o=r.map((a,i)=>a+(a-1)*(e[i]-1)).map(a=>a-1),n=o.map(a=>Math.floor(a/2)),s=o.map((a,i)=>a-n[i]);return o.map((a,i)=>[n[i],s[i]])}var P2=N({pool_:W6});function H6(r,e){let t=v(r,"x","prelu"),o=v(e,"alpha","prelu"),n={x:t,alpha:o};return _.runKernel(gs,n)}var Kd=N({prelu_:H6});function K6(r,e=null,t=!1){let o=v(r,"x","prod");o.dtype==="bool"&&(o=Ue(o,"int32"));let n={x:o},s={axis:e,keepDims:t};return _.runKernel(Ho,n,s)}var O2=N({prod_:K6});function q6(r,e,t,o){let n=r.map((l,c)=>v(l,`tensors${c}`,"raggedGather","int32")),s=v(e,"paramsDenseValues","raggedGather"),a=v(t,"indices","raggedGather","int32"),i={paramsNestedSplits:n,paramsDenseValues:s,indices:a},p={outputRaggedRank:o},u=_.runKernel(Qp,i,p);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}var M2=N({raggedGather_:q6});function j6(r,e,t){let o=v(r,"starts","raggedRange"),n=v(e,"limits","raggedRange",o.dtype),s=v(t,"deltas","raggedRange",o.dtype),a={starts:o,limits:n,deltas:s},i=_.runKernel(Zp,a);return{rtNestedSplits:i[0],rtDenseValues:i[1]}}var L2=N({raggedRange_:j6});function X6(r,e,t,o,n){let s=v(r,"shape","raggedTensorToTensor","int32"),a=v(e,"values","raggedTensorToTensor"),i=v(t,"defaultValue","raggedTensorToTensor",a.dtype),p=o.map((c,m)=>v(c,`tensors${m}`,"raggedTensorToTensor","int32")),u={shape:s,values:a,defaultValue:i,rowPartitionTensors:p},l={rowPartitionTypes:n};return _.runKernel(Jp,u,l)}var B2=N({raggedTensorToTensor_:X6});function Y6(r,e,t){St(r);let o=ze(r),n=null;if(t==null||t==="float32")n=new Float32Array(o);else if(t==="int32")n=new Int32Array(o);else if(t==="bool")n=new Uint8Array(o);else throw new Error(`Unknown data type ${t}`);for(let s=0;soN,createVideoElement:()=>pj,encodeStrings:()=>sN,expectArrayBuffersEqual:()=>uj,expectArraysClose:()=>nj,expectArraysEqual:()=>aj,expectNumbersClose:()=>nN,expectPromiseToFail:()=>sj,expectValuesInRange:()=>ij,play:()=>lj,testEpsilon:()=>jd});var oj=.001,oN=.1;function nj(r,e,t){return t==null&&(t=jd()),uS(r,e,(o,n)=>pS(o,n,t))}function jd(){return _.backend.floatPrecision()===32?oj:oN}function uS(r,e,t){let o=!0;if((Mt(r)||Mt(e))&&(o=!1),Mt(r)&&Mt(e)&&(o=!0),o){let a=r.constructor.name,i=e.constructor.name;if(a!==i)throw new Error(`Arrays are of different type. Actual: ${a}. Expected: ${i}`)}if(Array.isArray(r)&&Array.isArray(e)){let a=ur(r),i=ur(e);if(!Sr(a,i))throw new Error(`Arrays have different shapes. Actual: [${a}]. Expected: [${i}]`)}let n=Mt(r)?r:Us(r),s=Mt(e)?e:Us(e);if(n.length!==s.length)throw new Error(`Arrays have different lengths actual: ${n.length} vs expected: ${s.length}. Actual: ${n}. -Expected: ${s}.`);for(let a=0;at.fail(),()=>t()),typeof expect!="undefined"&&expect().nothing()}function Aq(r,t){let e=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return zo(r)||zo(r[0])||zo(t)||zo(t[0])?jw(r,e,(o,n)=>o==n):jw(r,t,(o,n)=>Xw(o,n,0))}function f1(r,t,e){if(e==null&&(e=Md()),!Xw(r,t,e))throw new Error(`Numbers differ: actual === ${r}, expected === ${t}`);typeof expect!="undefined"&&expect().nothing()}function Xw(r,t,e){return!isFinite(r)&&!isFinite(t)?!0:!(isNaN(r)||isNaN(t)||Math.abs(r-t)>e)}function Fq(r,t,e){for(let o=0;oe)throw new Error(`Value out of range:${r[o]} low: ${t}, high: ${e}`)}function Pq(r,t){let e=new Float32Array(r),o=new Float32Array(t);if(e.length!==o.length)throw new Error(`Expected ArrayBuffer to be of length ${o.length}, but it was ${e.length}`);for(let n=0;n{t.addEventListener("loadeddata",o=>e(t)),t.load()})}async function Mq(r){await r.play(),"requestVideoFrameCallback"in r&&await new Promise(t=>{r.requestVideoFrameCallback(t)})}var Hu=class{constructor(t,e,o,n,s){this.mean=t,this.stdDev=e,this.dtype=o,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);let a=s||Math.random();this.random=zd.alea(a.toString())}nextValue(){if(!isNaN(this.nextVal)){let n=this.nextVal;return this.nextVal=NaN,n}let t,e,o=!1;for(;!o;){let n,s,a;do n=2*this.random()-1,s=2*this.random()-1,a=n*n+s*s;while(a>=1||a===0);let i=Math.sqrt(-2*Math.log(a)/a);t=this.mean+this.stdDev*n*i,e=this.mean+this.stdDev*s*i,(!this.truncated||this.isValidTruncated(t))&&(o=!0)}return(!this.truncated||this.isValidTruncated(e))&&(this.nextVal=this.convertValue(e)),this.convertValue(t)}convertValue(t){return this.dtype==null||this.dtype==="float32"?t:Math.round(t)}isValidTruncated(t){return t<=this.upper&&t>=this.lower}},Ld=class{constructor(t,e,o,n){this.alpha=t,this.beta=1/e,this.dtype=o;let s=n||Math.random();this.randu=zd.alea(s.toString()),this.randn=new Hu(0,1,o,!1,this.randu()),t<1?this.d=t+2/3:this.d=t-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let t,e,o,n,s,a;for(;;){do n=this.randn.nextValue(),a=1+this.c*n;while(a<=0);if(a*=a*a,t=n*n,e=1-.331*t*t,o=.5*t+this.d*(1-a+Math.log(a)),s=this.randu(),sthis.dtype==null||this.dtype==="float32",this.min=t,this.range=e-t,this.dtype=o,n==null&&(n=Math.random()),typeof n=="number"&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${t} - ${e} <= 1 and dtype is not float`);this.random=zd.alea(n)}convertValue(t){return this.canReturnFloat()?t:Math.round(t)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function Lq(r,t,e=1,o="float32",n){if(Ct(r),e==null&&(e=1),o==null&&(o="float32"),o!=="float32"&&o!=="int32")throw new Error(`Unsupported data type ${o}`);let s=new Ld(t,e,o,n),a=me(r,o);for(let i=0;i`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),lo(t,0)}var w1=N({reverse1d_:jq});function Xq(r,t){let e=v(r,"x","reverse");return $(e.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${e.rank}.`),lo(e,t)}var S1=N({reverse2d_:Xq});function Yq(r,t){let e=v(r,"x","reverse");return $(e.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${e.rank}.`),lo(e,t)}var I1=N({reverse3d_:Yq});function Qq(r,t){let e=v(r,"x","reverse");return $(e.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${e.rank}.`),lo(e,t)}var v1=N({reverse4d_:Qq});function Zq(r){let e={x:v(r,"x","round")};return T.runKernel(cs,e)}var Ud=N({round_:Zq});function Jq(r){let e={x:v(r,"x","rsqrt","float32")};return T.runKernel(ls,e)}var k1=N({rsqrt_:Jq});function e6(r){let e={x:v(r,"x","selu")};return T.runKernel(hs,e)}var N1=N({selu_:e6});function t6(r,t,e,o,n,s=[1,1],a="NHWC"){let i=v(r,"x","separableConv2d"),p=v(t,"depthwiseFilter","separableConv2d"),u=v(e,"pointwiseFilter","separableConv2d"),c=i,l=!1;if(i.rank===3&&(l=!0,c=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),a==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");$(c.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`),$(p.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${p.rank}.`),$(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${p.rank}.`),$(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),$(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);let m=p.shape[2],d=p.shape[3];$(u.shape[2]===m*d,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${m*d}, but got ${u.shape[2]}.`);let f=oc(c,p,o,n,a,s),g=nu(f,u,1,"valid",a);return l?W(g,[g.shape[1],g.shape[2],g.shape[3]]):g}var T1=N({separableConv2d_:t6});async function r6(r,t){let e=v(r,"x","setdiff1d"),o=v(t,"y","setdiff1d");$(e.dtype===o.dtype,()=>`x and y should have the same dtype, but got x (${e.dtype}) and y (${o.dtype}).`),$(e.rank===1,()=>`x should be 1D tensor, but got x (${e.shape}).`),$(o.rank===1,()=>`y should be 1D tensor, but got y (${o.shape}).`);let n=await e.data(),s=await o.data(),a=new Set(s),i=0;for(let c=0;c`slice1d expects a rank-1 tensor, but got a rank-${o.rank} tensor`),Xe(o,[t],[e])}var D1=N({slice1d_:a6});function i6(r,t,e){let o=v(r,"x","slice2d");return $(o.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${o.rank} tensor`),Xe(o,t,e)}var A1=N({slice2d_:i6});function u6(r,t,e){let o=v(r,"x","slice3d");return $(o.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${o.rank} tensor`),Xe(o,t,e)}var F1=N({slice3d_:u6});function p6(r,t,e){let o=v(r,"x","slice4d");return $(o.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${o.rank} tensor`),Xe(o,t,e)}var P1=N({slice4d_:p6});function c6(r,t=-1){let e=v(r,"logits","softmax","float32");if(t===-1&&(t=e.rank-1),t!==e.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${e.rank} and dim was ${t}`);let o={logits:e},n={dim:t};return T.runKernel(Is,o,n)}var O1=N({softmax_:c6});function l6(r){$(r.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${r.dtype}.`);let t={input:r};return T.runKernel(Bi,t)}var ac=N({fft_:l6});function m6(r){$(r.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${r.dtype}.`);let t={input:r};return T.runKernel(zi,t)}var Ku=N({ifft_:m6});function d6(r){let t=r.shape[r.shape.length-1],e=r.size/t,o;if(t<=2){let n=W(r,[e,t]);o=Ku(n)}else{let n=[e,2*(t-1)],s=W(pi(r),[e,t]),a=W(iu(r),[e,t]),i=lo(Xe(s,[0,1],[e,t-2]),1),p=se(lo(Xe(a,[0,1],[e,t-2]),1),ke(-1)),u=yt([s,i],1),c=yt([a,p],1),l=W($r(u,c),[n[0],n[1]]);o=Ku(l)}if(o=pi(o),r.rank===3&&r.shape[0]!==0){let n=o,s=r.shape[0];o=W(o,[s,o.shape[0]/s,o.shape[1]]),n.dispose()}return o}var Gd=N({irfft_:d6});function f6(r,t,e=0){let n={x:v(r,"x","split")},s={numOrSizeSplits:t,axis:e};return T.runKernel(xa,n,s)}var ci=N({split_:f6});function h6(r,t){$(r.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${r.dtype}`);let e=r.shape[r.shape.length-1],o=r.size/e,n;if(t!=null&&t0),h=r.shape.map(g=>g);h[r.shape.length-1]=t,n=Xe(r,f,h),e=t}else if(t!=null&&t>e){let f=r.shape.map(h=>h);f[r.shape.length-1]=t-e,n=yt([r,Ur(f)],r.shape.length-1),e=t}else n=r;let s=Gt(n),a=W($r(n,s),[o,e]),i=ac(a),p=Math.floor(e/2)+1,u=pi(i),c=iu(i),l=ci(u,[p,e-p],u.shape.length-1),m=ci(c,[p,e-p],c.shape.length-1),d=n.shape.slice();return d[n.shape.length-1]=p,W($r(l[0],m[0]),d)}var ic=N({rfft_:h6});function g6(r,t){let e=v(r,"a","squaredDifference"),o=v(t,"b","squaredDifference");[e,o]=Oe(e,o),rt(e.shape,o.shape);let n={a:e,b:o},s={};return T.runKernel(ks,n,s)}var Hd=N({squaredDifference_:g6});function x6(r,t){let e=v(r,"x","squeeze","string_or_numeric");return W(e,ZC(e.shape,t).newShape)}var uc=N({squeeze_:x6});function y6(r,t=0){let e=ni(r,"tensors","stack","string_or_numeric");$(e.length>=1,()=>"Pass at least one tensor to tf.stack"),e.length>0&&$(t<=e[0].rank,()=>"Axis must be <= rank of the tensor");let o=e,n={axis:t};return T.runKernel(la,o,n)}var vr=N({stack_:y6});function b6(r,t=0){let o={x:v(r,"x","step")},n={alpha:t};return T.runKernel(wo,o,n)}var Kd=N({step_:b6});function C6(r,t,e,o,n=0,s=0,a=0,i=0,p=0){let c={x:v(r,"x","stridedSlice","string_or_numeric")},l={begin:t,end:e,strides:o,beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};return T.runKernel(Ns,c,l)}var M1=N({stridedSlice_:C6});function w6(r){let e={x:v(r,"x","tan","float32")};return T.runKernel(_s,e)}var L1=N({tan_:w6});function Jt(r,t){ao(r);let e=sr(r,t);if(e.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return wr(r,null,e,t)}function cu(r,t,e){if(ao(r),t!=null&&t.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let o=sr(r,e);if(o.length!==2&&o.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(o.length===1&&t==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return wr(r,t,o,e)}function qd(r,t,e){if(ao(r),t!=null&&t.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let o=sr(r,e);if(o.length!==3&&o.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(o.length===1&&t==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return wr(r,t,o,e)}function B1(r,t,e){if(ao(r),t!=null&&t.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let o=sr(r,e);if(o.length!==4&&o.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(o.length===1&&t==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return wr(r,t,o,e)}function z1(r,t,e){if(ao(r),t!=null&&t.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let o=sr(r,e);if(o.length!==5&&o.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(o.length===1&&t==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return wr(r,t,o,e)}function V1(r,t,e){if(ao(r),t!=null&&t.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let o=sr(r,e);if(o.length!==6&&o.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(o.length===1&&t==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||o,wr(r,t,o,e)}var lu={};qe(lu,{calculateShapes:()=>W1,validateInput:()=>pc,validateUpdateShape:()=>Yw});function Yw(r,t,e){let o=t.rank>1?t.shape[t.rank-1]:1,n=t.rank>1?t.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${e.shape}, indices.shape: ${t.shape}, shape: ${r}, sliceDim: ${o}, and batchDim: ${n}.`;if(e.rank1?t.shape[o-1]:1,s=e.length,a=1;for(let l=n;l= 0 but got ${t}`);if(t>n)throw new Error(`'k' passed to topk() must be <= the last dimension (${n}) but got ${t}`);let s={x:o},a={k:t,sorted:e},[i,p]=T.runKernel(Es,s,a);return{values:i,indices:p}}var G1=N({topk_:I6});function v6(r,t=0,e=1,o,n){if(Ct(r),o!=null&&o==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new Hu(t,e,o,!0,n),a=me(r,o);for(let i=0;i0,()=>"The input tensor must be at least 1D");let o={x:e},n={axis:t},[s,a]=T.runKernel(Xi,o,n);return{values:s,indices:a}}var K1=N({unique_:k6});function N6(r,t,e){let o=v(r,"x","unsortedSegmentSum"),n=v(t,"segmentIds","unsortedSegmentSum","int32");$(Ka(e),()=>"numSegments must be of dtype int");let s={x:o,segmentIds:n},a={numSegments:e};return T.runKernel(Yi,s,a)}var q1=N({unsortedSegmentSum_:N6});function T6(r,t=0){let e=v(r,"x","unstack","string_or_numeric");$(t>=-e.shape.length&&t`Axis = ${t} is not in [-${e.shape.length}, ${e.shape.length})`);let o={value:e},n={axis:t};return T.runKernel(wa,o,n)}var mo=N({unstack_:T6});function j1(r,t){return Nl(r,t,"right")}function X1(r,t=!0,e,o){return T.makeVariable(r,t,e,o)}function jd(r,t){let e=[];for(let s=0;s0,()=>"mask cannot be scalar"),xt(i.slice(s,s+a),n.shape,"mask's shape must match the first K dimensions of tensor's shape,");let p=1;for(let h=s;hi).reverse()),$(o.rank===t.length,()=>`Error in transpose: rank of input ${o.rank} must match length of perm ${t}.`),t.forEach(a=>{$(a>=0&&a`All entries in 'perm' must be between 0 and ${o.rank-1} but got ${t}`)}),o.rank<=1)return o.clone();let n={x:o},s={perm:t};return o.dtype==="complex64"?De(()=>{let a=pi(o),i=iu(o);return a=T.runKernel(po,{x:a},s),i=T.runKernel(po,{x:i},s),e&&(i=pr(i)),$r(a,i)}):T.runKernel(po,n,s)}var cc=N({transpose_:R6});function D6(r,t,e,o,n=!0){let s=v(r,"v","movingAverage"),a=v(t,"x","movingAverage"),i=v(e,"decay","movingAverage");Cw(s,a),$(br(s.shape,a.shape),()=>"Shape mismatch in v and x");let p=ke(1),u=Te(p,i),c=se(Te(a,s),u);if(n){$(o!=null,()=>"When using zeroDebias: true, step is required.");let l=v(o,"step","movingAverage");c=je(c,Te(p,ii(i,l)))}return Ce(s,c)}var A6=N({movingAverage_:D6});function F6(r,t,e){Ct(e);let o=v(r,"indices","scatterND","int32"),n=v(t,"updates","scatterND");pc(n,o,e);let s={indices:o,updates:n},a={shape:e};return T.runKernel(ms,s,a)}var P6=N({scatterND_:F6});function Y1(r,t,e,o){if(r.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${r.dtype}.`);if(r.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${r.shape}.`);let n=r.rank>0?r.shape[0]:1,s=r.rank>1?r.shape[1]:1;if(e.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${e.length}, should be: ${s}.`);let a=t.size;if(!(t.rank===0||t.rank===1&&a===n))throw new Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${n}]`);if(t.dtype!==o.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function M6(r,t,e,o=0){Ct(e);let n=v(r,"sparseIndices","sparseToDense","int32"),s=v(t,"sparseValues","sparseToDense","string_or_numeric"),a=v(o,"defaultValue","sparseToDense",s.dtype);Y1(n,s,e,a);let i={sparseIndices:n,sparseValues:s,defaultValue:a},p={outputShape:e};return T.runKernel(vs,i,p)}var L6=N({sparseToDense_:M6});function B6(r,t){let e=v(t,"indices","gatherND","int32"),n={params:v(r,"x","gatherND","string_or_numeric"),indices:e};return T.runKernel(vn,n)}var z6=N({gatherND_:B6});function Q1(r,t){if(t==null)return r.shape.slice();if(br(r.shape,t))return t;if(r.shape.length===t.length){let e=[];for(let o=0;o`x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`),$(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),t===0)return r instanceof mt?n.clone():n;let s=Q1(n,e),a=1-t,i=je(Cd(Ce(sc(s,0,1,"float32",o),a)),a);return se(n,i)}var W6=N({dropout_:V6});function Qw(r){return Math.floor(Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))))}function _l(r,t,e){let o=1-r%2,n=new Float32Array(r);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${o.rank}`),$(o.rank-1===n.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${o.rank} and targets rank ${n.rank}`),xt(o.shape.slice(0,o.shape.length-1),n.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=o.shape[o.shape.length-1];$(e>0&&e<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${e}`);let a=await o.data(),i=await n.data(),[p,u]=[a.length/s,s],c=JC("bool",p);for(let l=0;lg.value-h.value),c[l]=0;for(let h=0;hJ1,depthwiseConv2d:()=>rN,matMul:()=>oN});function H6(r,t,e,o,n,s="NHWC",a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=t;p.rank===3&&(p=W(t,[1,t.shape[0],t.shape[1],t.shape[2]])),$(i.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${i.shape}.`),$(p.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`),$(e.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${e}.`);let u=s==="NHWC"?i.shape[3]:i.shape[1],c=s==="NHWC"?p.shape[3]:p.shape[1];$(u===e[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${e[2]}.`),$(c===e[3],()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${e[3]}).`),Lt("conv2dDerFilter",n,a);let l={x:i,dy:p},m={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,filterShape:e};return T.runKernel(Ai,l,m)}var Z1=N({conv2DBackpropFilter_:H6});function qu(r,t,e){if(e==null||e==="linear")return r;if(e==="relu")return se(r,Kd(t));throw new Error(`Cannot compute gradient for fused activation ${e}.`)}function ju(r,t){let e=t,o=gd(r.shape,t.shape);return o.length>0&&(e=ot(e,o)),W(e,r.shape)}function Xu(r,t,e,o){if(t==="linear")return r;if(t==="relu")return pu(r);if(t==="elu")return yd(r);if(t==="relu6")return Wd(r);if(t==="prelu")return Pd(r,e);if(t==="leakyrelu")return Id(r,o);if(t==="sigmoid")return $a(r);throw new Error(`Unknown fused activation ${t}.`)}var Yu=(r,t)=>!(r>0)||t==="linear";function K6({x:r,filter:t,strides:e,pad:o,dataFormat:n="NHWC",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(p=p||"linear",Yu(T.state.gradientDepth,p)===!1){$(n==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${n} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let _=nu(r,t,e,o,n,s,a);return i!=null&&(_=Ce(_,i)),Xu(_,p,u,c)}let l=v(r,"x","conv2d","float32"),m=v(t,"filter","conv2d","float32"),d=l,f=!1;l.rank===3&&(f=!0,d=W(l,[1,l.shape[0],l.shape[1],l.shape[2]])),$(d.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${m.rank}.`),Lt("fused conv2d",o,a);let h=n==="NHWC"?d.shape[3]:d.shape[1];$(m.shape[2]===h,()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${m.shape[2]}.`),$(gr(e,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`);let g=Lu(d.shape,m.shape,e,s,o,a),x;i!=null&&(x=v(i,"bias","fused conv2d"),[x]=Oe(x,l),n==="NHWC"?rt(g.outShape,x.shape):($(x.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${x.shape.length}.`),$(x.shape.length===0||x.shape[0]===g.outChannels||x.shape[0]===1,()=>`Error in fused conv2d: bias shape (${x.shape}) is not compatible with the number of output channels (${g.outChannels})`)));let b;if(u!=null){let _=u.shape;if($(_.length<=1||_.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${_.length}.`),_.length===1)$(_[0]===1||_[0]===g.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${_}) is not compatible with the number of output channels (${g.outChannels}).`);else if(_.length===3)try{rt(_,g.outShape)}catch(E){let R=`Error in fused conv2d: PReLU activation weights (${_}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(R)}b=v(u,"prelu weights","fused conv2d")}let C=(_,E)=>{$(n==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${n} but only NHWC is currently supported.`);let[R,D,P,O]=E,M=qu(_,P,p);$(Mu(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let L=hd(D.shape,M,R,e,o),B=Z1(D,M,R.shape,e,o),z=[L,B];if(O!=null){let U=ju(O,M);z.push(U)}return z},S={x:d,filter:m,bias:x,preluActivationWeights:b},k={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:c};return i==null?Ir((E,R,D)=>{let P=T.runKernel(Io,S,k);return D([R,E,P]),f&&(P=W(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:C}})(d,m):Ir((E,R,D,P)=>{let O=T.runKernel(Io,S,k);return P([R,E,O,D]),f&&(O=W(O,[O.shape[1],O.shape[2],O.shape[3]])),{value:O,gradFunc:C}})(d,m,x)}var J1=N({fusedConv2d_:K6});function q6(r,t,e,o,n,s=[1,1],a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=t;p.rank===3&&(p=W(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={x:i,dy:p},c={strides:o,pad:n,dimRoundingMode:a,dilations:s,filterShape:e};return T.runKernel(Fi,u,c)}var eN=N({depthwiseConv2dNativeBackpropFilter_:q6});function j6(r,t,e,o,n,s=[1,1],a){let i=t,p=!1;t.rank===3&&(p=!0,i=W(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let u={dy:i,filter:e},c={strides:o,pad:n,dimRoundingMode:a,dilations:s,inputShape:r},l=T.runKernel(Pi,u,c);return p?W(l,[l.shape[1],l.shape[2],l.shape[3]]):l}var tN=N({depthwiseConv2dNativeBackpropInput_:j6});function X6({x:r,filter:t,strides:e,pad:o,dataFormat:n="NHWC",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(Yu(T.state.gradientDepth,p)===!1){let k=oc(r,t,e,o,n,s,a);return i!=null&&(k=Ce(k,i)),Xu(k,p,u,c)}let l=v(r,"x","depthwiseConv2d","float32"),m=v(t,"filter","depthwiseConv2d","float32"),d=l,f=!1;l.rank===3&&(f=!0,d=W(l,[1,l.shape[0],l.shape[1],l.shape[2]])),$(d.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${m.rank}.`),$(d.shape[3]===m.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${m.shape[2]}.`),s==null&&(s=[1,1]),$(gr(e,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${e} and dilations '${s}'`),Lt("fused depthwiseConv2d",o,a);let h=Lu(d.shape,m.shape,e,s,o,a,!0),g;i!=null&&(g=v(i,"bias","fused conv2d"),[g]=Oe(g,l),rt(h.outShape,g.shape));let x;u!=null&&(x=v(u,"prelu weights","fused depthwiseConv2d"));let b=(k,_)=>{$(Mu(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[E,R,D,P]=_,O=qu(k,D,p),M=tN(R.shape,O,E,e,o,s,a),L=eN(R,O,E.shape,e,o,s,a);if(P!=null){let B=ju(g,O);return[M,L,B]}return[M,L]},C={x:d,filter:m,bias:g,preluActivationWeights:x},S={strides:e,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:c};return i==null?Ir((_,E,R)=>{let D=T.runKernel(vo,C,S);return R([E,_,D]),f&&(D=W(D,[D.shape[1],D.shape[2],D.shape[3]])),{value:D,gradFunc:b}})(d,m):Ir((_,E,R,D)=>{let P=T.runKernel(vo,C,S);return D([E,_,P,R]),f&&(P=W(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:b}})(d,m,g)}var rN=N({fusedDepthwiseConv2d_:X6});function Y6({a:r,b:t,transposeA:e=!1,transposeB:o=!1,bias:n,activation:s="linear",preluActivationWeights:a,leakyreluAlpha:i=.2}){if(Yu(T.state.gradientDepth,s)===!1){let O=Ze(r,t,e,o);return n!=null&&(O=Ce(O,n)),Xu(O,s,a,i)}let p=v(r,"a","fused matMul"),u=v(t,"b","fused matMul");[p,u]=Oe(p,u);let c=e?p.shape[p.rank-2]:p.shape[p.rank-1],l=o?u.shape[u.rank-1]:u.shape[u.rank-2],m=e?p.shape[p.rank-1]:p.shape[p.rank-2],d=o?u.shape[u.rank-2]:u.shape[u.rank-1],f=p.shape.slice(0,-2),h=u.shape.slice(0,-2),g=He(f),x=He(h);$(c===l,()=>`Error in fused matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${p.shape} and ${u.shape} and transposeA=${e} and transposeB=${o} must match.`);let C=rt(p.shape.slice(0,-2),u.shape.slice(0,-2)).concat([m,d]),S=e?W(p,[g,c,m]):W(p,[g,m,c]),k=o?W(u,[x,d,l]):W(u,[x,l,d]),_;n!=null&&(_=v(n,"bias","fused matMul"),[_]=Oe(_,p),rt(C,_.shape));let E;a!=null&&(E=v(a,"prelu weights","fused matMul"));let R=(O,M)=>{let[L,B,z,U]=M,j=qu(W(O,z.shape),z,s),q,Y;if(!e&&!o?(q=Ze(j,B,!1,!0),Y=Ze(L,j,!0,!1)):!e&&o?(q=Ze(j,B,!1,!1),Y=Ze(j,L,!0,!1)):e&&!o?(q=Ze(B,j,!1,!0),Y=Ze(L,j,!1,!1)):(q=Ze(B,j,!0,!0),Y=Ze(j,L,!0,!0)),n!=null){let J=ju(U,j);return[q,Y,J]}else return[q,Y]},D={a:S,b:k,bias:_,preluActivationWeights:E},P={transposeA:e,transposeB:o,activation:s,leakyreluAlpha:i};return n==null?Ir((M,L,B)=>{let z=T.runKernel(So,D,P);return B([M,L,z]),{value:W(z,C),gradFunc:R}})(S,k):Ir((M,L,B,z)=>{let U=T.runKernel(So,D,P);return z([M,L,U,B]),{value:W(U,C),gradFunc:R}})(S,k,_)}var oN=N({fusedMatMul_:Y6});function Q6(r){return _l(r,.54,.46)}var nN=N({hammingWindow_:Q6});function Z6(r){return _l(r,.5,.5)}var Yd=N({hannWindow_:Z6});function J6(r,t,e,o=!1,n=0){let s=0,a=[];for(;s+t<=r.size;)a.push(Xe(r,s,t)),s+=e;if(o)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&i.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${i.shape}.`),$(p.rank===1&&p.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${i.shape}.`),$(o.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${o.length}.`),$(o[0]>=1&&o[1]>=1,()=>`cropSize must be atleast [1,1], but was ${o}`),$(n==="bilinear"||n==="nearest",()=>`method must be bilinear or nearest, but was ${n}`);let c={image:a,boxes:i,boxInd:p},l={method:n,extrapolationValue:s,cropSize:o};return T.runKernel(cn,c,l)}var aN=N({cropAndResize_:tj});function rj(r){let t=v(r,"image","flipLeftRight","float32");$(t.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`);let e={image:t};return T.runKernel(Cn,e,{})}var iN=N({flipLeftRight_:rj});function oj(r){let t=v(r,"image","grayscaleToRGB"),e=t.rank-1,o=t.shape[e];$(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),$(o===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${o}.`);let n=new Array(t.rank);return n.fill(1,0,e),n[e]=3,au(t,n)}var uN=N({grayscaleToRGB_:oj});function nj(r){let t=v(r,"image","RGBToGrayscale"),e=t.rank-1,o=t.shape[e];$(t.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${t.rank}.`),$(o===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${o}.`);let n=t.dtype,s=We(t,"float32"),a=Jt([.2989,.587,.114]),i;switch(t.rank){case 2:i=su("ij,j->i",s,a);break;case 3:i=su("ijk,k->ij",s,a);break;case 4:i=su("ijkl,l->ijk",s,a);break;case 5:i=su("ijklm,m->ijkl",s,a);break;case 6:i=su("ijklmn,n->ijklm",s,a);break;default:throw new Error("Not a valid tensor rank.")}return i=Ms(i,-1),We(i,n)}var pN=N({rgbToGrayscale_:nj});function sj(r,t,e=0,o=.5){let n=v(r,"image","rotateWithOffset","float32");$(n.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${n.rank}.`);let s={image:n},a={radians:t,fillValue:e,center:o};return T.runKernel(Ds,s,a)}var cN=N({rotateWithOffset_:sj});function $o(r,t,e,o,n,s){o==null&&(o=.5),n==null&&(n=Number.NEGATIVE_INFINITY),s==null&&(s=0);let a=r.shape[0];return e=Math.min(e,a),$(0<=o&&o<=1,()=>`iouThreshold must be in [0, 1], but was '${o}'`),$(r.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${r.rank}'`),$(r.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${r.shape[1]}`),$(t.rank===1,()=>"scores must be a 1D tensor"),$(t.shape[0]===a,()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${t.shape[0]}`),$(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:e,iouThreshold:o,scoreThreshold:n,softNmsSigma:s}}function aj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,"boxes","nonMaxSuppression","float32"),a=v(t,"scores","nonMaxSuppression","float32"),i=$o(s,a,e,o,n);e=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p={maxOutputSize:e,iouThreshold:o,scoreThreshold:n};return T.runKernel(Qn,{boxes:s,scores:a},p)}var lN=N({nonMaxSuppression_:aj});function mN(r,t,e){let o=ij(r,t,e),n=o<0?-(o+1):o;r.splice(n,0,t)}function ij(r,t,e){return pj(r,t,e||uj)}function uj(r,t){return r>t?1:r>>1);let i=e(t,r[s]);i>0?o=s+1:(n=s,a=!i)}return a?o:-o-1}function Zd(r,t,e,o,n){return Jw(r,t,e,o,n,0)}function Jd(r,t,e,o,n,s){return Jw(r,t,e,o,n,0,!1,s,!0)}function ef(r,t,e,o,n,s){return Jw(r,t,e,o,n,s,!0)}function Jw(r,t,e,o,n,s,a=!1,i=!1,p=!1){let u=[];for(let g=0;gn&&u.push({score:t[g],boxIndex:g,suppressBeginIndex:0});u.sort(dN);let c=s>0?-.5/s:0,l=[],m=[];for(;l.length0;){let g=u.pop(),{score:x,boxIndex:b,suppressBeginIndex:C}=g;if(x=C;--k){let _=cj(r,b,l[k]);if(_>=o){S=!0;break}if(g.score=g.score*lj(o,c,_),g.score<=n)break}g.suppressBeginIndex=l.length,S||(g.score===x?(l.push(b),m.push(g.score)):g.score>n&&mN(u,g,dN))}let d=l.length,f=e-d;i&&f>0&&(l.push(...new Array(f).fill(0)),m.push(...new Array(f).fill(0)));let h={selectedIndices:l};return a&&(h.selectedScores=m),p&&(h.validOutputs=d),h}function cj(r,t,e){let o=r.subarray(t*4,t*4+4),n=r.subarray(e*4,e*4+4),s=Math.min(o[0],o[2]),a=Math.min(o[1],o[3]),i=Math.max(o[0],o[2]),p=Math.max(o[1],o[3]),u=Math.min(n[0],n[2]),c=Math.min(n[1],n[3]),l=Math.max(n[0],n[2]),m=Math.max(n[1],n[3]),d=(i-s)*(p-a),f=(l-u)*(m-c);if(d<=0||f<=0)return 0;let h=Math.max(s,u),g=Math.max(a,c),x=Math.min(i,l),b=Math.min(p,m),C=Math.max(x-h,0)*Math.max(b-g,0);return C/(d+f-C)}function lj(r,t,e){let o=Math.exp(t*e*e);return e<=r?o:0}function dN(r,t){return r.score-t.score||r.score===t.score&&t.boxIndex-r.boxIndex}async function mj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,"boxes","nonMaxSuppressionAsync"),a=v(t,"scores","nonMaxSuppressionAsync"),i=$o(s,a,e,o,n);e=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p=await Promise.all([s.data(),a.data()]),u=p[0],c=p[1],{selectedIndices:l}=Zd(u,c,e,o,n);return s!==r&&s.dispose(),a!==t&&a.dispose(),Jt(l,"int32")}var fN=mj;function dj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,"boxes","nonMaxSuppression"),i=v(t,"scores","nonMaxSuppression"),p=$o(a,i,e,o,n,s);e=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u={boxes:a,scores:i},c={maxOutputSize:e,iouThreshold:o,scoreThreshold:n,softNmsSigma:s},l=T.runKernel(Zn,u,c);return{selectedIndices:l[0],selectedScores:l[1]}}var hN=N({nonMaxSuppressionWithScore_:dj});async function fj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,"boxes","nonMaxSuppressionAsync"),i=v(t,"scores","nonMaxSuppressionAsync"),p=$o(a,i,e,o,n,s);e=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u=await Promise.all([a.data(),i.data()]),c=u[0],l=u[1],{selectedIndices:m,selectedScores:d}=ef(c,l,e,o,n,s);return a!==r&&a.dispose(),i!==t&&i.dispose(),{selectedIndices:Jt(m,"int32"),selectedScores:Jt(d)}}var gN=fj;function hj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,"boxes","nonMaxSuppression"),i=v(t,"scores","nonMaxSuppression"),p=$o(a,i,e,o,n,null),u=p.maxOutputSize,c=p.iouThreshold,l=p.scoreThreshold,m={boxes:a,scores:i},d={maxOutputSize:u,iouThreshold:c,scoreThreshold:l,padToMaxOutputSize:s},f=T.runKernel(Qa,m,d);return{selectedIndices:f[0],validOutputs:f[1]}}var xN=N({nonMaxSuppressionPadded_:hj});async function gj(r,t,e,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,"boxes","nonMaxSuppressionAsync"),i=v(t,"scores","nonMaxSuppressionAsync"),p=$o(a,i,e,o,n,null),u=p.maxOutputSize,c=p.iouThreshold,l=p.scoreThreshold,[m,d]=await Promise.all([a.data(),i.data()]),{selectedIndices:f,validOutputs:h}=Jd(m,d,u,c,l,s);return a!==r&&a.dispose(),i!==t&&i.dispose(),{selectedIndices:Jt(f,"int32"),validOutputs:ke(h,"int32")}}var yN=gj;function xj(r,t,e=!1,o=!1){let n=v(r,"images","resizeBilinear");$(n.rank===3||n.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${n.rank}.`),$(t.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),$(o===!1||e===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=t,i={images:s},p={alignCorners:e,halfPixelCenters:o,size:t},u=T.runKernel(is,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var bN=N({resizeBilinear_:xj});function yj(r,t,e=!1,o=!1){let n=v(r,"images","resizeNearestNeighbor");$(n.rank===3||n.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${n.rank}.`),$(t.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),$(n.dtype==="float32"||n.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),$(o===!1||e===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=t,i={images:s},p={alignCorners:e,halfPixelCenters:o,size:t},u=T.runKernel(as,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var CN=N({resizeNearestNeighbor_:yj});function bj(r,t="binary",e=!1,o=.5){let n=v(r,"image","threshold"),s=.2989,a=.587,i=.114,p=n.shape[0]*n.shape[1],u=se(Jt([o]),255),c,l,m,d;if($(n.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${n.rank}.`),$(n.shape[2]===3||n.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${n.shape[2]}.`),$(n.dtype==="int32"||n.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${n.dtype}.`),$(t==="otsu"||t==="binary",()=>`Method must be binary or otsu, but was ${t}`),n.shape[2]===3){[c,l,m]=ci(n,[1,1,1],-1);let g=se(c,s),x=se(l,a),b=se(m,i);d=Ce(Ce(g,x),b)}else d=r;if(t==="otsu"){let g=fd(We(Ud(d),"int32"),ar([]),256);u=Cj(g,p)}let f=e?nc(d,u):zu(d,u);return We(se(f,255),"int32")}function Cj(r,t){let e=Jt([-1]),o=Jt([0]),n=Jt([0]),s,a,i,p,u,c;for(let l=0;l`Error in transform: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&(i.shape[0]===a.shape[0]||i.shape[0]===1)&&i.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),$(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let p={image:a,transforms:i},u={interpolation:e,fillMode:o,fillValue:n,outputShape:s};return T.runKernel(Rs,p,u)}var SN=N({transform_:wj});function Sj(r,t,e){let o=v(r,"a","bandPart");$(o.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${o.rank}.`);let n=o.shape,[s,a]=o.shape.slice(-2),i,p;typeof t=="number"?($(t%1===0,()=>`bandPart(): numLower must be an integer, got ${t}.`),$(t<=s,()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${s}).`),i=v(t<0?s:t,"numLower","bandPart")):($(t.dtype==="int32",()=>"bandPart(): numLower's dtype must be an int32."),i=co(kl(t,0),s,Uu(t,s))),typeof e=="number"?($(e%1===0,()=>`bandPart(): numUpper must be an integer, got ${e}.`),$(e<=a,()=>`bandPart(): numUpper (${e}) must not be greater than the number of columns (${a}).`),p=v(e<0?a:e,"numUpper","bandPart")):($(e.dtype==="int32",()=>"bandPart(): numUpper's dtype must be an int32."),p=co(kl(e,0),a,Uu(e,a)));let u=W(uu(0,s,1,"int32"),[-1,1]),c=uu(0,a,1,"int32"),l=Te(u,c),m=Vu(nc(l,i),Sd(l,pr(p))),d=Ur([s,a],o.dtype);return W(vr(mo(W(o,[-1,s,a])).map(f=>co(m,f,d))),n)}var IN=N({bandPart_:Sj});function Ij(r){let t;if(Array.isArray(r)){t=!1,$(r!=null&&r.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let n=r[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${r[s].shape[0]} vs. ${n})`)}else t=!0,r=ci(r,r.shape[0],0).map(n=>uc(n,[0]));$(r.length<=r[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${r.length}) exceeds number of dimensions (${r[0].shape[0]}).`);let e=[],o=r;for(let n=0;n{let s=o[n];if(n>0)for(let a=0;a=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${r.rank}`),r.rank===2)return kN(r,t);{let e=r.shape.slice(0,r.shape.length-2).reduce((p,u)=>p*u),o=mo(W(r,[e,r.shape[r.shape.length-2],r.shape[r.shape.length-1]]),0),n=[],s=[];o.forEach(p=>{let[u,c]=kN(p,t);n.push(u),s.push(c)});let a=W(vr(n,0),r.shape),i=W(vr(s,0),r.shape);return[a,i]}}function kN(r,t=!1){return T.tidy(()=>{$(r.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${r.shape.length}D Tensor.`);let e=r.shape[0],o=r.shape[1],n=bd(e),s=Wr(r),a=cu([[1]],[1,1]),i=Wr(a),p=e>=o?o:e;for(let u=0;u{let d=Xe(s,[u,u],[e-u,1]),f=Bu(d),h=Xe(s,[u,u],[1,1]),g=co(zu(h,0),cu([[-1]]),cu([[1]])),x=Te(h,se(g,f)),b=je(d,x);b.shape[0]===1?i=Wr(a):i=yt([a,Xe(b,[1,0],[b.shape[0]-1,b.shape[1]])],0);let C=pr(je(Ze(g,x),f)),S=Xe(s,[u,0],[e-u,o]),k=se(C,i),_=cc(i);if(u===0)s=Te(S,Ze(k,Ze(_,S)));else{let D=Te(S,Ze(k,Ze(_,S)));s=yt([Xe(s,[0,0],[u,o]),D],0)}let E=cc(k),R=Xe(n,[0,u],[e,n.shape[1]-u]);if(u===0)n=Te(R,Ze(Ze(R,i),E));else{let D=Te(R,Ze(Ze(R,i),E));n=yt([Xe(n,[0,0],[e,u]),D],1)}return[i,s,n]}),Ot([c,l,m])}return!t&&e>o&&(n=Xe(n,[0,0],[e,o]),s=Xe(s,[0,0],[o,o])),[n,s]})}var NN=N({qr_:vj});var Et;(function(r){r[r.NONE=0]="NONE",r[r.MEAN=1]="MEAN",r[r.SUM=2]="SUM",r[r.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(Et||(Et={}));function kj(r,t,e=Et.SUM_BY_NONZERO_WEIGHTS){let o=v(r,"losses","computeWeightedLoss"),n=null;t!=null&&(n=v(t,"weights","computeWeightedLoss"));let s=n==null?o:se(o,n);if(e===Et.NONE)return s;if(e===Et.SUM)return ot(s);if(e===Et.MEAN){if(n==null)return Wu(s);{let a=o.size/n.size,i=je(ot(s),ot(n));return a>1?je(i,ke(a)):i}}if(e===Et.SUM_BY_NONZERO_WEIGHTS){if(n==null)return je(ot(s),ke(o.size));{let a=se(n,Da(o.shape)),i=We(ot(Ad(a,ke(0))),"float32");return je(ot(s),i)}}throw Error(`Unknown reduction: ${e}`)}var cr=N({computeWeightedLoss_:kj});function Nj(r,t,e,o=Et.SUM_BY_NONZERO_WEIGHTS){let n=v(r,"labels","absoluteDifference"),s=v(t,"predictions","absoluteDifference"),a=null;e!=null&&(a=v(e,"weights","absoluteDifference")),xt(n.shape,s.shape,"Error in absoluteDifference: ");let i=Qt(Te(n,s));return cr(i,a,o)}var TN=N({absoluteDifference_:Nj});function Tj(r,t,e,o,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"labels","cosineDistance"),a=v(t,"predictions","cosineDistance"),i=null;o!=null&&(i=v(o,"weights","cosineDistance")),xt(s.shape,a.shape,"Error in cosineDistance: ");let p=ke(1),u=Te(p,ot(se(s,a),e,!0));return cr(u,i,n)}var _N=N({cosineDistance_:Tj});function _j(r,t,e,o=Et.SUM_BY_NONZERO_WEIGHTS){let n=v(r,"labels","hingeLoss"),s=v(t,"predictions","hingeLoss"),a=null;e!=null&&(a=v(e,"weights","hingeLoss")),xt(n.shape,s.shape,"Error in hingeLoss: ");let i=ke(1);n=Te(se(ke(2),n),i);let p=pu(Te(i,se(n,s)));return cr(p,a,o)}var $N=N({hingeLoss_:_j});function $j(r,t,e,o=1,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"labels","huberLoss"),a=v(t,"predictions","huberLoss"),i=null;e!=null&&(i=v(e,"weights","huberLoss")),xt(s.shape,a.shape,"Error in huberLoss: ");let p=ke(o),u=Qt(Te(a,s)),c=Uu(u,p),l=Te(u,c),m=Ce(se(ke(.5),Zt(c)),se(p,l));return cr(m,i,n)}var EN=N({huberLoss_:$j});function Ej(r,t,e,o=1e-7,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"labels","logLoss"),a=v(t,"predictions","logLoss"),i=null;e!=null&&(i=v(e,"weights","logLoss")),xt(s.shape,a.shape,"Error in logLoss: ");let p=ke(1),u=ke(o),c=pr(se(s,ui(Ce(a,u)))),l=se(Te(p,s),ui(Ce(Te(p,a),u))),m=Te(c,l);return cr(m,i,n)}var RN=N({logLoss_:Ej});function Rj(r,t,e,o=Et.SUM_BY_NONZERO_WEIGHTS){let n=v(r,"labels","meanSquaredError"),s=v(t,"predictions","meanSquaredError"),a=null;e!=null&&(a=v(e,"weights","meanSquaredError")),xt(n.shape,s.shape,"Error in meanSquaredError: ");let i=Hd(n,s);return cr(i,a,o)}var DN=N({meanSquaredError_:Rj});function Dj(r,t){let e=v(r,"labels","sigmoidCrossEntropyWithLogits"),o=v(t,"logits","sigmoidCrossEntropyWithLogits");xt(e.shape,o.shape,"Error in sigmoidCrossEntropyWithLogits: ");let n=pu(o),s=se(o,e),a=vd(_o(pr(Qt(o))));return Ce(Te(n,s),a)}function Aj(r,t,e,o=0,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"multiClassLabels","sigmoidCrossEntropy"),a=v(t,"logits","sigmoidCrossEntropy"),i=null;if(e!=null&&(i=v(e,"weights","sigmoidCrossEntropy")),xt(s.shape,a.shape,"Error in sigmoidCrossEntropy: "),o>0){let u=ke(o),c=ke(1),l=ke(.5);s=Ce(se(s,Te(c,u)),se(l,u))}let p=Dj(s,a);return cr(p,i,n)}var AN=N({sigmoidCrossEntropy_:Aj});function Fj(r,t,e=-1){if(e===-1&&(e=t.rank-1),e!==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 ${e}`);return Ir((n,s,a)=>{let p=Td(s,[e],!0),u=Te(We(s,"float32"),p);a([n,u]);let c=pr(se(u,n));return{value:ot(c,[e]),gradFunc:(d,f)=>{let[h,g]=f,x=ai(d.shape,[e]);return[se(W(d,x),Te(We(h,"float32"),_o(g))),se(W(d,x),Te(_o(g),We(h,"float32")))]}}})(r,t)}function Pj(r,t,e,o=0,n=Et.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"onehotLabels","softmaxCrossEntropy"),a=v(t,"logits","softmaxCrossEntropy"),i=null;if(e!=null&&(i=v(e,"weights","softmaxCrossEntropy")),xt(s.shape,a.shape,"Error in softmaxCrossEntropy: "),o>0){let u=ke(o),c=ke(1),l=ke(s.shape[1]);s=Ce(se(s,Te(c,u)),je(u,l))}let p=Fj(s,a);return cr(p,i,n)}var FN=N({softmaxCrossEntropy_:Pj});function Oj(r,t,e,o){let n=v(r,"indices","sparseFillEmptyRows","int32"),s=v(t,"values","sparseFillEmptyRows"),a=v(e,"denseShape","sparseFillEmptyRows","int32"),i=v(o,"defaultValue","sparseFillEmptyRows",s.dtype);if(n.rank!==2)throw new Error(`Indices should be Tensor2D but received shape - ${n.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(a.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(i.rank!==0)throw new Error(`Default value should be a scalar but received shape ${i.shape}`);let p={indices:n,values:s,denseShape:a,defaultValue:i},u=T.runKernel(Hi,p);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}var PN=N({sparseFillEmptyRows_:Oj});function Mj(r,t,e){let o=v(r,"inputIndices","sparseReshape","int32"),n=v(t,"inputShape","sparseReshape","int32"),s=v(e,"newShape","sparseReshape","int32");if(o.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape - ${o.shape}`);if(n.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${n.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let a={inputIndices:o,inputShape:n,newShape:s},i=T.runKernel(ei,a);return{outputIndices:i[0],outputShape:i[1]}}var ON=N({sparseReshape_:Mj});function Lj(r,t,e){let o=v(r,"data","sparseSegmentMean"),n=v(t,"indices","sparseSegmentMean","int32"),s=v(e,"segmentIds","sparseSegmentMean","int32");if(o.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape +Expected: ${s}.`)}typeof expect!="undefined"&&expect().nothing()}function sj(r,e){r().then(()=>e.fail(),()=>e()),typeof expect!="undefined"&&expect().nothing()}function aj(r,e){let t=typeof e=="string"||typeof e=="number"||typeof e=="boolean"?[e]:e;return dn(r)||dn(r[0])||dn(e)||dn(e[0])?uS(r,t,(o,n)=>o==n):uS(r,e,(o,n)=>pS(o,n,0))}function nN(r,e,t){if(t==null&&(t=jd()),!pS(r,e,t))throw new Error(`Numbers differ: actual === ${r}, expected === ${e}`);typeof expect!="undefined"&&expect().nothing()}function pS(r,e,t){return!isFinite(r)&&!isFinite(e)?!0:!(isNaN(r)||isNaN(e)||Math.abs(r-e)>t)}function ij(r,e,t){for(let o=0;ot)throw new Error(`Value out of range:${r[o]} low: ${e}, high: ${t}`)}function uj(r,e){let t=new Float32Array(r),o=new Float32Array(e);if(t.length!==o.length)throw new Error(`Expected ArrayBuffer to be of length ${o.length}, but it was ${t.length}`);for(let n=0;n{e.addEventListener("loadeddata",o=>t(e)),e.load()})}async function lj(r){await r.play(),"requestVideoFrameCallback"in r&&await new Promise(e=>{r.requestVideoFrameCallback(e)})}var Ju=class{constructor(e,t,o,n,s){this.mean=e,this.stdDev=t,this.dtype=o,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);let a=s||Math.random();this.random=Qd.alea(a.toString())}nextValue(){if(!isNaN(this.nextVal)){let n=this.nextVal;return this.nextVal=NaN,n}let e,t,o=!1;for(;!o;){let n,s,a;do n=2*this.random()-1,s=2*this.random()-1,a=n*n+s*s;while(a>=1||a===0);let i=Math.sqrt(-2*Math.log(a)/a);e=this.mean+this.stdDev*n*i,t=this.mean+this.stdDev*s*i,(!this.truncated||this.isValidTruncated(e))&&(o=!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}},Xd=class{constructor(e,t,o,n){this.alpha=e,this.beta=1/t,this.dtype=o;let s=n||Math.random();this.randu=Qd.alea(s.toString()),this.randn=new Ju(0,1,o,!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,o,n,s,a;for(;;){do n=this.randn.nextValue(),a=1+this.c*n;while(a<=0);if(a*=a*a,e=n*n,t=1-.331*e*e,o=.5*e+this.d*(1-a+Math.log(a)),s=this.randu(),sthis.dtype==null||this.dtype==="float32",this.min=e,this.range=t-e,this.dtype=o,n==null&&(n=Math.random()),typeof n=="number"&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=Qd.alea(n)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}};function cj(r,e,t=1,o="float32",n){if(St(r),t==null&&(t=1),o==null&&(o="float32"),o!=="float32"&&o!=="int32")throw new Error(`Unsupported data type ${o}`);let s=new Xd(e,t,o,n),a=ie(r,o);for(let i=0;i`Error in reverse1D: x must be rank 1 but got rank ${e.rank}.`),Bo(e,0)}var cN=N({reverse1d_:wj});function Sj(r,e){let t=v(r,"x","reverse");return $(t.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${t.rank}.`),Bo(t,e)}var mN=N({reverse2d_:Sj});function Ij(r,e){let t=v(r,"x","reverse");return $(t.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${t.rank}.`),Bo(t,e)}var dN=N({reverse3d_:Ij});function vj(r,e){let t=v(r,"x","reverse");return $(t.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${t.rank}.`),Bo(t,e)}var fN=N({reverse4d_:vj});function kj(r){let t={x:v(r,"x","round")};return _.runKernel(Is,t)}var ef=N({round_:kj});function Nj(r){let t={x:v(r,"x","rsqrt","float32")};return _.runKernel(Do,t)}var hN=N({rsqrt_:Nj});function Tj(r){let t={x:v(r,"x","selu")};return _.runKernel(Ts,t)}var gN=N({selu_:Tj});function _j(r,e,t,o,n,s=[1,1],a="NHWC"){let i=v(r,"x","separableConv2d"),p=v(e,"depthwiseFilter","separableConv2d"),u=v(t,"pointwiseFilter","separableConv2d"),l=i,c=!1;if(i.rank===3&&(c=!0,l=W(i,[1,i.shape[0],i.shape[1],i.shape[2]])),a==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");$(l.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${l.rank}.`),$(p.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${p.rank}.`),$(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${p.rank}.`),$(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),$(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);let m=p.shape[2],d=p.shape[3];$(u.shape[2]===m*d,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${m*d}, but got ${u.shape[2]}.`);let f=cl(l,p,o,n,a,s),g=du(f,u,1,"valid",a);return c?W(g,[g.shape[1],g.shape[2],g.shape[3]]):g}var xN=N({separableConv2d_:_j});async function Ej(r,e){let t=v(r,"x","setdiff1d"),o=v(e,"y","setdiff1d");$(t.dtype===o.dtype,()=>`x and y should have the same dtype, but got x (${t.dtype}) and y (${o.dtype}).`),$(t.rank===1,()=>`x should be 1D tensor, but got x (${t.shape}).`),$(o.rank===1,()=>`y should be 1D tensor, but got y (${o.shape}).`);let n=await t.data(),s=await o.data(),a=new Set(s),i=0;for(let l=0;l`slice1d expects a rank-1 tensor, but got a rank-${o.rank} tensor`),Ye(o,[e],[t])}var SN=N({slice1d_:Aj});function Fj(r,e,t){let o=v(r,"x","slice2d");return $(o.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${o.rank} tensor`),Ye(o,e,t)}var IN=N({slice2d_:Fj});function Pj(r,e,t){let o=v(r,"x","slice3d");return $(o.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${o.rank} tensor`),Ye(o,e,t)}var vN=N({slice3d_:Pj});function Oj(r,e,t){let o=v(r,"x","slice4d");return $(o.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${o.rank} tensor`),Ye(o,e,t)}var kN=N({slice4d_:Oj});function Mj(r,e=-1){let t=v(r,"logits","softmax","float32");if(e===-1&&(e=t.rank-1),e!==t.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and dim was ${e}`);let o={logits:t},n={dim:e};return _.runKernel(Fs,o,n)}var NN=N({softmax_:Mj});function Lj(r){$(r.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${r.dtype}.`);let e={input:r};return _.runKernel(Xi,e)}var fl=N({fft_:Lj});function Bj(r){$(r.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${r.dtype}.`);let e={input:r};return _.runKernel(Yi,e)}var ep=N({ifft_:Bj});function zj(r){let e=r.shape[r.shape.length-1],t=r.size/e,o;if(e<=2){let n=W(r,[t,e]);o=ep(n)}else{let n=[t,2*(e-1)],s=W(bi(r),[t,e]),a=W(gu(r),[t,e]),i=Bo(Ye(s,[0,1],[t,e-2]),1),p=se(Bo(Ye(a,[0,1],[t,e-2]),1),ke(-1)),u=bt([s,i],1),l=bt([a,p],1),c=W(Ar(u,l),[n[0],n[1]]);o=ep(c)}if(o=bi(o),r.rank===3&&r.shape[0]!==0){let n=o,s=r.shape[0];o=W(o,[s,o.shape[0]/s,o.shape[1]]),n.dispose()}return o}var tf=N({irfft_:zj});function Vj(r,e,t=0){let n={x:v(r,"x","split")},s={numOrSizeSplits:e,axis:t};return _.runKernel(Ia,n,s)}var Ci=N({split_:Vj});function Wj(r,e){$(r.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${r.dtype}`);let t=r.shape[r.shape.length-1],o=r.size/t,n;if(e!=null&&e0),h=r.shape.map(g=>g);h[r.shape.length-1]=e,n=Ye(r,f,h),t=e}else if(e!=null&&e>t){let f=r.shape.map(h=>h);f[r.shape.length-1]=e-t,n=bt([r,Yr(f)],r.shape.length-1),t=e}else n=r;let s=Kt(n),a=W(Ar(n,s),[o,t]),i=fl(a),p=Math.floor(t/2)+1,u=bi(i),l=gu(i),c=Ci(u,[p,t-p],u.shape.length-1),m=Ci(l,[p,t-p],l.shape.length-1),d=n.shape.slice();return d[n.shape.length-1]=p,W(Ar(c[0],m[0]),d)}var hl=N({rfft_:Wj});function Uj(r,e){let t=v(r,"a","squaredDifference"),o=v(e,"b","squaredDifference");[t,o]=Oe(t,o),rt(t.shape,o.shape);let n={a:t,b:o},s={};return _.runKernel(Po,n,s)}var rf=N({squaredDifference_:Uj});function Gj(r,e){let t=v(r,"x","squeeze","string_or_numeric");return W(t,mw(t.shape,e).newShape)}var gl=N({squeeze_:Gj});function Hj(r,e=0){let t=di(r,"tensors","stack","string_or_numeric");$(t.length>=1,()=>"Pass at least one tensor to tf.stack"),t.length>0&&$(e<=t[0].rank,()=>"Axis must be <= rank of the tensor");let o=t,n={axis:e};return _.runKernel(ya,o,n)}var Tr=N({stack_:Hj});function Kj(r,e=0){let o={x:v(r,"x","step")},n={alpha:e};return _.runKernel(Ko,o,n)}var of=N({step_:Kj});function qj(r,e,t,o,n=0,s=0,a=0,i=0,p=0){let l={x:v(r,"x","stridedSlice","string_or_numeric")},c={begin:e,end:t,strides:o,beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};return _.runKernel(Os,l,c)}var TN=N({stridedSlice_:qj});function jj(r){let t={x:v(r,"x","tan","float32")};return _.runKernel(Ms,t)}var _N=N({tan_:jj});function rr(r,e){fo(r);let t=ur(r,e);if(t.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return vr(r,null,t,e)}function bu(r,e,t){if(fo(r),e!=null&&e.length!==2)throw new Error("tensor2d() requires shape to have two numbers");let o=ur(r,t);if(o.length!==2&&o.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(o.length===1&&e==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return vr(r,e,o,t)}function nf(r,e,t){if(fo(r),e!=null&&e.length!==3)throw new Error("tensor3d() requires shape to have three numbers");let o=ur(r,t);if(o.length!==3&&o.length!==1)throw new Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(o.length===1&&e==null)throw new Error("tensor3d() requires shape to be provided when `values` are a flat array");return vr(r,e,o,t)}function EN(r,e,t){if(fo(r),e!=null&&e.length!==4)throw new Error("tensor4d() requires shape to have four numbers");let o=ur(r,t);if(o.length!==4&&o.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(o.length===1&&e==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return vr(r,e,o,t)}function $N(r,e,t){if(fo(r),e!=null&&e.length!==5)throw new Error("tensor5d() requires shape to have five numbers");let o=ur(r,t);if(o.length!==5&&o.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(o.length===1&&e==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return vr(r,e,o,t)}function RN(r,e,t){if(fo(r),e!=null&&e.length!==6)throw new Error("tensor6d() requires shape to have six numbers");let o=ur(r,t);if(o.length!==6&&o.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(o.length===1&&e==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return e=e||o,vr(r,e,o,t)}var Cu={};qe(Cu,{calculateShapes:()=>DN,validateInput:()=>xl,validateUpdateShape:()=>lS});function lS(r,e,t){let o=e.rank>1?e.shape[e.rank-1]:1,n=e.rank>1?e.rank-1:1,s=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${t.shape}, indices.shape: ${e.shape}, shape: ${r}, sliceDim: ${o}, and batchDim: ${n}.`;if(t.rank1?e.shape[o-1]:1,s=t.length,a=1;for(let c=n;c= 0 but got ${e}`);if(e>n)throw new Error(`'k' passed to topk() must be <= the last dimension (${n}) but got ${e}`);let s={x:o},a={k:e,sorted:t},[i,p]=_.runKernel(Bs,s,a);return{values:i,indices:p}}var FN=N({topk_:Yj});function Qj(r,e=0,t=1,o,n){if(St(r),o!=null&&o==="bool")throw new Error("Unsupported data type $ { dtype }");let s=new Ju(e,t,o,!0,n),a=ie(r,o);for(let i=0;i0,()=>"The input tensor must be at least 1D");let o={x:t},n={axis:e},[s,a]=_.runKernel(nu,o,n);return{values:s,indices:a}}var ON=N({unique_:Zj});function Jj(r,e,t){let o=v(r,"x","unsortedSegmentSum"),n=v(e,"segmentIds","unsortedSegmentSum","int32");$(Ja(t),()=>"numSegments must be of dtype int");let s={x:o,segmentIds:n},a={numSegments:t};return _.runKernel(su,s,a)}var MN=N({unsortedSegmentSum_:Jj});function eX(r,e=0){let t=v(r,"x","unstack","string_or_numeric");$(e>=-t.shape.length&&e`Axis = ${e} is not in [-${t.shape.length}, ${t.shape.length})`);let o={value:t},n={axis:e};return _.runKernel(Ta,o,n)}var zo=N({unstack_:eX});function LN(r,e){return Pc(r,e,"right")}function BN(r,e=!0,t,o){return _.makeVariable(r,e,t,o)}function sf(r,e){let t=[];for(let s=0;s0,()=>"mask cannot be scalar"),yt(i.slice(s,s+a),n.shape,"mask's shape must match the first K dimensions of tensor's shape,");let p=1;for(let h=s;hi).reverse()),$(o.rank===e.length,()=>`Error in transpose: rank of input ${o.rank} must match length of perm ${e}.`),e.forEach(a=>{$(a>=0&&a`All entries in 'perm' must be between 0 and ${o.rank-1} but got ${e}`)}),o.rank<=1)return o.clone();let n={x:o},s={perm:e};return o.dtype==="complex64"?De(()=>{let a=bi(o),i=gu(o);return a=_.runKernel(Kr,{x:a},s),i=_.runKernel(Kr,{x:i},s),t&&(i=mr(i)),Ar(a,i)}):_.runKernel(Kr,n,s)}var yl=N({transpose_:nX});function sX(r,e,t,o,n=!0){let s=v(r,"v","movingAverage"),a=v(e,"x","movingAverage"),i=v(t,"decay","movingAverage");Fw(s,a),$(Sr(s.shape,a.shape),()=>"Shape mismatch in v and x");let p=ke(1),u=Te(p,i),l=se(Te(a,s),u);if(n){$(o!=null,()=>"When using zeroDebias: true, step is required.");let c=v(o,"step","movingAverage");l=Xe(l,Te(p,xi(i,c)))}return Ce(s,l)}var aX=N({movingAverage_:sX});function iX(r,e,t){St(t);let o=v(r,"indices","scatterND","int32"),n=v(e,"updates","scatterND");xl(n,o,t);let s={indices:o,updates:n},a={shape:t};return _.runKernel(vs,s,a)}var uX=N({scatterND_:iX});function zN(r,e,t,o){if(r.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${r.dtype}.`);if(r.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${r.shape}.`);let n=r.rank>0?r.shape[0]:1,s=r.rank>1?r.shape[1]:1;if(t.length!==s)throw new Error(`outputShape has incorrect number of elements:, ${t.length}, should be: ${s}.`);let a=e.size;if(!(e.rank===0||e.rank===1&&a===n))throw new Error(`sparseValues has incorrect shape ${e.shape}, should be [] or [${n}]`);if(e.dtype!==o.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}function lX(r,e,t,o=0){St(t);let n=v(r,"sparseIndices","sparseToDense","int32"),s=v(e,"sparseValues","sparseToDense","string_or_numeric"),a=v(o,"defaultValue","sparseToDense",s.dtype);zN(n,s,t,a);let i={sparseIndices:n,sparseValues:s,defaultValue:a},p={outputShape:t};return _.runKernel(Ps,i,p)}var cX=N({sparseToDense_:lX});function mX(r,e){let t=v(e,"indices","gatherND","int32"),n={params:v(r,"x","gatherND","string_or_numeric"),indices:t};return _.runKernel(Kn,n)}var dX=N({gatherND_:mX});function VN(r,e){if(e==null)return r.shape.slice();if(Sr(r.shape,e))return e;if(r.shape.length===e.length){let t=[];for(let o=0;o`x has to be a floating point tensor since it's going to be scaled, but got a ${n.dtype} tensor instead.`),$(e>=0&&e<1,()=>`rate must be a float in the range [0, 1), but got ${e}.`),e===0)return r instanceof dt?n.clone():n;let s=VN(n,t),a=1-e,i=Xe(Rd(Ce(dl(s,0,1,"float32",o),a)),a);return se(n,i)}var hX=N({dropout_:fX});function cS(r){return Math.floor(Math.pow(2,Math.ceil(Math.log(r)/Math.log(2))))}function Mc(r,e,t){let o=1-r%2,n=new Float32Array(r);for(let s=0;s1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${o.rank}`),$(o.rank-1===n.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${o.rank} and targets rank ${n.rank}`),yt(o.shape.slice(0,o.shape.length-1),n.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let s=o.shape[o.shape.length-1];$(t>0&&t<=s,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${s}), but got ${t}`);let a=await o.data(),i=await n.data(),[p,u]=[a.length/s,s],l=dw("bool",p);for(let c=0;cg.value-h.value),l[c]=0;for(let h=0;hUN,depthwiseConv2d:()=>KN,matMul:()=>qN});function yX(r,e,t,o,n,s="NHWC",a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=e;p.rank===3&&(p=W(e,[1,e.shape[0],e.shape[1],e.shape[2]])),$(i.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${i.shape}.`),$(p.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${p.shape}.`),$(t.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${t}.`);let u=s==="NHWC"?i.shape[3]:i.shape[1],l=s==="NHWC"?p.shape[3]:p.shape[1];$(u===t[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${t[2]}.`),$(l===t[3],()=>`Error in conv2dDerFilter: depth of dy (${l}) must match output depth for filter (${t[3]}).`),zt("conv2dDerFilter",n,a);let c={x:i,dy:p},m={strides:o,pad:n,dataFormat:s,dimRoundingMode:a,filterShape:t};return _.runKernel(Ui,c,m)}var WN=N({conv2DBackpropFilter_:yX});function tp(r,e,t){if(t==null||t==="linear")return r;if(t==="relu")return se(r,of(e));throw new Error(`Cannot compute gradient for fused activation ${t}.`)}function rp(r,e){let t=e,o=Td(r.shape,e.shape);return o.length>0&&(t=ot(t,o)),W(t,r.shape)}function op(r,e,t,o){if(e==="linear")return r;if(e==="relu")return yu(r);if(e==="elu")return Ed(r);if(e==="relu6")return Jd(r);if(e==="prelu")return Kd(r,t);if(e==="leakyrelu")return Fd(r,o);if(e==="sigmoid")return Pa(r);throw new Error(`Unknown fused activation ${e}.`)}var np=(r,e)=>!(r>0)||e==="linear";function bX({x:r,filter:e,strides:t,pad:o,dataFormat:n="NHWC",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p="linear",preluActivationWeights:u,leakyreluAlpha:l}){if(p=p||"linear",np(_.state.gradientDepth,p)===!1){$(n==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${n} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let T=du(r,e,t,o,n,s,a);return i!=null&&(T=Ce(T,i)),op(T,p,u,l)}let c=v(r,"x","conv2d","float32"),m=v(e,"filter","conv2d","float32"),d=c,f=!1;c.rank===3&&(f=!0,d=W(c,[1,c.shape[0],c.shape[1],c.shape[2]])),$(d.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${m.rank}.`),zt("fused conv2d",o,a);let h=n==="NHWC"?d.shape[3]:d.shape[1];$(m.shape[2]===h,()=>`Error in conv2d: depth of input (${h}) must match input depth for filter ${m.shape[2]}.`),$(br(t,s),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`);let g=Ku(d.shape,m.shape,t,s,o,a),x;i!=null&&(x=v(i,"bias","fused conv2d"),[x]=Oe(x,c),n==="NHWC"?rt(g.outShape,x.shape):($(x.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${x.shape.length}.`),$(x.shape.length===0||x.shape[0]===g.outChannels||x.shape[0]===1,()=>`Error in fused conv2d: bias shape (${x.shape}) is not compatible with the number of output channels (${g.outChannels})`)));let b;if(u!=null){let T=u.shape;if($(T.length<=1||T.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${T.length}.`),T.length===1)$(T[0]===1||T[0]===g.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${T}) is not compatible with the number of output channels (${g.outChannels}).`);else if(T.length===3)try{rt(T,g.outShape)}catch(E){let R=`Error in fused conv2d: PReLU activation weights (${T}) is not compatible with the output shape of the conv2d (${g.outShape}).`;throw Error(R)}b=v(u,"prelu weights","fused conv2d")}let w=(T,E)=>{$(n==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${n} but only NHWC is currently supported.`);let[R,D,F,O]=E,M=tp(T,F,p);$(Hu(s),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${s}'`);let L=Nd(D.shape,M,R,t,o),B=WN(D,M,R.shape,t,o),z=[L,B];if(O!=null){let U=rp(O,M);z.push(U)}return z},S={x:d,filter:m,bias:x,preluActivationWeights:b},k={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:l};return i==null?Nr((E,R,D)=>{let F=_.runKernel(jo,S,k);return D([R,E,F]),f&&(F=W(F,[F.shape[1],F.shape[2],F.shape[3]])),{value:F,gradFunc:w}})(d,m):Nr((E,R,D,F)=>{let O=_.runKernel(jo,S,k);return F([R,E,O,D]),f&&(O=W(O,[O.shape[1],O.shape[2],O.shape[3]])),{value:O,gradFunc:w}})(d,m,x)}var UN=N({fusedConv2d_:bX});function CX(r,e,t,o,n,s=[1,1],a){let i=r;r.rank===3&&(i=W(r,[1,r.shape[0],r.shape[1],r.shape[2]]));let p=e;p.rank===3&&(p=W(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let u={x:i,dy:p},l={strides:o,pad:n,dimRoundingMode:a,dilations:s,filterShape:t};return _.runKernel(Gi,u,l)}var GN=N({depthwiseConv2dNativeBackpropFilter_:CX});function wX(r,e,t,o,n,s=[1,1],a){let i=e,p=!1;e.rank===3&&(p=!0,i=W(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let u={dy:i,filter:t},l={strides:o,pad:n,dimRoundingMode:a,dilations:s,inputShape:r},c=_.runKernel(Hi,u,l);return p?W(c,[c.shape[1],c.shape[2],c.shape[3]]):c}var HN=N({depthwiseConv2dNativeBackpropInput_:wX});function SX({x:r,filter:e,strides:t,pad:o,dataFormat:n="NHWC",dilations:s=[1,1],dimRoundingMode:a,bias:i,activation:p="linear",preluActivationWeights:u,leakyreluAlpha:l}){if(np(_.state.gradientDepth,p)===!1){let k=cl(r,e,t,o,n,s,a);return i!=null&&(k=Ce(k,i)),op(k,p,u,l)}let c=v(r,"x","depthwiseConv2d","float32"),m=v(e,"filter","depthwiseConv2d","float32"),d=c,f=!1;c.rank===3&&(f=!0,d=W(c,[1,c.shape[0],c.shape[1],c.shape[2]])),$(d.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${d.rank}.`),$(m.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${m.rank}.`),$(d.shape[3]===m.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${d.shape[3]}) must match the inChannels dimension in filter ${m.shape[2]}.`),s==null&&(s=[1,1]),$(br(t,s),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${t} and dilations '${s}'`),zt("fused depthwiseConv2d",o,a);let h=Ku(d.shape,m.shape,t,s,o,a,!0),g;i!=null&&(g=v(i,"bias","fused conv2d"),[g]=Oe(g,c),rt(h.outShape,g.shape));let x;u!=null&&(x=v(u,"prelu weights","fused depthwiseConv2d"));let b=(k,T)=>{$(Hu(s),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${s}'`);let[E,R,D,F]=T,O=tp(k,D,p),M=HN(R.shape,O,E,t,o,s,a),L=GN(R,O,E.shape,t,o,s,a);if(F!=null){let B=rp(g,O);return[M,L,B]}return[M,L]},w={x:d,filter:m,bias:g,preluActivationWeights:x},S={strides:t,pad:o,dataFormat:n,dilations:s,dimRoundingMode:a,activation:p,leakyreluAlpha:l};return i==null?Nr((T,E,R)=>{let D=_.runKernel(Xo,w,S);return R([E,T,D]),f&&(D=W(D,[D.shape[1],D.shape[2],D.shape[3]])),{value:D,gradFunc:b}})(d,m):Nr((T,E,R,D)=>{let F=_.runKernel(Xo,w,S);return D([E,T,F,R]),f&&(F=W(F,[F.shape[1],F.shape[2],F.shape[3]])),{value:F,gradFunc:b}})(d,m,g)}var KN=N({fusedDepthwiseConv2d_:SX});function IX({a:r,b:e,transposeA:t=!1,transposeB:o=!1,bias:n,activation:s="linear",preluActivationWeights:a,leakyreluAlpha:i=.2}){if(np(_.state.gradientDepth,s)===!1){let O=Je(r,e,t,o);return n!=null&&(O=Ce(O,n)),op(O,s,a,i)}let p=v(r,"a","fused matMul"),u=v(e,"b","fused matMul");[p,u]=Oe(p,u);let l=t?p.shape[p.rank-2]:p.shape[p.rank-1],c=o?u.shape[u.rank-1]:u.shape[u.rank-2],m=t?p.shape[p.rank-1]:p.shape[p.rank-2],d=o?u.shape[u.rank-2]:u.shape[u.rank-1],f=p.shape.slice(0,-2),h=u.shape.slice(0,-2),g=ze(f),x=ze(h);$(l===c,()=>`Error in fused matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${p.shape} and ${u.shape} and transposeA=${t} and transposeB=${o} must match.`);let w=rt(p.shape.slice(0,-2),u.shape.slice(0,-2)).concat([m,d]),S=t?W(p,[g,l,m]):W(p,[g,m,l]),k=o?W(u,[x,d,c]):W(u,[x,c,d]),T;n!=null&&(T=v(n,"bias","fused matMul"),[T]=Oe(T,p),rt(w,T.shape));let E;a!=null&&(E=v(a,"prelu weights","fused matMul"));let R=(O,M)=>{let[L,B,z,U]=M,j=tp(W(O,z.shape),z,s),q,Y;if(!t&&!o?(q=Je(j,B,!1,!0),Y=Je(L,j,!0,!1)):!t&&o?(q=Je(j,B,!1,!1),Y=Je(j,L,!0,!1)):t&&!o?(q=Je(B,j,!1,!0),Y=Je(L,j,!1,!1)):(q=Je(B,j,!0,!0),Y=Je(j,L,!0,!0)),n!=null){let J=rp(U,j);return[q,Y,J]}else return[q,Y]},D={a:S,b:k,bias:T,preluActivationWeights:E},F={transposeA:t,transposeB:o,activation:s,leakyreluAlpha:i};return n==null?Nr((M,L,B)=>{let z=_.runKernel(qo,D,F);return B([M,L,z]),{value:W(z,w),gradFunc:R}})(S,k):Nr((M,L,B,z)=>{let U=_.runKernel(qo,D,F);return z([M,L,U,B]),{value:W(U,w),gradFunc:R}})(S,k,T)}var qN=N({fusedMatMul_:IX});function vX(r){return Mc(r,.54,.46)}var jN=N({hammingWindow_:vX});function kX(r){return Mc(r,.5,.5)}var uf=N({hannWindow_:kX});function NX(r,e,t,o=!1,n=0){let s=0,a=[];for(;s+e<=r.size;)a.push(Ye(r,s,e)),s+=t;if(o)for(;s`Error in cropAndResize: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&i.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${i.shape}.`),$(p.rank===1&&p.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${i.shape}.`),$(o.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${o.length}.`),$(o[0]>=1&&o[1]>=1,()=>`cropSize must be atleast [1,1], but was ${o}`),$(n==="bilinear"||n==="nearest",()=>`method must be bilinear or nearest, but was ${n}`);let l={image:a,boxes:i,boxInd:p},c={method:n,extrapolationValue:s,cropSize:o};return _.runKernel(Mn,l,c)}var YN=N({cropAndResize_:_X});function EX(r){let e=v(r,"image","flipLeftRight","float32");$(e.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${e.rank}.`);let t={image:e};return _.runKernel(Gn,t,{})}var QN=N({flipLeftRight_:EX});function $X(r){let e=v(r,"image","grayscaleToRGB"),t=e.rank-1,o=e.shape[t];$(e.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${e.rank}.`),$(o===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${o}.`);let n=new Array(e.rank);return n.fill(1,0,t),n[t]=3,hu(e,n)}var ZN=N({grayscaleToRGB_:$X});function RX(r){let e=v(r,"image","RGBToGrayscale"),t=e.rank-1,o=e.shape[t];$(e.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${e.rank}.`),$(o===3,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${o}.`);let n=e.dtype,s=Ue(e,"float32"),a=rr([.2989,.587,.114]),i;switch(e.rank){case 2:i=fu("ij,j->i",s,a);break;case 3:i=fu("ijk,k->ij",s,a);break;case 4:i=fu("ijkl,l->ijk",s,a);break;case 5:i=fu("ijklm,m->ijkl",s,a);break;case 6:i=fu("ijklmn,n->ijklm",s,a);break;default:throw new Error("Not a valid tensor rank.")}return i=Ks(i,-1),Ue(i,n)}var JN=N({rgbToGrayscale_:RX});function DX(r,e,t=0,o=.5){let n=v(r,"image","rotateWithOffset","float32");$(n.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${n.rank}.`);let s={image:n},a={radians:e,fillValue:t,center:o};return _.runKernel(Vs,s,a)}var eT=N({rotateWithOffset_:DX});function en(r,e,t,o,n,s){o==null&&(o=.5),n==null&&(n=Number.NEGATIVE_INFINITY),s==null&&(s=0);let a=r.shape[0];return t=Math.min(t,a),$(0<=o&&o<=1,()=>`iouThreshold must be in [0, 1], but was '${o}'`),$(r.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${r.rank}'`),$(r.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${r.shape[1]}`),$(e.rank===1,()=>"scores must be a 1D tensor"),$(e.shape[0]===a,()=>`scores has incompatible shape with boxes. Expected ${a}, but was ${e.shape[0]}`),$(0<=s&&s<=1,()=>`softNmsSigma must be in [0, 1], but was '${s}'`),{maxOutputSize:t,iouThreshold:o,scoreThreshold:n,softNmsSigma:s}}function AX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,"boxes","nonMaxSuppression","float32"),a=v(e,"scores","nonMaxSuppression","float32"),i=en(s,a,t,o,n);t=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p={maxOutputSize:t,iouThreshold:o,scoreThreshold:n};return _.runKernel(cs,{boxes:s,scores:a},p)}var tT=N({nonMaxSuppression_:AX});function rT(r,e,t){let o=FX(r,e,t),n=o<0?-(o+1):o;r.splice(n,0,e)}function FX(r,e,t){return OX(r,e,t||PX)}function PX(r,e){return r>e?1:r>>1);let i=t(e,r[s]);i>0?o=s+1:(n=s,a=!i)}return a?o:-o-1}function lf(r,e,t,o,n){return dS(r,e,t,o,n,0)}function cf(r,e,t,o,n,s){return dS(r,e,t,o,n,0,!1,s,!0)}function mf(r,e,t,o,n,s){return dS(r,e,t,o,n,s,!0)}function dS(r,e,t,o,n,s,a=!1,i=!1,p=!1){let u=[];for(let g=0;gn&&u.push({score:e[g],boxIndex:g,suppressBeginIndex:0});u.sort(oT);let l=s>0?-.5/s:0,c=[],m=[];for(;c.length0;){let g=u.pop(),{score:x,boxIndex:b,suppressBeginIndex:w}=g;if(x=w;--k){let T=MX(r,b,c[k]);if(T>=o){S=!0;break}if(g.score=g.score*LX(o,l,T),g.score<=n)break}g.suppressBeginIndex=c.length,S||(g.score===x?(c.push(b),m.push(g.score)):g.score>n&&rT(u,g,oT))}let d=c.length,f=t-d;i&&f>0&&(c.push(...new Array(f).fill(0)),m.push(...new Array(f).fill(0)));let h={selectedIndices:c};return a&&(h.selectedScores=m),p&&(h.validOutputs=d),h}function MX(r,e,t){let o=r.subarray(e*4,e*4+4),n=r.subarray(t*4,t*4+4),s=Math.min(o[0],o[2]),a=Math.min(o[1],o[3]),i=Math.max(o[0],o[2]),p=Math.max(o[1],o[3]),u=Math.min(n[0],n[2]),l=Math.min(n[1],n[3]),c=Math.max(n[0],n[2]),m=Math.max(n[1],n[3]),d=(i-s)*(p-a),f=(c-u)*(m-l);if(d<=0||f<=0)return 0;let h=Math.max(s,u),g=Math.max(a,l),x=Math.min(i,c),b=Math.min(p,m),w=Math.max(x-h,0)*Math.max(b-g,0);return w/(d+f-w)}function LX(r,e,t){let o=Math.exp(e*t*t);return t<=r?o:0}function oT(r,e){return r.score-e.score||r.score===e.score&&e.boxIndex-r.boxIndex}async function BX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY){let s=v(r,"boxes","nonMaxSuppressionAsync"),a=v(e,"scores","nonMaxSuppressionAsync"),i=en(s,a,t,o,n);t=i.maxOutputSize,o=i.iouThreshold,n=i.scoreThreshold;let p=await Promise.all([s.data(),a.data()]),u=p[0],l=p[1],{selectedIndices:c}=lf(u,l,t,o,n);return s!==r&&s.dispose(),a!==e&&a.dispose(),rr(c,"int32")}var nT=BX;function zX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,"boxes","nonMaxSuppression"),i=v(e,"scores","nonMaxSuppression"),p=en(a,i,t,o,n,s);t=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u={boxes:a,scores:i},l={maxOutputSize:t,iouThreshold:o,scoreThreshold:n,softNmsSigma:s},c=_.runKernel(ms,u,l);return{selectedIndices:c[0],selectedScores:c[1]}}var sT=N({nonMaxSuppressionWithScore_:zX});async function VX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=0){let a=v(r,"boxes","nonMaxSuppressionAsync"),i=v(e,"scores","nonMaxSuppressionAsync"),p=en(a,i,t,o,n,s);t=p.maxOutputSize,o=p.iouThreshold,n=p.scoreThreshold,s=p.softNmsSigma;let u=await Promise.all([a.data(),i.data()]),l=u[0],c=u[1],{selectedIndices:m,selectedScores:d}=mf(l,c,t,o,n,s);return a!==r&&a.dispose(),i!==e&&i.dispose(),{selectedIndices:rr(m,"int32"),selectedScores:rr(d)}}var aT=VX;function WX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,"boxes","nonMaxSuppression"),i=v(e,"scores","nonMaxSuppression"),p=en(a,i,t,o,n,null),u=p.maxOutputSize,l=p.iouThreshold,c=p.scoreThreshold,m={boxes:a,scores:i},d={maxOutputSize:u,iouThreshold:l,scoreThreshold:c,padToMaxOutputSize:s},f=_.runKernel(ni,m,d);return{selectedIndices:f[0],validOutputs:f[1]}}var iT=N({nonMaxSuppressionPadded_:WX});async function UX(r,e,t,o=.5,n=Number.NEGATIVE_INFINITY,s=!1){let a=v(r,"boxes","nonMaxSuppressionAsync"),i=v(e,"scores","nonMaxSuppressionAsync"),p=en(a,i,t,o,n,null),u=p.maxOutputSize,l=p.iouThreshold,c=p.scoreThreshold,[m,d]=await Promise.all([a.data(),i.data()]),{selectedIndices:f,validOutputs:h}=cf(m,d,u,l,c,s);return a!==r&&a.dispose(),i!==e&&i.dispose(),{selectedIndices:rr(f,"int32"),validOutputs:ke(h,"int32")}}var uT=UX;function GX(r,e,t=!1,o=!1){let n=v(r,"images","resizeBilinear");$(n.rank===3||n.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${n.rank}.`),$(e.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`),$(o===!1||t===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=e,i={images:s},p={alignCorners:t,halfPixelCenters:o,size:e},u=_.runKernel(Cs,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var pT=N({resizeBilinear_:GX});function HX(r,e,t=!1,o=!1){let n=v(r,"images","resizeNearestNeighbor");$(n.rank===3||n.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${n.rank}.`),$(e.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`),$(n.dtype==="float32"||n.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),$(o===!1||t===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let s=n,a=!1;n.rank===3&&(a=!0,s=W(n,[1,n.shape[0],n.shape[1],n.shape[2]]));let[]=e,i={images:s},p={alignCorners:t,halfPixelCenters:o,size:e},u=_.runKernel(bs,i,p);return a?W(u,[u.shape[1],u.shape[2],u.shape[3]]):u}var lT=N({resizeNearestNeighbor_:HX});function KX(r,e="binary",t=!1,o=.5){let n=v(r,"image","threshold"),s=.2989,a=.587,i=.114,p=n.shape[0]*n.shape[1],u=se(rr([o]),255),l,c,m,d;if($(n.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${n.rank}.`),$(n.shape[2]===3||n.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${n.shape[2]}.`),$(n.dtype==="int32"||n.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${n.dtype}.`),$(e==="otsu"||e==="binary",()=>`Method must be binary or otsu, but was ${e}`),n.shape[2]===3){[l,c,m]=Ci(n,[1,1,1],-1);let g=se(l,s),x=se(c,a),b=se(m,i);d=Ce(Ce(g,x),b)}else d=r;if(e==="otsu"){let g=kd(Ue(ef(d),"int32"),pr([]),256);u=qX(g,p)}let f=t?ml(d,u):ju(d,u);return Ue(se(f,255),"int32")}function qX(r,e){let t=rr([-1]),o=rr([0]),n=rr([0]),s,a,i,p,u,l;for(let c=0;c`Error in transform: image must be rank 4,but got rank ${a.rank}.`),$(i.rank===2&&(i.shape[0]===a.shape[0]||i.shape[0]===1)&&i.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),$(s==null||s.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${s}.`);let p={image:a,transforms:i},u={interpolation:t,fillMode:o,fillValue:n,outputShape:s};return _.runKernel(zs,p,u)}var mT=N({transform_:jX});function XX(r,e,t){let o=v(r,"a","bandPart");$(o.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${o.rank}.`);let n=o.shape,[s,a]=o.shape.slice(-2),i,p;typeof e=="number"?($(e%1===0,()=>`bandPart(): numLower must be an integer, got ${e}.`),$(e<=s,()=>`bandPart(): numLower (${e}) must not be greater than the number of rows (${s}).`),i=v(e<0?s:e,"numLower","bandPart")):($(e.dtype==="int32",()=>"bandPart(): numLower's dtype must be an int32."),i=Lo(Fc(e,0),s,Qu(e,s))),typeof t=="number"?($(t%1===0,()=>`bandPart(): numUpper must be an integer, got ${t}.`),$(t<=a,()=>`bandPart(): numUpper (${t}) must not be greater than the number of columns (${a}).`),p=v(t<0?a:t,"numUpper","bandPart")):($(t.dtype==="int32",()=>"bandPart(): numUpper's dtype must be an int32."),p=Lo(Fc(t,0),a,Qu(t,a)));let u=W(xu(0,s,1,"int32"),[-1,1]),l=xu(0,a,1,"int32"),c=Te(u,l),m=Xu(ml(c,i),Ad(c,mr(p))),d=Yr([s,a],o.dtype);return W(Tr(zo(W(o,[-1,s,a])).map(f=>Lo(m,f,d))),n)}var dT=N({bandPart_:XX});function YX(r){let e;if(Array.isArray(r)){e=!1,$(r!=null&&r.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let n=r[0].shape[0];for(let s=1;s`Gram-Schmidt: Non-unique lengths found in the input vectors: (${r[s].shape[0]} vs. ${n})`)}else e=!0,r=Ci(r,r.shape[0],0).map(n=>gl(n,[0]));$(r.length<=r[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${r.length}) exceeds number of dimensions (${r[0].shape[0]}).`);let t=[],o=r;for(let n=0;n{let s=o[n];if(n>0)for(let a=0;a=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${r.rank}`),r.rank===2)return hT(r,e);{let t=r.shape.slice(0,r.shape.length-2).reduce((p,u)=>p*u),o=zo(W(r,[t,r.shape[r.shape.length-2],r.shape[r.shape.length-1]]),0),n=[],s=[];o.forEach(p=>{let[u,l]=hT(p,e);n.push(u),s.push(l)});let a=W(Tr(n,0),r.shape),i=W(Tr(s,0),r.shape);return[a,i]}}function hT(r,e=!1){return _.tidy(()=>{$(r.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${r.shape.length}D Tensor.`);let t=r.shape[0],o=r.shape[1],n=$d(t),s=Xr(r),a=bu([[1]],[1,1]),i=Xr(a),p=t>=o?o:t;for(let u=0;u{let d=Ye(s,[u,u],[t-u,1]),f=qu(d),h=Ye(s,[u,u],[1,1]),g=Lo(ju(h,0),bu([[-1]]),bu([[1]])),x=Te(h,se(g,f)),b=Xe(d,x);b.shape[0]===1?i=Xr(a):i=bt([a,Ye(b,[1,0],[b.shape[0]-1,b.shape[1]])],0);let w=mr(Xe(Je(g,x),f)),S=Ye(s,[u,0],[t-u,o]),k=se(w,i),T=yl(i);if(u===0)s=Te(S,Je(k,Je(T,S)));else{let D=Te(S,Je(k,Je(T,S)));s=bt([Ye(s,[0,0],[u,o]),D],0)}let E=yl(k),R=Ye(n,[0,u],[t,n.shape[1]-u]);if(u===0)n=Te(R,Je(Je(R,i),E));else{let D=Te(R,Je(Je(R,i),E));n=bt([Ye(n,[0,0],[t,u]),D],1)}return[i,s,n]}),Lt([l,c,m])}return!e&&t>o&&(n=Ye(n,[0,0],[t,o]),s=Ye(s,[0,0],[o,o])),[n,s]})}var gT=N({qr_:QX});var Dt;(function(r){r[r.NONE=0]="NONE",r[r.MEAN=1]="MEAN",r[r.SUM=2]="SUM",r[r.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(Dt||(Dt={}));function ZX(r,e,t=Dt.SUM_BY_NONZERO_WEIGHTS){let o=v(r,"losses","computeWeightedLoss"),n=null;e!=null&&(n=v(e,"weights","computeWeightedLoss"));let s=n==null?o:se(o,n);if(t===Dt.NONE)return s;if(t===Dt.SUM)return ot(s);if(t===Dt.MEAN){if(n==null)return Yu(s);{let a=o.size/n.size,i=Xe(ot(s),ot(n));return a>1?Xe(i,ke(a)):i}}if(t===Dt.SUM_BY_NONZERO_WEIGHTS){if(n==null)return Xe(ot(s),ke(o.size));{let a=se(n,Ba(o.shape)),i=Ue(ot(Gd(a,ke(0))),"float32");return Xe(ot(s),i)}}throw Error(`Unknown reduction: ${t}`)}var dr=N({computeWeightedLoss_:ZX});function JX(r,e,t,o=Dt.SUM_BY_NONZERO_WEIGHTS){let n=v(r,"labels","absoluteDifference"),s=v(e,"predictions","absoluteDifference"),a=null;t!=null&&(a=v(t,"weights","absoluteDifference")),yt(n.shape,s.shape,"Error in absoluteDifference: ");let i=er(Te(n,s));return dr(i,a,o)}var xT=N({absoluteDifference_:JX});function e5(r,e,t,o,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"labels","cosineDistance"),a=v(e,"predictions","cosineDistance"),i=null;o!=null&&(i=v(o,"weights","cosineDistance")),yt(s.shape,a.shape,"Error in cosineDistance: ");let p=ke(1),u=Te(p,ot(se(s,a),t,!0));return dr(u,i,n)}var yT=N({cosineDistance_:e5});function t5(r,e,t,o=Dt.SUM_BY_NONZERO_WEIGHTS){let n=v(r,"labels","hingeLoss"),s=v(e,"predictions","hingeLoss"),a=null;t!=null&&(a=v(t,"weights","hingeLoss")),yt(n.shape,s.shape,"Error in hingeLoss: ");let i=ke(1);n=Te(se(ke(2),n),i);let p=yu(Te(i,se(n,s)));return dr(p,a,o)}var bT=N({hingeLoss_:t5});function r5(r,e,t,o=1,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"labels","huberLoss"),a=v(e,"predictions","huberLoss"),i=null;t!=null&&(i=v(t,"weights","huberLoss")),yt(s.shape,a.shape,"Error in huberLoss: ");let p=ke(o),u=er(Te(a,s)),l=Qu(u,p),c=Te(u,l),m=Ce(se(ke(.5),tr(l)),se(p,c));return dr(m,i,n)}var CT=N({huberLoss_:r5});function o5(r,e,t,o=1e-7,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"labels","logLoss"),a=v(e,"predictions","logLoss"),i=null;t!=null&&(i=v(t,"weights","logLoss")),yt(s.shape,a.shape,"Error in logLoss: ");let p=ke(1),u=ke(o),l=mr(se(s,yi(Ce(a,u)))),c=se(Te(p,s),yi(Ce(Te(p,a),u))),m=Te(l,c);return dr(m,i,n)}var wT=N({logLoss_:o5});function n5(r,e,t,o=Dt.SUM_BY_NONZERO_WEIGHTS){let n=v(r,"labels","meanSquaredError"),s=v(e,"predictions","meanSquaredError"),a=null;t!=null&&(a=v(t,"weights","meanSquaredError")),yt(n.shape,s.shape,"Error in meanSquaredError: ");let i=rf(n,s);return dr(i,a,o)}var ST=N({meanSquaredError_:n5});function s5(r,e){let t=v(r,"labels","sigmoidCrossEntropyWithLogits"),o=v(e,"logits","sigmoidCrossEntropyWithLogits");yt(t.shape,o.shape,"Error in sigmoidCrossEntropyWithLogits: ");let n=yu(o),s=se(o,t),a=Pd(Jo(mr(er(o))));return Ce(Te(n,s),a)}function a5(r,e,t,o=0,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"multiClassLabels","sigmoidCrossEntropy"),a=v(e,"logits","sigmoidCrossEntropy"),i=null;if(t!=null&&(i=v(t,"weights","sigmoidCrossEntropy")),yt(s.shape,a.shape,"Error in sigmoidCrossEntropy: "),o>0){let u=ke(o),l=ke(1),c=ke(.5);s=Ce(se(s,Te(l,u)),se(c,u))}let p=s5(s,a);return dr(p,i,n)}var IT=N({sigmoidCrossEntropy_:a5});function i5(r,e,t=-1){if(t===-1&&(t=e.rank-1),t!==e.rank-1)throw Error(`Softmax cross entropy along a non-last dimension is not yet supported. Labels / logits was rank ${e.rank} and dim was ${t}`);return Nr((n,s,a)=>{let p=Ld(s,[t],!0),u=Te(Ue(s,"float32"),p);a([n,u]);let l=mr(se(u,n));return{value:ot(l,[t]),gradFunc:(d,f)=>{let[h,g]=f,x=gi(d.shape,[t]);return[se(W(d,x),Te(Ue(h,"float32"),Jo(g))),se(W(d,x),Te(Jo(g),Ue(h,"float32")))]}}})(r,e)}function u5(r,e,t,o=0,n=Dt.SUM_BY_NONZERO_WEIGHTS){let s=v(r,"onehotLabels","softmaxCrossEntropy"),a=v(e,"logits","softmaxCrossEntropy"),i=null;if(t!=null&&(i=v(t,"weights","softmaxCrossEntropy")),yt(s.shape,a.shape,"Error in softmaxCrossEntropy: "),o>0){let u=ke(o),l=ke(1),c=ke(s.shape[1]);s=Ce(se(s,Te(l,u)),Xe(u,c))}let p=i5(s,a);return dr(p,i,n)}var vT=N({softmaxCrossEntropy_:u5});function p5(r,e,t,o){let n=v(r,"indices","sparseFillEmptyRows","int32"),s=v(e,"values","sparseFillEmptyRows"),a=v(t,"denseShape","sparseFillEmptyRows","int32"),i=v(o,"defaultValue","sparseFillEmptyRows",s.dtype);if(n.rank!==2)throw new Error(`Indices should be Tensor2D but received shape + ${n.shape}`);if(s.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${s.shape}`);if(a.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${a.shape}`);if(i.rank!==0)throw new Error(`Default value should be a scalar but received shape ${i.shape}`);let p={indices:n,values:s,denseShape:a,defaultValue:i},u=_.runKernel(eu,p);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}var kT=N({sparseFillEmptyRows_:p5});function l5(r,e,t){let o=v(r,"inputIndices","sparseReshape","int32"),n=v(e,"inputShape","sparseReshape","int32"),s=v(t,"newShape","sparseReshape","int32");if(o.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape + ${o.shape}`);if(n.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${n.shape}`);if(s.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${s.shape}`);let a={inputIndices:o,inputShape:n,newShape:s},i=_.runKernel(ui,a);return{outputIndices:i[0],outputShape:i[1]}}var NT=N({sparseReshape_:l5});function c5(r,e,t){let o=v(r,"data","sparseSegmentMean"),n=v(e,"indices","sparseSegmentMean","int32"),s=v(t,"segmentIds","sparseSegmentMean","int32");if(o.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${n.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return T.runKernel(ya,a)}var MN=N({sparseSegmentMean_:Lj});function Bj(r,t,e){let o=v(r,"data","sparseSegmentSum"),n=v(t,"indices","sparseSegmentSum","int32"),s=v(e,"segmentIds","sparseSegmentSum","int32");if(o.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape + ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return _.runKernel(va,a)}var TT=N({sparseSegmentMean_:c5});function m5(r,e,t){let o=v(r,"data","sparseSegmentSum"),n=v(e,"indices","sparseSegmentSum","int32"),s=v(t,"segmentIds","sparseSegmentSum","int32");if(o.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${n.shape}`);if(s.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return T.runKernel(ba,a)}var LN=N({sparseSegmentSum_:Bj});function zj(r,t,e,o,n,s,a,i){let p=v(r,"data","stringNGrams","string");if(p.dtype!=="string")throw new Error("Data must be of datatype string");if(p.shape.length!==1)throw new Error(`Data must be a vector, saw: ${p.shape}`);let u=v(t,"dataSplits","stringNGrams");if(u.dtype!=="int32")throw new Error("Data splits must be of datatype int32");let c={separator:e,nGramWidths:o,leftPad:n,rightPad:s,padWidth:a,preserveShortSequences:i},l={data:p,dataSplits:u},m=T.runKernel(Ca,l,c);return{nGrams:m[0],nGramsSplits:m[1]}}var BN=N({stringNGrams_:zj});function Vj(r,t,e=!0){let o=v(r,"input","stringSplit","string"),n=v(t,"delimiter","stringSplit","string");if(o.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${o.shape}`);if(n.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${n.shape}`);let s={skipEmpty:e},a={input:o,delimiter:n},i=T.runKernel(qi,a,s);return{indices:i[0],values:i[1],shape:i[2]}}var zN=N({stringSplit_:Vj});function Wj(r,t){let e=v(r,"input","stringToHashBucketFast","string"),o={numBuckets:t};if(t<=0)throw new Error("Number of buckets must be at least 1");let n={input:e};return T.runKernel(ji,n,o)}var VN=N({stringToHashBucketFast_:Wj});function Uj(r,t,e,o=!0){let n=v(r,"input","staticRegexReplace","string"),s={pattern:t,rewrite:e,replaceGlobal:o};return T.runKernel($u,{x:n},s)}var WN=N({staticRegexReplace_:Uj});var Gj={fft:ac,ifft:Ku,rfft:ic,irfft:Gd},Hj={hammingWindow:nN,hannWindow:Yd,frame:Qd,stft:sN},Kj={flipLeftRight:iN,grayscaleToRGB:uN,resizeNearestNeighbor:CN,resizeBilinear:bN,rgbToGrayscale:pN,rotateWithOffset:cN,cropAndResize:aN,nonMaxSuppression:lN,nonMaxSuppressionAsync:fN,nonMaxSuppressionWithScore:hN,nonMaxSuppressionWithScoreAsync:gN,nonMaxSuppressionPadded:xN,nonMaxSuppressionPaddedAsync:yN,threshold:wN,transform:SN},qj={bandPart:IN,gramSchmidt:vN,qr:NN},jj={absoluteDifference:TN,computeWeightedLoss:cr,cosineDistance:_N,hingeLoss:$N,huberLoss:EN,logLoss:RN,meanSquaredError:DN,sigmoidCrossEntropy:AN,softmaxCrossEntropy:FN},Xj={sparseFillEmptyRows:PN,sparseReshape:ON,sparseSegmentMean:MN,sparseSegmentSum:LN},Yj={stringNGrams:BN,stringSplit:zN,stringToHashBucketFast:VN,staticRegexReplace:WN};var UN={};qe(UN,{Serializable:()=>$l,SerializationMap:()=>tf,getRegisteredName:()=>Zj,registerClass:()=>tS});var Qj=new Map,eS=new Map,$l=class{getClassName(){return this.constructor.className}static fromConfig(t,e){return new t(e)}},tf=class r{constructor(){this.classNameMap={}}static getMap(){return r.instance==null&&(r.instance=new r),r.instance}static register(t){r.getMap().classNameMap[t.className]=[t,t.fromConfig]}};function tS(r,t,e){$(r.className!=null,()=>"Class being registered does not have the static className property defined."),$(typeof r.className=="string",()=>"className is required to be a string, but got type "+typeof r.className),$(r.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),typeof t=="undefined"&&(t="Custom"),typeof e=="undefined"&&(e=r.className);let o=e,n=t+">"+o;return tf.register(r),Qj.set(n,r),eS.set(r,n),r}function Zj(r){return eS.has(r)?eS.get(r):r.className}var kr=class extends $l{minimize(t,e=!1,o){let{value:n,grads:s}=this.computeGradients(t,o);if(o!=null){let a=o.map(i=>({name:i.name,tensor:s[i.name]}));this.applyGradients(a)}else this.applyGradients(s);return Ot(s),e?n:(n.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(t,e){return zw(t,e)}dispose(){this.iterations_!=null&&Ot(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(t){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(t){return this.iterations_=(await t[0].tensor.data())[0],t.slice(1)}};Object.defineProperty(kr,Symbol.hasInstance,{value:r=>r.minimize!=null&&r.computeGradients!=null&&r.applyGradients!=null});var Qu=class extends kr{static get className(){return"Adadelta"}constructor(t,e,o=null){super(),this.learningRate=t,this.rho=e,this.epsilon=o,this.accumulatedGrads=[],this.accumulatedUpdates=[],o==null&&(this.epsilon=T.backend.epsilon())}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o],a=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accum_grad`,variable:De(()=>Gt(s).variable(a))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${o}/accum_var`,variable:De(()=>Gt(s).variable(a))});let i=Array.isArray(t)?t[n].tensor:t[o];if(i==null)return;let p=this.accumulatedGrads[n].variable,u=this.accumulatedUpdates[n].variable;De(()=>{let c=Ce(se(p,this.rho),se(Zt(i),1-this.rho)),l=se(je(Rr(Ce(u,this.epsilon)),Rr(Ce(p,this.epsilon))),i),m=Ce(se(u,this.rho),se(Zt(l),1-this.rho));p.assign(c),u.assign(m);let d=Ce(se(l,-this.learningRate),s);s.assign(d)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Ot(this.accumulatedGrads.map(t=>t.variable)),Ot(this.accumulatedUpdates.map(t=>t.variable)))}async getWeights(){let t=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(t.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=t.length/2,o=!1;this.accumulatedGrads=t.slice(0,e).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedUpdates=t.slice(e,e*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(t,e){return new t(e.learningRate,e.rho,e.epsilon)}};var Zu=class extends kr{static get className(){return"Adagrad"}constructor(t,e=.1){super(),this.learningRate=t,this.initialAccumulatorValue=e,this.accumulatedGrads=[]}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o];this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accumulator`,variable:De(()=>Ea(s.shape,this.initialAccumulatorValue).variable(!1))});let a=Array.isArray(t)?t[n].tensor:t[o];if(a==null)return;let i=this.accumulatedGrads[n].variable;De(()=>{let p=Ce(i,Zt(a));i.assign(p);let u=Ce(se(je(a,Rr(Ce(p,T.backend.epsilon()))),-this.learningRate),s);s.assign(u)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Ot(this.accumulatedGrads.map(t=>t.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=!1;this.accumulatedGrads=t.map(o=>({originalName:o.name,variable:o.tensor.variable(e)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(t,e){return new t(e.learningRate,e.initialAccumulatorValue)}};var Ju=class extends kr{static get className(){return"Adam"}constructor(t,e,o,n=null){super(),this.learningRate=t,this.beta1=e,this.beta2=o,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],De(()=>{this.accBeta1=ke(e).variable(),this.accBeta2=ke(o).variable()}),n==null&&(this.epsilon=T.backend.epsilon())}applyGradients(t){let e=Array.isArray(t)?t.map(o=>o.name):Object.keys(t);De(()=>{let o=Te(1,this.accBeta1),n=Te(1,this.accBeta2);e.forEach((s,a)=>{let i=T.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:De(()=>Gt(i).variable(p))}),this.accumulatedSecondMoment[a]==null&&(this.accumulatedSecondMoment[a]={originalName:`${s}/v`,variable:De(()=>Gt(i).variable(p))});let u=Array.isArray(t)?t[a].tensor:t[s];if(u==null)return;let c=this.accumulatedFirstMoment[a].variable,l=this.accumulatedSecondMoment[a].variable,m=Ce(se(c,this.beta1),se(u,1-this.beta1)),d=Ce(se(l,this.beta2),se(Zt(u),1-this.beta2)),f=je(m,o),h=je(d,n);c.assign(m),l.assign(d);let g=Ce(se(je(f,Ce(Rr(h),this.epsilon)),-this.learningRate),i);i.assign(g)}),this.accBeta1.assign(se(this.accBeta1,this.beta1)),this.accBeta2.assign(se(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Ot(this.accumulatedFirstMoment.map(t=>t.variable)),this.accumulatedSecondMoment!=null&&Ot(this.accumulatedSecondMoment.map(t=>t.variable))}async getWeights(){let t=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(t.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(t){t=await this.extractIterations(t),De(()=>{this.accBeta1.assign(ii(this.beta1,this.iterations_+1)),this.accBeta2.assign(ii(this.beta2,this.iterations_+1))});let e=t.length/2,o=!1;this.accumulatedFirstMoment=t.slice(0,e).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedSecondMoment=t.slice(e,e*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon)}};var ep=class extends kr{static get className(){return"Adamax"}constructor(t,e,o,n=null,s=0){super(),this.learningRate=t,this.beta1=e,this.beta2=o,this.epsilon=n,this.decay=s,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],De(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(e).variable()}),n==null&&(this.epsilon=T.backend.epsilon())}applyGradients(t){let e=Array.isArray(t)?t.map(o=>o.name):Object.keys(t);De(()=>{let o=Te(1,this.accBeta1),n=je(-this.learningRate,Ce(se(this.iteration,this.decay),1));e.forEach((s,a)=>{let i=T.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:Gt(i).variable(p)}),this.accumulatedWeightedInfNorm[a]==null&&(this.accumulatedWeightedInfNorm[a]={originalName:`${s}/v`,variable:Gt(i).variable(p)});let u=Array.isArray(t)?t[a].tensor:t[s];if(u==null)return;let c=this.accumulatedFirstMoment[a].variable,l=this.accumulatedWeightedInfNorm[a].variable,m=Ce(se(c,this.beta1),se(u,1-this.beta1)),d=se(l,this.beta2),f=Qt(u),h=Dd(d,f);c.assign(m),l.assign(h);let g=Ce(se(je(n,o),je(m,Ce(h,this.epsilon))),i);i.assign(g)}),this.iteration.assign(Ce(this.iteration,1)),this.accBeta1.assign(se(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Ot(this.accumulatedFirstMoment.map(t=>t.variable)),this.accumulatedWeightedInfNorm!=null&&Ot(this.accumulatedWeightedInfNorm.map(t=>t.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(t){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(t,e){return new t(e.learningRate,e.beta1,e.beta2,e.epsilon,e.decay)}};var li=class extends kr{static get className(){return"SGD"}constructor(t){super(),this.learningRate=t,this.setLearningRate(t)}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=Array.isArray(t)?t[n].tensor:t[o];if(s==null)return;let a=T.registeredVariables[o];De(()=>{let i=Ce(se(this.c,s),a);a.assign(i)})}),this.incrementIterations()}setLearningRate(t){this.learningRate=t,this.c!=null&&this.c.dispose(),this.c=Er(ke(-t))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(t){if(t=await this.extractIterations(t),t.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(t,e){return new t(e.learningRate)}};var tp=class extends li{static get className(){return"Momentum"}constructor(t,e,o=!1){super(t),this.learningRate=t,this.momentum=e,this.useNesterov=o,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o];this.accumulations[n]==null&&(this.accumulations[n]={originalName:`${o}/momentum`,variable:De(()=>Gt(s).variable(!1))});let a=this.accumulations[n].variable,i=Array.isArray(t)?t[n].tensor:t[o];i!=null&&De(()=>{let p,u=Ce(se(this.m,a),i);this.useNesterov?p=Ce(se(this.c,Ce(i,se(u,this.m))),s):p=Ce(se(this.c,u),s),a.assign(u),s.assign(p)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Ot(this.accumulations.map(t=>t.variable))}setMomentum(t){this.momentum=t}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(t=>({name:t.originalName,tensor:t.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=!1;this.accumulations=t.map(o=>({originalName:o.name,variable:o.tensor.variable(e)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(t,e){return new t(e.learningRate,e.momentum,e.useNesterov)}};var rp=class extends kr{static get className(){return"RMSProp"}constructor(t,e=.9,o=0,n=null,s=!1){if(super(),this.learningRate=t,this.decay=e,this.momentum=o,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=s,n==null&&(this.epsilon=T.backend.epsilon()),t==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(t){(Array.isArray(t)?t.map(o=>o.name):Object.keys(t)).forEach((o,n)=>{let s=T.registeredVariables[o],a=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${o}/rms`,variable:De(()=>Gt(s).variable(a))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${o}/momentum`,variable:De(()=>Gt(s).variable(a))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${o}/mg`,variable:De(()=>Gt(s).variable(a))});let i=Array.isArray(t)?t[n].tensor:t[o];if(i==null)return;let p=this.accumulatedMeanSquares[n].variable,u=this.accumulatedMoments[n].variable;De(()=>{let c=Ce(se(p,this.decay),se(Zt(i),1-this.decay));if(this.centered){let l=this.accumulatedMeanGrads[n].variable,m=Ce(se(l,this.decay),se(i,1-this.decay)),d=je(se(i,this.learningRate),Rr(Te(c,Ce(Zt(m),this.epsilon)))),f=Ce(se(u,this.momentum),d);p.assign(c),l.assign(m),u.assign(f);let h=Te(s,f);s.assign(h)}else{let l=Ce(se(p,this.decay),se(Zt(i),1-this.decay)),m=Ce(se(u,this.momentum),je(se(i,this.learningRate),Rr(Ce(l,this.epsilon))));p.assign(l),u.assign(m);let d=Te(s,m);s.assign(d)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Ot(this.accumulatedMeanSquares.map(t=>t.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Ot(this.accumulatedMeanGrads.map(t=>t.variable)),this.accumulatedMoments!=null&&Ot(this.accumulatedMoments.map(t=>t.variable))}async getWeights(){let t=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&t.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(t.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(t){t=await this.extractIterations(t);let e=this.centered?t.length/3:t.length/2,o=!1;this.accumulatedMeanSquares=t.slice(0,e).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedMoments=t.slice(e,e*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.centered&&(this.accumulatedMeanGrads=t.slice(e*2,e*3).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(t,e){return new t(e.learningRate,e.decay,e.momentum,e.epsilon,e.centered)}};var Jj=[Qu,Zu,Ju,ep,tp,rp,li];function GN(){for(let r of Jj)tS(r)}var mi={};qe(mi,{CompositeArrayBuffer:()=>ir,browserFiles:()=>KN,browserHTTPRequest:()=>XN,concatenateArrayBuffers:()=>uk,copyModel:()=>Sk,decodeWeights:()=>nd,encodeWeights:()=>sk,fromMemory:()=>YN,fromMemorySync:()=>iS,getLoadHandlers:()=>mk,getModelArtifactsForJSON:()=>Jp,getModelArtifactsForJSONSync:()=>_w,getModelArtifactsInfoForJSON:()=>va,getSaveHandlers:()=>lk,getWeightSpecs:()=>ad,http:()=>of,isHTTPScheme:()=>rf,listModels:()=>Ck,loadWeights:()=>qN,moveModel:()=>Ik,registerLoadRouter:()=>ck,registerSaveRouter:()=>pk,removeModel:()=>wk,weightsLoaderFactory:()=>sS,withSaveHandler:()=>QN,withSaveHandlerSync:()=>ZN});var eX="model",tX=".json",rX=".weights.bin";function HN(r){return new Promise(t=>setTimeout(t)).then(r)}var lc=class r{constructor(t){if(!A().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");t.startsWith(r.URL_SCHEME)&&(t=t.slice(r.URL_SCHEME.length)),(t==null||t.length===0)&&(t=eX),this.modelJsonFileName=t+tX,this.weightDataFileName=t+rX}async save(t){if(typeof document=="undefined")throw new Error("Browser downloads are not supported in this environment since `document` is not present");let e=ir.join(t.weightData),o=window.URL.createObjectURL(new Blob([e],{type:"application/octet-stream"}));if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let n=[{paths:["./"+this.weightDataFileName],weights:t.weightSpecs}],s=sd(t,n),a=window.URL.createObjectURL(new Blob([JSON.stringify(s)],{type:"application/json"})),i=this.modelJsonAnchor==null?document.createElement("a"):this.modelJsonAnchor;if(i.download=this.modelJsonFileName,i.href=a,await HN(()=>i.dispatchEvent(new MouseEvent("click"))),t.weightData!=null){let p=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;p.download=this.weightDataFileName,p.href=o,await HN(()=>p.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:va(t)}}}};lc.URL_SCHEME="downloads://";var rS=class{constructor(t){if(t==null||t.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${t}`);this.jsonFile=t[0],this.weightsFiles=t.slice(1)}async load(){return new Promise((t,e)=>{let o=new FileReader;o.onload=n=>{let s=JSON.parse(n.target.result),a=s.modelTopology;if(a==null){e(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(s.weightsManifest==null){e(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){t({modelTopology:a});return}let p=Jp(s,u=>this.loadWeights(u));t(p)},o.onerror=n=>e(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),o.readAsText(this.jsonFile)})}loadWeights(t){let e=[],o=[];for(let a of t)e.push(...a.weights),o.push(...a.paths);let n=this.checkManifestAndWeightFiles(t),s=o.map(a=>this.loadWeightsFile(a,n[a]));return Promise.all(s).then(a=>[e,a])}loadWeightsFile(t,e){return new Promise((o,n)=>{let s=new FileReader;s.onload=a=>{let i=a.target.result;o(i)},s.onerror=a=>n(`Failed to weights data from file of path '${t}'.`),s.readAsArrayBuffer(e)})}checkManifestAndWeightFiles(t){let e=[],o=this.weightsFiles.map(s=>Tw(s.name)),n={};for(let s of t)s.paths.forEach(a=>{let i=Tw(a);if(e.indexOf(i)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${i}'`);if(e.push(i),o.indexOf(i)===-1)throw new Error(`Weight file with basename '${i}' is not provided.`);n[a]=this.weightsFiles[o.indexOf(i)]});if(e.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${e.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}},oX=r=>A().getBool("IS_BROWSER")&&!Array.isArray(r)&&r.startsWith(lc.URL_SCHEME)?nX(r.slice(lc.URL_SCHEME.length)):null;qt.registerSaveRouter(oX);function nX(r="model"){return new lc(r)}function KN(r){return new rS(r)}function oS(r,t,e,o){a(r),e=e==null?0:e,o=o==null?1:o,i(e,o);let n=0,s=p=>(p.then(u=>{let c=e+ ++n/r.length*(o-e);return t(c),u}),p);function a(p){$(p!=null&&Array.isArray(p)&&p.length>0,()=>"promises must be a none empty array")}function i(p,u){$(p>=0&&p<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${p}`),$(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),$(u>=p,()=>`startFraction must be no more than endFraction, but got startFraction ${p} and endFraction ${u}`)}return Promise.all(r.map(s))}async function nS(r,t){t==null&&(t={});let e=t.fetchFunc==null?A().platform.fetch:t.fetchFunc,o=r.map(l=>e(l,t.requestInit,{isBinary:!0})),n=0,s=.5,i=(t.onProgress==null?await Promise.all(o):await oS(o,t.onProgress,n,s)).map(l=>l.arrayBuffer()),p=.5,u=1;return t.onProgress==null?await Promise.all(i):await oS(i,t.onProgress,p,u)}async function qN(r,t="",e,o){return sS(a=>nS(a,{requestInit:o}))(r,t,e)}function sS(r){return async(t,e="",o)=>{let n=t.map(()=>!1),s={},a=o!=null?o.map(()=>!1):[],i=[];if(t.forEach((d,f)=>{let h=0;d.weights.forEach(g=>{let x="quantization"in g?g.quantization.dtype:g.dtype,b=Cl[x]*He(g.shape),C=()=>{n[f]=!0,s[f]==null&&(s[f]=[]),s[f].push({manifestEntry:g,groupOffset:h,sizeBytes:b})};o!=null?o.forEach((S,k)=>{S===g.name&&(C(),a[k]=!0)}):C(),i.push(g.name),h+=b})}),!a.every(d=>d)){let d=o.filter((f,h)=>!a[h]);throw new Error(`Could not find weights in manifest with names: ${d.join(", ")}. -Manifest JSON has weights with names: ${i.join(", ")}.`)}let p=n.reduce((d,f,h)=>(f&&d.push(h),d),[]),u=[];p.forEach(d=>{t[d].paths.forEach(f=>{let h=e+(e.endsWith("/")?"":"/")+f;u.push(h)})});let c=await r(u),l={},m=0;return p.forEach(d=>{let f=t[d].paths.length,h=new ir(c.slice(m,m+f));s[d].forEach(x=>{let b=h.slice(x.groupOffset,x.groupOffset+x.sizeBytes),C=nd(b,[x.manifestEntry]);for(let S in C)l[S]=C[S]}),m+=f}),l}}var sX="application/octet-stream",aX="application/json",El=class{constructor(t,e){if(this.DEFAULT_METHOD="POST",e==null&&(e={}),this.weightPathPrefix=e.weightPathPrefix,this.onProgress=e.onProgress,this.weightUrlConverter=e.weightUrlConverter,e.fetchFunc!=null?($(typeof e.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=e.fetchFunc):this.fetch=A().platform.fetch,$(t!=null&&t.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(t)&&$(t.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${t.length}).`),this.path=t,e.requestInit!=null&&e.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=e.requestInit||{}}async save(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");let e=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);e.body=new FormData;let o=[{paths:["./model.weights.bin"],weights:t.weightSpecs}],n=sd(t,o);if(e.body.append("model.json",new Blob([JSON.stringify(n)],{type:aX}),"model.json"),t.weightData!=null){let a=ir.join(t.weightData);e.body.append("model.weights.bin",new Blob([a],{type:sX}),"model.weights.bin")}let s=await this.fetch(this.path,e);if(s.ok)return{modelArtifactsInfo:va(t),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async load(){let t=await this.fetch(this.path,this.requestInit);if(!t.ok)throw new Error(`Request to ${this.path} failed with status code ${t.status}. Please verify this URL points to the model JSON of the model to load.`);let e;try{e=await t.json()}catch(s){let a=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?a+=" 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.":a+=" Please make sure the server is serving valid JSON for this request.",new Error(a)}let o=e.modelTopology,n=e.weightsManifest;if(o==null&&n==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return Jp(e,s=>this.loadWeights(s))}async loadWeights(t){let e=Array.isArray(this.path)?this.path[1]:this.path,[o,n]=iX(e),s=this.weightPathPrefix||o,a=ad(t),i=[],p=[];for(let c of t)for(let l of c.paths)this.weightUrlConverter!=null?p.push(this.weightUrlConverter(l)):i.push(s+l+n);this.weightUrlConverter&&i.push(...await Promise.all(p));let u=await nS(i,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[a,u]}};El.URL_SCHEME_REGEX=/^https?:\/\//;function iX(r){let t=r.lastIndexOf("/"),e=r.lastIndexOf("?"),o=r.substring(0,t),n=e>t?r.substring(e):"";return[o+"/",n]}function rf(r){return r.match(El.URL_SCHEME_REGEX)!=null}var jN=(r,t)=>{if(typeof fetch=="undefined"&&(t==null||t.fetchFunc==null))return null;{let e=!0;if(Array.isArray(r)?e=r.every(o=>rf(o)):e=rf(r),e)return of(r,t)}return null};qt.registerSaveRouter(jN);qt.registerLoadRouter(jN);function of(r,t){return new El(r,t)}function XN(r,t){return of(r,t)}var Rl=class{constructor(t){this.modelArtifacts=t}load(){return this.modelArtifacts}},nf=class{constructor(t){this.saveHandler=t}save(t){return this.saveHandler(t)}},aS=class{constructor(t){t.load&&(this.load=()=>Promise.resolve(t.load())),t.save&&(this.save=e=>Promise.resolve(t.save(e)))}};function YN(r,t,e,o){let n=arguments;return new aS(iS(...n))}function iS(r,t,e,o){return arguments.length===1?r.modelTopology!=null||r.weightSpecs!=null?new Rl(r):(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 Rl({modelTopology:r})):(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 Rl({modelTopology:r,weightSpecs:t,weightData:e,trainingConfig:o}))}function QN(r){return new nf(r)}function ZN(r){return new nf(r)}var eT={};qe(eT,{confusionMatrix:()=>JN});function uX(r,t,e){let o=v(r,"labels","confusionMatrix"),n=v(t,"predictions","confusionMatrix");$(e==null||e>0&&Number.isInteger(e),()=>`If provided, numClasses must be a positive integer, but got ${e}`),$(o.rank===1,()=>`Expected the rank of labels to be 1, but got ${o.rank}`),$(n.rank===1,()=>`Expected the rank of predictions to be 1, but got ${n.rank}`),$(o.shape[0]===n.shape[0],()=>`Mismatch in the number of examples: ${o.shape[0]} vs. ${n.shape[0]}. Labels and predictions should have the same number of elements.`),$(e>0&&Number.isInteger(e),()=>`numClasses is required to be a positive integer, but got ${e}`);let s=Tl(We(o,"int32"),e),a=Tl(We(n,"int32"),e),i=cc(s),p=Ze(i,a);return We(p,"int32")}var JN=N({confusionMatrix_:uX});var nT={};qe(nT,{draw:()=>gX,fromPixels:()=>xX,fromPixelsAsync:()=>dX,toPixels:()=>hX});var op,tT=!1;function rT(r,t=3){if(t>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(r==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let e=!1,o=!1,n=!1,s=!1,a=!1,i=!1;if(r.data instanceof Uint8Array)e=!0;else if(typeof ImageData!="undefined"&&r instanceof ImageData)o=!0;else if(typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement)n=!0;else if(typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement)s=!0;else if(r.getContext!=null)a=!0;else if(typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap)i=!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 ${r.constructor.name}`);if(qp(Eu,T.backendName)!=null){let f={pixels:r},h={numChannels:t};return T.runKernel(Eu,f,h)}let[u,c]=n?[r.videoWidth,r.videoHeight]:[r.width,r.height],l;if(a)l=r.getContext("2d").getImageData(0,0,u,c).data;else if(o||e)l=r.data;else if(s||n||i){if(op==null)if(typeof document=="undefined")if(typeof OffscreenCanvas!="undefined"&&typeof OffscreenCanvasRenderingContext2D!="undefined")op=new OffscreenCanvas(1,1).getContext("2d");else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");else op=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});op.canvas.width=u,op.canvas.height=c,op.drawImage(r,0,0,u,c),l=op.getImageData(0,0,u,c).data}let m;if(t===4)m=new Int32Array(l);else{let f=u*c;m=new Int32Array(f*t);for(let h=0;h4||t===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if(r.dtype!=="float32"&&r.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${r.dtype}. Please use float32 or int32 tensors.`)}function fX(r){let t=(r==null?void 0:r.alpha)||1;if(t>1||t<0)throw new Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}async function hX(r,t){let e=v(r,"img","toPixels");if(!(r instanceof mt)){let u=e;e=We(u,"int32"),u.dispose()}oT(e);let[o,n]=e.shape.slice(0,2),s=e.rank===2?1:e.shape[2],a=await e.data(),i=e.dtype==="float32"?255:1,p=new Uint8ClampedArray(n*o*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${d}.`)}else if(e.dtype==="int32"&&(d<0||d>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${d}.`);s===1?(c[0]=d*i,c[1]=d*i,c[2]=d*i):c[m]=d*i}let l=u*4;p[l+0]=Math.round(c[0]),p[l+1]=Math.round(c[1]),p[l+2]=Math.round(c[2]),p[l+3]=Math.round(c[3])}if(t!=null){tT||qp(_u,T.backendName)!=null&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),tT=!0),t.width=n,t.height=o;let u=t.getContext("2d"),c=new ImageData(p,n,o);u.putImageData(c,0,0)}return e!==r&&e.dispose(),p}function gX(r,t,e){let o=v(r,"img","draw");if(!(r instanceof mt)){let a=o;o=We(a,"int32"),a.dispose()}oT(o),fX(e==null?void 0:e.imageOptions);let n={image:o},s={canvas:t,options:e};T.runKernel(_u,n,s)}var xX=N({fromPixels_:rT});var sf={};qe(sf,{prepareAndValidate:()=>sT});function sT(r,t){let e=r.shape.length,o=t.shape.length;if(e<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${e}.`);if(o<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${o}.`);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[o-1]>e)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${t.shape[o-1]} vs. ${e}`);if(He(r.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${r.shape}.`);let n=t.shape,s=n[n.length-1],a=1;for(let l=0;ll/u),1].slice(0,s);return[p,a,u,c]}var pt={};qe(pt,{assertParamsValid:()=>bX,computeFlatOffset:()=>vX,computeOutShape:()=>wX,getNormalizedAxes:()=>SX,isSliceContinous:()=>IX,maskToAxes:()=>CX,parseSliceParams:()=>kX,sliceInfo:()=>NX,startForAxis:()=>dT,startIndicesWithElidedDims:()=>cT,stopForAxis:()=>fT,stopIndicesWithElidedDims:()=>lT,stridesForAxis:()=>mT,stridesWithElidedDims:()=>iT});var uS=-2,yX=-1;function bX(r,t,e){let o=r.shape.length;$(o===t.length,()=>`Error in slice${o}D: Length of begin ${t} must match the rank of the array (${o}).`),$(o===e.length,()=>`Error in slice${o}D: Length of size ${e} must match the rank of the array (${o}).`);for(let n=0;n`Error in slice${o}D: begin[${n}] + size[${n}] (${t[n]+e[n]}) would overflow input.shape[${n}] (${r.shape[n]})`)}function CX(r){let t=[],e=0;for(;r>0;)r&1&&t.push(e),r/=2,e++;return t}function wX(r,t,e){let o=[];for(let n=0;n0){let d=t[0],f=e+1;c=cT(a,d,f,o,r),l=lT(i,d,f,n,r),m=iT(s,d,f,r)}else for(let d=0;d-1)s[i]=0;else{let p=uT(t,e,i),u=o[p];r&1<-1)s[i]=Number.MAX_SAFE_INTEGER;else{let p=uT(t,e,i),u=o[p];r&1<0?a=Number.MIN_SAFE_INTEGER:a=Number.MAX_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),a=Bp(0,a,p-1),a}function fT(r,t,e,o,n,s){let a=t[n],i=e[n]||1;(r&1<0?a=Number.MAX_SAFE_INTEGER:a=Number.MIN_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),i>0?a=Bp(0,a,p):a=Bp(-1,a,p-1),a}function IX(r,t,e){let o=e.length;for(let n=0;n1){o=n;break}for(let n=o+1;n0||e[n]!==r[n])return!1;return!0}function vX(r,t){let e=r.length>0?r[r.length-1]:1;for(let o=0;o{$(a!==-1,()=>"slice() does not support negative begin indexing.")});let s;return e==null?s=new Array(n).fill(-1):typeof e=="number"?s=[e,...new Array(n-1).fill(-1)]:e.lengtha>=0?a:($(a===-1,()=>`Negative size values should be exactly -1 but got ${a} for the slice() size at index ${i}.`),r.shape[i]-o[i])),[o,s]}function NX(r,t,e,o,n,s,a,i,p){let u;if(o==null?(u=new Array(t.length),u.fill(1)):u=o,a!=null&&a&a-1)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1,l={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:e.slice(),strides:u.slice(),beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};for(let C=0;C0?0:-1,m.strides[C]>0?k:k-1];if(S&&m.strides[C]<=0)throw Error("only stride 1 allowed on non-range indexing.");h=h&&m.strides[C]===1;let R=!!(m.beginMask&1<=k)throw Error(`slice index ${m.begin[C]} of dimension ${C} out of bounds.`)}else m.begin[C]=aT(m.begin[C],0,m.strides[C],k,_,E),m.end[C]=aT(m.end[C],1,m.strides[C],k,_,E);let O=m.strides[C]===1&&m.begin[C]===0&&m.end[C]===k;d=d&&O,f=f&&(C===0&&m.strides[C]===1||O)}else d=d&&m.strides[C]===1&&R,f=f&&(C===0&&m.strides[C]===1||R);let D,P=!1;if(m.beginValid&&m.endValid?(D=m.end[C]-m.begin[C],P=!0):S?(D=1,P=!0):R&&k>=0&&(m.strides[C]<0?D=-k:D=k,P=!0),P){let O;D===0||D<0!=m.strides[C]<0?O=0:O=Math.trunc(D/m.strides[C])+(D%m.strides[C]!==0?1:0),g.push(O)}else g.push(-1)}for(let C=0;C=0?x.push(g[S]):S===uS&&x.push(1)}return{finalShapeSparse:x.filter((C,S)=>m.finalShapeGatherIndices[S]!==uS),finalShape:x,isIdentity:d,sliceDim0:f,isSimpleSlice:h,begin:m.begin,end:m.end,strides:m.strides}}function TX(r,t){t.beginMask=0,t.endMask=0,t.shrinkAxisMask=0;let e=0;t.beginValid=r.begin!=null,t.endValid=r.end!=null,t.begin=new Array(t.dims),t.end=new Array(t.dims),t.strides=new Array(t.dims),t.finalShapeGatherIndices=[],t.finalShapeGatherIndicesSparse=[],t.inputShapeGatherIndicesSparse=new Array(t.dims);for(let o=0;o0?s[t]:s[t+1&1];{let a=r<0?o+r:r;return as[1]?s[1]:a}}var _X="4.14.0";var Dl=class{static sgd(t){return new li(t)}static momentum(t,e,o=!1){return new tp(t,e,o)}static rmsprop(t,e=.9,o=0,n=null,s=!1){return new rp(t,e,o,n,s)}static adam(t=.001,e=.9,o=.999,n=null){return new Ju(t,e,o,n)}static adadelta(t=.001,e=.95,o=null){return new Qu(t,e,o)}static adamax(t=.002,e=.9,o=.999,n=null,s=0){return new ep(t,e,o,n,s)}static adagrad(t,e=.1){return new Zu(t,e)}};var TGe=Dl;var $X=typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:r=>r();function pS(){return new Promise(r=>$X(()=>r()))}var w={};qe(w,{ERF_A1:()=>KX,ERF_A2:()=>qX,ERF_A3:()=>jX,ERF_A4:()=>XX,ERF_A5:()=>YX,ERF_P:()=>HX,PARALLELIZE_THRESHOLD:()=>af,RowPartitionType:()=>Fa,SELU_SCALE:()=>GX,SELU_SCALEALPHA:()=>UX,applyActivation:()=>Xu,assertAndGetBroadcastShape:()=>rt,assertAxesAreInnerMostDims:()=>tK,assertParamsConsistent:()=>EX,assignToTypedArray:()=>r5,axesAreInnerMostDims:()=>Bw,calculateShapes:()=>W1,checkEinsumDimSizes:()=>u5,checkPadOnDimRoundingMode:()=>Lt,combineLocations:()=>y2,combineRaggedTensorToTensorShapes:()=>DX,complexWithEvenIndex:()=>JX,complexWithOddIndex:()=>e5,computeConv2DInfo:()=>Lu,computeConv3DInfo:()=>Lk,computeDefaultPad:()=>Lw,computeDilation2DInfo:()=>J4,computeOptimalWindowSize:()=>OX,computeOutAndReduceShapes:()=>eK,computeOutShape:()=>RX,computePool2DInfo:()=>Mw,computePool3DInfo:()=>eH,convertConv2DDataFormat:()=>Bk,decodeEinsumEquation:()=>a5,eitherStridesOrDilationsAreOne:()=>gr,expandShapeToKeepDim:()=>ai,exponent:()=>n5,exponents:()=>o5,fromStringArrayToUint8:()=>$5,fromUint8ToStringArray:()=>_5,getAxesPermutation:()=>rK,getBroadcastDims:()=>d2,getComplexWithIndex:()=>t5,getEinsumComputePath:()=>p5,getEinsumPermutation:()=>i5,getFusedBiasGradient:()=>ju,getFusedDyActivation:()=>qu,getImageCenter:()=>MX,getInnerMostAxes:()=>nK,getPermuted:()=>BX,getRaggedRank:()=>FX,getReductionAxes:()=>gd,getReshaped:()=>LX,getReshapedPermuted:()=>zX,getRowPartitionTypesHelper:()=>AX,getSliceBeginCoords:()=>VX,getSliceSize:()=>WX,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>d5,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>f5,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>h5,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>y5,getSparseReshapeInputOutputMismatchErrorMessage:()=>C5,getSparseReshapeInputOutputMultipleErrorMessage:()=>b5,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>g5,getSparseReshapeNegativeOutputDimErrorMessage:()=>x5,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>v5,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>w5,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>S5,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>I5,getUndoAxesPermutation:()=>oK,isIdentityPermutation:()=>c5,log:()=>XG,mergeRealAndImagArrays:()=>QX,prepareAndValidate:()=>sT,prepareSplitSize:()=>m5,segment_util:()=>lS,shouldFuse:()=>Yu,slice_util:()=>pt,splitRealAndImagArrays:()=>ZX,stridesOrDilationsArePositive:()=>Ta,tupleValuesAreOne:()=>Mu,upcastType:()=>dt,validateDefaultValueShape:()=>PX,validateInput:()=>pc,validateUpdateShape:()=>Yw,warn:()=>Ia});function EX(r,t){let e=r[0].length;r.forEach((n,s)=>{$(n.length===e,()=>`Error in concat${e}D: rank of tensors[${s}] must be the same as the rank of the rest (${e})`)}),$(t>=0&&t`Error in concat${e}D: axis must be between 0 and ${e-1}.`);let o=r[0];r.forEach((n,s)=>{for(let a=0;a`Error in concat${e}D: Shape of tensors[${s}] (${n}) does not match the shape of the rest (${o}) along the non-concatenated axis ${s}.`)})}function RX(r,t){let e=r[0].slice();for(let o=1;o=0)if(i>=0){if(i!==s)throw new Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${n+r}] = ${s} but shape[${n+r}] = ${i}`)}else o[a]=s}return o}function AX(r){let t={FIRST_DIM_SIZE:Fa.FIRST_DIM_SIZE,VALUE_ROWIDS:Fa.VALUE_ROWIDS,ROW_LENGTHS:Fa.ROW_LENGTHS,ROW_SPLITS:Fa.ROW_SPLITS,ROW_LIMITS:Fa.ROW_LIMITS,ROW_STARTS:Fa.ROW_STARTS},e=[];for(let o of r)if(o in t)e.push(t[o]);else break;return e}function FX(r){return r.length===0?0:r[0]===Fa.FIRST_DIM_SIZE?r.length-1:r.length}function PX(r,t){if(r==null||t==null)return;let e=r.length,o=t.length;if(e>=o)throw new Error(`defaultValue.shape=${r} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${e} must be less than ragged tensor input flatValues.rank = ${o})`);for(let n=0;n=0&&a>=0&&s!==1&&s!==a)throw new Error(`defaultValue.shape=${r}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${n-r.length}] = ${s} but ragged tensor input.flatValues.shape[${n-r.length}] = ${a}`)}}var af=30;function OX(r){return r<=af?r:Vp(r,Math.floor(Math.sqrt(r)))}function MX(r,t,e){let o=e*(typeof r=="number"?r:r[0]),n=t*(typeof r=="number"?r:r[1]);return[o,n]}function LX(r,t,e,o=!0){let n=[];if(o)n=n.concat(t.slice(0)),n.push(r[0]/e),n=n.concat(r.slice(1));else{n=n.concat(r[0]);let s=t.length;for(let a=0;a=t*2+1||a%2===1?s.push(a):n.push(a);o.push(...n),o.push(0),o.push(...s)}return o}function zX(r,t,e,o=!0){let n=[];o?n.push(r[0]/e):n.push(r[0]*e);for(let s=1;s/g,hT=",",gT="...";function a5(r,t){r=r.replace(/\s/g,"");let e=(r.length-r.replace(s5,"").length)/cS.length;if(e<1)throw new Error("Equations without an arrow are not supported.");if(e>1)throw new Error(`Equation must contain exactly one arrow ("${cS}").`);let[o,n]=r.split(cS);$(o.indexOf(gT)===-1,()=>`The ellipsis notation ("${gT}") is not supported yet.`);let s=o.split(hT),a=s.length;if(t!==a)throw new Error(`Expected ${a} input tensors, received ${t}`);if(a>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let i=[];for(let m=0;mf.indexOf(d)!==-1))throw new Error(`Output subscripts contain the label ${d} not present in the input subscripts.`);i.indexOf(d)===-1&&i.push(d)}for(let m=0;mn!==-1),{permutationIndices:e,expandDims:o}}function u5(r,t,e){let o=new Array(r);for(let n=0;n`Expected dimension ${o[t[n][a]]} at axis ${a} of input shaped ${JSON.stringify(s)}, but got dimension ${s[a]}`)}}function p5(r,t){let e=r,o=[],n=0;r.length===0&&e.push(-1),n=r.length+1;for(let a=0;at===e)}function l5(r,t){let e=[];for(let o=0;o"Number of splits must evenly divide the axis."),o=new Array(t).fill(r.shape[e]/t);else{let n=t.reduce((a,i)=>(i===-1&&(a+=1),a),0);$(n<=1,()=>"There should be only one negative value in split array.");let s=t.indexOf(-1);if(s!==-1){let a=t.reduce((i,p)=>p>0?i+p:i);t[s]=r.shape[e]-a}$(r.shape[e]===t.reduce((a,i)=>a+i),()=>"The sum of sizes must match the size of the axis dimension."),o=t}return o}function d5(r){return`Received SparseTensor with denseShape[0] = 0 but - indices.shape[0] = ${r}`}function f5(r,t){return`indices(${r}, 0) is invalid: ${t} < 0`}function h5(r,t,e){return`indices(${r}, 0) is invalid: ${t} >= ${e}`}function g5(r,t){return`only one output dimension may be -1, not both ${r} and ${t}`}function x5(r,t){return`size ${r} must be non-negative, not ${t}`}function y5(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function b5(r,t){let e=He(r),o=He(t);return`Input to reshape is a SparseTensor with ${e} - dense values, but the requested shape requires a multiple of ${o}. inputShape=${r} outputShape= ${t}`}function C5(r,t){let e=He(r),o=He(t);return`Input to reshape is a tensor with ${e} dense values, but the requested shape has ${o}. inputShape=${r} outputShape=${t}`}function w5(){return"segment ids must be >= 0"}function S5(){return"segment ids are not increasing"}function I5(r,t){return`Segment id ${r} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function v5(r,t,e){return`Bad: indices[${r}] == ${t} out of range [0, ${e})`}var lS={};qe(lS,{collectGatherOpShapeInfo:()=>T5,computeOutShape:()=>N5,segOpComputeOptimalWindowSize:()=>k5});function k5(r,t){let e=!1,o;for(r<=af?(o=r,e=!0):o=Vp(r,Math.floor(Math.sqrt(r)));!e;)o>t||o===r?e=!0:o=Vp(r,o+1);return o}function N5(r,t,e){let o=[],n=r.length;for(let s=0;sn))throw new Error(`Expect batchDims in the range of [-${n}, ${n}], but got ${o}`);if(o<0&&(o+=n),o>s)throw new Error(`batchDims (${o}) must be less than rank(x) ( - ${s}).`);if(eQp(t))}catch(t){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${t}`)}}function $5(r){return r.map(t=>Zi(t))}var Vt={};qe(Vt,{nonMaxSuppressionV3Impl:()=>Zd,nonMaxSuppressionV4Impl:()=>Jd,nonMaxSuppressionV5Impl:()=>ef,whereImpl:()=>jd});GN();var E5=A();E5.registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,r=>{r&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")});var fo;(function(r){r[r.DT_INVALID=0]="DT_INVALID",r[r.DT_FLOAT=1]="DT_FLOAT",r[r.DT_DOUBLE=2]="DT_DOUBLE",r[r.DT_INT32=3]="DT_INT32",r[r.DT_UINT8=4]="DT_UINT8",r[r.DT_INT16=5]="DT_INT16",r[r.DT_INT8=6]="DT_INT8",r[r.DT_STRING=7]="DT_STRING",r[r.DT_COMPLEX64=8]="DT_COMPLEX64",r[r.DT_INT64=9]="DT_INT64",r[r.DT_BOOL=10]="DT_BOOL",r[r.DT_QINT8=11]="DT_QINT8",r[r.DT_QUINT8=12]="DT_QUINT8",r[r.DT_QINT32=13]="DT_QINT32",r[r.DT_BFLOAT16=14]="DT_BFLOAT16",r[r.DT_QINT16=15]="DT_QINT16",r[r.DT_QUINT16=16]="DT_QUINT16",r[r.DT_UINT16=17]="DT_UINT16",r[r.DT_COMPLEX128=18]="DT_COMPLEX128",r[r.DT_HALF=19]="DT_HALF",r[r.DT_RESOURCE=20]="DT_RESOURCE",r[r.DT_VARIANT=21]="DT_VARIANT",r[r.DT_UINT32=22]="DT_UINT32",r[r.DT_UINT64=23]="DT_UINT64",r[r.DT_FLOAT_REF=101]="DT_FLOAT_REF",r[r.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",r[r.DT_INT32_REF=103]="DT_INT32_REF",r[r.DT_UINT8_REF=104]="DT_UINT8_REF",r[r.DT_INT16_REF=105]="DT_INT16_REF",r[r.DT_INT8_REF=106]="DT_INT8_REF",r[r.DT_STRING_REF=107]="DT_STRING_REF",r[r.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",r[r.DT_INT64_REF=109]="DT_INT64_REF",r[r.DT_BOOL_REF=110]="DT_BOOL_REF",r[r.DT_QINT8_REF=111]="DT_QINT8_REF",r[r.DT_QUINT8_REF=112]="DT_QUINT8_REF",r[r.DT_QINT32_REF=113]="DT_QINT32_REF",r[r.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",r[r.DT_QINT16_REF=115]="DT_QINT16_REF",r[r.DT_QUINT16_REF=116]="DT_QUINT16_REF",r[r.DT_UINT16_REF=117]="DT_UINT16_REF",r[r.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",r[r.DT_HALF_REF=119]="DT_HALF_REF",r[r.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",r[r.DT_VARIANT_REF=121]="DT_VARIANT_REF",r[r.DT_UINT32_REF=122]="DT_UINT32_REF",r[r.DT_UINT64_REF=123]="DT_UINT64_REF"})(fo||(fo={}));var xT;(function(r){let t;(function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"})(t=r.CheckpointFormatVersion||(r.CheckpointFormatVersion={}))})(xT||(xT={}));var dS={};function D5(r,t){let e={tfOpName:r,category:"custom",inputs:[],attrs:[],customExecutor:t};dS[r]=e}function uf(r){return dS[r]}function A5(r){delete dS[r]}function I(r,t,e,o,n){let s=t.inputParams[r];if(s&&s.inputIndexStart!==void 0){let i=s.inputIndexStart,p=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?i+1:s.inputIndexEnd,u=i<0?t.inputNames.length+i:i;if(s.type==="tensor")return Bt(t.inputNames[u],e,o,n);if(s.type==="tensors"){let m=t.inputs.slice(i,p);return t.inputNames.slice(i,p).filter((f,h)=>{var g;return((g=m[h])===null||g===void 0?void 0:g.op)!=="NoOp"}).map(f=>Bt(f,e,o,n))}let c=Bt(t.inputNames[u],e,o,n),l=c.dataSync();return s.type==="number"?l[0]:y.toNestedArray(c.shape,l)}let a=t.attrParams[r];return a&&a.value}function Bt(r,t,e,o){let[n,s]=Nr(r,e);if(o!=null){let i=o.getHashTableHandleByName(n);if(i!=null)return i}let a=e.currentContextIds.find(i=>!!t[pf(n,i)]);return a!==void 0?t[pf(n,a)][s]:void 0}function fS(r,t,e){return t[pf(r,e.currentContextId)]}function Ls(r,t){let[e,o,n]=Nr(r,t);return[pf(e,t&&t.currentContextId),o,n]}function pf(r,t){return t?`${r}-${t}`:r}function Nr(r,t){if(r==="")return["",0,void 0];let e=t!=null&&t.parseNodeNameCache!=null;if(e){let s=t.parseNodeNameCache.get(r);if(s!=null)return s}let o=r.split(":"),n;if(o.length===1)n=[r,0,void 0];else{let s=o[0],a=o.length===3?o[1]:void 0,i=Number(o[o.length-1]);n=[s,i,a]}return e&&t.parseNodeNameCache.set(r,n),n}function Al(r,t,e){let o=I("pad",r,t,e);if(o==="explicit"){o=I("explicitPaddings",r,t,e);let n=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)n[s][0]=o[s*2],n[s][1]=o[s*2+1];return n}return o}function Bs(r){return r.kept?r:Wr(r)}var hS={};qe(hS,{json:()=>F5});var F5=[{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}]}];var gS={};qe(gS,{json:()=>P5});var P5=[{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:"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}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}];var xS={};qe(xS,{json:()=>O5});var O5=[{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:"TensorListConcatV2",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"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}];var yS={};qe(yS,{json:()=>M5});var M5=[{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",defaultValue:.2}]},{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"}]}];var bS={};qe(bS,{json:()=>L5});var L5=[{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"}]},{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:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{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:"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:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,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"}]}];var CS={};qe(CS,{json:()=>B5});var B5=[{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}]}];var wS={};qe(wS,{json:()=>z5});var z5=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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"}]}];var SS={};qe(SS,{json:()=>V5});var V5=[{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"}]}];var IS={};qe(IS,{json:()=>W5});var W5=[{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"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}];var vS={};qe(vS,{json:()=>U5});var U5=[{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"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}];var kS={};qe(kS,{json:()=>G5});var G5=[{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}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}];var NS={};qe(NS,{json:()=>H5});var H5=[{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:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{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"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}];var TS={};qe(TS,{json:()=>K5});var K5=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{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"}]}];var _S={};qe(_S,{json:()=>q5});var q5=[{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"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",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"}]},{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"}]}];var $S={};qe($S,{json:()=>j5});var j5=[{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}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}];var ES={};qe(ES,{json:()=>X5});var X5=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}];var RS={};qe(RS,{json:()=>Y5});var Y5=[{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}]}];var DS={};qe(DS,{json:()=>Q5});var Q5=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}];var AS={};qe(AS,{json:()=>Z5});var Z5=[{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:"EnsureShape",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:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];var Fl=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let t=[hS,gS,xS,yS,bS,CS,wS,SS,IS,vS,kS,NS,TS,_S,$S,ES,RS,DS,AS],e=[].concat(...t.map(o=>o.json));this.opMappers=e.reduce((o,n)=>(o[n.tfOpName]=n,o),{})}transformGraph(t,e={}){let o=t.node,n=[],s=[],a=[],i=o.reduce((h,g)=>(h[g.name]=this.mapNode(g),g.op.startsWith("Placeholder")?n.push(h[g.name]):g.op==="Const"?s.push(h[g.name]):(g.input==null||g.input.length===0)&&a.push(h[g.name]),h),{}),p=[],u=[],c={},l={};e!=null&&(c=this.mapSignatureEntries(e.inputs),l=this.mapSignatureEntries(e.outputs));let m=Object.keys(i);m.forEach(h=>{let g=i[h];g.inputNames.forEach((x,b)=>{let[C,,S]=Ls(x),k=i[C];if(k.outputs!=null){let _=k.outputs.indexOf(S);if(_!==-1){let E=`${C}:${_}`;g.inputNames[b]=E}}g.inputs.push(k),k.children.push(g)})}),Object.keys(l).length===0?m.forEach(h=>{let g=i[h];g.children.length===0&&u.push(g)}):Object.keys(l).forEach(h=>{let[g]=Ls(h),x=i[g];x!=null&&(x.signatureKey=l[h],u.push(x))}),Object.keys(c).length>0?Object.keys(c).forEach(h=>{let[g]=Ls(h),x=i[g];x&&(x.signatureKey=c[h],p.push(x))}):p=n;let d={};t.library!=null&&t.library.function!=null&&(d=t.library.function.reduce((h,g)=>(h[g.signature.name]=this.mapFunction(g),h),{}));let f={nodes:i,inputs:p,outputs:u,weights:s,placeholders:n,signature:e,functions:d};return a.length>0&&(f.initNodes=a),f}mapSignatureEntries(t){return Object.keys(t||{}).reduce((e,o)=>(e[t[o].name]=o,e),{})}mapNode(t){let e=uf(t.op)||this.opMappers[t.op]||{};t.attr==null&&(t.attr={});let o={name:t.name,op:t.op,category:e.category,inputNames:(t.input||[]).map(n=>n.startsWith("^")?n.slice(1):n),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:t.attr,outputs:e.outputs};return e.inputs!=null&&(o.inputParams=e.inputs.reduce((n,s)=>(n[s.name]={type:s.type,inputIndexStart:s.start,inputIndexEnd:s.end},n),{})),e.attrs!=null&&(o.attrParams=e.attrs.reduce((n,s)=>{let a=s.type,i;switch(s.type){case"string":i=cf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=cf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"string[]":i=xf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=xf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"number":i=mf(t.attr,s.tfName,s.defaultValue||0),i===void 0&&s.tfDeprecatedName&&(i=mf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"number[]":i=gf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=gf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"bool":i=lf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=lf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"bool[]":i=bf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=bf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"shape":i=hf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=hf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"shape[]":i=yf(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=yf(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"dtype":i=df(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=df(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"dtype[]":i=ff(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=ff(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"func":i=yT(t.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=yT(t.attr,s.tfDeprecatedName,s.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${s.type} for op: ${t.op}`)}return n[s.name]={value:i,type:a},n},{})),o}mapFunction(t){let e=t.nodeDef,o=[],n=[],s={};e!=null&&(s=e.reduce((l,m)=>(l[m.name]=this.mapNode(m),m.op==="Const"&&n.push(l[m.name]),l),{}));let a=[],i=[];t.signature.inputArg.forEach(l=>{let[m]=Ls(l.name),d={name:m,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:FS(l.type),type:"dtype"}},children:[]};d.signatureKey=l.name,a.push(d),s[m]=d}),Object.keys(s).forEach(l=>{let m=s[l];m.inputNames.forEach((d,f)=>{let[h,,g]=Ls(d),x=s[h];if(x.outputs!=null){let b=x.outputs.indexOf(g);if(b!==-1){let C=`${h}:${b}`;m.inputNames[f]=C}}m.inputs.push(x),x.children.push(m)})});let u=t.ret;t.signature.outputArg.forEach(l=>{let[m,d]=Ls(u[l.name]),f=s[m];f!=null&&(f.defaultOutput=d,i.push(f))});let c=this.mapArgsToSignature(t);return{nodes:s,inputs:a,outputs:i,weights:n,placeholders:o,signature:c}}mapArgsToSignature(t){return{methodName:t.signature.name,inputs:t.signature.inputArg.reduce((e,o)=>(e[o.name]=this.mapArgToTensorInfo(o),e),{}),outputs:t.signature.outputArg.reduce((e,o)=>(e[o.name]=this.mapArgToTensorInfo(o,t.ret),e),{})}}mapArgToTensorInfo(t,e){let o=t.name;return e!=null&&(o=e[o]),{name:o,dtype:t.type}}};function J5(r){let t=A().global;if(typeof t.atob!="undefined")return t.atob(r);if(typeof Buffer!="undefined")return new Buffer(r,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function bT(r,t){let e=Array.isArray(r)?String.fromCharCode.apply(null,r):J5(r);return t?e:e.toLowerCase()}function cf(r,t,e,o=!1){let n=r[t];return n!=null?bT(n.s,o):e}function lf(r,t,e){let o=r[t];return o?o.b:e}function mf(r,t,e){let o=r[t]||{},n=o.i!=null?o.i:o.f!=null?o.f:e;return typeof n=="number"?n:parseInt(n,10)}function FS(r){switch(typeof r=="string"&&(r=fo[r]),r){case fo.DT_FLOAT:case fo.DT_HALF:return"float32";case fo.DT_INT32:case fo.DT_INT64:case fo.DT_INT8:case fo.DT_UINT8:return"int32";case fo.DT_BOOL:return"bool";case fo.DT_DOUBLE:return"float32";case fo.DT_STRING:return"string";default:return null}}function yT(r,t,e){let o=r[t];return o&&o.func?o.func.name:e}function df(r,t,e){let o=r[t];return o&&o.type?FS(o.type):e}function ff(r,t,e){let o=r[t];return o&&o.list&&o.list.type?o.list.type.map(n=>FS(n)):e}function CT(r){if(!r.unknownRank)return r.dim!=null?r.dim.map(t=>typeof t.size=="number"?t.size:parseInt(t.size,10)):[]}function hf(r,t,e){let o=r[t];return o&&o.shape?CT(o.shape):e}function gf(r,t,e){let o=r[t];return o?((o.list.f&&o.list.f.length?o.list.f:o.list.i)||[]).map(n=>typeof n=="number"?n:parseInt(n,10)):e}function xf(r,t,e,o=!1){let n=r[t];return n&&n.list&&n.list.s?n.list.s.map(s=>bT(s,o)):e}function yf(r,t,e){let o=r[t];return o&&o.list&&o.list.shape?o.list.shape.map(n=>CT(n)):e}function bf(r,t,e){let o=r[t];return o&&o.list&&o.list.b?o.list.b:e}var Cf=class{constructor(t,e,o){this.node=t,this.tensorMap=e,this.context=o,this.inputs=[],this.attrs={},this.inputs=t.inputNames.map(n=>this.getInput(n)),t.rawAttrs!=null&&(this.attrs=Object.keys(t.rawAttrs).reduce((n,s)=>(n[s]=this.getAttr(s),n),{}))}getInput(t){return Bt(t,this.tensorMap,this.context)}getAttr(t,e){let o=this.node.rawAttrs[t];if(o.tensor!=null)return Bt(t,this.tensorMap,this.context);if(o.i!=null||o.f!=null)return mf(this.node.rawAttrs,t,e);if(o.s!=null)return cf(this.node.rawAttrs,t,e);if(o.b!=null)return lf(this.node.rawAttrs,t,e);if(o.shape!=null)return hf(this.node.rawAttrs,t,e);if(o.type!=null)return df(this.node.rawAttrs,t,e);if(o.list!=null){if(o.list.i!=null||o.list.f!=null)return gf(this.node.rawAttrs,t,e);if(o.list.s!=null)return xf(this.node.rawAttrs,t,e);if(o.list.shape!=null)return yf(this.node.rawAttrs,t,e);if(o.list.b!=null)return bf(this.node.rawAttrs,t,e);if(o.list.type!=null)return ff(this.node.rawAttrs,t,e)}return e}};var Je={};qe(Je,{OP_SCOPE_SUFFIX:()=>kw,abs:()=>Qt,acos:()=>Nk,acosh:()=>Tk,add:()=>Ce,addN:()=>_k,all:()=>$k,any:()=>Ek,argMax:()=>Rk,argMin:()=>Dk,asin:()=>Ak,asinh:()=>Fk,atan:()=>Pk,atan2:()=>Ok,atanh:()=>Mk,avgPool:()=>md,avgPool3d:()=>zk,basicLSTMCell:()=>Vk,batchNorm:()=>ru,batchNorm2d:()=>Uk,batchNorm3d:()=>Gk,batchNorm4d:()=>Hk,batchToSpaceND:()=>dd,bincount:()=>fd,bitwiseAnd:()=>Kk,booleanMaskAsync:()=>E6,broadcastArgs:()=>qk,broadcastTo:()=>ou,buffer:()=>me,cast:()=>We,ceil:()=>jk,clipByValue:()=>Xk,clone:()=>Wr,complex:()=>$r,concat:()=>yt,concat1d:()=>Yk,concat2d:()=>Qk,concat3d:()=>Zk,concat4d:()=>Jk,conv1d:()=>e2,conv2d:()=>nu,conv2dTranspose:()=>t2,conv3d:()=>r2,conv3dTranspose:()=>n2,cos:()=>s2,cosh:()=>a2,cosineWindow:()=>_l,cumprod:()=>i2,cumsum:()=>u2,denseBincount:()=>p2,depthToSpace:()=>c2,depthwiseConv2d:()=>oc,diag:()=>l2,dilation2d:()=>m2,div:()=>je,divNoNan:()=>f2,dot:()=>h2,dropout:()=>W6,einsum:()=>su,elu:()=>yd,enclosingPowerOfTwo:()=>Qw,ensureShape:()=>g2,equal:()=>xd,erf:()=>x2,euclideanNorm:()=>C2,exp:()=>_o,expandDims:()=>Ms,expm1:()=>w2,eye:()=>bd,fft:()=>ac,fill:()=>Ea,floor:()=>Cd,floorDiv:()=>ld,fused:()=>Zw,gather:()=>wd,gatherND:()=>z6,greater:()=>zu,greaterEqual:()=>Sd,ifft:()=>Ku,imag:()=>iu,image:()=>Kj,inTopKAsync:()=>G6,irfft:()=>Gd,isFinite:()=>S2,isInf:()=>I2,isNaN:()=>v2,leakyRelu:()=>Id,less:()=>kl,lessEqual:()=>nc,linalg:()=>qj,linspace:()=>k2,localResponseNormalization:()=>N2,log:()=>ui,log1p:()=>vd,logSigmoid:()=>T2,logSoftmax:()=>_2,logSumExp:()=>Td,logicalAnd:()=>Vu,logicalNot:()=>_d,logicalOr:()=>$d,logicalXor:()=>$2,losses:()=>jj,lowerBound:()=>E2,matMul:()=>Ze,max:()=>Ra,maxPool:()=>Rd,maxPool3d:()=>R2,maxPoolWithArgmax:()=>D2,maximum:()=>Dd,mean:()=>Wu,meshgrid:()=>A2,min:()=>vl,minimum:()=>Uu,mirrorPad:()=>F2,mod:()=>P2,moments:()=>O2,movingAverage:()=>A6,mul:()=>se,multiRNNCell:()=>M2,multinomial:()=>L2,neg:()=>pr,norm:()=>Bu,notEqual:()=>Ad,oneHot:()=>Tl,ones:()=>Da,onesLike:()=>B2,op:()=>N,outerProduct:()=>z2,pad:()=>Aa,pad1d:()=>V2,pad2d:()=>W2,pad3d:()=>U2,pad4d:()=>G2,pool:()=>H2,pow:()=>ii,prelu:()=>Pd,print:()=>cd,prod:()=>K2,raggedGather:()=>q2,raggedRange:()=>j2,raggedTensorToTensor:()=>X2,rand:()=>Y2,randomGamma:()=>x1,randomNormal:()=>Vd,randomStandardNormal:()=>y1,randomUniform:()=>sc,randomUniformInt:()=>b1,range:()=>uu,real:()=>pi,reciprocal:()=>C1,relu:()=>pu,relu6:()=>Wd,reshape:()=>W,reverse:()=>lo,reverse1d:()=>w1,reverse2d:()=>S1,reverse3d:()=>I1,reverse4d:()=>v1,rfft:()=>ic,round:()=>Ud,rsqrt:()=>k1,scalar:()=>ke,scatterND:()=>P6,searchSorted:()=>Nl,selu:()=>N1,separableConv2d:()=>T1,setdiff1dAsync:()=>_1,sigmoid:()=>$a,sign:()=>$1,signal:()=>Hj,sin:()=>E1,sinh:()=>R1,slice:()=>Xe,slice1d:()=>D1,slice2d:()=>A1,slice3d:()=>F1,slice4d:()=>P1,softmax:()=>O1,softplus:()=>Nd,spaceToBatchND:()=>Fd,sparse:()=>Xj,sparseToDense:()=>L6,spectral:()=>Gj,split:()=>ci,sqrt:()=>Rr,square:()=>Zt,squaredDifference:()=>Hd,squeeze:()=>uc,stack:()=>vr,step:()=>Kd,stridedSlice:()=>M1,string:()=>Yj,sub:()=>Te,sum:()=>ot,tan:()=>L1,tanh:()=>Il,tensor:()=>ar,tensor1d:()=>Jt,tensor2d:()=>cu,tensor3d:()=>qd,tensor4d:()=>B1,tensor5d:()=>z1,tensor6d:()=>V1,tensorScatterUpdate:()=>U1,tile:()=>au,topk:()=>G1,transpose:()=>cc,truncatedNormal:()=>H1,unique:()=>K1,unsortedSegmentSum:()=>q1,unstack:()=>mo,upperBound:()=>j1,variable:()=>X1,where:()=>co,whereAsync:()=>Xd,zeros:()=>Ur,zerosLike:()=>Gt});var wT=(r,t,e,o=Je)=>{switch(r.op){case"BiasAdd":case"AddV2":case"Add":return[o.add(I("a",r,t,e),I("b",r,t,e))];case"AddN":return[o.addN(I("tensors",r,t,e))];case"FloorMod":case"Mod":return[o.mod(I("a",r,t,e),I("b",r,t,e))];case"Mul":return[o.mul(I("a",r,t,e),I("b",r,t,e))];case"RealDiv":case"Div":return[o.div(I("a",r,t,e),I("b",r,t,e))];case"DivNoNan":return[o.divNoNan(I("a",r,t,e),I("b",r,t,e))];case"FloorDiv":return[o.floorDiv(I("a",r,t,e),I("b",r,t,e))];case"Sub":return[o.sub(I("a",r,t,e),I("b",r,t,e))];case"Minimum":return[o.minimum(I("a",r,t,e),I("b",r,t,e))];case"Maximum":return[o.maximum(I("a",r,t,e),I("b",r,t,e))];case"Pow":return[o.pow(I("a",r,t,e),I("b",r,t,e))];case"SquaredDifference":return[o.squaredDifference(I("a",r,t,e),I("b",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var ST=(r,t,e,o=Je)=>{switch(r.op){case"Abs":case"ComplexAbs":return[o.abs(I("x",r,t,e))];case"Acos":return[o.acos(I("x",r,t,e))];case"Acosh":return[o.acosh(I("x",r,t,e))];case"Asin":return[o.asin(I("x",r,t,e))];case"Asinh":return[o.asinh(I("x",r,t,e))];case"Atan":return[o.atan(I("x",r,t,e))];case"Atan2":return[o.atan2(I("x",r,t,e),I("y",r,t,e))];case"Atanh":return[o.atanh(I("x",r,t,e))];case"Ceil":return[o.ceil(I("x",r,t,e))];case"Complex":return[o.complex(I("real",r,t,e),I("imag",r,t,e))];case"Cos":return[o.cos(I("x",r,t,e))];case"Cosh":return[o.cosh(I("x",r,t,e))];case"Elu":return[o.elu(I("x",r,t,e))];case"Erf":return[o.erf(I("x",r,t,e))];case"Exp":return[o.exp(I("x",r,t,e))];case"Expm1":return[o.expm1(I("x",r,t,e))];case"Floor":return[o.floor(I("x",r,t,e))];case"Log":return[o.log(I("x",r,t,e))];case"Log1p":return[o.log1p(I("x",r,t,e))];case"Imag":return[o.imag(I("x",r,t,e))];case"Neg":return[o.neg(I("x",r,t,e))];case"Reciprocal":return[o.reciprocal(I("x",r,t,e))];case"Real":return[o.real(I("x",r,t,e))];case"Relu":return[o.relu(I("x",r,t,e))];case"Round":return[o.round(I("x",r,t,e))];case"Selu":return[o.selu(I("x",r,t,e))];case"Sigmoid":return[o.sigmoid(I("x",r,t,e))];case"Sin":return[o.sin(I("x",r,t,e))];case"Sign":return[o.sign(I("x",r,t,e))];case"Sinh":return[o.sinh(I("x",r,t,e))];case"Softplus":return[o.softplus(I("x",r,t,e))];case"Sqrt":return[o.sqrt(I("x",r,t,e))];case"Square":return[o.square(I("x",r,t,e))];case"Tanh":return[o.tanh(I("x",r,t,e))];case"Tan":return[o.tan(I("x",r,t,e))];case"ClipByValue":return[o.clipByValue(I("x",r,t,e),I("clipValueMin",r,t,e),I("clipValueMax",r,t,e))];case"Relu6":return[o.relu6(I("x",r,t,e))];case"Rsqrt":return[o.rsqrt(Bt(r.inputNames[0],t,e))];case"LeakyRelu":return[o.leakyRelu(I("x",r,t,e),I("alpha",r,t,e))];case"Prelu":return[o.prelu(I("x",r,t,e),I("alpha",r,t,e))];case"IsNan":return[o.isNaN(Bt(r.inputNames[0],t,e))];case"IsInf":return[o.isInf(Bt(r.inputNames[0],t,e))];case"IsFinite":return[o.isFinite(Bt(r.inputNames[0],t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function Gr(r,t,e=""){if(!(typeof r=="number"||typeof t=="number")){y.assert(r.length===t.length,()=>e+` Shapes ${r} and ${t} must match`);for(let o=0;oe+` Shapes ${r} and ${t} must match`)}}}function IT(r){return!(typeof r=="number"||r.some(t=>t<0))}function mc(r,t,e){let o=wf(r,e),n=!IT(o);if(n&&t.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${o}`);if(n&&t.forEach(s=>{o=wf(s.shape,o)}),!IT(o))throw new Error(`Non-fully-defined elementShape: ${o}`);return o}function wf(r,t){if(typeof r=="number")return t;if(typeof t=="number")return r;if(r.length!==t.length)throw new Error(`Incompatible ranks during merge: ${r} vs. ${t}`);let e=[];for(let o=0;o=0&&s>=0&&n!==s)throw new Error(`Incompatible shape during merge: ${r} vs. ${t}`);e[o]=n>=0?n:s}return e}var Sf=class{constructor(t,e,o,n,s,a,i){this.name=t,this.dtype=e,this.maxSize=o,this.elementShape=n,this.identicalElementShapes=s,this.dynamicSize=a,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Er(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(t){this.tensors.forEach(e=>{(t==null||!t.has(e.tensor.id))&&e.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(t){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||t>=this.size())throw new Error(`Tried to read from index ${t}, but array size is: ${this.size()}`);let e=this.tensors[t];if(e.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${t} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(e.cleared=!0),e.read=!0,e.tensor}readMany(t){return t.map(e=>this.read(e))}write(t,e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(t<0||!this.dynamicSize&&t>=this.maxSize)throw new Error(`Tried to write to index ${t}, but array is not resizeable and size is: ${this.maxSize}`);let o=this.tensors[t]||{};if(e.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, - because the value dtype is ${e.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=e.shape),Gr(this.elementShape,e.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${t}.`),o.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been read.`);if(o.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${t}, because it has already been written.`);o.tensor=e,Er(e),o.written=!0,this.tensors[t]=o}writeMany(t,e){if(t.length!==e.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${t.length} is not the same as tensors size: ${e.length}.`);t.forEach((o,n)=>this.write(o,e[n]))}gather(t,e){if(e&&e!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${e}`);if(t)t=t.slice(0,this.size());else{t=[];for(let n=0;n=this.maxSize)throw new Error(`Max index must be < array size (${o} vs. ${this.maxSize})`);this.writeMany(t,mo(e,0))}split(t,e){if(e.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${e.dtype}`);let o=0,n=t.map(p=>(o+=p,o));if(o!==e.shape[0])throw new Error(`Expected sum of lengths to be equal to + ${s.shape}`);let a={data:o,indices:n,segmentIds:s};return _.runKernel(ka,a)}var _T=N({sparseSegmentSum_:m5});function d5(r,e,t,o,n,s,a,i){let p=v(r,"data","stringNGrams","string");if(p.dtype!=="string")throw new Error("Data must be of datatype string");if(p.shape.length!==1)throw new Error(`Data must be a vector, saw: ${p.shape}`);let u=v(e,"dataSplits","stringNGrams");if(u.dtype!=="int32")throw new Error("Data splits must be of datatype int32");let l={separator:t,nGramWidths:o,leftPad:n,rightPad:s,padWidth:a,preserveShortSequences:i},c={data:p,dataSplits:u},m=_.runKernel(Na,c,l);return{nGrams:m[0],nGramsSplits:m[1]}}var ET=N({stringNGrams_:d5});function f5(r,e,t=!0){let o=v(r,"input","stringSplit","string"),n=v(e,"delimiter","stringSplit","string");if(o.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${o.shape}`);if(n.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${n.shape}`);let s={skipEmpty:t},a={input:o,delimiter:n},i=_.runKernel(ru,a,s);return{indices:i[0],values:i[1],shape:i[2]}}var $T=N({stringSplit_:f5});function h5(r,e){let t=v(r,"input","stringToHashBucketFast","string"),o={numBuckets:e};if(e<=0)throw new Error("Number of buckets must be at least 1");let n={input:t};return _.runKernel(ou,n,o)}var RT=N({stringToHashBucketFast_:h5});function g5(r,e,t,o=!0){let n=v(r,"input","staticRegexReplace","string"),s={pattern:e,rewrite:t,replaceGlobal:o};return _.runKernel(pi,{x:n},s)}var DT=N({staticRegexReplace_:g5});var x5={fft:fl,ifft:ep,rfft:hl,irfft:tf},y5={hammingWindow:jN,hannWindow:uf,frame:pf,stft:XN},b5={flipLeftRight:QN,grayscaleToRGB:ZN,resizeNearestNeighbor:lT,resizeBilinear:pT,rgbToGrayscale:JN,rotateWithOffset:eT,cropAndResize:YN,nonMaxSuppression:tT,nonMaxSuppressionAsync:nT,nonMaxSuppressionWithScore:sT,nonMaxSuppressionWithScoreAsync:aT,nonMaxSuppressionPadded:iT,nonMaxSuppressionPaddedAsync:uT,threshold:cT,transform:mT},C5={bandPart:dT,gramSchmidt:fT,qr:gT},w5={absoluteDifference:xT,computeWeightedLoss:dr,cosineDistance:yT,hingeLoss:bT,huberLoss:CT,logLoss:wT,meanSquaredError:ST,sigmoidCrossEntropy:IT,softmaxCrossEntropy:vT},S5={sparseFillEmptyRows:kT,sparseReshape:NT,sparseSegmentMean:TT,sparseSegmentSum:_T},I5={stringNGrams:ET,stringSplit:$T,stringToHashBucketFast:RT,staticRegexReplace:DT};var AT={};qe(AT,{Serializable:()=>Lc,SerializationMap:()=>df,getRegisteredName:()=>k5,registerClass:()=>hS});var v5=new Map,fS=new Map,Lc=class{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}},df=class r{constructor(){this.classNameMap={}}static getMap(){return r.instance==null&&(r.instance=new r),r.instance}static register(e){r.getMap().classNameMap[e.className]=[e,e.fromConfig]}};function hS(r,e,t){$(r.className!=null,()=>"Class being registered does not have the static className property defined."),$(typeof r.className=="string",()=>"className is required to be a string, but got type "+typeof r.className),$(r.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),typeof e=="undefined"&&(e="Custom"),typeof t=="undefined"&&(t=r.className);let o=t,n=e+">"+o;return df.register(r),v5.set(n,r),fS.set(r,n),r}function k5(r){return fS.has(r)?fS.get(r):r.className}var _r=class extends Lc{minimize(e,t=!1,o){let{value:n,grads:s}=this.computeGradients(e,o);if(o!=null){let a=o.map(i=>({name:i.name,tensor:s[i.name]}));this.applyGradients(a)}else this.applyGradients(s);return Lt(s),t?n:(n.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return eS(e,t)}dispose(){this.iterations_!=null&&Lt(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(_r,Symbol.hasInstance,{value:r=>r.minimize!=null&&r.computeGradients!=null&&r.applyGradients!=null});var sp=class extends _r{static get className(){return"Adadelta"}constructor(e,t,o=null){super(),this.learningRate=e,this.rho=t,this.epsilon=o,this.accumulatedGrads=[],this.accumulatedUpdates=[],o==null&&(this.epsilon=_.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o],a=!1;this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accum_grad`,variable:De(()=>Kt(s).variable(a))}),this.accumulatedUpdates[n]==null&&(this.accumulatedUpdates[n]={originalName:`${o}/accum_var`,variable:De(()=>Kt(s).variable(a))});let i=Array.isArray(e)?e[n].tensor:e[o];if(i==null)return;let p=this.accumulatedGrads[n].variable,u=this.accumulatedUpdates[n].variable;De(()=>{let l=Ce(se(p,this.rho),se(tr(i),1-this.rho)),c=se(Xe(Pr(Ce(u,this.epsilon)),Pr(Ce(p,this.epsilon))),i),m=Ce(se(u,this.rho),se(tr(c),1-this.rho));p.assign(l),u.assign(m);let d=Ce(se(c,-this.learningRate),s);s.assign(d)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Lt(this.accumulatedGrads.map(e=>e.variable)),Lt(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,o=!1;this.accumulatedGrads=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedUpdates=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}};var ap=class extends _r{static get className(){return"Adagrad"}constructor(e,t=.1){super(),this.learningRate=e,this.initialAccumulatorValue=t,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o];this.accumulatedGrads[n]==null&&(this.accumulatedGrads[n]={originalName:`${o}/accumulator`,variable:De(()=>Ma(s.shape,this.initialAccumulatorValue).variable(!1))});let a=Array.isArray(e)?e[n].tensor:e[o];if(a==null)return;let i=this.accumulatedGrads[n].variable;De(()=>{let p=Ce(i,tr(a));i.assign(p);let u=Ce(se(Xe(a,Pr(Ce(p,_.backend.epsilon()))),-this.learningRate),s);s.assign(u)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Lt(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(o=>({originalName:o.name,variable:o.tensor.variable(t)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}};var ip=class extends _r{static get className(){return"Adam"}constructor(e,t,o,n=null){super(),this.learningRate=e,this.beta1=t,this.beta2=o,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],De(()=>{this.accBeta1=ke(t).variable(),this.accBeta2=ke(o).variable()}),n==null&&(this.epsilon=_.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(o=>o.name):Object.keys(e);De(()=>{let o=Te(1,this.accBeta1),n=Te(1,this.accBeta2);t.forEach((s,a)=>{let i=_.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:De(()=>Kt(i).variable(p))}),this.accumulatedSecondMoment[a]==null&&(this.accumulatedSecondMoment[a]={originalName:`${s}/v`,variable:De(()=>Kt(i).variable(p))});let u=Array.isArray(e)?e[a].tensor:e[s];if(u==null)return;let l=this.accumulatedFirstMoment[a].variable,c=this.accumulatedSecondMoment[a].variable,m=Ce(se(l,this.beta1),se(u,1-this.beta1)),d=Ce(se(c,this.beta2),se(tr(u),1-this.beta2)),f=Xe(m,o),h=Xe(d,n);l.assign(m),c.assign(d);let g=Ce(se(Xe(f,Ce(Pr(h),this.epsilon)),-this.learningRate),i);i.assign(g)}),this.accBeta1.assign(se(this.accBeta1,this.beta1)),this.accBeta2.assign(se(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Lt(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&Lt(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),De(()=>{this.accBeta1.assign(xi(this.beta1,this.iterations_+1)),this.accBeta2.assign(xi(this.beta2,this.iterations_+1))});let t=e.length/2,o=!1;this.accumulatedFirstMoment=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedSecondMoment=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)}))}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)}};var up=class extends _r{static get className(){return"Adamax"}constructor(e,t,o,n=null,s=0){super(),this.learningRate=e,this.beta1=t,this.beta2=o,this.epsilon=n,this.decay=s,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],De(()=>{this.iteration=ke(0).variable(),this.accBeta1=ke(t).variable()}),n==null&&(this.epsilon=_.backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(o=>o.name):Object.keys(e);De(()=>{let o=Te(1,this.accBeta1),n=Xe(-this.learningRate,Ce(se(this.iteration,this.decay),1));t.forEach((s,a)=>{let i=_.registeredVariables[s],p=!1;this.accumulatedFirstMoment[a]==null&&(this.accumulatedFirstMoment[a]={originalName:`${s}/m`,variable:Kt(i).variable(p)}),this.accumulatedWeightedInfNorm[a]==null&&(this.accumulatedWeightedInfNorm[a]={originalName:`${s}/v`,variable:Kt(i).variable(p)});let u=Array.isArray(e)?e[a].tensor:e[s];if(u==null)return;let l=this.accumulatedFirstMoment[a].variable,c=this.accumulatedWeightedInfNorm[a].variable,m=Ce(se(l,this.beta1),se(u,1-this.beta1)),d=se(c,this.beta2),f=er(u),h=Ud(d,f);l.assign(m),c.assign(h);let g=Ce(se(Xe(n,o),Xe(m,Ce(h,this.epsilon))),i);i.assign(g)}),this.iteration.assign(Ce(this.iteration,1)),this.accBeta1.assign(se(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Lt(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&Lt(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)}};var wi=class extends _r{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=Array.isArray(e)?e[n].tensor:e[o];if(s==null)return;let a=_.registeredVariables[o];De(()=>{let i=Ce(se(this.c,s),a);a.assign(i)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Fr(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)}};var pp=class extends wi{static get className(){return"Momentum"}constructor(e,t,o=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=o,this.accumulations=[],this.m=ke(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o];this.accumulations[n]==null&&(this.accumulations[n]={originalName:`${o}/momentum`,variable:De(()=>Kt(s).variable(!1))});let a=this.accumulations[n].variable,i=Array.isArray(e)?e[n].tensor:e[o];i!=null&&De(()=>{let p,u=Ce(se(this.m,a),i);this.useNesterov?p=Ce(se(this.c,Ce(i,se(u,this.m))),s):p=Ce(se(this.c,u),s),a.assign(u),s.assign(p)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Lt(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(o=>({originalName:o.name,variable:o.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)}};var lp=class extends _r{static get className(){return"RMSProp"}constructor(e,t=.9,o=0,n=null,s=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=o,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=s,n==null&&(this.epsilon=_.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(o=>o.name):Object.keys(e)).forEach((o,n)=>{let s=_.registeredVariables[o],a=!1;this.accumulatedMeanSquares[n]==null&&(this.accumulatedMeanSquares[n]={originalName:`${o}/rms`,variable:De(()=>Kt(s).variable(a))}),this.accumulatedMoments[n]==null&&(this.accumulatedMoments[n]={originalName:`${o}/momentum`,variable:De(()=>Kt(s).variable(a))}),this.accumulatedMeanGrads[n]==null&&this.centered&&(this.accumulatedMeanGrads[n]={originalName:`${o}/mg`,variable:De(()=>Kt(s).variable(a))});let i=Array.isArray(e)?e[n].tensor:e[o];if(i==null)return;let p=this.accumulatedMeanSquares[n].variable,u=this.accumulatedMoments[n].variable;De(()=>{let l=Ce(se(p,this.decay),se(tr(i),1-this.decay));if(this.centered){let c=this.accumulatedMeanGrads[n].variable,m=Ce(se(c,this.decay),se(i,1-this.decay)),d=Xe(se(i,this.learningRate),Pr(Te(l,Ce(tr(m),this.epsilon)))),f=Ce(se(u,this.momentum),d);p.assign(l),c.assign(m),u.assign(f);let h=Te(s,f);s.assign(h)}else{let c=Ce(se(p,this.decay),se(tr(i),1-this.decay)),m=Ce(se(u,this.momentum),Xe(se(i,this.learningRate),Pr(Ce(c,this.epsilon))));p.assign(c),u.assign(m);let d=Te(s,m);s.assign(d)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Lt(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Lt(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&Lt(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,o=!1;this.accumulatedMeanSquares=e.slice(0,t).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.accumulatedMoments=e.slice(t,t*2).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})),this.centered&&(this.accumulatedMeanGrads=e.slice(t*2,t*3).map(n=>({originalName:n.name,variable:n.tensor.variable(o)})))}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)}};var N5=[sp,ap,ip,up,pp,lp,wi];function FT(){for(let r of N5)hS(r)}var Si={};qe(Si,{CompositeArrayBuffer:()=>lr,browserFiles:()=>OT,browserHTTPRequest:()=>zT,concatenateArrayBuffers:()=>Zk,copyModel:()=>m1,decodeWeights:()=>hd,decodeWeightsStream:()=>gd,encodeWeights:()=>jk,fromMemory:()=>VT,fromMemorySync:()=>wS,getLoadHandlers:()=>r1,getModelArtifactsForJSON:()=>il,getModelArtifactsForJSONSync:()=>Uw,getModelArtifactsInfoForJSON:()=>$a,getSaveHandlers:()=>t1,getWeightSpecs:()=>Ec,http:()=>hf,isHTTPScheme:()=>ff,listModels:()=>l1,loadWeights:()=>LT,moveModel:()=>d1,registerLoadRouter:()=>e1,registerSaveRouter:()=>Jk,removeModel:()=>c1,weightsLoaderFactory:()=>bS,withSaveHandler:()=>WT,withSaveHandlerSync:()=>UT});var T5="model",_5=".json",E5=".weights.bin";function PT(r){return new Promise(e=>setTimeout(e)).then(r)}var bl=class r{constructor(e){if(!A().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(r.URL_SCHEME)&&(e=e.slice(r.URL_SCHEME.length)),(e==null||e.length===0)&&(e=T5),this.modelJsonFileName=e+_5,this.weightDataFileName=e+E5}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=lr.join(e.weightData),o=window.URL.createObjectURL(new Blob([t],{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}],s=xd(e,n),a=window.URL.createObjectURL(new Blob([JSON.stringify(s)],{type:"application/json"})),i=this.modelJsonAnchor==null?document.createElement("a"):this.modelJsonAnchor;if(i.download=this.modelJsonFileName,i.href=a,await PT(()=>i.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){let p=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;p.download=this.weightDataFileName,p.href=o,await PT(()=>p.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:$a(e)}}}};bl.URL_SCHEME="downloads://";var gS=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.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise((e,t)=>{let o=new FileReader;o.onload=n=>{let s=JSON.parse(n.target.result),a=s.modelTopology;if(a==null){t(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(s.weightsManifest==null){t(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){e({modelTopology:a});return}let p=il(s,u=>this.loadWeights(u));e(p)},o.onerror=n=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),o.readAsText(this.jsonFile)})}loadWeights(e){let t=[],o=[];for(let a of e)t.push(...a.weights),o.push(...a.paths);let n=this.checkManifestAndWeightFiles(e),s=o.map(a=>this.loadWeightsFile(a,n[a]));return Promise.all(s).then(a=>[t,a])}loadWeightsFile(e,t){return new Promise((o,n)=>{let s=new FileReader;s.onload=a=>{let i=a.target.result;o(i)},s.onerror=a=>n(`Failed to weights data from file of path '${e}'.`),s.readAsArrayBuffer(t)})}checkManifestAndWeightFiles(e){let t=[],o=this.weightsFiles.map(s=>Ww(s.name)),n={};for(let s of e)s.paths.forEach(a=>{let i=Ww(a);if(t.indexOf(i)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${i}'`);if(t.push(i),o.indexOf(i)===-1)throw new Error(`Weight file with basename '${i}' is not provided.`);n[a]=this.weightsFiles[o.indexOf(i)]});if(t.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}},$5=r=>A().getBool("IS_BROWSER")&&!Array.isArray(r)&&r.startsWith(bl.URL_SCHEME)?R5(r.slice(bl.URL_SCHEME.length)):null;Xt.registerSaveRouter($5);function R5(r="model"){return new bl(r)}function OT(r){return new gS(r)}function xS(r,e,t,o){a(r),t=t==null?0:t,o=o==null?1:o,i(t,o);let n=0,s=p=>(p.then(u=>{let l=t+ ++n/r.length*(o-t);return e(l),u}),p);function a(p){$(p!=null&&Array.isArray(p)&&p.length>0,()=>"promises must be a none empty array")}function i(p,u){$(p>=0&&p<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${p}`),$(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),$(u>=p,()=>`startFraction must be no more than endFraction, but got startFraction ${p} and endFraction ${u}`)}return Promise.all(r.map(s))}async function yS(r,e){e==null&&(e={});let t=e.fetchFunc==null?A().platform.fetch:e.fetchFunc,o=r.map(c=>t(c,e.requestInit,{isBinary:!0})),i=(e.onProgress==null?await Promise.all(o):await xS(o,e.onProgress,0,.5)).map(c=>c.arrayBuffer());return e.onProgress==null?await Promise.all(i):await xS(i,e.onProgress,.5,1)}function MT(r,e){var t;let o=e.fetchFunc==null?A().platform.fetch:e.fetchFunc,n=0,s;return(t=e.onProgress)===null||t===void 0||t.call(e,0),new ReadableStream({pull:async a=>{for(var i;nyS(a,{requestInit:o}))(r,e,t)}function bS(r){return async(e,t="",o)=>{let n=e.map(()=>!1),s={},a=o!=null?o.map(()=>!1):[],i=[];if(e.forEach((d,f)=>{let h=0;d.weights.forEach(g=>{let x="quantization"in g?g.quantization.dtype:g.dtype,b=fi[x]*ze(g.shape),w=()=>{n[f]=!0,s[f]==null&&(s[f]=[]),s[f].push({manifestEntry:g,groupOffset:h,sizeBytes:b})};o!=null?o.forEach((S,k)=>{S===g.name&&(w(),a[k]=!0)}):w(),i.push(g.name),h+=b})}),!a.every(d=>d)){let d=o.filter((f,h)=>!a[h]);throw new Error(`Could not find weights in manifest with names: ${d.join(", ")}. +Manifest JSON has weights with names: ${i.join(", ")}.`)}let p=n.reduce((d,f,h)=>(f&&d.push(h),d),[]),u=[];p.forEach(d=>{e[d].paths.forEach(f=>{let h=t+(t.endsWith("/")?"":"/")+f;u.push(h)})});let l=await r(u),c={},m=0;return p.forEach(d=>{let f=e[d].paths.length,h=new lr(l.slice(m,m+f));s[d].forEach(x=>{let b=h.slice(x.groupOffset,x.groupOffset+x.sizeBytes),w=hd(b,[x.manifestEntry]);for(let S in w)c[S]=w[S]}),m+=f}),c}}var D5="application/octet-stream",A5="application/json",Bc=class{constructor(e,t){if(this.DEFAULT_METHOD="POST",t==null&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,t.fetchFunc!=null?($(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=A().platform.fetch,$(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&$(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||{},this.loadOptions=t}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 o=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],n=xd(e,o);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:A5}),"model.json"),e.weightData!=null){let a=lr.join(e.weightData);t.body.append("model.weights.bin",new Blob([a],{type:D5}),"model.weights.bin")}let s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:$a(e),responses:[s]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){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(s){let a=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?a+=" 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.":a+=" Please make sure the server is serving valid JSON for this request.",new Error(a)}let o=t.modelTopology,n=t.weightsManifest;if(o==null&&n==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return t}async load(){if(this.loadOptions.streamWeights)return this.loadStream();let e=await this.loadModelJSON();return il(e,t=>this.loadWeights(t))}async loadStream(){let e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),o=Ec(e.weightsManifest),n=()=>MT(t,this.loadOptions);return Object.assign(Object.assign({},e),{weightSpecs:o,getWeightStream:n})}async getWeightUrls(e){let t=Array.isArray(this.path)?this.path[1]:this.path,[o,n]=F5(t),s=this.weightPathPrefix||o,a=[],i=[];for(let p of e)for(let u of p.paths)this.weightUrlConverter!=null?i.push(this.weightUrlConverter(u)):a.push(s+u+n);return this.weightUrlConverter&&a.push(...await Promise.all(i)),a}async loadWeights(e){let t=await this.getWeightUrls(e),o=Ec(e),n=await yS(t,this.loadOptions);return[o,n]}};Bc.URL_SCHEME_REGEX=/^https?:\/\//;function F5(r){let e=r.lastIndexOf("/"),t=r.lastIndexOf("?"),o=r.substring(0,e),n=t>e?r.substring(t):"";return[o+"/",n]}function ff(r){return r.match(Bc.URL_SCHEME_REGEX)!=null}var BT=(r,e)=>{if(typeof fetch=="undefined"&&(e==null||e.fetchFunc==null))return null;{let t=!0;if(Array.isArray(r)?t=r.every(o=>ff(o)):t=ff(r),t)return hf(r,e)}return null};Xt.registerSaveRouter(BT);Xt.registerLoadRouter(BT);function hf(r,e){return new Bc(r,e)}function zT(r,e){return hf(r,e)}var zc=class{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}},gf=class{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}},CS=class{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}};function VT(r,e,t,o){let n=arguments;return new CS(wS(...n))}function wS(r,e,t,o){return arguments.length===1?r.modelTopology!=null||r.weightSpecs!=null?new zc(r):(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 zc({modelTopology:r})):(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 zc({modelTopology:r,weightSpecs:e,weightData:t,trainingConfig:o}))}function WT(r){return new gf(r)}function UT(r){return new gf(r)}var HT={};qe(HT,{confusionMatrix:()=>GT});function P5(r,e,t){let o=v(r,"labels","confusionMatrix"),n=v(e,"predictions","confusionMatrix");$(t==null||t>0&&Number.isInteger(t),()=>`If provided, numClasses must be a positive integer, but got ${t}`),$(o.rank===1,()=>`Expected the rank of labels to be 1, but got ${o.rank}`),$(n.rank===1,()=>`Expected the rank of predictions to be 1, but got ${n.rank}`),$(o.shape[0]===n.shape[0],()=>`Mismatch in the number of examples: ${o.shape[0]} vs. ${n.shape[0]}. Labels and predictions should have the same number of elements.`),$(t>0&&Number.isInteger(t),()=>`numClasses is required to be a positive integer, but got ${t}`);let s=Oc(Ue(o,"int32"),t),a=Oc(Ue(n,"int32"),t),i=yl(s),p=Je(i,a);return Ue(p,"int32")}var GT=N({confusionMatrix_:P5});var XT={};qe(XT,{draw:()=>U5,fromPixels:()=>G5,fromPixelsAsync:()=>z5,toPixels:()=>W5});var cp,KT=!1;function qT(r,e=3){if(e>4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(r==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let t=!1,o=!1,n=!1,s=!1,a=!1,i=!1;if(r.data instanceof Uint8Array)t=!0;else if(typeof ImageData!="undefined"&&r instanceof ImageData)o=!0;else if(typeof HTMLVideoElement!="undefined"&&r instanceof HTMLVideoElement)n=!0;else if(typeof HTMLImageElement!="undefined"&&r instanceof HTMLImageElement)s=!0;else if(r.getContext!=null)a=!0;else if(typeof ImageBitmap!="undefined"&&r instanceof ImageBitmap)i=!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 ${r.constructor.name}`);if(tl(Lu,_.backendName)!=null){let f={pixels:r},h={numChannels:e};return _.runKernel(Lu,f,h)}let[u,l]=n?[r.videoWidth,r.videoHeight]:[r.width,r.height],c;if(a)c=r.getContext("2d").getImageData(0,0,u,l).data;else if(o||t)c=r.data;else if(s||n||i){if(cp==null)if(typeof document=="undefined")if(typeof OffscreenCanvas!="undefined"&&typeof OffscreenCanvasRenderingContext2D!="undefined")cp=new OffscreenCanvas(1,1).getContext("2d");else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");else cp=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});cp.canvas.width=u,cp.canvas.height=l,cp.drawImage(r,0,0,u,l),c=cp.getImageData(0,0,u,l).data}let m;if(e===4)m=new Int32Array(c);else{let f=u*l;m=new Int32Array(f*e);for(let h=0;h4||e===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${e}`);if(r.dtype!=="float32"&&r.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${r.dtype}. Please use float32 or int32 tensors.`)}function V5(r){let e=(r==null?void 0:r.alpha)||1;if(e>1||e<0)throw new Error(`Alpha value ${e} is suppoed to be in range [0 - 1].`)}async function W5(r,e){let t=v(r,"img","toPixels");if(!(r instanceof dt)){let u=t;t=Ue(u,"int32"),u.dispose()}jT(t);let[o,n]=t.shape.slice(0,2),s=t.rank===2?1:t.shape[2],a=await t.data(),i=t.dtype==="float32"?255:1,p=new Uint8ClampedArray(n*o*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${d}.`)}else if(t.dtype==="int32"&&(d<0||d>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${d}.`);s===1?(l[0]=d*i,l[1]=d*i,l[2]=d*i):l[m]=d*i}let c=u*4;p[c+0]=Math.round(l[0]),p[c+1]=Math.round(l[1]),p[c+2]=Math.round(l[2]),p[c+3]=Math.round(l[3])}if(e!=null){KT||tl(Mu,_.backendName)!=null&&(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),KT=!0),e.width=n,e.height=o;let u=e.getContext("2d"),l=new ImageData(p,n,o);u.putImageData(l,0,0)}return t!==r&&t.dispose(),p}function U5(r,e,t){let o=v(r,"img","draw");if(!(r instanceof dt)){let a=o;o=Ue(a,"int32"),a.dispose()}jT(o),V5(t==null?void 0:t.imageOptions);let n={image:o},s={canvas:e,options:t};_.runKernel(Mu,n,s)}var G5=N({fromPixels_:qT});var xf={};qe(xf,{prepareAndValidate:()=>YT});function YT(r,e){let t=r.shape.length,o=e.shape.length;if(t<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${t}.`);if(o<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${o}.`);if(e.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.shape[o-1]>t)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${e.shape[o-1]} vs. ${t}`);if(ze(r.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${r.shape}.`);let n=e.shape,s=n[n.length-1],a=1;for(let c=0;cc/u),1].slice(0,s);return[p,a,u,l]}var nt={};qe(nt,{assertParamsValid:()=>K5,computeFlatOffset:()=>Q5,computeOutShape:()=>j5,getNormalizedAxes:()=>X5,isSliceContinous:()=>Y5,maskToAxes:()=>q5,parseSliceParams:()=>Z5,sliceInfo:()=>J5,startForAxis:()=>n_,startIndicesWithElidedDims:()=>t_,stopForAxis:()=>s_,stopIndicesWithElidedDims:()=>r_,stridesForAxis:()=>o_,stridesWithElidedDims:()=>ZT});var SS=-2,H5=-1;function K5(r,e,t){let o=r.shape.length;$(o===e.length,()=>`Error in slice${o}D: Length of begin ${e} must match the rank of the array (${o}).`),$(o===t.length,()=>`Error in slice${o}D: Length of size ${t} must match the rank of the array (${o}).`);for(let n=0;n`Error in slice${o}D: begin[${n}] + size[${n}] (${e[n]+t[n]}) would overflow input.shape[${n}] (${r.shape[n]})`)}function q5(r){let e=[],t=0;for(;r>0;)r&1&&e.push(t),r/=2,t++;return e}function j5(r,e,t){let o=[];for(let n=0;n0){let d=e[0],f=t+1;l=t_(a,d,f,o,r),c=r_(i,d,f,n,r),m=ZT(s,d,f,r)}else for(let d=0;d-1)s[i]=0;else{let p=JT(e,t,i),u=o[p];r&1<-1)s[i]=Number.MAX_SAFE_INTEGER;else{let p=JT(e,t,i),u=o[p];r&1<0?a=Number.MIN_SAFE_INTEGER:a=Number.MAX_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),a=qp(0,a,p-1),a}function s_(r,e,t,o,n,s){let a=e[n],i=t[n]||1;(r&1<0?a=Number.MAX_SAFE_INTEGER:a=Number.MIN_SAFE_INTEGER);let p=o[n];return a<0&&(a+=p),i>0?a=qp(0,a,p):a=qp(-1,a,p-1),a}function Y5(r,e,t){let o=t.length;for(let n=0;n1){o=n;break}for(let n=o+1;n0||t[n]!==r[n])return!1;return!0}function Q5(r,e){let t=r.length>0?r[r.length-1]:1;for(let o=0;o{$(a!==-1,()=>"slice() does not support negative begin indexing.")});let s;return t==null?s=new Array(n).fill(-1):typeof t=="number"?s=[t,...new Array(n-1).fill(-1)]:t.lengtha>=0?a:($(a===-1,()=>`Negative size values should be exactly -1 but got ${a} for the slice() size at index ${i}.`),r.shape[i]-o[i])),[o,s]}function J5(r,e,t,o,n,s,a,i,p){let u;if(o==null?(u=new Array(e.length),u.fill(1)):u=o,a!=null&&a&a-1)throw new Error("Multiple ellipses in slice is not allowed.");let l=!1,c={dims:u.length,numAddAxisAfterEllipsis:0,begin:e.slice(),end:t.slice(),strides:u.slice(),beginMask:n,endMask:s,ellipsisMask:a,newAxisMask:i,shrinkAxisMask:p};for(let w=0;w0?0:-1,m.strides[w]>0?k:k-1];if(S&&m.strides[w]<=0)throw Error("only stride 1 allowed on non-range indexing.");h=h&&m.strides[w]===1;let R=!!(m.beginMask&1<=k)throw Error(`slice index ${m.begin[w]} of dimension ${w} out of bounds.`)}else m.begin[w]=QT(m.begin[w],0,m.strides[w],k,T,E),m.end[w]=QT(m.end[w],1,m.strides[w],k,T,E);let O=m.strides[w]===1&&m.begin[w]===0&&m.end[w]===k;d=d&&O,f=f&&(w===0&&m.strides[w]===1||O)}else d=d&&m.strides[w]===1&&R,f=f&&(w===0&&m.strides[w]===1||R);let D,F=!1;if(m.beginValid&&m.endValid?(D=m.end[w]-m.begin[w],F=!0):S?(D=1,F=!0):R&&k>=0&&(m.strides[w]<0?D=-k:D=k,F=!0),F){let O;D===0||D<0!=m.strides[w]<0?O=0:O=Math.trunc(D/m.strides[w])+(D%m.strides[w]!==0?1:0),g.push(O)}else g.push(-1)}for(let w=0;w=0?x.push(g[S]):S===SS&&x.push(1)}return{finalShapeSparse:x.filter((w,S)=>m.finalShapeGatherIndices[S]!==SS),finalShape:x,isIdentity:d,sliceDim0:f,isSimpleSlice:h,begin:m.begin,end:m.end,strides:m.strides}}function e8(r,e){e.beginMask=0,e.endMask=0,e.shrinkAxisMask=0;let t=0;e.beginValid=r.begin!=null,e.endValid=r.end!=null,e.begin=new Array(e.dims),e.end=new Array(e.dims),e.strides=new Array(e.dims),e.finalShapeGatherIndices=[],e.finalShapeGatherIndicesSparse=[],e.inputShapeGatherIndicesSparse=new Array(e.dims);for(let o=0;o0?s[e]:s[e+1&1];{let a=r<0?o+r:r;return as[1]?s[1]:a}}var t8="4.17.0";var Vc=class{static sgd(e){return new wi(e)}static momentum(e,t,o=!1){return new pp(e,t,o)}static rmsprop(e,t=.9,o=0,n=null,s=!1){return new lp(e,t,o,n,s)}static adam(e=.001,t=.9,o=.999,n=null){return new ip(e,t,o,n)}static adadelta(e=.001,t=.95,o=null){return new sp(e,t,o)}static adamax(e=.002,t=.9,o=.999,n=null,s=0){return new up(e,t,o,n,s)}static adagrad(e,t=.1){return new ap(e,t)}};var cHe=Vc;var r8=typeof requestAnimationFrame!="undefined"?requestAnimationFrame:typeof setImmediate!="undefined"?setImmediate:r=>r();function IS(){return new Promise(r=>r8(()=>r()))}var C={};qe(C,{ERF_A1:()=>b8,ERF_A2:()=>C8,ERF_A3:()=>w8,ERF_A4:()=>S8,ERF_A5:()=>I8,ERF_P:()=>y8,PARALLELIZE_THRESHOLD:()=>yf,RowPartitionType:()=>Va,SELU_SCALE:()=>x8,SELU_SCALEALPHA:()=>g8,applyActivation:()=>op,assertAndGetBroadcastShape:()=>rt,assertAxesAreInnerMostDims:()=>_q,assertParamsConsistent:()=>o8,assignToTypedArray:()=>E8,axesAreInnerMostDims:()=>Jw,calculateShapes:()=>DN,checkEinsumDimSizes:()=>P8,checkPadOnDimRoundingMode:()=>zt,combineLocations:()=>u2,combineRaggedTensorToTensorShapes:()=>s8,complexWithEvenIndex:()=>N8,complexWithOddIndex:()=>T8,computeConv2DInfo:()=>Ku,computeConv3DInfo:()=>_1,computeDefaultPad:()=>Zw,computeDilation2DInfo:()=>NK,computeOptimalWindowSize:()=>p8,computeOutAndReduceShapes:()=>Tq,computeOutShape:()=>n8,computePool2DInfo:()=>Qw,computePool3DInfo:()=>TK,convertConv2DDataFormat:()=>E1,decodeEinsumEquation:()=>A8,eitherStridesOrDilationsAreOne:()=>br,expandShapeToKeepDim:()=>gi,exponent:()=>R8,exponents:()=>$8,fromStringArrayToUint8:()=>rY,fromUint8ToStringArray:()=>tY,getAxesPermutation:()=>Eq,getBroadcastDims:()=>o2,getComplexWithIndex:()=>_8,getEinsumComputePath:()=>O8,getEinsumPermutation:()=>F8,getFusedBiasGradient:()=>rp,getFusedDyActivation:()=>tp,getImageCenter:()=>l8,getInnerMostAxes:()=>Rq,getPermuted:()=>m8,getRaggedRank:()=>i8,getReductionAxes:()=>Td,getReshaped:()=>c8,getReshapedPermuted:()=>d8,getRowPartitionTypesHelper:()=>a8,getSliceBeginCoords:()=>f8,getSliceSize:()=>h8,getSparseFillEmptyRowsIndicesDenseShapeMismatch:()=>z8,getSparseFillEmptyRowsNegativeIndexErrorMessage:()=>V8,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:()=>W8,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:()=>H8,getSparseReshapeInputOutputMismatchErrorMessage:()=>q8,getSparseReshapeInputOutputMultipleErrorMessage:()=>K8,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:()=>U8,getSparseReshapeNegativeOutputDimErrorMessage:()=>G8,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:()=>Q8,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:()=>j8,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:()=>X8,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:()=>Y8,getUndoAxesPermutation:()=>$q,isIdentityPermutation:()=>M8,log:()=>CH,mergeRealAndImagArrays:()=>v8,prepareAndValidate:()=>YT,prepareSplitSize:()=>B8,segment_util:()=>kS,shouldFuse:()=>np,slice_util:()=>nt,splitRealAndImagArrays:()=>k8,stridesOrDilationsArePositive:()=>Aa,tupleValuesAreOne:()=>Hu,upcastType:()=>pt,validateDefaultValueShape:()=>u8,validateInput:()=>xl,validateUpdateShape:()=>lS,warn:()=>Ea});function o8(r,e){let t=r[0].length;r.forEach((n,s)=>{$(n.length===t,()=>`Error in concat${t}D: rank of tensors[${s}] must be the same as the rank of the rest (${t})`)}),$(e>=0&&e`Error in concat${t}D: axis must be between 0 and ${t-1}.`);let o=r[0];r.forEach((n,s)=>{for(let a=0;a`Error in concat${t}D: Shape of tensors[${s}] (${n}) does not match the shape of the rest (${o}) along the non-concatenated axis ${s}.`)})}function n8(r,e){let t=r[0].slice();for(let o=1;o=0)if(i>=0){if(i!==s)throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.shape[${n+r}] = ${s} but shape[${n+r}] = ${i}`)}else o[a]=s}return o}function a8(r){let e={FIRST_DIM_SIZE:Va.FIRST_DIM_SIZE,VALUE_ROWIDS:Va.VALUE_ROWIDS,ROW_LENGTHS:Va.ROW_LENGTHS,ROW_SPLITS:Va.ROW_SPLITS,ROW_LIMITS:Va.ROW_LIMITS,ROW_STARTS:Va.ROW_STARTS},t=[];for(let o of r)if(o in e)t.push(e[o]);else break;return t}function i8(r){return r.length===0?0:r[0]===Va.FIRST_DIM_SIZE?r.length-1:r.length}function u8(r,e){if(r==null||e==null)return;let t=r.length,o=e.length;if(t>=o)throw new Error(`defaultValue.shape=${r} and ragged tensor flatValues.shape=${e}, are incompatible: defaultValue.rank = ${t} must be less than ragged tensor input flatValues.rank = ${o})`);for(let n=0;n=0&&a>=0&&s!==1&&s!==a)throw new Error(`defaultValue.shape=${r}, and ragged tensor input flatValues.shape=${e} are incompatible: defaultValue.shape[${n-r.length}] = ${s} but ragged tensor input.flatValues.shape[${n-r.length}] = ${a}`)}}var yf=30;function p8(r){return r<=yf?r:Xp(r,Math.floor(Math.sqrt(r)))}function l8(r,e,t){let o=t*(typeof r=="number"?r:r[0]),n=e*(typeof r=="number"?r:r[1]);return[o,n]}function c8(r,e,t,o=!0){let n=[];if(o)n=n.concat(e.slice(0)),n.push(r[0]/t),n=n.concat(r.slice(1));else{n=n.concat(r[0]);let s=e.length;for(let a=0;a=e*2+1||a%2===1?s.push(a):n.push(a);o.push(...n),o.push(0),o.push(...s)}return o}function d8(r,e,t,o=!0){let n=[];o?n.push(r[0]/t):n.push(r[0]*t);for(let s=1;s/g,a_=",",i_="...";function A8(r,e){r=r.replace(/\s/g,"");let t=(r.length-r.replace(D8,"").length)/vS.length;if(t<1)throw new Error("Equations without an arrow are not supported.");if(t>1)throw new Error(`Equation must contain exactly one arrow ("${vS}").`);let[o,n]=r.split(vS);$(o.indexOf(i_)===-1,()=>`The ellipsis notation ("${i_}") is not supported yet.`);let s=o.split(a_),a=s.length;if(e!==a)throw new Error(`Expected ${a} input tensors, received ${e}`);if(a>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");let i=[];for(let m=0;mf.indexOf(d)!==-1))throw new Error(`Output subscripts contain the label ${d} not present in the input subscripts.`);i.indexOf(d)===-1&&i.push(d)}for(let m=0;mn!==-1),{permutationIndices:t,expandDims:o}}function P8(r,e,t){let o=new Array(r);for(let n=0;n`Expected dimension ${o[e[n][a]]} at axis ${a} of input shaped ${JSON.stringify(s)}, but got dimension ${s[a]}`)}}function O8(r,e){let t=r,o=[],n=0;r.length===0&&t.push(-1),n=r.length+1;for(let a=0;ae===t)}function L8(r,e){let t=[];for(let o=0;o"Number of splits must evenly divide the axis."),o=new Array(e).fill(r.shape[t]/e);else{let n=e.reduce((a,i)=>(i===-1&&(a+=1),a),0);$(n<=1,()=>"There should be only one negative value in split array.");let s=e.indexOf(-1);if(s!==-1){let a=e.reduce((i,p)=>p>0?i+p:i);e[s]=r.shape[t]-a}$(r.shape[t]===e.reduce((a,i)=>a+i),()=>"The sum of sizes must match the size of the axis dimension."),o=e}return o}function z8(r){return`Received SparseTensor with denseShape[0] = 0 but + indices.shape[0] = ${r}`}function V8(r,e){return`indices(${r}, 0) is invalid: ${e} < 0`}function W8(r,e,t){return`indices(${r}, 0) is invalid: ${e} >= ${t}`}function U8(r,e){return`only one output dimension may be -1, not both ${r} and ${e}`}function G8(r,e){return`size ${r} must be non-negative, not ${e}`}function H8(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function K8(r,e){let t=ze(r),o=ze(e);return`Input to reshape is a SparseTensor with ${t} + dense values, but the requested shape requires a multiple of ${o}. inputShape=${r} outputShape= ${e}`}function q8(r,e){let t=ze(r),o=ze(e);return`Input to reshape is a tensor with ${t} dense values, but the requested shape has ${o}. inputShape=${r} outputShape=${e}`}function j8(){return"segment ids must be >= 0"}function X8(){return"segment ids are not increasing"}function Y8(r,e){return`Segment id ${r} out of range [0, ${e}), possibly because segmentIds input is not sorted.`}function Q8(r,e,t){return`Bad: indices[${r}] == ${e} out of range [0, ${t})`}var kS={};qe(kS,{collectGatherOpShapeInfo:()=>eY,computeOutShape:()=>J8,segOpComputeOptimalWindowSize:()=>Z8});function Z8(r,e){let t=!1,o;for(r<=yf?(o=r,t=!0):o=Xp(r,Math.floor(Math.sqrt(r)));!t;)o>e||o===r?t=!0:o=Xp(r,o+1);return o}function J8(r,e,t){let o=[],n=r.length;for(let s=0;sn))throw new Error(`Expect batchDims in the range of [-${n}, ${n}], but got ${o}`);if(o<0&&(o+=n),o>s)throw new Error(`batchDims (${o}) must be less than rank(x) ( + ${s}).`);if(tsl(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function rY(r){return r.map(e=>iu(e))}var Ut={};qe(Ut,{nonMaxSuppressionV3Impl:()=>lf,nonMaxSuppressionV4Impl:()=>cf,nonMaxSuppressionV5Impl:()=>mf,whereImpl:()=>sf});FT();var oY=A();oY.registerFlag("KEEP_INTERMEDIATE_TENSORS",()=>!1,r=>{r&&console.warn("Keep intermediate tensors is ON. This will print the values of all intermediate tensors during model inference. Not all models support this mode. For details, check e2e/benchmarks/ model_config.js. This significantly impacts performance.")});var Or;(function(r){r[r.DT_INVALID=0]="DT_INVALID",r[r.DT_FLOAT=1]="DT_FLOAT",r[r.DT_DOUBLE=2]="DT_DOUBLE",r[r.DT_INT32=3]="DT_INT32",r[r.DT_UINT8=4]="DT_UINT8",r[r.DT_INT16=5]="DT_INT16",r[r.DT_INT8=6]="DT_INT8",r[r.DT_STRING=7]="DT_STRING",r[r.DT_COMPLEX64=8]="DT_COMPLEX64",r[r.DT_INT64=9]="DT_INT64",r[r.DT_BOOL=10]="DT_BOOL",r[r.DT_QINT8=11]="DT_QINT8",r[r.DT_QUINT8=12]="DT_QUINT8",r[r.DT_QINT32=13]="DT_QINT32",r[r.DT_BFLOAT16=14]="DT_BFLOAT16",r[r.DT_QINT16=15]="DT_QINT16",r[r.DT_QUINT16=16]="DT_QUINT16",r[r.DT_UINT16=17]="DT_UINT16",r[r.DT_COMPLEX128=18]="DT_COMPLEX128",r[r.DT_HALF=19]="DT_HALF",r[r.DT_RESOURCE=20]="DT_RESOURCE",r[r.DT_VARIANT=21]="DT_VARIANT",r[r.DT_UINT32=22]="DT_UINT32",r[r.DT_UINT64=23]="DT_UINT64",r[r.DT_FLOAT_REF=101]="DT_FLOAT_REF",r[r.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",r[r.DT_INT32_REF=103]="DT_INT32_REF",r[r.DT_UINT8_REF=104]="DT_UINT8_REF",r[r.DT_INT16_REF=105]="DT_INT16_REF",r[r.DT_INT8_REF=106]="DT_INT8_REF",r[r.DT_STRING_REF=107]="DT_STRING_REF",r[r.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",r[r.DT_INT64_REF=109]="DT_INT64_REF",r[r.DT_BOOL_REF=110]="DT_BOOL_REF",r[r.DT_QINT8_REF=111]="DT_QINT8_REF",r[r.DT_QUINT8_REF=112]="DT_QUINT8_REF",r[r.DT_QINT32_REF=113]="DT_QINT32_REF",r[r.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF",r[r.DT_QINT16_REF=115]="DT_QINT16_REF",r[r.DT_QUINT16_REF=116]="DT_QUINT16_REF",r[r.DT_UINT16_REF=117]="DT_UINT16_REF",r[r.DT_COMPLEX128_REF=118]="DT_COMPLEX128_REF",r[r.DT_HALF_REF=119]="DT_HALF_REF",r[r.DT_RESOURCE_REF=120]="DT_RESOURCE_REF",r[r.DT_VARIANT_REF=121]="DT_VARIANT_REF",r[r.DT_UINT32_REF=122]="DT_UINT32_REF",r[r.DT_UINT64_REF=123]="DT_UINT64_REF"})(Or||(Or={}));var u_;(function(r){let e;(function(t){t[t.LEGACY=0]="LEGACY",t[t.V1=1]="V1",t[t.V2=2]="V2"})(e=r.CheckpointFormatVersion||(r.CheckpointFormatVersion={}))})(u_||(u_={}));var TS={};function sY(r,e){let t={tfOpName:r,category:"custom",inputs:[],attrs:[],customExecutor:e};TS[r]=t}function bf(r){return TS[r]}function aY(r){delete TS[r]}function I(r,e,t,o,n){let s=e.inputParams[r];if(s&&s.inputIndexStart!==void 0){let i=s.inputIndexStart,p=s.inputIndexEnd===0?void 0:s.inputIndexEnd===void 0?i+1:s.inputIndexEnd,u=i<0?e.inputNames.length+i:i;if(s.type==="tensor")return Vt(e.inputNames[u],t,o,n);if(s.type==="tensors"){let m=e.inputs.slice(i,p);return e.inputNames.slice(i,p).filter((f,h)=>{var g;return((g=m[h])===null||g===void 0?void 0:g.op)!=="NoOp"}).map(f=>Vt(f,t,o,n))}let l=Vt(e.inputNames[u],t,o,n),c=l.dataSync();return s.type==="number"?c[0]:y.toNestedArray(l.shape,c)}let a=e.attrParams[r];return a&&a.value}function Vt(r,e,t,o){let[n,s]=Er(r,t);if(o!=null){let i=o.getHashTableHandleByName(n);if(i!=null)return i}let a=t.currentContextIds.find(i=>!!e[Cf(n,i)]);return a!==void 0?e[Cf(n,a)][s]:void 0}function _S(r,e,t){return e[Cf(r,t.currentContextId)]}function qs(r,e){let[t,o,n]=Er(r,e);return[Cf(t,e&&e.currentContextId),o,n]}function Cf(r,e){return e?`${r}-${e}`:r}function Er(r,e){if(r==="")return["",0,void 0];let t=e!=null&&e.parseNodeNameCache!=null;if(t){let s=e.parseNodeNameCache.get(r);if(s!=null)return s}let o=r.split(":"),n;if(o.length===1)n=[r,0,void 0];else{let s=o[0],a=o.length===3?o[1]:void 0,i=Number(o[o.length-1]);n=[s,i,a]}return t&&e.parseNodeNameCache.set(r,n),n}function Wc(r,e,t){let o=I("pad",r,e,t);if(o==="explicit"){o=I("explicitPaddings",r,e,t);let n=[[0,0],[0,0],[0,0],[0,0]];for(let s=0;s<4;s++)n[s][0]=o[s*2],n[s][1]=o[s*2+1];return n}return o}function js(r){return r.kept?r:Xr(r)}var ES={};qe(ES,{json:()=>iY});var iY=[{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}]}];var $S={};qe($S,{json:()=>uY});var uY=[{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:"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}]},{tfOpName:"IsFinite",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"IsInf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}];var RS={};qe(RS,{json:()=>pY});var pY=[{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:"TensorListConcatV2",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"}]},{tfOpName:"TensorListLength",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}]},{tfOpName:"TensorListResize",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"size",type:"number"}]}];var DS={};qe(DS,{json:()=>lY});var lY=[{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",defaultValue:.2}]},{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"}]}];var AS={};qe(AS,{json:()=>cY});var cY=[{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"}]},{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:"RandomStandardNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"seed",name:"seed",type:"number",defaultValue:0},{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:"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:"RandomUniformInt",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number"},{tfName:"maxval",name:"maxval",type:"number"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,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"}]}];var FS={};qe(FS,{json:()=>mY});var mY=[{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}]}];var PS={};qe(PS,{json:()=>dY});var dY=[{tfOpName:"LowerBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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:"UpperBound",category:"evaluation",inputs:[{start:0,name:"sortedSequence",type:"tensor"},{start:1,name:"values",type:"tensor"}]},{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"}]}];var OS={};qe(OS,{json:()=>fY});var fY=[{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"}]}];var MS={};qe(MS,{json:()=>hY});var hY=[{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"}]},{tfOpName:"InitializeTable",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]},{tfOpName:"InitializeTableV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}]}];var LS={};qe(LS,{json:()=>gY});var gY=[{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"}]},{tfOpName:"ImageProjectiveTransformV3",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"transforms",type:"tensor"},{start:2,name:"outputShape",type:"number[]"},{start:3,name:"fillValue",type:"number"}],attrs:[{tfName:"interpolation",name:"interpolation",type:"string"},{tfName:"fill_mode",name:"fillMode",type:"string"}]}];var BS={};qe(BS,{json:()=>xY});var xY=[{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}]},{tfOpName:"BitwiseAnd",category:"logical",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}]}];var zS={};qe(zS,{json:()=>yY});var yY=[{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:"leakyrelu_alpha",name:"leakyreluAlpha",type:"number",defaultValue:.2},{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"}]},{tfOpName:"MatrixBandPart",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"numLower",type:"tensor"},{start:1,name:"numUpper",type:"tensor"}]}];var VS={};qe(VS,{json:()=>bY});var bY=[{tfOpName:"EuclideanNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",defaultValue:!1}]},{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"}]}];var WS={};qe(WS,{json:()=>CY});var CY=[{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"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cumprod",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"}]},{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"}]}];var US={};qe(US,{json:()=>wY});var wY=[{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}]},{tfOpName:"TensorScatterUpdate",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"values",type:"tensor"}]}];var GS={};qe(GS,{json:()=>SY});var SY=[{tfOpName:"SparseFillEmptyRows",category:"sparse",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"denseShape",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}]},{tfOpName:"SparseReshape",category:"sparse",inputs:[{start:0,name:"inputIndices",type:"tensor"},{start:1,name:"inputShape",type:"tensor"},{start:2,name:"newShape",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SparseSegmentMean",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]},{tfOpName:"SparseSegmentSum",category:"sparse",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"segmentIds",type:"tensor"}]}];var HS={};qe(HS,{json:()=>IY});var IY=[{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}]}];var KS={};qe(KS,{json:()=>vY});var vY=[{tfOpName:"StaticRegexReplace",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"pattern",name:"pattern",type:"string"},{tfName:"rewrite",name:"rewrite",type:"string"},{tfName:"replace_global",name:"replaceGlobal",type:"bool"}]},{tfOpName:"StringNGrams",category:"string",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"dataSplits",type:"tensor"}],attrs:[{tfName:"separator",name:"separator",type:"string"},{tfName:"ngram_widths",name:"nGramWidths",type:"number[]"},{tfName:"left_pad",name:"leftPad",type:"string"},{tfName:"right_pad",name:"rightPad",type:"string"},{tfName:"pad_width",name:"padWidth",type:"number"},{tfName:"preserve_short_sequences",name:"preserveShortSequences",type:"bool"}],outputs:["ngrams","ngrams_splits"]},{tfOpName:"StringSplit",category:"string",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"delimiter",type:"tensor"}],attrs:[{tfName:"skip_empty",name:"skipEmpty",type:"bool"}],outputs:["indices","values","shape"]},{tfOpName:"StringToHashBucketFast",category:"string",inputs:[{start:0,name:"input",type:"tensor"}],attrs:[{tfName:"num_buckets",name:"numBuckets",type:"number"}]}];var qS={};qe(qS,{json:()=>kY});var kY=[{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:"EnsureShape",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:[]},{tfOpName:"BroadcastArgs",category:"transformation",inputs:[{start:0,name:"s0",type:"tensor"},{start:1,name:"s1",type:"tensor"}],attrs:[]}];var Uc=class{static get Instance(){return this._instance||(this._instance=new this)}constructor(){let e=[ES,$S,RS,DS,AS,FS,PS,OS,MS,LS,BS,zS,VS,WS,US,GS,HS,KS,qS],t=[].concat(...e.map(o=>o.json));this.opMappers=t.reduce((o,n)=>(o[n.tfOpName]=n,o),{})}transformGraph(e,t={}){let o=e.node,n=[],s=[],a=[],i=o.reduce((h,g)=>(h[g.name]=this.mapNode(g),g.op.startsWith("Placeholder")?n.push(h[g.name]):g.op==="Const"?s.push(h[g.name]):(g.input==null||g.input.length===0)&&a.push(h[g.name]),h),{}),p=[],u=[],l={},c={};t!=null&&(l=this.mapSignatureEntries(t.inputs),c=this.mapSignatureEntries(t.outputs));let m=Object.keys(i);m.forEach(h=>{let g=i[h];g.inputNames.forEach((x,b)=>{let[w,,S]=qs(x),k=i[w];if(k.outputs!=null){let T=k.outputs.indexOf(S);if(T!==-1){let E=`${w}:${T}`;g.inputNames[b]=E}}g.inputs.push(k),k.children.push(g)})}),Object.keys(c).length===0?m.forEach(h=>{let g=i[h];g.children.length===0&&u.push(g)}):Object.keys(c).forEach(h=>{let[g]=qs(h),x=i[g];x!=null&&(x.signatureKey=c[h],u.push(x))}),Object.keys(l).length>0?Object.keys(l).forEach(h=>{let[g]=qs(h),x=i[g];x&&(x.signatureKey=l[h],p.push(x))}):p=n;let d={};e.library!=null&&e.library.function!=null&&(d=e.library.function.reduce((h,g)=>(h[g.signature.name]=this.mapFunction(g),h),{}));let f={nodes:i,inputs:p,outputs:u,weights:s,placeholders:n,signature:t,functions:d};return a.length>0&&(f.initNodes=a),f}mapSignatureEntries(e){return Object.keys(e||{}).reduce((t,o)=>(t[e[o].name]=o,t),{})}mapNode(e){let t=bf(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});let o={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(n=>n.startsWith("^")?n.slice(1):n),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:t.outputs};return t.inputs!=null&&(o.inputParams=t.inputs.reduce((n,s)=>(n[s.name]={type:s.type,inputIndexStart:s.start,inputIndexEnd:s.end},n),{})),t.attrs!=null&&(o.attrParams=t.attrs.reduce((n,s)=>{let a=s.type,i;switch(s.type){case"string":i=wf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=wf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"string[]":i=_f(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=_f(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"number":i=If(e.attr,s.tfName,s.defaultValue||0),i===void 0&&s.tfDeprecatedName&&(i=If(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"number[]":i=Tf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Tf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"bool":i=Sf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Sf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"bool[]":i=$f(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=$f(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"shape":i=Nf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Nf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"shape[]":i=Ef(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=Ef(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"dtype":i=vf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=vf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"dtype[]":i=kf(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=kf(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"func":i=p_(e.attr,s.tfName,s.defaultValue),i===void 0&&s.tfDeprecatedName&&(i=p_(e.attr,s.tfDeprecatedName,s.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${s.type} for op: ${e.op}`)}return n[s.name]={value:i,type:a},n},{})),o}mapFunction(e){let t=e.nodeDef,o=[],n=[],s={};t!=null&&(s=t.reduce((c,m)=>(c[m.name]=this.mapNode(m),m.op==="Const"&&n.push(c[m.name]),c),{}));let a=[],i=[];e.signature.inputArg.forEach(c=>{let[m]=qs(c.name),d={name:m,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:jS(c.type),type:"dtype"}},children:[]};d.signatureKey=c.name,a.push(d),s[m]=d}),Object.keys(s).forEach(c=>{let m=s[c];m.inputNames.forEach((d,f)=>{let[h,,g]=qs(d),x=s[h];if(x.outputs!=null){let b=x.outputs.indexOf(g);if(b!==-1){let w=`${h}:${b}`;m.inputNames[f]=w}}m.inputs.push(x),x.children.push(m)})});let u=e.ret;e.signature.outputArg.forEach(c=>{let[m,d]=qs(u[c.name]),f=s[m];f!=null&&(f.defaultOutput=d,i.push(f))});let l=this.mapArgsToSignature(e);return{nodes:s,inputs:a,outputs:i,weights:n,placeholders:o,signature:l}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((t,o)=>(t[o.name]=this.mapArgToTensorInfo(o),t),{}),outputs:e.signature.outputArg.reduce((t,o)=>(t[o.name]=this.mapArgToTensorInfo(o,e.ret),t),{})}}mapArgToTensorInfo(e,t){let o=e.name;return t!=null&&(o=t[o]),{name:o,dtype:e.type}}};function NY(r){let e=A().global;if(typeof e.atob!="undefined")return e.atob(r);if(typeof Buffer!="undefined")return new Buffer(r,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function l_(r,e){let t=Array.isArray(r)?String.fromCharCode.apply(null,r):NY(r);return e?t:t.toLowerCase()}function wf(r,e,t,o=!1){let n=r[e];return n!=null?l_(n.s,o):t}function Sf(r,e,t){let o=r[e];return o?o.b:t}function If(r,e,t){let o=r[e]||{},n=o.i!=null?o.i:o.f!=null?o.f:t;return typeof n=="number"?n:parseInt(n,10)}function jS(r){switch(typeof r=="string"&&(r=Or[r]),r){case Or.DT_FLOAT:case Or.DT_HALF:return"float32";case Or.DT_INT32:case Or.DT_INT64:case Or.DT_INT8:case Or.DT_UINT8:return"int32";case Or.DT_BOOL:return"bool";case Or.DT_DOUBLE:return"float32";case Or.DT_STRING:return"string";case Or.DT_COMPLEX64:case Or.DT_COMPLEX128:return"complex64";default:return null}}function p_(r,e,t){let o=r[e];return o&&o.func?o.func.name:t}function vf(r,e,t){let o=r[e];return o&&o.type?jS(o.type):t}function kf(r,e,t){let o=r[e];return o&&o.list&&o.list.type?o.list.type.map(n=>jS(n)):t}function c_(r){if(!r.unknownRank)return r.dim!=null?r.dim.map(e=>typeof e.size=="number"?e.size:parseInt(e.size,10)):[]}function Nf(r,e,t){let o=r[e];return o&&o.shape?c_(o.shape):t}function Tf(r,e,t){let o=r[e];return o?((o.list.f&&o.list.f.length?o.list.f:o.list.i)||[]).map(n=>typeof n=="number"?n:parseInt(n,10)):t}function _f(r,e,t,o=!1){let n=r[e];return n&&n.list&&n.list.s?n.list.s.map(s=>l_(s,o)):t}function Ef(r,e,t){let o=r[e];return o&&o.list&&o.list.shape?o.list.shape.map(n=>c_(n)):t}function $f(r,e,t){let o=r[e];return o&&o.list&&o.list.b?o.list.b:t}var Rf=class{constructor(e,t,o){this.node=e,this.tensorMap=t,this.context=o,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(n=>this.getInput(n)),e.rawAttrs!=null&&(this.attrs=Object.keys(e.rawAttrs).reduce((n,s)=>(n[s]=this.getAttr(s),n),{}))}getInput(e){return Vt(e,this.tensorMap,this.context)}getAttr(e,t){let o=this.node.rawAttrs[e];if(o.tensor!=null)return Vt(e,this.tensorMap,this.context);if(o.i!=null||o.f!=null)return If(this.node.rawAttrs,e,t);if(o.s!=null)return wf(this.node.rawAttrs,e,t);if(o.b!=null)return Sf(this.node.rawAttrs,e,t);if(o.shape!=null)return Nf(this.node.rawAttrs,e,t);if(o.type!=null)return vf(this.node.rawAttrs,e,t);if(o.list!=null){if(o.list.i!=null||o.list.f!=null)return Tf(this.node.rawAttrs,e,t);if(o.list.s!=null)return _f(this.node.rawAttrs,e,t);if(o.list.shape!=null)return Ef(this.node.rawAttrs,e,t);if(o.list.b!=null)return $f(this.node.rawAttrs,e,t);if(o.list.type!=null)return kf(this.node.rawAttrs,e,t)}return t}};var et={};qe(et,{OP_SCOPE_SUFFIX:()=>Bw,abs:()=>er,acos:()=>g1,acosh:()=>x1,add:()=>Ce,addN:()=>y1,all:()=>b1,any:()=>C1,argMax:()=>w1,argMin:()=>S1,asin:()=>I1,asinh:()=>v1,atan:()=>k1,atan2:()=>N1,atanh:()=>T1,avgPool:()=>Id,avgPool3d:()=>$1,basicLSTMCell:()=>R1,batchNorm:()=>mu,batchNorm2d:()=>A1,batchNorm3d:()=>F1,batchNorm4d:()=>P1,batchToSpaceND:()=>vd,bincount:()=>kd,bitwiseAnd:()=>O1,booleanMaskAsync:()=>oX,broadcastArgs:()=>M1,broadcastTo:()=>Oa,buffer:()=>ie,cast:()=>Ue,ceil:()=>L1,clipByValue:()=>B1,clone:()=>Xr,complex:()=>Ar,concat:()=>bt,concat1d:()=>z1,concat2d:()=>V1,concat3d:()=>W1,concat4d:()=>U1,conv1d:()=>G1,conv2d:()=>du,conv2dTranspose:()=>H1,conv3d:()=>K1,conv3dTranspose:()=>j1,cos:()=>X1,cosh:()=>Y1,cosineWindow:()=>Mc,cumprod:()=>Q1,cumsum:()=>Z1,denseBincount:()=>J1,depthToSpace:()=>e2,depthwiseConv2d:()=>cl,diag:()=>t2,dilation2d:()=>r2,div:()=>Xe,divNoNan:()=>n2,dot:()=>s2,dropout:()=>hX,einsum:()=>fu,elu:()=>Ed,enclosingPowerOfTwo:()=>cS,ensureShape:()=>a2,equal:()=>_d,erf:()=>i2,euclideanNorm:()=>l2,exp:()=>Jo,expandDims:()=>Ks,expm1:()=>c2,eye:()=>$d,fft:()=>fl,fill:()=>Ma,floor:()=>Rd,floorDiv:()=>Sd,fused:()=>mS,gather:()=>Dd,gatherND:()=>dX,greater:()=>ju,greaterEqual:()=>Ad,ifft:()=>ep,imag:()=>gu,image:()=>b5,inTopKAsync:()=>xX,irfft:()=>tf,isFinite:()=>m2,isInf:()=>d2,isNaN:()=>f2,leakyRelu:()=>Fd,less:()=>Fc,lessEqual:()=>ml,linalg:()=>C5,linspace:()=>h2,localResponseNormalization:()=>g2,log:()=>yi,log1p:()=>Pd,logSigmoid:()=>x2,logSoftmax:()=>y2,logSumExp:()=>Ld,logicalAnd:()=>Xu,logicalNot:()=>Bd,logicalOr:()=>zd,logicalXor:()=>b2,losses:()=>w5,lowerBound:()=>C2,matMul:()=>Je,max:()=>La,maxPool:()=>Wd,maxPool3d:()=>w2,maxPoolWithArgmax:()=>S2,maximum:()=>Ud,mean:()=>Yu,meshgrid:()=>I2,min:()=>Ac,minimum:()=>Qu,mirrorPad:()=>v2,mod:()=>k2,moments:()=>N2,movingAverage:()=>aX,mul:()=>se,multiRNNCell:()=>T2,multinomial:()=>_2,neg:()=>mr,norm:()=>qu,notEqual:()=>Gd,oneHot:()=>Oc,ones:()=>Ba,onesLike:()=>E2,op:()=>N,outerProduct:()=>$2,pad:()=>za,pad1d:()=>R2,pad2d:()=>D2,pad3d:()=>A2,pad4d:()=>F2,pool:()=>P2,pow:()=>xi,prelu:()=>Kd,print:()=>wd,prod:()=>O2,raggedGather:()=>M2,raggedRange:()=>L2,raggedTensorToTensor:()=>B2,rand:()=>z2,randomGamma:()=>iN,randomNormal:()=>Zd,randomStandardNormal:()=>uN,randomUniform:()=>dl,randomUniformInt:()=>pN,range:()=>xu,real:()=>bi,reciprocal:()=>lN,relu:()=>yu,relu6:()=>Jd,reshape:()=>W,reverse:()=>Bo,reverse1d:()=>cN,reverse2d:()=>mN,reverse3d:()=>dN,reverse4d:()=>fN,rfft:()=>hl,round:()=>ef,rsqrt:()=>hN,scalar:()=>ke,scatterND:()=>uX,searchSorted:()=>Pc,selu:()=>gN,separableConv2d:()=>xN,setdiff1dAsync:()=>yN,sigmoid:()=>Pa,sign:()=>bN,signal:()=>y5,sin:()=>CN,sinh:()=>wN,slice:()=>Ye,slice1d:()=>SN,slice2d:()=>IN,slice3d:()=>vN,slice4d:()=>kN,softmax:()=>NN,softplus:()=>Md,spaceToBatchND:()=>Hd,sparse:()=>S5,sparseToDense:()=>cX,spectral:()=>x5,split:()=>Ci,sqrt:()=>Pr,square:()=>tr,squaredDifference:()=>rf,squeeze:()=>gl,stack:()=>Tr,step:()=>of,stridedSlice:()=>TN,string:()=>I5,sub:()=>Te,sum:()=>ot,tan:()=>_N,tanh:()=>Dc,tensor:()=>pr,tensor1d:()=>rr,tensor2d:()=>bu,tensor3d:()=>nf,tensor4d:()=>EN,tensor5d:()=>$N,tensor6d:()=>RN,tensorScatterUpdate:()=>AN,tile:()=>hu,topk:()=>FN,transpose:()=>yl,truncatedNormal:()=>PN,unique:()=>ON,unsortedSegmentSum:()=>MN,unstack:()=>zo,upperBound:()=>LN,variable:()=>BN,where:()=>Lo,whereAsync:()=>af,zeros:()=>Yr,zerosLike:()=>Kt});var m_=(r,e,t,o=et)=>{switch(r.op){case"BiasAdd":case"AddV2":case"Add":return[o.add(I("a",r,e,t),I("b",r,e,t))];case"AddN":return[o.addN(I("tensors",r,e,t))];case"FloorMod":case"Mod":return[o.mod(I("a",r,e,t),I("b",r,e,t))];case"Mul":return[o.mul(I("a",r,e,t),I("b",r,e,t))];case"RealDiv":case"Div":return[o.div(I("a",r,e,t),I("b",r,e,t))];case"DivNoNan":return[o.divNoNan(I("a",r,e,t),I("b",r,e,t))];case"FloorDiv":return[o.floorDiv(I("a",r,e,t),I("b",r,e,t))];case"Sub":return[o.sub(I("a",r,e,t),I("b",r,e,t))];case"Minimum":return[o.minimum(I("a",r,e,t),I("b",r,e,t))];case"Maximum":return[o.maximum(I("a",r,e,t),I("b",r,e,t))];case"Pow":return[o.pow(I("a",r,e,t),I("b",r,e,t))];case"SquaredDifference":return[o.squaredDifference(I("a",r,e,t),I("b",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var d_=(r,e,t,o=et)=>{switch(r.op){case"Abs":case"ComplexAbs":return[o.abs(I("x",r,e,t))];case"Acos":return[o.acos(I("x",r,e,t))];case"Acosh":return[o.acosh(I("x",r,e,t))];case"Asin":return[o.asin(I("x",r,e,t))];case"Asinh":return[o.asinh(I("x",r,e,t))];case"Atan":return[o.atan(I("x",r,e,t))];case"Atan2":return[o.atan2(I("x",r,e,t),I("y",r,e,t))];case"Atanh":return[o.atanh(I("x",r,e,t))];case"Ceil":return[o.ceil(I("x",r,e,t))];case"Complex":return[o.complex(I("real",r,e,t),I("imag",r,e,t))];case"Cos":return[o.cos(I("x",r,e,t))];case"Cosh":return[o.cosh(I("x",r,e,t))];case"Elu":return[o.elu(I("x",r,e,t))];case"Erf":return[o.erf(I("x",r,e,t))];case"Exp":return[o.exp(I("x",r,e,t))];case"Expm1":return[o.expm1(I("x",r,e,t))];case"Floor":return[o.floor(I("x",r,e,t))];case"Log":return[o.log(I("x",r,e,t))];case"Log1p":return[o.log1p(I("x",r,e,t))];case"Imag":return[o.imag(I("x",r,e,t))];case"Neg":return[o.neg(I("x",r,e,t))];case"Reciprocal":return[o.reciprocal(I("x",r,e,t))];case"Real":return[o.real(I("x",r,e,t))];case"Relu":return[o.relu(I("x",r,e,t))];case"Round":return[o.round(I("x",r,e,t))];case"Selu":return[o.selu(I("x",r,e,t))];case"Sigmoid":return[o.sigmoid(I("x",r,e,t))];case"Sin":return[o.sin(I("x",r,e,t))];case"Sign":return[o.sign(I("x",r,e,t))];case"Sinh":return[o.sinh(I("x",r,e,t))];case"Softplus":return[o.softplus(I("x",r,e,t))];case"Sqrt":return[o.sqrt(I("x",r,e,t))];case"Square":return[o.square(I("x",r,e,t))];case"Tanh":return[o.tanh(I("x",r,e,t))];case"Tan":return[o.tan(I("x",r,e,t))];case"ClipByValue":return[o.clipByValue(I("x",r,e,t),I("clipValueMin",r,e,t),I("clipValueMax",r,e,t))];case"Relu6":return[o.relu6(I("x",r,e,t))];case"Rsqrt":return[o.rsqrt(Vt(r.inputNames[0],e,t))];case"LeakyRelu":return[o.leakyRelu(I("x",r,e,t),I("alpha",r,e,t))];case"Prelu":return[o.prelu(I("x",r,e,t),I("alpha",r,e,t))];case"IsNan":return[o.isNaN(Vt(r.inputNames[0],e,t))];case"IsInf":return[o.isInf(Vt(r.inputNames[0],e,t))];case"IsFinite":return[o.isFinite(Vt(r.inputNames[0],e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function Qr(r,e,t=""){if(!(typeof r=="number"||typeof e=="number")){y.assert(r.length===e.length,()=>t+` Shapes ${r} and ${e} must match`);for(let o=0;ot+` Shapes ${r} and ${e} must match`)}}}function f_(r){return!(typeof r=="number"||r.some(e=>e<0))}function Cl(r,e,t){let o=Df(r,t),n=!f_(o);if(n&&e.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${o}`);if(n&&e.forEach(s=>{o=Df(s.shape,o)}),!f_(o))throw new Error(`Non-fully-defined elementShape: ${o}`);return o}function Df(r,e){if(typeof r=="number")return e;if(typeof e=="number")return r;if(r.length!==e.length)throw new Error(`Incompatible ranks during merge: ${r} vs. ${e}`);let t=[];for(let o=0;o=0&&s>=0&&n!==s)throw new Error(`Incompatible shape during merge: ${r} vs. ${e}`);t[o]=n>=0?n:s}return t}var Af=class{constructor(e,t,o,n,s,a,i){this.name=e,this.dtype=t,this.maxSize=o,this.elementShape=n,this.identicalElementShapes=s,this.dynamicSize=a,this.clearAfterRead=i,this.tensors=[],this.closed_=!1,this.idTensor=ke(0),Fr(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 o=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),Qr(this.elementShape,t.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),o.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(o.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);o.tensor=t,Fr(t),o.written=!0,this.tensors[e]=o}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((o,n)=>this.write(o,t[n]))}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 n=0;n=this.maxSize)throw new Error(`Max index must be < array size (${o} vs. ${this.maxSize})`);this.writeMany(e,zo(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 o=0,n=e.map(p=>(o+=p,o));if(o!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${o}, and tensor's shape is: ${e.shape}`);if(!this.dynamicSize&&t.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${t.length}), and the TensorArray is not marked as dynamically resizeable`);let s=o===0?0:e.size/o,a=[];De(()=>{e=W(e,[1,o,s]);for(let p=0;p{if(o!==s.dtype)throw new Error(`Invalid data types; op elements ${o}, but list elements ${s.dtype}`);Gr(e,s.shape,"TensorList shape mismatch: "),Er(s)}),this.idTensor=ke(0),this.maxNumElements=n,Er(this.idTensor)}copy(){return new r([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(t){this.tensors.forEach(e=>{(t==null||!t.has(e.id))&&e.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(t,e,o=-1){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(o!==-1&&this.tensors.length!==o)throw new Error(`Operation expected a list with ${o} elements but got a list with ${this.tensors.length} elements.`);Gr(t,this.elementShape,"TensorList shape mismatch: ");let n=mc(this.elementShape,this.tensors,t);return De(()=>{let s=this.tensors.map(a=>W(a,n));return vr(s,0)})}popBack(t,e){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");let o=mc(this.elementShape,this.tensors,t),n=this.tensors.pop();return n.kept=!1,Gr(n.shape,t,"TensorList shape mismatch: "),W(n,o)}pushBack(t){if(t.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${this.elementDtype}`);if(Gr(t.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Er(t),this.tensors.push(t)}resize(t){if(t<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${t}`);if(this.maxNumElements!==-1&&t>this.maxNumElements)throw new Error(`TensorListResize input size ${t} is greater maxNumElement ${this.maxNumElements}.`);let e=new r([],this.elementShape,this.elementDtype,this.maxNumElements);e.tensors.length=t;for(let o=0;othis.tensors.length)throw new Error(`Trying to access element ${t} in a list with ${this.tensors.length} elements.`);if(this.tensors[t]==null)throw new Error(`element at index ${t} is null.`);Gr(this.tensors[t].shape,e,"TensorList shape mismatch: ");let n=mc(this.elementShape,this.tensors,e);return W(this.tensors[t],n)}setItem(t,e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(t<0||this.maxNumElements!==-1&&t>=this.maxNumElements)throw new Error(`Trying to set element ${t} in a list with max ${this.maxNumElements} elements.`);Gr(this.elementShape,e.shape,"TensorList shape mismatch: "),Er(e),this.tensors[t]!=null&&(this.tensors[t].kept=!1),this.tensors[t]=e}gather(t,e,o){if(e!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e}, but list elements ${this.elementDtype}`);Gr(this.elementShape,o,"TensorList shape mismatch: "),t=t.slice(0,this.size());let n=mc(this.elementShape,this.tensors,o);return t.length===0?ar([],[0].concat(n)):De(()=>{let s=t.map(a=>W(this.tensors[a],n));return vr(s,0)})}concat(t,e){if(t&&t!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${t}`);Gr(this.elementShape,e,"TensorList shape mismatch: ");let o=mc(this.elementShape,this.tensors,e);return this.size()===0?ar([],[0].concat(o)):De(()=>{let n=this.tensors.map(s=>W(s,o));return yt(n,0)})}};function vT(r,t,e){let o=r.dtype;if(r.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${r.shape}`);if(r.dtype!==e)throw new Error(`Invalid data types; op elements ${r.dtype}, but list elements ${e}`);let n=r.shape.slice(1);Gr(n,t,"TensorList shape mismatch: ");let s=mo(r);return new dc(s,t,o)}function kT(r,t,e,o){return new dc([],r,t,o)}function NT(r,t,e,o){if(t.length!==r.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${t.length} vs. ${r.shape[0]}`);let n=Math.max(...t);if(o!=null&&o!==-1&&n>=o)throw new Error(`Max index must be < array size (${n} vs. ${o})`);let s=new dc([],e,r.dtype,o),a=mo(r,0);return t.forEach((i,p)=>{s.setItem(i,a[p])}),s}function TT(r,t,e){let o=0,n=t.map(c=>(o+=c,o));if(o!==r.shape[0])throw new Error(`Expected sum of lengths to be equal to + ${o}, 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 s=o===0?0:t.size/o,a=[];De(()=>{t=W(t,[1,o,s]);for(let p=0;p{if(o!==s.dtype)throw new Error(`Invalid data types; op elements ${o}, but list elements ${s.dtype}`);Qr(t,s.shape,"TensorList shape mismatch: "),Fr(s)}),this.idTensor=ke(0),this.maxNumElements=n,Fr(this.idTensor)}copy(){return new r([...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,o=-1){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);if(o!==-1&&this.tensors.length!==o)throw new Error(`Operation expected a list with ${o} elements but got a list with ${this.tensors.length} elements.`);Qr(e,this.elementShape,"TensorList shape mismatch: ");let n=Cl(this.elementShape,this.tensors,e);return De(()=>{let s=this.tensors.map(a=>W(a,n));return Tr(s,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 o=Cl(this.elementShape,this.tensors,e),n=this.tensors.pop();return n.kept=!1,Qr(n.shape,e,"TensorList shape mismatch: "),W(n,o)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Qr(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Fr(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}.`);let t=new r([],this.elementShape,this.elementDtype,this.maxNumElements);t.tensors.length=e;for(let o=0;othis.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.`);Qr(this.tensors[e].shape,t,"TensorList shape mismatch: ");let n=Cl(this.elementShape,this.tensors,t);return W(this.tensors[e],n)}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.`);Qr(this.elementShape,t.shape,"TensorList shape mismatch: "),Fr(t),this.tensors[e]!=null&&(this.tensors[e].kept=!1),this.tensors[e]=t}gather(e,t,o){if(t!==this.elementDtype)throw new Error(`Invalid data types; op elements ${t}, but list elements ${this.elementDtype}`);Qr(this.elementShape,o,"TensorList shape mismatch: "),e=e.slice(0,this.size());let n=Cl(this.elementShape,this.tensors,o);return e.length===0?pr([],[0].concat(n)):De(()=>{let s=e.map(a=>W(this.tensors[a],n));return Tr(s,0)})}concat(e,t){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Qr(this.elementShape,t,"TensorList shape mismatch: ");let o=Cl(this.elementShape,this.tensors,t);return this.size()===0?pr([],[0].concat(o)):De(()=>{let n=this.tensors.map(s=>W(s,o));return bt(n,0)})}};function h_(r,e,t){let o=r.dtype;if(r.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${r.shape}`);if(r.dtype!==t)throw new Error(`Invalid data types; op elements ${r.dtype}, but list elements ${t}`);let n=r.shape.slice(1);Qr(n,e,"TensorList shape mismatch: ");let s=zo(r);return new wl(s,e,o)}function g_(r,e,t,o){return new wl([],r,e,o)}function x_(r,e,t,o){if(e.length!==r.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${r.shape[0]}`);let n=Math.max(...e);if(o!=null&&o!==-1&&n>=o)throw new Error(`Max index must be < array size (${n} vs. ${o})`);let s=new wl([],t,r.dtype,o),a=zo(r,0);return e.forEach((i,p)=>{s.setItem(i,a[p])}),s}function y_(r,e,t){let o=0,n=e.map(l=>(o+=l,o));if(o!==r.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${o}, and tensor's shape is: ${r.shape}`);let s=r.shape.slice(1),a=wf(s,e),i=o===0?0:r.size/o,p=De(()=>{let c=[];r=W(r,[1,o,i]);for(let l=0;l{switch(r.op){case"If":case"StatelessIf":{let o=I("thenBranch",r,t,e),n=I("elseBranch",r,t,e),s=I("cond",r,t,e),a=I("args",r,t,e);return(await s.data())[0]?e.functionMap[o].executeFunctionAsync(a,e.tensorArrayMap,e.tensorListMap):e.functionMap[n].executeFunctionAsync(a,e.tensorArrayMap,e.tensorListMap)}case"While":case"StatelessWhile":{let o=I("body",r,t,e),n=I("cond",r,t,e),s=I("args",r,t,e),a=await e.functionMap[n].executeFunctionAsync(s,e.tensorArrayMap,e.tensorListMap),i=s.map(c=>c.id),p=await a[0].data();a.forEach(c=>{!c.kept&&i.indexOf(c.id)===-1&&c.dispose()});let u=s;for(;p[0];){let c=u;u=await e.functionMap[o].executeFunctionAsync(u,e.tensorArrayMap,e.tensorListMap);let l=u.map(d=>d.id);c.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&l.indexOf(d.id)===-1&&d.dispose()});let m=await e.functionMap[n].executeFunctionAsync(u,e.tensorArrayMap,e.tensorListMap);p=await m[0].data(),m.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&l.indexOf(d.id)===-1&&d.dispose()})}return u}case"LoopCond":{let o=I("pred",r,t,e);return[Bs(o)]}case"Switch":{let o=I("pred",r,t,e),n=I("data",r,t,e);return n.kept||(n=Bs(n)),(await o.data())[0]?[void 0,n]:[n,void 0]}case"Merge":{let o=r.inputNames.find(n=>Bt(n,t,e)!==void 0);if(o){let n=Bt(o,t,e);return[Bs(n)]}return}case"Enter":{let o=I("frameName",r,t,e),n=I("tensor",r,t,e);return e.enterFrame(o),[Bs(n)]}case"Exit":{let o=I("tensor",r,t,e);return e.exitFrame(),[Bs(o)]}case"NextIteration":{let o=I("tensor",r,t,e);return e.nextIteration(),[Bs(o)]}case"TensorArrayV3":{let o=I("size",r,t,e),n=I("dtype",r,t,e),s=I("elementShape",r,t,e),a=I("dynamicSize",r,t,e),i=I("clearAfterRead",r,t,e),p=I("identicalElementShapes",r,t,e),u=I("name",r,t,e),c=new Sf(u,n,o,s,p,a,i);return e.addTensorArray(c),[c.idTensor,ke(1)]}case"TensorArrayWriteV3":{let o=I("tensorArrayId",r,t,e),n=I("index",r,t,e),s=I("tensor",r,t,e),a=e.getTensorArray(o.id);return a.write(n,s),[a.idTensor]}case"TensorArrayReadV3":{let o=I("tensorArrayId",r,t,e),n=I("index",r,t,e);return[e.getTensorArray(o.id).read(n)]}case"TensorArrayGatherV3":{let o=I("tensorArrayId",r,t,e),n=I("indices",r,t,e),s=I("dtype",r,t,e);return[e.getTensorArray(o.id).gather(n,s)]}case"TensorArrayScatterV3":{let o=I("tensorArrayId",r,t,e),n=I("indices",r,t,e),s=I("tensor",r,t,e),a=e.getTensorArray(o.id);return a.scatter(n,s),[a.idTensor]}case"TensorArrayConcatV3":{let o=I("tensorArrayId",r,t,e),n=e.getTensorArray(o.id),s=I("dtype",r,t,e);return[n.concat(s)]}case"TensorArraySplitV3":{let o=I("tensorArrayId",r,t,e),n=I("tensor",r,t,e),s=I("lengths",r,t,e),a=e.getTensorArray(o.id);return a.split(s,n),[a.idTensor]}case"TensorArraySizeV3":{let o=I("tensorArrayId",r,t,e),n=e.getTensorArray(o.id);return[ke(n.size(),"int32")]}case"TensorArrayCloseV3":{let o=I("tensorArrayId",r,t,e),n=e.getTensorArray(o.id);return n.clearAndClose(),[n.idTensor]}case"TensorListSetItem":{let o=I("tensorListId",r,t,e),n=I("index",r,t,e),s=I("tensor",r,t,e),a=e.getTensorList(o.id);return a.setItem(n,s),[a.idTensor]}case"TensorListGetItem":{let o=I("tensorListId",r,t,e),n=I("index",r,t,e),s=I("elementShape",r,t,e),a=I("elementDType",r,t,e);return[e.getTensorList(o.id).getItem(n,s,a)]}case"TensorListScatterV2":case"TensorListScatter":{let o=I("indices",r,t,e),n=I("tensor",r,t,e),s=I("elementShape",r,t,e),a=I("numElements",r,t,e),i=NT(n,o,s,a);return e.addTensorList(i),[i.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let o=I("elementShape",r,t,e),n=I("elementDType",r,t,e),s;r.op==="TensorListReserve"?s="numElements":s="maxNumElements";let a=I(s,r,t,e),i=r.op==="TensorListReserve"?-1:a,p=kT(o,n,a,i);return e.addTensorList(p),[p.idTensor]}case"TensorListGather":{let o=I("tensorListId",r,t,e),n=I("indices",r,t,e),s=I("elementShape",r,t,e),a=I("elementDType",r,t,e);return[e.getTensorList(o.id).gather(n,a,s)]}case"TensorListStack":{let o=I("tensorListId",r,t,e),n=I("elementShape",r,t,e),s=I("elementDType",r,t,e),a=I("numElements",r,t,e);return[e.getTensorList(o.id).stack(n,s,a)]}case"TensorListFromTensor":{let o=I("tensor",r,t,e),n=I("elementShape",r,t,e),s=I("elementDType",r,t,e),a=vT(o,n,s);return e.addTensorList(a),[a.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{let o=I("tensorListId",r,t,e),n=e.getTensorList(o.id),s=I("dtype",r,t,e),a=I("elementShape",r,t,e);return[n.concat(s,a)]}case"TensorListPushBack":{let o=I("tensorListId",r,t,e),n=I("tensor",r,t,e),s=e.getTensorList(o.id);return s.pushBack(n),[s.idTensor]}case"TensorListPopBack":{let o=I("tensorListId",r,t,e),n=I("elementShape",r,t,e),s=I("elementDType",r,t,e);return[e.getTensorList(o.id).popBack(n,s)]}case"TensorListSplit":{let o=I("tensor",r,t,e),n=I("elementShape",r,t,e),s=I("lengths",r,t,e),a=TT(o,s,n);return e.addTensorList(a),[a.idTensor]}case"TensorListLength":{let o=I("tensorListId",r,t,e),n=e.getTensorList(o.id);return[ke(n.size(),"int32")]}case"TensorListResize":{let o=I("tensorListId",r,t,e),n=I("size",r,t,e),a=e.getTensorList(o.id).resize(n);return e.addTensorList(a),[a.idTensor]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};function $T(r,t,e){let[o,n]=I("fusedOps",r,t,e),s=o==="biasadd",a=!s,i=n==="prelu",p=o==="fusedbatchnorm",u=I("numArgs",r,t,e);if(s){if(i&&u!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&s&&u!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(p)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let c=I("strides",r,t,e),l=Al(r,t,e),m=I("dataFormat",r,t,e).toUpperCase(),d=I("dilations",r,t,e),[f,h]=I("args",r,t,e);a&&(h=f,f=void 0);let g=I("leakyreluAlpha",r,t,e);return{stride:c,pad:l,dataFormat:m,dilations:d,biasArg:f,preluArg:h,activationFunc:n,leakyreluAlpha:g}}var ET=(r,t,e,o=Je)=>{switch(r.op){case"Conv1D":{let n=I("stride",r,t,e),s=I("pad",r,t,e),a=I("dataFormat",r,t,e).toUpperCase(),i=I("dilation",r,t,e);return[o.conv1d(I("x",r,t,e),I("filter",r,t,e),n,s,a,i)]}case"Conv2D":{let n=I("strides",r,t,e),s=Al(r,t,e),a=I("dataFormat",r,t,e).toUpperCase(),i=I("dilations",r,t,e);return[o.conv2d(I("x",r,t,e),I("filter",r,t,e),[n[1],n[2]],s,a,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:c,leakyreluAlpha:l}=$T(r,t,e);return[o.fused.conv2d({x:I("x",r,t,e),filter:I("filter",r,t,e),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:c,preluActivationWeights:u,leakyreluAlpha:l})]}case"FusedDepthwiseConv2dNative":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:c,leakyreluAlpha:l}=$T(r,t,e);return[o.fused.depthwiseConv2d({x:I("x",r,t,e),filter:I("filter",r,t,e),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:c,preluActivationWeights:u,leakyreluAlpha:l})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let n=I("outputShape",r,t,e),s=I("strides",r,t,e),a=Al(r,t,e);return[o.conv2dTranspose(I("x",r,t,e),I("filter",r,t,e),n,[s[1],s[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let n=I("strides",r,t,e),s=Al(r,t,e),a=I("dilations",r,t,e),i=I("dataFormat",r,t,e).toUpperCase();return[o.depthwiseConv2d(I("input",r,t,e),I("filter",r,t,e),[n[1],n[2]],s,i,[a[1],a[2]])]}case"Conv3D":{let n=I("strides",r,t,e),s=I("pad",r,t,e),a=I("dataFormat",r,t,e).toUpperCase(),i=I("dilations",r,t,e);return[o.conv3d(I("x",r,t,e),I("filter",r,t,e),[n[1],n[2],n[3]],s,a,[i[1],i[2],i[3]])]}case"AvgPool":{let n=I("strides",r,t,e),s=I("pad",r,t,e),a=I("kernelSize",r,t,e);return[o.avgPool(I("x",r,t,e),[a[1],a[2]],[n[1],n[2]],s)]}case"MaxPool":{let n=I("strides",r,t,e),s=I("pad",r,t,e),a=I("kernelSize",r,t,e);return[o.maxPool(I("x",r,t,e),[a[1],a[2]],[n[1],n[2]],s)]}case"MaxPoolWithArgmax":{let n=I("strides",r,t,e),s=I("pad",r,t,e),a=I("kernelSize",r,t,e),i=I("includeBatchInIndex",r,t,e),{result:p,indexes:u}=o.maxPoolWithArgmax(I("x",r,t,e),[a[1],a[2]],[n[1],n[2]],s,i);return[p,u]}case"AvgPool3D":{let n=I("strides",r,t,e),s=I("pad",r,t,e),a=I("kernelSize",r,t,e);return[o.avgPool3d(I("x",r,t,e),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case"MaxPool3D":{let n=I("strides",r,t,e),s=I("pad",r,t,e),a=I("kernelSize",r,t,e);return[o.maxPool3d(I("x",r,t,e),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case"Dilation2D":{let n=I("strides",r,t,e),s=I("pad",r,t,e),a=I("dilations",r,t,e),i=n[1],p=n[2],u=a[1],c=a[2];return[o.dilation2d(I("x",r,t,e),I("filter",r,t,e),[i,p],s,[u,c],"NHWC")]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var RT=(r,t,e,o=Je)=>{switch(r.op){case"Fill":{let n=I("shape",r,t,e),s=I("dtype",r,t,e),a=I("value",r,t,e);return[o.fill(n,a,s)]}case"LinSpace":{let n=I("start",r,t,e),s=I("stop",r,t,e),a=I("num",r,t,e);return[o.linspace(n,s,a)]}case"Multinomial":{let n=I("logits",r,t,e),s=I("numSamples",r,t,e),a=I("seed",r,t,e);return[o.multinomial(n,s,a)]}case"OneHot":{let n=I("indices",r,t,e),s=I("depth",r,t,e),a=I("onValue",r,t,e),i=I("offValue",r,t,e),p=I("dtype",r,t,e);return[o.oneHot(n,s,a,i,p)]}case"Ones":return[o.ones(I("shape",r,t,e),I("dtype",r,t,e))];case"OnesLike":return[o.onesLike(I("x",r,t,e))];case"RandomStandardNormal":return[o.randomStandardNormal(I("shape",r,t,e),I("dtype",r,t,e),I("seed",r,t,e))];case"RandomUniform":return[o.randomUniform(I("shape",r,t,e),I("minval",r,t,e),I("maxval",r,t,e),I("dtype",r,t,e))];case"RandomUniformInt":return[o.randomUniformInt(I("shape",r,t,e),I("minval",r,t,e),I("maxval",r,t,e),I("seed",r,t,e))];case"Range":{let n=I("start",r,t,e),s=I("stop",r,t,e),a=I("step",r,t,e);return[o.range(n,s,a,I("dtype",r,t,e))]}case"TruncatedNormal":{let n=I("shape",r,t,e),s=I("mean",r,t,e),a=I("stdDev",r,t,e),i=I("seed",r,t,e);return[o.truncatedNormal(n,s,a,I("dtype",r,t,e),i)]}case"Zeros":return[o.zeros(I("shape",r,t,e),I("dtype",r,t,e))];case"ZerosLike":return[o.zerosLike(I("x",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function PS(r,t,e){let o=I("boxes",r,t,e),n=I("scores",r,t,e),s=I("maxOutputSize",r,t,e),a=I("iouThreshold",r,t,e),i=I("scoreThreshold",r,t,e),p=I("softNmsSigma",r,t,e);return{boxes:o,scores:n,maxOutputSize:s,iouThreshold:a,scoreThreshold:i,softNmsSigma:p}}var DT=async(r,t,e,o,n=Je)=>{switch(r.op){case"NonMaxSuppressionV5":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u,softNmsSigma:c}=PS(r,t,e),l=await n.image.nonMaxSuppressionWithScoreAsync(s,a,i,p,u,c);return[l.selectedIndices,l.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=PS(r,t,e),c=I("padToMaxOutputSize",r,t,e),l=await n.image.nonMaxSuppressionPaddedAsync(s,a,i,p,u,c);return[l.selectedIndices,l.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=PS(r,t,e);return[await n.image.nonMaxSuppressionAsync(s,a,i,p,u)]}case"Where":{let s=n.cast(I("condition",r,t,e),"bool"),a=[await n.whereAsync(s)];return s.dispose(),a}case"ListDiff":return n.setdiff1dAsync(I("x",r,t,e),I("y",r,t,e));default:throw TypeError(`Node type ${r.op} is not implemented`)}};var AT=(r,t,e,o=Je)=>{switch(r.op){case"LowerBound":{let n=I("sortedSequence",r,t,e),s=I("values",r,t,e);return[o.lowerBound(n,s)]}case"TopKV2":{let n=I("x",r,t,e),s=I("k",r,t,e),a=I("sorted",r,t,e),i=o.topk(n,s,a);return[i.values,i.indices]}case"UpperBound":{let n=I("sortedSequence",r,t,e),s=I("values",r,t,e);return[o.upperBound(n,s)]}case"Unique":{let n=I("x",r,t,e),s=o.unique(n);return[s.values,s.indices]}case"UniqueV2":{let n=I("x",r,t,e),s=I("axis",r,t,e),a=o.unique(n,s);return[a.values,a.indices]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var FT=(r,t,e,o=Je)=>{switch(r.op){case"Const":return t[r.name];case"PlaceholderWithDefault":let n=I("default",r,t,e);return[Bt(r.name,t,e)||n];case"Placeholder":return[Bt(r.name,t,e)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let c=I("x",r,t,e);return[Bs(c)]}case"IdentityN":return I("x",r,t,e).map(c=>Bs(c));case"Snapshot":let s=I("x",r,t,e);return[Bs(s)];case"Shape":return[o.tensor1d(I("x",r,t,e).shape,"int32")];case"ShapeN":return I("x",r,t,e).map(c=>o.tensor1d(c.shape));case"Size":return[o.scalar(I("x",r,t,e).size,"int32")];case"Rank":return[o.scalar(I("x",r,t,e).rank,"int32")];case"NoOp":return[o.scalar(1)];case"Print":let a=I("x",r,t,e),i=I("data",r,t,e),p=I("message",r,t,e),u=I("summarize",r,t,e);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(p);for(let c=0;ct.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return ke(this.size(),"int32")}async import(t,e){this.checkKeyAndValueTensor(t,e);let o=await t.data();return this.tensorMap.forEach(n=>n.dispose()),this.tensorMap.clear(),De(()=>{let n=mo(e),s=o.length,a=n.length;y.assert(s===a,()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${a} elements.`);for(let i=0;i{let n=[];for(let s=0;s{switch(r.op){case"HashTable":case"HashTableV2":{let n=o.getHashTableHandleByName(r.name);if(n!=null)return[n];{let s=I("keyDType",r,t,e),a=I("valueDType",r,t,e),i=new If(s,a);return o.addHashTable(r.name,i),[i.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{let n=I("tableHandle",r,t,e,o),s=I("keys",r,t,e),a=I("values",r,t,e);return[await o.getHashTableById(n.id).import(s,a)]}case"LookupTableFind":case"LookupTableFindV2":{let n=I("tableHandle",r,t,e,o),s=I("keys",r,t,e),a=I("defaultValue",r,t,e);return[await o.getHashTableById(n.id).find(s,a)]}case"LookupTableSize":case"LookupTableSizeV2":{let n=I("tableHandle",r,t,e,o);return[o.getHashTableById(n.id).tensorSize()]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var OT=(r,t,e,o=Je)=>{switch(r.op){case"ResizeBilinear":{let n=I("images",r,t,e),s=I("size",r,t,e),a=I("alignCorners",r,t,e),i=I("halfPixelCenters",r,t,e);return[o.image.resizeBilinear(n,[s[0],s[1]],a,i)]}case"ResizeNearestNeighbor":{let n=I("images",r,t,e),s=I("size",r,t,e),a=I("alignCorners",r,t,e),i=I("halfPixelCenters",r,t,e);return[o.image.resizeNearestNeighbor(n,[s[0],s[1]],a,i)]}case"CropAndResize":{let n=I("image",r,t,e),s=I("boxes",r,t,e),a=I("boxInd",r,t,e),i=I("cropSize",r,t,e),p=I("method",r,t,e),u=I("extrapolationValue",r,t,e);return[o.image.cropAndResize(n,s,a,i,p,u)]}case"ImageProjectiveTransformV3":{let n=I("images",r,t,e),s=I("transforms",r,t,e),a=I("outputShape",r,t,e),i=I("fillValue",r,t,e),p=I("interpolation",r,t,e),u=I("fillMode",r,t,e);return[o.image.transform(n,s,p.toLowerCase(),u.toLowerCase(),i,a)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var MT=(r,t,e,o=Je)=>{switch(r.op){case"Equal":return[o.equal(I("a",r,t,e),I("b",r,t,e))];case"NotEqual":return[o.notEqual(I("a",r,t,e),I("b",r,t,e))];case"Greater":return[o.greater(I("a",r,t,e),I("b",r,t,e))];case"GreaterEqual":return[o.greaterEqual(I("a",r,t,e),I("b",r,t,e))];case"Less":return[o.less(I("a",r,t,e),I("b",r,t,e))];case"LessEqual":return[o.lessEqual(I("a",r,t,e),I("b",r,t,e))];case"LogicalAnd":return[o.logicalAnd(I("a",r,t,e),I("b",r,t,e))];case"LogicalNot":return[o.logicalNot(I("a",r,t,e))];case"LogicalOr":return[o.logicalOr(I("a",r,t,e),I("b",r,t,e))];case"Select":case"SelectV2":return[o.where(I("condition",r,t,e),I("a",r,t,e),I("b",r,t,e))];case"BitwiseAnd":return[o.bitwiseAnd(I("a",r,t,e),I("b",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var LT=(r,t,e,o=Je)=>{switch(r.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[o.matMul(I("a",r,t,e),I("b",r,t,e),I("transposeA",r,t,e),I("transposeB",r,t,e))];case"Einsum":return[o.einsum(I("equation",r,t,e),...I("tensors",r,t,e))];case"Transpose":return[o.transpose(I("x",r,t,e),I("perm",r,t,e))];case"_FusedMatMul":let[n,s]=I("fusedOps",r,t,e),a=n==="biasadd",i=s==="prelu",p=I("numArgs",r,t,e),u=I("leakyreluAlpha",r,t,e);if(a){if(i&&p!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&p!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[c,l]=I("args",r,t,e);return[o.fused.matMul({a:I("a",r,t,e),b:I("b",r,t,e),transposeA:I("transposeA",r,t,e),transposeB:I("transposeB",r,t,e),bias:c,activation:s,preluActivationWeights:l,leakyreluAlpha:u})];case"MatrixBandPart":return[o.linalg.bandPart(I("a",r,t,e),I("numLower",r,t,e),I("numUpper",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var BT=(r,t,e,o=Je)=>{switch(r.op){case"EuclideanNorm":return[o.euclideanNorm(I("x",r,t,e),I("axis",r,t,e),I("keepDims",r,t,e))];case"FusedBatchNorm":case"FusedBatchNormV2":return[o.batchNorm(I("x",r,t,e),I("mean",r,t,e),I("variance",r,t,e),I("offset",r,t,e),I("scale",r,t,e),I("epsilon",r,t,e))];case"FusedBatchNormV3":return[o.batchNorm(I("x",r,t,e),I("mean",r,t,e),I("variance",r,t,e),I("offset",r,t,e),I("scale",r,t,e),I("epsilon",r,t,e))];case"LRN":return[o.localResponseNormalization(I("x",r,t,e),I("radius",r,t,e),I("bias",r,t,e),I("alpha",r,t,e),I("beta",r,t,e))];case"Softmax":return[o.softmax(I("x",r,t,e))];case"LogSoftmax":return[o.logSoftmax(I("x",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var zT=(r,t,e,o=Je)=>{switch(r.op){case"RaggedGather":{let{outputNestedSplits:n,outputDenseValues:s}=o.raggedGather(I("paramsNestedSplits",r,t,e),I("paramsDenseValues",r,t,e),I("indices",r,t,e),I("outputRaggedRank",r,t,e));return n.concat(s)}case"RaggedRange":{let{rtNestedSplits:n,rtDenseValues:s}=o.raggedRange(I("starts",r,t,e),I("limits",r,t,e),I("splits",r,t,e));return[n,s]}case"RaggedTensorToTensor":return[o.raggedTensorToTensor(I("shape",r,t,e),I("values",r,t,e),I("defaultValue",r,t,e),I("rowPartitionTensors",r,t,e),I("rowPartitionTypes",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var VT=(r,t,e,o=Je)=>{switch(r.op){case"Max":{let i=I("axis",r,t,e),p=I("keepDims",r,t,e);return[o.max(I("x",r,t,e),i,p)]}case"Mean":{let i=I("axis",r,t,e),p=I("keepDims",r,t,e);return[o.mean(I("x",r,t,e),i,p)]}case"Min":{let i=I("axis",r,t,e),p=I("keepDims",r,t,e);return[o.min(I("x",r,t,e),i,p)]}case"Sum":{let i=I("axis",r,t,e),p=I("keepDims",r,t,e);return[o.sum(I("x",r,t,e),i,p)]}case"All":{let i=I("axis",r,t,e),p=I("keepDims",r,t,e);return[o.all(I("x",r,t,e),i,p)]}case"Any":{let i=I("axis",r,t,e),p=I("keepDims",r,t,e);return[o.any(I("x",r,t,e),i,p)]}case"ArgMax":{let i=I("axis",r,t,e);return[o.argMax(I("x",r,t,e),i)]}case"ArgMin":{let i=I("axis",r,t,e);return[o.argMin(I("x",r,t,e),i)]}case"Prod":{let i=I("axis",r,t,e),p=I("keepDims",r,t,e);return[o.prod(I("x",r,t,e),i,p)]}case"Cumprod":{let i=I("axis",r,t,e),p=I("exclusive",r,t,e),u=I("reverse",r,t,e);return[o.cumprod(I("x",r,t,e),i,p,u)]}case"Cumsum":{let i=I("axis",r,t,e),p=I("exclusive",r,t,e),u=I("reverse",r,t,e);return[o.cumsum(I("x",r,t,e),i,p,u)]}case"Bincount":let n=I("x",r,t,e),s=I("weights",r,t,e),a=I("size",r,t,e);return[o.bincount(n,s,a)];case"DenseBincount":{let i=I("x",r,t,e),p=I("weights",r,t,e),u=I("size",r,t,e),c=I("binaryOutput",r,t,e);return[o.denseBincount(i,p,u,c)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var WT=(r,t,e,o=Je)=>{switch(r.op){case"ConcatV2":case"Concat":{let n=I("n",r,t,e),s=I("axis",r,t,e),a=I("tensors",r,t,e);return a=a.slice(0,n),[o.concat(a,s)]}case"Gather":{let n=I("x",r,t,e),s=I("indices",r,t,e);return[o.gather(n,o.cast(s,"int32"),0)]}case"GatherV2":{let n=I("axis",r,t,e),s=I("batchDims",r,t,e),a=I("x",r,t,e),i=I("indices",r,t,e);return[o.gather(a,o.cast(i,"int32"),n,s)]}case"Reverse":{let n=I("dims",r,t,e),s=[];for(let i=0;i{let n=I("axis",r,t,e),s=I("tensors",r,t,e),a=s[0].shape,i=o.squeeze(s[0]).shape,p=s.map(u=>{let c=y.arraysEqual(u.shape,a);if(!c&&!y.arraysEqual(o.squeeze(u).shape,i))throw new Error("the input tensors shape does not match");return c?u:o.reshape(u,a)});return[o.stack(p,n)]});case"Unpack":{let n=I("axis",r,t,e),s=I("tensor",r,t,e);return o.unstack(s,n)}case"Tile":{let n=I("reps",r,t,e);return[o.tile(I("x",r,t,e),n)]}case"Split":case"SplitV":{let n=I("axis",r,t,e),s=I("numOrSizeSplits",r,t,e),a=I("x",r,t,e);return o.split(a,s,n)}case"ScatterNd":{let n=I("indices",r,t,e),s=I("values",r,t,e),a=I("shape",r,t,e);return[o.scatterND(n,s,a)]}case"GatherNd":{let n=I("x",r,t,e),s=I("indices",r,t,e);return[o.gatherND(n,s)]}case"SparseToDense":{let n=I("sparseIndices",r,t,e),s=I("outputShape",r,t,e),a=I("sparseValues",r,t,e),i=I("defaultValue",r,t,e);return[o.sparseToDense(n,a,s,a.dtype===i.dtype?i:o.cast(i,a.dtype))]}case"TensorScatterUpdate":{let n=I("indices",r,t,e),s=I("values",r,t,e),a=I("tensor",r,t,e);return[o.tensorScatterUpdate(a,n,s)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var UT=(r,t,e,o=Je)=>{switch(r.op){case"SparseFillEmptyRows":{let{outputIndices:n,outputValues:s,emptyRowIndicator:a,reverseIndexMap:i}=o.sparse.sparseFillEmptyRows(I("indices",r,t,e),I("values",r,t,e),I("denseShape",r,t,e),I("defaultValue",r,t,e));return[n,s,a,i]}case"SparseReshape":{let{outputIndices:n,outputShape:s}=o.sparse.sparseReshape(I("inputIndices",r,t,e),I("inputShape",r,t,e),I("newShape",r,t,e));return[n,s]}case"SparseSegmentMean":return[o.sparse.sparseSegmentMean(I("data",r,t,e),I("indices",r,t,e),I("segmentIds",r,t,e))];case"SparseSegmentSum":return[o.sparse.sparseSegmentSum(I("data",r,t,e),I("indices",r,t,e),I("segmentIds",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var GT=(r,t,e,o=Je)=>{switch(r.op){case"FFT":return[o.fft(I("x",r,t,e))];case"IFFT":return[o.ifft(I("x",r,t,e))];case"RFFT":return[o.rfft(I("x",r,t,e))];case"IRFFT":return[o.irfft(I("x",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var HT=(r,t,e,o=Je)=>{switch(r.op){case"StaticRegexReplace":return[o.string.staticRegexReplace(I("input",r,t,e),I("pattern",r,t,e),I("rewrite",r,t,e),I("replaceGlobal",r,t,e))];case"StringNGrams":{let{nGrams:n,nGramsSplits:s}=o.string.stringNGrams(I("data",r,t,e),I("dataSplits",r,t,e),I("separator",r,t,e),I("nGramWidths",r,t,e),I("leftPad",r,t,e),I("rightPad",r,t,e),I("padWidth",r,t,e),I("preserveShortSequences",r,t,e));return[n,s]}case"StringSplit":{let{indices:n,values:s,shape:a}=o.string.stringSplit(I("input",r,t,e),I("delimiter",r,t,e),I("skipEmpty",r,t,e));return[n,s,a]}case"StringToHashBucketFast":return[o.string.stringToHashBucketFast(I("input",r,t,e),I("numBuckets",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var KT=(r,t,e,o=Je)=>{switch(r.op){case"Cast":return[o.cast(I("x",r,t,e),I("dtype",r,t,e))];case"ExpandDims":{let n=I("axis",r,t,e);return[o.expandDims(I("x",r,t,e),n)]}case"Squeeze":{let n=I("axis",r,t,e);return[o.squeeze(I("x",r,t,e),n)]}case"Reshape":return[o.reshape(I("x",r,t,e),I("shape",r,t,e))];case"EnsureShape":return[o.ensureShape(I("x",r,t,e),I("shape",r,t,e))];case"MirrorPad":return[o.mirrorPad(I("x",r,t,e),I("padding",r,t,e),I("mode",r,t,e))];case"PadV2":case"Pad":return[o.pad(I("x",r,t,e),I("padding",r,t,e),I("constantValue",r,t,e))];case"SpaceToBatchND":{let n=I("blockShape",r,t,e),s=I("paddings",r,t,e);return[o.spaceToBatchND(I("x",r,t,e),n,s)]}case"BatchToSpaceND":{let n=I("blockShape",r,t,e),s=I("crops",r,t,e);return[o.batchToSpaceND(I("x",r,t,e),n,s)]}case"DepthToSpace":{let n=I("blockSize",r,t,e),s=I("dataFormat",r,t,e).toUpperCase();return[o.depthToSpace(I("x",r,t,e),n,s)]}case"BroadcastTo":return[o.broadcastTo(I("x",r,t,e),I("shape",r,t,e))];case"BroadcastArgs":return[o.broadcastArgs(I("s0",r,t,e),I("s1",r,t,e))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function OS(r,t,e,o,n=De){let s=((a,i,p)=>{switch(a.category){case"arithmetic":return n(()=>wT(a,i,p));case"basic_math":return n(()=>ST(a,i,p));case"control":return _T(a,i,p);case"convolution":return n(()=>ET(a,i,p));case"creation":return n(()=>RT(a,i,p));case"dynamic":return DT(a,i,p);case"evaluation":return n(()=>AT(a,i,p));case"image":return n(()=>OT(a,i,p));case"graph":return n(()=>FT(a,i,p));case"logical":return n(()=>MT(a,i,p));case"matrices":return n(()=>LT(a,i,p));case"normalization":return n(()=>BT(a,i,p));case"ragged":return n(()=>zT(a,i,p));case"reduction":return n(()=>VT(a,i,p));case"slice_join":return n(()=>WT(a,i,p));case"sparse":return n(()=>UT(a,i,p));case"spectral":return n(()=>GT(a,i,p));case"string":return n(()=>HT(a,i,p));case"transformation":return n(()=>KT(a,i,p));case"hash_table":return PT(a,i,p,o);case"custom":let u=uf(a.op);if(u&&u.customExecutor)return u.customExecutor(new Cf(a,i,p));throw TypeError(`Custom op ${a.op} is not registered.`);default:throw TypeError(`Unknown op '${a.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(r,t,e);return y.isPromise(s)?s.then(a=>[].concat(a)):[].concat(s)}var Pl=class{constructor(t={},e={},o={},n={},s){this.weightMap=t,this.tensorArrayMap=e,this.tensorListMap=o,this.functionMap=n,this.parseNodeNameCache=s,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(t,e){return{id:t,frameName:e,iterationId:0}}set currentContext(t){this.contexts!==t&&(this.contexts=t,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){let t=[];for(let e=0;ee.id===0&&e.iterationId===0?"":`${e.frameName}-${e.iterationId}`).join("/"):""}enterFrame(t){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,t)),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 t=Object.assign({},this.contexts[this.contexts.length-1]);t.iterationId+=1,t.id=this.lastId,this.contexts.splice(-1,1,t),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(t){return this.weightMap[t]}addTensorArray(t){this.tensorArrayMap[t.id]=t}getTensorArray(t){return this.tensorArrayMap[t]}addTensorList(t){this.tensorListMap[t.id]=t}getTensorList(t){return this.tensorListMap[t]}dispose(t){for(let e in this.tensorArrayMap)this.tensorArrayMap[e].clearAndClose(t);for(let e in this.tensorListMap)this.tensorListMap[e].clearAndClose(t)}};function MS(r,t,e,o){let n=new Set,s=[],a=null,i=null,p=new Set,u=new Set(Object.keys(r).map(m=>Nr(m)[0]));o=o||[];let c=new Set(o.map(m=>Nr(m.name)[0])),l=[...t];for(;l.length>0;){let m=l.pop();if((mu(m)||k8(m)||N8(m))&&a==null&&(a=m,i=a.children.map(d=>d.name).filter(d=>n.has(d))),n.add(m.name),e[m.name]==null&&!u.has(m.name)&&!c.has(m.name)){if(m.inputs.length===0){s.push(m.name);continue}m.inputs.forEach(d=>{p.has(d.name)||(p.add(d.name),l.push(d))})}}return{inputs:r,outputs:t,usedNodes:n,missingInputs:s,dynamicNode:a,syncInputs:i}}function qT(r,t){let{usedNodes:e,inputs:o}=t,n=Object.keys(o).map(g=>Nr(g)[0]).map(g=>r.nodes[g]),s=r.initNodes||[],a=g=>e.has(typeof g=="string"?g:g.name);function i(g){return[...new Map(g.map(x=>[x.name,x])).values()]}let p=i([...n,...r.weights,...s]).filter(a),u=i([...p,...Object.values(r.nodes)]).filter(a),c=new Map(u.map(g=>[g.name,g])),l={};for(let g of u){l[g.name]=l[g.name]||0;for(let x of g.children)a(x)||(l[x.name]=Number.POSITIVE_INFINITY),l[x.name]=(l[x.name]||0)+1}let m=Object.entries(l).filter(([,g])=>g===0).map(([g])=>g),d=[...m];for(;m.length>0;){let g=m.pop(),x=c.get(g);for(let b of x.children.filter(a))--l[b.name]===0&&(d.push(b.name),m.push(b.name))}let f=d.map(g=>c.get(g)),h=C8(f,p);return w8(h,p),h}function C8(r,t){let e=new Map(r.map(a=>[a.name,a])),o=t.map(a=>a.name),n=new Set(o);for(;o.length>0;){let a=o.pop(),i=e.get(a);for(let p of i.children)!e.has(p.name)||n.has(p.name)||(n.add(p.name),o.push(p.name))}return r.filter(a=>n.has(a.name))}var fc=class extends Error{constructor(t){super(`NodesExecutionOrderError: ${t}`)}};function w8(r,t){let e=new Map(r.map((i,p)=>[i.name,p])),o=new Set(t.map(i=>i.name)),n=i=>o.has(typeof i=="string"?i:i.name),s=new Set(r.map(i=>i.name)),a=i=>s.has(typeof i=="string"?i:i.name);for(let i of r){for(let p of i.children.filter(a)){if(!e.has(p.name))throw new fc(`Child ${p.name} of node ${i.name} is unreachable.`);if(e.get(i.name)>e.get(p.name))throw new fc(`Node ${i.name} is scheduled to run after its child ${p.name}.`)}if(!n(i))for(let p of i.inputs){if(!e.has(p.name))throw new fc(`Input ${p.name} of node ${i.name} is unreachable.`);if(e.get(p.name)>e.get(i.name))throw new fc(`Node ${i.name} is scheduled to run before its input ${p.name}.`)}}}function jT(r){let t=new Map(r.map((i,p)=>[i.name,p])),e=Number.MAX_SAFE_INTEGER,o=r.map((i,p)=>mu(i)?e:p),n=i=>{let p=o[t.get(i.name)];return p==null?-1:p},s=r.map((i,p)=>i.children.map(n).reduce((u,c)=>Math.max(u,c),o[p])),a=new Map;for(let i=0;it[o].map(n=>n.id));this._weightIds=[].concat(...e),this._weightMap=t}set resourceManager(t){this._resourceManager=t}get inputs(){return this._inputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(t=>({name:t.name,shape:t.attrParams.shape?t.attrParams.shape.value:void 0,dtype:t.attrParams.dtype?t.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(t=>t.signatureKey||t.name)}get outputNodes(){return this._outputs.map(t=>{let e=t.signatureKey||t.name;return t.defaultOutput?`${e}:${t.defaultOutput}`:e})}get functions(){return Object.keys(this._functions).reduce((t,e)=>(t[e]=this._functions[e].signature,t),{})}constructor(t,e){this.graph=t,this.parent=e,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,t.functions!=null&&Object.keys(t.functions).forEach(o=>{this._functionExecutorMap[o]=new r(t.functions[o],this)})}getCompilationKey(t,e){let o=t.map(s=>s.name).sort(),n=e.map(s=>s.name).sort();return o.join(this.SEPARATOR)+"--"+n.join(this.SEPARATOR)}compile(t,e){let o=MS(t,e,this.weightMap,this._initNodes),{missingInputs:n,dynamicNode:s,syncInputs:a}=o;if(s!=null)throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`);if(n.length>0){let u=e.map(l=>l.name),c=Object.keys(t);throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${c}]. Missing the following inputs: [${n}]`)}let i=qT(this.graph,o),p=jT(i);return{orderedNodes:i,nodeLiveUntilMap:p}}cloneAndKeepTensor(t){if(t==null)return null;let e=t.clone();return Er(e),e}cloneTensorList(t){return t?t.map(o=>this.cloneAndKeepTensor(o)):null}cloneTensorMap(t){return Object.fromEntries(Object.entries(t).map(([e,o])=>[e,this.cloneTensorList(o)]))}execute(t,e){this.disposeIntermediateTensors(),t=this.mapInputs(t);let o=Object.keys(t).sort();this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e);let n=o.map(m=>this.graph.nodes[Nr(m)[0]]),s=e.map(m=>Nr(m)[0]),a=new Set(s),i=s.map(m=>this.graph.nodes[m]);i.length===0&&(i=this._outputs);let p=this.getCompilationKey(n,i),u=this.compiledMap.get(p);u==null&&(u=this.compile(t,i),this.compiledMap.set(p,u));try{this.keepIntermediateTensors=A().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let c={},l={};return De(()=>{let m=new Pl(this.weightMap,c,l,this.functionExecutorMap,this.parseNodeNameCache),d=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(t).forEach(x=>{let[b,C]=Nr(x,m),S=[];S[C]=t[x],d[b]=S,this.keepIntermediateTensors&&(this.clonedTensorsMap[b]=this.cloneTensorList(S))});let f=this.getFrozenTensorIds(d),{orderedNodes:h,nodeLiveUntilMap:g}=u;for(let x of h){if(d[x.name])continue;let b=OS(x,d,m,this._resourceManager);if(y.isPromise(b))throw new Error(`The execution of the op '${x.op}' returned a promise. Please use model.executeAsync() instead.`);d[x.name]=b,this.keepIntermediateTensors&&(this.clonedTensorsMap[x.name]=this.cloneTensorList(b)),this.checkTensorForDisposalWithNodeLiveUntilInfo(x,d,m,f,a,g.get(x.name))}return this.parent==null&&m.dispose(f),e.map(x=>Bt(x,d,m))})}getFrozenTensorIds(t){let e=[].concat.apply([],Object.keys(t).map(o=>t[o]).map(o=>o.map(n=>n.id)));return new Set(e)}checkTensorForDisposal(t,e,o,n,s,a,i){if(!(mu(e)||a.has(t))){for(let p of o[t])p!=null&&(i[p.id]=(i[p.id]||0)+e.children.length);for(let p of e.inputs){if(mu(p))continue;let u=fS(p.name,o,n);if(u!=null)for(let c of u){if(!c||c.kept||s.has(c.id))continue;let l=i[c.id];l===1?(c.dispose(),delete i[c.id]):l!=null&&i[c.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(t,e,o,n,s,a){function i(p){return mu(p)||s.has(p.name)}if(!(mu(t)||a==null))for(let p of a){if(i(p))continue;let u=fS(p.name,e,o);for(let c of u)!c||c.kept||n.has(c.id)||c.dispose()}}async executeAsync(t,e){return this._executeAsync(t,e)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(t=>{for(let e of t)e&&!e.isDisposed&&e.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(t,e,o=!1,n={},s={}){this.disposeIntermediateTensors(),o||(t=this.mapInputs(t),this.checkInputs(t),this.checkInputShapeAndType(t),e=this.mapOutputs(e),this.checkOutputs(e));try{this.keepIntermediateTensors=A().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let a=new Pl(this.weightMap,n,s,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));let i=await this.executeWithControlFlow(t,a,e,o),p=e.map(m=>Bt(m,i,a)),u=p.map(m=>m.id),c=Object.keys(t).map(m=>t[m].id),l=new Set([...u,...c,...this.weightIds]);return Object.values(i).forEach(m=>{m.forEach(d=>{d&&!d.isDisposed&&!l.has(d.id)&&d.dispose()})}),this.parent==null&&a.dispose(l),p}async executeFunctionAsync(t,e,o){let n=t.reduce((s,a,i)=>(s[this.inputs[i].name]=a,s),{});return this._executeAsync(n,this.outputNodes,!0,e,o)}async executeWithControlFlow(t,e,o,n){let s=Object.keys(t),a=s.map(S=>this.graph.nodes[Nr(S)[0]]),i=o.map(S=>Nr(S)[0]),p=new Set(i),u=i.map(S=>this.graph.nodes[S]);u.length===0&&(u=this._outputs);let{usedNodes:c,missingInputs:l,dynamicNode:m,syncInputs:d}=MS(t,u,this.weightMap,this._initNodes),f=[...a,...this.graph.weights,...this._initNodes||[]].map(S=>({node:S,contexts:e.currentContext})),h=Object.assign({},this.weightMap);Object.keys(t).forEach(S=>{let[k,_]=Nr(S),E=[];E[_]=t[S],h[k]=E});let g={},x=this.getFrozenTensorIds(h),b={};for(;f.length>0;){let S=this.processStack(a,f,e,h,b,x,p,g,c);await Promise.all(S)}m==null&&!n&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let C=u.filter(S=>!mu(S)&&!Bt(S.name,h,e)).map(S=>S.name);if(C.length>0){let S="";throw m!=null&&(S=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${C}] from the provided inputs [${s}]. Consider providing the following inputs: [${l}]. ${S}`)}return h}processStack(t,e,o,n,s,a,i,p,u){let c=[];for(;e.length>0;){let l=e.pop();o.currentContext=l.contexts;let m="";if(l.node.op==="Enter"&&I("isConstant",l.node,n,o)&&([m]=Ls(l.node.name,o)),n[l.node.name]==null){let d=OS(l.node,n,o,this._resourceManager);m||([m]=Ls(l.node.name,o));let f=o.currentContext;y.isPromise(d)?c.push(d.then(h=>(n[m]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(h)),o.currentContext=f,this.checkTensorForDisposal(m,l.node,n,o,a,i,p),this.processChildNodes(l.node,e,o,n,s,u),h))):(n[m]=d,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(d)),this.checkTensorForDisposal(m,l.node,n,o,a,i,p),this.processChildNodes(l.node,e,o,n,s,u))}else this.processChildNodes(l.node,e,o,n,s,u)}return c}processChildNodes(t,e,o,n,s,a){t.children.forEach(i=>{let[p]=Ls(i.name,o);s[p]||!a.has(i.name)||(i.op==="Merge"?i.inputNames.some(u=>!!Bt(u,n,o))&&(s[p]=!0,e.push({contexts:o.currentContext,node:i})):i.inputNames.every(u=>!!Bt(u,n,o))&&(s[p]=!0,e.push({contexts:o.currentContext,node:i})))})}dispose(){Object.keys(this.weightMap).forEach(t=>this.weightMap[t].forEach(e=>e.dispose()))}checkInputShapeAndType(t){Object.keys(t).forEach(e=>{let o=t[e],[n]=Nr(e),s=this.graph.nodes[n];if(s.attrParams.shape&&s.attrParams.shape.value){let a=s.attrParams.shape.value,i=a.length===o.shape.length&&o.shape.every((p,u)=>a[u]===-1||a[u]===p);y.assert(i,()=>`The shape of dict['${s.name}'] provided in model.execute(dict) must be [${a}], but was [${o.shape}]`)}s.attrParams.dtype&&s.attrParams.dtype.value&&y.assert(o.dtype===s.attrParams.dtype.value,()=>`The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${o.dtype}`)})}mapInputs(t){var e,o;let n={};for(let s in t){let a=(o=(e=this._signature)===null||e===void 0?void 0:e.inputs)===null||o===void 0?void 0:o[s];a!=null?n[a.name]=t[s]:n[s]=t[s]}return n}checkInputs(t){let e=Object.keys(t).filter(o=>{let[n]=Nr(o);return this.graph.nodes[n]==null});if(e.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${e}] that are not part of graph`)}mapOutputs(t){return t.map(e=>{var o,n;let s=(n=(o=this._signature)===null||o===void 0?void 0:o.outputs)===null||n===void 0?void 0:n[e];return s!=null?s.name:e},{})}checkOutputs(t){t.forEach(e=>{let[o]=Nr(e);if(!this.graph.nodes[o])throw new Error(`The output '${e}' is not found in the graph`)})}};var vf=class{constructor(t={},e={}){this.hashTableNameToHandle=t,this.hashTableMap=e}addHashTable(t,e){this.hashTableNameToHandle[t]=e.handle,this.hashTableMap[e.id]=e}getHashTableHandleByName(t){return this.hashTableNameToHandle[t]}getHashTableById(t){return this.hashTableMap[t]}dispose(){for(let t in this.hashTableMap)this.hashTableMap[t].clearAndClose(),delete this.hashTableMap[t];for(let t in this.hashTableNameToHandle)this.hashTableNameToHandle[t].dispose(),delete this.hashTableNameToHandle[t]}};var T8="?tfjs-format=file",_8="model.json",Ml=class{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}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(t,e={},o=mi){this.modelUrl=t,this.loadOptions=e,this.version="n/a",this.io=o,e==null&&(this.loadOptions={}),this.resourceManager=new vf}findIOHandler(){let t=this.modelUrl;if(t.load!=null)this.handler=t;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(t,this.loadOptions);else{let e=this.io.getLoadHandlers(t,this.loadOptions);if(e.length===0)e.push(this.io.browserHTTPRequest(t,this.loadOptions));else if(e.length>1)throw new Error(`Found more than one (${e.length}) load handlers for URL '${[t]}'`);this.handler=e[0]}}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 t=this.handler.load();return y.isPromise(t)?t.then(e=>this.loadSync(e)):this.loadSync(t)}loadSync(t){this.artifacts=t;let e=this.artifacts.modelTopology,o=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){let s=this.artifacts.userDefinedMetadata;s.signature!=null&&(o=s.signature),s.structuredOutputKeys!=null&&(this.structuredOutputKeys=s.structuredOutputKeys)}this.signature=o,this.version=`${e.versions.producer}.${e.versions.minConsumer}`;let n=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new Ol(Fl.Instance.transformGraph(e,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(n),this.executor.resourceManager=this.resourceManager,t.modelInitializer!=null&&t.modelInitializer.node!=null){let s=Fl.Instance.transformGraph(t.modelInitializer);this.initializer=new Ol(s),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=t.initializerSignature}return!0}async save(t,e){if(typeof t=="string"){let o=this.io.getSaveHandlers(t);if(o.length===0)throw new Error(`Cannot find any save handlers for URL '${t}'`);if(o.length>1)throw new Error(`Found more than one (${o.length}) save handlers for URL '${t}'`);t=o[0]}if(t.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return t.save(this.artifacts)}addStructuredOutputNames(t){if(this.structuredOutputKeys){let e=t instanceof mt?[t]:t,o={};return e.forEach((n,s)=>o[this.structuredOutputKeys[s]]=n),o}return t}predict(t,e){let o=this.execute(t,this.outputNodes);return this.addStructuredOutputNames(o)}async predictAsync(t,e){let o=await this.executeAsync(t,this.outputNodes);return this.addStructuredOutputNames(o)}normalizeInputs(t){var e;if(!(t instanceof mt)&&!Array.isArray(t)){let s=(e=this.signature)===null||e===void 0?void 0:e.inputs;if(s!=null)for(let a in s){let i=s[a];i.resourceId!=null&&(t[a]=this.resourceIdToCapturedInput[i.resourceId])}return t}t=Array.isArray(t)?t:[t];let o=Object.keys(this.resourceIdToCapturedInput).length;if(t.length+o!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-o} non-resource placeholders, while there are ${t.length} input tensors provided.`);let n=0;return this.inputNodes.reduce((s,a)=>{var i,p,u;let c=(u=(p=(i=this.signature)===null||i===void 0?void 0:i.inputs)===null||p===void 0?void 0:p[a])===null||u===void 0?void 0:u.resourceId;return c!=null?s[a]=this.resourceIdToCapturedInput[c]:s[a]=t[n++],s},{})}normalizeOutputs(t){return t=t||this.outputNodes,Array.isArray(t)?t:[t]}executeInitializerGraph(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(t){if(this.resourceIdToCapturedInput={},this.initializerSignature){let e=this.initializerSignature.outputs,o=Object.keys(e);for(let n=0;n1?o:o[0]}async executeAsync(t,e){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),t=this.normalizeInputs(t),e=this.normalizeOutputs(e);let o=await this.executor.executeAsync(t,e);return o.length>1?o:o[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(t){return Object.keys(t).reduce((e,o)=>(e[o]=[t[o]],e),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&Ot(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}};async function $8(r,t={},e=mi){if(r==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&&typeof r=="string"&&(r=R8(r));let o=new Ml(r,t,e);return await o.load(),o}function E8(r){if(r==null)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let t;if(r instanceof Array){let[o,n]=r;if(!o)throw new Error("modelJSON must be the first element of the array");if(!n||!(n instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in o))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in o))throw new Error("Model JSON is missing 'weightsManifest'");let s=mi.getWeightSpecs(o.weightsManifest),a=mi.getModelArtifactsForJSONSync(o,s,n);t=mi.fromMemorySync(a)}else if("load"in r)t=r;else if("modelTopology"in r&&"weightSpecs"in r&&"weightData"in r)t=mi.fromMemorySync(r);else throw new Error("Unknown model format");let e=new Ml(t);return e.load(),e}function R8(r){return r.endsWith("/")||(r=r+"/"),`${r}${_8}${T8}`}var D8="4.14.0";function Q(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>{e!=null&&y.assert(e.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the CPU backend.`)})}var A8=Vt.whereImpl,hc=class r extends so{nextDataId(){return r.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new Bo(this,ur())}write(t,e,o){this.firstUse&&(this.firstUse=!1,A().get("IS_NODE")&&w.warn(` + ${o}, and tensor's shape is: ${r.shape}`);let s=r.shape.slice(1),a=Df(s,t),i=o===0?0:r.size/o,p=De(()=>{let l=[];r=W(r,[1,o,i]);for(let c=0;c{switch(r.op){case"If":case"StatelessIf":{let o=I("thenBranch",r,e,t),n=I("elseBranch",r,e,t),s=I("cond",r,e,t),a=I("args",r,e,t);return(await s.data())[0]?t.functionMap[o].executeFunctionAsync(a,t.tensorArrayMap,t.tensorListMap):t.functionMap[n].executeFunctionAsync(a,t.tensorArrayMap,t.tensorListMap)}case"While":case"StatelessWhile":{let o=I("body",r,e,t),n=I("cond",r,e,t),s=I("args",r,e,t),a=await t.functionMap[n].executeFunctionAsync(s,t.tensorArrayMap,t.tensorListMap),i=s.map(l=>l.id),p=await a[0].data();a.forEach(l=>{!l.kept&&i.indexOf(l.id)===-1&&l.dispose()});let u=s;for(;p[0];){let l=u;u=await t.functionMap[o].executeFunctionAsync(u,t.tensorArrayMap,t.tensorListMap);let c=u.map(d=>d.id);l.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&c.indexOf(d.id)===-1&&d.dispose()});let m=await t.functionMap[n].executeFunctionAsync(u,t.tensorArrayMap,t.tensorListMap);p=await m[0].data(),m.forEach(d=>{!d.kept&&i.indexOf(d.id)===-1&&c.indexOf(d.id)===-1&&d.dispose()})}return u}case"LoopCond":{let o=I("pred",r,e,t);return[js(o)]}case"Switch":{let o=I("pred",r,e,t),n=I("data",r,e,t);return n.kept||(n=js(n)),(await o.data())[0]?[void 0,n]:[n,void 0]}case"Merge":{let o=r.inputNames.find(n=>Vt(n,e,t)!==void 0);if(o){let n=Vt(o,e,t);return[js(n)]}return}case"Enter":{let o=I("frameName",r,e,t),n=I("tensor",r,e,t);return t.enterFrame(o),[js(n)]}case"Exit":{let o=I("tensor",r,e,t);return t.exitFrame(),[js(o)]}case"NextIteration":{let o=I("tensor",r,e,t);return t.nextIteration(),[js(o)]}case"TensorArrayV3":{let o=I("size",r,e,t),n=I("dtype",r,e,t),s=I("elementShape",r,e,t),a=I("dynamicSize",r,e,t),i=I("clearAfterRead",r,e,t),p=I("identicalElementShapes",r,e,t),u=I("name",r,e,t),l=new Af(u,n,o,s,p,a,i);return t.addTensorArray(l),[l.idTensor,ke(1)]}case"TensorArrayWriteV3":{let o=I("tensorArrayId",r,e,t),n=I("index",r,e,t),s=I("tensor",r,e,t),a=t.getTensorArray(o.id);return a.write(n,s),[a.idTensor]}case"TensorArrayReadV3":{let o=I("tensorArrayId",r,e,t),n=I("index",r,e,t);return[t.getTensorArray(o.id).read(n)]}case"TensorArrayGatherV3":{let o=I("tensorArrayId",r,e,t),n=I("indices",r,e,t),s=I("dtype",r,e,t);return[t.getTensorArray(o.id).gather(n,s)]}case"TensorArrayScatterV3":{let o=I("tensorArrayId",r,e,t),n=I("indices",r,e,t),s=I("tensor",r,e,t),a=t.getTensorArray(o.id);return a.scatter(n,s),[a.idTensor]}case"TensorArrayConcatV3":{let o=I("tensorArrayId",r,e,t),n=t.getTensorArray(o.id),s=I("dtype",r,e,t);return[n.concat(s)]}case"TensorArraySplitV3":{let o=I("tensorArrayId",r,e,t),n=I("tensor",r,e,t),s=I("lengths",r,e,t),a=t.getTensorArray(o.id);return a.split(s,n),[a.idTensor]}case"TensorArraySizeV3":{let o=I("tensorArrayId",r,e,t),n=t.getTensorArray(o.id);return[ke(n.size(),"int32")]}case"TensorArrayCloseV3":{let o=I("tensorArrayId",r,e,t),n=t.getTensorArray(o.id);return n.clearAndClose(),[n.idTensor]}case"TensorListSetItem":{let o=I("tensorListId",r,e,t),n=I("index",r,e,t),s=I("tensor",r,e,t),a=t.getTensorList(o.id);return a.setItem(n,s),[a.idTensor]}case"TensorListGetItem":{let o=I("tensorListId",r,e,t),n=I("index",r,e,t),s=I("elementShape",r,e,t),a=I("elementDType",r,e,t);return[t.getTensorList(o.id).getItem(n,s,a)]}case"TensorListScatterV2":case"TensorListScatter":{let o=I("indices",r,e,t),n=I("tensor",r,e,t),s=I("elementShape",r,e,t),a=I("numElements",r,e,t),i=x_(n,o,s,a);return t.addTensorList(i),[i.idTensor]}case"TensorListReserve":case"EmptyTensorList":{let o=I("elementShape",r,e,t),n=I("elementDType",r,e,t),s;r.op==="TensorListReserve"?s="numElements":s="maxNumElements";let a=I(s,r,e,t),i=r.op==="TensorListReserve"?-1:a,p=g_(o,n,a,i);return t.addTensorList(p),[p.idTensor]}case"TensorListGather":{let o=I("tensorListId",r,e,t),n=I("indices",r,e,t),s=I("elementShape",r,e,t),a=I("elementDType",r,e,t);return[t.getTensorList(o.id).gather(n,a,s)]}case"TensorListStack":{let o=I("tensorListId",r,e,t),n=I("elementShape",r,e,t),s=I("elementDType",r,e,t),a=I("numElements",r,e,t);return[t.getTensorList(o.id).stack(n,s,a)]}case"TensorListFromTensor":{let o=I("tensor",r,e,t),n=I("elementShape",r,e,t),s=I("elementDType",r,e,t),a=h_(o,n,s);return t.addTensorList(a),[a.idTensor]}case"TensorListConcat":case"TensorListConcatV2":{let o=I("tensorListId",r,e,t),n=t.getTensorList(o.id),s=I("dtype",r,e,t),a=I("elementShape",r,e,t);return[n.concat(s,a)]}case"TensorListPushBack":{let o=I("tensorListId",r,e,t),n=I("tensor",r,e,t),s=t.getTensorList(o.id);return s.pushBack(n),[s.idTensor]}case"TensorListPopBack":{let o=I("tensorListId",r,e,t),n=I("elementShape",r,e,t),s=I("elementDType",r,e,t);return[t.getTensorList(o.id).popBack(n,s)]}case"TensorListSplit":{let o=I("tensor",r,e,t),n=I("elementShape",r,e,t),s=I("lengths",r,e,t),a=y_(o,s,n);return t.addTensorList(a),[a.idTensor]}case"TensorListLength":{let o=I("tensorListId",r,e,t),n=t.getTensorList(o.id);return[ke(n.size(),"int32")]}case"TensorListResize":{let o=I("tensorListId",r,e,t),n=I("size",r,e,t),a=t.getTensorList(o.id).resize(n);return t.addTensorList(a),[a.idTensor]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};function C_(r,e,t){let[o,n]=I("fusedOps",r,e,t),s=o==="biasadd",a=!s,i=n==="prelu",p=o==="fusedbatchnorm",u=I("numArgs",r,e,t);if(s){if(i&&u!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&s&&u!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(p)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");let l=I("strides",r,e,t),c=Wc(r,e,t),m=I("dataFormat",r,e,t).toUpperCase(),d=I("dilations",r,e,t),[f,h]=I("args",r,e,t);a&&(h=f,f=void 0);let g=I("leakyreluAlpha",r,e,t);return{stride:l,pad:c,dataFormat:m,dilations:d,biasArg:f,preluArg:h,activationFunc:n,leakyreluAlpha:g}}var w_=(r,e,t,o=et)=>{switch(r.op){case"Conv1D":{let n=I("stride",r,e,t),s=I("pad",r,e,t),a=I("dataFormat",r,e,t).toUpperCase(),i=I("dilation",r,e,t);return[o.conv1d(I("x",r,e,t),I("filter",r,e,t),n,s,a,i)]}case"Conv2D":{let n=I("strides",r,e,t),s=Wc(r,e,t),a=I("dataFormat",r,e,t).toUpperCase(),i=I("dilations",r,e,t);return[o.conv2d(I("x",r,e,t),I("filter",r,e,t),[n[1],n[2]],s,a,[i[1],i[2]])]}case"_FusedConv2D":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:l,leakyreluAlpha:c}=C_(r,e,t);return[o.fused.conv2d({x:I("x",r,e,t),filter:I("filter",r,e,t),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:l,preluActivationWeights:u,leakyreluAlpha:c})]}case"FusedDepthwiseConv2dNative":{let{stride:n,pad:s,dataFormat:a,dilations:i,biasArg:p,preluArg:u,activationFunc:l,leakyreluAlpha:c}=C_(r,e,t);return[o.fused.depthwiseConv2d({x:I("x",r,e,t),filter:I("filter",r,e,t),strides:[n[1],n[2]],pad:s,dataFormat:a,dilations:[i[1],i[2]],bias:p,activation:l,preluActivationWeights:u,leakyreluAlpha:c})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{let n=I("outputShape",r,e,t),s=I("strides",r,e,t),a=Wc(r,e,t);return[o.conv2dTranspose(I("x",r,e,t),I("filter",r,e,t),n,[s[1],s[2]],a)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{let n=I("strides",r,e,t),s=Wc(r,e,t),a=I("dilations",r,e,t),i=I("dataFormat",r,e,t).toUpperCase();return[o.depthwiseConv2d(I("input",r,e,t),I("filter",r,e,t),[n[1],n[2]],s,i,[a[1],a[2]])]}case"Conv3D":{let n=I("strides",r,e,t),s=I("pad",r,e,t),a=I("dataFormat",r,e,t).toUpperCase(),i=I("dilations",r,e,t);return[o.conv3d(I("x",r,e,t),I("filter",r,e,t),[n[1],n[2],n[3]],s,a,[i[1],i[2],i[3]])]}case"AvgPool":{let n=I("strides",r,e,t),s=I("pad",r,e,t),a=I("kernelSize",r,e,t);return[o.avgPool(I("x",r,e,t),[a[1],a[2]],[n[1],n[2]],s)]}case"MaxPool":{let n=I("strides",r,e,t),s=I("pad",r,e,t),a=I("kernelSize",r,e,t);return[o.maxPool(I("x",r,e,t),[a[1],a[2]],[n[1],n[2]],s)]}case"MaxPoolWithArgmax":{let n=I("strides",r,e,t),s=I("pad",r,e,t),a=I("kernelSize",r,e,t),i=I("includeBatchInIndex",r,e,t),{result:p,indexes:u}=o.maxPoolWithArgmax(I("x",r,e,t),[a[1],a[2]],[n[1],n[2]],s,i);return[p,u]}case"AvgPool3D":{let n=I("strides",r,e,t),s=I("pad",r,e,t),a=I("kernelSize",r,e,t);return[o.avgPool3d(I("x",r,e,t),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case"MaxPool3D":{let n=I("strides",r,e,t),s=I("pad",r,e,t),a=I("kernelSize",r,e,t);return[o.maxPool3d(I("x",r,e,t),[a[1],a[2],a[3]],[n[1],n[2],n[3]],s)]}case"Dilation2D":{let n=I("strides",r,e,t),s=I("pad",r,e,t),a=I("dilations",r,e,t),i=n[1],p=n[2],u=a[1],l=a[2];return[o.dilation2d(I("x",r,e,t),I("filter",r,e,t),[i,p],s,[u,l],"NHWC")]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var S_=(r,e,t,o=et)=>{switch(r.op){case"Fill":{let n=I("shape",r,e,t),s=I("dtype",r,e,t),a=I("value",r,e,t);return[o.fill(n,a,s)]}case"LinSpace":{let n=I("start",r,e,t),s=I("stop",r,e,t),a=I("num",r,e,t);return[o.linspace(n,s,a)]}case"Multinomial":{let n=I("logits",r,e,t),s=I("numSamples",r,e,t),a=I("seed",r,e,t);return[o.multinomial(n,s,a)]}case"OneHot":{let n=I("indices",r,e,t),s=I("depth",r,e,t),a=I("onValue",r,e,t),i=I("offValue",r,e,t),p=I("dtype",r,e,t);return[o.oneHot(n,s,a,i,p)]}case"Ones":return[o.ones(I("shape",r,e,t),I("dtype",r,e,t))];case"OnesLike":return[o.onesLike(I("x",r,e,t))];case"RandomStandardNormal":return[o.randomStandardNormal(I("shape",r,e,t),I("dtype",r,e,t),I("seed",r,e,t))];case"RandomUniform":return[o.randomUniform(I("shape",r,e,t),I("minval",r,e,t),I("maxval",r,e,t),I("dtype",r,e,t))];case"RandomUniformInt":return[o.randomUniformInt(I("shape",r,e,t),I("minval",r,e,t),I("maxval",r,e,t),I("seed",r,e,t))];case"Range":{let n=I("start",r,e,t),s=I("stop",r,e,t),a=I("step",r,e,t);return[o.range(n,s,a,I("dtype",r,e,t))]}case"TruncatedNormal":{let n=I("shape",r,e,t),s=I("mean",r,e,t),a=I("stdDev",r,e,t),i=I("seed",r,e,t);return[o.truncatedNormal(n,s,a,I("dtype",r,e,t),i)]}case"Zeros":return[o.zeros(I("shape",r,e,t),I("dtype",r,e,t))];case"ZerosLike":return[o.zerosLike(I("x",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function XS(r,e,t){let o=I("boxes",r,e,t),n=I("scores",r,e,t),s=I("maxOutputSize",r,e,t),a=I("iouThreshold",r,e,t),i=I("scoreThreshold",r,e,t),p=I("softNmsSigma",r,e,t);return{boxes:o,scores:n,maxOutputSize:s,iouThreshold:a,scoreThreshold:i,softNmsSigma:p}}var I_=async(r,e,t,o,n=et)=>{switch(r.op){case"NonMaxSuppressionV5":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u,softNmsSigma:l}=XS(r,e,t),c=await n.image.nonMaxSuppressionWithScoreAsync(s,a,i,p,u,l);return[c.selectedIndices,c.selectedScores]}case"NonMaxSuppressionV4":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=XS(r,e,t),l=I("padToMaxOutputSize",r,e,t),c=await n.image.nonMaxSuppressionPaddedAsync(s,a,i,p,u,l);return[c.selectedIndices,c.validOutputs]}case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":{let{boxes:s,scores:a,maxOutputSize:i,iouThreshold:p,scoreThreshold:u}=XS(r,e,t);return[await n.image.nonMaxSuppressionAsync(s,a,i,p,u)]}case"Where":{let s=n.cast(I("condition",r,e,t),"bool"),a=[await n.whereAsync(s)];return s.dispose(),a}case"ListDiff":return n.setdiff1dAsync(I("x",r,e,t),I("y",r,e,t));default:throw TypeError(`Node type ${r.op} is not implemented`)}};var v_=(r,e,t,o=et)=>{switch(r.op){case"LowerBound":{let n=I("sortedSequence",r,e,t),s=I("values",r,e,t);return[o.lowerBound(n,s)]}case"TopKV2":{let n=I("x",r,e,t),s=I("k",r,e,t),a=I("sorted",r,e,t),i=o.topk(n,s,a);return[i.values,i.indices]}case"UpperBound":{let n=I("sortedSequence",r,e,t),s=I("values",r,e,t);return[o.upperBound(n,s)]}case"Unique":{let n=I("x",r,e,t),s=o.unique(n);return[s.values,s.indices]}case"UniqueV2":{let n=I("x",r,e,t),s=I("axis",r,e,t),a=o.unique(n,s);return[a.values,a.indices]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var k_=(r,e,t,o=et)=>{switch(r.op){case"Const":return e[r.name];case"PlaceholderWithDefault":let n=I("default",r,e,t);return[Vt(r.name,e,t)||n];case"Placeholder":return[Vt(r.name,e,t)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":{let l=I("x",r,e,t);return[js(l)]}case"IdentityN":return I("x",r,e,t).map(l=>js(l));case"Snapshot":let s=I("x",r,e,t);return[js(s)];case"Shape":return[o.tensor1d(I("x",r,e,t).shape,"int32")];case"ShapeN":return I("x",r,e,t).map(l=>o.tensor1d(l.shape));case"Size":return[o.scalar(I("x",r,e,t).size,"int32")];case"Rank":return[o.scalar(I("x",r,e,t).rank,"int32")];case"NoOp":return[o.scalar(1)];case"Print":let a=I("x",r,e,t),i=I("data",r,e,t),p=I("message",r,e,t),u=I("summarize",r,e,t);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(p);for(let l=0;le.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 o=await e.data();return this.tensorMap.forEach(n=>n.dispose()),this.tensorMap.clear(),De(()=>{let n=zo(t),s=o.length,a=n.length;y.assert(s===a,()=>`The number of elements doesn't match, keys has ${s} elements, the values has ${a} elements.`);for(let i=0;i{let n=[];for(let s=0;s{switch(r.op){case"HashTable":case"HashTableV2":{let n=o.getHashTableHandleByName(r.name);if(n!=null)return[n];{let s=I("keyDType",r,e,t),a=I("valueDType",r,e,t),i=new Ff(s,a);return o.addHashTable(r.name,i),[i.handle]}}case"InitializeTable":case"InitializeTableV2":case"LookupTableImport":case"LookupTableImportV2":{let n=I("tableHandle",r,e,t,o),s=I("keys",r,e,t),a=I("values",r,e,t);return[await o.getHashTableById(n.id).import(s,a)]}case"LookupTableFind":case"LookupTableFindV2":{let n=I("tableHandle",r,e,t,o),s=I("keys",r,e,t),a=I("defaultValue",r,e,t);return[await o.getHashTableById(n.id).find(s,a)]}case"LookupTableSize":case"LookupTableSizeV2":{let n=I("tableHandle",r,e,t,o);return[o.getHashTableById(n.id).tensorSize()]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var T_=(r,e,t,o=et)=>{switch(r.op){case"ResizeBilinear":{let n=I("images",r,e,t),s=I("size",r,e,t),a=I("alignCorners",r,e,t),i=I("halfPixelCenters",r,e,t);return[o.image.resizeBilinear(n,[s[0],s[1]],a,i)]}case"ResizeNearestNeighbor":{let n=I("images",r,e,t),s=I("size",r,e,t),a=I("alignCorners",r,e,t),i=I("halfPixelCenters",r,e,t);return[o.image.resizeNearestNeighbor(n,[s[0],s[1]],a,i)]}case"CropAndResize":{let n=I("image",r,e,t),s=I("boxes",r,e,t),a=I("boxInd",r,e,t),i=I("cropSize",r,e,t),p=I("method",r,e,t),u=I("extrapolationValue",r,e,t);return[o.image.cropAndResize(n,s,a,i,p,u)]}case"ImageProjectiveTransformV3":{let n=I("images",r,e,t),s=I("transforms",r,e,t),a=I("outputShape",r,e,t),i=I("fillValue",r,e,t),p=I("interpolation",r,e,t),u=I("fillMode",r,e,t);return[o.image.transform(n,s,p.toLowerCase(),u.toLowerCase(),i,a)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var __=(r,e,t,o=et)=>{switch(r.op){case"Equal":return[o.equal(I("a",r,e,t),I("b",r,e,t))];case"NotEqual":return[o.notEqual(I("a",r,e,t),I("b",r,e,t))];case"Greater":return[o.greater(I("a",r,e,t),I("b",r,e,t))];case"GreaterEqual":return[o.greaterEqual(I("a",r,e,t),I("b",r,e,t))];case"Less":return[o.less(I("a",r,e,t),I("b",r,e,t))];case"LessEqual":return[o.lessEqual(I("a",r,e,t),I("b",r,e,t))];case"LogicalAnd":return[o.logicalAnd(I("a",r,e,t),I("b",r,e,t))];case"LogicalNot":return[o.logicalNot(I("a",r,e,t))];case"LogicalOr":return[o.logicalOr(I("a",r,e,t),I("b",r,e,t))];case"Select":case"SelectV2":return[o.where(I("condition",r,e,t),I("a",r,e,t),I("b",r,e,t))];case"BitwiseAnd":return[o.bitwiseAnd(I("a",r,e,t),I("b",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var E_=(r,e,t,o=et)=>{switch(r.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[o.matMul(I("a",r,e,t),I("b",r,e,t),I("transposeA",r,e,t),I("transposeB",r,e,t))];case"Einsum":return[o.einsum(I("equation",r,e,t),...I("tensors",r,e,t))];case"Transpose":return[o.transpose(I("x",r,e,t),I("perm",r,e,t))];case"_FusedMatMul":let[n,s]=I("fusedOps",r,e,t),a=n==="biasadd",i=s==="prelu",p=I("numArgs",r,e,t),u=I("leakyreluAlpha",r,e,t);if(a){if(i&&p!==2)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&p!==1)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}let[l,c]=I("args",r,e,t);return[o.fused.matMul({a:I("a",r,e,t),b:I("b",r,e,t),transposeA:I("transposeA",r,e,t),transposeB:I("transposeB",r,e,t),bias:l,activation:s,preluActivationWeights:c,leakyreluAlpha:u})];case"MatrixBandPart":return[o.linalg.bandPart(I("a",r,e,t),I("numLower",r,e,t),I("numUpper",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var $_=(r,e,t,o=et)=>{switch(r.op){case"EuclideanNorm":return[o.euclideanNorm(I("x",r,e,t),I("axis",r,e,t),I("keepDims",r,e,t))];case"FusedBatchNorm":case"FusedBatchNormV2":return[o.batchNorm(I("x",r,e,t),I("mean",r,e,t),I("variance",r,e,t),I("offset",r,e,t),I("scale",r,e,t),I("epsilon",r,e,t))];case"FusedBatchNormV3":return[o.batchNorm(I("x",r,e,t),I("mean",r,e,t),I("variance",r,e,t),I("offset",r,e,t),I("scale",r,e,t),I("epsilon",r,e,t))];case"LRN":return[o.localResponseNormalization(I("x",r,e,t),I("radius",r,e,t),I("bias",r,e,t),I("alpha",r,e,t),I("beta",r,e,t))];case"Softmax":return[o.softmax(I("x",r,e,t))];case"LogSoftmax":return[o.logSoftmax(I("x",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var R_=(r,e,t,o=et)=>{switch(r.op){case"RaggedGather":{let{outputNestedSplits:n,outputDenseValues:s}=o.raggedGather(I("paramsNestedSplits",r,e,t),I("paramsDenseValues",r,e,t),I("indices",r,e,t),I("outputRaggedRank",r,e,t));return n.concat(s)}case"RaggedRange":{let{rtNestedSplits:n,rtDenseValues:s}=o.raggedRange(I("starts",r,e,t),I("limits",r,e,t),I("splits",r,e,t));return[n,s]}case"RaggedTensorToTensor":return[o.raggedTensorToTensor(I("shape",r,e,t),I("values",r,e,t),I("defaultValue",r,e,t),I("rowPartitionTensors",r,e,t),I("rowPartitionTypes",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var D_=(r,e,t,o=et)=>{switch(r.op){case"Max":{let i=I("axis",r,e,t),p=I("keepDims",r,e,t);return[o.max(I("x",r,e,t),i,p)]}case"Mean":{let i=I("axis",r,e,t),p=I("keepDims",r,e,t);return[o.mean(I("x",r,e,t),i,p)]}case"Min":{let i=I("axis",r,e,t),p=I("keepDims",r,e,t);return[o.min(I("x",r,e,t),i,p)]}case"Sum":{let i=I("axis",r,e,t),p=I("keepDims",r,e,t);return[o.sum(I("x",r,e,t),i,p)]}case"All":{let i=I("axis",r,e,t),p=I("keepDims",r,e,t);return[o.all(I("x",r,e,t),i,p)]}case"Any":{let i=I("axis",r,e,t),p=I("keepDims",r,e,t);return[o.any(I("x",r,e,t),i,p)]}case"ArgMax":{let i=I("axis",r,e,t);return[o.argMax(I("x",r,e,t),i)]}case"ArgMin":{let i=I("axis",r,e,t);return[o.argMin(I("x",r,e,t),i)]}case"Prod":{let i=I("axis",r,e,t),p=I("keepDims",r,e,t);return[o.prod(I("x",r,e,t),i,p)]}case"Cumprod":{let i=I("axis",r,e,t),p=I("exclusive",r,e,t),u=I("reverse",r,e,t);return[o.cumprod(I("x",r,e,t),i,p,u)]}case"Cumsum":{let i=I("axis",r,e,t),p=I("exclusive",r,e,t),u=I("reverse",r,e,t);return[o.cumsum(I("x",r,e,t),i,p,u)]}case"Bincount":let n=I("x",r,e,t),s=I("weights",r,e,t),a=I("size",r,e,t);return[o.bincount(n,s,a)];case"DenseBincount":{let i=I("x",r,e,t),p=I("weights",r,e,t),u=I("size",r,e,t),l=I("binaryOutput",r,e,t);return[o.denseBincount(i,p,u,l)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var A_=(r,e,t,o=et)=>{switch(r.op){case"ConcatV2":case"Concat":{let n=I("n",r,e,t),s=I("axis",r,e,t),a=I("tensors",r,e,t);return a=a.slice(0,n),[o.concat(a,s)]}case"Gather":{let n=I("x",r,e,t),s=I("indices",r,e,t);return[o.gather(n,o.cast(s,"int32"),0)]}case"GatherV2":{let n=I("axis",r,e,t),s=I("batchDims",r,e,t),a=I("x",r,e,t),i=I("indices",r,e,t);return[o.gather(a,o.cast(i,"int32"),n,s)]}case"Reverse":{let n=I("dims",r,e,t),s=[];for(let i=0;i{let n=I("axis",r,e,t),s=I("tensors",r,e,t),a=s[0].shape,i=o.squeeze(s[0]).shape,p=s.map(u=>{let l=y.arraysEqual(u.shape,a);if(!l&&!y.arraysEqual(o.squeeze(u).shape,i))throw new Error("the input tensors shape does not match");return l?u:o.reshape(u,a)});return[o.stack(p,n)]});case"Unpack":{let n=I("axis",r,e,t),s=I("tensor",r,e,t);return o.unstack(s,n)}case"Tile":{let n=I("reps",r,e,t);return[o.tile(I("x",r,e,t),n)]}case"Split":case"SplitV":{let n=I("axis",r,e,t),s=I("numOrSizeSplits",r,e,t),a=I("x",r,e,t);return o.split(a,s,n)}case"ScatterNd":{let n=I("indices",r,e,t),s=I("values",r,e,t),a=I("shape",r,e,t);return[o.scatterND(n,s,a)]}case"GatherNd":{let n=I("x",r,e,t),s=I("indices",r,e,t);return[o.gatherND(n,s)]}case"SparseToDense":{let n=I("sparseIndices",r,e,t),s=I("outputShape",r,e,t),a=I("sparseValues",r,e,t),i=I("defaultValue",r,e,t);return[o.sparseToDense(n,a,s,a.dtype===i.dtype?i:o.cast(i,a.dtype))]}case"TensorScatterUpdate":{let n=I("indices",r,e,t),s=I("values",r,e,t),a=I("tensor",r,e,t);return[o.tensorScatterUpdate(a,n,s)]}default:throw TypeError(`Node type ${r.op} is not implemented`)}};var F_=(r,e,t,o=et)=>{switch(r.op){case"SparseFillEmptyRows":{let{outputIndices:n,outputValues:s,emptyRowIndicator:a,reverseIndexMap:i}=o.sparse.sparseFillEmptyRows(I("indices",r,e,t),I("values",r,e,t),I("denseShape",r,e,t),I("defaultValue",r,e,t));return[n,s,a,i]}case"SparseReshape":{let{outputIndices:n,outputShape:s}=o.sparse.sparseReshape(I("inputIndices",r,e,t),I("inputShape",r,e,t),I("newShape",r,e,t));return[n,s]}case"SparseSegmentMean":return[o.sparse.sparseSegmentMean(I("data",r,e,t),I("indices",r,e,t),I("segmentIds",r,e,t))];case"SparseSegmentSum":return[o.sparse.sparseSegmentSum(I("data",r,e,t),I("indices",r,e,t),I("segmentIds",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var P_=(r,e,t,o=et)=>{switch(r.op){case"FFT":return[o.fft(I("x",r,e,t))];case"IFFT":return[o.ifft(I("x",r,e,t))];case"RFFT":return[o.rfft(I("x",r,e,t))];case"IRFFT":return[o.irfft(I("x",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var O_=(r,e,t,o=et)=>{switch(r.op){case"StaticRegexReplace":return[o.string.staticRegexReplace(I("input",r,e,t),I("pattern",r,e,t),I("rewrite",r,e,t),I("replaceGlobal",r,e,t))];case"StringNGrams":{let{nGrams:n,nGramsSplits:s}=o.string.stringNGrams(I("data",r,e,t),I("dataSplits",r,e,t),I("separator",r,e,t),I("nGramWidths",r,e,t),I("leftPad",r,e,t),I("rightPad",r,e,t),I("padWidth",r,e,t),I("preserveShortSequences",r,e,t));return[n,s]}case"StringSplit":{let{indices:n,values:s,shape:a}=o.string.stringSplit(I("input",r,e,t),I("delimiter",r,e,t),I("skipEmpty",r,e,t));return[n,s,a]}case"StringToHashBucketFast":return[o.string.stringToHashBucketFast(I("input",r,e,t),I("numBuckets",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};var M_=(r,e,t,o=et)=>{switch(r.op){case"Cast":return[o.cast(I("x",r,e,t),I("dtype",r,e,t))];case"ExpandDims":{let n=I("axis",r,e,t);return[o.expandDims(I("x",r,e,t),n)]}case"Squeeze":{let n=I("axis",r,e,t);return[o.squeeze(I("x",r,e,t),n)]}case"Reshape":return[o.reshape(I("x",r,e,t),I("shape",r,e,t))];case"EnsureShape":return[o.ensureShape(I("x",r,e,t),I("shape",r,e,t))];case"MirrorPad":return[o.mirrorPad(I("x",r,e,t),I("padding",r,e,t),I("mode",r,e,t))];case"PadV2":case"Pad":return[o.pad(I("x",r,e,t),I("padding",r,e,t),I("constantValue",r,e,t))];case"SpaceToBatchND":{let n=I("blockShape",r,e,t),s=I("paddings",r,e,t);return[o.spaceToBatchND(I("x",r,e,t),n,s)]}case"BatchToSpaceND":{let n=I("blockShape",r,e,t),s=I("crops",r,e,t);return[o.batchToSpaceND(I("x",r,e,t),n,s)]}case"DepthToSpace":{let n=I("blockSize",r,e,t),s=I("dataFormat",r,e,t).toUpperCase();return[o.depthToSpace(I("x",r,e,t),n,s)]}case"BroadcastTo":return[o.broadcastTo(I("x",r,e,t),I("shape",r,e,t))];case"BroadcastArgs":return[o.broadcastArgs(I("s0",r,e,t),I("s1",r,e,t))];default:throw TypeError(`Node type ${r.op} is not implemented`)}};function YS(r,e,t,o,n=De){let s=((a,i,p)=>{switch(a.category){case"arithmetic":return n(()=>m_(a,i,p));case"basic_math":return n(()=>d_(a,i,p));case"control":return b_(a,i,p);case"convolution":return n(()=>w_(a,i,p));case"creation":return n(()=>S_(a,i,p));case"dynamic":return I_(a,i,p);case"evaluation":return n(()=>v_(a,i,p));case"image":return n(()=>T_(a,i,p));case"graph":return n(()=>k_(a,i,p));case"logical":return n(()=>__(a,i,p));case"matrices":return n(()=>E_(a,i,p));case"normalization":return n(()=>$_(a,i,p));case"ragged":return n(()=>R_(a,i,p));case"reduction":return n(()=>D_(a,i,p));case"slice_join":return n(()=>A_(a,i,p));case"sparse":return n(()=>F_(a,i,p));case"spectral":return n(()=>P_(a,i,p));case"string":return n(()=>O_(a,i,p));case"transformation":return n(()=>M_(a,i,p));case"hash_table":return N_(a,i,p,o);case"custom":let u=bf(a.op);if(u&&u.customExecutor)return u.customExecutor(new Rf(a,i,p));throw TypeError(`Custom op ${a.op} is not registered.`);default:throw TypeError(`Unknown op '${a.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(r,e,t);return y.isPromise(s)?s.then(a=>[].concat(a)):[].concat(s)}var Gc=class{constructor(e={},t={},o={},n={},s){this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=o,this.functionMap=n,this.parseNodeNameCache=s,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 QS(r,e,t,o){let n=new Set,s=[],a=null,i=null,p=new Set,u=new Set(Object.keys(r).map(m=>Er(m)[0]));o=o||[];let l=new Set(o.map(m=>Er(m.name)[0])),c=[...e];for(;c.length>0;){let m=c.pop();if((wu(m)||ZY(m)||JY(m))&&a==null&&(a=m,i=a.children.map(d=>d.name).filter(d=>n.has(d))),n.add(m.name),t[m.name]==null&&!u.has(m.name)&&!l.has(m.name)){if(m.inputs.length===0){s.push(m.name);continue}m.inputs.forEach(d=>{p.has(d.name)||(p.add(d.name),c.push(d))})}}return{inputs:r,outputs:e,usedNodes:n,missingInputs:s,dynamicNode:a,syncInputs:i}}function L_(r,e){let{usedNodes:t,inputs:o}=e,n=Object.keys(o).map(g=>Er(g)[0]).map(g=>r.nodes[g]),s=r.initNodes||[],a=g=>t.has(typeof g=="string"?g:g.name);function i(g){return[...new Map(g.map(x=>[x.name,x])).values()]}let p=i([...n,...r.weights,...s]).filter(a),u=i([...p,...Object.values(r.nodes)]).filter(a),l=new Map(u.map(g=>[g.name,g])),c={};for(let g of u){c[g.name]=c[g.name]||0;for(let x of g.children)a(x)||(c[x.name]=Number.POSITIVE_INFINITY),c[x.name]=(c[x.name]||0)+1}let m=Object.entries(c).filter(([,g])=>g===0).map(([g])=>g),d=[...m];for(;m.length>0;){let g=m.pop(),x=l.get(g);for(let b of x.children.filter(a))--c[b.name]===0&&(d.push(b.name),m.push(b.name))}let f=d.map(g=>l.get(g)),h=qY(f,p);return jY(h,p),h}function qY(r,e){let t=new Map(r.map(a=>[a.name,a])),o=e.map(a=>a.name),n=new Set(o);for(;o.length>0;){let a=o.pop(),i=t.get(a);for(let p of i.children)!t.has(p.name)||n.has(p.name)||(n.add(p.name),o.push(p.name))}return r.filter(a=>n.has(a.name))}var Sl=class extends Error{constructor(e){super(`NodesExecutionOrderError: ${e}`)}};function jY(r,e){let t=new Map(r.map((i,p)=>[i.name,p])),o=new Set(e.map(i=>i.name)),n=i=>o.has(typeof i=="string"?i:i.name),s=new Set(r.map(i=>i.name)),a=i=>s.has(typeof i=="string"?i:i.name);for(let i of r){for(let p of i.children.filter(a)){if(!t.has(p.name))throw new Sl(`Child ${p.name} of node ${i.name} is unreachable.`);if(t.get(i.name)>t.get(p.name))throw new Sl(`Node ${i.name} is scheduled to run after its child ${p.name}.`)}if(!n(i))for(let p of i.inputs){if(!t.has(p.name))throw new Sl(`Input ${p.name} of node ${i.name} is unreachable.`);if(t.get(p.name)>t.get(i.name))throw new Sl(`Node ${i.name} is scheduled to run before its input ${p.name}.`)}}}function B_(r){let e=new Map(r.map((i,p)=>[i.name,p])),t=Number.MAX_SAFE_INTEGER,o=r.map((i,p)=>wu(i)?t:p),n=i=>{let p=o[e.get(i.name)];return p==null?-1:p},s=r.map((i,p)=>i.children.map(n).reduce((u,l)=>Math.max(u,l),o[p])),a=new Map;for(let i=0;ie[o].map(n=>n.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),{})}constructor(e,t){this.graph=e,this.parent=t,this.compiledMap=new Map,this.parseNodeNameCache=new Map,this._weightMap={},this.SEPARATOR=",",this._functions={},this._functionExecutorMap={},this.keepIntermediateTensors=!1,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(o=>{this._functionExecutorMap[o]=new r(e.functions[o],this)})}getCompilationKey(e,t){let o=e.map(s=>s.name).sort(),n=t.map(s=>s.name).sort();return o.join(this.SEPARATOR)+"--"+n.join(this.SEPARATOR)}compile(e,t){let o=QS(e,t,this.weightMap,this._initNodes),{missingInputs:n,dynamicNode:s,syncInputs:a}=o;if(s!=null)throw new Error(`This execution contains the node '${s.name}', which has the dynamic op '${s.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${a}]`);if(n.length>0){let u=t.map(c=>c.name),l=Object.keys(e);throw new Error(`Cannot compute the outputs [${u}] from the provided inputs [${l}]. Missing the following inputs: [${n}]`)}let i=L_(this.graph,o),p=B_(i);return{orderedNodes:i,nodeLiveUntilMap:p}}cloneAndKeepTensor(e){if(e==null)return null;let t=e.clone();return Fr(t),t}cloneTensorList(e){return e?e.map(o=>this.cloneAndKeepTensor(o)):null}cloneTensorMap(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,this.cloneTensorList(o)]))}execute(e,t){this.disposeIntermediateTensors(),e=this.mapInputs(e);let o=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t);let n=o.map(m=>this.graph.nodes[Er(m)[0]]),s=t.map(m=>Er(m)[0]),a=new Set(s),i=s.map(m=>this.graph.nodes[m]);i.length===0&&(i=this._outputs);let p=this.getCompilationKey(n,i),u=this.compiledMap.get(p);u==null&&(u=this.compile(e,i),this.compiledMap.set(p,u));try{this.keepIntermediateTensors=A().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let l={},c={};return De(()=>{let m=new Gc(this.weightMap,l,c,this.functionExecutorMap,this.parseNodeNameCache),d=Object.assign({},this.weightMap);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap)),Object.keys(e).forEach(x=>{let[b,w]=Er(x,m),S=[];S[w]=e[x],d[b]=S,this.keepIntermediateTensors&&(this.clonedTensorsMap[b]=this.cloneTensorList(S))});let f=this.getFrozenTensorIds(d),{orderedNodes:h,nodeLiveUntilMap:g}=u;for(let x of h){if(d[x.name])continue;let b=YS(x,d,m,this._resourceManager);if(y.isPromise(b))throw new Error(`The execution of the op '${x.op}' returned a promise. Please use model.executeAsync() instead.`);d[x.name]=b,this.keepIntermediateTensors&&(this.clonedTensorsMap[x.name]=this.cloneTensorList(b)),this.checkTensorForDisposalWithNodeLiveUntilInfo(x,d,m,f,a,g.get(x.name))}return this.parent==null&&m.dispose(f),t.map(x=>Vt(x,d,m))})}getFrozenTensorIds(e){let t=[].concat.apply([],Object.keys(e).map(o=>e[o]).map(o=>o.map(n=>n.id)));return new Set(t)}checkTensorForDisposal(e,t,o,n,s,a,i){if(!(wu(t)||a.has(e))){for(let p of o[e])p!=null&&(i[p.id]=(i[p.id]||0)+t.children.length);for(let p of t.inputs){if(wu(p))continue;let u=_S(p.name,o,n);if(u!=null)for(let l of u){if(!l||l.kept||s.has(l.id))continue;let c=i[l.id];c===1?(l.dispose(),delete i[l.id]):c!=null&&i[l.id]--}}}}checkTensorForDisposalWithNodeLiveUntilInfo(e,t,o,n,s,a){function i(p){return wu(p)||s.has(p.name)}if(!(wu(e)||a==null))for(let p of a){if(i(p))continue;let u=_S(p.name,t,o);for(let l of u)!l||l.kept||n.has(l.id)||l.dispose()}}async executeAsync(e,t){return this._executeAsync(e,t)}disposeIntermediateTensors(){this.clonedTensorsMap&&(Object.values(this.clonedTensorsMap).forEach(e=>{for(let t of e)t&&!t.isDisposed&&t.dispose()}),this.clonedTensorsMap=null)}getIntermediateTensors(){return this.clonedTensorsMap}async _executeAsync(e,t,o=!1,n={},s={}){this.disposeIntermediateTensors(),o||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t));try{this.keepIntermediateTensors=A().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(m){this.keepIntermediateTensors=!1,console.warn(m.message)}let a=new Gc(this.weightMap,n,s,this.functionExecutorMap,this.parseNodeNameCache);this.keepIntermediateTensors&&(this.clonedTensorsMap=this.cloneTensorMap(this.weightMap));let i=await this.executeWithControlFlow(e,a,t,o),p=t.map(m=>Vt(m,i,a)),u=p.map(m=>m.id),l=Object.keys(e).map(m=>e[m].id),c=new Set([...u,...l,...this.weightIds]);return Object.values(i).forEach(m=>{m.forEach(d=>{d&&!d.isDisposed&&!c.has(d.id)&&d.dispose()})}),this.parent==null&&a.dispose(c),p}async executeFunctionAsync(e,t,o){let n=e.reduce((s,a,i)=>(s[this.inputs[i].name]=a,s),{});return this._executeAsync(n,this.outputNodes,!0,t,o)}async executeWithControlFlow(e,t,o,n){let s=Object.keys(e),a=s.map(S=>this.graph.nodes[Er(S)[0]]),i=o.map(S=>Er(S)[0]),p=new Set(i),u=i.map(S=>this.graph.nodes[S]);u.length===0&&(u=this._outputs);let{usedNodes:l,missingInputs:c,dynamicNode:m,syncInputs:d}=QS(e,u,this.weightMap,this._initNodes),f=[...a,...this.graph.weights,...this._initNodes||[]].map(S=>({node:S,contexts:t.currentContext})),h=Object.assign({},this.weightMap);Object.keys(e).forEach(S=>{let[k,T]=Er(S),E=[];E[T]=e[S],h[k]=E});let g={},x=this.getFrozenTensorIds(h),b={};for(;f.length>0;){let S=this.processStack(a,f,t,h,b,x,p,g,l);await Promise.all(S)}m==null&&!n&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");let w=u.filter(S=>!wu(S)&&!Vt(S.name,h,t)).map(S=>S.name);if(w.length>0){let S="";throw m!=null&&(S=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${d}]`),new Error(`Cannot compute the outputs [${w}] from the provided inputs [${s}]. Consider providing the following inputs: [${c}]. ${S}`)}return h}processStack(e,t,o,n,s,a,i,p,u){let l=[];for(;t.length>0;){let c=t.pop();o.currentContext=c.contexts;let m="";if(c.node.op==="Enter"&&I("isConstant",c.node,n,o)&&([m]=qs(c.node.name,o)),n[c.node.name]==null){let d=YS(c.node,n,o,this._resourceManager);m||([m]=qs(c.node.name,o));let f=o.currentContext;y.isPromise(d)?l.push(d.then(h=>(n[m]=h,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(h)),o.currentContext=f,this.checkTensorForDisposal(m,c.node,n,o,a,i,p),this.processChildNodes(c.node,t,o,n,s,u),h))):(n[m]=d,this.keepIntermediateTensors&&(this.clonedTensorsMap[m]=this.cloneTensorList(d)),this.checkTensorForDisposal(m,c.node,n,o,a,i,p),this.processChildNodes(c.node,t,o,n,s,u))}else this.processChildNodes(c.node,t,o,n,s,u)}return l}processChildNodes(e,t,o,n,s,a){e.children.forEach(i=>{let[p]=qs(i.name,o);s[p]||!a.has(i.name)||(i.op==="Merge"?i.inputNames.some(u=>!!Vt(u,n,o))&&(s[p]=!0,t.push({contexts:o.currentContext,node:i})):i.inputNames.every(u=>!!Vt(u,n,o))&&(s[p]=!0,t.push({contexts:o.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 o=e[t],[n]=Er(t),s=this.graph.nodes[n];if(s.attrParams.shape&&s.attrParams.shape.value){let a=s.attrParams.shape.value,i=a.length===o.shape.length&&o.shape.every((p,u)=>a[u]===-1||a[u]===p);y.assert(i,()=>`The shape of dict['${s.name}'] provided in model.execute(dict) must be [${a}], but was [${o.shape}]`)}s.attrParams.dtype&&s.attrParams.dtype.value&&y.assert(o.dtype===s.attrParams.dtype.value,()=>`The dtype of dict['${s.name}'] provided in model.execute(dict) must be ${s.attrParams.dtype.value}, but was ${o.dtype}`)})}mapInputs(e){var t,o;let n={};for(let s in e){let a=(o=(t=this._signature)===null||t===void 0?void 0:t.inputs)===null||o===void 0?void 0:o[s];a!=null?n[a.name]=e[s]:n[s]=e[s]}return n}checkInputs(e){let t=Object.keys(e).filter(o=>{let[n]=Er(o);return this.graph.nodes[n]==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=>{var o,n;let s=(n=(o=this._signature)===null||o===void 0?void 0:o.outputs)===null||n===void 0?void 0:n[t];return s!=null?s.name:t},{})}checkOutputs(e){e.forEach(t=>{let[o]=Er(t);if(!this.graph.nodes[o])throw new Error(`The output '${t}' is not found in the graph`)})}};var Pf=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]}};var e7="?tfjs-format=file",t7="model.json",Kc=class{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}get modelStructuredOutputKeys(){return this.structuredOutputKeys}constructor(e,t={},o=Si){this.modelUrl=e,this.loadOptions=t,this.version="n/a",this.io=o,t==null&&(this.loadOptions={}),this.resourceManager=new Pf}findIOHandler(){let e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{let t=this.io.getLoadHandlers(e,this.loadOptions);if(t.length===0)t.push(this.io.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]}}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=this.handler.load();return y.isPromise(e)?e.then(t=>t.getWeightStream==null?this.loadSync(t):this.loadStreaming(t)):this.loadSync(e)}loadSync(e){let t=this.io.decodeWeights(e.weightData,e.weightSpecs);return this.loadWithWeightMap(e,t)}async loadStreaming(e){if(e.getWeightStream==null)throw new Error("Model artifacts missing streamWeights function");let t=await gd(e.getWeightStream(),e.weightSpecs);return this.loadWithWeightMap(e,t)}loadWithWeightMap(e,t){this.artifacts=e;let o=this.artifacts.modelTopology,n=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){let s=this.artifacts.userDefinedMetadata;s.signature!=null&&(n=s.signature),s.structuredOutputKeys!=null&&(this.structuredOutputKeys=s.structuredOutputKeys)}if(this.signature=n,this.version=`${o.versions.producer}.${o.versions.minConsumer}`,this.executor=new Hc(Uc.Instance.transformGraph(o,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(t),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){let s=Uc.Instance.transformGraph(e.modelInitializer);this.initializer=new Hc(s),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializerSignature=e.initializerSignature}return!0}async save(e,t){if(typeof e=="string"){let o=this.io.getSaveHandlers(e);if(o.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(o.length>1)throw new Error(`Found more than one (${o.length}) save handlers for URL '${e}'`);e=o[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)}addStructuredOutputNames(e){if(this.structuredOutputKeys){let t=e instanceof dt?[e]:e,o={};return t.forEach((n,s)=>o[this.structuredOutputKeys[s]]=n),o}return e}predict(e,t){let o=this.execute(e,this.outputNodes);return this.addStructuredOutputNames(o)}async predictAsync(e,t){let o=await this.executeAsync(e,this.outputNodes);return this.addStructuredOutputNames(o)}normalizeInputs(e){var t;if(!(e instanceof dt)&&!Array.isArray(e)){let s=(t=this.signature)===null||t===void 0?void 0:t.inputs;if(s!=null)for(let a in s){let i=s[a];i.resourceId!=null&&(e[a]=this.resourceIdToCapturedInput[i.resourceId])}return e}e=Array.isArray(e)?e:[e];let o=Object.keys(this.resourceIdToCapturedInput).length;if(e.length+o!==this.inputNodes.length)throw new Error(`Input tensor count mismatch, the graph model has ${this.inputNodes.length-o} non-resource placeholders, while there are ${e.length} input tensors provided.`);let n=0;return this.inputNodes.reduce((s,a)=>{var i,p,u;let l=(u=(p=(i=this.signature)===null||i===void 0?void 0:i.inputs)===null||p===void 0?void 0:p[a])===null||u===void 0?void 0:u.resourceId;return l!=null?s[a]=this.resourceIdToCapturedInput[l]:s[a]=e[n++],s},{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}executeInitializerGraph(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.execute({},[]):this.initializer.execute({},Object.keys(this.initializerSignature.outputs))}async executeInitializerGraphAsync(){return this.initializer==null?[]:this.initializerSignature==null?this.initializer.executeAsync({},[]):this.initializer.executeAsync({},Object.keys(this.initializerSignature.outputs))}setResourceIdToCapturedInput(e){if(this.resourceIdToCapturedInput={},this.initializerSignature){let t=this.initializerSignature.outputs,o=Object.keys(t);for(let n=0;n1?o:o[0]}async executeAsync(e,t){this.resourceIdToCapturedInput==null&&this.setResourceIdToCapturedInput(await this.executeInitializerGraphAsync()),e=this.normalizeInputs(e),t=this.normalizeOutputs(t);let o=await this.executor.executeAsync(e,t);return o.length>1?o:o[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((t,o)=>(t[o]=[e[o]],t),{})}dispose(){this.executor.dispose(),this.initializer&&(this.initializer.dispose(),this.resourceIdToCapturedInput&&Lt(this.resourceIdToCapturedInput)),this.resourceManager.dispose()}};async function r7(r,e={},t=Si){if(r==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");e==null&&(e={}),e.fromTFHub&&typeof r=="string"&&(r=n7(r));let o=new Kc(r,e,t);return await o.load(),o}function o7(r){if(r==null)throw new Error("modelUrl in loadGraphModelSync() cannot be null. Please provide model artifacts or an IOHandler that loads the model");let e;if(r instanceof Array){let[o,n]=r;if(!o)throw new Error("modelJSON must be the first element of the array");if(!n||!(n instanceof ArrayBuffer))throw new Error("An ArrayBuffer of weights must be the second element of the array");if(!("modelTopology"in o))throw new Error("Model JSON is missing 'modelTopology'");if(!("weightsManifest"in o))throw new Error("Model JSON is missing 'weightsManifest'");let s=Si.getWeightSpecs(o.weightsManifest),a=Si.getModelArtifactsForJSONSync(o,s,n);e=Si.fromMemorySync(a)}else if("load"in r)e=r;else if("modelTopology"in r&&"weightSpecs"in r&&"weightData"in r)e=Si.fromMemorySync(r);else throw new Error("Unknown model format");let t=new Kc(e);return t.load(),t}function n7(r){return r.endsWith("/")||(r=r+"/"),`${r}${t7}${e7}`}var s7="4.17.0";function Q(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!=="complex64",()=>`${e} does not support complex64 tensors in the CPU backend.`)})}var a7=Ut.whereImpl,Il=class r extends mo{nextDataId(){return r.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new mn(this,cr())}write(e,t,o){this.firstUse&&(this.firstUse=!1,A().get("IS_NODE")&&C.warn(` ============================ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details. -============================`));let n={id:this.nextDataId()};return this.data.set(n,{values:t,dtype:o,refCount:1}),n}makeTensorInfo(t,e,o){let n;if(e==="string"&&o!=null&&o.length>0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,t,e)}else n=this.write(o,t,e);return{dataId:n,shape:t,dtype:e}}refCount(t){return this.data.has(t)?this.data.get(t).refCount:0}incRef(t){let e=this.data.get(t);e.refCount++}decRef(t){if(this.data.has(t)){let e=this.data.get(t);e.refCount--}}move(t,e,o,n,s){this.data.set(t,{values:e,dtype:n,refCount:s})}numDataIds(){return this.data.numDataIds()}async read(t){return this.readSync(t)}readSync(t){let{dtype:e,complexTensorInfos:o}=this.data.get(t);if(e==="complex64"){let n=this.readSync(o.real.dataId),s=this.readSync(o.imag.dataId);return w.mergeRealAndImagArrays(n,s)}return y.convertBackendValuesAndArrayBuffer(this.data.get(t).values,e)}bufferSync(t){let e=this.readSync(t.dataId);if(t.dtype==="string")try{let o=e.map(n=>y.decodeString(n));return me(t.shape,t.dtype,o)}catch(o){throw new Error("Failed to decode encoded string bytes into utf-8")}return me(t.shape,t.dtype,e)}makeOutput(t,e,o){return ur().makeTensorFromTensorInfo(this.makeTensorInfo(e,o,t),this)}disposeData(t,e=!1){if(this.data.has(t)){if(this.data.get(t).refCount--,!e&&this.data.get(t).refCount>0)return!1;let{complexTensorInfos:o}=this.data.get(t);o!=null&&(this.disposeData(o.real.dataId,!0),this.disposeData(o.imag.dataId,!0)),this.data.delete(t)}return!0}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}async time(t){let e=y.now();return t(),{kernelMs:y.now()-e}}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(t){Q([t],"where");let e=this.readSync(t.dataId);return A8(t.shape,e)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};hc.nextDataId=0;var wc={};qe(wc,{addImpl:()=>zS,bincountImpl:()=>yc,bincountReduceImpl:()=>kf,bitwiseAndImpl:()=>VS,castImpl:()=>BS,ceilImpl:()=>WS,concatImpl:()=>np,equalImpl:()=>US,expImpl:()=>HS,expm1Impl:()=>qS,floorDivImpl:()=>XS,floorImpl:()=>jS,gatherNdImpl:()=>Nf,gatherV2Impl:()=>Tf,greaterEqualImpl:()=>QS,greaterImpl:()=>YS,lessEqualImpl:()=>JS,lessImpl:()=>ZS,linSpaceImpl:()=>_f,logImpl:()=>eI,maxImpl:()=>$f,maximumImpl:()=>tI,minimumImpl:()=>rI,multiplyImpl:()=>Ll,negImpl:()=>oI,notEqualImpl:()=>nI,prodImpl:()=>sI,raggedGatherImpl:()=>Ef,raggedRangeImpl:()=>Rf,raggedTensorToTensorImpl:()=>Df,rangeImpl:()=>ap,rsqrtImpl:()=>iI,scatterImpl:()=>zs,sigmoidImpl:()=>k_,simpleAbsImpl:()=>LS,sliceImpl:()=>ip,sparseFillEmptyRowsImpl:()=>Af,sparseReshapeImpl:()=>Ff,sparseSegmentReductionImpl:()=>Cc,sqrtImpl:()=>__,squaredDifferenceImpl:()=>pI,staticRegexReplaceImpl:()=>cI,stridedSliceImpl:()=>Pf,stringNGramsImpl:()=>up,stringSplitImpl:()=>pp,stringToHashBucketFastImpl:()=>cp,subImpl:()=>mI,tileImpl:()=>Of,topKImpl:()=>Mf,transposeImpl:()=>bc,uniqueImpl:()=>lp});function LS(r){let t=new Float32Array(r.length);for(let e=0;e{let{x:t}=r.inputs,e=r.backend;Q(t,"abs");let o=new Float32Array(y.sizeFromShape(t.shape)),n=e.data.get(t.dataId).values;return o=LS(n),e.makeOutput(o,t.shape,t.dtype)},XT={kernelName:Xs,backendName:"cpu",kernelFunc:F8};function ze(r){return(t,e,o,n,s)=>{let a=w.assertAndGetBroadcastShape(t,e),i=a.length,p=y.computeStrides(a),u=y.sizeFromShape(a),c=y.getTypedArrayFromDType(s,u),l=t.length,m=e.length,d=y.computeStrides(t),f=y.computeStrides(e),h=w.getBroadcastDims(t,a),g=w.getBroadcastDims(e,a);if(h.length+g.length===0)for(let x=0;xC[E]=0);let S=y.locToIndex(C,l,d),k=b.slice(-m);g.forEach(E=>k[E]=0);let _=y.locToIndex(k,m,f);c[x]=r(o[S],n[_])}return[c,a]}}function Ht(r){let{inputs:t,backend:e}=r,{real:o,imag:n}=t,s=e.data.get(o.dataId).values,a=e.data.get(n.dataId).values,i=e.makeTensorInfo(o.shape,"complex64"),p=e.data.get(i.dataId);return p.complexTensorInfos={real:e.makeTensorInfo(o.shape,"float32",s),imag:e.makeTensorInfo(n.shape,"float32",a)},i}var YT={kernelName:Ri,backendName:"cpu",kernelFunc:Ht};function gc(r,t,e="float32"){if(e==="complex64"){let n=gc(r,t,"float32"),s=gc(r,t,"float32");return Ht({inputs:{real:n,imag:s},backend:r})}let o=y.makeZerosTypedArray(y.sizeFromShape(t),e);return r.makeTensorInfo(t,e,o)}function lr(r){let{inputs:t,backend:e}=r,{x:o}=t;return e.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var QT={kernelName:Co,backendName:"cpu",kernelFunc:lr};function Eo(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.data.get(o.dataId).complexTensorInfos.real,s=e.data.get(n.dataId).values;return e.makeTensorInfo(n.shape,n.dtype,s)}var ZT={kernelName:Gi,backendName:"cpu",kernelFunc:Eo};function BS(r,t,e,o){if(o==="int32"){let n=Int32Array.from(r);return[t,"int32",n]}if(o==="bool"){let n=y.toTypedArray([0],e),[s,a]=ze((i,p)=>i!==p?1:0)(t,[],r,n,"bool");return[a,"bool",s]}throw new Error(`Error in Cast: failed to cast ${e} to ${o}`)}function Ro(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dtype:s}=o;if(s==="complex64"){if(n.dtype==="complex64")return lr({inputs:{x:n},backend:e});let c=gc(e,n.shape,n.dtype),l=Ro({inputs:{x:n},backend:e,attrs:{dtype:"float32"}}),m=Ht({inputs:{real:l,imag:c},backend:e});return e.disposeIntermediateTensorInfo(c),e.disposeIntermediateTensorInfo(l),m}if(n.dtype==="complex64"){let c=Eo({inputs:{input:n},backend:e}),l=Ro({inputs:{x:c},backend:e,attrs:{dtype:s}});return e.disposeIntermediateTensorInfo(c),l}if(!y.hasEncodingLoss(n.dtype,s)){let c=lr({inputs:{x:n},backend:e});return{dataId:c.dataId,shape:c.shape,dtype:s}}let a=e.data.get(n.dataId).values,[i,p,u]=BS(a,n.shape,n.dtype,s);return e.makeTensorInfo(i,p,u)}var JT={kernelName:yo,backendName:"cpu",kernelFunc:Ro};function Ye(r,t,e,o){return e==null?({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;Q([a,i],r);let u=p.data.get(a.dataId).values,c=p.data.get(i.dataId).values,l=a.dtype==="string"?w.fromUint8ToStringArray(u):u,m=a.dtype==="string"?w.fromUint8ToStringArray(c):c,d=o||a.dtype,[f,h]=t(a.shape,i.shape,l,m,d);return p.makeTensorInfo(h,d,f)}:({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(a.dtype==="complex64"||i.dtype==="complex64"){let u=Ro({inputs:{x:a},backend:p,attrs:{dtype:"complex64"}}),c=p.data.get(u.dataId),l=c.complexTensorInfos.real,m=c.complexTensorInfos.imag,d=p.data.get(l.dataId).values,f=p.data.get(m.dataId).values,h=Ro({inputs:{x:i},backend:p,attrs:{dtype:"complex64"}}),g=p.data.get(h.dataId),x=g.complexTensorInfos.real,b=g.complexTensorInfos.imag,C=p.data.get(x.dataId).values,S=p.data.get(b.dataId).values,[k,_,E]=e(a.shape,i.shape,d,f,C,S),R=p.makeTensorInfo(E,"float32",k),D=p.makeTensorInfo(E,"float32",_),P=Ht({inputs:{real:R,imag:D},backend:p});return p.disposeIntermediateTensorInfo(u),p.disposeIntermediateTensorInfo(h),p.disposeIntermediateTensorInfo(R),p.disposeIntermediateTensorInfo(D),P}else{let u=p.data.get(a.dataId).values,c=p.data.get(i.dataId).values,l=o||a.dtype,[m,d]=t(a.shape,i.shape,u,c,l);return p.makeTensorInfo(d,l,m)}}}function xc(r){return(t,e,o,n,s,a)=>{let i=w.assertAndGetBroadcastShape(t,e),p=y.sizeFromShape(i),u=i.length,c=y.computeStrides(i),l=y.getTypedArrayFromDType("float32",p),m=y.getTypedArrayFromDType("float32",p),d=w.getBroadcastDims(t,i),f=w.getBroadcastDims(e,i),h=w.mergeRealAndImagArrays(o,n),g=w.mergeRealAndImagArrays(s,a),x=t.length,b=y.computeStrides(t),C=e.length,S=y.computeStrides(e);if(d.length+f.length===0)for(let k=0;kE[M]=0);let R=y.locToIndex(E,x,b),D=_.slice(-C);f.forEach(M=>D[M]=0);let P=y.locToIndex(D,C,S),O=r(h[R*2],h[R*2+1],g[P*2],g[P*2+1]);l[k]=O.real,m[k]=O.imag}return[l,m,i]}}var zS=ze((r,t)=>r+t),P8=xc((r,t,e,o)=>({real:r+e,imag:t+o})),Pa=Ye(io,zS,P8),e_={kernelName:io,backendName:"cpu",kernelFunc:Pa};function yc(r,t,e,o,n){let s=y.sizeFromShape(o),a=y.makeZerosTypedArray(n,e);for(let i=0;i=n||(s>0?a[p]+=t[i]:a[p]+=1)}return a}function kf(r,t,e,o=!1){let n=r.shape[0],s=r.shape[1],a=me([n,e],t.dtype);for(let i=0;i=e||(o?a.set(1,i,u):t.size>0?a.set(a.get(i,u)+t.get(i,p),i,u):a.set(a.get(i,u)+1,i,u))}return a}var VS=ze((r,t)=>r&t),O8=Ye(qa,VS),t_={kernelName:qa,backendName:"cpu",kernelFunc:O8};function jt(r){return(t,e,o)=>{let n=y.getArrayFromDType(e,t.length);for(let s=0;s{let{x:a}=o;Q(a,r);let i=s,p=i.data.get(a.dataId).values,u;if(a.dtype==="string"){if(!Array.isArray(p))throw new Error("String tensor's value was not an instance of Array");u=w.fromUint8ToStringArray(p)}else u=p;let c=e||a.dtype,l=t(u,c,n);return i.makeTensorInfo(a.shape,c,l)}}var WS=jt(r=>Math.ceil(r)),M8=Dr(en,WS),r_={kernelName:en,backendName:"cpu",kernelFunc:M8};function np(r,t,e,o){let n=y.getArrayFromDType(e,y.sizeFromShape(t));if(o&&e!=="string"){let s=0;r.forEach(a=>{let i=y.sizeFromShape(a.shape);n.set(a.vals,s),s+=i})}else{let s=0;r.forEach(a=>{let i=e==="string"?w.fromUint8ToStringArray(a.vals):a.vals,p=0;for(let u=0;ur===t?1:0),GS=Ye(xn,US,null,"bool"),o_={kernelName:xn,backendName:"cpu",kernelFunc:GS};var HS=jt(r=>Math.exp(r)),KS=Dr(yn,HS,"float32"),n_={kernelName:yn,backendName:"cpu",kernelFunc:KS};var qS=jt(r=>Math.expm1(r)),L8=Dr(bn,qS),s_={kernelName:bn,backendName:"cpu",kernelFunc:L8};var jS=jt(r=>Math.floor(r)),B8=Dr(wn,jS),a_={kernelName:wn,backendName:"cpu",kernelFunc:B8};var XS=ze((r,t)=>Math.floor(r/t)),z8=Ye(Sn,XS,null,"int32"),i_={kernelName:Sn,backendName:"cpu",kernelFunc:z8};function Nf(r,t,e,o,n,s,a,i,p){let u=me([o,s],e);for(let c=0;c=p/s)throw new Error(`Invalid indices: ${l} does not index into ${i}`);for(let d=0;dr>t?1:0),V8=Ye(kn,YS,null,"bool"),u_={kernelName:kn,backendName:"cpu",kernelFunc:V8};var QS=ze((r,t)=>r>=t?1:0),W8=Ye(Nn,QS,null,"bool"),p_={kernelName:Nn,backendName:"cpu",kernelFunc:W8};var ZS=ze((r,t)=>rr<=t?1:0),G8=Ye(Dn,JS,null,"bool"),l_={kernelName:Dn,backendName:"cpu",kernelFunc:G8};function _f(r,t,e){let o=(t-r)/(e-1),n=y.makeZerosTypedArray(e,"float32");n[0]=r;for(let s=1;sMath.log(r)),H8=Dr(Fn,eI),m_={kernelName:Fn,backendName:"cpu",kernelFunc:H8};function $f(r,t,e,o){let n=y.getTypedArrayFromDType(o,y.sizeFromShape(e));for(let s=0;si)&&(i=u)}n[s]=i}return n}var tI=ze((r,t)=>Math.max(r,t)),K8=Ye(Vn,tI),d_={kernelName:Vn,backendName:"cpu",kernelFunc:K8};var rI=ze((r,t)=>Math.min(r,t)),q8=Ye(Hn,rI),f_={kernelName:Hn,backendName:"cpu",kernelFunc:q8};var Ll=ze((r,t)=>r*t),j8=xc((r,t,e,o)=>({real:r*e-t*o,imag:r*o+t*e})),sp=Ye(Xn,Ll,j8),h_={kernelName:Xn,backendName:"cpu",kernelFunc:sp};function oI(r,t,e){let o=y.createScalarValue(-1,e);return Ll([],t,o,r,e)}function X8(r){let{inputs:t,backend:e}=r,{x:o}=t;Q(o,"neg");let n=e.data.get(o.dataId).values,[s,a]=oI(n,o.shape,o.dtype);return e.makeTensorInfo(a,o.dtype,s)}var g_={kernelName:pa,backendName:"cpu",kernelFunc:X8};var nI=ze((r,t)=>r!==t?1:0),Y8=Ye(Yn,nI,null,"bool"),x_={kernelName:Yn,backendName:"cpu",kernelFunc:Y8};function bc(r,t,e,o,n){let s=t.length,a=y.sizeFromShape(t),i=y.computeStrides(t),p=y.computeStrides(n),u=y.getTypedArrayFromDType(e,y.sizeFromShape(n));for(let c=0;ce.disposeIntermediateTensorInfo(b)),e.makeTensorInfo(x,g,f)}var b_={kernelName:os,backendName:"cpu",kernelFunc:Q8};function Z8(r,t,e){r.forEach((o,n)=>{if(o<0||o>=e){let s=y.indexToLoc(n,t.length,y.computeStrides(t)).join(",");throw new Error(`indices[${s}] = ${o} is not in [0, ${e})`)}})}function J8(r,t){for(let e=0;en)throw new Error("Ragged splits must not point past values");for(let s=1;so[s])throw new Error("Ragged splits must be sorted in ascending order")}}function eY(r,t,e,o){let n=[],s=0,a=t.length-1+e.length,i=new Array(a).fill(null).map(()=>[0]);J8(e,o);let p=1;for(let u=0;u=0){let h=i[f],g=h[h.length-1]-d[c];for(let x=c;xn[a]=s)}return t}function C_(r,t){let e=r.slice(0,t);for(;e.length1)throw new Error("starts must be a scalar or vector");if(n.length>1)throw new Error("limits must be a scalar or vector");if(a.length>1)throw new Error("deltas must be a scalar or vector");let i=t.length===0,p=n.length===0,u=a.length===0,c=[];i||c.push(t[0]),p||c.push(n[0]),u||c.push(a[0]);for(let g=1;g0&&bx)S=0;else if(S=Math.ceil(Math.abs((b-x)/C)),S>w_)throw new Error(`Requires ((limit - start) / delta) <= ${w_}`);m[g+1]=m[g]+S}let d=m[l],f=y.getArrayFromDType(e,d),h=0;for(let g=0;go&&(o=s)}return o}static getMaxWidthValueRowID(t){let e=t.length;if(e===0)return 0;let o=0,n=t[0],s=0;for(let a=1;a"Final length of result must be equal to firstDimension."),s}calculateOutputIndexRowSplit(t,e,o,n){let s=t.length,a=[];for(let i=0;i0&&a.length!==t[s-1])throw new Error("Invalid row split size.");return a}calculateOutputIndexValueRowID(t,e,o,n){let s=t.length,a=[];if(s===0)return[];let i=0,p=t[0];if(p>=e.length)throw new Error(`Got currentValueRowId=${p}, which is not less than ${e.length}`);let u=e[p];a.push(u);for(let c=1;c=0&&(++i,i=e.length)throw new Error(`Got nextValueRowId=${l} which is not less than ${e.length}`);u=e[l]}a.push(u)}if(a.length!==t.length)throw new Error("Invalid row ids.");return a}calculateOutputIndex(t,e,o,n){let s=this.getRowPartitionTensor(t),a=this.getRowPartitionTypeByDimension(t);switch(a){case Do.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,e,o,n);case Do.ROW_SPLITS:if(s.length-1>e.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${e.length}`);return this.calculateOutputIndexRowSplit(s,e,o,n);default:throw new Error(`Unsupported partition type: ${Do[a]}`)}}getFirstDimensionSize(){let t=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");let e=this.rowPartitionTypes[0];switch(e){case Do.FIRST_DIM_SIZE:return t[0];case Do.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case Do.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${Do[e]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");let e=this.getFirstDimensionSize(),o=this.calculateOutputSize(e),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let p=n.length-2;p>=0;--p)n[p]=n[p+1]*o[p+1];let s=I_(o,!1),a=y.getArrayFromDType(this.valuesDType,y.sizeFromShape(s));if(n[0]*o[0]>0){let p=this.calculateFirstParentOutputIndex(e,n[0],o[0]);for(let u=1;u<=this.raggedRank;++u)p=this.calculateOutputIndex(u-1,p,n[u],o[u]);this.setOutput(this.raggedRank,p,a,s)}return[s,a]}setOutput(t,e,o,n){if(o.length===0)return;let s=this.values,a=o,i=n.slice();i=i.slice(t+1);let p=y.sizeFromShape(i),u=e.length,c=this.defaultValue;if(c.length!==p&&c.length!==1){let f=this.defaultValueShape;De(()=>{let h=W(c,f);c=ou(h,i).dataSync()})}let l=0,m=0,d=0;for(let f=0;f<=u;++f){let h=f=u){let g=o.length;h=Math.floor(g/p)}if(h>d)if(this.defaultValue.length===1)a.subarray(d*p,h*p).fill(this.defaultValue[0]),d=h;else for(;h>d;){let g=a.slice(d*p);S_(g,c,p),++d}h<0?(l=f+1,m=d):(l=f,m=d,d=m+1)}}};function S_(r,t,e){for(let o=0;o= 0`);if(o<-1)throw new Error(`Dimension ${o} must be >= -1`);o=-1}e.push(o)}return e}function Df(r,t,e,o,n,s,a,i,p,u){return new aI(r,t,e,o,n,s,a,i,p,u).compute()}function ap(r,t,e,o){let n=r===t,s=r1;if(n||s||a)return y.makeZerosTypedArray(0,o);let i=Math.abs(Math.ceil((t-r)/e)),p=y.makeZerosTypedArray(i,o);t1/Math.sqrt(r)),nY=Dr(ls,iI),v_={kernelName:ls,backendName:"cpu",kernelFunc:nY};function zs(r,t,e,o,n,s,a,i,p,u){let c=[o/n,n],l=r.values,m=t.values;if(o===0)return me(e,t.dtype);let d=p instanceof tt?p:me(c,t.dtype);typeof p=="string"||typeof p=="number"?d.values.fill(p):typeof p=="boolean"&&d.values.fill(+p);for(let f=0;f=o/n)throw new Error(`Invalid indices: ${h} does not index into ${e}`);for(let x=0;x1/(1+Math.exp(-r))),uI=Ie(bs,r=>1/(1+Math.exp(-r))),N_={kernelName:bs,backendName:"cpu",kernelFunc:uI};function ip(r,t,e,o,n){let s=pt.isSliceContinous(o,t,e),a=y.sizeFromShape(e),i=y.computeStrides(o);if(s){let l=pt.computeFlatOffset(t,i);return n==="string"?r.slice(l,l+a):r.subarray(l,l+a)}let p=n==="string"?w.fromUint8ToStringArray(r):r,u=me(o,n,p),c=me(e,n);for(let l=0;lf+t[h]);c.set(u.get(...d),...m)}return n==="string"?w.fromStringArrayToUint8(c.values):c.values}function Ao(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,size:a}=o;Q(n,"slice");let[i,p]=pt.parseSliceParams(n,s,a);pt.assertParamsValid(n,i,p);let u=e.data.get(n.dataId).values,c=ip(u,i,p,n.shape,n.dtype);return e.makeTensorInfo(p,n.dtype,c)}var T_={kernelName:ha,backendName:"cpu",kernelFunc:Ao};function Af(r,t,e,o,n,s,a){let i=t[0],p=s[0],u=new Array(p),c=new Array(i),l=t[1];if(p===0){if(i!==0)throw new Error(w.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i));let g=y.getArrayFromDType(e,0),x=y.getArrayFromDType(n,0);return[g,[0,l],x,u,c]}let m=!0,d=0,f=new Array(p).fill(0);for(let g=0;g=p)throw new Error(w.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,x,p));++f[x],m=m&&x>=d,d=x}let h=!0;for(let g=0;g0&&(f[g]+=f[g-1])}if(h&&m){let g=r,x=o;for(let b=0;b0){d[m-1]=1;for(let g=m-2;g>=0;--g)d[g]=d[g+1]*o[g+1]}let f=[];if(i>0){f[i-1]=1;for(let g=i-2;g>=0;--g)f[g]=f[g+1]*p[g+1]}let h=y.getArrayFromDType(e,a*i);for(let g=0;g0?n[i-1]+1:0;if(l<0)throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=t.slice();m[0]=l;let d=m.reduce((C,S)=>C*S,1),f=y.getArrayFromDType(e,d);if(i===0)return l>0&&f.fill(a),[f,m];if(l<=0)throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let h=0,g=1,x=0,b=n[h];for(;;){let C=0;if(g=C)throw new Error(w.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(b<0||b>=l)throw new Error(w.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b,l));b>x&&f.fill(a,x*u,b*u);for(let S=h;S=p[0])throw new Error(w.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S,o[S],p[0]));for(let _=0;_i)break}return xMath.sqrt(r)),sY=Ie(ws,r=>Math.sqrt(r)),$_={kernelName:ws,backendName:"cpu",kernelFunc:sY};var pI=ze((r,t)=>{let e=r-t;return e*e}),aY=Ye(ks,pI),E_={kernelName:ks,backendName:"cpu",kernelFunc:aY};var cI=jt((r,t)=>{let{pattern:e,replaceGlobal:o,rewrite:n}=t;return r.replace(new RegExp(e,o?"g":""),n)}),iY=Dr($u,cI),R_={kernelName:$u,backendName:"cpu",kernelFunc:iY};function Pf(r,t,e,o){let n=me(r,t.dtype);for(let s=0;s0?0:i-p),d=0;d+=u*this.leftPad.length;for(let b=0;bb.forEach(C=>h[g++]=C);for(let b=0;b0){x(t[m+l-1]);for(let b=0;b0){let p=e[0];if(p!==0)throw new Error(`First split value must be 0, got ${p}`);for(let u=1;u=p;if(c=c&&e[u]<=o,!c)throw new Error(`Invalid split value ${e[u]}, must be in [${p}, ${o}]`);p=e[u]}if(p!==o)throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`)}let s=n-1,a=y.getArrayFromDType("int32",n);if(o===0||n===0){let p=new Array(o);for(let u=0;u<=s;++u)a[u]=0;return[p,a]}a[0]=0;for(let p=1;p<=s;++p){let u=e[p]-e[p-1],c=0;this.nGramWidths.forEach(l=>{c+=this.getNumNGrams(u,l)}),this.preserveShort&&u>0&&c===0&&(c=1),a[p]=a[p-1]+c}let i=new Array(a[s]);for(let p=0;p{let m=e[p+1]-e[p],d=this.getNumNGrams(m,l);this.createNGrams(t,u,i,c,d,l),c+=d}),this.preserveShort&&c===a[p]){let l=e[p+1]-e[p];if(l===0)continue;let m=l+2*this.padWidth,d=1;this.createNGrams(t,u,i,c,d,m)}}return[i,a]}};function up(r,t,e,o,n,s,a,i){return new lI(e,o,n,s,a,i).compute(r,t)}function uY(r,t,e,o){if(!r.length)return;if(t.length===0){for(let s=0;sr-t),pY=xc((r,t,e,o)=>({real:r-e,imag:t-o})),Bl=Ye(Ts,mI,pY),D_={kernelName:Ts,backendName:"cpu",kernelFunc:Bl};function Of(r,t){let e=new Array(r.rank);for(let n=0;n{let e=t.value-r.value;return e===0?r.index-t.index:e};function A_(r,t,e=0,o=r.length-1){for(;o>e;){if(o-e>600){let i=o-e+1,p=t-e+1,u=Math.log(i),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(i-c)/i)*Math.sign(p-i/2),m=Math.max(e,Math.floor(t-p*c/i+l)),d=Math.min(o,Math.floor(t+(i-p)*c/i+l));A_(r,t,m,d)}let n=r[t],s=e,a=o;for(y.swap(r,e,t),zl(r[o],n)>0&&y.swap(r,e,o);s0;)a=a-1}zl(r[e],n)===0?y.swap(r,e,a):(a=a+1,y.swap(r,a,o)),a<=t&&(e=a+1),t<=a&&(o=a-1)}}function Mf(r,t,e,o,n){let s=t[t.length-1],[a,i]=[r.length/s,s],p=y.getTypedArrayFromDType(e,a*o),u=y.getTypedArrayFromDType("int32",a*o);for(let l=0;lf[C]={value:b,index:C}),o{for(let g=0;gnew hc,1);var dI=Ie(hn,r=>r>=0?r:Math.exp(r)-1),F_={kernelName:hn,backendName:"cpu",kernelFunc:dI};function fI(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{alpha:s}=o;Q([n],"leakyRelu");let a=y.sizeFromShape(n.shape),i=e.data.get(n.dataId).values,p=y.getTypedArrayFromDType("float32",a);for(let u=0;ur<0?t*r:r);function hI(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t;Q([o,n],"prelu");let s=e.data.get(o.dataId).values,a=e.data.get(n.dataId).values,[i,p]=lY(o.shape,n.shape,s,a,"float32");return e.makeTensorInfo(p,"float32",i)}var O_={kernelName:rs,backendName:"cpu",kernelFunc:hI};var gI=Ie(ss,r=>Math.max(0,r)),M_={kernelName:ss,backendName:"cpu",kernelFunc:gI};var xI=Ie(us,r=>Math.min(Math.max(0,r),6)),L_={kernelName:us,backendName:"cpu",kernelFunc:xI};function mp(r,t,e,o,n){if(e==="linear")return lr({inputs:{x:t},backend:r});if(e==="relu")return gI({inputs:{x:t},backend:r});if(e==="elu")return dI({inputs:{x:t},backend:r});if(e==="relu6")return xI({inputs:{x:t},backend:r});if(e==="prelu")return hI({inputs:{x:t,alpha:o},backend:r});if(e==="leakyrelu")return fI({inputs:{x:t},backend:r,attrs:{alpha:n}});if(e==="sigmoid")return uI({inputs:{x:t},backend:r});throw new Error(`Activation ${e} has not been implemented for the CPU backend.`)}function Ve(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{shape:s}=o,a=y.sizeFromShape(n.shape),i=y.inferFromImplicitShape(s,a),p=y.sizeFromShape(i);y.assert(a===p,()=>`The new shape (${i}) has ${p} elements and the old shape (${n.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`),e.incRef(n.dataId);let u=e.data.get(n.dataId);if(u.complexTensorInfos!=null){let c=u.complexTensorInfos.real,l=u.complexTensorInfos.imag;c.shape=i,l.shape=i}return{dataId:n.dataId,shape:i,dtype:n.dtype}}var B_={kernelName:da,backendName:"cpu",kernelFunc:Ve};function yI(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;Q([n,s],"matMul");let p=n.shape.length,u=s.shape.length,c=a?n.shape[p-2]:n.shape[p-1],l=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),C=Sr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(c===l,()=>`Error in matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,c,m]:[g,m,c],k=i?[x,d,l]:[x,l,d],_=Ve({inputs:{x:n},backend:e,attrs:{shape:S}}),E=Ve({inputs:{x:s},backend:e,attrs:{shape:k}}),R=a?_.shape[1]:_.shape[2],D=a?_.shape[2]:_.shape[1],P=i?E.shape[1]:E.shape[2],O=Math.max(g,x),M=e.data.get(_.dataId).values,L=e.data.get(E.dataId).values,B=y.computeStrides(_.shape),z=y.computeStrides(E.shape),[U,j,q]=a?[B[0],1,B[1]]:[B[0],B[1],1],[Y,J,re]=i?[1,z[1],z[0]]:[z[1],1,z[0]],ne=D*P,ee=me([O,D,P],_.dtype),oe=ee.values,ie=e.blockSize;for(let le=0;leMath.acos(r)),W_={kernelName:Vo,backendName:"cpu",kernelFunc:dY};var fY=Ie(Wo,r=>Math.acosh(r)),U_={kernelName:Wo,backendName:"cpu",kernelFunc:fY};function hY(r){let{inputs:t,backend:e}=r,o=t;Q(t,"addN");let n=o.map(i=>e.data.get(i.dataId).values),s=me(o[0].shape,o[0].dtype),a=s.values;for(let i=0;ib&&(b=k,C=S)}d[g]=C}return u.forEach(g=>e.disposeIntermediateTensorInfo(g)),e.makeTensorInfo(c,"int32",d)}var q_={kernelName:Ys,backendName:"cpu",kernelFunc:yY};function bY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o;Q(n,"argMin");let a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=St({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),a=[a[0]],w.assertAxesAreInnerMostDims("argMin",a,p.shape.length);let[c,l]=w.computeOutAndReduceShapes(p.shape,a),m=y.sizeFromShape(c),d=y.makeZerosTypedArray(m,"int32"),f=y.sizeFromShape(l),h=e.data.get(p.dataId).values;for(let g=0;ge.disposeIntermediateTensorInfo(g)),e.makeTensorInfo(c,"int32",d)}var j_={kernelName:Qs,backendName:"cpu",kernelFunc:bY};var CY=Ie(Ko,r=>Math.asin(r)),X_={kernelName:Ko,backendName:"cpu",kernelFunc:CY};var wY=Ie(qo,r=>Math.asinh(r)),Y_={kernelName:qo,backendName:"cpu",kernelFunc:wY};var SY=Ie(jo,r=>Math.atan(r)),Q_={kernelName:jo,backendName:"cpu",kernelFunc:SY};var IY=ze((r,t)=>Math.atan2(r,t)),vY=Ye(Yo,IY),Z_={kernelName:Yo,backendName:"cpu",kernelFunc:vY};var kY=Ie(Xo,r=>Math.atanh(r)),J_={kernelName:Xo,backendName:"cpu",kernelFunc:kY};function Sc(r,t,e,o,n,s){let a=n.strideHeight,i=n.strideWidth,p=n.dilationHeight,u=n.dilationWidth,c=n.effectiveFilterHeight,l=n.effectiveFilterWidth,m=n.padInfo.top,d=n.padInfo.left,f=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,h=me(n.outShape,e),g=h.values,x=n.outShape[1]*n.outShape[2]*n.outShape[3],b=n.outShape[2]*n.outShape[3],C=n.outShape[3];for(let S=0;Sj?j=ie:s==="avg"&&(q+=ie,Y++)}if(isNaN(j))break}let J=M+L*C+E;g[J]=s==="avg"?q/Y:j}}}return h}function Lf(r,t,e,o,n=!1,s=!1){let a=me(o.outShape,"int32"),i=o.strideHeight,p=o.strideWidth,u=o.dilationHeight,c=o.dilationWidth,l=o.effectiveFilterHeight,m=o.effectiveFilterWidth,d=o.padInfo.top,f=o.padInfo.left,h=me(t,e,r);for(let g=0;gP&&(P=U,n?O=s?((g*o.inHeight+M)*o.inWidth+B)*o.inChannels+x:(M*o.inWidth+B)*o.inChannels+x:O=L*m+z)}}a.set(O,g,b,_,x)}}return a}function Bf(r,t,e,o,n,s){let a=n.strideDepth,i=n.strideHeight,p=n.strideWidth,u=n.dilationDepth,c=n.dilationHeight,l=n.dilationWidth,m=n.effectiveFilterDepth,d=n.effectiveFilterHeight,f=n.effectiveFilterWidth,h=n.padInfo.front,g=n.padInfo.top,x=n.padInfo.left,b=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,C=me(n.outShape,e),S=C.values,k=n.outShape[1]*n.outShape[2]*n.outShape[3]*n.outShape[4],_=n.outShape[2]*n.outShape[3]*n.outShape[4],E=n.outShape[3]*n.outShape[4],R=n.outShape[4];for(let D=0;D_e?_e=gt:s==="avg"&&(ve+=gt,Fe++),isNaN(_e))break}if(isNaN(_e))break}if(isNaN(_e))break}let Pe=be+M;S[Pe]=s==="avg"?ve/Math.max(Fe,1):_e}}}}return C}function e$(r,t){let e=me(t.outShape,"int32"),o=t.strideDepth,n=t.strideHeight,s=t.strideWidth,a=t.dilationDepth,i=t.dilationHeight,p=t.dilationWidth,u=t.effectiveFilterDepth,c=t.effectiveFilterHeight,l=t.effectiveFilterWidth,m=t.padInfo.front,d=t.padInfo.top,f=t.padInfo.left;for(let h=0;h=L&&(L=re,B=U*c*l+q*c+J)}}}e.set(B,h,x,k,D,g)}}}return e}function NY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t;Q(n,"avgPool");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(w.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p),l;if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))l=lr({inputs:{x:n},backend:e});else{let m=e.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=Sc(m,n.shape,n.dtype,d,c,"avg");l=e.makeTensorInfo(c.outShape,n.dtype,f.values)}return l}var t$={kernelName:Qo,backendName:"cpu",kernelFunc:NY};function TY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,"avgPool3d");let c=w.computePool3DInfo(n.shape,s,a,1,i,p,u),l=e.data.get(n.dataId).values,m=Bf(l,n.shape,n.dtype,y.computeStrides(n.shape),c,"avg");return e.makeTensorInfo(m.shape,"float32",m.values)}var r$={kernelName:Zs,backendName:"cpu",kernelFunc:TY};function _Y(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],"avgPool3DGrad");let c=w.computePool3DInfo(s.shape,a,i,1,p,u),l=c.strideDepth,m=c.strideHeight,d=c.strideWidth,f=c.filterDepth,h=c.filterHeight,g=c.filterWidth,x=c.dilationDepth,b=c.dilationHeight,C=c.dilationWidth,S=c.effectiveFilterDepth,k=c.effectiveFilterHeight,_=c.effectiveFilterWidth,E=S-1-c.padInfo.front,R=_-1-c.padInfo.left,D=k-1-c.padInfo.top,P=me(s.shape,"float32"),O=1/(f*h*g),M=e.bufferSync(n);for(let L=0;L=c.outDepth||Math.floor(ee)!==ee))for(let oe=0;oe=c.outHeight||Math.floor(ie)!==ie))for(let le=0;le<_;le+=C){let be=(J+le)/d;if(be<0||be>=c.outWidth||Math.floor(be)!==be)continue;let _e=M.get(L,ee,ie,be,B);re+=_e}}}P.set(re*O,L,z,U,j,B)}return e.makeTensorInfo(P.shape,P.dtype,P.values)}var o$={kernelName:Ei,backendName:"cpu",kernelFunc:_Y};function $Y(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s;Q([n,s],"avgPoolGrad");let{filterSize:i,strides:p,pad:u}=o,c=w.computePool2DInfo(a.shape,i,p,1,u),l=c.strideHeight,m=c.strideWidth,d=c.filterHeight,f=c.filterWidth,h=c.dilationHeight,g=c.dilationWidth,x=c.effectiveFilterHeight,b=c.effectiveFilterWidth,C=b-1-c.padInfo.left,S=x-1-c.padInfo.top,k=me(a.shape,"float32"),_=1/(d*f),E=e.data.get(n.dataId).values,R=me(n.shape,"float32",E);for(let D=0;D=c.outHeight||Math.floor(j)!==j))for(let q=0;q=c.outWidth||Math.floor(Y)!==Y)continue;let J=R.get(D,j,Y,P);z+=J}}k.set(z*_,D,O,M,P)}return e.makeTensorInfo(k.shape,k.dtype,k.values)}var n$={kernelName:$i,backendName:"cpu",kernelFunc:$Y};function EY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,scale:s,offset:a,mean:i,variance:p}=t;y.assert(i.shape.length===p.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),y.assert(a==null||i.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),y.assert(s==null||i.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),Q([n,i,p,s,a],"batchNorm");let{varianceEpsilon:u}=o;u==null&&(u=.001);let c=e.data.get(n.dataId).values,l=e.data.get(i.dataId).values,m=e.data.get(p.dataId).values,d=s?e.data.get(s.dataId).values:new Float32Array([1]),f=a?e.data.get(a.dataId).values:new Float32Array([0]),h=new Float32Array(c.length),g=f.length,x=d.length,b=m.length,C=l.length,S=0,k=0,_=0,E=0;for(let R=0;R=g&&(S=0),k>=C&&(k=0),_>=x&&(_=0),E>=b&&(E=0);return e.makeTensorInfo(n.shape,n.dtype,h)}var s$={kernelName:In,backendName:"cpu",kernelFunc:EY};function RY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,crops:a}=o;Q([n],"batchToSpaceND");let i=s.reduce((x,b)=>x*b),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=Ve({inputs:{x:n},backend:e,attrs:{shape:p}}),f=St({inputs:{x:d},backend:e,attrs:{perm:u}}),h=Ve({inputs:{x:f},backend:e,attrs:{shape:c}}),g=Ao({inputs:{x:h},backend:e,attrs:{begin:l,size:m}});return e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),g}var a$={kernelName:Js,backendName:"cpu",kernelFunc:RY};function DY(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,u=yc(i,p,s.dtype,s.shape,a);return e.makeTensorInfo([a],s.dtype,u)}var i$={kernelName:Jo,backendName:"cpu",kernelFunc:DY};function AY(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t,s=e.data.get(o.dataId).values,a=e.data.get(n.dataId).values,i=w.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return e.makeTensorInfo([i.length],"int32",Int32Array.from(i))}var u$={kernelName:ea,backendName:"cpu",kernelFunc:AY};var FY=Ie(bo,(r,t)=>{let e=t;return r>e.clipValueMax?e.clipValueMax:r{let{x:t}=r.inputs,e=r.backend,o=new Float32Array(y.sizeFromShape(t.shape)),n=e.data.get(t.dataId),s=n.complexTensorInfos.real,a=n.complexTensorInfos.imag,i=e.data.get(s.dataId).values,p=e.data.get(a.dataId).values;for(let u=0;uh.shape);w.assertParamsConsistent(a,s);let i=w.computeOutShape(t.map(h=>h.shape),s);if(y.sizeFromShape(i)===0)return e.makeTensorInfo(i,t[0].dtype,[]);let p=t.filter(h=>y.sizeFromShape(h.shape)>0);if(p.length===1)return lr({inputs:{x:p[0]},backend:e});if(p[0].dtype==="complex64"){let h=p.map(S=>Eo({inputs:{input:S},backend:e})),g=p.map(S=>Oa({inputs:{input:S},backend:e})),x=du({inputs:h,backend:e,attrs:{axis:s}}),b=du({inputs:g,backend:e,attrs:{axis:s}}),C=Ht({inputs:{real:x,imag:b},backend:e});return h.forEach(S=>e.disposeIntermediateTensorInfo(S)),g.forEach(S=>e.disposeIntermediateTensorInfo(S)),e.disposeIntermediateTensorInfo(x),e.disposeIntermediateTensorInfo(b),C}let u=p.map(h=>{let x=[-1,y.sizeFromShape(h.shape.slice(s))];return Ve({inputs:{x:h},backend:e,attrs:{shape:x}})}),c=u.map(h=>({vals:e.data.get(h.dataId).values,shape:h.shape}));i=w.computeOutShape(u.map(h=>h.shape),1);let l=u[0].shape[0]===1,m=np(c,i,t[0].dtype,l),d=w.computeOutShape(p.map(h=>h.shape),s),f=e.makeTensorInfo(d,t[0].dtype,m);return u.forEach(h=>e.disposeIntermediateTensorInfo(h)),f}var m$={kernelName:ta,backendName:"cpu",kernelFunc:du};function bI(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=o;Q([n,s],"conv2d");let l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,s.shape,a,u,i,c,!1,l),d=m.filterHeight,f=m.filterWidth,h=m.dilationHeight,g=m.dilationWidth,x=m.padInfo.left,b=m.padInfo.top,C=m.dataFormat==="channelsLast",S=new tt(m.outShape,n.dtype),k=y.computeStrides(n.shape),_=y.computeStrides(s.shape),E=k[0],R=C?k[1]:k[2],D=C?k[2]:1,P=C?1:k[1],O=S.strides[0],M=C?S.strides[1]:S.strides[2],L=C?S.strides[2]:1,B=C?1:S.strides[1],z=e.data.get(n.dataId).values,U=e.data.get(s.dataId).values,j=S.values;for(let q=0;q=m.inHeight)continue;let le=oe*_[0],be=Y+ie*R;for(let _e=0;_e=m.inWidth)continue;let ct=le+Pe*_[1],Ge=be+st*D,lt=ct;for(let it=0;it=u.inDepth)continue;let q=U*D[0],Y=O+j*R[1];for(let J=0;J=u.inHeight)continue;let ie=q+ee*D[1],le=Y+oe*R[2];for(let be=0;be=u.inWidth)continue;let st=ie+Fe*D[2],ct=le+Pe*u.inChannels,Ge=st;for(let lt=0;ltMath.cos(r)),b$={kernelName:sn,backendName:"cpu",kernelFunc:VY};var WY=Ie(an,r=>Math.cosh(r)),C$={kernelName:an,backendName:"cpu",kernelFunc:WY};function UY(r){let{inputs:t,backend:e,attrs:o}=r,{image:n,boxes:s,boxInd:a}=t,{cropSize:i,method:p,extrapolationValue:u}=o,[c,l,m,d]=n.shape,f=s.shape[0],[h,g]=i,x=me([f,h,g,d],"float32"),b=e.data.get(s.dataId).values,C=e.data.get(a.dataId).values,S=e.data.get(n.dataId).values,k=y.computeStrides(n.shape),_=y.computeStrides(x.shape);for(let E=0;E=c)continue;let B=h>1?(O-D)*(l-1)/(h-1):0,z=g>1?(M-P)*(m-1)/(g-1):0;for(let U=0;U1?D*(l-1)+U*B:.5*(D+O)*(l-1);if(j<0||j>l-1){for(let q=0;q1?P*(m-1)+re*z:.5*(P+M)*(m-1);if(ne<0||ne>m-1){for(let le=0;le1?P*(m-1)+q*z:.5*(P+M)*(m-1);if(Y<0||Y>m-1){for(let ne=0;nex+f-b-1:(x,b)=>x+b;for(let x=0;xx+f-b-1:(x,b)=>x+b;for(let x=0;x`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`);let i=n.shape[0],p=n.shape[1],u=n.shape[2],c=n.shape[3],l=p*s,m=u*s,d=c/(s*s),f=e.data.get(n.dataId).values,h=new Float32Array(i*l*m*d),g=0;for(let x=0;x`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${m}'`);let d=w.computeConv2DInfo(n.shape,s.shape,a,m,i,u,!0),{filterHeight:f,filterWidth:h,dilationHeight:g,dilationWidth:x,padInfo:b}=d,C=b.left,S=b.top,k=d.outChannels/d.inChannels,_=new tt(d.outShape,n.dtype),E=e.data.get(n.dataId).values,R=e.data.get(s.dataId).values,D=_.values;for(let P=0;P=d.inHeight)continue;let q=U*l[0],Y=O+j*c[1];for(let J=0;J=d.inWidth)continue;let ie=q+ee*l[1],le=Y+oe*d.inChannels,be=re,_e=ie;for(let ve=0;ve{let{x:o,filter:n}=r,{strides:s,pad:a,dilations:i}=e,p=t,u=p.data.get(o.dataId).values,c=o.shape.length,l=p.data.get(n.dataId).values,m=n.shape.length,{batchSize:d,inHeight:f,inWidth:h,inChannels:g,outHeight:x,outWidth:b,padInfo:C,strideHeight:S,strideWidth:k,filterHeight:_,filterWidth:E,dilationHeight:R,dilationWidth:D,outShape:P}=w.computeDilation2DInfo(o.shape,n.shape,s,a,"NHWC",i),O=y.sizeFromShape(P),M=P.length,L=y.getArrayFromDType(o.dtype,O);for(let z=0;z=0&&oe=0&&lere&&(re=ve)}}}let ne=y.locToIndex([z,U,q,J],M,y.computeStrides(P));L[ne]=re}}}return{dataId:p.write(y.toTypedArray(L,o.dtype),P,o.dtype),shape:P,dtype:o.dtype}}};var R$={kernelName:Mi,backendName:"cpu",kernelFunc:({inputs:r,backend:t,attrs:e})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=e,u=t,c=y.toNestedArray(o.shape,u.data.get(o.dataId).values),l=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:C,strideWidth:S,filterHeight:k,filterWidth:_,dilationHeight:E,dilationWidth:R,outShape:D}=w.computeDilation2DInfo(o.shape,n.shape,a,i,"NHWC",p);y.assert(s.rank===D.length,()=>`Error in ${Mi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let P=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(n.shape,n.dtype);for(let L=0;L=0&&ee=0&&ieY&&(Y=le,J=ne,re=oe)}}}O[J][re][q]+=P[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}};var D$={kernelName:Oi,backendName:"cpu",kernelFunc:({inputs:r,backend:t,attrs:e})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=e,u=t,c=y.toNestedArray(o.shape,u.data.get(o.dataId).values),l=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:C,strideWidth:S,filterHeight:k,filterWidth:_,dilationHeight:E,dilationWidth:R,outShape:D}=w.computeDilation2DInfo(o.shape,n.shape,a,i,"NHWC",p);y.assert(s.rank===D.length,()=>`Error in ${Oi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let P=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(o.shape,o.dtype);for(let L=0;L=0&&ee=0&&ieY&&(Y=le,J=ee,re=ie)}}}O[L][J][re][q]+=P[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),o.shape,o.dtype),shape:o.shape,dtype:o.dtype}}};function QY(r){let{inputs:t,backend:e,attrs:o}=r,{image:n}=t,{canvas:s,options:a}=o,{contextOptions:i,imageOptions:p}=a||{},u=(p==null?void 0:p.alpha)||1,c=(i==null?void 0:i.contextType)||"2d";if(c!=="2d")throw new Error(`Context type ${i.contextType} is not supported by the CPU backend.`);let l=s.getContext(c,(i==null?void 0:i.contextAttributes)||{});if(l==null)throw new Error(`Could not get the context with ${c} type.`);let[m,d]=n.shape.slice(0,2),f=n.shape.length===2?1:n.shape[2],h=e.data.get(n.dataId).values,g=n.dtype==="float32"?255:1,x=new Uint8ClampedArray(d*m*4);for(let C=0;C1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${E}.`)}else if(n.dtype==="int32"&&(E<0||E>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${E}.`);f===1?(S[0]=E*g,S[1]=E*g,S[2]=E*g):S[_]=E*g}let k=C*4;x[k+0]=Math.round(S[0]),x[k+1]=Math.round(S[1]),x[k+2]=Math.round(S[2]),x[k+3]=Math.round(S[3])}s.width=d,s.height=m;let b=new ImageData(x,d,m);return l.putImageData(b,0,0),n}var A$={kernelName:_u,backendName:"cpu",kernelFunc:QY};function di(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;Q(n,"sum");let i;n.dtype==="bool"?i=Ro({inputs:{x:n},backend:e,attrs:{dtype:"int32"}}):i=lr({inputs:{x:n},backend:e});let p=i.shape.length,u=y.parseAxisParam(s,i.shape),c=w.getAxesPermutation(u,p),l=u,m=i;c!=null&&(m=St({inputs:{x:i},backend:e,attrs:{perm:c}}),l=w.getInnerMostAxes(l.length,p)),w.assertAxesAreInnerMostDims("sum",l,m.shape.length);let[d,f]=w.computeOutAndReduceShapes(m.shape,l),h=w.upcastType(m.dtype,"int32"),g=gc(e,d,h),x=y.sizeFromShape(f),b=e.data.get(g.dataId).values,C=e.data.get(m.dataId).values;for(let S=0;S=0&&(m=di({inputs:{x:m},backend:e,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&e.disposeIntermediateTensorInfo(h);return m}var P$={kernelName:Li,backendName:"cpu",kernelFunc:ZY};function JY(r){let{inputs:t,backend:e}=r,{dy:o,y:n}=t;Q([o,n],"eluGrad");let s=new Float32Array(y.sizeFromShape(n.shape)),a=e.data.get(n.dataId).values,i=e.data.get(o.dataId).values;for(let p=0;p=0?s[p]=i[p]:s[p]=i[p]*(u+1)}return e.makeTensorInfo(n.shape,"float32",s)}var O$={kernelName:Xa,backendName:"cpu",kernelFunc:JY};var eQ=w.ERF_P,tQ=w.ERF_A1,rQ=w.ERF_A2,oQ=w.ERF_A3,nQ=w.ERF_A4,sQ=w.ERF_A5,aQ=Ie(gn,r=>{let t=Math.sign(r),e=Math.abs(r),o=1/(1+eQ*e);return t*(1-((((sQ*o+nQ)*o+oQ)*o+rQ)*o+tQ)*o*Math.exp(-e*e))}),M$={kernelName:gn,backendName:"cpu",kernelFunc:aQ};function Ic(r){let{inputs:t,backend:e,attrs:o}=r,{input:n}=t,{dim:s}=o,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),Ve({inputs:{x:n},backend:e,attrs:{shape:i}})}var L$={kernelName:na,backendName:"cpu",kernelFunc:Ic};var iQ=ze((r,t)=>r/t),Vl=Ye(fn,iQ),Wl={kernelName:fn,backendName:"cpu",kernelFunc:Vl};function zf(r,t,e){let o=r.shape,n=o[0],s=o[1],a=e.data.get(r.dataId),i=a.complexTensorInfos.real,p=a.complexTensorInfos.imag,u=[n,s],c=y.sizeFromShape(u),l=y.getTypedArrayFromDType("float32",c),m=y.getTypedArrayFromDType("float32",c);for(let g=0;g{let{image:o}=r,n=e,s=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[a,i,p,u]=o.shape,c=n.data.get(o.dataId).values;for(let m=0;m=0&&C=0,()=>`GatherV2: the index value ${k} is not in [0, ${c-1}]`)}let l=i;i==null&&(l=0);let m=y.sizeFromShape(s.shape),d=w.segment_util.collectGatherOpShapeInfo(n,s,p,l),f=Ve({inputs:{x:n},backend:e,attrs:{shape:[d.batchSize,d.outerSize,d.dimSize,d.sliceSize]}}),h=Ve({inputs:{x:s},backend:e,attrs:{shape:[d.batchSize,m/d.batchSize]}}),g=[d.batchSize,d.outerSize,m/d.batchSize,d.sliceSize],x=e.bufferSync(h),b=e.bufferSync(f),C=Tf(b,x,g);return e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),e.makeTensorInfo(d.outputShape,C.dtype,C.values)}var H$={kernelName:aa,backendName:"cpu",kernelFunc:gQ};function xQ(r){let{inputs:t,backend:e}=r,{input:o}=t,n=y.sizeFromShape(o.shape),s=o.shape[o.shape.length-1],a=n/s,i=Ve({inputs:{x:o},backend:e,attrs:{shape:[a,s]}}),p=zf(i,!0,e),u=Ve({inputs:{x:p},backend:e,attrs:{shape:o.shape}});return e.disposeIntermediateTensorInfo(i),e.disposeIntermediateTensorInfo(p),u}var K$={kernelName:zi,backendName:"cpu",kernelFunc:xQ};var yQ=Ie(Tn,r=>Number.isFinite(r)?1:0,"bool"),q$={kernelName:Tn,backendName:"cpu",kernelFunc:yQ};var bQ=Ie(_n,r=>Math.abs(r)===1/0?1:0,"bool"),j$={kernelName:_n,backendName:"cpu",kernelFunc:bQ};var CQ=Ie($n,r=>Number.isNaN(r)?1:0,"bool"),X$={kernelName:$n,backendName:"cpu",kernelFunc:CQ};function wQ(r){let{backend:t,attrs:e}=r,{start:o,stop:n,num:s}=e,a=_f(o,n,s);return t.makeTensorInfo([a.length],"float32",a)}var Y$={kernelName:An,backendName:"cpu",kernelFunc:wQ};var SQ=Ie(Pn,r=>Math.log1p(r)),Q$={kernelName:Pn,backendName:"cpu",kernelFunc:SQ};var IQ=ze((r,t)=>r&&t),vQ=Ye(On,IQ,null,"bool"),Z$={kernelName:On,backendName:"cpu",kernelFunc:vQ};var kQ=Ie(Mn,r=>r?0:1,"bool"),J$={kernelName:Mn,backendName:"cpu",kernelFunc:kQ};var NQ=ze((r,t)=>r||t),TQ=Ye(Ln,NQ,null,"bool"),eE={kernelName:Ln,backendName:"cpu",kernelFunc:TQ};function _Q(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o;Q(n,"LRN");let u=n.shape[3],c=u-1,l=e.data.get(n.dataId).values,m=y.sizeFromShape(n.shape),d=new Float32Array(m);function f(h){let g=h%u,x=h-g+Math.max(0,g-s),b=h-g+Math.min(g+s,c),C=0;for(;x<=b;x++){let S=l[x];C+=S*S}return C}for(let h=0;h`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p),l;if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))l=lr({inputs:{x:n},backend:e});else{let m=e.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=Sc(m,n.shape,n.dtype,d,c,"max");l=e.makeTensorInfo(c.outShape,n.dtype,f.values)}return l}var nE={kernelName:Wn,backendName:"cpu",kernelFunc:EQ};function RQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,"maxPool3d");let c=w.computePool3DInfo(n.shape,s,a,1,i,p,u),l=e.data.get(n.dataId).values,m=Bf(l,n.shape,n.dtype,y.computeStrides(n.shape),c,"max");return e.makeTensorInfo(m.shape,"float32",m.values)}var sE={kernelName:ia,backendName:"cpu",kernelFunc:RQ};function DQ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],"maxPool3DGrad");let c=w.computePool3DInfo(s.shape,a,i,1,p,u),l=e.bufferSync(s),m=e$(l,c),d=c.strideDepth,f=c.strideHeight,h=c.strideWidth,g=c.dilationDepth,x=c.dilationHeight,b=c.dilationWidth,C=c.effectiveFilterDepth,S=c.effectiveFilterHeight,k=c.effectiveFilterWidth,_=C-1-c.padInfo.front,E=k-1-c.padInfo.left,R=S-1-c.padInfo.top,D=me(s.shape,"float32"),P=e.bufferSync(n);for(let O=0;O=c.outDepth||Math.floor(re)!==re))for(let ne=0;ne=c.outHeight||Math.floor(ee)!==ee))for(let oe=0;oe=c.outWidth||Math.floor(ie)!==ie)continue;let le=C*S*k-1-m.get(O,re,ee,ie,M),be=J*S*k+ne*k+oe,_e=le===be?1:0;if(_e===0)continue;let ve=P.get(O,re,ee,ie,M);Y+=ve*_e}}}D.set(Y,O,L,B,z,M)}return e.makeTensorInfo(D.shape,D.dtype,D.values)}var aE={kernelName:Ui,backendName:"cpu",kernelFunc:DQ};function AQ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s,output:a}=t,i=s;Q([s,a],"maxPoolGrad");let{filterSize:p,strides:u,pad:c,dimRoundingMode:l}=o,m=w.computePool2DInfo(i.shape,p,u,1,c,l),d=e.data.get(i.dataId).values,f=me(m.outShape,i.dtype,Lf(d,i.shape,i.dtype,m).values),h=m.strideHeight,g=m.strideWidth,x=m.dilationHeight,b=m.dilationWidth,C=m.effectiveFilterHeight,S=m.effectiveFilterWidth,k=S-1-m.padInfo.left,_=C-1-m.padInfo.top,E=me(i.shape,"float32"),R=e.data.get(n.dataId).values,D=me(n.shape,"float32",R);for(let P=0;P=m.outHeight||Math.floor(q)!==q))for(let Y=0;Y=m.outWidth||Math.floor(J)!==J)continue;let re=C*S-1-f.get(P,q,J,O),ne=j*S+Y,ee=re===ne?1:0;if(ee===0)continue;let oe=D.get(P,q,J,O);U+=oe*ee}}E.set(U,P,M,L,O)}return e.makeTensorInfo(E.shape,E.dtype,E.values)}var iE={kernelName:Wi,backendName:"cpu",kernelFunc:AQ};function uE(r,t,e,o,n){let s=y.computeStrides(t),a=Sc(r,t,e,s,n,"max"),i=Lf(r,t,e,n,!0,o);return[a.values,i.values]}var pE={kernelName:ua,backendName:"cpu",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=t,p=e;Q(o,"MaxPoolWithArgmax");let u=p.data.get(o.dataId).values,c=w.computePool2DInfo(o.shape,n,s,[1,1],a),[l,m]=uE(u,o.shape,o.dtype,i,c),d=p.write(l,c.outShape,o.dtype),f=p.write(m,c.outShape,o.dtype);return[{dataId:d,shape:c.outShape,dtype:o.dtype},{dataId:f,shape:c.outShape,dtype:"int32"}]}};function FQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=y.parseAxisParam(s,n.shape),u=w.computeOutAndReduceShapes(n.shape,i)[1],c=y.sizeFromShape(u),l=[],m=e.makeTensorInfo([],"float32",new Float32Array([c]));l.push(m);let d=Ro({inputs:{x:n},backend:e,attrs:{dtype:"float32"}});l.push(d);let f=Vl({inputs:{a:d,b:m},backend:e});l.push(f);let h=di({inputs:{x:f},backend:e,attrs:{axis:s,keepDims:a}});return l.forEach(g=>e.disposeIntermediateTensorInfo(g)),h}var cE={kernelName:Un,backendName:"cpu",kernelFunc:FQ};function PQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;Q(n,"min");let i=y.parseAxisParam(s,n.shape),p=i,u=w.getAxesPermutation(p,n.shape.length),c=n;u!=null&&(c=St({inputs:{x:n},backend:e,attrs:{perm:u}}),p=w.getInnerMostAxes(p.length,n.shape.length)),w.assertAxesAreInnerMostDims("min",p,c.shape.length);let[l,m]=w.computeOutAndReduceShapes(c.shape,p),d=y.sizeFromShape(m),f=y.makeZerosTypedArray(y.sizeFromShape(l),c.dtype),h=e.data.get(c.dataId).values;for(let x=0;xC[0]+n.shape[S]+C[1]),p=s.map(C=>C[0]),u=s.map((C,S)=>C[0]+n.shape[S]),c=a==="reflect"?0:1,l=e.data.get(n.dataId).values,m=n.shape.length,d=y.computeStrides(n.shape),f=y.sizeFromShape(i),h=i.length,g=y.computeStrides(i),x=y.getTypedArrayFromDType(n.dtype,f);for(let C=0;C=u[_]&&(S[_]=(u[_]-1)*2-S[_]+c);S=S.map((_,E)=>_-p[E]);let k=y.locToIndex(S,m,d);x[C]=l[k]}return{dataId:e.write(x,i,n.dtype),shape:i,dtype:n.dtype}}var mE={kernelName:Kn,backendName:"cpu",kernelFunc:OQ};var MQ=ze((r,t)=>{let e=r%t;return r<0&&t<0||r>=0&&t>=0?e:(e+t)%t}),LQ=Ye(qn,MQ),dE={kernelName:qn,backendName:"cpu",kernelFunc:LQ};var hE=Lp(qw());function II(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{dim:s}=o,a=n.shape.length,i=s;if(i===-1&&(i=a-1),i!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${i}`);let p=y.parseAxisParam([i],n.shape),u=SI({inputs:{x:n},backend:e,attrs:{reductionIndices:p,keepDims:!1}}),c=w.expandShapeToKeepDim(u.shape,p),l=Ve({inputs:{x:u},backend:e,attrs:{shape:c}}),m=Bl({inputs:{a:n,b:l},backend:e}),d=KS({inputs:{x:m},backend:e}),f=di({inputs:{x:d},backend:e,attrs:{axis:p,keepDims:!1}}),h=Ve({inputs:{x:f},backend:e,attrs:{shape:c}}),g=Vl({inputs:{a:d,b:h},backend:e});return e.disposeIntermediateTensorInfo(u),e.disposeIntermediateTensorInfo(l),e.disposeIntermediateTensorInfo(m),e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),g}var fE={kernelName:Is,backendName:"cpu",kernelFunc:II};function BQ(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o;Q(n,"multinomial");let p=i?n:II({inputs:{logits:n},backend:e,attrs:{dim:-1}}),u=p.shape[0],c=p.shape[1],l=e.data.get(p.dataId).values,m=[u,s],d=y.makeZerosTypedArray(y.sizeFromShape(m),"int32");for(let f=0;f=0&&l[m]{y.assertShapesMatch(s,c.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===c.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=t.map(c=>{let l=Ic({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=du({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeIntermediateTensorInfo(c)),u}var vE={kernelName:la,backendName:"cpu",kernelFunc:vI};function qQ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{paddings:s,constantValue:a}=o;Q(n,"pad");let i=s.map((b,C)=>b[0]+n.shape[C]+b[1]),p=s.map(b=>b[0]),u=e.data.get(n.dataId).values,c=y.sizeFromShape(n.shape),l=n.shape.length,m=y.computeStrides(n.shape),d=y.sizeFromShape(i),f=i.length,h=y.computeStrides(i),g=y.getTypedArrayFromDType(n.dtype,d);a!==0&&g.fill(a);for(let b=0;b_+p[E]),k=y.locToIndex(S,f,h);g[k]=u[b]}return{dataId:e.write(g,i,n.dtype),shape:i,dtype:n.dtype}}var Vf={kernelName:es,backendName:"cpu",kernelFunc:qQ};var jQ=ze((r,t)=>Math.pow(r,t)),XQ=Ye(ts,jQ),kE={kernelName:ts,backendName:"cpu",kernelFunc:XQ};function YQ(r){let{inputs:t,backend:e,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=t,{outputRaggedRank:i}=o,p=n.map(x=>e.data.get(x.dataId).values),u=n.map(x=>x.shape),c=e.data.get(s.dataId).values,l=e.data.get(a.dataId).values,[m,d,f]=Ef(p,u,c,s.shape,s.dtype,l,a.shape,i),h=m.map(x=>e.makeTensorInfo([x.length],"int32",x)),g=e.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var NE={kernelName:Up,backendName:"cpu",kernelFunc:YQ};function QQ(r){let{inputs:t,backend:e}=r,{starts:o,limits:n,deltas:s}=t,a=e.data.get(o.dataId).values,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,[u,c]=Rf(a,o.shape,o.dtype,i,n.shape,p,s.shape),l=e.makeTensorInfo([u.length],"int32",u),m=e.makeTensorInfo([c.length],o.dtype,c);return[l,m]}var TE={kernelName:Gp,backendName:"cpu",kernelFunc:QQ};function ZQ(r){let{inputs:t,backend:e,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=t,{rowPartitionTypes:p}=o,u=e.data.get(n.dataId).values,c=e.data.get(s.dataId).values,l=e.data.get(a.dataId).values,m=i.map(g=>e.data.get(g.dataId).values),d=i.map(g=>g.shape),[f,h]=Df(u,n.shape,c,s.shape,s.dtype,l,a.shape,m,d,p);return e.makeTensorInfo(f,s.dtype,h)}var _E={kernelName:Hp,backendName:"cpu",kernelFunc:ZQ};function JQ(r){let{backend:t,attrs:e}=r,{start:o,stop:n,dtype:s,step:a}=e,i=ap(o,n,a,s);return t.makeTensorInfo([i.length],s,i)}var $E={kernelName:ma,backendName:"cpu",kernelFunc:JQ};var e7=Ie(ns,r=>1/r),EE={kernelName:ns,backendName:"cpu",kernelFunc:e7};function t7(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o;Q(n,"resizeBilinear");let p=y.computeStrides(n.shape),[u,c]=i,[l,m,d,f]=n.shape,h=e.data.get(n.dataId).values,g=new Float32Array(y.sizeFromShape([l,u,c,f])),x=[s&&u>1?m-1:m,s&&c>1?d-1:d],b=[s&&u>1?u-1:u,s&&c>1?c-1:c],C=0,S=x[0]/b[0],k=x[1]/b[1];for(let _=0;_1?u-1:u,a&&d>1?c-1:c],g=[a&&m>1?m-1:m,a&&d>1?d-1:d],x=h[0]/g[0],b=h[1]/g[1],C=e.data.get(s.dataId).values,S=0;for(let k=0;k1?m-1:m,s&&c>1?d-1:d],b=[s&&u>1?u-1:u,s&&c>1?c-1:c],C=x[0]/b[0],S=x[1]/b[1],k=0;for(let _=0;_1?c-1:c,a&&f>1?l-1:l],b=[a&&d>1?d-1:d,a&&f>1?f-1:f],C=x[0]/b[0],S=x[1]/b[1],k=1/C,_=1/S,E=Math.ceil(k)*2+2,R=Math.ceil(_)*2+2;for(let D=0;D=d)continue;let ee=P+ne*p[1],oe=ne*C,ie=Math.min(c-1,a?Math.round(oe):Math.floor(oe));if(O===ie)for(let le=0;le=f)continue;let _e=ee+be*p[2],ve=be*S,Fe=Math.min(l-1,a?Math.round(ve):Math.floor(ve));z===Fe&&(J+=g[_e+Y])}}h[U+Y]=J}}}}return e.makeTensorInfo(n.shape,n.dtype,h)}var FE={kernelName:Za,backendName:"cpu",kernelFunc:n7};function s7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o;Q(n,"reverse");let a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return lr({inputs:{x:n},backend:e});let p=new tt(n.shape,n.dtype),u=e.bufferSync(n);for(let c=0;cm[d]=n.shape[d]-1-m[d]),p.set(u.get(...m),...l)}return e.makeTensorInfo(p.shape,p.dtype,p.values)}var PE={kernelName:ps,backendName:"cpu",kernelFunc:s7};var OE={kernelName:Ds,backendName:"cpu",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=t,i=e,p=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[u,c,l,m]=o.shape,[d,f]=w.getImageCenter(a,c,l),h=255,g=Math.sin(n),x=Math.cos(n),b=i.data.get(o.dataId).values;for(let S=0;S=0&&B=0&&z{let t=Math.floor(r);return r-t<.5?Math.floor(r):r-t>.5?Math.ceil(r):t%2===0?t:t+1}),ME={kernelName:cs,backendName:"cpu",kernelFunc:a7};function i7(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(s,n,a),m=!0,d=e.bufferSync(n),f=e.bufferSync(s),h=zs(d,f,a,l,u,p,i,c,0,m);return e.makeTensorInfo(a,h.dtype,h.values)}var LE={kernelName:ms,backendName:"cpu",kernelFunc:i7};function u7(r,t){let e=0,o=r.length,n=0;for(;e1||n.shape.length===1?1:y.sizeFromShape(n.shape.slice(1));for(let f=0;fr>=0?d7*r:m7*(Math.exp(r)-1)),WE={kernelName:hs,backendName:"cpu",kernelFunc:f7};var h7=Ie(ys,r=>r<0?-1:r>0?1:0),UE={kernelName:ys,backendName:"cpu",kernelFunc:h7};var g7=Ie(gs,r=>Math.sin(r)),GE={kernelName:gs,backendName:"cpu",kernelFunc:g7};var x7=Ie(xs,r=>Math.sinh(r)),HE={kernelName:xs,backendName:"cpu",kernelFunc:x7};var y7=11920928955078125e-23,KE=Math.log(y7)+2,b7=Ie(Cs,r=>{let t=r>-KE,e=r0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,e,t)}else n=this.write(o,e,t);return{dataId:n,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,o,n,s){this.data.set(e,{values:t,dtype:n,refCount:s})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){let{dtype:t,complexTensorInfos:o}=this.data.get(e);if(t==="complex64"){let n=this.readSync(o.real.dataId),s=this.readSync(o.imag.dataId);return C.mergeRealAndImagArrays(n,s)}return y.convertBackendValuesAndArrayBuffer(this.data.get(e).values,t)}bufferSync(e){let t=this.readSync(e.dataId);if(e.dtype==="string")try{let o=t.map(n=>y.decodeString(n));return ie(e.shape,e.dtype,o)}catch(o){throw new Error("Failed to decode encoded string bytes into utf-8")}return ie(e.shape,e.dtype,t)}makeOutput(e,t,o){return cr().makeTensorFromTensorInfo(this.makeTensorInfo(t,o,e),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:o}=this.data.get(e);o!=null&&(this.disposeData(o.real.dataId,!0),this.disposeData(o.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=y.now();return e(),{kernelMs:y.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){Q([e],"where");let t=this.readSync(e.dataId);return a7(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}};Il.nextDataId=0;var Xf={};qe(Xf,{addImpl:()=>eI,bincountImpl:()=>Nl,bincountReduceImpl:()=>Of,bitwiseAndImpl:()=>tI,castImpl:()=>JS,ceilImpl:()=>rI,concatImpl:()=>mp,equalImpl:()=>oI,expImpl:()=>sI,expm1Impl:()=>iI,floorDivImpl:()=>pI,floorImpl:()=>uI,gatherNdImpl:()=>Mf,gatherV2Impl:()=>Lf,greaterEqualImpl:()=>cI,greaterImpl:()=>lI,lessEqualImpl:()=>dI,lessImpl:()=>mI,linSpaceImpl:()=>Bf,logImpl:()=>fI,maxImpl:()=>zf,maximumImpl:()=>hI,minimumImpl:()=>gI,multiplyImpl:()=>qc,negImpl:()=>xI,notEqualImpl:()=>yI,prodImpl:()=>bI,raggedGatherImpl:()=>Vf,raggedRangeImpl:()=>Wf,raggedTensorToTensorImpl:()=>Uf,rangeImpl:()=>fp,rsqrtImpl:()=>wI,scatterImpl:()=>Xs,sigmoidImpl:()=>gE,simpleAbsImpl:()=>ZS,sliceImpl:()=>hp,sparseFillEmptyRowsImpl:()=>Gf,sparseReshapeImpl:()=>Hf,sparseSegmentReductionImpl:()=>_l,sqrtImpl:()=>bE,squaredDifferenceImpl:()=>II,staticRegexReplaceImpl:()=>vI,stridedSliceImpl:()=>Kf,stringNGramsImpl:()=>gp,stringSplitImpl:()=>xp,stringToHashBucketFastImpl:()=>yp,subImpl:()=>NI,tileImpl:()=>qf,topKImpl:()=>jf,transposeImpl:()=>Tl,uniqueImpl:()=>bp});function ZS(r){let e=new Float32Array(r.length);for(let t=0;t{let{x:e}=r.inputs,t=r.backend;Q(e,"abs");let o=new Float32Array(y.sizeFromShape(e.shape)),n=t.data.get(e.dataId).values;return o=ZS(n),t.makeOutput(o,e.shape,e.dtype)},z_={kernelName:fn,backendName:"cpu",kernelFunc:i7};function Ve(r){return(e,t,o,n,s)=>{let a=C.assertAndGetBroadcastShape(e,t),i=a.length,p=y.computeStrides(a),u=y.sizeFromShape(a),l=y.getTypedArrayFromDType(s,u),c=e.length,m=t.length,d=y.computeStrides(e),f=y.computeStrides(t),h=C.getBroadcastDims(e,a),g=C.getBroadcastDims(t,a);if(h.length+g.length===0)for(let x=0;xw[E]=0);let S=y.locToIndex(w,c,d),k=b.slice(-m);g.forEach(E=>k[E]=0);let T=y.locToIndex(k,m,f);l[x]=r(o[S],n[T])}return[l,a]}}function qt(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,i=t.makeTensorInfo(o.shape,"complex64"),p=t.data.get(i.dataId);return p.complexTensorInfos={real:t.makeTensorInfo(o.shape,"float32",s),imag:t.makeTensorInfo(n.shape,"float32",a)},i}var V_={kernelName:ei,backendName:"cpu",kernelFunc:qt};function vl(r,e,t="float32"){if(t==="complex64"){let n=vl(r,e,"float32"),s=vl(r,e,"float32");return qt({inputs:{real:n,imag:s},backend:r})}let o=y.makeZerosTypedArray(y.sizeFromShape(e),t);return r.makeTensorInfo(e,t,o)}function fr(r){let{inputs:e,backend:t}=r,{x:o}=e;return t.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var W_={kernelName:vo,backendName:"cpu",kernelFunc:fr};function tn(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.data.get(o.dataId).complexTensorInfos.real,s=t.data.get(n.dataId).values;return t.makeTensorInfo(n.shape,n.dtype,s)}var U_={kernelName:si,backendName:"cpu",kernelFunc:tn};function JS(r,e,t,o){if(o==="int32"){let n=Int32Array.from(r);return[e,"int32",n]}if(o==="bool"){let n=y.toTypedArray([0],t),[s,a]=Ve((i,p)=>i!==p?1:0)(e,[],r,n,"bool");return[a,"bool",s]}throw new Error(`Error in Cast: failed to cast ${t} to ${o}`)}function rn(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s==="complex64"){if(n.dtype==="complex64")return fr({inputs:{x:n},backend:t});let l=vl(t,n.shape,n.dtype),c=rn({inputs:{x:n},backend:t,attrs:{dtype:"float32"}}),m=qt({inputs:{real:c,imag:l},backend:t});return t.disposeIntermediateTensorInfo(l),t.disposeIntermediateTensorInfo(c),m}if(n.dtype==="complex64"){let l=tn({inputs:{input:n},backend:t}),c=rn({inputs:{x:l},backend:t,attrs:{dtype:s}});return t.disposeIntermediateTensorInfo(l),c}if(!y.hasEncodingLoss(n.dtype,s)){let l=fr({inputs:{x:n},backend:t});return{dataId:l.dataId,shape:l.shape,dtype:s}}let a=t.data.get(n.dataId).values,[i,p,u]=JS(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}var G_={kernelName:ho,backendName:"cpu",kernelFunc:rn};function Qe(r,e,t,o){return t==null?({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;Q([a,i],r);let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=a.dtype==="string"?C.fromUint8ToStringArray(u):u,m=a.dtype==="string"?C.fromUint8ToStringArray(l):l,d=o||a.dtype,[f,h]=e(a.shape,i.shape,c,m,d);return p.makeTensorInfo(h,d,f)}:({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(a.dtype==="complex64"||i.dtype==="complex64"){let u=rn({inputs:{x:a},backend:p,attrs:{dtype:"complex64"}}),l=p.data.get(u.dataId),c=l.complexTensorInfos.real,m=l.complexTensorInfos.imag,d=p.data.get(c.dataId).values,f=p.data.get(m.dataId).values,h=rn({inputs:{x:i},backend:p,attrs:{dtype:"complex64"}}),g=p.data.get(h.dataId),x=g.complexTensorInfos.real,b=g.complexTensorInfos.imag,w=p.data.get(x.dataId).values,S=p.data.get(b.dataId).values,[k,T,E]=t(a.shape,i.shape,d,f,w,S),R=p.makeTensorInfo(E,"float32",k),D=p.makeTensorInfo(E,"float32",T),F=qt({inputs:{real:R,imag:D},backend:p});return p.disposeIntermediateTensorInfo(u),p.disposeIntermediateTensorInfo(h),p.disposeIntermediateTensorInfo(R),p.disposeIntermediateTensorInfo(D),F}else{let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=o||a.dtype,[m,d]=e(a.shape,i.shape,u,l,c);return p.makeTensorInfo(d,c,m)}}}function kl(r){return(e,t,o,n,s,a)=>{let i=C.assertAndGetBroadcastShape(e,t),p=y.sizeFromShape(i),u=i.length,l=y.computeStrides(i),c=y.getTypedArrayFromDType("float32",p),m=y.getTypedArrayFromDType("float32",p),d=C.getBroadcastDims(e,i),f=C.getBroadcastDims(t,i),h=C.mergeRealAndImagArrays(o,n),g=C.mergeRealAndImagArrays(s,a),x=e.length,b=y.computeStrides(e),w=t.length,S=y.computeStrides(t);if(d.length+f.length===0)for(let k=0;kE[M]=0);let R=y.locToIndex(E,x,b),D=T.slice(-w);f.forEach(M=>D[M]=0);let F=y.locToIndex(D,w,S),O=r(h[R*2],h[R*2+1],g[F*2],g[F*2+1]);c[k]=O.real,m[k]=O.imag}return[c,m,i]}}var eI=Ve((r,e)=>r+e),u7=kl((r,e,t,o)=>({real:r+t,imag:e+o})),Wa=Qe(Rr,eI,u7),H_={kernelName:Rr,backendName:"cpu",kernelFunc:Wa};function Nl(r,e,t,o,n){let s=y.sizeFromShape(o),a=y.makeZerosTypedArray(n,t);for(let i=0;i=n||(s>0?a[p]+=e[i]:a[p]+=1)}return a}function Of(r,e,t,o=!1){let n=r.shape[0],s=r.shape[1],a=ie([n,t],e.dtype);for(let i=0;i=t||(o?a.set(1,i,u):e.size>0?a.set(a.get(i,u)+e.get(i,p),i,u):a.set(a.get(i,u)+1,i,u))}return a}var tI=Ve((r,e)=>r&e),p7=Qe(_n,tI),K_={kernelName:_n,backendName:"cpu",kernelFunc:p7};function Yt(r){return(e,t,o)=>{let n=y.getArrayFromDType(t,e.length);for(let s=0;s{let{x:a}=o;Q(a,r);let i=s,p=i.data.get(a.dataId).values,u;if(a.dtype==="string"){if(!Array.isArray(p))throw new Error("String tensor's value was not an instance of Array");u=C.fromUint8ToStringArray(p)}else u=p;let l=t||a.dtype,c=e(u,l,n);return i.makeTensorInfo(a.shape,l,c)}}var rI=Yt(r=>Math.ceil(r)),l7=Mr(go,rI),q_={kernelName:go,backendName:"cpu",kernelFunc:l7};function mp(r,e,t,o){let n=y.getArrayFromDType(t,y.sizeFromShape(e));if(o&&t!=="string"){let s=0;r.forEach(a=>{let i=y.sizeFromShape(a.shape);n.set(a.vals,s),s+=i})}else{let s=0;r.forEach(a=>{let i=t==="string"?C.fromUint8ToStringArray(a.vals):a.vals,p=0;for(let u=0;ur===e?1:0),nI=Qe(xo,oI,null,"bool"),j_={kernelName:xo,backendName:"cpu",kernelFunc:nI};var sI=Yt(r=>Math.exp(r)),aI=Mr(yo,sI,"float32"),X_={kernelName:yo,backendName:"cpu",kernelFunc:aI};var iI=Yt(r=>Math.expm1(r)),c7=Mr(bo,iI),Y_={kernelName:bo,backendName:"cpu",kernelFunc:c7};var uI=Yt(r=>Math.floor(r)),m7=Mr(Co,uI),Q_={kernelName:Co,backendName:"cpu",kernelFunc:m7};var pI=Ve((r,e)=>Math.floor(r/e)),d7=Qe(wo,pI,null,"int32"),Z_={kernelName:wo,backendName:"cpu",kernelFunc:d7};function Mf(r,e,t,o,n,s,a,i,p){let u=ie([o,s],t);for(let l=0;l=p/s)throw new Error(`Invalid indices: ${c} does not index into ${i}`);for(let d=0;dr>e?1:0),f7=Qe(So,lI,null,"bool"),J_={kernelName:So,backendName:"cpu",kernelFunc:f7};var cI=Ve((r,e)=>r>=e?1:0),h7=Qe(Io,cI,null,"bool"),eE={kernelName:Io,backendName:"cpu",kernelFunc:h7};var mI=Ve((r,e)=>rr<=e?1:0),x7=Qe(No,dI,null,"bool"),rE={kernelName:No,backendName:"cpu",kernelFunc:x7};function Bf(r,e,t){let o=(e-r)/(t-1),n=y.makeZerosTypedArray(t,"float32");n[0]=r;for(let s=1;sMath.log(r)),y7=Mr(To,fI),oE={kernelName:To,backendName:"cpu",kernelFunc:y7};function zf(r,e,t,o){let n=y.getTypedArrayFromDType(o,y.sizeFromShape(t));for(let s=0;si)&&(i=u)}n[s]=i}return n}var hI=Ve((r,e)=>Math.max(r,e)),b7=Qe(_o,hI),nE={kernelName:_o,backendName:"cpu",kernelFunc:b7};var gI=Ve((r,e)=>Math.min(r,e)),C7=Qe(Eo,gI),sE={kernelName:Eo,backendName:"cpu",kernelFunc:C7};var qc=Ve((r,e)=>r*e),w7=kl((r,e,t,o)=>({real:r*t-e*o,imag:r*o+e*t})),dp=Qe($o,qc,w7),aE={kernelName:$o,backendName:"cpu",kernelFunc:dp};function xI(r,e,t){let o=y.createScalarValue(-1,t);return qc([],e,o,r,t)}function S7(r){let{inputs:e,backend:t}=r,{x:o}=e;Q(o,"neg");let n=t.data.get(o.dataId).values,[s,a]=xI(n,o.shape,o.dtype);return t.makeTensorInfo(a,o.dtype,s)}var iE={kernelName:ls,backendName:"cpu",kernelFunc:S7};var yI=Ve((r,e)=>r!==e?1:0),I7=Qe(Ro,yI,null,"bool"),uE={kernelName:Ro,backendName:"cpu",kernelFunc:I7};function Tl(r,e,t,o,n){let s=e.length,a=y.sizeFromShape(e),i=y.computeStrides(e),p=y.computeStrides(n),u=y.getTypedArrayFromDType(t,y.sizeFromShape(n));for(let l=0;lt.disposeIntermediateTensorInfo(b)),t.makeTensorInfo(x,g,f)}var lE={kernelName:Ho,backendName:"cpu",kernelFunc:v7};function k7(r,e,t){r.forEach((o,n)=>{if(o<0||o>=t){let s=y.indexToLoc(n,e.length,y.computeStrides(e)).join(",");throw new Error(`indices[${s}] = ${o} is not in [0, ${t})`)}})}function N7(r,e){for(let t=0;tn)throw new Error("Ragged splits must not point past values");for(let s=1;so[s])throw new Error("Ragged splits must be sorted in ascending order")}}function T7(r,e,t,o){let n=[],s=0,a=e.length-1+t.length,i=new Array(a).fill(null).map(()=>[0]);N7(t,o);let p=1;for(let u=0;u=0){let h=i[f],g=h[h.length-1]-d[l];for(let x=l;xn[a]=s)}return e}function cE(r,e){let t=r.slice(0,e);for(;t.length1)throw new Error("starts must be a scalar or vector");if(n.length>1)throw new Error("limits must be a scalar or vector");if(a.length>1)throw new Error("deltas must be a scalar or vector");let i=e.length===0,p=n.length===0,u=a.length===0,l=[];i||l.push(e[0]),p||l.push(n[0]),u||l.push(a[0]);for(let g=1;g0&&bx)S=0;else if(S=Math.ceil(Math.abs((b-x)/w)),S>mE)throw new Error(`Requires ((limit - start) / delta) <= ${mE}`);m[g+1]=m[g]+S}let d=m[c],f=y.getArrayFromDType(t,d),h=0;for(let g=0;go&&(o=s)}return o}static getMaxWidthValueRowID(e){let t=e.length;if(t===0)return 0;let o=0,n=e[0],s=0;for(let a=1;a"Final length of result must be equal to firstDimension."),s}calculateOutputIndexRowSplit(e,t,o,n){let s=e.length,a=[];for(let i=0;i0&&a.length!==e[s-1])throw new Error("Invalid row split size.");return a}calculateOutputIndexValueRowID(e,t,o,n){let s=e.length,a=[];if(s===0)return[];let i=0,p=e[0];if(p>=t.length)throw new Error(`Got currentValueRowId=${p}, which is not less than ${t.length}`);let u=t[p];a.push(u);for(let l=1;l=0&&(++i,i=t.length)throw new Error(`Got nextValueRowId=${c} which is not less than ${t.length}`);u=t[c]}a.push(u)}if(a.length!==e.length)throw new Error("Invalid row ids.");return a}calculateOutputIndex(e,t,o,n){let s=this.getRowPartitionTensor(e),a=this.getRowPartitionTypeByDimension(e);switch(a){case on.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,t,o,n);case on.ROW_SPLITS:if(s.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(s,t,o,n);default:throw new Error(`Unsupported partition type: ${on[a]}`)}}getFirstDimensionSize(){let e=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");let t=this.rowPartitionTypes[0];switch(t){case on.FIRST_DIM_SIZE:return e[0];case on.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case on.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${on[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");let t=this.getFirstDimensionSize(),o=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let p=n.length-2;p>=0;--p)n[p]=n[p+1]*o[p+1];let s=fE(o,!1),a=y.getArrayFromDType(this.valuesDType,y.sizeFromShape(s));if(n[0]*o[0]>0){let p=this.calculateFirstParentOutputIndex(t,n[0],o[0]);for(let u=1;u<=this.raggedRank;++u)p=this.calculateOutputIndex(u-1,p,n[u],o[u]);this.setOutput(this.raggedRank,p,a,s)}return[s,a]}setOutput(e,t,o,n){if(o.length===0)return;let s=this.values,a=o,i=n.slice();i=i.slice(e+1);let p=y.sizeFromShape(i),u=t.length,l=this.defaultValue;if(l.length!==p&&l.length!==1){let f=this.defaultValueShape;De(()=>{let h=W(l,f);l=Oa(h,i).dataSync()})}let c=0,m=0,d=0;for(let f=0;f<=u;++f){let h=f=u){let g=o.length;h=Math.floor(g/p)}if(h>d)if(this.defaultValue.length===1)a.subarray(d*p,h*p).fill(this.defaultValue[0]),d=h;else for(;h>d;){let g=a.slice(d*p);dE(g,l,p),++d}h<0?(c=f+1,m=d):(c=f,m=d,d=m+1)}}};function dE(r,e,t){for(let o=0;o= 0`);if(o<-1)throw new Error(`Dimension ${o} must be >= -1`);o=-1}t.push(o)}return t}function Uf(r,e,t,o,n,s,a,i,p,u){return new CI(r,e,t,o,n,s,a,i,p,u).compute()}function fp(r,e,t,o){let n=r===e,s=r1;if(n||s||a)return y.makeZerosTypedArray(0,o);let i=Math.abs(Math.ceil((e-r)/t)),p=y.makeZerosTypedArray(i,o);e1/Math.sqrt(r)),R7=Mr(Do,wI),hE={kernelName:Do,backendName:"cpu",kernelFunc:R7};function Xs(r,e,t,o,n,s,a,i,p,u){let l=[o/n,n],c=r.values,m=e.values;if(o===0)return ie(t,e.dtype);let d=p instanceof Ge?p:ie(l,e.dtype);typeof p=="string"||typeof p=="number"?d.values.fill(p):typeof p=="boolean"&&d.values.fill(+p);for(let f=0;f=o/n)throw new Error(`Invalid indices: ${h} does not index into ${t}`);for(let x=0;x1/(1+Math.exp(-r))),SI=Ie(Ao,r=>1/(1+Math.exp(-r))),xE={kernelName:Ao,backendName:"cpu",kernelFunc:SI};function hp(r,e,t,o,n){let s=nt.isSliceContinous(o,e,t),a=y.sizeFromShape(t),i=y.computeStrides(o);if(s){let c=nt.computeFlatOffset(e,i);return n==="string"?r.slice(c,c+a):r.subarray(c,c+a)}let p=n==="string"?C.fromUint8ToStringArray(r):r,u=ie(o,n,p),l=ie(t,n);for(let c=0;cf+e[h]);l.set(u.get(...d),...m)}return n==="string"?C.fromStringArrayToUint8(l.values):l.values}function nn(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,size:a}=o;Q(n,"slice");let[i,p]=nt.parseSliceParams(n,s,a);nt.assertParamsValid(n,i,p);let u=t.data.get(n.dataId).values,l=hp(u,i,p,n.shape,n.dtype);return t.makeTensorInfo(p,n.dtype,l)}var yE={kernelName:_s,backendName:"cpu",kernelFunc:nn};function Gf(r,e,t,o,n,s,a){let i=e[0],p=s[0],u=new Array(p),l=new Array(i),c=e[1];if(p===0){if(i!==0)throw new Error(C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i));let g=y.getArrayFromDType(t,0),x=y.getArrayFromDType(n,0);return[g,[0,c],x,u,l]}let m=!0,d=0,f=new Array(p).fill(0);for(let g=0;g=p)throw new Error(C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,x,p));++f[x],m=m&&x>=d,d=x}let h=!0;for(let g=0;g0&&(f[g]+=f[g-1])}if(h&&m){let g=r,x=o;for(let b=0;b0){d[m-1]=1;for(let g=m-2;g>=0;--g)d[g]=d[g+1]*o[g+1]}let f=[];if(i>0){f[i-1]=1;for(let g=i-2;g>=0;--g)f[g]=f[g+1]*p[g+1]}let h=y.getArrayFromDType(t,a*i);for(let g=0;g0?n[i-1]+1:0;if(c<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=e.slice();m[0]=c;let d=m.reduce((w,S)=>w*S,1),f=y.getArrayFromDType(t,d);if(i===0)return c>0&&f.fill(a),[f,m];if(c<=0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let h=0,g=1,x=0,b=n[h];for(;;){let w=0;if(g=w)throw new Error(C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(b<0||b>=c)throw new Error(C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b,c));b>x&&f.fill(a,x*u,b*u);for(let S=h;S=p[0])throw new Error(C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S,o[S],p[0]));for(let T=0;Ti)break}return xMath.sqrt(r)),D7=Ie(Fo,r=>Math.sqrt(r)),CE={kernelName:Fo,backendName:"cpu",kernelFunc:D7};var II=Ve((r,e)=>{let t=r-e;return t*t}),A7=Qe(Po,II),wE={kernelName:Po,backendName:"cpu",kernelFunc:A7};var vI=Yt((r,e)=>{let{pattern:t,replaceGlobal:o,rewrite:n}=e;return r.replace(new RegExp(t,o?"g":""),n)}),F7=Mr(pi,vI),SE={kernelName:pi,backendName:"cpu",kernelFunc:F7};function Kf(r,e,t,o){let n=ie(r,e.dtype);for(let s=0;s0?0:i-p),d=0;d+=u*this.leftPad.length;for(let b=0;bb.forEach(w=>h[g++]=w);for(let b=0;b0){x(e[m+c-1]);for(let b=0;b0){let p=t[0];if(p!==0)throw new Error(`First split value must be 0, got ${p}`);for(let u=1;u=p;if(l=l&&t[u]<=o,!l)throw new Error(`Invalid split value ${t[u]}, must be in [${p}, ${o}]`);p=t[u]}if(p!==o)throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`)}let s=n-1,a=y.getArrayFromDType("int32",n);if(o===0||n===0){let p=new Array(o);for(let u=0;u<=s;++u)a[u]=0;return[p,a]}a[0]=0;for(let p=1;p<=s;++p){let u=t[p]-t[p-1],l=0;this.nGramWidths.forEach(c=>{l+=this.getNumNGrams(u,c)}),this.preserveShort&&u>0&&l===0&&(l=1),a[p]=a[p-1]+l}let i=new Array(a[s]);for(let p=0;p{let m=t[p+1]-t[p],d=this.getNumNGrams(m,c);this.createNGrams(e,u,i,l,d,c),l+=d}),this.preserveShort&&l===a[p]){let c=t[p+1]-t[p];if(c===0)continue;let m=c+2*this.padWidth;this.createNGrams(e,u,i,l,1,m)}}return[i,a]}};function gp(r,e,t,o,n,s,a,i){return new kI(t,o,n,s,a,i).compute(r,e)}function P7(r,e,t,o){if(!r.length)return;if(e.length===0){for(let s=0;sr-e),O7=kl((r,e,t,o)=>({real:r-t,imag:e-o})),jc=Qe(Oo,NI,O7),IE={kernelName:Oo,backendName:"cpu",kernelFunc:jc};function qf(r,e){let t=new Array(r.rank);for(let n=0;n{let t=e.value-r.value;return t===0?r.index-e.index:t};function vE(r,e,t=0,o=r.length-1){for(;o>t;){if(o-t>600){let i=o-t+1,p=e-t+1,u=Math.log(i),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(i-l)/i)*Math.sign(p-i/2),m=Math.max(t,Math.floor(e-p*l/i+c)),d=Math.min(o,Math.floor(e+(i-p)*l/i+c));vE(r,e,m,d)}let n=r[e],s=t,a=o;for(y.swap(r,t,e),Xc(r[o],n)>0&&y.swap(r,t,o);s0;)a=a-1}Xc(r[t],n)===0?y.swap(r,t,a):(a=a+1,y.swap(r,a,o)),a<=e&&(t=a+1),e<=a&&(o=a-1)}}function jf(r,e,t,o,n){let s=e[e.length-1],[a,i]=[r.length/s,s],p=y.getTypedArrayFromDType(t,a*o),u=y.getTypedArrayFromDType("int32",a*o);for(let c=0;cf[w]={value:b,index:w}),o{for(let g=0;gnew Il,1);var TI=Ie(Wn,r=>r>=0?r:Math.exp(r)-1),kE={kernelName:Wn,backendName:"cpu",kernelFunc:TI};function _I(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{alpha:s}=o;Q([n],"leakyRelu");let a=y.sizeFromShape(n.shape),i=t.data.get(n.dataId).values,p=y.getTypedArrayFromDType("float32",a);for(let u=0;ur<0?e*r:r);function EI(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e;Q([o,n],"prelu");let s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,[i,p]=L7(o.shape,n.shape,s,a,"float32");return t.makeTensorInfo(p,"float32",i)}var TE={kernelName:gs,backendName:"cpu",kernelFunc:EI};var $I=Ie(ys,r=>Math.max(0,r)),_E={kernelName:ys,backendName:"cpu",kernelFunc:$I};var RI=Ie(ws,r=>Math.min(Math.max(0,r),6)),EE={kernelName:ws,backendName:"cpu",kernelFunc:RI};function Cp(r,e,t,o,n){if(t==="linear")return fr({inputs:{x:e},backend:r});if(t==="relu")return $I({inputs:{x:e},backend:r});if(t==="elu")return TI({inputs:{x:e},backend:r});if(t==="relu6")return RI({inputs:{x:e},backend:r});if(t==="prelu")return EI({inputs:{x:e,alpha:o},backend:r});if(t==="leakyrelu")return _I({inputs:{x:e},backend:r,attrs:{alpha:n}});if(t==="sigmoid")return SI({inputs:{x:e},backend:r});throw new Error(`Activation ${t} has not been implemented for the CPU backend.`)}function We(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{shape:s}=o,a=y.sizeFromShape(n.shape),i=y.inferFromImplicitShape(s,a),p=y.sizeFromShape(i);y.assert(a===p,()=>`The new shape (${i}) has ${p} elements and the old shape (${n.shape}) has ${a} elements. The new shape and old shape must have the same number of elements.`),t.incRef(n.dataId);let u=t.data.get(n.dataId);if(u.complexTensorInfos!=null){let l=u.complexTensorInfos.real,c=u.complexTensorInfos.imag;l.shape=i,c.shape=i}return{dataId:n.dataId,shape:i,dtype:n.dtype}}var $E={kernelName:Ca,backendName:"cpu",kernelFunc:We};function DI(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;Q([n,s],"matMul");let p=n.shape.length,u=s.shape.length,l=a?n.shape[p-2]:n.shape[p-1],c=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),w=kr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(l===c,()=>`Error in matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,l,m]:[g,m,l],k=i?[x,d,c]:[x,c,d],T=We({inputs:{x:n},backend:t,attrs:{shape:S}}),E=We({inputs:{x:s},backend:t,attrs:{shape:k}}),R=a?T.shape[1]:T.shape[2],D=a?T.shape[2]:T.shape[1],F=i?E.shape[1]:E.shape[2],O=Math.max(g,x),M=t.data.get(T.dataId).values,L=t.data.get(E.dataId).values,B=y.computeStrides(T.shape),z=y.computeStrides(E.shape),[U,j,q]=a?[B[0],1,B[1]]:[B[0],B[1],1],[Y,J,re]=i?[1,z[1],z[0]]:[z[1],1,z[0]],ne=D*F,ee=ie([O,D,F],T.dtype),oe=ee.values,ue=t.blockSize;for(let me=0;meMath.acos(r)),AE={kernelName:hn,backendName:"cpu",kernelFunc:z7};var V7=Ie(gn,r=>Math.acosh(r)),FE={kernelName:gn,backendName:"cpu",kernelFunc:V7};function W7(r){let{inputs:e,backend:t}=r,o=e;Q(e,"addN");let n=o.map(i=>t.data.get(i.dataId).values),s=ie(o[0].shape,o[0].dtype),a=s.values;for(let i=0;ib&&(b=k,w=S)}d[g]=w}return u.forEach(g=>t.disposeIntermediateTensorInfo(g)),t.makeTensorInfo(l,"int32",d)}var LE={kernelName:na,backendName:"cpu",kernelFunc:H7};function K7(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o;Q(n,"argMin");let a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=vt({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),a=[a[0]],C.assertAxesAreInnerMostDims("argMin",a,p.shape.length);let[l,c]=C.computeOutAndReduceShapes(p.shape,a),m=y.sizeFromShape(l),d=y.makeZerosTypedArray(m,"int32"),f=y.sizeFromShape(c),h=t.data.get(p.dataId).values;for(let g=0;gt.disposeIntermediateTensorInfo(g)),t.makeTensorInfo(l,"int32",d)}var BE={kernelName:sa,backendName:"cpu",kernelFunc:K7};var q7=Ie(Cn,r=>Math.asin(r)),zE={kernelName:Cn,backendName:"cpu",kernelFunc:q7};var j7=Ie(wn,r=>Math.asinh(r)),VE={kernelName:wn,backendName:"cpu",kernelFunc:j7};var X7=Ie(Sn,r=>Math.atan(r)),WE={kernelName:Sn,backendName:"cpu",kernelFunc:X7};var Y7=Ve((r,e)=>Math.atan2(r,e)),Q7=Qe(vn,Y7),UE={kernelName:vn,backendName:"cpu",kernelFunc:Q7};var Z7=Ie(In,r=>Math.atanh(r)),GE={kernelName:In,backendName:"cpu",kernelFunc:Z7};function El(r,e,t,o,n,s){let a=n.strideHeight,i=n.strideWidth,p=n.dilationHeight,u=n.dilationWidth,l=n.effectiveFilterHeight,c=n.effectiveFilterWidth,m=n.padInfo.top,d=n.padInfo.left,f=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,h=ie(n.outShape,t),g=h.values,x=n.outShape[1]*n.outShape[2]*n.outShape[3],b=n.outShape[2]*n.outShape[3],w=n.outShape[3];for(let S=0;Sj?j=ue:s==="avg"&&(q+=ue,Y++)}if(isNaN(j))break}let J=M+L*w+E;g[J]=s==="avg"?q/Y:j}}}return h}function Yf(r,e,t,o,n=!1,s=!1){let a=ie(o.outShape,"int32"),i=o.strideHeight,p=o.strideWidth,u=o.dilationHeight,l=o.dilationWidth,c=o.effectiveFilterHeight,m=o.effectiveFilterWidth,d=o.padInfo.top,f=o.padInfo.left,h=ie(e,t,r);for(let g=0;gF&&(F=U,n?O=s?((g*o.inHeight+M)*o.inWidth+B)*o.inChannels+x:(M*o.inWidth+B)*o.inChannels+x:O=L*m+z)}}a.set(O,g,b,T,x)}}return a}function Qf(r,e,t,o,n,s){let a=n.strideDepth,i=n.strideHeight,p=n.strideWidth,u=n.dilationDepth,l=n.dilationHeight,c=n.dilationWidth,m=n.effectiveFilterDepth,d=n.effectiveFilterHeight,f=n.effectiveFilterWidth,h=n.padInfo.front,g=n.padInfo.top,x=n.padInfo.left,b=s==="max"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,w=ie(n.outShape,t),S=w.values,k=n.outShape[1]*n.outShape[2]*n.outShape[3]*n.outShape[4],T=n.outShape[2]*n.outShape[3]*n.outShape[4],E=n.outShape[3]*n.outShape[4],R=n.outShape[4];for(let D=0;D_e?_e=xt:s==="avg"&&(ve+=xt,Fe++),isNaN(_e))break}if(isNaN(_e))break}if(isNaN(_e))break}let Pe=be+M;S[Pe]=s==="avg"?ve/Math.max(Fe,1):_e}}}}return w}function HE(r,e){let t=ie(e.outShape,"int32"),o=e.strideDepth,n=e.strideHeight,s=e.strideWidth,a=e.dilationDepth,i=e.dilationHeight,p=e.dilationWidth,u=e.effectiveFilterDepth,l=e.effectiveFilterHeight,c=e.effectiveFilterWidth,m=e.padInfo.front,d=e.padInfo.top,f=e.padInfo.left;for(let h=0;h=L&&(L=re,B=U*l*c+q*l+J)}}}t.set(B,h,x,k,D,g)}}}return t}function J7(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e;Q(n,"avgPool");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(C.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p),c;if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))c=fr({inputs:{x:n},backend:t});else{let m=t.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=El(m,n.shape,n.dtype,d,l,"avg");c=t.makeTensorInfo(l.outShape,n.dtype,f.values)}return c}var KE={kernelName:kn,backendName:"cpu",kernelFunc:J7};function eQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,"avgPool3d");let l=C.computePool3DInfo(n.shape,s,a,1,i,p,u),c=t.data.get(n.dataId).values,m=Qf(c,n.shape,n.dtype,y.computeStrides(n.shape),l,"avg");return t.makeTensorInfo(m.shape,"float32",m.values)}var qE={kernelName:aa,backendName:"cpu",kernelFunc:eQ};function tQ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],"avgPool3DGrad");let l=C.computePool3DInfo(s.shape,a,i,1,p,u),c=l.strideDepth,m=l.strideHeight,d=l.strideWidth,f=l.filterDepth,h=l.filterHeight,g=l.filterWidth,x=l.dilationDepth,b=l.dilationHeight,w=l.dilationWidth,S=l.effectiveFilterDepth,k=l.effectiveFilterHeight,T=l.effectiveFilterWidth,E=S-1-l.padInfo.front,R=T-1-l.padInfo.left,D=k-1-l.padInfo.top,F=ie(s.shape,"float32"),O=1/(f*h*g),M=t.bufferSync(n);for(let L=0;L=l.outDepth||Math.floor(ee)!==ee))for(let oe=0;oe=l.outHeight||Math.floor(ue)!==ue))for(let me=0;me=l.outWidth||Math.floor(be)!==be)continue;let _e=M.get(L,ee,ue,be,B);re+=_e}}}F.set(re*O,L,z,U,j,B)}return t.makeTensorInfo(F.shape,F.dtype,F.values)}var jE={kernelName:Vi,backendName:"cpu",kernelFunc:tQ};function rQ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s;Q([n,s],"avgPoolGrad");let{filterSize:i,strides:p,pad:u}=o,l=C.computePool2DInfo(a.shape,i,p,1,u),c=l.strideHeight,m=l.strideWidth,d=l.filterHeight,f=l.filterWidth,h=l.dilationHeight,g=l.dilationWidth,x=l.effectiveFilterHeight,b=l.effectiveFilterWidth,w=b-1-l.padInfo.left,S=x-1-l.padInfo.top,k=ie(a.shape,"float32"),T=1/(d*f),E=t.data.get(n.dataId).values,R=ie(n.shape,"float32",E);for(let D=0;D=l.outHeight||Math.floor(j)!==j))for(let q=0;q=l.outWidth||Math.floor(Y)!==Y)continue;let J=R.get(D,j,Y,F);z+=J}}k.set(z*T,D,O,M,F)}return t.makeTensorInfo(k.shape,k.dtype,k.values)}var XE={kernelName:zi,backendName:"cpu",kernelFunc:rQ};function oQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,scale:s,offset:a,mean:i,variance:p}=e;y.assert(i.shape.length===p.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),y.assert(a==null||i.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),y.assert(s==null||i.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),Q([n,i,p,s,a],"batchNorm");let{varianceEpsilon:u}=o;u==null&&(u=.001);let l=t.data.get(n.dataId).values,c=t.data.get(i.dataId).values,m=t.data.get(p.dataId).values,d=s?t.data.get(s.dataId).values:new Float32Array([1]),f=a?t.data.get(a.dataId).values:new Float32Array([0]),h=new Float32Array(l.length),g=f.length,x=d.length,b=m.length,w=c.length,S=0,k=0,T=0,E=0;for(let R=0;R=g&&(S=0),k>=w&&(k=0),T>=x&&(T=0),E>=b&&(E=0);return t.makeTensorInfo(n.shape,n.dtype,h)}var YE={kernelName:Hn,backendName:"cpu",kernelFunc:oQ};function nQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,crops:a}=o;Q([n],"batchToSpaceND");let i=s.reduce((x,b)=>x*b),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=We({inputs:{x:n},backend:t,attrs:{shape:p}}),f=vt({inputs:{x:d},backend:t,attrs:{perm:u}}),h=We({inputs:{x:f},backend:t,attrs:{shape:l}}),g=nn({inputs:{x:h},backend:t,attrs:{begin:c,size:m}});return t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(h),g}var QE={kernelName:ia,backendName:"cpu",kernelFunc:nQ};function sQ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,u=Nl(i,p,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,u)}var ZE={kernelName:Tn,backendName:"cpu",kernelFunc:sQ};function aQ(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e,s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,i=C.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return t.makeTensorInfo([i.length],"int32",Int32Array.from(i))}var JE={kernelName:ua,backendName:"cpu",kernelFunc:aQ};var iQ=Ie(Go,(r,e)=>{let t=e;return r>t.clipValueMax?t.clipValueMax:r{let{x:e}=r.inputs,t=r.backend,o=new Float32Array(y.sizeFromShape(e.shape)),n=t.data.get(e.dataId),s=n.complexTensorInfos.real,a=n.complexTensorInfos.imag,i=t.data.get(s.dataId).values,p=t.data.get(a.dataId).values;for(let u=0;uh.shape);C.assertParamsConsistent(a,s);let i=C.computeOutShape(e.map(h=>h.shape),s);if(y.sizeFromShape(i)===0)return t.makeTensorInfo(i,e[0].dtype,[]);let p=e.filter(h=>y.sizeFromShape(h.shape)>0);if(p.length===1)return fr({inputs:{x:p[0]},backend:t});if(p[0].dtype==="complex64"){let h=p.map(S=>tn({inputs:{input:S},backend:t})),g=p.map(S=>Ua({inputs:{input:S},backend:t})),x=Su({inputs:h,backend:t,attrs:{axis:s}}),b=Su({inputs:g,backend:t,attrs:{axis:s}}),w=qt({inputs:{real:x,imag:b},backend:t});return h.forEach(S=>t.disposeIntermediateTensorInfo(S)),g.forEach(S=>t.disposeIntermediateTensorInfo(S)),t.disposeIntermediateTensorInfo(x),t.disposeIntermediateTensorInfo(b),w}let u=p.map(h=>{let x=[-1,y.sizeFromShape(h.shape.slice(s))];return We({inputs:{x:h},backend:t,attrs:{shape:x}})}),l=u.map(h=>({vals:t.data.get(h.dataId).values,shape:h.shape}));i=C.computeOutShape(u.map(h=>h.shape),1);let c=u[0].shape[0]===1,m=mp(l,i,e[0].dtype,c),d=C.computeOutShape(p.map(h=>h.shape),s),f=t.makeTensorInfo(d,e[0].dtype,m);return u.forEach(h=>t.disposeIntermediateTensorInfo(h)),f}var o$={kernelName:pa,backendName:"cpu",kernelFunc:Su};function AI(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=o;Q([n,s],"conv2d");let c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,s.shape,a,u,i,l,!1,c),d=m.filterHeight,f=m.filterWidth,h=m.dilationHeight,g=m.dilationWidth,x=m.padInfo.left,b=m.padInfo.top,w=m.dataFormat==="channelsLast",S=new Ge(m.outShape,n.dtype),k=y.computeStrides(n.shape),T=y.computeStrides(s.shape),E=k[0],R=w?k[1]:k[2],D=w?k[2]:1,F=w?1:k[1],O=S.strides[0],M=w?S.strides[1]:S.strides[2],L=w?S.strides[2]:1,B=w?1:S.strides[1],z=t.data.get(n.dataId).values,U=t.data.get(s.dataId).values,j=S.values;for(let q=0;q=m.inHeight)continue;let me=oe*T[0],be=Y+ue*R;for(let _e=0;_e=m.inWidth)continue;let ct=me+Pe*T[1],Ke=be+at*D,mt=ct;for(let ut=0;ut=u.inDepth)continue;let q=U*D[0],Y=O+j*R[1];for(let J=0;J=u.inHeight)continue;let ue=q+ee*D[1],me=Y+oe*R[2];for(let be=0;be=u.inWidth)continue;let at=ue+Fe*D[2],ct=me+Pe*u.inChannels,Ke=at;for(let mt=0;mtMath.cos(r)),l$={kernelName:An,backendName:"cpu",kernelFunc:fQ};var hQ=Ie(Fn,r=>Math.cosh(r)),c$={kernelName:Fn,backendName:"cpu",kernelFunc:hQ};function gQ(r){let{inputs:e,backend:t,attrs:o}=r,{image:n,boxes:s,boxInd:a}=e,{cropSize:i,method:p,extrapolationValue:u}=o,[l,c,m,d]=n.shape,f=s.shape[0],[h,g]=i,x=ie([f,h,g,d],"float32"),b=t.data.get(s.dataId).values,w=t.data.get(a.dataId).values,S=t.data.get(n.dataId).values,k=y.computeStrides(n.shape),T=y.computeStrides(x.shape);for(let E=0;E=l)continue;let B=h>1?(O-D)*(c-1)/(h-1):0,z=g>1?(M-F)*(m-1)/(g-1):0;for(let U=0;U1?D*(c-1)+U*B:.5*(D+O)*(c-1);if(j<0||j>c-1){for(let q=0;q1?F*(m-1)+re*z:.5*(F+M)*(m-1);if(ne<0||ne>m-1){for(let me=0;me1?F*(m-1)+q*z:.5*(F+M)*(m-1);if(Y<0||Y>m-1){for(let ne=0;nex+f-b-1:(x,b)=>x+b;for(let x=0;xx+f-b-1:(x,b)=>x+b;for(let x=0;x`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${a}`);let i=n.shape[0],p=n.shape[1],u=n.shape[2],l=n.shape[3],c=p*s,m=u*s,d=l/(s*s),f=t.data.get(n.dataId).values,h=new Float32Array(i*c*m*d),g=0;for(let x=0;x`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${m}'`);let d=C.computeConv2DInfo(n.shape,s.shape,a,m,i,u,!0),{filterHeight:f,filterWidth:h,dilationHeight:g,dilationWidth:x,padInfo:b}=d,w=b.left,S=b.top,k=d.outChannels/d.inChannels,T=new Ge(d.outShape,n.dtype),E=t.data.get(n.dataId).values,R=t.data.get(s.dataId).values,D=T.values;for(let F=0;F=d.inHeight)continue;let q=U*c[0],Y=O+j*l[1];for(let J=0;J=d.inWidth)continue;let ue=q+ee*c[1],me=Y+oe*d.inChannels,be=re,_e=ue;for(let ve=0;ve{let{x:o,filter:n}=r,{strides:s,pad:a,dilations:i}=t,p=e,u=p.data.get(o.dataId).values,l=o.shape.length,c=p.data.get(n.dataId).values,m=n.shape.length,{batchSize:d,inHeight:f,inWidth:h,inChannels:g,outHeight:x,outWidth:b,padInfo:w,strideHeight:S,strideWidth:k,filterHeight:T,filterWidth:E,dilationHeight:R,dilationWidth:D,outShape:F}=C.computeDilation2DInfo(o.shape,n.shape,s,a,"NHWC",i),O=y.sizeFromShape(F),M=F.length,L=y.getArrayFromDType(o.dtype,O);for(let z=0;z=0&&oe=0&&mere&&(re=ve)}}}let ne=y.locToIndex([z,U,q,J],M,y.computeStrides(F));L[ne]=re}}}return{dataId:p.write(y.toTypedArray(L,o.dtype),F,o.dtype),shape:F,dtype:o.dtype}}};var S$={kernelName:qi,backendName:"cpu",kernelFunc:({inputs:r,backend:e,attrs:t})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=t,u=e,l=y.toNestedArray(o.shape,u.data.get(o.dataId).values),c=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:w,strideWidth:S,filterHeight:k,filterWidth:T,dilationHeight:E,dilationWidth:R,outShape:D}=C.computeDilation2DInfo(o.shape,n.shape,a,i,"NHWC",p);y.assert(s.rank===D.length,()=>`Error in ${qi}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let F=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(n.shape,n.dtype);for(let L=0;L=0&&ee=0&&ueY&&(Y=me,J=ne,re=oe)}}}O[J][re][q]+=F[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}};var I$={kernelName:Ki,backendName:"cpu",kernelFunc:({inputs:r,backend:e,attrs:t})=>{let{x:o,filter:n,dy:s}=r,{strides:a,pad:i,dilations:p}=t,u=e,l=y.toNestedArray(o.shape,u.data.get(o.dataId).values),c=y.toNestedArray(n.shape,u.data.get(n.dataId).values),{batchSize:m,inHeight:d,inWidth:f,inChannels:h,outHeight:g,outWidth:x,padInfo:b,strideHeight:w,strideWidth:S,filterHeight:k,filterWidth:T,dilationHeight:E,dilationWidth:R,outShape:D}=C.computeDilation2DInfo(o.shape,n.shape,a,i,"NHWC",p);y.assert(s.rank===D.length,()=>`Error in ${Ki}, dy must have the same rank as output ${D.length}, but got ${s.rank}`);let F=y.toNestedArray(D,u.data.get(s.dataId).values),O=y.makeZerosNestedTypedArray(o.shape,o.dtype);for(let L=0;L=0&&ee=0&&ueY&&(Y=me,J=ee,re=ue)}}}O[L][J][re][q]+=F[L][B][U][q]}}}return{dataId:u.write(y.toTypedArray(O,o.dtype),o.shape,o.dtype),shape:o.shape,dtype:o.dtype}}};function vQ(r){let{inputs:e,backend:t,attrs:o}=r,{image:n}=e,{canvas:s,options:a}=o,{contextOptions:i,imageOptions:p}=a||{},u=(p==null?void 0:p.alpha)||1,l=(i==null?void 0:i.contextType)||"2d";if(l!=="2d")throw new Error(`Context type ${i.contextType} is not supported by the CPU backend.`);let c=s.getContext(l,(i==null?void 0:i.contextAttributes)||{});if(c==null)throw new Error(`Could not get the context with ${l} type.`);let[m,d]=n.shape.slice(0,2),f=n.shape.length===2?1:n.shape[2],h=t.data.get(n.dataId).values,g=n.dtype==="float32"?255:1,x=new Uint8ClampedArray(d*m*4);for(let w=0;w1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${E}.`)}else if(n.dtype==="int32"&&(E<0||E>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${E}.`);f===1?(S[0]=E*g,S[1]=E*g,S[2]=E*g):S[T]=E*g}let k=w*4;x[k+0]=Math.round(S[0]),x[k+1]=Math.round(S[1]),x[k+2]=Math.round(S[2]),x[k+3]=Math.round(S[3])}s.width=d,s.height=m;let b=new ImageData(x,d,m);return c.putImageData(b,0,0),n}var v$={kernelName:Mu,backendName:"cpu",kernelFunc:vQ};function Ii(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;Q(n,"sum");let i;n.dtype==="bool"?i=rn({inputs:{x:n},backend:t,attrs:{dtype:"int32"}}):i=fr({inputs:{x:n},backend:t});let p=i.shape.length,u=y.parseAxisParam(s,i.shape),l=C.getAxesPermutation(u,p),c=u,m=i;l!=null&&(m=vt({inputs:{x:i},backend:t,attrs:{perm:l}}),c=C.getInnerMostAxes(c.length,p)),C.assertAxesAreInnerMostDims("sum",c,m.shape.length);let[d,f]=C.computeOutAndReduceShapes(m.shape,c),h=C.upcastType(m.dtype,"int32"),g=vl(t,d,h),x=y.sizeFromShape(f),b=t.data.get(g.dataId).values,w=t.data.get(m.dataId).values;for(let S=0;S=0&&(m=Ii({inputs:{x:m},backend:t,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&t.disposeIntermediateTensorInfo(h);return m}var N$={kernelName:ji,backendName:"cpu",kernelFunc:kQ};function NQ(r){let{inputs:e,backend:t}=r,{dy:o,y:n}=e;Q([o,n],"eluGrad");let s=new Float32Array(y.sizeFromShape(n.shape)),a=t.data.get(n.dataId).values,i=t.data.get(o.dataId).values;for(let p=0;p=0?s[p]=i[p]:s[p]=i[p]*(u+1)}return t.makeTensorInfo(n.shape,"float32",s)}var T$={kernelName:ri,backendName:"cpu",kernelFunc:NQ};var TQ=C.ERF_P,_Q=C.ERF_A1,EQ=C.ERF_A2,$Q=C.ERF_A3,RQ=C.ERF_A4,DQ=C.ERF_A5,AQ=Ie(Un,r=>{let e=Math.sign(r),t=Math.abs(r),o=1/(1+TQ*t);return e*(1-((((DQ*o+RQ)*o+$Q)*o+EQ)*o+_Q)*o*Math.exp(-t*t))}),_$={kernelName:Un,backendName:"cpu",kernelFunc:AQ};function $l(r){let{inputs:e,backend:t,attrs:o}=r,{input:n}=e,{dim:s}=o,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),We({inputs:{x:n},backend:t,attrs:{shape:i}})}var E$={kernelName:ma,backendName:"cpu",kernelFunc:$l};var FQ=Ve((r,e)=>r/e),Yc=Qe(Vn,FQ),Qc={kernelName:Vn,backendName:"cpu",kernelFunc:Yc};function Zf(r,e,t){let o=r.shape,n=o[0],s=o[1],a=t.data.get(r.dataId),i=a.complexTensorInfos.real,p=a.complexTensorInfos.imag,u=[n,s],l=y.sizeFromShape(u),c=y.getTypedArrayFromDType("float32",l),m=y.getTypedArrayFromDType("float32",l);for(let g=0;g{let{image:o}=r,n=t,s=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[a,i,p,u]=o.shape,l=n.data.get(o.dataId).values;for(let m=0;m=0&&w=0,()=>`GatherV2: the index value ${k} is not in [0, ${l-1}]`)}let c=i;i==null&&(c=0);let m=y.sizeFromShape(s.shape),d=C.segment_util.collectGatherOpShapeInfo(n,s,p,c),f=We({inputs:{x:n},backend:t,attrs:{shape:[d.batchSize,d.outerSize,d.dimSize,d.sliceSize]}}),h=We({inputs:{x:s},backend:t,attrs:{shape:[d.batchSize,m/d.batchSize]}}),g=[d.batchSize,d.outerSize,m/d.batchSize,d.sliceSize],x=t.bufferSync(h),b=t.bufferSync(f),w=Lf(b,x,g);return t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(h),t.makeTensorInfo(d.outputShape,w.dtype,w.values)}var O$={kernelName:fa,backendName:"cpu",kernelFunc:UQ};function GQ(r){let{inputs:e,backend:t}=r,{input:o}=e,n=y.sizeFromShape(o.shape),s=o.shape[o.shape.length-1],a=n/s,i=We({inputs:{x:o},backend:t,attrs:{shape:[a,s]}}),p=Zf(i,!0,t),u=We({inputs:{x:p},backend:t,attrs:{shape:o.shape}});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(p),u}var M$={kernelName:Yi,backendName:"cpu",kernelFunc:GQ};var HQ=Ie(qn,r=>Number.isFinite(r)?1:0,"bool"),L$={kernelName:qn,backendName:"cpu",kernelFunc:HQ};var KQ=Ie(jn,r=>Math.abs(r)===1/0?1:0,"bool"),B$={kernelName:jn,backendName:"cpu",kernelFunc:KQ};var qQ=Ie(Xn,r=>Number.isNaN(r)?1:0,"bool"),z$={kernelName:Xn,backendName:"cpu",kernelFunc:qQ};function jQ(r){let{backend:e,attrs:t}=r,{start:o,stop:n,num:s}=t,a=Bf(o,n,s);return e.makeTensorInfo([a.length],"float32",a)}var V$={kernelName:Qn,backendName:"cpu",kernelFunc:jQ};var XQ=Ie(Zn,r=>Math.log1p(r)),W$={kernelName:Zn,backendName:"cpu",kernelFunc:XQ};var YQ=Ve((r,e)=>r&&e),QQ=Qe(Jn,YQ,null,"bool"),U$={kernelName:Jn,backendName:"cpu",kernelFunc:QQ};var ZQ=Ie(es,r=>r?0:1,"bool"),G$={kernelName:es,backendName:"cpu",kernelFunc:ZQ};var JQ=Ve((r,e)=>r||e),eZ=Qe(ts,JQ,null,"bool"),H$={kernelName:ts,backendName:"cpu",kernelFunc:eZ};function tZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o;Q(n,"LRN");let u=n.shape[3],l=u-1,c=t.data.get(n.dataId).values,m=y.sizeFromShape(n.shape),d=new Float32Array(m);function f(h){let g=h%u,x=h-g+Math.max(0,g-s),b=h-g+Math.min(g+s,l),w=0;for(;x<=b;x++){let S=c[x];w+=S*S}return w}for(let h=0;h`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p),c;if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))c=fr({inputs:{x:n},backend:t});else{let m=t.data.get(n.dataId).values,d=y.computeStrides(n.shape),f=El(m,n.shape,n.dtype,d,l,"max");c=t.makeTensorInfo(l.outShape,n.dtype,f.values)}return c}var X$={kernelName:ns,backendName:"cpu",kernelFunc:oZ};function nZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o;Q(n,"maxPool3d");let l=C.computePool3DInfo(n.shape,s,a,1,i,p,u),c=t.data.get(n.dataId).values,m=Qf(c,n.shape,n.dtype,y.computeStrides(n.shape),l,"max");return t.makeTensorInfo(m.shape,"float32",m.values)}var Y$={kernelName:ha,backendName:"cpu",kernelFunc:nZ};function sZ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o;Q([n,s],"maxPool3DGrad");let l=C.computePool3DInfo(s.shape,a,i,1,p,u),c=t.bufferSync(s),m=HE(c,l),d=l.strideDepth,f=l.strideHeight,h=l.strideWidth,g=l.dilationDepth,x=l.dilationHeight,b=l.dilationWidth,w=l.effectiveFilterDepth,S=l.effectiveFilterHeight,k=l.effectiveFilterWidth,T=w-1-l.padInfo.front,E=k-1-l.padInfo.left,R=S-1-l.padInfo.top,D=ie(s.shape,"float32"),F=t.bufferSync(n);for(let O=0;O=l.outDepth||Math.floor(re)!==re))for(let ne=0;ne=l.outHeight||Math.floor(ee)!==ee))for(let oe=0;oe=l.outWidth||Math.floor(ue)!==ue)continue;let me=w*S*k-1-m.get(O,re,ee,ue,M),be=J*S*k+ne*k+oe,_e=me===be?1:0;if(_e===0)continue;let ve=F.get(O,re,ee,ue,M);Y+=ve*_e}}}D.set(Y,O,L,B,z,M)}return t.makeTensorInfo(D.shape,D.dtype,D.values)}var Q$={kernelName:Ji,backendName:"cpu",kernelFunc:sZ};function aZ(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s,output:a}=e,i=s;Q([s,a],"maxPoolGrad");let{filterSize:p,strides:u,pad:l,dimRoundingMode:c}=o,m=C.computePool2DInfo(i.shape,p,u,1,l,c),d=t.data.get(i.dataId).values,f=ie(m.outShape,i.dtype,Yf(d,i.shape,i.dtype,m).values),h=m.strideHeight,g=m.strideWidth,x=m.dilationHeight,b=m.dilationWidth,w=m.effectiveFilterHeight,S=m.effectiveFilterWidth,k=S-1-m.padInfo.left,T=w-1-m.padInfo.top,E=ie(i.shape,"float32"),R=t.data.get(n.dataId).values,D=ie(n.shape,"float32",R);for(let F=0;F=m.outHeight||Math.floor(q)!==q))for(let Y=0;Y=m.outWidth||Math.floor(J)!==J)continue;let re=w*S-1-f.get(F,q,J,O),ne=j*S+Y,ee=re===ne?1:0;if(ee===0)continue;let oe=D.get(F,q,J,O);U+=oe*ee}}E.set(U,F,M,L,O)}return t.makeTensorInfo(E.shape,E.dtype,E.values)}var Z$={kernelName:Zi,backendName:"cpu",kernelFunc:aZ};function J$(r,e,t,o,n){let s=y.computeStrides(e),a=El(r,e,t,s,n,"max"),i=Yf(r,e,t,n,!0,o);return[a.values,i.values]}var eR={kernelName:ga,backendName:"cpu",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=e,p=t;Q(o,"MaxPoolWithArgmax");let u=p.data.get(o.dataId).values,l=C.computePool2DInfo(o.shape,n,s,[1,1],a),[c,m]=J$(u,o.shape,o.dtype,i,l),d=p.write(c,l.outShape,o.dtype),f=p.write(m,l.outShape,o.dtype);return[{dataId:d,shape:l.outShape,dtype:o.dtype},{dataId:f,shape:l.outShape,dtype:"int32"}]}};function iZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=y.parseAxisParam(s,n.shape),u=C.computeOutAndReduceShapes(n.shape,i)[1],l=y.sizeFromShape(u),c=[],m=t.makeTensorInfo([],"float32",new Float32Array([l]));c.push(m);let d=rn({inputs:{x:n},backend:t,attrs:{dtype:"float32"}});c.push(d);let f=Yc({inputs:{a:d,b:m},backend:t});c.push(f);let h=Ii({inputs:{x:f},backend:t,attrs:{axis:s,keepDims:a}});return c.forEach(g=>t.disposeIntermediateTensorInfo(g)),h}var tR={kernelName:ss,backendName:"cpu",kernelFunc:iZ};function uZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;Q(n,"min");let i=y.parseAxisParam(s,n.shape),p=i,u=C.getAxesPermutation(p,n.shape.length),l=n;u!=null&&(l=vt({inputs:{x:n},backend:t,attrs:{perm:u}}),p=C.getInnerMostAxes(p.length,n.shape.length)),C.assertAxesAreInnerMostDims("min",p,l.shape.length);let[c,m]=C.computeOutAndReduceShapes(l.shape,p),d=y.sizeFromShape(m),f=y.makeZerosTypedArray(y.sizeFromShape(c),l.dtype),h=t.data.get(l.dataId).values;for(let x=0;xw[0]+n.shape[S]+w[1]),p=s.map(w=>w[0]),u=s.map((w,S)=>w[0]+n.shape[S]),l=a==="reflect"?0:1,c=t.data.get(n.dataId).values,m=n.shape.length,d=y.computeStrides(n.shape),f=y.sizeFromShape(i),h=i.length,g=y.computeStrides(i),x=y.getTypedArrayFromDType(n.dtype,f);for(let w=0;w=u[T]&&(S[T]=(u[T]-1)*2-S[T]+l);S=S.map((T,E)=>T-p[E]);let k=y.locToIndex(S,m,d);x[w]=c[k]}return{dataId:t.write(x,i,n.dtype),shape:i,dtype:n.dtype}}var oR={kernelName:is,backendName:"cpu",kernelFunc:pZ};var lZ=Ve((r,e)=>{let t=r%e;return r<0&&e<0||r>=0&&e>=0?t:(t+e)%e}),cZ=Qe(us,lZ),nR={kernelName:us,backendName:"cpu",kernelFunc:cZ};var aR=Kp(iS());function MI(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{dim:s}=o,a=n.shape.length,i=s;if(i===-1&&(i=a-1),i!==a-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${a} and dim was ${i}`);let p=y.parseAxisParam([i],n.shape),u=OI({inputs:{x:n},backend:t,attrs:{reductionIndices:p,keepDims:!1}}),l=C.expandShapeToKeepDim(u.shape,p),c=We({inputs:{x:u},backend:t,attrs:{shape:l}}),m=jc({inputs:{a:n,b:c},backend:t}),d=aI({inputs:{x:m},backend:t}),f=Ii({inputs:{x:d},backend:t,attrs:{axis:p,keepDims:!1}}),h=We({inputs:{x:f},backend:t,attrs:{shape:l}}),g=Yc({inputs:{a:d,b:h},backend:t});return t.disposeIntermediateTensorInfo(u),t.disposeIntermediateTensorInfo(c),t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(h),g}var sR={kernelName:Fs,backendName:"cpu",kernelFunc:MI};function mZ(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o;Q(n,"multinomial");let p=i?n:MI({inputs:{logits:n},backend:t,attrs:{dim:-1}}),u=p.shape[0],l=p.shape[1],c=t.data.get(p.dataId).values,m=[u,s],d=y.makeZerosTypedArray(y.sizeFromShape(m),"int32");for(let f=0;f=0&&c[m]{y.assertShapesMatch(s,l.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===l.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=e.map(l=>{let c=$l({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=Su({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeIntermediateTensorInfo(l)),u}var hR={kernelName:ya,backendName:"cpu",kernelFunc:LI};function CZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{paddings:s,constantValue:a}=o;Q(n,"pad");let i=s.map((b,w)=>b[0]+n.shape[w]+b[1]),p=s.map(b=>b[0]),u=t.data.get(n.dataId).values,l=y.sizeFromShape(n.shape),c=n.shape.length,m=y.computeStrides(n.shape),d=y.sizeFromShape(i),f=i.length,h=y.computeStrides(i),g=y.getTypedArrayFromDType(n.dtype,d);a!==0&&g.fill(a);for(let b=0;bT+p[E]),k=y.locToIndex(S,f,h);g[k]=u[b]}return{dataId:t.write(g,i,n.dtype),shape:i,dtype:n.dtype}}var Jf={kernelName:fs,backendName:"cpu",kernelFunc:CZ};var wZ=Ve((r,e)=>Math.pow(r,e)),SZ=Qe(hs,wZ),gR={kernelName:hs,backendName:"cpu",kernelFunc:SZ};function IZ(r){let{inputs:e,backend:t,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=e,{outputRaggedRank:i}=o,p=n.map(x=>t.data.get(x.dataId).values),u=n.map(x=>x.shape),l=t.data.get(s.dataId).values,c=t.data.get(a.dataId).values,[m,d,f]=Vf(p,u,l,s.shape,s.dtype,c,a.shape,i),h=m.map(x=>t.makeTensorInfo([x.length],"int32",x)),g=t.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var xR={kernelName:Qp,backendName:"cpu",kernelFunc:IZ};function vZ(r){let{inputs:e,backend:t}=r,{starts:o,limits:n,deltas:s}=e,a=t.data.get(o.dataId).values,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,[u,l]=Wf(a,o.shape,o.dtype,i,n.shape,p,s.shape),c=t.makeTensorInfo([u.length],"int32",u),m=t.makeTensorInfo([l.length],o.dtype,l);return[c,m]}var yR={kernelName:Zp,backendName:"cpu",kernelFunc:vZ};function kZ(r){let{inputs:e,backend:t,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=e,{rowPartitionTypes:p}=o,u=t.data.get(n.dataId).values,l=t.data.get(s.dataId).values,c=t.data.get(a.dataId).values,m=i.map(g=>t.data.get(g.dataId).values),d=i.map(g=>g.shape),[f,h]=Uf(u,n.shape,l,s.shape,s.dtype,c,a.shape,m,d,p);return t.makeTensorInfo(f,s.dtype,h)}var bR={kernelName:Jp,backendName:"cpu",kernelFunc:kZ};function NZ(r){let{backend:e,attrs:t}=r,{start:o,stop:n,dtype:s,step:a}=t,i=fp(o,n,a,s);return e.makeTensorInfo([i.length],s,i)}var CR={kernelName:ba,backendName:"cpu",kernelFunc:NZ};var TZ=Ie(xs,r=>1/r),wR={kernelName:xs,backendName:"cpu",kernelFunc:TZ};function _Z(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o;Q(n,"resizeBilinear");let p=y.computeStrides(n.shape),[u,l]=i,[c,m,d,f]=n.shape,h=t.data.get(n.dataId).values,g=new Float32Array(y.sizeFromShape([c,u,l,f])),x=[s&&u>1?m-1:m,s&&l>1?d-1:d],b=[s&&u>1?u-1:u,s&&l>1?l-1:l],w=0,S=x[0]/b[0],k=x[1]/b[1];for(let T=0;T1?u-1:u,a&&d>1?l-1:l],g=[a&&m>1?m-1:m,a&&d>1?d-1:d],x=h[0]/g[0],b=h[1]/g[1],w=t.data.get(s.dataId).values,S=0;for(let k=0;k1?m-1:m,s&&l>1?d-1:d],b=[s&&u>1?u-1:u,s&&l>1?l-1:l],w=x[0]/b[0],S=x[1]/b[1],k=0;for(let T=0;T1?l-1:l,a&&f>1?c-1:c],b=[a&&d>1?d-1:d,a&&f>1?f-1:f],w=x[0]/b[0],S=x[1]/b[1],k=1/w,T=1/S,E=Math.ceil(k)*2+2,R=Math.ceil(T)*2+2;for(let D=0;D=d)continue;let ee=F+ne*p[1],oe=ne*w,ue=Math.min(l-1,a?Math.round(oe):Math.floor(oe));if(O===ue)for(let me=0;me=f)continue;let _e=ee+be*p[2],ve=be*S,Fe=Math.min(c-1,a?Math.round(ve):Math.floor(ve));z===Fe&&(J+=g[_e+Y])}}h[U+Y]=J}}}}return t.makeTensorInfo(n.shape,n.dtype,h)}var kR={kernelName:ai,backendName:"cpu",kernelFunc:RZ};function DZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o;Q(n,"reverse");let a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return fr({inputs:{x:n},backend:t});let p=new Ge(n.shape,n.dtype),u=t.bufferSync(n);for(let l=0;lm[d]=n.shape[d]-1-m[d]),p.set(u.get(...m),...c)}return t.makeTensorInfo(p.shape,p.dtype,p.values)}var NR={kernelName:Ss,backendName:"cpu",kernelFunc:DZ};var TR={kernelName:Vs,backendName:"cpu",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=e,i=t,p=y.getTypedArrayFromDType(o.dtype,y.sizeFromShape(o.shape)),[u,l,c,m]=o.shape,[d,f]=C.getImageCenter(a,l,c),h=255,g=Math.sin(n),x=Math.cos(n),b=i.data.get(o.dataId).values;for(let S=0;S=0&&B=0&&z{let e=Math.floor(r);return r-e<.5?Math.floor(r):r-e>.5?Math.ceil(r):e%2===0?e:e+1}),_R={kernelName:Is,backendName:"cpu",kernelFunc:AZ};function FZ(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(s,n,a),m=!0,d=t.bufferSync(n),f=t.bufferSync(s),h=Xs(d,f,a,c,u,p,i,l,0,m);return t.makeTensorInfo(a,h.dtype,h.values)}var ER={kernelName:vs,backendName:"cpu",kernelFunc:FZ};function PZ(r,e){let t=0,o=r.length,n=0;for(;t1||n.shape.length===1?1:y.sizeFromShape(n.shape.slice(1));for(let f=0;fr>=0?zZ*r:BZ*(Math.exp(r)-1)),AR={kernelName:Ts,backendName:"cpu",kernelFunc:VZ};var WZ=Ie(Rs,r=>r<0?-1:r>0?1:0),FR={kernelName:Rs,backendName:"cpu",kernelFunc:WZ};var UZ=Ie(Es,r=>Math.sin(r)),PR={kernelName:Es,backendName:"cpu",kernelFunc:UZ};var GZ=Ie($s,r=>Math.sinh(r)),OR={kernelName:$s,backendName:"cpu",kernelFunc:GZ};var HZ=11920928955078125e-23,MR=Math.log(HZ)+2,KZ=Ie(Ds,r=>{let e=r>-MR,t=rNumber(g)))),e.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var XE={kernelName:Hi,backendName:"cpu",kernelFunc:w7};function S7(r){let{inputs:t,backend:e}=r,{inputIndices:o,inputShape:n,newShape:s}=t;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape + ${a.shape}`);let i=t.data.get(o.dataId).values,p=t.data.get(n.dataId).values,u=t.data.get(s.dataId).values,l=t.data.get(a.dataId).values[0],[c,m,d,f,h]=Gf(i,o.shape,o.dtype,p,n.dtype,u,l);return[t.makeTensorInfo(m,o.dtype,c),t.makeTensorInfo([m[0]],n.dtype,d),t.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(g=>Number(g)))),t.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var zR={kernelName:eu,backendName:"cpu",kernelFunc:jZ};function XZ(r){let{inputs:e,backend:t}=r,{inputIndices:o,inputShape:n,newShape:s}=e;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${o.shape}`);if(n.shape.length!==1)throw new Error(`Input shape should be a vector but received shape - ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(e.data.get(n.dataId).values),i=e.data.get(o.dataId).values,p=Array.from(e.data.get(s.dataId).values),[u,c,l]=Ff(i,o.shape,o.dtype,a,p);return[e.makeTensorInfo(c,o.dtype,u),e.makeTensorInfo([l.length],s.dtype,new Int32Array(l))]}var YE={kernelName:ei,backendName:"cpu",kernelFunc:S7};function I7(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(t.data.get(n.dataId).values),i=t.data.get(o.dataId).values,p=Array.from(t.data.get(s.dataId).values),[u,l,c]=Hf(i,o.shape,o.dtype,a,p);return[t.makeTensorInfo(l,o.dtype,u),t.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var VR={kernelName:ui,backendName:"cpu",kernelFunc:XZ};function YZ(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");let a=e.data.get(o.dataId).values,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,[u,c]=Cc(a,o.shape,o.dtype,i,p,!0);return e.makeTensorInfo(c,o.dtype,u)}var QE={kernelName:ya,backendName:"cpu",kernelFunc:I7};function v7(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");let a=t.data.get(o.dataId).values,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,[u,l]=_l(a,o.shape,o.dtype,i,p,!0);return t.makeTensorInfo(l,o.dtype,u)}var WR={kernelName:va,backendName:"cpu",kernelFunc:YZ};function QZ(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");let a=e.data.get(o.dataId).values,i=e.data.get(n.dataId).values,p=e.data.get(s.dataId).values,[u,c]=Cc(a,o.shape,o.dtype,i,p);return e.makeTensorInfo(c,o.dtype,u)}var ZE={kernelName:ba,backendName:"cpu",kernelFunc:v7};function k7(r){let{inputs:t,backend:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=w.calculateShapes(s,n,i),d=!1,f=e.bufferSync(n),h;switch(s.dtype){case"bool":{let g=e.bufferSync(s),x=!!e.data.get(a.dataId).values[0];h=zs(f,g,i,m,c,u,p,l,x,d);break}case"float32":{let g=e.bufferSync(s),x=e.data.get(a.dataId).values[0];h=zs(f,g,i,m,c,u,p,l,x,d);break}case"int32":{let g=e.bufferSync(s),x=e.data.get(a.dataId).values[0];h=zs(f,g,i,m,c,u,p,l,x,d);break}case"string":{let g=e.bufferSync(s),x=y.decodeString(e.data.get(a.dataId).values[0]);h=zs(f,g,i,m,c,u,p,l,x,d);break}default:throw new Error(`Unsupported type ${s.dtype}`)}return e.makeTensorInfo(i,h.dtype,h.values)}var JE={kernelName:vs,backendName:"cpu",kernelFunc:k7};function N7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),c=n.shape.slice();return p.map(l=>{let m=[...c];m[i]=l;let d=Ao({inputs:{x:n},backend:e,attrs:{begin:u,size:m}});return u[i]+=l,d})}var eR={kernelName:xa,backendName:"cpu",kernelFunc:N7};var tR={kernelName:Ki,backendName:"cpu",kernelFunc:({inputs:r,backend:t})=>{let{x:e}=r,o=t;Q(e,"square");let n=o.data.get(e.dataId).values,s=new Float32Array(n.length);for(let i=0;i{let e=t;return isNaN(r)?NaN:r>0?1:e.alpha}),rR={kernelName:wo,backendName:"cpu",kernelFunc:T7};function _7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o;Q(n,"stridedSlice");let{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=Ve({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let _=pt.computeOutShape(b,C,S),E=Ao({inputs:{x:n},backend:e,attrs:{begin:b,size:_}});k=Ve({inputs:{x:E},backend:e,attrs:{shape:f}}),e.disposeIntermediateTensorInfo(E)}else{let _=e.bufferSync(n),E=Pf(d,_,S,b);k=e.makeTensorInfo(f,E.dtype,E.values)}return k}var oR={kernelName:Ns,backendName:"cpu",kernelFunc:_7};function $7(r){let{inputs:t,backend:e,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:c,dataSplits:l}=t,m=e.data.get(c.dataId).values,d=e.data.get(l.dataId).values,[f,h]=up(m,d,n,s,a,i,p,u);return[e.makeTensorInfo([f.length],"string",f),e.makeTensorInfo(l.shape,"int32",h)]}var nR={kernelName:Ca,backendName:"cpu",kernelFunc:$7};function E7(r){let{inputs:t,backend:e,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=e.data.get(s.dataId).values,p=e.data.get(a.dataId).values[0],[u,c,l]=pp(i,p,n),m=c.length;return[e.makeTensorInfo([m,2],"int32",u),e.makeTensorInfo([m],"string",c),e.makeTensorInfo([2],"int32",new Int32Array(l))]}var sR={kernelName:qi,backendName:"cpu",kernelFunc:E7};function R7(r){let{inputs:t,backend:e,attrs:o}=r,{numBuckets:n}=o,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(n<=0)throw new Error("Number of buckets must be at least 1");let a=e.data.get(s.dataId).values,i=cp(a,n);return e.makeTensorInfo(s.shape,"int32",i)}var aR={kernelName:ji,backendName:"cpu",kernelFunc:R7};var D7=Ie(_s,r=>Math.tan(r)),iR={kernelName:_s,backendName:"cpu",kernelFunc:D7};var A7=Ie($s,r=>Math.tanh(r)),uR={kernelName:$s,backendName:"cpu",kernelFunc:A7};function F7(r){let{inputs:t,backend:e}=r,{tensor:o,indices:n,updates:s}=t,{sliceRank:a,numUpdates:i,sliceSize:p,strides:u,outputSize:c}=w.calculateShapes(s,n,o.shape),l=!1,m=e.bufferSync(n),d=e.bufferSync(s),f=e.bufferSync(o),h=zs(m,d,o.shape,c,p,i,a,u,f,l);return e.makeTensorInfo(o.shape,h.dtype,h.values)}var pR={kernelName:ds,backendName:"cpu",kernelFunc:F7};function P7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{reps:s}=o;Q(n,"tile");let a=Of(e.bufferSync(n),s);return e.makeTensorInfo(a.shape,a.dtype,a.values)}var cR={kernelName:uo,backendName:"cpu",kernelFunc:P7};function O7(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{k:s,sorted:a}=o;Q(n,"topk");let i=e.data.get(n.dataId).values,[p,u]=Mf(i,n.shape,n.dtype,s,a);return[e.makeTensorInfo(p.shape,p.dtype,p.values),e.makeTensorInfo(u.shape,u.dtype,u.values)]}var lR={kernelName:Es,backendName:"cpu",kernelFunc:O7};function M7(r){let{inputs:t,attrs:e,backend:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=e,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=y.computeStrides(n.shape),b=x[0],C=x[1],S=x[2],k=y.computeStrides(g),_=k[0],E=k[1],R=k[2],D=y.getTypedArrayFromDType(n.dtype,y.sizeFromShape(g));D.fill(p);let P=o.data.get(n.dataId).values,O=o.data.get(s.dataId).values;for(let L=0;Lt-1)if(t<=1)e=0;else{let o=2*t;e-=o*Math.trunc(e/o),e>=t&&(e=o-e-1)}return y.clamp(0,e,t-1)}function B7(r,t){let e=r;if(e<0)if(t<=1)e=0;else{let o=t-1;e+=t*(Math.trunc(-e/o)+1)}else if(e>t-1)if(t<=1)e=0;else{let o=t-1;e-=t*Math.trunc(e/o)}return y.clamp(0,e,t-1)}function z7(r,t){return r}function V7(r,t){return y.clamp(0,r,t-1)}function Hl(r,t,e,o,n,s,a,i,p,u,c){let l=a*o+i*n+p*s+u;return 0<=i&&ie.disposeIntermediateTensorInfo(f)),d}var gR={kernelName:Yi,backendName:"cpu",kernelFunc:K7};var q7=[V_,XT,W_,U_,e_,G_,H_,K_,q_,j_,X_,Y_,Q_,Z_,J_,t$,r$,o$,n$,z_,s$,a$,i$,t_,u$,JT,r_,p$,YT,c$,m$,d$,f$,h$,g$,x$,y$,b$,C$,w$,S$,I$,v$,k$,N$,T$,_$,$$,E$,R$,D$,A$,P$,F_,O$,o_,M$,n_,L$,s_,B$,z$,V$,a_,i_,W$,U$,G$,H$,u_,p_,QT,K$,l$,q$,j$,X$,P_,c_,l_,Y$,m_,Q$,Z$,J$,eE,tE,rE,oE,d_,nE,sE,aE,iE,pE,cE,lE,f_,mE,dE,gE,h_,g_,xE,yE,bE,x_,CE,IE,vE,Vf,kE,O_,b_,NE,TE,_E,$E,ZT,Wl,EE,M_,L_,B_,RE,DE,AE,FE,PE,OE,ME,v_,LE,zE,VE,WE,N_,UE,GE,HE,T_,fE,qE,jE,XE,YE,QE,ZE,JE,eR,$_,tR,E_,R_,rR,oR,nR,sR,aR,D_,F$,iR,uR,pR,cR,lR,dR,y_,fR,hR,gR,wE];for(let r of q7)ti(r);var Tc={};qe(Tc,{assertNotComplex:()=>Vs,bindCanvasToFramebuffer:()=>rZ,bindColorTextureToFramebuffer:()=>Xl,bindTextureToProgramUniformSampler:()=>zI,bindTextureUnit:()=>CR,bindVertexBufferToProgramAttribute:()=>qf,callAndCheck:()=>ce,canBeRepresented:()=>_I,createFragmentShader:()=>EI,createFramebuffer:()=>MI,createProgram:()=>RI,createStaticIndexBuffer:()=>FI,createStaticVertexBuffer:()=>AI,createTexture:()=>PI,createVertexShader:()=>$I,getBatchDim:()=>hi,getExtensionOrThrow:()=>vc,getFramebufferErrorMessage:()=>wR,getMaxTexturesInShader:()=>UI,getNumChannels:()=>eZ,getProgramUniformLocation:()=>BI,getProgramUniformLocationOrThrow:()=>LI,getRowsCols:()=>gi,getShapeAs3D:()=>Nc,getTextureShapeFromLogicalShape:()=>VI,getWebGLDisjointQueryTimerVersion:()=>GI,getWebGLErrorMessage:()=>bR,getWebGLMaxTextureSize:()=>WI,hasExtension:()=>Kr,isCapableOfRenderingToFloatTexture:()=>HI,isDownloadFloatTextureEnabled:()=>KI,isReshapeFree:()=>hu,isWebGLFenceEnabled:()=>qI,isWebGLVersionEnabled:()=>Xf,linkProgram:()=>DI,logShaderSourceAndInfoLog:()=>Kf,resetMaxTextureSize:()=>oZ,resetMaxTexturesInShader:()=>nZ,unbindColorTextureFromFramebuffer:()=>jf,unbindTextureUnit:()=>tZ,validateFramebuffer:()=>kc,validateProgram:()=>jl,validateTextureSize:()=>OI});var dp={},Wf={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function kI(r,t){dp[r]=t}function Hr(r,t){if(!(r in dp)||t!=null){let o=X7(r,t);if(o!==null)dp[r]=o;else return console.log("Could not get context for WebGL version",r),null}let e=dp[r];return e==null||e.isContextLost()?(delete dp[r],Hr(r)):(e.disable(e.DEPTH_TEST),e.disable(e.STENCIL_TEST),e.disable(e.BLEND),e.disable(e.DITHER),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SAMPLE_COVERAGE),e.enable(e.SCISSOR_TEST),e.enable(e.CULL_FACE),e.cullFace(e.BACK),dp[r])}function j7(r){if(!A().getBool("IS_SAFARI")&&typeof OffscreenCanvas!="undefined"&&r===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 X7(r,t){if(r!==1&&r!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let e=t==null?j7(r):t;return e.addEventListener("webglcontextlost",o=>{o.preventDefault(),delete dp[r]},!1),A().getBool("SOFTWARE_WEBGL_ENABLED")&&(Wf.failIfMajorPerformanceCaveat=!1),r===1?e.getContext("webgl",Wf)||e.getContext("experimental-webgl",Wf):e.getContext("webgl2",Wf)}var fu;(function(r){r[r.DENSE=0]="DENSE",r[r.SHARED_BATCH=1]="SHARED_BATCH"})(fu||(fu={}));var mr;(function(r){r[r.RENDER=0]="RENDER",r[r.UPLOAD=1]="UPLOAD",r[r.PIXELS=2]="PIXELS",r[r.DOWNLOAD=3]="DOWNLOAD"})(mr||(mr={}));var er;(function(r){r[r.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",r[r.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",r[r.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",r[r.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",r[r.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(er||(er={}));function fp(r,t){return[t,r]}function xR(r,t){return r*t}function Kl(r){let t=y.sizeFromShape(r),e=Math.ceil(t/4);return y.sizeToSquarishShape(e)}function Ma(r,t){return[Math.max(1,Math.ceil(t/2)),Math.max(1,Math.ceil(r/2))]}function yR(r,t){let[e,o]=Ma(r,t);return e*o*4}function ql(r,t){let e=r,o,n,s,a,i,p,u,c,l,m;return A().getNumber("WEBGL_VERSION")===2?(o=e.R32F,n=e.R16F,s=e.RGBA16F,a=e.RGBA32F,i=e.RED,u=4,c=1,l=e.HALF_FLOAT,m=e.FLOAT,p=e.RGBA8):(o=r.RGBA,n=r.RGBA,s=r.RGBA,a=e.RGBA,i=r.RGBA,u=4,c=4,l=t!=null?t.HALF_FLOAT_OES:null,m=r.FLOAT,p=r.RGBA),{internalFormatFloat:o,internalFormatHalfFloat:n,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:a,textureFormatFloat:i,downloadTextureFormat:p,downloadUnpackNumChannels:u,defaultNumChannels:c,textureTypeHalfFloat:l,textureTypeFloat:m}}function ce(r,t){let e=t();return A().getBool("DEBUG")&&Y7(r),e}function Y7(r){let t=r.getError();if(t!==r.NO_ERROR)throw new Error("WebGL Error: "+bR(r,t))}var Q7=596e-10,Z7=65504;function _I(r){return!!(A().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||r===0||Q7r.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function $I(r,t){let e=fi(r,()=>r.createShader(r.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(ce(r,()=>r.shaderSource(e,t)),ce(r,()=>r.compileShader(e)),r.getShaderParameter(e,r.COMPILE_STATUS)===!1)throw console.log(r.getShaderInfoLog(e)),new Error("Failed to compile vertex shader.");return e}function EI(r,t){let e=fi(r,()=>r.createShader(r.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(ce(r,()=>r.shaderSource(e,t)),ce(r,()=>r.compileShader(e)),A().get("ENGINE_COMPILE_ONLY"))return e;if(r.getShaderParameter(e,r.COMPILE_STATUS)===!1)throw Kf(t,r.getShaderInfoLog(e)),new Error("Failed to compile fragment shader.");return e}var J7=/ERROR: [0-9]+:([0-9]+):/g;function Kf(r,t){let e=J7.exec(t);if(e==null){console.log(`Couldn't parse line number in error: ${t}`),console.log(r);return}let o=+e[1],n=r.split(` -`),s=n.length.toString().length+2,a=n.map((l,m)=>y.rightPad((m+1).toString(),s)+l),i=0;for(let l=0;lr.createProgram(),"Unable to create WebGLProgram.")}function DI(r,t){if(ce(r,()=>r.linkProgram(t)),!A().get("ENGINE_COMPILE_ONLY")&&r.getProgramParameter(t,r.LINK_STATUS)===!1)throw console.log(r.getProgramInfoLog(t)),new Error("Failed to link vertex and fragment shaders.")}function jl(r,t){if(ce(r,()=>r.validateProgram(t)),r.getProgramParameter(t,r.VALIDATE_STATUS)===!1)throw console.log(r.getProgramInfoLog(t)),new Error("Shader program validation failed.")}function AI(r,t){let e=fi(r,()=>r.createBuffer(),"Unable to create WebGLBuffer");return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,e)),ce(r,()=>r.bufferData(r.ARRAY_BUFFER,t,r.STATIC_DRAW)),e}function FI(r,t){let e=fi(r,()=>r.createBuffer(),"Unable to create WebGLBuffer");return ce(r,()=>r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e)),ce(r,()=>r.bufferData(r.ELEMENT_ARRAY_BUFFER,t,r.STATIC_DRAW)),e}function eZ(){return A().getNumber("WEBGL_VERSION")===2?1:4}function PI(r){return fi(r,()=>r.createTexture(),"Unable to create WebGLTexture.")}function OI(r,t){let e=A().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(r<=0||t<=0){let o=`[${r}x${t}]`;throw new Error("Requested texture size "+o+" is invalid.")}if(r>e||t>e){let o=`[${r}x${t}]`,n=`[${e}x${e}]`;throw new Error("Requested texture size "+o+" greater than WebGL maximum on this browser / GPU "+n+".")}}function MI(r){return fi(r,()=>r.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function qf(r,t,e,o,n,s,a){let i=r.getAttribLocation(t,e);return i===-1?!1:(ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,o)),ce(r,()=>r.vertexAttribPointer(i,n,r.FLOAT,!1,s,a)),ce(r,()=>r.enableVertexAttribArray(i)),!0)}function CR(r,t,e){SR(r,e),ce(r,()=>r.activeTexture(r.TEXTURE0+e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,t))}function tZ(r,t){SR(r,t),ce(r,()=>r.activeTexture(r.TEXTURE0+t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function LI(r,t,e){return fi(r,()=>r.getUniformLocation(t,e),'uniform "'+e+'" not present in program.')}function BI(r,t,e){return r.getUniformLocation(t,e)}function zI(r,t,e,o){ce(r,()=>CR(r,t,o)),ce(r,()=>r.uniform1i(e,o))}function rZ(r){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,null)),ce(r,()=>r.viewport(0,0,r.canvas.width,r.canvas.height)),ce(r,()=>r.scissor(0,0,r.canvas.width,r.canvas.height))}function Xl(r,t,e){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,e)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0))}function jf(r,t){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,t)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,null,0))}function kc(r){let t=r.checkFramebufferStatus(r.FRAMEBUFFER);if(t!==r.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+wR(r,t))}function wR(r,t){switch(t){case r.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case r.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case r.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case r.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${t}`}}function fi(r,t,e){let o=ce(r,()=>t());if(o==null)throw new Error(e);return o}function SR(r,t){let e=r.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,o=t+r.TEXTURE0;if(oe){let n=`[gl.TEXTURE0, gl.TEXTURE${e}]`;throw new Error(`textureUnit must be in ${n}.`)}}function hi(r,t=2){return y.sizeFromShape(r.slice(0,r.length-t))}function gi(r){if(r.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[r.length>1?r[r.length-2]:1,r[r.length-1]]}function Nc(r){let t=[1,1,1];return r.length===0||r.length===1&&r[0]===1||(t=[hi(r),...gi(r)]),t}function VI(r,t=!1){let e=A().getNumber("WEBGL_MAX_TEXTURE_SIZE"),o=A().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");o===1/0&&A().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(o=e/2),t&&(e=e*2,o=o*2,r=r.map((i,p)=>p>=r.length-2?y.nearestLargerEven(r[p]):r[p]),r.length===1&&(r=[2,r[0]])),r.length!==2&&(r=y.squeezeShape(r).newShape);let n=y.sizeFromShape(r),s=null;r.length<=1&&n<=e?s=[1,n]:r.length===2&&r[0]<=e&&r[1]<=e?s=r:r.length===3&&r[0]*r[1]<=e&&r[2]<=e?s=[r[0]*r[1],r[2]]:r.length===3&&r[0]<=e&&r[1]*r[2]<=e?s=[r[0],r[1]*r[2]]:r.length===4&&r[0]*r[1]*r[2]<=e&&r[3]<=e?s=[r[0]*r[1]*r[2],r[3]]:r.length===4&&r[0]<=e&&r[1]*r[2]*r[3]<=e&&(s=[r[0],r[1]*r[2]*r[3]]);let a=s!=null&&Math.max(...s)>o&&Math.min(...s)<=(t?2:1)&&Math.min(...s)>0;if(s==null||a)if(t){let i=hi(r),p=2,u=2;r.length&&([p,u]=gi(r)),n=i*(p/2)*(u/2),s=y.sizeToSquarishShape(n).map(c=>c*2)}else s=y.sizeToSquarishShape(n);return s}function Uf(r){return r%2===0}function hu(r,t){if(r=r.slice(-2),t=t.slice(-2),y.arraysEqual(r,t)||!r.length||!t.length||r[0]===0||r[1]===0||t[0]===0||t[1]===0)return!0;if(r.length!==t.length){let e=r[r.length-1],o=t[t.length-1];if(e===o||Uf(e)&&Uf(o)&&(r[0]===1||t[0]===1))return!0}return r[1]===t[1]&&Uf(r[0])&&Uf(t[0])}var Gf,Hf;function WI(r){if(Gf==null){let t=Hr(r);Gf=t.getParameter(t.MAX_TEXTURE_SIZE)}return Gf}function oZ(){Gf=null}function nZ(){Hf=null}function UI(r){if(Hf==null){let t=Hr(r);Hf=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,Hf)}function GI(r){if(r===0)return 0;let t,e=Hr(r);return Kr(e,"EXT_disjoint_timer_query_webgl2")&&r===2?t=2:Kr(e,"EXT_disjoint_timer_query")?t=1:t=0,t}function Kr(r,t){return r.getExtension(t)!=null}function Xf(r){try{if(Hr(r)!=null)return!0}catch(t){return console.log("Error when getting WebGL context: ",t),!1}return!1}function HI(r){if(r===0)return!1;let t=Hr(r);if(r===1){if(!Kr(t,"OES_texture_float"))return!1}else if(!Kr(t,"EXT_color_buffer_float"))return!1;return TI(t)}function KI(r){if(r===0)return!1;let t=Hr(r);if(r===1){if(!Kr(t,"OES_texture_float")||!Kr(t,"WEBGL_color_buffer_float"))return!1}else{if(Kr(t,"EXT_color_buffer_float"))return TI(t);let o="EXT_color_buffer_half_float";if(Kr(t,o)){let n=t.getExtension(o);return sZ(t,n)}return!1}return TI(t)}function TI(r){let t=ql(r),e=r.createTexture();r.bindTexture(r.TEXTURE_2D,e);let o=1,n=1;r.texImage2D(r.TEXTURE_2D,0,t.internalFormatFloat,o,n,0,t.textureFormatFloat,t.textureTypeFloat,null);let s=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,s),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0);let a=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(e),r.deleteFramebuffer(s),a}function sZ(r,t){let e=ql(r,t),o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o);let n=1,s=1;r.texImage2D(r.TEXTURE_2D,0,e.internalFormatHalfFloat,n,s,0,e.textureFormatFloat,e.textureTypeHalfFloat,null);let a=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,a),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0);let i=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(o),r.deleteFramebuffer(a),i}function qI(r){return r!==2?!1:Hr(r).fenceSync!=null}function Vs(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>{e!=null&&y.assert(e.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}var Se=A();Se.registerFlag("HAS_WEBGL",()=>Se.getNumber("WEBGL_VERSION")>0);Se.registerFlag("WEBGL_VERSION",()=>Xf(2)?2:Xf(1)?1:0);Se.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Se.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Se.get("WEBGL_VERSION")===2);Se.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Se.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Se.registerFlag("WEBGL_PACK",()=>Se.getBool("HAS_WEBGL"));Se.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CLIP",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_REDUCE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_LAZILY_UNPACK",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_CONV_IM2COL",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>WI(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>UI(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let r=Se.getNumber("WEBGL_VERSION");return r===0?0:GI(r)});Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Se.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!Ji.isMobile());Se.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>HI(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Se.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Se.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Se.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>KI(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_FENCE_API_ENABLED",()=>qI(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Se.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Se.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,r=>{if(typeof r!="number")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${r}.`)});Se.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>Ji.isMobile()?1:-1,r=>{if(typeof r!="number")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${r}.`)});Se.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);Se.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1);Se.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5);Se.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);Se.registerFlag("WEBGL_EXP_CONV",()=>!1);Se.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>Se.getBool("IS_TEST"));Se.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0);Se.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1);Se.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1);Se.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);function It(){let r,t,e,o,n,s,a,i,p,u;return A().getNumber("WEBGL_VERSION")===2?(r="#version 300 es",t="in",e="out",o="in",n="texture",s="outputColor",a="out vec4 outputColor;",i=A().getBool("WEBGL2_ISNAN_CUSTOM")?` + ${s.shape}`);if(n.shape[0]!==s.shape[0])throw new Error("segmentIds and indices should have same size.");let a=t.data.get(o.dataId).values,i=t.data.get(n.dataId).values,p=t.data.get(s.dataId).values,[u,l]=_l(a,o.shape,o.dtype,i,p);return t.makeTensorInfo(l,o.dtype,u)}var UR={kernelName:ka,backendName:"cpu",kernelFunc:QZ};function ZZ(r){let{inputs:e,backend:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=C.calculateShapes(s,n,i),d=!1,f=t.bufferSync(n),h;switch(s.dtype){case"bool":{let g=t.bufferSync(s),x=!!t.data.get(a.dataId).values[0];h=Xs(f,g,i,m,l,u,p,c,x,d);break}case"float32":{let g=t.bufferSync(s),x=t.data.get(a.dataId).values[0];h=Xs(f,g,i,m,l,u,p,c,x,d);break}case"int32":{let g=t.bufferSync(s),x=t.data.get(a.dataId).values[0];h=Xs(f,g,i,m,l,u,p,c,x,d);break}case"string":{let g=t.bufferSync(s),x=y.decodeString(t.data.get(a.dataId).values[0]);h=Xs(f,g,i,m,l,u,p,c,x,d);break}default:throw new Error(`Unsupported type ${s.dtype}`)}return t.makeTensorInfo(i,h.dtype,h.values)}var GR={kernelName:Ps,backendName:"cpu",kernelFunc:ZZ};function JZ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),l=n.shape.slice();return p.map(c=>{let m=[...l];m[i]=c;let d=nn({inputs:{x:n},backend:t,attrs:{begin:u,size:m}});return u[i]+=c,d})}var HR={kernelName:Ia,backendName:"cpu",kernelFunc:JZ};var KR={kernelName:tu,backendName:"cpu",kernelFunc:({inputs:r,backend:e})=>{let{x:t}=r,o=e;Q(t,"square");let n=o.data.get(t.dataId).values,s=new Float32Array(n.length);for(let i=0;i{let t=e;return isNaN(r)?NaN:r>0?1:t.alpha}),qR={kernelName:Ko,backendName:"cpu",kernelFunc:e9};function t9(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o;Q(n,"stridedSlice");let{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=We({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let T=nt.computeOutShape(b,w,S),E=nn({inputs:{x:n},backend:t,attrs:{begin:b,size:T}});k=We({inputs:{x:E},backend:t,attrs:{shape:f}}),t.disposeIntermediateTensorInfo(E)}else{let T=t.bufferSync(n),E=Kf(d,T,S,b);k=t.makeTensorInfo(f,E.dtype,E.values)}return k}var jR={kernelName:Os,backendName:"cpu",kernelFunc:t9};function r9(r){let{inputs:e,backend:t,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:l,dataSplits:c}=e,m=t.data.get(l.dataId).values,d=t.data.get(c.dataId).values,[f,h]=gp(m,d,n,s,a,i,p,u);return[t.makeTensorInfo([f.length],"string",f),t.makeTensorInfo(c.shape,"int32",h)]}var XR={kernelName:Na,backendName:"cpu",kernelFunc:r9};function o9(r){let{inputs:e,backend:t,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=e;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=t.data.get(s.dataId).values,p=t.data.get(a.dataId).values[0],[u,l,c]=xp(i,p,n),m=l.length;return[t.makeTensorInfo([m,2],"int32",u),t.makeTensorInfo([m],"string",l),t.makeTensorInfo([2],"int32",new Int32Array(c))]}var YR={kernelName:ru,backendName:"cpu",kernelFunc:o9};function n9(r){let{inputs:e,backend:t,attrs:o}=r,{numBuckets:n}=o,{input:s}=e;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(n<=0)throw new Error("Number of buckets must be at least 1");let a=t.data.get(s.dataId).values,i=yp(a,n);return t.makeTensorInfo(s.shape,"int32",i)}var QR={kernelName:ou,backendName:"cpu",kernelFunc:n9};var s9=Ie(Ms,r=>Math.tan(r)),ZR={kernelName:Ms,backendName:"cpu",kernelFunc:s9};var a9=Ie(Ls,r=>Math.tanh(r)),JR={kernelName:Ls,backendName:"cpu",kernelFunc:a9};function i9(r){let{inputs:e,backend:t}=r,{tensor:o,indices:n,updates:s}=e,{sliceRank:a,numUpdates:i,sliceSize:p,strides:u,outputSize:l}=C.calculateShapes(s,n,o.shape),c=!1,m=t.bufferSync(n),d=t.bufferSync(s),f=t.bufferSync(o),h=Xs(m,d,o.shape,l,p,i,a,u,f,c);return t.makeTensorInfo(o.shape,h.dtype,h.values)}var eD={kernelName:ks,backendName:"cpu",kernelFunc:i9};function u9(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{reps:s}=o;Q(n,"tile");let a=qf(t.bufferSync(n),s);return t.makeTensorInfo(a.shape,a.dtype,a.values)}var tD={kernelName:Mo,backendName:"cpu",kernelFunc:u9};function p9(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{k:s,sorted:a}=o;Q(n,"topk");let i=t.data.get(n.dataId).values,[p,u]=jf(i,n.shape,n.dtype,s,a);return[t.makeTensorInfo(p.shape,p.dtype,p.values),t.makeTensorInfo(u.shape,u.dtype,u.values)]}var rD={kernelName:Bs,backendName:"cpu",kernelFunc:p9};function l9(r){let{inputs:e,attrs:t,backend:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=t,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=y.computeStrides(n.shape),b=x[0],w=x[1],S=x[2],k=y.computeStrides(g),T=k[0],E=k[1],R=k[2],D=y.getTypedArrayFromDType(n.dtype,y.sizeFromShape(g));D.fill(p);let F=o.data.get(n.dataId).values,O=o.data.get(s.dataId).values;for(let L=0;Le-1)if(e<=1)t=0;else{let o=2*e;t-=o*Math.trunc(t/o),t>=e&&(t=o-t-1)}return y.clamp(0,t,e-1)}function m9(r,e){let t=r;if(t<0)if(e<=1)t=0;else{let o=e-1;t+=e*(Math.trunc(-t/o)+1)}else if(t>e-1)if(e<=1)t=0;else{let o=e-1;t-=e*Math.trunc(t/o)}return y.clamp(0,t,e-1)}function d9(r,e){return r}function f9(r,e){return y.clamp(0,r,e-1)}function em(r,e,t,o,n,s,a,i,p,u,l){let c=a*o+i*n+p*s+u;return 0<=i&&it.disposeIntermediateTensorInfo(f)),d}var iD={kernelName:su,backendName:"cpu",kernelFunc:b9};var C9=[DE,z_,AE,FE,H_,PE,OE,ME,LE,BE,zE,VE,WE,UE,GE,KE,qE,jE,XE,RE,YE,QE,ZE,K_,JE,G_,q_,e$,V_,t$,o$,n$,s$,a$,i$,u$,p$,l$,c$,m$,d$,f$,h$,g$,x$,y$,b$,C$,w$,S$,I$,v$,N$,kE,T$,j_,_$,X_,E$,Y_,$$,R$,D$,Q_,Z_,A$,F$,P$,O$,J_,eE,W_,M$,r$,L$,B$,z$,NE,tE,rE,V$,oE,W$,U$,G$,H$,K$,q$,j$,nE,X$,Y$,Q$,Z$,eR,tR,rR,sE,oR,nR,iR,aE,iE,uR,pR,lR,uE,cR,fR,hR,Jf,gR,TE,lE,xR,yR,bR,CR,U_,Qc,wR,_E,EE,$E,SR,IR,vR,kR,NR,TR,_R,hE,ER,RR,DR,AR,xE,FR,PR,OR,yE,sR,LR,BR,zR,VR,WR,UR,GR,HR,CE,KR,wE,SE,qR,jR,XR,YR,QR,IE,k$,ZR,JR,eD,tD,rD,nD,pE,sD,aD,iD,mR];for(let r of C9)li(r);var Fl={};qe(Fl,{assertNotComplex:()=>Ys,bindCanvasToFramebuffer:()=>E9,bindColorTextureToFramebuffer:()=>nm,bindTextureToProgramUniformSampler:()=>e0,bindTextureUnit:()=>cD,bindVertexBufferToProgramAttribute:()=>sh,callAndCheck:()=>ce,canBeRepresented:()=>WI,createFragmentShader:()=>GI,createFramebuffer:()=>QI,createProgram:()=>HI,createStaticIndexBuffer:()=>jI,createStaticVertexBuffer:()=>qI,createTexture:()=>XI,createVertexShader:()=>UI,getBatchDim:()=>ki,getExtensionOrThrow:()=>Rl,getFramebufferErrorMessage:()=>mD,getMaxTexturesInShader:()=>o0,getNumChannels:()=>T9,getProgramUniformLocation:()=>JI,getProgramUniformLocationOrThrow:()=>ZI,getRowsCols:()=>Ni,getShapeAs3D:()=>Al,getTextureShapeFromLogicalShape:()=>t0,getWebGLDisjointQueryTimerVersion:()=>n0,getWebGLErrorMessage:()=>lD,getWebGLMaxTextureSize:()=>r0,hasExtension:()=>Jr,isCapableOfRenderingToFloatTexture:()=>s0,isDownloadFloatTextureEnabled:()=>a0,isReshapeFree:()=>vu,isWebGLFenceEnabled:()=>i0,isWebGLVersionEnabled:()=>ih,linkProgram:()=>KI,logShaderSourceAndInfoLog:()=>nh,resetMaxTextureSize:()=>$9,resetMaxTexturesInShader:()=>R9,unbindColorTextureFromFramebuffer:()=>ah,unbindTextureUnit:()=>_9,validateFramebuffer:()=>Dl,validateProgram:()=>om,validateTextureSize:()=>YI});var wp={},eh={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function BI(r,e){wp[r]=e}function Zr(r,e){if(!(r in wp)||e!=null){let o=S9(r,e);if(o!==null)wp[r]=o;else return console.log("Could not get context for WebGL version",r),null}let t=wp[r];return t==null||t.isContextLost()?(delete wp[r],Zr(r)):(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),wp[r])}function w9(r){if(!A().getBool("IS_SAFARI")&&typeof OffscreenCanvas!="undefined"&&r===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 S9(r,e){if(r!==1&&r!==2)throw new Error("Cannot get WebGL rendering context, WebGL is disabled.");let t=e==null?w9(r):e;return t.addEventListener("webglcontextlost",o=>{o.preventDefault(),delete wp[r]},!1),A().getBool("SOFTWARE_WEBGL_ENABLED")&&(eh.failIfMajorPerformanceCaveat=!1),r===1?t.getContext("webgl",eh)||t.getContext("experimental-webgl",eh):t.getContext("webgl2",eh)}var Iu;(function(r){r[r.DENSE=0]="DENSE",r[r.SHARED_BATCH=1]="SHARED_BATCH"})(Iu||(Iu={}));var hr;(function(r){r[r.RENDER=0]="RENDER",r[r.UPLOAD=1]="UPLOAD",r[r.PIXELS=2]="PIXELS",r[r.DOWNLOAD=3]="DOWNLOAD"})(hr||(hr={}));var or;(function(r){r[r.UNPACKED_FLOAT16=0]="UNPACKED_FLOAT16",r[r.UNPACKED_FLOAT32=1]="UNPACKED_FLOAT32",r[r.PACKED_4X1_UNSIGNED_BYTE=2]="PACKED_4X1_UNSIGNED_BYTE",r[r.PACKED_2X2_FLOAT32=3]="PACKED_2X2_FLOAT32",r[r.PACKED_2X2_FLOAT16=4]="PACKED_2X2_FLOAT16"})(or||(or={}));function Sp(r,e){return[e,r]}function uD(r,e){return r*e}function tm(r){let e=y.sizeFromShape(r),t=Math.ceil(e/4);return y.sizeToSquarishShape(t)}function Ga(r,e){return[Math.max(1,Math.ceil(e/2)),Math.max(1,Math.ceil(r/2))]}function pD(r,e){let[t,o]=Ga(r,e);return t*o*4}function rm(r,e){let t=r,o,n,s,a,i,p,u,l,c,m;return A().getNumber("WEBGL_VERSION")===2?(o=t.R32F,n=t.R16F,s=t.RGBA16F,a=t.RGBA32F,i=t.RED,u=4,l=1,c=t.HALF_FLOAT,m=t.FLOAT,p=t.RGBA8):(o=r.RGBA,n=r.RGBA,s=r.RGBA,a=t.RGBA,i=r.RGBA,u=4,l=4,c=e!=null?e.HALF_FLOAT_OES:null,m=r.FLOAT,p=r.RGBA),{internalFormatFloat:o,internalFormatHalfFloat:n,internalFormatPackedHalfFloat:s,internalFormatPackedFloat:a,textureFormatFloat:i,downloadTextureFormat:p,downloadUnpackNumChannels:u,defaultNumChannels:l,textureTypeHalfFloat:c,textureTypeFloat:m}}function ce(r,e){let t=e();return A().getBool("DEBUG")&&I9(r),t}function I9(r){let e=r.getError();if(e!==r.NO_ERROR)throw new Error("WebGL Error: "+lD(r,e))}var v9=596e-10,k9=65504;function WI(r){return!!(A().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||r===0||v9r.getExtension(e),'Extension "'+e+'" not supported on this browser.')}function UI(r,e){let t=vi(r,()=>r.createShader(r.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(ce(r,()=>r.shaderSource(t,e)),ce(r,()=>r.compileShader(t)),r.getShaderParameter(t,r.COMPILE_STATUS)===!1)throw console.log(r.getShaderInfoLog(t)),new Error("Failed to compile vertex shader.");return t}function GI(r,e){let t=vi(r,()=>r.createShader(r.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(ce(r,()=>r.shaderSource(t,e)),ce(r,()=>r.compileShader(t)),A().get("ENGINE_COMPILE_ONLY"))return t;if(r.getShaderParameter(t,r.COMPILE_STATUS)===!1)throw nh(e,r.getShaderInfoLog(t)),new Error("Failed to compile fragment shader.");return t}var N9=/ERROR: [0-9]+:([0-9]+):/g;function nh(r,e){let t=N9.exec(e);if(t==null){console.log(`Couldn't parse line number in error: ${e}`),console.log(r);return}let o=+t[1],n=r.split(` +`),s=n.length.toString().length+2,a=n.map((c,m)=>y.rightPad((m+1).toString(),s)+c),i=0;for(let c=0;cr.createProgram(),"Unable to create WebGLProgram.")}function KI(r,e){if(ce(r,()=>r.linkProgram(e)),!A().get("ENGINE_COMPILE_ONLY")&&r.getProgramParameter(e,r.LINK_STATUS)===!1)throw console.log(r.getProgramInfoLog(e)),new Error("Failed to link vertex and fragment shaders.")}function om(r,e){if(ce(r,()=>r.validateProgram(e)),r.getProgramParameter(e,r.VALIDATE_STATUS)===!1)throw console.log(r.getProgramInfoLog(e)),new Error("Shader program validation failed.")}function qI(r,e){let t=vi(r,()=>r.createBuffer(),"Unable to create WebGLBuffer");return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,t)),ce(r,()=>r.bufferData(r.ARRAY_BUFFER,e,r.STATIC_DRAW)),t}function jI(r,e){let t=vi(r,()=>r.createBuffer(),"Unable to create WebGLBuffer");return ce(r,()=>r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t)),ce(r,()=>r.bufferData(r.ELEMENT_ARRAY_BUFFER,e,r.STATIC_DRAW)),t}function T9(){return A().getNumber("WEBGL_VERSION")===2?1:4}function XI(r){return vi(r,()=>r.createTexture(),"Unable to create WebGLTexture.")}function YI(r,e){let t=A().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(r<=0||e<=0){let o=`[${r}x${e}]`;throw new Error("Requested texture size "+o+" is invalid.")}if(r>t||e>t){let o=`[${r}x${e}]`,n=`[${t}x${t}]`;throw new Error("Requested texture size "+o+" greater than WebGL maximum on this browser / GPU "+n+".")}}function QI(r){return vi(r,()=>r.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function sh(r,e,t,o,n,s,a){let i=r.getAttribLocation(e,t);return i===-1?!1:(ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,o)),ce(r,()=>r.vertexAttribPointer(i,n,r.FLOAT,!1,s,a)),ce(r,()=>r.enableVertexAttribArray(i)),!0)}function cD(r,e,t){dD(r,t),ce(r,()=>r.activeTexture(r.TEXTURE0+t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,e))}function _9(r,e){dD(r,e),ce(r,()=>r.activeTexture(r.TEXTURE0+e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function ZI(r,e,t){return vi(r,()=>r.getUniformLocation(e,t),'uniform "'+t+'" not present in program.')}function JI(r,e,t){return r.getUniformLocation(e,t)}function e0(r,e,t,o){ce(r,()=>cD(r,e,o)),ce(r,()=>r.uniform1i(t,o))}function E9(r){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,null)),ce(r,()=>r.viewport(0,0,r.canvas.width,r.canvas.height)),ce(r,()=>r.scissor(0,0,r.canvas.width,r.canvas.height))}function nm(r,e,t){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,t)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0))}function ah(r,e){ce(r,()=>r.bindFramebuffer(r.FRAMEBUFFER,e)),ce(r,()=>r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,null,0))}function Dl(r){let e=r.checkFramebufferStatus(r.FRAMEBUFFER);if(e!==r.FRAMEBUFFER_COMPLETE)throw new Error("Error binding framebuffer: "+mD(r,e))}function mD(r,e){switch(e){case r.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_ATTACHMENT";case r.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";case r.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"FRAMEBUFFER_INCOMPLETE_DIMENSIONS";case r.FRAMEBUFFER_UNSUPPORTED:return"FRAMEBUFFER_UNSUPPORTED";default:return`unknown error ${e}`}}function vi(r,e,t){let o=ce(r,()=>e());if(o==null)throw new Error(t);return o}function dD(r,e){let t=r.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,o=e+r.TEXTURE0;if(ot){let n=`[gl.TEXTURE0, gl.TEXTURE${t}]`;throw new Error(`textureUnit must be in ${n}.`)}}function ki(r,e=2){return y.sizeFromShape(r.slice(0,r.length-e))}function Ni(r){if(r.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[r.length>1?r[r.length-2]:1,r[r.length-1]]}function Al(r){let e=[1,1,1];return r.length===0||r.length===1&&r[0]===1||(e=[ki(r),...Ni(r)]),e}function t0(r,e=!1){let t=A().getNumber("WEBGL_MAX_TEXTURE_SIZE"),o=A().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");o===1/0&&A().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(o=t/2),e&&(t=t*2,o=o*2,r=r.map((i,p)=>p>=r.length-2?y.nearestLargerEven(r[p]):r[p]),r.length===1&&(r=[2,r[0]])),r.length!==2&&(r=y.squeezeShape(r).newShape);let n=y.sizeFromShape(r),s=null;r.length<=1&&n<=t?s=[1,n]:r.length===2&&r[0]<=t&&r[1]<=t?s=r:r.length===3&&r[0]*r[1]<=t&&r[2]<=t?s=[r[0]*r[1],r[2]]:r.length===3&&r[0]<=t&&r[1]*r[2]<=t?s=[r[0],r[1]*r[2]]:r.length===4&&r[0]*r[1]*r[2]<=t&&r[3]<=t?s=[r[0]*r[1]*r[2],r[3]]:r.length===4&&r[0]<=t&&r[1]*r[2]*r[3]<=t&&(s=[r[0],r[1]*r[2]*r[3]]);let a=s!=null&&Math.max(...s)>o&&Math.min(...s)<=(e?2:1)&&Math.min(...s)>0;if(s==null||a)if(e){let i=ki(r),p=2,u=2;r.length&&([p,u]=Ni(r)),n=i*(p/2)*(u/2),s=y.sizeToSquarishShape(n).map(l=>l*2)}else s=y.sizeToSquarishShape(n);return s}function th(r){return r%2===0}function vu(r,e){if(r=r.slice(-2),e=e.slice(-2),y.arraysEqual(r,e)||!r.length||!e.length||r[0]===0||r[1]===0||e[0]===0||e[1]===0)return!0;if(r.length!==e.length){let t=r[r.length-1],o=e[e.length-1];if(t===o||th(t)&&th(o)&&(r[0]===1||e[0]===1))return!0}return r[1]===e[1]&&th(r[0])&&th(e[0])}var rh,oh;function r0(r){if(rh==null){let e=Zr(r);rh=e.getParameter(e.MAX_TEXTURE_SIZE)}return rh}function $9(){rh=null}function R9(){oh=null}function o0(r){if(oh==null){let e=Zr(r);oh=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,oh)}function n0(r){if(r===0)return 0;let e,t=Zr(r);return Jr(t,"EXT_disjoint_timer_query_webgl2")&&r===2?e=2:Jr(t,"EXT_disjoint_timer_query")?e=1:e=0,e}function Jr(r,e){return r.getExtension(e)!=null}function ih(r){try{if(Zr(r)!=null)return!0}catch(e){return console.log("Error when getting WebGL context: ",e),!1}return!1}function s0(r){if(r===0)return!1;let e=Zr(r);if(r===1){if(!Jr(e,"OES_texture_float"))return!1}else if(!Jr(e,"EXT_color_buffer_float"))return!1;return VI(e)}function a0(r){if(r===0)return!1;let e=Zr(r);if(r===1){if(!Jr(e,"OES_texture_float")||!Jr(e,"WEBGL_color_buffer_float"))return!1}else{if(Jr(e,"EXT_color_buffer_float"))return VI(e);let o="EXT_color_buffer_half_float";if(Jr(e,o)){let n=e.getExtension(o);return D9(e,n)}return!1}return VI(e)}function VI(r){let e=rm(r),t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,e.internalFormatFloat,1,1,0,e.textureFormatFloat,e.textureTypeFloat,null);let s=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,s),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0);let a=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(t),r.deleteFramebuffer(s),a}function D9(r,e){let t=rm(r,e),o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,t.internalFormatHalfFloat,1,1,0,t.textureFormatFloat,t.textureTypeHalfFloat,null);let a=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,a),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0);let i=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;return r.bindTexture(r.TEXTURE_2D,null),r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteTexture(o),r.deleteFramebuffer(a),i}function i0(r){return r!==2?!1:Zr(r).fenceSync!=null}function Ys(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!=="complex64",()=>`${e} does not support complex64 tensors in the WebGL backend.`)})}var Se=A();Se.registerFlag("HAS_WEBGL",()=>Se.getNumber("WEBGL_VERSION")>0);Se.registerFlag("WEBGL_VERSION",()=>ih(2)?2:ih(1)?1:0);Se.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1);Se.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>Se.get("WEBGL_VERSION")===2);Se.registerFlag("WEBGL_CPU_FORWARD",()=>!0);Se.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1);Se.registerFlag("WEBGL_PACK",()=>Se.getBool("HAS_WEBGL"));Se.registerFlag("WEBGL_PACK_NORMALIZATION",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CLIP",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_REDUCE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_LAZILY_UNPACK",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_CONV_IM2COL",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>Se.getBool("WEBGL_PACK"));Se.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>r0(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>o0(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let r=Se.getNumber("WEBGL_VERSION");return r===0?0:n0(r)});Se.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>Se.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!uu.isMobile());Se.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>s0(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>Se.getBool("WEBGL_FORCE_F16_TEXTURES")?!1:Se.getBool("WEBGL_RENDER_FLOAT32_CAPABLE"));Se.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>a0(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_FENCE_API_ENABLED",()=>i0(Se.getNumber("WEBGL_VERSION")));Se.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>Se.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0);Se.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,r=>{if(typeof r!="number")throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${r}.`)});Se.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>uu.isMobile()?1:-1,r=>{if(typeof r!="number")throw new Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${r}.`);if(r<0&&r!==-1)throw new Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${r}.`)});Se.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128);Se.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1);Se.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5);Se.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128);Se.registerFlag("WEBGL_EXP_CONV",()=>!1);Se.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>Se.getBool("IS_TEST"));Se.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0);Se.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1);Se.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1);Se.registerFlag("ENGINE_COMPILE_ONLY",()=>!1);function kt(){let r,e,t,o,n,s,a,i,p,u;return A().getNumber("WEBGL_VERSION")===2?(r="#version 300 es",e="in",t="out",o="in",n="texture",s="outputColor",a="out vec4 outputColor;",i=A().getBool("WEBGL2_ISNAN_CUSTOM")?` bool isnan_custom(float val) { uint floatToUint = floatBitsToUint(val); return (floatToUint & 0x7fffffffu) > 0x7f800000u; @@ -75,7 +75,7 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram ivec4 newRound(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `):(r="",t="attribute",e="varying",o="varying",n="texture2D",s="gl_FragColor",a="",i=` + `):(r="",e="attribute",t="varying",o="varying",n="texture2D",s="gl_FragColor",a="",i=` #define isnan(value) isnan_custom(value) bool isnan_custom(float val) { return (val > 0. || val < 1. || val == 0.) ? false : true; @@ -100,15 +100,15 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram ivec4 round(vec4 value) { return ivec4(floor(value + vec4(0.5))); } - `),{version:r,attribute:t,varyingVs:e,varyingFs:o,texture2D:n,output:s,defineOutput:a,defineSpecialNaN:i,defineSpecialInf:p,defineRound:u}}function Ws(r,t,e="index"){let o=y.computeStrides(t);return o.map((n,s)=>{let a=`int ${r[s]} = ${e} / ${n}`,i=s===o.length-1?`int ${r[s+1]} = ${e} - ${r[s]} * ${n}`:`index -= ${r[s]} * ${n}`;return`${a}; ${i};`}).join("")}function hp(r,t,e="index"){let o=y.computeStrides(t);return o.map((n,s)=>{let a=`int ${r[s]} = ${e} / outShapeStrides[${s}]`,i=s===o.length-1?`int ${r[s+1]} = ${e} - ${r[s]} * outShapeStrides[${s}]`:`index -= ${r[s]} * outShapeStrides[${s}]`;return`${a}; ${i};`}).join("")}function aZ(r,t){let e=r.length,o=r.map(s=>`${t}[${s}]`),n=new Array(e-1);n[e-2]=o[e-1];for(let s=e-3;s>=0;--s)n[s]=`(${n[s+1]} * ${o[s+1]})`;return n}function IR(r,t,e="index"){let o=r.map((s,a)=>a),n=aZ(o,t);return n.map((s,a)=>{let i=`int ${r[a]} = ${e} / ${n[a]}`,p=a===n.length-1?`int ${r[a+1]} = ${e} - ${r[a]} * ${n[a]}`:`index -= ${r[a]} * ${n[a]}`;return`${i}; ${p};`}).join("")}function _c(r){let t=y.computeStrides(r).map(e=>e.toString());return` + `),{version:r,attribute:e,varyingVs:t,varyingFs:o,texture2D:n,output:s,defineOutput:a,defineSpecialNaN:i,defineSpecialInf:p,defineRound:u}}function Qs(r,e,t="index"){let o=y.computeStrides(e);return o.map((n,s)=>{let a=`int ${r[s]} = ${t} / ${n}`,i=s===o.length-1?`int ${r[s+1]} = ${t} - ${r[s]} * ${n}`:`index -= ${r[s]} * ${n}`;return`${a}; ${i};`}).join("")}function Ip(r,e,t="index"){let o=y.computeStrides(e);return o.map((n,s)=>{let a=`int ${r[s]} = ${t} / outShapeStrides[${s}]`,i=s===o.length-1?`int ${r[s+1]} = ${t} - ${r[s]} * outShapeStrides[${s}]`:`index -= ${r[s]} * outShapeStrides[${s}]`;return`${a}; ${i};`}).join("")}function A9(r,e){let t=r.length,o=r.map(s=>`${e}[${s}]`),n=new Array(t-1);n[t-2]=o[t-1];for(let s=t-3;s>=0;--s)n[s]=`(${n[s+1]} * ${o[s+1]})`;return n}function fD(r,e,t="index"){let o=r.map((s,a)=>a),n=A9(o,e);return n.map((s,a)=>{let i=`int ${r[a]} = ${t} / ${n[a]}`,p=a===n.length-1?`int ${r[a+1]} = ${t} - ${r[a]} * ${n[a]}`:`index -= ${r[a]} * ${n[a]}`;return`${i}; ${p};`}).join("")}function Pl(r){let e=y.computeStrides(r).map(t=>t.toString());return` int getFlatIndex(ivec3 coords) { - return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z; + return coords.x * ${e[0]} + coords.y * ${e[1]} + coords.z; } -`}function $c(){return` +`}function Ol(){return` int getFlatIndex(ivec3 coords) { return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z; } -`}var Yf=` +`}var uh=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; @@ -147,22 +147,22 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram return c / 255.0; } -`;var{getBroadcastDims:vR}=w;function kR(r,t,e){let o=[];if(r.forEach(d=>{let f=y.sizeFromShape(d.shapeInfo.logicalShape);if(d.shapeInfo.isUniform?o.push(`uniform float ${d.name}${f>1?`[${f}]`:""};`):(o.push(`uniform sampler2D ${d.name};`),o.push(`uniform int offset${d.name};`)),e.enableShapeUniforms){let{uniformShape:h}=Qf(e.packedInputs,d.shapeInfo.logicalShape,d.shapeInfo.texShape);switch(h.length){case 1:o.push(`uniform int ${d.name}Shape;`);break;case 2:o.push(`uniform ivec2 ${d.name}Shape;`);break;case 3:o.push(`uniform ivec3 ${d.name}Shape;`);break;case 4:o.push(`uniform ivec4 ${d.name}Shape;`);break;default:break}o.push(`uniform ivec2 ${d.name}TexShape;`)}}),e.enableShapeUniforms){switch(t.logicalShape.length){case 1:o.push("uniform int outShape;");break;case 2:o.push("uniform ivec2 outShape;"),o.push("uniform int outShapeStrides;");break;case 3:o.push("uniform ivec3 outShape;"),o.push("uniform ivec2 outShapeStrides;");break;case 4:o.push("uniform ivec4 outShape;"),o.push("uniform ivec3 outShapeStrides;");break;default:break}o.push("uniform ivec2 outTexShape;")}e.customUniforms&&e.customUniforms.forEach(d=>{o.push(`uniform ${d.type} ${d.name}${d.arrayIndex?`[${d.arrayIndex}]`:""};`)});let n=o.join(` -`),s=r.map(d=>iZ(d,t,e.packedInputs,e.enableShapeUniforms)).join(` -`),a=t.texShape,i=It(),p=cZ(i),u,c,l=dZ(i);return t.isPacked?(u=uZ(t.logicalShape,a,e.enableShapeUniforms),c=mZ(i)):(u=pZ(t.logicalShape,a,e.enableShapeUniforms),c=lZ(i)),e.packedInputs&&(l+=xZ),[l,p,c,n,u,s,e.userCode].join(` -`)}function Rc(r,t=!1){let e=r.shapeInfo.logicalShape;switch(e.length){case 0:return $Z(r,t);case 1:return RZ(r,t);case 2:return AZ(r,t);case 3:return PZ(r,t);case 4:return MZ(r,t);case 5:return LZ(r);case 6:return BZ(r);default:throw new Error(`${e.length}-D input sampling is not yet supported`)}}function NR(r,t){switch(r.shapeInfo.logicalShape.length){case 0:return _Z(r);case 1:return EZ(r,t);case 2:return DZ(r,t);case 3:return FZ(r,t);default:return OZ(r,t)}}function iZ(r,t,e=!1,o){let n="";e?n+=NR(r,o):n+=Rc(r,o);let s=r.shapeInfo.logicalShape,a=t.logicalShape;return s.length<=a.length&&(e?n+=zZ(r,t):n+=VZ(r,t)),n}function uZ(r,t,e){switch(r.length){case 0:return TR();case 1:return yZ(r,t,e);case 2:return NZ(r,t,e);case 3:return CZ(r,t,e);default:return SZ(r,t,e)}}function pZ(r,t,e){switch(r.length){case 0:return TR();case 1:return bZ(r,t,e);case 2:return TZ(r,t,e);case 3:return wZ(r,t,e);case 4:return IZ(r,t,e);case 5:return vZ(r,t);case 6:return kZ(r,t);default:throw new Error(`${r.length}-D output sampling is not yet supported`)}}function cZ(r){return` +`;var{getBroadcastDims:hD}=C;function gD(r,e,t){let o=[];if(r.forEach(d=>{let f=y.sizeFromShape(d.shapeInfo.logicalShape);if(d.shapeInfo.isUniform?o.push(`uniform float ${d.name}${f>1?`[${f}]`:""};`):(o.push(`uniform sampler2D ${d.name};`),o.push(`uniform int offset${d.name};`)),t.enableShapeUniforms){let{uniformShape:h}=ph(t.packedInputs,d.shapeInfo.logicalShape,d.shapeInfo.texShape);switch(h.length){case 1:o.push(`uniform int ${d.name}Shape;`);break;case 2:o.push(`uniform ivec2 ${d.name}Shape;`);break;case 3:o.push(`uniform ivec3 ${d.name}Shape;`);break;case 4:o.push(`uniform ivec4 ${d.name}Shape;`);break;default:break}o.push(`uniform ivec2 ${d.name}TexShape;`)}}),t.enableShapeUniforms){switch(e.logicalShape.length){case 1:o.push("uniform int outShape;");break;case 2:o.push("uniform ivec2 outShape;"),o.push("uniform int outShapeStrides;");break;case 3:o.push("uniform ivec3 outShape;"),o.push("uniform ivec2 outShapeStrides;");break;case 4:o.push("uniform ivec4 outShape;"),o.push("uniform ivec3 outShapeStrides;");break;default:break}o.push("uniform ivec2 outTexShape;")}t.customUniforms&&t.customUniforms.forEach(d=>{o.push(`uniform ${d.type} ${d.name}${d.arrayIndex?`[${d.arrayIndex}]`:""};`)});let n=o.join(` +`),s=r.map(d=>F9(d,e,t.packedInputs,t.enableShapeUniforms)).join(` +`),a=e.texShape,i=kt(),p=M9(i),u,l,c=z9(i);return e.isPacked?(u=P9(e.logicalShape,a,t.enableShapeUniforms),l=B9(i)):(u=O9(e.logicalShape,a,t.enableShapeUniforms),l=L9(i)),t.packedInputs&&(c+=G9),[c,p,l,n,u,s,t.userCode].join(` +`)}function Ll(r,e=!1){let t=r.shapeInfo.logicalShape;switch(t.length){case 0:return rJ(r,e);case 1:return nJ(r,e);case 2:return aJ(r,e);case 3:return uJ(r,e);case 4:return lJ(r,e);case 5:return cJ(r);case 6:return mJ(r);default:throw new Error(`${t.length}-D input sampling is not yet supported`)}}function xD(r,e){switch(r.shapeInfo.logicalShape.length){case 0:return tJ(r);case 1:return oJ(r,e);case 2:return sJ(r,e);case 3:return iJ(r,e);default:return pJ(r,e)}}function F9(r,e,t=!1,o){let n="";t?n+=xD(r,o):n+=Ll(r,o);let s=r.shapeInfo.logicalShape,a=e.logicalShape;return s.length<=a.length&&(t?n+=dJ(r,e):n+=fJ(r,e)),n}function P9(r,e,t){switch(r.length){case 0:return yD();case 1:return H9(r,e,t);case 2:return J9(r,e,t);case 3:return q9(r,e,t);default:return X9(r,e,t)}}function O9(r,e,t){switch(r.length){case 0:return yD();case 1:return K9(r,e,t);case 2:return eJ(r,e,t);case 3:return j9(r,e,t);case 4:return Y9(r,e,t);case 5:return Q9(r,e);case 6:return Z9(r,e);default:throw new Error(`${r.length}-D output sampling is not yet supported`)}}function M9(r){return` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${r.texture2D}(textureSampler, uv).r; } - `}function lZ(r){return` + `}function L9(r){return` void setOutput(float val) { ${r.output} = vec4(val, 0, 0, 0); } - `}function mZ(r){return` + `}function B9(r){return` void setOutput(vec4 val) { ${r.output} = val; } - `}function dZ(r){return`${r.version} + `}function z9(r){return`${r.version} precision highp float; precision highp int; precision highp sampler2D; @@ -217,10 +217,10 @@ Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dram return fract((p3.x + p3.y) * p3.z); } - ${fZ} - ${hZ} - ${gZ} - `}var fZ=` + ${V9} + ${W9} + ${U9} + `}var V9=` vec2 uvFromFlat(int texNumR, int texNumC, int index) { int texR = index / texNumC; int texC = index - texR * texNumC; @@ -232,7 +232,7 @@ vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,hZ=` +`,W9=` vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texNumC, int row, int col) { int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); @@ -240,7 +240,7 @@ vec2 packedUVfrom2D(int texelsInLogicalRow, int texNumR, int texC = texelIndex - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,gZ=` +`,U9=` vec2 packedUVfrom3D(int texNumR, int texNumC, int texelsInBatch, int texelsInLogicalRow, int b, int row, int col) { @@ -249,7 +249,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int texC = index - texR * texNumC; return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); } -`,xZ=` +`,G9=` float getChannel(vec4 frag, vec2 innerDims) { vec2 modCoord = mod(innerDims, 2.); return modCoord.x == 0. ? @@ -260,11 +260,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float modCoord = mod(float(dim), 2.); return modCoord == 0. ? frag.r : frag.g; } -`;function TR(){return` +`;function yD(){return` int getOutputCoords() { return 0; } - `}function yZ(r,t,e){let o=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return o[0]===1?e?` + `}function H9(r,e,t){let o=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)];return o[0]===1?t?` int getOutputCoords() { return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0)); } @@ -272,7 +272,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int getOutputCoords() { return 2 * int(resultUV.x * ${o[1]}.0); } - `:o[1]===1?e?` + `:o[1]===1?t?` int getOutputCoords() { return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0)); } @@ -280,7 +280,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, int getOutputCoords() { return 2 * int(resultUV.y * ${o[0]}.0); } - `:e?` + `:t?` int getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); ivec2 resTexRC = ivec2(resultUV.yx * @@ -293,23 +293,23 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec2(${o[0]}, ${o[1]})); return 2 * (resTexRC.x * ${o[1]} + resTexRC.y); } - `}function bZ(r,t,e){return t[0]===1?e?` + `}function K9(r,e,t){return e[0]===1?t?` int getOutputCoords() { return int(resultUV.x * float(outTexShape[1])); } `:` int getOutputCoords() { - return int(resultUV.x * ${t[1]}.0); + return int(resultUV.x * ${e[1]}.0); } - `:t[1]===1?e?` + `:e[1]===1?t?` int getOutputCoords() { return int(resultUV.y * float(outTexShape[0])); } `:` int getOutputCoords() { - return int(resultUV.y * ${t[0]}.0); + return int(resultUV.y * ${e[0]}.0); } - `:e?` + `:t?` int getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); @@ -318,10 +318,10 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, `:` int getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t[0]}, ${t[1]})); - return resTexRC.x * ${t[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + return resTexRC.x * ${e[1]} + resTexRC.y; } - `}function CZ(r,t,e){if(e)return` + `}function q9(r,e,t){if(t)return` ivec3 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); int texelsInLogicalRow = int(ceil(float(outShape[2]) / 2.0)); @@ -338,7 +338,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return ivec3(b, r, c); } - `;let o=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],n=Math.ceil(r[2]/2),s=n*Math.ceil(r[1]/2);return` + `;let o=[Math.ceil(e[0]/2),Math.ceil(e[1]/2)],n=Math.ceil(r[2]/2),s=n*Math.ceil(r[1]/2);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${o[0]}, ${o[1]})); @@ -352,23 +352,23 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return ivec3(b, r, c); } - `}function wZ(r,t,e){if(e)return` + `}function j9(r,e,t){if(t)return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(outTexShape[0], outTexShape[1])); int index = resTexRC.x * outTexShape[1] + resTexRC.y; - ${hp(["r","c","d"],r)} + ${Ip(["r","c","d"],r)} return ivec3(r, c, d); } -`;let o=Ws(["r","c","d"],r);return` +`;let o=Qs(["r","c","d"],r);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.x * ${t[1]} + resTexRC.y; + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.x * ${e[1]} + resTexRC.y; ${o} return ivec3(r, c, d); } - `}function SZ(r,t,e){if(e)return` + `}function X9(r,e,t){if(t)return` ivec4 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); ivec2 resTexRC = ivec2(resultUV.yx * @@ -390,7 +390,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, return ivec4(b2, b, r, c); } - `;let o=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],n=Math.ceil(r[r.length-1]/2),s=n*Math.ceil(r[r.length-2]/2),a=s,i="",p="b, r, c";for(let u=2;u=1?c="coords = 0;":c=i.map(b=>`coords.${l[b+u]} = 0;`).join(` -`);let m="";a<2&&s>0?m="coords":m=r.shapeInfo.logicalShape.map((b,C)=>`coords.${l[C+u]}`).join(", ");let d="return outputValue;",h=y.sizeFromShape(r.shapeInfo.logicalShape)===1,x=y.sizeFromShape(t.logicalShape)===1;if(s===1&&!h&&!x)d=` + `}function dJ(r,e){let t=r.name,o=t.charAt(0).toUpperCase()+t.slice(1),n="get"+o+"AtOutCoords",s=r.shapeInfo.logicalShape.length,a=e.logicalShape.length,i=hD(r.shapeInfo.logicalShape,e.logicalShape),p=Re(a),u=a-s,l,c=["x","y","z","w","u","v"];s===0?l="":a<2&&i.length>=1?l="coords = 0;":l=i.map(b=>`coords.${c[b+u]} = 0;`).join(` +`);let m="";a<2&&s>0?m="coords":m=r.shapeInfo.logicalShape.map((b,w)=>`coords.${c[w+u]}`).join(", ");let d="return outputValue;",h=y.sizeFromShape(r.shapeInfo.logicalShape)===1,x=y.sizeFromShape(e.logicalShape)===1;if(s===1&&!h&&!x)d=` return vec4(outputValue.xy, outputValue.xy); `;else if(h&&!x)a===1?d=` return vec4(outputValue.x, outputValue.x, 0., 0.); `:d=` return vec4(outputValue.x); - `;else if(i.length){let b=s-2,C=s-1;i.indexOf(b)>-1&&i.indexOf(C)>-1?d="return vec4(outputValue.x);":i.indexOf(b)>-1?d="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":i.indexOf(C)>-1&&(d="return vec4(outputValue.xx, outputValue.zz);")}return` + `;else if(i.length){let b=s-2,w=s-1;i.indexOf(b)>-1&&i.indexOf(w)>-1?d="return vec4(outputValue.x);":i.indexOf(b)>-1?d="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":i.indexOf(w)>-1&&(d="return vec4(outputValue.xx, outputValue.zz);")}return` vec4 ${n}() { ${p} coords = getOutputCoords(); - ${c} + ${l} vec4 outputValue = get${o}(${m}); ${d} } - `}function VZ(r,t){let e=r.name,o=e.charAt(0).toUpperCase()+e.slice(1),n="get"+o+"AtOutCoords",s=t.texShape,a=r.shapeInfo.texShape,i=r.shapeInfo.logicalShape.length,p=t.logicalShape.length;if(!r.shapeInfo.isUniform&&i===p&&r.shapeInfo.flatOffset==null&&y.arraysEqual(a,s))return` + `}function fJ(r,e){let t=r.name,o=t.charAt(0).toUpperCase()+t.slice(1),n="get"+o+"AtOutCoords",s=e.texShape,a=r.shapeInfo.texShape,i=r.shapeInfo.logicalShape.length,p=e.logicalShape.length;if(!r.shapeInfo.isUniform&&i===p&&r.shapeInfo.flatOffset==null&&y.arraysEqual(a,s))return` float ${n}() { - return sampleTexture(${e}, resultUV); + return sampleTexture(${t}, resultUV); } - `;let u=Re(p),c=vR(r.shapeInfo.logicalShape,t.logicalShape),l=p-i,m,d=["x","y","z","w","u","v"];i===0?m="":p<2&&c.length>=1?m="coords = 0;":m=c.map(h=>`coords.${d[h+l]} = 0;`).join(` -`);let f="";return p<2&&i>0?f="coords":f=r.shapeInfo.logicalShape.map((h,g)=>`coords.${d[g+l]}`).join(", "),` + `;let u=Re(p),l=hD(r.shapeInfo.logicalShape,e.logicalShape),c=p-i,m,d=["x","y","z","w","u","v"];i===0?m="":p<2&&l.length>=1?m="coords = 0;":m=l.map(h=>`coords.${d[h+c]} = 0;`).join(` +`);let f="";return p<2&&i>0?f="coords":f=r.shapeInfo.logicalShape.map((h,g)=>`coords.${d[g+c]}`).join(", "),` float ${n}() { ${u} coords = getOutputCoords(); ${m} return get${o}(${f}); } - `}function Re(r){if(r<=1)return"int";if(r===2)return"ivec2";if(r===3)return"ivec3";if(r===4)return"ivec4";if(r===5)return"ivec5";if(r===6)return"ivec6";throw Error(`GPU for rank ${r} is not yet supported`)}function Qf(r,t,e){let{newShape:o,keptDims:n}=y.squeezeShape(t),s=t.length,a=r&&s===3&&t[0]===1,i=a?t.slice(1):o,p=!r&&s>1&&!y.arraysEqual(t,e)&&o.lengthr[e]).join(", ")}function $R(r,t,e,o){let n=e.map((c,l)=>{let m={logicalShape:c.shape,texShape:c.isUniform?null:c.texData.texShape,isUniform:c.isUniform,isPacked:c.isUniform?!1:c.texData.isPacked,flatOffset:null};return c.texData!=null&&c.texData.slice!=null&&c.texData.slice.flatOffset>0&&(m.flatOffset=c.texData.slice.flatOffset),{name:t.variableNames[l],shapeInfo:m}}),s=n.map(c=>c.shapeInfo),a={logicalShape:o.shape,texShape:o.texData.texShape,isUniform:!1,isPacked:o.texData.isPacked,flatOffset:null},i=kR(n,a,t),p=EI(r.gl,i),u=r.createProgram(p);return A().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(r.buildVao(u),Object.assign({program:t,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a},jI(r,t,u)))}function jI(r,t,e){let o=[],n=[],s,a,i,p=null,u=null;u=r.getUniformLocation(e,"NAN",!1),A().getNumber("WEBGL_VERSION")===1&&(p=r.getUniformLocation(e,"INFINITY",!1));let c=!1;for(let l of t.variableNames){let m={name:l,uniform:r.getUniformLocation(e,l,c),offset:r.getUniformLocation(e,`offset${l}`,c)};t.enableShapeUniforms&&(m.shape=r.getUniformLocation(e,`${l}Shape`,c),m.texShape=r.getUniformLocation(e,`${l}TexShape`,c)),o.push(m)}if(t.enableShapeUniforms&&(s=r.getUniformLocation(e,"outShape",c),i=r.getUniformLocation(e,"outShapeStrides",c),a=r.getUniformLocation(e,"outTexShape",c)),t.customUniforms)for(let l of t.customUniforms)n.push(r.getUniformLocation(e,l.name,c));return{variablesLocations:o,customUniformLocations:n,infLoc:p,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:i,outTexShapeLocation:a}}function _R(r,t){if(r.length!==t.length)throw Error(`Binary was compiled with ${r.length} inputs, but was executed with ${t.length} inputs`);r.forEach((e,o)=>{let n=e.logicalShape,s=t[o],a=s.shape;if(!y.arraysEqual(n,a))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${n} and ${a} must match`);if(e.isUniform&&s.isUniform)return;let i=e.texShape,p=s.isUniform?null:s.texData.texShape;if(!y.arraysEqual(i,p))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${i} and ${p} must match`)})}function ER(r,t,e,o,n){t.program.enableShapeUniforms||(_R(t.inShapeInfos,e),_R([t.outShapeInfo],[o]));let s=o.texData.texture,a=o.texData.texShape;o.texData.isPacked?r.setOutputPackedMatrixTexture(s.texture,a[0],a[1]):r.setOutputMatrixTexture(s.texture,a[0],a[1]),r.setProgram(t.webGLProgram),r.bindVertexArray(t.webGLProgram.vao),A().getNumber("WEBGL_VERSION")===1&&t.infLoc!==null&&r.gl.uniform1f(t.infLoc,1/0),t.nanLoc!==null&&r.gl.uniform1f(t.nanLoc,NaN);for(let p=0;p{let i=a.texData!=null&&a.texData.slice!=null&&a.texData.slice.flatOffset>0;if(r.enableShapeUniforms&&!a.isUniform){let p=a.texData.texShape,{useSqueezeShape:u,uniformShape:c,keptDims:l}=Qf(r.packedInputs,a.shape,p),m="",d="",f="";if(c.length===1&&r.packedInputs){let k=[Math.ceil(p[0]/2),Math.ceil(p[1]/2)];m=`${k[0]>1}_${k[1]>1}`}else if(c.length===2&&!r.packedInputs)d=`${c[0]>1}_${c[1]>1}`;else if(c.length>2&&!r.packedInputs){let k=y.computeStrides(c);f=`${k[0]===p[1]}_${k[k.length-1]===p[1]}`}let h=a.shape.length,g=c.length===2&&y.arraysEqual(a.shape,p),x=y.sizeFromShape(a.shape)===1,b=w.getBroadcastDims(a.shape,e.shape),C=!r.packedInputs&&h===e.shape.length&&y.arraysEqual(p,e.texData.texShape),S=r.packedInputs||c.length>2?"":`${p[0]>1}_${p[1]>1}`;o+=`${h}_${C}_${u?l:""}_${c.length}_${x}_${b}_${g}_${m}_${d}_${f}_${S}_${i}`}else{let p=a.isUniform?"uniform":a.texData.texShape;o+=`${a.shape}_${p}_${i}`}});let n=r.userCode,s=r.constructor.name;return s+="_"+o+"_"+n+`${A().getNumber("WEBGL_VERSION")}`,s}function ut(r){return A().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&r<=4}var Zf=class{constructor(t){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=fu.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let e=It();this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=` + `}function Re(r){if(r<=1)return"int";if(r===2)return"ivec2";if(r===3)return"ivec3";if(r===4)return"ivec4";if(r===5)return"ivec5";if(r===6)return"ivec6";throw Error(`GPU for rank ${r} is not yet supported`)}function ph(r,e,t){let{newShape:o,keptDims:n}=y.squeezeShape(e),s=e.length,a=r&&s===3&&e[0]===1,i=a?e.slice(1):o,p=!r&&s>1&&!y.arraysEqual(e,t)&&o.lengthr[t]).join(", ")}function CD(r,e,t,o){let n=t.map((l,c)=>{let m={logicalShape:l.shape,texShape:l.isUniform?null:l.texData.texShape,isUniform:l.isUniform,isPacked:l.isUniform?!1:l.texData.isPacked,flatOffset:null};return l.texData!=null&&l.texData.slice!=null&&l.texData.slice.flatOffset>0&&(m.flatOffset=l.texData.slice.flatOffset),{name:e.variableNames[c],shapeInfo:m}}),s=n.map(l=>l.shapeInfo),a={logicalShape:o.shape,texShape:o.texData.texShape,isUniform:!1,isPacked:o.texData.isPacked,flatOffset:null},i=gD(n,a,e),p=GI(r.gl,i),u=r.createProgram(p);return A().get("ENGINE_COMPILE_ONLY")?{program:e,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(r.buildVao(u),Object.assign({program:e,fragmentShader:p,source:i,webGLProgram:u,inShapeInfos:s,outShapeInfo:a},u0(r,e,u)))}function u0(r,e,t){let o=[],n=[],s,a,i,p=null,u=null;u=r.getUniformLocation(t,"NAN",!1),A().getNumber("WEBGL_VERSION")===1&&(p=r.getUniformLocation(t,"INFINITY",!1));let l=!1;for(let c of e.variableNames){let m={name:c,uniform:r.getUniformLocation(t,c,l),offset:r.getUniformLocation(t,`offset${c}`,l)};e.enableShapeUniforms&&(m.shape=r.getUniformLocation(t,`${c}Shape`,l),m.texShape=r.getUniformLocation(t,`${c}TexShape`,l)),o.push(m)}if(e.enableShapeUniforms&&(s=r.getUniformLocation(t,"outShape",l),i=r.getUniformLocation(t,"outShapeStrides",l),a=r.getUniformLocation(t,"outTexShape",l)),e.customUniforms)for(let c of e.customUniforms)n.push(r.getUniformLocation(t,c.name,l));return{variablesLocations:o,customUniformLocations:n,infLoc:p,nanLoc:u,outShapeLocation:s,outShapeStridesLocation:i,outTexShapeLocation:a}}function bD(r,e){if(r.length!==e.length)throw Error(`Binary was compiled with ${r.length} inputs, but was executed with ${e.length} inputs`);r.forEach((t,o)=>{let n=t.logicalShape,s=e[o],a=s.shape;if(!y.arraysEqual(n,a))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${n} and ${a} must match`);if(t.isUniform&&s.isUniform)return;let i=t.texShape,p=s.isUniform?null:s.texData.texShape;if(!y.arraysEqual(i,p))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${i} and ${p} must match`)})}function wD(r,e,t,o,n){e.program.enableShapeUniforms||(bD(e.inShapeInfos,t),bD([e.outShapeInfo],[o]));let s=o.texData.texture,a=o.texData.texShape;o.texData.isPacked?r.setOutputPackedMatrixTexture(s.texture,a[0],a[1]):r.setOutputMatrixTexture(s.texture,a[0],a[1]),r.setProgram(e.webGLProgram),r.bindVertexArray(e.webGLProgram.vao),A().getNumber("WEBGL_VERSION")===1&&e.infLoc!==null&&r.gl.uniform1f(e.infLoc,1/0),e.nanLoc!==null&&r.gl.uniform1f(e.nanLoc,NaN);for(let p=0;p{let i=a.texData!=null&&a.texData.slice!=null&&a.texData.slice.flatOffset>0;if(r.enableShapeUniforms&&!a.isUniform){let p=a.texData.texShape,{useSqueezeShape:u,uniformShape:l,keptDims:c}=ph(r.packedInputs,a.shape,p),m="",d="",f="";if(l.length===1&&r.packedInputs){let k=[Math.ceil(p[0]/2),Math.ceil(p[1]/2)];m=`${k[0]>1}_${k[1]>1}`}else if(l.length===2&&!r.packedInputs)d=`${l[0]>1}_${l[1]>1}`;else if(l.length>2&&!r.packedInputs){let k=y.computeStrides(l);f=`${k[0]===p[1]}_${k[k.length-1]===p[1]}`}let h=a.shape.length,g=l.length===2&&y.arraysEqual(a.shape,p),x=y.sizeFromShape(a.shape)===1,b=C.getBroadcastDims(a.shape,t.shape),w=!r.packedInputs&&h===t.shape.length&&y.arraysEqual(p,t.texData.texShape),S=r.packedInputs||l.length>2?"":`${p[0]>1}_${p[1]>1}`;o+=`${h}_${w}_${u?c:""}_${l.length}_${x}_${b}_${g}_${m}_${d}_${f}_${S}_${i}`}else{let p=a.isUniform?"uniform":a.texData.texShape;o+=`${a.shape}_${p}_${i}`}});let n=r.userCode,s=r.constructor.name;return s+="_"+o+"_"+n+`${A().getNumber("WEBGL_VERSION")}`,s}function lt(r){return A().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&r<=4}var lh=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=Iu.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=kt();this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${this.enableShapeUniforms?hp(["r","c","d"],t):Ws(["r","c","d"],t)} + ${this.enableShapeUniforms?Ip(["r","c","d"],e):Qs(["r","c","d"],e)} return ivec3(r, c, d); } @@ -994,11 +994,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result[i] = getA(rc.x, rc.y, rc.z); } - ${e.output} = result; + ${t.output} = result; } - `}};var Jf=class{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=fu.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let e=It();this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=` + `}};var ch=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=Iu.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=kt();this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { - ${this.enableShapeUniforms?hp(["r","c","d"],t):Ws(["r","c","d"],t)} + ${this.enableShapeUniforms?Ip(["r","c","d"],e):Qs(["r","c","d"],e)} return ivec3(r, c, d); } @@ -1014,28 +1014,28 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z)); } - ${e.output} = result; + ${t.output} = result; } - `}};var eh=class{constructor(t){this.variableNames=["A"],this.outTexUsage=mr.DOWNLOAD;let e=It();this.outputShape=t,this.userCode=` - ${Yf} + `}};var mh=class{constructor(e){this.variableNames=["A"],this.outTexUsage=hr.DOWNLOAD;let t=kt();this.outputShape=e,this.userCode=` + ${uh} void main() { float x = getAAtOutCoords(); - ${e.output} = encode_float(x); + ${t.output} = encode_float(x); } - `}};var th=class{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=mr.DOWNLOAD;let e=It();this.outputShape=t,this.userCode=` - ${Yf} + `}};var dh=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=hr.DOWNLOAD;let t=kt();this.outputShape=e,this.userCode=` + ${uh} void main() { ivec3 coords = getOutputCoords(); float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); - ${e.output} = encode_float(x); + ${t.output} = encode_float(x); } - `}};var GZ={R:0,G:1,B:2,A:3},Yl=class{constructor(t,e=!1,o="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];let n=It();this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length);let s="result";e&&(s="floor(result * 255. + 0.5)");let a="";for(let i=0;iov,createBufferFromOutputTexture:()=>av,createFloat16MatrixTexture:()=>JI,createFloat16PackedMatrixTexture:()=>rv,createFloat32MatrixTexture:()=>ZI,createIndexBuffer:()=>QI,createPackedMatrixTexture:()=>tv,createUnsignedBytesMatrixTexture:()=>ev,createVertexBuffer:()=>YI,createVertexShader:()=>XI,downloadByteEncodedFloatMatrixFromOutputTexture:()=>uv,downloadFloat32MatrixFromBuffer:()=>iv,downloadMatrixFromPackedOutputTexture:()=>cv,downloadPackedMatrixFromBuffer:()=>pv,getInternalFormatForFloat16MatrixTexture:()=>nh,getInternalFormatForFloat16PackedMatrixTexture:()=>ih,getInternalFormatForFloat32MatrixTexture:()=>oh,getInternalFormatForPackedMatrixTexture:()=>ah,getInternalFormatForUnsignedBytesMatrixTexture:()=>sh,uploadDenseMatrixToTexture:()=>nv,uploadPixelDataToTexture:()=>sv});function XI(r){let t=It(),e=`${t.version} + `}};var k0={};qe(k0,{bindVertexProgramAttributeStreams:()=>x0,createBufferFromOutputTexture:()=>C0,createFloat16MatrixTexture:()=>d0,createFloat16PackedMatrixTexture:()=>g0,createFloat32MatrixTexture:()=>m0,createIndexBuffer:()=>c0,createPackedMatrixTexture:()=>h0,createUnsignedBytesMatrixTexture:()=>f0,createVertexBuffer:()=>l0,createVertexShader:()=>p0,downloadByteEncodedFloatMatrixFromOutputTexture:()=>S0,downloadFloat32MatrixFromBuffer:()=>w0,downloadMatrixFromPackedOutputTexture:()=>v0,downloadPackedMatrixFromBuffer:()=>I0,getInternalFormatForFloat16MatrixTexture:()=>gh,getInternalFormatForFloat16PackedMatrixTexture:()=>bh,getInternalFormatForFloat32MatrixTexture:()=>hh,getInternalFormatForPackedMatrixTexture:()=>yh,getInternalFormatForUnsignedBytesMatrixTexture:()=>xh,uploadDenseMatrixToTexture:()=>y0,uploadPixelDataToTexture:()=>b0});function p0(r){let e=kt(),t=`${e.version} precision highp float; - ${t.attribute} vec3 clipSpacePos; - ${t.attribute} vec2 uv; - ${t.varyingVs} vec2 resultUV; + ${e.attribute} vec3 clipSpacePos; + ${e.attribute} vec2 uv; + ${e.varyingVs} vec2 resultUV; void main() { gl_Position = vec4(clipSpacePos, 1); resultUV = uv; - }`;return $I(r,e)}function YI(r){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 AI(r,t)}function QI(r){let t=new Uint16Array([0,1,2,2,1,3]);return FI(r,t)}function Ql(r,t,e,o,n,s){OI(t,e);let a=PI(r),i=r.TEXTURE_2D;return ce(r,()=>r.bindTexture(i,a)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MIN_FILTER,r.NEAREST)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MAG_FILTER,r.NEAREST)),A().getNumber("WEBGL_VERSION")===1?ce(r,()=>r.texImage2D(i,0,o,t,e,0,n,s,null)):ce(r,()=>r.texStorage2D(i,1,o,t,e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null)),{texture:a,texShape:[e,t]}}function oh(r){return r.internalFormatFloat}function ZI(r,t,e,o){let[n,s]=fp(t,e);return Ql(r,n,s,oh(o),o.textureFormatFloat,r.FLOAT)}function nh(r){return r.internalFormatHalfFloat}function JI(r,t,e,o){let[n,s]=fp(t,e);return Ql(r,n,s,nh(o),o.textureFormatFloat,o.textureTypeHalfFloat)}function sh(r){return r.downloadTextureFormat}function ev(r,t,e,o){let[n,s]=fp(t,e);return Ql(r,n,s,sh(o),r.RGBA,r.UNSIGNED_BYTE)}function ah(r){return r.internalFormatPackedFloat}function tv(r,t,e,o){let[n,s]=Ma(t,e);return Ql(r,n,s,ah(o),r.RGBA,r.FLOAT)}function ih(r){return r.internalFormatPackedHalfFloat}function rv(r,t,e,o){let[n,s]=Ma(t,e);return Ql(r,n,s,ih(o),r.RGBA,o.textureTypeHalfFloat)}function ov(r,t,e){return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,e)),qf(r,t,"clipSpacePos",e,3,20,0)&&qf(r,t,"uv",e,2,20,12)}function nv(r,t,e,o,n,s){ce(r,()=>r.bindTexture(r.TEXTURE_2D,t));let a,i,p;n instanceof Uint8Array?(a=new Uint8Array(e*o*4),i=r.UNSIGNED_BYTE,p=r.RGBA):(a=new Float32Array(e*o*4),i=r.FLOAT,p=s.internalFormatPackedFloat),a.set(n),A().getNumber("WEBGL_VERSION")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,e,o,r.RGBA,i,a)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,p,e,o,0,r.RGBA,i,a)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function sv(r,t,e){ce(r,()=>r.bindTexture(r.TEXTURE_2D,t)),e.data instanceof Uint8Array?A().getNumber("WEBGL_VERSION")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,e.width,e.height,r.RGBA,r.UNSIGNED_BYTE,e.data)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width,e.height,0,r.RGBA,r.UNSIGNED_BYTE,e.data)):A().getNumber("WEBGL_VERSION")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,e)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function av(r,t,e,o){let n=r.createBuffer();ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,n));let i=4*4*t*e;return ce(r,()=>r.bufferData(r.PIXEL_PACK_BUFFER,i,r.STREAM_READ)),ce(r,()=>r.readPixels(0,0,e,t,r.RGBA,r.FLOAT,0)),ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,null)),n}function iv(r,t,e){let o=r,n=new Float32Array(e);return o.bindBuffer(o.PIXEL_PACK_BUFFER,t),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,n),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),n}function uv(r,t,e,o){let[n,s]=fp(t,e),a=4,i=new Uint8Array(xR(t*e,a));return ce(r,()=>r.readPixels(0,0,n,s,o.downloadTextureFormat,r.UNSIGNED_BYTE,i)),new Float32Array(i.buffer)}function pv(r,t,e,o,n,s,a,i){let p=r,u=new Float32Array(yR(s,a));return p.bindBuffer(p.PIXEL_PACK_BUFFER,t),p.getBufferSubData(p.PIXEL_PACK_BUFFER,0,u),p.bindBuffer(p.PIXEL_PACK_BUFFER,null),u}function cv(r,t,e){let o=new Float32Array(t*e*4);return ce(r,()=>r.readPixels(0,0,e,t,r.RGBA,r.FLOAT,o)),o}var xp=class{constructor(t){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];let e=A().getNumber("WEBGL_VERSION");if(t!=null?(this.gl=t,kI(e,t)):this.gl=Hr(e),t=this.gl,A().getNumber("WEBGL_VERSION")===2){let s=t;this.createVertexArray=()=>ce(s,()=>s.createVertexArray()),this.bindVertexArray=a=>ce(s,()=>s.bindVertexArray(a)),this.deleteVertexArray=a=>ce(s,()=>s.deleteVertexArray(a)),this.getVertexArray=()=>ce(s,()=>s.getParameter(s.VERTEX_ARRAY_BINDING))}else if(t!=null){let s=t.getExtension("OES_vertex_array_object");if(s==null)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>ce(t,()=>s.createVertexArrayOES()),this.bindVertexArray=a=>ce(t,()=>s.bindVertexArrayOES(a)),this.deleteVertexArray=a=>ce(t,()=>s.deleteVertexArrayOES(a)),this.getVertexArray=()=>ce(t,()=>t.getParameter(s.VERTEX_ARRAY_BINDING_OES))}let o="WEBGL_color_buffer_float",n="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),A().getNumber("WEBGL_VERSION")===1){let s="OES_texture_float",a="OES_texture_half_float";if(this.textureFloatExtension=vc(this.gl,s),Kr(this.gl,a))this.textureHalfFloatExtension=vc(this.gl,a);else if(A().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(o),Kr(this.gl,n))this.colorBufferHalfFloatExtension=vc(this.gl,n);else if(A().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(o="EXT_color_buffer_float",Kr(this.gl,o))this.colorBufferFloatExtension=this.gl.getExtension(o);else if(Kr(this.gl,n))this.colorBufferHalfFloatExtension=this.gl.getExtension(n);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=YI(this.gl),this.indexBuffer=QI(this.gl),this.framebuffer=MI(this.gl),this.textureConfig=ql(this.gl,this.textureHalfFloatExtension)}get debug(){return A().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 t=this.gl;ce(t,()=>t.finish()),ce(t,()=>t.bindFramebuffer(t.FRAMEBUFFER,null)),ce(t,()=>t.deleteFramebuffer(this.framebuffer)),ce(t,()=>t.bindBuffer(t.ARRAY_BUFFER,null)),ce(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)),ce(t,()=>t.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(t,e){return this.throwIfDisposed(),ZI(this.gl,t,e,this.textureConfig)}createFloat16MatrixTexture(t,e){return this.throwIfDisposed(),JI(this.gl,t,e,this.textureConfig)}createUnsignedBytesMatrixTexture(t,e){return this.throwIfDisposed(),ev(this.gl,t,e,this.textureConfig)}uploadPixelDataToTexture(t,e){this.throwIfDisposed(),sv(this.gl,t,e)}uploadDenseMatrixToTexture(t,e,o,n){this.throwIfDisposed(),nv(this.gl,t,e,o,n,this.textureConfig)}createFloat16PackedMatrixTexture(t,e){return this.throwIfDisposed(),rv(this.gl,t,e,this.textureConfig)}createPackedMatrixTexture(t,e){return this.throwIfDisposed(),tv(this.gl,t,e,this.textureConfig)}deleteMatrixTexture(t){this.throwIfDisposed(),this.outputTexture===t&&(jf(this.gl,this.framebuffer),this.outputTexture=null),ce(this.gl,()=>this.gl.deleteTexture(t))}downloadByteEncodedFloatMatrixFromOutputTexture(t,e,o){return this.downloadMatrixDriver(t,()=>uv(this.gl,e,o,this.textureConfig))}downloadPackedMatrixFromBuffer(t,e,o,n,s,a){return pv(this.gl,t,e,o,n,s,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(t,e){return iv(this.gl,t,e)}createBufferFromTexture(t,e,o){this.bindTextureToFrameBuffer(t);let n=av(this.gl,e,o,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){let t=this.createFence(this.gl);return this.pollFence(t)}createFence(t){let e,o;if(A().getBool("WEBGL_FENCE_API_ENABLED")){let n=t,s=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);t.flush(),o=()=>{let a=n.clientWaitSync(s,0,0);return a===n.ALREADY_SIGNALED||a===n.CONDITION_SATISFIED},e=s}else A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(e=this.beginQuery(),this.endQuery(),o=()=>this.isQueryAvailable(e,A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):o=()=>!0;return{query:e,isFencePassed:o}}downloadMatrixFromPackedTexture(t,e,o){return this.downloadMatrixDriver(t,()=>cv(this.gl,e,o))}createProgram(t){this.throwIfDisposed();let e=this.gl;this.vertexShader==null&&(this.vertexShader=XI(e));let o=RI(e);ce(e,()=>e.attachShader(o,this.vertexShader)),ce(e,()=>e.attachShader(o,t)),DI(e,o);let n=Object.assign(o,{vao:this.createVertexArray()});return this.debug&&jl(e,n),n}buildVao(t){this.setProgram(t),this.bindVertexArray(t.vao);let e=this.gl;ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),ov(e,t,this.vertexBuffer)}deleteProgram(t){this.throwIfDisposed(),t===this.program&&(this.program=null),t!=null&&(ce(this.gl,()=>this.gl.deleteProgram(t)),this.deleteVertexArray(t.vao))}setProgram(t){this.throwIfDisposed(),this.program=t,this.program!=null&&this.debug&&jl(this.gl,this.program),ce(this.gl,()=>this.gl.useProgram(t))}getUniformLocation(t,e,o=!0){return this.throwIfDisposed(),o?LI(this.gl,t,e):BI(this.gl,t,e)}getAttributeLocation(t,e){return this.throwIfDisposed(),ce(this.gl,()=>this.gl.getAttribLocation(t,e))}getUniformLocationNoThrow(t,e){return this.throwIfDisposed(),this.gl.getUniformLocation(t,e)}setInputMatrixTexture(t,e,o){this.throwIfDisposed(),this.throwIfNoProgram(),zI(this.gl,t,e,o)}setOutputMatrixTexture(t,e,o){this.setOutputMatrixTextureDriver(t,o,e)}setOutputPackedMatrixTexture(t,e,o){this.throwIfDisposed();let[n,s]=Ma(e,o);this.setOutputMatrixTextureDriver(t,n,s)}setOutputMatrixWriteRegion(t,e,o,n){this.setOutputMatrixWriteRegionDriver(o,t,n,e)}setOutputPackedMatrixWriteRegion(t,e,o,n){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&jl(this.gl,this.program),kc(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let t=this.gl;if(this.debug){let e=this.getVertexArray();console.assert(e===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}ce(t,()=>t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),ce(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=vc(this.gl,A().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(A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.createQuery();return o.beginQuery(n.TIME_ELAPSED_EXT,s),s}let t=this.getQueryTimerExtensionWebGL1(),e=t.createQueryEXT();return t.beginQueryEXT(t.TIME_ELAPSED_EXT,e),e}endQuery(){if(A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let e=this.gl,o=this.getQueryTimerExtensionWebGL2();e.endQuery(o.TIME_ELAPSED_EXT);return}let t=this.getQueryTimerExtensionWebGL1();t.endQueryEXT(t.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(t){return await y.repeatedTry(()=>this.disposed||this.isQueryAvailable(t,A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(t,A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(t,e){if(e===0)return null;if(e===2){let o=this.gl;return o.getQueryParameter(t,o.QUERY_RESULT)/1e6}else{let o=this.getQueryTimerExtensionWebGL1();return o.getQueryObjectEXT(t,o.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(t,e){if(e===0)return!0;if(e===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.getQueryParameter(t,o.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}else{let o=this.getQueryTimerExtensionWebGL1(),n=o.getQueryObjectEXT(t,o.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(o.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(t){return new Promise(e=>{this.addItemToPoll(()=>t.isFencePassed(),()=>e())})}pollItems(){let t=HZ(this.itemsToPoll.map(e=>e.isDoneFn));for(let e=0;e<=t;++e){let{resolveFn:o}=this.itemsToPoll[e];o()}this.itemsToPoll=this.itemsToPoll.slice(t+1)}addItemToPoll(t,e){if(this.itemsToPoll.push({isDoneFn:t,resolveFn:e}),this.itemsToPoll.length>1)return;let o;"setTimeoutCustom"in A().platform&&(o=A().platform.setTimeoutCustom.bind(A().platform)),y.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,o)}bindTextureToFrameBuffer(t){this.throwIfDisposed(),Xl(this.gl,t,this.framebuffer),this.debug&&kc(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(Xl(this.gl,this.outputTexture,this.framebuffer),this.debug&&kc(this.gl)):jf(this.gl,this.framebuffer)}downloadMatrixDriver(t,e){this.bindTextureToFrameBuffer(t);let o=e();return this.unbindTextureToFrameBuffer(),o}setOutputMatrixTextureDriver(t,e,o){this.throwIfDisposed();let n=this.gl;Xl(n,t,this.framebuffer),this.debug&&kc(n),this.outputTexture=t,ce(n,()=>n.viewport(0,0,e,o)),ce(n,()=>n.scissor(0,0,e,o))}setOutputMatrixWriteRegionDriver(t,e,o,n){this.throwIfDisposed(),ce(this.gl,()=>this.gl.scissor(t,e,o,n))}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 HZ(r){let t=0;for(;t`${r}.${e}`)}function Rt(r,t){return t===1?[r]:mv(r,t)}function ID(r,t){if(r===1)return"rc";let e="";for(let o=0;or.bindTexture(i,a)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MIN_FILTER,r.NEAREST)),ce(r,()=>r.texParameteri(i,r.TEXTURE_MAG_FILTER,r.NEAREST)),A().getNumber("WEBGL_VERSION")===1?ce(r,()=>r.texImage2D(i,0,o,e,t,0,n,s,null)):ce(r,()=>r.texStorage2D(i,1,o,e,t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null)),{texture:a,texShape:[t,e]}}function hh(r){return r.internalFormatFloat}function m0(r,e,t,o){let[n,s]=Sp(e,t);return am(r,n,s,hh(o),o.textureFormatFloat,r.FLOAT)}function gh(r){return r.internalFormatHalfFloat}function d0(r,e,t,o){let[n,s]=Sp(e,t);return am(r,n,s,gh(o),o.textureFormatFloat,o.textureTypeHalfFloat)}function xh(r){return r.downloadTextureFormat}function f0(r,e,t,o){let[n,s]=Sp(e,t);return am(r,n,s,xh(o),r.RGBA,r.UNSIGNED_BYTE)}function yh(r){return r.internalFormatPackedFloat}function h0(r,e,t,o){let[n,s]=Ga(e,t);return am(r,n,s,yh(o),r.RGBA,r.FLOAT)}function bh(r){return r.internalFormatPackedHalfFloat}function g0(r,e,t,o){let[n,s]=Ga(e,t);return am(r,n,s,bh(o),r.RGBA,o.textureTypeHalfFloat)}function x0(r,e,t){return ce(r,()=>r.bindBuffer(r.ARRAY_BUFFER,t)),sh(r,e,"clipSpacePos",t,3,20,0)&&sh(r,e,"uv",t,2,20,12)}function y0(r,e,t,o,n,s){ce(r,()=>r.bindTexture(r.TEXTURE_2D,e));let a,i,p;n instanceof Uint8Array?(a=new Uint8Array(t*o*4),i=r.UNSIGNED_BYTE,p=r.RGBA):(a=new Float32Array(t*o*4),i=r.FLOAT,p=s.internalFormatPackedFloat),a.set(n),A().getNumber("WEBGL_VERSION")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,t,o,r.RGBA,i,a)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,p,t,o,0,r.RGBA,i,a)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function b0(r,e,t){ce(r,()=>r.bindTexture(r.TEXTURE_2D,e)),t.data instanceof Uint8Array?A().getNumber("WEBGL_VERSION")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,t.width,t.height,r.RGBA,r.UNSIGNED_BYTE,t.data)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t.width,t.height,0,r.RGBA,r.UNSIGNED_BYTE,t.data)):A().getNumber("WEBGL_VERSION")===2?ce(r,()=>r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,t)):ce(r,()=>r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t)),ce(r,()=>r.bindTexture(r.TEXTURE_2D,null))}function C0(r,e,t,o){let n=r.createBuffer();ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,n));let i=4*4*e*t;return ce(r,()=>r.bufferData(r.PIXEL_PACK_BUFFER,i,r.STREAM_READ)),ce(r,()=>r.readPixels(0,0,t,e,r.RGBA,r.FLOAT,0)),ce(r,()=>r.bindBuffer(r.PIXEL_PACK_BUFFER,null)),n}function w0(r,e,t){let o=r,n=new Float32Array(t);return o.bindBuffer(o.PIXEL_PACK_BUFFER,e),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,n),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),n}function S0(r,e,t,o){let[n,s]=Sp(e,t),a=4,i=new Uint8Array(uD(e*t,a));return ce(r,()=>r.readPixels(0,0,n,s,o.downloadTextureFormat,r.UNSIGNED_BYTE,i)),new Float32Array(i.buffer)}function I0(r,e,t,o,n,s,a,i){let p=r,u=new Float32Array(pD(s,a));return p.bindBuffer(p.PIXEL_PACK_BUFFER,e),p.getBufferSubData(p.PIXEL_PACK_BUFFER,0,u),p.bindBuffer(p.PIXEL_PACK_BUFFER,null),u}function v0(r,e,t){let o=new Float32Array(e*t*4);return ce(r,()=>r.readPixels(0,0,t,e,r.RGBA,r.FLOAT,o)),o}var kp=class{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];let t=A().getNumber("WEBGL_VERSION");if(e!=null?(this.gl=e,BI(t,e)):this.gl=Zr(t),e=this.gl,A().getNumber("WEBGL_VERSION")===2){let s=e;this.createVertexArray=()=>ce(s,()=>s.createVertexArray()),this.bindVertexArray=a=>ce(s,()=>s.bindVertexArray(a)),this.deleteVertexArray=a=>ce(s,()=>s.deleteVertexArray(a)),this.getVertexArray=()=>ce(s,()=>s.getParameter(s.VERTEX_ARRAY_BINDING))}else if(e!=null){let s=e.getExtension("OES_vertex_array_object");if(s==null)throw new Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>ce(e,()=>s.createVertexArrayOES()),this.bindVertexArray=a=>ce(e,()=>s.bindVertexArrayOES(a)),this.deleteVertexArray=a=>ce(e,()=>s.deleteVertexArrayOES(a)),this.getVertexArray=()=>ce(e,()=>e.getParameter(s.VERTEX_ARRAY_BINDING_OES))}let o="WEBGL_color_buffer_float",n="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),A().getNumber("WEBGL_VERSION")===1){let s="OES_texture_float",a="OES_texture_half_float";if(this.textureFloatExtension=Rl(this.gl,s),Jr(this.gl,a))this.textureHalfFloatExtension=Rl(this.gl,a);else if(A().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(o),Jr(this.gl,n))this.colorBufferHalfFloatExtension=Rl(this.gl,n);else if(A().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(o="EXT_color_buffer_float",Jr(this.gl,o))this.colorBufferFloatExtension=this.gl.getExtension(o);else if(Jr(this.gl,n))this.colorBufferHalfFloatExtension=this.gl.getExtension(n);else throw new Error("GL context does not support color renderable floats");this.vertexBuffer=l0(this.gl),this.indexBuffer=c0(this.gl),this.framebuffer=QI(this.gl),this.textureConfig=rm(this.gl,this.textureHalfFloatExtension)}get debug(){return A().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;ce(e,()=>e.finish()),ce(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),ce(e,()=>e.deleteFramebuffer(this.framebuffer)),ce(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),ce(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),ce(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),m0(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),d0(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),f0(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),b0(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,o,n){this.throwIfDisposed(),y0(this.gl,e,t,o,n,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),g0(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),h0(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(ah(this.gl,this.framebuffer),this.outputTexture=null),ce(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,o){return this.downloadMatrixDriver(e,()=>S0(this.gl,t,o,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,o,n,s,a){return I0(this.gl,e,t,o,n,s,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return w0(this.gl,e,t)}createBufferFromTexture(e,t,o){this.bindTextureToFrameBuffer(e);let n=C0(this.gl,t,o,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,o;if(A().getBool("WEBGL_FENCE_API_ENABLED")){let n=e,s=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),o=()=>{let a=n.clientWaitSync(s,0,0);return a===n.ALREADY_SIGNALED||a===n.CONDITION_SATISFIED},t=s}else A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),o=()=>this.isQueryAvailable(t,A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):o=()=>!0;return{query:t,isFencePassed:o}}downloadMatrixFromPackedTexture(e,t,o){return this.downloadMatrixDriver(e,()=>v0(this.gl,t,o))}createProgram(e){this.throwIfDisposed();let t=this.gl;this.vertexShader==null&&(this.vertexShader=p0(t));let o=HI(t);ce(t,()=>t.attachShader(o,this.vertexShader)),ce(t,()=>t.attachShader(o,e)),KI(t,o);let n=Object.assign(o,{vao:this.createVertexArray()});return this.debug&&om(t,n),n}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);let t=this.gl;ce(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),x0(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),e!=null&&(ce(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,this.program!=null&&this.debug&&om(this.gl,this.program),ce(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,o=!0){return this.throwIfDisposed(),o?ZI(this.gl,e,t):JI(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),ce(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,o){this.throwIfDisposed(),this.throwIfNoProgram(),e0(this.gl,e,t,o)}setOutputMatrixTexture(e,t,o){this.setOutputMatrixTextureDriver(e,o,t)}setOutputPackedMatrixTexture(e,t,o){this.throwIfDisposed();let[n,s]=Ga(t,o);this.setOutputMatrixTextureDriver(e,n,s)}setOutputMatrixWriteRegion(e,t,o,n){this.setOutputMatrixWriteRegionDriver(o,e,n,t)}setOutputPackedMatrixWriteRegion(e,t,o,n){throw new Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){this.program!=null&&om(this.gl,this.program),Dl(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;if(this.debug){let t=this.getVertexArray();console.assert(t===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()}ce(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),ce(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return this.disjointQueryTimerExtension==null&&(this.disjointQueryTimerExtension=Rl(this.gl,A().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(A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.createQuery();return o.beginQuery(n.TIME_ELAPSED_EXT,s),s}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")===2){let t=this.gl,o=this.getQueryTimerExtensionWebGL2();t.endQuery(o.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await y.repeatedTry(()=>this.disposed||this.isQueryAvailable(e,A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(t===0)return null;if(t===2){let o=this.gl;return o.getQueryParameter(e,o.QUERY_RESULT)/1e6}else{let o=this.getQueryTimerExtensionWebGL1();return o.getQueryObjectEXT(e,o.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(t===0)return!0;if(t===2){let o=this.gl,n=this.getQueryTimerExtensionWebGL2(),s=o.getQueryParameter(e,o.QUERY_RESULT_AVAILABLE);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(n.GPU_DISJOINT_EXT)),s&&!this.disjoint}else{let o=this.getQueryTimerExtensionWebGL1(),n=o.getQueryObjectEXT(e,o.QUERY_RESULT_AVAILABLE_EXT);return this.disjoint==null&&(this.disjoint=this.gl.getParameter(o.GPU_DISJOINT_EXT)),n&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=yJ(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:o}=this.itemsToPoll[t];o()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){if(this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1)return;let o;"setTimeoutCustom"in A().platform&&(o=A().platform.setTimeoutCustom.bind(A().platform)),y.repeatedTry(()=>(this.pollItems(),this.itemsToPoll.length===0),()=>0,null,o)}bindTextureToFrameBuffer(e){this.throwIfDisposed(),nm(this.gl,e,this.framebuffer),this.debug&&Dl(this.gl)}unbindTextureToFrameBuffer(){this.outputTexture!=null?(nm(this.gl,this.outputTexture,this.framebuffer),this.debug&&Dl(this.gl)):ah(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let o=t();return this.unbindTextureToFrameBuffer(),o}setOutputMatrixTextureDriver(e,t,o){this.throwIfDisposed();let n=this.gl;nm(n,e,this.framebuffer),this.debug&&Dl(n),this.outputTexture=e,ce(n,()=>n.viewport(0,0,t,o)),ce(n,()=>n.scissor(0,0,t,o))}setOutputMatrixWriteRegionDriver(e,t,o,n){this.throwIfDisposed(),ce(this.gl,()=>this.gl.scissor(e,t,o,n))}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 yJ(r){let e=0;for(;e`${r}.${t}`)}function At(r,e){return e===1?[r]:N0(r,e)}function fA(r,e){if(r===1)return"rc";let t="";for(let o=0;o ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let e="";for(let o=this.rank-2;o= ${this.enableShapeUniforms?`outShape[${o}]`:this.outputShape[o]}`,o ${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let o=this.rank-2;o= ${this.enableShapeUniforms?`outShape[${o}]`:this.outputShape[o]}`,o= ${o}; bool rEdge = rp1 >= ${n}; - `}getOutput(t){let e=this.getSourceCoordsArr(t);return this.rank===1?`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${e[0]}), - cEdge ? 0. : getA(${e[1]}), - rEdge ? 0. : getA(${e[2]}), - rEdge || cEdge ? 0. : getA(${e[3]})`}};var Pc=class{constructor(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length);let o="";for(let n=0;n<4;n++){let s="thisRC = rc;";n%2===1&&(s+="thisRC.z += 1;"),n>1&&(s+="thisRC.y += 1;"),o+=` + `}getOutput(e){let t=this.getSourceCoordsArr(e);return this.rank===1?`getA(rc), (rc + 1 >= ${this.enableShapeUniforms?"outShape":this.outputShape[0]} ? 0. : getA(rc + 1)), 0, 0`:`getA(${t[0]}), + cEdge ? 0. : getA(${t[1]}), + rEdge ? 0. : getA(${t[2]}), + rEdge || cEdge ? 0. : getA(${t[3]})`}};var Wl=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length);let o="";for(let n=0;n<4;n++){let s="thisRC = rc;";n%2===1&&(s+="thisRC.z += 1;"),n>1&&(s+="thisRC.y += 1;"),o+=` ${s} ${n>0?"if(thisRC.y < rows && thisRC.z < cols){":""} int flatIndex = getFlatIndex(thisRC); @@ -1146,8 +1146,8 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); ${n>0?"}":""} `}this.userCode=` - ${KZ(e,this.enableShapeUniforms)} - ${this.enableShapeUniforms?$c():_c(t)} + ${bJ(t,this.enableShapeUniforms)} + ${this.enableShapeUniforms?Ol():Pl(e)} void main() { ivec3 rc = getOutputCoords(); @@ -1155,21 +1155,21 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, vec4 result = vec4(0.); ivec3 thisRC; - int rows = ${this.enableShapeUniforms?"outShape[1]":t[1]}; - int cols = ${this.enableShapeUniforms?"outShape[2]":t[2]}; + int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]}; + int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]}; ${o} setOutput(result); } - `}};function KZ(r,t){return` + `}};function bJ(r,e){return` ivec3 inputCoordsFromReshapedOutCoords(int index) { - ${t?IR(["r","c","d"],"inputShape"):Ws(["r","c","d"],r)} + ${e?fD(["r","c","d"],"inputShape"):Qs(["r","c","d"],r)} return ivec3(r, c, d); } - `}var mh=class{constructor(t){this.gpgpu=t,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(t,e,o){let n=kD(e,o),s=ND(t,n,o);s in this.freeTextures||(this.freeTextures[s]=[]),s in this.usedTextures||(this.usedTextures[s]=[]);let a=vD(t,n,this.gpgpu.gl,this.gpgpu.textureConfig,o);if(this.freeTextures[s].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=a,this.log();let p=this.freeTextures[s].pop();return this.usedTextures[s].push(p),p}let i;return n===er.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(t[0],t[1]):n===er.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(t[0],t[1]):n===er.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(t[0],t[1]):n===er.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(t[0],t[1]):n===er.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(t[0],t[1])),this.usedTextures[s].push(i),this.numUsedTextures++,this._numBytesAllocated+=a,this.log(),i}releaseTexture(t,e,o,n){if(this.freeTextures==null)return;let s=kD(o,n),a=ND(e,s,n);a in this.freeTextures||(this.freeTextures[a]=[]);let i=vD(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,n),p=A().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");p!==-1&&this._numBytesAllocated>p?(this.gpgpu.deleteMatrixTexture(t.texture),this._numBytesAllocated-=i):(this.freeTextures[a].push(t),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let u=this.usedTextures[a],c=u&&u.indexOf(t);if(c==null||c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");u[c]=u[u.length-1],u.pop(),this.log()}log(){if(!this.logEnabled)return;let t=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures} / ${this.numUsedTextures}`,`(${t})`);let e=this._numBytesFree/this._numBytesAllocated;console.log(`Bytes allocated: ${this._numBytesAllocated}`),console.log(`Bytes unused: ${this._numBytesFree} (${Math.round(100*e)}%)`)}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 t in this.freeTextures)this.freeTextures[t].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});for(let t in this.usedTextures)this.usedTextures[t].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function qZ(r,t){let e=r;if(t===e.R32F)return 4;if(t===e.R16F)return 2;if(t===e.RGBA32F)return 16;if(t===r.RGBA)return 16;if(t===e.RGBA16F)return 8;if(t===e.RGBA8)return 4;throw new Error(`Unknown internal format ${t}`)}function vD(r,t,e,o,n){let s=jZ(t,o),a;if(n){let[p,u]=Ma(r[0],r[1]);a=p*u}else{let[p,u]=fp(r[0],r[1]);a=p*u}let i=qZ(e,s);return a*i}function jZ(r,t){switch(r){case er.PACKED_2X2_FLOAT32:return ah(t);case er.PACKED_2X2_FLOAT16:return ih(t);case er.UNPACKED_FLOAT32:return oh(t);case er.UNPACKED_FLOAT16:return nh(t);case er.PACKED_4X1_UNSIGNED_BYTE:return sh(t);default:throw new Error(`Unknown physical texture type ${r}`)}}function XZ(r){return A().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?r?er.PACKED_2X2_FLOAT32:er.UNPACKED_FLOAT32:r?er.PACKED_2X2_FLOAT16:er.UNPACKED_FLOAT16}function kD(r,t){if(r===mr.UPLOAD)return er.PACKED_2X2_FLOAT32;if(r===mr.RENDER||r==null)return XZ(t);if(r===mr.DOWNLOAD||r===mr.PIXELS)return er.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${r}`)}function ND(r,t,e){return`${r[0]}_${r[1]}_${t}_${e}`}var tr=class{constructor(t,e){this.variableNames=["A"],this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=` + `}var vh=class{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.usedTextures={},this.logEnabled=!1}acquireTexture(e,t,o){let n=gA(t,o),s=xA(e,n,o);s in this.freeTextures||(this.freeTextures[s]=[]),s in this.usedTextures||(this.usedTextures[s]=[]);let a=hA(e,n,this.gpgpu.gl,this.gpgpu.textureConfig,o);if(this.freeTextures[s].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=a,this.log();let p=this.freeTextures[s].pop();return this.usedTextures[s].push(p),p}let i;return n===or.PACKED_2X2_FLOAT32?i=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):n===or.PACKED_2X2_FLOAT16?i=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):n===or.UNPACKED_FLOAT32?i=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):n===or.UNPACKED_FLOAT16?i=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):n===or.PACKED_4X1_UNSIGNED_BYTE&&(i=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[s].push(i),this.numUsedTextures++,this._numBytesAllocated+=a,this.log(),i}releaseTexture(e,t,o,n){if(this.freeTextures==null)return;let s=gA(o,n),a=xA(t,s,n);a in this.freeTextures||(this.freeTextures[a]=[]);let i=hA(t,s,this.gpgpu.gl,this.gpgpu.textureConfig,n),p=A().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");p!==-1&&this._numBytesAllocated>p?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=i):(this.freeTextures[a].push(e),this.numFreeTextures++,this._numBytesFree+=i),this.numUsedTextures--;let u=this.usedTextures[a],l=u&&u.indexOf(e);if(l==null||l<0)throw new Error("Cannot release a texture that was never provided by this texture manager");u[l]=u[u.length-1],u.pop(),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.texture)});for(let e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t.texture)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}};function CJ(r,e){let t=r;if(e===t.R32F)return 4;if(e===t.R16F)return 2;if(e===t.RGBA32F)return 16;if(e===r.RGBA)return 16;if(e===t.RGBA16F)return 8;if(e===t.RGBA8)return 4;throw new Error(`Unknown internal format ${e}`)}function hA(r,e,t,o,n){let s=wJ(e,o),a;if(n){let[p,u]=Ga(r[0],r[1]);a=p*u}else{let[p,u]=Sp(r[0],r[1]);a=p*u}let i=CJ(t,s);return a*i}function wJ(r,e){switch(r){case or.PACKED_2X2_FLOAT32:return yh(e);case or.PACKED_2X2_FLOAT16:return bh(e);case or.UNPACKED_FLOAT32:return hh(e);case or.UNPACKED_FLOAT16:return gh(e);case or.PACKED_4X1_UNSIGNED_BYTE:return xh(e);default:throw new Error(`Unknown physical texture type ${r}`)}}function SJ(r){return A().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?r?or.PACKED_2X2_FLOAT32:or.UNPACKED_FLOAT32:r?or.PACKED_2X2_FLOAT16:or.UNPACKED_FLOAT16}function gA(r,e){if(r===hr.UPLOAD)return or.PACKED_2X2_FLOAT32;if(r===hr.RENDER||r==null)return SJ(e);if(r===hr.DOWNLOAD||r===hr.PIXELS)return or.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknown logical texture type ${r}`)}function xA(r,e,t){return`${r[0]}_${r[1]}_${e}_${t}`}var nr=class{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=` float unaryOperation(float x) { - ${e} + ${t} } void main() { @@ -1178,11 +1178,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}},Wt="if (isnan(x)) return x;",TD="return x;",dv="return abs(x);";var _D="return (x >= 0.0) ? x : (exp(x) - 1.0);",$D=Wt+` + `}},Gt="if (isnan(x)) return x;",yA="return x;",T0="return abs(x);";var bA="return (x >= 0.0) ? x : (exp(x) - 1.0);",CA=Gt+` return (x < 0.0) ? 0.0 : x; -`,ED=Wt+` +`,wA=Gt+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,La="return x;",RD="return 1.0 / (1.0 + exp(-1.0 * x));";var AD="return x;",FD=` +`,Ha="return x;",SA="return 1.0 / (1.0 + exp(-1.0 * x));";var vA="return x;",kA=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -1191,7 +1191,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,PD=` +`,NA=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -1201,7 +1201,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,OD=` +`,TA=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -1211,9 +1211,9 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.a = isNaN.a ? x.a : result.a; return result; -`,MD="return 1.0 / (1.0 + exp(-1.0 * x));",Ar=class{constructor(t,e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=` +`,_A="return 1.0 / (1.0 + exp(-1.0 * x));",Lr=class{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=` vec4 unaryOperation(vec4 x) { - ${e} + ${t} } void main() { @@ -1222,19 +1222,19 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(y); } - `}};var dh=class{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=t,this.enableShapeUniforms=ut(this.outputShape.length);let e=t.length,o=Rt("rc",e),n=Re(e),s=ID(e,o),a=o.slice(-2),i=e<=1?"rc":`vec2(${a.join(",")})`;this.userCode=` + `}};var kh=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=lt(this.outputShape.length);let t=e.length,o=At("rc",t),n=Re(t),s=fA(t,o),a=o.slice(-2),i=t<=1?"rc":`vec2(${a.join(",")})`;this.userCode=` void main() { ${n} rc = getOutputCoords(); vec4 packedInput = getA(${s}); setOutput(getChannel(packedInput, ${i})); } - `}};var QZ=Vt.whereImpl,ZZ=1e-7,JZ=1e-4,fh={};function e9(r){return r in fh||(fh[r]={}),fh[r]}var t9=A().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),r9=600;function o9(){return A().global.screen==null?1024:A().global.screen.height*A().global.screen.width*window.devicePixelRatio*r9/1024/1024}var Oc=class r extends so{nextDataId(){return r.nextDataId++}constructor(t){if(super(),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,!A().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let e;if(t!=null){if(t instanceof xp)e=t;else{let o=Hr(A().getNumber("WEBGL_VERSION"),t);e=new xp(o)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{let o=Hr(A().getNumber("WEBGL_VERSION"));e=new xp(o),this.binaryCache=e9(A().getNumber("WEBGL_VERSION")),this.gpgpuCreatedLocally=!0}this.gpgpu=e,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new mh(this.gpgpu),this.numMBBeforeWarning=o9(),this.texData=new Bo(this,ur())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(t,e,o,n,s,a){let i=this.makeTensorInfo(e,o),p=this.texData.get(i.dataId);p.isPacked=!1,p.texture={texture:t,texShape:[n,s]},p.texShape=[n,s];let u=Nc(e),c=new Yl(u,!1,a),l=this.runWebGLProgram(c,[i],o,[[n,s]]);return l.shape=e,p.texture=null,this.disposeIntermediateTensorInfo(i),l.dataId}write(t,e,o){if((A().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||A().getBool("DEBUG"))&&this.checkNumericalProblems(t),o==="complex64"&&t!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let n={id:this.nextDataId()};return this.texData.set(n,{shape:e,dtype:o,values:t,usage:mr.UPLOAD,refCount:1}),n}refCount(t){return this.texData.has(t)?this.texData.get(t).refCount:0}incRef(t){let e=this.texData.get(t);e.refCount++}decRef(t){if(this.texData.has(t)){let e=this.texData.get(t);e.refCount--}}move(t,e,o,n,s){if(A().getBool("DEBUG")&&this.checkNumericalProblems(e),n==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(t,{shape:o,dtype:n,values:e,usage:mr.UPLOAD,refCount:s})}disposeIntermediateTensorInfo(t){this.disposeData(t.dataId)}readSync(t){let e=this.texData.get(t),{values:o,dtype:n,complexTensorInfos:s,slice:a,shape:i,isPacked:p}=e;if(a!=null){let m;p?m=new Ar(i,La):m=new tr(i,La);let d=this.runWebGLProgram(m,[{dataId:t,shape:i,dtype:n}],n),f=this.readSync(d.dataId);return this.disposeIntermediateTensorInfo(d),f}if(o!=null)return this.convertAndCacheOnCPU(t);if(n==="string")return o;let u=this.activeTimers!=null,c;u&&(c=y.now());let l;if(n==="complex64"){let m=this.readSync(s.real.dataId),d=this.readSync(s.imag.dataId);l=w.mergeRealAndImagArrays(m,d)}else l=this.getValuesFromTexture(t);return u&&(this.downloadWaitMs+=y.now()-c),this.convertAndCacheOnCPU(t,l)}async read(t){if(this.pendingRead.has(t)){let f=this.pendingRead.get(t);return new Promise(h=>f.push(h))}let e=this.texData.get(t),{values:o,shape:n,slice:s,dtype:a,complexTensorInfos:i,isPacked:p}=e;if(s!=null){let f;p?f=new Ar(n,La):f=new tr(n,La);let h=this.runWebGLProgram(f,[{dataId:t,shape:n,dtype:a}],a),g=this.read(h.dataId);return this.disposeIntermediateTensorInfo(h),g}if(o!=null)return this.convertAndCacheOnCPU(t);if(A().getBool("DEBUG")&&!A().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&A().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let u=null,c;if(a!=="complex64"&&A().get("WEBGL_BUFFER_SUPPORTED")){c=this.decode(t);let f=this.texData.get(c.dataId);u=this.gpgpu.createBufferFromTexture(f.texture.texture,...Kl(n))}this.pendingRead.set(t,[]),a!=="complex64"&&await this.gpgpu.createAndWaitForFence();let l;if(a==="complex64"){let f=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),h=f[0],g=f[1];l=w.mergeRealAndImagArrays(h,g)}else if(u==null)l=this.getValuesFromTexture(t);else{let f=y.sizeFromShape(n);l=this.gpgpu.downloadFloat32MatrixFromBuffer(u,f)}if(c!=null&&this.disposeIntermediateTensorInfo(c),u!=null){let f=this.gpgpu.gl;ce(f,()=>f.deleteBuffer(u))}let m=this.convertAndCacheOnCPU(t,l),d=this.pendingRead.get(t);return this.pendingRead.delete(t),d.forEach(f=>f(m)),this.pendingDisposal.has(t)&&(this.pendingDisposal.delete(t),this.disposeData(t)&&ur().removeDataId(t,this),this.pendingDeletes--),m}readToGPU(t,e={}){let o=this.texData.get(t),{values:n,shape:s,slice:a,dtype:i,isPacked:p,texture:u}=o;if(i==="complex64")throw new Error("Does not support reading texture for complex64 dtype.");if(a!=null){let d;p?d=new Ar(s,La):d=new tr(s,La);let f=this.runWebGLProgram(d,[{dataId:t,shape:s,dtype:i}],i),h=this.readToGPU(f,e);return this.disposeIntermediateTensorInfo(f),h}if(u==null)throw n!=null?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");let c=this.decode(t,e.customTexShape),l=ur().makeTensorFromTensorInfo(c),m=this.texData.get(c.dataId);return Object.assign({tensorRef:l},m.texture)}bufferSync(t){let e=this.readSync(t.dataId);if(t.dtype==="string")try{let o=e.map(n=>y.decodeString(n));return me(t.shape,t.dtype,o)}catch(o){throw new Error("Failed to decode encoded string bytes into utf-8")}return me(t.shape,t.dtype,e)}checkNumericalProblems(t){if(t!=null)for(let e=0;e0}time(t){let e=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,t();let s=y.flatten(this.activeTimers.map(p=>p.query)).filter(p=>p!=null),a=y.flatten(this.activeTimers.map(p=>p.name)).filter(p=>p!=null);this.activeTimers=e,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let p=await Promise.all(s);i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,c)=>({name:a[c],ms:u})).map(u=>`${u.name}: ${u.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 A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:y.now(),endMs:null}}endTimer(t){return A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),t):(t.endMs=y.now(),t)}async getQueryTime(t){if(A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0)return this.gpgpu.waitForQueryAndGetTime(t);let e=t;return e.endMs-e.startMs}disposeData(t,e=!1){if(this.pendingDisposal.has(t))return!1;if(!this.texData.has(t))return!0;if(e?this.texData.get(t).refCount=0:this.texData.get(t).refCount--,!e&&this.texData.get(t).refCount>0)return!1;if(this.pendingRead.has(t))return this.pendingDisposal.add(t),this.pendingDeletes++,!1;this.releaseGPUData(t);let{complexTensorInfos:o}=this.texData.get(t);return o!=null&&(this.disposeData(o.real.dataId,e),this.disposeData(o.imag.dataId,e)),this.texData.delete(t),!0}releaseGPUData(t){let{texture:e,dtype:o,texShape:n,usage:s,isPacked:a,slice:i}=this.texData.get(t),p=i&&i.origDataId||t,u=this.dataRefCount.get(p);u>1?this.dataRefCount.set(p,u-1):(this.dataRefCount.delete(p),e!=null&&(this.numBytesInGPU-=this.computeBytes(n,o),this.textureManager.releaseTexture(e,n,s,a)));let c=this.texData.get(t);c.texture=null,c.texShape=null,c.isPacked=!1,c.slice=null}getTexture(t){return this.uploadToGPU(t),this.texData.get(t).texture.texture}getDataInfo(t){return this.texData.get(t)}shouldExecuteOnCPU(t,e=t9){return A().getBool("WEBGL_CPU_FORWARD")&&t.every(o=>this.texData.get(o.dataId).texture==null&&y.sizeFromShape(o.shape)0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,t,e)}else n=this.write(o,t,e);return this.texData.get(n).usage=null,{dataId:n,shape:t,dtype:e}}makeOutput(t,e,o){return ur().makeTensorFromTensorInfo(this.makeTensorInfo(t,e,o),this)}unpackTensor(t){let e=new dh(t.shape);return this.runWebGLProgram(e,[t],t.dtype)}packTensor(t){let e=new lh(t.shape),o=!0;return this.runWebGLProgram(e,[t],t.dtype,null,o)}packedReshape(t,e){let o=[hi(t.shape),...gi(t.shape)],n={dtype:t.dtype,shape:o,dataId:t.dataId},s=[hi(e),...gi(e)],a=new Pc(s,o),i=!0,p=[o],u=this.runWebGLProgram(a,[n],t.dtype,p,i);return{dataId:u.dataId,shape:e,dtype:u.dtype}}decode(t,e){let o=this.texData.get(t),{isPacked:n,shape:s,dtype:a}=o;if(e!=null){let m=y.sizeFromShape(s),d=e[0]*e[1]*4;y.assert(m<=d,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}let i=Nc(s),p;n?p=new Jf(i):p=new Zf(i);let u=!0,c=[e!=null?e:Kl(i)],l=this.runWebGLProgram(p,[{shape:i,dtype:a,dataId:t}],a,c,u,e);return{dtype:a,shape:s,dataId:l.dataId}}runWebGLProgram(t,e,o,n,s=!1,a){let i=this.makeTensorInfo(t.outputShape,o),p=this.texData.get(i.dataId);if(t.packedOutput&&(p.isPacked=!0),t.outPackingScheme===fu.DENSE){let x=a!=null?a:Kl(t.outputShape);p.texShape=x.map(b=>b*2)}if(t.outTexUsage!=null&&(p.usage=t.outTexUsage),y.sizeFromShape(i.shape)===0)return p.values=y.getTypedArrayFromDType(i.dtype,0),i;let u=[],c=e.map(x=>{if(x.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let b=this.texData.get(x.dataId);if(b.texture==null){if(!t.packedInputs&&y.sizeFromShape(x.shape)<=A().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:x.shape,texData:null,isUniform:!0,uniformValues:b.values};t.packedInputs&&(b.isPacked=!0,b.shape=x.shape)}if(this.uploadToGPU(x.dataId),!!b.isPacked!=!!t.packedInputs)x=b.isPacked?this.unpackTensor(x):this.packTensor(x),u.push(x),b=this.texData.get(x.dataId);else if(b.isPacked&&!hu(b.shape,x.shape)){let C=x,S=x.shape;x.shape=b.shape,x=this.packedReshape(x,S),u.push(x),b=this.texData.get(x.dataId),C.shape=S}return{shape:x.shape,texData:b,isUniform:!1}});this.uploadToGPU(i.dataId);let l={shape:i.shape,texData:p,isUniform:!1},m=RR(t,c,l),d=this.getAndSaveBinary(m,()=>$R(this.gpgpu,t,c,l)),f=this.activeTimers!=null,h;f&&(h=this.startTimer()),A().get("ENGINE_COMPILE_ONLY")||ER(this.gpgpu,d,c,l,n),u.forEach(x=>this.disposeIntermediateTensorInfo(x)),f&&(h=this.endTimer(h),this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime(h)}));let g=A().getNumber("WEBGL_FLUSH_THRESHOLD");if(g>0){let x=y.now();x-this.lastGlFlushTime>g&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=x)}if(!A().getBool("WEBGL_LAZILY_UNPACK")&&p.isPacked&&s===!1){let x=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),x}return i}compileAndRun(t,e,o,n,s=!1){return o=o||e[0].dtype,this.runWebGLProgram(t,e,o,n,s)}getAndSaveBinary(t,e){return t in this.binaryCache||(this.binaryCache[t]=e()),this.binaryCache[t]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(A().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=De(()=>{if(!A().get("WEBGL_RENDER_FLOAT32_ENABLED")){let t=A().getBool("DEBUG");A().set("DEBUG",!1);let e=this.abs(ke(1e-8)).dataSync()[0];if(A().set("DEBUG",t),e>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?ZZ:JZ}uploadToGPU(t){let e=this.texData.get(t),{shape:o,dtype:n,values:s,texture:a,usage:i,isPacked:p}=e;if(a!=null)return;let u=this.activeTimers!=null,c;u&&(c=y.now());let l=e.texShape;if(l==null&&(l=VI(o,p),e.texShape=l),s!=null){let m=Nc(o),d,f=l[1],h=l[0],g=s instanceof Uint8Array||s instanceof Uint8ClampedArray;(p||!g)&&([f,h]=Ma(l[0],l[1])),p?d=new rh(m,g):d=new Yl(m,g);let x=g?[h,f]:l,b=this.makeTensorInfo(x,n),C=this.texData.get(b.dataId);g?C.usage=mr.PIXELS:C.usage=mr.UPLOAD,C.texShape=x,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(b.dataId),f,h,s);let S=[[h,f]],k=!0,_=this.runWebGLProgram(d,[b],n,S,k),E=this.texData.get(_.dataId);e.texShape=E.texShape,e.isPacked=E.isPacked,e.usage=E.usage,A().get("ENGINE_COMPILE_ONLY")?this.disposeData(_.dataId):(e.texture=E.texture,e.values=null,this.texData.delete(_.dataId)),this.disposeIntermediateTensorInfo(b),u&&(this.uploadWaitMs+=y.now()-c)}else{let m=this.acquireTexture(l,i,n,p);e.texture=m}}convertAndCacheOnCPU(t,e){let o=this.texData.get(t),{dtype:n}=o;return e!=null&&(o.values=n9(e,n)),o.values}acquireTexture(t,e,o,n){if(this.numBytesInGPU+=this.computeBytes(t,o),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(t,e,n)}computeBytes(t,e){return t[0]*t[1]*y.bytesPerElement(e)}checkCompileCompletion(){for(let[,t]of Object.entries(this.binaryCache))this.checkCompletion_(t)}async checkCompileCompletionAsync(){let t=[];if(this.gpgpu.parallelCompilationExtension){for(let[,e]of Object.entries(this.binaryCache))t.push(this.checkCompletionAsync_(e));return Promise.all(t)}else{for(let[,e]of Object.entries(this.binaryCache)){let o=new Promise(n=>{try{this.checkCompletion_(e),n(!0)}catch(s){throw s}});t.push(o)}return Promise.all(t)}}async checkCompletionAsync_(t){return this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(t):(await pS(),this.checkCompletionAsync_(t))}checkCompletion_(t){if(this.gpgpu.gl.getProgramParameter(t.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(t.webGLProgram)),this.gpgpu.gl.getShaderParameter(t.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(Kf(t.source,this.gpgpu.gl.getShaderInfoLog(t.fragmentShader)),new Error("Failed to compile fragment shader.")):new Error("Failed to link vertex and fragment shaders.");return!0}getUniformLocations(){for(let t of Object.values(this.binaryCache)){this.gpgpu.buildVao(t.webGLProgram);let{variablesLocations:e,customUniformLocations:o,infLoc:n,nanLoc:s,outShapeLocation:a,outShapeStridesLocation:i,outTexShapeLocation:p}=jI(this.gpgpu,t.program,t.webGLProgram);t.variablesLocations=e,t.customUniformLocations=o,t.infLoc=n,t.nanLoc=s,t.outShapeLocation=a,t.outShapeStridesLocation=i,t.outTexShapeLocation=p}}createTensorFromGPUData(t,e,o){t.channels=t.channels||"RGBA";let{texture:n,height:s,width:a,channels:i}=t,p=ur().backend;if(!p.gpgpu.gl.isTexture(n))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");let u=p.writeTexture(n,e,o,s,a,i);return ur().makeTensorFromDataId(u,e,o,p)}};Oc.nextDataId=0;function n9(r,t){if(t==="float32"||t==="complex64")return r;if(t==="int32"||t==="bool"){let e=t==="int32"?new Int32Array(r.length):new Uint8Array(r.length);for(let o=0;onew Oc,2);var Cat={forceHalfFloat:LD};var Mc=` + `}};var vJ=Ut.whereImpl,kJ=1e-7,NJ=1e-4,Nh={};function TJ(r){return r in Nh||(Nh[r]={}),Nh[r]}var _J=A().getNumber("CPU_HANDOFF_SIZE_THRESHOLD"),EJ=600;function $J(){return A().global.screen==null?1024:A().global.screen.height*A().global.screen.width*window.devicePixelRatio*EJ/1024/1024}var Ul=class r extends mo{nextDataId(){return r.nextDataId++}constructor(e){if(super(),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,!A().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");let t;if(e!=null){if(e instanceof kp)t=e;else{let o=Zr(A().getNumber("WEBGL_VERSION"),e);t=new kp(o)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{let o=Zr(A().getNumber("WEBGL_VERSION"));t=new kp(o),this.binaryCache=TJ(A().getNumber("WEBGL_VERSION")),this.gpgpuCreatedLocally=!0}this.gpgpu=t,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new vh(this.gpgpu),this.numMBBeforeWarning=$J(),this.texData=new mn(this,cr())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(e,t,o,n,s,a){let i=this.makeTensorInfo(t,o),p=this.texData.get(i.dataId);p.isPacked=!1,p.texture={texture:e,texShape:[n,s]},p.texShape=[n,s];let u=Al(t),l=new sm(u,!1,a),c=this.runWebGLProgram(l,[i],o,[[n,s]]);return c.shape=t,p.texture=null,this.disposeIntermediateTensorInfo(i),c.dataId}write(e,t,o){if((A().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||A().getBool("DEBUG"))&&this.checkNumericalProblems(e),o==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let n={id:this.nextDataId()};return this.texData.set(n,{shape:t,dtype:o,values:e,usage:hr.UPLOAD,refCount:1}),n}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,o,n,s){if(A().getBool("DEBUG")&&this.checkNumericalProblems(t),n==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:o,dtype:n,values:t,usage:hr.UPLOAD,refCount:s})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t=this.texData.get(e),{values:o,dtype:n,complexTensorInfos:s,slice:a,shape:i,isPacked:p}=t;if(a!=null){let m;p?m=new Lr(i,Ha):m=new nr(i,Ha);let d=this.runWebGLProgram(m,[{dataId:e,shape:i,dtype:n}],n),f=this.readSync(d.dataId);return this.disposeIntermediateTensorInfo(d),f}if(o!=null)return this.convertAndCacheOnCPU(e);if(n==="string")return o;let u=this.activeTimers!=null,l;u&&(l=y.now());let c;if(n==="complex64"){let m=this.readSync(s.real.dataId),d=this.readSync(s.imag.dataId);c=C.mergeRealAndImagArrays(m,d)}else c=this.getValuesFromTexture(e);return u&&(this.downloadWaitMs+=y.now()-l),this.convertAndCacheOnCPU(e,c)}async read(e){if(this.pendingRead.has(e)){let f=this.pendingRead.get(e);return new Promise(h=>f.push(h))}let t=this.texData.get(e),{values:o,shape:n,slice:s,dtype:a,complexTensorInfos:i,isPacked:p}=t;if(s!=null){let f;p?f=new Lr(n,Ha):f=new nr(n,Ha);let h=this.runWebGLProgram(f,[{dataId:e,shape:n,dtype:a}],a),g=this.read(h.dataId);return this.disposeIntermediateTensorInfo(h),g}if(o!=null)return this.convertAndCacheOnCPU(e);if(A().getBool("DEBUG")&&!A().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&A().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let u=null,l;if(a!=="complex64"&&A().get("WEBGL_BUFFER_SUPPORTED")){l=this.decode(e);let f=this.texData.get(l.dataId);u=this.gpgpu.createBufferFromTexture(f.texture.texture,...tm(n))}this.pendingRead.set(e,[]),a!=="complex64"&&await this.gpgpu.createAndWaitForFence();let c;if(a==="complex64"){let f=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),h=f[0],g=f[1];c=C.mergeRealAndImagArrays(h,g)}else if(u==null)c=this.getValuesFromTexture(e);else{let f=y.sizeFromShape(n);c=this.gpgpu.downloadFloat32MatrixFromBuffer(u,f)}if(l!=null&&this.disposeIntermediateTensorInfo(l),u!=null){let f=this.gpgpu.gl;ce(f,()=>f.deleteBuffer(u))}let m=this.convertAndCacheOnCPU(e,c),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach(f=>f(m)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&cr().removeDataId(e,this),this.pendingDeletes--),m}readToGPU(e,t={}){let o=this.texData.get(e),{values:n,shape:s,slice:a,dtype:i,isPacked:p,texture:u}=o;if(i==="complex64")throw new Error("Does not support reading texture for complex64 dtype.");if(a!=null){let d;p?d=new Lr(s,Ha):d=new nr(s,Ha);let f=this.runWebGLProgram(d,[{dataId:e,shape:s,dtype:i}],i),h=this.readToGPU(f,t);return this.disposeIntermediateTensorInfo(f),h}if(u==null)throw n!=null?new Error("Data is not on GPU but on CPU."):new Error("There is no data on GPU or CPU.");let l=this.decode(e,t.customTexShape),c=cr().makeTensorFromTensorInfo(l),m=this.texData.get(l.dataId);return Object.assign({tensorRef:c},m.texture)}bufferSync(e){let t=this.readSync(e.dataId);if(e.dtype==="string")try{let o=t.map(n=>y.decodeString(n));return ie(e.shape,e.dtype,o)}catch(o){throw new Error("Failed to decode encoded string bytes into utf-8")}return ie(e.shape,e.dtype,t)}checkNumericalProblems(e){if(e!=null)for(let t=0;t0}time(e){let t=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,e();let s=y.flatten(this.activeTimers.map(p=>p.query)).filter(p=>p!=null),a=y.flatten(this.activeTimers.map(p=>p.name)).filter(p=>p!=null);this.activeTimers=t,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if(A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let p=await Promise.all(s);i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,l)=>({name:a[l],ms:u})).map(u=>`${u.name}: ${u.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 A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:y.now(),endMs:null}}endTimer(e){return A().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?(this.gpgpu.endQuery(),e):(e.endMs=y.now(),e)}async getQueryTime(e){if(A().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:o}=this.texData.get(e);return o!=null&&(this.disposeData(o.real.dataId,t),this.disposeData(o.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:o,texShape:n,usage:s,isPacked:a,slice:i}=this.texData.get(e),p=i&&i.origDataId||e,u=this.dataRefCount.get(p);u>1?this.dataRefCount.set(p,u-1):(this.dataRefCount.delete(p),t!=null&&(this.numBytesInGPU-=this.computeBytes(n,o),this.textureManager.releaseTexture(t,n,s,a)));let l=this.texData.get(e);l.texture=null,l.texShape=null,l.isPacked=!1,l.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=_J){return A().getBool("WEBGL_CPU_FORWARD")&&e.every(o=>this.texData.get(o.dataId).texture==null&&y.sizeFromShape(o.shape)0&&y.isString(o[0])){let s=o.map(a=>y.encodeString(a));n=this.write(s,e,t)}else n=this.write(o,e,t);return this.texData.get(n).usage=null,{dataId:n,shape:e,dtype:t}}makeOutput(e,t,o){return cr().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,o),this)}unpackTensor(e){let t=new kh(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new Ih(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){let o=[ki(e.shape),...Ni(e.shape)],n={dtype:e.dtype,shape:o,dataId:e.dataId},s=[ki(t),...Ni(t)],a=new Wl(s,o),i=!0,p=[o],u=this.runWebGLProgram(a,[n],e.dtype,p,i);return{dataId:u.dataId,shape:t,dtype:u.dtype}}decode(e,t){let o=this.texData.get(e),{isPacked:n,shape:s,dtype:a}=o;if(t!=null){let m=y.sizeFromShape(s),d=t[0]*t[1]*4;y.assert(m<=d,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}let i=Al(s),p;n?p=new ch(i):p=new lh(i);let u=!0,l=[t!=null?t:tm(i)],c=this.runWebGLProgram(p,[{shape:i,dtype:a,dataId:e}],a,l,u,t);return{dtype:a,shape:s,dataId:c.dataId}}runWebGLProgram(e,t,o,n,s=!1,a){let i=this.makeTensorInfo(e.outputShape,o),p=this.texData.get(i.dataId);if(e.packedOutput&&(p.isPacked=!0),e.outPackingScheme===Iu.DENSE){let x=a!=null?a:tm(e.outputShape);p.texShape=x.map(b=>b*2)}if(e.outTexUsage!=null&&(p.usage=e.outTexUsage),y.sizeFromShape(i.shape)===0)return p.values=y.getTypedArrayFromDType(i.dtype,0),i;let u=[],l=t.map(x=>{if(x.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let b=this.texData.get(x.dataId);if(b.texture==null){if(!e.packedInputs&&y.sizeFromShape(x.shape)<=A().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:x.shape,texData:null,isUniform:!0,uniformValues:b.values};e.packedInputs&&(b.isPacked=!0,b.shape=x.shape)}if(this.uploadToGPU(x.dataId),!!b.isPacked!=!!e.packedInputs)x=b.isPacked?this.unpackTensor(x):this.packTensor(x),u.push(x),b=this.texData.get(x.dataId);else if(b.isPacked&&!vu(b.shape,x.shape)){let w=x,S=x.shape;x.shape=b.shape,x=this.packedReshape(x,S),u.push(x),b=this.texData.get(x.dataId),w.shape=S}return{shape:x.shape,texData:b,isUniform:!1}});this.uploadToGPU(i.dataId);let c={shape:i.shape,texData:p,isUniform:!1},m=SD(e,l,c),d=this.getAndSaveBinary(m,()=>CD(this.gpgpu,e,l,c)),f=this.activeTimers!=null,h;f&&(h=this.startTimer()),A().get("ENGINE_COMPILE_ONLY")||wD(this.gpgpu,d,l,c,n),u.forEach(x=>this.disposeIntermediateTensorInfo(x)),f&&(h=this.endTimer(h),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(h)}));let g=A().getNumber("WEBGL_FLUSH_THRESHOLD");if(g>0){let x=y.now();x-this.lastGlFlushTime>g&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=x)}if(!A().getBool("WEBGL_LAZILY_UNPACK")&&p.isPacked&&s===!1){let x=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),x}return i}compileAndRun(e,t,o,n,s=!1){return o=o||t[0].dtype,this.runWebGLProgram(e,t,o,n,s)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||(A().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(t=>{this.gpgpu.deleteProgram(this.binaryCache[t].webGLProgram),delete this.binaryCache[t]}),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=De(()=>{if(!A().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=A().getBool("DEBUG");A().set("DEBUG",!1);let t=this.abs(ke(1e-8)).dataSync()[0];if(A().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return this.floatPrecision()===32?kJ:NJ}uploadToGPU(e){let t=this.texData.get(e),{shape:o,dtype:n,values:s,texture:a,usage:i,isPacked:p}=t;if(a!=null)return;let u=this.activeTimers!=null,l;u&&(l=y.now());let c=t.texShape;if(c==null&&(c=t0(o,p),t.texShape=c),s!=null){let m=Al(o),d,f=c[1],h=c[0],g=s instanceof Uint8Array||s instanceof Uint8ClampedArray;(p||!g)&&([f,h]=Ga(c[0],c[1])),p?d=new fh(m,g):d=new sm(m,g);let x=g?[h,f]:c,b=this.makeTensorInfo(x,n),w=this.texData.get(b.dataId);g?w.usage=hr.PIXELS:w.usage=hr.UPLOAD,w.texShape=x,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(b.dataId),f,h,s);let S=[[h,f]],T=this.runWebGLProgram(d,[b],n,S,!0),E=this.texData.get(T.dataId);t.texShape=E.texShape,t.isPacked=E.isPacked,t.usage=E.usage,A().get("ENGINE_COMPILE_ONLY")?this.disposeData(T.dataId):(t.texture=E.texture,t.values=null,this.texData.delete(T.dataId)),this.disposeIntermediateTensorInfo(b),u&&(this.uploadWaitMs+=y.now()-l)}else{let m=this.acquireTexture(c,i,n,p);t.texture=m}}convertAndCacheOnCPU(e,t){let o=this.texData.get(e),{dtype:n}=o;return t!=null&&(o.values=RJ(t,n)),o.values}acquireTexture(e,t,o,n){if(this.numBytesInGPU+=this.computeBytes(e,o),!this.warnedAboutMemory&&this.numBytesInGPU>this.numMBBeforeWarning*1024*1024){let s=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${s} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,n)}computeBytes(e,t){return e[0]*e[1]*y.bytesPerElement(t)}checkCompileCompletion(){for(let[,e]of Object.entries(this.binaryCache))this.checkCompletion_(e)}async checkCompileCompletionAsync(){let e=[];if(this.gpgpu.parallelCompilationExtension){for(let[,t]of Object.entries(this.binaryCache))e.push(this.checkCompletionAsync_(t));return Promise.all(e)}else{for(let[,t]of Object.entries(this.binaryCache)){let o=new Promise(n=>{try{this.checkCompletion_(t),n(!0)}catch(s){throw s}});e.push(o)}return Promise.all(e)}}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await IS(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)===!1)throw console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS)===!1?(nh(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),new Error("Failed to compile fragment shader.")):new Error("Failed to link vertex and fragment shaders.");return!0}getUniformLocations(){for(let e of Object.values(this.binaryCache)){this.gpgpu.buildVao(e.webGLProgram);let{variablesLocations:t,customUniformLocations:o,infLoc:n,nanLoc:s,outShapeLocation:a,outShapeStridesLocation:i,outTexShapeLocation:p}=u0(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=o,e.infLoc=n,e.nanLoc=s,e.outShapeLocation=a,e.outShapeStridesLocation=i,e.outTexShapeLocation=p}}createTensorFromGPUData(e,t,o){e.channels=e.channels||"RGBA";let{texture:n,height:s,width:a,channels:i}=e,p=cr().backend;if(!p.gpgpu.gl.isTexture(n))throw new Error("The texture is invalid. Also, please make sure the texture and the TFJS WebGL backend are using the same canvas. If you want to use your own custom canvas, you have to create and use the custom TFJS WebGL backend created from the canvas through 'new tf.MathBackendWebGL(customCanvas)'.");let u=p.writeTexture(n,t,o,s,a,i);return cr().makeTensorFromDataId(u,t,o,p)}};Ul.nextDataId=0;function RJ(r,e){if(e==="float32"||e==="complex64")return r;if(e==="int32"||e==="bool"){let t=e==="int32"?new Int32Array(r.length):new Uint8Array(r.length);for(let o=0;onew Ul,2);var sut={forceHalfFloat:EA};var Gl=` if (isnan(a)) return a; if (isnan(b)) return b; -`;var Fr=class{constructor(t,e,o){this.variableNames=["A","B"],this.outputShape=w.assertAndGetBroadcastShape(e,o),this.enableShapeUniforms=ut(this.outputShape.length),this.userCode=` +`;var Br=class{constructor(e,t,o){this.variableNames=["A","B"],this.outputShape=C.assertAndGetBroadcastShape(t,o),this.enableShapeUniforms=lt(this.outputShape.length),this.userCode=` float binaryOperation(float a, float b) { - ${t} + ${e} } void main() { @@ -1242,12 +1242,12 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, float b = getBAtOutCoords(); setOutput(binaryOperation(a, b)); } - `}};var jr=` + `}};var to=` result.r = isNaN.r ? NAN : result.r; result.g = isNaN.g ? NAN : result.g; result.b = isNaN.b ? NAN : result.b; result.a = isNaN.a ? NAN : result.a; -`;var qr=class{constructor(t,e,o,n=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=w.assertAndGetBroadcastShape(e,o);let s=this.outputShape.length;this.enableShapeUniforms=ut(s);let a="";if(n)if(s===0||y.sizeFromShape(this.outputShape)===1)a=` +`;var eo=class{constructor(e,t,o,n=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=C.assertAndGetBroadcastShape(t,o);let s=this.outputShape.length;this.enableShapeUniforms=lt(s);let a="";if(n)if(s===0||y.sizeFromShape(this.outputShape)===1)a=` result.y = 0.; result.z = 0.; result.w = 0.; @@ -1261,7 +1261,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y; result.z = 0.; result.w = 0.; - `;else{let p=Rt("coords",s);this.enableShapeUniforms?a+=` + `;else{let p=At("coords",s);this.enableShapeUniforms?a+=` bool nextRowOutOfBounds = (${p[s-2]} + 1) >= outShape[${s} - 2]; bool nextColOutOfBounds = @@ -1279,7 +1279,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; `}this.userCode=` vec4 binaryOperation(vec4 a, vec4 b) { - ${t} + ${e} } void main() { @@ -1291,13 +1291,13 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, setOutput(result); } - `}};function Dt(r){let{inputs:t,backend:e}=r,{x:o}=t;return e.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var BD={kernelName:Co,backendName:"webgl",kernelFunc:Dt};function Pr(r){let{inputs:t,backend:e}=r,{real:o,imag:n}=t,s=e.makeTensorInfo(o.shape,"complex64"),a=e.texData.get(s.dataId),i=Dt({inputs:{x:o},backend:e}),p=Dt({inputs:{x:n},backend:e});return a.complexTensorInfos={real:i,imag:p},s}var zD={kernelName:Ri,backendName:"webgl",kernelFunc:Pr};var fv="return (a < 0.) ? b * a : a;",hv=` + `}};function Ft(r){let{inputs:e,backend:t}=r,{x:o}=e;return t.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}var $A={kernelName:vo,backendName:"webgl",kernelFunc:Ft};function zr(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.makeTensorInfo(o.shape,"complex64"),a=t.texData.get(s.dataId),i=Ft({inputs:{x:o},backend:t}),p=Ft({inputs:{x:n},backend:t});return a.complexTensorInfos={real:i,imag:p},s}var RA={kernelName:ei,backendName:"webgl",kernelFunc:zr};var _0="return (a < 0.) ? b * a : a;",E0=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function a9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{alpha:s}=o,a=e.makeTensorInfo([],"float32",y.createScalarValue(s,"float32")),i=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new qr(hv,n.shape,a.shape):new Fr(fv,n.shape,a.shape),p=e.runWebGLProgram(i,[n,a],"float32");return e.disposeIntermediateTensorInfo(a),p}var VD={kernelName:En,backendName:"webgl",kernelFunc:a9};var gv="return (a < 0.) ? b * a : a;",xv=` +`;function AJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{alpha:s}=o,a=t.makeTensorInfo([],"float32",y.createScalarValue(s,"float32")),i=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new eo(E0,n.shape,a.shape):new Br(_0,n.shape,a.shape),p=t.runWebGLProgram(i,[n,a],"float32");return t.disposeIntermediateTensorInfo(a),p}var DA={kernelName:Yn,backendName:"webgl",kernelFunc:AJ};var $0="return (a < 0.) ? b * a : a;",R0=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`;function i9(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t,s=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new qr(xv,o.shape,n.shape):new Fr(gv,o.shape,n.shape);return e.runWebGLProgram(s,[o,n],"float32")}var WD={kernelName:rs,backendName:"webgl",kernelFunc:i9};var Fo="if (isnan(x)) return x;";function xe({opSnippet:r,packedOpSnippet:t,cpuKernelImpl:e,dtype:o}){return({inputs:n,backend:s})=>{let{x:a}=n,i=s,p=o||a.dtype;if(i.shouldExecuteOnCPU([a])&&e!=null){let l=i.texData.get(a.dataId),m=e(l.values,p);return i.makeTensorInfo(a.shape,p,m)}let u=A().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&t!=null,c;return u?c=new Ar(a.shape,t):c=new tr(a.shape,r),i.runWebGLProgram(c,[a],p)}}function nt({opSnippet:r,packedOpSnippet:t,checkOutOfBounds:e=!1,supportsComplex:o=!1,cpuKernelImpl:n,dtype:s}){return({inputs:a,backend:i})=>{let{a:p,b:u}=a,c=i;if(o&&p.dtype==="complex64"){let f=c.texData.get(p.dataId),h=c.texData.get(u.dataId),[g,x]=[[f.complexTensorInfos.real,h.complexTensorInfos.real],[f.complexTensorInfos.imag,h.complexTensorInfos.imag]].map(C=>{let[S,k]=C,_={dataId:S.dataId,dtype:S.dtype,shape:p.shape},E={dataId:k.dataId,dtype:k.dtype,shape:u.shape},R=new Fr(r,p.shape,u.shape);return c.runWebGLProgram(R,[_,E],dt(S.dtype,k.dtype))}),b=Pr({inputs:{real:g,imag:x},backend:c});return c.disposeIntermediateTensorInfo(g),c.disposeIntermediateTensorInfo(x),b}let l=s||dt(p.dtype,u.dtype);if((p.dtype==="string"||u.dtype==="string"||c.shouldExecuteOnCPU([p,u]))&&n!=null){let f=c.texData.get(p.dataId).values,h=c.texData.get(u.dataId).values,g=p.dtype==="string"?w.fromUint8ToStringArray(f):f,x=p.dtype==="string"?w.fromUint8ToStringArray(h):h,[b,C]=n(p.shape,u.shape,g,x,l),S=c.makeTensorInfo(C,l),k=c.texData.get(S.dataId);return k.values=b,S}let m=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&t!=null,d;return m?d=new qr(t,p.shape,u.shape,e):d=new Fr(r,p.shape,u.shape),c.runWebGLProgram(d,[p,u],l)}}function xi(r,t=!1){if(r==="linear")return t?AD:TD;if(r==="relu")return t?PD:$D;if(r==="elu")return t?FD:_D;if(r==="relu6")return t?OD:ED;if(r==="prelu")return t?xv:gv;if(r==="leakyrelu")return t?hv:fv;if(r==="sigmoid")return t?MD:RD;throw new Error(`Activation ${r} has not been implemented for the WebGL backend.`)}var Lc=class{constructor(t,e,o,n=!1,s=!1,a=!1,i=null,p=!1,u=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=o,this.enableShapeUniforms=ut(this.outputShape.length);let c=n?t[1]:t[2],l=Math.ceil(c/2),m=n?"i * 2, rc.y":"rc.y, i * 2",d=s?"rc.z, i * 2":"i * 2, rc.z",f=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],h=s?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],g="",x="";i&&(p?g=`vec4 activation(vec4 a) { +`;function FJ(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e,s=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new eo(R0,o.shape,n.shape):new Br($0,o.shape,n.shape);return t.runWebGLProgram(s,[o,n],"float32")}var AA={kernelName:gs,backendName:"webgl",kernelFunc:FJ};var sn="if (isnan(x)) return x;";function xe({opSnippet:r,packedOpSnippet:e,cpuKernelImpl:t,dtype:o}){return({inputs:n,backend:s})=>{let{x:a}=n,i=s,p=o||a.dtype;if(i.shouldExecuteOnCPU([a])&&t!=null){let c=i.texData.get(a.dataId),m=t(c.values,p);return i.makeTensorInfo(a.shape,p,m)}let u=A().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&e!=null,l;return u?l=new Lr(a.shape,e):l=new nr(a.shape,r),i.runWebGLProgram(l,[a],p)}}function st({opSnippet:r,packedOpSnippet:e,checkOutOfBounds:t=!1,supportsComplex:o=!1,cpuKernelImpl:n,dtype:s}){return({inputs:a,backend:i})=>{let{a:p,b:u}=a,l=i;if(o&&p.dtype==="complex64"){let f=l.texData.get(p.dataId),h=l.texData.get(u.dataId),[g,x]=[[f.complexTensorInfos.real,h.complexTensorInfos.real],[f.complexTensorInfos.imag,h.complexTensorInfos.imag]].map(w=>{let[S,k]=w,T={dataId:S.dataId,dtype:S.dtype,shape:p.shape},E={dataId:k.dataId,dtype:k.dtype,shape:u.shape},R=new Br(r,p.shape,u.shape);return l.runWebGLProgram(R,[T,E],pt(S.dtype,k.dtype))}),b=zr({inputs:{real:g,imag:x},backend:l});return l.disposeIntermediateTensorInfo(g),l.disposeIntermediateTensorInfo(x),b}let c=s||pt(p.dtype,u.dtype);if((p.dtype==="string"||u.dtype==="string"||l.shouldExecuteOnCPU([p,u]))&&n!=null){let f=l.texData.get(p.dataId).values,h=l.texData.get(u.dataId).values,g=p.dtype==="string"?C.fromUint8ToStringArray(f):f,x=p.dtype==="string"?C.fromUint8ToStringArray(h):h,[b,w]=n(p.shape,u.shape,g,x,c),S=l.makeTensorInfo(w,c),k=l.texData.get(S.dataId);return k.values=b,S}let m=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&e!=null,d;return m?d=new eo(e,p.shape,u.shape,t):d=new Br(r,p.shape,u.shape),l.runWebGLProgram(d,[p,u],c)}}function Ti(r,e=!1){if(r==="linear")return e?vA:yA;if(r==="relu")return e?NA:CA;if(r==="elu")return e?kA:bA;if(r==="relu6")return e?TA:wA;if(r==="prelu")return e?R0:$0;if(r==="leakyrelu")return e?E0:_0;if(r==="sigmoid")return e?_A:SA;throw new Error(`Activation ${r} has not been implemented for the WebGL backend.`)}var Hl=class{constructor(e,t,o,n=!1,s=!1,a=!1,i=null,p=!1,u=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=o,this.enableShapeUniforms=lt(this.outputShape.length);let l=n?e[1]:e[2],c=Math.ceil(l/2),m=n?"i * 2, rc.y":"rc.y, i * 2",d=s?"rc.z, i * 2":"i * 2, rc.z",f=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],h=s?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],g="",x="";i&&(p?g=`vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${i} }`:u?g=`vec4 activation(vec4 a) { @@ -1305,16 +1305,16 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${i} }`:g=`vec4 activation(vec4 x) { ${i} - }`,x="result = activation(result);");let b=a?"result += getBiasAtOutCoords();":"";a&&this.variableNames.push("bias"),p&&this.variableNames.push("preluActivationWeights"),u&&this.variableNames.push("leakyreluAlpha");let C="rc.x",S="rc.x";t[0]`The new shape (${p}) has ${u} elements and the old shape (${n.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`);let c=a.texData.get(n.dataId);return c.isPacked&&!hu(n.shape,p)&&!(c.texture!==null&&hu(c.shape,p))?HD(n,p,a):(a.incRef(n.dataId),{dataId:n.dataId,shape:p,dtype:n.dtype})}var KD={kernelName:da,backendName:"webgl",kernelFunc:te};var em=class{constructor(t,e){this.variableNames=["x"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=t;this.outputShape=[n,a];let i=Math.floor(o/4)*4,p=o%4,u="sumValue += dot(values, ones);";if(e!=null){let l=1/e;u=`sumValue += dot(values * ${y.isInt(l)?l.toPrecision(2):l}, ones);`}let c="";s%o>0&&(c=` + `}};var FA="return a * b;";function um(r){let{inputs:e,backend:t}=r,{a:o,b:n}=e,s=C.upcastType(o.dtype,n.dtype);if(o.dtype==="complex64"){let i=t.texData.get(o.dataId),p=t.texData.get(n.dataId),u=new im(D0.REAL,o.shape,n.shape),l=new im(D0.IMAG,o.shape,n.shape),c=[{dataId:i.complexTensorInfos.real.dataId,dtype:i.complexTensorInfos.real.dtype,shape:o.shape},{dataId:i.complexTensorInfos.imag.dataId,dtype:i.complexTensorInfos.imag.dtype,shape:o.shape},{dataId:p.complexTensorInfos.real.dataId,dtype:p.complexTensorInfos.real.dtype,shape:n.shape},{dataId:p.complexTensorInfos.imag.dataId,dtype:p.complexTensorInfos.imag.dtype,shape:n.shape}],m=t.runWebGLProgram(u,c,"float32"),d=t.runWebGLProgram(l,c,"float32"),f=zr({inputs:{real:m,imag:d},backend:t});return t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d),f}if(t.shouldExecuteOnCPU([o,n])){let i=t.texData.get(o.dataId),p=t.texData.get(n.dataId),[u,l]=GD(o.shape,n.shape,i.values,p.values,s),c=t.makeTensorInfo(l,s),m=t.texData.get(c.dataId);return m.values=u,c}let a;return A().getBool("WEBGL_PACK_BINARY_OPERATIONS")?a=new eo(FA,o.shape,n.shape):a=new Br(FA,o.shape,n.shape),t.runWebGLProgram(a,[o,n],s)}var PA={kernelName:$o,backendName:"webgl",kernelFunc:um};function OA(r,e,t){let o=[ki(r.shape),...Ni(r.shape)],n={dtype:r.dtype,shape:o,dataId:r.dataId},s=[ki(e),...Ni(e)],a=new Wl(s,o),i=!0,p=[o],u=t.runWebGLProgram(a,[n],r.dtype,p,i);return{dataId:u.dataId,shape:e,dtype:u.dtype}}function te(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{shape:s}=o,a=t,i=y.sizeFromShape(n.shape),p=y.inferFromImplicitShape(s,i),u=y.sizeFromShape(p);y.assert(i===u,()=>`The new shape (${p}) has ${u} elements and the old shape (${n.shape}) has ${i} elements. The new shape and old shape must have the same number of elements.`);let l=a.texData.get(n.dataId);return l.isPacked&&!vu(n.shape,p)&&!(l.texture!==null&&vu(l.shape,p))?OA(n,p,a):(a.incRef(n.dataId),{dataId:n.dataId,shape:p,dtype:n.dtype})}var MA={kernelName:Ca,backendName:"webgl",kernelFunc:te};var pm=class{constructor(e,t){this.variableNames=["x"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=e;this.outputShape=[n,a];let i=Math.floor(o/4)*4,p=o%4,u="sumValue += dot(values, ones);";if(t!=null){let c=1/t;u=`sumValue += dot(values * ${y.isInt(c)?c.toPrecision(2):c}, ones);`}let l="";s%o>0&&(l=` if (inIdx < 0 || inIdx >= ${s}) { return 0.0; } @@ -1357,7 +1357,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) { - ${c} + ${l} return getX(batch, inIdx); } @@ -1402,15 +1402,15 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } setOutput(sumValue); } - `}};var hh=class{constructor(t,e){this.variableNames=["x"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=t;this.outputShape=[n,a];let i="0.0",p="";e==="prod"?i="1.0":e==="min"?(i="1.0 / 1e-20",p="min"):e==="max"&&(i="-1.0 / 1e-20",p="max");let u=`${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;e==="sum"?u="sumValue":e==="prod"?u="prodValue":e==="all"?u="allValue":e==="any"&&(u="anyValue");let c=Math.floor(o/4)*4,l=o%4,m=` - if (${e==="sum"}) { + `}};var Th=class{constructor(e,t){this.variableNames=["x"];let{windowSize:o,batchSize:n,inSize:s,outSize:a}=e;this.outputShape=[n,a];let i="0.0",p="";t==="prod"?i="1.0":t==="min"?(i="1.0 / 1e-20",p="min"):t==="max"&&(i="-1.0 / 1e-20",p="max");let u=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="sum"?u="sumValue":t==="prod"?u="prodValue":t==="all"?u="allValue":t==="any"&&(u="anyValue");let l=Math.floor(o/4)*4,c=o%4,m=` + if (${t==="sum"}) { sumValue += dot(values, ones); - } else if (${e==="prod"}) { + } else if (${t==="prod"}) { vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]); prodValue *= tmp[0] * tmp[1]; } else { minMaxValue = ${p}(values, minMaxValue); - if (${e==="min"} || ${e==="max"}) { + if (${t==="min"} || ${t==="max"}) { minMaxValue = ${p}(values, minMaxValue); bvec4 isNaN = isnan(values); if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) { @@ -1418,11 +1418,11 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } } } - `,d="vec4";e==="all"?(i="1.0",m=` + `,d="vec4";t==="all"?(i="1.0",m=` bool reducedAllValue = all(values); float floatedReducedAllValue = float(reducedAllValue); allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); - `,d="bvec4"):e==="any"&&(i="0.0",m=` + `,d="bvec4"):t==="any"&&(i="0.0",m=` bool reducedAnyValue = any(values); float floatedReducedAnyValue = float(reducedAnyValue); anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); @@ -1451,7 +1451,7 @@ 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 < ${l}; i += 4) { int inIdx = inOffset + i; ${d} values = ${d}( getValue(batch, inIdx), @@ -1463,8 +1463,8 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ${m} } - int inIdx = inOffset + ${c}; - if (${l===1}) { + int inIdx = inOffset + ${l}; + if (${c===1}) { ${d} values = ${d}( getValue(batch, inIdx), initializationValue, @@ -1473,7 +1473,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ); ${m} - } else if (${l===2}) { + } else if (${c===2}) { ${d} values = ${d}( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -1482,7 +1482,7 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, ); ${m} - } else if (${l===3}) { + } else if (${c===3}) { ${d} values = ${d}( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -1494,12 +1494,12 @@ vec2 packedUVfrom3D(int texNumR, int texNumC, } setOutput(${u}); } - `}};function p9(r){let t=[];for(;t.length===0||t[t.length-1].outSize!==1;){let e=t.length?t[t.length-1].outSize:r[1],o=w.computeOptimalWindowSize(e);t.push({inSize:e,windowSize:o,outSize:Math.ceil(e/o)})}return t}function Xr(r,t,e,o){let n=p9(r.shape),s=r;for(let a=0;a6)throw Error(`Transpose for rank ${t} is not yet supported`);let e=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],o=new Array(t);for(let n=0;n6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let n=Re(this.rank),s=mv("rc",this.rank),a=new Array(this.rank);for(let c=0;c6)throw Error(`Transpose for rank ${e} is not yet supported`);let t=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],o=new Array(e);for(let n=0;n6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let n=Re(this.rank),s=N0("rc",this.rank),a=new Array(this.rank);for(let l=0;l`Error in matMul: inner shapes (${l}) and (${m}) of Tensors with shapes ${r.shape} and ${t.shape} and transposeA=${e} and transposeB=${o} must match.`);let k=e?[x,l,d]:[x,d,l],_=o?[b,f,m]:[b,m,f],E=te({inputs:{x:r},backend:n,attrs:{shape:k}}),R=te({inputs:{x:t},backend:n,attrs:{shape:_}}),D=[E,R],P=Math.max(x,b),O=e?E.shape[1]:E.shape[2],M=s!=null,L=a!=null,B=p==="leakyrelu",z=p!=null?xi(p,!0):null,U=M||L||B||z!=null,j;if((d===1||f===1)&&O>bv&&U===!1){let Y=E,J=R;e&&(Y=bt({inputs:{x:E},backend:n,attrs:{perm:[0,2,1]}}),D.push(Y)),o&&(J=bt({inputs:{x:R},backend:n,attrs:{perm:[0,2,1]}}),D.push(J));let re=f!==1,ne=f===1,ee=Y;re&&(ee=te({inputs:{x:Y},backend:n,attrs:{shape:[P,O,1]}}),D.push(ee));let oe=f===1?2:1,ie=J;ne&&(ie=te({inputs:{x:J},backend:n,attrs:{shape:[P,1,O]}}),D.push(ie));let le=Jl({inputs:{a:ee,b:ie},backend:n});j=bp({inputs:{x:le},backend:n,attrs:{axis:oe,keepDims:!0}}),D.push(le)}else{let Y=dt(r.dtype,t.dtype),J=new Lc(k,_,[P,d,f],e,o,M,z,L,B),re=[E,R];if(s!=null&&re.push(s),L&&re.push(a),B){let ne=n.makeTensorInfo([],"float32",y.createScalarValue(i,"float32"));re.push(ne),D.push(ne)}j=n.runWebGLProgram(J,re,Y)}let q=te({inputs:{x:j},backend:n,attrs:{shape:S}});D.push(j);for(let Y of D)n.disposeIntermediateTensorInfo(Y);return q}function l9(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=t,{transposeA:p,transposeB:u,activation:c,leakyreluAlpha:l}=o;return Cp({a:n,b:s,transposeA:p,transposeB:u,backend:e,bias:a,preluActivationWeights:i,leakyreluAlpha:l,activation:c})}var YD={kernelName:So,backendName:"webgl",kernelFunc:l9};var QD="return abs(x);";function m9(r){let{inputs:t,backend:e}=r,{x:o}=t;if(e.shouldExecuteOnCPU([o])&&o.dtype!=="complex64"){let s=e.texData.get(o.dataId),a=ph(s.values);return e.makeTensorInfo(o.shape,o.dtype,a)}let n;return A().getBool("WEBGL_PACK_UNARY_OPERATIONS")?n=new Ar(o.shape,QD):n=new tr(o.shape,QD),e.runWebGLProgram(n,[o],o.dtype)}var ZD={kernelName:Xs,backendName:"webgl",kernelFunc:m9};var d9=Wt+` + `}};function ku(r,e,t){let o=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Eh(r.shape,e):new _h(r.shape,e);return t.runWebGLProgram(o,[r],r.dtype)}function LA(r,e,t,o){let n=e,s=r.shape.length,a=y.parseAxisParam(n,r.shape),i=a,p=C.getAxesPermutation(i,s),u=p!=null,l=r;u&&(l=ku(r,p,o),i=C.getInnerMostAxes(i.length,s)),C.assertAxesAreInnerMostDims("sum",i,s);let[c,m]=C.computeOutAndReduceShapes(l.shape,i),d=c;t&&(d=C.expandShapeToKeepDim(c,a));let f=y.sizeFromShape(m),g=y.sizeFromShape(r.shape)/f,x=te({inputs:{x:l},attrs:{shape:[g,f]},backend:o}),b=mi(r.dtype),w=ro(x,b,"sum",o),S=te({inputs:{x:w},attrs:{shape:d},backend:o});return o.disposeIntermediateTensorInfo(x),o.disposeIntermediateTensorInfo(w),u&&o.disposeIntermediateTensorInfo(l),S}function Tp(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;return LA(n,s,a,t)}var BA={kernelName:As,backendName:"webgl",kernelFunc:Tp};function Ct(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{perm:s}=o,a=t,i=n.shape.length,p=new Array(i);for(let l=0;l`Error in matMul: inner shapes (${c}) and (${m}) of Tensors with shapes ${r.shape} and ${e.shape} and transposeA=${t} and transposeB=${o} must match.`);let k=t?[x,c,d]:[x,d,c],T=o?[b,f,m]:[b,m,f],E=te({inputs:{x:r},backend:n,attrs:{shape:k}}),R=te({inputs:{x:e},backend:n,attrs:{shape:T}}),D=[E,R],F=Math.max(x,b),O=t?E.shape[1]:E.shape[2],M=s!=null,L=a!=null,B=p==="leakyrelu",z=p!=null?Ti(p,!0):null,U=M||L||B||z!=null,j;if((d===1||f===1)&&O>A0&&U===!1){let Y=E,J=R;t&&(Y=Ct({inputs:{x:E},backend:n,attrs:{perm:[0,2,1]}}),D.push(Y)),o&&(J=Ct({inputs:{x:R},backend:n,attrs:{perm:[0,2,1]}}),D.push(J));let re=f!==1,ne=f===1,ee=Y;re&&(ee=te({inputs:{x:Y},backend:n,attrs:{shape:[F,O,1]}}),D.push(ee));let oe=f===1?2:1,ue=J;ne&&(ue=te({inputs:{x:J},backend:n,attrs:{shape:[F,1,O]}}),D.push(ue));let me=um({inputs:{a:ee,b:ue},backend:n});j=Tp({inputs:{x:me},backend:n,attrs:{axis:oe,keepDims:!0}}),D.push(me)}else{let Y=pt(r.dtype,e.dtype),J=new Hl(k,T,[F,d,f],t,o,M,z,L,B),re=[E,R];if(s!=null&&re.push(s),L&&re.push(a),B){let ne=n.makeTensorInfo([],"float32",y.createScalarValue(i,"float32"));re.push(ne),D.push(ne)}j=n.runWebGLProgram(J,re,Y)}let q=te({inputs:{x:j},backend:n,attrs:{shape:S}});D.push(j);for(let Y of D)n.disposeIntermediateTensorInfo(Y);return q}function LJ(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=e,{transposeA:p,transposeB:u,activation:l,leakyreluAlpha:c}=o;return _p({a:n,b:s,transposeA:p,transposeB:u,backend:t,bias:a,preluActivationWeights:i,leakyreluAlpha:c,activation:l})}var VA={kernelName:qo,backendName:"webgl",kernelFunc:LJ};var WA="return abs(x);";function BJ(r){let{inputs:e,backend:t}=r,{x:o}=e;if(t.shouldExecuteOnCPU([o])&&o.dtype!=="complex64"){let s=t.texData.get(o.dataId),a=wh(s.values);return t.makeTensorInfo(o.shape,o.dtype,a)}let n;return A().getBool("WEBGL_PACK_UNARY_OPERATIONS")?n=new Lr(o.shape,WA):n=new nr(o.shape,WA),t.runWebGLProgram(n,[o],o.dtype)}var UA={kernelName:fn,backendName:"webgl",kernelFunc:BJ};var zJ=Gt+` if (abs(x) > 1.) { return NAN; } return acos(x); -`,f9=xe({opSnippet:d9}),JD={kernelName:Vo,backendName:"webgl",kernelFunc:f9};var h9=Wt+` +`,VJ=xe({opSnippet:zJ}),GA={kernelName:hn,backendName:"webgl",kernelFunc:VJ};var WJ=Gt+` if (x < 1.0) return NAN; -return log(x + sqrt(x * x - 1.0));`,g9=xe({opSnippet:h9}),eA={kernelName:Wo,backendName:"webgl",kernelFunc:g9};var tA="return a + b;",x9=nt({opSnippet:tA,packedOpSnippet:tA,supportsComplex:!0,cpuKernelImpl:DR}),rA={kernelName:io,backendName:"webgl",kernelFunc:x9};var yh=class{constructor(t,e){this.outputShape=[],this.outputShape=t,this.variableNames=e.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`float v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(" + ");this.userCode=` +return log(x + sqrt(x * x - 1.0));`,UJ=xe({opSnippet:WJ}),HA={kernelName:gn,backendName:"webgl",kernelFunc:UJ};var KA="return a + b;",GJ=st({opSnippet:KA,packedOpSnippet:KA,supportsComplex:!0,cpuKernelImpl:ID}),qA={kernelName:Rr,backendName:"webgl",kernelFunc:GJ};var $h=class{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`float v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(" + ");this.userCode=` void main() { ${o.join(` `)} @@ -1531,7 +1531,7 @@ return log(x + sqrt(x * x - 1.0));`,g9=xe({opSnippet:h9}),eA={kernelName:Wo,back float result = ${n}; setOutput(result); } - `}};var bh=class{constructor(t,e){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.variableNames=e.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`vec4 v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(" + ");this.userCode=` + `}};var Rh=class{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((s,a)=>`T${a}`);let o=[];this.variableNames.forEach(s=>{o.push(`vec4 v${s} = get${s}AtOutCoords();`)});let n=this.variableNames.map(s=>`v${s}`).join(" + ");this.userCode=` void main() { ${o.join(` `)} @@ -1539,7 +1539,7 @@ return log(x + sqrt(x * x - 1.0));`,g9=xe({opSnippet:h9}),eA={kernelName:Wo,back vec4 result = ${n}; setOutput(result); } - `}};function Ch(r){let{inputs:t,backend:e}=r,o=t;if(o.length===1)return Dt({inputs:{x:o[0]},backend:e});if(o.length>A().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let p=Math.floor(o.length/2),u=Ch({inputs:o.slice(0,p),backend:e}),c=Ch({inputs:o.slice(p),backend:e});return Ch({inputs:[u,c],backend:e})}let n=o.map(p=>p.dtype).reduce((p,u)=>dt(p,u)),s=o.map(p=>p.shape),i=A().getBool("WEBGL_PACK")?new bh(o[0].shape,s):new yh(o[0].shape,s);return e.runWebGLProgram(i,o,n)}var oA={kernelName:Uo,backendName:"webgl",kernelFunc:Ch};function y9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,c=w.getAxesPermutation(u,i),l=n;c!=null&&(l=bt({inputs:{x:n},backend:e,attrs:{perm:c}}),u=w.getInnerMostAxes(u.length,i)),w.assertAxesAreInnerMostDims("all",u,i);let[m,d]=w.computeOutAndReduceShapes(l.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:l},backend:e,attrs:{shape:[-1,f]}}),g=Xr(h,h.dtype,"all",e),x;if(a){let b=w.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:e,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:e,attrs:{shape:m}});return e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(g),c!=null&&e.disposeIntermediateTensorInfo(l),x}var nA={kernelName:Go,backendName:"webgl",kernelFunc:y9};function b9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,c=w.getAxesPermutation(u,i),l=n;c!=null&&(l=bt({inputs:{x:n},backend:e,attrs:{perm:c}}),u=w.getInnerMostAxes(u.length,i)),w.assertAxesAreInnerMostDims("any",u,i);let[m,d]=w.computeOutAndReduceShapes(l.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:l},backend:e,attrs:{shape:[-1,f]}}),g=Xr(h,h.dtype,"any",e),x;if(a){let b=w.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:e,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:e,attrs:{shape:m}});return e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(g),c!=null&&e.disposeIntermediateTensorInfo(l),x}var sA={kernelName:Ho,backendName:"webgl",kernelFunc:b9};var wh=class{constructor(t,e,o){this.variableNames=["A"];let{windowSize:n,batchSize:s,outSize:a}=t;o||this.variableNames.push("bestIndicesA"),this.outputShape=[s,a];let i=e==="max"?">":"<",p=o?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` + `}};function Dh(r){let{inputs:e,backend:t}=r,o=e;if(o.length===1)return Ft({inputs:{x:o[0]},backend:t});if(o.length>A().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let p=Math.floor(o.length/2),u=Dh({inputs:o.slice(0,p),backend:t}),l=Dh({inputs:o.slice(p),backend:t});return Dh({inputs:[u,l],backend:t})}let n=o.map(p=>p.dtype).reduce((p,u)=>pt(p,u)),s=o.map(p=>p.shape),i=A().getBool("WEBGL_PACK")?new Rh(o[0].shape,s):new $h(o[0].shape,s);return t.runWebGLProgram(i,o,n)}var jA={kernelName:xn,backendName:"webgl",kernelFunc:Dh};function HJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,l=C.getAxesPermutation(u,i),c=n;l!=null&&(c=Ct({inputs:{x:n},backend:t,attrs:{perm:l}}),u=C.getInnerMostAxes(u.length,i)),C.assertAxesAreInnerMostDims("all",u,i);let[m,d]=C.computeOutAndReduceShapes(c.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:c},backend:t,attrs:{shape:[-1,f]}}),g=ro(h,h.dtype,"all",t),x;if(a){let b=C.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:t,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:t,attrs:{shape:m}});return t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(g),l!=null&&t.disposeIntermediateTensorInfo(c),x}var XA={kernelName:yn,backendName:"webgl",kernelFunc:HJ};function KJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,l=C.getAxesPermutation(u,i),c=n;l!=null&&(c=Ct({inputs:{x:n},backend:t,attrs:{perm:l}}),u=C.getInnerMostAxes(u.length,i)),C.assertAxesAreInnerMostDims("any",u,i);let[m,d]=C.computeOutAndReduceShapes(c.shape,u),f=y.sizeFromShape(d),h=te({inputs:{x:c},backend:t,attrs:{shape:[-1,f]}}),g=ro(h,h.dtype,"any",t),x;if(a){let b=C.expandShapeToKeepDim(m,p);x=te({inputs:{x:g},backend:t,attrs:{shape:b}})}else x=te({inputs:{x:g},backend:t,attrs:{shape:m}});return t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(g),l!=null&&t.disposeIntermediateTensorInfo(c),x}var YA={kernelName:bn,backendName:"webgl",kernelFunc:KJ};var Ah=class{constructor(e,t,o){this.variableNames=["A"];let{windowSize:n,batchSize:s,outSize:a}=e;o||this.variableNames.push("bestIndicesA"),this.outputShape=[s,a];let i=t==="max"?">":"<",p=o?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));";this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -1559,31 +1559,31 @@ return log(x + sqrt(x * x - 1.0));`,g9=xe({opSnippet:h9}),eA={kernelName:Wo,back } setOutput(float(bestIndex)); } - `}};var Sh=class{constructor(t,e,o,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,y.assert(t.length>2,()=>`Packed arg${o.charAt(0).toUpperCase()+o.slice(1)} supports only inputs with rank above 2.`);let s=t[t.length-1],a=Math.ceil(s/e);this.outputShape=t.slice(0,-1),a>1&&this.outputShape.push(a),n||this.variableNames.push("bestIndicesA");let i=this.outputShape,p=i.length,u=Re(p),c=Rt("coords",p),l,m;if(a===1){m=p+1;let R=Re(m);l=` - ${R} sourceLocR = ${R}(${c.join()}, 0); - ++${c[p-1]}; - ${R} sourceLocG = ${R}(${c.join()}, 0); - ++${c[p-2]}; - ${R} sourceLocA = ${R}(${c.join()}, 0); - --${c[p-1]}; - ${R} sourceLocB = ${R}(${c.join()}, 0); - --${c[p-2]};`}else m=p,l=` + `}};var Fh=class{constructor(e,t,o,n){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,y.assert(e.length>2,()=>`Packed arg${o.charAt(0).toUpperCase()+o.slice(1)} supports only inputs with rank above 2.`);let s=e[e.length-1],a=Math.ceil(s/t);this.outputShape=e.slice(0,-1),a>1&&this.outputShape.push(a),n||this.variableNames.push("bestIndicesA");let i=this.outputShape,p=i.length,u=Re(p),l=At("coords",p),c,m;if(a===1){m=p+1;let R=Re(m);c=` + ${R} sourceLocR = ${R}(${l.join()}, 0); + ++${l[p-1]}; + ${R} sourceLocG = ${R}(${l.join()}, 0); + ++${l[p-2]}; + ${R} sourceLocA = ${R}(${l.join()}, 0); + --${l[p-1]}; + ${R} sourceLocB = ${R}(${l.join()}, 0); + --${l[p-2]};`}else m=p,c=` ${u} sourceLocR = coords; - ++${c[p-1]}; + ++${l[p-1]}; ${u} sourceLocG = coords; - ++${c[p-2]}; + ++${l[p-2]}; ${u} sourceLocA = coords; - --${c[p-1]}; + --${l[p-1]}; ${u} sourceLocB = coords; - --${c[p-2]};`;let d=["x","y","z","w","u","v"].slice(0,m),f="."+d[m-1],h=d.map(R=>"int "+R),g=Rt("sourceLocR",m-1).concat("inIdx.r"),x=Rt("sourceLocG",m-1).concat("inIdx.g"),b=Rt("sourceLocB",m-1).concat("inIdx.b"),C=Rt("sourceLocA",m-1).concat("inIdx.a"),S=o==="max"?"greaterThan":"lessThan",k=n?"":` + --${l[p-2]};`;let d=["x","y","z","w","u","v"].slice(0,m),f="."+d[m-1],h=d.map(R=>"int "+R),g=At("sourceLocR",m-1).concat("inIdx.r"),x=At("sourceLocG",m-1).concat("inIdx.g"),b=At("sourceLocB",m-1).concat("inIdx.b"),w=At("sourceLocA",m-1).concat("inIdx.a"),S=o==="max"?"greaterThan":"lessThan",k=n?"":` inIdx = round(vec4(getBestIndicesAChannel(${g.join()}), getBestIndicesAChannel(${x.join()}), getBestIndicesAChannel(${b.join()}), - getBestIndicesAChannel(${C.join()})));`,_=`vec4( + getBestIndicesAChannel(${w.join()})));`,T=`vec4( getAChannel(${g.join()}), hasNextCol ? getAChannel(${x.join()}) : 0., hasNextRow ? getAChannel(${b.join()}) : 0., - hasNextRow && hasNextCol ? getAChannel(${C.join()}) : 0.)`,E=n?"":` + hasNextRow && hasNextCol ? getAChannel(${w.join()}) : 0.)`,E=n?"":` float getBestIndicesAChannel(${h.join()}) { return getChannel(getBestIndicesA(${d.join()}), vec2(${d.slice(-2).join()})); @@ -1595,19 +1595,19 @@ return log(x + sqrt(x * x - 1.0));`,g9=xe({opSnippet:h9}),eA={kernelName:Wo,back ${E} void main() { ${u} coords = getOutputCoords(); - bool hasNextCol = ${c[p-1]} < ${i[p-1]-1}; - bool hasNextRow = ${c[p-2]} < ${i[p-2]-1}; - ${l} + bool hasNextCol = ${l[p-1]} < ${i[p-1]-1}; + bool hasNextRow = ${l[p-2]} < ${i[p-2]-1}; + ${c} ivec4 srcIdx = ivec4(sourceLocR${f}, sourceLocG${f}, - sourceLocB${f}, sourceLocA${f}) * ${e}; + sourceLocB${f}, sourceLocA${f}) * ${t}; ivec4 inIdx = srcIdx; vec4 bestIndex = vec4(inIdx); - vec4 bestValue = ${_}; + vec4 bestValue = ${T}; - for (int i = 0; i < ${e}; i++) { + for (int i = 0; i < ${t}; i++) { inIdx = srcIdx; ${k} - vec4 candidate = ${_}; + vec4 candidate = ${T}; bvec4 nan = isnan(candidate); bvec4 replace = bvec4( vec4(${S}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); @@ -1621,25 +1621,25 @@ return log(x + sqrt(x * x - 1.0));`,g9=xe({opSnippet:h9}),eA={kernelName:Wo,back } setOutput(bestIndex); } - `}};function aA(r,t,e,o=null){let n=t.shape[0],s=t.shape[1];o!=null&&(n=o.shape[0],s=o.shape[1]);let a=w.computeOptimalWindowSize(s),i={windowSize:a,inSize:s,batchSize:n,outSize:Math.ceil(s/a)},p=new wh(i,e,o==null),u=[t];o!=null&&u.push(o);let c=r.runWebGLProgram(p,u,"int32");if(c.shape[1]===1)return c;let l=aA(r,t,e,c);return r.disposeIntermediateTensorInfo(c),l}function iA(r,t,e,o=null){let n=o!=null?o.shape:t.shape,s=n[n.length-1],a=w.computeOptimalWindowSize(s),i=new Sh(n,a,e,o==null),p=o==null?[t]:[t,o],u=r.runWebGLProgram(i,p,"int32");if(u.shape.length===t.shape.length){let c=iA(r,t,e,u);return r.disposeIntermediateTensorInfo(u),c}return u}function Ih(r,t,e,o){let n=[e];if(w.assertAxesAreInnerMostDims("arg"+o.charAt(0).toUpperCase()+o.slice(1),n,t.shape.length),!A().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let s=[],a=r.texData.get(t.dataId),i=a!==null&&a.isPacked,p=t;i&&(p=r.unpackTensor(t),s.push(p));let[u,c]=w.computeOutAndReduceShapes(p.shape,n),l=y.sizeFromShape(c),m=te({inputs:{x:p},backend:r,attrs:{shape:[-1,l]}});s.push(m);let d=aA(r,m,o);s.push(d);let f=te({inputs:{x:d},backend:r,attrs:{shape:u}});return s.forEach(h=>r.disposeIntermediateTensorInfo(h)),f}return iA(r,t,o)}function C9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=bt({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims("argMax",[a[0]],p.shape.length);let c=Ih(e,p,a[0],"max");return u.forEach(l=>e.disposeIntermediateTensorInfo(l)),c}var uA={kernelName:Ys,backendName:"webgl",kernelFunc:C9};function w9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=bt({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims("argMin",[a[0]],p.shape.length);let c=Ih(e,p,a[0],"min");return u.forEach(l=>e.disposeIntermediateTensorInfo(l)),c}var pA={kernelName:Qs,backendName:"webgl",kernelFunc:w9};var S9=Wt+` + `}};function QA(r,e,t,o=null){let n=e.shape[0],s=e.shape[1];o!=null&&(n=o.shape[0],s=o.shape[1]);let a=C.computeOptimalWindowSize(s),i={windowSize:a,inSize:s,batchSize:n,outSize:Math.ceil(s/a)},p=new Ah(i,t,o==null),u=[e];o!=null&&u.push(o);let l=r.runWebGLProgram(p,u,"int32");if(l.shape[1]===1)return l;let c=QA(r,e,t,l);return r.disposeIntermediateTensorInfo(l),c}function ZA(r,e,t,o=null){let n=o!=null?o.shape:e.shape,s=n[n.length-1],a=C.computeOptimalWindowSize(s),i=new Fh(n,a,t,o==null),p=o==null?[e]:[e,o],u=r.runWebGLProgram(i,p,"int32");if(u.shape.length===e.shape.length){let l=ZA(r,e,t,u);return r.disposeIntermediateTensorInfo(u),l}return u}function Ph(r,e,t,o){let n=[t];if(C.assertAxesAreInnerMostDims("arg"+o.charAt(0).toUpperCase()+o.slice(1),n,e.shape.length),!A().getBool("WEBGL_PACK_REDUCE")||e.shape.length<=2){let s=[],a=r.texData.get(e.dataId),i=a!==null&&a.isPacked,p=e;i&&(p=r.unpackTensor(e),s.push(p));let[u,l]=C.computeOutAndReduceShapes(p.shape,n),c=y.sizeFromShape(l),m=te({inputs:{x:p},backend:r,attrs:{shape:[-1,c]}});s.push(m);let d=QA(r,m,o);s.push(d);let f=te({inputs:{x:d},backend:r,attrs:{shape:u}});return s.forEach(h=>r.disposeIntermediateTensorInfo(h)),f}return ZA(r,e,o)}function qJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Ct({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims("argMax",[a[0]],p.shape.length);let l=Ph(t,p,a[0],"max");return u.forEach(c=>t.disposeIntermediateTensorInfo(c)),l}var JA={kernelName:na,backendName:"webgl",kernelFunc:qJ};function jJ(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Ct({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims("argMin",[a[0]],p.shape.length);let l=Ph(t,p,a[0],"min");return u.forEach(c=>t.disposeIntermediateTensorInfo(c)),l}var eF={kernelName:sa,backendName:"webgl",kernelFunc:jJ};var XJ=Gt+` if (abs(x) > 1.) { return NAN; } return asin(x); -`,I9=xe({opSnippet:S9}),cA={kernelName:Ko,backendName:"webgl",kernelFunc:I9};var v9=Wt+"return log(x + sqrt(x * x + 1.0));",k9=xe({opSnippet:v9}),lA={kernelName:qo,backendName:"webgl",kernelFunc:k9};var N9=Wt+` +`,YJ=xe({opSnippet:XJ}),tF={kernelName:Cn,backendName:"webgl",kernelFunc:YJ};var QJ=Gt+"return log(x + sqrt(x * x + 1.0));",ZJ=xe({opSnippet:QJ}),rF={kernelName:wn,backendName:"webgl",kernelFunc:ZJ};var JJ=Gt+` return atan(x); -`,T9=xe({opSnippet:N9}),mA={kernelName:jo,backendName:"webgl",kernelFunc:T9};var _9=Mc+` +`,eee=xe({opSnippet:JJ}),oF={kernelName:Sn,backendName:"webgl",kernelFunc:eee};var tee=Gl+` return atan(a, b); -`,$9=` +`,ree=` vec4 result = atan(a, b); bvec4 isNaNA = isnan(a); bvec4 isNaNB = isnan(b); bvec4 isNaN = bvec4(isNaNA.x || isNaNB.x, isNaNA.y || isNaNB.y, isNaNA.z || isNaNB.z, isNaNA.w || isNaNB.w); - `+jr+` + `+to+` return result; -`,E9=nt({opSnippet:_9,packedOpSnippet:$9}),dA={kernelName:Yo,backendName:"webgl",kernelFunc:E9};var R9=Wt+` +`,oee=st({opSnippet:tee,packedOpSnippet:ree}),nF={kernelName:vn,backendName:"webgl",kernelFunc:oee};var nee=Gt+` if ((x < -1.0) || (x > 1.0)) return NAN; -return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelName:Xo,backendName:"webgl",kernelFunc:D9};var Us=class{constructor(t,e,o,n=!1,s=!1){if(this.variableNames=["x"],e==="avg"&&o)throw new Error("Cannot compute positions for average pool.");let a=t.filterWidth,i=t.strideHeight,p=t.strideWidth,u=t.dilationHeight,c=t.dilationWidth,l=t.effectiveFilterHeight,m=t.effectiveFilterWidth,d=t.padInfo.top,f=t.padInfo.left;this.outputShape=t.outShape;let h=e==="avg",g=`((batch * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + d`,x=`(xR * ${t.inWidth} + xC) * ${t.inChannels} + d`,b="0.0";if(h||(b="-1.0 / 1e-20"),o){let R=">=";this.userCode=` +return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,see=xe({opSnippet:nee}),sF={kernelName:In,backendName:"webgl",kernelFunc:see};var Zs=class{constructor(e,t,o,n=!1,s=!1){if(this.variableNames=["x"],t==="avg"&&o)throw new Error("Cannot compute positions for average pool.");let a=e.filterWidth,i=e.strideHeight,p=e.strideWidth,u=e.dilationHeight,l=e.dilationWidth,c=e.effectiveFilterHeight,m=e.effectiveFilterWidth,d=e.padInfo.top,f=e.padInfo.left;this.outputShape=e.outShape;let h=t==="avg",g=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,x=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,b="0.0";if(h||(b="-1.0 / 1e-20"),o){let R=">=";this.userCode=` const ivec2 strides = ivec2(${i}, ${p}); const ivec2 pads = ivec2(${d}, ${f}); @@ -1659,19 +1659,19 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int minMaxPosition = 0; float avgValue = 0.0; - for (int wR = 0; wR < ${l}; + for (int wR = 0; wR < ${c}; wR += ${u}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${m}; - wC += ${c}) { + wC += ${l}) { int xC = xCCorner + wC; - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -1690,11 +1690,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(float(minMaxPosition)); } - `;return}let C="max",S=`${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;e==="avg"&&(S="avgValue / max(count, 1.0)");let k=Math.floor(a/4)*4,_=a%4,E=` + `;return}let w="max",S=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(S="avgValue / max(count, 1.0)");let k=Math.floor(a/4)*4,T=a%4,E=` if (${h}) { avgValue += dot(values, ones); } else { - minMaxValue = ${C}(values, minMaxValue); + minMaxValue = ${w}(values, minMaxValue); } `;this.userCode=` const ivec2 strides = ivec2(${i}, ${p}); @@ -1705,7 +1705,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float count = 0.0; float getValue(int batch, int xR, int xC, int d) { - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { return initializationValue; } count += 1.0; @@ -1727,29 +1727,29 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float avgValue = 0.0; count = 0.0; - for (int wR = 0; wR < ${l}; + for (int wR = 0; wR < ${c}; wR += ${u}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${k}; wC += 4) { - int xC = xCCorner + wC * ${c}; + int xC = xCCorner + wC * ${l}; 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 + ${l}, d), + getValue(batch, xR, xC + 2 * ${l}, d), + getValue(batch, xR, xC + 3 * ${l}, d) ); ${E} } int xC = xCCorner + ${k}; - if (${_===1}) { + if (${T===1}) { vec4 values = vec4( getValue(batch, xR, xC, d), initializationValue, @@ -1758,20 +1758,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam ); ${E} - } else if (${_===2}) { + } else if (${T===2}) { vec4 values = vec4( getValue(batch, xR, xC, d), - getValue(batch, xR, xC + ${c}, d), + getValue(batch, xR, xC + ${l}, d), initializationValue, initializationValue ); ${E} - } else if (${_===3}) { + } else if (${T===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 + ${l}, d), + getValue(batch, xR, xC + 2 * ${l}, d), initializationValue ); @@ -1780,7 +1780,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(${S}); } - `}},xu=class{constructor(t,e,o,n=!1,s=!1){if(this.variableNames=["x"],e==="avg"&&o)throw new Error("Cannot compute positions for average pool.");let a=t.filterWidth,i=t.strideDepth,p=t.strideHeight,u=t.strideWidth,c=t.dilationDepth,l=t.dilationHeight,m=t.dilationWidth,d=t.effectiveFilterDepth,f=t.effectiveFilterHeight,h=t.effectiveFilterWidth,g=t.padInfo.front,x=t.padInfo.top,b=t.padInfo.left;this.outputShape=t.outShape;let C=e==="avg",S="0.0";if(C||(S="-1.0 / 1e-20"),o){let P=">=";this.userCode=` + `}},Nu=class{constructor(e,t,o,n=!1,s=!1){if(this.variableNames=["x"],t==="avg"&&o)throw new Error("Cannot compute positions for average pool.");let a=e.filterWidth,i=e.strideDepth,p=e.strideHeight,u=e.strideWidth,l=e.dilationDepth,c=e.dilationHeight,m=e.dilationWidth,d=e.effectiveFilterDepth,f=e.effectiveFilterHeight,h=e.effectiveFilterWidth,g=e.padInfo.front,x=e.padInfo.top,b=e.padInfo.left;this.outputShape=e.outShape;let w=t==="avg",S="0.0";if(w||(S="-1.0 / 1e-20"),o){let F=">=";this.userCode=` const ivec3 strides = ivec3(${i}, ${p}, ${u}); const ivec3 pads = ivec3(${g}, ${x}, ${b}); @@ -1802,18 +1802,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int minMaxPosition = 0; for (int wD = 0; wD < ${d}; - wD += ${c}) { + wD += ${l}) { int xD = xDCorner + wD; - if (xD < 0 || xD >= ${t.inDepth}) { + if (xD < 0 || xD >= ${e.inDepth}) { continue; } for (int wR = 0; wR < ${f}; - wR += ${l}) { + wR += ${c}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } @@ -1821,7 +1821,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam wC += ${m}) { int xC = xCCorner + wC; - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -1831,10 +1831,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); - if (value ${P} currMinMaxValue) { + if (value ${F} currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; - minMaxPosition = ${n?s?`(((batch * ${t.inDepth} + xD) * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + ch`:`((xD * ${t.inHeight} + xR) * ${t.inWidth} + xC) * ${t.inChannels} + ch`:`wD * ${f} * ${h} + + minMaxPosition = ${n?s?`(((batch * ${e.inDepth} + xD) * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`((xD * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + ch`:`wD * ${f} * ${h} + wR * ${h} + wC`}; } } @@ -1842,8 +1842,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(float(minMaxPosition)); } - `;return}let k="max",_=`${e}(${e}(${e}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;e==="avg"&&(_="avgValue / max(count, 1.0)");let E=Math.floor(a/4)*4,R=a%4,D=` - if (${C}) { + `;return}let k="max",T=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;t==="avg"&&(T="avgValue / max(count, 1.0)");let E=Math.floor(a/4)*4,R=a%4,D=` + if (${w}) { avgValue += dot(values, ones); } else { minMaxValue = ${k}(values, minMaxValue); @@ -1858,7 +1858,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float count = 0.0; float getValue(int batch, int xD, int xR, int xC, int ch) { - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { return initializationValue; } count += 1.0; @@ -1882,18 +1882,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam count = 0.0; for (int wD = 0; wD < ${d}; - wD += ${c}) { + wD += ${l}) { int xD = xDCorner + wD; - if (xD < 0 || xD >= ${t.inDepth}) { + if (xD < 0 || xD >= ${e.inDepth}) { continue; } for (int wR = 0; wR < ${f}; - wR += ${l}) { + wR += ${c}) { int xR = xRCorner + wR; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } @@ -1941,10 +1941,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } } } - setOutput(${_}); + setOutput(${T}); } - `}};function A9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t;Vs(n,"avgPool");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(w.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p);if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))return Dt({inputs:{x:n},backend:e});let l=new Us(c,"avg",!1);return e.runWebGLProgram(l,[n],"float32")}var hA={kernelName:Qo,backendName:"webgl",kernelFunc:A9};function F9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,p,u),m=new xu(l,"avg",!1);return e.runWebGLProgram(m,[n],"float32")}var gA={kernelName:Zs,backendName:"webgl",kernelFunc:F9};var vh=class{constructor(t){this.variableNames=["dy"],this.outputShape=t.inShape;let e=t.filterHeight,o=t.filterWidth,n=t.strideHeight,s=t.strideWidth,a=t.dilationHeight,i=t.dilationWidth,p=t.effectiveFilterHeight,u=t.effectiveFilterWidth,c=p-1-t.padInfo.top,l=u-1-t.padInfo.left,m=1/(e*o);this.userCode=` - const ivec2 pads = ivec2(${c}, ${l}); + `}};function aee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e;Ys(n,"avgPool");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(C.eitherStridesOrDilationsAreOne(a,u),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p);if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))return Ft({inputs:{x:n},backend:t});let c=new Zs(l,"avg",!1);return t.runWebGLProgram(c,[n],"float32")}var aF={kernelName:kn,backendName:"webgl",kernelFunc:aee};function iee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,p,u),m=new Nu(c,"avg",!1);return t.runWebGLProgram(m,[n],"float32")}var iF={kernelName:aa,backendName:"webgl",kernelFunc:iee};var Oh=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,o=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=e.dilationHeight,i=e.dilationWidth,p=e.effectiveFilterHeight,u=e.effectiveFilterWidth,l=p-1-e.padInfo.top,c=u-1-e.padInfo.left,m=1/(t*o);this.userCode=` + const ivec2 pads = ivec2(${l}, ${c}); const float avgMultiplier = float(${m}); void main() { @@ -1963,7 +1963,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam wR += ${a}) { float dyR = float(dyRCorner + wR) / ${n}.0; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); @@ -1972,7 +1972,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam wC+= ${i}) { float dyC = float(dyCCorner + wC) / ${s}.0; - if (dyC < 0.0 || dyC >= ${t.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -1985,7 +1985,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}},kh=class{constructor(t){this.variableNames=["dy"],this.outputShape=t.inShape;let e=t.filterDepth,o=t.filterHeight,n=t.filterWidth,s=t.strideDepth,a=t.strideHeight,i=t.strideWidth,p=t.dilationDepth,u=t.dilationHeight,c=t.dilationWidth,l=t.effectiveFilterDepth,m=t.effectiveFilterHeight,d=t.effectiveFilterWidth,f=l-1-t.padInfo.front,h=m-1-t.padInfo.top,g=d-1-t.padInfo.left,x=1/(e*o*n);this.userCode=` + `}},Mh=class{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,o=e.filterHeight,n=e.filterWidth,s=e.strideDepth,a=e.strideHeight,i=e.strideWidth,p=e.dilationDepth,u=e.dilationHeight,l=e.dilationWidth,c=e.effectiveFilterDepth,m=e.effectiveFilterHeight,d=e.effectiveFilterWidth,f=c-1-e.padInfo.front,h=m-1-e.padInfo.top,g=d-1-e.padInfo.left,x=1/(t*o*n);this.userCode=` const ivec3 pads = ivec3(${f}, ${h}, ${g}); const float avgMultiplier = float(${x}); @@ -2004,11 +2004,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wD = 0; wD < ${l}; + for (int wD = 0; wD < ${c}; wD += ${p}) { float dyD = float(dyDCorner + wD) / ${s}.0; - if (dyD < 0.0 || dyD >= ${t.outDepth}.0 || fract(dyD) > 0.0) { + if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); @@ -2017,17 +2017,17 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam wR += ${u}) { float dyR = float(dyRCorner + wR) / ${a}.0; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); for (int wC = 0; wC < ${d}; - wC += ${c}) { + wC += ${l}) { float dyC = float(dyCCorner + wC) / ${i}.0; - if (dyC < 0.0 || dyC >= ${t.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -2041,7 +2041,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}};function P9(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=[1,1,1],m=w.computePool3DInfo(a.shape,i,p,l,u,c),d=new kh(m);return e.runWebGLProgram(d,[n],a.dtype)}var xA={kernelName:Ei,backendName:"webgl",kernelFunc:P9};function O9(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s;Vs([n,s],"avgPoolGrad");let{filterSize:i,strides:p,pad:u}=o,c=w.computePool2DInfo(a.shape,i,p,1,u),l=new vh(c);return e.runWebGLProgram(l,[n],a.dtype)}var yA={kernelName:$i,backendName:"webgl",kernelFunc:O9};function M9(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;return Cp({a:n,b:s,transposeA:a,transposeB:i,backend:e})}var bA={kernelName:Zo,backendName:"webgl",kernelFunc:M9};var Nh=class{constructor(t,e,o,n,s,a){this.outputShape=[],this.variableNames=["x","mean","variance"],w.assertAndGetBroadcastShape(t,e),w.assertAndGetBroadcastShape(t,o);let i="0.0";n!=null&&(w.assertAndGetBroadcastShape(t,n),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let p="1.0";s!=null&&(w.assertAndGetBroadcastShape(t,s),this.variableNames.push("scale"),p="getScaleAtOutCoords()"),this.outputShape=t,this.userCode=` + `}};function uee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:l}=o,c=[1,1,1],m=C.computePool3DInfo(a.shape,i,p,c,u,l),d=new Mh(m);return t.runWebGLProgram(d,[n],a.dtype)}var uF={kernelName:Vi,backendName:"webgl",kernelFunc:uee};function pee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s;Ys([n,s],"avgPoolGrad");let{filterSize:i,strides:p,pad:u}=o,l=C.computePool2DInfo(a.shape,i,p,1,u),c=new Oh(l);return t.runWebGLProgram(c,[n],a.dtype)}var pF={kernelName:zi,backendName:"webgl",kernelFunc:pee};function lee(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;return _p({a:n,b:s,transposeA:a,transposeB:i,backend:t})}var lF={kernelName:Nn,backendName:"webgl",kernelFunc:lee};var Lh=class{constructor(e,t,o,n,s,a){this.outputShape=[],this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,o);let i="0.0";n!=null&&(C.assertAndGetBroadcastShape(e,n),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let p="1.0";s!=null&&(C.assertAndGetBroadcastShape(e,s),this.variableNames.push("scale"),p="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { float x = getXAtOutCoords(); float mean = getMeanAtOutCoords(); @@ -2051,7 +2051,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float inv = scale * inversesqrt(variance + float(${a})); setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); } - `}};var Th=class{constructor(t,e,o,n,s,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],w.assertAndGetBroadcastShape(t,e),w.assertAndGetBroadcastShape(t,o);let i="vec4(0.0)";n!=null&&(w.assertAndGetBroadcastShape(t,n),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let p="vec4(1.0)";s!=null&&(w.assertAndGetBroadcastShape(t,s),this.variableNames.push("scale"),p="getScaleAtOutCoords()"),this.outputShape=t,this.userCode=` + `}};var Bh=class{constructor(e,t,o,n,s,a){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],C.assertAndGetBroadcastShape(e,t),C.assertAndGetBroadcastShape(e,o);let i="vec4(0.0)";n!=null&&(C.assertAndGetBroadcastShape(e,n),this.variableNames.push("offset"),i="getOffsetAtOutCoords()");let p="vec4(1.0)";s!=null&&(C.assertAndGetBroadcastShape(e,s),this.variableNames.push("scale"),p="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { vec4 offset = ${i}; vec4 scale = ${p}; @@ -2064,9 +2064,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam setOutput((x - mean) * inv + offset); } - `}};var L9=({inputs:r,backend:t,attrs:e})=>{let{x:o,mean:n,variance:s,offset:a,scale:i}=r;y.assert(n.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),y.assert(a==null||n.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),y.assert(i==null||n.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:p}=e;p==null&&(p=.001);let u=[o,n,s],c=null;a!=null&&(c=a.shape,u.push(a));let l=null;i!=null&&(l=i.shape,u.push(i));let m=A().getBool("WEBGL_PACK_NORMALIZATION")?new Th(o.shape,n.shape,s.shape,c,l,p):new Nh(o.shape,n.shape,s.shape,c,l,p);return t.runWebGLProgram(m,u,u[0].dtype)},CA={kernelName:In,backendName:"webgl",kernelFunc:L9};var _h=class{constructor(t){this.variableNames=["source"],this.outputShape=t,this.rank=t.length;let e=Re(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let o=B9(this.rank),n,s=t.map((a,i)=>`sourceLoc.${Cv[i]} = start[${i}] + coords.${Cv[i]};`);n=` - ${e} sourceLoc; - ${e} coords = getOutputCoords(); + `}};var cee=({inputs:r,backend:e,attrs:t})=>{let{x:o,mean:n,variance:s,offset:a,scale:i}=r;y.assert(n.shape.length===s.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),y.assert(a==null||n.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),y.assert(i==null||n.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:p}=t;p==null&&(p=.001);let u=[o,n,s],l=null;a!=null&&(l=a.shape,u.push(a));let c=null;i!=null&&(c=i.shape,u.push(i));let m=A().getBool("WEBGL_PACK_NORMALIZATION")?new Bh(o.shape,n.shape,s.shape,l,c,p):new Lh(o.shape,n.shape,s.shape,l,c,p);return e.runWebGLProgram(m,u,u[0].dtype)},cF={kernelName:Hn,backendName:"webgl",kernelFunc:cee};var zh=class{constructor(e){this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let t=Re(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let o=mee(this.rank),n,s=e.map((a,i)=>`sourceLoc.${F0[i]} = start[${i}] + coords.${F0[i]};`);n=` + ${t} sourceLoc; + ${t} coords = getOutputCoords(); ${s.join(` `)} `,this.userCode=` @@ -2074,44 +2074,44 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam ${n} setOutput(getSource(${o})); } - `}},Cv=["x","y","z","w","u","v"];function B9(r){if(r===1)return"sourceLoc";if(r<=6)return Cv.slice(0,r).map(t=>"sourceLoc."+t).join(",");throw Error(`Slicing for rank ${r} is not yet supported`)}var $h=class{constructor(t){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t,this.rank=t.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let e=Re(this.rank),o=Rt("coords",this.rank),n=Rt("sourceLoc",this.rank),s=this.rank===1?"sourceLoc":`vec2(${n.slice(-2).join()})`,a=`getChannel(getSource(${n.join()}), ${s})`,i=` + `}},F0=["x","y","z","w","u","v"];function mee(r){if(r===1)return"sourceLoc";if(r<=6)return F0.slice(0,r).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${r} is not yet supported`)}var Vh=class{constructor(e){this.variableNames=["source"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let t=Re(this.rank),o=At("coords",this.rank),n=At("sourceLoc",this.rank),s=this.rank===1?"sourceLoc":`vec2(${n.slice(-2).join()})`,a=`getChannel(getSource(${n.join()}), ${s})`,i=` result.x = ${a}; - if (++${o[this.rank-1]} < ${t[this.rank-1]}) { + if (++${o[this.rank-1]} < ${e[this.rank-1]}) { ++${n[this.rank-1]}; result.y = ${a}; --${n[this.rank-1]}; } `,p=this.rank===1?"":` --${o[this.rank-1]}; - if (++${o[this.rank-2]} < ${t[this.rank-2]}) { + if (++${o[this.rank-2]} < ${e[this.rank-2]}) { ++${n[this.rank-2]}; result.z = ${a}; - if (++${o[this.rank-1]} < ${t[this.rank-1]}) { + if (++${o[this.rank-1]} < ${e[this.rank-1]}) { ++${n[this.rank-1]}; result.w = ${a}; } } `,u=this.rank<=4?`sourceLoc = coords + - ${e}(${t.map((c,l)=>`start[${l}]`).join()});`:t.map((c,l)=>`${n[l]} = ${o[l]} + start[${l}];`).join(` + ${t}(${e.map((l,c)=>`start[${c}]`).join()});`:e.map((l,c)=>`${n[c]} = ${o[c]} + start[${c}];`).join(` `);this.userCode=` void main() { - ${e} coords = getOutputCoords(); - ${e} sourceLoc; + ${t} coords = getOutputCoords(); + ${t} sourceLoc; ${u} vec4 result = vec4(0.); ${i} ${p} setOutput(result); } - `}};function z9(r,t,e,o){let n=o.texData.get(r.dataId),s=o.makeTensorInfo(e,r.dtype),a=o.texData.get(s.dataId);Object.assign(a,n),a.refCount=1,a.shape=e,a.dtype=r.dtype;let i=pt.computeFlatOffset(t,y.computeStrides(r.shape));n.slice&&(i+=n.slice.flatOffset),a.slice={flatOffset:i,origDataId:n.slice&&n.slice.origDataId||r.dataId};let p=o.dataRefCount.get(a.slice.origDataId)||1;return o.dataRefCount.set(a.slice.origDataId,p+1),s}function Gs(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,size:a}=o,[i,p]=pt.parseSliceParams(n,s,a);if(pt.assertParamsValid(n,i,p),y.sizeFromShape(p)===0)return e.makeTensorInfo(p,n.dtype,[]);if(e.shouldExecuteOnCPU([n])||n.dtype==="string"){let l=e.texData.get(n.dataId),m=cD(l.values,i,p,n.shape,n.dtype);return e.makeTensorInfo(p,n.dtype,m)}let{isPacked:u}=e.texData.get(n.dataId),c=pt.isSliceContinous(n.shape,i,p);if(u||!c){let l=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new $h(p):new _h(p),m=[i];return e.runWebGLProgram(l,[n],n.dtype,m)}return e.uploadToGPU(n.dataId),z9(n,i,p,e)}var wA={kernelName:ha,backendName:"webgl",kernelFunc:Gs};var V9=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let i=s.reduce((b,C)=>b*C),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=[],f=te({inputs:{x:n},backend:e,attrs:{shape:p}}),h=bt({inputs:{x:f},backend:e,attrs:{perm:u}}),g=te({inputs:{x:h},backend:e,attrs:{shape:c}}),x=Gs({inputs:{x:g},backend:e,attrs:{begin:l,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>e.disposeIntermediateTensorInfo(b)),x},SA={kernelName:Js,backendName:"webgl",kernelFunc:V9};function W9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=e.readSync(n.dataId),p=e.readSync(s.dataId),u=uh(i,p,s.dtype,s.shape,a);return e.makeTensorInfo([a],s.dtype,u)}var IA={kernelName:Jo,backendName:"webgl",kernelFunc:W9};var U9=` + `}};function dee(r,e,t,o){let n=o.texData.get(r.dataId),s=o.makeTensorInfo(t,r.dtype),a=o.texData.get(s.dataId);Object.assign(a,n),a.refCount=1,a.shape=t,a.dtype=r.dtype;let i=nt.computeFlatOffset(e,y.computeStrides(r.shape));n.slice&&(i+=n.slice.flatOffset),a.slice={flatOffset:i,origDataId:n.slice&&n.slice.origDataId||r.dataId};let p=o.dataRefCount.get(a.slice.origDataId)||1;return o.dataRefCount.set(a.slice.origDataId,p+1),s}function Js(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,size:a}=o,[i,p]=nt.parseSliceParams(n,s,a);if(nt.assertParamsValid(n,i,p),y.sizeFromShape(p)===0)return t.makeTensorInfo(p,n.dtype,[]);if(t.shouldExecuteOnCPU([n])||n.dtype==="string"){let c=t.texData.get(n.dataId),m=tA(c.values,i,p,n.shape,n.dtype);return t.makeTensorInfo(p,n.dtype,m)}let{isPacked:u}=t.texData.get(n.dataId),l=nt.isSliceContinous(n.shape,i,p);if(u||!l){let c=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Vh(p):new zh(p),m=[i];return t.runWebGLProgram(c,[n],n.dtype,m)}return t.uploadToGPU(n.dataId),dee(n,i,p,t)}var mF={kernelName:_s,backendName:"webgl",kernelFunc:Js};var fee=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let i=s.reduce((b,w)=>b*w),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=[],f=te({inputs:{x:n},backend:t,attrs:{shape:p}}),h=Ct({inputs:{x:f},backend:t,attrs:{perm:u}}),g=te({inputs:{x:h},backend:t,attrs:{shape:l}}),x=Js({inputs:{x:g},backend:t,attrs:{begin:c,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>t.disposeIntermediateTensorInfo(b)),x},dF={kernelName:ia,backendName:"webgl",kernelFunc:fee};function hee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=t.readSync(n.dataId),p=t.readSync(s.dataId),u=Ch(i,p,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,u)}var fF={kernelName:Tn,backendName:"webgl",kernelFunc:hee};var gee=` int r = int(a.r) & int(b.r); int g = int(a.g) & int(b.g); int rb = int(a.b) & int(b.b); int ra = int(a.a) & int(b.a); return vec4(r, g, rb, ra); -`,G9=` +`,xee=` return float(int(a.r) & int(b.r)); -`;function H9(r){let{inputs:t,backend:e}=r,{a:o,b:n}=t,s=A().getBool("WEBGL_PACK_BINARY_OPERATIONS"),a=A().getNumber("WEBGL_VERSION");if(e.shouldExecuteOnCPU([o,n])||a===1){let p=e.texData.get(o.dataId).values,u=e.texData.get(n.dataId).values,[c,l]=FR(o.shape,n.shape,p,u,o.dtype),m=e.makeTensorInfo(l,o.dtype),d=e.texData.get(m.dataId);return d.values=c,m}let i;return s?i=new qr(U9,o.shape,n.shape,!1):i=new Fr(G9,o.shape,n.shape),e.runWebGLProgram(i,[o,n],o.dtype)}var vA={kernelName:qa,backendName:"webgl",kernelFunc:H9};function K9(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t,s=e.readSync(o.dataId),a=e.readSync(n.dataId),i=w.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return e.makeTensorInfo([i.length],"int32",Int32Array.from(i))}var kA={kernelName:ea,backendName:"webgl",kernelFunc:K9};var q9="return float(a != b);",wv=nt({opSnippet:q9,cpuKernelImpl:tD,dtype:"bool"}),NA={kernelName:Yn,backendName:"webgl",kernelFunc:wv};function yi(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.texData.get(o.dataId);return Dt({inputs:{x:n.complexTensorInfos.real},backend:e})}var TA={kernelName:Gi,backendName:"webgl",kernelFunc:yi};var j9="return float(int(x));";function _A(r,t){let e=new tr(r.shape,j9),o=t.runWebGLProgram(e,[r],"int32");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function Sv(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dtype:s}=o;if(s==="complex64"){if(n.dtype==="complex64")return Dt({inputs:{x:n},backend:e});let a=Ur(n.shape),i=Sv({inputs:{x:n},backend:e,attrs:{dtype:"float32"}}),p=Pr({inputs:{real:i,imag:a},backend:e});return a.dispose(),e.disposeIntermediateTensorInfo(i),p}if(n.dtype==="complex64"){let a=yi({inputs:{input:n},backend:e}),i=Sv({inputs:{x:a},backend:e,attrs:{dtype:s}});return e.disposeIntermediateTensorInfo(a),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=Dt({inputs:{x:n},backend:e});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(e.shouldExecuteOnCPU([n])){let a=e.texData.get(n.dataId).values,[i,p,u]=PR(a,n.shape,n.dtype,s);return e.makeTensorInfo(i,p,u)}if(s==="int32")return _A(n,e);if(s==="bool"){let a=e.makeTensorInfo([],"bool",y.getTypedArrayFromDType("bool",1)),p=wv({inputs:{a:n,b:a},backend:e});return e.disposeIntermediateTensorInfo(a),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var $A={kernelName:yo,backendName:"webgl",kernelFunc:Sv};var EA="return ceil(x);",X9=xe({opSnippet:EA,packedOpSnippet:EA,cpuKernelImpl:OR}),RA={kernelName:en,backendName:"webgl",kernelFunc:X9};var Eh=class{constructor(t){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=t,this.userCode=` +`;function yee(r){let{inputs:e,backend:t}=r,{a:o,b:n}=e,s=A().getBool("WEBGL_PACK_BINARY_OPERATIONS"),a=A().getNumber("WEBGL_VERSION");if(t.shouldExecuteOnCPU([o,n])||a===1){let p=t.texData.get(o.dataId).values,u=t.texData.get(n.dataId).values,[l,c]=kD(o.shape,n.shape,p,u,o.dtype),m=t.makeTensorInfo(c,o.dtype),d=t.texData.get(m.dataId);return d.values=l,m}let i;return s?i=new eo(gee,o.shape,n.shape,!1):i=new Br(xee,o.shape,n.shape),t.runWebGLProgram(i,[o,n],o.dtype)}var hF={kernelName:_n,backendName:"webgl",kernelFunc:yee};function bee(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e,s=t.readSync(o.dataId),a=t.readSync(n.dataId),i=C.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return t.makeTensorInfo([i.length],"int32",Int32Array.from(i))}var gF={kernelName:ua,backendName:"webgl",kernelFunc:bee};var Cee="return float(a != b);",P0=st({opSnippet:Cee,cpuKernelImpl:KD,dtype:"bool"}),xF={kernelName:Ro,backendName:"webgl",kernelFunc:P0};function _i(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.texData.get(o.dataId);return Ft({inputs:{x:n.complexTensorInfos.real},backend:t})}var yF={kernelName:si,backendName:"webgl",kernelFunc:_i};var wee="return float(int(x));";function bF(r,e){let t=new nr(r.shape,wee),o=e.runWebGLProgram(t,[r],"int32");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function O0(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s==="complex64"){if(n.dtype==="complex64")return Ft({inputs:{x:n},backend:t});let a=Yr(n.shape),i=O0({inputs:{x:n},backend:t,attrs:{dtype:"float32"}}),p=zr({inputs:{real:i,imag:a},backend:t});return a.dispose(),t.disposeIntermediateTensorInfo(i),p}if(n.dtype==="complex64"){let a=_i({inputs:{input:n},backend:t}),i=O0({inputs:{x:a},backend:t,attrs:{dtype:s}});return t.disposeIntermediateTensorInfo(a),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=Ft({inputs:{x:n},backend:t});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(t.shouldExecuteOnCPU([n])){let a=t.texData.get(n.dataId).values,[i,p,u]=ND(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}if(s==="int32")return bF(n,t);if(s==="bool"){let a=t.makeTensorInfo([],"bool",y.getTypedArrayFromDType("bool",1)),p=P0({inputs:{a:n,b:a},backend:t});return t.disposeIntermediateTensorInfo(a),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var CF={kernelName:ho,backendName:"webgl",kernelFunc:O0};var wF="return ceil(x);",See=xe({opSnippet:wF,packedOpSnippet:wF,cpuKernelImpl:TD}),SF={kernelName:go,backendName:"webgl",kernelFunc:See};var Wh=class{constructor(e){this.variableNames=["A"],this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` void main() { float value = getAAtOutCoords(); @@ -2122,7 +2122,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam setOutput(clamp(value, minVal, maxVal)); } - `}};var Rh=class{constructor(t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=t,this.userCode=` + `}};var Uh=class{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"minVal",type:"float"},{name:"maxVal",type:"float"}],this.outputShape=e,this.userCode=` void main() { vec4 value = getAAtOutCoords(); @@ -2133,7 +2133,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam setOutput(clamp(value, vec4(minVal), vec4(maxVal))); } - `}};function Y9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{clipValueMin:s,clipValueMax:a}=o,i;A().getBool("WEBGL_PACK_CLIP")?i=new Rh(n.shape):i=new Eh(n.shape);let p=[[s],[a]];return e.runWebGLProgram(i,[n],n.dtype,p)}var DA={kernelName:bo,backendName:"webgl",kernelFunc:Y9};var Dh=class{constructor(t){this.variableNames=["real","imag"],this.outputShape=t,this.userCode=` + `}};function Iee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{clipValueMin:s,clipValueMax:a}=o,i;A().getBool("WEBGL_PACK_CLIP")?i=new Uh(n.shape):i=new Wh(n.shape);let p=[[s],[a]];return t.runWebGLProgram(i,[n],n.dtype,p)}var IF={kernelName:Go,backendName:"webgl",kernelFunc:Iee};var Gh=class{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` void main() { float re = abs(getRealAtOutCoords()); float im = abs(getImagAtOutCoords()); @@ -2146,7 +2146,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) ); } - `}};function AA(r,t){return{dataId:t.dataId,dtype:t.dtype,shape:r.shape}}function Q9(r){let{inputs:t,backend:e}=r,{x:o}=t,n=e.texData.get(o.dataId),s=new Dh(o.shape),a=[AA(o,n.complexTensorInfos.real),AA(o,n.complexTensorInfos.imag)];return e.runWebGLProgram(s,a,a[0].dtype)}var FA={kernelName:Di,backendName:"webgl",kernelFunc:Q9};var Ah=class{constructor(t){this.outputShape=[],this.outputShape=w.computeOutShape(t,1),this.variableNames=t.map((a,i)=>`T${i}`);let e=new Array(t.length-1);e[0]=t[0][1];for(let a=1;a`T${i}`);let t=new Array(e.length-1);t[0]=e[0][1];for(let a=1;a`T${g}`);let p=new Array(t.length-1);p[0]=t[0][e];for(let h=1;h`T${g}`);let p=new Array(e.length-1);p[0]=e[0][t];for(let h=1;h= ${p[h-1]}) { return getChannel( - getT${h}(${Fh(i,u,g)}), - vec2(${Fh(c,u,g)})); + getT${h}(${Kh(i,u,g)}), + vec2(${Kh(l,u,g)})); }`}let d=p.length,f=p[p.length-1];m+=` return getChannel( - getT${d}(${Fh(i,u,f)}), - vec2(${Fh(c,u,f)}));`,this.userCode=` + getT${d}(${Kh(i,u,f)}), + vec2(${Kh(l,u,f)}));`,this.userCode=` float getValue(${i.map(h=>"int "+h)}) { ${m} } @@ -2192,7 +2192,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(result); } - `}};function Fh(r,t,e){let o=r.indexOf(t);return r.map((s,a)=>a===o?`${s} - ${e}`:s).join()}function wp(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.texData.get(o.dataId);return Dt({inputs:{x:n.complexTensorInfos.imag},backend:e})}var PA={kernelName:Vi,backendName:"webgl",kernelFunc:wp};function Bc(r,t,e){let o=r[0].dtype;if(o==="complex64"){let d=r.map(b=>yi({inputs:{input:b},backend:e})),f=r.map(b=>wp({inputs:{input:b},backend:e})),h=Bc(d,t,e),g=Bc(f,t,e),x=Pr({inputs:{real:h,imag:g},backend:e});return d.forEach(b=>e.disposeIntermediateTensorInfo(b)),f.forEach(b=>e.disposeIntermediateTensorInfo(b)),e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(g),x}let n=e.shouldExecuteOnCPU(r);if(o==="string"&&(n=!0),n){let d=r.map(S=>{let _=[-1,y.sizeFromShape(S.shape.slice(t))];return te({inputs:{x:S},backend:e,attrs:{shape:_}})}),f=d.map(S=>({vals:e.readSync(S.dataId),shape:S.shape})),h=w.computeOutShape(d.map(S=>S.shape),1),g=d[0].shape[0]===1,x=MR(f,h,o,g),b=w.computeOutShape(r.map(S=>S.shape),t),C=e.makeTensorInfo(b,o,x);return d.forEach(S=>e.disposeIntermediateTensorInfo(S)),C}let s=r.filter(d=>y.sizeFromShape(d.shape)>0),a=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(s.length===1){let d=a?new tr(r[0].shape,La):new Ar(r[0].shape,La);return e.runWebGLProgram(d,r,o)}let i=A().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>i){let d=[];for(let h=0;hf.shape),t);return e.runWebGLProgram(d,s,o)}let{tensors2D:p,outShape:u}=Z9(s,t,e),c=new Ah(p.map(d=>d.shape)),l=e.runWebGLProgram(c,p,o);p.forEach(d=>e.disposeIntermediateTensorInfo(d));let m=te({inputs:{x:l},attrs:{shape:u},backend:e});return e.disposeIntermediateTensorInfo(l),m}function Z9(r,t,e){let o=w.computeOutShape(r.map(s=>s.shape),t);return{tensors2D:r.map(s=>te({inputs:{x:s},attrs:{shape:[-1,y.sizeFromShape(s.shape.slice(t))]},backend:e})),outShape:o}}function Iv(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,t[0].shape)[0],a=t.map(u=>u.shape);w.assertParamsConsistent(a,s);let i=w.computeOutShape(t.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return e.makeTensorInfo(i,t[0].dtype,[]);let p=t.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?Dt({inputs:{x:p[0]},backend:e}):Bc(p,s,e)}var OA={kernelName:ta,backendName:"webgl",kernelFunc:Iv};var zc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.outputShape=t.outShape;let a=t.padInfo.top,i=t.padInfo.left,p=t.strideHeight,u=t.strideWidth,c=t.dilationHeight,l=t.dilationWidth,m=t.filterHeight,d=t.filterWidth,f=Math.floor(t.inChannels/4)*4,h=t.inChannels%4,g=t.dataFormat==="channelsLast",x=g?1:2,b=g?2:3,C=g?3:1,S="",k="";o&&(n?S=`float activation(float a) { + `}};function Kh(r,e,t){let o=r.indexOf(e);return r.map((s,a)=>a===o?`${s} - ${t}`:s).join()}function Ep(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.texData.get(o.dataId);return Ft({inputs:{x:n.complexTensorInfos.imag},backend:t})}var NF={kernelName:Qi,backendName:"webgl",kernelFunc:Ep};function Kl(r,e,t){let o=r[0].dtype;if(o==="complex64"){let d=r.map(b=>_i({inputs:{input:b},backend:t})),f=r.map(b=>Ep({inputs:{input:b},backend:t})),h=Kl(d,e,t),g=Kl(f,e,t),x=zr({inputs:{real:h,imag:g},backend:t});return d.forEach(b=>t.disposeIntermediateTensorInfo(b)),f.forEach(b=>t.disposeIntermediateTensorInfo(b)),t.disposeIntermediateTensorInfo(h),t.disposeIntermediateTensorInfo(g),x}let n=t.shouldExecuteOnCPU(r);if(o==="string"&&(n=!0),n){let d=r.map(S=>{let T=[-1,y.sizeFromShape(S.shape.slice(e))];return te({inputs:{x:S},backend:t,attrs:{shape:T}})}),f=d.map(S=>({vals:t.readSync(S.dataId),shape:S.shape})),h=C.computeOutShape(d.map(S=>S.shape),1),g=d[0].shape[0]===1,x=_D(f,h,o,g),b=C.computeOutShape(r.map(S=>S.shape),e),w=t.makeTensorInfo(b,o,x);return d.forEach(S=>t.disposeIntermediateTensorInfo(S)),w}let s=r.filter(d=>y.sizeFromShape(d.shape)>0),a=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&s[0].shape.length>1;if(s.length===1){let d=a?new nr(r[0].shape,Ha):new Lr(r[0].shape,Ha);return t.runWebGLProgram(d,r,o)}let i=A().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(s.length>i){let d=[];for(let h=0;hf.shape),e);return t.runWebGLProgram(d,s,o)}let{tensors2D:p,outShape:u}=kee(s,e,t),l=new Hh(p.map(d=>d.shape)),c=t.runWebGLProgram(l,p,o);p.forEach(d=>t.disposeIntermediateTensorInfo(d));let m=te({inputs:{x:c},attrs:{shape:u},backend:t});return t.disposeIntermediateTensorInfo(c),m}function kee(r,e,t){let o=C.computeOutShape(r.map(s=>s.shape),e);return{tensors2D:r.map(s=>te({inputs:{x:s},attrs:{shape:[-1,y.sizeFromShape(s.shape.slice(e))]},backend:t})),outShape:o}}function M0(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,e[0].shape)[0],a=e.map(u=>u.shape);C.assertParamsConsistent(a,s);let i=C.computeOutShape(e.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return t.makeTensorInfo(i,e[0].dtype,[]);let p=e.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?Ft({inputs:{x:p[0]},backend:t}):Kl(p,s,t)}var TF={kernelName:pa,backendName:"webgl",kernelFunc:M0};var ql=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let a=e.padInfo.top,i=e.padInfo.left,p=e.strideHeight,u=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,m=e.filterHeight,d=e.filterWidth,f=Math.floor(e.inChannels/4)*4,h=e.inChannels%4,g=e.dataFormat==="channelsLast",x=g?1:2,b=g?2:3,w=g?3:1,S="",k="";o&&(n?S=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${o} }`:s?S=`float activation(float a) { @@ -2202,7 +2202,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float activation(float x) { ${o} } - `,k="result = activation(result);");let _=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + `,k="result = activation(result);");let T=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${S} const ivec2 strides = ivec2(${p}, ${u}); @@ -2211,7 +2211,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; - int d2 = coords[${C}]; + int d2 = coords[${w}]; ivec2 xRCCorner = ivec2(coords[${x}], coords[${b}]) * strides - pads; @@ -2222,16 +2222,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR < ${m}; wR++) { - int xR = xRCorner + wR * ${c}; + int xR = xRCorner + wR * ${l}; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${d}; wC++) { - int xC = xCCorner + wC * ${l}; + int xC = xCCorner + wC * ${c}; - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -2322,13 +2322,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } float result = dotProd; - ${_} + ${T} ${k} setOutput(result); } - `}},Oh=class{constructor(t){this.variableNames=["x","W"],this.outputShape=t.outShape;let e=t.padInfo.front,o=t.padInfo.top,n=t.padInfo.left,s=t.strideDepth,a=t.strideHeight,i=t.strideWidth,p=t.dilationDepth,u=t.dilationHeight,c=t.dilationWidth,l=t.filterDepth,m=t.filterHeight,d=t.filterWidth,f=Math.floor(t.inChannels/4)*4,h=t.inChannels%4;this.userCode=` + `}},jh=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,o=e.padInfo.top,n=e.padInfo.left,s=e.strideDepth,a=e.strideHeight,i=e.strideWidth,p=e.dilationDepth,u=e.dilationHeight,l=e.dilationWidth,c=e.filterDepth,m=e.filterHeight,d=e.filterWidth,f=Math.floor(e.inChannels/4)*4,h=e.inChannels%4;this.userCode=` const ivec3 strides = ivec3(${s}, ${a}, ${i}); - const ivec3 pads = ivec3(${e}, ${o}, ${n}); + const ivec3 pads = ivec3(${t}, ${o}, ${n}); void main() { ivec5 coords = getOutputCoords(); @@ -2344,24 +2344,24 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam // y(yF, yR, yC, d2). ? = to be determined. : = across all // values in that axis. float dotProd = 0.0; - for (int wF = 0; wF < ${l}; wF++) { + for (int wF = 0; wF < ${c}; wF++) { int xF = xFCorner + wF * ${p}; - if (xF < 0 || xF >= ${t.inDepth}) { + if (xF < 0 || xF >= ${e.inDepth}) { continue; } for (int wR = 0; wR < ${m}; wR++) { int xR = xRCorner + wR * ${u}; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC < ${d}; wC++) { - int xC = xCCorner + wC * ${c}; + int xC = xCCorner + wC * ${l}; - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -2414,17 +2414,17 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}};var Vc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=t.outShape,this.enableShapeUniforms=ut(this.outputShape.length);let a=t.padInfo.left,i=t.strideWidth,p=t.dilationWidth,u=t.filterHeight,c=t.filterWidth,l=c,m=` + `}};var jl=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=lt(this.outputShape.length);let a=e.padInfo.left,i=e.strideWidth,p=e.dilationWidth,u=e.filterHeight,l=e.filterWidth,c=l,m=` int xR; int xC; int xCOffset; - vec4 wTexel; vec4 previous; vec4 final;`;for(let g=0;g=0 && xR < inDims[0]) { - `;for(let g=0;g<(l+1)/2;g++){let x=g*2;if(m+=` + `;for(let g=0;g<(c+1)/2;g++){let x=g*2;if(m+=` xC = xCCorner + ${x*p}; - `,i===1){if(x= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) { xTexelC${x} = getX(batch, xR, xCOffset, d1); @@ -2474,7 +2474,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } xC${x} = xTexelC${x}; - `,x+1= 0 && xCOffset < inDims[1] && xTexelC${x+1}Ready == 0) { @@ -2511,7 +2511,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } xC${x+1} = xTexelC${x+1}; - `}}else x= 0 && xCOffset < inDims[1] && xTexelC${x}Ready == 0) { xTexelC${x} = getX(batch, xR, xCOffset, d1); @@ -2534,7 +2534,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } xC${x} = vec4(xTexelC${x}.zw, xTexelC${x+1}.zw); - `,x+1= 0 && xCOffset < inDims[1]) { @@ -2561,18 +2561,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam xC${x} = vec4( xTexelC${x}.xy, xTexelC${x+1}.xy); - `,x+1=3?t?[...r.slice(0,-3),r[e-3]*r[e-2],r[e-1]]:[...r.slice(0,-3),r[e-3],r[e-2]*r[e-1]]:!t&&e===1&&r[0]>1?[r[0],1]:null}function Bh({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=r.shape,u=o.texData.get(r.dataId),c=e.inChannels,l=p[0]*p[1]*p[2],m=e.outChannels,d=e.dataFormat==="channelsLast",f=!1,h=!1,g,x=[];if(s!=null){let S=Lh(s.shape,d);S!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:S}}),x.push(s))}if(n!=null){let S=Lh(n.shape,d);S!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:S}}),x.push(n))}if(!((l===1||m===1)&&c>bv)&&u.isPacked&&d&&u.texture!=null&&p[2]%2!==0&&y.arraysEqual(u.shape.slice(-3),p.slice(-3))){let S=p[0]*p[1]*(p[2]+1),k={dataId:r.dataId,shape:[1,S,e.inChannels],dtype:r.dtype},_=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,y.assert(hu(u.shape,k.shape),()=>`packed reshape ${u.shape} to ${k.shape} isn't free`);let E=te({inputs:{x:t},backend:o,attrs:{shape:[1,e.inChannels,e.outChannels]}});x.push(E);let R=Cp({a:k,b:E,backend:o,transposeA:f,transposeB:h,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),D=o.texData.get(R.dataId);y.assert(D.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=_,D.shape=e.outShape,g=Dt({inputs:{x:R},backend:o}),g.shape=e.outShape,x.push(R)}else{let S=e.outHeight*e.outWidth,k=te({inputs:{x:r},backend:o,attrs:{shape:d?[e.batchSize,S,e.inChannels]:[e.batchSize,e.inChannels,S]}}),_=te({inputs:{x:t},backend:o,attrs:{shape:[1,e.inChannels,e.outChannels]}}),E=Cp({a:d?k:_,b:d?_:k,transposeA:!d,transposeB:h,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});g=te({inputs:{x:E},backend:o,attrs:{shape:e.outShape}}),x.push(k),x.push(_),x.push(E)}for(let S of x)o.disposeIntermediateTensorInfo(S);return g}function zh({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:c,outWidth:l,outHeight:m,dataFormat:d}=e,f=d==="channelsLast",h=p*u*c,g=m*l,x=[e.batchSize,h,g],b=!0,C=!1,S=[];if(s!=null){let q=Lh(s.shape,f);q!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:q}}),S.push(s))}if(n!=null){let q=Lh(n.shape,f);q!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:q}}),S.push(n))}let k=te({inputs:{x:t},backend:o,attrs:{shape:[1,h,y.sizeFromShape(t.shape)/h]}});S.push(k);let _=new Mh(x,e),E=[r.shape,[e.padInfo.top,e.padInfo.left],[e.strideHeight,e.strideWidth],[e.dilationHeight,e.dilationWidth],[e.inChannels],[e.filterWidth*e.inChannels],[e.outWidth]],R=o.runWebGLProgram(_,[r],"float32",E),D=te({inputs:{x:R},backend:o,attrs:{shape:x}});S.push(R),S.push(D);let P=n!=null,O=s!=null,M=i==="leakyrelu",L=i?xi(i,!0):null,B=new Lc(f?D.shape:k.shape,f?k.shape:D.shape,f?[e.batchSize,g,e.outChannels]:[e.batchSize,e.outChannels,g],b,C,P,L,O,M),z=f?[D,k]:[k,D];if(n&&z.push(n),O&&z.push(s),M){let q=o.makeTensorInfo([],"float32",y.createScalarValue(a,"float32"));z.push(q),S.push(q)}let U=o.runWebGLProgram(B,z,"float32"),j=te({inputs:{x:U},backend:o,attrs:{shape:e.outShape}});S.push(U);for(let q of S)o.disposeIntermediateTensorInfo(q);return j}function J9(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,s.shape,a,u,i,c,!1,l),d;if(m.filterHeight===1&&m.filterWidth===1&&m.dilationHeight===1&&m.dilationWidth===1&&m.strideHeight===1&&m.strideWidth===1&&(m.padInfo.type==="SAME"||m.padInfo.type==="VALID"))d=Bh({x:n,filter:s,convInfo:m,backend:e});else if(m.strideWidth<=2&&l==="channelsLast"&&A().getBool("WEBGL_EXP_CONV")){let h=new Vc(m),g=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]];d=e.runWebGLProgram(h,[n,s],"float32",g)}else if(A().getBool("WEBGL_CONV_IM2COL"))d=zh({x:n,filter:s,convInfo:m,backend:e});else{let h=new zc(m);d=e.runWebGLProgram(h,[n,s],"float32")}let f=te({inputs:{x:d},backend:e,attrs:{shape:m.outShape}});return e.disposeIntermediateTensorInfo(d),f}var MA={kernelName:tn,backendName:"webgl",kernelFunc:J9};var Vh=class{constructor(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;let e=t.strideHeight,o=t.strideWidth,n=t.padInfo.top,s=t.padInfo.left,a=t.dataFormat==="channelsLast";this.userCode=` + `}};function Yh(r,e){let t=r.length;return t>=3?e?[...r.slice(0,-3),r[t-3]*r[t-2],r[t-1]]:[...r.slice(0,-3),r[t-3],r[t-2]*r[t-1]]:!e&&t===1&&r[0]>1?[r[0],1]:null}function Qh({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=r.shape,u=o.texData.get(r.dataId),l=t.inChannels,c=p[0]*p[1]*p[2],m=t.outChannels,d=t.dataFormat==="channelsLast",f=!1,h=!1,g,x=[];if(s!=null){let S=Yh(s.shape,d);S!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:S}}),x.push(s))}if(n!=null){let S=Yh(n.shape,d);S!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:S}}),x.push(n))}if(!((c===1||m===1)&&l>A0)&&u.isPacked&&d&&u.texture!=null&&p[2]%2!==0&&y.arraysEqual(u.shape.slice(-3),p.slice(-3))){let S=p[0]*p[1]*(p[2]+1),k={dataId:r.dataId,shape:[1,S,t.inChannels],dtype:r.dtype},T=u.shape;u.shape=u.shape.slice(),u.shape[u.shape.length-2]++,y.assert(vu(u.shape,k.shape),()=>`packed reshape ${u.shape} to ${k.shape} isn't free`);let E=te({inputs:{x:e},backend:o,attrs:{shape:[1,t.inChannels,t.outChannels]}});x.push(E);let R=_p({a:k,b:E,backend:o,transposeA:f,transposeB:h,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),D=o.texData.get(R.dataId);y.assert(D.isPacked,()=>"batchMatMul result is expected to be packed"),u.shape=T,D.shape=t.outShape,g=Ft({inputs:{x:R},backend:o}),g.shape=t.outShape,x.push(R)}else{let S=t.outHeight*t.outWidth,k=te({inputs:{x:r},backend:o,attrs:{shape:d?[t.batchSize,S,t.inChannels]:[t.batchSize,t.inChannels,S]}}),T=te({inputs:{x:e},backend:o,attrs:{shape:[1,t.inChannels,t.outChannels]}}),E=_p({a:d?k:T,b:d?T:k,transposeA:!d,transposeB:h,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});g=te({inputs:{x:E},backend:o,attrs:{shape:t.outShape}}),x.push(k),x.push(T),x.push(E)}for(let S of x)o.disposeIntermediateTensorInfo(S);return g}function Zh({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:l,outWidth:c,outHeight:m,dataFormat:d}=t,f=d==="channelsLast",h=p*u*l,g=m*c,x=[t.batchSize,h,g],b=!0,w=!1,S=[];if(s!=null){let q=Yh(s.shape,f);q!=null&&(s=te({inputs:{x:s},backend:o,attrs:{shape:q}}),S.push(s))}if(n!=null){let q=Yh(n.shape,f);q!=null&&(n=te({inputs:{x:n},backend:o,attrs:{shape:q}}),S.push(n))}let k=te({inputs:{x:e},backend:o,attrs:{shape:[1,h,y.sizeFromShape(e.shape)/h]}});S.push(k);let T=new Xh(x,t),E=[r.shape,[t.padInfo.top,t.padInfo.left],[t.strideHeight,t.strideWidth],[t.dilationHeight,t.dilationWidth],[t.inChannels],[t.filterWidth*t.inChannels],[t.outWidth]],R=o.runWebGLProgram(T,[r],"float32",E),D=te({inputs:{x:R},backend:o,attrs:{shape:x}});S.push(R),S.push(D);let F=n!=null,O=s!=null,M=i==="leakyrelu",L=i?Ti(i,!0):null,B=new Hl(f?D.shape:k.shape,f?k.shape:D.shape,f?[t.batchSize,g,t.outChannels]:[t.batchSize,t.outChannels,g],b,w,F,L,O,M),z=f?[D,k]:[k,D];if(n&&z.push(n),O&&z.push(s),M){let q=o.makeTensorInfo([],"float32",y.createScalarValue(a,"float32"));z.push(q),S.push(q)}let U=o.runWebGLProgram(B,z,"float32"),j=te({inputs:{x:U},backend:o,attrs:{shape:t.outShape}});S.push(U);for(let q of S)o.disposeIntermediateTensorInfo(q);return j}function Nee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,s.shape,a,u,i,l,!1,c),d;if(m.filterHeight===1&&m.filterWidth===1&&m.dilationHeight===1&&m.dilationWidth===1&&m.strideHeight===1&&m.strideWidth===1&&(m.padInfo.type==="SAME"||m.padInfo.type==="VALID"))d=Qh({x:n,filter:s,convInfo:m,backend:t});else if(m.strideWidth<=2&&c==="channelsLast"&&A().getBool("WEBGL_EXP_CONV")){let h=new jl(m),g=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]];d=t.runWebGLProgram(h,[n,s],"float32",g)}else if(A().getBool("WEBGL_CONV_IM2COL"))d=Zh({x:n,filter:s,convInfo:m,backend:t});else{let h=new ql(m);d=t.runWebGLProgram(h,[n,s],"float32")}let f=te({inputs:{x:d},backend:t,attrs:{shape:m.outShape}});return t.disposeIntermediateTensorInfo(d),f}var _F={kernelName:En,backendName:"webgl",kernelFunc:Nee};var Jh=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,o=e.strideWidth,n=e.padInfo.top,s=e.padInfo.left,a=e.dataFormat==="channelsLast";this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -2669,18 +2669,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int b = 0; b < ${t.batchSize}; b++) { - for (int yR = 0; yR < ${t.outHeight}; yR++) { - int xR = wR + yR * ${e} - ${n}; + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { + int xR = wR + yR * ${t} - ${n}; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int yC = 0; yC < ${t.outWidth}; yC++) { + for (int yC = 0; yC < ${e.outWidth}; yC++) { int xC = wC + yC * ${o} - ${s}; - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -2694,35 +2694,35 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}},Wh=class{constructor(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;let e=t.filterHeight,o=t.filterWidth,n=t.strideHeight,s=t.strideWidth,a=t.dataFormat==="channelsLast",i=e-1-t.padInfo.top,p=o-1-t.padInfo.left,u=a?1:2,c=a?2:3,l=a?3:1;this.userCode=` + `}},eg=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,o=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=e.dataFormat==="channelsLast",i=t-1-e.padInfo.top,p=o-1-e.padInfo.left,u=a?1:2,l=a?2:3,c=a?3:1;this.userCode=` const ivec2 pads = ivec2(${i}, ${p}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; - int d1 = coords[${l}]; + int d1 = coords[${c}]; - ivec2 dyCorner = ivec2(coords[${u}], coords[${c}]) - pads; + ivec2 dyCorner = ivec2(coords[${u}], coords[${l}]) - pads; int dyRCorner = dyCorner.x; int dyCCorner = dyCorner.y; // Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; - for (int wR = 0; wR < ${e}; wR++) { + for (int wR = 0; wR < ${t}; wR++) { float dyR = float(dyRCorner + wR) / ${n}.0; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - int wRPerm = ${e} - 1 - wR; + int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC < ${o}; wC++) { float dyC = float(dyCCorner + wC) / ${s}.0; - if (dyC < 0.0 || dyC >= ${t.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -2730,7 +2730,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int wCPerm = ${o} - 1 - wC; - for (int d2 = 0; d2 < ${t.outChannels}; d2++) { + for (int d2 = 0; d2 < ${e.outChannels}; d2++) { if (${a}) { float xValue = getDy(batch, idyR, idyC, d2); @@ -2747,7 +2747,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}},Uh=class{constructor(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;let e=t.strideDepth,o=t.strideHeight,n=t.strideWidth,s=t.padInfo.front,a=t.padInfo.top,i=t.padInfo.left;this.userCode=` + `}},tg=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,o=e.strideHeight,n=e.strideWidth,s=e.padInfo.front,a=e.padInfo.top,i=e.padInfo.left;this.userCode=` void main() { ivec5 coords = getOutputCoords(); int wF = coords.x; @@ -2758,25 +2758,25 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float dotProd = 0.0; - for (int b = 0; b < ${t.batchSize}; b++) { - for (int yF = 0; yF < ${t.outDepth}; yF++) { - int xF = wF + yF * ${e} - ${s}; + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yF = 0; yF < ${e.outDepth}; yF++) { + int xF = wF + yF * ${t} - ${s}; - if (xF < 0 || xF >= ${t.inDepth}) { + if (xF < 0 || xF >= ${e.inDepth}) { continue; } - for (int yR = 0; yR < ${t.outHeight}; yR++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { int xR = wR + yR * ${o} - ${a}; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int yC = 0; yC < ${t.outWidth}; yC++) { + for (int yC = 0; yC < ${e.outWidth}; yC++) { int xC = wC + yC * ${n} - ${i}; - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -2789,8 +2789,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}},Gh=class{constructor(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;let e=t.filterDepth,o=t.filterHeight,n=t.filterWidth,s=t.strideDepth,a=t.strideHeight,i=t.strideWidth,p=e-1-t.padInfo.front,u=o-1-t.padInfo.top,c=n-1-t.padInfo.left;this.userCode=` - const ivec3 pads = ivec3(${p}, ${u}, ${c}); + `}},rg=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,o=e.filterHeight,n=e.filterWidth,s=e.strideDepth,a=e.strideHeight,i=e.strideWidth,p=t-1-e.padInfo.front,u=o-1-e.padInfo.top,l=n-1-e.padInfo.left;this.userCode=` + const ivec3 pads = ivec3(${p}, ${u}, ${l}); void main() { ivec5 coords = getOutputCoords(); @@ -2804,20 +2804,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int dyCCorner = dyCorner.z; float dotProd = 0.0; - for (int wF = 0; wF < ${e}; wF++) { + for (int wF = 0; wF < ${t}; wF++) { float dyF = float(dyFCorner + wF) / ${s}.0; - if (dyF < 0.0 || dyF >= ${t.outDepth}.0 || fract(dyF) > 0.0) { + if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) { continue; } int idyF = int(dyF); - int wFPerm = ${e} - 1 - wF; + int wFPerm = ${t} - 1 - wF; for (int wR = 0; wR < ${o}; wR++) { float dyR = float(dyRCorner + wR) / ${a}.0; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } @@ -2828,7 +2828,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam for (int wC = 0; wC < ${n}; wC++) { float dyC = float(dyCCorner + wC) / ${i}.0; - if (dyC < 0.0 || dyC >= ${t.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -2836,7 +2836,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int wCPerm = ${n} - 1 - wC; - for (int d2 = 0; d2 < ${t.outChannels}; d2++) { + for (int d2 = 0; d2 < ${e.outChannels}; d2++) { float xValue = getDy(batch, idyF, idyR, idyC, d2); float wValue = getW(wFPerm, wRPerm, wCPerm, d1, d2); dotProd += xValue * wValue; @@ -2846,7 +2846,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}};function eJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:c}=o,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,c,a,1,i,u,!1,l),d=new Vh(m);return e.runWebGLProgram(d,[n,s],"float32")}var LA={kernelName:Ai,backendName:"webgl",kernelFunc:eJ};var Hh=class{constructor(t){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=t.inShape,this.enableShapeUniforms=ut(this.outputShape.length);let e=t.filterHeight,o=t.filterWidth,n=e-1-t.padInfo.top,s=o-1-t.padInfo.left;this.userCode=` + `}};function Tee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:l}=o,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,l,a,1,i,u,!1,c),d=new Jh(m);return t.runWebGLProgram(d,[n,s],"float32")}var EF={kernelName:Ui,backendName:"webgl",kernelFunc:Tee};var og=class{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=lt(this.outputShape.length);let t=e.filterHeight,o=e.filterWidth,n=t-1-e.padInfo.top,s=o-1-e.padInfo.left;this.userCode=` const ivec2 pads = ivec2(${n}, ${s}); void main() { @@ -2859,29 +2859,29 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int dyCCorner = dyCorner.y; vec4 result = vec4(0.); - for (int wR = 0; wR < ${e}; wR++) { + for (int wR = 0; wR < ${t}; wR++) { float dyR = float(dyRCorner + wR) / strides[0]; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - int wRPerm = ${e} - 1 - wR; + int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC < ${o}; wC++) { int wCPerm = ${o} - 1 - wC; float dyC = float(dyCCorner + wC) / strides[1]; - bool idyCVal = (dyC >= 0.0) && (dyC < ${t.outWidth}.0) + bool idyCVal = (dyC >= 0.0) && (dyC < ${e.outWidth}.0) && (fract(dyC) == 0.0); int idyC = int(dyC); float dyC2 = float(dyCCorner + wC + 1) / strides[1]; - bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${t.outWidth}.0) + bool idyCVal2 = (dyC2 >= 0.0) && (dyC2 < ${e.outWidth}.0) && (fract(dyC2) == 0.0); int idyC2 = int(dyC2); if (idyCVal && idyCVal2) { - for (int d2 = 0; d2 < ${t.outChannels}; d2 += 2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { vec4 wValue = getW(wRPerm, wCPerm, d1, d2); vec4 dySample = getDy(batch, idyR, idyC, d2); vec4 dySample2 = (idyC / 2 == idyC2 / 2) ? @@ -2898,7 +2898,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam dot(dyValue, wValue.zw)); } } else if (idyCVal) { - for (int d2 = 0; d2 < ${t.outChannels}; d2 += 2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { vec4 wValue = getW(wRPerm, wCPerm, d1, d2); vec4 dySample = getDy(batch, idyR, idyC, d2); vec2 dyValue = mod(float(idyC), 2.) == 0. ? @@ -2907,7 +2907,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam dot(dyValue, wValue.zw)); } } else if (idyCVal2) { - for (int d2 = 0; d2 < ${t.outChannels}; d2 += 2) { + for (int d2 = 0; d2 < ${e.outChannels}; d2 += 2) { vec4 wValue = getW(wRPerm, wCPerm, d1, d2); vec4 dySample = getDy(batch, idyR, idyC2, d2); vec2 dyValue = mod(float(idyC2), 2.) == 0. ? @@ -2920,19 +2920,19 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(result); } - `}};function tJ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(u),m=w.computeConv2DInfo(a,s.shape,i,1,p,c,!1,l);if(A().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&l==="channelsLast"){let d=[[m.strideHeight,m.strideWidth]],f=new Hh(m);return e.runWebGLProgram(f,[n,s],"float32",d)}else{let d=new Wh(m);return e.runWebGLProgram(d,[n,s],"float32")}}var BA={kernelName:rn,backendName:"webgl",kernelFunc:tJ};function rJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeConv3DInfo(n.shape,s.shape,a,p,i),c=new Oh(u);return e.runWebGLProgram(c,[n,s],"float32")}var zA={kernelName:on,backendName:"webgl",kernelFunc:rJ};function oJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,filterShape:p}=o,u=w.computeConv3DInfo(n.shape,p,a,1,i),c=new Uh(u);return e.runWebGLProgram(c,[n,s],"float32")}var VA={kernelName:ja,backendName:"webgl",kernelFunc:oJ};function nJ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{pad:a,strides:i,inputShape:p}=o,u=w.computeConv3DInfo(p,s.shape,i,1,a),c=new Gh(u);return e.runWebGLProgram(c,[n,s],"float32")}var WA={kernelName:nn,backendName:"webgl",kernelFunc:nJ};var sJ=Fo+` + `}};function _ee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(u),m=C.computeConv2DInfo(a,s.shape,i,1,p,l,!1,c);if(A().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&c==="channelsLast"){let d=[[m.strideHeight,m.strideWidth]],f=new og(m);return t.runWebGLProgram(f,[n,s],"float32",d)}else{let d=new eg(m);return t.runWebGLProgram(d,[n,s],"float32")}}var $F={kernelName:$n,backendName:"webgl",kernelFunc:_ee};function Eee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeConv3DInfo(n.shape,s.shape,a,p,i),l=new jh(u);return t.runWebGLProgram(l,[n,s],"float32")}var RF={kernelName:Rn,backendName:"webgl",kernelFunc:Eee};function $ee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,filterShape:p}=o,u=C.computeConv3DInfo(n.shape,p,a,1,i),l=new tg(u);return t.runWebGLProgram(l,[n,s],"float32")}var DF={kernelName:ti,backendName:"webgl",kernelFunc:$ee};function Ree(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{pad:a,strides:i,inputShape:p}=o,u=C.computeConv3DInfo(p,s.shape,i,1,a),l=new rg(u);return t.runWebGLProgram(l,[n,s],"float32")}var AF={kernelName:Dn,backendName:"webgl",kernelFunc:Ree};var Dee=sn+` return cos(x); -`,aJ=` +`,Aee=` vec4 result = cos(x); bvec4 isNaN = isnan(x); - ${jr} + ${to} return result; -`,iJ=xe({opSnippet:sJ,packedOpSnippet:aJ}),UA={kernelName:sn,backendName:"webgl",kernelFunc:iJ};var uJ=` +`,Fee=xe({opSnippet:Dee,packedOpSnippet:Aee}),FF={kernelName:An,backendName:"webgl",kernelFunc:Fee};var Pee=` float e2x = exp(-x); return (e2x + 1.0 / e2x) / 2.0; -`,pJ=xe({opSnippet:uJ}),GA={kernelName:an,backendName:"webgl",kernelFunc:pJ};var Kh=class{constructor(t,e,o,n,s){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[a,i,p,u]=t,[c]=e,[l,m]=o;this.outputShape=[c,l,m,u];let d=n==="bilinear"?1:0,[f,h]=[`${i-1}.0`,`${p-1}.0`],[g,x,b]=l>1?[`${(i-1)/(l-1)}`,"(y2-y1) * height_ratio",`y1*${f} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${f}`],[C,S,k]=m>1?[`${(p-1)/(m-1)}`,"(x2-x1) * width_ratio",`x1*${h} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${h}`];this.userCode=` +`,Oee=xe({opSnippet:Pee}),PF={kernelName:Fn,backendName:"webgl",kernelFunc:Oee};var ng=class{constructor(e,t,o,n,s){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[a,i,p,u]=e,[l]=t,[c,m]=o;this.outputShape=[l,c,m,u];let d=n==="bilinear"?1:0,[f,h]=[`${i-1}.0`,`${p-1}.0`],[g,x,b]=c>1?[`${(i-1)/(c-1)}`,"(y2-y1) * height_ratio",`y1*${f} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${f}`],[w,S,k]=m>1?[`${(p-1)/(m-1)}`,"(x2-x1) * width_ratio",`x1*${h} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${h}`];this.userCode=` const float height_ratio = float(${g}); - const float width_ratio = float(${C}); + const float width_ratio = float(${w}); void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -2991,20 +2991,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam setOutput(newValue); } } - `}};var cJ=r=>{let{inputs:t,backend:e,attrs:o}=r,{image:n,boxes:s,boxInd:a}=t,{cropSize:i,method:p,extrapolationValue:u}=o,c=new Kh(n.shape,s.shape,i,p,u);return e.runWebGLProgram(c,[n,s,a],"float32")},HA={kernelName:cn,backendName:"webgl",kernelFunc:cJ};var Sp;(function(r){r.Prod="*",r.Sum="+"})(Sp||(Sp={}));var tm=class{constructor(t,e,o,n){this.op=t,this.outputShape=e,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];let s=this.outputShape.length,a=this.op===Sp.Prod?"1.0":"0.0",i=o?a:`getX(${KA(s,"coords",this.op)})`,p=this.outputShape[this.outputShape.length-1],u="",c="";o?(u=n?`end != ${p-1}`:"end != 0",c=n?"end + 1":"end - 1"):(u=n?`end + pow2 < ${p}`:"end >= pow2",c=n?"end + pow2":"end - pow2"),this.userCode=` + `}};var Mee=r=>{let{inputs:e,backend:t,attrs:o}=r,{image:n,boxes:s,boxInd:a}=e,{cropSize:i,method:p,extrapolationValue:u}=o,l=new ng(n.shape,s.shape,i,p,u);return t.runWebGLProgram(l,[n,s,a],"float32")},OF={kernelName:Mn,backendName:"webgl",kernelFunc:Mee};var $p;(function(r){r.Prod="*",r.Sum="+"})($p||($p={}));var lm=class{constructor(e,t,o,n){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];let s=this.outputShape.length,a=this.op===$p.Prod?"1.0":"0.0",i=o?a:`getX(${MF(s,"coords",this.op)})`,p=this.outputShape[this.outputShape.length-1],u="",l="";o?(u=n?`end != ${p-1}`:"end != 0",l=n?"end + 1":"end - 1"):(u=n?`end + pow2 < ${p}`:"end >= pow2",l=n?"end + pow2":"end - pow2"),this.userCode=` void main() { ${Re(s)} coords = getOutputCoords(); - int end = ${qA(s,"coords",this.op)}; + int end = ${LF(s,"coords",this.op)}; float val = ${i}; int pow2 = int(pow(2.0, index)); if (${u}) { - int idx = ${c}; - ${qA(s,"coords",this.op)} = idx; - val ${this.op}= getX(${KA(s,"coords",this.op)}); + int idx = ${l}; + ${LF(s,"coords",this.op)} = idx; + val ${this.op}= getX(${MF(s,"coords",this.op)}); } setOutput(val); } - `}};function KA(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.x, ${t}.y`;if(r===3)return`${t}.x, ${t}.y, ${t}.z`;if(r===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw new Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function qA(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.y`;if(r===3)return`${t}.z`;if(r===4)return`${t}.w`;throw new Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function qh(r,t,e,o,n,s){let a=t.shape.length,i=w.getAxesPermutation([o],a),p=t;i!=null&&(p=bt({inputs:{x:t},backend:e,attrs:{perm:i}}));let u=w.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${o}`);let c=p.shape[u],l=Dt({inputs:{x:p},backend:e});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let d=new tm(r,p.shape,!1,s),f=[[m]],h=l;l=e.runWebGLProgram(d,[l],l.dtype,f),e.disposeIntermediateTensorInfo(h)}if(n){let m=new tm(r,p.shape,n,s),d=l;l=e.runWebGLProgram(m,[l],l.dtype),e.disposeIntermediateTensorInfo(d)}if(i!=null){let m=w.getUndoAxesPermutation(i),d=bt({inputs:{x:l},backend:e,attrs:{perm:m}});return e.disposeIntermediateTensorInfo(l),e.disposeIntermediateTensorInfo(p),d}return l}function lJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return qh(Sp.Prod,n,e,s,a,i)}var jA={kernelName:un,backendName:"webgl",kernelFunc:lJ};function mJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return qh(Sp.Sum,n,e,s,a,i)}var XA={kernelName:pn,backendName:"webgl",kernelFunc:mJ};function dJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a,binaryOutput:i}=o;if(n.shape.length===1){let p=e.readSync(n.dataId),u=e.readSync(s.dataId),c=uh(p,u,s.dtype,s.shape,a);return e.makeTensorInfo([a],s.dtype,c)}else if(n.shape.length===2){let p=e.bufferSync(n),u=e.bufferSync(s),c=AR(p,u,a,i);return e.makeTensorInfo(c.shape,s.dtype,c.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${n.shape.length}.`)}var YA={kernelName:ra,backendName:"webgl",kernelFunc:dJ};var jh=class{constructor(t,e,o){this.variableNames=["x"],this.outputShape=[],this.outputShape=t,this.blockSize=e,this.dataFormat=o,this.userCode=` + `}};function MF(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.x, ${e}.y`;if(r===3)return`${e}.x, ${e}.y, ${e}.z`;if(r===4)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw new Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function LF(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.y`;if(r===3)return`${e}.z`;if(r===4)return`${e}.w`;throw new Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function sg(r,e,t,o,n,s){let a=e.shape.length,i=C.getAxesPermutation([o],a),p=e;i!=null&&(p=Ct({inputs:{x:e},backend:t,attrs:{perm:i}}));let u=C.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGL cumprod shader expects an inner-most axis=${e.shape.length-1} but got axis=${o}`);let l=p.shape[u],c=Ft({inputs:{x:p},backend:t});for(let m=0;m<=Math.ceil(Math.log2(l))-1;m++){let d=new lm(r,p.shape,!1,s),f=[[m]],h=c;c=t.runWebGLProgram(d,[c],c.dtype,f),t.disposeIntermediateTensorInfo(h)}if(n){let m=new lm(r,p.shape,n,s),d=c;c=t.runWebGLProgram(m,[c],c.dtype),t.disposeIntermediateTensorInfo(d)}if(i!=null){let m=C.getUndoAxesPermutation(i),d=Ct({inputs:{x:c},backend:t,attrs:{perm:m}});return t.disposeIntermediateTensorInfo(c),t.disposeIntermediateTensorInfo(p),d}return c}function Lee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return sg($p.Prod,n,t,s,a,i)}var BF={kernelName:Pn,backendName:"webgl",kernelFunc:Lee};function Bee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return sg($p.Sum,n,t,s,a,i)}var zF={kernelName:On,backendName:"webgl",kernelFunc:Bee};function zee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a,binaryOutput:i}=o;if(n.shape.length===1){let p=t.readSync(n.dataId),u=t.readSync(s.dataId),l=Ch(p,u,s.dtype,s.shape,a);return t.makeTensorInfo([a],s.dtype,l)}else if(n.shape.length===2){let p=t.bufferSync(n),u=t.bufferSync(s),l=vD(p,u,a,i);return t.makeTensorInfo(l.shape,s.dtype,l.values)}throw new Error(`Error in denseBincount: input must be at most rank 2, but got rank${n.shape.length}.`)}var VF={kernelName:la,backendName:"webgl",kernelFunc:zee};var ag=class{constructor(e,t,o){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=o,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3012,18 +3012,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int w = ${this.getWidthCoordString()}; int d = ${this.getDepthCoordString()}; - int in_h = h / ${e}; - int offset_h = imod(h, ${e}); - int in_w = w / ${e}; - int offset_w = imod(w, ${e}); - int offset_d = (offset_h * ${e} + offset_w) * + int in_h = h / ${t}; + int offset_h = imod(h, ${t}); + int in_w = w / ${t}; + int offset_w = imod(w, ${t}); + int offset_d = (offset_h * ${t} + offset_w) * ${this.getOutputDepthSize()}; int in_d = d + offset_d; 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 fJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a==="NHWC"?n.shape[1]:n.shape[2],u=a==="NHWC"?n.shape[2]:n.shape[3],c=a==="NHWC"?n.shape[3]:n.shape[1],l=p*s,m=u*s,d=c/(s*s),f=a==="NHWC"?[i,l,m,d]:[i,d,l,m],h=new jh(f,s,a);return e.runWebGLProgram(h,[n],n.dtype)}var QA={kernelName:ln,backendName:"webgl",kernelFunc:fJ};var Wc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=t.outShape,this.enableShapeUniforms=ut(this.outputShape.length);let a=t.filterHeight,i=t.filterWidth,p=t.outChannels/t.inChannels,u="",c="";o&&(n?u=`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 Vee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a==="NHWC"?n.shape[1]:n.shape[2],u=a==="NHWC"?n.shape[2]:n.shape[3],l=a==="NHWC"?n.shape[3]:n.shape[1],c=p*s,m=u*s,d=l/(s*s),f=a==="NHWC"?[i,c,m,d]:[i,d,c,m],h=new ag(f,s,a);return t.runWebGLProgram(h,[n],n.dtype)}var WF={kernelName:Ln,backendName:"webgl",kernelFunc:Vee};var Xl=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=lt(this.outputShape.length);let a=e.filterHeight,i=e.filterWidth,p=e.outChannels/e.inChannels,u="",l="";o&&(n?u=`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${o} }`:s?u=`float activation(float a) { @@ -3033,7 +3033,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float activation(float x) { ${o} } - `,c="result = activation(result);");let l=e?"result += getBiasAtOutCoords();":"";e&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` + `,l="result = activation(result);");let c=t?"result += getBiasAtOutCoords();":"";t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${u} void main() { @@ -3072,20 +3072,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } float result = dotProd; - ${l} ${c} + ${l} setOutput(result); } - `}};var Uc=class{constructor(t,e=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=t.outShape,this.enableShapeUniforms=ut(this.outputShape.length);let a=t.outChannels/t.inChannels,i=t.padInfo.left,p=t.strideWidth,u=t.dilationWidth,c=t.filterHeight,l=t.filterWidth,m=l,d=` + `}};var Yl=class{constructor(e,t=!1,o=null,n=!1,s=!1){this.variableNames=["x","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"pads",type:"ivec2"},{name:"strides",type:"ivec2"},{name:"dilations",type:"ivec2"},{name:"inDims",type:"ivec2"}],this.outputShape=e.outShape,this.enableShapeUniforms=lt(this.outputShape.length);let a=e.outChannels/e.inChannels,i=e.padInfo.left,p=e.strideWidth,u=e.dilationWidth,l=e.filterHeight,c=e.filterWidth,m=c,d=` int xR; int xC; int xCOffset; - vec4 wTexel; vec4 previous; vec4 final;`;for(let x=0;x=0 && xR < inDims[0]) { `;for(let x=0;x<(m+1)/2;x++){let b=x*2;if(d+=` xC = xCCorner + ${b*u}; - `,p===1){if(b= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) { xTexelC${b} = getX(batch, xR, xCOffset, d1); @@ -3135,8 +3135,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } xC${b} = xTexelC${b}; - `,b+1= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) { xTexelC${b+1} = getX(batch, xR, xCOffset, d1); @@ -3158,10 +3158,10 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } `:d+=` xC${b+1} = vec4(xTexelC${b}.zw, xTexelC${b+1}.xy); - `):C===1?d+=` + `):w===1?d+=` xC${b+1} = xTexelC${b}; `:d+=` - xCOffset = xC + ${C}; + xCOffset = xC + ${w}; if (xCOffset >= 0 && xCOffset < inDims[1] && xTexelC${b+1}Ready == 0) { xTexelC${b+1} = getX(batch, xR, xCOffset, d1); @@ -3172,7 +3172,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } xC${b+1} = xTexelC${b+1}; - `}}else b= 0 && xCOffset < inDims[1] && xTexelC${b}Ready == 0) { xTexelC${b} = getX(batch, xR, xCOffset, d1); @@ -3195,7 +3195,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } xC${b} = vec4(xTexelC${b}.zw, xTexelC${b+1}.zw); - `,b+1= 0 && xCOffset < inDims[1]) { @@ -3222,12 +3222,12 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam xC${b} = vec4( xTexelC${b}.xy, xTexelC${b+1}.xy); - `,b+1`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${c}'`);let l=w.computeConv2DInfo(n.shape,s.shape,a,c,i,u,!0),m;A().getBool("WEBGL_PACK_DEPTHWISECONV")&&l.strideWidth<=2&&l.outChannels/l.inChannels===1?m=new Uc(l):m=new Wc(l);let d=[[l.padInfo.top,l.padInfo.left],[l.strideHeight,l.strideWidth],[l.dilationHeight,l.dilationWidth],[l.inHeight,l.inWidth]];return e.runWebGLProgram(m,[n,s],"float32",d)}var ZA={kernelName:mn,backendName:"webgl",kernelFunc:hJ};var Xh=class{constructor(t){this.variableNames=["x","dy"],this.outputShape=t.filterShape;let e=t.strideHeight,o=t.strideWidth,n=t.padInfo.top,s=t.padInfo.left,a=t.outChannels/t.inChannels;this.userCode=` + `}};function Wee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p,dimRoundingMode:u}=o,l=p;l==null&&(l=[1,1]),y.assert(C.eitherStridesOrDilationsAreOne(a,l),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${a} and dilations '${l}'`);let c=C.computeConv2DInfo(n.shape,s.shape,a,l,i,u,!0),m;A().getBool("WEBGL_PACK_DEPTHWISECONV")&&c.strideWidth<=2&&c.outChannels/c.inChannels===1?m=new Yl(c):m=new Xl(c);let d=[[c.padInfo.top,c.padInfo.left],[c.strideHeight,c.strideWidth],[c.dilationHeight,c.dilationWidth],[c.inHeight,c.inWidth]];return t.runWebGLProgram(m,[n,s],"float32",d)}var UF={kernelName:Bn,backendName:"webgl",kernelFunc:Wee};var ig=class{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,o=e.strideWidth,n=e.padInfo.top,s=e.padInfo.left,a=e.outChannels/e.inChannels;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; @@ -3277,18 +3277,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float dotProd = 0.0; // TO DO: Vec4 over the batch size - for (int b = 0; b < ${t.batchSize}; b++) { - for (int yR = 0; yR < ${t.outHeight}; yR++) { - int xR = wR + yR * ${e} - ${n}; + for (int b = 0; b < ${e.batchSize}; b++) { + for (int yR = 0; yR < ${e.outHeight}; yR++) { + int xR = wR + yR * ${t} - ${n}; - if (xR < 0 || xR >= ${t.inHeight}) { + if (xR < 0 || xR >= ${e.inHeight}) { continue; } - for (int yC = 0; yC < ${t.outWidth}; yC++) { + for (int yC = 0; yC < ${e.outWidth}; yC++) { int xC = wC + yC * ${o} - ${s}; - if (xC < 0 || xC >= ${t.inWidth}) { + if (xC < 0 || xC >= ${e.inWidth}) { continue; } @@ -3300,7 +3300,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}},Yh=class{constructor(t){this.variableNames=["dy","W"],this.outputShape=t.inShape;let e=t.filterHeight,o=t.filterWidth,n=t.strideHeight,s=t.strideWidth,a=e-1-t.padInfo.top,i=o-1-t.padInfo.left,p=t.outChannels/t.inChannels;this.userCode=` + `}},ug=class{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,o=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=t-1-e.padInfo.top,i=o-1-e.padInfo.left,p=e.outChannels/e.inChannels;this.userCode=` const ivec2 pads = ivec2(${a}, ${i}); void main() { @@ -3313,20 +3313,20 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float dotProd = 0.0; - for (int wR = 0; wR < ${e}; wR++) { + for (int wR = 0; wR < ${t}; wR++) { float dyR = float(dyRCorner + wR) / ${n}.0; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - int wRPerm = ${e} - 1 - wR; + int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC < ${o}; wC++) { float dyC = float(dyCCorner + wC) / ${s}.0; - if (dyC < 0.0 || dyC >= ${t.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -3345,15 +3345,15 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}};function gJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:c}=o,l=w.computeConv2DInfo(n.shape,c,a,i,p,u,!0),m=new Xh(l);return e.runWebGLProgram(m,[n,s],"float32")}var JA={kernelName:Fi,backendName:"webgl",kernelFunc:gJ};function xJ(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:c}=o,l=w.computeConv2DInfo(c,s.shape,a,i,p,u,!0),m=new Yh(l);return e.runWebGLProgram(m,[n,s],"float32")}var eF={kernelName:Pi,backendName:"webgl",kernelFunc:xJ};var Qh=class{constructor(t){this.variableNames=["X"],this.outputShape=[t,t],this.userCode=` + `}};function Uee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:l}=o,c=C.computeConv2DInfo(n.shape,l,a,i,p,u,!0),m=new ig(c);return t.runWebGLProgram(m,[n,s],"float32")}var GF={kernelName:Gi,backendName:"webgl",kernelFunc:Uee};function Gee(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:l}=o,c=C.computeConv2DInfo(l,s.shape,a,i,p,u,!0),m=new ug(c);return t.runWebGLProgram(m,[n,s],"float32")}var HF={kernelName:Hi,backendName:"webgl",kernelFunc:Gee};var pg=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(r){let{inputs:t,backend:e}=r,{x:o}=t,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=te({inputs:{x:o},backend:e,attrs:{shape:[s]}}),i=new Qh(s),p=e.runWebGLProgram(i,[a],a.dtype),u=te({inputs:{x:p},backend:e,attrs:{shape:n}});return e.disposeIntermediateTensorInfo(a),e.disposeIntermediateTensorInfo(p),u}var tF={kernelName:oa,backendName:"webgl",kernelFunc:yJ};var Zh=class{constructor(t){this.variableNames=["x","W"],this.outputShape=t.outShape;let{inHeight:e,inWidth:o,padInfo:n,strideHeight:s,strideWidth:a,filterHeight:i,filterWidth:p,dilationHeight:u,dilationWidth:c}=t,{top:l,left:m}=n;this.userCode=` + `}};function Hee(r){let{inputs:e,backend:t}=r,{x:o}=e,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=te({inputs:{x:o},backend:t,attrs:{shape:[s]}}),i=new pg(s),p=t.runWebGLProgram(i,[a],a.dtype),u=te({inputs:{x:p},backend:t,attrs:{shape:n}});return t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(p),u}var KF={kernelName:ca,backendName:"webgl",kernelFunc:Hee};var lg=class{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:o,padInfo:n,strideHeight:s,strideWidth:a,filterHeight:i,filterWidth:p,dilationHeight:u,dilationWidth:l}=e,{top:c,left:m}=n;this.userCode=` const ivec2 strides = ivec2(${s}, ${a}); - const ivec2 pads = ivec2(${l}, ${m}); + const ivec2 pads = ivec2(${c}, ${m}); const float neg_infinity = -3.4e38; void main() { @@ -3369,9 +3369,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam for (int h = 0; h < ${i}; h++) { int hIn = hBeg + h * ${u}; - if (hIn >= 0 && hIn < ${e}) { + if (hIn >= 0 && hIn < ${t}) { for (int w = 0; w < ${p}; w++) { - int wIn = wBeg + w * ${c}; + int wIn = wBeg + w * ${l}; if (wIn >= 0 && wIn < ${o}) { float xVal = getX(batch, hIn, wIn, d1); @@ -3389,7 +3389,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float result = curVal; setOutput(result); } - `}};function bJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeDilation2DInfo(n.shape,s.shape,a,i,"NHWC",p),c,l=new Zh(u);c=e.runWebGLProgram(l,[n,s],"float32");let m=te({inputs:{x:c},backend:e,attrs:{shape:u.outShape}});return e.disposeIntermediateTensorInfo(c),m}var rF={kernelName:dn,backendName:"webgl",kernelFunc:bJ};function CJ(r){let{inputs:t,backend:e,attrs:o}=r,{equation:n}=o,s=t,{allDims:a,summedDims:i,idDims:p}=w.decodeEinsumEquation(n,s.length);w.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:c}=w.getEinsumComputePath(i,p),l=c.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=bp({inputs:{x:m},backend:e,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&e.disposeIntermediateTensorInfo(h);return m}var oF={kernelName:Li,backendName:"webgl",kernelFunc:CJ};var wJ="return (x >= 0.0) ? x : (exp(x) - 1.0);",SJ=` + `}};function Kee(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeDilation2DInfo(n.shape,s.shape,a,i,"NHWC",p),l,c=new lg(u);l=t.runWebGLProgram(c,[n,s],"float32");let m=te({inputs:{x:l},backend:t,attrs:{shape:u.outShape}});return t.disposeIntermediateTensorInfo(l),m}var qF={kernelName:zn,backendName:"webgl",kernelFunc:Kee};function qee(r){let{inputs:e,backend:t,attrs:o}=r,{equation:n}=o,s=e,{allDims:a,summedDims:i,idDims:p}=C.decodeEinsumEquation(n,s.length);C.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:l}=C.getEinsumComputePath(i,p),c=l.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=Tp({inputs:{x:m},backend:t,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&t.disposeIntermediateTensorInfo(h);return m}var jF={kernelName:ji,backendName:"webgl",kernelFunc:qee};var jee="return (x >= 0.0) ? x : (exp(x) - 1.0);",Xee=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); @@ -3398,29 +3398,29 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; -`,IJ=xe({opSnippet:wJ,packedOpSnippet:SJ}),nF={kernelName:hn,backendName:"webgl",kernelFunc:IJ};var vJ="return (b >= 0.0) ? a : a * (b + 1.0);",kJ=` +`,Yee=xe({opSnippet:jee,packedOpSnippet:Xee}),XF={kernelName:Wn,backendName:"webgl",kernelFunc:Yee};var Qee="return (b >= 0.0) ? a : a * (b + 1.0);",Zee=` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); -`,NJ=r=>{let{inputs:t,backend:e}=r,{dy:o,y:n}=t,s=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new qr(kJ,o.shape,n.shape):new Fr(vJ,o.shape,n.shape);return e.runWebGLProgram(s,[o,n],o.dtype)},sF={kernelName:Xa,backendName:"webgl",kernelFunc:NJ};var TJ=` +`,Jee=r=>{let{inputs:e,backend:t}=r,{dy:o,y:n}=e,s=A().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new eo(Zee,o.shape,n.shape):new Br(Qee,o.shape,n.shape);return t.runWebGLProgram(s,[o,n],o.dtype)},YF={kernelName:ri,backendName:"webgl",kernelFunc:Jee};var ete=` return vec4(equal(a, b)); -`,_J="return float(a == b);",$J=nt({opSnippet:_J,packedOpSnippet:TJ,dtype:"bool",cpuKernelImpl:LR}),aF={kernelName:xn,backendName:"webgl",kernelFunc:$J};var EJ=` +`,tte="return float(a == b);",rte=st({opSnippet:tte,packedOpSnippet:ete,dtype:"bool",cpuKernelImpl:ED}),QF={kernelName:xo,backendName:"webgl",kernelFunc:rte};var ote=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - float p = ${w.ERF_P}; - float a1 = ${w.ERF_A1}; - float a2 = ${w.ERF_A2}; - float a3 = ${w.ERF_A3}; - float a4 = ${w.ERF_A4}; - float a5 = ${w.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)); -`,RJ=xe({opSnippet:EJ}),iF={kernelName:gn,backendName:"webgl",kernelFunc:RJ};var DJ=Fo+` +`,nte=xe({opSnippet:ote}),ZF={kernelName:Un,backendName:"webgl",kernelFunc:nte};var ste=sn+` return exp(x); -`,AJ=` +`,ate=` vec4 result = exp(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; @@ -3429,7 +3429,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam result.a = isNaN.a ? x.a : result.a; return result; -`,vv=xe({opSnippet:DJ,packedOpSnippet:AJ,cpuKernelImpl:BR,dtype:"float32"}),uF={kernelName:yn,backendName:"webgl",kernelFunc:vv};function Jh(r){let{inputs:t,attrs:e,backend:o}=r,{dim:n}=e,{input:s}=t,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),te({inputs:{x:s},backend:o,attrs:{shape:i}})}var pF={kernelName:na,backendName:"webgl",kernelFunc:Jh};var cF="return exp(x) - 1.0;",FJ=xe({opSnippet:cF,packedOpSnippet:cF,cpuKernelImpl:zR}),lF={kernelName:bn,backendName:"webgl",kernelFunc:FJ};var rm=class{constructor(t,e,o){this.variableNames=["real","imag"];let n=e[1];this.outputShape=e;let s=o?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,a=o?`${n}.0`:"1.0",i;if(t==="real")i="return real * expR - imag * expI;";else if(t==="imag")i="return real * expI + imag * expR;";else throw new Error(`FFT component must be either "real" or "imag", got ${t}.`);this.userCode=` +`,L0=xe({opSnippet:ste,packedOpSnippet:ate,cpuKernelImpl:$D,dtype:"float32"}),JF={kernelName:yo,backendName:"webgl",kernelFunc:L0};function cg(r){let{inputs:e,attrs:t,backend:o}=r,{dim:n}=t,{input:s}=e,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),te({inputs:{x:s},backend:o,attrs:{shape:i}})}var e3={kernelName:ma,backendName:"webgl",kernelFunc:cg};var t3="return exp(x) - 1.0;",ite=xe({opSnippet:t3,packedOpSnippet:t3,cpuKernelImpl:RD}),r3={kernelName:bo,backendName:"webgl",kernelFunc:ite};var cm=class{constructor(e,t,o){this.variableNames=["real","imag"];let n=t[1];this.outputShape=t;let s=o?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,a=o?`${n}.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 = ${s}; float unaryOpComplex(float real, float expR, float imag, float expI) { @@ -3462,26 +3462,26 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam ivec2 coords = getOutputCoords(); setOutput(mulMatDFT(coords[0], coords[1])); } - `}};function eg(r,t,e){let o=e.texData.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=te({inputs:{x:r},backend:e,attrs:{shape:[a,s]}}),p=i.shape,u=new rm("real",p,t),c=new rm("imag",p,t),l=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:p},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:p}],m=e.runWebGLProgram(u,l,"float32"),d=e.runWebGLProgram(c,l,"float32"),f=Pr({inputs:{real:m,imag:d},backend:e});e.disposeIntermediateTensorInfo(m),e.disposeIntermediateTensorInfo(d);let h=te({inputs:{x:f},backend:e,attrs:{shape:r.shape}});return e.disposeIntermediateTensorInfo(i),e.disposeIntermediateTensorInfo(f),h}function PJ(r){let{inputs:t,backend:e}=r,{input:o}=t;return eg(o,!1,e)}var mF={kernelName:Bi,backendName:"webgl",kernelFunc:PJ};var tg=class{constructor(t,e){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=t,this.userCode=` + `}};function mg(r,e,t){let o=t.texData.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=te({inputs:{x:r},backend:t,attrs:{shape:[a,s]}}),p=i.shape,u=new cm("real",p,e),l=new cm("imag",p,e),c=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:p},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:p}],m=t.runWebGLProgram(u,c,"float32"),d=t.runWebGLProgram(l,c,"float32"),f=zr({inputs:{real:m,imag:d},backend:t});t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d);let h=te({inputs:{x:f},backend:t,attrs:{shape:r.shape}});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(f),h}function ute(r){let{inputs:e,backend:t}=r,{input:o}=e;return mg(o,!1,t)}var o3={kernelName:Xi,backendName:"webgl",kernelFunc:ute};var dg=class{constructor(e,t){this.outputShape=[],this.customUniforms=[{name:"value",type:"float"}],this.variableNames=["x"],this.outputShape=e,this.userCode=` void main() { // Input can be obtained from uniform value. setOutput(value); } - `}};function bi(r){let{backend:t,attrs:e}=r,{shape:o,value:n}=e,{dtype:s}=e;if(s=s||y.inferDtype(n),s==="string"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),t.makeTensorInfo(o,s,a)}else{let a=new tg(o,n),i=[[n]];return t.runWebGLProgram(a,[],s,i)}}var dF={kernelName:sa,backendName:"webgl",kernelFunc:bi};var rg=class{constructor(t){this.variableNames=["Image"],this.outputShape=[];let e=t[2];this.outputShape=t,this.userCode=` + `}};function Ei(r){let{backend:e,attrs:t}=r,{shape:o,value:n}=t,{dtype:s}=t;if(s=s||y.inferDtype(n),s==="string"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),e.makeTensorInfo(o,s,a)}else{let a=new dg(o,n),i=[[n]];return e.runWebGLProgram(a,[],s,i)}}var n3={kernelName:da,backendName:"webgl",kernelFunc:Ei};var fg=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]; - int coordX = ${e} - x - 1; + int coordX = ${t} - x - 1; float outputValue; - if(coordX >= 0 && coordX < ${e}) { + if(coordX >= 0 && coordX < ${t}) { outputValue = getImage(coords[0], coords[1], coordX, coords[3]); } else { outputValue = getImage(coords[0], coords[1], coords[2], coords[3]); } setOutput(outputValue); } - `}};var fF={kernelName:Cn,backendName:"webgl",kernelFunc:({inputs:r,backend:t})=>{let{image:e}=r,o=t,n=new rg(e.shape);return o.runWebGLProgram(n,[e],e.dtype)}};var hF="return floor(x);",OJ=xe({opSnippet:hF,packedOpSnippet:hF,cpuKernelImpl:VR}),gF={kernelName:wn,backendName:"webgl",kernelFunc:OJ};var MJ=` + `}};var s3={kernelName:Gn,backendName:"webgl",kernelFunc:({inputs:r,backend:e})=>{let{image:t}=r,o=e,n=new fg(t.shape);return o.runWebGLProgram(n,[t],t.dtype)}};var a3="return floor(x);",pte=xe({opSnippet:a3,packedOpSnippet:a3,cpuKernelImpl:DD}),i3={kernelName:Co,backendName:"webgl",kernelFunc:pte};var lte=` float s = sign(a) * sign(b); int ia = round(a); int ib = round(b); @@ -3491,7 +3491,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } else { return NAN; } -`,LJ=` +`,cte=` ivec4 ia = round(a); ivec4 ib = round(b); bvec4 cond = notEqual(ib, ivec4(0)); @@ -3512,7 +3512,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam result[3] = idiv(ia[3], ib[3], s[3]); } return vec4(result); -`,BJ=nt({opSnippet:MJ,packedOpSnippet:LJ,dtype:"int32"}),xF={kernelName:Sn,backendName:"webgl",kernelFunc:BJ};var og=class{constructor(t){this.variableNames=["A"];let e=It(),[o,n]=t;this.outputShape=t,this.userCode=` +`,mte=st({opSnippet:lte,packedOpSnippet:cte,dtype:"int32"}),u3={kernelName:wo,backendName:"webgl",kernelFunc:mte};var hg=class{constructor(e){this.variableNames=["A"];let t=kt(),[o,n]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -3520,7 +3520,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam int depth = coords[2]; vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${o}.0); - vec4 values = ${e.texture2D}(A, uv); + vec4 values = ${t.texture2D}(A, uv); float value; if (depth == 0) { value = values.r; @@ -3534,7 +3534,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam setOutput(floor(value * 255.0 + 0.5)); } - `}};var ng=class{constructor(t){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let e=It(),[o,n]=t;this.outputShape=t,this.userCode=` + `}};var gg=class{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=kt(),[o,n]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; @@ -3550,7 +3550,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${o}.0); - vec4 values = ${e.texture2D}(A, uv); + vec4 values = ${t.texture2D}(A, uv); float value; if (depth == 0) { value = values.r; @@ -3566,9 +3566,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } } - ${e.output} = result; + ${t.output} = result; } - `}};var yF={kernelName:Eu,backendName:"webgl",kernelFunc:zJ},Gc,kv=A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function zJ(r){let{inputs:t,backend:e,attrs:o}=r,{pixels:n}=t,{numChannels:s}=o,a=typeof HTMLVideoElement!="undefined"&&n instanceof HTMLVideoElement,i=typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement,[p,u]=a?[n.videoWidth,n.videoHeight]:[n.width,n.height],c=[u,p],l=[u,p,s];if(i||a){let h=A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(Gc==null||h!==kv)&&(kv=h,Gc=document.createElement("canvas").getContext("2d",{willReadFrequently:kv})),Gc.canvas.width=p,Gc.canvas.height=u,Gc.drawImage(n,0,0,p,u),n=Gc.canvas}let m=e.makeTensorInfo(c,"int32");e.texData.get(m.dataId).usage=mr.PIXELS,e.gpgpu.uploadPixelDataToTexture(e.getTexture(m.dataId),n);let d=A().getBool("WEBGL_PACK")?new ng(l):new og(l),f=e.runWebGLProgram(d,[m],"int32");return e.disposeData(m.dataId),f}function VJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dataFormat:c,dilations:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=w.convertConv2DDataFormat(c),g=w.computeConv2DInfo(n.shape,s.shape,p,l,u,m,!1,h),x,b=[],C=a!=null,S=i!=null,k=d==="leakyrelu",_=()=>{let R=[n,s],D=(P,O)=>{if(O==="NCHW"&&P.shape.length===1&&P.shape[0]!==1){let M=te({inputs:{x:P},backend:e,attrs:{shape:[P.shape[0],1,1]}});return b.push(M),M}return P};if(C&&R.push(D(a,c)),S&&R.push(D(i,c)),k){let P=e.makeTensorInfo([],"float32",y.createScalarValue(f,"float32"));R.push(P),b.push(P)}return R};if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type==="SAME"||g.padInfo.type==="VALID"))x=Bh({x:n,filter:s,convInfo:g,backend:e,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else if(g.strideWidth<=2&&h==="channelsLast"&&A().getBool("WEBGL_EXP_CONV")){let R=d?xi(d,!0):null,D=new Vc(g,C,R,S,k),P=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],O=_();x=e.runWebGLProgram(D,O,"float32",P)}else if(A().getBool("WEBGL_CONV_IM2COL"))x=zh({x:n,filter:s,convInfo:g,backend:e,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else{let R=d?xi(d,!1):null,D=new zc(g,C,R,S,k),P=_();x=e.runWebGLProgram(D,P,"float32")}let E=te({inputs:{x},backend:e,attrs:{shape:g.outShape}});return b.push(x),b.forEach(R=>e.disposeIntermediateTensorInfo(R)),E}var bF={kernelName:Io,backendName:"webgl",kernelFunc:VJ};function WJ(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dimRoundingMode:l,activation:m,leakyreluAlpha:d}=o,f=[],h=c;h==null&&(h=[1,1]),y.assert(w.eitherStridesOrDilationsAreOne(p,h),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`);let g=w.computeConv2DInfo(n.shape,s.shape,p,h,u,l,!0),x=A().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,b=m?xi(m,x):null,C=[n,s],S=a!=null,k=i!=null,_=m==="leakyrelu";if(S&&C.push(a),k&&C.push(i),_){let P=e.makeTensorInfo([],"float32",y.createScalarValue(d,"float32"));C.push(P),f.push(P)}let E;x?E=new Uc(g,S,b,k,_):E=new Wc(g,S,b,k,_);let R=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],D=e.runWebGLProgram(E,C,"float32",R);return f.forEach(P=>e.disposeIntermediateTensorInfo(P)),D}var CF={kernelName:vo,backendName:"webgl",kernelFunc:WJ};var sg=class{constructor(t,e,o,n){this.sliceDim=t,this.strides=e,this.paramsShape=n,this.variableNames=["x","indices"],this.outputShape=o;let s=Re(o.length),a=` + `}};var p3={kernelName:Lu,backendName:"webgl",kernelFunc:dte},Ql,B0=A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function dte(r){let{inputs:e,backend:t,attrs:o}=r,{pixels:n}=e,{numChannels:s}=o,a=typeof HTMLVideoElement!="undefined"&&n instanceof HTMLVideoElement,i=typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement,[p,u]=a?[n.videoWidth,n.videoHeight]:[n.width,n.height],l=[u,p],c=[u,p,s];if(i||a){let h=A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(Ql==null||h!==B0)&&(B0=h,Ql=document.createElement("canvas").getContext("2d",{willReadFrequently:B0})),Ql.canvas.width=p,Ql.canvas.height=u,Ql.drawImage(n,0,0,p,u),n=Ql.canvas}let m=t.makeTensorInfo(l,"int32");t.texData.get(m.dataId).usage=hr.PIXELS,t.gpgpu.uploadPixelDataToTexture(t.getTexture(m.dataId),n);let d=A().getBool("WEBGL_PACK")?new gg(c):new hg(c),f=t.runWebGLProgram(d,[m],"int32");return t.disposeData(m.dataId),f}function fte(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dataFormat:l,dilations:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=C.convertConv2DDataFormat(l),g=C.computeConv2DInfo(n.shape,s.shape,p,c,u,m,!1,h),x,b=[],w=a!=null,S=i!=null,k=d==="leakyrelu",T=()=>{let R=[n,s],D=(F,O)=>{if(O==="NCHW"&&F.shape.length===1&&F.shape[0]!==1){let M=te({inputs:{x:F},backend:t,attrs:{shape:[F.shape[0],1,1]}});return b.push(M),M}return F};if(w&&R.push(D(a,l)),S&&R.push(D(i,l)),k){let F=t.makeTensorInfo([],"float32",y.createScalarValue(f,"float32"));R.push(F),b.push(F)}return R};if(g.filterHeight===1&&g.filterWidth===1&&g.dilationHeight===1&&g.dilationWidth===1&&g.strideHeight===1&&g.strideWidth===1&&(g.padInfo.type==="SAME"||g.padInfo.type==="VALID"))x=Qh({x:n,filter:s,convInfo:g,backend:t,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else if(g.strideWidth<=2&&h==="channelsLast"&&A().getBool("WEBGL_EXP_CONV")){let R=d?Ti(d,!0):null,D=new jl(g,w,R,S,k),F=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],O=T();x=t.runWebGLProgram(D,O,"float32",F)}else if(A().getBool("WEBGL_CONV_IM2COL"))x=Zh({x:n,filter:s,convInfo:g,backend:t,bias:a,activation:d,preluActivationWeights:i,leakyreluAlpha:f});else{let R=d?Ti(d,!1):null,D=new ql(g,w,R,S,k),F=T();x=t.runWebGLProgram(D,F,"float32")}let E=te({inputs:{x},backend:t,attrs:{shape:g.outShape}});return b.push(x),b.forEach(R=>t.disposeIntermediateTensorInfo(R)),E}var l3={kernelName:jo,backendName:"webgl",kernelFunc:fte};function hte(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dimRoundingMode:c,activation:m,leakyreluAlpha:d}=o,f=[],h=l;h==null&&(h=[1,1]),y.assert(C.eitherStridesOrDilationsAreOne(p,h),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`);let g=C.computeConv2DInfo(n.shape,s.shape,p,h,u,c,!0),x=A().getBool("WEBGL_PACK_DEPTHWISECONV")&&g.strideWidth<=2&&g.outChannels/g.inChannels===1,b=m?Ti(m,x):null,w=[n,s],S=a!=null,k=i!=null,T=m==="leakyrelu";if(S&&w.push(a),k&&w.push(i),T){let F=t.makeTensorInfo([],"float32",y.createScalarValue(d,"float32"));w.push(F),f.push(F)}let E;x?E=new Yl(g,S,b,k,T):E=new Xl(g,S,b,k,T);let R=[[g.padInfo.top,g.padInfo.left],[g.strideHeight,g.strideWidth],[g.dilationHeight,g.dilationWidth],[g.inHeight,g.inWidth]],D=t.runWebGLProgram(E,w,"float32",R);return f.forEach(F=>t.disposeIntermediateTensorInfo(F)),D}var c3={kernelName:Xo,backendName:"webgl",kernelFunc:hte};var xg=class{constructor(e,t,o,n){this.sliceDim=e,this.strides=t,this.paramsShape=n,this.variableNames=["x","indices"],this.outputShape=o;let s=Re(o.length),a=` int index;`;for(let i=0;i= 0) && (index < ${t[2]}) ? 1.0 : 0.0; + float inBounds = (index >= 0) && (index < ${e[2]}) ? 1.0 : 0.0; setOutput(inBounds * getA(${n})); } - `}};function GJ(r,t){let e=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[];for(let n=0;n=0,()=>`GatherV2: the index value ${k} is not in [0, ${C-1}]`)}}let u=w.segment_util.collectGatherOpShapeInfo(n,s,p,i),c=y.sizeFromShape(s.shape),l=[],m=te({inputs:{x:n},backend:e,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),d=te({inputs:{x:s},backend:e,attrs:{shape:[u.batchSize,c/u.batchSize]}});l.push(m),l.push(d);let f=[u.batchSize,u.outerSize,c/u.batchSize,u.sliceSize];if(e.shouldExecuteOnCPU([n,s])||n.dtype==="string"){let b=e.bufferSync(d),C=e.bufferSync(m),S=UR(C,b,f);return l.forEach(k=>e.disposeIntermediateTensorInfo(k)),e.makeTensorInfo(u.outputShape,S.dtype,S.values)}let h=new ag(m.shape,f),g=e.runWebGLProgram(h,[m,d],m.dtype);l.push(g);let x=te({inputs:{x:g},backend:e,attrs:{shape:u.outputShape}});return l.forEach(b=>e.disposeIntermediateTensorInfo(b)),x}var SF={kernelName:aa,backendName:"webgl",kernelFunc:Nv};var HJ="return float(a > b);",KJ=` + `}};function xte(r,e){let t=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[];for(let n=0;n=0,()=>`GatherV2: the index value ${k} is not in [0, ${w-1}]`)}}let u=C.segment_util.collectGatherOpShapeInfo(n,s,p,i),l=y.sizeFromShape(s.shape),c=[],m=te({inputs:{x:n},backend:t,attrs:{shape:[u.batchSize,u.outerSize,u.dimSize,u.sliceSize]}}),d=te({inputs:{x:s},backend:t,attrs:{shape:[u.batchSize,l/u.batchSize]}});c.push(m),c.push(d);let f=[u.batchSize,u.outerSize,l/u.batchSize,u.sliceSize];if(t.shouldExecuteOnCPU([n,s])||n.dtype==="string"){let b=t.bufferSync(d),w=t.bufferSync(m),S=FD(w,b,f);return c.forEach(k=>t.disposeIntermediateTensorInfo(k)),t.makeTensorInfo(u.outputShape,S.dtype,S.values)}let h=new yg(m.shape,f),g=t.runWebGLProgram(h,[m,d],m.dtype);c.push(g);let x=te({inputs:{x:g},backend:t,attrs:{shape:u.outputShape}});return c.forEach(b=>t.disposeIntermediateTensorInfo(b)),x}var d3={kernelName:fa,backendName:"webgl",kernelFunc:z0};var yte="return float(a > b);",bte=` return vec4(greaterThan(a, b)); -`,qJ=nt({opSnippet:HJ,packedOpSnippet:KJ,cpuKernelImpl:GR,dtype:"bool"}),IF={kernelName:kn,backendName:"webgl",kernelFunc:qJ};var jJ="return float(a >= b);",XJ=` +`,Cte=st({opSnippet:yte,packedOpSnippet:bte,cpuKernelImpl:PD,dtype:"bool"}),f3={kernelName:So,backendName:"webgl",kernelFunc:Cte};var wte="return float(a >= b);",Ste=` return vec4(greaterThanEqual(a, b)); -`,YJ=nt({opSnippet:jJ,packedOpSnippet:XJ,dtype:"bool",cpuKernelImpl:HR}),vF={kernelName:Nn,backendName:"webgl",kernelFunc:YJ};function QJ(r){let{inputs:t,backend:e}=r,{input:o}=t;return eg(o,!0,e)}var kF={kernelName:zi,backendName:"webgl",kernelFunc:QJ};var ZJ="return float(!isnan(x) && !isinf(x));",JJ=xe({opSnippet:ZJ,dtype:"bool"}),NF={kernelName:Tn,backendName:"webgl",kernelFunc:JJ};var eee="return float(isinf(x));",tee=xe({opSnippet:eee,dtype:"bool"}),TF={kernelName:_n,backendName:"webgl",kernelFunc:tee};var ree="return float(isnan(x));",oee=xe({opSnippet:ree,dtype:"bool"}),_F={kernelName:$n,backendName:"webgl",kernelFunc:oee};var nee="return float(a < b);",see=` +`,Ite=st({opSnippet:wte,packedOpSnippet:Ste,dtype:"bool",cpuKernelImpl:OD}),h3={kernelName:Io,backendName:"webgl",kernelFunc:Ite};function vte(r){let{inputs:e,backend:t}=r,{input:o}=e;return mg(o,!0,t)}var g3={kernelName:Yi,backendName:"webgl",kernelFunc:vte};var kte="return float(!isnan(x) && !isinf(x));",Nte=xe({opSnippet:kte,dtype:"bool"}),x3={kernelName:qn,backendName:"webgl",kernelFunc:Nte};var Tte="return float(isinf(x));",_te=xe({opSnippet:Tte,dtype:"bool"}),y3={kernelName:jn,backendName:"webgl",kernelFunc:_te};var Ete="return float(isnan(x));",$te=xe({opSnippet:Ete,dtype:"bool"}),b3={kernelName:Xn,backendName:"webgl",kernelFunc:$te};var Rte="return float(a < b);",Dte=` return vec4(lessThan(a, b)); -`,aee=nt({opSnippet:nee,packedOpSnippet:see,cpuKernelImpl:KR,dtype:"bool"}),$F={kernelName:Rn,backendName:"webgl",kernelFunc:aee};var iee="return float(a <= b);",uee=` +`,Ate=st({opSnippet:Rte,packedOpSnippet:Dte,cpuKernelImpl:MD,dtype:"bool"}),C3={kernelName:ko,backendName:"webgl",kernelFunc:Ate};var Fte="return float(a <= b);",Pte=` return vec4(lessThanEqual(a, b)); -`,pee=nt({opSnippet:iee,packedOpSnippet:uee,cpuKernelImpl:qR,dtype:"bool"}),EF={kernelName:Dn,backendName:"webgl",kernelFunc:pee};function cee(r){let{backend:t,attrs:e}=r,{start:o,stop:n,num:s}=e,a=jR(o,n,s);return t.makeTensorInfo([a.length],"float32",a)}var RF={kernelName:An,backendName:"webgl",kernelFunc:cee};var lee=Fo+` +`,Ote=st({opSnippet:Fte,packedOpSnippet:Pte,cpuKernelImpl:LD,dtype:"bool"}),w3={kernelName:No,backendName:"webgl",kernelFunc:Ote};function Mte(r){let{backend:e,attrs:t}=r,{start:o,stop:n,num:s}=t,a=BD(o,n,s);return e.makeTensorInfo([a.length],"float32",a)}var S3={kernelName:Qn,backendName:"webgl",kernelFunc:Mte};var Lte=sn+` return x < 0.0 ? 0./0. : log(x); -`,mee=` +`,Bte=` vec4 result = log(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r); @@ -3608,18 +3608,18 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam result.b = isNaN.b ? x.b : (x.b < 0.0 ? 0./0. : result.b); result.a = isNaN.a ? x.a : (x.a < 0.0 ? 0./0. : result.a); return result; -`,dee=xe({opSnippet:lee,packedOpSnippet:mee,cpuKernelImpl:XR}),DF={kernelName:Fn,backendName:"webgl",kernelFunc:dee};var fee=Fo+` +`,zte=xe({opSnippet:Lte,packedOpSnippet:Bte,cpuKernelImpl:zD}),I3={kernelName:To,backendName:"webgl",kernelFunc:zte};var Vte=sn+` return log(1.0 + x); -`,hee=xe({opSnippet:fee}),AF={kernelName:Pn,backendName:"webgl",kernelFunc:hee};var gee="return float(a >= 1.0 && b >= 1.0);",xee=` +`,Wte=xe({opSnippet:Vte}),v3={kernelName:Zn,backendName:"webgl",kernelFunc:Wte};var Ute="return float(a >= 1.0 && b >= 1.0);",Gte=` return vec4( vec4(greaterThanEqual(a, vec4(1.0))) * vec4(greaterThanEqual(b, vec4(1.0)))); -`,yee=nt({opSnippet:gee,packedOpSnippet:xee,dtype:"bool"}),FF={kernelName:On,backendName:"webgl",kernelFunc:yee};var bee="return float(!(x >= 1.0));",Cee=xe({opSnippet:bee}),PF={kernelName:Mn,backendName:"webgl",kernelFunc:Cee};var wee="return float(a >= 1.0 || b >= 1.0);",See=` +`,Hte=st({opSnippet:Ute,packedOpSnippet:Gte,dtype:"bool"}),k3={kernelName:Jn,backendName:"webgl",kernelFunc:Hte};var Kte="return float(!(x >= 1.0));",qte=xe({opSnippet:Kte}),N3={kernelName:es,backendName:"webgl",kernelFunc:qte};var jte="return float(a >= 1.0 || b >= 1.0);",Xte=` return min( vec4(greaterThanEqual(a, vec4(1.0))) + vec4(greaterThanEqual(b, vec4(1.0))), vec4(1.0)); -`,Iee=nt({opSnippet:wee,packedOpSnippet:See,dtype:"bool"}),OF={kernelName:Ln,backendName:"webgl",kernelFunc:Iee};var ig=class{constructor(t,e,o,n,s){this.variableNames=["x"],this.outputShape=[];let a=e,i=t[3]-1;this.outputShape=t;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=` +`,Yte=st({opSnippet:jte,packedOpSnippet:Xte,dtype:"bool"}),T3={kernelName:ts,backendName:"webgl",kernelFunc:Yte};var bg=class{constructor(e,t,o,n,s){this.variableNames=["x"],this.outputShape=[];let a=t,i=e[3]-1;this.outputShape=e;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3638,7 +3638,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float val = x * ${p}; setOutput(val); } - `}};var ug=class{constructor(t,e,o,n,s){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let a=e,i=t[3]-1;this.outputShape=t;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=` + `}};var Cg=class{constructor(e,t,o,n,s){this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let a=t,i=e[3]-1;this.outputShape=e;let p,u=`float(${o}) + float(${n}) * sum`;s===.5?p=`inversesqrt(${u})`:s===1?p=`1.0/(${u})`:p=`exp(log(${u}) * float(-${s}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords.x; @@ -3700,7 +3700,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam vec4 result = xAtOutputCoords * ${p}; setOutput(result); } - `}};var vee=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u=A().getBool("WEBGL_PACK_NORMALIZATION")?new ug(n.shape,s,a,i,p):new ig(n.shape,s,a,i,p);return e.runWebGLProgram(u,[n],n.dtype)},MF={kernelName:Bn,backendName:"webgl",kernelFunc:vee};var pg=class{constructor(t,e,o,n,s){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=t,this.depth=t[3],this.depthRadius=e,this.bias=o,this.alpha=n,this.beta=s,this.userCode=` + `}};var Qte=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u=A().getBool("WEBGL_PACK_NORMALIZATION")?new Cg(n.shape,s,a,i,p):new bg(n.shape,s,a,i,p);return t.runWebGLProgram(u,[n],n.dtype)},_3={kernelName:rs,backendName:"webgl",kernelFunc:Qte};var wg=class{constructor(e,t,o,n,s){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=o,this.alpha=n,this.beta=s,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -3709,9 +3709,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float result = 0.0; for (int d = 0; d < ${this.depth}; ++d) { - int depthBegin = int(max(0.0, float(d - ${e}))); + int depthBegin = int(max(0.0, float(d - ${t}))); int depthEnd = int(min(float(${this.depth}), - float(d + ${e} + 1))); + float(d + ${t} + 1))); const int MIN_DEPTH_BEGIN = 0; const int MAX_DEPTH_END = ${this.depth}; @@ -3755,16 +3755,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(result); } - `}};var kee=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n,y:s,dy:a}=t,{depthRadius:i,bias:p,alpha:u,beta:c}=o,l=new pg(n.shape,i,p,u,c);return e.runWebGLProgram(l,[n,s,a],n.dtype)},LF={kernelName:Ya,backendName:"webgl",kernelFunc:kee};function BF(r,t,e,o){let n=y.sizeFromShape(t),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=Xr(i,r.dtype,"max",o),u=te({inputs:{x:p},attrs:{shape:e},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}function Tv(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{reductionIndices:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,c=w.getAxesPermutation(u,i),l=c!=null,m=e.shouldExecuteOnCPU([n]),d=n;if(l){if(m){let C=e.texData.get(d.dataId).values,S=new Array(i);for(let E=0;E{let{inputs:e,backend:t,attrs:o}=r,{x:n,y:s,dy:a}=e,{depthRadius:i,bias:p,alpha:u,beta:l}=o,c=new wg(n.shape,i,p,u,l);return t.runWebGLProgram(c,[n,s,a],n.dtype)},E3={kernelName:oi,backendName:"webgl",kernelFunc:Zte};function $3(r,e,t,o){let n=y.sizeFromShape(e),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=ro(i,r.dtype,"max",o),u=te({inputs:{x:p},attrs:{shape:t},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}function V0(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{reductionIndices:s,keepDims:a}=o,i=n.shape.length,p=y.parseAxisParam(s,n.shape),u=p,l=C.getAxesPermutation(u,i),c=l!=null,m=t.shouldExecuteOnCPU([n]),d=n;if(c){if(m){let w=t.texData.get(d.dataId).values,S=new Array(i);for(let E=0;E`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,u,i,p);if(c.filterWidth===1&&c.filterHeight===1&&y.arraysEqual(c.inShape,c.outShape))return Dt({inputs:{x:n},backend:e});let l=new Us(c,"max",!1);return e.runWebGLProgram(l,[n],n.dtype)}var WF={kernelName:Wn,backendName:"webgl",kernelFunc:$ee};function Eee(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,u,p),m=new xu(l,"max",!1);return e.runWebGLProgram(m,[n],n.dtype)}var UF={kernelName:ia,backendName:"webgl",kernelFunc:Eee};var cg=class{constructor(t){this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;let e=t.strideHeight,o=t.strideWidth,n=t.dilationHeight,s=t.effectiveFilterHeight,a=t.effectiveFilterWidth,i=s-1-t.padInfo.top,p=a-1-t.padInfo.left,u=s*a-1;this.userCode=` +`,tre=st({opSnippet:Jte,packedOpSnippet:ere,cpuKernelImpl:WD}),D3={kernelName:_o,backendName:"webgl",kernelFunc:tre};function rre(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e;Ys(n,"maxPool");let{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1;y.assert(C.eitherStridesOrDilationsAreOne(a,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,u,i,p);if(l.filterWidth===1&&l.filterHeight===1&&y.arraysEqual(l.inShape,l.outShape))return Ft({inputs:{x:n},backend:t});let c=new Zs(l,"max",!1);return t.runWebGLProgram(c,[n],n.dtype)}var A3={kernelName:ns,backendName:"webgl",kernelFunc:rre};function ore(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,u,p),m=new Nu(c,"max",!1);return t.runWebGLProgram(m,[n],n.dtype)}var F3={kernelName:ha,backendName:"webgl",kernelFunc:ore};var Sg=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,o=e.strideWidth,n=e.dilationHeight,s=e.effectiveFilterHeight,a=e.effectiveFilterWidth,i=s-1-e.padInfo.top,p=a-1-e.padInfo.left,u=s*a-1;this.userCode=` const ivec2 pads = ivec2(${i}, ${p}); void main() { @@ -3781,9 +3781,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float dotProd = 0.0; for (int wR = 0; wR < ${s}; wR += ${n}) { - float dyR = float(dyRCorner + wR) / ${e}.0; + float dyR = float(dyRCorner + wR) / ${t}.0; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || fract(dyR) > 0.0) { + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); @@ -3791,7 +3791,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam for (int wC = 0; wC < ${a}; wC++) { float dyC = float(dyCCorner + wC) / ${o}.0; - if (dyC < 0.0 || dyC >= ${t.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -3810,8 +3810,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}},lg=class{constructor(t){this.variableNames=["dy","maxPos"],this.outputShape=t.inShape;let e=t.strideDepth,o=t.strideHeight,n=t.strideWidth,s=t.dilationDepth,a=t.dilationHeight,i=t.dilationWidth,p=t.effectiveFilterDepth,u=t.effectiveFilterHeight,c=t.effectiveFilterWidth,l=p-1-t.padInfo.front,m=u-1-t.padInfo.top,d=c-1-t.padInfo.left,f=p*u*c-1;this.userCode=` - const ivec3 pads = ivec3(${l}, ${m}, ${d}); + `}},Ig=class{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,o=e.strideHeight,n=e.strideWidth,s=e.dilationDepth,a=e.dilationHeight,i=e.dilationWidth,p=e.effectiveFilterDepth,u=e.effectiveFilterHeight,l=e.effectiveFilterWidth,c=p-1-e.padInfo.front,m=u-1-e.padInfo.top,d=l-1-e.padInfo.left,f=p*u*l-1;this.userCode=` + const ivec3 pads = ivec3(${c}, ${m}, ${d}); void main() { ivec5 coords = getOutputCoords(); @@ -3830,9 +3830,9 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam for (int wD = 0; wD < ${p}; wD += ${s}) { - float dyD = float(dyDCorner + wD) / ${e}.0; + float dyD = float(dyDCorner + wD) / ${t}.0; - if (dyD < 0.0 || dyD >= ${t.outDepth}.0 || fract(dyD) > 0.0) { + if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); @@ -3841,17 +3841,17 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam wR += ${a}) { float dyR = float(dyRCorner + wR) / ${o}.0; - if (dyR < 0.0 || dyR >= ${t.outHeight}.0 || + if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); - for (int wC = 0; wC < ${c}; + for (int wC = 0; wC < ${l}; wC += ${i}) { float dyC = float(dyCCorner + wC) / ${n}.0; - if (dyC < 0.0 || dyC >= ${t.outWidth}.0 || + if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } @@ -3864,8 +3864,8 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam // Get the current value, check it against the value from the // position matrix. int curPosValue = - wD * ${u} * ${c} + - wR * ${c} + wC; + wD * ${u} * ${l} + + wR * ${l} + wC; float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); dotProd += dyValue * mask; @@ -3874,16 +3874,16 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } setOutput(dotProd); } - `}};function Ree(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=[1,1,1],m=w.computePool3DInfo(a.shape,i,p,l,u,c),d=new xu(m,"max",!0),f=e.runWebGLProgram(d,[a],a.dtype),h=new lg(m),g=e.runWebGLProgram(h,[n,f],a.dtype);return e.disposeIntermediateTensorInfo(f),g}var GF={kernelName:Ui,backendName:"webgl",kernelFunc:Ree};function Dee(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s,output:a}=t,i=s;Vs([s,a],"maxPoolGrad");let{filterSize:p,strides:u,pad:c,dimRoundingMode:l}=o,m=w.computePool2DInfo(i.shape,p,u,1,c,l),d=!0,f=new Us(m,"max",d),h=e.runWebGLProgram(f,[i],i.dtype),g=new cg(m),x=e.runWebGLProgram(g,[n,h],i.dtype);return e.disposeIntermediateTensorInfo(h),x}var HF={kernelName:Wi,backendName:"webgl",kernelFunc:Dee};function KF(r,t,e,o){let n=new Us(e,"max",!1),s=o.runWebGLProgram(n,[r],"float32");n=new Us(e,"max",!0,!0,t);let a=o.runWebGLProgram(n,[r],"float32");return[s,a]}var qF={kernelName:ua,backendName:"webgl",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=t,p=e;y.assert(o.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${o.shape.length}.`);let u=[1,1];y.assert(w.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let c=w.computePool2DInfo(o.shape,n,s,u,a),[l,m]=KF(o,i,c,p);return[l,m]}};function jF(r,t,e,o){let n=y.sizeFromShape(t),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=Xr(i,"float32","mean",o),u=te({inputs:{x:p},attrs:{shape:e},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}var XF={kernelName:Un,backendName:"webgl",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{keepDims:n,axis:s}=t,a=e,i=o.shape.length,p=y.parseAxisParam(s,o.shape),u=p,c=w.getAxesPermutation(u,i),l=c!=null,m=a.shouldExecuteOnCPU([o]),d=[],f=o;if(l){if(m){let S=a.texData.get(f.dataId).values,k=new Array(i);for(let R=0;R{let{x:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=e,p=t;y.assert(o.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${o.shape.length}.`);let u=[1,1];y.assert(C.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let l=C.computePool2DInfo(o.shape,n,s,u,a),[c,m]=M3(o,i,l,p);return[c,m]}};function B3(r,e,t,o){let n=y.sizeFromShape(e),a=y.sizeFromShape(r.shape)/n,i=te({inputs:{x:r},attrs:{shape:[a,n]},backend:o}),p=ro(i,"float32","mean",o),u=te({inputs:{x:p},attrs:{shape:t},backend:o});return o.disposeIntermediateTensorInfo(i),o.disposeIntermediateTensorInfo(p),u}var z3={kernelName:ss,backendName:"webgl",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o}=r,{keepDims:n,axis:s}=e,a=t,i=o.shape.length,p=y.parseAxisParam(s,o.shape),u=p,l=C.getAxesPermutation(u,i),c=l!=null,m=a.shouldExecuteOnCPU([o]),d=[],f=o;if(c){if(m){let S=a.texData.get(f.dataId).values,k=new Array(i);for(let R=0;Rc[0]+t[l]+c[1]);let n=t.length,s=Re(n),a=e.map(c=>c[0]).join(","),i=e.map((c,l)=>c[0]+t[l]).join(","),p=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n),u=o==="reflect"?0:1;if(n===1){this.userCode=` +`,pre=st({opSnippet:ire,packedOpSnippet:ure,cpuKernelImpl:UD}),W3={kernelName:Eo,backendName:"webgl",kernelFunc:pre};var vg=class{constructor(e,t,o){this.variableNames=["x"],this.outputShape=t.map((l,c)=>l[0]+e[c]+l[1]);let n=e.length,s=Re(n),a=t.map(l=>l[0]).join(","),i=t.map((l,c)=>l[0]+e[c]).join(","),p=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n),u=o==="reflect"?0:1;if(n===1){this.userCode=` int start = ${a}; int end = ${i}; @@ -3912,7 +3912,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam ${s} coords = outC - start; setOutput(getX(${p})); } - `}};var dg=class{constructor(t,e,o){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e.map((f,h)=>f[0]+t[h]+f[1]);let n=t.length,s=Re(n),a=e.map(f=>f[0]).join(","),i=e.map((f,h)=>f[0]+t[h]).join(","),p=Rt("rc",n),u=Rt("source",n),c=`${p[n-1]} < ${this.outputShape[n-1]}`,l=n===1?"source":`vec2(${u.slice(-2).join()})`,m=o==="reflect"?0:1,d="";if(n===1){let f=` + `}};var kg=class{constructor(e,t,o){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((f,h)=>f[0]+e[h]+f[1]);let n=e.length,s=Re(n),a=t.map(f=>f[0]).join(","),i=t.map((f,h)=>f[0]+e[h]).join(","),p=At("rc",n),u=At("source",n),l=`${p[n-1]} < ${this.outputShape[n-1]}`,c=n===1?"source":`vec2(${u.slice(-2).join()})`,m=o==="reflect"?0:1,d="";if(n===1){let f=` ${s} source = rc; if (source < start) { source = start * 2 - source - ${m}; @@ -3923,11 +3923,11 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam `;d=` ${s} rc = outputLoc; ${f} - result[0] = getChannel(getX(${u.join()}), ${l}); + result[0] = getChannel(getX(${u.join()}), ${c}); ${p[n-1]} += 1; - if(${c}) { + if(${l}) { ${f} - result[1] = getChannel(getX(${u.join()}), ${l}); + result[1] = getChannel(getX(${u.join()}), ${c}); } `}else{let f=` ${s} source = rc; @@ -3941,21 +3941,21 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam `;d=` ${s} rc = outputLoc; ${f} - result[0] = getChannel(getX(${u.join()}), ${l}); + result[0] = getChannel(getX(${u.join()}), ${c}); ${p[n-1]} += 1; - if(${c}) { + if(${l}) { ${f} - result[1] = getChannel(getX(${u.join()}), ${l}); + result[1] = getChannel(getX(${u.join()}), ${c}); } rc = outputLoc; ${p[n-2]} += 1; if(${p[n-2]} < ${this.outputShape[n-2]}) { ${f} - result[2] = getChannel(getX(${u.join()}), ${l}); + result[2] = getChannel(getX(${u.join()}), ${c}); ${p[n-1]} += 1; - if(${c}) { + if(${l}) { ${f} - result[3] = getChannel(getX(${u.join()}), ${l}); + result[3] = getChannel(getX(${u.join()}), ${c}); } } `}this.userCode=` @@ -3968,13 +3968,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam ${d} setOutput(result); } - `}};var Mee=({inputs:r,backend:t,attrs:e})=>{let{x:o}=r,{paddings:n,mode:s}=e,a=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new dg(o.shape,n,s):new mg(o.shape,n,s);return t.runWebGLProgram(a,[o],o.dtype)},ZF={kernelName:Kn,backendName:"webgl",kernelFunc:Mee};var Lee=`if (b == 0.0) return NAN; - return mod(a, b);`,Bee=` + `}};var lre=({inputs:r,backend:e,attrs:t})=>{let{x:o}=r,{paddings:n,mode:s}=t,a=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new kg(o.shape,n,s):new vg(o.shape,n,s);return e.runWebGLProgram(a,[o],o.dtype)},U3={kernelName:is,backendName:"webgl",kernelFunc:lre};var cre=`if (b == 0.0) return NAN; + return mod(a, b);`,mre=` vec4 result = mod(a, b); bvec4 isNaN = equal(b, vec4(0.0)); - `+jr+` + `+to+` return result; -`,zee=nt({opSnippet:Lee,packedOpSnippet:Bee}),JF={kernelName:qn,backendName:"webgl",kernelFunc:zee};var fg=class{constructor(t,e,o){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[t,o],this.userCode=` +`,dre=st({opSnippet:cre,packedOpSnippet:mre}),G3={kernelName:us,backendName:"webgl",kernelFunc:dre};var Ng=class{constructor(e,t,o){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,o],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -3982,7 +3982,7 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam float r = random(seed); float cdf = 0.0; - for (int i = 0; i < ${e-1}; i++) { + for (int i = 0; i < ${t-1}; i++) { cdf += getProbs(batch, i); if (r < cdf) { @@ -3992,13 +3992,13 @@ return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,D9=xe({opSnippet:R9}),fA={kernelNam } // If no other event happened, last event happened. - setOutput(float(${e-1})); + setOutput(float(${t-1})); } - `}};var Vee=` + `}};var fre=` if (a == b) { return 1.0; }; -return a / b;`,Wee=` +return a / b;`,hre=` // vec4 one = vec4(equal(a, b)); // return one + (vec4(1.0) - one) * a / b; vec4 result = a / b; @@ -4016,9 +4016,9 @@ return a / b;`,Wee=` } return result; -`,_v=nt({opSnippet:Vee,packedOpSnippet:Wee,checkOutOfBounds:!0}),e3={kernelName:fn,backendName:"webgl",kernelFunc:_v};var t3="return a - b;",$v=nt({opSnippet:t3,packedOpSnippet:t3,supportsComplex:!0,cpuKernelImpl:bD}),r3={kernelName:Ts,backendName:"webgl",kernelFunc:$v};function Ev(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{dim:s}=o,a=y.parseAxisParam([s],n.shape),i=Tv({inputs:{x:n},backend:e,attrs:{reductionIndices:a,keepDims:!1}}),p=w.expandShapeToKeepDim(i.shape,a),u=te({inputs:{x:i},backend:e,attrs:{shape:p}}),c=$v({inputs:{a:n,b:u},backend:e}),l=vv({inputs:{x:c},backend:e}),m=bp({inputs:{x:l},backend:e,attrs:{axis:a,keepDims:!1}}),d=te({inputs:{x:m},backend:e,attrs:{shape:p}}),f=_v({inputs:{a:l,b:d},backend:e});return e.disposeIntermediateTensorInfo(i),e.disposeIntermediateTensorInfo(u),e.disposeIntermediateTensorInfo(c),e.disposeIntermediateTensorInfo(l),e.disposeIntermediateTensorInfo(m),e.disposeIntermediateTensorInfo(d),f}var o3={kernelName:Is,backendName:"webgl",kernelFunc:Ev};function Uee(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o,p=i?n:Ev({inputs:{logits:n},backend:e,attrs:{dim:n.shape.length-1}}),u=p.shape[0],c=p.shape[1],l=new fg(u,c,s),m=[[a]],d=e.runWebGLProgram(l,[p],"int32",m);return i||e.disposeIntermediateTensorInfo(p),d}var n3={kernelName:jn,backendName:"webgl",kernelFunc:Uee};var Gee=Wt+` +`,W0=st({opSnippet:fre,packedOpSnippet:hre,checkOutOfBounds:!0}),H3={kernelName:Vn,backendName:"webgl",kernelFunc:W0};var K3="return a - b;",U0=st({opSnippet:K3,packedOpSnippet:K3,supportsComplex:!0,cpuKernelImpl:lA}),q3={kernelName:Oo,backendName:"webgl",kernelFunc:U0};function G0(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{dim:s}=o,a=y.parseAxisParam([s],n.shape),i=V0({inputs:{x:n},backend:t,attrs:{reductionIndices:a,keepDims:!1}}),p=C.expandShapeToKeepDim(i.shape,a),u=te({inputs:{x:i},backend:t,attrs:{shape:p}}),l=U0({inputs:{a:n,b:u},backend:t}),c=L0({inputs:{x:l},backend:t}),m=Tp({inputs:{x:c},backend:t,attrs:{axis:a,keepDims:!1}}),d=te({inputs:{x:m},backend:t,attrs:{shape:p}}),f=W0({inputs:{a:c,b:d},backend:t});return t.disposeIntermediateTensorInfo(i),t.disposeIntermediateTensorInfo(u),t.disposeIntermediateTensorInfo(l),t.disposeIntermediateTensorInfo(c),t.disposeIntermediateTensorInfo(m),t.disposeIntermediateTensorInfo(d),f}var j3={kernelName:Fs,backendName:"webgl",kernelFunc:G0};function gre(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o,p=i?n:G0({inputs:{logits:n},backend:t,attrs:{dim:n.shape.length-1}}),u=p.shape[0],l=p.shape[1],c=new Ng(u,l,s),m=[[a]],d=t.runWebGLProgram(c,[p],"int32",m);return i||t.disposeIntermediateTensorInfo(p),d}var X3={kernelName:ps,backendName:"webgl",kernelFunc:gre};var xre=Gt+` return -x; -`,Hee=` +`,yre=` vec4 result = -x; bvec4 isNaN = isnan(x); @@ -4028,14 +4028,14 @@ return a / b;`,Wee=` result.a = isNaN.a ? x.a : result.a; return result; -`;function Kee(r){let{inputs:t,backend:e}=r,{x:o}=t;if(e.shouldExecuteOnCPU([o])){let s=e.texData.get(o.dataId),[a,i]=eD(s.values,o.shape,o.dtype);return e.makeTensorInfo(i,o.dtype,a)}let n;return A().getBool("WEBGL_PACK_UNARY_OPERATIONS")?n=new Ar(o.shape,Hee):n=new tr(o.shape,Gee),e.runWebGLProgram(n,[o],o.dtype)}var s3={kernelName:pa,backendName:"webgl",kernelFunc:Kee};var qee=Vt.nonMaxSuppressionV3Impl;function jee(r){w.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=e.readSync(n.dataId),c=e.readSync(s.dataId),{selectedIndices:l}=qee(u,c,a,i,p);return e.makeTensorInfo([l.length],"int32",new Int32Array(l))}var a3={kernelName:Qn,backendName:"webgl",kernelFunc:jee};var Xee=Vt.nonMaxSuppressionV4Impl;function Yee(r){w.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,padToMaxOutputSize:u}=o,c=e.readSync(n.dataId),l=e.readSync(s.dataId),{selectedIndices:m,validOutputs:d}=Xee(c,l,a,i,p,u);return[e.makeTensorInfo([m.length],"int32",new Int32Array(m)),e.makeTensorInfo([],"int32",new Int32Array([d]))]}var i3={kernelName:Qa,backendName:"webgl",kernelFunc:Yee};var Qee=Vt.nonMaxSuppressionV5Impl;function Zee(r){w.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,c=e.readSync(n.dataId),l=e.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=Qee(c,l,m,d,f,h);return[e.makeTensorInfo([g.length],"int32",new Int32Array(g)),e.makeTensorInfo([x.length],"float32",new Float32Array(x))]}var u3={kernelName:Zn,backendName:"webgl",kernelFunc:Zee};var hg=class{constructor(t,e,o,n){this.variableNames=["indices"],this.outputShape=[t,e],this.userCode=` +`;function bre(r){let{inputs:e,backend:t}=r,{x:o}=e;if(t.shouldExecuteOnCPU([o])){let s=t.texData.get(o.dataId),[a,i]=HD(s.values,o.shape,o.dtype);return t.makeTensorInfo(i,o.dtype,a)}let n;return A().getBool("WEBGL_PACK_UNARY_OPERATIONS")?n=new Lr(o.shape,yre):n=new nr(o.shape,xre),t.runWebGLProgram(n,[o],o.dtype)}var Y3={kernelName:ls,backendName:"webgl",kernelFunc:bre};var Cre=Ut.nonMaxSuppressionV3Impl;function wre(r){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=t.readSync(n.dataId),l=t.readSync(s.dataId),{selectedIndices:c}=Cre(u,l,a,i,p);return t.makeTensorInfo([c.length],"int32",new Int32Array(c))}var Q3={kernelName:cs,backendName:"webgl",kernelFunc:wre};var Sre=Ut.nonMaxSuppressionV4Impl;function Ire(r){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,padToMaxOutputSize:u}=o,l=t.readSync(n.dataId),c=t.readSync(s.dataId),{selectedIndices:m,validOutputs:d}=Sre(l,c,a,i,p,u);return[t.makeTensorInfo([m.length],"int32",new Int32Array(m)),t.makeTensorInfo([],"int32",new Int32Array([d]))]}var Z3={kernelName:ni,backendName:"webgl",kernelFunc:Ire};var vre=Ut.nonMaxSuppressionV5Impl;function kre(r){C.warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,l=t.readSync(n.dataId),c=t.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=vre(l,c,m,d,f,h);return[t.makeTensorInfo([g.length],"int32",new Int32Array(g)),t.makeTensorInfo([x.length],"float32",new Float32Array(x))]}var J3={kernelName:ms,backendName:"webgl",kernelFunc:kre};var Tg=class{constructor(e,t,o,n){this.variableNames=["indices"],this.outputShape=[e,t],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int index = round(getIndices(coords.x)); setOutput(mix(float(${n}), float(${o}), float(index == coords.y))); } - `}};var Jee=r=>{let{inputs:t,backend:e,attrs:o}=r,{indices:n}=t,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),c=new hg(u,a,i,p),l=te({inputs:{x:n},backend:e,attrs:{shape:[u]}}),m=e.runWebGLProgram(c,[l],s);e.disposeIntermediateTensorInfo(l);let d=[...n.shape,a],f=te({inputs:{x:m},backend:e,attrs:{shape:d}});return e.disposeIntermediateTensorInfo(m),f},p3={kernelName:Jn,backendName:"webgl",kernelFunc:Jee};function om(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype==="complex64"){let n=yi({inputs:{input:o},backend:e}),s=om({inputs:{x:n},backend:e}),a=wp({inputs:{input:o},backend:e}),i=om({inputs:{x:a},backend:e}),p=Pr({inputs:{real:s,imag:i},backend:e});return e.disposeIntermediateTensorInfo(n),e.disposeIntermediateTensorInfo(s),e.disposeIntermediateTensorInfo(a),e.disposeIntermediateTensorInfo(i),p}else return bi({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype==="string"?"":0},backend:e})}var c3={kernelName:Sa,backendName:"webgl",kernelFunc:om};function l3(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(o.dtype==="complex64"){let n=yi({inputs:{input:o},backend:e}),s=l3({inputs:{x:n},backend:e}),a=wp({inputs:{input:o},backend:e}),i=om({inputs:{x:a},backend:e}),p=Pr({inputs:{real:s,imag:i},backend:e});return e.disposeIntermediateTensorInfo(n),e.disposeIntermediateTensorInfo(s),e.disposeIntermediateTensorInfo(a),e.disposeIntermediateTensorInfo(i),p}else return bi({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:e})}var m3={kernelName:ca,backendName:"webgl",kernelFunc:l3};function ete(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o;if(t.length===1)return Jh({inputs:{input:t[0]},backend:e,attrs:{dim:n}});let s=t[0].shape,a=t[0].dtype;t.forEach(c=>{y.assertShapesMatch(s,c.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===c.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=t.map(c=>{let l=Jh({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=Iv({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeIntermediateTensorInfo(c)),u}var d3={kernelName:la,backendName:"webgl",kernelFunc:ete};var gg=class{constructor(t,e,o){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=e.map((u,c)=>u[0]+t[c]+u[1]);let n=t.length,s=Re(n),a=e.map(u=>u[0]).join(","),i=e.map((u,c)=>u[0]+t[c]).join(","),p=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n);if(n===1){this.userCode=` + `}};var Nre=r=>{let{inputs:e,backend:t,attrs:o}=r,{indices:n}=e,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),l=new Tg(u,a,i,p),c=te({inputs:{x:n},backend:t,attrs:{shape:[u]}}),m=t.runWebGLProgram(l,[c],s);t.disposeIntermediateTensorInfo(c);let d=[...n.shape,a],f=te({inputs:{x:m},backend:t,attrs:{shape:d}});return t.disposeIntermediateTensorInfo(m),f},eP={kernelName:ds,backendName:"webgl",kernelFunc:Nre};function mm(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype==="complex64"){let n=_i({inputs:{input:o},backend:t}),s=mm({inputs:{x:n},backend:t}),a=Ep({inputs:{input:o},backend:t}),i=mm({inputs:{x:a},backend:t}),p=zr({inputs:{real:s,imag:i},backend:t});return t.disposeIntermediateTensorInfo(n),t.disposeIntermediateTensorInfo(s),t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(i),p}else return Ei({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype==="string"?"":0},backend:t})}var tP={kernelName:_a,backendName:"webgl",kernelFunc:mm};function rP(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(o.dtype==="complex64"){let n=_i({inputs:{input:o},backend:t}),s=rP({inputs:{x:n},backend:t}),a=Ep({inputs:{input:o},backend:t}),i=mm({inputs:{x:a},backend:t}),p=zr({inputs:{real:s,imag:i},backend:t});return t.disposeIntermediateTensorInfo(n),t.disposeIntermediateTensorInfo(s),t.disposeIntermediateTensorInfo(a),t.disposeIntermediateTensorInfo(i),p}else return Ei({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:t})}var oP={kernelName:xa,backendName:"webgl",kernelFunc:rP};function Tre(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o;if(e.length===1)return cg({inputs:{input:e[0]},backend:t,attrs:{dim:n}});let s=e[0].shape,a=e[0].dtype;e.forEach(l=>{y.assertShapesMatch(s,l.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===l.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=e.map(l=>{let c=cg({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=M0({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeIntermediateTensorInfo(l)),u}var nP={kernelName:ya,backendName:"webgl",kernelFunc:Tre};var _g=class{constructor(e,t,o){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((u,l)=>u[0]+e[l]+u[1]);let n=e.length,s=Re(n),a=t.map(u=>u[0]).join(","),i=t.map((u,l)=>u[0]+e[l]).join(","),p=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n);if(n===1){this.userCode=` int start = ${a}; int end = ${i}; @@ -4060,19 +4060,19 @@ return a / b;`,Wee=` setOutput(getX(${p})); } } - `}};var xg=class{constructor(t,e,o){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=e.map((h,g)=>h[0]+t[g]+h[1]);let n=t.length,s=Re(n),a=e.map(h=>h[0]).join(","),i=e.map((h,g)=>h[0]+t[g]).join(","),p=Rt("rc",n),u=Rt("source",n),c=`${p[n-1]} < ${this.outputShape[n-1]}`,l=n===1?"source":`vec2(${u.slice(-2).join()})`,m=[`${s} rc = outputLoc;`,`${p[n-1]} += 1; - if(${c}) { + `}};var Eg=class{constructor(e,t,o){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((h,g)=>h[0]+e[g]+h[1]);let n=e.length,s=Re(n),a=t.map(h=>h[0]).join(","),i=t.map((h,g)=>h[0]+e[g]).join(","),p=At("rc",n),u=At("source",n),l=`${p[n-1]} < ${this.outputShape[n-1]}`,c=n===1?"source":`vec2(${u.slice(-2).join()})`,m=[`${s} rc = outputLoc;`,`${p[n-1]} += 1; + if(${l}) { `,n===1?"":`} rc = outputLoc; ${p[n-2]} += 1; if(${p[n-2]} < ${this.outputShape[n-2]}) {`,n===1?"":` ${p[n-1]} += 1; - if(${c}) {`],d=n===1?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",f="";for(let h=0,g=n===1?2:4;h= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",f="";for(let h=0,g=n===1?2:4;h{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{paddings:s,constantValue:a}=o;if(y.sizeFromShape(n.shape)===0){let u=s.map((c,l)=>c[0]+n.shape[l]+c[1]);return bi({backend:e,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new xg(n.shape,s,a):new gg(n.shape,s,a),p=[[a]];return e.runWebGLProgram(i,[n],n.dtype,p)},f3={kernelName:es,backendName:"webgl",kernelFunc:Rv};var tte=` + `}};var H0=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{paddings:s,constantValue:a}=o;if(y.sizeFromShape(n.shape)===0){let u=s.map((l,c)=>l[0]+n.shape[c]+l[1]);return Ei({backend:t,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Eg(n.shape,s,a):new _g(n.shape,s,a),p=[[a]];return t.runWebGLProgram(i,[n],n.dtype,p)},sP={kernelName:fs,backendName:"webgl",kernelFunc:H0};var _re=` if(a < 0.0 && floor(b) < b){ return NAN; } @@ -4093,7 +4093,7 @@ return a / b;`,Wee=` } return (round(mod(b, 2.0)) != 1) ? pow(abs(a), b) : sign(a) * pow(abs(a), b); -`,rte=` +`,Ere=` // 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); @@ -4109,11 +4109,11 @@ return a / b;`,Wee=` bvec4 isNaN1 = lessThan(a, vec4(0.0)); bvec4 isNaN2 = lessThan(floor(b), b); bvec4 isNaN = bvec4(isNaN1.x && isNaN2.x, isNaN1.y && isNaN2.y, isNaN1.z && isNaN2.z, isNaN1.w && isNaN2.w); - `+jr+` + `+to+` return result; -`,ote=nt({opSnippet:tte,packedOpSnippet:rte}),h3={kernelName:ts,backendName:"webgl",kernelFunc:ote};function nte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o,i=n.shape.length,p=[],u=y.parseAxisParam(s,n.shape),c=u,l=w.getAxesPermutation(c,i),m=n;l!=null&&(m=bt({inputs:{x:n},backend:e,attrs:{perm:l}}),c=w.getInnerMostAxes(c.length,i),p.push(m)),w.assertAxesAreInnerMostDims("prod",c,i);let d;if(e.shouldExecuteOnCPU([m])){let f=e.texData.get(m.dataId).values,{outVals:h,outShape:g,outDtype:x}=rD(m.shape,m.dtype,f,c);d=e.makeTensorInfo(g,x,h)}else{let[f,h]=w.computeOutAndReduceShapes(m.shape,c),g=y.sizeFromShape(h),x=te({inputs:{x:m},backend:e,attrs:{shape:[-1,g]}}),b=oi(n.dtype),C=Xr(x,b,"prod",e);d=te({inputs:{x:C},backend:e,attrs:{shape:f}}),p.push(x),p.push(C)}if(a){p.push(d);let f=w.expandShapeToKeepDim(d.shape,u);d=te({inputs:{x:d},backend:e,attrs:{shape:f}})}return p.forEach(f=>e.disposeIntermediateTensorInfo(f)),d}var g3={kernelName:os,backendName:"webgl",kernelFunc:nte};function ste(r){let{inputs:t,backend:e,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=t,{outputRaggedRank:i}=o,p=n.map(x=>e.readSync(x.dataId)),u=n.map(x=>x.shape),c=e.readSync(s.dataId),l=e.readSync(a.dataId),[m,d,f]=oD(p,u,c,s.shape,s.dtype,l,a.shape,i),h=m.map(x=>e.makeTensorInfo([x.length],"int32",x)),g=e.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var x3={kernelName:Up,backendName:"webgl",kernelFunc:ste};function ate(r){let{inputs:t,backend:e}=r,{starts:o,limits:n,deltas:s}=t,a=e.readSync(o.dataId),i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,c]=nD(a,o.shape,o.dtype,i,n.shape,p,s.shape),l=e.makeTensorInfo([u.length],"int32",u),m=e.makeTensorInfo([c.length],o.dtype,c);return[l,m]}var y3={kernelName:Gp,backendName:"webgl",kernelFunc:ate};function ite(r){let{inputs:t,backend:e,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=t,{rowPartitionTypes:p}=o,u=e.readSync(n.dataId),c=e.readSync(s.dataId),l=e.readSync(a.dataId),m=i.map(g=>e.readSync(g.dataId)),d=i.map(g=>g.shape),[f,h]=sD(u,n.shape,c,s.shape,s.dtype,l,a.shape,m,d,p);return e.makeTensorInfo(f,s.dtype,h)}var b3={kernelName:Hp,backendName:"webgl",kernelFunc:ite};var Dv=r=>{let{backend:t,attrs:e}=r,{start:o,stop:n,step:s,dtype:a}=e,i=aD(o,n,s,a);return t.makeTensorInfo([i.length],a,i)},C3={kernelName:ma,backendName:"webgl",kernelFunc:Dv};var ute="return 1.0 / x;",pte=xe({opSnippet:ute}),w3={kernelName:ns,backendName:"webgl",kernelFunc:pte};var cte=Wt+` +`,$re=st({opSnippet:_re,packedOpSnippet:Ere}),aP={kernelName:hs,backendName:"webgl",kernelFunc:$re};function Rre(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o,i=n.shape.length,p=[],u=y.parseAxisParam(s,n.shape),l=u,c=C.getAxesPermutation(l,i),m=n;c!=null&&(m=Ct({inputs:{x:n},backend:t,attrs:{perm:c}}),l=C.getInnerMostAxes(l.length,i),p.push(m)),C.assertAxesAreInnerMostDims("prod",l,i);let d;if(t.shouldExecuteOnCPU([m])){let f=t.texData.get(m.dataId).values,{outVals:h,outShape:g,outDtype:x}=qD(m.shape,m.dtype,f,l);d=t.makeTensorInfo(g,x,h)}else{let[f,h]=C.computeOutAndReduceShapes(m.shape,l),g=y.sizeFromShape(h),x=te({inputs:{x:m},backend:t,attrs:{shape:[-1,g]}}),b=mi(n.dtype),w=ro(x,b,"prod",t);d=te({inputs:{x:w},backend:t,attrs:{shape:f}}),p.push(x),p.push(w)}if(a){p.push(d);let f=C.expandShapeToKeepDim(d.shape,u);d=te({inputs:{x:d},backend:t,attrs:{shape:f}})}return p.forEach(f=>t.disposeIntermediateTensorInfo(f)),d}var iP={kernelName:Ho,backendName:"webgl",kernelFunc:Rre};function Dre(r){let{inputs:e,backend:t,attrs:o}=r,{paramsNestedSplits:n,paramsDenseValues:s,indices:a}=e,{outputRaggedRank:i}=o,p=n.map(x=>t.readSync(x.dataId)),u=n.map(x=>x.shape),l=t.readSync(s.dataId),c=t.readSync(a.dataId),[m,d,f]=jD(p,u,l,s.shape,s.dtype,c,a.shape,i),h=m.map(x=>t.makeTensorInfo([x.length],"int32",x)),g=t.makeTensorInfo(f,s.dtype,d);return h.concat([g])}var uP={kernelName:Qp,backendName:"webgl",kernelFunc:Dre};function Are(r){let{inputs:e,backend:t}=r,{starts:o,limits:n,deltas:s}=e,a=t.readSync(o.dataId),i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,l]=XD(a,o.shape,o.dtype,i,n.shape,p,s.shape),c=t.makeTensorInfo([u.length],"int32",u),m=t.makeTensorInfo([l.length],o.dtype,l);return[c,m]}var pP={kernelName:Zp,backendName:"webgl",kernelFunc:Are};function Fre(r){let{inputs:e,backend:t,attrs:o}=r,{shape:n,values:s,defaultValue:a,rowPartitionTensors:i}=e,{rowPartitionTypes:p}=o,u=t.readSync(n.dataId),l=t.readSync(s.dataId),c=t.readSync(a.dataId),m=i.map(g=>t.readSync(g.dataId)),d=i.map(g=>g.shape),[f,h]=YD(u,n.shape,l,s.shape,s.dtype,c,a.shape,m,d,p);return t.makeTensorInfo(f,s.dtype,h)}var lP={kernelName:Jp,backendName:"webgl",kernelFunc:Fre};var K0=r=>{let{backend:e,attrs:t}=r,{start:o,stop:n,step:s,dtype:a}=t,i=QD(o,n,s,a);return e.makeTensorInfo([i.length],a,i)},cP={kernelName:ba,backendName:"webgl",kernelFunc:K0};var Pre="return 1.0 / x;",Ore=xe({opSnippet:Pre}),mP={kernelName:xs,backendName:"webgl",kernelFunc:Ore};var Mre=Gt+` return (x < 0.0) ? 0.0 : x; -`,lte=` +`,Lre=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -4123,9 +4123,9 @@ return a / b;`,Wee=` result.a = isNaN.a ? x.a : result.a; return result; -`,mte=xe({opSnippet:cte,packedOpSnippet:lte}),S3={kernelName:ss,backendName:"webgl",kernelFunc:mte};var dte=Wt+` +`,Bre=xe({opSnippet:Mre,packedOpSnippet:Lre}),dP={kernelName:ys,backendName:"webgl",kernelFunc:Bre};var zre=Gt+` return (x < 0.0) ? 0.0 : min(6.0, x); -`,fte=` +`,Vre=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); @@ -4135,10 +4135,10 @@ return a / b;`,Wee=` result.a = isNaN.a ? x.a : result.a; return result; -`,hte=xe({opSnippet:dte,packedOpSnippet:fte}),I3={kernelName:us,backendName:"webgl",kernelFunc:hte};var yg=class{constructor(t,e,o,n,s){this.variableNames=["A"],this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m;s?m="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":m="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` +`,Wre=xe({opSnippet:zre,packedOpSnippet:Vre}),fP={kernelName:ws,backendName:"webgl",kernelFunc:Wre};var $g=class{constructor(e,t,o,n,s){this.variableNames=["A"],this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m;s?m="(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":m="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0]/l[0]}, - ${c[1]/l[1]}); + ${l[0]/c[0]}, + ${l[1]/c[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${p}.0); void main() { @@ -4168,11 +4168,11 @@ return a / b;`,Wee=` setOutput(newValue); } - `}};var bg=class{constructor(t,e,o,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m;s?m="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":m="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}};var Rg=class{constructor(e,t,o,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m;s?m="(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":m="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${c[0]/l[0]}, - ${c[1]/l[1]}, - ${c[1]/l[1]}); + ${l[0]/c[0]}, + ${l[1]/c[1]}, + ${l[1]/c[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${p}.0, ${p}.0); @@ -4245,7 +4245,7 @@ return a / b;`,Wee=` setOutput(newValue); } - `}};function gte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,c=A().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new bg(n.shape,p,u,s,a):new yg(n.shape,p,u,s,a);return e.runWebGLProgram(c,[n],"float32")}var v3={kernelName:is,backendName:"webgl",kernelFunc:gte};var Cg=class{constructor(t,e,o){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e;let[,n,s]=e,[,a,i]=t,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],c=p[0]/u[0],l=p[1]/u[1],m=1/c,d=1/l,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=` + `}};function Ure(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,l=A().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Rg(n.shape,p,u,s,a):new $g(n.shape,p,u,s,a);return t.runWebGLProgram(l,[n],"float32")}var hP={kernelName:Cs,backendName:"webgl",kernelFunc:Ure};var Dg=class{constructor(e,t,o){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,s]=t,[,a,i]=e,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],l=p[0]/u[0],c=p[1]/u[1],m=1/l,d=1/c,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -4255,8 +4255,8 @@ return a / b;`,Wee=` float accumulator = 0.0; - const float heightScale = float(${c}); - const float widthScale = float(${l}); + const float heightScale = float(${l}); + const float widthScale = float(${c}); const float invHeightScale = float(${m}); const float invWidthScale = float(${d}); @@ -4326,10 +4326,10 @@ return a / b;`,Wee=` setOutput(accumulator); } - `}};function xte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=new Cg(s.shape,n.shape,a);return e.runWebGLProgram(i,[s],s.dtype)}var k3={kernelName:Ja,backendName:"webgl",kernelFunc:xte};var wg=class{constructor(t,e,o,n,s){this.variableNames=["A"],this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m=n?"0.5":"0.0",d;s?d="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":d="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}};function Gre(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=new Dg(s.shape,n.shape,a);return t.runWebGLProgram(i,[s],s.dtype)}var gP={kernelName:ii,backendName:"webgl",kernelFunc:Gre};var Ag=class{constructor(e,t,o,n,s){this.variableNames=["A"],this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m=n?"0.5":"0.0",d;s?d="max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":d="vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( - ${c[0]/l[0]}, - ${c[1]/l[1]}); + ${l[0]/c[0]}, + ${l[1]/c[1]}); const vec2 inputShapeRC = vec2(${i}.0, ${p}.0); void main() { @@ -4348,11 +4348,11 @@ return a / b;`,Wee=` setOutput(newValue); } - `}};var Sg=class{constructor(t,e,o,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=t;this.outputShape=[a,e,o,u];let c=[n&&e>1?i-1:i,n&&o>1?p-1:p],l=[n&&e>1?e-1:e,n&&o>1?o-1:o],m=n?"0.5":"0.0",d;s?d="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":d="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` + `}};var Fg=class{constructor(e,t,o,n,s){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[a,i,p,u]=e;this.outputShape=[a,t,o,u];let l=[n&&t>1?i-1:i,n&&o>1?p-1:p],c=[n&&t>1?t-1:t,n&&o>1?o-1:o],m=n?"0.5":"0.0",d;s?d="max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":d="vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( - ${c[0]/l[0]}, - ${c[1]/l[1]}, - ${c[1]/l[1]}); + ${l[0]/c[0]}, + ${l[1]/c[1]}, + ${l[1]/c[1]}); const vec3 inputShapeRC = vec3(${i}.0, ${p}.0, ${p}.0); @@ -4389,7 +4389,7 @@ return a / b;`,Wee=` setOutput(newValue); } - `}};function yte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,c=A().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Sg(n.shape,p,u,s,a):new wg(n.shape,p,u,s,a);return e.runWebGLProgram(c,[n],n.dtype)}var N3={kernelName:as,backendName:"webgl",kernelFunc:yte};var Ig=class{constructor(t,e,o){this.variableNames=["dy"],this.outputShape=[],this.outputShape=e;let[,n,s]=e,[,a,i]=t,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],c=p[0]/u[0],l=p[1]/u[1],m=1/c,d=1/l,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=` + `}};function Hre(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,l=A().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new Fg(n.shape,p,u,s,a):new Ag(n.shape,p,u,s,a);return t.runWebGLProgram(l,[n],n.dtype)}var xP={kernelName:bs,backendName:"webgl",kernelFunc:Hre};var Pg=class{constructor(e,t,o){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,s]=t,[,a,i]=e,p=[o&&a>1?n-1:n,o&&i>1?s-1:s],u=[o&&a>1?a-1:a,o&&i>1?i-1:i],l=p[0]/u[0],c=p[1]/u[1],m=1/l,d=1/c,f=Math.ceil(m)*2+2,h=Math.ceil(d)*2+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; @@ -4399,8 +4399,8 @@ return a / b;`,Wee=` float accumulator = 0.0; - const float heightScale = float(${c}); - const float widthScale = float(${l}); + const float heightScale = float(${l}); + const float widthScale = float(${c}); const float invHeightScale = float(${m}); const float invWidthScale = float(${d}); @@ -4459,25 +4459,25 @@ return a / b;`,Wee=` setOutput(accumulator); } - `}};function bte(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=new Ig(s.shape,n.shape,a);return e.runWebGLProgram(i,[s],s.dtype)}var T3={kernelName:Za,backendName:"webgl",kernelFunc:bte};var vg=class{constructor(t,e){this.variableNames=["x"];let o=t.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);if(this.outputShape=t,o===1){this.userCode=` + `}};function Kre(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=new Pg(s.shape,n.shape,a);return t.runWebGLProgram(i,[s],s.dtype)}var yP={kernelName:ai,backendName:"webgl",kernelFunc:Kre};var Og=class{constructor(e,t){this.variableNames=["x"];let o=e.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);if(this.outputShape=e,o===1){this.userCode=` void main() { int coord = getOutputCoords(); - setOutput(getX(${t[0]} - coord - 1)); + setOutput(getX(${e[0]} - coord - 1)); } - `;return}let n=i=>e.indexOf(i)!==-1&&t[i]!==1?`${t[i]} - coords[${i}] - 1`:`coords[${i}]`,s=t.map((i,p)=>n(p)).join(","),a=Re(o);this.userCode=` + `;return}let n=i=>t.indexOf(i)!==-1&&e[i]!==1?`${e[i]} - coords[${i}] - 1`:`coords[${i}]`,s=e.map((i,p)=>n(p)).join(","),a=Re(o);this.userCode=` void main() { ${a} coords = getOutputCoords(); setOutput(getX(${s})); } - `}};var kg=class{constructor(t,e){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let o=t.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);this.outputShape=t;let n=Rt("rc",o),s=`${n[o-1]} + 1 < ${this.outputShape[o-1]}`,a=`${n[o-2]} + 1 < ${this.outputShape[o-2]}`,i=Re(o);o===1?this.userCode=` + `}};var Mg=class{constructor(e,t){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let o=e.length;if(o>4)throw new Error(`WebGL backend: Reverse of rank-${o} tensor is not yet supported`);this.outputShape=e;let n=At("rc",o),s=`${n[o-1]} + 1 < ${this.outputShape[o-1]}`,a=`${n[o-2]} + 1 < ${this.outputShape[o-2]}`,i=Re(o);o===1?this.userCode=` void main(){ int rc = getOutputCoords(); vec4 result = vec4(0.); - result.r = getChannel(getX(${t[0]} - rc - 1), - ${t[0]} - rc - 1); + result.r = getChannel(getX(${e[0]} - rc - 1), + ${e[0]} - rc - 1); if(${s}){ - result.g = getChannel(getX(${t[0]} - (rc + 1) - 1), - ${t[0]} - (rc + 1) - 1); + result.g = getChannel(getX(${e[0]} - (rc + 1) - 1), + ${e[0]} - (rc + 1) - 1); } setOutput(result); } @@ -4490,15 +4490,15 @@ return a / b;`,Wee=` result.g = ${u(n.slice())}; } if(${a}) { - result.b = ${c(n.slice())}; + result.b = ${l(n.slice())}; if(${s}) { - result.a = ${l(n.slice())}; + result.a = ${c(n.slice())}; } } setOutput(result); } - `;function p(f){return m(f)}function u(f){return f[o-1]="("+f[o-1]+" + 1)",m(f)}function c(f){return f[o-2]="("+f[o-2]+" + 1)",m(f)}function l(f){return f[o-1]="("+f[o-1]+" + 1)",f[o-2]="("+f[o-2]+" + 1)",m(f)}function m(f){let h=t.map((b,C)=>d(C,f)),g=h.join(","),x=h.slice(-2).join(",");return`getChannel(getX(${g}), vec2(${x}))`}function d(f,h){return e.indexOf(f)!==-1&&t[f]!==1?`${t[f]} - ${h[f]} - 1`:`${h[f]}`}}};function Cte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o,a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return Dt({inputs:{x:n},backend:e});let p=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new kg(n.shape,i):new vg(n.shape,i);return e.runWebGLProgram(p,[n],n.dtype)}var _3={kernelName:ps,backendName:"webgl",kernelFunc:Cte};var Ng=class{constructor(t,e){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];let o=t[1],n=t[2];this.outputShape=t;let s="";typeof e=="number"?s=`float outputValue = ${e.toFixed(2)};`:s=` - vec3 fill = vec3(${e.join(",")}); + `;function p(f){return m(f)}function u(f){return f[o-1]="("+f[o-1]+" + 1)",m(f)}function l(f){return f[o-2]="("+f[o-2]+" + 1)",m(f)}function c(f){return f[o-1]="("+f[o-1]+" + 1)",f[o-2]="("+f[o-2]+" + 1)",m(f)}function m(f){let h=e.map((b,w)=>d(w,f)),g=h.join(","),x=h.slice(-2).join(",");return`getChannel(getX(${g}), vec2(${x}))`}function d(f,h){return t.indexOf(f)!==-1&&e[f]!==1?`${e[f]} - ${h[f]} - 1`:`${h[f]}`}}};function qre(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o,a=n.shape.length,i=y.parseAxisParam(s,n.shape);if(a===0)return Ft({inputs:{x:n},backend:t});let p=A().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new Mg(n.shape,i):new Og(n.shape,i);return t.runWebGLProgram(p,[n],n.dtype)}var bP={kernelName:Ss,backendName:"webgl",kernelFunc:qre};var Lg=class{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];let o=e[1],n=e[2];this.outputShape=e;let s="";typeof t=="number"?s=`float outputValue = ${t.toFixed(2)};`:s=` + vec3 fill = vec3(${t.join(",")}); float outputValue = fill[coords[3]];`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); @@ -4516,7 +4516,7 @@ return a / b;`,Wee=` } setOutput(outputValue); } - `}};var $3={kernelName:Ds,backendName:"webgl",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=t,i=e,p=new Ng(o.shape,s),[u,c]=w.getImageCenter(a,o.shape[1],o.shape[2]),l=[[u,c,Math.sin(n),Math.cos(n)]];return i.runWebGLProgram(p,[o],o.dtype,l)}};var wte=` + `}};var CP={kernelName:Vs,backendName:"webgl",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=e,i=t,p=new Lg(o.shape,s),[u,l]=C.getImageCenter(a,o.shape[1],o.shape[2]),c=[[u,l,Math.sin(n),Math.cos(n)]];return i.runWebGLProgram(p,[o],o.dtype,c)}};var jre=` // OpenGL ES does not support round function. // The algorithm is based on banker's rounding. float base = floor(x); @@ -4531,16 +4531,16 @@ return a / b;`,Wee=` return base + 1.0; } } -`,Ste=xe({opSnippet:wte}),E3={kernelName:cs,backendName:"webgl",kernelFunc:Ste};var Ite="return inversesqrt(x);",vte=xe({opSnippet:Ite,cpuKernelImpl:iD}),R3={kernelName:ls,backendName:"webgl",kernelFunc:vte};var yu=class{constructor(t,e,o,n,s,a,i=!0,p=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=a;let u=Re(s.length),c=Re(a.length),l="";o===1?l="i":o===2&&(l="i, j");let m=`getIndices(${l})`,d="";n===1?d="i":n===2&&(d="i, coords[1]");let f=`getUpdates(${d})`,h="";p&&(h="coords[0], coords[1]");let g=`getDefaultValue(${h})`,x=e>1?"strides[j]":"strides";this.userCode=` +`,Xre=xe({opSnippet:jre}),wP={kernelName:Is,backendName:"webgl",kernelFunc:Xre};var Yre="return inversesqrt(x);",Qre=xe({opSnippet:Yre,cpuKernelImpl:ZD}),SP={kernelName:Do,backendName:"webgl",kernelFunc:Qre};var Tu=class{constructor(e,t,o,n,s,a,i=!0,p=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=a;let u=Re(s.length),l=Re(a.length),c="";o===1?c="i":o===2&&(c="i, j");let m=`getIndices(${c})`,d="";n===1?d="i":n===2&&(d="i, coords[1]");let f=`getUpdates(${d})`,h="";p&&(h="coords[0], coords[1]");let g=`getDefaultValue(${h})`,x=t>1?"strides[j]":"strides";this.userCode=` ${u} strides = ${u}(${s}); void main() { - ${c} coords = getOutputCoords(); + ${l} coords = getOutputCoords(); float sum = 0.0; bool found = false; - for (int i = 0; i < ${t}; i++) { + for (int i = 0; i < ${e}; i++) { int flattenedIndex = 0; - for (int j = 0; j < ${e}; j++) { + for (int j = 0; j < ${t}; j++) { int index = round(${m}); flattenedIndex += index * ${x}; } @@ -4551,19 +4551,19 @@ return a / b;`,Wee=` } setOutput(mix(${g}, sum, float(found))); } - `}};var Tg=class{constructor(t,e,o,n,s,a,i=!0,p=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a;let u=Re(s.length),c=Re(a.length),l="";o===1?l="i":o===2&&(l="i, j");let m=`getIndices(${l})`,d="";n===1?d="i":n===2&&(d="i, coords[1]");let f=`getUpdates(${d})`,h="";p&&(h="coords[0], coords[1]");let g=`getDefaultValue(${h})`,x=e>1?"strides[j]":"strides",b=e>1?"strides[j + 1]":"strides";this.userCode=` + `}};var Bg=class{constructor(e,t,o,n,s,a,i=!0,p=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=a;let u=Re(s.length),l=Re(a.length),c="";o===1?c="i":o===2&&(c="i, j");let m=`getIndices(${c})`,d="";n===1?d="i":n===2&&(d="i, coords[1]");let f=`getUpdates(${d})`,h="";p&&(h="coords[0], coords[1]");let g=`getDefaultValue(${h})`,x=t>1?"strides[j]":"strides",b=t>1?"strides[j + 1]":"strides";this.userCode=` ${u} strides = ${u}(${s}); void main() { - ${c} coords = getOutputCoords(); + ${l} coords = getOutputCoords(); vec4 sum = vec4(0.); vec4 found = vec4(0.); - for (int i = 0; i < ${t}; i+=2) { + for (int i = 0; i < ${e}; i+=2) { ivec2 flattenedIndex = ivec2(0); - for (int j = 0; j < ${e}; j+=2) { + for (int j = 0; j < ${t}; j+=2) { ivec4 index = round(${m}); flattenedIndex += index.xz * ${x}; - if (j + 1 < ${e}) { + if (j + 1 < ${t}) { flattenedIndex += index.yw * ${b}; } } @@ -4588,7 +4588,7 @@ return a / b;`,Wee=` } setOutput(mix(${g}, sum, found)); } - `}};function kte(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(s,n,a),m=[l/u,u];if(l===0)return e.makeTensorInfo(a,n.dtype);let d=te({inputs:{x:n},backend:e,attrs:{shape:[p,i]}}),f=te({inputs:{x:s},backend:e,attrs:{shape:[p,u]}}),h=e.makeTensorInfo([],"float32",new Float32Array([0])),g;A().getBool("WEBGL_PACK")?g=new Tg(p,i,d.shape.length,f.shape.length,c,m):g=new yu(p,i,d.shape.length,f.shape.length,c,m);let x=e.runWebGLProgram(g,[f,d,h],f.dtype),b=te({inputs:{x},backend:e,attrs:{shape:a}});return e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(x),e.disposeIntermediateTensorInfo(h),b}var D3={kernelName:ms,backendName:"webgl",kernelFunc:kte};var _g=class{constructor(t,e,o,n){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[t,o];let s="while (left < right) {",a=`for (int i = 0; i < ${Math.ceil(Math.log2(e+1))}; ++i) { if (left >= right) break;`,i=A().getNumber("WEBGL_VERSION")===2?s:a,p=n==="left"?"<":"<=";this.userCode=` + `}};function Zre(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(s,n,a),m=[c/u,u];if(c===0)return t.makeTensorInfo(a,n.dtype);let d=te({inputs:{x:n},backend:t,attrs:{shape:[p,i]}}),f=te({inputs:{x:s},backend:t,attrs:{shape:[p,u]}}),h=t.makeTensorInfo([],"float32",new Float32Array([0])),g;A().getBool("WEBGL_PACK")?g=new Bg(p,i,d.shape.length,f.shape.length,l,m):g=new Tu(p,i,d.shape.length,f.shape.length,l,m);let x=t.runWebGLProgram(g,[f,d,h],f.dtype),b=te({inputs:{x},backend:t,attrs:{shape:a}});return t.disposeIntermediateTensorInfo(d),t.disposeIntermediateTensorInfo(f),t.disposeIntermediateTensorInfo(x),t.disposeIntermediateTensorInfo(h),b}var IP={kernelName:vs,backendName:"webgl",kernelFunc:Zre};var zg=class{constructor(e,t,o,n){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,o];let s="while (left < right) {",a=`for (int i = 0; i < ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,i=A().getNumber("WEBGL_VERSION")===2?s:a,p=n==="left"?"<":"<=";this.userCode=` int findBound(int batch, float value) { int left = 0; int right = numInputs; @@ -4613,7 +4613,7 @@ return a / b;`,Wee=` setOutput(float(findBound(batch, value))); } - `}};function Nte(r){let{inputs:t,backend:e,attrs:o}=r,{sortedSequence:n,values:s}=t,{side:a}=o,i=new _g(n.shape[0],n.shape[1],s.shape[1],a),p=[[n.shape[1]]];return e.runWebGLProgram(i,[n,s],"int32",p)}var A3={kernelName:fs,backendName:"webgl",kernelFunc:Nte};var $g=class{constructor(t,e,o){this.variableNames=["c","a","b"],this.outputShape=e;let n,s;if(o>4)throw Error(`Where for rank ${o} is not yet supported`);if(o===1)s="resRC",n="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],p=[],u=[];for(let c=0;c4)throw Error(`Where for rank ${o} is not yet supported`);if(o===1)s="resRC",n="resRC";else{let i=["resRC.x","resRC.y","resRC.z","resRC.w"],p=[],u=[];for(let l=0;l= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); -`,$te=xe({opSnippet:_te}),P3={kernelName:hs,backendName:"webgl",kernelFunc:$te};var Ete=Fo+` +`,roe=xe({opSnippet:toe}),NP={kernelName:Ts,backendName:"webgl",kernelFunc:roe};var ooe=sn+` return 1.0 / (1.0 + exp(-1.0 * x)); -`,Rte=` +`,noe=` vec4 result = 1.0 / (1.0 + exp(-1.0 * x)); bvec4 isNaN = isnan(x); @@ -4641,20 +4641,20 @@ return a / b;`,Wee=` result.a = isNaN.a ? x.a : result.a; return result; -`,Dte=xe({opSnippet:Ete,packedOpSnippet:Rte,cpuKernelImpl:pD}),O3={kernelName:bs,backendName:"webgl",kernelFunc:Dte};var Ate=` +`,soe=xe({opSnippet:ooe,packedOpSnippet:noe,cpuKernelImpl:eA}),TP={kernelName:Ao,backendName:"webgl",kernelFunc:soe};var aoe=` if (isnan(x)) { return 0.0; } return sign(x); -`,Fte=xe({opSnippet:Ate}),M3={kernelName:ys,backendName:"webgl",kernelFunc:Fte};var Pte=Fo+` +`,ioe=xe({opSnippet:aoe}),_P={kernelName:Rs,backendName:"webgl",kernelFunc:ioe};var uoe=sn+` return sin(x); -`,Ote=` +`,poe=` vec4 result = sin(x); bvec4 isNaN = isnan(x); - ${jr} + ${to} return result; -`,Mte=xe({opSnippet:Pte,packedOpSnippet:Ote}),L3={kernelName:gs,backendName:"webgl",kernelFunc:Mte};var Lte=` +`,loe=xe({opSnippet:uoe,packedOpSnippet:poe}),EP={kernelName:Es,backendName:"webgl",kernelFunc:loe};var coe=` float e2x = exp(x); return (e2x - 1.0 / e2x) / 2.0; -`,Bte=xe({opSnippet:Lte}),B3={kernelName:xs,backendName:"webgl",kernelFunc:Bte};var zte=` +`,moe=xe({opSnippet:coe}),$P={kernelName:$s,backendName:"webgl",kernelFunc:moe};var doe=` float epsilon = 1.1920928955078125e-7; float threshold = log(epsilon) + 2.0; @@ -4674,33 +4674,33 @@ return a / b;`,Wee=` result = log(exp_x + 1.0); } return result; -`,Vte=xe({opSnippet:zte}),z3={kernelName:Cs,backendName:"webgl",kernelFunc:Vte};var Wte=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let i=s.reduce((x,b)=>x*b),p=[[0,0]];p.push(...a);for(let x=1+s.length;xe.disposeIntermediateTensorInfo(x)),g},V3={kernelName:ga,backendName:"webgl",kernelFunc:Wte};function Ute(r){let{inputs:t,backend:e}=r,{indices:o,values:n,denseShape:s,defaultValue:a}=t;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: +`,foe=xe({opSnippet:doe}),RP={kernelName:Ds,backendName:"webgl",kernelFunc:foe};var hoe=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let i=s.reduce((x,b)=>x*b),p=[[0,0]];p.push(...a);for(let x=1+s.length;xt.disposeIntermediateTensorInfo(x)),g},DP={kernelName:Sa,backendName:"webgl",kernelFunc:hoe};function goe(r){let{inputs:e,backend:t}=r,{indices:o,values:n,denseShape:s,defaultValue:a}=e;if(s.shape.length!==1)throw new Error(`Dense shape must be a vector, saw: ${s.shape}`);if(o.shape.length!==2)throw new Error(`Indices must be a matrix, saw: ${o.shape}`);if(n.shape.length!==1)throw new Error(`Values must be a vector, saw: ${n.shape}`);if(a.shape.length!==0)throw new Error(`Default value must be a scalar, saw: - ${a.shape}`);let i=e.readSync(o.dataId),p=e.readSync(n.dataId),u=e.readSync(s.dataId),c=e.readSync(a.dataId)[0],[l,m,d,f,h]=lD(i,o.shape,o.dtype,p,n.dtype,u,c);return[e.makeTensorInfo(m,o.dtype,l),e.makeTensorInfo([m[0]],n.dtype,d),e.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(g=>Number(g)))),e.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var W3={kernelName:Hi,backendName:"webgl",kernelFunc:Ute};function Gte(r){let{inputs:t,backend:e}=r,{inputIndices:o,inputShape:n,newShape:s}=t;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${o.shape}`);if(n.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(e.readSync(n.dataId)),i=e.readSync(o.dataId),p=Array.from(e.readSync(s.dataId)),[u,c,l]=mD(i,o.shape,o.dtype,a,p);return[e.makeTensorInfo(c,o.dtype,u),e.makeTensorInfo([l.length],s.dtype,new Int32Array(l))]}var U3={kernelName:ei,backendName:"webgl",kernelFunc:Gte};function Hte(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${a.shape}`);let i=t.readSync(o.dataId),p=t.readSync(n.dataId),u=t.readSync(s.dataId),l=t.readSync(a.dataId)[0],[c,m,d,f,h]=rA(i,o.shape,o.dtype,p,n.dtype,u,l);return[t.makeTensorInfo(m,o.dtype,c),t.makeTensorInfo([m[0]],n.dtype,d),t.makeTensorInfo([f.length],"bool",new Uint8Array(f.map(g=>Number(g)))),t.makeTensorInfo([h.length],o.dtype,new Int32Array(h))]}var AP={kernelName:eu,backendName:"webgl",kernelFunc:goe};function xoe(r){let{inputs:e,backend:t}=r,{inputIndices:o,inputShape:n,newShape:s}=e;if(o.shape.length!==2)throw new Error(`Input indices should be a matrix but received shape ${o.shape}`);if(n.shape.length!==1)throw new Error(`Input shape should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=Array.from(t.readSync(n.dataId)),i=t.readSync(o.dataId),p=Array.from(t.readSync(s.dataId)),[u,l,c]=oA(i,o.shape,o.dtype,a,p);return[t.makeTensorInfo(l,o.dtype,u),t.makeTensorInfo([c.length],s.dtype,new Int32Array(c))]}var FP={kernelName:ui,backendName:"webgl",kernelFunc:xoe};function yoe(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let a=e.readSync(o.dataId),i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,c]=ch(a,o.shape,o.dtype,i,p,!0);return e.makeTensorInfo(c,o.dtype,u)}var G3={kernelName:ya,backendName:"webgl",kernelFunc:Hte};function Kte(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape + ${s.shape}`);let a=t.readSync(o.dataId),i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,l]=Sh(a,o.shape,o.dtype,i,p,!0);return t.makeTensorInfo(l,o.dtype,u)}var PP={kernelName:va,backendName:"webgl",kernelFunc:yoe};function boe(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;if(o.shape.length<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(n.shape.length!==1)throw new Error(`Indices should be a vector but received shape ${n.shape}`);if(s.shape.length!==1)throw new Error(`Segment ids should be a vector but received shape - ${s.shape}`);let a=e.readSync(o.dataId),i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,c]=ch(a,o.shape,o.dtype,i,p);return e.makeTensorInfo(c,o.dtype,u)}var H3={kernelName:ba,backendName:"webgl",kernelFunc:Kte};function qte(r){let{inputs:t,backend:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=w.calculateShapes(s,n,i),d=!1;if(s.dtype==="string"){let x=e.bufferSync(n),b=e.bufferSync(s),C=y.decodeString(e.readSync(a.dataId)[0]),S=uD(x,b,i,m,c,u,p,l,C,d);return e.makeTensorInfo(i,S.dtype,S.values)}let f=new yu(u,p,n.shape.length,s.shape.length,l,[m,1],d),h=e.runWebGLProgram(f,[s,n,a],s.dtype),g=te({inputs:{x:h},backend:e,attrs:{shape:i}});return e.disposeIntermediateTensorInfo(h),g}var K3={kernelName:vs,backendName:"webgl",kernelFunc:qte};function jte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=n.shape.length,c=new Array(u).fill(0),l=n.shape.slice();return p.map(m=>{let d=[...l];d[i]=m;let f=Gs({inputs:{x:n},backend:e,attrs:{begin:c,size:d}});return c[i]+=m,f})}var q3={kernelName:xa,backendName:"webgl",kernelFunc:jte};var j3="return sqrt(x);",Xte=xe({opSnippet:j3,packedOpSnippet:j3,cpuKernelImpl:dD}),X3={kernelName:ws,backendName:"webgl",kernelFunc:Xte};var Yte="return x * x;",Qte=xe({opSnippet:Yte}),Y3={kernelName:Ki,backendName:"webgl",kernelFunc:Qte};var Q3="return (a - b) * (a - b);",Zte=nt({opSnippet:Q3,packedOpSnippet:Q3}),Z3={kernelName:ks,backendName:"webgl",kernelFunc:Zte};function Jte(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t;if(n.dtype!=="string")throw new Error("Input must be of datatype string");let s=e.readSync(n.dataId),a=w.fromUint8ToStringArray(s),i=fD(a,"string",o);return e.makeTensorInfo(n.shape,"string",i)}var J3={kernelName:$u,backendName:"webgl",kernelFunc:Jte};function ere({inputs:r,attrs:t,backend:e}){let{x:o}=r,n=Wt+` - return x > 0.0 ? 1.0 : float(${t.alpha}); - `,s=new tr(o.shape,n);return e.runWebGLProgram(s,[o],o.dtype)}var eP={kernelName:wo,backendName:"webgl",kernelFunc:ere};var Eg=class{constructor(t,e,o){this.variableNames=["x"],this.outputShape=o;let n=o.length,s=Re(o.length),a=Re(o.length),i="";if(n===1)i="coords * strides + begin";else{let p=0;i=o.map((u,c)=>(p++,o.length===1?`coords * strides[${c}] + begin[${c}]`:`coords[${p-1}] * strides[${c}] + begin[${c}]`)).join(",")}this.userCode=` - ${s} begin = ${s}(${t}); - ${s} strides = ${s}(${e}); + ${s.shape}`);let a=t.readSync(o.dataId),i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,l]=Sh(a,o.shape,o.dtype,i,p);return t.makeTensorInfo(l,o.dtype,u)}var OP={kernelName:ka,backendName:"webgl",kernelFunc:boe};function Coe(r){let{inputs:e,backend:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=C.calculateShapes(s,n,i),d=!1;if(s.dtype==="string"){let x=t.bufferSync(n),b=t.bufferSync(s),w=y.decodeString(t.readSync(a.dataId)[0]),S=JD(x,b,i,m,l,u,p,c,w,d);return t.makeTensorInfo(i,S.dtype,S.values)}let f=new Tu(u,p,n.shape.length,s.shape.length,c,[m,1],d),h=t.runWebGLProgram(f,[s,n,a],s.dtype),g=te({inputs:{x:h},backend:t,attrs:{shape:i}});return t.disposeIntermediateTensorInfo(h),g}var MP={kernelName:Ps,backendName:"webgl",kernelFunc:Coe};function woe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=n.shape.length,l=new Array(u).fill(0),c=n.shape.slice();return p.map(m=>{let d=[...c];d[i]=m;let f=Js({inputs:{x:n},backend:t,attrs:{begin:l,size:d}});return l[i]+=m,f})}var LP={kernelName:Ia,backendName:"webgl",kernelFunc:woe};var BP="return sqrt(x);",Soe=xe({opSnippet:BP,packedOpSnippet:BP,cpuKernelImpl:nA}),zP={kernelName:Fo,backendName:"webgl",kernelFunc:Soe};var Ioe="return x * x;",voe=xe({opSnippet:Ioe}),VP={kernelName:tu,backendName:"webgl",kernelFunc:voe};var WP="return (a - b) * (a - b);",koe=st({opSnippet:WP,packedOpSnippet:WP}),UP={kernelName:Po,backendName:"webgl",kernelFunc:koe};function Noe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e;if(n.dtype!=="string")throw new Error("Input must be of datatype string");let s=t.readSync(n.dataId),a=C.fromUint8ToStringArray(s),i=sA(a,"string",o);return t.makeTensorInfo(n.shape,"string",i)}var GP={kernelName:pi,backendName:"webgl",kernelFunc:Noe};function Toe({inputs:r,attrs:e,backend:t}){let{x:o}=r,n=Gt+` + return x > 0.0 ? 1.0 : float(${e.alpha}); + `,s=new nr(o.shape,n);return t.runWebGLProgram(s,[o],o.dtype)}var HP={kernelName:Ko,backendName:"webgl",kernelFunc:Toe};var Wg=class{constructor(e,t,o){this.variableNames=["x"],this.outputShape=o;let n=o.length,s=Re(o.length),a=Re(o.length),i="";if(n===1)i="coords * strides + begin";else{let p=0;i=o.map((u,l)=>(p++,o.length===1?`coords * strides[${l}] + begin[${l}]`:`coords[${p-1}] * strides[${l}] + begin[${l}]`)).join(",")}this.userCode=` + ${s} begin = ${s}(${e}); + ${s} strides = ${s}(${t}); void main() { ${a} coords = getOutputCoords(); setOutput(getX(${i})); } - `}};function tre(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=te({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let E=pt.computeOutShape(b,C,S),R=Gs({inputs:{x:n},backend:e,attrs:{begin:b,size:E}});k=te({inputs:{x:R},backend:e,attrs:{shape:f}}),e.disposeIntermediateTensorInfo(R)}else if(e.shouldExecuteOnCPU([n])){let R=e.readSync(n.dataId),D=me(n.shape,n.dtype,R),P=hD(d,D,S,b);k=e.makeTensorInfo(f,n.dtype,P.values)}else{let R=new Eg(b,S,d);k=e.runWebGLProgram(R,[n],n.dtype)}let _=te({inputs:{x:k},backend:e,attrs:{shape:f}});return e.disposeIntermediateTensorInfo(k),_}var tP={kernelName:Ns,backendName:"webgl",kernelFunc:tre};function rre(r){let{inputs:t,backend:e,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:c,dataSplits:l}=t,m=e.readSync(c.dataId),d=e.readSync(l.dataId),[f,h]=gD(m,d,n,s,a,i,p,u);return[e.makeTensorInfo([f.length],"string",f),e.makeTensorInfo(l.shape,"int32",h)]}var rP={kernelName:Ca,backendName:"webgl",kernelFunc:rre};function ore(r){let{inputs:t,backend:e,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=e.readSync(s.dataId),p=e.readSync(a.dataId)[0],[u,c,l]=xD(i,p,n),m=c.length;return[e.makeTensorInfo([m,2],"int32",u),e.makeTensorInfo([m],"string",c),e.makeTensorInfo([2],"int32",new Int32Array(l))]}var oP={kernelName:qi,backendName:"webgl",kernelFunc:ore};function nre(r){let{inputs:t,backend:e,attrs:o}=r,{numBuckets:n}=o,{input:s}=t;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(n<=0)throw new Error("Number of buckets must be at least 1");let a=e.readSync(s.dataId),i=yD(a,n);return e.makeTensorInfo(s.shape,"int32",i)}var nP={kernelName:ji,backendName:"webgl",kernelFunc:nre};var sre="return tan(x);",are=xe({opSnippet:sre}),sP={kernelName:_s,backendName:"webgl",kernelFunc:are};var ire=` + `}};function _oe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=te({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let E=nt.computeOutShape(b,w,S),R=Js({inputs:{x:n},backend:t,attrs:{begin:b,size:E}});k=te({inputs:{x:R},backend:t,attrs:{shape:f}}),t.disposeIntermediateTensorInfo(R)}else if(t.shouldExecuteOnCPU([n])){let R=t.readSync(n.dataId),D=ie(n.shape,n.dtype,R),F=aA(d,D,S,b);k=t.makeTensorInfo(f,n.dtype,F.values)}else{let R=new Wg(b,S,d);k=t.runWebGLProgram(R,[n],n.dtype)}let T=te({inputs:{x:k},backend:t,attrs:{shape:f}});return t.disposeIntermediateTensorInfo(k),T}var KP={kernelName:Os,backendName:"webgl",kernelFunc:_oe};function Eoe(r){let{inputs:e,backend:t,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:l,dataSplits:c}=e,m=t.readSync(l.dataId),d=t.readSync(c.dataId),[f,h]=iA(m,d,n,s,a,i,p,u);return[t.makeTensorInfo([f.length],"string",f),t.makeTensorInfo(c.shape,"int32",h)]}var qP={kernelName:Na,backendName:"webgl",kernelFunc:Eoe};function $oe(r){let{inputs:e,backend:t,attrs:o}=r,{skipEmpty:n}=o,{input:s,delimiter:a}=e;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(s.shape.length!==1)throw new Error(`Input must be a vector, got shape: ${s.shape}`);if(a.shape.length!==0)throw new Error(`Delimiter must be a scalar, got shape: ${a.shape}`);let i=t.readSync(s.dataId),p=t.readSync(a.dataId)[0],[u,l,c]=uA(i,p,n),m=l.length;return[t.makeTensorInfo([m,2],"int32",u),t.makeTensorInfo([m],"string",l),t.makeTensorInfo([2],"int32",new Int32Array(c))]}var jP={kernelName:ru,backendName:"webgl",kernelFunc:$oe};function Roe(r){let{inputs:e,backend:t,attrs:o}=r,{numBuckets:n}=o,{input:s}=e;if(s.dtype!=="string")throw new Error("Input must be of datatype string");if(n<=0)throw new Error("Number of buckets must be at least 1");let a=t.readSync(s.dataId),i=pA(a,n);return t.makeTensorInfo(s.shape,"int32",i)}var XP={kernelName:ou,backendName:"webgl",kernelFunc:Roe};var Doe="return tan(x);",Aoe=xe({opSnippet:Doe}),YP={kernelName:Ms,backendName:"webgl",kernelFunc:Aoe};var Foe=` float e2x = exp(-2.0 * abs(x)); return sign(x) * (1.0 - e2x) / (1.0 + e2x); -`,ure=xe({opSnippet:ire}),aP={kernelName:$s,backendName:"webgl",kernelFunc:ure};function pre(r){let{inputs:t,backend:e,attrs:o}=r,{tensor:n,indices:s,updates:a}=t,{}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(a,s,n.shape),m=[l/u,u];if(l===0)return e.makeTensorInfo(n.shape,s.dtype);let d=te({inputs:{x:s},backend:e,attrs:{shape:[p,i]}}),f=te({inputs:{x:a},backend:e,attrs:{shape:[p,u]}}),h=te({inputs:{x:n},backend:e,attrs:{shape:m}}),g=new yu(p,i,d.shape.length,f.shape.length,c,m,!1,!0),x=e.runWebGLProgram(g,[f,d,h],h.dtype),b=te({inputs:{x},backend:e,attrs:{shape:n.shape}});return e.disposeIntermediateTensorInfo(d),e.disposeIntermediateTensorInfo(f),e.disposeIntermediateTensorInfo(h),e.disposeIntermediateTensorInfo(x),b}var iP={kernelName:ds,backendName:"webgl",kernelFunc:pre};var Rg=class{constructor(t,e){this.variableNames=["A"];let o=new Array(t.length);for(let a=0;a5)throw Error(`Tile for rank ${t} is not yet supported`);if(t===1)return`imod(resRC, ${r[0]})`;let e=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],o=[];for(let n=0;n5){let p=e.readSync(n.dataId),u=n.dtype==="string"?p.map(m=>y.decodeString(m)):p,c=me(n.shape,n.dtype,u),l=CD(c,s);return e.makeTensorInfo(l.shape,l.dtype,l.values)}let a=new Rg(n.shape,s);return e.runWebGLProgram(a,[n],n.dtype)}var uP={kernelName:uo,backendName:"webgl",kernelFunc:Av};var Dg=class{constructor(t){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=t,this.userCode=` + `}};function Moe(r){let e=r.length;if(e>5)throw Error(`Tile for rank ${e} is not yet supported`);if(e===1)return`imod(resRC, ${r[0]})`;let t=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],o=[];for(let n=0;n5){let p=t.readSync(n.dataId),u=n.dtype==="string"?p.map(m=>y.decodeString(m)):p,l=ie(n.shape,n.dtype,u),c=cA(l,s);return t.makeTensorInfo(c.shape,c.dtype,c.values)}let a=new Ug(n.shape,s);return t.runWebGLProgram(a,[n],n.dtype)}var JP={kernelName:Mo,backendName:"webgl",kernelFunc:q0};var Gg=class{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"negativeInf",type:"float"},{name:"dir",type:"int"},{name:"inc",type:"int"}],this.outputShape=e,this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; @@ -4740,7 +4740,7 @@ return a / b;`,Wee=` setOutput(float(i1)); } } - `}},Ag=class{constructor(t){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=t,this.userCode=` + `}},Hg=class{constructor(e){this.variableNames=["x","indices"],this.customUniforms=[{name:"n",type:"int"},{name:"firstPass",type:"int"},{name:"k",type:"int"}],this.outputShape=e,this.userCode=` void main() { // Takes max of indices (0, k), (1, k + 1), (2, k + 2) ... ivec2 coords = getOutputCoords(); @@ -4774,7 +4774,7 @@ return a / b;`,Wee=` setOutput(x0 >= x1 ? float(i0) : float(i1)); } - `}};function Ip(r,t){t!==null&&r.disposeIntermediateTensorInfo(t)}function pP(r){let t=1;for(;tp){let P=e.readSync(n.dataId),[O,M]=wD(P,u,n.dtype,s,a);return[e.makeTensorInfo(O.shape,O.dtype,O.values),e.makeTensorInfo(M.shape,M.dtype,M.values)]}if(s===0)return u[u.length-1]=0,[e.makeTensorInfo(u,n.dtype,[]),e.makeTensorInfo(u,"int32",[])];if(c===1)return[n,bi({attrs:{shape:u,dtype:"int32",value:0},backend:e})];let l=e.texData.get(n.dataId),m=l!==null&&l.isPacked,d=m?e.unpackTensor(n):n,h=y.sizeFromShape(u)/c,g=te({inputs:{x:d},attrs:{shape:[h,c]},backend:e});m&&Ip(e,d);let x=pP(s),b=pP(c),C=null,S=()=>C===null?[g,g]:[g,C],k=(P,O,M)=>{let L=S(),B=new Dg(M),U=[[c],[C===null?1:0],[Number.NEGATIVE_INFINITY],[P],[O]],j=C;C=e.runWebGLProgram(B,L,"int32",U),Ip(e,j)};for(let P=1;P=1;M/=2)k(O,M,[h,b])}for(let P=b;P>x;P/=2){let O=S(),M=new Ag([h,P/2]),B=[[c],[C===null?1:0],[x]],z=C;C=e.runWebGLProgram(M,O,"int32",B),Ip(e,z);let U=x/2,j=U*2;for(let q=U;q>=1;q/=2)k(j,q,C.shape)}let _=C;C=Gs({inputs:{x:C},backend:e,attrs:{begin:0,size:[h,s]}}),Ip(e,_);let E=Nv({inputs:{x:g,indices:C},backend:e,attrs:{axis:1,batchDims:1}});Ip(e,g);let R=u.slice(0,-1);R.push(s),_=C,C=te({inputs:{x:C},attrs:{shape:R},backend:e}),Ip(e,_);let D=E;return E=te({inputs:{x:E},attrs:{shape:R},backend:e}),Ip(e,D),[E,C]}var cP={kernelName:Es,backendName:"webgl",kernelFunc:lre};var Fg=class{constructor(t,e,o,n,s,a){this.variableNames=["Image","Transforms"],this.outputShape=a;let i=o==="nearest"?1:2,p;switch(n){case"constant":p=1;break;case"reflect":p=2;break;case"wrap":p=3;break;case"nearest":p=4;break;default:p=1;break}this.userCode=` + `}};function Rp(r,e){e!==null&&r.disposeIntermediateTensorInfo(e)}function eO(r){let e=1;for(;ep){let F=t.readSync(n.dataId),[O,M]=mA(F,u,n.dtype,s,a);return[t.makeTensorInfo(O.shape,O.dtype,O.values),t.makeTensorInfo(M.shape,M.dtype,M.values)]}if(s===0)return u[u.length-1]=0,[t.makeTensorInfo(u,n.dtype,[]),t.makeTensorInfo(u,"int32",[])];if(l===1)return[n,Ei({attrs:{shape:u,dtype:"int32",value:0},backend:t})];let c=t.texData.get(n.dataId),m=c!==null&&c.isPacked,d=m?t.unpackTensor(n):n,h=y.sizeFromShape(u)/l,g=te({inputs:{x:d},attrs:{shape:[h,l]},backend:t});m&&Rp(t,d);let x=eO(s),b=eO(l),w=null,S=()=>w===null?[g,g]:[g,w],k=(F,O,M)=>{let L=S(),B=new Gg(M),U=[[l],[w===null?1:0],[Number.NEGATIVE_INFINITY],[F],[O]],j=w;w=t.runWebGLProgram(B,L,"int32",U),Rp(t,j)};for(let F=1;F=1;M/=2)k(O,M,[h,b])}for(let F=b;F>x;F/=2){let O=S(),M=new Hg([h,F/2]),B=[[l],[w===null?1:0],[x]],z=w;w=t.runWebGLProgram(M,O,"int32",B),Rp(t,z);let U=x/2,j=U*2;for(let q=U;q>=1;q/=2)k(j,q,w.shape)}let T=w;w=Js({inputs:{x:w},backend:t,attrs:{begin:0,size:[h,s]}}),Rp(t,T);let E=z0({inputs:{x:g,indices:w},backend:t,attrs:{axis:1,batchDims:1}});Rp(t,g);let R=u.slice(0,-1);R.push(s),T=w,w=te({inputs:{x:w},attrs:{shape:R},backend:t}),Rp(t,T);let D=E;return E=te({inputs:{x:E},attrs:{shape:R},backend:t}),Rp(t,D),[E,w]}var tO={kernelName:Bs,backendName:"webgl",kernelFunc:Loe};var Kg=class{constructor(e,t,o,n,s,a){this.variableNames=["Image","Transforms"],this.outputShape=a;let i=o==="nearest"?1:2,p;switch(n){case"constant":p=1;break;case"reflect":p=2;break;case"wrap":p=3;break;case"nearest":p=4;break;default:p=1;break}this.userCode=` float mapCoord(float outCoord, float len) { float inCoord = outCoord; if(${p} == 2) { @@ -4828,7 +4828,7 @@ return a / b;`,Wee=` float readWithFillValue(int batch, int coordY, int coordX, int channel) { float outputValue; - if (0 <= coordY && coordY < ${t} && 0 <= coordX && coordX < ${e}) { + if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) { outputValue = getImage(batch, coordY, coordX, channel); } else { outputValue = float(${s}); @@ -4859,8 +4859,8 @@ return a / b;`,Wee=` } else { float inX = (a1 * xf + a2 * yf + a3) / projection; float inY = (b1 * xf + b2 * yf + b3) / projection; - float mapX = mapCoord(inX, float(${e})); - float mapY = mapCoord(inY, float(${t})); + float mapX = mapCoord(inX, float(${t})); + float mapY = mapCoord(inY, float(${e})); if (${i} == 1) { int coordY = int(round(mapY)); @@ -4886,7 +4886,7 @@ return a / b;`,Wee=` } setOutput(outputValue); } - `}};function mre(r){let{inputs:t,backend:e,attrs:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=new Fg(l,m,a,i,p,g);return e.runWebGLProgram(x,[n,s],"float32")}var lP={kernelName:Rs,backendName:"webgl",kernelFunc:mre};function dre(r){let{inputs:t,attrs:e,backend:o}=r,{axis:n}=e,{x:s}=t;Vs(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let a=o.readSync(s.dataId),{outputValues:i,outputShape:p,indices:u}=SD(a,n,s.shape,s.dtype);return[o.makeTensorInfo(p,s.dtype,i),o.makeTensorInfo([u.length],"int32",u)]}var mP={kernelName:Xi,backendName:"webgl",kernelFunc:dre};function fre(r){let{inputs:t,backend:e,attrs:o}=r,{value:n}=t,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),c=0;for(let h=0;he.disposeIntermediateTensorInfo(h)),f}var dP={kernelName:wa,backendName:"webgl",kernelFunc:fre};var Pg=class{constructor(t,e){this.variableNames=["x","segmentIds"];let o=t.windowSize,n=t.batchSize,s=t.inSize,a=t.numSegments,i=a*Math.ceil(s/o);this.outputShape=[n,i];let p="0.0",u="sumValue",c=Math.floor(o/4)*4,l=o%4,m=` + `}};function Boe(r){let{inputs:e,backend:t,attrs:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=new Kg(c,m,a,i,p,g);return t.runWebGLProgram(x,[n,s],"float32")}var rO={kernelName:zs,backendName:"webgl",kernelFunc:Boe};function zoe(r){let{inputs:e,attrs:t,backend:o}=r,{axis:n}=t,{x:s}=e;Ys(s,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let a=o.readSync(s.dataId),{outputValues:i,outputShape:p,indices:u}=dA(a,n,s.shape,s.dtype);return[o.makeTensorInfo(p,s.dtype,i),o.makeTensorInfo([u.length],"int32",u)]}var oO={kernelName:nu,backendName:"webgl",kernelFunc:zoe};function Voe(r){let{inputs:e,backend:t,attrs:o}=r,{value:n}=e,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),l=0;for(let h=0;ht.disposeIntermediateTensorInfo(h)),f}var nO={kernelName:Ta,backendName:"webgl",kernelFunc:Voe};var qg=class{constructor(e,t){this.variableNames=["x","segmentIds"];let o=e.windowSize,n=e.batchSize,s=e.inSize,a=e.numSegments,i=a*Math.ceil(s/o);this.outputShape=[n,i];let p="0.0",u="sumValue",l=Math.floor(o/4)*4,c=o%4,m=` sumValue += dot(values, segFilter); `,d="";s%o>0&&(d=` if (inIdx < 0 || inIdx >= ${s}) { @@ -4919,7 +4919,7 @@ return a / b;`,Wee=` float sumValue = 0.0; - for (int i = 0; i < ${c}; i += 4) { + for (int i = 0; i < ${l}; i += 4) { int inIdx = inOffset + i; vec4 values = vec4( getValue(batch, inIdx), @@ -4938,8 +4938,8 @@ return a / b;`,Wee=` ${m} } - int inIdx = inOffset + ${c}; - if (${l===1}) { + int inIdx = inOffset + ${l}; + if (${c===1}) { vec4 values = vec4( getValue(batch, inIdx), initializationValue, @@ -4957,7 +4957,7 @@ return a / b;`,Wee=` ); ${m} - } else if (${l===2}) { + } else if (${c===2}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -4973,7 +4973,7 @@ return a / b;`,Wee=` ); ${m} - } else if (${l===3}) { + } else if (${c===3}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), @@ -4992,13 +4992,13 @@ return a / b;`,Wee=` } setOutput(${u}); } - `}};function hre(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,segmentIds:s}=t,{numSegments:a}=o,i=n.shape.length,p=[],u=0,c=w.getAxesPermutation([u],i),l=n;c!=null&&(l=bt({inputs:{x:n},backend:e,attrs:{perm:c}}),p.push(l),u=w.getInnerMostAxes(1,i)[0]);let m=w.segment_util.computeOutShape(l.shape,u,a),d=y.sizeFromShape([l.shape[u]]),f=te({inputs:{x:l},backend:e,attrs:{shape:[-1,d]}});p.push(f);let h=oi(n.dtype),g=(S,k,_,E,R)=>{let D=S.shape[0],P=S.shape[1],O=w.segment_util.segOpComputeOptimalWindowSize(P,R),M={windowSize:O,inSize:P,batchSize:D,numSegments:R},L=new Pg(M,k),B=e.compileAndRun(L,[S,_],E);if(p.push(B),B.shape[1]===R)return B;let z=Dv({backend:e,attrs:{start:0,stop:R,step:1,dtype:"float32"}}),U=Av({inputs:{x:z},backend:e,attrs:{reps:[P/O]}});return p.push(z),p.push(U),g(B,k,U,E,R)},x=g(f,"unsortedSegmentSum",s,h,a),b=te({inputs:{x},backend:e,attrs:{shape:m}}),C=b;if(c!=null){p.push(b);let S=w.getUndoAxesPermutation(c);C=bt({inputs:{x:C},backend:e,attrs:{perm:S}})}return p.forEach(S=>e.disposeIntermediateTensorInfo(S)),C}var fP={kernelName:Yi,backendName:"webgl",kernelFunc:hre};var gre=[YD,ZD,JD,eA,rA,oA,nA,sA,uA,pA,cA,lA,mA,dA,fA,hA,gA,xA,yA,bA,CA,SA,IA,vA,kA,$A,RA,DA,zD,FA,OA,MA,LA,BA,zA,VA,WA,UA,GA,HA,jA,XA,YA,QA,ZA,JA,eF,tF,rF,oF,nF,sF,aF,iF,uF,pF,lF,mF,dF,fF,gF,xF,yF,bF,CF,wF,SF,IF,vF,BD,kF,PA,NF,TF,_F,VD,$F,EF,RF,DF,AF,FF,PF,OF,MF,LF,zF,VF,WF,UF,GF,HF,qF,XF,YF,QF,ZF,JF,n3,GD,s3,a3,i3,u3,NA,p3,m3,d3,f3,h3,WD,g3,x3,y3,b3,C3,TA,e3,w3,S3,I3,KD,v3,k3,N3,T3,_3,$3,E3,R3,D3,A3,F3,P3,O3,M3,L3,B3,wA,o3,z3,V3,W3,U3,G3,H3,K3,q3,X3,Y3,Z3,J3,eP,tP,rP,oP,nP,r3,jD,sP,aP,iP,uP,cP,lP,XD,mP,dP,fP,c3];for(let r of gre)ti(r);var we;(function(r){r[r.float32=0]="float32",r[r.int32=1]="int32",r[r.bool=2]="bool",r[r.string=3]="string",r[r.complex64=4]="complex64"})(we||(we={}));var bu;(function(r){r[r.linear=0]="linear",r[r.relu=1]="relu",r[r.relu6=2]="relu6",r[r.prelu=3]="prelu",r[r.leakyrelu=4]="leakyrelu",r[r.sigmoid=5]="sigmoid",r[r.elu=6]="elu"})(bu||(bu={}));var hP;function xre(r){hP=r.wasm.cwrap(So,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function yre(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=t;if(n.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:p,transposeB:u,activation:c,leakyreluAlpha:l}=o,m=e.dataIdMap.get(n.dataId).id,d=e.dataIdMap.get(s.dataId).id,f=0;if(a!=null){let R=e.dataIdMap.get(a.dataId);if(R.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${R.shape.length}.`);f=R.id}let h=i==null?0:e.dataIdMap.get(i.dataId).id,g=bu[c];if(g==null)throw new Error(`${c} activation not yet supported for FusedConv2D in the wasm backend.`);let x=p?n.shape[2]:n.shape[1],b=u?s.shape[1]:s.shape[2],C=Sr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)),S=e.makeOutput([...C,x,b],n.dtype),k=e.dataIdMap.get(S.dataId).id,_=new Uint8Array(new Int32Array(n.shape).buffer),E=new Uint8Array(new Int32Array(s.shape).buffer);return hP(m,_,n.shape.length,d,E,s.shape.length,p,u,g,f,h,l||0,k),S}var gP={kernelName:So,backendName:"wasm",setupFunc:xre,kernelFunc:yre};function he(r,t){let e;function o(s){e=s.wasm.cwrap(r,null,["number","number","number"])}function n(s){let{backend:a,inputs:{x:i}}=s,p=a.dataIdMap.get(i.dataId).id,u=a.makeOutput(i.shape,t||i.dtype),c=a.dataIdMap.get(u.dataId).id;return y.sizeFromShape(u.shape)===0||e(p,we[i.dtype],c),u}return{kernelName:r,backendName:"wasm",setupFunc:o,kernelFunc:n}}var xP=he(Xs);var yP=he(Vo);var bP=he(Wo);function Ue(r,t,e){let o;function n(a){o=a.wasm.cwrap(r,null,["number","array","number","number","array","number","number","number"])}function s(a){let{backend:i,inputs:p}=a,{a:u,b:c}=p,l=i.dataIdMap.get(u.dataId).id,m=i.dataIdMap.get(c.dataId).id,d=e!=null?e:u.dtype,f=w.assertAndGetBroadcastShape(u.shape,c.shape),h=i.makeOutput(f,d);if(y.sizeFromShape(f)===0)return h;let g=new Uint8Array(new Int32Array(u.shape).buffer),x=new Uint8Array(new Int32Array(c.shape).buffer),b=i.dataIdMap.get(h.dataId).id;return o(l,g,u.shape.length,m,x,c.shape.length,we[u.dtype],b),h}return{kernelName:r,backendName:"wasm",setupFunc:n,kernelFunc:s}}var bre=!0,CP=Ue(io,bre);var wP;function Cre(r){wP=r.wasm.cwrap(Uo,null,["array","number","number","number"])}function wre(r){let{inputs:t,backend:e}=r,o=e.makeOutput(t[0].shape,t[0].dtype);if(y.sizeFromShape(o.shape)===0)return o;let n=t.map(i=>e.dataIdMap.get(i.dataId).id),s=new Uint8Array(new Int32Array(n).buffer),a=e.dataIdMap.get(o.dataId).id;return wP(s,n.length,we[o.dtype],a),o}var SP={kernelName:Uo,backendName:"wasm",setupFunc:Cre,kernelFunc:wre};function vp(r){let{inputs:{x:t},backend:e}=r;if(t.dtype==="string")return ar(e.readSync(t.dataId),t.shape,t.dtype);let o=e.makeOutput(t.shape,t.dtype),n=e.typedArrayFromHeap(t);return e.typedArrayFromHeap(o).set(n),o}var IP={kernelName:Co,backendName:"wasm",kernelFunc:vp};var vP;function Sre(r){vP=r.wasm.cwrap(po,null,["number","array","number","number","number","array","number"])}function ho(r){let{inputs:t,backend:e,attrs:o}=r,[n,s]=vre(t.x.shape,o.perm),a=!0;for(let f=0;f=n&&(s===-1||o[s]>o[a])&&(s=a);o[s]=n}return[e,o]}var kP={kernelName:po,backendName:"wasm",kernelFunc:ho,setupFunc:Sre};function Tr(r,t,e){let o=r.shape,n=r.shape.length,s=y.parseAxisParam(t,o),a=s,i=w.getAxesPermutation(a,n),p=null,u=!1;if(i!=null){let c=new Array(n);for(let d=0;d`new shape: ${a}, old shape: ${o.shape}. New shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var HP={kernelName:da,backendName:"wasm",kernelFunc:zt};var KP;function Mre(r){KP=r.wasm.cwrap(Zo,null,["number","array","number","number","array","number","number","number","number"])}function Lre(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;if(n.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let p=n.shape.length,u=s.shape.length,c=a?n.shape[p-2]:n.shape[p-1],l=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),C=Sr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(c===l,()=>`Error in matMul: inner shapes (${c}) and (${l}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,c,m]:[g,m,c],k=i?[x,d,l]:[x,l,d],_=zt({inputs:{x:n},backend:e,attrs:{shape:S}}),E=zt({inputs:{x:s},backend:e,attrs:{shape:k}}),R=e.dataIdMap.get(_.dataId).id,D=e.dataIdMap.get(E.dataId).id,P=a?_.shape[2]:_.shape[1],O=i?E.shape[1]:E.shape[2],M=Math.max(g,x),L=e.makeOutput([M,P,O],_.dtype),B=e.dataIdMap.get(L.dataId).id,z=new Uint8Array(new Int32Array(_.shape).buffer),U=new Uint8Array(new Int32Array(E.shape).buffer);return KP(R,z,_.shape.length,D,U,E.shape.length,a,i,B),e.disposeData(_.dataId),e.disposeData(E.dataId),L.shape=C,L}var qP={kernelName:Zo,backendName:"wasm",setupFunc:Mre,kernelFunc:Lre};function Po(r){let{inputs:{x:t},attrs:{begin:e,size:o},backend:n}=r,[s,a]=pt.parseSliceParams(t,e,o),i=pt.isSliceContinous(t.shape,s,a),p=n.readSync(t.dataId),u=n.makeOutput(a,t.dtype),c=y.computeStrides(t.shape),l=n.dataIdMap.get(u.dataId);if(i){let f=pt.computeFlatOffset(s,c);return t.dtype==="string"?l.stringBytes=p.slice(f,f+y.sizeFromShape(a)):n.typedArrayFromHeap(u).set(p.subarray(f,f+y.sizeFromShape(a))),u}if(t.dtype==="string"){let f=ip(p,s,a,t.shape,t.dtype);return l.stringBytes=f,u}let m=n.typedArrayFromHeap(u),d=t.shape.length;if(d===2)Bre(p,c[0],m,s,a);else if(d===3)zre(p,c[0],c[1],m,s,a);else if(d===4)Vre(p,c[0],c[1],c[2],m,s,a);else{let f=ip(p,s,a,t.shape,t.dtype);m.set(f)}return u}function Bre(r,t,e,o,n){let s=0,a=o[0],i=o[1],p=a+n[0];for(let u=a;ux*b),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=zt({inputs:{x:n},backend:e,attrs:{shape:p}}),f=ho({inputs:{x:d},backend:e,attrs:{perm:u}}),h=zt({inputs:{x:f},backend:e,attrs:{shape:c}}),g=Po({inputs:{x:h},backend:e,attrs:{begin:l,size:m}});return e.disposeData(d.dataId),e.disposeData(f.dataId),e.disposeData(h.dataId),g}var XP={kernelName:Js,backendName:"wasm",kernelFunc:Wre};var YP;function Ure(r){YP=r.wasm.cwrap(Jo,null,["number","number","boolean","number","number","number"])}function Gre(r){let{backend:t,inputs:e,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=s.shape.reduce((l,m)=>l*m,1)!==0,p=n.shape.length===1?[a]:[n.shape[0],a],u=t.makeOutput(p,s.dtype);function c(l){return t.dataIdMap.get(l.dataId).id}return YP(c(n),a,i,c(s),we[s.dtype],c(u)),u}var QP={kernelName:Jo,backendName:"wasm",setupFunc:Ure,kernelFunc:Gre};var Hre=!0,ZP=Ue(qa,Hre);function Kre(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t,s=e.typedArrayFromHeap(o),a=e.typedArrayFromHeap(n),i=w.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return e.makeOutput([i.length],"int32",void 0,new Int32Array(i))}var JP={kernelName:ea,backendName:"wasm",kernelFunc:Kre};function Or(r){let{inputs:{x:t},attrs:{dtype:e},backend:o}=r,n=o.makeOutput(t.shape,e),s=o.typedArrayFromHeap(t);return o.typedArrayFromHeap(n).set(s),n}var eO={kernelName:yo,backendName:"wasm",kernelFunc:Or};var tO=he(en);var rO;function qre(r){rO=r.wasm.cwrap(bo,null,["number","number","number","number"])}function jre(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{clipValueMin:s,clipValueMax:a}=o,i=e.dataIdMap.get(n.dataId).id,p=e.makeOutput(n.shape,n.dtype),u=e.dataIdMap.get(p.dataId).id;return rO(i,s,a,u),p}var oO={kernelName:bo,backendName:"wasm",setupFunc:qre,kernelFunc:jre};function Fv(r){let{inputs:t,backend:e}=r,o=y.parseAxisParam(r.attrs.axis,t[0].shape)[0],n=t.map(d=>d.shape);w.assertParamsConsistent(n,o);let s=w.computeOutShape(t.map(d=>d.shape),o),a=t.filter(d=>y.sizeFromShape(d.shape)>0);if(a.length===1)return vp({inputs:{x:a[0]},backend:e});let i=e.makeOutput(s,t[0].dtype);if(y.sizeFromShape(s)===0)return i;if(a[0].dtype==="string"){let d=a.map(C=>{let k=[-1,y.sizeFromShape(C.shape.slice(o))];return zt({inputs:{x:C},backend:e,attrs:{shape:k}})}),f=d.map(C=>({vals:e.readSync(C.dataId),shape:C.shape}));s=w.computeOutShape(d.map(C=>C.shape),1);let h=d[0].shape[0]===1,g=np(f,s,t[0].dtype,h),x=w.computeOutShape(a.map(C=>C.shape),o);i.shape=x;let b=e.dataIdMap.get(i.dataId);return b.stringBytes=w.fromStringArrayToUint8(g),d.forEach(C=>e.disposeData(C.dataId)),i}let p=y.sizeFromShape(a[0].shape.slice(0,o)),u=0,c=a.map(d=>{let f=y.sizeFromShape(d.shape.slice(o));return u+=f,f}),l=a.map(d=>e.typedArrayFromHeap(d)),m=e.typedArrayFromHeap(i);for(let d=0;d`cumprod does not support ${n.dtype} tensors in the WASM backend`);let u=w.getAxesPermutation([s],p),c=n;u!==null&&(c=ho({inputs:{x:n},attrs:{perm:u},backend:e}));let l=w.getInnerMostAxes(1,p)[0];w.assertAxesAreInnerMostDims("cumprod",[l],p);let m=e.makeOutput(c.shape,c.dtype),d=c.shape[l],f=e.dataIdMap.get(c.dataId).id,h=e.dataIdMap.get(m.dataId).id;bO(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=w.getUndoAxesPermutation(u);g=ho({inputs:{x:m},attrs:{perm:x},backend:e}),e.disposeData(c.dataId),e.disposeData(m.dataId)}return g}var CO={kernelName:un,backendName:"wasm",setupFunc:ioe,kernelFunc:uoe};var wO;function poe(r){wO=r.wasm.cwrap(pn,null,["number","number","number","number","number","number"])}function coe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o,p=n.shape.length;y.assert(n.dtype==="float32"||n.dtype==="int32",()=>`cumsum does not support ${n.dtype} tensors in the WASM backend`);let u=w.getAxesPermutation([s],p),c=n;u!==null&&(c=ho({inputs:{x:n},attrs:{perm:u},backend:e}));let l=w.getInnerMostAxes(1,p)[0];w.assertAxesAreInnerMostDims("cumsum",[l],p);let m=e.makeOutput(c.shape,c.dtype),d=c.shape[l],f=e.dataIdMap.get(c.dataId).id,h=e.dataIdMap.get(m.dataId).id;wO(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=w.getUndoAxesPermutation(u);g=ho({inputs:{x:m},attrs:{perm:x},backend:e}),e.disposeData(c.dataId),e.disposeData(m.dataId)}return g}var SO={kernelName:pn,backendName:"wasm",setupFunc:poe,kernelFunc:coe};var IO;function loe(r){IO=r.wasm.cwrap("DenseBincount",null,["number","array","number","number","boolean","number","number","boolean","number"])}function moe(r){let{backend:t,inputs:e,attrs:o}=r,{x:n,weights:s}=e,{size:a,binaryOutput:i}=o,p=s.shape.reduce((m,d)=>m*d,1)!==0,u=n.shape.length===1?[a]:[n.shape[0],a],c=t.makeOutput(u,s.dtype);function l(m){return t.dataIdMap.get(m.dataId).id}return IO(l(n),new Uint8Array(new Int32Array(n.shape).buffer),n.shape.length,a,p,l(s),we[s.dtype],i,l(c)),c}var vO={kernelName:ra,backendName:"wasm",setupFunc:loe,kernelFunc:moe};var kO;function doe(r){kO=r.wasm.cwrap(ln,null,["number","number","number","array","number","array","array","number","number"])}function foe(r){let{backend:t,inputs:e,attrs:o}=r,{x:n}=e,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a==="NHWC"?n.shape[1]:n.shape[2],u=a==="NHWC"?n.shape[2]:n.shape[3],c=a==="NHWC"?n.shape[3]:n.shape[1],l=p*s,m=u*s,d=c/(s*s),f=a==="NHWC"?[i,l,m,d]:[i,d,l,m],h=t.makeOutput(f,"float32"),x=t.dataIdMap.get(n.dataId).id,b=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),C=new Uint8Array(new Int32Array(f).buffer),S=new Uint8Array(new Int32Array(y.computeStrides(f)).buffer),k=t.dataIdMap.get(h.dataId).id;return kO(x,s,a==="NHWC"?1:0,b,n.shape.length-1,C,S,f.length,k),h}var NO={kernelName:ln,backendName:"wasm",setupFunc:doe,kernelFunc:foe};var TO;function hoe(r){TO=r.wasm.cwrap(mn,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function goe(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s}=t,a=o.dataIdMap.get(n.dataId).id,i=o.dataIdMap.get(s.dataId).id,{strides:p,dilations:u,pad:c,dimRoundingMode:l}=e,m=u==null?[1,1]:u,d=w.computeConv2DInfo(n.shape,s.shape,p,m,c,l,!0),f=d.filterHeight,h=d.filterWidth,g=d.padInfo.top,x=d.padInfo.right,b=d.padInfo.bottom,C=d.padInfo.left,S=d.dilationHeight,k=d.dilationWidth,_=d.strideHeight,E=d.strideWidth,R=d.inChannels,D=d.outChannels,P=d.padInfo.type==="SAME"?1:0;if(d.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`);let O=o.makeOutput(d.outShape,"float32"),M=o.dataIdMap.get(O.dataId).id;return TO(a,n.shape[0],n.shape[1],n.shape[2],i,f,h,g,x,b,C,P,S,k,_,E,R,D,M),O}var _O={kernelName:mn,backendName:"wasm",setupFunc:hoe,kernelFunc:goe};var $O;function xoe(r){$O=r.wasm.cwrap("Diag",null,["number","number","number","number"])}function yoe(r){let{inputs:t,backend:e}=r,{x:o}=t,n=y.sizeFromShape(o.shape),s=e.makeOutput([...o.shape,...o.shape],o.dtype);return $O(e.dataIdMap.get(o.dataId).id,we[o.dtype],n,e.dataIdMap.get(s.dataId).id),s}var EO={kernelName:oa,backendName:"wasm",setupFunc:xoe,kernelFunc:yoe};var RO;function boe(r){RO=r.wasm.cwrap(dn,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Coe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o;if(n.dtype!==s.dtype)throw new Error(`Dilation2D error: x must have the same dtype as filter. Got ${n.dtype} and ${s.dtype}`);let u=w.computeDilation2DInfo(n.shape,s.shape,a,i,"NHWC",p),c=e.makeOutput(u.outShape,n.dtype);return RO(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(c.dataId).id,we[n.dtype],u.batchSize,u.inChannels,u.inHeight,u.inWidth,u.outHeight,u.outWidth,u.strideHeight,u.strideWidth,u.dilationHeight,u.dilationWidth,u.filterHeight,u.filterWidth,u.padInfo.top,u.padInfo.left),c}var DO={kernelName:dn,backendName:"wasm",setupFunc:boe,kernelFunc:Coe};var AO;function woe(r){AO=r.wasm.cwrap(Mi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Soe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropFilter error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let c=w.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),l=e.makeOutput(s.shape,s.dtype);return AO(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(a.dataId).id,e.dataIdMap.get(l.dataId).id,we[n.dtype],c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.filterHeight,c.filterWidth,c.padInfo.top,c.padInfo.left),l}var FO={kernelName:Mi,backendName:"wasm",setupFunc:woe,kernelFunc:Soe};var PO;function Ioe(r){PO=r.wasm.cwrap(Oi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function voe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropInput error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let c=w.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),l=e.makeOutput(n.shape,n.dtype);return PO(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(a.dataId).id,e.dataIdMap.get(l.dataId).id,we[n.dtype],c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.filterHeight,c.filterWidth,c.padInfo.top,c.padInfo.left),l}var OO={kernelName:Oi,backendName:"wasm",setupFunc:Ioe,kernelFunc:voe};var MO=he(hn);var LO;function koe(r){LO=r.wasm.cwrap(Xa,null,["number","number","number"])}function Noe(r){let{inputs:t,backend:e}=r,{dy:o,y:n}=t,s=e.makeOutput(n.shape,"float32"),a=i=>e.dataIdMap.get(i.dataId).id;return LO(a(n),a(o),a(s)),s}var BO={kernelName:Xa,backendName:"wasm",setupFunc:koe,kernelFunc:Noe};var Toe=!1,zO=Ue(xn,Toe,"bool");var VO=he(gn);var WO=he(yn,"float32");function Mg(r){let{inputs:t,attrs:e,backend:o}=r,{input:n}=t,{dim:s}=e,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),zt({inputs:{x:n},backend:o,attrs:{shape:i}})}var UO={kernelName:na,backendName:"wasm",kernelFunc:Mg};var GO=he(bn,"float32");function Ov(r){let{attrs:{shape:t,value:e},backend:o}=r,{attrs:{dtype:n}}=r;n=n||y.inferDtype(e);let s=o.makeOutput(t,n);return o.typedArrayFromHeap(s).fill(e),s}var HO={kernelName:sa,backendName:"wasm",kernelFunc:Ov};var KO;function _oe(r){KO=r.wasm.cwrap(Cn,null,["number","number","number","number","number","number"])}function $oe(r){let{inputs:t,backend:e}=r,{image:o}=t,n=e.makeOutput(o.shape,o.dtype),s=e.dataIdMap.get(o.dataId).id,a=e.dataIdMap.get(n.dataId).id,[i,p,u,c]=o.shape;return KO(s,i,p,u,c,a),n}var qO={kernelName:Cn,backendName:"wasm",kernelFunc:$oe,setupFunc:_oe};var jO=he(wn);var Eoe=!1,XO=Ue(Sn,Eoe);var YO;function Roe(r){YO=r.wasm.cwrap(In,null,["number","number","number","number","number","number","number"])}function Doe(r){let{backend:t,inputs:e,attrs:o}=r,{varianceEpsilon:n}=o,{x:s,mean:a,variance:i,offset:p,scale:u}=e,c=t.dataIdMap.get(s.dataId).id,l=t.dataIdMap.get(a.dataId).id,m=t.dataIdMap.get(i.dataId).id,d=p!=null?t.dataIdMap.get(p.dataId).id:0,f=u!=null?t.dataIdMap.get(u.dataId).id:0,h=t.makeOutput(s.shape,s.dtype);if(y.sizeFromShape(s.shape)===0)return h;let g=t.dataIdMap.get(h.dataId).id;return YO(c,l,m,d,f,n,g),h}var QO={kernelName:In,backendName:"wasm",setupFunc:Roe,kernelFunc:Doe};var ZO;function Aoe(r){ZO=r.wasm.cwrap(Io,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 Foe(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dataFormat:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=e,h=w.computeConv2DInfo(n.shape,s.shape,p,c,u,m),g=bu[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,C=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==C)throw new Error(`FusedConv2D bias shape (${ee.shape}) does not match the number of output channels (${C})`);S=ee.id}let k=h.filterHeight,_=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,P=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type==="SAME"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(l!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${l}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,"float32"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return ZO(x,j,q,Y,b,k,_,S,E,R,D,P,U,O,M,L,B,z,C,g,ne,f||0,re),J}var JO={kernelName:Io,backendName:"wasm",setupFunc:Aoe,kernelFunc:Foe};var eM;function Poe(r){eM=r.wasm.cwrap(vo,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 Ooe(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dataFormat:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=e,h=w.computeConv2DInfo(n.shape,s.shape,p,c,u,m,!0),g=bu[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,C=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==C)throw new Error(`FusedDepthwiseConv2D bias shape (${ee.shape}) does not match the number of output channels (${C})`);S=ee.id}let k=h.filterHeight,_=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,P=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type==="SAME"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(l!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${l}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,"float32"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return eM(x,j,q,Y,b,k,_,S,E,R,D,P,U,O,M,L,B,z,C,g,ne,f||0,re),J}var tM={kernelName:vo,backendName:"wasm",setupFunc:Poe,kernelFunc:Ooe};var rM;function Moe(r){rM=r.wasm.cwrap(vn,null,["number","number","number","number","number","number","array","number"])}function Loe(r){let{backend:t,inputs:e}=r,{params:o,indices:n}=e,[s,a,i,p]=sf.prepareAndValidate(o,n),u=t.makeOutput(s,o.dtype);if(a===0)return u;let c=n.shape,l=c[c.length-1],d=t.dataIdMap.get(o.dataId).id,h=t.dataIdMap.get(n.dataId).id,g=new Uint8Array(new Int32Array(p).buffer),x=t.dataIdMap.get(u.dataId).id;return rM(d,we[o.dtype],h,a,l,i,g,x),u}var oM={kernelName:vn,backendName:"wasm",setupFunc:Moe,kernelFunc:Loe};var nM;function Boe(r){nM=r.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function zoe(r){let{backend:t,inputs:e,attrs:o}=r,{x:n,indices:s}=e,{axis:a,batchDims:i}=o,p=y.parseAxisParam(a,n.shape)[0],u=t.readSync(s.dataId),c=n.shape[p];for(let D=0;D=0,()=>`GatherV2: the index value ${P} is not in [0, ${c-1}]`)}let l=w.segment_util.collectGatherOpShapeInfo(n,s,p,i),m=zt({inputs:{x:n},attrs:{shape:[l.batchSize,l.outerSize,l.dimSize,l.sliceSize]},backend:t}),d=y.sizeFromShape(s.shape),f=zt({inputs:{x:s},attrs:{shape:[l.batchSize,d/l.batchSize]},backend:t}),h=[l.batchSize,l.outerSize,d/l.batchSize,l.sliceSize],g=t.makeOutput(h,n.dtype);if(y.sizeFromShape(n.shape)===0)return g;let x=m.shape.length-1,C=t.dataIdMap.get(m.dataId).id,k=t.dataIdMap.get(f.dataId).id,_=t.dataIdMap.get(g.dataId).id,E=new Uint8Array(new Int32Array(y.computeStrides(m.shape)).buffer),R=new Uint8Array(new Int32Array(y.computeStrides(h)).buffer);return nM(C,we[n.dtype],E,x,k,l.batchSize,R,_),t.disposeData(m.dataId),t.disposeData(f.dataId),g.shape=l.outputShape,g}var sM={kernelName:aa,backendName:"wasm",setupFunc:Boe,kernelFunc:zoe};var Voe=!1,aM=Ue(kn,Voe,"bool");var Woe=!1,iM=Ue(Nn,Woe,"bool");var uM=he(Tn,"bool");var pM=he(_n,"bool");var cM=he($n,"bool");var lM;function Uoe(r){lM=r.wasm.cwrap(En,null,["number","number","number","number"])}function Goe(r){let{inputs:{x:t},attrs:{alpha:e},backend:o}=r,n=o.dataIdMap.get(t.dataId).id,s=o.makeOutput(t.shape,"float32");if(y.sizeFromShape(t.shape)!==0){let a=o.dataIdMap.get(s.dataId).id;lM(n,we[t.dtype],e,a)}return s}var mM={kernelName:En,backendName:"wasm",setupFunc:Uoe,kernelFunc:Goe};var Hoe=!1,dM=Ue(Rn,Hoe,"bool");var Koe=!1,fM=Ue(Dn,Koe,"bool");var hM;function qoe(r){hM=r.wasm.cwrap(An,null,["number","number","number","number"])}function joe(r){let{attrs:t,backend:e}=r,{start:o,stop:n,num:s}=t,a=Math.floor(s),i=e.makeOutput([a],"float32");return hM(e.dataIdMap.get(i.dataId).id,o,n,a),i}var gM={kernelName:An,backendName:"wasm",setupFunc:qoe,kernelFunc:joe};var xM=he(Fn);var yM=he(Pn);var Xoe=!1,bM=Ue(On,Xoe,"bool");var CM=he(Mn);var Yoe=!1,wM=Ue(Ln,Yoe,"bool");var Qoe=!1,SM=Ue(E0,Qoe,"bool");var IM;function Zoe(r){IM=r.wasm.cwrap(Bn,null,["number","number","number","number","number","number","number"])}function Joe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o;if(n.dtype!=="float32")throw new Error("LRN error: x must have dtype float32");let u=e.makeOutput(n.shape,n.dtype);return IM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(u.dataId).id,n.shape[3],s,a,i,p),u}var vM={kernelName:Bn,backendName:"wasm",setupFunc:Zoe,kernelFunc:Joe};var kM;function ene(r){kM=r.wasm.cwrap(Ya,null,["number","number","number","number","number","number","number","number","number"])}function tne(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,y:s,dy:a}=t,{depthRadius:i,bias:p,alpha:u,beta:c}=o;if(n.dtype!=="float32"||s.dtype!=="float32"||a.dtype!=="float32")throw new Error("LRNGrad error: x, y, and dy must have dtype float32");let l=e.makeOutput(n.shape,n.dtype);return kM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(a.dataId).id,e.dataIdMap.get(l.dataId).id,a.shape[3],i,p,u,c),l}var NM={kernelName:Ya,backendName:"wasm",setupFunc:ene,kernelFunc:tne};var TM;function rne(r){TM=r.wasm.cwrap(zn,null,["number","number","number","number"])}function one(r){let{backend:t,inputs:e,attrs:o}=r,{reductionIndices:n,keepDims:s}=o,{x:a}=e,p=t.dataIdMap.get(a.dataId).id,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t);if(d){let C=t.dataIdMap.get(c.dataId).id;u=c,p=C}let f=u.shape.length;w.assertAxesAreInnerMostDims("max",l,f);let[h,g]=w.computeOutAndReduceShapes(u.shape,l),x=y.sizeFromShape(g),b=t.makeOutput(h,a.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;TM(p,we[a.dtype],x,C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var _M={kernelName:zn,backendName:"wasm",setupFunc:rne,kernelFunc:one};var nne=!1,$M=Ue(Vn,nne);var EM;function sne(r){EM=r.wasm.cwrap(Wn,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function ane(r){let{inputs:t,attrs:e,backend:o}=r,n=t.x,s=o.dataIdMap.get(n.dataId).id;y.assert(n.dtype==="float32",()=>`Error in MaxPool: only float32 input is supported. Got ${n.dtype}.`);let{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=e,c=w.computePool2DInfo(n.shape,a,i,1,p,u),l=c.filterHeight,m=c.filterWidth,d=c.padInfo.top,f=c.padInfo.right,h=c.padInfo.bottom,g=c.padInfo.left,x=c.dilationHeight,b=c.dilationWidth,C=c.strideHeight,S=c.strideWidth,k=c.inChannels,_=c.outChannels;if(c.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${c.dataFormat}'. Please use 'channelsLast'.`);let E=o.makeOutput(c.outShape,"float32"),R=o.dataIdMap.get(E.dataId).id;return EM(s,n.shape[0],n.shape[1],n.shape[2],l,m,d,f,h,g,x,b,C,S,k,_,R),E}var RM={kernelName:Wn,backendName:"wasm",setupFunc:sne,kernelFunc:ane};var DM;function ine(r){DM=r.wasm.cwrap("MaxPool3D",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function une(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,c=w.computePool3DInfo(n.shape,s,a,1,i,p,u),l=e.makeOutput(c.outShape,n.dtype);return DM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,c.batchSize,c.inChannels,c.inDepth,c.inHeight,c.inWidth,c.outDepth,c.outHeight,c.outWidth,c.strideDepth,c.strideHeight,c.strideWidth,c.dilationDepth,c.dilationHeight,c.dilationWidth,c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.front,c.padInfo.top,c.padInfo.left),l}var AM={kernelName:ia,backendName:"wasm",setupFunc:ine,kernelFunc:une};var FM;function pne(r){FM=r.wasm.cwrap("MaxPool3DGrad",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 cne(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,c=w.computePool3DInfo(s.shape,a,i,1,p,u),l=e.makeOutput(s.shape,s.dtype);return FM(e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,c.batchSize,c.inChannels,c.inDepth,c.inHeight,c.inWidth,c.outDepth,c.outHeight,c.outWidth,c.strideDepth,c.strideHeight,c.strideWidth,c.dilationDepth,c.dilationHeight,c.dilationWidth,c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.front,c.padInfo.top,c.padInfo.left),l}var PM={kernelName:Ui,backendName:"wasm",setupFunc:pne,kernelFunc:cne};var OM;function lne(r){OM=r.wasm.cwrap("MaxPoolGrad",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function mne(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,c=w.computePool2DInfo(s.shape,a,i,1,p,u),l=e.makeOutput(s.shape,s.dtype);return OM(e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.top,c.padInfo.left),l}var MM={kernelName:Wi,backendName:"wasm",setupFunc:lne,kernelFunc:mne};var LM;function dne(r){LM=r.wasm.cwrap("MaxPoolWithArgmax",null,["number","number","number","number","boolean","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function fne(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,includeBatchInIndex:p}=o;y.assert(n.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`);let u=[1,1];y.assert(w.eitherStridesOrDilationsAreOne(a,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let c=w.computePool2DInfo(n.shape,s,a,[1,1],i),l=e.makeOutput(c.outShape,n.dtype),m=e.makeOutput(c.outShape,"int32");return LM(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(l.dataId).id,e.dataIdMap.get(m.dataId).id,we[n.dtype],p,c.batchSize,c.inChannels,c.inHeight,c.inWidth,c.outHeight,c.outWidth,c.strideHeight,c.strideWidth,c.dilationHeight,c.dilationWidth,c.effectiveFilterHeight,c.effectiveFilterWidth,c.padInfo.top,c.padInfo.left),[l,m]}var BM={kernelName:ua,backendName:"wasm",setupFunc:dne,kernelFunc:fne};var zM;function hne(r){zM=r.wasm.cwrap(Un,null,["number, number, number"])}function gne(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t),f=l;if(d){let S=t.dataIdMap.get(c.dataId).id;S!==i&&(u=c,p=S,f=w.getInnerMostAxes(f.length,u.shape.length))}w.assertAxesAreInnerMostDims("mean",f,u.shape.length);let[h,g]=w.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=u;u.dtype!=="float32"&&(b=Or({backend:t,inputs:{x:u},attrs:{dtype:"float32"}}),p=t.dataIdMap.get(b.dataId).id);let C=t.makeOutput(h,"float32");if(y.sizeFromShape(u.shape)!==0){let S=t.dataIdMap.get(C.dataId).id;zM(p,x,S)}if(d&&t.disposeData(c.dataId),s){let S=w.expandShapeToKeepDim(C.shape,m);C.shape=S}return u.dtype!=="float32"&&t.disposeData(b.dataId),C}var VM={kernelName:Un,backendName:"wasm",setupFunc:hne,kernelFunc:gne};var WM;function xne(r){WM=r.wasm.cwrap(Gn,null,["number","number","number","number"])}function yne(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t);if(d){let C=t.dataIdMap.get(c.dataId).id;C!==i&&(u=c,p=C)}let f=u.shape.length;w.assertAxesAreInnerMostDims("min",l,f);let[h,g]=w.computeOutAndReduceShapes(u.shape,l),x=y.sizeFromShape(g),b=t.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;WM(p,we[a.dtype],x,C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var UM={kernelName:Gn,backendName:"wasm",setupFunc:xne,kernelFunc:yne};var bne=!1,GM=Ue(Hn,bne);var Mv;(function(r){r[r.reflect=0]="reflect",r[r.symmetric=1]="symmetric"})(Mv||(Mv={}));var HM;function Cne(r){HM=r.wasm.cwrap(Kn,null,["number","array","number","number","array","array","number","number"])}function wne(r){let{inputs:{x:t},backend:e,attrs:{paddings:o,mode:n}}=r,s=o.map((f,h)=>f[0]+t.shape[h]+f[1]),a=e.dataIdMap.get(t.dataId).id,i=e.makeOutput(s,t.dtype),p=e.dataIdMap.get(i.dataId).id,u=new Uint8Array(new Int32Array(t.shape).buffer),c=o.map(f=>f[0]),l=o.map(f=>f[1]),m=new Uint8Array(new Int32Array(c).buffer),d=new Uint8Array(new Int32Array(l).buffer);return HM(a,u,t.shape.length,we[t.dtype],m,d,Mv[n],p),i}var KM={kernelName:Kn,backendName:"wasm",kernelFunc:wne,setupFunc:Cne};var qM;function Sne(r){qM=r.wasm.cwrap(Is,null,["number","number","number","number"])}function Lv(r){let{backend:t,inputs:{logits:e},attrs:{dim:o}}=r,n=t.dataIdMap.get(e.dataId).id,s=t.makeOutput(e.shape,e.dtype),a=t.dataIdMap.get(s.dataId).id,i=e.shape[o],p=y.sizeFromShape(e.shape)/i;return y.sizeFromShape(s.shape)===0||qM(n,a,i,p),s}var jM={kernelName:Is,backendName:"wasm",setupFunc:Sne,kernelFunc:Lv};var XM;function Ine(r){XM=r.wasm.cwrap(jn,null,["number","number","number","number","number","number"])}function vne(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o;if(n.dtype!=="float32")throw new Error(`Tensor logits must have dtype float32, got ${n.dtype}`);let p=i?n:Lv({inputs:{logits:n},backend:e,attrs:{dim:n.shape.length-1}}),[u,c]=p.shape,l=e.makeOutput([u,s],"int32");return XM(e.dataIdMap.get(p.dataId).id,u,c,s,a,e.dataIdMap.get(l.dataId).id),i||e.disposeData(p.dataId),l}var YM={kernelName:jn,backendName:"wasm",setupFunc:Ine,kernelFunc:vne};var QM=Ue(qn,!0);var kne=!0,ZM=Ue(Xn,kne);var JM=he(pa);function Hc(r,t){let e=new Int32Array(r.wasm.HEAPU8.buffer,t,4),o=e[0],n=e[1],s=e[2],a=e[3];return r.wasm._free(t),{pSelectedIndices:o,selectedSize:n,pSelectedScores:s,pValidOutputs:a}}var eL;function Nne(r){eL=r.wasm.cwrap(Qn,"number",["number","number","number","number","number"])}function Tne(r){let{backend:t,inputs:e,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a}=o,{boxes:i,scores:p}=e,u=t.dataIdMap.get(i.dataId).id,c=t.dataIdMap.get(p.dataId).id,l=eL(u,c,s,n,a),{pSelectedIndices:m,selectedSize:d,pSelectedScores:f,pValidOutputs:h}=Hc(t,l);return t.wasm._free(f),t.wasm._free(h),t.makeOutput([d],"int32",m)}var tL={kernelName:Qn,backendName:"wasm",setupFunc:Nne,kernelFunc:Tne};var rL;function _ne(r){rL=r.wasm.cwrap(Qa,"number",["number","number","number","number","number","bool"])}function $ne(r){let{backend:t,inputs:e,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,padToMaxOutputSize:i}=o,{boxes:p,scores:u}=e,c=t.dataIdMap.get(p.dataId).id,l=t.dataIdMap.get(u.dataId).id,m=rL(c,l,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Hc(t,m);t.wasm._free(h);let x=t.makeOutput([f],"int32",d),b=t.makeOutput([],"int32",g);return[x,b]}var oL={kernelName:Qa,backendName:"wasm",setupFunc:_ne,kernelFunc:$ne};var nL;function Ene(r){nL=r.wasm.cwrap(Zn,"number",["number","number","number","number","number","number"])}function Rne(r){let{backend:t,inputs:e,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,softNmsSigma:i}=o,{boxes:p,scores:u}=e,c=t.dataIdMap.get(p.dataId).id,l=t.dataIdMap.get(u.dataId).id,m=nL(c,l,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Hc(t,m);t.wasm._free(g);let x=t.makeOutput([f],"int32",d),b=t.makeOutput([f],"float32",h);return[x,b]}var sL={kernelName:Zn,backendName:"wasm",setupFunc:Ene,kernelFunc:Rne};var Dne=!1,aL=Ue(Yn,Dne,"bool");var iL;function Ane(r){iL=r.wasm.cwrap(Jn,null,["number","number","number","number","number"])}function Fne(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n}=t,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=e.makeOutput([...n.shape,a],s),c=e.dataIdMap.get(u.dataId).id,m=e.dataIdMap.get(n.dataId).id;return iL(m,a,i,p,c),u}var uL={kernelName:Jn,backendName:"wasm",setupFunc:Ane,kernelFunc:Fne};function Pne(r){let{inputs:{x:t},backend:e}=r,o=e.makeOutput(t.shape,t.dtype);return e.typedArrayFromHeap(o).fill(1),o}var pL={kernelName:ca,backendName:"wasm",kernelFunc:Pne};function One(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o;if(t.length===1)return Mg({inputs:{input:t[0]},backend:e,attrs:{dim:n}});let s=t[0].shape,a=t[0].dtype;t.forEach(c=>{y.assertShapesMatch(s,c.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===c.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=t.map(c=>{let l=Mg({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=Fv({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeData(c.dataId)),u}var cL={kernelName:la,backendName:"wasm",kernelFunc:One};var lL;function Mne(r){lL=r.wasm.cwrap(es,null,["number","array","number","number","array","array","number","number"])}function Lne(r){let{inputs:{x:t},backend:e,attrs:{paddings:o,constantValue:n}}=r,s=o.map((h,g)=>h[0]+t.shape[g]+h[1]);if(y.sizeFromShape(t.shape)===0)return Ov({backend:e,attrs:{shape:s,value:n,dtype:t.dtype}});let a=e.dataIdMap.get(t.dataId).id,i=e.makeOutput(s,t.dtype),u=e.dataIdMap.get(i.dataId).id,c=new Uint8Array(new Int32Array(t.shape).buffer),l=o.map(h=>h[0]),m=o.map(h=>h[1]),d=new Uint8Array(new Int32Array(l).buffer),f=new Uint8Array(new Int32Array(m).buffer);return lL(a,c,t.shape.length,we[t.dtype],d,f,n,u),i}var Lg={kernelName:es,backendName:"wasm",kernelFunc:Lne,setupFunc:Mne};var Bne=!1,mL=Ue(ts,Bne);var dL;function zne(r){dL=r.wasm.cwrap(rs,null,["number","number","number"])}function Vne(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t,s=e.dataIdMap.get(o.dataId).id,a=e.dataIdMap.get(n.dataId).id,i=s,p=o,u=p;p.dtype!=="float32"&&(u=Or({backend:e,inputs:{x:o},attrs:{dtype:"float32"}}),i=e.dataIdMap.get(u.dataId).id);let c=e.makeOutput(o.shape,"float32"),l=e.dataIdMap.get(c.dataId).id;return dL(i,a,l),p.dtype!=="float32"&&e.disposeData(u.dataId),c}var fL={kernelName:rs,backendName:"wasm",setupFunc:zne,kernelFunc:Vne};var hL;function Wne(r){hL=r.wasm.cwrap(os,null,["number","number","number","number"])}function Une(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t),f=l;if(d){let C=t.dataIdMap.get(c.dataId).id;C!==i&&(u=c,p=C,f=w.getInnerMostAxes(f.length,u.shape.length))}w.assertAxesAreInnerMostDims("prod",f,u.shape.length);let[h,g]=w.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=t.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;hL(p,x,we[b.dtype],C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var gL={kernelName:os,backendName:"wasm",setupFunc:Wne,kernelFunc:Une};var Gne=r=>{let{backend:t,attrs:e}=r,{start:o,stop:n,step:s,dtype:a}=e,i=ap(o,n,s,a),p=t.makeOutput([i.length],a);return t.typedArrayFromHeap(p).set(i),p},xL={kernelName:ma,backendName:"wasm",kernelFunc:Gne};var Hne=!0,yL=Ue(fn,Hne);var bL=he(ns);var CL=he(ss);var wL=he(us);var SL;function Kne(r){SL=r.wasm.cwrap(is,null,["number","number","number","number","number","number","number","number","number","number"])}function qne(r){let{backend:t,inputs:e,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[c,l,m,d]=n.shape,f=[c,p,u,d],h=t.dataIdMap.get(n.dataId),g;h.dtype!=="float32"&&(g=Or({backend:t,inputs:{x:n},attrs:{dtype:"float32"}}),h=t.dataIdMap.get(g.dataId));let x=h.id,b=t.makeOutput(f,"float32");if(y.sizeFromShape(n.shape)===0)return b;let C=t.dataIdMap.get(b.dataId).id;return SL(x,c,l,m,d,p,u,s?1:0,a?1:0,C),g!=null&&t.disposeData(g.dataId),b}var IL={kernelName:is,backendName:"wasm",setupFunc:Kne,kernelFunc:qne};var vL;function jne(r){vL=r.wasm.cwrap(Ja,null,["number","number","number","array","array","boolean"])}function Xne(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=e.makeOutput(n.shape,"float32"),p=e.dataIdMap.get(n.dataId),u;return p.dtype!=="float32"&&(u=Or({backend:e,inputs:{x:n},attrs:{dtype:"float32"}}),p=e.dataIdMap.get(u.dataId)),vL(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&e.disposeData(u.dataId),i}var kL={kernelName:Ja,backendName:"wasm",setupFunc:jne,kernelFunc:Xne};var NL;function Yne(r){NL=r.wasm.cwrap(as,null,["number","number","number","number","number","number","number","number","number","number"])}function Qne(r){let{backend:t,inputs:e,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[c,l,m,d]=n.shape,f=[c,p,u,d],h=t.makeOutput(f,"float32");if(y.sizeFromShape(n.shape)===0)return h;let g=t.dataIdMap.get(n.dataId),x;g.dtype!=="float32"&&(x=Or({backend:t,inputs:{x:n},attrs:{dtype:"float32"}}),g=t.dataIdMap.get(x.dataId));let b=g.id,C=t.dataIdMap.get(h.dataId).id;return NL(b,c,l,m,d,p,u,s?1:0,a?1:0,C),x!=null&&t.disposeData(x.dataId),h}var TL={kernelName:as,backendName:"wasm",setupFunc:Yne,kernelFunc:Qne};var _L;function Zne(r){_L=r.wasm.cwrap(Za,null,["number","number","number","array","array","boolean"])}function Jne(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,i=e.makeOutput(n.shape,"float32"),p=e.dataIdMap.get(n.dataId),u;return p.dtype!=="float32"&&(u=Or({backend:e,inputs:{x:n},attrs:{dtype:"float32"}}),p=e.dataIdMap.get(u.dataId)),_L(e.dataIdMap.get(n.dataId).id,e.dataIdMap.get(s.dataId).id,e.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&e.disposeData(u.dataId),i}var $L={kernelName:Za,backendName:"wasm",setupFunc:Zne,kernelFunc:Jne};var EL;function ese(r){EL=r.wasm.cwrap(ps,null,["number","array","number","array","number","number"])}function tse(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o,a=y.parseAxisParam(s,n.shape);if(n.shape.length===0)return vp({inputs:{x:n},backend:e});let i=e.makeOutput(n.shape,n.dtype),p=e.dataIdMap.get(n.dataId).id,u=e.dataIdMap.get(i.dataId).id,c=new Uint8Array(new Int32Array(a).buffer),l=new Uint8Array(new Int32Array(n.shape).buffer);EL(p,c,a.length,l,n.shape.length,u);let m=zt({inputs:{x:i},attrs:{shape:n.shape},backend:e});return e.disposeData(i.dataId),m}var RL={kernelName:ps,backendName:"wasm",kernelFunc:tse,setupFunc:ese};var DL;function rse(r){DL=r.wasm.cwrap(Ds,null,["number","number","number","number","number","number","number","number","array","number","number"])}function ose(r){let{inputs:t,backend:e,attrs:o}=r,{image:n}=t,{radians:s,fillValue:a,center:i}=o,p=e.makeOutput(n.shape,n.dtype),u=e.dataIdMap.get(n.dataId).id,c=e.dataIdMap.get(p.dataId).id,[l,m,d,f]=n.shape,[h,g]=w.getImageCenter(i,m,d),x=a===0,b=255,C=typeof a=="number"?[a,a,a,x?0:b]:[...a,b],S=new Uint8Array(new Int32Array(C).buffer);return DL(u,l,m,d,f,s,h,g,S,C.length,c),p}var AL={kernelName:Ds,backendName:"wasm",kernelFunc:ose,setupFunc:rse};var FL=he(cs);var PL=he(ls);var OL;function nse(r){OL=r.wasm.cwrap(ms,null,["number","number","number","number","number","number","array","number","number"])}function sse(r){let{backend:t,inputs:e,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,i=t.makeOutput(a,s.dtype);if(y.sizeFromShape(a)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=lu.calculateShapes(s,n,a),f=t.dataIdMap.get(n.dataId).id,g=t.dataIdMap.get(s.dataId).id,x=new Uint8Array(new Int32Array(l).buffer),b=t.dataIdMap.get(i.dataId).id;return OL(f,g,we[s.dtype],p,u,c,x,m,b),i}var ML={kernelName:ms,backendName:"wasm",setupFunc:nse,kernelFunc:sse};var LL;function ase(r){LL=r.wasm.cwrap(fs,null,["number","number","number","number","number","number","bool","number"])}function ise(r){let{inputs:t,backend:e,attrs:o}=r,{sortedSequence:n,values:s}=t,{side:a}=o;if(n.dtype!==s.dtype)throw new Error(`SearchSorted error: sorted_sequence must have the same dtype as values. Got ${n.dtype} and ${s.dtype}`);let i=e.makeOutput(s.shape,"int32");function p(u){return e.dataIdMap.get(u.dataId).id}return LL(p(n),p(s),n.shape[0],n.shape[1],s.shape[1],we[n.dtype],a==="left",p(i)),i}var BL={kernelName:fs,backendName:"wasm",setupFunc:ase,kernelFunc:ise};var zL;function use(r){zL=r.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function pse(r){let{inputs:t,backend:e}=r,{condition:o,t:n,e:s}=t,a=e.dataIdMap.get(o.dataId).id,i=e.dataIdMap.get(n.dataId).id,p=e.dataIdMap.get(s.dataId).id,u=e.makeOutput(n.shape,n.dtype),c=e.dataIdMap.get(u.dataId).id,l=o.shape.length,m=n.shape.length,d=l===0||l>1||m===1?1:y.sizeFromShape(n.shape.slice(1));return zL(a,i,p,d,c),u}var VL={kernelName:fa,backendName:"wasm",kernelFunc:pse,setupFunc:use};var WL=he(hs);var UL;function cse(r){UL=r.wasm.cwrap(bs,null,["number","number"])}function lse(r){let{backend:t,inputs:{x:e}}=r,o=t.dataIdMap.get(e.dataId).id,n=t.makeOutput(e.shape,e.dtype),s=t.dataIdMap.get(n.dataId).id;return y.sizeFromShape(n.shape)===0||UL(o,s),n}var GL={kernelName:"Sigmoid",backendName:"wasm",setupFunc:cse,kernelFunc:lse};var HL=he(ys);var KL=he(gs);var qL=he(xs);var jL=he(Cs);function mse(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,paddings:a}=o,i=y.sizeFromShape(s),p=[[0,0]];p.push(...a);for(let _=1+s.length;_{let D=S.shape[0],F=S.shape[1],O=C.segment_util.segOpComputeOptimalWindowSize(F,R),M={windowSize:O,inSize:F,batchSize:D,numSegments:R},L=new qg(M,k),B=t.compileAndRun(L,[S,T],E);if(p.push(B),B.shape[1]===R)return B;let z=K0({backend:t,attrs:{start:0,stop:R,step:1,dtype:"float32"}}),U=q0({inputs:{x:z},backend:t,attrs:{reps:[F/O]}});return p.push(z),p.push(U),g(B,k,U,E,R)},x=g(f,"unsortedSegmentSum",s,h,a),b=te({inputs:{x},backend:t,attrs:{shape:m}}),w=b;if(l!=null){p.push(b);let S=C.getUndoAxesPermutation(l);w=Ct({inputs:{x:w},backend:t,attrs:{perm:S}})}return p.forEach(S=>t.disposeIntermediateTensorInfo(S)),w}var sO={kernelName:su,backendName:"webgl",kernelFunc:Woe};var Uoe=[VA,UA,GA,HA,qA,jA,XA,YA,JA,eF,tF,rF,oF,nF,sF,aF,iF,uF,pF,lF,cF,dF,fF,hF,gF,CF,SF,IF,RA,kF,TF,_F,EF,$F,RF,DF,AF,FF,PF,OF,BF,zF,VF,WF,UF,GF,HF,KF,qF,jF,XF,YF,QF,ZF,JF,e3,r3,o3,n3,s3,i3,u3,p3,l3,c3,m3,d3,f3,h3,$A,g3,NF,x3,y3,b3,DA,C3,w3,S3,I3,v3,k3,N3,T3,_3,E3,R3,D3,A3,F3,P3,O3,L3,z3,V3,W3,U3,G3,X3,PA,Y3,Q3,Z3,J3,xF,eP,oP,nP,sP,aP,AA,iP,uP,pP,lP,cP,yF,H3,mP,dP,fP,MA,hP,gP,xP,yP,bP,CP,wP,SP,IP,vP,kP,NP,TP,_P,EP,$P,mF,j3,RP,DP,AP,FP,PP,OP,MP,LP,zP,VP,UP,GP,HP,KP,qP,jP,XP,q3,BA,YP,QP,ZP,JP,tO,rO,zA,oO,nO,sO,tP];for(let r of Uoe)li(r);var we;(function(r){r[r.float32=0]="float32",r[r.int32=1]="int32",r[r.bool=2]="bool",r[r.string=3]="string",r[r.complex64=4]="complex64"})(we||(we={}));var _u;(function(r){r[r.linear=0]="linear",r[r.relu=1]="relu",r[r.relu6=2]="relu6",r[r.prelu=3]="prelu",r[r.leakyrelu=4]="leakyrelu",r[r.sigmoid=5]="sigmoid",r[r.elu=6]="elu"})(_u||(_u={}));var aO;function Goe(r){aO=r.wasm.cwrap(qo,null,["number","array","number","number","array","number","number","number","number","number","number","number","number"])}function Hoe(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=e;if(n.dtype!=="float32"||s.dtype!=="float32")throw new Error("_FusedMatMul for non non-float32 tensors not yet supported.");let{transposeA:p,transposeB:u,activation:l,leakyreluAlpha:c}=o,m=t.dataIdMap.get(n.dataId).id,d=t.dataIdMap.get(s.dataId).id,f=0;if(a!=null){let R=t.dataIdMap.get(a.dataId);if(R.shape.length!==1)throw new Error(`_FusedMatMul only supports rank-1 bias but got rank ${R.shape.length}.`);f=R.id}let h=i==null?0:t.dataIdMap.get(i.dataId).id,g=_u[l];if(g==null)throw new Error(`${l} activation not yet supported for FusedConv2D in the wasm backend.`);let x=p?n.shape[2]:n.shape[1],b=u?s.shape[1]:s.shape[2],w=kr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)),S=t.makeOutput([...w,x,b],n.dtype),k=t.dataIdMap.get(S.dataId).id,T=new Uint8Array(new Int32Array(n.shape).buffer),E=new Uint8Array(new Int32Array(s.shape).buffer);return aO(m,T,n.shape.length,d,E,s.shape.length,p,u,g,f,h,c||0,k),S}var iO={kernelName:qo,backendName:"wasm",setupFunc:Goe,kernelFunc:Hoe};function he(r,e){let t;function o(s){t=s.wasm.cwrap(r,null,["number","number","number"])}function n(s){let{backend:a,inputs:{x:i}}=s,p=a.dataIdMap.get(i.dataId).id,u=a.makeOutput(i.shape,e||i.dtype),l=a.dataIdMap.get(u.dataId).id;return y.sizeFromShape(u.shape)===0||t(p,we[i.dtype],l),u}return{kernelName:r,backendName:"wasm",setupFunc:o,kernelFunc:n}}var uO=he(fn);var pO=he(hn);var lO=he(gn);function He(r,e,t){let o;function n(a){o=a.wasm.cwrap(r,null,["number","array","number","number","array","number","number","number"])}function s(a){let{backend:i,inputs:p}=a,{a:u,b:l}=p,c=i.dataIdMap.get(u.dataId).id,m=i.dataIdMap.get(l.dataId).id,d=t!=null?t:u.dtype,f=C.assertAndGetBroadcastShape(u.shape,l.shape),h=i.makeOutput(f,d);if(y.sizeFromShape(f)===0)return h;let g=new Uint8Array(new Int32Array(u.shape).buffer),x=new Uint8Array(new Int32Array(l.shape).buffer),b=i.dataIdMap.get(h.dataId).id;return o(c,g,u.shape.length,m,x,l.shape.length,we[u.dtype],b),h}return{kernelName:r,backendName:"wasm",setupFunc:n,kernelFunc:s}}var Koe=!0,cO=He(Rr,Koe);var mO;function qoe(r){mO=r.wasm.cwrap(xn,null,["array","number","number","number"])}function joe(r){let{inputs:e,backend:t}=r,o=t.makeOutput(e[0].shape,e[0].dtype);if(y.sizeFromShape(o.shape)===0)return o;let n=e.map(i=>t.dataIdMap.get(i.dataId).id),s=new Uint8Array(new Int32Array(n).buffer),a=t.dataIdMap.get(o.dataId).id;return mO(s,n.length,we[o.dtype],a),o}var dO={kernelName:xn,backendName:"wasm",setupFunc:qoe,kernelFunc:joe};function Dp(r){let{inputs:{x:e},backend:t}=r;if(e.dtype==="string")return pr(t.readSync(e.dataId),e.shape,e.dtype);let o=t.makeOutput(e.shape,e.dtype),n=t.typedArrayFromHeap(e);return t.typedArrayFromHeap(o).set(n),o}var fO={kernelName:vo,backendName:"wasm",kernelFunc:Dp};var hO;function Xoe(r){hO=r.wasm.cwrap(Kr,null,["number","array","number","number","number","array","number"])}function Vo(r){let{inputs:e,backend:t,attrs:o}=r,[n,s]=Qoe(e.x.shape,o.perm),a=!0;for(let f=0;f=n&&(s===-1||o[s]>o[a])&&(s=a);o[s]=n}return[t,o]}var gO={kernelName:Kr,backendName:"wasm",kernelFunc:Vo,setupFunc:Xoe};function $r(r,e,t){let o=r.shape,n=r.shape.length,s=y.parseAxisParam(e,o),a=s,i=C.getAxesPermutation(a,n),p=null,u=!1;if(i!=null){let l=new Array(n);for(let d=0;d`new shape: ${a}, old shape: ${o.shape}. New shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var OO={kernelName:Ca,backendName:"wasm",kernelFunc:Wt};var MO;function lne(r){MO=r.wasm.cwrap(Nn,null,["number","array","number","number","array","number","number","number","number"])}function cne(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;if(n.dtype!=="float32"||s.dtype!=="float32")throw new Error("BatchMatMul for non non-float32 tensors not yet supported.");let p=n.shape.length,u=s.shape.length,l=a?n.shape[p-2]:n.shape[p-1],c=i?s.shape[u-1]:s.shape[u-2],m=a?n.shape[p-1]:n.shape[p-2],d=i?s.shape[u-2]:s.shape[u-1],f=n.shape.slice(0,-2),h=s.shape.slice(0,-2),g=y.sizeFromShape(f),x=y.sizeFromShape(h),w=kr.assertAndGetBroadcastShape(n.shape.slice(0,-2),s.shape.slice(0,-2)).concat([m,d]);y.assert(l===c,()=>`Error in matMul: inner shapes (${l}) and (${c}) of Tensors with shapes ${n.shape} and ${s.shape} and transposeA=${a} and transposeB=${i} must match.`);let S=a?[g,l,m]:[g,m,l],k=i?[x,d,c]:[x,c,d],T=Wt({inputs:{x:n},backend:t,attrs:{shape:S}}),E=Wt({inputs:{x:s},backend:t,attrs:{shape:k}}),R=t.dataIdMap.get(T.dataId).id,D=t.dataIdMap.get(E.dataId).id,F=a?T.shape[2]:T.shape[1],O=i?E.shape[1]:E.shape[2],M=Math.max(g,x),L=t.makeOutput([M,F,O],T.dtype),B=t.dataIdMap.get(L.dataId).id,z=new Uint8Array(new Int32Array(T.shape).buffer),U=new Uint8Array(new Int32Array(E.shape).buffer);return MO(R,z,T.shape.length,D,U,E.shape.length,a,i,B),t.disposeData(T.dataId),t.disposeData(E.dataId),L.shape=w,L}var LO={kernelName:Nn,backendName:"wasm",setupFunc:lne,kernelFunc:cne};function an(r){let{inputs:{x:e},attrs:{begin:t,size:o},backend:n}=r,[s,a]=nt.parseSliceParams(e,t,o),i=nt.isSliceContinous(e.shape,s,a),p=n.readSync(e.dataId),u=n.makeOutput(a,e.dtype),l=y.computeStrides(e.shape),c=n.dataIdMap.get(u.dataId);if(i){let f=nt.computeFlatOffset(s,l);return e.dtype==="string"?c.stringBytes=p.slice(f,f+y.sizeFromShape(a)):n.typedArrayFromHeap(u).set(p.subarray(f,f+y.sizeFromShape(a))),u}if(e.dtype==="string"){let f=hp(p,s,a,e.shape,e.dtype);return c.stringBytes=f,u}let m=n.typedArrayFromHeap(u),d=e.shape.length;if(d===2)mne(p,l[0],m,s,a);else if(d===3)dne(p,l[0],l[1],m,s,a);else if(d===4)fne(p,l[0],l[1],l[2],m,s,a);else{let f=hp(p,s,a,e.shape,e.dtype);m.set(f)}return u}function mne(r,e,t,o,n){let s=0,a=o[0],i=o[1],p=a+n[0];for(let u=a;ux*b),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=Wt({inputs:{x:n},backend:t,attrs:{shape:p}}),f=Vo({inputs:{x:d},backend:t,attrs:{perm:u}}),h=Wt({inputs:{x:f},backend:t,attrs:{shape:l}}),g=an({inputs:{x:h},backend:t,attrs:{begin:c,size:m}});return t.disposeData(d.dataId),t.disposeData(f.dataId),t.disposeData(h.dataId),g}var zO={kernelName:ia,backendName:"wasm",kernelFunc:hne};var VO;function gne(r){VO=r.wasm.cwrap(Tn,null,["number","number","boolean","number","number","number"])}function xne(r){let{backend:e,inputs:t,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=s.shape.reduce((c,m)=>c*m,1)!==0,p=n.shape.length===1?[a]:[n.shape[0],a],u=e.makeOutput(p,s.dtype);function l(c){return e.dataIdMap.get(c.dataId).id}return VO(l(n),a,i,l(s),we[s.dtype],l(u)),u}var WO={kernelName:Tn,backendName:"wasm",setupFunc:gne,kernelFunc:xne};var yne=!0,UO=He(_n,yne);function bne(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e,s=t.typedArrayFromHeap(o),a=t.typedArrayFromHeap(n),i=C.assertAndGetBroadcastShape(Array.from(s),Array.from(a));return t.makeOutput([i.length],"int32",void 0,new Int32Array(i))}var GO={kernelName:ua,backendName:"wasm",kernelFunc:bne};function Vr(r){let{inputs:{x:e},attrs:{dtype:t},backend:o}=r,n=o.makeOutput(e.shape,t),s=o.typedArrayFromHeap(e);return o.typedArrayFromHeap(n).set(s),n}var HO={kernelName:ho,backendName:"wasm",kernelFunc:Vr};var KO=he(go);var qO;function Cne(r){qO=r.wasm.cwrap(Go,null,["number","number","number","number"])}function wne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{clipValueMin:s,clipValueMax:a}=o,i=t.dataIdMap.get(n.dataId).id,p=t.makeOutput(n.shape,n.dtype),u=t.dataIdMap.get(p.dataId).id;return qO(i,s,a,u),p}var jO={kernelName:Go,backendName:"wasm",setupFunc:Cne,kernelFunc:wne};function j0(r){let{inputs:e,backend:t}=r,o=y.parseAxisParam(r.attrs.axis,e[0].shape)[0],n=e.map(d=>d.shape);C.assertParamsConsistent(n,o);let s=C.computeOutShape(e.map(d=>d.shape),o),a=e.filter(d=>y.sizeFromShape(d.shape)>0);if(a.length===1)return Dp({inputs:{x:a[0]},backend:t});let i=t.makeOutput(s,e[0].dtype);if(y.sizeFromShape(s)===0)return i;if(a[0].dtype==="string"){let d=a.map(w=>{let k=[-1,y.sizeFromShape(w.shape.slice(o))];return Wt({inputs:{x:w},backend:t,attrs:{shape:k}})}),f=d.map(w=>({vals:t.readSync(w.dataId),shape:w.shape}));s=C.computeOutShape(d.map(w=>w.shape),1);let h=d[0].shape[0]===1,g=mp(f,s,e[0].dtype,h),x=C.computeOutShape(a.map(w=>w.shape),o);i.shape=x;let b=t.dataIdMap.get(i.dataId);return b.stringBytes=C.fromStringArrayToUint8(g),d.forEach(w=>t.disposeData(w.dataId)),i}let p=y.sizeFromShape(a[0].shape.slice(0,o)),u=0,l=a.map(d=>{let f=y.sizeFromShape(d.shape.slice(o));return u+=f,f}),c=a.map(d=>t.typedArrayFromHeap(d)),m=t.typedArrayFromHeap(i);for(let d=0;d`cumprod does not support ${n.dtype} tensors in the WASM backend`);let u=C.getAxesPermutation([s],p),l=n;u!==null&&(l=Vo({inputs:{x:n},attrs:{perm:u},backend:t}));let c=C.getInnerMostAxes(1,p)[0];C.assertAxesAreInnerMostDims("cumprod",[c],p);let m=t.makeOutput(l.shape,l.dtype),d=l.shape[c],f=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(m.dataId).id;lM(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=C.getUndoAxesPermutation(u);g=Vo({inputs:{x:m},attrs:{perm:x},backend:t}),t.disposeData(l.dataId),t.disposeData(m.dataId)}return g}var cM={kernelName:Pn,backendName:"wasm",setupFunc:Fne,kernelFunc:Pne};var mM;function One(r){mM=r.wasm.cwrap(On,null,["number","number","number","number","number","number"])}function Mne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o,p=n.shape.length;y.assert(n.dtype==="float32"||n.dtype==="int32",()=>`cumsum does not support ${n.dtype} tensors in the WASM backend`);let u=C.getAxesPermutation([s],p),l=n;u!==null&&(l=Vo({inputs:{x:n},attrs:{perm:u},backend:t}));let c=C.getInnerMostAxes(1,p)[0];C.assertAxesAreInnerMostDims("cumsum",[c],p);let m=t.makeOutput(l.shape,l.dtype),d=l.shape[c],f=t.dataIdMap.get(l.dataId).id,h=t.dataIdMap.get(m.dataId).id;mM(f,a?1:0,i?1:0,d,h,we[n.dtype]);let g=m;if(u!==null){let x=C.getUndoAxesPermutation(u);g=Vo({inputs:{x:m},attrs:{perm:x},backend:t}),t.disposeData(l.dataId),t.disposeData(m.dataId)}return g}var dM={kernelName:On,backendName:"wasm",setupFunc:One,kernelFunc:Mne};var fM;function Lne(r){fM=r.wasm.cwrap("DenseBincount",null,["number","array","number","number","boolean","number","number","boolean","number"])}function Bne(r){let{backend:e,inputs:t,attrs:o}=r,{x:n,weights:s}=t,{size:a,binaryOutput:i}=o,p=s.shape.reduce((m,d)=>m*d,1)!==0,u=n.shape.length===1?[a]:[n.shape[0],a],l=e.makeOutput(u,s.dtype);function c(m){return e.dataIdMap.get(m.dataId).id}return fM(c(n),new Uint8Array(new Int32Array(n.shape).buffer),n.shape.length,a,p,c(s),we[s.dtype],i,c(l)),l}var hM={kernelName:la,backendName:"wasm",setupFunc:Lne,kernelFunc:Bne};var gM;function zne(r){gM=r.wasm.cwrap(Ln,null,["number","number","number","array","number","array","array","number","number"])}function Vne(r){let{backend:e,inputs:t,attrs:o}=r,{x:n}=t,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a==="NHWC"?n.shape[1]:n.shape[2],u=a==="NHWC"?n.shape[2]:n.shape[3],l=a==="NHWC"?n.shape[3]:n.shape[1],c=p*s,m=u*s,d=l/(s*s),f=a==="NHWC"?[i,c,m,d]:[i,d,c,m],h=e.makeOutput(f,"float32"),x=e.dataIdMap.get(n.dataId).id,b=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),w=new Uint8Array(new Int32Array(f).buffer),S=new Uint8Array(new Int32Array(y.computeStrides(f)).buffer),k=e.dataIdMap.get(h.dataId).id;return gM(x,s,a==="NHWC"?1:0,b,n.shape.length-1,w,S,f.length,k),h}var xM={kernelName:Ln,backendName:"wasm",setupFunc:zne,kernelFunc:Vne};var yM;function Wne(r){yM=r.wasm.cwrap(Bn,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Une(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s}=e,a=o.dataIdMap.get(n.dataId).id,i=o.dataIdMap.get(s.dataId).id,{strides:p,dilations:u,pad:l,dimRoundingMode:c}=t,m=u==null?[1,1]:u,d=C.computeConv2DInfo(n.shape,s.shape,p,m,l,c,!0),f=d.filterHeight,h=d.filterWidth,g=d.padInfo.top,x=d.padInfo.right,b=d.padInfo.bottom,w=d.padInfo.left,S=d.dilationHeight,k=d.dilationWidth,T=d.strideHeight,E=d.strideWidth,R=d.inChannels,D=d.outChannels,F=d.padInfo.type==="SAME"?1:0;if(d.dataFormat!=="channelsLast")throw new Error(`wasm backend DepthwiseConv2dNative does not support dataFormat:'${d.dataFormat}'. Please use 'channelsLast'.`);let O=o.makeOutput(d.outShape,"float32"),M=o.dataIdMap.get(O.dataId).id;return yM(a,n.shape[0],n.shape[1],n.shape[2],i,f,h,g,x,b,w,F,S,k,T,E,R,D,M),O}var bM={kernelName:Bn,backendName:"wasm",setupFunc:Wne,kernelFunc:Une};var CM;function Gne(r){CM=r.wasm.cwrap("Diag",null,["number","number","number","number"])}function Hne(r){let{inputs:e,backend:t}=r,{x:o}=e,n=y.sizeFromShape(o.shape),s=t.makeOutput([...o.shape,...o.shape],o.dtype);return CM(t.dataIdMap.get(o.dataId).id,we[o.dtype],n,t.dataIdMap.get(s.dataId).id),s}var wM={kernelName:ca,backendName:"wasm",setupFunc:Gne,kernelFunc:Hne};var SM;function Kne(r){SM=r.wasm.cwrap(zn,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function qne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o;if(n.dtype!==s.dtype)throw new Error(`Dilation2D error: x must have the same dtype as filter. Got ${n.dtype} and ${s.dtype}`);let u=C.computeDilation2DInfo(n.shape,s.shape,a,i,"NHWC",p),l=t.makeOutput(u.outShape,n.dtype);return SM(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(l.dataId).id,we[n.dtype],u.batchSize,u.inChannels,u.inHeight,u.inWidth,u.outHeight,u.outWidth,u.strideHeight,u.strideWidth,u.dilationHeight,u.dilationWidth,u.filterHeight,u.filterWidth,u.padInfo.top,u.padInfo.left),l}var IM={kernelName:zn,backendName:"wasm",setupFunc:Kne,kernelFunc:qne};var vM;function jne(r){vM=r.wasm.cwrap(qi,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Xne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropFilter error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let l=C.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),c=t.makeOutput(s.shape,s.dtype);return vM(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(a.dataId).id,t.dataIdMap.get(c.dataId).id,we[n.dtype],l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.filterHeight,l.filterWidth,l.padInfo.top,l.padInfo.left),c}var kM={kernelName:qi,backendName:"wasm",setupFunc:jne,kernelFunc:Xne};var NM;function Yne(r){NM=r.wasm.cwrap(Ki,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Qne(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o;if(n.dtype!==s.dtype||n.dtype!==a.dtype)throw new Error(`Dilation2DBackpropInput error: x must have the same dtype as filter and dy. Got ${n.dtype}, ${s.dtype}, and ${a.dtype}`);let l=C.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),c=t.makeOutput(n.shape,n.dtype);return NM(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(a.dataId).id,t.dataIdMap.get(c.dataId).id,we[n.dtype],l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.filterHeight,l.filterWidth,l.padInfo.top,l.padInfo.left),c}var TM={kernelName:Ki,backendName:"wasm",setupFunc:Yne,kernelFunc:Qne};var _M=he(Wn);var EM;function Zne(r){EM=r.wasm.cwrap(ri,null,["number","number","number"])}function Jne(r){let{inputs:e,backend:t}=r,{dy:o,y:n}=e,s=t.makeOutput(n.shape,"float32"),a=i=>t.dataIdMap.get(i.dataId).id;return EM(a(n),a(o),a(s)),s}var $M={kernelName:ri,backendName:"wasm",setupFunc:Zne,kernelFunc:Jne};var ese=!1,RM=He(xo,ese,"bool");var DM=he(Un);var AM=he(yo,"float32");function Xg(r){let{inputs:e,attrs:t,backend:o}=r,{input:n}=e,{dim:s}=t,a=n.shape.length,i=n.shape.slice(),p=s;return s<0&&(y.assert(-(a+1)<=s,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+s+1),i.splice(p,0,1),Wt({inputs:{x:n},backend:o,attrs:{shape:i}})}var FM={kernelName:ma,backendName:"wasm",kernelFunc:Xg};var PM=he(bo,"float32");function Y0(r){let{attrs:{shape:e,value:t},backend:o}=r,{attrs:{dtype:n}}=r;n=n||y.inferDtype(t);let s=o.makeOutput(e,n);return o.typedArrayFromHeap(s).fill(t),s}var OM={kernelName:da,backendName:"wasm",kernelFunc:Y0};var MM;function tse(r){MM=r.wasm.cwrap(Gn,null,["number","number","number","number","number","number"])}function rse(r){let{inputs:e,backend:t}=r,{image:o}=e,n=t.makeOutput(o.shape,o.dtype),s=t.dataIdMap.get(o.dataId).id,a=t.dataIdMap.get(n.dataId).id,[i,p,u,l]=o.shape;return MM(s,i,p,u,l,a),n}var LM={kernelName:Gn,backendName:"wasm",kernelFunc:rse,setupFunc:tse};var BM=he(Co);var ose=!1,zM=He(wo,ose);var VM;function nse(r){VM=r.wasm.cwrap(Hn,null,["number","number","number","number","number","number","number"])}function sse(r){let{backend:e,inputs:t,attrs:o}=r,{varianceEpsilon:n}=o,{x:s,mean:a,variance:i,offset:p,scale:u}=t,l=e.dataIdMap.get(s.dataId).id,c=e.dataIdMap.get(a.dataId).id,m=e.dataIdMap.get(i.dataId).id,d=p!=null?e.dataIdMap.get(p.dataId).id:0,f=u!=null?e.dataIdMap.get(u.dataId).id:0,h=e.makeOutput(s.shape,s.dtype);if(y.sizeFromShape(s.shape)===0)return h;let g=e.dataIdMap.get(h.dataId).id;return VM(l,c,m,d,f,n,g),h}var WM={kernelName:Hn,backendName:"wasm",setupFunc:nse,kernelFunc:sse};var UM;function ase(r){UM=r.wasm.cwrap(jo,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 ise(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dataFormat:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=t,h=C.computeConv2DInfo(n.shape,s.shape,p,l,u,m),g=_u[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,w=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==w)throw new Error(`FusedConv2D bias shape (${ee.shape}) does not match the number of output channels (${w})`);S=ee.id}let k=h.filterHeight,T=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,F=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type==="SAME"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(c!=="NHWC")throw new Error(`wasm backend FusedConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,"float32"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return UM(x,j,q,Y,b,k,T,S,E,R,D,F,U,O,M,L,B,z,w,g,ne,f||0,re),J}var GM={kernelName:jo,backendName:"wasm",setupFunc:ase,kernelFunc:ise};var HM;function use(r){HM=r.wasm.cwrap(Xo,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 pse(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dataFormat:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=t,h=C.computeConv2DInfo(n.shape,s.shape,p,l,u,m,!0),g=_u[d];if(g==null)throw new Error(`${d} activation not yet supported for FusedDepthwiseConv2D in the wasm backend.`);let x=o.dataIdMap.get(n.dataId).id,b=o.dataIdMap.get(s.dataId).id,w=h.outChannels,S=0;if(a!=null){let ee=o.dataIdMap.get(a.dataId);if(ee.shape.length!==1)throw new Error(`FusedDepthwiseConv2D only supports rank-1 bias but got rank ${ee.shape.length}.`);if(ee.shape[0]!==w)throw new Error(`FusedDepthwiseConv2D bias shape (${ee.shape}) does not match the number of output channels (${w})`);S=ee.id}let k=h.filterHeight,T=h.filterWidth,E=h.padInfo.top,R=h.padInfo.right,D=h.padInfo.bottom,F=h.padInfo.left,O=h.dilationHeight,M=h.dilationWidth,L=h.strideHeight,B=h.strideWidth,z=h.inChannels,U=h.padInfo.type==="SAME"?1:0,j=h.batchSize,q=h.inHeight,Y=h.inWidth;if(c!=="NHWC")throw new Error(`wasm backend FusedDepthwiseConv2D does not support dataFormat:'${c}'. Please use 'NHWC'.`);let J=o.makeOutput(h.outShape,"float32"),re=o.dataIdMap.get(J.dataId).id,ne=i==null?0:o.dataIdMap.get(i.dataId).id;return HM(x,j,q,Y,b,k,T,S,E,R,D,F,U,O,M,L,B,z,w,g,ne,f||0,re),J}var KM={kernelName:Xo,backendName:"wasm",setupFunc:use,kernelFunc:pse};var qM;function lse(r){qM=r.wasm.cwrap(Kn,null,["number","number","number","number","number","number","array","number"])}function cse(r){let{backend:e,inputs:t}=r,{params:o,indices:n}=t,[s,a,i,p]=xf.prepareAndValidate(o,n),u=e.makeOutput(s,o.dtype);if(a===0)return u;let l=n.shape,c=l[l.length-1],d=e.dataIdMap.get(o.dataId).id,h=e.dataIdMap.get(n.dataId).id,g=new Uint8Array(new Int32Array(p).buffer),x=e.dataIdMap.get(u.dataId).id;return qM(d,we[o.dtype],h,a,c,i,g,x),u}var jM={kernelName:Kn,backendName:"wasm",setupFunc:lse,kernelFunc:cse};var XM;function mse(r){XM=r.wasm.cwrap("Gather",null,["number","number","array","number","number","number","array","number"])}function dse(r){let{backend:e,inputs:t,attrs:o}=r,{x:n,indices:s}=t,{axis:a,batchDims:i}=o,p=y.parseAxisParam(a,n.shape)[0],u=e.readSync(s.dataId),l=n.shape[p];for(let D=0;D=0,()=>`GatherV2: the index value ${F} is not in [0, ${l-1}]`)}let c=C.segment_util.collectGatherOpShapeInfo(n,s,p,i),m=Wt({inputs:{x:n},attrs:{shape:[c.batchSize,c.outerSize,c.dimSize,c.sliceSize]},backend:e}),d=y.sizeFromShape(s.shape),f=Wt({inputs:{x:s},attrs:{shape:[c.batchSize,d/c.batchSize]},backend:e}),h=[c.batchSize,c.outerSize,d/c.batchSize,c.sliceSize],g=e.makeOutput(h,n.dtype);if(y.sizeFromShape(n.shape)===0)return g;let x=m.shape.length-1,w=e.dataIdMap.get(m.dataId).id,k=e.dataIdMap.get(f.dataId).id,T=e.dataIdMap.get(g.dataId).id,E=new Uint8Array(new Int32Array(y.computeStrides(m.shape)).buffer),R=new Uint8Array(new Int32Array(y.computeStrides(h)).buffer);return XM(w,we[n.dtype],E,x,k,c.batchSize,R,T),e.disposeData(m.dataId),e.disposeData(f.dataId),g.shape=c.outputShape,g}var YM={kernelName:fa,backendName:"wasm",setupFunc:mse,kernelFunc:dse};var fse=!1,QM=He(So,fse,"bool");var hse=!1,ZM=He(Io,hse,"bool");var JM=he(qn,"bool");var eL=he(jn,"bool");var tL=he(Xn,"bool");var rL;function gse(r){rL=r.wasm.cwrap(Yn,null,["number","number","number","number"])}function xse(r){let{inputs:{x:e},attrs:{alpha:t},backend:o}=r,n=o.dataIdMap.get(e.dataId).id,s=o.makeOutput(e.shape,"float32");if(y.sizeFromShape(e.shape)!==0){let a=o.dataIdMap.get(s.dataId).id;rL(n,we[e.dtype],t,a)}return s}var oL={kernelName:Yn,backendName:"wasm",setupFunc:gse,kernelFunc:xse};var yse=!1,nL=He(ko,yse,"bool");var bse=!1,sL=He(No,bse,"bool");var aL;function Cse(r){aL=r.wasm.cwrap(Qn,null,["number","number","number","number"])}function wse(r){let{attrs:e,backend:t}=r,{start:o,stop:n,num:s}=e,a=Math.floor(s),i=t.makeOutput([a],"float32");return aL(t.dataIdMap.get(i.dataId).id,o,n,a),i}var iL={kernelName:Qn,backendName:"wasm",setupFunc:Cse,kernelFunc:wse};var uL=he(To);var pL=he(Zn);var Sse=!1,lL=He(Jn,Sse,"bool");var cL=he(es);var Ise=!1,mL=He(ts,Ise,"bool");var vse=!1,dL=He(gk,vse,"bool");var fL;function kse(r){fL=r.wasm.cwrap(rs,null,["number","number","number","number","number","number","number"])}function Nse(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o;if(n.dtype!=="float32")throw new Error("LRN error: x must have dtype float32");let u=t.makeOutput(n.shape,n.dtype);return fL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(u.dataId).id,n.shape[3],s,a,i,p),u}var hL={kernelName:rs,backendName:"wasm",setupFunc:kse,kernelFunc:Nse};var gL;function Tse(r){gL=r.wasm.cwrap(oi,null,["number","number","number","number","number","number","number","number","number"])}function _se(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,y:s,dy:a}=e,{depthRadius:i,bias:p,alpha:u,beta:l}=o;if(n.dtype!=="float32"||s.dtype!=="float32"||a.dtype!=="float32")throw new Error("LRNGrad error: x, y, and dy must have dtype float32");let c=t.makeOutput(n.shape,n.dtype);return gL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(a.dataId).id,t.dataIdMap.get(c.dataId).id,a.shape[3],i,p,u,l),c}var xL={kernelName:oi,backendName:"wasm",setupFunc:Tse,kernelFunc:_se};var yL;function Ese(r){yL=r.wasm.cwrap(os,null,["number","number","number","number"])}function $se(r){let{backend:e,inputs:t,attrs:o}=r,{reductionIndices:n,keepDims:s}=o,{x:a}=t,p=e.dataIdMap.get(a.dataId).id,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e);if(d){let w=e.dataIdMap.get(l.dataId).id;u=l,p=w}let f=u.shape.length;C.assertAxesAreInnerMostDims("max",c,f);let[h,g]=C.computeOutAndReduceShapes(u.shape,c),x=y.sizeFromShape(g),b=e.makeOutput(h,a.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;yL(p,we[a.dtype],x,w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var bL={kernelName:os,backendName:"wasm",setupFunc:Ese,kernelFunc:$se};var Rse=!1,CL=He(_o,Rse);var wL;function Dse(r){wL=r.wasm.cwrap(ns,null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Ase(r){let{inputs:e,attrs:t,backend:o}=r,n=e.x,s=o.dataIdMap.get(n.dataId).id;y.assert(n.dtype==="float32",()=>`Error in MaxPool: only float32 input is supported. Got ${n.dtype}.`);let{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=t,l=C.computePool2DInfo(n.shape,a,i,1,p,u),c=l.filterHeight,m=l.filterWidth,d=l.padInfo.top,f=l.padInfo.right,h=l.padInfo.bottom,g=l.padInfo.left,x=l.dilationHeight,b=l.dilationWidth,w=l.strideHeight,S=l.strideWidth,k=l.inChannels,T=l.outChannels;if(l.dataFormat!=="channelsLast")throw new Error(`wasm backend does not support dataFormat:'${l.dataFormat}'. Please use 'channelsLast'.`);let E=o.makeOutput(l.outShape,"float32"),R=o.dataIdMap.get(E.dataId).id;return wL(s,n.shape[0],n.shape[1],n.shape[2],c,m,d,f,h,g,x,b,w,S,k,T,R),E}var SL={kernelName:ns,backendName:"wasm",setupFunc:Dse,kernelFunc:Ase};var IL;function Fse(r){IL=r.wasm.cwrap("MaxPool3D",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Pse(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p,dataFormat:u}=o,l=C.computePool3DInfo(n.shape,s,a,1,i,p,u),c=t.makeOutput(l.outShape,n.dtype);return IL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,l.batchSize,l.inChannels,l.inDepth,l.inHeight,l.inWidth,l.outDepth,l.outHeight,l.outWidth,l.strideDepth,l.strideHeight,l.strideWidth,l.dilationDepth,l.dilationHeight,l.dilationWidth,l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.front,l.padInfo.top,l.padInfo.left),c}var vL={kernelName:ha,backendName:"wasm",setupFunc:Fse,kernelFunc:Pse};var kL;function Ose(r){kL=r.wasm.cwrap("MaxPool3DGrad",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 Mse(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,l=C.computePool3DInfo(s.shape,a,i,1,p,u),c=t.makeOutput(s.shape,s.dtype);return kL(t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,l.batchSize,l.inChannels,l.inDepth,l.inHeight,l.inWidth,l.outDepth,l.outHeight,l.outWidth,l.strideDepth,l.strideHeight,l.strideWidth,l.dilationDepth,l.dilationHeight,l.dilationWidth,l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.front,l.padInfo.top,l.padInfo.left),c}var NL={kernelName:Ji,backendName:"wasm",setupFunc:Ose,kernelFunc:Mse};var TL;function Lse(r){TL=r.wasm.cwrap("MaxPoolGrad",null,["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Bse(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,{filterSize:a,strides:i,pad:p,dimRoundingMode:u}=o,l=C.computePool2DInfo(s.shape,a,i,1,p,u),c=t.makeOutput(s.shape,s.dtype);return TL(t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.top,l.padInfo.left),c}var _L={kernelName:Zi,backendName:"wasm",setupFunc:Lse,kernelFunc:Bse};var EL;function zse(r){EL=r.wasm.cwrap("MaxPoolWithArgmax",null,["number","number","number","number","boolean","number","number","number","number","number","number","number","number","number","number","number","number","number","number"])}function Vse(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,includeBatchInIndex:p}=o;y.assert(n.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`);let u=[1,1];y.assert(C.eitherStridesOrDilationsAreOne(a,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${a} and dilations '${u}'`);let l=C.computePool2DInfo(n.shape,s,a,[1,1],i),c=t.makeOutput(l.outShape,n.dtype),m=t.makeOutput(l.outShape,"int32");return EL(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(c.dataId).id,t.dataIdMap.get(m.dataId).id,we[n.dtype],p,l.batchSize,l.inChannels,l.inHeight,l.inWidth,l.outHeight,l.outWidth,l.strideHeight,l.strideWidth,l.dilationHeight,l.dilationWidth,l.effectiveFilterHeight,l.effectiveFilterWidth,l.padInfo.top,l.padInfo.left),[c,m]}var $L={kernelName:ga,backendName:"wasm",setupFunc:zse,kernelFunc:Vse};var RL;function Wse(r){RL=r.wasm.cwrap(ss,null,["number, number, number"])}function Use(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e),f=c;if(d){let S=e.dataIdMap.get(l.dataId).id;S!==i&&(u=l,p=S,f=C.getInnerMostAxes(f.length,u.shape.length))}C.assertAxesAreInnerMostDims("mean",f,u.shape.length);let[h,g]=C.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=u;u.dtype!=="float32"&&(b=Vr({backend:e,inputs:{x:u},attrs:{dtype:"float32"}}),p=e.dataIdMap.get(b.dataId).id);let w=e.makeOutput(h,"float32");if(y.sizeFromShape(u.shape)!==0){let S=e.dataIdMap.get(w.dataId).id;RL(p,x,S)}if(d&&e.disposeData(l.dataId),s){let S=C.expandShapeToKeepDim(w.shape,m);w.shape=S}return u.dtype!=="float32"&&e.disposeData(b.dataId),w}var DL={kernelName:ss,backendName:"wasm",setupFunc:Wse,kernelFunc:Use};var AL;function Gse(r){AL=r.wasm.cwrap(as,null,["number","number","number","number"])}function Hse(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e);if(d){let w=e.dataIdMap.get(l.dataId).id;w!==i&&(u=l,p=w)}let f=u.shape.length;C.assertAxesAreInnerMostDims("min",c,f);let[h,g]=C.computeOutAndReduceShapes(u.shape,c),x=y.sizeFromShape(g),b=e.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;AL(p,we[a.dtype],x,w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var FL={kernelName:as,backendName:"wasm",setupFunc:Gse,kernelFunc:Hse};var Kse=!1,PL=He(Eo,Kse);var Q0;(function(r){r[r.reflect=0]="reflect",r[r.symmetric=1]="symmetric"})(Q0||(Q0={}));var OL;function qse(r){OL=r.wasm.cwrap(is,null,["number","array","number","number","array","array","number","number"])}function jse(r){let{inputs:{x:e},backend:t,attrs:{paddings:o,mode:n}}=r,s=o.map((f,h)=>f[0]+e.shape[h]+f[1]),a=t.dataIdMap.get(e.dataId).id,i=t.makeOutput(s,e.dtype),p=t.dataIdMap.get(i.dataId).id,u=new Uint8Array(new Int32Array(e.shape).buffer),l=o.map(f=>f[0]),c=o.map(f=>f[1]),m=new Uint8Array(new Int32Array(l).buffer),d=new Uint8Array(new Int32Array(c).buffer);return OL(a,u,e.shape.length,we[e.dtype],m,d,Q0[n],p),i}var ML={kernelName:is,backendName:"wasm",kernelFunc:jse,setupFunc:qse};var LL;function Xse(r){LL=r.wasm.cwrap(Fs,null,["number","number","number","number"])}function Z0(r){let{backend:e,inputs:{logits:t},attrs:{dim:o}}=r,n=e.dataIdMap.get(t.dataId).id,s=e.makeOutput(t.shape,t.dtype),a=e.dataIdMap.get(s.dataId).id,i=t.shape[o],p=y.sizeFromShape(t.shape)/i;return y.sizeFromShape(s.shape)===0||LL(n,a,i,p),s}var BL={kernelName:Fs,backendName:"wasm",setupFunc:Xse,kernelFunc:Z0};var zL;function Yse(r){zL=r.wasm.cwrap(ps,null,["number","number","number","number","number","number"])}function Qse(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o;if(n.dtype!=="float32")throw new Error(`Tensor logits must have dtype float32, got ${n.dtype}`);let p=i?n:Z0({inputs:{logits:n},backend:t,attrs:{dim:n.shape.length-1}}),[u,l]=p.shape,c=t.makeOutput([u,s],"int32");return zL(t.dataIdMap.get(p.dataId).id,u,l,s,a,t.dataIdMap.get(c.dataId).id),i||t.disposeData(p.dataId),c}var VL={kernelName:ps,backendName:"wasm",setupFunc:Yse,kernelFunc:Qse};var WL=He(us,!0);var Zse=!0,UL=He($o,Zse);var GL=he(ls);function Zl(r,e){let t=new Int32Array(r.wasm.HEAPU8.buffer,e,4),o=t[0],n=t[1],s=t[2],a=t[3];return r.wasm._free(e),{pSelectedIndices:o,selectedSize:n,pSelectedScores:s,pValidOutputs:a}}var HL;function Jse(r){HL=r.wasm.cwrap(cs,"number",["number","number","number","number","number"])}function eae(r){let{backend:e,inputs:t,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a}=o,{boxes:i,scores:p}=t,u=e.dataIdMap.get(i.dataId).id,l=e.dataIdMap.get(p.dataId).id,c=HL(u,l,s,n,a),{pSelectedIndices:m,selectedSize:d,pSelectedScores:f,pValidOutputs:h}=Zl(e,c);return e.wasm._free(f),e.wasm._free(h),e.makeOutput([d],"int32",m)}var KL={kernelName:cs,backendName:"wasm",setupFunc:Jse,kernelFunc:eae};var qL;function tae(r){qL=r.wasm.cwrap(ni,"number",["number","number","number","number","number","bool"])}function rae(r){let{backend:e,inputs:t,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,padToMaxOutputSize:i}=o,{boxes:p,scores:u}=t,l=e.dataIdMap.get(p.dataId).id,c=e.dataIdMap.get(u.dataId).id,m=qL(l,c,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Zl(e,m);e.wasm._free(h);let x=e.makeOutput([f],"int32",d),b=e.makeOutput([],"int32",g);return[x,b]}var jL={kernelName:ni,backendName:"wasm",setupFunc:tae,kernelFunc:rae};var XL;function oae(r){XL=r.wasm.cwrap(ms,"number",["number","number","number","number","number","number"])}function nae(r){let{backend:e,inputs:t,attrs:o}=r,{iouThreshold:n,maxOutputSize:s,scoreThreshold:a,softNmsSigma:i}=o,{boxes:p,scores:u}=t,l=e.dataIdMap.get(p.dataId).id,c=e.dataIdMap.get(u.dataId).id,m=XL(l,c,s,n,a,i),{pSelectedIndices:d,selectedSize:f,pSelectedScores:h,pValidOutputs:g}=Zl(e,m);e.wasm._free(g);let x=e.makeOutput([f],"int32",d),b=e.makeOutput([f],"float32",h);return[x,b]}var YL={kernelName:ms,backendName:"wasm",setupFunc:oae,kernelFunc:nae};var sae=!1,QL=He(Ro,sae,"bool");var ZL;function aae(r){ZL=r.wasm.cwrap(ds,null,["number","number","number","number","number"])}function iae(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n}=e,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=t.makeOutput([...n.shape,a],s),l=t.dataIdMap.get(u.dataId).id,m=t.dataIdMap.get(n.dataId).id;return ZL(m,a,i,p,l),u}var JL={kernelName:ds,backendName:"wasm",setupFunc:aae,kernelFunc:iae};function uae(r){let{inputs:{x:e},backend:t}=r,o=t.makeOutput(e.shape,e.dtype);return t.typedArrayFromHeap(o).fill(1),o}var eB={kernelName:xa,backendName:"wasm",kernelFunc:uae};function pae(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o;if(e.length===1)return Xg({inputs:{input:e[0]},backend:t,attrs:{dim:n}});let s=e[0].shape,a=e[0].dtype;e.forEach(l=>{y.assertShapesMatch(s,l.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===l.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=e.map(l=>{let c=Xg({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=j0({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeData(l.dataId)),u}var tB={kernelName:ya,backendName:"wasm",kernelFunc:pae};var rB;function lae(r){rB=r.wasm.cwrap(fs,null,["number","array","number","number","array","array","number","number"])}function cae(r){let{inputs:{x:e},backend:t,attrs:{paddings:o,constantValue:n}}=r,s=o.map((h,g)=>h[0]+e.shape[g]+h[1]);if(y.sizeFromShape(e.shape)===0)return Y0({backend:t,attrs:{shape:s,value:n,dtype:e.dtype}});let a=t.dataIdMap.get(e.dataId).id,i=t.makeOutput(s,e.dtype),u=t.dataIdMap.get(i.dataId).id,l=new Uint8Array(new Int32Array(e.shape).buffer),c=o.map(h=>h[0]),m=o.map(h=>h[1]),d=new Uint8Array(new Int32Array(c).buffer),f=new Uint8Array(new Int32Array(m).buffer);return rB(a,l,e.shape.length,we[e.dtype],d,f,n,u),i}var Yg={kernelName:fs,backendName:"wasm",kernelFunc:cae,setupFunc:lae};var mae=!1,oB=He(hs,mae);var nB;function dae(r){nB=r.wasm.cwrap(gs,null,["number","number","number"])}function fae(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e,s=t.dataIdMap.get(o.dataId).id,a=t.dataIdMap.get(n.dataId).id,i=s,p=o,u=p;p.dtype!=="float32"&&(u=Vr({backend:t,inputs:{x:o},attrs:{dtype:"float32"}}),i=t.dataIdMap.get(u.dataId).id);let l=t.makeOutput(o.shape,"float32"),c=t.dataIdMap.get(l.dataId).id;return nB(i,a,c),p.dtype!=="float32"&&t.disposeData(u.dataId),l}var sB={kernelName:gs,backendName:"wasm",setupFunc:dae,kernelFunc:fae};var aB;function hae(r){aB=r.wasm.cwrap(Ho,null,["number","number","number","number"])}function gae(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e),f=c;if(d){let w=e.dataIdMap.get(l.dataId).id;w!==i&&(u=l,p=w,f=C.getInnerMostAxes(f.length,u.shape.length))}C.assertAxesAreInnerMostDims("prod",f,u.shape.length);let[h,g]=C.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=e.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;aB(p,x,we[b.dtype],w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var iB={kernelName:Ho,backendName:"wasm",setupFunc:hae,kernelFunc:gae};var xae=r=>{let{backend:e,attrs:t}=r,{start:o,stop:n,step:s,dtype:a}=t,i=fp(o,n,s,a),p=e.makeOutput([i.length],a);return e.typedArrayFromHeap(p).set(i),p},uB={kernelName:ba,backendName:"wasm",kernelFunc:xae};var yae=!0,pB=He(Vn,yae);var lB=he(xs);var cB=he(ys);var mB=he(ws);var dB;function bae(r){dB=r.wasm.cwrap(Cs,null,["number","number","number","number","number","number","number","number","number","number"])}function Cae(r){let{backend:e,inputs:t,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[l,c,m,d]=n.shape,f=[l,p,u,d],h=e.dataIdMap.get(n.dataId),g;h.dtype!=="float32"&&(g=Vr({backend:e,inputs:{x:n},attrs:{dtype:"float32"}}),h=e.dataIdMap.get(g.dataId));let x=h.id,b=e.makeOutput(f,"float32");if(y.sizeFromShape(n.shape)===0)return b;let w=e.dataIdMap.get(b.dataId).id;return dB(x,l,c,m,d,p,u,s?1:0,a?1:0,w),g!=null&&e.disposeData(g.dataId),b}var fB={kernelName:Cs,backendName:"wasm",setupFunc:bae,kernelFunc:Cae};var hB;function wae(r){hB=r.wasm.cwrap(ii,null,["number","number","number","array","array","boolean"])}function Sae(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=t.makeOutput(n.shape,"float32"),p=t.dataIdMap.get(n.dataId),u;return p.dtype!=="float32"&&(u=Vr({backend:t,inputs:{x:n},attrs:{dtype:"float32"}}),p=t.dataIdMap.get(u.dataId)),hB(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&t.disposeData(u.dataId),i}var gB={kernelName:ii,backendName:"wasm",setupFunc:wae,kernelFunc:Sae};var xB;function Iae(r){xB=r.wasm.cwrap(bs,null,["number","number","number","number","number","number","number","number","number","number"])}function vae(r){let{backend:e,inputs:t,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,[l,c,m,d]=n.shape,f=[l,p,u,d],h=e.makeOutput(f,"float32");if(y.sizeFromShape(n.shape)===0)return h;let g=e.dataIdMap.get(n.dataId),x;g.dtype!=="float32"&&(x=Vr({backend:e,inputs:{x:n},attrs:{dtype:"float32"}}),g=e.dataIdMap.get(x.dataId));let b=g.id,w=e.dataIdMap.get(h.dataId).id;return xB(b,l,c,m,d,p,u,s?1:0,a?1:0,w),x!=null&&e.disposeData(x.dataId),h}var yB={kernelName:bs,backendName:"wasm",setupFunc:Iae,kernelFunc:vae};var bB;function kae(r){bB=r.wasm.cwrap(ai,null,["number","number","number","array","array","boolean"])}function Nae(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,i=t.makeOutput(n.shape,"float32"),p=t.dataIdMap.get(n.dataId),u;return p.dtype!=="float32"&&(u=Vr({backend:t,inputs:{x:n},attrs:{dtype:"float32"}}),p=t.dataIdMap.get(u.dataId)),bB(t.dataIdMap.get(n.dataId).id,t.dataIdMap.get(s.dataId).id,t.dataIdMap.get(i.dataId).id,new Uint8Array(new Int32Array(n.shape).buffer),new Uint8Array(new Int32Array(s.shape).buffer),a),u!=null&&t.disposeData(u.dataId),i}var CB={kernelName:ai,backendName:"wasm",setupFunc:kae,kernelFunc:Nae};var wB;function Tae(r){wB=r.wasm.cwrap(Ss,null,["number","array","number","array","number","number"])}function _ae(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o,a=y.parseAxisParam(s,n.shape);if(n.shape.length===0)return Dp({inputs:{x:n},backend:t});let i=t.makeOutput(n.shape,n.dtype),p=t.dataIdMap.get(n.dataId).id,u=t.dataIdMap.get(i.dataId).id,l=new Uint8Array(new Int32Array(a).buffer),c=new Uint8Array(new Int32Array(n.shape).buffer);wB(p,l,a.length,c,n.shape.length,u);let m=Wt({inputs:{x:i},attrs:{shape:n.shape},backend:t});return t.disposeData(i.dataId),m}var SB={kernelName:Ss,backendName:"wasm",kernelFunc:_ae,setupFunc:Tae};var IB;function Eae(r){IB=r.wasm.cwrap(Vs,null,["number","number","number","number","number","number","number","number","array","number","number"])}function $ae(r){let{inputs:e,backend:t,attrs:o}=r,{image:n}=e,{radians:s,fillValue:a,center:i}=o,p=t.makeOutput(n.shape,n.dtype),u=t.dataIdMap.get(n.dataId).id,l=t.dataIdMap.get(p.dataId).id,[c,m,d,f]=n.shape,[h,g]=C.getImageCenter(i,m,d),x=a===0,b=255,w=typeof a=="number"?[a,a,a,x?0:b]:[...a,b],S=new Uint8Array(new Int32Array(w).buffer);return IB(u,c,m,d,f,s,h,g,S,w.length,l),p}var vB={kernelName:Vs,backendName:"wasm",kernelFunc:$ae,setupFunc:Eae};var kB=he(Is);var NB=he(Do);var TB;function Rae(r){TB=r.wasm.cwrap(vs,null,["number","number","number","number","number","number","array","number","number"])}function Dae(r){let{backend:e,inputs:t,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,i=e.makeOutput(a,s.dtype);if(y.sizeFromShape(a)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=Cu.calculateShapes(s,n,a),f=e.dataIdMap.get(n.dataId).id,g=e.dataIdMap.get(s.dataId).id,x=new Uint8Array(new Int32Array(c).buffer),b=e.dataIdMap.get(i.dataId).id;return TB(f,g,we[s.dtype],p,u,l,x,m,b),i}var _B={kernelName:vs,backendName:"wasm",setupFunc:Rae,kernelFunc:Dae};var EB;function Aae(r){EB=r.wasm.cwrap(Ns,null,["number","number","number","number","number","number","bool","number"])}function Fae(r){let{inputs:e,backend:t,attrs:o}=r,{sortedSequence:n,values:s}=e,{side:a}=o;if(n.dtype!==s.dtype)throw new Error(`SearchSorted error: sorted_sequence must have the same dtype as values. Got ${n.dtype} and ${s.dtype}`);let i=t.makeOutput(s.shape,"int32");function p(u){return t.dataIdMap.get(u.dataId).id}return EB(p(n),p(s),n.shape[0],n.shape[1],s.shape[1],we[n.dtype],a==="left",p(i)),i}var $B={kernelName:Ns,backendName:"wasm",setupFunc:Aae,kernelFunc:Fae};var RB;function Pae(r){RB=r.wasm.cwrap("SelectV2",null,["number","number","number","number","number"])}function Oae(r){let{inputs:e,backend:t}=r,{condition:o,t:n,e:s}=e,a=t.dataIdMap.get(o.dataId).id,i=t.dataIdMap.get(n.dataId).id,p=t.dataIdMap.get(s.dataId).id,u=t.makeOutput(n.shape,n.dtype),l=t.dataIdMap.get(u.dataId).id,c=o.shape.length,m=n.shape.length,d=c===0||c>1||m===1?1:y.sizeFromShape(n.shape.slice(1));return RB(a,i,p,d,l),u}var DB={kernelName:wa,backendName:"wasm",kernelFunc:Oae,setupFunc:Pae};var AB=he(Ts);var FB;function Mae(r){FB=r.wasm.cwrap(Ao,null,["number","number"])}function Lae(r){let{backend:e,inputs:{x:t}}=r,o=e.dataIdMap.get(t.dataId).id,n=e.makeOutput(t.shape,t.dtype),s=e.dataIdMap.get(n.dataId).id;return y.sizeFromShape(n.shape)===0||FB(o,s),n}var PB={kernelName:"Sigmoid",backendName:"wasm",setupFunc:Mae,kernelFunc:Lae};var OB=he(Rs);var MB=he(Es);var LB=he($s);var BB=he(Ds);function Bae(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,paddings:a}=o,i=y.sizeFromShape(s),p=[[0,0]];p.push(...a);for(let T=1+s.length;T0?p+1:0;if(c<0)throw new Error(w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let l=n.shape.slice();l[0]=c;let m=e.dataIdMap.get(n.dataId).id,d=e.dataIdMap.get(s.dataId).id,f=e.dataIdMap.get(a.dataId).id,h=e.makeOutput(l,n.dtype),g=e.dataIdMap.get(h.dataId).id,x=e.makeOutput([4],"int32"),b=e.dataIdMap.get(x.dataId).id;eB(m,we[n.dtype],n.shape[0],d,f,g,b,t,0);let C=e.readSync(x.dataId),S;switch(C[0]){case 0:{S=w.getSparseSegmentReductionNegativeSegmentIdsErrorMessage();break}case 1:{S=w.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage();break}case 2:S=w.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(C[1],C[2]);break;case 3:S=w.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(C[1],C[2],C[3]);break;default:S=""}if(e.disposeData(x.dataId),S)throw e.disposeData(h.dataId),new Error(S);return h}function xse(r){return zg(r,!0)}var tB={kernelName:ya,backendName:"wasm",setupFunc:Bg,kernelFunc:xse};function yse(r){return zg(r,!1)}var rB={kernelName:ba,backendName:"wasm",setupFunc:Bg,kernelFunc:yse};var oB;function bse(r){oB=r.wasm.cwrap(vs,null,["number","number","number","number","number","number","number","number","array","number","number"])}function Cse(r){let{backend:t,inputs:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,p=t.makeOutput(i,a.dtype);if(y.sizeFromShape(i)===0)return p;let{sliceRank:u,numUpdates:c,sliceSize:l,strides:m,outputSize:d}=w.calculateShapes(s,n,i),f=t.dataIdMap.get(n.dataId).id,h=t.dataIdMap.get(s.dataId).id,g=t.dataIdMap.get(a.dataId).id,x=new Uint8Array(new Int32Array(m).buffer),b=t.dataIdMap.get(p.dataId).id;return oB(f,h,s.shape.length,g,we[a.dtype],u,c,l,x,d,b),p}var nB={kernelName:vs,backendName:"wasm",setupFunc:bse,kernelFunc:Cse};function wse(r){let{inputs:t,attrs:e,backend:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=e,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),c=n.shape.slice();return p.map(l=>{let m=[...c];m[i]=l;let d=Po({inputs:{x:n},attrs:{begin:u,size:m},backend:o});return u[i]+=l,d})}var sB={kernelName:xa,backendName:"wasm",kernelFunc:wse};var aB=he(ws);var iB=he(Ki);var Sse=!0,uB=Ue(ks,Sse);var pB;function Ise(r){pB=r.wasm.cwrap(wo,null,["number","number","number","number"])}function vse(r){let{backend:t,inputs:e,attrs:o}=r,{alpha:n}=o,{x:s}=e,a=t.dataIdMap.get(s.dataId).id,i=t.makeOutput(s.shape,s.dtype),p=t.dataIdMap.get(i.dataId).id;return pB(a,n,we[s.dtype],p),i}var cB={kernelName:wo,backendName:"wasm",setupFunc:Ise,kernelFunc:vse};var lB;function kse(r){lB=r.wasm.cwrap(Ns,null,["number","array","number","array","array","array","array","array","number","number"])}function Nse(r){let{backend:t,inputs:e,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=zt({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let _=pt.computeOutShape(b,C,S),E=Po({inputs:{x:n},backend:t,attrs:{begin:b,size:_}});k=zt({inputs:{x:E},backend:t,attrs:{shape:f}}),t.disposeData(E.dataId)}else{let _=t.makeOutput(d,"float32"),E=t.dataIdMap.get(n.dataId).id,R=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),D=new Uint8Array(new Int32Array(b).buffer),P=new Uint8Array(new Int32Array(C).buffer),O=new Uint8Array(new Int32Array(S).buffer),M=new Uint8Array(new Int32Array(d).buffer),L=new Uint8Array(new Int32Array(y.computeStrides(d)).buffer),B=t.dataIdMap.get(_.dataId).id;lB(E,R,n.shape.length,D,P,O,M,L,d.length,B),k=zt({inputs:{x:_},backend:t,attrs:{shape:f}}),t.disposeData(_.dataId)}return k}var mB={kernelName:Ns,backendName:"wasm",setupFunc:kse,kernelFunc:Nse};function Tse(r){let{backend:t,inputs:e,attrs:o}=r,{data:n,dataSplits:s}=e,{separator:a,nGramWidths:i,leftPad:p,rightPad:u,padWidth:c,preserveShortSequences:l}=o,m=t.readSync(n.dataId),d=t.readSync(s.dataId),[f,h]=up(m,d,a,i,p,u,c,l),g=t.makeOutput([f.length],"string"),x=t.dataIdMap.get(g.dataId);x.stringBytes=f;let b=t.makeOutput(s.shape,"int32");return t.typedArrayFromHeap(b).set(h),[g,b]}var dB={kernelName:Ca,backendName:"wasm",kernelFunc:Tse};function _se(r){let{backend:t,inputs:e,attrs:o}=r,{input:n,delimiter:s}=e,{skipEmpty:a}=o,i=t.readSync(n.dataId),p=t.readSync(s.dataId),[u,c,l]=pp(i,p[0],a),m=c.length,d=t.makeOutput([m,2],"int32");t.typedArrayFromHeap(d).set(u);let h=t.makeOutput([m],"string"),g=t.dataIdMap.get(h.dataId);g.stringBytes=c;let x=t.makeOutput([2],"int32");return t.typedArrayFromHeap(x).set(l),[d,h,x]}var fB={kernelName:qi,backendName:"wasm",kernelFunc:_se};function $se(r){let{backend:t,inputs:e,attrs:o}=r,{input:n}=e,{numBuckets:s}=o,a=t.readSync(n.dataId),i=cp(a,s),p=t.makeOutput(n.shape,"int32");return t.typedArrayFromHeap(p).set(i),p}var hB={kernelName:ji,backendName:"wasm",kernelFunc:$se};var Ese=!0,gB=Ue(Ts,Ese);var xB;function Rse(r){xB=r.wasm.cwrap(Ss,null,["number","number","number","number"])}function Dse(r){let{backend:t,inputs:e,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=e,i=t.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:c,axes:l,originalAxes:m,inputWasTransposed:d}=Tr(a,n,t),f=l;if(d){let C=t.dataIdMap.get(c.dataId).id;C!==i&&(u=c,p=C,f=w.getInnerMostAxes(f.length,u.shape.length))}w.assertAxesAreInnerMostDims("sum",f,u.shape.length);let[h,g]=w.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=t.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let C=t.dataIdMap.get(b.dataId).id;xB(p,x,we[b.dtype],C)}if(d&&t.disposeData(c.dataId),s){let C=w.expandShapeToKeepDim(b.shape,m);b.shape=C}return b}var yB={kernelName:Ss,backendName:"wasm",setupFunc:Rse,kernelFunc:Dse};var bB=he(_s);var CB=he($s);var wB;function Ase(r){wB=r.wasm.cwrap(ds,null,["number","number","number","number","number","number","array","number","number","number"])}function Fse(r){let{backend:t,inputs:e,attrs:o}=r,{tensor:n,indices:s,updates:a}=e,{}=o,i=t.makeOutput(n.shape,n.dtype);if(y.sizeFromShape(n.shape)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=lu.calculateShapes(a,s,n.shape),f=t.dataIdMap.get(s.dataId).id,g=t.dataIdMap.get(a.dataId).id,b=t.dataIdMap.get(n.dataId).id,C=new Uint8Array(new Int32Array(l).buffer),S=t.dataIdMap.get(i.dataId).id;return wB(f,g,we[a.dtype],p,u,c,C,m,S,b),i}var SB={kernelName:ds,backendName:"wasm",setupFunc:Ase,kernelFunc:Fse};var IB;function Pse(r){IB=r.wasm.cwrap(uo,null,["number","array","number","array","number","number"])}function Ose(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,s=e.dataIdMap.get(n.dataId).id,{reps:a}=o,i=new Array(n.shape.length);for(let m=0;m{let{x:o}=r,{k:n,sorted:s}=e,a=t.dataIdMap.get(o.dataId).id,i=new Uint8Array(new Int32Array(o.shape).buffer),p=o.shape.slice();p[p.length-1]=n;let u=t.makeOutput(p,o.dtype),c=t.dataIdMap.get(u.dataId).id,l=t.makeOutput(p,"int32"),m=t.dataIdMap.get(l.dataId).id;return kB(a,i,o.shape.length,we[o.dtype],n,s,c,m),[u,l]},NB={kernelName:Es,backendName:"wasm",setupFunc:Mse,kernelFunc:Lse};var TB;function Bse(r){TB=r.wasm.cwrap(Rs,null,["number","number","bool","number","number","number","number","number","number","array","number","array","number","number","number","number","number"])}function zse(r){let{backend:t,inputs:e,attrs:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),b=new Uint8Array(new Int32Array(y.computeStrides(g)).buffer),C=t.makeOutput(g,n.dtype),S=t.dataIdMap.get(C.dataId).id,_=t.dataIdMap.get(n.dataId).id,R=t.dataIdMap.get(s.dataId).id,D=a==="nearest"?1:2,P;switch(i){case"constant":P=1;break;case"reflect":P=2;break;case"wrap":P=3;break;case"nearest":P=4;break;default:P=1;break}return TB(_,R,s.shape[0]>1,c,f,h,d,m,l,x,n.shape.length-1,b,g.length-1,D,P,p,S),C}var _B={kernelName:Rs,backendName:"wasm",setupFunc:Bse,kernelFunc:zse};function Vse(r){let{inputs:t,attrs:e,backend:o}=r,{axis:n}=e,{x:s}=t,{outputValues:a,outputShape:i,indices:p}=lp(o.readSync(s.dataId),n,s.shape,s.dtype);return[o.makeOutput(i,s.dtype,void 0,a),o.makeOutput([p.length],"int32",void 0,p)]}var $B={kernelName:Xi,backendName:"wasm",kernelFunc:Vse};function Wse(r){let{inputs:t,backend:e,attrs:o}=r,{value:n}=t,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n.shape[s],i=n.shape.length,p=new Array(i-1),u=0;for(let d=0;d({dataId:d,dtype:f,shape:p}))}var EB={kernelName:wa,backendName:"wasm",kernelFunc:Wse};function Use(r){let{inputs:{x:t},backend:e}=r,o=e.makeOutput(t.shape,t.dtype);return e.typedArrayFromHeap(o).fill(0),o}var RB={kernelName:Sa,backendName:"wasm",kernelFunc:Use};var Gse=[gP,xP,yP,bP,CP,SP,TP,$P,EP,RP,DP,AP,FP,PP,OP,LP,GP,zP,WP,qP,XP,QP,ZP,JP,eO,tO,oO,nO,aO,uO,cO,mO,fO,hO,gO,yO,CO,SO,vO,NO,_O,EO,DO,FO,OO,MO,BO,zO,VO,WO,UO,GO,HO,qO,jO,XO,QO,JO,tM,oM,sM,aM,iM,IP,uM,pM,cM,mM,dM,fM,gM,yM,xM,bM,CM,wM,SM,vM,NM,_M,$M,RM,AM,PM,MM,BM,VM,UM,GM,KM,YM,QM,ZM,JM,tL,oL,sL,aL,uL,pL,cL,Lg,mL,fL,gL,xL,yL,bL,CL,wL,HP,IL,kL,TL,$L,RL,AL,FL,PL,ML,BL,VL,WL,GL,HL,KL,qL,jP,jM,jL,XL,QL,JL,tB,rB,nB,sB,aB,iB,uB,cB,mB,dB,fB,hB,gB,yB,bB,CB,SB,vB,NB,_B,kP,$B,EB,RB];for(let r of Gse)ti(r);var Bv=A();Bv.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>{try{return 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]))}catch(r){return!1}});Bv.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(Bv.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(r){return!1}});var qv=Lp(PB()),VB=Lp(MB()),jv=Lp(LB());var BB=qv.default||qv,Hse=jv.default||jv,im=class extends so{constructor(t){super(),this.wasm=t,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(UB),Kv=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new Bo(this,ur())}write(t,e,o){let n={id:this.dataIdNextNumber++};return this.move(n,t,e,o,1),n}numDataIds(){return this.dataIdMap.numDataIds()}async time(t){let e=y.now();return t(),{kernelMs:y.now()-e}}move(t,e,o,n,s){let a=this.dataIdNextNumber++;if(n==="string"){let c=e;this.dataIdMap.set(t,{id:a,stringBytes:c,shape:o,dtype:n,memoryOffset:null,refCount:s});return}let i=y.sizeFromShape(o),p=i*y.bytesPerElement(n),u=this.wasm._malloc(p)>>>0;this.dataIdMap.set(t,{id:a,memoryOffset:u,shape:o,dtype:n,refCount:s}),this.wasm.tfjs.registerTensor(a,i,u),e!=null&&this.wasm.HEAPU8.set(new Uint8Array(e.buffer,e.byteOffset,p),u)}async read(t){return this.readSync(t)}readSync(t,e,o){let{memoryOffset:n,dtype:s,shape:a,stringBytes:i}=this.dataIdMap.get(t);if(s==="string")return(e==null||e===0)&&(o==null||o>=i.length)?i:i.slice(e,o);e=e||0,o=o||y.sizeFromShape(a);let p=y.bytesPerElement(s),u=this.wasm.HEAPU8.slice(n+e*p,n+o*p);return qse(u.buffer,s)}disposeData(t,e=!1){if(this.dataIdMap.has(t)){let o=this.dataIdMap.get(t);if(o.refCount--,!e&&o.refCount>0)return!1;this.wasm._free(o.memoryOffset),this.wasm.tfjs.disposeData(o.id),this.dataIdMap.delete(t)}return!0}refCount(t){return this.dataIdMap.has(t)?this.dataIdMap.get(t).refCount:0}incRef(t){let e=this.dataIdMap.get(t);e!=null&&e.refCount++}floatPrecision(){return 32}getMemoryOffset(t){return this.dataIdMap.get(t).memoryOffset}dispose(){this.wasm.tfjs.dispose(),"PThread"in this.wasm&&this.wasm.PThread.terminateAllThreads(),this.wasm=null}memory(){return{unreliable:!1}}makeOutput(t,e,o,n){let s;if(o==null)s=this.write(n!=null?n:null,t,e);else{let a=this.dataIdNextNumber++;s={id:a},this.dataIdMap.set(s,{id:a,memoryOffset:o,shape:t,dtype:e,refCount:1});let i=y.sizeFromShape(t);this.wasm.tfjs.registerTensor(a,i,o)}return{dataId:s,shape:t,dtype:e}}typedArrayFromHeap({shape:t,dtype:e,dataId:o}){let n=this.wasm.HEAPU8.buffer,{memoryOffset:s}=this.dataIdMap.get(o),a=y.sizeFromShape(t);switch(e){case"float32":return new Float32Array(n,s,a);case"int32":return new Int32Array(n,s,a);case"bool":return new Uint8Array(n,s,a);default:throw new Error(`Unknown dtype ${e}`)}}};function Kse(r){return(t,e)=>(y.fetch(r,{credentials:"same-origin"}).then(o=>{o.ok||t.env.a(`failed to load wasm binary file at '${r}'`),o.arrayBuffer().then(n=>{WebAssembly.instantiate(n,t).then(s=>{e(s.instance,s.module)})})}),{})}function zB(r,t,e){if(Ug!=null)return Ug;let o="tfjs-backend-wasm.wasm";return r&&t?o="tfjs-backend-wasm-threaded-simd.wasm":r&&(o="tfjs-backend-wasm-simd.wasm"),sm!=null&&sm[o]!=null?sm[o]:e+o}async function WB(){let[r,t]=await Promise.all([A().getAsync("WASM_HAS_SIMD_SUPPORT"),A().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((e,o)=>{let n={};n.locateFile=(i,p)=>{if(i.endsWith(".worker.js")){let u=VB.wasmWorkerContents.replace(/\n/g,"\\n"),c=new Blob([u],{type:"application/javascript"});return URL.createObjectURL(c)}return i.endsWith(".wasm")?zB(r,t,nm!=null?nm:p):p+i},Xv&&(n.instantiateWasm=Kse(zB(r,t,nm!=null?nm:"")));let s=!1;n.onAbort=()=>{if(s||am)return;am=!0,o({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 a;t&&r&&Ug==null?(n.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+BB.toString()],{type:"text/javascript"}),a=BB(n)):a=Hse(n),a.then(i=>{s=!0,am=!1;let p=null;i.tfjs={init:i.cwrap("init",null,[]),initWithThreadsCount:i.cwrap("init_with_threads_count",null,["number"]),getThreadsCount:i.cwrap("get_threads_count","number",[]),registerTensor:i.cwrap("register_tensor",null,["number","number","number"]),disposeData:i.cwrap("dispose_data",p,["number"]),dispose:i.cwrap("dispose",p,[])},e({wasm:i})}).catch(o)})}function qse(r,t){switch(t){case"float32":return new Float32Array(r);case"int32":return new Int32Array(r);case"bool":return new Uint8Array(r);default:throw new Error(`Unknown dtype ${t}`)}}var jse=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],Ug=null,nm=null,sm={},am=!1,Xv=!1;function Xse(r,t=!1){if(Pw("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),am)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");Ug=r,Xv=t}function Yse(r,t=!1){if(am)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof r=="string")nm=r;else{sm=r;let e=jse.filter(o=>sm[o]==null);if(e.length>0)throw new Error(`There were no entries found for the following binaries: ${e.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.`)}Xv=t}var UB=-1,Kv=-1;function Qse(r){UB=r}function Zse(){if(Kv===-1)throw new Error("WASM backend not initialized.");return Kv}var Jse="4.14.0";var eae=2;tu("wasm",async()=>{let{wasm:r}=await WB();return new im(r)},eae);var go=A();go.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE",()=>15);go.registerFlag("WEBGPU_CPU_FORWARD",()=>!0);go.registerFlag("WEBGPU_MATMUL_PROGRAM_TYPE",()=>-1);go.registerFlag("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE",()=>!0);go.registerFlag("WEBGPU_USE_LOW_POWER_GPU",()=>!1);go.registerFlag("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e3);go.registerFlag("WEBGPU_USE_PROFILE_TOOL",()=>!1);go.registerFlag("WEBGPU_IMPORT_EXTERNAL_TEXTURE",()=>!0);go.registerFlag("WEBGPU_USE_NAIVE_CONV2D_DEBUG",()=>!1);go.registerFlag("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL",()=>-1);go.registerFlag("WEBGPU_CONV_SEPARATE_IM2COL_SHADER",()=>!1);go.registerFlag("WEBGPU_PRINT_SHADER",()=>"");go.registerFlag("WEBGPU_ENGINE_COMPILE_ONLY",()=>!1);var Gg=class{constructor(t){t&&(this.vendor=t.vendor,this.architecture=t.architecture,this.intelGPUGeneration=this.getIntelGPUGeneration())}getIntelGPUGeneration(){if(this.isIntel()){if(this.architecture.startsWith("gen"))return Number(this.architecture.match(/\d+/));if(this.architecture.startsWith("xe"))return 12}return 0}isIntel(){return this.vendor==="intel"}};var Hg=class{constructor(t){this.device=t,this.numUsedBuffers=0,this.numFreeBuffers=0,this.freeBuffers=new Map,this.usedBuffers=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireBuffer(t,e,o=!1,n=!0){let s,a=GB(t,e);return n?(this.freeBuffers.has(a)||this.freeBuffers.set(a,[]),this.freeBuffers.get(a).length>0?(s=this.freeBuffers.get(a).pop(),this.numFreeBuffers--):(s=this.device.createBuffer({size:t,usage:e,mappedAtCreation:o}),this.numBytesAllocated+=t)):(s=this.device.createBuffer({size:t,usage:e,mappedAtCreation:o}),this.numBytesAllocated+=t),this.usedBuffers.has(a)||this.usedBuffers.set(a,[]),this.usedBuffers.get(a).push(s),this.numUsedBuffers++,this.numBytesUsed+=t,s}releaseBuffer(t,e=!0){if(this.freeBuffers.size===0)return;let o=t.size,n=t.usage,s=GB(o,n),a=this.usedBuffers.get(s),i=a.indexOf(t);if(i<0)throw new Error("Cannot find the buffer in buffer manager");a[i]=a[a.length-1],a.pop(),this.numUsedBuffers--,this.numBytesUsed-=o,e?(this.freeBuffers.get(s).push(t),this.numFreeBuffers++):(t.destroy(),this.numBytesAllocated-=o)}getNumUsedBuffers(){return this.numUsedBuffers}getNumFreeBuffers(){return this.numFreeBuffers}dispose(){this.freeBuffers.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.usedBuffers.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.freeBuffers=new Map,this.usedBuffers=new Map,this.numUsedBuffers=0,this.numFreeBuffers=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function GB(r,t){return`${r}_${t}`}var Kg=class{constructor(t){this.device=t,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures=new Map,this.usedTextures=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireTexture(t,e,o,n){let s=KB(o),a=t*e*s,i=HB(t,e,o,n);if(this.freeTextures.has(i)||this.freeTextures.set(i,[]),this.usedTextures.has(i)||this.usedTextures.set(i,[]),this.numBytesUsed+=a,this.numUsedTextures++,this.freeTextures.get(i).length>0){this.numFreeTextures--;let u=this.freeTextures.get(i).shift();return this.usedTextures.get(i).push(u),u}this.numBytesAllocated+=a;let p=this.device.createTexture({size:[t,e],format:o,usage:n});return this.usedTextures.get(i).push(p),p}releaseTexture(t){if(this.freeTextures.size===0)return;let e=t.width,o=t.height,n=t.format,s=t.usage,a=HB(e,o,n,s);this.freeTextures.has(a)||this.freeTextures.set(a,[]),this.freeTextures.get(a).push(t),this.numFreeTextures++,this.numUsedTextures--;let i=this.usedTextures.get(a),p=i.indexOf(t);if(p<0)throw new Error("Cannot release a texture that was never provided by this texture manager");i.splice(p,1);let u=KB(n),c=e*o*u;this.numBytesUsed-=c}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){this.freeTextures.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.usedTextures.forEach((t,e)=>{t.forEach(o=>{o.destroy()})}),this.freeTextures=new Map,this.usedTextures=new Map,this.numUsedTextures=0,this.numFreeTextures=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function HB(r,t,e,o){return`${r}_${t}_${e}_${o}`}function KB(r){if(r==="rgba8unorm")return 16;throw new Error(`${r} is not supported!`)}function qB(r,t){if(Math.max(...r)>5)throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");let e=r.length,o="xyzwuv",n=r.map(a=>`${t}.${o[a]}`),s=new Array(e-1);s[e-2]=n[e-1];for(let a=e-3;a>=0;--a)s[a]=`(${s[a+1]} * ${n[a+1]})`;return s}var Yr=(r,t,e)=>e==="int32"?`atomicAdd(${r}, bitcast(${t}));`:` + ${n.shape}`);if(s.shape.length!==1)throw new Error(`Target shape should be a vector but received shape ${s.shape}`);let a=e.dataIdMap.get(o.dataId).id,i=e.dataIdMap.get(n.dataId).id,p=e.dataIdMap.get(s.dataId).id,u=o.shape[0],l=y.sizeFromShape(s.shape),c=e.makeOutput([u,l],o.dtype),m=e.dataIdMap.get(c.dataId).id,d=e.makeOutput([l],s.dtype),f=e.dataIdMap.get(d.dataId).id,h=e.makeOutput([3],"int32"),g=e.dataIdMap.get(h.dataId).id;UB(a,i,p,u,m,f,g);let x=e.readSync(h.dataId),b;switch(x[0]){case 0:{b=C.getSparseReshapeMultipleNegativeOneOutputDimErrorMessage(x[1],x[2]);break}case 1:{b=C.getSparseReshapeNegativeOutputDimErrorMessage(x[1],x[2]);break}case 2:b=C.getSparseReshapeEmptyTensorZeroOutputDimErrorMessage();break;case 3:{let w=Array.from(e.readSync(n.dataId)),S=Array.from(e.readSync(d.dataId));b=C.getSparseReshapeInputOutputMultipleErrorMessage(w,S);break}case 4:{let w=Array.from(e.readSync(n.dataId)),S=Array.from(e.readSync(d.dataId));b=C.getSparseReshapeInputOutputMismatchErrorMessage(w,S);break}default:b=""}if(e.disposeData(h.dataId),b)throw e.disposeData(c.dataId),e.disposeData(d.dataId),new Error(b);return[c,d]}var GB={kernelName:ui,backendName:"wasm",setupFunc:Wae,kernelFunc:Uae};var HB;function Qg(r){HB=r.wasm.cwrap("SparseSegmentReduction",null,["number","number","number","number","number","number","number","number","number"])}function Zg(r,e){let{backend:t,inputs:o}=r,{data:n,indices:s,segmentIds:a}=o,i=s.shape[0],p=t.readSync(a.dataId,i-1,i)[0],l=i>0?p+1:0;if(l<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let c=n.shape.slice();c[0]=l;let m=t.dataIdMap.get(n.dataId).id,d=t.dataIdMap.get(s.dataId).id,f=t.dataIdMap.get(a.dataId).id,h=t.makeOutput(c,n.dtype),g=t.dataIdMap.get(h.dataId).id,x=t.makeOutput([4],"int32"),b=t.dataIdMap.get(x.dataId).id;HB(m,we[n.dtype],n.shape[0],d,f,g,b,e,0);let w=t.readSync(x.dataId),S;switch(w[0]){case 0:{S=C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage();break}case 1:{S=C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage();break}case 2:S=C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(w[1],w[2]);break;case 3:S=C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(w[1],w[2],w[3]);break;default:S=""}if(t.disposeData(x.dataId),S)throw t.disposeData(h.dataId),new Error(S);return h}function Gae(r){return Zg(r,!0)}var KB={kernelName:va,backendName:"wasm",setupFunc:Qg,kernelFunc:Gae};function Hae(r){return Zg(r,!1)}var qB={kernelName:ka,backendName:"wasm",setupFunc:Qg,kernelFunc:Hae};var jB;function Kae(r){jB=r.wasm.cwrap(Ps,null,["number","number","number","number","number","number","number","number","array","number","number"])}function qae(r){let{backend:e,inputs:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,p=e.makeOutput(i,a.dtype);if(y.sizeFromShape(i)===0)return p;let{sliceRank:u,numUpdates:l,sliceSize:c,strides:m,outputSize:d}=C.calculateShapes(s,n,i),f=e.dataIdMap.get(n.dataId).id,h=e.dataIdMap.get(s.dataId).id,g=e.dataIdMap.get(a.dataId).id,x=new Uint8Array(new Int32Array(m).buffer),b=e.dataIdMap.get(p.dataId).id;return jB(f,h,s.shape.length,g,we[a.dtype],u,l,c,x,d,b),p}var XB={kernelName:Ps,backendName:"wasm",setupFunc:Kae,kernelFunc:qae};function jae(r){let{inputs:e,attrs:t,backend:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=t,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=new Array(n.shape.length).fill(0),l=n.shape.slice();return p.map(c=>{let m=[...l];m[i]=c;let d=an({inputs:{x:n},attrs:{begin:u,size:m},backend:o});return u[i]+=c,d})}var YB={kernelName:Ia,backendName:"wasm",kernelFunc:jae};var QB=he(Fo);var ZB=he(tu);var Xae=!0,JB=He(Po,Xae);var ez;function Yae(r){ez=r.wasm.cwrap(Ko,null,["number","number","number","number"])}function Qae(r){let{backend:e,inputs:t,attrs:o}=r,{alpha:n}=o,{x:s}=t,a=e.dataIdMap.get(s.dataId).id,i=e.makeOutput(s.shape,s.dtype),p=e.dataIdMap.get(i.dataId).id;return ez(a,n,we[s.dtype],p),i}var tz={kernelName:Ko,backendName:"wasm",setupFunc:Yae,kernelFunc:Qae};var rz;function Zae(r){rz=r.wasm.cwrap(Os,null,["number","array","number","array","array","array","array","array","number","number"])}function Jae(r){let{backend:e,inputs:t,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=Wt({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let T=nt.computeOutShape(b,w,S),E=an({inputs:{x:n},backend:e,attrs:{begin:b,size:T}});k=Wt({inputs:{x:E},backend:e,attrs:{shape:f}}),e.disposeData(E.dataId)}else{let T=e.makeOutput(d,"float32"),E=e.dataIdMap.get(n.dataId).id,R=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),D=new Uint8Array(new Int32Array(b).buffer),F=new Uint8Array(new Int32Array(w).buffer),O=new Uint8Array(new Int32Array(S).buffer),M=new Uint8Array(new Int32Array(d).buffer),L=new Uint8Array(new Int32Array(y.computeStrides(d)).buffer),B=e.dataIdMap.get(T.dataId).id;rz(E,R,n.shape.length,D,F,O,M,L,d.length,B),k=Wt({inputs:{x:T},backend:e,attrs:{shape:f}}),e.disposeData(T.dataId)}return k}var oz={kernelName:Os,backendName:"wasm",setupFunc:Zae,kernelFunc:Jae};function eie(r){let{backend:e,inputs:t,attrs:o}=r,{data:n,dataSplits:s}=t,{separator:a,nGramWidths:i,leftPad:p,rightPad:u,padWidth:l,preserveShortSequences:c}=o,m=e.readSync(n.dataId),d=e.readSync(s.dataId),[f,h]=gp(m,d,a,i,p,u,l,c),g=e.makeOutput([f.length],"string"),x=e.dataIdMap.get(g.dataId);x.stringBytes=f;let b=e.makeOutput(s.shape,"int32");return e.typedArrayFromHeap(b).set(h),[g,b]}var nz={kernelName:Na,backendName:"wasm",kernelFunc:eie};function tie(r){let{backend:e,inputs:t,attrs:o}=r,{input:n,delimiter:s}=t,{skipEmpty:a}=o,i=e.readSync(n.dataId),p=e.readSync(s.dataId),[u,l,c]=xp(i,p[0],a),m=l.length,d=e.makeOutput([m,2],"int32");e.typedArrayFromHeap(d).set(u);let h=e.makeOutput([m],"string"),g=e.dataIdMap.get(h.dataId);g.stringBytes=l;let x=e.makeOutput([2],"int32");return e.typedArrayFromHeap(x).set(c),[d,h,x]}var sz={kernelName:ru,backendName:"wasm",kernelFunc:tie};function rie(r){let{backend:e,inputs:t,attrs:o}=r,{input:n}=t,{numBuckets:s}=o,a=e.readSync(n.dataId),i=yp(a,s),p=e.makeOutput(n.shape,"int32");return e.typedArrayFromHeap(p).set(i),p}var az={kernelName:ou,backendName:"wasm",kernelFunc:rie};var oie=!0,iz=He(Oo,oie);var uz;function nie(r){uz=r.wasm.cwrap(As,null,["number","number","number","number"])}function sie(r){let{backend:e,inputs:t,attrs:o}=r,{axis:n,keepDims:s}=o,{x:a}=t,i=e.dataIdMap.get(a.dataId).id,p=i,u=a,{transposed:l,axes:c,originalAxes:m,inputWasTransposed:d}=$r(a,n,e),f=c;if(d){let w=e.dataIdMap.get(l.dataId).id;w!==i&&(u=l,p=w,f=C.getInnerMostAxes(f.length,u.shape.length))}C.assertAxesAreInnerMostDims("sum",f,u.shape.length);let[h,g]=C.computeOutAndReduceShapes(u.shape,f),x=y.sizeFromShape(g),b=e.makeOutput(h,u.dtype);if(y.sizeFromShape(u.shape)!==0){let w=e.dataIdMap.get(b.dataId).id;uz(p,x,we[b.dtype],w)}if(d&&e.disposeData(l.dataId),s){let w=C.expandShapeToKeepDim(b.shape,m);b.shape=w}return b}var pz={kernelName:As,backendName:"wasm",setupFunc:nie,kernelFunc:sie};var lz=he(Ms);var cz=he(Ls);var mz;function aie(r){mz=r.wasm.cwrap(ks,null,["number","number","number","number","number","number","array","number","number","number"])}function iie(r){let{backend:e,inputs:t,attrs:o}=r,{tensor:n,indices:s,updates:a}=t,{}=o,i=e.makeOutput(n.shape,n.dtype);if(y.sizeFromShape(n.shape)===0)return i;let{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=Cu.calculateShapes(a,s,n.shape),f=e.dataIdMap.get(s.dataId).id,g=e.dataIdMap.get(a.dataId).id,b=e.dataIdMap.get(n.dataId).id,w=new Uint8Array(new Int32Array(c).buffer),S=e.dataIdMap.get(i.dataId).id;return mz(f,g,we[a.dtype],p,u,l,w,m,S,b),i}var dz={kernelName:ks,backendName:"wasm",setupFunc:aie,kernelFunc:iie};var fz;function uie(r){fz=r.wasm.cwrap(Mo,null,["number","array","number","array","number","number"])}function pie(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,s=t.dataIdMap.get(n.dataId).id,{reps:a}=o,i=new Array(n.shape.length);for(let m=0;m{let{x:o}=r,{k:n,sorted:s}=t,a=e.dataIdMap.get(o.dataId).id,i=new Uint8Array(new Int32Array(o.shape).buffer),p=o.shape.slice();p[p.length-1]=n;let u=e.makeOutput(p,o.dtype),l=e.dataIdMap.get(u.dataId).id,c=e.makeOutput(p,"int32"),m=e.dataIdMap.get(c.dataId).id;return gz(a,i,o.shape.length,we[o.dtype],n,s,l,m),[u,c]},xz={kernelName:Bs,backendName:"wasm",setupFunc:lie,kernelFunc:cie};var yz;function mie(r){yz=r.wasm.cwrap(zs,null,["number","number","bool","number","number","number","number","number","number","array","number","array","number","number","number","number","number"])}function die(r){let{backend:e,inputs:t,attrs:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=new Uint8Array(new Int32Array(y.computeStrides(n.shape)).buffer),b=new Uint8Array(new Int32Array(y.computeStrides(g)).buffer),w=e.makeOutput(g,n.dtype),S=e.dataIdMap.get(w.dataId).id,T=e.dataIdMap.get(n.dataId).id,R=e.dataIdMap.get(s.dataId).id,D=a==="nearest"?1:2,F;switch(i){case"constant":F=1;break;case"reflect":F=2;break;case"wrap":F=3;break;case"nearest":F=4;break;default:F=1;break}return yz(T,R,s.shape[0]>1,l,f,h,d,m,c,x,n.shape.length-1,b,g.length-1,D,F,p,S),w}var bz={kernelName:zs,backendName:"wasm",setupFunc:mie,kernelFunc:die};function fie(r){let{inputs:e,attrs:t,backend:o}=r,{axis:n}=t,{x:s}=e,{outputValues:a,outputShape:i,indices:p}=bp(o.readSync(s.dataId),n,s.shape,s.dtype);return[o.makeOutput(i,s.dtype,void 0,a),o.makeOutput([p.length],"int32",void 0,p)]}var Cz={kernelName:nu,backendName:"wasm",kernelFunc:fie};function hie(r){let{inputs:e,backend:t,attrs:o}=r,{value:n}=e,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n.shape[s],i=n.shape.length,p=new Array(i-1),u=0;for(let d=0;d({dataId:d,dtype:f,shape:p}))}var wz={kernelName:Ta,backendName:"wasm",kernelFunc:hie};function gie(r){let{inputs:{x:e},backend:t}=r,o=t.makeOutput(e.shape,e.dtype);return t.typedArrayFromHeap(o).fill(0),o}var Sz={kernelName:_a,backendName:"wasm",kernelFunc:gie};var xie=[iO,uO,pO,lO,cO,dO,yO,CO,wO,SO,IO,vO,kO,NO,TO,EO,PO,RO,AO,LO,zO,WO,UO,GO,HO,KO,jO,XO,QO,JO,tM,oM,sM,aM,iM,pM,cM,dM,hM,xM,bM,wM,IM,kM,TM,_M,$M,RM,DM,AM,FM,PM,OM,LM,BM,zM,WM,GM,KM,jM,YM,QM,ZM,fO,JM,eL,tL,oL,nL,sL,iL,pL,uL,lL,cL,mL,dL,hL,xL,bL,CL,SL,vL,NL,_L,$L,DL,FL,PL,ML,VL,WL,UL,GL,KL,jL,YL,QL,JL,eB,tB,Yg,oB,sB,iB,uB,pB,lB,cB,mB,OO,fB,gB,yB,CB,SB,vB,kB,NB,_B,$B,DB,AB,PB,OB,MB,LB,BO,BL,BB,zB,WB,GB,KB,qB,XB,YB,QB,ZB,JB,tz,oz,nz,sz,az,iz,pz,lz,cz,dz,hz,xz,bz,gO,Cz,wz,Sz];for(let r of xie)li(r);var J0=A();J0.registerFlag("WASM_HAS_SIMD_SUPPORT",async()=>{try{return 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]))}catch(r){return!1}});J0.registerFlag("WASM_HAS_MULTITHREAD_SUPPORT",async()=>{if(J0.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(r){return!1}});var iv=Kp(Nz()),Dz=Kp(_z()),uv=Kp(Ez());var $z=iv.default||iv,yie=uv.default||uv,gm=class extends mo{constructor(e){super(),this.wasm=e,this.dataIdNextNumber=1,this.wasm.tfjs.initWithThreadsCount(Fz),av=this.wasm.tfjs.getThreadsCount(),this.dataIdMap=new mn(this,cr())}write(e,t,o){let n={id:this.dataIdNextNumber++};return this.move(n,e,t,o,1),n}numDataIds(){return this.dataIdMap.numDataIds()}async time(e){let t=y.now();return e(),{kernelMs:y.now()-t}}move(e,t,o,n,s){let a=this.dataIdNextNumber++;if(n==="string"){let l=t;this.dataIdMap.set(e,{id:a,stringBytes:l,shape:o,dtype:n,memoryOffset:null,refCount:s});return}let i=y.sizeFromShape(o),p=i*y.bytesPerElement(n),u=this.wasm._malloc(p)>>>0;this.dataIdMap.set(e,{id:a,memoryOffset:u,shape:o,dtype:n,refCount:s}),this.wasm.tfjs.registerTensor(a,i,u),t!=null&&this.wasm.HEAPU8.set(new Uint8Array(t.buffer,t.byteOffset,p),u)}async read(e){return this.readSync(e)}readSync(e,t,o){let{memoryOffset:n,dtype:s,shape:a,stringBytes:i}=this.dataIdMap.get(e);if(s==="string")return(t==null||t===0)&&(o==null||o>=i.length)?i:i.slice(t,o);t=t||0,o=o||y.sizeFromShape(a);let p=y.bytesPerElement(s),u=this.wasm.HEAPU8.slice(n+t*p,n+o*p);return Cie(u.buffer,s)}disposeData(e,t=!1){if(this.dataIdMap.has(e)){let o=this.dataIdMap.get(e);if(o.refCount--,!t&&o.refCount>0)return!1;this.wasm._free(o.memoryOffset),this.wasm.tfjs.disposeData(o.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,o,n){let s;if(o==null)s=this.write(n!=null?n:null,e,t);else{let a=this.dataIdNextNumber++;s={id:a},this.dataIdMap.set(s,{id:a,memoryOffset:o,shape:e,dtype:t,refCount:1});let i=y.sizeFromShape(e);this.wasm.tfjs.registerTensor(a,i,o)}return{dataId:s,shape:e,dtype:t}}typedArrayFromHeap({shape:e,dtype:t,dataId:o}){let n=this.wasm.HEAPU8.buffer,{memoryOffset:s}=this.dataIdMap.get(o),a=y.sizeFromShape(e);switch(t){case"float32":return new Float32Array(n,s,a);case"int32":return new Int32Array(n,s,a);case"bool":return new Uint8Array(n,s,a);default:throw new Error(`Unknown dtype ${t}`)}}};function bie(r){return(e,t)=>(y.fetch(r,{credentials:"same-origin"}).then(o=>{o.ok||e.env.a(`failed to load wasm binary file at '${r}'`),o.arrayBuffer().then(n=>{WebAssembly.instantiate(n,e).then(s=>{t(s.instance,s.module)})})}),{})}function Rz(r,e,t){if(tx!=null)return tx;let o="tfjs-backend-wasm.wasm";return r&&e?o="tfjs-backend-wasm-threaded-simd.wasm":r&&(o="tfjs-backend-wasm-simd.wasm"),fm!=null&&fm[o]!=null?fm[o]:t+o}async function Az(){let[r,e]=await Promise.all([A().getAsync("WASM_HAS_SIMD_SUPPORT"),A().getAsync("WASM_HAS_MULTITHREAD_SUPPORT")]);return new Promise((t,o)=>{let n={};n.locateFile=(i,p)=>{if(i.endsWith(".worker.js")){let u=Dz.wasmWorkerContents.replace(/\n/g,"\\n"),l=new Blob([u],{type:"application/javascript"});return URL.createObjectURL(l)}return i.endsWith(".wasm")?Rz(r,e,dm!=null?dm:p):p+i},pv&&(n.instantiateWasm=bie(Rz(r,e,dm!=null?dm:"")));let s=!1;n.onAbort=()=>{if(s||hm)return;hm=!0,o({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 a;e&&r&&tx==null?(n.mainScriptUrlOrBlob=new Blob(["var WasmBackendModuleThreadedSimd = "+$z.toString()],{type:"text/javascript"}),a=$z(n)):a=yie(n),a.then(i=>{s=!0,hm=!1;let p=null;i.tfjs={init:i.cwrap("init",null,[]),initWithThreadsCount:i.cwrap("init_with_threads_count",null,["number"]),getThreadsCount:i.cwrap("get_threads_count","number",[]),registerTensor:i.cwrap("register_tensor",null,["number","number","number"]),disposeData:i.cwrap("dispose_data",p,["number"]),dispose:i.cwrap("dispose",p,[])},t({wasm:i})}).catch(o)})}function Cie(r,e){switch(e){case"float32":return new Float32Array(r);case"int32":return new Int32Array(r);case"bool":return new Uint8Array(r);default:throw new Error(`Unknown dtype ${e}`)}}var wie=["tfjs-backend-wasm.wasm","tfjs-backend-wasm-simd.wasm","tfjs-backend-wasm-threaded-simd.wasm"],tx=null,dm=null,fm={},hm=!1,pv=!1;function Sie(r,e=!1){if(zw("setWasmPath has been deprecated in favor of setWasmPaths and will be removed in a future release."),hm)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPath()` before you call `tf.setBackend()` or `tf.ready()`");tx=r,pv=e}function Iie(r,e=!1){if(hm)throw new Error("The WASM backend was already initialized. Make sure you call `setWasmPaths()` before you call `tf.setBackend()` or `tf.ready()`");if(typeof r=="string")dm=r;else{fm=r;let t=wie.filter(o=>fm[o]==null);if(t.length>0)throw new Error(`There were no entries found for the following binaries: ${t.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.`)}pv=e}var Fz=-1,av=-1;function vie(r){Fz=r}function kie(){if(av===-1)throw new Error("WASM backend not initialized.");return av}var Nie="4.17.0";var Tie=2;pu("wasm",async()=>{let{wasm:r}=await Az();return new gm(r)},Tie);var Wo=A();Wo.registerFlag("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE",()=>15);Wo.registerFlag("WEBGPU_CPU_FORWARD",()=>!0);Wo.registerFlag("WEBGPU_MATMUL_PROGRAM_TYPE",()=>-1);Wo.registerFlag("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE",()=>!0);Wo.registerFlag("WEBGPU_USE_LOW_POWER_GPU",()=>!1);Wo.registerFlag("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e3);Wo.registerFlag("WEBGPU_USE_PROFILE_TOOL",()=>!1);Wo.registerFlag("WEBGPU_IMPORT_EXTERNAL_TEXTURE",()=>!0);Wo.registerFlag("WEBGPU_USE_NAIVE_CONV2D_DEBUG",()=>!1);Wo.registerFlag("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL",()=>-1);Wo.registerFlag("WEBGPU_CONV_SEPARATE_IM2COL_SHADER",()=>!1);Wo.registerFlag("WEBGPU_PRINT_SHADER",()=>"");Wo.registerFlag("WEBGPU_ENGINE_COMPILE_ONLY",()=>!1);var rx=class{constructor(e){e&&(this.vendor=e.vendor,this.architecture=e.architecture,this.intelGPUGeneration=this.getIntelGPUGeneration())}getIntelGPUGeneration(){if(this.isIntel()){if(this.architecture.startsWith("gen"))return Number(this.architecture.match(/\d+/));if(this.architecture.startsWith("xe"))return 12}return 0}isIntel(){return this.vendor==="intel"}};var ox=class{constructor(e){this.device=e,this.numUsedBuffers=0,this.numFreeBuffers=0,this.freeBuffers=new Map,this.usedBuffers=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireBuffer(e,t,o=!1,n=!0){let s,a=Pz(e,t);return n?(this.freeBuffers.has(a)||this.freeBuffers.set(a,[]),this.freeBuffers.get(a).length>0?(s=this.freeBuffers.get(a).pop(),this.numFreeBuffers--):(s=this.device.createBuffer({size:e,usage:t,mappedAtCreation:o}),this.numBytesAllocated+=e)):(s=this.device.createBuffer({size:e,usage:t,mappedAtCreation:o}),this.numBytesAllocated+=e),this.usedBuffers.has(a)||this.usedBuffers.set(a,[]),this.usedBuffers.get(a).push(s),this.numUsedBuffers++,this.numBytesUsed+=e,s}releaseBuffer(e,t=!0){if(this.freeBuffers.size===0)return;let o=e.size,n=e.usage,s=Pz(o,n),a=this.usedBuffers.get(s),i=a.indexOf(e);if(i<0)throw new Error("Cannot find the buffer in buffer manager");a[i]=a[a.length-1],a.pop(),this.numUsedBuffers--,this.numBytesUsed-=o,t?(this.freeBuffers.get(s).push(e),this.numFreeBuffers++):(e.destroy(),this.numBytesAllocated-=o)}getNumUsedBuffers(){return this.numUsedBuffers}getNumFreeBuffers(){return this.numFreeBuffers}dispose(){this.freeBuffers.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.usedBuffers.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.freeBuffers=new Map,this.usedBuffers=new Map,this.numUsedBuffers=0,this.numFreeBuffers=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function Pz(r,e){return`${r}_${e}`}var nx=class{constructor(e){this.device=e,this.numUsedTextures=0,this.numFreeTextures=0,this.freeTextures=new Map,this.usedTextures=new Map,this.numBytesUsed=0,this.numBytesAllocated=0}acquireTexture(e,t,o,n){let s=Mz(o),a=e*t*s,i=Oz(e,t,o,n);if(this.freeTextures.has(i)||this.freeTextures.set(i,[]),this.usedTextures.has(i)||this.usedTextures.set(i,[]),this.numBytesUsed+=a,this.numUsedTextures++,this.freeTextures.get(i).length>0){this.numFreeTextures--;let u=this.freeTextures.get(i).shift();return this.usedTextures.get(i).push(u),u}this.numBytesAllocated+=a;let p=this.device.createTexture({size:[e,t],format:o,usage:n});return this.usedTextures.get(i).push(p),p}releaseTexture(e){if(this.freeTextures.size===0)return;let t=e.width,o=e.height,n=e.format,s=e.usage,a=Oz(t,o,n,s);this.freeTextures.has(a)||this.freeTextures.set(a,[]),this.freeTextures.get(a).push(e),this.numFreeTextures++,this.numUsedTextures--;let i=this.usedTextures.get(a),p=i.indexOf(e);if(p<0)throw new Error("Cannot release a texture that was never provided by this texture manager");i.splice(p,1);let u=Mz(n),l=t*o*u;this.numBytesUsed-=l}getNumUsedTextures(){return this.numUsedTextures}getNumFreeTextures(){return this.numFreeTextures}dispose(){this.freeTextures.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.usedTextures.forEach((e,t)=>{e.forEach(o=>{o.destroy()})}),this.freeTextures=new Map,this.usedTextures=new Map,this.numUsedTextures=0,this.numFreeTextures=0,this.numBytesUsed=0,this.numBytesAllocated=0}};function Oz(r,e,t,o){return`${r}_${e}_${t}_${o}`}function Mz(r){if(r==="rgba8unorm")return 16;throw new Error(`${r} is not supported!`)}function Lz(r,e){if(Math.max(...r)>5)throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");let t=r.length,o="xyzwuv",n=r.map(a=>`${e}.${o[a]}`),s=new Array(t-1);s[t-2]=n[t-1];for(let a=t-3;a>=0;--a)s[a]=`(${s[a+1]} * ${n[a+1]})`;return s}var oo=(r,e,t)=>t==="int32"?`atomicAdd(${r}, bitcast(${e}));`:` { var oldValue = 0; loop { - let newValueF32 = bitcast(oldValue) + (${t}); + let newValueF32 = bitcast(oldValue) + (${e}); let newValue = bitcast(newValueF32); let res = atomicCompareExchangeWeak(${r}, oldValue, newValue); if res.exchanged { @@ -5006,12 +5006,12 @@ return a / b;`,Wee=` } oldValue = res.old_value; } - }`;var Ci;(function(r){r[r.FROM_PIXELS=0]="FROM_PIXELS",r[r.DRAW=1]="DRAW"})(Ci||(Ci={}));var QB=(r,t,e,o,n)=>{let s={dtype:o.dtype,shape:o.shape},a=rae(e,s,t),i=r.createShaderModule({code:a,label:t.constructor.name}),p=A().get("WEBGPU_PRINT_SHADER");if(p!==""){p=p.toLowerCase();let u=p.split(",");(p==="all"||u.some(c=>t.shaderKey.toLowerCase().includes(c)))&&(console.group(t.shaderKey),console.debug(a),console.groupEnd())}return n?r.createComputePipelineAsync({compute:{module:i,entryPoint:"_start"},label:t.constructor.name,layout:"auto"}):r.createComputePipeline({compute:{module:i,entryPoint:"_start"},label:t.constructor.name,layout:"auto"})},Ae=(r,t="f32")=>{switch(r){case 1:return`${t}`;case 2:return`vec2<${t}>`;case 3:return`vec3<${t}>`;case 4:return`vec4<${t}>`;default:throw new Error(`${r}-component ${t} is not supported.`)}};function ft(r){if(r<=1)return"i32";if(r===2)return"vec2";if(r===3)return"vec3";if(r===4)return"vec4";if(r===5)return"vec5";if(r===6)return"vec6";throw Error(`GPU for rank ${r} is not yet supported`)}function Oo(r){if(r===0)return"x";if(r===1)return"y";if(r===2)return"z";if(r===3)return"w";if(r===4)return"u";if(r===5)return"v";throw Error(`Index ${r} is not yet supported`)}function G(...r){let t;switch(r.length){case 0:t=` + }`;var $i;(function(r){r[r.FROM_PIXELS=0]="FROM_PIXELS",r[r.DRAW=1]="DRAW"})($i||($i={}));var Wz=(r,e,t,o,n)=>{let s={dtype:o.dtype,shape:o.shape},a=Eie(t,s,e),i=r.createShaderModule({code:a,label:e.constructor.name}),p=A().get("WEBGPU_PRINT_SHADER");if(p!==""){p=p.toLowerCase();let u=p.split(",");(p==="all"||u.some(l=>e.shaderKey.toLowerCase().includes(l)))&&(console.group(e.shaderKey),console.debug(a),console.groupEnd())}return n?r.createComputePipelineAsync({compute:{module:i,entryPoint:"_start"},label:e.constructor.name,layout:"auto"}):r.createComputePipeline({compute:{module:i,entryPoint:"_start"},label:e.constructor.name,layout:"auto"})},Ae=(r,e="f32")=>{switch(r){case 1:return`${e}`;case 2:return`vec2<${e}>`;case 3:return`vec3<${e}>`;case 4:return`vec4<${e}>`;default:throw new Error(`${r}-component ${e} is not supported.`)}};function ft(r){if(r<=1)return"i32";if(r===2)return"vec2";if(r===3)return"vec3";if(r===4)return"vec4";if(r===5)return"vec5";if(r===6)return"vec6";throw Error(`GPU for rank ${r} is not yet supported`)}function un(r){if(r===0)return"x";if(r===1)return"y";if(r===2)return"z";if(r===3)return"w";if(r===4)return"u";if(r===5)return"v";throw Error(`Index ${r} is not yet supported`)}function G(...r){let e;switch(r.length){case 0:e=` fn main() - `;break;case 1:t=` + `;break;case 1:e=` fn main(${r[0]} : i32) - `;break;default:throw Error("Unreachable")}return t}function jB(r,t){let e;return e=` - ${tae(t)} + `;break;default:throw Error("Unreachable")}return e}function Bz(r,e){let t;return t=` + ${_ie(e)} fn _start(@builtin(local_invocation_id) LocalId : vec3, @builtin(global_invocation_id) GlobalId : vec3, @builtin(local_invocation_index) LocalIndex: u32, @@ -5024,9 +5024,9 @@ return a / b;`,Wee=` workgroupId = WorkgroupId; ${r?"main(getGlobalIndex());":"main();"}; } - `,e}function tae(r){return` + `,t}function _ie(r){return` @compute @workgroup_size(${r.workgroupSize[0]}, ${r.workgroupSize[1]}, ${r.workgroupSize[2]}) -`}function rae(r,t,e){let o=[],n=e.workgroupSize[0]*e.workgroupSize[1]*e.workgroupSize[2];if(e.outputComponent=e.outputComponent?e.outputComponent:1,o.push(` +`}function Eie(r,e,t){let o=[],n=t.workgroupSize[0]*t.workgroupSize[1]*t.workgroupSize[2];if(t.outputComponent=t.outputComponent?t.outputComponent:1,o.push(` var localId: vec3; var localIndex: u32; @@ -5036,12 +5036,12 @@ return a / b;`,Wee=` // Only used when the y/z dimension of workgroup size is 1. fn getGlobalIndex() -> i32 { - ${JB(e)?" return i32(globalId.x);":` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y + + ${Gz(t)?" return i32(globalId.x);":` return i32((workgroupId.z * numWorkgroups.x * numWorkgroups.y + workgroupId.y * numWorkgroups.x + workgroupId.x) * ${n}u + localIndex); `} } - `),e.pixelsOpType!=null){let f=e.pixelsOpType===Ci.FROM_PIXELS?`@group(0) @binding(0) var result: array<${Cu(t.dtype,e.outputComponent)}>;`:`@group(0) @binding(1) var inBuf : array<${Cu(r[0].dtype,e.outputComponent)}>;`,h=t.shape.length===3?"vec2":"i32";o.push(` + `),t.pixelsOpType!=null){let f=t.pixelsOpType===$i.FROM_PIXELS?`@group(0) @binding(0) var result: array<${Eu(e.dtype,t.outputComponent)}>;`:`@group(0) @binding(1) var inBuf : array<${Eu(r[0].dtype,t.outputComponent)}>;`,h=e.shape.length===3?"vec2":"i32";o.push(` struct Uniform { outShapeStrides : ${h}, size : i32, @@ -5051,21 +5051,21 @@ return a / b;`,Wee=` ${f} @group(0) @binding(2) var uniforms: Uniform; - `);let g=YB(e);return[XB,o.join(` -`),um(t.shape),e.getUserCode(),jB(g,e)].join(` -`)}let s,a,i="struct Uniforms { NAN : f32, INFINITY : f32, ";e.variableNames.forEach((f,h)=>{let g=ft(r[h].shape.length);i+=`${f.charAt(0).toLowerCase()+f.slice(1)}Shape : ${g}, `,s=r[h].shape.length-1,a=ft(s),i+=`${f.charAt(0).toLowerCase()+f.slice(1)}ShapeStrides: ${a}, `});let p=ft(t.shape.length);i+=`outShape : ${p}, `,s=t.shape.length-1,a=ft(s),i+=` - outShapeStrides: ${a}, `,e.size&&(i+="size : i32, "),e.uniforms&&(i+=e.uniforms),i+="};",i=cae(i),o.push(i),e.atomic?o.push(` + `);let g=Vz(t);return[zz,o.join(` +`),xm(e.shape),t.getUserCode(),Bz(g,t)].join(` +`)}let s,a,i="struct Uniforms { NAN : f32, INFINITY : f32, ";t.variableNames.forEach((f,h)=>{let g=ft(r[h].shape.length);i+=`${f.charAt(0).toLowerCase()+f.slice(1)}Shape : ${g}, `,s=r[h].shape.length-1,a=ft(s),i+=`${f.charAt(0).toLowerCase()+f.slice(1)}ShapeStrides: ${a}, `});let p=ft(e.shape.length);i+=`outShape : ${p}, `,s=e.shape.length-1,a=ft(s),i+=` + outShapeStrides: ${a}, `,t.size&&(i+="size : i32, "),t.uniforms&&(i+=t.uniforms),i+="};",i=Mie(i),o.push(i),t.atomic?o.push(` @group(0) @binding(0) var result: array>; `):o.push(` - @group(0) @binding(0) var result: array<${Cu(t.dtype,e.outputComponent)}>; - `),e.variableNames.forEach((f,h)=>{o.push(` - @group(0) @binding(${1+h}) var ${f}: array<${e.variableComponents?Cu(r[h].dtype,e.variableComponents[h]):Cu(r[h].dtype,e.outputComponent)}>; + @group(0) @binding(0) var result: array<${Eu(e.dtype,t.outputComponent)}>; + `),t.variableNames.forEach((f,h)=>{o.push(` + @group(0) @binding(${1+h}) var ${f}: array<${t.variableComponents?Eu(r[h].dtype,t.variableComponents[h]):Eu(r[h].dtype,t.outputComponent)}>; `)}),i!==""&&o.push(` - @group(0) @binding(${1+e.variableNames.length}) var uniforms: Uniforms; - `);let u=iae(t.shape,e.dispatchLayout),c=[XB,o.join(` -`)+oae,um(t.shape),u,uae(t.shape.length)];e.atomic||c.push(pae(t.shape,t.dtype,e.outputComponent)),e.variableNames.forEach((f,h)=>{c.push(`${um(r[h].shape,f)}`)});let l=r.map((f,h)=>aae(f,t.shape,e.variableComponents?e.variableComponents[h]:e.outputComponent,e.dispatchLayout.x.length===t.shape.length)).join(` -`);c.push(l),c.push(e.getUserCode());let m=YB(e);return c.push(jB(m,e)),c.join(` -`)}function ZB(r,t,e){let o=r.shaderKey;if(r.pixelsOpType!=null)return o;let n=[],s=[];t.forEach(c=>{n.push(c.shape),s.push(c.dtype)}),n.push(e.shape),s.push(e.dtype);let a=t.map(c=>w.getBroadcastDims(c.shape,e.shape)),i=t.map(c=>y.arraysEqual(c.shape,e.shape)).join("_"),p=a.map(c=>c.join("_")).join(";"),u=JB(r)?"flatDispatch":"";return o+="_"+(r.workgroupSize?r.workgroupSize.join(","):"")+n.map(c=>c.length).join(",")+s.join(",")+r.variableNames.join(",")+p+i+u,o}var XB=` + @group(0) @binding(${1+t.variableNames.length}) var uniforms: Uniforms; + `);let u=Fie(e.shape,t.dispatchLayout),l=[zz,o.join(` +`)+$ie,xm(e.shape),u,Pie(e.shape.length)];t.atomic||l.push(Oie(e.shape,e.dtype,t.outputComponent)),t.variableNames.forEach((f,h)=>{l.push(`${xm(r[h].shape,f)}`)});let c=r.map((f,h)=>Aie(f,e.shape,t.variableComponents?t.variableComponents[h]:t.outputComponent,t.dispatchLayout.x.length===e.shape.length)).join(` +`);l.push(c),l.push(t.getUserCode());let m=Vz(t);return l.push(Bz(m,t)),l.join(` +`)}function Uz(r,e,t){let o=r.shaderKey;if(r.pixelsOpType!=null)return o;let n=[],s=[];e.forEach(l=>{n.push(l.shape),s.push(l.dtype)}),n.push(t.shape),s.push(t.dtype);let a=e.map(l=>C.getBroadcastDims(l.shape,t.shape)),i=e.map(l=>y.arraysEqual(l.shape,t.shape)).join("_"),p=a.map(l=>l.join("_")).join(";"),u=Gz(r)?"flatDispatch":"";return o+="_"+(r.workgroupSize?r.workgroupSize.join(","):"")+n.map(l=>l.length).join(",")+s.join(",")+r.variableNames.join(",")+p+i+u,o}var zz=` struct vec5 {x: i32, y: i32, z: i32, w: i32, u: i32}; struct vec6 {x: i32, y: i32, z: i32, w: i32, u: i32, v: i32}; @@ -5115,80 +5115,80 @@ return a / b;`,Wee=` let floatToUint: vec4 = bitcast>(val); return (floatToUint & vec4(0x7fffffffu)) > vec4(0x7f800000u); } -`,oae=` +`,$ie=` fn isinf(val: f32) -> bool { return abs(val) == uniforms.INFINITY; } -`;function um(r,t=""){let e=r.length,o=t!==""?`get${t.charAt(0).toUpperCase()+t.slice(1)}CoordsFromIndex`:"getCoordsFromIndex",n=t!==""?`${t.charAt(0).toLowerCase()+t.slice(1)}ShapeStrides`:"outShapeStrides";if(e<=1)return`fn ${o}(index : i32) -> i32 { return index; }`;let s=y.computeStrides(r),a=ft(e),i=[];for(let u=0;u vec2 { +`;function xm(r,e=""){let t=r.length,o=e!==""?`get${e.charAt(0).toUpperCase()+e.slice(1)}CoordsFromIndex`:"getCoordsFromIndex",n=e!==""?`${e.charAt(0).toLowerCase()+e.slice(1)}ShapeStrides`:"outShapeStrides";if(t<=1)return`fn ${o}(index : i32) -> i32 { return index; }`;let s=y.computeStrides(r),a=ft(t),i=[];for(let u=0;u vec2 { let d0 = index / uniforms.${n}; let d1 = index - d0 * uniforms.${n}; return vec2(d0, d1); - }`;let p;return p="var index2 = index;"+s.map((u,c)=>{let l=`let ${i[c]} = index2 / uniforms.${n}.${Oo(c)}`,m=c===s.length-1?`let ${i[c+1]} = index2 - ${i[c]} * uniforms.${n}.${Oo(c)}`:`index2 = index2 - ${i[c]} * uniforms.${n}.${Oo(c)}`;return`${l}; ${m};`}).join(""),` + }`;let p;return p="var index2 = index;"+s.map((u,l)=>{let c=`let ${i[l]} = index2 / uniforms.${n}.${un(l)}`,m=l===s.length-1?`let ${i[l+1]} = index2 - ${i[l]} * uniforms.${n}.${un(l)}`:`index2 = index2 - ${i[l]} * uniforms.${n}.${un(l)}`;return`${c}; ${m};`}).join(""),` fn ${o}(index : i32) -> ${a} { ${p} return ${a}(${i.join(",")}); } - `}function nae(r,t){let e=r.name,o=r.shape.length,n=ft(o),s="get"+e.charAt(0).toUpperCase()+e.slice(1),a=["d0","d1","d2","d3","d4","d5"].slice(0,o),i=a.map(c=>`${c} : i32`).join(", ");if(o<1)return` - fn ${s}() -> ${Ae(t)} { - return ${Ae(t)}(${e}[0]); - } - `;let p=`uniforms.${e.charAt(0).toLowerCase()+e.slice(1)}Shape`,u=`${o}D`;return o===0&&(u="1D"),` - fn ${s}(${i}) -> ${Ae(t)} { - return ${Ae(t)}(${e}[getIndexFromCoords${u}(${n}(${a.join(",")}), - ${p})${t===1?"":` / ${t}`}]); + `}function Rie(r,e){let t=r.name,o=r.shape.length,n=ft(o),s="get"+t.charAt(0).toUpperCase()+t.slice(1),a=["d0","d1","d2","d3","d4","d5"].slice(0,o),i=a.map(l=>`${l} : i32`).join(", ");if(o<1)return` + fn ${s}() -> ${Ae(e)} { + return ${Ae(e)}(${t}[0]); + } + `;let p=`uniforms.${t.charAt(0).toLowerCase()+t.slice(1)}Shape`,u=`${o}D`;return o===0&&(u="1D"),` + fn ${s}(${i}) -> ${Ae(e)} { + return ${Ae(e)}(${t}[getIndexFromCoords${u}(${n}(${a.join(",")}), + ${p})${e===1?"":` / ${e}`}]); } - `}function sae(r,t,e,o){let n=r.name,s=n.charAt(0).toUpperCase()+n.slice(1),a="get"+s+"ByOutput",i=r.shape.length,p=t.length,u=ft(p);if(y.arraysEqual(r.shape,t)&&o)return` - fn ${a}Index(globalIndex : i32) -> ${Ae(e)} { - return ${Ae(e)}(${n}[globalIndex]); + `}function Die(r,e,t,o){let n=r.name,s=n.charAt(0).toUpperCase()+n.slice(1),a="get"+s+"ByOutput",i=r.shape.length,p=e.length,u=ft(p);if(y.arraysEqual(r.shape,e)&&o)return` + fn ${a}Index(globalIndex : i32) -> ${Ae(t)} { + return ${Ae(t)}(${n}[globalIndex]); } - fn ${a}Coords(coords : ${u}) -> ${Ae(e)} { - return ${Ae(e)}(${n}[${p>1?"getOutputIndexFromCoords(coords)":"coords"}${e===1?"":` / ${e}`}]); + fn ${a}Coords(coords : ${u}) -> ${Ae(t)} { + return ${Ae(t)}(${n}[${p>1?"getOutputIndexFromCoords(coords)":"coords"}${t===1?"":` / ${t}`}]); } - `;let c=w.getBroadcastDims(r.shape,t),l=p-i,m="";if(i===0)return` - fn ${a}Index(globalIndex : i32) -> ${Ae(e)}{ + `;let l=C.getBroadcastDims(r.shape,e),c=p-i,m="";if(i===0)return` + fn ${a}Index(globalIndex : i32) -> ${Ae(t)}{ return get${s}(); } - fn ${a}Coords(coords : ${u}) -> ${Ae(e)}{ + fn ${a}Coords(coords : ${u}) -> ${Ae(t)}{ return get${s}(); } - `;p<2&&c.length>=1?m="coords = 0;":m=c.map(g=>`coords.${Oo(g+l)} = 0;`).join(` -`);let d="";if(p<2&&i>0)d="coords";else if(p>1){let g=ft(i),x=r.shape.map((b,C)=>`coords.${Oo(C+l)}`).join(", ");d=`${g}(${x})`}else d="coords";let f=`uniforms.${n.charAt(0).toLowerCase()+n.slice(1)}Shape`,h=`${i}D`;return` - fn ${a}Index(globalIndex : i32) -> ${Ae(e)} { + `;p<2&&l.length>=1?m="coords = 0;":m=l.map(g=>`coords.${un(g+c)} = 0;`).join(` +`);let d="";if(p<2&&i>0)d="coords";else if(p>1){let g=ft(i),x=r.shape.map((b,w)=>`coords.${un(w+c)}`).join(", ");d=`${g}(${x})`}else d="coords";let f=`uniforms.${n.charAt(0).toLowerCase()+n.slice(1)}Shape`,h=`${i}D`;return` + fn ${a}Index(globalIndex : i32) -> ${Ae(t)} { var coords = getCoordsFromIndex(globalIndex); ${m} - return ${Ae(e)}(${n}[getIndexFromCoords${h}(${d}, ${f})${e===1?"":` / ${e}`}]); + return ${Ae(t)}(${n}[getIndexFromCoords${h}(${d}, ${f})${t===1?"":` / ${t}`}]); } - fn ${a}Coords(coordsIn : ${u}) -> ${Ae(e)} { + fn ${a}Coords(coordsIn : ${u}) -> ${Ae(t)} { var coords = coordsIn; ${m} - return ${Ae(e)}(${n}[getIndexFromCoords${h}(${d}, ${f})${e===1?"":` / ${e}`}]); + return ${Ae(t)}(${n}[getIndexFromCoords${h}(${d}, ${f})${t===1?"":` / ${t}`}]); } -`}function aae(r,t,e,o){let n=nae(r,e);return r.shape.length<=t.length&&(n+=sae(r,t,e,o)),n}function iae(r,t){let{x:e,y:o=[],z:n=[]}=t,s=r.length,a=e.length+o.length+n.length;if(a!==s)return"";if(e.length===s)return`fn getOutputCoords() -> ${ft(s)}{ +`}function Aie(r,e,t,o){let n=Rie(r,t);return r.shape.length<=e.length&&(n+=Die(r,e,t,o)),n}function Fie(r,e){let{x:t,y:o=[],z:n=[]}=e,s=r.length,a=t.length+o.length+n.length;if(a!==s)return"";if(t.length===s)return`fn getOutputCoords() -> ${ft(s)}{ let globalIndex = getGlobalIndex(); return getCoordsFromIndex(globalIndex); } - `;let i="",p=[e,o,n];for(let m=0;m ${c} { + `;let i="",p=[t,o,n];for(let m=0;m ${l} { ${i} -`;return u.length===0?l+=`return ${c}(0); }`:l+=`return ${c}(${u.join(",")}); }`,l}function uae(r){let t="";switch(r){case 0:case 1:t+=` +`;return u.length===0?c+=`return ${l}(0); }`:c+=`return ${l}(${u.join(",")}); }`,c}function Pie(r){let e="";switch(r){case 0:case 1:e+=` fn getOutputIndexFromCoords(coords : i32) -> i32 { return coords; } - `;break;case 2:t+=` + `;break;case 2:e+=` fn getOutputIndexFromCoords(coords : vec2) -> i32 { return dot(coords, vec2(uniforms.outShapeStrides, 1)); } - `;break;case 3:t+=` + `;break;case 3:e+=` fn getOutputIndexFromCoords(coords : vec3) -> i32 { return dot(coords, vec3(uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, 1)); } - `;break;case 4:t+=` + `;break;case 4:e+=` fn getOutputIndexFromCoords(coords : vec4) -> i32 { return dot(coords, vec4( uniforms.outShapeStrides.x, uniforms.outShapeStrides.y, uniforms.outShapeStrides.z, 1)); } - `;break;case 5:t+=` + `;break;case 5:e+=` fn getOutputIndexFromCoords(coords : vec5) -> i32 { return coords.x * uniforms.outShapeStrides.x + coords.y * uniforms.outShapeStrides.y + @@ -5196,7 +5196,7 @@ return a / b;`,Wee=` coords.w * uniforms.outShapeStrides.w + coords.u; } - `;break;case 6:t+=` + `;break;case 6:e+=` fn getOutputIndexFromCoords(coords : vec6) -> i32 { return coords.x * uniforms.outShapeStrides.x + coords.y * uniforms.outShapeStrides.y + @@ -5205,56 +5205,56 @@ return a / b;`,Wee=` coords.u * uniforms.outShapeStrides.u + coords.v; } - `;break;default:y.assert(!1,()=>`Unsupported ${r}D shape`);break}return t}function JB(r){return r.dispatch[1]===1&&r.dispatch[2]===1}function Cu(r,t=1){if(r==="float32")return Ae(t,"f32");if(r==="int32"||r==="bool")return Ae(t,"i32");throw new Error(`type ${r} is not supported.`)}function pae(r,t,e){let o=r.length,n=Cu(t,e),s=`fn setOutputAtIndex(flatIndex : i32, value : ${Ae(e)}) { + `;break;default:y.assert(!1,()=>`Unsupported ${r}D shape`);break}return e}function Gz(r){return r.dispatch[1]===1&&r.dispatch[2]===1}function Eu(r,e=1){if(r==="float32")return Ae(e,"f32");if(r==="int32"||r==="bool")return Ae(e,"i32");throw new Error(`type ${r} is not supported.`)}function Oie(r,e,t){let o=r.length,n=Eu(e,t),s=`fn setOutputAtIndex(flatIndex : i32, value : ${Ae(t)}) { result[flatIndex] = ${n}(value); } - fn setOutputAtIndexI32(flatIndex : i32, value : ${Ae(e,"i32")}) { + fn setOutputAtIndexI32(flatIndex : i32, value : ${Ae(t,"i32")}) { result[flatIndex] = ${n}(value); } `;if(o>=2){let a=["d0","d1","d2","d3","d4","d5"].slice(0,o),i=ft(o);s+=` - fn setOutputAtCoords(${a.map(p=>`${p} : i32`).join(", ")}, value : ${Ae(e)}) { + fn setOutputAtCoords(${a.map(p=>`${p} : i32`).join(", ")}, value : ${Ae(t)}) { let flatIndex = getOutputIndexFromCoords(${i}(${a.join(", ")})); - setOutputAtIndex(flatIndex${e===1?"":` / ${e}`}, value); + setOutputAtIndex(flatIndex${t===1?"":` / ${t}`}, value); } - fn setOutputAtCoordsI32(${a.map(p=>`${p} : i32`).join(", ")}, value : ${Ae(e,"i32")}) { + fn setOutputAtCoordsI32(${a.map(p=>`${p} : i32`).join(", ")}, value : ${Ae(t,"i32")}) { let flatIndex = getOutputIndexFromCoords(${i}(${a.join(", ")})); - setOutputAtIndexI32(flatIndex${e===1?"":` / ${e}`}, value); + setOutputAtIndexI32(flatIndex${t===1?"":` / ${t}`}, value); } - `}return s}function cae(r){let t=/(\w+)\s*:\s*vec(5|6)/g;r=r.replace(t,o=>"@align(16) "+o);let e=/vec(5|6)\s*,\s*(\w+)/g;return r=r.replace(e,(o,n,s)=>`vec${n}, @align(16) ${s}`),r}function YB(r){return!(r.dispatchLayout.hasOwnProperty("y")&&r.dispatchLayout.y.length!==0||r.dispatchLayout.hasOwnProperty("z")&&r.dispatchLayout.z.length!==0)}var Qv={};qe(Qv,{GPUBytesPerElement:()=>qg,MatMulProgramType:()=>Mo,assertNotComplex:()=>mm,computeDispatch:()=>H,computeWorkPerThreadForConv2d:()=>cm,computeWorkgroupInfoForMatMul:()=>Yv,computeWorkgroupSizeForConv2d:()=>pm,flatDispatchLayout:()=>X,isWebGPUSupported:()=>lm,tilesFitEvenlyIntoShape:()=>mae});var kp=r=>{let t=1;for(let e=0;ee%r[o]===0)}function H(r,t,e=[1,1,1],o=[1,1,1]){let[n,s,a]=[Math.ceil(kp(r.x.map(i=>t[i]))/(e[0]*o[0])),r.y?Math.ceil(kp(r.y.map(i=>t[i]))/(e[1]*o[1])):1,r.z?Math.ceil(kp(r.z.map(i=>t[i]))/(e[2]*o[2])):1];return[n,s,a]}function Yv(r,t,e,o=!1){let n=[8,8,1],s=[4,4,1];return o||(r<=8&&(s[1]=1),t<=16&&e<=16&&(n[0]=4)),{workgroupSize:n,elementsPerThread:s}}function pm(r,t,e=!1){if(e)return[8,8,1];let o=kp(r.x.map(s=>t[s])),n=kp(r.y.map(s=>t[s]));return o<=4?[4,16,1]:n<=4?[16,4,1]:[16,16,1]}function cm(r,t,e=!1){if(e)return[4,4,1];let o=kp(r.x.map(s=>t[s])),n=kp(r.y.map(s=>t[s]));return o<=4?[1,2,1]:n<=4?[2,1,1]:[2,2,1]}function X(r){return{x:r.map((t,e)=>e)}}function qg(r){if(r==="float32"||r==="int32"||r==="bool"||r==="string")return 4;if(r==="complex64")return 8;throw new Error(`Unknown dtype ${r}`)}function lm(){return!!(globalThis&&globalThis.navigator&&globalThis.navigator.gpu)}function mm(r,t){Array.isArray(r)||(r=[r]),r.forEach(e=>{e!=null&&y.assert(e.dtype!=="complex64",()=>`${t} does not support complex64 tensors in the WebGPU backend.`)})}var Mo;(function(r){r[r.MatMulReduceProgram=0]="MatMulReduceProgram",r[r.MatMulSplitKProgram=1]="MatMulSplitKProgram",r[r.MatMulSmallOutputSizeProgram=2]="MatMulSmallOutputSizeProgram",r[r.MatMulPackedProgram=3]="MatMulPackedProgram",r[r.MatMulMax=4]="MatMulMax"})(Mo||(Mo={}));var dae=A().getNumber("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD"),fae=(r,t)=>{let e=r.limits.maxComputeWorkgroupsPerDimension,o=t.dispatchLayout,n=t.dispatch;if(n.every(a=>a<=e))return n;y.assert(n[0]>e&&o.y===void 0&&o.z===void 0,()=>"Dispatch size exceeds WebGPU limits in Y or Z dimension.");let s=Math.ceil(Math.sqrt(n[0]));return s>e?(s=Math.ceil(Math.cbrt(n[0])),y.assert(s<=e,()=>"Total dispatch size exceeds WebGPU maximum."),[s,s,s]):[s,s,1]},Kc=class r extends so{nextDataId(){return r.nextDataId++}constructor(t,e){if(super(),this.commandQueueOwnedIds=new WeakSet,this.dispatchCountInPass=0,this.disposed=!1,this.downloadWaitMs=0,this.tensorDataPendingDisposal=[],this.queryResolveBuffer=null,this.querySet=null,this.querySetCount=2,this.stagingPendingDisposal=[],this.uniformPendingDisposal=[],this.uploadWaitMs=0,this.hasReadSyncWarned=!1,this.hasTimestampQueryWarned=!1,!lm())throw new Error("WebGPU is not supported on this device");this.pipelineCache={},this.device=t,this.queue=t.queue,this.commandEncoder=null,this.computePassEncoder=null,this.adapterInfo=new Gg(e),this.supportTimestampQuery=this.device.features.has("timestamp-query"),this.thresholdToIncreaseWorkgroups=this.adapterInfo.intelGPUGeneration>=12?16:8,this.bufferManager=new Hg(this.device),this.textureManager=new Kg(this.device),this.tensorMap=new Bo(this,ur()),A().getBool("WEBGPU_USE_PROFILE_TOOL")&&(this.dummyCanvas=document.createElement("canvas"),this.dummyCanvas.width=1,this.dummyCanvas.height=1,this.dummyContext=this.dummyCanvas.getContext("webgpu"),this.dummyContext.configure({device:t,format:"bgra8unorm"}),document.body.appendChild(this.dummyCanvas))}floatPrecision(){return 32}disposeData(t,e=!1){if(!this.tensorMap.has(t))return!0;let o=this.tensorMap.get(t);return e?o.refCount=0:o.refCount--,o.refCount>0?!1:(o.complexTensorInfos!=null&&(this.disposeData(o.complexTensorInfos.real.dataId),this.disposeData(o.complexTensorInfos.imag.dataId)),this.commandQueueOwnedIds.has(t)?(this.tensorDataPendingDisposal.push(t),!0):(this.releaseResource(t),this.tensorMap.delete(t),!0))}memory(){return{numBytesInGPU:this.bufferManager.numBytesUsed,numBytesAllocatedInGPU:this.bufferManager.numBytesAllocated,unreliable:!1}}releaseResource(t){let e=this.tensorMap.get(t);if(!(!e||!e.resource)){if(e.external){e.resource=null;return}e.resource instanceof GPUBuffer?this.bufferManager.releaseBuffer(e.resource):e.resource instanceof GPUTexture&&this.textureManager.releaseTexture(e.resource),e.resource=null}}refCount(t){return this.tensorMap.has(t)?this.tensorMap.get(t).refCount:0}incRef(t){let e=this.tensorMap.get(t);e.refCount++}decRef(t){if(this.tensorMap.has(t)){let e=this.tensorMap.get(t);e.refCount--}}write(t,e,o){if(o==="complex64"&&t!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let n={id:this.nextDataId()};return this.tensorMap.set(n,{dtype:o,shape:e,values:t,refCount:1}),n}move(t,e,o,n,s){if(n==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.tensorMap.set(t,{dtype:n,shape:o,values:e,refCount:s})}submitQueue(){this.queue.submit([this.commandEncoder.finish()]),this.commandEncoder=null,this.dispatchCountInPass=0,this.commandQueueOwnedIds=new WeakSet,this.tensorDataPendingDisposal.forEach(t=>{this.releaseResource(t),this.tensorMap.delete(t)}),this.uniformPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t)),this.stagingPendingDisposal.forEach(t=>this.bufferManager.releaseBuffer(t,!1)),this.tensorDataPendingDisposal=[],this.uniformPendingDisposal=[],this.stagingPendingDisposal=[]}ensureCommandEncoderReady(){this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder())}endComputePassEncoder(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}async checkCompileCompletionAsync(){let t;try{t=await Promise.all(Object.values(this.pipelineCache))}catch(e){throw new Error(e.message)}Object.keys(this.pipelineCache).map((e,o)=>{this.pipelineCache[e]=t[o]})}async getBufferData(t){if(A().getBool("WEBGPU_ENGINE_COMPILE_ONLY"))return console.warn("The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false"),null;let e=t.size,o=this.bufferManager.acquireBuffer(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,o,0,e),this.submitQueue(),await o.mapAsync(GPUMapMode.READ);let n=o.getMappedRange().slice(0);return o.unmap(),o!=null&&this.bufferManager.releaseBuffer(o),A().getBool("WEBGPU_USE_PROFILE_TOOL")&&(y.assert(this.dummyContext!==void 0,()=>"Fail to get context for profiling tool"),this.dummyContext.getCurrentTexture()),n}convertAndCacheOnCPU(t,e){let o=this.tensorMap.get(t);return o.values=e,o.values}readSync(t){let e=this.tensorMap.get(t),{values:o,complexTensorInfos:n}=e;if(o!=null||e.dtype==="string")return o;if(e.dtype==="complex64"){let h=this.readSync(n.real.dataId),g=this.readSync(n.imag.dataId),x=y.convertBackendValuesAndArrayBuffer(w.mergeRealAndImagArrays(h,g).buffer,"float32");return this.convertAndCacheOnCPU(t,x),x}this.hasReadSyncWarned||(this.hasReadSyncWarned=!0,console.warn("The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead."));let s=["opaque","premultiplied"],a=e.resource,i=a.size;y.assert(i%4===0,()=>"Because there is 4 bytes for one pixel, buffer size must be multiple of 4.");let p=i/4,u=new ArrayBuffer(i),c=256,l=256,m=s.map(h=>new OffscreenCanvas(c,l)),d=new OffscreenCanvas(c,l);this.endComputePassEncoder(),m.map((h,g)=>{let x=h.getContext("webgpu");return x.configure({device:this.device,format:"bgra8unorm",usage:GPUTextureUsage.COPY_DST,alphaMode:s[g]}),x.getCurrentTexture()}).map((h,g)=>{let x=c*4,b=(R,D,P)=>{this.ensureCommandEncoderReady(),this.commandEncoder.copyBufferToTexture({buffer:a,bytesPerRow:x,offset:P},{texture:h},{width:R,height:D}),this.submitQueue();let O=d.getContext("2d",{willReadFrequently:!0});O.clearRect(0,0,R,D),O.drawImage(m[g],0,0);let M=O.getImageData(0,0,R,D).data,L=s[g],B=new Uint8ClampedArray(u,P,R*D*4);for(let z=0;z0&&(b(S,k,_),_+=k*(c*4)),S=E%c,S>0&&b(S,1,_)});let f=y.convertBackendValuesAndArrayBuffer(u,e.dtype);return this.convertAndCacheOnCPU(t,f),f}async read(t){if(!this.tensorMap.has(t))throw new Error(`Tensor ${t} was not registered!`);let e=this.tensorMap.get(t),{values:o}=e;if(o!=null)return o;let n;if(e.dtype==="complex64"){let s=await Promise.all([this.read(e.complexTensorInfos.real.dataId),this.read(e.complexTensorInfos.imag.dataId)]),a=s[0],i=s[1];n=w.mergeRealAndImagArrays(a,i)}else{let s=await this.getBufferData(e.resource);n=y.convertBackendValuesAndArrayBuffer(s,e.dtype)}return this.convertAndCacheOnCPU(t,n),n}copyBuffer(t){let e=t.size,o=t.usage,n=this.bufferManager.acquireBuffer(e,o);return this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(t,0,n,0,e),this.submitQueue(),n}createTensorFromGPUData(t,e,o){let n=t.buffer;if(o==="complex64")throw new Error("Cannot write to a complex64 dtype. ");let s={id:this.nextDataId()};this.tensorMap.set(s,{dtype:o,shape:e,values:null,refCount:1,external:t.zeroCopy});let a=this.tensorMap.get(s),i=qg(a.dtype)*y.sizeFromShape(a.shape);if(t.buffer.sizey.decodeString(n));return me(t.shape,t.dtype,o)}catch(o){throw new Error("Failed to decode encoded string bytes into utf-8")}return me(t.shape,t.dtype,e)}async time(t){!this.supportTimestampQuery&&!this.hasTimestampQueryWarned&&(console.warn("This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled."),this.hasTimestampQueryWarned=!0);let e=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,t();let s=y.flatten(this.activeTimers.map(u=>u.query)).filter(u=>u!=null),a=y.flatten(this.activeTimers.map(u=>u.name)).filter(u=>u!=null);this.activeTimers=e,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},p=await Promise.all(s);return i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,c)=>({name:a[c],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(", "),this.uploadWaitMs=0,this.downloadWaitMs=0,i}makeTensorInfo(t,e,o){return e==="string"&&o!=null&&o.length>0&&y.isString(o[0])&&(o=o.map(s=>y.encodeString(s))),{dataId:this.write(o,t,e),shape:t,dtype:e}}tensorToBinding(t){if(!t)return null;let o=this.tensorMap.get(t.dataId).resource;return o instanceof GPUBuffer?{buffer:o}:o instanceof GPUTexture?o.createView():o}uploadToGPU(t){let e=this.tensorMap.get(t);if(e.resource!=null)return;let o=qg(e.dtype)*y.sizeFromShape(e.shape),n,s=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;if(e.values){if(n=this.bufferManager.acquireBuffer(o,s,!0),n.mapState==="unmapped"){let a=this.bufferManager.acquireBuffer(o,GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC,!0,!1),i=a.getMappedRange();e.dtype==="int32"||e.dtype==="bool"?new Int32Array(i).set(e.values):new Float32Array(i).set(e.values),a.unmap(),this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(a,0,n,0,o),this.stagingPendingDisposal.push(a)}else{let a=n.getMappedRange();e.dtype==="int32"||e.dtype==="bool"?new Int32Array(a).set(e.values):new Float32Array(a).set(e.values),n.unmap()}e.values=null}else n=this.bufferManager.acquireBuffer(o,s);e.resource=n}makeUniforms(t){let e=0,o=0,n=[],s=1;t.forEach(p=>{p.data.length===0&&(p.data=[1]);let u;switch(p.data.length){case 1:u=4;break;case 2:u=8;break;case 3:u=16;break;case 4:u=16;break;case 5:u=16;break;case 6:u=16;break;default:y.assert(!1,()=>`Unsupported ${p.data.length}D shape`)}(o===5||o===6)&&(u=16),u>s&&(s=u),e=Math.ceil(e/u)*u,o=p.data.length,n.push(e),e+=p.data.length*4}),e=Math.ceil(e/s)*s;let a=new ArrayBuffer(e);t.forEach((p,u)=>{let c=n[u];p.type==="int32"?new Int32Array(a,c,p.data.length).set(p.data):p.type==="uint32"?new Uint32Array(a,c,p.data.length).set(p.data):new Float32Array(a,c,p.data.length).set(p.data)});let i=this.bufferManager.acquireBuffer(e,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);return this.queue.writeBuffer(i,0,a,0,e),this.uniformPendingDisposal.push(i),{offset:0,size:e,buffer:i}}runWebGPUProgram(t,e,o,n,s){if(s||(s=this.makeTensorInfo(t.outputShape,o)),y.sizeFromShape(s.shape)===0)return this.tensorMap.get(s.dataId).values=y.getTypedArrayFromDType(s.dtype,0),s;this.uploadToGPU(s.dataId),t.dispatch=fae(this.device,t);let a=e.map((p,u)=>{if(p.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");return this.uploadToGPU(p.dataId),{dtype:this.tensorMap.get(p.dataId).dtype,shape:p.shape,name:t.variableNames[u]}});t.shaderKey=ZB(t,a,s);let i=A().getBool("WEBGPU_ENGINE_COMPILE_ONLY");return t.shaderKey in this.pipelineCache||(this.pipelineCache[t.shaderKey]=QB(this.device,t,a,s,i)),t.pipeline=this.pipelineCache[t.shaderKey],i||this.recordAndSubmit(t,s,e,n),s}recordAndSubmit(t,e,o,n){if(t.pipeline instanceof Promise)throw new Error("Please call checkCompileCompletionAsync to ensure parallel compilation is done!");let s=[],a=[],i="int32";if(t.pixelsOpType==null){s.push({type:"float32",data:[NaN]},{type:"float32",data:[1/0]}),a=o.concat(e).map(d=>d.shape);let m="int32";a.map(d=>{s.push({type:m,data:d});let f=y.computeStrides(d);s.push({type:m,data:f})})}else{let m=y.computeStrides(e.shape);s.push({type:i,data:m})}if(t.size){let m=y.sizeFromShape(t.outputShape);s.push({type:i,data:[t.outputComponent?m/t.outputComponent:m]})}n&&(s=[...s,...n]);let p=[this.tensorToBinding(e),...o.map(m=>this.tensorToBinding(m)),this.makeUniforms(s)];o.forEach(m=>{this.commandQueueOwnedIds.add(m.dataId)}),this.commandQueueOwnedIds.add(e.dataId);let u=this.device.createBindGroup({layout:t.pipeline.getBindGroupLayout(0),entries:p.map((m,d)=>({binding:d,resource:m}))}),c=this.activeTimers!=null;this.ensureCommandEncoderReady();let l={};c&&this.supportTimestampQuery?(this.endComputePassEncoder(),this.querySet==null&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.querySetCount})),l.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1},this.computePassEncoder=this.commandEncoder.beginComputePass(l)):this.computePassEncoder||(this.computePassEncoder=this.commandEncoder.beginComputePass(l)),this.computePassEncoder.setPipeline(t.pipeline),this.computePassEncoder.setBindGroup(0,u),this.computePassEncoder.dispatchWorkgroups(t.dispatch[0],t.dispatch[1],t.dispatch[2]),this.dispatchCountInPass++,(c||A().get("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE")<=this.dispatchCountInPass||t.pixelsOpType===Ci.DRAW)&&(this.endComputePassEncoder(),c?this.activeTimers.push({name:t.constructor.name,query:this.getQueryTime()}):this.submitQueue())}async getQueryTime(){if(!this.supportTimestampQuery)return 0;this.queryResolveBuffer==null&&(this.queryResolveBuffer=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST|GPUBufferUsage.QUERY_RESOLVE)),this.commandEncoder.resolveQuerySet(this.querySet,0,this.querySetCount,this.queryResolveBuffer,0);let t=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,t,0,this.querySetCount*8),this.submitQueue(),await t.mapAsync(GPUMapMode.READ);let e=new BigUint64Array(t.getMappedRange()),o=Number(e[1]-e[0])/1e6;return t.unmap(),this.bufferManager.releaseBuffer(t),o}shouldExecuteOnCPU(t,e=dae){return A().getBool("WEBGPU_CPU_FORWARD")&&t.every(o=>this.tensorMap.get(o.dataId).resource==null&&y.sizeFromShape(o.shape){let r={powerPreference:A().get("WEBGPU_USE_LOW_POWER_GPU")?"low-power":"high-performance"},t=await navigator.gpu.requestAdapter(r),e={},o=[];t.features.has("timestamp-query")&&o.push("timestamp-query"),t.features.has("bgra8unorm-storage")&&o.push(["bgra8unorm-storage"]),e.requiredFeatures=o;let n=t.limits;e.requiredLimits={maxComputeWorkgroupStorageSize:n.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:n.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:n.maxStorageBufferBindingSize,maxBufferSize:n.maxBufferSize,maxComputeWorkgroupSizeX:n.maxComputeWorkgroupSizeX,maxComputeInvocationsPerWorkgroup:n.maxComputeInvocationsPerWorkgroup};let s=await t.requestDevice(e),a=await t.requestAdapterInfo();return new Kc(s,a)},3);var fe;(function(r){r[r.ADD=0]="ADD",r[r.ATAN2=1]="ATAN2",r[r.COMPLEX_MULTIPLY_IMAG=2]="COMPLEX_MULTIPLY_IMAG",r[r.COMPLEX_MULTIPLY_REAL=3]="COMPLEX_MULTIPLY_REAL",r[r.DIV=4]="DIV",r[r.ELU_DER=5]="ELU_DER",r[r.EQUAL=6]="EQUAL",r[r.FLOOR_DIV=7]="FLOOR_DIV",r[r.GREATER=8]="GREATER",r[r.GREATER_EQUAL=9]="GREATER_EQUAL",r[r.LESS=10]="LESS",r[r.LESS_EQUAL=11]="LESS_EQUAL",r[r.LOGICAL_AND=12]="LOGICAL_AND",r[r.LOGICAL_OR=13]="LOGICAL_OR",r[r.MAX=14]="MAX",r[r.MIN=15]="MIN",r[r.MOD=16]="MOD",r[r.MUL=17]="MUL",r[r.NOT_EQUAL=18]="NOT_EQUAL",r[r.POW=19]="POW",r[r.PRELU=20]="PRELU",r[r.SQUARED_DIFFERENCE=21]="SQUARED_DIFFERENCE",r[r.SUB=22]="SUB"})(fe||(fe={}));var hae="let resultTemp = a + b;",gae="let resultTemp = atan2(a, b);",xae="let resultTemp = areal * breal - aimag * bimag;",yae="let resultTemp = areal * bimag + aimag * breal;",bae="let resultTemp = a / b;",Cae="let resultTemp = select(a * (b + 1.0), a, b >= b - b);",wae=` + `}return s}function Mie(r){let e=/(\w+)\s*:\s*vec(5|6)/g;r=r.replace(e,o=>"@align(16) "+o);let t=/vec(5|6)\s*,\s*(\w+)/g;return r=r.replace(t,(o,n,s)=>`vec${n}, @align(16) ${s}`),r}function Vz(r){return!(r.dispatchLayout.hasOwnProperty("y")&&r.dispatchLayout.y.length!==0||r.dispatchLayout.hasOwnProperty("z")&&r.dispatchLayout.z.length!==0)}var cv={};qe(cv,{GPUBytesPerElement:()=>sx,MatMulProgramType:()=>pn,assertNotComplex:()=>wm,computeDispatch:()=>H,computeWorkPerThreadForConv2d:()=>bm,computeWorkgroupInfoForMatMul:()=>lv,computeWorkgroupSizeForConv2d:()=>ym,flatDispatchLayout:()=>X,isWebGPUSupported:()=>Cm,tilesFitEvenlyIntoShape:()=>Bie});var Ap=r=>{let e=1;for(let t=0;tt%r[o]===0)}function H(r,e,t=[1,1,1],o=[1,1,1]){let[n,s,a]=[Math.ceil(Ap(r.x.map(i=>e[i]))/(t[0]*o[0])),r.y?Math.ceil(Ap(r.y.map(i=>e[i]))/(t[1]*o[1])):1,r.z?Math.ceil(Ap(r.z.map(i=>e[i]))/(t[2]*o[2])):1];return[n,s,a]}function lv(r,e,t,o=!1){let n=[8,8,1],s=[4,4,1];return o||(r<=8&&(s[1]=1),e<=16&&t<=16&&(n[0]=4)),{workgroupSize:n,elementsPerThread:s}}function ym(r,e,t=!1){if(t)return[8,8,1];let o=Ap(r.x.map(s=>e[s])),n=Ap(r.y.map(s=>e[s]));return o<=4?[4,16,1]:n<=4?[16,4,1]:[16,16,1]}function bm(r,e,t=!1){if(t)return[4,4,1];let o=Ap(r.x.map(s=>e[s])),n=Ap(r.y.map(s=>e[s]));return o<=4?[1,2,1]:n<=4?[2,1,1]:[2,2,1]}function X(r){return{x:r.map((e,t)=>t)}}function sx(r){if(r==="float32"||r==="int32"||r==="bool"||r==="string")return 4;if(r==="complex64")return 8;throw new Error(`Unknown dtype ${r}`)}function Cm(){return!!(globalThis&&globalThis.navigator&&globalThis.navigator.gpu)}function wm(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!=="complex64",()=>`${e} does not support complex64 tensors in the WebGPU backend.`)})}var pn;(function(r){r[r.MatMulReduceProgram=0]="MatMulReduceProgram",r[r.MatMulSplitKProgram=1]="MatMulSplitKProgram",r[r.MatMulSmallOutputSizeProgram=2]="MatMulSmallOutputSizeProgram",r[r.MatMulPackedProgram=3]="MatMulPackedProgram",r[r.MatMulMax=4]="MatMulMax"})(pn||(pn={}));var zie=A().getNumber("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD"),Vie=(r,e)=>{let t=r.limits.maxComputeWorkgroupsPerDimension,o=e.dispatchLayout,n=e.dispatch;if(n.every(a=>a<=t))return n;y.assert(n[0]>t&&o.y===void 0&&o.z===void 0,()=>"Dispatch size exceeds WebGPU limits in Y or Z dimension.");let s=Math.ceil(Math.sqrt(n[0]));return s>t?(s=Math.ceil(Math.cbrt(n[0])),y.assert(s<=t,()=>"Total dispatch size exceeds WebGPU maximum."),[s,s,s]):[s,s,1]},Jl=class r extends mo{nextDataId(){return r.nextDataId++}constructor(e,t){if(super(),this.commandQueueOwnedIds=new WeakSet,this.dispatchCountInPass=0,this.disposed=!1,this.downloadWaitMs=0,this.tensorDataPendingDisposal=[],this.queryResolveBuffer=null,this.querySet=null,this.querySetCount=2,this.stagingPendingDisposal=[],this.uniformPendingDisposal=[],this.uploadWaitMs=0,this.hasReadSyncWarned=!1,this.hasTimestampQueryWarned=!1,!Cm())throw new Error("WebGPU is not supported on this device");this.pipelineCache={},this.device=e,this.queue=e.queue,this.commandEncoder=null,this.computePassEncoder=null,this.adapterInfo=new rx(t),this.supportTimestampQuery=this.device.features.has("timestamp-query"),this.thresholdToIncreaseWorkgroups=this.adapterInfo.intelGPUGeneration>=12?16:8,this.bufferManager=new ox(this.device),this.textureManager=new nx(this.device),this.tensorMap=new mn(this,cr()),A().getBool("WEBGPU_USE_PROFILE_TOOL")&&(this.dummyCanvas=document.createElement("canvas"),this.dummyCanvas.width=1,this.dummyCanvas.height=1,this.dummyContext=this.dummyCanvas.getContext("webgpu"),this.dummyContext.configure({device:e,format:"bgra8unorm"}),document.body.appendChild(this.dummyCanvas))}floatPrecision(){return 32}disposeData(e,t=!1){if(!this.tensorMap.has(e))return!0;let o=this.tensorMap.get(e);return t?o.refCount=0:o.refCount--,o.refCount>0?!1:(o.complexTensorInfos!=null&&(this.disposeData(o.complexTensorInfos.real.dataId),this.disposeData(o.complexTensorInfos.imag.dataId)),this.commandQueueOwnedIds.has(e)?(this.tensorDataPendingDisposal.push(e),!0):(this.releaseResource(e),this.tensorMap.delete(e),!0))}memory(){return{numBytesInGPU:this.bufferManager.numBytesUsed,numBytesAllocatedInGPU:this.bufferManager.numBytesAllocated,unreliable:!1}}releaseResource(e){let t=this.tensorMap.get(e);if(!(!t||!t.resource)){if(t.external){t.resource=null;return}t.resource instanceof GPUBuffer?this.bufferManager.releaseBuffer(t.resource):t.resource instanceof GPUTexture&&this.textureManager.releaseTexture(t.resource),t.resource=null}}refCount(e){return this.tensorMap.has(e)?this.tensorMap.get(e).refCount:0}incRef(e){let t=this.tensorMap.get(e);t.refCount++}decRef(e){if(this.tensorMap.has(e)){let t=this.tensorMap.get(e);t.refCount--}}write(e,t,o){if(o==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");let n={id:this.nextDataId()};return this.tensorMap.set(n,{dtype:o,shape:t,values:e,refCount:1}),n}move(e,t,o,n,s){if(n==="complex64")throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.tensorMap.set(e,{dtype:n,shape:o,values:t,refCount:s})}submitQueue(){this.queue.submit([this.commandEncoder.finish()]),this.commandEncoder=null,this.dispatchCountInPass=0,this.commandQueueOwnedIds=new WeakSet,this.tensorDataPendingDisposal.forEach(e=>{this.releaseResource(e),this.tensorMap.delete(e)}),this.uniformPendingDisposal.forEach(e=>this.bufferManager.releaseBuffer(e)),this.stagingPendingDisposal.forEach(e=>this.bufferManager.releaseBuffer(e,!1)),this.tensorDataPendingDisposal=[],this.uniformPendingDisposal=[],this.stagingPendingDisposal=[]}ensureCommandEncoderReady(){this.commandEncoder||(this.commandEncoder=this.device.createCommandEncoder())}endComputePassEncoder(){this.computePassEncoder&&(this.computePassEncoder.end(),this.computePassEncoder=null)}async checkCompileCompletionAsync(){let e;try{e=await Promise.all(Object.values(this.pipelineCache))}catch(t){throw new Error(t.message)}Object.keys(this.pipelineCache).map((t,o)=>{this.pipelineCache[t]=e[o]})}async getBufferData(e){if(A().getBool("WEBGPU_ENGINE_COMPILE_ONLY"))return console.warn("The data may be invalid since WEBGPU_ENGINE_COMPILE_ONLY is true, this can only be called when WEBGPU_ENGINE_COMPILE_ONLY is false"),null;let t=e.size,o=this.bufferManager.acquireBuffer(t,GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ);this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(e,0,o,0,t),this.submitQueue(),await o.mapAsync(GPUMapMode.READ);let n=o.getMappedRange().slice(0);return o.unmap(),o!=null&&this.bufferManager.releaseBuffer(o),A().getBool("WEBGPU_USE_PROFILE_TOOL")&&(y.assert(this.dummyContext!==void 0,()=>"Fail to get context for profiling tool"),this.dummyContext.getCurrentTexture()),n}convertAndCacheOnCPU(e,t){let o=this.tensorMap.get(e);return o.values=t,o.values}readSync(e){let t=this.tensorMap.get(e),{values:o,complexTensorInfos:n}=t;if(o!=null||t.dtype==="string")return o;if(t.dtype==="complex64"){let h=this.readSync(n.real.dataId),g=this.readSync(n.imag.dataId),x=y.convertBackendValuesAndArrayBuffer(C.mergeRealAndImagArrays(h,g).buffer,"float32");return this.convertAndCacheOnCPU(e,x),x}this.hasReadSyncWarned||(this.hasReadSyncWarned=!0,console.warn("The performance of synchronously reading data from GPU to CPU is poor on the webgpu backend, please use asynchronous APIs instead."));let s=["opaque","premultiplied"],a=t.resource,i=a.size;y.assert(i%4===0,()=>"Because there is 4 bytes for one pixel, buffer size must be multiple of 4.");let p=i/4,u=new ArrayBuffer(i),l=256,c=256,m=s.map(h=>new OffscreenCanvas(l,c)),d=new OffscreenCanvas(l,c);this.endComputePassEncoder(),m.map((h,g)=>{let x=h.getContext("webgpu");return x.configure({device:this.device,format:"bgra8unorm",usage:GPUTextureUsage.COPY_DST,alphaMode:s[g]}),x.getCurrentTexture()}).map((h,g)=>{let x=l*4,b=(R,D,F)=>{this.ensureCommandEncoderReady(),this.commandEncoder.copyBufferToTexture({buffer:a,bytesPerRow:x,offset:F},{texture:h},{width:R,height:D}),this.submitQueue();let O=d.getContext("2d",{willReadFrequently:!0});O.clearRect(0,0,R,D),O.drawImage(m[g],0,0);let M=O.getImageData(0,0,R,D).data,L=s[g],B=new Uint8ClampedArray(u,F,R*D*4);for(let z=0;z0&&(b(S,k,T),T+=k*(l*4)),S=E%l,S>0&&b(S,1,T)});let f=y.convertBackendValuesAndArrayBuffer(u,t.dtype);return this.convertAndCacheOnCPU(e,f),f}async read(e){if(!this.tensorMap.has(e))throw new Error(`Tensor ${e} was not registered!`);let t=this.tensorMap.get(e),{values:o}=t;if(o!=null)return o;let n;if(t.dtype==="complex64"){let s=await Promise.all([this.read(t.complexTensorInfos.real.dataId),this.read(t.complexTensorInfos.imag.dataId)]),a=s[0],i=s[1];n=C.mergeRealAndImagArrays(a,i)}else{let s=await this.getBufferData(t.resource);n=y.convertBackendValuesAndArrayBuffer(s,t.dtype)}return this.convertAndCacheOnCPU(e,n),n}copyBuffer(e){let t=e.size,o=e.usage,n=this.bufferManager.acquireBuffer(t,o);return this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(e,0,n,0,t),this.submitQueue(),n}createTensorFromGPUData(e,t,o){let n=e.buffer;if(o==="complex64")throw new Error("Cannot write to a complex64 dtype. ");let s={id:this.nextDataId()};this.tensorMap.set(s,{dtype:o,shape:t,values:null,refCount:1,external:e.zeroCopy});let a=this.tensorMap.get(s),i=sx(a.dtype)*y.sizeFromShape(a.shape);if(e.buffer.sizey.decodeString(n));return ie(e.shape,e.dtype,o)}catch(o){throw new Error("Failed to decode encoded string bytes into utf-8")}return ie(e.shape,e.dtype,t)}async time(e){!this.supportTimestampQuery&&!this.hasTimestampQueryWarned&&(console.warn("This device doesn't support timestamp-query extension. Start Chrome browser with flag --enable-dawn-features=allow_unsafe_apis to try it again. Otherwise, zero will be shown for the kernel time when profiling mode is enabled."),this.hasTimestampQueryWarned=!0);let t=this.activeTimers,o=[],n=!1;this.programTimersStack==null?(this.programTimersStack=o,n=!0):this.activeTimers.push(o),this.activeTimers=o,e();let s=y.flatten(this.activeTimers.map(u=>u.query)).filter(u=>u!=null),a=y.flatten(this.activeTimers.map(u=>u.name)).filter(u=>u!=null);this.activeTimers=t,n&&(this.programTimersStack=null);let i={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null},p=await Promise.all(s);return i.kernelMs=y.sum(p),i.getExtraProfileInfo=()=>p.map((u,l)=>({name:a[l],ms:u})).map(u=>`${u.name}: ${u.ms}`).join(", "),this.uploadWaitMs=0,this.downloadWaitMs=0,i}makeTensorInfo(e,t,o){return t==="string"&&o!=null&&o.length>0&&y.isString(o[0])&&(o=o.map(s=>y.encodeString(s))),{dataId:this.write(o,e,t),shape:e,dtype:t}}tensorToBinding(e){if(!e)return null;let o=this.tensorMap.get(e.dataId).resource;return o instanceof GPUBuffer?{buffer:o}:o instanceof GPUTexture?o.createView():o}uploadToGPU(e){let t=this.tensorMap.get(e);if(t.resource!=null)return;let o=sx(t.dtype)*y.sizeFromShape(t.shape),n,s=GPUBufferUsage.STORAGE|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST;if(t.values){if(n=this.bufferManager.acquireBuffer(o,s,!0),n.mapState==="unmapped"){let a=this.bufferManager.acquireBuffer(o,GPUBufferUsage.MAP_WRITE|GPUBufferUsage.COPY_SRC,!0,!1),i=a.getMappedRange();t.dtype==="int32"||t.dtype==="bool"?new Int32Array(i).set(t.values):new Float32Array(i).set(t.values),a.unmap(),this.ensureCommandEncoderReady(),this.endComputePassEncoder(),this.commandEncoder.copyBufferToBuffer(a,0,n,0,o),this.stagingPendingDisposal.push(a)}else{let a=n.getMappedRange();t.dtype==="int32"||t.dtype==="bool"?new Int32Array(a).set(t.values):new Float32Array(a).set(t.values),n.unmap()}t.values=null}else n=this.bufferManager.acquireBuffer(o,s);t.resource=n}makeUniforms(e){let t=0,o=0,n=[],s=1;e.forEach(p=>{p.data.length===0&&(p.data=[1]);let u;switch(p.data.length){case 1:u=4;break;case 2:u=8;break;case 3:u=16;break;case 4:u=16;break;case 5:u=16;break;case 6:u=16;break;default:y.assert(!1,()=>`Unsupported ${p.data.length}D shape`)}(o===5||o===6)&&(u=16),u>s&&(s=u),t=Math.ceil(t/u)*u,o=p.data.length,n.push(t),t+=p.data.length*4}),t=Math.ceil(t/s)*s;let a=new ArrayBuffer(t);e.forEach((p,u)=>{let l=n[u];p.type==="int32"?new Int32Array(a,l,p.data.length).set(p.data):p.type==="uint32"?new Uint32Array(a,l,p.data.length).set(p.data):new Float32Array(a,l,p.data.length).set(p.data)});let i=this.bufferManager.acquireBuffer(t,GPUBufferUsage.COPY_DST|GPUBufferUsage.UNIFORM);return this.queue.writeBuffer(i,0,a,0,t),this.uniformPendingDisposal.push(i),{offset:0,size:t,buffer:i}}runWebGPUProgram(e,t,o,n,s){if(s||(s=this.makeTensorInfo(e.outputShape,o)),y.sizeFromShape(s.shape)===0)return this.tensorMap.get(s.dataId).values=y.getTypedArrayFromDType(s.dtype,0),s;this.uploadToGPU(s.dataId),e.dispatch=Vie(this.device,e);let a=t.map((p,u)=>{if(p.dtype==="complex64")throw new Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");return this.uploadToGPU(p.dataId),{dtype:this.tensorMap.get(p.dataId).dtype,shape:p.shape,name:e.variableNames[u]}});e.shaderKey=Uz(e,a,s);let i=A().getBool("WEBGPU_ENGINE_COMPILE_ONLY");return e.shaderKey in this.pipelineCache||(this.pipelineCache[e.shaderKey]=Wz(this.device,e,a,s,i)),e.pipeline=this.pipelineCache[e.shaderKey],i||this.recordAndSubmit(e,s,t,n),s}recordAndSubmit(e,t,o,n){if(e.pipeline instanceof Promise)throw new Error("Please call checkCompileCompletionAsync to ensure parallel compilation is done!");let s=[],a=[],i="int32";if(e.pixelsOpType==null){s.push({type:"float32",data:[NaN]},{type:"float32",data:[1/0]}),a=o.concat(t).map(d=>d.shape);let m="int32";a.map(d=>{s.push({type:m,data:d});let f=y.computeStrides(d);s.push({type:m,data:f})})}else{let m=y.computeStrides(t.shape);s.push({type:i,data:m})}if(e.size){let m=y.sizeFromShape(e.outputShape);s.push({type:i,data:[e.outputComponent?m/e.outputComponent:m]})}n&&(s=[...s,...n]);let p=[this.tensorToBinding(t),...o.map(m=>this.tensorToBinding(m)),this.makeUniforms(s)];o.forEach(m=>{this.commandQueueOwnedIds.add(m.dataId)}),this.commandQueueOwnedIds.add(t.dataId);let u=this.device.createBindGroup({layout:e.pipeline.getBindGroupLayout(0),entries:p.map((m,d)=>({binding:d,resource:m}))}),l=this.activeTimers!=null;this.ensureCommandEncoderReady();let c={};l&&this.supportTimestampQuery?(this.endComputePassEncoder(),this.querySet==null&&(this.querySet=this.device.createQuerySet({type:"timestamp",count:this.querySetCount})),c.timestampWrites={querySet:this.querySet,beginningOfPassWriteIndex:0,endOfPassWriteIndex:1},this.computePassEncoder=this.commandEncoder.beginComputePass(c)):this.computePassEncoder||(this.computePassEncoder=this.commandEncoder.beginComputePass(c)),this.computePassEncoder.setPipeline(e.pipeline),this.computePassEncoder.setBindGroup(0,u),this.computePassEncoder.dispatchWorkgroups(e.dispatch[0],e.dispatch[1],e.dispatch[2]),this.dispatchCountInPass++,(l||A().get("WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE")<=this.dispatchCountInPass||e.pixelsOpType===$i.DRAW)&&(this.endComputePassEncoder(),l?this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime()}):this.submitQueue())}async getQueryTime(){if(!this.supportTimestampQuery)return 0;this.queryResolveBuffer==null&&(this.queryResolveBuffer=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST|GPUBufferUsage.QUERY_RESOLVE)),this.commandEncoder.resolveQuerySet(this.querySet,0,this.querySetCount,this.queryResolveBuffer,0);let e=this.bufferManager.acquireBuffer(this.querySetCount*8,GPUBufferUsage.MAP_READ|GPUBufferUsage.COPY_DST);this.commandEncoder.copyBufferToBuffer(this.queryResolveBuffer,0,e,0,this.querySetCount*8),this.submitQueue(),await e.mapAsync(GPUMapMode.READ);let t=new BigUint64Array(e.getMappedRange()),o=Number(t[1]-t[0])/1e6;return e.unmap(),this.bufferManager.releaseBuffer(e),o}shouldExecuteOnCPU(e,t=zie){return A().getBool("WEBGPU_CPU_FORWARD")&&e.every(o=>this.tensorMap.get(o.dataId).resource==null&&y.sizeFromShape(o.shape){let r={powerPreference:A().get("WEBGPU_USE_LOW_POWER_GPU")?"low-power":"high-performance"},e=await navigator.gpu.requestAdapter(r),t={},o=[];e.features.has("timestamp-query")&&o.push("timestamp-query"),e.features.has("bgra8unorm-storage")&&o.push(["bgra8unorm-storage"]),t.requiredFeatures=o;let n=e.limits;t.requiredLimits={maxComputeWorkgroupStorageSize:n.maxComputeWorkgroupStorageSize,maxComputeWorkgroupsPerDimension:n.maxComputeWorkgroupsPerDimension,maxStorageBufferBindingSize:n.maxStorageBufferBindingSize,maxBufferSize:n.maxBufferSize,maxComputeWorkgroupSizeX:n.maxComputeWorkgroupSizeX,maxComputeInvocationsPerWorkgroup:n.maxComputeInvocationsPerWorkgroup};let s=await e.requestDevice(t),a=await e.requestAdapterInfo();return new Jl(s,a)},3);var fe;(function(r){r[r.ADD=0]="ADD",r[r.ATAN2=1]="ATAN2",r[r.COMPLEX_MULTIPLY_IMAG=2]="COMPLEX_MULTIPLY_IMAG",r[r.COMPLEX_MULTIPLY_REAL=3]="COMPLEX_MULTIPLY_REAL",r[r.DIV=4]="DIV",r[r.ELU_DER=5]="ELU_DER",r[r.EQUAL=6]="EQUAL",r[r.FLOOR_DIV=7]="FLOOR_DIV",r[r.GREATER=8]="GREATER",r[r.GREATER_EQUAL=9]="GREATER_EQUAL",r[r.LESS=10]="LESS",r[r.LESS_EQUAL=11]="LESS_EQUAL",r[r.LOGICAL_AND=12]="LOGICAL_AND",r[r.LOGICAL_OR=13]="LOGICAL_OR",r[r.MAX=14]="MAX",r[r.MIN=15]="MIN",r[r.MOD=16]="MOD",r[r.MUL=17]="MUL",r[r.NOT_EQUAL=18]="NOT_EQUAL",r[r.POW=19]="POW",r[r.PRELU=20]="PRELU",r[r.SQUARED_DIFFERENCE=21]="SQUARED_DIFFERENCE",r[r.SUB=22]="SUB"})(fe||(fe={}));var Wie="let resultTemp = a + b;",Uie="let resultTemp = atan2(a, b);",Gie="let resultTemp = areal * breal - aimag * bimag;",Hie="let resultTemp = areal * bimag + aimag * breal;",Kie="let resultTemp = a / b;",qie="let resultTemp = select(a * (b + 1.0), a, b >= b - b);",jie=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a == b); -`,Sae=` +`,Xie=` let remainder = select(a % b, round(a % b), (round(a) == a) & (round(b) == b)); let quotient = (a - remainder) / b; let resultTemp = round(select(quotient, quotient - 1, sign(remainder) == -sign(b))); -`,Iae=` +`,Yie=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a > b); -`,vae=` +`,Qie=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a >= b); -`,kae=` +`,Zie=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a < b); -`,Nae=` +`,Jie=` let zero = sign(a) * 0 + 0; let one = sign(b) * 0 + 1; let resultTemp = select(zero, one, a <= b); -`,Tae="return f32(a >= 1.0 && b >= 1.0);",_ae=`return (vec4(a >= vec4(1.0)) * - vec4(b >= vec4(1.0)));`,$ae="return f32(a >= 1.0 || b >= 1.0);",Eae=`return min(vec4(a >= vec4(1.0)) + - vec4(b >= vec4(1.0)), vec4(1.0));`,Rae="let resultTemp = max(a, b);",Dae="let resultTemp = min(a, b);",Aae=` +`,eue="return f32(a >= 1.0 && b >= 1.0);",tue=`return (vec4(a >= vec4(1.0)) * + vec4(b >= vec4(1.0)));`,rue="return f32(a >= 1.0 || b >= 1.0);",oue=`return min(vec4(a >= vec4(1.0)) + + vec4(b >= vec4(1.0)), vec4(1.0));`,nue="let resultTemp = max(a, b);",sue="let resultTemp = min(a, b);",aue=` let isNaN = b == 0.; var resultTemp = a % b; resultTemp = select((resultTemp + b) % b, resultTemp, (a < 0. && b < 0.) || (a >= 0. && b > 0.)); -`,Fae=` +`,iue=` let isNaN = !vec4(b); var resultTemp = vec4(a % b); if (!((a[0] < 0. && b[0] < 0.) || (a[0] >= 0. && b[0] > 0.))) { @@ -5269,20 +5269,20 @@ return a / b;`,Wee=` if (!((a[3] < 0. && b[3] < 0.) || (a[3] >= 0. && b[3] > 0.))) { resultTemp[3] = (resultTemp[3] + b[3]) % b[3]; } -`,Pae="let resultTemp = a * b;",Oae=` +`,uue="let resultTemp = a * b;",pue=` var resultTemp = f32(a != b); let valueForNaN = 1.0; -`,Mae=` +`,lue=` var resultTemp = vec4(a != b); let valueForNaN = 1.0; -`,Lae=` +`,cue=` let isNaN = a < 0.0 && floor(b) < b; if (b == 0.0) { return 1.0; } var resultTemp = select(sign(a) * pow(abs(a), b), pow(abs(a), b), round(abs(b) % 2.0) != 1.0); -`,Bae=` +`,mue=` let isModRound1Bool = vec4(round(abs(b) % vec4(2.0))) == vec4(1); let isModRound1 = vec4(isModRound1Bool); let multiplier = sign(a) * isModRound1 + (vec4(1.0) - isModRound1); @@ -5303,10 +5303,10 @@ return a / b;`,Wee=` resultTemp.a = 1.0; } let isNaN = (a < vec4(0.0)) & (floor(b) < b); -`,zae="if (a < 0.0) { return b * a; } return a;",Vae=` +`,due="if (a < 0.0) { return b * a; } return a;",fue=` let aLessThanZero = vec4(a < vec4(0.0)); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); -`,Wae="let resultTemp = (a - b) * (a - b);",Uae="let resultTemp = a - b;";function qc(r,t){let e;do{switch(r){case fe.ATAN2:e=gae;break;case fe.MAX:e=Rae;break;case fe.MIN:e=Dae;break;case fe.MOD:e=t?Fae:Aae;break;case fe.NOT_EQUAL:e=t?Mae:Oae;break;case fe.POW:e=t?Bae:Lae;break;default:continue}let o,n,s;return t?(o="isnanVec4",n="vec4",s="vec4"):(o="isnan",n="f32",s="bool"),` +`,hue="let resultTemp = (a - b) * (a - b);",gue="let resultTemp = a - b;";function ec(r,e){let t;do{switch(r){case fe.ATAN2:t=Uie;break;case fe.MAX:t=nue;break;case fe.MIN:t=sue;break;case fe.MOD:t=e?iue:aue;break;case fe.NOT_EQUAL:t=e?lue:pue;break;case fe.POW:t=e?mue:cue;break;default:continue}let o,n,s;return e?(o="isnanVec4",n="vec4",s="vec4"):(o="isnan",n="f32",s="bool"),` let aIsNaN = ${o}(a); let aPostLegalization = select(a, ${n}(42), aIsNaN); let bIsNaN = ${o}(b); @@ -5316,35 +5316,35 @@ return a / b;`,Wee=` { let a = aPostLegalization; let b = bPostLegalization; - ${e} + ${t} return select( resultTemp, ${n}(valueForNaN), ${s}(isNaN) | aIsNaN | bIsNaN); } - `}while(!1);switch(r){case fe.ADD:e=hae;break;case fe.COMPLEX_MULTIPLY_IMAG:e=yae;break;case fe.COMPLEX_MULTIPLY_REAL:e=xae;break;case fe.DIV:e=bae;break;case fe.ELU_DER:e=Cae;break;case fe.EQUAL:e=wae;break;case fe.FLOOR_DIV:e=Sae;break;case fe.GREATER:e=Iae;break;case fe.GREATER_EQUAL:e=vae;break;case fe.LESS:e=kae;break;case fe.LESS_EQUAL:e=Nae;break;case fe.LOGICAL_AND:return t?_ae:Tae;case fe.LOGICAL_OR:return t?Eae:$ae;case fe.MUL:e=Pae;break;case fe.PRELU:return t?Vae:zae;case fe.SQUARED_DIFFERENCE:e=Wae;break;case fe.SUB:e=Uae;break;default:}return` - ${e} + `}while(!1);switch(r){case fe.ADD:t=Wie;break;case fe.COMPLEX_MULTIPLY_IMAG:t=Hie;break;case fe.COMPLEX_MULTIPLY_REAL:t=Gie;break;case fe.DIV:t=Kie;break;case fe.ELU_DER:t=qie;break;case fe.EQUAL:t=jie;break;case fe.FLOOR_DIV:t=Xie;break;case fe.GREATER:t=Yie;break;case fe.GREATER_EQUAL:t=Qie;break;case fe.LESS:t=Zie;break;case fe.LESS_EQUAL:t=Jie;break;case fe.LOGICAL_AND:return e?tue:eue;case fe.LOGICAL_OR:return e?oue:rue;case fe.MUL:t=uue;break;case fe.PRELU:return e?fue:due;case fe.SQUARED_DIFFERENCE:t=hue;break;case fe.SUB:t=gue;break;default:}return` + ${t} return resultTemp; - `}var Z;(function(r){r[r.ABS=0]="ABS",r[r.ACOS=1]="ACOS",r[r.ACOSH=2]="ACOSH",r[r.ASIN=3]="ASIN",r[r.ASINH=4]="ASINH",r[r.ATAN=5]="ATAN",r[r.ATANH=6]="ATANH",r[r.CEIL=7]="CEIL",r[r.COS=8]="COS",r[r.COSH=9]="COSH",r[r.ELU=10]="ELU",r[r.ERF=11]="ERF",r[r.EXP=12]="EXP",r[r.EXPM1=13]="EXPM1",r[r.FLOOR=14]="FLOOR",r[r.IS_FINITE=15]="IS_FINITE",r[r.IS_INF=16]="IS_INF",r[r.IS_NAN=17]="IS_NAN",r[r.LINEAR=18]="LINEAR",r[r.LOG=19]="LOG",r[r.LOG1P=20]="LOG1P",r[r.LOGICAL_NOT=21]="LOGICAL_NOT",r[r.NEG=22]="NEG",r[r.RELU=23]="RELU",r[r.RELU6=24]="RELU6",r[r.LEAKYRELU=25]="LEAKYRELU",r[r.RECIPROCAL=26]="RECIPROCAL",r[r.ROUND=27]="ROUND",r[r.RSQRT=28]="RSQRT",r[r.SELU=29]="SELU",r[r.SIGMOID=30]="SIGMOID",r[r.SIGN=31]="SIGN",r[r.SIN=32]="SIN",r[r.SINH=33]="SINH",r[r.SOFTPLUS=34]="SOFTPLUS",r[r.SQRT=35]="SQRT",r[r.SQUARE=36]="SQUARE",r[r.STEP=37]="STEP",r[r.TAN=38]="TAN",r[r.TANH=39]="TANH",r[r.TO_INT=40]="TO_INT"})(Z||(Z={}));var Gae="return abs(a);",Hae=` + `}var Z;(function(r){r[r.ABS=0]="ABS",r[r.ACOS=1]="ACOS",r[r.ACOSH=2]="ACOSH",r[r.ASIN=3]="ASIN",r[r.ASINH=4]="ASINH",r[r.ATAN=5]="ATAN",r[r.ATANH=6]="ATANH",r[r.CEIL=7]="CEIL",r[r.COS=8]="COS",r[r.COSH=9]="COSH",r[r.ELU=10]="ELU",r[r.ERF=11]="ERF",r[r.EXP=12]="EXP",r[r.EXPM1=13]="EXPM1",r[r.FLOOR=14]="FLOOR",r[r.IS_FINITE=15]="IS_FINITE",r[r.IS_INF=16]="IS_INF",r[r.IS_NAN=17]="IS_NAN",r[r.LINEAR=18]="LINEAR",r[r.LOG=19]="LOG",r[r.LOG1P=20]="LOG1P",r[r.LOGICAL_NOT=21]="LOGICAL_NOT",r[r.NEG=22]="NEG",r[r.RELU=23]="RELU",r[r.RELU6=24]="RELU6",r[r.LEAKYRELU=25]="LEAKYRELU",r[r.RECIPROCAL=26]="RECIPROCAL",r[r.ROUND=27]="ROUND",r[r.RSQRT=28]="RSQRT",r[r.SELU=29]="SELU",r[r.SIGMOID=30]="SIGMOID",r[r.SIGN=31]="SIGN",r[r.SIN=32]="SIN",r[r.SINH=33]="SINH",r[r.SOFTPLUS=34]="SOFTPLUS",r[r.SQRT=35]="SQRT",r[r.SQUARE=36]="SQUARE",r[r.STEP=37]="STEP",r[r.TAN=38]="TAN",r[r.TANH=39]="TANH",r[r.TO_INT=40]="TO_INT"})(Z||(Z={}));var xue="return abs(a);",yue=` if (abs(a) > 1.) { return uniforms.NAN; } return acos(a); -`,Kae=` +`,bue=` if (a < 1.) { return uniforms.NAN; } return acosh(a); -`,qae=` +`,Cue=` if (abs(a) > 1.) { return uniforms.NAN; } return asin(a); -`,jae="return asinh(a);",Xae=` +`,wue="return asinh(a);",Sue=` if (isnan(a)) { return uniforms.NAN; } return atan(a); -`,Yae=` +`,Iue=` if (abs(a) > 1.) { return uniforms.NAN; } @@ -5355,10 +5355,10 @@ return a / b;`,Wee=` return -uniforms.INFINITY; } return atanh(a); -`,Qae="return ceil(a);",Zae="return cos(a);",Jae=` +`,vue="return ceil(a);",kue="return cos(a);",Nue=` let e2x = exp(-a); return (e2x + 1.0 / e2x) / 2.0; -`,eie="return exp(a) - 1.0;",tie="if (a >= 0.0) { return a; } return (exp(a) - 1.0);",rie=` +`,Tue="return exp(a) - 1.0;",_ue="if (a >= 0.0) { return a; } return (exp(a) - 1.0);",Eue=` var resFloat = exp(a) - vec4(1.0); if (a.r >= 0.0) { resFloat.r = a.r; @@ -5373,40 +5373,40 @@ return a / b;`,Wee=` resFloat.a = a.a; } return resFloat; -`,oie=` +`,$ue=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. - let p = ${w.ERF_P}; - let a1 = ${w.ERF_A1}; - let a2 = ${w.ERF_A2}; - let a3 = ${w.ERF_A3}; - let a4 = ${w.ERF_A4}; - let a5 = ${w.ERF_A5}; + let p = ${C.ERF_P}; + let a1 = ${C.ERF_A1}; + let a2 = ${C.ERF_A2}; + let a3 = ${C.ERF_A3}; + let a4 = ${C.ERF_A4}; + let a5 = ${C.ERF_A5}; let sign = sign(a); let absA = abs(a); let t = 1.0 / (1.0 + p * absA); return sign * (1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * exp(-absA * absA)); -`,nie="return exp(a);",sie="return floor(a);",aie="return f32(!isnan(a) && !isinf(a));",iie="return f32(isinf(a));",uie="return f32(isnan(a));",pie="return a;",cie=`if (a < 0.0) { return uniforms.NAN; } - return log(a);`,lie=` +`,Rue="return exp(a);",Due="return floor(a);",Aue="return f32(!isnan(a) && !isinf(a));",Fue="return f32(isinf(a));",Pue="return f32(isnan(a));",Oue="return a;",Mue=`if (a < 0.0) { return uniforms.NAN; } + return log(a);`,Lue=` if (isnan(a)) { return a; } return log(1.0 + a); -`,mie="return f32(!(a >= 1.0));",die="return -a;",fie="if (a < 0.0) { return uniforms.alpha * a; } return a;",hie=` +`,Bue="return f32(!(a >= 1.0));",zue="return -a;",Vue="if (a < 0.0) { return uniforms.alpha * a; } return a;",Wue=` let aLessThanZero = vec4(a < vec4(0.0)); return (aLessThanZero * (uniforms.alpha * a)) + ((vec4(1.0) - aLessThanZero) * a); -`,gie="return 1.0 / a;",xie="return select(a, 0.0, a < 0.0);",yie="return clamp(a, 0.0, 6.0);",bie="return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));",Cie=` +`,Uue="return 1.0 / a;",Gue="return select(a, 0.0, a < 0.0);",Hue="return clamp(a, 0.0, 6.0);",Kue="return clamp(a, vec4(0.0, 0.0, 0.0, 0.0), vec4(6.0, 6.0, 6.0, 6.0));",que=` return select(a, vec4(0.0), a < vec4(0.0)); -`,wie="return round(a);",Sie="return inverseSqrt(a);",Iie=` +`,jue="return round(a);",Xue="return inverseSqrt(a);",Yue=` if (a >= 0.0) { - return ${w.SELU_SCALE} * a; + return ${C.SELU_SCALE} * a; } else { - return ${w.SELU_SCALEALPHA} * (exp(a) - 1.0); + return ${C.SELU_SCALEALPHA} * (exp(a) - 1.0); } -`,vie="return 1.0 / (1.0 + exp(-1.0 * a));",kie="return sign(a);",Nie="return sin(a);",Tie=` +`,Que="return 1.0 / (1.0 + exp(-1.0 * a));",Zue="return sign(a);",Jue="return sin(a);",epe=` let e2x = exp(a); return (e2x - 1.0 / e2x) / 2.0; -`,_ie=` +`,tpe=` let epsilon = 1.1920928955078125e-7; let threshold = log(epsilon) + 2.0; @@ -5421,32 +5421,32 @@ return a / b;`,Wee=` } else { return log(exp_a + 1.0); } -`,$ie="return sqrt(a);",Eie="return a * a;",Rie=` +`,rpe="return sqrt(a);",ope="return a * a;",npe=` if (isnan(a)) { return a; } return select(uniforms.stepAlpha, 1.0, a > 0.0); -`,Die="return tan(a);",Aie=` +`,spe="return tan(a);",ape=` let e2x = exp(-2.0 * abs(a)); return sign(a) * (1.0 - e2x) / (1.0 + e2x); -`,Fie="return f32(i32((a)));";function wi(r,t){switch(r){case Z.ABS:return Gae;case Z.ACOS:return Hae;case Z.ACOSH:return Kae;case Z.ASIN:return qae;case Z.ASINH:return jae;case Z.ATAN:return Xae;case Z.ATANH:return Yae;case Z.COS:return Zae;case Z.COSH:return Jae;case Z.CEIL:return Qae;case Z.ELU:return t?rie:tie;case Z.ERF:return oie;case Z.EXP:return nie;case Z.EXPM1:return eie;case Z.FLOOR:return sie;case Z.IS_FINITE:return aie;case Z.IS_INF:return iie;case Z.IS_NAN:return uie;case Z.LINEAR:return pie;case Z.LOG:return cie;case Z.LOG1P:return lie;case Z.LOGICAL_NOT:return mie;case Z.NEG:return die;case Z.LEAKYRELU:return t?hie:fie;case Z.RECIPROCAL:return gie;case Z.RELU:return t?Cie:xie;case Z.RELU6:return t?bie:yie;case Z.ROUND:return wie;case Z.RSQRT:return Sie;case Z.SELU:return Iie;case Z.SIGMOID:return vie;case Z.SIGN:return kie;case Z.SIN:return Nie;case Z.SINH:return Tie;case Z.SOFTPLUS:return _ie;case Z.SQRT:return $ie;case Z.SQUARE:return Eie;case Z.STEP:return Rie;case Z.TAN:return Die;case Z.TANH:return Aie;case Z.TO_INT:return Fie;default:throw new Error(`BinaryType ${r} is not implemented!`)}}function dr(r,t=!1,e=!1,o=3){if(r===null)return"";let n="";if(r==="linear")n=wi(Z.LINEAR);else if(r==="relu")n=wi(Z.RELU,e);else if(r==="elu")n=wi(Z.ELU,e);else if(r==="relu6")n=wi(Z.RELU6,e);else if(r==="prelu")n=qc(fe.PRELU,e);else if(r==="sigmoid")n=wi(Z.SIGMOID,e);else if(r==="leakyrelu")n=wi(Z.LEAKYRELU,e);else throw new Error(`Activation ${r} has not been implemented for the WebGPU backend.`);let a=Ae(e?4:1),i="";return t?i=` +`,ipe="return f32(i32((a)));";function Ri(r,e){switch(r){case Z.ABS:return xue;case Z.ACOS:return yue;case Z.ACOSH:return bue;case Z.ASIN:return Cue;case Z.ASINH:return wue;case Z.ATAN:return Sue;case Z.ATANH:return Iue;case Z.COS:return kue;case Z.COSH:return Nue;case Z.CEIL:return vue;case Z.ELU:return e?Eue:_ue;case Z.ERF:return $ue;case Z.EXP:return Rue;case Z.EXPM1:return Tue;case Z.FLOOR:return Due;case Z.IS_FINITE:return Aue;case Z.IS_INF:return Fue;case Z.IS_NAN:return Pue;case Z.LINEAR:return Oue;case Z.LOG:return Mue;case Z.LOG1P:return Lue;case Z.LOGICAL_NOT:return Bue;case Z.NEG:return zue;case Z.LEAKYRELU:return e?Wue:Vue;case Z.RECIPROCAL:return Uue;case Z.RELU:return e?que:Gue;case Z.RELU6:return e?Kue:Hue;case Z.ROUND:return jue;case Z.RSQRT:return Xue;case Z.SELU:return Yue;case Z.SIGMOID:return Que;case Z.SIGN:return Zue;case Z.SIN:return Jue;case Z.SINH:return epe;case Z.SOFTPLUS:return tpe;case Z.SQRT:return rpe;case Z.SQUARE:return ope;case Z.STEP:return npe;case Z.TAN:return spe;case Z.TANH:return ape;case Z.TO_INT:return ipe;default:throw new Error(`BinaryType ${r} is not implemented!`)}}function gr(r,e=!1,t=!1,o=3){if(r===null)return"";let n="";if(r==="linear")n=Ri(Z.LINEAR);else if(r==="relu")n=Ri(Z.RELU,t);else if(r==="elu")n=Ri(Z.ELU,t);else if(r==="relu6")n=Ri(Z.RELU6,t);else if(r==="prelu")n=ec(fe.PRELU,t);else if(r==="sigmoid")n=Ri(Z.SIGMOID,t);else if(r==="leakyrelu")n=Ri(Z.LEAKYRELU,t);else throw new Error(`Activation ${r} has not been implemented for the WebGPU backend.`);let a=Ae(t?4:1),i="";return e?i=` fn activation(a : ${a}, coords : vec${o}) -> ${a} { let b = getPreluActivationWeightsByOutputCoords(coords); ${n} }`:i=` fn activation(a : ${a}, coords : vec${o}) -> ${a} { ${n} - }`,i}function Qr(r,t){return` + }`,i}function no(r,e){return` ${r?"value = value + getBiasByOutputCoords(coords);":""} - ${t?"value = activation(value, coords);":""} - `}function Zv(r,t,e=!1,o=!1,n=!1,s=1){y.assert(r&&s===1||!r,()=>`transposeA ${r} is not compatible with component size ${s}`);let a=` + ${e?"value = activation(value, coords);":""} + `}function mv(r,e,t=!1,o=!1,n=!1,s=1){y.assert(r&&s===1||!r,()=>`transposeA ${r} is not compatible with component size ${s}`);let a=` ${r?"value = getA(batch, col, row);":"value = getA(batch, row, col);"} - `,i=t?"value = getB(batch, col, row);":"value = getB(batch, row, col);";return` + `,i=e?"value = getB(batch, col, row);":"value = getB(batch, row, col);";return` fn mm_readA(batch: i32, row: i32, col: i32) -> ${Ae(s)} { var value = ${Ae(s)}(0.0); - ${e&&n?a:` + ${t&&n?a:` ${r?"if(row < uniforms.dimAOuter && col < uniforms.dimInner)":"if(row < uniforms.aShape[1] && col < uniforms.aShape[2])"} { ${a} @@ -5460,43 +5460,43 @@ return a / b;`,Wee=` ${i} return value; } - `}function dm(r,t,e,o,n=!1,s=!1,a=!1,i=1){return` - ${Zv(e,o,n,s,a,i)} + `}function Sm(r,e,t,o,n=!1,s=!1,a=!1,i=1){return` + ${mv(t,o,n,s,a,i)} fn mm_write(batch: i32, row: i32, col: i32, valueIn: ${Ae(i)}) { ${n&&s?"":"if (row < uniforms.dimAOuter && col < uniforms.dimBOuter)"} { var value = valueIn; let coords = vec3(batch, row, col); - ${Qr(r,t)} + ${no(r,e)} setOutputAtCoords(coords[0], coords[1], coords[2], value); } } - `}var Pie=(r,t)=>r?` + `}var upe=(r,e)=>r?` mm_Asub[inputRow][inputCol] = mm_readA(batchA, kStart + inputRow, - globalRowStart + inputCol * ${t}); + globalRowStart + inputCol * ${e}); `:` mm_Asub[inputRow][inputCol] = mm_readA(batchA, globalRow + innerRow, - kStart + inputCol * ${t}); - `,Oie=(r,t,e,o)=>{if(r)return` + kStart + inputCol * ${e}); + `,ppe=(r,e,t,o)=>{if(r)return` for (var k = 0; k < ${o}; k++) { let BCached0 = mm_Bsub[k][tileCol]; let ACached0 = mm_Asub[k][localRow]; - for (var i = 0; i < ${e}; i++) { + for (var i = 0; i < ${t}; i++) { acc[i] = fma(BCached0, vec4(ACached0[i]), acc[i]); } - }`;{let n="",s="";for(let a=0;a(ACached[${a}]), acc[i]);`;return` - for (var k = 0; k < ${o/t}; k++) { + }`;{let n="",s="";for(let a=0;a(ACached[${a}]), acc[i]);`;return` + for (var k = 0; k < ${o/e}; k++) { ${n} - for (var i = 0; i < ${e}; i++) { + for (var i = 0; i < ${t}; i++) { let ACached = mm_Asub[tileRow + i][k]; ${s} } - }`}};function Np(r,t,e=!1,o=32,n=!1,s=32,a=!1){let i=t[1]*r[1],p=t[0]*r[0],u=e?i:o,c=e?o:i,l=u/t[0],m=o/t[1],d=r[1],f=r[0];return y.assert((e&&l===4&&r[1]===4||!e&&(l===3||l===4))&&u%t[0]===0&&o%t[1]===0&&r[0]===4,()=>`If transposeA ${e} is true, innerElementSize ${l} and workPerThread[1] ${r[1]} must be 4. - Otherwise, innerElementSize ${l} must be 3 or 4. - tileAWidth ${u} must be divisible by workgroupSize[0]${t[0]}. tileInner ${o} must be divisible by workgroupSize[1] ${t[1]}. colPerThread ${r[0]} must be 4.`),` - var mm_Asub : array, ${u/l}>, ${c}>; + }`}};function Fp(r,e,t=!1,o=32,n=!1,s=32,a=!1){let i=e[1]*r[1],p=e[0]*r[0],u=t?i:o,l=t?o:i,c=u/e[0],m=o/e[1],d=r[1],f=r[0];return y.assert((t&&c===4&&r[1]===4||!t&&(c===3||c===4))&&u%e[0]===0&&o%e[1]===0&&r[0]===4,()=>`If transposeA ${t} is true, innerElementSize ${c} and workPerThread[1] ${r[1]} must be 4. + Otherwise, innerElementSize ${c} must be 3 or 4. + tileAWidth ${u} must be divisible by workgroupSize[0]${e[0]}. tileInner ${o} must be divisible by workgroupSize[1] ${e[1]}. colPerThread ${r[0]} must be 4.`),` + var mm_Asub : array, ${u/c}>, ${l}>; var mm_Bsub : array, ${p/r[0]}>, ${o}>; ${G()} { @@ -5523,7 +5523,7 @@ return a / b;`,Wee=` for (var innerRow = 0; innerRow < ${d}; innerRow++) { let inputRow = tileRow + innerRow; let inputCol = tileCol; - ${Pie(e,l)} + ${upe(t,c)} } // Load one tile of B into local memory. @@ -5536,14 +5536,14 @@ return a / b;`,Wee=` workgroupBarrier(); // Compute acc values for a single thread. - ${Oie(e,l,d,o)} + ${ppe(t,c,d,o)} workgroupBarrier(); } for (var innerRow = 0; innerRow < ${d}; innerRow++) { mm_write(batch, globalRow + innerRow, globalCol, acc[innerRow]); } - }`}var ez=r=>r?` + }`}var Hz=r=>r?` mm_Asub[inputRow][inputCol] = mm_readA(batchA, kStart + inputRow, globalRowStart + inputCol); @@ -5551,7 +5551,7 @@ return a / b;`,Wee=` mm_Asub[inputRow][inputCol] = mm_readA(batchA, globalRowStart + inputRow, kStart + inputCol); - `,Mie=r=>r?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];";function Tp(r,t,e=!1,o=32,n=!1,s=32,a=!1,i=!1){let p=r[1]*t[1],u=r[0]*t[0],c=e?p:o,l=e?o:p;y.assert(l%t[1]===0&&c%t[0]===0&&o%t[1]===0,()=>`tileAHight ${l} must be divisible by workgroupSize[1]${t[1]}, tileAWidth ${c} must be divisible by workgroupSize[0]${t[0]}, tileInner ${o} must be divisible by workgroupSize[1]${t[1]}`);let m=l/t[1],d=c/t[0],f=o/t[1],h=r[1],g=r[0],x=a?` + `,lpe=r=>r?"let ACached = mm_Asub[k][tileRow + innerRow];":"let ACached = mm_Asub[tileRow + innerRow][k];";function Pp(r,e,t=!1,o=32,n=!1,s=32,a=!1,i=!1){let p=r[1]*e[1],u=r[0]*e[0],l=t?p:o,c=t?o:p;y.assert(c%e[1]===0&&l%e[0]===0&&o%e[1]===0,()=>`tileAHight ${c} must be divisible by workgroupSize[1]${e[1]}, tileAWidth ${l} must be divisible by workgroupSize[0]${e[0]}, tileInner ${o} must be divisible by workgroupSize[1]${e[1]}`);let m=c/e[1],d=l/e[0],f=o/e[1],h=r[1],g=r[0],x=a?` let localRow = i32(localId.y); let localCol = i32(localId.x); let globalRowStart = i32(workgroupId.y) * ${p}; @@ -5560,14 +5560,14 @@ return a / b;`,Wee=` // Loop over shared dimension. for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. - for (var inputRow = localRow; inputRow < ${l}; inputRow = inputRow + ${t[1]}) { - for (var inputCol = localCol; inputCol < ${c}; inputCol = inputCol + ${t[0]}) { - ${ez(e)} + for (var inputRow = localRow; inputRow < ${c}; inputRow = inputRow + ${e[1]}) { + for (var inputCol = localCol; inputCol < ${l}; inputCol = inputCol + ${e[0]}) { + ${Hz(t)} } } // Load one tile of B into local memory. - for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${t[1]}) { - for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${t[0]}) { + for (var inputRow = localRow; inputRow < ${o}; inputRow = inputRow + ${e[1]}) { + for (var inputCol = localCol; inputCol < ${u}; inputCol = inputCol + ${e[0]}) { mm_Bsub[inputRow][inputCol] = mm_readB(batchB, kStart + inputRow, globalColStart + inputCol); @@ -5580,10 +5580,10 @@ return a / b;`,Wee=` var BCached : array; for (var k = 0; k < ${o}; k++) { for (var inner = 0; inner < ${g}; inner++) { - BCached[inner] = mm_Bsub[k][localCol + inner * ${t[0]}]; + BCached[inner] = mm_Bsub[k][localCol + inner * ${e[0]}]; } for (var innerRow = 0; innerRow < ${h}; innerRow++) { - let ACached = ${e?`mm_Asub[k][localRow + innerRow * ${t[1]}];`:`mm_Asub[localRow + innerRow * ${t[1]}][k];`} + let ACached = ${t?`mm_Asub[k][localRow + innerRow * ${e[1]}];`:`mm_Asub[localRow + innerRow * ${e[1]}][k];`} for (var innerCol = 0; innerCol < ${g}; innerCol++) { acc[innerRow][innerCol] = fma(ACached, BCached[innerCol], acc[innerRow][innerCol]); @@ -5593,9 +5593,9 @@ return a / b;`,Wee=` workgroupBarrier(); } for (var innerRow = 0; innerRow < ${h}; innerRow++) { - let gRow = globalRowStart + localRow + innerRow * ${t[1]}; + let gRow = globalRowStart + localRow + innerRow * ${e[1]}; for (var innerCol = 0; innerCol < ${g}; innerCol++) { - let gCol = globalColStart + localCol + innerCol * ${t[0]}; + let gCol = globalColStart + localCol + innerCol * ${e[0]}; mm_write(batch, gRow, gCol, acc[innerRow][innerCol]); } } @@ -5617,7 +5617,7 @@ return a / b;`,Wee=` for (var innerCol = 0; innerCol < ${d}; innerCol++) { let inputRow = tileRowA + innerRow; let inputCol = tileColA + innerCol; - ${ez(e)} + ${Hz(t)} } } @@ -5642,7 +5642,7 @@ return a / b;`,Wee=` } for (var innerRow = 0; innerRow < ${h}; innerRow++) { - ${Mie(e)} + ${lpe(t)} for (var innerCol = 0; innerCol < ${g}; innerCol++) { acc[innerRow][innerCol] = fma(ACached, BCached[innerCol], acc[innerRow][innerCol]); @@ -5660,7 +5660,7 @@ return a / b;`,Wee=` } } `;return` - var mm_Asub : array, ${l}>; + var mm_Asub : array, ${c}>; var mm_Bsub : array, ${o}>; ${G()} { @@ -5680,7 +5680,7 @@ return a / b;`,Wee=` } ${x} } - `}var Lie=r=>r?` + `}var cpe=r=>r?` mm_readA(batchA, colA, globalRow), mm_readA(batchA, colA + 1, globalRow), mm_readA(batchA, colA + 2, globalRow), @@ -5690,7 +5690,7 @@ return a / b;`,Wee=` mm_readA(batchA, globalRow, colA + 1), mm_readA(batchA, globalRow, colA + 2), mm_readA(batchA, globalRow, colA + 3) - `;function Bie(r,t=!1){y.assert(r[1]===1&&r[2]===1,()=>`A linear work group size is required. But got ${r}.`);let e=r[0]*4;return` + `;function mpe(r,e=!1){y.assert(r[1]===1&&r[2]===1,()=>`A linear work group size is required. But got ${r}.`);let t=r[0]*4;return` var mm_Asub : array, ${r[0]}>; ${G()} { @@ -5698,7 +5698,7 @@ return a / b;`,Wee=` let globalCol = i32(globalId.x); let globalRow = i32(globalId.y); - let numTiles = (uniforms.dimInner - 1) / ${e} + 1; + let numTiles = (uniforms.dimInner - 1) / ${t} + 1; let batch = i32(globalId.z); let batchA = batch % uniforms.aShape[0]; let batchB = batch % uniforms.bShape[0]; @@ -5708,13 +5708,13 @@ return a / b;`,Wee=` // Loop over shared dimension. for (var t = 0; t < numTiles; t++) { // Load one tile of A into local memory. - let colA = t * ${e} + tileCol * 4; - mm_Asub[tileCol] = vec4(${Lie(t)}); + let colA = t * ${t} + tileCol * 4; + mm_Asub[tileCol] = vec4(${cpe(e)}); workgroupBarrier(); // Compute acc values for a single thread. - for (var k = 0; k < ${e/4}; k++) { - let rowB = t * ${e} + k * 4; + for (var k = 0; k < ${t/4}; k++) { + let rowB = t * ${t} + k * 4; let BCached = vec4(mm_readB(batchB, rowB, globalCol), mm_readB(batchB, rowB + 1, globalCol), mm_readB(batchB, rowB + 2, globalCol), @@ -5729,11 +5729,11 @@ return a / b;`,Wee=` mm_write(batch, globalRow, globalCol, acc); } - `}var jg=class{constructor(t,e,o=!1,n=!1,s=null,a=null,i=null,p=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e,this.dispatchLayout={x:[2],y:[1],z:[0]};let u=o?t[1]:t[2];if(this.isVec4=(u%4===0&&!o||e[1]%4===0&&o)&&e[2]%4===0&&!n,this.outputComponent=this.isVec4?4:1,this.isVectorA=e[1]===1&&!o,!this.isVec4&&this.isVectorA)this.elementsPerThread=[1,1,1],this.workgroupSize=[32,1,1];else{let m=Yv(e[1],u,e[2],o);this.workgroupSize=m.workgroupSize,this.elementsPerThread=m.elementsPerThread}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread);let c=s!=null,l=i!=null;c&&this.variableNames.push("bias"),l&&this.variableNames.push("preluActivationWeights"),this.sequentialAccessByThreads=p,this.transposeA=o,this.transposeB=n,this.addBias=c,this.activation=a,this.hasPreluActivationWeights=l,[this.fitAOuter,this.fitBOuter,this.fitInner]=this.getShapeFit(e[1],e[2],u),this.shaderKey=`matMulPacked_${this.elementsPerThread}_${o}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`}getShapeFit(t,e,o){let n=this.workgroupSize[1]*this.elementsPerThread[1],s=this.workgroupSize[0]*this.elementsPerThread[0];!this.isVec4&&this.isVectorA?this.tileInner=this.workgroupSize[0]*4:this.tileInner=s;let a=t%n===0,i=e%s===0,p=o%this.tileInner===0;return[a,i,p]}getUserCode(){return` - ${dr(this.activation,this.hasPreluActivationWeights,this.isVec4)} - ${dm(this.addBias,this.activation,!1,this.transposeB,this.fitAOuter,this.fitBOuter,this.fitInner,this.isVec4?4:1)} - ${this.isVec4?Np(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,!0):this.isVectorA?Bie(this.workgroupSize,this.transposeA):Tp(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,this.sequentialAccessByThreads,!0)} - `}};function zie(r){return` + `}var ax=class{constructor(e,t,o=!1,n=!1,s=null,a=null,i=null,p=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=t,this.dispatchLayout={x:[2],y:[1],z:[0]};let u=o?e[1]:e[2];if(this.isVec4=(u%4===0&&!o||t[1]%4===0&&o)&&t[2]%4===0&&!n,this.outputComponent=this.isVec4?4:1,this.isVectorA=t[1]===1&&!o,!this.isVec4&&this.isVectorA)this.elementsPerThread=[1,1,1],this.workgroupSize=[32,1,1];else{let m=lv(t[1],u,t[2],o);this.workgroupSize=m.workgroupSize,this.elementsPerThread=m.elementsPerThread}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread);let l=s!=null,c=i!=null;l&&this.variableNames.push("bias"),c&&this.variableNames.push("preluActivationWeights"),this.sequentialAccessByThreads=p,this.transposeA=o,this.transposeB=n,this.addBias=l,this.activation=a,this.hasPreluActivationWeights=c,[this.fitAOuter,this.fitBOuter,this.fitInner]=this.getShapeFit(t[1],t[2],u),this.shaderKey=`matMulPacked_${this.elementsPerThread}_${o}_${n}_${this.activation}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.isVectorA}_${this.sequentialAccessByThreads}`}getShapeFit(e,t,o){let n=this.workgroupSize[1]*this.elementsPerThread[1],s=this.workgroupSize[0]*this.elementsPerThread[0];!this.isVec4&&this.isVectorA?this.tileInner=this.workgroupSize[0]*4:this.tileInner=s;let a=e%n===0,i=t%s===0,p=o%this.tileInner===0;return[a,i,p]}getUserCode(){return` + ${gr(this.activation,this.hasPreluActivationWeights,this.isVec4)} + ${Sm(this.addBias,this.activation,!1,this.transposeB,this.fitAOuter,this.fitBOuter,this.fitInner,this.isVec4?4:1)} + ${this.isVec4?Fp(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,!0):this.isVectorA?mpe(this.workgroupSize,this.transposeA):Pp(this.elementsPerThread,this.workgroupSize,this.transposeA,this.tileInner,!1,null,this.sequentialAccessByThreads,!0)} + `}};function dpe(r){return` var sumValues : array; ${G()} { let coords = getOutputCoords(); @@ -5766,13 +5766,13 @@ return a / b;`,Wee=` mm_write(batch, row, col, sum); } } - `}var Xg=class{constructor(t,e=!1,o=!1,n=null,s=null,a=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[256,1,1],this.outputShape=t,this.dispatchLayout={x:[],y:[1,2],z:[0]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize);let i=n!=null,p=a!=null;i&&this.variableNames.push("bias"),p&&this.variableNames.push("preluActivationWeights"),this.transposeA=e,this.transposeB=o,this.addBias=i,this.activation=s,this.hasPreluActivationWeights=p,this.shaderKey=`matMulReduce_${this.activation}_${e}_${o}`}getUserCode(){return` - ${dr(this.activation,this.hasPreluActivationWeights)} - ${dm(this.addBias,this.activation,this.transposeA,this.transposeB)} - ${zie(this.workgroupSize[0])} - `}};function Vie(r){let t=r[1],e=r[0],o=t>e?t:e;return` - var mm_Asub : array, ${t}>; - var mm_Bsub : array, ${o}>; + `}var ix=class{constructor(e,t=!1,o=!1,n=null,s=null,a=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout={x:[],y:[1,2],z:[0]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize);let i=n!=null,p=a!=null;i&&this.variableNames.push("bias"),p&&this.variableNames.push("preluActivationWeights"),this.transposeA=t,this.transposeB=o,this.addBias=i,this.activation=s,this.hasPreluActivationWeights=p,this.shaderKey=`matMulReduce_${this.activation}_${t}_${o}`}getUserCode(){return` + ${gr(this.activation,this.hasPreluActivationWeights)} + ${Sm(this.addBias,this.activation,this.transposeA,this.transposeB)} + ${dpe(this.workgroupSize[0])} + `}};function fpe(r){let e=r[1],t=r[0],o=e>t?e:t;return` + var mm_Asub : array, ${e}>; + var mm_Bsub : array, ${o}>; // If the output size is small for matrix multiplication, avoid to use vec4 // and handle some elements per thread to optimally utilize the ALU. @@ -5822,44 +5822,44 @@ return a / b;`,Wee=` mm_write(batch, globalRow, globalCol, acc); } - `}var Yg=class{constructor(t,e,o,n=!1,s=!1,a=null,i=null,p=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[16,8,1],this.outputShape=o,this.dispatchLayout={x:[2],y:[1],z:[0]},this.dispatch=[Math.ceil(o[2]/this.workgroupSize[0]),Math.ceil(o[1]/this.workgroupSize[1]),o[0]];let u=a!=null;u&&this.variableNames.push("bias");let c=p!=null;c&&this.variableNames.push("preluActivationWeights"),this.transposeA=n,this.transposeB=s,this.addBias=u,this.activation=i,this.hasPreluActivationWeights=c,this.shaderKey=`matMulSmallOutputSize_${this.activation}_${n}_${s}`}getUserCode(){return` - ${dr(this.activation,this.hasPreluActivationWeights)} - ${dm(this.addBias,this.activation,this.transposeA,this.transposeB)} - ${Vie(this.workgroupSize)} - `}};var Qg=class{constructor(t,e,o=!1,n=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[8,8,1],this.atomic=!0,this.splitedDimInner=128,y.assert(t[0]===1,()=>"MatMulSplitKProgram only supports batch = 1."),this.outputShape=t,this.dispatchLayout={x:[2],y:[1],z:[0,3]};let s=(o&&this.outputShape[1]%4===0||!o&&e%4===0)&&this.outputShape[2]%4===0;this.elementsPerThread=[4,4,this.splitedDimInner],this.outputComponent=s?4:1,s||(this.outputShape[1]<16&&(this.elementsPerThread[1]=1),this.outputShape[2]<16&&(this.elementsPerThread[0]=1)),this.dispatch=H(this.dispatchLayout,[this.outputShape[0],this.outputShape[1],this.outputShape[2],e],this.workgroupSize,this.elementsPerThread),this.transposeA=o,this.transposeB=n,this.shaderKey=`matMulSplitK_${o}_${n}_${this.elementsPerThread}_${this.outputComponent}`}getUserCode(){let t=this.outputComponent;return` - ${Zv(!1,this.transposeB,!1,!1,!1,t)} - fn mm_write(batch: i32, row : i32, col : i32, value : ${Ae(t)}) { + `}var ux=class{constructor(e,t,o,n=!1,s=!1,a=null,i=null,p=null){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[16,8,1],this.outputShape=o,this.dispatchLayout={x:[2],y:[1],z:[0]},this.dispatch=[Math.ceil(o[2]/this.workgroupSize[0]),Math.ceil(o[1]/this.workgroupSize[1]),o[0]];let u=a!=null;u&&this.variableNames.push("bias");let l=p!=null;l&&this.variableNames.push("preluActivationWeights"),this.transposeA=n,this.transposeB=s,this.addBias=u,this.activation=i,this.hasPreluActivationWeights=l,this.shaderKey=`matMulSmallOutputSize_${this.activation}_${n}_${s}`}getUserCode(){return` + ${gr(this.activation,this.hasPreluActivationWeights)} + ${Sm(this.addBias,this.activation,this.transposeA,this.transposeB)} + ${fpe(this.workgroupSize)} + `}};var px=class{constructor(e,t,o=!1,n=!1){this.variableNames=["A","B"],this.uniforms="dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.workgroupSize=[8,8,1],this.atomic=!0,this.splitedDimInner=128,y.assert(e[0]===1,()=>"MatMulSplitKProgram only supports batch = 1."),this.outputShape=e,this.dispatchLayout={x:[2],y:[1],z:[0,3]};let s=(o&&this.outputShape[1]%4===0||!o&&t%4===0)&&this.outputShape[2]%4===0;this.elementsPerThread=[4,4,this.splitedDimInner],this.outputComponent=s?4:1,s||(this.outputShape[1]<16&&(this.elementsPerThread[1]=1),this.outputShape[2]<16&&(this.elementsPerThread[0]=1)),this.dispatch=H(this.dispatchLayout,[this.outputShape[0],this.outputShape[1],this.outputShape[2],t],this.workgroupSize,this.elementsPerThread),this.transposeA=o,this.transposeB=n,this.shaderKey=`matMulSplitK_${o}_${n}_${this.elementsPerThread}_${this.outputComponent}`}getUserCode(){let e=this.outputComponent;return` + ${mv(!1,this.transposeB,!1,!1,!1,e)} + fn mm_write(batch: i32, row : i32, col : i32, value : ${Ae(e)}) { if (row < uniforms.dimAOuter && col < uniforms.dimBOuter) { let coords = vec3(batch, row, col); let flatIndex = getOutputIndexFromCoords(coords); // The problem is that we should initialize output to zero before using. // Otherwise, the original value will be added to the result. - for (var i = 0; i < ${t}; i = i + 1) { - ${Yr("&result[flatIndex + i]",`${t>1?"value[i]":"value"}`,"float32")} + for (var i = 0; i < ${e}; i = i + 1) { + ${oo("&result[flatIndex + i]",`${e>1?"value[i]":"value"}`,"float32")} } } } - ${t===4?Np(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner):Tp(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner)} - `}},Zg=class{constructor(t,e=null,o=null,n=null){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=e!=null,this.hasPreluActivationWeights=n!=null,this.activation=o,this.addBias&&this.variableNames.push("bias"),this.hasPreluActivationWeights&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`biasActivation_${o}`}getUserCode(){return` - ${dr(this.activation,this.hasPreluActivationWeights)} + ${e===4?Fp(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner):Pp(this.elementsPerThread,this.workgroupSize,this.transposeA,32,!0,this.splitedDimInner)} + `}},lx=class{constructor(e,t=null,o=null,n=null){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t!=null,this.hasPreluActivationWeights=n!=null,this.activation=o,this.addBias&&this.variableNames.push("bias"),this.hasPreluActivationWeights&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`biasActivation_${o}`}getUserCode(){return` + ${gr(this.activation,this.hasPreluActivationWeights)} ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); var value = getXByOutputIndex(index); - ${Qr(this.addBias,this.activation)} + ${no(this.addBias,this.activation)} setOutputAtIndex(index, value); } } - `}};var Jg=class{constructor(t){this.variableNames=[],this.outputShape=[],this.uniforms="value : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="fill"}getUserCode(){return` + `}};var cx=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms="value : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="fill"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { setOutputAtIndex(index, uniforms.value); } } - `}};function vt(r){let{backend:t,attrs:e}=r,{shape:o,value:n}=e,{dtype:s}=e;if(s=s||y.inferDtype(n),s==="string"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),t.makeTensorInfo(o,s,a)}else{let a=new Jg(o),i=[{type:"float32",data:[n]}];return t.runWebGPUProgram(a,[],s,i)}}var tz={kernelName:sa,backendName:"webgpu",kernelFunc:vt};function pe(r){let{inputs:t,attrs:e}=r,{x:o}=t,{shape:n}=e,s=y.sizeFromShape(o.shape),a=y.inferFromImplicitShape(n,s),i=y.sizeFromShape(a);return y.assert(s===i,()=>`The new shape (${a}) has ${i} elements and the old shape (${o.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var rz={kernelName:da,backendName:"webgpu",kernelFunc:pe};function _p({a:r,b:t,transposeA:e,transposeB:o,backend:n,bias:s=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:p=null}){let u=r.shape.length,c=t.shape.length,l=e?r.shape[u-2]:r.shape[u-1],m=o?t.shape[c-1]:t.shape[c-2],d=e?r.shape[u-1]:r.shape[u-2],f=o?t.shape[c-2]:t.shape[c-1],h=r.shape.slice(0,-2),g=t.shape.slice(0,-2),x=y.sizeFromShape(h),b=y.sizeFromShape(g),S=Sr.assertAndGetBroadcastShape(r.shape.slice(0,-2),t.shape.slice(0,-2)).concat([d,f]);y.assert(l===m,()=>`Error in matMul: inner shapes (${l}) and (${m}) of Tensors with shapes ${r.shape} and ${t.shape} and transposeA=${e} and transposeB=${o} must match.`);let k=e?[x,l,d]:[x,d,l],_=o?[b,f,m]:[b,m,f],E=pe({inputs:{x:r},backend:n,attrs:{shape:k}}),R=pe({inputs:{x:t},backend:n,attrs:{shape:_}}),D=[E,R],P=Math.max(x,b),O=[E,R],M=[{type:"int32",data:[d]},{type:"int32",data:[f]},{type:"int32",data:[l]}],L,B,z=[P,d,f],U=A().get("WEBGPU_MATMUL_PROGRAM_TYPE");if(U<0){let q=A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),Y=q>0?q:n.thresholdToIncreaseWorkgroups,J=P*Math.ceil(d/32)*Math.ceil(f/32);J<=Y||d<=8&&J<=Y*2?P*d*f<=128?U=Mo.MatMulReduceProgram:P===1&&m>=2e3?U=Mo.MatMulSplitKProgram:U=Mo.MatMulSmallOutputSizeProgram:U=Mo.MatMulPackedProgram}switch(U){case Mo.MatMulReduceProgram:L=new Xg(z,e,o,s,p,a);break;case Mo.MatMulSplitKProgram:{if(B=vt({backend:n,attrs:{shape:z,value:0,dtype:r.dtype}}),L=new Qg(z,m,e,o),s||p){B=n.runWebGPUProgram(L,O,r.dtype,M,B);let Y=new Zg(B.shape,s,p,a),J=null,re=[B];s&&re.push(s),a&&re.push(a),p==="leakyrelu"&&(J=[{type:"float32",data:[i]}],Y.uniforms+=" alpha : f32,");let ne=n.runWebGPUProgram(Y,re,B.dtype,J);D.push(B);let ee=pe({inputs:{x:ne},backend:n,attrs:{shape:S}});D.push(ne);for(let oe of D)n.disposeData(oe.dataId);return ee}break}case Mo.MatMulSmallOutputSizeProgram:L=new Yg(k,_,z,e,o,s,p,a);break;case Mo.MatMulPackedProgram:let q=n.adapterInfo.isIntel();L=new jg(k,z,e,o,s,p,a,q);break;default:throw new Error(`Unsupported MatMulProgramType ${U}.`)}s&&O.push(s),a&&O.push(a),p==="leakyrelu"&&(M.push({type:"float32",data:[i]}),L.uniforms+=" alpha : f32,"),B=n.runWebGPUProgram(L,O,r.dtype,M,B);let j=pe({inputs:{x:B},backend:n,attrs:{shape:S}});D.push(B);for(let q of D)n.disposeData(q.dataId);return j}function Wie(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=t,{transposeA:p,transposeB:u,activation:c,leakyreluAlpha:l}=o;return _p({a:n,b:s,transposeA:p,transposeB:u,backend:e,bias:a,preluActivationWeights:i,leakyreluAlpha:l,activation:c})}var oz={kernelName:So,backendName:"webgpu",kernelFunc:Wie};var fm=class{constructor(t,e,o){this.variableNames=["AReal","AImag","BReal","BImag"],this.workgroupSize=[128,1,1],this.size=!0,this.outputShape=w.assertAndGetBroadcastShape(e,o),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`binaryOpComplex_${t}`,this.op=t}getUserCode(){return` + `}};function Nt(r){let{backend:e,attrs:t}=r,{shape:o,value:n}=t,{dtype:s}=t;if(s=s||y.inferDtype(n),s==="string"){let a=y.getArrayFromDType(s,y.sizeFromShape(o));return a.fill(n),e.makeTensorInfo(o,s,a)}else{let a=new cx(o),i=[{type:"float32",data:[n]}];return e.runWebGPUProgram(a,[],s,i)}}var Kz={kernelName:da,backendName:"webgpu",kernelFunc:Nt};function le(r){let{inputs:e,attrs:t}=r,{x:o}=e,{shape:n}=t,s=y.sizeFromShape(o.shape),a=y.inferFromImplicitShape(n,s),i=y.sizeFromShape(a);return y.assert(s===i,()=>`The new shape (${a}) has ${i} elements and the old shape (${o.shape}) has ${s} elements. The new shape and old shape must have the same number of elements.`),r.backend.incRef(o.dataId),{dataId:o.dataId,shape:a,dtype:o.dtype}}var qz={kernelName:Ca,backendName:"webgpu",kernelFunc:le};function Op({a:r,b:e,transposeA:t,transposeB:o,backend:n,bias:s=null,preluActivationWeights:a=null,leakyreluAlpha:i=0,activation:p=null}){let u=r.shape.length,l=e.shape.length,c=t?r.shape[u-2]:r.shape[u-1],m=o?e.shape[l-1]:e.shape[l-2],d=t?r.shape[u-1]:r.shape[u-2],f=o?e.shape[l-2]:e.shape[l-1],h=r.shape.slice(0,-2),g=e.shape.slice(0,-2),x=y.sizeFromShape(h),b=y.sizeFromShape(g),S=kr.assertAndGetBroadcastShape(r.shape.slice(0,-2),e.shape.slice(0,-2)).concat([d,f]);y.assert(c===m,()=>`Error in matMul: inner shapes (${c}) and (${m}) of Tensors with shapes ${r.shape} and ${e.shape} and transposeA=${t} and transposeB=${o} must match.`);let k=t?[x,c,d]:[x,d,c],T=o?[b,f,m]:[b,m,f],E=le({inputs:{x:r},backend:n,attrs:{shape:k}}),R=le({inputs:{x:e},backend:n,attrs:{shape:T}}),D=[E,R],F=Math.max(x,b),O=[E,R],M=[{type:"int32",data:[d]},{type:"int32",data:[f]},{type:"int32",data:[c]}],L,B,z=[F,d,f],U=A().get("WEBGPU_MATMUL_PROGRAM_TYPE");if(U<0){let q=A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),Y=q>0?q:n.thresholdToIncreaseWorkgroups,J=F*Math.ceil(d/32)*Math.ceil(f/32);J<=Y||d<=8&&J<=Y*2?F*d*f<=128?U=pn.MatMulReduceProgram:F===1&&m>=2e3?U=pn.MatMulSplitKProgram:U=pn.MatMulSmallOutputSizeProgram:U=pn.MatMulPackedProgram}switch(U){case pn.MatMulReduceProgram:L=new ix(z,t,o,s,p,a);break;case pn.MatMulSplitKProgram:{if(B=Nt({backend:n,attrs:{shape:z,value:0,dtype:r.dtype}}),L=new px(z,m,t,o),s||p){B=n.runWebGPUProgram(L,O,r.dtype,M,B);let Y=new lx(B.shape,s,p,a),J=null,re=[B];s&&re.push(s),a&&re.push(a),p==="leakyrelu"&&(J=[{type:"float32",data:[i]}],Y.uniforms+=" alpha : f32,");let ne=n.runWebGPUProgram(Y,re,B.dtype,J);D.push(B);let ee=le({inputs:{x:ne},backend:n,attrs:{shape:S}});D.push(ne);for(let oe of D)n.disposeData(oe.dataId);return ee}break}case pn.MatMulSmallOutputSizeProgram:L=new ux(k,T,z,t,o,s,p,a);break;case pn.MatMulPackedProgram:let q=n.adapterInfo.isIntel();L=new ax(k,z,t,o,s,p,a,q);break;default:throw new Error(`Unsupported MatMulProgramType ${U}.`)}s&&O.push(s),a&&O.push(a),p==="leakyrelu"&&(M.push({type:"float32",data:[i]}),L.uniforms+=" alpha : f32,"),B=n.runWebGPUProgram(L,O,r.dtype,M,B);let j=le({inputs:{x:B},backend:n,attrs:{shape:S}});D.push(B);for(let q of D)n.disposeData(q.dataId);return j}function hpe(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s,bias:a,preluActivationWeights:i}=e,{transposeA:p,transposeB:u,activation:l,leakyreluAlpha:c}=o;return Op({a:n,b:s,transposeA:p,transposeB:u,backend:t,bias:a,preluActivationWeights:i,leakyreluAlpha:c,activation:l})}var jz={kernelName:qo,backendName:"webgpu",kernelFunc:hpe};var Im=class{constructor(e,t,o){this.variableNames=["AReal","AImag","BReal","BImag"],this.workgroupSize=[128,1,1],this.size=!0,this.outputShape=C.assertAndGetBroadcastShape(t,o),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`binaryOpComplex_${e}`,this.op=e}getUserCode(){return` fn binaryOpComplex( areal : f32, aimag : f32, breal : f32, bimag : f32) -> f32 { - ${qc(this.op,!1)} + ${ec(this.op,!1)} } ${G("index")} { @@ -5871,13 +5871,13 @@ return a / b;`,Wee=` setOutputAtIndex(index, binaryOpComplex(areal, aimag, breal, bimag)); } } - `}};var Si=class{constructor(t,e,o){if(this.size=!0,this.variableNames=["A","B"],this.outputShape=w.assertAndGetBroadcastShape(e,o),this.dispatchLayout=X(this.outputShape),this.op=t,this.useSharedMemoryWithA=e.length<=1&&o.length>1&&e[0]<128,this.useSharedMemoryWithB=o.length<=1&&e.length>1&&o[0]<128,this.useSharedMemoryWithA||this.useSharedMemoryWithB)this.outputComponent=1,this.variableComponents=[1,1],this.lastDimensionSize=this.useSharedMemoryWithB?o[0]:e[0],this.shaderKey=`binary_${t}_${this.lastDimensionSize}`,this.type="shared",this.workgroupSize=[256,1,1];else{let n=e.length>0&&e[e.length-1]%4===0,s=o.length>0&&o[o.length-1]%4===0;n&&s?(this.outputComponent=4,this.variableComponents=[4,4]):n&&(y.isScalarShape(o)||o[o.length-1]===1)||s&&(y.isScalarShape(e)||e[e.length-1]===1)?(this.outputComponent=4,this.variableComponents=n?[4,1]:[1,4]):(this.outputComponent=1,this.variableComponents=[1,1]),this.type="nonshared",this.shaderKey=`binary_${t}_${this.variableComponents}`,this.workgroupSize=[128,1,1]}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.outputComponent,1,1])}getUserCode(){let t,e=this.outputComponent===4?"vec4":"f32",o=` - fn binaryOperation(a : ${e}, b : ${e}) -> ${e} { - ${qc(this.op,this.outputComponent===4)} + `}};var Di=class{constructor(e,t,o){if(this.size=!0,this.variableNames=["A","B"],this.outputShape=C.assertAndGetBroadcastShape(t,o),this.dispatchLayout=X(this.outputShape),this.op=e,this.useSharedMemoryWithA=t.length<=1&&o.length>1&&t[0]<128,this.useSharedMemoryWithB=o.length<=1&&t.length>1&&o[0]<128,this.useSharedMemoryWithA||this.useSharedMemoryWithB)this.outputComponent=1,this.variableComponents=[1,1],this.lastDimensionSize=this.useSharedMemoryWithB?o[0]:t[0],this.shaderKey=`binary_${e}_${this.lastDimensionSize}`,this.type="shared",this.workgroupSize=[256,1,1];else{let n=t.length>0&&t[t.length-1]%4===0,s=o.length>0&&o[o.length-1]%4===0;n&&s?(this.outputComponent=4,this.variableComponents=[4,4]):n&&(y.isScalarShape(o)||o[o.length-1]===1)||s&&(y.isScalarShape(t)||t[t.length-1]===1)?(this.outputComponent=4,this.variableComponents=n?[4,1]:[1,4]):(this.outputComponent=1,this.variableComponents=[1,1]),this.type="nonshared",this.shaderKey=`binary_${e}_${this.variableComponents}`,this.workgroupSize=[128,1,1]}this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.outputComponent,1,1])}getUserCode(){let e,t=this.outputComponent===4?"vec4":"f32",o=` + fn binaryOperation(a : ${t}, b : ${t}) -> ${t} { + ${ec(this.op,this.outputComponent===4)} }; `;if(this.type==="shared"){let n=this.lastDimensionSize>1?`coords[${this.outputShape.length-1}]`:"0",s=this.useSharedMemoryWithB?`let a = getAByOutputIndex(index); let b = sharedBuf[${n}];`:`let a = sharedBuf[${n}]; - let b = getBByOutputIndex(index);`;t=` + let b = getBByOutputIndex(index);`;e=` ${o} var sharedBuf : array; ${G("index")} { @@ -5894,19 +5894,19 @@ return a / b;`,Wee=` setOutputAtIndex(index, binaryOperation(a, b)); } } - `}else t=` + `}else e=` ${o} ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index * ${this.outputComponent}); - let a = ${e}(getAByOutputCoords(coords)); - let b = ${e}(getBByOutputCoords(coords)); + let a = ${t}(getAByOutputCoords(coords)); + let b = ${t}(getBByOutputCoords(coords)); setOutputAtIndex(index, binaryOperation(a, b)); } } - `;return t}};function At(r){let{inputs:t}=r,{x:e}=t;return r.backend.incRef(e.dataId),{dataId:e.dataId,shape:e.shape,dtype:e.dtype}}var nz={kernelName:Co,backendName:"webgpu",kernelFunc:At};function xo(r){let{inputs:t,backend:e}=r,{real:o,imag:n}=t,s=e.makeTensorInfo(o.shape,"complex64"),a=e.tensorMap.get(s.dataId),i=At({inputs:{x:o},backend:e}),p=At({inputs:{x:n},backend:e});return a.complexTensorInfos={real:i,imag:p},s}var sz={kernelName:Ri,backendName:"webgpu",kernelFunc:xo};var Zr=class{constructor(t,e,o=""){this.variableNames=["A"],this.size=!0;let n=128;this.workgroupSize=[n,1,1],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.op=e,o!==""&&(this.uniforms=o),this.shaderKey=`unary_${e}`}getUserCode(){return` + `;return e}};function Pt(r){let{inputs:e}=r,{x:t}=e;return r.backend.incRef(t.dataId),{dataId:t.dataId,shape:t.shape,dtype:t.dtype}}var Xz={kernelName:vo,backendName:"webgpu",kernelFunc:Pt};function Uo(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.makeTensorInfo(o.shape,"complex64"),a=t.tensorMap.get(s.dataId),i=Pt({inputs:{x:o},backend:t}),p=Pt({inputs:{x:n},backend:t});return a.complexTensorInfos={real:i,imag:p},s}var Yz={kernelName:ei,backendName:"webgpu",kernelFunc:Uo};var so=class{constructor(e,t,o=""){this.variableNames=["A"],this.size=!0;let n=128;this.workgroupSize=[n,1,1],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.op=t,o!==""&&(this.uniforms=o),this.shaderKey=`unary_${t}`}getUserCode(){return` fn unaryOperation(a : f32) -> f32 { - ${wi(this.op,!1)} + ${Ri(this.op,!1)} } ${G("index")} { if (index < uniforms.size) { @@ -5914,23 +5914,23 @@ return a / b;`,Wee=` setOutputAtIndex(index, unaryOperation(a)); } } - `}};function ye({opType:r,cpuKernelImpl:t,dtype:e}){return({inputs:o,backend:n})=>{let{x:s}=o,a=n,i=e||s.dtype;if(a.shouldExecuteOnCPU([s])&&t!=null){let u=a.tensorMap.get(s.dataId),c=t(u.values,i);return a.makeTensorInfo(s.shape,i,c)}let p=new Zr(s.shape,r);return a.runWebGPUProgram(p,[s],i)}}function et({opType:r,cpuKernelImpl:t,supportsComplex:e=!1,dtype:o}){return({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(e&&a.dtype==="complex64"){let l=p.tensorMap.get(a.dataId),m=p.tensorMap.get(i.dataId),d,f;if(r!==fe.MUL)[d,f]=[[l.complexTensorInfos.real,m.complexTensorInfos.real],[l.complexTensorInfos.imag,m.complexTensorInfos.imag]].map(g=>{let[x,b]=g,C={dataId:x.dataId,dtype:x.dtype,shape:a.shape},S={dataId:b.dataId,dtype:b.dtype,shape:i.shape},k=new Si(r,a.shape,i.shape);return p.runWebGPUProgram(k,[C,S],dt(x.dtype,b.dtype))});else{let g=new fm(fe.COMPLEX_MULTIPLY_REAL,a.shape,i.shape),x=new fm(fe.COMPLEX_MULTIPLY_IMAG,a.shape,i.shape),b=[{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},{dataId:m.complexTensorInfos.real.dataId,dtype:m.complexTensorInfos.real.dtype,shape:i.shape},{dataId:m.complexTensorInfos.imag.dataId,dtype:m.complexTensorInfos.imag.dtype,shape:i.shape}];d=p.runWebGPUProgram(g,b,"float32"),f=p.runWebGPUProgram(x,b,"float32")}let h=xo({inputs:{real:d,imag:f},backend:p});return p.disposeData(d.dataId),p.disposeData(f.dataId),h}let u=o||dt(a.dtype,i.dtype);if((a.dtype==="string"||i.dtype==="string"||p.shouldExecuteOnCPU([a,i]))&&t!=null){let l=p.tensorMap.get(a.dataId).values,m=p.tensorMap.get(i.dataId).values,d=a.dtype==="string"?w.fromUint8ToStringArray(l):l,f=a.dtype==="string"?w.fromUint8ToStringArray(m):m,[h,g]=t(a.shape,i.shape,d,f,u);return p.makeTensorInfo(g,u,h)}let c=new Si(r,a.shape,i.shape);return p.runWebGPUProgram(c,[a,i],u)}}var{addImpl:az,castImpl:iz,ceilImpl:uz,concatImpl:pz,equalImpl:cz,expImpl:lz,expm1Impl:mz,floorImpl:dz,floorDivImpl:fz,gatherNdImpl:hz,gatherV2Impl:gz,greaterEqualImpl:xz,greaterImpl:yz,lessEqualImpl:bz,lessImpl:Cz,logImpl:wz,maxImpl:Sz,maximumImpl:Iz,minimumImpl:vz,multiplyImpl:kz,negImpl:Nz,notEqualImpl:Tz,prodImpl:_z,rangeImpl:$z,rsqrtImpl:Ez,scatterImpl:Rz,simpleAbsImpl:Dz,sliceImpl:Az,stridedSliceImpl:Fz,stringNGramsImpl:Pz,subImpl:Oz,tileImpl:Mz,topKImpl:Lz,transposeImpl:Bz,uniqueImpl:KPt}=wc;var Uie=ye({opType:Z.ABS,cpuKernelImpl:Dz}),zz={kernelName:Xs,backendName:"webgpu",kernelFunc:Uie};var Gie=ye({opType:Z.ACOS}),Vz={kernelName:Vo,backendName:"webgpu",kernelFunc:Gie};var Hie=ye({opType:Z.ACOSH}),Wz={kernelName:Wo,backendName:"webgpu",kernelFunc:Hie};var Kie=et({opType:fe.ADD,cpuKernelImpl:az,supportsComplex:!0}),Uz={kernelName:io,backendName:"webgpu",kernelFunc:Kie};var ex=class{constructor(t){this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t[0],this.variableNames=t.map((e,o)=>`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="addN"}getUserCode(){let t=[];this.variableNames.forEach(n=>{t.push(`let v${n} = get${n}ByOutputCoords(coords);`)});let e=this.variableNames.map(n=>`v${n}`).join(" + ");return` + `}};function ye({opType:r,cpuKernelImpl:e,dtype:t}){return({inputs:o,backend:n})=>{let{x:s}=o,a=n,i=t||s.dtype;if(a.shouldExecuteOnCPU([s])&&e!=null){let u=a.tensorMap.get(s.dataId),l=e(u.values,i);return a.makeTensorInfo(s.shape,i,l)}let p=new so(s.shape,r);return a.runWebGPUProgram(p,[s],i)}}function tt({opType:r,cpuKernelImpl:e,supportsComplex:t=!1,dtype:o}){return({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(t&&a.dtype==="complex64"){let c=p.tensorMap.get(a.dataId),m=p.tensorMap.get(i.dataId),d,f;if(r!==fe.MUL)[d,f]=[[c.complexTensorInfos.real,m.complexTensorInfos.real],[c.complexTensorInfos.imag,m.complexTensorInfos.imag]].map(g=>{let[x,b]=g,w={dataId:x.dataId,dtype:x.dtype,shape:a.shape},S={dataId:b.dataId,dtype:b.dtype,shape:i.shape},k=new Di(r,a.shape,i.shape);return p.runWebGPUProgram(k,[w,S],pt(x.dtype,b.dtype))});else{let g=new Im(fe.COMPLEX_MULTIPLY_REAL,a.shape,i.shape),x=new Im(fe.COMPLEX_MULTIPLY_IMAG,a.shape,i.shape),b=[{dataId:c.complexTensorInfos.real.dataId,dtype:c.complexTensorInfos.real.dtype,shape:a.shape},{dataId:c.complexTensorInfos.imag.dataId,dtype:c.complexTensorInfos.imag.dtype,shape:a.shape},{dataId:m.complexTensorInfos.real.dataId,dtype:m.complexTensorInfos.real.dtype,shape:i.shape},{dataId:m.complexTensorInfos.imag.dataId,dtype:m.complexTensorInfos.imag.dtype,shape:i.shape}];d=p.runWebGPUProgram(g,b,"float32"),f=p.runWebGPUProgram(x,b,"float32")}let h=Uo({inputs:{real:d,imag:f},backend:p});return p.disposeData(d.dataId),p.disposeData(f.dataId),h}let u=o||pt(a.dtype,i.dtype);if((a.dtype==="string"||i.dtype==="string"||p.shouldExecuteOnCPU([a,i]))&&e!=null){let c=p.tensorMap.get(a.dataId).values,m=p.tensorMap.get(i.dataId).values,d=a.dtype==="string"?C.fromUint8ToStringArray(c):c,f=a.dtype==="string"?C.fromUint8ToStringArray(m):m,[h,g]=e(a.shape,i.shape,d,f,u);return p.makeTensorInfo(g,u,h)}let l=new Di(r,a.shape,i.shape);return p.runWebGPUProgram(l,[a,i],u)}}var Lv={};qe(Lv,{addImpl:()=>hv,bincountImpl:()=>Jz,bincountReduceImpl:()=>eV,bitwiseAndImpl:()=>gv,castImpl:()=>fv,ceilImpl:()=>xv,concatImpl:()=>tV,equalImpl:()=>yv,expImpl:()=>bv,expm1Impl:()=>Cv,floorDivImpl:()=>Sv,floorImpl:()=>wv,gatherNdImpl:()=>rV,gatherV2Impl:()=>oV,greaterEqualImpl:()=>vv,greaterImpl:()=>Iv,lessEqualImpl:()=>Nv,lessImpl:()=>kv,linSpaceImpl:()=>nV,logImpl:()=>Tv,maxImpl:()=>sV,maximumImpl:()=>_v,minimumImpl:()=>Ev,multiplyImpl:()=>km,negImpl:()=>aV,notEqualImpl:()=>$v,prodImpl:()=>iV,raggedGatherImpl:()=>pV,raggedRangeImpl:()=>cV,raggedTensorToTensorImpl:()=>fV,rangeImpl:()=>hV,rsqrtImpl:()=>Av,scatterImpl:()=>gV,sigmoidImpl:()=>xV,simpleAbsImpl:()=>Qz,sliceImpl:()=>yV,sparseFillEmptyRowsImpl:()=>bV,sparseReshapeImpl:()=>CV,sparseSegmentReductionImpl:()=>wV,sqrtImpl:()=>SV,squaredDifferenceImpl:()=>Fv,staticRegexReplaceImpl:()=>Pv,stridedSliceImpl:()=>IV,stringNGramsImpl:()=>vV,stringSplitImpl:()=>kV,stringToHashBucketFastImpl:()=>NV,subImpl:()=>Mv,tileImpl:()=>TV,topKImpl:()=>EV,transposeImpl:()=>Rv,uniqueImpl:()=>$V});function Ai(r,e){Array.isArray(r)||(r=[r]),r.forEach(t=>{t!=null&&y.assert(t.dtype!=="complex64",()=>`${e} does not support complex64 tensors in the CPU backend.`)})}function Qz(r){let e=new Float32Array(r.length);for(let t=0;t{let a=C.assertAndGetBroadcastShape(e,t),i=a.length,p=y.computeStrides(a),u=y.sizeFromShape(a),l=y.getTypedArrayFromDType(s,u),c=e.length,m=t.length,d=y.computeStrides(e),f=y.computeStrides(t),h=C.getBroadcastDims(e,a),g=C.getBroadcastDims(t,a);if(h.length+g.length===0)for(let x=0;xw[E]=0);let S=y.locToIndex(w,c,d),k=b.slice(-m);g.forEach(E=>k[E]=0);let T=y.locToIndex(k,m,f);l[x]=r(o[S],n[T])}return[l,a]}}function tc(r){let{inputs:e,backend:t}=r,{real:o,imag:n}=e,s=t.data.get(o.dataId).values,a=t.data.get(n.dataId).values,i=t.makeTensorInfo(o.shape,"complex64"),p=t.data.get(i.dataId);return p.complexTensorInfos={real:t.makeTensorInfo(o.shape,"float32",s),imag:t.makeTensorInfo(n.shape,"float32",a)},i}function mx(r,e,t="float32"){if(t==="complex64"){let n=mx(r,e,"float32"),s=mx(r,e,"float32");return tc({inputs:{real:n,imag:s},backend:r})}let o=y.makeZerosTypedArray(y.sizeFromShape(e),t);return r.makeTensorInfo(e,t,o)}function dv(r){let{inputs:e,backend:t}=r,{x:o}=e;return t.incRef(o.dataId),{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function Zz(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.data.get(o.dataId).complexTensorInfos.real,s=t.data.get(n.dataId).values;return t.makeTensorInfo(n.shape,n.dtype,s)}function fv(r,e,t,o){if(o==="int32"){let n=Int32Array.from(r);return[e,"int32",n]}if(o==="bool"){let n=y.toTypedArray([0],t),[s,a]=ht((i,p)=>i!==p?1:0)(e,[],r,n,"bool");return[a,"bool",s]}throw new Error(`Error in Cast: failed to cast ${t} to ${o}`)}function vm(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s==="complex64"){if(n.dtype==="complex64")return dv({inputs:{x:n},backend:t});let l=mx(t,n.shape,n.dtype),c=vm({inputs:{x:n},backend:t,attrs:{dtype:"float32"}}),m=tc({inputs:{real:c,imag:l},backend:t});return t.disposeIntermediateTensorInfo(l),t.disposeIntermediateTensorInfo(c),m}if(n.dtype==="complex64"){let l=Zz({inputs:{input:n},backend:t}),c=vm({inputs:{x:l},backend:t,attrs:{dtype:s}});return t.disposeIntermediateTensorInfo(l),c}if(!y.hasEncodingLoss(n.dtype,s)){let l=dv({inputs:{x:n},backend:t});return{dataId:l.dataId,shape:l.shape,dtype:s}}let a=t.data.get(n.dataId).values,[i,p,u]=fv(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}function wt(r,e,t,o){return t==null?({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;Ai([a,i],r);let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=a.dtype==="string"?C.fromUint8ToStringArray(u):u,m=a.dtype==="string"?C.fromUint8ToStringArray(l):l,d=o||a.dtype,[f,h]=e(a.shape,i.shape,c,m,d);return p.makeTensorInfo(h,d,f)}:({inputs:n,backend:s})=>{let{a,b:i}=n,p=s;if(a.dtype==="complex64"||i.dtype==="complex64"){let u=vm({inputs:{x:a},backend:p,attrs:{dtype:"complex64"}}),l=p.data.get(u.dataId),c=l.complexTensorInfos.real,m=l.complexTensorInfos.imag,d=p.data.get(c.dataId).values,f=p.data.get(m.dataId).values,h=vm({inputs:{x:i},backend:p,attrs:{dtype:"complex64"}}),g=p.data.get(h.dataId),x=g.complexTensorInfos.real,b=g.complexTensorInfos.imag,w=p.data.get(x.dataId).values,S=p.data.get(b.dataId).values,[k,T,E]=t(a.shape,i.shape,d,f,w,S),R=p.makeTensorInfo(E,"float32",k),D=p.makeTensorInfo(E,"float32",T),F=tc({inputs:{real:R,imag:D},backend:p});return p.disposeIntermediateTensorInfo(u),p.disposeIntermediateTensorInfo(h),p.disposeIntermediateTensorInfo(R),p.disposeIntermediateTensorInfo(D),F}else{let u=p.data.get(a.dataId).values,l=p.data.get(i.dataId).values,c=o||a.dtype,[m,d]=e(a.shape,i.shape,u,l,c);return p.makeTensorInfo(d,c,m)}}}function rc(r){return(e,t,o,n,s,a)=>{let i=C.assertAndGetBroadcastShape(e,t),p=y.sizeFromShape(i),u=i.length,l=y.computeStrides(i),c=y.getTypedArrayFromDType("float32",p),m=y.getTypedArrayFromDType("float32",p),d=C.getBroadcastDims(e,i),f=C.getBroadcastDims(t,i),h=C.mergeRealAndImagArrays(o,n),g=C.mergeRealAndImagArrays(s,a),x=e.length,b=y.computeStrides(e),w=t.length,S=y.computeStrides(t);if(d.length+f.length===0)for(let k=0;kE[M]=0);let R=y.locToIndex(E,x,b),D=T.slice(-w);f.forEach(M=>D[M]=0);let F=y.locToIndex(D,w,S),O=r(h[R*2],h[R*2+1],g[F*2],g[F*2+1]);c[k]=O.real,m[k]=O.imag}return[c,m,i]}}var hv=ht((r,e)=>r+e),gpe=rc((r,e,t,o)=>({real:r+t,imag:e+o})),uLt=wt(Rr,hv,gpe);function Jz(r,e,t,o,n){let s=y.sizeFromShape(o),a=y.makeZerosTypedArray(n,t);for(let i=0;i=n||(s>0?a[p]+=e[i]:a[p]+=1)}return a}function eV(r,e,t,o=!1){let n=r.shape[0],s=r.shape[1],a=ie([n,t],e.dtype);for(let i=0;i=t||(o?a.set(1,i,u):e.size>0?a.set(a.get(i,u)+e.get(i,p),i,u):a.set(a.get(i,u)+1,i,u))}return a}var gv=ht((r,e)=>r&e),hLt=wt(_n,gv);function Qt(r){return(e,t,o)=>{let n=y.getArrayFromDType(t,e.length);for(let s=0;s{let{x:a}=o;Ai(a,r);let i=s,p=i.data.get(a.dataId).values,u;if(a.dtype==="string"){if(!Array.isArray(p))throw new Error("String tensor's value was not an instance of Array");u=C.fromUint8ToStringArray(p)}else u=p;let l=t||a.dtype,c=e(u,l,n);return i.makeTensorInfo(a.shape,l,c)}}var xv=Qt(r=>Math.ceil(r)),NLt=Wr(go,xv);function tV(r,e,t,o){let n=y.getArrayFromDType(t,y.sizeFromShape(e));if(o&&t!=="string"){let s=0;r.forEach(a=>{let i=y.sizeFromShape(a.shape);n.set(a.vals,s),s+=i})}else{let s=0;r.forEach(a=>{let i=t==="string"?C.fromUint8ToStringArray(a.vals):a.vals,p=0;for(let u=0;ur===e?1:0),ALt=wt(xo,yv,null,"bool");var bv=Qt(r=>Math.exp(r)),LLt=Wr(yo,bv,"float32");var Cv=Qt(r=>Math.expm1(r)),ULt=Wr(bo,Cv);var wv=Qt(r=>Math.floor(r)),jLt=Wr(Co,wv);var Sv=ht((r,e)=>Math.floor(r/e)),JLt=wt(wo,Sv,null,"int32");function rV(r,e,t,o,n,s,a,i,p){let u=ie([o,s],t);for(let l=0;l=p/s)throw new Error(`Invalid indices: ${c} does not index into ${i}`);for(let d=0;dr>e?1:0),uBt=wt(So,Iv,null,"bool");var vv=ht((r,e)=>r>=e?1:0),dBt=wt(Io,vv,null,"bool");var kv=ht((r,e)=>rr<=e?1:0),IBt=wt(No,Nv,null,"bool");function nV(r,e,t){let o=(e-r)/(t-1),n=y.makeZerosTypedArray(t,"float32");n[0]=r;for(let s=1;sMath.log(r)),$Bt=Wr(To,Tv);function sV(r,e,t,o){let n=y.getTypedArrayFromDType(o,y.sizeFromShape(t));for(let s=0;si)&&(i=u)}n[s]=i}return n}var _v=ht((r,e)=>Math.max(r,e)),MBt=wt(_o,_v);var Ev=ht((r,e)=>Math.min(r,e)),WBt=wt(Eo,Ev);var km=ht((r,e)=>r*e),xpe=rc((r,e,t,o)=>({real:r*t-e*o,imag:r*o+e*t})),qBt=wt($o,km,xpe);function aV(r,e,t){let o=y.createScalarValue(-1,t);return km([],e,o,r,t)}var $v=ht((r,e)=>r!==e?1:0),rzt=wt(Ro,$v,null,"bool");function Rv(r,e,t,o,n){let s=e.length,a=y.sizeFromShape(e),i=y.computeStrides(e),p=y.computeStrides(n),u=y.getTypedArrayFromDType(t,y.sizeFromShape(n));for(let l=0;l{if(o<0||o>=t){let s=y.indexToLoc(n,e.length,y.computeStrides(e)).join(",");throw new Error(`indices[${s}] = ${o} is not in [0, ${t})`)}})}function bpe(r,e){for(let t=0;tn)throw new Error("Ragged splits must not point past values");for(let s=1;so[s])throw new Error("Ragged splits must be sorted in ascending order")}}function Cpe(r,e,t,o){let n=[],s=0,a=e.length-1+t.length,i=new Array(a).fill(null).map(()=>[0]);bpe(t,o);let p=1;for(let u=0;u=0){let h=i[f],g=h[h.length-1]-d[l];for(let x=l;xn[a]=s)}return e}function uV(r,e){let t=r.slice(0,e);for(;t.length1)throw new Error("starts must be a scalar or vector");if(n.length>1)throw new Error("limits must be a scalar or vector");if(a.length>1)throw new Error("deltas must be a scalar or vector");let i=e.length===0,p=n.length===0,u=a.length===0,l=[];i||l.push(e[0]),p||l.push(n[0]),u||l.push(a[0]);for(let g=1;g0&&bx)S=0;else if(S=Math.ceil(Math.abs((b-x)/w)),S>lV)throw new Error(`Requires ((limit - start) / delta) <= ${lV}`);m[g+1]=m[g]+S}let d=m[c],f=y.getArrayFromDType(t,d),h=0;for(let g=0;go&&(o=s)}return o}static getMaxWidthValueRowID(e){let t=e.length;if(t===0)return 0;let o=0,n=e[0],s=0;for(let a=1;a"Final length of result must be equal to firstDimension."),s}calculateOutputIndexRowSplit(e,t,o,n){let s=e.length,a=[];for(let i=0;i0&&a.length!==e[s-1])throw new Error("Invalid row split size.");return a}calculateOutputIndexValueRowID(e,t,o,n){let s=e.length,a=[];if(s===0)return[];let i=0,p=e[0];if(p>=t.length)throw new Error(`Got currentValueRowId=${p}, which is not less than ${t.length}`);let u=t[p];a.push(u);for(let l=1;l=0&&(++i,i=t.length)throw new Error(`Got nextValueRowId=${c} which is not less than ${t.length}`);u=t[c]}a.push(u)}if(a.length!==e.length)throw new Error("Invalid row ids.");return a}calculateOutputIndex(e,t,o,n){let s=this.getRowPartitionTensor(e),a=this.getRowPartitionTypeByDimension(e);switch(a){case ln.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,t,o,n);case ln.ROW_SPLITS:if(s.length-1>t.length)throw new Error(`Row partition size is greater than output size: ${s.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(s,t,o,n);default:throw new Error(`Unsupported partition type: ${ln[a]}`)}}getFirstDimensionSize(){let e=this.rowPartitionValues[0];if(this.rowPartitionTypes.length===0)throw new Error("No row_partition_types given.");let t=this.rowPartitionTypes[0];switch(t){case ln.FIRST_DIM_SIZE:return e[0];case ln.VALUE_ROWIDS:throw new Error("Cannot handle VALUE_ROWIDS in first dimension.");case ln.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw new Error(`Cannot handle type ${ln[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw new Error("Invalid first partition input. Tensor requires at least one element.");let t=this.getFirstDimensionSize(),o=this.calculateOutputSize(t),n=new Array(this.raggedRank+1);n[n.length-1]=1;for(let p=n.length-2;p>=0;--p)n[p]=n[p+1]*o[p+1];let s=dV(o,!1),a=y.getArrayFromDType(this.valuesDType,y.sizeFromShape(s));if(n[0]*o[0]>0){let p=this.calculateFirstParentOutputIndex(t,n[0],o[0]);for(let u=1;u<=this.raggedRank;++u)p=this.calculateOutputIndex(u-1,p,n[u],o[u]);this.setOutput(this.raggedRank,p,a,s)}return[s,a]}setOutput(e,t,o,n){if(o.length===0)return;let s=this.values,a=o,i=n.slice();i=i.slice(e+1);let p=y.sizeFromShape(i),u=t.length,l=this.defaultValue;if(l.length!==p&&l.length!==1){let f=this.defaultValueShape;De(()=>{let h=W(l,f);l=Oa(h,i).dataSync()})}let c=0,m=0,d=0;for(let f=0;f<=u;++f){let h=f=u){let g=o.length;h=Math.floor(g/p)}if(h>d)if(this.defaultValue.length===1)a.subarray(d*p,h*p).fill(this.defaultValue[0]),d=h;else for(;h>d;){let g=a.slice(d*p);mV(g,l,p),++d}h<0?(c=f+1,m=d):(c=f,m=d,d=m+1)}}};function mV(r,e,t){for(let o=0;o= 0`);if(o<-1)throw new Error(`Dimension ${o} must be >= -1`);o=-1}t.push(o)}return t}function fV(r,e,t,o,n,s,a,i,p,u){return new Dv(r,e,t,o,n,s,a,i,p,u).compute()}function hV(r,e,t,o){let n=r===e,s=r1;if(n||s||a)return y.makeZerosTypedArray(0,o);let i=Math.abs(Math.ceil((e-r)/t)),p=y.makeZerosTypedArray(i,o);e1/Math.sqrt(r)),Nzt=Wr(Do,Av);function gV(r,e,t,o,n,s,a,i,p,u){let l=[o/n,n],c=r.values,m=e.values;if(o===0)return ie(t,e.dtype);let d=p instanceof Ge?p:ie(l,e.dtype);typeof p=="string"||typeof p=="number"?d.values.fill(p):typeof p=="boolean"&&d.values.fill(+p);for(let f=0;f=o/n)throw new Error(`Invalid indices: ${h} does not index into ${t}`);for(let x=0;x1/(1+Math.exp(-r))),Azt=dx(Ao,r=>1/(1+Math.exp(-r)));function yV(r,e,t,o,n){let s=nt.isSliceContinous(o,e,t),a=y.sizeFromShape(t),i=y.computeStrides(o);if(s){let c=nt.computeFlatOffset(e,i);return n==="string"?r.slice(c,c+a):r.subarray(c,c+a)}let p=n==="string"?C.fromUint8ToStringArray(r):r,u=ie(o,n,p),l=ie(t,n);for(let c=0;cf+e[h]);l.set(u.get(...d),...m)}return n==="string"?C.fromStringArrayToUint8(l.values):l.values}function bV(r,e,t,o,n,s,a){let i=e[0],p=s[0],u=new Array(p),l=new Array(i),c=e[1];if(p===0){if(i!==0)throw new Error(C.getSparseFillEmptyRowsIndicesDenseShapeMismatch(i));let g=y.getArrayFromDType(t,0),x=y.getArrayFromDType(n,0);return[g,[0,c],x,u,l]}let m=!0,d=0,f=new Array(p).fill(0);for(let g=0;g=p)throw new Error(C.getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(g,x,p));++f[x],m=m&&x>=d,d=x}let h=!0;for(let g=0;g0&&(f[g]+=f[g-1])}if(h&&m){let g=r,x=o;for(let b=0;b0){d[m-1]=1;for(let g=m-2;g>=0;--g)d[g]=d[g+1]*o[g+1]}let f=[];if(i>0){f[i-1]=1;for(let g=i-2;g>=0;--g)f[g]=f[g+1]*p[g+1]}let h=y.getArrayFromDType(t,a*i);for(let g=0;g0?n[i-1]+1:0;if(c<0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let m=e.slice();m[0]=c;let d=m.reduce((w,S)=>w*S,1),f=y.getArrayFromDType(t,d);if(i===0)return c>0&&f.fill(a),[f,m];if(c<=0)throw new Error(C.getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let h=0,g=1,x=0,b=n[h];for(;;){let w=0;if(g=w)throw new Error(C.getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(b<0||b>=c)throw new Error(C.getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(b,c));b>x&&f.fill(a,x*u,b*u);for(let S=h;S=p[0])throw new Error(C.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(S,o[S],p[0]));for(let T=0;Ti)break}return xMath.sqrt(r)),qzt=dx(Fo,r=>Math.sqrt(r));var Fv=ht((r,e)=>{let t=r-e;return t*t}),Zzt=wt(Po,Fv);var Pv=Qt((r,e)=>{let{pattern:t,replaceGlobal:o,rewrite:n}=e;return r.replace(new RegExp(t,o?"g":""),n)}),oVt=Wr(pi,Pv);function IV(r,e,t,o){let n=ie(r,e.dtype);for(let s=0;s0?0:i-p),d=0;d+=u*this.leftPad.length;for(let b=0;bb.forEach(w=>h[g++]=w);for(let b=0;b0){x(e[m+c-1]);for(let b=0;b0){let p=t[0];if(p!==0)throw new Error(`First split value must be 0, got ${p}`);for(let u=1;u=p;if(l=l&&t[u]<=o,!l)throw new Error(`Invalid split value ${t[u]}, must be in [${p}, ${o}]`);p=t[u]}if(p!==o)throw new Error(`Last split value must be data size. Expected ${o}, got ${p}`)}let s=n-1,a=y.getArrayFromDType("int32",n);if(o===0||n===0){let p=new Array(o);for(let u=0;u<=s;++u)a[u]=0;return[p,a]}a[0]=0;for(let p=1;p<=s;++p){let u=t[p]-t[p-1],l=0;this.nGramWidths.forEach(c=>{l+=this.getNumNGrams(u,c)}),this.preserveShort&&u>0&&l===0&&(l=1),a[p]=a[p-1]+l}let i=new Array(a[s]);for(let p=0;p{let m=t[p+1]-t[p],d=this.getNumNGrams(m,c);this.createNGrams(e,u,i,l,d,c),l+=d}),this.preserveShort&&l===a[p]){let c=t[p+1]-t[p];if(c===0)continue;let m=c+2*this.padWidth;this.createNGrams(e,u,i,l,1,m)}}return[i,a]}};function vV(r,e,t,o,n,s,a,i){return new Ov(t,o,n,s,a,i).compute(r,e)}function vpe(r,e,t,o){if(!r.length)return;if(e.length===0){for(let s=0;sr-e),kpe=rc((r,e,t,o)=>({real:r-t,imag:e-o})),gVt=wt(Oo,Mv,kpe);function TV(r,e){let t=new Array(r.rank);for(let n=0;n{let t=e.value-r.value;return t===0?r.index-e.index:t};function _V(r,e,t=0,o=r.length-1){for(;o>t;){if(o-t>600){let i=o-t+1,p=e-t+1,u=Math.log(i),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(i-l)/i)*Math.sign(p-i/2),m=Math.max(t,Math.floor(e-p*l/i+c)),d=Math.min(o,Math.floor(e+(i-p)*l/i+c));_V(r,e,m,d)}let n=r[e],s=t,a=o;for(y.swap(r,t,e),Nm(r[o],n)>0&&y.swap(r,t,o);s0;)a=a-1}Nm(r[t],n)===0?y.swap(r,t,a):(a=a+1,y.swap(r,a,o)),a<=e&&(t=a+1),e<=a&&(o=a-1)}}function EV(r,e,t,o,n){let s=e[e.length-1],[a,i]=[r.length/s,s],p=y.getTypedArrayFromDType(t,a*o),u=y.getTypedArrayFromDType("int32",a*o);for(let c=0;cf[w]={value:b,index:w}),o{for(let g=0;g`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="addN"}getUserCode(){let e=[];this.variableNames.forEach(n=>{e.push(`let v${n} = get${n}ByOutputCoords(coords);`)});let t=this.variableNames.map(n=>`v${n}`).join(" + ");return` ${G("index")} { for (var i = 0; i < ${this.workPerThread}; i = i + 1) { let flatIndex = index * ${this.workPerThread} + i; if (flatIndex < uniforms.size) { let coords = getCoordsFromIndex(flatIndex); - ${t.join(` + ${e.join(` `)} - setOutputAtIndex(flatIndex, ${e}); + setOutputAtIndex(flatIndex, ${t}); } } } - `}};function qie(r){let{inputs:t,backend:e}=r,o=t;if(o.length===1)return At({inputs:{x:o[0]},backend:e});let n=o.map(i=>i.dtype).reduce((i,p)=>dt(i,p)),s=o.map(i=>i.shape),a=new ex(s);return e.runWebGPUProgram(a,o,n)}var Gz={kernelName:Uo,backendName:"webgpu",kernelFunc:qie};var tx=class{constructor(t,e){this.variableNames=["A"],this.workgroupSize=[16,16,1];let o=new Array(t.length);for(let n=0;n`Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`);let t=this.workgroupSize[0];return` + `}};function $pe(r){let{inputs:e,backend:t}=r,o=e;if(o.length===1)return Pt({inputs:{x:o[0]},backend:t});let n=o.map(i=>i.dtype).reduce((i,p)=>pt(i,p)),s=o.map(i=>i.shape),a=new fx(s);return t.runWebGPUProgram(a,o,n)}var hW={kernelName:xn,backendName:"webgpu",kernelFunc:$pe};var hx=class{constructor(e,t){this.variableNames=["A"],this.workgroupSize=[16,16,1];let o=new Array(e.length);for(let n=0;n`Must be a square tile, current tile shape is ${this.workgroupSize[0]} x ${this.workgroupSize[1]}`);let e=this.workgroupSize[0];return` var tile : array, ${this.workgroupSize[0]}>; ${G()} { - var x = i32(workgroupId.x) * ${t} + i32(localId.x); - var y = i32(workgroupId.y) * ${t} + i32(localId.y); + var x = i32(workgroupId.x) * ${e} + i32(localId.x); + var y = i32(workgroupId.y) * ${e} + i32(localId.y); let width = uniforms.outShape[0]; let height = uniforms.outShape[1]; if (x < width && y < height) { @@ -5938,29 +5938,29 @@ return a / b;`,Wee=` } workgroupBarrier(); - x = i32(workgroupId.y) * ${t} + i32(localId.x); - y = i32(workgroupId.x) * ${t} + i32(localId.y); + x = i32(workgroupId.y) * ${e} + i32(localId.x); + y = i32(workgroupId.x) * ${e} + i32(localId.y); if (x < height && y < width) { setOutputAtIndex((y * height + x), tile[localId.x] [localId.y]); } } - `}};var rx=class{constructor(t,e){this.variableNames=["A"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0;let o=new Array(t.length);for(let n=0;n6)throw Error(`Transpose for rank ${t} is not yet supported`);let e=new Array(t);for(let o=0;o=32768&&o>=512?this.workgroupSize=[512,1,1]:t.inSize>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1]),this.reduceType=e,this.shaderKey=`reduce_${e}`}getUserCode(){let t="",e="0.0",o=this.workgroupSize[0];this.reduceType==="min"||this.reduceType==="max"?(t=` + `}};function Bv(r){let e=r.length;if(e>6)throw Error(`Transpose for rank ${e} is not yet supported`);let t=new Array(e);for(let o=0;o=32768&&o>=512?this.workgroupSize=[512,1,1]:e.inSize>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1]),this.reduceType=t,this.shaderKey=`reduce_${t}`}getUserCode(){let e="",t="0.0",o=this.workgroupSize[0];this.reduceType==="min"||this.reduceType==="max"?(e=` if (isnan(candidate)) { bestValue = uniforms.NAN; } else if (!isnan(bestValue) && candidate ${this.reduceType==="min"?"<":">"} bestValue) - { bestValue = candidate; }`,e="f32(x[offset])"):this.reduceType==="sum"||this.reduceType==="mean"?t=" bestValue = bestValue + candidate; ":this.reduceType==="prod"?(t=" bestValue = bestValue * candidate; ",e="1.0"):this.reduceType==="all"?(t=" bestValue = f32(bestValue >= 1.0 && candidate >= 1.0); ",e="1.0"):this.reduceType==="any"&&(t=" bestValue = f32(bestValue >= 1.0 || candidate >= 1.0); ",e="0.0");let n=this.reduceType==="mean"?"setOutputAtIndex(outputIndex, bestValue / f32(uniforms.reduceSize));":"setOutputAtIndex(outputIndex, bestValue);";return` + { bestValue = candidate; }`,t="f32(x[offset])"):this.reduceType==="sum"||this.reduceType==="mean"?e=" bestValue = bestValue + candidate; ":this.reduceType==="prod"?(e=" bestValue = bestValue * candidate; ",t="1.0"):this.reduceType==="all"?(e=" bestValue = f32(bestValue >= 1.0 && candidate >= 1.0); ",t="1.0"):this.reduceType==="any"&&(e=" bestValue = f32(bestValue >= 1.0 || candidate >= 1.0); ",t="0.0");let n=this.reduceType==="mean"?"setOutputAtIndex(outputIndex, bestValue / f32(uniforms.reduceSize));":"setOutputAtIndex(outputIndex, bestValue);";return` fn DIV_CEIL(a : u32, b : u32) -> u32 { return ((a - 1u) / b + 1u); } @@ -5976,13 +5976,13 @@ return a / b;`,Wee=` ${G("index")} { let outputIndex = index / ${o}; let offset = getOffset(outputIndex); - var bestValue = ${e}; + var bestValue = ${t}; let Length = uniforms.reduceSize; let WorkPerThread = DIV_CEIL(u32(Length), ${o}u); for (var k = i32(localId.x); k < Length && outputIndex < uniforms.size; k = k + ${o}) { let candidate = f32(x[offset + k]); - ${t} + ${e} } xBestValues[localId.x] = bestValue; workgroupBarrier(); @@ -5993,7 +5993,7 @@ return a / b;`,Wee=` let interval = DIV_CEIL(reduceSize, 2u); if (localId.x < currentSize) { let candidate = xBestValues[localId.x + interval]; - ${t} + ${e} xBestValues[localId.x] = bestValue; } reduceSize = interval; @@ -6004,25 +6004,25 @@ return a / b;`,Wee=` ${n} } } - `}};var jie={mean:"float32",all:"bool",any:"bool"};function Jr(r,t,e,o,n){let s=r.shape.length,a=[],i=y.parseAxisParam(t,r.shape),p=i,u=w.getAxesPermutation(p,s),c=r;u!=null&&(c=xr({inputs:{x:r},attrs:{perm:u},backend:n}),p=w.getInnerMostAxes(p.length,s),a.push(c)),w.assertAxesAreInnerMostDims(o,p,s);let[l,m]=w.computeOutAndReduceShapes(c.shape,p),d=l;e&&(d=w.expandShapeToKeepDim(l,i));let f;if((o==="max"||o==="prod")&&n.shouldExecuteOnCPU([c])){let h=n.tensorMap.get(c.dataId).values;switch(o){case"max":let g=Sz(h,y.sizeFromShape(m),d,r.dtype);f=n.makeTensorInfo(d,r.dtype,g);break;case"prod":let{outVals:x,outShape:b,outDtype:C}=_z(c.shape,c.dtype,h,p);f=n.makeTensorInfo(b,C,x);break;default:throw new Error(`${o} CPU implementation is not yet supported.`)}}else{let h=y.sizeFromShape(m),x=y.sizeFromShape(c.shape)/h,b={windowSize:h,inSize:h,batchSize:x,outSize:1},C=jie[o]||oi(r.dtype),S=[{type:"int32",data:[h]}],k=new ox(b,o,n.device.limits.maxComputeWorkgroupSizeX),_=n.runWebGPUProgram(k,[c],C,S);a.push(_),f=pe({inputs:{x:_},attrs:{shape:d},backend:n})}return a.forEach(h=>n.disposeData(h.dataId)),f}function Xie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{keepDims:s,axis:a}=o;return Jr(n,a,s,"all",e)}var Kz={kernelName:Go,backendName:"webgpu",kernelFunc:Xie};function Yie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{keepDims:s,axis:a}=o;return Jr(n,a,s,"any",e)}var qz={kernelName:Ho,backendName:"webgpu",kernelFunc:Yie};var jc=class{constructor(t,e,o){this.workgroupSize=[64,1,1],this.variableNames=["x"],this.uniforms="infinityValue : f32,",this.size=!0;let n=[e];this.op=o==="min"?"<":">";let[s,a]=w.computeOutAndReduceShapes(t,n);this.outputShape=s.length===0?[1]:s,this.dispatchLayout=X(this.outputShape),y.sizeFromShape(a)<32?(this.type="plain",this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)):(this.type="shared",this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1])),this.inputShape=t,this.shaderKey=`argMinMax_${this.op}_${this.type}`}getUserCode(){let t=this.workgroupSize[0],e=()=>this.inputShape.length===1?"uniforms.xShape":`uniforms.xShape.${Oo(this.inputShape.length-1)}`,o=()=>{let n="";if(this.outputShape.length===1)this.inputShape.length!==1&&(n+="outputCoords,");else for(let s=0;sn.disposeData(h.dataId)),f}function Dpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{keepDims:s,axis:a}=o;return ao(n,a,s,"all",t)}var xW={kernelName:yn,backendName:"webgpu",kernelFunc:Dpe};function Ape(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{keepDims:s,axis:a}=o;return ao(n,a,s,"any",t)}var yW={kernelName:bn,backendName:"webgpu",kernelFunc:Ape};var oc=class{constructor(e,t,o){this.workgroupSize=[64,1,1],this.variableNames=["x"],this.uniforms="infinityValue : f32,",this.size=!0;let n=[t];this.op=o==="min"?"<":">";let[s,a]=C.computeOutAndReduceShapes(e,n);this.outputShape=s.length===0?[1]:s,this.dispatchLayout=X(this.outputShape),y.sizeFromShape(a)<32?(this.type="plain",this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)):(this.type="shared",this.dispatch=H(this.dispatchLayout,this.outputShape,[1,1,1])),this.inputShape=e,this.shaderKey=`argMinMax_${this.op}_${this.type}`}getUserCode(){let e=this.workgroupSize[0],t=()=>this.inputShape.length===1?"uniforms.xShape":`uniforms.xShape.${un(this.inputShape.length-1)}`,o=()=>{let n="";if(this.outputShape.length===1)this.inputShape.length!==1&&(n+="outputCoords,");else for(let s=0;s u32 { return ((a - 1u) / b + 1u); } ${` - var xBestIndices : array; - var xBestValues : array; + var xBestIndices : array; + var xBestValues : array; `} ${G("index")} { - let outputIndex = index / ${t}; - let reduceLength = ${e()}; + let outputIndex = index / ${e}; + let reduceLength = ${t()}; var bestIndex = i32(localId.x); var bestValue = uniforms.infinityValue; let outputCoords = getCoordsFromIndex(outputIndex); for (var k = i32(localId.x); k < reduceLength && outputIndex < uniforms.size; - k = k + ${t}) { + k = k + ${e}) { let candidate = getX(${o()} k); if (!isnan(candidate) && candidate ${this.op} bestValue) { bestValue = candidate; @@ -6033,7 +6033,7 @@ return a / b;`,Wee=` xBestIndices[localId.x] = bestIndex; workgroupBarrier(); - var reduceSize = min(u32(reduceLength), ${t}u); + var reduceSize = min(u32(reduceLength), ${e}u); for (var currentSize = reduceSize / 2u; reduceSize > 1u; currentSize = reduceSize / 2u) { let interval = DIV_CEIL(reduceSize, 2u); @@ -6059,7 +6059,7 @@ return a / b;`,Wee=` let outputCoords = getCoordsFromIndex(index); var bestIndex = 0; var bestValue = getX(${o()} 0); - let reduceLength = ${e()}; + let reduceLength = ${t()}; for (var i = 1; i < reduceLength; i++) { let candidate = getX(${o()} i); if (candidate ${this.op} bestValue) { @@ -6070,7 +6070,7 @@ return a / b;`,Wee=` setOutputAtIndexI32(index, bestIndex); } } - `}};function Qie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=xr({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims("argMax",[a[0]],p.shape.length);let c=new jc(p.shape,a[0],"max"),l=[{type:"float32",data:[Number.NEGATIVE_INFINITY]}],m=e.runWebGPUProgram(c,[p],"int32",l);return u.forEach(d=>e.disposeData(d.dataId)),m}var jz={kernelName:Ys,backendName:"webgpu",kernelFunc:Qie};function Zie(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=w.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=xr({inputs:{x:n},backend:e,attrs:{perm:i}}),u.push(p),a=w.getInnerMostAxes(a.length,p.shape.length)),w.assertAxesAreInnerMostDims("argMin",[a[0]],p.shape.length);let c=new jc(p.shape,a[0],"min"),l=[{type:"float32",data:[Number.POSITIVE_INFINITY]}],m=e.runWebGPUProgram(c,[p],"int32",l);return u.forEach(d=>e.disposeData(d.dataId)),m}var Xz={kernelName:Qs,backendName:"webgpu",kernelFunc:Zie};var Jie=ye({opType:Z.ASIN}),Yz={kernelName:Ko,backendName:"webgpu",kernelFunc:Jie};var eue=ye({opType:Z.ASINH}),Qz={kernelName:qo,backendName:"webgpu",kernelFunc:eue};var tue=ye({opType:Z.ATAN}),Zz={kernelName:jo,backendName:"webgpu",kernelFunc:tue};var rue=et({opType:fe.ATAN2}),Jz={kernelName:Yo,backendName:"webgpu",kernelFunc:rue};var oue=ye({opType:Z.ATANH}),eV={kernelName:Xo,backendName:"webgpu",kernelFunc:oue};var nx=class{constructor(t){this.variableNames=["x"],this.uniforms="strides : vec2,",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="poolWithFilterSizeEqualsOne"}getUserCode(){return` + `}};function Fpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Cr({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims("argMax",[a[0]],p.shape.length);let l=new oc(p.shape,a[0],"max"),c=[{type:"float32",data:[Number.NEGATIVE_INFINITY]}],m=t.runWebGPUProgram(l,[p],"int32",c);return u.forEach(d=>t.disposeData(d.dataId)),m}var bW={kernelName:na,backendName:"webgpu",kernelFunc:Fpe};function Ppe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s}=o,a=y.parseAxisParam(s,n.shape),i=C.getAxesPermutation(a,n.shape.length),p=n,u=[];i!=null&&(p=Cr({inputs:{x:n},backend:t,attrs:{perm:i}}),u.push(p),a=C.getInnerMostAxes(a.length,p.shape.length)),C.assertAxesAreInnerMostDims("argMin",[a[0]],p.shape.length);let l=new oc(p.shape,a[0],"min"),c=[{type:"float32",data:[Number.POSITIVE_INFINITY]}],m=t.runWebGPUProgram(l,[p],"int32",c);return u.forEach(d=>t.disposeData(d.dataId)),m}var CW={kernelName:sa,backendName:"webgpu",kernelFunc:Ppe};var Ope=ye({opType:Z.ASIN}),wW={kernelName:Cn,backendName:"webgpu",kernelFunc:Ope};var Mpe=ye({opType:Z.ASINH}),SW={kernelName:wn,backendName:"webgpu",kernelFunc:Mpe};var Lpe=ye({opType:Z.ATAN}),IW={kernelName:Sn,backendName:"webgpu",kernelFunc:Lpe};var Bpe=tt({opType:fe.ATAN2}),vW={kernelName:vn,backendName:"webgpu",kernelFunc:Bpe};var zpe=ye({opType:Z.ATANH}),kW={kernelName:In,backendName:"webgpu",kernelFunc:zpe};var yx=class{constructor(e){this.variableNames=["x"],this.uniforms="strides : vec2,",this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="poolWithFilterSizeEqualsOne"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6085,12 +6085,12 @@ return a / b;`,Wee=` setOutputAtIndex(index, value); } } - `}};var Ba=class{constructor(t,e,o=!1,n=!1,s=!1){if(this.variableNames=["x"],this.uniforms="strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,",this.workgroupSize=[128,1,1],this.size=!0,e==="avg"&&o)throw new Error("Cannot compute positions for average pool.");this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=e,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool2D_${e}_${o}_${n}_${s}`}getUserCode(){let t;this.poolType==="avg"?t="resultValue = resultValue + value; count = count + 1.0;":this.computePositions?t=`let currMaxValue = mix(value, maxValue, maxValueFound); + `}};var Ka=class{constructor(e,t,o=!1,n=!1,s=!1){if(this.variableNames=["x"],this.uniforms="strides : vec2, pads : vec2, dilations : vec2, convDims : vec2, filterDims : vec2,",this.workgroupSize=[128,1,1],this.size=!0,t==="avg"&&o)throw new Error("Cannot compute positions for average pool.");this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool2D_${t}_${o}_${n}_${s}`}getUserCode(){let e;this.poolType==="avg"?e="resultValue = resultValue + value; count = count + 1.0;":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound); if (value >= currMaxValue) { maxValue = value; maxValueFound = 1.0; maxPosition = ${this.flattenPositions?this.includeBatchIndex?"((batch * uniforms.xShape[1] + xR) * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d":"(xR * uniforms.xShape[2] + xC) * uniforms.xShape[3] + d":"wR * uniforms.filterDims.y + wC"}; - }`:t="resultValue = max(value, resultValue);";let e="resultValue";return this.poolType==="avg"&&(e="resultValue / max(count, 1.0)"),` + }`:e="resultValue = max(value, resultValue);";let t="resultValue";return this.poolType==="avg"&&(t="resultValue / max(count, 1.0)"),` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6119,19 +6119,19 @@ return a / b;`,Wee=` } let value = getX(batch, xR, xC, d); - ${t} + ${e} } } - ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${e});`} + ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${t});`} } } - `}},wu=class{constructor(t,e,o=!1,n=!1,s=!1){if(this.variableNames=["x"],this.uniforms="strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,",this.workgroupSize=[128,1,1],this.size=!0,e==="avg"&&o)throw new Error("Cannot compute positions for average pool.");this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=e,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool3D_${e}_${o}_${n}_${s}`}getUserCode(){let t;this.poolType==="avg"?t="resultValue += value; count += 1.0;":this.computePositions?t=`let currMaxValue = mix(value, maxValue, maxValueFound); + `}},$u=class{constructor(e,t,o=!1,n=!1,s=!1){if(this.variableNames=["x"],this.uniforms="strides : vec3, pads : vec3, convDims : vec3, filterDims : vec3,",this.workgroupSize=[128,1,1],this.size=!0,t==="avg"&&o)throw new Error("Cannot compute positions for average pool.");this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.poolType=t,this.computePositions=o,this.flattenPositions=n,this.includeBatchIndex=s,this.shaderKey=`pool3D_${t}_${o}_${n}_${s}`}getUserCode(){let e;this.poolType==="avg"?e="resultValue += value; count += 1.0;":this.computePositions?e=`let currMaxValue = mix(value, maxValue, maxValueFound); if (value >= currMaxValue) { maxValue = value; maxValueFound = 1.0; maxPosition = ${this.flattenPositions?this.includeBatchIndex?"(((batch * uniforms.xShape.y + xD) * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch":"((xD * uniforms.xShape.z + xR) * uniforms.xShape.w + xC) * uniforms.xShape.u + ch":"wD * uniforms.filterDims.y * uniforms.filterDims.y + wR * uniforms.filterDims.z + wC"}; - }`:t="resultValue = max(value, resultValue);";let e="resultValue";return this.poolType==="avg"&&(e="resultValue / max(count, 1.0)"),` + }`:e="resultValue = max(value, resultValue);";let t="resultValue";return this.poolType==="avg"&&(t="resultValue / max(count, 1.0)"),` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6167,16 +6167,16 @@ return a / b;`,Wee=` } let value = getX(batch, xD, xR, xC, ch); - ${t} + ${e} } } } - ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${e});`} + ${this.computePositions?"setOutputAtIndexI32(index, maxPosition);":`setOutputAtIndex(index, ${t});`} } } - `}};function e0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{reductionIndices:s,keepDims:a}=o;return Jr(n,s,a,"max",e)}var tV={kernelName:zn,backendName:"webgpu",kernelFunc:e0};function t0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{keepDims:s,axis:a}=o;return Jr(n,a,s,"mean",e)}var rV={kernelName:Un,backendName:"webgpu",kernelFunc:t0};function sx(r,t,e,o){if(t.filterWidth===1&&t.filterHeight===1&&y.arraysEqual(t.inShape,t.outShape))return At({inputs:{x:r},backend:o});if(t.filterWidth===t.inWidth&&t.filterHeight===t.inHeight&&t.batchSize===1&&t.padInfo.type==="VALID"){let a=r.shape.length,i=pe({inputs:{x:r},backend:o,attrs:{shape:[r.shape[a-3]*r.shape[a-2],r.shape[a-1]]}}),p;e==="avg"?p=t0({inputs:{x:i},backend:o,attrs:{axis:0,keepDims:!1}}):(y.assert(e==="max",()=>`Invalid pool type ${e}`),p=e0({inputs:{x:i},backend:o,attrs:{reductionIndices:0,keepDims:!1}}));let u=pe({inputs:{x:p},backend:o,attrs:{shape:t.outShape}});return o.disposeData(i.dataId),o.disposeData(p.dataId),u}let n,s=[{type:"int32",data:[t.strideHeight,t.strideWidth]}];return t.filterHeight===1&&t.filterWidth===1?n=new nx(t):(e==="avg"?n=new Ba(t,"avg"):(y.assert(e==="max",()=>`Invalid pool type ${e}`),n=new Ba(t,"max")),s.push({type:"int32",data:[t.padInfo.top,t.padInfo.left]},{type:"int32",data:[t.dilationHeight,t.dilationWidth]},{type:"int32",data:[t.inHeight,t.inWidth]},{type:"int32",data:[t.effectiveFilterHeight,t.effectiveFilterWidth]})),o.runWebGPUProgram(n,[r],r.dtype,s)}function nue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1,c=w.computePool2DInfo(n.shape,s,a,u,i,p);return sx(n,c,"avg",e)}var oV={kernelName:Qo,backendName:"webgpu",kernelFunc:nue};function sue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,u,p),m=new wu(l,"avg"),d=[{type:"int32",data:[l.strideDepth,l.strideHeight,l.strideWidth]},{type:"int32",data:[l.padInfo.front,l.padInfo.top,l.padInfo.left]},{type:"int32",data:[l.inDepth,l.inHeight,l.inWidth]},{type:"int32",data:[l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth]}];return e.runWebGPUProgram(m,[n],n.dtype,d)}var nV={kernelName:Zs,backendName:"webgpu",kernelFunc:sue};var ax=class{constructor(t){this.variableNames=["dy"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, - outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool2DBackprop"}getUserCode(){return` + `}};function zv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{reductionIndices:s,keepDims:a}=o;return ao(n,s,a,"max",t)}var NW={kernelName:os,backendName:"webgpu",kernelFunc:zv};function Vv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{keepDims:s,axis:a}=o;return ao(n,a,s,"mean",t)}var TW={kernelName:ss,backendName:"webgpu",kernelFunc:Vv};function bx(r,e,t,o){if(e.filterWidth===1&&e.filterHeight===1&&y.arraysEqual(e.inShape,e.outShape))return Pt({inputs:{x:r},backend:o});if(e.filterWidth===e.inWidth&&e.filterHeight===e.inHeight&&e.batchSize===1&&e.padInfo.type==="VALID"){let a=r.shape.length,i=le({inputs:{x:r},backend:o,attrs:{shape:[r.shape[a-3]*r.shape[a-2],r.shape[a-1]]}}),p;t==="avg"?p=Vv({inputs:{x:i},backend:o,attrs:{axis:0,keepDims:!1}}):(y.assert(t==="max",()=>`Invalid pool type ${t}`),p=zv({inputs:{x:i},backend:o,attrs:{reductionIndices:0,keepDims:!1}}));let u=le({inputs:{x:p},backend:o,attrs:{shape:e.outShape}});return o.disposeData(i.dataId),o.disposeData(p.dataId),u}let n,s=[{type:"int32",data:[e.strideHeight,e.strideWidth]}];return e.filterHeight===1&&e.filterWidth===1?n=new yx(e):(t==="avg"?n=new Ka(e,"avg"):(y.assert(t==="max",()=>`Invalid pool type ${t}`),n=new Ka(e,"max")),s.push({type:"int32",data:[e.padInfo.top,e.padInfo.left]},{type:"int32",data:[e.dilationHeight,e.dilationWidth]},{type:"int32",data:[e.inHeight,e.inWidth]},{type:"int32",data:[e.effectiveFilterHeight,e.effectiveFilterWidth]})),o.runWebGPUProgram(n,[r],r.dtype,s)}function Vpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,l=C.computePool2DInfo(n.shape,s,a,1,i,p);return bx(n,l,"avg",t)}var _W={kernelName:kn,backendName:"webgpu",kernelFunc:Vpe};function Wpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,u,p),m=new $u(c,"avg"),d=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.inDepth,c.inHeight,c.inWidth]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return t.runWebGPUProgram(m,[n],n.dtype,d)}var EW={kernelName:aa,backendName:"webgpu",kernelFunc:Wpe};var Cx=class{constructor(e){this.variableNames=["dy"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, + outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool2DBackprop"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6214,8 +6214,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}},ix=class{constructor(t){this.variableNames=["dy"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, - outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool3DBackprop"}getUserCode(){return` + `}},wx=class{constructor(e){this.variableNames=["dy"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, + outDepth : i32, outHeight : i32, outWidth : i32, avgMultiplier : f32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="avgPool3DBackprop"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6263,26 +6263,26 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}};function aue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=w.computePool3DInfo(a.shape,i,p,1,u,c),m=new ix(l),d=1/(l.filterDepth*l.filterHeight*l.filterWidth),f=[{type:"int32",data:[l.strideDepth,l.strideHeight,l.strideWidth]},{type:"int32",data:[l.effectiveFilterDepth-1-l.padInfo.front,l.effectiveFilterHeight-1-l.padInfo.top,l.effectiveFilterWidth-1-l.padInfo.left]},{type:"int32",data:[l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth]},{type:"int32",data:[l.outDepth]},{type:"int32",data:[l.outHeight]},{type:"int32",data:[l.outWidth]},{type:"float32",data:[d]}];return e.runWebGPUProgram(m,[n],a.dtype,f)}var sV={kernelName:Ei,backendName:"webgpu",kernelFunc:aue};function iue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s;mm([n,s],"avgPoolGrad");let{filterSize:i,strides:p,pad:u}=o,c=w.computePool2DInfo(a.shape,i,p,1,u),l=new ax(c),m=1/(c.filterHeight*c.filterWidth),d=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.effectiveFilterHeight-1-c.padInfo.top,c.effectiveFilterWidth-1-c.padInfo.left]},{type:"int32",data:[c.dilationHeight,c.dilationWidth]},{type:"int32",data:[c.effectiveFilterHeight,c.effectiveFilterWidth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"float32",data:[m]}];return e.runWebGPUProgram(l,[n],a.dtype,d)}var aV={kernelName:$i,backendName:"webgpu",kernelFunc:iue};function uue(r){let{inputs:t,backend:e,attrs:o}=r,{a:n,b:s}=t,{transposeA:a,transposeB:i}=o;return _p({a:n,b:s,transposeA:a,transposeB:i,backend:e})}var iV={kernelName:Zo,backendName:"webgpu",kernelFunc:uue};var ux=class{constructor(t,e){this.variableNames=["source"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.rank=e.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.start=t,this.uniforms=`start : ${ft(t.length)}, `,this.shaderKey="slice"}getUserCode(){let t=ft(this.rank),e=pue(this.rank),o;return this.start.length===1?o=this.outputShape.map((s,a)=>"sourceLoc = uniforms.start + coords;"):o=this.outputShape.map((s,a)=>`sourceLoc.${r0[a]} = uniforms.start.${Oo(a)} + coords.${r0[a]};`),` + `}};function Upe(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:l}=o,c=C.computePool3DInfo(a.shape,i,p,1,u,l),m=new wx(c),d=1/(c.filterDepth*c.filterHeight*c.filterWidth),f=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.effectiveFilterDepth-1-c.padInfo.front,c.effectiveFilterHeight-1-c.padInfo.top,c.effectiveFilterWidth-1-c.padInfo.left]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]},{type:"int32",data:[c.outDepth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"float32",data:[d]}];return t.runWebGPUProgram(m,[n],a.dtype,f)}var $W={kernelName:Vi,backendName:"webgpu",kernelFunc:Upe};function Gpe(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s;wm([n,s],"avgPoolGrad");let{filterSize:i,strides:p,pad:u}=o,l=C.computePool2DInfo(a.shape,i,p,1,u),c=new Cx(l),m=1/(l.filterHeight*l.filterWidth),d=[{type:"int32",data:[l.strideHeight,l.strideWidth]},{type:"int32",data:[l.effectiveFilterHeight-1-l.padInfo.top,l.effectiveFilterWidth-1-l.padInfo.left]},{type:"int32",data:[l.dilationHeight,l.dilationWidth]},{type:"int32",data:[l.effectiveFilterHeight,l.effectiveFilterWidth]},{type:"int32",data:[l.outHeight]},{type:"int32",data:[l.outWidth]},{type:"float32",data:[m]}];return t.runWebGPUProgram(c,[n],a.dtype,d)}var RW={kernelName:zi,backendName:"webgpu",kernelFunc:Gpe};function Hpe(r){let{inputs:e,backend:t,attrs:o}=r,{a:n,b:s}=e,{transposeA:a,transposeB:i}=o;return Op({a:n,b:s,transposeA:a,transposeB:i,backend:t})}var DW={kernelName:Nn,backendName:"webgpu",kernelFunc:Hpe};var Sx=class{constructor(e,t){this.variableNames=["source"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.rank=t.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.start=e,this.uniforms=`start : ${ft(e.length)}, `,this.shaderKey="slice"}getUserCode(){let e=ft(this.rank),t=Kpe(this.rank),o;return this.start.length===1?o=this.outputShape.map((s,a)=>"sourceLoc = uniforms.start + coords;"):o=this.outputShape.map((s,a)=>`sourceLoc.${Wv[a]} = uniforms.start.${un(a)} + coords.${Wv[a]};`),` ${G("index")} { if (index < uniforms.size) { - var sourceLoc : ${t}; + var sourceLoc : ${e}; let coords = getCoordsFromIndex(index); ${o.join(` `)} - setOutputAtIndex(index, getSource(${e})); + setOutputAtIndex(index, getSource(${t})); } } - `}},r0=["x","y","z","w","u","v"];function pue(r){if(r===1)return"sourceLoc";if(r<=6)return r0.slice(0,r).map(t=>`sourceLoc.${t}`).join(",");throw Error(`Slicing for rank ${r} is not yet supported`)}function Hs(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,size:a}=o,[i,p]=pt.parseSliceParams(n,s,a);if(pt.assertParamsValid(n,i,p),e.shouldExecuteOnCPU([n])||n.dtype==="string"){let l=e.tensorMap.get(n.dataId),m=Az(l.values,i,p,n.shape,n.dtype);return e.makeTensorInfo(p,n.dtype,m)}if(y.sizeFromShape(p)===0)return e.makeTensorInfo(p,n.dtype,[]);let u=new ux(i,p),c=[{type:"int32",data:i}];return e.runWebGPUProgram(u,[n],n.dtype,c)}var uV={kernelName:ha,backendName:"webgpu",kernelFunc:Hs};var cue=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet");let i=s.reduce((b,C)=>b*C),p=w.getReshaped(n.shape,s,i),u=w.getPermuted(p.length,s.length),c=w.getReshapedPermuted(n.shape,s,i),l=w.getSliceBeginCoords(a,s.length),m=w.getSliceSize(c,a,s.length),d=[],f=pe({inputs:{x:n},backend:e,attrs:{shape:p}}),h=xr({inputs:{x:f},backend:e,attrs:{perm:u}}),g=pe({inputs:{x:h},backend:e,attrs:{shape:c}}),x=Hs({inputs:{x:g},backend:e,attrs:{begin:l,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>e.disposeData(b.dataId)),x},pV={kernelName:Js,backendName:"webgpu",kernelFunc:cue};var lue=` + `}},Wv=["x","y","z","w","u","v"];function Kpe(r){if(r===1)return"sourceLoc";if(r<=6)return Wv.slice(0,r).map(e=>`sourceLoc.${e}`).join(",");throw Error(`Slicing for rank ${r} is not yet supported`)}function ea(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,size:a}=o,[i,p]=nt.parseSliceParams(n,s,a);if(nt.assertParamsValid(n,i,p),t.shouldExecuteOnCPU([n])||n.dtype==="string"){let c=t.tensorMap.get(n.dataId),m=nW(c.values,i,p,n.shape,n.dtype);return t.makeTensorInfo(p,n.dtype,m)}if(y.sizeFromShape(p)===0)return t.makeTensorInfo(p,n.dtype,[]);let u=new Sx(i,p),l=[{type:"int32",data:i}];return t.runWebGPUProgram(u,[n],n.dtype,l)}var AW={kernelName:_s,backendName:"webgpu",kernelFunc:ea};var qpe=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,crops:a}=o;y.assert(n.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGPU backend not implemented yet");let i=s.reduce((b,w)=>b*w),p=C.getReshaped(n.shape,s,i),u=C.getPermuted(p.length,s.length),l=C.getReshapedPermuted(n.shape,s,i),c=C.getSliceBeginCoords(a,s.length),m=C.getSliceSize(l,a,s.length),d=[],f=le({inputs:{x:n},backend:t,attrs:{shape:p}}),h=Cr({inputs:{x:f},backend:t,attrs:{perm:u}}),g=le({inputs:{x:h},backend:t,attrs:{shape:l}}),x=ea({inputs:{x:g},backend:t,attrs:{begin:c,size:m}});return d.push(f),d.push(h),d.push(g),d.forEach(b=>t.disposeData(b.dataId)),x},FW={kernelName:ia,backendName:"webgpu",kernelFunc:qpe};var jpe=` fn bincount_write(index: i32, value: f32) { - ${Yr("&result[index]","value","float32")} + ${oo("&result[index]","value","float32")} } -`,mue=` +`,Xpe=` fn bincount_write(index: i32, value: f32) { atomicStore(&result[index], bitcast(value)); } -`,Xc=class{constructor(t,e,o=!1){this.outputShape=[],this.variableNames=["x"],this.uniforms="binCountSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.hasWeights=!0,this.binaryOutput=!1,this.outputShape=t,this.rank=t.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.binaryOutput=o,o&&(this.atomic=!1),this.hasWeights=e,this.hasWeights&&this.variableNames.push("w"),this.shaderKey=`bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`}getUserCode(){return` - ${this.binaryOutput?mue:lue} +`,nc=class{constructor(e,t,o=!1){this.outputShape=[],this.variableNames=["x"],this.uniforms="binCountSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.hasWeights=!0,this.binaryOutput=!1,this.outputShape=e,this.rank=e.length,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.binaryOutput=o,o&&(this.atomic=!1),this.hasWeights=t,this.hasWeights&&this.variableNames.push("w"),this.shaderKey=`bincount_${this.hasWeights}_${this.binaryOutput}_${this.rank}`}getUserCode(){return` + ${this.binaryOutput?Xpe:jpe} ${G("index")} { ${this.rank===1?`if (index < uniforms.xShape) { let indexVal = i32(getX(index)); @@ -6299,7 +6299,7 @@ return a / b;`,Wee=` } }`} } - `}};function due(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a}=o,i=y.sizeFromShape(n.shape),u=y.sizeFromShape(s.shape)>0,c=[a],l=s.dtype,m=vt({backend:e,attrs:{shape:c,value:0,dtype:l}}),d=new Xc([i],u),f=[{type:"int32",data:[a]}],h=u?[n,s]:[n];return e.runWebGPUProgram(d,h,l,f,m)}var cV={kernelName:Jo,backendName:"webgpu",kernelFunc:due};var px=class{constructor(t){this.outputShape=[],this.variableNames=["s0","s1"],this.uniforms="s0Size : i32, s1Size : i32, ",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="broadcastArgs"}getUserCode(){return` + `}};function Ype(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a}=o,i=y.sizeFromShape(n.shape),u=y.sizeFromShape(s.shape)>0,l=[a],c=s.dtype,m=Nt({backend:t,attrs:{shape:l,value:0,dtype:c}}),d=new nc([i],u),f=[{type:"int32",data:[a]}],h=u?[n,s]:[n];return t.runWebGPUProgram(d,h,c,f,m)}var PW={kernelName:Tn,backendName:"webgpu",kernelFunc:Ype};var Ix=class{constructor(e){this.outputShape=[],this.variableNames=["s0","s1"],this.uniforms="s0Size : i32, s1Size : i32, ",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="broadcastArgs"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { var s0 = 1.0; @@ -6324,7 +6324,7 @@ return a / b;`,Wee=` } } } - `}};function fue(r){let{inputs:t,backend:e}=r,{s0:o,s1:n}=t;if(e.shouldExecuteOnCPU([o,n])){let c=e.tensorMap.get(o.dataId),l=e.tensorMap.get(n.dataId),m=c.values,d=l.values,f=w.assertAndGetBroadcastShape(Array.from(m),Array.from(d));return e.makeTensorInfo([f.length],"int32",Int32Array.from(f))}let s=y.sizeFromShape(o.shape),a=y.sizeFromShape(n.shape),i=Math.max(s,a),p=new px(i),u=[{type:"int32",data:[s]},{type:"int32",data:[a]}];return e.runWebGPUProgram(p,[o,n],"int32",u)}var lV={kernelName:ea,backendName:"webgpu",kernelFunc:fue};var o0=et({opType:fe.NOT_EQUAL,dtype:"bool",cpuKernelImpl:Tz}),mV={kernelName:Yn,backendName:"webgpu",kernelFunc:o0};function Ii(r){let{inputs:t,backend:e}=r,{input:o}=t,n=e.tensorMap.get(o.dataId);return At({inputs:{x:n.complexTensorInfos.real},backend:e})}var dV={kernelName:Gi,backendName:"webgpu",kernelFunc:Ii};function fV(r,t){let e=new Zr(r.shape,Z.TO_INT),o=t.runWebGPUProgram(e,[r],"int32");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function n0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dtype:s}=o;if(s==="complex64"){if(n.dtype==="complex64")return At({inputs:{x:n},backend:e});let a=Ur(n.shape),i=n0({inputs:{x:n},backend:e,attrs:{dtype:"float32"}}),p=xo({inputs:{real:i,imag:a},backend:e});return a.dispose(),e.disposeData(i.dataId),p}if(n.dtype==="complex64"){let a=Ii({inputs:{input:n},backend:e}),i=n0({inputs:{x:a},backend:e,attrs:{dtype:s}});return e.disposeData(a.dataId),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=At({inputs:{x:n},backend:e});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(e.shouldExecuteOnCPU([n])){let a=e.tensorMap.get(n.dataId).values,[i,p,u]=iz(a,n.shape,n.dtype,s);return e.makeTensorInfo(i,p,u)}if(s==="int32")return fV(n,e);if(s==="bool"){let a=e.makeTensorInfo([],"bool",y.getTypedArrayFromDType("bool",1)),p=o0({inputs:{a:n,b:a},backend:e});return e.disposeData(a.dataId),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var hV={kernelName:yo,backendName:"webgpu",kernelFunc:n0};var hue=ye({opType:Z.CEIL,cpuKernelImpl:uz}),gV={kernelName:en,backendName:"webgpu",kernelFunc:hue};var cx=class{constructor(t){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workPerThread=4,this.workgroupSize=[64,1,1],this.outputComponent=4,this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="clipVec4"}getUserCode(){return` + `}};function Qpe(r){let{inputs:e,backend:t}=r,{s0:o,s1:n}=e;if(t.shouldExecuteOnCPU([o,n])){let l=t.tensorMap.get(o.dataId),c=t.tensorMap.get(n.dataId),m=l.values,d=c.values,f=C.assertAndGetBroadcastShape(Array.from(m),Array.from(d));return t.makeTensorInfo([f.length],"int32",Int32Array.from(f))}let s=y.sizeFromShape(o.shape),a=y.sizeFromShape(n.shape),i=Math.max(s,a),p=new Ix(i),u=[{type:"int32",data:[s]},{type:"int32",data:[a]}];return t.runWebGPUProgram(p,[o,n],"int32",u)}var OW={kernelName:ua,backendName:"webgpu",kernelFunc:Qpe};var Uv=tt({opType:fe.NOT_EQUAL,dtype:"bool",cpuKernelImpl:ZV}),MW={kernelName:Ro,backendName:"webgpu",kernelFunc:Uv};function Fi(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.tensorMap.get(o.dataId);return Pt({inputs:{x:n.complexTensorInfos.real},backend:t})}var LW={kernelName:si,backendName:"webgpu",kernelFunc:Fi};function BW(r,e){let t=new so(r.shape,Z.TO_INT),o=e.runWebGPUProgram(t,[r],"int32");return{dataId:o.dataId,shape:o.shape,dtype:o.dtype}}function Gv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dtype:s}=o;if(s==="complex64"){if(n.dtype==="complex64")return Pt({inputs:{x:n},backend:t});let a=Yr(n.shape),i=Gv({inputs:{x:n},backend:t,attrs:{dtype:"float32"}}),p=Uo({inputs:{real:i,imag:a},backend:t});return a.dispose(),t.disposeData(i.dataId),p}if(n.dtype==="complex64"){let a=Fi({inputs:{input:n},backend:t}),i=Gv({inputs:{x:a},backend:t,attrs:{dtype:s}});return t.disposeData(a.dataId),i}if(!y.hasEncodingLoss(n.dtype,s)){let a=Pt({inputs:{x:n},backend:t});return{dataId:a.dataId,shape:a.shape,dtype:s}}if(t.shouldExecuteOnCPU([n])){let a=t.tensorMap.get(n.dataId).values,[i,p,u]=DV(a,n.shape,n.dtype,s);return t.makeTensorInfo(i,p,u)}if(s==="int32")return BW(n,t);if(s==="bool"){let a=t.makeTensorInfo([],"bool",y.getTypedArrayFromDType("bool",1)),p=Uv({inputs:{a:n,b:a},backend:t});return t.disposeData(a.dataId),p}throw new Error(`Error in Cast: failed to cast ${n.dtype} to ${s}`)}var zW={kernelName:ho,backendName:"webgpu",kernelFunc:Gv};var Zpe=ye({opType:Z.CEIL,cpuKernelImpl:AV}),VW={kernelName:go,backendName:"webgpu",kernelFunc:Zpe};var vx=class{constructor(e){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workPerThread=4,this.workgroupSize=[64,1,1],this.outputComponent=4,this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.shaderKey="clipVec4"}getUserCode(){return` ${G("index")} { if(index < uniforms.size) { let value = getAByOutputIndex(index); @@ -6334,7 +6334,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, clampedValue); } } - `}};var lx=class{constructor(t){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="clip"}getUserCode(){return` + `}};var kx=class{constructor(e){this.variableNames=["A"],this.uniforms="minVal : f32, maxVal : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="clip"}getUserCode(){return` ${G("index")} { if(index < uniforms.size) { let value = getAByOutputIndex(index); @@ -6345,7 +6345,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, clamp(value, uniforms.minVal, uniforms.maxVal)); } } - `}};function gue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{clipValueMin:s,clipValueMax:a}=o,i,p=[{type:"float32",data:[s]},{type:"float32",data:[a]}];return y.sizeFromShape(n.shape)%4===0?i=new cx(n.shape):i=new lx(n.shape),e.runWebGPUProgram(i,[n],n.dtype,p)}var xV={kernelName:bo,backendName:"webgpu",kernelFunc:gue};var mx=class{constructor(t){this.outputShape=[],this.variableNames=["real","imag"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="complexAbs"}getUserCode(){return` + `}};function Jpe(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{clipValueMin:s,clipValueMax:a}=o,i,p=[{type:"float32",data:[s]},{type:"float32",data:[a]}];return y.sizeFromShape(n.shape)%4===0?i=new vx(n.shape):i=new kx(n.shape),t.runWebGPUProgram(i,[n],n.dtype,p)}var WW={kernelName:Go,backendName:"webgpu",kernelFunc:Jpe};var Nx=class{constructor(e){this.outputShape=[],this.variableNames=["real","imag"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="complexAbs"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let re = abs(getRealByOutputIndex(index)); @@ -6357,7 +6357,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, select(mx * length(vec2(1, min(re, im)/mx)), 0.0, mx == 0.0)); } } - `}};function yV(r,t){return{dataId:t.dataId,dtype:t.dtype,shape:r.shape}}function xue(r){let{inputs:t,backend:e}=r,{x:o}=t,n=e.tensorMap.get(o.dataId),s=new mx(o.shape),a=[yV(o,n.complexTensorInfos.real),yV(o,n.complexTensorInfos.imag)];return e.runWebGPUProgram(s,a,a[0].dtype)}var bV={kernelName:Di,backendName:"webgpu",kernelFunc:xue};var dx=class{constructor(t){this.uniforms="",this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=w.computeOutShape(t,1),this.variableNames=t.map((e,o)=>`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.offsetLength=t.length-1;for(let e=0;e0){t.push("if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }");for(let s=1;s`T${o}`),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]),this.offsetLength=e.length-1;for(let t=0;t0){e.push("if (yC < uniforms.offset0){ setOutputAtCoords(coords.x, coords.y, getT0(yR, yC)); }");for(let s=1;sIi({inputs:{input:C},backend:e})),h=r.map(C=>$p({inputs:{input:C},backend:e})),g=Yc(f,t,e),x=Yc(h,t,e),b=xo({inputs:{real:g,imag:x},backend:e});return f.forEach(C=>e.disposeData(C.dataId)),h.forEach(C=>e.disposeData(C.dataId)),e.disposeData(g.dataId),e.disposeData(x.dataId),b}let n=e.shouldExecuteOnCPU(r);if(o==="string"&&(n=!0),n){let f=r.map(k=>{let E=[-1,y.sizeFromShape(k.shape.slice(t))];return pe({inputs:{x:k},backend:e,attrs:{shape:E}})}),h=f.map(k=>({vals:e.readSync(k.dataId),shape:k.shape})),g=w.computeOutShape(f.map(k=>k.shape),1),x=f[0].shape[0]===1,b=pz(h,g,o,x),C=w.computeOutShape(r.map(k=>k.shape),t),S=e.makeTensorInfo(C,o,b);return f.forEach(k=>e.disposeData(k.dataId)),S}let s=e.device.limits.maxStorageBuffersPerShaderStage-1;if(r.length>s){let f=[];for(let g=0;gf.shape),u=new dx(p),c=[],l=new Array(p.length-1);if(l.length>0){l[0]=p[0][1],c.push({type:"int32",data:[l[0]]});for(let f=1;fe.disposeData(f.dataId));let d=pe({inputs:{x:m},backend:e,attrs:{shape:i}});return e.disposeData(m.dataId),d}function yue(r,t,e){let o=w.computeOutShape(r.map(s=>s.shape),t);return{tensors2D:r.map(s=>pe({inputs:{x:s},backend:e,attrs:{shape:[y.sizeFromShape(s.shape.slice(0,t)),y.sizeFromShape(s.shape.slice(t))]}})),outShape:o}}function s0(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,t[0].shape)[0],a=t.map(u=>u.shape);w.assertParamsConsistent(a,s);let i=w.computeOutShape(t.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return e.makeTensorInfo(i,t[0].dtype,[]);let p=t.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?At({inputs:{x:p[0]},backend:e}):Yc(p,s,e)}var wV={kernelName:ta,backendName:"webgpu",kernelFunc:s0};function bue(r,t,e,o,n=!1,s=null,a=!1,i=4,p=4,u=4){let c=D=>{switch(D){case 1:return"resData = f32(x[xIndex]);";case 3:return"resData = vec3(x[xIndex], x[xIndex + 1], x[xIndex + 2]);";case 4:return"resData = vec4(x[xIndex / 4]);";default:throw new Error(`innerElementSize ${D} is not supported.`)}},l=D=>{switch(D){case 1:return"return f32(W[row * uniforms.wShape[3] + col]);";case 4:return"return vec4(W[(row * uniforms.wShape[3] + col) / 4]);";default:throw new Error(`innerElementSize ${D} is not supported.`)}},m=r?` + `}};function Mp(r){let{inputs:e,backend:t}=r,{input:o}=e,n=t.tensorMap.get(o.dataId);return Pt({inputs:{x:n.complexTensorInfos.imag},backend:t})}var HW={kernelName:Qi,backendName:"webgpu",kernelFunc:Mp};function sc(r,e,t){let o=r[0].dtype;if(o==="complex64"){let f=r.map(w=>Fi({inputs:{input:w},backend:t})),h=r.map(w=>Mp({inputs:{input:w},backend:t})),g=sc(f,e,t),x=sc(h,e,t),b=Uo({inputs:{real:g,imag:x},backend:t});return f.forEach(w=>t.disposeData(w.dataId)),h.forEach(w=>t.disposeData(w.dataId)),t.disposeData(g.dataId),t.disposeData(x.dataId),b}let n=t.shouldExecuteOnCPU(r);if(o==="string"&&(n=!0),n){let f=r.map(k=>{let E=[-1,y.sizeFromShape(k.shape.slice(e))];return le({inputs:{x:k},backend:t,attrs:{shape:E}})}),h=f.map(k=>({vals:t.readSync(k.dataId),shape:k.shape})),g=C.computeOutShape(f.map(k=>k.shape),1),x=f[0].shape[0]===1,b=FV(h,g,o,x),w=C.computeOutShape(r.map(k=>k.shape),e),S=t.makeTensorInfo(w,o,b);return f.forEach(k=>t.disposeData(k.dataId)),S}let s=t.device.limits.maxStorageBuffersPerShaderStage-1;if(r.length>s){let f=[];for(let g=0;gf.shape),u=new Tx(p),l=[],c=new Array(p.length-1);if(c.length>0){c[0]=p[0][1],l.push({type:"int32",data:[c[0]]});for(let f=1;ft.disposeData(f.dataId));let d=le({inputs:{x:m},backend:t,attrs:{shape:i}});return t.disposeData(m.dataId),d}function tle(r,e,t){let o=C.computeOutShape(r.map(s=>s.shape),e);return{tensors2D:r.map(s=>le({inputs:{x:s},backend:t,attrs:{shape:[y.sizeFromShape(s.shape.slice(0,e)),y.sizeFromShape(s.shape.slice(e))]}})),outShape:o}}function Hv(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o,s=y.parseAxisParam(n,e[0].shape)[0],a=e.map(u=>u.shape);C.assertParamsConsistent(a,s);let i=C.computeOutShape(e.map(u=>u.shape),s);if(y.sizeFromShape(i)===0)return t.makeTensorInfo(i,e[0].dtype,[]);let p=e.filter(u=>y.sizeFromShape(u.shape)>0);return p.length===1?Pt({inputs:{x:p[0]},backend:t}):sc(p,s,t)}var KW={kernelName:pa,backendName:"webgpu",kernelFunc:Hv};function rle(r,e,t,o,n=!1,s=null,a=!1,i=4,p=4,u=4){let l=D=>{switch(D){case 1:return"resData = f32(x[xIndex]);";case 3:return"resData = vec3(x[xIndex], x[xIndex + 1], x[xIndex + 2]);";case 4:return"resData = vec4(x[xIndex / 4]);";default:throw new Error(`innerElementSize ${D} is not supported.`)}},c=D=>{switch(D){case 1:return"return f32(W[row * uniforms.wShape[3] + col]);";case 4:return"return vec4(W[(row * uniforms.wShape[3] + col) / 4]);";default:throw new Error(`innerElementSize ${D} is not supported.`)}},m=r?` let coord = vec4(batch, xRow, xCol, xCh); `:` let coord = vec4(batch, xCh, xRow, xCol); @@ -6404,26 +6404,26 @@ return a / b;`,Wee=` if (xRow >= 0 && xRow < ${f} && xCol >= 0 && xCol < ${h}) { ${m} let xIndex = getIndexFromCoords4D(coord, uniforms.xShape); - ${c(i)} + ${l(i)} } - return resData;`,C=r?t&&o?` + return resData;`,w=r?e&&o?` ${b}`:` if (row < uniforms.dimAOuter && col < uniforms.dimInner) { ${b} } - return ${Ae(i)}(0.0);`:o&&e?` + return ${Ae(i)}(0.0);`:o&&t?` ${b}`:` if (row < uniforms.dimInner && col < uniforms.dimBOuter) { ${b} } - return ${Ae(i)}(0.0);`,S=`${l(p)}`,k=Ae(u),_=r?Ae(i):Ae(p),E=r?Ae(p):Ae(i);return` - ${dr(s,a,u===4,4)} - fn mm_readA(batch: i32, row : i32, col : i32) -> ${_} { - ${r?C:S} + return ${Ae(i)}(0.0);`,S=`${c(p)}`,k=Ae(u),T=r?Ae(i):Ae(p),E=r?Ae(p):Ae(i);return` + ${gr(s,a,u===4,4)} + fn mm_readA(batch: i32, row : i32, col : i32) -> ${T} { + ${r?w:S} } fn mm_readB(batch: i32, row : i32, col : i32) -> ${E} { - ${r?S:C} + ${r?S:w} } fn mm_write(batch: i32, row : i32, col : i32, valueIn : ${k}) { @@ -6432,14 +6432,14 @@ return a / b;`,Wee=` var value = valueIn; let outWidth = ${r?"uniforms.outShape[2]":"uniforms.outShape[3]"}; ${d} - ${Qr(n,s)} + ${no(n,s)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } - }`}var fx=class{constructor(t,e,o,n,s=!1,a=null,i=!1,p=!1){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=t.outShape,this.isChannelsLast=t.dataFormat==="channelsLast",this.isVec4=((t.inChannels%4===0||t.inChannels%3===0)&&this.isChannelsLast||t.outWidth%4===0&&!this.isChannelsLast)&&t.outChannels%4===0,this.dispatchLayout=this.isChannelsLast?{x:[3],y:[1,2],z:[0]}:{x:[2,3],y:[1],z:[0]},this.workgroupSize=pm(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=cm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4?(this.outputComponent=4,this.isChannelsLast&&t.inChannels%4!==0?(this.innerElementSize=3,this.variableComponents=[1,4]):(this.innerElementSize=4,this.variableComponents=[4,4]),s&&(this.variableNames.push("bias"),this.variableComponents.push(4)),i&&(this.variableNames.push("preluActivationWeights"),this.variableComponents.push(4))):(this.innerElementSize=this.elementsPerThread[0],s&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights")),this.sequentialAccessByThreads=p,this.addBias=s,this.activation=a,this.hasPreluActivationWeights=i,this.tileAOuter=this.workgroupSize[1]*this.elementsPerThread[1],this.tileBOuter=this.workgroupSize[0]*this.elementsPerThread[0],this.tileInner=Math.max(this.workgroupSize[0]*this.innerElementSize,this.workgroupSize[1]),this.fitAOuter=e%this.tileAOuter===0,this.fitBOuter=o%this.tileBOuter===0,this.fitInner=n%this.tileInner===0,this.shaderKey=`conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`}getUserCode(){let t=this.isVec4?Np(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner):Tp(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner,!1,null,this.sequentialAccessByThreads),e=this.isVec4?[this.innerElementSize,4,4]:[1,1,1];return` - ${bue(this.isChannelsLast,this.fitAOuter,this.fitBOuter,this.fitInner,this.addBias,this.activation,this.hasPreluActivationWeights,e[0],e[1],e[2])} - ${t} - `}};var hx=class{constructor(t,e=!1,o=null,n=!1){this.variableNames=["x","W"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,",this.workgroupSize=[4,4,8],this.outputShape=t.outShape,this.isChannelsLast=t.dataFormat==="channelsLast",this.dispatchLayout=this.isChannelsLast?{x:[2],y:[1],z:[0,3]}:{x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=e,this.activation=o,this.hasPreluActivationWeights=n,e&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`conv2dnaive_${this.activation}_${this.isChannelsLast}`}getUserCode(){return` - ${dr(this.activation,this.hasPreluActivationWeights,!1,4)} + }`}var _x=class{constructor(e,t,o,n,s=!1,a=null,i=!1,p=!1){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, dilations : vec2, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.isVec4=((e.inChannels%4===0||e.inChannels%3===0)&&this.isChannelsLast||e.outWidth%4===0&&!this.isChannelsLast)&&e.outChannels%4===0,this.dispatchLayout=this.isChannelsLast?{x:[3],y:[1,2],z:[0]}:{x:[2,3],y:[1],z:[0]},this.workgroupSize=ym(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=bm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4?(this.outputComponent=4,this.isChannelsLast&&e.inChannels%4!==0?(this.innerElementSize=3,this.variableComponents=[1,4]):(this.innerElementSize=4,this.variableComponents=[4,4]),s&&(this.variableNames.push("bias"),this.variableComponents.push(4)),i&&(this.variableNames.push("preluActivationWeights"),this.variableComponents.push(4))):(this.innerElementSize=this.elementsPerThread[0],s&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights")),this.sequentialAccessByThreads=p,this.addBias=s,this.activation=a,this.hasPreluActivationWeights=i,this.tileAOuter=this.workgroupSize[1]*this.elementsPerThread[1],this.tileBOuter=this.workgroupSize[0]*this.elementsPerThread[0],this.tileInner=Math.max(this.workgroupSize[0]*this.innerElementSize,this.workgroupSize[1]),this.fitAOuter=t%this.tileAOuter===0,this.fitBOuter=o%this.tileBOuter===0,this.fitInner=n%this.tileInner===0,this.shaderKey=`conv2DMM_${this.elementsPerThread}_${this.activation}}_${this.fitAOuter}_${this.fitBOuter}_${this.fitInner}_${this.isVec4}_${this.innerElementSize}_${this.isChannelsLast}_${this.sequentialAccessByThreads}`}getUserCode(){let e=this.isVec4?Fp(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner):Pp(this.elementsPerThread,this.workgroupSize,!this.isChannelsLast,this.tileInner,!1,null,this.sequentialAccessByThreads),t=this.isVec4?[this.innerElementSize,4,4]:[1,1,1];return` + ${rle(this.isChannelsLast,this.fitAOuter,this.fitBOuter,this.fitInner,this.addBias,this.activation,this.hasPreluActivationWeights,t[0],t[1],t[2])} + ${e} + `}};var Ex=class{constructor(e,t=!1,o=null,n=!1){this.variableNames=["x","W"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2,",this.workgroupSize=[4,4,8],this.outputShape=e.outShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.dispatchLayout=this.isChannelsLast?{x:[2],y:[1],z:[0,3]}:{x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.addBias=t,this.activation=o,this.hasPreluActivationWeights=n,t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.shaderKey=`conv2dnaive_${this.activation}_${this.isChannelsLast}`}getUserCode(){return` + ${gr(this.activation,this.hasPreluActivationWeights,!1,4)} fn readInp(batch : i32, row : i32, col : i32, chan : i32) -> f32{ let coords = vec4(batch, row, col, chan); if (coordsInBounds4D(coords, uniforms.xShape)) { @@ -6460,7 +6460,7 @@ return a / b;`,Wee=` let coords = ${this.isChannelsLast?"vec4(batch, row, col, chan);":"vec4(batch, chan, row, col);"} if (coordsInBounds4D(coords, uniforms.outShape)) { var value = valueIn; - ${Qr(this.addBias,this.activation)} + ${no(this.addBias,this.activation)} setOutputAtCoords(coords.x, coords.y, coords.z, coords.w, value); } } @@ -6484,8 +6484,8 @@ return a / b;`,Wee=` } writeResult(batch, outRow, outCol, outChannel, acc); } - `}};var gx=class{constructor(t,e){this.variableNames=["x"],this.uniforms=`pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32, - inChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e,this.shaderKey=`im2col_${this.isChannelsLast}`}getUserCode(){let t=this.isChannelsLast?1:2,e=this.isChannelsLast?2:3,o=this.isChannelsLast?"coords[1]":"coords[2]",n=this.isChannelsLast?"coords[2]":"coords[1]",s=this.isChannelsLast?"getX(batch, xRow, xCol, ch)":"getX(batch, ch, xRow, xCol)";return` + `}};var $x=class{constructor(e,t){this.variableNames=["x"],this.uniforms=`pads : vec2, strides : vec2, dilations : vec2, outWidth : i32, itemsPerBlockRow : i32, + inChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=t,this.shaderKey=`im2col_${this.isChannelsLast}`}getUserCode(){let e=this.isChannelsLast?1:2,t=this.isChannelsLast?2:3,o=this.isChannelsLast?"coords[1]":"coords[2]",n=this.isChannelsLast?"coords[2]":"coords[1]",s=this.isChannelsLast?"getX(batch, xRow, xCol, ch)":"getX(batch, ch, xRow, xCol)";return` ${G("index")} { let coords = getCoordsFromIndex(index); if(index < uniforms.size) { @@ -6495,20 +6495,20 @@ return a / b;`,Wee=` let offsetY = (row / uniforms.outWidth) * uniforms.strides[0] - uniforms.pads[0]; let xRow = offsetY + uniforms.dilations[0] * (col / uniforms.itemsPerBlockRow); var value = 0.0; - if(xRow < uniforms.xShape[${t}] && xRow >= 0) { + if(xRow < uniforms.xShape[${e}] && xRow >= 0) { let offsetX = (row % uniforms.outWidth) * uniforms.strides[1] - uniforms.pads[1]; let xCol = offsetX + uniforms.dilations[1] * ((col % uniforms.itemsPerBlockRow) / uniforms.inChannels); let ch = col % uniforms.inChannels; - if(xCol < uniforms.xShape[${e}] && xCol >= 0) { + if(xCol < uniforms.xShape[${t}] && xCol >= 0) { value = ${s}; } } setOutputAtIndex(index, value); } } - `}};function xx(r,t){let e=r.length;return e>=3?t?[...r.slice(0,-3),r[e-3]*r[e-2],r[e-1]]:[...r.slice(0,-3),r[e-3],r[e-2]*r[e-1]]:!t&&e===1&&r[0]>1?[r[0],1]:null}function Cue({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=e.dataFormat==="channelsLast",u=!p,c=!1,l=p&&e.filterHeight===e.inHeight&&e.filterWidth===e.inWidth&&e.padInfo.type==="VALID",m=[],d,f;if(l){let x=e.inHeight*e.inWidth*e.inChannels;d=pe({inputs:{x:r},backend:o,attrs:{shape:[1,e.batchSize,x]}}),f=pe({inputs:{x:t},backend:o,attrs:{shape:[1,x,e.outChannels]}})}else d=pe({inputs:{x:r},backend:o,attrs:{shape:p?[e.batchSize,e.inHeight*e.inWidth,e.inChannels]:[e.batchSize,e.inChannels,e.inHeight*e.inWidth]}}),f=pe({inputs:{x:t},backend:o,attrs:{shape:[1,e.inChannels,e.outChannels]}});if(m.push(d),m.push(f),s!=null){let x=xx(s.shape,p);x!=null&&(s=pe({inputs:{x:s},backend:o,attrs:{shape:x}}),m.push(s))}if(n!=null){let x=xx(n.shape,p);x!=null&&(n=pe({inputs:{x:n},backend:o,attrs:{shape:x}}),m.push(n))}let h=_p({a:p?d:f,b:p?f:d,transposeA:u,transposeB:c,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),g=pe({inputs:{x:h},backend:o,attrs:{shape:e.outShape}});m.push(h);for(let x of m)o.disposeData(x.dataId);return g}function wue({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:c,strideWidth:l,strideHeight:m,padInfo:d,outWidth:f,outHeight:h,dilationWidth:g,dilationHeight:x,dataFormat:b}=e,C=b==="channelsLast",S=p*u*c,k=h*f,_=C?[e.batchSize,k,S]:[e.batchSize,S,k],E=new gx(_,C),R=[{type:"int32",data:[d.top,d.left]},{type:"int32",data:[m,l]},{type:"int32",data:[x,g]},{type:"int32",data:[f]},{type:"int32",data:[c*p]},{type:"int32",data:[c]}],D=o.runWebGPUProgram(E,[r],r.dtype,R),P=[];P.push(D);let O=pe({inputs:{x:t},backend:o,attrs:{shape:[1,S,-1]}});if(P.push(O),s!=null){let U=xx(s.shape,C);U!=null&&(s=pe({inputs:{x:s},backend:o,attrs:{shape:U}}),P.push(s))}if(n!=null){let U=xx(n.shape,C);U!=null&&(n=pe({inputs:{x:n},backend:o,attrs:{shape:U}}),P.push(n))}let B=_p({a:C?D:O,b:C?O:D,transposeA:!C,transposeB:!1,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),z=pe({inputs:{x:B},backend:o,attrs:{shape:e.outShape}});P.push(B);for(let U of P)o.disposeData(U.dataId);return z}function yx({x:r,filter:t,convInfo:e,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=n!=null,u=s!=null,c=e.dataFormat==="channelsLast",l=c&&e.filterHeight===e.inHeight&&e.filterWidth===e.inWidth&&e.padInfo.type==="VALID",m=A().getBool("WEBGPU_USE_NAIVE_CONV2D_DEBUG");if(!m&&(l||e.filterHeight===1&&e.filterWidth===1&&e.dilationHeight===1&&e.dilationWidth===1&&e.strideHeight===1&&e.strideWidth===1&&(e.padInfo.type==="SAME"||e.padInfo.type==="VALID")))return Cue({x:r,filter:t,convInfo:e,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});let d=A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),f=d>-1?d:o.thresholdToIncreaseWorkgroups,h=e.batchSize*Math.ceil(e.outHeight*e.outWidth/32)*Math.ceil(e.outChannels/32);if(A().getBool("WEBGPU_CONV_SEPARATE_IM2COL_SHADER")||h<=f)return wue({x:r,filter:t,convInfo:e,backend:o,bias:n,preluActivationWeights:s,leakyreluAlpha:a,activation:i});let g,x=[e.padInfo.top,e.padInfo.left],b=[{type:"int32",data:[e.filterHeight,e.filterWidth]},{type:"int32",data:[...x]},{type:"int32",data:[e.strideHeight,e.strideWidth]},{type:"int32",data:[e.dilationHeight,e.dilationWidth]}];if(m)g=new hx(e,p,i,u);else{let _=c?e.outHeight*e.outWidth:e.outChannels,E=c?e.outChannels:e.outHeight*e.outWidth,R=e.filterHeight*e.filterWidth*e.inChannels;b.push({type:"int32",data:[_]},{type:"int32",data:[E]},{type:"int32",data:[R]});let D=o.adapterInfo.isIntel();g=new fx(e,_,E,R,p,i,u,D)}let C=[],S=[r,t];p&&(!c&&n.shape.length===1&&(n=pe({inputs:{x:n},backend:o,attrs:{shape:[n.shape[0],1,1]}}),C.push(n)),S.push(n)),u&&(!c&&s.shape.length===1&&(s=pe({inputs:{x:s},backend:o,attrs:{shape:[s.shape[0],1,1]}}),C.push(s)),S.push(s)),i==="leakyrelu"&&(b.push({type:"float32",data:[a]}),g.uniforms+=" alpha : f32,");let k=o.runWebGPUProgram(g,S,r.dtype,b);for(let _ of C)o.disposeData(_.dataId);return k}function Sue(r){let{inputs:t,attrs:e,backend:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=e,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,s.shape,a,u,i,c,!1,l);return yx({x:n,filter:s,convInfo:m,backend:o})}var SV={kernelName:tn,backendName:"webgpu",kernelFunc:Sue};var bx=class{constructor(t){this.variableNames=["dy","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,",this.workgroupSize=[64,1,1],this.size=!1,this.isVec4=!1,this.workPerThread=1,this.outputShape=t.inShape,this.isChannelsLast=t.dataFormat==="channelsLast",this.isVec4=this.isChannelsLast&&t.outChannels%4===0&&t.inChannels%4===0,this.isVec4?(this.workPerThread=2,this.outputComponent=4,this.workgroupSize=[4,4,4],this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[4,this.workPerThread,1])):(this.size=!0,this.workPerThread=1,this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)),this.shaderKey=`conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`}getUserCode(){let t=this.isChannelsLast?1:2,e=this.isChannelsLast?2:3,o=this.isChannelsLast?3:1,n=` + `}};function Rx(r,e){let t=r.length;return t>=3?e?[...r.slice(0,-3),r[t-3]*r[t-2],r[t-1]]:[...r.slice(0,-3),r[t-3],r[t-2]*r[t-1]]:!e&&t===1&&r[0]>1?[r[0],1]:null}function ole({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=t.dataFormat==="channelsLast",u=!p,l=!1,c=p&&t.filterHeight===t.inHeight&&t.filterWidth===t.inWidth&&t.padInfo.type==="VALID",m=[],d,f;if(c){let x=t.inHeight*t.inWidth*t.inChannels;d=le({inputs:{x:r},backend:o,attrs:{shape:[1,t.batchSize,x]}}),f=le({inputs:{x:e},backend:o,attrs:{shape:[1,x,t.outChannels]}})}else d=le({inputs:{x:r},backend:o,attrs:{shape:p?[t.batchSize,t.inHeight*t.inWidth,t.inChannels]:[t.batchSize,t.inChannels,t.inHeight*t.inWidth]}}),f=le({inputs:{x:e},backend:o,attrs:{shape:[1,t.inChannels,t.outChannels]}});if(m.push(d),m.push(f),s!=null){let x=Rx(s.shape,p);x!=null&&(s=le({inputs:{x:s},backend:o,attrs:{shape:x}}),m.push(s))}if(n!=null){let x=Rx(n.shape,p);x!=null&&(n=le({inputs:{x:n},backend:o,attrs:{shape:x}}),m.push(n))}let h=Op({a:p?d:f,b:p?f:d,transposeA:u,transposeB:l,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),g=le({inputs:{x:h},backend:o,attrs:{shape:t.outShape}});m.push(h);for(let x of m)o.disposeData(x.dataId);return g}function nle({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let{filterWidth:p,filterHeight:u,inChannels:l,strideWidth:c,strideHeight:m,padInfo:d,outWidth:f,outHeight:h,dilationWidth:g,dilationHeight:x,dataFormat:b}=t,w=b==="channelsLast",S=p*u*l,k=h*f,T=w?[t.batchSize,k,S]:[t.batchSize,S,k],E=new $x(T,w),R=[{type:"int32",data:[d.top,d.left]},{type:"int32",data:[m,c]},{type:"int32",data:[x,g]},{type:"int32",data:[f]},{type:"int32",data:[l*p]},{type:"int32",data:[l]}],D=o.runWebGPUProgram(E,[r],r.dtype,R),F=[];F.push(D);let O=le({inputs:{x:e},backend:o,attrs:{shape:[1,S,-1]}});if(F.push(O),s!=null){let U=Rx(s.shape,w);U!=null&&(s=le({inputs:{x:s},backend:o,attrs:{shape:U}}),F.push(s))}if(n!=null){let U=Rx(n.shape,w);U!=null&&(n=le({inputs:{x:n},backend:o,attrs:{shape:U}}),F.push(n))}let B=Op({a:w?D:O,b:w?O:D,transposeA:!w,transposeB:!1,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a}),z=le({inputs:{x:B},backend:o,attrs:{shape:t.outShape}});F.push(B);for(let U of F)o.disposeData(U.dataId);return z}function Dx({x:r,filter:e,convInfo:t,backend:o,bias:n=null,preluActivationWeights:s=null,leakyreluAlpha:a=0,activation:i=null}){let p=n!=null,u=s!=null,l=t.dataFormat==="channelsLast",c=l&&t.filterHeight===t.inHeight&&t.filterWidth===t.inWidth&&t.padInfo.type==="VALID",m=A().getBool("WEBGPU_USE_NAIVE_CONV2D_DEBUG");if(!m&&(c||t.filterHeight===1&&t.filterWidth===1&&t.dilationHeight===1&&t.dilationWidth===1&&t.strideHeight===1&&t.strideWidth===1&&(t.padInfo.type==="SAME"||t.padInfo.type==="VALID")))return ole({x:r,filter:e,convInfo:t,backend:o,bias:n,activation:i,preluActivationWeights:s,leakyreluAlpha:a});let d=A().getNumber("WEBGPU_THRESHOLD_TO_INCREASE_WORKGROUPS_FOR_MATMUL"),f=d>-1?d:o.thresholdToIncreaseWorkgroups,h=t.batchSize*Math.ceil(t.outHeight*t.outWidth/32)*Math.ceil(t.outChannels/32);if(A().getBool("WEBGPU_CONV_SEPARATE_IM2COL_SHADER")||h<=f)return nle({x:r,filter:e,convInfo:t,backend:o,bias:n,preluActivationWeights:s,leakyreluAlpha:a,activation:i});let g,x=[t.padInfo.top,t.padInfo.left],b=[{type:"int32",data:[t.filterHeight,t.filterWidth]},{type:"int32",data:[...x]},{type:"int32",data:[t.strideHeight,t.strideWidth]},{type:"int32",data:[t.dilationHeight,t.dilationWidth]}];if(m)g=new Ex(t,p,i,u);else{let T=l?t.outHeight*t.outWidth:t.outChannels,E=l?t.outChannels:t.outHeight*t.outWidth,R=t.filterHeight*t.filterWidth*t.inChannels;b.push({type:"int32",data:[T]},{type:"int32",data:[E]},{type:"int32",data:[R]});let D=o.adapterInfo.isIntel();g=new _x(t,T,E,R,p,i,u,D)}let w=[],S=[r,e];p&&(!l&&n.shape.length===1&&(n=le({inputs:{x:n},backend:o,attrs:{shape:[n.shape[0],1,1]}}),w.push(n)),S.push(n)),u&&(!l&&s.shape.length===1&&(s=le({inputs:{x:s},backend:o,attrs:{shape:[s.shape[0],1,1]}}),w.push(s)),S.push(s)),i==="leakyrelu"&&(b.push({type:"float32",data:[a]}),g.uniforms+=" alpha : f32,");let k=o.runWebGPUProgram(g,S,r.dtype,b);for(let T of w)o.disposeData(T.dataId);return k}function sle(r){let{inputs:e,attrs:t,backend:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=t,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,s.shape,a,u,i,l,!1,c);return Dx({x:n,filter:s,convInfo:m,backend:o})}var qW={kernelName:En,backendName:"webgpu",kernelFunc:sle};var Ax=class{constructor(e){this.variableNames=["dy","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4,",this.workgroupSize=[64,1,1],this.size=!1,this.isVec4=!1,this.workPerThread=1,this.outputShape=e.inShape,this.isChannelsLast=e.dataFormat==="channelsLast",this.isVec4=this.isChannelsLast&&e.outChannels%4===0&&e.inChannels%4===0,this.isVec4?(this.workPerThread=2,this.outputComponent=4,this.workgroupSize=[4,4,4],this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[4,this.workPerThread,1])):(this.size=!0,this.workPerThread=1,this.workgroupSize=[64,1,1],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize)),this.shaderKey=`conv2DDerInput_${this.isChannelsLast}_${this.isVec4}_${this.workPerThread}`}getUserCode(){let e=this.isChannelsLast?1:2,t=this.isChannelsLast?2:3,o=this.isChannelsLast?3:1,n=` ${G()} { let batch = i32(globalId.z) / uniforms.outShape[1]; let r = i32(globalId.z) % uniforms.outShape[1]; @@ -6616,7 +6616,7 @@ return a / b;`,Wee=` let batch = coords[0]; let d1 = coords[${o}]; - let dyCorner = vec2(coords[${t}], coords[${e}]) - uniforms.pads; + let dyCorner = vec2(coords[${e}], coords[${t}]) - uniforms.pads; let dyRCorner = dyCorner.x; let dyCCorner = dyCorner.y; @@ -6651,7 +6651,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}},Cx=class{constructor(t){this.variableNames=["x","dy"],this.uniforms="pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=t.dataFormat==="channelsLast",this.shaderKey=`conv2DDerFilter_${this.isChannelsLast}`}getUserCode(){return` + `}},Fx=class{constructor(e){this.variableNames=["x","dy"],this.uniforms="pads : vec2, strides : vec2, batchSize : i32, outHeight : i32, outWidth : i32, inHeight : i32, inWidth : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e.dataFormat==="channelsLast",this.shaderKey=`conv2DDerFilter_${this.isChannelsLast}`}getUserCode(){return` ${G("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6692,8 +6692,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}},wx=class{constructor(t){this.variableNames=["x","dy"],this.uniforms=`pads : vec3, strides : vec3, batchSize : i32, outDepth : i32, - outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerFilter"}getUserCode(){return` + `}},Px=class{constructor(e){this.variableNames=["x","dy"],this.uniforms=`pads : vec3, strides : vec3, batchSize : i32, outDepth : i32, + outHeight : i32, outWidth : i32, inDepth : i32, inHeight : i32, inWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerFilter"}getUserCode(){return` ${G("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6733,8 +6733,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}},Sx=class{constructor(t){this.variableNames=["dy","W"],this.uniforms=`filterDims : vec3, pads : vec3, strides : vec3, - outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerInput"}getUserCode(){return` + `}},Ox=class{constructor(e){this.variableNames=["dy","W"],this.uniforms=`filterDims : vec3, pads : vec3, strides : vec3, + outDepth : i32, outHeight : i32, outWidth : i32, outChannels : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3DDerInput"}getUserCode(){return` ${G("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6787,7 +6787,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}};function Iue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:c}=o,l=w.convertConv2DDataFormat(p),m=w.computeConv2DInfo(n.shape,c,a,1,i,u,!1,l),d=new Cx(m),f=[{type:"int32",data:[m.padInfo.top,m.padInfo.left]},{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.batchSize]},{type:"int32",data:[m.outHeight]},{type:"int32",data:[m.outWidth]},{type:"int32",data:[m.inHeight]},{type:"int32",data:[m.inWidth]}];return e.runWebGPUProgram(d,[n,s],n.dtype,f)}var IV={kernelName:Ai,backendName:"webgpu",kernelFunc:Iue};function vue(r=4){let t=s=>{switch(s){case 1:return"return W[getIndexFromCoords4D(coord, uniforms.wShape)];";case 4:return` + `}};function ale(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,dataFormat:p,dimRoundingMode:u,filterShape:l}=o,c=C.convertConv2DDataFormat(p),m=C.computeConv2DInfo(n.shape,l,a,1,i,u,!1,c),d=new Fx(m),f=[{type:"int32",data:[m.padInfo.top,m.padInfo.left]},{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.batchSize]},{type:"int32",data:[m.outHeight]},{type:"int32",data:[m.outWidth]},{type:"int32",data:[m.inHeight]},{type:"int32",data:[m.inWidth]}];return t.runWebGPUProgram(d,[n,s],n.dtype,f)}var jW={kernelName:Ui,backendName:"webgpu",kernelFunc:ale};function ile(r=4){let e=s=>{switch(s){case 1:return"return W[getIndexFromCoords4D(coord, uniforms.wShape)];";case 4:return` let coord1 = vec4(coordX, coordY, col + 1, rowInner); let coord2 = vec4(coordX, coordY, col + 2, rowInner); let coord3 = vec4(coordX, coordY, col + 3, rowInner); @@ -6832,7 +6832,7 @@ return a / b;`,Wee=` coordX >= 0 && coordY >= 0) { let rowInner = row % uniforms.outBackprop[3]; let coord = vec4(coordX, coordY, col, rowInner); - ${t(r)} + ${e(r)} } return ${Ae(r)}(0.0); } @@ -6847,10 +6847,10 @@ return a / b;`,Wee=` col); result[getIndexFromCoords4D(outCoord, uniforms.outShape)/${r}] = value; } - }`}var Ix=class{constructor(t){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=t.inShape,y.assert(t.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),this.isVec4=t.inChannels%4===0&&t.outChannels%4===0,this.dispatchLayout={x:[3],y:[1,2],z:[0]},this.workgroupSize=pm(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=cm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4&&(this.outputComponent=4,this.variableComponents=[4,1]),this.shaderKey=`conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`}getUserCode(){let t=this.isVec4?Np(this.elementsPerThread,this.workgroupSize):Tp(this.elementsPerThread,this.workgroupSize);return` - ${vue(this.isVec4?4:1)} - ${t} - `}};function kue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(u),m=w.computeConv2DInfo(a,s.shape,i,1,p,c,!1,l),d=[{type:"int32",data:[m.filterHeight,m.filterWidth]},{type:"int32",data:[m.filterHeight-1-m.padInfo.top,m.filterWidth-1-m.padInfo.left]},{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.batchSize,m.outHeight,m.outWidth,m.outChannels]}],f;if(A().getBool("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE")||m.dataFormat!=="channelsLast")f=new bx(m);else{f=new Ix(m);let h=m.inHeight*m.inWidth,g=m.inChannels,x=m.filterHeight*m.filterWidth*m.outChannels;d.push({type:"uint32",data:[h]},{type:"uint32",data:[g]},{type:"uint32",data:[x]})}return e.runWebGPUProgram(f,[n,s],"float32",d)}var vV={kernelName:rn,backendName:"webgpu",kernelFunc:kue};var vx=class{constructor(t){this.variableNames=["x","W"],this.uniforms="filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3dnaive"}getUserCode(){return` + }`}var Mx=class{constructor(e){this.variableNames=["x","W"],this.uniforms="filterDims : vec2, pads : vec2, strides : vec2, outBackprop : vec4, dimAOuter : i32, dimBOuter : i32, dimInner : i32,",this.outputShape=e.inShape,y.assert(e.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),this.isVec4=e.inChannels%4===0&&e.outChannels%4===0,this.dispatchLayout={x:[3],y:[1,2],z:[0]},this.workgroupSize=ym(this.dispatchLayout,this.outputShape,this.isVec4),this.elementsPerThread=bm(this.dispatchLayout,this.outputShape,this.isVec4),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,this.elementsPerThread),this.isVec4&&(this.outputComponent=4,this.variableComponents=[4,1]),this.shaderKey=`conv2DDerInputMM_${this.isVec4}_${this.elementsPerThread}`}getUserCode(){let e=this.isVec4?Fp(this.elementsPerThread,this.workgroupSize):Pp(this.elementsPerThread,this.workgroupSize);return` + ${ile(this.isVec4?4:1)} + ${e} + `}};function ule(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{inputShape:a,strides:i,pad:p,dataFormat:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(u),m=C.computeConv2DInfo(a,s.shape,i,1,p,l,!1,c),d=[{type:"int32",data:[m.filterHeight,m.filterWidth]},{type:"int32",data:[m.filterHeight-1-m.padInfo.top,m.filterWidth-1-m.padInfo.left]},{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.batchSize,m.outHeight,m.outWidth,m.outChannels]}],f;if(A().getBool("WEBGPU_USE_NAIVE_CONV2D_TRANSPOSE")||m.dataFormat!=="channelsLast")f=new Ax(m);else{f=new Mx(m);let h=m.inHeight*m.inWidth,g=m.inChannels,x=m.filterHeight*m.filterWidth*m.outChannels;d.push({type:"uint32",data:[h]},{type:"uint32",data:[g]},{type:"uint32",data:[x]})}return t.runWebGPUProgram(f,[n,s],"float32",d)}var XW={kernelName:$n,backendName:"webgpu",kernelFunc:ule};var Lx=class{constructor(e){this.variableNames=["x","W"],this.uniforms="filterDims: vec3, pads: vec3, strides: vec3, dilations: vec3,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="conv3dnaive"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -6932,7 +6932,7 @@ return a / b;`,Wee=` } setOutputAtIndex(index, dotProd); } - }`}};function Nue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeConv3DInfo(n.shape,s.shape,a,p,i),c=[u.padInfo.front,u.padInfo.top,u.padInfo.left],l=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[...c]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationDepth,u.dilationHeight,u.dilationWidth]}],m=new vx(u),d=dt(n.dtype,s.dtype);return e.runWebGPUProgram(m,[n,s],d,l)}var kV={kernelName:on,backendName:"webgpu",kernelFunc:Nue};function Tue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,pad:i,filterShape:p}=o,u=w.computeConv3DInfo(n.shape,p,a,1,i),c=new wx(u),l=[{type:"int32",data:[u.padInfo.front,u.padInfo.top,u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.batchSize]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.inDepth]},{type:"int32",data:[u.inHeight]},{type:"int32",data:[u.inWidth]}];return e.runWebGPUProgram(c,[n,s],s.dtype,l)}var NV={kernelName:ja,backendName:"webgpu",kernelFunc:Tue};function _ue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{strides:a,pad:i,inputShape:p}=o,u=w.computeConv3DInfo(p,s.shape,a,1,i),c=new Sx(u),l=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[u.filterDepth-1-u.padInfo.front,u.filterHeight-1-u.padInfo.top,u.filterWidth-1-u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.outChannels]}];return e.runWebGPUProgram(c,[n,s],n.dtype,l)}var TV={kernelName:nn,backendName:"webgpu",kernelFunc:_ue};var $ue=ye({opType:Z.COS}),_V={kernelName:sn,backendName:"webgpu",kernelFunc:$ue};var Eue=ye({opType:Z.COSH}),$V={kernelName:an,backendName:"webgpu",kernelFunc:Eue};var kx=class{constructor(t,e,o,n){this.variableNames=["Image","Boxes","BoxInd"],this.uniforms="extrapolationValue : f32,",this.workgroupSize=[64,1,1],this.size=!0;let[s]=e;this.outputShape=[s,o[0],o[1],t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.methodId=n==="bilinear"?1:0,this.cropHeightBiggerThan1=this.outputShape[1]>1,this.cropWidthBiggerThan1=this.outputShape[2]>1,this.shaderKey=`cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`}getUserCode(){let[t,e]=["f32(uniforms.imageShape[1] - 1)","f32(uniforms.imageShape[2] - 1)"],[o,n,s]=this.cropHeightBiggerThan1?[`(${t} / f32(uniforms.outShape[1] - 1))`,"(y2-y1) * height_ratio",`y1*${t} + f32(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${t}`],[a,i,p]=this.cropWidthBiggerThan1?[`(${e} / f32(uniforms.outShape[2] - 1))`,"(x2-x1) * width_ratio",`x1*${e} + f32(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${e}`];return` + }`}};function ple(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeConv3DInfo(n.shape,s.shape,a,p,i),l=[u.padInfo.front,u.padInfo.top,u.padInfo.left],c=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[...l]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationDepth,u.dilationHeight,u.dilationWidth]}],m=new Lx(u),d=pt(n.dtype,s.dtype);return t.runWebGPUProgram(m,[n,s],d,c)}var YW={kernelName:Rn,backendName:"webgpu",kernelFunc:ple};function lle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,pad:i,filterShape:p}=o,u=C.computeConv3DInfo(n.shape,p,a,1,i),l=new Px(u),c=[{type:"int32",data:[u.padInfo.front,u.padInfo.top,u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.batchSize]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.inDepth]},{type:"int32",data:[u.inHeight]},{type:"int32",data:[u.inWidth]}];return t.runWebGPUProgram(l,[n,s],s.dtype,c)}var QW={kernelName:ti,backendName:"webgpu",kernelFunc:lle};function cle(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{strides:a,pad:i,inputShape:p}=o,u=C.computeConv3DInfo(p,s.shape,a,1,i),l=new Ox(u),c=[{type:"int32",data:[u.filterDepth,u.filterHeight,u.filterWidth]},{type:"int32",data:[u.filterDepth-1-u.padInfo.front,u.filterHeight-1-u.padInfo.top,u.filterWidth-1-u.padInfo.left]},{type:"int32",data:[u.strideDepth,u.strideHeight,u.strideWidth]},{type:"int32",data:[u.outDepth]},{type:"int32",data:[u.outHeight]},{type:"int32",data:[u.outWidth]},{type:"int32",data:[u.outChannels]}];return t.runWebGPUProgram(l,[n,s],n.dtype,c)}var ZW={kernelName:Dn,backendName:"webgpu",kernelFunc:cle};var mle=ye({opType:Z.COS}),JW={kernelName:An,backendName:"webgpu",kernelFunc:mle};var dle=ye({opType:Z.COSH}),eU={kernelName:Fn,backendName:"webgpu",kernelFunc:dle};var Bx=class{constructor(e,t,o,n){this.variableNames=["Image","Boxes","BoxInd"],this.uniforms="extrapolationValue : f32,",this.workgroupSize=[64,1,1],this.size=!0;let[s]=t;this.outputShape=[s,o[0],o[1],e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.methodId=n==="bilinear"?1:0,this.cropHeightBiggerThan1=this.outputShape[1]>1,this.cropWidthBiggerThan1=this.outputShape[2]>1,this.shaderKey=`cropAndResize_${this.methodId}_${this.cropHeightBiggerThan1}_${this.cropWidthBiggerThan1}`}getUserCode(){let[e,t]=["f32(uniforms.imageShape[1] - 1)","f32(uniforms.imageShape[2] - 1)"],[o,n,s]=this.cropHeightBiggerThan1?[`(${e} / f32(uniforms.outShape[1] - 1))`,"(y2-y1) * height_ratio",`y1*${e} + f32(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${e}`],[a,i,p]=this.cropWidthBiggerThan1?[`(${t} / f32(uniforms.outShape[2] - 1))`,"(x2-x1) * width_ratio",`x1*${t} + f32(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${t}`];return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -6955,12 +6955,12 @@ return a / b;`,Wee=` let height_scale = ${n}; let width_scale = ${i}; let in_y = ${s}; - if( in_y < 0.0 || in_y > ${t} ) { + if( in_y < 0.0 || in_y > ${e} ) { setOutputAtIndex(index, uniforms.extrapolationValue); return; } let in_x = ${p}; - if( in_x < 0.0 || in_x > ${e} ) { + if( in_x < 0.0 || in_x > ${t} ) { setOutputAtIndex(index, uniforms.extrapolationValue); return; } @@ -6988,23 +6988,23 @@ return a / b;`,Wee=` } } } - `}};var Rue=r=>{let{inputs:t,backend:e,attrs:o}=r,{image:n,boxes:s,boxInd:a}=t,{cropSize:i,method:p,extrapolationValue:u}=o,c=new kx(n.shape[3],s.shape,i,p),l=[{type:"float32",data:[u]}];return e.runWebGPUProgram(c,[n,s,a],"float32",l)},EV={kernelName:cn,backendName:"webgpu",kernelFunc:Rue};var Ep;(function(r){r.Prod="*",r.Sum="+"})(Ep||(Ep={}));var hm=class{constructor(t,e,o,n){this.variableNames=["x"],this.uniforms="index : f32,",this.size=!0,this.workgroupSize=[128,1,1],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.exclusive=o,this.reverse=n,this.op=t,this.shaderKey=`cum_${this.op}_${this.exclusive}_${this.reverse}`}getUserCode(){let t=this.outputShape.length,e=this.op===Ep.Prod?"1.0":"0.0",o=this.exclusive?e:`getX(${RV(t,"coords",this.op)})`,n=this.outputShape[this.outputShape.length-1],s="",a="";return this.exclusive?(s=this.reverse?`end != ${n-1}`:"end != 0",a=this.reverse?"end + 1":"end - 1"):(s=this.reverse?`end + pow2 < ${n}`:"end >= pow2",a=this.reverse?"end + pow2":"end - pow2"),` + `}};var fle=r=>{let{inputs:e,backend:t,attrs:o}=r,{image:n,boxes:s,boxInd:a}=e,{cropSize:i,method:p,extrapolationValue:u}=o,l=new Bx(n.shape[3],s.shape,i,p),c=[{type:"float32",data:[u]}];return t.runWebGPUProgram(l,[n,s,a],"float32",c)},tU={kernelName:Mn,backendName:"webgpu",kernelFunc:fle};var Lp;(function(r){r.Prod="*",r.Sum="+"})(Lp||(Lp={}));var Tm=class{constructor(e,t,o,n){this.variableNames=["x"],this.uniforms="index : f32,",this.size=!0,this.workgroupSize=[128,1,1],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.exclusive=o,this.reverse=n,this.op=e,this.shaderKey=`cum_${this.op}_${this.exclusive}_${this.reverse}`}getUserCode(){let e=this.outputShape.length,t=this.op===Lp.Prod?"1.0":"0.0",o=this.exclusive?t:`getX(${rU(e,"coords",this.op)})`,n=this.outputShape[this.outputShape.length-1],s="",a="";return this.exclusive?(s=this.reverse?`end != ${n-1}`:"end != 0",a=this.reverse?"end + 1":"end - 1"):(s=this.reverse?`end + pow2 < ${n}`:"end >= pow2",a=this.reverse?"end + pow2":"end - pow2"),` ${G("index")} { if (index < uniforms.size) { var coords = getCoordsFromIndex(index); - let end = ${DV(t,"coords",this.op)}; + let end = ${oU(e,"coords",this.op)}; var val = ${o}; let pow2 = i32(pow(2.0, uniforms.index)); if (${s}) { let idx = ${a}; - ${DV(t,"coords",this.op)} = idx; - val ${this.op}= getX(${RV(t,"coords",this.op)}); + ${oU(e,"coords",this.op)} = idx; + val ${this.op}= getX(${rU(e,"coords",this.op)}); } setOutputAtIndex(index, val); } } - `}};function RV(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.x, ${t}.y`;if(r===3)return`${t}.x, ${t}.y, ${t}.z`;if(r===4)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function DV(r,t,e){if(r===1)return`${t}`;if(r===2)return`${t}.y`;if(r===3)return`${t}.z`;if(r===4)return`${t}.w`;throw Error(`Cumulative ${e} for rank ${r} is not yet supported`)}function Nx(r,t,e,o,n,s){let a=t.shape.length,i=w.getAxesPermutation([o],a),p=t;i!=null&&(p=xr({inputs:{x:t},backend:e,attrs:{perm:i}}));let u=w.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGPU cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${o}`);let c=p.shape[u],l=At({inputs:{x:p},backend:e});for(let m=0;m<=Math.ceil(Math.log2(c))-1;m++){let d=new hm(r,p.shape,!1,s),f=l,h=[{type:"float32",data:[m]}];l=e.runWebGPUProgram(d,[l],l.dtype,h),e.disposeData(f.dataId)}if(n){let m=new hm(r,p.shape,n,s),d=l,f=[{type:"float32",data:[0]}];l=e.runWebGPUProgram(m,[l],l.dtype,f),e.disposeData(d.dataId)}if(i!=null){let m=w.getUndoAxesPermutation(i),d=xr({inputs:{x:l},backend:e,attrs:{perm:m}});return e.disposeData(l.dataId),e.disposeData(p.dataId),d}return l}function Due(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return Nx(Ep.Prod,n,e,s,a,i)}var AV={kernelName:un,backendName:"webgpu",kernelFunc:Due};function Aue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,exclusive:a,reverse:i}=o;return Nx(Ep.Sum,n,e,s,a,i)}var FV={kernelName:pn,backendName:"webgpu",kernelFunc:Aue};function Fue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,weights:s}=t,{size:a,binaryOutput:i}=o,p=n.shape.length===1,c=y.sizeFromShape(s.shape)>0,l=s.dtype,m=p?[n.shape[0]]:[n.shape[0],n.shape[1]],d=p?[a]:[n.shape[0],a],f=vt({backend:e,attrs:{shape:d,value:0,dtype:l}}),h=new Xc(m,c,i),g=[{type:"int32",data:[a]}],x=c?[n,s]:[n];return e.runWebGPUProgram(h,x,l,g,f)}var PV={kernelName:ra,backendName:"webgpu",kernelFunc:Fue};var Tx=class{constructor(t,e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.uniforms="blockSize : i32,",this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`depthToSpace_${e}`,this.dataFormat=e}getUserCode(){return` + `}};function rU(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.x, ${e}.y`;if(r===3)return`${e}.x, ${e}.y, ${e}.z`;if(r===4)return`${e}.x, ${e}.y, ${e}.z, ${e}.w`;throw Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function oU(r,e,t){if(r===1)return`${e}`;if(r===2)return`${e}.y`;if(r===3)return`${e}.z`;if(r===4)return`${e}.w`;throw Error(`Cumulative ${t} for rank ${r} is not yet supported`)}function zx(r,e,t,o,n,s){let a=e.shape.length,i=C.getAxesPermutation([o],a),p=e;i!=null&&(p=Cr({inputs:{x:e},backend:t,attrs:{perm:i}}));let u=C.getInnerMostAxes(1,a)[0];if(u!==a-1)throw new Error(`WebGPU cumprod shader expects an inner-most axis=${e.shape.length-1} but got axis=${o}`);let l=p.shape[u],c=Pt({inputs:{x:p},backend:t});for(let m=0;m<=Math.ceil(Math.log2(l))-1;m++){let d=new Tm(r,p.shape,!1,s),f=c,h=[{type:"float32",data:[m]}];c=t.runWebGPUProgram(d,[c],c.dtype,h),t.disposeData(f.dataId)}if(n){let m=new Tm(r,p.shape,n,s),d=c,f=[{type:"float32",data:[0]}];c=t.runWebGPUProgram(m,[c],c.dtype,f),t.disposeData(d.dataId)}if(i!=null){let m=C.getUndoAxesPermutation(i),d=Cr({inputs:{x:c},backend:t,attrs:{perm:m}});return t.disposeData(c.dataId),t.disposeData(p.dataId),d}return c}function hle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return zx(Lp.Prod,n,t,s,a,i)}var nU={kernelName:Pn,backendName:"webgpu",kernelFunc:hle};function gle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,exclusive:a,reverse:i}=o;return zx(Lp.Sum,n,t,s,a,i)}var sU={kernelName:On,backendName:"webgpu",kernelFunc:gle};function xle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,weights:s}=e,{size:a,binaryOutput:i}=o,p=n.shape.length===1,l=y.sizeFromShape(s.shape)>0,c=s.dtype,m=p?[n.shape[0]]:[n.shape[0],n.shape[1]],d=p?[a]:[n.shape[0],a],f=Nt({backend:t,attrs:{shape:d,value:0,dtype:c}}),h=new nc(m,l,i),g=[{type:"int32",data:[a]}],x=l?[n,s]:[n];return t.runWebGPUProgram(h,x,c,g,f)}var aU={kernelName:la,backendName:"webgpu",kernelFunc:xle};var Vx=class{constructor(e,t){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.uniforms="blockSize : i32,",this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`depthToSpace_${t}`,this.dataFormat=t}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7024,8 +7024,8 @@ return a / b;`,Wee=` let rlt = ${this.getInputSamplingString()}; setOutputAtIndex(index, rlt); } - }`}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"?"uniforms.outShape[3]":"uniforms.outShape[1]"}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function Pue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a==="NHWC"?n.shape[1]:n.shape[2],u=a==="NHWC"?n.shape[2]:n.shape[3],c=a==="NHWC"?n.shape[3]:n.shape[1],l=p*s,m=u*s,d=c/(s*s),f=a==="NHWC"?[i,l,m,d]:[i,d,l,m],h=[{type:"int32",data:[s]}],g=new Tx(f,a);return e.runWebGPUProgram(g,[n],n.dtype,h)}var OV={kernelName:ln,backendName:"webgpu",kernelFunc:Pue};var _x=class{constructor(t,e,o,n=!1,s=null,a=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2,",this.workgroupSize=[16,16,1],this.outputShape=t,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),n&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),this.addBias=n,this.activation=s,this.hasPreluActivation=a,this.filterHeight=e,this.filterWidth=o,this.shaderKey=`depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`}getUserCode(){let t=this.filterWidth*this.filterHeight,e=this.workgroupSize[0]*this.workgroupSize[1]*this.workgroupSize[2],o=this.workgroupSize[1]+this.filterHeight-1,n=this.workgroupSize[0]+this.filterWidth-1;return` - ${dr(this.activation,this.hasPreluActivation,!1,4)} + }`}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"?"uniforms.outShape[3]":"uniforms.outShape[1]"}getInputSamplingString(){return this.dataFormat==="NHWC"?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}};function yle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockSize:s,dataFormat:a}=o,i=n.shape[0],p=a==="NHWC"?n.shape[1]:n.shape[2],u=a==="NHWC"?n.shape[2]:n.shape[3],l=a==="NHWC"?n.shape[3]:n.shape[1],c=p*s,m=u*s,d=l/(s*s),f=a==="NHWC"?[i,c,m,d]:[i,d,c,m],h=[{type:"int32",data:[s]}],g=new Vx(f,a);return t.runWebGPUProgram(g,[n],n.dtype,h)}var iU={kernelName:Ln,backendName:"webgpu",kernelFunc:yle};var Wx=class{constructor(e,t,o,n=!1,s=null,a=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2,",this.workgroupSize=[16,16,1],this.outputShape=e,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),n&&this.variableNames.push("bias"),a&&this.variableNames.push("preluActivationWeights"),this.addBias=n,this.activation=s,this.hasPreluActivation=a,this.filterHeight=t,this.filterWidth=o,this.shaderKey=`depthwiseNCHW_${this.activation}_${this.filterHeight}_${this.filterWidth}`}getUserCode(){let e=this.filterWidth*this.filterHeight,t=this.workgroupSize[0]*this.workgroupSize[1]*this.workgroupSize[2],o=this.workgroupSize[1]+this.filterHeight-1,n=this.workgroupSize[0]+this.filterWidth-1;return` + ${gr(this.activation,this.hasPreluActivation,!1,4)} var mm_Asub : array, ${o}>; var mm_Bsub : array, ${this.filterHeight}>; @@ -7063,7 +7063,7 @@ return a / b;`,Wee=` // Load one tile of W into local memory. var wIndex = i32(localIndex); - ${t, inDims : vec2, virtualWidth : i32,",this.workgroupSize=[64,1,1],this.workPerThread=4,this.outputComponent=4,this.outputShape=t.outShape,this.virtualWidth=Math.ceil(this.outputShape[2]/this.workPerThread)*this.workPerThread;let s=[this.outputShape[0],this.outputShape[1],this.virtualWidth,this.outputShape[3]];this.dispatchLayout=X(s),this.dispatch=H(this.dispatchLayout,s,this.workgroupSize,[this.outputComponent*this.workPerThread,1,1]),y.assert(t.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),e&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.convInfo=t,this.addBias=e,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwiseVec4_${o}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`}getUserCode(){let t=(this.workPerThread-1)*this.convInfo.strideWidth+this.convInfo.filterWidth,e=this.convInfo.strideHeight,o=this.convInfo.strideWidth;return` - ${dr(this.activation,this.hasPreluActivation,!0,4)} + `}};var ac=class{constructor(e,t=!1,o=null,n=!1){this.variableNames=["x","W"],this.uniforms="pads : vec2, inDims : vec2, virtualWidth : i32,",this.workgroupSize=[64,1,1],this.workPerThread=4,this.outputComponent=4,this.outputShape=e.outShape,this.virtualWidth=Math.ceil(this.outputShape[2]/this.workPerThread)*this.workPerThread;let s=[this.outputShape[0],this.outputShape[1],this.virtualWidth,this.outputShape[3]];this.dispatchLayout=X(s),this.dispatch=H(this.dispatchLayout,s,this.workgroupSize,[this.outputComponent*this.workPerThread,1,1]),y.assert(e.dataFormat==="channelsLast",()=>"TODO: NCHW is unimplemented"),t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.convInfo=e,this.addBias=t,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwiseVec4_${o}_${this.convInfo.filterHeight}_${this.convInfo.filterWidth}_${this.convInfo.strideHeight}_${this.convInfo.strideWidth}_${this.workPerThread}`}getUserCode(){let e=(this.workPerThread-1)*this.convInfo.strideWidth+this.convInfo.filterWidth,t=this.convInfo.strideHeight,o=this.convInfo.strideWidth;return` + ${gr(this.activation,this.hasPreluActivation,!0,4)} fn readX(batch : i32, row : i32, col : i32, channel : i32) -> vec4 { var value = vec4(0.0); if (col >=0 && col < uniforms.inDims[1]) { @@ -7106,11 +7106,11 @@ return a / b;`,Wee=` let r = index1 % uniforms.outShape[1]; let batch = index1 / uniforms.outShape[1]; - let xRCCorner = vec2(r, c) * vec2(${e}, ${o}) - uniforms.pads; + let xRCCorner = vec2(r, c) * vec2(${t}, ${o}) - uniforms.pads; let xRCorner = xRCCorner.x; let xCCorner = xRCCorner.y; - var xVals : array, ${t}>; + var xVals : array, ${e}>; var dotProd : array, ${this.workPerThread}>; for (var i = 0; i < ${this.workPerThread}; i++) { dotProd[i] = vec4(0.0); @@ -7120,7 +7120,7 @@ return a / b;`,Wee=` for (var wR = 0; wR < ${this.convInfo.filterHeight}; wR = wR + 1) { let xR = xRCorner + wR; if (xR >=0 && xR < uniforms.inDims[0]) { - for (var i = 0; i < ${t}; i++) { + for (var i = 0; i < ${e}; i++) { xVals[i] = readX(batch, xR, xCCorner + i, d1); } for (var wC = 0; wC < ${this.convInfo.filterWidth}; wC = wC + 1) { @@ -7136,14 +7136,14 @@ return a / b;`,Wee=` let coords = vec4(batch, r, c + i, d1); if (coordsInBounds4D(coords, uniforms.outShape)) { var value = dotProd[i]; - ${Qr(this.addBias,this.activation)} + ${no(this.addBias,this.activation)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } } } - `}};var Zc=class{constructor(t,e=!1,o=null,n=!1){this.variableNames=["x","W"],this.uniforms=`pads : vec2, inDims : vec2, filterHeight : i32, - filterWidth : i32, strides : vec2, dilations : vec2,`,this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=t.dataFormat==="channelsLast",e&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.convInfo=t,this.addBias=e,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwise_${this.activation}_${this.isChannelsLast}`}getUserCode(){let t=this.isChannelsLast?"getX(batch, xR, xC, d1);":"getX(batch, d1, xR, xC);";return` - ${dr(this.activation,this.hasPreluActivation,!1,4)} + `}};var ic=class{constructor(e,t=!1,o=null,n=!1){this.variableNames=["x","W"],this.uniforms=`pads : vec2, inDims : vec2, filterHeight : i32, + filterWidth : i32, strides : vec2, dilations : vec2,`,this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.isChannelsLast=e.dataFormat==="channelsLast",t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),this.convInfo=e,this.addBias=t,this.activation=o,this.hasPreluActivation=n,this.shaderKey=`depthwise_${this.activation}_${this.isChannelsLast}`}getUserCode(){let e=this.isChannelsLast?"getX(batch, xR, xC, d1);":"getX(batch, d1, xR, xC);";return` + ${gr(this.activation,this.hasPreluActivation,!1,4)} ${G("index")} { if (index < uniforms.size) { @@ -7178,7 +7178,7 @@ return a / b;`,Wee=` for (var wC = 0; wC < uniforms.filterWidth; wC = wC + 1) { let xC = inputColStart + wC * uniforms.dilations[1]; - let xVal = ${t}; + let xVal = ${e}; let wVal = getW(wR, wC, d1, q); value = value + xVal * wVal; } @@ -7198,18 +7198,18 @@ return a / b;`,Wee=` continue; } - let xVal = ${t}; + let xVal = ${e}; let wVal = getW(wR, wC, d1, q); value = value + xVal * wVal; } } } - ${Qr(this.addBias,this.activation)} + ${no(this.addBias,this.activation)} setOutputAtCoords(coords[0], coords[1], coords[2], coords[3], value); } } - `}};function Oue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:c}=o,l=w.convertConv2DDataFormat(p),m=u;m==null&&(m=[1,1]);let d=w.computeConv2DInfo(n.shape,s.shape,a,m,i,c,!0,l),f=[{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.inHeight,d.inWidth]}],h=d.dataFormat==="channelsLast",g;return!h&&d.inHeight>16&&d.inWidth>16&&d.strideHeight===1&&d.strideWidth===1&&d.dilationWidth===1&&d.dilationHeight===1&&d.inChannels===d.outChannels?g=new _x(d.outShape,d.filterHeight,d.filterWidth):h&&d.outHeight>4&&d.outWidth>4&&d.strideWidth<=2&&d.inChannels===d.outChannels&&d.dilationHeight===1&&d.dilationWidth===1&&d.inChannels%4===0?(g=new Qc(d),f.push({type:"int32",data:[g.virtualWidth]})):(g=new Zc(d),f.push({type:"int32",data:[d.filterHeight]},{type:"int32",data:[d.filterWidth]},{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]})),e.runWebGPUProgram(g,[n,s],n.dtype,f)}var MV={kernelName:mn,backendName:"webgpu",kernelFunc:Oue};var $x=class{constructor(t){this.variableNames=["x","dy"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32, - outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_filter"}getUserCode(){return` + `}};function ble(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dataFormat:p,dilations:u,dimRoundingMode:l}=o,c=C.convertConv2DDataFormat(p),m=u;m==null&&(m=[1,1]);let d=C.computeConv2DInfo(n.shape,s.shape,a,m,i,l,!0,c),f=[{type:"int32",data:[d.padInfo.top,d.padInfo.left]},{type:"int32",data:[d.inHeight,d.inWidth]}],h=d.dataFormat==="channelsLast",g;return!h&&d.inHeight>16&&d.inWidth>16&&d.strideHeight===1&&d.strideWidth===1&&d.dilationWidth===1&&d.dilationHeight===1&&d.inChannels===d.outChannels?g=new Wx(d.outShape,d.filterHeight,d.filterWidth):h&&d.outHeight>4&&d.outWidth>4&&d.strideWidth<=2&&d.inChannels===d.outChannels&&d.dilationHeight===1&&d.dilationWidth===1&&d.inChannels%4===0?(g=new ac(d),f.push({type:"int32",data:[g.virtualWidth]})):(g=new ic(d),f.push({type:"int32",data:[d.filterHeight]},{type:"int32",data:[d.filterWidth]},{type:"int32",data:[d.strideHeight,d.strideWidth]},{type:"int32",data:[d.dilationHeight,d.dilationWidth]})),t.runWebGPUProgram(g,[n,s],n.dtype,f)}var uU={kernelName:Bn,backendName:"webgpu",kernelFunc:ble};var Ux=class{constructor(e){this.variableNames=["x","dy"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, outHeight : i32, + outWidth : i32, inHeight : i32, inWidth : i32, batchSize : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_filter"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7244,8 +7244,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}},Ex=class{constructor(t){this.variableNames=["dy","W"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, - outHeight : i32, outWidth : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_input"}getUserCode(){return` + `}},Gx=class{constructor(e){this.variableNames=["dy","W"],this.uniforms=`strides : vec2, pads : vec2, filterDims : vec2, + outHeight : i32, outWidth : i32, channelMul : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="depthwise_conv2d_backprop_input"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7287,7 +7287,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}};function Mue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,dy:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:c}=o,l=w.computeConv2DInfo(n.shape,c,a,i,p,u,!0),m=new $x(l),d=[{type:"int32",data:[l.strideHeight,l.strideWidth]},{type:"int32",data:[l.padInfo.top,l.padInfo.left]},{type:"int32",data:[l.filterHeight,l.filterWidth]},{type:"int32",data:[l.outHeight]},{type:"int32",data:[l.outWidth]},{type:"int32",data:[l.inHeight]},{type:"int32",data:[l.inWidth]},{type:"int32",data:[l.batchSize]},{type:"int32",data:[l.outChannels/l.inChannels]}];return e.runWebGPUProgram(m,[n,s],"float32",d)}var LV={kernelName:Fi,backendName:"webgpu",kernelFunc:Mue};function Lue(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,filter:s}=t,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:c}=o,l=w.computeConv2DInfo(c,s.shape,a,i,p,u,!0),m=new Ex(l),d=[{type:"int32",data:[l.strideHeight,l.strideWidth]},{type:"int32",data:[l.filterHeight-1-l.padInfo.top,l.filterWidth-1-l.padInfo.left]},{type:"int32",data:[l.filterHeight,l.filterWidth]},{type:"int32",data:[l.outHeight]},{type:"int32",data:[l.outWidth]},{type:"int32",data:[l.outChannels/l.inChannels]}];return e.runWebGPUProgram(m,[n,s],n.dtype,d)}var BV={kernelName:Pi,backendName:"webgpu",kernelFunc:Lue};var Rx=class{constructor(t){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="diag"}getUserCode(){return` + `}};function Cle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,dy:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,filterShape:l}=o,c=C.computeConv2DInfo(n.shape,l,a,i,p,u,!0),m=new Ux(c),d=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.inHeight]},{type:"int32",data:[c.inWidth]},{type:"int32",data:[c.batchSize]},{type:"int32",data:[c.outChannels/c.inChannels]}];return t.runWebGPUProgram(m,[n,s],"float32",d)}var pU={kernelName:Gi,backendName:"webgpu",kernelFunc:Cle};function wle(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,filter:s}=e,{strides:a,dilations:i,pad:p,dimRoundingMode:u,inputShape:l}=o,c=C.computeConv2DInfo(l,s.shape,a,i,p,u,!0),m=new Gx(c),d=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.filterHeight-1-c.padInfo.top,c.filterWidth-1-c.padInfo.left]},{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.outHeight]},{type:"int32",data:[c.outWidth]},{type:"int32",data:[c.outChannels/c.inChannels]}];return t.runWebGPUProgram(m,[n,s],n.dtype,d)}var lU={kernelName:Hi,backendName:"webgpu",kernelFunc:wle};var Hx=class{constructor(e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="diag"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -7295,7 +7295,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, value); } } - `}};function Bue(r){let{inputs:t,backend:e}=r,{x:o}=t,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=pe({inputs:{x:o},backend:e,attrs:{shape:[s]}}),i=new Rx(s),p=e.runWebGPUProgram(i,[a],a.dtype),u=pe({inputs:{x:p},backend:e,attrs:{shape:n}});return e.disposeData(a.dataId),e.disposeData(p.dataId),u}var zV={kernelName:oa,backendName:"webgpu",kernelFunc:Bue};var Dx=class{constructor(t){this.variableNames=["x","w"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="dilation2d"}getUserCode(){return` + `}};function Sle(r){let{inputs:e,backend:t}=r,{x:o}=e,n=[...o.shape,...o.shape],s=y.sizeFromShape(o.shape),a=le({inputs:{x:o},backend:t,attrs:{shape:[s]}}),i=new Hx(s),p=t.runWebGPUProgram(i,[a],a.dtype),u=le({inputs:{x:p},backend:t,attrs:{shape:n}});return t.disposeData(a.dataId),t.disposeData(p.dataId),u}var cU={kernelName:ca,backendName:"webgpu",kernelFunc:Sle};var Kx=class{constructor(e){this.variableNames=["x","w"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.outShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="dilation2d"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let neg_infinity = -3.4e38; @@ -7327,8 +7327,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, curVal); } } - `}};function zue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s}=t,{strides:a,pad:i,dilations:p}=o,u=w.computeDilation2DInfo(n.shape,s.shape,a,i,"NHWC",p),c=[u.padInfo.top,u.padInfo.left],l=[{type:"int32",data:[u.filterHeight,u.filterWidth]},{type:"int32",data:[...c]},{type:"int32",data:[u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationHeight,u.dilationWidth]}],m=new Dx(u);return e.runWebGPUProgram(m,[n,s],n.dtype,l)}var VV={kernelName:dn,backendName:"webgpu",kernelFunc:zue};var Ax=class{constructor(t,e){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t.inShape,this.dispatchLayout=X(t.outShape),this.dispatch=H(this.dispatchLayout,t.outShape,this.workgroupSize),e!=="float32"&&e!=="int32")throw new Error(`Dilation2DBackpropInput only supports float32 and int32 - types, does not support ${e} type.`);this.type=e,this.shaderKey="dilation2DBackpropInput"}getUserCode(){return` + `}};function Ile(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s}=e,{strides:a,pad:i,dilations:p}=o,u=C.computeDilation2DInfo(n.shape,s.shape,a,i,"NHWC",p),l=[u.padInfo.top,u.padInfo.left],c=[{type:"int32",data:[u.filterHeight,u.filterWidth]},{type:"int32",data:[...l]},{type:"int32",data:[u.strideHeight,u.strideWidth]},{type:"int32",data:[u.dilationHeight,u.dilationWidth]}],m=new Kx(u);return t.runWebGPUProgram(m,[n,s],n.dtype,c)}var mU={kernelName:zn,backendName:"webgpu",kernelFunc:Ile};var qx=class{constructor(e,t){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.inShape,this.dispatchLayout=X(e.outShape),this.dispatch=H(this.dispatchLayout,e.outShape,this.workgroupSize),t!=="float32"&&t!=="int32")throw new Error(`Dilation2DBackpropInput only supports float32 and int32 + types, does not support ${t} type.`);this.type=t,this.shaderKey="dilation2DBackpropInput"}getUserCode(){return` ${G("index")} { if (index < uniforms.dySize) { let coords = getDyCoordsFromIndex(index); @@ -7368,10 +7368,10 @@ return a / b;`,Wee=` let flatIndexIn = d + uniforms.xShape[3] * (xCMax + uniforms.xShape[2] * (xRMax + uniforms.xShape[1] * b)); let value = getDy(b, r, c, d); - ${Yr("&result[flatIndexIn]","value",this.type)} + ${oo("&result[flatIndexIn]","value",this.type)} } } - `}},Fx=class{constructor(t,e,o){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t.filterShape,this.dispatchLayout=X(t.outShape),this.dispatch=H(this.dispatchLayout,t.outShape,this.workgroupSize),o!=="float32"&&o!=="int32")throw new Error(`Dilation2DBackpropFilter only supports float32 and int32 + `}},jx=class{constructor(e,t,o){if(this.variableNames=["x","w","dy"],this.uniforms="filterDims: vec2, pads: vec2, strides: vec2, dilations: vec2, dySize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e.filterShape,this.dispatchLayout=X(e.outShape),this.dispatch=H(this.dispatchLayout,e.outShape,this.workgroupSize),o!=="float32"&&o!=="int32")throw new Error(`Dilation2DBackpropFilter only supports float32 and int32 types, does not support ${o} type.`);this.type=o,this.shaderKey="dilation2DBackpropFilter"}getUserCode(){return` ${G("index")} { if (index < uniforms.dySize) { @@ -7411,16 +7411,16 @@ return a / b;`,Wee=` let flatIndexIn = d + uniforms.wShape[2] * (wCMax + wRMax * uniforms.wShape[1]); let value = getDy(b, r, c, d); - ${Yr("&result[flatIndexIn]","value",this.type)} + ${oo("&result[flatIndexIn]","value",this.type)} } } - `}};function Vue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o,c=w.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),l=s.dtype,m=new Fx(c,s.shape,l),d=[{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.dilationHeight,c.dilationWidth]},{type:"int32",data:[y.sizeFromShape(c.outShape)]}],f=vt({backend:e,attrs:{shape:s.shape,value:0,dtype:l}});return e.runWebGPUProgram(m,[n,s,a],l,d,f)}var WV={kernelName:Mi,backendName:"webgpu",kernelFunc:Vue};function Wue(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,dy:a}=t,{strides:i,pad:p,dilations:u}=o,c=w.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),l=n.dtype,m=new Ax(c,l),d=[{type:"int32",data:[c.filterHeight,c.filterWidth]},{type:"int32",data:[c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.dilationHeight,c.dilationWidth]},{type:"int32",data:[y.sizeFromShape(c.outShape)]}],f=vt({backend:e,attrs:{shape:c.inShape,value:0,dtype:l}});return e.runWebGPUProgram(m,[n,s,a],l,d,f)}var UV={kernelName:Oi,backendName:"webgpu",kernelFunc:Wue};var Px=class{constructor(t,e,o){this.variableNames=["Image"],this.uniforms="alpha: f32,",this.workgroupSize=[64,1,1],this.pixelsOpType=Ci.DRAW,this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.type=e,this.textureFormat=o,this.shaderKey=`draw_${e}_${o}`}getUserCode(){let t,e=this.type==="float32"?"value":"value / 255.0";return t=` + `}};function vle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o,l=C.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),c=s.dtype,m=new jx(l,s.shape,c),d=[{type:"int32",data:[l.filterHeight,l.filterWidth]},{type:"int32",data:[l.padInfo.top,l.padInfo.left]},{type:"int32",data:[l.strideHeight,l.strideWidth]},{type:"int32",data:[l.dilationHeight,l.dilationWidth]},{type:"int32",data:[y.sizeFromShape(l.outShape)]}],f=Nt({backend:t,attrs:{shape:s.shape,value:0,dtype:c}});return t.runWebGPUProgram(m,[n,s,a],c,d,f)}var dU={kernelName:qi,backendName:"webgpu",kernelFunc:vle};function kle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,dy:a}=e,{strides:i,pad:p,dilations:u}=o,l=C.computeDilation2DInfo(n.shape,s.shape,i,p,"NHWC",u),c=n.dtype,m=new qx(l,c),d=[{type:"int32",data:[l.filterHeight,l.filterWidth]},{type:"int32",data:[l.padInfo.top,l.padInfo.left]},{type:"int32",data:[l.strideHeight,l.strideWidth]},{type:"int32",data:[l.dilationHeight,l.dilationWidth]},{type:"int32",data:[y.sizeFromShape(l.outShape)]}],f=Nt({backend:t,attrs:{shape:l.inShape,value:0,dtype:c}});return t.runWebGPUProgram(m,[n,s,a],c,d,f)}var fU={kernelName:Ki,backendName:"webgpu",kernelFunc:kle};var Xx=class{constructor(e,t,o){this.variableNames=["Image"],this.uniforms="alpha: f32,",this.workgroupSize=[64,1,1],this.pixelsOpType=$i.DRAW,this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.type=t,this.textureFormat=o,this.shaderKey=`draw_${t}_${o}`}getUserCode(){let e,t=this.type==="float32"?"value":"value / 255.0";return e=` if (uniforms.numChannels == 1) { - rgba[0] = ${e}; - rgba[1] = ${e}; - rgba[2] = ${e}; + rgba[0] = ${t}; + rgba[1] = ${t}; + rgba[2] = ${t}; } else { - rgba[d] = ${e}; + rgba[d] = ${t}; }`,` @group(0) @binding(0) var outImage : texture_storage_2d<${this.textureFormat}, write>; ${G("index")} { @@ -7428,7 +7428,7 @@ return a / b;`,Wee=` var rgba = vec4(0.0, 0.0, 0.0, uniforms.alpha); for (var d = 0; d < uniforms.numChannels; d = d + 1) { let value = f32(inBuf[index * uniforms.numChannels + d]); - ${t} + ${e} } rgba.x = rgba.x * rgba.w; rgba.y = rgba.y * rgba.w; @@ -7437,7 +7437,7 @@ return a / b;`,Wee=` textureStore(outImage, vec2(coords.yx), rgba); } } - `}};function Uue(r){let{inputs:t,backend:e,attrs:o}=r,{image:n}=t,{canvas:s,options:a}=o,[i,p]=n.shape.slice(0,2),{imageOptions:u}=a||{},c=(u==null?void 0:u.alpha)||1,l=e.device.features.has("bgra8unorm-storage")?"bgra8unorm":"rgba8unorm",m=[i,p],d=new Px(m,n.dtype,l);s.width=p,s.height=i;let f="webgpu",h=s.getContext(f),g;h||(g=new OffscreenCanvas(p,i),h=g.getContext(f));let x=n.shape.length===3?n.shape[2]:1;h.configure({device:e.device,format:l,usage:GPUTextureUsage.STORAGE_BINDING,alphaMode:"premultiplied"});let b="int32",C=e.makeTensorInfo(m,b),S=e.tensorMap.get(C.dataId);S.resource=h.getCurrentTexture(),S.external=!0;let k=[{type:"uint32",data:[x]},{type:"float32",data:[c]}];if(e.runWebGPUProgram(d,[n],b,k,C),g){let _=s.getContext("2d");if(!_)throw new Error("Please make sure this canvas has only been used for 2d or webgpu context!");_.drawImage(g,0,0)}return e.disposeData(C.dataId),n}var GV={kernelName:_u,backendName:"webgpu",kernelFunc:Uue};var a0=et({opType:fe.MUL,cpuKernelImpl:kz,supportsComplex:!0}),HV={kernelName:Xn,backendName:"webgpu",kernelFunc:a0};function i0(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;return Jr(n,s,a,"sum",e)}var KV={kernelName:Ss,backendName:"webgpu",kernelFunc:i0};function Gue(r){let{inputs:t,backend:e,attrs:o}=r,{equation:n}=o,s=t,{allDims:a,summedDims:i,idDims:p}=w.decodeEinsumEquation(n,s.length);w.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:c}=w.getEinsumComputePath(i,p),l=c.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=i0({inputs:{x:m},backend:e,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&e.disposeData(h.dataId);return m}var qV={kernelName:Li,backendName:"webgpu",kernelFunc:Gue};var Hue=ye({opType:Z.ELU}),jV={kernelName:hn,backendName:"webgpu",kernelFunc:Hue};var Kue=r=>{let{inputs:t,backend:e}=r,{dy:o,y:n}=t,s=new Si(fe.ELU_DER,o.shape,n.shape);return e.runWebGPUProgram(s,[o,n],o.dtype)},XV={kernelName:Xa,backendName:"webgpu",kernelFunc:Kue};var que=et({opType:fe.EQUAL,dtype:"bool",cpuKernelImpl:cz}),YV={kernelName:xn,backendName:"webgpu",kernelFunc:que};var jue=ye({opType:Z.ERF}),QV={kernelName:gn,backendName:"webgpu",kernelFunc:jue};var Xue=ye({opType:Z.EXP,cpuKernelImpl:lz,dtype:"float32"}),ZV={kernelName:yn,backendName:"webgpu",kernelFunc:Xue};function Ox(r){let{inputs:t,attrs:e,backend:o}=r,{dim:n}=e,{input:s}=t,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),pe({inputs:{x:s},backend:o,attrs:{shape:i}})}var JV={kernelName:na,backendName:"webgpu",kernelFunc:Ox};var Yue=ye({opType:Z.EXPM1,cpuKernelImpl:mz}),eW={kernelName:bn,backendName:"webgpu",kernelFunc:Yue};var gm=class{constructor(t,e){this.variableNames=["real","imag"],this.outputShape=[],this.uniforms="exponentMultiplier : f32, denominator: f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.component=t,this.shaderKey=`fft_${t}`}getUserCode(){return` + `}};function Nle(r){let{inputs:e,backend:t,attrs:o}=r,{image:n}=e,{canvas:s,options:a}=o,[i,p]=n.shape.slice(0,2),{imageOptions:u}=a||{},l=(u==null?void 0:u.alpha)||1,c=t.device.features.has("bgra8unorm-storage")?"bgra8unorm":"rgba8unorm",m=[i,p],d=new Xx(m,n.dtype,c);s.width=p,s.height=i;let f="webgpu",h=s.getContext(f),g;h||(g=new OffscreenCanvas(p,i),h=g.getContext(f));let x=n.shape.length===3?n.shape[2]:1;h.configure({device:t.device,format:c,usage:GPUTextureUsage.STORAGE_BINDING,alphaMode:"premultiplied"});let b="int32",w=t.makeTensorInfo(m,b),S=t.tensorMap.get(w.dataId);S.resource=h.getCurrentTexture(),S.external=!0;let k=[{type:"uint32",data:[x]},{type:"float32",data:[l]}];if(t.runWebGPUProgram(d,[n],b,k,w),g){let T=s.getContext("2d");if(!T)throw new Error("Please make sure this canvas has only been used for 2d or webgpu context!");T.drawImage(g,0,0)}return t.disposeData(w.dataId),n}var hU={kernelName:Mu,backendName:"webgpu",kernelFunc:Nle};var Kv=tt({opType:fe.MUL,cpuKernelImpl:YV,supportsComplex:!0}),gU={kernelName:$o,backendName:"webgpu",kernelFunc:Kv};function qv(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;return ao(n,s,a,"sum",t)}var xU={kernelName:As,backendName:"webgpu",kernelFunc:qv};function Tle(r){let{inputs:e,backend:t,attrs:o}=r,{equation:n}=o,s=e,{allDims:a,summedDims:i,idDims:p}=C.decodeEinsumEquation(n,s.length);C.checkEinsumDimSizes(a.length,p,s);let{path:u,steps:l}=C.getEinsumComputePath(i,p),c=l.length,m=null,d=a.length,f=[];for(let h=0;h=0&&(m=qv({inputs:{x:m},backend:t,attrs:{axis:u[h]-(a.length-d),keepDims:!1}}),f.push(m)),d--)}for(let h of f)h!==m&&t.disposeData(h.dataId);return m}var yU={kernelName:ji,backendName:"webgpu",kernelFunc:Tle};var _le=ye({opType:Z.ELU}),bU={kernelName:Wn,backendName:"webgpu",kernelFunc:_le};var Ele=r=>{let{inputs:e,backend:t}=r,{dy:o,y:n}=e,s=new Di(fe.ELU_DER,o.shape,n.shape);return t.runWebGPUProgram(s,[o,n],o.dtype)},CU={kernelName:ri,backendName:"webgpu",kernelFunc:Ele};var $le=tt({opType:fe.EQUAL,dtype:"bool",cpuKernelImpl:PV}),wU={kernelName:xo,backendName:"webgpu",kernelFunc:$le};var Rle=ye({opType:Z.ERF}),SU={kernelName:Un,backendName:"webgpu",kernelFunc:Rle};var Dle=ye({opType:Z.EXP,cpuKernelImpl:OV,dtype:"float32"}),IU={kernelName:yo,backendName:"webgpu",kernelFunc:Dle};function Yx(r){let{inputs:e,attrs:t,backend:o}=r,{dim:n}=t,{input:s}=e,a=s.shape.length,i=s.shape.slice(),p=n;return n<0&&(y.assert(-(a+1)<=n,()=>`Axis must be in the interval [${-(a+1)}, ${a}]`),p=a+n+1),i.splice(p,0,1),le({inputs:{x:s},backend:o,attrs:{shape:i}})}var vU={kernelName:ma,backendName:"webgpu",kernelFunc:Yx};var Ale=ye({opType:Z.EXPM1,cpuKernelImpl:MV}),kU={kernelName:bo,backendName:"webgpu",kernelFunc:Ale};var _m=class{constructor(e,t){this.variableNames=["real","imag"],this.outputShape=[],this.uniforms="exponentMultiplier : f32, denominator: f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.component=e,this.shaderKey=`fft_${e}`}getUserCode(){return` fn unaryOpComplex(real: f32, expR: f32, imag: f32, expI: f32) -> f32 { ${this.component==="real"?"return real * expR - imag * expI;":"return real * expI + imag * expR;"} } @@ -7470,7 +7470,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, mulMatDFT(coords[0], coords[1])); } } - `}};function Mx(r,t,e){let o=e.tensorMap.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=[],p=pe({inputs:{x:r},backend:e,attrs:{shape:[a,s]}});i.push(p);let u=p.shape,c=new gm("real",u),l=new gm("imag",u),m=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:u},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:u}],d=t?2*Math.PI:-2*Math.PI,f=t?u[1]:1,h=[{type:"float32",data:[d]},{type:"float32",data:[f]}],g=e.runWebGPUProgram(c,m,"float32",h);i.push(g);let x=e.runWebGPUProgram(l,m,"float32",h);i.push(x);let b=xo({inputs:{real:g,imag:x},backend:e});i.push(b);let C=pe({inputs:{x:b},backend:e,attrs:{shape:r.shape}});return i.forEach(S=>e.disposeData(S.dataId)),C}function Que(r){let{inputs:t,backend:e}=r,{input:o}=t;return Mx(o,!1,e)}var tW={kernelName:Bi,backendName:"webgpu",kernelFunc:Que};var Lx=class{constructor(t){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="flipLeftRight"}getUserCode(){return` + `}};function Qx(r,e,t){let o=t.tensorMap.get(r.dataId),n=y.sizeFromShape(r.shape),s=r.shape[r.shape.length-1],a=n/s,i=[],p=le({inputs:{x:r},backend:t,attrs:{shape:[a,s]}});i.push(p);let u=p.shape,l=new _m("real",u),c=new _m("imag",u),m=[{dataId:o.complexTensorInfos.real.dataId,dtype:o.complexTensorInfos.real.dtype,shape:u},{dataId:o.complexTensorInfos.imag.dataId,dtype:o.complexTensorInfos.imag.dtype,shape:u}],d=e?2*Math.PI:-2*Math.PI,f=e?u[1]:1,h=[{type:"float32",data:[d]},{type:"float32",data:[f]}],g=t.runWebGPUProgram(l,m,"float32",h);i.push(g);let x=t.runWebGPUProgram(c,m,"float32",h);i.push(x);let b=Uo({inputs:{real:g,imag:x},backend:t});i.push(b);let w=le({inputs:{x:b},backend:t,attrs:{shape:r.shape}});return i.forEach(S=>t.disposeData(S.dataId)),w}function Fle(r){let{inputs:e,backend:t}=r,{input:o}=e;return Qx(o,!1,t)}var NU={kernelName:Xi,backendName:"webgpu",kernelFunc:Fle};var Zx=class{constructor(e){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="flipLeftRight"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7479,61 +7479,61 @@ return a / b;`,Wee=` setOutputAtIndex(index, outputValue); } } - `}};var rW={kernelName:Cn,backendName:"webgpu",kernelFunc:({inputs:r,backend:t})=>{let{image:e}=r,o=t,n=new Lx(e.shape);return o.runWebGPUProgram(n,[e],e.dtype)}};var Zue=ye({opType:Z.FLOOR,cpuKernelImpl:dz}),oW={kernelName:wn,backendName:"webgpu",kernelFunc:Zue};var Jue=et({opType:fe.FLOOR_DIV,cpuKernelImpl:fz,dtype:"int32"}),nW={kernelName:Sn,backendName:"webgpu",kernelFunc:Jue};var Bx=class{constructor(t,e,o=!1){this.pixelsOpType=Ci.FROM_PIXELS,this.outputShape=[0],this.variableNames=[],this.workgroupSize=[256,1,1],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[e,1,1]),this.importVideo=o,this.shaderKey=`fromPixels_${this.importVideo}`}getUserCode(){let t=this.importVideo?"textureLoad(src, vec2(coords.yx));":"textureLoad(src, vec2(coords.yx), 0)";return` + `}};var TU={kernelName:Gn,backendName:"webgpu",kernelFunc:({inputs:r,backend:e})=>{let{image:t}=r,o=e,n=new Zx(t.shape);return o.runWebGPUProgram(n,[t],t.dtype)}};var Ple=ye({opType:Z.FLOOR,cpuKernelImpl:LV}),_U={kernelName:Co,backendName:"webgpu",kernelFunc:Ple};var Ole=tt({opType:fe.FLOOR_DIV,cpuKernelImpl:BV,dtype:"int32"}),EU={kernelName:wo,backendName:"webgpu",kernelFunc:Ole};var Jx=class{constructor(e,t,o=!1){this.pixelsOpType=$i.FROM_PIXELS,this.outputShape=[0],this.variableNames=[],this.workgroupSize=[256,1,1],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[t,1,1]),this.importVideo=o,this.shaderKey=`fromPixels_${this.importVideo}`}getUserCode(){let e=this.importVideo?"textureLoad(src, vec2(coords.yx));":"textureLoad(src, vec2(coords.yx), 0)";return` @binding(1) @group(0) var src: ${this.importVideo?"texture_external":"texture_2d"}; ${G("index")} { let flatIndex = index * uniforms.numChannels; if (flatIndex < uniforms.size) { let coords = getCoordsFromIndex(flatIndex); - let values = ${t}; + let values = ${e}; for (var i = 0; i < uniforms.numChannels; i = i + 1) { result[flatIndex + i] = i32(floor(255.0 * values[i])); } } } - `}};var sW={kernelName:Eu,backendName:"webgpu",kernelFunc:epe},Jc,u0=A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");function epe(r){let{inputs:t,backend:e,attrs:o}=r,{pixels:n}=t,{numChannels:s}=o;if(n==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let a=typeof HTMLVideoElement!="undefined"&&n instanceof HTMLVideoElement,i=typeof HTMLImageElement!="undefined"&&n instanceof HTMLImageElement,p=typeof HTMLCanvasElement!="undefined"&&n instanceof HTMLCanvasElement||typeof OffscreenCanvas!="undefined"&&n instanceof OffscreenCanvas,u=typeof ImageBitmap!="undefined"&&n instanceof ImageBitmap,[c,l]=a?[n.videoWidth,n.videoHeight]:[n.width,n.height],m=[l,c,s],d=A().getBool("WEBGPU_IMPORT_EXTERNAL_TEXTURE")&&a,f=a||i;if(u||p||f){let b;if(d)b=e.device.importExternalTexture({source:n});else{if(f){let L=A().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(Jc==null||L!==u0)&&(u0=L,Jc=document.createElement("canvas").getContext("2d",{willReadFrequently:u0})),Jc.canvas.width=c,Jc.canvas.height=l,Jc.drawImage(n,0,0,c,l),n=Jc.canvas}let P=GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING,O="rgba8unorm",M=e.textureManager.acquireTexture(m[1],m[0],O,P);e.queue.copyExternalImageToTexture({source:n},{texture:M},[m[1],m[0]]),b=M}let C=y.sizeFromShape(m),S=y.computeStrides(m),k=new Bx(m,s,d),_=[{type:"uint32",data:[C]},{type:"uint32",data:[s]},{type:"uint32",data:[...S]}],E=e.makeTensorInfo([l,c],"int32"),R=e.tensorMap.get(E.dataId);R.resource=b;let D=e.runWebGPUProgram(k,[E],"int32",_);return e.disposeData(E.dataId),D}let h=n.data,g=h;if(s!=null&&s!==4){g=new Uint8Array(n.width*n.height*s);let b=h.length,C=0;for(let S=0;S(xValue, -meanValue, offsetValue), vec3(inv, inv, 1.0))); } } - `}};var aW={kernelName:In,backendName:"webgpu",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o,scale:n,offset:s,mean:a,variance:i}=r,{varianceEpsilon:p}=t,u=e,c=[o,a,i],l=null;s!=null&&(l=s.shape,c.push(s));let m=null;n!=null&&(m=n.shape,c.push(n));let d=new zx(o.shape,a.shape,i.shape,l,m),f=[{type:"float32",data:[p]}];return u.runWebGPUProgram(d,c,o.dtype,f)}};function tpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dataFormat:c,dilations:l,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=w.convertConv2DDataFormat(c),g=w.computeConv2DInfo(n.shape,s.shape,p,l,u,m,!1,h);return yx({x:n,filter:s,convInfo:g,backend:e,bias:a,preluActivationWeights:i,leakyreluAlpha:f,activation:d})}var iW={kernelName:Io,backendName:"webgpu",kernelFunc:tpe};function rpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=t,{strides:p,pad:u,dilations:c,dimRoundingMode:l,activation:m,leakyreluAlpha:d}=o,f=c;f==null&&(f=[1,1]),y.assert(w.eitherStridesOrDilationsAreOne(p,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${f}'`);let h=w.computeConv2DInfo(n.shape,s.shape,p,f,u,l,!0),g=[n,s],x=a!=null,b=i!=null;x&&g.push(a),b&&g.push(i);let C=[{type:"int32",data:[h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.inHeight,h.inWidth]}],S;return h.outHeight>4&&h.outWidth>4&&h.strideWidth<=2&&h.inChannels===h.outChannels&&h.dilationHeight===1&&h.dilationWidth===1&&h.inChannels%4===0?(S=new Qc(h,x,m,b),C.push({type:"int32",data:[S.virtualWidth]})):(S=new Zc(h,x,m,b),C.push({type:"int32",data:[h.filterHeight]},{type:"int32",data:[h.filterWidth]},{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]})),m==="leakyrelu"&&(C.push({type:"float32",data:[d]}),S.uniforms+=" alpha : f32,"),e.runWebGPUProgram(S,g,"float32",C)}var uW={kernelName:vo,backendName:"webgpu",kernelFunc:rpe};var Vx=class{constructor(t,e){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`gathernd_${t}`,this.sliceDim=t,this.uniforms=`sliceDim : i32, strides : ${ft(t)},`}getUserCode(){let t;return this.sliceDim>1?t="uniforms.strides[j]":t="uniforms.strides",` + `}};var RU={kernelName:Hn,backendName:"webgpu",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o,scale:n,offset:s,mean:a,variance:i}=r,{varianceEpsilon:p}=e,u=t,l=[o,a,i],c=null;s!=null&&(c=s.shape,l.push(s));let m=null;n!=null&&(m=n.shape,l.push(n));let d=new ey(o.shape,a.shape,i.shape,c,m),f=[{type:"float32",data:[p]}];return u.runWebGPUProgram(d,l,o.dtype,f)}};function Lle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dataFormat:l,dilations:c,dimRoundingMode:m,activation:d,leakyreluAlpha:f}=o,h=C.convertConv2DDataFormat(l),g=C.computeConv2DInfo(n.shape,s.shape,p,c,u,m,!1,h);return Dx({x:n,filter:s,convInfo:g,backend:t,bias:a,preluActivationWeights:i,leakyreluAlpha:f,activation:d})}var DU={kernelName:jo,backendName:"webgpu",kernelFunc:Lle};function Ble(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,filter:s,bias:a,preluActivationWeights:i}=e,{strides:p,pad:u,dilations:l,dimRoundingMode:c,activation:m,leakyreluAlpha:d}=o,f=l;f==null&&(f=[1,1]),y.assert(C.eitherStridesOrDilationsAreOne(p,f),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${f}'`);let h=C.computeConv2DInfo(n.shape,s.shape,p,f,u,c,!0),g=[n,s],x=a!=null,b=i!=null;x&&g.push(a),b&&g.push(i);let w=[{type:"int32",data:[h.padInfo.top,h.padInfo.left]},{type:"int32",data:[h.inHeight,h.inWidth]}],S;return h.outHeight>4&&h.outWidth>4&&h.strideWidth<=2&&h.inChannels===h.outChannels&&h.dilationHeight===1&&h.dilationWidth===1&&h.inChannels%4===0?(S=new ac(h,x,m,b),w.push({type:"int32",data:[S.virtualWidth]})):(S=new ic(h,x,m,b),w.push({type:"int32",data:[h.filterHeight]},{type:"int32",data:[h.filterWidth]},{type:"int32",data:[h.strideHeight,h.strideWidth]},{type:"int32",data:[h.dilationHeight,h.dilationWidth]})),m==="leakyrelu"&&(w.push({type:"float32",data:[d]}),S.uniforms+=" alpha : f32,"),t.runWebGPUProgram(S,g,"float32",w)}var AU={kernelName:Xo,backendName:"webgpu",kernelFunc:Ble};var ty=class{constructor(e,t){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey=`gathernd_${e}`,this.sliceDim=e,this.uniforms=`sliceDim : i32, strides : ${ft(e)},`}getUserCode(){let e;return this.sliceDim>1?e="uniforms.strides[j]":e="uniforms.strides",` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); var flattenIndex = 0; for (var j = 0; j < uniforms.sliceDim; j = j + 1) { let indexTemp = i32(round(getIndices(coords[0], j))); - let strideNum = ${t}; + let strideNum = ${e}; flattenIndex = flattenIndex + indexTemp * strideNum; } setOutputAtIndex(index, getA(flattenIndex, coords[1])); } } - `}};function ope(r){let{inputs:t,backend:e}=r,{params:o,indices:n}=t,s=n.shape,a=s[s.length-1],i=y.sizeFromShape(o.shape),[p,u,c,l]=w.prepareAndValidate(o,n),m=pe({inputs:{x:n},backend:e,attrs:{shape:[u,a]}}),d=pe({inputs:{x:o},backend:e,attrs:{shape:[y.sizeFromShape(o.shape)/c,c]}});if(e.shouldExecuteOnCPU([o,n])||o.dtype==="string"){let b=e.readSync(n.dataId),C=e.bufferSync(o),S=hz(b,C,o.dtype,u,a,c,l,o.shape,i);return e.makeTensorInfo(p,o.dtype,S.values)}let f=new Vx(a,[u,c]),h=[{type:"int32",data:[a]},{type:"int32",data:l}],g=e.runWebGPUProgram(f,[d,m],d.dtype,h),x=pe({inputs:{x:g},backend:e,attrs:{shape:p}});return e.disposeData(m.dataId),e.disposeData(d.dataId),e.disposeData(g.dataId),x}var pW={kernelName:vn,backendName:"webgpu",kernelFunc:ope};var Wx=class{constructor(t,e){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.slice(),this.aShape=t,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="gather"}getUserCode(){let t=npe(this.aShape);return` + `}};function zle(r){let{inputs:e,backend:t}=r,{params:o,indices:n}=e,s=n.shape,a=s[s.length-1],i=y.sizeFromShape(o.shape),[p,u,l,c]=C.prepareAndValidate(o,n),m=le({inputs:{x:n},backend:t,attrs:{shape:[u,a]}}),d=le({inputs:{x:o},backend:t,attrs:{shape:[y.sizeFromShape(o.shape)/l,l]}});if(t.shouldExecuteOnCPU([o,n])||o.dtype==="string"){let b=t.readSync(n.dataId),w=t.bufferSync(o),S=zV(b,w,o.dtype,u,a,l,c,o.shape,i);return t.makeTensorInfo(p,o.dtype,S.values)}let f=new ty(a,[u,l]),h=[{type:"int32",data:[a]},{type:"int32",data:c}],g=t.runWebGPUProgram(f,[d,m],d.dtype,h),x=le({inputs:{x:g},backend:t,attrs:{shape:p}});return t.disposeData(m.dataId),t.disposeData(d.dataId),t.disposeData(g.dataId),x}var FU={kernelName:Kn,backendName:"webgpu",kernelFunc:zle};var ry=class{constructor(e,t){this.variableNames=["A","indices"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.slice(),this.aShape=e,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="gather"}getUserCode(){let e=Vle(this.aShape);return` ${G("index")} { if (index < uniforms.size) { let resRC = getCoordsFromIndex(index); let indexZ = i32(getIndices(resRC.x, resRC.z)); let inBounds = select(0.0, 1.0, indexZ >= 0 && indexZ < uniforms.aShape[2]); - setOutputAtIndex(index, inBounds * getA(${t})); + setOutputAtIndex(index, inBounds * getA(${e})); } } - `}};function npe(r){let t=["resRC.x","resRC.y","resRC.z","resRC.w"],e=[];for(let o=0;oe.disposeData(D.dataId)),e.makeTensorInfo(u.outputShape,R.dtype,R.values)}let h=new Wx(m.shape,f),g=e.runWebGPUProgram(h,[m,d],m.dtype);l.push(g);let x=pe({inputs:{x:g},backend:e,attrs:{shape:u.outputShape}});return l.forEach(b=>e.disposeData(b.dataId)),x}var cW={kernelName:aa,backendName:"webgpu",kernelFunc:p0};var spe=et({opType:fe.GREATER,cpuKernelImpl:yz,dtype:"bool"}),lW={kernelName:kn,backendName:"webgpu",kernelFunc:spe};var ape=et({opType:fe.GREATER_EQUAL,dtype:"bool",cpuKernelImpl:xz}),mW={kernelName:Nn,backendName:"webgpu",kernelFunc:ape};function ipe(r){let{inputs:t,backend:e}=r,{input:o}=t;return Mx(o,!0,e)}var dW={kernelName:zi,backendName:"webgpu",kernelFunc:ipe};var upe=ye({opType:Z.IS_FINITE,dtype:"bool"}),fW={kernelName:Tn,backendName:"webgpu",kernelFunc:upe};var ppe=ye({opType:Z.IS_INF,dtype:"bool"}),hW={kernelName:_n,backendName:"webgpu",kernelFunc:ppe};var cpe=ye({opType:Z.IS_NAN,dtype:"bool"}),gW={kernelName:$n,backendName:"webgpu",kernelFunc:cpe};function lpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{alpha:s}=o,a=[{type:"float32",data:[s]}],i=new Zr(n.shape,Z.LEAKYRELU,"alpha : f32,");return e.runWebGPUProgram(i,[n],"float32",a)}var xW={kernelName:En,backendName:"webgpu",kernelFunc:lpe};var mpe=et({opType:fe.LESS,dtype:"bool",cpuKernelImpl:Cz}),yW={kernelName:Rn,backendName:"webgpu",kernelFunc:mpe};var dpe=et({opType:fe.LESS_EQUAL,dtype:"bool",cpuKernelImpl:bz}),bW={kernelName:Dn,backendName:"webgpu",kernelFunc:dpe};var Ux=class{constructor(t){this.variableNames=[],this.outputShape=[],this.uniforms="start : f32, step : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="linSpace"}getUserCode(){return` + `}};function Vle(r){let e=["resRC.x","resRC.y","resRC.z","resRC.w"],t=[];for(let o=0;ot.disposeData(D.dataId)),t.makeTensorInfo(u.outputShape,R.dtype,R.values)}let h=new ry(m.shape,f),g=t.runWebGPUProgram(h,[m,d],m.dtype);c.push(g);let x=le({inputs:{x:g},backend:t,attrs:{shape:u.outputShape}});return c.forEach(b=>t.disposeData(b.dataId)),x}var PU={kernelName:fa,backendName:"webgpu",kernelFunc:Xv};var Wle=tt({opType:fe.GREATER,cpuKernelImpl:UV,dtype:"bool"}),OU={kernelName:So,backendName:"webgpu",kernelFunc:Wle};var Ule=tt({opType:fe.GREATER_EQUAL,dtype:"bool",cpuKernelImpl:WV}),MU={kernelName:Io,backendName:"webgpu",kernelFunc:Ule};function Gle(r){let{inputs:e,backend:t}=r,{input:o}=e;return Qx(o,!0,t)}var LU={kernelName:Yi,backendName:"webgpu",kernelFunc:Gle};var Hle=ye({opType:Z.IS_FINITE,dtype:"bool"}),BU={kernelName:qn,backendName:"webgpu",kernelFunc:Hle};var Kle=ye({opType:Z.IS_INF,dtype:"bool"}),zU={kernelName:jn,backendName:"webgpu",kernelFunc:Kle};var qle=ye({opType:Z.IS_NAN,dtype:"bool"}),VU={kernelName:Xn,backendName:"webgpu",kernelFunc:qle};function jle(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{alpha:s}=o,a=[{type:"float32",data:[s]}],i=new so(n.shape,Z.LEAKYRELU,"alpha : f32,");return t.runWebGPUProgram(i,[n],"float32",a)}var WU={kernelName:Yn,backendName:"webgpu",kernelFunc:jle};var Xle=tt({opType:fe.LESS,dtype:"bool",cpuKernelImpl:HV}),UU={kernelName:ko,backendName:"webgpu",kernelFunc:Xle};var Yle=tt({opType:fe.LESS_EQUAL,dtype:"bool",cpuKernelImpl:GV}),GU={kernelName:No,backendName:"webgpu",kernelFunc:Yle};var oy=class{constructor(e){this.variableNames=[],this.outputShape=[],this.uniforms="start : f32, step : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="linSpace"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { setOutputAtIndex(index, uniforms.start + f32(index) * uniforms.step); } } - `}};function fpe(r){let{backend:t,attrs:e}=r,{start:o,stop:n,num:s}=e,a=(n-o)/(s-1),i=new Ux(s),p=[{type:"float32",data:[o]},{type:"float32",data:[a]}];return t.runWebGPUProgram(i,[],"float32",p)}var CW={kernelName:An,backendName:"webgpu",kernelFunc:fpe};var hpe=ye({opType:Z.LOG,cpuKernelImpl:wz}),wW={kernelName:Fn,backendName:"webgpu",kernelFunc:hpe};var gpe=ye({opType:Z.LOG1P}),SW={kernelName:Pn,backendName:"webgpu",kernelFunc:gpe};var xpe=et({opType:fe.LOGICAL_AND,dtype:"bool"}),IW={kernelName:On,backendName:"webgpu",kernelFunc:xpe};var ype=ye({opType:Z.LOGICAL_NOT}),vW={kernelName:Mn,backendName:"webgpu",kernelFunc:ype};var bpe=et({opType:fe.LOGICAL_OR}),kW={kernelName:Ln,backendName:"webgpu",kernelFunc:bpe};var NW=` + `}};function Qle(r){let{backend:e,attrs:t}=r,{start:o,stop:n,num:s}=t,a=(n-o)/(s-1),i=new oy(s),p=[{type:"float32",data:[o]},{type:"float32",data:[a]}];return e.runWebGPUProgram(i,[],"float32",p)}var HU={kernelName:Qn,backendName:"webgpu",kernelFunc:Qle};var Zle=ye({opType:Z.LOG,cpuKernelImpl:KV}),KU={kernelName:To,backendName:"webgpu",kernelFunc:Zle};var Jle=ye({opType:Z.LOG1P}),qU={kernelName:Zn,backendName:"webgpu",kernelFunc:Jle};var ece=tt({opType:fe.LOGICAL_AND,dtype:"bool"}),jU={kernelName:Jn,backendName:"webgpu",kernelFunc:ece};var tce=ye({opType:Z.LOGICAL_NOT}),XU={kernelName:es,backendName:"webgpu",kernelFunc:tce};var rce=tt({opType:fe.LOGICAL_OR}),YU={kernelName:ts,backendName:"webgpu",kernelFunc:rce};var QU=` var powValue = 0.0; let basis = uniforms.bias + uniforms.alpha * sum; if (uniforms.beta == 0.5) { @@ -7543,7 +7543,7 @@ return a / b;`,Wee=` } else { powValue = exp(log(basis) * (-uniforms.beta)); } -`,Gx=class{constructor(t){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn"}getUserCode(){return` +`,ny=class{constructor(e){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -7561,12 +7561,12 @@ return a / b;`,Wee=` sum = sum + z * z; } } - ${NW} + ${QU} setOutputAtIndex(index, x * powValue); } } - `}},Hx=class{constructor(t,e){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[256,1,1],this.maxAllowRadius=16,y.assert(e<=this.maxAllowRadius,()=>`Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${e}`),this.outputShape=t,this.elementsPerWorkgroup=this.workgroupSize[0]-2*this.maxAllowRadius,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,[this.elementsPerWorkgroup,this.workgroupSize[1],this.workgroupSize[2]]),this.shaderKey="lrn_shared"}getUserCode(){return` + `}},sy=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.uniforms="radius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[256,1,1],this.maxAllowRadius=16,y.assert(t<=this.maxAllowRadius,()=>`Radius must be less than or equal to ${this.maxAllowRadius}, current radius is ${t}`),this.outputShape=e,this.elementsPerWorkgroup=this.workgroupSize[0]-2*this.maxAllowRadius,this.dispatchLayout={x:[3],y:[2],z:[0,1]},this.dispatch=H(this.dispatchLayout,this.outputShape,[this.elementsPerWorkgroup,this.workgroupSize[1],this.workgroupSize[2]]),this.shaderKey="lrn_shared"}getUserCode(){return` var lrnSub: array; const elementsPerWorkgroup = ${this.elementsPerWorkgroup}; const maxAllowRadius = ${this.maxAllowRadius}; @@ -7594,11 +7594,11 @@ return a / b;`,Wee=` let z = lrnSub[index + i]; sum = sum + z * z; } - ${NW} + ${QU} setOutputAtCoords(b, r, c, d, lrnSub[index] * powValue); } - } `}};function Cpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u;s>16?u=new Gx(n.shape):u=new Hx(n.shape,s);let c=[{type:"int32",data:[s]},{type:"float32",data:[a]},{type:"float32",data:[i]},{type:"float32",data:[p]}];return e.runWebGPUProgram(u,[n],n.dtype,c)}var TW={kernelName:Bn,backendName:"webgpu",kernelFunc:Cpe};var Kx=class{constructor(t){this.outputShape=[],this.variableNames=["inputImage","outputImage","dy"],this.uniforms="depthRadius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn_grad"}getUserCode(){return` + } `}};function oce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{depthRadius:s,bias:a,alpha:i,beta:p}=o,u;s>16?u=new ny(n.shape):u=new sy(n.shape,s);let l=[{type:"int32",data:[s]},{type:"float32",data:[a]},{type:"float32",data:[i]},{type:"float32",data:[p]}];return t.runWebGPUProgram(u,[n],n.dtype,l)}var ZU={kernelName:rs,backendName:"webgpu",kernelFunc:oce};var ay=class{constructor(e){this.outputShape=[],this.variableNames=["inputImage","outputImage","dy"],this.uniforms="depthRadius : i32, bias : f32, alpha : f32, beta : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="lrn_grad"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -7648,8 +7648,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, result); } } - `}};function wpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,y:s,dy:a}=t,{depthRadius:i,bias:p,alpha:u,beta:c}=o,l=new Kx(n.shape),m=[{type:"int32",data:[i]},{type:"float32",data:[p]},{type:"float32",data:[u]},{type:"float32",data:[c]}];return e.runWebGPUProgram(l,[n,s,a],n.dtype,m)}var _W={kernelName:Ya,backendName:"webgpu",kernelFunc:wpe};var Spe=et({opType:fe.MAX,cpuKernelImpl:Iz}),$W={kernelName:Vn,backendName:"webgpu",kernelFunc:Spe};function Ipe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,u=1,c=w.computePool2DInfo(n.shape,s,a,u,i,p);return sx(n,c,"max",e)}var EW={kernelName:Wn,backendName:"webgpu",kernelFunc:Ipe};function vpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,c=[1,1,1],l=w.computePool3DInfo(n.shape,s,a,c,i,u,p),m=new wu(l,"max"),d=[{type:"int32",data:[l.strideDepth,l.strideHeight,l.strideWidth]},{type:"int32",data:[l.padInfo.front,l.padInfo.top,l.padInfo.left]},{type:"int32",data:[l.inDepth,l.inHeight,l.inWidth]},{type:"int32",data:[l.effectiveFilterDepth,l.effectiveFilterHeight,l.effectiveFilterWidth]}];return e.runWebGPUProgram(m,[n],n.dtype,d)}var RW={kernelName:ia,backendName:"webgpu",kernelFunc:vpe};var qx=class{constructor(t){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, - outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool2DBackprop"}getUserCode(){return` + `}};function nce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,y:s,dy:a}=e,{depthRadius:i,bias:p,alpha:u,beta:l}=o,c=new ay(n.shape),m=[{type:"int32",data:[i]},{type:"float32",data:[p]},{type:"float32",data:[u]},{type:"float32",data:[l]}];return t.runWebGPUProgram(c,[n,s,a],n.dtype,m)}var JU={kernelName:oi,backendName:"webgpu",kernelFunc:nce};var sce=tt({opType:fe.MAX,cpuKernelImpl:jV}),eG={kernelName:_o,backendName:"webgpu",kernelFunc:sce};function ace(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dimRoundingMode:p}=o,l=C.computePool2DInfo(n.shape,s,a,1,i,p);return bx(n,l,"max",t)}var tG={kernelName:ns,backendName:"webgpu",kernelFunc:ace};function ice(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{filterSize:s,strides:a,pad:i,dataFormat:p,dimRoundingMode:u}=o,l=[1,1,1],c=C.computePool3DInfo(n.shape,s,a,l,i,u,p),m=new $u(c,"max"),d=[{type:"int32",data:[c.strideDepth,c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.front,c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.inDepth,c.inHeight,c.inWidth]},{type:"int32",data:[c.effectiveFilterDepth,c.effectiveFilterHeight,c.effectiveFilterWidth]}];return t.runWebGPUProgram(m,[n],n.dtype,d)}var rG={kernelName:ha,backendName:"webgpu",kernelFunc:ice};var iy=class{constructor(e){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec2, pads : vec2, dilations : vec2, filterDims : vec2, + outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool2DBackprop"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7693,8 +7693,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}},jx=class{constructor(t){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, - outDepth : i32, outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool3DBackprop"}getUserCode(){return` + `}},uy=class{constructor(e){this.variableNames=["dy","maxPos"],this.uniforms=`strides : vec3, pads : vec3, filterDims : vec3, + outDepth : i32, outHeight : i32, outWidth : i32`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.inShape,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="maxPool3DBackprop"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7751,13 +7751,13 @@ return a / b;`,Wee=` setOutputAtIndex(index, dotProd); } } - `}};function kpe(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s}=t,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:c}=o,l=[1,1,1],m=w.computePool3DInfo(a.shape,i,p,l,u,c),d=new wu(m,"max",!0),f=[{type:"int32",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:"int32",data:[m.padInfo.front,m.padInfo.top,m.padInfo.left]},{type:"int32",data:[m.inDepth,m.inHeight,m.inWidth]},{type:"int32",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=e.runWebGPUProgram(d,[a],"int32",f),g=new jx(m);f=[{type:"int32",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:"int32",data:[m.effectiveFilterDepth-1-m.padInfo.front,m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:"int32",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:"int32",data:[m.outDepth]},{type:"int32",data:[m.outHeight]},{type:"int32",data:[m.outWidth]}];let x=e.runWebGPUProgram(g,[n,h],a.dtype,f);return e.disposeData(h.dataId),x}var DW={kernelName:Ui,backendName:"webgpu",kernelFunc:kpe};function Npe(r){let{inputs:t,backend:e,attrs:o}=r,{dy:n,input:s,output:a}=t,i=s;mm([s,a],"maxPoolGrad");let{filterSize:p,strides:u,pad:c,dimRoundingMode:l}=o,m=w.computePool2DInfo(i.shape,p,u,1,c,l),d=new Ba(m,"max",!0),f=[{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.padInfo.top,m.padInfo.left]},{type:"int32",data:[m.dilationHeight,m.dilationWidth]},{type:"int32",data:[m.inHeight,m.inWidth]},{type:"int32",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=e.runWebGPUProgram(d,[i],"int32",f),g=new qx(m);f=[{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:"int32",data:[m.dilationHeight,m.dilationWidth]},{type:"int32",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:"int32",data:[m.outHeight]},{type:"int32",data:[m.outWidth]}];let x=e.runWebGPUProgram(g,[n,h],i.dtype,f);return e.disposeData(h.dataId),x}var AW={kernelName:Wi,backendName:"webgpu",kernelFunc:Npe};function Tpe(r){let{inputs:t,backend:e,attrs:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=o,{x:p}=t;y.assert(p.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${p.shape.length}.`);let u=[1,1];y.assert(w.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let c=w.computePool2DInfo(p.shape,n,s,u,a),l=[{type:"int32",data:[c.strideHeight,c.strideWidth]},{type:"int32",data:[c.padInfo.top,c.padInfo.left]},{type:"int32",data:[c.dilationHeight,c.dilationWidth]},{type:"int32",data:[c.inHeight,c.inWidth]},{type:"int32",data:[c.effectiveFilterHeight,c.effectiveFilterWidth]}],m=new Ba(c,"max",!1),d=e.runWebGPUProgram(m,[p],p.dtype,l);m=new Ba(c,"max",!0,!0,i);let f=e.runWebGPUProgram(m,[p],"int32",l);return[d,f]}var FW={kernelName:ua,backendName:"webgpu",kernelFunc:Tpe};function _pe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;return Jr(n,s,a,"min",e)}var PW={kernelName:Gn,backendName:"webgpu",kernelFunc:_pe};var $pe=et({opType:fe.MIN,cpuKernelImpl:vz}),OW={kernelName:Hn,backendName:"webgpu",kernelFunc:$pe};var Xx=class{constructor(t,e,o){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.map((n,s)=>n[0]+t[s]+n[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.xShape=t,e.map((n,s)=>{this.uniforms+=` pad${s} : vec2,`}),this.offset=o==="reflect"?0:1,this.shaderKey=`mirrorPad_${o}`}getUserCode(){let t=this.xShape.length,e=this.xShape.map((u,c)=>`uniforms.pad${c}[0]`).join(","),o=this.xShape.map((u,c)=>`uniforms.pad${c}[0] + uniforms.xShape${t>1?`[${c}]`:""}`).join(","),n=t===1?"start":"start[i]",s=t===1?"end":"end[i]",a=t===1?"outC":"outC[i]",i=ft(t),p=t>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,t):"coords";return` + `}};function uce(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s}=e,a=s,{filterSize:i,strides:p,pad:u,dimRoundingMode:l}=o,c=[1,1,1],m=C.computePool3DInfo(a.shape,i,p,c,u,l),d=new $u(m,"max",!0),f=[{type:"int32",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:"int32",data:[m.padInfo.front,m.padInfo.top,m.padInfo.left]},{type:"int32",data:[m.inDepth,m.inHeight,m.inWidth]},{type:"int32",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=t.runWebGPUProgram(d,[a],"int32",f),g=new uy(m);f=[{type:"int32",data:[m.strideDepth,m.strideHeight,m.strideWidth]},{type:"int32",data:[m.effectiveFilterDepth-1-m.padInfo.front,m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:"int32",data:[m.effectiveFilterDepth,m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:"int32",data:[m.outDepth]},{type:"int32",data:[m.outHeight]},{type:"int32",data:[m.outWidth]}];let x=t.runWebGPUProgram(g,[n,h],a.dtype,f);return t.disposeData(h.dataId),x}var oG={kernelName:Ji,backendName:"webgpu",kernelFunc:uce};function pce(r){let{inputs:e,backend:t,attrs:o}=r,{dy:n,input:s,output:a}=e,i=s;wm([s,a],"maxPoolGrad");let{filterSize:p,strides:u,pad:l,dimRoundingMode:c}=o,m=C.computePool2DInfo(i.shape,p,u,1,l,c),d=new Ka(m,"max",!0),f=[{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.padInfo.top,m.padInfo.left]},{type:"int32",data:[m.dilationHeight,m.dilationWidth]},{type:"int32",data:[m.inHeight,m.inWidth]},{type:"int32",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]}],h=t.runWebGPUProgram(d,[i],"int32",f),g=new iy(m);f=[{type:"int32",data:[m.strideHeight,m.strideWidth]},{type:"int32",data:[m.effectiveFilterHeight-1-m.padInfo.top,m.effectiveFilterWidth-1-m.padInfo.left]},{type:"int32",data:[m.dilationHeight,m.dilationWidth]},{type:"int32",data:[m.effectiveFilterHeight,m.effectiveFilterWidth]},{type:"int32",data:[m.outHeight]},{type:"int32",data:[m.outWidth]}];let x=t.runWebGPUProgram(g,[n,h],i.dtype,f);return t.disposeData(h.dataId),x}var nG={kernelName:Zi,backendName:"webgpu",kernelFunc:pce};function lce(r){let{inputs:e,backend:t,attrs:o}=r,{filterSize:n,strides:s,pad:a,includeBatchInIndex:i}=o,{x:p}=e;y.assert(p.shape.length===4,()=>`Error in maxPool: input must be rank 4 but got rank ${p.shape.length}.`);let u=[1,1];y.assert(C.eitherStridesOrDilationsAreOne(s,u),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${s} and dilations '${u}'`);let l=C.computePool2DInfo(p.shape,n,s,u,a),c=[{type:"int32",data:[l.strideHeight,l.strideWidth]},{type:"int32",data:[l.padInfo.top,l.padInfo.left]},{type:"int32",data:[l.dilationHeight,l.dilationWidth]},{type:"int32",data:[l.inHeight,l.inWidth]},{type:"int32",data:[l.effectiveFilterHeight,l.effectiveFilterWidth]}],m=new Ka(l,"max",!1),d=t.runWebGPUProgram(m,[p],p.dtype,c);m=new Ka(l,"max",!0,!0,i);let f=t.runWebGPUProgram(m,[p],"int32",c);return[d,f]}var sG={kernelName:ga,backendName:"webgpu",kernelFunc:lce};function cce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;return ao(n,s,a,"min",t)}var aG={kernelName:as,backendName:"webgpu",kernelFunc:cce};var mce=tt({opType:fe.MIN,cpuKernelImpl:XV}),iG={kernelName:Eo,backendName:"webgpu",kernelFunc:mce};var py=class{constructor(e,t,o){this.uniforms="",this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((n,s)=>n[0]+e[s]+n[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.xShape=e,t.map((n,s)=>{this.uniforms+=` pad${s} : vec2,`}),this.offset=o==="reflect"?0:1,this.shaderKey=`mirrorPad_${o}`}getUserCode(){let e=this.xShape.length,t=this.xShape.map((u,l)=>`uniforms.pad${l}[0]`).join(","),o=this.xShape.map((u,l)=>`uniforms.pad${l}[0] + uniforms.xShape${e>1?`[${l}]`:""}`).join(","),n=e===1?"start":"start[i]",s=e===1?"end":"end[i]",a=e===1?"outC":"outC[i]",i=ft(e),p=e>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,e):"coords";return` ${G("index")} { if (index < uniforms.size) { - let start = ${i}(${e}); + let start = ${i}(${t}); let end = ${i}(${o}); var outC = getCoordsFromIndex(index); - for (var i = 0; i < ${t}; i = i + 1) { + for (var i = 0; i < ${e}; i = i + 1) { if (${a} < ${n}) { ${a} = ${n} * 2 - ${a} - ${this.offset}; } else if(${a} >= ${s}) { @@ -7768,7 +7768,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, getX(${p})); } } - `}};var MW={kernelName:Kn,backendName:"webgpu",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{x:o}=r,{paddings:n,mode:s}=t,a=e,i=n.map(c=>({type:"int32",data:[c[0],c[1]]})),p=new Xx(o.shape,n,s);return a.runWebGPUProgram(p,[o],o.dtype,i)}};var Epe=et({opType:fe.MOD}),LW={kernelName:qn,backendName:"webgpu",kernelFunc:Epe};var Yx=class{constructor(t,e){this.variableNames=["probs"],this.outputShape=[],this.uniforms="seed : f32, numOutcomes: i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="multinomial"}getUserCode(){return` + `}};var uG={kernelName:is,backendName:"webgpu",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{x:o}=r,{paddings:n,mode:s}=e,a=t,i=n.map(l=>({type:"int32",data:[l[0],l[1]]})),p=new py(o.shape,n,s);return a.runWebGPUProgram(p,[o],o.dtype,i)}};var dce=tt({opType:fe.MOD}),pG={kernelName:us,backendName:"webgpu",kernelFunc:dce};var ly=class{constructor(e,t){this.variableNames=["probs"],this.outputShape=[],this.uniforms="seed : f32, numOutcomes: i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="multinomial"}getUserCode(){return` //Based on the work of Dave Hoskins //https://www.shadertoy.com/view/4djSRW fn random (seed : f32, resultUV : vec2) -> f32 { @@ -7801,7 +7801,7 @@ return a / b;`,Wee=` setOutputAtIndexI32(index, uniforms.numOutcomes - 1); } } - `}};var Qx=class{constructor(t){this.variableNames=["logits"],this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=[this.outputShape[0],1,1],this.outputShape[1]>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.shaderKey="softmax"}getUserCode(){return` + `}};var cy=class{constructor(e){this.variableNames=["logits"],this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=[this.outputShape[0],1,1],this.outputShape[1]>=4096?this.workgroupSize=[256,1,1]:this.workgroupSize=[64,1,1],this.shaderKey="softmax"}getUserCode(){return` var buf : array; var rowMaxShared : f32; var rowSumShared : f32; @@ -7860,7 +7860,7 @@ return a / b;`,Wee=` setOutputAtCoords(row, col, value); } } - `}};function c0(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{dim:s}=o,a=pe({inputs:{x:n},backend:e,attrs:{shape:[y.sizeFromShape(n.shape)/n.shape[s],n.shape[s]]}}),i=new Qx(a.shape),p=e.runWebGPUProgram(i,[a],n.dtype),u=pe({inputs:{x:p},backend:e,attrs:{shape:n.shape}});return e.disposeData(a.dataId),e.disposeData(p.dataId),u}var BW={kernelName:Is,backendName:"webgpu",kernelFunc:c0};function Rpe(r){let{inputs:t,backend:e,attrs:o}=r,{logits:n}=t,{numSamples:s,seed:a,normalized:i}=o,p=i?n:c0({inputs:{logits:n},backend:e,attrs:{dim:n.shape.length-1}}),u=p.shape[0],c=p.shape[1],l=new Yx(u,s),m=[{type:"float32",data:[a]},{type:"int32",data:[c]}],d=e.runWebGPUProgram(l,[p],"int32",m);return i||e.disposeData(p.dataId),d}var zW={kernelName:jn,backendName:"webgpu",kernelFunc:Rpe};function Dpe(r){let{inputs:t,backend:e}=r,{x:o}=t;if(e.shouldExecuteOnCPU([o])){let s=e.tensorMap.get(o.dataId),[a,i]=Nz(s.values,o.shape,o.dtype);return e.makeTensorInfo(i,o.dtype,a)}let n=new Zr(o.shape,Z.NEG);return e.runWebGPUProgram(n,[o],o.dtype)}var VW={kernelName:pa,backendName:"webgpu",kernelFunc:Dpe};function Ape(r){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=e.readSync(n.dataId),c=e.readSync(s.dataId),{selectedIndices:l}=Vt.nonMaxSuppressionV3Impl(u,c,a,i,p);return e.makeTensorInfo([l.length],"int32",new Int32Array(l))}var WW={kernelName:Qn,backendName:"webgpu",kernelFunc:Ape};function Fpe(r){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:e,attrs:o}=r,{boxes:n,scores:s}=t,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,c=e.readSync(n.dataId),l=e.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=Vt.nonMaxSuppressionV5Impl(c,l,m,d,f,h);return[e.makeTensorInfo([g.length],"int32",new Int32Array(g)),e.makeTensorInfo([x.length],"float32",new Float32Array(x))]}var UW={kernelName:Zn,backendName:"webgpu",kernelFunc:Fpe};var Zx=class{constructor(t,e){this.variableNames=["x"],this.uniforms="onValue : f32, offValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t,e],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="onehot"}getUserCode(){return` + `}};function Yv(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{dim:s}=o,a=le({inputs:{x:n},backend:t,attrs:{shape:[y.sizeFromShape(n.shape)/n.shape[s],n.shape[s]]}}),i=new cy(a.shape),p=t.runWebGPUProgram(i,[a],n.dtype),u=le({inputs:{x:p},backend:t,attrs:{shape:n.shape}});return t.disposeData(a.dataId),t.disposeData(p.dataId),u}var lG={kernelName:Fs,backendName:"webgpu",kernelFunc:Yv};function fce(r){let{inputs:e,backend:t,attrs:o}=r,{logits:n}=e,{numSamples:s,seed:a,normalized:i}=o,p=i?n:Yv({inputs:{logits:n},backend:t,attrs:{dim:n.shape.length-1}}),u=p.shape[0],l=p.shape[1],c=new ly(u,s),m=[{type:"float32",data:[a]},{type:"int32",data:[l]}],d=t.runWebGPUProgram(c,[p],"int32",m);return i||t.disposeData(p.dataId),d}var cG={kernelName:ps,backendName:"webgpu",kernelFunc:fce};function hce(r){let{inputs:e,backend:t}=r,{x:o}=e;if(t.shouldExecuteOnCPU([o])){let s=t.tensorMap.get(o.dataId),[a,i]=QV(s.values,o.shape,o.dtype);return t.makeTensorInfo(i,o.dtype,a)}let n=new so(o.shape,Z.NEG);return t.runWebGPUProgram(n,[o],o.dtype)}var mG={kernelName:ls,backendName:"webgpu",kernelFunc:hce};function gce(r){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p}=o,u=t.readSync(n.dataId),l=t.readSync(s.dataId),{selectedIndices:c}=Ut.nonMaxSuppressionV3Impl(u,l,a,i,p);return t.makeTensorInfo([c.length],"int32",new Int32Array(c))}var dG={kernelName:cs,backendName:"webgpu",kernelFunc:gce};function xce(r){console.warn("tf.nonMaxSuppression() in webgpu locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:e,backend:t,attrs:o}=r,{boxes:n,scores:s}=e,{maxOutputSize:a,iouThreshold:i,scoreThreshold:p,softNmsSigma:u}=o,l=t.readSync(n.dataId),c=t.readSync(s.dataId),m=a,d=i,f=p,h=u,{selectedIndices:g,selectedScores:x}=Ut.nonMaxSuppressionV5Impl(l,c,m,d,f,h);return[t.makeTensorInfo([g.length],"int32",new Int32Array(g)),t.makeTensorInfo([x.length],"float32",new Float32Array(x))]}var fG={kernelName:ms,backendName:"webgpu",kernelFunc:xce};var my=class{constructor(e,t){this.variableNames=["x"],this.uniforms="onValue : f32, offValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e,t],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="onehot"}getUserCode(){return` ${G("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7868,23 +7868,23 @@ return a / b;`,Wee=` f32(i32(round(getX(coords.x))) == coords.y))); } } - `}};function Ppe(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n}=t,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),c=new Zx(u,a),l=pe({inputs:{x:n},backend:e,attrs:{shape:[u]}}),m=[{type:"float32",data:[i]},{type:"float32",data:[p]}],d=e.runWebGPUProgram(c,[l],s,m);e.disposeData(l.dataId);let f=[...n.shape,a],h=pe({inputs:{x:d},backend:e,attrs:{shape:f}});return e.disposeData(d.dataId),h}var GW={kernelName:Jn,backendName:"webgpu",kernelFunc:Ppe};function xm(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype==="complex64"){let n=Ii({inputs:{input:o},backend:e}),s=xm({inputs:{x:n},backend:e}),a=$p({inputs:{input:o},backend:e}),i=xm({inputs:{x:a},backend:e}),p=xo({inputs:{real:s,imag:i},backend:e});return e.disposeData(n.dataId),e.disposeData(s.dataId),e.disposeData(a.dataId),e.disposeData(i.dataId),p}else return vt({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype==="string"?"":0},backend:e})}var HW={kernelName:Sa,backendName:"webgpu",kernelFunc:xm};function KW(r){let{inputs:t,backend:e}=r,{x:o}=t;if(o.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(o.dtype==="complex64"){let n=Ii({inputs:{input:o},backend:e}),s=KW({inputs:{x:n},backend:e}),a=$p({inputs:{input:o},backend:e}),i=xm({inputs:{x:a},backend:e}),p=xo({inputs:{real:s,imag:i},backend:e});return e.disposeData(n.dataId),e.disposeData(s.dataId),e.disposeData(a.dataId),e.disposeData(i.dataId),p}else return vt({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:e})}var qW={kernelName:ca,backendName:"webgpu",kernelFunc:KW};function Ope(r){let{inputs:t,backend:e,attrs:o}=r,{axis:n}=o;if(t.length===1)return Ox({inputs:{input:t[0]},backend:e,attrs:{dim:n}});let s=t[0].shape,a=t[0].dtype;t.forEach(c=>{y.assertShapesMatch(s,c.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===c.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=t.map(c=>{let l=Ox({inputs:{input:c},backend:e,attrs:{dim:n}});return i.push(l),l}),u=s0({inputs:p,backend:e,attrs:{axis:n}});return i.forEach(c=>e.disposeData(c.dataId)),u}var jW={kernelName:la,backendName:"webgpu",kernelFunc:Ope};function l0(r,t=!1){let e=r.length,o=ft(e),n=r.map((l,m)=>`uniforms.pad${m}[0]`).join(","),s=r.map((l,m)=>`uniforms.pad${m}[0] + uniforms.xShape${e>1?`[${m}]`:""}`).join(","),a=e>1?`${o}(${n})`:`${n}`,i=e>1?`${o}(${s})`:`${s}`,p=e>1?"any(paddedCoords < start)":"paddedCoords < start",u=e>1?"any(paddedCoords >= end)":"paddedCoords >= end",c=e>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,e):"coords";return` + `}};function yce(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n}=e,{dtype:s,depth:a,onValue:i,offValue:p}=o,u=y.sizeFromShape(n.shape),l=new my(u,a),c=le({inputs:{x:n},backend:t,attrs:{shape:[u]}}),m=[{type:"float32",data:[i]},{type:"float32",data:[p]}],d=t.runWebGPUProgram(l,[c],s,m);t.disposeData(c.dataId);let f=[...n.shape,a],h=le({inputs:{x:d},backend:t,attrs:{shape:f}});return t.disposeData(d.dataId),h}var hG={kernelName:ds,backendName:"webgpu",kernelFunc:yce};function Em(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype==="complex64"){let n=Fi({inputs:{input:o},backend:t}),s=Em({inputs:{x:n},backend:t}),a=Mp({inputs:{input:o},backend:t}),i=Em({inputs:{x:a},backend:t}),p=Uo({inputs:{real:s,imag:i},backend:t});return t.disposeData(n.dataId),t.disposeData(s.dataId),t.disposeData(a.dataId),t.disposeData(i.dataId),p}else return Nt({attrs:{shape:o.shape,dtype:o.dtype,value:o.dtype==="string"?"":0},backend:t})}var gG={kernelName:_a,backendName:"webgpu",kernelFunc:Em};function xG(r){let{inputs:e,backend:t}=r,{x:o}=e;if(o.dtype==="string")throw new Error("onesLike is not supported under string dtype");if(o.dtype==="complex64"){let n=Fi({inputs:{input:o},backend:t}),s=xG({inputs:{x:n},backend:t}),a=Mp({inputs:{input:o},backend:t}),i=Em({inputs:{x:a},backend:t}),p=Uo({inputs:{real:s,imag:i},backend:t});return t.disposeData(n.dataId),t.disposeData(s.dataId),t.disposeData(a.dataId),t.disposeData(i.dataId),p}else return Nt({attrs:{shape:o.shape,dtype:o.dtype,value:1},backend:t})}var yG={kernelName:xa,backendName:"webgpu",kernelFunc:xG};function bce(r){let{inputs:e,backend:t,attrs:o}=r,{axis:n}=o;if(e.length===1)return Yx({inputs:{input:e[0]},backend:t,attrs:{dim:n}});let s=e[0].shape,a=e[0].dtype;e.forEach(l=>{y.assertShapesMatch(s,l.shape,"All tensors passed to stack must have matching shapes"),y.assert(a===l.dtype,()=>"All tensors passed to stack must have matching dtypes")});let i=[],p=e.map(l=>{let c=Yx({inputs:{input:l},backend:t,attrs:{dim:n}});return i.push(c),c}),u=Hv({inputs:p,backend:t,attrs:{axis:n}});return i.forEach(l=>t.disposeData(l.dataId)),u}var bG={kernelName:ya,backendName:"webgpu",kernelFunc:bce};function Qv(r,e=!1){let t=r.length,o=ft(t),n=r.map((c,m)=>`uniforms.pad${m}[0]`).join(","),s=r.map((c,m)=>`uniforms.pad${m}[0] + uniforms.xShape${t>1?`[${m}]`:""}`).join(","),a=t>1?`${o}(${n})`:`${n}`,i=t>1?`${o}(${s})`:`${s}`,p=t>1?"any(paddedCoords < start)":"paddedCoords < start",u=t>1?"any(paddedCoords >= end)":"paddedCoords >= end",l=t>1?["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,t):"coords";return` let start = ${a}; let end = ${i}; if (${p} || ${u}) { - setOutputAtIndex(index, ${t?0:"uniforms.constantValue"}); + setOutputAtIndex(index, ${e?0:"uniforms.constantValue"}); } else { let coords = paddedCoords - start; - setOutputAtIndex(index, getX(${c})); + setOutputAtIndex(index, getX(${l})); } - `}var Jx=class{constructor(t,e){this.variableNames=["x"],this.uniforms="constantValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e.map((o,n)=>o[0]+t[n]+o[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),e.map((o,n)=>{this.uniforms+=` pad${n} : vec2,`}),this.xShape=t,this.shaderKey="pad"}getUserCode(){return` + `}var dy=class{constructor(e,t){this.variableNames=["x"],this.uniforms="constantValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t.map((o,n)=>o[0]+e[n]+o[1]),this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),t.map((o,n)=>{this.uniforms+=` pad${n} : vec2,`}),this.xShape=e,this.shaderKey="pad"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let paddedCoords = getCoordsFromIndex(index); - ${l0(this.xShape)} + ${Qv(this.xShape)} } } - `}};var Mpe=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{paddings:s,constantValue:a}=o;if(s.every(u=>y.arraysEqual(u,[0,0])))return At({inputs:{x:n},backend:e});if(y.sizeFromShape(n.shape)===0){let u=s.map((c,l)=>c[0]+n.shape[l]+c[1]);return vt({backend:e,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=[{type:"float32",data:[a]}];s.map(u=>i.push({type:"int32",data:[u[0],u[1]]}));let p=new Jx(n.shape,s);return e.runWebGPUProgram(p,[n],n.dtype,i)},XW={kernelName:es,backendName:"webgpu",kernelFunc:Mpe};var Lpe=et({opType:fe.POW}),YW={kernelName:ts,backendName:"webgpu",kernelFunc:Lpe};function Bpe(r){let{inputs:t,backend:e}=r,{x:o,alpha:n}=t,s=new Si(fe.PRELU,o.shape,n.shape);return e.runWebGPUProgram(s,[o,n],"float32")}var QW={kernelName:rs,backendName:"webgpu",kernelFunc:Bpe};function zpe(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{axis:s,keepDims:a}=o;return Jr(n,s,a,"prod",e)}var ZW={kernelName:os,backendName:"webgpu",kernelFunc:zpe};var Vpe=r=>{let{backend:t,attrs:e}=r,{start:o,stop:n,step:s,dtype:a}=e,i=$z(o,n,s,a);return t.makeTensorInfo([i.length],a,i)},JW={kernelName:ma,backendName:"webgpu",kernelFunc:Vpe};var Wpe=et({opType:fe.DIV}),eU={kernelName:fn,backendName:"webgpu",kernelFunc:Wpe};var Upe=ye({opType:Z.RECIPROCAL}),tU={kernelName:ns,backendName:"webgpu",kernelFunc:Upe};var Gpe=ye({opType:Z.RELU}),rU={kernelName:ss,backendName:"webgpu",kernelFunc:Gpe};var Hpe=ye({opType:Z.RELU6}),oU={kernelName:us,backendName:"webgpu",kernelFunc:Hpe};var ey=class{constructor(t,e,o){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, halfPixelCenters : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t[0],e,o,t[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="resizeBilinear"}getUserCode(){return` + `}};var Cce=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{paddings:s,constantValue:a}=o;if(s.every(u=>y.arraysEqual(u,[0,0])))return Pt({inputs:{x:n},backend:t});if(y.sizeFromShape(n.shape)===0){let u=s.map((l,c)=>l[0]+n.shape[c]+l[1]);return Nt({backend:t,attrs:{shape:u,value:a,dtype:n.dtype}})}let i=[{type:"float32",data:[a]}];s.map(u=>i.push({type:"int32",data:[u[0],u[1]]}));let p=new dy(n.shape,s);return t.runWebGPUProgram(p,[n],n.dtype,i)},CG={kernelName:fs,backendName:"webgpu",kernelFunc:Cce};var wce=tt({opType:fe.POW}),wG={kernelName:hs,backendName:"webgpu",kernelFunc:wce};function Sce(r){let{inputs:e,backend:t}=r,{x:o,alpha:n}=e,s=new Di(fe.PRELU,o.shape,n.shape);return t.runWebGPUProgram(s,[o,n],"float32")}var SG={kernelName:gs,backendName:"webgpu",kernelFunc:Sce};function Ice(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{axis:s,keepDims:a}=o;return ao(n,s,a,"prod",t)}var IG={kernelName:Ho,backendName:"webgpu",kernelFunc:Ice};var vce=r=>{let{backend:e,attrs:t}=r,{start:o,stop:n,step:s,dtype:a}=t,i=eW(o,n,s,a);return e.makeTensorInfo([i.length],a,i)},vG={kernelName:ba,backendName:"webgpu",kernelFunc:vce};var kce=tt({opType:fe.DIV}),kG={kernelName:Vn,backendName:"webgpu",kernelFunc:kce};var Nce=ye({opType:Z.RECIPROCAL}),NG={kernelName:xs,backendName:"webgpu",kernelFunc:Nce};var Tce=ye({opType:Z.RELU}),TG={kernelName:ys,backendName:"webgpu",kernelFunc:Tce};var _ce=ye({opType:Z.RELU6}),_G={kernelName:ws,backendName:"webgpu",kernelFunc:_ce};var fy=class{constructor(e,t,o){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, halfPixelCenters : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,o,e[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="resizeBilinear"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -7927,8 +7927,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, newValue); } } - `}};function Kpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,size:a,halfPixelCenters:i}=o,[p,u]=a,c=s&&p>1?1:0,l=s&&u>1?1:0,d=[{type:"float32",data:[c,l]},{type:"float32",data:[i?.5:0]}],f=new ey(n.shape,p,u);return e.runWebGPUProgram(f,[n],"float32",d)}var nU={kernelName:is,backendName:"webgpu",kernelFunc:Kpe};var ty=class{constructor(t,e){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32, - invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=e,this.shaderKey=`resizeBilinearBackprop_${e}`}getUserCode(){return` + `}};function Ece(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,size:a,halfPixelCenters:i}=o,[p,u]=a,l=s&&p>1?1:0,c=s&&u>1?1:0,d=[{type:"float32",data:[l,c]},{type:"float32",data:[i?.5:0]}],f=new fy(n.shape,p,u);return t.runWebGPUProgram(f,[n],"float32",d)}var EG={kernelName:Cs,backendName:"webgpu",kernelFunc:Ece};var hy=class{constructor(e,t){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, heightScale : f32, widthScale : f32, + invHeightScale : f32, invWidthScale : f32, winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=t,this.shaderKey=`resizeBilinearBackprop_${t}`}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -8002,7 +8002,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, accumulator); } } - `}};function qpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,[,i,p]=n.shape,[,u,c]=s.shape,l=[a&&u>1?i-1:i,a&&c>1?p-1:p],m=[a&&u>1?u-1:u,a&&c>1?c-1:c],d=l[0]/m[0],f=l[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,C=new ty(n.shape,a),S=[{type:"int32",data:l},{type:"int32",data:m},{type:"float32",data:[d]},{type:"float32",data:[f]},{type:"float32",data:[h]},{type:"float32",data:[g]},{type:"int32",data:[x]},{type:"int32",data:[b]}];return e.runWebGPUProgram(C,[s],s.dtype,S)}var sU={kernelName:Ja,backendName:"webgpu",kernelFunc:qpe};var ry=class{constructor(t,e,o,n){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, roundBase : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[t[0],e,o,t[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.halfPixelCenters=n,this.shaderKey=`resizeNearest_${n}`}getUserCode(){let t;return this.halfPixelCenters?t="max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":t="vec2(rc) * effectiveInputOverOutputRatioRC",` + `}};function $ce(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,[,i,p]=n.shape,[,u,l]=s.shape,c=[a&&u>1?i-1:i,a&&l>1?p-1:p],m=[a&&u>1?u-1:u,a&&l>1?l-1:l],d=c[0]/m[0],f=c[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,w=new hy(n.shape,a),S=[{type:"int32",data:c},{type:"int32",data:m},{type:"float32",data:[d]},{type:"float32",data:[f]},{type:"float32",data:[h]},{type:"float32",data:[g]},{type:"int32",data:[x]},{type:"int32",data:[b]}];return t.runWebGPUProgram(w,[s],s.dtype,S)}var $G={kernelName:ii,backendName:"webgpu",kernelFunc:$ce};var gy=class{constructor(e,t,o,n){this.variableNames=["x"],this.uniforms="adjustHeightWidth : vec2, roundBase : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=[e[0],t,o,e[3]],this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.halfPixelCenters=n,this.shaderKey=`resizeNearest_${n}`}getUserCode(){let e;return this.halfPixelCenters?e="max((vec2(rc) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":e="vec2(rc) * effectiveInputOverOutputRatioRC",` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -8022,7 +8022,7 @@ return a / b;`,Wee=` effectiveInSize / effectiveOutSize; // Fractional source index - let sourceFracIndexRC = ${t}; + let sourceFracIndexRC = ${e}; // Compute the coordinators of nearest neighbor point. let inputShapeRC = vec2(f32(uniforms.xShape.y), f32(uniforms.xShape.z)); @@ -8033,8 +8033,8 @@ return a / b;`,Wee=` setOutputAtIndex(index, newValue); } } - `}};function jpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n}=t,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,c=s&&p>1?1:0,l=s&&u>1?1:0,d=[{type:"float32",data:[c,l]},{type:"float32",data:[s?.5:0]}],f=new ry(n.shape,p,u,a);return e.runWebGPUProgram(f,[n],n.dtype,d)}var aU={kernelName:as,backendName:"webgpu",kernelFunc:jpe};var oy=class{constructor(t,e){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32, - winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=e,this.shaderKey=`resizeNearestNeigborBackprop_${e}`}getUserCode(){return` + `}};function Rce(r){let{inputs:e,backend:t,attrs:o}=r,{images:n}=e,{alignCorners:s,halfPixelCenters:a,size:i}=o,[p,u]=i,l=s&&p>1?1:0,c=s&&u>1?1:0,d=[{type:"float32",data:[l,c]},{type:"float32",data:[s?.5:0]}],f=new gy(n.shape,p,u,a);return t.runWebGPUProgram(f,[n],n.dtype,d)}var RG={kernelName:bs,backendName:"webgpu",kernelFunc:Rce};var xy=class{constructor(e,t){this.variableNames=["dy"],this.uniforms=`effectiveXSize : vec2, effectiveYSize : vec2, invHeightScale : f32, invWidthScale : f32, + winHeight : i32, winWidth : i32,`,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.alignCorners=t,this.shaderKey=`resizeNearestNeigborBackprop_${t}`}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getOutputCoords(); @@ -8093,7 +8093,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, accumulator); } } - `}};function Xpe(r){let{inputs:t,backend:e,attrs:o}=r,{images:n,dy:s}=t,{alignCorners:a}=o,[,i,p]=n.shape,[,u,c]=s.shape,l=[a&&u>1?i-1:i,a&&c>1?p-1:p],m=[a&&u>1?u-1:u,a&&c>1?c-1:c],d=l[0]/m[0],f=l[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,C=new oy(n.shape,a),S=[{type:"int32",data:l},{type:"int32",data:m},{type:"float32",data:[h]},{type:"float32",data:[g]},{type:"int32",data:[x]},{type:"int32",data:[b]}];return e.runWebGPUProgram(C,[s],s.dtype,S)}var iU={kernelName:Za,backendName:"webgpu",kernelFunc:Xpe};var ny=class{constructor(t){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=" axis : vec4,",this.shaderKey="reverse"}getUserCode(){return` + `}};function Dce(r){let{inputs:e,backend:t,attrs:o}=r,{images:n,dy:s}=e,{alignCorners:a}=o,[,i,p]=n.shape,[,u,l]=s.shape,c=[a&&u>1?i-1:i,a&&l>1?p-1:p],m=[a&&u>1?u-1:u,a&&l>1?l-1:l],d=c[0]/m[0],f=c[1]/m[1],h=1/d,g=1/f,x=Math.ceil(h)*2+2,b=Math.ceil(g)*2+2,w=new xy(n.shape,a),S=[{type:"int32",data:c},{type:"int32",data:m},{type:"float32",data:[h]},{type:"float32",data:[g]},{type:"int32",data:[x]},{type:"int32",data:[b]}];return t.runWebGPUProgram(w,[s],s.dtype,S)}var DG={kernelName:ai,backendName:"webgpu",kernelFunc:Dce};var yy=class{constructor(e){this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=" axis : vec4,",this.shaderKey="reverse"}getUserCode(){return` // Using uniform variables as judging conditions, so the function has // coherent execution within all threads. @@ -8123,8 +8123,8 @@ return a / b;`,Wee=` reverseCoords[1], reverseCoords[2], reverseCoords[3])); } } - `}};function Ype(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{dims:s}=o,a=n.shape.length;if(a===0)return At({inputs:{x:n},backend:e});let i=n.shape,p=[1,1,1,1];i.forEach((g,x)=>{let b=x+4-a;p[b]=g});let u=y.parseAxisParam(s,n.shape),c=[0,0,0,0];u.forEach(g=>{let x=g+4-a;c[x]=1});let l=[{type:"int32",data:c}],m=pe({inputs:{x:n},backend:e,attrs:{shape:p}}),d=new ny(p),f=e.runWebGPUProgram(d,[m],m.dtype,l);e.disposeData(m.dataId);let h=pe({inputs:{x:f},backend:e,attrs:{shape:i}});return e.disposeData(f.dataId),h}var uU={kernelName:ps,backendName:"webgpu",kernelFunc:Ype};var sy=class{constructor(t,e){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`centerX : f32, centerY : f32, sinRadians : f32, - cosRadians : f32,`,this.shaderKey="rotate",this.outputShape=t,typeof e=="number"?(this.uniforms+=" fillValue : f32,",this.fillSnippet="var outputValue = uniforms.fillValue;",this.shaderKey+="_float"):(this.uniforms+=" fillValue : vec3,",this.fillSnippet="var outputValue = uniforms.fillValue[coords[3]];",this.shaderKey+="_vec3")}getUserCode(){return` + `}};function Ace(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{dims:s}=o,a=n.shape.length;if(a===0)return Pt({inputs:{x:n},backend:t});let i=n.shape,p=[1,1,1,1];i.forEach((g,x)=>{let b=x+4-a;p[b]=g});let u=y.parseAxisParam(s,n.shape),l=[0,0,0,0];u.forEach(g=>{let x=g+4-a;l[x]=1});let c=[{type:"int32",data:l}],m=le({inputs:{x:n},backend:t,attrs:{shape:p}}),d=new yy(p),f=t.runWebGPUProgram(d,[m],m.dtype,c);t.disposeData(m.dataId);let h=le({inputs:{x:f},backend:t,attrs:{shape:i}});return t.disposeData(f.dataId),h}var AG={kernelName:Ss,backendName:"webgpu",kernelFunc:Ace};var by=class{constructor(e,t){this.outputShape=[],this.variableNames=["x"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`centerX : f32, centerY : f32, sinRadians : f32, + cosRadians : f32,`,this.shaderKey="rotate",this.outputShape=e,typeof t=="number"?(this.uniforms+=" fillValue : f32,",this.fillSnippet="var outputValue = uniforms.fillValue;",this.shaderKey+="_float"):(this.uniforms+=" fillValue : vec3,",this.fillSnippet="var outputValue = uniforms.fillValue[coords[3]];",this.shaderKey+="_vec3")}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); @@ -8144,7 +8144,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, outputValue); } } - `}};var pU={kernelName:Ds,backendName:"webgpu",kernelFunc:({inputs:r,attrs:t,backend:e})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=t,i=e,p=new sy(o.shape,s),[u,c]=w.getImageCenter(a,o.shape[1],o.shape[2]),l=[{type:"float32",data:[u]},{type:"float32",data:[c]},{type:"float32",data:[Math.sin(n)]},{type:"float32",data:[Math.cos(n)]}];return typeof s=="number"?l.push({type:"float32",data:[Number.parseFloat(s.toFixed(2))]}):l.push({type:"float32",data:s}),i.runWebGPUProgram(p,[o],o.dtype,l)}};var Qpe=ye({opType:Z.ROUND}),cU={kernelName:cs,backendName:"webgpu",kernelFunc:Qpe};var Zpe=ye({opType:Z.RSQRT,cpuKernelImpl:Ez}),lU={kernelName:ls,backendName:"webgpu",kernelFunc:Zpe};var za=class{constructor(t,e,o,n,s,a,i,p=!0){this.variableNames=["updates","indices"],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=a,this.type=i,this.sumDupeIndices=p,this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),this.sliceDimGreaterThanOne=e>1,this.shaderKey=`scatter_${o}_${n}_${this.sliceDimGreaterThanOne}_${i}_${p}_${s.length}`;let u=ft(s.length);this.uniforms=`sliceDim : i32, strides: ${u}, updatesSize: i32,`,this.updatesRank=n,this.indicesRank=o}getUserCode(){let t="";this.indicesRank===1?t="coords[0]":this.indicesRank===2&&(t="coords[0], j");let e=`getIndices(${t})`,o=this.sliceDimGreaterThanOne?"uniforms.strides[j]":"uniforms.strides",n="",s="";this.dispatchLayout.x.length===1?(n="flattenedIndex",s=` + `}};var FG={kernelName:Vs,backendName:"webgpu",kernelFunc:({inputs:r,attrs:e,backend:t})=>{let{image:o}=r,{radians:n,fillValue:s,center:a}=e,i=t,p=new by(o.shape,s),[u,l]=C.getImageCenter(a,o.shape[1],o.shape[2]),c=[{type:"float32",data:[u]},{type:"float32",data:[l]},{type:"float32",data:[Math.sin(n)]},{type:"float32",data:[Math.cos(n)]}];return typeof s=="number"?c.push({type:"float32",data:[Number.parseFloat(s.toFixed(2))]}):c.push({type:"float32",data:s}),i.runWebGPUProgram(p,[o],o.dtype,c)}};var Fce=ye({opType:Z.ROUND}),PG={kernelName:Is,backendName:"webgpu",kernelFunc:Fce};var Pce=ye({opType:Z.RSQRT,cpuKernelImpl:tW}),OG={kernelName:Do,backendName:"webgpu",kernelFunc:Pce};var qa=class{constructor(e,t,o,n,s,a,i,p=!0){this.variableNames=["updates","indices"],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=a,this.type=i,this.sumDupeIndices=p,this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),this.sliceDimGreaterThanOne=t>1,this.shaderKey=`scatter_${o}_${n}_${this.sliceDimGreaterThanOne}_${i}_${p}_${s.length}`;let u=ft(s.length);this.uniforms=`sliceDim : i32, strides: ${u}, updatesSize: i32,`,this.updatesRank=n,this.indicesRank=o}getUserCode(){let e="";this.indicesRank===1?e="coords[0]":this.indicesRank===2&&(e="coords[0], j");let t=`getIndices(${e})`,o=this.sliceDimGreaterThanOne?"uniforms.strides[j]":"uniforms.strides",n="",s="";this.dispatchLayout.x.length===1?(n="flattenedIndex",s=` fn getUpdatesCoordsFromFlatIndex(index : i32) -> i32 { return index; } @@ -8159,23 +8159,23 @@ return a / b;`,Wee=` let d1 = index - d0 * sliceSize; return vec2(d0, d1); } - `);let i=`getUpdates(${Array.from({length:this.updatesRank},(u,c)=>`coords[${c}]`).join(", ")})`;return` + `);let i=`getUpdates(${Array.from({length:this.updatesRank},(u,l)=>`coords[${l}]`).join(", ")})`;return` ${s} ${G("index")} { if (index < uniforms.updatesSize) { let coords = getUpdatesCoordsFromFlatIndex(index); var flattenedIndex = 0; for (var j = 0; j < uniforms.sliceDim; j = j + 1) { - let indexInside = i32(round(${e})); + let indexInside = i32(round(${t})); flattenedIndex = flattenedIndex + indexInside * ${o}; } let updateValue = - ${Cu(this.type)}(${i}); + ${Eu(this.type)}(${i}); let flatIndex = getOutputIndexFromCoords(${n}); - ${this.sumDupeIndices?Yr("&result[flatIndex]","updateValue",this.type):"atomicStore(&result[flatIndex], bitcast(updateValue));"} + ${this.sumDupeIndices?oo("&result[flatIndex]","updateValue",this.type):"atomicStore(&result[flatIndex], bitcast(updateValue));"} } - }`}};function Jpe(r){let{inputs:t,backend:e,attrs:o}=r,{indices:n,updates:s}=t,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(s,n,a),m=[l/u,u];if(l===0)return e.makeTensorInfo(a,n.dtype);let d=pe({inputs:{x:n},backend:e,attrs:{shape:[p,i]}}),f=pe({inputs:{x:s},backend:e,attrs:{shape:[p,u]}}),h=f.dtype,g=vt({backend:e,attrs:{shape:m,value:0,dtype:h}}),x=y.sizeFromShape(f.shape),b=[{type:"int32",data:[i]},{type:"int32",data:c},{type:"int32",data:[x]}],C=new za(f.shape,i,d.shape.length,f.shape.length,c,m,h),S=e.runWebGPUProgram(C,[f,d],h,b,g),k=pe({inputs:{x:S},backend:e,attrs:{shape:a}});return e.disposeData(d.dataId),e.disposeData(f.dataId),e.disposeData(S.dataId),k}var mU={kernelName:ms,backendName:"webgpu",kernelFunc:Jpe};var ay=class{constructor(t,e){this.outputShape=[],this.variableNames=["sortedSequence","values"],this.uniforms="numInputs : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.side=e,this.shaderKey=`search_sorted_${e}`}getUserCode(){return` + }`}};function Oce(r){let{inputs:e,backend:t,attrs:o}=r,{indices:n,updates:s}=e,{shape:a}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(s,n,a),m=[c/u,u];if(c===0)return t.makeTensorInfo(a,n.dtype);let d=le({inputs:{x:n},backend:t,attrs:{shape:[p,i]}}),f=le({inputs:{x:s},backend:t,attrs:{shape:[p,u]}}),h=f.dtype,g=Nt({backend:t,attrs:{shape:m,value:0,dtype:h}}),x=y.sizeFromShape(f.shape),b=[{type:"int32",data:[i]},{type:"int32",data:l},{type:"int32",data:[x]}],w=new qa(f.shape,i,d.shape.length,f.shape.length,l,m,h),S=t.runWebGPUProgram(w,[f,d],h,b,g),k=le({inputs:{x:S},backend:t,attrs:{shape:a}});return t.disposeData(d.dataId),t.disposeData(f.dataId),t.disposeData(S.dataId),k}var MG={kernelName:vs,backendName:"webgpu",kernelFunc:Oce};var Cy=class{constructor(e,t){this.outputShape=[],this.variableNames=["sortedSequence","values"],this.uniforms="numInputs : i32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.side=t,this.shaderKey=`search_sorted_${t}`}getUserCode(){return` fn findBound(batch: i32, value: f32) -> i32 { var left = i32(0); var right = uniforms.numInputs; @@ -8197,29 +8197,29 @@ return a / b;`,Wee=` setOutputAtIndexI32(index, findBound(coords[0], value)); } } - `}};function ece(r){let{inputs:t,backend:e,attrs:o}=r,{sortedSequence:n,values:s}=t,{side:a}=o,i=new ay([s.shape[0],s.shape[1]],a),p=[{type:"int32",data:[n.shape[1]]}];return e.runWebGPUProgram(i,[n,s],"int32",p)}var dU={kernelName:fs,backendName:"webgpu",kernelFunc:ece};var iy=class{constructor(t,e,o){this.variableNames=["c","a","b"],this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.cRank=t,this.rank=o,this.shaderKey="select"}getUserCode(){let t,e;if(this.rank>4)throw Error(`Where for rank ${this.rank} is not yet supported`);if(this.rank===1)e="resRC",t="resRC";else{let n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],a=[];for(let i=0;i4)throw Error(`Where for rank ${this.rank} is not yet supported`);if(this.rank===1)t="resRC",e="resRC";else{let n=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],a=[];for(let i=0;i= 1.0) { - setOutputAtIndex(index, getA(${e})); + setOutputAtIndex(index, getA(${t})); } else { - setOutputAtIndex(index, getB(${e})); + setOutputAtIndex(index, getB(${t})); } } } - `}};function tce(r){let{inputs:t,backend:e}=r,{condition:o,t:n,e:s}=t,a=new iy(o.shape.length,n.shape,n.shape.length);return e.runWebGPUProgram(a,[o,n,s],dt(n.dtype,s.dtype))}var fU={kernelName:fa,backendName:"webgpu",kernelFunc:tce};var rce=ye({opType:Z.SELU}),hU={kernelName:hs,backendName:"webgpu",kernelFunc:rce};var oce=ye({opType:Z.SIGMOID}),gU={kernelName:bs,backendName:"webgpu",kernelFunc:oce};var nce=ye({opType:Z.SIGN}),xU={kernelName:ys,backendName:"webgpu",kernelFunc:nce};var sce=ye({opType:Z.SIN}),yU={kernelName:gs,backendName:"webgpu",kernelFunc:sce};var ace=ye({opType:Z.SINH}),bU={kernelName:xs,backendName:"webgpu",kernelFunc:ace};var ice=ye({opType:Z.SOFTPLUS}),CU={kernelName:Cs,backendName:"webgpu",kernelFunc:ice};var uy=class{constructor(t,e,o,n,s,a){this.variableNames=["x"],this.outputShape=[],this.uniforms="",this.workgroupSize=[64,1,1],this.size=!0;let i=new Array(n.length);for(let p=0;p{this.uniforms+=` pad${u} : vec2,`}),this.shaderKey=`spaceToBatchND_${s}`}getUserCode(){let t=ft(this.outputShape.length),e=Jv(this.newDim);return` - ${um(this.paddedXShape,"PaddedX")} + `}};function Lce(r){let{inputs:e,backend:t}=r,{condition:o,t:n,e:s}=e,a=new wy(o.shape.length,n.shape,n.shape.length);return t.runWebGPUProgram(a,[o,n,s],pt(n.dtype,s.dtype))}var BG={kernelName:wa,backendName:"webgpu",kernelFunc:Lce};var Bce=ye({opType:Z.SELU}),zG={kernelName:Ts,backendName:"webgpu",kernelFunc:Bce};var zce=ye({opType:Z.SIGMOID}),VG={kernelName:Ao,backendName:"webgpu",kernelFunc:zce};var Vce=ye({opType:Z.SIGN}),WG={kernelName:Rs,backendName:"webgpu",kernelFunc:Vce};var Wce=ye({opType:Z.SIN}),UG={kernelName:Es,backendName:"webgpu",kernelFunc:Wce};var Uce=ye({opType:Z.SINH}),GG={kernelName:$s,backendName:"webgpu",kernelFunc:Uce};var Gce=ye({opType:Z.SOFTPLUS}),HG={kernelName:Ds,backendName:"webgpu",kernelFunc:Gce};var Sy=class{constructor(e,t,o,n,s,a){this.variableNames=["x"],this.outputShape=[],this.uniforms="",this.workgroupSize=[64,1,1],this.size=!0;let i=new Array(n.length);for(let p=0;p{this.uniforms+=` pad${u} : vec2,`}),this.shaderKey=`spaceToBatchND_${s}`}getUserCode(){let e=ft(this.outputShape.length),t=Bv(this.newDim);return` + ${xm(this.paddedXShape,"PaddedX")} ${G("index")} { if(index < uniforms.size) { let coords = getCoordsFromIndex(index); - let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${t}(${e}), uniforms.reshapedPaddedXShape); + let switchedIndex = getIndexFromCoords${this.outputShape.length}D(${e}(${t}), uniforms.reshapedPaddedXShape); let paddedCoords = getPaddedXCoordsFromIndex(switchedIndex); - ${l0(this.xShape,!0)} + ${Qv(this.xShape,!0)} } } - `}};var uce=r=>{let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet");let i=s.reduce((b,C)=>b*C),p=[[0,0]];p.push(...a);for(let b=1+s.length;bb[0]+n.shape[C]+b[1]),c=w.getReshaped(u,s,i,!1),l=w.getPermuted(c.length,s.length,!1),m=w.getReshapedPermuted(u,s,i,!1),d=y.computeStrides(u),f=new uy(n.shape,u,p,c,l,d.length),h=[{type:"int32",data:c},{type:"int32",data:d}];p.map(b=>h.push({type:"int32",data:[b[0],b[1]]}));let g=e.runWebGPUProgram(f,[n],n.dtype,h),x=pe({inputs:{x:g},backend:e,attrs:{shape:m}});return e.disposeData(g.dataId),x},wU={kernelName:ga,backendName:"webgpu",kernelFunc:uce};var py=class{constructor(t,e,o){this.variableNames=["input","indices","segmentIds"],this.outputShape=[],this.uniforms="segmentSize : i32, sparseSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t,this.type=o,this.dispatchLayout=X([e]),this.dispatch=H(this.dispatchLayout,[e],this.workgroupSize),this.shaderKey="sparseSegmentSum"}getUserCode(){return` + `}};var Hce=r=>{let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{blockShape:s,paddings:a}=o;y.assert(n.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGPU backend not implemented yet");let i=s.reduce((b,w)=>b*w),p=[[0,0]];p.push(...a);for(let b=1+s.length;bb[0]+n.shape[w]+b[1]),l=C.getReshaped(u,s,i,!1),c=C.getPermuted(l.length,s.length,!1),m=C.getReshapedPermuted(u,s,i,!1),d=y.computeStrides(u),f=new Sy(n.shape,u,p,l,c,d.length),h=[{type:"int32",data:l},{type:"int32",data:d}];p.map(b=>h.push({type:"int32",data:[b[0],b[1]]}));let g=t.runWebGPUProgram(f,[n],n.dtype,h),x=le({inputs:{x:g},backend:t,attrs:{shape:m}});return t.disposeData(g.dataId),x},KG={kernelName:Sa,backendName:"webgpu",kernelFunc:Hce};var Iy=class{constructor(e,t,o){this.variableNames=["input","indices","segmentIds"],this.outputShape=[],this.uniforms="segmentSize : i32, sparseSize : i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e,this.type=o,this.dispatchLayout=X([t]),this.dispatch=H(this.dispatchLayout,[t],this.workgroupSize),this.shaderKey="sparseSegmentSum"}getUserCode(){return` ${G("index")} { if (index < uniforms.sparseSize) { let indexInSegmentIds = index / uniforms.segmentSize; @@ -8229,17 +8229,17 @@ return a / b;`,Wee=` let value = input[indexInInput * uniforms.segmentSize + indexInSegment]; let outIndex = segmentId * uniforms.segmentSize + indexInSegment; - ${Yr("&result[outIndex]","value",this.type)} + ${oo("&result[outIndex]","value",this.type)} } } - `}},cy=class{constructor(t,e){this.variableNames=["segmentIds"],this.outputShape=[],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=[t],this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),this.shaderKey="sparseSegmentIdCountProgram"}getUserCode(){return` + `}},vy=class{constructor(e,t){this.variableNames=["segmentIds"],this.outputShape=[],this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=[e],this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),this.shaderKey="sparseSegmentIdCountProgram"}getUserCode(){return` ${G("index")} { if (index < uniforms.segmentIdsShape) { let segmentId = segmentIds[index]; - ${Yr("&result[segmentId]","1","int32")} + ${oo("&result[segmentId]","1","int32")} } } - `}},ly=class{constructor(t,e){this.variableNames=["segmentSum","sameSegmentIdCount"],this.outputShape=[],this.uniforms="segmentSize : i32",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.type=e,this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),this.shaderKey="sparseSegmentMean"}getUserCode(){return` + `}},ky=class{constructor(e,t){this.variableNames=["segmentSum","sameSegmentIdCount"],this.outputShape=[],this.uniforms="segmentSize : i32",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.type=t,this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),this.shaderKey="sparseSegmentMean"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let segmentId = index / uniforms.segmentSize; @@ -8249,21 +8249,21 @@ return a / b;`,Wee=` } } } - `}};function my(r,t,e,o=!1,n){let a=y.sizeFromShape(r.shape)/r.shape[0],i=r.dtype,p=y.sizeFromShape(t.shape),u=n.readSync(e.dataId),l=p>0?u[p-1]+1:0,m,d=r.shape.slice();d[0]=l;let f=p*a,h=vt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new py(d,f,i);let g=[{type:"int32",data:[a]},{type:"int32",data:[f]}],x=n.runWebGPUProgram(m,[r,t,e],i,g,h);if(o)return x;let b=vt({backend:n,attrs:{shape:[l],value:0,dtype:"int32"}});m=new cy(l,e.shape);let C=n.runWebGPUProgram(m,[e],"int32",null,b),S=vt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new ly(d,i),g=[{type:"int32",data:[a]}];let k=n.runWebGPUProgram(m,[x,C],i,g,S);return n.disposeData(x.dataId),n.disposeData(C.dataId),k}function pce(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;return my(o,n,s,!1,e)}var SU={kernelName:ya,backendName:"webgpu",kernelFunc:pce};function cce(r){let{inputs:t,backend:e}=r,{data:o,indices:n,segmentIds:s}=t;return my(o,n,s,!0,e)}var IU={kernelName:ba,backendName:"webgpu",kernelFunc:cce};var dy=class{constructor(t,e){this.variableNames=["A"],this.workgroupSize=[64,1,1],this.size=!0;let o=new Array(t.length);for(let n=0;n0?u[p-1]+1:0,m,d=r.shape.slice();d[0]=c;let f=p*a,h=Nt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new Iy(d,f,i);let g=[{type:"int32",data:[a]},{type:"int32",data:[f]}],x=n.runWebGPUProgram(m,[r,e,t],i,g,h);if(o)return x;let b=Nt({backend:n,attrs:{shape:[c],value:0,dtype:"int32"}});m=new vy(c,t.shape);let w=n.runWebGPUProgram(m,[t],"int32",null,b),S=Nt({backend:n,attrs:{shape:d,value:0,dtype:i}});m=new ky(d,i),g=[{type:"int32",data:[a]}];let k=n.runWebGPUProgram(m,[x,w],i,g,S);return n.disposeData(x.dataId),n.disposeData(w.dataId),k}function Kce(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;return Ny(o,n,s,!1,t)}var qG={kernelName:va,backendName:"webgpu",kernelFunc:Kce};function qce(r){let{inputs:e,backend:t}=r,{data:o,indices:n,segmentIds:s}=e;return Ny(o,n,s,!0,t)}var jG={kernelName:ka,backendName:"webgpu",kernelFunc:qce};var Ty=class{constructor(e,t){this.variableNames=["A"],this.workgroupSize=[64,1,1],this.size=!0;let o=new Array(e.length);for(let n=0;n=5)throw Error(`Tile for rank ${r} is not yet supported`);if(r===1)return`(resRC % ${t}aShape)`;let e=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[];for(let n=0;n=5){let p=e.readSync(n.dataId),u=n.dtype==="string"?p.map(m=>y.decodeString(m)):p,c=me(n.shape,n.dtype,u),l=Mz(c,s);return e.makeTensorInfo(l.shape,l.dtype,l.values)}let a=new dy(n.shape,s);return e.runWebGPUProgram(a,[n],n.dtype)}var vU={kernelName:uo,backendName:"webgpu",kernelFunc:ym};function mce(r){let{inputs:t,backend:e,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=t,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:c,strides:l,outputSize:m}=w.calculateShapes(s,n,i),d=!1;if(s.dtype==="string"){let R=e.bufferSync(n),D=e.bufferSync(s),P=y.decodeString(e.readSync(a.dataId)[0]),O=Rz(R,D,i,m,c,u,p,l,P,d);return e.makeTensorInfo(i,O.dtype,O.values)}let f=[m/c,c],h=pe({inputs:{x:n},backend:e,attrs:{shape:[u,p]}}),g=s.shape.length?pe({inputs:{x:s},backend:e,attrs:{shape:[u,c]}}):At({inputs:{x:s},backend:e}),x=g.dtype,b=e.makeTensorInfo([],x,y.makeZerosTypedArray(1,x)),C=pe({inputs:{x:a},backend:e,attrs:{shape:Array(f.length).fill(1)}}),S=ym({inputs:{x:C},backend:e,attrs:{reps:f}}),k=y.sizeFromShape([u,c]),_=[{type:"int32",data:[p]},{type:"int32",data:l},{type:"int32",data:[k]}];switch(u){case 0:break;case 1:{let R=new za([u,c],p,h.shape.length,g.shape.length,l,f,x,d);e.runWebGPUProgram(R,[g,h],x,_,S)}break;default:{let R=new za([u,c],p,h.shape.length,b.shape.length,l,f,x,d);e.runWebGPUProgram(R,[b,h],x,_,S)}{let R=new za([u,c],p,h.shape.length,g.shape.length,l,f,x);e.runWebGPUProgram(R,[g,h],x,_,S)}}let E=pe({inputs:{x:S},backend:e,attrs:{shape:i}});return e.disposeData(h.dataId),e.disposeData(g.dataId),e.disposeData(C.dataId),e.disposeData(b.dataId),e.disposeData(S.dataId),E}var kU={kernelName:vs,backendName:"webgpu",kernelFunc:mce};function dce(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=w.prepareSplitSize(n,s,i),u=n.shape.length,c=new Array(u).fill(0),l=n.shape.slice();return p.map(m=>{let d=[...l];d[i]=m;let f=Hs({inputs:{x:n},backend:e,attrs:{begin:c,size:d}});return c[i]+=m,f})}var NU={kernelName:xa,backendName:"webgpu",kernelFunc:dce};var fce=ye({opType:Z.SQRT}),TU={kernelName:ws,backendName:"webgpu",kernelFunc:fce};var _U={kernelName:Ki,backendName:"webgpu",kernelFunc:({inputs:r,backend:t})=>{let{x:e}=r,o=t,n=new Zr(e.shape,Z.SQUARE);return o.runWebGPUProgram(n,[e],e.dtype)}};var hce=et({opType:fe.SQUARED_DIFFERENCE}),$U={kernelName:ks,backendName:"webgpu",kernelFunc:hce};function gce({inputs:r,attrs:t,backend:e}){let{x:o}=r,n=new Zr(o.shape,Z.STEP,"stepAlpha : f32,"),s=[{type:"float32",data:[t.alpha]}];return e.runWebGPUProgram(n,[o],o.dtype,s)}var EU={kernelName:wo,backendName:"webgpu",kernelFunc:gce};var fy=class{constructor(t){this.variableNames=["x"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]);let e=ft(this.outputShape.length);this.uniforms=`begin : ${e}, strides : ${e}, `,this.shaderKey="stridedSlice"}getUserCode(){let t=this.outputShape.length,e="";if(t===1)e="coords * uniforms.strides + uniforms.begin";else{let n=0;e=this.outputShape.map((s,a)=>(n++,this.outputShape.length===1?`coords * uniforms.strides[${a}] + uniforms.begin[${a}]`:`coords[${n-1}] * uniforms.strides[${a}] + uniforms.begin[${a}]`)).join(",")}return` + `}};function jce(r,e=""){if(r>=5)throw Error(`Tile for rank ${r} is not yet supported`);if(r===1)return`(resRC % ${e}aShape)`;let t=["resRC.x","resRC.y","resRC.z","resRC.w"],o=[];for(let n=0;n=5){let p=t.readSync(n.dataId),u=n.dtype==="string"?p.map(m=>y.decodeString(m)):p,l=ie(n.shape,n.dtype,u),c=uW(l,s);return t.makeTensorInfo(c.shape,c.dtype,c.values)}let a=new Ty(n.shape,s);return t.runWebGPUProgram(a,[n],n.dtype)}var XG={kernelName:Mo,backendName:"webgpu",kernelFunc:$m};function Xce(r){let{inputs:e,backend:t,attrs:o}=r,{sparseIndices:n,sparseValues:s,defaultValue:a}=e,{outputShape:i}=o,{sliceRank:p,numUpdates:u,sliceSize:l,strides:c,outputSize:m}=C.calculateShapes(s,n,i),d=!1;if(s.dtype==="string"){let R=t.bufferSync(n),D=t.bufferSync(s),F=y.decodeString(t.readSync(a.dataId)[0]),O=rW(R,D,i,m,l,u,p,c,F,d);return t.makeTensorInfo(i,O.dtype,O.values)}let f=[m/l,l],h=le({inputs:{x:n},backend:t,attrs:{shape:[u,p]}}),g=s.shape.length?le({inputs:{x:s},backend:t,attrs:{shape:[u,l]}}):Pt({inputs:{x:s},backend:t}),x=g.dtype,b=t.makeTensorInfo([],x,y.makeZerosTypedArray(1,x)),w=le({inputs:{x:a},backend:t,attrs:{shape:Array(f.length).fill(1)}}),S=$m({inputs:{x:w},backend:t,attrs:{reps:f}}),k=y.sizeFromShape([u,l]),T=[{type:"int32",data:[p]},{type:"int32",data:c},{type:"int32",data:[k]}];switch(u){case 0:break;case 1:{let R=new qa([u,l],p,h.shape.length,g.shape.length,c,f,x,d);t.runWebGPUProgram(R,[g,h],x,T,S)}break;default:{let R=new qa([u,l],p,h.shape.length,b.shape.length,c,f,x,d);t.runWebGPUProgram(R,[b,h],x,T,S)}{let R=new qa([u,l],p,h.shape.length,g.shape.length,c,f,x);t.runWebGPUProgram(R,[g,h],x,T,S)}}let E=le({inputs:{x:S},backend:t,attrs:{shape:i}});return t.disposeData(h.dataId),t.disposeData(g.dataId),t.disposeData(w.dataId),t.disposeData(b.dataId),t.disposeData(S.dataId),E}var YG={kernelName:Ps,backendName:"webgpu",kernelFunc:Xce};function Yce(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{numOrSizeSplits:s,axis:a}=o,i=y.parseAxisParam(a,n.shape)[0],p=C.prepareSplitSize(n,s,i),u=n.shape.length,l=new Array(u).fill(0),c=n.shape.slice();return p.map(m=>{let d=[...c];d[i]=m;let f=ea({inputs:{x:n},backend:t,attrs:{begin:l,size:d}});return l[i]+=m,f})}var QG={kernelName:Ia,backendName:"webgpu",kernelFunc:Yce};var Qce=ye({opType:Z.SQRT}),ZG={kernelName:Fo,backendName:"webgpu",kernelFunc:Qce};var JG={kernelName:tu,backendName:"webgpu",kernelFunc:({inputs:r,backend:e})=>{let{x:t}=r,o=e,n=new so(t.shape,Z.SQUARE);return o.runWebGPUProgram(n,[t],t.dtype)}};var Zce=tt({opType:fe.SQUARED_DIFFERENCE}),e4={kernelName:Po,backendName:"webgpu",kernelFunc:Zce};function Jce({inputs:r,attrs:e,backend:t}){let{x:o}=r,n=new so(o.shape,Z.STEP,"stepAlpha : f32,"),s=[{type:"float32",data:[e.alpha]}];return t.runWebGPUProgram(n,[o],o.dtype,s)}var t4={kernelName:Ko,backendName:"webgpu",kernelFunc:Jce};var _y=class{constructor(e){this.variableNames=["x"],this.workPerThread=1,this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize,[this.workPerThread,1,1]);let t=ft(this.outputShape.length);this.uniforms=`begin : ${t}, strides : ${t}, `,this.shaderKey="stridedSlice"}getUserCode(){let e=this.outputShape.length,t="";if(e===1)t="coords * uniforms.strides + uniforms.begin";else{let n=0;t=this.outputShape.map((s,a)=>(n++,this.outputShape.length===1?`coords * uniforms.strides[${a}] + uniforms.begin[${a}]`:`coords[${n-1}] * uniforms.strides[${a}] + uniforms.begin[${a}]`)).join(",")}return` ${G("index")} { if (index < uniforms.size) { let coords = getCoordsFromIndex(index); - setOutputAtIndex(index, getX(${e})); + setOutputAtIndex(index, getX(${t})); } } - `}};function xce(r){let{inputs:t,backend:e,attrs:o}=r,{x:n}=t,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:c,newAxisMask:l,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:C,strides:S}=pt.sliceInfo(n.shape,s,a,i,p,u,c,l,m),k;if(h)k=pe({inputs:{x:n},backend:e,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let _=pt.computeOutShape(b,C,S),E=Hs({inputs:{x:n},backend:e,attrs:{begin:b,size:_}});k=pe({inputs:{x:E},backend:e,attrs:{shape:f}}),e.disposeData(E.dataId)}else if(e.shouldExecuteOnCPU([n])){let E=e.readSync(n.dataId),R=me(n.shape,n.dtype,E),D=Fz(d,R,S,b);k=e.makeTensorInfo(f,n.dtype,D.values)}else{let E=new fy(d),R=[{type:"int32",data:b},{type:"int32",data:S}],D=e.runWebGPUProgram(E,[n],n.dtype,R);k=pe({inputs:{x:D},backend:e,attrs:{shape:f}}),e.disposeData(D.dataId)}return k}var RU={kernelName:Ns,backendName:"webgpu",kernelFunc:xce};function yce(r){let{inputs:t,backend:e,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:c,dataSplits:l}=t,m=e.readSync(c.dataId),d=e.readSync(l.dataId),[f,h]=Pz(m,d,n,s,a,i,p,u);return[e.makeTensorInfo([f.length],"string",f),e.makeTensorInfo(l.shape,"int32",h)]}var DU={kernelName:Ca,backendName:"webgpu",kernelFunc:yce};var bce=et({opType:fe.SUB,cpuKernelImpl:Oz,supportsComplex:!0}),AU={kernelName:Ts,backendName:"webgpu",kernelFunc:bce};var Cce=ye({opType:Z.TAN}),FU={kernelName:_s,backendName:"webgpu",kernelFunc:Cce};var wce=ye({opType:Z.TANH}),PU={kernelName:$s,backendName:"webgpu",kernelFunc:wce};function Sce(r){let{inputs:t,backend:e,attrs:o}=r,{tensor:n,indices:s,updates:a}=t,{}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:c,outputSize:l}=w.calculateShapes(a,s,n.shape),m=[l/u,u];if(l===0)return e.makeTensorInfo(n.shape,s.dtype);let d=[],f=pe({inputs:{x:s},backend:e,attrs:{shape:[p,i]}});d.push(f);let h=pe({inputs:{x:a},backend:e,attrs:{shape:[p,u]}});d.push(h);let g=pe({inputs:{x:n},backend:e,attrs:{shape:m}});d.push(g);let x=ym({inputs:{x:g},backend:e,attrs:{reps:Array(m.length).fill(1)}}),b=new za([p,u],i,f.shape.length,h.shape.length,c,m,n.dtype,!1),C=y.sizeFromShape([p,u]),S=[{type:"int32",data:[i]},{type:"int32",data:c},{type:"int32",data:[C]}],k=e.runWebGPUProgram(b,[h,f],g.dtype,S,x);d.push(k);let _=pe({inputs:{x:k},backend:e,attrs:{shape:n.shape}});return d.forEach(E=>e.disposeData(E.dataId)),_}var OU={kernelName:ds,backendName:"webgpu",kernelFunc:Sce};var hy=class{constructor(t){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`inputSize : i32, firstPass : i32, negativeInf : f32, + `}};function eme(r){let{inputs:e,backend:t,attrs:o}=r,{x:n}=e,{begin:s,end:a,strides:i,beginMask:p,endMask:u,ellipsisMask:l,newAxisMask:c,shrinkAxisMask:m}=o,{finalShapeSparse:d,finalShape:f,isIdentity:h,sliceDim0:g,isSimpleSlice:x,begin:b,end:w,strides:S}=nt.sliceInfo(n.shape,s,a,i,p,u,l,c,m),k;if(h)k=le({inputs:{x:n},backend:t,attrs:{shape:f}});else if(g||x){y.assert(n.shape.length>=1,()=>`Input must have rank at least 1, got: ${n.shape.length}`);let T=nt.computeOutShape(b,w,S),E=ea({inputs:{x:n},backend:t,attrs:{begin:b,size:T}});k=le({inputs:{x:E},backend:t,attrs:{shape:f}}),t.disposeData(E.dataId)}else if(t.shouldExecuteOnCPU([n])){let E=t.readSync(n.dataId),R=ie(n.shape,n.dtype,E),D=sW(d,R,S,b);k=t.makeTensorInfo(f,n.dtype,D.values)}else{let E=new _y(d),R=[{type:"int32",data:b},{type:"int32",data:S}],D=t.runWebGPUProgram(E,[n],n.dtype,R);k=le({inputs:{x:D},backend:t,attrs:{shape:f}}),t.disposeData(D.dataId)}return k}var r4={kernelName:Os,backendName:"webgpu",kernelFunc:eme};function tme(r){let{inputs:e,backend:t,attrs:o}=r,{separator:n,nGramWidths:s,leftPad:a,rightPad:i,padWidth:p,preserveShortSequences:u}=o,{data:l,dataSplits:c}=e,m=t.readSync(l.dataId),d=t.readSync(c.dataId),[f,h]=aW(m,d,n,s,a,i,p,u);return[t.makeTensorInfo([f.length],"string",f),t.makeTensorInfo(c.shape,"int32",h)]}var o4={kernelName:Na,backendName:"webgpu",kernelFunc:tme};var rme=tt({opType:fe.SUB,cpuKernelImpl:iW,supportsComplex:!0}),n4={kernelName:Oo,backendName:"webgpu",kernelFunc:rme};var ome=ye({opType:Z.TAN}),s4={kernelName:Ms,backendName:"webgpu",kernelFunc:ome};var nme=ye({opType:Z.TANH}),a4={kernelName:Ls,backendName:"webgpu",kernelFunc:nme};function sme(r){let{inputs:e,backend:t,attrs:o}=r,{tensor:n,indices:s,updates:a}=e,{}=o,{sliceRank:i,numUpdates:p,sliceSize:u,strides:l,outputSize:c}=C.calculateShapes(a,s,n.shape),m=[c/u,u];if(c===0)return t.makeTensorInfo(n.shape,s.dtype);let d=[],f=le({inputs:{x:s},backend:t,attrs:{shape:[p,i]}});d.push(f);let h=le({inputs:{x:a},backend:t,attrs:{shape:[p,u]}});d.push(h);let g=le({inputs:{x:n},backend:t,attrs:{shape:m}});d.push(g);let x=$m({inputs:{x:g},backend:t,attrs:{reps:Array(m.length).fill(1)}}),b=new qa([p,u],i,f.shape.length,h.shape.length,l,m,n.dtype,!1),w=y.sizeFromShape([p,u]),S=[{type:"int32",data:[i]},{type:"int32",data:l},{type:"int32",data:[w]}],k=t.runWebGPUProgram(b,[h,f],g.dtype,S,x);d.push(k);let T=le({inputs:{x:k},backend:t,attrs:{shape:n.shape}});return d.forEach(E=>t.disposeData(E.dataId)),T}var i4={kernelName:ks,backendName:"webgpu",kernelFunc:sme};var Ey=class{constructor(e){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms=`inputSize : i32, firstPass : i32, negativeInf : f32, dir : i32, inc : i32,`,this.shaderKey="swap"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { @@ -8331,7 +8331,7 @@ return a / b;`,Wee=` } } } - `}},gy=class{constructor(t){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms="inputSize : i32, firstPass : i32, k : i32,",this.shaderKey="merge"}getUserCode(){return` + `}},$y=class{constructor(e){this.variableNames=["x","indices"],this.workgroupSize=[256,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.uniforms="inputSize : i32, firstPass : i32, k : i32,",this.shaderKey="merge"}getUserCode(){return` ${G("index")} { if (index < uniforms.size) { let outC = getCoordsFromIndex(index); @@ -8390,7 +8390,7 @@ return a / b;`,Wee=` } } } - `}};function el(r,t){t!==null&&r.disposeData(t.dataId)}function MU(r){let t=1;for(;tf===null?[l,l]:[l,f],g=(k,_,E)=>{let R=h(),D=new hy(E),O=[{type:"int32",data:[p]},{type:"int32",data:[f===null?1:0]},{type:"float32",data:[Number.NEGATIVE_INFINITY]},{type:"int32",data:[k]},{type:"int32",data:[_]}],M=f;f=e.runWebGPUProgram(D,R,"int32",O),el(e,M)};for(let k=1;k=1;E/=2)g(_,E,[c,d])}for(let k=d;k>m;k/=2){let _=h(),E=new gy([c,k/2]),D=[{type:"int32",data:[p]},{type:"int32",data:[f===null?1:0]},{type:"int32",data:[m]}],P=f;f=e.runWebGPUProgram(E,_,"int32",D),el(e,P);let O=m/2,M=O*2;for(let L=O;L>=1;L/=2)g(M,L,f.shape)}let x=f;f=Hs({inputs:{x:f},backend:e,attrs:{begin:0,size:[c,s]}}),el(e,x);let b=p0({inputs:{x:l,indices:f},backend:e,attrs:{axis:1,batchDims:1}});el(e,l);let C=i.slice(0,-1);C.push(s),x=f,f=pe({inputs:{x:f},attrs:{shape:C},backend:e}),el(e,x);let S=b;return b=pe({inputs:{x:b},attrs:{shape:C},backend:e}),el(e,S),[b,f]}var LU={kernelName:Es,backendName:"webgpu",kernelFunc:Ice};var xy=class{constructor(t){this.variableNames=["Image","Transforms"],this.uniforms="interpolationModeId : i32, fillModeId : i32, fillValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=t,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="transform"}getUserCode(){return` + `}};function pc(r,e){e!==null&&r.disposeData(e.dataId)}function u4(r){let e=1;for(;ef===null?[c,c]:[c,f],g=(k,T,E)=>{let R=h(),D=new Ey(E),O=[{type:"int32",data:[p]},{type:"int32",data:[f===null?1:0]},{type:"float32",data:[Number.NEGATIVE_INFINITY]},{type:"int32",data:[k]},{type:"int32",data:[T]}],M=f;f=t.runWebGPUProgram(D,R,"int32",O),pc(t,M)};for(let k=1;k=1;E/=2)g(T,E,[l,d])}for(let k=d;k>m;k/=2){let T=h(),E=new $y([l,k/2]),D=[{type:"int32",data:[p]},{type:"int32",data:[f===null?1:0]},{type:"int32",data:[m]}],F=f;f=t.runWebGPUProgram(E,T,"int32",D),pc(t,F);let O=m/2,M=O*2;for(let L=O;L>=1;L/=2)g(M,L,f.shape)}let x=f;f=ea({inputs:{x:f},backend:t,attrs:{begin:0,size:[l,s]}}),pc(t,x);let b=Xv({inputs:{x:c,indices:f},backend:t,attrs:{axis:1,batchDims:1}});pc(t,c);let w=i.slice(0,-1);w.push(s),x=f,f=le({inputs:{x:f},attrs:{shape:w},backend:t}),pc(t,x);let S=b;return b=le({inputs:{x:b},attrs:{shape:w},backend:t}),pc(t,S),[b,f]}var p4={kernelName:Bs,backendName:"webgpu",kernelFunc:ame};var Ry=class{constructor(e){this.variableNames=["Image","Transforms"],this.uniforms="interpolationModeId : i32, fillModeId : i32, fillValue : f32,",this.workgroupSize=[64,1,1],this.size=!0,this.outputShape=e,this.dispatchLayout=X(this.outputShape),this.dispatch=H(this.dispatchLayout,this.outputShape,this.workgroupSize),this.shaderKey="transform"}getUserCode(){return` fn mapCoord(outCoord : f32, len : f32) -> f32{ var inCoord = outCoord; if(uniforms.fillModeId == 2) { @@ -8506,7 +8506,7 @@ return a / b;`,Wee=` setOutputAtIndex(index, outputValue); } } - `}};function vce(r){let{inputs:t,backend:e,attrs:o}=r,{image:n,transforms:s}=t,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[c,l,m,d]=n.shape,[f,h]=u!=null?u:[l,m],g=[c,f,h,d],x=new xy(g),b=a==="nearest"?1:2,C;switch(i){case"constant":C=1;break;case"reflect":C=2;break;case"wrap":C=3;break;case"nearest":C=4;break;default:C=1;break}let S=[{type:"int32",data:[b]},{type:"int32",data:[C]},{type:"float32",data:[p]}];return e.runWebGPUProgram(x,[n,s],"float32",S)}var BU={kernelName:Rs,backendName:"webgpu",kernelFunc:vce};function kce(r){let{inputs:t,backend:e,attrs:o}=r,{value:n}=t,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),c=0;for(let h=0;he.disposeData(h.dataId)),f}var zU={kernelName:wa,backendName:"webgpu",kernelFunc:kce};var yy=class{constructor(t,e,o){if(this.outputShape=[],this.variableNames=["x","segmentIds"],this.uniforms="numSegments : i32, xSize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=e,this.dispatchLayout=X(t),this.dispatch=H(this.dispatchLayout,t,this.workgroupSize),o!=="float32"&&o!=="int32")throw new Error(`UnsortedSegmentSum only supports float32 and int32 + `}};function ime(r){let{inputs:e,backend:t,attrs:o}=r,{image:n,transforms:s}=e,{interpolation:a,fillMode:i,fillValue:p,outputShape:u}=o,[l,c,m,d]=n.shape,[f,h]=u!=null?u:[c,m],g=[l,f,h,d],x=new Ry(g),b=a==="nearest"?1:2,w;switch(i){case"constant":w=1;break;case"reflect":w=2;break;case"wrap":w=3;break;case"nearest":w=4;break;default:w=1;break}let S=[{type:"int32",data:[b]},{type:"int32",data:[w]},{type:"float32",data:[p]}];return t.runWebGPUProgram(x,[n,s],"float32",S)}var l4={kernelName:zs,backendName:"webgpu",kernelFunc:ime};function ume(r){let{inputs:e,backend:t,attrs:o}=r,{value:n}=e,{axis:s}=o;s<0&&(s+=n.shape.length);let a=n,i=a.shape.length,p=n.shape[s],u=new Array(i-1),l=0;for(let h=0;ht.disposeData(h.dataId)),f}var c4={kernelName:Ta,backendName:"webgpu",kernelFunc:ume};var Dy=class{constructor(e,t,o){if(this.outputShape=[],this.variableNames=["x","segmentIds"],this.uniforms="numSegments : i32, xSize: i32,",this.workgroupSize=[64,1,1],this.atomic=!0,this.outputShape=t,this.dispatchLayout=X(e),this.dispatch=H(this.dispatchLayout,e,this.workgroupSize),o!=="float32"&&o!=="int32")throw new Error(`UnsortedSegmentSum only supports float32 and int32 types, does not support ${o} type.`);this.type=o,this.shaderKey="unsortedSegmentSum"}getUserCode(){return` ${G("index")} { if (index < uniforms.xSize) { @@ -8519,8 +8519,8 @@ return a / b;`,Wee=` let flatIndex = b * uniforms.numSegments + segmentId % uniforms.numSegments; let value = getX(b, inCol); - ${Yr("&result[flatIndex]","value",this.type)} + ${oo("&result[flatIndex]","value",this.type)} } } } - `}};function Nce(r){let{inputs:t,backend:e,attrs:o}=r,{x:n,segmentIds:s}=t,{numSegments:a}=o,i=n.shape.length,p=[],u=0,c=w.getAxesPermutation([u],i),l=n;c!=null&&(l=xr({inputs:{x:n},backend:e,attrs:{perm:c}}),p.push(l),u=w.getInnerMostAxes(1,i)[0]);let m=w.segment_util.computeOutShape(l.shape,u,a),d=y.sizeFromShape([l.shape[u]]),f=pe({inputs:{x:l},backend:e,attrs:{shape:[-1,d]}});p.push(f);let h=n.dtype,g=[f.shape[0],a],x=vt({backend:e,attrs:{shape:g,value:0,dtype:h}}),b=new yy(f.shape,g,h),C=[{type:"int32",data:[a]},{type:"int32",data:[y.sizeFromShape(f.shape)]}],S=e.runWebGPUProgram(b,[f,s],h,C,x),k=pe({inputs:{x:S},backend:e,attrs:{shape:m}});p.push(S);let _=k;if(c!=null){p.push(k);let E=w.getUndoAxesPermutation(c);_=xr({inputs:{x:_},backend:e,attrs:{perm:E}})}return p.forEach(E=>e.disposeData(E.dataId)),_}var VU={kernelName:Yi,backendName:"webgpu",kernelFunc:Nce};var Tce=[oz,zz,Vz,Wz,Uz,Gz,Kz,qz,jz,Xz,Yz,Qz,Zz,Jz,eV,oV,nV,sV,aV,iV,pV,cV,lV,hV,gV,xV,sz,bV,wV,SV,IV,vV,kV,NV,TV,_V,$V,EV,AV,FV,PV,OV,LV,BV,MV,zV,VV,WV,UV,GV,qV,jV,XV,YV,QV,ZV,JV,eW,tW,tz,rW,sW,oW,nW,aW,iW,uW,pW,cW,lW,mW,nz,dW,CV,fW,hW,gW,xW,yW,bW,CW,SW,wW,IW,vW,kW,TW,_W,tV,$W,EW,AW,RW,DW,FW,rV,PW,OW,MW,LW,zW,HV,VW,WW,UW,mV,GW,qW,jW,XW,YW,QW,ZW,JW,dV,eU,tU,rU,oU,rz,nU,sU,aU,iU,uU,pU,cU,lU,mU,dU,fU,hU,gU,xU,yU,bU,uV,EU,RU,DU,BW,CU,wU,SU,IU,kU,NU,TU,_U,$U,AU,KV,FU,PU,OU,vU,LU,BU,Hz,zU,VU,HW];for(let r of Tce)ti(r);var WU="4.14.0",_ce="4.14.0",$ce="4.14.0",Ece="4.14.0",Rce="4.14.0",Dce="4.14.0",Ace={tfjs:WU,"tfjs-core":WU,"tfjs-converter":_ce,"tfjs-backend-cpu":$ce,"tfjs-backend-webgl":Ece,"tfjs-backend-wasm":Rce,"tfjs-backend-webgpu":Dce};var bQt=void 0;export{Xs as Abs,Vo as Acos,Wo as Acosh,Qu as AdadeltaOptimizer,Zu as AdagradOptimizer,Ju as AdamOptimizer,ep as AdamaxOptimizer,io as Add,Uo as AddN,Go as All,Ho as Any,Ys as ArgMax,Qs as ArgMin,Ko as Asin,qo as Asinh,jo as Atan,Yo as Atan2,Xo as Atanh,Qo as AvgPool,Zs as AvgPool3D,Ei as AvgPool3DGrad,$i as AvgPoolGrad,im as BackendWasm,Zo as BatchMatMul,Js as BatchToSpaceND,Jo as Bincount,qa as BitwiseAnd,ea as BroadcastArgs,Bce as BroadcastTo,yo as Cast,en as Ceil,bo as ClipByValue,Ri as Complex,Di as ComplexAbs,ta as Concat,tn as Conv2D,Ai as Conv2DBackpropFilter,rn as Conv2DBackpropInput,on as Conv3D,ja as Conv3DBackpropFilterV2,nn as Conv3DBackpropInputV2,sn as Cos,an as Cosh,cn as CropAndResize,un as Cumprod,pn as Cumsum,Bo as DataStorage,ra as DenseBincount,ln as DepthToSpace,mn as DepthwiseConv2dNative,Fi as DepthwiseConv2dNativeBackpropFilter,Pi as DepthwiseConv2dNativeBackpropInput,oa as Diag,dn as Dilation2D,Mi as Dilation2DBackpropFilter,Oi as Dilation2DBackpropInput,_u as Draw,ow as ENV,Li as Einsum,hn as Elu,Xa as EluGrad,ll as Environment,xn as Equal,gn as Erf,yn as Exp,na as ExpandDims,bn as Expm1,Bi as FFT,sa as Fill,Cn as FlipLeftRight,wn as Floor,Sn as FloorDiv,Eu as FromPixels,In as FusedBatchNorm,Io as FusedConv2D,vo as FusedDepthwiseConv2D,xp as GPGPUContext,vn as GatherNd,aa as GatherV2,Ml as GraphModel,kn as Greater,Nn as GreaterEqual,zi as IFFT,Co as Identity,Vi as Imag,Tn as IsFinite,_n as IsInf,$n as IsNan,so as KernelBackend,Bn as LRN,Ya as LRNGrad,En as LeakyRelu,Rn as Less,Dn as LessEqual,An as LinSpace,Fn as Log,Pn as Log1p,zce as LogSoftmax,On as LogicalAnd,Mn as LogicalNot,Ln as LogicalOr,E0 as LogicalXor,Vce as LowerBound,hc as MathBackendCPU,Oc as MathBackendWebGL,Wce as MatrixBandPart,zn as Max,Wn as MaxPool,ia as MaxPool3D,Ui as MaxPool3DGrad,Wi as MaxPoolGrad,ua as MaxPoolWithArgmax,Vn as Maximum,Un as Mean,Gn as Min,Hn as Minimum,Kn as MirrorPad,qn as Mod,tp as MomentumOptimizer,jn as Multinomial,Xn as Multiply,pa as Neg,Qn as NonMaxSuppressionV3,Qa as NonMaxSuppressionV4,Zn as NonMaxSuppressionV5,Yn as NotEqual,kw as OP_SCOPE_SUFFIX,Jn as OneHot,ca as OnesLike,kr as Optimizer,Dl as OptimizerConstructors,la as Pack,es as PadV2,Uce as Pool,ts as Pow,rs as Prelu,os as Prod,rp as RMSPropOptimizer,Up as RaggedGather,Gp as RaggedRange,Hp as RaggedTensorToTensor,ma as Range,hw as Rank,Gi as Real,fn as RealDiv,ns as Reciprocal,Et as Reduction,ss as Relu,us as Relu6,da as Reshape,is as ResizeBilinear,Ja as ResizeBilinearGrad,as as ResizeNearestNeighbor,Za as ResizeNearestNeighborGrad,ps as Reverse,Ds as RotateWithOffset,cs as Round,ls as Rsqrt,li as SGDOptimizer,ms as ScatterNd,fs as SearchSorted,fa as Select,hs as Selu,bs as Sigmoid,ys as Sign,gs as Sin,xs as Sinh,ha as Slice,Is as Softmax,Cs as Softplus,ga as SpaceToBatchND,Hi as SparseFillEmptyRows,ei as SparseReshape,ya as SparseSegmentMean,ba as SparseSegmentSum,vs as SparseToDense,xa as SplitV,ws as Sqrt,Ki as Square,ks as SquaredDifference,$u as StaticRegexReplace,wo as Step,Ns as StridedSlice,Ca as StringNGrams,qi as StringSplit,ji as StringToHashBucketFast,Ts as Sub,Ss as Sum,_s as Tan,$s as Tanh,mt as Tensor,tt as TensorBuffer,ds as TensorScatterUpdate,uo as Tile,Es as TopK,Rs as Transform,po as Transpose,Xi as Unique,wa as Unpack,Yi as UnsortedSegmentSum,Gce as UpperBound,ri as Variable,Kc as WebGPUBackend,Sa as ZerosLike,So as _FusedMatMul,Qt as abs,Nk as acos,Tk as acosh,Ce as add,_k as addN,$k as all,Ek as any,Rk as argMax,Dk as argMin,Ak as asin,Fk as asinh,Pk as atan,Ok as atan2,Mk as atanh,md as avgPool,zk as avgPool3d,vde as backend,w as backend_util,Vk as basicLSTMCell,ru as batchNorm,Uk as batchNorm2d,Gk as batchNorm3d,Hk as batchNorm4d,dd as batchToSpaceND,fd as bincount,Kk as bitwiseAnd,E6 as booleanMaskAsync,qk as broadcastArgs,ou as broadcastTo,Sr as broadcast_util,nT as browser,me as buffer,We as cast,jk as ceil,Xk as clipByValue,Wr as clone,$r as complex,yt as concat,Yk as concat1d,Qk as concat2d,Zk as concat3d,Jk as concat4d,e2 as conv1d,nu as conv2d,t2 as conv2dTranspose,r2 as conv3d,n2 as conv3dTranspose,Zce as copyRegisteredKernels,s2 as cos,a2 as cosh,_l as cosineWindow,i2 as cumprod,u2 as cumsum,Ir as customGrad,p2 as denseBincount,Pw as deprecationWarn,c2 as depthToSpace,oc as depthwiseConv2d,A5 as deregisterOp,Ji as device_util,l2 as diag,m2 as dilation2d,dde as disableDeprecationWarnings,Ot as dispose,fde as disposeVariables,je as div,f2 as divNoNan,h2 as dot,W6 as dropout,su as einsum,yd as elu,mde as enableDebugMode,lde as enableProdMode,Qw as enclosingPowerOfTwo,ur as engine,g2 as ensureShape,A as env,xd as equal,x2 as erf,C2 as euclideanNorm,_o as exp,Ms as expandDims,w2 as expm1,bd as eye,ac as fft,Ea as fill,Sde as findBackend,Ide as findBackendFactory,Cd as floor,ld as floorDiv,LD as forceHalfFloat,Zw as fused,wd as gather,z6 as gatherND,sf as gather_util,Cde as getBackend,aw as getGradient,qp as getKernel,jm as getKernelsForBackend,Zse as getThreadsCount,lv as gpgpu_util,AK as grad,FK as grads,zu as greater,Sd as greaterEqual,Ku as ifft,iu as imag,Kj as image,G6 as inTopKAsync,mi as io,Gd as irfft,S2 as isFinite,I2 as isInf,v2 as isNaN,Er as keep,Vt as kernel_impls,Id as leakyRelu,kl as less,nc as lessEqual,qj as linalg,k2 as linspace,$8 as loadGraphModel,E8 as loadGraphModelSync,N2 as localResponseNormalization,ui as log,vd as log1p,T2 as logSigmoid,_2 as logSoftmax,Td as logSumExp,Vu as logicalAnd,_d as logicalNot,$d as logicalOr,$2 as logicalXor,jj as losses,E2 as lowerBound,Ze as matMul,eT as math,Ra as max,Rd as maxPool,R2 as maxPool3d,D2 as maxPoolWithArgmax,Dd as maximum,Wu as mean,hde as memory,A2 as meshgrid,vl as min,Uu as minimum,F2 as mirrorPad,P2 as mod,O2 as moments,A6 as movingAverage,se as mul,M2 as multiRNNCell,L2 as multinomial,pr as neg,pS as nextFrame,bQt as node,Bu as norm,Ad as notEqual,Tl as oneHot,Da as ones,B2 as onesLike,N as op,z2 as outerProduct,Aa as pad,V2 as pad1d,W2 as pad2d,U2 as pad3d,G2 as pad4d,H2 as pool,ii as pow,Pd as prelu,cd as print,K2 as prod,gde as profile,q2 as raggedGather,j2 as raggedRange,X2 as raggedTensorToTensor,Y2 as rand,x1 as randomGamma,Vd as randomNormal,y1 as randomStandardNormal,sc as randomUniform,b1 as randomUniformInt,uu as range,bde as ready,pi as real,C1 as reciprocal,tu as registerBackend,Xce as registerGradient,ti as registerKernel,D5 as registerOp,pu as relu,Wd as relu6,wde as removeBackend,W as reshape,lo as reverse,w1 as reverse1d,S1 as reverse2d,I1 as reverse3d,v1 as reverse4d,ic as rfft,Ud as round,k1 as rsqrt,ke as scalar,P6 as scatterND,lu as scatter_util,Nl as searchSorted,N1 as selu,T1 as separableConv2d,UN as serialization,yde as setBackend,kde as setPlatform,Qse as setThreadsCount,Xse as setWasmPath,Yse as setWasmPaths,kI as setWebGLContext,_1 as setdiff1dAsync,wc as shared,$a as sigmoid,$1 as sign,Hj as signal,E1 as sin,R1 as sinh,Xe as slice,D1 as slice1d,A1 as slice2d,F1 as slice3d,P1 as slice4d,pt as slice_util,O1 as softmax,Nd as softplus,Fd as spaceToBatchND,Xj as sparse,L6 as sparseToDense,Gj as spectral,ci as split,Rr as sqrt,Zt as square,Hd as squaredDifference,uc as squeeze,vr as stack,Kd as step,M1 as stridedSlice,Yj as string,Te as sub,ot as sum,oi as sumOutType,L1 as tan,Il as tanh,ar as tensor,Jt as tensor1d,cu as tensor2d,qd as tensor3d,B1 as tensor4d,z1 as tensor5d,V1 as tensor6d,U1 as tensorScatterUpdate,tk as tensor_util,g1 as test_util,De as tidy,au as tile,xde as time,G1 as topk,TGe as train,cc as transpose,H1 as truncatedNormal,K1 as unique,Qce as unregisterGradient,Yce as unregisterKernel,q1 as unsortedSegmentSum,mo as unstack,dt as upcastType,j1 as upperBound,y as util,PK as valueAndGrad,OK as valueAndGrads,X1 as variable,zw as variableGrads,Ace as version,D8 as version_converter,_X as version_core,cY as version_cpu,Jse as version_wasm,s9 as version_webgl,Cat as webgl,Tc as webgl_util,Qv as webgpu_util,co as where,Xd as whereAsync,Ur as zeros,Gt as zerosLike}; + `}};function pme(r){let{inputs:e,backend:t,attrs:o}=r,{x:n,segmentIds:s}=e,{numSegments:a}=o,i=n.shape.length,p=[],u=0,l=C.getAxesPermutation([u],i),c=n;l!=null&&(c=Cr({inputs:{x:n},backend:t,attrs:{perm:l}}),p.push(c),u=C.getInnerMostAxes(1,i)[0]);let m=C.segment_util.computeOutShape(c.shape,u,a),d=y.sizeFromShape([c.shape[u]]),f=le({inputs:{x:c},backend:t,attrs:{shape:[-1,d]}});p.push(f);let h=n.dtype,g=[f.shape[0],a],x=Nt({backend:t,attrs:{shape:g,value:0,dtype:h}}),b=new Dy(f.shape,g,h),w=[{type:"int32",data:[a]},{type:"int32",data:[y.sizeFromShape(f.shape)]}],S=t.runWebGPUProgram(b,[f,s],h,w,x),k=le({inputs:{x:S},backend:t,attrs:{shape:m}});p.push(S);let T=k;if(l!=null){p.push(k);let E=C.getUndoAxesPermutation(l);T=Cr({inputs:{x:T},backend:t,attrs:{perm:E}})}return p.forEach(E=>t.disposeData(E.dataId)),T}var m4={kernelName:su,backendName:"webgpu",kernelFunc:pme};var lme=[jz,cW,mW,dW,fW,hW,xW,yW,bW,CW,wW,SW,IW,vW,kW,_W,EW,$W,RW,DW,FW,PW,OW,zW,VW,WW,Yz,GW,KW,qW,jW,XW,YW,QW,ZW,JW,eU,tU,nU,sU,aU,iU,pU,lU,uU,cU,mU,dU,fU,hU,yU,bU,CU,wU,SU,IU,vU,kU,NU,Kz,TU,$U,_U,EU,RU,DU,AU,FU,PU,OU,MU,Xz,LU,HW,BU,zU,VU,WU,UU,GU,HU,qU,KU,jU,XU,YU,ZU,JU,NW,eG,tG,nG,rG,oG,sG,TW,aG,iG,uG,pG,cG,gU,mG,dG,fG,MW,hG,yG,bG,CG,wG,SG,IG,vG,LW,kG,NG,TG,_G,qz,EG,$G,RG,DG,AG,FG,PG,OG,MG,LG,BG,zG,VG,WG,UG,GG,AW,t4,r4,o4,lG,HG,KG,qG,jG,YG,QG,ZG,JG,e4,n4,xU,s4,a4,i4,XG,p4,l4,gW,c4,m4,gG];for(let r of lme)li(r);var d4="4.17.0",cme="4.17.0",mme="4.17.0",dme="4.17.0",fme="4.17.0",hme="4.14.0",gme={tfjs:d4,"tfjs-core":d4,"tfjs-converter":cme,"tfjs-backend-cpu":mme,"tfjs-backend-webgl":dme,"tfjs-backend-wasm":fme,"tfjs-backend-webgpu":hme};var qtr=void 0;export{fn as Abs,hn as Acos,gn as Acosh,sp as AdadeltaOptimizer,ap as AdagradOptimizer,ip as AdamOptimizer,up as AdamaxOptimizer,Rr as Add,xn as AddN,yn as All,bn as Any,na as ArgMax,sa as ArgMin,Cn as Asin,wn as Asinh,Sn as Atan,vn as Atan2,In as Atanh,kn as AvgPool,aa as AvgPool3D,Vi as AvgPool3DGrad,zi as AvgPoolGrad,gm as BackendWasm,Nn as BatchMatMul,ia as BatchToSpaceND,Tn as Bincount,_n as BitwiseAnd,ua as BroadcastArgs,Sme as BroadcastTo,ho as Cast,go as Ceil,Go as ClipByValue,ei as Complex,Wi as ComplexAbs,pa as Concat,En as Conv2D,Ui as Conv2DBackpropFilter,$n as Conv2DBackpropInput,Rn as Conv3D,ti as Conv3DBackpropFilterV2,Dn as Conv3DBackpropInputV2,An as Cos,Fn as Cosh,Mn as CropAndResize,Pn as Cumprod,On as Cumsum,mn as DataStorage,la as DenseBincount,Ln as DepthToSpace,Bn as DepthwiseConv2dNative,Gi as DepthwiseConv2dNativeBackpropFilter,Hi as DepthwiseConv2dNativeBackpropInput,ca as Diag,zn as Dilation2D,qi as Dilation2DBackpropFilter,Ki as Dilation2DBackpropInput,Mu as Draw,xw as ENV,ji as Einsum,Wn as Elu,ri as EluGrad,Cc as Environment,xo as Equal,Un as Erf,yo as Exp,ma as ExpandDims,bo as Expm1,Xi as FFT,da as Fill,Gn as FlipLeftRight,Co as Floor,wo as FloorDiv,Lu as FromPixels,Hn as FusedBatchNorm,jo as FusedConv2D,Xo as FusedDepthwiseConv2D,kp as GPGPUContext,Kn as GatherNd,fa as GatherV2,Kc as GraphModel,So as Greater,Io as GreaterEqual,Yi as IFFT,vo as Identity,Qi as Imag,qn as IsFinite,jn as IsInf,Xn as IsNan,mo as KernelBackend,rs as LRN,oi as LRNGrad,Yn as LeakyRelu,ko as Less,No as LessEqual,Qn as LinSpace,To as Log,Zn as Log1p,Ime as LogSoftmax,Jn as LogicalAnd,es as LogicalNot,ts as LogicalOr,gk as LogicalXor,vme as LowerBound,Il as MathBackendCPU,Ul as MathBackendWebGL,kme as MatrixBandPart,os as Max,ns as MaxPool,ha as MaxPool3D,Ji as MaxPool3DGrad,Zi as MaxPoolGrad,ga as MaxPoolWithArgmax,_o as Maximum,ss as Mean,as as Min,Eo as Minimum,is as MirrorPad,us as Mod,pp as MomentumOptimizer,ps as Multinomial,$o as Multiply,ls as Neg,cs as NonMaxSuppressionV3,ni as NonMaxSuppressionV4,ms as NonMaxSuppressionV5,Ro as NotEqual,Bw as OP_SCOPE_SUFFIX,ds as OneHot,xa as OnesLike,_r as Optimizer,Vc as OptimizerConstructors,ya as Pack,fs as PadV2,Nme as Pool,hs as Pow,gs as Prelu,Ho as Prod,lp as RMSPropOptimizer,Qp as RaggedGather,Zp as RaggedRange,Jp as RaggedTensorToTensor,ba as Range,Ew as Rank,si as Real,Vn as RealDiv,xs as Reciprocal,Dt as Reduction,ys as Relu,ws as Relu6,Ca as Reshape,Cs as ResizeBilinear,ii as ResizeBilinearGrad,bs as ResizeNearestNeighbor,ai as ResizeNearestNeighborGrad,Ss as Reverse,Vs as RotateWithOffset,Is as Round,Do as Rsqrt,wi as SGDOptimizer,vs as ScatterNd,Ns as SearchSorted,wa as Select,Ts as Selu,Ao as Sigmoid,Rs as Sign,Es as Sin,$s as Sinh,_s as Slice,Fs as Softmax,Ds as Softplus,Sa as SpaceToBatchND,eu as SparseFillEmptyRows,ui as SparseReshape,va as SparseSegmentMean,ka as SparseSegmentSum,Ps as SparseToDense,Ia as SplitV,Fo as Sqrt,tu as Square,Po as SquaredDifference,pi as StaticRegexReplace,Ko as Step,Os as StridedSlice,Na as StringNGrams,ru as StringSplit,ou as StringToHashBucketFast,Oo as Sub,As as Sum,Ms as Tan,Ls as Tanh,dt as Tensor,Ge as TensorBuffer,ks as TensorScatterUpdate,Mo as Tile,Bs as TopK,zs as Transform,Kr as Transpose,nu as Unique,Ta as Unpack,su as UnsortedSegmentSum,Tme as UpperBound,ci as Variable,Jl as WebGPUBackend,_a as ZerosLike,qo as _FusedMatMul,er as abs,g1 as acos,x1 as acosh,Ce as add,y1 as addN,b1 as all,C1 as any,w1 as argMax,S1 as argMin,I1 as asin,v1 as asinh,k1 as atan,N1 as atan2,T1 as atanh,Id as avgPool,$1 as avgPool3d,Hk as backend,C as backend_util,R1 as basicLSTMCell,mu as batchNorm,A1 as batchNorm2d,F1 as batchNorm3d,P1 as batchNorm4d,vd as batchToSpaceND,kd as bincount,O1 as bitwiseAnd,oX as booleanMaskAsync,M1 as broadcastArgs,Oa as broadcastTo,kr as broadcast_util,XT as browser,ie as buffer,Ue as cast,L1 as ceil,B1 as clipByValue,Xr as clone,Ar as complex,bt as concat,z1 as concat1d,V1 as concat2d,W1 as concat3d,U1 as concat4d,G1 as conv1d,du as conv2d,H1 as conv2dTranspose,K1 as conv3d,j1 as conv3dTranspose,Pme as copyRegisteredKernels,X1 as cos,Y1 as cosh,Mc as cosineWindow,Q1 as cumprod,Z1 as cumsum,Nr as customGrad,J1 as denseBincount,zw as deprecationWarn,e2 as depthToSpace,cl as depthwiseConv2d,aY as deregisterOp,uu as device_util,t2 as diag,r2 as dilation2d,Kde as disableDeprecationWarnings,Lt as dispose,qde as disposeVariables,Xe as div,n2 as divNoNan,s2 as dot,hX as dropout,fu as einsum,Ed as elu,Hde as enableDebugMode,Gde as enableProdMode,cS as enclosingPowerOfTwo,cr as engine,a2 as ensureShape,A as env,_d as equal,i2 as erf,l2 as euclideanNorm,Jo as exp,Ks as expandDims,c2 as expm1,$d as eye,fl as fft,Ma as fill,efe as findBackend,tfe as findBackendFactory,Rd as floor,Sd as floorDiv,EA as forceHalfFloat,mS as fused,Dd as gather,dX as gatherND,xf as gather_util,Gk as getBackend,Cw as getGradient,tl as getKernel,ad as getKernelsForBackend,kie as getThreadsCount,k0 as gpgpu_util,a6 as grad,i6 as grads,ju as greater,Ad as greaterEqual,ep as ifft,gu as imag,b5 as image,xX as inTopKAsync,Si as io,tf as irfft,m2 as isFinite,d2 as isInf,f2 as isNaN,Fr as keep,Ut as kernel_impls,Fd as leakyRelu,Fc as less,ml as lessEqual,C5 as linalg,h2 as linspace,r7 as loadGraphModel,o7 as loadGraphModelSync,g2 as localResponseNormalization,yi as log,Pd as log1p,x2 as logSigmoid,y2 as logSoftmax,Ld as logSumExp,Xu as logicalAnd,Bd as logicalNot,zd as logicalOr,b2 as logicalXor,w5 as losses,C2 as lowerBound,Je as matMul,HT as math,La as max,Wd as maxPool,w2 as maxPool3d,S2 as maxPoolWithArgmax,Ud as maximum,Yu as mean,jde as memory,I2 as meshgrid,Ac as min,Qu as minimum,v2 as mirrorPad,k2 as mod,N2 as moments,aX as movingAverage,se as mul,T2 as multiRNNCell,_2 as multinomial,mr as neg,IS as nextFrame,qtr as node,qu as norm,Gd as notEqual,Oc as oneHot,Ba as ones,E2 as onesLike,N as op,$2 as outerProduct,za as pad,R2 as pad1d,D2 as pad2d,A2 as pad3d,F2 as pad4d,P2 as pool,xi as pow,Kd as prelu,wd as print,O2 as prod,Xde as profile,M2 as raggedGather,L2 as raggedRange,B2 as raggedTensorToTensor,z2 as rand,iN as randomGamma,Zd as randomNormal,uN as randomStandardNormal,dl as randomUniform,pN as randomUniformInt,xu as range,Zde as ready,bi as real,lN as reciprocal,pu as registerBackend,Dme as registerGradient,li as registerKernel,sY as registerOp,yu as relu,Jd as relu6,Jde as removeBackend,W as reshape,Bo as reverse,cN as reverse1d,mN as reverse2d,dN as reverse3d,fN as reverse4d,hl as rfft,ef as round,hN as rsqrt,ke as scalar,uX as scatterND,Cu as scatter_util,Pc as searchSorted,gN as selu,xN as separableConv2d,AT as serialization,Qde as setBackend,rfe as setPlatform,vie as setThreadsCount,Sie as setWasmPath,Iie as setWasmPaths,BI as setWebGLContext,yN as setdiff1dAsync,Xf as shared,Pa as sigmoid,bN as sign,y5 as signal,CN as sin,wN as sinh,Ye as slice,SN as slice1d,IN as slice2d,vN as slice3d,kN as slice4d,nt as slice_util,NN as softmax,Md as softplus,Hd as spaceToBatchND,S5 as sparse,cX as sparseToDense,x5 as spectral,Ci as split,Pr as sqrt,tr as square,rf as squaredDifference,gl as squeeze,Tr as stack,of as step,TN as stridedSlice,I5 as string,Te as sub,ot as sum,mi as sumOutType,_N as tan,Dc as tanh,pr as tensor,rr as tensor1d,bu as tensor2d,nf as tensor3d,EN as tensor4d,$N as tensor5d,RN as tensor6d,AN as tensorScatterUpdate,Vk as tensor_util,aN as test_util,De as tidy,hu as tile,Yde as time,FN as topk,cHe as train,yl as transpose,PN as truncatedNormal,ON as unique,Fme as unregisterGradient,Ame as unregisterKernel,MN as unsortedSegmentSum,zo as unstack,pt as upcastType,LN as upperBound,y as util,u6 as valueAndGrad,p6 as valueAndGrads,BN as variable,eS as variableGrads,gme as version,s7 as version_converter,t8 as version_core,M7 as version_cpu,Nie as version_wasm,DJ as version_webgl,sut as webgl,Fl as webgl_util,cv as webgpu_util,Lo as where,af as whereAsync,Yr as zeros,Kt as zerosLike}; diff --git a/dist/tfjs.version.js b/dist/tfjs.version.js index 15752b1c..302cccfc 100644 --- a/dist/tfjs.version.js +++ b/dist/tfjs.version.js @@ -4,4 +4,4 @@ author: ' */ -var e="4.14.0";var s="4.14.0";var t="4.14.0";var n="4.14.0";var r="4.14.0";var i="4.14.0";var h={tfjs:e,"tfjs-core":e,"tfjs-converter":s,"tfjs-backend-cpu":t,"tfjs-backend-webgl":n,"tfjs-backend-wasm":r,"tfjs-backend-webgpu":i};export{h as version}; +var e="4.17.0";var s="4.17.0";var t="4.17.0";var n="4.17.0";var r="4.17.0";var i="4.14.0";var h={tfjs:e,"tfjs-core":e,"tfjs-converter":s,"tfjs-backend-cpu":t,"tfjs-backend-webgl":n,"tfjs-backend-wasm":r,"tfjs-backend-webgpu":i};export{h as version}; diff --git a/src/config.ts b/src/config.ts index 5abce82c..c91f767c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -37,6 +37,8 @@ export interface FaceDetectorConfig extends GenericConfig { minSize: number, /** minimum overlap between two detected faces before one is discarded */ iouThreshold: number, + /** how much should face box be enlarged over the min/max facial coordinates */ + scale: number, /** should child models perform on masked image of a face */ mask: boolean, /** should face detection return processed and cropped face tensor that can with an external model for addtional processing? @@ -51,7 +53,10 @@ export interface FaceMeshConfig extends GenericConfig { } /** Iris part of face configuration */ -export interface FaceIrisConfig extends GenericConfig {} +export interface FaceIrisConfig extends GenericConfig { + /** how much should iris box be enlarged over the min/max iris coordinates */ + scale: number, +} /** Attention part of face configuration */ export interface FaceAttentionConfig extends GenericConfig {} @@ -383,6 +388,7 @@ const config: Config = { minConfidence: 0.2, minSize: 0, iouThreshold: 0.1, + scale: 1.4, mask: false, return: false, }, @@ -397,6 +403,7 @@ const config: Config = { }, iris: { enabled: true, + scale: 2.3, modelPath: 'iris.json', }, emotion: { diff --git a/src/face/blazeface.ts b/src/face/blazeface.ts index d597d9d4..e957237c 100644 --- a/src/face/blazeface.ts +++ b/src/face/blazeface.ts @@ -14,7 +14,6 @@ import { env } from '../util/env'; import type { Point } from '../result'; const keypointsCount = 6; -const faceBoxScaleFactor = 1.4; let model: GraphModel | null; let anchors: Tensor | null = null; let inputSize = 0; @@ -99,7 +98,7 @@ export async function getBoxes(inputImage: Tensor4D, config: Config): Promise (config.face.detector?.['minSize'] || 0) && squaredBox.size[1] > (config.face.detector?.['minSize'] || 0)) boxes.push(squaredBox); Object.keys(b).forEach((tensor) => tf.dispose(b[tensor])); diff --git a/src/face/faceboxes.ts b/src/face/faceboxes.ts index 6d42f9f5..e29d6fbe 100644 --- a/src/face/faceboxes.ts +++ b/src/face/faceboxes.ts @@ -9,13 +9,11 @@ import type { Config } from '../config'; type Box = [number, number, number, number]; export class FaceBoxes { - enlarge: number; model: GraphModel; config: Config; inputSize: 0; constructor(model, config: Config) { - this.enlarge = 1.1; this.model = model; this.config = config; this.inputSize = model.inputs[0].shape ? model.inputs[0].shape[2] : 0; @@ -23,6 +21,7 @@ export class FaceBoxes { async estimateFaces(input, config) { if (config) this.config = config; + const enlarge = this.config.face.detector?.minConfidence || 0.1; const results: { confidence: number, box: Box, boxRaw: Box, image: Tensor }[] = []; const resizeT = tf.image.resizeBilinear(input, [this.inputSize, this.inputSize]); const castT = resizeT.toInt(); @@ -38,7 +37,7 @@ export class FaceBoxes { resizeT.dispose(); for (let i = 0; i < boxes.length; i++) { if (scores[i] && scores[i] > (this.config.face.detector?.minConfidence || 0.1)) { - const crop = [boxes[i][0] / this.enlarge, boxes[i][1] / this.enlarge, boxes[i][2] * this.enlarge, boxes[i][3] * this.enlarge]; + const crop = [boxes[i][0] / enlarge, boxes[i][1] / enlarge, boxes[i][2] * enlarge, boxes[i][3] * enlarge]; const boxRaw: Box = [crop[1], crop[0], (crop[3]) - (crop[1]), (crop[2]) - (crop[0])]; const box: Box = [ parseInt((boxRaw[0] * input.shape[2]).toString()), diff --git a/src/face/facemesh.ts b/src/face/facemesh.ts index f02cdae2..ee684dad 100644 --- a/src/face/facemesh.ts +++ b/src/face/facemesh.ts @@ -114,7 +114,7 @@ export async function predict(input: Tensor4D, config: Config): Promise [pt[0] / (input.shape[2] || 0), pt[1] / (input.shape[1] || 0), (pt[2] || 0) / size]); diff --git a/src/face/iris.ts b/src/face/iris.ts index d2117d81..181175cc 100644 --- a/src/face/iris.ts +++ b/src/face/iris.ts @@ -11,8 +11,6 @@ import type { Point } from '../result'; let model: GraphModel | null; let inputSize = 0; -const irisEnlarge = 2.3; - const leftOutline = coords.meshAnnotations.leftEyeLower0; const rightOutline = coords.meshAnnotations.rightEyeLower0; @@ -62,8 +60,8 @@ export const getLeftToRightEyeDepthDifference = (rawCoords) => { }; // Returns a box describing a cropped region around the eye fit for passing to the iris model. -export const getEyeBox = (rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, meshSize, flip = false) => { - const box = util.squarifyBox(util.enlargeBox(util.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), irisEnlarge)); +export const getEyeBox = (rawCoords, face, eyeInnerCornerIndex, eyeOuterCornerIndex, meshSize, flip = false, scale = 2.3) => { + const box = util.squarifyBox(util.enlargeBox(util.calculateLandmarksBoundingBox([rawCoords[eyeInnerCornerIndex], rawCoords[eyeOuterCornerIndex]]), scale)); const boxSize = util.getBoxSize(box); let crop = tf.image.cropAndResize(face, [[ box.startPoint[1] / meshSize, @@ -110,10 +108,10 @@ export const getAdjustedIrisCoords = (rawCoords, irisCoords, direction) => { }); }; -export async function augmentIris(rawCoords, face, meshSize) { +export async function augmentIris(rawCoords, face, meshSize, config: Config) { if (!model?.['executor']) return rawCoords; - const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], meshSize, true); - const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], meshSize, true); + const { box: leftEyeBox, boxSize: leftEyeBoxSize, crop: leftEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.leftBounds[0], eyeLandmarks.leftBounds[1], meshSize, true, config.face.iris?.scale || 2.3); + const { box: rightEyeBox, boxSize: rightEyeBoxSize, crop: rightEyeCrop } = getEyeBox(rawCoords, face, eyeLandmarks.rightBounds[0], eyeLandmarks.rightBounds[1], meshSize, true, config.face.iris?.scale || 2.3); const combined = tf.concat([leftEyeCrop, rightEyeCrop]); tf.dispose(leftEyeCrop); tf.dispose(rightEyeCrop); diff --git a/test/build.log b/test/build.log index c7d87fcf..d1077ffd 100644 --- a/test/build.log +++ b/test/build.log @@ -1,51 +1,51 @@ -2023-12-06 14:57:40 DATA:  Build {"name":"@vladmandic/human","version":"3.2.0"} -2023-12-06 14:57:40 INFO:  Application: {"name":"@vladmandic/human","version":"3.2.0"} -2023-12-06 14:57:40 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true} -2023-12-06 14:57:40 INFO:  Toolchain: {"build":"0.9.2","esbuild":"0.19.8","typescript":"5.3.3","typedoc":"0.25.4","eslint":"8.55.0"} -2023-12-06 14:57:40 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]} -2023-12-06 14:57:40 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]} -2023-12-06 14:57:40 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1289,"outputBytes":358} -2023-12-06 14:57:40 STATE: Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":566,"outputBytes":957} -2023-12-06 14:57:40 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":80,"inputBytes":676002,"outputBytes":320790} -2023-12-06 14:57:40 STATE: Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":574,"outputBytes":965} -2023-12-06 14:57:40 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":80,"inputBytes":676010,"outputBytes":320794} -2023-12-06 14:57:40 STATE: Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":662,"outputBytes":2003} -2023-12-06 14:57:40 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":80,"inputBytes":677048,"outputBytes":320905} -2023-12-06 14:57:40 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1403,"outputBytes":690} -2023-12-06 14:57:40 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":80,"inputBytes":675735,"outputBytes":319371} -2023-12-06 14:57:40 STATE: Compile: {"name":"tfjs/browser/esm/bundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":10,"inputBytes":1403,"outputBytes":1265002} -2023-12-06 14:57:40 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":80,"inputBytes":1940047,"outputBytes":1580115} -2023-12-06 14:57:40 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":80,"inputBytes":1940047,"outputBytes":2069972} -2023-12-06 14:57:42 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":14} -2023-12-06 14:57:44 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":81,"generated":true} -2023-12-06 14:57:44 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6318,"outputBytes":2970} -2023-12-06 14:57:44 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":17499,"outputBytes":9399} -2023-12-06 14:57:44 STATE: Compile: {"name":"demo/tracker","format":"esm","platform":"browser","input":"demo/tracker/index.ts","output":"demo/tracker/index.js","files":2,"inputBytes":54375,"outputBytes":22791} -2023-12-06 14:57:51 STATE: Lint: {"locations":["**/*.json","src/**/*.ts","test/**/*.js","demo/**/*.js","**/*.md"],"files":172,"errors":0,"warnings":0} -2023-12-06 14:57:51 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"} -2023-12-06 14:57:51 STATE: Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs-core.d.ts","output":"types/tfjs-core.d.ts"} -2023-12-06 14:57:51 INFO:  Done... -2023-12-06 14:57:51 STATE: Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs.d.ts","output":"types/tfjs.esm.d.ts"} -2023-12-06 14:57:51 STATE: Copy: {"input":"src/types/tsconfig.json","output":"types/tsconfig.json"} -2023-12-06 14:57:51 STATE: Copy: {"input":"src/types/eslint.json","output":"types/.eslintrc.json"} -2023-12-06 14:57:51 STATE: Copy: {"input":"src/types/tfjs.esm.d.ts","output":"dist/tfjs.esm.d.ts"} -2023-12-06 14:57:51 STATE: Filter: {"input":"types/tfjs-core.d.ts"} -2023-12-06 14:57:52 ERROR: API-Extractor: {} -2023-12-06 14:57:52 STATE: Filter: {"input":"types/human.d.ts"} -2023-12-06 14:57:52 STATE: Write: {"output":"dist/human.esm-nobundle.d.ts"} -2023-12-06 14:57:52 STATE: Write: {"output":"dist/human.esm.d.ts"} -2023-12-06 14:57:52 STATE: Write: {"output":"dist/human.d.ts"} -2023-12-06 14:57:52 STATE: Write: {"output":"dist/human.node-gpu.d.ts"} -2023-12-06 14:57:52 STATE: Write: {"output":"dist/human.node.d.ts"} -2023-12-06 14:57:52 STATE: Write: {"output":"dist/human.node-wasm.d.ts"} -2023-12-06 14:57:52 INFO:  Analyze models: {"folders":8,"result":"models/models.json"} -2023-12-06 14:57:52 STATE: Models {"folder":"./models","models":12} -2023-12-06 14:57:52 STATE: Models {"folder":"../human-models/models","models":44} -2023-12-06 14:57:52 STATE: Models {"folder":"../blazepose/model/","models":4} -2023-12-06 14:57:52 STATE: Models {"folder":"../anti-spoofing/model","models":1} -2023-12-06 14:57:52 STATE: Models {"folder":"../efficientpose/models","models":3} -2023-12-06 14:57:52 STATE: Models {"folder":"../insightface/models","models":5} -2023-12-06 14:57:52 STATE: Models {"folder":"../movenet/models","models":3} -2023-12-06 14:57:52 STATE: Models {"folder":"../nanodet/models","models":4} -2023-12-06 14:57:52 STATE: Models: {"count":58,"totalSize":380063249} -2023-12-06 14:57:52 INFO:  Human Build complete... {"logFile":"test/build.log"} +2024-02-15 12:49:25 DATA:  Build {"name":"@vladmandic/human","version":"3.2.1"} +2024-02-15 12:49:25 INFO:  Application: {"name":"@vladmandic/human","version":"3.2.1"} +2024-02-15 12:49:25 INFO:  Environment: {"profile":"production","config":".build.json","package":"package.json","tsconfig":true,"eslintrc":true,"git":true} +2024-02-15 12:49:25 INFO:  Toolchain: {"build":"0.9.2","esbuild":"0.19.12","typescript":"5.3.3","typedoc":"0.25.4","eslint":"8.55.0"} +2024-02-15 12:49:25 INFO:  Build: {"profile":"production","steps":["clean","compile","typings","typedoc","lint","changelog"]} +2024-02-15 12:49:25 STATE: Clean: {"locations":["dist/*","types/*","typedoc/*"]} +2024-02-15 12:49:25 STATE: Compile: {"name":"tfjs/browser/version","format":"esm","platform":"browser","input":"tfjs/tf-version.ts","output":"dist/tfjs.version.js","files":1,"inputBytes":1289,"outputBytes":358} +2024-02-15 12:49:25 STATE: Compile: {"name":"tfjs/nodejs/cpu","format":"cjs","platform":"node","input":"tfjs/tf-node.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":566,"outputBytes":957} +2024-02-15 12:49:25 STATE: Compile: {"name":"human/nodejs/cpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node.js","files":80,"inputBytes":676266,"outputBytes":320934} +2024-02-15 12:49:25 STATE: Compile: {"name":"tfjs/nodejs/gpu","format":"cjs","platform":"node","input":"tfjs/tf-node-gpu.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":574,"outputBytes":965} +2024-02-15 12:49:25 STATE: Compile: {"name":"human/nodejs/gpu","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-gpu.js","files":80,"inputBytes":676274,"outputBytes":320938} +2024-02-15 12:49:25 STATE: Compile: {"name":"tfjs/nodejs/wasm","format":"cjs","platform":"node","input":"tfjs/tf-node-wasm.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":662,"outputBytes":2003} +2024-02-15 12:49:25 STATE: Compile: {"name":"human/nodejs/wasm","format":"cjs","platform":"node","input":"src/human.ts","output":"dist/human.node-wasm.js","files":80,"inputBytes":677312,"outputBytes":321049} +2024-02-15 12:49:25 STATE: Compile: {"name":"tfjs/browser/esm/nobundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":2,"inputBytes":1403,"outputBytes":690} +2024-02-15 12:49:25 STATE: Compile: {"name":"human/browser/esm/nobundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm-nobundle.js","files":80,"inputBytes":675999,"outputBytes":319515} +2024-02-15 12:49:25 STATE: Compile: {"name":"tfjs/browser/esm/bundle","format":"esm","platform":"browser","input":"tfjs/tf-browser.ts","output":"dist/tfjs.esm.js","files":10,"inputBytes":1403,"outputBytes":1294474} +2024-02-15 12:49:25 STATE: Compile: {"name":"human/browser/iife/bundle","format":"iife","platform":"browser","input":"src/human.ts","output":"dist/human.js","files":80,"inputBytes":1969783,"outputBytes":1609692} +2024-02-15 12:49:25 STATE: Compile: {"name":"human/browser/esm/bundle","format":"esm","platform":"browser","input":"src/human.ts","output":"dist/human.esm.js","files":80,"inputBytes":1969783,"outputBytes":2120081} +2024-02-15 12:49:26 STATE: Typings: {"input":"src/human.ts","output":"types/lib","files":14} +2024-02-15 12:49:28 STATE: TypeDoc: {"input":"src/human.ts","output":"typedoc","objects":81,"generated":true} +2024-02-15 12:49:28 STATE: Compile: {"name":"demo/typescript","format":"esm","platform":"browser","input":"demo/typescript/index.ts","output":"demo/typescript/index.js","files":1,"inputBytes":6318,"outputBytes":2970} +2024-02-15 12:49:28 STATE: Compile: {"name":"demo/faceid","format":"esm","platform":"browser","input":"demo/faceid/index.ts","output":"demo/faceid/index.js","files":2,"inputBytes":17499,"outputBytes":9399} +2024-02-15 12:49:28 STATE: Compile: {"name":"demo/tracker","format":"esm","platform":"browser","input":"demo/tracker/index.ts","output":"demo/tracker/index.js","files":2,"inputBytes":54375,"outputBytes":22791} +2024-02-15 12:49:35 STATE: Lint: {"locations":["**/*.json","src/**/*.ts","test/**/*.js","demo/**/*.js","**/*.md"],"files":172,"errors":0,"warnings":0} +2024-02-15 12:49:35 STATE: ChangeLog: {"repository":"https://github.com/vladmandic/human","branch":"main","output":"CHANGELOG.md"} +2024-02-15 12:49:35 STATE: Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs-core.d.ts","output":"types/tfjs-core.d.ts"} +2024-02-15 12:49:35 INFO:  Done... +2024-02-15 12:49:35 STATE: Copy: {"input":"node_modules/@vladmandic/tfjs/types/tfjs.d.ts","output":"types/tfjs.esm.d.ts"} +2024-02-15 12:49:35 STATE: Copy: {"input":"src/types/tsconfig.json","output":"types/tsconfig.json"} +2024-02-15 12:49:35 STATE: Copy: {"input":"src/types/eslint.json","output":"types/.eslintrc.json"} +2024-02-15 12:49:35 STATE: Copy: {"input":"src/types/tfjs.esm.d.ts","output":"dist/tfjs.esm.d.ts"} +2024-02-15 12:49:35 STATE: Filter: {"input":"types/tfjs-core.d.ts"} +2024-02-15 12:49:36 ERROR: API-Extractor: {} +2024-02-15 12:49:36 STATE: Filter: {"input":"types/human.d.ts"} +2024-02-15 12:49:36 STATE: Write: {"output":"dist/human.esm-nobundle.d.ts"} +2024-02-15 12:49:36 STATE: Write: {"output":"dist/human.esm.d.ts"} +2024-02-15 12:49:36 STATE: Write: {"output":"dist/human.d.ts"} +2024-02-15 12:49:36 STATE: Write: {"output":"dist/human.node-gpu.d.ts"} +2024-02-15 12:49:36 STATE: Write: {"output":"dist/human.node.d.ts"} +2024-02-15 12:49:36 STATE: Write: {"output":"dist/human.node-wasm.d.ts"} +2024-02-15 12:49:36 INFO:  Analyze models: {"folders":8,"result":"models/models.json"} +2024-02-15 12:49:36 STATE: Models {"folder":"./models","models":12} +2024-02-15 12:49:36 STATE: Models {"folder":"../human-models/models","models":44} +2024-02-15 12:49:36 STATE: Models {"folder":"../blazepose/model/","models":4} +2024-02-15 12:49:36 STATE: Models {"folder":"../anti-spoofing/model","models":1} +2024-02-15 12:49:36 STATE: Models {"folder":"../efficientpose/models","models":3} +2024-02-15 12:49:36 STATE: Models {"folder":"../insightface/models","models":5} +2024-02-15 12:49:36 STATE: Models {"folder":"../movenet/models","models":3} +2024-02-15 12:49:36 STATE: Models {"folder":"../nanodet/models","models":4} +2024-02-15 12:49:36 STATE: Models: {"count":58,"totalSize":380063249} +2024-02-15 12:49:36 INFO:  Human Build complete... {"logFile":"test/build.log"} diff --git a/test/test.log b/test/test.log index 02ae18da..ff2349ff 100644 --- a/test/test.log +++ b/test/test.log @@ -1,905 +1,904 @@ -2023-12-06 14:58:19 INFO:  @vladmandic/human version 3.2.0 -2023-12-06 14:58:19 INFO:  User: vlado Platform: linux Arch: x64 Node: v21.4.0 -2023-12-06 14:58:19 INFO:  demos: [{"cmd":"../demo/nodejs/node.js","args":[]},{"cmd":"../demo/nodejs/node-simple.js","args":[]},{"cmd":"../demo/nodejs/node-event.js","args":["samples/in/ai-body.jpg"]},{"cmd":"../demo/nodejs/node-similarity.js","args":["samples/in/ai-face.jpg","samples/in/ai-upper.jpg"]},{"cmd":"../demo/nodejs/node-canvas.js","args":["samples/in/ai-body.jpg","samples/out/ai-body.jpg"]},{"cmd":"../demo/nodejs/process-folder.js","args":["samples"]},{"cmd":"../demo/multithread/node-multiprocess.js","args":[]},{"cmd":"../demo/facematch/node-match.js","args":[]},{"cmd":"../demo/nodejs/node-bench.js","args":[]},{"cmd":"../test/test-node-emotion.js","args":[]}] -2023-12-06 14:58:19 INFO:  {"cmd":"../demo/nodejs/node.js","args":[]} start -2023-12-06 14:58:20 INFO:  {"cmd":"../demo/nodejs/node-simple.js","args":[]} start -2023-12-06 14:58:21 INFO:  {"cmd":"../demo/nodejs/node-event.js","args":["samples/in/ai-body.jpg"]} start -2023-12-06 14:58:21 INFO:  {"cmd":"../demo/nodejs/node-similarity.js","args":["samples/in/ai-face.jpg","samples/in/ai-upper.jpg"]} start -2023-12-06 14:58:22 INFO:  {"cmd":"../demo/nodejs/node-canvas.js","args":["samples/in/ai-body.jpg","samples/out/ai-body.jpg"]} start -2023-12-06 14:58:23 INFO:  {"cmd":"../demo/nodejs/process-folder.js","args":["samples"]} start -2023-12-06 14:58:25 INFO:  {"cmd":"../demo/multithread/node-multiprocess.js","args":[]} start -2023-12-06 14:58:43 INFO:  {"cmd":"../demo/facematch/node-match.js","args":[]} start -2023-12-06 14:58:44 INFO:  {"cmd":"../demo/nodejs/node-bench.js","args":[]} start -2023-12-06 14:58:59 INFO:  {"cmd":"../test/test-node-emotion.js","args":[]} start -2023-12-06 14:59:05 INFO:  tests: ["test-node-load.js","test-node-gear.js","test-backend-node.js","test-backend-node-gpu.js","test-backend-node-wasm.js"] -2023-12-06 14:59:05 INFO:  -2023-12-06 14:59:05 INFO:  test-node-load.js start -2023-12-06 14:59:06 INFO:  test-node-load.js load start {"human":"3.2.0","tf":"4.14.0","progress":0} -2023-12-06 14:59:06 DATA:  test-node-load.js load interval {"elapsed":1,"progress":0} -2023-12-06 14:59:06 DATA:  test-node-load.js load interval {"elapsed":10,"progress":0} -2023-12-06 14:59:06 DATA:  test-node-load.js load interval {"elapsed":27,"progress":0.12865823126207815} -2023-12-06 14:59:06 DATA:  test-node-load.js load interval {"elapsed":41,"progress":0.33826045252170456} -2023-12-06 14:59:06 DATA:  test-node-load.js load interval {"elapsed":65,"progress":0.4726970548784964} -2023-12-06 14:59:06 DATA:  test-node-load.js load interval {"elapsed":80,"progress":0.68355493315821} -2023-12-06 14:59:06 STATE: test-node-load.js passed {"progress":1} -2023-12-06 14:59:06 INFO:  test-node-load.js load final {"progress":1} -2023-12-06 14:59:06 DATA:  test-node-load.js load interval {"elapsed":482,"progress":1} -2023-12-06 14:59:06 INFO:  -2023-12-06 14:59:06 INFO:  test-node-gear.js start -2023-12-06 14:59:06 DATA:  test-node-gear.js input: ["samples/in/ai-face.jpg"] -2023-12-06 14:59:08 STATE: test-node-gear.js passed: gear faceres samples/in/ai-face.jpg -2023-12-06 14:59:08 DATA:  test-node-gear.js results {"face":0,"model":"faceres","image":"samples/in/ai-face.jpg","age":23.5,"gender":"female","genderScore":0.92,"emotion":[]} -2023-12-06 14:59:08 STATE: test-node-gear.js passed: gear gear samples/in/ai-face.jpg -2023-12-06 14:59:08 DATA:  test-node-gear.js results {"face":0,"model":"gear","image":"samples/in/ai-face.jpg","age":23.3,"gender":"female","genderScore":0.51,"race":[{"score":0.93,"race":"white"}],"emotion":[]} -2023-12-06 14:59:08 STATE: test-node-gear.js passed: gear ssrnet samples/in/ai-face.jpg -2023-12-06 14:59:08 DATA:  test-node-gear.js results {"face":0,"model":"ssrnet","image":"samples/in/ai-face.jpg","age":23.4,"gender":"female","genderScore":0.99,"emotion":[]} -2023-12-06 14:59:09 STATE: test-node-gear.js passed: gear ssrnet samples/in/ai-face.jpg -2023-12-06 14:59:09 DATA:  test-node-gear.js results {"face":0,"model":"ssrnet","image":"samples/in/ai-face.jpg","age":23.4,"gender":"male","emotion":[]} -2023-12-06 14:59:09 INFO:  -2023-12-06 14:59:09 INFO:  test-backend-node.js start -2023-12-06 14:59:09 INFO:  test-backend-node.js test: configuration validation -2023-12-06 14:59:09 STATE: test-backend-node.js passed: configuration default validation [] -2023-12-06 14:59:09 STATE: test-backend-node.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] -2023-12-06 14:59:09 INFO:  test-backend-node.js test: model load -2023-12-06 14:59:09 STATE: test-backend-node.js passed: models loaded 11 11 [{"name":"blazeface","loaded":true,"size":538928,"url":"file://models/blazeface.json"},{"name":"antispoof","loaded":true,"size":853098,"url":"file://models/antispoof.json"},{"name":"liveness","loaded":true,"size":592976,"url":"file://models/liveness.json"},{"name":"emotion","loaded":true,"size":820516,"url":"file://models/emotion.json"},{"name":"facemesh","loaded":true,"size":1477958,"url":"file://models/facemesh.json"},{"name":"handskeleton","loaded":true,"size":0,"url":"file://models/handlandmark-lite.json"},{"name":"iris","loaded":true,"size":2599092,"url":"file://models/iris.json"},{"name":"handtrack","loaded":true,"size":2964837,"url":"file://models/handtrack.json"},{"name":"centernet","loaded":true,"size":4030290,"url":"file://models/centernet.json"},{"name":"movenet","loaded":true,"size":4650216,"url":"file://models/movenet-lightning.json"},{"name":"faceres","loaded":true,"size":6978814,"url":"file://models/faceres.json"}] -2023-12-06 14:59:09 INFO:  test-backend-node.js memory: {"memory":{"unreliable":true,"numTensors":1785,"numDataBuffers":1785,"numBytes":56431460}} -2023-12-06 14:59:09 INFO:  test-backend-node.js state: {"state":{"registeredVariables":{},"nextTapeNodeId":0,"numBytes":56431460,"numTensors":1785,"numStringTensors":0,"numDataBuffers":1785,"gradientDepth":0,"kernelDepth":0,"scopeStack":[],"numDataMovesStack":[],"nextScopeId":0,"tensorInfo":{},"profiling":false,"activeProfile":{"newBytes":0,"newTensors":0,"peakBytes":0,"kernels":[],"result":null,"kernelNames":[]}}} -2023-12-06 14:59:09 INFO:  test-backend-node.js test: warmup -2023-12-06 14:59:09 STATE: test-backend-node.js passed: create human -2023-12-06 14:59:09 INFO:  test-backend-node.js human version: 3.2.0 -2023-12-06 14:59:09 INFO:  test-backend-node.js platform: agent: -2023-12-06 14:59:09 INFO:  test-backend-node.js tfjs version: 4.14.0 -2023-12-06 14:59:09 INFO:  test-backend-node.js env: {"browser":false,"node":true,"platform":"","agent":"","backends":["cpu","tensorflow"],"initial":false,"tfjs":{"version":"4.14.0"},"offscreen":false,"perfadd":false,"tensorflow":{"version":"2.9.1","gpu":false},"wasm":{"supported":true,"backend":false},"webgl":{"supported":false,"backend":false},"webgpu":{"supported":false,"backend":false},"cpu":{"flags":[]},"kernels":172} -2023-12-06 14:59:09 STATE: test-backend-node.js passed: set backend: tensorflow -2023-12-06 14:59:09 STATE: test-backend-node.js tensors 1785 -2023-12-06 14:59:09 STATE: test-backend-node.js result: defined models: 11 loaded models: 11 -2023-12-06 14:59:09 STATE: test-backend-node.js passed: load models 11 -2023-12-06 14:59:09 STATE: test-backend-node.js passed: warmup: none default -2023-12-06 14:59:09 DATA:  test-backend-node.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} -2023-12-06 14:59:09 DATA:  test-backend-node.js result: performance: load: null total: null -2023-12-06 14:59:09 STATE: test-backend-node.js passed: warmup none result match -2023-12-06 14:59:09 STATE: test-backend-node.js event: image -2023-12-06 14:59:09 STATE: test-backend-node.js event: detect -2023-12-06 14:59:09 STATE: test-backend-node.js event: warmup -2023-12-06 14:59:09 STATE: test-backend-node.js passed: warmup: face default -2023-12-06 14:59:09 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} -2023-12-06 14:59:09 DATA:  test-backend-node.js result: performance: load: null total: 456 -2023-12-06 14:59:09 STATE: test-backend-node.js passed: warmup face result match -2023-12-06 14:59:09 STATE: test-backend-node.js event: image -2023-12-06 14:59:10 STATE: test-backend-node.js event: detect -2023-12-06 14:59:10 STATE: test-backend-node.js event: warmup -2023-12-06 14:59:10 STATE: test-backend-node.js passed: warmup: body default -2023-12-06 14:59:10 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:10 DATA:  test-backend-node.js result: performance: load: null total: 350 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: warmup body result match -2023-12-06 14:59:10 STATE: test-backend-node.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.7,"gender":"female","genderScore":0.97},"emotion":[{"score":0.63,"emotion":"angry"},{"score":0.22,"emotion":"fear"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"face":0,"gesture":"mouth 10% open"},{"hand":0,"gesture":"pinky forward"},{"hand":0,"gesture":"thumb up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking left"},{"iris":0,"gesture":"looking up"}]} -2023-12-06 14:59:10 INFO:  test-backend-node.js test: details verification -2023-12-06 14:59:10 STATE: test-backend-node.js start default -2023-12-06 14:59:10 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:10 STATE: test-backend-node.js event: image -2023-12-06 14:59:10 STATE: test-backend-node.js event: detect -2023-12-06 14:59:10 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg default -2023-12-06 14:59:10 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:10 DATA:  test-backend-node.js result: performance: load: null total: 329 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details face length 1 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details face score 1 0.93 1 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details face age/gender 23.7 female 0.97 2.34 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details face arrays 4 478 1024 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details face emotion 2 {"score":0.59,"emotion":"angry"} -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details face anti-spoofing 0.79 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details face liveness 0.83 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details body length 1 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details body 0.92 17 6 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details hand length 1 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details hand 0.51 0.73 point -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details hand arrays 21 5 7 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details gesture length 7 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details gesture first {"face":0,"gesture":"facing right"} -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details object length 1 -2023-12-06 14:59:10 STATE: test-backend-node.js passed: details object 0.72 person -2023-12-06 14:59:10 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996928} -2023-12-06 14:59:10 STATE: test-backend-node.js event: image -2023-12-06 14:59:11 STATE: test-backend-node.js event: detect -2023-12-06 14:59:11 STATE: test-backend-node.js passed: tensor shape: [1,1200,1200,4] dtype: float32 -2023-12-06 14:59:11 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996928} -2023-12-06 14:59:11 STATE: test-backend-node.js event: image -2023-12-06 14:59:11 STATE: test-backend-node.js event: detect -2023-12-06 14:59:11 STATE: test-backend-node.js passed: tensor shape: [1200,1200,4] dtype: float32 -2023-12-06 14:59:11 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:11 STATE: test-backend-node.js event: image -2023-12-06 14:59:12 STATE: test-backend-node.js event: detect -2023-12-06 14:59:12 STATE: test-backend-node.js passed: tensor shape: [1,1200,1200,3] dtype: float32 -2023-12-06 14:59:12 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:12 STATE: test-backend-node.js event: image -2023-12-06 14:59:12 STATE: test-backend-node.js event: detect -2023-12-06 14:59:12 STATE: test-backend-node.js passed: tensor shape: [1200,1200,3] dtype: float32 -2023-12-06 14:59:13 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} -2023-12-06 14:59:13 STATE: test-backend-node.js event: image -2023-12-06 14:59:13 STATE: test-backend-node.js event: detect -2023-12-06 14:59:13 STATE: test-backend-node.js passed: tensor shape: [1,1200,1200,4] dtype: int32 -2023-12-06 14:59:13 INFO:  test-backend-node.js test default -2023-12-06 14:59:13 STATE: test-backend-node.js start async -2023-12-06 14:59:13 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:13 STATE: test-backend-node.js event: image -2023-12-06 14:59:13 STATE: test-backend-node.js event: detect -2023-12-06 14:59:14 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg async -2023-12-06 14:59:14 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:14 DATA:  test-backend-node.js result: performance: load: null total: 341 -2023-12-06 14:59:14 STATE: test-backend-node.js passed: default result face match 1 female 0.97 -2023-12-06 14:59:14 INFO:  test-backend-node.js test sync -2023-12-06 14:59:14 STATE: test-backend-node.js start sync -2023-12-06 14:59:14 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:14 STATE: test-backend-node.js event: image -2023-12-06 14:59:14 STATE: test-backend-node.js event: detect -2023-12-06 14:59:14 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg sync -2023-12-06 14:59:14 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:14 DATA:  test-backend-node.js result: performance: load: null total: 351 -2023-12-06 14:59:14 STATE: test-backend-node.js passed: default sync 1 female 0.97 -2023-12-06 14:59:14 INFO:  test-backend-node.js test: image process -2023-12-06 14:59:14 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:14 STATE: test-backend-node.js passed: image input null [1,256,256,3] -2023-12-06 14:59:14 INFO:  test-backend-node.js test: image null -2023-12-06 14:59:14 STATE: test-backend-node.js passed: invalid input could not convert input to tensor -2023-12-06 14:59:14 INFO:  test-backend-node.js test face similarity -2023-12-06 14:59:14 STATE: test-backend-node.js start face similarity -2023-12-06 14:59:14 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:14 STATE: test-backend-node.js event: image -2023-12-06 14:59:15 STATE: test-backend-node.js event: detect -2023-12-06 14:59:15 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face similarity -2023-12-06 14:59:15 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2023-12-06 14:59:15 DATA:  test-backend-node.js result: performance: load: null total: 352 -2023-12-06 14:59:15 STATE: test-backend-node.js start face similarity -2023-12-06 14:59:15 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:15 STATE: test-backend-node.js event: image -2023-12-06 14:59:15 STATE: test-backend-node.js event: detect -2023-12-06 14:59:15 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg face similarity -2023-12-06 14:59:15 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:15 DATA:  test-backend-node.js result: performance: load: null total: 348 -2023-12-06 14:59:15 STATE: test-backend-node.js start face similarity -2023-12-06 14:59:15 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:15 STATE: test-backend-node.js event: image -2023-12-06 14:59:15 STATE: test-backend-node.js event: detect -2023-12-06 14:59:15 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg face similarity -2023-12-06 14:59:15 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} -2023-12-06 14:59:15 DATA:  test-backend-node.js result: performance: load: null total: 323 -2023-12-06 14:59:15 STATE: test-backend-node.js passed: face descriptor -2023-12-06 14:59:15 STATE: test-backend-node.js passed: face similarity {"similarity":[1,0.44727441595492046,0.556793560189727],"descriptors":[1024,1024,1024]} -2023-12-06 14:59:15 INFO:  test-backend-node.js test object -2023-12-06 14:59:15 STATE: test-backend-node.js start object -2023-12-06 14:59:16 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:16 STATE: test-backend-node.js event: image -2023-12-06 14:59:16 STATE: test-backend-node.js event: detect -2023-12-06 14:59:16 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg object -2023-12-06 14:59:16 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:16 DATA:  test-backend-node.js result: performance: load: null total: 337 -2023-12-06 14:59:16 STATE: test-backend-node.js passed: centernet -2023-12-06 14:59:16 STATE: test-backend-node.js start object -2023-12-06 14:59:18 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:18 STATE: test-backend-node.js event: image -2023-12-06 14:59:18 STATE: test-backend-node.js event: detect -2023-12-06 14:59:18 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg object -2023-12-06 14:59:18 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 3 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:18 DATA:  test-backend-node.js result: performance: load: null total: 324 -2023-12-06 14:59:18 STATE: test-backend-node.js passed: nanodet -2023-12-06 14:59:18 INFO:  test-backend-node.js test sensitive -2023-12-06 14:59:18 STATE: test-backend-node.js start sensitive -2023-12-06 14:59:19 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:19 STATE: test-backend-node.js event: image -2023-12-06 14:59:19 STATE: test-backend-node.js event: detect -2023-12-06 14:59:19 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg sensitive -2023-12-06 14:59:19 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:19 DATA:  test-backend-node.js result: performance: load: null total: 297 -2023-12-06 14:59:19 STATE: test-backend-node.js passed: sensitive result match -2023-12-06 14:59:19 STATE: test-backend-node.js passed: sensitive face result match -2023-12-06 14:59:19 STATE: test-backend-node.js passed: sensitive face emotion result [{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}] -2023-12-06 14:59:19 STATE: test-backend-node.js passed: sensitive body result match -2023-12-06 14:59:19 STATE: test-backend-node.js passed: sensitive hand result match -2023-12-06 14:59:19 INFO:  test-backend-node.js test body -2023-12-06 14:59:19 STATE: test-backend-node.js start blazepose -2023-12-06 14:59:21 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:21 STATE: test-backend-node.js event: image -2023-12-06 14:59:21 STATE: test-backend-node.js event: detect -2023-12-06 14:59:21 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg blazepose -2023-12-06 14:59:21 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.99,"keypoints":39} -2023-12-06 14:59:21 DATA:  test-backend-node.js result: performance: load: null total: 425 -2023-12-06 14:59:21 STATE: test-backend-node.js passed: blazepose -2023-12-06 14:59:21 STATE: test-backend-node.js start efficientpose -2023-12-06 14:59:23 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:23 STATE: test-backend-node.js event: image -2023-12-06 14:59:23 STATE: test-backend-node.js event: detect -2023-12-06 14:59:23 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg efficientpose -2023-12-06 14:59:23 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.75,"keypoints":13} -2023-12-06 14:59:23 DATA:  test-backend-node.js result: performance: load: null total: 377 -2023-12-06 14:59:23 STATE: test-backend-node.js passed: efficientpose -2023-12-06 14:59:23 STATE: test-backend-node.js start posenet -2023-12-06 14:59:24 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:24 STATE: test-backend-node.js event: image -2023-12-06 14:59:24 STATE: test-backend-node.js event: detect -2023-12-06 14:59:24 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg posenet -2023-12-06 14:59:24 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.96,"keypoints":16} -2023-12-06 14:59:24 DATA:  test-backend-node.js result: performance: load: null total: 289 -2023-12-06 14:59:24 STATE: test-backend-node.js passed: posenet -2023-12-06 14:59:24 STATE: test-backend-node.js start movenet -2023-12-06 14:59:25 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:25 STATE: test-backend-node.js event: image -2023-12-06 14:59:25 STATE: test-backend-node.js event: detect -2023-12-06 14:59:25 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg movenet -2023-12-06 14:59:25 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:25 DATA:  test-backend-node.js result: performance: load: null total: 265 -2023-12-06 14:59:25 STATE: test-backend-node.js passed: movenet -2023-12-06 14:59:25 INFO:  test-backend-node.js test face matching -2023-12-06 14:59:25 STATE: test-backend-node.js passed: face database 40 -2023-12-06 14:59:25 STATE: test-backend-node.js passed: face match {"first":{"index":4,"similarity":0.7827852251220577}} {"second":{"index":4,"similarity":0.5002052057057577}} {"third":{"index":4,"similarity":0.5401588464054732}} -2023-12-06 14:59:25 INFO:  test-backend-node.js test face similarity alternative -2023-12-06 14:59:25 STATE: test-backend-node.js start face embeddings -2023-12-06 14:59:26 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:26 STATE: test-backend-node.js event: image -2023-12-06 14:59:27 STATE: test-backend-node.js event: detect -2023-12-06 14:59:27 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face embeddings -2023-12-06 14:59:27 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:27 DATA:  test-backend-node.js result: performance: load: null total: 348 -2023-12-06 14:59:27 STATE: test-backend-node.js passed: mobilefacenet {"embedding":192} -2023-12-06 14:59:27 STATE: test-backend-node.js start face embeddings -2023-12-06 14:59:28 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:28 STATE: test-backend-node.js event: image -2023-12-06 14:59:28 STATE: test-backend-node.js event: detect -2023-12-06 14:59:28 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face embeddings -2023-12-06 14:59:28 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:28 DATA:  test-backend-node.js result: performance: load: null total: 369 -2023-12-06 14:59:28 STATE: test-backend-node.js passed: insightface {"embedding":512} -2023-12-06 14:59:28 INFO:  test-backend-node.js test face attention -2023-12-06 14:59:28 STATE: test-backend-node.js start face attention -2023-12-06 14:59:28 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:28 STATE: test-backend-node.js event: image -2023-12-06 14:59:29 STATE: test-backend-node.js event: detect -2023-12-06 14:59:29 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face attention -2023-12-06 14:59:29 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:29 DATA:  test-backend-node.js result: performance: load: null total: 308 -2023-12-06 14:59:29 STATE: test-backend-node.js passed: face attention -2023-12-06 14:59:29 INFO:  test-backend-node.js test detectors -2023-12-06 14:59:29 STATE: test-backend-node.js start detectors -2023-12-06 14:59:29 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:29 STATE: test-backend-node.js event: image -2023-12-06 14:59:29 STATE: test-backend-node.js event: detect -2023-12-06 14:59:29 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg detectors -2023-12-06 14:59:29 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:29 DATA:  test-backend-node.js result: performance: load: null total: 169 -2023-12-06 14:59:29 STATE: test-backend-node.js passed: detector result face match -2023-12-06 14:59:29 STATE: test-backend-node.js passed: detector result hand match -2023-12-06 14:59:29 INFO:  test-backend-node.js test: multi-instance -2023-12-06 14:59:29 STATE: test-backend-node.js start multi instance -2023-12-06 14:59:29 STATE: test-backend-node.js event: image -2023-12-06 14:59:30 STATE: test-backend-node.js event: detect -2023-12-06 14:59:30 STATE: test-backend-node.js passed: detect: random multi instance -2023-12-06 14:59:30 DATA:  test-backend-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0} -2023-12-06 14:59:30 DATA:  test-backend-node.js result: performance: load: null total: 139 -2023-12-06 14:59:30 INFO:  test-backend-node.js test: first instance -2023-12-06 14:59:30 STATE: test-backend-node.js start multi instance -2023-12-06 14:59:30 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:30 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg multi instance -2023-12-06 14:59:30 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:30 DATA:  test-backend-node.js result: performance: load: null total: 132 -2023-12-06 14:59:30 INFO:  test-backend-node.js test: second instance -2023-12-06 14:59:30 STATE: test-backend-node.js start multi instance -2023-12-06 14:59:30 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:30 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg multi instance -2023-12-06 14:59:30 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:30 DATA:  test-backend-node.js result: performance: load: null total: 131 -2023-12-06 14:59:30 INFO:  test-backend-node.js test: concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js start concurrent -2023-12-06 14:59:30 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:30 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:30 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:30 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:30 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:31 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:31 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:31 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:31 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:31 STATE: test-backend-node.js event: image -2023-12-06 14:59:31 STATE: test-backend-node.js event: image -2023-12-06 14:59:31 STATE: test-backend-node.js event: image -2023-12-06 14:59:32 STATE: test-backend-node.js event: detect -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js event: detect -2023-12-06 14:59:32 STATE: test-backend-node.js event: detect -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg concurrent -2023-12-06 14:59:32 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:32 DATA:  test-backend-node.js result: performance: load: null total: 1176 -2023-12-06 14:59:32 INFO:  test-backend-node.js test: monkey-patch -2023-12-06 14:59:32 STATE: test-backend-node.js event: image -2023-12-06 14:59:32 STATE: test-backend-node.js event: detect -2023-12-06 14:59:32 STATE: test-backend-node.js passed: monkey patch -2023-12-06 14:59:33 STATE: test-backend-node.js passed: segmentation [262144] -2023-12-06 14:59:33 STATE: test-backend-node.js passeed: equal usage -2023-12-06 14:59:33 INFO:  test-backend-node.js test: input compare -2023-12-06 14:59:33 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:33 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:33 STATE: test-backend-node.js passed: image compare 0 23.275441687091504 -2023-12-06 14:59:33 INFO:  test-backend-node.js events: {"image":29,"detect":29,"warmup":2} -2023-12-06 14:59:33 INFO:  test-backend-node.js tensors 14855 -2023-12-06 14:59:33 INFO:  test-backend-node.js test complete: 24052 ms -2023-12-06 14:59:33 INFO:  -2023-12-06 14:59:33 INFO:  test-backend-node-gpu.js start -2023-12-06 14:59:33 INFO:  test-backend-node-gpu.js test: configuration validation -2023-12-06 14:59:33 STATE: test-backend-node-gpu.js passed: configuration default validation [] -2023-12-06 14:59:33 STATE: test-backend-node-gpu.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] -2023-12-06 14:59:33 INFO:  test-backend-node-gpu.js test: model load -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: models loaded 11 11 [{"name":"blazeface","loaded":true,"size":538928,"url":"file://models/blazeface.json"},{"name":"antispoof","loaded":true,"size":853098,"url":"file://models/antispoof.json"},{"name":"liveness","loaded":true,"size":592976,"url":"file://models/liveness.json"},{"name":"emotion","loaded":true,"size":820516,"url":"file://models/emotion.json"},{"name":"facemesh","loaded":true,"size":1477958,"url":"file://models/facemesh.json"},{"name":"handskeleton","loaded":true,"size":0,"url":"file://models/handlandmark-lite.json"},{"name":"iris","loaded":true,"size":2599092,"url":"file://models/iris.json"},{"name":"handtrack","loaded":true,"size":2964837,"url":"file://models/handtrack.json"},{"name":"centernet","loaded":true,"size":4030290,"url":"file://models/centernet.json"},{"name":"movenet","loaded":true,"size":4650216,"url":"file://models/movenet-lightning.json"},{"name":"faceres","loaded":true,"size":6978814,"url":"file://models/faceres.json"}] -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js memory: {"memory":{"unreliable":true,"numTensors":1785,"numDataBuffers":1785,"numBytes":56431460}} -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js state: {"state":{"registeredVariables":{},"nextTapeNodeId":0,"numBytes":56431460,"numTensors":1785,"numStringTensors":0,"numDataBuffers":1785,"gradientDepth":0,"kernelDepth":0,"scopeStack":[],"numDataMovesStack":[],"nextScopeId":0,"tensorInfo":{},"profiling":false,"activeProfile":{"newBytes":0,"newTensors":0,"peakBytes":0,"kernels":[],"result":null,"kernelNames":[]}}} -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js test: warmup -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: create human -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js human version: 3.2.0 -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js platform: agent: -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js tfjs version: 4.14.0 -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js env: {"browser":false,"node":true,"platform":"","agent":"","backends":["cpu","tensorflow"],"initial":false,"tfjs":{"version":"4.14.0"},"offscreen":false,"perfadd":false,"tensorflow":{"version":"2.9.1","gpu":false},"wasm":{"supported":true,"backend":false},"webgl":{"supported":false,"backend":false},"webgpu":{"supported":false,"backend":false},"cpu":{"flags":[]},"kernels":172} -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: set backend: tensorflow -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js tensors 1785 -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js result: defined models: 11 loaded models: 11 -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: load models 11 -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: warmup: none default -2023-12-06 14:59:34 DATA:  test-backend-node-gpu.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} -2023-12-06 14:59:34 DATA:  test-backend-node-gpu.js result: performance: load: null total: null -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: warmup none result match -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js event: warmup -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: warmup: face default -2023-12-06 14:59:34 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} -2023-12-06 14:59:34 DATA:  test-backend-node-gpu.js result: performance: load: null total: 460 -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: warmup face result match -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js event: warmup -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: warmup: body default -2023-12-06 14:59:34 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:34 DATA:  test-backend-node-gpu.js result: performance: load: null total: 354 -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js passed: warmup body result match -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.7,"gender":"female","genderScore":0.97},"emotion":[{"score":0.63,"emotion":"angry"},{"score":0.22,"emotion":"fear"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"face":0,"gesture":"mouth 10% open"},{"hand":0,"gesture":"pinky forward"},{"hand":0,"gesture":"thumb up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking left"},{"iris":0,"gesture":"looking up"}]} -2023-12-06 14:59:34 INFO:  test-backend-node-gpu.js test: details verification -2023-12-06 14:59:34 STATE: test-backend-node-gpu.js start default -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg default -2023-12-06 14:59:35 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:35 DATA:  test-backend-node-gpu.js result: performance: load: null total: 332 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details face length 1 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details face score 1 0.93 1 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details face age/gender 23.7 female 0.97 2.34 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details face arrays 4 478 1024 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details face emotion 2 {"score":0.59,"emotion":"angry"} -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details face anti-spoofing 0.79 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details face liveness 0.83 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details body length 1 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details body 0.92 17 6 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details hand length 1 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details hand 0.51 0.73 point -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details hand arrays 21 5 7 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details gesture length 7 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details gesture first {"face":0,"gesture":"facing right"} -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details object length 1 -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: details object 0.72 person -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996928} -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:35 STATE: test-backend-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: float32 -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996928} -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js passed: tensor shape: [1200,1200,4] dtype: float32 -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:36 STATE: test-backend-node-gpu.js passed: tensor shape: [1,1200,1200,3] dtype: float32 -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js passed: tensor shape: [1200,1200,3] dtype: float32 -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: int32 -2023-12-06 14:59:37 INFO:  test-backend-node-gpu.js test default -2023-12-06 14:59:37 STATE: test-backend-node-gpu.js start async -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg async -2023-12-06 14:59:38 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:38 DATA:  test-backend-node-gpu.js result: performance: load: null total: 345 -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js passed: default result face match 1 female 0.97 -2023-12-06 14:59:38 INFO:  test-backend-node-gpu.js test sync -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js start sync -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:38 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg sync -2023-12-06 14:59:39 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:39 DATA:  test-backend-node-gpu.js result: performance: load: null total: 372 -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: default sync 1 female 0.97 -2023-12-06 14:59:39 INFO:  test-backend-node-gpu.js test: image process -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: image input null [1,256,256,3] -2023-12-06 14:59:39 INFO:  test-backend-node-gpu.js test: image null -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: invalid input could not convert input to tensor -2023-12-06 14:59:39 INFO:  test-backend-node-gpu.js test face similarity -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js start face similarity -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face similarity -2023-12-06 14:59:39 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2023-12-06 14:59:39 DATA:  test-backend-node-gpu.js result: performance: load: null total: 360 -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js start face similarity -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:39 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg face similarity -2023-12-06 14:59:40 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:40 DATA:  test-backend-node-gpu.js result: performance: load: null total: 333 -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js start face similarity -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg face similarity -2023-12-06 14:59:40 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} -2023-12-06 14:59:40 DATA:  test-backend-node-gpu.js result: performance: load: null total: 341 -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js passed: face descriptor -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js passed: face similarity {"similarity":[1,0.44727441595492046,0.556793560189727],"descriptors":[1024,1024,1024]} -2023-12-06 14:59:40 INFO:  test-backend-node-gpu.js test object -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js start object -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:40 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:41 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:41 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg object -2023-12-06 14:59:41 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:41 DATA:  test-backend-node-gpu.js result: performance: load: null total: 389 -2023-12-06 14:59:41 STATE: test-backend-node-gpu.js passed: centernet -2023-12-06 14:59:41 STATE: test-backend-node-gpu.js start object -2023-12-06 14:59:41 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:41 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg object -2023-12-06 14:59:42 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 3 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:42 DATA:  test-backend-node-gpu.js result: performance: load: null total: 313 -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: nanodet -2023-12-06 14:59:42 INFO:  test-backend-node-gpu.js test sensitive -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js start sensitive -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg sensitive -2023-12-06 14:59:42 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:42 DATA:  test-backend-node-gpu.js result: performance: load: null total: 283 -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: sensitive result match -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: sensitive face result match -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: sensitive face emotion result [{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}] -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: sensitive body result match -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js passed: sensitive hand result match -2023-12-06 14:59:42 INFO:  test-backend-node-gpu.js test body -2023-12-06 14:59:42 STATE: test-backend-node-gpu.js start blazepose -2023-12-06 14:59:43 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:43 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:44 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:44 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg blazepose -2023-12-06 14:59:44 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.99,"keypoints":39} -2023-12-06 14:59:44 DATA:  test-backend-node-gpu.js result: performance: load: null total: 403 -2023-12-06 14:59:44 STATE: test-backend-node-gpu.js passed: blazepose -2023-12-06 14:59:44 STATE: test-backend-node-gpu.js start efficientpose -2023-12-06 14:59:44 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:44 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg efficientpose -2023-12-06 14:59:45 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.75,"keypoints":13} -2023-12-06 14:59:45 DATA:  test-backend-node-gpu.js result: performance: load: null total: 349 -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js passed: efficientpose -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js start posenet -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg posenet -2023-12-06 14:59:45 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.96,"keypoints":16} -2023-12-06 14:59:45 DATA:  test-backend-node-gpu.js result: performance: load: null total: 279 -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js passed: posenet -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js start movenet -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:45 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:46 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:46 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg movenet -2023-12-06 14:59:46 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:46 DATA:  test-backend-node-gpu.js result: performance: load: null total: 275 -2023-12-06 14:59:46 STATE: test-backend-node-gpu.js passed: movenet -2023-12-06 14:59:46 INFO:  test-backend-node-gpu.js test face matching -2023-12-06 14:59:46 STATE: test-backend-node-gpu.js passed: face database 40 -2023-12-06 14:59:46 STATE: test-backend-node-gpu.js passed: face match {"first":{"index":4,"similarity":0.7827852251220577}} {"second":{"index":4,"similarity":0.5002052057057577}} {"third":{"index":4,"similarity":0.5401588464054732}} -2023-12-06 14:59:46 INFO:  test-backend-node-gpu.js test face similarity alternative -2023-12-06 14:59:46 STATE: test-backend-node-gpu.js start face embeddings -2023-12-06 14:59:47 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:47 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face embeddings -2023-12-06 14:59:48 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:48 DATA:  test-backend-node-gpu.js result: performance: load: null total: 324 -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js passed: mobilefacenet {"embedding":192} -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js start face embeddings -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face embeddings -2023-12-06 14:59:48 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:48 DATA:  test-backend-node-gpu.js result: performance: load: null total: 340 -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js passed: insightface {"embedding":512} -2023-12-06 14:59:48 INFO:  test-backend-node-gpu.js test face attention -2023-12-06 14:59:48 STATE: test-backend-node-gpu.js start face attention -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face attention -2023-12-06 14:59:49 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:49 DATA:  test-backend-node-gpu.js result: performance: load: null total: 310 -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js passed: face attention -2023-12-06 14:59:49 INFO:  test-backend-node-gpu.js test detectors -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js start detectors -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg detectors -2023-12-06 14:59:49 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:49 DATA:  test-backend-node-gpu.js result: performance: load: null total: 162 -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js passed: detector result face match -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js passed: detector result hand match -2023-12-06 14:59:49 INFO:  test-backend-node-gpu.js test: multi-instance -2023-12-06 14:59:49 STATE: test-backend-node-gpu.js start multi instance -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: detect: random multi instance -2023-12-06 14:59:50 DATA:  test-backend-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0} -2023-12-06 14:59:50 DATA:  test-backend-node-gpu.js result: performance: load: null total: 134 -2023-12-06 14:59:50 INFO:  test-backend-node-gpu.js test: first instance -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start multi instance -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg multi instance -2023-12-06 14:59:50 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:50 DATA:  test-backend-node-gpu.js result: performance: load: null total: 134 -2023-12-06 14:59:50 INFO:  test-backend-node-gpu.js test: second instance -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start multi instance -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg multi instance -2023-12-06 14:59:50 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:50 DATA:  test-backend-node-gpu.js result: performance: load: null total: 137 -2023-12-06 14:59:50 INFO:  test-backend-node-gpu.js test: concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js start concurrent -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:50 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:51 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg concurrent -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} -2023-12-06 14:59:52 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1213 -2023-12-06 14:59:52 INFO:  test-backend-node-gpu.js test: monkey-patch -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js event: image -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js event: detect -2023-12-06 14:59:52 STATE: test-backend-node-gpu.js passed: monkey patch -2023-12-06 14:59:53 STATE: test-backend-node-gpu.js passed: segmentation [262144] -2023-12-06 14:59:53 STATE: test-backend-node-gpu.js passeed: equal usage -2023-12-06 14:59:53 INFO:  test-backend-node-gpu.js test: input compare -2023-12-06 14:59:53 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} -2023-12-06 14:59:53 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} -2023-12-06 14:59:53 STATE: test-backend-node-gpu.js passed: image compare 0 23.275441687091504 -2023-12-06 14:59:53 INFO:  test-backend-node-gpu.js events: {"image":29,"detect":29,"warmup":2} -2023-12-06 14:59:53 INFO:  test-backend-node-gpu.js tensors 14855 -2023-12-06 14:59:53 INFO:  test-backend-node-gpu.js test complete: 19331 ms -2023-12-06 14:59:53 INFO:  -2023-12-06 14:59:53 INFO:  test-backend-node-wasm.js start -2023-12-06 14:59:53 DATA:  test-backend-node-wasm.js stdout: 2023-12-06 14:59:53 INFO:  { supported: true, backend: true, simd: undefined, multithread: undefined } https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@4.14.0/dist/ -2023-12-06 14:59:53 STATE: test-backend-node-wasm.js passed: model server: https://vladmandic.github.io/human-models/models/ -2023-12-06 14:59:53 INFO:  test-backend-node-wasm.js test: configuration validation -2023-12-06 14:59:53 STATE: test-backend-node-wasm.js passed: configuration default validation [] -2023-12-06 14:59:53 STATE: test-backend-node-wasm.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] -2023-12-06 14:59:53 INFO:  test-backend-node-wasm.js test: model load -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: models loaded 11 11 [{"name":"movenet","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/movenet-lightning.json"},{"name":"liveness","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/liveness.json"},{"name":"antispoof","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/antispoof.json"},{"name":"facemesh","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/facemesh.json"},{"name":"centernet","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/centernet.json"},{"name":"handskeleton","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/handlandmark-lite.json"},{"name":"iris","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/iris.json"},{"name":"blazeface","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/blazeface.json"},{"name":"emotion","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/emotion.json"},{"name":"faceres","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/faceres.json"},{"name":"handtrack","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/handtrack.json"}] -2023-12-06 14:59:55 INFO:  test-backend-node-wasm.js memory: {"memory":{"unreliable":false,"numTensors":1785,"numDataBuffers":1785,"numBytes":56431460}} -2023-12-06 14:59:55 INFO:  test-backend-node-wasm.js state: {"state":{"registeredVariables":{},"nextTapeNodeId":0,"numBytes":56431460,"numTensors":1785,"numStringTensors":0,"numDataBuffers":1785,"gradientDepth":0,"kernelDepth":0,"scopeStack":[],"numDataMovesStack":[],"nextScopeId":0,"tensorInfo":{},"profiling":false,"activeProfile":{"newBytes":0,"newTensors":0,"peakBytes":0,"kernels":[],"result":null,"kernelNames":[]}}} -2023-12-06 14:59:55 INFO:  test-backend-node-wasm.js test: warmup -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: create human -2023-12-06 14:59:55 INFO:  test-backend-node-wasm.js human version: 3.2.0 -2023-12-06 14:59:55 INFO:  test-backend-node-wasm.js platform: agent: -2023-12-06 14:59:55 INFO:  test-backend-node-wasm.js tfjs version: 4.14.0 -2023-12-06 14:59:55 INFO:  test-backend-node-wasm.js env: {"browser":false,"node":true,"platform":"","agent":"","backends":["wasm"],"initial":false,"tfjs":{"version":"4.14.0"},"offscreen":false,"perfadd":false,"tensorflow":{},"wasm":{"supported":true,"backend":true,"simd":true,"multithread":false},"webgl":{"supported":false,"backend":false},"webgpu":{"supported":false,"backend":false},"cpu":{"flags":[]},"kernels":174} -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: set backend: wasm -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js tensors 1785 -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js result: defined models: 11 loaded models: 11 -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: load models 11 -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: warmup: none default -2023-12-06 14:59:55 DATA:  test-backend-node-wasm.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} -2023-12-06 14:59:55 DATA:  test-backend-node-wasm.js result: performance: load: null total: null -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: warmup none result match -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js event: warmup -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: warmup: face default -2023-12-06 14:59:55 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2023-12-06 14:59:55 DATA:  test-backend-node-wasm.js result: performance: load: null total: 488 -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js passed: warmup face result match -2023-12-06 14:59:55 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js event: warmup -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: warmup: body default -2023-12-06 14:59:56 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:56 DATA:  test-backend-node-wasm.js result: performance: load: null total: 338 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: warmup body result match -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js details: {"face":{"boxScore":0.93,"faceScore":1,"age":23.7,"gender":"female","genderScore":0.97},"emotion":[{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.51,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"face":0,"gesture":"mouth 21% open"},{"hand":0,"gesture":"pinky forward"},{"hand":0,"gesture":"thumb up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking left"},{"iris":0,"gesture":"looking up"}]} -2023-12-06 14:59:56 INFO:  test-backend-node-wasm.js test: details verification -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js start default -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg default -2023-12-06 14:59:56 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 14:59:56 DATA:  test-backend-node-wasm.js result: performance: load: null total: 334 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details face length 1 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details face score 1 0.93 1 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details face age/gender 23.7 female 0.97 2.34 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details face arrays 4 478 1024 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details face emotion 2 {"score":0.59,"emotion":"angry"} -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details face anti-spoofing 0.79 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details face liveness 0.83 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details body length 1 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details body 0.92 17 6 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details hand length 1 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details hand 0.51 0.73 point -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details hand arrays 21 5 7 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details gesture length 7 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details gesture first {"face":0,"gesture":"facing right"} -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details object length 1 -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: details object 0.72 person -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1413675264} -2023-12-06 14:59:56 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:57 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:57 STATE: test-backend-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: float32 -2023-12-06 14:59:57 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1413675264} -2023-12-06 14:59:57 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:57 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:57 STATE: test-backend-node-wasm.js passed: tensor shape: [1200,1200,4] dtype: float32 -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js passed: tensor shape: [1,1200,1200,3] dtype: float32 -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1038921856} -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:58 STATE: test-backend-node-wasm.js passed: tensor shape: [1200,1200,3] dtype: float32 -2023-12-06 14:59:59 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} -2023-12-06 14:59:59 STATE: test-backend-node-wasm.js event: image -2023-12-06 14:59:59 STATE: test-backend-node-wasm.js event: detect -2023-12-06 14:59:59 STATE: test-backend-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: int32 -2023-12-06 14:59:59 INFO:  test-backend-node-wasm.js test default -2023-12-06 14:59:59 STATE: test-backend-node-wasm.js start async -2023-12-06 15:00:01 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:01 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:01 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:01 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg async -2023-12-06 15:00:01 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 15:00:01 DATA:  test-backend-node-wasm.js result: performance: load: null total: 395 -2023-12-06 15:00:01 STATE: test-backend-node-wasm.js passed: default result face match 1 female 0.97 -2023-12-06 15:00:01 INFO:  test-backend-node-wasm.js test sync -2023-12-06 15:00:01 STATE: test-backend-node-wasm.js start sync -2023-12-06 15:00:02 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:02 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:03 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:03 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg sync -2023-12-06 15:00:03 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 15:00:03 DATA:  test-backend-node-wasm.js result: performance: load: null total: 399 -2023-12-06 15:00:03 STATE: test-backend-node-wasm.js passed: default sync 1 female 0.97 -2023-12-06 15:00:03 INFO:  test-backend-node-wasm.js test: image process -2023-12-06 15:00:03 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2023-12-06 15:00:03 STATE: test-backend-node-wasm.js passed: image input null [1,256,256,3] -2023-12-06 15:00:03 INFO:  test-backend-node-wasm.js test: image null -2023-12-06 15:00:03 STATE: test-backend-node-wasm.js passed: invalid input could not convert input to tensor -2023-12-06 15:00:03 INFO:  test-backend-node-wasm.js test face similarity -2023-12-06 15:00:03 STATE: test-backend-node-wasm.js start face similarity -2023-12-06 15:00:04 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2023-12-06 15:00:04 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-face.jpg face similarity -2023-12-06 15:00:05 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} -2023-12-06 15:00:05 DATA:  test-backend-node-wasm.js result: performance: load: null total: 397 -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js start face similarity -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg face similarity -2023-12-06 15:00:05 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 15:00:05 DATA:  test-backend-node-wasm.js result: performance: load: null total: 301 -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js start face similarity -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} -2023-12-06 15:00:05 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-upper.jpg face similarity -2023-12-06 15:00:06 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} -2023-12-06 15:00:06 DATA:  test-backend-node-wasm.js result: performance: load: null total: 289 -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js passed: face descriptor -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js passed: face similarity {"similarity":[1,0.4472741837136387,0.5567931378245533],"descriptors":[1024,1024,1024]} -2023-12-06 15:00:06 INFO:  test-backend-node-wasm.js test object -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js start object -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg object -2023-12-06 15:00:06 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 15:00:06 DATA:  test-backend-node-wasm.js result: performance: load: null total: 311 -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js passed: centernet -2023-12-06 15:00:06 STATE: test-backend-node-wasm.js start object -2023-12-06 15:00:07 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:07 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:07 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:07 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg object -2023-12-06 15:00:07 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 3 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} -2023-12-06 15:00:07 DATA:  test-backend-node-wasm.js result: performance: load: null total: 353 -2023-12-06 15:00:07 STATE: test-backend-node-wasm.js passed: nanodet -2023-12-06 15:00:07 INFO:  test-backend-node-wasm.js test sensitive -2023-12-06 15:00:07 STATE: test-backend-node-wasm.js start sensitive -2023-12-06 15:00:08 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:08 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg sensitive -2023-12-06 15:00:09 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} -2023-12-06 15:00:09 DATA:  test-backend-node-wasm.js result: performance: load: null total: 276 -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js passed: sensitive result match -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js passed: sensitive face result match -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js passed: sensitive face emotion result [{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}] -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js passed: sensitive body result match -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js passed: sensitive hand result match -2023-12-06 15:00:09 INFO:  test-backend-node-wasm.js test body -2023-12-06 15:00:09 STATE: test-backend-node-wasm.js start blazepose -2023-12-06 15:00:11 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:11 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:11 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:11 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg blazepose -2023-12-06 15:00:11 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.99,"keypoints":39} -2023-12-06 15:00:11 DATA:  test-backend-node-wasm.js result: performance: load: null total: 432 -2023-12-06 15:00:11 STATE: test-backend-node-wasm.js passed: blazepose -2023-12-06 15:00:11 STATE: test-backend-node-wasm.js start efficientpose -2023-12-06 15:00:12 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:12 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:13 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:13 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg efficientpose -2023-12-06 15:00:13 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.75,"keypoints":13} -2023-12-06 15:00:13 DATA:  test-backend-node-wasm.js result: performance: load: null total: 675 -2023-12-06 15:00:13 STATE: test-backend-node-wasm.js passed: efficientpose -2023-12-06 15:00:13 STATE: test-backend-node-wasm.js start posenet -2023-12-06 15:00:13 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:13 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg posenet -2023-12-06 15:00:14 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.96,"keypoints":16} -2023-12-06 15:00:14 DATA:  test-backend-node-wasm.js result: performance: load: null total: 261 -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js passed: posenet -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js start movenet -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg movenet -2023-12-06 15:00:14 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} -2023-12-06 15:00:14 DATA:  test-backend-node-wasm.js result: performance: load: null total: 214 -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js passed: movenet -2023-12-06 15:00:14 INFO:  test-backend-node-wasm.js test face matching -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js passed: face database 40 -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js passed: face match {"first":{"index":4,"similarity":0.7827852754786533}} {"second":{"index":4,"similarity":0.5002051178899982}} {"third":{"index":4,"similarity":0.5401586736511599}} -2023-12-06 15:00:14 INFO:  test-backend-node-wasm.js test face similarity alternative -2023-12-06 15:00:14 STATE: test-backend-node-wasm.js start face embeddings -2023-12-06 15:00:16 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2023-12-06 15:00:16 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:16 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:16 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-face.jpg face embeddings -2023-12-06 15:00:16 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 15:00:16 DATA:  test-backend-node-wasm.js result: performance: load: null total: 306 -2023-12-06 15:00:16 STATE: test-backend-node-wasm.js passed: mobilefacenet {"embedding":192} -2023-12-06 15:00:16 STATE: test-backend-node-wasm.js start face embeddings -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js event: detect -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-face.jpg face embeddings -2023-12-06 15:00:17 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} -2023-12-06 15:00:17 DATA:  test-backend-node-wasm.js result: performance: load: null total: 273 -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js passed: insightface {"embedding":512} -2023-12-06 15:00:17 INFO:  test-backend-node-wasm.js test face attention -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js start face attention -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} -2023-12-06 15:00:17 STATE: test-backend-node-wasm.js event: image -2023-12-06 15:00:17 ERROR: test-backend-node-wasm.js failed: testDetect face attention -2023-12-06 15:00:17 ERROR: test-backend-node-wasm.js uncaughtException {"name":"Error","message":"BatchMatMul for non non-float32 tensors not yet supported.","stack":["Error: BatchMatMul for non non-float32 tensors not yet supported."," at Object.batchMatMul [as kernelFunc] (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.node.js:1280:15)"," at kernelFunc (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4707:32)"," at /home/vlado/dev/human/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4767:27"," at Engine.scopedRun (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4572:23)"," at Engine.runKernelFunc (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4763:14)"," at Engine.runKernel (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4636:21)"," at matMul_ (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:13408:19)"," at Object.matMul__op [as matMul] (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:12217:29)"," at executeOp$9 (/home/vlado/dev/human/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:29592:25)"," at /home/vlado/dev/human/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:30172:50"]} -2023-12-06 15:00:17 STATE: all tests complete -2023-12-06 15:00:17 INFO:  status {"test":"../demo/nodejs/node.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/nodejs/node-simple.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/nodejs/node-event.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/nodejs/node-similarity.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/nodejs/node-canvas.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/nodejs/process-folder.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/multithread/node-multiprocess.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/facematch/node-match.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../demo/nodejs/node-bench.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"../test/test-node-emotion.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"test-node-load.js","passed":1,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"test-node-gear.js","passed":4,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"test-backend-node.js","passed":125,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"test-backend-node-gpu.js","passed":125,"failed":0} -2023-12-06 15:00:17 INFO:  status {"test":"test-backend-node-wasm.js","passed":92,"failed":1} -2023-12-06 15:00:17 INFO:  failures {"count":1} -2023-12-06 15:00:17 WARN:  failed {"test":"test-backend-node-wasm.js","message":["error",["failed:","testDetect face attention"]]} +2024-02-15 12:49:40 INFO:  @vladmandic/human version 3.2.1 +2024-02-15 12:49:40 INFO:  User: vlado Platform: linux Arch: x64 Node: v21.4.0 +2024-02-15 12:49:40 INFO:  demos: [{"cmd":"../demo/nodejs/node.js","args":[]},{"cmd":"../demo/nodejs/node-simple.js","args":[]},{"cmd":"../demo/nodejs/node-event.js","args":["samples/in/ai-body.jpg"]},{"cmd":"../demo/nodejs/node-similarity.js","args":["samples/in/ai-face.jpg","samples/in/ai-upper.jpg"]},{"cmd":"../demo/nodejs/node-canvas.js","args":["samples/in/ai-body.jpg","samples/out/ai-body.jpg"]},{"cmd":"../demo/nodejs/process-folder.js","args":["samples"]},{"cmd":"../demo/multithread/node-multiprocess.js","args":[]},{"cmd":"../demo/facematch/node-match.js","args":[]},{"cmd":"../demo/nodejs/node-bench.js","args":[]},{"cmd":"../test/test-node-emotion.js","args":[]}] +2024-02-15 12:49:40 INFO:  {"cmd":"../demo/nodejs/node.js","args":[]} start +2024-02-15 12:49:41 INFO:  {"cmd":"../demo/nodejs/node-simple.js","args":[]} start +2024-02-15 12:49:42 INFO:  {"cmd":"../demo/nodejs/node-event.js","args":["samples/in/ai-body.jpg"]} start +2024-02-15 12:49:42 INFO:  {"cmd":"../demo/nodejs/node-similarity.js","args":["samples/in/ai-face.jpg","samples/in/ai-upper.jpg"]} start +2024-02-15 12:49:43 INFO:  {"cmd":"../demo/nodejs/node-canvas.js","args":["samples/in/ai-body.jpg","samples/out/ai-body.jpg"]} start +2024-02-15 12:49:44 INFO:  {"cmd":"../demo/nodejs/process-folder.js","args":["samples"]} start +2024-02-15 12:49:45 INFO:  {"cmd":"../demo/multithread/node-multiprocess.js","args":[]} start +2024-02-15 12:49:58 INFO:  {"cmd":"../demo/facematch/node-match.js","args":[]} start +2024-02-15 12:49:59 INFO:  {"cmd":"../demo/nodejs/node-bench.js","args":[]} start +2024-02-15 12:50:15 INFO:  {"cmd":"../test/test-node-emotion.js","args":[]} start +2024-02-15 12:50:22 INFO:  tests: ["test-node-load.js","test-node-gear.js","test-backend-node.js","test-backend-node-gpu.js","test-backend-node-wasm.js"] +2024-02-15 12:50:22 INFO:  +2024-02-15 12:50:22 INFO:  test-node-load.js start +2024-02-15 12:50:22 INFO:  test-node-load.js load start {"human":"3.2.1","tf":"4.17.0","progress":0} +2024-02-15 12:50:22 DATA:  test-node-load.js load interval {"elapsed":1,"progress":0} +2024-02-15 12:50:22 DATA:  test-node-load.js load interval {"elapsed":11,"progress":0} +2024-02-15 12:50:22 DATA:  test-node-load.js load interval {"elapsed":30,"progress":0.12865823126207815} +2024-02-15 12:50:22 DATA:  test-node-load.js load interval {"elapsed":64,"progress":0.4726970548784964} +2024-02-15 12:50:22 DATA:  test-node-load.js load interval {"elapsed":74,"progress":0.68355493315821} +2024-02-15 12:50:22 STATE: test-node-load.js passed {"progress":1} +2024-02-15 12:50:22 INFO:  test-node-load.js load final {"progress":1} +2024-02-15 12:50:22 DATA:  test-node-load.js load interval {"elapsed":429,"progress":1} +2024-02-15 12:50:22 INFO:  +2024-02-15 12:50:22 INFO:  test-node-gear.js start +2024-02-15 12:50:22 DATA:  test-node-gear.js input: ["samples/in/ai-face.jpg"] +2024-02-15 12:50:24 STATE: test-node-gear.js passed: gear faceres samples/in/ai-face.jpg +2024-02-15 12:50:24 DATA:  test-node-gear.js results {"face":0,"model":"faceres","image":"samples/in/ai-face.jpg","age":23.5,"gender":"female","genderScore":0.92,"emotion":[]} +2024-02-15 12:50:24 STATE: test-node-gear.js passed: gear gear samples/in/ai-face.jpg +2024-02-15 12:50:24 DATA:  test-node-gear.js results {"face":0,"model":"gear","image":"samples/in/ai-face.jpg","age":23.3,"gender":"female","genderScore":0.51,"race":[{"score":0.93,"race":"white"}],"emotion":[]} +2024-02-15 12:50:25 STATE: test-node-gear.js passed: gear ssrnet samples/in/ai-face.jpg +2024-02-15 12:50:25 DATA:  test-node-gear.js results {"face":0,"model":"ssrnet","image":"samples/in/ai-face.jpg","age":23.4,"gender":"female","genderScore":0.99,"emotion":[]} +2024-02-15 12:50:25 STATE: test-node-gear.js passed: gear ssrnet samples/in/ai-face.jpg +2024-02-15 12:50:25 DATA:  test-node-gear.js results {"face":0,"model":"ssrnet","image":"samples/in/ai-face.jpg","age":23.4,"gender":"male","emotion":[]} +2024-02-15 12:50:25 INFO:  +2024-02-15 12:50:25 INFO:  test-backend-node.js start +2024-02-15 12:50:25 INFO:  test-backend-node.js test: configuration validation +2024-02-15 12:50:25 STATE: test-backend-node.js passed: configuration default validation [] +2024-02-15 12:50:25 STATE: test-backend-node.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] +2024-02-15 12:50:25 INFO:  test-backend-node.js test: model load +2024-02-15 12:50:25 STATE: test-backend-node.js passed: models loaded 11 11 [{"name":"blazeface","loaded":true,"size":538928,"url":"file://models/blazeface.json"},{"name":"antispoof","loaded":true,"size":853098,"url":"file://models/antispoof.json"},{"name":"liveness","loaded":true,"size":592976,"url":"file://models/liveness.json"},{"name":"emotion","loaded":true,"size":820516,"url":"file://models/emotion.json"},{"name":"facemesh","loaded":true,"size":1477958,"url":"file://models/facemesh.json"},{"name":"handskeleton","loaded":true,"size":0,"url":"file://models/handlandmark-lite.json"},{"name":"iris","loaded":true,"size":2599092,"url":"file://models/iris.json"},{"name":"handtrack","loaded":true,"size":2964837,"url":"file://models/handtrack.json"},{"name":"centernet","loaded":true,"size":4030290,"url":"file://models/centernet.json"},{"name":"movenet","loaded":true,"size":4650216,"url":"file://models/movenet-lightning.json"},{"name":"faceres","loaded":true,"size":6978814,"url":"file://models/faceres.json"}] +2024-02-15 12:50:25 INFO:  test-backend-node.js memory: {"memory":{"unreliable":true,"numTensors":1785,"numDataBuffers":1785,"numBytes":56431460}} +2024-02-15 12:50:25 INFO:  test-backend-node.js state: {"state":{"registeredVariables":{},"nextTapeNodeId":0,"numBytes":56431460,"numTensors":1785,"numStringTensors":0,"numDataBuffers":1785,"gradientDepth":0,"kernelDepth":0,"scopeStack":[],"numDataMovesStack":[],"nextScopeId":0,"tensorInfo":{},"profiling":false,"activeProfile":{"newBytes":0,"newTensors":0,"peakBytes":0,"kernels":[],"result":null,"kernelNames":[]}}} +2024-02-15 12:50:25 INFO:  test-backend-node.js test: warmup +2024-02-15 12:50:25 STATE: test-backend-node.js passed: create human +2024-02-15 12:50:25 INFO:  test-backend-node.js human version: 3.2.1 +2024-02-15 12:50:25 INFO:  test-backend-node.js platform: agent: +2024-02-15 12:50:25 INFO:  test-backend-node.js tfjs version: 4.17.0 +2024-02-15 12:50:25 INFO:  test-backend-node.js env: {"browser":false,"node":true,"platform":"","agent":"","backends":["cpu","tensorflow"],"initial":false,"tfjs":{"version":"4.17.0"},"offscreen":false,"perfadd":false,"tensorflow":{"version":"2.9.1","gpu":false},"wasm":{"supported":true,"backend":false},"webgl":{"supported":false,"backend":false},"webgpu":{"supported":false,"backend":false},"cpu":{"flags":[]},"kernels":172} +2024-02-15 12:50:25 STATE: test-backend-node.js passed: set backend: tensorflow +2024-02-15 12:50:25 STATE: test-backend-node.js tensors 1785 +2024-02-15 12:50:25 STATE: test-backend-node.js result: defined models: 11 loaded models: 11 +2024-02-15 12:50:25 STATE: test-backend-node.js passed: load models 11 +2024-02-15 12:50:25 STATE: test-backend-node.js passed: warmup: none default +2024-02-15 12:50:25 DATA:  test-backend-node.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} +2024-02-15 12:50:25 DATA:  test-backend-node.js result: performance: load: null total: null +2024-02-15 12:50:25 STATE: test-backend-node.js passed: warmup none result match +2024-02-15 12:50:25 STATE: test-backend-node.js event: image +2024-02-15 12:50:26 STATE: test-backend-node.js event: detect +2024-02-15 12:50:26 STATE: test-backend-node.js event: warmup +2024-02-15 12:50:26 STATE: test-backend-node.js passed: warmup: face default +2024-02-15 12:50:26 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} +2024-02-15 12:50:26 DATA:  test-backend-node.js result: performance: load: null total: 415 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: warmup face result match +2024-02-15 12:50:26 STATE: test-backend-node.js event: image +2024-02-15 12:50:26 STATE: test-backend-node.js event: detect +2024-02-15 12:50:26 STATE: test-backend-node.js event: warmup +2024-02-15 12:50:26 STATE: test-backend-node.js passed: warmup: body default +2024-02-15 12:50:26 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:50:26 DATA:  test-backend-node.js result: performance: load: null total: 318 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: warmup body result match +2024-02-15 12:50:26 STATE: test-backend-node.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.7,"gender":"female","genderScore":0.97},"emotion":[{"score":0.63,"emotion":"angry"},{"score":0.22,"emotion":"fear"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"face":0,"gesture":"mouth 10% open"},{"hand":0,"gesture":"pinky forward"},{"hand":0,"gesture":"thumb up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking left"},{"iris":0,"gesture":"looking up"}]} +2024-02-15 12:50:26 INFO:  test-backend-node.js test: details verification +2024-02-15 12:50:26 STATE: test-backend-node.js start default +2024-02-15 12:50:26 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:26 STATE: test-backend-node.js event: image +2024-02-15 12:50:26 STATE: test-backend-node.js event: detect +2024-02-15 12:50:26 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg default +2024-02-15 12:50:26 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:50:26 DATA:  test-backend-node.js result: performance: load: null total: 300 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details face length 1 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details face score 1 0.93 1 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details face age/gender 23.7 female 0.97 2.34 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details face arrays 4 478 1024 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details face emotion 2 {"score":0.59,"emotion":"angry"} +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details face anti-spoofing 0.79 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details face liveness 0.83 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details body length 1 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details body 0.92 17 6 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details hand length 1 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details hand 0.51 0.73 point +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details hand arrays 21 5 7 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details gesture length 7 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details gesture first {"face":0,"gesture":"facing right"} +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details object length 1 +2024-02-15 12:50:26 STATE: test-backend-node.js passed: details object 0.72 person +2024-02-15 12:50:27 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996928} +2024-02-15 12:50:27 STATE: test-backend-node.js event: image +2024-02-15 12:50:27 STATE: test-backend-node.js event: detect +2024-02-15 12:50:27 STATE: test-backend-node.js passed: tensor shape: [1,1200,1200,4] dtype: float32 +2024-02-15 12:50:27 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996928} +2024-02-15 12:50:27 STATE: test-backend-node.js event: image +2024-02-15 12:50:27 STATE: test-backend-node.js event: detect +2024-02-15 12:50:27 STATE: test-backend-node.js passed: tensor shape: [1200,1200,4] dtype: float32 +2024-02-15 12:50:28 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:28 STATE: test-backend-node.js event: image +2024-02-15 12:50:28 STATE: test-backend-node.js event: detect +2024-02-15 12:50:28 STATE: test-backend-node.js passed: tensor shape: [1,1200,1200,3] dtype: float32 +2024-02-15 12:50:28 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:28 STATE: test-backend-node.js event: image +2024-02-15 12:50:28 STATE: test-backend-node.js event: detect +2024-02-15 12:50:28 STATE: test-backend-node.js passed: tensor shape: [1200,1200,3] dtype: float32 +2024-02-15 12:50:28 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} +2024-02-15 12:50:28 STATE: test-backend-node.js event: image +2024-02-15 12:50:29 STATE: test-backend-node.js event: detect +2024-02-15 12:50:29 STATE: test-backend-node.js passed: tensor shape: [1,1200,1200,4] dtype: int32 +2024-02-15 12:50:29 INFO:  test-backend-node.js test default +2024-02-15 12:50:29 STATE: test-backend-node.js start async +2024-02-15 12:50:29 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:29 STATE: test-backend-node.js event: image +2024-02-15 12:50:29 STATE: test-backend-node.js event: detect +2024-02-15 12:50:29 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg async +2024-02-15 12:50:29 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:50:29 DATA:  test-backend-node.js result: performance: load: null total: 303 +2024-02-15 12:50:29 STATE: test-backend-node.js passed: default result face match 1 female 0.97 +2024-02-15 12:50:29 INFO:  test-backend-node.js test sync +2024-02-15 12:50:29 STATE: test-backend-node.js start sync +2024-02-15 12:50:30 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:30 STATE: test-backend-node.js event: image +2024-02-15 12:50:30 STATE: test-backend-node.js event: detect +2024-02-15 12:50:30 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg sync +2024-02-15 12:50:30 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:50:30 DATA:  test-backend-node.js result: performance: load: null total: 298 +2024-02-15 12:50:30 STATE: test-backend-node.js passed: default sync 1 female 0.97 +2024-02-15 12:50:30 INFO:  test-backend-node.js test: image process +2024-02-15 12:50:30 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:30 STATE: test-backend-node.js passed: image input null [1,256,256,3] +2024-02-15 12:50:30 INFO:  test-backend-node.js test: image null +2024-02-15 12:50:30 STATE: test-backend-node.js passed: invalid input could not convert input to tensor +2024-02-15 12:50:30 INFO:  test-backend-node.js test face similarity +2024-02-15 12:50:30 STATE: test-backend-node.js start face similarity +2024-02-15 12:50:30 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:30 STATE: test-backend-node.js event: image +2024-02-15 12:50:30 STATE: test-backend-node.js event: detect +2024-02-15 12:50:30 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face similarity +2024-02-15 12:50:30 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2024-02-15 12:50:30 DATA:  test-backend-node.js result: performance: load: null total: 298 +2024-02-15 12:50:30 STATE: test-backend-node.js start face similarity +2024-02-15 12:50:30 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:30 STATE: test-backend-node.js event: image +2024-02-15 12:50:31 STATE: test-backend-node.js event: detect +2024-02-15 12:50:31 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg face similarity +2024-02-15 12:50:31 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:50:31 DATA:  test-backend-node.js result: performance: load: null total: 289 +2024-02-15 12:50:31 STATE: test-backend-node.js start face similarity +2024-02-15 12:50:31 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:50:31 STATE: test-backend-node.js event: image +2024-02-15 12:50:31 STATE: test-backend-node.js event: detect +2024-02-15 12:50:31 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg face similarity +2024-02-15 12:50:31 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} +2024-02-15 12:50:31 DATA:  test-backend-node.js result: performance: load: null total: 260 +2024-02-15 12:50:31 STATE: test-backend-node.js passed: face descriptor +2024-02-15 12:50:31 STATE: test-backend-node.js passed: face similarity {"similarity":[1,0.44727441595492046,0.556793560189727],"descriptors":[1024,1024,1024]} +2024-02-15 12:50:31 INFO:  test-backend-node.js test object +2024-02-15 12:50:31 STATE: test-backend-node.js start object +2024-02-15 12:50:31 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:31 STATE: test-backend-node.js event: image +2024-02-15 12:50:31 STATE: test-backend-node.js event: detect +2024-02-15 12:50:31 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg object +2024-02-15 12:50:31 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:50:31 DATA:  test-backend-node.js result: performance: load: null total: 289 +2024-02-15 12:50:31 STATE: test-backend-node.js passed: centernet +2024-02-15 12:50:31 STATE: test-backend-node.js start object +2024-02-15 12:50:33 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:33 STATE: test-backend-node.js event: image +2024-02-15 12:50:33 STATE: test-backend-node.js event: detect +2024-02-15 12:50:33 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg object +2024-02-15 12:50:33 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 3 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:50:33 DATA:  test-backend-node.js result: performance: load: null total: 285 +2024-02-15 12:50:33 STATE: test-backend-node.js passed: nanodet +2024-02-15 12:50:33 INFO:  test-backend-node.js test sensitive +2024-02-15 12:50:33 STATE: test-backend-node.js start sensitive +2024-02-15 12:50:33 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:33 STATE: test-backend-node.js event: image +2024-02-15 12:50:34 STATE: test-backend-node.js event: detect +2024-02-15 12:50:34 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg sensitive +2024-02-15 12:50:34 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:50:34 DATA:  test-backend-node.js result: performance: load: null total: 255 +2024-02-15 12:50:34 STATE: test-backend-node.js passed: sensitive result match +2024-02-15 12:50:34 STATE: test-backend-node.js passed: sensitive face result match +2024-02-15 12:50:34 STATE: test-backend-node.js passed: sensitive face emotion result [{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}] +2024-02-15 12:50:34 STATE: test-backend-node.js passed: sensitive body result match +2024-02-15 12:50:34 STATE: test-backend-node.js passed: sensitive hand result match +2024-02-15 12:50:34 INFO:  test-backend-node.js test body +2024-02-15 12:50:34 STATE: test-backend-node.js start blazepose +2024-02-15 12:50:42 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:42 STATE: test-backend-node.js event: image +2024-02-15 12:50:43 STATE: test-backend-node.js event: detect +2024-02-15 12:50:43 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg blazepose +2024-02-15 12:50:43 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.99,"keypoints":39} +2024-02-15 12:50:43 DATA:  test-backend-node.js result: performance: load: null total: 362 +2024-02-15 12:50:43 STATE: test-backend-node.js passed: blazepose +2024-02-15 12:50:43 STATE: test-backend-node.js start efficientpose +2024-02-15 12:50:45 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:45 STATE: test-backend-node.js event: image +2024-02-15 12:50:45 STATE: test-backend-node.js event: detect +2024-02-15 12:50:45 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg efficientpose +2024-02-15 12:50:45 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.75,"keypoints":13} +2024-02-15 12:50:45 DATA:  test-backend-node.js result: performance: load: null total: 309 +2024-02-15 12:50:45 STATE: test-backend-node.js passed: efficientpose +2024-02-15 12:50:45 STATE: test-backend-node.js start posenet +2024-02-15 12:50:47 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:47 STATE: test-backend-node.js event: image +2024-02-15 12:50:47 STATE: test-backend-node.js event: detect +2024-02-15 12:50:47 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg posenet +2024-02-15 12:50:47 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.96,"keypoints":16} +2024-02-15 12:50:47 DATA:  test-backend-node.js result: performance: load: null total: 241 +2024-02-15 12:50:47 STATE: test-backend-node.js passed: posenet +2024-02-15 12:50:47 STATE: test-backend-node.js start movenet +2024-02-15 12:50:47 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:47 STATE: test-backend-node.js event: image +2024-02-15 12:50:47 STATE: test-backend-node.js event: detect +2024-02-15 12:50:47 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg movenet +2024-02-15 12:50:47 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:50:47 DATA:  test-backend-node.js result: performance: load: null total: 240 +2024-02-15 12:50:47 STATE: test-backend-node.js passed: movenet +2024-02-15 12:50:47 INFO:  test-backend-node.js test face matching +2024-02-15 12:50:47 STATE: test-backend-node.js passed: face database 40 +2024-02-15 12:50:47 STATE: test-backend-node.js passed: face match {"first":{"index":4,"similarity":0.7827852251220577}} {"second":{"index":4,"similarity":0.5002052057057577}} {"third":{"index":4,"similarity":0.5401588464054732}} +2024-02-15 12:50:47 INFO:  test-backend-node.js test face similarity alternative +2024-02-15 12:50:47 STATE: test-backend-node.js start face embeddings +2024-02-15 12:50:49 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:49 STATE: test-backend-node.js event: image +2024-02-15 12:50:49 STATE: test-backend-node.js event: detect +2024-02-15 12:50:49 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face embeddings +2024-02-15 12:50:49 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:50:49 DATA:  test-backend-node.js result: performance: load: null total: 315 +2024-02-15 12:50:49 STATE: test-backend-node.js passed: mobilefacenet {"embedding":192} +2024-02-15 12:50:49 STATE: test-backend-node.js start face embeddings +2024-02-15 12:50:53 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:53 STATE: test-backend-node.js event: image +2024-02-15 12:50:53 STATE: test-backend-node.js event: detect +2024-02-15 12:50:53 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face embeddings +2024-02-15 12:50:53 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:50:53 DATA:  test-backend-node.js result: performance: load: null total: 298 +2024-02-15 12:50:53 STATE: test-backend-node.js passed: insightface {"embedding":512} +2024-02-15 12:50:53 INFO:  test-backend-node.js test face attention +2024-02-15 12:50:53 STATE: test-backend-node.js start face attention +2024-02-15 12:50:54 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:54 STATE: test-backend-node.js event: image +2024-02-15 12:50:54 STATE: test-backend-node.js event: detect +2024-02-15 12:50:54 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg face attention +2024-02-15 12:50:54 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:50:54 DATA:  test-backend-node.js result: performance: load: null total: 272 +2024-02-15 12:50:54 STATE: test-backend-node.js passed: face attention +2024-02-15 12:50:54 INFO:  test-backend-node.js test detectors +2024-02-15 12:50:54 STATE: test-backend-node.js start detectors +2024-02-15 12:50:56 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:56 STATE: test-backend-node.js event: image +2024-02-15 12:50:56 STATE: test-backend-node.js event: detect +2024-02-15 12:50:56 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg detectors +2024-02-15 12:50:56 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:50:56 DATA:  test-backend-node.js result: performance: load: null total: 126 +2024-02-15 12:50:56 STATE: test-backend-node.js passed: detector result face match +2024-02-15 12:50:56 STATE: test-backend-node.js passed: detector result hand match +2024-02-15 12:50:56 INFO:  test-backend-node.js test: multi-instance +2024-02-15 12:50:56 STATE: test-backend-node.js start multi instance +2024-02-15 12:50:56 STATE: test-backend-node.js event: image +2024-02-15 12:50:56 STATE: test-backend-node.js event: detect +2024-02-15 12:50:56 STATE: test-backend-node.js passed: detect: random multi instance +2024-02-15 12:50:56 DATA:  test-backend-node.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0} +2024-02-15 12:50:56 DATA:  test-backend-node.js result: performance: load: null total: 118 +2024-02-15 12:50:56 INFO:  test-backend-node.js test: first instance +2024-02-15 12:50:56 STATE: test-backend-node.js start multi instance +2024-02-15 12:50:56 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg multi instance +2024-02-15 12:50:57 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:50:57 DATA:  test-backend-node.js result: performance: load: null total: 120 +2024-02-15 12:50:57 INFO:  test-backend-node.js test: second instance +2024-02-15 12:50:57 STATE: test-backend-node.js start multi instance +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg multi instance +2024-02-15 12:50:57 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:50:57 DATA:  test-backend-node.js result: performance: load: null total: 120 +2024-02-15 12:50:57 INFO:  test-backend-node.js test: concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js start concurrent +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:50:57 STATE: test-backend-node.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:50:57 STATE: test-backend-node.js event: image +2024-02-15 12:50:57 STATE: test-backend-node.js event: image +2024-02-15 12:50:57 STATE: test-backend-node.js event: image +2024-02-15 12:50:59 STATE: test-backend-node.js event: detect +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-upper.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js event: detect +2024-02-15 12:50:59 STATE: test-backend-node.js event: detect +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-face.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 STATE: test-backend-node.js passed: detect: samples/in/ai-body.jpg concurrent +2024-02-15 12:50:59 DATA:  test-backend-node.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:50:59 DATA:  test-backend-node.js result: performance: load: null total: 1077 +2024-02-15 12:50:59 INFO:  test-backend-node.js test: monkey-patch +2024-02-15 12:50:59 STATE: test-backend-node.js event: image +2024-02-15 12:50:59 STATE: test-backend-node.js event: detect +2024-02-15 12:50:59 STATE: test-backend-node.js passed: monkey patch +2024-02-15 12:51:00 STATE: test-backend-node.js passed: segmentation [262144] +2024-02-15 12:51:00 STATE: test-backend-node.js passeed: equal usage +2024-02-15 12:51:00 INFO:  test-backend-node.js test: input compare +2024-02-15 12:51:00 STATE: test-backend-node.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:00 STATE: test-backend-node.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:00 STATE: test-backend-node.js passed: image compare 0 23.275441687091504 +2024-02-15 12:51:00 INFO:  test-backend-node.js events: {"image":29,"detect":29,"warmup":2} +2024-02-15 12:51:00 INFO:  test-backend-node.js tensors 14855 +2024-02-15 12:51:00 INFO:  test-backend-node.js test complete: 35125 ms +2024-02-15 12:51:00 INFO:  +2024-02-15 12:51:00 INFO:  test-backend-node-gpu.js start +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js test: configuration validation +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: configuration default validation [] +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js test: model load +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: models loaded 11 11 [{"name":"blazeface","loaded":true,"size":538928,"url":"file://models/blazeface.json"},{"name":"antispoof","loaded":true,"size":853098,"url":"file://models/antispoof.json"},{"name":"liveness","loaded":true,"size":592976,"url":"file://models/liveness.json"},{"name":"emotion","loaded":true,"size":820516,"url":"file://models/emotion.json"},{"name":"facemesh","loaded":true,"size":1477958,"url":"file://models/facemesh.json"},{"name":"handskeleton","loaded":true,"size":0,"url":"file://models/handlandmark-lite.json"},{"name":"iris","loaded":true,"size":2599092,"url":"file://models/iris.json"},{"name":"handtrack","loaded":true,"size":2964837,"url":"file://models/handtrack.json"},{"name":"centernet","loaded":true,"size":4030290,"url":"file://models/centernet.json"},{"name":"movenet","loaded":true,"size":4650216,"url":"file://models/movenet-lightning.json"},{"name":"faceres","loaded":true,"size":6978814,"url":"file://models/faceres.json"}] +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js memory: {"memory":{"unreliable":true,"numTensors":1785,"numDataBuffers":1785,"numBytes":56431460}} +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js state: {"state":{"registeredVariables":{},"nextTapeNodeId":0,"numBytes":56431460,"numTensors":1785,"numStringTensors":0,"numDataBuffers":1785,"gradientDepth":0,"kernelDepth":0,"scopeStack":[],"numDataMovesStack":[],"nextScopeId":0,"tensorInfo":{},"profiling":false,"activeProfile":{"newBytes":0,"newTensors":0,"peakBytes":0,"kernels":[],"result":null,"kernelNames":[]}}} +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js test: warmup +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: create human +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js human version: 3.2.1 +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js platform: agent: +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js tfjs version: 4.17.0 +2024-02-15 12:51:01 INFO:  test-backend-node-gpu.js env: {"browser":false,"node":true,"platform":"","agent":"","backends":["cpu","tensorflow"],"initial":false,"tfjs":{"version":"4.17.0"},"offscreen":false,"perfadd":false,"tensorflow":{"version":"2.9.1","gpu":false},"wasm":{"supported":true,"backend":false},"webgl":{"supported":false,"backend":false},"webgpu":{"supported":false,"backend":false},"cpu":{"flags":[]},"kernels":172} +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: set backend: tensorflow +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js tensors 1785 +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js result: defined models: 11 loaded models: 11 +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: load models 11 +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: warmup: none default +2024-02-15 12:51:01 DATA:  test-backend-node-gpu.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} +2024-02-15 12:51:01 DATA:  test-backend-node-gpu.js result: performance: load: null total: null +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: warmup none result match +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js event: warmup +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: warmup: face default +2024-02-15 12:51:01 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.42,"keypoints":4} +2024-02-15 12:51:01 DATA:  test-backend-node-gpu.js result: performance: load: null total: 419 +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js passed: warmup face result match +2024-02-15 12:51:01 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js event: warmup +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: warmup: body default +2024-02-15 12:51:02 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:02 DATA:  test-backend-node-gpu.js result: performance: load: null total: 322 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: warmup body result match +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js details: {"face":{"boxScore":0.92,"faceScore":1,"age":23.7,"gender":"female","genderScore":0.97},"emotion":[{"score":0.63,"emotion":"angry"},{"score":0.22,"emotion":"fear"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.52,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"face":0,"gesture":"mouth 10% open"},{"hand":0,"gesture":"pinky forward"},{"hand":0,"gesture":"thumb up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking left"},{"iris":0,"gesture":"looking up"}]} +2024-02-15 12:51:02 INFO:  test-backend-node-gpu.js test: details verification +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js start default +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg default +2024-02-15 12:51:02 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:02 DATA:  test-backend-node-gpu.js result: performance: load: null total: 305 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details face length 1 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details face score 1 0.93 1 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details face age/gender 23.7 female 0.97 2.34 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details face arrays 4 478 1024 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details face emotion 2 {"score":0.59,"emotion":"angry"} +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details face anti-spoofing 0.79 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details face liveness 0.83 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details body length 1 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details body 0.92 17 6 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details hand length 1 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details hand 0.51 0.73 point +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details hand arrays 21 5 7 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details gesture length 7 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details gesture first {"face":0,"gesture":"facing right"} +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details object length 1 +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: details object 0.72 person +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996928} +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:02 STATE: test-backend-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: float32 +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1371996928} +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js passed: tensor shape: [1200,1200,4] dtype: float32 +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:03 STATE: test-backend-node-gpu.js passed: tensor shape: [1,1200,1200,3] dtype: float32 +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js passed: tensor shape: [1200,1200,3] dtype: float32 +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js passed: tensor shape: [1,1200,1200,4] dtype: int32 +2024-02-15 12:51:04 INFO:  test-backend-node-gpu.js test default +2024-02-15 12:51:04 STATE: test-backend-node-gpu.js start async +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg async +2024-02-15 12:51:05 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:05 DATA:  test-backend-node-gpu.js result: performance: load: null total: 306 +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: default result face match 1 female 0.97 +2024-02-15 12:51:05 INFO:  test-backend-node-gpu.js test sync +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js start sync +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg sync +2024-02-15 12:51:05 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:05 DATA:  test-backend-node-gpu.js result: performance: load: null total: 303 +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: default sync 1 female 0.97 +2024-02-15 12:51:05 INFO:  test-backend-node-gpu.js test: image process +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: image input null [1,256,256,3] +2024-02-15 12:51:05 INFO:  test-backend-node-gpu.js test: image null +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js passed: invalid input could not convert input to tensor +2024-02-15 12:51:05 INFO:  test-backend-node-gpu.js test face similarity +2024-02-15 12:51:05 STATE: test-backend-node-gpu.js start face similarity +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face similarity +2024-02-15 12:51:06 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2024-02-15 12:51:06 DATA:  test-backend-node-gpu.js result: performance: load: null total: 290 +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js start face similarity +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg face similarity +2024-02-15 12:51:06 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:06 DATA:  test-backend-node-gpu.js result: performance: load: null total: 291 +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js start face similarity +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:51:06 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg face similarity +2024-02-15 12:51:07 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} +2024-02-15 12:51:07 DATA:  test-backend-node-gpu.js result: performance: load: null total: 263 +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js passed: face descriptor +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js passed: face similarity {"similarity":[1,0.44727441595492046,0.556793560189727],"descriptors":[1024,1024,1024]} +2024-02-15 12:51:07 INFO:  test-backend-node-gpu.js test object +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js start object +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg object +2024-02-15 12:51:07 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:07 DATA:  test-backend-node-gpu.js result: performance: load: null total: 286 +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js passed: centernet +2024-02-15 12:51:07 STATE: test-backend-node-gpu.js start object +2024-02-15 12:51:08 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:08 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:08 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:08 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg object +2024-02-15 12:51:08 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 3 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:08 DATA:  test-backend-node-gpu.js result: performance: load: null total: 284 +2024-02-15 12:51:08 STATE: test-backend-node-gpu.js passed: nanodet +2024-02-15 12:51:08 INFO:  test-backend-node-gpu.js test sensitive +2024-02-15 12:51:08 STATE: test-backend-node-gpu.js start sensitive +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg sensitive +2024-02-15 12:51:09 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:51:09 DATA:  test-backend-node-gpu.js result: performance: load: null total: 250 +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js passed: sensitive result match +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js passed: sensitive face result match +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js passed: sensitive face emotion result [{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}] +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js passed: sensitive body result match +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js passed: sensitive hand result match +2024-02-15 12:51:09 INFO:  test-backend-node-gpu.js test body +2024-02-15 12:51:09 STATE: test-backend-node-gpu.js start blazepose +2024-02-15 12:51:17 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:17 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:17 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:17 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg blazepose +2024-02-15 12:51:17 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.99,"keypoints":39} +2024-02-15 12:51:17 DATA:  test-backend-node-gpu.js result: performance: load: null total: 337 +2024-02-15 12:51:17 STATE: test-backend-node-gpu.js passed: blazepose +2024-02-15 12:51:17 STATE: test-backend-node-gpu.js start efficientpose +2024-02-15 12:51:18 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:18 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:19 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:19 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg efficientpose +2024-02-15 12:51:19 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.75,"keypoints":13} +2024-02-15 12:51:19 DATA:  test-backend-node-gpu.js result: performance: load: null total: 307 +2024-02-15 12:51:19 STATE: test-backend-node-gpu.js passed: efficientpose +2024-02-15 12:51:19 STATE: test-backend-node-gpu.js start posenet +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg posenet +2024-02-15 12:51:20 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.96,"keypoints":16} +2024-02-15 12:51:20 DATA:  test-backend-node-gpu.js result: performance: load: null total: 238 +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js passed: posenet +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js start movenet +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:20 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:21 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:21 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg movenet +2024-02-15 12:51:21 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:51:21 DATA:  test-backend-node-gpu.js result: performance: load: null total: 244 +2024-02-15 12:51:21 STATE: test-backend-node-gpu.js passed: movenet +2024-02-15 12:51:21 INFO:  test-backend-node-gpu.js test face matching +2024-02-15 12:51:21 STATE: test-backend-node-gpu.js passed: face database 40 +2024-02-15 12:51:21 STATE: test-backend-node-gpu.js passed: face match {"first":{"index":4,"similarity":0.7827852251220577}} {"second":{"index":4,"similarity":0.5002052057057577}} {"third":{"index":4,"similarity":0.5401588464054732}} +2024-02-15 12:51:21 INFO:  test-backend-node-gpu.js test face similarity alternative +2024-02-15 12:51:21 STATE: test-backend-node-gpu.js start face embeddings +2024-02-15 12:51:23 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:23 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:23 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:23 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face embeddings +2024-02-15 12:51:23 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:51:23 DATA:  test-backend-node-gpu.js result: performance: load: null total: 285 +2024-02-15 12:51:23 STATE: test-backend-node-gpu.js passed: mobilefacenet {"embedding":192} +2024-02-15 12:51:23 STATE: test-backend-node-gpu.js start face embeddings +2024-02-15 12:51:26 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:26 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:26 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:26 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face embeddings +2024-02-15 12:51:26 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:51:26 DATA:  test-backend-node-gpu.js result: performance: load: null total: 287 +2024-02-15 12:51:26 STATE: test-backend-node-gpu.js passed: insightface {"embedding":512} +2024-02-15 12:51:26 INFO:  test-backend-node-gpu.js test face attention +2024-02-15 12:51:26 STATE: test-backend-node-gpu.js start face attention +2024-02-15 12:51:27 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:27 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:27 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:27 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg face attention +2024-02-15 12:51:27 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:51:27 DATA:  test-backend-node-gpu.js result: performance: load: null total: 273 +2024-02-15 12:51:27 STATE: test-backend-node-gpu.js passed: face attention +2024-02-15 12:51:27 INFO:  test-backend-node-gpu.js test detectors +2024-02-15 12:51:27 STATE: test-backend-node-gpu.js start detectors +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg detectors +2024-02-15 12:51:29 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:51:29 DATA:  test-backend-node-gpu.js result: performance: load: null total: 128 +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js passed: detector result face match +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js passed: detector result hand match +2024-02-15 12:51:29 INFO:  test-backend-node-gpu.js test: multi-instance +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js start multi instance +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js passed: detect: random multi instance +2024-02-15 12:51:29 DATA:  test-backend-node-gpu.js result: face: 0 body: 1 hand: 0 gesture: 0 object: 0 person: 0 {} {} {"score":0,"keypoints":0} +2024-02-15 12:51:29 DATA:  test-backend-node-gpu.js result: performance: load: null total: 116 +2024-02-15 12:51:29 INFO:  test-backend-node-gpu.js test: first instance +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js start multi instance +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg multi instance +2024-02-15 12:51:29 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:51:29 DATA:  test-backend-node-gpu.js result: performance: load: null total: 122 +2024-02-15 12:51:29 INFO:  test-backend-node-gpu.js test: second instance +2024-02-15 12:51:29 STATE: test-backend-node-gpu.js start multi instance +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg multi instance +2024-02-15 12:51:30 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:51:30 DATA:  test-backend-node-gpu.js result: performance: load: null total: 120 +2024-02-15 12:51:30 INFO:  test-backend-node-gpu.js test: concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js start concurrent +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151289024} +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:30 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1051 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1051 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-upper.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 0 gesture: 0 object: 0 person: 1 {"score":0.96,"gender":"unknown"} {} {"score":0.75,"keypoints":7} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1051 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1052 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1052 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-face.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.91,"gender":"unknown"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1052 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1052 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1052 +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js passed: detect: samples/in/ai-body.jpg concurrent +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: face: 1 body: 1 hand: 1 gesture: 0 object: 0 person: 1 {"score":0.93,"gender":"unknown"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:51:31 DATA:  test-backend-node-gpu.js result: performance: load: null total: 1052 +2024-02-15 12:51:31 INFO:  test-backend-node-gpu.js test: monkey-patch +2024-02-15 12:51:31 STATE: test-backend-node-gpu.js event: image +2024-02-15 12:51:32 STATE: test-backend-node-gpu.js event: detect +2024-02-15 12:51:32 STATE: test-backend-node-gpu.js passed: monkey patch +2024-02-15 12:51:33 STATE: test-backend-node-gpu.js passed: segmentation [262144] +2024-02-15 12:51:33 STATE: test-backend-node-gpu.js passeed: equal usage +2024-02-15 12:51:33 INFO:  test-backend-node-gpu.js test: input compare +2024-02-15 12:51:33 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34696120} +2024-02-15 12:51:33 STATE: test-backend-node-gpu.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1004796864} +2024-02-15 12:51:33 STATE: test-backend-node-gpu.js passed: image compare 0 23.275441687091504 +2024-02-15 12:51:33 INFO:  test-backend-node-gpu.js events: {"image":29,"detect":29,"warmup":2} +2024-02-15 12:51:33 INFO:  test-backend-node-gpu.js tensors 14855 +2024-02-15 12:51:33 INFO:  test-backend-node-gpu.js test complete: 32681 ms +2024-02-15 12:51:33 INFO:  +2024-02-15 12:51:33 INFO:  test-backend-node-wasm.js start +2024-02-15 12:51:34 DATA:  test-backend-node-wasm.js stdout: 2024-02-15 12:51:34 INFO:  { supported: true, backend: true, simd: undefined, multithread: undefined } https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@4.17.0/dist/ +2024-02-15 12:51:34 STATE: test-backend-node-wasm.js passed: model server: https://vladmandic.github.io/human-models/models/ +2024-02-15 12:51:34 INFO:  test-backend-node-wasm.js test: configuration validation +2024-02-15 12:51:34 STATE: test-backend-node-wasm.js passed: configuration default validation [] +2024-02-15 12:51:34 STATE: test-backend-node-wasm.js passed: configuration invalid validation [{"reason":"unknown property","where":"config.invalid = true"}] +2024-02-15 12:51:34 INFO:  test-backend-node-wasm.js test: model load +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js passed: models loaded 11 11 [{"name":"liveness","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/liveness.json"},{"name":"emotion","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/emotion.json"},{"name":"blazeface","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/blazeface.json"},{"name":"antispoof","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/antispoof.json"},{"name":"facemesh","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/facemesh.json"},{"name":"iris","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/iris.json"},{"name":"centernet","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/centernet.json"},{"name":"handskeleton","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/handlandmark-lite.json"},{"name":"movenet","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/movenet-lightning.json"},{"name":"faceres","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/faceres.json"},{"name":"handtrack","loaded":true,"size":0,"url":"https://vladmandic.github.io/human-models/models/handtrack.json"}] +2024-02-15 12:51:36 INFO:  test-backend-node-wasm.js memory: {"memory":{"unreliable":false,"numTensors":1785,"numDataBuffers":1785,"numBytes":56431460}} +2024-02-15 12:51:36 INFO:  test-backend-node-wasm.js state: {"state":{"registeredVariables":{},"nextTapeNodeId":0,"numBytes":56431460,"numTensors":1785,"numStringTensors":0,"numDataBuffers":1785,"gradientDepth":0,"kernelDepth":0,"scopeStack":[],"numDataMovesStack":[],"nextScopeId":0,"tensorInfo":{},"profiling":false,"activeProfile":{"newBytes":0,"newTensors":0,"peakBytes":0,"kernels":[],"result":null,"kernelNames":[]}}} +2024-02-15 12:51:36 INFO:  test-backend-node-wasm.js test: warmup +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js passed: create human +2024-02-15 12:51:36 INFO:  test-backend-node-wasm.js human version: 3.2.1 +2024-02-15 12:51:36 INFO:  test-backend-node-wasm.js platform: agent: +2024-02-15 12:51:36 INFO:  test-backend-node-wasm.js tfjs version: 4.17.0 +2024-02-15 12:51:36 INFO:  test-backend-node-wasm.js env: {"browser":false,"node":true,"platform":"","agent":"","backends":["wasm"],"initial":false,"tfjs":{"version":"4.17.0"},"offscreen":false,"perfadd":false,"tensorflow":{},"wasm":{"supported":true,"backend":true,"simd":true,"multithread":false},"webgl":{"supported":false,"backend":false},"webgpu":{"supported":false,"backend":false},"cpu":{"flags":[]},"kernels":174} +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js passed: set backend: wasm +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js tensors 1785 +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js result: defined models: 11 loaded models: 11 +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js passed: load models 11 +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js passed: warmup: none default +2024-02-15 12:51:36 DATA:  test-backend-node-wasm.js result: face: 0 body: 0 hand: 0 gesture: 0 object: 0 person: 0 {} {} {} +2024-02-15 12:51:36 DATA:  test-backend-node-wasm.js result: performance: load: null total: null +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js passed: warmup none result match +2024-02-15 12:51:36 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js event: warmup +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js passed: warmup: face default +2024-02-15 12:51:37 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2024-02-15 12:51:37 DATA:  test-backend-node-wasm.js result: performance: load: null total: 450 +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js passed: warmup face result match +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js event: warmup +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js passed: warmup: body default +2024-02-15 12:51:37 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:37 DATA:  test-backend-node-wasm.js result: performance: load: null total: 347 +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js passed: warmup body result match +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js details: {"face":{"boxScore":0.93,"faceScore":1,"age":23.7,"gender":"female","genderScore":0.97},"emotion":[{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}],"body":{"score":0.92,"keypoints":17},"hand":{"boxScore":0.51,"fingerScore":0.73,"keypoints":21},"gestures":[{"face":0,"gesture":"facing right"},{"face":0,"gesture":"mouth 21% open"},{"hand":0,"gesture":"pinky forward"},{"hand":0,"gesture":"thumb up"},{"hand":0,"gesture":"open palm"},{"iris":0,"gesture":"looking left"},{"iris":0,"gesture":"looking up"}]} +2024-02-15 12:51:37 INFO:  test-backend-node-wasm.js test: details verification +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js start default +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:37 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg default +2024-02-15 12:51:38 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:38 DATA:  test-backend-node-wasm.js result: performance: load: null total: 364 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details face length 1 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details face score 1 0.93 1 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details face age/gender 23.7 female 0.97 2.34 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details face arrays 4 478 1024 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details face emotion 2 {"score":0.59,"emotion":"angry"} +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details face anti-spoofing 0.79 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details face liveness 0.83 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details body length 1 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details body 0.92 17 6 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details hand length 1 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details hand 0.51 0.73 point +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details hand arrays 21 5 7 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details gesture length 7 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details gesture first {"face":0,"gesture":"facing right"} +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details object length 1 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: details object 0.72 person +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1413675264} +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: float32 +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,4] {"checksum":1413675264} +2024-02-15 12:51:38 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js passed: tensor shape: [1200,1200,4] dtype: float32 +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js passed: tensor shape: [1,1200,1200,3] dtype: float32 +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:39 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:40 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:40 STATE: test-backend-node-wasm.js passed: tensor shape: [1200,1200,3] dtype: float32 +2024-02-15 12:51:40 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,4] {"checksum":1371996871} +2024-02-15 12:51:40 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:40 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:40 STATE: test-backend-node-wasm.js passed: tensor shape: [1,1200,1200,4] dtype: int32 +2024-02-15 12:51:40 INFO:  test-backend-node-wasm.js test default +2024-02-15 12:51:40 STATE: test-backend-node-wasm.js start async +2024-02-15 12:51:43 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:43 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:43 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:43 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg async +2024-02-15 12:51:43 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:43 DATA:  test-backend-node-wasm.js result: performance: load: null total: 374 +2024-02-15 12:51:43 STATE: test-backend-node-wasm.js passed: default result face match 1 female 0.97 +2024-02-15 12:51:43 INFO:  test-backend-node-wasm.js test sync +2024-02-15 12:51:43 STATE: test-backend-node-wasm.js start sync +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg sync +2024-02-15 12:51:46 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:46 DATA:  test-backend-node-wasm.js result: performance: load: null total: 379 +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js passed: default sync 1 female 0.97 +2024-02-15 12:51:46 INFO:  test-backend-node-wasm.js test: image process +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js passed: image input null [1,256,256,3] +2024-02-15 12:51:46 INFO:  test-backend-node-wasm.js test: image null +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js passed: invalid input could not convert input to tensor +2024-02-15 12:51:46 INFO:  test-backend-node-wasm.js test face similarity +2024-02-15 12:51:46 STATE: test-backend-node-wasm.js start face similarity +2024-02-15 12:51:49 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2024-02-15 12:51:49 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:49 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:49 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-face.jpg face similarity +2024-02-15 12:51:49 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 6 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.82,"class":"person"} {"score":0.47,"keypoints":3} +2024-02-15 12:51:49 DATA:  test-backend-node-wasm.js result: performance: load: null total: 375 +2024-02-15 12:51:49 STATE: test-backend-node-wasm.js start face similarity +2024-02-15 12:51:49 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:49 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg face similarity +2024-02-15 12:51:50 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:50 DATA:  test-backend-node-wasm.js result: performance: load: null total: 296 +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js start face similarity +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-upper.jpg [1,720,688,3] {"checksum":151155104} +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-upper.jpg face similarity +2024-02-15 12:51:50 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 0 gesture: 4 object: 1 person: 1 {"score":1,"age":23.5,"gender":"female"} {"score":0.71,"class":"person"} {"score":0.75,"keypoints":7} +2024-02-15 12:51:50 DATA:  test-backend-node-wasm.js result: performance: load: null total: 273 +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js passed: face descriptor +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js passed: face similarity {"similarity":[1,0.4472741837136387,0.5567931378245533],"descriptors":[1024,1024,1024]} +2024-02-15 12:51:50 INFO:  test-backend-node-wasm.js test object +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js start object +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:50 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:51 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:51 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg object +2024-02-15 12:51:51 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 1 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.72,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:51 DATA:  test-backend-node-wasm.js result: performance: load: null total: 293 +2024-02-15 12:51:51 STATE: test-backend-node-wasm.js passed: centernet +2024-02-15 12:51:51 STATE: test-backend-node-wasm.js start object +2024-02-15 12:51:53 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:53 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:53 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:53 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg object +2024-02-15 12:51:53 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 1 gesture: 7 object: 3 person: 1 {"score":1,"age":23.7,"gender":"female"} {"score":0.86,"class":"person"} {"score":0.92,"keypoints":17} +2024-02-15 12:51:53 DATA:  test-backend-node-wasm.js result: performance: load: null total: 339 +2024-02-15 12:51:53 STATE: test-backend-node-wasm.js passed: nanodet +2024-02-15 12:51:53 INFO:  test-backend-node-wasm.js test sensitive +2024-02-15 12:51:53 STATE: test-backend-node-wasm.js start sensitive +2024-02-15 12:51:55 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:51:55 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg sensitive +2024-02-15 12:51:56 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:51:56 DATA:  test-backend-node-wasm.js result: performance: load: null total: 266 +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js passed: sensitive result match +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js passed: sensitive face result match +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js passed: sensitive face emotion result [{"score":0.59,"emotion":"angry"},{"score":0.29,"emotion":"fear"}] +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js passed: sensitive body result match +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js passed: sensitive hand result match +2024-02-15 12:51:56 INFO:  test-backend-node-wasm.js test body +2024-02-15 12:51:56 STATE: test-backend-node-wasm.js start blazepose +2024-02-15 12:52:04 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:52:04 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:52:05 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:52:05 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg blazepose +2024-02-15 12:52:05 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.99,"keypoints":39} +2024-02-15 12:52:05 DATA:  test-backend-node-wasm.js result: performance: load: null total: 422 +2024-02-15 12:52:05 STATE: test-backend-node-wasm.js passed: blazepose +2024-02-15 12:52:05 STATE: test-backend-node-wasm.js start efficientpose +2024-02-15 12:52:06 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:52:06 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:52:07 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:52:07 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg efficientpose +2024-02-15 12:52:07 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.75,"keypoints":13} +2024-02-15 12:52:07 DATA:  test-backend-node-wasm.js result: performance: load: null total: 668 +2024-02-15 12:52:07 STATE: test-backend-node-wasm.js passed: efficientpose +2024-02-15 12:52:07 STATE: test-backend-node-wasm.js start posenet +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg posenet +2024-02-15 12:52:09 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.96,"keypoints":16} +2024-02-15 12:52:09 DATA:  test-backend-node-wasm.js result: performance: load: null total: 254 +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: posenet +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js start movenet +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-body.jpg [1,1200,1200,3] {"checksum":1038921856} +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-body.jpg movenet +2024-02-15 12:52:09 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 9 object: 0 person: 1 {"score":1,"age":23.7,"gender":"female"} {} {"score":0.92,"keypoints":17} +2024-02-15 12:52:09 DATA:  test-backend-node-wasm.js result: performance: load: null total: 203 +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: movenet +2024-02-15 12:52:09 INFO:  test-backend-node-wasm.js test face matching +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: face database 40 +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js passed: face match {"first":{"index":4,"similarity":0.7827852754786533}} {"second":{"index":4,"similarity":0.5002051178899982}} {"third":{"index":4,"similarity":0.5401586736511599}} +2024-02-15 12:52:09 INFO:  test-backend-node-wasm.js test face similarity alternative +2024-02-15 12:52:09 STATE: test-backend-node-wasm.js start face embeddings +2024-02-15 12:52:12 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2024-02-15 12:52:12 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:52:13 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:52:13 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-face.jpg face embeddings +2024-02-15 12:52:13 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:52:13 DATA:  test-backend-node-wasm.js result: performance: load: null total: 288 +2024-02-15 12:52:13 STATE: test-backend-node-wasm.js passed: mobilefacenet {"embedding":192} +2024-02-15 12:52:13 STATE: test-backend-node-wasm.js start face embeddings +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js event: detect +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js passed: detect: samples/in/ai-face.jpg face embeddings +2024-02-15 12:52:17 DATA:  test-backend-node-wasm.js result: face: 1 body: 1 hand: 2 gesture: 8 object: 0 person: 1 {"score":1,"age":23.5,"gender":"female"} {} {"score":0.47,"keypoints":3} +2024-02-15 12:52:17 DATA:  test-backend-node-wasm.js result: performance: load: null total: 276 +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js passed: insightface {"embedding":512} +2024-02-15 12:52:17 INFO:  test-backend-node-wasm.js test face attention +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js start face attention +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js passed: load image: samples/in/ai-face.jpg [1,256,256,3] {"checksum":34697856} +2024-02-15 12:52:17 STATE: test-backend-node-wasm.js event: image +2024-02-15 12:52:18 ERROR: test-backend-node-wasm.js failed: testDetect face attention +2024-02-15 12:52:18 ERROR: test-backend-node-wasm.js uncaughtException {"name":"Error","message":"BatchMatMul for non non-float32 tensors not yet supported.","stack":["Error: BatchMatMul for non non-float32 tensors not yet supported."," at Object.batchMatMul [as kernelFunc] (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-backend-wasm@4.17.0_@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-backend-wasm/dist/tf-backend-wasm.node.js:1280:15)"," at kernelFunc (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4707:32)"," at /home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4767:27"," at Engine.scopedRun (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4572:23)"," at Engine.runKernelFunc (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4763:14)"," at Engine.runKernel (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-core/dist/tf-core.node.js:4636:21)"," at matMul_ (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-converter@4.17.0_@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:13411:19)"," at Object.matMul__op [as matMul] (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-converter@4.17.0_@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:12220:29)"," at executeOp$9 (/home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-converter@4.17.0_@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:29615:25)"," at /home/vlado/dev/human/node_modules/.pnpm/@tensorflow+tfjs-converter@4.17.0_@tensorflow+tfjs-core@4.17.0/node_modules/@tensorflow/tfjs-converter/dist/tf-converter.node.js:30195:50"]} +2024-02-15 12:52:18 STATE: all tests complete +2024-02-15 12:52:18 INFO:  status {"test":"../demo/nodejs/node.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/nodejs/node-simple.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/nodejs/node-event.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/nodejs/node-similarity.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/nodejs/node-canvas.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/nodejs/process-folder.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/multithread/node-multiprocess.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/facematch/node-match.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../demo/nodejs/node-bench.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"../test/test-node-emotion.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"test-node-load.js","passed":1,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"test-node-gear.js","passed":4,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"test-backend-node.js","passed":125,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"test-backend-node-gpu.js","passed":125,"failed":0} +2024-02-15 12:52:18 INFO:  status {"test":"test-backend-node-wasm.js","passed":92,"failed":1} +2024-02-15 12:52:18 INFO:  failures {"count":1} +2024-02-15 12:52:18 WARN:  failed {"test":"test-backend-node-wasm.js","message":["error",["failed:","testDetect face attention"]]} diff --git a/typedoc/assets/search.js b/typedoc/assets/search.js index 6e59737c..e6c4ad98 100644 --- a/typedoc/assets/search.js +++ b/typedoc/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA72da5PjtrGw/8vs181mcKMkf4vtXFwndlKxT/JWuVKnOBI0w7MSKZPUzK5T+e9vASClRrMbpKDN+RJvRo1uAI3rgwb4r4e2eesevvr5Xw8fq3r38JWQ6/cPdXm0D189/Ol8LOuH9w/n9vDw1cP2UHad7X7r//rhpT8eHt6Pf3z46u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t28ohvmh8gcfSfN3Zeofea4WLdcViYipMEuR5WHGpyz/GNRjb6qef7ooWc2wqHwUTL6RgLCu7Gngr2+M5XpZHDfVheA+Qy29IP2W5EBGxG7S3souTPUbbdd5md5yGPkMAzU6yPukQirK36K6IhkOaYQeWN/u0jTck0Xg6fiiRPUEP6YmHSuD9P82eb77Zp+c4ahzuhhV7YOXS4afHIYVmV7jEZCchv5Z8bb9YtHGPIl1ZHDy596dg5LLajDzpwrYuXyNh5/63pv2IX5WK3nLmutavtm0mEYYSdhJJY/h/vn84VScXaG8fvvr5n//+9/8HMn90PEb+AQA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA72da5PjtrGw/8vs181GuFEaf4vtXFwndlKxT/JWuVKnOBI0w7MUKZPUzK5T+e9vARClRrMbpKDN+eIdi41uEI3rgwb4r4eufesfvvr5Xw8fq2b38JWQm/cPTXmwD189/Ol0KJuH9w+nrn746mFbl31v+9/6Xz+8DIf64f3448NXDw//fj/qMEJedGzbph+603Zou4Smd7EY0Pr+4Vh2thku2bmaESupL3ZebddXbSq3764iGfq3bbOvnmdeIUhkaO9sf6qHlPaLRIb2figHm1I+CmToPnbt1vZ9SvtVZJn+whhVXAz8z/8Mn4/J3J/1f7hIJsx8GDPDvM5gmz5dU2NrHy4JFhgdc8hVsbJ5LZeU5Gj7kuB+28M+Zdc/zagctnlNqQ2PM/TuuvItpfj8PEPzoRy2LynVo0BOabzaZkj69yKRoX1fbu1PXVU2z6e6HGa6Qko40+Z///378jhnaxTK6WBst2+7Q9ls051AJLbMjlzp62BXNmX9+dekjatIhv7O9nauh7fLO/hI92tZV7uZPh7IZFho2mSDC48z9FaH8jmZ7VEgQ3dvnw+2GWYbA5LLsLRtD04wPTsYRXJKqamSVef8PKN1vdmnbXlI6b5IZOS7bstdSvf5eYZme0iXyPl5Tk23n5Kaz88zNL+V3eGU7CovEhnaj127r+q5idJZJEP/zg52myyZi0ROW62tTRbNKJDTO1Y72ya7xrPAM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SKXWqiC/MlPM0r2d4T33sv4QpNsjswg92+NNVkiqrhqsSwUQrhaGIEdsHMJrzoGIAizWVdzFXNoC6+91JCtifZq1pCUomSwgbBLlJDUoWSwsrJu8on1SgprGls9EJIuq/jDQAFJ5SKXcCFxHjHVqro5BHXIIf4SEh0uyyb5H/Rff6wL2Tb7vDStW/Vnjz7AvelWSw4ICAv4Rk0yRdPdbD9UB7is+mQ0RbsZubQPqE9JAmBomQp7dDu6za+EVfCpalkI9iGyR5bFO3BHtQd2mM8skWn/NiAraF1fWoc3wdpoWCp49AOZZ1aUEQnWfhsn7W4NQXKB4zkZkOrLgqI5Uh04JUtgQ7NCRTEPIrddyBvx5XReT92wXlqql9OKCHs2NmorJNr6oPdnaENHqGi4w7sbvWpmc6Donvf2BOop+OuHCz1nRHYLBQbUhTS4+t6YcNQbFtE13nEX604r1hYtnDq7fbUvaJQERi6odiByEVSuAtXY84K35dlu/70G5oCRt3AeT3FHlMYFUziWuE8jT1/H6VGyxJ4QIxlr6/u2nJ0HhaOheNERrLn+F7LrnKIL+pf4L42X3a22aELX+FkXbHgioqzBHk+z7jU5Y9xDsbW+um3v6LJHJvKh9HEEynoNdZtb2V3OMXT8qiiPpyvcOHmrSH9lOVCRMQu0N7KPk62ipbrXBm5ZJPYadgdGbZh+6TnWJa9RYdNNOyYDDuMvNmnbbwgifrT8UuL7BZ8SE/cdAIPEGp2g/TNPj3HYedwNazYAy4uHb67HFJodoZLDHYS8mvJBki9vVi0cI9CZdmd1cnBQQVDn9XjiMYud2JePmfCDt1vbfcRX0sVXQbNNa1fbddOQhQlbCSSxvD/fP9wrI4uUt8+fPXzP//97/8PHjFyre//AQA="; \ No newline at end of file diff --git a/typedoc/classes/Env.html b/typedoc/classes/Env.html index 10463c21..cbf65f55 100644 --- a/typedoc/classes/Env.html +++ b/typedoc/classes/Env.html @@ -1,4 +1,4 @@ -Env | @vladmandic/human - v3.2.0

Env class that holds detected capabilities

+Env | @vladmandic/human - v3.2.1

Env class that holds detected capabilities

Constructors

Properties

agent backends @@ -41,4 +41,4 @@

Type declaration

  • adapter: undefined | GPUAdapterInfo
  • backend: undefined | boolean
  • supported: undefined | boolean
worker: boolean

Running in WebWorker thread

Accessors

Methods

  • update backend information

    Returns Promise<void>

\ No newline at end of file +

Returns void

\ No newline at end of file diff --git a/typedoc/classes/GraphModel.html b/typedoc/classes/GraphModel.html index 4967f6cf..b9b300b3 100644 --- a/typedoc/classes/GraphModel.html +++ b/typedoc/classes/GraphModel.html @@ -1,9 +1,9 @@ -GraphModel | @vladmandic/human - v3.2.0

Class GraphModel<ModelURL>

A tf.GraphModel is a directed, acyclic graph built from a +GraphModel | @vladmandic/human - v3.2.1

Class GraphModel<ModelURL>

A tf.GraphModel is a directed, acyclic graph built from a SavedModel GraphDef and allows inference execution.

A tf.GraphModel can only be created by loading from a model converted from a TensorFlow SavedModel using the command line converter tool and loaded via tf.loadGraphModel.

-

Doc

Type Parameters

  • ModelURL extends Url = string | io.IOHandler

Implements

  • InferenceModel

Constructors

Doc

Type Parameters

  • ModelURL extends Url = string | io.IOHandler

Implements

  • InferenceModel

Constructors

Accessors

Constructors

  • Type Parameters

    • ModelURL extends Url = string | IOHandler

    Parameters

    • modelUrl: ModelURL

      url for the model, or an io.IOHandler.

      -
    • Optional loadOptions: LoadOptions
    • Optional tfio: __module

    Returns GraphModel<ModelURL>

Accessors

  • get inputNodes(): string[]
  • Returns string[]

  • get inputs(): TensorInfo[]
  • Returns TensorInfo[]

  • get metadata(): {}
  • Returns {}

    • get modelSignature(): {}
    • Returns {}

      • get modelStructuredOutputKeys(): {}
      • Returns {}

        • get modelVersion(): string
        • Returns string

        • get outputNodes(): string[]
        • Returns string[]

        • get outputs(): TensorInfo[]
        • Returns TensorInfo[]

        • get weights(): NamedTensorsMap
        • Returns NamedTensorsMap

        Methods

        • Releases the memory used by the weight tensors and resourceManager.

          -

          Returns void

          Doc

        • Dispose intermediate tensors for model debugging mode (flag +

        • Optional loadOptions: LoadOptions
        • Optional tfio: __module

        Returns GraphModel<ModelURL>

        Accessors

        • get inputNodes(): string[]
        • Returns string[]

        • get inputs(): TensorInfo[]
        • Returns TensorInfo[]

        • get metadata(): {}
        • Returns {}

          • get modelSignature(): {}
          • Returns {}

            • get modelStructuredOutputKeys(): {}
            • Returns {}

              • get modelVersion(): string
              • Returns string

              • get outputNodes(): string[]
              • Returns string[]

              • get outputs(): TensorInfo[]
              • Returns TensorInfo[]

              • get weights(): NamedTensorsMap
              • Returns NamedTensorsMap

              Methods

              • Releases the memory used by the weight tensors and resourceManager.

                +

                Returns void

                Doc

              • Dispose intermediate tensors for model debugging mode (flag KEEP_INTERMEDIATE_TENSORS is true).

                -

                Returns void

                Doc

              • Executes inference for the model for given input tensors.

                +

                Returns void

                Doc

              • Executes inference for the model for given input tensors.

                Parameters

                • inputs: Tensor<Rank> | Tensor<Rank>[] | NamedTensorMap

                  tensor, tensor array or tensor map of the inputs for the model, keyed by the input node names.

                • Optional outputs: string | string[]

                  output node name from the TensorFlow model, if no @@ -38,7 +38,7 @@ are provided and there is only one default output, otherwise return a tensor array. The order of the tensor array is the same as the outputs if provided, otherwise the order of outputNodes attribute of the model.

                  -

                  Doc

              • Executes inference for the model for given input tensors in async +

                Doc

              • Executes inference for the model for given input tensors in async fashion, use this method when your model contains control flow ops.

                Parameters

                • inputs: Tensor<Rank> | Tensor<Rank>[] | NamedTensorMap

                  tensor, tensor array or tensor map of the inputs for the model, keyed by the input node names.

                  @@ -49,13 +49,13 @@

                Returns Promise<Tensor<Rank> | Tensor<Rank>[]>

                A Promise of single tensor if provided with a single output or no outputs are provided and there is only one default output, otherwise return a tensor map.

                -

                Doc

              • Get intermediate tensors for model debugging mode (flag +

                Doc

              • Get intermediate tensors for model debugging mode (flag KEEP_INTERMEDIATE_TENSORS is true).

                -

                Returns NamedTensorsMap

                Doc

              • Loads the model and weight files, construct the in memory weight map and +

                Returns NamedTensorsMap

                Doc

              • Loads the model and weight files, construct the in memory weight map and compile the inference graph.

                -

                Returns UrlIOHandler<ModelURL> extends IOHandlerSync
                    ? boolean
                    : Promise<boolean>

              • Synchronously construct the in memory weight map and +

                Returns UrlIOHandler<ModelURL> extends IOHandlerSync
                    ? boolean
                    : Promise<boolean>

              • Synchronously construct the in memory weight map and compile the inference graph.

                -

                Parameters

                • artifacts: ModelArtifacts

                Returns boolean

                Doc

              • Execute the inference for the input tensors.

                +

                Parameters

                • artifacts: ModelArtifacts

                Returns boolean

                Doc

              • Execute the inference for the input tensors.

                Parameters

                • inputs: Tensor<Rank> | Tensor<Rank>[] | NamedTensorMap
                • Optional config: ModelPredictConfig

                  Prediction configuration for specifying the batch size. Currently the batch size option is ignored for graph model.

                Returns Tensor<Rank> | Tensor<Rank>[] | NamedTensorMap

                Inference result tensors. If the model is converted and it @@ -76,7 +76,7 @@ is [1, 244, 244, 3], which represents the [batch, height, width, channel]. If we are provide a batched data of 100 images, the input tensor should be in the shape of [100, 244, 244, 3].

                -

                Doc

              • Execute the inference for the input tensors in async fashion, use this +

                Doc

              • Execute the inference for the input tensors in async fashion, use this method when your model contains control flow ops.

                Parameters

                • inputs: Tensor<Rank> | Tensor<Rank>[] | NamedTensorMap
                • Optional config: ModelPredictConfig

                  Prediction configuration for specifying the batch size. Currently the batch size option is ignored for graph model.

                  @@ -98,7 +98,7 @@

                  Doc

              • Save the configuration and/or weights of the GraphModel.

                +

                Doc

              • Save the configuration and/or weights of the GraphModel.

                An IOHandler is an object that has a save method of the proper signature defined. The save method manages the storing or transmission of serialized data ("artifacts") that represent the @@ -122,4 +122,4 @@

                Doc

              Returns Promise<SaveResult>

              A Promise of SaveResult, which summarizes the result of the saving, such as byte sizes of the saved artifacts for the model's topology and weight values.

              -

              Doc

              \ No newline at end of file +

              Doc

              \ No newline at end of file diff --git a/typedoc/classes/Human.html b/typedoc/classes/Human.html index 9e569961..fecf43e5 100644 --- a/typedoc/classes/Human.html +++ b/typedoc/classes/Human.html @@ -1,4 +1,4 @@ -Human | @vladmandic/human - v3.2.0

              Human* library main class

              +Human | @vladmandic/human - v3.2.1

              Human* library main class

              All methods and properties are available only as members of Human class

              • Configuration object definition: Config
              • @@ -151,4 +151,4 @@

                Returns

                instance of Human

              Returns Promise<undefined | Result>

              result - Result

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/classes/Tensor-1.html b/typedoc/classes/Tensor-1.html index a9c94d3b..b4afe0bb 100644 --- a/typedoc/classes/Tensor-1.html +++ b/typedoc/classes/Tensor-1.html @@ -1,4 +1,4 @@ -Tensor | @vladmandic/human - v3.2.0

              A tf.Tensor object represents an immutable, multidimensional array of +Tensor | @vladmandic/human - v3.2.1

              A tf.Tensor object represents an immutable, multidimensional array of numbers that has a shape and a data type.

              For performance reasons, functions that create tensors do not necessarily perform a copy of the data passed to them (e.g. if the data is passed as a @@ -6,7 +6,7 @@ a feature and is not supported. To avoid this behavior, use the tensor before changing the input data or create a copy with copy = tf.add(yourTensor, 0).

              See tf.tensor for details on how to create a tf.Tensor.

              -

              Doc

              Type Parameters

              Implements

              • TensorInfo

              Constructors

              Doc

              Type Parameters

              Implements

              • TensorInfo

              Constructors

              Properties

              dataId dtype id @@ -170,32 +170,32 @@ variable where zerosLike -

              Constructors

              • Type Parameters

                Parameters

                • shape: ShapeMap[R]
                • dtype: keyof DataTypeMap
                • dataId: object
                • id: number

                Returns Tensor<R>

              Properties

              dataId: object

              Id of the bucket holding the data for this tensor. Multiple arrays can +

              Constructors

              • Type Parameters

                Parameters

                • shape: ShapeMap[R]
                • dtype: keyof DataTypeMap
                • dataId: object
                • id: number

                Returns Tensor<R>

              Properties

              dataId: object

              Id of the bucket holding the data for this tensor. Multiple arrays can point to the same bucket (e.g. when calling array.reshape()).

              -
              dtype: keyof DataTypeMap

              The data type for the array.

              -
              id: number

              Unique id of this tensor.

              -
              kept: boolean

              Whether this tensor has been globally kept.

              -
              kerasMask?: Tensor<Rank>

              The keras mask that some keras layers attach to the tensor

              -
              rankType: R

              The rank type for the array (see Rank enum).

              -
              scopeId: number

              The id of the scope this tensor is being tracked in.

              -
              shape: ShapeMap[R]

              The shape of the tensor.

              -
              size: number

              Number of elements in the tensor.

              -
              strides: number[]

              Number of elements to skip in each dimension when indexing. See +

              dtype: keyof DataTypeMap

              The data type for the array.

              +
              id: number

              Unique id of this tensor.

              +
              kept: boolean

              Whether this tensor has been globally kept.

              +
              kerasMask?: Tensor<Rank>

              The keras mask that some keras layers attach to the tensor

              +
              rankType: R

              The rank type for the array (see Rank enum).

              +
              scopeId: number

              The id of the scope this tensor is being tracked in.

              +
              shape: ShapeMap[R]

              The shape of the tensor.

              +
              size: number

              Number of elements in the tensor.

              +
              strides: number[]

              Number of elements to skip in each dimension when indexing. See https://docs.scipy.org/doc/numpy/reference/generated/\ numpy.ndarray.strides.html

              -

              Accessors

              • get isDisposed(): boolean
              • Returns boolean

              • get rank(): number
              • Returns number

              Methods

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T

              • Returns the tensor data as a nested array. The transfer of data is done +

              Accessors

              • get isDisposed(): boolean
              • Returns boolean

              • get rank(): number
              • Returns number

              Methods

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T

              • Returns the tensor data as a nested array. The transfer of data is done asynchronously.

                -

                Returns Promise<ArrayMap[R]>

                Doc

              • Returns the tensor data as a nested array. The transfer of data is done +

                Returns Promise<ArrayMap[R]>

                Doc

              • Returns the tensor data as a nested array. The transfer of data is done synchronously.

                -

                Returns ArrayMap[R]

                Doc

              • Type Parameters

                Returns Tensor1D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number

                Returns Tensor2D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number
                • depth: number

                Returns Tensor3D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number
                • depth: number
                • depth2: number

                Returns Tensor4D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number
                • depth: number
                • depth2: number
                • depth3: number

                Returns Tensor5D

              • Type Parameters

                Returns Scalar

              • Type Parameters

                Parameters

                • this: T
                • dtype: keyof DataTypeMap

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • filterSize: number | [number, number]
                • strides: number | [number, number]
                • pad: number | "valid" | "same" | ExplicitPadding
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • blockShape: number[]
                • crops: number[][]

                Returns Tensor<R>

              • Type Parameters

                Parameters

                • shape: ShapeMap[R]

                Returns Tensor<R>

              • Returns a promise of tf.TensorBuffer that holds the underlying data.

                -

                Type Parameters

                • D extends keyof DataTypeMap = "float32"

                Returns Promise<TensorBuffer<R, D>>

                Doc

              • Returns a tf.TensorBuffer that holds the underlying data.

                -

                Type Parameters

                • D extends keyof DataTypeMap = "float32"

                Returns TensorBuffer<R, D>

                Doc

              • Returns the underlying bytes of the tensor's data.

                -

                Returns Promise<Uint8Array | Uint8Array[]>

              • Type Parameters

                Parameters

                • dtype: keyof DataTypeMap

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • min: number
                • max: number

                Returns Tensor<Rank>

              • Returns a copy of the tensor. See tf.clone for details.

                -

                Type Parameters

                Parameters

                • this: T

                Returns T

                Doc

              • Type Parameters

                Parameters

                • tensors: T | (TensorLike | T)[]
                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor3D | TensorLike3D
                • stride: number
                • pad: number | "valid" | "same" | ExplicitPadding
                • Optional dataFormat: "NWC" | "NCW"
                • Optional dilation: number
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor4D | TensorLike4D
                • strides: number | [number, number]
                • pad: number | "valid" | "same"
                • Optional dataFormat: "NHWC" | "NCHW"
                • Optional dilations: number | [number, number]
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor4D | TensorLike4D
                • outputShape: [number, number, number] | [number, number, number, number]
                • strides: number | [number, number]
                • pad: number | "valid" | "same"
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number
                • Optional exclusive: boolean
                • Optional reverse: boolean

                Returns Tensor<R>

              • Type Parameters

                Parameters

                • Optional axis: number
                • Optional exclusive: boolean
                • Optional reverse: boolean

                Returns Tensor<R>

              • Asynchronously downloads the values from the tf.Tensor. Returns a +

                Returns ArrayMap[R]

                Doc

              • Type Parameters

                Returns Tensor1D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number

                Returns Tensor2D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number
                • depth: number

                Returns Tensor3D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number
                • depth: number
                • depth2: number

                Returns Tensor4D

              • Type Parameters

                Parameters

                • rows: number
                • columns: number
                • depth: number
                • depth2: number
                • depth3: number

                Returns Tensor5D

              • Type Parameters

                Returns Scalar

              • Type Parameters

                Parameters

                • this: T
                • dtype: keyof DataTypeMap

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • filterSize: number | [number, number]
                • strides: number | [number, number]
                • pad: number | "valid" | "same" | ExplicitPadding
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • blockShape: number[]
                • crops: number[][]

                Returns Tensor<R>

              • Type Parameters

                Parameters

                • shape: ShapeMap[R]

                Returns Tensor<R>

              • Returns a promise of tf.TensorBuffer that holds the underlying data.

                +

                Type Parameters

                • D extends keyof DataTypeMap = "float32"

                Returns Promise<TensorBuffer<R, D>>

                Doc

              • Returns a tf.TensorBuffer that holds the underlying data.

                +

                Type Parameters

                • D extends keyof DataTypeMap = "float32"

                Returns TensorBuffer<R, D>

                Doc

              • Returns the underlying bytes of the tensor's data.

                +

                Returns Promise<Uint8Array | Uint8Array[]>

              • Type Parameters

                Parameters

                • dtype: keyof DataTypeMap

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • min: number
                • max: number

                Returns Tensor<Rank>

              • Returns a copy of the tensor. See tf.clone for details.

                +

                Type Parameters

                Parameters

                • this: T

                Returns T

                Doc

              • Type Parameters

                Parameters

                • tensors: T | (TensorLike | T)[]
                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor3D | TensorLike3D
                • stride: number
                • pad: number | "valid" | "same" | ExplicitPadding
                • Optional dataFormat: "NWC" | "NCW"
                • Optional dilation: number
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor4D | TensorLike4D
                • strides: number | [number, number]
                • pad: number | "valid" | "same"
                • Optional dataFormat: "NHWC" | "NCHW"
                • Optional dilations: number | [number, number]
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor4D | TensorLike4D
                • outputShape: [number, number, number] | [number, number, number, number]
                • strides: number | [number, number]
                • pad: number | "valid" | "same"
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number
                • Optional exclusive: boolean
                • Optional reverse: boolean

                Returns Tensor<R>

              • Type Parameters

                Parameters

                • Optional axis: number
                • Optional exclusive: boolean
                • Optional reverse: boolean

                Returns Tensor<R>

              • Asynchronously downloads the values from the tf.Tensor. Returns a promise of TypedArray that resolves when the computation has finished.

                -

                Type Parameters

                • D extends keyof DataTypeMap = NumericDataType

                Returns Promise<DataTypeMap[D]>

                Doc

              • Synchronously downloads the values from the tf.Tensor. This blocks the +

                Type Parameters

                • D extends keyof DataTypeMap = NumericDataType

                Returns Promise<DataTypeMap[D]>

                Doc

              • Synchronously downloads the values from the tf.Tensor. This blocks the UI thread until the values are ready, which can cause performance issues.

                -

                Type Parameters

                • D extends keyof DataTypeMap = NumericDataType

                Returns DataTypeMap[D]

                Doc

              • Copy the tensor's data to a new GPU resource. Comparing to the dataSync() +

                Type Parameters

                • D extends keyof DataTypeMap = NumericDataType

                Returns DataTypeMap[D]

                Doc

              • Copy the tensor's data to a new GPU resource. Comparing to the dataSync() and data(), this method prevents data from being downloaded to CPU.

                For WebGL backend, the data will be stored on a densely packed texture. This means that the texture will use the RGBA channels to store value.

                @@ -210,9 +210,9 @@ }

                For WebGPU backend, a GPUData contains the new buffer.
                {
                tensorRef: The tensor that is associated with this buffer,
                buffer: GPUBuffer,
                }

                Remember to dispose the GPUData after it is used by
                `res.tensorRef.dispose()`.
                -

                Doc

              • Type Parameters

                Parameters

                • blockSize: number
                • dataFormat: "NHWC" | "NCHW"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor4D | TensorLike4D
                • strides: number | [number, number]
                • pad: number | "valid" | "same"
                • Optional dataFormat: "NHWC" | "NCHW"
                • Optional dilations: number | [number, number]
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor3D | TensorLike3D
                • strides: number | [number, number]
                • pad: "valid" | "same"
                • Optional dilations: number | [number, number]
                • Optional dataFormat: "NHWC"

                Returns T

              • Disposes tf.Tensor from memory.

                -

                Returns void

                Doc

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Returns Tensor1D

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • alpha: number

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional depthRadius: number
                • Optional bias: number
                • Optional alpha: number
                • Optional beta: number

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • filterSize: number | [number, number]
                • strides: number | [number, number]
                • pad: number | "valid" | "same" | ExplicitPadding
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • paddings: [number, number][]
                • mode: "reflect" | "symmetric"

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • Optional ord: number | "euclidean" | "fro"
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                Returns T

              • Parameters

                • depth: number
                • onValue: number
                • offValue: number

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • paddings: [number, number][]
                • Optional constantValue: number

                Returns T

              • Type Parameters

                Parameters

                • windowShape: number | [number, number]
                • poolingType: "avg" | "max"
                • padding: number | "valid" | "same" | ExplicitPadding
                • Optional diationRate: number | [number, number]
                • Optional strides: number | [number, number]
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Prints the tf.Tensor. See tf.print for details.

                +

                Doc

              • Type Parameters

                Parameters

                • blockSize: number
                • dataFormat: "NHWC" | "NCHW"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor4D | TensorLike4D
                • strides: number | [number, number]
                • pad: number | "valid" | "same"
                • Optional dataFormat: "NHWC" | "NCHW"
                • Optional dilations: number | [number, number]
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                • filter: Tensor3D | TensorLike3D
                • strides: number | [number, number]
                • pad: "valid" | "same"
                • Optional dilations: number | [number, number]
                • Optional dataFormat: "NHWC"

                Returns T

              • Disposes tf.Tensor from memory.

                +

                Returns void

                Doc

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns Tensor<Rank>

              • Type Parameters

                Returns Tensor1D

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • alpha: number

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional depthRadius: number
                • Optional bias: number
                • Optional alpha: number
                • Optional beta: number

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • filterSize: number | [number, number]
                • strides: number | [number, number]
                • pad: number | "valid" | "same" | ExplicitPadding
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • paddings: [number, number][]
                • mode: "reflect" | "symmetric"

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • Optional ord: number | "euclidean" | "fro"
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                Returns T

              • Parameters

                • depth: number
                • onValue: number
                • offValue: number

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • paddings: [number, number][]
                • Optional constantValue: number

                Returns T

              • Type Parameters

                Parameters

                • windowShape: number | [number, number]
                • poolingType: "avg" | "max"
                • padding: number | "valid" | "same" | ExplicitPadding
                • Optional diationRate: number | [number, number]
                • Optional strides: number | [number, number]
                • Optional dimRoundingMode: "floor" | "round" | "ceil"

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Prints the tf.Tensor. See tf.print for details.

                Parameters

                • Optional verbose: boolean

                  Whether to print verbose information about the tensor, including dtype and size.

                  -

                Returns void

                Doc

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                • shape: number[]

                Returns T

              • Type Parameters

                Parameters

                • x: T

                Returns T

              • Type Parameters

                Parameters

                • newShape2D: [number, number]
                • Optional alignCorners: boolean
                • Optional halfPixelCenters: boolean

                Returns T

              • Type Parameters

                Parameters

                • newShape2D: [number, number]
                • Optional alignCorners: boolean
                • Optional halfFloatCenters: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                • depthwiseFilter: Tensor4D | TensorLike4D
                • pointwiseFilter: TensorLike | Tensor4D
                • strides: number | [number, number]
                • pad: "valid" | "same"
                • Optional dilation: number | [number, number]
                • Optional dataFormat: "NHWC" | "NCHW"

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • begin: number | number[]
                • Optional size: number | number[]

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional dim: number

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • blockShape: number[]
                • paddings: number[][]

                Returns Tensor<R>

              • Type Parameters

                Parameters

                • numOrSizeSplits: number | number[]
                • Optional axis: number

                Returns T[]

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number[]

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional alpha: number

                Returns T

              • Type Parameters

                Parameters

                • this: Tensor<Rank>
                • begin: number[]
                • end: number[]
                • strides: number[]
                • Optional beginMask: number
                • Optional endMask: number
                • Optional ellipsisMask: number
                • Optional newAxisMask: number
                • Optional shrinkAxisMask: number

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Returns void

              • Type Parameters

                Parameters

                • b: number[]

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Returns a human-readable description of the tensor. Useful for logging.

                -

                Parameters

                • Optional verbose: boolean

                Returns string

                Doc

              • Type Parameters

                Parameters

                • this: T
                • Optional k: number
                • Optional sorted: boolean

                Returns {
                    indices: T;
                    values: T;
                }

                • indices: T
                • values: T
              • Type Parameters

                Parameters

                • Optional perm: number[]

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number

                Returns {
                    indices: T;
                    values: T;
                }

                • indices: T
                • values: T
              • Type Parameters

                Parameters

                • this: T
                • segmentIds: Tensor1D | TensorLike1D
                • numSegments: number

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T[]

              • Parameters

                • Optional trainable: boolean
                • Optional name: string
                • Optional dtype: keyof DataTypeMap

                Returns Variable<R>

              • Type Parameters

                Parameters

                • this: T

                Returns T

              \ No newline at end of file +

              Returns void

              Doc

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                • shape: number[]

                Returns T

              • Type Parameters

                Parameters

                • x: T

                Returns T

              • Type Parameters

                Parameters

                • newShape2D: [number, number]
                • Optional alignCorners: boolean
                • Optional halfPixelCenters: boolean

                Returns T

              • Type Parameters

                Parameters

                • newShape2D: [number, number]
                • Optional alignCorners: boolean
                • Optional halfFloatCenters: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number | number[]

                Returns T

              • Type Parameters

                Parameters

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Returns T

              • Type Parameters

                Parameters

                • depthwiseFilter: Tensor4D | TensorLike4D
                • pointwiseFilter: TensorLike | Tensor4D
                • strides: number | [number, number]
                • pad: "valid" | "same"
                • Optional dilation: number | [number, number]
                • Optional dataFormat: "NHWC" | "NCHW"

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • begin: number | number[]
                • Optional size: number | number[]

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional dim: number

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • blockShape: number[]
                • paddings: number[][]

                Returns Tensor<R>

              • Type Parameters

                Parameters

                • numOrSizeSplits: number | number[]
                • Optional axis: number

                Returns T[]

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number[]

                Returns T

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional alpha: number

                Returns T

              • Type Parameters

                Parameters

                • this: Tensor<Rank>
                • begin: number[]
                • end: number[]
                • strides: number[]
                • Optional beginMask: number
                • Optional endMask: number
                • Optional ellipsisMask: number
                • Optional newAxisMask: number
                • Optional shrinkAxisMask: number

                Returns Tensor<Rank>

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number | number[]
                • Optional keepDims: boolean

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Returns void

              • Type Parameters

                Parameters

                • b: number[]

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              • Returns a human-readable description of the tensor. Useful for logging.

                +

                Parameters

                • Optional verbose: boolean

                Returns string

                Doc

              • Type Parameters

                Parameters

                • this: T
                • Optional k: number
                • Optional sorted: boolean

                Returns {
                    indices: T;
                    values: T;
                }

                • indices: T
                • values: T
              • Type Parameters

                Parameters

                • Optional perm: number[]

                Returns T

              • Type Parameters

                Parameters

                • this: T
                • Optional axis: number

                Returns {
                    indices: T;
                    values: T;
                }

                • indices: T
                • values: T
              • Type Parameters

                Parameters

                • this: T
                • segmentIds: Tensor1D | TensorLike1D
                • numSegments: number

                Returns T

              • Type Parameters

                Parameters

                • Optional axis: number

                Returns T[]

              • Parameters

                • Optional trainable: boolean
                • Optional name: string
                • Optional dtype: keyof DataTypeMap

                Returns Variable<R>

              • Type Parameters

                Parameters

                Returns T

              • Type Parameters

                Parameters

                • this: T

                Returns T

              \ No newline at end of file diff --git a/typedoc/classes/WebCam.html b/typedoc/classes/WebCam.html index 0c9a53c0..ba245b80 100644 --- a/typedoc/classes/WebCam.html +++ b/typedoc/classes/WebCam.html @@ -1,4 +1,4 @@ -WebCam | @vladmandic/human - v3.2.0

              Constructors

              constructor +WebCam | @vladmandic/human - v3.2.1

              Constructors

              Properties

              config devices element @@ -32,4 +32,4 @@

              Returns void

              • start method initializizes webcam stream and associates it with a dom video element

                Parameters

                Returns Promise<string>

              • stop method stops active webcam stream track and disconnects webcam

                -

                Returns void

              \ No newline at end of file +

              Returns void

              \ No newline at end of file diff --git a/typedoc/classes/models.Models.html b/typedoc/classes/models.Models.html index 9012490e..bbeaf43c 100644 --- a/typedoc/classes/models.Models.html +++ b/typedoc/classes/models.Models.html @@ -1,4 +1,4 @@ -Models | @vladmandic/human - v3.2.0

              Models class used by Human

              +Models | @vladmandic/human - v3.2.1

              Models class used by Human

              • models: record of all GraphModels
              • list: returns list of configured models with their stats
              • @@ -15,4 +15,4 @@ reset stats validate -

              Constructors

              Properties

              models: Record<string, null | GraphModel<string | IOHandler>> = {}

              Methods

              • Returns {
                    loaded: boolean;
                    name: string;
                    size: number;
                    url: any;
                }[]

              • Parameters

                Returns Promise<void>

              • Returns {
                    missing: string[];
                    name: string;
                }[]

              \ No newline at end of file +

              Constructors

              Properties

              models: Record<string, null | GraphModel<string | IOHandler>> = {}

              Methods

              • Returns {
                    loaded: boolean;
                    name: string;
                    size: number;
                    url: any;
                }[]

              • Parameters

                Returns Promise<void>

              • Returns {
                    missing: string[];
                    name: string;
                }[]

              \ No newline at end of file diff --git a/typedoc/enums/Rank.html b/typedoc/enums/Rank.html index 97dae6da..6ccd6b15 100644 --- a/typedoc/enums/Rank.html +++ b/typedoc/enums/Rank.html @@ -1,8 +1,8 @@ -Rank | @vladmandic/human - v3.2.0

              Enumeration Rank

              Enumeration Members

              R0 +Rank | @vladmandic/human - v3.2.1

              Enumeration Rank

              Enumeration Members

              Enumeration Members

              R0: "R0"
              R1: "R1"
              R2: "R2"
              R3: "R3"
              R4: "R4"
              R5: "R5"
              R6: "R6"
              \ No newline at end of file +

              Enumeration Members

              R0: "R0"
              R1: "R1"
              R2: "R2"
              R3: "R3"
              R4: "R4"
              R5: "R5"
              R6: "R6"
              \ No newline at end of file diff --git a/typedoc/functions/draw.all.html b/typedoc/functions/draw.all.html index 32184279..88ce7b2a 100644 --- a/typedoc/functions/draw.all.html +++ b/typedoc/functions/draw.all.html @@ -1,2 +1,2 @@ -all | @vladmandic/human - v3.2.0
              • meta-function that performs draw for: canvas, face, body, hand

                -

                Parameters

                Returns Promise<null | [void, void, void, void, void]>

              \ No newline at end of file +all | @vladmandic/human - v3.2.1
              • meta-function that performs draw for: canvas, face, body, hand

                +

                Parameters

                Returns Promise<null | [void, void, void, void, void]>

              \ No newline at end of file diff --git a/typedoc/functions/draw.body.html b/typedoc/functions/draw.body.html index ad200a8f..5f119860 100644 --- a/typedoc/functions/draw.body.html +++ b/typedoc/functions/draw.body.html @@ -1,2 +1,2 @@ -body | @vladmandic/human - v3.2.0
              \ No newline at end of file +body | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/draw.canvas.html b/typedoc/functions/draw.canvas.html index 10855f10..bb5cdc50 100644 --- a/typedoc/functions/draw.canvas.html +++ b/typedoc/functions/draw.canvas.html @@ -1,2 +1,2 @@ -canvas | @vladmandic/human - v3.2.0
              \ No newline at end of file +canvas | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/draw.face.html b/typedoc/functions/draw.face.html index 7bab6302..d870795e 100644 --- a/typedoc/functions/draw.face.html +++ b/typedoc/functions/draw.face.html @@ -1,2 +1,2 @@ -face | @vladmandic/human - v3.2.0
              \ No newline at end of file +face | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/draw.gesture.html b/typedoc/functions/draw.gesture.html index 1f93639e..5c132c80 100644 --- a/typedoc/functions/draw.gesture.html +++ b/typedoc/functions/draw.gesture.html @@ -1,2 +1,2 @@ -gesture | @vladmandic/human - v3.2.0
              \ No newline at end of file +gesture | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/draw.hand.html b/typedoc/functions/draw.hand.html index 966b238a..6f0ba316 100644 --- a/typedoc/functions/draw.hand.html +++ b/typedoc/functions/draw.hand.html @@ -1,2 +1,2 @@ -hand | @vladmandic/human - v3.2.0
              \ No newline at end of file +hand | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/draw.init.html b/typedoc/functions/draw.init.html index 332254fa..2451061f 100644 --- a/typedoc/functions/draw.init.html +++ b/typedoc/functions/draw.init.html @@ -1,2 +1,2 @@ -init | @vladmandic/human - v3.2.0
              \ No newline at end of file +init | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/draw.object.html b/typedoc/functions/draw.object.html index 1260a263..14ba163e 100644 --- a/typedoc/functions/draw.object.html +++ b/typedoc/functions/draw.object.html @@ -1,2 +1,2 @@ -object | @vladmandic/human - v3.2.0
              \ No newline at end of file +object | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/draw.person.html b/typedoc/functions/draw.person.html index 559cea19..6aa09444 100644 --- a/typedoc/functions/draw.person.html +++ b/typedoc/functions/draw.person.html @@ -1,2 +1,2 @@ -person | @vladmandic/human - v3.2.0
              • draw combined person results instead of individual detection result objects

                -

                Parameters

                Returns void

              \ No newline at end of file +person | @vladmandic/human - v3.2.1
              • draw combined person results instead of individual detection result objects

                +

                Parameters

                Returns void

              \ No newline at end of file diff --git a/typedoc/functions/empty.html b/typedoc/functions/empty.html index 727d3451..d20cd9f5 100644 --- a/typedoc/functions/empty.html +++ b/typedoc/functions/empty.html @@ -1 +1 @@ -empty | @vladmandic/human - v3.2.0
              \ No newline at end of file +empty | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/functions/match.distance.html b/typedoc/functions/match.distance.html index 4606b73b..a4bf5f75 100644 --- a/typedoc/functions/match.distance.html +++ b/typedoc/functions/match.distance.html @@ -1,4 +1,4 @@ -distance | @vladmandic/human - v3.2.0

              Returns number

              \ No newline at end of file diff --git a/typedoc/functions/match.find.html b/typedoc/functions/match.find.html index 076f55a3..5012b4a2 100644 --- a/typedoc/functions/match.find.html +++ b/typedoc/functions/match.find.html @@ -1,4 +1,4 @@ -find | @vladmandic/human - v3.2.0
              • Matches given descriptor to a closest entry in array of descriptors

                +find | @vladmandic/human - v3.2.1
                • Matches given descriptor to a closest entry in array of descriptors

                  Parameters

                  • descriptor: Descriptor

                    face descriptor

                  • descriptors: Descriptor[]

                    array of face descriptors to commpare given descriptor to

                  • options: MatchOptions = ...

                    see similarity method for options description @@ -8,4 +8,4 @@

                  • distance calculated distance of given descriptor to the best match
                  • similarity calculated normalized similarity of given descriptor to the best match
                  -

                Returns {
                    distance: number;
                    index: number;
                    similarity: number;
                }

                • distance: number
                • index: number
                • similarity: number
              \ No newline at end of file +

              Returns {
                  distance: number;
                  index: number;
                  similarity: number;
              }

              • distance: number
              • index: number
              • similarity: number
              \ No newline at end of file diff --git a/typedoc/functions/match.similarity.html b/typedoc/functions/match.similarity.html index 1cbd094e..9803247e 100644 --- a/typedoc/functions/match.similarity.html +++ b/typedoc/functions/match.similarity.html @@ -1,4 +1,4 @@ -similarity | @vladmandic/human - v3.2.0

              Returns number

              \ No newline at end of file diff --git a/typedoc/functions/models.validateModel.html b/typedoc/functions/models.validateModel.html index 6a24f05f..a5bc69fe 100644 --- a/typedoc/functions/models.validateModel.html +++ b/typedoc/functions/models.validateModel.html @@ -1 +1 @@ -validateModel | @vladmandic/human - v3.2.0
              \ No newline at end of file +validateModel | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/index.html b/typedoc/index.html index 893455cd..326a3627 100644 --- a/typedoc/index.html +++ b/typedoc/index.html @@ -1,4 +1,4 @@ -@vladmandic/human - v3.2.0

              @vladmandic/human - v3.2.0

              References

              default +@vladmandic/human - v3.2.1

              @vladmandic/human - v3.2.1

              References

              Namespaces

              Tensor draw match @@ -79,4 +79,4 @@

              Variables

              Functions

              References

              Renames and re-exports Human
              \ No newline at end of file +

              References

              Renames and re-exports Human
              \ No newline at end of file diff --git a/typedoc/interfaces/BodyConfig.html b/typedoc/interfaces/BodyConfig.html index 28439737..e8928245 100644 --- a/typedoc/interfaces/BodyConfig.html +++ b/typedoc/interfaces/BodyConfig.html @@ -1,5 +1,5 @@ -BodyConfig | @vladmandic/human - v3.2.0

              Interface BodyConfig

              Configures all body detection specific options

              -
              interface BodyConfig {
                  enabled: boolean;
                  maxDetected: number;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +BodyConfig | @vladmandic/human - v3.2.1

              Interface BodyConfig

              Configures all body detection specific options

              +
              interface BodyConfig {
                  enabled: boolean;
                  maxDetected: number;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              Properties

              enabled: boolean

              is module enabled?

              maxDetected: number

              maximum number of detected bodies

              -
              minConfidence: number

              minimum confidence for a detected body before results are discarded

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              minConfidence: number

              minimum confidence for a detected body before results are discarded

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/BodyKeypoint.html b/typedoc/interfaces/BodyKeypoint.html index 8651bfbd..683c4788 100644 --- a/typedoc/interfaces/BodyKeypoint.html +++ b/typedoc/interfaces/BodyKeypoint.html @@ -1,4 +1,4 @@ -BodyKeypoint | @vladmandic/human - v3.2.0

              Interface BodyKeypoint

              Body Result keypoints

              +BodyKeypoint | @vladmandic/human - v3.2.1

              Interface BodyKeypoint

              Body Result keypoints

              interface BodyKeypoint {
                  distance?: Point;
                  part: BodyLandmark;
                  position: Point;
                  positionRaw: Point;
                  score: number;
              }

              Properties

              distance? part position @@ -9,4 +9,4 @@
              position: Point

              body part position

              positionRaw: Point

              body part position normalized to 0..1

              score: number

              body part detection score

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/BodyResult.html b/typedoc/interfaces/BodyResult.html index 13e865b8..dee2cbfd 100644 --- a/typedoc/interfaces/BodyResult.html +++ b/typedoc/interfaces/BodyResult.html @@ -1,4 +1,4 @@ -BodyResult | @vladmandic/human - v3.2.0

              Interface BodyResult

              Body results

              +BodyResult | @vladmandic/human - v3.2.1

              Interface BodyResult

              Body results

              interface BodyResult {
                  annotations: Record<BodyAnnotation, Point[][]>;
                  box: Box;
                  boxRaw: Box;
                  id: number;
                  keypoints: BodyKeypoint[];
                  score: number;
              }

              Properties

              annotations box boxRaw @@ -11,4 +11,4 @@
              id: number

              body id

              keypoints: BodyKeypoint[]

              detected body keypoints

              score: number

              body detection score

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/Config.html b/typedoc/interfaces/Config.html index 92c85e70..5295e09a 100644 --- a/typedoc/interfaces/Config.html +++ b/typedoc/interfaces/Config.html @@ -1,7 +1,7 @@ -Config | @vladmandic/human - v3.2.0

              Interface Config

              Configuration interface definition for Human library +Config | @vladmandic/human - v3.2.1

              Interface Config

              Configuration interface definition for Human library Contains all configurable parameters Defaults: config

              -
              interface Config {
                  async: boolean;
                  backend: BackendEnum;
                  body: Partial<BodyConfig>;
                  cacheModels: boolean;
                  cacheSensitivity: number;
                  deallocate: boolean;
                  debug: boolean;
                  face: Partial<FaceConfig>;
                  filter: Partial<FilterConfig>;
                  flags: Record<string, unknown>;
                  gesture: Partial<GestureConfig>;
                  hand: Partial<HandConfig>;
                  modelBasePath: string;
                  object: Partial<ObjectConfig>;
                  segmentation: Partial<SegmentationConfig>;
                  skipAllowed: boolean;
                  softwareKernels: boolean;
                  validateModels: boolean;
                  warmup: WarmupEnum;
                  wasmPath: string;
                  wasmPlatformFetch: boolean;
              }

              Properties

              interface Config {
                  async: boolean;
                  backend: BackendEnum;
                  body: Partial<BodyConfig>;
                  cacheModels: boolean;
                  cacheSensitivity: number;
                  deallocate: boolean;
                  debug: boolean;
                  face: Partial<FaceConfig>;
                  filter: Partial<FilterConfig>;
                  flags: Record<string, unknown>;
                  gesture: Partial<GestureConfig>;
                  hand: Partial<HandConfig>;
                  modelBasePath: string;
                  object: Partial<ObjectConfig>;
                  segmentation: Partial<SegmentationConfig>;
                  skipAllowed: boolean;
                  softwareKernels: boolean;
                  validateModels: boolean;
                  warmup: WarmupEnum;
                  wasmPath: string;
                  wasmPlatformFetch: boolean;
              }

              Properties

              Properties

              async: boolean

              Perform model loading and inference concurrently or sequentially

              default: true

              -
              backend: BackendEnum

              Backend used for TFJS operations +

              backend: BackendEnum

              Backend used for TFJS operations valid build-in backends are:

              • Browser: cpu, wasm, webgl, humangl, webgpu
              • NodeJS: cpu, wasm, tensorflow default: webgl for browser and tensorflow for nodejs
              -
              body: Partial<BodyConfig>

              Body config BodyConfig

              -
              cacheModels: boolean

              Cache models in IndexDB on first sucessfull load +

              body: Partial<BodyConfig>

              Body config BodyConfig

              +
              cacheModels: boolean

              Cache models in IndexDB on first sucessfull load default: true if indexdb is available (browsers), false if its not (nodejs)

              -
              cacheSensitivity: number

              Cache sensitivity

              +
              cacheSensitivity: number

              Cache sensitivity

              • values 0..1 where 0.01 means reset cache if input changed more than 1%
              • set to 0 to disable caching

              default: 0.7

              -
              deallocate: boolean

              Perform immediate garbage collection on deallocated tensors instead of caching them

              -
              debug: boolean

              Print debug statements to console

              +
              deallocate: boolean

              Perform immediate garbage collection on deallocated tensors instead of caching them

              +
              debug: boolean

              Print debug statements to console

              default: true

              -
              face: Partial<FaceConfig>

              Face config FaceConfig

              -
              filter: Partial<FilterConfig>

              Filter config FilterConfig

              -
              flags: Record<string, unknown>

              Explicit flags passed to initialize TFJS

              -
              gesture: Partial<GestureConfig>

              Gesture config GestureConfig

              -
              hand: Partial<HandConfig>

              Hand config HandConfig

              -
              modelBasePath: string

              Base model path (typically starting with file://, http:// or https://) for all models

              +
              face: Partial<FaceConfig>

              Face config FaceConfig

              +
              filter: Partial<FilterConfig>

              Filter config FilterConfig

              +
              flags: Record<string, unknown>

              Explicit flags passed to initialize TFJS

              +
              gesture: Partial<GestureConfig>

              Gesture config GestureConfig

              +
              hand: Partial<HandConfig>

              Hand config HandConfig

              +
              modelBasePath: string

              Base model path (typically starting with file://, http:// or https://) for all models

              • individual modelPath values are relative to this path

              default: ../models/ for browsers and file://models/ for nodejs

              -
              object: Partial<ObjectConfig>

              Object config ObjectConfig

              -
              segmentation: Partial<SegmentationConfig>

              Segmentation config SegmentationConfig

              -
              skipAllowed: boolean

              Internal Variable

              -
              softwareKernels: boolean

              Software Kernels +

              object: Partial<ObjectConfig>

              Object config ObjectConfig

              +
              segmentation: Partial<SegmentationConfig>

              Segmentation config SegmentationConfig

              +
              skipAllowed: boolean

              Internal Variable

              +
              softwareKernels: boolean

              Software Kernels Registers software kernel ops running on CPU when accelerated version of kernel is not found in the current backend

              -
              validateModels: boolean

              Validate kernel ops used in model during model load +

              validateModels: boolean

              Validate kernel ops used in model during model load default: true any errors will be printed on console but will be treated as non-fatal

              -
              warmup: WarmupEnum

              What to use for human.warmup()

              +
              warmup: WarmupEnum

              What to use for human.warmup()

              • warmup pre-initializes all models for faster inference but can take significant time on startup
              • used by webgl, humangl and webgpu backends

              default: full

              -
              wasmPath: string

              Path to *.wasm files if backend is set to wasm

              +
              wasmPath: string

              Path to *.wasm files if backend is set to wasm

              default: auto-detects to link to CDN jsdelivr when running in browser

              -
              wasmPlatformFetch: boolean

              Force WASM loader to use platform fetch

              +
              wasmPlatformFetch: boolean

              Force WASM loader to use platform fetch

              default: false

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/DrawOptions.html b/typedoc/interfaces/DrawOptions.html index 6fc64beb..9e6a4c98 100644 --- a/typedoc/interfaces/DrawOptions.html +++ b/typedoc/interfaces/DrawOptions.html @@ -1,4 +1,4 @@ -DrawOptions | @vladmandic/human - v3.2.0

              Interface DrawOptions

              Draw Options

              +DrawOptions | @vladmandic/human - v3.2.1

              Interface DrawOptions

              Draw Options

              • Accessed via human.draw.options or provided per each draw method as the drawOptions optional parameter
              @@ -54,4 +54,4 @@
              shadowColor: string

              label shadow color

              useCurves: boolean

              should lines be curved?

              useDepth: boolean

              use z-coordinate when available

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceAntiSpoofConfig.html b/typedoc/interfaces/FaceAntiSpoofConfig.html index 47878f32..c7c219d7 100644 --- a/typedoc/interfaces/FaceAntiSpoofConfig.html +++ b/typedoc/interfaces/FaceAntiSpoofConfig.html @@ -1,5 +1,5 @@ -FaceAntiSpoofConfig | @vladmandic/human - v3.2.0

              Interface FaceAntiSpoofConfig

              Anti-spoofing part of face configuration

              -
              interface FaceAntiSpoofConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceAntiSpoofConfig | @vladmandic/human - v3.2.1

              Interface FaceAntiSpoofConfig

              Anti-spoofing part of face configuration

              +
              interface FaceAntiSpoofConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled modelPath skipFrames skipTime @@ -9,4 +9,4 @@ for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceAttentionConfig.html b/typedoc/interfaces/FaceAttentionConfig.html index 53a39f44..9361401a 100644 --- a/typedoc/interfaces/FaceAttentionConfig.html +++ b/typedoc/interfaces/FaceAttentionConfig.html @@ -1,5 +1,5 @@ -FaceAttentionConfig | @vladmandic/human - v3.2.0

              Interface FaceAttentionConfig

              Attention part of face configuration

              -
              interface FaceAttentionConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceAttentionConfig | @vladmandic/human - v3.2.1

              Interface FaceAttentionConfig

              Attention part of face configuration

              +
              interface FaceAttentionConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled modelPath skipFrames skipTime @@ -9,4 +9,4 @@ for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceConfig.html b/typedoc/interfaces/FaceConfig.html index 1a970499..a1571929 100644 --- a/typedoc/interfaces/FaceConfig.html +++ b/typedoc/interfaces/FaceConfig.html @@ -1,5 +1,5 @@ -FaceConfig | @vladmandic/human - v3.2.0

              Interface FaceConfig

              Configures all face-specific options: face detection, mesh analysis, age, gender, emotion detection and face description

              -
              interface FaceConfig {
                  antispoof: Partial<FaceAntiSpoofConfig>;
                  attention: Partial<FaceAttentionConfig>;
                  description: Partial<FaceDescriptionConfig>;
                  detector: Partial<FaceDetectorConfig>;
                  emotion: Partial<FaceEmotionConfig>;
                  enabled: boolean;
                  gear: Partial<FaceGearConfig>;
                  iris: Partial<FaceIrisConfig>;
                  liveness: Partial<FaceLivenessConfig>;
                  mesh: Partial<FaceMeshConfig>;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              antispoof +FaceConfig | @vladmandic/human - v3.2.1

              Interface FaceConfig

              Configures all face-specific options: face detection, mesh analysis, age, gender, emotion detection and face description

              +
              interface FaceConfig {
                  antispoof: Partial<FaceAntiSpoofConfig>;
                  attention: Partial<FaceAttentionConfig>;
                  description: Partial<FaceDescriptionConfig>;
                  detector: Partial<FaceDetectorConfig>;
                  emotion: Partial<FaceEmotionConfig>;
                  enabled: boolean;
                  gear: Partial<FaceGearConfig>;
                  iris: Partial<FaceIrisConfig>;
                  liveness: Partial<FaceLivenessConfig>;
                  mesh: Partial<FaceMeshConfig>;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              antispoof: Partial<FaceAntiSpoofConfig>
              attention: Partial<FaceAttentionConfig>
              description: Partial<FaceDescriptionConfig>
              detector: Partial<FaceDetectorConfig>
              emotion: Partial<FaceEmotionConfig>
              enabled: boolean

              is module enabled?

              -
              gear: Partial<FaceGearConfig>
              iris: Partial<FaceIrisConfig>
              liveness: Partial<FaceLivenessConfig>
              mesh: Partial<FaceMeshConfig>
              modelPath: string

              path to model json file (relative to modelBasePath

              +

              Properties

              antispoof: Partial<FaceAntiSpoofConfig>
              attention: Partial<FaceAttentionConfig>
              description: Partial<FaceDescriptionConfig>
              detector: Partial<FaceDetectorConfig>
              emotion: Partial<FaceEmotionConfig>
              enabled: boolean

              is module enabled?

              +
              gear: Partial<FaceGearConfig>
              iris: Partial<FaceIrisConfig>
              liveness: Partial<FaceLivenessConfig>
              mesh: Partial<FaceMeshConfig>
              modelPath: string

              path to model json file (relative to modelBasePath

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceDescriptionConfig.html b/typedoc/interfaces/FaceDescriptionConfig.html index dcf38738..dac5fe9e 100644 --- a/typedoc/interfaces/FaceDescriptionConfig.html +++ b/typedoc/interfaces/FaceDescriptionConfig.html @@ -1,17 +1,17 @@ -FaceDescriptionConfig | @vladmandic/human - v3.2.0

              Interface FaceDescriptionConfig

              Description or face embedding part of face configuration

              +FaceDescriptionConfig | @vladmandic/human - v3.2.1

              Interface FaceDescriptionConfig

              Description or face embedding part of face configuration

              • also used by age and gender detection
              -
              interface FaceDescriptionConfig {
                  enabled: boolean;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              interface FaceDescriptionConfig {
                  enabled: boolean;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled: boolean

              is module enabled?

              minConfidence: number

              minimum confidence for a detected face before results are discarded

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceDetectorConfig.html b/typedoc/interfaces/FaceDetectorConfig.html index 3976eb8a..2114a820 100644 --- a/typedoc/interfaces/FaceDetectorConfig.html +++ b/typedoc/interfaces/FaceDetectorConfig.html @@ -1,5 +1,5 @@ -FaceDetectorConfig | @vladmandic/human - v3.2.0

              Interface FaceDetectorConfig

              Detector part of face configuration

              -
              interface FaceDetectorConfig {
                  enabled: boolean;
                  iouThreshold: number;
                  mask: boolean;
                  maxDetected: number;
                  minConfidence: number;
                  minSize: number;
                  modelPath: string;
                  return: boolean;
                  rotation: boolean;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceDetectorConfig | @vladmandic/human - v3.2.1

              Interface FaceDetectorConfig

              Detector part of face configuration

              +
              interface FaceDetectorConfig {
                  enabled: boolean;
                  iouThreshold: number;
                  mask: boolean;
                  maxDetected: number;
                  minConfidence: number;
                  minSize: number;
                  modelPath: string;
                  return: boolean;
                  rotation: boolean;
                  scale: number;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled: boolean

              is module enabled?

              iouThreshold: number

              minimum overlap between two detected faces before one is discarded

              mask: boolean

              should child models perform on masked image of a face

              -
              maxDetected: number

              maximum number of detected faces

              +
              maxDetected: number

              maximum number of detected faces

              minConfidence: number

              minimum confidence for a detected face before results are discarded

              minSize: number

              minimum size in pixels of a detected face box before resutls are discared

              modelPath: string

              path to model json file (relative to modelBasePath

              return: boolean

              should face detection return processed and cropped face tensor that can with an external model for addtional processing? if enabled it must be manually deallocated to avoid memory leak

              -
              rotation: boolean

              is face rotation correction performed after detecting face? +

              rotation: boolean

              is face rotation correction performed after detecting face? used to correctly analyze faces under high angles

              -
              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable +

              scale: number

              how much should face box be enlarged over the min/max facial coordinates

              +
              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceEmotionConfig.html b/typedoc/interfaces/FaceEmotionConfig.html index a4949780..a1a471b1 100644 --- a/typedoc/interfaces/FaceEmotionConfig.html +++ b/typedoc/interfaces/FaceEmotionConfig.html @@ -1,14 +1,14 @@ -FaceEmotionConfig | @vladmandic/human - v3.2.0

              Interface FaceEmotionConfig

              Emotion part of face configuration

              -
              interface FaceEmotionConfig {
                  enabled: boolean;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceEmotionConfig | @vladmandic/human - v3.2.1

              Interface FaceEmotionConfig

              Emotion part of face configuration

              +
              interface FaceEmotionConfig {
                  enabled: boolean;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled: boolean

              is module enabled?

              minConfidence: number

              minimum confidence for a detected face before results are discarded

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceGearConfig.html b/typedoc/interfaces/FaceGearConfig.html index 5c0f1758..a01f8b60 100644 --- a/typedoc/interfaces/FaceGearConfig.html +++ b/typedoc/interfaces/FaceGearConfig.html @@ -1,14 +1,14 @@ -FaceGearConfig | @vladmandic/human - v3.2.0

              Interface FaceGearConfig

              Gear part of face configuration

              -
              interface FaceGearConfig {
                  enabled: boolean;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceGearConfig | @vladmandic/human - v3.2.1

              Interface FaceGearConfig

              Gear part of face configuration

              +
              interface FaceGearConfig {
                  enabled: boolean;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled: boolean

              is module enabled?

              minConfidence: number

              minimum confidence for a detected race before results are discarded

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceIrisConfig.html b/typedoc/interfaces/FaceIrisConfig.html index b2882d2f..63aa1639 100644 --- a/typedoc/interfaces/FaceIrisConfig.html +++ b/typedoc/interfaces/FaceIrisConfig.html @@ -1,12 +1,14 @@ -FaceIrisConfig | @vladmandic/human - v3.2.0

              Interface FaceIrisConfig

              Iris part of face configuration

              -
              interface FaceIrisConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceIrisConfig | @vladmandic/human - v3.2.1

              Interface FaceIrisConfig

              Iris part of face configuration

              +
              interface FaceIrisConfig {
                  enabled: boolean;
                  modelPath: string;
                  scale: number;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled: boolean

              is module enabled?

              modelPath: string

              path to model json file (relative to modelBasePath

              -
              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable +

              scale: number

              how much should iris box be enlarged over the min/max iris coordinates

              +
              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceLivenessConfig.html b/typedoc/interfaces/FaceLivenessConfig.html index dc243e37..a4fe74d7 100644 --- a/typedoc/interfaces/FaceLivenessConfig.html +++ b/typedoc/interfaces/FaceLivenessConfig.html @@ -1,5 +1,5 @@ -FaceLivenessConfig | @vladmandic/human - v3.2.0

              Interface FaceLivenessConfig

              Liveness part of face configuration

              -
              interface FaceLivenessConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceLivenessConfig | @vladmandic/human - v3.2.1

              Interface FaceLivenessConfig

              Liveness part of face configuration

              +
              interface FaceLivenessConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled modelPath skipFrames skipTime @@ -9,4 +9,4 @@ for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceMeshConfig.html b/typedoc/interfaces/FaceMeshConfig.html index 00fbcd9a..738bdbdf 100644 --- a/typedoc/interfaces/FaceMeshConfig.html +++ b/typedoc/interfaces/FaceMeshConfig.html @@ -1,14 +1,14 @@ -FaceMeshConfig | @vladmandic/human - v3.2.0

              Interface FaceMeshConfig

              Mesh part of face configuration

              -
              interface FaceMeshConfig {
                  enabled: boolean;
                  keepInvalid: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +FaceMeshConfig | @vladmandic/human - v3.2.1

              Interface FaceMeshConfig

              Mesh part of face configuration

              +
              interface FaceMeshConfig {
                  enabled: boolean;
                  keepInvalid: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled: boolean

              is module enabled?

              keepInvalid: boolean

              Keep detected faces that cannot be verified using facemesh

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FaceResult.html b/typedoc/interfaces/FaceResult.html index 963159d6..0259a6b4 100644 --- a/typedoc/interfaces/FaceResult.html +++ b/typedoc/interfaces/FaceResult.html @@ -1,4 +1,4 @@ -FaceResult | @vladmandic/human - v3.2.0

              Interface FaceResult

              Face results

              +FaceResult | @vladmandic/human - v3.2.1

              Interface FaceResult

              Face results

              • Combined results of face detector, face mesh, age, gender, emotion, embedding, iris models
              • Some values may be null if specific model is not enabled
              • @@ -45,4 +45,4 @@

              Type declaration

              • angle: {
                    pitch: number;
                    roll: number;
                    yaw: number;
                }
                • pitch: number
                • roll: number
                • yaw: number
              • gaze: {
                    bearing: number;
                    strength: number;
                }
                • bearing: number
                • strength: number
              • matrix: [number, number, number, number, number, number, number, number, number]
              score: number

              overall face score

              size: [number, number]

              detected face box size

              tensor?: Tensor<Rank>

              detected face as tensor that can be used in further pipelines

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/FilterConfig.html b/typedoc/interfaces/FilterConfig.html index e3291e14..3880912b 100644 --- a/typedoc/interfaces/FilterConfig.html +++ b/typedoc/interfaces/FilterConfig.html @@ -1,9 +1,9 @@ -FilterConfig | @vladmandic/human - v3.2.0

              Interface FilterConfig

              Run input through image filters before inference

              +FilterConfig | @vladmandic/human - v3.2.1

              Interface FilterConfig

              Run input through image filters before inference

              • available only in Browser environments
              • image filters run with near-zero latency as they are executed on the GPU using WebGL
              -
              interface FilterConfig {
                  autoBrightness: boolean;
                  blur: number;
                  brightness: number;
                  contrast: number;
                  enabled: boolean;
                  equalization: boolean;
                  flip: boolean;
                  height: number;
                  hue: number;
                  kodachrome: boolean;
                  negative: boolean;
                  pixelate: number;
                  polaroid: boolean;
                  return: boolean;
                  saturation: number;
                  sepia: boolean;
                  sharpness: number;
                  technicolor: boolean;
                  vintage: boolean;
                  width: number;
              }

              Properties

              interface FilterConfig {
                  autoBrightness: boolean;
                  blur: number;
                  brightness: number;
                  contrast: number;
                  enabled: boolean;
                  equalization: boolean;
                  flip: boolean;
                  height: number;
                  hue: number;
                  kodachrome: boolean;
                  negative: boolean;
                  pixelate: number;
                  polaroid: boolean;
                  return: boolean;
                  saturation: number;
                  sepia: boolean;
                  sharpness: number;
                  technicolor: boolean;
                  vintage: boolean;
                  width: number;
              }

              Properties

              Properties

              autoBrightness: boolean

              apply auto-brighness

              -
              blur: number

              range: 0 (no blur) to N (blur radius in pixels)

              -
              brightness: number

              range: -1 (darken) to 1 (lighten)

              -
              contrast: number

              range: -1 (reduce contrast) to 1 (increase contrast)

              -
              enabled: boolean

              are image filters enabled?

              -
              equalization: boolean

              perform image histogram equalization

              +
              blur: number

              range: 0 (no blur) to N (blur radius in pixels)

              +
              brightness: number

              range: -1 (darken) to 1 (lighten)

              +
              contrast: number

              range: -1 (reduce contrast) to 1 (increase contrast)

              +
              enabled: boolean

              are image filters enabled?

              +
              equalization: boolean

              perform image histogram equalization

              • equalization is performed on input as a whole and detected face before its passed for further analysis
              -
              flip: boolean

              flip input as mirror image

              -
              height: number

              resize input height

              +
              flip: boolean

              flip input as mirror image

              +
              height: number

              resize input height

              • if both width and height are set to 0, there is no resizing
              • if just one is set, second one is scaled automatically
              • if both are set, values are used as-is
              -
              hue: number

              range: 0 (no change) to 360 (hue rotation in degrees)

              -
              kodachrome: boolean

              image kodachrome colors

              -
              negative: boolean

              image negative

              -
              pixelate: number

              range: 0 (no pixelate) to N (number of pixels to pixelate)

              -
              polaroid: boolean

              image polaroid camera effect

              -
              return: boolean

              return processed canvas imagedata in result

              -
              saturation: number

              range: -1 (reduce saturation) to 1 (increase saturation)

              -
              sepia: boolean

              image sepia colors

              -
              sharpness: number

              range: 0 (no sharpening) to 1 (maximum sharpening)

              -
              technicolor: boolean

              image technicolor colors

              -
              vintage: boolean

              image vintage colors

              -
              width: number

              resize input width

              +
              hue: number

              range: 0 (no change) to 360 (hue rotation in degrees)

              +
              kodachrome: boolean

              image kodachrome colors

              +
              negative: boolean

              image negative

              +
              pixelate: number

              range: 0 (no pixelate) to N (number of pixels to pixelate)

              +
              polaroid: boolean

              image polaroid camera effect

              +
              return: boolean

              return processed canvas imagedata in result

              +
              saturation: number

              range: -1 (reduce saturation) to 1 (increase saturation)

              +
              sepia: boolean

              image sepia colors

              +
              sharpness: number

              range: 0 (no sharpening) to 1 (maximum sharpening)

              +
              technicolor: boolean

              image technicolor colors

              +
              vintage: boolean

              image vintage colors

              +
              width: number

              resize input width

              • if both width and height are set to 0, there is no resizing
              • if just one is set, second one is scaled automatically
              • if both are set, values are used as-is
              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/GenericConfig.html b/typedoc/interfaces/GenericConfig.html index 195be68d..882c2c95 100644 --- a/typedoc/interfaces/GenericConfig.html +++ b/typedoc/interfaces/GenericConfig.html @@ -1,4 +1,4 @@ -GenericConfig | @vladmandic/human - v3.2.0

              Interface GenericConfig

              Generic config type inherited by all module types

              +GenericConfig | @vladmandic/human - v3.2.1

              Interface GenericConfig

              Generic config type inherited by all module types

              interface GenericConfig {
                  enabled: boolean;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled modelPath skipFrames @@ -9,4 +9,4 @@ for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/GestureConfig.html b/typedoc/interfaces/GestureConfig.html index 7fda63b9..eebc8627 100644 --- a/typedoc/interfaces/GestureConfig.html +++ b/typedoc/interfaces/GestureConfig.html @@ -1,4 +1,4 @@ -GestureConfig | @vladmandic/human - v3.2.0

              Interface GestureConfig

              Controlls gesture detection

              -
              interface GestureConfig {
                  enabled: boolean;
              }

              Properties

              enabled +GestureConfig | @vladmandic/human - v3.2.1

              Interface GestureConfig

              Controlls gesture detection

              +
              interface GestureConfig {
                  enabled: boolean;
              }

              Properties

              Properties

              enabled: boolean

              is gesture detection enabled?

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/HandConfig.html b/typedoc/interfaces/HandConfig.html index 52bca2ca..7fd5c7e3 100644 --- a/typedoc/interfaces/HandConfig.html +++ b/typedoc/interfaces/HandConfig.html @@ -1,5 +1,5 @@ -HandConfig | @vladmandic/human - v3.2.0

              Interface HandConfig

              Configures all hand detection specific options

              -
              interface HandConfig {
                  detector: {
                      modelPath?: string;
                  };
                  enabled: boolean;
                  iouThreshold: number;
                  landmarks: boolean;
                  maxDetected: number;
                  minConfidence: number;
                  modelPath: string;
                  rotation: boolean;
                  skeleton: {
                      modelPath?: string;
                  };
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              detector +HandConfig | @vladmandic/human - v3.2.1

              Interface HandConfig

              Configures all hand detection specific options

              +
              interface HandConfig {
                  detector: {
                      modelPath?: string;
                  };
                  enabled: boolean;
                  iouThreshold: number;
                  landmarks: boolean;
                  maxDetected: number;
                  minConfidence: number;
                  modelPath: string;
                  rotation: boolean;
                  skeleton: {
                      modelPath?: string;
                  };
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              Properties

              detector: {
                  modelPath?: string;
              }

              Type declaration

              • Optional modelPath?: string

                path to hand detector model json

                -
              enabled: boolean

              is module enabled?

              +
              enabled: boolean

              is module enabled?

              iouThreshold: number

              minimum overlap between two detected hands before one is discarded

              -
              landmarks: boolean

              should hand landmarks be detected or just return detected hand box

              -
              maxDetected: number

              maximum number of detected hands

              -
              minConfidence: number

              minimum confidence for a detected hand before results are discarded

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              landmarks: boolean

              should hand landmarks be detected or just return detected hand box

              +
              maxDetected: number

              maximum number of detected hands

              +
              minConfidence: number

              minimum confidence for a detected hand before results are discarded

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              rotation: boolean

              should hand rotation correction be performed after hand detection?

              -
              skeleton: {
                  modelPath?: string;
              }

              Type declaration

              • Optional modelPath?: string

                path to hand skeleton model json

                -
              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable +

              skeleton: {
                  modelPath?: string;
              }

              Type declaration

              • Optional modelPath?: string

                path to hand skeleton model json

                +
              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/HandResult.html b/typedoc/interfaces/HandResult.html index 75d95d23..f87ac166 100644 --- a/typedoc/interfaces/HandResult.html +++ b/typedoc/interfaces/HandResult.html @@ -1,4 +1,4 @@ -HandResult | @vladmandic/human - v3.2.0

              Interface HandResult

              Hand results

              +HandResult | @vladmandic/human - v3.2.1

              Interface HandResult

              Hand results

              interface HandResult {
                  annotations: Record<Finger, Point[]>;
                  box: Box;
                  boxRaw: Box;
                  boxScore: number;
                  fingerScore: number;
                  id: number;
                  keypoints: Point[];
                  label: HandType;
                  landmarks: Record<Finger, {
                      curl: FingerCurl;
                      direction: FingerDirection;
                  }>;
                  score: number;
              }

              Properties

              annotations box boxRaw @@ -19,4 +19,4 @@
              label: HandType

              detected hand class

              landmarks: Record<Finger, {
                  curl: FingerCurl;
                  direction: FingerDirection;
              }>

              detected hand parts annotated with part gestures

              Type declaration

              score: number

              hand overal score

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/ModelInfo.html b/typedoc/interfaces/ModelInfo.html index aca9cd20..2981f61f 100644 --- a/typedoc/interfaces/ModelInfo.html +++ b/typedoc/interfaces/ModelInfo.html @@ -1,7 +1,7 @@ -ModelInfo | @vladmandic/human - v3.2.0

              Interface ModelInfo

              interface ModelInfo {
                  inCache: boolean;
                  name: string;
                  sizeDesired: number;
                  sizeFromManifest: number;
                  sizeLoadedWeights: number;
                  url: string;
              }

              Properties

              inCache +ModelInfo | @vladmandic/human - v3.2.1

              Interface ModelInfo

              interface ModelInfo {
                  inCache: boolean;
                  name: string;
                  sizeDesired: number;
                  sizeFromManifest: number;
                  sizeLoadedWeights: number;
                  url: string;
              }

              Properties

              inCache: boolean
              name: string
              sizeDesired: number
              sizeFromManifest: number
              sizeLoadedWeights: number
              url: string
              \ No newline at end of file +

              Properties

              inCache: boolean
              name: string
              sizeDesired: number
              sizeFromManifest: number
              sizeLoadedWeights: number
              url: string
              \ No newline at end of file diff --git a/typedoc/interfaces/ObjectConfig.html b/typedoc/interfaces/ObjectConfig.html index b14a0ab2..d18cb768 100644 --- a/typedoc/interfaces/ObjectConfig.html +++ b/typedoc/interfaces/ObjectConfig.html @@ -1,5 +1,5 @@ -ObjectConfig | @vladmandic/human - v3.2.0

              Interface ObjectConfig

              Configures all object detection specific options

              -
              interface ObjectConfig {
                  enabled: boolean;
                  iouThreshold: number;
                  maxDetected: number;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled +ObjectConfig | @vladmandic/human - v3.2.1

              Interface ObjectConfig

              Configures all object detection specific options

              +
              interface ObjectConfig {
                  enabled: boolean;
                  iouThreshold: number;
                  maxDetected: number;
                  minConfidence: number;
                  modelPath: string;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled: boolean

              is module enabled?

              iouThreshold: number

              minimum overlap between two detected objects before one is discarded

              -
              maxDetected: number

              maximum number of detected objects

              -
              minConfidence: number

              minimum confidence for a detected objects before results are discarded

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              maxDetected: number

              maximum number of detected objects

              +
              minConfidence: number

              minimum confidence for a detected objects before results are discarded

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/ObjectResult.html b/typedoc/interfaces/ObjectResult.html index 10837b0b..ee463a42 100644 --- a/typedoc/interfaces/ObjectResult.html +++ b/typedoc/interfaces/ObjectResult.html @@ -1,4 +1,4 @@ -ObjectResult | @vladmandic/human - v3.2.0

              Interface ObjectResult

              Object results

              +ObjectResult | @vladmandic/human - v3.2.1

              Interface ObjectResult

              Object results

              interface ObjectResult {
                  box: Box;
                  boxRaw: Box;
                  class: number;
                  id: number;
                  label: ObjectType;
                  score: number;
              }

              Properties

              box boxRaw class @@ -11,4 +11,4 @@
              id: number

              object id

              label: ObjectType

              detected object class name

              score: number

              object detection score

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/PersonResult.html b/typedoc/interfaces/PersonResult.html index 2fec0a60..e8c900a8 100644 --- a/typedoc/interfaces/PersonResult.html +++ b/typedoc/interfaces/PersonResult.html @@ -1,4 +1,4 @@ -PersonResult | @vladmandic/human - v3.2.0

              Interface PersonResult

              Person getter

              +PersonResult | @vladmandic/human - v3.2.1

              Interface PersonResult

              Person getter

              • Triggers combining all individual results into a virtual person object
              @@ -16,4 +16,4 @@
              gestures: GestureResult[]

              detected gestures specific to this person

              hands: {
                  left: null | HandResult;
                  right: null | HandResult;
              }

              left and right hand results that belong to this person

              Type declaration

              id: number

              person id

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/Result.html b/typedoc/interfaces/Result.html index 523433ae..dfb8f939 100644 --- a/typedoc/interfaces/Result.html +++ b/typedoc/interfaces/Result.html @@ -1,4 +1,4 @@ -Result | @vladmandic/human - v3.2.0

              Interface Result

              Result interface definition for Human library

              +Result | @vladmandic/human - v3.2.1

              Interface Result

              Result interface definition for Human library

              Contains all possible detection results

              interface Result {
                  body: BodyResult[];
                  canvas?: null | AnyCanvas;
                  error: null | string;
                  face: FaceResult[];
                  gesture: GestureResult[];
                  hand: HandResult[];
                  height: number;
                  object: ObjectResult[];
                  performance: Record<string, number>;
                  persons: PersonResult[];
                  timestamp: number;
                  width: number;
              }

              Properties

              body canvas? @@ -24,4 +24,4 @@
              persons: PersonResult[]

              getter property that returns unified persons object

              timestamp: number

              timestamp of detection representing the milliseconds elapsed since the UNIX epoch

              width: number

              Resolution width

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/SegmentationConfig.html b/typedoc/interfaces/SegmentationConfig.html index 489b8167..e5627438 100644 --- a/typedoc/interfaces/SegmentationConfig.html +++ b/typedoc/interfaces/SegmentationConfig.html @@ -1,9 +1,9 @@ -SegmentationConfig | @vladmandic/human - v3.2.0

              Interface SegmentationConfig

              Configures all body segmentation module +SegmentationConfig | @vladmandic/human - v3.2.1

              Interface SegmentationConfig

              Configures all body segmentation module removes background from input containing person if segmentation is enabled it will run as preprocessing task before any other model alternatively leave it disabled and use it on-demand using human.segmentation method which can remove background or replace it with user-provided background

              -
              interface SegmentationConfig {
                  enabled: boolean;
                  mode: SegmentationEnum;
                  modelPath: string;
                  ratio: number;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              interface SegmentationConfig {
                  enabled: boolean;
                  mode: SegmentationEnum;
                  modelPath: string;
                  ratio: number;
                  skipFrames: number;
                  skipTime: number;
              }

              Hierarchy

              Properties

              enabled mode modelPath ratio @@ -11,10 +11,10 @@ skipTime

              Properties

              enabled: boolean

              is module enabled?

              possible rvm segmentation mode

              -
              modelPath: string

              path to model json file (relative to modelBasePath

              +
              modelPath: string

              path to model json file (relative to modelBasePath

              ratio: number

              downsample ratio, adjust to reflect approximately how much of input is taken by body

              -
              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable +

              skipFrames: number

              how many max frames to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              skipTime: number

              how many max milliseconds to go without re-running model if cached results are acceptable for two-phase models such as face and hand caching applies to bounding boxes detection only

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/WebCamConfig.html b/typedoc/interfaces/WebCamConfig.html index 7eece962..2f8f2b53 100644 --- a/typedoc/interfaces/WebCamConfig.html +++ b/typedoc/interfaces/WebCamConfig.html @@ -1,4 +1,4 @@ -WebCamConfig | @vladmandic/human - v3.2.0

              Interface WebCamConfig

              WebCam configuration

              +WebCamConfig | @vladmandic/human - v3.2.1

              Interface WebCamConfig

              WebCam configuration

              interface WebCamConfig {
                  crop: boolean;
                  debug: boolean;
                  element: undefined | string | HTMLVideoElement;
                  height: number;
                  id?: string;
                  mode: "front" | "back";
                  width: number;
              }

              Properties

              crop debug element @@ -18,4 +18,4 @@
              id?: string

              deviceId of the video device to use

              mode: "front" | "back"

              use front or back camera

              width: number

              desired webcam width

              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/interfaces/models.KernelOps.html b/typedoc/interfaces/models.KernelOps.html index ad6eca06..545901a7 100644 --- a/typedoc/interfaces/models.KernelOps.html +++ b/typedoc/interfaces/models.KernelOps.html @@ -1,5 +1,5 @@ -KernelOps | @vladmandic/human - v3.2.0
              interface KernelOps {
                  missing: string[];
                  name: string;
                  ops: string[];
                  url: string;
              }

              Properties

              missing +KernelOps | @vladmandic/human - v3.2.1
              interface KernelOps {
                  missing: string[];
                  name: string;
                  ops: string[];
                  url: string;
              }

              Properties

              Properties

              missing: string[]
              name: string
              ops: string[]
              url: string
              \ No newline at end of file +

              Properties

              missing: string[]
              name: string
              ops: string[]
              url: string
              \ No newline at end of file diff --git a/typedoc/interfaces/models.ModelStats.html b/typedoc/interfaces/models.ModelStats.html index 2c9a6746..ef0d9972 100644 --- a/typedoc/interfaces/models.ModelStats.html +++ b/typedoc/interfaces/models.ModelStats.html @@ -1,4 +1,4 @@ -ModelStats | @vladmandic/human - v3.2.0

              structure that holds global stats for currently loaded models

              +ModelStats | @vladmandic/human - v3.2.1

              structure that holds global stats for currently loaded models

              interface ModelStats {
                  modelStats: ModelInfo[];
                  numDefinedModels: number;
                  numLoadedModels: number;
                  percentageLoaded: number;
                  totalSizeFromManifest: number;
                  totalSizeLoading: number;
                  totalSizeWeights: number;
              }

              Properties

              modelStats: ModelInfo[]
              numDefinedModels: number
              numLoadedModels: number
              percentageLoaded: number
              totalSizeFromManifest: number
              totalSizeLoading: number
              totalSizeWeights: number
              \ No newline at end of file +

              Properties

              modelStats: ModelInfo[]
              numDefinedModels: number
              numLoadedModels: number
              percentageLoaded: number
              totalSizeFromManifest: number
              totalSizeLoading: number
              totalSizeWeights: number
              \ No newline at end of file diff --git a/typedoc/modules/Tensor.html b/typedoc/modules/Tensor.html index 6c25dbef..acb8670c 100644 --- a/typedoc/modules/Tensor.html +++ b/typedoc/modules/Tensor.html @@ -1,2 +1,2 @@ -Tensor | @vladmandic/human - v3.2.0

              Namespace Tensor

              Explict reexport of main @tensorflow/tfjs types

              -
              \ No newline at end of file +Tensor | @vladmandic/human - v3.2.1

              Namespace Tensor

              Explict reexport of main @tensorflow/tfjs types

              +
              \ No newline at end of file diff --git a/typedoc/modules/draw.html b/typedoc/modules/draw.html index 685a4284..604ab997 100644 --- a/typedoc/modules/draw.html +++ b/typedoc/modules/draw.html @@ -1,4 +1,4 @@ -draw | @vladmandic/human - v3.2.0

              Namespace draw

              Class Human as default export

              +draw | @vladmandic/human - v3.2.1
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/modules/match.html b/typedoc/modules/match.html index 22f3a84f..992d2e77 100644 --- a/typedoc/modules/match.html +++ b/typedoc/modules/match.html @@ -1,7 +1,7 @@ -match | @vladmandic/human - v3.2.0

              Namespace match

              Class Human as default export

              +match | @vladmandic/human - v3.2.1
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/modules/models.html b/typedoc/modules/models.html index 517fa342..b15380a3 100644 --- a/typedoc/modules/models.html +++ b/typedoc/modules/models.html @@ -1,6 +1,6 @@ -models | @vladmandic/human - v3.2.0

              Namespace models

              Class Human as default export

              +models | @vladmandic/human - v3.2.1
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/types/AnyCanvas.html b/typedoc/types/AnyCanvas.html index da7deb05..304f3db9 100644 --- a/typedoc/types/AnyCanvas.html +++ b/typedoc/types/AnyCanvas.html @@ -1,2 +1,2 @@ -AnyCanvas | @vladmandic/human - v3.2.0
              \ No newline at end of file +AnyCanvas | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/AnyImage.html b/typedoc/types/AnyImage.html index 405699f4..7b3e624b 100644 --- a/typedoc/types/AnyImage.html +++ b/typedoc/types/AnyImage.html @@ -1,2 +1,2 @@ -AnyImage | @vladmandic/human - v3.2.0
              \ No newline at end of file +AnyImage | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/AnyVideo.html b/typedoc/types/AnyVideo.html index 13047668..1b8385f5 100644 --- a/typedoc/types/AnyVideo.html +++ b/typedoc/types/AnyVideo.html @@ -1,2 +1,2 @@ -AnyVideo | @vladmandic/human - v3.2.0
              \ No newline at end of file +AnyVideo | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/BackendEnum.html b/typedoc/types/BackendEnum.html index 5f14bd02..7aeb7032 100644 --- a/typedoc/types/BackendEnum.html +++ b/typedoc/types/BackendEnum.html @@ -1,2 +1,2 @@ -BackendEnum | @vladmandic/human - v3.2.0

              Type alias BackendEnum

              BackendEnum: "" | "cpu" | "wasm" | "webgl" | "humangl" | "tensorflow" | "webgpu"

              Possible TensorFlow backends

              -
              \ No newline at end of file +BackendEnum | @vladmandic/human - v3.2.1

              Type alias BackendEnum

              BackendEnum: "" | "cpu" | "wasm" | "webgl" | "humangl" | "tensorflow" | "webgpu"

              Possible TensorFlow backends

              +
              \ No newline at end of file diff --git a/typedoc/types/BodyAnnotation.html b/typedoc/types/BodyAnnotation.html index 6c32152d..5280c953 100644 --- a/typedoc/types/BodyAnnotation.html +++ b/typedoc/types/BodyAnnotation.html @@ -1 +1 @@ -BodyAnnotation | @vladmandic/human - v3.2.0
              \ No newline at end of file +BodyAnnotation | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/BodyAnnotationBlazePose.html b/typedoc/types/BodyAnnotationBlazePose.html index 646dc006..59dcd609 100644 --- a/typedoc/types/BodyAnnotationBlazePose.html +++ b/typedoc/types/BodyAnnotationBlazePose.html @@ -1 +1 @@ -BodyAnnotationBlazePose | @vladmandic/human - v3.2.0

              Type alias BodyAnnotationBlazePose

              BodyAnnotationBlazePose: "leftLeg" | "rightLeg" | "torso" | "leftArm" | "rightArm" | "leftEye" | "rightEye" | "mouth"
              \ No newline at end of file +BodyAnnotationBlazePose | @vladmandic/human - v3.2.1

              Type alias BodyAnnotationBlazePose

              BodyAnnotationBlazePose: "leftLeg" | "rightLeg" | "torso" | "leftArm" | "rightArm" | "leftEye" | "rightEye" | "mouth"
              \ No newline at end of file diff --git a/typedoc/types/BodyAnnotationEfficientPose.html b/typedoc/types/BodyAnnotationEfficientPose.html index 5e861fb5..bd0c124a 100644 --- a/typedoc/types/BodyAnnotationEfficientPose.html +++ b/typedoc/types/BodyAnnotationEfficientPose.html @@ -1 +1 @@ -BodyAnnotationEfficientPose | @vladmandic/human - v3.2.0

              Type alias BodyAnnotationEfficientPose

              BodyAnnotationEfficientPose: "leftLeg" | "rightLeg" | "torso" | "leftArm" | "rightArm" | "head"
              \ No newline at end of file +BodyAnnotationEfficientPose | @vladmandic/human - v3.2.1

              Type alias BodyAnnotationEfficientPose

              BodyAnnotationEfficientPose: "leftLeg" | "rightLeg" | "torso" | "leftArm" | "rightArm" | "head"
              \ No newline at end of file diff --git a/typedoc/types/BodyGesture.html b/typedoc/types/BodyGesture.html index c59918b5..0f7d8591 100644 --- a/typedoc/types/BodyGesture.html +++ b/typedoc/types/BodyGesture.html @@ -1,2 +1,2 @@ -BodyGesture | @vladmandic/human - v3.2.0

              Type alias BodyGesture

              BodyGesture: `leaning ${"left" | "right"}` | `raise ${"left" | "right"} hand` | "i give up"

              body gesture type

              -
              \ No newline at end of file +BodyGesture | @vladmandic/human - v3.2.1

              Type alias BodyGesture

              BodyGesture: `leaning ${"left" | "right"}` | `raise ${"left" | "right"} hand` | "i give up"

              body gesture type

              +
              \ No newline at end of file diff --git a/typedoc/types/BodyLandmark.html b/typedoc/types/BodyLandmark.html index 1883c907..e5469e58 100644 --- a/typedoc/types/BodyLandmark.html +++ b/typedoc/types/BodyLandmark.html @@ -1 +1 @@ -BodyLandmark | @vladmandic/human - v3.2.0
              \ No newline at end of file +BodyLandmark | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/BodyLandmarkBlazePose.html b/typedoc/types/BodyLandmarkBlazePose.html index 94bffb55..7d87f033 100644 --- a/typedoc/types/BodyLandmarkBlazePose.html +++ b/typedoc/types/BodyLandmarkBlazePose.html @@ -1 +1 @@ -BodyLandmarkBlazePose | @vladmandic/human - v3.2.0

              Type alias BodyLandmarkBlazePose

              BodyLandmarkBlazePose: "nose" | "leftEyeInside" | "leftEye" | "leftEyeOutside" | "rightEyeInside" | "rightEye" | "rightEyeOutside" | "leftEar" | "rightEar" | "leftMouth" | "rightMouth" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftPinky" | "rightPinky" | "leftIndex" | "rightIndex" | "leftThumb" | "rightThumb" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle" | "leftHeel" | "rightHeel" | "leftFoot" | "rightFoot" | "bodyCenter" | "bodyTop" | "leftPalm" | "leftHand" | "rightPalm" | "rightHand"
              \ No newline at end of file +BodyLandmarkBlazePose | @vladmandic/human - v3.2.1

              Type alias BodyLandmarkBlazePose

              BodyLandmarkBlazePose: "nose" | "leftEyeInside" | "leftEye" | "leftEyeOutside" | "rightEyeInside" | "rightEye" | "rightEyeOutside" | "leftEar" | "rightEar" | "leftMouth" | "rightMouth" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftPinky" | "rightPinky" | "leftIndex" | "rightIndex" | "leftThumb" | "rightThumb" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle" | "leftHeel" | "rightHeel" | "leftFoot" | "rightFoot" | "bodyCenter" | "bodyTop" | "leftPalm" | "leftHand" | "rightPalm" | "rightHand"
              \ No newline at end of file diff --git a/typedoc/types/BodyLandmarkEfficientNet.html b/typedoc/types/BodyLandmarkEfficientNet.html index e64f0371..82528766 100644 --- a/typedoc/types/BodyLandmarkEfficientNet.html +++ b/typedoc/types/BodyLandmarkEfficientNet.html @@ -1 +1 @@ -BodyLandmarkEfficientNet | @vladmandic/human - v3.2.0

              Type alias BodyLandmarkEfficientNet

              BodyLandmarkEfficientNet: "head" | "neck" | "rightShoulder" | "rightElbow" | "rightWrist" | "chest" | "leftShoulder" | "leftElbow" | "leftWrist" | "bodyCenter" | "rightHip" | "rightKnee" | "rightAnkle" | "leftHip" | "leftKnee" | "leftAnkle"
              \ No newline at end of file +BodyLandmarkEfficientNet | @vladmandic/human - v3.2.1

              Type alias BodyLandmarkEfficientNet

              BodyLandmarkEfficientNet: "head" | "neck" | "rightShoulder" | "rightElbow" | "rightWrist" | "chest" | "leftShoulder" | "leftElbow" | "leftWrist" | "bodyCenter" | "rightHip" | "rightKnee" | "rightAnkle" | "leftHip" | "leftKnee" | "leftAnkle"
              \ No newline at end of file diff --git a/typedoc/types/BodyLandmarkMoveNet.html b/typedoc/types/BodyLandmarkMoveNet.html index b4945c89..d161b81d 100644 --- a/typedoc/types/BodyLandmarkMoveNet.html +++ b/typedoc/types/BodyLandmarkMoveNet.html @@ -1 +1 @@ -BodyLandmarkMoveNet | @vladmandic/human - v3.2.0

              Type alias BodyLandmarkMoveNet

              BodyLandmarkMoveNet: "nose" | "leftEye" | "rightEye" | "leftEar" | "rightEar" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle"
              \ No newline at end of file +BodyLandmarkMoveNet | @vladmandic/human - v3.2.1

              Type alias BodyLandmarkMoveNet

              BodyLandmarkMoveNet: "nose" | "leftEye" | "rightEye" | "leftEar" | "rightEar" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle"
              \ No newline at end of file diff --git a/typedoc/types/BodyLandmarkPoseNet.html b/typedoc/types/BodyLandmarkPoseNet.html index 7079dda8..4d2aef5e 100644 --- a/typedoc/types/BodyLandmarkPoseNet.html +++ b/typedoc/types/BodyLandmarkPoseNet.html @@ -1 +1 @@ -BodyLandmarkPoseNet | @vladmandic/human - v3.2.0

              Type alias BodyLandmarkPoseNet

              BodyLandmarkPoseNet: "nose" | "leftEye" | "rightEye" | "leftEar" | "rightEar" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle"
              \ No newline at end of file +BodyLandmarkPoseNet | @vladmandic/human - v3.2.1

              Type alias BodyLandmarkPoseNet

              BodyLandmarkPoseNet: "nose" | "leftEye" | "rightEye" | "leftEar" | "rightEar" | "leftShoulder" | "rightShoulder" | "leftElbow" | "rightElbow" | "leftWrist" | "rightWrist" | "leftHip" | "rightHip" | "leftKnee" | "rightKnee" | "leftAnkle" | "rightAnkle"
              \ No newline at end of file diff --git a/typedoc/types/Box.html b/typedoc/types/Box.html index c589e569..89017766 100644 --- a/typedoc/types/Box.html +++ b/typedoc/types/Box.html @@ -1,2 +1,2 @@ -Box | @vladmandic/human - v3.2.0
              \ No newline at end of file +Box | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/Emotion.html b/typedoc/types/Emotion.html index 2c49fff6..5f6fc5d9 100644 --- a/typedoc/types/Emotion.html +++ b/typedoc/types/Emotion.html @@ -1 +1 @@ -Emotion | @vladmandic/human - v3.2.0
              \ No newline at end of file +Emotion | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/Events.html b/typedoc/types/Events.html index c20368d7..9b7c08a3 100644 --- a/typedoc/types/Events.html +++ b/typedoc/types/Events.html @@ -1,4 +1,4 @@ -Events | @vladmandic/human - v3.2.0

              Type alias Events

              Events: "create" | "load" | "image" | "result" | "warmup" | "error"

              Events dispatched by human.events

              +Events | @vladmandic/human - v3.2.1

              Type alias Events

              Events: "create" | "load" | "image" | "result" | "warmup" | "error"

              Events dispatched by human.events

              • create: triggered when Human object is instantiated
              • load: triggered when models are loaded (explicitly or on-demand)
              • @@ -6,4 +6,4 @@
              • result: triggered when detection is complete
              • warmup: triggered when warmup is complete
              -
              \ No newline at end of file +
              \ No newline at end of file diff --git a/typedoc/types/ExternalCanvas.html b/typedoc/types/ExternalCanvas.html index 80a49e6d..2ab58e8b 100644 --- a/typedoc/types/ExternalCanvas.html +++ b/typedoc/types/ExternalCanvas.html @@ -1,2 +1,2 @@ -ExternalCanvas | @vladmandic/human - v3.2.0
              \ No newline at end of file +ExternalCanvas | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/FaceGesture.html b/typedoc/types/FaceGesture.html index 79ef01e8..a857097a 100644 --- a/typedoc/types/FaceGesture.html +++ b/typedoc/types/FaceGesture.html @@ -1,2 +1,2 @@ -FaceGesture | @vladmandic/human - v3.2.0

              Type alias FaceGesture

              FaceGesture: `facing ${"left" | "center" | "right"}` | `blink ${"left" | "right"} eye` | `mouth ${number}% open` | `head ${"up" | "down"}`

              face gesture type

              -
              \ No newline at end of file +FaceGesture | @vladmandic/human - v3.2.1

              Type alias FaceGesture

              FaceGesture: `facing ${"left" | "center" | "right"}` | `blink ${"left" | "right"} eye` | `mouth ${number}% open` | `head ${"up" | "down"}`

              face gesture type

              +
              \ No newline at end of file diff --git a/typedoc/types/FaceLandmark.html b/typedoc/types/FaceLandmark.html index b54b5e14..8111d603 100644 --- a/typedoc/types/FaceLandmark.html +++ b/typedoc/types/FaceLandmark.html @@ -1 +1 @@ -FaceLandmark | @vladmandic/human - v3.2.0

              Type alias FaceLandmark

              FaceLandmark: "leftEye" | "rightEye" | "nose" | "mouth" | "leftEar" | "rightEar" | "symmetryLine" | "silhouette" | "lipsUpperOuter" | "lipsLowerOuter" | "lipsUpperInner" | "lipsLowerInner" | "rightEyeUpper0" | "rightEyeLower0" | "rightEyeUpper1" | "rightEyeLower1" | "rightEyeUpper2" | "rightEyeLower2" | "rightEyeLower3" | "rightEyebrowUpper" | "rightEyebrowLower" | "rightEyeIris" | "leftEyeUpper0" | "leftEyeLower0" | "leftEyeUpper1" | "leftEyeLower1" | "leftEyeUpper2" | "leftEyeLower2" | "leftEyeLower3" | "leftEyebrowUpper" | "leftEyebrowLower" | "leftEyeIris" | "midwayBetweenEyes" | "noseTip" | "noseBottom" | "noseRightCorner" | "noseLeftCorner" | "rightCheek" | "leftCheek"
              \ No newline at end of file +FaceLandmark | @vladmandic/human - v3.2.1

              Type alias FaceLandmark

              FaceLandmark: "leftEye" | "rightEye" | "nose" | "mouth" | "leftEar" | "rightEar" | "symmetryLine" | "silhouette" | "lipsUpperOuter" | "lipsLowerOuter" | "lipsUpperInner" | "lipsLowerInner" | "rightEyeUpper0" | "rightEyeLower0" | "rightEyeUpper1" | "rightEyeLower1" | "rightEyeUpper2" | "rightEyeLower2" | "rightEyeLower3" | "rightEyebrowUpper" | "rightEyebrowLower" | "rightEyeIris" | "leftEyeUpper0" | "leftEyeLower0" | "leftEyeUpper1" | "leftEyeLower1" | "leftEyeUpper2" | "leftEyeLower2" | "leftEyeLower3" | "leftEyebrowUpper" | "leftEyebrowLower" | "leftEyeIris" | "midwayBetweenEyes" | "noseTip" | "noseBottom" | "noseRightCorner" | "noseLeftCorner" | "rightCheek" | "leftCheek"
              \ No newline at end of file diff --git a/typedoc/types/Finger.html b/typedoc/types/Finger.html index 751cb01d..620f0397 100644 --- a/typedoc/types/Finger.html +++ b/typedoc/types/Finger.html @@ -1 +1 @@ -Finger | @vladmandic/human - v3.2.0
              \ No newline at end of file +Finger | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/FingerCurl.html b/typedoc/types/FingerCurl.html index 0992ed7c..90ca7116 100644 --- a/typedoc/types/FingerCurl.html +++ b/typedoc/types/FingerCurl.html @@ -1 +1 @@ -FingerCurl | @vladmandic/human - v3.2.0
              \ No newline at end of file +FingerCurl | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/FingerDirection.html b/typedoc/types/FingerDirection.html index 34fefa67..59a703f7 100644 --- a/typedoc/types/FingerDirection.html +++ b/typedoc/types/FingerDirection.html @@ -1 +1 @@ -FingerDirection | @vladmandic/human - v3.2.0

              Type alias FingerDirection

              FingerDirection: "verticalUp" | "verticalDown" | "horizontalLeft" | "horizontalRight" | "diagonalUpRight" | "diagonalUpLeft" | "diagonalDownRight" | "diagonalDownLeft"
              \ No newline at end of file +FingerDirection | @vladmandic/human - v3.2.1

              Type alias FingerDirection

              FingerDirection: "verticalUp" | "verticalDown" | "horizontalLeft" | "horizontalRight" | "diagonalUpRight" | "diagonalUpLeft" | "diagonalDownRight" | "diagonalDownLeft"
              \ No newline at end of file diff --git a/typedoc/types/Gender.html b/typedoc/types/Gender.html index b90a075d..97d1bd0a 100644 --- a/typedoc/types/Gender.html +++ b/typedoc/types/Gender.html @@ -1 +1 @@ -Gender | @vladmandic/human - v3.2.0
              \ No newline at end of file +Gender | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/GestureResult.html b/typedoc/types/GestureResult.html index 10b96fd2..ffef34a5 100644 --- a/typedoc/types/GestureResult.html +++ b/typedoc/types/GestureResult.html @@ -1,7 +1,7 @@ -GestureResult | @vladmandic/human - v3.2.0

              Type alias GestureResult

              GestureResult: {
                  face: number;
                  gesture: FaceGesture;
              } | {
                  gesture: IrisGesture;
                  iris: number;
              } | {
                  body: number;
                  gesture: BodyGesture;
              } | {
                  gesture: HandGesture;
                  hand: number;
              }

              Gesture combined results +GestureResult | @vladmandic/human - v3.2.1

              Type alias GestureResult

              GestureResult: {
                  face: number;
                  gesture: FaceGesture;
              } | {
                  gesture: IrisGesture;
                  iris: number;
              } | {
                  body: number;
                  gesture: BodyGesture;
              } | {
                  gesture: HandGesture;
                  hand: number;
              }

              Gesture combined results Each result has:

              • part: part name and number where gesture was detected: face, iris, body, hand
              • gesture: gesture detected
              -

              Type declaration

              Type declaration

              Type declaration

              Type declaration

              \ No newline at end of file +

              Type declaration

              Type declaration

              Type declaration

              Type declaration

              \ No newline at end of file diff --git a/typedoc/types/HandGesture.html b/typedoc/types/HandGesture.html index 0ac705a0..8af5e565 100644 --- a/typedoc/types/HandGesture.html +++ b/typedoc/types/HandGesture.html @@ -1,2 +1,2 @@ -HandGesture | @vladmandic/human - v3.2.0

              Type alias HandGesture

              HandGesture: `${"thumb" | "index" | "middle" | "ring" | "pinky"} forward` | `${"thumb" | "index" | "middle" | "ring" | "pinky"} up` | "victory" | "thumbs up"

              hand gesture type

              -
              \ No newline at end of file +HandGesture | @vladmandic/human - v3.2.1

              Type alias HandGesture

              HandGesture: `${"thumb" | "index" | "middle" | "ring" | "pinky"} forward` | `${"thumb" | "index" | "middle" | "ring" | "pinky"} up` | "victory" | "thumbs up"

              hand gesture type

              +
              \ No newline at end of file diff --git a/typedoc/types/HandType.html b/typedoc/types/HandType.html index 403dee35..36648b9f 100644 --- a/typedoc/types/HandType.html +++ b/typedoc/types/HandType.html @@ -1 +1 @@ -HandType | @vladmandic/human - v3.2.0
              \ No newline at end of file +HandType | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/ImageObjects.html b/typedoc/types/ImageObjects.html index 08487788..ab2fa3df 100644 --- a/typedoc/types/ImageObjects.html +++ b/typedoc/types/ImageObjects.html @@ -1,2 +1,2 @@ -ImageObjects | @vladmandic/human - v3.2.0
              \ No newline at end of file +ImageObjects | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/Input.html b/typedoc/types/Input.html index 7a631741..6ef3b8de 100644 --- a/typedoc/types/Input.html +++ b/typedoc/types/Input.html @@ -1,2 +1,2 @@ -Input | @vladmandic/human - v3.2.0
              \ No newline at end of file +Input | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/IrisGesture.html b/typedoc/types/IrisGesture.html index e02e5692..1211e0bd 100644 --- a/typedoc/types/IrisGesture.html +++ b/typedoc/types/IrisGesture.html @@ -1,2 +1,2 @@ -IrisGesture | @vladmandic/human - v3.2.0

              Type alias IrisGesture

              IrisGesture: "facing center" | `looking ${"left" | "right" | "up" | "down"}` | "looking center"

              iris gesture type

              -
              \ No newline at end of file +IrisGesture | @vladmandic/human - v3.2.1

              Type alias IrisGesture

              IrisGesture: "facing center" | `looking ${"left" | "right" | "up" | "down"}` | "looking center"

              iris gesture type

              +
              \ No newline at end of file diff --git a/typedoc/types/ObjectType.html b/typedoc/types/ObjectType.html index 834dc66c..0e73361d 100644 --- a/typedoc/types/ObjectType.html +++ b/typedoc/types/ObjectType.html @@ -1 +1 @@ -ObjectType | @vladmandic/human - v3.2.0

              Type alias ObjectType

              ObjectType: "person" | "bicycle" | "car" | "motorcycle" | "airplane" | "bus" | "train" | "truck" | "boat" | "traffic light" | "fire hydrant" | "stop sign" | "parking meter" | "bench" | "bird" | "cat" | "dog" | "horse" | "sheep" | "cow" | "elephant" | "bear" | "zebra" | "giraffe" | "backpack" | "umbrella" | "handbag" | "tie" | "suitcase" | "frisbee" | "skis" | "snowboard" | "sports ball" | "kite" | "baseball bat" | "baseball glove" | "skateboard" | "surfboard" | "tennis racket" | "bottle" | "wine glass" | "cup" | "fork" | "knife" | "spoon" | "bowl" | "banana" | "apple" | "sandwich" | "orange" | "broccoli" | "carrot" | "hot dog" | "pizza" | "donut" | "cake" | "chair" | "couch" | "potted plant" | "bed" | "dining table" | "toilet" | "tv" | "laptop" | "mouse" | "remote" | "keyboard" | "cell phone" | "microwave" | "oven" | "toaster" | "sink" | "refrigerator" | "book" | "clock" | "vase" | "scissors" | "teddy bear" | "hair drier" | "toothbrush"
              \ No newline at end of file +ObjectType | @vladmandic/human - v3.2.1

              Type alias ObjectType

              ObjectType: "person" | "bicycle" | "car" | "motorcycle" | "airplane" | "bus" | "train" | "truck" | "boat" | "traffic light" | "fire hydrant" | "stop sign" | "parking meter" | "bench" | "bird" | "cat" | "dog" | "horse" | "sheep" | "cow" | "elephant" | "bear" | "zebra" | "giraffe" | "backpack" | "umbrella" | "handbag" | "tie" | "suitcase" | "frisbee" | "skis" | "snowboard" | "sports ball" | "kite" | "baseball bat" | "baseball glove" | "skateboard" | "surfboard" | "tennis racket" | "bottle" | "wine glass" | "cup" | "fork" | "knife" | "spoon" | "bowl" | "banana" | "apple" | "sandwich" | "orange" | "broccoli" | "carrot" | "hot dog" | "pizza" | "donut" | "cake" | "chair" | "couch" | "potted plant" | "bed" | "dining table" | "toilet" | "tv" | "laptop" | "mouse" | "remote" | "keyboard" | "cell phone" | "microwave" | "oven" | "toaster" | "sink" | "refrigerator" | "book" | "clock" | "vase" | "scissors" | "teddy bear" | "hair drier" | "toothbrush"
              \ No newline at end of file diff --git a/typedoc/types/Point.html b/typedoc/types/Point.html index c754385b..ffe08b0c 100644 --- a/typedoc/types/Point.html +++ b/typedoc/types/Point.html @@ -1,2 +1,2 @@ -Point | @vladmandic/human - v3.2.0
              \ No newline at end of file +Point | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/Race.html b/typedoc/types/Race.html index 20194777..ef71de66 100644 --- a/typedoc/types/Race.html +++ b/typedoc/types/Race.html @@ -1 +1 @@ -Race | @vladmandic/human - v3.2.0
              \ No newline at end of file +Race | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/SegmentationEnum.html b/typedoc/types/SegmentationEnum.html index c37a7629..4632e116 100644 --- a/typedoc/types/SegmentationEnum.html +++ b/typedoc/types/SegmentationEnum.html @@ -1,2 +1,2 @@ -SegmentationEnum | @vladmandic/human - v3.2.0

              Type alias SegmentationEnum

              SegmentationEnum: "default" | "alpha" | "foreground" | "state"

              Possible segmentation model behavior

              -
              \ No newline at end of file +SegmentationEnum | @vladmandic/human - v3.2.1

              Type alias SegmentationEnum

              SegmentationEnum: "default" | "alpha" | "foreground" | "state"

              Possible segmentation model behavior

              +
              \ No newline at end of file diff --git a/typedoc/types/Tensor1D.html b/typedoc/types/Tensor1D.html index 0cdce2cd..06eadae1 100644 --- a/typedoc/types/Tensor1D.html +++ b/typedoc/types/Tensor1D.html @@ -1,2 +1,2 @@ -Tensor1D | @vladmandic/human - v3.2.0

              Type alias Tensor1D

              Tensor1D: Tensor<R1>

              Doclink

              Tensor

              -
              \ No newline at end of file +Tensor1D | @vladmandic/human - v3.2.1

              Type alias Tensor1D

              Tensor1D: Tensor<R1>

              Doclink

              Tensor

              +
              \ No newline at end of file diff --git a/typedoc/types/Tensor2D.html b/typedoc/types/Tensor2D.html index ad27d0bc..2f21f384 100644 --- a/typedoc/types/Tensor2D.html +++ b/typedoc/types/Tensor2D.html @@ -1,2 +1,2 @@ -Tensor2D | @vladmandic/human - v3.2.0

              Type alias Tensor2D

              Tensor2D: Tensor<R2>

              Doclink

              Tensor

              -
              \ No newline at end of file +Tensor2D | @vladmandic/human - v3.2.1

              Type alias Tensor2D

              Tensor2D: Tensor<R2>

              Doclink

              Tensor

              +
              \ No newline at end of file diff --git a/typedoc/types/Tensor3D.html b/typedoc/types/Tensor3D.html index 6d025b47..901ccb2a 100644 --- a/typedoc/types/Tensor3D.html +++ b/typedoc/types/Tensor3D.html @@ -1,2 +1,2 @@ -Tensor3D | @vladmandic/human - v3.2.0

              Type alias Tensor3D

              Tensor3D: Tensor<R3>

              Doclink

              Tensor

              -
              \ No newline at end of file +Tensor3D | @vladmandic/human - v3.2.1

              Type alias Tensor3D

              Tensor3D: Tensor<R3>

              Doclink

              Tensor

              +
              \ No newline at end of file diff --git a/typedoc/types/Tensor4D.html b/typedoc/types/Tensor4D.html index 2e45db82..77823bbb 100644 --- a/typedoc/types/Tensor4D.html +++ b/typedoc/types/Tensor4D.html @@ -1,2 +1,2 @@ -Tensor4D | @vladmandic/human - v3.2.0

              Type alias Tensor4D

              Tensor4D: Tensor<R4>

              Doclink

              Tensor

              -
              \ No newline at end of file +Tensor4D | @vladmandic/human - v3.2.1

              Type alias Tensor4D

              Tensor4D: Tensor<R4>

              Doclink

              Tensor

              +
              \ No newline at end of file diff --git a/typedoc/types/TensorLike.html b/typedoc/types/TensorLike.html index 0b63725e..ce514ff1 100644 --- a/typedoc/types/TensorLike.html +++ b/typedoc/types/TensorLike.html @@ -1,2 +1,2 @@ -TensorLike | @vladmandic/human - v3.2.0

              Type alias TensorLike

              TensorLike: TypedArray | number | boolean | string | RecursiveArray<number | number[] | TypedArray> | RecursiveArray<boolean> | RecursiveArray<string> | Uint8Array[]

              Docalias

              TypedArray|Array

              -
              \ No newline at end of file +TensorLike | @vladmandic/human - v3.2.1

              Type alias TensorLike

              TensorLike: TypedArray | number | boolean | string | RecursiveArray<number | number[] | TypedArray> | RecursiveArray<boolean> | RecursiveArray<string> | Uint8Array[]

              Docalias

              TypedArray|Array

              +
              \ No newline at end of file diff --git a/typedoc/types/WarmupEnum.html b/typedoc/types/WarmupEnum.html index 23b40888..1dbd41bd 100644 --- a/typedoc/types/WarmupEnum.html +++ b/typedoc/types/WarmupEnum.html @@ -1,2 +1,2 @@ -WarmupEnum | @vladmandic/human - v3.2.0
              \ No newline at end of file +WarmupEnum | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/match.Descriptor.html b/typedoc/types/match.Descriptor.html index 2dd7f544..bf38191f 100644 --- a/typedoc/types/match.Descriptor.html +++ b/typedoc/types/match.Descriptor.html @@ -1,2 +1,2 @@ -Descriptor | @vladmandic/human - v3.2.0
              \ No newline at end of file +Descriptor | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/types/match.MatchOptions.html b/typedoc/types/match.MatchOptions.html index 8cc745f4..1bd0a782 100644 --- a/typedoc/types/match.MatchOptions.html +++ b/typedoc/types/match.MatchOptions.html @@ -1 +1 @@ -MatchOptions | @vladmandic/human - v3.2.0

              Type alias MatchOptions

              MatchOptions: {
                  max?: number;
                  min?: number;
                  multiplier?: number;
                  order?: number;
                  threshold?: number;
              } | undefined

              Type declaration

              • Optional max?: number
              • Optional min?: number
              • Optional multiplier?: number
              • Optional order?: number
              • Optional threshold?: number
              \ No newline at end of file +MatchOptions | @vladmandic/human - v3.2.1

              Type alias MatchOptions

              MatchOptions: {
                  max?: number;
                  min?: number;
                  multiplier?: number;
                  order?: number;
                  threshold?: number;
              } | undefined

              Type declaration

              • Optional max?: number
              • Optional min?: number
              • Optional multiplier?: number
              • Optional order?: number
              • Optional threshold?: number
              \ No newline at end of file diff --git a/typedoc/variables/defaults.html b/typedoc/variables/defaults.html index b6b89511..18ffdd76 100644 --- a/typedoc/variables/defaults.html +++ b/typedoc/variables/defaults.html @@ -1,4 +1,4 @@ -defaults | @vladmandic/human - v3.2.0

              Variable defaultsConst

              defaults: Config = ...
              \ No newline at end of file diff --git a/typedoc/variables/draw.options.html b/typedoc/variables/draw.options.html index 355e4b8c..cff48653 100644 --- a/typedoc/variables/draw.options.html +++ b/typedoc/variables/draw.options.html @@ -1,2 +1,2 @@ -options | @vladmandic/human - v3.2.0
              \ No newline at end of file +options | @vladmandic/human - v3.2.1
              \ No newline at end of file diff --git a/typedoc/variables/env-1.html b/typedoc/variables/env-1.html index 689778f1..1bcda0c3 100644 --- a/typedoc/variables/env-1.html +++ b/typedoc/variables/env-1.html @@ -1 +1 @@ -env | @vladmandic/human - v3.2.0
              \ No newline at end of file +env | @vladmandic/human - v3.2.1
              \ No newline at end of file